@antv/g2 5.1.14 → 5.1.15-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/g2.lite.min.js +1 -1
- package/dist/g2.min.js +1 -1
- package/esm/animation/growInX.js +1 -1
- package/esm/animation/growInX.js.map +1 -1
- package/esm/animation/growInY.js +1 -1
- package/esm/animation/growInY.js.map +1 -1
- package/esm/animation/morphing.js +8 -4
- package/esm/animation/morphing.js.map +1 -1
- package/esm/animation/scaleInY.js +2 -5
- package/esm/animation/scaleInY.js.map +1 -1
- package/esm/animation/waveIn.js +2 -1
- package/esm/animation/waveIn.js.map +1 -1
- package/esm/api/utils.js +5 -3
- package/esm/api/utils.js.map +1 -1
- package/esm/component/title.js +2 -1
- package/esm/component/title.js.map +1 -1
- package/esm/index.d.ts +2 -0
- package/esm/interaction/index.d.ts +1 -0
- package/esm/interaction/index.js +1 -0
- package/esm/interaction/index.js.map +1 -1
- package/esm/interaction/legendFilter.d.ts +1 -0
- package/esm/interaction/legendFilter.js +6 -0
- package/esm/interaction/legendFilter.js.map +1 -1
- package/esm/interaction/scrollbarFilter.js +5 -1
- package/esm/interaction/scrollbarFilter.js.map +1 -1
- package/esm/interaction/sliderFilter.d.ts +1 -1
- package/esm/interaction/sliderFilter.js +19 -2
- package/esm/interaction/sliderFilter.js.map +1 -1
- package/esm/interaction/tooltip.js +2 -2
- package/esm/interaction/tooltip.js.map +1 -1
- package/esm/interaction/treemapDrillDown.d.ts +10 -0
- package/esm/interaction/treemapDrillDown.js +229 -0
- package/esm/interaction/treemapDrillDown.js.map +1 -0
- package/esm/interaction/utils.js +7 -6
- package/esm/interaction/utils.js.map +1 -1
- package/esm/lib/core.d.ts +2 -1
- package/esm/lib/core.js +2 -1
- package/esm/lib/core.js.map +1 -1
- package/esm/lib/std.d.ts +1 -0
- package/esm/mark/chord.js +0 -1
- package/esm/mark/chord.js.map +1 -1
- package/esm/mark/gauge.js +4 -1
- package/esm/mark/gauge.js.map +1 -1
- package/esm/mark/sankey.js +1 -1
- package/esm/mark/sankey.js.map +1 -1
- package/esm/mark/treemap.js +37 -57
- package/esm/mark/treemap.js.map +1 -1
- package/esm/mark/utils.d.ts +0 -5
- package/esm/mark/utils.js +0 -13
- package/esm/mark/utils.js.map +1 -1
- package/esm/runtime/plot.js +47 -35
- package/esm/runtime/plot.js.map +1 -1
- package/esm/runtime/types/common.d.ts +1 -1
- package/esm/shape/connector/connector.js +1 -1
- package/esm/shape/connector/connector.js.map +1 -1
- package/esm/shape/gauge/round.d.ts +3 -0
- package/esm/shape/gauge/round.js +40 -0
- package/esm/shape/gauge/round.js.map +1 -0
- package/esm/shape/image/image.js +1 -1
- package/esm/shape/index.d.ts +1 -0
- package/esm/shape/index.js +1 -0
- package/esm/shape/index.js.map +1 -1
- package/esm/shape/interval/color.js +1 -1
- package/esm/shape/interval/color.js.map +1 -1
- package/esm/shape/interval/funnel.js +1 -1
- package/esm/shape/interval/funnel.js.map +1 -1
- package/esm/shape/label/position/default.js +9 -9
- package/esm/shape/label/position/default.js.map +1 -1
- package/esm/shape/lineXY/line.js +1 -1
- package/esm/shape/lineXY/line.js.map +1 -1
- package/esm/shape/liquid/liquid.js +4 -4
- package/esm/shape/liquid/liquid.js.map +1 -1
- package/esm/shape/liquid/wave.js +1 -1
- package/esm/shape/liquid/wave.js.map +1 -1
- package/esm/shape/point/color.js +1 -0
- package/esm/shape/point/color.js.map +1 -1
- package/esm/shape/text/advance.js +2 -1
- package/esm/shape/text/advance.js.map +1 -1
- package/esm/shape/utils.js +2 -2
- package/esm/shape/utils.js.map +1 -1
- package/esm/theme/create.d.ts +2 -2
- package/esm/theme/create.js +2 -2
- package/esm/theme/create.js.map +1 -1
- package/esm/utils/marker.d.ts +1 -1
- package/esm/utils/marker.js +2 -2
- package/esm/utils/marker.js.map +1 -1
- package/esm/utils/treeDataTransform.d.ts +21 -0
- package/esm/utils/treeDataTransform.js +90 -0
- package/esm/utils/treeDataTransform.js.map +1 -0
- package/lib/animation/growInX.js +1 -1
- package/lib/animation/growInX.js.map +1 -1
- package/lib/animation/growInY.js +1 -1
- package/lib/animation/growInY.js.map +1 -1
- package/lib/animation/morphing.js +8 -4
- package/lib/animation/morphing.js.map +1 -1
- package/lib/animation/scaleInY.js +2 -5
- package/lib/animation/scaleInY.js.map +1 -1
- package/lib/animation/waveIn.js +2 -1
- package/lib/animation/waveIn.js.map +1 -1
- package/lib/api/utils.js +5 -3
- package/lib/api/utils.js.map +1 -1
- package/lib/component/title.js +2 -1
- package/lib/component/title.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/interaction/index.d.ts +1 -0
- package/lib/interaction/index.js +3 -1
- package/lib/interaction/index.js.map +1 -1
- package/lib/interaction/legendFilter.d.ts +1 -0
- package/lib/interaction/legendFilter.js +8 -1
- package/lib/interaction/legendFilter.js.map +1 -1
- package/lib/interaction/scrollbarFilter.js +5 -1
- package/lib/interaction/scrollbarFilter.js.map +1 -1
- package/lib/interaction/sliderFilter.d.ts +1 -1
- package/lib/interaction/sliderFilter.js +19 -2
- package/lib/interaction/sliderFilter.js.map +1 -1
- package/lib/interaction/tooltip.js +2 -2
- package/lib/interaction/tooltip.js.map +1 -1
- package/lib/interaction/treemapDrillDown.d.ts +10 -0
- package/lib/interaction/treemapDrillDown.js +233 -0
- package/lib/interaction/treemapDrillDown.js.map +1 -0
- package/lib/interaction/utils.js +7 -6
- package/lib/interaction/utils.js.map +1 -1
- package/lib/lib/core.d.ts +2 -1
- package/lib/lib/core.js +1 -0
- package/lib/lib/core.js.map +1 -1
- package/lib/lib/std.d.ts +1 -0
- package/lib/mark/chord.js +0 -1
- package/lib/mark/chord.js.map +1 -1
- package/lib/mark/gauge.js +4 -1
- package/lib/mark/gauge.js.map +1 -1
- package/lib/mark/sankey.js +1 -1
- package/lib/mark/sankey.js.map +1 -1
- package/lib/mark/treemap.js +36 -56
- package/lib/mark/treemap.js.map +1 -1
- package/lib/mark/utils.d.ts +0 -5
- package/lib/mark/utils.js +1 -15
- package/lib/mark/utils.js.map +1 -1
- package/lib/runtime/plot.js +46 -34
- package/lib/runtime/plot.js.map +1 -1
- package/lib/runtime/types/common.d.ts +1 -1
- package/lib/shape/connector/connector.js +1 -1
- package/lib/shape/connector/connector.js.map +1 -1
- package/lib/shape/gauge/round.d.ts +3 -0
- package/lib/shape/gauge/round.js +44 -0
- package/lib/shape/gauge/round.js.map +1 -0
- package/lib/shape/image/image.js +1 -1
- package/lib/shape/index.d.ts +1 -0
- package/lib/shape/index.js +3 -1
- package/lib/shape/index.js.map +1 -1
- package/lib/shape/interval/color.js +1 -1
- package/lib/shape/interval/color.js.map +1 -1
- package/lib/shape/interval/funnel.js +1 -1
- package/lib/shape/interval/funnel.js.map +1 -1
- package/lib/shape/label/position/default.js +9 -9
- package/lib/shape/label/position/default.js.map +1 -1
- package/lib/shape/lineXY/line.js +1 -1
- package/lib/shape/lineXY/line.js.map +1 -1
- package/lib/shape/liquid/liquid.js +4 -4
- package/lib/shape/liquid/liquid.js.map +1 -1
- package/lib/shape/liquid/wave.js +1 -1
- package/lib/shape/liquid/wave.js.map +1 -1
- package/lib/shape/point/color.js +1 -0
- package/lib/shape/point/color.js.map +1 -1
- package/lib/shape/text/advance.js +2 -1
- package/lib/shape/text/advance.js.map +1 -1
- package/lib/shape/utils.js +1 -1
- package/lib/shape/utils.js.map +1 -1
- package/lib/theme/create.d.ts +2 -2
- package/lib/theme/create.js +2 -2
- package/lib/theme/create.js.map +1 -1
- package/lib/utils/marker.d.ts +1 -1
- package/lib/utils/marker.js +2 -2
- package/lib/utils/marker.js.map +1 -1
- package/lib/utils/treeDataTransform.d.ts +21 -0
- package/lib/utils/treeDataTransform.js +94 -0
- package/lib/utils/treeDataTransform.js.map +1 -0
- package/package.json +15 -15
- package/src/animation/growInX.ts +1 -1
- package/src/animation/growInY.ts +1 -1
- package/src/animation/morphing.ts +7 -5
- package/src/animation/scaleInY.ts +2 -5
- package/src/animation/waveIn.ts +2 -1
- package/src/api/utils.ts +6 -3
- package/src/component/title.ts +4 -0
- package/src/interaction/index.ts +1 -0
- package/src/interaction/legendFilter.ts +8 -0
- package/src/interaction/scrollbarFilter.ts +4 -0
- package/src/interaction/sliderFilter.ts +21 -1
- package/src/interaction/tooltip.ts +3 -3
- package/src/interaction/treemapDrillDown.ts +282 -0
- package/src/interaction/utils.ts +8 -5
- package/src/lib/core.ts +2 -0
- package/src/mark/chord.ts +0 -1
- package/src/mark/gauge.ts +5 -1
- package/src/mark/sankey.ts +1 -1
- package/src/mark/treemap.ts +76 -123
- package/src/mark/utils.ts +0 -17
- package/src/runtime/plot.ts +82 -44
- package/src/runtime/types/common.ts +5 -1
- package/src/shape/connector/connector.ts +1 -1
- package/src/shape/gauge/round.ts +57 -0
- package/src/shape/image/image.ts +1 -1
- package/src/shape/index.ts +1 -0
- package/src/shape/interval/color.ts +1 -1
- package/src/shape/interval/funnel.ts +1 -1
- package/src/shape/label/position/default.ts +9 -9
- package/src/shape/lineXY/line.ts +1 -2
- package/src/shape/liquid/liquid.ts +4 -4
- package/src/shape/liquid/wave.ts +1 -1
- package/src/shape/point/color.ts +1 -0
- package/src/shape/text/advance.ts +3 -1
- package/src/shape/utils.ts +3 -2
- package/src/theme/create.ts +2 -2
- package/src/utils/marker.ts +2 -11
- package/src/utils/treeDataTransform.ts +153 -0
package/dist/g2.lite.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G2={})}(this,(function(t){"use strict";const e=()=>[["cartesian"]];e.props={};const n=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1},n=Object.assign(Object.assign({},e),t);return Object.assign(Object.assign({},n),(r=n.startAngle,i=n.endAngle,r%=2*Math.PI,i%=2*Math.PI,r<0&&(r=2*Math.PI+r),i<0&&(i=2*Math.PI+i),r>=i&&(i+=2*Math.PI),{startAngle:r,endAngle:i}));var r,i},r=t=>{const{startAngle:e,endAngle:r,innerRadius:i,outerRadius:o}=n(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",e,r,i,o]]};r.props={};const i=()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]];i.props={transform:!0};const o=t=>{const{startAngle:e,endAngle:n,innerRadius:i,outerRadius:o}=((t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)})(t);return[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:o})]};o.props={};const a=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)},s=t=>{const{startAngle:e,endAngle:n,innerRadius:i,outerRadius:o}=a(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:o})]};s.props={};const c=()=>[["parallel",0,1,0,1]];c.props={};const l=({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]];l.props={transform:!0};const u=t=>{const{startAngle:e=-Math.PI/2,endAngle:n=3*Math.PI/2,innerRadius:i=0,outerRadius:o=1}=t;return[["parallel",0,1,0,1],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:o})]};u.props={};const f=({value:t})=>e=>e.map((()=>t));f.props={};const h=({value:t})=>e=>e.map(t);h.props={};const d=({value:t})=>e=>e.map((e=>e[t]));d.props={};const p=({value:t})=>()=>t;p.props={};var g=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},m=function(t){return"function"==typeof t},y=function(t){return null==t},v={}.toString,b=function(t,e){return v.call(t)==="[object "+e+"]"},x=function(t){return Array.isArray?Array.isArray(t):b(t,"Array")},w=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e};var M=function(t){return"object"==typeof t&&null!==t},O=function(t){if(!M(t)||!b(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},E=function(t){if(x(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},k=function(t){if(x(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},S=function(t,e,n){if(!x(t)&&!O(t))return t;var r=n;return function(t,e){if(t)if(x(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(w(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break}(t,(function(t,n){r=e(r,t,n)})),r},A=function(t){return b(t,"String")};var _=function(t,e,n){return t<e?e:t>n?n:t},T=function(t){return b(t,"Number")},P=1e-5;function C(t,e,n){return void 0===n&&(n=P),Math.abs(t-e)<n}var N=function(t,e){if(x(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var o=t[i],a=m(e)?e(o):o[e];a>r&&(n=o,r=a)}return n}},L=function(t,e){if(x(t)){for(var n,r=1/0,i=0;i<t.length;i++){var o=t[i],a=m(e)?e(o):o[e];a<r&&(n=o,r=a)}return n}},j=function(t,e){return(t%e+e)%e},R=function(t){return y(t)?"":t.toString()},I=function(t){var e=R(t);return e.charAt(0).toLowerCase()+e.substring(1)};var B=function(t){var e=R(t);return e.charAt(0).toUpperCase()+e.substring(1)},D=function(t){return b(t,"Boolean")},F=function(t){return void 0===t},z=function(t){if("object"!=typeof t||null===t)return t;var e;if(x(t)){e=[];for(var n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=z(t[n]):e[n]=t[n]}else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=z(t[i]):e[i]=t[i];return e},G=z;function W(t,e,n){var r;return function(){var i=this,o=arguments,a=n&&!r;clearTimeout(r),r=setTimeout((function(){r=null,n||t.apply(i,o)}),e),a&&t.apply(i,o)}}function $(t){var e,n,r,i=t||1;function o(t,o){++e>i&&(r=n,a(1),++e),n[t]=o}function a(t){e=0,n=Object.create(null),t||(r=Object.create(null))}return a(),{clear:a,has:function(t){return void 0!==n[t]||void 0!==r[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=r[t])?(o(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:o(t,e)}}}function H(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(null==t)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function Y(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(H(e,i)){var o=e[i];null!==o&&O(o)?(O(t[i])||(t[i]={}),n<r?Y(t[i],o,n+1,r):t[i]=e[i]):x(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var V=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)Y(t,e[r]);return t},q=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(A(t)||A(e))return!1;if(g(t)||g(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=q(t[r],e[r]));r++);return n}if(M(t)||M(e)){var i=Object.keys(t),o=Object.keys(e);if(i.length!==o.length)return!1;for(n=!0,r=0;r<i.length&&(n=q(t[i[r]],e[i[r]]));r++);return n}return!1},U=q,X=function(t,e,n){for(var r=0,i=A(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},K=function(t,e){return S(t,(function(t,n,r){return e.includes(r)||(t[r]=n),t}),{})},Z=function(t,e,n){var r,i,o,a,s=0;n||(n={});var c=function(){s=!1===n.leading?0:Date.now(),r=null,a=t.apply(i,o),r||(i=o=null)},l=function(){var l=Date.now();s||!1!==n.leading||(s=l);var u=e-(l-s);return i=this,o=arguments,u<=0||u>e?(r&&(clearTimeout(r),r=null),s=l,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(c,u)),a};return l.cancel=function(){clearTimeout(r),s=0,r=i=o=null},l},Q=function(){},J=1e-6,tt="undefined"!=typeof Float32Array?Float32Array:Array;function et(){var t=new tt(9);return tt!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var nt=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=n[0],d=n[1],p=n[2],g=n[3],m=n[4],y=n[5],v=n[6],b=n[7],x=n[8];return t[0]=h*r+d*a+p*l,t[1]=h*i+d*s+p*u,t[2]=h*o+d*c+p*f,t[3]=g*r+m*a+y*l,t[4]=g*i+m*s+y*u,t[5]=g*o+m*c+y*f,t[6]=v*r+b*a+x*l,t[7]=v*i+b*s+x*u,t[8]=v*o+b*c+x*f,t};function rt(){var t=new tt(16);return tt!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function it(t){var e=new tt(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function ot(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function at(t,e,n,r,i,o,a,s,c,l,u,f,h,d,p,g,m){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=c,t[8]=l,t[9]=u,t[10]=f,t[11]=h,t[12]=d,t[13]=p,t[14]=g,t[15]=m,t}function st(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ct(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function lt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],m=e[14],y=e[15],v=n*s-r*a,b=n*c-i*a,x=n*l-o*a,w=r*c-i*s,M=r*l-o*s,O=i*l-o*c,E=u*g-f*p,k=u*m-h*p,S=u*y-d*p,A=f*m-h*g,_=f*y-d*g,T=h*y-d*m,P=v*T-b*_+x*A+w*S-M*k+O*E;return P?(P=1/P,t[0]=(s*T-c*_+l*A)*P,t[1]=(i*_-r*T-o*A)*P,t[2]=(g*O-m*M+y*w)*P,t[3]=(h*M-f*O-d*w)*P,t[4]=(c*S-a*T-l*k)*P,t[5]=(n*T-i*S+o*k)*P,t[6]=(m*x-p*O-y*b)*P,t[7]=(u*O-h*x+d*b)*P,t[8]=(a*_-s*S+l*E)*P,t[9]=(r*S-n*_-o*E)*P,t[10]=(p*M-g*x+y*v)*P,t[11]=(f*x-u*M-d*v)*P,t[12]=(s*k-a*A-c*E)*P,t[13]=(n*A-r*k+i*E)*P,t[14]=(g*b-p*w-m*v)*P,t[15]=(u*w-f*b+h*v)*P,t):null}function ut(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],c=t[7],l=t[8],u=t[9],f=t[10],h=t[11],d=t[12],p=t[13],g=t[14],m=t[15];return(e*a-n*o)*(f*m-h*g)-(e*s-r*o)*(u*m-h*p)+(e*c-i*o)*(u*g-f*p)+(n*s-r*a)*(l*m-h*d)-(n*c-i*a)*(l*g-f*d)+(r*c-i*s)*(l*p-u*d)}function ft(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],g=e[12],m=e[13],y=e[14],v=e[15],b=n[0],x=n[1],w=n[2],M=n[3];return t[0]=b*r+x*s+w*f+M*g,t[1]=b*i+x*c+w*h+M*m,t[2]=b*o+x*l+w*d+M*y,t[3]=b*a+x*u+w*p+M*v,b=n[4],x=n[5],w=n[6],M=n[7],t[4]=b*r+x*s+w*f+M*g,t[5]=b*i+x*c+w*h+M*m,t[6]=b*o+x*l+w*d+M*y,t[7]=b*a+x*u+w*p+M*v,b=n[8],x=n[9],w=n[10],M=n[11],t[8]=b*r+x*s+w*f+M*g,t[9]=b*i+x*c+w*h+M*m,t[10]=b*o+x*l+w*d+M*y,t[11]=b*a+x*u+w*p+M*v,b=n[12],x=n[13],w=n[14],M=n[15],t[12]=b*r+x*s+w*f+M*g,t[13]=b*i+x*c+w*h+M*m,t[14]=b*o+x*l+w*d+M*y,t[15]=b*a+x*u+w*p+M*v,t}function ht(t,e,n){var r,i,o,a,s,c,l,u,f,h,d,p,g=n[0],m=n[1],y=n[2];return e===t?(t[12]=e[0]*g+e[4]*m+e[8]*y+e[12],t[13]=e[1]*g+e[5]*m+e[9]*y+e[13],t[14]=e[2]*g+e[6]*m+e[10]*y+e[14],t[15]=e[3]*g+e[7]*m+e[11]*y+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=f,t[9]=h,t[10]=d,t[11]=p,t[12]=r*g+s*m+f*y+e[12],t[13]=i*g+c*m+h*y+e[13],t[14]=o*g+l*m+d*y+e[14],t[15]=a*g+u*m+p*y+e[15]),t}function dt(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function pt(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],c=e[7],l=e[8],u=e[9],f=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+l*r,t[5]=a*i+u*r,t[6]=s*i+f*r,t[7]=c*i+h*r,t[8]=l*i-o*r,t[9]=u*i-a*r,t[10]=f*i-s*r,t[11]=h*i-c*r,t}function gt(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],c=e[3],l=e[8],u=e[9],f=e[10],h=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-l*r,t[1]=a*i-u*r,t[2]=s*i-f*r,t[3]=c*i-h*r,t[8]=o*r+l*i,t[9]=a*r+u*i,t[10]=s*r+f*i,t[11]=c*r+h*i,t}function mt(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function yt(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function vt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,c=i+i,l=o+o,u=r*s,f=r*c,h=r*l,d=i*c,p=i*l,g=o*l,m=a*s,y=a*c,v=a*l;return t[0]=1-(d+g),t[1]=f+v,t[2]=h-y,t[3]=0,t[4]=f-v,t[5]=1-(u+g),t[6]=p+m,t[7]=0,t[8]=h+y,t[9]=p-m,t[10]=1-(u+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function bt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function xt(t,e){var n=e[0],r=e[1],i=e[2],o=e[4],a=e[5],s=e[6],c=e[8],l=e[9],u=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(c,l,u),t}function wt(t,e){var n=new tt(3);xt(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,s=e[1]*i,c=e[2]*o,l=e[4]*r,u=e[5]*i,f=e[6]*o,h=e[8]*r,d=e[9]*i,p=e[10]*o,g=a+u+p,m=0;return g>0?(m=2*Math.sqrt(g+1),t[3]=.25*m,t[0]=(f-d)/m,t[1]=(h-c)/m,t[2]=(s-l)/m):a>u&&a>p?(m=2*Math.sqrt(1+a-u-p),t[3]=(f-d)/m,t[0]=.25*m,t[1]=(s+l)/m,t[2]=(h+c)/m):u>p?(m=2*Math.sqrt(1+u-a-p),t[3]=(h-c)/m,t[0]=(s+l)/m,t[1]=.25*m,t[2]=(f+d)/m):(m=2*Math.sqrt(1+p-a-u),t[3]=(s-l)/m,t[0]=(h+c)/m,t[1]=(f+d)/m,t[2]=.25*m),t}function Mt(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],c=e[3],l=o+o,u=a+a,f=s+s,h=o*l,d=o*u,p=o*f,g=a*u,m=a*f,y=s*f,v=c*l,b=c*u,x=c*f,w=r[0],M=r[1],O=r[2],E=i[0],k=i[1],S=i[2],A=(1-(g+y))*w,_=(d+x)*w,T=(p-b)*w,P=(d-x)*M,C=(1-(h+y))*M,N=(m+v)*M,L=(p+b)*O,j=(m-v)*O,R=(1-(h+g))*O;return t[0]=A,t[1]=_,t[2]=T,t[3]=0,t[4]=P,t[5]=C,t[6]=N,t[7]=0,t[8]=L,t[9]=j,t[10]=R,t[11]=0,t[12]=n[0]+E-(A*E+P*k+L*S),t[13]=n[1]+k-(_*E+C*k+j*S),t[14]=n[2]+S-(T*E+N*k+R*S),t[15]=1,t}function Ot(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,c=i+i,l=n*a,u=r*a,f=r*s,h=i*a,d=i*s,p=i*c,g=o*a,m=o*s,y=o*c;return t[0]=1-f-p,t[1]=u+y,t[2]=h-m,t[3]=0,t[4]=u-y,t[5]=1-l-p,t[6]=d+g,t[7]=0,t[8]=h+m,t[9]=d-g,t[10]=1-l-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Et(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}var kt=Et;function St(t,e,n,r,i,o,a){var s=1/(e-n),c=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*c,t[14]=(a+o)*l,t[15]=1,t}var At=St;function _t(t,e,n,r,i,o,a){var s=1/(e-n),c=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*c,t[14]=o*l,t[15]=1,t}function Tt(t,e,n,r){var i,o,a,s,c,l,u,f,h,d,p=e[0],g=e[1],m=e[2],y=r[0],v=r[1],b=r[2],x=n[0],w=n[1],M=n[2];return Math.abs(p-x)<J&&Math.abs(g-w)<J&&Math.abs(m-M)<J?st(t):(u=p-x,f=g-w,h=m-M,i=v*(h*=d=1/Math.hypot(u,f,h))-b*(f*=d),o=b*(u*=d)-y*h,a=y*f-v*u,(d=Math.hypot(i,o,a))?(i*=d=1/d,o*=d,a*=d):(i=0,o=0,a=0),s=f*a-h*o,c=h*i-u*a,l=u*o-f*i,(d=Math.hypot(s,c,l))?(s*=d=1/d,c*=d,l*=d):(s=0,c=0,l=0),t[0]=i,t[1]=s,t[2]=u,t[3]=0,t[4]=o,t[5]=c,t[6]=f,t[7]=0,t[8]=a,t[9]=l,t[10]=h,t[11]=0,t[12]=-(i*p+o*g+a*m),t[13]=-(s*p+c*g+l*m),t[14]=-(u*p+f*g+h*m),t[15]=1,t)}function Pt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}var Ct=ft,Nt=Pt,Lt=Object.freeze({__proto__:null,create:rt,clone:it,copy:ot,fromValues:function(t,e,n,r,i,o,a,s,c,l,u,f,h,d,p,g){var m=new tt(16);return m[0]=t,m[1]=e,m[2]=n,m[3]=r,m[4]=i,m[5]=o,m[6]=a,m[7]=s,m[8]=c,m[9]=l,m[10]=u,m[11]=f,m[12]=h,m[13]=d,m[14]=p,m[15]=g,m},set:at,identity:st,transpose:ct,invert:lt,adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],m=e[14],y=e[15];return t[0]=s*(h*y-d*m)-f*(c*y-l*m)+g*(c*d-l*h),t[1]=-(r*(h*y-d*m)-f*(i*y-o*m)+g*(i*d-o*h)),t[2]=r*(c*y-l*m)-s*(i*y-o*m)+g*(i*l-o*c),t[3]=-(r*(c*d-l*h)-s*(i*d-o*h)+f*(i*l-o*c)),t[4]=-(a*(h*y-d*m)-u*(c*y-l*m)+p*(c*d-l*h)),t[5]=n*(h*y-d*m)-u*(i*y-o*m)+p*(i*d-o*h),t[6]=-(n*(c*y-l*m)-a*(i*y-o*m)+p*(i*l-o*c)),t[7]=n*(c*d-l*h)-a*(i*d-o*h)+u*(i*l-o*c),t[8]=a*(f*y-d*g)-u*(s*y-l*g)+p*(s*d-l*f),t[9]=-(n*(f*y-d*g)-u*(r*y-o*g)+p*(r*d-o*f)),t[10]=n*(s*y-l*g)-a*(r*y-o*g)+p*(r*l-o*s),t[11]=-(n*(s*d-l*f)-a*(r*d-o*f)+u*(r*l-o*s)),t[12]=-(a*(f*m-h*g)-u*(s*m-c*g)+p*(s*h-c*f)),t[13]=n*(f*m-h*g)-u*(r*m-i*g)+p*(r*h-i*f),t[14]=-(n*(s*m-c*g)-a*(r*m-i*g)+p*(r*c-i*s)),t[15]=n*(s*h-c*f)-a*(r*h-i*f)+u*(r*c-i*s),t},determinant:ut,multiply:ft,translate:ht,scale:dt,rotate:function(t,e,n,r){var i,o,a,s,c,l,u,f,h,d,p,g,m,y,v,b,x,w,M,O,E,k,S,A,_=r[0],T=r[1],P=r[2],C=Math.hypot(_,T,P);return C<J?null:(_*=C=1/C,T*=C,P*=C,i=Math.sin(n),a=1-(o=Math.cos(n)),s=e[0],c=e[1],l=e[2],u=e[3],f=e[4],h=e[5],d=e[6],p=e[7],g=e[8],m=e[9],y=e[10],v=e[11],b=_*_*a+o,x=T*_*a+P*i,w=P*_*a-T*i,M=_*T*a-P*i,O=T*T*a+o,E=P*T*a+_*i,k=_*P*a+T*i,S=T*P*a-_*i,A=P*P*a+o,t[0]=s*b+f*x+g*w,t[1]=c*b+h*x+m*w,t[2]=l*b+d*x+y*w,t[3]=u*b+p*x+v*w,t[4]=s*M+f*O+g*E,t[5]=c*M+h*O+m*E,t[6]=l*M+d*O+y*E,t[7]=u*M+p*O+v*E,t[8]=s*k+f*S+g*A,t[9]=c*k+h*S+m*A,t[10]=l*k+d*S+y*A,t[11]=u*k+p*S+v*A,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:pt,rotateY:gt,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],c=e[3],l=e[4],u=e[5],f=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+l*r,t[1]=a*i+u*r,t[2]=s*i+f*r,t[3]=c*i+h*r,t[4]=l*i-o*r,t[5]=u*i-a*r,t[6]=f*i-s*r,t[7]=h*i-c*r,t},fromTranslation:mt,fromScaling:yt,fromRotation:function(t,e,n){var r,i,o,a=n[0],s=n[1],c=n[2],l=Math.hypot(a,s,c);return l<J?null:(a*=l=1/l,s*=l,c*=l,r=Math.sin(e),o=1-(i=Math.cos(e)),t[0]=a*a*o+i,t[1]=s*a*o+c*r,t[2]=c*a*o-s*r,t[3]=0,t[4]=a*s*o-c*r,t[5]=s*s*o+i,t[6]=c*s*o+a*r,t[7]=0,t[8]=a*c*o+s*r,t[9]=s*c*o-a*r,t[10]=c*c*o+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},fromXRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromYRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromZRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotationTranslation:vt,fromQuat2:function(t,e){var n=new tt(3),r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=r*r+i*i+o*o+a*a;return f>0?(n[0]=2*(s*a+u*r+c*o-l*i)/f,n[1]=2*(c*a+u*i+l*r-s*o)/f,n[2]=2*(l*a+u*o+s*i-c*r)/f):(n[0]=2*(s*a+u*r+c*o-l*i),n[1]=2*(c*a+u*i+l*r-s*o),n[2]=2*(l*a+u*o+s*i-c*r)),vt(t,e,n),t},getTranslation:bt,getScaling:xt,getRotation:wt,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],c=i+i,l=o+o,u=a+a,f=i*c,h=i*l,d=i*u,p=o*l,g=o*u,m=a*u,y=s*c,v=s*l,b=s*u,x=r[0],w=r[1],M=r[2];return t[0]=(1-(p+m))*x,t[1]=(h+b)*x,t[2]=(d-v)*x,t[3]=0,t[4]=(h-b)*w,t[5]=(1-(f+m))*w,t[6]=(g+y)*w,t[7]=0,t[8]=(d+v)*M,t[9]=(g-y)*M,t[10]=(1-(f+p))*M,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:Mt,fromQuat:Ot,frustum:function(t,e,n,r,i,o,a){var s=1/(n-e),c=1/(i-r),l=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*c,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*c,t[10]=(a+o)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*l,t[15]=0,t},perspectiveNO:Et,perspective:kt,perspectiveZO:function(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=i*o,t[14]=i*r*o):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),c=2/(a+s),l=2/(i+o);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(a-s)*c*.5,t[9]=(i-o)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},orthoNO:St,ortho:At,orthoZO:_t,lookAt:Tt,targetTo:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],c=r[1],l=r[2],u=i-n[0],f=o-n[1],h=a-n[2],d=u*u+f*f+h*h;d>0&&(u*=d=1/Math.sqrt(d),f*=d,h*=d);var p=c*h-l*f,g=l*u-s*h,m=s*f-c*u;return(d=p*p+g*g+m*m)>0&&(p*=d=1/Math.sqrt(d),g*=d,m*=d),t[0]=p,t[1]=g,t[2]=m,t[3]=0,t[4]=f*m-h*g,t[5]=h*p-u*m,t[6]=u*g-f*p,t[7]=0,t[8]=u,t[9]=f,t[10]=h,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t},str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},subtract:Pt,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},equals:function(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],c=t[6],l=t[7],u=t[8],f=t[9],h=t[10],d=t[11],p=t[12],g=t[13],m=t[14],y=t[15],v=e[0],b=e[1],x=e[2],w=e[3],M=e[4],O=e[5],E=e[6],k=e[7],S=e[8],A=e[9],_=e[10],T=e[11],P=e[12],C=e[13],N=e[14],L=e[15];return Math.abs(n-v)<=J*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(r-b)<=J*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-x)<=J*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-w)<=J*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-M)<=J*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(s-O)<=J*Math.max(1,Math.abs(s),Math.abs(O))&&Math.abs(c-E)<=J*Math.max(1,Math.abs(c),Math.abs(E))&&Math.abs(l-k)<=J*Math.max(1,Math.abs(l),Math.abs(k))&&Math.abs(u-S)<=J*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(f-A)<=J*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(h-_)<=J*Math.max(1,Math.abs(h),Math.abs(_))&&Math.abs(d-T)<=J*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(p-P)<=J*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(g-C)<=J*Math.max(1,Math.abs(g),Math.abs(C))&&Math.abs(m-N)<=J*Math.max(1,Math.abs(m),Math.abs(N))&&Math.abs(y-L)<=J*Math.max(1,Math.abs(y),Math.abs(L))},mul:Ct,sub:Nt});function jt(){var t=new tt(3);return tt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Rt(t){var e=new tt(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function It(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function Bt(t,e,n){var r=new tt(3);return r[0]=t,r[1]=e,r[2]=n,r}function Dt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Ft(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function zt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Gt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Wt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function $t(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function Ht(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Yt(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],c=n[2];return t[0]=i*c-o*s,t[1]=o*a-r*c,t[2]=r*s-i*a,t}function Vt(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function qt(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function Ut(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}function Xt(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(n-o)<=J*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=J*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=J*Math.max(1,Math.abs(i),Math.abs(s))}var Kt=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)},Zt=It;function Qt(){var t=new tt(4);return tt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Jt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}function te(){var t=new tt(4);return tt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function ee(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function ne(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],c=n[1],l=n[2],u=n[3];return t[0]=r*u+a*s+i*l-o*c,t[1]=i*u+a*c+o*s-r*l,t[2]=o*u+a*l+r*c-i*s,t[3]=a*u-r*s-i*c-o*l,t}function re(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function ie(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(n),c=Math.cos(n),l=Math.sin(r),u=Math.cos(r);return t[0]=o*c*u-a*s*l,t[1]=a*s*u+o*c*l,t[2]=a*c*l-o*s*u,t[3]=a*c*u+o*s*l,t}jt(),function(){var t=Qt()}();var oe=function(t,e,n,r){var i=new tt(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},ae=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},se=ne,ce=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t};jt(),Bt(1,0,0),Bt(0,1,0),te(),te(),et(),function(){var t,e=(t=new tt(2),tt!=Float32Array&&(t[0]=0,t[1]=0),t)}();var le=function(t,e){return le=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},le(t,e)};function ue(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}le(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var fe=function(){return fe=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},fe.apply(this,arguments)};function he(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function de(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function pe(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))}function ge(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function me(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function ye(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function ve(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function be(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}var xe={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function we(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Me={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Oe(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Me[e]===t.length-1&&"achlmqstvz".includes(e)}))}function Ee(t){return Oe(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function ke(t){return Ee(t)&&t.every((function(t){var e=t[0];return"ACLMQZ".includes(e)}))}function Se(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=Me[n]&&("m"===n&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,Me[n]))),Me[n]););}function Ae(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'+n[e]+'", expecting 0 or 1 at index '+e)}function _e(t){return t>=48&&t<=57||43===t||45===t||46===t}function Te(t){return t>=48&&t<=57}function Pe(t){var e,n=t.max,r=t.pathValue,i=t.index,o=i,a=!1,s=!1,c=!1,l=!1;if(o>=n)t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param';else if(43!==(e=r.charCodeAt(o))&&45!==e||(o+=1,e=r.charCodeAt(o)),Te(e)||46===e){if(46!==e){if(a=48===e,o+=1,e=r.charCodeAt(o),a&&o<n&&e&&Te(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;o<n&&Te(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(l=!0,o+=1;Te(r.charCodeAt(o));)o+=1,c=!0;e=r.charCodeAt(o)}if(101===e||69===e){if(l&&!s&&!c)return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid float exponent');if(o+=1,43!==(e=r.charCodeAt(o))&&45!==e||(o+=1),!(o<n&&Te(r.charCodeAt(o))))return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid integer exponent');for(;o<n&&Te(r.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(i,o)}else t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" is not a number'}function Ce(t){for(var e,n=t.pathValue,r=t.max;t.index<r&&(10===(e=n.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function Ne(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=Me[n[r].toLowerCase()];if(t.segmentStart=r,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,Ce(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?Pe(t):Ae(t),t.err.length)return;t.data.push(t.param),Ce(t),t.index<e&&44===n.charCodeAt(t.index)&&(t.index+=1,Ce(t))}if(t.index>=t.max)break;if(!_e(n.charCodeAt(t.index)))break}Se(t)}else Se(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var Le=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function je(t){if(Ee(t))return[].concat(t);var e=function(t){if(Oe(t))return[].concat(t);var e=new Le(t);for(Ce(e);e.index<e.max&&!e.err.length;)Ne(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,o=0;return e.map((function(t){var e,a=t.slice(1).map(Number),s=t[0],c=s.toUpperCase();if("M"===s)return n=a[0],r=a[1],i=n,o=r,["M",n,r];if(s!==c)switch(c){case"A":e=[c,a[0],a[1],a[2],a[3],a[4],a[5]+n,a[6]+r];break;case"V":e=[c,a[0]+r];break;case"H":e=[c,a[0]+n];break;default:var l=a.map((function(t,e){return t+(e%2?r:n)}));e=[c].concat(l)}else e=[c].concat(a);var u=e.length;switch(c){case"Z":n=i,r=o;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[u-2],r=e[u-1],"M"===c&&(i=n,o=r)}return e}))}function Re(t,e){var n=t[0],r=e.x1,i=e.y1,o=e.x2,a=e.y2,s=t.slice(1).map(Number),c=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)c=["L",t[1],i];else if("V"===n)c=["L",r,t[1]];else if("S"===n){var l=2*r-o,u=2*i-a;e.x1=l,e.y1=u,c=["C",l,u].concat(s)}else if("T"===n){var f=2*r-e.qx,h=2*i-e.qy;e.qx=f,e.qy=h,c=["Q",f,h].concat(s)}else if("Q"===n){var d=s[0],p=s[1];e.qx=d,e.qy=p}return c}function Ie(t){if(ke(t))return[].concat(t);for(var e=je(t),n=fe({},xe),r=0;r<e.length;r+=1){e[r]=Re(e[r],n);var i=e[r],o=i.length;n.x1=+i[o-2],n.y1=+i[o-1],n.x2=+i[o-4]||n.x1,n.y2=+i[o-3]||n.y1}return e}function Be(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function De(t,e,n,r,i,o,a,s,c,l){var u,f,h,d,p,g=t,m=e,y=n,v=r,b=s,x=c,w=120*Math.PI/180,M=Math.PI/180*(+i||0),O=[];if(l)f=l[0],h=l[1],d=l[2],p=l[3];else{g=(u=Be(g,m,-M)).x,m=u.y;var E=(g-(b=(u=Be(b,x,-M)).x))/2,k=(m-(x=u.y))/2,S=E*E/(y*y)+k*k/(v*v);S>1&&(y*=S=Math.sqrt(S),v*=S);var A=y*y,_=v*v,T=(o===a?-1:1)*Math.sqrt(Math.abs((A*_-A*k*k-_*E*E)/(A*k*k+_*E*E)));d=T*y*k/v+(g+b)/2,p=T*-v*E/y+(m+x)/2,f=Math.asin(((m-p)/v*Math.pow(10,9)>>0)/Math.pow(10,9)),h=Math.asin(((x-p)/v*Math.pow(10,9)>>0)/Math.pow(10,9)),f=g<d?Math.PI-f:f,h=b<d?Math.PI-h:h,f<0&&(f=2*Math.PI+f),h<0&&(h=2*Math.PI+h),a&&f>h&&(f-=2*Math.PI),!a&&h>f&&(h-=2*Math.PI)}var P=h-f;if(Math.abs(P)>w){var C=h,N=b,L=x;h=f+w*(a&&h>f?1:-1),O=De(b=d+y*Math.cos(h),x=p+v*Math.sin(h),y,v,i,0,a,N,L,[h,C,d,p])}P=h-f;var j=Math.cos(f),R=Math.sin(f),I=Math.cos(h),B=Math.sin(h),D=Math.tan(P/4),F=4/3*y*D,z=4/3*v*D,G=[g,m],W=[g+F*R,m-z*j],$=[b+F*B,x-z*I],H=[b,x];if(W[0]=2*G[0]-W[0],W[1]=2*G[1]-W[1],l)return W.concat($,H,O);for(var Y=[],V=0,q=(O=W.concat($,H,O)).length;V<q;V+=1)Y[V]=V%2?Be(O[V-1],O[V],M).y:Be(O[V],O[V+1],M).x;return Y}function Fe(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}var ze=function(t,e,n,r){return ve(ve([],Fe([t,e],[n,r],.5),!0),[n,r,n,r],!1)};function Ge(t,e){var n,r,i,o,a,s,c,l,u,f=t[0],h=t.slice(1).map(Number),d=h[0],p=h[1],g=e.x1,m=e.y1,y=e.x,v=e.y;switch("TQ".includes(f)||(e.qx=null,e.qy=null),f){case"M":return e.x=d,e.y=p,t;case"A":return n=[g,m].concat(h),["C"].concat(De(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=d,e.qy=p,n=[g,m].concat(h),["C"].concat((r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],c=n[5],[(l=1/3)*r+(u=2/3)*o,l*i+u*a,l*s+u*o,l*c+u*a,s,c]));case"L":return["C"].concat(ze(g,m,d,p));case"Z":return g===y&&m===v?["C",g,m,y,v,y,v]:["C"].concat(ze(g,m,y,v))}return t}function We(t,e){if(void 0===e&&(e=!1),function(t){return ke(t)&&t.every((function(t){var e=t[0];return"MC".includes(e)}))}(t)){var n=[].concat(t);return e?[n,[]]:n}for(var r,i,o=Ie(t),a=fe({},xe),s=[],c="",l=o.length,u=[],f=0;f<l;f+=1){o[f]&&(c=o[f][0]),s[f]=c;var h=Ge(o[f],a);o[f]=h,we(o,s,f),l=o.length,"Z"===c&&u.push(f),i=(r=o[f]).length,a.x1=+r[i-2],a.y1=+r[i-1],a.x2=+r[i-4]||a.x1,a.y2=+r[i-3]||a.y1}return e?[o,u]:o}function $e(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function He(t,e,n,r,i){var o=$e([t,e],[n,r]),a={x:0,y:0};if("number"==typeof i)if(i<=0)a={x:t,y:e};else if(i>=o)a={x:n,y:r};else{var s=Fe([t,e],[n,r],i/o);a={x:s[0],y:s[1]}}return{length:o,point:a,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function Ye(t,e){var n=t.x,r=t.y,i=e.x,o=e.y,a=n*i+r*o,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2)));return(n*o-r*i<0?-1:1)*Math.acos(a/s)}function Ve(t,e,n,r,i,o,a,s,c,l){var u=Math.abs,f=Math.sin,h=Math.cos,d=Math.sqrt,p=Math.PI,g=u(n),m=u(r),y=(i%360+360)%360*(p/180);if(t===s&&e===c)return{x:t,y:e};if(0===g||0===m)return He(t,e,s,c,l).point;var v=(t-s)/2,b=(e-c)/2,x={x:h(y)*v+f(y)*b,y:-f(y)*v+h(y)*b},w=Math.pow(x.x,2)/Math.pow(g,2)+Math.pow(x.y,2)/Math.pow(m,2);w>1&&(g*=d(w),m*=d(w));var M=(Math.pow(g,2)*Math.pow(m,2)-Math.pow(g,2)*Math.pow(x.y,2)-Math.pow(m,2)*Math.pow(x.x,2))/(Math.pow(g,2)*Math.pow(x.y,2)+Math.pow(m,2)*Math.pow(x.x,2)),O=(o!==a?1:-1)*d(M=M<0?0:M),E=O*(g*x.y/m),k=O*(-m*x.x/g),S=h(y)*E-f(y)*k+(t+s)/2,A=f(y)*E+h(y)*k+(e+c)/2,_={x:(x.x-E)/g,y:(x.y-k)/m},T=Ye({x:1,y:0},_),P=Ye(_,{x:(-x.x-E)/g,y:(-x.y-k)/m});!a&&P>0?P-=2*p:a&&P<0&&(P+=2*p);var C=T+(P%=2*p)*l,N=g*h(C),L=m*f(C);return{x:h(y)*N-f(y)*L+S,y:f(y)*N+h(y)*L+A}}function qe(t,e,n,r,i,o,a,s,c,l,u){var f,h=u.bbox,d=void 0===h||h,p=u.length,g=void 0===p||p,m=u.sampleSize,y=void 0===m?30:m,v="number"==typeof l,b=t,x=e,w=0,M=[b,x,w],O=[b,x],E={x:0,y:0},k=[{x:b,y:x}];v&&l<=0&&(E={x:b,y:x});for(var S=0;S<=y;S+=1){if(b=(f=Ve(t,e,n,r,i,o,a,s,c,S/y)).x,x=f.y,d&&k.push({x:b,y:x}),g&&(w+=$e(O,[b,x])),O=[b,x],v&&w>=l&&l>M[2]){var A=(w-l)/(w-M[2]);E={x:O[0]*(1-A)+M[0]*A,y:O[1]*(1-A)+M[1]*A}}M=[b,x,w]}return v&&l>=w&&(E={x:s,y:c}),{length:w,point:E,min:{x:Math.min.apply(null,k.map((function(t){return t.x}))),y:Math.min.apply(null,k.map((function(t){return t.y})))},max:{x:Math.max.apply(null,k.map((function(t){return t.x}))),y:Math.max.apply(null,k.map((function(t){return t.y})))}}}function Ue(t,e,n,r,i,o,a,s,c){var l=1-c;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*c*n+3*l*Math.pow(c,2)*i+Math.pow(c,3)*a,y:Math.pow(l,3)*e+3*Math.pow(l,2)*c*r+3*l*Math.pow(c,2)*o+Math.pow(c,3)*s}}function Xe(t,e,n,r,i,o,a,s,c,l){var u,f=l.bbox,h=void 0===f||f,d=l.length,p=void 0===d||d,g=l.sampleSize,m=void 0===g?10:g,y="number"==typeof c,v=t,b=e,x=0,w=[v,b,x],M=[v,b],O={x:0,y:0},E=[{x:v,y:b}];y&&c<=0&&(O={x:v,y:b});for(var k=0;k<=m;k+=1){if(v=(u=Ue(t,e,n,r,i,o,a,s,k/m)).x,b=u.y,h&&E.push({x:v,y:b}),p&&(x+=$e(M,[v,b])),M=[v,b],y&&x>=c&&c>w[2]){var S=(x-c)/(x-w[2]);O={x:M[0]*(1-S)+w[0]*S,y:M[1]*(1-S)+w[1]*S}}w=[v,b,x]}return y&&c>=x&&(O={x:a,y:s}),{length:x,point:O,min:{x:Math.min.apply(null,E.map((function(t){return t.x}))),y:Math.min.apply(null,E.map((function(t){return t.y})))},max:{x:Math.max.apply(null,E.map((function(t){return t.x}))),y:Math.max.apply(null,E.map((function(t){return t.y})))}}}function Ke(t,e,n,r,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*n+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*r+Math.pow(a,2)*o}}function Ze(t,e,n,r,i,o,a,s){var c,l=s.bbox,u=void 0===l||l,f=s.length,h=void 0===f||f,d=s.sampleSize,p=void 0===d?10:d,g="number"==typeof a,m=t,y=e,v=0,b=[m,y,v],x=[m,y],w={x:0,y:0},M=[{x:m,y:y}];g&&a<=0&&(w={x:m,y:y});for(var O=0;O<=p;O+=1){if(m=(c=Ke(t,e,n,r,i,o,O/p)).x,y=c.y,u&&M.push({x:m,y:y}),h&&(v+=$e(x,[m,y])),x=[m,y],g&&v>=a&&a>b[2]){var E=(v-a)/(v-b[2]);w={x:x[0]*(1-E)+b[0]*E,y:x[1]*(1-E)+b[1]*E}}b=[m,y,v]}return g&&a>=v&&(w={x:i,y:o}),{length:v,point:w,min:{x:Math.min.apply(null,M.map((function(t){return t.x}))),y:Math.min.apply(null,M.map((function(t){return t.y})))},max:{x:Math.max.apply(null,M.map((function(t){return t.x}))),y:Math.max.apply(null,M.map((function(t){return t.y})))}}}function Qe(t,e,n){for(var r,i,o,a,s,c,l,u,f,h=Ie(t),d="number"==typeof e,p=[],g=0,m=0,y=0,v=0,b=[],x=[],w=0,M={x:0,y:0},O=M,E=M,k=M,S=0,A=0,_=h.length;A<_;A+=1)p=(l="M"===(u=(f=h[A])[0]))?p:[g,m].concat(f.slice(1)),l?(O=M={x:y=f[1],y:v=f[2]},w=0,d&&e<.001&&(k=M)):"L"===u?(w=(r=He(p[0],p[1],p[2],p[3],(e||0)-S)).length,M=r.min,O=r.max,E=r.point):"A"===u?(w=(i=qe(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],(e||0)-S,n||{})).length,M=i.min,O=i.max,E=i.point):"C"===u?(w=(o=Xe(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],(e||0)-S,n||{})).length,M=o.min,O=o.max,E=o.point):"Q"===u?(w=(a=Ze(p[0],p[1],p[2],p[3],p[4],p[5],(e||0)-S,n||{})).length,M=a.min,O=a.max,E=a.point):"Z"===u&&(w=(s=He((p=[g,m,y,v])[0],p[1],p[2],p[3],(e||0)-S)).length,M=s.min,O=s.max,E=s.point),d&&S<e&&S+w>=e&&(k=E),x.push(O),b.push(M),S+=w,g=(c="Z"!==u?f.slice(-2):[y,v])[0],m=c[1];return d&&e>=S&&(k={x:g,y:m}),{length:S,point:k,min:{x:Math.min.apply(null,b.map((function(t){return t.x}))),y:Math.min.apply(null,b.map((function(t){return t.y})))},max:{x:Math.max.apply(null,x.map((function(t){return t.x}))),y:Math.max.apply(null,x.map((function(t){return t.y})))}}}function Je(t){return function(t){var e=0,n=0,r=0;return We(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var o=t.slice(1),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=o[5];return r=function(t,e,n,r,i,o,a,s){return 3*((s-e)*(n+i)-(a-t)*(r+o)+r*(t-i)-n*(e-o)+s*(i+t/3)-a*(o+e/3))/20}(e,n,a,s,c,l,u,f),i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}(t)>=0}function tn(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?Xe(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=Fe(n,r,e),s=Fe(r,i,e),c=Fe(i,o,e),l=Fe(a,s,e),u=Fe(s,c,e),f=Fe(l,u,e);return[["C"].concat(a,l,f),["C"].concat(u,c,o)]}(r):[t,t]:[t],l:i}}))}function en(t,e,n){var r=tn(t),i=tn(e),o=r.length,a=i.length,s=r.filter((function(t){return t.l})).length,c=i.filter((function(t){return t.l})).length,l=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,u=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/c||0,f=n||Math.max(o,a),h=[l,u],d=[f-o,f-a],p=0,g=[r,i].map((function(t,e){return t.l===f?t.map((function(t){return t.s})):t.map((function(t,n){return p=n&&d[e]&&t.l>=h[e],d[e]-=p?1:0,p?t.ss:[t.s]})).flat()}));return g[0].length===g[1].length?g:en(g[0],g[1],f)}function nn(t){var e=document.createElement("div");e.innerHTML=t;var n=e.childNodes[0];return n&&e.contains(n)&&e.removeChild(n),n}function rn(t,e){if(null!==t)return{type:"column",value:t,field:e}}function on(t,e){const n=rn(t,e);return Object.assign(Object.assign({},n),{inferred:!0})}function an(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function sn(t,e){const n=rn(t,e);return Object.assign(Object.assign({},n),{constant:!1})}function cn(t,e){const n=[];for(const r of t)n[r]=e;return n}function ln(t,e){const n=t[e];if(!n)return[null,null];const{value:r,field:i=null}=n;return[r,i]}function un(t,...e){for(const n of e){if("string"!=typeof n)return[n,null];{const[e,r]=ln(t,n);if(null!==e)return[e,r]}}return[null,null]}function fn(t){return!(t instanceof Date)&&"object"==typeof t}const hn=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;return void 0!==r?[t,e]:[t,V({},e,{encode:{y1:on(cn(t,0))}})]};function dn(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function pn(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function gn(t){let e,n,r;function i(t,r,i=0,o=t.length){if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<0?i=e+1:o=e}while(i<o)}return i}return 2!==t.length?(e=dn,n=(e,n)=>dn(t(e),n),r=(e,n)=>t(e)-n):(e=t===dn||t===pn?t:mn,n=t,r=t),{left:i,center:function(t,e,n=0,o=t.length){const a=i(t,e,n,o-1);return a>n&&r(t[a-1],e)>-r(t[a],e)?a-1:a},right:function(t,r,i=0,o=t.length){if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<=0?i=e+1:o=e}while(i<o)}return i}}}function mn(){return 0}function yn(t){return null===t?NaN:+t}hn.props={};const vn=gn(dn),bn=vn.right,xn=vn.left,wn=gn(yn).center;var Mn=bn;function On(t,e){let n=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&++n;else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(i=+i)>=i&&++n}return n}function En(t,e){const n=function(t,e){let n,r=0,i=0,o=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(n=e-i,i+=n/++r,o+=n*(e-i));else{let a=-1;for(let s of t)null!=(s=e(s,++a,t))&&(s=+s)>=s&&(n=s-i,i+=n/++r,o+=n*(s-i))}if(r>1)return o/(r-1)}(t,e);return n?Math.sqrt(n):n}function kn(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r<e&&(r=e)));else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(void 0===n?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}class Sn extends Map{constructor(t,e=_n){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(An(this,t))}has(t){return super.has(An(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){const r=e(n);t.has(r)&&(n=t.get(r),t.delete(r));return n}(this,t))}}function An({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function _n(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Tn(t){return t}function Pn(t,...e){return jn(t,Tn,Tn,e)}function Cn(t,...e){return jn(t,Array.from,Tn,e)}function Nn(t,e,...n){return jn(t,Tn,e,n)}function Ln(t,e,...n){return jn(t,Array.from,e,n)}function jn(t,e,n,r){return function t(i,o){if(o>=r.length)return n(i);const a=new Sn,s=r[o++];let c=-1;for(const t of i){const e=s(t,++c,i),n=a.get(e);n?n.push(t):a.set(e,[t])}for(const[e,n]of a)a.set(e,t(n,o));return e(a)}(t,0)}function Rn(t,...e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&2!==n.length||e.length>1){const o=Uint32Array.from(t,((t,e)=>e));return e.length>1?(e=e.map((e=>t.map(e))),o.sort(((t,n)=>{for(const r of e){const e=Bn(r[t],r[n]);if(e)return e}}))):(n=t.map(n),o.sort(((t,e)=>Bn(n[t],n[e])))),r=t,i=o,Array.from(i,(t=>r[t]))}var r,i;return t.sort(In(n))}function In(t=dn){if(t===dn)return Bn;if("function"!=typeof t)throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||0===r?r:(0===t(n,n))-(0===t(e,e))}}function Bn(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(t<e?-1:t>e?1:0)}var Dn=Array.prototype.slice;function Fn(t){return()=>t}const zn=Math.sqrt(50),Gn=Math.sqrt(10),Wn=Math.sqrt(2);function $n(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=zn?10:o>=Gn?5:o>=Wn?2:1;let s,c,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(t*l),c=Math.round(e*l),s/l<t&&++s,c/l>e&&--c,l=-l):(l=Math.pow(10,i)*a,s=Math.round(t/l),c=Math.round(e/l),s*l<t&&++s,c*l>e&&--c),c<s&&.5<=n&&n<2?$n(t,e,2*n):[s,c,l]}function Hn(t,e,n){return $n(t=+t,e=+e,n=+n)[2]}function Yn(t){return Math.max(1,Math.ceil(Math.log(On(t))/Math.LN2)+1)}function Vn(){var t=Tn,e=kn,n=Yn;function r(r){Array.isArray(r)||(r=Array.from(r));var i,o,a,s=r.length,c=new Array(s);for(i=0;i<s;++i)c[i]=t(r[i],i,r);var l=e(c),u=l[0],f=l[1],h=n(c,u,f);if(!Array.isArray(h)){const t=f,n=+h;if(e===kn&&([u,f]=function(t,e,n){let r;for(;;){const i=Hn(t,e,n);if(i===r||0===i||!isFinite(i))return[t,e];i>0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}(u,f,n)),h=function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const r=e<t,[i,o,a]=r?$n(e,t,n):$n(t,e,n);if(!(o>=i))return[];const s=o-i+1,c=new Array(s);if(r)if(a<0)for(let t=0;t<s;++t)c[t]=(o-t)/-a;else for(let t=0;t<s;++t)c[t]=(o-t)*a;else if(a<0)for(let t=0;t<s;++t)c[t]=(i+t)/-a;else for(let t=0;t<s;++t)c[t]=(i+t)*a;return c}(u,f,n),h[0]<=u&&(a=Hn(u,f,n)),h[h.length-1]>=f)if(t>=f&&e===kn){const t=Hn(u,f,n);isFinite(t)&&(t>0?f=(Math.floor(f/t)+1)*t:t<0&&(f=(Math.ceil(f*-t)+1)/-t))}else h.pop()}for(var d=h.length,p=0,g=d;h[p]<=u;)++p;for(;h[g-1]>f;)--g;(p||g<d)&&(h=h.slice(p,g),d=g-p);var m,y=new Array(d+1);for(i=0;i<=d;++i)(m=y[i]=[]).x0=i>0?h[i-1]:u,m.x1=i<d?h[i]:f;if(isFinite(a)){if(a>0)for(i=0;i<s;++i)null!=(o=c[i])&&u<=o&&o<=f&&y[Math.min(d,Math.floor((o-u)/a))].push(r[i]);else if(a<0)for(i=0;i<s;++i)if(null!=(o=c[i])&&u<=o&&o<=f){const t=Math.floor((u-o)*a);y[Math.min(d,t+(h[t]<=o))].push(r[i])}}else for(i=0;i<s;++i)null!=(o=c[i])&&u<=o&&o<=f&&y[Mn(h,o,0,d)].push(r[i]);return y}return r.value=function(e){return arguments.length?(t="function"==typeof e?e:Fn(e),r):t},r.domain=function(t){return arguments.length?(e="function"==typeof t?t:Fn([t[0],t[1]]),r):e},r.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Fn(Array.isArray(t)?Dn.call(t):t),r):n},r}function qn(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}function Un(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n<e||void 0===n&&e>=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n<o||void 0===n&&o>=o)&&(n=o,r=i);return r}function Xn(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function Kn(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n>e||void 0===n&&e>=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);return r}function Zn(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=void 0===i?Bn:In(i);r>n;){if(r-n>600){const o=r-n+1,a=e-n+1,s=Math.log(o),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(o-c)/o)*(a-o/2<0?-1:1);Zn(t,e,Math.max(n,Math.floor(e-a*c/o+l)),Math.min(r,Math.floor(e+(o-a)*c/o+l)),i)}const o=t[e];let a=n,s=r;for(Qn(t,n,e),i(t[r],o)>0&&Qn(t,n,r);a<s;){for(Qn(t,a,s),++a,--s;i(t[a],o)<0;)++a;for(;i(t[s],o)>0;)--s}0===i(t[n],o)?Qn(t,n,s):(++s,Qn(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function Qn(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function Jn(t,e,n=yn){if(!isNaN(e=+e)){if(r=Float64Array.from(t,((e,r)=>yn(n(t[r],r,t)))),e<=0)return Kn(r);if(e>=1)return Un(r);var r,i=Uint32Array.from(t,((t,e)=>e)),o=r.length-1,a=Math.floor(o*e);return Zn(i,a,0,o,((t,e)=>Bn(r[t],r[e]))),a=function(t,e=dn){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?dn(t,i)>0:0===dn(t,t))&&(n=o,i=t,r=!0)}}else for(const i of t)(r?e(i,n)>0:0===e(i,i))&&(n=i,r=!0);return n}(i.subarray(0,a+1),(t=>r[t])),a>=0?a:-1}}function tr(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function er(t,e){return function(t,e,n){if(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,n)),(r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return Xn(t);if(e>=1)return qn(t);var r,i=(r-1)*e,o=Math.floor(i),a=qn(Zn(t,o).subarray(0,o+1));return a+(Xn(t.subarray(o+1))-a)*(i-o)}}(t,.5,e)}function nr(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function rr(t){return t}function ir(t){return t.reduce(((t,e)=>(n,...r)=>e(t(n,...r),...r)),rr)}function or(t){return t.replace(/( |^)[a-z]/g,(t=>t.toUpperCase()))}function ar(t=""){throw new Error(t)}function sr(t,e){const{attributes:n}=e,r=new Set(["id","className"]);for(const[e,i]of Object.entries(n))r.has(e)||("transform"===e?(t.attr(e,""),t.attr(e,i)):t.attr(e,i))}function cr(t){return null!=t&&!Number.isNaN(t)}function lr(t){const e=new Map;return n=>{if(e.has(n))return e.get(n);const r=t(n);return e.set(n,r),r}}function ur(t,e){return fr(t,e)||{}}function fr(t,e){const n=Object.entries(t||{}).filter((([t])=>t.startsWith(e))).map((([t,n])=>[I(t.replace(e,"").trim()),n])).filter((([t])=>!!t));return 0===n.length?null:Object.fromEntries(n)}function hr(t,...e){return Object.fromEntries(Object.entries(t).filter((([t])=>e.every((e=>!t.startsWith(e))))))}function dr(t,e){if(void 0===t)return null;if("number"==typeof t)return t;const n=+t.replace("%","");return Number.isNaN(n)?null:n/100*e}function pr(t){return!("object"!=typeof t||t instanceof Date||null===t||Array.isArray(t))}function gr(t){return null===t||!1===t}function mr(t,e,n=5,r=0){if(!(r>=n)){for(const i of Object.keys(e)){const o=e[i];O(o)&&O(t[i])?mr(t[i],o,n,r+1):t[i]=o}return t}}function yr(t,e){return Object.entries(t).reduce(((n,[r,i])=>(n[r]=e(i,r,t),n)),{})}function vr(t){return t.map(((t,e)=>e))}function br(t){return t[0]}function xr(t){return t[t.length-1]}function wr(t,e){const n=[[],[]];return t.forEach((t=>{n[e(t)?0:1].push(t)})),n}function Mr(t,e=t.length){if(1===e)return t.map((t=>[t]));const n=[];for(let r=0;r<t.length;r++){Mr(t.slice(r+1),e-1).forEach((e=>{n.push([t[r],...e])}))}return n}function Or(t,e,n){const{encode:r}=n;if(null===t)return[e];const i=function(t){return Array.isArray(t)?t:[t]}(t).map((t=>{var e;return[t,null===(e=ln(r,t))||void 0===e?void 0:e[0]]})).filter((([,t])=>cr(t)));return Array.from(Pn(e,(t=>i.map((([,e])=>e[t])).join("-"))).values())}function Er(t){return Array.isArray(t)?function(t){return(e,n,r)=>(n,r)=>t.reduce(((t,i)=>0!==t?t:dn(e[n][i],e[r][i])),0)}(t):"function"==typeof t?function(t){return(e,n,r)=>Cr((n=>t(e[n])))}(t):"series"===t?Ar:"value"===t?_r:"sum"===t?Tr:"maxIndex"===t?Pr:()=>null}function kr(t,e){for(const n of t)n.sort(e)}function Sr(t,e){return(null==e?void 0:e.domain)||Array.from(new Set(t))}function Ar(t,e,n){return Cr((t=>n[t]))}function _r(t,e,n){return Cr((t=>e[t]))}function Tr(t,e,n){const r=vr(t),i=Array.from(Pn(r,(t=>n[+t])).entries()),o=new Map(i.map((([t,n])=>[t,n.reduce(((t,n)=>t+ +e[n]))])));return Cr((t=>o.get(n[t])))}function Pr(t,e,n){const r=vr(t),i=Array.from(Pn(r,(t=>n[+t])).entries()),o=new Map(i.map((([t,n])=>[t,Un(n,(t=>e[t]))])));return Cr((t=>o.get(n[t])))}function Cr(t){return(e,n)=>dn(t(e),t(n))}const Nr=(t={})=>{const{groupBy:e="x",orderBy:n=null,reverse:r=!1,y:i="y",y1:o="y1",series:a=!0}=t;return(t,s)=>{const{data:c,encode:l,style:u={}}=s,[f,h]=ln(l,"y"),[d,p]=ln(l,"y1"),[g]=a?un(l,"series","color"):ln(l,"color"),m=Or(e,t,s),y=Er(n)(c,f,g);y&&kr(m,y);const v=new Array(t.length),b=new Array(t.length),x=new Array(t.length),w=[],M=[];for(const t of m){r&&t.reverse();const e=d?+d[t[0]]:0,n=[],i=[];for(const r of t){const t=x[r]=+f[r]-e;t<0?i.push(r):t>=0&&n.push(r)}const o=n.length>0?n:i,a=i.length>0?i:n;let s=n.length-1,c=0;for(;s>0&&0===f[o[s]];)s--;for(;c<a.length-1&&0===f[a[c]];)c++;w.push(o[s]),M.push(a[c]);let l=e;for(const t of i.reverse()){const e=x[t];l=v[t]=(b[t]=l)+e}let u=e;for(const t of n){const e=x[t];e>0?u=v[t]=(b[t]=u)+e:v[t]=b[t]=u}}const O=new Set(w),E=new Set(M),k="y"===i?v:b,S="y"===o?v:b;return[t,V({},s,{encode:{y0:on(f,h),y:rn(k,h),y1:rn(S,p)},style:Object.assign({first:(t,e)=>O.has(e),last:(t,e)=>E.has(e)},u)})]}};function Lr(t){const{type:e}=t;return"string"==typeof e&&["stackY","dodgeX","groupX"].includes(e)}Nr.props={};const jr=t=>(e,n,r)=>{const{encode:i,transform:o=[]}=n;if(o.some(Lr))return[e,n];const{x:a,y:s}=i;if(void 0===a||void 0===s)return[e,n];const{series:c}=t;return Nr({groupBy:c?["x","series"]:"x"})(e,n,r)};function Rr(t){return Math.abs(t)>10?String(t):t.toString().padStart(2,"0")}function Ir(t){const e=`${t.getFullYear()}-${Rr(t.getMonth()+1)}-${Rr(t.getDate())}`,n=t.getHours(),r=t.getMinutes(),i=t.getSeconds();return n||r||i?`${e} ${Rr(n)}:${Rr(r)}:${Rr(i)}`:e}jr.props={};const Br=(t={})=>{const{channel:e="x"}=t;return(t,n)=>{const{encode:r}=n,{tooltip:i}=n;if(gr(i))return[t,n];const{title:o}=i;if(void 0!==o)return[t,n];const a=Object.keys(r).filter((t=>t.startsWith(e))).filter((t=>!r[t].inferred)).map((t=>ln(r,t))).filter((([t])=>t)).map((t=>t[0]));if(0===a.length)return[t,n];const s=[];for(const e of t)s[e]={value:a.map((t=>t[e]instanceof Date?Ir(t[e]):t[e])).join(", ")};return[t,V({},n,{tooltip:{title:s}})]}};Br.props={};const Dr=()=>(t,e)=>{const{encode:n}=e,{x:r}=n;return void 0!==r?[t,e]:[t,V({},e,{encode:{x:on(cn(t,0))},scale:{x:{guide:null}}})]};Dr.props={};const Fr=()=>(t,e)=>{const{encode:n}=e,{y:r}=n;return void 0!==r?[t,e]:[t,V({},e,{encode:{y:on(cn(t,0))},scale:{y:{guide:null}}})]};Fr.props={};const zr=()=>(t,e)=>{const{encode:n}=e,{z:r}=n;return void 0!==r?[t,e]:[t,V({},e,{encode:{z:on(cn(t,0))},scale:{z:{guide:null}}})]};zr.props={};const Gr=()=>(t,e)=>{const{encode:n}=e,{size:r}=n;return void 0!==r?[t,e]:[t,V({},e,{encode:{size:an(cn(t,3))}})]};Gr.props={};const Wr=()=>(t,e)=>{const{encode:n}=e,{key:r}=n,i=he(n,["key"]);if(void 0!==r)return[t,e];const o=Object.values(i).map((({value:t})=>t)),a=t.map((t=>o.filter(Array.isArray).map((e=>e[t])).join("-")));return[t,V({},e,{encode:{key:rn(a)}})]};Wr.props={};const $r=()=>(t,e)=>{const{encode:n}=e,{series:r,color:i}=n;if(void 0!==r||void 0===i)return[t,e];const[o,a]=ln(n,"color");return[t,V({},e,{encode:{series:rn(o,a)}})]};$r.props={};const Hr=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(fn)?[t,e]:[t,V({},e,{encode:{y:rn(n)}})]};Hr.props={};const Yr=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(fn)?[t,e]:[t,V({},e,{encode:{x:rn(n)}})]};Yr.props={};const Vr=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;if(r)return[t,e];const[i]=ln(n,"y");return[t,V({},e,{encode:{y1:rn([...i])}})]};Vr.props={};const qr=()=>(t,e)=>{const{encode:n}=e,{x1:r}=n;if(r)return[t,e];const[i]=ln(n,"x");return[t,V({},e,{encode:{x1:rn([...i])}})]};qr.props={};const Ur=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(fn))){const r=(t,e)=>Array.isArray(t[0])?t.map((t=>t[e])):[t[e]];return[t,V({},e,{encode:{x:rn(r(n,0)),x1:rn(r(n,1))}})]}return[t,e]};Ur.props={};const Xr=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(fn))){const r=(t,e)=>Array.isArray(t[0])?t.map((t=>t[e])):[t[e]];return[t,V({},e,{encode:{y:rn(r(n,0)),y1:rn(r(n,1))}})]}return[t,e]};Xr.props={};const Kr=t=>{const{channel:e}=t;return(t,n)=>{const{encode:r,tooltip:i}=n;if(gr(i))return[t,n];const{items:o=[]}=i;if(!o||o.length>0)return[t,n];const a=(Array.isArray(e)?e:[e]).flatMap((t=>Object.keys(r).filter((e=>e.startsWith(t))).map((t=>{const{field:e,value:n,inferred:i=!1,aggregate:o}=r[t];return i?null:o&&n?{channel:t}:e?{field:e}:n?{channel:t}:null})).filter((t=>null!==t))));return[t,V({},n,{tooltip:{items:a}})]}};Kr.props={};const Zr=()=>(t,e)=>[t,V({scale:{x:{padding:0},y:{padding:0}}},e)];Zr.props={};const Qr=()=>(t,e)=>{const{data:n,style:r={}}=e,i=he(e,["data","style"]),{x:o,y:a}=r,s=he(r,["x","y"]);if(null==o||null==a)return[t,e];const c=a||0;return[[0],V({},i,{data:[0],cartesian:!0,encode:{x:rn([o||0]),y:rn([c])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:s})]};Qr.props={};const Jr=()=>(t,e)=>{const{style:n={}}=e;return[t,V({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter((([,t])=>"function"==typeof t)).map((([t,e])=>[t,()=>e]))))})]};Jr.props={};const ti=()=>(t,e)=>{const{data:n}=e;if(!Array.isArray(n)||n.some(fn))return[t,e];const r=Array.isArray(n[0])?n:[n],i=r.map((t=>t[0])),o=r.map((t=>t[1]));return[t,V({},e,{encode:{x:rn(i),y:rn(o)}})]};ti.props={};const ei=()=>(t,e)=>{const{style:n={},encode:r}=e,{series:i}=r,{gradient:o}=n;return!o||i?[t,e]:[t,V({},e,{encode:{series:an(cn(t,void 0))}})]};ei.props={};const ni=(t={})=>{const{groupBy:e="x",reverse:n=!1,orderBy:r,padding:i}=t;return he(t,["groupBy","reverse","orderBy","padding"]),(t,o)=>{const{data:a,encode:s,scale:c}=o,{series:l}=c,[u]=ln(s,"y"),[f]=un(s,"series","color"),h=Sr(f,l),d=Or(e,t,o),p=Er(r)(a,u,f);p&&kr(d,p);const g=new Array(t.length);for(const t of d){n&&t.reverse();for(let e=0;e<t.length;e++)g[t[e]]=h[e]}return[t,V({},o,{scale:{series:{domain:h,paddingInner:i}},encode:{series:rn(g)}})]}};ni.props={};const ri=t=>{const{groupBy:e=["x"],reducer:n=((t,e)=>e[t[0]]),orderBy:r=null,reverse:i=!1,duration:o}=t;return(t,a)=>{const{encode:s}=a,c=(Array.isArray(e)?e:[e]).map((t=>[t,ln(s,t)[0]]));if(0===c.length)return[t,a];let l=[t];for(const[,t]of c){const e=[];for(const n of l){const r=Array.from(Pn(n,(e=>t[e])).values());e.push(...r)}l=e}if(r){const[t]=ln(s,r);t&&l.sort(((e,r)=>n(e,t)-n(r,t))),i&&l.reverse()}const u=(o||3e3)/l.length,[f]=o?[cn(t,u)]:un(s,"enterDuration",cn(t,u)),[h]=un(s,"enterDelay",cn(t,0)),d=new Array(t.length);for(let t=0,e=0;t<l.length;t++){const n=l[t],r=qn(n,(t=>+f[t]));for(const t of n)d[t]=+h[t]+e;e+=r}return[t,V({},a,{encode:{enterDuration:an(f),enterDelay:an(d)}})]}};ri.props={};const ii=(t={})=>{const{groupBy:e="x",basis:n="max"}=t;return(t,r)=>{const{encode:i,tooltip:o}=r,a=he(i,["x"]),s=Object.entries(a).filter((([t])=>t.startsWith("y"))).map((([t])=>[t,ln(i,t)[0]])),[,c]=s.find((([t])=>"y"===t)),l=s.map((([e])=>[e,new Array(t.length)])),u=Or(e,t,r),f=function(t){return"function"==typeof t?t:{min:(t,e)=>Xn(t,(t=>e[+t])),max:(t,e)=>qn(t,(t=>e[+t])),first:(t,e)=>e[t[0]],last:(t,e)=>e[t[t.length-1]],mean:(t,e)=>tr(t,(t=>e[+t])),median:(t,e)=>er(t,(t=>e[+t])),sum:(t,e)=>nr(t,(t=>e[+t])),deviation:(t,e)=>En(t,(t=>e[+t]))}[t]||qn}(n);for(const t of u){const e=f(t,c);for(const n of t)for(let t=0;t<s.length;t++){const[,r]=s[t],[,i]=l[t];i[n]=+r[n]/e}}const h=gr(o)||(null==o?void 0:o.items)&&0!==(null==o?void 0:o.items.length);return[t,V({},r,Object.assign({encode:Object.fromEntries(l.map((([t,e])=>[t,rn(e,ln(i,t)[1])])))},!h&&i.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};function oi(t,...e){return e.reduce(((t,e)=>n=>t(e(n))),t)}function ai(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}function si(t,e,n,r,i){let o=n||0,a=r||t.length;const s=i||(t=>t);for(;o<a;){const n=Math.floor((o+a)/2);s(t[n])>e?a=n:o=n+1}return o}ii.props={};const ci=Math.sqrt(50),li=Math.sqrt(10),ui=Math.sqrt(2);function fi(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/10**i;return i>=0?(o>=ci?10:o>=li?5:o>=ui?2:1)*10**i:-(10**-i)/(o>=ci?10:o>=li?5:o>=ui?2:1)}function hi(t,e,n){const r=Math.abs(e-t)/Math.max(0,n);let i=10**Math.floor(Math.log(r)/Math.LN10);const o=r/i;return o>=ci?i*=10:o>=li?i*=5:o>=ui&&(i*=2),e<t?-i:i}const di=(t,e,n=5)=>{const r=[t,e];let i,o=0,a=r.length-1,s=r[o],c=r[a];return c<s&&([s,c]=[c,s],[o,a]=[a,o]),i=fi(s,c,n),i>0?(s=Math.floor(s/i)*i,c=Math.ceil(c/i)*i,i=fi(s,c,n)):i<0&&(s=Math.ceil(s*i)/i,c=Math.floor(c*i)/i,i=fi(s,c,n)),i>0?(r[o]=Math.floor(s/i)*i,r[a]=Math.ceil(c/i)*i):i<0&&(r[o]=Math.ceil(s*i)/i,r[a]=Math.floor(c*i)/i),r},pi=1e3,gi=6e4,mi=36e5,yi=864e5,vi=6048e5,bi=2592e6,xi=31536e6;function wi(t,e,n,r){const i=(t,i)=>{i&&((t,e)=>{const i=t=>r(t)%e==0;let o=e;for(;o&&!i(t);)n(t,-1),o-=1})(t,i),e(t)},o=(t,e)=>{const r=new Date(+t-1);return i(r,e),n(r,e),i(r),r};return{ceil:o,floor:(t,e)=>{const n=new Date(+t);return i(n,e),n},range:(t,e,r,a)=>{const s=[],c=Math.floor(r);for(let l=a?o(t,r):o(t);l<e;n(l,c),i(l))s.push(new Date(+l));return s},duration:t}}const Mi=wi(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),Oi=wi(pi,(t=>{t.setMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+pi*e)}),(t=>t.getSeconds())),Ei=wi(gi,(t=>{t.setSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+gi*e)}),(t=>t.getMinutes())),ki=wi(mi,(t=>{t.setMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+mi*e)}),(t=>t.getHours())),Si=wi(yi,(t=>{t.setHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+yi*e)}),(t=>t.getDate()-1)),Ai=wi(bi,(t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e=1)=>{const n=t.getMonth();t.setMonth(n+e)}),(t=>t.getMonth())),_i=wi(vi,(t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)}),((t,e=1)=>{t.setDate(t.getDate()+7*e)}),(t=>{const e=Ai.floor(t),n=new Date(+t);return Math.floor((+n-+e)/vi)})),Ti=wi(xi,(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e=1)=>{const n=t.getFullYear();t.setFullYear(n+e)}),(t=>t.getFullYear())),Pi={millisecond:Mi,second:Oi,minute:Ei,hour:ki,day:Si,week:_i,month:Ai,year:Ti},Ci=wi(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),Ni=wi(pi,(t=>{t.setUTCMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+pi*e)}),(t=>t.getUTCSeconds())),Li=wi(gi,(t=>{t.setUTCSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+gi*e)}),(t=>t.getUTCMinutes())),ji=wi(mi,(t=>{t.setUTCMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+mi*e)}),(t=>t.getUTCHours())),Ri=wi(yi,(t=>{t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+yi*e)}),(t=>t.getUTCDate()-1)),Ii=wi(bi,(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{const n=t.getUTCMonth();t.setUTCMonth(n+e)}),(t=>t.getUTCMonth())),Bi=wi(vi,(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+vi*e)}),(t=>{const e=Ii.floor(t),n=new Date(+t);return Math.floor((+n-+e)/vi)})),Di=wi(xi,(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{const n=t.getUTCFullYear();t.setUTCFullYear(n+e)}),(t=>t.getUTCFullYear())),Fi={millisecond:Ci,second:Ni,minute:Li,hour:ji,day:Ri,week:Bi,month:Ii,year:Di};function zi(t,e,n,r,i){const o=+t,a=+e,{tickIntervals:s,year:c,millisecond:l}=function(t){const e=t?Fi:Pi,{year:n,month:r,week:i,day:o,hour:a,minute:s,second:c,millisecond:l}=e;return{tickIntervals:[[c,1],[c,5],[c,15],[c,30],[s,1],[s,5],[s,15],[s,30],[a,1],[a,3],[a,6],[a,12],[o,1],[o,2],[i,1],[r,1],[r,3],[n,1]],year:n,millisecond:l}}(i),u=([t,e])=>t.duration*e,f=r?(a-o)/r:n||5,h=r||(a-o)/f,d=s.length,p=si(s,h,0,d,u);let g;if(p===d){g=[c,hi(o/c.duration,a/c.duration,f)]}else if(p){const t=h/u(s[p-1])<u(s[p])/h,[e,n]=t?s[p-1]:s[p];g=[e,r?Math.ceil(r/e.duration):n]}else{g=[l,Math.max(hi(o,a,f),1)]}return g}const Gi=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[c,l]=zi(a,s,n,r,i),u=[c.floor(a,l),c.ceil(s,l)];return o?u.reverse():u};var Wi=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},$i={}.toString,Hi=function(t,e){return $i.call(t)==="[object "+e+"]"},Yi=function(t){return null==t},Vi=function(t){return Array.isArray?Array.isArray(t):Hi(t,"Array")},qi=function(t){return"object"==typeof t&&null!==t},Ui=function(t){if(!qi(t)||!Hi(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},Xi=function(t){return Hi(t,"Number")},Ki=function(t){return null===t},Zi=function(t){return void 0===t};function Qi(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&&Ui(o)?(Ui(t[i])||(t[i]={}),n<r?Qi(t[i],o,n+1,r):t[i]=e[i]):Vi(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var Ji=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)Qi(t,e[r]);return t},to=function(t,e){if(!Wi(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var r=-1,i=0;i<t.length;i++)if(t[i]===e){r=i;break}return r},eo=function(t){return t};function no(t){return Yi(t)?0:Wi(t)?t.length:Object.keys(t).length}function ro(t){return!Zi(t)&&!Ki(t)&&!Number.isNaN(t)}const io=t=>e=>-t(-e),oo=(t,e)=>{const n=Math.log(t),r=t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:t=>Math.log(t)/n;return e?io(r):r},ao=(t,e)=>{const n=t===Math.E?Math.exp:e=>t**e;return e?io(n):n},so=(t,e,n,r)=>{const i=t<0,o=oo(r,i),a=ao(r,i),s=t>e,c=s?e:t,l=s?t:e,u=[a(Math.floor(o(c))),a(Math.ceil(o(l)))];return s?u.reverse():u};var co={exports:{}},lo={exports:{}},uo=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))},fo=Array.prototype.concat,ho=Array.prototype.slice,po=lo.exports=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];uo(i)?e=fo.call(e,ho.call(i)):e.push(i)}return e};po.wrap=function(t){return function(){return t(po(arguments))}};var go={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},mo=lo.exports,yo=Object.hasOwnProperty,vo=Object.create(null);for(var bo in go)yo.call(go,bo)&&(vo[go[bo]]=bo);var xo=co.exports={to:{},get:{}};function wo(t,e,n){return Math.min(Math.max(e,t),n)}function Mo(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}xo.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=xo.get.hsl(t),n="hsl";break;case"hwb":e=xo.get.hwb(t),n="hwb";break;default:e=xo.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},xo.get.rgb=function(t){if(!t)return null;var e,n,r,i=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=e[2],e=e[1],n=0;n<3;n++){var o=2*n;i[n]=parseInt(e.slice(o,o+2),16)}r&&(i[3]=parseInt(r,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(r=(e=e[1])[3],n=0;n<3;n++)i[n]=parseInt(e[n]+e[n],16);r&&(i[3]=parseInt(r+r,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)i[n]=parseInt(e[n+1],0);e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:yo.call(go,e[1])?((i=go[e[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}for(n=0;n<3;n++)i[n]=wo(i[n],0,255);return i[3]=wo(i[3],0,1),i},xo.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,wo(parseFloat(e[2]),0,100),wo(parseFloat(e[3]),0,100),wo(isNaN(n)?1:n,0,1)]}return null},xo.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,wo(parseFloat(e[2]),0,100),wo(parseFloat(e[3]),0,100),wo(isNaN(n)?1:n,0,1)]}return null},xo.to.hex=function(){var t=mo(arguments);return"#"+Mo(t[0])+Mo(t[1])+Mo(t[2])+(t[3]<1?Mo(Math.round(255*t[3])):"")},xo.to.rgb=function(){var t=mo(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},xo.to.rgb.percent=function(){var t=mo(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},xo.to.hsl=function(){var t=mo(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},xo.to.hwb=function(){var t=mo(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},xo.to.keyword=function(t){return vo[t.slice(0,3)]};var Oo=co.exports;function Eo(t,e,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function ko(t){const e=Oo.get(t);if(!e)return null;const{model:n,value:r}=e;return"rgb"===n?r:"hsl"===n?function(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100,i=t[3];if(0===n)return[255*r,255*r,255*r,i];const o=r<.5?r*(1+n):r+n-r*n,a=2*r-o;return[255*Eo(a,o,e+1/3),255*Eo(a,o,e),255*Eo(a,o,e-1/3),i]}(r):null}const So=(t,e)=>n=>t*(1-n)+e*n,Ao=(t,e)=>"number"==typeof t&&"number"==typeof e?So(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=ko(t),r=ko(e);return null===n||null===r?n?()=>t:()=>e:t=>{const e=new Array(4);for(let i=0;i<4;i+=1){const o=n[i],a=r[i];e[i]=o*(1-t)+a*t}const[i,o,a,s]=e;return`rgba(${Math.round(i)}, ${Math.round(o)}, ${Math.round(a)}, ${s})`}})(t,e):()=>t,_o=(t,e)=>{const n=So(t,e);return t=>Math.round(n(t))};function To({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Po(t){return"object"==typeof t?t.valueOf():t}class Co extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=Po,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(To({map:this.map,initKey:this.initKey},t))}has(t){return super.has(To({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(function({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(function({map:t,initKey:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}({map:this.map,initKey:this.initKey},t))}}class No{constructor(t){this.options=Ji({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=Ji({},this.options,t),this.rescale(t)}rescale(t){}}const Lo=Symbol("defaultUnknown");function jo(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function Ro(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:o}=t;let a=i.get(e);if(void 0===a){if(o!==Lo)return o;a=n.push(e)-1,i.set(e,a)}return r[a%r.length]}function Io(t){return t instanceof Date?t=>`${t}`:"object"==typeof t?t=>JSON.stringify(t):t=>t}class Bo extends No{getDefaultOptions(){return{domain:[],range:[],unknown:Lo}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&jo(this.domainIndexMap,this.getDomain(),this.domainKey),Ro({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&jo(this.rangeIndexMap,this.getRange(),this.rangeKey),Ro({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[e]=this.options.domain,[n]=this.options.range;if(this.domainKey=Io(e),this.rangeKey=Io(n),!this.rangeIndexMap)return this.rangeIndexMap=new Map,void(this.domainIndexMap=new Map);t&&!t.range||this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new Bo(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:t,compare:e}=this.options;return this.sortedDomain=e?[...t].sort(e):t,this.sortedDomain}}function Do(t){return Math.round(1e12*t)/1e12}function Fo(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:o,round:a,align:s}=t,c=e.length,l=function(t,e){const n=e-t.length;return n>0?[...t,...new Array(n).fill(1)]:n<0?t.slice(0,e):t}(o,c),[u,f]=n,h=f-u,d=h/(2/c*r+1-1/c*i),p=d*i/c,g=d-c*p,m=function(t){const e=Math.min(...t);return t.map((t=>t/e))}(l),y=m.reduce(((t,e)=>t+e)),v=g/y,b=new Co(e.map(((t,e)=>{const n=m[e]*v;return[t,a?Math.floor(n):n]}))),x=new Co(e.map(((t,e)=>{const n=m[e]*v+p;return[t,a?Math.floor(n):n]}))),w=Array.from(x.values()).reduce(((t,e)=>t+e)),M=u+(h-(w-w/c*i))*s;let O=a?Math.round(M):M;const E=new Array(c);for(let t=0;t<c;t+=1){E[t]=Do(O);const n=e[t];O+=x.get(n)}return{valueBandWidth:b,valueStep:x,adjustedRange:E}}class zo extends Bo{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:Lo,flex:[]}}constructor(t){super(t)}clone(){return new zo(this.options)}getStep(t){return void 0===this.valueStep?1:"number"==typeof this.valueStep?this.valueStep:void 0===t?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return void 0===this.valueBandWidth?1:"number"==typeof this.valueBandWidth?this.valueBandWidth:void 0===t?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:t,paddingInner:e}=this.options;return t>0?t:e}getPaddingOuter(){const{padding:t,paddingOuter:e}=this.options;return t>0?t:e}rescale(){super.rescale();const{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:o,valueBandWidth:a,valueStep:s}=function(t){var e;const{domain:n}=t,r=n.length;if(0===r)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(null===(e=t.flex)||void 0===e?void 0:e.length)return Fo(t);const{range:i,paddingOuter:o,paddingInner:a,round:s,align:c}=t;let l,u,f=i[0];const h=i[1]-f,d=2*o,p=r-a;l=h/Math.max(1,d+p),s&&(l=Math.floor(l)),f+=(h-l*(r-a))*c,u=l*(1-a),s&&(f=Math.round(f),u=Math.round(u));const g=new Array(r).fill(0).map(((t,e)=>f+e*l));return{valueStep:l,valueBandWidth:u,adjustedRange:g}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=s,this.valueBandWidth=a,this.adjustedRange=o}}const Go=(t,e,n)=>{let r,i,o=t,a=e;if(o===a&&n>0)return[o];let s=fi(o,a,n);if(0===s||!Number.isFinite(s))return[];if(s>0){o=Math.ceil(o/s),a=Math.floor(a/s),i=new Array(r=Math.ceil(a-o+1));for(let t=0;t<r;t+=1)i[t]=(o+t)*s}else{s=-s,o=Math.ceil(o*s),a=Math.floor(a*s),i=new Array(r=Math.ceil(a-o+1));for(let t=0;t<r;t+=1)i[t]=(o+t)/s}return i};class Wo extends No{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:Go}}map(t){const[e]=this.options.range;return void 0!==e?e:this.options.unknown}invert(t){const[e]=this.options.range;return t===e&&void 0!==e?this.options.domain:[]}getTicks(){const{tickMethod:t,domain:e,tickCount:n}=this.options,[r,i]=e;return Xi(r)&&Xi(i)?t(r,i,n):[]}clone(){return new Wo(this.options)}}function $o(t){return Math.abs(t)<1e-14?t:parseFloat(t.toFixed(14))}const Ho=[1,5,2,2.5,4,3],Yo=100*Number.EPSILON;function Vo(t,e,n,r,i,o){const a=no(e),s=to(e,t);let c=0;const l=function(t,e){return(t%e+e)%e}(r,o);return(l<Yo||o-l<Yo)&&r<=0&&i>=0&&(c=1),1-s/(a-1)-n+c}function qo(t,e,n){const r=no(e);return 1-to(e,t)/(r-1)-n+1}function Uo(t,e,n,r,i,o){const a=(t-1)/(o-i),s=(e-1)/(Math.max(o,r)-Math.min(n,i));return 2-Math.max(a/s,s/a)}function Xo(t,e){return t>=e?2-(t-1)/(e-1):1}function Ko(t,e,n,r){return 1-.5*((e-r)**2+(t-n)**2)/(.1*(e-t))**2}function Zo(t,e,n){const r=e-t;if(n>r){return 1-((n-r)/2)**2/(.1*r)**2}return 1}const Qo=(t,e,n=5,r=!0,i=Ho,o=[.25,.2,.5,.05])=>{const a=n<0?0:Math.round(n);if(Number.isNaN(t)||Number.isNaN(e)||"number"!=typeof t||"number"!=typeof e||!a)return[];if(e-t<1e-15||1===a)return[t];const s={score:-2,lmin:0,lmax:0,lstep:0};let c=1;for(;c<1/0;){for(let n=0;n<i.length;n+=1){const l=i[n],u=qo(l,i,c);if(o[0]*u+o[1]+o[2]+o[3]<s.score){c=1/0;break}let f=2;for(;f<1/0;){const n=Xo(f,a);if(o[0]*u+o[1]+o[2]*n+o[3]<s.score)break;const h=(e-t)/(f+1)/c/l;let d=Math.ceil(Math.log10(h));for(;d<1/0;){const h=c*l*10**d,p=Zo(t,e,h*(f-1));if(o[0]*u+o[1]*p+o[2]*n+o[3]<s.score)break;const g=Math.floor(e/h)*c-(f-1)*c,m=Math.ceil(t/h)*c;if(g<=m){const n=m-g;for(let u=0;u<=n;u+=1){const n=(g+u)*(h/c),d=n+h*(f-1),p=h,m=Vo(l,i,c,n,d,p),y=Ko(t,e,n,d),v=Uo(f,a,t,e,n,d),b=1,x=o[0]*m+o[1]*y+o[2]*v+o[3]*b;x>s.score&&(!r||n<=t&&d>=e)&&(s.lmin=n,s.lmax=d,s.lstep=p,s.score=x)}}d+=1}f+=1}}c+=1}const l=$o(s.lmax),u=$o(s.lmin),f=$o(s.lstep),h=Math.floor(function(t){return Math.round(1e12*t)/1e12}((l-u)/f))+1,d=new Array(h);d[0]=$o(u);for(let t=1;t<h;t+=1)d[t]=$o(d[t-1]+f);return d};class Jo extends No{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:Qo}}map(t){return ro(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new Jo(this.options)}getTicks(){const{domain:t,tickCount:e,tickMethod:n}=this.options,[r,i]=t;return Xi(r)&&Xi(i)?n(r,i,e):[]}}const ta=(t,e,n)=>{const[r,i]=t,[o,a]=e;let s,c;return r<i?(s=ai(r,i),c=n(o,a)):(s=ai(i,r),c=n(a,o)),oi(c,s)},ea=(t,e,n)=>{const r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=t[0]>t[r],s=a?[...t].reverse():t,c=a?[...e].reverse():e;for(let t=0;t<r;t+=1)i[t]=ai(s[t],s[t+1]),o[t]=n(c[t],c[t+1]);return e=>{const n=si(t,e,1,r)-1,a=i[n];return oi(o[n],a)(e)}},na=(t,e,n,r)=>(Math.min(t.length,e.length)>2?ea:ta)(t,e,r?_o:n);class ra extends No{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:So,tickCount:5}}map(t){return ro(t)?this.output(t):this.options.unknown}invert(t){return ro(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,e,n,...r]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,e,n,...r)}getTicks(){const{tickMethod:t}=this.options,[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return di}rescale(){this.nice();const[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){const{clamp:e,range:n}=this.options,r=this.options.domain.map(t),i=Math.min(r.length,n.length);return e?function(t,e){const n=e<t?e:t,r=t>e?t:e;return t=>Math.min(Math.max(n,t),r)}(r[0],r[i-1]):eo}composeOutput(t,e){const{domain:n,range:r,round:i,interpolate:o}=this.options,a=na(n.map(t),r,o,i);this.output=oi(a,e,t)}composeInput(t,e,n){const{domain:r,range:i}=this.options,o=na(i,r.map(t),So);this.input=oi(e,n,o)}}class ia extends ra{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:Ao,tickMethod:Go,tickCount:5}}chooseTransforms(){return[eo,eo]}clone(){return new ia(this.options)}}class oa extends zo{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:Lo,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new oa(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const aa=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class sa extends ra{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:Ao,tickMethod:Go,tickCount:5}}constructor(t){super(t)}chooseTransforms(){const{exponent:t}=this.options;if(1===t)return[eo,eo];const e=.5===t?aa:(t=>e=>e<0?-((-e)**t):e**t)(t),n=(t=>e=>e<0?-((-e)**(1/t)):e**(1/t))(t);return[e,n]}clone(){return new sa(this.options)}}class ca extends sa{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Ao,tickMethod:Go,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new ca(this.options)}}class la extends No{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){if(!ro(t))return this.options.unknown;const e=si(this.thresholds,t,0,this.n);return this.options.range[e]}invert(t){const{range:e}=this.options,n=e.indexOf(t),r=this.thresholds;return[r[n-1],r[n]]}clone(){return new la(this.options)}rescale(){const{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const ua=(t,e,n,r=10)=>{const i=t<0,o=ao(r,i),a=oo(r,i),s=e<t,c=s?e:t,l=s?t:e;let u=a(c),f=a(l),h=[];if(!(r%1)&&f-u<n){if(u=Math.floor(u),f=Math.ceil(f),i)for(;u<=f;u+=1){const t=o(u);for(let e=r-1;e>=1;e-=1){const n=t*e;if(n>l)break;n>=c&&h.push(n)}}else for(;u<=f;u+=1){const t=o(u);for(let e=1;e<r;e+=1){const n=t*e;if(n>l)break;n>=c&&h.push(n)}}2*h.length<n&&(h=Go(c,l,n))}else{const t=-1===n?f-u:Math.min(f-u,n);h=Go(u,f,t).map(o)}return s?h.reverse():h};class fa extends ra{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:Ao,tickMethod:ua,tickCount:5}}chooseNice(){return so}getTickMethodOptions(){const{domain:t,tickCount:e,base:n}=this.options;return[t[0],t[t.length-1],e,n]}chooseTransforms(){const{base:t,domain:e}=this.options,n=e[0]<0;return[oo(t,n),ao(t,n)]}clone(){return new fa(this.options)}}class ha extends la{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:Qo}}constructor(t){super(t)}nice(){const{nice:t}=this.options;if(t){const[t,e,n]=this.getTickMethodOptions();this.options.domain=di(t,e,n)}}getTicks(){const{tickMethod:t}=this.options,[e,n,r]=this.getTickMethodOptions();return t(e,n,r)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}rescale(){this.nice();const{range:t,domain:e}=this.options,[n,r]=e;this.n=t.length-1,this.thresholds=new Array(this.n);for(let t=0;t<this.n;t+=1)this.thresholds[t]=((t+1)*r-(t-this.n)*n)/(this.n+1)}invert(t){const[e,n]=super.invert(t),[r,i]=this.options.domain;return void 0===e&&void 0===n?[e,n]:[e||r,n||i]}getThresholds(){return this.thresholds}clone(){return new ha(this.options)}}function da(t,e){const n=t.length;if(!n)return;if(n<2)return t[n-1];const r=(n-1)*e,i=Math.floor(r),o=t[i];return o+(t[i+1]-o)*(r-i)}class pa extends la{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:Qo}}constructor(t){super(t)}rescale(){const{domain:t,range:e}=this.options;this.n=e.length-1,this.thresholds=function(t,e,n=!1){const r=t;n||r.sort(((t,e)=>t-e));const i=[];for(let t=1;t<e;t+=1)i.push(da(r,t/e));return i}(t,this.n+1,!1)}invert(t){const[e,n]=super.invert(t),{domain:r}=this.options,i=r[0],o=r[r.length-1];return void 0===e&&void 0===n?[e,n]:[e||i,n||o]}getThresholds(){return this.thresholds}clone(){return new pa(this.options)}getTicks(){const{tickCount:t,domain:e,tickMethod:n}=this.options,r=e.length-1;return n(e[0],e[r],t)}}var ga=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,ma=/\[([^]*?)\]/gm;function ya(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function va(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++){var o=i[r];for(var a in o)t[a]=o[a]}return t}var ba=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],xa=["January","February","March","April","May","June","July","August","September","October","November","December"],wa=ya(xa,3),Ma=va({},{dayNamesShort:ya(ba,3),dayNames:ba,monthNamesShort:wa,monthNames:xa,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10?1:0)*t%10]}}),Oa=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t},Ea={D:function(t){return String(t.getDate())},DD:function(t){return Oa(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return Oa(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return String(t.getMonth()+1)},MM:function(t){return Oa(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return Oa(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return Oa(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return Oa(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return Oa(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return Oa(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return Oa(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return Oa(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return Oa(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return t.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+Oa(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+Oa(Math.floor(Math.abs(e)/60),2)+":"+Oa(Math.abs(e)%60,2)}},ka={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"};const Sa=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[c,l]=zi(a,s,n,r,i),u=c.range(a,new Date(+s+1),l,!0);return o?u.reverse():u};function Aa(t){const e=t.getTimezoneOffset(),n=new Date(t);return n.setMinutes(n.getMinutes()+e,n.getSeconds(),n.getMilliseconds()),n}class _a extends ra{getDefaultOptions(){return{domain:[new Date(2e3,0,1),new Date(2e3,0,2)],range:[0,1],nice:!1,tickCount:5,tickInterval:void 0,unknown:void 0,clamp:!1,tickMethod:Sa,interpolate:So,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return Gi}getTickMethodOptions(){const{domain:t,tickCount:e,tickInterval:n,utc:r}=this.options;return[t[0],t[t.length-1],e,n,r]}getFormatter(){const{mask:t,utc:e}=this.options,n=e?Fi:Pi,r=e?Aa:eo;return e=>function(t,e,n){if(void 0===e&&(e=ka.default),void 0===n&&(n={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");var r=[];e=(e=ka[e]||e).replace(ma,(function(t,e){return r.push(e),"@@@"}));var i=va(va({},Ma),n);return(e=e.replace(ga,(function(e){return Ea[e](t,i)}))).replace(/@@@/g,(function(){return r.shift()}))}(r(e),t||function(t,e){const{second:n,minute:r,hour:i,day:o,week:a,month:s,year:c}=e;return n.floor(t)<t?".SSS":r.floor(t)<t?":ss":i.floor(t)<t?"hh:mm":o.floor(t)<t?"hh A":s.floor(t)<t?a.floor(t)<t?"MMM DD":"ddd DD":c.floor(t)<t?"MMMM":"YYYY"}(e,n))}clone(){return new _a(this.options)}}var Ta,Pa=window&&window.__decorate||function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};let Ca=Ta=class extends ia{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:eo,tickMethod:Go,tickCount:5}}constructor(t){super(t)}clone(){return new Ta(this.options)}};function Na(t,e,n){if(null===t)return[-.5,.5];const r=Sr(t,e),i=new zo({domain:r,range:[0,1],padding:n}).getBandWidth();return[-i/2,i/2]}function La(t,e,n){return e*(1-t)+n*t}Ca=Ta=Pa([function(t,e){return n=>{n.prototype.rescale=function(){this.initRange(),this.nice();const[t]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t))},n.prototype.initRange=function(){const{interpolator:e}=this.options;this.options.range=t(e)},n.prototype.composeOutput=function(t,n){const{domain:r,interpolator:i,round:o}=this.getOptions(),a=e(r.map(t)),s=o?(t=>e=>{const n=t(e);return Xi(n)?Math.round(n):n})(i):i;this.output=oi(s,a,n,t)},n.prototype.invert=void 0}}((function(t){return[t(0),t(1)]}),(t=>{const[e,n]=t;return oi(So(0,1),ai(e,n))}))],Ca);const ja=(t={})=>{const{padding:e=0,paddingX:n=e,paddingY:r=e,random:i=Math.random}=t;return(t,e)=>{const{encode:o,scale:a}=e,{x:s,y:c}=a,[l]=ln(o,"x"),[u]=ln(o,"y"),f=Na(l,s,n),h=Na(u,c,r),d=t.map((()=>La(i(),...h))),p=t.map((()=>La(i(),...f)));return[t,V({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:rn(d),dx:rn(p)}})]}};ja.props={};const Ra=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(t,r)=>{const{encode:i,scale:o}=r,{x:a}=o,[s]=ln(i,"x"),c=Na(s,a,e),l=t.map((()=>La(n(),...c)));return[t,V({scale:{x:{padding:.5}}},r,{encode:{dx:rn(l)}})]}};Ra.props={};const Ia=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(t,r)=>{const{encode:i,scale:o}=r,{y:a}=o,[s]=ln(i,"y"),c=Na(s,a,e),l=t.map((()=>La(n(),...c)));return[t,V({scale:{y:{padding:.5}}},r,{encode:{dy:rn(l)}})]}};Ia.props={};const Ba=(t={})=>{const{groupBy:e="x"}=t;return(t,n)=>{const{encode:r}=n,i=he(r,["x"]),o=Object.entries(i).filter((([t])=>t.startsWith("y"))).map((([t])=>[t,ln(r,t)[0]])),a=o.map((([e])=>[e,new Array(t.length)])),s=Or(e,t,n),c=new Array(s.length);for(let t=0;t<s.length;t++){const e=s[t].flatMap((t=>o.map((([,e])=>+e[t])))),[n,r]=kn(e);c[t]=(n+r)/2}const l=Math.max(...c);for(let t=0;t<s.length;t++){const e=l-c[t],n=s[t];for(const t of n)for(let n=0;n<o.length;n++){const[,r]=o[n],[,i]=a[n];i[t]=+r[t]+e}}return[t,V({},n,{encode:Object.fromEntries(a.map((([t,e])=>[t,rn(e,ln(r,t)[1])])))})]}};Ba.props={};const Da=(t={})=>{const{groupBy:e="x",series:n=!0}=t;return(t,r)=>{const{encode:i}=r,[o]=ln(i,"y"),[a,s]=ln(i,"y1");n?un(i,"series","color"):ln(i,"color");const c=Or(e,t,r),l=new Array(t.length);for(const t of c){const e=t.map((t=>+o[t]));for(let n=0;n<t.length;n++){const r=t[n],i=Math.max(...e.filter(((t,e)=>e!==n)));l[r]=o[r]>i?i:o[r]}}return[t,V({},r,{encode:{y1:rn(l,s)}})]}};function Fa(t,e){return[t[0]]}function za(t,e){return[t[t.length-1]]}function Ga(t,e){return[t[Un(t,(t=>e[t]))]]}function Wa(t,e){return[t[Kn(t,(t=>e[t]))]]}Da.props={};const $a=(t={})=>{const{groupBy:e="series",channel:n,selector:r}=t;return(t,i)=>{const{encode:o}=i,a=Or(e,t,i),[s]=ln(o,n),c=function(t){return"function"==typeof t?t:{first:Fa,last:za,max:Ga,min:Wa}[t]||Fa}(r);return[a.flatMap((t=>c(t,s))),i]}};$a.props={};const Ha=(t={})=>{const{selector:e}=t,n=he(t,["selector"]);return $a(Object.assign({channel:"x",selector:e},n))};Ha.props={};const Ya=(t={})=>{const{selector:e}=t,n=he(t,["selector"]);return $a(Object.assign({channel:"y",selector:e},n))};function Va(t){return e=>null===e?t:`${t} of ${e}`}function qa(){return[(t,e)=>tr(t,(t=>+e[t])),Va("mean")]}function Ua(){return[(t,e)=>er(t,(t=>+e[t])),Va("median")]}function Xa(){return[(t,e)=>qn(t,(t=>+e[t])),Va("max")]}function Ka(){return[(t,e)=>Xn(t,(t=>+e[t])),Va("min")]}function Za(){return[(t,e)=>t.length,Va("count")]}function Qa(){return[(t,e)=>nr(t,(t=>+e[t])),Va("sum")]}function Ja(){return[(t,e)=>e[t[0]],Va("first")]}function ts(){return[(t,e)=>e[t[t.length-1]],Va("last")]}Ya.props={};const es=(t={})=>{const{groupBy:e}=t,n=he(t,["groupBy"]);return(t,r)=>{const{data:i,encode:o}=r,a=e(t,r);if(!a)return[t,r];const s=Object.entries(n).map((([t,e])=>{const[n,r]=function(t){if("function"==typeof t)return[t,null];const e={mean:qa,max:Xa,count:Za,first:Ja,last:ts,sum:Qa,min:Ka,median:Ua}[t];if(!e)throw new Error(`Unknown reducer: ${t}.`);return e()}(e),[s,c]=ln(o,t),l=((t,e)=>{if(t)return t;const{from:n}=e;if(!n)return t;const[,r]=ln(o,n);return r})(c,e),u=a.map((t=>n(t,null!=s?s:i)));return[t,Object.assign(Object.assign({},sn(u,(null==r?void 0:r(l))||l)),{aggregate:!0})]})),c=Object.keys(o).map((t=>{const[e,n]=ln(o,t),r=a.map((t=>e[t[0]]));return[t,rn(r,n)]})),l=a.map((t=>i[t[0]]));return[vr(a),V({},r,{data:l,encode:Object.fromEntries([...c,...s])})]}};es.props={};const ns=(t={})=>{const{channels:e=["x","y"]}=t,n=he(t,["channels"]);return es(Object.assign(Object.assign({},n),{groupBy:(t,n)=>Or(e,t,n)}))};ns.props={};const rs=(t={})=>ns(Object.assign(Object.assign({},t),{channels:["x","color","series"]}));rs.props={};const is=(t={})=>ns(Object.assign(Object.assign({},t),{channels:["y","color","series"]}));is.props={};const os=(t={})=>ns(Object.assign(Object.assign({},t),{channels:["color"]}));function as(t,e,n){var r;const{reverse:i,slice:o,channel:a}=n,s=he(n,["reverse","slice","channel"]),{encode:c,scale:l={}}=e,u=null===(r=l[a])||void 0===r?void 0:r.domain,[f]=ln(c,a),h=function(t,e,n){const{by:r=t,reducer:i="max"}=e,[o]=ln(n,r);if("function"==typeof i)return t=>i(t,o);if("max"===i)return t=>qn(t,(t=>+o[t]));if("min"===i)return t=>Xn(t,(t=>+o[t]));if("sum"===i)return t=>nr(t,(t=>+o[t]));if("median"===i)return t=>er(t,(t=>+o[t]));if("mean"===i)return t=>tr(t,(t=>+o[t]));if("first"===i)return t=>o[t[0]];if("last"===i)return t=>o[t[t.length-1]];throw new Error(`Unknown reducer: ${i}`)}(a,s,c),d=function(t,e,n){if(!Array.isArray(n))return t;const r=new Set(n);return t.filter((t=>r.has(e[t])))}(t,f,u),p=function(t,e,n){return(2!==e.length?Rn(Nn(t,e,n),(([t,e],[n,r])=>dn(e,r)||dn(t,n))):Rn(Pn(t,n),(([t,n],[r,i])=>e(n,i)||dn(t,r)))).map((([t])=>t))}(d,h,(t=>f[t]));i&&p.reverse();const g="number"==typeof o?[0,o]:o,m=o?p.slice(...g):p;return[t,V(e,{scale:{[a]:{domain:m}}})]}os.props={};const ss=(t={})=>{const{reverse:e=!1,slice:n,channel:r,ordinal:i=!0}=t,o=he(t,["reverse","slice","channel","ordinal"]);return(t,a)=>i?as(t,a,Object.assign({reverse:e,slice:n,channel:r},o)):function(t,e,n){const{reverse:r,channel:i}=n,{encode:o}=e,[a]=ln(o,i),s=Rn(t,(t=>a[t]));return r&&s.reverse(),[s,e]}(t,a,Object.assign({reverse:e,slice:n,channel:r},o))};ss.props={};const cs=(t={})=>ss(Object.assign(Object.assign({},t),{channel:"x"}));cs.props={};const ls=(t={})=>ss(Object.assign(Object.assign({},t),{channel:"color"}));ls.props={};const us=(t={})=>ss(Object.assign(Object.assign({},t),{channel:"y"}));us.props={};const fs=(t={})=>{const{field:e,channel:n="y",reducer:r="sum"}=t;return(t,i)=>{const{data:o,encode:a}=i,[s]=ln(a,"x"),c=e?function(t,e){return"string"==typeof e?t.map((t=>t[e])):t.map(e)}(o,e):ln(a,n)[0],l=function(t,e){if("function"==typeof t)return n=>t(n,e);if("sum"===t)return t=>nr(t,(t=>+e[t]));throw new Error(`Unknown reducer: ${t}`)}(r,c),u=Ln(t,l,(t=>s[t])).map((t=>t[1]));return[t,V({},i,{scale:{x:{flex:u}}})]}};function hs([t,e],[n,r]){return[t-n,e-r]}function ds([t,e],[n,r]){return[t+n,e+r]}function ps([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function gs([t,e]){return Math.atan2(e,t)}function ms([t,e]){return gs([t,e])+Math.PI/2}function ys(t,e){const n=gs(t),r=gs(e);return n<r?r-n:2*Math.PI-(n-r)}function vs(t){let e=1/0,n=-1/0,r=1/0,i=-1/0;for(const[o,a]of t)e=Math.min(o,e),n=Math.max(o,n),r=Math.min(a,r),i=Math.max(a,i);return[e,r,n-e,i-r]}function bs([t,e],[n,r]){return[(t+n)/2,(e+r)/2]}function xs(t){const{padding:e=0,direction:n="col"}=t;return(t,r,i)=>{const o=t.length;if(0===o)return[];const{innerWidth:a,innerHeight:s}=i,c=s/a;let l=Math.ceil(Math.sqrt(r/c)),u=a/l,f=Math.ceil(r/l),h=f*u;for(;h>s;)l+=1,u=a/l,f=Math.ceil(r/l),h=f*u;const d=s-f*u,p=f<=1?0:d/(f-1),[g,m]=f<=1?[(a-o*u)/(o-1),(s-u)/2]:[0,0];return t.map(((t,r)=>{const[i,o,a,s]=vs(t),c="col"===n?r%l:Math.floor(r/f),h="col"===n?Math.floor(r/l):r%f;return`translate(${c*u-i+g*c+.5*e}, ${(f-h-1)*u+d-o-p*h-m+.5*e}) scale(${(u-e)/a}, ${(u-e)/s})`}))}}fs.props={};const ws=t=>(e,n)=>[e,V({},n,{modifier:xs(t),axis:!1})];ws.props={};const Ms="thresholds";function Os(t){const[e,n]=kn(t);return Math.min(200,function(t,e,n){const r=On(t),i=En(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}(t,e,n))}const Es=(t={})=>{const{groupChannels:e=["color"],binChannels:n=["x","y"]}=t,r=he(t,["groupChannels","binChannels"]),i={};return es(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(r).filter((([t])=>!t.startsWith(Ms))))),Object.fromEntries(n.flatMap((t=>{const e=([e])=>+i[t].get(e).split(",")[1];return e.from=t,[[t,([e])=>+i[t].get(e).split(",")[0]],[`${t}1`,e]]})))),{groupBy:(t,o)=>{const{encode:a}=o,s=n.map((t=>{const[e]=ln(a,t);return e})),c=ur(r,Ms),l=t.filter((t=>s.every((e=>cr(e[t]))))),u=[...e.map((t=>{const[e]=ln(a,t);return e})).filter(cr).map((t=>e=>t[e])),...n.map(((t,e)=>{const n=s[e],r=c[t]||Os(n),o=Vn().thresholds(r).value((t=>+n[t]))(l),a=new Map(o.flatMap((t=>{const{x0:e,x1:n}=t,r=`${e},${n}`;return t.map((t=>[t,r]))})));return i[t]=a,t=>a.get(t)}))];return Array.from(Pn(l,(t=>u.map((e=>e(t))).join("-"))).values())}}))};Es.props={};const ks=(t={})=>{const{thresholds:e}=t;return Es(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))};function Ss(t,e,n,r){const i=t.length;if(r>=i||0===r)return t;const o=n=>1*e[t[n]],a=e=>1*n[t[e]],s=[],c=(i-2)/(r-2);let l,u,f,h=0;s.push(h);for(let t=0;t<r-2;t++){let e=0,n=0,r=Math.floor((t+1)*c)+1,d=Math.floor((t+2)*c)+1;d=Math.min(d,i);const p=d-r;for(;r<d;r++)e+=o(r),n+=a(r);e/=p,n/=p;let g=Math.floor((t+0)*c)+1;const m=Math.floor((t+1)*c)+1,y=[o(h),a(h)];for(l=u=-1;g<m;g++)u=.5*Math.abs((y[0]-e)*(o(g)-y[1])-(y[0]-a(g))*(n-y[0])),u>l&&(l=u,f=g);s.push(f),h=f}return s.push(i-1),s.map((e=>t[e]))}ks.props={};const As=(t={})=>{const{strategy:e="median",thresholds:n=2e3,groupBy:r=["series","color"]}=t,i=function(t){if("function"==typeof t)return t;if("lttb"===t)return Ss;const e={first:t=>[t[0]],last:t=>[t[t.length-1]],min:(t,e,n)=>[t[Kn(t,(t=>n[t]))]],max:(t,e,n)=>[t[Un(t,(t=>n[t]))]],median:(t,e,n)=>{return[t[(r=t,i=t=>n[t],Jn(r,.5,i))]];var r,i}},n=e[t]||e.median;return(t,e,r,i)=>{const o=function(t,e){const n=t.length,r=[];let i=0;for(;i<n;)r.push(t.slice(i,i+=e));return r}(t,Math.max(1,Math.floor(t.length/i)));return o.flatMap((t=>n(t,e,r)))}}(e);return(t,e)=>{const{encode:o}=e,a=Or(r,t,e),[s]=ln(o,"x"),[c]=ln(o,"y");return[a.flatMap((t=>i(t,s,c,n))),e]}};As.props={};const _s=(t={})=>(e,n)=>{const{encode:r,data:i}=n,o=Object.entries(t).map((([t,e])=>{const[n]=ln(r,t);if(!n)return null;const[i,o=!0]=function(t){return"object"==typeof t?[t.value,t.ordinal]:[t,!0]}(e);if("function"==typeof i)return t=>i(n[t]);if(o){const t=Array.isArray(i)?i:[i];return 0===t.length?null:e=>t.includes(n[e])}{const[t,e]=i;return r=>n[r]>=t&&n[r]<=e}})).filter(cr);if(0===o.length)return[e,n];const a=e.filter((t=>o.every((e=>e(t))))),s=a.map(((t,e)=>e)),c=Object.entries(r).map((([t,e])=>[t,Object.assign(Object.assign({},e),{value:s.map((t=>e.value[a[t]])).filter((t=>void 0!==t))})]));return[s,V({},n,{encode:Object.fromEntries(c),data:a.map((t=>i[t]))})]};function Ts(t){return function(){return t}}_s.props={};const Ps=Math.abs,Cs=Math.atan2,Ns=Math.cos,Ls=Math.max,js=Math.min,Rs=Math.sin,Is=Math.sqrt,Bs=1e-12,Ds=Math.PI,Fs=Ds/2,zs=2*Ds;function Gs(t){return t>=1?Fs:t<=-1?-Fs:Math.asin(t)}const Ws=Math.PI,$s=2*Ws,Hs=1e-6,Ys=$s-Hs;function Vs(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class qs{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?Vs:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Vs;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=Math.round(arguments[e]*n)/n+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,r){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(t,e,n,r,i,o){this._append`C${+t},${+e},${+n},${+r},${this._x1=+i},${this._y1=+o}`}arcTo(t,e,n,r,i){if(t=+t,e=+e,n=+n,r=+r,(i=+i)<0)throw new Error(`negative radius: ${i}`);let o=this._x1,a=this._y1,s=n-t,c=r-e,l=o-t,u=a-e,f=l*l+u*u;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(f>Hs)if(Math.abs(u*s-c*l)>Hs&&i){let h=n-o,d=r-a,p=s*s+c*c,g=h*h+d*d,m=Math.sqrt(p),y=Math.sqrt(f),v=i*Math.tan((Ws-Math.acos((p+f-g)/(2*m*y)))/2),b=v/y,x=v/m;Math.abs(b-1)>Hs&&this._append`L${t+b*l},${e+b*u}`,this._append`A${i},${i},0,0,${+(u*h>l*d)},${this._x1=t+x*s},${this._y1=e+x*c}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,n,r,i,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(r),s=n*Math.sin(r),c=t+a,l=e+s,u=1^o,f=o?r-i:i-r;null===this._x1?this._append`M${c},${l}`:(Math.abs(this._x1-c)>Hs||Math.abs(this._y1-l)>Hs)&&this._append`L${c},${l}`,n&&(f<0&&(f=f%$s+$s),f>Ys?this._append`A${n},${n},0,1,${u},${t-a},${e-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:f>Hs&&this._append`A${n},${n},0,${+(f>=Ws)},${u},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function Us(){return new qs}function Xs(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new qs(e)}function Ks(t){return t.innerRadius}function Zs(t){return t.outerRadius}function Qs(t){return t.startAngle}function Js(t){return t.endAngle}function tc(t){return t&&t.padAngle}function ec(t,e,n,r,i,o,a){var s=t-n,c=e-r,l=(a?o:-o)/Is(s*s+c*c),u=l*c,f=-l*s,h=t+u,d=e+f,p=n+u,g=r+f,m=(h+p)/2,y=(d+g)/2,v=p-h,b=g-d,x=v*v+b*b,w=i-o,M=h*g-p*d,O=(b<0?-1:1)*Is(Ls(0,w*w*x-M*M)),E=(M*b-v*O)/x,k=(-M*v-b*O)/x,S=(M*b+v*O)/x,A=(-M*v+b*O)/x,_=E-m,T=k-y,P=S-m,C=A-y;return _*_+T*T>P*P+C*C&&(E=S,k=A),{cx:E,cy:k,x01:-u,y01:-f,x11:E*(i/w-1),y11:k*(i/w-1)}}function nc(){var t=Ks,e=Zs,n=Ts(0),r=null,i=Qs,o=Js,a=tc,s=null,c=Xs(l);function l(){var l,u,f=+t.apply(this,arguments),h=+e.apply(this,arguments),d=i.apply(this,arguments)-Fs,p=o.apply(this,arguments)-Fs,g=Ps(p-d),m=p>d;if(s||(s=l=c()),h<f&&(u=h,h=f,f=u),h>Bs)if(g>zs-Bs)s.moveTo(h*Ns(d),h*Rs(d)),s.arc(0,0,h,d,p,!m),f>Bs&&(s.moveTo(f*Ns(p),f*Rs(p)),s.arc(0,0,f,p,d,m));else{var y,v,b=d,x=p,w=d,M=p,O=g,E=g,k=a.apply(this,arguments)/2,S=k>Bs&&(r?+r.apply(this,arguments):Is(f*f+h*h)),A=js(Ps(h-f)/2,+n.apply(this,arguments)),_=A,T=A;if(S>Bs){var P=Gs(S/f*Rs(k)),C=Gs(S/h*Rs(k));(O-=2*P)>Bs?(w+=P*=m?1:-1,M-=P):(O=0,w=M=(d+p)/2),(E-=2*C)>Bs?(b+=C*=m?1:-1,x-=C):(E=0,b=x=(d+p)/2)}var N=h*Ns(b),L=h*Rs(b),j=f*Ns(M),R=f*Rs(M);if(A>Bs){var I,B=h*Ns(x),D=h*Rs(x),F=f*Ns(w),z=f*Rs(w);if(g<Ds)if(I=function(t,e,n,r,i,o,a,s){var c=n-t,l=r-e,u=a-i,f=s-o,h=f*c-u*l;if(!(h*h<Bs))return[t+(h=(u*(e-o)-f*(t-i))/h)*c,e+h*l]}(N,L,F,z,B,D,j,R)){var G=N-I[0],W=L-I[1],$=B-I[0],H=D-I[1],Y=1/Rs(function(t){return t>1?0:t<-1?Ds:Math.acos(t)}((G*$+W*H)/(Is(G*G+W*W)*Is($*$+H*H)))/2),V=Is(I[0]*I[0]+I[1]*I[1]);_=js(A,(f-V)/(Y-1)),T=js(A,(h-V)/(Y+1))}else _=T=0}E>Bs?T>Bs?(y=ec(F,z,N,L,h,T,m),v=ec(B,D,j,R,h,T,m),s.moveTo(y.cx+y.x01,y.cy+y.y01),T<A?s.arc(y.cx,y.cy,T,Cs(y.y01,y.x01),Cs(v.y01,v.x01),!m):(s.arc(y.cx,y.cy,T,Cs(y.y01,y.x01),Cs(y.y11,y.x11),!m),s.arc(0,0,h,Cs(y.cy+y.y11,y.cx+y.x11),Cs(v.cy+v.y11,v.cx+v.x11),!m),s.arc(v.cx,v.cy,T,Cs(v.y11,v.x11),Cs(v.y01,v.x01),!m))):(s.moveTo(N,L),s.arc(0,0,h,b,x,!m)):s.moveTo(N,L),f>Bs&&O>Bs?_>Bs?(y=ec(j,R,B,D,f,-_,m),v=ec(N,L,F,z,f,-_,m),s.lineTo(y.cx+y.x01,y.cy+y.y01),_<A?s.arc(y.cx,y.cy,_,Cs(y.y01,y.x01),Cs(v.y01,v.x01),!m):(s.arc(y.cx,y.cy,_,Cs(y.y01,y.x01),Cs(y.y11,y.x11),!m),s.arc(0,0,f,Cs(y.cy+y.y11,y.cx+y.x11),Cs(v.cy+v.y11,v.cx+v.x11),m),s.arc(v.cx,v.cy,_,Cs(v.y11,v.x11),Cs(v.y01,v.x01),!m))):s.arc(0,0,f,M,w,m):s.lineTo(j,R)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-Ds/2;return[Ns(r)*n,Rs(r)*n]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Ts(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Ts(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:Ts(+t),l):n},l.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Ts(+t),l):r},l.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:Ts(+t),l):i},l.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:Ts(+t),l):o},l.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:Ts(+t),l):a},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function rc(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function ic(t){this._context=t}function oc(t){return new ic(t)}function ac(t){return t[0]}function sc(t){return t[1]}function cc(t,e){var n=Ts(!0),r=null,i=oc,o=null,a=Xs(s);function s(s){var c,l,u,f=(s=rc(s)).length,h=!1;for(null==r&&(o=i(u=a())),c=0;c<=f;++c)!(c<f&&n(l=s[c],c,s))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+t(l,c,s),+e(l,c,s));if(u)return o=null,u+""||null}return t="function"==typeof t?t:void 0===t?ac:Ts(t),e="function"==typeof e?e:void 0===e?sc:Ts(e),s.x=function(e){return arguments.length?(t="function"==typeof e?e:Ts(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:Ts(+t),s):e},s.defined=function(t){return arguments.length?(n="function"==typeof t?t:Ts(!!t),s):n},s.curve=function(t){return arguments.length?(i=t,null!=r&&(o=i(r)),s):i},s.context=function(t){return arguments.length?(null==t?r=o=null:o=i(r=t),s):r},s}function lc(t,e,n){var r=null,i=Ts(!0),o=null,a=oc,s=null,c=Xs(l);function l(l){var u,f,h,d,p,g=(l=rc(l)).length,m=!1,y=new Array(g),v=new Array(g);for(null==o&&(s=a(p=c())),u=0;u<=g;++u){if(!(u<g&&i(d=l[u],u,l))===m)if(m=!m)f=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),h=u-1;h>=f;--h)s.point(y[h],v[h]);s.lineEnd(),s.areaEnd()}m&&(y[u]=+t(d,u,l),v[u]=+e(d,u,l),s.point(r?+r(d,u,l):y[u],n?+n(d,u,l):v[u]))}if(p)return s=null,p+""||null}function u(){return cc().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?ac:Ts(+t),e="function"==typeof e?e:Ts(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?sc:Ts(+n),l.x=function(e){return arguments.length?(t="function"==typeof e?e:Ts(+e),r=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:Ts(+e),l):t},l.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Ts(+t),l):r},l.y=function(t){return arguments.length?(e="function"==typeof t?t:Ts(+t),n=null,l):e},l.y0=function(t){return arguments.length?(e="function"==typeof t?t:Ts(+t),l):e},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Ts(+t),l):n},l.lineX0=l.lineY0=function(){return u().x(t).y(e)},l.lineY1=function(){return u().x(t).y(n)},l.lineX1=function(){return u().x(r).y(e)},l.defined=function(t){return arguments.length?(i="function"==typeof t?t:Ts(!!t),l):i},l.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),l):a},l.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),l):o},l}Us.prototype=qs.prototype,ic.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var uc=hc(oc);function fc(t){this._curve=t}function hc(t){function e(e){return new fc(t(e))}return e._curve=t,e}function dc(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(hc(t)):e()._curve},t}function pc(){}function gc(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function mc(t,e){this._context=t,this._k=(1-e)/6}function yc(t,e){this._context=t,this._k=(1-e)/6}function vc(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>Bs){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>Bs){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*l+t._x1*t._l23_2a-e*t._l12_2a)/u,a=(a*l+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function bc(t,e){this._context=t,this._alpha=e}function xc(t,e){this._context=t,this._alpha=e}fc.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}},mc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:gc(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:gc(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new mc(t,e)}return n.tension=function(e){return t(+e)},n}(0),yc.prototype={areaStart:pc,areaEnd:pc,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:gc(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new yc(t,e)}return n.tension=function(e){return t(+e)},n}(0),bc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:vc(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return e?new bc(t,e):new mc(t,0)}return n.alpha=function(e){return t(+e)},n}(.5),xc.prototype={areaStart:pc,areaEnd:pc,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:vc(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var wc=function t(e){function n(t){return e?new xc(t,e):new yc(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Mc(t){this._context=t}function Oc(t){return new Mc(t)}function Ec(t){return t<0?-1:1}function kc(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(Ec(o)+Ec(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Sc(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Ac(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function _c(t){this._context=t}function Tc(t){this._context=new Pc(t)}function Pc(t){this._context=t}function Cc(t){return new _c(t)}function Nc(t){return new Tc(t)}function Lc(t,e){this._context=t,this._t=e}function jc(t){return new Lc(t,.5)}function Rc(t){return new Lc(t,0)}function Ic(t){return new Lc(t,1)}function Bc(t){const{transformations:e}=t.getOptions();return e.map((([t])=>t)).filter((t=>"transpose"===t)).length%2!=0}function Dc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"polar"===t))}function Fc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"reflect"===t))&&e.some((([t])=>t.startsWith("transpose")))}function zc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"helix"===t))}function Gc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"parallel"===t))}function Wc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"fisheye"===t))}function $c(t){return zc(t)||Dc(t)}function Hc(t){const{transformations:e}=t.getOptions(),[,,,n,r]=e.find((t=>"polar"===t[0]));return[+n,+r]}function Yc(t,e=!0){const{transformations:n}=t.getOptions(),[,r,i]=n.find((t=>"polar"===t[0]));return e?[180*+r/Math.PI,180*+i/Math.PI]:[r,i]}Mc.prototype={areaStart:pc,areaEnd:pc,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},_c.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ac(this,this._t0,Sc(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Ac(this,Sc(this,n=kc(this,t,e)),n);break;default:Ac(this,this._t0,n=kc(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(Tc.prototype=Object.create(_c.prototype)).point=function(t,e){_c.prototype.point.call(this,e,t)},Pc.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}},Lc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var Vc="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},qc={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||t,a),c=n?n+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],s]:t._events[c].push(s):(t._events[c]=s,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(t){var e=n?n+t:t,r=this._events[e];return r?r.fn?1:r.length:0},s.prototype.emit=function(t,e,r,i,o,a){var s=n?n+t:t;if(!this._events[s])return!1;var c,l,u=this._events[s],f=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),f){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,r),!0;case 4:return u.fn.call(u.context,e,r,i),!0;case 5:return u.fn.call(u.context,e,r,i,o),!0;case 6:return u.fn.call(u.context,e,r,i,o,a),!0}for(l=1,c=new Array(f-1);l<f;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var h,d=u.length;for(l=0;l<d;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),f){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,r);break;case 4:u[l].fn.call(u[l].context,e,r,i);break;default:if(!c)for(h=1,c=new Array(f-1);h<f;h++)c[h-1]=arguments[h];u[l].fn.apply(u[l].context,c)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var c=0,l=[],u=s.length;c<u;c++)(s[c].fn!==e||i&&!s[c].once||r&&s[c].context!==r)&&l.push(s[c]);l.length?this._events[o]=1===l.length?l[0]:l:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&a(this,e)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}(qc);var Uc=qc.exports;function Xc(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Kc(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Zc(){}var Qc=.7,Jc=1/Qc,tl="\\s*([+-]?\\d+)\\s*",el="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",nl="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",rl=/^#([0-9a-f]{3,8})$/,il=new RegExp("^rgb\\("+[tl,tl,tl]+"\\)$"),ol=new RegExp("^rgb\\("+[nl,nl,nl]+"\\)$"),al=new RegExp("^rgba\\("+[tl,tl,tl,el]+"\\)$"),sl=new RegExp("^rgba\\("+[nl,nl,nl,el]+"\\)$"),cl=new RegExp("^hsl\\("+[el,nl,nl]+"\\)$"),ll=new RegExp("^hsla\\("+[el,nl,nl,el]+"\\)$"),ul={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function fl(){return this.rgb().formatHex()}function hl(){return this.rgb().formatRgb()}function dl(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=rl.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?pl(e):3===n?new ml(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?gl(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?gl(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=il.exec(t))?new ml(e[1],e[2],e[3],1):(e=ol.exec(t))?new ml(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=al.exec(t))?gl(e[1],e[2],e[3],e[4]):(e=sl.exec(t))?gl(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=cl.exec(t))?xl(e[1],e[2]/100,e[3]/100,1):(e=ll.exec(t))?xl(e[1],e[2]/100,e[3]/100,e[4]):ul.hasOwnProperty(t)?pl(ul[t]):"transparent"===t?new ml(NaN,NaN,NaN,0):null}function pl(t){return new ml(t>>16&255,t>>8&255,255&t,1)}function gl(t,e,n,r){return r<=0&&(t=e=n=NaN),new ml(t,e,n,r)}function ml(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function yl(){return"#"+bl(this.r)+bl(this.g)+bl(this.b)}function vl(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function bl(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function xl(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Ml(t,e,n,r)}function wl(t){if(t instanceof Ml)return new Ml(t.h,t.s,t.l,t.opacity);if(t instanceof Zc||(t=dl(t)),!t)return new Ml;if(t instanceof Ml)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 Ml(a,s,c,t.opacity)}function Ml(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Ol(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 El(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function kl(t,e){var n=Math.min.apply(Math,ve([],ye(t),!1)),r=Math.min.apply(Math,ve([],ye(e),!1));return{x:n,y:r,width:Math.max.apply(Math,ve([],ye(t),!1))-n,height:Math.max.apply(Math,ve([],ye(e),!1))-r}}function Sl(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function Al(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function _l(t,e,n,r,i,o,a){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),c=1/0,l=-1/0,u=[o,a],f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var h=s+f;o<a?o<h&&h<a&&u.push(h):a<h&&h<o&&u.push(h)}for(f=0;f<u.length;f++){var d=Sl(t,0,n,r,i,u[f]);d<c&&(c=d),d>l&&(l=d)}var p=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),g=1/0,m=-1/0,y=[o,a];for(f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var v=p+f;o<a?o<v&&v<a&&y.push(v):a<v&&v<o&&y.push(v)}for(f=0;f<y.length;f++){var b=Al(0,e,n,r,i,y[f]);b<g&&(g=b),b>m&&(m=b)}return{x:c,y:g,width:l-c,height:m-g}}Xc(Zc,dl,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:fl,formatHex:fl,formatHsl:function(){return wl(this).formatHsl()},formatRgb:hl,toString:hl}),Xc(ml,(function(t,e,n,r){return 1===arguments.length?((i=t)instanceof Zc||(i=dl(i)),i?new ml((i=i.rgb()).r,i.g,i.b,i.opacity):new ml):new ml(t,e,n,null==r?1:r);var i}),Kc(Zc,{brighter:function(t){return t=null==t?Jc:Math.pow(Jc,t),new ml(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?Qc:Math.pow(Qc,t),new ml(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:yl,formatHex:yl,formatRgb:vl,toString:vl})),Xc(Ml,(function(t,e,n,r){return 1===arguments.length?wl(t):new Ml(t,e,n,null==r?1:r)}),Kc(Zc,{brighter:function(t){return t=null==t?Jc:Math.pow(Jc,t),new Ml(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Qc:Math.pow(Qc,t),new Ml(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new ml(Ol(t>=240?t-240:t+120,i,r),Ol(t,i,r),Ol(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Tl=1e-4;function Pl(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,ve([],ye(t.concat([d])),!1)),i.apply(void 0,ve([],ye(e.concat([d])),!1))];(v=El(c[0],c[1],p[0],p[1]))<s&&(a=d,s=v)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var g=t.length;return{x:t[g-1],y:e[g-1]}}s=1/0;for(h=0;h<32&&!(f<Tl);h++){var m=a-f,y=a+f,v=(p=[i.apply(void 0,ve([],ye(t.concat([m])),!1)),i.apply(void 0,ve([],ye(e.concat([m])),!1))],El(c[0],c[1],p[0],p[1]));if(m>=0&&v<s)a=m,s=v;else{var b=[i.apply(void 0,ve([],ye(t.concat([y])),!1)),i.apply(void 0,ve([],ye(e.concat([y])),!1))],x=El(c[0],c[1],b[0],b[1]);y<=1&&x<s?(a=y,s=x):f*=.5}}return{x:i.apply(void 0,ve([],ye(t.concat([a])),!1)),y:i.apply(void 0,ve([],ye(e.concat([a])),!1))}}function Cl(t,e,n,r){return El(t,e,n,r)}function Nl(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function Ll(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 jl(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 Rl(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(C(s,0))C(c,0)||(i=-l/c)>=0&&i<=1&&u.push(i);else{var f=c*c-4*s*l;C(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 Il(t,e,n,r,i,o,a,s){for(var c=[t,a],l=[e,s],u=Rl(t,n,i,a),f=Rl(e,r,o,s),h=0;h<u.length;h++)c.push(jl(t,n,i,a,u[h]));for(h=0;h<f.length;h++)l.push(jl(e,r,o,s,f[h]));return kl(c,l)}function Bl(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 Pl([t,n,i,a],[e,r,o,s],c,l,jl,u)}(t,e,n,r,i,o,a,s,c,l,u);return El(f.x,f.y,c,l)}function Dl(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+=El(r[0],r[1],i[0],i[1])}return e}(t)}function Fl(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function zl(t,e,n){var r=t+n-2*e;if(C(r,0))return[.5];var i=(t-e)/r;return i<=1&&i>=0?[i]:[]}function Gl(t,e,n,r,i,o){var a=zl(t,n,i)[0],s=zl(e,r,o)[0],c=[t,i],l=[e,o];return void 0!==a&&c.push(Fl(t,n,i,a)),void 0!==s&&l.push(Fl(e,r,o,s)),kl(c,l)}function Wl(t,e,n,r,i,o,a,s){var c=function(t,e,n,r,i,o,a,s){return Pl([t,n,i],[e,r,o],a,s,Fl)}(t,e,n,r,i,o,a,s);return El(c.x,c.y,a,s)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==Vc||"undefined"!=typeof self&&self;var $l={exports:{}};!function(t,e){t.exports=function(){function t(t,n,i,o,a){e(t,n,i||0,o||t.length-1,a||r)}function e(t,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,c=r-i+1,l=Math.log(s),u=.5*Math.exp(2*l/3),f=.5*Math.sqrt(l*u*(s-u)/s)*(c-s/2<0?-1:1);e(t,r,Math.max(i,Math.floor(r-c*u/s+f)),Math.min(o,Math.floor(r+(s-c)*u/s+f)),a)}var 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 m(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function y(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(e,n,r,i,o){for(var a=[n,r];a.length;)if(!((r=a.pop())-(n=a.pop())<=i)){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,o),a.push(n,s,s,r)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!m(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;o<e.children.length;o++){var a=e.children[o],s=e.leaf?r(a):a;m(t,s)&&(e.leaf?n.push(a):g(t,s)?this._all(a,n):i.push(a))}e=i.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!m(t,e))return!1;for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(m(t,o)){if(e.leaf||g(t,o))return!0;n.push(i)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=y([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,a=this.data,s=this.toBBox(t),c=[],l=[];a||c.length;){if(a||(a=c.pop(),r=c[c.length-1],n=l.pop(),i=!0),a.leaf){var u=o(t,a.children,e);if(-1!==u)return a.children.splice(u,1),c.push(a),this._condense(c),this}i||a.leaf||!g(a,s)?r?(n++,a=r.children[n],i=!1):a=null:(c.push(a),l.push(n),n=0,r=a,a=a.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,r){var i,o=n-e+1,s=this._maxEntries;if(o<=s)return a(i=y(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),(i=y([])).leaf=!1,i.height=r;var c=Math.ceil(o/s),l=c*Math.ceil(Math.sqrt(s));v(t,e,n,l,this.compareMinX);for(var u=e;u<=n;u+=l){var f=Math.min(u+l-1,n);v(t,u,f,c,this.compareMinY);for(var 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}()}($l);var Hl,Yl,Vl=$l.exports;!function(t){t.GROUP="g",t.CIRCLE="circle",t.ELLIPSE="ellipse",t.IMAGE="image",t.RECT="rect",t.LINE="line",t.POLYLINE="polyline",t.POLYGON="polygon",t.TEXT="text",t.PATH="path",t.HTML="html",t.MESH="mesh"}(Hl||(Hl={})),function(t){t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE"}(Yl||(Yl={}));var ql=function(){function t(){this.plugins=[]}return t.prototype.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},t.prototype.removeAllRenderingPlugins=function(){var t=this;this.plugins.forEach((function(e){var n=t.context.renderingPlugins.indexOf(e);n>=0&&t.context.renderingPlugins.splice(n,1)}))},t}(),Ul=function(){function t(t){this.clipSpaceNearZ=Yl.NEGATIVE_ONE,this.plugins=[],this.config=fe({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},t)}return t.prototype.registerPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));-1===e&&this.plugins.push(t)},t.prototype.unregisterPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)},t.prototype.getPlugins=function(){return this.plugins},t.prototype.getPlugin=function(t){return this.plugins.find((function(e){return e.name===t}))},t.prototype.getConfig=function(){return this.config},t.prototype.setConfig=function(t){Object.assign(this.config,t)},t}();function Xl(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Kl(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Zl(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Ql(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Jl(t){return void 0===t?0:t>360||t<-360?t%360:t}function tu(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?Rt(t):T(t)?Bt(t,e,n):Bt(t[0],t[1]||e,t[2]||n)}function eu(t){return t*(Math.PI/180)}function nu(t){return t*(180/Math.PI)}function ru(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,o=ye(xt(jt(),e),3),a=o[0],s=o[1],c=o[2],l=Math.asin(-e[2]/a);return l<i?l>-i?(n=Math.atan2(e[6]/s,e[10]/c),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/s,e[5]/s)):(r=0,n=Math.atan2(e[4]/s,e[5]/s)),t[0]=n,t[1]=l,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=r*r,s=i*i,c=o*o,l=n*n+a+s+c,u=n*o-r*i;return u>.499995*l?(t[0]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):u<-.499995*l?(t[0]=-Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-o*r)),t[1]=Math.atan2(2*(n*o+r*i),1-2*(s+c)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(a+s))),t}(t,e)}function iu(t,e,n,r,i){var o,a,s,c,l,u,f,h,d,p,g=Math.cos(t),m=Math.sin(t);return o=r*g,a=i*m,s=0,c=-r*m,l=i*g,u=0,f=e,h=n,d=1,(p=new tt(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 ou(t){var e=t[0],n=t[1],r=t[3],i=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(r*r+i*i);e*i-n*r<0&&(e<i?o=-o:a=-a),o&&(e*=1/o,n*=1/o),a&&(r*=1/a,i*=1/a);var s=nu(Math.atan2(n,e));return[t[6],t[7],o,a,s]}var au=rt(),su=rt(),cu=Qt(),lu=[jt(),jt(),jt()],uu=jt();function fu(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 hu,du=function(){function t(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return t.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]},t.prototype.update=function(t,e){Xl(this.center,t),Xl(this.halfExtents,e),Kl(this.min,this.center,this.halfExtents),Zl(this.max,this.center,this.halfExtents)},t.prototype.setMinMax=function(t,e){Zl(this.center,e,t),Ql(this.center,this.center,.5),Kl(this.halfExtents,e,t),Ql(this.halfExtents,this.halfExtents,.5),Xl(this.min,t),Xl(this.max,e)},t.prototype.getMin=function(){return this.min},t.prototype.getMax=function(){return this.max},t.prototype.add=function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],o=n[2],a=this.halfExtents,s=a[0],c=a[1],l=a[2],u=r-s,f=r+s,h=i-c,d=i+c,p=o-l,g=o+l,m=e.center,y=m[0],v=m[1],b=m[2],x=e.halfExtents,w=x[0],M=x[1],O=x[2],E=y-w,k=y+w,S=v-M,A=v+M,_=b-O,T=b+O;E<u&&(u=E),k>f&&(f=k),S<h&&(h=S),A>d&&(d=A),_<p&&(p=_),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}},t.prototype.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,o=t.halfExtents,a=e[0],s=e[4],c=e[8],l=e[1],u=e[5],f=e[9],h=e[2],d=e[6],p=e[10],g=Math.abs(a),m=Math.abs(s),y=Math.abs(c),v=Math.abs(l),b=Math.abs(u),x=Math.abs(f),w=Math.abs(h),M=Math.abs(d),O=Math.abs(p);n[0]=e[12]+a*i[0]+s*i[1]+c*i[2],n[1]=e[13]+l*i[0]+u*i[1]+f*i[2],n[2]=e[14]+h*i[0]+d*i[1]+p*i[2],r[0]=g*o[0]+m*o[1]+y*o[2],r[1]=v*o[0]+b*o[1]+x*o[2],r[2]=w*o[0]+M*o[1]+O*o[2],Kl(this.min,n,r),Zl(this.max,n,r)},t.prototype.intersects=function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return n[0]<=r[0]&&e[0]>=i[0]&&n[1]<=r[1]&&e[1]>=i[1]&&n[2]<=r[2]&&e[2]>=i[2]},t.prototype.intersection=function(e){if(!this.intersects(e))return null;var n,r,i,o=new t,a=(n=[0,0,0],r=this.getMin(),i=e.getMin(),n[0]=Math.max(r[0],i[0]),n[1]=Math.max(r[1],i[1]),n[2]=Math.max(r[2],i[2]),n),s=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}([0,0,0],this.getMax(),e.getMax());return o.setMinMax(a,s),o},t.prototype.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?Xl([0,0,0],this.min):272===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]},t.prototype.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?Xl([0,0,0],this.max):272===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]},t}(),pu=function(){function t(t,e){this.distance=t||0,this.normal=e||Bt(0,1,0),this.updatePNVertexFlag()}return t.prototype.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)},t.prototype.distanceToPoint=function(t){return Ht(t,this.normal)-this.distance},t.prototype.normalize=function(){var t=1/Zt(this.normal);Wt(this.normal,this.normal,t),this.distance*=t},t.prototype.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&i<=1;return o&&n&&Vt(n,t,e,i),o},t}();!function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"}(hu||(hu={}));var gu,mu,yu,vu=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new pu)}return t.prototype.extractFromVPMatrix=function(t){var e=ye(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],m=e[14],y=e[15];Ft(this.planes[0].normal,o-n,l-a,d-u),this.planes[0].distance=y-p,Ft(this.planes[1].normal,o+n,l+a,d+u),this.planes[1].distance=y+p,Ft(this.planes[2].normal,o+r,l+s,d+f),this.planes[2].distance=y+g,Ft(this.planes[3].normal,o-r,l-s,d-f),this.planes[3].distance=y-g,Ft(this.planes[4].normal,o-i,l-c,d-h),this.planes[4].distance=y-m,Ft(this.planes[5].normal,o+i,l+c,d+h),this.planes[5].distance=y+m,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),bu=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y},t}(),xu=function(){function t(t,e,n,r){this.x=t,this.y=e,this.width=n,this.height=r,this.left=t,this.right=t+n,this.top=e,this.bottom=e+r}return t.prototype.toJSON=function(){},t}(),wu="Method not implemented.",Mu="Use document.documentElement instead.";!function(t){t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING"}(gu||(gu={})),function(t){t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC"}(mu||(mu={})),function(t){t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE"}(yu||(yu={}));var Ou,Eu,ku,Su,Au,_u="updated",Tu=2e-4,Pu=function(){function t(){this.clipSpaceNearZ=Yl.NEGATIVE_ONE,this.eventEmitter=new Uc,this.matrix=rt(),this.right=Bt(1,0,0),this.up=Bt(0,1,0),this.forward=Bt(0,0,1),this.position=Bt(0,0,1),this.focalPoint=Bt(0,0,0),this.distanceVector=Bt(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=rt(),this.projectionMatrixInverse=rt(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=gu.EXPLORING,this.trackingMode=mu.DEFAULT,this.projectionMode=yu.PERSPECTIVE,this.frustum=new vu,this.orthoMatrix=rt()}return t.prototype.isOrtho=function(){return this.projectionMode===yu.ORTHOGRAPHIC},t.prototype.getProjectionMode=function(){return this.projectionMode},t.prototype.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},t.prototype.getPerspectiveInverse=function(){return this.projectionMatrixInverse},t.prototype.getFrustum=function(){return this.frustum},t.prototype.getPosition=function(){return this.position},t.prototype.getFocalPoint=function(){return this.focalPoint},t.prototype.getDollyingStep=function(){return this.dollyingStep},t.prototype.getNear=function(){return this.near},t.prototype.getFar=function(){return this.far},t.prototype.getZoom=function(){return this.zoom},t.prototype.getOrthoMatrix=function(){return this.orthoMatrix},t.prototype.getView=function(){return this.view},t.prototype.setEnableUpdate=function(t){this.enableUpdate=t},t.prototype.setType=function(t,e){return this.type=t,this.type===gu.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===gu.TRACKING&&void 0!==e&&this.setTrackingMode(e),this},t.prototype.setProjectionMode=function(t){return this.projectionMode=t,this},t.prototype.setTrackingMode=function(t){if(this.type!==gu.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this},t.prototype.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},t.prototype.getViewTransform=function(){return lt(rt(),this.matrix)},t.prototype.getWorldTransform=function(){return this.matrix},t.prototype.jitterProjectionMatrix=function(t,e){var n=mt(rt(),[t,e,0]);this.jitteredProjectionMatrix=ft(rt(),n,this.projectionMatrix)},t.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},t.prototype.setMatrix=function(t){return this.matrix=t,this._update(),this},t.prototype.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},t.prototype.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},t.prototype.setNear=function(t){return this.projectionMode===yu.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this},t.prototype.setFar=function(t){return this.projectionMode===yu.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this},t.prototype.setViewOffset=function(t,e,n,r,i,o){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.projectionMode===yu.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},t.prototype.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===yu.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},t.prototype.setZoom=function(t){return this.zoom=t,this.projectionMode===yu.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===yu.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},t.prototype.setZoomByViewportPoint=function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,i=n.y,o=this.roll;this.rotate(0,0,-o),this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t),this.rotate(0,0,o);var a=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=Bt(a.x-r,a.y-i,0),c=Ht(s,this.right)/It(this.right),l=Ht(s,this.up)/It(this.up);return this.pan(-c,-l),this},t.prototype.setPerspective=function(t,e,n,r){var i;this.projectionMode=yu.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var o=this.near*Math.tan(eu(.5*this.fov))/this.zoom,a=2*o,s=this.aspect*a,c=-.5*s;if(null===(i=this.view)||void 0===i?void 0:i.enabled){var l=this.view.fullWidth,u=this.view.fullHeight;c+=this.view.offsetX*s/l,o-=this.view.offsetY*a/u,s*=this.view.width/l,a*=this.view.height/u}return function(t,e,n,r,i,o,a,s){void 0===s&&(s=!1);var c,l,u=2*o/(n-e),f=2*o/(r-i),h=(n+e)/(n-e),d=(r+i)/(r-i);s?(c=-a/(a-o),l=-a*o/(a-o)):(c=-(a+o)/(a-o),l=-2*a*o/(a-o)),t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=f,t[6]=0,t[7]=0,t[8]=h,t[9]=d,t[10]=c,t[11]=-1,t[12]=0,t[13]=0,t[14]=l,t[15]=0}(this.projectionMatrix,c,c+s,o,o-a,t,this.far,this.clipSpaceNearZ===Yl.ZERO),dt(this.projectionMatrix,this.projectionMatrix,Bt(1,-1,1)),lt(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},t.prototype.setOrthographic=function(t,e,n,r,i,o){var a;this.projectionMode=yu.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=o;var s=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,u=(this.top+this.bottom)/2,f=l-s,h=l+s,d=u+c,p=u-c;if(null===(a=this.view)||void 0===a?void 0:a.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,m=(this.top-this.bottom)/this.view.fullHeight/this.zoom;h=(f+=g*this.view.offsetX)+g*this.view.width,p=(d-=m*this.view.offsetY)-m*this.view.height}return this.clipSpaceNearZ===Yl.NEGATIVE_ONE?At(this.projectionMatrix,f,h,p,d,i,o):_t(this.projectionMatrix,f,h,p,d,i,o),dt(this.projectionMatrix,this.projectionMatrix,Bt(1,-1,1)),lt(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},t.prototype.setPosition=function(t,e,n){void 0===e&&(e=this.position[1]),void 0===n&&(n=this.position[2]);var r=tu(t,e,n);return this._setPosition(r),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},t.prototype.setFocalPoint=function(t,e,n){void 0===e&&(e=this.focalPoint[1]),void 0===n&&(n=this.focalPoint[2]);var r=Bt(0,1,0);if(this.focalPoint=tu(t,e,n),this.trackingMode===mu.CINEMATIC){var i=Gt(jt(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var o=It(i),a=nu(Math.asin(e/o)),s=90+nu(Math.atan2(n,t)),c=rt();gt(c,c,eu(s)),pt(c,c,eu(a)),r=qt(jt(),[0,1,0],c)}return lt(this.matrix,Tt(rt(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},t.prototype.getDistance=function(){return this.distance},t.prototype.getDistanceVector=function(){return this.distanceVector},t.prototype.setDistance=function(t){if(this.distance===t||t<0)return this;this.distance=t,this.distance<Tu&&(this.distance=Tu),this.dollyingStep=this.distance/100;var e=jt();t=this.distance;var n=this.forward,r=this.focalPoint;return e[0]=t*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate(),this},t.prototype.setMaxDistance=function(t){return this.maxDistance=t,this},t.prototype.setMinDistance=function(t){return this.minDistance=t,this},t.prototype.setAzimuth=function(t){return this.azimuth=Jl(t),this.computeMatrix(),this._getAxes(),this.type===gu.ORBITING||this.type===gu.EXPLORING?this._getPosition():this.type===gu.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getAzimuth=function(){return this.azimuth},t.prototype.setElevation=function(t){return this.elevation=Jl(t),this.computeMatrix(),this._getAxes(),this.type===gu.ORBITING||this.type===gu.EXPLORING?this._getPosition():this.type===gu.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getElevation=function(){return this.elevation},t.prototype.setRoll=function(t){return this.roll=Jl(t),this.computeMatrix(),this._getAxes(),this.type===gu.ORBITING||this.type===gu.EXPLORING?this._getPosition():this.type===gu.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getRoll=function(){return this.roll},t.prototype._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},t.prototype.computeMatrix=function(){var t=ee(te(),[0,0,1],eu(this.roll));st(this.matrix);var e=ee(te(),[1,0,0],eu((this.rotateWorld&&this.type!==gu.TRACKING||this.type===gu.TRACKING?1:-1)*this.elevation)),n=ee(te(),[0,1,0],eu((this.rotateWorld&&this.type!==gu.TRACKING||this.type===gu.TRACKING?1:-1)*this.azimuth)),r=ne(te(),n,e);r=ne(te(),r,t);var i=Ot(rt(),r);this.type===gu.ORBITING||this.type===gu.EXPLORING?(ht(this.matrix,this.matrix,this.focalPoint),ft(this.matrix,this.matrix,i),ht(this.matrix,this.matrix,[0,0,this.distance])):this.type===gu.TRACKING&&(ht(this.matrix,this.matrix,this.position),ft(this.matrix,this.matrix,i))},t.prototype._setPosition=function(t,e,n){this.position=tu(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1,this._getOrthoMatrix()},t.prototype._getAxes=function(){Dt(this.right,tu(Jt(Qt(),[1,0,0,0],this.matrix))),Dt(this.up,tu(Jt(Qt(),[0,1,0,0],this.matrix))),Dt(this.forward,tu(Jt(Qt(),[0,0,1,0],this.matrix))),$t(this.right,this.right),$t(this.up,this.up),$t(this.forward,this.forward)},t.prototype._getAngles=function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=It(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===gu.TRACKING||this.rotateWorld?(this.elevation=nu(Math.asin(e/r)),this.azimuth=nu(Math.atan2(-t,-n))):(this.elevation=-nu(Math.asin(e/r)),this.azimuth=-nu(Math.atan2(-t,-n)))},t.prototype._getPosition=function(){Dt(this.position,tu(Jt(Qt(),[0,0,0,1],this.matrix))),this._getDistance()},t.prototype._getFocalPoint=function(){var t,e;Ut(this.distanceVector,[0,0,-this.distance],(t=et(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),zt(this.focalPoint,this.position,this.distanceVector),this._getDistance()},t.prototype._getDistance=function(){this.distanceVector=Gt(jt(),this.focalPoint,this.position),this.distance=It(this.distanceVector),this.dollyingStep=this.distance/100},t.prototype._getOrthoMatrix=function(){if(this.projectionMode===yu.ORTHOGRAPHIC){var t=this.position,e=ee(te(),[0,0,1],-this.roll*Math.PI/180);Mt(this.orthoMatrix,e,Bt((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),Bt(this.zoom,this.zoom,1),t)}},t.prototype.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=ft(rt(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(_u)}},t.prototype.rotate=function(t,e,n){throw new Error(wu)},t.prototype.pan=function(t,e){throw new Error(wu)},t.prototype.dolly=function(t){throw new Error(wu)},t.prototype.createLandmark=function(t,e){throw new Error(wu)},t.prototype.gotoLandmark=function(t,e){throw new Error(wu)},t.prototype.cancelLandmarkAnimation=function(){throw new Error(wu)},t}();function Cu(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return n.cache=a.set(o,s)||a,s};return n.cache=new(Cu.Cache||Map),n}Cu.Cache=Map,function(t){t[t.kUnknown=0]="kUnknown",t[t.kNumber=1]="kNumber",t[t.kPercentage=2]="kPercentage",t[t.kEms=3]="kEms",t[t.kPixels=4]="kPixels",t[t.kRems=5]="kRems",t[t.kDegrees=6]="kDegrees",t[t.kRadians=7]="kRadians",t[t.kGradians=8]="kGradians",t[t.kTurns=9]="kTurns",t[t.kMilliseconds=10]="kMilliseconds",t[t.kSeconds=11]="kSeconds",t[t.kInteger=12]="kInteger"}(Ou||(Ou={})),function(t){t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther"}(Eu||(Eu={})),function(t){t[t.kAll=0]="kAll",t[t.kNonNegative=1]="kNonNegative",t[t.kInteger=2]="kInteger",t[t.kNonNegativeInteger=3]="kNonNegativeInteger",t[t.kPositiveInteger=4]="kPositiveInteger"}(ku||(ku={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Su||(Su={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Au||(Au={}));var Nu,Lu=[{name:"em",unit_type:Ou.kEms},{name:"px",unit_type:Ou.kPixels},{name:"deg",unit_type:Ou.kDegrees},{name:"rad",unit_type:Ou.kRadians},{name:"grad",unit_type:Ou.kGradians},{name:"ms",unit_type:Ou.kMilliseconds},{name:"s",unit_type:Ou.kSeconds},{name:"rem",unit_type:Ou.kRems},{name:"turn",unit_type:Ou.kTurns}];!function(t){t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType"}(Nu||(Nu={}));var ju,Ru=function(t){return t?"number"===t?Ou.kNumber:"percent"===t||"%"===t?Ou.kPercentage:function(t){return Lu.find((function(e){return e.name===t})).unit_type}(t):Ou.kUnknown},Iu=function(t){var e=1;switch(t){case Ou.kPixels:case Ou.kDegrees:case Ou.kSeconds:break;case Ou.kMilliseconds:e=.001;break;case Ou.kRadians:e=180/Math.PI;break;case Ou.kGradians:e=.9;break;case Ou.kTurns:e=360}return e},Bu=function(t){switch(t){case Ou.kNumber:case Ou.kInteger:return"";case Ou.kPercentage:return"%";case Ou.kEms:return"em";case Ou.kRems:return"rem";case Ou.kPixels:return"px";case Ou.kDegrees:return"deg";case Ou.kRadians:return"rad";case Ou.kGradians:return"grad";case Ou.kMilliseconds:return"ms";case Ou.kSeconds:return"s";case Ou.kTurns:return"turn"}return""},Du=function(){function t(){}return t.isAngle=function(t){return t===Ou.kDegrees||t===Ou.kRadians||t===Ou.kGradians||t===Ou.kTurns},t.isLength=function(t){return t>=Ou.kEms&&t<Ou.kDegrees},t.isRelativeUnit=function(t){return t===Ou.kPercentage||t===Ou.kEms||t===Ou.kRems},t.isTime=function(t){return t===Ou.kSeconds||t===Ou.kMilliseconds},t.prototype.toString=function(){return this.buildCSSText(Su.kNo,Au.kNo,"")},t.prototype.isNumericValue=function(){return this.getType()>=Nu.kUnitType&&this.getType()<=Nu.kClampType},t}(),Fu=function(t){function e(e){var n=t.call(this)||this;return n.colorSpace=e,n}return ue(e,t),e.prototype.getType=function(){return Nu.kColorType},e.prototype.to=function(t){return this},e}(Du);!function(t){t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient"}(ju||(ju={}));var zu=function(t){function e(e,n){var r=t.call(this)||this;return r.type=e,r.value=n,r}return ue(e,t),e.prototype.clone=function(){return new e(this.type,this.value)},e.prototype.buildCSSText=function(t,e,n){return n},e.prototype.getType=function(){return Nu.kColorType},e}(Du),Gu=function(t){function e(e){var n=t.call(this)||this;return n.value=e,n}return ue(e,t),e.prototype.clone=function(){return new e(this.value)},e.prototype.getType=function(){return Nu.kKeywordType},e.prototype.buildCSSText=function(t,e,n){return n+this.value},e}(Du),Wu=Cu((function(t){return void 0===t&&(t=""),t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))})),$u=function(t){return t.split("").map((function(t,e){return t.toUpperCase()===t?"".concat(0!==e?"-":"").concat(t.toLowerCase()):t})).join("")};function Hu(t){return"function"==typeof t}var Yu={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},Vu=Cu((function(t){var e=Wu(t),n=Yu[e];return e=(null==n?void 0:n.alias)||e})),qu=function(t,e){void 0===e&&(e="");var n="";return Number.isFinite(t)?(!function(t){if(!t)throw new Error}(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e},Uu=function(t){return function(t){switch(t){case Eu.kUNumber:return Ou.kNumber;case Eu.kULength:return Ou.kPixels;case Eu.kUPercent:return Ou.kPercentage;case Eu.kUTime:return Ou.kSeconds;case Eu.kUAngle:return Ou.kDegrees;default:return Ou.kUnknown}}(function(t){switch(t){case Ou.kNumber:case Ou.kInteger:return Eu.kUNumber;case Ou.kPercentage:return Eu.kUPercent;case Ou.kPixels:return Eu.kULength;case Ou.kMilliseconds:case Ou.kSeconds:return Eu.kUTime;case Ou.kDegrees:case Ou.kRadians:case Ou.kGradians:case Ou.kTurns:return Eu.kUAngle;default:return Eu.kUOther}}(t))},Xu=function(t){function e(e,n){void 0===n&&(n=Ou.kNumber);var r,i=t.call(this)||this;return r="string"==typeof n?Ru(n):n,i.unit=r,i.value=e,i}return ue(e,t),e.prototype.clone=function(){return new e(this.value,this.unit)},e.prototype.equals=function(t){var e=t;return this.value===e.value&&this.unit===e.unit},e.prototype.getType=function(){return Nu.kUnitType},e.prototype.convertTo=function(t){if(this.unit===t)return new e(this.value,this.unit);var n=Uu(this.unit);if(n!==Uu(t)||n===Ou.kUnknown)return null;var r=Iu(this.unit)/Iu(t);return new e(this.value*r,t)},e.prototype.buildCSSText=function(t,e,n){var r;switch(this.unit){case Ou.kUnknown:break;case Ou.kInteger:r=Number(this.value).toFixed(0);break;case Ou.kNumber:case Ou.kPercentage:case Ou.kEms:case Ou.kRems:case Ou.kPixels:case Ou.kDegrees:case Ou.kRadians:case Ou.kGradians:case Ou.kMilliseconds:case Ou.kSeconds:case Ou.kTurns:var i=this.value,o=Bu(this.unit);if(i<-999999||i>999999){var a=Bu(this.unit);r=!Number.isFinite(i)||Number.isNaN(i)?qu(i,a):i+(a||"")}else r="".concat(i).concat(o)}return n+=r},e}(Du),Ku=new Xu(0,"px");new Xu(1,"px");var Zu,Qu,Ju=new Xu(0,"deg"),tf=function(t){function e(e,n,r,i,o){void 0===i&&(i=1),void 0===o&&(o=!1);var a=t.call(this,"rgb")||this;return a.r=e,a.g=n,a.b=r,a.alpha=i,a.isNone=o,a}return ue(e,t),e.prototype.clone=function(){return new e(this.r,this.g,this.b,this.alpha)},e.prototype.buildCSSText=function(t,e,n){return n+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")},e}(Fu),ef=new Gu("unset"),nf=new Gu("initial"),rf=new Gu("inherit"),of={"":ef,unset:ef,initial:nf,inherit:rf},af=function(t){return of[t]||(of[t]=new Gu(t)),of[t]},sf=new tf(0,0,0,0,!0),cf=new tf(0,0,0,0),lf=Cu((function(t,e,n,r){return new tf(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),uf=function(t,e){return void 0===e&&(e=Ou.kNumber),new Xu(t,e)},ff=new Xu(50,"%");!function(t){t[t.Standard=0]="Standard"}(Zu||(Zu={})),function(t){t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"}(Qu||(Qu={}));var hf,df={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new xu(0,0,0,0)};function pf(t){var e=t.type,n=t.value;return"hex"===e?"#".concat(n):"literal"===e?n:"rgb"===e?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}!function(t){t.COORDINATE="<coordinate>",t.COLOR="<color>",t.PAINT="<paint>",t.NUMBER="<number>",t.ANGLE="<angle>",t.OPACITY_VALUE="<opacity-value>",t.SHADOW_BLUR="<shadow-blur>",t.LENGTH="<length>",t.PERCENTAGE="<percentage>",t.LENGTH_PERCENTAGE="<length> | <percentage>",t.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",t.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",t.LIST_OF_POINTS="<list-of-points>",t.PATH="<path>",t.FILTER="<filter>",t.Z_INDEX="<z-index>",t.OFFSET_DISTANCE="<offset-distance>",t.DEFINED_PATH="<defined-path>",t.MARKER="<marker>",t.TRANSFORM="<transform>",t.TRANSFORM_ORIGIN="<transform-origin>",t.TEXT="<text>",t.TEXT_TRANSFORM="<text-transform>"}(hf||(hf={}));var gf=function(){var t={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},e="";function n(t){throw new Error(e+": "+t)}function r(){var t=d(i);return e.length>0&&n("Invalid input not EOF"),t}function i(){return o("linear-gradient",t.linearGradient,s)||o("repeating-linear-gradient",t.repeatingLinearGradient,s)||o("radial-gradient",t.radialGradient,c)||o("repeating-radial-gradient",t.repeatingRadialGradient,c)||o("conic-gradient",t.conicGradient,c)}function o(e,r,i){return a(r,(function(r){var o=i();return o&&(b(t.comma)||n("Missing comma before color stops")),{type:e,orientation:o,colorStops:d(p)}}))}function a(e,r){var i=b(e);if(i){b(t.startCall)||n("Missing (");var o=r(i);return b(t.endCall)||n("Missing )"),o}}function s(){return v("directional",t.sideOrCorner,1)||v("angular",t.angleValue,1)}function c(){var n,r,i=l();return i&&((n=[]).push(i),r=e,b(t.comma)&&((i=l())?n.push(i):e=r)),n}function l(){var t=function(){var t=v("shape",/^(circle)/i,0);t&&(t.style=y()||u());return t}()||function(){var t=v("shape",/^(ellipse)/i,0);t&&(t.style=m()||u());return t}();if(t)t.at=f();else{var e=u();if(e){t=e;var n=f();n&&(t.at=n)}else{var r=h();r&&(t={type:"default-radial",at:r})}}return t}function u(){return v("extent-keyword",t.extentKeywords,1)}function f(){if(v("position",/^at/,0)){var t=h();return t||n("Missing positioning value"),t}}function h(){var t={x:m(),y:m()};if(t.x||t.y)return{type:"position",value:t}}function d(e){var r=e(),i=[];if(r)for(i.push(r);b(t.comma);)(r=e())?i.push(r):n("One extra comma");return i}function p(){var e=v("hex",t.hexColor,1)||a(t.rgbaColor,(function(){return{type:"rgba",value:d(g)}}))||a(t.rgbColor,(function(){return{type:"rgb",value:d(g)}}))||v("literal",t.literalColor,0);return e||n("Expected color definition"),e.length=m(),e}function g(){return b(t.number)[1]}function m(){return v("%",t.percentageValue,1)||v("position-keyword",t.positionKeywords,1)||y()}function y(){return v("px",t.pixelValue,1)||v("em",t.emValue,1)}function v(t,e,n){var r=b(e);if(r)return{type:t,value:r[n]}}function b(t){var n=/^[\n\r\t\s]+/.exec(e);n&&x(n[0].length);var r=t.exec(e);return r&&x(r[0].length),r}function x(t){e=e.substring(t)}return function(t){return e=t,r()}}();var mf=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,yf=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,vf=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,bf=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var xf={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},wf=Cu((function(t){var e;return e="angular"===t.type?Number(t.value):xf[t.value]||0,uf(e,"deg")})),Mf=Cu((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:uf(e,r),cy:uf(n,i)}})),Of=Cu((function(t){var e;if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return gf(t).map((function(t){var e=t.type,n=t.orientation,r=t.colorStops;!function(t){var e,n,r,i=t.length;t[i-1].length=null!==(e=t[i-1].length)&&void 0!==e?e:{type:"%",value:"100"},i>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var o=0,a=Number(t[0].length.value),s=1;s<i;s++){var c=null===(r=t[s].length)||void 0===r?void 0:r.value;if(!y(c)&&!y(a)){for(var l=1;l<s-o;l++)t[o+l].length={type:"%",value:"".concat(a+(Number(c)-a)*l/(s-o))};o=s,a=Number(c)}}}(r);var i=r.map((function(t){return{offset:uf(Number(t.length.value),"%"),color:pf(t)}}));if("linear-gradient"===e)return new zu(ju.LinearGradient,{angle:n?wf(n):Ju,steps:i});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var o=Mf(n[0].at),a=o.cx,s=o.cy,c=void 0;if(n[0].style){var l=n[0].style,u=l.type,f=l.value;c="extent-keyword"===u?af(f):uf(f,u)}return new zu(ju.RadialGradient,{cx:a,cy:s,size:c,steps:i})}}));var n=t[0];if("("===t[1]||"("===t[2])if("l"===n){var r=mf.exec(t);if(r){var i=(null===(e=r[2].match(bf))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return[new zu(ju.LinearGradient,{angle:uf(parseFloat(r[1]),"deg"),steps:i.map((function(t){var e=ye(t,2),n=e[0],r=e[1];return{offset:uf(100*Number(n),"%"),color:r}}))})]}}else if("r"===n){var o=function(t){var e,n=yf.exec(t);if(n){var r=(null===(e=n[4].match(bf))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return{cx:uf(50,"%"),cy:uf(50,"%"),steps:r.map((function(t){var e=ye(t,2),n=e[0],r=e[1];return{offset:uf(100*Number(n),"%"),color:r}}))}}return null}(t);if(o){if(!A(o))return[new zu(ju.RadialGradient,o)];t=o}}else if("p"===n)return function(t){var e=vf.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 Ef(t){return t&&!!t.image}function kf(t){return t&&!y(t.r)&&!y(t.g)&&!y(t.b)}var Sf=Cu((function(t){if(Ef(t))return fe({repetition:"repeat"},t);if(y(t)&&(t=""),"transparent"===t)return cf;"currentColor"===t&&(t="black");var e=Of(t);if(e)return e;var n=dl(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),lf.apply(void 0,ve([],ye(r),!1))}));function Af(t,e){if(kf(t)&&kf(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(_(e[n],0,255));return e[3]=_(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function _f(t,e){if(y(e))return uf(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return uf(Number(e),"px");if("deg".search(t)>=0)return uf(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U"+t}));var r="U("+t.source+")";return n.map((function(t){return uf(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)}))[0]}var Tf=Cu((function(t){return _f(new RegExp("px","g"),t)}));Cu((function(t){return _f(new RegExp("%","g"),t)}));var Pf=function(t){return T(t)||isFinite(Number(t))?uf(Number(t)||0,"px"):_f(new RegExp("px|%|em|rem","g"),t)},Cf=Cu((function(t){return _f(new RegExp("deg|rad|grad|turn","g"),t)}));function Nf(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0,c=Uu(t.unit),l=t.convertTo(c),u=e.convertTo(c);return l&&u?(a=l.value,s=u.value,o=Bu(t.unit)):(Xu.isLength(t.unit)||Xu.isLength(e.unit))&&(a=If(t,i,n),s=If(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function Lf(t){var e=0;return t.unit===Ou.kDegrees?e=t.value:t.unit===Ou.kRadians?e=nu(Number(t.value)):t.unit===Ou.kTurns&&(e=360*Number(t.value)),e}function jf(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):A(t)?n=t.split(" ").map((function(t){return Number(t)})):T(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:1===n.length?[n[0],n[0],n[0],n[0]]:2===n.length?[n[0],n[1],n[0],n[1]]:3===n.length?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]}function Rf(t){return A(t)?t.split(" ").map((function(t){return Pf(t)})):t.map((function(t){return Pf(t.toString())}))}function If(t,e,n){if(0===t.value)return 0;if(t.unit===Ou.kPixels)return Number(t.value);if(t.unit===Ou.kPercentage&&n){var r=n.nodeName===Hl.GROUP?n.getLocalBounds():n.geometry.contentBounds;return t.value/100*r.halfExtents[e]*2}return 0}var Bf=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Df(t){if(void 0===t&&(t=""),"none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,Bf.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return _f(/deg|rad|grad|turn|px|%/g,t)||Sf(t)}))}),n.lastIndex===t.length)return r}return[]}function Ff(t){return t.toString()}var zf=Cu((function(t){return"number"==typeof t?uf(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?uf(Number(t)):uf(0)}));function Gf(t,e){return[t,e,Ff]}function Wf(t,e){return function(n,r){return[n,r,function(n){return Ff(_(n,t,e))}]}}function $f(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function Hf(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=Qe(t.parsedStyle.path.absolutePath,void 0,fe(fe({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function Yf(t,e){return t[0]===e[0]&&t[1]===e[1]}function Vf(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)||C(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 qf(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Cu((function(t){return A(t)?t.split(" ").map(zf):t.map(zf)}));var Uf=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)},Xf=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n);var c=eu(r=j(r,360));if(t.x===a.x&&t.y===a.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var l=(t.x-a.x)/2,u=(t.y-a.y)/2,f={x:Math.cos(c)*l+Math.sin(c)*u,y:-Math.sin(c)*l+Math.cos(c)*u},h=Math.pow(f.x,2)/Math.pow(e,2)+Math.pow(f.y,2)/Math.pow(n,2);h>1&&(e=Math.sqrt(h)*e,n=Math.sqrt(h)*n);var d=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(f.y,2)-Math.pow(n,2)*Math.pow(f.x,2))/(Math.pow(e,2)*Math.pow(f.y,2)+Math.pow(n,2)*Math.pow(f.x,2));d=d<0?0:d;var p=(i!==o?1:-1)*Math.sqrt(d),g=p*(e*f.y/n),m=p*(-n*f.x/e),y={x:Math.cos(c)*g-Math.sin(c)*m+(t.x+a.x)/2,y:Math.sin(c)*g+Math.cos(c)*m+(t.y+a.y)/2},v={x:(f.x-g)/e,y:(f.y-m)/n},b=Uf({x:1,y:0},v),x=Uf(v,{x:(-f.x-g)/e,y:(-f.y-m)/n});!o&&x>0?x-=2*Math.PI:o&&x<0&&(x+=2*Math.PI);var w=b+(x%=2*Math.PI)*s,M=e*Math.cos(w),O=n*Math.sin(w);return{x:Math.cos(c)*M-Math.sin(c)*O+y.x,y:Math.sin(c)*M+Math.cos(c)*O+y.y,ellipticalArcStartAngle:b,ellipticalArcEndAngle:b+x,ellipticalArcAngle:w,ellipticalArcCenter:y,resultantRx:e,resultantRy:n}};function Kf(t,e,n){void 0===n&&(n=!0);var r=t.arcParams,i=r.rx,o=void 0===i?0:i,a=r.ry,s=void 0===a?0:a,c=r.xRotation,l=r.arcFlag,u=r.sweepFlag,f=Xf({x:t.prePoint[0],y:t.prePoint[1]},o,s,c,!!l,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},e),h=Xf({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 Zf(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Qf(t,e){return Zf(t)*Zf(e)?(t[0]*e[0]+t[1]*e[1])/(Zf(t)*Zf(e)):1}function Jf(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Qf(t,e))}function th(t,e){var n=e[1],r=e[2],i=j(eu(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 m=r?g*n*h/r:0,y=n?g*-r*f/n:0,v=(s+l)/2+Math.cos(i)*m-Math.sin(i)*y,b=(c+u)/2+Math.sin(i)*m+Math.cos(i)*y,x=[(f-m)/n,(h-y)/r],w=[(-1*f-m)/n,(-1*h-y)/r],M=Jf([1,0],x),O=Jf(x,w);return Qf(x,w)<=-1&&(O=Math.PI),Qf(x,w)>=1&&(O=0),0===a&&O>0&&(O-=2*Math.PI),1===a&&O<0&&(O+=2*Math.PI),{cx:v,cy:b,rx:Yf(t,[l,u])?0:n,ry:Yf(t,[l,u])?0:r,startAngle:M,endAngle:M+O,xRotation:i,arcFlag:o,sweepFlag:a}}function eh(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 nh(t,e){void 0===e&&(e=t.getLocalTransform());var n=[];switch(t.nodeName){case Hl.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 Hl.CIRCLE:var f=t.parsedStyle,h=f.r,d=void 0===h?0:h,p=f.cx,g=void 0===p?0:p,m=f.cy;n=eh(d,d,g,void 0===m?0:m);break;case Hl.ELLIPSE:var y=t.parsedStyle,v=y.rx,b=void 0===v?0:v,x=y.ry,w=void 0===x?0:x,M=y.cx,O=(g=void 0===M?0:M,y.cy);n=eh(b,w,g,void 0===O?0:O);break;case Hl.POLYLINE:case Hl.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===Hl.POLYGON);break;case Hl.RECT:var E=t.parsedStyle,k=E.width,S=void 0===k?0:k,A=E.height,T=void 0===A?0:A,P=E.x,C=void 0===P?0:P,N=E.y,L=void 0===N?0:N,j=E.radius,R=j&&j.some((function(t){return 0!==t}));n=function(t,e,n,r,i){if(i){var o=ye(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,C,L,R&&j.map((function(t){return _(t,0,Math.min(Math.abs(S)/2,Math.abs(T)/2))})));break;case Hl.PATH:n=ve([],ye(t.parsedStyle.path.absolutePath),!1)}if(n.length)return function(t,e,n){var r=e.parsedStyle,i=r.defX,o=void 0===i?0:i,a=r.defY,s=void 0===a?0:a;return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=Bt(e[1]-o,e[2]-s,0);n&&qt(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 a=Bt(e[1]-o,e[2]-s,0),c=Bt(e[3]-o,e[4]-s,0),l=Bt(e[5]-o,e[6]-s,0);n&&(qt(a,a,n),qt(c,c,n),qt(l,l,n)),r="".concat(e[0]).concat(a[0],",").concat(a[1],",").concat(c[0],",").concat(c[1],",").concat(l[0],",").concat(l[1])}else if("A"===e[0]){var u=Bt(e[6]-o,e[7]-s,0);n&&qt(u,u,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(u[0],",").concat(u[1])}else"Q"===e[0]&&(a=Bt(e[1]-o,e[2]-s,0),c=Bt(e[3]-o,e[4]-s,0),n&&(qt(a,a,n),qt(c,c,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}"));return t+r}),"")}(n,t,e)}var rh=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=Ie(t)}catch(n){e=Ie(""),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&&Yf(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=th(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]&&Yf(n,e[o].currentPoint)&&(e[o].prePoint=u.prePoint);var d=r?[r[r.length-2],r[r.length-1]]:null;u.nextPoint=d;var p=u.prePoint;if(["L","H","V"].includes(l))u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]];else if("Q"===l){var g=[c[1],c[2]];u.startTangent=[p[0]-g[0],p[1]-g[1]],u.endTangent=[n[0]-g[0],n[1]-g[1]]}else if("T"===l)g=qf((v=e[s-1]).currentPoint,p),"Q"===v.command?(u.command="Q",u.startTangent=[p[0]-g[0],p[1]-g[1]],u.endTangent=[n[0]-g[0],n[1]-g[1]]):(u.command="TL",u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]]);else if("C"===l){var m=[c[1],c[2]],y=[c[3],c[4]];u.startTangent=[p[0]-m[0],p[1]-m[1]],u.endTangent=[n[0]-y[0],n[1]-y[1]],0===u.startTangent[0]&&0===u.startTangent[1]&&(u.startTangent=[m[0]-y[0],m[1]-y[1]]),0===u.endTangent[0]&&0===u.endTangent[1]&&(u.endTangent=[y[0]-m[0],y[1]-m[1]])}else if("S"===l){var v;m=qf((v=e[s-1]).currentPoint,p),y=[c[1],c[2]],"C"===v.command?(u.command="C",u.startTangent=[p[0]-m[0],p[1]-m[1]],u.endTangent=[n[0]-y[0],n[1]-y[1]]):(u.command="SQ",u.startTangent=[p[0]-y[0],p[1]-y[1]],u.endTangent=[n[0]-y[0],n[1]-y[1]])}else if("A"===l){var b=Kf(u,0),x=b.x,w=b.y,M=Kf(u,1,!1),O=M.x,E=M.y;u.startTangent=[x,w],u.endTangent=[O,E]}e.push(u)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],o=0;o<t.length;o++){var a=(g=t[o]).currentPoint,s=g.params,c=g.prePoint,l=void 0;switch(g.command){case"Q":l=Gl(c[0],c[1],s[1],s[2],s[3],s[4]);break;case"C":l=Il(c[0],c[1],s[1],s[2],s[3],s[4],s[5],s[6]);break;case"A":var u=g.arcParams;l=_l(u.cx,u.cy,u.rx,u.ry,u.xRotation,u.startAngle,u.endAngle);break;default:n.push(a[0]),r.push(a[1])}l&&(g.box=l,n.push(l.x,l.x+l.width),r.push(l.y,l.y+l.height)),e&&("L"===g.command||"M"===g.command)&&g.prePoint&&g.nextPoint&&i.push(g)}n=n.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0})),r=r.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}));var f=k(n),h=k(r),d=E(n),p=E(r);if(0===i.length)return{x:f,y:h,width:d-f,height:p-h};for(o=0;o<i.length;o++){var g;(a=(g=i[o]).currentPoint)[0]===f?f-=Vf(g,e).xExtra:a[0]===d&&(d+=Vf(g,e).xExtra),a[1]===h?h-=Vf(g,e).yExtra:a[1]===p&&(p+=Vf(g,e).yExtra)}return{x:f,y:h,width:d-f,height:p-h}}(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}}},ih=Cu(rh);function oh(t){return A(t)?ih(t):rh(t)}function ah(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=We(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=We(e.absolutePath,!1),e.curve=i);var o=[r,i];r.length!==i.length&&(o=en(r,i));var a,s,c,l,u,f,h,d,p=Je(o[0])!==Je(o[1])?(a=o[0],s=a.slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):a[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map((function(t){return["C"].concat(t.slice(2))})))):function(t){return t.map((function(t){return Array.isArray(t)?[].concat(t):t}))}(o[0]);return[p,(c=o[1],l=p,u=c.length-1,f=[],h=0,d=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,o){var a,s=i+o;return 0===o||t[s]&&"M"===t[s][0]?(a=t[s],["M"].concat(a.slice(-2))):(s>=e&&(s-=n),t[s])}))}))}(c),d.forEach((function(t,e){c.slice(1).forEach((function(t,n){h+=$e(c[(e+n)%u].slice(-2),l[n%u].slice(-2))})),f[e]=h,h=0})),d[f.indexOf(Math.min.apply(null,f))]),function(t){return t}]}function sh(t,e){var n;n=A(t)?t.split(" ").map((function(t){var e=ye(t.split(","),2),n=e[0],r=e[1];return[Number(n),Number(r)]})):t;var r,i,o=[],a=0,s=Dl(n);n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=Cl(t[0],t[1],n[e+1][0],n[e+1][1]),a+=i,r[1]=a/s,o.push(r))}));var c=Math.min.apply(Math,ve([],ye(n.map((function(t){return t[0]}))),!1)),l=Math.min.apply(Math,ve([],ye(n.map((function(t){return t[1]}))),!1));return e&&(e.parsedStyle.defX=c,e.parsedStyle.defY=l),{points:n,totalLength:s,segments:o}}function ch(t,e){return[t.points,e.points,function(t){return t}]}var lh=null;function uh(t){return function(e){var n=0;return t.map((function(t){return t===lh?e[n++]:t}))}}function fh(t){return t}var hh={matrix:["NNNNNN",[lh,lh,0,0,lh,lh,0,0,0,0,1,0,lh,lh,0,1],fh],matrix3d:["NNNNNNNNNNNNNNNN",fh],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",uh([lh,lh,new Xu(1)]),fh],scalex:["N",uh([lh,new Xu(1),new Xu(1)]),uh([lh,new Xu(1)])],scaley:["N",uh([new Xu(1),lh,new Xu(1)]),uh([new Xu(1),lh])],scalez:["N",uh([new Xu(1),new Xu(1),lh])],scale3d:["NNN",fh],skew:["Aa",null,fh],skewx:["A",null,uh([lh,Ju])],skewy:["A",null,uh([Ju,lh])],translate:["Tt",uh([lh,lh,Ku]),fh],translatex:["T",uh([lh,Ku,Ku]),uh([lh,Ku])],translatey:["T",uh([Ku,lh,Ku]),uh([Ku,lh])],translatez:["L",uh([Ku,Ku,lh])],translate3d:["TTL",fh]};function dh(t){if("none"===(t=(t||"none").toLowerCase().trim()))return[];for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var o=e[1],a=hh[o];if(!a)return[];var s=e[2].split(","),c=a[0];if(c.length<s.length)return[];for(var l=[],u=0;u<c.length;u++){var f=s[u],h=c[u],d=void 0;if(void 0===(d=f?{A:function(t){return"0"===t.trim()?Ju:Cf(t)},N:zf,T:Pf,L:Tf}[h.toUpperCase()](f):{a:Ju,n:l[0],t:Ku}[h]))return[];l.push(d)}if(r.push({t:o,d:l}),n.lastIndex===t.length)return r}return[]}function ph(t){var e,n,r,i;switch(t.t){case"rotatex":return i=eu(Lf(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=eu(Lf(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=eu(Lf(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=eu(Lf(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=eu(Lf(t.d[0])),f=eu(Lf(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=eu(Lf(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=eu(Lf(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=If(t.d[0],0,null)||0,n=If(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=If(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=If(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=If(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=If(t.d[0],0,null)||0,n=If(t.d[1],0,null)||0,r=If(t.d[2],0,null)||0,1];case"perspective":var h=If(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 gh(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 mh(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}(au,t))return!1;if(ot(su,au),su[3]=0,su[7]=0,su[11]=0,su[15]=1,Math.abs(ut(su))<1e-8)return!1;var a,s,c=au[3],l=au[7],u=au[11],f=au[12],h=au[13],d=au[14],p=au[15];if(0!==c||0!==l||0!==u){if(cu[0]=c,cu[1]=l,cu[2]=u,cu[3]=p,!lt(su,su))return!1;ct(su,su),Jt(i,cu,su)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=f,e[1]=h,e[2]=d,s=au,(a=lu)[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]=It(lu[0]),$t(lu[0],lu[0]),r[0]=Ht(lu[0],lu[1]),fu(lu[1],lu[1],lu[0],1,-r[0]),n[1]=It(lu[1]),$t(lu[1],lu[1]),r[0]/=n[1],r[1]=Ht(lu[0],lu[2]),fu(lu[2],lu[2],lu[0],1,-r[1]),r[2]=Ht(lu[1],lu[2]),fu(lu[2],lu[2],lu[1],1,-r[2]),n[2]=It(lu[2]),$t(lu[2],lu[2]),r[1]/=n[2],r[2]/=n[2],Yt(uu,lu[1],lu[2]),Ht(lu[0],uu)<0)for(var g=0;g<3;g++)n[g]*=-1,lu[g][0]*=-1,lu[g][1]*=-1,lu[g][2]*=-1;o[0]=.5*Math.sqrt(Math.max(1+lu[0][0]-lu[1][1]-lu[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-lu[0][0]+lu[1][1]-lu[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-lu[0][0]-lu[1][1]+lu[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+lu[0][0]+lu[1][1]+lu[2][2],0)),lu[2][1]>lu[1][2]&&(o[0]=-o[0]),lu[0][2]>lu[2][0]&&(o[1]=-o[1]),lu[1][0]>lu[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(ph).reduce(gh)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var yh=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;r<4;r++)for(var i=0;i<4;i++)for(var o=0;o<4;o++)n[r][i]+=e[r][o]*t[o][i];return n}return function(e,n,r,i,o){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;s<4;s++)a[s][3]=o[s];for(s=0;s<3;s++)for(var c=0;c<3;c++)a[3][s]+=e[c]*a[c][s];var l=i[0],u=i[1],f=i[2],h=i[3],d=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];d[0][0]=1-2*(u*u+f*f),d[0][1]=2*(l*u-f*h),d[0][2]=2*(l*f+u*h),d[1][0]=2*(l*u+f*h),d[1][1]=1-2*(l*l+f*f),d[1][2]=2*(u*f-l*h),d[2][0]=2*(l*f-u*h),d[2][1]=2*(u*f+l*h),d[2][2]=1-2*(l*l+u*u),a=t(a,d);var p,g=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];for(r[2]&&(g[2][1]=r[2],a=t(a,g)),r[1]&&(g[2][1]=0,g[2][0]=r[0],a=t(a,g)),r[0]&&(g[2][0]=0,g[1][0]=r[0],a=t(a,g)),s=0;s<3;s++)for(c=0;c<3;c++)a[s][c]*=n[s];return 0==(p=a)[0][2]&&0==p[0][3]&&0==p[1][2]&&0==p[1][3]&&0==p[2][0]&&0==p[2][1]&&1==p[2][2]&&0==p[2][3]&&0==p[3][2]&&1==p[3][3]?[a[0][0],a[0][1],a[1][0],a[1][1],a[3][0],a[3][1]]:a[0].concat(a[1],a[2],a[3])}}();function vh(t){return t.toFixed(6).replace(".000000","")}function bh(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=mh(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=mh(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,-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 yh(t[0],t[1],t[2],e,t[4]).map(vh).join(",")}])}function xh(t){return t.replace(/[xy]/,"")}function wh(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function Mh(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(n){var r=t[n],i=r.t,o=r.d,a="scale"===i.substring(0,5)?1:0;e.push({t:i,d:o.map((function(t){return"number"==typeof t?uf(a):uf(a,t.unit)}))})},o=0;o<t.length;o++)i(o)}var a,s,c=[],l=[],u=[];if(t.length!==e.length)c=[(v=bh(t,e))[0]],l=[v[1]],u=[["matrix",[v[2]]]];else for(o=0;o<t.length;o++){var f=t[o].t,h=e[o].t,d=t[o].d,p=e[o].d,g=hh[f],m=hh[h],y=void 0;if(s=h,"perspective"===(a=f)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var v=bh([t[o]],[e[o]]);c.push(v[0]),l.push(v[1]),u.push(["matrix",[v[2]]])}else{if(f===h)y=f;else if(g[2]&&m[2]&&xh(f)===xh(h))y=xh(f),d=g[2](d),p=m[2](p);else{if(!g[1]||!m[1]||wh(f)!==wh(h)){c=[(v=bh(t,e))[0]],l=[v[1]],u=[["matrix",[v[2]]]];break}y=wh(f),d=g[1](d),p=m[1](p)}for(var b=[],x=[],w=[],M=0;M<d.length;M++){v=Nf(d[M],p[M],n,!1,M);b[M]=v[0],x[M]=v[1],w.push(v[2])}c.push(b),l.push(x),u.push([y,w])}}if(r){var O=c;c=l,l=O}return[c,l,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return u[e][1][n](t)})).join(",");return"matrix"===u[e][0]&&16===n.split(",").length&&(u[e][0]="matrix3d"),"matrix3d"===u[e][0]&&6===n.split(",").length&&(u[e][0]="matrix"),u[e][0]+"("+n+")"})).join(" ")}]}var Oh=Cu((function(t){if(A(t)){if("text-anchor"===t)return[uf(0,"px"),uf(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:[Pf(Eh(e[0])),Pf(Eh(e[1]))]}return[uf(t[0]||0,"px"),uf(t[1]||0,"px")]}));function Eh(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var kh=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:hf.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:hf.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:hf.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:hf.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:hf.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:hf.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:hf.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:hf.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:hf.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:hf.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:hf.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:hf.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:hf.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:hf.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:hf.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:hf.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:hf.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:hf.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:hf.FILTER},{n:"clipPath",syntax:hf.DEFINED_PATH},{n:"textPath",syntax:hf.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:hf.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:hf.TRANSFORM},{n:"transformOrigin",p:100,d:function(t){return t===Hl.CIRCLE||t===Hl.ELLIPSE?"center":t===Hl.TEXT?"text-anchor":"left top"},l:!0,syntax:hf.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(t){return t===Hl.CIRCLE||t===Hl.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:hf.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:hf.COORDINATE},{n:"cy",int:!0,d:"0",syntax:hf.COORDINATE},{n:"cz",int:!0,d:"0",syntax:hf.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:hf.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:hf.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:hf.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:hf.COORDINATE},{n:"y",int:!0,d:"0",syntax:hf.COORDINATE},{n:"z",int:!0,d:"0",syntax:hf.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:hf.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:hf.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:hf.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:hf.COORDINATE},{n:"y1",int:!0,l:!0,syntax:hf.COORDINATE},{n:"z1",int:!0,l:!0,syntax:hf.COORDINATE},{n:"x2",int:!0,l:!0,syntax:hf.COORDINATE},{n:"y2",int:!0,l:!0,syntax:hf.COORDINATE},{n:"z2",int:!0,l:!0,syntax:hf.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:hf.PATH,p:50},{n:"points",int:!0,l:!0,syntax:hf.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:hf.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:hf.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:hf.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:hf.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:hf.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:hf.NUMBER,d:function(t){return t===Hl.PATH||t===Hl.POLYGON||t===Hl.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:hf.MARKER},{n:"markerEnd",syntax:hf.MARKER},{n:"markerMid",syntax:hf.MARKER},{n:"markerStartOffset",syntax:hf.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:hf.LENGTH,l:!0,int:!0,d:"0"}],Sh=kh.filter((function(t){return!!t.l})).map((function(t){return t.n})),Ah={},_h=new WeakMap,Th=function(){function t(t){var e=this;this.runtime=t,kh.forEach((function(t){e.registerMetadata(t)}))}return t.prototype.registerMetadata=function(t){ve([t.n],ye(t.a||[]),!1).forEach((function(e){Ah[e]=t}))},t.prototype.unregisterMetadata=function(t){delete Ah[t]},t.prototype.getPropertySyntax=function(t){return this.runtime.CSSPropertySyntaxFactory[t]},t.prototype.processProperties=function(t,e,n){var r=this;if(void 0===n&&(n={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[]}),!this.runtime.enableCSSParsing){Object.assign(t.attributes,e);var i=Object.keys(e),o=t.parsedStyle.clipPath,a=t.parsedStyle.offsetPath;t.parsedStyle=Object.assign(t.parsedStyle,e);var s=!!n.forceUpdateGeometry;if(!s)for(var c=0;c<Sh.length;c++)if(Sh[c]in e){s=!0;break}return e.fill&&(t.parsedStyle.fill=Sf(e.fill)),e.stroke&&(t.parsedStyle.stroke=Sf(e.stroke)),e.shadowColor&&(t.parsedStyle.shadowColor=Sf(e.shadowColor)),e.filter&&(t.parsedStyle.filter=Df(e.filter)),y(e.radius)||(t.parsedStyle.radius=jf(e.radius,4)),y(e.lineDash)||(t.parsedStyle.lineDash=jf(e.lineDash,2)),e.points&&(t.parsedStyle.points=sh(e.points,t)),""===e.path&&(t.parsedStyle.path=fe({},df)),e.path&&(t.parsedStyle.path=oh(e.path),t.parsedStyle.defX=t.parsedStyle.path.rect.x,t.parsedStyle.defY=t.parsedStyle.path.rect.y),e.textTransform&&this.runtime.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:e.textTransform},t,null),e.clipPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",o,e.clipPath,t,this.runtime),e.offsetPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",a,e.offsetPath,t,this.runtime),e.anchor&&(t.parsedStyle.anchor=jf(e.anchor,2)),e.transform&&(t.parsedStyle.transform=dh(e.transform)),e.transformOrigin&&(t.parsedStyle.transformOrigin=Oh(e.transformOrigin)),e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerStart,e.markerStart,null,null)),e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerEnd,e.markerEnd,null,null)),e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator("",e.markerMid,e.markerMid,null,null)),(t.nodeName!==Hl.CIRCLE&&t.nodeName!==Hl.ELLIPSE||y(e.cx)&&y(e.cy))&&(t.nodeName!==Hl.RECT&&t.nodeName!==Hl.IMAGE&&t.nodeName!==Hl.GROUP&&t.nodeName!==Hl.HTML&&t.nodeName!==Hl.TEXT&&t.nodeName!==Hl.MESH||y(e.x)&&y(e.y)&&y(e.z))&&(t.nodeName!==Hl.LINE||y(e.x1)&&y(e.y1)&&y(e.z1)&&y(e.x2)&&y(e.y2)&&y(e.z2))||this.runtime.CSSPropertySyntaxFactory["<coordinate>"].postProcessor(t,i),y(e.zIndex)||this.runtime.CSSPropertySyntaxFactory["<z-index>"].postProcessor(t,i),e.path&&this.runtime.CSSPropertySyntaxFactory["<path>"].postProcessor(t,i),e.points&&this.runtime.CSSPropertySyntaxFactory["<list-of-points>"].postProcessor(t,i),y(e.offsetDistance)||this.runtime.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(t,i),e.transform&&this.runtime.CSSPropertySyntaxFactory["<transform>"].postProcessor(t,i),void(s&&this.updateGeometry(t))}var l=n.skipUpdateAttribute,u=n.skipParse,f=n.forceUpdateGeometry,h=n.usedAttributes,d=f,p=Object.keys(e);p.forEach((function(n){var r;l||(t.attributes[n]=e[n]),!d&&(null===(r=Ah[n])||void 0===r?void 0:r.l)&&(d=!0)})),u||p.forEach((function(e){t.computedStyle[e]=r.parseProperty(e,t.attributes[e],t)})),(null==h?void 0:h.length)&&(p=Array.from(new Set(p.concat(h)))),p.forEach((function(e){e in t.computedStyle&&(t.parsedStyle[e]=r.computeProperty(e,t.computedStyle[e],t))})),d&&this.updateGeometry(t),p.forEach((function(e){e in t.parsedStyle&&r.postProcessProperty(e,t,p)})),this.runtime.enableCSSParsing&&t.children.length&&p.forEach((function(e){e in t.parsedStyle&&r.isPropertyInheritable(e)&&t.children.forEach((function(t){t.internalSetAttribute(e,null,{skipUpdateAttribute:!0,skipParse:!0})}))}))},t.prototype.parseProperty=function(t,e,n){var r=Ah[t],i=e;if((""===e||y(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)i=af(e);else if(r){var o=r.k,a=r.syntax,s=a&&this.getPropertySyntax(a);o&&o.indexOf(e)>-1?i=af(e):s&&s.parser&&(i=s.parser(e,n))}return i},t.prototype.computeProperty=function(t,e,n){var r=Ah[t],i="g-root"===n.id,o=e;if(r){var a=r.syntax,s=r.inh,c=r.d;if(e instanceof Gu){var l=e.value;if("unset"===l&&(l=s&&!i?"inherit":"initial"),"initial"===l)y(c)||(e=this.parseProperty(t,Hu(c)?c(n.nodeName):c,n));else if("inherit"===l){var u=this.tryToResolveProperty(n,t,{inherited:!0});return y(u)?void this.addUnresolveProperty(n,t):u}}var f=a&&this.getPropertySyntax(a);if(f&&f.calculator){var h=n.parsedStyle[t];o=f.calculator(t,h,e,n,this.runtime)}else o=e instanceof Gu?e.value:e}return o},t.prototype.postProcessProperty=function(t,e,n){var r=Ah[t];if(r&&r.syntax){var i=r.syntax&&this.getPropertySyntax(r.syntax);i&&i.postProcessor&&i.postProcessor(e,n)}},t.prototype.addUnresolveProperty=function(t,e){var n=_h.get(t);n||(_h.set(t,[]),n=_h.get(t)),-1===n.indexOf(e)&&n.push(e)},t.prototype.tryToResolveProperty=function(t,e,n){if(void 0===n&&(n={}),n.inherited&&t.parentElement&&function(t,e){var n=_h.get(t);return!n||0===n.length||n.includes(e)}(t.parentElement,e)){var r=t.parentElement.parsedStyle[e];if("unset"===r||"initial"===r||"inherit"===r)return;return r}},t.prototype.recalc=function(t){var e=_h.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),_h.delete(t)}},t.prototype.updateGeometry=function(t){var e=t.nodeName,n=this.runtime.geometryUpdaterFactory[e];if(n){var r=t.geometry;r.contentBounds||(r.contentBounds=new du),r.renderBounds||(r.renderBounds=new du);var i=t.parsedStyle,o=n.update(i,t),a=o.width,s=o.height,c=o.depth,l=void 0===c?0:c,u=o.offsetX,f=void 0===u?0:u,h=o.offsetY,d=void 0===h?0:h,p=o.offsetZ,g=void 0===p?0:p,m=[Math.abs(a)/2,Math.abs(s)/2,l/2],y=i,v=y.stroke,b=y.lineWidth,x=y.increasedLineWidthForHitTesting,w=y.shadowType,M=y.shadowColor,O=y.filter,E=void 0===O?[]:O,k=y.transformOrigin,S=i.anchor;e===Hl.TEXT?delete i.anchor:e===Hl.MESH&&(i.anchor[2]=.5);var A=[(1-2*(S&&S[0]||0))*a/2+f,(1-2*(S&&S[1]||0))*s/2+d,(1-2*(S&&S[2]||0))*m[2]+g];r.contentBounds.update(A,m);var _=e===Hl.POLYLINE||e===Hl.POLYGON||e===Hl.PATH?Math.SQRT2:.5;if(v&&!v.isNone){var T=((b||0)+(x||0))*_;m[0]+=T,m[1]+=T}if(r.renderBounds.update(A,m),M&&w&&"inner"!==w){var P=r.renderBounds,C=P.min,N=P.max,L=i,j=L.shadowBlur||0,R=L.shadowOffsetX||0,I=L.shadowOffsetY||0,B=C[0]-j+R,D=N[0]+j+R,F=C[1]-j+I,z=N[1]+j+I;C[0]=Math.min(C[0],B),N[0]=Math.max(N[0],D),C[1]=Math.min(C[1],F),N[1]=Math.max(N[1],z),r.renderBounds.setMinMax(C,N)}E.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,Zl(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)}})),S=i.anchor;var G=a<0,W=s<0,$=(G?-1:1)*(k?If(k[0],0,t):0),H=(W?-1:1)*(k?If(k[1],1,t):0);$-=(G?-1:1)*(S&&S[0]||0)*r.contentBounds.halfExtents[0]*2,H-=(W?-1:1)*(S&&S[1]||0)*r.contentBounds.halfExtents[1]*2,t.setOrigin($,H),this.runtime.sceneGraphService.dirtifyToRoot(t)}},t.prototype.isPropertyInheritable=function(t){var e=Ah[t];return!!e&&e.inh},t}(),Ph=function(){function t(){this.parser=Cf,this.parserWithCSSDisabled=null,this.mixer=Gf}return t.prototype.calculator=function(t,e,n,r){return Lf(n)},t}(),Ch=function(){function t(){}return t.prototype.calculator=function(t,e,n,r,i){return n instanceof Gu&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)})),n},t}(),Nh=function(){function t(){this.parser=Sf,this.parserWithCSSDisabled=Sf,this.mixer=Af}return t.prototype.calculator=function(t,e,n,r){return n instanceof Gu?"none"===n.value?sf:cf:n},t}(),Lh=function(){function t(){this.parser=Df}return t.prototype.calculator=function(t,e,n){return n instanceof Gu?[]:n},t}();function jh(t){var e=t.parsedStyle.fontSize;return y(e)?null:e}var Rh=function(){function t(){this.parser=Pf,this.parserWithCSSDisabled=null,this.mixer=Gf}return t.prototype.calculator=function(t,e,n,r,i){var o;if(T(n))return n;if(!Xu.isRelativeUnit(n.unit))return n.value;var a=i.styleValueRegistry;if(n.unit===Ou.kPercentage)return 0;if(n.unit===Ou.kEms){if(r.parentNode){if(s=jh(r.parentNode))return s*=n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}if(n.unit===Ou.kRems){if(null===(o=null==r?void 0:r.ownerDocument)||void 0===o?void 0:o.documentElement){var s;if(s=jh(r.ownerDocument.documentElement))return s*=n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}},t}(),Ih=function(){function t(){this.mixer=$f}return t.prototype.parser=function(t){var e=Rf(T(t)?[t]:t);return 1===e.length?[e[0],e[0]]:[e[0],e[1]]},t.prototype.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),Bh=function(){function t(){this.mixer=$f}return t.prototype.parser=function(t){var e=Rf(T(t)?[t]:t);return 1===e.length?[e[0],e[0],e[0],e[0]]:2===e.length?[e[0],e[1],e[0],e[1]]:3===e.length?[e[0],e[1],e[2],e[1]]:[e[0],e[1],e[2],e[3]]},t.prototype.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),Dh=rt();function Fh(t,e){var n=e.parsedStyle.defX||0,r=e.parsedStyle.defY||0;return e.resetLocalTransform(),e.setLocalPosition(n,r),t.forEach((function(t){var i=t.t,o=t.d;if("scale"===i){var a=(null==o?void 0:o.map((function(t){return t.value})))||[1,1];e.scaleLocal(a[0],a[1],1)}else if("scalex"===i){a=(null==o?void 0:o.map((function(t){return t.value})))||[1];e.scaleLocal(a[0],1,1)}else if("scaley"===i){a=(null==o?void 0:o.map((function(t){return t.value})))||[1];e.scaleLocal(1,a[0],1)}else if("scalez"===i){a=(null==o?void 0:o.map((function(t){return t.value})))||[1];e.scaleLocal(1,1,a[0])}else if("scale3d"===i){a=(null==o?void 0:o.map((function(t){return t.value})))||[1,1,1];e.scaleLocal(a[0],a[1],a[2])}else if("translate"===i){var s=o||[Ku,Ku];e.translateLocal(s[0].value,s[1].value,0)}else if("translatex"===i){s=o||[Ku];e.translateLocal(s[0].value,0,0)}else if("translatey"===i){s=o||[Ku];e.translateLocal(0,s[0].value,0)}else if("translatez"===i){s=o||[Ku];e.translateLocal(0,0,s[0].value)}else if("translate3d"===i){s=o||[Ku,Ku,Ku];e.translateLocal(s[0].value,s[1].value,s[2].value)}else if("rotate"===i){var c=o||[Ju];e.rotateLocal(0,0,Lf(c[0]))}else if("rotatex"===i){c=o||[Ju];e.rotateLocal(Lf(c[0]),0,0)}else if("rotatey"===i){c=o||[Ju];e.rotateLocal(0,Lf(c[0]),0)}else if("rotatez"===i){c=o||[Ju];e.rotateLocal(0,0,Lf(c[0]))}else if("rotate3d"===i);else if("skew"===i){var l=(null==o?void 0:o.map((function(t){return t.value})))||[0,0];e.setLocalSkew(eu(l[0]),eu(l[1]))}else if("skewx"===i){l=(null==o?void 0:o.map((function(t){return t.value})))||[0];e.setLocalSkew(eu(l[0]),e.getLocalSkew()[1])}else if("skewy"===i){l=(null==o?void 0:o.map((function(t){return t.value})))||[0];e.setLocalSkew(e.getLocalSkew()[0],eu(l[0]))}else if("matrix"===i){var u=ye(o.map((function(t){return t.value})),6),f=u[0],h=u[1],d=u[2],p=u[3],g=u[4],m=u[5];e.setLocalTransform(at(Dh,f,h,0,0,d,p,0,0,0,0,1,0,g+n,m+r,0,1))}else"matrix3d"===i&&(at.apply(Lt,ve([Dh],ye(o.map((function(t){return t.value}))),!1)),Dh[12]+=n,Dh[13]+=r,e.setLocalTransform(Dh))})),e.getLocalTransform()}var zh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ue(e,t),e.prototype.postProcessor=function(t,e){var n,r,i;switch(t.nodeName){case Hl.CIRCLE:case Hl.ELLIPSE:var o=t.parsedStyle,a=o.cx,s=o.cy,c=o.cz;y(a)||(n=a),y(s)||(r=s),y(c)||(i=c);break;case Hl.LINE:var l=t.parsedStyle,u=l.x1,f=l.x2,h=l.y1,d=l.y2;n=Math.min(u,f),r=Math.min(h,d),i=0;break;case Hl.RECT:case Hl.IMAGE:case Hl.GROUP:case Hl.HTML:case Hl.TEXT:case Hl.MESH:y(t.parsedStyle.x)||(n=t.parsedStyle.x),y(t.parsedStyle.y)||(r=t.parsedStyle.y),y(t.parsedStyle.z)||(i=t.parsedStyle.z)}if(t.nodeName!==Hl.PATH&&t.nodeName!==Hl.POLYLINE&&t.nodeName!==Hl.POLYGON&&(t.parsedStyle.defX=n||0,t.parsedStyle.defY=r||0),(!y(n)||!y(r)||!y(i))&&-1===e.indexOf("transform")){var p=t.parsedStyle.transform;if(p&&p.length)Fh(p,t);else{var g=ye(t.getLocalPosition(),3),m=g[0],v=g[1],b=g[2];t.setLocalPosition(y(n)?m:n,y(r)?v:r,y(i)?b:i)}}},e}(Rh),Gh=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){n instanceof Gu&&(n=null);var i=null==n?void 0:n.cloneNode(!0);return i&&(i.style.isMarker=!0),i},t}(),Wh=function(){function t(){this.mixer=Gf,this.parser=zf,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(t,e,n){return n.value},t}(),$h=function(){function t(){this.parser=zf,this.parserWithCSSDisabled=null,this.mixer=Wf(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t.prototype.postProcessor=function(t){var e=t.parsedStyle,n=e.offsetPath,r=e.offsetDistance;if(n){var i=n.nodeName;if(i===Hl.LINE||i===Hl.PATH||i===Hl.POLYLINE){var o=n.getPoint(r);o&&(t.parsedStyle.defX=o.x,t.parsedStyle.defY=o.y,t.setLocalPosition(o.x,o.y))}}},t}(),Hh=function(){function t(){this.parser=zf,this.parserWithCSSDisabled=null,this.mixer=Wf(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),Yh=function(){function t(){this.parser=oh,this.parserWithCSSDisabled=oh,this.mixer=ah}return t.prototype.calculator=function(t,e,n){return n instanceof Gu&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new xu(0,0,0,0)}:n},t.prototype.postProcessor=function(t,e){if(t.parsedStyle.defX=t.parsedStyle.path.rect.x,t.parsedStyle.defY=t.parsedStyle.path.rect.y,t.nodeName===Hl.PATH&&-1===e.indexOf("transform")){var n=t.parsedStyle,r=n.defX,i=void 0===r?0:r,o=n.defY,a=void 0===o?0:o;t.setLocalPosition(i,a)}},t}(),Vh=function(){function t(){this.parser=sh,this.mixer=ch}return t.prototype.postProcessor=function(t,e){if((t.nodeName===Hl.POLYGON||t.nodeName===Hl.POLYLINE)&&-1===e.indexOf("transform")){var n=t.parsedStyle,r=n.defX,i=n.defY;t.setLocalPosition(r,i)}},t}(),qh=function(t){function e(){var e=t.apply(this,ve([],ye(arguments),!1))||this;return e.mixer=Wf(0,1/0),e}return ue(e,t),e}(Rh),Uh=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof Gu?"unset"===n.value?"":n.value:"".concat(n)},t.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""},t}(),Xh=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i=r.getAttribute("text");if(i){var o=i;"capitalize"===n.value?o=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?o=i.toLowerCase():"uppercase"===n.value&&(o=i.toUpperCase()),r.parsedStyle.text=o}return n.value},t}(),Kh={},Zh=0;var Qh="undefined"!=typeof window&&void 0!==window.document;function Jh(t){return!!t.getAttribute}function td(t,e){var n=Number(t.parsedStyle.zIndex),r=Number(e.parsedStyle.zIndex);if(n===r){var i=t.parentNode;if(i){var o=i.childNodes||[];return o.indexOf(t)-o.indexOf(e)}}return n-r}function ed(t){var e,n=t;do{if(null===(e=n.parsedStyle)||void 0===e?void 0:e.clipPath)return n;n=n.parentElement}while(null!==n);return null}function nd(t,e){if(Qh)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var rd={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},id="object"==typeof performance&&performance.now?performance:Date;function od(t,e,n){var r=!1,i=!1,o=!!e&&!e.isNone,a=!!n&&!n.isNone;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=o,i=a):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]}var ad=1,sd="object"==typeof self&&self.self==self?self:"object"==typeof Vc&&Vc.global==Vc?Vc:{},cd=Date.now(),ld={},ud=Date.now(),fd=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-ud,r=n>16?0:16-n,i=ad++;return ld[i]=t,Object.keys(ld).length>1||setTimeout((function(){ud=e;var t=ld;ld={},Object.keys(t).forEach((function(e){return t[e](sd.performance&&"function"==typeof sd.performance.now?sd.performance.now():Date.now()-cd)}))}),r),i},hd=function(t){delete ld[t]},dd=function(t){return"string"!=typeof t?fd:""===t?sd.requestAnimationFrame:sd[t+"RequestAnimationFrame"]},pd=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!!dd(t)})),gd=dd(pd),md=function(t){return"string"!=typeof t?hd:""===t?sd.cancelAnimationFrame:sd[t+"CancelAnimationFrame"]||sd[t+"CancelRequestAnimationFrame"]}(pd);sd.requestAnimationFrame=gd,sd.cancelAnimationFrame=md;var yd=function(){function t(){this.callbacks=[]}return t.prototype.getCallbacksNum=function(){return this.callbacks.length},t.prototype.tapPromise=function(t,e){this.callbacks.push(e)},t.prototype.promise=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Promise.all(this.callbacks.map((function(e){return e.apply(void 0,ve([],ye(t),!1))})))},t}(),vd=function(){function t(){this.callbacks=[]}return t.prototype.tapPromise=function(t,e){this.callbacks.push(e)},t.prototype.promise=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return pe(this,void 0,void 0,(function(){var e,n,r;return ge(this,(function(i){switch(i.label){case 0:return this.callbacks.length?[4,(r=this.callbacks)[0].apply(r,ve([],ye(t),!1))]:[3,6];case 1:e=i.sent(),n=0,i.label=2;case 2:return n<this.callbacks.length-1?[4,(0,this.callbacks[n])(e)]:[3,5];case 3:e=i.sent(),i.label=4;case 4:return n++,[3,2];case 5:return[2,e];case 6:return[2,null]}}))}))},t}(),bd=function(){function t(){this.callbacks=[]}return t.prototype.tap=function(t,e){this.callbacks.push(e)},t.prototype.call=function(){var t=arguments;this.callbacks.forEach((function(e){e.apply(void 0,t)}))},t}(),xd=function(){function t(){this.callbacks=[]}return t.prototype.tap=function(t,e){this.callbacks.push(e)},t.prototype.call=function(){if(this.callbacks.length){for(var t=arguments,e=this.callbacks[0].apply(void 0,t),n=0;n<this.callbacks.length-1;n++){e=(0,this.callbacks[n])(e)}return e}return null},t}(),wd=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Md=/([\"\'])[^\'\"]+\1/;var Od=function(){function t(){this.parser=dh,this.parserWithCSSDisabled=dh,this.mixer=Mh}return t.prototype.calculator=function(t,e,n,r){return n instanceof Gu?[]:n},t.prototype.postProcessor=function(t){Fh(t.parsedStyle.transform,t)},t}(),Ed=function(){this.parser=Oh},kd=function(){function t(){this.parser=zf}return t.prototype.calculator=function(t,e,n,r){return n.value},t.prototype.postProcessor=function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,r=e.sortable;n&&(n.dirty=!0),r&&(r.dirty=!0,r.dirtyReason=Qu.Z_INDEX_CHANGED)}},t}(),Sd=function(){function t(){}return t.prototype.update=function(t,e){var n=t.r;return{width:2*n,height:2*n}},t}(),Ad=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}},t}(),_d=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=Math.min(e,r),a=Math.max(e,r),s=Math.min(n,i);return{width:a-o,height:Math.max(n,i)-s}},t}(),Td=function(){function t(){}return t.prototype.update=function(t){var e=t.path.rect;return{width:e.width,height:e.height}},t}(),Pd=function(){function t(){}return t.prototype.update=function(t){if(t.points&&x(t.points.points)){var e=t.points.points,n=Math.min.apply(Math,ve([],ye(e.map((function(t){return t[0]}))),!1)),r=Math.max.apply(Math,ve([],ye(e.map((function(t){return t[0]}))),!1)),i=Math.min.apply(Math,ve([],ye(e.map((function(t){return t[1]}))),!1)),o=Math.max.apply(Math,ve([],ye(e.map((function(t){return t[1]}))),!1));return{width:r-n,height:o-i}}return{width:0,height:0}},t}(),Cd=function(){function t(){}return t.prototype.update=function(t,e){var n=t.img,r=t.width,i=void 0===r?0:r,o=t.height,a=i,s=void 0===o?0:o;return n&&!A(n)&&(a||(a=n.width,t.width=a),s||(s=n.height,t.height=s)),{width:a,height:s}},t}(),Nd=function(){function t(t){this.globalRuntime=t}return t.prototype.isReadyToMeasure=function(t,e){var n=t.text,r=t.textAlign,i=t.textBaseline,o=t.fontSize,a=t.fontStyle,s=t.fontWeight,c=t.fontVariant,l=t.lineWidth;return n&&o&&a&&s&&c&&r&&i&&!y(l)},t.prototype.update=function(t,e){var n,r,i=t.text,o=t.textAlign,a=t.lineWidth,s=t.textBaseline,c=t.dx,l=t.dy;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:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0};var u=((null===(r=null===(n=null==e?void 0:e.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===r?void 0:r.getConfig())||{}).offscreenCanvas,f=this.globalRuntime.textService.measureText(i,t,u);t.metrics=f;var h=f.width,d=f.height,p=f.lineHeight,g=f.fontProperties,m=[h/2,d/2,0],y=[0,1],v=0;"center"===o||"middle"===o?(v=a/2,y=[.5,1]):"right"!==o&&"end"!==o||(v=a,y=[1,1]);var b=0;return"middle"===s?b=m[1]:"top"===s||"hanging"===s?b=2*m[1]:"alphabetic"===s?b=this.globalRuntime.enableCSSParsing?p-g.ascent:0:"bottom"!==s&&"ideographic"!==s||(b=0),c&&(v+=c),l&&(b+=l),t.anchor=[y[0],y[1],0],{width:2*m[0],height:2*m[1],offsetX:v,offsetY:b}},t}();var Ld,jd=function(){function t(e){this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new bu,this.page=new bu,this.canvas=new bu,this.viewport=new bu,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}return Object.defineProperty(t.prototype,"name",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerX",{get:function(){return this.layer.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerY",{get:function(){return this.layer.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageX",{get:function(){return this.page.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageY",{get:function(){return this.page.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasX",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasY",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportX",{get:function(){return this.viewport.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportY",{get:function(){return this.viewport.y},enumerable:!1,configurable:!0}),t.prototype.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},Object.defineProperty(t.prototype,"propagationPath",{get:function(){return this.composedPath()},enumerable:!1,configurable:!0}),t.prototype.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},t.prototype.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t.prototype.initEvent=function(){},t.prototype.initUIEvent=function(){},t.prototype.clone=function(){throw new Error(wu)},t}(),Rd=function(t){function e(){var e=t.apply(this,ve([],ye(arguments),!1))||this;return e.client=new bu,e.movement=new bu,e.offset=new bu,e.global=new bu,e.screen=new bu,e}return ue(e,t),Object.defineProperty(e.prototype,"clientX",{get:function(){return this.client.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clientY",{get:function(){return this.client.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementX",{get:function(){return this.movement.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementY",{get:function(){return this.movement.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetX",{get:function(){return this.offset.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetY",{get:function(){return this.offset.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalX",{get:function(){return this.global.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalY",{get:function(){return this.global.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenX",{get:function(){return this.screen.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenY",{get:function(){return this.screen.y},enumerable:!1,configurable:!0}),e.prototype.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},e.prototype.initMouseEvent=function(){throw new Error(wu)},e}(jd),Id=function(t){function e(){var e=t.apply(this,ve([],ye(arguments),!1))||this;return e.width=0,e.height=0,e.isPrimary=!1,e}return ue(e,t),e.prototype.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},e.prototype.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},e.prototype.clone=function(){return this.manager.clonePointerEvent(this)},e}(Rd),Bd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ue(e,t),e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(Rd),Dd=function(t){function e(e,n){var r=t.call(this,null)||this;return r.type=e,r.detail=n,Object.assign(r,n),r}return ue(e,t),e}(jd),Fd=function(){function t(){this.emitter=new Uc}return t.prototype.on=function(t,e,n){return this.addEventListener(t,e,n),this},t.prototype.addEventListener=function(t,e,n){var r=D(n)&&n||w(n)&&n.capture,i=w(n)&&n.once,o=Hu(e)?void 0:e,a=!1,s="";if(t.indexOf(":")>-1){var c=ye(t.split(":"),2),l=c[0];t=c[1],s=l,a=!0}if(t=r?"".concat(t,"capture"):t,e=Hu(e)?e:e.handleEvent,a){var u=e;e=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];(null===(t=e[0].target)||void 0===t?void 0:t.name)===s&&u.apply(void 0,ve([],ye(e),!1))}}return i?this.emitter.once(t,e,o):this.emitter.on(t,e,o),this},t.prototype.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},t.prototype.removeAllEventListeners=function(){this.emitter.removeAllListeners()},t.prototype.removeEventListener=function(t,e,n){var r=D(n)&&n||w(n)&&n.capture,i=Hu(e)?void 0:e;return t=r?"".concat(t,"capture"):t,e=Hu(e)?e:null==e?void 0:e.handleEvent,this.emitter.off(t,e,i),this},t.prototype.emit=function(t,e){this.dispatchEvent(new Dd(t,e))},t.prototype.dispatchEvent=function(t,e){var n,r,i;if(void 0===e&&(e=!1),!t.type)throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");if(i=this.document?this:this.defaultView?this.defaultView:null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView){if(t.manager=i.getEventService()||null,!t.manager)return!1;t.defaultPrevented=!1,t.path=[],e||(t.target=this),null===(r=t.manager)||void 0===r||r.dispatchEvent(t,t.type,e)}return!t.defaultPrevented},t}(),zd=function(t){function e(){var e=t.apply(this,ve([],ye(arguments),!1))||this;return e.shadow=!1,e.ownerDocument=null,e.isConnected=!1,e.baseURI="",e.childNodes=[],e.nodeType=0,e.nodeName="",e.nodeValue=null,e.parentNode=null,e}return ue(e,t),e.isNode=function(t){return!!t.childNodes},Object.defineProperty(e.prototype,"textContent",{get:function(){var t,e,n="";this.nodeName===Hl.TEXT&&(n+=this.style.text);try{for(var r=me(this.childNodes),i=r.next();!i.done;i=r.next()){var o=i.value;o.nodeName===Hl.TEXT?n+=o.nodeValue:n+=o.textContent}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},set:function(t){var e=this;this.childNodes.slice().forEach((function(t){e.removeChild(t)})),this.nodeName===Hl.TEXT&&(this.style.text="".concat(t))},enumerable:!1,configurable:!0}),e.prototype.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},e.prototype.hasChildNodes=function(){return this.childNodes.length>0},e.prototype.isDefaultNamespace=function(t){throw new Error(wu)},e.prototype.lookupNamespaceURI=function(t){throw new Error(wu)},e.prototype.lookupPrefix=function(t){throw new Error(wu)},e.prototype.normalize=function(){throw new Error(wu)},e.prototype.isEqualNode=function(t){return this===t},e.prototype.isSameNode=function(t){return this.isEqualNode(t)},Object.defineProperty(e.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstChild",{get:function(){return this.childNodes.length>0?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastChild",{get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),e.prototype.compareDocumentPosition=function(t){var n;if(t===this)return 0;for(var r=t,i=this,o=[r],a=[i];null!==(n=r.parentNode)&&void 0!==n?n:i.parentNode;)r=r.parentNode?(o.push(r.parentNode),r.parentNode):r,i=i.parentNode?(a.push(i.parentNode),i.parentNode):i;if(r!==i)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var s=o.length>a.length?o:a,c=s===o?a:o;if(s[s.length-c.length]===c[0])return s===o?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var l=s.length-c.length,u=c.length-1;u>=0;u--){var f=c[u],h=s[l+u];if(h!==f){var d=f.parentNode.childNodes;return d.indexOf(f)<d.indexOf(h)?c===o?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:s===o?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING},e.prototype.contain=function(t){return this.contains(t)},e.prototype.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},e.prototype.getAncestor=function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e},e.prototype.forEach=function(t,e){void 0===e&&(e=!1),t(this)||(e?this.childNodes.slice():this.childNodes).forEach((function(e){e.forEach(t)}))},e.DOCUMENT_POSITION_DISCONNECTED=1,e.DOCUMENT_POSITION_PRECEDING=2,e.DOCUMENT_POSITION_FOLLOWING=4,e.DOCUMENT_POSITION_CONTAINS=8,e.DOCUMENT_POSITION_CONTAINED_BY=16,e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,e}(Fd),Gd=function(){function t(t,e){var n=this;this.globalRuntime=t,this.context=e,this.emitter=new Uc,this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=rt(),this.tmpVec3=jt(),this.onPointerDown=function(t){var e=n.createPointerEvent(t);if(n.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)n.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){var r=2===e.button;n.dispatchEvent(e,r?"rightdown":"mousedown")}n.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),n.freeEvent(e)},this.onPointerUp=function(t){var e,r=id.now(),i=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);if(n.dispatchEvent(i,"pointerup"),"touch"===i.pointerType)n.dispatchEvent(i,"touchend");else if("mouse"===i.pointerType||"pen"===i.pointerType){var o=2===i.button;n.dispatchEvent(i,o?"rightup":"mouseup")}var a=n.trackingData(t.pointerId),s=n.findMountedTarget(a.pressTargetsByButton[t.button]),c=s;if(s&&!i.composedPath().includes(s)){for(var l=s;l&&!i.composedPath().includes(l);){if(i.currentTarget=l,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType)n.notifyTarget(i,"touchendoutside");else if("mouse"===i.pointerType||"pen"===i.pointerType){o=2===i.button;n.notifyTarget(i,o?"rightupoutside":"mouseupoutside")}zd.isNode(l)&&(l=l.parentNode)}delete a.pressTargetsByButton[t.button],c=l}if(c){var u=n.clonePointerEvent(i,"click");u.target=c,u.path=[],a.clicksByButton[t.button]||(a.clicksByButton[t.button]={clickCount:0,target:u.target,timeStamp:r});var f=a.clicksByButton[t.button];f.target===u.target&&r-f.timeStamp<200?++f.clickCount:f.clickCount=1,f.target=u.target,f.timeStamp=r,u.detail=f.clickCount,(null===(e=i.detail)||void 0===e?void 0:e.preventClick)||(n.context.config.useNativeClickEvent||"mouse"!==u.pointerType&&"touch"!==u.pointerType||n.dispatchEvent(u,"click"),n.dispatchEvent(u,"pointertap")),n.freeEvent(u)}n.freeEvent(i)},this.onPointerMove=function(t){var e=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0),r="mouse"===e.pointerType||"pen"===e.pointerType,i=n.trackingData(t.pointerId),o=n.findMountedTarget(i.overTargets);if(i.overTargets&&o!==e.target){var a="mousemove"===t.type?"mouseout":"pointerout",s=n.createPointerEvent(t,a,o||void 0);if(n.dispatchEvent(s,"pointerout"),r&&n.dispatchEvent(s,"mouseout"),!e.composedPath().includes(o)){var c=n.createPointerEvent(t,"pointerleave",o||void 0);for(c.eventPhase=c.AT_TARGET;c.target&&!e.composedPath().includes(c.target);)c.currentTarget=c.target,n.notifyTarget(c),r&&n.notifyTarget(c,"mouseleave"),zd.isNode(c.target)&&(c.target=c.target.parentNode);n.freeEvent(c)}n.freeEvent(s)}if(o!==e.target){var l="mousemove"===t.type?"mouseover":"pointerover",u=n.clonePointerEvent(e,l);n.dispatchEvent(u,"pointerover"),r&&n.dispatchEvent(u,"mouseover");for(var f=o&&zd.isNode(o)&&o.parentNode;f&&f!==(zd.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&f!==e.target;)f=f.parentNode;if(!f||f===(zd.isNode(n.rootTarget)&&n.rootTarget.parentNode)){var h=n.clonePointerEvent(e,"pointerenter");for(h.eventPhase=h.AT_TARGET;h.target&&h.target!==o&&h.target!==(zd.isNode(n.rootTarget)&&n.rootTarget.parentNode);)h.currentTarget=h.target,n.notifyTarget(h),r&&n.notifyTarget(h,"mouseenter"),zd.isNode(h.target)&&(h.target=h.target.parentNode);n.freeEvent(h)}n.freeEvent(u)}n.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&n.dispatchEvent(e,"touchmove"),r&&(n.dispatchEvent(e,"mousemove"),n.cursor=n.getCursor(e.target)),i.overTargets=e.composedPath(),n.freeEvent(e)},this.onPointerOut=function(t){var e=n.trackingData(t.pointerId);if(e.overTargets){var r="mouse"===t.pointerType||"pen"===t.pointerType,i=n.findMountedTarget(e.overTargets),o=n.createPointerEvent(t,"pointerout",i||void 0);n.dispatchEvent(o),r&&n.dispatchEvent(o,"mouseout");var a=n.createPointerEvent(t,"pointerleave",i||void 0);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(zd.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),r&&n.notifyTarget(a,"mouseleave"),zd.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=null,n.freeEvent(o),n.freeEvent(a)}n.cursor=null},this.onPointerOver=function(t){var e=n.trackingData(t.pointerId),r=n.createPointerEvent(t),i="mouse"===r.pointerType||"pen"===r.pointerType;n.dispatchEvent(r,"pointerover"),i&&n.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(n.cursor=n.getCursor(r.target));var o=n.clonePointerEvent(r,"pointerenter");for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(zd.isNode(n.rootTarget)&&n.rootTarget.parentNode);)o.currentTarget=o.target,n.notifyTarget(o),i&&n.notifyTarget(o,"mouseenter"),zd.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=r.composedPath(),n.freeEvent(r),n.freeEvent(o)},this.onPointerUpOutside=function(t){var e=n.trackingData(t.pointerId),r=n.findMountedTarget(e.pressTargetsByButton[t.button]),i=n.createPointerEvent(t);if(r){for(var o=r;o;)i.currentTarget=o,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||n.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),zd.isNode(o)&&(o=o.parentNode);delete e.pressTargetsByButton[t.button]}n.freeEvent(i)},this.onWheel=function(t){var e=n.createWheelEvent(t);n.dispatchEvent(e),n.freeEvent(e)},this.onClick=function(t){if(n.context.config.useNativeClickEvent){var e=n.createPointerEvent(t);n.dispatchEvent(e),n.freeEvent(e)}},this.onPointerCancel=function(t){var e=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);n.dispatchEvent(e),n.freeEvent(e)}}return t.prototype.init=function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)},t.prototype.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},t.prototype.client2Viewport=function(t){var e=this.context.contextService.getBoundingClientRect();return new bu(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},t.prototype.viewport2Client=function(t){var e=this.context.contextService.getBoundingClientRect();return new bu(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},t.prototype.viewport2Canvas=function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,o=i.width,a=i.height,s=r.getPerspectiveInverse(),c=r.getWorldTransform(),l=ft(this.tmpMatrix,c,s),u=Ft(this.tmpVec3,e/o*2-1,2*(1-n/a)-1,0);return qt(u,u,l),new bu(u[0],u[1])},t.prototype.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=ft(this.tmpMatrix,n,r),o=Ft(this.tmpVec3,t.x,t.y,0);qt(this.tmpVec3,this.tmpVec3,i);var a=this.context.config,s=a.width,c=a.height;return new bu((o[0]+1)/2*s,(1-(o[1]+1)/2)*c)},t.prototype.setPickHandler=function(t){this.pickHandler=t},t.prototype.addEventMapping=function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))},t.prototype.mapEvent=function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;n<r;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}},t.prototype.dispatchEvent=function(t,e,n){if(n){t.eventPhase=t.AT_TARGET;var r=this.rootTarget.defaultView||null;t.currentTarget=r,this.notifyListeners(t,e)}else t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e);this.emitter.emit(e||t.type,t)},t.prototype.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(r=i+1;r<n.length;r++)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},t.prototype.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;r<2048&&t!==this.rootTarget;r++)zd.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e},t.prototype.hitTest=function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config,i=r.width,o=r.height,a=r.disableHitTesting;return e<0||n<0||e>i||n>o?null:!a&&this.pickHandler(t)||this.rootTarget||null},t.prototype.isNativeEventFromCanvas=function(t){var e,n=this.context.contextService.getDomElement(),r=null===(e=t.nativeEvent)||void 0===e?void 0:e.target;if(r){if(r===n)return!0;if(n&&n.contains)return n.contains(r)}return!!t.nativeEvent.composedPath&&t.nativeEvent.composedPath().indexOf(n)>-1},t.prototype.getExistedHTML=function(t){var e,n;if(t.nativeEvent.composedPath)try{for(var r=me(t.nativeEvent.composedPath()),i=r.next();!i.done;i=r.next()){var o=i.value,a=this.nativeHTMLMap.get(o);if(a)return a}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return null},t.prototype.pickTarget=function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})},t.prototype.createPointerEvent=function(t,e,n,r){var i=this.allocateEvent(Id);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var o=this.getExistedHTML(i);return i.target=null!=n?n:o||this.isNativeEventFromCanvas(i)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i},t.prototype.createWheelEvent=function(t){var e=this.allocateEvent(Bd);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e);return e.target=n||this.isNativeEventFromCanvas(e)&&this.pickTarget(e),e},t.prototype.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},t.prototype.cloneWheelEvent=function(t){var e=this.allocateEvent(Bd);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e},t.prototype.clonePointerEvent=function(t,e){var n=this.allocateEvent(Id);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n},t.prototype.copyPointerData=function(t,e){e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist},t.prototype.copyMouseData=function(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)},t.prototype.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},t.prototype.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=id.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},t.prototype.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e},t.prototype.freeEvent=function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)},t.prototype.notifyTarget=function(t,e){e=null!=e?e:t.type;var n=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e;this.notifyListeners(t,n),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)},t.prototype.notifyListeners=function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;i<r.length&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)},t.prototype.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||zd.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},t.prototype.getCursor=function(t){for(var e=t;e;){var n=Jh(e)&&e.getAttribute("cursor");if(n)return n;e=zd.isNode(e)&&e.parentNode}},t}(),Wd=function(){function t(){}return t.prototype.getOrCreateCanvas=function(t,e){if(this.canvas)return this.canvas;if(t||op.offscreenCanvas)this.canvas=t||op.offscreenCanvas,this.context=this.canvas.getContext("2d",fe({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",fe({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",fe({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas},t.prototype.getOrCreateContext=function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context},t}();!function(t){t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE"}(Ld||(Ld={}));var $d,Hd=function(){function t(t,e){this.globalRuntime=t,this.context=e,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new bd,initAsync:new yd,dirtycheck:new xd,cull:new xd,beginFrame:new bd,beforeRender:new bd,render:new bd,afterRender:new bd,endFrame:new bd,destroy:new bd,pick:new vd,pickSync:new xd,pointerDown:new bd,pointerUp:new bd,pointerMove:new bd,pointerOut:new bd,pointerOver:new bd,pointerWheel:new bd,pointerCancel:new bd,click:new bd}}return t.prototype.init=function(t){var e=this,n=fe(fe({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach((function(t){t.apply(n,e.globalRuntime)})),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,t()):this.hooks.initAsync.promise().then((function(){e.inited=!0,t()}))},t.prototype.getStats=function(){return this.stats},t.prototype.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(Ld.CAMERA_CHANGED)},t.prototype.render=function(t,e){var n=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var r=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(r.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),r.renderReasons.size&&this.inited){r.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var i=1===r.renderReasons.size&&r.renderReasons.has(Ld.CAMERA_CHANGED),o=!t.disableRenderHooks||!(t.disableRenderHooks&&i);o&&this.renderDisplayObject(r.root,t,r),this.hooks.beginFrame.call(),o&&r.renderListCurrentFrame.forEach((function(t){n.hooks.beforeRender.call(t),n.hooks.render.call(t),n.hooks.afterRender.call(t)})),this.hooks.endFrame.call(),r.renderListCurrentFrame=[],r.renderReasons.clear(),e()}},t.prototype.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),o=i.enableDirtyCheck,a=i.enableCulling;this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t);var s=t.renderable,c=o?s.dirty||n.dirtyRectangleRenderingDisabled?t:null:t;if(c){var l=a?this.hooks.cull.call(c,this.context.camera):c;l&&(this.stats.rendered++,n.renderListCurrentFrame.push(l))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var u=t.sortable;u.dirty&&(this.sort(t,u),u.dirty=!1,u.dirtyChildren=[],u.dirtyReason=void 0),(u.sorted||t.childNodes).forEach((function(t){r.renderDisplayObject(t,e,n)}))},t.prototype.sort=function(t,e){e.sorted&&e.dirtyReason!==Qu.Z_INDEX_CHANGED?e.dirtyChildren.forEach((function(n){if(-1===t.childNodes.indexOf(n)){var r=e.sorted.indexOf(n);r>=0&&e.sorted.splice(r,1)}else if(0===e.sorted.length)e.sorted.push(n);else{var i=function(t,e){for(var n=0,r=t.length;n<r;){var i=n+r>>>1;td(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(td)},t.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},t.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(Ld.DISPLAY_OBJECT_CHANGED)},t}(),Yd=/\[\s*(.*)=(.*)\s*\]/,Vd=function(){function t(){}return t.prototype.selectOne=function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))},t.prototype.selectAll=function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(r){return e!==r&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.findAll((function(r){return e!==r&&r.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))},t.prototype.is=function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t},t.prototype.getIdOrClassname=function(t){return t.substring(1)},t.prototype.getAttribute=function(t){var e=t.match(Yd),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}},t.prototype.attributeToString=function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return y(n)?"":n.toString?n.toString():""},t}(),qd=function(t){function e(e,n,r,i,o,a,s,c){var l=t.call(this,null)||this;return l.relatedNode=n,l.prevValue=r,l.newValue=i,l.attrName=o,l.attrChange=a,l.prevParsedValue=s,l.newParsedValue=c,l.type=e,l}return ue(e,t),e.ADDITION=2,e.MODIFICATION=1,e.REMOVAL=3,e}(jd);function Ud(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}!function(t){t.REPARENT="reparent",t.DESTROY="destroy",t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.REMOVED="removed",t.MOUNTED="DOMNodeInsertedIntoDocument",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled"}($d||($d={}));var Xd,Kd,Zd,Qd=new qd($d.REPARENT,null,"","","",0,"",""),Jd=function(){function t(t){var e,n,r,i,o,a,s,c,l=this;this.runtime=t,this.pendingEvents=[],this.boundsChangedEvent=new Dd($d.BOUNDS_CHANGED),this.rotate=(e=te(),function(t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof n&&(n=Bt(n,r,i));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var a=te();ie(a,n[0],n[1],n[2]);var s=l.getRotation(t),c=l.getRotation(t.parentNode);ae(e,c),re(e,e),ne(a,e,a),ne(o.localRotation,a,s),ce(o.localRotation,o.localRotation),l.dirtifyLocal(t,o)}else l.rotateLocal(t,n)}),this.rotateLocal=(n=te(),function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof e&&(e=Bt(e,r,i));var o=t.transformable;ie(n,e[0],e[1],e[2]),se(o.localRotation,o.localRotation,n),l.dirtifyLocal(t,o)}),this.setEulerAngles=(r=te(),function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=0),"number"==typeof e&&(e=Bt(e,n,i));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){ie(o.localRotation,e[0],e[1],e[2]);var a=l.getRotation(t.parentNode);ae(r,re(te(),a)),se(o.localRotation,o.localRotation,r),l.dirtifyLocal(t,o)}else l.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Bt(e,n,r));var i=t.transformable;Xt(e,jt())||(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,m=2*a;u*=m,f*=m,h*=m,d*=2,p*=2,g*=2,t[0]=s+u+d,t[1]=c+f+p,t[2]=l+h+g}(e,e,i.localRotation),zt(i.localPosition,i.localPosition,e),l.dirtifyLocal(t,i))},this.setPosition=(i=rt(),o=jt(),function(t,e){var n=t.transformable;if(o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,!Xt(l.getPosition(t),o)){if(Dt(n.position,o),null!==t.parentNode&&t.parentNode.transformable){var r=t.parentNode.transformable;ot(i,r.worldTransform),lt(i,i),qt(n.localPosition,o,i)}else Dt(n.localPosition,o);l.dirtifyLocal(t,n)}}),this.setLocalPosition=function(){var t=jt();return function(e,n){var r=e.transformable;t[0]=n[0],t[1]=n[1],t[2]=n[2]||0,Xt(r.localPosition,t)||(Dt(r.localPosition,t),l.dirtifyLocal(e,r))}}(),this.translate=(a=jt(),s=jt(),c=jt(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ft(s,e,n,r)),Xt(e,a)||(zt(c,l.getPosition(t),e),l.setPosition(t,c))}),this.setRotation=function(){var t=te();return function(e,n,r,i,o){var a=e.transformable;if("number"==typeof n&&(n=oe(n,r,i,o)),null!==e.parentNode&&e.parentNode.transformable){var s=l.getRotation(e.parentNode);ae(t,s),re(t,t),ne(a.localRotation,t,n),ce(a.localRotation,a.localRotation),l.dirtifyLocal(e,a)}else l.setLocalRotation(e,n)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var t=rt(),e=jt(),n=oe(0,0,0,1);return function(r){if(0!==r.localSkew[0]||0!==r.localSkew[1]){if(Mt(r.localTransform,r.localRotation,r.localPosition,Bt(1,1,1),r.origin),0!==r.localSkew[0]||0!==r.localSkew[1]){var i=st(t);i[4]=Math.tan(r.localSkew[0]),i[1]=Math.tan(r.localSkew[1]),ft(r.localTransform,r.localTransform,i)}var o=Mt(t,n,e,r.localScale,r.origin);ft(r.localTransform,r.localTransform,o)}else Mt(r.localTransform,r.localRotation,r.localPosition,r.localScale,r.origin)}}()}return t.prototype.matches=function(t,e){return this.runtime.sceneGraphSelector.is(t,e)},t.prototype.querySelector=function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)},t.prototype.querySelectorAll=function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)},t.prototype.attach=function(t,e,n){var r,i,o=!1;t.parentNode&&(o=t.parentNode!==e,this.detach(t)),t.parentNode=e,y(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);var a=e.sortable;((null===(r=null==a?void 0:a.sorted)||void 0===r?void 0:r.length)||(null===(i=t.style)||void 0===i?void 0:i.zIndex))&&(-1===a.dirtyChildren.indexOf(t)&&a.dirtyChildren.push(t),a.dirty=!0,a.dirtyReason=Qu.ADDED);var s=t.transformable;s&&this.dirtifyWorld(t,s),s.frozen&&this.unfreezeParentToRoot(t),o&&t.dispatchEvent(Qd)},t.prototype.detach=function(t){var e,n;if(t.parentNode){var r=t.transformable,i=t.parentNode.sortable;((null===(e=null==i?void 0:i.sorted)||void 0===e?void 0:e.length)||(null===(n=t.style)||void 0===n?void 0:n.zIndex))&&(-1===i.dirtyChildren.indexOf(t)&&i.dirtyChildren.push(t),i.dirty=!0,i.dirtyReason=Qu.REMOVED);var o=t.parentNode.childNodes.indexOf(t);o>-1&&t.parentNode.childNodes.splice(o,1),r&&this.dirtifyWorld(t,r),t.parentNode=null}},t.prototype.getOrigin=function(t){return t.transformable.origin},t.prototype.setOrigin=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=[e,n,r]);var i=t.transformable;if(e[0]!==i.origin[0]||e[1]!==i.origin[1]||e[2]!==i.origin[2]){var o=i.origin;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,this.dirtifyLocal(t,i)}},t.prototype.setLocalEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Bt(e,n,r));var i=t.transformable;ie(i.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,i)},t.prototype.scaleLocal=function(t,e){var n,r,i,o=t.transformable;n=o.localScale,r=o.localScale,i=Bt(e[0],e[1],e[2]||1),n[0]=r[0]*i[0],n[1]=r[1]*i[1],n[2]=r[2]*i[2],this.dirtifyLocal(t,o)},t.prototype.setLocalScale=function(t,e){var n=t.transformable,r=Bt(e[0],e[1],e[2]||n.localScale[2]);Xt(r,n.localScale)||(Dt(n.localScale,r),this.dirtifyLocal(t,n))},t.prototype.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=oe(e,n,r,i));var o=t.transformable;ae(o.localRotation,e),this.dirtifyLocal(t,o)},t.prototype.setLocalSkew=function(t,e,n){"number"==typeof e&&(e=function(t,e){var n=new tt(2);return n[0]=t,n[1]=e,n}(e,n));var r,i,o=t.transformable;r=o.localSkew,i=e,r[0]=i[0],r[1]=i[1],this.dirtifyLocal(t,o)},t.prototype.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))},t.prototype.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)},t.prototype.triggerPendingEvents=function(){var t=this,e=new Set,n=function(n,r){n.isConnected&&!e.has(n.entity)&&(t.boundsChangedEvent.detail=r,t.boundsChangedEvent.target=n,n.isMutationObserved?n.dispatchEvent(t.boundsChangedEvent):n.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),e.add(n.entity))};this.pendingEvents.forEach((function(t){var e=ye(t,2),r=e[0],i=e[1];i.affectChildren?r.forEach((function(t){n(t,i)})):n(r,i)})),this.clearPendingEvents(),e.clear()},t.prototype.clearPendingEvents=function(){this.pendingEvents=[]},t.prototype.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)Ud(n),n=n.parentNode;e&&t.forEach((function(t){Ud(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren:e}])},t.prototype.updateDisplayObjectDependency=function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var o=i[t].indexOf(r);i[t].splice(o,1)}}if(n){var a=this.displayObjectDependencyMap.get(n);a||(this.displayObjectDependencyMap.set(n,{}),a=this.displayObjectDependencyMap.get(n)),a[t]||(a[t]=[]),a[t].push(r)}},t.prototype.informDependentDisplayObjects=function(t){var e=this,n=this.displayObjectDependencyMap.get(t);n&&Object.keys(n).forEach((function(t){n[t].forEach((function(n){e.dirtifyToRoot(n,!0),n.dispatchEvent(new qd($d.ATTR_MODIFIED,n,e,e,t,qd.MODIFICATION,e,e)),n.isCustomElement&&n.isConnected&&n.attributeChangedCallback&&n.attributeChangedCallback(t,e,e)}))}))},t.prototype.getPosition=function(t){var e=t.transformable;return bt(e.position,this.getWorldTransform(t,e))},t.prototype.getRotation=function(t){var e=t.transformable;return wt(e.rotation,this.getWorldTransform(t,e))},t.prototype.getScale=function(t){var e=t.transformable;return xt(e.scaling,this.getWorldTransform(t,e))},t.prototype.getWorldTransform=function(t,e){return void 0===e&&(e=t.transformable),e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform},t.prototype.getLocalPosition=function(t){return t.transformable.localPosition},t.prototype.getLocalRotation=function(t){return t.transformable.localRotation},t.prototype.getLocalScale=function(t){return t.transformable.localScale},t.prototype.getLocalSkew=function(t){return t.transformable.localSkew},t.prototype.getLocalTransform=function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform},t.prototype.setLocalTransform=function(t,e){var n=bt(jt(),e),r=wt(te(),e),i=xt(jt(),e);this.setLocalScale(t,i),this.setLocalPosition(t,n),this.setLocalRotation(t,r)},t.prototype.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0]),this.setLocalSkew(t,[0,0])},t.prototype.getTransformedGeometryBounds=function(t,e,n){void 0===e&&(e=!1);var r=this.getGeometryBounds(t,e);if(du.isEmpty(r))return null;var i=n||new du;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i},t.prototype.getGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=t.geometry;return(e?n.renderBounds:n.contentBounds||null)||new du},t.prototype.getBounds=function(t,e){var n=this;void 0===e&&(e=!1);var r=t.renderable;if(!r.boundsDirty&&!e&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&e&&r.renderBounds)return r.renderBounds;var i=e?r.renderBounds:r.bounds,o=this.getTransformedGeometryBounds(t,e,i);if(t.childNodes.forEach((function(t){var r=n.getBounds(t,e);r&&(o?o.add(r):(o=i||new du).update(r.center,r.halfExtents))})),e){var a=ed(t);if(a){var s=a.parsedStyle.clipPath.getBounds(e);o?s&&(o=s.intersection(o)):o=s}}return o||(o=new du),o&&(e?r.renderBounds=o:r.bounds=o),e?r.renderBoundsDirty=!1:r.boundsDirty=!1,o},t.prototype.getLocalBounds=function(t){if(t.parentNode){var e=rt();t.parentNode.transformable&&(e=lt(rt(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!du.isEmpty(n)){var r=new du;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},t.prototype.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);du.isEmpty(i)||(r=new du).setFromTransformedAABB(i,this.getWorldTransform(t));var o=null===(n=null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)||void 0===n?void 0:n.getContextService().getBoundingClientRect();if(r){var a=ye(r.getMin(),2),s=a[0],c=a[1],l=ye(r.getMax(),2),u=l[0],f=l[1];return new xu(s+((null==o?void 0:o.left)||0),c+((null==o?void 0:o.top)||0),u-s,f-c)}return new xu((null==o?void 0:o.left)||0,(null==o?void 0:o.top)||0,0,0)},t.prototype.dirtifyWorldInternal=function(t,e){var n=this;if(!e.dirtyFlag){e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}));var r=t.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0)}},t.prototype.syncHierarchy=function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;r<n.length;r++)this.syncHierarchy(n[r])}},t.prototype.sync=function(t,e){if(e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,r=n&&n.transformable;null!==n&&r?ft(e.worldTransform,r.worldTransform,e.localTransform):ot(e.worldTransform,e.localTransform),e.dirtyFlag=!1}},t.prototype.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},t}(),tp={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]},ep=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,np=new RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),rp=new RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),ip=function(){function t(t){var e=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!rp.exec(n)&&!np.exec(t))},this.trimByKinsokuShorui=function(t){var e=ve([],ye(t),!1),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e}}return t.prototype.measureFont=function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),i=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0});i.font=t;var o=tp.MetricsString+tp.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(tp.BaselineSymbol).width),c=tp.HeightMultiplier*s;s=s*tp.BaselineMultiplier|0,r.width=a,r.height=c,i.fillStyle="#f00",i.fillRect(0,0,a,c),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(o,0,s);var l=i.getImageData(0,0,a||1,c||1).data,u=l.length,f=4*a,h=0,d=0,p=!1;for(h=0;h<s;++h){for(var g=0;g<f;g+=4)if(255!==l[d+g]){p=!0;break}if(p)break;d+=f}for(n.ascent=s-h,d=u-f,p=!1,h=c;h>s;--h){for(g=0;g<f;g+=4)if(255!==l[d+g]){p=!0;break}if(p)break;d-=f}return n.descent=h-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n},t.prototype.measureText=function(t,e,n){var r=e.fontSize,i=e.wordWrap,o=e.lineHeight,a=e.lineWidth,s=e.textBaseline,c=e.textAlign,l=e.letterSpacing,u=e.textPath,f=e.leading,h=void 0===f?0:f,d=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,o=t.fontWeight,a=T(e)&&"".concat(e,"px")||"16px",s=n.split(","),c=s.length-1;c>=0;c--){var l=s[c].trim();!Md.test(l)&&wd.indexOf(l)<0&&(l='"'.concat(l,'"')),s[c]=l}return"".concat(r," ").concat(i," ").concat(o," ").concat(a," ").concat(s.join(","))}(e),p=this.measureFont(d,n);0===p.fontSize&&(p.fontSize=r,p.ascent=r);var g=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);g.font=d,e.isOverflowing=!1;var m=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),y=new Array(m.length),v=0;if(!u){for(O=0;O<m.length;O++){var b=g.measureText(m[O]).width+(m[O].length-1)*l;y[O]=b,v=Math.max(v,b)}E=v+a;var x=o||p.fontSize+a,w=Math.max(x,p.fontSize+a)+(m.length-1)*(x+h),M=0;return"middle"===s?M=-w/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?M=-w:"top"!==s&&"hanging"!==s||(M=0),{font:d,width:E,height:w,lines:m,lineWidths:y,lineHeight:x+=h,maxLineWidth:v,fontProperties:p,lineMetrics:y.map((function(t,e){var n=0;return"center"===c||"middle"===c?n-=t/2:"right"!==c&&"end"!==c||(n-=t),new xu(n-a/2,M+e*x,t+a,x)}))}}u.getTotalLength();for(var O=0;O<m.length;O++)var E=g.measureText(m[O]).width+(m[O].length-1)*l},t.prototype.setGraphemeOnPath=function(){},t.prototype.wordWrap=function(t,e,n){var r=this,i=e.wordWrapWidth,o=void 0===i?0:i,a=e.letterSpacing,s=e.maxLines,c=void 0===s?1/0:s,l=e.textOverflow,u=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),f=o+a,h="";"ellipsis"===l?h="...":l&&"clip"!==l&&(h=l);for(var d=[],p=0,g=0,m={},y=function(t){return r.getFromCache(t,a,m,u)},v=Array.from(h).reduce((function(t,e){return t+y(e)}),0),b=Array.from(t),x=0;x<b.length;x++){var w=b[x],M=t[x-1],O=t[x+1],E=y(w);if(this.isNewline(w)){if(++p>=c){e.isOverflowing=!0;break}g=0,d[p]=""}else{if(g>0&&g+E>f){if(p+1>=c){if(e.isOverflowing=!0,v>0&&v<=f){for(var k=d[p].length,S=0,A=k,_=0;_<k;_++){var T=y(d[p][_]);if(S+T+v>f){A=_;break}S+=T}d[p]=(d[p]||"").slice(0,A)+h}break}if(g=0,d[++p]="",this.isBreakingSpace(w))continue;this.canBreakInLastChar(w)||(d=this.trimToBreakable(d),g=this.sumTextWidthByCache(d[p]||"",m)),this.shouldBreakByKinsokuShorui(w,O)&&(d=this.trimByKinsokuShorui(d),g+=y(M||""))}g+=E,d[p]=(d[p]||"")+w}}return d.join("\n")},t.prototype.isBreakingSpace=function(t){return"string"==typeof t&&tp.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},t.prototype.isNewline=function(t){return"string"==typeof t&&tp.Newlines.indexOf(t.charCodeAt(0))>=0},t.prototype.trimToBreakable=function(t){var e=ve([],ye(t),!1),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),o=r+1,a=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(o,n.length),e[e.length-2]=n.slice(0,a),e},t.prototype.canBreakInLastChar=function(t){return!t||!ep.test(t)},t.prototype.sumTextWidthByCache=function(t,e){return t.split("").reduce((function(t,n){if(!e[n])throw Error("cannot count the word without cache");return t+e[n]}),0)},t.prototype.findBreakableIndex=function(t){for(var e=t.length-1;e>=0;e--)if(!ep.test(t[e]))return e;return-1},t.prototype.getFromCache=function(t,e,n,r){var i=n[t];if("number"!=typeof i){var o=t.length*e;i=r.measureText(t).width+o,n[t]=i}return i},t}(),op={},ap=(Kd=new Cd,Zd=new Pd,(Xd={})[Hl.CIRCLE]=new Sd,Xd[Hl.ELLIPSE]=new Ad,Xd[Hl.RECT]=Kd,Xd[Hl.IMAGE]=Kd,Xd[Hl.GROUP]=Kd,Xd[Hl.LINE]=new _d,Xd[Hl.TEXT]=new Nd(op),Xd[Hl.POLYLINE]=Zd,Xd[Hl.POLYGON]=Zd,Xd[Hl.PATH]=new Td,Xd[Hl.HTML]=null,Xd[Hl.MESH]=null,Xd),sp=function(){var t,e=new Nh,n=new Rh;return(t={})[hf.PERCENTAGE]=null,t[hf.NUMBER]=new Wh,t[hf.ANGLE]=new Ph,t[hf.DEFINED_PATH]=new Ch,t[hf.PAINT]=e,t[hf.COLOR]=e,t[hf.FILTER]=new Lh,t[hf.LENGTH]=n,t[hf.LENGTH_PERCENTAGE]=n,t[hf.LENGTH_PERCENTAGE_12]=new Ih,t[hf.LENGTH_PERCENTAGE_14]=new Bh,t[hf.COORDINATE]=new zh,t[hf.OFFSET_DISTANCE]=new $h,t[hf.OPACITY_VALUE]=new Hh,t[hf.PATH]=new Yh,t[hf.LIST_OF_POINTS]=new Vh,t[hf.SHADOW_BLUR]=new qh,t[hf.TEXT]=new Uh,t[hf.TEXT_TRANSFORM]=new Xh,t[hf.TRANSFORM]=new Od,t[hf.TRANSFORM_ORIGIN]=new Ed,t[hf.Z_INDEX]=new kd,t[hf.MARKER]=new Gh,t}();op.CameraContribution=Pu,op.AnimationTimeline=null,op.EasingFunction=null,op.offscreenCanvasCreator=new Wd,op.sceneGraphSelector=new Vd,op.sceneGraphService=new Jd(op),op.textService=new ip(op),op.geometryUpdaterFactory=ap,op.CSSPropertySyntaxFactory=sp,op.styleValueRegistry=new Th(op),op.layoutRegistry=null,op.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==Vc?Vc:{},op.enableCSSParsing=!0,op.enableDataset=!1,op.enableStyleSyntax=!0;var cp=0,lp=new qd($d.INSERTED,null,"","","",0,"",""),up=new qd($d.REMOVED,null,"","","",0,"",""),fp=new Dd($d.DESTROY),hp=function(t){function e(){var e=t.apply(this,ve([],ye(arguments),!1))||this;return e.entity=cp++,e.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},e.cullable={strategy:Zu.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},e.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},e.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},e.geometry={contentBounds:void 0,renderBounds:void 0},e.rBushNode={aabb:void 0},e.namespaceURI="g",e.scrollLeft=0,e.scrollTop=0,e.clientTop=0,e.clientLeft=0,e.destroyed=!1,e.style={},e.computedStyle=op.enableCSSParsing?{anchor:ef,opacity:ef,fillOpacity:ef,strokeOpacity:ef,fill:ef,stroke:ef,transform:ef,transformOrigin:ef,visibility:ef,pointerEvents:ef,lineWidth:ef,lineCap:ef,lineJoin:ef,increasedLineWidthForHitTesting:ef,fontSize:ef,fontFamily:ef,fontStyle:ef,fontWeight:ef,fontVariant:ef,textAlign:ef,textBaseline:ef,textTransform:ef,zIndex:ef,filter:ef,shadowType:ef}:null,e.parsedStyle={},e.attributes={},e}return ue(e,t),Object.defineProperty(e.prototype,"className",{get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"classList",{get:function(){return this.className.split(" ").filter((function(t){return""!==t}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tagName",{get:function(){return this.nodeName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentElement",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(t){throw new Error(wu)},e.prototype.appendChild=function(t,e){var n;if(t.destroyed)throw new Error("Cannot append a destroyed element.");return op.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),lp.relatedNode=this,t.dispatchEvent(lp),t},e.prototype.insertBefore=function(t,e){if(e){t.parentElement&&t.parentElement.removeChild(t);var n=this.childNodes.indexOf(e);-1===n?this.appendChild(t):this.appendChild(t,n)}else this.appendChild(t);return t},e.prototype.replaceChild=function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},e.prototype.removeChild=function(t){var e;return up.relatedNode=this,t.dispatchEvent(up),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),op.sceneGraphService.detach(t),t},e.prototype.removeChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];this.removeChild(e)}},e.prototype.destroyChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length&&e.destroyChildren(),e.destroy()}},e.prototype.matches=function(t){return op.sceneGraphService.matches(t,this)},e.prototype.getElementById=function(t){return op.sceneGraphService.querySelector("#".concat(t),this)},e.prototype.getElementsByName=function(t){return op.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)},e.prototype.getElementsByClassName=function(t){return op.sceneGraphService.querySelectorAll(".".concat(t),this)},e.prototype.getElementsByTagName=function(t){return op.sceneGraphService.querySelectorAll(t,this)},e.prototype.querySelector=function(t){return op.sceneGraphService.querySelector(t,this)},e.prototype.querySelectorAll=function(t){return op.sceneGraphService.querySelectorAll(t,this)},e.prototype.closest=function(t){var e=this;do{if(op.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null},e.prototype.find=function(t){var e=this,n=null;return this.forEach((function(r){return!(r===e||!t(r))&&(n=r,!0)})),n},e.prototype.findAll=function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n},e.prototype.after=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this);e.forEach((function(e,n){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(e,r+n+1)}))}},e.prototype.before=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this),i=ye(e),o=i[0],a=i.slice(1);this.parentNode.appendChild(o,r),(t=o).after.apply(t,ve([],ye(a),!1))}},e.prototype.replaceWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.after.apply(this,ve([],ye(t),!1)),this.remove()},e.prototype.append=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach((function(e){return t.appendChild(e)}))},e.prototype.prepend=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach((function(e,n){return t.appendChild(e,n)}))},e.prototype.replaceChildren=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,ve([],ye(t),!1))},e.prototype.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},e.prototype.destroy=function(){this.dispatchEvent(fp),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},e.prototype.getGeometryBounds=function(){return op.sceneGraphService.getGeometryBounds(this)},e.prototype.getRenderBounds=function(){return op.sceneGraphService.getBounds(this,!0)},e.prototype.getBounds=function(){return op.sceneGraphService.getBounds(this)},e.prototype.getLocalBounds=function(){return op.sceneGraphService.getLocalBounds(this)},e.prototype.getBoundingClientRect=function(){return op.sceneGraphService.getBoundingClientRect(this)},e.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},e.prototype.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},e.prototype.getAttributeNames=function(){return Object.keys(this.attributes)},e.prototype.getAttribute=function(t){if(function(t){return"symbol"==typeof t}(t))return op.enableCSSParsing?null:void 0;var e=this.attributes[t];if(void 0===e){var n=Vu(t);return e=this.attributes[n],op.enableCSSParsing&&y(e)?null:e}return e},e.prototype.hasAttribute=function(t){return this.getAttributeNames().includes(t)},e.prototype.hasAttributes=function(){return!!this.getAttributeNames().length},e.prototype.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},e.prototype.setAttribute=function(t,e,n){this.attributes[t]=e},e.prototype.getAttributeNS=function(t,e){throw new Error(wu)},e.prototype.getAttributeNode=function(t){throw new Error(wu)},e.prototype.getAttributeNodeNS=function(t,e){throw new Error(wu)},e.prototype.hasAttributeNS=function(t,e){throw new Error(wu)},e.prototype.removeAttributeNS=function(t,e){throw new Error(wu)},e.prototype.removeAttributeNode=function(t){throw new Error(wu)},e.prototype.setAttributeNS=function(t,e,n){throw new Error(wu)},e.prototype.setAttributeNode=function(t){throw new Error(wu)},e.prototype.setAttributeNodeNS=function(t){throw new Error(wu)},e.prototype.toggleAttribute=function(t,e){throw new Error(wu)},e}(zd);function dp(t){return!!(null==t?void 0:t.nodeName)}var pp,gp=new qd($d.ATTR_MODIFIED,null,null,null,null,qd.MODIFICATION,null,null),mp={anchor:"",opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",zIndex:"",filter:"",shadowType:""},yp={anchor:[0,0],fill:sf,stroke:sf,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},vp=fe(fe({},yp),{opacity:1,fillOpacity:1,strokeOpacity:1,visibility:"visible",pointerEvents:"auto",lineWidth:1,lineCap:"butt",lineJoin:"miter",increasedLineWidthForHitTesting:0,fillRule:"nonzero"}),bp=ve(ve([],ye(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"]),!1),["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],!1),xp="data-",wp=function(t){function e(e){var n,r=t.call(this)||this;r.isCustomElement=!1,r.isMutationObserved=!1,r.activeAnimations=[],r.getClip=function(){return this.style.clipPath||null},r.config=e,r.config.interactive=null!==(n=r.config.capture)&&void 0!==n?n:r.config.interactive,r.id=r.config.id||"",r.name=r.config.name||"",(r.config.className||r.config.class)&&(r.className=r.config.className||r.config.class),r.nodeName=r.config.type||Hl.GROUP,r.config.style=r.config.style||r.config.attrs||{},Object.assign(r.config.style,r.config.attrs),null!=r.config.visible&&(r.config.style.visibility=!1===r.config.visible?"hidden":"visible"),null!=r.config.interactive&&(r.config.style.pointerEvents=!1===r.config.interactive?"none":"auto"),Object.assign(r.parsedStyle,op.enableCSSParsing?yp:vp,r.config.initialParsedStyle),op.enableCSSParsing&&Object.assign(r.attributes,mp),r.initAttributes(r.config.style);var i=op.globalThis.Proxy?op.globalThis.Proxy:function(){};return op.enableDataset&&(r.dataset=new i({},{get:function(t,e){var n="".concat(xp).concat($u(e));return void 0!==t[n]?t[n]:r.getAttribute(n)},set:function(t,e,n){return r.setAttribute("".concat(xp).concat($u(e)),n),!0}})),op.enableStyleSyntax&&(r.style=new i({setProperty:function(t,e){r.setAttribute(t,e)},getPropertyValue:function(t){return r.getAttribute(t)},removeProperty:function(t){r.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:r.getAttribute(e)},set:function(t,e,n){return r.setAttribute(e,n),!0}})),r}return ue(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.getAnimations().forEach((function(t){t.cancel()}))},e.prototype.cloneNode=function(t,e){var n=fe({},this.attributes);for(var r in n){var i=n[r];dp(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}var o=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:n});return o.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);o.appendChild(n)}})),o},e.prototype.initAttributes=function(t){void 0===t&&(t={});var e=this.renderable,n={forceUpdateGeometry:!0};op.enableCSSParsing&&(n.usedAttributes=bp);var r={};for(var i in t){r[Vu(i)]=t[i]}op.styleValueRegistry.processProperties(this,r,n),e.dirty=!0},e.prototype.setAttribute=function(e,n,r){void 0===r&&(r=!1);var i=Vu(e);F(n)||(r||n!==this.attributes[i])&&(this.internalSetAttribute(i,n),t.prototype.setAttribute.call(this,i,n))},e.prototype.internalSetAttribute=function(t,e,n){var r;void 0===n&&(n={});var i=this.renderable,o=this.attributes[t],a=this.parsedStyle[t];op.styleValueRegistry.processProperties(this,((r={})[t]=e,r),n),i.dirty=!0;var s=this.parsedStyle[t];this.isConnected&&(gp.relatedNode=this,gp.prevValue=o,gp.newValue=e,gp.attrName=t,gp.prevParsedValue=a,gp.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(gp):(gp.target=this,this.ownerDocument.defaultView.dispatchEvent(gp,!0))),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,o,e,a,s)},e.prototype.getBBox=function(){var t=this.getBounds(),e=ye(t.getMin(),2),n=e[0],r=e[1],i=ye(t.getMax(),2),o=i[0],a=i[1];return new xu(n,r,o-n,a-r)},e.prototype.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),op.sceneGraphService.setOrigin(this,tu(t,e,n)),this},e.prototype.getOrigin=function(){return op.sceneGraphService.getOrigin(this)},e.prototype.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),op.sceneGraphService.setPosition(this,tu(t,e,n)),this},e.prototype.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),op.sceneGraphService.setLocalPosition(this,tu(t,e,n)),this},e.prototype.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),op.sceneGraphService.translate(this,tu(t,e,n)),this},e.prototype.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),op.sceneGraphService.translateLocal(this,tu(t,e,n)),this},e.prototype.getPosition=function(){return op.sceneGraphService.getPosition(this)},e.prototype.getLocalPosition=function(){return op.sceneGraphService.getLocalPosition(this)},e.prototype.scale=function(t,e,n){return this.scaleLocal(t,e,n)},e.prototype.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=tu(t,e=e||t,n=n||t)),op.sceneGraphService.scaleLocal(this,t),this},e.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=tu(t,e=e||t,n=n||t)),op.sceneGraphService.setLocalScale(this,t),this},e.prototype.getLocalScale=function(){return op.sceneGraphService.getLocalScale(this)},e.prototype.getScale=function(){return op.sceneGraphService.getScale(this)},e.prototype.getEulerAngles=function(){return nu(ye(ru(jt(),op.sceneGraphService.getWorldTransform(this)),3)[2])},e.prototype.getLocalEulerAngles=function(){return nu(ye(ru(jt(),op.sceneGraphService.getLocalRotation(this)),3)[2])},e.prototype.setEulerAngles=function(t){return op.sceneGraphService.setEulerAngles(this,0,0,t),this},e.prototype.setLocalEulerAngles=function(t){return op.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},e.prototype.rotateLocal=function(t,e,n){return y(e)&&y(n)?op.sceneGraphService.rotateLocal(this,0,0,t):op.sceneGraphService.rotateLocal(this,t,e,n),this},e.prototype.rotate=function(t,e,n){return y(e)&&y(n)?op.sceneGraphService.rotate(this,0,0,t):op.sceneGraphService.rotate(this,t,e,n),this},e.prototype.setRotation=function(t,e,n,r){return op.sceneGraphService.setRotation(this,t,e,n,r),this},e.prototype.setLocalRotation=function(t,e,n,r){return op.sceneGraphService.setLocalRotation(this,t,e,n,r),this},e.prototype.setLocalSkew=function(t,e){return op.sceneGraphService.setLocalSkew(this,t,e),this},e.prototype.getRotation=function(){return op.sceneGraphService.getRotation(this)},e.prototype.getLocalRotation=function(){return op.sceneGraphService.getLocalRotation(this)},e.prototype.getLocalSkew=function(){return op.sceneGraphService.getLocalSkew(this)},e.prototype.getLocalTransform=function(){return op.sceneGraphService.getLocalTransform(this)},e.prototype.getWorldTransform=function(){return op.sceneGraphService.getWorldTransform(this)},e.prototype.setLocalTransform=function(t){return op.sceneGraphService.setLocalTransform(this,t),this},e.prototype.resetLocalTransform=function(){op.sceneGraphService.resetLocalTransform(this)},e.prototype.getAnimations=function(){return this.activeAnimations},e.prototype.animate=function(t,e){var n,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return r?r.play(this,t,e):null},e.prototype.isVisible=function(){var t;return"visible"===(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)},Object.defineProperty(e.prototype,"interactive",{get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"},enumerable:!1,configurable:!0}),e.prototype.isInteractive=function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)},e.prototype.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},e.prototype.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,ve([],ye(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))+1),this},e.prototype.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,ve([],ye(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))-1),this},e.prototype.getConfig=function(){return this.config},e.prototype.attr=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=ye(e,2),i=r[0],o=r[1];return i?w(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===e.length?(this.setAttribute(i,o),this):this.attributes[i]:this.attributes},e.prototype.getMatrix=function(t){var e=t||this.getWorldTransform(),n=ye(bt(jt(),e),2),r=n[0],i=n[1],o=ye(xt(jt(),e),2),a=o[0],s=o[1],c=wt(te(),e),l=ye(ru(jt(),c),3),u=l[0],f=l[2];return iu(u||f,r,i,a,s)},e.prototype.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},e.prototype.setMatrix=function(t){var e=ye(ou(t),5),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4];this.setEulerAngles(a).setPosition(n,r).setLocalScale(i,o)},e.prototype.setLocalMatrix=function(t){var e=ye(ou(t),5),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4];this.setLocalEulerAngles(a).setLocalPosition(n,r).setLocalScale(i,o)},e.prototype.show=function(){op.enableCSSParsing?this.style.visibility="visible":this.forEach((function(t){t.style.visibility="visible"}))},e.prototype.hide=function(){op.enableCSSParsing?this.style.visibility="hidden":this.forEach((function(t){t.style.visibility="hidden"}))},e.prototype.getCount=function(){return this.childElementCount},e.prototype.getParent=function(){return this.parentElement},e.prototype.getChildren=function(){return this.children},e.prototype.getFirst=function(){return this.firstElementChild},e.prototype.getLast=function(){return this.lastElementChild},e.prototype.getChildByIndex=function(t){return this.children[t]||null},e.prototype.add=function(t,e){return this.appendChild(t,e)},e.prototype.setClip=function(t){this.style.clipPath=t},e.prototype.set=function(t,e){this.config[t]=e},e.prototype.get=function(t){return this.config[t]},e.prototype.moveTo=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},e.prototype.move=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},e.prototype.setZIndex=function(t){return this.style.zIndex=t,this},e}(hp),Mp=function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,o=t.syntax;op.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:o})},Op=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Hl.CIRCLE,style:op.enableCSSParsing?fe({cx:"",cy:"",r:""},n):fe({},n),initialParsedStyle:{anchor:[.5,.5],transformOrigin:op.enableCSSParsing?null:[ff,ff]}},r))||this}return ue(e,t),e}(wp),Ep=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=he(e,["style"]);return(n=t.call(this,fe({style:op.enableCSSParsing?fe({x:"",y:""},r):fe({},r)},i))||this).isCustomElement=!0,n}return ue(e,t),e}(wp),kp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Hl.ELLIPSE,style:op.enableCSSParsing?fe({cx:"",cy:"",rx:"",ry:""},n):fe({},n),initialParsedStyle:{anchor:[.5,.5],transformOrigin:op.enableCSSParsing?null:[ff,ff]}},r))||this}return ue(e,t),e}(wp),Sp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Hl.GROUP,style:op.enableCSSParsing?fe({x:"",y:"",width:"",height:""},n):fe({},n)},r))||this}return ue(e,t),e}(wp),Ap=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=he(e,["style"]);return(n=t.call(this,fe({type:Hl.HTML,style:op.enableCSSParsing?fe({x:"",y:"",width:"auto",height:"auto",innerHTML:""},r):fe({},r)},i))||this).cullable.enable=!1,n}return ue(e,t),e.prototype.getDomElement=function(){return this.parsedStyle.$el},e.prototype.getBoundingClientRect=function(){if(this.parsedStyle.$el)return this.parsedStyle.$el.getBoundingClientRect();var t=this.parsedStyle,e=t.x,n=t.y,r=t.width,i=t.height;return new xu(e,n,r,i)},e.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},e.prototype.getBounds=function(){var t,e,n=this.getBoundingClientRect(),r=null===(e=null===(t=this.ownerDocument)||void 0===t?void 0:t.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect(),i=new du,o=n.left-((null==r?void 0:r.left)||0),a=n.top-((null==r?void 0:r.top)||0);return i.setMinMax([o,a,0],[o+n.width,a+n.height,0]),i},e.prototype.getLocalBounds=function(){if(this.parentNode){var t=lt(rt(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!du.isEmpty(e)){var n=new du;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},e}(wp),_p=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Hl.IMAGE,style:op.enableCSSParsing?fe({x:"",y:"",img:"",width:"",height:""},n):fe({},n)},r))||this}return ue(e,t),e}(wp),Tp=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=he(e,["style"]);(n=t.call(this,fe({type:Hl.LINE,style:fe({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},r)},i))||this).markerStartAngle=0,n.markerEndAngle=0;var o=n.parsedStyle,a=o.markerStart,s=o.markerEnd;return a&&dp(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),s&&dp(s)&&(n.markerEndAngle=s.getLocalEulerAngles(),n.appendChild(s)),n.transformMarker(!0),n.transformMarker(!1),n}return ue(e,t),e.prototype.attributeChangedCallback=function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&dp(r)&&(this.markerStartAngle=0,r.remove()),i&&dp(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&dp(r)&&(this.markerEndAngle=0,r.remove()),i&&dp(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))},e.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=e.x1,s=e.x2,c=e.y1,l=e.y2,u=e.defX,f=e.defY,h=t?n:r;if(h&&dp(h)){var d,p,g,m,y,v,b;t?(m=a-u,y=c-f,p=s-a,g=l-c,v=i||0,b=this.markerStartAngle):(m=s-u,y=l-f,p=a-s,g=c-l,v=o||0,b=this.markerEndAngle),d=Math.atan2(g,p),h.setLocalEulerAngles(180*d/Math.PI+b),h.setLocalPosition(m+Math.cos(d)*v,y+Math.sin(d)*v)}},e.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.x1,i=n.y1,o=n.x2,a=n.y2,s=n.defX,c=n.defY,l=Nl(r,i,o,a,t),u=l.x,f=l.y,h=qt(jt(),Bt(u-s,f-c,0),e?this.getWorldTransform():this.getLocalTransform());return new bu(h[0],h[1])},e.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},e.prototype.getTotalLength=function(){var t=this.parsedStyle;return Cl(t.x1,t.y1,t.x2,t.y2)},e}(wp),Pp=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=he(e,["style"]);(n=t.call(this,fe({type:Hl.PATH,style:op.enableCSSParsing?fe({path:"",miterLimit:""},r):fe({},r),initialParsedStyle:op.enableCSSParsing?null:{miterLimit:4,path:fe({},df)}},i))||this).markerStartAngle=0,n.markerEndAngle=0,n.markerMidList=[];var o=n.parsedStyle,a=o.markerStart,s=o.markerEnd,c=o.markerMid;return a&&dp(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),c&&dp(c)&&n.placeMarkerMid(c),s&&dp(s)&&(n.markerEndAngle=s.getLocalEulerAngles(),n.appendChild(s)),n.transformMarker(!0),n.transformMarker(!1),n}return ue(e,t),e.prototype.attributeChangedCallback=function(t,e,n,r,i){"path"===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&&dp(r)&&(this.markerStartAngle=0,r.remove()),i&&dp(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&dp(r)&&(this.markerEndAngle=0,r.remove()),i&&dp(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},e.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=e.defX,s=e.defY,c=t?n:r;if(c&&dp(c)){var l,u,f,h,d,p,g;if(t){var m=ye(this.getStartTangent(),2),y=m[0];h=(v=m[1])[0]-a,d=v[1]-s,u=y[0]-v[0],f=y[1]-v[1],p=i||0,g=this.markerStartAngle}else{var v,b=ye(this.getEndTangent(),2);y=b[0];h=(v=b[1])[0]-a,d=v[1]-s,u=y[0]-v[0],f=y[1]-v[1],p=o||0,g=this.markerEndAngle}l=Math.atan2(f,u),c.setLocalEulerAngles(180*l/Math.PI+g),c.setLocalPosition(h+Math.cos(l)*p,d+Math.sin(l)*p)}},e.prototype.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.path.segments,r=e.defX,i=e.defY;if(this.markerMidList.forEach((function(t){t.remove()})),t&&dp(t))for(var o=1;o<n.length-1;o++){var a=ye(n[o].currentPoint,2),s=a[0],c=a[1],l=1===o?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(s-r,c-i)}},e.prototype.getTotalLength=function(){return Hf(this)},e.prototype.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,o=function(t,e,n){return Qe(t,e,fe(fe({},n),{bbox:!1,length:!0})).point}(n.path.absolutePath,t),a=o.x,s=o.y,c=qt(jt(),Bt(a-r,s-i,0),e?this.getWorldTransform():this.getLocalTransform());return new bu(c[0],c[1])},e.prototype.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*Hf(this),e)},e.prototype.getStartTangent=function(){var t=this.parsedStyle.path.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e},e.prototype.getEndTangent=function(){var t=this.parsedStyle.path.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,o=t[e-1].endTangent;n=[],o?(n.push([i[0]-o[0],i[1]-o[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n},e}(wp),Cp=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=he(e,["style"]);(n=t.call(this,fe({type:Hl.POLYGON,style:op.enableCSSParsing?fe({points:"",miterLimit:"",isClosed:!0},r):fe({},r),initialParsedStyle:op.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},i))||this).markerStartAngle=0,n.markerEndAngle=0,n.markerMidList=[];var o=n.parsedStyle,a=o.markerStart,s=o.markerEnd,c=o.markerMid;return a&&dp(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),c&&dp(c)&&n.placeMarkerMid(c),s&&dp(s)&&(n.markerEndAngle=s.getLocalEulerAngles(),n.appendChild(s)),n.transformMarker(!0),n.transformMarker(!1),n}return ue(e,t),e.prototype.attributeChangedCallback=function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&dp(r)&&(this.markerStartAngle=0,r.remove()),i&&dp(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&dp(r)&&(this.markerEndAngle=0,r.remove()),i&&dp(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},e.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=e.points,s=e.defX,c=e.defY,l=(a||{}).points,u=t?n:r;if(u&&dp(u)&&l){var f,h,d,p,g,m,y;if(p=l[0][0]-s,g=l[0][1]-c,t)h=l[1][0]-l[0][0],d=l[1][1]-l[0][1],m=i||0,y=this.markerStartAngle;else{var v=l.length;this.parsedStyle.isClosed?(h=l[v-1][0]-l[0][0],d=l[v-1][1]-l[0][1]):(p=l[v-1][0]-s,g=l[v-1][1]-c,h=l[v-2][0]-l[v-1][0],d=l[v-2][1]-l[v-1][1]),m=o||0,y=this.markerEndAngle}f=Math.atan2(d,h),u.setLocalEulerAngles(180*f/Math.PI+y),u.setLocalPosition(p+Math.cos(f)*m,g+Math.sin(f)*m)}},e.prototype.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.points,r=e.defX,i=e.defY,o=(n||{}).points;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&dp(t)&&o)for(var a=1;a<(this.parsedStyle.isClosed?o.length:o.length-1);a++){var s=o[a][0]-r,c=o[a][1]-i,l=1===a?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(s,c)}},e}(wp),Np=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Hl.POLYLINE,style:op.enableCSSParsing?fe({points:"",miterLimit:"",isClosed:!1},n):fe({},n),initialParsedStyle:op.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},r))||this}return ue(e,t),e.prototype.getTotalLength=function(){return this.parsedStyle.points.totalLength},e.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},e.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,o=n.points,a=o.points,s=o.segments,c=0,l=0;s.forEach((function(e,n){t>=e[0]&&t<=e[1]&&(c=(t-e[0])/(e[1]-e[0]),l=n)}));var u=Nl(a[l][0],a[l][1],a[l+1][0],a[l+1][1],c),f=u.x,h=u.y,d=qt(jt(),Bt(f-r,h-i,0),e?this.getWorldTransform():this.getLocalTransform());return new bu(d[0],d[1])},e.prototype.getStartTangent=function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.prototype.getEndTangent=function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},e}(Cp),Lp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Hl.RECT,style:op.enableCSSParsing?fe({x:"",y:"",width:"",height:"",radius:""},n):fe({},n)},r))||this}return ue(e,t),e}(wp),jp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({type:Hl.TEXT,style:op.enableCSSParsing?fe({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""},n):fe({fill:"black"},n),initialParsedStyle:op.enableCSSParsing?{}:{x:0,y:0,fontSize:16,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",lineHeight:0,letterSpacing:0,textBaseline:"alphabetic",textAlign:"start",wordWrap:!1,wordWrapWidth:0,leading:0,dx:0,dy:0}},r))||this}return ue(e,t),e.prototype.getComputedTextLength=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0},e.prototype.getLineBoundingRects=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]},e.prototype.isOverflowing=function(){return!!this.parsedStyle.isOverflowing},e}(wp),Rp=function(){function t(){this.registry={},this.define(Hl.CIRCLE,Op),this.define(Hl.ELLIPSE,kp),this.define(Hl.RECT,Lp),this.define(Hl.IMAGE,_p),this.define(Hl.LINE,Tp),this.define(Hl.GROUP,Sp),this.define(Hl.PATH,Pp),this.define(Hl.POLYGON,Cp),this.define(Hl.POLYLINE,Np),this.define(Hl.TEXT,jp),this.define(Hl.HTML,Ap)}return t.prototype.define=function(t,e){this.registry[t]=e},t.prototype.get=function(t){return this.registry[t]},t}(),Ip=function(t){function e(){var e=t.call(this)||this;e.defaultView=null,e.ownerDocument=null,e.nodeName="document";try{e.timeline=new op.AnimationTimeline(e)}catch(t){}var n={};return kh.forEach((function(t){var e=t.n,r=t.inh,i=t.d;r&&i&&(n[e]=Hu(i)?i(Hl.GROUP):i)})),e.documentElement=new Sp({id:"g-root",style:n}),e.documentElement.ownerDocument=e,e.documentElement.parentNode=e,e.childNodes=[e.documentElement],e}return ue(e,t),Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),e.prototype.createElement=function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?jp:Sp);var r=new n(e);return r.ownerDocument=this,r},e.prototype.createElementNS=function(t,e,n){return this.createElement(e,n)},e.prototype.cloneNode=function(t){throw new Error(wu)},e.prototype.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}},e.prototype.elementsFromBBox=function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),o=[];return i.forEach((function(t){var e=t.displayObject,n=e.parsedStyle.pointerEvents,r=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(n);(!r||r&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&o.push(e)})),o.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),o},e.prototype.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height;if(r<0||i<0||r>a||i>s)return null;var c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,f=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]}).picked;return f&&f[0]||this.documentElement},e.prototype.elementFromPoint=function(t,e){return pe(this,void 0,void 0,(function(){var n,r,i,o,a,s,c,l,u,f;return ge(this,(function(h){switch(h.label){case 0:return n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height,r<0||i<0||r>a||i>s?[2,null]:(c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]})]);case 1:return[2,(f=h.sent().picked)&&f[0]||this.documentElement]}}))}))},e.prototype.elementsFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height;if(r<0||i<0||r>a||i>s)return[];var c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,f=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]}).picked;return f[f.length-1]!==this.documentElement&&f.push(this.documentElement),f},e.prototype.elementsFromPoint=function(t,e){return pe(this,void 0,void 0,(function(){var n,r,i,o,a,s,c,l,u,f;return ge(this,(function(h){switch(h.label){case 0:return n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height,r<0||i<0||r>a||i>s?[2,[]]:(c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]})]);case 1:return(f=h.sent().picked)[f.length-1]!==this.documentElement&&f.push(this.documentElement),[2,f]}}))}))},e.prototype.appendChild=function(t,e){throw new Error(Mu)},e.prototype.insertBefore=function(t,e){throw new Error(Mu)},e.prototype.removeChild=function(t,e){throw new Error(Mu)},e.prototype.replaceChild=function(t,e,n){throw new Error(Mu)},e.prototype.append=function(){throw new Error(Mu)},e.prototype.prepend=function(){throw new Error(Mu)},e.prototype.getElementById=function(t){return this.documentElement.getElementById(t)},e.prototype.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},e.prototype.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},e.prototype.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},e.prototype.querySelector=function(t){return this.documentElement.querySelector(t)},e.prototype.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},e.prototype.find=function(t){return this.documentElement.find(t)},e.prototype.findAll=function(t){return this.documentElement.findAll(t)},e}(zd),Bp=function(){function t(t){this.strategies=t}return t.prototype.apply=function(e){var n=e.camera,r=e.renderingService,i=e.renderingContext,o=this.strategies;r.hooks.cull.tap(t.tag,(function(t){if(t){var e=t.cullable;return 0===o.length?e.visible=i.unculledEntities.indexOf(t.entity)>-1:e.visible=o.every((function(e){return e.isVisible(n,t)})),!t.isCulled()&&t.isVisible()?t:(t.dispatchEvent(new Dd($d.CULLED)),null)}return t})),r.hooks.afterRender.tap(t.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},t.tag="Culling",t}(),Dp=function(){function t(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new Id(null),this.rootWheelEvent=new Bd(null),this.onPointerMove=function(e){var n,r,i,o,a=null===(o=null===(i=t.context.renderingContext.root)||void 0===i?void 0:i.ownerDocument)||void 0===o?void 0:o.defaultView;if(!a.supportsTouchEvents||"touch"!==e.pointerType){var s=t.normalizeToPointerEvent(e,a);try{for(var c=me(s),l=c.next();!l.done;l=c.next()){var u=l.value,f=t.bootstrapEvent(t.rootPointerEvent,u,a,e);t.context.eventService.mapEvent(f)}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}t.setCursor(t.context.eventService.cursor)}},this.onClick=function(e){var n,r,i,o,a=null===(o=null===(i=t.context.renderingContext.root)||void 0===i?void 0:i.ownerDocument)||void 0===o?void 0:o.defaultView,s=t.normalizeToPointerEvent(e,a);try{for(var c=me(s),l=c.next();!l.done;l=c.next()){var u=l.value,f=t.bootstrapEvent(t.rootPointerEvent,u,a,e);t.context.eventService.mapEvent(f)}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}t.setCursor(t.context.eventService.cursor)}}return t.prototype.apply=function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler((function(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null})),r.hooks.pointerWheel.tap(t.tag,(function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)})),r.hooks.pointerDown.tap(t.tag,(function(t){var e,r;if(!i.supportsTouchEvents||"touch"!==t.pointerType){var o=n.normalizeToPointerEvent(t,i);if(n.autoPreventDefault&&o[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();try{for(var a=me(o),s=a.next();!s.done;s=a.next()){var c=s.value,l=n.bootstrapEvent(n.rootPointerEvent,c,i,t);n.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){var e,r;if(!i.supportsTouchEvents||"touch"!==t.pointerType){var o=n.context.contextService.getDomElement(),a="outside";try{a=o&&t.target&&t.target!==o&&o.contains&&!o.contains(t.target)?"outside":""}catch(t){}var s=n.normalizeToPointerEvent(t,i);try{for(var c=me(s),l=c.next();!l.done;l=c.next()){var u=l.value,f=n.bootstrapEvent(n.rootPointerEvent,u,i,t);f.type+=a,n.context.eventService.mapEvent(f)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerMove.tap(t.tag,this.onPointerMove),r.hooks.pointerOver.tap(t.tag,this.onPointerMove),r.hooks.pointerOut.tap(t.tag,this.onPointerMove),r.hooks.click.tap(t.tag,this.onClick),r.hooks.pointerCancel.tap(t.tag,(function(t){var e,r,o=n.normalizeToPointerEvent(t,i);try{for(var a=me(o),s=a.next();!s.done;s=a.next()){var c=s.value,l=n.bootstrapEvent(n.rootPointerEvent,c,i,t);n.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}))},t.prototype.getViewportXY=function(t){var e,n,r=t.offsetX,i=t.offsetY,o=t.clientX,a=t.clientY;if(!this.context.config.supportsCSSTransform||y(r)||y(i)){var s=this.context.eventService.client2Viewport(new bu(o,a));e=s.x,n=s.y}else e=r,n=i;return{x:e,y:n}},t.prototype.bootstrapEvent=function(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var i=this.getViewportXY(e),o=i.x,a=i.y;t.viewport.x=o,t.viewport.y=a;var s=this.context.eventService.viewport2Canvas(t.viewport),c=s.x,l=s.y;return t.canvas.x=c,t.canvas.y=l,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=rd[t.type]||t.type),t},t.prototype.normalizeWheelEvent=function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.getViewportXY(t),r=n.x,i=n.y;e.viewport.x=r,e.viewport.y=i;var o=this.context.eventService.viewport2Canvas(e.viewport),a=o.x,s=o.y;return e.canvas.x=a,e.canvas.y=s,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},t.prototype.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=id.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null},t.prototype.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},t.prototype.normalizeToPointerEvent=function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;r<t.changedTouches.length;r++){var i=t.changedTouches[r];F(i.button)&&(i.button=0),F(i.buttons)&&(i.buttons=1),F(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),F(i.width)&&(i.width=i.radiusX||1),F(i.height)&&(i.height=i.radiusY||1),F(i.tiltX)&&(i.tiltX=0),F(i.tiltY)&&(i.tiltY=0),F(i.pointerType)&&(i.pointerType="touch"),F(i.pointerId)&&(i.pointerId=i.identifier||0),F(i.pressure)&&(i.pressure=i.force||.5),F(i.twist)&&(i.twist=0),F(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;F(o.isPrimary)&&(o.isPrimary=!0),F(o.width)&&(o.width=1),F(o.height)&&(o.height=1),F(o.tiltX)&&(o.tiltX=0),F(o.tiltY)&&(o.tiltY=0),F(o.pointerType)&&(o.pointerType="mouse"),F(o.pointerId)&&(o.pointerId=1),F(o.pressure)&&(o.pressure=.5),F(o.twist)&&(o.twist=0),F(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t.tag="Event",t}(),Fp=[Hl.CIRCLE,Hl.ELLIPSE,Hl.IMAGE,Hl.RECT,Hl.LINE,Hl.POLYLINE,Hl.POLYGON,Hl.TEXT,Hl.PATH,Hl.HTML],zp=function(){function t(){}return t.prototype.isVisible=function(t,e){var n,r,i=e.cullable;if(!i.enable)return!0;var o=e.getRenderBounds();if(du.isEmpty(o))return!1;var a=t.getFrustum(),s=null===(r=null===(n=e.parentNode)||void 0===n?void 0:n.cullable)||void 0===r?void 0:r.visibilityPlaneMask;return i.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,o,s||hu.INDETERMINATE,a.planes),i.visible=i.visibilityPlaneMask!==hu.OUTSIDE,i.visible},t.prototype.computeVisibilityWithPlaneMask=function(t,e,n,r){if(n===hu.OUTSIDE||n===hu.INSIDE)return n;for(var i=hu.INSIDE,o=Fp.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(Ht(u,e.getPositiveFarPoint(r[a]))+f<0)return hu.OUTSIDE;Ht(u,e.getNegativeFarPoint(r[a]))+f<0&&(i|=c)}}return i},t}(),Gp=function(){function t(){this.toSync=new Set}return t.prototype.apply=function(e){var n=this,r=e.renderingService,i=e.renderingContext,o=e.rBushRoot,a=i.root.ownerDocument.defaultView;this.rBush=o;var s=function(t){t.target.renderable.dirty=!0,r.dirtify()},c=function(t){var e=t.detail.affectChildren,i=t.target;e&&i.forEach((function(t){n.toSync.add(t)}));for(var o=i;o;)o.renderable&&n.toSync.add(o),o=o.parentElement;r.dirtify()},l=function(t){var e=t.target;op.enableCSSParsing&&op.styleValueRegistry.recalc(e),op.sceneGraphService.dirtifyToRoot(e),r.dirtify()},u=function(t){var e=t.target,i=e.rBushNode;i.aabb&&n.rBush.remove(i.aabb),n.toSync.delete(e),op.sceneGraphService.dirtifyToRoot(e),r.dirtify()};r.hooks.init.tap(t.tag,(function(){a.addEventListener($d.MOUNTED,l),a.addEventListener($d.UNMOUNTED,u),a.addEventListener($d.ATTR_MODIFIED,s),a.addEventListener($d.BOUNDS_CHANGED,c)})),r.hooks.destroy.tap(t.tag,(function(){a.removeEventListener($d.MOUNTED,l),a.removeEventListener($d.UNMOUNTED,u),a.removeEventListener($d.ATTR_MODIFIED,s),a.removeEventListener($d.BOUNDS_CHANGED,c),n.toSync.clear()})),r.hooks.endFrame.tap(t.tag,(function(){n.syncRTree()}))},t.prototype.syncRTree=function(){var t=this,e=[];Array.from(this.toSync).filter((function(t){return t.isConnected})).forEach((function(n){var r=n.rBushNode;r&&r.aabb&&t.rBush.remove(r.aabb);var i=n.getRenderBounds();if(i){var o=ye(i.getMin(),2),a=o[0],s=o[1],c=ye(i.getMax(),2),l=c[0],u=c[1];r.aabb||(r.aabb={}),r.aabb.displayObject=n,r.aabb.minX=a,r.aabb.minY=s,r.aabb.maxX=l,r.aabb.maxY=u}r.aabb&&(isNaN(r.aabb.maxX)||isNaN(r.aabb.maxX)||isNaN(r.aabb.minX)||isNaN(r.aabb.minY)||e.push(r.aabb))})),this.rBush.load(e),e.length=0,this.toSync.clear()},t.tag="Prepare",t}();!function(t){t.READY="ready",t.BEFORE_RENDER="beforerender",t.RERENDER="rerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.RESIZE="resize",t.DIRTY_RECTANGLE="dirtyrectangle",t.RENDERER_CHANGED="rendererchanged"}(pp||(pp={}));var Wp=new Dd($d.MOUNTED),$p=new Dd($d.UNMOUNTED),Hp=new Dd(pp.BEFORE_RENDER),Yp=new Dd(pp.RERENDER),Vp=new Dd(pp.AFTER_RENDER),qp=function(t){function e(e){var n=t.call(this)||this;n.Element=wp,n.inited=!1,n.context={},n.document=new Ip,n.document.defaultView=n,n.customElements=new Rp;var r=e.container,i=e.canvas,o=e.offscreenCanvas,a=e.width,s=e.height,c=e.devicePixelRatio,l=e.renderer,u=e.background,f=e.cursor,h=e.document,d=e.requestAnimationFrame,p=e.cancelAnimationFrame,g=e.createImage,m=e.supportsPointerEvents,y=e.supportsTouchEvents,v=e.supportsCSSTransform,b=e.supportsMutipleCanvasesInOneContainer,x=e.useNativeClickEvent,w=e.alwaysTriggerPointerEventOnCanvas,M=e.isTouchEvent,O=e.isMouseEvent;b||function(t,e){if(t){var n="string"==typeof t?t:t.id||Zh++;Kh[n]&&Kh[n].destroy(),Kh[n]=e}}(r,n);var E=a,k=s,S=c;return i&&(S=(S=c||Qh&&window.devicePixelRatio||1)>=1?Math.ceil(S):1,E=a||function(t){var e=nd(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/S,k=s||function(t){var e=nd(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/S),o&&(op.offscreenCanvas=o),n.devicePixelRatio=S,n.requestAnimationFrame=null!=d?d:gd.bind(op.globalThis),n.cancelAnimationFrame=null!=p?p:md.bind(op.globalThis),n.supportsTouchEvents=null!=y?y:"ontouchstart"in op.globalThis,n.supportsPointerEvents=null!=m?m:!!op.globalThis.PointerEvent,n.isTouchEvent=null!=M?M:function(t){return n.supportsTouchEvents&&t instanceof op.globalThis.TouchEvent},n.isMouseEvent=null!=O?O:function(t){return!op.globalThis.MouseEvent||t instanceof op.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof op.globalThis.PointerEvent))},n.initRenderingContext({container:r,canvas:i,width:E,height:k,renderer:l,offscreenCanvas:o,devicePixelRatio:S,cursor:f||"default",background:u||"transparent",createImage:g,document:h,supportsCSSTransform:v,useNativeClickEvent:x,alwaysTriggerPointerEventOnCanvas:w}),n.initDefaultCamera(E,k,l.clipSpaceNearZ),n.initRenderer(l,!0),n}return ue(e,t),e.prototype.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},e.prototype.initDefaultCamera=function(t,e,n){var r=this,i=new op.CameraContribution;i.clipSpaceNearZ=n,i.setType(gu.EXPLORING,mu.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(_u,(function(){r.context.renderingContext.renderReasons.add(Ld.CAMERA_CHANGED)})),this.context.camera=i},e.prototype.getConfig=function(){return this.context.config},e.prototype.getRoot=function(){return this.document.documentElement},e.prototype.getCamera=function(){return this.context.camera},e.prototype.getContextService=function(){return this.context.contextService},e.prototype.getEventService=function(){return this.context.eventService},e.prototype.getRenderingService=function(){return this.context.renderingService},e.prototype.getRenderingContext=function(){return this.context.renderingContext},e.prototype.getStats=function(){return this.getRenderingService().getStats()},Object.defineProperty(e.prototype,"ready",{get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),e.prototype.destroy=function(t,e){(void 0===t&&(t=!0),void 0===e&&(e=!1),e||this.dispatchEvent(new Dd(pp.BEFORE_DESTROY)),this.frameId)&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var n=this.getRoot();this.unmountChildren(n),t&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),t&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),e||this.dispatchEvent(new Dd(pp.AFTER_DESTROY))},e.prototype.changeSize=function(t,e){this.resize(t,e)},e.prototype.resize=function(t,e){var n=this.context.config;n.width=t,n.height=e,this.getContextService().resize(t,e);var r=this.context.camera,i=r.getProjectionMode();r.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),i===yu.ORTHOGRAPHIC?r.setOrthographic(t/-2,t/2,e/2,e/-2,r.getNear(),r.getFar()):r.setAspect(t/e),this.dispatchEvent(new Dd(pp.RESIZE,{width:t,height:e}))},e.prototype.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},e.prototype.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},e.prototype.removeChild=function(t){return this.document.documentElement.removeChild(t)},e.prototype.removeChildren=function(){this.document.documentElement.removeChildren()},e.prototype.destroyChildren=function(){this.document.documentElement.destroyChildren()},e.prototype.render=function(){var t=this;this.dispatchEvent(Hp),this.getRenderingService().render(this.getConfig(),(function(){t.dispatchEvent(Yp)})),this.dispatchEvent(Vp)},e.prototype.run=function(){var t=this,e=function(){t.render(),t.frameId=t.requestAnimationFrame(e)};e()},e.prototype.initRenderer=function(t,e){var n=this;if(void 0===e&&(e=!1),!t)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new Vl,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new Dp,new Gp,new Bp([new zp])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(fe(fe({},op),this.context)),this.context.renderingService=new Hd(op,this.context),this.context.eventService=new Gd(op,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,e,!0)):this.context.contextService.initAsync().then((function(){n.initRenderingService(t,e)}))},e.prototype.initRenderingService=function(t,e,n){var r=this;void 0===e&&(e=!1),void 0===n&&(n=!1),this.context.renderingService.init((function(){r.inited=!0,e?(n?r.requestAnimationFrame((function(){r.dispatchEvent(new Dd(pp.READY))})):r.dispatchEvent(new Dd(pp.READY)),r.readyPromise&&r.resolveReadyPromise()):r.dispatchEvent(new Dd(pp.RENDERER_CHANGED)),e||r.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),r.mountChildren(r.getRoot()),t.getConfig().enableAutoRendering&&r.run()}))},e.prototype.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(op)}))},e.prototype.setRenderer=function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),ve([],ye(null==n?void 0:n.getPlugins()),!1).reverse().forEach((function(t){t.destroy(op)})),this.initRenderer(t)}},e.prototype.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},e.prototype.unmountChildren=function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent($p):($p.target=t,this.dispatchEvent($p,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},e.prototype.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(Wp):(Wp.target=t,this.dispatchEvent(Wp,!0))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName),t.childNodes.forEach((function(t){e.mountChildren(t)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()},e.prototype.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},e.prototype.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},e.prototype.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},e.prototype.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},e.prototype.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},e.prototype.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},e}(Fd),Up=function(t){function e(){var e=t.apply(this,ve([],ye(arguments),!1))||this;return e.landmarks=[],e}return ue(e,t),e.prototype.rotate=function(t,e,n){if(this.relElevation=Jl(e),this.relAzimuth=Jl(t),this.relRoll=Jl(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===gu.EXPLORING){var r=ee(te(),[1,0,0],eu((this.rotateWorld?1:-1)*this.relElevation)),i=ee(te(),[0,1,0],eu((this.rotateWorld?1:-1)*this.relAzimuth)),o=ee(te(),[0,0,1],eu(this.relRoll)),a=ne(te(),i,r);a=ne(te(),a,o);var s=Ot(rt(),a);ht(this.matrix,this.matrix,[0,0,-this.distance]),ft(this.matrix,this.matrix,s),ht(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===gu.ORBITING||this.type===gu.EXPLORING?this._getPosition():this.type===gu.TRACKING&&this._getFocalPoint(),this._update(),this},e.prototype.pan=function(t,e){var n=tu(t,e,0),r=Rt(this.position);return zt(r,r,Wt(jt(),this.right,n[0])),zt(r,r,Wt(jt(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this},e.prototype.dolly=function(t){var e=this.forward,n=Rt(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===gu.ORBITING||this.type===gu.EXPLORING?this._getDistance():this.type===gu.TRACKING&&zt(this.focalPoint,n,this.distanceVector),this.triggerUpdate(),this},e.prototype.cancelLandmarkAnimation=function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)},e.prototype.createLandmark=function(t,e){var n,r,i,o;void 0===e&&(e={});var a=e.position,s=void 0===a?this.position:a,c=e.focalPoint,l=void 0===c?this.focalPoint:c,u=e.roll,f=e.zoom,h=new op.CameraContribution;h.setType(this.type,void 0),h.setPosition(s[0],null!==(n=s[1])&&void 0!==n?n:this.position[1],null!==(r=s[2])&&void 0!==r?r:this.position[2]),h.setFocalPoint(l[0],null!==(i=l[1])&&void 0!==i?i:this.focalPoint[1],null!==(o=l[2])&&void 0!==o?o:this.focalPoint[2]),h.setRoll(null!=u?u:this.roll),h.setZoom(null!=f?f:this.zoom);var d={name:t,matrix:it(h.getWorldTransform()),right:Rt(h.right),up:Rt(h.up),forward:Rt(h.forward),position:Rt(h.getPosition()),focalPoint:Rt(h.getFocalPoint()),distanceVector:Rt(h.getDistanceVector()),distance:h.getDistance(),dollyingStep:h.getDollyingStep(),azimuth:h.getAzimuth(),elevation:h.getElevation(),roll:h.getRoll(),relAzimuth:h.relAzimuth,relElevation:h.relElevation,relRoll:h.relRoll,zoom:h.getZoom()};return this.landmarks.push(d),d},e.prototype.gotoLandmark=function(t,e){var n=this;void 0===e&&(e={});var r=A(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=T(e)?{duration:e}:e,o=i.easing,a=void 0===o?"linear":o,s=i.duration,c=void 0===s?100:s,l=i.easingFunction,u=void 0===l?void 0:l,f=i.onfinish,h=void 0===f?void 0:f,d=i.onframe,p=void 0===d?void 0:d;if(0===c)return this.syncFromLandmark(r),void(h&&h());this.cancelLandmarkAnimation();var g,m=r.position,y=r.focalPoint,v=r.zoom,b=r.roll,x=u||op.EasingFunction(a),w=function(){n.setFocalPoint(y),n.setPosition(m),n.setRoll(b),n.setZoom(v),n.computeMatrix(),n.triggerUpdate(),h&&h()},M=function(t){void 0===g&&(g=t);var e=t-g;if(e>c)w();else{var r,i,o=x(e/c),a=jt(),s=jt();Vt(a,n.focalPoint,y,o),Vt(s,n.position,m,o),i=n.roll*(1-o)+b*o,r=n.zoom*(1-o)+v*o,n.setFocalPoint(a),n.setPosition(s),n.setRoll(i),n.setZoom(r),Kt(a,y)+Kt(s,m)<=.01&&null==v&&null==b?w():(n.computeMatrix(),n.triggerUpdate(),e<c&&(p&&p(o),n.landmarkAnimationID=n.canvas.requestAnimationFrame(M)))}};this.canvas.requestAnimationFrame(M)}},e.prototype.syncFromLandmark=function(t){this.matrix=ot(this.matrix,t.matrix),this.right=Dt(this.right,t.right),this.up=Dt(this.up,t.up),this.forward=Dt(this.forward,t.forward),this.position=Dt(this.position,t.position),this.focalPoint=Dt(this.focalPoint,t.focalPoint),this.distanceVector=Dt(this.distanceVector,t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance,this.zoom=t.zoom},e}(Pu);op.CameraContribution=Up;var Xp=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.currentTime=r,o.timelineTime=i,o.target=n,o.type="finish",o.bubbles=!1,o.currentTarget=n,o.defaultPrevented=!1,o.eventPhase=o.AT_TARGET,o.timeStamp=Date.now(),o.currentTime=r,o.timelineTime=i,o}return ue(e,t),e}(jd),Kp=0,Zp=function(){function t(t,e){var n;this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=t,t.animation=this,this.timeline=e,this.id="".concat(Kp++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null===(n=this.effect)||void 0===n?void 0:n.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}return Object.defineProperty(t.prototype,"pending",{get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playState",{get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ready",{get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise((function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(new Error)}})),this.pending||this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"finished",{get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise((function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(new Error)}})),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentTime",{get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){var e;t=Number(t),isNaN(t)||(this.timeline.restart(),this._paused||null===this._startTime||(this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate),this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this)))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"startTime",{get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),t=Number(t),isNaN(t))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_isFinished",{get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"totalDuration",{get:function(){return this._totalDuration},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_needsTick",{get:function(){return this.pending||"running"===this.playState||!this._finishedFlag},enumerable:!1,configurable:!0}),t.prototype.updatePromises=function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,this.readyPromise||this.finishedPromise},t.prototype.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()},t.prototype.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()},t.prototype.finish=function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},t.prototype.cancel=function(){var t=this;if(this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var e=new Xp(null,this,this.currentTime,null);setTimeout((function(){t.oncancel(e)}))}},t.prototype.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()},t.prototype.updatePlaybackRate=function(t){this.playbackRate=t},t.prototype.targetAnimations=function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()},t.prototype.markTarget=function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)},t.prototype.unmarkTarget=function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)},t.prototype.tick=function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))},t.prototype.rewind=function(){if(this.playbackRate>=0)this.currentTime=0;else{if(!(this._totalDuration<1/0))throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}},t.prototype.persist=function(){throw new Error(wu)},t.prototype.addEventListener=function(t,e,n){throw new Error(wu)},t.prototype.removeEventListener=function(t,e,n){throw new Error(wu)},t.prototype.dispatchEvent=function(t){throw new Error(wu)},t.prototype.commitStyles=function(){throw new Error(wu)},t.prototype.ensureAlive=function(){var t,e;this.playbackRate<0&&0===this.currentTime?this._inEffect=!!(null===(t=this.effect)||void 0===t?void 0:t.update(-1)):this._inEffect=!!(null===(e=this.effect)||void 0===e?void 0:e.update(this.currentTime)),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},t.prototype.tickCurrentTime=function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())},t.prototype.fireEvents=function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new Xp(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 Xp(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}},t}(),Qp=.1,Jp="function"==typeof Float32Array,tg=function(t,e){return 1-3*e+3*t},eg=function(t,e){return 3*e-6*t},ng=function(t){return 3*t},rg=function(t,e,n){return((tg(e,n)*t+eg(e,n))*t+ng(e))*t},ig=function(t,e,n){return 3*tg(e,n)*t*t+2*eg(e,n)*t+ng(e)},og=function(t,e,n,r){if(!(0<=t&&t<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=Jp?new Float32Array(11):new Array(11),o=0;o<11;++o)i[o]=rg(o*Qp,t,n);var a=function(e){for(var r=0,o=1;10!==o&&i[o]<=e;++o)r+=Qp;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*Qp,s=ig(a,t,n);return s>=.001?function(t,e,n,r){for(var i=0;i<4;++i){var o=ig(e,n,r);if(0===o)return e;e-=(rg(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=rg(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+Qp,t,n)};return function(t){return 0===t||1===t?t:rg(a(t),e,r)}},ag=function(t){return Math.pow(t,2)},sg=function(t){return Math.pow(t,3)},cg=function(t){return Math.pow(t,4)},lg=function(t){return Math.pow(t,5)},ug=function(t){return Math.pow(t,6)},fg=function(t){return 1-Math.cos(t*Math.PI/2)},hg=function(t){return 1-Math.sqrt(1-t*t)},dg=function(t){return t*t*(3*t-2)},pg=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)},gg=function(t,e){void 0===e&&(e=[]);var n=ye(e,2),r=n[0],i=void 0===r?1:r,o=n[1],a=void 0===o?.5:o,s=_(Number(i),1,10),c=_(Number(a),.1,2);return 0===t||1===t?t:-s*Math.pow(2,10*(t-1))*Math.sin((t-1-c/(2*Math.PI)*Math.asin(1/s))*(2*Math.PI)/c)},mg=function(t,e,n){void 0===e&&(e=[]);var r=ye(e,4),i=r[0],o=void 0===i?1:i,a=r[1],s=void 0===a?100:a,c=r[2],l=void 0===c?10:c,u=r[3],f=void 0===u?0:u;o=_(o,.1,1e3),s=_(s,.1,1e3),l=_(l,.1,1e3),f=_(f,.1,1e3);var h=Math.sqrt(s/o),d=l/(2*Math.sqrt(s*o)),p=d<1?h*Math.sqrt(1-d*d):0,g=d<1?(d*h-f)/p:-f+h,m=n?n*t/1e3:t;return m=d<1?Math.exp(-m*d*h)*(1*Math.cos(p*m)+g*Math.sin(p*m)):(1+g*m)*Math.exp(-m*h),0===t||1===t?t:1-m},yg=function(t,e){void 0===e&&(e=[]);var n=ye(e,2),r=n[0],i=void 0===r?10:r;return("start"==n[1]?Math.ceil:Math.floor)(_(t,0,1)*i)/i},vg=function(t,e){void 0===e&&(e=[]);var n=ye(e,4),r=n[0],i=n[1],o=n[2],a=n[3];return og(r,i,o,a)(t)},bg=og(.42,0,1,1),xg=function(t){return function(e,n,r){return void 0===n&&(n=[]),1-t(1-e,n,r)}},wg=function(t){return function(e,n,r){return void 0===n&&(n=[]),e<.5?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},Mg=function(t){return function(e,n,r){return void 0===n&&(n=[]),e<.5?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},Og={steps:yg,"step-start":function(t){return yg(t,[1,"start"])},"step-end":function(t){return yg(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":vg,ease:function(t){return vg(t,[.25,.1,.25,1])},in:bg,out:xg(bg),"in-out":wg(bg),"out-in":Mg(bg),"in-quad":ag,"out-quad":xg(ag),"in-out-quad":wg(ag),"out-in-quad":Mg(ag),"in-cubic":sg,"out-cubic":xg(sg),"in-out-cubic":wg(sg),"out-in-cubic":Mg(sg),"in-quart":cg,"out-quart":xg(cg),"in-out-quart":wg(cg),"out-in-quart":Mg(cg),"in-quint":lg,"out-quint":xg(lg),"in-out-quint":wg(lg),"out-in-quint":Mg(lg),"in-expo":ug,"out-expo":xg(ug),"in-out-expo":wg(ug),"out-in-expo":Mg(ug),"in-sine":fg,"out-sine":xg(fg),"in-out-sine":wg(fg),"out-in-sine":Mg(fg),"in-circ":hg,"out-circ":xg(hg),"in-out-circ":wg(hg),"out-in-circ":Mg(hg),"in-back":dg,"out-back":xg(dg),"in-out-back":wg(dg),"out-in-back":Mg(dg),"in-bounce":pg,"out-bounce":xg(pg),"in-out-bounce":wg(pg),"out-in-bounce":Mg(pg),"in-elastic":gg,"out-elastic":xg(gg),"in-out-elastic":wg(gg),"out-in-elastic":Mg(gg),spring:mg,"spring-in":mg,"spring-out":xg(mg),"spring-in-out":wg(mg),"spring-out-in":Mg(mg)},Eg=function(t){return Og[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)]||Og.linear},kg=function(t){return t},Sg=1,Ag=.5,_g=0;function Tg(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var Pg="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Cg=new RegExp("cubic-bezier\\("+Pg+","+Pg+","+Pg+","+Pg+"\\)"),Ng=/steps\(\s*(\d+)\s*\)/,Lg=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function jg(t){var e=Cg.exec(t);if(e)return og.apply(void 0,ve([],ye(e.slice(1).map(Number)),!1));var n=Ng.exec(t);if(n)return Tg(Number(n[1]),_g);var r=Lg.exec(t);return r?Tg(Number(r[1]),{start:Sg,middle:Ag,end:_g}[r[2]]):Eg(t)}function Rg(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}var Ig=0,Bg=1,Dg=2,Fg=3;function zg(t,e,n){var r=function(t,e,n){if(null===e)return Ig;var r=n.endTime;return e<Math.min(n.delay,r)?Bg:e>=Math.min(n.delay+t+n.endDelay,r)?Dg:Fg}(t,e,n),i=function(t,e,n,r,i){switch(r){case Bg:return"backwards"===e||"both"===e?0:null;case Fg:return n-i;case Dg:return"forwards"===e||"both"===e?t:null;case Ig:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var o="auto"===n.duration?0:n.duration,a=function(t,e,n,r,i){var o=i;return 0===t?e!==Bg&&(o+=n):o+=r/t,o}(o,r,n.iterations,i,n.iterationStart),s=function(t,e,n,r,i,o){var a=t===1/0?e%1:t%1;return 0!==a||n!==Dg||0===r||0===i&&0!==o||(a=1),a}(a,n.iterationStart,r,n.iterations,i,o),c=function(t,e,n,r){return t===Dg&&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 Gg(t,e,n){var r=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r])if(Wg(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:jg(t[r].easing)||e.easingFunction,value:t[r][i]};n[i]=n[i]||[],n[i].push(o)}return n}(t,e),i=function(t,e){var n=[];for(var r in t)for(var i=t[r],o=0;o<i.length-1;o++){var a=o,s=o+1,c=i[a].computedOffset,l=i[s].computedOffset,u=c,f=l;0===o&&(u=-1/0,0===l&&(s=a)),o===i.length-2&&(f=1/0,1===c&&(a=s)),n.push({applyFrom:u,applyTo:f,startOffset:i[a].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[a].easingFunction,property:r,interpolation:Hg(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:n.easingFunction(r/i);t.setAttribute(n.property,n.interpolation(o))}));else for(var n in r)Wg(n)&&t.setAttribute(n,null)}}function Wg(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var $g=function(t,e,n){return function(r){var i=Yg(t,e,r);return!op.enableCSSParsing&&T(i)?i:n(i)}};function Hg(t,e,n,r){var i=Ah[t];if(i&&i.syntax&&i.int){var o=op.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a=void 0,s=void 0;if(op.enableCSSParsing){var c=op.styleValueRegistry.parseProperty(t,e,r),l=op.styleValueRegistry.parseProperty(t,n,r);a=op.styleValueRegistry.computeProperty(t,c,r),s=op.styleValueRegistry.computeProperty(t,l,r)}else{var u=o.parserWithCSSDisabled;a=u?u(e,r):e,s=u?u(n,r):n}var f=o.mixer(a,s,r);if(f){var h=$g.apply(void 0,ve([],ye(f),!1));return function(t){return 0===t?e:1===t?n:h(t)}}}}return $g(!1,!0,(function(t){return t?n:e}))}function Yg(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(Yg(t[s<r?s:r-1],e[s<i?s:i-1],n));return a}throw new Error("Mismatched interpolation arguments "+t+":"+e)}var Vg=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=kg,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}return Object.defineProperty(t.prototype,"easing",{get:function(){return this._easing},set:function(t){this.easingFunction=jg(t),this._easing=t},enumerable:!1,configurable:!0}),t}();function qg(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var r=t[n];Array.isArray(r)||(r=[r]);for(var i=r.length,o=0;o<i;o++){if(!e[o]){var a={};"offset"in t&&(a.offset=Number(t.offset)),"easing"in t&&(a.easing=t.easing),"composite"in t&&(a.composite=t.composite),e[o]=a}void 0!==r[o]&&null!==r[o]&&(e[o][n]=r[o])}}return e.sort((function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)})),e}(t));for(var n=t.map((function(t){var n={};for(var r in(null==e?void 0:e.composite)&&(n.composite="auto"),t){var i=t[r];if("offset"===r){if(null!==i){if(i=Number(i),!isFinite(i))throw new Error("Keyframe offsets must be numbers.");if(i<0||i>1)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw new Error("".concat(i," compositing is not supported"));n[r]=i}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n})),r=!0,i=-1/0,o=0;o<n.length;o++){var a=n[o].offset;if(y(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(!y(s)&&!y(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 Ug="backwards|forwards|both|none".split("|"),Xg="reverse|alternate|alternate-reverse".split("|");function Kg(t,e){return function(t,e){var n=new Vg;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===Ug.indexOf(t[e]))return;if("direction"===e&&-1===Xg.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 Zg=function(){function t(t,e,n){var r=this;this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=Kg(n,!1),this.timing.effect=this,this.timing.activeDuration=Rg(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=qg(e,this.timing),this.interpolations=Gg(this.normalizedKeyframes,this.timing,this.target);var i=op.globalThis.Proxy;this.computedTiming=i?new i(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?r.animation&&r.animation.currentTime||null:"currentIteration"===e?r.animation&&"running"===r.animation.playState?t.currentIteration||0:null:"progress"===e?r.animation&&"running"===r.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}}):this.timing}return t.prototype.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},t.prototype.update=function(t){return null!==t&&(this.timeFraction=zg(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},t.prototype.getKeyframes=function(){return this.normalizedKeyframes},t.prototype.setKeyframes=function(t){this.normalizedKeyframes=qg(t)},t.prototype.getComputedTiming=function(){return this.computedTiming},t.prototype.getTiming=function(){return this.timing},t.prototype.updateTiming=function(t){var e=this;Object.keys(t||{}).forEach((function(n){e.timing[n]=t[n]}))},t}();function Qg(t,e){return Number(t.id)-Number(e.id)}var Jg=function(){function t(t){var e=this;this.document=t,this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.webAnimationsNextTick=function(t){e.currentTime=t,e.discardAnimations(),0===e.animations.length?e.timelineTicking=!1:e.requestAnimationFrame(e.webAnimationsNextTick)},this.processRafCallbacks=function(t){var n=e.rafCallbacks;e.rafCallbacks=[],t<Number(e.currentTime)&&(t=Number(e.currentTime)),e.animations.sort(Qg),e.animations=e.tick(t,!0,e.animations)[0],n.forEach((function(e){e[1](t)})),e.applyPendingEffects()}}return t.prototype.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},t.prototype.isTicking=function(){return this.inTick},t.prototype.play=function(t,e,n){var r=new Zg(t,e,n),i=new Zp(r,this);return this.animations.push(i),this.restartWebAnimationsNextTick(),i.updatePromises(),i.play(),i.updatePromises(),i},t.prototype.applyDirtiedAnimation=function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(Qg),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach((function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,1)})),this.applyPendingEffects()}},t.prototype.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},t.prototype.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},t.prototype.applyPendingEffects=function(){this.pendingEffects.forEach((function(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]},t.prototype.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))},t.prototype.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))},t.prototype.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},t.prototype.rAF=function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e},t.prototype.requestAnimationFrame=function(t){var e=this;return this.rAF((function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()}))},t.prototype.tick=function(t,e,n){var r,i,o=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var a=[],s=[],c=[],l=[];return n.forEach((function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(a.push(n.effect),n.unmarkTarget()),n._needsTick&&(o.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?c.push(n):l.push(n)})),(r=this.pendingEffects).push.apply(r,ve([],ye(a),!1)),(i=this.pendingEffects).push.apply(i,ve([],ye(s),!1)),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[c,l]},t}();function tm(t){return new em([t],null,t,t.ownerDocument)}op.EasingFunction=jg,op.AnimationTimeline=Jg;class em{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 em(e,null,this._elements[0],this._document)}selectFacetAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new em(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 em([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 em(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 em(n,null,n[0],this._document)}maybeAppend(t,e,n){const r=this._elements[0],i=r.getElementById(t);if(i)return new em([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 em([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=Pn(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 em([],r,this._parent,this._document),new em(i,null,this._parent,this._document),new em(o,null,this._parent,this._document),new em([],a,this._parent,this._document),new em(s,null,this._parent,this._document)];return new em(this._elements,null,this._parent,this._document,f)}merge(t){const e=[...this._elements,...t._elements],n=[...this._transitions,...t._transitions];return new em(e,null,this._parent,this._document,void 0,n)}createElement(t){if(this._document)return this._document.createElement(t,{});const e=em.registry[t];return e?new e:ar(`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 em([],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 nm(t,e,n){return Math.max(e,Math.min(t,n))}function rm(t,e=10){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(e))}function im(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}function om(t,e,n,r,i){const o=gs(hs(r,e))+Math.PI,a=gs(hs(r,n))+Math.PI;return t.arc(r[0],r[1],i,o,a,a-o<0),t}function am(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=vr(a),[l,u]=kn(c,(t=>a[t])),f=new ia({domain:[l,u],range:[0,100]}),h=t=>f.map(a[t]),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)}%`};return`linear-gradient(${s}deg, ${c.sort(((t,e)=>h(t)-h(e))).map(d[i]||d.between).join(",")})`}function sm(t){const[e,n,r,i]=t;return[i,e,n,r]}function cm(t,e,n){const[r,i,,o]=Bc(t)?sm(e):e,[a,s]=n,c=t.getCenter(),l=ms(hs(r,c)),u=ms(hs(i,c)),f=u===l&&a!==s?u+2*Math.PI:u;return{startAngle:l,endAngle:f-l>=0?f:2*Math.PI+f,innerRadius:ps(o,c),outerRadius:ps(r,c)}}function lm(t){const{colorAttribute:e,opacityAttribute:n=e}=t;return`${n}Opacity`}function um(t,e){if(!Dc(t))return"";const n=t.getCenter(),{transform:r}=e;return`translate(${n[0]}, ${n[1]}) ${r||""}`}function fm(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:m=1/0,minHeight:y=-1/0}=i,v=he(i,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth","minHeight"]);if(!Dc(r)&&!zc(r)){const n=!!Bc(r),[i,,o]=n?sm(e):e,[a,b]=i,[x,w]=hs(o,i),M=(x>0?a:a+x)+s,O=(w>0?b:b+w)+c,E=Math.abs(x)-(s+l),k=Math.abs(w)-(c+u),S=n?nm(E,y,1/0):nm(E,g,m),A=n?nm(k,g,m):nm(k,y,1/0),_=n?M:M-(S-E)/2,T=n?O-(A-k)/2:O-(A-k);return tm(t.createElement("rect",{})).style("x",_).style("y",T).style("width",S).style("height",A).style("radius",[d,p,h,f]).call(im,v).node()}const{y:b,y1:x}=n,w=r.getCenter(),M=cm(r,e,[b,x]),O=nc().cornerRadius(a).padAngle(o*Math.PI/180);return tm(t.createElement("path",{})).style("path",O(M)).style("transform",`translate(${w[0]}, ${w[1]})`).style("radius",a).style("inset",o).call(im,v).node()}em.registry={g:Sp,rect:Lp,circle:Op,path:Pp,text:jp,ellipse:kp,image:_p,line:Tp,polygon:Cp,polyline:Np,html:Ap};const hm=(t,e)=>{const{colorAttribute:n,opacityAttribute:r="fill",first:i=!0,last:o=!0}=t,a=he(t,["colorAttribute","opacityAttribute","first","last"]),{coordinate:s,document:c}=e;return(e,r,l)=>{const{color:u,radius:f=0}=l,h=he(l,["color","radius"]),d=h.lineWidth||1,{stroke:p,radius:g=f,radiusTopLeft:m=g,radiusTopRight:y=g,radiusBottomRight:v=g,radiusBottomLeft:b=g,innerRadius:x=0,innerRadiusTopLeft:w=x,innerRadiusTopRight:M=x,innerRadiusBottomRight:O=x,innerRadiusBottomLeft:E=x,lineWidth:k=("stroke"===n||p?d:0),inset:S=0,insetLeft:A=S,insetRight:_=S,insetBottom:T=S,insetTop:P=S,minWidth:C,maxWidth:N,minHeight:L}=a,j=he(a,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop","minWidth","maxWidth","minHeight"]),{color:R=u,opacity:I}=r,B=[i?m:w,i?y:M,o?v:O,o?b:E],D=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"];Bc(s)&&D.push(D.shift());const F=Object.assign(Object.assign({radius:g},Object.fromEntries(D.map(((t,e)=>[t,B[e]])))),{inset:S,insetLeft:A,insetRight:_,insetBottom:T,insetTop:P,minWidth:C,maxWidth:N,minHeight:L});return tm(fm(c,e,r,s,F)).call(im,h).style("fill","transparent").style(n,R).style(lm(t),I).style("lineWidth",k).style("stroke",void 0===p?R:p).call(im,j).node()}};hm.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const dm=(t,e)=>hm(Object.assign({colorAttribute:"fill"},t),e);dm.props=Object.assign(Object.assign({},hm.props),{defaultMarker:"square"});const pm=(t,e)=>hm(Object.assign({colorAttribute:"stroke"},t),e);function gm(t,e,n){const[r,i,o,a]=t;if(Bc(n)){return[r,[e?e[0][0]:i[0],i[1]],[e?e[3][0]:o[0],o[1]],a]}return[r,[i[0],e?e[0][1]:i[1]],[o[0],e?e[3][1]:o[1]],a]}pm.props=Object.assign(Object.assign({},hm.props),{defaultMarker:"hollowSquare"});const mm=(t,e)=>{const{adjustPoints:n=gm}=t,r=he(t,["adjustPoints"]),{coordinate:i,document:o}=e;return(t,e,a,s)=>{const{index:c}=e,{color:l}=a,u=he(a,["color"]),f=s[c+1],h=n(t,f,i),d=!!Bc(i),[p,g,m,y]=d?sm(h):h,{color:v=l,opacity:b}=e,x=cc().curve(Oc)([p,g,m,y]);return tm(o.createElement("path",{})).call(im,u).style("path",x).style("fill",v).style("fillOpacity",b).call(im,r).node()}};function ym(t,e,n){const[r,i,o,a]=t;if(Bc(n)){return[r,[e?e[0][0]:(i[0]+o[0])/2,i[1]],[e?e[3][0]:(i[0]+o[0])/2,o[1]],a]}return[r,[i[0],e?e[0][1]:(i[1]+o[1])/2],[o[0],e?e[3][1]:(i[1]+o[1])/2],a]}mm.props={defaultMarker:"square"};const vm=(t,e)=>mm(Object.assign({adjustPoints:ym},t),e);function bm(t){const e="function"==typeof t?t:t.render;return class extends Ep{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}vm.props={defaultMarker:"square"};const xm=bm((t=>{const{d1:e,d2:n,style1:r,style2:i}=t.attributes,o=t.ownerDocument;tm(t).maybeAppend("line",(()=>o.createElement("path",{}))).style("d",e).call(im,r),tm(t).maybeAppend("line1",(()=>o.createElement("path",{}))).style("d",n).call(im,i)}));const wm=(t,e)=>{const{curve:n,gradient:r=!1,gradientColor:i="between",defined:o=(t=>!Number.isNaN(t)&&null!=t),connect:a=!1}=t,s=he(t,["curve","gradient","gradientColor","defined","connect"]),{coordinate:c,document:l}=e;return(t,e,u)=>{const{color:f,lineWidth:h}=u,d=he(u,["color","lineWidth"]),{color:p=f,size:g=h,seriesColor:m,seriesX:y,seriesY:v}=e,b=um(c,e),x=Bc(c),w=r&&m?am(m,y,v,r,i,x):p,M=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},d),w&&{stroke:w}),g&&{lineWidth:g}),b&&{transform:b}),s);let O;if(Dc(c)){const t=c.getCenter();O=e=>dc(cc().curve(uc)).angle(((n,r)=>ms(hs(e[r],t)))).radius(((n,r)=>ps(e[r],t))).defined((([t,e])=>o(t)&&o(e))).curve(n)(e)}else O=cc().x((t=>t[0])).y((t=>t[1])).defined((([t,e])=>o(t)&&o(e))).curve(n);const[E,k]=function(t,e){const n=[],r=[];let i=!1,o=null;for(const a of t)e(a[0])&&e(a[1])?(n.push(a),i&&(i=!1,r.push([o,a])),o=a):i=!0;return[n,r]}(t,o),S=ur(M,"connect"),A=!!k.length;if(!A||a&&!Object.keys(S).length)return tm(l.createElement("path",{})).style("d",O(E)||[]).call(im,M).node();if(A&&!a)return tm(l.createElement("path",{})).style("d",O(t)).call(im,M).node();return tm(new xm).style("style1",Object.assign(Object.assign({},M),S)).style("style2",M).style("d1",(_=k,_.map(O).join(","))).style("d2",O(t)).node();var _}};wm.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Mm=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=Dc(n)?Oc:oc;return wm(Object.assign({curve:i},t),e)(...r)}};Mm.props=Object.assign(Object.assign({},wm.props),{defaultMarker:"line"});const Om=(t,e)=>{const n=he(t,[]),{coordinate:r}=e;return(...t)=>{const i=Dc(r)?wc:Bc(r)?Nc:Cc;return wm(Object.assign({curve:i},n),e)(...t)}};Om.props=Object.assign(Object.assign({},wm.props),{defaultMarker:"smooth"});const Em=(t,e)=>wm(Object.assign({curve:Ic},t),e);Em.props=Object.assign(Object.assign({},wm.props),{defaultMarker:"hv"});const km=(t,e)=>wm(Object.assign({curve:Rc},t),e);km.props=Object.assign(Object.assign({},wm.props),{defaultMarker:"vh"});const Sm=(t,e)=>wm(Object.assign({curve:jc},t),e);function Am(t,e,n,r,i){const o=gs(hs(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=ds(e,s),h=ds(n,c),d=ds(h,l),p=ds(n,l),g=hs(p,c),m=hs(n,c),y=hs(e,s),v=hs(y,u),b=hs(e,u),x=hs(f,u);t.moveTo(...f),t.lineTo(...h),t.arcTo(...d,...p,i/2),t.arcTo(...g,...m,i/2),t.lineTo(...y),t.arcTo(...v,...b,r/2),t.arcTo(...x,...f,r/2),t.closePath()}Sm.props=Object.assign(Object.assign({},wm.props),{defaultMarker:"hvh"});const _m=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{seriesSize:o,color:a}=r,{color:s}=i,c=he(i,["color"]),l=Us();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(cr)&&Am(l,n,r,i,a)}return tm(n.createElement("path",{})).call(im,c).style("fill",a||s).style("d",l.toString()).call(im,t).node()}};_m.props=Object.assign(Object.assign({},wm.props),{defaultMarker:"line"});const Tm=(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"]];Tm.style=["fill"];const Pm=Tm.bind(void 0);Pm.style=["stroke","lineWidth"];const Cm=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]];Cm.style=["fill"];const Nm=Cm.bind(void 0);Nm.style=["fill"];const Lm=Cm.bind(void 0);Lm.style=["stroke","lineWidth"];const jm=(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"]]};jm.style=["fill"];const Rm=jm.bind(void 0);Rm.style=["stroke","lineWidth"];const Im=(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"]]};Im.style=["fill"];const Bm=Im.bind(void 0);Bm.style=["stroke","lineWidth"];const Dm=(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"]]};Dm.style=["fill"];const Fm=Dm.bind(void 0);Fm.style=["stroke","lineWidth"];const zm=(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"]]};zm.style=["fill"];const Gm=zm.bind(void 0);Gm.style=["stroke","lineWidth"];const Wm=(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"]]};Wm.style=["fill"];const $m=Wm.bind(void 0);$m.style=["stroke","lineWidth"];const Hm=(t,e,n)=>[["M",t,e+n],["L",t,e-n]];Hm.style=["stroke","lineWidth"];const Ym=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]];Ym.style=["stroke","lineWidth"];const Vm=(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]];Vm.style=["stroke","lineWidth"];const qm=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]];qm.style=["stroke","lineWidth"];const Um=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];Um.style=["stroke","lineWidth"];const Xm=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];Xm.style=["stroke","lineWidth"];const Km=Xm.bind(void 0);Km.style=["stroke","lineWidth"];const Zm=(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]];Zm.style=["stroke","lineWidth"];const Qm=(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]];Qm.style=["stroke","lineWidth"];const Jm=(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]];Jm.style=["stroke","lineWidth"];const ty=(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]];ty.style=["stroke","lineWidth"];const ey=(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]];ey.style=["stroke","lineWidth"];const ny=new Map([["bowtie",Wm],["cross",Ym],["dash",Km],["diamond",jm],["dot",Xm],["hexagon",zm],["hollowBowtie",$m],["hollowDiamond",Rm],["hollowHexagon",Gm],["hollowPoint",Pm],["hollowSquare",Lm],["hollowTriangle",Bm],["hollowTriangleDown",Fm],["hv",Qm],["hvh",ty],["hyphen",Um],["line",Hm],["plus",qm],["point",Tm],["rect",Nm],["smooth",Zm],["square",Cm],["tick",Vm],["triangleDown",Dm],["triangle",Im],["vh",Jm],["vhv",ey]]);const ry=(t,e)=>{const{colorAttribute:n,symbol:r,mode:i="auto"}=t,o=he(t,["colorAttribute","symbol","mode"]),a=ny.get(r)||ny.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,[m,y]=function(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]}(e),v=function(t,e,n,r){if(1===e.length)return;const{size:i}=n;if("fixed"===t)return i;if("normal"===t||Wc(r)){const[[t,n],[r,i]]=e,o=Math.abs((r-t)/2),a=Math.abs((i-n)/2);return Math.max(0,(o+a)/2)}return i}(i,e,r,s),b=v||o.r||l.r;return tm(c.createElement("path",{})).call(im,l).style("fill","transparent").style("d",a(m,y,b)).style("lineWidth",h).style("transform",p).style("stroke",d).style(lm(t),g).style(n,d).call(im,o).node()}};ry.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const iy=(t,e)=>ry(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e);iy.props=Object.assign({defaultMarker:"hollowBowtie"},ry.props);const oy=(t,e)=>ry(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e);oy.props=Object.assign({defaultMarker:"hollowDiamond"},ry.props);const ay=(t,e)=>ry(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e);ay.props=Object.assign({defaultMarker:"hollowHexagon"},ry.props);const sy=(t,e)=>ry(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e);sy.props=Object.assign({defaultMarker:"hollowPoint"},ry.props);const cy=(t,e)=>ry(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e);cy.props=Object.assign({defaultMarker:"hollowSquare"},ry.props);const ly=(t,e)=>ry(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e);ly.props=Object.assign({defaultMarker:"hollowTriangle"},ry.props);const uy=(t,e)=>ry(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e);uy.props=Object.assign({defaultMarker:"hollowTriangleDown"},ry.props);const fy=(t,e)=>ry(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e);fy.props=Object.assign({defaultMarker:"bowtie"},ry.props);const hy=(t,e)=>ry(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e);hy.props=Object.assign({defaultMarker:"cross"},ry.props);const dy=(t,e)=>ry(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e);dy.props=Object.assign({defaultMarker:"diamond"},ry.props);const py=(t,e)=>ry(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e);py.props=Object.assign({defaultMarker:"hexagon"},ry.props);const gy=(t,e)=>ry(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e);gy.props=Object.assign({defaultMarker:"hyphen"},ry.props);const my=(t,e)=>ry(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e);my.props=Object.assign({defaultMarker:"line"},ry.props);const yy=(t,e)=>ry(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e);yy.props=Object.assign({defaultMarker:"plus"},ry.props);const vy=(t,e)=>ry(Object.assign({colorAttribute:"fill",symbol:"point"},t),e);vy.props=Object.assign({defaultMarker:"point"},ry.props);const by=(t,e)=>ry(Object.assign({colorAttribute:"fill",symbol:"square"},t),e);by.props=Object.assign({defaultMarker:"square"},ry.props);const xy=(t,e)=>ry(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e);xy.props=Object.assign({defaultMarker:"tick"},ry.props);const wy=(t,e)=>ry(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e);wy.props=Object.assign({defaultMarker:"triangle"},ry.props);const My=(t,e)=>ry(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e);My.props=Object.assign({defaultMarker:"triangleDown"},ry.props);const Oy=(t,e)=>{const{arrow:n=!0,arrowSize:r="40%"}=t,i=he(t,["arrow","arrowSize"]),{document:o}=e;return(t,e,a)=>{const{defaultColor:s}=a,c=he(a,["defaultColor"]),{color:l=s,transform:u}=e,[f,h]=t,d=Us();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*ps(t,e):r,o=Math.PI/6,a=Math.atan2(e[1]-t[1],e[0]-t[0]),s=Math.PI/2-a-o,c=a-o;return[[e[0]-i*Math.sin(s),e[1]-i*Math.cos(s)],[e[0]-i*Math.cos(c),e[1]-i*Math.sin(c)]]}(f,h,{arrowSize:r});d.moveTo(...h),d.lineTo(...t),d.moveTo(...h),d.lineTo(...e)}return tm(o.createElement("path",{})).call(im,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(im,i).node()}};function Ey(t,e){e(t),t.children&&t.children.forEach((function(t){t&&Ey(t,e)}))}function ky(t){Ay(t,!0)}function Sy(t){Ay(t,!1)}function Ay(t,e){var n=e?"visible":"hidden";Ey(t,(function(t){t.attr("visibility",n)}))}Oy.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var _y=function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.apply(this,ve([],ye(e),!1))||this;return r.addEventListener($d.INSERTED,(function(){Sy(r)})),r}return ue(e,t),e}(Sp);function Ty(t){var e=t.appendChild(new _y({class:"offscreen"}));return Sy(e),e}var Py=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=he(e,["style"]);return t.call(this,fe({style:fe({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},n)},r))||this}return ue(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=Ty(this)),this._offscreen},enumerable:!1,configurable:!0}),e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e}(jp);function Cy(t){return t*Math.PI/180}function Ny(t){return Number((180*t/Math.PI).toPrecision(5))}var Ly=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 jy(t,e){return m(t)?t.apply(void 0,ve([],ye(e),!1)):t}var Ry,Iy=function(t,e){var n=function(t){return"".concat(e,"-").concat(t)},r=Object.fromEntries(Object.entries(t).map((function(t){var e=ye(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},By=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=5),Object.entries(e).forEach((function(i){var o=ye(i,2),a=o[0],s=o[1],c=t;Object.prototype.hasOwnProperty.call(e,a)&&(s?O(s)?(O(t[a])||(c[a]={}),n<r?By(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)}))},Dy=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)By(t,e[r]);return t},Fy=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},zy=function(t,e,n){if(void 0===n&&(n=128),!m(t))throw new TypeError("Expected a function");var r=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var s=t.apply(this,n);return a.set(o,s),s};return r.cache=$(n),r}((function(t,e){var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return Ry||(Ry=op.offscreenCanvasCreator.getOrCreateContext(void 0)),Ry.font=[o,a,i,"".concat(n,"px"),r].join(" "),Ry.measureText(t).width}),(function(t,e){return[t,Object.values(e||Gy(t)).join()].join("")}),4096),Gy=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 Wy(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function $y(t,e){var n=Wy(t);n&&n.attr(e)}function Hy(t,e,n){void 0===n&&(n="..."),$y(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n})}function Yy(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 Vy(t){return"function"==typeof t?t():A(t)||T(t)?new Py({style:{text:String(t)}}):t}function qy(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 Uy(t,e,n,r,i){return void 0===r&&(r=!0),void 0===i&&(i=!1),!!(r&&t===e||i&&t===n)||t>e&&t<n}var Xy=function(t,e){return function(n){return t*(1-n)+e*n}};function Ky(t,e){return"number"==typeof t&&"number"==typeof e?Xy(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]=Ky(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=ye(e,2),o=i[0],a=i[1];o in t?n[o]=Ky(t[o],a):r[o]=a})),function(t){return Object.entries(n).forEach((function(e){var n=ye(e,2),i=n[0],o=n[1];return r[i]=o(t)})),r}}(t,e):function(e){return t}}function Zy(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=ye([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 Ly(e,n,r-e,i-n)}var Qy=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=ye([0,0],2),g=p[0],m=p[1],y=e.map((function(t){var e,n=t.width,r=t.height,i=ye([g,m],2),o=i[0],a=i[1];return e=ye([g+n*d[0],m+r*d[1]],2),g=e[0],m=e[1],new Ly(o,a,n,r)})),v=Zy(y),b={"flex-start":0,"flex-end":f?r-v.width:i-v.height,center:f?(r-v.width)/2:(i-v.height)/2},x=y.map((function(t){var e=t.x,n=t.y,r=Ly.fromRect(t);return r.x=f?e+b[c]:e,r.y=f?n:n+b[c],r}));Zy(x);var w=function(t){var e=ye(f?["height",i]:["width",r],2),n=e[0],o=e[1];switch(u){case"flex-start":default:return 0;case"flex-end":return o-t[n];case"center":return o/2-t[n]/2}},M=x.map((function(t){var e=t.x,n=t.y,r=Ly.fromRect(t);return r.x=f?e:e+w(r),r.y=f?n+w(r):n,r})),O=M.map((function(e){var n,r,i=Ly.fromRect(e);return i.x+=null!==(n=t.x)&&void 0!==n?n:0,i.y+=null!==(r=t.y)&&void 0!==r?r:0,i}));return O},Jy=function(t,e,n){return[]};function tv(t,e){return[t[0]*e,t[1]*e]}function ev(t,e){return[t[0]+e[0],t[1]+e[1]]}function nv(t,e){return[t[0]-e[0],t[1]-e[1]]}function rv(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function iv(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function ov(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function av(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 sv(t,e){return+t.toPrecision(e)}function cv(t,e){var n={},r=Array.isArray(e)?e:[e];for(var i in t)r.includes(i)||(n[i]=t[i]);return n}function lv(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=[[0,0],[1,1]]);for(var r=!!e,i=[],o=0,a=t.length;o<a;o+=2)i.push([t[o],t[o+1]]);var s,c,l,u=function(t,e,n,r){var i,o,a,s,c,l,u=[],f=!!r,h=[1/0,1/0],d=[-1/0,-1/0];if(f){h=(i=ye(r,2))[0],d=i[1];for(var p=0,g=t.length;p<g;p+=1)h=rv(h,y=t[p]),d=iv(d,y)}p=0;for(var m=t.length;p<m;p+=1){var y=t[p];if(0!==p||n)if(p!==m-1||n){o=t[[p?p-1:m-1,p-1][n?0:1]];var v=[0,0];v=tv(v=nv(a=t[n?(p+1)%m:p+1],o),e);var b=ov(y,o),x=ov(y,a),w=b+x;0!==w&&(b/=w,x/=w);var M=tv(v,-b),O=tv(v,x);c=ev(y,M),s=rv(s=ev(y,O),iv(a,y)),s=iv(s,rv(a,y)),c=rv(c=ev(y,M=tv(M=nv(s,y),-b/x)),iv(o,y)),s=ev(y,O=tv(O=nv(y,c=iv(c,rv(o,y))),x/b)),f&&(c=rv(c=iv(c,h),d),s=rv(s=iv(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=ye(i,1)[0],h.push(["C",s[0],s[1],c[0],c[1],l[0],l[1]])),h}var uv=["$el","anchor","cx","cy","d","defX","defY","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 fv(t){return uv.includes(t)}function hv(t){var e={};for(var n in t)fv(n)&&(e[n]=t[n]);return e}function dv(t,e,n){void 0===n&&(n=!1);var r=t.getBBox(),i=r.width,o=r.height,a=e/Math.max(i,o);return n&&t.scale(a),a}var pv=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=ye(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=be(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=be(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=be(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],m=e(g,p),y=r(g,p);if(f.has(m))(w=f.get(m)).__data__=g,w.__facet__=!1,s.push(w),c.delete(w),f.delete(m);else if(h.has(m)){(w=h.get(m)).__data__=g,w.__facet__=!0,s.push(w),h.delete(m)}else if(d.has(m)){var v=d.get(m);l.push([g,v]);try{for(var b=(i=void 0,me(v)),x=b.next();!x.done;x=b.next()){var w=x.value;c.delete(w)}}catch(t){i={error:t}}finally{try{x&&!x.done&&(o=b.return)&&o.call(b)}finally{if(i)throw i.error}}d.delete(m)}else if(f.has(y)){(w=f.get(y)).__toData__?w.__toData__.push(g):w.__toData__=[g],u.add(w),c.delete(w)}else a.push(g)}var M=[new n([],a,this._parent,this._document),new n(s,null,this._parent,this._document),new n(c,null,this._parent,this._document),new n([],l,this._parent,this._document),new n(u,null,this._parent,this._document)];return new n(this._elements,null,this._parent,this._document,M)},t.prototype.merge=function(t){var e=ve(ve([],ye(this._elements),!1),ye(t._elements),!1),r=ve(ve([],ye(this._transitions),!1),ye(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=ye(t,2),a=o[0],s=o[1],c="function"==typeof s&&e?s:function(){return s};void 0!==s&&i.attr(a,c.call(i,n,r))}))}))},t.prototype.update=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each((function(e,r){t&&this.update&&this.update(n.call(this,e,r))}))},t.prototype.maybeUpdate=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each((function(e,r){t&&this.update&&this.update(n.call(this,e,r))}))},t.prototype.transition=function(t){var e=this._transitions;return this.each((function(n,r){e[r]=t.call(this,n,r)}))},t.prototype.on=function(t,e){return this.each((function(){this.addEventListener(t,e)})),this},t.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.call.apply(t,ve([this._parent,this],ye(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:Sp,rect:Lp,circle:Op,path:Pp,text:Py,ellipse:kp,image:_p,line:Tp,polygon:Cp,polyline:Np,html:Ap},t}();function gv(t){return new pv([t],null,t,t.ownerDocument)}function mv(t){if(T(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 yv(t){var e=t.getLocalBounds(),n=ye([e.min,e.max],2),r=ye(n[0],2),i=r[0],o=r[1],a=ye(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 vv(t,e){var n=ye(t,2),r=n[0],i=n[1],o=ye(e,2),a=o[0],s=o[1];return r!==a&&i===s}function bv(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function xv(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 wv=function(t,e){if(!(null==t?void 0:t.startsWith(e)))return!1;var n=t[e.length];return n>="A"&&n<="Z"};function Mv(t,e,n){void 0===n&&(n=!1);var r={};return Object.entries(t).forEach((function(t){var i=ye(t,2),o=i[0],a=i[1];if("className"===o||"class"===o);else if(wv(o,"show")&&wv(xv(o,"show"),e)!==n)o===function(t,e){return"".concat(e).concat(bv(t))}(e,"show")?r[o]=a:r[o.replace(new RegExp(bv(e)),"")]=a;else if(!wv(o,"show")&&wv(o,e)!==n){var s=xv(o,e);"filter"===s&&"function"==typeof a||(r[s]=a)}})),r}function Ov(t,e){return Object.entries(t).reduce((function(t,n){var r=ye(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(bv(i))]=o,t}),{})}function Ev(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=ye(t,2),a=o[0],s=o[1];e.includes(a)||(-1!==n.indexOf(a)?i[a]=s:r[a]=s)})),[r,i]}function kv(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=ye([e,n].map((function(t,e){var n;return t.includes("%")?parseFloat((null===(n=t.match(/[+-]?([0-9]*[.])?[0-9]+/))||void 0===n?void 0:n[0])||"0")/100*(0===e?i:o):t})),2);return[a[0],a[1]]}(t,n,r),")")}));t.attr("transform",n)}catch(t){}}function Sv(){Ay(this,"hidden"!==this.attributes.visibility)}var Av=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,Dy({},{style:n},e))||this;return r.initialized=!1,r._defaultOptions=n,r}return ue(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=Ty(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&&Sv.call(this)},e.prototype.update=function(t,e){var n;return this.attr(Dy({},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}(Ep),_v=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"]]},Tv=_v,Pv=function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},Cv=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},Nv=Cv;var Lv=function(t,e,n){return[["M",t-n,e-n],["L",t+n,e],["L",t-n,e+n],["Z"]]};function jv(t){var e=function(t){var e="default";if(w(t)&&t instanceof Image)e="image";else if(m(t))e="symbol";else if(A(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 Rv=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ue(e,t),e.prototype.render=function(t,n){var r=t.symbol,i=t.size,o=void 0===i?16:i,a=he(t,["symbol","size"]),s=jv(r);qy(!!s,gv(n),(function(t){t.maybeAppendByClassName("marker",s).attr("className","marker ".concat(s,"-marker")).call((function(t){if("image"===s){var n=2*o;t.styles({img:r,width:n,height:n,x:-o,y:-o})}else{n=o/2;var i=m(r)?r:e.getSymbol(r);t.styles(fe({path:null==i?void 0:i(0,0,n)},a))}}))}))},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}(Av);Rv.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]]})),Rv.registerSymbol("hyphen",(function(t,e,n){return[["M",t-n,e],["L",t+n,e]]})),Rv.registerSymbol("line",Pv),Rv.registerSymbol("plus",(function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]})),Rv.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]]})),Rv.registerSymbol("circle",_v),Rv.registerSymbol("point",Tv),Rv.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"]]})),Rv.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"]]})),Rv.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"]]})),Rv.registerSymbol("diamond",(function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]})),Rv.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"]]})),Rv.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"]]})),Rv.registerSymbol("line",Pv),Rv.registerSymbol("dot",Cv),Rv.registerSymbol("dash",Nv),Rv.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]]})),Rv.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]]})),Rv.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]]})),Rv.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]]})),Rv.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 Iv=function(t){function e(e){var n=this,r=e.style,i=he(e,["style"]);return(n=t.call(this,V({},{type:"column"},fe({style:r},i)))||this).columnsGroup=new Sp({name:"columns"}),n.appendChild(n.columnsGroup),n.render(),n}return ue(e,t),e.prototype.render=function(){var t=this.attributes.columns;gv(this.columnsGroup).selectAll(".column").data(t.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(Dy({},this.attributes,t)),this.render()},e.prototype.clear=function(){this.removeChildren()},e}(wp),Bv=function(t){function e(e){var n=this,r=e.style,i=he(e,["style"]);return(n=t.call(this,V({},{type:"lines"},fe({style:r},i)))||this).linesGroup=n.appendChild(new Sp),n.areasGroup=n.appendChild(new Sp),n.render(),n}return ue(e,t),e.prototype.render=function(){var t=this.attributes,e=t.lines,n=t.areas;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(Dy({},this.attributes,t)),this.render()},e.prototype.renderLines=function(t){gv(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){gv(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}(wp);function Dv(t,e){void 0===e&&(e=!1);var n=e?t.length-1:0,r=t.map((function(t,e){return ve([e===n?"M":"L"],ye(t),!1)}));return e?r.reverse():r}function Fv(t,e){if(void 0===e&&(e=!1),t.length<=2)return Dv(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var o=e?t[r-i-1]:t[i];U(o,n.slice(-2))||n.push.apply(n,ve([],ye(o),!1))}var a=lv(n,!1);return e?a.unshift(ve(["M"],ye(t[r-1]),!1)):a.unshift(ve(["M"],ye(t[0]),!1)),a}function zv(t,e,n){var r=G(t);return r.push(["L",e,n],["L",0,n],["Z"]),r}function Gv(t){return 0===t.length?[0,0]:[k(L(t,(function(t){return k(t)||0}))),E(N(t,(function(t){return E(t)||0})))]}function Wv(t){for(var e=G(t),n=e[0].length,r=ye([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 $v=function(t){function e(e){return t.call(this,e,{type:"line",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 ue(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=G(t);return T(e[0])?[e]:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?Wv(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=ye(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=Mv(this.attributes,"area"),a=Mv(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=ye(i.getOptions().range||[0,0],2),a=o[0],s=o[1];return s>a&&(n=ye([a,s],2),s=n[0],a=n[1]),t.map((function(t){return t.map((function(t,e){return[r.map(e),_(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=Fv(o),s=void 0;if(0===i)s=zv(a,e,n);else{var c=Fv(t[i-1],!0),l=o[0];c[0][0]="L",s=ve(ve(ve([],ye(a),!1),ye(c),!1),[ve(["M"],ye(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=Dv(t[i]),a=void 0;if(0===i)a=zv(o,e,n);else{var s=Dv(t[i-1],!0);s[0][0]="L",a=ve(ve(ve([],ye(o),!1),ye(s),!1),[["Z"]],!1)}r.push(a)}return r}(u,s,h):function(t,e,n,r){return t.map((function(t){return zv(e?Fv(t):Dv(t),n,r)}))}(u,i,s,h)}return{lines:u.map((function(e,n){return fe({stroke:t.getColor(n),path:i?Fv(e):Dv(e)},a)})),areas:f.map((function(e,n){return fe({path:e,fill:t.getColor(n)},o)}))}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columnsStyle",{get:function(){var t=this,e=Mv(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=Wv(s));var c=this.createScales(s),l=c.x,u=c.y,f=ye(Gv(s),2),h=f[0],d=f[1],p=new ia({domain:[0,d-(h>0?0:h)],range:[0,a*o]}),g=l.getBandWidth(),m=this.rawData;return{columns:s.map((function(n,i){return n.map((function(n,o){var a=g/s.length;return fe(fe({fill:t.getColor(i)},e),r?{x:l.map(o),y:u.map(n),width:g,height:p.map(m[i][o])}:{x:l.map(o)+a*i,y:n>=0?u.map(n):u.map(0),width:a,height:p.map(Math.abs(n))})}))}))}},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){var n,r,i;(n=e,r=".container",i="rect",n.querySelector(r)?gv(n).select(r):gv(n).append(i)).attr("className","container").node();var o=t.type,a="spark".concat(o),s="line"===o?this.linesStyle:this.columnsStyle;gv(e).selectAll(".spark").data([o]).join((function(t){return t.append((function(t){return"line"===t?new Bv({className:a,style:s}):new Iv({className:a,style:s})})).attr("className","spark ".concat(a))}),(function(t){return t.update(s)}),(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=ye(Gv(t),2),d=h[0],p=h[1],g=new ia({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 ia({domain:[0,t[0].length-1],range:[0,u]}),y:g}:{type:i,x:new zo({domain:t[0].map((function(t,e){return e})),range:[0,u],paddingInner:c,paddingOuter:c/2,align:.5}),y:g}},e.tag="sparkline",e}(Av);function Hv(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=ye(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,fe(fe({},t[e]),n)]:[e,n]})))}function Yv(t,e){t?t.finished.then(e):e()}function Vv(t,e){"update"in t?t.update(e):t.attr(e)}function qv(t,e,n){return 0===e.length?null:n?t.animate(e,n):(Vv(t,{style:e.slice(-1)[0]}),null)}function Uv(t,e,n){var r={},i={};return Object.entries(e).forEach((function(e){var n=ye(e,2),o=n[0],a=n[1];if(!y(a)){var s=t.style[o]||t.parsedStyle[o]||0;s!==a&&(r[o]=s,i[o]=a)}})),n?qv(t,[r,i],fe({fill:"both"},n)):(Vv(t,i),null)}function Xv(t,e){return t.style.opacity||(t.style.opacity=1),Uv(t,{opacity:0},e)}var Kv={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},Zv={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},Qv={orientation:"horizontal",showLabel:!0,type:"start"},Jv=Iy({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),tb=Iy({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),eb=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ue(e,t),e.prototype.render=function(t,e){var n=t.size,r=void 0===n?10:n,i=t.radius,o=void 0===i?r/4:i,a=t.orientation,s=he(t,["size","radius","orientation"]),c=r,l=2.4*c,u=gv(e).maybeAppendByClassName(tb.iconRect,"rect").styles(fe(fe({},s),{width:c,height:l,radius:o,x:-c/2,y:-l/2})),f=1/3*c,h=2/3*c,d=1/4*l,p=3/4*l;u.maybeAppendByClassName("".concat(tb.iconLine,"-1"),"line").styles(fe({x1:f,x2:f,y1:d,y2:p},s)),u.maybeAppendByClassName("".concat(tb.iconLine,"-2"),"line").styles(fe({x1:h,x2:h,y1:d,y2:p},s)),u.node().setOrigin(c/2,l/2),"vertical"===a?e.setLocalEulerAngles(90):e.setLocalEulerAngles(0)},e}(Av),nb=function(t){function e(e){return t.call(this,e,Qv)||this}return ue(e,t),e.prototype.renderLabel=function(t){var e=this,n=this.attributes.showLabel,r=Mv(this.attributes,"label"),i=r.transform,o=ye(Ev(he(r,["transform"]),[]),2),a=o[0],s=o[1],c=gv(t).maybeAppendByClassName(tb.labelGroup,"g").styles(s),l=fe(fe({},Zv),a),u=l.text,f=he(l,["text"]);qy(!!n,c,(function(t){e.label=t.maybeAppendByClassName(tb.label,"text").styles(fe(fe({},f),{transform:i,text:"".concat(u)})),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.orientation,r=e.type,i=fe(fe({orientation:n},Kv),Mv(this.attributes,"icon")),o=this.attributes.iconShape,a=void 0===o?function(){return new eb({style:i})}:o;gv(t).maybeAppendByClassName(tb.iconGroup,"g").selectAll(tb.icon.class).data([a]).join((function(t){return t.append("string"==typeof a?a:function(){return a(r)}).attr("className",tb.icon.name)}),(function(t){return t.update(i)}),(function(t){return t.remove()}))},e.prototype.render=function(t,e){this.renderIcon(e),this.renderLabel(e)},e}(Av),rb=function(t){function e(e){var n=t.call(this,e,fe(fe(fe({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},Ov(Qv,"handle")),Ov(Kv,"handleIcon")),Ov(Zv,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(t){return function(e){e.stopPropagation(),n.target=t,n.prevPos=n.getOrientVal(Yy(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(Yy(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 Dd("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 ue(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=Mv(this.attributes,"sparkline");return fe(fe({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=ye(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=ye(mv(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(Jv.selection.class).each((function(n,r){Uv(this,e[r],t)}))},e.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(this.startHandle&&Uv(this.startHandle,this.getHandleStyle("start"),t),this.endHandle&&Uv(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=Mv(this.attributes,"track");this.trackShape=gv(t).maybeAppendByClassName(Jv.track,"rect").styles(fe(fe({},this.shape),e))},e.prototype.renderBrushArea=function(t){var e=this.attributes.brushable;this.brushArea=gv(t).maybeAppendByClassName(Jv.brushArea,"rect").styles(fe({fill:"transparent",cursor:e?"crosshair":"default"},this.shape))},e.prototype.renderSparkline=function(t){var e=this;qy("horizontal"===this.attributes.orientation,gv(t).maybeAppendByClassName(Jv.sparklineGroup,"g"),(function(t){var n=e.sparklineStyle;t.maybeAppendByClassName(Jv.sparkline,(function(){return new $v({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(Jv.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 nb({style:e.getHandleStyle(n)})})).each((function(t){var e=t.type;this.attr("class","".concat(Jv.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.type,r=e.selectionType;this.foregroundGroup=gv(t).maybeAppendByClassName(Jv.foreground,"g");var i=Mv(this.attributes,"selection"),o=function(t){return t.style("visibility",(function(t){return t.show?"visible":"hidden"})).style("cursor",(function(t){return"select"===r?"grab":"invert"===r?"crosshair":"default"})).styles(i)},a=this;this.foregroundGroup.selectAll(Jv.selection.class).data("value"===n?[]:this.calcSelectionArea().map((function(t,e){return{style:fe({},t),index:e,show:"select"===r?1===e:1!==e}})),(function(t){return t.index})).join((function(t){return t.append("rect").attr("className",Jv.selection.name).call(o).each((function(t,e){var n=this;1===e?(a.selectionShape=gv(this),this.on("pointerdown",(function(t){n.attr("cursor","grabbing"),a.onDragStart("selection")(t)})),a.dispatchCustomEvent(this,"pointerenter","selectionMouseenter"),a.dispatchCustomEvent(this,"pointerleave","selectionMouseleave"),a.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",a.onDragStart("track"))}))}),(function(t){return t.call(o)}),(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=ye(this.range,2),i=r[0],o=r[1],a=ye(this.getValues().map((function(t){return sv(t,e)})),2),s=a[0],c=a[1],l=ye(((Array.isArray(t)?t:[s,null!=t?t:c])||[s,c]).map((function(t){return sv(t,e)})),2),u=l[0],f=l[1];if("value"===this.attributes.type)return[0,_(f,i,o)];u>f&&(u=(n=ye([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=ye(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=ye(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?{transform:"rotate(90)",textAlign:"start"}:"end"===t?{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=Mv(this.attributes,"handle"),c=Mv(s,"label"),l=s.spacing,u=this.getHandleSize(),f=this.clampValues(),h=o("start"===t?f[0]:f[1]),d=new Py({style:fe(fe(fe({},c),this.inferTextStyle(t)),{text:h})}),p=d.getBBox(),g=p.width,m=p.height;if(d.destroy(),!a){if("value"===r)return{text:h,x:0,y:-m-l};var y=l+u+("horizontal"===i?g/2:0);return(e={text:h})["horizontal"===i?"x":"y"]="start"===t?-y:y,e}var v=0,b=0,x=this.availableSpace,w=x.width,M=x.height,O=this.calcSelectionArea()[1],E=O.x,k=O.y,S=O.width,A=O.height,_=l+u;if("horizontal"===i){var T=_+g/2;if("start"===t)v=E-_-g>0?-T:T;else v=w-E-S-_>g?T:-T}else{var P=m+_;b="start"===t?k-u>m?-P:_:M-(k+A)-u>m?P:-_}return{x:v,y:b,text:h}},e.prototype.getHandleLabelStyle=function(t){var e=Mv(this.attributes,"handleLabel");return fe(fe(fe({},e),this.calcHandleText(t)),this.inferTextStyle(t))},e.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=Mv(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),r=this.getHandleSize();return fe({cursor:n,shape:t,size:r},e)},e.prototype.getHandleStyle=function(t){var e=this.attributes,n=e.showLabel,r=e.showLabelOnInteraction,i=e.orientation,o=this.calcHandlePosition(t),a=this.calcHandleText(t),s=n;return!n&&r&&(s=!!this.target),fe(fe(fe(fe({},Ov(this.getHandleIconStyle(),"icon")),Ov(fe(fe({},this.getHandleLabelStyle(t)),a),"label")),o),{orientation:i,showLabel:s,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=ye(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=ye(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 Dd(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}(Av),ib=function(t){function e(e){var n=t.call(this,e,{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 Dd("scroll",r)),n.dispatchEvent(new Dd("valuechange",r))}},n.onTrackClick=function(t){if(n.attributes.slidable){var e=ye(n.getLocalPosition(),2),r=e[0],i=e[1],o=ye(n.padding,4),a=o[0],s=o[3],c=n.getOrientVal([r+s,i+a]),l=(n.getOrientVal(Yy(t))-c)/n.trackLength;n.setValue(l,!0)}},n.onThumbMouseenter=function(t){n.dispatchEvent(new Dd("thumbMouseenter",{detail:t.detail}))},n.onTrackMouseenter=function(t){n.dispatchEvent(new Dd("trackMouseenter",{detail:t.detail}))},n.onThumbMouseleave=function(t){n.dispatchEvent(new Dd("thumbMouseleave",{detail:t.detail}))},n.onTrackMouseleave=function(t){n.dispatchEvent(new Dd("trackMouseleave",{detail:t.detail}))},n}return ue(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return mv(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){var t=this.attributes.value,e=ye(this.range,2),n=e[0],r=e[1];return _(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=ye(this.padding,4),r=n[0],i=n[1],o=n[2],a=n[3],s=ye(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=ye(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.orientation,r=e.trackSize,i=e.padding,o=e.slidable,a=Mv(this.attributes,"track"),s=Mv(this.attributes,"thumb"),c=fe(fe({brushable:!1,orientation:n,padding:i,selectionRadius:this.thumbRadius,showHandle:!1,slidable:o,trackLength:this.trackLength,trackRadius:this.trackRadius,trackSize:r,values:this.getValues()},Ov(a,"track")),Ov(s,"selection"));this.slider=gv(t).maybeAppendByClassName("scrollbar",(function(){return new rb({style:c})})).update(c).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=ye(this.range,2),i=r[0],o=r[1];this.slider.setValues(this.getValues(_(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}(Av),ob={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 Pp({style:{path:[["M",10,10],["L",-10,0],["L",10,-10],["L",0,0],["L",10,10],["Z"]],anchor:"0.5 0.5",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:[]};V({},ob,{style:{type:"arc"}}),V({},ob,{style:{}});var ab=Iy({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"),sb=Iy({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function cb(t){return t.reduce((function(t,e,n){return t.push(ve([0===n?"M":"L"],ye(e),!1)),t}),[])}function lb(t,e,n){return"surround"===e.type?function(t,e,n){var r=e.connect,i=void 0===r?"line":r,o=e.center;if("line"===i)return cb(t);if(!o)return[];var a=ov(t[0],o),s=n?0:1;return t.reduce((function(t,e,n){return 0===n?t.push(ve(["M"],ye(e),!1)):t.push(ve(["A",a,a,0,0,s],ye(e),!1)),t}),[])}(t,e,n):cb(t)}function ub(t,e,n){var r=n.type,i=n.connect,o=n.center,a=n.closed?[["Z"]]:[],s=ye([lb(t,n),lb(e.slice().reverse(),n,!0)],2),c=s[0],l=s[1],u=ye([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([ve(["L"],ye(h),!1)],[ve(["L"],ye(f),!1)]);if(!o)throw new Error("Arc grid need to specified center");var p=ye([ov(h,o),ov(f,o)],2),g=p[0],m=p[1];return d([ve(["A",g,g,0,0,1],ye(h),!1),ve(["L"],ye(h),!1)],[ve(["A",m,m,0,0,0],ye(f),!1),ve(["L"],ye(f),!1)])}var fb=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ue(e,t),e.prototype.render=function(t,e){var n=he(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=ye(e,1)[0];return fe(fe({},t),{points:ve(ve([],ye(e),!1),[n],!1)})})):n}(t),i=gv(e).maybeAppendByClassName(sb.lineGroup,"g"),o=gv(e).maybeAppendByClassName(sb.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),path:lb(t.points,n)}}));return t.selectAll(sb.line.class).data(a,(function(t){return t.id})).join((function(t){return t.append("path").each((function(t,e){var n=jy(hv(fe({path:t.path},r)),[t,e,a]);this.attr(fe({class:sb.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:o},n))}))}),(function(t){return t.transition((function(t,e){return Uv(this,jy(hv(fe({path:t.path},r)),[t,e,a]),i.update)}))}),(function(t){return t.transition((function(){var t=this,e=Xv(this,i.exit);return Yv(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=ye([e[l].points,e[l+1].points],2),f=ub(u[0],u[1],n);c.push({path:f,fill:s(l)})}return t.selectAll(sb.region.class).data(c,(function(t,e){return e})).join((function(t){return t.append("path").each((function(t,e){var n=jy(t,[t,e,c]);this.attr(n)})).attr("className",sb.region.name)}),(function(t){return t.transition((function(t,e){return Uv(this,jy(t,[t,e,c]),r.update)}))}),(function(t){return t.transition((function(){var t=this,e=Xv(this,r.exit);return Yv(e,(function(){return t.remove()})),e}))})).transitions()}(o,r,t);return ve(ve([],ye(a),!1),ye(s),!1)},e}(Av);function hb(t,e){return Object.fromEntries(Object.entries(t).map((function(t){var n=ye(t,2);return[n[0],jy(n[1],e)]})))}function db(t,e){return e&&m(e)?t.filter(e):t}function pb(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n}function gb(t,e){if("linear"===e.type){var n=ye(e.startPos,2),r=n[0],i=n[1],o=ye(e.endPos,2),a=ye([o[0]-r,o[1]-i],2);return av([a[0],a[1]])}var s=Cy(pb(t,e));return[-Math.sin(s),Math.cos(s)]}function mb(t,e,n){return function(t,e){return e?[t[1],-t[0]]:[-t[1],t[0]]}(gb(t,n),"positive"!==e)}function yb(t,e){return mb(t,e.labelDirection,e)}function vb(t,e){return"linear"===e.type?function(t,e){var n=ye(e.startPos,2),r=n[0],i=n[1],o=ye(e.endPos,2),a=ye([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=ye(e.center,2),i=r[0],o=r[1],a=Cy(pb(t,e));return[i+n*Math.cos(a),o+n*Math.sin(a)]}(t,e)}function bb(t){return 0===gb(0,t)[1]}function xb(t){return 0===gb(0,t)[0]}function wb(t,e){return e-t==360}function Mb(t,e,n,r,i){var o=e-t,a=ye([i,i],2),s=a[0],c=a[1],l=ye([Cy(t),Cy(e)],2),u=l[0],f=l[1],h=function(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]},d=ye(h(u),2),p=d[0],g=d[1],m=ye(h(f),2),y=m[0],v=m[1];if(wb(t,e)){var b=ye(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,v]]}var x=o>180?1:0,w=t>e?0:1;return"M".concat(p,",").concat(g,",A").concat(s,",").concat(c,",0,").concat(x,",").concat(w,",").concat(y,",").concat(v)}function Ob(t,e,n,r){var i=e.startAngle,o=e.endAngle,a=e.center,s=e.radius;return t.selectAll(ab.line.class).data([{path:Mb.apply(void 0,ve(ve([i,o],ye(a),!1),[s],!1))}],(function(t,e){return e})).join((function(t){return t.append("path").attr("className",ab.line.name).styles(e).styles({path:function(t){return t.path}})}),(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=Ky(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,fe({fill:"both"},r))}(this,function(t){var e=t.attributes,n=e.startAngle,r=e.endAngle,i=e.center,o=e.radius;return ve(ve([n,r],ye(i),!1),[o],!1)}(this),ve(ve([i,o],ye(a),!1),[s],!1),r.update);if(e){var n=function(){var e=X(t.attributes,"__keyframe_data__");t.style.path=Mb.apply(void 0,ve([],ye(e),!1))};e.onframe=n,e.onfinish=n}return e})).styles(e)}),(function(t){return t.remove()})).styles(n).transitions()}function Eb(t){var e=ye(t,2),n=ye(e[0],2),r=n[0],i=n[1],o=ye(e[1],2);return{x1:r,y1:i,x2:o[0],y2:o[1]}}function kb(t,e,n,r){var i=e.showTrunc,o=e.startPos,a=e.endPos,s=e.truncRange,c=e.lineExtension,l=ye([o,a],2),u=ye(l[0],2),f=u[0],h=u[1],d=ye(l[1],2),p=d[0],g=d[1],m=ye(c?function(t,e,n){void 0===n&&(n=[0,0]);var r=ye([t,e,n],3),i=ye(r[0],2),o=i[0],a=i[1],s=ye(r[1],2),c=s[0],l=s[1],u=ye(r[2],2),f=u[0],h=u[1],d=ye([c-o,l-a],2),p=d[0],g=d[1],m=Math.sqrt(Math.pow(p,2)+Math.pow(g,2)),y=ye([-f/m,h/m],2),v=y[0],b=y[1];return[v*p,v*g,b*p,b*g]}(o,a,c):new Array(4).fill(0),4),y=m[0],v=m[1],b=m[2],x=m[3],w=function(e){return t.selectAll(ab.line.class).data(e,(function(t,e){return e})).join((function(t){return t.append("line").attr("className",(function(t){return"".concat(ab.line.name," ").concat(t.className)})).styles(n).transition((function(t){return Uv(this,Eb(t.line),!1)}))}),(function(t){return t.styles(n).transition((function(t){return Uv(this,Eb(t.line),r.update)}))}),(function(t){return t.remove()})).transitions()};if(!i||!s)return w([{line:[[f+y,h+v],[p+b,g+x]],className:ab.line.name}]);var M=ye(s,2),O=M[0],E=M[1],k=p-f,S=g-h,A=ye([f+k*O,h+S*O],2),_=A[0],T=A[1],P=ye([f+k*E,h+S*E],2),C=P[0],N=P[1];return w([{line:[[f+y,h+v],[_,T]],className:ab.lineFirst.name},{line:[[C,N],[p+b,g+x]],className:ab.lineSecond.name}])}function Sb(t,e,n){var r,i=e.type,o=Mv(e,"line");return r="linear"===i?kb(t,e,cv(o,"arrow"),n):Ob(t,e,cv(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(ab.line.class):a?t.select(ab.lineSecond.class):t.select(ab.line.class),!o||!s||"arc"===n.type&&wb(n.startAngle,n.endAngle)){var u=i.node();u&&(u.style.markerEnd=void 0)}else{var f=Vy(s);f.attr(r),dv(f,l,!0),i.style("markerEnd",f).style("markerEndOffset",-c)}}(t,i,e,o),r}function Ab(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function _b(t,e){var n=e.gridLength;return t.map((function(t,r){var i=t.value,o=ye(vb(i,e),2),a=o[0],s=o[1],c=ye(tv(function(t,e){return mb(t,e.gridDirection,e)}(i,e),n),2);return{id:r,points:[[a,s],[a+c[0],s+c[1]]]}}))}function Tb(t,e,n,r){var i=Mv(n,"grid"),o=i.type,a=i.areaFill,s=Ab(n),c=db(e,n.gridFilter),l="segment"===o?_b(c,n):function(t,e){var n=e.gridControlAngles,r=Ab(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=ye(r,2),o=i[0],a=i[1];return t.map((function(t,r){var i=ye(vb(t.value,e),2),s=i[0],c=i[1],l=ye([s-o,c-a],2),u=l[0],f=l[1],h=[];return n.forEach((function(t){var e=Cy(t),n=ye([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=fe(fe({},i),{center:s,areaFill:m(a)?c.map((function(t,e){return jy(a,[t,e,c])})):a,animate:r,data:l});return t.selectAll(ab.grid.class).data([1]).join((function(t){return t.append((function(){return new fb({style:u})})).attr("className",ab.grid.name)}),(function(t){return t.transition((function(){return this.update(u)}))}),(function(t){return t.remove()})).transitions()}var Pb=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 Cb(t,e){var n=t.getEulerAngles()||0;t.setEulerAngles(0);var r=t.getLocalBounds(),i=ye(r.min,2),o=i[0],a=i[1],s=ye(r.max,2),c=s[0],l=s[1],u=Nb(t),f=u.width,h=u.height,d=0,p=0,g=o,m=a,y=Wy(t);if(y){h-=1.5;var v=y.style.textAlign,b=y.style.textBaseline;"center"===v?g=(o+c)/2:"right"!==v&&"end"!==v||(g=c),"middle"===b?m=(a+l)/2:"bottom"===b&&(m=l)}var x=ye(mv(e),4),w=x[0],M=void 0===w?0:w,O=x[1],E=void 0===O?0:O,k=x[2],S=void 0===k?M:k,A=x[3],_=new Pb((d+=o)-(void 0===A?E:A),(p+=a)-M,d+f+E,p+h+S);return t.setEulerAngles(n),_.rotatedPoints(Cy(n),g,m)}function Nb(t){return t.__bbox__?t.__bbox__:t.getBBox()}function Lb(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 jb(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 Rb(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=jb((r=h)[0],r[1],i[0]),a=jb(r[0],r[1],i[1]),s=jb(i[0],i[1],r[0]),c=jb(i[0],i[1],r[1]),o!==a&&s!==c||0===o&&Lb(r,i[0])||0===a&&Lb(r,i[1])||0===s&&Lb(i,r[0])||0===c&&Lb(i,r[1])){if(0===jb(h[0],e,h[1]))return Lb(h,e);u++}f=(f+1)%n}while(0!==f);return!!(1&u)}(t,e)}))}function Ib(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=ye(t,4),r=n[0],i=n[1],o=n[2],a=n[3],s=ye(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,m=r-c,y=i-l,v=u*y-f*m;if(v<0===g)return!1;var b=h*y-d*m;return b<0!==g&&v>p!==g&&b>p!==g}(e,t)}))}function Bb(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=ye(o,2),c=s[0],l=s[1],u="negative"===r?0:i,f=-a-u,h=a+u,d=ye(mv(e),4),p=d[0],g=d[1],m=d[2],y=d[3];return new Pb(c+f-y,l+f-p,c+h+g,l+h+m)}var v=ye(t.startPos,2),b=v[0],x=v[1],w=ye(t.endPos,2),M=w[0],O=w[1],E=ye(xb(t)?[-e,0,e,0]:[0,e,0,-e],4),k=E[0],S=E[1],A=E[2],_=E[3],T=tv(yb(0,t),i),P=new Pb(b,x,M,O);return P.x1+=_,P.y1+=k,P.x2+=S+T[0],P.y2+=A+T[1],P}(e,o),l=function(t){return!c||function(t,e,n){var r=t.x1,i=t.x2,o=t.y1,a=t.y2;return Rb([[r,o],[i,o],[i,a],[r,a]],Cb(e,n))}(c,t)},u=function(t,e){return!t||!function(t,e,n){var r,i,o=Cb(t,n).flat(1),a=Cb(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=me(s),l=c.next();!l.done;l=c.next())if(Ib(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,e,mv(n))};try{for(var f=me(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 Db(t,e){return void 0===e&&(e={}),y(t)?0:"number"==typeof t?t:Math.floor(zy(t,e))}var Fb=function(t,e){var n=e.seq,r=void 0===n?2:n;return t.filter((function(t,e){return!(e%r)||(Sy(t),!1)}))};var zb=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=Fb,f=function(t){return t.forEach(r.show),t},h=2,d=t.slice(),p=t.slice(),g=Math.min.apply(Math,ve([1],ye(t.map((function(t){return Nb(t).width}))),!1));if("linear"===n.type&&(bb(n)||xb(n))){var m=yv(t[0]).left,y=yv(t[i-1]).right,v=Math.abs(y-m)||1;h=Math.max(Math.floor(i*g/v),h)}for(o&&(s=d.splice(0,1)[0]),a&&(c=d.splice(-1,1)[0],d.reverse()),f(d);h<t.length&&Bb((l=c?ve(ve([c],ye(p),!1),[s],!1):ve([s],ye(p),!1),l.filter(Fy)),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=me(s),p=d.next();!p.done;p=d.next()){if(h(p.value),Bb(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=Gy(r.getTextShape(t[0])),p=Db(u,d),g=a?Db(a,d):p,m=Db(c,d);(y(m)||m===1/0)&&(m=Math.max.apply(null,t.map((function(t){return Nb(t).width}))));var v=t.slice();ye(h,4);for(var b=function(e){if(v.forEach((function(t){r.ellipsis(r.getTextShape(t),e,o)})),(v=Bb(t,n,h)).length<1)return{value:void 0}},x=m;x>g+p;x-=p){var w=b(x);if("object"==typeof w)return w.value}}}],["wrap",function(t,e,n,r){var i=e.wordWrapWidth,o=void 0===i?50:i,a=e.maxLines,s=void 0===a?3:a,c=e.recoverWhenFailed,l=void 0===c||c,u=e.margin,f=void 0===u?[0,0,0,0]:u,h=t.map((function(t){return t.attr("maxLines")||1})),d=Math.min.apply(Math,ve([],ye(h),!1)),p=function(t){var e=t.type,n=t.labelDirection;return"linear"===e&&bb(t)?"negative"===n?"bottom":"top":"middle"}(n),g=function(e){return t.forEach((function(t,n){var i=Array.isArray(e)?e[n]:e;r.wrap(t,o,i,p)}))};if(!(d>s)){for(var m=d;m<=s;m++)if(g(m),Bb(t,n,f).length<1)return;l&&g(h)}}]]);function Gb(){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 Wb(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}function $b(t,e){var n=ye(t,2),r=n[0],i=n[1],o=ye(e,2),a=o[0],s=o[1],c=ye([r*a+i*s,r*s-i*a],2),l=c[0],u=c[1];return Math.atan2(u,l)}function Hb(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=yb(t.value,n),a=gb(t.value,n);return"horizontal"===i?0:function(t){var e=(t+360)%180;return Uy(e,-90,90)||(e+=180),e}(Ny("perpendicular"===i?$b([1,0],o):$b([a[0]<0?-1:1,0],a)))}function Yb(t,e,n){var r=n.type,i=n.labelAlign,o=yb(t,n),a=Wb(e),s=Wb(Ny($b([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?(Uy(a,0,90,!1,!0)||Uy(a,0,90)||Uy(a,270,360))&&(c="start"):90===s?Uy(a,0,90,!1,!0)?c="start":(Uy(a,90,180)||Uy(a,270,360))&&(c="end"):270===s?Uy(a,0,90,!1,!0)?c="end":(Uy(a,90,180)||Uy(a,270,360))&&(c="start"):180===s&&(90===a?c="start":(Uy(a,0,90)||Uy(a,270,360))&&(c="end")):c="center":"parallel"===i?l=Uy(s,0,180,!0)?"top":"bottom":"horizontal"===i?Uy(s,90,270,!1)?c="end":(Uy(s,270,360,!1)||Uy(s,0,90))&&(c="start"):"perpendicular"===i&&(c=Uy(s,90,270)?"end":"start"),{textAlign:c,textBaseline:l}}function Vb(t,e,n){var r=n.showTick,i=n.tickLength,o=n.tickDirection,a=n.labelDirection,s=n.labelSpacing,c=e.indexOf(t),l=jy(s,[t,c,e]),u=ye([yb(t.value,n),Gb(a,o)],2),f=ye(ev(tv(u[0],l+(1===u[1]?jy(r?i:0,[t,c,e]):0)),vb(t.value,n)),2);return{x:f[0],y:f[1]}}function qb(t,e){"text"===t.nodeName&&t.attr(e)}function Ub(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=zb.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:Sy,show:ky,rotate:function(e,n){!function(t,e,n){e.setLocalEulerAngles(t);var r=Yb(e.__data__.value,t,n),i=e.querySelector(ab.labelItem.class);i&&qb(i,r)}(+n,e,t)},ellipsis:function(t,e,n){t&&Hy(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"),$y(t,{wordWrap:!0,wordWrapWidth:e,maxLines:r,textBaseline:i}))},getTextShape:function(t){return t.querySelector("text")}})}function Xb(t,e,n,r,i){var o=n.indexOf(e),a=gv(t).append(function(t,e,n,r){var i=r.labelFormatter;return m(i)?function(){return Vy(jy(i,[t,e,n,yb(t.value,r)]))}:function(){return Vy(t.label||"")}}(e,o,n,i)).attr("className",ab.labelItem.name).node(),s=ye(Ev(hb(r,[e,o,n])),2),c=s[0],l=s[1],u=l.transform,f=he(l,["transform"]);kv(t,u);var h=Hb(e,t,i);return t.setLocalEulerAngles(+h),qb(a,fe(fe({},Yb(e.value,h,i)),c)),kv(t,u),t.attr(f),a}function Kb(t,e,n,r){var i=db(e,n.labelFilter),o=Mv(n,"label");return t.selectAll(ab.label.class).data(i,(function(t,e){return e})).join((function(r){return r.append("g").attr("className",ab.label.name).transition((function(t){return Xb(this,t,e,o,n),this.attr(Vb(t,e,n)),this.__bbox__=t.bbox,null})).call((function(){return Ub.call(t,n)}))}),(function(i){return i.transition((function(t){var i=function(t,e,n,r){if(void 0===r&&(r="destroy"),function(t,e){return"text"===t.nodeName&&"text"===e.nodeName&&t.attributes.text===e.attributes.text}(t,e))return t.remove(),[null];var i=function(){"destroy"===r?t.destroy():"hide"===r&&Sy(t),e.isVisible()&&ky(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=function(t){if("circle"===t.nodeName){var e=ye(t.getLocalPosition(),2),n=e[0],r=e[1],i=t.attr("r");return[n-i,r-i]}return t.getLocalPosition()},h=ye(f(t),2),d=h[0],p=h[1],g=ye(f(e),2),m=ye([(d+g[0])/2-d,(p+g[1])/2-p],2),y=m[0],v=m[1],b=t.style.opacity,x=void 0===b?1:b,w=e.style.opacity,M=void 0===w?1:w,O=t.animate([{opacity:x,transform:"translate(0, 0)"},{opacity:0,transform:"translate(".concat(y,", ").concat(v,")")}],fe(fe({fill:"both"},n),{duration:c+l+u})),E=e.animate([{opacity:0,transform:"translate(".concat(-y,", ").concat(-v,")"),offset:.01},{opacity:M,transform:"translate(0, 0)"}],fe(fe({fill:"both"},n),{duration:l+u,delay:c+l-u}));return Yv(E,i),[O,E]}(this.querySelector(ab.labelItem.class),Xb(this,t,e,o,n),r.update),a=Uv(this,Vb(t,e,n),r.update);return this.__bbox__=t.bbox,ve(ve([],ye(i),!1),[a],!1)})).call((function(e){var r,i,o=X(e,"_transitions").flat().filter(Fy);i=function(){return Ub.call(t,n)},0===(r=o).length?i():Promise.all(r.map((function(t){return null==t?void 0:t.finished}))).then(i)}))}),(function(t){return t.transition((function(){var t=this,e=Xv(this.childNodes[0],r.exit);return Yv(e,(function(){return gv(t).remove()})),e}))})).transitions()}function Zb(t,e){return mb(t,e.tickDirection,e)}function Qb(t,e,n,r,i){var o=ye(function(t,e){var n=ye(t,2);return[[0,0],[n[0]*e,n[1]*e]]}(r,jy(i.tickLength,[t,e,n])),2),a=ye(o[0],2),s=a[0],c=a[1],l=ye(o[1],2);return{x1:s,x2:l[0],y1:c,y2:l[1]}}function Jb(t,e,n,r,i,o){var a=function(t,e,n,r,i){var o=i.tickFormatter,a=Zb(e.value,i),s="line";return m(o)&&(s=function(){return jy(o,[e,n,r,a])}),t.append(s).attr("className",ab.tickItem.name)}(gv(this),t,e,n,r);!function(t,e,n,r,i,o,a){var s=Zb(t.value,o),c=Qb(t,e,n,s,o),l=c.x1,u=c.x2,f=c.y1,h=c.y2,d=ye(Ev(hb(a,[t,e,n,s])),2),p=d[0],g=d[1];"line"===r.node().nodeName&&r.styles(fe({x1:l,x2:u,y1:f,y2:h},p)),i.attr(g),r.styles(p)}(t,e,n,a,this,r,i);var s=ye(vb(t.value,r),2);return Uv(this,{x:s[0],y:s[1]},o)}var tx=Iy({text:"text"},"title");function ex(t){return/\S+-\S+/g.test(t)?t.split("-").map((function(t){return t[0]})):t.length>2?[t[0]]:t.split("")}function nx(t,e){var n=Object.entries(e).reduce((function(e,n){var r=ye(n,2),i=r[0],o=r[1];return t.node().attr(i)||(e[i]=o),e}),{});t.styles(n)}var rx=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 ue(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(tx.text.class);if(!a)return new Ly(0,0,+e,+n);var s=a.getBBox(),c=s.width,l=s.height,u=ye(mv(i),4),f=u[0],h=u[1],d=u[2],p=u[3],g=ye([0,0,+e,+n],4),m=g[0],y=g[1],v=g[2],b=g[3],x=ex(r);if(x.includes("i"))return new Ly(m,y,v,b);x.forEach((function(t,r){var i,o,a,s;"t"===t&&(i=ye(0===r?[l+d,+n-l-d]:[0,+n],2),y=i[0],b=i[1]),"r"===t&&(o=ye([+e-c-p],1),v=o[0]),"b"===t&&(a=ye([+n-l-f],1),b=a[0]),"l"===t&&(s=ye(0===r?[c+h,+e-c-h]:[0,+e],2),m=s[0],v=s[1])}));var w=ye(mv(o),4),M=w[0],O=w[1],E=w[2],k=w[3],S=ye([k+O,M+E],2),A=S[0],_=S[1];return new Ly(m+k,y+M,v-A,b-_)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new Ly(0,0,0,0)},e.prototype.render=function(t,e){var n=this,r=he(t,["width","height","position","spacing"]),i=ye(Ev(r),1)[0],o=function(t){var e,n,r,i,o=t,a=o.width,s=o.height,c=o.position,l=ye([+a/2,+s/2],2),u=ye([+l[0],+l[1],"center","middle"],4),f=u[0],h=u[1],d=u[2],p=u[3],g=ex(c);return g.includes("l")&&(f=(e=ye([0,"start"],2))[0],d=e[1]),g.includes("r")&&(f=(n=ye([+a,"end"],2))[0],d=n[1]),g.includes("t")&&(h=(r=ye([0,"top"],2))[0],p=r[1]),g.includes("b")&&(h=(i=ye([+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;qy(!!r.text,gv(e),(function(t){n.title=t.maybeAppendByClassName(tx.text,"text").styles(i).call(nx,{x:a,y:s,textAlign:c,textBaseline:l}).node()}))},e}(Av);function ix(t,e,n,r,i){var o=ye(Ev(Mv(r,"title")),2),a=o[0],s=o[1],c=s.transform,l=he(s,["transform"]);t.styles(a),e.styles(l);var u=c||function(t,e,n){var r=t.cloneNode(!0);r.style.transform="scale(1, 1)",r.style.transform="none";var i=r.getBBox().height;if("vertical"===e){if("left"===n)return"rotate(-90) translate(0, ".concat(i/2,")");if("right"===n)return"rotate(-90) translate(0, -".concat(i/2,")")}return""}(t.node(),a.direction,a.position);kv(t.node(),u);var f=function(t,e,n){var r=n.titlePosition,i=void 0===r?"lb":r,o=n.titleSpacing,a=ex(i),s=t.node().getLocalBounds(),c=ye(s.min,2),l=c[0],u=c[1],f=ye(s.halfExtents,2),h=f[0],d=f[1],p=ye(e.node().getLocalBounds().halfExtents,2),g=p[0],m=p[1],y=ye([l+h,u+d],2),v=y[0],b=y[1],x=ye(mv(o),4),w=x[0],M=x[1],O=x[2],E=x[3];if(["start","end"].includes(i)&&"linear"===n.type){var k=n.startPos,S=n.endPos,A=ye("start"===i?[k,S]:[S,k],2),_=A[0],T=A[1],P=ye(tv(av([-T[0]+_[0],-T[1]+_[1]]),w),2),C=P[0],N=P[1];return{x:_[0]+C,y:_[1]+N}}return a.includes("t")&&(b-=d+m+w),a.includes("r")&&(v+=h+g+M),a.includes("l")&&(v-=h+2*g+E),a.includes("b")&&(b+=d+2*m+O),{x:v,y:b}}(gv(n._offscreen||n.querySelector(ab.mainGroup.class)),e,r),h=f.x,d=f.y,p=Uv(e.node(),{x:h,y:d},i);return kv(t.node(),u),p}function ox(t,e,n,r){var i=t.showLine,o=t.showTick,a=t.showLabel,s=qy(i,e.maybeAppendByClassName(ab.lineGroup,"g"),(function(e){return Sb(e,t,r)}))||[],c=qy(o,e.maybeAppendByClassName(ab.tickGroup,"g"),(function(e){return function(t,e,n,r){var i=db(e,n.tickFilter),o=Mv(n,"tick");return t.selectAll(ab.tick.class).data(i,(function(t){return t.id||t.label})).join((function(t){return t.append("g").attr("className",ab.tick.name).transition((function(t,e){return Jb.call(this,t,e,i,n,o,!1)}))}),(function(t){return t.transition((function(t,e){return this.removeChildren(),Jb.call(this,t,e,i,n,o,r.update)}))}),(function(t){return t.transition((function(){var t=this,e=Xv(this.childNodes[0],r.exit);return Yv(e,(function(){return t.remove()})),e}))})).transitions()}(e,n,t,r)}))||[],l=qy(a,e.maybeAppendByClassName(ab.labelGroup,"g"),(function(e){return Kb(e,n,t,r)}))||[];return ve(ve(ve([],ye(s),!1),ye(c),!1),ye(l),!1).filter((function(t){return!!t}))}var ax=function(t){function e(e){return t.call(this,e,ob)||this}return ue(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=Hv(void 0===n?a:n),d=qy(c,gv(e).maybeAppendByClassName(ab.gridGroup,"g"),(function(e){return Tb(e,f,t,h)}))||[],p=gv(e).maybeAppendByClassName(ab.mainGroup,"g");i&&(!this.initialized&&h.enter||this.initialized&&h.update)&&ox(t,gv(this.offscreenGroup),f,Hv(!1));var g=ox(t,gv(p.node()),f,h),m=qy(s,gv(e).maybeAppendByClassName(ab.titleGroup,"g"),(function(e){return function(t,e,n,r){var i=n.titleText;return t.selectAll(ab.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 Vy(i)})).attr("className",ab.title.name).transition((function(){return ix(gv(this),t,e,n,r.enter)}))}),(function(i){return i.transition((function(){return ix(gv(this),t,e,n,r.update)}))}),(function(t){return t.remove()})).transitions()}(e,r,t,h)}))||[];return ve(ve(ve([],ye(d),!1),ye(g),!1),ye(m),!1).flat().filter((function(t){return!!t}))},e}(Av),sx=Iy({prevBtnGroup:"prev-btn-group",prevBtn:"prev-btn",nextBtnGroup:"next-btn-group",nextBtn:"next-btn",pageInfoGroup:"page-info-group",pageInfo:"page-info",playWindow:"play-window",contentGroup:"content-group",controller:"controller",clipPath:"clip-path"},"navigator"),cx=function(t){function e(e){var n=t.call(this,e,{animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonPath:Lv(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 Sp({class:sx.contentGroup.name})),n.playWindow=n.contentGroup.appendChild(new Sp({class:sx.playWindow.name})),n.innerCurrPage=n.defaultPage,n}return ue(e,t),Object.defineProperty(e.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return _(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=ye(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,ve([],ye(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 Ly(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=ye(this.getFollowingPageDiff(t),2),l=c[0],u=c[1];this.playState="running";var f=qv(a,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-l,", ").concat(-u,")")}],n);return Yv(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:_(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:_(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(sx.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)?ky(e):Sy(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=ye("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,m=p.height,y=Math.max(h,s,g),v="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,m+a]],textAlign:"center"},b=ye(v.offset,3),x=ye(b[0],2),w=x[0],M=x[1],O=ye(b[1],2),E=O[0],k=O[1],S=ye(b[2],2),A=S[0],_=S[1],T=v.textAlign,P=r.querySelector("text");P&&(P.style.textAlign=T),e.setLocalPosition(w,M),r.setLocalPosition(E,k),n.setLocalPosition(A,_)},e.prototype.updatePageInfo=function(){var t,e=this,n=e.currPage,r=e.pageViews,i=e.attributes.formatter;r.length<2||(null===(t=this.pageInfoGroup.querySelector(sx.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=ye(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(sx.controller,"g");if(Ay(s.node(),a),a){var c=Mv(this.attributes,"button"),l=Mv(this.attributes,"pageNum"),u=ye(Ev(c),2),f=u[0],h=u[1],d=f.size,p=he(f,["size"]),g=!s.select(sx.prevBtnGroup.class).node(),m=s.maybeAppendByClassName(sx.prevBtnGroup,"g").styles(h);this.prevBtnGroup=m.node();var y=m.maybeAppendByClassName(sx.prevBtn,"path"),v=s.maybeAppendByClassName(sx.nextBtnGroup,"g").styles(h);this.nextBtnGroup=v.node(),[y,v.maybeAppendByClassName(sx.nextBtn,"path")].forEach((function(t){t.styles(fe(fe({},p),{transformOrigin:"center"})),dv(t.node(),d,!0)}));var b=s.maybeAppendByClassName(sx.pageInfoGroup,"g");this.pageInfoGroup=b.node(),b.maybeAppendByClassName(sx.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=gv(e);this.renderClipPath(n),this.renderController(n),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},e.prototype.bindEvents=function(){var t=this,e=W((function(){return t.render(t.attributes,t)}),50);this.playWindow.addEventListener($d.INSERTED,e),this.playWindow.addEventListener($d.REMOVED,e)},e}(Av);function lx(t,e,n){return void 0===t&&(t="horizontal"),"horizontal"===t?e:n}Rv.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"]]})),Rv.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]]})),Rv.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 ux=Iy({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 fx=function(t){function e(e){return t.call(this,e,{span:[1,1],marker:function(){return new Op({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}return ue(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=ye(mv(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=ye(this.spacing,2),f=u[0],h=u[1];if(r){var d=r-n-f-h,p=ye(this.span,2);c=(t=ye([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=ye(mv(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=ye(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(ux.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=Mv(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(ux.markerGroup,"g").style("zIndex",0),qy(!!n,this.markerGroup,(function(){var t=e.markerGroup.node(),i=t.getElementsByClassName(ux.marker.name)[0],o=n();i?o.nodeName===i.nodeName?(!function(t,e){var n,r,i=e.attributes;try{for(var o=me(Object.entries(i)),a=o.next();!a.done;a=o.next()){var s=ye(a.value,2),c=s[0],l=s[1];"id"!==c&&"className"!==c&&t.attr(c,l)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}(i,o),gv(i).styles(r)):(i.remove(),gv(o).attr("className",ux.marker.name).styles(r),t.appendChild(o)):(gv(o).attr("className",ux.marker.name).styles(r),t.appendChild(o)),e.markerGroup.node().scale(1/e.markerGroup.node().getScale()[0]),dv(e.markerGroup.node(),e.scaleSize,!0)}))},e.prototype.renderLabel=function(t){var e=Mv(this.attributes,"label"),n=e.text,r=he(e,["text"]);this.labelGroup=t.maybeAppendByClassName(ux.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(ux.label,(function(){return Vy(n)})).styles(r)},e.prototype.renderValue=function(t){var e=this,n=Mv(this.attributes,"value"),r=n.text,i=he(n,["text"]);this.valueGroup=t.maybeAppendByClassName(ux.valueGroup,"g").style("zIndex",0),qy(this.showValue,this.valueGroup,(function(){e.valueGroup.maybeAppendByClassName(ux.value,(function(){return Vy(r)})).styles(i)}))},e.prototype.renderBackground=function(t){var e=this.shape,n=e.width,r=e.height,i=Mv(this.attributes,"background");this.background=t.maybeAppendByClassName(ux.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(ux.background,"rect").styles(fe({width:n,height:r},i))},e.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,i=ye(t.position,3),o=i[0],a=i[1],s=i[2],c=r/2;this.markerGroup.styles({x:o,y:c}),this.labelGroup.styles({x:a,y:c}),Hy(this.labelGroup.select(ux.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({x:s,y:c}),Hy(this.valueGroup.select(ux.value.class).node(),Math.ceil(n)))},e.prototype.render=function(t,e){var n=gv(e);this.renderMarker(n),this.renderLabel(n),this.renderValue(n),this.renderBackground(n),this.adjustLayout()},e}(Av),hx=Iy({page:"item-page",navigator:"navigator",item:"item"},"items"),dx=function(t,e,n){return void 0===n&&(n=!0),t?e(t):n},px=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:Q,mouseenter:Q,mouseleave:Q})||this;return n.navigatorShape=[0,0],n}return ue(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=Mv(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:fe({layout:n,labelText:s,valueText:c},Object.fromEntries(Object.entries(r).map((function(n){var r=ye(n,2);return[r[0],jy(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=ye(this.navigatorShape,1)[0],s=ye(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,m=t.ifHorizontal(l,c),y=[Math.floor(g/m),g%m];"vertical"===n&&y.reverse();var v=ye(y,2),b=v[0],x=v[1],w=(r-a-(l-1)*o)/l,M=e.getBBox().height,O=ye([0,0],2),E=O[0],k=O[1];return"horizontal"===n?(E=(h=ye([f,b*(M+i)],2))[0],k=h[1],f=x===l-1?0:f+w+o):(E=(d=ye([x*(w+o),f],2))[0],k=d[1],f=b===c-1?0:f+M+i),{page:p,index:s,row:b,col:x,pageIndex:g,width:w,height:M,x:E,y:k}}))},e.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,r=t.rowPadding,i=t.colPadding,o=ye(this.navigatorShape,1)[0],a=ye(this.grid,2),s=a[0],c=a[1],l=ye([e-o,n],2),u=l[0],f=l[1],h=ye([0,0,0,0,0,0,0,0],8),d=h[0],p=h[1],g=h[2],m=h[3],y=h[4],v=h[5],b=h[6],x=h[7];return this.pageViews.children.map((function(t,e){var n,o,a,l,h=t.getBBox(),w=h.width,M=h.height,O=0===b?0:i,E=b+O+w;return E<=u&&dx(y,(function(t){return t<c}))?(n=ye([b+O,x,E],3),d=n[0],p=n[1],b=n[2],{width:w,height:M,x:d,y:p,page:g,index:e,pageIndex:m++,row:v,col:y++}):(o=ye([v+1,0,0,x+M+r],4),v=o[0],y=o[1],b=o[2],(x=o[3])+M<=f&&dx(v,(function(t){return t<s}))?(a=ye([b,x,w],3),d=a[0],p=a[1],b=a[2],{width:w,height:M,x:d,y:p,page:g,index:e,pageIndex:m++,row:v,col:y++}):(l=ye([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],m=l[5],v=l[6],y=l[7],{width:w,height:M,x:d,y:p,page:g,index:e,pageIndex:m++,row:v,col:y++}))}))},Object.defineProperty(e.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var t="grid"===this.attributes.layout?this.getGridLayout:this.getFlexLayout,e=t.call(this);return e.slice(-1)[0].page>0?(this.navigatorShape=[55,0],t.call(this)):e},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return lx(this.attributes.orientation,t,e)},e.prototype.flattenPage=function(t){t.querySelectorAll(hx.item.class).forEach((function(e){t.appendChild(e)})),t.querySelectorAll(hx.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);gv(t).selectAll(hx.item.class).data(this.renderData,(function(t){return t.id})).join((function(t){return t.append((function(t){var e=t.style;return new fx({style:e})})).attr("className",hx.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=ye(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=ye(t,2);return{page:e[0],layouts:e[1]}})),i=ve([],ye(this.navigator.getContainer().children),!1);r.forEach((function(t){var e=t.layouts,r=n.pageViews.appendChild(new Sp({className:hx.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=A(e)?e.split("."):e;i.forEach((function(t,e){e<i.length-1?(w(r[t])||(r[t]=T(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=Mv(this.attributes,"nav"),r=Dy({orientation:e},n),i=this;return t.selectAll(hx.navigator.class).data(["nav"]).join((function(t){return t.append((function(){return new cx({style:r})})).attr("className",hx.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(gv(e));this.renderItems(r.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(t,e){var n=new Dd(t,{detail:e});this.dispatchEvent(n)},e}(Av),gx=Iy({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),mx={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},yx=function(t){function e(e){return t.call(this,e,mx)||this}return ue(e,t),e.prototype.render=function(t,e){var n=gv(e).maybeAppendByClassName(gx.markerGroup,"g");this.renderMarker(n);var r=gv(e).maybeAppendByClassName(gx.labelGroup,"g");this.renderLabel(r)},e.prototype.renderMarker=function(t){var e=this,n=this.attributes,r=n.orientation,i=n.markerSymbol,o=void 0===i?lx(r,"horizontalHandle","verticalHandle"):i;qy(!!o,t,(function(t){var n=Mv(e.attributes,"marker"),r=fe({symbol:o},n);e.marker=t.maybeAppendByClassName(gx.marker,(function(){return new Rv({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;qy(r,t,(function(t){var n,r=Mv(e.attributes,"label"),o=r.text,c=he(r,["text"]),l=(null===(n=t.select(gx.marker.class))||void 0===n?void 0:n.node().getBBox())||{},u=l.width,f=void 0===u?0:u,h=l.height,d=ye(lx(i,[0,(void 0===h?0:h)+a,"center","top"],[f+a,0,"start","middle"]),4),p=d[0],g=d[1],m=d[2],y=d[3];t.maybeAppendByClassName(gx.label,"text").styles(fe(fe({},c),{x:p,y:g,text:s(o).toString(),textAlign:m,textBaseline:y}))}))},e}(Av),vx={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},bx=Dy({},vx,{}),xx=Dy({},vx,Ov(mx,"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"}),wx=Iy({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"),Mx=function(t){function e(e){return t.call(this,e,bx)||this}return ue(e,t),e.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,o=r.titleText,a=ye(Ev(Mv(this.attributes,"title")),2),s=a[0],c=a[1];this.titleGroup=t.maybeAppendByClassName(wx.titleGroup,"g").styles(c);var l=fe(fe({width:e,height:n},s),{text:i?o:""});this.title=this.titleGroup.maybeAppendByClassName(wx.title,(function(){return new rx({style:l})})).update(l)},e.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,o=e.height,a=ye(Ev(Mv(this.attributes,"title",!0)),2),s=a[0],c=a[1],l=fe(fe({},s),{width:i,height:o,x:0,y:0});this.itemsGroup=t.maybeAppendByClassName(wx.itemsGroup,"g").styles(fe({x:n,y:r},c));var u=this;this.itemsGroup.selectAll(wx.items.class).data(["items"]).join((function(t){return t.append((function(){return new px({style:l})})).attr("className",wx.items.name).each((function(){u.items=gv(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().setLocalPosition(e,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 Ly(0,0,n,r)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e,n,r=null===(e=this.title)||void 0===e?void 0:e.node(),i=null===(n=this.items)||void 0===n?void 0:n.node();return r&&i?function(t,e){var n=t.attributes,r=n.position,i=n.spacing,o=n.inset,a=n.text,s=t.getBBox(),c=e.getBBox(),l=ex(r),u=ye(mv(a?i:0),4),f=u[0],h=u[1],d=u[2],p=u[3],g=ye(mv(o),4),m=g[0],y=g[1],v=g[2],b=g[3],x=ye([p+h,f+d],2),w=x[0],M=x[1],O=ye([b+y,m+v],2),E=O[0],k=O[1];if("l"===l[0])return new Ly(s.x,s.y,c.width+s.width+w+E,Math.max(c.height+k,s.height));if("t"===l[0])return new Ly(s.x,s.y,Math.max(c.width+E,s.width),c.height+s.height+M+k);var S=ye([e.attributes.width||c.width,e.attributes.height||c.height],2),A=S[0],_=S[1];return new Ly(c.x,c.y,A+s.width+w+E,_+s.height+M+k)}(r,i):t.prototype.getBBox.call(this)},e.prototype.render=function(t,e){var n=t.width,r=t.height,i=gv(e);this.renderTitle(i,n,r),this.renderItems(i,this.availableSpace),this.adjustLayout()},e}(Av),Ox={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},Ex=Iy({background:"background",labelGroup:"label-group",label:"label"},"indicator"),kx=function(t){function e(e){var n=t.call(this,e,Ox)||this;return n.point=[0,0],n.group=n.appendChild(new Sp({})),n.isMutationObserved=!0,n}return ue(e,t),e.prototype.renderBackground=function(){if(this.label){var t=this.attributes,e=t.position,n=ye(mv(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 Ly(c[0]-a,c[1]-r,l[0]+i-c[0]+a,l[1]+o-c[1]+r),f=this.getPath(e,u),h=Mv(this.attributes,"background");this.background=gv(this.group).maybeAppendByClassName(Ex.background,"path").styles(fe(fe({},h),{path:f})),this.group.appendChild(this.label.node())}},e.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,r=ye(Ev(Mv(this.attributes,"label")),2),i=r[0],o=r[1],a=he(i,["text"]);(this.label=gv(this.group).maybeAppendByClassName(Ex.labelGroup,"g").styles(o),n)&&this.label.maybeAppendByClassName(Ex.label,(function(){return Vy(e(n))})).style("text",e(n).toString()).selectAll("text").styles(a)},e.prototype.adjustLayout=function(){var t=ye(this.point,2),e=t[0],n=t[1];this.group.attr("x",-e).attr("y",-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,ve([c+1,1],ye(l),!1)),s[0][0]="M",s},e.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=vv.apply(void 0,ve([],ye(t),!1)),r=ye(t,2),i=ye(r[0],2),o=i[0],a=i[1],s=ye(r[1],2),c=s[0],l=s[1],u=ye(n?[c-o,[o,c]]:[l-a,[a,l]],2),f=u[0],h=ye(u[1],2),d=h[0],p=h[1],g=f/2,m=e*(f/Math.abs(f)),y=m/2,v=m*Math.sqrt(3)/2*.8,b=ye([d,d+g-y,d+g,d+g+y,p],5),x=b[0],w=b[1],M=b[2],O=b[3],E=b[4];return n?(this.point=[M,a-v],[["L",x,a],["L",w,a],["L",M,a-v],["L",O,a],["L",E,a]]):(this.point=[o+v,M],[["L",o,x],["L",o,w],["L",o+v,M],["L",o,O],["L",o,E]])},e.prototype.applyVisibility=function(){"hidden"===this.attributes.visibility?Sy(this):ky(this)},e.prototype.bindEvents=function(){this.label.on($d.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},e}(Av);function Sx(t,e){var n=ye(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 Ax=Iy({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function _x(t){var e=t.orientation,n=t.size,r=t.length;return lx(e,[r,n],[n,r])}function Tx(t){var e=t.type,n=ye(_x(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 Px(t){return Tx(t)}function Cx(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 Sf(t).toString()}));return a?1===a?s[0]:i?function(t,e,n){var r=Array.from(e),i=t.length;return new Array(i).fill(0).reduce((function(e,n,o){var a=r[o%r.length];return e+" ".concat(t[o],":").concat(a).concat(o<i-1?" ".concat(t[o+1],":").concat(a):"")}),"l(".concat("horizontal"===n?"0":"270",")"))}(o,s,n):s.reduce((function(t,e,n){return t+" ".concat(n/(a-1),":").concat(e)}),"l(".concat(lx(n,"0","270"),")")):""}function Nx(t){var e=t.orientation,n=t.range;if(!n)return[];var r=ye(_x(t),2),i=r[0],o=r[1],a=ye(n,2),s=a[0],c=a[1],l=lx(e,s*i,0),u=lx(e,0,s*o),f=lx(e,c*i,i),h=lx(e,o,c*o);return[["M",l,u],["L",l,h],["L",f,h],["L",f,u],["Z"]]}var Lx=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 ue(e,t),e.prototype.render=function(t,e){!function(t,e){var n=Mv(e,"track");t.maybeAppendByClassName(Ax.track,"path").styles(fe({path:Tx(e)},n))}(gv(e).maybeAppendByClassName(Ax.trackGroup,"g"),t),function(t,e){var n=Mv(e,"selection"),r=Cx(e),i=t.maybeAppendByClassName(Ax.selection,"path").styles(fe({path:Px(e),fill:r},n)),o=i.maybeAppendByClassName(Ax.clipPath,"path").styles({path:Nx(e)}).node();i.style("clip-path",o)}(gv(e).maybeAppendByClassName(Ax.selectionGroup,"g"),t)},e}(Av);var jx=function(t){function e(e){var n=t.call(this,e,xx)||this;return n.eventToOffsetScale=new ia({}),n.innerRibbonScale=new ia({}),n.cacheLabelBBox=null,n.cacheHandleBBox=null,n.onHovering=function(t){var e=n.attributes,r=e.data,i=e.block;t.stopPropagation();var o=n.getValueByCanvasPoint(t);if(i){var a=Sx(r.map((function(t){return t.value})),o).range;n.showIndicator((a[0]+a[1])/2,"".concat(a[0],"-").concat(a[1])),n.dispatchIndicated(o,a)}else{var s=n.getTickValue(o);n.showIndicator(s),n.dispatchIndicated(s)}},n.onDragStart=function(t){return function(e){e.stopPropagation(),n.attributes.slidable&&(n.target=t,n.prevValue=n.getTickValue(n.getValueByCanvasPoint(e)),document.addEventListener("mousemove",n.onDragging),document.addEventListener("touchmove",n.onDragging),document.addEventListener("mouseleave",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("touchend",n.onDragEnd))}},n.onDragging=function(t){var e=n.target;n.updateMouse();var r=ye(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 ue(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 Ly(0,0,e,n)},e.prototype.render=function(t,e){var n=this,r=t.showLabel;this.renderTitle(gv(e));var i=this.availableSpace,o=i.x,a=i.y,s=gv(e).maybeAppendByClassName(wx.contentGroup,"g").styles({x:o,y:a});qy(!!r,s.maybeAppendByClassName(wx.labelGroup,"g").styles({zIndex:1}),(function(t){n.renderLabel(t)}));var c=s.maybeAppendByClassName(wx.ribbonGroup,"g").styles({zIndex:0});this.handlesGroup=s.maybeAppendByClassName(wx.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,ve([],ye(t.map((function(t){return t.value}))),!1)),max:Math.max.apply(Math,ve([],ye(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=ye(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=ye(void 0===r?[e,n]:r,2);return[i[0],i[1]]},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return lx(this.attributes.orientation,"function"==typeof t?t():t,"function"==typeof e?e():e)},e.prototype.renderTitle=function(t){var e=this.attributes,n=e.showTitle,r=e.titleText,i=e.width,o=e.height,a=Mv(this.attributes,"title"),s=fe(fe({},a),{width:i,height:o,text:r}),c=this;t.selectAll(wx.title.class).data(n?[r]:[]).join((function(t){return t.append((function(){return new rx({style:s})})).attr("className",wx.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 Ly(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 Ly(0,0,0,0);if(this.cacheLabelBBox)return this.cacheLabelBBox;var e=(null===(t=this.label.querySelector(ab.labelGroup.class))||void 0===t?void 0:t.children.slice(-1)[0]).getBBox(),n=e.width,r=e.height;return this.cacheLabelBBox=new Ly(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=ye(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,m=0,y=this.labelPosition;m=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 v=Math.max(p,c),b=f-v,x=ye(this.ifHorizontal([b,m],[m,b]),2),w=x[0],M=x[1],O=["top","left"].includes(y)?s:0,E=ye(this.ifHorizontal([v/2,O],[O,v/2]),2),k=E[0],S=E[1];return new Ly(k,S,w,M)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonShape",{get:function(){var t=this.ribbonBBox,e=t.width,n=t.height;return this.ifHorizontal({size:n,length:e},{size:e,length:n})},enumerable:!1,configurable:!0}),e.prototype.renderRibbon=function(t){var e=this.attributes,n=e.data,r=e.type,i=e.orientation,o=e.color,a=e.block,s=Mv(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,m=p.size,y=Dy({x:h,y:d,length:g,size:m,type:r,orientation:i,color:o,block:a,partition:n.map((function(t){return(t.value-l)/(u-l)})),range:this.ribbonRange},s);this.ribbon=t.maybeAppendByClassName(wx.ribbon,(function(){return new Lx({style:y})})).update(y)},e.prototype.getHandleClassName=function(t){return"".concat(wx.prefix("".concat(t,"-handle")))},e.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,n=t.orientation,r=Mv(this.attributes,"handle"),i=ye(this.selection,2),o=i[0],a=i[1],s=fe(fe({},r),{orientation:n}),c=r.shape,l="basic"===(void 0===c?"slider":c)?yx:nb,u=this;this.handlesGroup.selectAll(wx.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(wx.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=ye(this.selection,2),e=t[0],n=t[1];this.setHandlePosition("start",e),this.setHandlePosition("end",n)},e.prototype.adjustTitle=function(){var t=this.attributes,e=t.titlePosition,n=t.orientation,r=ye(this.getElementsByClassName(wx.title.name),1)[0],i=this.handlesGroup.select(".".concat(this.getHandleClassName("start"))).node();if(r&&i&&"top-left"===e&&"horizontal"===n){var o=ye(i.getLocalBounds().min,1)[0]-ye(r.getLocalBounds().min,1)[0];r.style.x=+(this.style.x||0)+o}},Object.defineProperty(e.prototype,"handleBBox",{get:function(){if(this.cacheHandleBBox)return this.cacheHandleBBox;if(!this.attributes.showHandle)return new Ly(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=ye([Math.max(e,i),Math.max(n,o)],2),s=a[0],c=a[1];return this.cacheHandleBBox=new Ly(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=ye(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=ye(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({x:l,y:u,formatter:n})},e.prototype.renderIndicator=function(t){var e=Mv(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(wx.indicator,(function(){return new kx({})})).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(fe(fe({},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=ye([n.value,c.value],2),u=l[0],f=l[1],h=(u+f)/2;e.push(fe(fe({},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=ye(["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=Mv(this.attributes,"tick"),s=Mv(this.attributes,"label"),c=s.align,l=Dy(fe({showLine:!1,showGrid:!1,showTick:r,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),Ov(a,"tick"),Ov(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=fe(fe(fe({},l),u),{labelOverlap:[{type:"hide"}]});this.label=t.maybeAppendByClassName(wx.label,(function(){return new ax({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=ye([0,0,0],3),l=c[0],u=c[2],f=null!=i?i:o;return e?(u=f,"positive"===n?"right"===a?(l=f,u=f):"bottom"===a&&(l=u):"negative"===n&&("top"===a||"left"===a)&&(l=o)):"positive"===n&&("right"===a||"bottom"===a&&(l=o+s)),{offset:l,spacing:r,tickLength:u}},enumerable:!1,configurable:!0}),e.prototype.adjustLabel=function(){if(this.attributes.showLabel){var t=this.ribbonBBox,e=t.x,n=t.y,r=t.width,i=t.height,o=this.labelAxisStyle,a=o.offset,s=o.spacing,c=o.tickLength,l=ye(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=_(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}),ky(this.indicator.node())}else this.hideIndicator()},e.prototype.hideIndicator=function(){Sy(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=ye(this.selection,2),o=i[0],a=i[1],s=ye([t,e],2),c=s[0],l=s[1];n&&(c+=o,l+=a);var u=this.range;r=ye(function(t,e,n,r){var i,o=ye(t,2),a=o[0],s=o[1],c=ye(e,2),l=c[0],u=c[1],f=ye(n,2),h=f[0],d=f[1],p=ye([l,u],2),g=p[0],m=p[1],y=m-g;return g>m&&(g=(i=ye([m,g],2))[0],m=i[1]),y>s-a?[a,s]:g<a?h===a&&d===m?[a,m]:[a,y+a]:m>s?d===s&&h===g?[g,s]:[s-y,s]:[g,m]}([u.min,u.max],[c,l],this.selection),2),c=r[0],l=r[1],this.update({defaultValue:[c,l]}),this.dispatchSelection()},Object.defineProperty(e.prototype,"step",{get:function(){var t=this.attributes.step,e=void 0===t?1:t,n=this.range,r=n.min,i=n.max;return F(e)?sv(.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?Sx(n.map((function(t){return t.value})),t).tick:function(t,e,n){return n+Math.round((t-n)/e)*e}(t,this.step,i)},e.prototype.getValueByCanvasPoint=function(t,e){var n=this.range,r=n.min,i=n.max,o=ye(this.ribbon.node().getPosition(),2),a=o[0],s=o[1],c=this.ifHorizontal(a,s),l=this.ifHorizontal.apply(this,ve([],ye(Yy(t)),!1))-c;return _(this.getOffset(l,!0),r,i)},e.prototype.getOffset=function(t,e){void 0===e&&(e=!1);var n=this.range,r=n.min,i=n.max,o=this.ribbonShape.length,a=this.eventToOffsetScale;return a.update({domain:[r,i],range:[0,o]}),e?a.invert(t):a.map(t)},e.prototype.dispatchSelection=function(){var t=new Dd("valuechange",{detail:{value:this.selection}});this.dispatchEvent(t)},e.prototype.dispatchIndicated=function(t,e){var n=new Dd("indicate",{detail:{value:t,range:e}});this.dispatchEvent(n)},e}(Av);function Rx(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 Ix={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function Bx(t){var e;void 0===t&&(t="");var n=Rx(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)]=fe({flex:1},Ix),e[".".concat(n.VALUE)]=fe({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},Ix),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 Dx=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=Rx(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:Bx(o)})||this).timestamp=-1,i.prevCustomContentKey=i.attributes.contentKey,i.initShape(),i.render(i.attributes,i),i}return ue(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=he(t,["name","color","index"]),l=fe({name:i,color:a,index:null!=s?s:e},c);return nn(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=nn(t.container),this.id&&this.element.setAttribute("id",this.id)},e.prototype.renderCustomContent=function(){if(void 0===this.prevCustomContentKey||this.prevCustomContentKey!==this.attributes.contentKey){this.prevCustomContentKey=this.attributes.contentKey;var t=this.attributes.content;t&&("string"==typeof t?this.element.innerHTML=t:this.element.replaceChildren(t))}},e.prototype.renderHTMLTooltipElement=function(){var t,e,n=this.attributes,r=n.template,i=n.title,o=n.enterable,a=n.style,s=n.content,c=Rx(r.prefixCls),l=this.element;if(this.element.style.pointerEvents=o?"auto":"none",s)this.renderCustomContent();else{i?(l.innerHTML=r.title,l.getElementsByClassName(c.TITLE)[0].innerHTML=i):null===(e=null===(t=l.getElementsByClassName(c.TITLE))||void 0===t?void 0:t[0])||void 0===e||e.remove();var u=this.HTMLTooltipItemsElements,f=document.createElement("ul");f.className=c.LIST,f.replaceChildren.apply(f,ve([],ye(u),!1));var h=this.element.querySelector(".".concat(c.LIST));h?h.replaceWith(f):l.appendChild(f)}!function(t,e){Object.entries(e).forEach((function(e){var n=ye(e,2),r=n[0],i=n[1];ve([t],ye(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=ye(l,2),n=e[0],i=e[1],a=ye(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=ye(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=ye(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=ye([+o+n,+a+r],2),d=h[0],p=h[1],g={left:"right",right:"left",top:"bottom",bottom:"top"},m=s.x,y=s.y,v={left:d<m,right:d+u>m+s.width,top:p<y,bottom:p+f>y+s.height},b=[];c.split("-").forEach((function(t){v[t]?b.push(g[t]):b.push(t)}));var x=b.join("-");return this.getRelativeOffsetFromCursor(x)},e.prototype.isCursorEntered=function(t,e){if(this.element){var n=this.element.getBoundingClientRect(),r=n.x,i=n.y,o=n.width,a=n.height;return new Ly(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}(Av),Fx=function(t){function e(e){var n=t.call(this,e)||this;n.layoutEvents=[$d.BOUNDS_CHANGED,$d.INSERTED,$d.REMOVED],n.$margin=mv(0),n.$padding=mv(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 ue(e,t),Object.defineProperty(e.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=mv(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=mv(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=ye(this.$margin,4),c=s[0],l=s[1],u=s[2],f=s[3];return new Ly(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=ye(this.$padding,4),i=r[0],o=r[1],a=r[2],s=r[3],c=ye(this.$margin,4),l=c[0],u=c[3];return new Ly(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=function(t,e,n){if(0===e.length)return[];var r={flex:Qy,grid:Jy},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(e,n){var r=t[n],i=r.x,o=r.y;e.attr({x:i,y:o})}))}catch(t){}},e.prototype.bindEvents=function(){var t=this;this.layoutEvents.forEach((function(e){t.addEventListener(e,(function(e){e.target.isMutationObserved=!0,t.layout()}))}))},e.prototype.attributeChangedCallback=function(t,e,n){"margin"===t?this.margin=n:"padding"===t&&(this.padding=n),this.layout()},e}(Sp);function zx(t,e,n,r){const[[i,o],[a,s]]=e,[c,l]=function(t){const{min:[e,n],max:[r,i]}=t.getLocalBounds();let o=0,a=0;return e>0&&(o=e),r<0&&(o=r),n>0&&(a=n),i<0&&(a=i),[o,a]}(t);if(i===a&&o===s)return cc()([[0,0],[c,l]]);const u=[[i-a,o-s]].concat(n.length?n:[[0,0]]),f=[r[0]-a,r[1]-s],[h,d]=u;if(((t,e,n)=>{const r=ps(t,e),i=ps(e,n),o=ps(n,t);return(Math.pow(r,2)+Math.pow(i,2)-Math.pow(o,2))/(2*r*i)})(f,h,d)>0){const e=(()=>{const{min:e,max:n}=t.getLocalBounds(),r=h[0]+(h[1]-f[1])*(h[1]-0)/(h[0]-f[0]);return n[0]<f[0]?Math.min(n[0],r):Math.max(e[0],r)})();u.splice(1,1,[e,0])}return cc()(u)}const Gx=bm((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:m,coordCenter:y,innerHTML:v}=e,b=he(e,["className","class","transform","rotate","labelTransform","labelTransformOrigin","x","y","x0","y0","text","background","connector","startMarker","endMarker","coordCenter","innerHTML"]);if([c,l,u,f].some((t=>!T(t))))return void t.children.forEach((t=>t.remove()));const x=ur(b,"background"),{padding:w}=x,M=he(x,["padding"]),O=ur(b,"connector"),{points:E=[]}=O,k=he(O,["points"]),S=[[+u,+f],[+c,+l]];let A;A=v?tm(t).maybeAppend("html","html",n).style("zIndex",0).style("innerHTML",v).call(im,Object.assign({transform:a,transformOrigin:s},b)).node():tm(t).maybeAppend("text","text").style("zIndex",0).style("text",h).call(im,Object.assign({textBaseline:"middle",transform:a,transformOrigin:s},b)).node();const _=tm(t).maybeAppend("background","rect").style("zIndex",-1).call(im,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}}(A,w)).call(im,d?M:{}).node(),P=zx(_,S,E,y),C=g&&new Rv({id:"startMarker",style:Object.assign({x:0,y:0},ur(b,"startMarker"))}),N=m&&new Rv({id:"endMarker",style:Object.assign({x:0,y:0},ur(b,"endMarker"))});tm(t).maybeAppend("connector","path").style("zIndex",0).style("path",P).style("markerStart",C).style("markerEnd",N).call(im,p?k:{})})),Wx=(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 tm(new Gx).style("x",f).style("y",h).call(im,i).style("transform",`${l}rotate(${+c})`).style("coordCenter",n.getCenter()).call(im,u).call(im,t).node()}};Wx.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const $x=bm((t=>{const e=he(t.attributes,["class","x","y"]),n=ur(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=tm(t).maybeAppend("marker",(()=>new Rv({}))).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);tm(t).maybeAppend("text","text").style("x",a).style("y",s).call(im,e)})),Hx=(t,e)=>{const n=he(t,[]);return(t,e,r)=>{const{color:i}=r,o=he(r,["color"]),{color:a=i,text:s=""}=e,c={text:String(s),stroke:a,fill:a},[[l,u]]=t;return tm(new $x).call(im,o).style("x",l).style("y",u).call(im,c).call(im,n).node()}};Hx.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Yx=bm((t=>{const{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes,o=t.ownerDocument;tm(t).maybeAppend("connect-path",(()=>o.createElement("path",{}))).style("d",n).call(im,i),tm(t).maybeAppend("area-path",(()=>o.createElement("path",{}))).style("d",e).call(im,r)})),Vx=(t,e)=>{const{curve:n,gradient:r=!1,defined:i=(t=>!Number.isNaN(t)&&null!=t),connect:o=!1}=t,a=he(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=Bc(s),m=um(s,e),y=r&&h?am(h,d,p,r,void 0,g):f,v=Object.assign(Object.assign(Object.assign(Object.assign({},l),{stroke:y,fill:y}),m&&{transform:m}),a),[b,x]=function(t,e){const n=[],r=[],i=[];let o=!1,a=null;const s=t.length/2;for(let c=0;c<s;c++){const l=t[c],u=t[c+s];if([...l,...u].some((t=>!e(t))))o=!0;else{if(n.push(l),r.push(u),o&&a){o=!1;const[t,e]=a;i.push([t,l,e,u])}a=[l,u]}}return[n.concat(r),i]}(t,i),w=ur(v,"connect"),M=!!x.length,O=t=>tm(c.createElement("path",{})).style("d",t||"").call(im,v).node();if(Dc(s)){const e=t=>{const e=s.getCenter(),r=t.slice(0,t.length/2),o=t.slice(t.length/2);return function(){var t=lc().curve(uc),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return dc(n())},delete t.lineX0,t.lineEndAngle=function(){return dc(r())},delete t.lineX1,t.lineInnerRadius=function(){return dc(i())},delete t.lineY0,t.lineOuterRadius=function(){return dc(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(hc(t)):e()._curve},t}().angle(((t,n)=>ms(hs(r[n],e)))).outerRadius(((t,n)=>ps(r[n],e))).innerRadius(((t,n)=>ps(o[n],e))).defined(((t,e)=>[...r[e],...o[e]].every(i))).curve(n)(o)};return!M||o&&!Object.keys(w).length?O(e(b)):M&&!o?O(e(t)):tm(new Yx).style("areaStyle",v).style("connectStyle",Object.assign(Object.assign({},w),a)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}{const e=t=>{const e=t.slice(0,t.length/2),r=t.slice(t.length/2);return g?lc().y(((t,n)=>e[n][1])).x1(((t,n)=>e[n][0])).x0(((t,e)=>r[e][0])).defined(((t,n)=>[...e[n],...r[n]].every(i))).curve(n)(e):lc().x(((t,n)=>e[n][0])).y1(((t,n)=>e[n][1])).y0(((t,e)=>r[e][1])).defined(((t,n)=>[...e[n],...r[n]].every(i))).curve(n)(e)};return!M||o&&!Object.keys(w).length?O(e(b)):M&&!o?O(e(t)):tm(new Yx).style("areaStyle",v).style("connectStyle",Object.assign(Object.assign({},w),a)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}}};Vx.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const qx=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=Dc(n)?Oc:oc;return Vx(Object.assign({curve:i},t),e)(...r)}};qx.props=Object.assign(Object.assign({},Vx.props),{defaultMarker:"square"});const Ux=(t,e)=>{const n=he(t,[]),{coordinate:r}=e;return(...t)=>{const i=Dc(r)?wc:Bc(r)?Nc:Cc;return Vx(Object.assign({curve:i},n),e)(...t)}};Ux.props=Object.assign(Object.assign({},Vx.props),{defaultMarker:"smooth"});const Xx=(t,e)=>(...n)=>Vx(Object.assign({curve:jc},t),e)(...n);Xx.props=Object.assign(Object.assign({},Vx.props),{defaultMarker:"hvh"});const Kx=(t,e)=>(...n)=>Vx(Object.assign({curve:Rc},t),e)(...n);Kx.props=Object.assign(Object.assign({},Vx.props),{defaultMarker:"vh"});const Zx=(t,e)=>(...n)=>Vx(Object.assign({curve:Ic},t),e)(...n);Zx.props=Object.assign(Object.assign({},Vx.props),{defaultMarker:"hv"});const Qx=(t,e)=>{const{arrow:n=!1}=t;return(...r)=>Oy(Object.assign(Object.assign({},t),{arrow:n}),e)(...r)};Qx.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Jx=(t,e)=>{const n=he(t,[]),{document:r}=e;return(t,e,i)=>{const{color:o}=i,a=he(i,["color"]),{color:s=o,transform:c}=e,[l,u]=t,f=Us();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]),tm(r.createElement("path",{})).call(im,a).style("d",f.toString()).style("stroke",s).style("transform",c).call(im,n).node()}};function tw(t,e,n,r){const i=Us();if(Dc(n)){const o=n.getCenter(),a=ps(t,o),s=(ps(e,o)-a)*r+a;return i.moveTo(t[0],t[1]),om(i,t,e,o,s),i.lineTo(e[0],e[1]),i}return Bc(n)?(i.moveTo(t[0],t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,e[1]),i.lineTo(e[0],e[1]),i):(i.moveTo(t[0],t[1]),i.lineTo(t[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],e[1]),i)}Jx.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const ew=(t,e)=>{const{cornerRatio:n=1/3}=t,r=he(t,["cornerRatio"]),{coordinate:i,document:o}=e;return(t,e,a)=>{const{defaultColor:s}=a,c=he(a,["defaultColor"]),{color:l=s,transform:u}=e,[f,h]=t,d=tw(f,h,i,n);return tm(o.createElement("path",{})).call(im,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(im,r).node()}};ew.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const nw=(t,e)=>{const n=he(t,[]),{coordinate:r,document:i}=e;return(t,e,o)=>{const{color:a}=o,s=he(o,["color"]),{color:c=a,transform:l}=e,[u,f]=t,h=Us();if(h.moveTo(u[0],u[1]),Dc(r)){const t=r.getCenter();h.quadraticCurveTo(t[0],t[1],f[0],f[1])}else{om(h,u,f,bs(u,f),ps(u,f)/2)}return tm(i.createElement("path",{})).call(im,s).style("d",h.toString()).style("stroke",c).style("transform",l).call(im,n).node()}};function rw(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 iw(t={}){return[...rw(t),{name:"title",scale:"identity"}]}function ow(){return[{type:Br,channel:"color"},{type:Kr,channel:["x","y"]}]}function aw(){return[{type:Br,channel:"x"},{type:Kr,channel:["y"]}]}function sw(t={}){return rw(t)}function cw(){return[{type:Wr}]}function lw(t,e){return t.getBandWidth(t.invert(e))}function uw(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?lw(a,r[e]):0,l=d?lw(s,i[e]):0,g=p&&o?(lw(c,o[e])/2+ +o[e])*n:0,[m,y]=t;return[m+u*n+g,y+f*l]}:t=>t}function fw(t){return parseFloat(t)/100}function hw(t,e,n,r){const{x:i,y:o}=n,{innerWidth:a,innerHeight:s}=r.getOptions();return[t,Array.from(t,(t=>{const e=i[t],n=o[t];return[["string"==typeof e?fw(e)*a:+e,"string"==typeof n?fw(n)*s:+n]]}))]}nw.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const dw=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a}=o,s=he(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,[m,y]=n.getSize();h="string"==typeof h?fw(h)*m:h,d="string"==typeof d?fw(d)*y:d;const v=p-Number(h)/2,b=g-Number(d)/2;return tm(r.createElement("image",{})).call(im,s).style("x",v).style("y",b).style("img",l).style("stroke",c).style("transform",f).call(im,t).style("width",h).style("height",d).node()}};function pw(t,e){const n=Us();if(Dc(e)){const r=e.getCenter(),i=[...t,t[0]],o=i.map((t=>ps(t,r)));return i.forEach(((e,i)=>{if(0===i)return void n.moveTo(e[0],e[1]);const a=o[i],s=t[i-1],c=o[i-1];void 0!==c&&Math.abs(a-c)<1e-10?om(n,s,e,r,a):n.lineTo(e[0],e[1])})),n.closePath(),n}return function(t,e){return e.forEach(((e,n)=>0===n?t.moveTo(e[0],e[1]):t.lineTo(e[0],e[1]))),t.closePath(),t}(n,t)}dw.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const gw=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a}=o,s=he(o,["color"]),{color:c=a,transform:l}=i,u=pw(e,n);return tm(r.createElement("path",{})).call(im,s).style("d",u.toString()).style("stroke",c).style("fill",c).style("transform",l).call(im,t).node()}};function mw(t,e){const[n,r,i,o]=t,a=Us();if(Dc(e)){const t=e.getCenter(),s=ps(t,n);return a.moveTo(n[0],n[1]),a.quadraticCurveTo(t[0],t[1],i[0],i[1]),om(a,i,o,t,s),a.quadraticCurveTo(t[0],t[1],r[0],r[1]),om(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}gw.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const yw=(t,e)=>{const n=he(t,[]),{coordinate:r,document:i}=e;return(t,e,o)=>{const{color:a}=o,s=he(o,["color"]),{color:c=a,transform:l}=e,u=mw(t,r);return tm(i.createElement("path",{})).call(im,s).style("d",u.toString()).style("fill",c||a).style("stroke",c||a).style("transform",l).call(im,n).node()}};function vw(t,e){const n=Us();if(Dc(e)){const r=e.getCenter(),[i,o]=r,a=gs(hs(t[0],r)),s=gs(hs(t[1],r)),c=ps(r,t[2]),l=ps(r,t[3]),u=ps(r,t[8]),f=ps(r,t[10]),h=ps(r,t[11]);n.moveTo(...t[0]),n.arc(i,o,c,a,s),n.arc(i,o,c,s,a,!0),n.moveTo(...t[2]),n.lineTo(...t[3]),n.moveTo(...t[4]),n.arc(i,o,l,a,s),n.lineTo(...t[6]),n.arc(i,o,f,s,a,!0),n.closePath(),n.moveTo(...t[8]),n.arc(i,o,u,a,s),n.arc(i,o,u,s,a,!0),n.moveTo(...t[10]),n.lineTo(...t[11]),n.moveTo(...t[12]),n.arc(i,o,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}yw.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const bw=(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=he(o,["color","fill","stroke"]),h=vw(e,n);return tm(r.createElement("path",{})).call(im,f).style("d",h.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(im,t).node()}};function xw(t,e,n=4){const r=Us();if(!Dc(e))return r.moveTo(...t[2]),r.lineTo(...t[3]),r.lineTo(t[3][0]-n,t[3][1]),r.lineTo(t[10][0]-n,t[10][1]),r.lineTo(t[10][0]+n,t[10][1]),r.lineTo(t[3][0]+n,t[3][1]),r.lineTo(...t[3]),r.closePath(),r.moveTo(...t[10]),r.lineTo(...t[11]),r.moveTo(t[3][0]+n/2,t[8][1]),r.arc(t[3][0],t[8][1],n/2,0,2*Math.PI),r.closePath(),r;const i=e.getCenter(),[o,a]=i,s=ps(i,t[3]),c=ps(i,t[8]),l=ps(i,t[10]),u=gs(hs(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}bw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const ww=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a,transform:s}=i,{color:c,fill:l=c,stroke:u=c}=o,f=he(o,["color","fill","stroke"]),h=xw(e,n,4);return tm(r.createElement("path",{})).call(im,f).style("d",h.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(im,t).node()}};ww.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Mw=(t,e)=>{const{arrow:n,arrowSize:r=4}=t,i=he(t,["arrow","arrowSize"]),{coordinate:o,document:a}=e;return(t,e,s)=>{const{color:c,lineWidth:l}=s,u=he(s,["color","lineWidth"]),{color:f=c,size:h=l}=e,d=n?function(t,e,n){return t.createElement("path",{style:Object.assign({path:`M ${e},${e} L -${e},0 L ${e},-${e} L 0,0 Z`,anchor:"0.5 0.5",transformOrigin:"center"},n)})}(a,r,Object.assign({fill:i.stroke||f,stroke:i.stroke||f},ur(i,"arrow"))):null,p=function(t,e){if(!Dc(e))return cc().x((t=>t[0])).y((t=>t[1]))(t);const n=e.getCenter();return nc()({startAngle:0,endAngle:2*Math.PI,outerRadius:ps(t[0],n),innerRadius:ps(t[1],n)})}(t,o),g=function(t,e){if(!Dc(t))return e;const[n,r]=t.getCenter();return`translate(${n}, ${r}) ${e||""}`}(o,e.transform);return tm(a.createElement("path",{})).call(im,u).style("d",p).style("stroke",f).style("lineWidth",h).style("transform",g).style("markerEnd",d).call(im,i).node()}};function Ow(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}Mw.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Ew=(t,e)=>{const{offset:n=0,offset1:r=n,offset2:i=n,connectLength1:o,endMarker:a=!0}=t,s=he(t,["offset","offset1","offset2","connectLength1","endMarker"]),{coordinate:c}=e;return(t,e,n)=>{const{color:l,connectLength1:u}=n,f=he(n,["color","connectLength1"]),{color:h,transform:d}=e,p=function(t,e,n,r,i=0){const[[o,a],[s,c]]=e;if(Bc(t)){const t=o+n,e=t+i;return[[t,a],[e,a],[e,c],[s+r,c]]}const l=a-n,u=l-i;return[[o,l],[o,u],[s,u],[s,c-r]]}(c,t,r,i,null!=o?o:u),g=ur(Object.assign(Object.assign({},s),n),"endMarker");return tm(new Pp).call(im,f).style("path",function(t){return cc().x((t=>t[0])).y((t=>t[1]))(t)}(p)).style("stroke",h||l).style("transform",d).style("markerEnd",a?new Rv({className:"marker",style:Object.assign(Object.assign({},g),{symbol:Ow})}):null).call(im,s).node()}};function kw(t){return t.replace(/-(\w)/g,(function(t,e){return e.toUpperCase()}))}function Sw(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=dr(n.x,l),s=dr(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,textAnchor:"start",textBaseline:"middle"}:"right"===t?{x:l,y:u/2,textAnchor:"end",textBaseline:"middle"}:"top"===t?{x:l/2,y:0,textAnchor:"center",textBaseline:"top"}:"bottom"===t?{x:l/2,y:u,textAnchor:"center",textBaseline:"bottom"}:"top-left"===t?{x:0,y:0,textAnchor:"start",textBaseline:"top"}:"top-right"===t?{x:l,y:0,textAnchor:"end",textBaseline:"top"}:"bottom-left"===t?{x:0,y:u,textAnchor:"start",textBaseline:"bottom"}:"bottom-right"===t?{x:l,y:u,textAnchor:"end",textBaseline:"bottom"}:{x:l/2,y:u/2,textAnchor:"center",textBaseline:"middle"})}function Aw(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s}=n,c=r.getCenter(),l=cm(r,e,[i,o]),{innerRadius:u,outerRadius:f,startAngle:h,endAngle:d}=l,p="inside"===t?(h+d)/2:d,g=Tw(p,a,s),m=(()=>{const[n,r]=e,i=u+.5*(f-u),[o,a]="inside"===t?_w(c,p,i):bs(n,r);return{x:o,y:a}})();return Object.assign(Object.assign({},m),{textAlign:"inside"===t?"center":"start",textBaseline:"middle",rotate:g})}function _w(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function Tw(t,e,n){if(!e)return 0;const r=n?0:Math.sin(t)<0?90:-90;return t/Math.PI*180+r}function Pw(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s,radius:c=.5,offset:l=0}=n,u=cm(r,e,[i,o]),{startAngle:f,endAngle:h}=u,d=r.getCenter(),p=(f+h)/2,g={textAlign:"center",textBaseline:"middle",rotate:Tw(p,a,s)},{innerRadius:m,outerRadius:y}=u,v=m+(y-m)*c+l,[b,x]=_w(d,p,v);return Object.assign({x:b,y:x},g)}function Cw(t){return void 0===t?null:t}function Nw(t,e,n,r){const{bounds:i}=n,[o]=i;return{x:Cw(o[0]),y:Cw(o[1])}}function Lw(t,e,n,r){const{bounds:i}=n;if(1===i.length)return Nw(0,0,n);return(Fc(r)?Aw:$c(r)?Pw:Sw)(t,e,n,r)}function jw(t,e,n){const r=cm(n,t,[e.y,e.y1]),{innerRadius:i,outerRadius:o}=r;return i+(o-i)}function Rw(t,e,n){const r=cm(n,t,[e.y,e.y1]),{startAngle:i,endAngle:o}=r;return(i+o)/2}function Iw(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=Rw(e,n,r),d=Math.sin(h)>0?1:-1,p=Tw(h,i,o),g={textAlign:d>0||Fc(r)?"start":"end",textBaseline:"middle",rotate:p},m=jw(e,n,r),y=m+(s?c:a),[[v,b],[x,w],[M,O]]=function(t,e,n,r,i){const[o,a]=_w(t,e,n),[s,c]=_w(t,e,r);return[[o,a],[s,c],[s+(Math.sin(e)>0?1:-1)*i,c]]}(f,h,m,y,s?l:0),E=s?+u*d:0,k=M+E,S={connector:s,connectorPoints:[[x-k,w-O],[M-k,O-O]]};return Object.assign(Object.assign({x0:v,y0:b,x:M+E,y:O},g),S)}Ew.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var Bw=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=Un(o,((t,e)=>Math.abs(t[1]-a[e][1])));s=Math.max(Math.min(s,i-2),1);const c=t=>[o[t][0],(o[t][1]+a[t][1])/2],l=c(s),u=c(s-1),f=gs(hs(c(s+1),u))/Math.PI*180;return{x:l[0],y:l[1],transform:`rotate(${f})`,textAlign:"center",textBaseline:"middle"}},bottom:Lw,bottomLeft:Lw,bottomRight:Lw,inside:Lw,left:Lw,outside:function(t,e,n,r){const{bounds:i}=n;return 1===i.length?Nw(0,0,n):(Fc(r)?Aw:$c(r)?Iw:Sw)(t,e,n,r)},right:Lw,spider:function(t,e,n,r){if(!$c(r))return{};const{connectorLength:i,connectorLength2:o,connectorDistance:a}=n,s=he(Iw(0,e,n,r),[]),c=r.getCenter(),l=jw(e,n,r),u=Rw(e,n,r),f=l+i+o,h=Math.sin(u)>0?1:-1,d=c[0]+(f+ +a)*h,{x:p}=s,g=d-p;return s.x+=g,s.connectorPoints[0][0]-=g,s},surround:function(t,e,n,r){if(!$c(r))return{};const{connectorLength:i,connectorLength2:o,connectorDistance:a}=n,s=he(Iw(0,e,n,r),[]),{x0:c,y0:l}=s,u=r.getCenter(),f=function(t){if($c(t)){const[e,n]=t.getSize(),r=t.getOptions().transformations.find((t=>"polar"===t[0]));if(r)return Math.max(e,n)/2*r[4]}return 0}(r),h=f+i,d=ms([c-u[0],l-u[1]]),p=Math.sin(d)>0?1:-1,[g,m]=_w(u,d,h);return s.x=g+(o+a)*p,s.y=m,s},top:Lw,topLeft:Lw,topRight:Lw});function Dw(t,e,n,r,i){const{position:o}=e,{render:a}=i,s=function(t,e){return void 0!==t?t:$c(e)?"inside":Bc(e)?"right":"top"}(o,n),c=r[a?"htmlLabel":"inside"===s?"innerLabel":"label"],l=Object.assign({},c,e),u=Bw[kw(s)];if(!u)throw new Error(`Unknown position: ${s}`);return Object.assign(Object.assign({},c),u(s,t,l,n,i))}const Fw=(t,e)=>{const{coordinate:n,theme:r}=e,{render:i}=t;return(e,o)=>{const{text:a,x:s,y:c,transform:l="",transformOrigin:u,className:f=""}=o,h=he(o,["text","x","y","transform","transformOrigin","className"]),d=Dw(e,o,n,r,t),{rotate:p=0,transform:g=""}=d,m=he(d,["rotate","transform"]);return tm(new Gx).call(im,m).style("text",`${a}`).style("className",`${f} g2-label`).style("innerHTML",i?i(a,o.datum,o.index):void 0).style("labelTransform",`${g} rotate(${+p}) ${l}`.trim()).style("labelTransformOrigin",u).style("coordCenter",n.getCenter()).call(im,h).node()}};Fw.props={defaultMarker:"point"};const zw=(t,e)=>{const{arrow:n,colorAttribute:r}=t,i=he(t,["arrow","colorAttribute"]),{coordinate:o,document:a}=e;return(t,e,n)=>{const{color:s,stroke:c}=n,l=he(n,["color","stroke"]),{d:u,color:f=s}=e,[h,d]=o.getSize();return tm(a.createElement("path",{})).call(im,l).style("d","function"==typeof u?u({width:h,height:d}):u).style(r,f).call(im,i).node()}};zw.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Gw=(t,e)=>zw(Object.assign({colorAttribute:"fill"},t),e);Gw.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Ww=(t,e)=>zw(Object.assign({fill:"none",colorAttribute:"stroke"},t),e);Ww.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const $w=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{transform:o}=r,{color:a}=i,s=he(i,["color"]),{color:c=a}=r,[l,...u]=e,f=Us();return f.moveTo(...l),u.forEach((([t,e])=>{f.lineTo(t,e)})),f.closePath(),tm(n.createElement("path",{})).call(im,s).style("d",f.toString()).style("stroke",c||a).style("fill",c||a).style("fillOpacity",.4).style("transform",o).call(im,t).node()}};function Hw(t,e,n){const r=t?t():document.createElement("canvas");return r.width=e,r.height=n,r}$w.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},$(3);const Yw=function(t,e=((...t)=>`${t[0]}`),n=16){const r=$(n);return(...n)=>{const i=e(...n);let o=r.get(i);return r.has(i)?r.get(i):(o=t(...n),r.set(i,o),o)}}(((t,e,n)=>{const r=Hw(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 Vw(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=Hw(a,t,e).getContext("2d"),l=function(t,e){const n=Hw(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=Yw(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=Hw(a,t,e).getContext("2d");return f.putImageData(u,0,0),f}const qw=(t,e)=>{const{gradient:n,opacity:r,maxOpacity:i,minOpacity:o,blur:a,useGradientOpacity:s}=t,c=he(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(),m=t.map((t=>({x:t[0],y:t[1],value:t[2],radius:t[3]}))),y=Xn(t,(t=>t[2])),v=qn(t,(t=>t[2])),b=p&&g?Vw(p,g,y,v,m,(x={gradient:n,opacity:r,minOpacity:o,maxOpacity:i,blur:a,useGradientOpacity:s},w=t=>void 0===t,Object.keys(x).reduce(((t,e)=>{const n=x[e];return w(n,e)||(t[e]=n),t}),{})),u):{canvas:null};var x,w;return tm(f.createElement("image",{})).call(im,h).style("x",0).style("y",0).style("width",p).style("height",g).style("src",b.canvas).style("transform",d).call(im,c).node()}};qw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Uw=(t,e)=>{const{render:n}=t,r=he(t,["render"]);return t=>{const[[i,o]]=t;return n(Object.assign(Object.assign({},r),{x:i,y:o}),e)}};function Xw(t,e){return t.getBandWidth(t.invert(e))}Uw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Kw={rect:dm,hollow:pm,funnel:mm,pyramid:vm},Zw=()=>(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=Xw(l,i[t]),n=e*(u?Xw(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],m=+a[t];return[[h,g],[p,g],[p,m],[h,m]].map((t=>r.map(t)))}));return[t,p]};Zw.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:Kw,channels:[...iw({shapes:Object.keys(Kw)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...cw(),{type:hn},{type:Dr}],postInference:[...aw()],interaction:{shareTooltip:!0}};const Qw={rect:dm,hollow:pm},Jw=()=>(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]};Jw.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:Qw,channels:[...iw({shapes:Object.keys(Qw)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...cw(),{type:hn}],postInference:[...aw()],interaction:{shareTooltip:!0}};const tM={line:Mm,smooth:Om,hv:Em,vh:km,hvh:Sm,trail:_m},eM=(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(Pn(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]},nM=(t,e,n,r)=>{const i=Object.entries(n).filter((([t])=>t.startsWith("position"))).map((([,t])=>t));if(0===i.length)throw new Error("Missing encode for position channel.");return[t,Array.from(t,(t=>{const e=i.map((e=>+e[t])),n=r.map(e),o=[];for(let t=0;t<n.length;t+=2)o.push([n[t],n[t+1]]);return o}))]},rM=()=>(t,e,n,r)=>(Gc(r)?nM:eM)(t,e,n,r);rM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:tM,channels:[...iw({shapes:Object.keys(tM)}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...cw(),{type:ei},{type:$r}],postInference:[...aw(),{type:Br,channel:"color"},{type:Kr,channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const iM={hollow:sy,hollowDiamond:oy,hollowHexagon:ay,hollowSquare:cy,hollowTriangleDown:uy,hollowTriangle:ly,hollowBowtie:iy,point:vy,plus:yy,diamond:dy,square:by,triangle:wy,hexagon:py,cross:hy,bowtie:fy,hyphen:gy,line:my,tick:xy,triangleDown:My},oM=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=uw(n,r,t),g=t=>{const e=+((null==u?void 0:u[t])||0),n=+((null==f?void 0:f[t])||0);return[(s?(+o[t]+ +s[t])/2:+o[t])+e,(c?(+a[t]+ +c[t])/2:+a[t])+n]};return[e,l?Array.from(e,(t=>{const[e,n]=g(t),r=+l[t],o=r/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))]))]};oM.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,shape:iM,channels:[...iw({shapes:Object.keys(iM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size",quantitative:"sqrt"},{name:"dx",scale:"identity"},{name:"dy",scale:"identity"}],preInference:[...cw(),{type:Dr},{type:Fr}],postInference:[{type:Gr},...ow()]};const aM={text:Wx,badge:Hx},sM=t=>{const{cartesian:e=!1}=t;return e?hw:(e,n,r,i)=>{const{x:o,y:a}=r,s=uw(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};sM.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,shape:aM,channels:[...iw({shapes:Object.keys(aM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize"},{name:"rotate"}],preInference:[...cw(),{type:ti},{type:Qr}],postInference:[...ow()]};const cM={cell:dm,hollow:pm},lM=()=>(t,e,n,r)=>{const{x:i,y:o}=n,a=e.x,s=e.y,c=Array.from(t,(t=>{const e=a.getBandWidth(a.invert(+i[t])),n=s.getBandWidth(s.invert(+o[t])),c=+i[t],l=+o[t];return[[c,l],[c+e,l],[c+e,l+n],[c,l+n]].map((t=>r.map(t)))}));return[t,c]};lM.props={defaultShape:"cell",defaultLabelShape:"label",shape:cM,composite:!1,channels:[...iw({shapes:Object.keys(cM)}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...cw(),{type:Dr},{type:Fr},{type:Zr}],postInference:[...ow()]};const uM={area:qx,smooth:Ux,hvh:Xx,vh:Kx,hv:Zx},fM=()=>(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(Pn(t,(t=>l[t])).values()):[t],d=h.map((t=>t[0])).filter((t=>void 0!==t)),p=((null===(i=null==u?void 0:u.getBandWidth)||void 0===i?void 0:i.call(u))||0)/2,g=((null===(o=null==f?void 0:f.getBandWidth)||void 0===o?void 0:o.call(f))||0)/2;return[d,Array.from(h,(t=>{const e=t.length,n=new Array(2*e);for(let i=0;i<t.length;i++){const o=t[i];n[i]=r.map([+a[o]+p,+s[o]+g]),n[e+i]=r.map([+a[o]+p,+c[o]+g])}return n})),h]};fM.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,shape:uM,channels:[...iw({shapes:Object.keys(uM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...cw(),{type:$r},{type:hn},{type:Zr}],postInference:[...aw()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const hM={link:Qx,arc:nw,smooth:Jx,vhv:ew},dM=t=>(e,n,r,i)=>{const{x:o,y:a,x1:s=o,y1:c=a}=r,l=uw(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]};dM.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,shape:hM,channels:[...iw({shapes:Object.keys(hM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...cw(),{type:Vr},{type:qr}],postInference:[...ow()]};const pM={image:dw},gM=t=>{const{cartesian:e}=t;return e?hw:(e,n,r,i)=>{const{x:o,y:a}=r,s=uw(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};gM.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,shape:pM,channels:[...iw({shapes:Object.keys(pM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...cw(),{type:ti},{type:Qr}],postInference:[...ow()]};const mM={polygon:gw,ribbon:yw},yM=()=>(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]};yM.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,shape:mM,channels:[...iw({shapes:Object.keys(mM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...cw()],postInference:[...ow()]};const vM={box:bw,violin:ww},bM=()=>(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,m,y,v,b]=[+o[t],+a[t],+s[t],+c[t],+l[t]];return[[p-n/2,b],[p+n/2,b],[p,b],[p,v],[p-n/2,v],[p+n/2,v],[p+n/2,m],[p-n/2,m],[p-n/2,y],[p+n/2,y],[p,m],[p,g],[p-n/2,g],[p+n/2,g]].map((t=>r.map(t)))}));return[t,d]};bM.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,shape:vM,channels:[...iw({shapes:Object.keys(vM)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...cw(),{type:Dr}],postInference:[...aw()],interaction:{shareTooltip:!0}};const xM={vector:Oy},wM=()=>(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]};wM.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,shape:xM,channels:[...iw({shapes:Object.keys(xM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...cw()],postInference:[...ow()]};const MM={line:Mw},OM=t=>(e,n,r,i)=>{const{y:o}=r,a=uw(n,r,V({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]};OM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:MM,channels:[...sw({shapes:Object.keys(MM)}),{name:"y",required:!0}],preInference:[...cw(),{type:Hr}],postInference:[]};const EM={line:Mw},kM=t=>(e,n,r,i)=>{const{x:o}=r,a=uw(n,r,V({style:{bandOffset:0}},t)),s=Array.from(e,(t=>[[o[t],1],[o[t],0]].map((e=>i.map(a(e,t))))));return[e,s]};kM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:EM,channels:[...sw({shapes:Object.keys(EM)}),{name:"x",required:!0}],preInference:[...cw(),{type:Yr}],postInference:[]};const SM={connector:Ew},AM=(...t)=>dM(...t);function _M(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 TM(t={}){const{extendX:e=!1,extendY:n=!1}=t;return(t,r,i,o)=>{const a=_M("x",e,i,r.x),s=_M("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]}}AM.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,shape:SM,channels:[...sw({shapes:Object.keys(SM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...cw()],postInference:[]};const PM={range:dm},CM=()=>TM();CM.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:PM,channels:[...sw({shapes:Object.keys(PM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...cw()],postInference:[]};const NM={range:dm},LM=()=>TM({extendY:!0});LM.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:NM,channels:[...sw({shapes:Object.keys(NM)}),{name:"x",required:!0}],preInference:[...cw(),{type:Ur}],postInference:[]};const jM={range:dm},RM=()=>TM({extendX:!0});RM.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:jM,channels:[...sw({shapes:Object.keys(jM)}),{name:"y",required:!0}],preInference:[...cw(),{type:Xr}],postInference:[]};const IM={path:Gw,hollow:Ww},BM=t=>(t,e,n,r)=>[t,t.map((()=>[[0,0]]))];BM.props={defaultShape:"path",defaultLabelShape:"label",shape:IM,composite:!1,channels:[...iw({shapes:Object.keys(IM)}),{name:"d",scale:"identity"}],preInference:[...cw()],postInference:[]};const DM=t=>{const{cartesian:e}=t;return e?hw:(e,n,r,i)=>{const{x:o,y:a}=r,s=uw(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};DM.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,shape:{shape:Uw},channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...cw(),{type:ti},{type:Qr},{type:Jr}]};var FM={},zM={};function GM(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function WM(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 $M(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function HM(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":function(t){return t<0?"-"+$M(-t,6):t>9999?"+"+$M(t,6):$M(t,4)}(t.getUTCFullYear())+"-"+$M(t.getUTCMonth()+1,2)+"-"+$M(t.getUTCDate(),2)+(i?"T"+$M(e,2)+":"+$M(n,2)+":"+$M(r,2)+"."+$M(i,3)+"Z":r?"T"+$M(e,2)+":"+$M(n,2)+":"+$M(r,2)+"Z":n||e?"T"+$M(e,2)+":"+$M(n,2)+"Z":"")}function YM(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 zM;if(l)return l=!1,FM;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())!==zM;){for(var f=[];r!==FM&&r!==zM;)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?HM(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=GM(t);return function(r,i){return e(n(r),i,t)}}(t,e):GM(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=WM(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=WM(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}function VM(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;qM&&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 qM=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),UM=t=>{const{value:e,format:n=e.split(".").pop(),delimiter:r=",",autoType:i=!0}=t;return()=>pe(void 0,void 0,void 0,(function*(){const t=yield fetch(e);if("csv"===n){const e=yield t.text();return YM(r).parse(e,i?VM:rr)}if("json"===n)return yield t.json();throw new Error(`Unknown format: ${n}.`)}))};UM.props={};const XM=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 KM(t){return null!=t&&!Number.isNaN(t)}XM.props={};const ZM=t=>{const{callback:e=KM}=t;return t=>t.filter(e)};ZM.props={};const QM=t=>{const{callback:e}=t;return t=>Array.isArray(t)?[...t].sort(e):t};QM.props={};const JM=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)))};JM.props={};const tO=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)),{})))};tO.props={};const eO=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)))};eO.props={};const nO=t=>{const{value:e}=t;return()=>e};nO.props={};const rO=t=>{const{callback:e=rr}=t;return t=>e(t)};rO.props={};const iO=t=>{const{callback:e=rr}=t;return t=>Array.isArray(t)?t.map(e):t};function oO(t){return"string"==typeof t?e=>e[t]:t}iO.props={};const aO=t=>{const{join:e,on:n,select:r=[],as:i=r,unknown:o=NaN}=t,[a,s]=n,c=oO(s),l=oO(a),u=Nn(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)),{}))}))};aO.props={};const sO=t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)};sO.props={};var cO={exports:{}},lO={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}}(lO),function(t){var e=Math.log(2),n=t.exports,r=lO.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],m=0;t.forEach((function(t){var e=function(t){return Math.floor((t-c)/u)}(t);if(!(e+a<0||e-a>=f.length)){var n=Math.max(e-a,0),i=e,o=Math.min(e+a,f.length-1),s=n-(e-a),l=e+a-o,h=d[-a-1+s]||0,y=d[-a-1+l]||0,v=p/(p-h-y);s>0&&(m+=v*(s-1)*g);var b=Math.max(0,e-a+1);r.inside(0,f.length-1,b)&&(f[b].y+=1*v*g),r.inside(0,f.length-1,i+1)&&(f[i+1].y-=2*v*g),r.inside(0,f.length-1,o+1)&&(f[o+1].y+=1*v*g)}}));var y=m,v=0,b=0;return f.forEach((function(t){v+=t.y,y+=v,t.y=y,b+=y})),b>0&&f.forEach((function(t){t.y/=b})),f},t.exports.getExpectedValueFromPdf=function(t){if(t&&0!==t.length){var e=0;return t.forEach((function(t){e+=t.x*t.y})),e}},t.exports.getXWithLeftTailArea=function(t,e){if(t&&0!==t.length){for(var n=0,r=0,i=0;i<t.length&&(r=i,!((n+=t[i].y)>=e));i++);return t[r].x}},t.exports.getPerplexity=function(t){if(t&&0!==t.length){var n=0;return t.forEach((function(t){var e=Math.log(t.y);isFinite(e)&&(n+=t.y*e)})),n=-n/e,Math.pow(2,n)}}}(cO);var uO=cO.exports;const fO=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(Pn(t,(t=>n.map((e=>t[e])).join("-"))).values());return r.map((t=>{const n=uO.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})}))}};fO.props={};const hO=()=>t=>(console.log("G2 data section:",t),t);hO.props={};const dO={density:$w},pO=()=>(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]};pO.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,shape:dO,channels:[...iw({shapes:Object.keys(dO)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"size",required:!0},{name:"series",scale:"band"},{name:"size",required:!0,scale:"identity"}],preInference:[...cw(),{type:hn},{type:Dr}],postInference:[...aw()],interaction:{shareTooltip:!0}};const gO={heatmap:qw},mO=t=>(t,e,n,r)=>{const{x:i,y:o,size:a,color:s}=n;return[[0],[Array.from(t,(t=>{const e=a?+a[t]:40;return[...r.map([+i[t],+o[t]]),s[t],e]}))]]};mO.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,shape:gO,channels:[...iw({shapes:Object.keys(gO)}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...cw(),{type:Dr},{type:Fr}],postInference:[...ow()]};const yO=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"];yO.props={};const vO=()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"];vO.props={};const bO=t=>new zo(t);bO.props={};const xO=t=>new ia(t);xO.props={};const wO=t=>new Bo(t);wO.props={};const MO=t=>new Jo(t);MO.props={};const OO=t=>new oa(t);OO.props={};const EO=t=>new _a(t);EO.props={};const kO=t=>new fa(t);kO.props={};const SO=t=>new sa(t);SO.props={};const AO=t=>new la(t);AO.props={};const _O=t=>new pa(t);_O.props={};const TO=t=>new ha(t);TO.props={};const PO=t=>new ca(t);PO.props={};const CO=t=>new Ca(t);CO.props={};const NO=t=>new Wo(t);function LO({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:m="auto",margin:y=16}){return{padding:m,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,strokeWidth: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,strokeWidth: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"},axisLeft:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"left",titleSpacing:12,titleTextBaseline:"middle",titleDirection:"vertical",titleTransformOrigin:"center"},axisRight:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"right",titleSpacing:12,titleTextBaseline:"top",titleDirection:"vertical",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleSpacing:0},axisArc:{title:!1,titlePosition:"inner",line:!1,tick:!0,labelSpacing:4},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:e,itemLabelFillOpacity:c,itemLabelFontSize:12,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[o,o],itemValueFill:e,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"normal",navButtonFill:e,navButtonFillOpacity:.65,navPageNumFill:e,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!1,titleFill:e,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:e,tickStrokeOpacity:.25,rowPadding:o,colPadding:a,maxRows:3,maxCols:3},legendContinuous:{handleHeight:12,handleLabelFill:e,handleLabelFillOpacity:u,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:e,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:e,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:e,labelFillOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing:3,tick:!0,tickLength:12,ribbonSize:12,ribbonFill:"#aaa",handle:!0,handleLabel:!1,handleShape:"slider",handleIconSize:12/1.8,indicator:!1,titleFontSize:12,titleSpacing:4,titleFontWeight:"normal",titleFillOpacity:c,tickStroke:e,tickStrokeOpacity:u},label:{fill:e,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:e,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:n,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},htmlLabel:{fontSize:12,opacity:.65,color:e,fontWeight:"normal"},slider:{trackSize:16,trackFill:r,trackFillOpacity:1,selectionFill:t,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:e,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:e,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{padding:[0,0,0,0],trackSize:6,isRound:!0,slidable:!0,scrollable:!0,trackFill:"#e5e5e5",trackFillOpacity:0,thumbFill:"#000",thumbFillOpacity:.15,thumbHighlightedFillOpacity:.2},title:{spacing:8,titleFill:e,titleFillOpacity:c,titleFontSize:16,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:e,subtitleFillOpacity:l,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}}}NO.props={};const jO=LO({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}),RO=t=>V({},jO,t);RO.props={};const IO=t=>V({},RO(),{category10:"category10",category20:"category20"},t);IO.props={};const BO=LO({colorBlack:"#fff",colorWhite:"#000",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"#141414",category10:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F"],category20:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F","#AABA01","#BC7CFC","#237CBC","#2DE379","#CE8032","#FF7AF4","#545FD3","#AFE410","#D8C608","#FFA1E0"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.25}),DO=t=>V({},BO,{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),FO=t=>Object.assign({},DO(),{category10:"category10",category20:"category20"},t);FO.props={};const zO=LO({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}),GO=t=>V({},zO,{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 WO(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)]}GO.props={};var $O,HO=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function YO(t){if(!(e=HO.exec(t)))throw new Error("invalid format: "+t);var e;return new VO({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 VO(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 qO(t,e){var n=WO(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")}YO.prototype=VO.prototype,VO.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 UO={"%":(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)=>qO(100*t,e),r:qO,s:function(t,e){var n=WO(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-($O=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")+WO(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function XO(t){return t}var KO,ZO,QO=Array.prototype.map,JO=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function tE(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?XO:(e=QO.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?XO:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(QO.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=YO(t)).fill,n=t.align,f=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,m=t.precision,y=t.trim,v=t.type;"n"===v?(g=!0,v="g"):UO[v]||(void 0===m&&(m=12),y=!0,v="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===h?o:/[%p]/.test(v)?c:"",w=UO[v],M=/[defgprs%]/.test(v);function O(t){var i,o,c,h=b,O=x;if("c"===v)O=w(t)+O,t="";else{var E=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:w(Math.abs(t),m),y&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),E&&0==+t&&"+"!==f&&(E=!1),h=(E?"("===f?f:l:"-"===f||"("===f?"":f)+h,O=("s"===v?JO[8+$O/3]:"")+O+(E&&"("===f?")":""),M)for(i=-1,o=t.length;++i<o;)if(48>(c=t.charCodeAt(i))||c>57){O=(46===c?a+t.slice(i+1):t.slice(i))+O,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var k=h.length+t.length+O.length,S=k<p?new Array(p-k+1).join(e):"";switch(g&&d&&(t=r(S+t,S.length?p-O.length:1/0),S=""),n){case"<":t=h+t+O+S;break;case"=":t=h+S+t+O;break;case"^":t=S.slice(0,k=S.length>>1)+h+t+O+S.slice(k);break;default:t=S+h+t+O}return s(t)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),O.toString=function(){return t+""},O}return{format:f,formatPrefix:function(t,e){var n=f(((t=YO(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(function(t){return(t=WO(Math.abs(t)))?t[1]:NaN}(e)/3))),i=Math.pow(10,-r),o=JO[8+r/3];return function(t){return n(i*t)+o}}}}function eE(t,e,n){return t.querySelector(e)?tm(t).select(e):tm(t).append(n)}function nE(t){return Array.isArray(t)?t.join(", "):`${t||""}`}function rE(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)}KO=tE({thousands:",",grouping:[3],currency:["$",""]}),ZO=KO.format;class iE extends Fx{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 oE extends iE{update(t){var e;const{subOptions:n}=t;this.attr(t),null===(e=this.child)||void 0===e||e.update(n)}}function aE(t,e){var n;return null===(n=t.filter((t=>t.getOptions().name===e)))||void 0===n?void 0:n[0]}function sE(t){return"vertical"===t||t===-Math.PI/2}function cE(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,m]=s?[d,h]:[h,d];return{orientation:p,width:g,height:m,size:h,length:d}}function lE(t){const e=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"],{style:n}=t,r=he(t,["style"]),i={};return Object.entries(r).forEach((([t,n])=>{e.includes(t)?i[`show${B(t)}`]=n:i[t]=n})),Object.assign(Object.assign({},i),n)}function uE(t,e){const{eulerAngles:n,origin:r}=e;r&&t.setOrigin(r),n&&t.rotate(n[0],n[1],n[2])}function fE(t){const{innerWidth:e,innerHeight:n,depth:r}=t.getOptions();return[e,n,r]}function hE(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]=kn(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(Dc(e))return t=>t;const n=e.getOptions(),{innerWidth:r,innerHeight:i,insetTop:o,insetBottom:a,insetLeft:s,insetRight:c}=n,[l,u,f]="left"===t||"right"===t?[o,a,i]:[s,c,r],h=new ia({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(!Wc(e))return i;const o="bottom"===t?[i,1]:[0,i],a=e.map(o);if("bottom"===t){const t=a[0];return new ia({domain:[0,n],range:[0,1]}).map(t)}if("left"===t){const t=a[1];return new ia({domain:[0,r],range:[0,1]}).map(t)}return i}}(a,s),g=t=>["left","right"].includes(t);return Dc(s)||Bc(s)?u.map(((e,n,r)=>{var i,o;const c=(null===(i=t.getBandWidth)||void 0===i?void 0:i.call(t,e))/2||0,l=d(t.map(e)+c);return{value:Fc(s)&&"center"===a||Bc(s)&&(null===(o=t.getTicks)||void 0===o?void 0:o.call(t))&&(t=>["top","bottom","center","outer"].includes(t))(a)||Bc(s)&&g(a)?1-l:l,label:f(h(rm(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(rm(e),n,r)),id:String(n)}}))}function dE(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 pE(t,e,n){return!function(t){return Dc(t)&&Bc(t)}(e)&&!Gc(e)&&(void 0===t?!!n.getTicks:t)}function gE(t,e,n,r,i,o){const a=function(t,e,n,r,i,o){const a=n.axis,s=["top","right","bottom","left"].includes(i)?n[`axis${or(i)}`]:n.axisLinear,c=t.getOptions().name,l=n[`axis${B(c)}`]||{};return Object.assign({},a,s,l)}(t,0,n,0,i);return"center"===i?Object.assign(Object.assign(Object.assign(Object.assign({},a),{labelDirection:"right"===r?"negative":"positive"}),"center"===r?{labelTransform:"translate(50%,0)"}:null),{tickDirection:"right"===r?"negative":"positive",labelSpacing:"center"===r?0:4,titleSpacing:sE(o)?10:0,tick:"center"!==r&&void 0}):a}const mE=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?ZO(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)}},yE=mE((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,m=he(t,["direction","important","labelFormatter","order","orientation","actualPosition","position","size","style","title","tickCount","tickFilter","tickMethod","transform","indexBBox"]);return({scales:i,value:y,coordinate:v,theme:b})=>{const{bbox:x}=y,[w]=i,{domain:M,xScale:O}=w.getOptions(),E=gE(w,0,b,e,s,o),k=Object.assign(Object.assign(Object.assign({},E),l),m),S=function(t,e,n="xy"){const[r,i,o]=fE(e);return"xy"===n?t.includes("bottom")||t.includes("top")?i:r:"xz"===n?t.includes("bottom")||t.includes("top")?o:r:t.includes("bottom")||t.includes("top")?i:o}(a||s,v,t.plane),A=function(t,e,n,r,i){const{x:o,y:a,width:s,height:c}=n;if("bottom"===t)return{startPos:[o,a],endPos:[o+s,a]};if("left"===t)return{startPos:[o+s,a+c],endPos:[o+s,a]};if("right"===t)return{startPos:[o,a+c],endPos:[o,a]};if("top"===t)return{startPos:[o,a+c],endPos:[o+s,a+c]};if("center"===t){if("vertical"===e)return{startPos:[o,a],endPos:[o,a+c]};if("horizontal"===e)return{startPos:[o,a],endPos:[o+s,a]};if("number"==typeof e){const[t,n]=r.getCenter(),[l,u]=Hc(r),[f,h]=Yc(r),d=Math.min(s,c)/2,{insetLeft:p,insetTop:g}=r.getOptions(),m=l*d,y=u*d,[v,b]=[t+o-p,n+a-g],[x,w]=[Math.cos(e),Math.sin(e)],M=[v+y*x,b+y*w],O=[v+m*x,b+m*w],E=()=>{const{domain:t}=i.getOptions();return t.length},k=Dc(r)&&i?E():3;return{startPos:M,endPos:O,gridClosed:Math.abs(h-f-360)<1e-6,gridCenter:[v,b],gridControlAngles:new Array(k).fill(0).map(((t,e,n)=>(h-f)/k*e))}}}return{}}(s,o,x,v,O),_=function(t){const{depth:e}=t.getOptions();return e?{tickIsBillboard:!0,lineIsBillboard:!0,labelIsBillboard:!0,titleIsBillboard:!0,gridIsBillboard:!0}:{}}(v),T=hE(w,M,f,r,h,d,s,v),P=g?T.map(((t,e)=>{const n=g.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t})):T,C=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},k),{type:"linear",data:P,crossSize:c,titleText:nE(u),labelOverlap:dE(p,k),grid:pE(k.grid,v,w),gridLength:S,line:!0,indexBBox:g}),k.line?null:{lineOpacity:0}),A),_),n),N=C.labelOverlap.find((t=>"hide"===t.type));return N&&(C.crossSize=!1),new ax({className:"axis",style:lE(C)})}})),vE=mE((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=he(t,["order","size","position","orientation","labelFormatter","tickFilter","tickCount","tickMethod","important","style","indexBBox","title","grid"]);return({scales:[t],value:e,coordinate:n,theme:i})=>{const{bbox:u}=e,{domain:g}=t.getOptions(),m=hE(t,g,s,o,a,c,r,n),y=f?m.map(((t,e)=>{const n=f.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t})):m,[v,b]=Hc(n),x=function(t,e,n,r,i){const{x:o,y:a,width:s,height:c}=e,l=[o+s/2,a+c/2],u=Math.min(s,c)/2,[f,h]=Yc(i),[d,p]=fE(i),g={center:l,radius:u,startAngle:f,endAngle:h,gridLength:(r-n)*(Math.min(d,p)/2)};if("inner"===t){const{insetLeft:t,insetTop:e}=i.getOptions();return Object.assign(Object.assign({},g),{center:[l[0]-t,l[1]-e],labelAlign:"perpendicular",labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"})}return Object.assign(Object.assign({},g),{labelAlign:"parallel",labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"})}(r,u,v,b,n),{axis:w,axisArc:M={}}=i,O=lE(V({},w,M,x,Object.assign(Object.assign({type:"arc",data:y,titleText:nE(h),grid:d},p),l)));return new ax({style:K(O,["transform"])})}}));yE.props={defaultPosition:"center",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]},vE.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const bE=t=>(...e)=>{const n=yE(Object.assign({},{crossPadding:50},t))(...e);return uE(n,t),n};bE.props=Object.assign(Object.assign({},yE.props),{defaultPosition:"bottom"});const xE=t=>(...e)=>{const n=yE(Object.assign({},{crossPadding:10},t))(...e);return uE(n,t),n};function wE(t,e,n,r){const{radar:i}=t,[o]=r,a=o.getOptions().name,[s,c]=Yc(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))})}xE.props=Object.assign(Object.assign({},yE.props),{defaultPosition:"left"});const ME=t=>{const{important:e={}}=t,n=he(t,["important"]);return r=>{const{theme:i,coordinate:o,scales:a}=r;return yE(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({},wE(t,i,o,a)),e)}))(r)}};function OE(t,e){const{scales:n,library:r,markState:i}=e,[o,a]=function(t,e){const n=aE(t,"shape"),r=aE(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)||function(t){if(g(t))return t[t.length-1]}(t.split(".")),l="function"==typeof c?c(e):c;return()=>function(t,e){var{d:n,fill:r,strokeWidth:i,path:o,stroke:a,lineWidth:s,color:c}=e,l=he(e,["d","fill","strokeWidth","path","stroke","lineWidth","color"]);const u=ny.get(t)||ny.get("point");return(...t)=>new Pp({style:Object.assign(Object.assign({},l),{path:u(...t),stroke:u.style.includes("stroke")?c||a:"",fill:u.style.includes("fill")?c||r:"",lineWidth:u.style.includes("lineWidth")?s||s||2:0})})}(s,{color:e.color})(0,0,l)},u=t=>`${a[t]}`;return aE(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 EE(t){const e=aE(t,"opacity");if(e){const{range:t}=e.getOptions();return(e,n)=>t[n]}}function kE(t,e){const{labelFormatter:n=(t=>`${t}`)}=t,{scales:r,theme:i}=e,o=function(t,e){const n=aE(t,"size");return n instanceof Jo?2*n.map(NaN):e}(r,i.legendCategory.itemMarkerSize),a={itemMarker:OE(Object.assign(Object.assign({},t),{itemMarkerSize:o}),e),itemMarkerSize:o,itemMarkerOpacity:EE(r)},s="string"==typeof n?ZO(n):n,c=aE(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)})))})}ME.props=Object.assign(Object.assign({},yE.props),{defaultPosition:"center"});const SE=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s,cols:c,itemMarker:l}=t,u=he(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}=cE(t,e,n);return{width:i,height:o}}(r,t,SE),d=rE(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:nE(s)}),kE(t,e)),{legendCategory:g={}}=i,m=lE(Object.assign({},g,p,u)),y=new oE({style:Object.assign(Object.assign({x:a.x,y:a.y,width:a.width,height:a.height},d),{subOptions:m})});return y.appendChild(new Mx({className:"legend-category",style:m})),y}};function AE(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 _E(t){const{domain:e}=t.getOptions(),[n,r]=[e[0],xr(e)];return[n,r]}function TE(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:[Sf(e).toString()]})),r}(s,c),[u,f]=_E(l),[h,d]=_E([e,n,r].filter((t=>void 0!==t)).find((t=>!(t instanceof Wo))));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 PE(t,e,n,r,i,o){const a=aE(t,"color"),s=function(t,e,n){const{size:r}=e,i=cE(t,e,n);return function(t,e,n){return t.size=e,function(t){return"horizontal"===t||0===t}(n)?t.height=e:t.width=e,t}(i,r,i.orientation)}(n,r,i);if(a instanceof la){const{range:t}=a.getOptions(),[e,n]=_E(a);return a instanceof ha||a instanceof pa?AE(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 TE(s,a,aE(t,"size"),aE(t,"opacity"),e,o)}SE.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const CE=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s,style:c,crossPadding:l,padding:u}=t,f=he(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,m=rE(o,n),{legendContinuous:y={}}=a,v=lE(Object.assign({},y,Object.assign(Object.assign({titleText:nE(s),labelAlign:"value",labelFormatter:"string"==typeof e?t=>ZO(e)(t.label):e},PE(r,l,i,t,CE,a)),c),f)),b=new iE({style:Object.assign(Object.assign({x:h,y:d,width:p,height:g},m),{subOptions:v})});return b.appendChild(new jx({className:"legend-continuous",style:v})),b}};CE.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[12,12]};const NE=t=>(...e)=>CE(Object.assign({},{block:!0},t))(...e);NE.props=Object.assign(Object.assign({},CE.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const LE=t=>e=>{const{scales:n}=e,r=aE(n,"size");return CE(Object.assign({},{type:"size",data:r.getTicks().map(((t,e)=>({value:t,label:String(t)})))},t))(e)};LE.props=Object.assign(Object.assign({},CE.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const jE=t=>LE(Object.assign({},{block:!0},t));function RE(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"}}}jE.props=Object.assign(Object.assign({},CE.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const IE=(BE={render(t,e){const{width:n,title:r,subtitle:i,spacing:o=2,align:a="left"}=t,s=he(t,["width","title","subtitle","spacing","align"]),c=ur(s,"title"),l=ur(s,"subtitle"),u=eE(e,".title","text").attr("className","title").call(im,Object.assign(Object.assign(Object.assign({},RE(0,0,n,a)),{fontSize:14,textBaseline:"top",text:r}),c)).node().getLocalBounds();eE(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({},RE(0,u.max[1]+o,n,a)),{fontSize:12,textBaseline:"top",text:i}),l))}))}},class extends Ep{constructor(t){super(t),this.descriptor=BE}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(V({},this.attributes,t)),null===(n=(e=this.descriptor).render)||void 0===n||n.call(e,this.attributes,this)}});var BE;const DE=t=>({value:e,theme:n})=>{const{x:r,y:i,width:o,height:a}=e.bbox;return new IE({style:V({},n.title,Object.assign({x:r,y:i,width:o,height:a},t))})};function FE(t){return!!t.getBandWidth}function zE(t,e,n){if(!FE(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))}(xn(s,e)+o,0,i.length-1);return i[c]}function GE(t,e,n){if(!e)return t.getOptions().domain;if(!FE(t)){const r=Rn(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 WE(t,e,n,r,i,o){const{x:a,y:s}=i,c=(t,e)=>{const[n,r]=o.invert(t);return[zE(a,n,e),zE(s,r,e)]},l=c([t,e],!0),u=c([n,r],!1);return[GE(a,[l[0],u[0]]),GE(s,[l[1],u[1]])]}function $E(t,e){const[n,r]=t;return[e.map(n),e.map(r)+(t=>t.getStep?t.getStep():0)(e)]}DE.props={defaultPosition:"top",defaultOrder:2,defaultSize:36,defaultCrossPadding:[20,20],defaultPadding:[12,12]};const HE=t=>{const{orientation:e,labelFormatter:n,size:r,style:i={},position:o}=t,a=he(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,m=(null===(s=c.getFormatter)||void 0===s?void 0:s.call(c))||(t=>t+""),y="string"==typeof n?ZO(n):n,v="horizontal"===e,b=Bc(f)&&v,{trackSize:x=g.trackSize}=i,[w,M]=function(t,e,n){const{x:r,y:i,width:o,height:a}=t;return"left"===e?[r+o-n,i]:"right"===e||"bottom"===e?[r,i]:"top"===e?[r,i+a-n]:void 0}(h,o,x);return new rb({className:"slider",style:Object.assign({},g,Object.assign(Object.assign({x:w,y:M,trackLength:v?d:p,orientation:e,formatter:t=>(y||m)(zE(c,b?1-t:t,!0)),sparklineData:YE(t,r)},i),a))})}};function YE(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)).map((([t])=>{const{encode:n,slider:r}=t;if((null==r?void 0:r.x)&&0===Object.keys(r.x).length){const t=t=>{const e=n[t];return[t,e?e.value:void 0]};return Object.fromEntries(e.map(t))}}));if(!(null==n?void 0:n.series))return null==n?void 0:n.y;const r=n.series.reduce(((t,e,r)=>(t[e]=t[e]||[],t[e].push(n.y[r]),t)),{});return Object.values(r)}(n,["y","series"])}HE.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const VE=t=>HE(Object.assign(Object.assign({},t),{orientation:"horizontal"}));VE.props=Object.assign(Object.assign({},HE.props),{defaultPosition:"bottom"});const qE=t=>HE(Object.assign(Object.assign({},t),{orientation:"vertical"}));qE.props=Object.assign(Object.assign({},HE.props),{defaultPosition:"left"});const UE=t=>{const{orientation:e,labelFormatter:n,style:r}=t,i=he(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,[m,y]=d,v=y>m?0:1;return new ib({className:"g2-scrollbar",style:Object.assign({},f,Object.assign(Object.assign(Object.assign(Object.assign({},r),{x:s,y:c,trackLength:p,value:v}),i),{orientation:e,contentLength:g,viewportLength:p}))})}};UE.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const XE=t=>UE(Object.assign(Object.assign({},t),{orientation:"horizontal"}));XE.props=Object.assign(Object.assign({},UE.props),{defaultPosition:"bottom"});const KE=t=>UE(Object.assign(Object.assign({},t),{orientation:"vertical"}));KE.props=Object.assign(Object.assign({},UE.props),{defaultPosition:"left"});const ZE=t=>()=>new Sp;ZE.props={};const QE=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{transform:a="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=o.style,[u,f]=Bc(n)?["left bottom","scale(1, 0.0001)"]:["left top","scale(0.0001, 1)"],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))}},JE=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{transform:a="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=o.style,[u,f]=Bc(n)?["left bottom","scale(1, 0.0001)"]:["left top","scale(0.0001, 1)"],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))}},tk=(t,e)=>{const n=1e-4,{coordinate:r}=e;return Mp({name:"scaleInYRadius",inherits:!1,initialValue:"",interpolable:!0,syntax:hf.NUMBER}),(e,i,o)=>{const[a]=e;return Dc(r)?(e=>{const{__data__:i,style:a}=e,{radius:s=0,inset:c=0,fillOpacity:l=1,strokeOpacity:u=1,opacity:f=1}=a,{points:h,y:d,y1:p}=i,g=cm(r,h,[d,p]),{innerRadius:m,outerRadius:y}=g,v=nc().cornerRadius(s).padAngle(c*Math.PI/180),b=new Pp({}),x=r.getCenter(),w=t=>{b.attr({d:v(t),transform:`translate(${x[0]}, ${x[1]})`});const e=nh(b);return b.style.transform="",e},M=[{scaleInYRadius:m+n,fillOpacity:0,strokeOpacity:0,opacity:0},{scaleInYRadius:m+n,fillOpacity:l,strokeOpacity:u,opacity:f,offset:.01},{scaleInYRadius:y,fillOpacity:l,strokeOpacity:u,opacity:f}],O=e.animate(M,Object.assign(Object.assign({},o),t));return O.onframe=function(){e.style.path=w(Object.assign(Object.assign({},g),{outerRadius:Number(e.style.scaleInYRadius)}))},O.onfinish=function(){e.style.path=w(Object.assign(Object.assign({},g),{outerRadius:y}))},O})(a):(e=>{const{style:n}=e,{transform:i="",fillOpacity:a=1,strokeOpacity:s=1,opacity:c=1}=n,[l,u]=Bc(r)?["left top","scale(0.0001, 1)"]:["left bottom","scale(1, 0.0001)"],f=[{transform:`${i} ${u}`.trimStart(),transformOrigin:l,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${i} ${u}`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c,offset:.01},{transform:`${i} scale(1, 1)`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c}];return e.animate(f,Object.assign(Object.assign({},o),t))})(a)}},ek=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{transform:a="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=o.style,[u,f]=Bc(n)?["left top","scale(0.0001, 1)"]:["left bottom","scale(1, 0.0001)"],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))}},nk=t=>(e,n,r)=>{const[i]=e,{fillOpacity:o=1,strokeOpacity:a=1,opacity:s=1}=i.style,c=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:o,strokeOpacity:a,opacity:s}];return i.animate(c,Object.assign(Object.assign({},r),t))};nk.props={};const rk=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))};function ik(t,e){const n={};for(const r of e){const e=t.style[r];e&&(n[r]=e)}return n}rk.props={};const ok=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function ak(t){const{min:e,max:n}=t.getLocalBounds(),[r,i]=e,[o,a]=n;return[r,i,o-r,a-i]}function sk(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 ck(t,e){const[n,r,i,o]=ak(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(sk([t,o,e,l]))}f-=t,u+=1}return c}function lk(t,e){t.__data__=e.__data__,t.className=e.className,t.markType=e.markType,e.parentNode.replaceChild(t,e)}function uk(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function fk(t){const e=nh(t);if(e&&!function(t){return!uk(t,"m")||!uk(t,"M")}(e))return e}function hk(t,e,n,r){const{nodeName:i}=e,{nodeName:o}=n,a=fk(e),s=fk(n);if(i===o&&"path"!==i||(void 0===a||void 0===s))return function(t,e,n){const[r,i,o,a]=ak(t),{transform:s}=t.style,{transform:c}=e.style;lk(e,t);const[l,u,f,h]=ak(e),d=r-l,p=i-u,g=o/f,m=a/h,y=[Object.assign({transform:`${s?s+" ":""}translate(${d}, ${p}) scale(${g}, ${m})`},ik(t,ok)),Object.assign({transform:(c?c+" ":"")+"translate(0, 0) scale(1, 1)"},ik(e,ok))];return e.animate(y,n)}(e,n,r);const c=function(t,e){const{nodeName:n}=t;if("path"===n)return t;const r=new Pp({style:Object.assign(Object.assign({},ik(t,ok)),{d:e})});return lk(r,t),r}(t,a),l=[Object.assign({path:a},ik(e,ok)),Object.assign({path:s},ik(n,ok))],u=c.animate(l,r);return u.onfinish=()=>{c.style.transform="none",sr(c,n)},c.style.transform="none",u}const dk=t=>(e,n,r)=>{const i=function(t="pack"){return"function"==typeof t?t:ck}(t.split),o=Object.assign(Object.assign({},r),t),{length:a}=e,{length:s}=n;if(1===a&&1===s||a>1&&s>1){const[t]=e,[r]=n;return hk(t,t,r,o)}if(1===a&&s>1){const[t]=e;return function(t,e,n,r){t.style.visibility="hidden";const i=r(t,e.length);return e.map(((e,r)=>hk(e,new Pp({style:Object.assign({path:i[r]},ik(t,ok))}),e,n)))}(t,n,o,i)}if(a>1&&1===s){const[t]=n;return function(t,e,n,r){const i=r(e,t.length),{fillOpacity:o=1,strokeOpacity:a=1,opacity:s=1}=e.style,c=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:0,strokeOpacity:0,opacity:0,offset:.99},{fillOpacity:o,strokeOpacity:a,opacity:s}],l=e.animate(c,n),u=t.map(((t,r)=>hk(t,t,new Pp({style:{path:i[r],fill:e.style.fill}}),n)));return[...u,l]}(e,t,o,i)}return null};dk.props={};const pk=(t,e)=>{const n=1e-4;Mp({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:hf.NUMBER});const{coordinate:r}=e;return(i,o,a)=>{const[s]=i;if(!Dc(r))return QE(t,e)(i,o,a);const c=r.getCenter(),{__data__:l,style:u}=s,{radius:f=0,inset:h=0,fillOpacity:d=1,strokeOpacity:p=1,opacity:g=1}=u,{points:m,y:y,y1:v}=l,b=nc().cornerRadius(f).padAngle(h*Math.PI/180),x=cm(r,m,[y,v]),{startAngle:w,endAngle:M}=x,O=new Pp({}),E=t=>{O.attr({d:b(t),transform:`translate(${c[0]}, ${c[1]})`});const e=nh(O);return O.style.transform="",e},k=[{waveInArcAngle:w+n,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:w+n,fillOpacity:d,strokeOpacity:p,opacity:g,offset:.01},{waveInArcAngle:M,fillOpacity:d,strokeOpacity:p,opacity:g}],S=s.animate(k,Object.assign(Object.assign({},a),t));return S.onframe=function(){s.style.path=E(Object.assign(Object.assign({},x),{endAngle:Number(s.style.waveInArcAngle)}))},S.onfinish=function(){s.style.path=E(Object.assign(Object.assign({},x),{endAngle:M}))},S}};pk.props={};const gk=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))},mk=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))},yk=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))};yk.props={};const vk=(t,e)=>(n,r,i)=>{const[o]=n,{height:a,width:s}=o.getBoundingClientRect(),c=new Pp({style:{path:`M0,0L${s},0L${s},${a}L0,${a}Z`}});o.appendChild(c),o.style.clipPath=c;return QE(t,e)([c],r,i)};vk.props={};const bk=(t,e)=>(n,r,i)=>{const[o]=n,{height:a,width:s}=o.getBoundingClientRect(),c=new Pp({style:{path:`M0,0L${s},0L${s},${a}L0,${a}Z`}});o.appendChild(c),o.style.clipPath=c;return tk(t,e)([c],r,i)};bk.props={};const xk="main-layer",wk="label-layer",Mk="element",Ok="view",Ek="plot",kk="component",Sk="label",Ak="area";function _k(t,e){var n=e.r;t.arc(n,n,n,0,2*Math.PI,!1)}function Tk(t,e){var n=e.rx,r=e.ry;if(t.ellipse)t.ellipse(n,r,n,r,0,0,2*Math.PI,!1);else{var i=n>r?n:r,o=n>r?1:n/r,a=n>r?r/n:1;t.save(),t.scale(o,a),t.arc(i,i,i,0,2*Math.PI)}}function Pk(t,e){var n,r,i=e.x1,o=e.y1,a=e.x2,s=e.y2,c=e.defX,l=void 0===c?0:c,u=e.defY,f=void 0===u?0:u,h=e.markerStart,d=e.markerEnd,p=e.markerStartOffset,g=e.markerEndOffset,m=0,y=0,v=0,b=0,x=0;h&&dp(h)&&p&&(n=a-i,r=s-o,x=Math.atan2(r,n),m=Math.cos(x)*(p||0),y=Math.sin(x)*(p||0)),d&&dp(d)&&g&&(n=i-a,r=o-s,x=Math.atan2(r,n),v=Math.cos(x)*(g||0),b=Math.sin(x)*(g||0)),t.moveTo(i-l+m,o-f+y),t.lineTo(a-l+v,s-f+b)}function Ck(t,e){var n,r,i=e.defX,o=void 0===i?0:i,a=e.defY,s=void 0===a?0:a,c=e.markerStart,l=e.markerEnd,u=e.markerStartOffset,f=e.markerEndOffset,h=e.path,d=h.absolutePath,p=h.segments,g=0,m=0,y=0,v=0,b=0;if(c&&dp(c)&&u){var x=ye(c.parentNode.getStartTangent(),2),w=x[0],M=x[1];n=w[0]-M[0],r=w[1]-M[1],b=Math.atan2(r,n),g=Math.cos(b)*(u||0),m=Math.sin(b)*(u||0)}if(l&&dp(l)&&f){var O=ye(l.parentNode.getEndTangent(),2);w=O[0],M=O[1];n=w[0]-M[0],r=w[1]-M[1],b=Math.atan2(r,n),y=Math.cos(b)*(f||0),v=Math.sin(b)*(f||0)}for(var E=0;E<d.length;E++){var k=d[E],S=k[0],A=d[E+1],_=0===E&&(0!==g||0!==m),T=(E===d.length-1||A&&("M"===A[0]||"Z"===A[0]))&&0!==y&&0!==v;switch(S){case"M":_?(t.moveTo(k[1]-o+g,k[2]-s+m),t.lineTo(k[1]-o,k[2]-s)):t.moveTo(k[1]-o,k[2]-s);break;case"L":T?t.lineTo(k[1]-o+y,k[2]-s+v):t.lineTo(k[1]-o,k[2]-s);break;case"Q":t.quadraticCurveTo(k[1]-o,k[2]-s,k[3]-o,k[4]-s),T&&t.lineTo(k[3]-o+y,k[4]-s+v);break;case"C":t.bezierCurveTo(k[1]-o,k[2]-s,k[3]-o,k[4]-s,k[5]-o,k[6]-s),T&&t.lineTo(k[5]-o+y,k[6]-s+v);break;case"A":var P=p[E].arcParams,C=P.cx,N=P.cy,L=P.rx,j=P.ry,R=P.startAngle,I=P.endAngle,B=P.xRotation,D=P.sweepFlag;if(t.ellipse)t.ellipse(C-o,N-s,L,j,B,R,I,!!(1-D));else{var F=L>j?L:j,z=L>j?1:L/j,G=L>j?j/L:1;t.translate(C-o,N-s),t.rotate(B),t.scale(z,G),t.arc(0,0,F,R,I,!!(1-D)),t.scale(1/z,1/G),t.rotate(-B),t.translate(-(C-o),-(N-s))}T&&t.lineTo(k[6]-o+y,k[7]-s+v);break;case"Z":t.closePath()}}}function Nk(t,e){var n,r,i=e.defX,o=void 0===i?0:i,a=e.defY,s=void 0===a?0:a,c=e.markerStart,l=e.markerEnd,u=e.markerStartOffset,f=e.markerEndOffset,h=e.points.points,d=h.length,p=h[0][0]-o,g=h[0][1]-s,m=h[d-1][0]-o,y=h[d-1][1]-s,v=0,b=0,x=0,w=0,M=0;c&&dp(c)&&u&&(n=h[1][0]-h[0][0],r=h[1][1]-h[0][1],M=Math.atan2(r,n),v=Math.cos(M)*(u||0),b=Math.sin(M)*(u||0)),l&&dp(l)&&f&&(n=h[d-1][0]-h[0][0],r=h[d-1][1]-h[0][1],M=Math.atan2(r,n),x=Math.cos(M)*(f||0),w=Math.sin(M)*(f||0)),t.moveTo(p+(v||x),g+(b||w));for(var O=1;O<d-1;O++){var E=h[O];t.lineTo(E[0]-o,E[1]-s)}t.lineTo(m,y)}function Lk(t,e){var n,r,i=e.defX,o=void 0===i?0:i,a=e.defY,s=void 0===a?0:a,c=e.markerStart,l=e.markerEnd,u=e.markerStartOffset,f=e.markerEndOffset,h=e.points.points,d=h.length,p=h[0][0]-o,g=h[0][1]-s,m=h[d-1][0]-o,y=h[d-1][1]-s,v=0,b=0,x=0,w=0,M=0;c&&dp(c)&&u&&(n=h[1][0]-h[0][0],r=h[1][1]-h[0][1],M=Math.atan2(r,n),v=Math.cos(M)*(u||0),b=Math.sin(M)*(u||0)),l&&dp(l)&&f&&(n=h[d-2][0]-h[d-1][0],r=h[d-2][1]-h[d-1][1],M=Math.atan2(r,n),x=Math.cos(M)*(f||0),w=Math.sin(M)*(f||0)),t.moveTo(p+v,g+b);for(var O=1;O<d-1;O++){var E=h[O];t.lineTo(E[0]-o,E[1]-s)}t.lineTo(m+x,y+w)}function jk(t,e){var n=e.radius,r=e.width,i=e.height,o=r,a=i;if(n&&n.some((function(t){return 0!==t}))){var s=r>0?1:-1,c=i>0?1:-1,l=s+c===0,u=ye(n.map((function(t){return _(t,0,Math.min(Math.abs(o)/2,Math.abs(a)/2))})),4),f=u[0],h=u[1],d=u[2],p=u[3];t.moveTo(s*f,0),t.lineTo(o-s*h,0),0!==h&&t.arc(o-s*h,c*h,h,-c*Math.PI/2,s>0?0:Math.PI,l),t.lineTo(o,a-c*d),0!==d&&t.arc(o-s*d,a-c*d,d,s>0?0:Math.PI,c>0?Math.PI/2:1.5*Math.PI,l),t.lineTo(s*p,a),0!==p&&t.arc(s*p,a-c*p,p,c>0?Math.PI/2:-Math.PI/2,s>0?Math.PI:0,l),t.lineTo(0,c*f),0!==f&&t.arc(s*f,c*f,f,s>0?Math.PI:0,c>0?1.5*Math.PI:Math.PI/2,l)}else t.rect(0,0,o,a)}var Rk=function(t){function e(){var e=t.apply(this,ve([],ye(arguments),!1))||this;return e.name="canvas-path-generator",e}return ue(e,t),e.prototype.init=function(){var t,e=((t={})[Hl.CIRCLE]=_k,t[Hl.ELLIPSE]=Tk,t[Hl.RECT]=jk,t[Hl.LINE]=Pk,t[Hl.POLYLINE]=Lk,t[Hl.POLYGON]=Nk,t[Hl.PATH]=Ck,t[Hl.TEXT]=void 0,t[Hl.GROUP]=void 0,t[Hl.IMAGE]=void 0,t[Hl.HTML]=void 0,t[Hl.MESH]=void 0,t);this.context.pathGeneratorFactory=e},e.prototype.destroy=function(){delete this.context.pathGeneratorFactory},e}(ql),Ik=jt(),Bk=jt(),Dk=jt(),Fk=rt(),zk=function(){function t(){var t=this;this.isHit=function(e,n,r,i){var o=t.context.pointInPathPickerFactory[e.nodeName];if(o){var a=lt(Fk,r),s=qt(Bk,Ft(Dk,n[0],n[1],0),a),c=e.getGeometryBounds().halfExtents,l=e.parsedStyle.anchor;if(s[0]+=(l&&l[0]||0)*c[0]*2,s[1]+=(l&&l[1]||0)*c[1]*2,o(e,new bu(s[0],s[1]),i,t.isPointInPath,t.context,t.runtime))return!0}return!1},this.isPointInPath=function(e,n){var r=t.runtime.offscreenCanvasCreator.getOrCreateContext(t.context.config.offscreenCanvas),i=t.context.pathGeneratorFactory[e.nodeName];return i&&(r.beginPath(),i(r,e.parsedStyle),r.closePath()),r.isPointInPath(n.x,n.y)}}return t.prototype.apply=function(e,n){var r,i=this,o=e.renderingService,a=e.renderingContext;this.context=e,this.runtime=n;var s=null===(r=a.root)||void 0===r?void 0:r.ownerDocument;o.hooks.pick.tapPromise(t.tag,(function(t){return pe(i,void 0,void 0,(function(){return ge(this,(function(e){return[2,this.pick(s,t)]}))}))})),o.hooks.pickSync.tap(t.tag,(function(t){return i.pick(s,t)}))},t.prototype.pick=function(t,e){var n,r,i=e.topmost,o=e.position,a=o.x,s=o.y,c=Ft(Ik,a,s,0),l=t.elementsFromBBox(c[0],c[1],c[0],c[1]),u=[];try{for(var f=me(l),h=f.next();!h.done;h=f.next()){var d=h.value,p=d.getWorldTransform();if(this.isHit(d,c,p,!1)){var g=ed(d);if(g){var m=g.parsedStyle.clipPath;if(this.isHit(m,c,m.getWorldTransform(),!0)){if(i)return e.picked=[d],e;u.push(d)}}else{if(i)return e.picked=[d],e;u.push(d)}}}}catch(t){n={error:t}}finally{try{h&&!h.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}return e.picked=u,e},t.tag="CanvasPicker",t}();function Gk(t,e,n){var r=t.parsedStyle,i=r.r,o=r.fill,a=r.stroke,s=r.lineWidth,c=r.increasedLineWidthForHitTesting,l=r.pointerEvents,u=((s||0)+(c||0))/2,f=El(i,i,e.x,e.y),h=ye(od(l,o,a),2),d=h[0],p=h[1];return d&&p||n?f<=i+u:d?f<=i:!!p&&(f>=i-u&&f<=i+u)}function Wk(t,e,n,r){return t/(n*n)+e/(r*r)}function $k(t,e,n){var r=t.parsedStyle,i=r.rx,o=r.ry,a=r.fill,s=r.stroke,c=r.lineWidth,l=r.increasedLineWidthForHitTesting,u=r.pointerEvents,f=e.x,h=e.y,d=ye(od(u,a,s),2),p=d[0],g=d[1],m=((c||0)+(l||0))/2,y=(f-i)*(f-i),v=(h-o)*(h-o);return p&&g||n?Wk(y,v,i+m,o+m)<=1:p?Wk(y,v,i,o)<=1:!!g&&(Wk(y,v,i-m,o-m)>=1&&Wk(y,v,i+m,o+m)<=1)}function Hk(t,e,n,r,i,o){return i>=t&&i<=t+n&&o>=e&&o<=e+r}function Yk(t,e,n,r,i,o,a,s){var c=(Math.atan2(s-e,a-t)+2*Math.PI)%(2*Math.PI),l={x:t+n*Math.cos(c),y:e+n*Math.sin(c)};return El(l.x,l.y,a,s)<=o/2}function Vk(t,e,n,r,i,o,a){var s=Math.min(t,n),c=Math.max(t,n),l=Math.min(e,r),u=Math.max(e,r),f=i/2;return o>=s-f&&o<=c+f&&a>=l-f&&a<=u+f&&Ll(t,e,n,r,o,a)<=i/2}function qk(t,e,n,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a<o-1;a++){if(Vk(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,n,r))return!0}if(i){var s=t[0],c=t[o-1];if(Vk(s[0],s[1],c[0],c[1],e,n,r))return!0}return!1}var Uk=1e-6;function Xk(t){return Math.abs(t)<Uk?0:t<0?-1:1}function Kk(t,e,n){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}function Zk(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var o=0;o<i;o++){var a=t[o],s=t[(o+1)%i];if(Kk(a,s,[e,n]))return!0;Xk(a[1]-n)>0!=Xk(s[1]-n)>0&&Xk(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}function Qk(t,e,n){for(var r=!1,i=0;i<t.length;i++){if(r=Zk(t[i],e,n))break}return r}function Jk(t,e,n){var r=t.parsedStyle,i=r.x1,o=r.y1,a=r.x2,s=r.y2,c=r.lineWidth,l=r.increasedLineWidthForHitTesting,u=r.defX,f=void 0===u?0:u,h=r.defY,d=void 0===h?0:h;return!(!ye(od(r.pointerEvents,r.fill,r.stroke),2)[1]&&!n||!c)&&Vk(i,o,a,s,(c||0)+(l||0),e.x+f,e.y+d)}function tS(t,e,n,r,i,o){var a=t.parsedStyle,s=a.lineWidth,c=a.increasedLineWidthForHitTesting,l=a.stroke,u=a.fill,f=a.defX,h=void 0===f?0:f,d=a.defY,p=void 0===d?0:d,g=a.path,m=a.pointerEvents,y=g.segments,v=g.hasArc,b=g.polylines,x=g.polygons,w=ye(od(m,(null==x?void 0:x.length)&&u,l),2),M=w[0],O=w[1],E=Hf(t),k=!1;return M||n?k=v?r(t,e):Qk(x,e.x+h,e.y+p)||Qk(b,e.x+h,e.y+p):((O||n)&&(k=function(t,e,n,r,i){for(var o=!1,a=e/2,s=0;s<t.length;s++){var c=t[s],l=c.currentPoint,u=c.params,f=c.prePoint,h=c.box;if(!h||Hk(h.x-a,h.y-a,h.width+e,h.height+e,n,r))switch(c.command){case"L":case"Z":if(o=Vk(f[0],f[1],l[0],l[1],e,n,r))return!0;break;case"Q":if(o=Wl(f[0],f[1],u[1],u[2],u[3],u[4],n,r)<=e/2)return!0;break;case"C":if(o=Bl(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],n,r,i)<=e/2)return!0;break;case"A":c.cubicParams||(c.cubicParams=De(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var d=c.cubicParams,p=f,g=0;g<d.length;g+=6){var m=Bl(p[0],p[1],d[g],d[g+1],d[g+2],d[g+3],d[g+4],d[g+5],n,r,i);if(p=[d[g+4],d[g+5]],o=m<=e/2)return!0}}}return o}(y,(s||0)+(c||0),e.x+h,e.y+p,E)),k)}function eS(t,e,n){var r=t.parsedStyle,i=r.stroke,o=r.fill,a=r.lineWidth,s=r.increasedLineWidthForHitTesting,c=r.points,l=r.defX,u=void 0===l?0:l,f=r.defY,h=void 0===f?0:f,d=ye(od(r.pointerEvents,o,i),2),p=d[0],g=!1;return(d[1]||n)&&(g=qk(c.points,(a||0)+(s||0),e.x+u,e.y+h,!0)),g||!p&&!n||(g=Zk(c.points,e.x+u,e.y+h)),g}function nS(t,e,n){var r=t.parsedStyle,i=r.lineWidth,o=r.increasedLineWidthForHitTesting,a=r.points,s=r.defX,c=void 0===s?0:s,l=r.defY,u=void 0===l?0:l;return!(!ye(od(r.pointerEvents,r.fill,r.stroke),2)[1]&&!n||!i)&&qk(a.points,(i||0)+(o||0),e.x+c,e.y+u,!1)}function rS(t,e,n,r,i){var o=t.parsedStyle,a=o.radius,s=o.fill,c=o.stroke,l=o.lineWidth,u=o.increasedLineWidthForHitTesting,f=o.width,h=o.height,d=ye(od(o.pointerEvents,s,c),2),p=d[0],g=d[1],m=(l||0)+(u||0);if(a&&a.some((function(t){return 0!==t}))){var y=!1;return(g||n)&&(y=function(t,e,n,r,i,o,a,s){var c=ye(i,4),l=c[0],u=c[1],f=c[2],h=c[3];return Vk(t+l,e,t+n-u,e,o,a,s)||Vk(t+n,e+u,t+n,e+r-f,o,a,s)||Vk(t+n-f,e+r,t+h,e+r,o,a,s)||Vk(t,e+r-h,t,e+l,o,a,s)||Yk(t+n-u,e+u,u,Math.PI,Math.PI,o,a,s)||Yk(t+n-f,e+r-f,f,0,Math.PI,o,a,s)||Yk(t+h,e+r-h,h,Math.PI,Math.PI,o,a,s)||Yk(t+l,e+l,l,Math.PI,Math.PI,o,a,s)}(0,0,f,h,a.map((function(t){return _(t,0,Math.min(Math.abs(f)/2,Math.abs(h)/2))})),m,e.x,e.y)),y||!p&&!n||(y=r(t,e)),y}var v=m/2;return p&&g||n?Hk(0-v,0-v,f+v,h+v,e.x,e.y):p?Hk(0,0,f,h,e.x,e.y):!!g&&function(t,e,n,r,i,o,a){var s=i/2;return Hk(t-s,e-s,n,i,o,a)||Hk(t+n-s,e-s,i,r,o,a)||Hk(t+s,e+r-s,n,i,o,a)||Hk(t-s,e+s,i,r,o,a)}(0,0,f,h,m,e.x,e.y)}function iS(t,e,n,r,i,o){var a=t.parsedStyle,s=a.pointerEvents,c=a.width,l=a.height;if("non-transparent-pixel"===s){var u=i.config.offscreenCanvas,f=o.offscreenCanvasCreator.getOrCreateCanvas(u),h=o.offscreenCanvasCreator.getOrCreateContext(u,{willReadFrequently:!0});return f.width=c,f.height=l,i.defaultStyleRendererFactory[Hl.IMAGE].render(h,t.parsedStyle,t,void 0,void 0,void 0),h.getImageData(e.x,e.y,1,1).data.every((function(t){return 0!==t}))}return!0}var oS=function(t){function e(){var e=t.apply(this,ve([],ye(arguments),!1))||this;return e.name="canvas-picker",e}return ue(e,t),e.prototype.init=function(){var t,e=((t={})[Hl.CIRCLE]=Gk,t[Hl.ELLIPSE]=$k,t[Hl.RECT]=rS,t[Hl.LINE]=Jk,t[Hl.POLYLINE]=nS,t[Hl.POLYGON]=eS,t[Hl.PATH]=tS,t[Hl.TEXT]=function(){return!0},t[Hl.GROUP]=null,t[Hl.IMAGE]=iS,t[Hl.HTML]=null,t[Hl.MESH]=null,t);this.context.pointInPathPickerFactory=e,this.addRenderingPlugin(new zk)},e.prototype.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()},e}(ql),aS=function(){function t(t){this.canvasRendererPluginOptions=t,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.vpMatrix=rt(),this.dprMatrix=rt(),this.tmpMat4=rt(),this.vec3a=jt(),this.vec3b=jt(),this.vec3c=jt(),this.vec3d=jt()}return t.prototype.apply=function(e,n){var r=this;this.context=e;var i=e.config,o=e.camera,a=e.renderingService,s=e.renderingContext,c=e.rBushRoot,l=e.pathGeneratorFactory;this.rBush=c,this.pathGeneratorFactory=l;var u=e.contextService,f=s.root.ownerDocument.defaultView,h=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)},d=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)};a.hooks.init.tap(t.tag,(function(){f.addEventListener($d.UNMOUNTED,h),f.addEventListener($d.CULLED,d);var t=u.getDPR(),e=i.width,n=i.height,o=u.getContext();r.clearRect(o,0,0,e*t,n*t,i.background)})),a.hooks.destroy.tap(t.tag,(function(){f.removeEventListener($d.UNMOUNTED,h),f.removeEventListener($d.CULLED,d),r.renderQueue=[],r.removedRBushNodeAABBs=[],r.restoreStack=[]})),a.hooks.beginFrame.tap(t.tag,(function(){var t=u.getContext(),e=u.getDPR(),n=i.width,o=i.height,s=r.canvasRendererPluginOptions,c=s.dirtyObjectNumThreshold,l=s.dirtyObjectRatioThreshold,f=a.getStats(),h=f.total,d=f.rendered,p=d/h;r.clearFullScreen=a.disableDirtyRectangleRendering()||d>c&&p>l,t&&(t.resetTransform?t.resetTransform():t.setTransform(1,0,0,1,0,0),r.clearFullScreen&&r.clearRect(t,0,0,n*e,o*e,i.background))}));var p=function(t,e){t.isVisible()&&!t.isCulled()&&(r.renderDisplayObject(t,e,r.context,r.restoreStack,n),r.saveDirtyAABB(t)),(t.sortable.sorted||t.childNodes).forEach((function(t){p(t,e)}))};a.hooks.endFrame.tap(t.tag,(function(){var t=u.getContext(),e=u.getDPR();if(yt(r.dprMatrix,[e,e,1]),ft(r.vpMatrix,r.dprMatrix,o.getOrthoMatrix()),r.clearFullScreen)p(s.root,t);else{var a=r.safeMergeAABB.apply(r,ve([r.mergeDirtyAABBs(r.renderQueue)],ye(r.removedRBushNodeAABBs.map((function(t){var e=t.minX,n=t.minY,r=t.maxX,i=t.maxY,o=new du;return o.setMinMax([e,n,0],[r,i,0]),o}))),!1));if(r.removedRBushNodeAABBs=[],du.isEmpty(a))return void(r.renderQueue=[]);var c=r.convertAABB2Rect(a),l=c.x,h=c.y,d=c.width,g=c.height,m=qt(r.vec3a,[l,h,0],r.vpMatrix),y=qt(r.vec3b,[l+d,h,0],r.vpMatrix),v=qt(r.vec3c,[l,h+g,0],r.vpMatrix),b=qt(r.vec3d,[l+d,h+g,0],r.vpMatrix),x=Math.min(m[0],y[0],b[0],v[0]),w=Math.min(m[1],y[1],b[1],v[1]),M=Math.max(m[0],y[0],b[0],v[0]),O=Math.max(m[1],y[1],b[1],v[1]),E=Math.floor(x),k=Math.floor(w),S=Math.ceil(M-x),A=Math.ceil(O-w);t.save(),r.clearRect(t,E,k,S,A,i.background),t.beginPath(),t.rect(E,k,S,A),t.clip(),t.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]),i.renderer.getConfig().enableDirtyRectangleRenderingDebug&&f.dispatchEvent(new Dd(pp.DIRTY_RECTANGLE,{dirtyRect:{x:E,y:k,width:S,height:A}})),r.searchDirtyObjects(a).sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t,r.context,r.restoreStack,n)})),t.restore(),r.renderQueue.forEach((function(t){r.saveDirtyAABB(t)})),r.renderQueue=[]}r.restoreStack.forEach((function(){t.restore()})),r.restoreStack=[]})),a.hooks.render.tap(t.tag,(function(t){r.clearFullScreen||r.renderQueue.push(t)}))},t.prototype.clearRect=function(t,e,n,r,i,o){t.clearRect(e,n,r,i),o&&(t.fillStyle=o,t.fillRect(e,n,r,i))},t.prototype.renderDisplayObject=function(t,e,n,r,i){var o=t.nodeName,a=r[r.length-1];!a||t.compareDocumentPosition(a)&zd.DOCUMENT_POSITION_CONTAINS||(e.restore(),r.pop());var s=this.context.styleRendererFactory[o],c=this.pathGeneratorFactory[o],l=t.parsedStyle.clipPath;if(l){this.applyWorldTransform(e,l);var u=this.pathGeneratorFactory[l.nodeName];u&&(e.save(),r.push(t),e.beginPath(),u(e,l.parsedStyle),e.closePath(),e.clip())}s&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),c&&(e.beginPath(),c(e,t.parsedStyle),t.nodeName!==Hl.LINE&&t.nodeName!==Hl.PATH&&t.nodeName!==Hl.POLYLINE&&e.closePath()),s&&(s.render(e,t.parsedStyle,t,n,this,i),e.restore()),t.renderable.dirty=!1},t.prototype.convertAABB2Rect=function(t){var e=t.getMin(),n=t.getMax(),r=Math.floor(e[0]),i=Math.floor(e[1]);return{x:r,y:i,width:Math.ceil(n[0])-r,height:Math.ceil(n[1])-i}},t.prototype.mergeDirtyAABBs=function(t){var e=new du;return t.forEach((function(t){var n=t.getRenderBounds();e.add(n);var r=t.renderable.dirtyRenderBounds;r&&e.add(r)})),e},t.prototype.searchDirtyObjects=function(t){var e=ye(t.getMin(),2),n=e[0],r=e[1],i=ye(t.getMax(),2),o=i[0],a=i[1];return this.rBush.search({minX:n,minY:r,maxX:o,maxY:a}).map((function(t){return t.displayObject}))},t.prototype.saveDirtyAABB=function(t){var e=t.renderable;e.dirtyRenderBounds||(e.dirtyRenderBounds=new du);var n=t.getRenderBounds();n&&e.dirtyRenderBounds.update(n.center,n.halfExtents)},t.prototype.applyAttributesToContext=function(t,e){var n=e.parsedStyle,r=n.stroke,i=n.fill,o=n.opacity,a=n.lineDash,s=n.lineDashOffset;a&&t.setLineDash(a),y(s)||(t.lineDashOffset=s),y(o)||(t.globalAlpha*=o),y(r)||Array.isArray(r)||r.isNone||(t.strokeStyle=e.attributes.stroke),y(i)||Array.isArray(i)||i.isNone||(t.fillStyle=e.attributes.fill)},t.prototype.applyWorldTransform=function(t,e,n){var r=0,i=0,o=(e.parsedStyle||{}).anchor,a=o&&o[0]||0,s=o&&o[1]||0;if(0!==a||0!==s){var c=e.geometry.contentBounds;r=-a*(c&&2*c.halfExtents[0]||0),i=-s*(c&&2*c.halfExtents[1]||0)}n?(ot(this.tmpMat4,e.getLocalTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,ht(this.tmpMat4,this.tmpMat4,this.vec3a),ft(this.tmpMat4,n,this.tmpMat4),ft(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(ot(this.tmpMat4,e.getWorldTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,ht(this.tmpMat4,this.tmpMat4,this.vec3a),ft(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])},t.prototype.safeMergeAABB=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=new du;return t.forEach((function(t){n.add(t)})),n},t.tag="CanvasRenderer",t}(),sS=function(){function t(t){this.imagePool=t}return t.prototype.render=function(t,e,n,r,i,o){var a=e.fill,s=e.fillRule,c=e.opacity,l=e.fillOpacity,u=e.stroke,f=e.strokeOpacity,h=e.lineWidth,d=e.lineCap,p=e.lineJoin,g=e.shadowType,m=e.shadowColor,v=e.shadowBlur,b=e.filter,x=e.miterLimit,w=!y(a)&&!a.isNone,M=!y(u)&&!u.isNone&&h>0,O=0===a.alpha,E=!(!b||!b.length),k=!y(m)&&v>0,S=n.nodeName,A="inner"===g,_=M&&k&&(S===Hl.PATH||S===Hl.LINE||S===Hl.POLYLINE||O||A);w&&(t.globalAlpha=c*l,_||cS(n,t,k),this.fill(t,n,a,s,r,i,o),_||this.clearShadowAndFilter(t,E,k)),M&&(t.globalAlpha=c*f,t.lineWidth=h,y(x)||(t.miterLimit=x),y(d)||(t.lineCap=d),y(p)||(t.lineJoin=p),_&&(A&&(t.globalCompositeOperation="source-atop"),cS(n,t,!0),A&&(this.stroke(t,n,u,r,i,o),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,E,!0))),this.stroke(t,n,u,r,i,o))},t.prototype.clearShadowAndFilter=function(t,e,n){if(n&&(t.shadowColor="transparent",t.shadowBlur=0),e){var r=t.filter;!y(r)&&r.indexOf("drop-shadow")>-1&&(t.filter=r.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}},t.prototype.fill=function(t,e,n,r,i,o,a){var s=this;Array.isArray(n)?n.forEach((function(n){t.fillStyle=s.getColor(n,e,t),r?t.fill(r):t.fill()})):(Ef(n)&&(t.fillStyle=this.getPattern(n,e,t,i,o,a)),r?t.fill(r):t.fill())},t.prototype.stroke=function(t,e,n,r,i,o){var a=this;Array.isArray(n)?n.forEach((function(n){t.strokeStyle=a.getColor(n,e,t),t.stroke()})):(Ef(n)&&(t.strokeStyle=this.getPattern(n,e,t,r,i,o)),t.stroke())},t.prototype.getPattern=function(t,e,n,r,i,o){var a,s;if("rect"===t.image.nodeName){var c=t.image.parsedStyle,l=c.width,u=c.height;s=r.contextService.getDPR();var f=r.config.offscreenCanvas;(a=o.offscreenCanvasCreator.getOrCreateCanvas(f)).width=l*s,a.height=u*s;var h=o.offscreenCanvasCreator.getOrCreateContext(f),d=[];t.image.forEach((function(t){i.renderDisplayObject(t,h,r,d,o)})),d.forEach((function(){h.restore()}))}return this.imagePool.getOrCreatePatternSync(t,n,a,s,(function(){e.renderable.dirty=!0,r.renderingService.dirtify()}))},t.prototype.getColor=function(t,e,n){var r;if(t.type===ju.LinearGradient||t.type===ju.RadialGradient){var i=e.getGeometryBounds(),o=i&&2*i.halfExtents[0]||1,a=i&&2*i.halfExtents[1]||1;r=this.imagePool.getOrCreateGradient(fe(fe({type:t.type},t.value),{width:o,height:a}),n)}return r},t}();function cS(t,e,n){var r=t.parsedStyle,i=r.filter,o=r.shadowColor,a=r.shadowBlur,s=r.shadowOffsetX,c=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=o.toString(),e.shadowBlur=a||0,e.shadowOffsetX=s||0,e.shadowOffsetY=c||0)}var lS=function(){function t(t){this.imagePool=t}return t.prototype.render=function(t,e,n){var r,i=e.width,o=e.height,a=e.img,s=e.shadowColor,c=e.shadowBlur,l=i,u=o;if(A(a)?r=this.imagePool.getImageSync(a):(l||(l=a.width),u||(u=a.height),r=a),r){cS(n,t,!y(s)&&c>0);try{t.drawImage(r,0,0,l,u)}catch(t){}}},t}(),uS=function(){function t(){}return t.prototype.render=function(t,e,n,r,i,o){var a=e,s=a.lineWidth,c=a.textAlign,l=a.textBaseline,u=a.lineJoin,f=a.miterLimit,h=a.letterSpacing,d=a.stroke,p=a.fill,g=a.fillOpacity,m=a.strokeOpacity,v=a.opacity,b=a.metrics,x=a.dx,w=a.dy,M=a.shadowColor,O=a.shadowBlur,E=b.font,k=b.lines,S=b.height,A=b.lineHeight,_=b.lineMetrics;t.font=E,t.lineWidth=s,t.textAlign="middle"===c?"center":c;var T=l;o.enableCSSParsing||"alphabetic"!==T||(T="bottom"),t.lineJoin=u,y(f)||(t.miterLimit=f);var P=0;"middle"===l?P=-S/2-A/2:"bottom"===l||"alphabetic"===l||"ideographic"===l?P=-S:"top"!==l&&"hanging"!==l||(P=-A);var C=x||0;P+=w||0,1===k.length&&("bottom"===T?(T="middle",P-=.5*S):"top"===T&&(T="middle",P+=.5*S)),t.textBaseline=T,cS(n,t,!y(M)&&O>0);for(var N=0;N<k.length;N++){var L=s/2+C;P+=A,y(d)||d.isNone||!s||this.drawLetterSpacing(t,k[N],_[N],c,L,P,h,g,m,v,!0),y(p)||this.drawLetterSpacing(t,k[N],_[N],c,L,P,h,g,m,v)}},t.prototype.drawLetterSpacing=function(t,e,n,r,i,o,a,s,c,l,u){if(void 0===u&&(u=!1),0!==a){var f=t.textAlign;t.textAlign="left";var h=i;"center"===r||"middle"===r?h=i-n.width/2:"right"!==r&&"end"!==r||(h=i-n.width);for(var d=Array.from(e),p=t.measureText(e).width,g=0,m=0;m<d.length;++m){var y=d[m];u?this.strokeText(t,y,h,o,c):this.fillText(t,y,h,o,s,l),h+=p-(g=t.measureText(e.substring(m+1)).width)+a,p=g}t.textAlign=f}else u?this.strokeText(t,e,i,o,c):this.fillText(t,e,i,o,s,l)},t.prototype.fillText=function(t,e,n,r,i,o){var a,s=!y(i)&&1!==i;s&&(a=t.globalAlpha,t.globalAlpha=i*o),t.fillText(e,n,r),s&&(t.globalAlpha=a)},t.prototype.strokeText=function(t,e,n,r,i){var o,a=!y(i)&&1!==i;a&&(o=t.globalAlpha,t.globalAlpha=i),t.strokeText(e,n,r),a&&(t.globalAlpha=o)},t}();!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(sS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(sS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(sS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(sS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(sS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(sS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}ue(e,t)}(sS);var fS=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.options=e,n.name="canvas-renderer",n}return ue(e,t),e.prototype.init=function(){var t,e=fe({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,r=new sS(n),i=((t={})[Hl.CIRCLE]=r,t[Hl.ELLIPSE]=r,t[Hl.RECT]=r,t[Hl.IMAGE]=new lS(n),t[Hl.TEXT]=new uS,t[Hl.LINE]=r,t[Hl.POLYLINE]=r,t[Hl.POLYGON]=r,t[Hl.PATH]=r,t[Hl.GROUP]=void 0,t[Hl.HTML]=void 0,t[Hl.MESH]=void 0,t);this.context.defaultStyleRendererFactory=i,this.context.styleRendererFactory=i,this.addRenderingPlugin(new aS(e))},e.prototype.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory},e}(ql),hS=function(){function t(){}return t.prototype.apply=function(e,n){var r=this,i=e.renderingService,o=e.renderingContext,a=e.config;this.context=e;var s=o.root.ownerDocument.defaultView,c=function(t){i.hooks.pointerMove.call(t)},l=function(t){i.hooks.pointerUp.call(t)},u=function(t){i.hooks.pointerDown.call(t)},f=function(t){i.hooks.pointerOver.call(t)},h=function(t){i.hooks.pointerOut.call(t)},d=function(t){i.hooks.pointerCancel.call(t)},p=function(t){i.hooks.pointerWheel.call(t)},g=function(t){i.hooks.click.call(t)};i.hooks.init.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="none",t.style.msTouchAction="none"):s.supportsPointerEvents&&(t.style.touchAction="none"),s.supportsPointerEvents?function(t){n.globalThis.document.addEventListener("pointermove",c,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("pointerleave",h,!0),t.addEventListener("pointerover",f,!0),n.globalThis.addEventListener("pointerup",l,!0),n.globalThis.addEventListener("pointercancel",d,!0)}(t):function(t){n.globalThis.document.addEventListener("mousemove",c,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("mouseout",h,!0),t.addEventListener("mouseover",f,!0),n.globalThis.addEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.addEventListener("touchstart",u,!0),t.addEventListener("touchend",l,!0),t.addEventListener("touchmove",c,!0),t.addEventListener("touchcancel",d,!0)}(t),a.useNativeClickEvent&&t.addEventListener("click",g,!0),t.addEventListener("wheel",p,{passive:!0,capture:!0})})),i.hooks.destroy.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):s.supportsPointerEvents&&(t.style.touchAction=""),s.supportsPointerEvents?function(t){n.globalThis.document.removeEventListener("pointermove",c,!0),t.removeEventListener("pointerdown",u,!0),t.removeEventListener("pointerleave",h,!0),t.removeEventListener("pointerover",f,!0),n.globalThis.removeEventListener("pointerup",l,!0)}(t):function(t){n.globalThis.document.removeEventListener("mousemove",c,!0),t.removeEventListener("mousedown",u,!0),t.removeEventListener("mouseout",h,!0),t.removeEventListener("mouseover",f,!0),n.globalThis.removeEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",u,!0),t.removeEventListener("touchend",l,!0),t.removeEventListener("touchmove",c,!0),t.removeEventListener("touchcancel",d,!0)}(t),a.useNativeClickEvent&&t.removeEventListener("click",g,!0),t.removeEventListener("wheel",p,!0)}))},t.tag="DOMInteraction",t}(),dS=function(t){function e(){var e=t.apply(this,ve([],ye(arguments),!1))||this;return e.name="dom-interaction",e}return ue(e,t),e.prototype.init=function(){this.addRenderingPlugin(new hS)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(ql),pS=function(){function t(){this.displayObjectHTMLElementMap=new WeakMap}return t.prototype.joinTransformMatrix=function(t){return"matrix(".concat([t[0],t[1],t[4],t[5],t[12],t[13]].join(","),")")},t.prototype.apply=function(e,n){var r=this,i=e.camera,o=e.renderingContext,a=e.renderingService;this.context=e;var s=o.root.ownerDocument.defaultView,c=s.context.eventService.nativeHTMLMap,l=function(t,e){e.style.transform=r.joinTransformMatrix(t.getWorldTransform())},u=function(t){var e=t.target;if(e.nodeName===Hl.HTML){r.$camera||(r.$camera=r.createCamera(i));var o=r.getOrCreateEl(e);if(r.$camera.appendChild(o),n.enableCSSParsing){var a=e.ownerDocument.documentElement.attributes;Object.keys(a).forEach((function(t){o.style[t]=a[t]}))}Object.keys(e.attributes).forEach((function(t){r.updateAttribute(t,e)})),l(e,o),c.set(o,e)}},f=function(t){var e=t.target;if(e.nodeName===Hl.HTML&&r.$camera){var n=r.getOrCreateEl(e);n&&(n.remove(),c.delete(n))}},h=function(t){var e=t.target;if(e.nodeName===Hl.HTML){var n=t.attrName;r.updateAttribute(n,e)}},d=function(t){var e=t.target;if(e.nodeName===Hl.HTML){var n=r.getOrCreateEl(e);l(e,n)}},p=function(){if(r.$camera){var t=r.context.config,e=t.width,n=t.height;r.$camera.style.width="".concat(e||0,"px"),r.$camera.style.height="".concat(n||0,"px")}};a.hooks.init.tap(t.tag,(function(){s.addEventListener(pp.RESIZE,p),s.addEventListener($d.MOUNTED,u),s.addEventListener($d.UNMOUNTED,f),s.addEventListener($d.ATTR_MODIFIED,h),s.addEventListener($d.BOUNDS_CHANGED,d)})),a.hooks.endFrame.tap(t.tag,(function(){r.$camera&&o.renderReasons.has(Ld.CAMERA_CHANGED)&&(r.$camera.style.transform=r.joinTransformMatrix(i.getOrthoMatrix()))})),a.hooks.destroy.tap(t.tag,(function(){r.$camera&&r.$camera.remove(),s.removeEventListener(pp.RESIZE,p),s.removeEventListener($d.MOUNTED,u),s.removeEventListener($d.UNMOUNTED,f),s.removeEventListener($d.ATTR_MODIFIED,h),s.removeEventListener($d.BOUNDS_CHANGED,d)}))},t.prototype.createCamera=function(t){var e=this.context.config,n=e.document,r=e.width,i=e.height,o=this.context.contextService.getDomElement(),a=o.parentNode;if(a){var s="g-canvas-camera",c=a.querySelector("#"+s);if(!c){var l=(n||document).createElement("div");c=l,l.id=s,l.style.position="absolute",l.style.left="".concat(o.offsetLeft||0,"px"),l.style.top="".concat(o.offsetTop||0,"px"),l.style.transformOrigin="left top",l.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),l.style.overflow="hidden",l.style.pointerEvents="none",l.style.width="".concat(r||0,"px"),l.style.height="".concat(i||0,"px"),a.appendChild(l)}return c}return null},t.prototype.getOrCreateEl=function(t){var e=this.context.config.document,n=this.displayObjectHTMLElementMap.get(t);return n||(n=(e||document).createElement("div"),t.parsedStyle.$el=n,this.displayObjectHTMLElementMap.set(t,n),t.id&&(n.id=t.id),t.name&&n.setAttribute("name",t.name),t.className&&(n.className=t.className),n.style.position="absolute",n.style.left="0px",n.style.top="0px",n.style["will-change"]="transform",n.style.transform=this.joinTransformMatrix(t.getWorldTransform())),n},t.prototype.updateAttribute=function(t,e){var n=this.getOrCreateEl(e);switch(t){case"innerHTML":var r=e.parsedStyle.innerHTML;A(r)?n.innerHTML=r:(n.innerHTML="",n.appendChild(r));break;case"transformOrigin":var i=e.parsedStyle.transformOrigin;n.style["transform-origin"]="".concat(i[0].value," ").concat(i[1].value);break;case"width":if(this.context.enableCSSParsing){var o=e.computedStyleMap().get("width");n.style.width=o.toString()}else{o=e.parsedStyle.width;n.style.width=T(o)?"".concat(o,"px"):o.toString()}break;case"height":if(this.context.enableCSSParsing){var a=e.computedStyleMap().get("height");n.style.height=a.toString()}else{a=e.parsedStyle.height;n.style.height=T(a)?"".concat(a,"px"):a.toString()}break;case"zIndex":var s=e.parsedStyle.zIndex;n.style["z-index"]="".concat(s);break;case"visibility":var c=e.parsedStyle.visibility;n.style.visibility=c;break;case"pointerEvents":var l=e.parsedStyle.pointerEvents;n.style.pointerEvents=l;break;case"opacity":var u=e.parsedStyle.opacity;n.style.opacity="".concat(u);break;case"fill":var f=e.parsedStyle.fill,h="";kf(f)?h=f.isNone?"transparent":e.getAttribute("fill"):Array.isArray(f)&&(h=e.getAttribute("fill")),n.style.background=h;break;case"stroke":var d=e.parsedStyle.stroke,p="";kf(d)?p=d.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(d)&&(p=e.getAttribute("stroke")),n.style["border-color"]=p,n.style["border-style"]="solid";break;case"lineWidth":var g=e.parsedStyle.lineWidth;n.style["border-width"]="".concat(g||0,"px");break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":var m=e.style.filter;n.style.filter=m;break;default:"x"!==t&&"y"!==t&&(y(e.style[t])||""===e.style[t]||(n.style[t]=e.style[t]))}},t.tag="HTMLRendering",t}(),gS=function(t){function e(){var e=t.apply(this,ve([],ye(arguments),!1))||this;return e.name="html-renderer",e}return ue(e,t),e.prototype.init=function(){this.addRenderingPlugin(new pS)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(ql),mS=function(){function t(t){this.canvasConfig=t,this.imageCache={},this.gradientCache={},this.patternCache={}}return t.prototype.getImageSync=function(t,e){return this.imageCache[t]?e&&e(this.imageCache[t]):this.getOrCreateImage(t).then((function(t){e&&e(t)})),this.imageCache[t]},t.prototype.getOrCreateImage=function(t){var e=this;if(this.imageCache[t])return Promise.resolve(this.imageCache[t]);var n=this.canvasConfig.createImage;return new Promise((function(r,i){var o;n?o=n(t):Qh&&(o=new window.Image),o&&(o.onload=function(){e.imageCache[t]=o,r(o)},o.onerror=function(t){i(t)},o.crossOrigin="Anonymous",o.src=t)}))},t.prototype.getOrCreatePatternSync=function(t,e,n,r,i){var o=this.generatePatternKey(t);if(o&&this.patternCache[o])return this.patternCache[o];var a,s=t.image,c=t.repetition,l=t.transform,u=!1;A(s)?a=this.getImageSync(s,i):n?(a=n,u=!0):a=s;var f=a&&e.createPattern(a,c);if(f){var h=void 0;h=l?Fh(dh(l),new wp({})):st(rt()),u&&dt(h,h,[1/r,1/r,1]),f.setTransform({a:h[0],b:h[1],c:h[4],d:h[5],e:h[12],f:h[13]})}return o&&f&&(this.patternCache[o]=f),f},t.prototype.getOrCreateGradient=function(t,e){var n=this.generateGradientKey(t),r=t.type,i=t.steps,o=t.width,a=t.height,s=t.angle,c=t.cx,l=t.cy,u=t.size;if(this.gradientCache[n])return this.gradientCache[n];var f=null;if(r===ju.LinearGradient){var h=function(t,e,n){var r=eu(n.value),i=0+t/2,o=0+e/2,a=Math.abs(t*Math.cos(r))+Math.abs(e*Math.sin(r));return{x1:i-Math.cos(r)*a/2,y1:o-Math.sin(r)*a/2,x2:i+Math.cos(r)*a/2,y2:o+Math.sin(r)*a/2}}(o,a,s),d=h.x1,p=h.y1,g=h.x2,m=h.y2;f=e.createLinearGradient(d,p,g,m)}else if(r===ju.RadialGradient){var y=function(t,e,n,r,i){var o=n.value,a=r.value;n.unit===Ou.kPercentage&&(o=n.value/100*t),r.unit===Ou.kPercentage&&(a=r.value/100*e);var s=Math.max($e([0,0],[o,a]),$e([0,e],[o,a]),$e([t,e],[o,a]),$e([t,0],[o,a]));return i&&(i instanceof Xu?s=i.value:i instanceof Gu&&("closest-side"===i.value?s=Math.min(o,t-o,a,e-a):"farthest-side"===i.value?s=Math.max(o,t-o,a,e-a):"closest-corner"===i.value&&(s=Math.min($e([0,0],[o,a]),$e([0,e],[o,a]),$e([t,e],[o,a]),$e([t,0],[o,a]))))),{x:o,y:a,r:s}}(o,a,c,l,u),v=y.x,b=y.y,x=y.r;f=e.createRadialGradient(v,b,0,v,b,x)}return f&&(i.forEach((function(t){var e=t.offset,n=t.color;e.unit===Ou.kPercentage&&(null==f||f.addColorStop(e.value/100,n.toString()))})),this.gradientCache[n]=f),this.gradientCache[n]},t.prototype.generateGradientKey=function(t){var e=t.type,n=t.width,r=t.height,i=t.steps,o=t.angle,a=t.cx,s=t.cy,c=t.size;return"gradient-".concat(e,"-").concat((null==o?void 0:o.toString())||0,"-").concat((null==a?void 0:a.toString())||0,"-").concat((null==s?void 0:s.toString())||0,"-").concat((null==c?void 0:c.toString())||0,"-").concat(n,"-").concat(r,"-").concat(i.map((function(t){var e=t.offset,n=t.color;return"".concat(e).concat(n)})).join("-"))},t.prototype.generatePatternKey=function(t){var e=t.image,n=t.repetition;return A(e)?"pattern-".concat(e,"-").concat(n):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(n):void 0},t}(),yS=function(){function t(){}return t.prototype.apply=function(e){var n=e.renderingService,r=e.renderingContext,i=e.imagePool,o=r.root.ownerDocument.defaultView,a=function(t,e,n){var r=t.parsedStyle,i=r.width,o=r.height;i&&!o?t.setAttribute("height",n/e*i):!i&&o&&t.setAttribute("width",e/n*o)},s=function(t){var e=t.target,r=e.nodeName,o=e.attributes;if(r===Hl.IMAGE){var s=o.img,c=o.keepAspectRatio;A(s)&&i.getImageSync(s,(function(t){var r=t.width,i=t.height;c&&a(e,r,i),e.renderable.dirty=!0,n.dirtify()}))}},c=function(t){var e=t.target,r=t.attrName,o=t.newValue;e.nodeName===Hl.IMAGE&&"img"===r&&A(o)&&i.getOrCreateImage(o).then((function(t){var r=t.width,i=t.height;e.attributes.keepAspectRatio&&a(e,r,i),e.renderable.dirty=!0,n.dirtify()}))};n.hooks.init.tap(t.tag,(function(){o.addEventListener($d.MOUNTED,s),o.addEventListener($d.ATTR_MODIFIED,c)})),n.hooks.destroy.tap(t.tag,(function(){o.removeEventListener($d.MOUNTED,s),o.removeEventListener($d.ATTR_MODIFIED,c)}))},t.tag="LoadImage",t}(),vS=function(t){function e(){var e=t.apply(this,ve([],ye(arguments),!1))||this;return e.name="image-loader",e}return ue(e,t),e.prototype.init=function(){this.context.imagePool=new mS(this.context.config),this.addRenderingPlugin(new yS)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(ql),bS=function(){function t(t){this.renderingContext=t.renderingContext,this.canvasConfig=t.config}return t.prototype.init=function(){var t=this.canvasConfig,e=t.container,n=t.canvas;if(n)this.$canvas=n,e&&n.parentElement!==e&&e.appendChild(n),this.$container=n.parentElement,this.canvasConfig.container=this.$container;else if(e&&(this.$container=A(e)?document.getElementById(e):e,this.$container)){var r=document.createElement("canvas");this.$container.appendChild(r),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=r}this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)},t.prototype.getContext=function(){return this.context},t.prototype.getDomElement=function(){return this.$canvas},t.prototype.getDPR=function(){return this.dpr},t.prototype.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},t.prototype.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},t.prototype.resize=function(t,e){var n=this.canvasConfig.devicePixelRatio||Qh&&window.devicePixelRatio||1;n=n>=1?Math.ceil(n):1,this.dpr=n,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*e,function(t,e,n){Qh&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")}(this.$canvas,t,e)),this.renderingContext.renderReasons.add(Ld.CAMERA_CHANGED)},t.prototype.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},t.prototype.toDataURL=function(t){return void 0===t&&(t={}),pe(this,void 0,void 0,(function(){var e,n;return ge(this,(function(r){return e=t.type,n=t.encoderOptions,[2,this.context.canvas.toDataURL(e,n)]}))}))},t}(),xS=function(t){function e(){var e=t.apply(this,ve([],ye(arguments),!1))||this;return e.name="canvas-context-register",e}return ue(e,t),e.prototype.init=function(){this.context.ContextService=bS},e.prototype.destroy=function(){delete this.context.ContextService},e}(ql),wS=function(t){function e(e){var n=t.call(this,e)||this;return n.registerPlugin(new xS),n.registerPlugin(new vS),n.registerPlugin(new Rk),n.registerPlugin(new fS),n.registerPlugin(new dS),n.registerPlugin(new oS),n.registerPlugin(new gS),n}return ue(e,t),e}(Ul),MS=function(){function t(t){this.dragndropPluginOptions=t}return t.prototype.apply=function(e){var n=this,r=e.renderingService,i=e.renderingContext.root.ownerDocument,o=i.defaultView,a=function(t){var e=t.target,r=e===i,a=r&&n.dragndropPluginOptions.isDocumentDraggable?i:e.closest&&e.closest("[draggable=true]");if(a){var s=!1,c=t.timeStamp,l=[t.clientX,t.clientY],u=null,f=[t.clientX,t.clientY],h=function(t){return pe(n,void 0,void 0,(function(){var n,o,h,d,p,g;return ge(this,(function(m){switch(m.label){case 0:if(!s){if(n=t.timeStamp-c,o=$e([t.clientX,t.clientY],l),n<=this.dragndropPluginOptions.dragstartTimeThreshold||o<=this.dragndropPluginOptions.dragstartDistanceThreshold)return[2];t.type="dragstart",a.dispatchEvent(t),s=!0}return t.type="drag",t.dx=t.clientX-f[0],t.dy=t.clientY-f[1],a.dispatchEvent(t),f=[t.clientX,t.clientY],r?[3,2]:(h="pointer"===this.dragndropPluginOptions.overlap?[t.canvasX,t.canvasY]:e.getBounds().center,[4,i.elementsFromPoint(h[0],h[1])]);case 1:d=m.sent(),p=d[d.indexOf(e)+1],g=(null==p?void 0:p.closest("[droppable=true]"))||(this.dragndropPluginOptions.isDocumentDroppable?i:null),u!==g&&(u&&(t.type="dragleave",t.target=u,u.dispatchEvent(t)),g&&(t.type="dragenter",t.target=g,g.dispatchEvent(t)),(u=g)&&(t.type="dragover",t.target=u,u.dispatchEvent(t))),m.label=2;case 2:return[2]}}))}))};o.addEventListener("pointermove",h);var d=function(t){if(s){t.detail={preventClick:!0};var e=t.clone();u&&(e.type="drop",e.target=u,u.dispatchEvent(e)),e.type="dragend",a.dispatchEvent(e),s=!1}o.removeEventListener("pointermove",h)};e.addEventListener("pointerup",d,{once:!0}),e.addEventListener("pointerupoutside",d,{once:!0})}};r.hooks.init.tap(t.tag,(function(){o.addEventListener("pointerdown",a)})),r.hooks.destroy.tap(t.tag,(function(){o.removeEventListener("pointerdown",a)}))},t.tag="Dragndrop",t}(),OS=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.options=e,n.name="dragndrop",n}return ue(e,t),e.prototype.init=function(){this.addRenderingPlugin(new MS(fe({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e.prototype.setOptions=function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)},e}(ql),ES=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}(),kS=ES;const SS={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"},AS=[["legendCategory",[[["color","discrete"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","discrete"]],[["color","discrete"],["opacity","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"]],[["color","discrete"],["opacity","constant"],["size","constant"]],[["color","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"]],[["color","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["shape","discrete"]],[["color","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"]],[["color","discrete"],["opacity","constant"]],[["color","discrete"],["shape","constant"]],[["color","constant"],["shape","discrete"]],[["color","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"]],[["color","discrete"]]]],["legendContinuousSize",[[["color","continuous"],["opacity","continuous"],["size","continuous"]],[["color","constant"],["opacity","continuous"],["size","continuous"]],[["color","continuous"],["size","continuous"]],[["color","constant"],["size","continuous"]],[["size","continuous"],["opacity","continuous"]],[["size","continuous"]]]],["legendContinuousBlockSize",[[["color","distribution"],["opacity","distribution"],["size","distribution"]],[["color","distribution"],["size","distribution"]]]],["legendContinuousBlock",[[["color","distribution"],["opacity","continuous"]],[["color","distribution"]]]],["legendContinuous",[[["color","continuous"],["opacity","continuous"]],[["color","continuous"]],[["opacity","continuous"]]]]];function _S(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):eo}function TS(t){return t instanceof Float32Array||t instanceof Array}var PS=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},CS=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 NS(t,e,n){for(;t<e;)t+=2*Math.PI;for(;t>n;)t-=2*Math.PI;return t}var LS=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},jS=function(t,e,n,r,i){var o,a,s=LS(t,2),c=s[0],l=s[1],u=et();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},RS=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},IS=function(t,e,n,r,i){var o=new ia({range:[e,e+r]}),a=new ia({range:[n,n+i]});return{transform:function(t){var e=RS(t,2),n=e[0],r=e[1];return[o.map(n),a.map(r)]},untransform:function(t){var e=RS(t,2),n=e[0],r=e[1];return[o.invert(n),a.invert(r)]}}},BS=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},DS=function(t,e,n,r,i){return(0,BS(t,1)[0])(e,n,r,i)},FS=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},zS=function(t,e,n,r,i){return FS(t,1)[0]},GS=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},WS=function(t,e,n,r,i){var o=GS(t,4),a=o[0],s=o[1],c=o[2],l=o[3],u=new ia({range:[c,l]}),f=new ia({range:[a,s]}),h=i/r,d=h>1?1:h,p=h>1?1/h:1;return{transform:function(t){var e=GS(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=GS(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=NS(Math.atan2(o,i),a,s);return[f.invert(l),u.invert(c)]}}},$S=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},HS=function(t,e,n,r,i){return{transform:function(t){var e=$S(t,2),n=e[0];return[e[1],n]},untransform:function(t){var e=$S(t,2),n=e[0];return[e[1],n]}}},YS=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},VS=function(t,e,n,r,i){var o,a,s=YS(t,2),c=s[0],l=s[1],u=et();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},qS=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},US=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))},XS=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return VS.apply(void 0,US([[-1,-1]],qS(e),!1))},KS=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return VS.apply(void 0,US([[-1,1]],qS(e),!1))},ZS=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return VS.apply(void 0,US([[1,-1]],qS(e),!1))},QS=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},JS=function(t,e,n,r,i){var o=QS(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}(et(),o)},tA=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},eA=function(t,e,n,r,i){var o=tA(t,4),a=o[0],s=o[1],c=o[2],l=(o[3]-c)/((s-0)/(2*Math.PI)+1),u=l/(2*Math.PI),f=new ia({range:[c,c+.99*l]}),h=new ia({range:[a,s]}),d=i/r,p=d>1?1:d,g=d>1?1/d:1;return{transform:function(t){var e=tA(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=tA(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=NS(Math.atan2(o,i)+Math.floor(c/l)*Math.PI*2,a,s),m=c-u*d;return[h.invert(d),f.invert(m)]}}},nA=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},rA=function(t,e,n,r,i){var o=nA(t,4),a=o[0],s=o[1],c=o[2],l=o[3],u=new ia({range:[c,l]});return{transform:function(t){for(var e=[],n=t.length,r=new oa({domain:new Array(n).fill(0).map((function(t,e){return e})),range:[a,s]}),i=0;i<n;i++){var o=t[i],c=r.map(i),l=u.map(o);e.push(c,l)}return e},untransform:function(t){for(var e=[],n=0;n<t.length;n+=2){var r=t[n+1];e.push(u.invert(r))}return e}}},iA=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};function oA(t){return 1/Math.tan(t)}var aA=function(t,e,n,r,i){var o=oA(iA(t,1)[0]);return{transform:function(t){var e=iA(t,2),n=e[0],r=e[1];return[n+r*o,r]},untransform:function(t){var e=iA(t,2),n=e[0],r=e[1];return[n-r*o,r]}}},sA=function(t,e,n,r,i){var o=oA(iA(t,1)[0]);return{transform:function(t){var e=iA(t,2),n=e[0];return[n,e[1]+n*o]},untransform:function(t){var e=iA(t,2),n=e[0];return[n,e[1]-n*o]}}},cA=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};function lA(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 uA(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 fA(t,e,n){return n?new ia({range:[0,1],domain:[0,e]}).map(t):t}var hA=function(t,e,n,r,i){var o=cA(t,3),a=o[0],s=o[1],c=o[2],l=fA(a,r,void 0!==c&&c);return{transform:function(t){var e=cA(t,2),n=e[0],r=e[1];return[lA(n,l,s,0,1),r]},untransform:function(t){var e=cA(t,2),n=e[0],r=e[1];return[uA(n,l,s,0,1),r]}}},dA=function(t,e,n,r,i){var o=cA(t,3),a=o[0],s=o[1],c=o[2],l=fA(a,i,void 0!==c&&c);return{transform:function(t){var e=cA(t,2);return[e[0],lA(e[1],l,s,0,1)]},untransform:function(t){var e=cA(t,2);return[e[0],uA(e[1],l,s,0,1)]}}},pA=function(t,e,n,r,i){var o=cA(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,h=fA(a,r,f),d=fA(s,i,f);return{transform:function(t){var e=cA(t,2),n=e[0],r=e[1];return[lA(n,h,c,0,1),lA(r,d,l,0,1)]},untransform:function(t){var e=cA(t,2),n=e[0],r=e[1];return[uA(n,h,c,0,1),uA(r,d,l,0,1)]}}},gA=function(t,e,n,r,i){var o=cA(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,h=new ia({range:[0,r]}),d=new ia({range:[0,i]}),p=f?a:h.map(a),g=f?s:d.map(s);return{transform:function(t){var e=cA(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=lA(a,0,l,0,c),u=Math.atan2(o,i),f=p+s*Math.cos(u),m=g+s*Math.sin(u);return[h.invert(f),d.invert(m)]},untransform:function(t){var e=cA(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=uA(a,0,l,0,c),u=Math.atan2(o,i),f=p+s*Math.cos(u),m=g+s*Math.sin(u);return[h.invert(f),d.invert(m)]}}},mA=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},yA=function(t,e,n,r,i,o,a){var s=new ia({range:[e,e+i]}),c=new ia({range:[n,n+o]}),l=new ia({range:[r,r+a]});return{transform:function(t){var e=mA(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=mA(t,3),n=e[0],r=e[1],i=e[2];return[s.invert(n),c.invert(r),l.invert(i)]}}},vA=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},bA=function(t,e,n,r,i,o,a){var s=vA(t,3),c=s[0],l=s[1],u=s[2];return mt(rt(),[c,l,u])},xA=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},wA=function(t,e,n,r,i,o,a){return{transform:function(t){var e=xA(t,3),n=e[0];return[e[1],n,e[2]]},untransform:function(t){var e=xA(t,3),n=e[0];return[e[1],n,e[2]]}}},MA=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},OA=function(t,e,n,r,i,o,a){var s=MA(t,3),c=s[0],l=s[1],u=s[2];return yt(rt(),[c,l,u])},EA=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},kA=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},SA=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.")},AA=function(){function t(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:IS,translate:jS,custom:DS,matrix:zS,polar:WS,transpose:HS,scale:VS,"shear.x":aA,"shear.y":sA,reflect:XS,"reflect.x":KS,"reflect.y":ZS,rotate:JS,helix:eA,parallel:rA,fisheye:pA,"fisheye.x":hA,"fisheye.y":dA,"fisheye.circular":gA},this.update(t)}return t.prototype.update=function(t){this.options=Ji({},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:kA(kA([],EA(n),!1),[kA([],EA(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?kA([],EA(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,CS([],PS(o),!1))}return n}}(t):t)};try{for(var c=SA(r),l=c.next();!l.done;l=c.next()){var u=EA(l.value),f=u[0],h=u.slice(1),d=this.transformers[f];if(d){var p=this.options,g=p.x,m=p.y,y=p.width,v=p.height,b=d(kA([],EA(h),!1),g,m,y,v);if(TS(b))o.push(b);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(b)||eo,"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 _S.apply(void 0,kA([],EA(a),!1))},t.prototype.createMatrixTransform=function(t,e){var n,r,i=et();return e&&t.reverse(),t.forEach((function(t){return nt(i,i,t)})),e&&function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=u*a-s*l,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)}(i,(n=i,(r=new tt(9))[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=n[3],r[4]=n[4],r[5]=n[5],r[6]=n[6],r[7]=n[7],r[8]=n[8],r)),function(t){var e=[t[0],t[1],1];return Ut(e,e,i),[e[0],e[1]]}},t}(),_A=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},TA=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))},PA=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.")},CA=function(){function t(t){this.options={x:0,y:0,z:0,width:300,height:150,depth:150,transformations:[]},this.transformers={cartesian3D:yA,translate3D:bA,scale3D:OA,transpose3D:wA},this.update(t)}return t.prototype.update=function(t){this.options=Ji({},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:TA(TA([],_A(n),!1),[TA([],_A(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?TA([],_A(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},o=[],a=[],s=function(t,e){return void 0===e&&(e=!0),a.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=3){var i=[e[r],e[r+1],e[r+2]],o=t(i);n.push.apply(n,CS([],PS(o),!1))}return n}}(t):t)};try{for(var c=PA(r),l=c.next();!l.done;l=c.next()){var u=_A(l.value),f=u[0],h=u.slice(1),d=this.transformers[f];if(d){var p=this.options,g=p.x,m=p.y,y=p.z,v=p.width,b=p.height,x=p.depth,w=d(TA([],_A(h),!1),g,m,y,v,b,x);if(TS(w))o.push(w);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(w)||eo,!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 _S.apply(void 0,TA([],_A(a),!1))},t.prototype.createMatrixTransform=function(t,e){var n=rt();return e&&t.reverse(),t.forEach((function(t){return Ct(n,n,t)})),e&<(n,it(n)),function(t){var e=[t[0],t[1],t[2],1];return Jt(e,e,n),[e[0],e[1],e[2]]}},t}();function NA(t){return(e,...n)=>V({},t(e,...n),e)}function LA(t){return(e,...n)=>V({},e,t(e,...n))}function jA(t,e){if(!t)return e;if(Array.isArray(t))return t;const{value:n=e}=t,r=he(t,["value"]);return Object.assign(Object.assign({},r),{value:n})}const RA=()=>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=he(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},f),{data:jA(e,a),x:null!=s?s:n,y:null!=c?c:r,width:null!=l?l:i,height:null!=u?u:o})}))};RA.props={};const IA=()=>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=he(r,["data"]),g=jA(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};IA.props={};const BA=()=>t=>{const{children:e}=t,n=he(t,["children"]);if(!Array.isArray(e))return[];const{data:r,scale:i={},axis:o={},legend:a={},encode:s={},transform:c=[]}=n,l=he(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=he(t,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:jA(e,r),scale:V({},i,n),encode:V({},s,f),transform:[...c,...h],axis:!(!l||!o)&&V({},o,l),legend:!(!u||!a)&&V({},a,u)},d)}));return[Object.assign(Object.assign({},l),{marks:u,type:"standardView"})]};BA.props={};const DA=({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:m,marginBottom:y,marginTop:v,marginRight:b,data:x,coordinate:w,theme:M,component:O,interaction:E,x:k,y:S,z:A,key:_,frame:T,labelTransform:P,parentKey:C,clip:N,viewStyle:L,title:j}=e,R=he(e,["width","height","depth","paddingLeft","paddingRight","paddingTop","paddingBottom","padding","inset","insetLeft","insetTop","insetRight","insetBottom","margin","marginLeft","marginBottom","marginTop","marginRight","data","coordinate","theme","component","interaction","x","y","z","key","frame","labelTransform","parentKey","clip","viewStyle","title"]);return[Object.assign(Object.assign({type:"standardView",x:k,y:S,z:A,key:_,width:n,height:r,depth:i,padding:l,paddingLeft:o,paddingRight:a,paddingTop:s,inset:u,insetLeft:f,insetTop:h,insetRight:d,insetBottom:p,paddingBottom:c,theme:M,coordinate:w,component:O,interaction:E,frame:T,labelTransform:P,margin:g,marginLeft:m,marginBottom:y,marginTop:v,marginRight:b,parentKey:C,clip:N,style:L},!t&&{title:j}),{marks:[Object.assign(Object.assign(Object.assign({},R),{key:`${_}-0`,data:x}),t&&{title:j})]})]};DA.props={};class FA{constructor(t){this.$value=t}static of(t){return new FA(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const zA=NA((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=Pn(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"))}}})),GA=NA((t=>{const{data:e,scale:n}=t,r=[t];let i,o,a;for(;r.length;){const t=r.shift(),{children:e,encode:n={},scale:s={},legend:c={}}=t,{color:l}=n,{color:u}=s,{color:f}=c;void 0!==l&&(i=l),void 0!==u&&(o=u),void 0!==f&&(a=f),Array.isArray(e)&&r.push(...e)}const s="string"==typeof i?i:"",[c,l]=(()=>{var t;const r=null===(t=null==n?void 0:n.color)||void 0===t?void 0:t.domain;if(void 0!==r)return[r];if(void 0===i)return[void 0];const o="function"==typeof i?i:t=>t[i],a=e.map(o);return a.some((t=>"number"==typeof t))?[kn(a)]:[Array.from(new Set(a)),"ordinal"]})();return{encode:{color:i},scale:{color:V({},o,{domain:c,type:l})},legend:{color:V({title:s},a)}}})),WA=NA((()=>({animate:{enterType:"fadeIn"}}))),$A=LA((()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}}))),HA=LA((()=>({type:"cell"}))),YA=LA((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]}}})),VA=LA(((t,e=qA,n=XA,r=KA,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:m}=c,{domain:y}=m;return{children:(t,o,a)=>{const{x:c,y:m}=o,{paddingLeft:v,paddingTop:b,marginLeft:x,marginTop:w}=a,{domain:M}=c.getOptions(),{domain:O}=m.getOptions(),E=vr(t),k=t.map(e),S=t.map((({x:t,y:e})=>[c.invert(t),m.invert(e)])),A=S.map((([t,e])=>n=>{const{[p]:r,[g]:i}=n;return(void 0===p||r===t)&&(void 0===g||i===e)})),_=A.map((t=>d.filter(t))),T=f?qn(_,(t=>t.length)):void 0,P=S.map((([t,e])=>({columnField:p,columnIndex:M.indexOf(t),columnValue:t,columnValuesLength:M.length,rowField:g,rowIndex:O.indexOf(e),rowValue:e,rowValuesLength:O.length}))),C=P.map((t=>Array.isArray(s)?s:[s(t)].flat(1)));return E.flatMap((t=>{const[e,o,a,s]=k[t],c=P[t],f=_[t];return C[t].map((m=>{var M,O,{scale:E,key:k,facet:S=!0,axis:A={},legend:_={}}=m,P=he(m,["scale","key","facet","axis","legend"]);const C=(null===(M=null==E?void 0:E.y)||void 0===M?void 0:M.guide)||A.y,N=(null===(O=null==E?void 0:E.x)||void 0===O?void 0:O.guide)||A.x,L={x:{tickCount:p?5:void 0},y:{tickCount:g?5:void 0}},j=S?f:0===f.length?[]:d,R={color:{domain:y}},I={x:ZA(N,n)(c,j),y:ZA(C,r)(c,j)};return Object.assign(Object.assign({key:`${k}-${t}`,data:j,margin:0,x:e+v+l+x,y:o+b+u+w,parentKey:h,width:a,height:s,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!j.length,dataDomain:T,scale:V(L,E,R),axis:V({},A,I),legend:!1},P),i)}))}))}}}));function qA(t){const{points:e}=t;return vs(e)}function UA(t,e){return e.length?V({title:!1,tick:null,label:null},t):V({title:!1,tick:null,label:null,grid:null},t)}function XA(t){return(e,n)=>{const{rowIndex:r,rowValuesLength:i,columnIndex:o,columnValuesLength:a}=e;if(r!==i-1)return UA(t,n);const s=o===a-1&&void 0,c=n.length?void 0:null;return V({title:s,grid:c},t)}}function KA(t){return(e,n)=>{const{rowIndex:r,columnIndex:i}=e;if(0!==i)return UA(t,n);const o=0===r&&void 0,a=n.length?void 0:null;return V({title:o,grid:a},t)}}function ZA(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const QA=()=>t=>[FA.of(t).call(HA).call(GA).call(WA).call(zA).call($A).call(YA).call(VA).value()];QA.props={};const JA=NA((t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),t_=LA((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(),m=vr(t),y=t.map((({points:t})=>vs(t))),v=t.map((({x:t,y:e})=>[c.invert(t),l.invert(e)])),b=v.map((([t,e])=>({columnField:t,columnIndex:p.indexOf(t),columnValue:t,columnValuesLength:p.length,rowField:e,rowIndex:g.indexOf(e),rowValue:e,rowValuesLength:g.length}))),x=b.map((t=>Array.isArray(n)?n:[n(t)].flat(1)));return m.flatMap((t=>{const[n,a,s,c]=y[t],[l,p]=v[t],g=b[t];return x[t].map((m=>{var y,v;const{scale:b,key:x,encode:w,axis:M,interaction:O}=m,E=he(m,["scale","key","encode","axis","interaction"]),k=null===(y=null==b?void 0:b.y)||void 0===y?void 0:y.guide,S={x:n_(null===(v=null==b?void 0:b.x)||void 0===v?void 0:v.guide)(g,e),y:r_(k)(g,e)};return Object.assign({data:e,parentKey:o,key:`${x}-${t}`,x:n+u+r+h,y:a+f+i+d,width:s,height:c,margin:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:V({x:{facet:!1},y:{facet:!1}},b),axis:V({x:{tickCount:5},y:{tickCount:5}},M,S),legend:!1,encode:V({},w,{x:l,y:p}),interaction:V({},O,{legendFilter:!1})},E)}))}))}}})),e_=LA((t=>{const{encode:e}=t,n=he(t,["encode"]),{position:r=[],x:i=r,y:o=[...r].reverse()}=e,a=he(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 n_(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{rowIndex:r,rowValuesLength:i}=e;if(r!==i-1)return UA(t,n)}}function r_(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{columnIndex:r}=e;if(0!==r)return UA(t,n)}}const i_=()=>t=>[FA.of(t).call(HA).call(GA).call(t_).call(e_).call(WA).call($A).call(JA).value()],o_=NA((t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),a_=NA((t=>({coordinate:{type:"polar"}}))),s_=t=>{const{encode:e}=t,n=he(t,["encode"]),{position:r}=e;return Object.assign(Object.assign({},n),{encode:{x:r}})};function c_(t){return t=>null}function l_(t){const{points:e}=t,[n,r,i,o]=e,a=ps(n,o),s=hs(n,o),c=ys(s,hs(r,i)),l=1/Math.sin(c/2),u=a/(1+l),f=u*Math.sqrt(2),[h,d]=i,p=ms(s)+c/2,g=u*l;return[h+g*Math.sin(p)-f/2,d-g*Math.cos(p)-f/2,f,f]}const u_=()=>t=>[FA.of(t).call(HA).call(s_).call(GA).call(a_).call(YA).call(VA,l_,c_,c_,{frame:!1}).call(WA).call($A).call(o_).value()];function f_(t,e,n){const r=[0,n],i=[1-n,1];return"normal"===t?r:"reverse"===t?i:"alternate"===t?e%2==0?r:i:"reverse-alternate"===t?e%2==0?i:r:void 0}const h_=()=>t=>{const{children:e=[],duration:n=1e3,iterationCount:r=1,direction:i="normal",easing:o="ease-in-out-sine"}=t,a=e.length;if(!Array.isArray(e)||0===a)return[];const{key:s}=e[0],c=e.map((t=>Object.assign(Object.assign({},t),{key:s}))).map((t=>function(t,e,n){const r=[t];for(;r.length;){const t=r.pop();t.animate=V({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]=f_(i,e,a);for(let e=n;e<r;e+=1){const n=Math.abs(e);t!==n&&(yield c[n]),t=n}e++}}};function d_(t,e){const{__data__:n}=t,{markKey:r,index:i,seriesIndex:o}=n,{markState:a}=e,s=Array.from(a.keys()).find((t=>t.key===r));if(s)return o?o.map((t=>s.data[t])):s.data[i]}function p_(t,e){if(e(t))return t;let n=t.parent;for(;n&&!e(n);)n=n.parent;return n}function g_(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=p_(o,(t=>"element"===t.className));const c=function(t){return p_(t,(t=>"component"===t.className))}(o),l=function(t){return p_(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:d_(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 m_(){return(t,e,n)=>{const{container:r,view:i}=t,o=g_(SS.CLICK,i,n,(t=>1===t.detail)),a=g_(SS.DBLCLICK,i,n,(t=>2===t.detail)),s=g_(SS.POINTER_TAP,i,n),c=g_(SS.POINTER_DOWN,i,n),l=g_(SS.POINTER_UP,i,n),u=g_(SS.POINTER_OVER,i,n),f=g_(SS.POINTER_OUT,i,n),h=g_(SS.POINTER_MOVE,i,n),d=g_(SS.POINTER_ENTER,i,n),p=g_(SS.POINTER_LEAVE,i,n),g=g_(SS.POINTER_UPOUTSIDE,i,n),m=g_(SS.DRAG_START,i,n),y=g_(SS.DRAG,i,n),v=g_(SS.DRAG_END,i,n),b=g_(SS.DRAG_ENTER,i,n),x=g_(SS.DRAG_LEAVE,i,n),w=g_(SS.DRAG_OVER,i,n),M=g_(SS.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",m),r.addEventListener("drag",y),r.addEventListener("dragend",v),r.addEventListener("dragenter",b),r.addEventListener("dragleave",x),r.addEventListener("dragover",w),r.addEventListener("drop",M),()=>{r.removeEventListener("click",o),r.removeEventListener("click",a),r.removeEventListener("pointertap",s),r.removeEventListener("pointerdown",c),r.removeEventListener("pointerup",l),r.removeEventListener("pointerover",u),r.removeEventListener("pointerout",f),r.removeEventListener("pointermove",h),r.removeEventListener("pointerenter",d),r.removeEventListener("pointerleave",p),r.removeEventListener("pointerupoutside",g),r.removeEventListener("dragstart",m),r.removeEventListener("drag",y),r.removeEventListener("dragend",v),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",x),r.removeEventListener("dragover",w),r.removeEventListener("drop",M)}}}function y_(t,e){const n=Object.assign(Object.assign({},{"component.axisRadar":ME,"component.axisLinear":yE,"component.axisArc":vE,"component.legendContinuousBlock":NE,"component.legendContinuousBlockSize":jE,"component.legendContinuousSize":LE,"interaction.event":m_,"composition.mark":DA,"composition.view":BA,"shape.label.label":Fw}),e),r=e=>{if("string"!=typeof e)return e;const r=`${t}.${e}`;return n[r]||ar(`Unknown Component: ${r}`)};return[(t,e)=>{const{type:n}=t,i=he(t,["type"]);n||ar("Plot type is required!");const o=r(n);return null==o?void 0:o(i,e)},r]}function v_(t){const{canvas:e,group:n}=t;return(null==e?void 0:e.document)||(null==n?void 0:n.ownerDocument)||ar("Cannot find library document")}function b_(t,e){const{coordinate:n={}}=t,r=he(t,["coordinate"]),{type:i,transform:o=[]}=n,a=he(n,["type","transform"]);if(!i)return Object.assign(Object.assign({},r),{coordinates:o});const[,s]=y_("coordinate",e),{transform:c=!1}=s(i).props||{};if(c)throw new Error(`Unknown coordinate: ${i}.`);return Object.assign(Object.assign({},r),{coordinates:[Object.assign({type:i},a),...o]})}function x_(t,e){return t.filter((t=>t.type===e))}function w_(t){return x_(t,"polar").length>0}function M_(t){return x_(t,"transpose").length%2==1}function O_(t){return x_(t,"theta").length>0}function E_(t){return x_(t,"radial").length>0}function k_(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}h_.props={},m_.props={reapplyWhenUpdate:!0};var S_=k_("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),A_=k_("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),__=k_("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),T_=k_("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),P_=k_("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),C_=k_("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),N_=k_("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),L_=k_("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),j_=k_("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),R_=k_("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function I_(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function B_(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function D_(){}var F_=.7,z_=1/F_,G_="\\s*([+-]?\\d+)\\s*",W_="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",$_="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",H_=/^#([0-9a-f]{3,8})$/,Y_=new RegExp(`^rgb\\(${G_},${G_},${G_}\\)$`),V_=new RegExp(`^rgb\\(${$_},${$_},${$_}\\)$`),q_=new RegExp(`^rgba\\(${G_},${G_},${G_},${W_}\\)$`),U_=new RegExp(`^rgba\\(${$_},${$_},${$_},${W_}\\)$`),X_=new RegExp(`^hsl\\(${W_},${$_},${$_}\\)$`),K_=new RegExp(`^hsla\\(${W_},${$_},${$_},${W_}\\)$`),Z_={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 Q_(){return this.rgb().formatHex()}function J_(){return this.rgb().formatRgb()}function tT(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=H_.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?eT(e):3===n?new oT(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?nT(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?nT(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=Y_.exec(t))?new oT(e[1],e[2],e[3],1):(e=V_.exec(t))?new oT(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=q_.exec(t))?nT(e[1],e[2],e[3],e[4]):(e=U_.exec(t))?nT(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=X_.exec(t))?fT(e[1],e[2]/100,e[3]/100,1):(e=K_.exec(t))?fT(e[1],e[2]/100,e[3]/100,e[4]):Z_.hasOwnProperty(t)?eT(Z_[t]):"transparent"===t?new oT(NaN,NaN,NaN,0):null}function eT(t){return new oT(t>>16&255,t>>8&255,255&t,1)}function nT(t,e,n,r){return r<=0&&(t=e=n=NaN),new oT(t,e,n,r)}function rT(t){return t instanceof D_||(t=tT(t)),t?new oT((t=t.rgb()).r,t.g,t.b,t.opacity):new oT}function iT(t,e,n,r){return 1===arguments.length?rT(t):new oT(t,e,n,null==r?1:r)}function oT(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function aT(){return`#${uT(this.r)}${uT(this.g)}${uT(this.b)}`}function sT(){const t=cT(this.opacity);return`${1===t?"rgb(":"rgba("}${lT(this.r)}, ${lT(this.g)}, ${lT(this.b)}${1===t?")":`, ${t})`}`}function cT(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function lT(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function uT(t){return((t=lT(t))<16?"0":"")+t.toString(16)}function fT(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new dT(t,e,n,r)}function hT(t){if(t instanceof dT)return new dT(t.h,t.s,t.l,t.opacity);if(t instanceof D_||(t=tT(t)),!t)return new dT;if(t instanceof dT)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 dT(a,s,c,t.opacity)}function dT(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function pT(t){return(t=(t||0)%360)<0?t+360:t}function gT(t){return Math.max(0,Math.min(1,t||0))}function mT(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}I_(D_,tT,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Q_,formatHex:Q_,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return hT(this).formatHsl()},formatRgb:J_,toString:J_}),I_(oT,iT,B_(D_,{brighter(t){return t=null==t?z_:Math.pow(z_,t),new oT(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?F_:Math.pow(F_,t),new oT(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new oT(lT(this.r),lT(this.g),lT(this.b),cT(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:aT,formatHex:aT,formatHex8:function(){return`#${uT(this.r)}${uT(this.g)}${uT(this.b)}${uT(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:sT,toString:sT})),I_(dT,(function(t,e,n,r){return 1===arguments.length?hT(t):new dT(t,e,n,null==r?1:r)}),B_(D_,{brighter(t){return t=null==t?z_:Math.pow(z_,t),new dT(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?F_:Math.pow(F_,t),new dT(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 oT(mT(t>=240?t-240:t+120,i,r),mT(t,i,r),mT(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new dT(pT(this.h),gT(this.s),gT(this.l),cT(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=cT(this.opacity);return`${1===t?"hsl(":"hsla("}${pT(this.h)}, ${100*gT(this.s)}%, ${100*gT(this.l)}%${1===t?")":`, ${t})`}`}}));const yT=Math.PI/180,vT=180/Math.PI;var bT=-.14861,xT=1.78277,wT=-.29227,MT=-.90649,OT=1.97294,ET=OT*MT,kT=OT*xT,ST=xT*wT-MT*bT;function AT(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof _T)return new _T(t.h,t.s,t.l,t.opacity);t instanceof oT||(t=rT(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(ST*r+ET*e-kT*n)/(ST+ET-kT),o=r-i,a=(OT*(n-i)-wT*o)/MT,s=Math.sqrt(a*a+o*o)/(OT*i*(1-i)),c=s?Math.atan2(a,o)*vT-120:NaN;return new _T(c<0?c+360:c,s,i,t.opacity)}(t):new _T(t,e,n,null==r?1:r)}function _T(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}I_(_T,AT,B_(D_,{brighter(t){return t=null==t?z_:Math.pow(z_,t),new _T(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?F_:Math.pow(F_,t),new _T(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*yT,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new oT(255*(e+n*(bT*r+xT*i)),255*(e+n*(wT*r+MT*i)),255*(e+n*(OT*r)),this.opacity)}}));var TT=t=>()=>t;function PT(t,e){return function(n){return t+n*e}}function CT(t){return 1==(t=+t)?NT: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):TT(isNaN(e)?n:e)}}function NT(t,e){var n=e-t;return n?PT(t,n):TT(isNaN(t)?e:t)}!function t(e){var n=CT(e);function r(t,e){var r=n((t=iT(t)).r,(e=iT(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=NT(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 LT,jT=(LT=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return function(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}((n-r/e)*e,a,i,o,s)}},function(t){var e,n,r=t.length,i=new Array(r),o=new Array(r),a=new Array(r);for(e=0;e<r;++e)n=iT(t[e]),i[e]=n.r||0,o[e]=n.g||0,a[e]=n.b||0;return i=LT(i),o=LT(o),a=LT(a),n.opacity=1,function(t){return n.r=i(t),n.g=o(t),n.b=a(t),n+""}});function RT(t){return function e(n){function r(e,r){var i=t((e=AT(e)).h,(r=AT(r)).h),o=NT(e.s,r.s),a=NT(e.l,r.l),s=NT(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)}RT((function(t,e){var n=e-t;return n?PT(t,n>180||n<-180?n-360*Math.round(n/360):n):TT(isNaN(t)?e:t)}));var IT=RT(NT),BT=t=>jT(t[t.length-1]),DT=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(k_),FT=BT(DT),zT=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(k_),GT=BT(zT),WT=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(k_),$T=BT(WT),HT=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(k_),YT=BT(HT),VT=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(k_),qT=BT(VT),UT=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(k_),XT=BT(UT),KT=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(k_),ZT=BT(KT),QT=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(k_),JT=BT(QT),tP=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(k_),eP=BT(tP),nP=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(k_),rP=BT(nP),iP=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(k_),oP=BT(iP),aP=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(k_),sP=BT(aP),cP=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(k_),lP=BT(cP),uP=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(k_),fP=BT(uP),hP=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(k_),dP=BT(hP),pP=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(k_),gP=BT(pP),mP=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(k_),yP=BT(mP),vP=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(k_),bP=BT(vP),xP=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(k_),wP=BT(xP),MP=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(k_),OP=BT(MP),EP=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(k_),kP=BT(EP),SP=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(k_),AP=BT(SP),_P=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(k_),TP=BT(_P),PP=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(k_),CP=BT(PP),NP=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(k_),LP=BT(NP),jP=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(k_),RP=BT(jP),IP=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(k_),BP=BT(IP);var DP=IT(AT(300,.5,0),AT(-240,.5,1)),FP=IT(AT(-100,.75,.35),AT(80,1.5,.8)),zP=IT(AT(260,.75,.35),AT(80,1.5,.8)),GP=AT();var WP=iT(),$P=Math.PI/3,HP=2*Math.PI/3;function YP(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var VP=YP(k_("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),qP=YP(k_("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),UP=YP(k_("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),XP=YP(k_("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),KP=Object.freeze({__proto__:null,schemeCategory10:S_,schemeAccent:A_,schemeDark2:__,schemePaired:T_,schemePastel1:P_,schemePastel2:C_,schemeSet1:N_,schemeSet2:L_,schemeSet3:j_,schemeTableau10:R_,interpolateBrBG:FT,schemeBrBG:DT,interpolatePRGn:GT,schemePRGn:zT,interpolatePiYG:$T,schemePiYG:WT,interpolatePuOr:YT,schemePuOr:HT,interpolateRdBu:qT,schemeRdBu:VT,interpolateRdGy:XT,schemeRdGy:UT,interpolateRdYlBu:ZT,schemeRdYlBu:KT,interpolateRdYlGn:JT,schemeRdYlGn:QT,interpolateSpectral:eP,schemeSpectral:tP,interpolateBuGn:rP,schemeBuGn:nP,interpolateBuPu:oP,schemeBuPu:iP,interpolateGnBu:sP,schemeGnBu:aP,interpolateOrRd:lP,schemeOrRd:cP,interpolatePuBuGn:fP,schemePuBuGn:uP,interpolatePuBu:dP,schemePuBu:hP,interpolatePuRd:gP,schemePuRd:pP,interpolateRdPu:yP,schemeRdPu:mP,interpolateYlGnBu:bP,schemeYlGnBu:vP,interpolateYlGn:wP,schemeYlGn:xP,interpolateYlOrBr:OP,schemeYlOrBr:MP,interpolateYlOrRd:kP,schemeYlOrRd:EP,interpolateBlues:AP,schemeBlues:SP,interpolateGreens:TP,schemeGreens:_P,interpolateGreys:CP,schemeGreys:PP,interpolatePurples:LP,schemePurples:NP,interpolateReds:RP,schemeReds:jP,interpolateOranges:BP,schemeOranges:IP,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:DP,interpolateRainbow:function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return GP.h=360*t-100,GP.s=1.5-1.5*e,GP.l=.8-.9*e,GP+""},interpolateWarm:FP,interpolateCool:zP,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,WP.r=255*(e=Math.sin(t))*e,WP.g=255*(e=Math.sin(t+$P))*e,WP.b=255*(e=Math.sin(t+HP))*e,WP+""},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:VP,interpolateMagma:qP,interpolateInferno:UP,interpolatePlasma:XP});function ZP(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 pC(t,pr)}(e))return"identity";if("string"==typeof o)return"linear";if((i||o||[]).length>2)return cC(t,s);if(void 0!==i)return hC([i])?cC(t,s):dC(e)?"time":lC(t,o,a);return hC(e)?cC(t,s):dC(e)?"time":lC(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 uC(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)cr(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 fC(n);case"quantile":return function(t){return fC(t).sort()}(n);case"sequential":return uC(function(t){let e=1/0,n=-1/0;for(const r of t)for(const t of r)cr(t)&&(e=Math.min(e,+t),n=Math.max(n,+t));return e===1/0?[]:[e<0?-n:e,n]}(n),r);default:return[]}}(s,0,e,n),l=function(t,e,n){const{ratio:r}=n;if(null==r)return e;if(iC({type:t}))return function(t,e,n){const r=t.map(Number),i=new ia({domain:r,range:[r[0],r[0]+(r[r.length-1]-r[0])*e]});return"time"===n?t.map((t=>new Date(i.map(t)))):t.map((t=>i.map(t)))}(e,r,t);return oC({type:t})?function(t,e){const n=Math.round(t.length*e);return t.slice(0,n)}(e,r):e}(s,c,n);return Object.assign(Object.assign(Object.assign({},n),function(t,e,n,r,i){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return function(t,e){const{interpolate:n=Ao,nice:r=!1,tickCount:i=5}=e;return Object.assign(Object.assign({},e),{interpolate:n,nice:r,tickCount:i})}(0,r);case"band":case"point":return function(t,e,n,r){if(void 0!==r.padding||void 0!==r.paddingInner||void 0!==r.paddingOuter)return Object.assign(Object.assign({},r),{unknown:NaN});const i=function(t,e,n){return"enterDelay"===e||"enterDuration"===e||"size"===e?0:"band"===t?O_(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=B(e),i=KP[`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:aC(s,t,e,n,l,i,o),expectedDomain:c,guide:a,name:t,type:s})}function QP(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 JP(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=qn(i)+1,a=`${e}${o}`;t[a]=r,r.getOptions().key=a}else t[e]=r}return t}function tC(t,e){const[n]=y_("scale",e),{relations:r}=t,[i]=function(t){if(!t||!Array.isArray(t))return[rr,rr];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 eC(t){const e=t.flatMap((t=>Array.from(t.values()))).flatMap((t=>t.channels.map((t=>t.scale))));rC(e,"x"),rC(e,"y")}function nC(t){const{channels:e=[],type:n,scale:r={}}=t,i=["shape","color","opacity","size"];return 0!==e.length?e:"axisX"===n?["x"]:"axisY"===n?["y"]:"legends"===n?Object.keys(r).filter((t=>i.includes(t))):[]}function rC(t,e){const n=t.filter((({name:t,facet:n=!0})=>n&&t===e)),r=n.flatMap((t=>t.domain)),i=n.every(iC)?kn(r):n.every(oC)?Array.from(new Set(r)):null;if(null!==i)for(const t of n)t.domain=i}function iC(t){const{type:e}=t;if("string"!=typeof e)return!1;return["linear","log","pow","time"].includes(e)}function oC(t){const{type:e}=t;if("string"!=typeof e)return!1;return["band","point","ordinal"].includes(e)}function aC(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=sC(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?[br(e),xr(e)]:"opacity"===t?[0,1]:"size"===t?[1,10]:[0,1]}(e,t);return[c||s,l||u]}case"band":case"point":return[c||("size"===e?5:0),l||("size"===e?10:1)];case"ordinal":return sC(n,r,i,o,a);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}function sC(t,e,n,r,i){const[o]=y_("palette",i),{category10:a,category20:s}=r,c=function(t){return Array.from(new Set(t))}(t.flat()).length<=a.length?a:s,{palette:l=c,offset:u}=e;if(Array.isArray(l))return l;try{return o({type:l})}catch(t){const e=function(t,e,n=(t=>t)){if(!t)return null;const r=B(t),i=KP[`scheme${r}`],o=KP[`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 cC(t,e){return e||(function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")}(t)?"point":"ordinal")}function lC(t,e,n){return n||("color"!==t||e?"linear":"sequential")}function uC(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 fC(t){return Array.from(new Set(t.flat()))}function hC(t){return pC(t,(t=>{const e=typeof t;return"string"===e||"boolean"===e}))}function dC(t){return pC(t,(t=>t instanceof Date))}function pC(t,e){for(const n of t)if(n.some(e))return!0;return!1}const gC={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},mC={threshold:"threshold",quantize:"quantize",quantile:"quantile"},yC={ordinal:"ordinal",band:"band",point:"point"},vC={constant:"constant"};function bC(t,e,n){const{coordinates:r=[],title:i}=e,[,o]=y_("component",n),a=t.filter((({guide:t})=>null!==t)),s=[],c=function(t,e,n){const[,r]=y_("component",n),{coordinates:i}=t;function o(t,e,n,o){const a=function(t,e,n=[]){return"x"===t?M_(n)?`${e}Y`:`${e}X`:"y"===t?M_(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[...MC(n),...EC(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=V({},...e),{guide:m,field:y}=g,v=Array.isArray(m)?m:[m];for(const n of v){const[o,g]=AC(t,i,l,n,e,a,r);if(!o&&!g)continue;const m="left"===o||"right"===o,v=m?d[1]:d[0],b=m?p[1]:p[0],{size:x,order:w=f,length:M=h,padding:O=v,crossPadding:E=b}=n;s.push(Object.assign(Object.assign({title:y},n),{defaultSize:u,length:M,position:o,plane:c,orientation:g,padding:O,order:w,crossPadding:E,size:x,type:t,scales:e}))}})),s}function xC(t,e,n,r,i){const[o]=y_("component",r),{scaleInstances:a,scale:s,bbox:c}=t,l={bbox:c,library:r};return o(he(t,["scaleInstances","scale","bbox"]))({coordinate:e,library:r,markState:i,scales:a,theme:n,value:l,scale:s})}function wC(t,e){const n=["left","right","bottom","top"],r=Cn(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=nr(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=qn(t,(t=>t.size)),r=qn(t,(t=>t.order)),i=qn(t,(t=>t.crossPadding));return{type:"group",size:n,order:r,position:t[0].position,children:t,crossPadding:i}}))}function MC(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=Cn(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(...Mr(t,n));return e}(t).sort(((t,e)=>e.length-t.length)),n=e.map((t=>({combination:t,option:t.map((t=>[t.name,OC(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 AS)for(const{option:r,combination:i}of n)if(e.some((t=>U(s(t),s(r)))))return[t,i];return null})).filter(cr);return c}function OC(t){const{type:e}=t;return"string"!=typeof e?null:e in gC?"continuous":e in yC?"discrete":e in mC?"distribution":e in vC?"constant":null}function EC(t,e){return t.map((t=>{const{name:n}=t;if(function(t){return x_(t,"helix").length>0}(e)||O_(e))return null;if(M_(e)&&(w_(e)||E_(e)))return null;if(n.startsWith("x"))return w_(e)?["axisArc",[t]]:E_(e)?["axisLinear",[t]]:[M_(e)?"axisY":"axisX",[t]];if(n.startsWith("y"))return w_(e)?["axisLinear",[t]]:E_(e)?["axisArc",[t]]:[M_(e)?"axisX":"axisY",[t]];if(n.startsWith("z"))return["axisZ",[t]];if(n.startsWith("position")){if(function(t){return x_(t,"radar").length>0}(e))return["axisRadar",[t]];if(!w_(e))return["axisY",[t]]}return null})).filter(cr)}function kC(t){const e=x_(t,"polar");if(e.length){const t=e[e.length-1],{startAngle:r,endAngle:i}=n(t);return[r,i]}const r=x_(t,"radial");if(r.length){const t=r[r.length-1],{startAngle:e,endAngle:n}=a(t);return[e,n]}return[-Math.PI/2,Math.PI/2*3]}function SC(t,e,n,r,i){const{name:o}=n[0];if("axisRadar"===t){const t=r.filter((t=>t.name.startsWith("position"))),e=function(t){const e=/position(\d*)/g.exec(t);return e?+e[1]:null}(o);if(o===t.slice(-1)[0].name||null===e)return[null,null];const[n,a]=kC(i);return["center",(a-n)/(t.length-1)*e+n]}if("axisY"===t&&function(t){return x_(t,"parallel").length>0}(i))return M_(i)?["center","horizontal"]:["center","vertical"];if("axisLinear"===t){const[t]=kC(i);return["center",t]}return"axisArc"===t?"inner"===e[0]?["inner",null]:["outer",null]:w_(i)||E_(i)?["center",null]:"axisX"===t&&function(t){return x_(t,"reflect").length>0}(i)||"axisX"===t&&function(t){return x_(t,"reflectY").length>0}(i)?["top",null]:e}function AC(t,e,n,r,i,o,a){const[s]=kC(a),c=[r.position||e,null!=s?s:n];return"string"==typeof t&&t.startsWith("axis")?SC(t,c,i,o,a):"string"==typeof t&&t.startsWith("legend")&&w_(a)&&"center"===r.position?["center","vertical"]:c}function _C(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")?LC:s.startsWith("group")?TC:s.startsWith("legendContinuous")?jC:"legendCategory"===s?RC:s.startsWith("slider")?NC:"title"===s?CC:s.startsWith("scrollbar")?PC:()=>{})(t,e,n,r,i,o)}function TC(t,e,n,r,i,o){const{children:a}=t,s=qn(a,(t=>t.crossPadding));a.forEach((t=>t.crossPadding=s)),a.forEach((t=>_C(t,e,n,r,i,o)));const c=qn(a,(t=>t.size));t.size=c,a.forEach((t=>t.size=c))}function PC(t,e,n,r,i,o){const{trackSize:a=6}=V({},i.scrollbar,t);t.size=a}function CC(t,e,n,r,i,o){const a=V({},i.title,t),{title:s,subtitle:c,spacing:l=0}=a,u=he(a,["title","subtitle","spacing"]);if(s){const e=GC(s,ur(u,"title"));t.size=e.height}if(c){const e=GC(c,ur(u,"subtitle"));t.size+=l+e.height}}function NC(t,e,n,r,i,o){const{trackSize:a,handleIconSize:s}=(()=>{const{slider:e}=i;return V({},e,t)})(),c=Math.max(a,2.4*s);t.size=c}function LC(t,e,n,r,i,o){t.transform=t.transform||[{type:"hide"}];const a="left"===r||"right"===r,s=FC(t,r,i),{tickLength:c=0,labelSpacing:l=0,titleSpacing:u=0,labelAutoRotate:f}=s,h=he(s,["tickLength","labelSpacing","titleSpacing","labelAutoRotate"]),d=IC(t,o),p=BC(h,d),g=c+l;if(p&&p.length){const r=qn(p,(t=>t.width)),i=qn(p,(t=>t.height));if(a)t.size=r+g;else{const{tickFilter:o,labelTransform:a}=t;!function(t,e,n,r,i){const o=nr(e,(t=>t.width));if(o>n)return!0;const a=t.clone();a.update({range:[0,n]});const s=zC(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}(d,p,e,n,o)||a||!1===f||null===f?t.size=i+g:(t.labelTransform="rotate(90)",t.size=r+g)}}else t.size=c;const m=DC(h);m&&(t.size+=a?u+m.width:u+m.height)}function jC(t,e,n,r,i,o){const a=(()=>{const{legendContinuous:e}=i;return V({},e,t)})(),{labelSpacing:s=0,titleSpacing:c=0}=a,l=he(a,["labelSpacing","titleSpacing"]),u="left"===r||"right"===r,f=ur(l,"ribbon"),{size:h}=f,d=ur(l,"handleIcon"),{size:p}=d,g=Math.max(h,2.4*p);t.size=g;const m=BC(l,IC(t,o));if(m){const e=u?"width":"height",n=qn(m,(t=>t[e]));t.size+=n+s}const y=DC(l);y&&(u?t.size=Math.max(t.size,y.width):t.size+=c+y.height)}function RC(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 V({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=he(a,["itemSpacing","itemMarkerSize","titleSpacing","rowPadding","colPadding","maxCols","maxRows"]),{cols:g,length:m}=t,y=t=>Math.min(t,d),v=t=>Math.min(t,h),b="left"===r||"right"===r,x=void 0===m?e+(b?0:n[0]+n[1]):m,w=DC(p),M=BC(p,IC(t,o),"itemLabel"),O=Math.max(M[0].height,c)+u,E=(t,e=0)=>c+t+s[0]+e;b?(()=>{let e=-1/0,n=0,r=1,i=0,o=-1/0,a=-1/0;const s=w?w.height:0,c=x-s;for(const{width:t}of M){const s=E(t,f);e=Math.max(e,s),n+O>c?(r++,o=Math.max(o,i),a=Math.max(a,n),i=1,n=O):(n+=O,i++)}r<=1&&(o=i,a=n),t.size=e*v(r),t.length=a+s,V(t,{cols:v(r),gridRow:o})})():"number"==typeof g?(()=>{const e=Math.ceil(M.length/g),n=qn(M,(t=>E(t.width)))*g;t.size=O*y(e)-u,t.length=Math.min(n,x)})():(()=>{let e=1,n=0,r=-1/0;for(const{width:t}of M){const i=E(t,f);n+i>x?(r=Math.max(r,n),n=i,e++):n+=i}1===e&&(r=n),t.size=O*y(e)-u,t.length=r})(),w&&(b?t.size=Math.max(t.size,w.width):t.size+=l+w.height)}function IC(t,e){const[n]=y_("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 BC(t,e,n="label"){const{labelFormatter:r,tickFilter:i,label:o=!0}=t,a=he(t,["labelFormatter","tickFilter","label"]);if(!o)return null;const s=function(t,e,n){const r=zC(t,n),i=r.map((t=>"number"==typeof t?rm(t):t)),o=e?"string"==typeof e?ZO(e):e:t.getFormatter?t.getFormatter():t=>`${t}`;return i.map(o)}(e,r,i),c=ur(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)=>GC(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 DC(t){const{title:e}=t,n=he(t,["title"]);if((t=>!1===t||null===t)(e)||void 0===e)return null;const r=ur(n,"title"),{direction:i,transform:o}=r,a=Array.isArray(e)?e.join(","):e;if("string"!=typeof a)return null;return GC(a,Object.assign(Object.assign({},r),{transform:o||("vertical"===i?"rotate(-90)":"")}))}function FC(t,e,n){const{title:r}=t,[i,o]=Array.isArray(r)?[r,void 0]:[void 0,r],{axis:a,[`axis${or(e)}`]:s}=n;return V({title:i},a,s,Object.assign(Object.assign({},t),{title:o}))}function zC(t,e){const n=t.getTicks?t.getTicks():t.getOptions().domain;return e?n.filter(e):n}function GC(t,e){const n=function(t){return t instanceof wp?t:new jp({style:{text:`${t}`}})}(t),r=he(e,["filter"]);n.attr(Object.assign(Object.assign({},r),{visibility:"none"}));return n.getBBox()}function WC(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:m=h,margin:y=(null!==(o=n.margin)&&void 0!==o?o:0),marginLeft:v=y,marginBottom:b=y,marginTop:x=y,marginRight:w=y,padding:M=n.padding,paddingBottom:O=M,paddingLeft:E=M,paddingRight:k=M,paddingTop:S=M}=function(t,e,n,r){const{coordinates:i}=e;if(!w_(i)&&!E_(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=>FC(t,"axisArc"===t.type?"arc":"linear",n))),s=qn(a,(t=>{var e;return null!==(e=t.labelSpacing)&&void 0!==e?e:0})),c=o.flatMap(((t,e)=>BC(a[e],IC(t,r)))).filter(cr),l=qn(c,(t=>t.height))+s,u=o.flatMap(((t,e)=>DC(a[e]))).filter((t=>null!==t)),f=0===u.length?0:qn(u,(t=>t.height)),{inset:h=l,insetLeft:d=h,insetBottom:p=h,insetTop:g=h+f,insetRight:m=h}=e;return Object.assign(Object.assign({},e),{insetLeft:d,insetBottom:p,insetTop:g,insetRight:m})}(t,e,n,r),A=(t,n,r,i,o)=>{const{marks:a}=e;if(0===a.length)return[i,o];if(t-i-o-.25*t>0)return[i,o];const s=.75*t;return["auto"===n?s*i/(i+o):i,"auto"===r?s*o/(i+o):o]},_=t=>"auto"===t?20:null!=t?t:20,T=_(S),P=_(O),C=$C(t,s-T-P,[T+x,P+b],["left","right"],e,n,r),{paddingLeft:N,paddingRight:L}=C,j=a-v-w,[R,I]=A(j,E,k,N,L),B=j-R-I,D=$C(t,B,[R+v,I+w],["bottom","top"],e,n,r),{paddingTop:F,paddingBottom:z}=D,G=s-b-x,[W,$]=A(G,O,S,z,F);return{width:a,height:s,depth:c,insetLeft:d,insetTop:p,insetBottom:g,insetRight:m,innerWidth:B,innerHeight:G-W-$,paddingLeft:R,paddingRight:I,paddingTop:$,paddingBottom:W,marginLeft:v,marginBottom:b,marginTop:x,marginRight:w,x:l,y:u,z:f}}function $C(t,e,n,r,i,o,a){const s=Pn(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${or(kw(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=qn(t.children,(t=>t.size))):t.size=t.defaultSize},f=r=>{r.size||("auto"!==c?u(r):(_C(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=Xn(i,(t=>t.order)),m=i.filter((t=>t.type.startsWith("axis")&&t.order==g));if(m.length&&(m[0].crossPadding=0),"number"==typeof c)i.forEach(l),i.forEach(h);else if(0===i.length)d[r]=0;else{const t=wC(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 HC({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 m=n+a,y=i+s,v=r+l,b=o+c,x=t-a-l,w=[m+d,y+g,f-d-p,u-g-h,"center",null,null];return{top:[m,0,f,y,"vertical",!0,dn,a,x],right:[t-v,y,v,u,"horizontal",!1,dn],bottom:[m,e-b,f,b,"vertical",!1,dn,a,x],left:[0,y,m,u,"horizontal",!0,dn],"top-left":[m,0,f,y,"vertical",!0,dn],"top-right":[m,0,f,y,"vertical",!0,dn],"bottom-left":[m,e-b,f,b,"vertical",!1,dn],"bottom-right":[m,e-b,f,b,"vertical",!1,dn],center:w,inner:w,outer:w}}function YC(t,e,n,r){const[i,o]=wr(t,(t=>!("string"!=typeof t.type||!t.type.startsWith("axis"))));!function(t,e,n,r){"center"===r?function(t){return Gc(t)&&Dc(t)}(e)?function(t,e,n,r){const[i,o,a,s]=n;for(const e of t)e.bbox={x:i,y:o,width:a,height:s},e.radar={index:t.indexOf(e),count:t.length}}(t,0,n):Dc(e)?function(t,e,n){const[r,i,o,a]=n;for(const e of t)e.bbox={x:r,y:i,width:o,height:a}}(t,0,n):Gc(e)&&function(t,e,n,r){"horizontal"===r?function(t,e,n){const[r,i,o]=n,a=new Array(t.length).fill(0),s=e.map(a),c=s.filter(((t,e)=>e%2==1)).map((t=>t+i));for(let e=0;e<t.length;e++){const n=t[e],i=c[e],a=c[e+1]-i;n.bbox={x:r,y:i,width:o,height:a}}}(t,e,n):"vertical"===r&&function(t,e,n){const[r,i,,o]=n,a=new Array(t.length).fill(0),s=e.map(a),c=s.filter(((t,e)=>e%2==0)).map((t=>t+r));for(let e=0;e<t.length;e++){const n=t[e],r=c[e],a=c[e+1]-r;n.bbox={x:r,y:i,width:a,height:o}}}(t,e,n)}(t,e,n,t[0].orientation):"inner"===r?function(t,e,n){const[r,i,,o]=n,[a,s]=e.getCenter(),[c]=Hc(e),l=c*(o/2),u=a-l,f=s-l;for(let e=0;e<t.length;e++){t[e].bbox={x:r+u,y:i+f,width:2*l,height:2*l}}}(t,e,n):"outer"===r&&function(t,e,n){const[r,i,o,a]=n;for(const e of t)e.bbox={x:r,y:i,width:o,height:a}}(t,0,n)}(i,e,n,r),function(t,e,n){if(0===t.length)return;const[r,i,o,a]=n,[s]=Hc(e),c=a/2*s/Math.sqrt(2),l=r+o/2,u=i+a/2;for(let e=0;e<t.length;e++){t[e].bbox={x:l-c,y:u-c,width:2*c,height:2*c}}}(o,e,n)}function VC(t,e,n){const[r,i,o,a,s,c,l,u,f]=n,[h,d,p,g,m,y,v,b]="vertical"===s?["y",i,"x",r,"height",a,"width",o]:["x",r,"y",i,"width",o,"height",a];t.sort(((t,e)=>null==l?void 0:l(t.order,e.order)));const x=t=>"title"===t||"group"===t||t.startsWith("legend"),w=(t,e,n)=>void 0===n?e:x(t)?n:e,M=(t,e,n)=>void 0===n?e:x(t)?n:e;for(let e=0,n=c?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]:M(o,g,u),[m]:a,[v]:w(o,b,f)},n+=(a+i)*(c?-1:1)}const O=t.filter((t=>"group"===t.type));for(const t of O){const{bbox:e,children:n}=t,r=e[v],i=r/n.length,o=n.reduce(((t,e)=>{var n;const r=null===(n=e.layout)||void 0===n?void 0:n.justifyContent;return r||t}),"flex-start"),a=n.map(((t,e)=>{const{length:r=i,padding:o=0}=t;return r+(e===n.length-1?0:o)})),s=r-nr(a),c="flex-start"===o?0:"center"===o?s/2:s;for(let t=0,r=e[p]+c;t<n.length;t++){const i=n[t],{padding:s=0}=i,c=t===n.length-1?0:s;i.bbox={[m]:e[m],[h]:e[h],[p]:r,[v]:a[t]-c},V(i,{layout:{justifyContent:o}}),r+=a[t]}}}function qC(t,e,n){const{encode:r={},scale:i={},transform:o=[]}=e,a=he(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},a),{encode:r,scale:i,transform:o})]}function UC(t,e,n){return pe(this,void 0,void 0,(function*(){const{library:t}=n,{data:r}=e,[i]=y_("data",t),o=function(t){if(T(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=he(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}(r),{transform:a=[]}=o,s=[he(o,["transform"]),...a].map(i),c=yield function(t){return t.reduce(((t,e)=>n=>pe(this,void 0,void 0,(function*(){const r=yield t(n);return e(r)}))),rr)}(s)(r),l=!r||Array.isArray(r)||Array.isArray(c)?c:{value:c};return[Array.isArray(c)?vr(c):[],Object.assign(Object.assign({},e),{data:l})]}))}function XC(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 KC(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const o=yr(r,(t=>{if(function(t){if("object"!=typeof t||t instanceof Date||null===t)return!1;const{type:e}=t;return cr(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 ZC(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i=yr(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 QC(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const{library:o}=n,a=function(t){const[e]=y_("encode",t);return(t,n)=>void 0===n||void 0===t?null:Object.assign(Object.assign({},n),{type:"column",value:e(n)(t),field:oN(n)})}(o),s=yr(r,(t=>a(i,t)));return[t,Object.assign(Object.assign({},e),{encode:s})]}function JC(t,e,n){const{tooltip:r={}}=e;return gr(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:pr(r)&&function(t){if(0===Object.keys(t).length)return!0;const{title:e,items:n}=t;return void 0!==e||void 0!==n}(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function tN(t,e,n){const{data:r,encode:i,tooltip:o={}}=e;if(gr(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(pr(e)){const{field:n,channel:o,color:a,name:s=n,valueFormatter:c=(t=>t)}=e,l="string"==typeof c?ZO(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);pr(t)?n[o]=t:n[o]={value:t}}return n}return e},{title:s,items:c=[]}=o,l=he(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 eN(t,e,n){const{encode:r}=e,i=he(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=he(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 nN(t,e,n){const{axis:r={},legend:i={},slider:o={},scrollbar:a={}}=e,s=(t,e)=>{if("boolean"==typeof t)return t?{}:null;const n=t[e];return void 0===n||n?n:null},c="object"==typeof r?Array.from(new Set(["x","y",...Object.keys(r)])):["x","y"];return V(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 rN(t,e,n){const{animate:r}=e;return r||void 0===r||V(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}function iN(t,e,n){return pe(this,void 0,void 0,(function*(){const r={library:n},[i,o]=yield function(t,e,n){return pe(this,void 0,void 0,(function*(){const{library:r}=n,[i]=y_("transform",r),{preInference:o=[],postInference:a=[]}=e,{transform:s=[]}=t,c=[qC,UC,XC,KC,ZC,QC,eN,rN,nN,JC,...o.map(i),...s.map(i),...a.map(i),tN];let l=[],u=t;for(const t of c)[l,u]=yield t(l,u,n);return[l,u]}))}(t,e,r),{encode:a,scale:s,data:c,tooltip:l}=o;if(!1===Array.isArray(c))return null;const{channels:u}=e,f=Ln(Object.entries(a).filter((([,t])=>cr(t))),(t=>t.map((([t,e])=>Object.assign({name:t},e)))),(([t])=>{var e;const n=null===(e=/([^\d]+)\d*$/.exec(t))||void 0===e?void 0:e[1],r=u.find((t=>t.name===n));return(null==r?void 0:r.independent)?t:n})),h=u.filter((t=>{const{name:e,required:n}=t;if(f.find((([t])=>t===e)))return!0;if(n)throw new Error(`Missing encoding for channel: ${e}.`);return!1})).flatMap((t=>{const{name:e,scale:n,scaleKey:r,range:i,quantitative:o,ordinal:a}=t;return f.filter((([t])=>t.startsWith(e))).map((([t,e],c)=>{const l=e.some((t=>t.visual)),u=e.some((t=>t.constant)),f=s[t]||{},{independent:h=!1,key:d=r||t,type:p=(u?"constant":l?"identity":n)}=f,g=he(f,["independent","key","type"]),m="constant"===p,y=m?void 0:i;return{name:t,values:e,scaleKey:h||m?Symbol("independent"):d,scale:Object.assign(Object.assign({type:p,range:y},g),{quantitative:o,ordinal:a})}}))}));return[o,Object.assign(Object.assign({},e),{index:i,channels:h,tooltip:l})]}))}function oN(t){const{type:e,value:n}=t;return"field"===e&&"string"==typeof n?n:null}function aN(t,e,n,r){var i,o;return pe(this,void 0,void 0,(function*(){const[a]=y_("composition",n),[s]=y_("interaction",n),c=new Set(Object.keys(n).map((t=>{var e;return null===(e=/mark\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(cr)),l=new Set(Object.keys(n).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(cr)),u=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:c.has(e)||l.has(e)?"mark":e},f=t=>"mark"===u(t),h=t=>"standardView"===u(t),d=t=>{const{type:e}=t;return"string"==typeof e&&!!l.has(e)},p=t=>{if(h(t))return[t];const e=u(t);return a({type:e,static:d(t)})(t)},g=[],m=new Map,y=new Map,v=[t],b=[];for(;v.length;){const t=v.shift();if(h(t)){const e=y.get(t),[r,i]=e?hN(e,t,n):yield lN(t,n);m.set(r,t),g.push(r);const o=i.flatMap(p).map((t=>b_(t,n)));if(v.push(...o),o.every(h)){const t=yield Promise.all(o.map((t=>uN(t,n))));eC(t);for(let e=0;e<o.length;e++){const n=o[e],r=t[e];y.set(n,r)}}}else{const e=p(f(t)?t:yield AN(t,n));Array.isArray(e)?v.push(...e):"function"==typeof e&&b.push(e())}}r.emitter.emit(SS.BEFORE_PAINT);const x=new Map,w=new Map,M=[];e.selectAll(CN(Ok)).data(g,(t=>t.key)).join((t=>t.append("g").attr("className",Ok).attr("id",(t=>t.key)).call(sN).each((function(t,e,i){dN(t,tm(i),M,n,r),x.set(t,i)}))),(t=>t.call(sN).each((function(t,e,i){dN(t,tm(i),M,n,r),w.set(t,i)}))),(t=>t.each((function(t,e,n){const r=n.nameInteraction.values();for(const t of r)t.destroy()})).remove()));const O=t=>Array.from(t.entries()).map((([t,e])=>{const i=new Map,o=m.get(t),a=function(t,e,n,r){const i=function(t){const[,e]=y_("interaction",t);return t=>{const[n,r]=t;try{return[n,e(n)]}catch(t){return[n,r.type]}}}(n),o=t=>t[1]&&t[1].props&&t[1].props.reapplyWhenUpdate,a=SN(e),s=a.map(i).filter(o).map((t=>t[0]));return(e,i)=>pe(this,void 0,void 0,(function*(){const o=[],[a,c]=yield lN(e,n);dN(a,t,o,n,r);for(const o of s.filter((t=>t!==i)))cN(o,t,e,a,n,r);for(const e of c)aN(e,t,n,r);return{options:e,view:a}}))}(tm(e),o,n,r);return{view:t,container:e,options:o,setState:(t,e=(t=>t))=>i.set(t,e),update:t=>pe(this,void 0,void 0,(function*(){const e=ir(Array.from(i.values()))(o);return yield a(e,t)}))}})),E=O(x);for(const t of E){const{options:e}=t,n=new Map;t.container.nameInteraction=n;for(const i of SN(e)){const[e,o]=i;if(o){const i=fN(t.view,e,o,s)(t,E,r.emitter);n.set(e,{destroy:i})}}}const k=O(w);for(const t of k){const{options:e,container:n}=t,o=n.nameInteraction;for(const n of SN(e)){const[e,a]=n,c=o.get(e);if(c&&(null===(i=c.destroy)||void 0===i||i.call(c)),a){const n=fN(t.view,e,a,s)(t,k,r.emitter);o.set(e,{destroy:n})}}}const{width:S,height:A}=t,_=[];for(const t of b){const i=new Promise((i=>pe(this,void 0,void 0,(function*(){for(const i of t){const t=Object.assign({width:S,height:A},i);yield aN(t,e,n,r)}i()}))));_.push(i)}r.views=g,null===(o=r.animations)||void 0===o||o.forEach((t=>null==t?void 0:t.cancel())),r.animations=M,r.emitter.emit(SS.AFTER_PAINT);const T=M.filter(cr).map(MN).map((t=>t.finished));return Promise.all([...T,..._])}))}function sN(t){t.style("transform",(t=>`translate(${t.layout.x}, ${t.layout.y})`))}function cN(t,e,n,r,i,o){var a;const[s]=y_("interaction",i),c=e.node().nameInteraction,l=SN(n).find((([e])=>e===t)),u=c.get(t);if(!u)return;if(null===(a=u.destroy)||void 0===a||a.call(u),!l[1])return;const f=fN(r,t,l[1],s),h={options:n,view:r,container:e.node(),update:t=>Promise.resolve(t)},d=f(h,[],o.emitter);c.set(t,{destroy:d})}function lN(t,e){return pe(this,void 0,void 0,(function*(){const n=yield function(t,e){return pe(this,void 0,void 0,(function*(){const[n,r]=y_("mark",e),i=new Set(Object.keys(e).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(cr)),{marks:o}=t,a=[],s=[],c=[...o],{width:l,height:u}=function(t){const{height:e,width:n,padding:r=0,paddingLeft:i=r,paddingRight:o=r,paddingTop:a=r,paddingBottom:s=r,margin:c=16,marginLeft:l=c,marginRight:u=c,marginTop:f=c,marginBottom:h=c,inset:d=0,insetLeft:p=d,insetRight:g=d,insetTop:m=d,insetBottom:y=d}=t,v=t=>"auto"===t?20:t;return{width:n-v(i)-v(o)-l-u-p-g,height:e-v(a)-v(s)-f-h-m-y}}(t),f={options:t,width:l,height:u};for(;c.length;){const[t]=c.splice(0,1),o=yield AN(t,e),{type:l=ar("G2Mark type is required."),key:u}=o;if(i.has(l))s.push(o);else{const{props:t={}}=r(l),{composite:e=!0}=t;if(e){const{data:t}=o,e=Object.assign(Object.assign({},o),{data:t?Array.isArray(t)?t:t.value:t}),r=yield n(e,f),i=Array.isArray(r)?r:[r];c.unshift(...i.map(((t,e)=>Object.assign(Object.assign({},t),{key:`${u}-${e}`}))))}else a.push(o)}}return Object.assign(Object.assign({},t),{marks:a,components:s})}))}(t,e),r=function(t){const{coordinate:e={},interaction:n={},style:r={},marks:i}=t,o=he(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)=>V(t,e)),{}),u=[n,...s].reduce(((t,e)=>V(t,e)),{}),f=[...c,r].reduce(((t,e)=>V(t,e)),{});return Object.assign(Object.assign({},o),{marks:i,coordinate:l,interaction:u,style:f})}(n);t.interaction=r.interaction,t.coordinate=r.coordinate,t.marks=[...r.marks,...r.components];const i=b_(r,e);return hN(yield uN(i,e),i,e)}))}function uN(t,e){return pe(this,void 0,void 0,(function*(){const[n]=y_("theme",e),[,r]=y_("mark",e),{theme:i,marks:o,coordinates:a=[]}=t,s=n(kN(i)),c=new Map;for(const t of o){const{type:n}=t,{props:i={}}=r(n),o=yield iN(t,i,e);if(o){const[t,e]=o;c.set(t,e)}}const l=Pn(Array.from(c.values()).flatMap((t=>t.channels)),(({scaleKey:t})=>t));for(const t of l.values()){const n=t.reduce(((t,{scale:e})=>V(t,e)),{}),{scaleKey:r}=t[0],{values:i}=t[0],o=Array.from(new Set(i.map((t=>t.field)).filter(cr))),c=V({guide:{title:0===o.length?void 0:o},field:o[0]},n),{name:l}=t[0],u=t.flatMap((({values:t})=>t.map((t=>t.value)))),f=Object.assign(Object.assign({},ZP(l,u,c,a,s,e)),{key:r});t.forEach((t=>t.scale=f))}return c}))}function fN(t,e,n,r){const i=t.theme,o="string"==typeof e&&i[e]||{};return r(V(o,Object.assign({type:e},n)))}function hN(t,e,n){const[r]=y_("mark",n),[i]=y_("theme",n),[o]=y_("labelTransform",n),{key:a,frame:s=!1,theme:c,clip:l,style:u={},labelTransform:f=[]}=e,h=i(kN(c)),d=Array.from(t.values()),p=function(t,e){var n;const{components:r=[]}=e,i=["scale","encode","axis","legend","data","transform"],o=Array.from(new Set(t.flatMap((t=>t.channels.map((t=>t.scale)))))),a=new Map(o.map((t=>[t.name,t])));for(const t of r){const e=nC(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=V({},r,t),Object.assign(e,s)}else{const e=Object.assign(Object.assign({},s),{expectedDomain:s.domain,name:r,guide:K(t,i)});o.push(e)}}}return o}(d,e),g=function(t){return t.map((t=>{const e=V(t,t.style);return delete e.style,e}))}(bC(function(t,e,n){var r;for(const[e]of n.entries())if("cell"===e.type)return t.filter((t=>"shape"!==t.name));if(1!==e.length||t.some((t=>"shape"===t.name)))return t;const{defaultShape:i}=e[0];if(!["point","line","rect","hollow"].includes(i))return t;const o={point:"point",line:"hyphen",rect:"square",hollow:"hollow"},a=(null===(r=t.find((t=>"color"===t.name)))||void 0===r?void 0:r.field)||null,s={field:a,name:"shape",type:"constant",domain:[],range:[o[i]]};return[...t,s]}(Array.from(p),d,t),e,n)),m=WC(g,e,h,n),y=function(t,e,n){const[r]=y_("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 CA(p):new AA(p)}(m,e,n),v=s?V({mainLineWidth:1,mainStroke:"#000"},u):u;!function(t,e,n){const r=Pn(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:m,insetTop:y,height:v,width:b,depth:x}=n,w={xy:HC({width:b,height:v,paddingLeft:i,paddingRight:o,paddingTop:a,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:h,innerWidth:d,insetBottom:p,insetLeft:g,insetRight:m,insetTop:y}),yz:HC({width:x,height:v,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:x,innerHeight:v,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0}),xz:HC({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]=wr(n,(t=>"string"==typeof t.type&&("center"===i||!(!t.type.startsWith("axis")||!["inner","outer"].includes(i)))));a.length&&YC(a,e,o,i),s.length&&VC(n,0,o)}}(wC(g),y,m),function(t){const e=t.find((({type:t})=>"axisZ"===t));if(e){const n=t.find((({type:t})=>"axisX"===t));n.plane="xy";const r=t.find((({type:t})=>"axisY"===t));r.plane="xy",e.plane="yz",e.origin=[n.bbox.x,n.bbox.y,0],e.eulerAngles=[0,-90,0],e.bbox.x=n.bbox.x,e.bbox.y=n.bbox.y,t.push(Object.assign(Object.assign({},n),{plane:"xz",showLabel:!1,showTitle:!1,origin:[n.bbox.x,n.bbox.y,0],eulerAngles:[-90,0,0]})),t.push(Object.assign(Object.assign({},r),{plane:"yz",showLabel:!1,showTitle:!1,origin:[r.bbox.x+r.bbox.width,r.bbox.y,0],eulerAngles:[0,-90,0]})),t.push(Object.assign(Object.assign({},e),{plane:"xz",actualPosition:"left",showLabel:!1,showTitle:!1,eulerAngles:[90,-90,0]}))}}(g);const b={};for(const t of g){const{scales:e=[]}=t,r=[];for(const t of e){const{name:e}=t,i=tC(t,n);r.push(i),"y"===e&&i.update(Object.assign(Object.assign({},i.getOptions()),{xScale:b.x})),JP(b,{[e]:i})}t.scaleInstances=r}const x=[];for(const[e,i]of t.entries()){const{children:t,dataDomain:o,modifier:s,key:c}=e,{index:l,channels:u,tooltip:f}=i,h=Object.fromEntries(u.map((({name:t,scale:e})=>[t,e]))),d=yr(h,(t=>tC(t,n)));JP(b,d);const p=QP(u,d),g=r(e),[v,w,M]=pN(g(l,d,p,y)),O=o||v.length,E=s?s(w,O,m):[],k=t=>{var e,n;return null===(n=null===(e=f.title)||void 0===e?void 0:e[t])||void 0===n?void 0:n.value},S=t=>f.items.map((e=>e[t])),A=v.map(((t,e)=>{const n=Object.assign({points:w[e],transform:E[e],index:t,markKey:c,viewKey:a},f&&{title:k(t),items:S(t)});for(const[r,i]of Object.entries(p))n[r]=i[t],M&&(n[`series${B(r)}`]=M[e].map((t=>i[t])));return M&&(n.seriesIndex=M[e]),M&&f&&(n.seriesItems=M[e].map((t=>S(t))),n.seriesTitle=M[e].map((t=>k(t)))),n}));i.data=A,i.index=v;const _=null==t?void 0:t(A,d,m);x.push(..._||[])}return[{layout:m,theme:h,coordinate:y,markState:t,key:a,clip:l,scale:b,style:v,components:g,labelTransform:ir(f.map(o))},x]}function dN(t,e,n,r,i){return pe(this,void 0,void 0,(function*(){const{components:o,theme:a,layout:s,markState:c,coordinate:l,key:u,style:f,clip:h,scale:d}=t,{x:p,y:g,width:m,height:y}=s,v=he(s,["x","y","width","height"]),b=["view","plot","main","content"],x=b.map(((t,e)=>e)),w=b.map((t=>fr(Object.assign({},a.view,f),t))),M=["a","margin","padding","inset"].map((t=>ur(v,t))),O=t=>t.style("x",(t=>_[t].x)).style("y",(t=>_[t].y)).style("width",(t=>_[t].width)).style("height",(t=>_[t].height)).each((function(t,e,n){!function(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}(tm(n),w[t])}));let E=0,k=0,S=m,A=y;const _=x.map((t=>{const e=M[t],{left:n=0,top:r=0,bottom:i=0,right:o=0}=e;return E+=n,k+=r,S-=n+o,A-=r+i,{x:E,y:k,width:S,height:A}}));e.selectAll(CN(Ak)).data(x.filter((t=>cr(w[t]))),(t=>b[t])).join((t=>t.append("rect").attr("className",Ak).style("zIndex",-2).call(O)),(t=>t.call(O)),(t=>t.remove()));const T=function(t){let e=-1/0,n=1/0;for(const[r,i]of t){const{animate:t={}}=r,{data:o}=i,{enter:a={},update:s={},exit:c={}}=t,{type:l,duration:u=300,delay:f=0}=s,{type:h,duration:d=300,delay:p=0}=a,{type:g,duration:m=300,delay:y=0}=c;for(const t of o){const{updateType:r=l,updateDuration:i=u,updateDelay:o=f,enterType:a=h,enterDuration:s=d,enterDelay:c=p,exitDuration:v=m,exitDelay:b=y,exitType:x=g}=t;(void 0===r||r)&&(e=Math.max(e,i+o),n=Math.min(n,o)),(void 0===x||x)&&(e=Math.max(e,v+b),n=Math.min(n,b)),(void 0===a||a)&&(e=Math.max(e,s+c),n=Math.min(n,c))}}return e===-1/0?null:[n,e-n]}(c),P=!!T&&{duration:T[1]};for(const[,t]of Cn(o,(t=>`${t.type}-${t.position}`)))t.forEach(((t,e)=>t.index=e));const C=e.selectAll(CN(kk)).data(o,(t=>`${t.type}-${t.position}-${t.index}`)).join((t=>t.append("g").style("zIndex",(({zIndex:t})=>t||-1)).attr("className",kk).append((t=>xC(V({animate:P,scale:d},t),l,a,r,c)))),(t=>t.transition((function(t,e,n){const{preserve:i=!1}=t;if(i)return;const o=xC(V({animate:P,scale:d},t),l,a,r,c),{attributes:s}=o,[u]=n.childNodes;return u.update(s,!1)})))).transitions();n.push(...C.flat().filter(cr));const N=e.selectAll(CN(Ek)).data([s],(()=>u)).join((t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",Ek).call(_N).call(PN,Array.from(c.keys())).call(NN,h)),(t=>t.call(PN,Array.from(c.keys())).call((t=>T?function(t,e){const[n,r]=e;t.transition((function(t,e,i){const{x:o,y:a,width:s,height:c}=i.style,{paddingLeft:l,paddingTop:u,innerWidth:f,innerHeight:h,marginLeft:d,marginTop:p}=t,g=[{x:o,y:a,width:s,height:c},{x:l+d,y:u+p,width:f,height:h}];return i.animate(g,{delay:n,duration:r,fill:"both"})}))}(t,T):_N(t))).call(NN,h))).transitions();n.push(...N.flat());for(const[o,a]of c.entries()){const{data:s}=a,{key:c,class:l,type:u}=o,f=e.select(`#${c}`),h=vN(o,a,t,r,i),d=wN(o,a,t,r),p=ON(o,a,t,r),g=EN(o,a,t,r),m=mN(e,f,l,"element"),y=f.selectAll(CN(Mk)).selectFacetAll(m).data(s,(t=>t.key),(t=>t.groupKey)).join((t=>t.append(h).attr("className",Mk).attr("markType",u).transition((function(t,e,n){return d(t,[n])}))),(t=>t.call((t=>{const e=t.parent(),n=lr((t=>{const[e,n]=t.getBounds().min;return[e,n]}));t.transition((function(t,r,i){yN(i,e,n);const o=h(t,r),a=p(t,[i],[o]);return null!==a||(i.nodeName===o.nodeName&&"g"!==o.nodeName?sr(i,o):(i.parentNode.replaceChild(o,i),o.className=Mk,o.markType=u,o.__data__=i.__data__)),a})).attr("markType",u).attr("className",Mk)}))),(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",Mk).attr("markType",u).transition((function(t,e,n){const{__fromElements__:r}=n,i=p(t,r,[n]);return new em(r,null,n.parentNode).transition(i).remove(),i}))),(t=>t.transition((function(t,e,n){const r=new em([],n.__toData__,n.parentNode).append(h).attr("className",Mk).attr("markType",u).nodes();return p(t,[n],r)})).remove())).transitions();n.push(...y.flat())}!function(t,e,n,r,i){const[o]=y_("labelTransform",r),{markState:a,labelTransform:s}=t,c=e.select(CN(wk)).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]=y_("shape",r),{data:a}=t,{data:s,defaultLabelShape:c}=e,l=s.map((t=>t.points)),{theme:u,coordinate:f}=n,h=Object.assign(Object.assign({},i),{document:v_(i),theme:u,coordinate:f});return t=>{const{index:e,points:n}=t,r=a[e],{formatter:i=(t=>`${t}`),transform:s,style:f,render:d}=t,p=he(t,["formatter","transform","style","render"]),g=yr(Object.assign(Object.assign({},p),f),(t=>gN(t,r,e,a))),{shape:m=c,text:y}=g,v=he(g,["shape","text"]),b="string"==typeof i?ZO(i):i,x=Object.assign(Object.assign({},v),{text:b(y,r,e,a),datum:r}),w=Object.assign({type:`label.${m}`,render:d},v);return o(w,h)(n,x,bN(u,"label",m,"label"),l)}}(n,o,t,r,i),f=e.select(`#${s}`).selectAll(CN(Mk)).nodes().filter((t=>!t.__removed__));return a.flatMap(((t,e)=>{const n=he(t,["transform"]);return f.flatMap((r=>{const i=function(t,e,n){const{seriesIndex:r,seriesKey:i,points:o,key:a,index:s}=n.__data__,c=function(t){const e=t.cloneNode(),n=t.getAnimations();e.style.visibility="hidden",n.forEach((t=>{const n=t.effect.getKeyframes();e.attr(n[n.length-1])})),t.parentNode.appendChild(e);const r=e.getLocalBounds();e.destroy();const{min:i,max:o}=r;return[i,o]}(n);if(!r)return[Object.assign(Object.assign({},t),{key:`${a}-${e}`,bounds:c,index:s,points:o,dependentElement:n})];const l=function(t){const{selector:e}=t;if(!e)return null;if("function"==typeof e)return e;if("first"===e)return t=>[t[0]];if("last"===e)return t=>[t[t.length-1]];throw new Error(`Unknown selector: ${e}`)}(t),u=r.map(((r,a)=>Object.assign(Object.assign({},t),{key:`${i[a]}-${e}`,bounds:[o[a]],index:r,points:o,dependentElement:n})));return l?l(u):u}(n,e,r);return i.forEach((e=>{l.set(e,c),u.set(e,t)})),i}))}))})),h=tm(c).selectAll(CN(Sk)).data(f,(t=>t.key)).join((t=>t.append((t=>l.get(t)(t))).attr("className",Sk)),(t=>t.each((function(t,e,n){sr(n,l.get(t)(t))}))),(t=>t.remove())).nodes(),d=Pn(h,(t=>u.get(t.__data__))),{coordinate:p}=t;for(const[t,e]of d){const{transform:n=[]}=t;ir(n.map(o))(e,p)}s&&s(h,p)}(t,e,0,r,i)}))}function pN([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])=>cr(t)&&cr(e)))&&(r.push(o),i.push(a))}return[r,i]}function gN(t,e,n,r){return"function"==typeof t?t(e,n,r):"string"!=typeof t?t:void 0!==e[t]?e[t]:t}function mN(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 yN(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 vN(t,e,n,r,i){const[o]=y_("shape",r),{data:a}=t,{defaultShape:s,data:c,shape:l}=e,u=c.map((t=>t.points)),{theme:f,coordinate:h}=n,{type:d,style:p={}}=t,g=Object.assign(Object.assign({},i),{document:v_(i),coordinate:h,theme:f});return e=>{const{shape:n=s}=p,{shape:r=n,points:i,seriesIndex:c,index:h}=e,m=he(e,["shape","points","seriesIndex","index"]),y=Object.assign(Object.assign({},m),{index:h}),v=c?c.map((t=>a[t])):a[h],b=c||h,x=yr(p,(t=>gN(t,v,b,a)));return(l[r]?l[r](x,g):o(Object.assign(Object.assign({},x),{type:TN(t,r)}),g))(i,y,bN(f,d,r,s),u)}}function bN(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 xN(t,e,n,r,i){var o,a;const[,s]=y_("shape",i),[c]=y_("animation",i),{defaultShape:l,shape:u}=n,{theme:f,coordinate:h}=r,d=`default${B(t)}Animation`,{[d]:p}=(null===(o=u[l])||void 0===o?void 0:o.props)||s(TN(e,l)).props,{[t]:g={}}=f,m=(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},m);if(!l.type)return null;const u=c(l,y)(n,r,V(g,{delay:o,duration:a,easing:s}));return Array.isArray(u)?u:[u]}}function wN(t,e,n,r){return xN("enter",t,e,n,r)}function MN(t){return t.finished.then((()=>{t.cancel()})),t}function ON(t,e,n,r){return xN("update",t,e,n,r)}function EN(t,e,n,r){return xN("exit",t,e,n,r)}function kN(t={}){if("string"==typeof t)return{type:t};const{type:e="light"}=t,n=he(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}function SN(t){const{interaction:e={}}=t;return Object.entries(V({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},e)).reverse()}function AN(t,e){return pe(this,void 0,void 0,(function*(){const n={library:e},{data:r}=t,i=he(t,["data"]);if(null==r)return t;const[,{data:o}]=yield UC(0,{data:r},n);return Object.assign({data:o},i)}))}function _N(t){t.style("x",(t=>t.paddingLeft+t.marginLeft)).style("y",(t=>t.paddingTop+t.marginTop)).style("width",(t=>t.innerWidth)).style("height",(t=>t.innerHeight))}function TN(t,e){const{type:n}=t;return"string"==typeof e?`${n}.${e}`:e}function PN(t,e){const n=t=>void 0!==t.class?`${t.class}`:"";if(0===t.nodes().length)return;t.selectAll(CN(xk)).data(e,(t=>t.key)).join((t=>t.append("g").attr("className",xk).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(CN(wk)).node()||t.append("g").attr("className",wk).style("zIndex",0)}function CN(...t){return t.map((t=>`.${t}`)).join("")}function NN(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 Lp({style:{x:r+i,y:n+o,width:a,height:s}})}))}function LN(t){const e=V({},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=V({},e[o]);e[o]=a,n.set(a,t),r.set(a,o),i.push(a)}}return e}function jN(t,e){const n=new wS;return n.registerPlugin(new OS),new qp({width:t,height:e,container:document.createElement("div"),renderer:n})}function RN(t,e={},n=(()=>{}),r=(t=>{throw t})){const{width:i=640,height:o=480,depth:a=0}=t,s=LN(t),{canvas:c=jN(i,o),emitter:l=new kS,library:u}=e;e.canvas=c,e.emitter=l;const{width:f,height:h}=c.getConfig();f===i&&h===o||c.resize(i,o),l.emit(SS.BEFORE_RENDER);const d=tm(c.document.documentElement);return c.ready.then((()=>aN(Object.assign(Object.assign({},s),{width:i,height:o,depth:a}),d,u,e))).then((()=>{if(a){const[t,e]=c.document.documentElement.getPosition();c.document.documentElement.setPosition(t,e,-a/2)}c.requestAnimationFrame((()=>{l.emit(SS.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),"string"==typeof(p=c.getConfig().container)?document.getElementById(p):p;var p}function IN(t,e={},n=!1){const{canvas:r,emitter:i}=e;r&&(!function(t){const e=t.getRoot().querySelectorAll(`.${Ok}`);null==e||e.forEach((t=>{const{nameInteraction:e=new Map}=t;(null==e?void 0:e.size)>0&&Array.from(null==e?void 0:e.values()).forEach((t=>{null==t||t.destroy()}))}))}(r),n?r.destroy():r.destroyChildren()),i.off()}const BN={visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1};function DN(t,e){var n;return null!==(n=t.style[e])&&void 0!==n?n:BN[e]}function FN(t,e,n,r){t.style[e]=n,r&&t.children.forEach((t=>FN(t,e,n,r)))}function zN(t){FN(t,"visibility","hidden",!0)}function GN(t){FN(t,"visibility","visible",!0)}function WN(t){return tm(t).selectAll(`.${Mk}`).nodes().filter((t=>!t.__removed__))}function $N(t,e){return HN(t,e).flatMap((({container:t})=>WN(t)))}function HN(t,e){return e.filter((e=>e!==t&&e.options.parentKey===t.options.key))}function YN(t){return tm(t).select(`.${Ek}`).node()}function VN(t){if("rect"!==t.nodeName)return t.getRenderBounds();const{x:e,y:n,width:r,height:i}=t.style;return{min:[e,n],max:[e+r,n+i]}}function qN(t,e){const{offsetX:n,offsetY:r}=e,i=VN(t),{min:[o,a],max:[s,c]}=i;return n<o||n>s||(r<a||r>c)?null:[n-o,r-a]}function UN(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 XN(t){return t=>t.__data__.color}function KN(t){return t=>t.__data__.x}function ZN(t){const e=Array.isArray(t)?t:[t],n=new Map(e.flatMap((t=>Array.from(t.markState.keys()).map((e=>[JN(t.key,e.key),e.data])))));return t=>{const{index:e,markKey:r,viewKey:i}=t.__data__;return n.get(JN(i,r))[e]}}function QN(t,e=((t,e)=>t),n=((t,e,n)=>t.setAttribute(e,n))){const r="__states__",i="__ordinal__",o=o=>{const{[r]:a=[],[i]:s={}}=o,c=a.reduce(((e,n)=>Object.assign(Object.assign({},e),t[n])),s);if(0!==Object.keys(c).length){for(const[t,r]of Object.entries(c)){const i=DN(o,t),a=e(r,o);n(o,t,a),t in s||(s[t]=i)}o[i]=s}},a=t=>{t[r]||(t[r]=[])};return{setState:(t,...e)=>{a(t),t[r]=[...e],o(t)},removeState:(t,...e)=>{a(t);for(const n of e){const e=t[r].indexOf(n);-1!==e&&t[r].splice(e,1)}o(t)},hasState:(t,e)=>(a(t),-1!==t[r].indexOf(e))}}function JN(t,e){return`${t},${e}`}function tL(t,e){const n=(Array.isArray(t)?t:[t]).flatMap((t=>t.marks.map((e=>[JN(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=JN(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 eL(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 nL(t){var{link:e=!1,valueof:n=((t,e)=>t),coordinate:r}=t,i=he(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=Rn(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=Us(),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=yr(i,(t=>n(t,c))),{fill:g=c.getAttribute("fill")}=p,m=he(p,["fill"]),y=new Pp({className:"element-link",style:Object.assign({d:s.toString(),fill:g,zIndex:-2},m)});null===(e=c.link)||void 0===e||e.remove(),c.parentNode.appendChild(y),c.link=y}},t=>{var e;null===(e=t.link)||void 0===e||e.remove(),t.link=null}]}function rL(t,e,n){const r=e=>{const{transform:n}=t.style;return n?`${n} ${e}`:e};if(Dc(n)){const{points:i}=t.__data__,[o,a]=Bc(n)?sm(i):i,s=n.getCenter(),c=hs(o,s),l=hs(a,s),u=gs(c)+ys(c,l)/2;return r(`translate(${e*Math.cos(u)}, ${e*Math.sin(u)})`)}return Bc(n)?r(`translate(${e}, 0)`):r(`translate(0, ${-e})`)}function iL(t){var{document:e,background:n,scale:r,coordinate:i,valueof:o}=t,a=he(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(!FE(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(!FE(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 fm(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=he(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=yr(a,(e=>o(e,t))),{fill:n="#CCD6EC",fillOpacity:i=.3,zIndex:c=-2,padding:f=.001,strokeWidth:h=0}=e,d=he(e,["fill","fillOpacity","zIndex","padding","strokeWidth"]),p=Object.assign(Object.assign({},d),{fill:n,fillOpacity:i,zIndex:c,padding:f,strokeWidth:h}),g=(()=>{const{x:t,y:e}=r;return[t,e].some(FE)})()?l:u,m=g(t,p);m.className=s,t.parentNode.parentNode.appendChild(m),t.background=m},t=>{var e;null===(e=t.background)||void 0===e||e.remove(),t.background=null},t=>t.className===s]}function oL(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 aL(t){oL(t,t.cursor)}function sL(t,e,n){return t.find((t=>Object.entries(e).every((([e,r])=>n(t)[e]===r))))}function cL(t,{elements:e,datum:n,groupKey:r=(t=>t),link:i=!1,background:o=!1,delay:a=60,scale:s,coordinate:c,emitter:l,state:u={}}){var f;const h=e(t),d=new Set(h),p=Pn(h,r),g=eL(h,n),[m,y]=nL(Object.assign({elements:h,valueof:g,link:i,coordinate:c},ur(u.active,"link"))),[v,b,x]=iL(Object.assign({document:t.ownerDocument,scale:s,coordinate:c,background:o,valueof:g},ur(u.active,"background"))),w=V(u,{active:Object.assign({},(null===(f=u.active)||void 0===f?void 0:f.offset)&&{transform:(...t)=>{const e=u.active.offset(...t),[,n]=t;return rL(h[n],e,c)}})}),{setState:M,removeState:O,hasState:E}=QN(w,g);let k;const S=t=>{const{target:e,nativeEvent:i=!0}=t;if(!d.has(e))return;k&&clearTimeout(k);const o=r(e),a=p.get(o),s=new Set(a);for(const t of h)s.has(t)?E(t,"active")||M(t,"active"):(M(t,"inactive"),y(t)),t!==e&&b(t);v(e),m(a),i&&l.emit("element:highlight",{nativeEvent:i,data:{data:n(e),group:a.map(n)}})},A=(t=!0)=>{for(const t of h)O(t,"active","inactive"),b(t),y(t);t&&l.emit("element:unhighlight",{nativeEvent:t})},_=t=>{const{target:e}=t;o&&!x(e)||(o||d.has(e))&&(a>0?(k&&clearTimeout(k),k=setTimeout((()=>{A(),k=null}),a)):A())},T=()=>{A()};t.addEventListener("pointerover",S),t.addEventListener("pointerout",_),t.addEventListener("pointerleave",T);const P=t=>{const{nativeEvent:e}=t;e||A(!1)},C=t=>{const{nativeEvent:e}=t;if(e)return;const{data:r}=t.data,i=sL(h,r,n);i&&S({target:i,nativeEvent:!1})};return l.on("element:highlight",C),l.on("element:unhighlight",P),()=>{t.removeEventListener("pointerover",S),t.removeEventListener("pointerout",_),t.removeEventListener("pointerleave",T),l.off("element:highlight",C),l.off("element:unhighlight",P);for(const t of h)b(t),y(t)}}function lL(t){var{delay:e,createGroup:n,background:r=!1,link:i=!1}=t,o=he(t,["delay","createGroup","background","link"]);return(t,a,s)=>{const{container:c,view:l,options:u}=t,{scale:f,coordinate:h}=l;return cL(YN(c),Object.assign({elements:WN,datum:ZN(l),groupKey:n?n(l):void 0,coordinate:h,scale:f,state:tL(u,[["active",r?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:r,link:i,delay:e,emitter:s},o))}}function uL(t){return lL(Object.assign(Object.assign({},t),{createGroup:KN}))}function fL(t){return lL(Object.assign(Object.assign({},t),{createGroup:XN}))}function hL(t,{elements:e,datum:n,groupKey:r=(t=>t),link:i=!1,single:o=!1,coordinate:a,background:s=!1,scale:c,emitter:l,state:u={}}){var f;const h=e(t),d=new Set(h),p=Pn(h,r),g=eL(h,n),[m,y]=nL(Object.assign({link:i,elements:h,valueof:g,coordinate:a},ur(u.selected,"link"))),[v,b]=iL(Object.assign({document:t.ownerDocument,background:s,coordinate:a,scale:c,valueof:g},ur(u.selected,"background"))),x=V(u,{selected:Object.assign({},(null===(f=u.selected)||void 0===f?void 0:f.offset)&&{transform:(...t)=>{const e=u.selected.offset(...t),[,n]=t;return rL(h[n],e,a)}})}),{setState:w,removeState:M,hasState:O}=QN(x,g),E=(t=!0)=>{for(const t of h)M(t,"selected","unselected"),y(t),b(t);t&&l.emit("element:unselect",{nativeEvent:!0})},k=t=>{const{target:e,nativeEvent:a=!0}=t;return d.has(e)?o?((t,e,i=!0)=>{if(O(e,"selected"))E();else{const o=r(e),a=p.get(o),s=new Set(a);for(const t of h)s.has(t)?w(t,"selected"):(w(t,"unselected"),y(t)),t!==e&&b(t);if(m(a),v(e),!i)return;l.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:i,data:{data:[n(e),...a.map(n)]}}))}})(t,e,a):((t,e,o=!0)=>{const a=r(e),s=p.get(a),c=new Set(s);if(O(e,"selected")){if(!h.some((t=>!c.has(t)&&O(t,"selected"))))return E();for(const t of s)w(t,"unselected"),y(t),b(t)}else{const t=s.some((t=>O(t,"selected")));for(const t of h)c.has(t)?w(t,"selected"):O(t,"selected")||w(t,"unselected");!t&&i&&m(s),v(e)}o&&l.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:o,data:{data:h.filter((t=>O(t,"selected"))).map(n)}}))})(t,e,a):E()};t.addEventListener("click",k);const S=t=>{const{nativeEvent:e,data:r}=t;if(e)return;const i=o?r.data.slice(0,1):r.data;for(const t of i){const e=sL(h,t,n);k({target:e,nativeEvent:!1})}},A=()=>{E(!1)};return l.on("element:select",S),l.on("element:unselect",A),()=>{for(const t of h)y(t);t.removeEventListener("click",k),l.off("element:select",S),l.off("element:unselect",A)}}function dL(t){var{createGroup:e,background:n=!1,link:r=!1}=t,i=he(t,["createGroup","background","link"]);return(t,o,a)=>{const{container:s,view:c,options:l}=t,{coordinate:u,scale:f}=c;return hL(YN(s),Object.assign({elements:WN,datum:ZN(c),groupKey:e?e(c):void 0,coordinate:u,scale:f,state:tL(l,[["selected",n?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:n,link:r,emitter:a},i))}}function pL(t){return dL(Object.assign(Object.assign({},t),{createGroup:KN}))}function gL(t){return dL(Object.assign(Object.assign({},t),{createGroup:XN}))}function mL(t){var{wait:e=20,leading:n,trailing:r=!1,labelFormatter:i=(t=>`${t}`)}=t,o=he(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:m=[]}=d,y=p.map(((t,e)=>e)),v=Rn(y.map((t=>g[t]))),b=YN(s),x=s.getElementsByClassName(Mk),w=Pn(s.getElementsByClassName(Sk),(t=>t.__data__.key.split("-")[0])),M=new Tp({style:Object.assign({x1:0,y1:0,x2:0,y2:b.getAttribute("height"),stroke:"black",lineWidth:1},ur(o,"rule"))}),O=new jp({style:Object.assign({x:0,y:b.getAttribute("height"),text:"",fontSize:10},ur(o,"label"))});M.append(O),b.appendChild(M);const E=(t,e,n)=>{const[r]=t.invert(n),i=e.invert(r);return v[wn(v,i)]},k=(t,e)=>{M.setAttribute("x1",t[0]),M.setAttribute("x2",t[0]),O.setAttribute("text",i(e))};let S;const A=Z((t=>{const e=qN(b,t);e&&(t=>{const{scale:e,coordinate:n}=S,{x:r,y:i}=e,o=E(n,r,t);k(t,o);for(const t of x){const{seriesIndex:e,key:r}=t.__data__,a=e[gn((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=>{pe(this,void 0,void 0,(function*(){const{x:e}=f,n=E(h,e,t);k(t,n),l("chartIndex",(t=>{const e=V({},t),r=e.marks.find((t=>"line"===t.type)),i=qn(Nn(y,(t=>qn(t,(t=>+p[t]))/Xn(t,(t=>+p[t]))),(t=>m[t])).values());V(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[gn((t=>g[+t])).center(t,n)]];for(const t of e.marks)t.animate=!1;return e}));const r=yield c("chartIndex");S=r.view}))})([0,0]),b.addEventListener("pointerenter",A),b.addEventListener("pointermove",A),b.addEventListener("pointerleave",A),()=>{M.remove(),b.removeEventListener("pointerenter",A),b.removeEventListener("pointermove",A),b.removeEventListener("pointerleave",A)}}}function yL({wait:t=30,leading:e,trailing:n=!1}){return r=>{const{options:i,update:o,setState:a,container:s}=r,c=YN(s),l=Z((t=>{const e=qN(c,t);if(!e)return a("fisheye"),void o();a("fisheye",(t=>{const n=V({},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 vL(t,e){if(e)return"string"==typeof e?document.querySelector(e):e;return t.ownerDocument.defaultView.getContextService().getDomElement().parentElement}function bL(t,e,n,r,i,o,a,s={}){const c=new Dx({className:"tooltip",style:{x:e,y:n,container:a,data:[],bounding:o,position:r,enterable:i,title:"",offset:[10,10],template:{prefixCls:"g2-"},style:V({".g2-tooltip":{},".g2-tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}},s)}});return t.appendChild(c.HTMLTooltipElement),c}function xL({root:t,data:e,x:n,y:r,render:i,event:o,single:a,position:s="right-bottom",enterable:c=!1,css:l,mount:u,bounding:f}){const h=vL(t,u),d=vL(t),p=a?d:t,g=f||function(t){const e=t.getBounds(),{min:[n,r],max:[i,o]}=e;return{x:n,y:r,width:i-n,height:o-r}}(t),m=function(t,e){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return{x:n.x-r.x,y:n.y-r.y}}(d,h),{tooltipElement:y=bL(h,n,r,s,c,g,m,l)}=p,{items:v,title:b=""}=e;y.update(Object.assign({x:n,y:r,data:v,title:b,position:s,enterable:c},void 0!==i&&{content:i(o,{items:v,title:b})})),p.tooltipElement=y}function wL({root:t,single:e,emitter:n,nativeEvent:r=!0,event:i=null}){r&&n.emit("tooltip:hide",{nativeEvent:r});const o=vL(t),a=e?o:t,{tooltipElement:s}=a;s&&s.hide(null==i?void 0:i.clientX,null==i?void 0:i.clientY)}function ML({root:t,single:e}){const n=vL(t),r=e?n:t;if(!r)return;const{tooltipElement:i}=r;i&&(i.destroy(),r.tooltipElement=void 0)}function OL(t){const{value:e}=t;return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function EL(t){const e=t.getAttribute("fill"),n=t.getAttribute("stroke"),{__data__:r}=t,{color:i=(e&&"transparent"!==e?e:n)}=r;return i}function kL(t,e=(t=>t)){const n=new Map(t.map((t=>[e(t),t])));return Array.from(n.values())}function SL(t,e,n,r=t.map((t=>t.__data__)),i={}){const o=t=>t instanceof Date?+t:t,a=kL(r.map((t=>t.title)),o).filter(cr),s=r.flatMap(((r,o)=>{const a=t[o],{items:s=[],title:c}=r,l=s.filter(cr),u=void 0!==n?n:s.length<=1;return l.map((t=>{var{color:n=EL(a)||i.color,name:o}=t,s=he(t,["color","name"]);const l=function(t,e){const{color:n,series:r,facet:i=!1}=t,{color:o,series:a}=e,s=t=>t&&t.invert&&!(t instanceof zo)&&!(t instanceof Wo);if(s(r))return r.clone().invert(a);if(a&&r instanceof zo&&r.invert(a)!==o&&!i)return r.invert(a);if(s(n)){const t=n.invert(o);return Array.isArray(t)?null:t}return null}(e,r),f=u?l||o:o||l;return Object.assign(Object.assign({},s),{color:n,name:f||c})}))})).map(OL);return Object.assign(Object.assign({},a.length>0&&{title:a.join(",")}),{items:kL(s,(t=>`(${o(t.name)}, ${o(t.value)}, ${o(t.color)})`))})}function AL(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=he(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])),m=e.map((t=>t[0])),y=tr(g),v=tr(m),[b,x,w,M]=(()=>{if(u){const t=Math.min(o,a)/2,e=s+f+o/2,n=c+h+a/2,r=gs(hs([v,y],[e,n]));return[e,e+t*Math.cos(r),n,n+t*Math.sin(r)]}return l?[s,s+r,y+c,y+c]:[v+s,v+s,c,c+i]})();if(m.length>0){const e=t.ruleY||(()=>{const e=new Tp({style:Object.assign({x1:b,x2:x,y1:w,y2:M},p)});return t.appendChild(e),e})();e.style.x1=b,e.style.x2=x,e.style.y1=w,e.style.y2=M,t.ruleY=e}}function _L(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function TL(t){t.markers&&(t.markers.forEach((t=>t.remove())),t.markers=[])}function PL(t,e){return Array.from(t.values()).some((t=>{var n;return null===(n=t.interaction)||void 0===n?void 0:n[e]}))}function CL(t,e){return void 0===t?e:t}function NL(t){const{title:e,items:n}=t;return 0===n.length&&void 0===e}function LL(t,e){var{elements:n,sort:r,filter:i,scale:o,coordinate:a,crosshairs:s,render:c,groupName:l,emitter:u,wait:f=50,leading:h=!0,trailing:d=!1,startX:p=0,startY:g=0,body:m=!0,single:y=!0,position:v,enterable:b,mount:x,bounding:w,theme:M,disableNative:O=!1,marker:E=!0,preserve:k=!1,style:S={},css:A={}}=e,_=he(e,["elements","sort","filter","scale","coordinate","crosshairs","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","theme","disableNative","marker","preserve","style","css"]);const T=n(t),P=Bc(a),C=Dc(a),N=V(S,_),{innerWidth:L,innerHeight:j,width:R,height:B,insetLeft:D,insetTop:F}=a.getOptions(),z=[],G=[];for(const t of T){const{__data__:e}=t,{seriesX:n,title:r,items:i}=e;n?z.push(t):(r||i)&&G.push(t)}const W=!!(P?o.y:o.x).getBandWidth&&G.length>0;z.sort(((t,e)=>{const n=P?0:1,r=t=>t.getBounds().min[n];return P?r(e)-r(t):r(t)-r(e)}));const $=t=>{const e=P?1:0,{min:n,max:r}=t.getLocalBounds();return Rn([n[e],r[e]])};G.sort(((t,e)=>{const[n,r]=$(t),[i,o]=$(e),a=(n+r)/2,s=(i+o)/2;return P?s-a:a-s}));const H=new Map(z.map((t=>{const{__data__:e}=t,{seriesX:n}=e;return[t,[Rn(n.map(((t,e)=>e)),(t=>n[+t])),n]]}))),{x:Y}=o,q=(null==Y?void 0:Y.getBandWidth)?Y.getBandWidth()/2:0,U=t=>{const[e]=a.invert(t);return e-q},X=(t,e,n)=>{const r=U(t),i=n.filter(cr),[o,a]=Rn([i[0],i[i.length-1]]);if(!W&&(r<o||r>a)&&!(o===a))return null;const s=gn((t=>n[+t])).center;return e[s(e,r)]},K=(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[I(t.replace("series","")),r]})))},Q=Z((e=>{const n=qN(t,e);if(!n)return;const f=VN(t),h=f.min[0],d=f.min[1],O=[n[0]-p,n[1]-g];if(!O)return;const k=((t,e)=>{const n=t[P?1:0],r=e.filter((t=>{const[e,r]=$(t);return n>=e&&n<=r}));if(!W||r.length>0)return r;const i=gn((t=>{const[e,n]=$(t);return(e+n)/2})).center;return[e[i(e,n)]].filter(cr)})(O,G),S=[],_=[];for(const t of z){const[e,n]=H.get(t),r=X(O,e,n);if(null!==r){S.push(t);const e=K(t,r),{x:n,y:i}=e,o=a.map([(n||0)+q,i||0]);_.push([Object.assign(Object.assign({},e),{element:t}),o])}}const T=Array.from(new Set(_.map((t=>t[0].x)))),I=T[Kn(T,(t=>Math.abs(t-U(O))))],Y=_.filter((t=>t[0].x===I)),V=[...Y.map((t=>t[0])),...k.map((t=>t.__data__))],Z=[...S,...k],Q=SL(Z,o,l,V,M);if(r&&Q.items.sort(((t,e)=>r(t)-r(e))),i&&(Q.items=Q.items.filter(i)),0===Z.length||NL(Q))J(e);else{if(m&&xL({root:t,data:Q,x:n[0]+h,y:n[1]+d,render:c,event:e,single:y,position:v,enterable:b,mount:x,bounding:w,css:A}),s){const e=Y.map((t=>t[1])),n=ur(N,"crosshairs");AL(t,e,Object.assign(Object.assign({},n),{plotWidth:L,plotHeight:j,mainWidth:R,mainHeight:B,insetLeft:D,insetTop:F,startX:p,startY:g,transposed:P,polar:C}))}if(E){const e=ur(N,"marker");!function(t,{data:e,style:n,theme:r}){t.markers&&t.markers.forEach((t=>t.remove()));const i=e.filter((t=>{const[{x:e,y:n}]=t;return cr(e)&&cr(n)})).map((t=>{const[{color:e,element:i},o]=t,a=e||i.style.fill||i.style.stroke||r.color;return new Op({style:Object.assign({cx:o[0],cy:o[1],fill:a,r:4,stroke:"#fff",strokeWidth:2},n)})}));for(const e of i)t.appendChild(e);t.markers=i}(t,{data:Y,style:e,theme:M})}u.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:{data:{x:zE(o.x,U(O),!0)}}}))}}),f,{leading:h,trailing:d}),J=e=>{wL({root:t,single:y,emitter:u,event:e}),s&&_L(t),E&&TL(t)},tt=()=>{ML({root:t,single:y}),s&&_L(t),E&&TL(t)},et=({nativeEvent:e,data:n})=>{if(e)return;const{x:r}=n.data,{x:i}=o,s=i.map(r),[c,l]=a.map([s,.5]),{min:[u,f]}=t.getRenderBounds();Q({offsetX:c+u,offsetY:l+f})},nt=()=>{wL({root:t,single:y,emitter:u,nativeEvent:!1})},rt=()=>{at(),tt()},it=()=>{ot()},ot=()=>{O||(t.addEventListener("pointerenter",Q),t.addEventListener("pointermove",Q),t.addEventListener("pointerleave",J))},at=()=>{O||(t.removeEventListener("pointerenter",Q),t.removeEventListener("pointermove",Q),t.removeEventListener("pointerleave",J))};return ot(),u.on("tooltip:show",et),u.on("tooltip:hide",nt),u.on("tooltip:disable",rt),u.on("tooltip:enable",it),()=>{at(),u.off("tooltip:show",et),u.off("tooltip:hide",nt),u.off("tooltip:disable",rt),u.off("tooltip:enable",it),k?wL({root:t,single:y,emitter:u,nativeEvent:!1}):tt()}}function jL(t,{elements:e,scale:n,render:r,groupName:i,sort:o,filter:a,emitter:s,wait:c=50,leading:l=!0,trailing:u=!1,groupKey:f=(t=>t),single:h=!0,position:d,enterable:p,datum:g,view:m,mount:y,bounding:v,theme:b,shared:x=!1,body:w=!0,disableNative:M=!1,preserve:O=!1,css:E={}}){const k=e(t),S=new Set(k),A=Pn(k,f),_=Z((e=>{const{target:c}=e;if(!S.has(c))return void wL({root:t,single:h,emitter:s,event:e});const l=f(c),u=A.get(l),g=1!==u.length||x?SL(u,n,i,void 0,b):function(t){const{__data__:e}=t,{title:n,items:r=[]}=e,i=r.filter(cr).map((e=>{var{color:n=EL(t)}=e,r=he(e,["color"]);return Object.assign(Object.assign({},r),{color:n})})).map(OL);return Object.assign(Object.assign({},n&&{title:n}),{items:i})}(u[0]);if(o&&g.items.sort(((t,e)=>o(t)-o(e))),a&&(g.items=g.items.filter(a)),NL(g))return void wL({root:t,single:h,emitter:s,event:e});const{offsetX:M,offsetY:O}=e;w&&xL({root:t,data:g,x:M,y:O,render:r,event:e,single:h,position:d,enterable:p,mount:y,bounding:v,css:E}),s.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:{data:d_(c,m)}}))}),c,{leading:l,trailing:u}),T=e=>{wL({root:t,single:h,emitter:s,event:e})},P=()=>{M||(t.addEventListener("pointermove",_),t.addEventListener("pointerleave",T))},C=()=>{M||(t.removeEventListener("pointermove",_),t.removeEventListener("pointerleave",T))},N=({nativeEvent:t,data:e})=>{if(t)return;const n=sL(k,e.data,g);if(!n)return;const r=n.getBBox(),{x:i,y:o,width:a,height:s}=r;_({target:n,offsetX:i+a/2,offsetY:o+s/2})},L=({nativeEvent:e}={})=>{e||wL({root:t,single:h,emitter:s,nativeEvent:!1})};return s.on("tooltip:show",N),s.on("tooltip:hide",L),s.on("tooltip:enable",(()=>{P()})),s.on("tooltip:disable",(()=>{C(),ML({root:t,single:h})})),P(),()=>{C(),s.off("tooltip:show",N),s.off("tooltip:hide",L),O?wL({root:t,single:h,emitter:s,nativeEvent:!1}):ML({root:t,single:h})}}function RL(t){const{shared:e,crosshairs:n,series:r,name:i,item:o=(()=>({})),facet:a=!1}=t,s=he(t,["shared","crosshairs","series","name","item","facet"]);return(t,i,c)=>{const{container:l,view:u}=t,{scale:f,markState:h,coordinate:d,theme:p}=u,g=PL(h,"seriesTooltip"),m=PL(h,"crosshairs"),y=YN(l),v=CL(r,g);if(v&&function(t){return Array.from(t.values()).some((t=>{var e;return(null===(e=t.interaction)||void 0===e?void 0:e.seriesTooltip)&&t.tooltip}))}(h)&&!a)return LL(y,Object.assign(Object.assign({},s),{theme:p,elements:WN,scale:f,coordinate:d,crosshairs:CL(n,m),item:o,emitter:c}));if(v&&a){const e=i.filter((e=>e!==t&&e.options.parentKey===t.options.key)),r=$N(t,i),a=e[0].view.scale,l=y.getBounds(),u=l.min[0],f=l.min[1];return Object.assign(a,{facet:!0}),LL(y.parentNode.parentNode,Object.assign(Object.assign({},s),{theme:p,elements:()=>r,scale:a,coordinate:d,crosshairs:CL(n,m),item:o,startX:u,startY:f,emitter:c}))}return jL(y,Object.assign(Object.assign({},s),{datum:ZN(u),elements:WN,scale:f,coordinate:d,groupKey:e?t=>t.__data__.x:void 0,item:o,emitter:c,view:u,theme:p,shared:e}))}}lL.props={reapplyWhenUpdate:!0},uL.props={reapplyWhenUpdate:!0},fL.props={reapplyWhenUpdate:!0},dL.props={reapplyWhenUpdate:!0},pL.props={reapplyWhenUpdate:!0},gL.props={reapplyWhenUpdate:!0},mL.props={reapplyWhenUpdate:!0},RL.props={reapplyWhenUpdate:!0};const IL="legend-category",BL="legend-continuous",DL="items-item",FL="legend-category-item-marker",zL="legend-category-item-label";function GL(t){return t.getElementsByClassName(FL)[0]}function WL(t){return t.getElementsByClassName(zL)[0]}function $L(t){return t.getElementsByClassName(DL)}function HL(t){return t.getElementsByClassName(IL)}function YL(t){return t.getElementsByClassName(BL)}function VL(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function qL(t,{legend:e,channel:n,value:r,ordinal:i,channels:o,allChannels:a,facet:s=!1}){return pe(this,void 0,void 0,(function*(){const{view:c,update:l,setState:u}=t;u(e,(t=>{const{marks:e}=t,l=e.map((t=>{if("legends"===t.type)return t;const{transform:e=[]}=t,l=e.findIndex((({type:t})=>t.startsWith("group")||t.startsWith("bin"))),u=[...e];u.splice(l+1,0,{type:"filter",[n]:{value:r,ordinal:i}});const f=Object.fromEntries(o.map((t=>[t,{domain:c.scale[t].getOptions().domain}])));return V({},t,Object.assign(Object.assign({transform:u,scale:f},!i&&{animate:!1}),{legend:!s&&Object.fromEntries(a.map((t=>[t,{preserve:!0}])))}))}));return Object.assign(Object.assign({},t),{marks:l})})),yield l()}))}function UL(t,e){for(const n of t)qL(n,Object.assign(Object.assign({},e),{facet:!0}))}function XL(){return(t,e,n)=>{const{container:r}=t,i=e.filter((e=>e!==t)),o=i.length>0,a=t=>VL(t).scales.map((t=>t.name)),s=[...HL(r),...YL(r)],c=s.flatMap(a),l=Z(o?UL:qL,50,{trailing:!0}),u=s.map((e=>{const{name:s,domain:u}=VL(e).scales[0],f={legend:e,channel:s,channels:a(e),allChannels:c};return e.className===IL?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:ur(h,"marker")},p={unselected:ur(h,"label")},{setState:g,removeState:m}=QN(d,void 0),{setState:y,removeState:v}=QN(p,void 0),b=Array.from(e(t));let x=b.map(i);const w=()=>{for(const t of b){const e=i(t),o=n(t),a=r(t);x.includes(e)?(m(o,"unselected"),v(a,"unselected")):(g(o,"unselected"),y(a,"unselected"))}};for(const e of b){const n=()=>{oL(t,"pointer")},r=()=>{aL(t)},c=t=>pe(this,void 0,void 0,(function*(){const n=i(e),r=x.indexOf(n);-1===r?x.push(n):x.splice(r,1),0===x.length&&x.push(...b.map(i)),yield o(x),w();const{nativeEvent:c=!0}=t;c&&(x.length===b.length?a.emit("legend:reset",{nativeEvent:c}):a.emit("legend:filter",Object.assign(Object.assign({},t),{nativeEvent:c,data:{channel:s,values:x}})))}));e.addEventListener("click",c),e.addEventListener("pointerenter",n),e.addEventListener("pointerout",r),l.set(e,c),u.set(e,n),f.set(e,r)}const M=t=>pe(this,void 0,void 0,(function*(){const{nativeEvent:e}=t;if(e)return;const{data:n}=t,{channel:r,values:i}=n;r===s&&(x=i,yield o(x),w())})),O=t=>pe(this,void 0,void 0,(function*(){const{nativeEvent:e}=t;e||(x=b.map(i),yield o(x),w())}));return a.on("legend:filter",M),a.on("legend:reset",O),()=>{for(const t of b)t.removeEventListener("click",l.get(t)),t.removeEventListener("pointerenter",u.get(t)),t.removeEventListener("pointerout",f.get(t)),a.off("legend:filter",M),a.off("legend:reset",O)}}(r,{legends:$L,marker:GL,label:WL,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 KL(){return(t,e,n)=>{const{container:r,view:i,options:o}=t,a=HL(r),s=WN(r),c=t=>VL(t).scales[0].name,l=t=>{const{scale:{[t]:e}}=i;return e},u=tL(o,["active","inactive"]),f=eL(s,ZN(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=$L(t),o=l(r),a=Pn(s,(t=>o.invert(t.__data__[r]))),{state:d={}}=t.attributes,{inactive:p={}}=d,{setState:g,removeState:m}=QN(u,f),y={inactive:ur(p,"marker")},v={inactive:ur(p,"label")},{setState:b,removeState:x}=QN(y),{setState:w,removeState:M}=QN(v),O=t=>{for(const e of i){const n=GL(e),r=WL(e);e===t||null===t?(x(n,"inactive"),M(r,"inactive")):(b(n,"inactive"),w(r,"inactive"))}},E=(t,i)=>{const o=e(i),c=new Set(a.get(o));for(const t of s)c.has(t)?g(t,"active"):g(t,"inactive");O(i);const{nativeEvent:l=!0}=t;l&&n.emit("legend:highlight",Object.assign(Object.assign({},t),{nativeEvent:l,data:{channel:r,value:o}}))},k=new Map;for(const t of i){const e=e=>{E(e,t)};t.addEventListener("pointerover",e),k.set(t,e)}const S=t=>{for(const t of s)m(t,"inactive","active");O(null);const{nativeEvent:e=!0}=t;e&&n.emit("legend:unhighlight",{nativeEvent:e})},A=t=>{const{nativeEvent:n,data:o}=t;if(n)return;const{channel:a,value:s}=o;if(a!==r)return;const c=i.find((t=>e(t)===s));c&&E({nativeEvent:!1},c)},_=t=>{const{nativeEvent:e}=t;e||S({nativeEvent:!1})};t.addEventListener("pointerleave",S),n.on("legend:highlight",A),n.on("legend:unhighlight",_);const T=()=>{t.removeEventListener(S),n.off("legend:highlight",A),n.off("legend:unhighlight",_);for(const[t,e]of k)t.removeEventListener(e)};h.push(T)}return()=>h.forEach((t=>t()))}}function ZL(t,e){const[n,r,i,o]=t,[a,s,c,l]=e;return!(a>i||c<n||s>o||l<r)}function QL(t){const{width:e,height:n}=t.getBBox();return[0,0,e,n]}function JL(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}const tj=bm((t=>{const e=t.attributes,{x:n,y:r,width:i,height:o,class:a,renders:s={},handleSize:c=10,document:l}=e,u=he(e,["x","y","width","height","class","renders","handleSize","document"]);if(!l||void 0===i||void 0===o||void 0===n||void 0===r)return;const f=c/2,h=(t,e,n)=>{t.handle||(t.handle=n.createElement("rect"),t.append(t.handle));const{handle:r}=t;return r.attr(e),r},d=ur(hr(u,"handleNW","handleNE"),"handleN"),{render:p=h}=d,g=he(d,["render"]),m=ur(u,"handleE"),{render:y=h}=m,v=he(m,["render"]),b=ur(hr(u,"handleSE","handleSW"),"handleS"),{render:x=h}=b,w=he(b,["render"]),M=ur(u,"handleW"),{render:O=h}=M,E=he(M,["render"]),k=ur(u,"handleNW"),{render:S=h}=k,A=he(k,["render"]),_=ur(u,"handleNE"),{render:T=h}=_,P=he(_,["render"]),C=ur(u,"handleSE"),{render:N=h}=C,L=he(C,["render"]),j=ur(u,"handleSW"),{render:R=h}=j,I=he(j,["render"]),B=t=>()=>{const e=bm((e=>((t,e)=>{const{id:n}=t,r=he(t.attributes,["x","y"]),i=e(t,Object.assign({x:0,y:0},r),l);i.id=n,i.style.draggable=!0})(e,t)));return new e({})},D=tm(t).attr("className",a).style("x",n).style("y",r).style("draggable",!0);D.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(JL,Object.assign({width:i,height:o},hr(u,"handle"))),D.maybeAppend("handle-n",B(p)).style("x",f).style("y",-f).style("width",i-c).style("height",c).style("fill","transparent").call(JL,g),D.maybeAppend("handle-e",B(y)).style("x",i-f).style("y",f).style("width",c).style("height",o-c).style("fill","transparent").call(JL,v),D.maybeAppend("handle-s",B(x)).style("x",f).style("y",o-f).style("width",i-c).style("height",c).style("fill","transparent").call(JL,w),D.maybeAppend("handle-w",B(O)).style("x",-f).style("y",f).style("width",c).style("height",o-c).style("fill","transparent").call(JL,E),D.maybeAppend("handle-nw",B(S)).style("x",-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(JL,A),D.maybeAppend("handle-ne",B(T)).style("x",i-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(JL,P),D.maybeAppend("handle-se",B(N)).style("x",i-f).style("y",o-f).style("width",c).style("height",c).style("fill","transparent").call(JL,L),D.maybeAppend("handle-sw",B(R)).style("x",-f).style("y",o-f).style("width",c).style("height",c).style("fill","transparent").call(JL,I)}));function ej(t,e){var{brushed:n=(()=>{}),brushended:r=(()=>{}),brushcreated:i=(()=>{}),brushstarted:o=(()=>{}),brushupdated:a=(()=>{}),extent:s=QL(t),brushRegion:c=((t,e,n,r,i)=>[t,e,n,r]),reverse:l=!1,fill:u="#777",fillOpacity:f="0.3",stroke:h="#fff",selectedHandles:d=["handle-n","handle-e","handle-s","handle-w","handle-nw","handle-ne","handle-se","handle-sw"]}=e,p=he(e,["brushed","brushended","brushcreated","brushstarted","brushupdated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let g=null,m=null,y=null,v=null,b=null,x=!1;const[w,M,O,E]=s;oL(t,"crosshair"),t.style.draggable=!0;const k=(t,e,n)=>{if(o(n),v&&v.remove(),b&&b.remove(),g=[t,e],l)return S();A()},S=()=>{b=new Pp({style:Object.assign(Object.assign({},p),{fill:u,fillOpacity:f,stroke:h,pointerEvents:"none"})}),v=new tj({style:{x:0,y:0,width:0,height:0,draggable:!0,document:t.ownerDocument},className:"mask"}),t.appendChild(b),t.appendChild(v)},A=()=>{v=new tj({style:Object.assign(Object.assign({document:t.ownerDocument,x:0,y:0},p),{fill:u,fillOpacity:f,stroke:h,draggable:!0}),className:"mask"}),t.appendChild(v)},_=(t=!0)=>{v&&v.remove(),b&&b.remove(),g=null,m=null,y=null,x=!1,v=null,b=null,r(t)},T=(t,e,r=!0)=>{const[i,o,a,u]=function(t,e,n,r,i){const[o,a,s,c]=i;return[Math.max(o,Math.min(t,n)),Math.max(a,Math.min(e,r)),Math.min(s,Math.max(t,n)),Math.min(c,Math.max(e,r))]}(t[0],t[1],e[0],e[1],s),[f,h,d,p]=c(i,o,a,u,s);return l?C(f,h,d,p):P(f,h,d,p),n(f,h,d,p,r),[f,h,d,p]},P=(t,e,n,r)=>{v.style.x=t,v.style.y=e,v.style.width=n-t,v.style.height=r-e},C=(t,e,n,r)=>{b.style.d=`\n M${w},${M}L${O},${M}L${O},${E}L${w},${E}Z\n M${t},${e}L${t},${r}L${n},${r}L${n},${e}Z\n `,v.style.x=t,v.style.y=e,v.style.width=n-t,v.style.height=r-e},N={"handle-n":{vector:[0,1,0,0],cursor:"ns-resize"},"handle-e":{vector:[0,0,1,0],cursor:"ew-resize"},"handle-s":{vector:[0,0,0,1],cursor:"ns-resize"},"handle-w":{vector:[1,0,0,0],cursor:"ew-resize"},"handle-nw":{vector:[1,1,0,0],cursor:"nwse-resize"},"handle-ne":{vector:[0,1,1,0],cursor:"nesw-resize"},"handle-se":{vector:[0,0,1,1],cursor:"nwse-resize"},"handle-sw":{vector:[1,0,0,1],cursor:"nesw-resize"}},L=t=>R(t)||j(t),j=t=>{const{id:e}=t;return-1!==d.indexOf(e)&&new Set(Object.keys(N)).has(e)},R=t=>t===v.getElementById("selection"),I=e=>{const{target:n}=e,[r,i]=UN(t,e);if(!v||!L(n))return k(r,i,e),void(x=!0);L(n)&&(y=[r,i])},B=e=>{const{target:n}=e,r=UN(t,e);if(!g)return;if(!y)return T(g,r);if(R(n))return(t=>{const e=(t,e,n,r,i)=>t+e<r?r-e:t+n>i?i-n:t,n=t[0]-y[0],r=t[1]-y[1],i=e(n,g[0],m[0],w,O),o=e(r,g[1],m[1],M,E),a=[g[0]+i,g[1]+o],s=[m[0]+i,m[1]+o];T(a,s)})(r);const[i,o]=[r[0]-y[0],r[1]-y[1]],{id:a}=n;if(N[a]){const[t,e,n,r]=N[a].vector;return T([g[0]+i*t,g[1]+o*e],[m[0]+i*n,m[1]+o*r])}},D=e=>{if(y){y=null;const{x:t,y:n,width:r,height:i}=v.style;return g=[t,n],m=[t+r,n+i],void a(t,n,t+r,n+i,e)}m=UN(t,e);const[n,r,o,s]=T(g,m);x=!1,i(n,r,o,s,e)},F=t=>{const{target:e}=t;v&&!L(e)&&_()},z=e=>{const{target:n}=e;v&&L(n)&&!x?R(n)?oL(t,"move"):j(n)&&oL(t,N[n.id].cursor):oL(t,"crosshair")},G=()=>{oL(t,"default")};return t.addEventListener("dragstart",I),t.addEventListener("drag",B),t.addEventListener("dragend",D),t.addEventListener("click",F),t.addEventListener("pointermove",z),t.addEventListener("pointerleave",G),{mask:v,move(t,e,n,r,i=!0){v||k(t,e,{}),g=[t,e],m=[n,r],T([t,e],[n,r],i)},remove(t=!0){v&&_(t)},destroy(){v&&_(!1),oL(t,"default"),t.removeEventListener("dragstart",I),t.removeEventListener("drag",B),t.removeEventListener("dragend",D),t.removeEventListener("click",F),t.removeEventListener("pointermove",z),t.removeEventListener("pointerleave",G)}}}function nj(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 rj(t,e,n){return nj(t,e,n).map((t=>t.options))}function ij(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,m=he(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const y=n(t),v=i(t),b=v.flatMap(n),x=eL(y,o),w=ur(m,"mask"),{setState:M,removeState:O}=QN(p,x),E=new Map,{width:k,height:S,x:A=0,y:_=0}=d(t),T=s||[0,0,k,S],P=()=>{for(const t of[...y,...b])O(t,"active","inactive")},C=(t,e,n,r)=>{var i;for(const t of v)null===(i=t.brush)||void 0===i||i.remove();const o=new Set;for(const i of y){const{min:a,max:s}=i.getLocalBounds(),[c,l]=a,[u,f]=s;ZL([c,l,u,f],[t,e,n,r])?(M(i,"active"),o.add(h(i))):M(i,"inactive")}for(const t of b)o.has(h(t))?M(t,"active"):M(t,"inactive")},N=()=>{for(const t of y)O(t,"inactive");for(const t of E.values())t.remove();E.clear()},L=(t,e,n,r)=>{const i=t=>{const e=t.cloneNode();return e.__data__=t.__data__,t.parentNode.appendChild(e),E.set(t,e),e};for(const o of y){const a=E.get(o)||i(o);a.style.clipPath=new Lp({style:{x:t+A,y:e+_,width:n-t,height:r-e}}),M(o,"inactive"),M(a,"active")}},j=ej(t,Object.assign(Object.assign({},w),{extent:T,brushRegion:a,reverse:c,selectedHandles:r,brushended:t=>{const e=f?N:P;t&&g.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{const o=WE(t,e,n,r,l,u);i&&g.emit("brush:highlight",{nativeEvent:!0,data:{selection:o}});(f?L:C)(t,e,n,r)},brushcreated:(t,e,n,r,i)=>{const o=WE(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=WE(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=$E(o,r),c=$E(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 B=j.destroy.bind(j);return j.destroy=()=>{g.off("brush:highlight",R),g.off("brush:remove",I),B()},j}function oj(t){var{facet:e,brushKey:n}=t,r=he(t,["facet","brushKey"]);return(t,i,o)=>{const{container:a,view:s,options:c}=t,l=YN(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 ij(l.parentNode.parentNode,Object.assign(Object.assign({elements:()=>$N(t,i),datum:ZN(HN(t,i).map((t=>t.view))),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[n,a,s,c],state:tL(HN(t,i).map((t=>t.options)),f),emitter:o,scale:h,coordinate:d,selectedHandles:void 0},u),r))}const p=ij(l,Object.assign(Object.assign({elements:WN,key:t=>t.__data__.key,siblings:()=>function(t,e,n){return nj(t,e,n).map((t=>YN(t.container)))}(t,i,n),datum:ZN([s,...nj(t,i,n).map((t=>t.view))]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:tL([c,...rj(t,i,n)],f),emitter:o,scale:h,coordinate:d,selectedHandles:void 0},u),r));return l.brush=p,()=>p.destroy()}}function aj(t,e,n,r,i){const[,o,,a]=i;return[t,o,n,a]}function sj(t){return oj(Object.assign(Object.assign({},t),{brushRegion:aj,selectedHandles:["handle-e","handle-w"]}))}function cj(t,e,n,r,i){const[o,,a]=i;return[o,e,a,r]}function lj(t){return oj(Object.assign(Object.assign({},t),{brushRegion:cj,selectedHandles:["handle-n","handle-s"]}))}const uj="axis",fj="axis-line",hj="axis-main-group",dj="axis-hot-area";function pj(t){return t.getElementsByClassName(uj)}function gj(t){return t.getElementsByClassName(fj)[0]}function mj(t){return function(t){return t.getElementsByClassName(hj)[0]}(t).getLocalBounds()}function yj(t,e){var{cross:n,offsetX:r,offsetY:i}=e,o=he(e,["cross","offsetX","offsetY"]);const a=mj(t),s=gj(t),[c]=s.getLocalBounds().min,[l,u]=a.min,[f,h]=a.max,d=2*(f-l);return{brushRegion:cj,hotZone:new Lp({className:dj,style:Object.assign({x:n?l:c-d/2,width:n?d/2:d,y: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 vj(t,e){var{offsetY:n,offsetX:r,cross:i=!1}=e,o=he(e,["offsetY","offsetX","cross"]);const a=mj(t),s=gj(t),[,c]=s.getLocalBounds().min,[l,u]=a.min,[f,h]=a.max,d=h-u;return{brushRegion:aj,hotZone:new Lp({className:dj,style:Object.assign({x:l,width:f-l,y:i?u:c-d,height:i?d:2*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 bj(t){return(e,n,r)=>{const{container:i,view:o,options:a}=e,s=YN(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=he(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const p=r(t),g=n(t),m=eL(p,a),{setState:y,removeState:v}=QN(u,m),b=new Map,x=ur(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)))),M=g.map((t=>t.attributes.scale)),O=t=>t.length>2?[t[0],t[t.length-1]]:t,E=new Map,k=()=>{E.clear();for(let t=0;t<g.length;t++){const e=M[t],{domain:n}=e.getOptions();E.set(t,O(n))}};k();const S=(t,e)=>{const n=[];for(const t of p){const e=i(t);w(e)?(y(t,"active"),n.push(t)):y(t,"inactive")}E.set(t,_(n,t)),e&&f.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!T)return Array.from(E.values());const t=[];for(const[e,n]of E){const r=M[e],{name:i}=r.getOptions();"x"===i?t[0]=n:t[1]=n}return t})()}})},A=t=>{for(const t of p)v(t,"active","inactive");k(),t&&f.emit("brushAxis:remove",{nativeEvent:!0})},_=(t,e)=>{const n=M[e],{name:r}=n.getOptions(),i=t.map((t=>{const e=t.__data__;return n.invert(e[r])}));return O(GE(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)?vj:yj,{hotZone:r,brushRegion:i,extent:a}=n(e,{offsetY:s,offsetX:c,cross:T,zIndex:999,fill:"transparent"});e.parentNode.appendChild(r);const u=ej(r,Object.assign(Object.assign({},x),{reverse:l,brushRegion:i,brushended(n){b.delete(e),0===Array.from(b.entries()).length?A(n):S(t,n)},brushed(n,r,i,o,s){b.set(e,a(n,r,i,o)),S(t,s)}}));P.push(u)}const C=(t={})=>{const{nativeEvent:e}=t;e||P.forEach((t=>t.remove(!1)))},N=(t,e,n)=>{const[r,i]=t,a=L(r,e,n),s=L(i,e,n)+(t=>t.getStep?t.getStep():0)(e);return o(n)?[a,-1/0,s,1/0]:[-1/0,a,1/0,s]},L=(t,e,n)=>{const{height:r,width:i}=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=M[t];r.move(...N(e,n,i),!1)}else r.remove(!1)}};return f.on("brushAxis:remove",C),f.on("brushAxis:highlight",j),()=>{P.forEach((t=>t.destroy())),f.off("brushAxis:remove",C),f.off("brushAxis:highlight",j)}}(i,Object.assign({elements:WN,axes:pj,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:ZN(o),state:tL(a,["active",["inactive",{opacity:.5}]]),coordinate:u,emitter:r},t))}}function xj(t){var{hideX:e=!0,hideY:n=!0}=t,r=he(t,["hideX","hideY"]);return(t,i,o)=>{const{container:a,view:s,options:c,update:l,setState:u}=t,f=YN(a);let h=!1,d=!1,p=s;const{scale:g,coordinate:m}=s;return function(t,e){var{filter:n,reset:r,brushRegion:i,extent:o,reverse:a,emitter:s,scale:c,coordinate:l,selection:u,series:f=!1}=e;const h=ur(he(e,["filter","reset","brushRegion","extent","reverse","emitter","scale","coordinate","selection","series"]),"mask"),{width:d,height:p}=t.getBBox(),g=o||[0,0,d,p],m=function(t=300){let e=null;return n=>{const{timeStamp:r}=n;return null!==e&&r-e<t?(e=r,!0):(e=r,!1)}}(),y=ej(t,Object.assign(Object.assign({},h),{extent:g,brushRegion:i,reverse:a,brushcreated:function(t,e,r,i,o){o.nativeEvent=!0,n(u(t,e,r,i),o),y.remove()}}));function v(t){m(t)&&(t.nativeEvent=!0,r(t))}t.addEventListener("click",v);const b=({nativeEvent:t,data:e})=>{if(t)return;const{selection:r}=e;n(r,{nativeEvent:!1})};return s.on("brush:filter",b),()=>{y.destroy(),s.off("brush:filter",b),t.removeEventListener("click",v)}}(f,Object.assign(Object.assign({brushRegion:(t,e,n,r)=>[t,e,n,r],selection:(t,e,n,r)=>{const{scale:i,coordinate:o}=p;return WE(t,e,n,r,i,o)},filter:(t,r)=>pe(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=>V({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:m},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),r))}}function wj(t){return xj(Object.assign(Object.assign({hideX:!0},t),{brushRegion:aj}))}function Mj(t){return xj(Object.assign(Object.assign({hideY:!0},t),{brushRegion:cj}))}const Oj="slider";function Ej(t,e,n,r=!1,i="x",o="y"){const{marks:a}=t,s=a.map((t=>{var a,s;return V({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 kj(t,e,n){const[r,i]=t,o=n?t=>1-t:t=>t;return GE(e,[zE(e,o(r),!0),zE(e,o(i),!1)])}function Sj(t){return[t[0],t[t.length-1]]}function Aj({initDomain:t={},className:e=Oj,prefix:n="slider",setValue:r=((t,e)=>t.setValues(e)),hasState:i=!1,wait:o=50,leading:a=!0,trailing:s=!1}){return(c,l,u)=>{const{container:f,view:h,update:d,setState:p}=c,g=f.getElementsByClassName(e);if(!g.length)return()=>{};let m=!1;const{scale:y,coordinate:v,layout:b}=h,{paddingLeft:x,paddingTop:w,paddingBottom:M,paddingRight:O}=b,{x:E,y:k}=y,S=Bc(v),A=t=>{const e="vertical"===t?"y":"x",n="vertical"===t?"x":"y";return S?[n,e]:[e,n]},_=new Map,T=new Set,P={x:t.x||E.getOptions().domain,y:t.y||k.getOptions().domain};for(const t of g){const{orientation:e}=t.attributes,[c,l]=A(e),f=`${n}${B(c)}:filter`,h="x"===c,{ratio:g}=E.getOptions(),{ratio:v}=k.getOptions(),b=t=>{if(t.data){const{selection:e}=t.data,[n=Sj(P.x),r=Sj(P.y)]=e;return h?[GE(E,n,g),GE(k,r,v)]:[GE(k,r,v),GE(E,n,g)]}const{value:n}=t.detail;return[kj(n,y[c],S&&"horizontal"===e),P[l]]},C=Z((e=>pe(this,void 0,void 0,(function*(){if(m)return;m=!0;const{nativeEvent:r=!0}=e,[o,a]=b(e);if(P[c]=o,P[l]=a,r){const t=h?o:a,n=h?a:o;u.emit(f,Object.assign(Object.assign({},e),{nativeEvent:r,data:{selection:[Sj(t),Sj(n)]}}))}p(t,(t=>Object.assign(Object.assign({},Ej(t,{[c]:{domain:o,nice:!1}},n,i,c,l)),{paddingLeft:x,paddingTop:w,paddingBottom:M,paddingRight:O}))),yield d(),m=!1}))),o,{leading:a,trailing:s}),N=e=>{const{nativeEvent:n}=e;if(n)return;const{data:i}=e,{selection:o}=i,[a,s]=o;t.dispatchEvent(new Dd("valuechange",{data:i,nativeEvent:!1}));const c=h?$E(a,E):$E(s,k);r(t,c)};u.on(f,N),t.addEventListener("valuechange",C),_.set(t,C),T.add([f,N])}return d(),()=>{for(const[t,e]of _)t.removeEventListener("valuechange",e);for(const[t,e]of T)u.off(t,e)}}}const _j="g2-scrollbar";function Tj(t={}){return(e,n,r)=>{const{view:i,container:o}=e;if(!o.getElementsByClassName(_j).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 Aj(Object.assign(Object.assign({},t),{initDomain:l,className:_j,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0])}))(e,n,r)}}function Pj(t,e,n){return`<${t} style="${Object.entries(n).map((([t,e])=>{return`${n=t,n.replace(/([A-Z])/g,"-$1").toLowerCase()}:${e}`;var n})).join(";")}">${e}</${t}>`}const Cj={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 Nj(t){return"text"===t.nodeName&&!!t.isOverflowing()}function Lj(t){var{offsetX:e=8,offsetY:n=8}=t,r=he(t,["offsetX","offsetY"]);return t=>{const{container:i}=t,[o,a]=i.getBounds().min,s=ur(r,"tip"),c=new Set,l=t=>{const{target:r}=t;if(!Nj(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 Ap({className:"poptip",style:{innerHTML:Pj("div",d,Object.assign(Object.assign({},Cj),s)),x:f,y:h}});i.appendChild(p),r.tip=p,c.add(p)},u=t=>{const{target:e}=t;Nj(e)?e.tip&&(e.tip.remove(),e.tip=null,c.delete(e.tip)):t.stopPropagation()};return i.addEventListener("pointerover",l),i.addEventListener("pointerout",u),()=>{i.removeEventListener("pointerover",l),i.removeEventListener("pointerout",u),c.forEach((t=>t.remove()))}}}function jj(t){const{min:e,max:n}=t;return[[e[0],e[1]],[n[0],n[1]]]}function Rj(t,e){const[n,r]=t,[i,o]=e;return n>=i[0]&&n<=o[0]&&r>=i[1]&&r<=o[1]}Lj.props={reapplyWhenUpdate:!0};const Ij=t=>{const{priority:e}=t;return t=>{const n=[];return e&&t.sort(e),t.forEach((t=>{GN(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]}(jj(e),jj(t.getLocalBounds()))));r?zN(t):n.push(t)})),t}};function Bj([t,e],[n,r]){return r>t&&e>n}function Dj(){const t=new Map;return[e=>t.get(e),(e,n)=>t.set(e,n)]}function Fj(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 zj=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]=Dj(),[s,c]=Dj(),[l,u]=Dj(),[f,h]=Dj();for(const e of t){const{min:t,max:n}=Fj(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)=>dn(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])&&!Bj(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 Gj(t){let e=t/255;return e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),e}function Wj(t,e,n){return.2126*Gj(t)+.7152*Gj(e)+.0722*Gj(n)}function $j(t,e){const{r:n,g:r,b:i}=t,{r:o,g:a,b:s}=e,c=Wj(n,r,i),l=Wj(o,a,s);return(Math.max(c,l)+.05)/(Math.min(c,l)+.05)}function Hj(t,e){const n=Un(e,(e=>$j(t,function(t){return"object"==typeof t?t:Sf(t)}(e))));return e[n]}const Yj=t=>{const{threshold:e=4.5,palette:n=["#000","#fff"]}=t;return t=>(t.forEach((t=>{const r=t.attr("dependentElement").parsedStyle.fill;$j(t.parsedStyle.fill,r)<e&&t.attr("fill",Hj(r,n))})),t)},Vj=()=>t=>(t.forEach((t=>{GN(t);const e=t.attr("bounds"),n=function(t,e){const[n,r]=t;return!(Rj(n,e)&&Rj(r,e))}(jj(t.getLocalBounds()),e);n&&zN(t)})),t);function qj(){return{"data.fetch":UM,"data.inline":nO,"data.sortBy":eO,"data.sort":QM,"data.filter":ZM,"data.pick":JM,"data.rename":tO,"data.fold":XM,"data.slice":sO,"data.custom":rO,"data.map":iO,"data.join":aO,"data.kde":fO,"data.log":hO,"transform.stackY":Nr,"transform.binX":ks,"transform.bin":Es,"transform.dodgeX":ni,"transform.jitter":ja,"transform.jitterX":Ra,"transform.jitterY":Ia,"transform.symmetryY":Ba,"transform.diffY":Da,"transform.stackEnter":ri,"transform.normalizeY":ii,"transform.select":$a,"transform.selectX":Ha,"transform.selectY":Ya,"transform.groupX":rs,"transform.groupY":is,"transform.groupColor":os,"transform.group":ns,"transform.sortX":cs,"transform.sortY":us,"transform.sortColor":ls,"transform.flexX":fs,"transform.pack":ws,"transform.sample":As,"transform.filter":_s,"coordinate.cartesian":e,"coordinate.polar":r,"coordinate.transpose":i,"coordinate.theta":o,"coordinate.parallel":c,"coordinate.fisheye":l,"coordinate.radial":s,"coordinate.radar":u,"encode.constant":f,"encode.field":d,"encode.transform":h,"encode.column":p,"mark.interval":Zw,"mark.rect":Jw,"mark.line":rM,"mark.point":oM,"mark.text":sM,"mark.cell":lM,"mark.area":fM,"mark.link":dM,"mark.image":gM,"mark.polygon":yM,"mark.box":bM,"mark.vector":wM,"mark.lineX":kM,"mark.lineY":OM,"mark.connector":AM,"mark.range":CM,"mark.rangeX":LM,"mark.rangeY":RM,"mark.path":BM,"mark.shape":DM,"mark.density":pO,"mark.heatmap":mO,"palette.category10":yO,"palette.category20":vO,"scale.linear":xO,"scale.ordinal":wO,"scale.band":bO,"scale.identity":MO,"scale.point":OO,"scale.time":EO,"scale.log":kO,"scale.pow":SO,"scale.sqrt":PO,"scale.threshold":AO,"scale.quantile":_O,"scale.quantize":TO,"scale.sequential":CO,"scale.constant":NO,"theme.classic":IO,"theme.classicDark":FO,"theme.academy":GO,"theme.light":RO,"theme.dark":DO,"component.axisX":bE,"component.axisY":xE,"component.legendCategory":SE,"component.legendContinuous":CE,"component.legends":ZE,"component.title":DE,"component.sliderX":VE,"component.sliderY":qE,"component.scrollbarX":XE,"component.scrollbarY":KE,"animation.scaleInX":QE,"animation.scaleOutX":JE,"animation.scaleInY":tk,"animation.scaleOutY":ek,"animation.waveIn":pk,"animation.fadeIn":nk,"animation.fadeOut":rk,"animation.zoomIn":gk,"animation.zoomOut":mk,"animation.pathIn":yk,"animation.morphing":dk,"animation.growInX":vk,"animation.growInY":bk,"interaction.elementHighlight":lL,"interaction.elementHighlightByX":uL,"interaction.elementHighlightByColor":fL,"interaction.elementSelect":dL,"interaction.elementSelectByX":pL,"interaction.elementSelectByColor":gL,"interaction.fisheye":yL,"interaction.chartIndex":mL,"interaction.tooltip":RL,"interaction.legendFilter":XL,"interaction.legendHighlight":KL,"interaction.brushHighlight":oj,"interaction.brushXHighlight":sj,"interaction.brushYHighlight":lj,"interaction.brushAxisHighlight":bj,"interaction.brushFilter":xj,"interaction.brushXFilter":wj,"interaction.brushYFilter":Mj,"interaction.sliderFilter":Aj,"interaction.scrollbarFilter":Tj,"interaction.poptip":Lj,"composition.spaceLayer":RA,"composition.spaceFlex":IA,"composition.facetRect":QA,"composition.repeatMatrix":i_,"composition.facetCircle":u_,"composition.timingKeyframe":h_,"labelTransform.overlapHide":Ij,"labelTransform.overlapDodgeY":zj,"labelTransform.overflowHide":Vj,"labelTransform.contrastReverse":Yj}}function Uj(t,e){return class extends t{constructor(t){super(Object.assign(Object.assign({},t),{lib:e}))}}}const Xj={};const Kj=t=>t?parseInt(t):0;function Zj(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 Qj{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 Zj(this,(n=>{t===n.attr("key")&&(e=n)})),e}getNodesByType(t){const e=[];return Zj(this,(n=>{t===n.type&&e.push(n)})),e}getNodeByType(t){let e=null;return Zj(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 Jj=["width","height","depth","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title"],tR="__remove__",eR="__callback__";function nR(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function rR(t,e){const{width:n=640,height:r=480,autoFit:i,depth:o=0}=t;let a=n,s=r;if(i){const{width:t,height:n}=function(t){const e=getComputedStyle(t),n=t.clientWidth||Kj(e.width),r=t.clientHeight||Kj(e.height);return{width:n-(Kj(e.paddingLeft)+Kj(e.paddingRight)),height:r-(Kj(e.paddingTop)+Kj(e.paddingBottom))}}(e);a=t||a,s=n||s}return{width:Math.max(T(a)?a:1,1),height:Math.max(T(s)?s:1,1),depth:o}}function iR(t){const e=function(t){if(null!==t.type)return t;const e=t.children[t.children.length-1];for(const n of Jj)e.attr(n,t.attr(n));return e}(t),n=[e],r=new Map;for(r.set(e,nR(e));n.length;){const t=n.pop(),e=r.get(t),{children:i=[]}=t;for(const t of i)if(t.type===eR)e.children=t.value;else{const i=nR(t),{children:o=[]}=e;o.push(i),n.push(t),r.set(t,i),e.children=o}}return r.get(e)}function oR(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 Jj)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 Jj)void 0!==n[e]&&(t[e]=n[e],delete n[e]);return Object.assign(Object.assign({},t),{children:[n]})}return e}function aR(t,e,n){if("function"==typeof t){const e=new Qj;return e.value=t,e.type=eR,e}const{type:r,children:i}=t,o=he(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 sR(t,e){const{type:n,children:r}=e,i=he(e,["type","children"]);t.type===n||void 0===n?mr(t.value,i):"string"==typeof n&&(t.type=n,t.value=i)}function cR(t,e,n,r){if(!t)return;const i=[[t,e]];for(;i.length;){const[t,e]=i.shift(),o=aR(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 lR(t,e,{key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function uR(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 fR(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 hR(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(pr(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 dR(t,e,{ctor:n}){t.prototype[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}function pR(t,e,{ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}function gR(t){return e=>{for(const[n,r]of Object.entries(t)){const{type:t}=r;"value"===t?lR(e,n,r):"array"===t?uR(e,n,r):"object"===t?fR(e,n,r):"node"===t?dR(e,n,r):"container"===t?pR(e,n,r):"mix"===t&&hR(e,n)}return e}}function mR(t){return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,{type:"node",ctor:e}])))}const yR={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"}},vR=Object.assign(Object.assign({},yR),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),bR=Object.assign(Object.assign({},yR),{labelTransform:{type:"array"}});let xR=class extends Qj{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()&&GN(t)}hide(){const t=this.getGroup();t&&t.isVisible()&&zN(t)}};xR=de([gR(bR)],xR);let wR=class extends Qj{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)}};wR=de([gR(vR)],wR);const MR="G2_CHART_KEY";class OR extends xR{constructor(t){const{container:e,canvas:n,renderer:r,plugins:i,lib:o}=t;super(he(t,["container","canvas","renderer","plugins","lib"]),"view"),this._hasBindAutoFit=!1,this._rendering=!1,this._trailing=!1,this._trailingResolve=null,this._trailingReject=null,this._previousDefinedType=null,this._onResize=W((()=>{this.forceFit()}),300),this._renderer=r||new wS,this._plugins=i||[],this._container=function(t){if(void 0===t){const t=document.createElement("div");return t[tR]=!0,t}if("string"==typeof t)return document.getElementById(t);return t}(e),this._emitter=new kS,this._context={library:Object.assign(Object.assign({},o),Xj),emitter:this._emitter,canvas:n},this._create()}render(){if(this._rendering)return this._addToTrailing();this._context.canvas||this._createCanvas(),this._context.canvas.getConfig().supportsCSSTransform=!0,this._bindAutoFit(),this._rendering=!0;const t=new Promise(((t,e)=>RN(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 iR(this);const{type:e}=t;return e&&(this._previousDefinedType=e),function(t,e,n,r,i){const o=[[null,t,oR(t,e,n,r,i)]];for(;o.length;){const[t,e,n]=o.shift();if(e)if(n){sR(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 cR(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(SS.BEFORE_CLEAR),this._reset(),IN(0,this._context,!1),this.emit(SS.AFTER_CLEAR)}destroy(){this.options();this.emit(SS.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),IN(0,this._context,!0),this._container[tR]&&function(t){const e=t.parentNode;e&&e.removeChild(t)}(this._container),this.emit(SS.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;const{width:t,height:e}=rR(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(SS.BEFORE_CHANGE_SIZE);const n=this.render();return n.then((()=>{this.emit(SS.AFTER_CHANGE_SIZE)})),n}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(SS.BEFORE_CHANGE_SIZE),this.attr("width",t),this.attr("height",e);const n=this.render();return n.then((()=>{this.emit(SS.AFTER_CHANGE_SIZE)})),n}_create(){const{library:t}=this._context,e=["mark.mark",...Object.keys(t).filter((t=>t.startsWith("mark.")||"component.axisX"===t||"component.axisY"===t||"component.legends"===t))];this._marks={};for(const t of e){const e=t.split(".").pop();class n extends wR{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 xR{constructor(){super({},e)}};return n=de([gR(mR(this._marks))],n),[e,n]})));for(const t of Object.values(this._compositions))gR(mR(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=MR}=t,{width:n,height:r,depth:i}=rR(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}=rR(this.options(),this._container);this._plugins.push(new OS),this._plugins.forEach((t=>this._renderer.registerPlugin(t))),this._context.canvas=new qp({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))}}op.enableCSSParsing=!1;const ER=Uj(OR,Object.assign({},qj()));t.AREA_CLASS_NAME=Ak,t.Academy=GO,t.Bin=Es,t.BinX=ks,t.COMPONENT_CLASS_NAME=kk,t.Chart=ER,t.ChartEvent=SS,t.Classic=IO,t.ClassicDark=FO,t.Dark=DO,t.DiffY=Da,t.DodgeX=ni,t.ELEMENT_CLASS_NAME=Mk,t.Filter=_s,t.FlexX=fs,t.Group=ns,t.GroupColor=os,t.GroupX=rs,t.GroupY=is,t.Jitter=ja,t.JitterX=Ra,t.JitterY=Ia,t.LABEL_CLASS_NAME=Sk,t.LABEL_LAYER_CLASS_NAME=wk,t.Light=RO,t.LinearAxis=yE,t.MAIN_LAYER_CLASS_NAME=xk,t.MASK_CLASS_NAME="mask",t.MaybeDefaultX=Ur,t.MaybeDefaultY=Xr,t.MaybeFunctionAttribute=Jr,t.MaybeGradient=ei,t.MaybeIdentityX=qr,t.MaybeIdentityY=Vr,t.MaybeKey=Wr,t.MaybeSeries=$r,t.MaybeSize=Gr,t.MaybeStackY=jr,t.MaybeTitle=Br,t.MaybeTooltip=Kr,t.MaybeTuple=ti,t.MaybeTupleX=Yr,t.MaybeTupleY=Hr,t.MaybeVisualPosition=Qr,t.MaybeZeroPadding=Zr,t.MaybeZeroX=Dr,t.MaybeZeroY=Fr,t.MaybeZeroY1=hn,t.MaybeZeroZ=zr,t.NormalizeY=ii,t.PLOT_CLASS_NAME=Ek,t.Pack=ws,t.Runtime=OR,t.Sample=As,t.Select=$a,t.SelectX=Ha,t.SelectY=Ya,t.Selection=em,t.SortColor=ls,t.SortX=cs,t.SortY=us,t.StackEnter=ri,t.StackY=Nr,t.SymmetryY=Ba,t.VIEW_CLASS_NAME=Ok,t.corelib=qj,t.extend=Uj,t.register=function(t,e){Object.assign(Xj,{[t]:e})},t.render=RN,t.renderToMountedElement=function(t,e={},n=(()=>{}),r=(t=>{throw t})){var i;const{width:o=640,height:a=480}=t,s=LN(t),{group:c=new Sp,emitter:l=new kS,library:u}=e;(null==c?void 0:c.parentElement)||ar("renderToMountedElement can't render chart to unmounted group.");const f=tm(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(SS.BEFORE_RENDER),aN(Object.assign(Object.assign({},s),{width:o,height:a}),f,u,e).then((()=>{var t;null===(t=e.canvas)||void 0===t||t.requestAnimationFrame((()=>{l.emit(SS.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),c},t.select=tm,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G2={})}(this,(function(t){"use strict";const e=()=>[["cartesian"]];e.props={};const n=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1},n=Object.assign(Object.assign({},e),t);return Object.assign(Object.assign({},n),(r=n.startAngle,i=n.endAngle,r%=2*Math.PI,i%=2*Math.PI,r<0&&(r=2*Math.PI+r),i<0&&(i=2*Math.PI+i),r>=i&&(i+=2*Math.PI),{startAngle:r,endAngle:i}));var r,i},r=t=>{const{startAngle:e,endAngle:r,innerRadius:i,outerRadius:o}=n(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",e,r,i,o]]};r.props={};const i=()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]];i.props={transform:!0};const o=t=>{const{startAngle:e,endAngle:n,innerRadius:i,outerRadius:o}=((t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)})(t);return[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:o})]};o.props={};const a=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)},s=t=>{const{startAngle:e,endAngle:n,innerRadius:i,outerRadius:o}=a(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:o})]};s.props={};const c=()=>[["parallel",0,1,0,1]];c.props={};const l=({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]];l.props={transform:!0};const u=t=>{const{startAngle:e=-Math.PI/2,endAngle:n=3*Math.PI/2,innerRadius:i=0,outerRadius:o=1}=t;return[["parallel",0,1,0,1],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:o})]};u.props={};const f=({value:t})=>e=>e.map((()=>t));f.props={};const h=({value:t})=>e=>e.map(t);h.props={};const d=({value:t})=>e=>e.map((e=>e[t]));d.props={};const p=({value:t})=>()=>t;p.props={};var g=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},m=function(t){return"function"==typeof t},y=function(t){return null==t},v={}.toString,b=function(t,e){return v.call(t)==="[object "+e+"]"},x=function(t){return Array.isArray?Array.isArray(t):b(t,"Array")},w=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e};function M(t,e){if(t)if(x(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(w(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break}var O=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return M(t,(function(n,r){m(t)&&"prototype"===r||e.push(r)})),e};var E=function(t){return"object"==typeof t&&null!==t},k=function(t){if(!E(t)||!b(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};function S(t,e){if(!x(t))return null;var n;if(m(e)&&(n=e),k(e)&&(n=function(t){return function(t,e){var n=O(e),r=n.length;if(y(t))return!r;for(var i=0;i<r;i+=1){var o=n[i];if(e[o]!==t[o]||!(o in t))return!1}return!0}(t,e)}),n)for(var r=0;r<t.length;r+=1)if(n(t[r]))return t[r];return null}var A=function(t){if(x(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},_=function(t){if(x(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},T=function(t,e,n){if(!x(t)&&!k(t))return t;var r=n;return M(t,(function(t,n){r=e(r,t,n)})),r},P=function(t){return b(t,"String")};function C(t){if(g(t)){return t[t.length-1]}}var N=function(t,e,n){return t<e?e:t>n?n:t},L=function(t){return b(t,"Number")},j=1e-5;function R(t,e,n){return void 0===n&&(n=j),Math.abs(t-e)<n}var I=function(t,e){if(x(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var o=t[i],a=m(e)?e(o):o[e];a>r&&(n=o,r=a)}return n}},B=function(t,e){if(x(t)){for(var n,r=1/0,i=0;i<t.length;i++){var o=t[i],a=m(e)?e(o):o[e];a<r&&(n=o,r=a)}return n}},D=function(t,e){return(t%e+e)%e},F=function(t){return y(t)?"":t.toString()},z=function(t){var e=F(t);return e.charAt(0).toLowerCase()+e.substring(1)};var G=function(t){var e=F(t);return e.charAt(0).toUpperCase()+e.substring(1)},W=function(t){return b(t,"Boolean")},$=function(t){return void 0===t},H=function(t){if("object"!=typeof t||null===t)return t;var e;if(x(t)){e=[];for(var n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=H(t[n]):e[n]=t[n]}else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=H(t[i]):e[i]=t[i];return e},V=H;function Y(t,e,n){var r;return function(){var i=this,o=arguments,a=n&&!r;clearTimeout(r),r=setTimeout((function(){r=null,n||t.apply(i,o)}),e),a&&t.apply(i,o)}}function U(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(null==t)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function q(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(U(e,i)){var o=e[i];null!==o&&k(o)?(k(t[i])||(t[i]={}),n<r?q(t[i],o,n+1,r):t[i]=e[i]):x(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var X=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)q(t,e[r]);return t},K=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(P(t)||P(e))return!1;if(g(t)||g(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=K(t[r],e[r]));r++);return n}if(E(t)||E(e)){var i=Object.keys(t),o=Object.keys(e);if(i.length!==o.length)return!1;for(n=!0,r=0;r<i.length&&(n=K(t[i[r]],e[i[r]]));r++);return n}return!1},Z=K,Q=function(t,e,n){for(var r=0,i=P(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},J=Object.prototype.hasOwnProperty,tt=function(t,e){if(null===t||!k(t))return{};var n={};return M(e,(function(e){J.call(t,e)&&(n[e]=t[e])})),n},et=function(t,e){return T(t,(function(t,n,r){return e.includes(r)||(t[r]=n),t}),{})},nt=function(t,e,n){var r,i,o,a,s=0;n||(n={});var c=function(){s=!1===n.leading?0:Date.now(),r=null,a=t.apply(i,o),r||(i=o=null)},l=function(){var l=Date.now();s||!1!==n.leading||(s=l);var u=e-(l-s);return i=this,o=arguments,u<=0||u>e?(r&&(clearTimeout(r),r=null),s=l,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(c,u)),a};return l.cancel=function(){clearTimeout(r),s=0,r=i=o=null},l},rt=function(){};function it(t){return y(t)?0:g(t)?t.length:Object.keys(t).length}var ot=1e-6,at="undefined"!=typeof Float32Array?Float32Array:Array;function st(){var t=new at(9);return at!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var ct=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=n[0],d=n[1],p=n[2],g=n[3],m=n[4],y=n[5],v=n[6],b=n[7],x=n[8];return t[0]=h*r+d*a+p*l,t[1]=h*i+d*s+p*u,t[2]=h*o+d*c+p*f,t[3]=g*r+m*a+y*l,t[4]=g*i+m*s+y*u,t[5]=g*o+m*c+y*f,t[6]=v*r+b*a+x*l,t[7]=v*i+b*s+x*u,t[8]=v*o+b*c+x*f,t};function lt(){var t=new at(16);return at!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function ut(t){var e=new at(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function ft(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ht(t,e,n,r,i,o,a,s,c,l,u,f,h,d,p,g,m){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=c,t[8]=l,t[9]=u,t[10]=f,t[11]=h,t[12]=d,t[13]=p,t[14]=g,t[15]=m,t}function dt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function pt(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function gt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],m=e[14],y=e[15],v=n*s-r*a,b=n*c-i*a,x=n*l-o*a,w=r*c-i*s,M=r*l-o*s,O=i*l-o*c,E=u*g-f*p,k=u*m-h*p,S=u*y-d*p,A=f*m-h*g,_=f*y-d*g,T=h*y-d*m,P=v*T-b*_+x*A+w*S-M*k+O*E;return P?(P=1/P,t[0]=(s*T-c*_+l*A)*P,t[1]=(i*_-r*T-o*A)*P,t[2]=(g*O-m*M+y*w)*P,t[3]=(h*M-f*O-d*w)*P,t[4]=(c*S-a*T-l*k)*P,t[5]=(n*T-i*S+o*k)*P,t[6]=(m*x-p*O-y*b)*P,t[7]=(u*O-h*x+d*b)*P,t[8]=(a*_-s*S+l*E)*P,t[9]=(r*S-n*_-o*E)*P,t[10]=(p*M-g*x+y*v)*P,t[11]=(f*x-u*M-d*v)*P,t[12]=(s*k-a*A-c*E)*P,t[13]=(n*A-r*k+i*E)*P,t[14]=(g*b-p*w-m*v)*P,t[15]=(u*w-f*b+h*v)*P,t):null}function mt(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],c=t[7],l=t[8],u=t[9],f=t[10],h=t[11],d=t[12],p=t[13],g=t[14],m=t[15];return(e*a-n*o)*(f*m-h*g)-(e*s-r*o)*(u*m-h*p)+(e*c-i*o)*(u*g-f*p)+(n*s-r*a)*(l*m-h*d)-(n*c-i*a)*(l*g-f*d)+(r*c-i*s)*(l*p-u*d)}function yt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],g=e[12],m=e[13],y=e[14],v=e[15],b=n[0],x=n[1],w=n[2],M=n[3];return t[0]=b*r+x*s+w*f+M*g,t[1]=b*i+x*c+w*h+M*m,t[2]=b*o+x*l+w*d+M*y,t[3]=b*a+x*u+w*p+M*v,b=n[4],x=n[5],w=n[6],M=n[7],t[4]=b*r+x*s+w*f+M*g,t[5]=b*i+x*c+w*h+M*m,t[6]=b*o+x*l+w*d+M*y,t[7]=b*a+x*u+w*p+M*v,b=n[8],x=n[9],w=n[10],M=n[11],t[8]=b*r+x*s+w*f+M*g,t[9]=b*i+x*c+w*h+M*m,t[10]=b*o+x*l+w*d+M*y,t[11]=b*a+x*u+w*p+M*v,b=n[12],x=n[13],w=n[14],M=n[15],t[12]=b*r+x*s+w*f+M*g,t[13]=b*i+x*c+w*h+M*m,t[14]=b*o+x*l+w*d+M*y,t[15]=b*a+x*u+w*p+M*v,t}function vt(t,e,n){var r,i,o,a,s,c,l,u,f,h,d,p,g=n[0],m=n[1],y=n[2];return e===t?(t[12]=e[0]*g+e[4]*m+e[8]*y+e[12],t[13]=e[1]*g+e[5]*m+e[9]*y+e[13],t[14]=e[2]*g+e[6]*m+e[10]*y+e[14],t[15]=e[3]*g+e[7]*m+e[11]*y+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=f,t[9]=h,t[10]=d,t[11]=p,t[12]=r*g+s*m+f*y+e[12],t[13]=i*g+c*m+h*y+e[13],t[14]=o*g+l*m+d*y+e[14],t[15]=a*g+u*m+p*y+e[15]),t}function bt(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function xt(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],c=e[7],l=e[8],u=e[9],f=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+l*r,t[5]=a*i+u*r,t[6]=s*i+f*r,t[7]=c*i+h*r,t[8]=l*i-o*r,t[9]=u*i-a*r,t[10]=f*i-s*r,t[11]=h*i-c*r,t}function wt(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],c=e[3],l=e[8],u=e[9],f=e[10],h=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-l*r,t[1]=a*i-u*r,t[2]=s*i-f*r,t[3]=c*i-h*r,t[8]=o*r+l*i,t[9]=a*r+u*i,t[10]=s*r+f*i,t[11]=c*r+h*i,t}function Mt(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function Ot(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Et(t,e,n){var r,i,o,a=n[0],s=n[1],c=n[2],l=Math.hypot(a,s,c);return l<ot?null:(a*=l=1/l,s*=l,c*=l,r=Math.sin(e),o=1-(i=Math.cos(e)),t[0]=a*a*o+i,t[1]=s*a*o+c*r,t[2]=c*a*o-s*r,t[3]=0,t[4]=a*s*o-c*r,t[5]=s*s*o+i,t[6]=c*s*o+a*r,t[7]=0,t[8]=a*c*o+s*r,t[9]=s*c*o-a*r,t[10]=c*c*o+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function kt(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function St(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function At(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function _t(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,c=i+i,l=o+o,u=r*s,f=r*c,h=r*l,d=i*c,p=i*l,g=o*l,m=a*s,y=a*c,v=a*l;return t[0]=1-(d+g),t[1]=f+v,t[2]=h-y,t[3]=0,t[4]=f-v,t[5]=1-(u+g),t[6]=p+m,t[7]=0,t[8]=h+y,t[9]=p-m,t[10]=1-(u+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function Tt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Pt(t,e){var n=e[0],r=e[1],i=e[2],o=e[4],a=e[5],s=e[6],c=e[8],l=e[9],u=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(c,l,u),t}function Ct(t,e){var n=new at(3);Pt(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,s=e[1]*i,c=e[2]*o,l=e[4]*r,u=e[5]*i,f=e[6]*o,h=e[8]*r,d=e[9]*i,p=e[10]*o,g=a+u+p,m=0;return g>0?(m=2*Math.sqrt(g+1),t[3]=.25*m,t[0]=(f-d)/m,t[1]=(h-c)/m,t[2]=(s-l)/m):a>u&&a>p?(m=2*Math.sqrt(1+a-u-p),t[3]=(f-d)/m,t[0]=.25*m,t[1]=(s+l)/m,t[2]=(h+c)/m):u>p?(m=2*Math.sqrt(1+u-a-p),t[3]=(h-c)/m,t[0]=(s+l)/m,t[1]=.25*m,t[2]=(f+d)/m):(m=2*Math.sqrt(1+p-a-u),t[3]=(s-l)/m,t[0]=(h+c)/m,t[1]=(f+d)/m,t[2]=.25*m),t}function Nt(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],c=e[3],l=o+o,u=a+a,f=s+s,h=o*l,d=o*u,p=o*f,g=a*u,m=a*f,y=s*f,v=c*l,b=c*u,x=c*f,w=r[0],M=r[1],O=r[2],E=i[0],k=i[1],S=i[2],A=(1-(g+y))*w,_=(d+x)*w,T=(p-b)*w,P=(d-x)*M,C=(1-(h+y))*M,N=(m+v)*M,L=(p+b)*O,j=(m-v)*O,R=(1-(h+g))*O;return t[0]=A,t[1]=_,t[2]=T,t[3]=0,t[4]=P,t[5]=C,t[6]=N,t[7]=0,t[8]=L,t[9]=j,t[10]=R,t[11]=0,t[12]=n[0]+E-(A*E+P*k+L*S),t[13]=n[1]+k-(_*E+C*k+j*S),t[14]=n[2]+S-(T*E+N*k+R*S),t[15]=1,t}function Lt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,c=i+i,l=n*a,u=r*a,f=r*s,h=i*a,d=i*s,p=i*c,g=o*a,m=o*s,y=o*c;return t[0]=1-f-p,t[1]=u+y,t[2]=h-m,t[3]=0,t[4]=u-y,t[5]=1-l-p,t[6]=d+g,t[7]=0,t[8]=h+m,t[9]=d-g,t[10]=1-l-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function jt(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}var Rt=jt;function It(t,e,n,r,i,o,a){var s=1/(e-n),c=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*c,t[14]=(a+o)*l,t[15]=1,t}var Bt=It;function Dt(t,e,n,r,i,o,a){var s=1/(e-n),c=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*c,t[14]=o*l,t[15]=1,t}function Ft(t,e,n,r){var i,o,a,s,c,l,u,f,h,d,p=e[0],g=e[1],m=e[2],y=r[0],v=r[1],b=r[2],x=n[0],w=n[1],M=n[2];return Math.abs(p-x)<ot&&Math.abs(g-w)<ot&&Math.abs(m-M)<ot?dt(t):(u=p-x,f=g-w,h=m-M,i=v*(h*=d=1/Math.hypot(u,f,h))-b*(f*=d),o=b*(u*=d)-y*h,a=y*f-v*u,(d=Math.hypot(i,o,a))?(i*=d=1/d,o*=d,a*=d):(i=0,o=0,a=0),s=f*a-h*o,c=h*i-u*a,l=u*o-f*i,(d=Math.hypot(s,c,l))?(s*=d=1/d,c*=d,l*=d):(s=0,c=0,l=0),t[0]=i,t[1]=s,t[2]=u,t[3]=0,t[4]=o,t[5]=c,t[6]=f,t[7]=0,t[8]=a,t[9]=l,t[10]=h,t[11]=0,t[12]=-(i*p+o*g+a*m),t[13]=-(s*p+c*g+l*m),t[14]=-(u*p+f*g+h*m),t[15]=1,t)}function zt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}var Gt=yt,Wt=zt,$t=Object.freeze({__proto__:null,create:lt,clone:ut,copy:ft,fromValues:function(t,e,n,r,i,o,a,s,c,l,u,f,h,d,p,g){var m=new at(16);return m[0]=t,m[1]=e,m[2]=n,m[3]=r,m[4]=i,m[5]=o,m[6]=a,m[7]=s,m[8]=c,m[9]=l,m[10]=u,m[11]=f,m[12]=h,m[13]=d,m[14]=p,m[15]=g,m},set:ht,identity:dt,transpose:pt,invert:gt,adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],m=e[14],y=e[15];return t[0]=s*(h*y-d*m)-f*(c*y-l*m)+g*(c*d-l*h),t[1]=-(r*(h*y-d*m)-f*(i*y-o*m)+g*(i*d-o*h)),t[2]=r*(c*y-l*m)-s*(i*y-o*m)+g*(i*l-o*c),t[3]=-(r*(c*d-l*h)-s*(i*d-o*h)+f*(i*l-o*c)),t[4]=-(a*(h*y-d*m)-u*(c*y-l*m)+p*(c*d-l*h)),t[5]=n*(h*y-d*m)-u*(i*y-o*m)+p*(i*d-o*h),t[6]=-(n*(c*y-l*m)-a*(i*y-o*m)+p*(i*l-o*c)),t[7]=n*(c*d-l*h)-a*(i*d-o*h)+u*(i*l-o*c),t[8]=a*(f*y-d*g)-u*(s*y-l*g)+p*(s*d-l*f),t[9]=-(n*(f*y-d*g)-u*(r*y-o*g)+p*(r*d-o*f)),t[10]=n*(s*y-l*g)-a*(r*y-o*g)+p*(r*l-o*s),t[11]=-(n*(s*d-l*f)-a*(r*d-o*f)+u*(r*l-o*s)),t[12]=-(a*(f*m-h*g)-u*(s*m-c*g)+p*(s*h-c*f)),t[13]=n*(f*m-h*g)-u*(r*m-i*g)+p*(r*h-i*f),t[14]=-(n*(s*m-c*g)-a*(r*m-i*g)+p*(r*c-i*s)),t[15]=n*(s*h-c*f)-a*(r*h-i*f)+u*(r*c-i*s),t},determinant:mt,multiply:yt,translate:vt,scale:bt,rotate:function(t,e,n,r){var i,o,a,s,c,l,u,f,h,d,p,g,m,y,v,b,x,w,M,O,E,k,S,A,_=r[0],T=r[1],P=r[2],C=Math.hypot(_,T,P);return C<ot?null:(_*=C=1/C,T*=C,P*=C,i=Math.sin(n),a=1-(o=Math.cos(n)),s=e[0],c=e[1],l=e[2],u=e[3],f=e[4],h=e[5],d=e[6],p=e[7],g=e[8],m=e[9],y=e[10],v=e[11],b=_*_*a+o,x=T*_*a+P*i,w=P*_*a-T*i,M=_*T*a-P*i,O=T*T*a+o,E=P*T*a+_*i,k=_*P*a+T*i,S=T*P*a-_*i,A=P*P*a+o,t[0]=s*b+f*x+g*w,t[1]=c*b+h*x+m*w,t[2]=l*b+d*x+y*w,t[3]=u*b+p*x+v*w,t[4]=s*M+f*O+g*E,t[5]=c*M+h*O+m*E,t[6]=l*M+d*O+y*E,t[7]=u*M+p*O+v*E,t[8]=s*k+f*S+g*A,t[9]=c*k+h*S+m*A,t[10]=l*k+d*S+y*A,t[11]=u*k+p*S+v*A,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:xt,rotateY:wt,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],c=e[3],l=e[4],u=e[5],f=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+l*r,t[1]=a*i+u*r,t[2]=s*i+f*r,t[3]=c*i+h*r,t[4]=l*i-o*r,t[5]=u*i-a*r,t[6]=f*i-s*r,t[7]=h*i-c*r,t},fromTranslation:Mt,fromScaling:Ot,fromRotation:Et,fromXRotation:kt,fromYRotation:St,fromZRotation:At,fromRotationTranslation:_t,fromQuat2:function(t,e){var n=new at(3),r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=r*r+i*i+o*o+a*a;return f>0?(n[0]=2*(s*a+u*r+c*o-l*i)/f,n[1]=2*(c*a+u*i+l*r-s*o)/f,n[2]=2*(l*a+u*o+s*i-c*r)/f):(n[0]=2*(s*a+u*r+c*o-l*i),n[1]=2*(c*a+u*i+l*r-s*o),n[2]=2*(l*a+u*o+s*i-c*r)),_t(t,e,n),t},getTranslation:Tt,getScaling:Pt,getRotation:Ct,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],c=i+i,l=o+o,u=a+a,f=i*c,h=i*l,d=i*u,p=o*l,g=o*u,m=a*u,y=s*c,v=s*l,b=s*u,x=r[0],w=r[1],M=r[2];return t[0]=(1-(p+m))*x,t[1]=(h+b)*x,t[2]=(d-v)*x,t[3]=0,t[4]=(h-b)*w,t[5]=(1-(f+m))*w,t[6]=(g+y)*w,t[7]=0,t[8]=(d+v)*M,t[9]=(g-y)*M,t[10]=(1-(f+p))*M,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:Nt,fromQuat:Lt,frustum:function(t,e,n,r,i,o,a){var s=1/(n-e),c=1/(i-r),l=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*c,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*c,t[10]=(a+o)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*l,t[15]=0,t},perspectiveNO:jt,perspective:Rt,perspectiveZO:function(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=i*o,t[14]=i*r*o):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),c=2/(a+s),l=2/(i+o);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(a-s)*c*.5,t[9]=(i-o)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},orthoNO:It,ortho:Bt,orthoZO:Dt,lookAt:Ft,targetTo:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],c=r[1],l=r[2],u=i-n[0],f=o-n[1],h=a-n[2],d=u*u+f*f+h*h;d>0&&(u*=d=1/Math.sqrt(d),f*=d,h*=d);var p=c*h-l*f,g=l*u-s*h,m=s*f-c*u;return(d=p*p+g*g+m*m)>0&&(p*=d=1/Math.sqrt(d),g*=d,m*=d),t[0]=p,t[1]=g,t[2]=m,t[3]=0,t[4]=f*m-h*g,t[5]=h*p-u*m,t[6]=u*g-f*p,t[7]=0,t[8]=u,t[9]=f,t[10]=h,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t},str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},subtract:zt,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},equals:function(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],c=t[6],l=t[7],u=t[8],f=t[9],h=t[10],d=t[11],p=t[12],g=t[13],m=t[14],y=t[15],v=e[0],b=e[1],x=e[2],w=e[3],M=e[4],O=e[5],E=e[6],k=e[7],S=e[8],A=e[9],_=e[10],T=e[11],P=e[12],C=e[13],N=e[14],L=e[15];return Math.abs(n-v)<=ot*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(r-b)<=ot*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-x)<=ot*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-w)<=ot*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-M)<=ot*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(s-O)<=ot*Math.max(1,Math.abs(s),Math.abs(O))&&Math.abs(c-E)<=ot*Math.max(1,Math.abs(c),Math.abs(E))&&Math.abs(l-k)<=ot*Math.max(1,Math.abs(l),Math.abs(k))&&Math.abs(u-S)<=ot*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(f-A)<=ot*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(h-_)<=ot*Math.max(1,Math.abs(h),Math.abs(_))&&Math.abs(d-T)<=ot*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(p-P)<=ot*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(g-C)<=ot*Math.max(1,Math.abs(g),Math.abs(C))&&Math.abs(m-N)<=ot*Math.max(1,Math.abs(m),Math.abs(N))&&Math.abs(y-L)<=ot*Math.max(1,Math.abs(y),Math.abs(L))},mul:Gt,sub:Wt});function Ht(){var t=new at(3);return at!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Vt(t){var e=new at(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Yt(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function Ut(t,e,n){var r=new at(3);return r[0]=t,r[1]=e,r[2]=n,r}function qt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Xt(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function Kt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Zt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Qt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Jt(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function te(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ee(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],c=n[2];return t[0]=i*c-o*s,t[1]=o*a-r*c,t[2]=r*s-i*a,t}function ne(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function re(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function ie(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}function oe(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(n-o)<=ot*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=ot*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=ot*Math.max(1,Math.abs(i),Math.abs(s))}var ae=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)},se=Yt;function ce(){var t=new at(4);return at!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function le(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}function ue(){var t=new at(4);return at!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function fe(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function he(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],c=n[1],l=n[2],u=n[3];return t[0]=r*u+a*s+i*l-o*c,t[1]=i*u+a*c+o*s-r*l,t[2]=o*u+a*l+r*c-i*s,t[3]=a*u-r*s-i*c-o*l,t}function de(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function pe(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(n),c=Math.cos(n),l=Math.sin(r),u=Math.cos(r);return t[0]=o*c*u-a*s*l,t[1]=a*s*u+o*c*l,t[2]=a*c*l-o*s*u,t[3]=a*c*u+o*s*l,t}Ht(),function(){var t=ce()}();var ge=function(t,e,n,r){var i=new at(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},me=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},ye=he,ve=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t};Ht(),Ut(1,0,0),Ut(0,1,0),ue(),ue(),st(),function(){var t,e=(t=new at(2),at!=Float32Array&&(t[0]=0,t[1]=0),t)}();var be=function(t,e){return be=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},be(t,e)};function xe(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}be(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var we=function(){return we=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},we.apply(this,arguments)};function Me(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function Oe(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function Ee(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))}function ke(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function Se(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ae(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function _e(t,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 Te(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}var Pe={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function Ce(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Ne={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Le(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Ne[e]===t.length-1&&"achlmqstvz".includes(e)}))}function je(t){return Le(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function Re(t){return je(t)&&t.every((function(t){var e=t[0];return"ACLMQZ".includes(e)}))}function Ie(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=Ne[n]&&("m"===n&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,Ne[n]))),Ne[n]););}function Be(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'+n[e]+'", expecting 0 or 1 at index '+e)}function De(t){return t>=48&&t<=57||43===t||45===t||46===t}function Fe(t){return t>=48&&t<=57}function ze(t){var e,n=t.max,r=t.pathValue,i=t.index,o=i,a=!1,s=!1,c=!1,l=!1;if(o>=n)t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param';else if(43!==(e=r.charCodeAt(o))&&45!==e||(o+=1,e=r.charCodeAt(o)),Fe(e)||46===e){if(46!==e){if(a=48===e,o+=1,e=r.charCodeAt(o),a&&o<n&&e&&Fe(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;o<n&&Fe(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(l=!0,o+=1;Fe(r.charCodeAt(o));)o+=1,c=!0;e=r.charCodeAt(o)}if(101===e||69===e){if(l&&!s&&!c)return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid float exponent');if(o+=1,43!==(e=r.charCodeAt(o))&&45!==e||(o+=1),!(o<n&&Fe(r.charCodeAt(o))))return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid integer exponent');for(;o<n&&Fe(r.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(i,o)}else t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" is not a number'}function Ge(t){for(var e,n=t.pathValue,r=t.max;t.index<r&&(10===(e=n.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function We(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=Ne[n[r].toLowerCase()];if(t.segmentStart=r,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,Ge(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?ze(t):Be(t),t.err.length)return;t.data.push(t.param),Ge(t),t.index<e&&44===n.charCodeAt(t.index)&&(t.index+=1,Ge(t))}if(t.index>=t.max)break;if(!De(n.charCodeAt(t.index)))break}Ie(t)}else Ie(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var $e=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function He(t){if(je(t))return[].concat(t);var e=function(t){if(Le(t))return[].concat(t);var e=new $e(t);for(Ge(e);e.index<e.max&&!e.err.length;)We(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,o=0;return e.map((function(t){var e,a=t.slice(1).map(Number),s=t[0],c=s.toUpperCase();if("M"===s)return n=a[0],r=a[1],i=n,o=r,["M",n,r];if(s!==c)switch(c){case"A":e=[c,a[0],a[1],a[2],a[3],a[4],a[5]+n,a[6]+r];break;case"V":e=[c,a[0]+r];break;case"H":e=[c,a[0]+n];break;default:var l=a.map((function(t,e){return t+(e%2?r:n)}));e=[c].concat(l)}else e=[c].concat(a);var u=e.length;switch(c){case"Z":n=i,r=o;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[u-2],r=e[u-1],"M"===c&&(i=n,o=r)}return e}))}function Ve(t,e){var n=t[0],r=e.x1,i=e.y1,o=e.x2,a=e.y2,s=t.slice(1).map(Number),c=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)c=["L",t[1],i];else if("V"===n)c=["L",r,t[1]];else if("S"===n){var l=2*r-o,u=2*i-a;e.x1=l,e.y1=u,c=["C",l,u].concat(s)}else if("T"===n){var f=2*r-e.qx,h=2*i-e.qy;e.qx=f,e.qy=h,c=["Q",f,h].concat(s)}else if("Q"===n){var d=s[0],p=s[1];e.qx=d,e.qy=p}return c}function Ye(t){if(Re(t))return[].concat(t);for(var e=He(t),n=we({},Pe),r=0;r<e.length;r+=1){e[r]=Ve(e[r],n);var i=e[r],o=i.length;n.x1=+i[o-2],n.y1=+i[o-1],n.x2=+i[o-4]||n.x1,n.y2=+i[o-3]||n.y1}return e}function Ue(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function qe(t,e,n,r,i,o,a,s,c,l){var u,f,h,d,p,g=t,m=e,y=n,v=r,b=s,x=c,w=120*Math.PI/180,M=Math.PI/180*(+i||0),O=[];if(l)f=l[0],h=l[1],d=l[2],p=l[3];else{g=(u=Ue(g,m,-M)).x,m=u.y;var E=(g-(b=(u=Ue(b,x,-M)).x))/2,k=(m-(x=u.y))/2,S=E*E/(y*y)+k*k/(v*v);S>1&&(y*=S=Math.sqrt(S),v*=S);var A=y*y,_=v*v,T=(o===a?-1:1)*Math.sqrt(Math.abs((A*_-A*k*k-_*E*E)/(A*k*k+_*E*E)));d=T*y*k/v+(g+b)/2,p=T*-v*E/y+(m+x)/2,f=Math.asin(((m-p)/v*Math.pow(10,9)|0)/Math.pow(10,9)),h=Math.asin(((x-p)/v*Math.pow(10,9)|0)/Math.pow(10,9)),f=g<d?Math.PI-f:f,h=b<d?Math.PI-h:h,f<0&&(f=2*Math.PI+f),h<0&&(h=2*Math.PI+h),a&&f>h&&(f-=2*Math.PI),!a&&h>f&&(h-=2*Math.PI)}var P=h-f;if(Math.abs(P)>w){var C=h,N=b,L=x;h=f+w*(a&&h>f?1:-1),O=qe(b=d+y*Math.cos(h),x=p+v*Math.sin(h),y,v,i,0,a,N,L,[h,C,d,p])}P=h-f;var j=Math.cos(f),R=Math.sin(f),I=Math.cos(h),B=Math.sin(h),D=Math.tan(P/4),F=4/3*y*D,z=4/3*v*D,G=[g,m],W=[g+F*R,m-z*j],$=[b+F*B,x-z*I],H=[b,x];if(W[0]=2*G[0]-W[0],W[1]=2*G[1]-W[1],l)return W.concat($,H,O);for(var V=[],Y=0,U=(O=W.concat($,H,O)).length;Y<U;Y+=1)V[Y]=Y%2?Ue(O[Y-1],O[Y],M).y:Ue(O[Y],O[Y+1],M).x;return V}function Xe(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}var Ke=function(t,e,n,r){return _e(_e([],Xe([t,e],[n,r],.5),!0),[n,r,n,r],!1)};function Ze(t,e){var n,r,i,o,a,s,c,l,u,f=t[0],h=t.slice(1).map(Number),d=h[0],p=h[1],g=e.x1,m=e.y1,y=e.x,v=e.y;switch("TQ".includes(f)||(e.qx=null,e.qy=null),f){case"M":return e.x=d,e.y=p,t;case"A":return n=[g,m].concat(h),["C"].concat(qe(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=d,e.qy=p,n=[g,m].concat(h),["C"].concat((r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],c=n[5],[(l=1/3)*r+(u=2/3)*o,l*i+u*a,l*s+u*o,l*c+u*a,s,c]));case"L":return["C"].concat(Ke(g,m,d,p));case"Z":return g===y&&m===v?["C",g,m,y,v,y,v]:["C"].concat(Ke(g,m,y,v))}return t}function Qe(t,e){if(void 0===e&&(e=!1),function(t){return Re(t)&&t.every((function(t){var e=t[0];return"MC".includes(e)}))}(t)){var n=[].concat(t);return e?[n,[]]:n}for(var r,i,o=Ye(t),a=we({},Pe),s=[],c="",l=o.length,u=[],f=0;f<l;f+=1){o[f]&&(c=o[f][0]),s[f]=c;var h=Ze(o[f],a);o[f]=h,Ce(o,s,f),l=o.length,"Z"===c&&u.push(f),i=(r=o[f]).length,a.x1=+r[i-2],a.y1=+r[i-1],a.x2=+r[i-4]||a.x1,a.y2=+r[i-3]||a.y1}return e?[o,u]:o}function Je(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function tn(t,e,n,r,i){var o=Je([t,e],[n,r]),a={x:0,y:0};if("number"==typeof i)if(i<=0)a={x:t,y:e};else if(i>=o)a={x:n,y:r};else{var s=Xe([t,e],[n,r],i/o);a={x:s[0],y:s[1]}}return{length:o,point:a,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function en(t,e){var n=t.x,r=t.y,i=e.x,o=e.y,a=n*i+r*o,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2)));return(n*o-r*i<0?-1:1)*Math.acos(a/s)}function nn(t,e,n,r,i,o,a,s,c,l){var u=Math.abs,f=Math.sin,h=Math.cos,d=Math.sqrt,p=Math.PI,g=u(n),m=u(r),y=(i%360+360)%360*(p/180);if(t===s&&e===c)return{x:t,y:e};if(0===g||0===m)return tn(t,e,s,c,l).point;var v=(t-s)/2,b=(e-c)/2,x={x:h(y)*v+f(y)*b,y:-f(y)*v+h(y)*b},w=Math.pow(x.x,2)/Math.pow(g,2)+Math.pow(x.y,2)/Math.pow(m,2);w>1&&(g*=d(w),m*=d(w));var M=(Math.pow(g,2)*Math.pow(m,2)-Math.pow(g,2)*Math.pow(x.y,2)-Math.pow(m,2)*Math.pow(x.x,2))/(Math.pow(g,2)*Math.pow(x.y,2)+Math.pow(m,2)*Math.pow(x.x,2)),O=(o!==a?1:-1)*d(M=M<0?0:M),E=O*(g*x.y/m),k=O*(-m*x.x/g),S=h(y)*E-f(y)*k+(t+s)/2,A=f(y)*E+h(y)*k+(e+c)/2,_={x:(x.x-E)/g,y:(x.y-k)/m},T=en({x:1,y:0},_),P=en(_,{x:(-x.x-E)/g,y:(-x.y-k)/m});!a&&P>0?P-=2*p:a&&P<0&&(P+=2*p);var C=T+(P%=2*p)*l,N=g*h(C),L=m*f(C);return{x:h(y)*N-f(y)*L+S,y:f(y)*N+h(y)*L+A}}function rn(t,e,n,r,i,o,a,s,c,l,u){var f,h=u.bbox,d=void 0===h||h,p=u.length,g=void 0===p||p,m=u.sampleSize,y=void 0===m?30:m,v="number"==typeof l,b=t,x=e,w=0,M=[b,x,w],O=[b,x],E={x:0,y:0},k=[{x:b,y:x}];v&&l<=0&&(E={x:b,y:x});for(var S=0;S<=y;S+=1){if(b=(f=nn(t,e,n,r,i,o,a,s,c,S/y)).x,x=f.y,d&&k.push({x:b,y:x}),g&&(w+=Je(O,[b,x])),O=[b,x],v&&w>=l&&l>M[2]){var A=(w-l)/(w-M[2]);E={x:O[0]*(1-A)+M[0]*A,y:O[1]*(1-A)+M[1]*A}}M=[b,x,w]}return v&&l>=w&&(E={x:s,y:c}),{length:w,point:E,min:{x:Math.min.apply(null,k.map((function(t){return t.x}))),y:Math.min.apply(null,k.map((function(t){return t.y})))},max:{x:Math.max.apply(null,k.map((function(t){return t.x}))),y:Math.max.apply(null,k.map((function(t){return t.y})))}}}function on(t,e,n,r,i,o,a,s,c){var l=1-c;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*c*n+3*l*Math.pow(c,2)*i+Math.pow(c,3)*a,y:Math.pow(l,3)*e+3*Math.pow(l,2)*c*r+3*l*Math.pow(c,2)*o+Math.pow(c,3)*s}}function an(t,e,n,r,i,o,a,s,c,l){var u,f=l.bbox,h=void 0===f||f,d=l.length,p=void 0===d||d,g=l.sampleSize,m=void 0===g?10:g,y="number"==typeof c,v=t,b=e,x=0,w=[v,b,x],M=[v,b],O={x:0,y:0},E=[{x:v,y:b}];y&&c<=0&&(O={x:v,y:b});for(var k=0;k<=m;k+=1){if(v=(u=on(t,e,n,r,i,o,a,s,k/m)).x,b=u.y,h&&E.push({x:v,y:b}),p&&(x+=Je(M,[v,b])),M=[v,b],y&&x>=c&&c>w[2]){var S=(x-c)/(x-w[2]);O={x:M[0]*(1-S)+w[0]*S,y:M[1]*(1-S)+w[1]*S}}w=[v,b,x]}return y&&c>=x&&(O={x:a,y:s}),{length:x,point:O,min:{x:Math.min.apply(null,E.map((function(t){return t.x}))),y:Math.min.apply(null,E.map((function(t){return t.y})))},max:{x:Math.max.apply(null,E.map((function(t){return t.x}))),y:Math.max.apply(null,E.map((function(t){return t.y})))}}}function sn(t,e,n,r,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*n+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*r+Math.pow(a,2)*o}}function cn(t,e,n,r,i,o,a,s){var c,l=s.bbox,u=void 0===l||l,f=s.length,h=void 0===f||f,d=s.sampleSize,p=void 0===d?10:d,g="number"==typeof a,m=t,y=e,v=0,b=[m,y,v],x=[m,y],w={x:0,y:0},M=[{x:m,y:y}];g&&a<=0&&(w={x:m,y:y});for(var O=0;O<=p;O+=1){if(m=(c=sn(t,e,n,r,i,o,O/p)).x,y=c.y,u&&M.push({x:m,y:y}),h&&(v+=Je(x,[m,y])),x=[m,y],g&&v>=a&&a>b[2]){var E=(v-a)/(v-b[2]);w={x:x[0]*(1-E)+b[0]*E,y:x[1]*(1-E)+b[1]*E}}b=[m,y,v]}return g&&a>=v&&(w={x:i,y:o}),{length:v,point:w,min:{x:Math.min.apply(null,M.map((function(t){return t.x}))),y:Math.min.apply(null,M.map((function(t){return t.y})))},max:{x:Math.max.apply(null,M.map((function(t){return t.x}))),y:Math.max.apply(null,M.map((function(t){return t.y})))}}}function ln(t,e,n){for(var r,i,o,a,s,c,l,u,f,h=Ye(t),d="number"==typeof e,p=[],g=0,m=0,y=0,v=0,b=[],x=[],w=0,M={x:0,y:0},O=M,E=M,k=M,S=0,A=0,_=h.length;A<_;A+=1)p=(l="M"===(u=(f=h[A])[0]))?p:[g,m].concat(f.slice(1)),l?(O=M={x:y=f[1],y:v=f[2]},w=0,d&&e<.001&&(k=M)):"L"===u?(w=(r=tn(p[0],p[1],p[2],p[3],(e||0)-S)).length,M=r.min,O=r.max,E=r.point):"A"===u?(w=(i=rn(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],(e||0)-S,n||{})).length,M=i.min,O=i.max,E=i.point):"C"===u?(w=(o=an(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],(e||0)-S,n||{})).length,M=o.min,O=o.max,E=o.point):"Q"===u?(w=(a=cn(p[0],p[1],p[2],p[3],p[4],p[5],(e||0)-S,n||{})).length,M=a.min,O=a.max,E=a.point):"Z"===u&&(w=(s=tn((p=[g,m,y,v])[0],p[1],p[2],p[3],(e||0)-S)).length,M=s.min,O=s.max,E=s.point),d&&S<e&&S+w>=e&&(k=E),x.push(O),b.push(M),S+=w,g=(c="Z"!==u?f.slice(-2):[y,v])[0],m=c[1];return d&&e>=S&&(k={x:g,y:m}),{length:S,point:k,min:{x:Math.min.apply(null,b.map((function(t){return t.x}))),y:Math.min.apply(null,b.map((function(t){return t.y})))},max:{x:Math.max.apply(null,x.map((function(t){return t.x}))),y:Math.max.apply(null,x.map((function(t){return t.y})))}}}function un(t){return function(t){var e=0,n=0,r=0;return Qe(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var o=t.slice(1),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=o[5];return r=function(t,e,n,r,i,o,a,s){return 3*((s-e)*(n+i)-(a-t)*(r+o)+r*(t-i)-n*(e-o)+s*(i+t/3)-a*(o+e/3))/20}(e,n,a,s,c,l,u,f),i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}(t)>=0}function fn(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?an(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=Xe(n,r,e),s=Xe(r,i,e),c=Xe(i,o,e),l=Xe(a,s,e),u=Xe(s,c,e),f=Xe(l,u,e);return[["C"].concat(a,l,f),["C"].concat(u,c,o)]}(r):[t,t]:[t],l:i}}))}function hn(t,e,n){var r=fn(t),i=fn(e),o=r.length,a=i.length,s=r.filter((function(t){return t.l})).length,c=i.filter((function(t){return t.l})).length,l=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,u=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/c||0,f=n||Math.max(o,a),h=[l,u],d=[f-o,f-a],p=0,g=[r,i].map((function(t,e){return t.l===f?t.map((function(t){return t.s})):t.map((function(t,n){return p=n&&d[e]&&t.l>=h[e],d[e]-=p?1:0,p?t.ss:[t.s]})).flat()}));return g[0].length===g[1].length?g:hn(g[0],g[1],f)}function dn(t){var e=document.createElement("div");e.innerHTML=t;var n=e.childNodes[0];return n&&e.contains(n)&&e.removeChild(n),n}function pn(t,e){if(null!==t)return{type:"column",value:t,field:e}}function gn(t,e){const n=pn(t,e);return Object.assign(Object.assign({},n),{inferred:!0})}function mn(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function yn(t,e){const n=pn(t,e);return Object.assign(Object.assign({},n),{constant:!1})}function vn(t,e){const n=[];for(const r of t)n[r]=e;return n}function bn(t,e){const n=t[e];if(!n)return[null,null];const{value:r,field:i=null}=n;return[r,i]}function xn(t,...e){for(const n of e){if("string"!=typeof n)return[n,null];{const[e,r]=bn(t,n);if(null!==e)return[e,r]}}return[null,null]}function wn(t){return!(t instanceof Date)&&"object"==typeof t}const Mn=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;return void 0!==r?[t,e]:[t,X({},e,{encode:{y1:gn(vn(t,0))}})]};function On(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function En(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function kn(t){let e,n,r;function i(t,r,i=0,o=t.length){if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<0?i=e+1:o=e}while(i<o)}return i}return 2!==t.length?(e=On,n=(e,n)=>On(t(e),n),r=(e,n)=>t(e)-n):(e=t===On||t===En?t:Sn,n=t,r=t),{left:i,center:function(t,e,n=0,o=t.length){const a=i(t,e,n,o-1);return a>n&&r(t[a-1],e)>-r(t[a],e)?a-1:a},right:function(t,r,i=0,o=t.length){if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<=0?i=e+1:o=e}while(i<o)}return i}}}function Sn(){return 0}function An(t){return null===t?NaN:+t}Mn.props={};const _n=kn(On),Tn=_n.right,Pn=_n.left,Cn=kn(An).center;var Nn=Tn;function Ln(t,e){let n=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&++n;else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(i=+i)>=i&&++n}return n}function jn(t,e){const n=function(t,e){let n,r=0,i=0,o=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(n=e-i,i+=n/++r,o+=n*(e-i));else{let a=-1;for(let s of t)null!=(s=e(s,++a,t))&&(s=+s)>=s&&(n=s-i,i+=n/++r,o+=n*(s-i))}if(r>1)return o/(r-1)}(t,e);return n?Math.sqrt(n):n}function Rn(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r<e&&(r=e)));else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(void 0===n?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}class In extends Map{constructor(t,e=Dn){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Bn(this,t))}has(t){return super.has(Bn(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){const r=e(n);t.has(r)&&(n=t.get(r),t.delete(r));return n}(this,t))}}function Bn({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Dn(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Fn(t){return t}function zn(t,...e){return Hn(t,Fn,Fn,e)}function Gn(t,...e){return Hn(t,Array.from,Fn,e)}function Wn(t,e,...n){return Hn(t,Fn,e,n)}function $n(t,e,...n){return Hn(t,Array.from,e,n)}function Hn(t,e,n,r){return function t(i,o){if(o>=r.length)return n(i);const a=new In,s=r[o++];let c=-1;for(const t of i){const e=s(t,++c,i),n=a.get(e);n?n.push(t):a.set(e,[t])}for(const[e,n]of a)a.set(e,t(n,o));return e(a)}(t,0)}function Vn(t,...e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&2!==n.length||e.length>1){const r=Uint32Array.from(t,((t,e)=>e));return e.length>1?(e=e.map((e=>t.map(e))),r.sort(((t,n)=>{for(const r of e){const e=Un(r[t],r[n]);if(e)return e}}))):(n=t.map(n),r.sort(((t,e)=>Un(n[t],n[e])))),function(t,e){return Array.from(e,(e=>t[e]))}(t,r)}return t.sort(Yn(n))}function Yn(t=On){if(t===On)return Un;if("function"!=typeof t)throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||0===r?r:(0===t(n,n))-(0===t(e,e))}}function Un(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(t<e?-1:t>e?1:0)}var qn=Array.prototype.slice;function Xn(t){return()=>t}const Kn=Math.sqrt(50),Zn=Math.sqrt(10),Qn=Math.sqrt(2);function Jn(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=Kn?10:o>=Zn?5:o>=Qn?2:1;let s,c,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(t*l),c=Math.round(e*l),s/l<t&&++s,c/l>e&&--c,l=-l):(l=Math.pow(10,i)*a,s=Math.round(t/l),c=Math.round(e/l),s*l<t&&++s,c*l>e&&--c),c<s&&.5<=n&&n<2?Jn(t,e,2*n):[s,c,l]}function tr(t,e,n){return Jn(t=+t,e=+e,n=+n)[2]}function er(t){return Math.max(1,Math.ceil(Math.log(Ln(t))/Math.LN2)+1)}function nr(){var t=Fn,e=Rn,n=er;function r(r){Array.isArray(r)||(r=Array.from(r));var i,o,a,s=r.length,c=new Array(s);for(i=0;i<s;++i)c[i]=t(r[i],i,r);var l=e(c),u=l[0],f=l[1],h=n(c,u,f);if(!Array.isArray(h)){const t=f,n=+h;if(e===Rn&&([u,f]=function(t,e,n){let r;for(;;){const i=tr(t,e,n);if(i===r||0===i||!isFinite(i))return[t,e];i>0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}(u,f,n)),h=function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const r=e<t,[i,o,a]=r?Jn(e,t,n):Jn(t,e,n);if(!(o>=i))return[];const s=o-i+1,c=new Array(s);if(r)if(a<0)for(let t=0;t<s;++t)c[t]=(o-t)/-a;else for(let t=0;t<s;++t)c[t]=(o-t)*a;else if(a<0)for(let t=0;t<s;++t)c[t]=(i+t)/-a;else for(let t=0;t<s;++t)c[t]=(i+t)*a;return c}(u,f,n),h[0]<=u&&(a=tr(u,f,n)),h[h.length-1]>=f)if(t>=f&&e===Rn){const t=tr(u,f,n);isFinite(t)&&(t>0?f=(Math.floor(f/t)+1)*t:t<0&&(f=(Math.ceil(f*-t)+1)/-t))}else h.pop()}for(var d=h.length,p=0,g=d;h[p]<=u;)++p;for(;h[g-1]>f;)--g;(p||g<d)&&(h=h.slice(p,g),d=g-p);var m,y=new Array(d+1);for(i=0;i<=d;++i)(m=y[i]=[]).x0=i>0?h[i-1]:u,m.x1=i<d?h[i]:f;if(isFinite(a)){if(a>0)for(i=0;i<s;++i)null!=(o=c[i])&&u<=o&&o<=f&&y[Math.min(d,Math.floor((o-u)/a))].push(r[i]);else if(a<0)for(i=0;i<s;++i)if(null!=(o=c[i])&&u<=o&&o<=f){const t=Math.floor((u-o)*a);y[Math.min(d,t+(h[t]<=o))].push(r[i])}}else for(i=0;i<s;++i)null!=(o=c[i])&&u<=o&&o<=f&&y[Nn(h,o,0,d)].push(r[i]);return y}return r.value=function(e){return arguments.length?(t="function"==typeof e?e:Xn(e),r):t},r.domain=function(t){return arguments.length?(e="function"==typeof t?t:Xn([t[0],t[1]]),r):e},r.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Xn(Array.isArray(t)?qn.call(t):t),r):n},r}function rr(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}function ir(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n<e||void 0===n&&e>=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n<o||void 0===n&&o>=o)&&(n=o,r=i);return r}function or(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function ar(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n>e||void 0===n&&e>=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);return r}function sr(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=void 0===i?Un:Yn(i);r>n;){if(r-n>600){const o=r-n+1,a=e-n+1,s=Math.log(o),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(o-c)/o)*(a-o/2<0?-1:1);sr(t,e,Math.max(n,Math.floor(e-a*c/o+l)),Math.min(r,Math.floor(e+(o-a)*c/o+l)),i)}const o=t[e];let a=n,s=r;for(cr(t,n,e),i(t[r],o)>0&&cr(t,n,r);a<s;){for(cr(t,a,s),++a,--s;i(t[a],o)<0;)++a;for(;i(t[s],o)>0;)--s}0===i(t[n],o)?cr(t,n,s):(++s,cr(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function cr(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function lr(t,e,n=An){if(!isNaN(e=+e)){if(r=Float64Array.from(t,((e,r)=>An(n(t[r],r,t)))),e<=0)return ar(r);if(e>=1)return ir(r);var r,i=Uint32Array.from(t,((t,e)=>e)),o=r.length-1,a=Math.floor(o*e);return sr(i,a,0,o,((t,e)=>Un(r[t],r[e]))),a=function(t,e=On){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?On(t,i)>0:0===On(t,t))&&(n=o,i=t,r=!0)}}else for(const i of t)(r?e(i,n)>0:0===e(i,i))&&(n=i,r=!0);return n}(i.subarray(0,a+1),(t=>r[t])),a>=0?a:-1}}function ur(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function fr(t,e){return function(t,e,n){if(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,n)),(r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return or(t);if(e>=1)return rr(t);var r,i=(r-1)*e,o=Math.floor(i),a=rr(sr(t,o).subarray(0,o+1));return a+(or(t.subarray(o+1))-a)*(i-o)}}(t,.5,e)}function hr(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function dr(t){return t}function pr(t){return t.reduce(((t,e)=>(n,...r)=>e(t(n,...r),...r)),dr)}function gr(t){return t.replace(/( |^)[a-z]/g,(t=>t.toUpperCase()))}function mr(t=""){throw new Error(t)}function yr(t,e){const{attributes:n}=e,r=new Set(["id","className"]);for(const[e,i]of Object.entries(n))r.has(e)||("transform"===e?(t.attr(e,""),t.attr(e,i)):t.attr(e,i))}function vr(t){return null!=t&&!Number.isNaN(t)}function br(t){const e=new Map;return n=>{if(e.has(n))return e.get(n);const r=t(n);return e.set(n,r),r}}function xr(t,e){return wr(t,e)||{}}function wr(t,e){const n=Object.entries(t||{}).filter((([t])=>t.startsWith(e))).map((([t,n])=>[z(t.replace(e,"").trim()),n])).filter((([t])=>!!t));return 0===n.length?null:Object.fromEntries(n)}function Mr(t,...e){return Object.fromEntries(Object.entries(t).filter((([t])=>e.every((e=>!t.startsWith(e))))))}function Or(t,e){if(void 0===t)return null;if("number"==typeof t)return t;const n=+t.replace("%","");return Number.isNaN(n)?null:n/100*e}function Er(t){return!("object"!=typeof t||t instanceof Date||null===t||Array.isArray(t))}function kr(t){return null===t||!1===t}function Sr(t,e,n=5,r=0){if(!(r>=n)){for(const i of Object.keys(e)){const o=e[i];k(o)&&k(t[i])?Sr(t[i],o,n,r+1):t[i]=o}return t}}function Ar(t,e){return Object.entries(t).reduce(((n,[r,i])=>(n[r]=e(i,r,t),n)),{})}function _r(t){return t.map(((t,e)=>e))}function Tr(t){return t[0]}function Pr(t){return t[t.length-1]}function Cr(t,e){const n=[[],[]];return t.forEach((t=>{n[e(t)?0:1].push(t)})),n}function Nr(t,e=t.length){if(1===e)return t.map((t=>[t]));const n=[];for(let r=0;r<t.length;r++){Nr(t.slice(r+1),e-1).forEach((e=>{n.push([t[r],...e])}))}return n}function Lr(t,e,n){const{encode:r}=n;if(null===t)return[e];const i=function(t){return Array.isArray(t)?t:[t]}(t).map((t=>{var e;return[t,null===(e=bn(r,t))||void 0===e?void 0:e[0]]})).filter((([,t])=>vr(t)));return Array.from(zn(e,(t=>i.map((([,e])=>e[t])).join("-"))).values())}function jr(t){return Array.isArray(t)?function(t){return(e,n,r)=>(n,r)=>t.reduce(((t,i)=>0!==t?t:On(e[n][i],e[r][i])),0)}(t):"function"==typeof t?function(t){return(e,n,r)=>Gr((n=>t(e[n])))}(t):"series"===t?Br:"value"===t?Dr:"sum"===t?Fr:"maxIndex"===t?zr:()=>null}function Rr(t,e){for(const n of t)n.sort(e)}function Ir(t,e){return(null==e?void 0:e.domain)||Array.from(new Set(t))}function Br(t,e,n){return Gr((t=>n[t]))}function Dr(t,e,n){return Gr((t=>e[t]))}function Fr(t,e,n){const r=_r(t),i=Array.from(zn(r,(t=>n[+t])).entries()),o=new Map(i.map((([t,n])=>[t,n.reduce(((t,n)=>t+ +e[n]))])));return Gr((t=>o.get(n[t])))}function zr(t,e,n){const r=_r(t),i=Array.from(zn(r,(t=>n[+t])).entries()),o=new Map(i.map((([t,n])=>[t,ir(n,(t=>e[t]))])));return Gr((t=>o.get(n[t])))}function Gr(t){return(e,n)=>On(t(e),t(n))}const Wr=(t={})=>{const{groupBy:e="x",orderBy:n=null,reverse:r=!1,y:i="y",y1:o="y1",series:a=!0}=t;return(t,s)=>{const{data:c,encode:l,style:u={}}=s,[f,h]=bn(l,"y"),[d,p]=bn(l,"y1"),[g]=a?xn(l,"series","color"):bn(l,"color"),m=Lr(e,t,s),y=jr(n)(c,f,g);y&&Rr(m,y);const v=new Array(t.length),b=new Array(t.length),x=new Array(t.length),w=[],M=[];for(const t of m){r&&t.reverse();const e=d?+d[t[0]]:0,n=[],i=[];for(const r of t){const t=x[r]=+f[r]-e;t<0?i.push(r):t>=0&&n.push(r)}const o=n.length>0?n:i,a=i.length>0?i:n;let s=n.length-1,c=0;for(;s>0&&0===f[o[s]];)s--;for(;c<a.length-1&&0===f[a[c]];)c++;w.push(o[s]),M.push(a[c]);let l=e;for(const t of i.reverse()){const e=x[t];l=v[t]=(b[t]=l)+e}let u=e;for(const t of n){const e=x[t];e>0?u=v[t]=(b[t]=u)+e:v[t]=b[t]=u}}const O=new Set(w),E=new Set(M),k="y"===i?v:b,S="y"===o?v:b;return[t,X({},s,{encode:{y0:gn(f,h),y:pn(k,h),y1:pn(S,p)},style:Object.assign({first:(t,e)=>O.has(e),last:(t,e)=>E.has(e)},u)})]}};function $r(t){const{type:e}=t;return"string"==typeof e&&["stackY","dodgeX","groupX"].includes(e)}Wr.props={};const Hr=t=>(e,n,r)=>{const{encode:i,transform:o=[]}=n;if(o.some($r))return[e,n];const{x:a,y:s}=i;if(void 0===a||void 0===s)return[e,n];const{series:c}=t;return Wr({groupBy:c?["x","series"]:"x"})(e,n,r)};function Vr(t){return Math.abs(t)>10?String(t):t.toString().padStart(2,"0")}function Yr(t){const e=`${t.getFullYear()}-${Vr(t.getMonth()+1)}-${Vr(t.getDate())}`,n=t.getHours(),r=t.getMinutes(),i=t.getSeconds();return n||r||i?`${e} ${Vr(n)}:${Vr(r)}:${Vr(i)}`:e}Hr.props={};const Ur=(t={})=>{const{channel:e="x"}=t;return(t,n)=>{const{encode:r}=n,{tooltip:i}=n;if(kr(i))return[t,n];const{title:o}=i;if(void 0!==o)return[t,n];const a=Object.keys(r).filter((t=>t.startsWith(e))).filter((t=>!r[t].inferred)).map((t=>bn(r,t))).filter((([t])=>t)).map((t=>t[0]));if(0===a.length)return[t,n];const s=[];for(const e of t)s[e]={value:a.map((t=>t[e]instanceof Date?Yr(t[e]):t[e])).join(", ")};return[t,X({},n,{tooltip:{title:s}})]}};Ur.props={};const qr=()=>(t,e)=>{const{encode:n}=e,{x:r}=n;return void 0!==r?[t,e]:[t,X({},e,{encode:{x:gn(vn(t,0))},scale:{x:{guide:null}}})]};qr.props={};const Xr=()=>(t,e)=>{const{encode:n}=e,{y:r}=n;return void 0!==r?[t,e]:[t,X({},e,{encode:{y:gn(vn(t,0))},scale:{y:{guide:null}}})]};Xr.props={};const Kr=()=>(t,e)=>{const{encode:n}=e,{z:r}=n;return void 0!==r?[t,e]:[t,X({},e,{encode:{z:gn(vn(t,0))},scale:{z:{guide:null}}})]};Kr.props={};const Zr=()=>(t,e)=>{const{encode:n}=e,{size:r}=n;return void 0!==r?[t,e]:[t,X({},e,{encode:{size:mn(vn(t,3))}})]};Zr.props={};const Qr=()=>(t,e)=>{const{encode:n}=e,{key:r}=n,i=Me(n,["key"]);if(void 0!==r)return[t,e];const o=Object.values(i).map((({value:t})=>t)),a=t.map((t=>o.filter(Array.isArray).map((e=>e[t])).join("-")));return[t,X({},e,{encode:{key:pn(a)}})]};Qr.props={};const Jr=()=>(t,e)=>{const{encode:n}=e,{series:r,color:i}=n;if(void 0!==r||void 0===i)return[t,e];const[o,a]=bn(n,"color");return[t,X({},e,{encode:{series:pn(o,a)}})]};Jr.props={};const ti=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(wn)?[t,e]:[t,X({},e,{encode:{y:pn(n)}})]};ti.props={};const ei=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(wn)?[t,e]:[t,X({},e,{encode:{x:pn(n)}})]};ei.props={};const ni=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;if(r)return[t,e];const[i]=bn(n,"y");return[t,X({},e,{encode:{y1:pn([...i])}})]};ni.props={};const ri=()=>(t,e)=>{const{encode:n}=e,{x1:r}=n;if(r)return[t,e];const[i]=bn(n,"x");return[t,X({},e,{encode:{x1:pn([...i])}})]};ri.props={};const ii=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(wn))){const r=(t,e)=>Array.isArray(t[0])?t.map((t=>t[e])):[t[e]];return[t,X({},e,{encode:{x:pn(r(n,0)),x1:pn(r(n,1))}})]}return[t,e]};ii.props={};const oi=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(wn))){const r=(t,e)=>Array.isArray(t[0])?t.map((t=>t[e])):[t[e]];return[t,X({},e,{encode:{y:pn(r(n,0)),y1:pn(r(n,1))}})]}return[t,e]};oi.props={};const ai=t=>{const{channel:e}=t;return(t,n)=>{const{encode:r,tooltip:i}=n;if(kr(i))return[t,n];const{items:o=[]}=i;if(!o||o.length>0)return[t,n];const a=(Array.isArray(e)?e:[e]).flatMap((t=>Object.keys(r).filter((e=>e.startsWith(t))).map((t=>{const{field:e,value:n,inferred:i=!1,aggregate:o}=r[t];return i?null:o&&n?{channel:t}:e?{field:e}:n?{channel:t}:null})).filter((t=>null!==t))));return[t,X({},n,{tooltip:{items:a}})]}};ai.props={};const si=()=>(t,e)=>[t,X({scale:{x:{padding:0},y:{padding:0}}},e)];si.props={};const ci=()=>(t,e)=>{const{data:n,style:r={}}=e,i=Me(e,["data","style"]),{x:o,y:a}=r,s=Me(r,["x","y"]);if(null==o||null==a)return[t,e];const c=a||0;return[[0],X({},i,{data:[0],cartesian:!0,encode:{x:pn([o||0]),y:pn([c])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:s})]};ci.props={};const li=()=>(t,e)=>{const{style:n={}}=e;return[t,X({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter((([,t])=>"function"==typeof t)).map((([t,e])=>[t,()=>e]))))})]};li.props={};const ui=()=>(t,e)=>{const{data:n}=e;if(!Array.isArray(n)||n.some(wn))return[t,e];const r=Array.isArray(n[0])?n:[n],i=r.map((t=>t[0])),o=r.map((t=>t[1]));return[t,X({},e,{encode:{x:pn(i),y:pn(o)}})]};ui.props={};const fi=()=>(t,e)=>{const{style:n={},encode:r}=e,{series:i}=r,{gradient:o}=n;return!o||i?[t,e]:[t,X({},e,{encode:{series:mn(vn(t,void 0))}})]};fi.props={};const hi=(t={})=>{const{groupBy:e="x",reverse:n=!1,orderBy:r,padding:i}=t;return Me(t,["groupBy","reverse","orderBy","padding"]),(t,o)=>{const{data:a,encode:s,scale:c}=o,{series:l}=c,[u]=bn(s,"y"),[f]=xn(s,"series","color"),h=Ir(f,l),d=Lr(e,t,o),p=jr(r)(a,u,f);p&&Rr(d,p);const g=new Array(t.length);for(const t of d){n&&t.reverse();for(let e=0;e<t.length;e++)g[t[e]]=h[e]}return[t,X({},o,{scale:{series:{domain:h,paddingInner:i}},encode:{series:pn(g)}})]}};hi.props={};const di=t=>{const{groupBy:e=["x"],reducer:n=((t,e)=>e[t[0]]),orderBy:r=null,reverse:i=!1,duration:o}=t;return(t,a)=>{const{encode:s}=a,c=(Array.isArray(e)?e:[e]).map((t=>[t,bn(s,t)[0]]));if(0===c.length)return[t,a];let l=[t];for(const[,t]of c){const e=[];for(const n of l){const r=Array.from(zn(n,(e=>t[e])).values());e.push(...r)}l=e}if(r){const[t]=bn(s,r);t&&l.sort(((e,r)=>n(e,t)-n(r,t))),i&&l.reverse()}const u=(o||3e3)/l.length,[f]=o?[vn(t,u)]:xn(s,"enterDuration",vn(t,u)),[h]=xn(s,"enterDelay",vn(t,0)),d=new Array(t.length);for(let t=0,e=0;t<l.length;t++){const n=l[t],r=rr(n,(t=>+f[t]));for(const t of n)d[t]=+h[t]+e;e+=r}return[t,X({},a,{encode:{enterDuration:mn(f),enterDelay:mn(d)}})]}};di.props={};const pi=(t={})=>{const{groupBy:e="x",basis:n="max"}=t;return(t,r)=>{const{encode:i,tooltip:o}=r,a=Me(i,["x"]),s=Object.entries(a).filter((([t])=>t.startsWith("y"))).map((([t])=>[t,bn(i,t)[0]])),[,c]=s.find((([t])=>"y"===t)),l=s.map((([e])=>[e,new Array(t.length)])),u=Lr(e,t,r),f=function(t){return"function"==typeof t?t:{min:(t,e)=>or(t,(t=>e[+t])),max:(t,e)=>rr(t,(t=>e[+t])),first:(t,e)=>e[t[0]],last:(t,e)=>e[t[t.length-1]],mean:(t,e)=>ur(t,(t=>e[+t])),median:(t,e)=>fr(t,(t=>e[+t])),sum:(t,e)=>hr(t,(t=>e[+t])),deviation:(t,e)=>jn(t,(t=>e[+t]))}[t]||rr}(n);for(const t of u){const e=f(t,c);for(const n of t)for(let t=0;t<s.length;t++){const[,r]=s[t],[,i]=l[t];i[n]=+r[n]/e}}const h=kr(o)||(null==o?void 0:o.items)&&0!==(null==o?void 0:o.items.length);return[t,X({},r,Object.assign({encode:Object.fromEntries(l.map((([t,e])=>[t,pn(e,bn(i,t)[1])])))},!h&&i.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};function gi(t,...e){return e.reduce(((t,e)=>n=>t(e(n))),t)}function mi(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}function yi(t,e,n,r,i){let o=n||0,a=r||t.length;const s=i||(t=>t);for(;o<a;){const n=Math.floor((o+a)/2);s(t[n])>e?a=n:o=n+1}return o}pi.props={};const vi=Math.sqrt(50),bi=Math.sqrt(10),xi=Math.sqrt(2);function wi(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/10**i;return i>=0?(o>=vi?10:o>=bi?5:o>=xi?2:1)*10**i:-(10**-i)/(o>=vi?10:o>=bi?5:o>=xi?2:1)}function Mi(t,e,n){const r=Math.abs(e-t)/Math.max(0,n);let i=10**Math.floor(Math.log(r)/Math.LN10);const o=r/i;return o>=vi?i*=10:o>=bi?i*=5:o>=xi&&(i*=2),e<t?-i:i}const Oi=(t,e,n=5)=>{const r=[t,e];let i,o=0,a=r.length-1,s=r[o],c=r[a];return c<s&&([s,c]=[c,s],[o,a]=[a,o]),i=wi(s,c,n),i>0?(s=Math.floor(s/i)*i,c=Math.ceil(c/i)*i,i=wi(s,c,n)):i<0&&(s=Math.ceil(s*i)/i,c=Math.floor(c*i)/i,i=wi(s,c,n)),i>0?(r[o]=Math.floor(s/i)*i,r[a]=Math.ceil(c/i)*i):i<0&&(r[o]=Math.ceil(s*i)/i,r[a]=Math.floor(c*i)/i),r},Ei=1e3,ki=6e4,Si=36e5,Ai=864e5,_i=6048e5,Ti=2592e6,Pi=31536e6;function Ci(t,e,n,r){const i=(t,i)=>{i&&((t,e)=>{const i=t=>r(t)%e==0;let o=e;for(;o&&!i(t);)n(t,-1),o-=1})(t,i),e(t)},o=(t,e)=>{const r=new Date(+t-1);return i(r,e),n(r,e),i(r),r};return{ceil:o,floor:(t,e)=>{const n=new Date(+t);return i(n,e),n},range:(t,e,r,a)=>{const s=[],c=Math.floor(r);for(let l=a?o(t,r):o(t);l<e;n(l,c),i(l))s.push(new Date(+l));return s},duration:t}}const Ni=Ci(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),Li=Ci(Ei,(t=>{t.setMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+Ei*e)}),(t=>t.getSeconds())),ji=Ci(ki,(t=>{t.setSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+ki*e)}),(t=>t.getMinutes())),Ri=Ci(Si,(t=>{t.setMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+Si*e)}),(t=>t.getHours())),Ii=Ci(Ai,(t=>{t.setHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+Ai*e)}),(t=>t.getDate()-1)),Bi=Ci(Ti,(t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e=1)=>{const n=t.getMonth();t.setMonth(n+e)}),(t=>t.getMonth())),Di=Ci(_i,(t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)}),((t,e=1)=>{t.setDate(t.getDate()+7*e)}),(t=>{const e=Bi.floor(t),n=new Date(+t);return Math.floor((+n-+e)/_i)})),Fi=Ci(Pi,(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e=1)=>{const n=t.getFullYear();t.setFullYear(n+e)}),(t=>t.getFullYear())),zi={millisecond:Ni,second:Li,minute:ji,hour:Ri,day:Ii,week:Di,month:Bi,year:Fi},Gi=Ci(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),Wi=Ci(Ei,(t=>{t.setUTCMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+Ei*e)}),(t=>t.getUTCSeconds())),$i=Ci(ki,(t=>{t.setUTCSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+ki*e)}),(t=>t.getUTCMinutes())),Hi=Ci(Si,(t=>{t.setUTCMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+Si*e)}),(t=>t.getUTCHours())),Vi=Ci(Ai,(t=>{t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+Ai*e)}),(t=>t.getUTCDate()-1)),Yi=Ci(Ti,(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{const n=t.getUTCMonth();t.setUTCMonth(n+e)}),(t=>t.getUTCMonth())),Ui=Ci(_i,(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+_i*e)}),(t=>{const e=Yi.floor(t),n=new Date(+t);return Math.floor((+n-+e)/_i)})),qi=Ci(Pi,(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{const n=t.getUTCFullYear();t.setUTCFullYear(n+e)}),(t=>t.getUTCFullYear())),Xi={millisecond:Gi,second:Wi,minute:$i,hour:Hi,day:Vi,week:Ui,month:Yi,year:qi};function Ki(t,e,n,r,i){const o=+t,a=+e,{tickIntervals:s,year:c,millisecond:l}=function(t){const e=t?Xi:zi,{year:n,month:r,week:i,day:o,hour:a,minute:s,second:c,millisecond:l}=e;return{tickIntervals:[[c,1],[c,5],[c,15],[c,30],[s,1],[s,5],[s,15],[s,30],[a,1],[a,3],[a,6],[a,12],[o,1],[o,2],[i,1],[r,1],[r,3],[n,1]],year:n,millisecond:l}}(i),u=([t,e])=>t.duration*e,f=r?(a-o)/r:n||5,h=r||(a-o)/f,d=s.length,p=yi(s,h,0,d,u);let g;if(p===d){g=[c,Mi(o/c.duration,a/c.duration,f)]}else if(p){const t=h/u(s[p-1])<u(s[p])/h,[e,n]=t?s[p-1]:s[p];g=[e,r?Math.ceil(r/e.duration):n]}else{g=[l,Math.max(Mi(o,a,f),1)]}return g}const Zi=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[c,l]=Ki(a,s,n,r,i),u=[c.floor(a,l),c.ceil(s,l)];return o?u.reverse():u};var Qi=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},Ji={}.toString,to=function(t,e){return Ji.call(t)==="[object "+e+"]"},eo=function(t){return null==t},no=function(t){return Array.isArray?Array.isArray(t):to(t,"Array")},ro=function(t){return"object"==typeof t&&null!==t},io=function(t){if(!ro(t)||!to(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},oo=function(t){return to(t,"Number")},ao=function(t){return null===t},so=function(t){return void 0===t};function co(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&&io(o)?(io(t[i])||(t[i]={}),n<r?co(t[i],o,n+1,r):t[i]=e[i]):no(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var lo=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)co(t,e[r]);return t},uo=function(t,e){if(!Qi(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var r=-1,i=0;i<t.length;i++)if(t[i]===e){r=i;break}return r},fo=function(t){return t};function ho(t){return eo(t)?0:Qi(t)?t.length:Object.keys(t).length}function po(t){return!so(t)&&!ao(t)&&!Number.isNaN(t)}const go=t=>e=>-t(-e),mo=(t,e)=>{const n=Math.log(t),r=t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:t=>Math.log(t)/n;return e?go(r):r},yo=(t,e)=>{const n=t===Math.E?Math.exp:e=>t**e;return e?go(n):n},vo=(t,e,n,r)=>{const i=t<0,o=mo(r,i),a=yo(r,i),s=t>e,c=s?e:t,l=s?t:e,u=[a(Math.floor(o(c))),a(Math.ceil(o(l)))];return s?u.reverse():u};var bo={exports:{}},xo={exports:{}},wo=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))},Mo=Array.prototype.concat,Oo=Array.prototype.slice,Eo=xo.exports=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];wo(i)?e=Mo.call(e,Oo.call(i)):e.push(i)}return e};Eo.wrap=function(t){return function(){return t(Eo(arguments))}};var ko={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},So=xo.exports,Ao=Object.hasOwnProperty,_o=Object.create(null);for(var To in ko)Ao.call(ko,To)&&(_o[ko[To]]=To);var Po=bo.exports={to:{},get:{}};function Co(t,e,n){return Math.min(Math.max(e,t),n)}function No(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}Po.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=Po.get.hsl(t),n="hsl";break;case"hwb":e=Po.get.hwb(t),n="hwb";break;default:e=Po.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},Po.get.rgb=function(t){if(!t)return null;var e,n,r,i=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=e[2],e=e[1],n=0;n<3;n++){var o=2*n;i[n]=parseInt(e.slice(o,o+2),16)}r&&(i[3]=parseInt(r,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(r=(e=e[1])[3],n=0;n<3;n++)i[n]=parseInt(e[n]+e[n],16);r&&(i[3]=parseInt(r+r,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)i[n]=parseInt(e[n+1],0);e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:Ao.call(ko,e[1])?((i=ko[e[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}for(n=0;n<3;n++)i[n]=Co(i[n],0,255);return i[3]=Co(i[3],0,1),i},Po.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,Co(parseFloat(e[2]),0,100),Co(parseFloat(e[3]),0,100),Co(isNaN(n)?1:n,0,1)]}return null},Po.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,Co(parseFloat(e[2]),0,100),Co(parseFloat(e[3]),0,100),Co(isNaN(n)?1:n,0,1)]}return null},Po.to.hex=function(){var t=So(arguments);return"#"+No(t[0])+No(t[1])+No(t[2])+(t[3]<1?No(Math.round(255*t[3])):"")},Po.to.rgb=function(){var t=So(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},Po.to.rgb.percent=function(){var t=So(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},Po.to.hsl=function(){var t=So(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},Po.to.hwb=function(){var t=So(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},Po.to.keyword=function(t){return _o[t.slice(0,3)]};var Lo=bo.exports;function jo(t,e,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function Ro(t){const e=Lo.get(t);if(!e)return null;const{model:n,value:r}=e;return"rgb"===n?r:"hsl"===n?function(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100,i=t[3];if(0===n)return[255*r,255*r,255*r,i];const o=r<.5?r*(1+n):r+n-r*n,a=2*r-o;return[255*jo(a,o,e+1/3),255*jo(a,o,e),255*jo(a,o,e-1/3),i]}(r):null}const Io=(t,e)=>n=>t*(1-n)+e*n,Bo=(t,e)=>"number"==typeof t&&"number"==typeof e?Io(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=Ro(t),r=Ro(e);return null===n||null===r?n?()=>t:()=>e:t=>{const e=new Array(4);for(let i=0;i<4;i+=1){const o=n[i],a=r[i];e[i]=o*(1-t)+a*t}const[i,o,a,s]=e;return`rgba(${Math.round(i)}, ${Math.round(o)}, ${Math.round(a)}, ${s})`}})(t,e):()=>t,Do=(t,e)=>{const n=Io(t,e);return t=>Math.round(n(t))};function Fo({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function zo(t){return"object"==typeof t?t.valueOf():t}class Go extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=zo,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Fo({map:this.map,initKey:this.initKey},t))}has(t){return super.has(Fo({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(function({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(function({map:t,initKey:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}({map:this.map,initKey:this.initKey},t))}}class Wo{constructor(t){this.options=lo({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=lo({},this.options,t),this.rescale(t)}rescale(t){}}const $o=Symbol("defaultUnknown");function Ho(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function Vo(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:o}=t;let a=i.get(e);if(void 0===a){if(o!==$o)return o;a=n.push(e)-1,i.set(e,a)}return r[a%r.length]}function Yo(t){return t instanceof Date?t=>`${t}`:"object"==typeof t?t=>JSON.stringify(t):t=>t}class Uo extends Wo{getDefaultOptions(){return{domain:[],range:[],unknown:$o}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&Ho(this.domainIndexMap,this.getDomain(),this.domainKey),Vo({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&Ho(this.rangeIndexMap,this.getRange(),this.rangeKey),Vo({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[e]=this.options.domain,[n]=this.options.range;if(this.domainKey=Yo(e),this.rangeKey=Yo(n),!this.rangeIndexMap)return this.rangeIndexMap=new Map,void(this.domainIndexMap=new Map);t&&!t.range||this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new Uo(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:t,compare:e}=this.options;return this.sortedDomain=e?[...t].sort(e):t,this.sortedDomain}}function qo(t){return Math.round(1e12*t)/1e12}function Xo(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:o,round:a,align:s}=t,c=e.length,l=function(t,e){const n=e-t.length;return n>0?[...t,...new Array(n).fill(1)]:n<0?t.slice(0,e):t}(o,c),[u,f]=n,h=f-u,d=h/(2/c*r+1-1/c*i),p=d*i/c,g=d-c*p,m=function(t){const e=Math.min(...t);return t.map((t=>t/e))}(l),y=m.reduce(((t,e)=>t+e)),v=g/y,b=new Go(e.map(((t,e)=>{const n=m[e]*v;return[t,a?Math.floor(n):n]}))),x=new Go(e.map(((t,e)=>{const n=m[e]*v+p;return[t,a?Math.floor(n):n]}))),w=Array.from(x.values()).reduce(((t,e)=>t+e)),M=u+(h-(w-w/c*i))*s;let O=a?Math.round(M):M;const E=new Array(c);for(let t=0;t<c;t+=1){E[t]=qo(O);const n=e[t];O+=x.get(n)}return{valueBandWidth:b,valueStep:x,adjustedRange:E}}class Ko extends Uo{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:$o,flex:[]}}constructor(t){super(t)}clone(){return new Ko(this.options)}getStep(t){return void 0===this.valueStep?1:"number"==typeof this.valueStep?this.valueStep:void 0===t?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return void 0===this.valueBandWidth?1:"number"==typeof this.valueBandWidth?this.valueBandWidth:void 0===t?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:t,paddingInner:e}=this.options;return t>0?t:e}getPaddingOuter(){const{padding:t,paddingOuter:e}=this.options;return t>0?t:e}rescale(){super.rescale();const{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:o,valueBandWidth:a,valueStep:s}=function(t){var e;const{domain:n}=t,r=n.length;if(0===r)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(null===(e=t.flex)||void 0===e?void 0:e.length)return Xo(t);const{range:i,paddingOuter:o,paddingInner:a,round:s,align:c}=t;let l,u,f=i[0];const h=i[1]-f,d=2*o,p=r-a;l=h/Math.max(1,d+p),s&&(l=Math.floor(l)),f+=(h-l*(r-a))*c,u=l*(1-a),s&&(f=Math.round(f),u=Math.round(u));const g=new Array(r).fill(0).map(((t,e)=>f+e*l));return{valueStep:l,valueBandWidth:u,adjustedRange:g}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=s,this.valueBandWidth=a,this.adjustedRange=o}}const Zo=(t,e,n)=>{let r,i,o=t,a=e;if(o===a&&n>0)return[o];let s=wi(o,a,n);if(0===s||!Number.isFinite(s))return[];if(s>0){o=Math.ceil(o/s),a=Math.floor(a/s),i=new Array(r=Math.ceil(a-o+1));for(let t=0;t<r;t+=1)i[t]=(o+t)*s}else{s=-s,o=Math.ceil(o*s),a=Math.floor(a*s),i=new Array(r=Math.ceil(a-o+1));for(let t=0;t<r;t+=1)i[t]=(o+t)/s}return i};class Qo extends Wo{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:Zo}}map(t){const[e]=this.options.range;return void 0!==e?e:this.options.unknown}invert(t){const[e]=this.options.range;return t===e&&void 0!==e?this.options.domain:[]}getTicks(){const{tickMethod:t,domain:e,tickCount:n}=this.options,[r,i]=e;return oo(r)&&oo(i)?t(r,i,n):[]}clone(){return new Qo(this.options)}}function Jo(t){return Math.abs(t)<1e-14?t:parseFloat(t.toFixed(14))}const ta=[1,5,2,2.5,4,3],ea=100*Number.EPSILON;function na(t,e,n,r,i,o){const a=ho(e),s=uo(e,t);let c=0;const l=function(t,e){return(t%e+e)%e}(r,o);return(l<ea||o-l<ea)&&r<=0&&i>=0&&(c=1),1-s/(a-1)-n+c}function ra(t,e,n){const r=ho(e);return 1-uo(e,t)/(r-1)-n+1}function ia(t,e,n,r,i,o){const a=(t-1)/(o-i),s=(e-1)/(Math.max(o,r)-Math.min(n,i));return 2-Math.max(a/s,s/a)}function oa(t,e){return t>=e?2-(t-1)/(e-1):1}function aa(t,e,n,r){return 1-.5*((e-r)**2+(t-n)**2)/(.1*(e-t))**2}function sa(t,e,n){const r=e-t;if(n>r){return 1-((n-r)/2)**2/(.1*r)**2}return 1}const ca=(t,e,n=5,r=!0,i=ta,o=[.25,.2,.5,.05])=>{const a=n<0?0:Math.round(n);if(Number.isNaN(t)||Number.isNaN(e)||"number"!=typeof t||"number"!=typeof e||!a)return[];if(e-t<1e-15||1===a)return[t];const s={score:-2,lmin:0,lmax:0,lstep:0};let c=1;for(;c<1/0;){for(let n=0;n<i.length;n+=1){const l=i[n],u=ra(l,i,c);if(o[0]*u+o[1]+o[2]+o[3]<s.score){c=1/0;break}let f=2;for(;f<1/0;){const n=oa(f,a);if(o[0]*u+o[1]+o[2]*n+o[3]<s.score)break;const h=(e-t)/(f+1)/c/l;let d=Math.ceil(Math.log10(h));for(;d<1/0;){const h=c*l*10**d,p=sa(t,e,h*(f-1));if(o[0]*u+o[1]*p+o[2]*n+o[3]<s.score)break;const g=Math.floor(e/h)*c-(f-1)*c,m=Math.ceil(t/h)*c;if(g<=m){const n=m-g;for(let u=0;u<=n;u+=1){const n=(g+u)*(h/c),d=n+h*(f-1),p=h,m=na(l,i,c,n,d,p),y=aa(t,e,n,d),v=ia(f,a,t,e,n,d),b=1,x=o[0]*m+o[1]*y+o[2]*v+o[3]*b;x>s.score&&(!r||n<=t&&d>=e)&&(s.lmin=n,s.lmax=d,s.lstep=p,s.score=x)}}d+=1}f+=1}}c+=1}const l=Jo(s.lmax),u=Jo(s.lmin),f=Jo(s.lstep),h=Math.floor(function(t){return Math.round(1e12*t)/1e12}((l-u)/f))+1,d=new Array(h);d[0]=Jo(u);for(let t=1;t<h;t+=1)d[t]=Jo(d[t-1]+f);return d};class la extends Wo{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:ca}}map(t){return po(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new la(this.options)}getTicks(){const{domain:t,tickCount:e,tickMethod:n}=this.options,[r,i]=t;return oo(r)&&oo(i)?n(r,i,e):[]}}const ua=(t,e,n)=>{const[r,i]=t,[o,a]=e;let s,c;return r<i?(s=mi(r,i),c=n(o,a)):(s=mi(i,r),c=n(a,o)),gi(c,s)},fa=(t,e,n)=>{const r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=t[0]>t[r],s=a?[...t].reverse():t,c=a?[...e].reverse():e;for(let t=0;t<r;t+=1)i[t]=mi(s[t],s[t+1]),o[t]=n(c[t],c[t+1]);return e=>{const n=yi(t,e,1,r)-1,a=i[n];return gi(o[n],a)(e)}},ha=(t,e,n,r)=>(Math.min(t.length,e.length)>2?fa:ua)(t,e,r?Do:n);class da extends Wo{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Io,tickCount:5}}map(t){return po(t)?this.output(t):this.options.unknown}invert(t){return po(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,e,n,...r]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,e,n,...r)}getTicks(){const{tickMethod:t}=this.options,[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return Oi}rescale(){this.nice();const[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){const{clamp:e,range:n}=this.options,r=this.options.domain.map(t),i=Math.min(r.length,n.length);return e?function(t,e){const n=e<t?e:t,r=t>e?t:e;return t=>Math.min(Math.max(n,t),r)}(r[0],r[i-1]):fo}composeOutput(t,e){const{domain:n,range:r,round:i,interpolate:o}=this.options,a=ha(n.map(t),r,o,i);this.output=gi(a,e,t)}composeInput(t,e,n){const{domain:r,range:i}=this.options,o=ha(i,r.map(t),Io);this.input=gi(e,n,o)}}class pa extends da{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:Bo,tickMethod:Zo,tickCount:5}}chooseTransforms(){return[fo,fo]}clone(){return new pa(this.options)}}class ga extends Ko{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:$o,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new ga(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const ma=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class ya extends da{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:Bo,tickMethod:Zo,tickCount:5}}constructor(t){super(t)}chooseTransforms(){const{exponent:t}=this.options;if(1===t)return[fo,fo];const e=.5===t?ma:(t=>e=>e<0?-((-e)**t):e**t)(t),n=(t=>e=>e<0?-((-e)**(1/t)):e**(1/t))(t);return[e,n]}clone(){return new ya(this.options)}}class va extends ya{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Bo,tickMethod:Zo,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new va(this.options)}}class ba extends Wo{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){if(!po(t))return this.options.unknown;const e=yi(this.thresholds,t,0,this.n);return this.options.range[e]}invert(t){const{range:e}=this.options,n=e.indexOf(t),r=this.thresholds;return[r[n-1],r[n]]}clone(){return new ba(this.options)}rescale(){const{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const xa=(t,e,n,r=10)=>{const i=t<0,o=yo(r,i),a=mo(r,i),s=e<t,c=s?e:t,l=s?t:e;let u=a(c),f=a(l),h=[];if(!(r%1)&&f-u<n){if(u=Math.floor(u),f=Math.ceil(f),i)for(;u<=f;u+=1){const t=o(u);for(let e=r-1;e>=1;e-=1){const n=t*e;if(n>l)break;n>=c&&h.push(n)}}else for(;u<=f;u+=1){const t=o(u);for(let e=1;e<r;e+=1){const n=t*e;if(n>l)break;n>=c&&h.push(n)}}2*h.length<n&&(h=Zo(c,l,n))}else{const t=-1===n?f-u:Math.min(f-u,n);h=Zo(u,f,t).map(o)}return s?h.reverse():h};class wa extends da{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:Bo,tickMethod:xa,tickCount:5}}chooseNice(){return vo}getTickMethodOptions(){const{domain:t,tickCount:e,base:n}=this.options;return[t[0],t[t.length-1],e,n]}chooseTransforms(){const{base:t,domain:e}=this.options,n=e[0]<0;return[mo(t,n),yo(t,n)]}clone(){return new wa(this.options)}}class Ma extends ba{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:ca}}constructor(t){super(t)}nice(){const{nice:t}=this.options;if(t){const[t,e,n]=this.getTickMethodOptions();this.options.domain=Oi(t,e,n)}}getTicks(){const{tickMethod:t}=this.options,[e,n,r]=this.getTickMethodOptions();return t(e,n,r)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}rescale(){this.nice();const{range:t,domain:e}=this.options,[n,r]=e;this.n=t.length-1,this.thresholds=new Array(this.n);for(let t=0;t<this.n;t+=1)this.thresholds[t]=((t+1)*r-(t-this.n)*n)/(this.n+1)}invert(t){const[e,n]=super.invert(t),[r,i]=this.options.domain;return void 0===e&&void 0===n?[e,n]:[e||r,n||i]}getThresholds(){return this.thresholds}clone(){return new Ma(this.options)}}function Oa(t,e){const n=t.length;if(!n)return;if(n<2)return t[n-1];const r=(n-1)*e,i=Math.floor(r),o=t[i];return o+(t[i+1]-o)*(r-i)}class Ea extends ba{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:ca}}constructor(t){super(t)}rescale(){const{domain:t,range:e}=this.options;this.n=e.length-1,this.thresholds=function(t,e,n=!1){const r=t;n||r.sort(((t,e)=>t-e));const i=[];for(let t=1;t<e;t+=1)i.push(Oa(r,t/e));return i}(t,this.n+1,!1)}invert(t){const[e,n]=super.invert(t),{domain:r}=this.options,i=r[0],o=r[r.length-1];return void 0===e&&void 0===n?[e,n]:[e||i,n||o]}getThresholds(){return this.thresholds}clone(){return new Ea(this.options)}getTicks(){const{tickCount:t,domain:e,tickMethod:n}=this.options,r=e.length-1;return n(e[0],e[r],t)}}var ka=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,Sa=/\[([^]*?)\]/gm;function Aa(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function _a(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++){var o=i[r];for(var a in o)t[a]=o[a]}return t}var Ta=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Pa=["January","February","March","April","May","June","July","August","September","October","November","December"],Ca=Aa(Pa,3),Na=_a({},{dayNamesShort:Aa(Ta,3),dayNames:Ta,monthNamesShort:Ca,monthNames:Pa,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10?1:0)*t%10]}}),La=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t},ja={D:function(t){return String(t.getDate())},DD:function(t){return La(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return La(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return String(t.getMonth()+1)},MM:function(t){return La(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return La(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return La(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return La(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return La(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return La(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return La(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return La(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return La(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return t.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+La(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+La(Math.floor(Math.abs(e)/60),2)+":"+La(Math.abs(e)%60,2)}},Ra={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"};const Ia=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[c,l]=Ki(a,s,n,r,i),u=c.range(a,new Date(+s+1),l,!0);return o?u.reverse():u};function Ba(t){const e=t.getTimezoneOffset(),n=new Date(t);return n.setMinutes(n.getMinutes()+e,n.getSeconds(),n.getMilliseconds()),n}class Da extends da{getDefaultOptions(){return{domain:[new Date(2e3,0,1),new Date(2e3,0,2)],range:[0,1],nice:!1,tickCount:5,tickInterval:void 0,unknown:void 0,clamp:!1,tickMethod:Ia,interpolate:Io,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return Zi}getTickMethodOptions(){const{domain:t,tickCount:e,tickInterval:n,utc:r}=this.options;return[t[0],t[t.length-1],e,n,r]}getFormatter(){const{mask:t,utc:e}=this.options,n=e?Xi:zi,r=e?Ba:fo;return e=>function(t,e,n){if(void 0===e&&(e=Ra.default),void 0===n&&(n={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");var r=[];e=(e=Ra[e]||e).replace(Sa,(function(t,e){return r.push(e),"@@@"}));var i=_a(_a({},Na),n);return(e=e.replace(ka,(function(e){return ja[e](t,i)}))).replace(/@@@/g,(function(){return r.shift()}))}(r(e),t||function(t,e){const{second:n,minute:r,hour:i,day:o,week:a,month:s,year:c}=e;return n.floor(t)<t?".SSS":r.floor(t)<t?":ss":i.floor(t)<t?"hh:mm":o.floor(t)<t?"hh A":s.floor(t)<t?a.floor(t)<t?"MMM DD":"ddd DD":c.floor(t)<t?"MMMM":"YYYY"}(e,n))}clone(){return new Da(this.options)}}var Fa,za=window&&window.__decorate||function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};let Ga=Fa=class extends pa{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:fo,tickMethod:Zo,tickCount:5}}constructor(t){super(t)}clone(){return new Fa(this.options)}};function Wa(t,e,n){if(null===t)return[-.5,.5];const r=Ir(t,e),i=new Ko({domain:r,range:[0,1],padding:n}).getBandWidth();return[-i/2,i/2]}function $a(t,e,n){return e*(1-t)+n*t}Ga=Fa=za([function(t,e){return n=>{n.prototype.rescale=function(){this.initRange(),this.nice();const[t]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t))},n.prototype.initRange=function(){const{interpolator:e}=this.options;this.options.range=t(e)},n.prototype.composeOutput=function(t,n){const{domain:r,interpolator:i,round:o}=this.getOptions(),a=e(r.map(t)),s=o?(t=>e=>{const n=t(e);return oo(n)?Math.round(n):n})(i):i;this.output=gi(s,a,n,t)},n.prototype.invert=void 0}}((function(t){return[t(0),t(1)]}),(t=>{const[e,n]=t;return gi(Io(0,1),mi(e,n))}))],Ga);const Ha=(t={})=>{const{padding:e=0,paddingX:n=e,paddingY:r=e,random:i=Math.random}=t;return(t,e)=>{const{encode:o,scale:a}=e,{x:s,y:c}=a,[l]=bn(o,"x"),[u]=bn(o,"y"),f=Wa(l,s,n),h=Wa(u,c,r),d=t.map((()=>$a(i(),...h))),p=t.map((()=>$a(i(),...f)));return[t,X({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:pn(d),dx:pn(p)}})]}};Ha.props={};const Va=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(t,r)=>{const{encode:i,scale:o}=r,{x:a}=o,[s]=bn(i,"x"),c=Wa(s,a,e),l=t.map((()=>$a(n(),...c)));return[t,X({scale:{x:{padding:.5}}},r,{encode:{dx:pn(l)}})]}};Va.props={};const Ya=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(t,r)=>{const{encode:i,scale:o}=r,{y:a}=o,[s]=bn(i,"y"),c=Wa(s,a,e),l=t.map((()=>$a(n(),...c)));return[t,X({scale:{y:{padding:.5}}},r,{encode:{dy:pn(l)}})]}};Ya.props={};const Ua=(t={})=>{const{groupBy:e="x"}=t;return(t,n)=>{const{encode:r}=n,i=Me(r,["x"]),o=Object.entries(i).filter((([t])=>t.startsWith("y"))).map((([t])=>[t,bn(r,t)[0]])),a=o.map((([e])=>[e,new Array(t.length)])),s=Lr(e,t,n),c=new Array(s.length);for(let t=0;t<s.length;t++){const e=s[t].flatMap((t=>o.map((([,e])=>+e[t])))),[n,r]=Rn(e);c[t]=(n+r)/2}const l=Math.max(...c);for(let t=0;t<s.length;t++){const e=l-c[t],n=s[t];for(const t of n)for(let n=0;n<o.length;n++){const[,r]=o[n],[,i]=a[n];i[t]=+r[t]+e}}return[t,X({},n,{encode:Object.fromEntries(a.map((([t,e])=>[t,pn(e,bn(r,t)[1])])))})]}};Ua.props={};const qa=(t={})=>{const{groupBy:e="x",series:n=!0}=t;return(t,r)=>{const{encode:i}=r,[o]=bn(i,"y"),[a,s]=bn(i,"y1");n?xn(i,"series","color"):bn(i,"color");const c=Lr(e,t,r),l=new Array(t.length);for(const t of c){const e=t.map((t=>+o[t]));for(let n=0;n<t.length;n++){const r=t[n],i=Math.max(...e.filter(((t,e)=>e!==n)));l[r]=o[r]>i?i:o[r]}}return[t,X({},r,{encode:{y1:pn(l,s)}})]}};function Xa(t,e){return[t[0]]}function Ka(t,e){return[t[t.length-1]]}function Za(t,e){return[t[ir(t,(t=>e[t]))]]}function Qa(t,e){return[t[ar(t,(t=>e[t]))]]}qa.props={};const Ja=(t={})=>{const{groupBy:e="series",channel:n,selector:r}=t;return(t,i)=>{const{encode:o}=i,a=Lr(e,t,i),[s]=bn(o,n),c=function(t){return"function"==typeof t?t:{first:Xa,last:Ka,max:Za,min:Qa}[t]||Xa}(r);return[a.flatMap((t=>c(t,s))),i]}};Ja.props={};const ts=(t={})=>{const{selector:e}=t,n=Me(t,["selector"]);return Ja(Object.assign({channel:"x",selector:e},n))};ts.props={};const es=(t={})=>{const{selector:e}=t,n=Me(t,["selector"]);return Ja(Object.assign({channel:"y",selector:e},n))};function ns(t){return e=>null===e?t:`${t} of ${e}`}function rs(){return[(t,e)=>ur(t,(t=>+e[t])),ns("mean")]}function is(){return[(t,e)=>fr(t,(t=>+e[t])),ns("median")]}function os(){return[(t,e)=>rr(t,(t=>+e[t])),ns("max")]}function as(){return[(t,e)=>or(t,(t=>+e[t])),ns("min")]}function ss(){return[(t,e)=>t.length,ns("count")]}function cs(){return[(t,e)=>hr(t,(t=>+e[t])),ns("sum")]}function ls(){return[(t,e)=>e[t[0]],ns("first")]}function us(){return[(t,e)=>e[t[t.length-1]],ns("last")]}es.props={};const fs=(t={})=>{const{groupBy:e}=t,n=Me(t,["groupBy"]);return(t,r)=>{const{data:i,encode:o}=r,a=e(t,r);if(!a)return[t,r];const s=Object.entries(n).map((([t,e])=>{const[n,r]=function(t){if("function"==typeof t)return[t,null];const e={mean:rs,max:os,count:ss,first:ls,last:us,sum:cs,min:as,median:is}[t];if(!e)throw new Error(`Unknown reducer: ${t}.`);return e()}(e),[s,c]=bn(o,t),l=((t,e)=>{if(t)return t;const{from:n}=e;if(!n)return t;const[,r]=bn(o,n);return r})(c,e),u=a.map((t=>n(t,null!=s?s:i)));return[t,Object.assign(Object.assign({},yn(u,(null==r?void 0:r(l))||l)),{aggregate:!0})]})),c=Object.keys(o).map((t=>{const[e,n]=bn(o,t),r=a.map((t=>e[t[0]]));return[t,pn(r,n)]})),l=a.map((t=>i[t[0]]));return[_r(a),X({},r,{data:l,encode:Object.fromEntries([...c,...s])})]}};fs.props={};const hs=(t={})=>{const{channels:e=["x","y"]}=t,n=Me(t,["channels"]);return fs(Object.assign(Object.assign({},n),{groupBy:(t,n)=>Lr(e,t,n)}))};hs.props={};const ds=(t={})=>hs(Object.assign(Object.assign({},t),{channels:["x","color","series"]}));ds.props={};const ps=(t={})=>hs(Object.assign(Object.assign({},t),{channels:["y","color","series"]}));ps.props={};const gs=(t={})=>hs(Object.assign(Object.assign({},t),{channels:["color"]}));function ms(t,e,n){var r;const{reverse:i,slice:o,channel:a}=n,s=Me(n,["reverse","slice","channel"]),{encode:c,scale:l={}}=e,u=null===(r=l[a])||void 0===r?void 0:r.domain,[f]=bn(c,a),h=function(t,e,n){const{by:r=t,reducer:i="max"}=e,[o]=bn(n,r);if("function"==typeof i)return t=>i(t,o);if("max"===i)return t=>rr(t,(t=>+o[t]));if("min"===i)return t=>or(t,(t=>+o[t]));if("sum"===i)return t=>hr(t,(t=>+o[t]));if("median"===i)return t=>fr(t,(t=>+o[t]));if("mean"===i)return t=>ur(t,(t=>+o[t]));if("first"===i)return t=>o[t[0]];if("last"===i)return t=>o[t[t.length-1]];throw new Error(`Unknown reducer: ${i}`)}(a,s,c),d=function(t,e,n){if(!Array.isArray(n))return t;const r=new Set(n);return t.filter((t=>r.has(e[t])))}(t,f,u),p=function(t,e,n){return(2!==e.length?Vn(Wn(t,e,n),(([t,e],[n,r])=>On(e,r)||On(t,n))):Vn(zn(t,n),(([t,n],[r,i])=>e(n,i)||On(t,r)))).map((([t])=>t))}(d,h,(t=>f[t]));i&&p.reverse();const g="number"==typeof o?[0,o]:o,m=o?p.slice(...g):p;return[t,X(e,{scale:{[a]:{domain:m}}})]}gs.props={};const ys=(t={})=>{const{reverse:e=!1,slice:n,channel:r,ordinal:i=!0}=t,o=Me(t,["reverse","slice","channel","ordinal"]);return(t,a)=>i?ms(t,a,Object.assign({reverse:e,slice:n,channel:r},o)):function(t,e,n){const{reverse:r,channel:i}=n,{encode:o}=e,[a]=bn(o,i),s=Vn(t,(t=>a[t]));return r&&s.reverse(),[s,e]}(t,a,Object.assign({reverse:e,slice:n,channel:r},o))};ys.props={};const vs=(t={})=>ys(Object.assign(Object.assign({},t),{channel:"x"}));vs.props={};const bs=(t={})=>ys(Object.assign(Object.assign({},t),{channel:"color"}));bs.props={};const xs=(t={})=>ys(Object.assign(Object.assign({},t),{channel:"y"}));xs.props={};const ws=(t={})=>{const{field:e,channel:n="y",reducer:r="sum"}=t;return(t,i)=>{const{data:o,encode:a}=i,[s]=bn(a,"x"),c=e?function(t,e){return"string"==typeof e?t.map((t=>t[e])):t.map(e)}(o,e):bn(a,n)[0],l=function(t,e){if("function"==typeof t)return n=>t(n,e);if("sum"===t)return t=>hr(t,(t=>+e[t]));throw new Error(`Unknown reducer: ${t}`)}(r,c),u=$n(t,l,(t=>s[t])).map((t=>t[1]));return[t,X({},i,{scale:{x:{flex:u}}})]}};function Ms([t,e],[n,r]){return[t-n,e-r]}function Os([t,e],[n,r]){return[t+n,e+r]}function Es([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function ks([t,e]){return Math.atan2(e,t)}function Ss([t,e]){return ks([t,e])+Math.PI/2}function As(t,e){const n=ks(t),r=ks(e);return n<r?r-n:2*Math.PI-(n-r)}function _s(t){let e=1/0,n=-1/0,r=1/0,i=-1/0;for(const[o,a]of t)e=Math.min(o,e),n=Math.max(o,n),r=Math.min(a,r),i=Math.max(a,i);return[e,r,n-e,i-r]}function Ts([t,e],[n,r]){return[(t+n)/2,(e+r)/2]}function Ps(t){const{padding:e=0,direction:n="col"}=t;return(t,r,i)=>{const o=t.length;if(0===o)return[];const{innerWidth:a,innerHeight:s}=i,c=s/a;let l=Math.ceil(Math.sqrt(r/c)),u=a/l,f=Math.ceil(r/l),h=f*u;for(;h>s;)l+=1,u=a/l,f=Math.ceil(r/l),h=f*u;const d=s-f*u,p=f<=1?0:d/(f-1),[g,m]=f<=1?[(a-o*u)/(o-1),(s-u)/2]:[0,0];return t.map(((t,r)=>{const[i,o,a,s]=_s(t),c="col"===n?r%l:Math.floor(r/f),h="col"===n?Math.floor(r/l):r%f;return`translate(${c*u-i+g*c+.5*e}, ${(f-h-1)*u+d-o-p*h-m+.5*e}) scale(${(u-e)/a}, ${(u-e)/s})`}))}}ws.props={};const Cs=t=>(e,n)=>[e,X({},n,{modifier:Ps(t),axis:!1})];Cs.props={};const Ns="thresholds";function Ls(t){const[e,n]=Rn(t);return Math.min(200,function(t,e,n){const r=Ln(t),i=jn(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}(t,e,n))}const js=(t={})=>{const{groupChannels:e=["color"],binChannels:n=["x","y"]}=t,r=Me(t,["groupChannels","binChannels"]),i={};return fs(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(r).filter((([t])=>!t.startsWith(Ns))))),Object.fromEntries(n.flatMap((t=>{const e=([e])=>+i[t].get(e).split(",")[1];return e.from=t,[[t,([e])=>+i[t].get(e).split(",")[0]],[`${t}1`,e]]})))),{groupBy:(t,o)=>{const{encode:a}=o,s=n.map((t=>{const[e]=bn(a,t);return e})),c=xr(r,Ns),l=t.filter((t=>s.every((e=>vr(e[t]))))),u=[...e.map((t=>{const[e]=bn(a,t);return e})).filter(vr).map((t=>e=>t[e])),...n.map(((t,e)=>{const n=s[e],r=c[t]||Ls(n),o=nr().thresholds(r).value((t=>+n[t]))(l),a=new Map(o.flatMap((t=>{const{x0:e,x1:n}=t,r=`${e},${n}`;return t.map((t=>[t,r]))})));return i[t]=a,t=>a.get(t)}))];return Array.from(zn(l,(t=>u.map((e=>e(t))).join("-"))).values())}}))};js.props={};const Rs=(t={})=>{const{thresholds:e}=t;return js(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))};function Is(t,e,n,r){const i=t.length;if(r>=i||0===r)return t;const o=n=>1*e[t[n]],a=e=>1*n[t[e]],s=[],c=(i-2)/(r-2);let l,u,f,h=0;s.push(h);for(let t=0;t<r-2;t++){let e=0,n=0,r=Math.floor((t+1)*c)+1,d=Math.floor((t+2)*c)+1;d=Math.min(d,i);const p=d-r;for(;r<d;r++)e+=o(r),n+=a(r);e/=p,n/=p;let g=Math.floor((t+0)*c)+1;const m=Math.floor((t+1)*c)+1,y=[o(h),a(h)];for(l=u=-1;g<m;g++)u=.5*Math.abs((y[0]-e)*(o(g)-y[1])-(y[0]-a(g))*(n-y[0])),u>l&&(l=u,f=g);s.push(f),h=f}return s.push(i-1),s.map((e=>t[e]))}Rs.props={};const Bs=(t={})=>{const{strategy:e="median",thresholds:n=2e3,groupBy:r=["series","color"]}=t,i=function(t){if("function"==typeof t)return t;if("lttb"===t)return Is;const e={first:t=>[t[0]],last:t=>[t[t.length-1]],min:(t,e,n)=>[t[ar(t,(t=>n[t]))]],max:(t,e,n)=>[t[ir(t,(t=>n[t]))]],median:(t,e,n)=>{return[t[(r=t,i=t=>n[t],lr(r,.5,i))]];var r,i}},n=e[t]||e.median;return(t,e,r,i)=>{const o=function(t,e){const n=t.length,r=[];let i=0;for(;i<n;)r.push(t.slice(i,i+=e));return r}(t,Math.max(1,Math.floor(t.length/i)));return o.flatMap((t=>n(t,e,r)))}}(e);return(t,e)=>{const{encode:o}=e,a=Lr(r,t,e),[s]=bn(o,"x"),[c]=bn(o,"y");return[a.flatMap((t=>i(t,s,c,n))),e]}};Bs.props={};const Ds=(t={})=>(e,n)=>{const{encode:r,data:i}=n,o=Object.entries(t).map((([t,e])=>{const[n]=bn(r,t);if(!n)return null;const[i,o=!0]=function(t){return"object"==typeof t?[t.value,t.ordinal]:[t,!0]}(e);if("function"==typeof i)return t=>i(n[t]);if(o){const t=Array.isArray(i)?i:[i];return 0===t.length?null:e=>t.includes(n[e])}{const[t,e]=i;return r=>n[r]>=t&&n[r]<=e}})).filter(vr);if(0===o.length)return[e,n];const a=e.filter((t=>o.every((e=>e(t))))),s=a.map(((t,e)=>e)),c=Object.entries(r).map((([t,e])=>[t,Object.assign(Object.assign({},e),{value:s.map((t=>e.value[a[t]])).filter((t=>void 0!==t))})]));return[s,X({},n,{encode:Object.fromEntries(c),data:a.map((t=>i[t]))})]};function Fs(t){return function(){return t}}Ds.props={};const zs=Math.abs,Gs=Math.atan2,Ws=Math.cos,$s=Math.max,Hs=Math.min,Vs=Math.sin,Ys=Math.sqrt,Us=1e-12,qs=Math.PI,Xs=qs/2,Ks=2*qs;function Zs(t){return t>=1?Xs:t<=-1?-Xs:Math.asin(t)}const Qs=Math.PI,Js=2*Qs,tc=1e-6,ec=Js-tc;function nc(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class rc{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?nc:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return nc;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=Math.round(arguments[e]*n)/n+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,r){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(t,e,n,r,i,o){this._append`C${+t},${+e},${+n},${+r},${this._x1=+i},${this._y1=+o}`}arcTo(t,e,n,r,i){if(t=+t,e=+e,n=+n,r=+r,(i=+i)<0)throw new Error(`negative radius: ${i}`);let o=this._x1,a=this._y1,s=n-t,c=r-e,l=o-t,u=a-e,f=l*l+u*u;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(f>tc)if(Math.abs(u*s-c*l)>tc&&i){let h=n-o,d=r-a,p=s*s+c*c,g=h*h+d*d,m=Math.sqrt(p),y=Math.sqrt(f),v=i*Math.tan((Qs-Math.acos((p+f-g)/(2*m*y)))/2),b=v/y,x=v/m;Math.abs(b-1)>tc&&this._append`L${t+b*l},${e+b*u}`,this._append`A${i},${i},0,0,${+(u*h>l*d)},${this._x1=t+x*s},${this._y1=e+x*c}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,n,r,i,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(r),s=n*Math.sin(r),c=t+a,l=e+s,u=1^o,f=o?r-i:i-r;null===this._x1?this._append`M${c},${l}`:(Math.abs(this._x1-c)>tc||Math.abs(this._y1-l)>tc)&&this._append`L${c},${l}`,n&&(f<0&&(f=f%Js+Js),f>ec?this._append`A${n},${n},0,1,${u},${t-a},${e-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:f>tc&&this._append`A${n},${n},0,${+(f>=Qs)},${u},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function ic(){return new rc}function oc(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new rc(e)}function ac(t){return t.innerRadius}function sc(t){return t.outerRadius}function cc(t){return t.startAngle}function lc(t){return t.endAngle}function uc(t){return t&&t.padAngle}function fc(t,e,n,r,i,o,a){var s=t-n,c=e-r,l=(a?o:-o)/Ys(s*s+c*c),u=l*c,f=-l*s,h=t+u,d=e+f,p=n+u,g=r+f,m=(h+p)/2,y=(d+g)/2,v=p-h,b=g-d,x=v*v+b*b,w=i-o,M=h*g-p*d,O=(b<0?-1:1)*Ys($s(0,w*w*x-M*M)),E=(M*b-v*O)/x,k=(-M*v-b*O)/x,S=(M*b+v*O)/x,A=(-M*v+b*O)/x,_=E-m,T=k-y,P=S-m,C=A-y;return _*_+T*T>P*P+C*C&&(E=S,k=A),{cx:E,cy:k,x01:-u,y01:-f,x11:E*(i/w-1),y11:k*(i/w-1)}}function hc(){var t=ac,e=sc,n=Fs(0),r=null,i=cc,o=lc,a=uc,s=null,c=oc(l);function l(){var l,u,f=+t.apply(this,arguments),h=+e.apply(this,arguments),d=i.apply(this,arguments)-Xs,p=o.apply(this,arguments)-Xs,g=zs(p-d),m=p>d;if(s||(s=l=c()),h<f&&(u=h,h=f,f=u),h>Us)if(g>Ks-Us)s.moveTo(h*Ws(d),h*Vs(d)),s.arc(0,0,h,d,p,!m),f>Us&&(s.moveTo(f*Ws(p),f*Vs(p)),s.arc(0,0,f,p,d,m));else{var y,v,b=d,x=p,w=d,M=p,O=g,E=g,k=a.apply(this,arguments)/2,S=k>Us&&(r?+r.apply(this,arguments):Ys(f*f+h*h)),A=Hs(zs(h-f)/2,+n.apply(this,arguments)),_=A,T=A;if(S>Us){var P=Zs(S/f*Vs(k)),C=Zs(S/h*Vs(k));(O-=2*P)>Us?(w+=P*=m?1:-1,M-=P):(O=0,w=M=(d+p)/2),(E-=2*C)>Us?(b+=C*=m?1:-1,x-=C):(E=0,b=x=(d+p)/2)}var N=h*Ws(b),L=h*Vs(b),j=f*Ws(M),R=f*Vs(M);if(A>Us){var I,B=h*Ws(x),D=h*Vs(x),F=f*Ws(w),z=f*Vs(w);if(g<qs)if(I=function(t,e,n,r,i,o,a,s){var c=n-t,l=r-e,u=a-i,f=s-o,h=f*c-u*l;if(!(h*h<Us))return[t+(h=(u*(e-o)-f*(t-i))/h)*c,e+h*l]}(N,L,F,z,B,D,j,R)){var G=N-I[0],W=L-I[1],$=B-I[0],H=D-I[1],V=1/Vs(function(t){return t>1?0:t<-1?qs:Math.acos(t)}((G*$+W*H)/(Ys(G*G+W*W)*Ys($*$+H*H)))/2),Y=Ys(I[0]*I[0]+I[1]*I[1]);_=Hs(A,(f-Y)/(V-1)),T=Hs(A,(h-Y)/(V+1))}else _=T=0}E>Us?T>Us?(y=fc(F,z,N,L,h,T,m),v=fc(B,D,j,R,h,T,m),s.moveTo(y.cx+y.x01,y.cy+y.y01),T<A?s.arc(y.cx,y.cy,T,Gs(y.y01,y.x01),Gs(v.y01,v.x01),!m):(s.arc(y.cx,y.cy,T,Gs(y.y01,y.x01),Gs(y.y11,y.x11),!m),s.arc(0,0,h,Gs(y.cy+y.y11,y.cx+y.x11),Gs(v.cy+v.y11,v.cx+v.x11),!m),s.arc(v.cx,v.cy,T,Gs(v.y11,v.x11),Gs(v.y01,v.x01),!m))):(s.moveTo(N,L),s.arc(0,0,h,b,x,!m)):s.moveTo(N,L),f>Us&&O>Us?_>Us?(y=fc(j,R,B,D,f,-_,m),v=fc(N,L,F,z,f,-_,m),s.lineTo(y.cx+y.x01,y.cy+y.y01),_<A?s.arc(y.cx,y.cy,_,Gs(y.y01,y.x01),Gs(v.y01,v.x01),!m):(s.arc(y.cx,y.cy,_,Gs(y.y01,y.x01),Gs(y.y11,y.x11),!m),s.arc(0,0,f,Gs(y.cy+y.y11,y.cx+y.x11),Gs(v.cy+v.y11,v.cx+v.x11),m),s.arc(v.cx,v.cy,_,Gs(v.y11,v.x11),Gs(v.y01,v.x01),!m))):s.arc(0,0,f,M,w,m):s.lineTo(j,R)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-qs/2;return[Ws(r)*n,Vs(r)*n]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Fs(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Fs(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:Fs(+t),l):n},l.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Fs(+t),l):r},l.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:Fs(+t),l):i},l.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:Fs(+t),l):o},l.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:Fs(+t),l):a},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function dc(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function pc(t){this._context=t}function gc(t){return new pc(t)}function mc(t){return t[0]}function yc(t){return t[1]}function vc(t,e){var n=Fs(!0),r=null,i=gc,o=null,a=oc(s);function s(s){var c,l,u,f=(s=dc(s)).length,h=!1;for(null==r&&(o=i(u=a())),c=0;c<=f;++c)!(c<f&&n(l=s[c],c,s))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+t(l,c,s),+e(l,c,s));if(u)return o=null,u+""||null}return t="function"==typeof t?t:void 0===t?mc:Fs(t),e="function"==typeof e?e:void 0===e?yc:Fs(e),s.x=function(e){return arguments.length?(t="function"==typeof e?e:Fs(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:Fs(+t),s):e},s.defined=function(t){return arguments.length?(n="function"==typeof t?t:Fs(!!t),s):n},s.curve=function(t){return arguments.length?(i=t,null!=r&&(o=i(r)),s):i},s.context=function(t){return arguments.length?(null==t?r=o=null:o=i(r=t),s):r},s}function bc(t,e,n){var r=null,i=Fs(!0),o=null,a=gc,s=null,c=oc(l);function l(l){var u,f,h,d,p,g=(l=dc(l)).length,m=!1,y=new Array(g),v=new Array(g);for(null==o&&(s=a(p=c())),u=0;u<=g;++u){if(!(u<g&&i(d=l[u],u,l))===m)if(m=!m)f=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),h=u-1;h>=f;--h)s.point(y[h],v[h]);s.lineEnd(),s.areaEnd()}m&&(y[u]=+t(d,u,l),v[u]=+e(d,u,l),s.point(r?+r(d,u,l):y[u],n?+n(d,u,l):v[u]))}if(p)return s=null,p+""||null}function u(){return vc().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?mc:Fs(+t),e="function"==typeof e?e:Fs(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?yc:Fs(+n),l.x=function(e){return arguments.length?(t="function"==typeof e?e:Fs(+e),r=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:Fs(+e),l):t},l.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Fs(+t),l):r},l.y=function(t){return arguments.length?(e="function"==typeof t?t:Fs(+t),n=null,l):e},l.y0=function(t){return arguments.length?(e="function"==typeof t?t:Fs(+t),l):e},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Fs(+t),l):n},l.lineX0=l.lineY0=function(){return u().x(t).y(e)},l.lineY1=function(){return u().x(t).y(n)},l.lineX1=function(){return u().x(r).y(e)},l.defined=function(t){return arguments.length?(i="function"==typeof t?t:Fs(!!t),l):i},l.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),l):a},l.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),l):o},l}ic.prototype=rc.prototype,pc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var xc=Mc(gc);function wc(t){this._curve=t}function Mc(t){function e(e){return new wc(t(e))}return e._curve=t,e}function Oc(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(Mc(t)):e()._curve},t}function Ec(){}function kc(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Sc(t,e){this._context=t,this._k=(1-e)/6}function Ac(t,e){this._context=t,this._k=(1-e)/6}function _c(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>Us){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>Us){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*l+t._x1*t._l23_2a-e*t._l12_2a)/u,a=(a*l+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function Tc(t,e){this._context=t,this._alpha=e}function Pc(t,e){this._context=t,this._alpha=e}wc.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}},Sc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:kc(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:kc(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new Sc(t,e)}return n.tension=function(e){return t(+e)},n}(0),Ac.prototype={areaStart:Ec,areaEnd:Ec,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:kc(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new Ac(t,e)}return n.tension=function(e){return t(+e)},n}(0),Tc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:_c(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return e?new Tc(t,e):new Sc(t,0)}return n.alpha=function(e){return t(+e)},n}(.5),Pc.prototype={areaStart:Ec,areaEnd:Ec,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:_c(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Cc=function t(e){function n(t){return e?new Pc(t,e):new Ac(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Nc(t){this._context=t}function Lc(t){return new Nc(t)}function jc(t){return t<0?-1:1}function Rc(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(jc(o)+jc(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Ic(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Bc(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function Dc(t){this._context=t}function Fc(t){this._context=new zc(t)}function zc(t){this._context=t}function Gc(t){return new Dc(t)}function Wc(t){return new Fc(t)}function $c(t,e){this._context=t,this._t=e}function Hc(t){return new $c(t,.5)}function Vc(t){return new $c(t,0)}function Yc(t){return new $c(t,1)}function Uc(t){const{transformations:e}=t.getOptions();return e.map((([t])=>t)).filter((t=>"transpose"===t)).length%2!=0}function qc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"polar"===t))}function Xc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"reflect"===t))&&e.some((([t])=>t.startsWith("transpose")))}function Kc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"helix"===t))}function Zc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"parallel"===t))}function Qc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"fisheye"===t))}function Jc(t){return Kc(t)||qc(t)}function tl(t){const{transformations:e}=t.getOptions(),[,,,n,r]=e.find((t=>"polar"===t[0]));return[+n,+r]}function el(t,e=!0){const{transformations:n}=t.getOptions(),[,r,i]=n.find((t=>"polar"===t[0]));return e?[180*+r/Math.PI,180*+i/Math.PI]:[r,i]}Nc.prototype={areaStart:Ec,areaEnd:Ec,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},Dc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Bc(this,this._t0,Ic(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Bc(this,Ic(this,n=Rc(this,t,e)),n);break;default:Bc(this,this._t0,n=Rc(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(Fc.prototype=Object.create(Dc.prototype)).point=function(t,e){Dc.prototype.point.call(this,e,t)},zc.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}},$c.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var nl="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},rl={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||t,a),c=n?n+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],s]:t._events[c].push(s):(t._events[c]=s,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(t){var e=n?n+t:t,r=this._events[e];return r?r.fn?1:r.length:0},s.prototype.emit=function(t,e,r,i,o,a){var s=n?n+t:t;if(!this._events[s])return!1;var c,l,u=this._events[s],f=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),f){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,r),!0;case 4:return u.fn.call(u.context,e,r,i),!0;case 5:return u.fn.call(u.context,e,r,i,o),!0;case 6:return u.fn.call(u.context,e,r,i,o,a),!0}for(l=1,c=new Array(f-1);l<f;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var h,d=u.length;for(l=0;l<d;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),f){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,r);break;case 4:u[l].fn.call(u[l].context,e,r,i);break;default:if(!c)for(h=1,c=new Array(f-1);h<f;h++)c[h-1]=arguments[h];u[l].fn.apply(u[l].context,c)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var c=0,l=[],u=s.length;c<u;c++)(s[c].fn!==e||i&&!s[c].once||r&&s[c].context!==r)&&l.push(s[c]);l.length?this._events[o]=1===l.length?l[0]:l:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&a(this,e)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}(rl);var il=rl.exports;function ol(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function al(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function sl(){}var cl=.7,ll=1/cl,ul="\\s*([+-]?\\d+)\\s*",fl="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",hl="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",dl=/^#([0-9a-f]{3,8})$/,pl=new RegExp("^rgb\\("+[ul,ul,ul]+"\\)$"),gl=new RegExp("^rgb\\("+[hl,hl,hl]+"\\)$"),ml=new RegExp("^rgba\\("+[ul,ul,ul,fl]+"\\)$"),yl=new RegExp("^rgba\\("+[hl,hl,hl,fl]+"\\)$"),vl=new RegExp("^hsl\\("+[fl,hl,hl]+"\\)$"),bl=new RegExp("^hsla\\("+[fl,hl,hl,fl]+"\\)$"),xl={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 wl(){return this.rgb().formatHex()}function Ml(){return this.rgb().formatRgb()}function Ol(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=dl.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?El(e):3===n?new Sl(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?kl(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?kl(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=pl.exec(t))?new Sl(e[1],e[2],e[3],1):(e=gl.exec(t))?new Sl(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ml.exec(t))?kl(e[1],e[2],e[3],e[4]):(e=yl.exec(t))?kl(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=vl.exec(t))?Pl(e[1],e[2]/100,e[3]/100,1):(e=bl.exec(t))?Pl(e[1],e[2]/100,e[3]/100,e[4]):xl.hasOwnProperty(t)?El(xl[t]):"transparent"===t?new Sl(NaN,NaN,NaN,0):null}function El(t){return new Sl(t>>16&255,t>>8&255,255&t,1)}function kl(t,e,n,r){return r<=0&&(t=e=n=NaN),new Sl(t,e,n,r)}function Sl(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Al(){return"#"+Tl(this.r)+Tl(this.g)+Tl(this.b)}function _l(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Tl(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Pl(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Nl(t,e,n,r)}function Cl(t){if(t instanceof Nl)return new Nl(t.h,t.s,t.l,t.opacity);if(t instanceof sl||(t=Ol(t)),!t)return new Nl;if(t instanceof Nl)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 Nl(a,s,c,t.opacity)}function Nl(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Ll(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 jl(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function Rl(t,e){var n=Math.min.apply(Math,_e([],Ae(t),!1)),r=Math.min.apply(Math,_e([],Ae(e),!1));return{x:n,y:r,width:Math.max.apply(Math,_e([],Ae(t),!1))-n,height:Math.max.apply(Math,_e([],Ae(e),!1))-r}}function Il(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function Bl(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function Dl(t,e,n,r,i,o,a){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),c=1/0,l=-1/0,u=[o,a],f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var h=s+f;o<a?o<h&&h<a&&u.push(h):a<h&&h<o&&u.push(h)}for(f=0;f<u.length;f++){var d=Il(t,0,n,r,i,u[f]);d<c&&(c=d),d>l&&(l=d)}var p=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),g=1/0,m=-1/0,y=[o,a];for(f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var v=p+f;o<a?o<v&&v<a&&y.push(v):a<v&&v<o&&y.push(v)}for(f=0;f<y.length;f++){var b=Bl(0,e,n,r,i,y[f]);b<g&&(g=b),b>m&&(m=b)}return{x:c,y:g,width:l-c,height:m-g}}ol(sl,Ol,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:wl,formatHex:wl,formatHsl:function(){return Cl(this).formatHsl()},formatRgb:Ml,toString:Ml}),ol(Sl,(function(t,e,n,r){return 1===arguments.length?((i=t)instanceof sl||(i=Ol(i)),i?new Sl((i=i.rgb()).r,i.g,i.b,i.opacity):new Sl):new Sl(t,e,n,null==r?1:r);var i}),al(sl,{brighter:function(t){return t=null==t?ll:Math.pow(ll,t),new Sl(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?cl:Math.pow(cl,t),new Sl(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Al,formatHex:Al,formatRgb:_l,toString:_l})),ol(Nl,(function(t,e,n,r){return 1===arguments.length?Cl(t):new Nl(t,e,n,null==r?1:r)}),al(sl,{brighter:function(t){return t=null==t?ll:Math.pow(ll,t),new Nl(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?cl:Math.pow(cl,t),new Nl(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Sl(Ll(t>=240?t-240:t+120,i,r),Ll(t,i,r),Ll(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Fl=1e-4;function zl(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,_e([],Ae(t.concat([d])),!1)),i.apply(void 0,_e([],Ae(e.concat([d])),!1))];(v=jl(c[0],c[1],p[0],p[1]))<s&&(a=d,s=v)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var g=t.length;return{x:t[g-1],y:e[g-1]}}s=1/0;for(h=0;h<32&&!(f<Fl);h++){var m=a-f,y=a+f,v=(p=[i.apply(void 0,_e([],Ae(t.concat([m])),!1)),i.apply(void 0,_e([],Ae(e.concat([m])),!1))],jl(c[0],c[1],p[0],p[1]));if(m>=0&&v<s)a=m,s=v;else{var b=[i.apply(void 0,_e([],Ae(t.concat([y])),!1)),i.apply(void 0,_e([],Ae(e.concat([y])),!1))],x=jl(c[0],c[1],b[0],b[1]);y<=1&&x<s?(a=y,s=x):f*=.5}}return{x:i.apply(void 0,_e([],Ae(t.concat([a])),!1)),y:i.apply(void 0,_e([],Ae(e.concat([a])),!1))}}function Gl(t,e,n,r){return jl(t,e,n,r)}function Wl(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function $l(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 Hl(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 Vl(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(R(s,0))R(c,0)||(i=-l/c)>=0&&i<=1&&u.push(i);else{var f=c*c-4*s*l;R(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 Yl(t,e,n,r,i,o,a,s){for(var c=[t,a],l=[e,s],u=Vl(t,n,i,a),f=Vl(e,r,o,s),h=0;h<u.length;h++)c.push(Hl(t,n,i,a,u[h]));for(h=0;h<f.length;h++)l.push(Hl(e,r,o,s,f[h]));return Rl(c,l)}function Ul(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 zl([t,n,i,a],[e,r,o,s],c,l,Hl,u)}(t,e,n,r,i,o,a,s,c,l,u);return jl(f.x,f.y,c,l)}function ql(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+=jl(r[0],r[1],i[0],i[1])}return e}(t)}function Xl(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Kl(t,e,n){var r=t+n-2*e;if(R(r,0))return[.5];var i=(t-e)/r;return i<=1&&i>=0?[i]:[]}function Zl(t,e,n,r,i,o){var a=Kl(t,n,i)[0],s=Kl(e,r,o)[0],c=[t,i],l=[e,o];return void 0!==a&&c.push(Xl(t,n,i,a)),void 0!==s&&l.push(Xl(e,r,o,s)),Rl(c,l)}function Ql(t,e,n,r,i,o,a,s){var c=function(t,e,n,r,i,o,a,s){return zl([t,n,i],[e,r,o],a,s,Xl)}(t,e,n,r,i,o,a,s);return jl(c.x,c.y,a,s)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==nl||"undefined"!=typeof self&&self;var Jl={exports:{}};!function(t,e){t.exports=function(){function t(t,n,i,o,a){e(t,n,i||0,o||t.length-1,a||r)}function e(t,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,c=r-i+1,l=Math.log(s),u=.5*Math.exp(2*l/3),f=.5*Math.sqrt(l*u*(s-u)/s)*(c-s/2<0?-1:1);e(t,r,Math.max(i,Math.floor(r-c*u/s+f)),Math.min(o,Math.floor(r+(s-c)*u/s+f)),a)}var 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 m(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function y(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(e,n,r,i,o){for(var a=[n,r];a.length;)if(!((r=a.pop())-(n=a.pop())<=i)){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,o),a.push(n,s,s,r)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!m(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;o<e.children.length;o++){var a=e.children[o],s=e.leaf?r(a):a;m(t,s)&&(e.leaf?n.push(a):g(t,s)?this._all(a,n):i.push(a))}e=i.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!m(t,e))return!1;for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(m(t,o)){if(e.leaf||g(t,o))return!0;n.push(i)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=y([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,a=this.data,s=this.toBBox(t),c=[],l=[];a||c.length;){if(a||(a=c.pop(),r=c[c.length-1],n=l.pop(),i=!0),a.leaf){var u=o(t,a.children,e);if(-1!==u)return a.children.splice(u,1),c.push(a),this._condense(c),this}i||a.leaf||!g(a,s)?r?(n++,a=r.children[n],i=!1):a=null:(c.push(a),l.push(n),n=0,r=a,a=a.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,r){var i,o=n-e+1,s=this._maxEntries;if(o<=s)return a(i=y(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),(i=y([])).leaf=!1,i.height=r;var c=Math.ceil(o/s),l=c*Math.ceil(Math.sqrt(s));v(t,e,n,l,this.compareMinX);for(var u=e;u<=n;u+=l){var f=Math.min(u+l-1,n);v(t,u,f,c,this.compareMinY);for(var 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}()}(Jl);var tu,eu,nu=Jl.exports;!function(t){t.GROUP="g",t.CIRCLE="circle",t.ELLIPSE="ellipse",t.IMAGE="image",t.RECT="rect",t.LINE="line",t.POLYLINE="polyline",t.POLYGON="polygon",t.TEXT="text",t.PATH="path",t.HTML="html",t.MESH="mesh"}(tu||(tu={})),function(t){t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE"}(eu||(eu={}));var ru=function(){function t(){this.plugins=[]}return t.prototype.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},t.prototype.removeAllRenderingPlugins=function(){var t=this;this.plugins.forEach((function(e){var n=t.context.renderingPlugins.indexOf(e);n>=0&&t.context.renderingPlugins.splice(n,1)}))},t}(),iu=function(){function t(t){this.clipSpaceNearZ=eu.NEGATIVE_ONE,this.plugins=[],this.config=we({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},t)}return t.prototype.registerPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));-1===e&&this.plugins.push(t)},t.prototype.unregisterPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)},t.prototype.getPlugins=function(){return this.plugins},t.prototype.getPlugin=function(t){return this.plugins.find((function(e){return e.name===t}))},t.prototype.getConfig=function(){return this.config},t.prototype.setConfig=function(t){Object.assign(this.config,t)},t}();function ou(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function au(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function su(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function cu(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function lu(t){return void 0===t?0:t>360||t<-360?t%360:t}function uu(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?Vt(t):L(t)?Ut(t,e,n):Ut(t[0],t[1]||e,t[2]||n)}function fu(t){return t*(Math.PI/180)}function hu(t){return t*(180/Math.PI)}function du(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,o=Ae(Pt(Ht(),e),3),a=o[0],s=o[1],c=o[2],l=Math.asin(-e[2]/a);return l<i?l>-i?(n=Math.atan2(e[6]/s,e[10]/c),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/s,e[5]/s)):(r=0,n=Math.atan2(e[4]/s,e[5]/s)),t[0]=n,t[1]=l,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=r*r,s=i*i,c=o*o,l=n*n+a+s+c,u=n*o-r*i;return u>.499995*l?(t[0]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):u<-.499995*l?(t[0]=-Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-o*r)),t[1]=Math.atan2(2*(n*o+r*i),1-2*(s+c)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(a+s))),t}(t,e)}function pu(t,e,n,r,i){var o,a,s,c,l,u,f,h,d,p,g=Math.cos(t),m=Math.sin(t);return o=r*g,a=i*m,s=0,c=-r*m,l=i*g,u=0,f=e,h=n,d=1,(p=new at(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 gu(t){var e=t[0],n=t[1],r=t[3],i=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(r*r+i*i);e*i-n*r<0&&(e<i?o=-o:a=-a),o&&(e*=1/o,n*=1/o),a&&(r*=1/a,i*=1/a);var s=hu(Math.atan2(n,e));return[t[6],t[7],o,a,s]}var mu=lt(),yu=lt(),vu=ce(),bu=[Ht(),Ht(),Ht()],xu=Ht();function wu(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 Mu,Ou=function(){function t(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return t.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]},t.prototype.update=function(t,e){ou(this.center,t),ou(this.halfExtents,e),au(this.min,this.center,this.halfExtents),su(this.max,this.center,this.halfExtents)},t.prototype.setMinMax=function(t,e){su(this.center,e,t),cu(this.center,this.center,.5),au(this.halfExtents,e,t),cu(this.halfExtents,this.halfExtents,.5),ou(this.min,t),ou(this.max,e)},t.prototype.getMin=function(){return this.min},t.prototype.getMax=function(){return this.max},t.prototype.add=function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],o=n[2],a=this.halfExtents,s=a[0],c=a[1],l=a[2],u=r-s,f=r+s,h=i-c,d=i+c,p=o-l,g=o+l,m=e.center,y=m[0],v=m[1],b=m[2],x=e.halfExtents,w=x[0],M=x[1],O=x[2],E=y-w,k=y+w,S=v-M,A=v+M,_=b-O,T=b+O;E<u&&(u=E),k>f&&(f=k),S<h&&(h=S),A>d&&(d=A),_<p&&(p=_),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}},t.prototype.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,o=t.halfExtents,a=e[0],s=e[4],c=e[8],l=e[1],u=e[5],f=e[9],h=e[2],d=e[6],p=e[10],g=Math.abs(a),m=Math.abs(s),y=Math.abs(c),v=Math.abs(l),b=Math.abs(u),x=Math.abs(f),w=Math.abs(h),M=Math.abs(d),O=Math.abs(p);n[0]=e[12]+a*i[0]+s*i[1]+c*i[2],n[1]=e[13]+l*i[0]+u*i[1]+f*i[2],n[2]=e[14]+h*i[0]+d*i[1]+p*i[2],r[0]=g*o[0]+m*o[1]+y*o[2],r[1]=v*o[0]+b*o[1]+x*o[2],r[2]=w*o[0]+M*o[1]+O*o[2],au(this.min,n,r),su(this.max,n,r)},t.prototype.intersects=function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return n[0]<=r[0]&&e[0]>=i[0]&&n[1]<=r[1]&&e[1]>=i[1]&&n[2]<=r[2]&&e[2]>=i[2]},t.prototype.intersection=function(e){if(!this.intersects(e))return null;var n,r,i,o=new t,a=(n=[0,0,0],r=this.getMin(),i=e.getMin(),n[0]=Math.max(r[0],i[0]),n[1]=Math.max(r[1],i[1]),n[2]=Math.max(r[2],i[2]),n),s=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}([0,0,0],this.getMax(),e.getMax());return o.setMinMax(a,s),o},t.prototype.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?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]]},t.prototype.getPositiveFarPoint=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]]},t}(),Eu=function(){function t(t,e){this.distance=t||0,this.normal=e||Ut(0,1,0),this.updatePNVertexFlag()}return t.prototype.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)},t.prototype.distanceToPoint=function(t){return te(t,this.normal)-this.distance},t.prototype.normalize=function(){var t=1/se(this.normal);Qt(this.normal,this.normal,t),this.distance*=t},t.prototype.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&i<=1;return o&&n&&ne(n,t,e,i),o},t}();!function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"}(Mu||(Mu={}));var ku,Su,Au,_u=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new Eu)}return t.prototype.extractFromVPMatrix=function(t){var e=Ae(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],m=e[14],y=e[15];Xt(this.planes[0].normal,o-n,l-a,d-u),this.planes[0].distance=y-p,Xt(this.planes[1].normal,o+n,l+a,d+u),this.planes[1].distance=y+p,Xt(this.planes[2].normal,o+r,l+s,d+f),this.planes[2].distance=y+g,Xt(this.planes[3].normal,o-r,l-s,d-f),this.planes[3].distance=y-g,Xt(this.planes[4].normal,o-i,l-c,d-h),this.planes[4].distance=y-m,Xt(this.planes[5].normal,o+i,l+c,d+h),this.planes[5].distance=y+m,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),Tu=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y},t}(),Pu=function(){function t(t,e,n,r){this.x=t,this.y=e,this.width=n,this.height=r,this.left=t,this.right=t+n,this.top=e,this.bottom=e+r}return t.prototype.toJSON=function(){},t}(),Cu="Method not implemented.",Nu="Use document.documentElement instead.";!function(t){t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING"}(ku||(ku={})),function(t){t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC"}(Su||(Su={})),function(t){t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE"}(Au||(Au={}));var Lu,ju,Ru,Iu,Bu,Du="updated",Fu=2e-4,zu=function(){function t(){this.clipSpaceNearZ=eu.NEGATIVE_ONE,this.eventEmitter=new il,this.matrix=lt(),this.right=Ut(1,0,0),this.up=Ut(0,1,0),this.forward=Ut(0,0,1),this.position=Ut(0,0,1),this.focalPoint=Ut(0,0,0),this.distanceVector=Ut(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=lt(),this.projectionMatrixInverse=lt(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=ku.EXPLORING,this.trackingMode=Su.DEFAULT,this.projectionMode=Au.PERSPECTIVE,this.frustum=new _u,this.orthoMatrix=lt()}return t.prototype.isOrtho=function(){return this.projectionMode===Au.ORTHOGRAPHIC},t.prototype.getProjectionMode=function(){return this.projectionMode},t.prototype.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},t.prototype.getPerspectiveInverse=function(){return this.projectionMatrixInverse},t.prototype.getFrustum=function(){return this.frustum},t.prototype.getPosition=function(){return this.position},t.prototype.getFocalPoint=function(){return this.focalPoint},t.prototype.getDollyingStep=function(){return this.dollyingStep},t.prototype.getNear=function(){return this.near},t.prototype.getFar=function(){return this.far},t.prototype.getZoom=function(){return this.zoom},t.prototype.getOrthoMatrix=function(){return this.orthoMatrix},t.prototype.getView=function(){return this.view},t.prototype.setEnableUpdate=function(t){this.enableUpdate=t},t.prototype.setType=function(t,e){return this.type=t,this.type===ku.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===ku.TRACKING&&void 0!==e&&this.setTrackingMode(e),this},t.prototype.setProjectionMode=function(t){return this.projectionMode=t,this},t.prototype.setTrackingMode=function(t){if(this.type!==ku.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this},t.prototype.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},t.prototype.getViewTransform=function(){return gt(lt(),this.matrix)},t.prototype.getWorldTransform=function(){return this.matrix},t.prototype.jitterProjectionMatrix=function(t,e){var n=Mt(lt(),[t,e,0]);this.jitteredProjectionMatrix=yt(lt(),n,this.projectionMatrix)},t.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},t.prototype.setMatrix=function(t){return this.matrix=t,this._update(),this},t.prototype.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},t.prototype.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},t.prototype.setNear=function(t){return this.projectionMode===Au.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this},t.prototype.setFar=function(t){return this.projectionMode===Au.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this},t.prototype.setViewOffset=function(t,e,n,r,i,o){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.projectionMode===Au.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},t.prototype.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===Au.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},t.prototype.setZoom=function(t){return this.zoom=t,this.projectionMode===Au.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===Au.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},t.prototype.setZoomByViewportPoint=function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,i=n.y,o=this.roll;this.rotate(0,0,-o),this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t),this.rotate(0,0,o);var a=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=Ut(a.x-r,a.y-i,0),c=te(s,this.right)/Yt(this.right),l=te(s,this.up)/Yt(this.up);return this.pan(-c,-l),this},t.prototype.setPerspective=function(t,e,n,r){var i;this.projectionMode=Au.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var o=this.near*Math.tan(fu(.5*this.fov))/this.zoom,a=2*o,s=this.aspect*a,c=-.5*s;if(null===(i=this.view)||void 0===i?void 0:i.enabled){var l=this.view.fullWidth,u=this.view.fullHeight;c+=this.view.offsetX*s/l,o-=this.view.offsetY*a/u,s*=this.view.width/l,a*=this.view.height/u}return function(t,e,n,r,i,o,a,s){void 0===s&&(s=!1);var c,l,u=2*o/(n-e),f=2*o/(r-i),h=(n+e)/(n-e),d=(r+i)/(r-i);s?(c=-a/(a-o),l=-a*o/(a-o)):(c=-(a+o)/(a-o),l=-2*a*o/(a-o)),t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=f,t[6]=0,t[7]=0,t[8]=h,t[9]=d,t[10]=c,t[11]=-1,t[12]=0,t[13]=0,t[14]=l,t[15]=0}(this.projectionMatrix,c,c+s,o,o-a,t,this.far,this.clipSpaceNearZ===eu.ZERO),bt(this.projectionMatrix,this.projectionMatrix,Ut(1,-1,1)),gt(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},t.prototype.setOrthographic=function(t,e,n,r,i,o){var a;this.projectionMode=Au.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=o;var s=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,u=(this.top+this.bottom)/2,f=l-s,h=l+s,d=u+c,p=u-c;if(null===(a=this.view)||void 0===a?void 0:a.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,m=(this.top-this.bottom)/this.view.fullHeight/this.zoom;h=(f+=g*this.view.offsetX)+g*this.view.width,p=(d-=m*this.view.offsetY)-m*this.view.height}return this.clipSpaceNearZ===eu.NEGATIVE_ONE?Bt(this.projectionMatrix,f,h,p,d,i,o):Dt(this.projectionMatrix,f,h,p,d,i,o),bt(this.projectionMatrix,this.projectionMatrix,Ut(1,-1,1)),gt(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},t.prototype.setPosition=function(t,e,n){void 0===e&&(e=this.position[1]),void 0===n&&(n=this.position[2]);var r=uu(t,e,n);return this._setPosition(r),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},t.prototype.setFocalPoint=function(t,e,n){void 0===e&&(e=this.focalPoint[1]),void 0===n&&(n=this.focalPoint[2]);var r=Ut(0,1,0);if(this.focalPoint=uu(t,e,n),this.trackingMode===Su.CINEMATIC){var i=Zt(Ht(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var o=Yt(i),a=hu(Math.asin(e/o)),s=90+hu(Math.atan2(n,t)),c=lt();wt(c,c,fu(s)),xt(c,c,fu(a)),r=re(Ht(),[0,1,0],c)}return gt(this.matrix,Ft(lt(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},t.prototype.getDistance=function(){return this.distance},t.prototype.getDistanceVector=function(){return this.distanceVector},t.prototype.setDistance=function(t){if(this.distance===t||t<0)return this;this.distance=t,this.distance<Fu&&(this.distance=Fu),this.dollyingStep=this.distance/100;var e=Ht();t=this.distance;var n=this.forward,r=this.focalPoint;return e[0]=t*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate(),this},t.prototype.setMaxDistance=function(t){return this.maxDistance=t,this},t.prototype.setMinDistance=function(t){return this.minDistance=t,this},t.prototype.setAzimuth=function(t){return this.azimuth=lu(t),this.computeMatrix(),this._getAxes(),this.type===ku.ORBITING||this.type===ku.EXPLORING?this._getPosition():this.type===ku.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getAzimuth=function(){return this.azimuth},t.prototype.setElevation=function(t){return this.elevation=lu(t),this.computeMatrix(),this._getAxes(),this.type===ku.ORBITING||this.type===ku.EXPLORING?this._getPosition():this.type===ku.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getElevation=function(){return this.elevation},t.prototype.setRoll=function(t){return this.roll=lu(t),this.computeMatrix(),this._getAxes(),this.type===ku.ORBITING||this.type===ku.EXPLORING?this._getPosition():this.type===ku.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getRoll=function(){return this.roll},t.prototype._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},t.prototype.computeMatrix=function(){var t=fe(ue(),[0,0,1],fu(this.roll));dt(this.matrix);var e=fe(ue(),[1,0,0],fu((this.rotateWorld&&this.type!==ku.TRACKING||this.type===ku.TRACKING?1:-1)*this.elevation)),n=fe(ue(),[0,1,0],fu((this.rotateWorld&&this.type!==ku.TRACKING||this.type===ku.TRACKING?1:-1)*this.azimuth)),r=he(ue(),n,e);r=he(ue(),r,t);var i=Lt(lt(),r);this.type===ku.ORBITING||this.type===ku.EXPLORING?(vt(this.matrix,this.matrix,this.focalPoint),yt(this.matrix,this.matrix,i),vt(this.matrix,this.matrix,[0,0,this.distance])):this.type===ku.TRACKING&&(vt(this.matrix,this.matrix,this.position),yt(this.matrix,this.matrix,i))},t.prototype._setPosition=function(t,e,n){this.position=uu(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1,this._getOrthoMatrix()},t.prototype._getAxes=function(){qt(this.right,uu(le(ce(),[1,0,0,0],this.matrix))),qt(this.up,uu(le(ce(),[0,1,0,0],this.matrix))),qt(this.forward,uu(le(ce(),[0,0,1,0],this.matrix))),Jt(this.right,this.right),Jt(this.up,this.up),Jt(this.forward,this.forward)},t.prototype._getAngles=function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=Yt(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===ku.TRACKING||this.rotateWorld?(this.elevation=hu(Math.asin(e/r)),this.azimuth=hu(Math.atan2(-t,-n))):(this.elevation=-hu(Math.asin(e/r)),this.azimuth=-hu(Math.atan2(-t,-n)))},t.prototype._getPosition=function(){qt(this.position,uu(le(ce(),[0,0,0,1],this.matrix))),this._getDistance()},t.prototype._getFocalPoint=function(){var t,e;ie(this.distanceVector,[0,0,-this.distance],(t=st(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),Kt(this.focalPoint,this.position,this.distanceVector),this._getDistance()},t.prototype._getDistance=function(){this.distanceVector=Zt(Ht(),this.focalPoint,this.position),this.distance=Yt(this.distanceVector),this.dollyingStep=this.distance/100},t.prototype._getOrthoMatrix=function(){if(this.projectionMode===Au.ORTHOGRAPHIC){var t=this.position,e=fe(ue(),[0,0,1],-this.roll*Math.PI/180);Nt(this.orthoMatrix,e,Ut((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),Ut(this.zoom,this.zoom,1),t)}},t.prototype.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=yt(lt(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(Du)}},t.prototype.rotate=function(t,e,n){throw new Error(Cu)},t.prototype.pan=function(t,e){throw new Error(Cu)},t.prototype.dolly=function(t){throw new Error(Cu)},t.prototype.createLandmark=function(t,e){throw new Error(Cu)},t.prototype.gotoLandmark=function(t,e){throw new Error(Cu)},t.prototype.cancelLandmarkAnimation=function(){throw new Error(Cu)},t}();function Gu(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return n.cache=a.set(o,s)||a,s};return n.cache=new(Gu.Cache||Map),n}Gu.Cache=Map,function(t){t[t.kUnknown=0]="kUnknown",t[t.kNumber=1]="kNumber",t[t.kPercentage=2]="kPercentage",t[t.kEms=3]="kEms",t[t.kPixels=4]="kPixels",t[t.kRems=5]="kRems",t[t.kDegrees=6]="kDegrees",t[t.kRadians=7]="kRadians",t[t.kGradians=8]="kGradians",t[t.kTurns=9]="kTurns",t[t.kMilliseconds=10]="kMilliseconds",t[t.kSeconds=11]="kSeconds",t[t.kInteger=12]="kInteger"}(Lu||(Lu={})),function(t){t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther"}(ju||(ju={})),function(t){t[t.kAll=0]="kAll",t[t.kNonNegative=1]="kNonNegative",t[t.kInteger=2]="kInteger",t[t.kNonNegativeInteger=3]="kNonNegativeInteger",t[t.kPositiveInteger=4]="kPositiveInteger"}(Ru||(Ru={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Iu||(Iu={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Bu||(Bu={}));var Wu,$u=[{name:"em",unit_type:Lu.kEms},{name:"px",unit_type:Lu.kPixels},{name:"deg",unit_type:Lu.kDegrees},{name:"rad",unit_type:Lu.kRadians},{name:"grad",unit_type:Lu.kGradians},{name:"ms",unit_type:Lu.kMilliseconds},{name:"s",unit_type:Lu.kSeconds},{name:"rem",unit_type:Lu.kRems},{name:"turn",unit_type:Lu.kTurns}];!function(t){t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType"}(Wu||(Wu={}));var Hu,Vu=function(t){return t?"number"===t?Lu.kNumber:"percent"===t||"%"===t?Lu.kPercentage:function(t){return $u.find((function(e){return e.name===t})).unit_type}(t):Lu.kUnknown},Yu=function(t){var e=1;switch(t){case Lu.kPixels:case Lu.kDegrees:case Lu.kSeconds:break;case Lu.kMilliseconds:e=.001;break;case Lu.kRadians:e=180/Math.PI;break;case Lu.kGradians:e=.9;break;case Lu.kTurns:e=360}return e},Uu=function(t){switch(t){case Lu.kNumber:case Lu.kInteger:return"";case Lu.kPercentage:return"%";case Lu.kEms:return"em";case Lu.kRems:return"rem";case Lu.kPixels:return"px";case Lu.kDegrees:return"deg";case Lu.kRadians:return"rad";case Lu.kGradians:return"grad";case Lu.kMilliseconds:return"ms";case Lu.kSeconds:return"s";case Lu.kTurns:return"turn"}return""},qu=function(){function t(){}return t.isAngle=function(t){return t===Lu.kDegrees||t===Lu.kRadians||t===Lu.kGradians||t===Lu.kTurns},t.isLength=function(t){return t>=Lu.kEms&&t<Lu.kDegrees},t.isRelativeUnit=function(t){return t===Lu.kPercentage||t===Lu.kEms||t===Lu.kRems},t.isTime=function(t){return t===Lu.kSeconds||t===Lu.kMilliseconds},t.prototype.toString=function(){return this.buildCSSText(Iu.kNo,Bu.kNo,"")},t.prototype.isNumericValue=function(){return this.getType()>=Wu.kUnitType&&this.getType()<=Wu.kClampType},t}(),Xu=function(t){function e(e){var n=t.call(this)||this;return n.colorSpace=e,n}return xe(e,t),e.prototype.getType=function(){return Wu.kColorType},e.prototype.to=function(t){return this},e}(qu);!function(t){t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient"}(Hu||(Hu={}));var Ku=function(t){function e(e,n){var r=t.call(this)||this;return r.type=e,r.value=n,r}return xe(e,t),e.prototype.clone=function(){return new e(this.type,this.value)},e.prototype.buildCSSText=function(t,e,n){return n},e.prototype.getType=function(){return Wu.kColorType},e}(qu),Zu=function(t){function e(e){var n=t.call(this)||this;return n.value=e,n}return xe(e,t),e.prototype.clone=function(){return new e(this.value)},e.prototype.getType=function(){return Wu.kKeywordType},e.prototype.buildCSSText=function(t,e,n){return n+this.value},e}(qu),Qu=Gu((function(t){return void 0===t&&(t=""),t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))})),Ju=function(t){return t.split("").map((function(t,e){return t.toUpperCase()===t?"".concat(0!==e?"-":"").concat(t.toLowerCase()):t})).join("")};function tf(t){return"function"==typeof t}var ef={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},nf=Gu((function(t){var e=Qu(t),n=ef[e];return e=(null==n?void 0:n.alias)||e})),rf=function(t,e){void 0===e&&(e="");var n="";return Number.isFinite(t)?(!function(t){if(!t)throw new Error}(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e},of=function(t){return function(t){switch(t){case ju.kUNumber:return Lu.kNumber;case ju.kULength:return Lu.kPixels;case ju.kUPercent:return Lu.kPercentage;case ju.kUTime:return Lu.kSeconds;case ju.kUAngle:return Lu.kDegrees;default:return Lu.kUnknown}}(function(t){switch(t){case Lu.kNumber:case Lu.kInteger:return ju.kUNumber;case Lu.kPercentage:return ju.kUPercent;case Lu.kPixels:return ju.kULength;case Lu.kMilliseconds:case Lu.kSeconds:return ju.kUTime;case Lu.kDegrees:case Lu.kRadians:case Lu.kGradians:case Lu.kTurns:return ju.kUAngle;default:return ju.kUOther}}(t))},af=function(t){function e(e,n){void 0===n&&(n=Lu.kNumber);var r,i=t.call(this)||this;return r="string"==typeof n?Vu(n):n,i.unit=r,i.value=e,i}return xe(e,t),e.prototype.clone=function(){return new e(this.value,this.unit)},e.prototype.equals=function(t){var e=t;return this.value===e.value&&this.unit===e.unit},e.prototype.getType=function(){return Wu.kUnitType},e.prototype.convertTo=function(t){if(this.unit===t)return new e(this.value,this.unit);var n=of(this.unit);if(n!==of(t)||n===Lu.kUnknown)return null;var r=Yu(this.unit)/Yu(t);return new e(this.value*r,t)},e.prototype.buildCSSText=function(t,e,n){var r;switch(this.unit){case Lu.kUnknown:break;case Lu.kInteger:r=Number(this.value).toFixed(0);break;case Lu.kNumber:case Lu.kPercentage:case Lu.kEms:case Lu.kRems:case Lu.kPixels:case Lu.kDegrees:case Lu.kRadians:case Lu.kGradians:case Lu.kMilliseconds:case Lu.kSeconds:case Lu.kTurns:var i=this.value,o=Uu(this.unit);if(i<-999999||i>999999){var a=Uu(this.unit);r=!Number.isFinite(i)||Number.isNaN(i)?rf(i,a):i+(a||"")}else r="".concat(i).concat(o)}return n+=r},e}(qu),sf=new af(0,"px");new af(1,"px");var cf,lf,uf=new af(0,"deg"),ff=function(t){function e(e,n,r,i,o){void 0===i&&(i=1),void 0===o&&(o=!1);var a=t.call(this,"rgb")||this;return a.r=e,a.g=n,a.b=r,a.alpha=i,a.isNone=o,a}return xe(e,t),e.prototype.clone=function(){return new e(this.r,this.g,this.b,this.alpha)},e.prototype.buildCSSText=function(t,e,n){return n+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")},e}(Xu),hf=new Zu("unset"),df=new Zu("initial"),pf=new Zu("inherit"),gf={"":hf,unset:hf,initial:df,inherit:pf},mf=function(t){return gf[t]||(gf[t]=new Zu(t)),gf[t]},yf=new ff(0,0,0,0,!0),vf=new ff(0,0,0,0),bf=Gu((function(t,e,n,r){return new ff(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),xf=function(t,e){return void 0===e&&(e=Lu.kNumber),new af(t,e)};new af(50,"%"),function(t){t[t.Standard=0]="Standard"}(cf||(cf={})),function(t){t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"}(lf||(lf={}));var wf,Mf={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Pu(0,0,0,0)};function Of(t){var e=t.type,n=t.value;return"hex"===e?"#".concat(n):"literal"===e?n:"rgb"===e?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}!function(t){t.COORDINATE="<coordinate>",t.COLOR="<color>",t.PAINT="<paint>",t.NUMBER="<number>",t.ANGLE="<angle>",t.OPACITY_VALUE="<opacity-value>",t.SHADOW_BLUR="<shadow-blur>",t.LENGTH="<length>",t.PERCENTAGE="<percentage>",t.LENGTH_PERCENTAGE="<length> | <percentage>",t.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",t.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",t.LIST_OF_POINTS="<list-of-points>",t.PATH="<path>",t.FILTER="<filter>",t.Z_INDEX="<z-index>",t.OFFSET_DISTANCE="<offset-distance>",t.DEFINED_PATH="<defined-path>",t.MARKER="<marker>",t.TRANSFORM="<transform>",t.TRANSFORM_ORIGIN="<transform-origin>",t.TEXT="<text>",t.TEXT_TRANSFORM="<text-transform>"}(wf||(wf={}));var Ef=function(){var t={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},e="";function n(t){throw new Error(e+": "+t)}function r(){var t=d(i);return e.length>0&&n("Invalid input not EOF"),t}function i(){return o("linear-gradient",t.linearGradient,s)||o("repeating-linear-gradient",t.repeatingLinearGradient,s)||o("radial-gradient",t.radialGradient,c)||o("repeating-radial-gradient",t.repeatingRadialGradient,c)||o("conic-gradient",t.conicGradient,c)}function o(e,r,i){return a(r,(function(r){var o=i();return o&&(b(t.comma)||n("Missing comma before color stops")),{type:e,orientation:o,colorStops:d(p)}}))}function a(e,r){var i=b(e);if(i){b(t.startCall)||n("Missing (");var o=r(i);return b(t.endCall)||n("Missing )"),o}}function s(){return v("directional",t.sideOrCorner,1)||v("angular",t.angleValue,1)}function c(){var n,r,i=l();return i&&((n=[]).push(i),r=e,b(t.comma)&&((i=l())?n.push(i):e=r)),n}function l(){var t=function(){var t=v("shape",/^(circle)/i,0);t&&(t.style=y()||u());return t}()||function(){var t=v("shape",/^(ellipse)/i,0);t&&(t.style=m()||u());return t}();if(t)t.at=f();else{var e=u();if(e){t=e;var n=f();n&&(t.at=n)}else{var r=h();r&&(t={type:"default-radial",at:r})}}return t}function u(){return v("extent-keyword",t.extentKeywords,1)}function f(){if(v("position",/^at/,0)){var t=h();return t||n("Missing positioning value"),t}}function h(){var t={x:m(),y:m()};if(t.x||t.y)return{type:"position",value:t}}function d(e){var r=e(),i=[];if(r)for(i.push(r);b(t.comma);)(r=e())?i.push(r):n("One extra comma");return i}function p(){var e=v("hex",t.hexColor,1)||a(t.rgbaColor,(function(){return{type:"rgba",value:d(g)}}))||a(t.rgbColor,(function(){return{type:"rgb",value:d(g)}}))||v("literal",t.literalColor,0);return e||n("Expected color definition"),e.length=m(),e}function g(){return b(t.number)[1]}function m(){return v("%",t.percentageValue,1)||v("position-keyword",t.positionKeywords,1)||y()}function y(){return v("px",t.pixelValue,1)||v("em",t.emValue,1)}function v(t,e,n){var r=b(e);if(r)return{type:t,value:r[n]}}function b(t){var n=/^[\n\r\t\s]+/.exec(e);n&&x(n[0].length);var r=t.exec(e);return r&&x(r[0].length),r}function x(t){e=e.substring(t)}return function(t){return e=t,r()}}();var kf=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Sf=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Af=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,_f=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var Tf={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},Pf=Gu((function(t){var e;return e="angular"===t.type?Number(t.value):Tf[t.value]||0,xf(e,"deg")})),Cf=Gu((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:xf(e,r),cy:xf(n,i)}})),Nf=Gu((function(t){var e;if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return Ef(t).map((function(t){var e=t.type,n=t.orientation,r=t.colorStops;!function(t){var e,n,r,i=t.length;t[i-1].length=null!==(e=t[i-1].length)&&void 0!==e?e:{type:"%",value:"100"},i>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var o=0,a=Number(t[0].length.value),s=1;s<i;s++){var c=null===(r=t[s].length)||void 0===r?void 0:r.value;if(!y(c)&&!y(a)){for(var l=1;l<s-o;l++)t[o+l].length={type:"%",value:"".concat(a+(Number(c)-a)*l/(s-o))};o=s,a=Number(c)}}}(r);var i=r.map((function(t){return{offset:xf(Number(t.length.value),"%"),color:Of(t)}}));if("linear-gradient"===e)return new Ku(Hu.LinearGradient,{angle:n?Pf(n):uf,steps:i});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var o=Cf(n[0].at),a=o.cx,s=o.cy,c=void 0;if(n[0].style){var l=n[0].style,u=l.type,f=l.value;c="extent-keyword"===u?mf(f):xf(f,u)}return new Ku(Hu.RadialGradient,{cx:a,cy:s,size:c,steps:i})}}));var n=t[0];if("("===t[1]||"("===t[2])if("l"===n){var r=kf.exec(t);if(r){var i=(null===(e=r[2].match(_f))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return[new Ku(Hu.LinearGradient,{angle:xf(parseFloat(r[1]),"deg"),steps:i.map((function(t){var e=Ae(t,2),n=e[0],r=e[1];return{offset:xf(100*Number(n),"%"),color:r}}))})]}}else if("r"===n){var o=function(t){var e,n=Sf.exec(t);if(n){var r=(null===(e=n[4].match(_f))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return{cx:xf(50,"%"),cy:xf(50,"%"),steps:r.map((function(t){var e=Ae(t,2),n=e[0],r=e[1];return{offset:xf(100*Number(n),"%"),color:r}}))}}return null}(t);if(o){if(!P(o))return[new Ku(Hu.RadialGradient,o)];t=o}}else if("p"===n)return function(t){var e=Af.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 Lf(t){return t&&!!t.image}function jf(t){return t&&!y(t.r)&&!y(t.g)&&!y(t.b)}var Rf=Gu((function(t){if(Lf(t))return we({repetition:"repeat"},t);if(y(t)&&(t=""),"transparent"===t)return vf;"currentColor"===t&&(t="black");var e=Nf(t);if(e)return e;var n=Ol(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),bf.apply(void 0,_e([],Ae(r),!1))}));function If(t,e){if(jf(t)&&jf(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(N(e[n],0,255));return e[3]=N(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function Bf(t,e){if(y(e))return xf(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return xf(Number(e),"px");if("deg".search(t)>=0)return xf(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U"+t}));var r="U("+t.source+")";return n.map((function(t){return xf(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)}))[0]}var Df=function(t){return Bf(new RegExp("px","g"),t)},Ff=Gu(Df);Gu((function(t){return Bf(new RegExp("%","g"),t)}));var zf=function(t){return L(t)||isFinite(Number(t))?xf(Number(t)||0,"px"):Bf(new RegExp("px|%|em|rem","g"),t)},Gf=Gu(zf),Wf=function(t){return Bf(new RegExp("deg|rad|grad|turn","g"),t)},$f=Gu(Wf);function Hf(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0,c=of(t.unit),l=t.convertTo(c),u=e.convertTo(c);return l&&u?(a=l.value,s=u.value,o=Uu(t.unit)):(af.isLength(t.unit)||af.isLength(e.unit))&&(a=qf(t,i,n),s=qf(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function Vf(t){var e=0;return t.unit===Lu.kDegrees?e=t.value:t.unit===Lu.kRadians?e=hu(Number(t.value)):t.unit===Lu.kTurns&&(e=360*Number(t.value)),e}function Yf(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):P(t)?n=t.split(" ").map((function(t){return Number(t)})):L(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:1===n.length?[n[0],n[0],n[0],n[0]]:2===n.length?[n[0],n[1],n[0],n[1]]:3===n.length?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]}function Uf(t){return P(t)?t.split(" ").map((function(t){return Gf(t)})):t.map((function(t){return Gf(t.toString())}))}function qf(t,e,n,r){if(void 0===r&&(r=!1),t.unit===Lu.kPixels)return Number(t.value);if(t.unit===Lu.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 Xf=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Kf(t){if(void 0===t&&(t=""),"none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,Xf.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return Bf(/deg|rad|grad|turn|px|%/g,t)||Rf(t)}))}),n.lastIndex===t.length)return r}return[]}function Zf(t){return t.toString()}var Qf=function(t){return"number"==typeof t?xf(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?xf(Number(t)):xf(0)},Jf=Gu(Qf);function th(t,e){return[t,e,Zf]}function eh(t,e){return function(n,r){return[n,r,function(n){return Zf(N(n,t,e))}]}}function nh(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function rh(t){var e;return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=ln(t.parsedStyle.d.absolutePath,void 0,we(we({},e),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function ih(t,e){return t[0]===e[0]&&t[1]===e[1]}function oh(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)||R(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 ah(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Gu((function(t){return P(t)?t.split(" ").map(Jf):t.map(Jf)}));var sh=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)},ch=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n);var c=fu(r=D(r,360));if(t.x===a.x&&t.y===a.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var l=(t.x-a.x)/2,u=(t.y-a.y)/2,f={x:Math.cos(c)*l+Math.sin(c)*u,y:-Math.sin(c)*l+Math.cos(c)*u},h=Math.pow(f.x,2)/Math.pow(e,2)+Math.pow(f.y,2)/Math.pow(n,2);h>1&&(e=Math.sqrt(h)*e,n=Math.sqrt(h)*n);var d=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(f.y,2)-Math.pow(n,2)*Math.pow(f.x,2))/(Math.pow(e,2)*Math.pow(f.y,2)+Math.pow(n,2)*Math.pow(f.x,2));d=d<0?0:d;var p=(i!==o?1:-1)*Math.sqrt(d),g=p*(e*f.y/n),m=p*(-n*f.x/e),y={x:Math.cos(c)*g-Math.sin(c)*m+(t.x+a.x)/2,y:Math.sin(c)*g+Math.cos(c)*m+(t.y+a.y)/2},v={x:(f.x-g)/e,y:(f.y-m)/n},b=sh({x:1,y:0},v),x=sh(v,{x:(-f.x-g)/e,y:(-f.y-m)/n});!o&&x>0?x-=2*Math.PI:o&&x<0&&(x+=2*Math.PI);var w=b+(x%=2*Math.PI)*s,M=e*Math.cos(w),O=n*Math.sin(w);return{x:Math.cos(c)*M-Math.sin(c)*O+y.x,y:Math.sin(c)*M+Math.cos(c)*O+y.y,ellipticalArcStartAngle:b,ellipticalArcEndAngle:b+x,ellipticalArcAngle:w,ellipticalArcCenter:y,resultantRx:e,resultantRy:n}};function lh(t,e,n){void 0===n&&(n=!0);var r=t.arcParams,i=r.rx,o=void 0===i?0:i,a=r.ry,s=void 0===a?0:a,c=r.xRotation,l=r.arcFlag,u=r.sweepFlag,f=ch({x:t.prePoint[0],y:t.prePoint[1]},o,s,c,!!l,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},e),h=ch({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 uh(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function fh(t,e){return uh(t)*uh(e)?(t[0]*e[0]+t[1]*e[1])/(uh(t)*uh(e)):1}function hh(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(fh(t,e))}function dh(t,e){var n=e[1],r=e[2],i=D(fu(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 m=r?g*n*h/r:0,y=n?g*-r*f/n:0,v=(s+l)/2+Math.cos(i)*m-Math.sin(i)*y,b=(c+u)/2+Math.sin(i)*m+Math.cos(i)*y,x=[(f-m)/n,(h-y)/r],w=[(-1*f-m)/n,(-1*h-y)/r],M=hh([1,0],x),O=hh(x,w);return fh(x,w)<=-1&&(O=Math.PI),fh(x,w)>=1&&(O=0),0===a&&O>0&&(O-=2*Math.PI),1===a&&O<0&&(O+=2*Math.PI),{cx:v,cy:b,rx:ih(t,[l,u])?0:n,ry:ih(t,[l,u])?0:r,startAngle:M,endAngle:M+O,xRotation:i,arcFlag:o,sweepFlag:a}}function ph(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 gh(t,e){void 0===e&&(e=t.getLocalTransform());var 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,m=f.cy;n=ph(d,d,g,void 0===m?0:m);break;case tu.ELLIPSE:var y=t.parsedStyle,v=y.rx,b=void 0===v?0:v,x=y.ry,w=void 0===x?0:x,M=y.cx,O=(g=void 0===M?0:M,y.cy);n=ph(b,w,g,void 0===O?0:O);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 E=t.parsedStyle,k=E.width,S=void 0===k?0:k,A=E.height,_=void 0===A?0:A,T=E.x,P=void 0===T?0:T,C=E.y,L=void 0===C?0:C,j=E.radius,R=j&&j.some((function(t){return 0!==t}));n=function(t,e,n,r,i){if(i){var o=Ae(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,_,P,L,R&&j.map((function(t){return N(t,0,Math.min(Math.abs(S)/2,Math.abs(_)/2))})));break;case tu.PATH:n=_e([],Ae(t.parsedStyle.d.absolutePath),!1)}if(n.length)return function(t,e,n){return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=Ut(e[1],e[2],0);n&&re(i,i,n),r="".concat(e[0]).concat(i[0],",").concat(i[1])}else if("Z"===e[0])r=e[0];else if("C"===e[0]){var o=Ut(e[1],e[2],0),a=Ut(e[3],e[4],0),s=Ut(e[5],e[6],0);n&&(re(o,o,n),re(a,a,n),re(s,s,n)),r="".concat(e[0]).concat(o[0],",").concat(o[1],",").concat(a[0],",").concat(a[1],",").concat(s[0],",").concat(s[1])}else if("A"===e[0]){var c=Ut(e[6],e[7],0);n&&re(c,c,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(c[0],",").concat(c[1])}else"Q"===e[0]&&(o=Ut(e[1],e[2],0),a=Ut(e[3],e[4],0),n&&(re(o,o,n),re(a,a,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}"));return t+r}),"")}(n,0,e)}var mh=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=Ye(t)}catch(n){e=Ye(""),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&&ih(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=dh(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]&&ih(n,e[o].currentPoint)&&(e[o].prePoint=u.prePoint);var d=r?[r[r.length-2],r[r.length-1]]:null;u.nextPoint=d;var p=u.prePoint;if(["L","H","V"].includes(l))u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]];else if("Q"===l){var g=[c[1],c[2]];u.startTangent=[p[0]-g[0],p[1]-g[1]],u.endTangent=[n[0]-g[0],n[1]-g[1]]}else if("T"===l)g=ah((v=e[s-1]).currentPoint,p),"Q"===v.command?(u.command="Q",u.startTangent=[p[0]-g[0],p[1]-g[1]],u.endTangent=[n[0]-g[0],n[1]-g[1]]):(u.command="TL",u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]]);else if("C"===l){var m=[c[1],c[2]],y=[c[3],c[4]];u.startTangent=[p[0]-m[0],p[1]-m[1]],u.endTangent=[n[0]-y[0],n[1]-y[1]],0===u.startTangent[0]&&0===u.startTangent[1]&&(u.startTangent=[m[0]-y[0],m[1]-y[1]]),0===u.endTangent[0]&&0===u.endTangent[1]&&(u.endTangent=[y[0]-m[0],y[1]-m[1]])}else if("S"===l){var v;m=ah((v=e[s-1]).currentPoint,p),y=[c[1],c[2]],"C"===v.command?(u.command="C",u.startTangent=[p[0]-m[0],p[1]-m[1]],u.endTangent=[n[0]-y[0],n[1]-y[1]]):(u.command="SQ",u.startTangent=[p[0]-y[0],p[1]-y[1]],u.endTangent=[n[0]-y[0],n[1]-y[1]])}else if("A"===l){var b=lh(u,0),x=b.x,w=b.y,M=lh(u,1,!1),O=M.x,E=M.y;u.startTangent=[x,w],u.endTangent=[O,E]}e.push(u)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],o=0;o<t.length;o++){var a=(g=t[o]).currentPoint,s=g.params,c=g.prePoint,l=void 0;switch(g.command){case"Q":l=Zl(c[0],c[1],s[1],s[2],s[3],s[4]);break;case"C":l=Yl(c[0],c[1],s[1],s[2],s[3],s[4],s[5],s[6]);break;case"A":var u=g.arcParams;l=Dl(u.cx,u.cy,u.rx,u.ry,u.xRotation,u.startAngle,u.endAngle);break;default:n.push(a[0]),r.push(a[1])}l&&(g.box=l,n.push(l.x,l.x+l.width),r.push(l.y,l.y+l.height)),e&&("L"===g.command||"M"===g.command)&&g.prePoint&&g.nextPoint&&i.push(g)}n=n.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0})),r=r.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}));var f=_(n),h=_(r),d=A(n),p=A(r);if(0===i.length)return{x:f,y:h,width:d-f,height:p-h};for(o=0;o<i.length;o++){var g;(a=(g=i[o]).currentPoint)[0]===f?f-=oh(g,e).xExtra:a[0]===d&&(d+=oh(g,e).xExtra),a[1]===h?h-=oh(g,e).yExtra:a[1]===p&&(p+=oh(g,e).yExtra)}return{x:f,y:h,width:d-f,height:p-h}}(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}}},yh=Gu(mh);function vh(t){return P(t)?yh(t):mh(t)}function bh(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=Qe(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=Qe(e.absolutePath,!1),e.curve=i);var o=[r,i];r.length!==i.length&&(o=hn(r,i));var a,s,c,l,u,f,h,d,p=un(o[0])!==un(o[1])?(a=o[0],s=a.slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):a[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map((function(t){return["C"].concat(t.slice(2))})))):function(t){return t.map((function(t){return Array.isArray(t)?[].concat(t):t}))}(o[0]);return[p,(c=o[1],l=p,u=c.length-1,f=[],h=0,d=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,o){var a,s=i+o;return 0===o||t[s]&&"M"===t[s][0]?(a=t[s],["M"].concat(a.slice(-2))):(s>=e&&(s-=n),t[s])}))}))}(c),d.forEach((function(t,e){c.slice(1).forEach((function(t,n){h+=Je(c[(e+n)%u].slice(-2),l[n%u].slice(-2))})),f[e]=h,h=0})),d[f.indexOf(Math.min.apply(null,f))]),function(t){return t}]}function xh(t,e){var n;n=P(t)?t.split(" ").map((function(t){var e=Ae(t.split(","),2),n=e[0],r=e[1];return[Number(n),Number(r)]})):t;var r,i,o=[],a=0,s=ql(n);return n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=Gl(t[0],t[1],n[e+1][0],n[e+1][1]),a+=i,r[1]=a/s,o.push(r))})),{points:n,totalLength:s,segments:o}}function wh(t,e){return[t.points,e.points,function(t){return t}]}var Mh=null;function Oh(t){return function(e){var n=0;return t.map((function(t){return t===Mh?e[n++]:t}))}}function Eh(t){return t}var kh={matrix:["NNNNNN",[Mh,Mh,0,0,Mh,Mh,0,0,0,0,1,0,Mh,Mh,0,1],Eh],matrix3d:["NNNNNNNNNNNNNNNN",Eh],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Oh([Mh,Mh,new af(1)]),Eh],scalex:["N",Oh([Mh,new af(1),new af(1)]),Oh([Mh,new af(1)])],scaley:["N",Oh([new af(1),Mh,new af(1)]),Oh([new af(1),Mh])],scalez:["N",Oh([new af(1),new af(1),Mh])],scale3d:["NNN",Eh],skew:["Aa",null,Eh],skewx:["A",null,Oh([Mh,uf])],skewy:["A",null,Oh([uf,Mh])],translate:["Tt",Oh([Mh,Mh,sf]),Eh],translatex:["T",Oh([Mh,sf,sf]),Oh([Mh,sf])],translatey:["T",Oh([sf,Mh,sf]),Oh([sf,Mh])],translatez:["L",Oh([sf,sf,Mh])],translate3d:["TTL",Eh]};function Sh(t){if("none"===(t=(t||"none").toLowerCase().trim()))return[];for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var o=e[1],a=kh[o];if(!a)return[];var s=e[2].split(","),c=a[0];if(c.length<s.length)return[];for(var l=[],u=0;u<c.length;u++){var f=s[u],h=c[u],d=void 0;if(void 0===(d=f?{A:function(t){return"0"===t.trim()?uf:$f(t)},N:Jf,T:Gf,L:Ff}[h.toUpperCase()](f):{a:uf,n:l[0],t:sf}[h]))return[];l.push(d)}if(r.push({t:o,d:l}),n.lastIndex===t.length)return r}return[]}function Ah(t){if("none"===(t=(t||"none").toLowerCase().trim()))return[];for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var o=e[1],a=kh[o];if(!a)return[];var s=e[2].split(","),c=a[0];if(c.length<s.length)return[];for(var l=[],u=0;u<c.length;u++){var f=s[u],h=c[u],d=void 0;if(void 0===(d=f?{A:function(t){return"0"===t.trim()?uf:Wf(t)},N:Qf,T:zf,L:Df}[h.toUpperCase()](f):{a:uf,n:l[0],t:sf}[h]))return[];l.push(d)}if(r.push({t:o,d:l}),n.lastIndex===t.length)return r}return[]}function _h(t){var e,n,r,i;switch(t.t){case"rotatex":return i=fu(Vf(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=fu(Vf(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=fu(Vf(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=fu(Vf(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=fu(Vf(t.d[0])),f=fu(Vf(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=fu(Vf(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=fu(Vf(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=qf(t.d[0],0,null)||0,n=qf(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=qf(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=qf(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=qf(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=qf(t.d[0],0,null)||0,n=qf(t.d[1],0,null)||0,r=qf(t.d[2],0,null)||0,1];case"perspective":var h=qf(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 Th(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 Ph(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}(mu,t))return!1;if(ft(yu,mu),yu[3]=0,yu[7]=0,yu[11]=0,yu[15]=1,Math.abs(mt(yu))<1e-8)return!1;var a,s,c=mu[3],l=mu[7],u=mu[11],f=mu[12],h=mu[13],d=mu[14],p=mu[15];if(0!==c||0!==l||0!==u){if(vu[0]=c,vu[1]=l,vu[2]=u,vu[3]=p,!gt(yu,yu))return!1;pt(yu,yu),le(i,vu,yu)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=f,e[1]=h,e[2]=d,s=mu,(a=bu)[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]=Yt(bu[0]),Jt(bu[0],bu[0]),r[0]=te(bu[0],bu[1]),wu(bu[1],bu[1],bu[0],1,-r[0]),n[1]=Yt(bu[1]),Jt(bu[1],bu[1]),r[0]/=n[1],r[1]=te(bu[0],bu[2]),wu(bu[2],bu[2],bu[0],1,-r[1]),r[2]=te(bu[1],bu[2]),wu(bu[2],bu[2],bu[1],1,-r[2]),n[2]=Yt(bu[2]),Jt(bu[2],bu[2]),r[1]/=n[2],r[2]/=n[2],ee(xu,bu[1],bu[2]),te(bu[0],xu)<0)for(var g=0;g<3;g++)n[g]*=-1,bu[g][0]*=-1,bu[g][1]*=-1,bu[g][2]*=-1;o[0]=.5*Math.sqrt(Math.max(1+bu[0][0]-bu[1][1]-bu[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-bu[0][0]+bu[1][1]-bu[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-bu[0][0]-bu[1][1]+bu[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+bu[0][0]+bu[1][1]+bu[2][2],0)),bu[2][1]>bu[1][2]&&(o[0]=-o[0]),bu[0][2]>bu[2][0]&&(o[1]=-o[1]),bu[1][0]>bu[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(_h).reduce(Th)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var Ch=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;r<4;r++)for(var i=0;i<4;i++)for(var o=0;o<4;o++)n[r][i]+=e[r][o]*t[o][i];return n}return function(e,n,r,i,o){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;s<4;s++)a[s][3]=o[s];for(s=0;s<3;s++)for(var c=0;c<3;c++)a[3][s]+=e[c]*a[c][s];var l=i[0],u=i[1],f=i[2],h=i[3],d=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];d[0][0]=1-2*(u*u+f*f),d[0][1]=2*(l*u-f*h),d[0][2]=2*(l*f+u*h),d[1][0]=2*(l*u+f*h),d[1][1]=1-2*(l*l+f*f),d[1][2]=2*(u*f-l*h),d[2][0]=2*(l*f-u*h),d[2][1]=2*(u*f+l*h),d[2][2]=1-2*(l*l+u*u),a=t(a,d);var p,g=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];for(r[2]&&(g[2][1]=r[2],a=t(a,g)),r[1]&&(g[2][1]=0,g[2][0]=r[0],a=t(a,g)),r[0]&&(g[2][0]=0,g[1][0]=r[0],a=t(a,g)),s=0;s<3;s++)for(c=0;c<3;c++)a[s][c]*=n[s];return 0==(p=a)[0][2]&&0==p[0][3]&&0==p[1][2]&&0==p[1][3]&&0==p[2][0]&&0==p[2][1]&&1==p[2][2]&&0==p[2][3]&&0==p[3][2]&&1==p[3][3]?[a[0][0],a[0][1],a[1][0],a[1][1],a[3][0],a[3][1]]:a[0].concat(a[1],a[2],a[3])}}();function Nh(t){return t.toFixed(6).replace(".000000","")}function Lh(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=Ph(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=Ph(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=N(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 Ch(t[0],t[1],t[2],e,t[4]).map(Nh).join(",")}])}function jh(t){return t.replace(/[xy]/,"")}function Rh(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function Ih(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(n){var r=t[n],i=r.t,o=r.d,a="scale"===i.substring(0,5)?1:0;e.push({t:i,d:o.map((function(t){return"number"==typeof t?xf(a):xf(a,t.unit)}))})},o=0;o<t.length;o++)i(o)}var a,s,c=[],l=[],u=[];if(t.length!==e.length)c=[(v=Lh(t,e))[0]],l=[v[1]],u=[["matrix",[v[2]]]];else for(o=0;o<t.length;o++){var f=t[o].t,h=e[o].t,d=t[o].d,p=e[o].d,g=kh[f],m=kh[h],y=void 0;if(s=h,"perspective"===(a=f)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var v=Lh([t[o]],[e[o]]);c.push(v[0]),l.push(v[1]),u.push(["matrix",[v[2]]])}else{if(f===h)y=f;else if(g[2]&&m[2]&&jh(f)===jh(h))y=jh(f),d=g[2](d),p=m[2](p);else{if(!g[1]||!m[1]||Rh(f)!==Rh(h)){c=[(v=Lh(t,e))[0]],l=[v[1]],u=[["matrix",[v[2]]]];break}y=Rh(f),d=g[1](d),p=m[1](p)}for(var b=[],x=[],w=[],M=0;M<d.length;M++){v=Hf(d[M],p[M],n,!1,M);b[M]=v[0],x[M]=v[1],w.push(v[2])}c.push(b),l.push(x),u.push([y,w])}}if(r){var O=c;c=l,l=O}return[c,l,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return u[e][1][n](t)})).join(",");return"matrix"===u[e][0]&&16===n.split(",").length&&(u[e][0]="matrix3d"),"matrix3d"===u[e][0]&&6===n.split(",").length&&(u[e][0]="matrix"),u[e][0]+"("+n+")"})).join(" ")}]}var Bh=Gu((function(t){if(P(t)){if("text-anchor"===t)return[xf(0,"px"),xf(0,"px")];var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[Gf(Fh(e[0])),Gf(Fh(e[1]))]}return[xf(t[0]||0,"px"),xf(t[1]||0,"px")]})),Dh=function(t){if(P(t)){if("text-anchor"===t)return[xf(0,"px"),xf(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:[zf(Fh(e[0])),zf(Fh(e[1]))]}return[xf(t[0]||0,"px"),xf(t[1]||0,"px")]};function Fh(t){return"center"===t?"50%":"left"===t||"top"===t?"0%":"right"===t||"bottom"===t?"100%":t}var zh=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:wf.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:wf.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:wf.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:wf.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:wf.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:wf.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:wf.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:wf.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:wf.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:wf.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:wf.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:wf.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:wf.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:wf.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:wf.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:wf.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:wf.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:wf.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:wf.FILTER},{n:"clipPath",syntax:wf.DEFINED_PATH},{n:"textPath",syntax:wf.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:wf.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:wf.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:wf.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:wf.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:wf.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:wf.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:wf.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:wf.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:wf.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:wf.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:wf.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:wf.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:wf.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:wf.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:wf.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:wf.COORDINATE},{n:"y1",int:!0,l:!0,syntax:wf.COORDINATE},{n:"z1",int:!0,l:!0,syntax:wf.COORDINATE},{n:"x2",int:!0,l:!0,syntax:wf.COORDINATE},{n:"y2",int:!0,l:!0,syntax:wf.COORDINATE},{n:"z2",int:!0,l:!0,syntax:wf.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:wf.PATH,p:50},{n:"points",int:!0,l:!0,syntax:wf.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:wf.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:wf.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:wf.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:wf.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:wf.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:wf.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:wf.MARKER},{n:"markerEnd",syntax:wf.MARKER},{n:"markerMid",syntax:wf.MARKER},{n:"markerStartOffset",syntax:wf.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:wf.LENGTH,l:!0,int:!0,d:"0"}],Gh=zh.filter((function(t){return!!t.l})).map((function(t){return t.n})),Wh={},$h=new WeakMap,Hh=function(){function t(t){var e=this;this.runtime=t,zh.forEach((function(t){e.registerMetadata(t)}))}return t.prototype.registerMetadata=function(t){_e([t.n],Ae(t.a||[]),!1).forEach((function(e){Wh[e]=t}))},t.prototype.unregisterMetadata=function(t){delete Wh[t]},t.prototype.getPropertySyntax=function(t){return this.runtime.CSSPropertySyntaxFactory[t]},t.prototype.processProperties=function(t,e,n){var r=this;if(void 0===n&&(n={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0}),this.runtime.enableCSSParsing){var i=n.skipUpdateAttribute,o=n.skipParse,a=n.forceUpdateGeometry,s=n.usedAttributes,c=n.memoize,l=a,u=Object.keys(e);u.forEach((function(n){var r;i||(t.attributes[n]=e[n]),!l&&(null===(r=Wh[n])||void 0===r?void 0:r.l)&&(l=!0)})),o||u.forEach((function(e){t.computedStyle[e]=r.parseProperty(e,t.attributes[e],t,c)})),(null==s?void 0:s.length)&&(u=Array.from(new Set(u.concat(s)))),u.forEach((function(e){e in t.computedStyle&&(t.parsedStyle[e]=r.computeProperty(e,t.computedStyle[e],t,c))})),l&&(t.geometry.dirty=!0,t.renderable.boundsDirty=!0,t.renderable.renderBoundsDirty=!0,n.forceUpdateGeometry||this.runtime.sceneGraphService.dirtifyToRoot(t)),u.forEach((function(e){e in t.parsedStyle&&r.postProcessProperty(e,t,u)})),this.runtime.enableCSSParsing&&t.children.length&&u.forEach((function(e){e in t.parsedStyle&&r.isPropertyInheritable(e)&&t.children.forEach((function(t){t.internalSetAttribute(e,null,{skipUpdateAttribute:!0,skipParse:!0})}))}))}else{Object.assign(t.attributes,e);var f=Object.keys(e),h=t.parsedStyle.clipPath,d=t.parsedStyle.offsetPath;t.parsedStyle=Object.assign(t.parsedStyle,e);var p=!!n.forceUpdateGeometry;if(!p)for(var g=0;g<Gh.length;g++)if(Gh[g]in e){p=!0;break}e.fill&&(t.parsedStyle.fill=Rf(e.fill)),e.stroke&&(t.parsedStyle.stroke=Rf(e.stroke)),e.shadowColor&&(t.parsedStyle.shadowColor=Rf(e.shadowColor)),e.filter&&(t.parsedStyle.filter=Kf(e.filter)),y(e.radius)||(t.parsedStyle.radius=Yf(e.radius,4)),y(e.lineDash)||(t.parsedStyle.lineDash=Yf(e.lineDash,2)),e.points&&(t.parsedStyle.points=xh(e.points)),""===e.d&&(t.parsedStyle.d=we({},Mf)),e.d&&(t.parsedStyle.d=vh(e.d)),e.textTransform&&this.runtime.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:e.textTransform},t,null),e.clipPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",h,e.clipPath,t,this.runtime),e.offsetPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",d,e.offsetPath,t,this.runtime),e.transform&&(t.parsedStyle.transform=Sh(e.transform)),e.transformOrigin&&(t.parsedStyle.transformOrigin=Bh(e.transformOrigin)),e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerStart,e.markerStart,null,null)),e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerEnd,e.markerEnd,null,null)),e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator("",e.markerMid,e.markerMid,null,null)),y(e.zIndex)||this.runtime.CSSPropertySyntaxFactory["<z-index>"].postProcessor(t,f),y(e.offsetDistance)||this.runtime.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(t,f),e.transform&&this.runtime.CSSPropertySyntaxFactory["<transform>"].postProcessor(t,f),e.transformOrigin&&this.runtime.CSSPropertySyntaxFactory["<transform-origin>"].postProcessor(t,f),p&&(t.geometry.dirty=!0,t.renderable.boundsDirty=!0,t.renderable.renderBoundsDirty=!0,n.forceUpdateGeometry||this.runtime.sceneGraphService.dirtifyToRoot(t))}},t.prototype.parseProperty=function(t,e,n,r){var i=Wh[t],o=e;if((""===e||y(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)o=mf(e);else if(i){var a=i.k,s=i.syntax,c=s&&this.getPropertySyntax(s);a&&a.indexOf(e)>-1?o=mf(e):c&&(!r&&c.parserUnmemoize?o=c.parserUnmemoize(e,n):c.parser&&(o=c.parser(e,n)))}return o},t.prototype.computeProperty=function(t,e,n,r){var i=Wh[t],o="g-root"===n.id,a=e;if(i){var s=i.syntax,c=i.inh,l=i.d;if(e instanceof Zu){var u=e.value;if("unset"===u&&(u=c&&!o?"inherit":"initial"),"initial"===u)y(l)||(e=this.parseProperty(t,tf(l)?l(n.nodeName):l,n,r));else if("inherit"===u){var f=this.tryToResolveProperty(n,t,{inherited:!0});return y(f)?void this.addUnresolveProperty(n,t):f}}var h=s&&this.getPropertySyntax(s);if(h&&h.calculator){var d=n.parsedStyle[t];a=h.calculator(t,d,e,n,this.runtime)}else a=e instanceof Zu?e.value:e}return a},t.prototype.postProcessProperty=function(t,e,n){var r=Wh[t];if(r&&r.syntax){var i=r.syntax&&this.getPropertySyntax(r.syntax);i&&i.postProcessor&&i.postProcessor(e,n)}},t.prototype.addUnresolveProperty=function(t,e){var n=$h.get(t);n||($h.set(t,[]),n=$h.get(t)),-1===n.indexOf(e)&&n.push(e)},t.prototype.tryToResolveProperty=function(t,e,n){if(void 0===n&&(n={}),n.inherited&&t.parentElement&&function(t,e){var n=$h.get(t);return!n||0===n.length||n.includes(e)}(t.parentElement,e)){var r=t.parentElement.parsedStyle[e];if("unset"===r||"initial"===r||"inherit"===r)return;return r}},t.prototype.recalc=function(t){var e=$h.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),$h.delete(t)}},t.prototype.updateGeometry=function(t){var e=t.nodeName,n=this.runtime.geometryUpdaterFactory[e];if(n){var r=t.geometry;r.contentBounds||(r.contentBounds=new Ou),r.renderBounds||(r.renderBounds=new Ou);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,m=o.hdepth,y=void 0===m?0:m,v=[Math.abs(d),Math.abs(g),y],b=i,x=b.stroke,w=b.lineWidth,M=void 0===w?1:w,O=b.increasedLineWidthForHitTesting,E=void 0===O?0:O,k=b.shadowType,S=b.shadowColor,A=b.filter,_=void 0===A?[]:A,T=b.transformOrigin,P=[s,l,f];r.contentBounds.update(P,v);var C=e===tu.POLYLINE||e===tu.POLYGON||e===tu.PATH?Math.SQRT2:.5;if(x&&!x.isNone){var N=((M||0)+(E||0))*C;v[0]+=N,v[1]+=N}if(r.renderBounds.update(P,v),S&&k&&"inner"!==k){var L=r.renderBounds,j=L.min,R=L.max,I=i,B=I.shadowBlur||0,D=I.shadowOffsetX||0,F=I.shadowOffsetY||0,z=j[0]-B+D,G=R[0]+B+D,W=j[1]-B+F,$=R[1]+B+F;j[0]=Math.min(j[0],z),R[0]=Math.max(R[0],G),j[1]=Math.min(j[1],W),R[1]=Math.max(R[1],$),r.renderBounds.setMinMax(j,R)}_.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,su(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 H=g<0,V=(d<0?-1:1)*(T?qf(T[0],0,t,!0):0),Y=(H?-1:1)*(T?qf(T[1],1,t,!0):0);(V||Y)&&t.setOrigin(V,Y)}},t.prototype.isPropertyInheritable=function(t){var e=Wh[t];return!!e&&e.inh},t}(),Vh=function(){function t(){this.parser=$f,this.parserUnmemoize=Wf,this.parserWithCSSDisabled=null,this.mixer=th}return t.prototype.calculator=function(t,e,n,r){return Vf(n)},t}(),Yh=function(){function t(){}return t.prototype.calculator=function(t,e,n,r,i){return n instanceof Zu&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)})),n},t}(),Uh=function(){function t(){this.parser=Rf,this.parserWithCSSDisabled=Rf,this.mixer=If}return t.prototype.calculator=function(t,e,n,r){return n instanceof Zu?"none"===n.value?yf:vf:n},t}(),qh=function(){function t(){this.parser=Kf}return t.prototype.calculator=function(t,e,n){return n instanceof Zu?[]:n},t}();function Xh(t){var e=t.parsedStyle.fontSize;return y(e)?null:e}var Kh=function(){function t(){this.parser=Gf,this.parserUnmemoize=zf,this.parserWithCSSDisabled=null,this.mixer=th}return t.prototype.calculator=function(t,e,n,r,i){var o;if(L(n))return n;if(!af.isRelativeUnit(n.unit))return n.value;var a=i.styleValueRegistry;if(n.unit===Lu.kPercentage)return 0;if(n.unit===Lu.kEms){if(r.parentNode){if(s=Xh(r.parentNode))return s*=n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}if(n.unit===Lu.kRems){if(null===(o=null==r?void 0:r.ownerDocument)||void 0===o?void 0:o.documentElement){var s;if(s=Xh(r.ownerDocument.documentElement))return s*=n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}},t}(),Zh=function(){function t(){this.mixer=nh}return t.prototype.parser=function(t){var e=Uf(L(t)?[t]:t);return 1===e.length?[e[0],e[0]]:[e[0],e[1]]},t.prototype.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),Qh=function(){function t(){this.mixer=nh}return t.prototype.parser=function(t){var e=Uf(L(t)?[t]:t);return 1===e.length?[e[0],e[0],e[0],e[0]]:2===e.length?[e[0],e[1],e[0],e[1]]:3===e.length?[e[0],e[1],e[2],e[1]]:[e[0],e[1],e[2],e[3]]},t.prototype.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),Jh=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){n instanceof Zu&&(n=null);var i=null==n?void 0:n.cloneNode(!0);return i&&(i.style.isMarker=!0),i},t}(),td=function(){function t(){this.mixer=th,this.parser=Jf,this.parserUnmemoize=Qf,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(t,e,n){return n.value},t}(),ed=function(){function t(){this.parser=Jf,this.parserUnmemoize=Qf,this.parserWithCSSDisabled=null,this.mixer=eh(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t.prototype.postProcessor=function(t){var e=t.parsedStyle,n=e.offsetPath,r=e.offsetDistance;if(n){var i=n.nodeName;if(i===tu.LINE||i===tu.PATH||i===tu.POLYLINE){var o=n.getPoint(r);o&&t.setLocalPosition(o.x,o.y)}}},t}(),nd=function(){function t(){this.parser=Jf,this.parserUnmemoize=Qf,this.parserWithCSSDisabled=null,this.mixer=eh(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),rd=function(){function t(){this.parser=vh,this.parserWithCSSDisabled=vh,this.mixer=bh}return t.prototype.calculator=function(t,e,n){return n instanceof Zu&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Pu(0,0,0,0)}:n},t}(),id=function(){this.parser=xh,this.mixer=wh},od=function(t){function e(){var e=t.apply(this,_e([],Ae(arguments),!1))||this;return e.mixer=eh(0,1/0),e}return xe(e,t),e}(Kh),ad=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof Zu?"unset"===n.value?"":n.value:"".concat(n)},t.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""},t}(),sd=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i=r.getAttribute("text");if(i){var o=i;"capitalize"===n.value?o=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?o=i.toLowerCase():"uppercase"===n.value&&(o=i.toUpperCase()),r.parsedStyle.text=o}return n.value},t}(),cd={},ld=0;var ud="undefined"!=typeof window&&void 0!==window.document;function fd(t){return!!t.getAttribute}function hd(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 dd(t){var e,n=t;do{if(null===(e=n.parsedStyle)||void 0===e?void 0:e.clipPath)return n;n=n.parentElement}while(null!==n);return null}function pd(t,e){if(ud)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var gd={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},md="object"==typeof performance&&performance.now?performance:Date;function yd(t,e,n){void 0===t&&(t="auto");var r=!1,i=!1,o=!!e&&!e.isNone,a=!!n&&!n.isNone;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=o,i=a):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]}var vd=1,bd="object"==typeof self&&self.self==self?self:"object"==typeof nl&&nl.global==nl?nl:{},xd=Date.now(),wd={},Md=Date.now(),Od=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-Md,r=n>16?0:16-n,i=vd++;return wd[i]=t,Object.keys(wd).length>1||setTimeout((function(){Md=e;var t=wd;wd={},Object.keys(t).forEach((function(e){return t[e](bd.performance&&"function"==typeof bd.performance.now?bd.performance.now():Date.now()-xd)}))}),r),i},Ed=function(t){delete wd[t]},kd=function(t){return"string"!=typeof t?Od:""===t?bd.requestAnimationFrame:bd[t+"RequestAnimationFrame"]},Sd=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)})),Ad=kd(Sd),_d=function(t){return"string"!=typeof t?Ed:""===t?bd.cancelAnimationFrame:bd[t+"CancelAnimationFrame"]||bd[t+"CancelRequestAnimationFrame"]}(Sd);bd.requestAnimationFrame=Ad,bd.cancelAnimationFrame=_d;var Td=function(){function t(){this.callbacks=[]}return t.prototype.getCallbacksNum=function(){return this.callbacks.length},t.prototype.tapPromise=function(t,e){this.callbacks.push(e)},t.prototype.promise=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Promise.all(this.callbacks.map((function(e){return e.apply(void 0,_e([],Ae(t),!1))})))},t}(),Pd=function(){function t(){this.callbacks=[]}return t.prototype.tapPromise=function(t,e){this.callbacks.push(e)},t.prototype.promise=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Ee(this,void 0,void 0,(function(){var e,n,r;return ke(this,(function(i){switch(i.label){case 0:return this.callbacks.length?[4,(r=this.callbacks)[0].apply(r,_e([],Ae(t),!1))]:[3,6];case 1:e=i.sent(),n=0,i.label=2;case 2:return n<this.callbacks.length-1?[4,(0,this.callbacks[n])(e)]:[3,5];case 3:e=i.sent(),i.label=4;case 4:return n++,[3,2];case 5:return[2,e];case 6:return[2,null]}}))}))},t}(),Cd=function(){function t(){this.callbacks=[]}return t.prototype.tap=function(t,e){this.callbacks.push(e)},t.prototype.call=function(){var t=arguments;this.callbacks.forEach((function(e){e.apply(void 0,t)}))},t}(),Nd=function(){function t(){this.callbacks=[]}return t.prototype.tap=function(t,e){this.callbacks.push(e)},t.prototype.call=function(){if(this.callbacks.length){for(var t=arguments,e=this.callbacks[0].apply(void 0,t),n=0;n<this.callbacks.length-1;n++){e=(0,this.callbacks[n])(e)}return e}return null},t}(),Ld=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],jd=/([\"\'])[^\'\"]+\1/;function Rd(t,e,n){return dt(t),t[4]=Math.tan(e),t[1]=Math.tan(n),t}var Id=1e-5,Bd=lt(),Dd=lt();function Fd(t,e){if(t.length){var n=dt(Bd);t.forEach((function(t){var e=t.t,r=t.d;if("scale"===e){var i=(null==r?void 0:r.map((function(t){return Math.max(t.value,Id)})))||[1,1];Ot(Dd,[i[0],i[1],1])}else if("scalex"===e){i=(null==r?void 0:r.map((function(t){return Math.max(t.value,Id)})))||[1];Ot(Dd,[i[0],1,1])}else if("scaley"===e){i=(null==r?void 0:r.map((function(t){return Math.max(t.value,Id)})))||[1];Ot(Dd,[1,i[0],1])}else if("scalez"===e){i=(null==r?void 0:r.map((function(t){return Math.max(t.value,Id)})))||[1];Ot(Dd,[1,1,i[0]])}else if("scale3d"===e){i=(null==r?void 0:r.map((function(t){return Math.max(t.value,Id)})))||[1,1,1];Ot(Dd,[i[0],i[1],i[2]])}else if("translate"===e){Mt(Dd,[(o=r||[sf,sf])[0].value,o[1].value,0])}else if("translatex"===e){Mt(Dd,[(o=r||[sf])[0].value,0,0])}else if("translatey"===e){Mt(Dd,[0,(o=r||[sf])[0].value,0])}else if("translatez"===e){Mt(Dd,[0,0,(o=r||[sf])[0].value])}else if("translate3d"===e){var o;Mt(Dd,[(o=r||[sf,sf,sf])[0].value,o[1].value,o[2].value])}else if("rotate"===e){At(Dd,fu(Vf((a=r||[uf])[0])))}else if("rotatex"===e){kt(Dd,fu(Vf((a=r||[uf])[0])))}else if("rotatey"===e){St(Dd,fu(Vf((a=r||[uf])[0])))}else if("rotatez"===e){At(Dd,fu(Vf((a=r||[uf])[0])))}else if("rotate3d"===e){var a;Et(Dd,fu(Vf((a=r||[sf,sf,sf,uf])[3])),[a[0].value,a[1].value,a[2].value])}else if("skew"===e){var s=(null==r?void 0:r.map((function(t){return t.value})))||[0,0];Rd(Dd,fu(s[0]),fu(s[1]))}else if("skewx"===e){s=(null==r?void 0:r.map((function(t){return t.value})))||[0];Rd(Dd,fu(s[0]),0)}else if("skewy"===e){s=(null==r?void 0:r.map((function(t){return t.value})))||[0];Rd(Dd,0,fu(s[0]))}else if("matrix"===e){var c=Ae(r.map((function(t){return t.value})),6),l=c[0],u=c[1],f=c[2],h=c[3],d=c[4],p=c[5];ht(Dd,l,u,0,0,f,h,0,0,0,0,1,0,d,p,0,1)}else"matrix3d"===e&&ht.apply($t,_e([Dd],Ae(r.map((function(t){return t.value}))),!1));Gt(n,n,Dd)})),e.setLocalTransform(n)}else e.resetLocalTransform();return e.getLocalTransform()}var zd=function(){function t(){this.parser=Sh,this.parserUnmemoize=Ah,this.parserWithCSSDisabled=Ah,this.mixer=Ih}return t.prototype.calculator=function(t,e,n,r){return n instanceof Zu?[]:n},t.prototype.postProcessor=function(t){Fd(t.parsedStyle.transform,t)},t}(),Gd=function(){function t(){this.parser=Bh,this.parserUnmemoize=Dh}return t.prototype.postProcessor=function(t){var e=t.parsedStyle.transformOrigin;e[0].unit===Lu.kPixels&&e[1].unit===Lu.kPixels?t.setOrigin(e[0].value,e[1].value):t.getGeometryBounds()},t}(),Wd=function(){function t(){this.parser=Jf,this.parserUnmemoize=Qf}return t.prototype.calculator=function(t,e,n,r){return n.value},t.prototype.postProcessor=function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,r=e.sortable;n&&(n.dirty=!0),r&&(r.dirty=!0,r.dirtyReason=lf.Z_INDEX_CHANGED)}},t}(),$d=function(){function t(){}return t.prototype.update=function(t,e){var n=t.cx,r=void 0===n?0:n,i=t.cy,o=void 0===i?0:i,a=t.r,s=void 0===a?0:a;return{cx:r,cy:o,hwidth:s,hheight:s}},t}(),Hd=function(){function t(){}return t.prototype.update=function(t,e){var n=t.cx,r=void 0===n?0:n,i=t.cy,o=void 0===i?0:i,a=t.rx,s=void 0===a?0:a,c=t.ry;return{cx:r,cy:o,hwidth:s,hheight:void 0===c?0:c}},t}(),Vd=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=Math.min(e,r),a=Math.max(e,r),s=Math.min(n,i),c=(a-o)/2,l=(Math.max(n,i)-s)/2;return{cx:o+c,cy:s+l,hwidth:c,hheight:l}},t}(),Yd=function(){function t(){}return t.prototype.update=function(t){var e=t.d.rect,n=e.x,r=e.y,i=e.width/2,o=e.height/2;return{cx:n+i,cy:r+o,hwidth:i,hheight:o}},t}(),Ud=function(){function t(){}return t.prototype.update=function(t){if(t.points&&x(t.points.points)){var e=t.points.points,n=Math.min.apply(Math,_e([],Ae(e.map((function(t){return t[0]}))),!1)),r=Math.max.apply(Math,_e([],Ae(e.map((function(t){return t[0]}))),!1)),i=Math.min.apply(Math,_e([],Ae(e.map((function(t){return t[1]}))),!1)),o=Math.max.apply(Math,_e([],Ae(e.map((function(t){return t[1]}))),!1)),a=(r-n)/2,s=(o-i)/2;return{cx:n+a,cy:i+s,hwidth:a,hheight:s}}return{cx:0,cy:0,hwidth:0,hheight:0}},t}(),qd=function(){function t(){}return t.prototype.update=function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,o=void 0===i?0:i,a=t.src,s=t.width,c=void 0===s?0:s,l=t.height,u=c,f=void 0===l?0:l;return a&&!P(a)&&(u||(u=a.width,t.width=u),f||(f=a.height,t.height=f)),{cx:r+u/2,cy:o+f/2,hwidth:u/2,hheight:f/2}},t}(),Xd=function(){function t(t){this.globalRuntime=t}return t.prototype.isReadyToMeasure=function(t,e){var n=t.text,r=t.textAlign,i=t.textBaseline,o=t.fontSize,a=t.fontStyle,s=t.fontWeight,c=t.fontVariant,l=t.lineWidth;return Op.enableCSSParsing?n&&o&&a&&s&&c&&r&&i&&!y(l):n},t.prototype.update=function(t,e){var n,r,i=t.text,o=t.textAlign,a=void 0===o?"start":o,s=t.lineWidth,c=void 0===s?1:s,l=t.textBaseline,u=void 0===l?"alphabetic":l,f=t.dx,h=void 0===f?0:f,d=t.dy,p=void 0===d?0:d,g=t.x,m=void 0===g?0:g,y=t.y,v=void 0===y?0:y;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var b=((null===(r=null===(n=null==e?void 0:e.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===r?void 0:r.getConfig())||{}).offscreenCanvas,x=this.globalRuntime.textService.measureText(i,t,b);t.metrics=x;var w=x.width,M=x.height,O=x.lineHeight,E=x.fontProperties,k=w/2,S=M/2,A=m+k;"center"===a||"middle"===a?A+=c/2-k:"right"!==a&&"end"!==a||(A+=c-2*k);var _=v-S;return"middle"===u?_+=S:"top"===u||"hanging"===u?_+=2*S:"alphabetic"===u?_+=this.globalRuntime.enableCSSParsing?O-E.ascent:0:"bottom"!==u&&"ideographic"!==u||(_+=0),h&&(A+=h),p&&(_+=p),{cx:A,cy:_,hwidth:k,hheight:S}},t}(),Kd=function(){function t(){}return t.prototype.update=function(t,e){return{cx:0,cy:0,hwidth:0,hheight:0}},t}();var Zd,Qd=function(){function t(e){this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Tu,this.page=new Tu,this.canvas=new Tu,this.viewport=new Tu,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}return Object.defineProperty(t.prototype,"name",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerX",{get:function(){return this.layer.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerY",{get:function(){return this.layer.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageX",{get:function(){return this.page.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageY",{get:function(){return this.page.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasX",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasY",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportX",{get:function(){return this.viewport.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportY",{get:function(){return this.viewport.y},enumerable:!1,configurable:!0}),t.prototype.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},Object.defineProperty(t.prototype,"propagationPath",{get:function(){return this.composedPath()},enumerable:!1,configurable:!0}),t.prototype.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},t.prototype.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t.prototype.initEvent=function(){},t.prototype.initUIEvent=function(){},t.prototype.clone=function(){throw new Error(Cu)},t}(),Jd=function(t){function e(){var e=t.apply(this,_e([],Ae(arguments),!1))||this;return e.client=new Tu,e.movement=new Tu,e.offset=new Tu,e.global=new Tu,e.screen=new Tu,e}return xe(e,t),Object.defineProperty(e.prototype,"clientX",{get:function(){return this.client.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clientY",{get:function(){return this.client.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementX",{get:function(){return this.movement.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementY",{get:function(){return this.movement.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetX",{get:function(){return this.offset.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetY",{get:function(){return this.offset.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalX",{get:function(){return this.global.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalY",{get:function(){return this.global.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenX",{get:function(){return this.screen.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenY",{get:function(){return this.screen.y},enumerable:!1,configurable:!0}),e.prototype.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},e.prototype.initMouseEvent=function(){throw new Error(Cu)},e}(Qd),tp=function(t){function e(){var e=t.apply(this,_e([],Ae(arguments),!1))||this;return e.width=0,e.height=0,e.isPrimary=!1,e}return xe(e,t),e.prototype.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},e.prototype.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},e.prototype.clone=function(){return this.manager.clonePointerEvent(this)},e}(Jd),ep=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return xe(e,t),e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(Jd),np=function(t){function e(e,n){var r=t.call(this,null)||this;return r.type=e,r.detail=n,Object.assign(r,n),r}return xe(e,t),e}(Qd),rp=function(){function t(){this.emitter=new il}return t.prototype.on=function(t,e,n){return this.addEventListener(t,e,n),this},t.prototype.addEventListener=function(t,e,n){var r=W(n)&&n||w(n)&&n.capture,i=w(n)&&n.once,o=tf(e)?void 0:e,a=!1,s="";if(t.indexOf(":")>-1){var c=Ae(t.split(":"),2),l=c[0];t=c[1],s=l,a=!0}if(t=r?"".concat(t,"capture"):t,e=tf(e)?e:e.handleEvent,a){var u=e;e=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];(null===(t=e[0].target)||void 0===t?void 0:t.name)===s&&u.apply(void 0,_e([],Ae(e),!1))}}return i?this.emitter.once(t,e,o):this.emitter.on(t,e,o),this},t.prototype.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},t.prototype.removeAllEventListeners=function(){this.emitter.removeAllListeners()},t.prototype.removeEventListener=function(t,e,n){var r=W(n)&&n||w(n)&&n.capture,i=tf(e)?void 0:e;return t=r?"".concat(t,"capture"):t,e=tf(e)?e:null==e?void 0:e.handleEvent,this.emitter.off(t,e,i),this},t.prototype.emit=function(t,e){this.dispatchEvent(new np(t,e))},t.prototype.dispatchEvent=function(t,e){var n,r,i;if(void 0===e&&(e=!1),!t.type)throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");if(i=this.document?this:this.defaultView?this.defaultView:null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView){if(t.manager=i.getEventService()||null,!t.manager)return!1;t.defaultPrevented=!1,t.path=[],e||(t.target=this),null===(r=t.manager)||void 0===r||r.dispatchEvent(t,t.type,e)}return!t.defaultPrevented},t}(),ip=function(t){function e(){var e=t.call(this)||this;return e.shadow=!1,e.ownerDocument=null,e.isConnected=!1,e.baseURI="",e.childNodes=[],e.nodeType=0,e.nodeName="",e.nodeValue=null,e.parentNode=null,e}return xe(e,t),e.isNode=function(t){return!!t.childNodes},Object.defineProperty(e.prototype,"textContent",{get:function(){var t,e,n="";this.nodeName===tu.TEXT&&(n+=this.style.text);try{for(var r=Se(this.childNodes),i=r.next();!i.done;i=r.next()){var o=i.value;o.nodeName===tu.TEXT?n+=o.nodeValue:n+=o.textContent}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},set:function(t){var e=this;this.childNodes.slice().forEach((function(t){e.removeChild(t)})),this.nodeName===tu.TEXT&&(this.style.text="".concat(t))},enumerable:!1,configurable:!0}),e.prototype.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},e.prototype.hasChildNodes=function(){return this.childNodes.length>0},e.prototype.isDefaultNamespace=function(t){throw new Error(Cu)},e.prototype.lookupNamespaceURI=function(t){throw new Error(Cu)},e.prototype.lookupPrefix=function(t){throw new Error(Cu)},e.prototype.normalize=function(){throw new Error(Cu)},e.prototype.isEqualNode=function(t){return this===t},e.prototype.isSameNode=function(t){return this.isEqualNode(t)},Object.defineProperty(e.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstChild",{get:function(){return this.childNodes.length>0?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastChild",{get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),e.prototype.compareDocumentPosition=function(t){var n;if(t===this)return 0;for(var r=t,i=this,o=[r],a=[i];null!==(n=r.parentNode)&&void 0!==n?n:i.parentNode;)r=r.parentNode?(o.push(r.parentNode),r.parentNode):r,i=i.parentNode?(a.push(i.parentNode),i.parentNode):i;if(r!==i)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var s=o.length>a.length?o:a,c=s===o?a:o;if(s[s.length-c.length]===c[0])return s===o?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var l=s.length-c.length,u=c.length-1;u>=0;u--){var f=c[u],h=s[l+u];if(h!==f){var d=f.parentNode.childNodes;return d.indexOf(f)<d.indexOf(h)?c===o?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:s===o?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING},e.prototype.contain=function(t){return this.contains(t)},e.prototype.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},e.prototype.getAncestor=function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e},e.prototype.forEach=function(t,e){void 0===e&&(e=!1),t(this)||(e?this.childNodes.slice():this.childNodes).forEach((function(e){e.forEach(t)}))},e.DOCUMENT_POSITION_DISCONNECTED=1,e.DOCUMENT_POSITION_PRECEDING=2,e.DOCUMENT_POSITION_FOLLOWING=4,e.DOCUMENT_POSITION_CONTAINS=8,e.DOCUMENT_POSITION_CONTAINED_BY=16,e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,e}(rp),op=function(){function t(t,e){var n=this;this.globalRuntime=t,this.context=e,this.emitter=new il,this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=lt(),this.tmpVec3=Ht(),this.onPointerDown=function(t){var e=n.createPointerEvent(t);if(n.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)n.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){var r=2===e.button;n.dispatchEvent(e,r?"rightdown":"mousedown")}n.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),n.freeEvent(e)},this.onPointerUp=function(t){var e,r=md.now(),i=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);if(n.dispatchEvent(i,"pointerup"),"touch"===i.pointerType)n.dispatchEvent(i,"touchend");else if("mouse"===i.pointerType||"pen"===i.pointerType){var o=2===i.button;n.dispatchEvent(i,o?"rightup":"mouseup")}var a=n.trackingData(t.pointerId),s=n.findMountedTarget(a.pressTargetsByButton[t.button]),c=s;if(s&&!i.composedPath().includes(s)){for(var l=s;l&&!i.composedPath().includes(l);){if(i.currentTarget=l,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType)n.notifyTarget(i,"touchendoutside");else if("mouse"===i.pointerType||"pen"===i.pointerType){o=2===i.button;n.notifyTarget(i,o?"rightupoutside":"mouseupoutside")}ip.isNode(l)&&(l=l.parentNode)}delete a.pressTargetsByButton[t.button],c=l}if(c){var u=n.clonePointerEvent(i,"click");u.target=c,u.path=[],a.clicksByButton[t.button]||(a.clicksByButton[t.button]={clickCount:0,target:u.target,timeStamp:r});var f=a.clicksByButton[t.button];f.target===u.target&&r-f.timeStamp<200?++f.clickCount:f.clickCount=1,f.target=u.target,f.timeStamp=r,u.detail=f.clickCount,(null===(e=i.detail)||void 0===e?void 0:e.preventClick)||(n.context.config.useNativeClickEvent||"mouse"!==u.pointerType&&"touch"!==u.pointerType||n.dispatchEvent(u,"click"),n.dispatchEvent(u,"pointertap")),n.freeEvent(u)}n.freeEvent(i)},this.onPointerMove=function(t){var e=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0),r="mouse"===e.pointerType||"pen"===e.pointerType,i=n.trackingData(t.pointerId),o=n.findMountedTarget(i.overTargets);if(i.overTargets&&o!==e.target){var a="mousemove"===t.type?"mouseout":"pointerout",s=n.createPointerEvent(t,a,o||void 0);if(n.dispatchEvent(s,"pointerout"),r&&n.dispatchEvent(s,"mouseout"),!e.composedPath().includes(o)){var c=n.createPointerEvent(t,"pointerleave",o||void 0);for(c.eventPhase=c.AT_TARGET;c.target&&!e.composedPath().includes(c.target);)c.currentTarget=c.target,n.notifyTarget(c),r&&n.notifyTarget(c,"mouseleave"),ip.isNode(c.target)&&(c.target=c.target.parentNode);n.freeEvent(c)}n.freeEvent(s)}if(o!==e.target){var l="mousemove"===t.type?"mouseover":"pointerover",u=n.clonePointerEvent(e,l);n.dispatchEvent(u,"pointerover"),r&&n.dispatchEvent(u,"mouseover");for(var f=o&&ip.isNode(o)&&o.parentNode;f&&f!==(ip.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&f!==e.target;)f=f.parentNode;if(!f||f===(ip.isNode(n.rootTarget)&&n.rootTarget.parentNode)){var h=n.clonePointerEvent(e,"pointerenter");for(h.eventPhase=h.AT_TARGET;h.target&&h.target!==o&&h.target!==(ip.isNode(n.rootTarget)&&n.rootTarget.parentNode);)h.currentTarget=h.target,n.notifyTarget(h),r&&n.notifyTarget(h,"mouseenter"),ip.isNode(h.target)&&(h.target=h.target.parentNode);n.freeEvent(h)}n.freeEvent(u)}n.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&n.dispatchEvent(e,"touchmove"),r&&(n.dispatchEvent(e,"mousemove"),n.cursor=n.getCursor(e.target)),i.overTargets=e.composedPath(),n.freeEvent(e)},this.onPointerOut=function(t){var e=n.trackingData(t.pointerId);if(e.overTargets){var r="mouse"===t.pointerType||"pen"===t.pointerType,i=n.findMountedTarget(e.overTargets),o=n.createPointerEvent(t,"pointerout",i||void 0);n.dispatchEvent(o),r&&n.dispatchEvent(o,"mouseout");var a=n.createPointerEvent(t,"pointerleave",i||void 0);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(ip.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),r&&n.notifyTarget(a,"mouseleave"),ip.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=null,n.freeEvent(o),n.freeEvent(a)}n.cursor=null},this.onPointerOver=function(t){var e=n.trackingData(t.pointerId),r=n.createPointerEvent(t),i="mouse"===r.pointerType||"pen"===r.pointerType;n.dispatchEvent(r,"pointerover"),i&&n.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(n.cursor=n.getCursor(r.target));var o=n.clonePointerEvent(r,"pointerenter");for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(ip.isNode(n.rootTarget)&&n.rootTarget.parentNode);)o.currentTarget=o.target,n.notifyTarget(o),i&&n.notifyTarget(o,"mouseenter"),ip.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=r.composedPath(),n.freeEvent(r),n.freeEvent(o)},this.onPointerUpOutside=function(t){var e=n.trackingData(t.pointerId),r=n.findMountedTarget(e.pressTargetsByButton[t.button]),i=n.createPointerEvent(t);if(r){for(var o=r;o;)i.currentTarget=o,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||n.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),ip.isNode(o)&&(o=o.parentNode);delete e.pressTargetsByButton[t.button]}n.freeEvent(i)},this.onWheel=function(t){var e=n.createWheelEvent(t);n.dispatchEvent(e),n.freeEvent(e)},this.onClick=function(t){if(n.context.config.useNativeClickEvent){var e=n.createPointerEvent(t);n.dispatchEvent(e),n.freeEvent(e)}},this.onPointerCancel=function(t){var e=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);n.dispatchEvent(e),n.freeEvent(e)}}return t.prototype.init=function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)},t.prototype.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},t.prototype.client2Viewport=function(t){var e=this.context.contextService.getBoundingClientRect();return new Tu(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},t.prototype.viewport2Client=function(t){var e=this.context.contextService.getBoundingClientRect();return new Tu(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},t.prototype.viewport2Canvas=function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,o=i.width,a=i.height,s=r.getPerspectiveInverse(),c=r.getWorldTransform(),l=yt(this.tmpMatrix,c,s),u=Xt(this.tmpVec3,e/o*2-1,2*(1-n/a)-1,0);return re(u,u,l),new Tu(u[0],u[1])},t.prototype.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=yt(this.tmpMatrix,n,r),o=Xt(this.tmpVec3,t.x,t.y,0);re(this.tmpVec3,this.tmpVec3,i);var a=this.context.config,s=a.width,c=a.height;return new Tu((o[0]+1)/2*s,(1-(o[1]+1)/2)*c)},t.prototype.setPickHandler=function(t){this.pickHandler=t},t.prototype.addEventMapping=function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))},t.prototype.mapEvent=function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;n<r;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}},t.prototype.dispatchEvent=function(t,e,n){if(n){t.eventPhase=t.AT_TARGET;var r=this.rootTarget.defaultView||null;t.currentTarget=r,this.notifyListeners(t,e)}else t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e);this.emitter.emit(e||t.type,t)},t.prototype.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(r=i+1;r<n.length;r++)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},t.prototype.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;r<2048&&t!==this.rootTarget;r++)ip.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e},t.prototype.hitTest=function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config,i=r.width,o=r.height,a=r.disableHitTesting;return e<0||n<0||e>i||n>o?null:!a&&this.pickHandler(t)||this.rootTarget||null},t.prototype.isNativeEventFromCanvas=function(t){var e,n=this.context.contextService.getDomElement(),r=null===(e=t.nativeEvent)||void 0===e?void 0:e.target;if(r){if(r===n)return!0;if(n&&n.contains)return n.contains(r)}return!!t.nativeEvent.composedPath&&t.nativeEvent.composedPath().indexOf(n)>-1},t.prototype.getExistedHTML=function(t){var e,n;if(t.nativeEvent.composedPath)try{for(var r=Se(t.nativeEvent.composedPath()),i=r.next();!i.done;i=r.next()){var o=i.value,a=this.nativeHTMLMap.get(o);if(a)return a}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return null},t.prototype.pickTarget=function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})},t.prototype.createPointerEvent=function(t,e,n,r){var i=this.allocateEvent(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);return i.target=null!=n?n:o||this.isNativeEventFromCanvas(i)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i},t.prototype.createWheelEvent=function(t){var e=this.allocateEvent(ep);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e);return e.target=n||this.isNativeEventFromCanvas(e)&&this.pickTarget(e),e},t.prototype.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},t.prototype.cloneWheelEvent=function(t){var e=this.allocateEvent(ep);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e},t.prototype.clonePointerEvent=function(t,e){var n=this.allocateEvent(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},t.prototype.copyPointerData=function(t,e){e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist},t.prototype.copyMouseData=function(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)},t.prototype.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},t.prototype.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=md.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},t.prototype.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e},t.prototype.freeEvent=function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)},t.prototype.notifyTarget=function(t,e){e=null!=e?e:t.type;var n=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e;this.notifyListeners(t,n),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)},t.prototype.notifyListeners=function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;i<r.length&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)},t.prototype.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||ip.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},t.prototype.getCursor=function(t){for(var e=t;e;){var n=fd(e)&&e.getAttribute("cursor");if(n)return n;e=ip.isNode(e)&&e.parentNode}},t}(),ap=function(){function t(){}return t.prototype.getOrCreateCanvas=function(t,e){if(this.canvas)return this.canvas;if(t||Op.offscreenCanvas)this.canvas=t||Op.offscreenCanvas,this.context=this.canvas.getContext("2d",we({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",we({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",we({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas},t.prototype.getOrCreateContext=function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context},t}();!function(t){t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE"}(Zd||(Zd={}));var sp,cp=function(){function t(t,e){this.globalRuntime=t,this.context=e,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Cd,initAsync:new Td,dirtycheck:new Nd,cull:new Nd,beginFrame:new Cd,beforeRender:new Cd,render:new Cd,afterRender:new Cd,endFrame:new Cd,destroy:new Cd,pick:new Pd,pickSync:new Nd,pointerDown:new Cd,pointerUp:new Cd,pointerMove:new Cd,pointerOut:new Cd,pointerOver:new Cd,pointerWheel:new Cd,pointerCancel:new Cd,click:new Cd}}return t.prototype.init=function(t){var e=this,n=we(we({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach((function(t){t.apply(n,e.globalRuntime)})),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,t()):this.hooks.initAsync.promise().then((function(){e.inited=!0,t()}))},t.prototype.getStats=function(){return this.stats},t.prototype.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(Zd.CAMERA_CHANGED)},t.prototype.render=function(t,e){var n=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var r=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(r.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),r.renderReasons.size&&this.inited){r.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var i=1===r.renderReasons.size&&r.renderReasons.has(Zd.CAMERA_CHANGED),o=!t.disableRenderHooks||!(t.disableRenderHooks&&i);o&&this.renderDisplayObject(r.root,t,r),this.hooks.beginFrame.call(),o&&r.renderListCurrentFrame.forEach((function(t){n.hooks.beforeRender.call(t),n.hooks.render.call(t),n.hooks.afterRender.call(t)})),this.hooks.endFrame.call(),r.renderListCurrentFrame=[],r.renderReasons.clear(),e()}},t.prototype.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),o=i.enableDirtyCheck,a=i.enableCulling;this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t);var s=t.renderable,c=o?s.dirty||n.dirtyRectangleRenderingDisabled?t:null:t;if(c){var l=a?this.hooks.cull.call(c,this.context.camera):c;l&&(this.stats.rendered++,n.renderListCurrentFrame.push(l))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var u=t.sortable;u.dirty&&(this.sort(t,u),u.dirty=!1,u.dirtyChildren=[],u.dirtyReason=void 0),(u.sorted||t.childNodes).forEach((function(t){r.renderDisplayObject(t,e,n)}))},t.prototype.sort=function(t,e){e.sorted&&e.dirtyReason!==lf.Z_INDEX_CHANGED?e.dirtyChildren.forEach((function(n){if(-1===t.childNodes.indexOf(n)){var r=e.sorted.indexOf(n);r>=0&&e.sorted.splice(r,1)}else if(0===e.sorted.length)e.sorted.push(n);else{var i=function(t,e){for(var n=0,r=t.length;n<r;){var i=n+r>>>1;hd(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(hd)},t.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},t.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(Zd.DISPLAY_OBJECT_CHANGED)},t}(),lp=/\[\s*(.*)=(.*)\s*\]/,up=function(){function t(){}return t.prototype.selectOne=function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))},t.prototype.selectAll=function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(r){return e!==r&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.findAll((function(r){return e!==r&&r.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))},t.prototype.is=function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t},t.prototype.getIdOrClassname=function(t){return t.substring(1)},t.prototype.getAttribute=function(t){var e=t.match(lp),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}},t.prototype.attributeToString=function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return y(n)?"":n.toString?n.toString():""},t}(),fp=function(t){function e(e,n,r,i,o,a,s,c){var l=t.call(this,null)||this;return l.relatedNode=n,l.prevValue=r,l.newValue=i,l.attrName=o,l.attrChange=a,l.prevParsedValue=s,l.newParsedValue=c,l.type=e,l}return xe(e,t),e.ADDITION=2,e.MODIFICATION=1,e.REMOVAL=3,e}(Qd);function hp(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}!function(t){t.REPARENT="reparent",t.DESTROY="destroy",t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.REMOVED="removed",t.MOUNTED="DOMNodeInsertedIntoDocument",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled"}(sp||(sp={}));var dp,pp,gp,mp=new fp(sp.REPARENT,null,"","","",0,"",""),yp=function(){function t(t){var e,n,r,i,o,a,s,c,l=this;this.runtime=t,this.pendingEvents=[],this.boundsChangedEvent=new np(sp.BOUNDS_CHANGED),this.rotate=(e=ue(),function(t,n,r,i,o){void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=!0),"number"==typeof n&&(n=Ut(n,r,i));var a=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var s=ue();pe(s,n[0],n[1],n[2]);var c=l.getRotation(t),u=l.getRotation(t.parentNode);me(e,u),de(e,e),he(s,e,s),he(a.localRotation,s,c),ve(a.localRotation,a.localRotation),o&&l.dirtifyLocal(t,a)}else l.rotateLocal(t,n)}),this.rotateLocal=(n=ue(),function(t,e,r,i,o){void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=!0),"number"==typeof e&&(e=Ut(e,r,i));var a=t.transformable;pe(n,e[0],e[1],e[2]),ye(a.localRotation,a.localRotation,n),o&&l.dirtifyLocal(t,a)}),this.setEulerAngles=(r=ue(),function(t,e,n,i,o){void 0===n&&(n=0),void 0===i&&(i=0),void 0===o&&(o=!0),"number"==typeof e&&(e=Ut(e,n,i));var a=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){pe(a.localRotation,e[0],e[1],e[2]);var s=l.getRotation(t.parentNode);me(r,de(ue(),s)),ye(a.localRotation,a.localRotation,r),o&&l.dirtifyLocal(t,a)}else l.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r,i){void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=!0),"number"==typeof e&&(e=Ut(e,n,r));var o=t.transformable;oe(e,Ht())||(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,m=2*a;u*=m,f*=m,h*=m,d*=2,p*=2,g*=2,t[0]=s+u+d,t[1]=c+f+p,t[2]=l+h+g}(e,e,o.localRotation),Kt(o.localPosition,o.localPosition,e),i&&l.dirtifyLocal(t,o))},this.setPosition=(i=lt(),o=Ht(),function(t,e,n){void 0===n&&(n=!0);var r=t.transformable;if(o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,!oe(l.getPosition(t),o)){if(qt(r.position,o),null!==t.parentNode&&t.parentNode.transformable){var a=t.parentNode.transformable;ft(i,a.worldTransform),gt(i,i),re(r.localPosition,o,i)}else qt(r.localPosition,o);n&&l.dirtifyLocal(t,r)}}),this.setLocalPosition=function(){var t=Ht();return function(e,n,r){void 0===r&&(r=!0);var i=e.transformable;t[0]=n[0],t[1]=n[1],t[2]=n[2]||0,oe(i.localPosition,t)||(qt(i.localPosition,t),r&&l.dirtifyLocal(e,i))}}(),this.translate=(a=Ht(),s=Ht(),c=Ht(),function(t,e,n,r,i){void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=!0),"number"==typeof e&&(e=Xt(s,e,n,r)),oe(e,a)||(Kt(c,l.getPosition(t),e),l.setPosition(t,c,i))}),this.setRotation=function(){var t=ue();return function(e,n,r,i,o,a){void 0===a&&(a=!0);var s=e.transformable;if("number"==typeof n&&(n=ge(n,r,i,o)),null!==e.parentNode&&e.parentNode.transformable){var c=l.getRotation(e.parentNode);me(t,c),de(t,t),he(s.localRotation,t,n),ve(s.localRotation,s.localRotation),a&&l.dirtifyLocal(e,s)}else l.setLocalRotation(e,n)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var t=lt(),e=Ht(),n=ge(0,0,0,1);return function(r){if(0!==r.localSkew[0]||0!==r.localSkew[1]){if(Nt(r.localTransform,r.localRotation,r.localPosition,Ut(1,1,1),r.origin),0!==r.localSkew[0]||0!==r.localSkew[1]){var i=dt(t);i[4]=Math.tan(r.localSkew[0]),i[1]=Math.tan(r.localSkew[1]),yt(r.localTransform,r.localTransform,i)}var o=Nt(t,n,e,r.localScale,r.origin);yt(r.localTransform,r.localTransform,o)}else Nt(r.localTransform,r.localRotation,r.localPosition,r.localScale,r.origin)}}()}return t.prototype.matches=function(t,e){return this.runtime.sceneGraphSelector.is(t,e)},t.prototype.querySelector=function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)},t.prototype.querySelectorAll=function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)},t.prototype.attach=function(t,e,n){var r,i=!1;t.parentNode&&(i=t.parentNode!==e,this.detach(t)),t.parentNode=e,y(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);var o=e.sortable;((null===(r=null==o?void 0:o.sorted)||void 0===r?void 0:r.length)||t.parsedStyle.zIndex)&&(-1===o.dirtyChildren.indexOf(t)&&o.dirtyChildren.push(t),o.dirty=!0,o.dirtyReason=lf.ADDED);var a=t.transformable;a&&this.dirtifyWorld(t,a),a.frozen&&this.unfreezeParentToRoot(t),i&&t.dispatchEvent(mp)},t.prototype.detach=function(t){var e,n;if(t.parentNode){var r=t.transformable,i=t.parentNode.sortable;((null===(e=null==i?void 0:i.sorted)||void 0===e?void 0:e.length)||(null===(n=t.style)||void 0===n?void 0:n.zIndex))&&(-1===i.dirtyChildren.indexOf(t)&&i.dirtyChildren.push(t),i.dirty=!0,i.dirtyReason=lf.REMOVED);var o=t.parentNode.childNodes.indexOf(t);o>-1&&t.parentNode.childNodes.splice(o,1),r&&this.dirtifyWorld(t,r),t.parentNode=null}},t.prototype.getOrigin=function(t){return t.getGeometryBounds(),t.transformable.origin},t.prototype.setOrigin=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=[e,n,r]);var i=t.transformable;if(e[0]!==i.origin[0]||e[1]!==i.origin[1]||e[2]!==i.origin[2]){var o=i.origin;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,this.dirtifyLocal(t,i)}},t.prototype.setLocalEulerAngles=function(t,e,n,r,i){void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=!0),"number"==typeof e&&(e=Ut(e,n,r));var o=t.transformable;pe(o.localRotation,e[0],e[1],e[2]),i&&this.dirtifyLocal(t,o)},t.prototype.scaleLocal=function(t,e,n){void 0===n&&(n=!0);var r,i,o,a=t.transformable;r=a.localScale,i=a.localScale,o=Ut(e[0],e[1],e[2]||1),r[0]=i[0]*o[0],r[1]=i[1]*o[1],r[2]=i[2]*o[2],n&&this.dirtifyLocal(t,a)},t.prototype.setLocalScale=function(t,e,n){void 0===n&&(n=!0);var r=t.transformable,i=Ut(e[0],e[1],e[2]||r.localScale[2]);oe(i,r.localScale)||(qt(r.localScale,i),n&&this.dirtifyLocal(t,r))},t.prototype.setLocalRotation=function(t,e,n,r,i,o){void 0===o&&(o=!0),"number"==typeof e&&(e=ge(e,n,r,i));var a=t.transformable;me(a.localRotation,e),o&&this.dirtifyLocal(t,a)},t.prototype.setLocalSkew=function(t,e,n){"number"==typeof e&&(e=function(t,e){var n=new at(2);return n[0]=t,n[1]=e,n}(e,n));var r,i,o=t.transformable;r=o.localSkew,i=e,r[0]=i[0],r[1]=i[1],this.dirtifyLocal(t,o)},t.prototype.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))},t.prototype.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)},t.prototype.triggerPendingEvents=function(){var t=this,e=new Set,n=function(n,r){n.isConnected&&!e.has(n.entity)&&(t.boundsChangedEvent.detail=r,t.boundsChangedEvent.target=n,n.isMutationObserved?n.dispatchEvent(t.boundsChangedEvent):n.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),e.add(n.entity))};this.pendingEvents.forEach((function(t){var e=Ae(t,2),r=e[0],i=e[1];i.affectChildren?r.forEach((function(t){n(t,i)})):n(r,i)})),this.clearPendingEvents(),e.clear()},t.prototype.clearPendingEvents=function(){this.pendingEvents=[]},t.prototype.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)hp(n),n=n.parentNode;e&&t.forEach((function(t){hp(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren:e}])},t.prototype.updateDisplayObjectDependency=function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var o=i[t].indexOf(r);i[t].splice(o,1)}}if(n){var a=this.displayObjectDependencyMap.get(n);a||(this.displayObjectDependencyMap.set(n,{}),a=this.displayObjectDependencyMap.get(n)),a[t]||(a[t]=[]),a[t].push(r)}},t.prototype.informDependentDisplayObjects=function(t){var e=this,n=this.displayObjectDependencyMap.get(t);n&&Object.keys(n).forEach((function(t){n[t].forEach((function(n){e.dirtifyToRoot(n,!0),n.dispatchEvent(new fp(sp.ATTR_MODIFIED,n,e,e,t,fp.MODIFICATION,e,e)),n.isCustomElement&&n.isConnected&&n.attributeChangedCallback&&n.attributeChangedCallback(t,e,e)}))}))},t.prototype.getPosition=function(t){var e=t.transformable;return Tt(e.position,this.getWorldTransform(t,e))},t.prototype.getRotation=function(t){var e=t.transformable;return Ct(e.rotation,this.getWorldTransform(t,e))},t.prototype.getScale=function(t){var e=t.transformable;return Pt(e.scaling,this.getWorldTransform(t,e))},t.prototype.getWorldTransform=function(t,e){return void 0===e&&(e=t.transformable),e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform},t.prototype.getLocalPosition=function(t){return t.transformable.localPosition},t.prototype.getLocalRotation=function(t){return t.transformable.localRotation},t.prototype.getLocalScale=function(t){return t.transformable.localScale},t.prototype.getLocalSkew=function(t){return t.transformable.localSkew},t.prototype.getLocalTransform=function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform},t.prototype.setLocalTransform=function(t,e){var n=Tt(Ht(),e),r=Ct(ue(),e),i=Pt(Ht(),e);this.setLocalScale(t,i,!1),this.setLocalPosition(t,n,!1),this.setLocalRotation(t,r,void 0,void 0,void 0,!1),this.dirtifyLocal(t,t.transformable)},t.prototype.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0]),this.setLocalSkew(t,[0,0])},t.prototype.getTransformedGeometryBounds=function(t,e,n){void 0===e&&(e=!1);var r=this.getGeometryBounds(t,e);if(Ou.isEmpty(r))return null;var i=n||new Ou;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i},t.prototype.getGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=t.geometry;return n.dirty&&Op.styleValueRegistry.updateGeometry(t),(e?n.renderBounds:n.contentBounds||null)||new Ou},t.prototype.getBounds=function(t,e){var n=this;void 0===e&&(e=!1);var r=t.renderable;if(!r.boundsDirty&&!e&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&e&&r.renderBounds)return r.renderBounds;var i=e?r.renderBounds:r.bounds,o=this.getTransformedGeometryBounds(t,e,i);if(t.childNodes.forEach((function(t){var r=n.getBounds(t,e);r&&(o?o.add(r):(o=i||new Ou).update(r.center,r.halfExtents))})),e){var a=dd(t);if(a){var s=a.parsedStyle.clipPath.getBounds(e);o?s&&(o=s.intersection(o)):o=s}}return o||(o=new Ou),o&&(e?r.renderBounds=o:r.bounds=o),e?r.renderBoundsDirty=!1:r.boundsDirty=!1,o},t.prototype.getLocalBounds=function(t){if(t.parentNode){var e=lt();t.parentNode.transformable&&(e=gt(lt(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!Ou.isEmpty(n)){var r=new Ou;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},t.prototype.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);Ou.isEmpty(i)||(r=new Ou).setFromTransformedAABB(i,this.getWorldTransform(t));var o=null===(n=null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)||void 0===n?void 0:n.getContextService().getBoundingClientRect();if(r){var a=Ae(r.getMin(),2),s=a[0],c=a[1],l=Ae(r.getMax(),2),u=l[0],f=l[1];return new Pu(s+((null==o?void 0:o.left)||0),c+((null==o?void 0:o.top)||0),u-s,f-c)}return new Pu((null==o?void 0:o.left)||0,(null==o?void 0:o.top)||0,0,0)},t.prototype.dirtifyWorldInternal=function(t,e){var n=this;if(!e.dirtyFlag){e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}));var r=t.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0)}},t.prototype.syncHierarchy=function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;r<n.length;r++)this.syncHierarchy(n[r])}},t.prototype.sync=function(t,e){if(e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,r=n&&n.transformable;null!==n&&r?yt(e.worldTransform,r.worldTransform,e.localTransform):ft(e.worldTransform,e.localTransform),e.dirtyFlag=!1}},t.prototype.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},t}(),vp={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]},bp=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,xp=new RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),wp=new RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),Mp=function(){function t(t){var e=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!wp.exec(n)&&!xp.exec(t))},this.trimByKinsokuShorui=function(t){var e=_e([],Ae(t),!1),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e}}return t.prototype.measureFont=function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),i=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0});i.font=t;var o=vp.MetricsString+vp.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(vp.BaselineSymbol).width),c=vp.HeightMultiplier*s;s=s*vp.BaselineMultiplier|0,r.width=a,r.height=c,i.fillStyle="#f00",i.fillRect(0,0,a,c),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(o,0,s);var l=i.getImageData(0,0,a||1,c||1).data,u=l.length,f=4*a,h=0,d=0,p=!1;for(h=0;h<s;++h){for(var g=0;g<f;g+=4)if(255!==l[d+g]){p=!0;break}if(p)break;d+=f}for(n.ascent=s-h,d=u-f,p=!1,h=c;h>s;--h){for(g=0;g<f;g+=4)if(255!==l[d+g]){p=!0;break}if(p)break;d-=f}return n.descent=h-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n},t.prototype.measureText=function(t,e,n){var r=e.fontSize,i=void 0===r?16:r,o=e.wordWrap,a=void 0!==o&&o,s=e.lineHeight,c=e.lineWidth,l=void 0===c?1:c,u=e.textBaseline,f=void 0===u?"alphabetic":u,h=e.textAlign,d=void 0===h?"start":h,p=e.letterSpacing,g=void 0===p?0:p,m=e.textPath,y=e.leading,v=void 0===y?0:y,b=function(t){for(var e=t.fontSize,n=void 0===e?16:e,r=t.fontFamily,i=void 0===r?"sans-serif":r,o=t.fontStyle,a=void 0===o?"normal":o,s=t.fontVariant,c=void 0===s?"normal":s,l=t.fontWeight,u=void 0===l?"normal":l,f=L(n)&&"".concat(n,"px")||"16px",h=i.split(","),d=h.length-1;d>=0;d--){var p=h[d].trim();!jd.test(p)&&Ld.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 M=(a?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),O=new Array(M.length),E=0;if(!m){for(T=0;T<M.length;T++){var k=w.measureText(M[T]).width+(M[T].length-1)*g;O[T]=k,E=Math.max(E,k)}P=E+l;var S=s||x.fontSize+l,A=Math.max(S,x.fontSize+l)+(M.length-1)*(S+v),_=0;return"middle"===f?_=-A/2:"bottom"===f||"alphabetic"===f||"ideographic"===f?_=-A:"top"!==f&&"hanging"!==f||(_=0),{font:b,width:P,height:A,lines:M,lineWidths:O,lineHeight:S+=v,maxLineWidth:E,fontProperties:x,lineMetrics:O.map((function(t,e){var n=0;return"center"===d||"middle"===d?n-=t/2:"right"!==d&&"end"!==d||(n-=t),new Pu(n-l/2,_+e*S,t+l,S)}))}}m.getTotalLength();for(var T=0;T<M.length;T++)var P=w.measureText(M[T]).width+(M[T].length-1)*g},t.prototype.setGraphemeOnPath=function(){},t.prototype.wordWrap=function(t,e,n){var r=this,i=e.wordWrapWidth,o=void 0===i?0:i,a=e.letterSpacing,s=void 0===a?0:a,c=e.maxLines,l=void 0===c?1/0:c,u=e.textOverflow,f=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),h=o+s,d="";"ellipsis"===u?d="...":u&&"clip"!==u&&(d=u);for(var p=[],g=0,m=0,y={},v=function(t){return r.getFromCache(t,s,y,f)},b=Array.from(d).reduce((function(t,e){return t+v(e)}),0),x=Array.from(t),w=0;w<x.length;w++){var M=x[w],O=t[w-1],E=t[w+1],k=v(M);if(this.isNewline(M)){if(++g>=l){e.isOverflowing=!0;break}m=0,p[g]=""}else{if(m>0&&m+k>h){if(g+1>=l){if(e.isOverflowing=!0,b>0&&b<=h){for(var S=p[g].length,A=0,_=S,T=0;T<S;T++){var P=v(p[g][T]);if(A+P+b>h){_=T;break}A+=P}p[g]=(p[g]||"").slice(0,_)+d}break}if(m=0,p[++g]="",this.isBreakingSpace(M))continue;this.canBreakInLastChar(M)||(p=this.trimToBreakable(p),m=this.sumTextWidthByCache(p[g]||"",y)),this.shouldBreakByKinsokuShorui(M,E)&&(p=this.trimByKinsokuShorui(p),m+=v(O||""))}m+=k,p[g]=(p[g]||"")+M}}return p.join("\n")},t.prototype.isBreakingSpace=function(t){return"string"==typeof t&&vp.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},t.prototype.isNewline=function(t){return"string"==typeof t&&vp.Newlines.indexOf(t.charCodeAt(0))>=0},t.prototype.trimToBreakable=function(t){var e=_e([],Ae(t),!1),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),o=r+1,a=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(o,n.length),e[e.length-2]=n.slice(0,a),e},t.prototype.canBreakInLastChar=function(t){return!t||!bp.test(t)},t.prototype.sumTextWidthByCache=function(t,e){return t.split("").reduce((function(t,n){if(!e[n])throw Error("cannot count the word without cache");return t+e[n]}),0)},t.prototype.findBreakableIndex=function(t){for(var e=t.length-1;e>=0;e--)if(!bp.test(t[e]))return e;return-1},t.prototype.getFromCache=function(t,e,n,r){var i=n[t];if("number"!=typeof i){var o=t.length*e;i=r.measureText(t).width+o,n[t]=i}return i},t}(),Op={},Ep=(pp=new qd,gp=new Ud,(dp={})[tu.CIRCLE]=new $d,dp[tu.ELLIPSE]=new Hd,dp[tu.RECT]=pp,dp[tu.IMAGE]=pp,dp[tu.GROUP]=new Kd,dp[tu.LINE]=new Vd,dp[tu.TEXT]=new Xd(Op),dp[tu.POLYLINE]=gp,dp[tu.POLYGON]=gp,dp[tu.PATH]=new Yd,dp[tu.HTML]=null,dp[tu.MESH]=null,dp),kp=function(){var t,e=new Uh,n=new Kh;return(t={})[wf.PERCENTAGE]=null,t[wf.NUMBER]=new td,t[wf.ANGLE]=new Vh,t[wf.DEFINED_PATH]=new Yh,t[wf.PAINT]=e,t[wf.COLOR]=e,t[wf.FILTER]=new qh,t[wf.LENGTH]=n,t[wf.LENGTH_PERCENTAGE]=n,t[wf.LENGTH_PERCENTAGE_12]=new Zh,t[wf.LENGTH_PERCENTAGE_14]=new Qh,t[wf.COORDINATE]=new Kh,t[wf.OFFSET_DISTANCE]=new ed,t[wf.OPACITY_VALUE]=new nd,t[wf.PATH]=new rd,t[wf.LIST_OF_POINTS]=new id,t[wf.SHADOW_BLUR]=new od,t[wf.TEXT]=new ad,t[wf.TEXT_TRANSFORM]=new sd,t[wf.TRANSFORM]=new zd,t[wf.TRANSFORM_ORIGIN]=new Gd,t[wf.Z_INDEX]=new Wd,t[wf.MARKER]=new Jh,t}();Op.CameraContribution=zu,Op.AnimationTimeline=null,Op.EasingFunction=null,Op.offscreenCanvasCreator=new ap,Op.sceneGraphSelector=new up,Op.sceneGraphService=new yp(Op),Op.textService=new Mp(Op),Op.geometryUpdaterFactory=Ep,Op.CSSPropertySyntaxFactory=kp,Op.styleValueRegistry=new Hh(Op),Op.layoutRegistry=null,Op.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==nl?nl:{},Op.enableCSSParsing=!0,Op.enableDataset=!1,Op.enableStyleSyntax=!0,Op.enableAttributeDashCased=!1;var Sp=0,Ap=new fp(sp.INSERTED,null,"","","",0,"",""),_p=new fp(sp.REMOVED,null,"","","",0,"",""),Tp=new np(sp.DESTROY),Pp=function(t){function e(){var e=t.call(this)||this;return e.entity=Sp++,e.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},e.cullable={strategy:cf.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},e.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},e.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},e.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},e.rBushNode={aabb:void 0},e.namespaceURI="g",e.scrollLeft=0,e.scrollTop=0,e.clientTop=0,e.clientLeft=0,e.destroyed=!1,e.style={},e.computedStyle=Op.enableCSSParsing?{opacity:hf,fillOpacity:hf,strokeOpacity:hf,fill:hf,stroke:hf,transform:hf,transformOrigin:hf,visibility:hf,pointerEvents:hf,lineWidth:hf,lineCap:hf,lineJoin:hf,increasedLineWidthForHitTesting:hf,fontSize:hf,fontFamily:hf,fontStyle:hf,fontWeight:hf,fontVariant:hf,textAlign:hf,textBaseline:hf,textTransform:hf,zIndex:hf,filter:hf,shadowType:hf}:null,e.parsedStyle={},e.attributes={},e}return xe(e,t),Object.defineProperty(e.prototype,"className",{get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"classList",{get:function(){return this.className.split(" ").filter((function(t){return""!==t}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tagName",{get:function(){return this.nodeName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentElement",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(t){throw new Error(Cu)},e.prototype.appendChild=function(t,e){var n;if(t.destroyed)throw new Error("Cannot append a destroyed element.");return Op.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),this.isMutationObserved&&(Ap.relatedNode=this,t.dispatchEvent(Ap)),t},e.prototype.insertBefore=function(t,e){if(e){t.parentElement&&t.parentElement.removeChild(t);var n=this.childNodes.indexOf(e);-1===n?this.appendChild(t):this.appendChild(t,n)}else this.appendChild(t);return t},e.prototype.replaceChild=function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},e.prototype.removeChild=function(t){var e;return _p.relatedNode=this,t.dispatchEvent(_p),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),Op.sceneGraphService.detach(t),t},e.prototype.removeChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];this.removeChild(e)}},e.prototype.destroyChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length&&e.destroyChildren(),e.destroy()}},e.prototype.matches=function(t){return Op.sceneGraphService.matches(t,this)},e.prototype.getElementById=function(t){return Op.sceneGraphService.querySelector("#".concat(t),this)},e.prototype.getElementsByName=function(t){return Op.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)},e.prototype.getElementsByClassName=function(t){return Op.sceneGraphService.querySelectorAll(".".concat(t),this)},e.prototype.getElementsByTagName=function(t){return Op.sceneGraphService.querySelectorAll(t,this)},e.prototype.querySelector=function(t){return Op.sceneGraphService.querySelector(t,this)},e.prototype.querySelectorAll=function(t){return Op.sceneGraphService.querySelectorAll(t,this)},e.prototype.closest=function(t){var e=this;do{if(Op.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null},e.prototype.find=function(t){var e=this,n=null;return this.forEach((function(r){return!(r===e||!t(r))&&(n=r,!0)})),n},e.prototype.findAll=function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n},e.prototype.after=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this);e.forEach((function(e,n){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(e,r+n+1)}))}},e.prototype.before=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this),i=Ae(e),o=i[0],a=i.slice(1);this.parentNode.appendChild(o,r),(t=o).after.apply(t,_e([],Ae(a),!1))}},e.prototype.replaceWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.after.apply(this,_e([],Ae(t),!1)),this.remove()},e.prototype.append=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach((function(e){return t.appendChild(e)}))},e.prototype.prepend=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach((function(e,n){return t.appendChild(e,n)}))},e.prototype.replaceChildren=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,_e([],Ae(t),!1))},e.prototype.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},e.prototype.destroy=function(){this.dispatchEvent(Tp),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},e.prototype.getGeometryBounds=function(){return Op.sceneGraphService.getGeometryBounds(this)},e.prototype.getRenderBounds=function(){return Op.sceneGraphService.getBounds(this,!0)},e.prototype.getBounds=function(){return Op.sceneGraphService.getBounds(this)},e.prototype.getLocalBounds=function(){return Op.sceneGraphService.getLocalBounds(this)},e.prototype.getBoundingClientRect=function(){return Op.sceneGraphService.getBoundingClientRect(this)},e.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},e.prototype.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},e.prototype.getAttributeNames=function(){return Object.keys(this.attributes)},e.prototype.getAttribute=function(t){if(function(t){return"symbol"==typeof t}(t))return Op.enableCSSParsing?null:void 0;var e=this.attributes[t];if(void 0===e){if(Op.enableAttributeDashCased){var n=nf(t);e=this.attributes[n]}return Op.enableCSSParsing&&y(e)?null:e}return e},e.prototype.hasAttribute=function(t){return this.getAttributeNames().includes(t)},e.prototype.hasAttributes=function(){return!!this.getAttributeNames().length},e.prototype.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},e.prototype.setAttribute=function(t,e,n,r){this.attributes[t]=e},e.prototype.getAttributeNS=function(t,e){throw new Error(Cu)},e.prototype.getAttributeNode=function(t){throw new Error(Cu)},e.prototype.getAttributeNodeNS=function(t,e){throw new Error(Cu)},e.prototype.hasAttributeNS=function(t,e){throw new Error(Cu)},e.prototype.removeAttributeNS=function(t,e){throw new Error(Cu)},e.prototype.removeAttributeNode=function(t){throw new Error(Cu)},e.prototype.setAttributeNS=function(t,e,n){throw new Error(Cu)},e.prototype.setAttributeNode=function(t){throw new Error(Cu)},e.prototype.setAttributeNodeNS=function(t){throw new Error(Cu)},e.prototype.toggleAttribute=function(t,e){throw new Error(Cu)},e}(ip);function Cp(t){return!!(null==t?void 0:t.nodeName)}var Np,Lp=Op.globalThis.Proxy?Op.globalThis.Proxy:function(){},jp=new fp(sp.ATTR_MODIFIED,null,null,null,null,fp.MODIFICATION,null,null),Rp={opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",zIndex:"",filter:"",shadowType:""},Ip={fill:yf,stroke:yf,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},Bp=_e(_e([],Ae(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"]),!1),["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],!1),Dp="data-",Fp=function(t){function e(e){var n=t.call(this)||this;return n.isCustomElement=!1,n.isMutationObserved=!1,n.activeAnimations=[],n.config=e,n.id=n.config.id||"",n.name=n.config.name||"",(n.config.className||n.config.class)&&(n.className=n.config.className||n.config.class),n.nodeName=n.config.type||tu.GROUP,Op.enableCSSParsing?(Object.assign(n.attributes,Rp),Object.assign(n.parsedStyle,Ip,n.config.initialParsedStyle)):n.config.initialParsedStyle&&Object.assign(n.parsedStyle,n.config.initialParsedStyle),n.initAttributes(n.config.style),Op.enableDataset&&(n.dataset=new Lp({},{get:function(t,e){var r="".concat(Dp).concat(Ju(e));return void 0!==t[r]?t[r]:n.getAttribute(r)},set:function(t,e,r){return n.setAttribute("".concat(Dp).concat(Ju(e)),r),!0}})),Op.enableStyleSyntax&&(n.style=new Lp({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 xe(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.getAnimations().forEach((function(t){t.cancel()}))},e.prototype.cloneNode=function(t,e){var n=we({},this.attributes);for(var r in n){var i=n[r];Cp(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}var o=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:n});return o.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);o.appendChild(n)}})),o},e.prototype.initAttributes=function(t){void 0===t&&(t={});var e=this.renderable,n={forceUpdateGeometry:!0};Op.enableCSSParsing&&(n.usedAttributes=Bp);var r=t;if(Op.enableAttributeDashCased)for(var i in r={},t){r[nf(i)]=t[i]}Op.styleValueRegistry.processProperties(this,r,n),e.dirty=!0},e.prototype.setAttribute=function(e,n,r,i){void 0===r&&(r=!1),void 0===i&&(i=!0),Op.enableAttributeDashCased&&(e=nf(e)),$(n)||(r||n!==this.attributes[e])&&(this.internalSetAttribute(e,n,{memoize:i}),t.prototype.setAttribute.call(this,e,n))},e.prototype.internalSetAttribute=function(t,e,n){var r;void 0===n&&(n={});var i=this.renderable,o=this.attributes[t],a=this.parsedStyle[t];Op.styleValueRegistry.processProperties(this,((r={})[t]=e,r),n),i.dirty=!0;var s=this.parsedStyle[t];this.isConnected&&(jp.relatedNode=this,jp.prevValue=o,jp.newValue=e,jp.attrName=t,jp.prevParsedValue=a,jp.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(jp):(jp.target=this,this.ownerDocument.defaultView.dispatchEvent(jp,!0))),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,o,e,a,s)},e.prototype.getBBox=function(){var t=this.getBounds(),e=Ae(t.getMin(),2),n=e[0],r=e[1],i=Ae(t.getMax(),2),o=i[0],a=i[1];return new Pu(n,r,o-n,a-r)},e.prototype.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Op.sceneGraphService.setOrigin(this,uu(t,e,n)),this},e.prototype.getOrigin=function(){return Op.sceneGraphService.getOrigin(this)},e.prototype.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Op.sceneGraphService.setPosition(this,uu(t,e,n)),this},e.prototype.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Op.sceneGraphService.setLocalPosition(this,uu(t,e,n)),this},e.prototype.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Op.sceneGraphService.translate(this,uu(t,e,n)),this},e.prototype.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Op.sceneGraphService.translateLocal(this,uu(t,e,n)),this},e.prototype.getPosition=function(){return Op.sceneGraphService.getPosition(this)},e.prototype.getLocalPosition=function(){return Op.sceneGraphService.getLocalPosition(this)},e.prototype.scale=function(t,e,n){return this.scaleLocal(t,e,n)},e.prototype.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=uu(t,e=e||t,n=n||t)),Op.sceneGraphService.scaleLocal(this,t),this},e.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=uu(t,e=e||t,n=n||t)),Op.sceneGraphService.setLocalScale(this,t),this},e.prototype.getLocalScale=function(){return Op.sceneGraphService.getLocalScale(this)},e.prototype.getScale=function(){return Op.sceneGraphService.getScale(this)},e.prototype.getEulerAngles=function(){return hu(Ae(du(Ht(),Op.sceneGraphService.getWorldTransform(this)),3)[2])},e.prototype.getLocalEulerAngles=function(){return hu(Ae(du(Ht(),Op.sceneGraphService.getLocalRotation(this)),3)[2])},e.prototype.setEulerAngles=function(t){return Op.sceneGraphService.setEulerAngles(this,0,0,t),this},e.prototype.setLocalEulerAngles=function(t){return Op.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},e.prototype.rotateLocal=function(t,e,n){return y(e)&&y(n)?Op.sceneGraphService.rotateLocal(this,0,0,t):Op.sceneGraphService.rotateLocal(this,t,e,n),this},e.prototype.rotate=function(t,e,n){return y(e)&&y(n)?Op.sceneGraphService.rotate(this,0,0,t):Op.sceneGraphService.rotate(this,t,e,n),this},e.prototype.setRotation=function(t,e,n,r){return Op.sceneGraphService.setRotation(this,t,e,n,r),this},e.prototype.setLocalRotation=function(t,e,n,r){return Op.sceneGraphService.setLocalRotation(this,t,e,n,r),this},e.prototype.setLocalSkew=function(t,e){return Op.sceneGraphService.setLocalSkew(this,t,e),this},e.prototype.getRotation=function(){return Op.sceneGraphService.getRotation(this)},e.prototype.getLocalRotation=function(){return Op.sceneGraphService.getLocalRotation(this)},e.prototype.getLocalSkew=function(){return Op.sceneGraphService.getLocalSkew(this)},e.prototype.getLocalTransform=function(){return Op.sceneGraphService.getLocalTransform(this)},e.prototype.getWorldTransform=function(){return Op.sceneGraphService.getWorldTransform(this)},e.prototype.setLocalTransform=function(t){return Op.sceneGraphService.setLocalTransform(this,t),this},e.prototype.resetLocalTransform=function(){Op.sceneGraphService.resetLocalTransform(this)},e.prototype.getAnimations=function(){return this.activeAnimations},e.prototype.animate=function(t,e){var n,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return r?r.play(this,t,e):null},e.prototype.isVisible=function(){var t,e;return Op.enableCSSParsing?"visible"===(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility):"hidden"!==(null===(e=this.parsedStyle)||void 0===e?void 0:e.visibility)},Object.defineProperty(e.prototype,"interactive",{get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"},enumerable:!1,configurable:!0}),e.prototype.isInteractive=function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)},e.prototype.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},e.prototype.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,_e([],Ae(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))+1),this},e.prototype.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,_e([],Ae(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))-1),this},e.prototype.getConfig=function(){return this.config},e.prototype.attr=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=Ae(e,2),i=r[0],o=r[1];return i?w(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===e.length?(this.setAttribute(i,o),this):this.attributes[i]:this.attributes},e.prototype.getMatrix=function(t){var e=t||this.getWorldTransform(),n=Ae(Tt(Ht(),e),2),r=n[0],i=n[1],o=Ae(Pt(Ht(),e),2),a=o[0],s=o[1],c=Ct(ue(),e),l=Ae(du(Ht(),c),3),u=l[0],f=l[2];return pu(u||f,r,i,a,s)},e.prototype.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},e.prototype.setMatrix=function(t){var e=Ae(gu(t),5),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4];this.setEulerAngles(a).setPosition(n,r).setLocalScale(i,o)},e.prototype.setLocalMatrix=function(t){var e=Ae(gu(t),5),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4];this.setLocalEulerAngles(a).setLocalPosition(n,r).setLocalScale(i,o)},e.prototype.show=function(){Op.enableCSSParsing?this.style.visibility="visible":this.forEach((function(t){t.style.visibility="visible"}))},e.prototype.hide=function(){Op.enableCSSParsing?this.style.visibility="hidden":this.forEach((function(t){t.style.visibility="hidden"}))},e.prototype.getCount=function(){return this.childElementCount},e.prototype.getParent=function(){return this.parentElement},e.prototype.getChildren=function(){return this.children},e.prototype.getFirst=function(){return this.firstElementChild},e.prototype.getLast=function(){return this.lastElementChild},e.prototype.getChildByIndex=function(t){return this.children[t]||null},e.prototype.add=function(t,e){return this.appendChild(t,e)},e.prototype.set=function(t,e){this.config[t]=e},e.prototype.get=function(t){return this.config[t]},e.prototype.moveTo=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},e.prototype.move=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},e.prototype.setZIndex=function(t){return this.style.zIndex=t,this},e}(Pp),zp=function(t){function e(e){return void 0===e&&(e={}),t.call(this,we({type:tu.CIRCLE},e))||this}return xe(e,t),e}(Fp),Gp=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=Me(e,["style"]);return(n=t.call(this,we({style:(Op.enableCSSParsing,we({},r))},i))||this).isCustomElement=!0,n}return xe(e,t),e}(Fp),Wp=function(t){function e(e){return void 0===e&&(e={}),t.call(this,we({type:tu.ELLIPSE},e))||this}return xe(e,t),e}(Fp),$p=function(t){function e(e){return void 0===e&&(e={}),t.call(this,we({type:tu.GROUP},e))||this}return xe(e,t),e}(Fp),Hp=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=Me(e,["style"]);return(n=t.call(this,we({type:tu.HTML,style:Op.enableCSSParsing?we({x:"",y:"",width:"auto",height:"auto",innerHTML:""},r):we({},r)},i))||this).cullable.enable=!1,n}return xe(e,t),e.prototype.getDomElement=function(){return this.parsedStyle.$el},e.prototype.getBoundingClientRect=function(){if(this.parsedStyle.$el)return this.parsedStyle.$el.getBoundingClientRect();var t=this.parsedStyle,e=t.x,n=t.y,r=t.width,i=t.height;return new Pu(e,n,r,i)},e.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},e.prototype.getBounds=function(){var t,e,n=this.getBoundingClientRect(),r=null===(e=null===(t=this.ownerDocument)||void 0===t?void 0:t.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect(),i=new Ou,o=n.left-((null==r?void 0:r.left)||0),a=n.top-((null==r?void 0:r.top)||0);return i.setMinMax([o,a,0],[o+n.width,a+n.height,0]),i},e.prototype.getLocalBounds=function(){if(this.parentNode){var t=gt(lt(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!Ou.isEmpty(e)){var n=new Ou;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},e}(Fp),Vp=function(t){function e(e){return void 0===e&&(e={}),t.call(this,we({type:tu.IMAGE},e))||this}return xe(e,t),e}(Fp),Yp=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=Me(e,["style"]);(n=t.call(this,we({type:tu.LINE,style:we({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},r)},i))||this).markerStartAngle=0,n.markerEndAngle=0;var o=n.parsedStyle,a=o.markerStart,s=o.markerEnd;return a&&Cp(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),s&&Cp(s)&&(n.markerEndAngle=s.getLocalEulerAngles(),n.appendChild(s)),n.transformMarker(!0),n.transformMarker(!1),n}return xe(e,t),e.prototype.attributeChangedCallback=function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Cp(r)&&(this.markerStartAngle=0,r.remove()),i&&Cp(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&Cp(r)&&(this.markerEndAngle=0,r.remove()),i&&Cp(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))},e.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=e.x1,s=e.x2,c=e.y1,l=e.y2,u=t?n:r;if(u&&Cp(u)){var f,h,d,p,g,m,y;t?(p=a,g=c,h=s-a,d=l-c,m=i||0,y=this.markerStartAngle):(p=s,g=l,h=a-s,d=c-l,m=o||0,y=this.markerEndAngle),f=Math.atan2(d,h),u.setLocalEulerAngles(180*f/Math.PI+y),u.setLocalPosition(p+Math.cos(f)*m,g+Math.sin(f)*m)}},e.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=Wl(n.x1,n.y1,n.x2,n.y2,t),i=r.x,o=r.y,a=re(Ht(),Ut(i,o,0),e?this.getWorldTransform():this.getLocalTransform());return new Tu(a[0],a[1])},e.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},e.prototype.getTotalLength=function(){var t=this.parsedStyle;return Gl(t.x1,t.y1,t.x2,t.y2)},e}(Fp),Up=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=Me(e,["style"]);(n=t.call(this,we({type:tu.PATH,style:Op.enableCSSParsing?we({d:"",miterLimit:""},r):we({},r),initialParsedStyle:Op.enableCSSParsing?null:{miterLimit:4,d:we({},Mf)}},i))||this).markerStartAngle=0,n.markerEndAngle=0,n.markerMidList=[];var o=n.parsedStyle,a=o.markerStart,s=o.markerEnd,c=o.markerMid;return a&&Cp(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),c&&Cp(c)&&n.placeMarkerMid(c),s&&Cp(s)&&(n.markerEndAngle=s.getLocalEulerAngles(),n.appendChild(s)),n.transformMarker(!0),n.transformMarker(!1),n}return xe(e,t),e.prototype.attributeChangedCallback=function(t,e,n,r,i){"d"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Cp(r)&&(this.markerStartAngle=0,r.remove()),i&&Cp(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Cp(r)&&(this.markerEndAngle=0,r.remove()),i&&Cp(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},e.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=t?n:r;if(a&&Cp(a)){var s,c,l,u,f,h,d;if(t){var p=Ae(this.getStartTangent(),2),g=p[0];u=(m=p[1])[0],f=m[1],c=g[0]-m[0],l=g[1]-m[1],h=i||0,d=this.markerStartAngle}else{var m,y=Ae(this.getEndTangent(),2);g=y[0];u=(m=y[1])[0],f=m[1],c=g[0]-m[0],l=g[1]-m[1],h=o||0,d=this.markerEndAngle}s=Math.atan2(l,c),a.setLocalEulerAngles(180*s/Math.PI+d),a.setLocalPosition(u+Math.cos(s)*h,f+Math.sin(s)*h)}},e.prototype.placeMarkerMid=function(t){var e=this.parsedStyle.d.segments;if(this.markerMidList.forEach((function(t){t.remove()})),t&&Cp(t))for(var n=1;n<e.length-1;n++){var r=Ae(e[n].currentPoint,2),i=r[0],o=r[1],a=1===n?t:t.cloneNode(!0);this.markerMidList.push(a),this.appendChild(a),a.setLocalPosition(i,o)}},e.prototype.getTotalLength=function(){return rh(this)},e.prototype.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=function(t,e,n){return ln(t,e,we(we({},n),{bbox:!1,length:!0})).point}(this.parsedStyle.d.absolutePath,t),r=n.x,i=n.y,o=re(Ht(),Ut(r,i,0),e?this.getWorldTransform():this.getLocalTransform());return new Tu(o[0],o[1])},e.prototype.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*rh(this),e)},e.prototype.getStartTangent=function(){var t=this.parsedStyle.d.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e},e.prototype.getEndTangent=function(){var t=this.parsedStyle.d.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,o=t[e-1].endTangent;n=[],o?(n.push([i[0]-o[0],i[1]-o[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n},e}(Fp),qp=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=Me(e,["style"]);(n=t.call(this,we({type:tu.POLYGON,style:Op.enableCSSParsing?we({points:"",miterLimit:"",isClosed:!0},r):we({},r),initialParsedStyle:Op.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},i))||this).markerStartAngle=0,n.markerEndAngle=0,n.markerMidList=[];var o=n.parsedStyle,a=o.markerStart,s=o.markerEnd,c=o.markerMid;return a&&Cp(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),c&&Cp(c)&&n.placeMarkerMid(c),s&&Cp(s)&&(n.markerEndAngle=s.getLocalEulerAngles(),n.appendChild(s)),n.transformMarker(!0),n.transformMarker(!1),n}return xe(e,t),e.prototype.attributeChangedCallback=function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Cp(r)&&(this.markerStartAngle=0,r.remove()),i&&Cp(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Cp(r)&&(this.markerEndAngle=0,r.remove()),i&&Cp(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},e.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=(e.points||{}).points,s=t?n:r;if(s&&Cp(s)&&a){var c,l,u,f,h,d,p;if(f=a[0][0],h=a[0][1],t)l=a[1][0]-a[0][0],u=a[1][1]-a[0][1],d=i||0,p=this.markerStartAngle;else{var g=a.length;this.parsedStyle.isClosed?(l=a[g-1][0]-a[0][0],u=a[g-1][1]-a[0][1]):(f=a[g-1][0],h=a[g-1][1],l=a[g-2][0]-a[g-1][0],u=a[g-2][1]-a[g-1][1]),d=o||0,p=this.markerEndAngle}c=Math.atan2(u,l),s.setLocalEulerAngles(180*c/Math.PI+p),s.setLocalPosition(f+Math.cos(c)*d,h+Math.sin(c)*d)}},e.prototype.placeMarkerMid=function(t){var e=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&Cp(t)&&e)for(var n=1;n<(this.parsedStyle.isClosed?e.length:e.length-1);n++){var r=e[n][0],i=e[n][1],o=1===n?t:t.cloneNode(!0);this.markerMidList.push(o),this.appendChild(o),o.setLocalPosition(r,i)}},e}(Fp),Xp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=Me(e,["style"]);return t.call(this,we({type:tu.POLYLINE,style:Op.enableCSSParsing?we({points:"",miterLimit:"",isClosed:!1},n):we({},n),initialParsedStyle:Op.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},r))||this}return xe(e,t),e.prototype.getTotalLength=function(){return this.parsedStyle.points.totalLength},e.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},e.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle.points,r=n.points,i=n.segments,o=0,a=0;i.forEach((function(e,n){t>=e[0]&&t<=e[1]&&(o=(t-e[0])/(e[1]-e[0]),a=n)}));var s=Wl(r[a][0],r[a][1],r[a+1][0],r[a+1][1],o),c=s.x,l=s.y,u=re(Ht(),Ut(c,l,0),e?this.getWorldTransform():this.getLocalTransform());return new Tu(u[0],u[1])},e.prototype.getStartTangent=function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.prototype.getEndTangent=function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},e}(qp),Kp=function(t){function e(e){return void 0===e&&(e={}),t.call(this,we({type:tu.RECT},e))||this}return xe(e,t),e}(Fp),Zp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=Me(e,["style"]);return t.call(this,we({type:tu.TEXT,style:Op.enableCSSParsing?we({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""},n):we({fill:"black"},n)},r))||this}return xe(e,t),e.prototype.getComputedTextLength=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0},e.prototype.getLineBoundingRects=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]},e.prototype.isOverflowing=function(){return!!this.parsedStyle.isOverflowing},e}(Fp),Qp=function(){function t(){this.registry={},this.define(tu.CIRCLE,zp),this.define(tu.ELLIPSE,Wp),this.define(tu.RECT,Kp),this.define(tu.IMAGE,Vp),this.define(tu.LINE,Yp),this.define(tu.GROUP,$p),this.define(tu.PATH,Up),this.define(tu.POLYGON,qp),this.define(tu.POLYLINE,Xp),this.define(tu.TEXT,Zp),this.define(tu.HTML,Hp)}return t.prototype.define=function(t,e){this.registry[t]=e},t.prototype.get=function(t){return this.registry[t]},t}(),Jp=function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,o=t.syntax;Op.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:o})},tg=function(t){function e(){var e=t.call(this)||this;e.defaultView=null,e.ownerDocument=null,e.nodeName="document";try{e.timeline=new Op.AnimationTimeline(e)}catch(t){}var n={};return zh.forEach((function(t){var e=t.n,r=t.inh,i=t.d;r&&i&&(n[e]=tf(i)?i(tu.GROUP):i)})),e.documentElement=new $p({id:"g-root",style:n}),e.documentElement.ownerDocument=e,e.documentElement.parentNode=e,e.childNodes=[e.documentElement],e}return xe(e,t),Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),e.prototype.createElement=function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?Zp:$p);var r=new n(e);return r.ownerDocument=this,r},e.prototype.createElementNS=function(t,e,n){return this.createElement(e,n)},e.prototype.cloneNode=function(t){throw new Error(Cu)},e.prototype.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}},e.prototype.elementsFromBBox=function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),o=[];return i.forEach((function(t){var e=t.displayObject,n=e.parsedStyle.pointerEvents,r=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(void 0===n?"auto":n);(!r||r&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&o.push(e)})),o.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),o},e.prototype.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height;if(r<0||i<0||r>a||i>s)return null;var c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,f=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]}).picked;return f&&f[0]||this.documentElement},e.prototype.elementFromPoint=function(t,e){return Ee(this,void 0,void 0,(function(){var n,r,i,o,a,s,c,l,u,f;return ke(this,(function(h){switch(h.label){case 0:return n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height,r<0||i<0||r>a||i>s?[2,null]:(c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]})]);case 1:return[2,(f=h.sent().picked)&&f[0]||this.documentElement]}}))}))},e.prototype.elementsFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height;if(r<0||i<0||r>a||i>s)return[];var c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,f=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]}).picked;return f[f.length-1]!==this.documentElement&&f.push(this.documentElement),f},e.prototype.elementsFromPoint=function(t,e){return Ee(this,void 0,void 0,(function(){var n,r,i,o,a,s,c,l,u,f;return ke(this,(function(h){switch(h.label){case 0:return n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height,r<0||i<0||r>a||i>s?[2,[]]:(c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]})]);case 1:return(f=h.sent().picked)[f.length-1]!==this.documentElement&&f.push(this.documentElement),[2,f]}}))}))},e.prototype.appendChild=function(t,e){throw new Error(Nu)},e.prototype.insertBefore=function(t,e){throw new Error(Nu)},e.prototype.removeChild=function(t,e){throw new Error(Nu)},e.prototype.replaceChild=function(t,e,n){throw new Error(Nu)},e.prototype.append=function(){throw new Error(Nu)},e.prototype.prepend=function(){throw new Error(Nu)},e.prototype.getElementById=function(t){return this.documentElement.getElementById(t)},e.prototype.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},e.prototype.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},e.prototype.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},e.prototype.querySelector=function(t){return this.documentElement.querySelector(t)},e.prototype.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},e.prototype.find=function(t){return this.documentElement.find(t)},e.prototype.findAll=function(t){return this.documentElement.findAll(t)},e}(ip),eg=function(){function t(t){this.strategies=t}return t.prototype.apply=function(e){var n=e.camera,r=e.renderingService,i=e.renderingContext,o=this.strategies;r.hooks.cull.tap(t.tag,(function(t){if(t){var e=t.cullable;return 0===o.length?e.visible=i.unculledEntities.indexOf(t.entity)>-1:e.visible=o.every((function(e){return e.isVisible(n,t)})),!t.isCulled()&&t.isVisible()?t:(t.dispatchEvent(new np(sp.CULLED)),null)}return t})),r.hooks.afterRender.tap(t.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},t.tag="Culling",t}(),ng=function(){function t(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new tp(null),this.rootWheelEvent=new ep(null),this.onPointerMove=function(e){var n,r,i,o,a=null===(o=null===(i=t.context.renderingContext.root)||void 0===i?void 0:i.ownerDocument)||void 0===o?void 0:o.defaultView;if(!a.supportsTouchEvents||"touch"!==e.pointerType){var s=t.normalizeToPointerEvent(e,a);try{for(var c=Se(s),l=c.next();!l.done;l=c.next()){var u=l.value,f=t.bootstrapEvent(t.rootPointerEvent,u,a,e);t.context.eventService.mapEvent(f)}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}t.setCursor(t.context.eventService.cursor)}},this.onClick=function(e){var n,r,i,o,a=null===(o=null===(i=t.context.renderingContext.root)||void 0===i?void 0:i.ownerDocument)||void 0===o?void 0:o.defaultView,s=t.normalizeToPointerEvent(e,a);try{for(var c=Se(s),l=c.next();!l.done;l=c.next()){var u=l.value,f=t.bootstrapEvent(t.rootPointerEvent,u,a,e);t.context.eventService.mapEvent(f)}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}t.setCursor(t.context.eventService.cursor)}}return t.prototype.apply=function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler((function(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null})),r.hooks.pointerWheel.tap(t.tag,(function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)})),r.hooks.pointerDown.tap(t.tag,(function(t){var e,r;if(!i.supportsTouchEvents||"touch"!==t.pointerType){var o=n.normalizeToPointerEvent(t,i);if(n.autoPreventDefault&&o[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();try{for(var a=Se(o),s=a.next();!s.done;s=a.next()){var c=s.value,l=n.bootstrapEvent(n.rootPointerEvent,c,i,t);n.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){var e,r;if(!i.supportsTouchEvents||"touch"!==t.pointerType){var o=n.context.contextService.getDomElement(),a="outside";try{a=o&&t.target&&t.target!==o&&o.contains&&!o.contains(t.target)?"outside":""}catch(t){}var s=n.normalizeToPointerEvent(t,i);try{for(var c=Se(s),l=c.next();!l.done;l=c.next()){var u=l.value,f=n.bootstrapEvent(n.rootPointerEvent,u,i,t);f.type+=a,n.context.eventService.mapEvent(f)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerMove.tap(t.tag,this.onPointerMove),r.hooks.pointerOver.tap(t.tag,this.onPointerMove),r.hooks.pointerOut.tap(t.tag,this.onPointerMove),r.hooks.click.tap(t.tag,this.onClick),r.hooks.pointerCancel.tap(t.tag,(function(t){var e,r,o=n.normalizeToPointerEvent(t,i);try{for(var a=Se(o),s=a.next();!s.done;s=a.next()){var c=s.value,l=n.bootstrapEvent(n.rootPointerEvent,c,i,t);n.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}))},t.prototype.getViewportXY=function(t){var e,n,r=t.offsetX,i=t.offsetY,o=t.clientX,a=t.clientY;if(!this.context.config.supportsCSSTransform||y(r)||y(i)){var s=this.context.eventService.client2Viewport(new Tu(o,a));e=s.x,n=s.y}else e=r,n=i;return{x:e,y:n}},t.prototype.bootstrapEvent=function(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var i=this.getViewportXY(e),o=i.x,a=i.y;t.viewport.x=o,t.viewport.y=a;var s=this.context.eventService.viewport2Canvas(t.viewport),c=s.x,l=s.y;return t.canvas.x=c,t.canvas.y=l,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=gd[t.type]||t.type),t},t.prototype.normalizeWheelEvent=function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.getViewportXY(t),r=n.x,i=n.y;e.viewport.x=r,e.viewport.y=i;var o=this.context.eventService.viewport2Canvas(e.viewport),a=o.x,s=o.y;return e.canvas.x=a,e.canvas.y=s,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},t.prototype.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=md.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null},t.prototype.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},t.prototype.normalizeToPointerEvent=function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;r<t.changedTouches.length;r++){var i=t.changedTouches[r];$(i.button)&&(i.button=0),$(i.buttons)&&(i.buttons=1),$(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),$(i.width)&&(i.width=i.radiusX||1),$(i.height)&&(i.height=i.radiusY||1),$(i.tiltX)&&(i.tiltX=0),$(i.tiltY)&&(i.tiltY=0),$(i.pointerType)&&(i.pointerType="touch"),$(i.pointerId)&&(i.pointerId=i.identifier||0),$(i.pressure)&&(i.pressure=i.force||.5),$(i.twist)&&(i.twist=0),$(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;$(o.isPrimary)&&(o.isPrimary=!0),$(o.width)&&(o.width=1),$(o.height)&&(o.height=1),$(o.tiltX)&&(o.tiltX=0),$(o.tiltY)&&(o.tiltY=0),$(o.pointerType)&&(o.pointerType="mouse"),$(o.pointerId)&&(o.pointerId=1),$(o.pressure)&&(o.pressure=.5),$(o.twist)&&(o.twist=0),$(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t.tag="Event",t}(),rg=[tu.CIRCLE,tu.ELLIPSE,tu.IMAGE,tu.RECT,tu.LINE,tu.POLYLINE,tu.POLYGON,tu.TEXT,tu.PATH,tu.HTML],ig=function(){function t(){}return t.prototype.isVisible=function(t,e){var n,r,i=e.cullable;if(!i.enable)return!0;var o=e.getRenderBounds();if(Ou.isEmpty(o))return!1;var a=t.getFrustum(),s=null===(r=null===(n=e.parentNode)||void 0===n?void 0:n.cullable)||void 0===r?void 0:r.visibilityPlaneMask;return i.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,o,s||Mu.INDETERMINATE,a.planes),i.visible=i.visibilityPlaneMask!==Mu.OUTSIDE,i.visible},t.prototype.computeVisibilityWithPlaneMask=function(t,e,n,r){if(n===Mu.OUTSIDE||n===Mu.INSIDE)return n;for(var i=Mu.INSIDE,o=rg.indexOf(t.nodeName)>-1,a=0,s=r.length;a<s;++a){var c=1<<a;if(n&c&&(!o||4!==a&&5!==a)){var l=r[a],u=l.normal,f=l.distance;if(te(u,e.getPositiveFarPoint(r[a]))+f<0)return Mu.OUTSIDE;te(u,e.getNegativeFarPoint(r[a]))+f<0&&(i|=c)}}return i},t}(),og=function(){function t(){this.toSync=new Set,this.isFirstTimeRendering=!0,this.syncing=!1}return t.prototype.apply=function(e){var n,r=this,i=e.renderingService,o=e.renderingContext,a=e.rBushRoot,s=o.root.ownerDocument.defaultView;this.rBush=a;var c=function(t){t.target.renderable.dirty=!0,i.dirtify()},l=function(t){var e=t.detail.affectChildren,n=t.target;e&&n.forEach((function(t){r.toSync.add(t)}));for(var o=n;o;)o.renderable&&r.toSync.add(o),o=o.parentElement;i.dirtify()},u=function(t){var e=t.target;Op.enableCSSParsing&&Op.styleValueRegistry.recalc(e),Op.sceneGraphService.dirtifyToRoot(e),i.dirtify()},f=function(t){var e=t.target,n=e.rBushNode;n.aabb&&r.rBush.remove(n.aabb),r.toSync.delete(e),Op.sceneGraphService.dirtifyToRoot(e),i.dirtify()};i.hooks.init.tap(t.tag,(function(){s.addEventListener(sp.MOUNTED,u),s.addEventListener(sp.UNMOUNTED,f),s.addEventListener(sp.ATTR_MODIFIED,c),s.addEventListener(sp.BOUNDS_CHANGED,l)})),i.hooks.destroy.tap(t.tag,(function(){s.removeEventListener(sp.MOUNTED,u),s.removeEventListener(sp.UNMOUNTED,f),s.removeEventListener(sp.ATTR_MODIFIED,c),s.removeEventListener(sp.BOUNDS_CHANGED,l),r.toSync.clear()}));var h=null!==(n=Op.globalThis.requestIdleCallback)&&void 0!==n?n:Ad.bind(Op.globalThis);i.hooks.endFrame.tap(t.tag,(function(){r.isFirstTimeRendering?(r.isFirstTimeRendering=!1,r.syncing=!0,h((function(){r.syncRTree(!0)}))):r.syncRTree()}))},t.prototype.syncRTree=function(t){var e=this;if(void 0===t&&(t=!1),t||!this.syncing&&0!==this.toSync.size){this.syncing=!0;var n=[];Array.from(this.toSync).filter((function(t){return t.isConnected})).forEach((function(t){var r=t.rBushNode;r&&r.aabb&&e.rBush.remove(r.aabb);var i=t.getRenderBounds();if(i){var o=Ae(i.getMin(),2),a=o[0],s=o[1],c=Ae(i.getMax(),2),l=c[0],u=c[1];r.aabb||(r.aabb={}),r.aabb.displayObject=t,r.aabb.minX=a,r.aabb.minY=s,r.aabb.maxX=l,r.aabb.maxY=u}r.aabb&&(isNaN(r.aabb.maxX)||isNaN(r.aabb.maxX)||isNaN(r.aabb.minX)||isNaN(r.aabb.minY)||n.push(r.aabb))})),this.rBush.load(n),n.length=0,this.toSync.clear(),this.syncing=!1}},t.tag="Prepare",t}();!function(t){t.READY="ready",t.BEFORE_RENDER="beforerender",t.RERENDER="rerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.RESIZE="resize",t.DIRTY_RECTANGLE="dirtyrectangle",t.RENDERER_CHANGED="rendererchanged"}(Np||(Np={}));var ag=new np(sp.MOUNTED),sg=new np(sp.UNMOUNTED),cg=new np(Np.BEFORE_RENDER),lg=new np(Np.RERENDER),ug=new np(Np.AFTER_RENDER),fg=function(t){function e(e){var n=t.call(this)||this;n.Element=Fp,n.inited=!1,n.context={},n.document=new tg,n.document.defaultView=n,n.customElements=new Qp;var r=e.container,i=e.canvas,o=e.offscreenCanvas,a=e.width,s=e.height,c=e.devicePixelRatio,l=e.renderer,u=e.background,f=e.cursor,h=e.document,d=e.requestAnimationFrame,p=e.cancelAnimationFrame,g=e.createImage,m=e.supportsPointerEvents,y=e.supportsTouchEvents,v=e.supportsCSSTransform,b=e.supportsMutipleCanvasesInOneContainer,x=e.useNativeClickEvent,w=e.alwaysTriggerPointerEventOnCanvas,M=e.isTouchEvent,O=e.isMouseEvent;b||function(t,e){if(t){var n="string"==typeof t?t:t.id||ld++;cd[n]&&cd[n].destroy(),cd[n]=e}}(r,n);var E=a,k=s,S=c;return i&&(S=(S=c||ud&&window.devicePixelRatio||1)>=1?Math.ceil(S):1,E=a||function(t){var e=pd(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/S,k=s||function(t){var e=pd(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/S),o&&(Op.offscreenCanvas=o),n.devicePixelRatio=S,n.requestAnimationFrame=null!=d?d:Ad.bind(Op.globalThis),n.cancelAnimationFrame=null!=p?p:_d.bind(Op.globalThis),n.supportsTouchEvents=null!=y?y:"ontouchstart"in Op.globalThis,n.supportsPointerEvents=null!=m?m:!!Op.globalThis.PointerEvent,n.isTouchEvent=null!=M?M:function(t){return n.supportsTouchEvents&&t instanceof Op.globalThis.TouchEvent},n.isMouseEvent=null!=O?O:function(t){return!Op.globalThis.MouseEvent||t instanceof Op.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof Op.globalThis.PointerEvent))},n.initRenderingContext({container:r,canvas:i,width:E,height:k,renderer:l,offscreenCanvas:o,devicePixelRatio:S,cursor:f||"default",background:u||"transparent",createImage:g,document:h,supportsCSSTransform:v,useNativeClickEvent:x,alwaysTriggerPointerEventOnCanvas:w}),n.initDefaultCamera(E,k,l.clipSpaceNearZ),n.initRenderer(l,!0),n}return xe(e,t),e.prototype.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},e.prototype.initDefaultCamera=function(t,e,n){var r=this,i=new Op.CameraContribution;i.clipSpaceNearZ=n,i.setType(ku.EXPLORING,Su.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(Du,(function(){r.context.renderingContext.renderReasons.add(Zd.CAMERA_CHANGED)})),this.context.camera=i},e.prototype.getConfig=function(){return this.context.config},e.prototype.getRoot=function(){return this.document.documentElement},e.prototype.getCamera=function(){return this.context.camera},e.prototype.getContextService=function(){return this.context.contextService},e.prototype.getEventService=function(){return this.context.eventService},e.prototype.getRenderingService=function(){return this.context.renderingService},e.prototype.getRenderingContext=function(){return this.context.renderingContext},e.prototype.getStats=function(){return this.getRenderingService().getStats()},Object.defineProperty(e.prototype,"ready",{get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),e.prototype.destroy=function(t,e){(void 0===t&&(t=!0),void 0===e&&(e=!1),e||this.dispatchEvent(new np(Np.BEFORE_DESTROY)),this.frameId)&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var n=this.getRoot();this.unmountChildren(n),t&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),t&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),e||this.dispatchEvent(new np(Np.AFTER_DESTROY))},e.prototype.changeSize=function(t,e){this.resize(t,e)},e.prototype.resize=function(t,e){var n=this.context.config;n.width=t,n.height=e,this.getContextService().resize(t,e);var r=this.context.camera,i=r.getProjectionMode();r.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),i===Au.ORTHOGRAPHIC?r.setOrthographic(t/-2,t/2,e/2,e/-2,r.getNear(),r.getFar()):r.setAspect(t/e),this.dispatchEvent(new np(Np.RESIZE,{width:t,height:e}))},e.prototype.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},e.prototype.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},e.prototype.removeChild=function(t){return this.document.documentElement.removeChild(t)},e.prototype.removeChildren=function(){this.document.documentElement.removeChildren()},e.prototype.destroyChildren=function(){this.document.documentElement.destroyChildren()},e.prototype.render=function(){var t=this;this.dispatchEvent(cg),this.getRenderingService().render(this.getConfig(),(function(){t.dispatchEvent(lg)})),this.dispatchEvent(ug)},e.prototype.run=function(){var t=this,e=function(){t.render(),t.frameId=t.requestAnimationFrame(e)};e()},e.prototype.initRenderer=function(t,e){var n=this;if(void 0===e&&(e=!1),!t)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new nu,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new ng,new og,new eg([new ig])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(we(we({},Op),this.context)),this.context.renderingService=new cp(Op,this.context),this.context.eventService=new op(Op,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,e,!0)):this.context.contextService.initAsync().then((function(){n.initRenderingService(t,e)}))},e.prototype.initRenderingService=function(t,e,n){var r=this;void 0===e&&(e=!1),void 0===n&&(n=!1),this.context.renderingService.init((function(){r.inited=!0,e?(n?r.requestAnimationFrame((function(){r.dispatchEvent(new np(Np.READY))})):r.dispatchEvent(new np(Np.READY)),r.readyPromise&&r.resolveReadyPromise()):r.dispatchEvent(new np(Np.RENDERER_CHANGED)),e||r.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),r.mountChildren(r.getRoot()),t.getConfig().enableAutoRendering&&r.run()}))},e.prototype.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(Op)}))},e.prototype.setRenderer=function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),_e([],Ae(null==n?void 0:n.getPlugins()),!1).reverse().forEach((function(t){t.destroy(Op)})),this.initRenderer(t)}},e.prototype.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},e.prototype.unmountChildren=function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(sg):(sg.target=t,this.dispatchEvent(sg,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},e.prototype.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(ag):(ag.target=t,this.dispatchEvent(ag,!0))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName),t.childNodes.forEach((function(t){e.mountChildren(t)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()},e.prototype.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},e.prototype.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},e.prototype.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},e.prototype.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},e.prototype.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},e.prototype.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},e}(rp),hg=function(t){function e(){var e=t.apply(this,_e([],Ae(arguments),!1))||this;return e.landmarks=[],e}return xe(e,t),e.prototype.rotate=function(t,e,n){if(this.relElevation=lu(e),this.relAzimuth=lu(t),this.relRoll=lu(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===ku.EXPLORING){var r=fe(ue(),[1,0,0],fu((this.rotateWorld?1:-1)*this.relElevation)),i=fe(ue(),[0,1,0],fu((this.rotateWorld?1:-1)*this.relAzimuth)),o=fe(ue(),[0,0,1],fu(this.relRoll)),a=he(ue(),i,r);a=he(ue(),a,o);var s=Lt(lt(),a);vt(this.matrix,this.matrix,[0,0,-this.distance]),yt(this.matrix,this.matrix,s),vt(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===ku.ORBITING||this.type===ku.EXPLORING?this._getPosition():this.type===ku.TRACKING&&this._getFocalPoint(),this._update(),this},e.prototype.pan=function(t,e){var n=uu(t,e,0),r=Vt(this.position);return Kt(r,r,Qt(Ht(),this.right,n[0])),Kt(r,r,Qt(Ht(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this},e.prototype.dolly=function(t){var e=this.forward,n=Vt(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===ku.ORBITING||this.type===ku.EXPLORING?this._getDistance():this.type===ku.TRACKING&&Kt(this.focalPoint,n,this.distanceVector),this.triggerUpdate(),this},e.prototype.cancelLandmarkAnimation=function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)},e.prototype.createLandmark=function(t,e){var n,r,i,o;void 0===e&&(e={});var a=e.position,s=void 0===a?this.position:a,c=e.focalPoint,l=void 0===c?this.focalPoint:c,u=e.roll,f=e.zoom,h=new Op.CameraContribution;h.setType(this.type,void 0),h.setPosition(s[0],null!==(n=s[1])&&void 0!==n?n:this.position[1],null!==(r=s[2])&&void 0!==r?r:this.position[2]),h.setFocalPoint(l[0],null!==(i=l[1])&&void 0!==i?i:this.focalPoint[1],null!==(o=l[2])&&void 0!==o?o:this.focalPoint[2]),h.setRoll(null!=u?u:this.roll),h.setZoom(null!=f?f:this.zoom);var d={name:t,matrix:ut(h.getWorldTransform()),right:Vt(h.right),up:Vt(h.up),forward:Vt(h.forward),position:Vt(h.getPosition()),focalPoint:Vt(h.getFocalPoint()),distanceVector:Vt(h.getDistanceVector()),distance:h.getDistance(),dollyingStep:h.getDollyingStep(),azimuth:h.getAzimuth(),elevation:h.getElevation(),roll:h.getRoll(),relAzimuth:h.relAzimuth,relElevation:h.relElevation,relRoll:h.relRoll,zoom:h.getZoom()};return this.landmarks.push(d),d},e.prototype.gotoLandmark=function(t,e){var n=this;void 0===e&&(e={});var r=P(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=L(e)?{duration:e}:e,o=i.easing,a=void 0===o?"linear":o,s=i.duration,c=void 0===s?100:s,l=i.easingFunction,u=void 0===l?void 0:l,f=i.onfinish,h=void 0===f?void 0:f,d=i.onframe,p=void 0===d?void 0:d;if(0===c)return this.syncFromLandmark(r),void(h&&h());this.cancelLandmarkAnimation();var g,m=r.position,y=r.focalPoint,v=r.zoom,b=r.roll,x=u||Op.EasingFunction(a),w=function(){n.setFocalPoint(y),n.setPosition(m),n.setRoll(b),n.setZoom(v),n.computeMatrix(),n.triggerUpdate(),h&&h()},M=function(t){void 0===g&&(g=t);var e=t-g;if(e>c)w();else{var r,i,o=x(e/c),a=Ht(),s=Ht();ne(a,n.focalPoint,y,o),ne(s,n.position,m,o),i=n.roll*(1-o)+b*o,r=n.zoom*(1-o)+v*o,n.setFocalPoint(a),n.setPosition(s),n.setRoll(i),n.setZoom(r),ae(a,y)+ae(s,m)<=.01&&null==v&&null==b?w():(n.computeMatrix(),n.triggerUpdate(),e<c&&(p&&p(o),n.landmarkAnimationID=n.canvas.requestAnimationFrame(M)))}};this.canvas.requestAnimationFrame(M)}},e.prototype.syncFromLandmark=function(t){this.matrix=ft(this.matrix,t.matrix),this.right=qt(this.right,t.right),this.up=qt(this.up,t.up),this.forward=qt(this.forward,t.forward),this.position=qt(this.position,t.position),this.focalPoint=qt(this.focalPoint,t.focalPoint),this.distanceVector=qt(this.distanceVector,t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance,this.zoom=t.zoom},e}(zu);Op.CameraContribution=hg;var dg=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.currentTime=r,o.timelineTime=i,o.target=n,o.type="finish",o.bubbles=!1,o.currentTarget=n,o.defaultPrevented=!1,o.eventPhase=o.AT_TARGET,o.timeStamp=Date.now(),o.currentTime=r,o.timelineTime=i,o}return xe(e,t),e}(Qd),pg=0,gg=function(){function t(t,e){var n;this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=t,t.animation=this,this.timeline=e,this.id="".concat(pg++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null===(n=this.effect)||void 0===n?void 0:n.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}return Object.defineProperty(t.prototype,"pending",{get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playState",{get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ready",{get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise((function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(new Error)}})),this.pending||this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"finished",{get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise((function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(new Error)}})),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentTime",{get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){var e;t=Number(t),isNaN(t)||(this.timeline.restart(),this._paused||null===this._startTime||(this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate),this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this)))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"startTime",{get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),t=Number(t),isNaN(t))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_isFinished",{get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"totalDuration",{get:function(){return this._totalDuration},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_needsTick",{get:function(){return this.pending||"running"===this.playState||!this._finishedFlag},enumerable:!1,configurable:!0}),t.prototype.updatePromises=function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,this.readyPromise||this.finishedPromise},t.prototype.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()},t.prototype.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()},t.prototype.finish=function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},t.prototype.cancel=function(){var t=this;if(this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var e=new dg(null,this,this.currentTime,null);setTimeout((function(){t.oncancel(e)}))}},t.prototype.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()},t.prototype.updatePlaybackRate=function(t){this.playbackRate=t},t.prototype.targetAnimations=function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()},t.prototype.markTarget=function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)},t.prototype.unmarkTarget=function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)},t.prototype.tick=function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))},t.prototype.rewind=function(){if(this.playbackRate>=0)this.currentTime=0;else{if(!(this._totalDuration<1/0))throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}},t.prototype.persist=function(){throw new Error(Cu)},t.prototype.addEventListener=function(t,e,n){throw new Error(Cu)},t.prototype.removeEventListener=function(t,e,n){throw new Error(Cu)},t.prototype.dispatchEvent=function(t){throw new Error(Cu)},t.prototype.commitStyles=function(){throw new Error(Cu)},t.prototype.ensureAlive=function(){var t,e;this.playbackRate<0&&0===this.currentTime?this._inEffect=!!(null===(t=this.effect)||void 0===t?void 0:t.update(-1)):this._inEffect=!!(null===(e=this.effect)||void 0===e?void 0:e.update(this.currentTime)),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},t.prototype.tickCurrentTime=function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())},t.prototype.fireEvents=function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new dg(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 dg(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}},t}(),mg=.1,yg="function"==typeof Float32Array,vg=function(t,e){return 1-3*e+3*t},bg=function(t,e){return 3*e-6*t},xg=function(t){return 3*t},wg=function(t,e,n){return((vg(e,n)*t+bg(e,n))*t+xg(e))*t},Mg=function(t,e,n){return 3*vg(e,n)*t*t+2*bg(e,n)*t+xg(e)},Og=function(t,e,n,r){if(!(0<=t&&t<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=yg?new Float32Array(11):new Array(11),o=0;o<11;++o)i[o]=wg(o*mg,t,n);var a=function(e){for(var r=0,o=1;10!==o&&i[o]<=e;++o)r+=mg;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*mg,s=Mg(a,t,n);return s>=.001?function(t,e,n,r){for(var i=0;i<4;++i){var o=Mg(e,n,r);if(0===o)return e;e-=(wg(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=wg(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+mg,t,n)};return function(t){return 0===t||1===t?t:wg(a(t),e,r)}},Eg=function(t){return Math.pow(t,2)},kg=function(t){return Math.pow(t,3)},Sg=function(t){return Math.pow(t,4)},Ag=function(t){return Math.pow(t,5)},_g=function(t){return Math.pow(t,6)},Tg=function(t){return 1-Math.cos(t*Math.PI/2)},Pg=function(t){return 1-Math.sqrt(1-t*t)},Cg=function(t){return t*t*(3*t-2)},Ng=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)},Lg=function(t,e){void 0===e&&(e=[]);var n=Ae(e,2),r=n[0],i=void 0===r?1:r,o=n[1],a=void 0===o?.5:o,s=N(Number(i),1,10),c=N(Number(a),.1,2);return 0===t||1===t?t:-s*Math.pow(2,10*(t-1))*Math.sin((t-1-c/(2*Math.PI)*Math.asin(1/s))*(2*Math.PI)/c)},jg=function(t,e,n){void 0===e&&(e=[]);var r=Ae(e,4),i=r[0],o=void 0===i?1:i,a=r[1],s=void 0===a?100:a,c=r[2],l=void 0===c?10:c,u=r[3],f=void 0===u?0:u;o=N(o,.1,1e3),s=N(s,.1,1e3),l=N(l,.1,1e3),f=N(f,.1,1e3);var h=Math.sqrt(s/o),d=l/(2*Math.sqrt(s*o)),p=d<1?h*Math.sqrt(1-d*d):0,g=d<1?(d*h-f)/p:-f+h,m=n?n*t/1e3:t;return m=d<1?Math.exp(-m*d*h)*(1*Math.cos(p*m)+g*Math.sin(p*m)):(1+g*m)*Math.exp(-m*h),0===t||1===t?t:1-m},Rg=function(t,e){void 0===e&&(e=[]);var n=Ae(e,2),r=n[0],i=void 0===r?10:r;return("start"==n[1]?Math.ceil:Math.floor)(N(t,0,1)*i)/i},Ig=function(t,e){void 0===e&&(e=[]);var n=Ae(e,4),r=n[0],i=n[1],o=n[2],a=n[3];return Og(r,i,o,a)(t)},Bg=Og(.42,0,1,1),Dg=function(t){return function(e,n,r){return void 0===n&&(n=[]),1-t(1-e,n,r)}},Fg=function(t){return function(e,n,r){return void 0===n&&(n=[]),e<.5?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},zg=function(t){return function(e,n,r){return void 0===n&&(n=[]),e<.5?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},Gg={steps:Rg,"step-start":function(t){return Rg(t,[1,"start"])},"step-end":function(t){return Rg(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":Ig,ease:function(t){return Ig(t,[.25,.1,.25,1])},in:Bg,out:Dg(Bg),"in-out":Fg(Bg),"out-in":zg(Bg),"in-quad":Eg,"out-quad":Dg(Eg),"in-out-quad":Fg(Eg),"out-in-quad":zg(Eg),"in-cubic":kg,"out-cubic":Dg(kg),"in-out-cubic":Fg(kg),"out-in-cubic":zg(kg),"in-quart":Sg,"out-quart":Dg(Sg),"in-out-quart":Fg(Sg),"out-in-quart":zg(Sg),"in-quint":Ag,"out-quint":Dg(Ag),"in-out-quint":Fg(Ag),"out-in-quint":zg(Ag),"in-expo":_g,"out-expo":Dg(_g),"in-out-expo":Fg(_g),"out-in-expo":zg(_g),"in-sine":Tg,"out-sine":Dg(Tg),"in-out-sine":Fg(Tg),"out-in-sine":zg(Tg),"in-circ":Pg,"out-circ":Dg(Pg),"in-out-circ":Fg(Pg),"out-in-circ":zg(Pg),"in-back":Cg,"out-back":Dg(Cg),"in-out-back":Fg(Cg),"out-in-back":zg(Cg),"in-bounce":Ng,"out-bounce":Dg(Ng),"in-out-bounce":Fg(Ng),"out-in-bounce":zg(Ng),"in-elastic":Lg,"out-elastic":Dg(Lg),"in-out-elastic":Fg(Lg),"out-in-elastic":zg(Lg),spring:jg,"spring-in":jg,"spring-out":Dg(jg),"spring-in-out":Fg(jg),"spring-out-in":zg(jg)},Wg=function(t){return Gg[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)]||Gg.linear},$g=function(t){return t},Hg=1,Vg=.5,Yg=0;function Ug(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var qg="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Xg=new RegExp("cubic-bezier\\("+qg+","+qg+","+qg+","+qg+"\\)"),Kg=/steps\(\s*(\d+)\s*\)/,Zg=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Qg(t){var e=Xg.exec(t);if(e)return Og.apply(void 0,_e([],Ae(e.slice(1).map(Number)),!1));var n=Kg.exec(t);if(n)return Ug(Number(n[1]),Yg);var r=Zg.exec(t);return r?Ug(Number(r[1]),{start:Hg,middle:Vg,end:Yg}[r[2]]):Wg(t)}function Jg(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}var tm=0,em=1,nm=2,rm=3;function im(t,e,n){var r=function(t,e,n){if(null===e)return tm;var r=n.endTime;return e<Math.min(n.delay,r)?em:e>=Math.min(n.delay+t+n.endDelay,r)?nm:rm}(t,e,n),i=function(t,e,n,r,i){switch(r){case em:return"backwards"===e||"both"===e?0:null;case rm:return n-i;case nm:return"forwards"===e||"both"===e?t:null;case tm:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var o="auto"===n.duration?0:n.duration,a=function(t,e,n,r,i){var o=i;return 0===t?e!==em&&(o+=n):o+=r/t,o}(o,r,n.iterations,i,n.iterationStart),s=function(t,e,n,r,i,o){var a=t===1/0?e%1:t%1;return 0!==a||n!==nm||0===r||0===i&&0!==o||(a=1),a}(a,n.iterationStart,r,n.iterations,i,o),c=function(t,e,n,r){return t===nm&&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 om(t,e,n){var r=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r])if(am(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:Qg(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:cm(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:n.easingFunction(r/i);t.setAttribute(n.property,n.interpolation(o),!1,!1)}));else for(var n in r)am(n)&&t.setAttribute(n,null)}}function am(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var sm=function(t,e,n){return function(r){var i=lm(t,e,r);return!Op.enableCSSParsing&&L(i)?i:n(i)}};function cm(t,e,n,r){var i=Wh[t];if(i&&i.syntax&&i.int){var o=Op.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a=void 0,s=void 0;if(Op.enableCSSParsing){var c=Op.styleValueRegistry.parseProperty(t,e,r,!1),l=Op.styleValueRegistry.parseProperty(t,n,r,!1);a=Op.styleValueRegistry.computeProperty(t,c,r,!1),s=Op.styleValueRegistry.computeProperty(t,l,r,!1)}else{var u=o.parserWithCSSDisabled;a=u?u(e,r):e,s=u?u(n,r):n}var f=o.mixer(a,s,r);if(f){var h=sm.apply(void 0,_e([],Ae(f),!1));return function(t){return 0===t?e:1===t?n:h(t)}}}}return sm(!1,!0,(function(t){return t?n:e}))}function lm(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(lm(t[s<r?s:r-1],e[s<i?s:i-1],n));return a}throw new Error("Mismatched interpolation arguments "+t+":"+e)}var um=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=$g,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}return Object.defineProperty(t.prototype,"easing",{get:function(){return this._easing},set:function(t){this.easingFunction=Qg(t),this._easing=t},enumerable:!1,configurable:!0}),t}();function fm(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var r=t[n];Array.isArray(r)||(r=[r]);for(var i=r.length,o=0;o<i;o++){if(!e[o]){var a={};"offset"in t&&(a.offset=Number(t.offset)),"easing"in t&&(a.easing=t.easing),"composite"in t&&(a.composite=t.composite),e[o]=a}void 0!==r[o]&&null!==r[o]&&(e[o][n]=r[o])}}return e.sort((function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)})),e}(t));for(var n=t.map((function(t){var n={};for(var r in(null==e?void 0:e.composite)&&(n.composite="auto"),t){var i=t[r];if("offset"===r){if(null!==i){if(i=Number(i),!isFinite(i))throw new Error("Keyframe offsets must be numbers.");if(i<0||i>1)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw new Error("".concat(i," compositing is not supported"));n[r]=i}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n})),r=!0,i=-1/0,o=0;o<n.length;o++){var a=n[o].offset;if(y(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(!y(s)&&!y(o)){for(var c=1;c<a-i;c++)n[i+c].computedOffset=o+(Number(s)-o)*c/(a-i);i=a,o=Number(s)}}}(),n}var hm="backwards|forwards|both|none".split("|"),dm="reverse|alternate|alternate-reverse".split("|");function pm(t,e){return function(t,e){var n=new um;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach((function(e){if(void 0!==t[e]&&null!==t[e]&&"auto"!==t[e]){if(("number"==typeof n[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===hm.indexOf(t[e]))return;if("direction"===e&&-1===dm.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 gm=function(){function t(t,e,n){var r=this;this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=pm(n,!1),this.timing.effect=this,this.timing.activeDuration=Jg(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=fm(e,this.timing),this.interpolations=om(this.normalizedKeyframes,this.timing,this.target);var i=Op.globalThis.Proxy;this.computedTiming=i?new i(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?r.animation&&r.animation.currentTime||null:"currentIteration"===e?r.animation&&"running"===r.animation.playState?t.currentIteration||0:null:"progress"===e?r.animation&&"running"===r.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}}):this.timing}return t.prototype.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},t.prototype.update=function(t){return null!==t&&(this.timeFraction=im(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},t.prototype.getKeyframes=function(){return this.normalizedKeyframes},t.prototype.setKeyframes=function(t){this.normalizedKeyframes=fm(t)},t.prototype.getComputedTiming=function(){return this.computedTiming},t.prototype.getTiming=function(){return this.timing},t.prototype.updateTiming=function(t){var e=this;Object.keys(t||{}).forEach((function(n){e.timing[n]=t[n]}))},t}();function mm(t,e){return Number(t.id)-Number(e.id)}var ym=function(){function t(t){var e=this;this.document=t,this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.webAnimationsNextTick=function(t){e.currentTime=t,e.discardAnimations(),0===e.animations.length?e.timelineTicking=!1:e.requestAnimationFrame(e.webAnimationsNextTick)},this.processRafCallbacks=function(t){var n=e.rafCallbacks;e.rafCallbacks=[],t<Number(e.currentTime)&&(t=Number(e.currentTime)),e.animations.sort(mm),e.animations=e.tick(t,!0,e.animations)[0],n.forEach((function(e){e[1](t)})),e.applyPendingEffects()}}return t.prototype.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},t.prototype.isTicking=function(){return this.inTick},t.prototype.play=function(t,e,n){var r=new gm(t,e,n),i=new gg(r,this);return this.animations.push(i),this.restartWebAnimationsNextTick(),i.updatePromises(),i.play(),i.updatePromises(),i},t.prototype.applyDirtiedAnimation=function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(mm),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach((function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,1)})),this.applyPendingEffects()}},t.prototype.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},t.prototype.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},t.prototype.applyPendingEffects=function(){this.pendingEffects.forEach((function(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]},t.prototype.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))},t.prototype.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))},t.prototype.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},t.prototype.rAF=function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e},t.prototype.requestAnimationFrame=function(t){var e=this;return this.rAF((function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()}))},t.prototype.tick=function(t,e,n){var r,i,o=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var a=[],s=[],c=[],l=[];return n.forEach((function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(a.push(n.effect),n.unmarkTarget()),n._needsTick&&(o.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?c.push(n):l.push(n)})),(r=this.pendingEffects).push.apply(r,_e([],Ae(a),!1)),(i=this.pendingEffects).push.apply(i,_e([],Ae(s),!1)),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[c,l]},t}();function vm(t){return new bm([t],null,t,t.ownerDocument)}Op.EasingFunction=Qg,Op.AnimationTimeline=ym;class bm{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 bm(e,null,this._elements[0],this._document)}selectFacetAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new bm(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 bm([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 bm(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 bm(n,null,n[0],this._document)}maybeAppend(t,e,n){const r=this._elements[0],i=r.getElementById(t);if(i)return new bm([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 bm([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=zn(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 bm([],r,this._parent,this._document),new bm(i,null,this._parent,this._document),new bm(o,null,this._parent,this._document),new bm([],a,this._parent,this._document),new bm(s,null,this._parent,this._document)];return new bm(this._elements,null,this._parent,this._document,f)}merge(t){const e=[...this._elements,...t._elements],n=[...this._transitions,...t._transitions];return new bm(e,null,this._parent,this._document,void 0,n)}createElement(t){if(this._document)return this._document.createElement(t,{});const e=bm.registry[t];return e?new e:mr(`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 bm([],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 xm(t,e,n){return Math.max(e,Math.min(t,n))}function wm(t,e=10){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(e))}function Mm(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}function Om(t,e,n,r,i){const o=ks(Ms(r,e))+Math.PI,a=ks(Ms(r,n))+Math.PI;return t.arc(r[0],r[1],i,o,a,a-o<0),t}function Em(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=_r(a),[l,u]=Rn(c,(t=>a[t])),f=new pa({domain:[l,u],range:[0,100]}),h=t=>L(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)}%`};return`linear-gradient(${s}deg, ${c.sort(((t,e)=>h(t)-h(e))).map(d[i]||d.between).join(",")})`}function km(t){const[e,n,r,i]=t;return[i,e,n,r]}function Sm(t,e,n){const[r,i,,o]=Uc(t)?km(e):e,[a,s]=n,c=t.getCenter(),l=Ss(Ms(r,c)),u=Ss(Ms(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:Es(o,c),outerRadius:Es(r,c)}}function Am(t){const{colorAttribute:e,opacityAttribute:n=e}=t;return`${n}Opacity`}function _m(t,e){if(!qc(t))return"";const n=t.getCenter(),{transform:r}=e;return`translate(${n[0]}, ${n[1]}) ${r||""}`}function Tm(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:m=1/0,minHeight:y=-1/0}=i,v=Me(i,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth","minHeight"]);if(!qc(r)&&!Kc(r)){const n=!!Uc(r),[i,,o]=n?km(e):e,[a,b]=i,[x,w]=Ms(o,i),M=(x>0?a:a+x)+s,O=(w>0?b:b+w)+c,E=Math.abs(x)-(s+l),k=Math.abs(w)-(c+u),S=n?xm(E,y,1/0):xm(E,g,m),A=n?xm(k,g,m):xm(k,y,1/0),_=n?M:M-(S-E)/2,T=n?O-(A-k)/2:O-(A-k);return vm(t.createElement("rect",{})).style("x",_).style("y",T).style("width",S).style("height",A).style("radius",[d,p,h,f]).call(Mm,v).node()}const{y:b,y1:x}=n,w=r.getCenter(),M=Sm(r,e,[b,x]),O=hc().cornerRadius(a).padAngle(o*Math.PI/180);return vm(t.createElement("path",{})).style("d",O(M)).style("transform",`translate(${w[0]}, ${w[1]})`).style("radius",a).style("inset",o).call(Mm,v).node()}bm.registry={g:$p,rect:Kp,circle:zp,path:Up,text:Zp,ellipse:Wp,image:Vp,line:Yp,polygon:qp,polyline:Xp,html:Hp};const Pm=(t,e)=>{const{colorAttribute:n,opacityAttribute:r="fill",first:i=!0,last:o=!0}=t,a=Me(t,["colorAttribute","opacityAttribute","first","last"]),{coordinate:s,document:c}=e;return(e,r,l)=>{const{color:u,radius:f=0}=l,h=Me(l,["color","radius"]),d=h.lineWidth||1,{stroke:p,radius:g=f,radiusTopLeft:m=g,radiusTopRight:y=g,radiusBottomRight:v=g,radiusBottomLeft:b=g,innerRadius:x=0,innerRadiusTopLeft:w=x,innerRadiusTopRight:M=x,innerRadiusBottomRight:O=x,innerRadiusBottomLeft:E=x,lineWidth:k=("stroke"===n||p?d:0),inset:S=0,insetLeft:A=S,insetRight:_=S,insetBottom:T=S,insetTop:P=S,minWidth:C,maxWidth:N,minHeight:L}=a,j=Me(a,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop","minWidth","maxWidth","minHeight"]),{color:R=u,opacity:I}=r,B=[i?m:w,i?y:M,o?v:O,o?b:E],D=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"];Uc(s)&&D.push(D.shift());const F=Object.assign(Object.assign({radius:g},Object.fromEntries(D.map(((t,e)=>[t,B[e]])))),{inset:S,insetLeft:A,insetRight:_,insetBottom:T,insetTop:P,minWidth:C,maxWidth:N,minHeight:L});return vm(Tm(c,e,r,s,F)).call(Mm,h).style("fill","transparent").style(n,R).style(Am(t),I).style("lineWidth",k).style("stroke",void 0===p?R:p).call(Mm,j).node()}};Pm.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Cm=(t,e)=>Pm(Object.assign({colorAttribute:"fill"},t),e);Cm.props=Object.assign(Object.assign({},Pm.props),{defaultMarker:"square"});const Nm=(t,e)=>Pm(Object.assign({colorAttribute:"stroke"},t),e);function Lm(t,e,n){const[r,i,o,a]=t;if(Uc(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]}Nm.props=Object.assign(Object.assign({},Pm.props),{defaultMarker:"hollowSquare"});const jm=(t,e)=>{const{adjustPoints:n=Lm}=t,r=Me(t,["adjustPoints"]),{coordinate:i,document:o}=e;return(t,e,a,s)=>{const{index:c}=e,{color:l}=a,u=Me(a,["color"]),f=s[c+1],h=n(t,f,i),d=!!Uc(i),[p,g,m,y]=d?km(h):h,{color:v=l,opacity:b}=e,x=vc().curve(Lc)([p,g,m,y]);return vm(o.createElement("path",{})).call(Mm,u).style("d",x).style("fill",v).style("fillOpacity",b).call(Mm,r).node()}};function Rm(t,e,n){const[r,i,o,a]=t;if(Uc(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]}jm.props={defaultMarker:"square"};const Im=(t,e)=>jm(Object.assign({adjustPoints:Rm},t),e);function Bm(t){const e="function"==typeof t?t:t.render;return class extends Gp{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}Im.props={defaultMarker:"square"};const Dm=Bm((t=>{const{d1:e,d2:n,style1:r,style2:i}=t.attributes,o=t.ownerDocument;vm(t).maybeAppend("line",(()=>o.createElement("path",{}))).style("d",e).call(Mm,r),vm(t).maybeAppend("line1",(()=>o.createElement("path",{}))).style("d",n).call(Mm,i)}));const Fm=(t,e)=>{const{curve:n,gradient:r=!1,gradientColor:i="between",defined:o=(t=>!Number.isNaN(t)&&null!=t),connect:a=!1}=t,s=Me(t,["curve","gradient","gradientColor","defined","connect"]),{coordinate:c,document:l}=e;return(t,e,u)=>{const{color:f,lineWidth:h}=u,d=Me(u,["color","lineWidth"]),{color:p=f,size:g=h,seriesColor:m,seriesX:y,seriesY:v}=e,b=_m(c,e),x=Uc(c),w=r&&m?Em(m,y,v,r,i,x):p,M=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},d),w&&{stroke:w}),g&&{lineWidth:g}),b&&{transform:b}),s);let O;if(qc(c)){const t=c.getCenter();O=e=>Oc(vc().curve(xc)).angle(((n,r)=>Ss(Ms(e[r],t)))).radius(((n,r)=>Es(e[r],t))).defined((([t,e])=>o(t)&&o(e))).curve(n)(e)}else O=vc().x((t=>t[0])).y((t=>t[1])).defined((([t,e])=>o(t)&&o(e))).curve(n);const[E,k]=function(t,e){const n=[],r=[];let i=!1,o=null;for(const a of t)e(a[0])&&e(a[1])?(n.push(a),i&&(i=!1,r.push([o,a])),o=a):i=!0;return[n,r]}(t,o),S=xr(M,"connect"),A=!!k.length;if(!A||a&&!Object.keys(S).length)return vm(l.createElement("path",{})).style("d",O(E)||[]).call(Mm,M).node();if(A&&!a)return vm(l.createElement("path",{})).style("d",O(t)).call(Mm,M).node();return vm(new Dm).style("style1",Object.assign(Object.assign({},M),S)).style("style2",M).style("d1",(_=k,_.map(O).join(","))).style("d2",O(t)).node();var _}};Fm.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const zm=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=qc(n)?Lc:gc;return Fm(Object.assign({curve:i},t),e)(...r)}};zm.props=Object.assign(Object.assign({},Fm.props),{defaultMarker:"line"});const Gm=(t,e)=>{const n=Me(t,[]),{coordinate:r}=e;return(...t)=>{const i=qc(r)?Cc:Uc(r)?Wc:Gc;return Fm(Object.assign({curve:i},n),e)(...t)}};Gm.props=Object.assign(Object.assign({},Fm.props),{defaultMarker:"smooth"});const Wm=(t,e)=>Fm(Object.assign({curve:Yc},t),e);Wm.props=Object.assign(Object.assign({},Fm.props),{defaultMarker:"hv"});const $m=(t,e)=>Fm(Object.assign({curve:Vc},t),e);$m.props=Object.assign(Object.assign({},Fm.props),{defaultMarker:"vh"});const Hm=(t,e)=>Fm(Object.assign({curve:Hc},t),e);function Vm(t,e,n,r,i){const o=ks(Ms(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=Os(e,s),h=Os(n,c),d=Os(h,l),p=Os(n,l),g=Ms(p,c),m=Ms(n,c),y=Ms(e,s),v=Ms(y,u),b=Ms(e,u),x=Ms(f,u);t.moveTo(...f),t.lineTo(...h),t.arcTo(...d,...p,i/2),t.arcTo(...g,...m,i/2),t.lineTo(...y),t.arcTo(...v,...b,r/2),t.arcTo(...x,...f,r/2),t.closePath()}Hm.props=Object.assign(Object.assign({},Fm.props),{defaultMarker:"hvh"});const Ym=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{seriesSize:o,color:a}=r,{color:s}=i,c=Me(i,["color"]),l=ic();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(vr)&&Vm(l,n,r,i,a)}return vm(n.createElement("path",{})).call(Mm,c).style("fill",a||s).style("d",l.toString()).call(Mm,t).node()}};Ym.props=Object.assign(Object.assign({},Fm.props),{defaultMarker:"line"});const Um=(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"]];Um.style=["fill"];const qm=Um.bind(void 0);qm.style=["stroke","lineWidth"];const Xm=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]];Xm.style=["fill"];const Km=Xm.bind(void 0);Km.style=["fill"];const Zm=Xm.bind(void 0);Zm.style=["stroke","lineWidth"];const Qm=(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"]]};Qm.style=["fill"];const Jm=Qm.bind(void 0);Jm.style=["stroke","lineWidth"];const ty=(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"]]};ty.style=["fill"];const ey=ty.bind(void 0);ey.style=["stroke","lineWidth"];const ny=(t,e,n)=>{const r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]};ny.style=["fill"];const ry=ny.bind(void 0);ry.style=["stroke","lineWidth"];const iy=(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"]]};iy.style=["fill"];const oy=iy.bind(void 0);oy.style=["stroke","lineWidth"];const ay=(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"]]};ay.style=["fill"];const sy=ay.bind(void 0);sy.style=["stroke","lineWidth"];const cy=(t,e,n)=>[["M",t,e+n],["L",t,e-n]];cy.style=["stroke","lineWidth"];const ly=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]];ly.style=["stroke","lineWidth"];const uy=(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]];uy.style=["stroke","lineWidth"];const fy=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]];fy.style=["stroke","lineWidth"];const hy=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];hy.style=["stroke","lineWidth"];const dy=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];dy.style=["stroke","lineWidth"];const py=dy.bind(void 0);py.style=["stroke","lineWidth"];const gy=(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]];gy.style=["stroke","lineWidth"];const my=(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]];my.style=["stroke","lineWidth"];const yy=(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]];yy.style=["stroke","lineWidth"];const vy=(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]];vy.style=["stroke","lineWidth"];const by=(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]];by.style=["stroke","lineWidth"];const xy=new Map([["bowtie",ay],["cross",ly],["dash",py],["diamond",Qm],["dot",dy],["hexagon",iy],["hollowBowtie",sy],["hollowDiamond",Jm],["hollowHexagon",oy],["hollowPoint",qm],["hollowSquare",Zm],["hollowTriangle",ey],["hollowTriangleDown",ry],["hv",my],["hvh",vy],["hyphen",hy],["line",cy],["plus",fy],["point",Um],["rect",Km],["smooth",gy],["square",Xm],["tick",uy],["triangleDown",ny],["triangle",ty],["vh",yy],["vhv",by]]);const wy=(t,e)=>{const{colorAttribute:n,symbol:r,mode:i="auto"}=t,o=Me(t,["colorAttribute","symbol","mode"]),a=xy.get(r)||xy.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,[m,y]=function(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]}(e),v=function(t,e,n,r){if(1===e.length)return;const{size:i}=n;if("fixed"===t)return i;if("normal"===t||Qc(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}(i,e,r,s),b=v||o.r||l.r;return vm(c.createElement("path",{})).call(Mm,l).style("fill","transparent").style("d",a(m,y,b)).style("lineWidth",h).style("transform",p).style("transformOrigin",`${m-b} ${y-b}`).style("stroke",d).style(Am(t),g).style(n,d).call(Mm,o).node()}};wy.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const My=(t,e)=>wy(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e);My.props=Object.assign({defaultMarker:"hollowBowtie"},wy.props);const Oy=(t,e)=>wy(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e);Oy.props=Object.assign({defaultMarker:"hollowDiamond"},wy.props);const Ey=(t,e)=>wy(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e);Ey.props=Object.assign({defaultMarker:"hollowHexagon"},wy.props);const ky=(t,e)=>wy(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e);ky.props=Object.assign({defaultMarker:"hollowPoint"},wy.props);const Sy=(t,e)=>wy(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e);Sy.props=Object.assign({defaultMarker:"hollowSquare"},wy.props);const Ay=(t,e)=>wy(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e);Ay.props=Object.assign({defaultMarker:"hollowTriangle"},wy.props);const _y=(t,e)=>wy(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e);_y.props=Object.assign({defaultMarker:"hollowTriangleDown"},wy.props);const Ty=(t,e)=>wy(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e);Ty.props=Object.assign({defaultMarker:"bowtie"},wy.props);const Py=(t,e)=>wy(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e);Py.props=Object.assign({defaultMarker:"cross"},wy.props);const Cy=(t,e)=>wy(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e);Cy.props=Object.assign({defaultMarker:"diamond"},wy.props);const Ny=(t,e)=>wy(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e);Ny.props=Object.assign({defaultMarker:"hexagon"},wy.props);const Ly=(t,e)=>wy(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e);Ly.props=Object.assign({defaultMarker:"hyphen"},wy.props);const jy=(t,e)=>wy(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e);jy.props=Object.assign({defaultMarker:"line"},wy.props);const Ry=(t,e)=>wy(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e);Ry.props=Object.assign({defaultMarker:"plus"},wy.props);const Iy=(t,e)=>wy(Object.assign({colorAttribute:"fill",symbol:"point"},t),e);Iy.props=Object.assign({defaultMarker:"point"},wy.props);const By=(t,e)=>wy(Object.assign({colorAttribute:"fill",symbol:"square"},t),e);By.props=Object.assign({defaultMarker:"square"},wy.props);const Dy=(t,e)=>wy(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e);Dy.props=Object.assign({defaultMarker:"tick"},wy.props);const Fy=(t,e)=>wy(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e);Fy.props=Object.assign({defaultMarker:"triangle"},wy.props);const zy=(t,e)=>wy(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e);zy.props=Object.assign({defaultMarker:"triangleDown"},wy.props);const Gy=(t,e)=>{const{arrow:n=!0,arrowSize:r="40%"}=t,i=Me(t,["arrow","arrowSize"]),{document:o}=e;return(t,e,a)=>{const{defaultColor:s}=a,c=Me(a,["defaultColor"]),{color:l=s,transform:u}=e,[f,h]=t,d=ic();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*Es(t,e):r,o=Math.PI/6,a=Math.atan2(e[1]-t[1],e[0]-t[0]),s=Math.PI/2-a-o,c=a-o;return[[e[0]-i*Math.sin(s),e[1]-i*Math.cos(s)],[e[0]-i*Math.cos(c),e[1]-i*Math.sin(c)]]}(f,h,{arrowSize:r});d.moveTo(...h),d.lineTo(...t),d.moveTo(...h),d.lineTo(...e)}return vm(o.createElement("path",{})).call(Mm,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(Mm,i).node()}};function Wy(t,e){e(t),t.children&&t.children.forEach((function(t){t&&Wy(t,e)}))}function $y(t){Vy(t,!0)}function Hy(t){Vy(t,!1)}function Vy(t,e){var n=e?"visible":"hidden";Wy(t,(function(t){t.attr("visibility",n)}))}Gy.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var Yy=function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.apply(this,_e([],Ae(e),!1))||this;return r.isMutationObserved=!0,r.addEventListener(sp.INSERTED,(function(){Hy(r)})),r}return xe(e,t),e}($p);function Uy(t){var e=t.appendChild(new Yy({class:"offscreen"}));return Hy(e),e}var qy=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=Me(e,["style"]);return t.call(this,we({style:we({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},n)},r))||this}return xe(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=Uy(this)),this._offscreen},enumerable:!1,configurable:!0}),e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e}(Zp);function Xy(t){return t*Math.PI/180}function Ky(t){return Number((180*t/Math.PI).toPrecision(5))}var Zy=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 Qy(t,e){return m(t)?t.apply(void 0,_e([],Ae(e),!1)):t}var Jy,tv=function(t,e){var n=function(t){return"".concat(e,"-").concat(t)},r=Object.fromEntries(Object.entries(t).map((function(t){var e=Ae(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},ev=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=5),Object.entries(e).forEach((function(i){var o=Ae(i,2),a=o[0],s=o[1],c=t;Object.prototype.hasOwnProperty.call(e,a)&&(s?k(s)?(k(t[a])||(c[a]={}),n<r?ev(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)}))},nv=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)ev(t,e[r]);return t},rv=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},iv=function(t,e,n){if(void 0===n&&(n=128),!m(t))throw new TypeError("Expected a function");var r=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var s=t.apply(this,n);return a.set(o,s),s};return r.cache=function(t){var e,n,r,i=t||1;function o(t,o){++e>i&&(r=n,a(1),++e),n[t]=o}function a(t){e=0,n=Object.create(null),t||(r=Object.create(null))}return a(),{clear:a,has:function(t){return void 0!==n[t]||void 0!==r[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=r[t])?(o(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:o(t,e)}}}(n),r}((function(t,e){var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return Jy||(Jy=Op.offscreenCanvasCreator.getOrCreateContext(void 0)),Jy.font=[o,a,i,"".concat(n,"px"),r].join(" "),Jy.measureText(t).width}),(function(t,e){return[t,Object.values(e||ov(t)).join()].join("")}),4096),ov=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 av(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function sv(t,e){var n=av(t);n&&n.attr(e)}function cv(t,e,n){void 0===n&&(n="..."),sv(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n})}function lv(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 uv(t){return"function"==typeof t?t():P(t)||L(t)?new qy({style:{text:String(t)}}):t}function fv(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 hv(t,e,n,r,i){return void 0===r&&(r=!0),void 0===i&&(i=!1),!!(r&&t===e||i&&t===n)||t>e&&t<n}var dv=function(t,e){return function(n){return t*(1-n)+e*n}};function pv(t,e){return"number"==typeof t&&"number"==typeof e?dv(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]=pv(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=Ae(e,2),o=i[0],a=i[1];o in t?n[o]=pv(t[o],a):r[o]=a})),function(t){return Object.entries(n).forEach((function(e){var n=Ae(e,2),i=n[0],o=n[1];return r[i]=o(t)})),r}}(t,e):function(e){return t}}function gv(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=Ae([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 Zy(e,n,r-e,i-n)}var mv=function(t,e,n){var r=t.width,i=t.height,o=n.flexDirection,a=void 0===o?"row":o,s=n.justifyContent,c=void 0===s?"flex-start":s,l=n.alignItems,u=void 0===l?"flex-start":l,f="row"===a,h="row"===a||"column"===a,d=f?h?[1,0]:[-1,0]:h?[0,1]:[0,-1],p=Ae([0,0],2),g=p[0],m=p[1],y=e.map((function(t){var e,n=t.width,r=t.height,i=Ae([g,m],2),o=i[0],a=i[1];return e=Ae([g+n*d[0],m+r*d[1]],2),g=e[0],m=e[1],new Zy(o,a,n,r)})),v=gv(y),b={"flex-start":0,"flex-end":f?r-v.width:i-v.height,center:f?(r-v.width)/2:(i-v.height)/2},x=y.map((function(t){var e=t.x,n=t.y,r=Zy.fromRect(t);return r.x=f?e+b[c]:e,r.y=f?n:n+b[c],r}));gv(x);var w=function(t){var e=Ae(f?["height",i]:["width",r],2),n=e[0],o=e[1];switch(u){case"flex-start":default:return 0;case"flex-end":return o-t[n];case"center":return o/2-t[n]/2}},M=x.map((function(t){var e=t.x,n=t.y,r=Zy.fromRect(t);return r.x=f?e:e+w(r),r.y=f?n+w(r):n,r})),O=M.map((function(e){var n,r,i=Zy.fromRect(e);return i.x+=null!==(n=t.x)&&void 0!==n?n:0,i.y+=null!==(r=t.y)&&void 0!==r?r:0,i}));return O},yv=function(t,e,n){return[]};function vv(t,e){return[t[0]*e,t[1]*e]}function bv(t,e){return[t[0]+e[0],t[1]+e[1]]}function xv(t,e){return[t[0]-e[0],t[1]-e[1]]}function wv(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function Mv(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function Ov(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Ev(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 kv(t,e){return+t.toPrecision(e)}function Sv(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 Av(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=Ae(r,2))[0],d=i[1];for(var p=0,g=t.length;p<g;p+=1)h=wv(h,y=t[p]),d=Mv(d,y)}p=0;for(var m=t.length;p<m;p+=1){var y=t[p];if(0!==p||n)if(p!==m-1||n){o=t[[p?p-1:m-1,p-1][n?0:1]];var v=[0,0];v=vv(v=xv(a=t[n?(p+1)%m:p+1],o),e);var b=Ov(y,o),x=Ov(y,a),w=b+x;0!==w&&(b/=w,x/=w);var M=vv(v,-b),O=vv(v,x);c=bv(y,M),s=wv(s=bv(y,O),Mv(a,y)),s=Mv(s,wv(a,y)),c=wv(c=bv(y,M=vv(M=xv(s,y),-b/x)),Mv(o,y)),s=bv(y,O=vv(O=xv(y,c=Mv(c,wv(o,y))),x/b)),f&&(c=wv(c=Mv(c,h),d),s=wv(s=Mv(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=Ae(i,1)[0],h.push(["C",s[0],s[1],c[0],c[1],l[0],l[1]])),h}var _v=["$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 Tv(t){return _v.includes(t)}function Pv(t){var e={};for(var n in t)Tv(n)&&(e[n]=t[n]);return e}function Cv(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 Nv=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=Ae(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=Te(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=Te(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=Te(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],m=e(g,p),y=r(g,p);if(f.has(m))(w=f.get(m)).__data__=g,w.__facet__=!1,s.push(w),c.delete(w),f.delete(m);else if(h.has(m)){(w=h.get(m)).__data__=g,w.__facet__=!0,s.push(w),h.delete(m)}else if(d.has(m)){var v=d.get(m);l.push([g,v]);try{for(var b=(i=void 0,Se(v)),x=b.next();!x.done;x=b.next()){var w=x.value;c.delete(w)}}catch(t){i={error:t}}finally{try{x&&!x.done&&(o=b.return)&&o.call(b)}finally{if(i)throw i.error}}d.delete(m)}else if(f.has(y)){(w=f.get(y)).__toData__?w.__toData__.push(g):w.__toData__=[g],u.add(w),c.delete(w)}else a.push(g)}var M=[new n([],a,this._parent,this._document),new n(s,null,this._parent,this._document),new n(c,null,this._parent,this._document),new n([],l,this._parent,this._document),new n(u,null,this._parent,this._document)];return new n(this._elements,null,this._parent,this._document,M)},t.prototype.merge=function(t){var e=_e(_e([],Ae(this._elements),!1),Ae(t._elements),!1),r=_e(_e([],Ae(this._transitions),!1),Ae(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=Ae(t,2),a=o[0],s=o[1],c="function"==typeof s&&e?s:function(){return s};void 0!==s&&i.attr(a,c.call(i,n,r))}))}))},t.prototype.update=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each((function(e,r){t&&this.update&&this.update(n.call(this,e,r))}))},t.prototype.maybeUpdate=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each((function(e,r){t&&this.update&&this.update(n.call(this,e,r))}))},t.prototype.transition=function(t){var e=this._transitions;return this.each((function(n,r){e[r]=t.call(this,n,r)}))},t.prototype.on=function(t,e){return this.each((function(){this.addEventListener(t,e)})),this},t.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.call.apply(t,_e([this._parent,this],Ae(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:$p,rect:Kp,circle:zp,path:Up,text:qy,ellipse:Wp,image:Vp,line:Yp,polygon:qp,polyline:Xp,html:Hp},t}();function Lv(t){return new Nv([t],null,t,t.ownerDocument)}function jv(t){if(L(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 Rv(t){var e=t.getLocalBounds(),n=Ae([e.min,e.max],2),r=Ae(n[0],2),i=r[0],o=r[1],a=Ae(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 Iv(t,e){var n=Ae(t,2),r=n[0],i=n[1],o=Ae(e,2),a=o[0],s=o[1];return r!==a&&i===s}function Bv(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function Dv(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 Fv=function(t,e){if(!(null==t?void 0:t.startsWith(e)))return!1;var n=t[e.length];return n>="A"&&n<="Z"};function zv(t,e,n){void 0===n&&(n=!1);var r={};return Object.entries(t).forEach((function(t){var i=Ae(t,2),o=i[0],a=i[1];if("className"===o||"class"===o);else if(Fv(o,"show")&&Fv(Dv(o,"show"),e)!==n)o===function(t,e){return"".concat(e).concat(Bv(t))}(e,"show")?r[o]=a:r[o.replace(new RegExp(Bv(e)),"")]=a;else if(!Fv(o,"show")&&Fv(o,e)!==n){var s=Dv(o,e);"filter"===s&&"function"==typeof a||(r[s]=a)}})),r}function Gv(t,e){return Object.entries(t).reduce((function(t,n){var r=Ae(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(Bv(i))]=o,t}),{})}function Wv(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=Ae(t,2),a=o[0],s=o[1];e.includes(a)||(-1!==n.indexOf(a)?i[a]=s:r[a]=s)})),[r,i]}function $v(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=Ae([e,n].map((function(t,e){var n;return t.includes("%")?parseFloat((null===(n=t.match(/[+-]?([0-9]*[.])?[0-9]+/))||void 0===n?void 0:n[0])||"0")/100*(0===e?i:o):t})),2);return[a[0],a[1]]}(t,n,r),")")}));t.attr("transform",n)}catch(t){}}function Hv(){Vy(this,"hidden"!==this.attributes.visibility)}var Vv=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,nv({},{style:n},e))||this;return r.initialized=!1,r._defaultOptions=n,r}return xe(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=Uy(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&&Hv.call(this)},e.prototype.update=function(t,e){var n;return this.attr(nv({},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}(Gp),Yv=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"]]},Uv=Yv,qv=function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},Xv=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},Kv=Xv;var Zv=function(t,e,n){return[["M",t-n,e-n],["L",t+n,e],["L",t-n,e+n],["Z"]]};function Qv(t){var e=function(t){var e="default";if(w(t)&&t instanceof Image)e="image";else if(m(t))e="symbol";else if(P(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 Jv=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return xe(e,t),e.prototype.render=function(t,n){var r=t.symbol,i=t.size,o=void 0===i?16:i,a=t.x,s=void 0===a?0:a,c=t.y,l=void 0===c?0:c,u=Me(t,["symbol","size","x","y","transform","transformOrigin"]),f=Qv(r);fv(!!f,Lv(n),(function(t){t.maybeAppendByClassName("marker",f).attr("className","marker ".concat(f,"-marker")).call((function(t){if("image"===f){var n=2*o;t.styles({img:r,width:n,height:n,x:s-o,y:l-o})}else{n=o/2;var i=m(r)?r:e.getSymbol(r);t.styles(we({d:null==i?void 0:i(s,l,n)},u))}}))}))},e.MARKER_SYMBOL_MAP=new Map,e.registerSymbol=function(t,n){e.MARKER_SYMBOL_MAP.set(t,n)},e.getSymbol=function(t){return e.MARKER_SYMBOL_MAP.get(t)},e.getSymbols=function(){return Array.from(e.MARKER_SYMBOL_MAP.keys())},e}(Vv);Jv.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]]})),Jv.registerSymbol("hyphen",(function(t,e,n){return[["M",t-n,e],["L",t+n,e]]})),Jv.registerSymbol("line",qv),Jv.registerSymbol("plus",(function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]})),Jv.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]]})),Jv.registerSymbol("circle",Yv),Jv.registerSymbol("point",Uv),Jv.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"]]})),Jv.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"]]})),Jv.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"]]})),Jv.registerSymbol("diamond",(function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]})),Jv.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"]]})),Jv.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"]]})),Jv.registerSymbol("line",qv),Jv.registerSymbol("dot",Xv),Jv.registerSymbol("dash",Kv),Jv.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]]})),Jv.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]]})),Jv.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]]})),Jv.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]]})),Jv.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 tb=function(t){function e(e){var n=this,r=e.style,i=Me(e,["style"]);return(n=t.call(this,X({},{type:"column"},we({style:r},i)))||this).columnsGroup=new $p({name:"columns"}),n.appendChild(n.columnsGroup),n.render(),n}return xe(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,")"),Lv(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(nv({},this.attributes,t)),this.render()},e.prototype.clear=function(){this.removeChildren()},e}(Fp),eb=function(t){function e(e){var n=this,r=e.style,i=Me(e,["style"]);return(n=t.call(this,X({},{type:"lines"},we({style:r},i)))||this).linesGroup=n.appendChild(new $p),n.areasGroup=n.appendChild(new $p),n.render(),n}return xe(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(nv({},this.attributes,t)),this.render()},e.prototype.renderLines=function(t){Lv(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){Lv(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}(Fp);function nb(t,e){void 0===e&&(e=!1);var n=e?t.length-1:0,r=t.map((function(t,e){return _e([e===n?"M":"L"],Ae(t),!1)}));return e?r.reverse():r}function rb(t,e){if(void 0===e&&(e=!1),t.length<=2)return nb(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var o=e?t[r-i-1]:t[i];Z(o,n.slice(-2))||n.push.apply(n,_e([],Ae(o),!1))}var a=Av(n,!1);return e?a.unshift(_e(["M"],Ae(t[r-1]),!1)):a.unshift(_e(["M"],Ae(t[0]),!1)),a}function ib(t,e,n){var r=V(t);return r.push(["L",e,n],["L",0,n],["Z"]),r}function ob(t){return 0===t.length?[0,0]:[_(B(t,(function(t){return _(t)||0}))),A(I(t,(function(t){return A(t)||0})))]}function ab(t){for(var e=V(t),n=e[0].length,r=Ae([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 sb=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 xe(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 L(e[0])?[e]:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?ab(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=Ae(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=zv(this.attributes,"area"),a=zv(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=Ae(i.getOptions().range||[0,0],2),a=o[0],s=o[1];return s>a&&(n=Ae([a,s],2),s=n[0],a=n[1]),t.map((function(t){return t.map((function(t,e){return[r.map(e),N(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=rb(o),s=void 0;if(0===i)s=ib(a,e,n);else{var c=rb(t[i-1],!0),l=o[0];c[0][0]="L",s=_e(_e(_e([],Ae(a),!1),Ae(c),!1),[_e(["M"],Ae(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=nb(t[i]),a=void 0;if(0===i)a=ib(o,e,n);else{var s=nb(t[i-1],!0);s[0][0]="L",a=_e(_e(_e([],Ae(o),!1),Ae(s),!1),[["Z"]],!1)}r.push(a)}return r}(u,s,h):function(t,e,n,r){return t.map((function(t){return ib(e?rb(t):nb(t),n,r)}))}(u,i,s,h)}return{lines:u.map((function(e,n){return we({stroke:t.getColor(n),d:i?rb(e):nb(e)},a)})),areas:f.map((function(e,n){return we({d:e,fill:t.getColor(n)},o)}))}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columnsStyle",{get:function(){var t=this,e=zv(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=ab(s));var c=this.createScales(s),l=c.x,u=c.y,f=Ae(ob(s),2),h=f[0],d=f[1],p=new pa({domain:[0,d-(h>0?0:h)],range:[0,a*o]}),g=l.getBandWidth(),m=this.rawData;return{columns:s.map((function(n,i){return n.map((function(n,o){var a=g/s.length;return we(we({fill:t.getColor(i)},e),r?{x:l.map(o),y:u.map(n),width:g,height:p.map(m[i][o])}:{x:l.map(o)+a*i,y:n>=0?u.map(n):u.map(0),width:a,height:p.map(Math.abs(n))})}))}))}},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){var n,r,i;(n=e,r=".container",i="rect",n.querySelector(r)?Lv(n).select(r):Lv(n).append(i)).attr("className","container").node();var o=t.type,a=t.x,s=t.y,c="spark".concat(o),l=we({x:a,y:s},"line"===o?this.linesStyle:this.columnsStyle);Lv(e).selectAll(".spark").data([o]).join((function(t){return t.append((function(t){return"line"===t?new eb({className:c,style:l}):new tb({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=Ae(ob(t),2),d=h[0],p=h[1],g=new pa({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 pa({domain:[0,t[0].length-1],range:[0,u]}),y:g}:{type:i,x:new Ko({domain:t[0].map((function(t,e){return e})),range:[0,u],paddingInner:c,paddingOuter:c/2,align:.5}),y:g}},e.tag="sparkline",e}(Vv);function cb(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=Ae(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,we(we({},t[e]),n)]:[e,n]})))}function lb(t,e){t?t.finished.then(e):e()}function ub(t,e){"update"in t?t.update(e):t.attr(e)}function fb(t,e,n){return 0===e.length?null:n?t.animate(e,n):(ub(t,{style:e.slice(-1)[0]}),null)}function hb(t,e,n){var r={},i={};return Object.entries(e).forEach((function(e){var n=Ae(e,2),o=n[0],a=n[1];if(!y(a)){var s=t.style[o]||t.parsedStyle[o]||0;s!==a&&(r[o]=s,i[o]=a)}})),n?fb(t,[r,i],we({fill:"both"},n)):(ub(t,i),null)}function db(t,e){return t.style.opacity||(t.style.opacity=1),hb(t,{opacity:0},e)}var pb={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},gb={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},mb={x:0,y:0,orientation:"horizontal",showLabel:!0,type:"start"},yb=tv({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),vb=tv({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),bb=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return xe(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=Me(t,["x","y","size","radius","orientation"]),u=o,f=2.4*u,h=Lv(e).maybeAppendByClassName(vb.iconRect,"rect").styles(we(we({},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,m=r+3/4*f-f/2;h.maybeAppendByClassName("".concat(vb.iconLine,"-1"),"line").styles(we({x1:d,x2:d,y1:g,y2:m},l)),h.maybeAppendByClassName("".concat(vb.iconLine,"-2"),"line").styles(we({x1:p,x2:p,y1:g,y2:m},l)),"vertical"===c&&(h.node().style.transform="rotate(90)")},e}(Vv),xb=function(t){function e(e){return t.call(this,e,mb)||this}return xe(e,t),e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.x,i=n.y,o=n.showLabel,a=zv(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=Ae(Wv(Me(a,["x","y","transform","transformOrigin"]),[]),2),p=d[0],g=d[1],m=Lv(t).maybeAppendByClassName(vb.labelGroup,"g").styles(g),y=we(we({},gb),p),v=y.text,b=Me(y,["text"]);fv(!!o,m,(function(t){e.label=t.maybeAppendByClassName(vb.label,"text").styles(we(we({},b),{x:r+c,y:i+u,transform:f,transformOrigin:h,text:"".concat(v)})),e.label.on("mousedown",(function(t){t.stopPropagation()})),e.label.on("touchstart",(function(t){t.stopPropagation()}))}))},e.prototype.renderIcon=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.orientation,o=e.type,a=we(we({x:n,y:r,orientation:i},pb),zv(this.attributes,"icon")),s=this.attributes.iconShape,c=void 0===s?function(){return new bb({style:a})}:s;Lv(t).maybeAppendByClassName(vb.iconGroup,"g").selectAll(vb.icon.class).data([c]).join((function(t){return t.append("string"==typeof c?c:function(){return c(o)}).attr("className",vb.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}(Vv),wb=function(t){function e(e){var n=t.call(this,e,we(we(we({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},Gv(mb,"handle")),Gv(pb,"handleIcon")),Gv(gb,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(t){return function(e){e.stopPropagation(),n.target=t,n.prevPos=n.getOrientVal(lv(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(lv(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 xe(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=zv(this.attributes,"sparkline");return we(we({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=Ae(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=Ae(jv(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(yb.selection.class).each((function(n,r){hb(this,e[r],t)}))},e.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(this.startHandle&&hb(this.startHandle,this.getHandleStyle("start"),t),this.endHandle&&hb(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=zv(this.attributes,"track");this.trackShape=Lv(t).maybeAppendByClassName(yb.track,"rect").styles(we(we({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=Lv(t).maybeAppendByClassName(yb.brushArea,"rect").styles(we({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;fv("horizontal"===n.orientation,Lv(t).maybeAppendByClassName(yb.sparklineGroup,"g"),(function(t){var n=we(we({},e.sparklineStyle),{x:r,y:i});t.maybeAppendByClassName(yb.sparkline,(function(){return new sb({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(yb.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 xb({style:e.getHandleStyle(n)})})).each((function(t){var e=t.type;this.attr("class","".concat(yb.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=Lv(t).maybeAppendByClassName(yb.foreground,"g");var a=zv(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(we(we({},a),{transform:"translate(".concat(n,", ").concat(r,")")}))},c=this;this.foregroundGroup.selectAll(yb.selection.class).data("value"===i?[]:this.calcSelectionArea().map((function(t,e){return{style:we({},t),index:e,show:"select"===o?1===e:1!==e}})),(function(t){return t.index})).join((function(t){return t.append("rect").attr("className",yb.selection.name).call(s).each((function(t,e){var n=this;1===e?(c.selectionShape=Lv(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=Ae(this.range,2),i=r[0],o=r[1],a=Ae(this.getValues().map((function(t){return kv(t,e)})),2),s=a[0],c=a[1],l=Ae(((Array.isArray(t)?t:[s,null!=t?t:c])||[s,c]).map((function(t){return kv(t,e)})),2),u=l[0],f=l[1];if("value"===this.attributes.type)return[0,N(f,i,o)];u>f&&(u=(n=Ae([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=Ae(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=Ae(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=zv(this.attributes,"handle"),c=zv(s,"label"),l=s.spacing,u=this.getHandleSize(),f=this.clampValues(),h=o("start"===t?f[0]:f[1]),d=new qy({style:we(we(we({},c),this.inferTextStyle(t)),{text:h})}),p=d.getBBox(),g=p.width,m=p.height;if(d.destroy(),!a){if("value"===r)return{text:h,x:0,y:-m-l};var y=l+u+("horizontal"===i?g/2:0);return(e={text:h})["horizontal"===i?"x":"y"]="start"===t?-y:y,e}var v=0,b=0,x=this.availableSpace,w=x.width,M=x.height,O=this.calcSelectionArea()[1],E=O.x,k=O.y,S=O.width,A=O.height,_=l+u;if("horizontal"===i){var T=_+g/2;if("start"===t)v=E-_-g>0?-T:T;else v=w-E-S-_>g?T:-T}else{var P=m+_;b="start"===t?k-u>m?-P:_:M-(k+A)-u>m?P:-_}return{x:v,y:b,text:h}},e.prototype.getHandleLabelStyle=function(t){var e=zv(this.attributes,"handleLabel");return we(we(we({},e),this.calcHandleText(t)),this.inferTextStyle(t))},e.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=zv(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),r=this.getHandleSize();return we({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),we(we(we({},Gv(this.getHandleIconStyle(),"icon")),Gv(we(we({},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=Ae(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=Ae(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}(Vv),Mb=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=Ae(n.getLocalPosition(),2),r=e[0],i=e[1],o=Ae(n.padding,4),a=o[0],s=o[3],c=n.getOrientVal([r+s,i+a]),l=(n.getOrientVal(lv(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 xe(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return jv(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){var t=this.attributes.value,e=Ae(this.range,2),n=e[0],r=e[1];return N(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=Ae(this.padding,4),r=n[0],i=n[1],o=n[2],a=n[3],s=Ae(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=Ae(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=zv(this.attributes,"track"),l=zv(this.attributes,"thumb"),u=we(we({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()},Gv(c,"track")),Gv(l,"selection"));this.slider=Lv(t).maybeAppendByClassName("scrollbar",(function(){return new wb({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=Ae(this.range,2),i=r[0],o=r[1];this.slider.setValues(this.getValues(N(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}(Vv),Ob={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 Up({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:[]};X({},Ob,{style:{type:"arc"}}),X({},Ob,{style:{}});var Eb=tv({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"),kb=tv({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function Sb(t){return t.reduce((function(t,e,n){return t.push(_e([0===n?"M":"L"],Ae(e),!1)),t}),[])}function Ab(t,e,n){return"surround"===e.type?function(t,e,n){var r=e.connect,i=void 0===r?"line":r,o=e.center;if("line"===i)return Sb(t);if(!o)return[];var a=Ov(t[0],o),s=n?0:1;return t.reduce((function(t,e,n){return 0===n?t.push(_e(["M"],Ae(e),!1)):t.push(_e(["A",a,a,0,0,s],Ae(e),!1)),t}),[])}(t,e,n):Sb(t)}function _b(t,e,n){var r=n.type,i=n.connect,o=n.center,a=n.closed?[["Z"]]:[],s=Ae([Ab(t,n),Ab(e.slice().reverse(),n,!0)],2),c=s[0],l=s[1],u=Ae([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([_e(["L"],Ae(h),!1)],[_e(["L"],Ae(f),!1)]);if(!o)throw new Error("Arc grid need to specified center");var p=Ae([Ov(h,o),Ov(f,o)],2),g=p[0],m=p[1];return d([_e(["A",g,g,0,0,1],Ae(h),!1),_e(["L"],Ae(h),!1)],[_e(["A",m,m,0,0,0],Ae(f),!1),_e(["L"],Ae(f),!1)])}var Tb=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return xe(e,t),e.prototype.render=function(t,e){var n=Me(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=Ae(e,1)[0];return we(we({},t),{points:_e(_e([],Ae(e),!1),[n],!1)})})):n}(t),i=Lv(e).maybeAppendByClassName(kb.lineGroup,"g"),o=Lv(e).maybeAppendByClassName(kb.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:Ab(t.points,n)}}));return t.selectAll(kb.line.class).data(a,(function(t){return t.id})).join((function(t){return t.append("path").each((function(t,e){var n=Qy(Pv(we({d:t.d},r)),[t,e,a]);this.attr(we({class:kb.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:o},n))}))}),(function(t){return t.transition((function(t,e){return hb(this,Qy(Pv(we({d:t.d},r)),[t,e,a]),i.update)}))}),(function(t){return t.transition((function(){var t=this,e=db(this,i.exit);return lb(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=Ae([e[l].points,e[l+1].points],2),f=_b(u[0],u[1],n);c.push({d:f,fill:s(l)})}return t.selectAll(kb.region.class).data(c,(function(t,e){return e})).join((function(t){return t.append("path").each((function(t,e){var n=Qy(t,[t,e,c]);this.attr(n)})).attr("className",kb.region.name)}),(function(t){return t.transition((function(t,e){return hb(this,Qy(t,[t,e,c]),r.update)}))}),(function(t){return t.transition((function(){var t=this,e=db(this,r.exit);return lb(e,(function(){return t.remove()})),e}))})).transitions()}(o,r,t);return _e(_e([],Ae(a),!1),Ae(s),!1)},e}(Vv);function Pb(t,e){return Object.fromEntries(Object.entries(t).map((function(t){var n=Ae(t,2);return[n[0],Qy(n[1],e)]})))}function Cb(t,e){return e&&m(e)?t.filter(e):t}function Nb(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n}function Lb(t,e){if("linear"===e.type){var n=Ae(e.startPos,2),r=n[0],i=n[1],o=Ae(e.endPos,2),a=Ae([o[0]-r,o[1]-i],2);return Ev([a[0],a[1]])}var s=Xy(Nb(t,e));return[-Math.sin(s),Math.cos(s)]}function jb(t,e,n){return function(t,e){return e?[t[1],-t[0]]:[-t[1],t[0]]}(Lb(t,n),"positive"!==e)}function Rb(t,e){return jb(t,e.labelDirection,e)}function Ib(t,e){return"linear"===e.type?function(t,e){var n=Ae(e.startPos,2),r=n[0],i=n[1],o=Ae(e.endPos,2),a=Ae([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=Ae(e.center,2),i=r[0],o=r[1],a=Xy(Nb(t,e));return[i+n*Math.cos(a),o+n*Math.sin(a)]}(t,e)}function Bb(t){return 0===Lb(0,t)[1]}function Db(t){return 0===Lb(0,t)[0]}function Fb(t,e){return e-t==360}function zb(t,e,n,r,i){var o=e-t,a=Ae([i,i],2),s=a[0],c=a[1],l=Ae([Xy(t),Xy(e)],2),u=l[0],f=l[1],h=function(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]},d=Ae(h(u),2),p=d[0],g=d[1],m=Ae(h(f),2),y=m[0],v=m[1];if(Fb(t,e)){var b=Ae(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,v]]}var x=o>180?1:0,w=t>e?0:1;return"M".concat(p,",").concat(g,",A").concat(s,",").concat(c,",0,").concat(x,",").concat(w,",").concat(y,",").concat(v)}function Gb(t,e,n,r){var i=e.startAngle,o=e.endAngle,a=e.center,s=e.radius;return t.selectAll(Eb.line.class).data([{d:zb.apply(void 0,_e(_e([i,o],Ae(a),!1),[s],!1))}],(function(t,e){return e})).join((function(t){return t.append("path").attr("className",Eb.line.name).styles(e).styles({d:function(t){return t.path}})}),(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=pv(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,we({fill:"both"},r))}(this,function(t){var e=t.attributes,n=e.startAngle,r=e.endAngle,i=e.center,o=e.radius;return _e(_e([n,r],Ae(i),!1),[o],!1)}(this),_e(_e([i,o],Ae(a),!1),[s],!1),r.update);if(e){var n=function(){var e=Q(t.attributes,"__keyframe_data__");t.style.path=zb.apply(void 0,_e([],Ae(e),!1))};e.onframe=n,e.onfinish=n}return e})).styles(e)}),(function(t){return t.remove()})).styles(n).transitions()}function Wb(t){var e=Ae(t,2),n=Ae(e[0],2),r=n[0],i=n[1],o=Ae(e[1],2);return{x1:r,y1:i,x2:o[0],y2:o[1]}}function $b(t,e,n,r){var i=e.showTrunc,o=e.startPos,a=e.endPos,s=e.truncRange,c=e.lineExtension,l=Ae([o,a],2),u=Ae(l[0],2),f=u[0],h=u[1],d=Ae(l[1],2),p=d[0],g=d[1],m=Ae(c?function(t,e,n){void 0===n&&(n=[0,0]);var r=Ae([t,e,n],3),i=Ae(r[0],2),o=i[0],a=i[1],s=Ae(r[1],2),c=s[0],l=s[1],u=Ae(r[2],2),f=u[0],h=u[1],d=Ae([c-o,l-a],2),p=d[0],g=d[1],m=Math.sqrt(Math.pow(p,2)+Math.pow(g,2)),y=Ae([-f/m,h/m],2),v=y[0],b=y[1];return[v*p,v*g,b*p,b*g]}(o,a,c):new Array(4).fill(0),4),y=m[0],v=m[1],b=m[2],x=m[3],w=function(e){return t.selectAll(Eb.line.class).data(e,(function(t,e){return e})).join((function(t){return t.append("line").attr("className",(function(t){return"".concat(Eb.line.name," ").concat(t.className)})).styles(n).transition((function(t){return hb(this,Wb(t.line),!1)}))}),(function(t){return t.styles(n).transition((function(t){return hb(this,Wb(t.line),r.update)}))}),(function(t){return t.remove()})).transitions()};if(!i||!s)return w([{line:[[f+y,h+v],[p+b,g+x]],className:Eb.line.name}]);var M=Ae(s,2),O=M[0],E=M[1],k=p-f,S=g-h,A=Ae([f+k*O,h+S*O],2),_=A[0],T=A[1],P=Ae([f+k*E,h+S*E],2),C=P[0],N=P[1];return w([{line:[[f+y,h+v],[_,T]],className:Eb.lineFirst.name},{line:[[C,N],[p+b,g+x]],className:Eb.lineSecond.name}])}function Hb(t,e,n){var r,i=e.type,o=zv(e,"line");return r="linear"===i?$b(t,e,Sv(o,"arrow"),n):Gb(t,e,Sv(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(Eb.line.class):a?t.select(Eb.lineSecond.class):t.select(Eb.line.class),!o||!s||"arc"===n.type&&Fb(n.startAngle,n.endAngle)){var u=i.node();u&&(u.style.markerEnd=void 0)}else{var f=uv(s);f.attr(r),Cv(f,l,!0),i.style("markerEnd",f).style("markerEndOffset",-c)}}(t,i,e,o),r}function Vb(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function Yb(t,e){var n=e.gridLength;return t.map((function(t,r){var i=t.value,o=Ae(Ib(i,e),2),a=o[0],s=o[1],c=Ae(vv(function(t,e){return jb(t,e.gridDirection,e)}(i,e),n),2);return{id:r,points:[[a,s],[a+c[0],s+c[1]]]}}))}function Ub(t,e,n,r){var i=zv(n,"grid"),o=i.type,a=i.areaFill,s=Vb(n),c=Cb(e,n.gridFilter),l="segment"===o?Yb(c,n):function(t,e){var n=e.gridControlAngles,r=Vb(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=Ae(r,2),o=i[0],a=i[1];return t.map((function(t,r){var i=Ae(Ib(t.value,e),2),s=i[0],c=i[1],l=Ae([s-o,c-a],2),u=l[0],f=l[1],h=[];return n.forEach((function(t){var e=Xy(t),n=Ae([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=we(we({},i),{center:s,areaFill:m(a)?c.map((function(t,e){return Qy(a,[t,e,c])})):a,animate:r,data:l});return t.selectAll(Eb.grid.class).data([1]).join((function(t){return t.append((function(){return new Tb({style:u})})).attr("className",Eb.grid.name)}),(function(t){return t.transition((function(){return this.update(u)}))}),(function(t){return t.remove()})).transitions()}var qb=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 Xb(t,e){var n=t.getEulerAngles()||0;t.setEulerAngles(0);var r=t.getLocalBounds(),i=Ae(r.min,2),o=i[0],a=i[1],s=Ae(r.max,2),c=s[0],l=s[1],u=t.getBBox(),f=u.width,h=u.height,d=0,p=0,g=o,m=a,y=av(t);if(y){h-=1.5;var v=y.style.textAlign,b=y.style.textBaseline;"center"===v?g=(o+c)/2:"right"!==v&&"end"!==v||(g=c),"middle"===b?m=(a+l)/2:"bottom"===b&&(m=l)}var x=Ae(jv(e),4),w=x[0],M=void 0===w?0:w,O=x[1],E=void 0===O?0:O,k=x[2],S=void 0===k?M:k,A=x[3],_=new qb((d+=o)-(void 0===A?E:A),(p+=a)-M,d+f+E,p+h+S);return t.setEulerAngles(n),_.rotatedPoints(Xy(n),g,m)}function Kb(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 Zb(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 Qb(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=Zb((r=h)[0],r[1],i[0]),a=Zb(r[0],r[1],i[1]),s=Zb(i[0],i[1],r[0]),c=Zb(i[0],i[1],r[1]),o!==a&&s!==c||0===o&&Kb(r,i[0])||0===a&&Kb(r,i[1])||0===s&&Kb(i,r[0])||0===c&&Kb(i,r[1])){if(0===Zb(h[0],e,h[1]))return Kb(h,e);u++}f=(f+1)%n}while(0!==f);return!!(1&u)}(t,e)}))}function Jb(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=Ae(t,4),r=n[0],i=n[1],o=n[2],a=n[3],s=Ae(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,m=r-c,y=i-l,v=u*y-f*m;if(v<0===g)return!1;var b=h*y-d*m;return b<0!==g&&v>p!==g&&b>p!==g}(e,t)}))}function tx(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=Ae(o,2),c=s[0],l=s[1],u="negative"===r?0:i,f=-a-u,h=a+u,d=Ae(jv(e),4),p=d[0],g=d[1],m=d[2],y=d[3];return new qb(c+f-y,l+f-p,c+h+g,l+h+m)}var v=Ae(t.startPos,2),b=v[0],x=v[1],w=Ae(t.endPos,2),M=w[0],O=w[1],E=Ae(Db(t)?[-e,0,e,0]:[0,e,0,-e],4),k=E[0],S=E[1],A=E[2],_=E[3],T=vv(Rb(0,t),i),P=new qb(b,x,M,O);return P.x1+=_,P.y1+=k,P.x2+=S+T[0],P.y2+=A+T[1],P}(e,o),l=function(t){return!c||function(t,e,n){var r=t.x1,i=t.x2,o=t.y1,a=t.y2;return Qb([[r,o],[i,o],[i,a],[r,a]],Xb(e,n))}(c,t)},u=function(t,e){return!t||!function(t,e,n){var r,i,o=Xb(t,n).flat(1),a=Xb(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=Se(s),l=c.next();!l.done;l=c.next())if(Jb(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,e,jv(n))};try{for(var f=Se(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 ex(t,e){return void 0===e&&(e={}),y(t)?0:"number"==typeof t?t:Math.floor(iv(t,e))}var nx=function(t,e){var n=e.seq,r=void 0===n?2:n;return t.filter((function(t,e){return!(e%r)||(Hy(t),!1)}))};var rx=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=nx,f=function(t){return t.forEach(r.show),t},h=2,d=t.slice(),p=t.slice(),g=Math.min.apply(Math,_e([1],Ae(t.map((function(t){return t.getBBox().width}))),!1));if("linear"===n.type&&(Bb(n)||Db(n))){var m=Rv(t[0]).left,y=Rv(t[i-1]).right,v=Math.abs(y-m)||1;h=Math.max(Math.floor(i*g/v),h)}for(o&&(s=d.splice(0,1)[0]),a&&(c=d.splice(-1,1)[0],d.reverse()),f(d);h<t.length&&tx((l=c?_e(_e([c],Ae(p),!1),[s],!1):_e([s],Ae(p),!1),l.filter(rv)),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=Se(s),p=d.next();!p.done;p=d.next()){if(h(p.value),tx(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=ov(r.getTextShape(t[0])),p=ex(u,d),g=a?ex(a,d):p,m=ex(c,d);(y(m)||m===1/0)&&(m=Math.max.apply(null,t.map((function(t){return t.getBBox().width}))));var v=t.slice();Ae(h,4);for(var b=function(e){if(v.forEach((function(t){r.ellipsis(r.getTextShape(t),e,o)})),(v=tx(t,n,h)).length<1)return{value:void 0}},x=m;x>g+p;x-=p){var w=b(x);if("object"==typeof w)return w.value}}}],["wrap",function(t,e,n,r){var i=e.wordWrapWidth,o=void 0===i?50:i,a=e.maxLines,s=void 0===a?3:a,c=e.recoverWhenFailed,l=void 0===c||c,u=e.margin,f=void 0===u?[0,0,0,0]:u,h=t.map((function(t){return t.attr("maxLines")||1})),d=Math.min.apply(Math,_e([],Ae(h),!1)),p=function(t){var e=t.type,n=t.labelDirection;return"linear"===e&&Bb(t)?"negative"===n?"bottom":"top":"middle"}(n),g=function(e){return t.forEach((function(t,n){var i=Array.isArray(e)?e[n]:e;r.wrap(t,o,i,p)}))};if(!(d>s)){for(var m=d;m<=s;m++)if(g(m),tx(t,n,f).length<1)return;l&&g(h)}}]]);function ix(){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 ox(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}function ax(t,e){var n=Ae(t,2),r=n[0],i=n[1],o=Ae(e,2),a=o[0],s=o[1],c=Ae([r*a+i*s,r*s-i*a],2),l=c[0],u=c[1];return Math.atan2(u,l)}function sx(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=Rb(t.value,n),a=Lb(t.value,n);return"horizontal"===i?0:function(t){var e=(t+360)%180;return hv(e,-90,90)||(e+=180),e}(Ky("perpendicular"===i?ax([1,0],o):ax([a[0]<0?-1:1,0],a)))}function cx(t,e,n){var r=n.type,i=n.labelAlign,o=Rb(t,n),a=ox(e),s=ox(Ky(ax([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?(hv(a,0,90,!1,!0)||hv(a,0,90)||hv(a,270,360))&&(c="start"):90===s?hv(a,0,90,!1,!0)?c="start":(hv(a,90,180)||hv(a,270,360))&&(c="end"):270===s?hv(a,0,90,!1,!0)?c="end":(hv(a,90,180)||hv(a,270,360))&&(c="start"):180===s&&(90===a?c="start":(hv(a,0,90)||hv(a,270,360))&&(c="end")):c="center":"parallel"===i?l=hv(s,0,180,!0)?"top":"bottom":"horizontal"===i?hv(s,90,270,!1)?c="end":(hv(s,270,360,!1)||hv(s,0,90))&&(c="start"):"perpendicular"===i&&(c=hv(s,90,270)?"end":"start"),{textAlign:c,textBaseline:l}}function lx(t,e,n){var r=n.showTick,i=n.tickLength,o=n.tickDirection,a=n.labelDirection,s=n.labelSpacing,c=e.indexOf(t),l=Qy(s,[t,c,e]),u=Ae([Rb(t.value,n),ix(a,o)],2),f=Ae(bv(vv(u[0],l+(1===u[1]?Qy(r?i:0,[t,c,e]):0)),Ib(t.value,n)),2);return{x:f[0],y:f[1]}}function ux(t,e){"text"===t.nodeName&&t.attr(e)}function fx(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=rx.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:Hy,show:$y,rotate:function(e,n){!function(t,e,n){e.setLocalEulerAngles(t);var r=cx(e.__data__.value,t,n),i=e.querySelector(Eb.labelItem.class);i&&ux(i,r)}(+n,e,t)},ellipsis:function(t,e,n){t&&cv(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"),sv(t,{wordWrap:!0,wordWrapWidth:e,maxLines:r,textBaseline:i}))},getTextShape:function(t){return t.querySelector("text")}})}function hx(t,e,n,r,i){var o=n.indexOf(e),a=Lv(t).append(function(t,e,n,r){var i=r.labelFormatter;return m(i)?function(){return uv(Qy(i,[t,e,n,Rb(t.value,r)]))}:function(){return uv(t.label||"")}}(e,o,n,i)).attr("className",Eb.labelItem.name).node(),s=Ae(Wv(Pb(r,[e,o,n])),2),c=s[0],l=s[1],u=l.transform,f=Me(l,["transform"]);$v(a,u);var h=sx(e,a,i);return a.getLocalEulerAngles()||a.setLocalEulerAngles(h),ux(a,we(we({},cx(e.value,h,i)),c)),t.attr(f),a}function dx(t,e,n,r){var i=Cb(e,n.labelFilter),o=zv(n,"label");return t.selectAll(Eb.label.class).data(i,(function(t,e){return e})).join((function(r){return r.append("g").attr("className",Eb.label.name).transition((function(t){hx(this,t,e,o,n);var r=lx(t,e,n),i=r.x,a=r.y;return this.style.transform="translate(".concat(i,", ").concat(a,")"),null})).call((function(){return fx.call(t,n)}))}),(function(i){return i.transition((function(t){var i=function(t,e,n,r){if(void 0===r&&(r="destroy"),function(t,e){return"text"===t.nodeName&&"text"===e.nodeName&&t.attributes.text===e.attributes.text}(t,e))return t.remove(),[null];var i=function(){"destroy"===r?t.destroy():"hide"===r&&Hy(t),e.isVisible()&&$y(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=Ae(t.getGeometryBounds().center,2),h=f[0],d=f[1],p=Ae(e.getGeometryBounds().center,2),g=Ae([(h+p[0])/2-h,(d+p[1])/2-d],2),m=g[0],y=g[1],v=t.style.opacity,b=void 0===v?1:v,x=e.style.opacity,w=void 0===x?1:x,M=t.style.transform||"",O=e.style.transform||"",E=t.animate([{opacity:b,transform:"translate(0, 0) ".concat(M)},{opacity:0,transform:"translate(".concat(m,", ").concat(y,") ").concat(M)}],we(we({fill:"both"},n),{duration:c+l+u})),k=e.animate([{opacity:0,transform:"translate(".concat(-m,", ").concat(-y,") ").concat(O),offset:.01},{opacity:w,transform:"translate(0, 0) ".concat(O)}],we(we({fill:"both"},n),{duration:l+u,delay:c+l-u}));return lb(k,i),[E,k]}(this.querySelector(Eb.labelItem.class),hx(this,t,e,o,n),r.update),a=lx(t,e,n),s=a.x,c=a.y,l=hb(this,{transform:"translate(".concat(s,", ").concat(c,")")},r.update);return _e(_e([],Ae(i),!1),[l],!1)})).call((function(e){var r,i,o=Q(e,"_transitions").flat().filter(rv);i=function(){return fx.call(t,n)},0===(r=o).length?i():Promise.all(r.map((function(t){return null==t?void 0:t.finished}))).then(i)}))}),(function(t){return t.transition((function(){var t=this,e=db(this.childNodes[0],r.exit);return lb(e,(function(){return Lv(t).remove()})),e}))})).transitions()}function px(t,e){return jb(t,e.tickDirection,e)}function gx(t,e,n,r,i){var o=Ae(function(t,e){var n=Ae(t,2);return[[0,0],[n[0]*e,n[1]*e]]}(r,Qy(i.tickLength,[t,e,n])),2),a=Ae(o[0],2),s=a[0],c=a[1],l=Ae(o[1],2);return{x1:s,x2:l[0],y1:c,y2:l[1]}}function mx(t,e,n,r,i,o){var a=function(t,e,n,r,i){var o=i.tickFormatter,a=px(e.value,i),s="line";return m(o)&&(s=function(){return Qy(o,[e,n,r,a])}),t.append(s).attr("className",Eb.tickItem.name)}(Lv(this),t,e,n,r);!function(t,e,n,r,i,o,a){var s=px(t.value,o),c=gx(t,e,n,s,o),l=c.x1,u=c.x2,f=c.y1,h=c.y2,d=Ae(Wv(Pb(a,[t,e,n,s])),2),p=d[0],g=d[1];"line"===r.node().nodeName&&r.styles(we({x1:l,x2:u,y1:f,y2:h},p)),i.attr(g),r.styles(p)}(t,e,n,a,this,r,i);var s=Ae(Ib(t.value,r),2),c=s[0],l=s[1];return hb(this,{transform:"translate(".concat(c,", ").concat(l,")")},o)}var yx=tv({text:"text"},"title");function vx(t){return/\S+-\S+/g.test(t)?t.split("-").map((function(t){return t[0]})):t.length>2?[t[0]]:t.split("")}function bx(t,e){var n=Object.entries(e).reduce((function(e,n){var r=Ae(n,2),i=r[0],o=r[1];return t.node().attr(i)||(e[i]=o),e}),{});t.styles(n)}var xx=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 xe(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(yx.text.class);if(!a)return new Zy(0,0,+e,+n);var s=a.getBBox(),c=s.width,l=s.height,u=Ae(jv(i),4),f=u[0],h=u[1],d=u[2],p=u[3],g=Ae([0,0,+e,+n],4),m=g[0],y=g[1],v=g[2],b=g[3],x=vx(r);if(x.includes("i"))return new Zy(m,y,v,b);x.forEach((function(t,r){var i,o,a,s;"t"===t&&(i=Ae(0===r?[l+d,+n-l-d]:[0,+n],2),y=i[0],b=i[1]),"r"===t&&(o=Ae([+e-c-p],1),v=o[0]),"b"===t&&(a=Ae([+n-l-f],1),b=a[0]),"l"===t&&(s=Ae(0===r?[c+h,+e-c-h]:[0,+e],2),m=s[0],v=s[1])}));var w=Ae(jv(o),4),M=w[0],O=w[1],E=w[2],k=w[3],S=Ae([k+O,M+E],2),A=S[0],_=S[1];return new Zy(m+k,y+M,v-A,b-_)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new Zy(0,0,0,0)},e.prototype.render=function(t,e){var n=this,r=Me(t,["width","height","position","spacing"]),i=Ae(Wv(r),1)[0],o=function(t){var e,n,r,i,o=t,a=o.width,s=o.height,c=o.position,l=Ae([+a/2,+s/2],2),u=Ae([+l[0],+l[1],"center","middle"],4),f=u[0],h=u[1],d=u[2],p=u[3],g=vx(c);return g.includes("l")&&(f=(e=Ae([0,"start"],2))[0],d=e[1]),g.includes("r")&&(f=(n=Ae([+a,"end"],2))[0],d=n[1]),g.includes("t")&&(h=(r=Ae([0,"top"],2))[0],p=r[1]),g.includes("b")&&(h=(i=Ae([+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;fv(!!r.text,Lv(e),(function(t){n.title=t.maybeAppendByClassName(yx.text,"text").styles(i).call(bx,{x:a,y:s,textAlign:c,textBaseline:l}).node()}))},e}(Vv);function wx(t,e,n,r,i){var o=Ae(Wv(zv(r,"title")),2),a=o[0],s=o[1],c=s.transform,l=s.transformOrigin,u=Me(s,["transform","transformOrigin"]);e.styles(u);var f=c||function(t,e,n){var r=t.cloneNode(!0).getBBox().height;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(we(we({},a),{transformOrigin:l})),$v(t.node(),f);var h=function(t,e,n){var r=n.titlePosition,i=void 0===r?"lb":r,o=n.titleSpacing,a=vx(i),s=t.node().getLocalBounds(),c=Ae(s.min,2),l=c[0],u=c[1],f=Ae(s.halfExtents,2),h=f[0],d=f[1],p=Ae(e.node().getLocalBounds().halfExtents,2),g=p[0],m=p[1],y=Ae([l+h,u+d],2),v=y[0],b=y[1],x=Ae(jv(o),4),w=x[0],M=x[1],O=x[2],E=x[3];if(["start","end"].includes(i)&&"linear"===n.type){var k=n.startPos,S=n.endPos,A=Ae("start"===i?[k,S]:[S,k],2),_=A[0],T=A[1],P=Ae(vv(Ev([-T[0]+_[0],-T[1]+_[1]]),w),2),C=P[0],N=P[1];return{x:_[0]+C,y:_[1]+N}}return a.includes("t")&&(b-=d+m+w),a.includes("r")&&(v+=h+g+M),a.includes("l")&&(v-=h+g+E),a.includes("b")&&(b+=d+m+O),{x:v,y:b}}(Lv(n._offscreen||n.querySelector(Eb.mainGroup.class)),e,r),d=h.x,p=h.y;return hb(e.node(),{transform:"translate(".concat(d,", ").concat(p,")")},i)}function Mx(t,e,n,r){var i=t.showLine,o=t.showTick,a=t.showLabel,s=fv(i,e.maybeAppendByClassName(Eb.lineGroup,"g"),(function(e){return Hb(e,t,r)}))||[],c=fv(o,e.maybeAppendByClassName(Eb.tickGroup,"g"),(function(e){return function(t,e,n,r){var i=Cb(e,n.tickFilter),o=zv(n,"tick");return t.selectAll(Eb.tick.class).data(i,(function(t){return t.id||t.label})).join((function(t){return t.append("g").attr("className",Eb.tick.name).transition((function(t,e){return mx.call(this,t,e,i,n,o,!1)}))}),(function(t){return t.transition((function(t,e){return this.removeChildren(),mx.call(this,t,e,i,n,o,r.update)}))}),(function(t){return t.transition((function(){var t=this,e=db(this.childNodes[0],r.exit);return lb(e,(function(){return t.remove()})),e}))})).transitions()}(e,n,t,r)}))||[],l=fv(a,e.maybeAppendByClassName(Eb.labelGroup,"g"),(function(e){return dx(e,n,t,r)}))||[];return _e(_e(_e([],Ae(s),!1),Ae(c),!1),Ae(l),!1).filter((function(t){return!!t}))}var Ox=function(t){function e(e){return t.call(this,e,Ob)||this}return xe(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=cb(void 0===n?a:n),d=fv(c,Lv(e).maybeAppendByClassName(Eb.gridGroup,"g"),(function(e){return Ub(e,f,t,h)}))||[],p=Lv(e).maybeAppendByClassName(Eb.mainGroup,"g");i&&(!this.initialized&&h.enter||this.initialized&&h.update)&&Mx(t,Lv(this.offscreenGroup),f,cb(!1));var g=Mx(t,Lv(p.node()),f,h),m=fv(s,Lv(e).maybeAppendByClassName(Eb.titleGroup,"g"),(function(e){return function(t,e,n,r){var i=n.titleText;return t.selectAll(Eb.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 uv(i)})).attr("className",Eb.title.name).transition((function(){return wx(Lv(this),t,e,n,r.enter)}))}),(function(i){return i.transition((function(){return wx(Lv(this),t,e,n,r.update)}))}),(function(t){return t.remove()})).transitions()}(e,r,t,h)}))||[];return _e(_e(_e([],Ae(d),!1),Ae(g),!1),Ae(m),!1).flat().filter((function(t){return!!t}))},e}(Vv),Ex=tv({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"),kx=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:Zv(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 $p({class:Ex.contentGroup.name})),n.playWindow=n.contentGroup.appendChild(new $p({class:Ex.playWindow.name})),n.innerCurrPage=n.defaultPage,n}return xe(e,t),Object.defineProperty(e.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return N(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=Ae(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,_e([],Ae(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 Zy(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=Ae(this.getFollowingPageDiff(t),2),l=c[0],u=c[1];this.playState="running";var f=fb(a,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-l,", ").concat(-u,")")}],n);return lb(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:N(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:N(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(Ex.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)?$y(e):Hy(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=Ae("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,m=p.height,y=Math.max(h,s,g),v="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,m+a]],textAlign:"center"},b=Ae(v.offset,3),x=Ae(b[0],2),w=x[0],M=x[1],O=Ae(b[1],2),E=O[0],k=O[1],S=Ae(b[2],2),A=S[0],_=S[1],T=v.textAlign,P=r.querySelector("text");P&&(P.style.textAlign=T),e.setLocalPosition(w,M),r.setLocalPosition(E,k),n.setLocalPosition(A,_)},e.prototype.updatePageInfo=function(){var t,e=this,n=e.currPage,r=e.pageViews,i=e.attributes.formatter;r.length<2||(null===(t=this.pageInfoGroup.querySelector(Ex.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=Ae(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(Ex.controller,"g");if(Vy(s.node(),a),a){var c=zv(this.attributes,"button"),l=zv(this.attributes,"pageNum"),u=Ae(Wv(c),2),f=u[0],h=u[1],d=f.size,p=Me(f,["size"]),g=!s.select(Ex.prevBtnGroup.class).node(),m=s.maybeAppendByClassName(Ex.prevBtnGroup,"g").styles(h);this.prevBtnGroup=m.node();var y=m.maybeAppendByClassName(Ex.prevBtn,"path"),v=s.maybeAppendByClassName(Ex.nextBtnGroup,"g").styles(h);this.nextBtnGroup=v.node(),[y,v.maybeAppendByClassName(Ex.nextBtn,"path")].forEach((function(t){t.styles(we(we({},p),{transformOrigin:"center"})),Cv(t.node(),d,!0)}));var b=s.maybeAppendByClassName(Ex.pageInfoGroup,"g");this.pageInfoGroup=b.node(),b.maybeAppendByClassName(Ex.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=Lv(e);this.renderClipPath(a),this.renderController(a),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},e.prototype.bindEvents=function(){var t=this,e=Y((function(){return t.render(t.attributes,t)}),50);this.playWindow.addEventListener(sp.INSERTED,e),this.playWindow.addEventListener(sp.REMOVED,e)},e}(Vv);function Sx(t,e,n){return void 0===t&&(t="horizontal"),"horizontal"===t?e:n}Jv.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"]]})),Jv.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]]})),Jv.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 Ax=tv({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 _x=function(t){function e(e){return t.call(this,e,{span:[1,1],marker:function(){return new zp({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}return xe(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=Ae(jv(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=Ae(this.spacing,2),f=u[0],h=u[1];if(r){var d=r-n-f-h,p=Ae(this.span,2);c=(t=Ae([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=Ae(jv(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=Ae(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(Ax.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=zv(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(Ax.markerGroup,"g").style("zIndex",0),fv(!!n,this.markerGroup,(function(){var t=e.markerGroup.node(),i=t.getElementsByClassName(Ax.marker.name)[0],o=n();i?o.nodeName===i.nodeName?(!function(t,e){var n,r,i=e.attributes;try{for(var o=Se(Object.entries(i)),a=o.next();!a.done;a=o.next()){var s=Ae(a.value,2),c=s[0],l=s[1];"id"!==c&&"className"!==c&&t.attr(c,l)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}(i,o),Lv(i).styles(r)):(i.remove(),Lv(o).attr("className",Ax.marker.name).styles(r),t.appendChild(o)):(Lv(o).attr("className",Ax.marker.name).styles(r),t.appendChild(o)),e.markerGroup.node().scale(1/e.markerGroup.node().getScale()[0]);var a=Cv(e.markerGroup.node(),e.scaleSize,!0);e.markerGroup.node().style._transform="scale(".concat(a,")")}))},e.prototype.renderLabel=function(t){var e=zv(this.attributes,"label"),n=e.text,r=Me(e,["text"]);this.labelGroup=t.maybeAppendByClassName(Ax.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(Ax.label,(function(){return uv(n)})).styles(r)},e.prototype.renderValue=function(t){var e=this,n=zv(this.attributes,"value"),r=n.text,i=Me(n,["text"]);this.valueGroup=t.maybeAppendByClassName(Ax.valueGroup,"g").style("zIndex",0),fv(this.showValue,this.valueGroup,(function(){e.valueGroup.maybeAppendByClassName(Ax.value,(function(){return uv(r)})).styles(i)}))},e.prototype.renderBackground=function(t){var e=this.shape,n=e.width,r=e.height,i=zv(this.attributes,"background");this.background=t.maybeAppendByClassName(Ax.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(Ax.background,"rect").styles(we({width:n,height:r},i))},e.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,i=Ae(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,")")}),cv(this.labelGroup.select(Ax.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({transform:"translate(".concat(s,", ").concat(c,")")}),cv(this.valueGroup.select(Ax.value.class).node(),Math.ceil(n)))},e.prototype.render=function(t,e){var n=Lv(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}(Vv),Tx=tv({page:"item-page",navigator:"navigator",item:"item"},"items"),Px=function(t,e,n){return void 0===n&&(n=!0),t?e(t):n},Cx=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:rt,mouseenter:rt,mouseleave:rt})||this;return n.navigatorShape=[0,0],n}return xe(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=zv(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:we({layout:n,labelText:s,valueText:c},Object.fromEntries(Object.entries(r).map((function(n){var r=Ae(n,2);return[r[0],Qy(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=Ae(this.navigatorShape,1)[0],s=Ae(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,m=t.ifHorizontal(l,c),y=[Math.floor(g/m),g%m];"vertical"===n&&y.reverse();var v=Ae(y,2),b=v[0],x=v[1],w=(r-a-(l-1)*o)/l,M=e.getBBox().height,O=Ae([0,0],2),E=O[0],k=O[1];return"horizontal"===n?(E=(h=Ae([f,b*(M+i)],2))[0],k=h[1],f=x===l-1?0:f+w+o):(E=(d=Ae([x*(w+o),f],2))[0],k=d[1],f=b===c-1?0:f+M+i),{page:p,index:s,row:b,col:x,pageIndex:g,width:w,height:M,x:E,y:k}}))},e.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,r=t.rowPadding,i=t.colPadding,o=Ae(this.navigatorShape,1)[0],a=Ae(this.grid,2),s=a[0],c=a[1],l=Ae([e-o,n],2),u=l[0],f=l[1],h=Ae([0,0,0,0,0,0,0,0],8),d=h[0],p=h[1],g=h[2],m=h[3],y=h[4],v=h[5],b=h[6],x=h[7];return this.pageViews.children.map((function(t,e){var n,o,a,l,h=t.getBBox(),w=h.width,M=h.height,O=0===b?0:i,E=b+O+w;return E<=u&&Px(y,(function(t){return t<c}))?(n=Ae([b+O,x,E],3),d=n[0],p=n[1],b=n[2],{width:w,height:M,x:d,y:p,page:g,index:e,pageIndex:m++,row:v,col:y++}):(o=Ae([v+1,0,0,x+M+r],4),v=o[0],y=o[1],b=o[2],(x=o[3])+M<=f&&Px(v,(function(t){return t<s}))?(a=Ae([b,x,w],3),d=a[0],p=a[1],b=a[2],{width:w,height:M,x:d,y:p,page:g,index:e,pageIndex:m++,row:v,col:y++}):(l=Ae([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],m=l[5],v=l[6],y=l[7],{width:w,height:M,x:d,y:p,page:g,index:e,pageIndex:m++,row:v,col:y++}))}))},Object.defineProperty(e.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var t="grid"===this.attributes.layout?this.getGridLayout:this.getFlexLayout,e=t.call(this);return e.slice(-1)[0].page>0?(this.navigatorShape=[55,0],t.call(this)):e},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Sx(this.attributes.orientation,t,e)},e.prototype.flattenPage=function(t){t.querySelectorAll(Tx.item.class).forEach((function(e){t.appendChild(e)})),t.querySelectorAll(Tx.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);Lv(t).selectAll(Tx.item.class).data(this.renderData,(function(t){return t.id})).join((function(t){return t.append((function(t){var e=t.style;return new _x({style:e})})).attr("className",Tx.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=Ae(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=Ae(t,2);return{page:e[0],layouts:e[1]}})),i=_e([],Ae(this.navigator.getContainer().children),!1);r.forEach((function(t){var e=t.layouts,r=n.pageViews.appendChild(new $p({className:Tx.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=P(e)?e.split("."):e;i.forEach((function(t,e){e<i.length-1?(w(r[t])||(r[t]=L(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=zv(this.attributes,"nav"),r=nv({orientation:e},n),i=this;return t.selectAll(Tx.navigator.class).data(["nav"]).join((function(t){return t.append((function(){return new kx({style:r})})).attr("className",Tx.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(Lv(e));this.renderItems(r.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(t,e){var n=new np(t,{detail:e});this.dispatchEvent(n)},e}(Vv),Nx=tv({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),Lx={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},jx=function(t){function e(e){return t.call(this,e,Lx)||this}return xe(e,t),e.prototype.render=function(t,e){var n=Lv(e).maybeAppendByClassName(Nx.markerGroup,"g");this.renderMarker(n);var r=Lv(e).maybeAppendByClassName(Nx.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?Sx(r,"horizontalHandle","verticalHandle"):i;fv(!!o,t,(function(t){var n=zv(e.attributes,"marker"),r=we({symbol:o},n);e.marker=t.maybeAppendByClassName(Nx.marker,(function(){return new Jv({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;fv(r,t,(function(t){var n,r=zv(e.attributes,"label"),o=r.text,c=Me(r,["text"]),l=(null===(n=t.select(Nx.marker.class))||void 0===n?void 0:n.node().getBBox())||{},u=l.width,f=void 0===u?0:u,h=l.height,d=Ae(Sx(i,[0,(void 0===h?0:h)+a,"center","top"],[f+a,0,"start","middle"]),4),p=d[0],g=d[1],m=d[2],y=d[3];t.maybeAppendByClassName(Nx.label,"text").styles(we(we({},c),{x:p,y:g,text:s(o).toString(),textAlign:m,textBaseline:y}))}))},e}(Vv),Rx={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},Ix=nv({},Rx,{}),Bx=nv({},Rx,Gv(Lx,"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"}),Dx=tv({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"),Fx=function(t){function e(e){return t.call(this,e,Ix)||this}return xe(e,t),e.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,o=r.titleText,a=Ae(Wv(zv(this.attributes,"title")),2),s=a[0],c=a[1];this.titleGroup=t.maybeAppendByClassName(Dx.titleGroup,"g").styles(c);var l=we(we({width:e,height:n},s),{text:i?o:""});this.title=this.titleGroup.maybeAppendByClassName(Dx.title,(function(){return new xx({style:l})})).update(l)},e.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,o=e.height,a=Ae(Wv(zv(this.attributes,"title",!0)),2),s=a[0],c=a[1],l=we(we({},s),{width:i,height:o,x:0,y:0});this.itemsGroup=t.maybeAppendByClassName(Dx.itemsGroup,"g").styles(we(we({},c),{transform:"translate(".concat(n,", ").concat(r,")")}));var u=this;this.itemsGroup.selectAll(Dx.items.class).data(["items"]).join((function(t){return t.append((function(){return new Cx({style:l})})).attr("className",Dx.items.name).each((function(){u.items=Lv(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 Zy(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=vx(r),u=Ae(jv(a?i:0),4),f=u[0],h=u[1],d=u[2],p=u[3],g=Ae(jv(o),4),m=g[0],y=g[1],v=g[2],b=g[3],x=Ae([p+h,f+d],2),w=x[0],M=x[1],O=Ae([b+y,m+v],2),E=O[0],k=O[1];if("l"===l[0])return new Zy(s.x,s.y,c.width+s.width+w+E,Math.max(c.height+k,s.height));if("t"===l[0])return new Zy(s.x,s.y,Math.max(c.width+E,s.width),c.height+s.height+M+k);var S=Ae([e.attributes.width||c.width,e.attributes.height||c.height],2),A=S[0],_=S[1];return new Zy(c.x,c.y,A+s.width+w+E,_+s.height+M+k)}(r,i):t.prototype.getBBox.call(this)},e.prototype.render=function(t,e){var n=this.attributes,r=n.width,i=n.height,o=n.x,a=void 0===o?0:o,s=n.y,c=void 0===s?0:s,l=Lv(e);e.style.transform="translate(".concat(a,", ").concat(c,")"),this.renderTitle(l,r,i),this.renderItems(l,this.availableSpace),this.adjustLayout()},e}(Vv),zx={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},Gx=tv({background:"background",labelGroup:"label-group",label:"label"},"indicator"),Wx=function(t){function e(e){var n=t.call(this,e,zx)||this;return n.point=[0,0],n.group=n.appendChild(new $p({})),n.isMutationObserved=!0,n}return xe(e,t),e.prototype.renderBackground=function(){if(this.label){var t=this.attributes,e=t.position,n=Ae(jv(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 Zy(c[0]-a,c[1]-r,l[0]+i-c[0]+a,l[1]+o-c[1]+r),f=this.getPath(e,u),h=zv(this.attributes,"background");this.background=Lv(this.group).maybeAppendByClassName(Gx.background,"path").styles(we(we({},h),{d:f})),this.group.appendChild(this.label.node())}},e.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,r=Ae(Wv(zv(this.attributes,"label")),2),i=r[0],o=r[1],a=Me(i,["text"]);(this.label=Lv(this.group).maybeAppendByClassName(Gx.labelGroup,"g").styles(o),n)&&this.label.maybeAppendByClassName(Gx.label,(function(){return uv(e(n))})).style("text",e(n).toString()).selectAll("text").styles(a)},e.prototype.adjustLayout=function(){var t=Ae(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,_e([c+1,1],Ae(l),!1)),s[0][0]="M",s},e.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=Iv.apply(void 0,_e([],Ae(t),!1)),r=Ae(t,2),i=Ae(r[0],2),o=i[0],a=i[1],s=Ae(r[1],2),c=s[0],l=s[1],u=Ae(n?[c-o,[o,c]]:[l-a,[a,l]],2),f=u[0],h=Ae(u[1],2),d=h[0],p=h[1],g=f/2,m=e*(f/Math.abs(f)),y=m/2,v=m*Math.sqrt(3)/2*.8,b=Ae([d,d+g-y,d+g,d+g+y,p],5),x=b[0],w=b[1],M=b[2],O=b[3],E=b[4];return n?(this.point=[M,a-v],[["L",x,a],["L",w,a],["L",M,a-v],["L",O,a],["L",E,a]]):(this.point=[o+v,M],[["L",o,x],["L",o,w],["L",o+v,M],["L",o,O],["L",o,E]])},e.prototype.applyVisibility=function(){"hidden"===this.attributes.visibility?Hy(this):$y(this)},e.prototype.bindEvents=function(){this.label.on(sp.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},e}(Vv);function $x(t,e){var n=Ae(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 Hx=tv({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function Vx(t){var e=t.orientation,n=t.size,r=t.length;return Sx(e,[r,n],[n,r])}function Yx(t){var e=t.type,n=Ae(Vx(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 Ux(t){return Yx(t)}function qx(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 Rf(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(Sx(n,"0","270"),")")):""}function Xx(t){var e=t.orientation,n=t.range;if(!n)return[];var r=Ae(Vx(t),2),i=r[0],o=r[1],a=Ae(n,2),s=a[0],c=a[1],l=Sx(e,s*i,0),u=Sx(e,0,s*o),f=Sx(e,c*i,i),h=Sx(e,o,c*o);return[["M",l,u],["L",l,h],["L",f,h],["L",f,u],["Z"]]}var Kx=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 xe(e,t),e.prototype.render=function(t,e){!function(t,e){var n=zv(e,"track");t.maybeAppendByClassName(Hx.track,"path").styles(we({d:Yx(e)},n))}(Lv(e).maybeAppendByClassName(Hx.trackGroup,"g"),t),function(t,e){var n=zv(e,"selection"),r=qx(e),i=t.maybeAppendByClassName(Hx.selection,"path").styles(we({d:Ux(e),fill:r},n)),o=i.maybeAppendByClassName(Hx.clipPath,"path").styles({d:Xx(e)}).node();i.style("clipPath",o)}(Lv(e).maybeAppendByClassName(Hx.selectionGroup,"g"),t)},e}(Vv);var Zx=function(t){function e(e){var n=t.call(this,e,Bx)||this;return n.eventToOffsetScale=new pa({}),n.innerRibbonScale=new pa({}),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=$x(r.map((function(t){return t.value})),o).range;n.showIndicator((a[0]+a[1])/2,"".concat(a[0],"-").concat(a[1])),n.dispatchIndicated(o,a)}else{var s=n.getTickValue(o);n.showIndicator(s),n.dispatchIndicated(s)}},n.onDragStart=function(t){return function(e){e.stopPropagation(),n.attributes.slidable&&(n.target=t,n.prevValue=n.getTickValue(n.getValueByCanvasPoint(e)),document.addEventListener("mousemove",n.onDragging),document.addEventListener("touchmove",n.onDragging),document.addEventListener("mouseleave",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("touchend",n.onDragEnd))}},n.onDragging=function(t){var e=n.target;n.updateMouse();var r=Ae(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 xe(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 Zy(0,0,e,n)},e.prototype.render=function(t,e){var n=this,r=t.showLabel;this.renderTitle(Lv(e));var i=this.availableSpace,o=i.x,a=i.y,s=Lv(e).maybeAppendByClassName(Dx.contentGroup,"g").styles({transform:"translate(".concat(o,", ").concat(a,")")});fv(!!r,s.maybeAppendByClassName(Dx.labelGroup,"g").styles({zIndex:1}),(function(t){n.renderLabel(t)}));var c=s.maybeAppendByClassName(Dx.ribbonGroup,"g").styles({zIndex:0});this.handlesGroup=s.maybeAppendByClassName(Dx.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,_e([],Ae(t.map((function(t){return t.value}))),!1)),max:Math.max.apply(Math,_e([],Ae(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=Ae(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=Ae(void 0===r?[e,n]:r,2);return[i[0],i[1]]},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Sx(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=zv(this.attributes,"title"),s=we(we({},a),{width:i,height:o,text:r}),c=this;t.selectAll(Dx.title.class).data(n?[r]:[]).join((function(t){return t.append((function(){return new xx({style:s})})).attr("className",Dx.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 Zy(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 Zy(0,0,0,0);if(this.cacheLabelBBox)return this.cacheLabelBBox;var e=(null===(t=this.label.querySelector(Eb.labelGroup.class))||void 0===t?void 0:t.children.slice(-1)[0]).getBBox(),n=e.width,r=e.height;return this.cacheLabelBBox=new Zy(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=Ae(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,m=0,y=this.labelPosition;m=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 v=Math.max(p,c),b=f-v,x=Ae(this.ifHorizontal([b,m],[m,b]),2),w=x[0],M=x[1],O=["top","left"].includes(y)?s:0,E=Ae(this.ifHorizontal([v/2,O],[O,v/2]),2),k=E[0],S=E[1];return new Zy(k,S,w,M)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonShape",{get:function(){var t=this.ribbonBBox,e=t.width,n=t.height;return this.ifHorizontal({size:n,length:e},{size:e,length:n})},enumerable:!1,configurable:!0}),e.prototype.renderRibbon=function(t){var e=this.attributes,n=e.data,r=e.type,i=e.orientation,o=e.color,a=e.block,s=zv(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,m=p.size,y=nv({transform:"translate(".concat(h,", ").concat(d,")"),length:g,size:m,type:r,orientation:i,color:o,block:a,partition:n.map((function(t){return(t.value-l)/(u-l)})),range:this.ribbonRange},s);this.ribbon=t.maybeAppendByClassName(Dx.ribbon,(function(){return new Kx({style:y})})).update(y)},e.prototype.getHandleClassName=function(t){return"".concat(Dx.prefix("".concat(t,"-handle")))},e.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,n=t.orientation,r=zv(this.attributes,"handle"),i=Ae(this.selection,2),o=i[0],a=i[1],s=we(we({},r),{orientation:n}),c=r.shape,l="basic"===(void 0===c?"slider":c)?jx:xb,u=this;this.handlesGroup.selectAll(Dx.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(Dx.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=Ae(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 Zy(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=Ae([Math.max(e,i),Math.max(n,o)],2),s=a[0],c=a[1];return this.cacheHandleBBox=new Zy(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=Ae(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=Ae(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=zv(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(Dx.indicator,(function(){return new Wx({})})).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(we(we({},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=Ae([n.value,c.value],2),u=l[0],f=l[1],h=(u+f)/2;e.push(we(we({},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=Ae(["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=zv(this.attributes,"tick"),s=zv(this.attributes,"label"),c=s.align,l=nv(we({showLine:!1,showGrid:!1,showTick:r,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),Gv(a,"tick"),Gv(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=we(we(we({},l),u),{labelOverlap:[{type:"hide"}]});this.label=t.maybeAppendByClassName(Dx.label,(function(){return new Ox({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=Ae([0,0,0],3),l=c[0],u=c[2],f=null!=i?i:o;return e?(u=f,"positive"===n?"right"===a?(l=f,u=f):"bottom"===a&&(l=u):"negative"===n&&("top"===a||"left"===a)&&(l=o)):"positive"===n&&("right"===a||"bottom"===a&&(l=o+s)),{offset:l,spacing:r,tickLength:u}},enumerable:!1,configurable:!0}),e.prototype.adjustLabel=function(){if(this.attributes.showLabel){var t=this.ribbonBBox,e=t.x,n=t.y,r=t.width,i=t.height,o=this.labelAxisStyle,a=o.offset,s=o.spacing,c=o.tickLength,l=Ae(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=N(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}),$y(this.indicator.node())}else this.hideIndicator()},e.prototype.hideIndicator=function(){Hy(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=Ae(this.selection,2),o=i[0],a=i[1],s=Ae([t,e],2),c=s[0],l=s[1];n&&(c+=o,l+=a);var u=this.range;r=Ae(function(t,e,n,r){var i,o=Ae(t,2),a=o[0],s=o[1],c=Ae(e,2),l=c[0],u=c[1],f=Ae(n,2),h=f[0],d=f[1],p=Ae([l,u],2),g=p[0],m=p[1],y=m-g;return g>m&&(g=(i=Ae([m,g],2))[0],m=i[1]),y>s-a?[a,s]:g<a?h===a&&d===m?[a,m]:[a,y+a]:m>s?d===s&&h===g?[g,s]:[s-y,s]:[g,m]}([u.min,u.max],[c,l],this.selection),2),c=r[0],l=r[1],this.update({defaultValue:[c,l]}),this.dispatchSelection()},Object.defineProperty(e.prototype,"step",{get:function(){var t=this.attributes.step,e=void 0===t?1:t,n=this.range,r=n.min,i=n.max;return $(e)?kv(.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?$x(n.map((function(t){return t.value})),t).tick:function(t,e,n){return n+Math.round((t-n)/e)*e}(t,this.step,i)},e.prototype.getValueByCanvasPoint=function(t,e){var n=this.range,r=n.min,i=n.max,o=Ae(this.ribbon.node().getPosition(),2),a=o[0],s=o[1],c=this.ifHorizontal(a,s),l=this.ifHorizontal.apply(this,_e([],Ae(lv(t)),!1))-c;return N(this.getOffset(l,!0),r,i)},e.prototype.getOffset=function(t,e){void 0===e&&(e=!1);var n=this.range,r=n.min,i=n.max,o=this.ribbonShape.length,a=this.eventToOffsetScale;return a.update({domain:[r,i],range:[0,o]}),e?a.invert(t):a.map(t)},e.prototype.dispatchSelection=function(){var t=new np("valuechange",{detail:{value:this.selection}});this.dispatchEvent(t)},e.prototype.dispatchIndicated=function(t,e){var n=new np("indicate",{detail:{value:t,range:e}});this.dispatchEvent(n)},e}(Vv);function Qx(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 Jx={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function tw(t){var e;void 0===t&&(t="");var n=Qx(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)]=we({flex:1},Jx),e[".".concat(n.VALUE)]=we({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},Jx),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 ew=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=Qx(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:tw(o)})||this).timestamp=-1,i.prevCustomContentKey=i.attributes.contentKey,i.initShape(),i.render(i.attributes,i),i}return xe(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=Me(t,["name","color","index"]),l=we({name:i,color:a,index:null!=s?s:e},c);return dn(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=dn(t.container),this.id&&this.element.setAttribute("id",this.id)},e.prototype.renderCustomContent=function(){if(void 0===this.prevCustomContentKey||this.prevCustomContentKey!==this.attributes.contentKey){this.prevCustomContentKey=this.attributes.contentKey;var t=this.attributes.content;t&&("string"==typeof t?this.element.innerHTML=t:this.element.replaceChildren(t))}},e.prototype.renderHTMLTooltipElement=function(){var t,e,n=this.attributes,r=n.template,i=n.title,o=n.enterable,a=n.style,s=n.content,c=Qx(r.prefixCls),l=this.element;if(this.element.style.pointerEvents=o?"auto":"none",s)this.renderCustomContent();else{i?(l.innerHTML=r.title,l.getElementsByClassName(c.TITLE)[0].innerHTML=i):null===(e=null===(t=l.getElementsByClassName(c.TITLE))||void 0===t?void 0:t[0])||void 0===e||e.remove();var u=this.HTMLTooltipItemsElements,f=document.createElement("ul");f.className=c.LIST,f.replaceChildren.apply(f,_e([],Ae(u),!1));var h=this.element.querySelector(".".concat(c.LIST));h?h.replaceWith(f):l.appendChild(f)}!function(t,e){Object.entries(e).forEach((function(e){var n=Ae(e,2),r=n[0],i=n[1];_e([t],Ae(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=Ae(l,2),n=e[0],i=e[1],a=Ae(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=Ae(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=Ae(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=Ae([+o+n,+a+r],2),d=h[0],p=h[1],g={left:"right",right:"left",top:"bottom",bottom:"top"},m=s.x,y=s.y,v={left:d<m,right:d+u>m+s.width,top:p<y,bottom:p+f>y+s.height},b=[];c.split("-").forEach((function(t){v[t]?b.push(g[t]):b.push(t)}));var x=b.join("-");return this.getRelativeOffsetFromCursor(x)},e.prototype.isCursorEntered=function(t,e){if(this.element){var n=this.element.getBoundingClientRect(),r=n.x,i=n.y,o=n.width,a=n.height;return new Zy(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}(Vv),nw=function(t){function e(e){var n=t.call(this,e)||this;n.layoutEvents=[sp.BOUNDS_CHANGED,sp.INSERTED,sp.REMOVED],n.$margin=jv(0),n.$padding=jv(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 xe(e,t),Object.defineProperty(e.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=jv(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=jv(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=Ae(this.$margin,4),c=s[0],l=s[1],u=s[2],f=s[3];return new Zy(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=Ae(this.$padding,4),i=r[0],o=r[1],a=r[2],s=r[3],c=Ae(this.$margin,4),l=c[0],u=c[3];return new Zy(s+u,i+l,e-s-o,n-i-a)},e.prototype.layout=function(){if(this.attributes.display&&this.isConnected&&!this.children.some((function(t){return!t.isConnected})))try{var t=this.attributes,e=t.x,n=t.y;this.style.transform="translate(".concat(e,", ").concat(n,")");var r=function(t,e,n){if(0===e.length)return[];var r={flex:mv,grid:yv},i=n.display in r?r[n.display]:null;return(null==i?void 0:i.call(null,t,e,n))||[]}(this.getAvailableSpace(),this.children.map((function(t){return t.getBBox()})),this.attributes);this.children.forEach((function(t,e){var n=r[e],i=n.x,o=n.y;t.style.transform="translate(".concat(i,", ").concat(o,")")}))}catch(t){}},e.prototype.bindEvents=function(){var t=this;this.layoutEvents.forEach((function(e){t.addEventListener(e,(function(e){e.target.isMutationObserved=!0,t.layout()}))}))},e.prototype.attributeChangedCallback=function(t,e,n){"margin"===t?this.margin=n:"padding"===t&&(this.padding=n),this.layout()},e}($p);function rw(t,e,n,r){const[[i,o],[a,s]]=e,[c,l]=function(t){const{min:[e,n],max:[r,i]}=t.getLocalBounds();let o=0,a=0;return e>0&&(o=e),r<0&&(o=r),n>0&&(a=n),i<0&&(a=i),[o,a]}(t);if(i===a&&o===s)return vc()([[0,0],[c,l]]);const u=[[i-a,o-s]].concat(n.length?n:[[0,0]]),f=[r[0]-a,r[1]-s],[h,d]=u;if(((t,e,n)=>{const r=Es(t,e),i=Es(e,n),o=Es(n,t);return(Math.pow(r,2)+Math.pow(i,2)-Math.pow(o,2))/(2*r*i)})(f,h,d)>0){const e=(()=>{const{min:e,max:n}=t.getLocalBounds(),r=h[0]+(h[1]-f[1])*(h[1]-0)/(h[0]-f[0]);return n[0]<f[0]?Math.min(n[0],r):Math.max(e[0],r)})();u.splice(1,1,[e,0])}return vc()(u)}const iw=Bm((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:m,coordCenter:y,innerHTML:v}=e,b=Me(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=>!L(t))))return void t.children.forEach((t=>t.remove()));const x=xr(b,"background"),{padding:w}=x,M=Me(x,["padding"]),O=xr(b,"connector"),{points:E=[]}=O,k=Me(O,["points"]),S=[[+u,+f],[+c,+l]];let A;A=v?vm(t).maybeAppend("html","html",n).style("zIndex",0).style("innerHTML",v).call(Mm,Object.assign({transform:a,transformOrigin:s},b)).node():vm(t).maybeAppend("text","text").style("zIndex",0).style("text",h).call(Mm,Object.assign({textBaseline:"middle",transform:a,transformOrigin:s},b)).node();const _=vm(t).maybeAppend("background","rect").style("zIndex",-1).call(Mm,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}}(A,w)).call(Mm,d?M:{}).node(),T=rw(_,S,E,y),P=g&&new Jv({id:"startMarker",style:Object.assign({x:0,y:0},xr(b,"startMarker"))}),C=m&&new Jv({id:"endMarker",style:Object.assign({x:0,y:0},xr(b,"endMarker"))});vm(t).maybeAppend("connector","path").style("zIndex",0).style("d",T).style("markerStart",P).style("markerEnd",C).call(Mm,p?k:{})})),ow=(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 vm(new iw).style("x",f).style("y",h).call(Mm,i).style("transform",`${l}rotate(${+c})`).style("coordCenter",n.getCenter()).call(Mm,u).call(Mm,t).node()}};ow.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const aw=Bm((t=>{const e=Me(t.attributes,["class","x","y"]),n=xr(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=vm(t).maybeAppend("marker",(()=>new Jv({}))).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);vm(t).maybeAppend("text","text").style("x",a).style("y",s).call(Mm,e)})),sw=(t,e)=>{const n=Me(t,[]);return(t,e,r)=>{const{color:i}=r,o=Me(r,["color"]),{color:a=i,text:s=""}=e,c={text:String(s),stroke:a,fill:a},[[l,u]]=t;return vm(new aw).call(Mm,o).style("x",l).style("y",u).call(Mm,c).call(Mm,n).node()}};sw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const cw=Bm((t=>{const{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes,o=t.ownerDocument;vm(t).maybeAppend("connect-path",(()=>o.createElement("path",{}))).style("d",n).call(Mm,i),vm(t).maybeAppend("area-path",(()=>o.createElement("path",{}))).style("d",e).call(Mm,r)})),lw=(t,e)=>{const{curve:n,gradient:r=!1,defined:i=(t=>!Number.isNaN(t)&&null!=t),connect:o=!1}=t,a=Me(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=Uc(s),m=_m(s,e),y=r&&h?Em(h,d,p,r,void 0,g):f,v=Object.assign(Object.assign(Object.assign(Object.assign({},l),{stroke:y,fill:y}),m&&{transform:m}),a),[b,x]=function(t,e){const n=[],r=[],i=[];let o=!1,a=null;const s=t.length/2;for(let c=0;c<s;c++){const l=t[c],u=t[c+s];if([...l,...u].some((t=>!e(t))))o=!0;else{if(n.push(l),r.push(u),o&&a){o=!1;const[t,e]=a;i.push([t,l,e,u])}a=[l,u]}}return[n.concat(r),i]}(t,i),w=xr(v,"connect"),M=!!x.length,O=t=>vm(c.createElement("path",{})).style("d",t||"").call(Mm,v).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=bc().curve(xc),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 Oc(n())},delete t.lineX0,t.lineEndAngle=function(){return Oc(r())},delete t.lineX1,t.lineInnerRadius=function(){return Oc(i())},delete t.lineY0,t.lineOuterRadius=function(){return Oc(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(Mc(t)):e()._curve},t}().angle(((t,n)=>Ss(Ms(r[n],e)))).outerRadius(((t,n)=>Es(r[n],e))).innerRadius(((t,n)=>Es(o[n],e))).defined(((t,e)=>[...r[e],...o[e]].every(i))).curve(n)(o)};return!M||o&&!Object.keys(w).length?O(e(b)):M&&!o?O(e(t)):vm(new cw).style("areaStyle",v).style("connectStyle",Object.assign(Object.assign({},w),a)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}{const e=t=>{const e=t.slice(0,t.length/2),r=t.slice(t.length/2);return g?bc().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):bc().x(((t,n)=>e[n][0])).y1(((t,n)=>e[n][1])).y0(((t,e)=>r[e][1])).defined(((t,n)=>[...e[n],...r[n]].every(i))).curve(n)(e)};return!M||o&&!Object.keys(w).length?O(e(b)):M&&!o?O(e(t)):vm(new cw).style("areaStyle",v).style("connectStyle",Object.assign(Object.assign({},w),a)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}}};lw.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const uw=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=qc(n)?Lc:gc;return lw(Object.assign({curve:i},t),e)(...r)}};uw.props=Object.assign(Object.assign({},lw.props),{defaultMarker:"square"});const fw=(t,e)=>{const n=Me(t,[]),{coordinate:r}=e;return(...t)=>{const i=qc(r)?Cc:Uc(r)?Wc:Gc;return lw(Object.assign({curve:i},n),e)(...t)}};fw.props=Object.assign(Object.assign({},lw.props),{defaultMarker:"smooth"});const hw=(t,e)=>(...n)=>lw(Object.assign({curve:Hc},t),e)(...n);hw.props=Object.assign(Object.assign({},lw.props),{defaultMarker:"hvh"});const dw=(t,e)=>(...n)=>lw(Object.assign({curve:Vc},t),e)(...n);dw.props=Object.assign(Object.assign({},lw.props),{defaultMarker:"vh"});const pw=(t,e)=>(...n)=>lw(Object.assign({curve:Yc},t),e)(...n);pw.props=Object.assign(Object.assign({},lw.props),{defaultMarker:"hv"});const gw=(t,e)=>{const{arrow:n=!1}=t;return(...r)=>Gy(Object.assign(Object.assign({},t),{arrow:n}),e)(...r)};gw.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const mw=(t,e)=>{const n=Me(t,[]),{document:r}=e;return(t,e,i)=>{const{color:o}=i,a=Me(i,["color"]),{color:s=o,transform:c}=e,[l,u]=t,f=ic();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]),vm(r.createElement("path",{})).call(Mm,a).style("d",f.toString()).style("stroke",s).style("transform",c).call(Mm,n).node()}};function yw(t,e,n,r){const i=ic();if(qc(n)){const o=n.getCenter(),a=Es(t,o),s=(Es(e,o)-a)*r+a;return i.moveTo(t[0],t[1]),Om(i,t,e,o,s),i.lineTo(e[0],e[1]),i}return Uc(n)?(i.moveTo(t[0],t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,e[1]),i.lineTo(e[0],e[1]),i):(i.moveTo(t[0],t[1]),i.lineTo(t[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],e[1]),i)}mw.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const vw=(t,e)=>{const{cornerRatio:n=1/3}=t,r=Me(t,["cornerRatio"]),{coordinate:i,document:o}=e;return(t,e,a)=>{const{defaultColor:s}=a,c=Me(a,["defaultColor"]),{color:l=s,transform:u}=e,[f,h]=t,d=yw(f,h,i,n);return vm(o.createElement("path",{})).call(Mm,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(Mm,r).node()}};vw.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const bw=(t,e)=>{const n=Me(t,[]),{coordinate:r,document:i}=e;return(t,e,o)=>{const{color:a}=o,s=Me(o,["color"]),{color:c=a,transform:l}=e,[u,f]=t,h=ic();if(h.moveTo(u[0],u[1]),qc(r)){const t=r.getCenter();h.quadraticCurveTo(t[0],t[1],f[0],f[1])}else{Om(h,u,f,Ts(u,f),Es(u,f)/2)}return vm(i.createElement("path",{})).call(Mm,s).style("d",h.toString()).style("stroke",c).style("transform",l).call(Mm,n).node()}};function xw(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 ww(t={}){return[...xw(t),{name:"title",scale:"identity"}]}function Mw(){return[{type:Ur,channel:"color"},{type:ai,channel:["x","y"]}]}function Ow(){return[{type:Ur,channel:"x"},{type:ai,channel:["y"]}]}function Ew(t={}){return xw(t)}function kw(){return[{type:Qr}]}function Sw(t,e){return t.getBandWidth(t.invert(e))}function Aw(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?Sw(a,r[e]):0,l=d?Sw(s,i[e]):0,g=p&&o?(Sw(c,o[e])/2+ +o[e])*n:0,[m,y]=t;return[m+u*n+g,y+f*l]}:t=>t}function _w(t){return parseFloat(t)/100}function Tw(t,e,n,r){const{x:i,y:o}=n,{innerWidth:a,innerHeight:s}=r.getOptions();return[t,Array.from(t,(t=>{const e=i[t],n=o[t];return[["string"==typeof e?_w(e)*a:+e,"string"==typeof n?_w(n)*s:+n]]}))]}bw.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Pw=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a}=o,s=Me(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,[m,y]=n.getSize();h="string"==typeof h?_w(h)*m:h,d="string"==typeof d?_w(d)*y:d;const v=p-Number(h)/2,b=g-Number(d)/2;return vm(r.createElement("image",{})).call(Mm,s).style("x",v).style("y",b).style("src",l).style("stroke",c).style("transform",f).call(Mm,t).style("width",h).style("height",d).node()}};function Cw(t,e){const n=ic();if(qc(e)){const r=e.getCenter(),i=[...t,t[0]],o=i.map((t=>Es(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?Om(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)}Pw.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Nw=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a}=o,s=Me(o,["color"]),{color:c=a,transform:l}=i,u=Cw(e,n);return vm(r.createElement("path",{})).call(Mm,s).style("d",u.toString()).style("stroke",c).style("fill",c).style("transform",l).call(Mm,t).node()}};function Lw(t,e){const[n,r,i,o]=t,a=ic();if(qc(e)){const t=e.getCenter(),s=Es(t,n);return a.moveTo(n[0],n[1]),a.quadraticCurveTo(t[0],t[1],i[0],i[1]),Om(a,i,o,t,s),a.quadraticCurveTo(t[0],t[1],r[0],r[1]),Om(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}Nw.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const jw=(t,e)=>{const n=Me(t,[]),{coordinate:r,document:i}=e;return(t,e,o)=>{const{color:a}=o,s=Me(o,["color"]),{color:c=a,transform:l}=e,u=Lw(t,r);return vm(i.createElement("path",{})).call(Mm,s).style("d",u.toString()).style("fill",c||a).style("stroke",c||a).style("transform",l).call(Mm,n).node()}};function Rw(t,e){const n=ic();if(qc(e)){const r=e.getCenter(),[i,o]=r,a=ks(Ms(t[0],r)),s=ks(Ms(t[1],r)),c=Es(r,t[2]),l=Es(r,t[3]),u=Es(r,t[8]),f=Es(r,t[10]),h=Es(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}jw.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Iw=(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=Me(o,["color","fill","stroke"]),h=Rw(e,n);return vm(r.createElement("path",{})).call(Mm,f).style("d",h.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(Mm,t).node()}};function Bw(t,e,n=4){const r=ic();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=Es(i,t[3]),c=Es(i,t[8]),l=Es(i,t[10]),u=ks(Ms(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}Iw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Dw=(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=Me(o,["color","fill","stroke"]),h=Bw(e,n,4);return vm(r.createElement("path",{})).call(Mm,f).style("d",h.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(Mm,t).node()}};Dw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Fw=(t,e)=>{const{arrow:n,arrowSize:r=4}=t,i=Me(t,["arrow","arrowSize"]),{coordinate:o,document:a}=e;return(t,e,s)=>{const{color:c,lineWidth:l}=s,u=Me(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},xr(i,"arrow"))):null,p=function(t,e){if(!qc(e))return vc().x((t=>t[0])).y((t=>t[1]))(t);const n=e.getCenter();return hc()({startAngle:0,endAngle:2*Math.PI,outerRadius:Es(t[0],n),innerRadius:Es(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 vm(a.createElement("path",{})).call(Mm,u).style("d",p).style("stroke",f).style("lineWidth",h).style("transform",g).style("markerEnd",d).call(Mm,i).node()}};function zw(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}Fw.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Gw=(t,e)=>{const{offset:n=0,offset1:r=n,offset2:i=n,connectLength1:o,endMarker:a=!0}=t,s=Me(t,["offset","offset1","offset2","connectLength1","endMarker"]),{coordinate:c}=e;return(t,e,n)=>{const{color:l,connectLength1:u}=n,f=Me(n,["color","connectLength1"]),{color:h,transform:d}=e,p=function(t,e,n,r,i=0){const[[o,a],[s,c]]=e;if(Uc(t)){const t=o+n,e=t+i;return[[t,a],[e,a],[e,c],[s+r,c]]}const l=a-n,u=l-i;return[[o,l],[o,u],[s,u],[s,c-r]]}(c,t,r,i,null!=o?o:u),g=xr(Object.assign(Object.assign({},s),n),"endMarker");return vm(new Up).call(Mm,f).style("d",function(t){return vc().x((t=>t[0])).y((t=>t[1]))(t)}(p)).style("stroke",h||l).style("transform",d).style("markerEnd",a?new Jv({className:"marker",style:Object.assign(Object.assign({},g),{symbol:zw})}):null).call(Mm,s).node()}};function Ww(t){return t.replace(/-(\w)/g,(function(t,e){return e.toUpperCase()}))}function $w(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=Or(n.x,l),s=Or(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 Hw(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s}=n,c=r.getCenter(),l=Sm(r,e,[i,o]),{innerRadius:u,outerRadius:f,startAngle:h,endAngle:d}=l,p="inside"===t?(h+d)/2:d,g=Yw(p,a,s),m=(()=>{const[n,r]=e,i=u+.5*(f-u),[o,a]="inside"===t?Vw(c,p,i):Ts(n,r);return{x:o,y:a}})();return Object.assign(Object.assign({},m),{textAlign:"inside"===t?"center":"start",textBaseline:"middle",rotate:g})}function Vw(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function Yw(t,e,n){if(!e)return 0;const r=n?0:Math.sin(t)<0?90:-90;return t/Math.PI*180+r}function Uw(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s,radius:c=.5,offset:l=0}=n,u=Sm(r,e,[i,o]),{startAngle:f,endAngle:h}=u,d=r.getCenter(),p=(f+h)/2,g={textAlign:"center",textBaseline:"middle",rotate:Yw(p,a,s)},{innerRadius:m,outerRadius:y}=u,v=m+(y-m)*c+l,[b,x]=Vw(d,p,v);return Object.assign({x:b,y:x},g)}function qw(t){return void 0===t?null:t}function Xw(t,e,n,r){const{bounds:i}=n,[o]=i;return{x:qw(o[0]),y:qw(o[1])}}function Kw(t,e,n,r){const{bounds:i}=n;if(1===i.length)return Xw(0,0,n);return(Xc(r)?Hw:Jc(r)?Uw:$w)(t,e,n,r)}function Zw(t,e,n){const r=Sm(n,t,[e.y,e.y1]),{innerRadius:i,outerRadius:o}=r;return i+(o-i)}function Qw(t,e,n){const r=Sm(n,t,[e.y,e.y1]),{startAngle:i,endAngle:o}=r;return(i+o)/2}function Jw(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=Qw(e,n,r),d=Math.sin(h)>0?1:-1,p=Yw(h,i,o),g={textAlign:d>0||Xc(r)?"start":"end",textBaseline:"middle",rotate:p},m=Zw(e,n,r),y=m+(s?c:a),[[v,b],[x,w],[M,O]]=function(t,e,n,r,i){const[o,a]=Vw(t,e,n),[s,c]=Vw(t,e,r);return[[o,a],[s,c],[s+(Math.sin(e)>0?1:-1)*i,c]]}(f,h,m,y,s?l:0),E=s?+u*d:0,k=M+E,S={connector:s,connectorPoints:[[x-k,w-O],[M-k,O-O]]};return Object.assign(Object.assign({x0:v,y0:b,x:M+E,y:O},g),S)}Gw.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var tM=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=ir(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=ks(Ms(c(s+1),u))/Math.PI*180;return{x:l[0],y:l[1],transform:`rotate(${f})`,textAlign:"center",textBaseline:"middle"}},bottom:Kw,bottomLeft:Kw,bottomRight:Kw,inside:Kw,left:Kw,outside:function(t,e,n,r){const{bounds:i}=n;return 1===i.length?Xw(0,0,n):(Xc(r)?Hw:Jc(r)?Jw:$w)(t,e,n,r)},right:Kw,spider:function(t,e,n,r){if(!Jc(r))return{};const{connectorLength:i,connectorLength2:o,connectorDistance:a}=n,s=Me(Jw(0,e,n,r),[]),c=r.getCenter(),l=Zw(e,n,r),u=Qw(e,n,r),f=l+i+o,h=Math.sin(u)>0?1:-1,d=c[0]+(f+ +a)*h,{x:p}=s,g=d-p;return s.x+=g,s.connectorPoints[0][0]-=g,s},surround:function(t,e,n,r){if(!Jc(r))return{};const{connectorLength:i,connectorLength2:o,connectorDistance:a}=n,s=Me(Jw(0,e,n,r),[]),{x0:c,y0:l}=s,u=r.getCenter(),f=function(t){if(Jc(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=Ss([c-u[0],l-u[1]]),p=Math.sin(d)>0?1:-1,[g,m]=Vw(u,d,h);return s.x=g+(o+a)*p,s.y=m,s},top:Kw,topLeft:Kw,topRight:Kw});function eM(t,e,n,r,i){const{position:o}=e,{render:a}=i,s=function(t,e){return void 0!==t?t:Jc(e)?"inside":Uc(e)?"right":"top"}(o,n),c=r[a?"htmlLabel":"inside"===s?"innerLabel":"label"],l=Object.assign({},c,e),u=tM[Ww(s)];if(!u)throw new Error(`Unknown position: ${s}`);return Object.assign(Object.assign({},c),u(s,t,l,n,i))}const nM=(t,e)=>{const{coordinate:n,theme:r}=e,{render:i}=t;return(e,o)=>{const{text:a,x:s,y:c,transform:l="",transformOrigin:u,className:f=""}=o,h=Me(o,["text","x","y","transform","transformOrigin","className"]),d=eM(e,o,n,r,t),{rotate:p=0,transform:g=""}=d,m=Me(d,["rotate","transform"]);return vm(new iw).call(Mm,m).style("text",`${a}`).style("className",`${f} g2-label`).style("innerHTML",i?i(a,o.datum,o.index):void 0).style("labelTransform",`${g} rotate(${+p}) ${l}`.trim()).style("labelTransformOrigin",u).style("coordCenter",n.getCenter()).call(Mm,h).node()}};nM.props={defaultMarker:"point"};const rM=(t,e)=>{const{arrow:n,colorAttribute:r}=t,i=Me(t,["arrow","colorAttribute"]),{coordinate:o,document:a}=e;return(t,e,n)=>{const{color:s,stroke:c}=n,l=Me(n,["color","stroke"]),{d:u,color:f=s}=e,[h,d]=o.getSize();return vm(a.createElement("path",{})).call(Mm,l).style("d","function"==typeof u?u({width:h,height:d}):u).style(r,f).call(Mm,i).node()}};rM.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const iM=(t,e)=>rM(Object.assign({colorAttribute:"fill"},t),e);iM.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const oM=(t,e)=>rM(Object.assign({fill:"none",colorAttribute:"stroke"},t),e);oM.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const aM=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{transform:o}=r,{color:a}=i,s=Me(i,["color"]),{color:c=a}=r,[l,...u]=e,f=ic();return f.moveTo(...l),u.forEach((([t,e])=>{f.lineTo(t,e)})),f.closePath(),vm(n.createElement("path",{})).call(Mm,s).style("d",f.toString()).style("stroke",c||a).style("fill",c||a).style("fillOpacity",.4).style("transform",o).call(Mm,t).node()}};function sM(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 cM(t,e,n){const r=t?t():document.createElement("canvas");return r.width=e,r.height=n,r}aM.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},sM(3);const lM=function(t,e=((...t)=>`${t[0]}`),n=16){const r=sM(n);return(...n)=>{const i=e(...n);let o=r.get(i);return r.has(i)?r.get(i):(o=t(...n),r.set(i,o),o)}}(((t,e,n)=>{const r=cM(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 uM(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=cM(a,t,e).getContext("2d"),l=function(t,e){const n=cM(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=lM(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=cM(a,t,e).getContext("2d");return f.putImageData(u,0,0),f}const fM=(t,e)=>{const{gradient:n,opacity:r,maxOpacity:i,minOpacity:o,blur:a,useGradientOpacity:s}=t,c=Me(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(),m=t.map((t=>({x:t[0],y:t[1],value:t[2],radius:t[3]}))),y=or(t,(t=>t[2])),v=rr(t,(t=>t[2])),b=p&&g?uM(p,g,y,v,m,(x={gradient:n,opacity:r,minOpacity:o,maxOpacity:i,blur:a,useGradientOpacity:s},w=t=>void 0===t,Object.keys(x).reduce(((t,e)=>{const n=x[e];return w(n,e)||(t[e]=n),t}),{})),u):{canvas:null};var x,w;return vm(f.createElement("image",{})).call(Mm,h).style("x",0).style("y",0).style("width",p).style("height",g).style("src",b.canvas).style("transform",d).call(Mm,c).node()}};fM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const hM=(t,e)=>{const{render:n}=t,r=Me(t,["render"]);return t=>{const[[i,o]]=t;return n(Object.assign(Object.assign({},r),{x:i,y:o}),e)}};function dM(t,e){return t.getBandWidth(t.invert(e))}hM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const pM={rect:Cm,hollow:Nm,funnel:jm,pyramid:Im},gM=()=>(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=dM(l,i[t]),n=e*(u?dM(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],m=+a[t];return[[h,g],[p,g],[p,m],[h,m]].map((t=>r.map(t)))}));return[t,p]};gM.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:pM,channels:[...ww({shapes:Object.keys(pM)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...kw(),{type:Mn},{type:qr}],postInference:[...Ow()],interaction:{shareTooltip:!0}};const mM={rect:Cm,hollow:Nm},yM=()=>(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]};yM.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:mM,channels:[...ww({shapes:Object.keys(mM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...kw(),{type:Mn}],postInference:[...Ow()],interaction:{shareTooltip:!0}};const vM={line:zm,smooth:Gm,hv:Wm,vh:$m,hvh:Hm,trail:Ym},bM=(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(zn(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]},xM=(t,e,n,r)=>{const i=Object.entries(n).filter((([t])=>t.startsWith("position"))).map((([,t])=>t));if(0===i.length)throw new Error("Missing encode for position channel.");return[t,Array.from(t,(t=>{const e=i.map((e=>+e[t])),n=r.map(e),o=[];for(let t=0;t<n.length;t+=2)o.push([n[t],n[t+1]]);return o}))]},wM=()=>(t,e,n,r)=>(Zc(r)?xM:bM)(t,e,n,r);wM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:vM,channels:[...ww({shapes:Object.keys(vM)}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...kw(),{type:fi},{type:Jr}],postInference:[...Ow(),{type:Ur,channel:"color"},{type:ai,channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const MM={hollow:ky,hollowDiamond:Oy,hollowHexagon:Ey,hollowSquare:Sy,hollowTriangleDown:_y,hollowTriangle:Ay,hollowBowtie:My,point:Iy,plus:Ry,diamond:Cy,square:By,triangle:Fy,hexagon:Ny,cross:Py,bowtie:Ty,hyphen:Ly,line:jy,tick:Dy,triangleDown:zy},OM=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=Aw(n,r,t),g=t=>{const e=+((null==u?void 0:u[t])||0),n=+((null==f?void 0:f[t])||0);return[(s?(+o[t]+ +s[t])/2:+o[t])+e,(c?(+a[t]+ +c[t])/2:+a[t])+n]};return[e,l?Array.from(e,(t=>{const[e,n]=g(t),r=+l[t],o=r/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))]))]};OM.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,shape:MM,channels:[...ww({shapes:Object.keys(MM)}),{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:[...kw(),{type:qr},{type:Xr}],postInference:[{type:Zr},...Mw()]};const EM={text:ow,badge:sw},kM=t=>{const{cartesian:e=!1}=t;return e?Tw:(e,n,r,i)=>{const{x:o,y:a}=r,s=Aw(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};kM.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,shape:EM,channels:[...ww({shapes:Object.keys(EM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize"},{name:"rotate"}],preInference:[...kw(),{type:ui},{type:ci}],postInference:[...Mw()]};const SM={cell:Cm,hollow:Nm},AM=()=>(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]};AM.props={defaultShape:"cell",defaultLabelShape:"label",shape:SM,composite:!1,channels:[...ww({shapes:Object.keys(SM)}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...kw(),{type:qr},{type:Xr},{type:si}],postInference:[...Mw()]};const _M={area:uw,smooth:fw,hvh:hw,vh:dw,hv:pw},TM=()=>(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(zn(t,(t=>l[t])).values()):[t],d=h.map((t=>t[0])).filter((t=>void 0!==t)),p=((null===(i=null==u?void 0:u.getBandWidth)||void 0===i?void 0:i.call(u))||0)/2,g=((null===(o=null==f?void 0:f.getBandWidth)||void 0===o?void 0:o.call(f))||0)/2;return[d,Array.from(h,(t=>{const e=t.length,n=new Array(2*e);for(let i=0;i<t.length;i++){const o=t[i];n[i]=r.map([+a[o]+p,+s[o]+g]),n[e+i]=r.map([+a[o]+p,+c[o]+g])}return n})),h]};TM.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,shape:_M,channels:[...ww({shapes:Object.keys(_M)}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...kw(),{type:Jr},{type:Mn},{type:si}],postInference:[...Ow()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const PM={link:gw,arc:bw,smooth:mw,vhv:vw},CM=t=>(e,n,r,i)=>{const{x:o,y:a,x1:s=o,y1:c=a}=r,l=Aw(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]};CM.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,shape:PM,channels:[...ww({shapes:Object.keys(PM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...kw(),{type:ni},{type:ri}],postInference:[...Mw()]};const NM={image:Pw},LM=t=>{const{cartesian:e}=t;return e?Tw:(e,n,r,i)=>{const{x:o,y:a}=r,s=Aw(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};LM.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,shape:NM,channels:[...ww({shapes:Object.keys(NM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...kw(),{type:ui},{type:ci}],postInference:[...Mw()]};const jM={polygon:Nw,ribbon:jw},RM=()=>(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]};RM.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,shape:jM,channels:[...ww({shapes:Object.keys(jM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...kw()],postInference:[...Mw()]};const IM={box:Iw,violin:Dw},BM=()=>(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,m,y,v,b]=[+o[t],+a[t],+s[t],+c[t],+l[t]];return[[p-n/2,b],[p+n/2,b],[p,b],[p,v],[p-n/2,v],[p+n/2,v],[p+n/2,m],[p-n/2,m],[p-n/2,y],[p+n/2,y],[p,m],[p,g],[p-n/2,g],[p+n/2,g]].map((t=>r.map(t)))}));return[t,d]};BM.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,shape:IM,channels:[...ww({shapes:Object.keys(IM)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...kw(),{type:qr}],postInference:[...Ow()],interaction:{shareTooltip:!0}};const DM={vector:Gy},FM=()=>(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]};FM.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,shape:DM,channels:[...ww({shapes:Object.keys(DM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...kw()],postInference:[...Mw()]};const zM={line:Fw},GM=t=>(e,n,r,i)=>{const{y:o}=r,a=Aw(n,r,X({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]};GM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:zM,channels:[...Ew({shapes:Object.keys(zM)}),{name:"y",required:!0}],preInference:[...kw(),{type:ti}],postInference:[]};const WM={line:Fw},$M=t=>(e,n,r,i)=>{const{x:o}=r,a=Aw(n,r,X({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]};$M.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:WM,channels:[...Ew({shapes:Object.keys(WM)}),{name:"x",required:!0}],preInference:[...kw(),{type:ei}],postInference:[]};const HM={connector:Gw},VM=(...t)=>CM(...t);function YM(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 UM(t={}){const{extendX:e=!1,extendY:n=!1}=t;return(t,r,i,o)=>{const a=YM("x",e,i,r.x),s=YM("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]}}VM.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,shape:HM,channels:[...Ew({shapes:Object.keys(HM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...kw()],postInference:[]};const qM={range:Cm},XM=()=>UM();XM.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:qM,channels:[...Ew({shapes:Object.keys(qM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...kw()],postInference:[]};const KM={range:Cm},ZM=()=>UM({extendY:!0});ZM.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:KM,channels:[...Ew({shapes:Object.keys(KM)}),{name:"x",required:!0}],preInference:[...kw(),{type:ii}],postInference:[]};const QM={range:Cm},JM=()=>UM({extendX:!0});JM.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:QM,channels:[...Ew({shapes:Object.keys(QM)}),{name:"y",required:!0}],preInference:[...kw(),{type:oi}],postInference:[]};const tO={path:iM,hollow:oM},eO=t=>(t,e,n,r)=>[t,t.map((()=>[[0,0]]))];function nO(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 rO(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=oO)):void 0===e&&(e=iO);for(var n,r,i,o,a,s=new cO(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 cO(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(sO)}function iO(t){return t.children}function oO(t){return Array.isArray(t)?t[1]:null}function aO(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function sO(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function cO(t){this.data=t,this.depth=this.height=0,this.parent=null}function lO(t){return null==t?null:uO(t)}function uO(t){if("function"!=typeof t)throw new Error;return t}function fO(){return 0}function hO(t){return function(){return t}}function dO(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 pO(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}eO.props={defaultShape:"path",defaultLabelShape:"label",shape:tO,composite:!1,channels:[...ww({shapes:Object.keys(tO)}),{name:"d",scale:"identity"}],preInference:[...kw()],postInference:[]},cO.prototype=rO.prototype={constructor:cO,count:function(){return this.eachAfter(nO)},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 rO(this).eachBefore(aO)},[Symbol.iterator]:function*(){var t,e,n,r,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(yield i,e=i.children)for(n=0,r=e.length;n<r;++n)o.push(e[n])}while(o.length)}};var gO={depth:-1},mO={},yO={};function vO(t){return t.id}function bO(t){return t.parentId}function xO(){var t,e=vO,n=bO;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;MO(t,e-1)&&!MO(t,e-2)&&(t=t.slice(0,-1));return"/"===t[0]?t:`/${t}`}(t(e,n,r)))),n=e.map(wO),i=new Set(e).add("");for(const t of n)i.has(t)||(i.add(t),e.push(t),n.push(wO(t)),h.push(yO));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 cO(o),null!=(u=d(o,a,r))&&(u+="")&&(f=l.id=u,g.set(f,g.has(f)?mO:l)),null!=(u=p(o,a,r))&&(u+="")&&(l.parent=u);for(a=0;a<i;++a)if(u=(l=h[a]).parent){if(!(c=g.get(u)))throw new Error("missing: "+u);if(c===mO)throw new Error("ambiguous: "+u);c.children?c.children.push(l):c.children=[l],l.parent=c}else{if(s)throw new Error("multiple roots");s=l}if(!s)throw new Error("no root");if(null!=t){for(;s.data===yO&&1===s.children.length;)s=s.children[0],--i;for(let t=h.length-1;t>=0&&(l=h[t]).data===yO;--t)l.data=null}if(s.parent=gO,s.eachBefore((function(t){t.depth=t.parent.depth+1,--i})).eachBefore(sO),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(t){return arguments.length?(e=lO(t),r):e},r.parentId=function(t){return arguments.length?(n=lO(t),r):n},r.path=function(e){return arguments.length?(t=lO(e),r):t},r}function wO(t){let e=t.length;if(e<2)return"";for(;--e>1&&!MO(t,e););return t.slice(0,e)}function MO(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(!(1&n))return!0}return!1}function OO(t,e,n,r,i){for(var o,a=t.children,s=-1,c=a.length,l=t.value&&(i-n)/t.value;++s<c;)(o=a[s]).x0=e,o.x1=r,o.y0=n,o.y1=n+=o.value*l}var EO=(1+Math.sqrt(5))/2;function kO(t,e,n,r,i,o){for(var a,s,c,l,u,f,h,d,p,g,m,y=[],v=e.children,b=0,x=0,w=v.length,M=e.value;b<w;){c=i-n,l=o-r;do{u=v[x++].value}while(!u&&x<w);for(f=h=u,m=u*u*(g=Math.max(l/c,c/l)/(M*t)),p=Math.max(h/m,m/f);x<w;++x){if(u+=s=v[x].value,s<f&&(f=s),s>h&&(h=s),m=u*u*g,(d=Math.max(h/m,m/f))>p){u-=s;break}p=d}y.push(a={value:u,dice:c<l,children:v.slice(b,x)}),a.dice?pO(a,n,r,i,M?r+=l*u/M:o):OO(a,n,r,M?n+=c*u/M:i,o),M-=u,b=x}return y}var SO=function t(e){function n(t,n,r,i,o){kO(e,t,n,r,i,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(EO);function AO(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 m=l[d]-f,y=r-m;if(a-i>c-o){var v=r?(i*y+a*m)/r:a;t(e,d,m,i,o,v,c),t(d,n,y,v,o,a,c)}else{var b=r?(o*y+c*m)/r:c;t(e,d,m,i,o,a,b),t(d,n,y,i,b,a,c)}}(0,c,t.value,e,n,r,i)}function _O(t,e,n,r,i){(1&t.depth?OO:pO)(t,e,n,r,i)}var TO=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?pO(s,n,r,i,d?r+=(o-r)*s.value/d:o):OO(s,n,r,d?n+=(i-n)*s.value/d:i,o),d-=s.value}else t._squarify=a=kO(e,t,n,r,i,o),a.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(EO);function PO(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],PO(n,n.path)}))}function CO(t){const e=Q(t,["data","name"]);e.replaceAll&&(t.path=e.replaceAll(".","/").split("/")),t.children&&t.children.forEach((t=>{CO(t)}))}function NO(t,e,n){const{value:r}=n,i=function(t,e){const n={treemapBinary:AO,treemapDice:pO,treemapSlice:OO,treemapSliceDice:_O,treemapSquarify:SO,treemapResquarify:TO},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?xO().path(e)(t):xO()(t):rO(t)}(t,e.path);x(t)?CO(o):PO(o),r?o.sum((t=>e.ignoreParentValue&&t.children?0:function(t){return"function"==typeof t?t:e=>e[t]}(r)(t))).sort(e.sort):o.count(),function(){var t=SO,e=!1,n=1,r=1,i=[0],o=fO,a=fO,s=fO,c=fO,l=fO;function u(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(dO),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=uO(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:hO(+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:hO(+t),u):a},u.paddingRight=function(t){return arguments.length?(s="function"==typeof t?t:hO(+t),u):s},u.paddingBottom=function(t){return arguments.length?(c="function"==typeof t?t:hO(+t),u):c},u.paddingLeft=function(t){return arguments.length?(l="function"==typeof t?t:hO(+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 LO=t=>{const{cartesian:e}=t;return e?Tw:(e,n,r,i)=>{const{x:o,y:a}=r,s=Aw(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};LO.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,shape:{shape:hM},channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...kw(),{type:ui},{type:ci},{type:li}]};var jO={},RO={};function IO(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function BO(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 DO(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function FO(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":function(t){return t<0?"-"+DO(-t,6):t>9999?"+"+DO(t,6):DO(t,4)}(t.getUTCFullYear())+"-"+DO(t.getUTCMonth()+1,2)+"-"+DO(t.getUTCDate(),2)+(i?"T"+DO(e,2)+":"+DO(n,2)+":"+DO(r,2)+"."+DO(i,3)+"Z":r?"T"+DO(e,2)+":"+DO(n,2)+":"+DO(r,2)+"Z":n||e?"T"+DO(e,2)+":"+DO(n,2)+"Z":"")}function zO(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 RO;if(l)return l=!1,jO;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())!==RO;){for(var f=[];r!==jO&&r!==RO;)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?FO(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=IO(t);return function(r,i){return e(n(r),i,t)}}(t,e):IO(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=BO(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=BO(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}function GO(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;WO&&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 WO=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),$O=t=>{const{value:e,format:n=e.split(".").pop(),delimiter:r=",",autoType:i=!0}=t;return()=>Ee(void 0,void 0,void 0,(function*(){const t=yield fetch(e);if("csv"===n){const e=yield t.text();return zO(r).parse(e,i?GO:dr)}if("json"===n)return yield t.json();throw new Error(`Unknown format: ${n}.`)}))};$O.props={};const HO=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 VO(t){return null!=t&&!Number.isNaN(t)}HO.props={};const YO=t=>{const{callback:e=VO}=t;return t=>t.filter(e)};YO.props={};const UO=t=>{const{callback:e}=t;return t=>Array.isArray(t)?[...t].sort(e):t};UO.props={};const qO=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)))};qO.props={};const XO=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)),{})))};XO.props={};const KO=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)))};KO.props={};const ZO=t=>{const{value:e}=t;return()=>e};ZO.props={};const QO=t=>{const{callback:e=dr}=t;return t=>e(t)};QO.props={};const JO=t=>{const{callback:e=dr}=t;return t=>Array.isArray(t)?t.map(e):t};function tE(t){return"string"==typeof t?e=>e[t]:t}JO.props={};const eE=t=>{const{join:e,on:n,select:r=[],as:i=r,unknown:o=NaN}=t,[a,s]=n,c=tE(s),l=tE(a),u=Wn(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)),{}))}))};eE.props={};const nE=t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)};nE.props={};var rE={exports:{}},iE={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}}(iE),function(t){var e=Math.log(2),n=t.exports,r=iE.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],m=0;t.forEach((function(t){var e=function(t){return Math.floor((t-c)/u)}(t);if(!(e+a<0||e-a>=f.length)){var n=Math.max(e-a,0),i=e,o=Math.min(e+a,f.length-1),s=n-(e-a),l=e+a-o,h=d[-a-1+s]||0,y=d[-a-1+l]||0,v=p/(p-h-y);s>0&&(m+=v*(s-1)*g);var b=Math.max(0,e-a+1);r.inside(0,f.length-1,b)&&(f[b].y+=1*v*g),r.inside(0,f.length-1,i+1)&&(f[i+1].y-=2*v*g),r.inside(0,f.length-1,o+1)&&(f[o+1].y+=1*v*g)}}));var y=m,v=0,b=0;return f.forEach((function(t){v+=t.y,y+=v,t.y=y,b+=y})),b>0&&f.forEach((function(t){t.y/=b})),f},t.exports.getExpectedValueFromPdf=function(t){if(t&&0!==t.length){var e=0;return t.forEach((function(t){e+=t.x*t.y})),e}},t.exports.getXWithLeftTailArea=function(t,e){if(t&&0!==t.length){for(var n=0,r=0,i=0;i<t.length&&(r=i,!((n+=t[i].y)>=e));i++);return t[r].x}},t.exports.getPerplexity=function(t){if(t&&0!==t.length){var n=0;return t.forEach((function(t){var e=Math.log(t.y);isFinite(e)&&(n+=t.y*e)})),n=-n/e,Math.pow(2,n)}}}(rE);var oE=rE.exports;const aE=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(zn(t,(t=>n.map((e=>t[e])).join("-"))).values());return r.map((t=>{const n=oE.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})}))}};aE.props={};const sE=()=>t=>(console.log("G2 data section:",t),t);sE.props={};const cE={density:aM},lE=()=>(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]};lE.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,shape:cE,channels:[...ww({shapes:Object.keys(cE)}),{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:[...kw(),{type:Mn},{type:qr}],postInference:[...Ow()],interaction:{shareTooltip:!0}};const uE={heatmap:fM},fE=t=>(t,e,n,r)=>{const{x:i,y:o,size:a,color:s}=n;return[[0],[Array.from(t,(t=>{const e=a?+a[t]:40;return[...r.map([+i[t],+o[t]]),s[t],e]}))]]};fE.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,shape:uE,channels:[...ww({shapes:Object.keys(uE)}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...kw(),{type:qr},{type:Xr}],postInference:[...Mw()]};const hE=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"];hE.props={};const dE=()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"];dE.props={};const pE=t=>new Ko(t);pE.props={};const gE=t=>new pa(t);gE.props={};const mE=t=>new Uo(t);mE.props={};const yE=t=>new la(t);yE.props={};const vE=t=>new ga(t);vE.props={};const bE=t=>new Da(t);bE.props={};const xE=t=>new wa(t);xE.props={};const wE=t=>new ya(t);wE.props={};const ME=t=>new ba(t);ME.props={};const OE=t=>new Ea(t);OE.props={};const EE=t=>new Ma(t);EE.props={};const kE=t=>new va(t);kE.props={};const SE=t=>new Ga(t);SE.props={};const AE=t=>new Qo(t);function _E({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:m="auto",margin:y=16}){return{padding:m,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"},axisLeft:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"left",titleSpacing:12,titleTextBaseline:"middle",titleDirection:"vertical",titleTransformOrigin:"center"},axisRight:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"right",titleSpacing:12,titleTextBaseline:"top",titleDirection:"vertical",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleSpacing:0},axisArc:{title:!1,titlePosition:"inner",line:!1,tick:!0,labelSpacing:4},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:e,itemLabelFillOpacity:c,itemLabelFontSize:12,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[o,o],itemValueFill:e,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"normal",navButtonFill:e,navButtonFillOpacity:.65,navPageNumFill:e,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!1,titleFill:e,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:e,tickStrokeOpacity:.25,rowPadding:o,colPadding:a,maxRows:3,maxCols:3},legendContinuous:{handleHeight:12,handleLabelFill:e,handleLabelFillOpacity:u,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:e,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:e,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:e,labelFillOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing:3,tick:!0,tickLength:12,ribbonSize:12,ribbonFill:"#aaa",handle:!0,handleLabel:!1,handleShape:"slider",handleIconSize:12/1.8,indicator:!1,titleFontSize:12,titleSpacing:4,titleFontWeight:"normal",titleFillOpacity:c,tickStroke:e,tickStrokeOpacity:u},label:{fill:e,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:e,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:n,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},htmlLabel:{fontSize:12,opacity:.65,color:e,fontWeight:"normal"},slider:{trackSize:16,trackFill:r,trackFillOpacity:1,selectionFill:t,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:e,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:e,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{padding:[0,0,0,0],trackSize:6,isRound:!0,slidable:!0,scrollable:!0,trackFill:"#e5e5e5",trackFillOpacity:0,thumbFill:"#000",thumbFillOpacity:.15,thumbHighlightedFillOpacity:.2},title:{spacing:8,titleFill:e,titleFillOpacity:c,titleFontSize:16,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:e,subtitleFillOpacity:l,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}}}AE.props={};const TE=_E({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}),PE=t=>X({},TE,t);PE.props={};const CE=t=>X({},PE(),{category10:"category10",category20:"category20"},t);CE.props={};const NE=_E({colorBlack:"#fff",colorWhite:"#000",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"#141414",category10:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F"],category20:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F","#AABA01","#BC7CFC","#237CBC","#2DE379","#CE8032","#FF7AF4","#545FD3","#AFE410","#D8C608","#FFA1E0"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.25}),LE=t=>X({},NE,{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),jE=t=>Object.assign({},LE(),{category10:"category10",category20:"category20"},t);jE.props={};const RE=_E({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}),IE=t=>X({},RE,{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 BE(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)]}IE.props={};var DE,FE=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function zE(t){if(!(e=FE.exec(t)))throw new Error("invalid format: "+t);var e;return new GE({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 GE(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 WE(t,e){var n=BE(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")}zE.prototype=GE.prototype,GE.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 $E={"%":(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)=>WE(100*t,e),r:WE,s:function(t,e){var n=BE(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(DE=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")+BE(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function HE(t){return t}var VE,YE,UE=Array.prototype.map,qE=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function XE(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?HE:(e=UE.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?HE:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(UE.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=zE(t)).fill,n=t.align,f=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,m=t.precision,y=t.trim,v=t.type;"n"===v?(g=!0,v="g"):$E[v]||(void 0===m&&(m=12),y=!0,v="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===h?o:/[%p]/.test(v)?c:"",w=$E[v],M=/[defgprs%]/.test(v);function O(t){var i,o,c,h=b,O=x;if("c"===v)O=w(t)+O,t="";else{var E=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:w(Math.abs(t),m),y&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),E&&0==+t&&"+"!==f&&(E=!1),h=(E?"("===f?f:l:"-"===f||"("===f?"":f)+h,O=("s"===v?qE[8+DE/3]:"")+O+(E&&"("===f?")":""),M)for(i=-1,o=t.length;++i<o;)if(48>(c=t.charCodeAt(i))||c>57){O=(46===c?a+t.slice(i+1):t.slice(i))+O,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var k=h.length+t.length+O.length,S=k<p?new Array(p-k+1).join(e):"";switch(g&&d&&(t=r(S+t,S.length?p-O.length:1/0),S=""),n){case"<":t=h+t+O+S;break;case"=":t=h+S+t+O;break;case"^":t=S.slice(0,k=S.length>>1)+h+t+O+S.slice(k);break;default:t=S+h+t+O}return s(t)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),O.toString=function(){return t+""},O}return{format:f,formatPrefix:function(t,e){var n=f(((t=zE(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(function(t){return(t=BE(Math.abs(t)))?t[1]:NaN}(e)/3))),i=Math.pow(10,-r),o=qE[8+r/3];return function(t){return n(i*t)+o}}}}function KE(t,e,n){return t.querySelector(e)?vm(t).select(e):vm(t).append(n)}function ZE(t){return Array.isArray(t)?t.join(", "):`${t||""}`}function QE(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)}VE=XE({thousands:",",grouping:[3],currency:["$",""]}),YE=VE.format;class JE extends nw{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 tk extends JE{update(t){var e;const{subOptions:n}=t;this.attr(t),null===(e=this.child)||void 0===e||e.update(n)}}function ek(t,e){var n;return null===(n=t.filter((t=>t.getOptions().name===e)))||void 0===n?void 0:n[0]}function nk(t){return"vertical"===t||t===-Math.PI/2}function rk(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,m]=s?[d,h]:[h,d];return{orientation:p,width:g,height:m,size:h,length:d}}function ik(t){const e=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"],{style:n}=t,r=Me(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 ok(t,e){const{eulerAngles:n,origin:r}=e;r&&t.setOrigin(r),n&&t.rotate(n[0],n[1],n[2])}function ak(t){const{innerWidth:e,innerHeight:n,depth:r}=t.getOptions();return[e,n,r]}function sk(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]=Rn(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 pa({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(!Qc(e))return i;const o="bottom"===t?[i,1]:[0,i],a=e.map(o);if("bottom"===t){const t=a[0];return new pa({domain:[0,n],range:[0,1]}).map(t)}if("left"===t){const t=a[1];return new pa({domain:[0,r],range:[0,1]}).map(t)}return i}}(a,s),g=t=>["left","right"].includes(t);return qc(s)||Uc(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:Xc(s)&&"center"===a||Uc(s)&&(null===(o=t.getTicks)||void 0===o?void 0:o.call(t))&&(t=>["top","bottom","center","outer"].includes(t))(a)||Uc(s)&&g(a)?1-l:l,label:f(h(wm(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(wm(e),n,r)),id:String(n)}}))}function ck(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 lk(t,e,n){return!function(t){return qc(t)&&Uc(t)}(e)&&!Zc(e)&&(void 0===t?!!n.getTicks:t)}function uk(t,e,n,r,i,o){const a=function(t,e,n,r,i,o){const a=n.axis,s=["top","right","bottom","left"].includes(i)?n[`axis${gr(i)}`]:n.axisLinear,c=t.getOptions().name,l=n[`axis${G(c)}`]||{};return Object.assign({},a,s,l)}(t,0,n,0,i);return"center"===i?Object.assign(Object.assign(Object.assign(Object.assign({},a),{labelDirection:"right"===r?"negative":"positive"}),"center"===r?{labelTransform:"translate(50%,0)"}:null),{tickDirection:"right"===r?"negative":"positive",labelSpacing:"center"===r?0:4,titleSpacing:nk(o)?10:0,tick:"center"!==r&&void 0}):a}const fk=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?YE(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)}},hk=fk((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,m=Me(t,["direction","important","labelFormatter","order","orientation","actualPosition","position","size","style","title","tickCount","tickFilter","tickMethod","transform","indexBBox"]);return({scales:i,value:y,coordinate:v,theme:b})=>{const{bbox:x}=y,[w]=i,{domain:M,xScale:O}=w.getOptions(),E=uk(w,0,b,e,s,o),k=Object.assign(Object.assign(Object.assign({},E),l),m),S=function(t,e,n="xy"){const[r,i,o]=ak(e);return"xy"===n?t.includes("bottom")||t.includes("top")?i:r:"xz"===n?t.includes("bottom")||t.includes("top")?o:r:t.includes("bottom")||t.includes("top")?i:o}(a||s,v,t.plane),A=function(t,e,n,r,i){const{x:o,y:a,width:s,height:c}=n;if("bottom"===t)return{startPos:[o,a],endPos:[o+s,a]};if("left"===t)return{startPos:[o+s,a+c],endPos:[o+s,a]};if("right"===t)return{startPos:[o,a+c],endPos:[o,a]};if("top"===t)return{startPos:[o,a+c],endPos:[o+s,a+c]};if("center"===t){if("vertical"===e)return{startPos:[o,a],endPos:[o,a+c]};if("horizontal"===e)return{startPos:[o,a],endPos:[o+s,a]};if("number"==typeof e){const[t,n]=r.getCenter(),[l,u]=tl(r),[f,h]=el(r),d=Math.min(s,c)/2,{insetLeft:p,insetTop:g}=r.getOptions(),m=l*d,y=u*d,[v,b]=[t+o-p,n+a-g],[x,w]=[Math.cos(e),Math.sin(e)],M=[v+y*x,b+y*w],O=[v+m*x,b+m*w],E=()=>{const{domain:t}=i.getOptions();return t.length},k=qc(r)&&i?E():3;return{startPos:M,endPos:O,gridClosed:Math.abs(h-f-360)<1e-6,gridCenter:[v,b],gridControlAngles:new Array(k).fill(0).map(((t,e,n)=>(h-f)/k*e))}}}return{}}(s,o,x,v,O),_=function(t){const{depth:e}=t.getOptions();return e?{tickIsBillboard:!0,lineIsBillboard:!0,labelIsBillboard:!0,titleIsBillboard:!0,gridIsBillboard:!0}:{}}(v),T=sk(w,M,f,r,h,d,s,v),P=g?T.map(((t,e)=>{const n=g.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t})):T,C=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},k),{type:"linear",data:P,crossSize:c,titleText:ZE(u),labelOverlap:ck(p,k),grid:lk(k.grid,v,w),gridLength:S,line:!0,indexBBox:g}),k.line?null:{lineOpacity:0}),A),_),n),N=C.labelOverlap.find((t=>"hide"===t.type));return N&&(C.crossSize=!1),new Ox({className:"axis",style:ik(C)})}})),dk=fk((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=Me(t,["order","size","position","orientation","labelFormatter","tickFilter","tickCount","tickMethod","important","style","indexBBox","title","grid"]);return({scales:[t],value:e,coordinate:n,theme:i})=>{const{bbox:u}=e,{domain:g}=t.getOptions(),m=sk(t,g,s,o,a,c,r,n),y=f?m.map(((t,e)=>{const n=f.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t})):m,[v,b]=tl(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]=el(i),[d,p]=ak(i),g={center:l,radius:u,startAngle:f,endAngle:h,gridLength:(r-n)*(Math.min(d,p)/2)};if("inner"===t){const{insetLeft:t,insetTop:e}=i.getOptions();return Object.assign(Object.assign({},g),{center:[l[0]-t,l[1]-e],labelAlign:"perpendicular",labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"})}return Object.assign(Object.assign({},g),{labelAlign:"parallel",labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"})}(r,u,v,b,n),{axis:w,axisArc:M={}}=i,O=ik(X({},w,M,x,Object.assign(Object.assign({type:"arc",data:y,titleText:ZE(h),grid:d},p),l)));return new Ox({style:et(O,["transform"])})}}));hk.props={defaultPosition:"center",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]},dk.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const pk=t=>(...e)=>{const n=hk(Object.assign({},{crossPadding:50},t))(...e);return ok(n,t),n};pk.props=Object.assign(Object.assign({},hk.props),{defaultPosition:"bottom"});const gk=t=>(...e)=>{const n=hk(Object.assign({},{crossPadding:10},t))(...e);return ok(n,t),n};function mk(t,e,n,r){const{radar:i}=t,[o]=r,a=o.getOptions().name,[s,c]=el(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))})}gk.props=Object.assign(Object.assign({},hk.props),{defaultPosition:"left"});const yk=t=>{const{important:e={}}=t,n=Me(t,["important"]);return r=>{const{theme:i,coordinate:o,scales:a}=r;return hk(Object.assign(Object.assign(Object.assign({},n),function(t){const e=t%(2*Math.PI);return e===Math.PI/2?{titleTransform:"translate(0, 50%)"}:e>-Math.PI/2&&e<Math.PI/2?{titleTransform:"translate(50%, 0)"}:e>Math.PI/2&&e<3*Math.PI/2?{titleTransform:"translate(-50%, 0)"}:{}}(t.orientation)),{important:Object.assign(Object.assign({},mk(t,i,o,a)),e)}))(r)}};function vk(t,e){const{scales:n,library:r,markState:i}=e,[o,a]=function(t,e){const n=ek(t,"shape"),r=ek(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)||C(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=Me(e,["d","fill","lineWidth","path","stroke","color"]);const l=xy.get(t)||xy.get("point");return(...t)=>new Up({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 ek(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 bk(t){const e=ek(t,"opacity");if(e){const{range:t}=e.getOptions();return(e,n)=>t[n]}}function xk(t,e){const{labelFormatter:n=(t=>`${t}`)}=t,{scales:r,theme:i}=e,o=function(t,e){const n=ek(t,"size");return n instanceof la?2*n.map(NaN):e}(r,i.legendCategory.itemMarkerSize),a={itemMarker:vk(Object.assign(Object.assign({},t),{itemMarkerSize:o}),e),itemMarkerSize:o,itemMarkerOpacity:bk(r)},s="string"==typeof n?YE(n):n,c=ek(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)})))})}yk.props=Object.assign(Object.assign({},hk.props),{defaultPosition:"center"});const wk=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s,cols:c,itemMarker:l}=t,u=Me(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}=rk(t,e,n);return{width:i,height:o}}(r,t,wk),d=QE(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:ZE(s)}),xk(t,e)),{legendCategory:g={}}=i,m=ik(Object.assign({},g,p,u)),y=new tk({style:Object.assign(Object.assign({x:a.x,y:a.y,width:a.width,height:a.height},d),{subOptions:m})});return y.appendChild(new Fx({className:"legend-category",style:m})),y}};function Mk(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 Ok(t){const{domain:e}=t.getOptions(),[n,r]=[e[0],Pr(e)];return[n,r]}function Ek(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:[Rf(e).toString()]})),r}(s,c),[u,f]=Ok(l),[h,d]=Ok([e,n,r].filter((t=>void 0!==t)).find((t=>!(t instanceof Qo))));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 kk(t,e,n,r,i,o){const a=ek(t,"color"),s=function(t,e,n){const{size:r}=e,i=rk(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 ba){const{range:t}=a.getOptions(),[e,n]=Ok(a);return a instanceof Ma||a instanceof Ea?Mk(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 Ek(s,a,ek(t,"size"),ek(t,"opacity"),e,o)}wk.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const Sk=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s,style:c,crossPadding:l,padding:u}=t,f=Me(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,m=QE(o,n),{legendContinuous:y={}}=a,v=ik(Object.assign({},y,Object.assign(Object.assign({titleText:ZE(s),labelAlign:"value",labelFormatter:"string"==typeof e?t=>YE(e)(t.label):e},kk(r,l,i,t,Sk,a)),c),f)),b=new JE({style:Object.assign(Object.assign({x:h,y:d,width:p,height:g},m),{subOptions:v})});return b.appendChild(new Zx({className:"legend-continuous",style:v})),b}};Sk.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[12,12]};const Ak=t=>(...e)=>Sk(Object.assign({},{block:!0},t))(...e);Ak.props=Object.assign(Object.assign({},Sk.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const _k=t=>e=>{const{scales:n}=e,r=ek(n,"size");return Sk(Object.assign({},{type:"size",data:r.getTicks().map(((t,e)=>({value:t,label:String(t)})))},t))(e)};_k.props=Object.assign(Object.assign({},Sk.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const Tk=t=>_k(Object.assign({},{block:!0},t));function Pk(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"}}}Tk.props=Object.assign(Object.assign({},Sk.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const Ck=(Nk={render(t,e){const{width:n,title:r,subtitle:i,spacing:o=2,align:a="left",x:s,y:c}=t,l=Me(t,["width","title","subtitle","spacing","align","x","y"]);e.style.transform=`translate(${s}, ${c})`;const u=xr(l,"title"),f=xr(l,"subtitle"),h=KE(e,".title","text").attr("className","title").call(Mm,Object.assign(Object.assign(Object.assign({},Pk(0,0,n,a)),{fontSize:14,textBaseline:"top",text:r}),u)).node().getLocalBounds();KE(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({},Pk(0,h.max[1]+o,n,a)),{fontSize:12,textBaseline:"top",text:i}),f))}))}},class extends Gp{constructor(t){super(t),this.descriptor=Nk}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(X({},this.attributes,t)),null===(n=(e=this.descriptor).render)||void 0===n||n.call(e,this.attributes,this)}});var Nk;const Lk=t=>({value:e,theme:n})=>{const{x:r,y:i,width:o,height:a}=e.bbox;return new Ck({style:X({},n.title,Object.assign({x:r,y:i,width:o,height:a},t))})};function jk(t){return!!t.getBandWidth}function Rk(t,e,n){if(!jk(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))}(Pn(s,e)+o,0,i.length-1);return i[c]}function Ik(t,e,n){if(!e)return t.getOptions().domain;if(!jk(t)){const r=Vn(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 Bk(t,e,n,r,i,o){const{x:a,y:s}=i,c=(t,e)=>{const[n,r]=o.invert(t);return[Rk(a,n,e),Rk(s,r,e)]},l=c([t,e],!0),u=c([n,r],!1);return[Ik(a,[l[0],u[0]]),Ik(s,[l[1],u[1]])]}function Dk(t,e){const[n,r]=t;return[e.map(n),e.map(r)+(t=>t.getStep?t.getStep():0)(e)]}Lk.props={defaultPosition:"top",defaultOrder:2,defaultSize:36,defaultCrossPadding:[20,20],defaultPadding:[12,12]};const Fk=t=>{const{orientation:e,labelFormatter:n,size:r,style:i={},position:o}=t,a=Me(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,m=(null===(s=c.getFormatter)||void 0===s?void 0:s.call(c))||(t=>t+""),y="string"==typeof n?YE(n):n,v="horizontal"===e,b=Uc(f)&&v,{trackSize:x=g.trackSize}=i,[w,M]=function(t,e,n){const{x:r,y:i,width:o,height:a}=t;return"left"===e?[r+o-n,i]:"right"===e||"bottom"===e?[r,i]:"top"===e?[r,i+a-n]:void 0}(h,o,x);return new wb({className:"slider",style:Object.assign({},g,Object.assign(Object.assign({x:w,y:M,trackLength:v?d:p,orientation:e,formatter:t=>(y||m)(Rk(c,b?1-t:t,!0)),sparklineData:zk(t,r)},i),a))})}};function zk(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)).map((([t])=>{const{encode:n,slider:r}=t;if((null==r?void 0:r.x)&&0===Object.keys(r.x).length){const t=t=>{const e=n[t];return[t,e?e.value:void 0]};return Object.fromEntries(e.map(t))}}));if(!(null==n?void 0:n.series))return null==n?void 0:n.y;const r=n.series.reduce(((t,e,r)=>(t[e]=t[e]||[],t[e].push(n.y[r]),t)),{});return Object.values(r)}(n,["y","series"])}Fk.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const Gk=t=>Fk(Object.assign(Object.assign({},t),{orientation:"horizontal"}));Gk.props=Object.assign(Object.assign({},Fk.props),{defaultPosition:"bottom"});const Wk=t=>Fk(Object.assign(Object.assign({},t),{orientation:"vertical"}));Wk.props=Object.assign(Object.assign({},Fk.props),{defaultPosition:"left"});const $k=t=>{const{orientation:e,labelFormatter:n,style:r}=t,i=Me(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,[m,y]=d,v=y>m?0:1;return new Mb({className:"g2-scrollbar",style:Object.assign({},f,Object.assign(Object.assign(Object.assign(Object.assign({},r),{x:s,y:c,trackLength:p,value:v}),i),{orientation:e,contentLength:g,viewportLength:p}))})}};$k.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const Hk=t=>$k(Object.assign(Object.assign({},t),{orientation:"horizontal"}));Hk.props=Object.assign(Object.assign({},$k.props),{defaultPosition:"bottom"});const Vk=t=>$k(Object.assign(Object.assign({},t),{orientation:"vertical"}));Vk.props=Object.assign(Object.assign({},$k.props),{defaultPosition:"left"});const Yk=t=>()=>new $p;Yk.props={};const Uk=(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]=Uc(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))}},qk=(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]=Uc(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))}},Xk=(t,e)=>{const n=1e-4,{coordinate:r}=e;return Jp({name:"scaleInYRadius",inherits:!1,initialValue:"",interpolable:!0,syntax:wf.NUMBER}),(e,i,o)=>{const[a]=e;return qc(r)?(e=>{const{__data__:i,style:a}=e,{radius:s=0,inset:c=0,fillOpacity:l=1,strokeOpacity:u=1,opacity:f=1}=a,{points:h,y:d,y1:p}=i,g=Sm(r,h,[d,p]),{innerRadius:m,outerRadius:y}=g,v=hc().cornerRadius(s).padAngle(c*Math.PI/180),b=new Up({}),x=t=>(b.attr({d:v(t)}),gh(b)),w=[{scaleInYRadius:m+n,fillOpacity:0,strokeOpacity:0,opacity:0},{scaleInYRadius:m+n,fillOpacity:l,strokeOpacity:u,opacity:f,offset:.01},{scaleInYRadius:y,fillOpacity:l,strokeOpacity:u,opacity:f}],M=e.animate(w,Object.assign(Object.assign({},o),t));return M.onframe=function(){e.style.d=x(Object.assign(Object.assign({},g),{outerRadius:Number(e.style.scaleInYRadius)}))},M.onfinish=function(){e.style.d=x(Object.assign(Object.assign({},g),{outerRadius:y}))},M})(a):(e=>{const{style:n}=e,{transform:i="",fillOpacity:a=1,strokeOpacity:s=1,opacity:c=1}=n,[l,u]=Uc(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)}},Kk=(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]=Uc(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))}},Zk=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))};Zk.props={};const Qk=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))};function Jk(t,e){const n={};for(const r of e){const e=t.style[r];e&&(n[r]=e)}return n}Qk.props={};const tS=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function eS(t){const{min:e,max:n}=t.getLocalBounds(),[r,i]=e,[o,a]=n;return[r,i,o-r,a-i]}function nS(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 rS(t,e){const[n,r,i,o]=eS(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(nS([t,o,e,l]))}f-=t,u+=1}return c}function iS(t,e){t.__data__=e.__data__,t.className=e.className,t.markType=e.markType,e.parentNode.replaceChild(t,e)}function oS(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function aS(t){const e=gh(t);if(e&&!function(t){return!oS(t,"m")||!oS(t,"M")}(e))return e}function sS(t,e,n,r){const{nodeName:i}=e,{nodeName:o}=n,a=aS(e),s=aS(n);if(i===o&&"path"!==i||(void 0===a||void 0===s))return function(t,e,n){const[r,i,o,a]=eS(t),{transform:s}=t.style,{transform:c}=e.style;iS(e,t);const[l,u,f,h]=eS(e),d=r-l,p=i-u,g=o/f,m=a/h,y=[Object.assign({transform:`${s?s+" ":""}translate(${d}, ${p}) scale(${g}, ${m})`},Jk(t,tS)),Object.assign({transform:(c?c+" ":"")+"translate(0, 0) scale(1, 1)"},Jk(e,tS))];return e.animate(y,n)}(e,n,r);const c=function(t,e){const{nodeName:n}=t;if("path"===n)return t;const r=new Up({style:Object.assign(Object.assign({},Jk(t,tS)),{d:e})});return iS(r,t),r}(t,a),l=[Object.assign({},Jk(e,tS)),Object.assign({},Jk(n,tS))];a!==s&&(l[0].d=a,l[1].d=s);const u=c.animate(l,r);return u.onfinish=()=>{c.style.transform="none",yr(c,n)},c.style.transform="none",u}const cS=t=>(e,n,r)=>{const i=function(t="pack"){return"function"==typeof t?t:rS}(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 sS(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)=>sS(e,new Up({style:Object.assign({d:i[r]},Jk(t,tS))}),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)=>sS(t,t,new Up({style:{d:i[r],fill:e.style.fill}}),n)));return[...u,l]}(e,t,o,i)}return null};cS.props={};const lS=(t,e)=>{const n=1e-4;Jp({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:wf.NUMBER});const{coordinate:r}=e;return(i,o,a)=>{const[s]=i;if(!qc(r))return Uk(t,e)(i,o,a);const c=r.getCenter(),{__data__:l,style:u}=s,{radius:f=0,inset:h=0,fillOpacity:d=1,strokeOpacity:p=1,opacity:g=1}=u,{points:m,y:y,y1:v}=l,b=hc().cornerRadius(f).padAngle(h*Math.PI/180),x=Sm(r,m,[y,v]),{startAngle:w,endAngle:M}=x,O=new Up({}),E=t=>{O.attr({d:b(t),transform:`translate(${c[0]}, ${c[1]})`});const e=gh(O);return console.log(e),e},k=[{waveInArcAngle:w+n,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:w+n,fillOpacity:d,strokeOpacity:p,opacity:g,offset:.01},{waveInArcAngle:M,fillOpacity:d,strokeOpacity:p,opacity:g}],S=s.animate(k,Object.assign(Object.assign({},a),t));return S.onframe=function(){s.style.path=E(Object.assign(Object.assign({},x),{endAngle:Number(s.style.waveInArcAngle)}))},S.onfinish=function(){s.style.path=E(Object.assign(Object.assign({},x),{endAngle:M}))},S}};lS.props={};const uS=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))},fS=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))},hS=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))};hS.props={};const dS=(t,e)=>(n,r,i)=>{const[o]=n,{height:a,width:s}=o.getBoundingClientRect(),c=new Up({style:{d:`M0,0L${s},0L${s},${a}L0,${a}Z`}});o.appendChild(c),o.style.clipPath=c;return Uk(t,e)([c],r,i)};dS.props={};const pS=(t,e)=>(n,r,i)=>{const[o]=n,{height:a,width:s}=o.getBoundingClientRect(),c=new Up({style:{d:`M0,0L${s},0L${s},${a}L0,${a}Z`}});o.appendChild(c),o.style.clipPath=c;return Xk(t,e)([c],r,i)};pS.props={};const gS="main-layer",mS="label-layer",yS="element",vS="view",bS="plot",xS="component",wS="label",MS="area";function OS(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,o=void 0===i?0:i,a=e.r;t.arc(r,o,a,0,2*Math.PI,!1)}function ES(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,o=void 0===i?0:i,a=e.rx,s=e.ry;if(t.ellipse)t.ellipse(r,o,a,s,0,0,2*Math.PI,!1);else{var c=a>s?a:s,l=a>s?1:a/s,u=a>s?s/a:1;t.save(),t.scale(l,u),t.arc(r,o,c,0,2*Math.PI)}}function kS(t,e){var n,r,i=e.x1,o=e.y1,a=e.x2,s=e.y2,c=e.markerStart,l=e.markerEnd,u=e.markerStartOffset,f=e.markerEndOffset,h=0,d=0,p=0,g=0,m=0;c&&Cp(c)&&u&&(n=a-i,r=s-o,m=Math.atan2(r,n),h=Math.cos(m)*(u||0),d=Math.sin(m)*(u||0)),l&&Cp(l)&&f&&(n=i-a,r=o-s,m=Math.atan2(r,n),p=Math.cos(m)*(f||0),g=Math.sin(m)*(f||0)),t.moveTo(i+h,o+d),t.lineTo(a+p,s+g)}function SS(t,e){var n,r,i=e.markerStart,o=e.markerEnd,a=e.markerStartOffset,s=e.markerEndOffset,c=e.d,l=c.absolutePath,u=c.segments,f=0,h=0,d=0,p=0,g=0;if(i&&Cp(i)&&a){var m=Ae(i.parentNode.getStartTangent(),2),y=m[0],v=m[1];n=y[0]-v[0],r=y[1]-v[1],g=Math.atan2(r,n),f=Math.cos(g)*(a||0),h=Math.sin(g)*(a||0)}if(o&&Cp(o)&&s){var b=Ae(o.parentNode.getEndTangent(),2);y=b[0],v=b[1];n=y[0]-v[0],r=y[1]-v[1],g=Math.atan2(r,n),d=Math.cos(g)*(s||0),p=Math.sin(g)*(s||0)}for(var x=0;x<l.length;x++){var w=l[x],M=w[0],O=l[x+1],E=0===x&&(0!==f||0!==h),k=(x===l.length-1||O&&("M"===O[0]||"Z"===O[0]))&&0!==d&&0!==p;switch(M){case"M":E?(t.moveTo(w[1]+f,w[2]+h),t.lineTo(w[1],w[2])):t.moveTo(w[1],w[2]);break;case"L":k?t.lineTo(w[1]+d,w[2]+p):t.lineTo(w[1],w[2]);break;case"Q":t.quadraticCurveTo(w[1],w[2],w[3],w[4]),k&&t.lineTo(w[3]+d,w[4]+p);break;case"C":t.bezierCurveTo(w[1],w[2],w[3],w[4],w[5],w[6]),k&&t.lineTo(w[5]+d,w[6]+p);break;case"A":var S=u[x].arcParams,A=S.cx,_=S.cy,T=S.rx,P=S.ry,C=S.startAngle,N=S.endAngle,L=S.xRotation,j=S.sweepFlag;if(t.ellipse)t.ellipse(A,_,T,P,L,C,N,!!(1-j));else{var R=T>P?T:P,I=T>P?1:T/P,B=T>P?P/T:1;t.translate(A,_),t.rotate(L),t.scale(I,B),t.arc(0,0,R,C,N,!!(1-j)),t.scale(1/I,1/B),t.rotate(-L),t.translate(-A,-_)}k&&t.lineTo(w[6]+d,w[7]+p);break;case"Z":t.closePath()}}}function AS(t,e){var n,r,i=e.markerStart,o=e.markerEnd,a=e.markerStartOffset,s=e.markerEndOffset,c=e.points.points,l=c.length,u=c[0][0],f=c[0][1],h=c[l-1][0],d=c[l-1][1],p=0,g=0,m=0,y=0,v=0;i&&Cp(i)&&a&&(n=c[1][0]-c[0][0],r=c[1][1]-c[0][1],v=Math.atan2(r,n),p=Math.cos(v)*(a||0),g=Math.sin(v)*(a||0)),o&&Cp(o)&&s&&(n=c[l-1][0]-c[0][0],r=c[l-1][1]-c[0][1],v=Math.atan2(r,n),m=Math.cos(v)*(s||0),y=Math.sin(v)*(s||0)),t.moveTo(u+(p||m),f+(g||y));for(var b=1;b<l-1;b++){var x=c[b];t.lineTo(x[0],x[1])}t.lineTo(h,d)}function _S(t,e){var n,r,i=e.markerStart,o=e.markerEnd,a=e.markerStartOffset,s=e.markerEndOffset,c=e.points.points,l=c.length,u=c[0][0],f=c[0][1],h=c[l-1][0],d=c[l-1][1],p=0,g=0,m=0,y=0,v=0;i&&Cp(i)&&a&&(n=c[1][0]-c[0][0],r=c[1][1]-c[0][1],v=Math.atan2(r,n),p=Math.cos(v)*(a||0),g=Math.sin(v)*(a||0)),o&&Cp(o)&&s&&(n=c[l-2][0]-c[l-1][0],r=c[l-2][1]-c[l-1][1],v=Math.atan2(r,n),m=Math.cos(v)*(s||0),y=Math.sin(v)*(s||0)),t.moveTo(u+p,f+g);for(var b=1;b<l-1;b++){var x=c[b];t.lineTo(x[0],x[1])}t.lineTo(h+m,d+y)}function TS(t,e){var n=e.x,r=void 0===n?0:n,i=e.y,o=void 0===i?0:i,a=e.radius,s=e.width,c=e.height,l=s,u=c;if(a&&a.some((function(t){return 0!==t}))){var f=s>0?1:-1,h=c>0?1:-1,d=f+h===0,p=Ae(a.map((function(t){return N(t,0,Math.min(Math.abs(l)/2,Math.abs(u)/2))})),4),g=p[0],m=p[1],y=p[2],v=p[3];t.moveTo(f*g+r,o),t.lineTo(l-f*m+r,o),0!==m&&t.arc(l-f*m+r,h*m+o,m,-h*Math.PI/2,f>0?0:Math.PI,d),t.lineTo(l+r,u-h*y+o),0!==y&&t.arc(l-f*y+r,u-h*y+o,y,f>0?0:Math.PI,h>0?Math.PI/2:1.5*Math.PI,d),t.lineTo(f*v+r,u+o),0!==v&&t.arc(f*v+r,u-h*v+o,v,h>0?Math.PI/2:-Math.PI/2,f>0?Math.PI:0,d),t.lineTo(r,h*g+o),0!==g&&t.arc(f*g+r,h*g+o,g,f>0?Math.PI:0,h>0?1.5*Math.PI:Math.PI/2,d)}else t.rect(r,o,l,u)}var PS=function(t){function e(){var e=t.apply(this,_e([],Ae(arguments),!1))||this;return e.name="canvas-path-generator",e}return xe(e,t),e.prototype.init=function(){var t,e=((t={})[tu.CIRCLE]=OS,t[tu.ELLIPSE]=ES,t[tu.RECT]=TS,t[tu.LINE]=kS,t[tu.POLYLINE]=_S,t[tu.POLYGON]=AS,t[tu.PATH]=SS,t[tu.TEXT]=void 0,t[tu.GROUP]=void 0,t[tu.IMAGE]=void 0,t[tu.HTML]=void 0,t[tu.MESH]=void 0,t);this.context.pathGeneratorFactory=e},e.prototype.destroy=function(){delete this.context.pathGeneratorFactory},e}(ru),CS=Ht(),NS=Ht(),LS=Ht(),jS=lt(),RS=function(){function t(){var t=this;this.isHit=function(e,n,r,i){var o=t.context.pointInPathPickerFactory[e.nodeName];if(o){var a=gt(jS,r),s=re(NS,Xt(LS,n[0],n[1],0),a);if(o(e,new Tu(s[0],s[1]),i,t.isPointInPath,t.context,t.runtime))return!0}return!1},this.isPointInPath=function(e,n){var r=t.runtime.offscreenCanvasCreator.getOrCreateContext(t.context.config.offscreenCanvas),i=t.context.pathGeneratorFactory[e.nodeName];return i&&(r.beginPath(),i(r,e.parsedStyle),r.closePath()),r.isPointInPath(n.x,n.y)}}return t.prototype.apply=function(e,n){var r,i=this,o=e.renderingService,a=e.renderingContext;this.context=e,this.runtime=n;var s=null===(r=a.root)||void 0===r?void 0:r.ownerDocument;o.hooks.pick.tapPromise(t.tag,(function(t){return Ee(i,void 0,void 0,(function(){return ke(this,(function(e){return[2,this.pick(s,t)]}))}))})),o.hooks.pickSync.tap(t.tag,(function(t){return i.pick(s,t)}))},t.prototype.pick=function(t,e){var n,r,i=e.topmost,o=e.position,a=o.x,s=o.y,c=Xt(CS,a,s,0),l=t.elementsFromBBox(c[0],c[1],c[0],c[1]),u=[];try{for(var f=Se(l),h=f.next();!h.done;h=f.next()){var d=h.value,p=d.getWorldTransform();if(this.isHit(d,c,p,!1)){var g=dd(d);if(g){var m=g.parsedStyle.clipPath;if(this.isHit(m,c,m.getWorldTransform(),!0)){if(i)return e.picked=[d],e;u.push(d)}}else{if(i)return e.picked=[d],e;u.push(d)}}}}catch(t){n={error:t}}finally{try{h&&!h.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}return e.picked=u,e},t.tag="CanvasPicker",t}();function IS(t,e,n){var r=t.parsedStyle,i=r.cx,o=void 0===i?0:i,a=r.cy,s=void 0===a?0:a,c=r.r,l=r.fill,u=r.stroke,f=r.lineWidth,h=void 0===f?0:f,d=r.increasedLineWidthForHitTesting,p=void 0===d?0:d,g=r.pointerEvents,m=void 0===g?"auto":g,y=(h+p)/2,v=jl(o,s,e.x,e.y),b=Ae(yd(m,l,u),2),x=b[0],w=b[1];return x&&w||n?v<=c+y:x?v<=c:!!w&&(v>=c-y&&v<=c+y)}function BS(t,e,n,r){return t/(n*n)+e/(r*r)}function DS(t,e,n){var r=t.parsedStyle,i=r.cx,o=void 0===i?0:i,a=r.cy,s=void 0===a?0:a,c=r.rx,l=r.ry,u=r.fill,f=r.stroke,h=r.lineWidth,d=void 0===h?0:h,p=r.increasedLineWidthForHitTesting,g=void 0===p?0:p,m=r.pointerEvents,y=void 0===m?"auto":m,v=e.x,b=e.y,x=Ae(yd(y,u,f),2),w=x[0],M=x[1],O=(d+g)/2,E=(v-o)*(v-o),k=(b-s)*(b-s);return w&&M||n?BS(E,k,c+O,l+O)<=1:w?BS(E,k,c,l)<=1:!!M&&(BS(E,k,c-O,l-O)>=1&&BS(E,k,c+O,l+O)<=1)}function FS(t,e,n,r,i,o){return i>=t&&i<=t+n&&o>=e&&o<=e+r}function zS(t,e,n,r,i,o,a,s){var c=(Math.atan2(s-e,a-t)+2*Math.PI)%(2*Math.PI),l={x:t+n*Math.cos(c),y:e+n*Math.sin(c)};return jl(l.x,l.y,a,s)<=o/2}function GS(t,e,n,r,i,o,a){var s=Math.min(t,n),c=Math.max(t,n),l=Math.min(e,r),u=Math.max(e,r),f=i/2;return o>=s-f&&o<=c+f&&a>=l-f&&a<=u+f&&$l(t,e,n,r,o,a)<=i/2}function WS(t,e,n,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a<o-1;a++){if(GS(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,n,r))return!0}if(i){var s=t[0],c=t[o-1];if(GS(s[0],s[1],c[0],c[1],e,n,r))return!0}return!1}var $S=1e-6;function HS(t){return Math.abs(t)<$S?0:t<0?-1:1}function VS(t,e,n){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}function YS(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var o=0;o<i;o++){var a=t[o],s=t[(o+1)%i];if(VS(a,s,[e,n]))return!0;HS(a[1]-n)>0!=HS(s[1]-n)>0&&HS(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}function US(t,e,n){for(var r=!1,i=0;i<t.length;i++){if(r=YS(t[i],e,n))break}return r}function qS(t,e,n){var r=t.parsedStyle,i=r.x1,o=r.y1,a=r.x2,s=r.y2,c=r.lineWidth,l=void 0===c?0:c,u=r.increasedLineWidthForHitTesting,f=void 0===u?0:u,h=r.pointerEvents;return!(!Ae(yd(void 0===h?"auto":h,r.fill,r.stroke),2)[1]&&!n||!l)&&GS(i,o,a,s,l+f,e.x,e.y)}function XS(t,e,n,r,i,o){var a=t.parsedStyle,s=a.lineWidth,c=void 0===s?0:s,l=a.increasedLineWidthForHitTesting,u=void 0===l?0:l,f=a.stroke,h=a.fill,d=a.d,p=a.pointerEvents,g=void 0===p?"auto":p,m=d.segments,y=d.hasArc,v=d.polylines,b=d.polygons,x=Ae(yd(g,(null==b?void 0:b.length)&&h,f),2),w=x[0],M=x[1],O=rh(t),E=!1;return w||n?E=y?r(t,e):US(b,e.x,e.y)||US(v,e.x,e.y):((M||n)&&(E=function(t,e,n,r,i){for(var o=!1,a=e/2,s=0;s<t.length;s++){var c=t[s],l=c.currentPoint,u=c.params,f=c.prePoint,h=c.box;if(!h||FS(h.x-a,h.y-a,h.width+e,h.height+e,n,r))switch(c.command){case"L":case"Z":if(o=GS(f[0],f[1],l[0],l[1],e,n,r))return!0;break;case"Q":if(o=Ql(f[0],f[1],u[1],u[2],u[3],u[4],n,r)<=e/2)return!0;break;case"C":if(o=Ul(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],n,r,i)<=e/2)return!0;break;case"A":c.cubicParams||(c.cubicParams=qe(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var d=c.cubicParams,p=f,g=0;g<d.length;g+=6){var m=Ul(p[0],p[1],d[g],d[g+1],d[g+2],d[g+3],d[g+4],d[g+5],n,r,i);if(p=[d[g+4],d[g+5]],o=m<=e/2)return!0}}}return o}(m,c+u,e.x,e.y,O)),E)}function KS(t,e,n){var r=t.parsedStyle,i=r.stroke,o=r.fill,a=r.lineWidth,s=void 0===a?0:a,c=r.increasedLineWidthForHitTesting,l=void 0===c?0:c,u=r.points,f=r.pointerEvents,h=Ae(yd(void 0===f?"auto":f,o,i),2),d=h[0],p=!1;return(h[1]||n)&&(p=WS(u.points,s+l,e.x,e.y,!0)),p||!d&&!n||(p=YS(u.points,e.x,e.y)),p}function ZS(t,e,n){var r=t.parsedStyle,i=r.lineWidth,o=void 0===i?0:i,a=r.increasedLineWidthForHitTesting,s=void 0===a?0:a,c=r.points,l=r.pointerEvents;return!(!Ae(yd(void 0===l?"auto":l,r.fill,r.stroke),2)[1]&&!n||!o)&&WS(c.points,o+s,e.x,e.y,!1)}function QS(t,e,n,r,i){var o=t.parsedStyle,a=o.radius,s=o.fill,c=o.stroke,l=o.lineWidth,u=void 0===l?0:l,f=o.increasedLineWidthForHitTesting,h=void 0===f?0:f,d=o.x,p=void 0===d?0:d,g=o.y,m=void 0===g?0:g,y=o.width,v=o.height,b=o.pointerEvents,x=Ae(yd(void 0===b?"auto":b,s,c),2),w=x[0],M=x[1],O=u+h;if(a&&a.some((function(t){return 0!==t}))){var E=!1;return(M||n)&&(E=function(t,e,n,r,i,o,a,s){var c=Ae(i,4),l=c[0],u=c[1],f=c[2],h=c[3];return GS(t+l,e,t+n-u,e,o,a,s)||GS(t+n,e+u,t+n,e+r-f,o,a,s)||GS(t+n-f,e+r,t+h,e+r,o,a,s)||GS(t,e+r-h,t,e+l,o,a,s)||zS(t+n-u,e+u,u,Math.PI,Math.PI,o,a,s)||zS(t+n-f,e+r-f,f,0,Math.PI,o,a,s)||zS(t+h,e+r-h,h,Math.PI,Math.PI,o,a,s)||zS(t+l,e+l,l,Math.PI,Math.PI,o,a,s)}(p,m,y,v,a.map((function(t){return N(t,0,Math.min(Math.abs(y)/2,Math.abs(v)/2))})),O,e.x,e.y)),E||!w&&!n||(E=r(t,e)),E}var k=O/2;return w&&M||n?FS(p-k,m-k,y+k,v+k,e.x,e.y):w?FS(p,m,y,v,e.x,e.y):!!M&&function(t,e,n,r,i,o,a){var s=i/2;return FS(t-s,e-s,n,i,o,a)||FS(t+n-s,e-s,i,r,o,a)||FS(t+s,e+r-s,n,i,o,a)||FS(t-s,e+s,i,r,o,a)}(p,m,y,v,O,e.x,e.y)}function JS(t,e,n,r,i,o){var a=t.parsedStyle,s=a.pointerEvents,c=void 0===s?"auto":s,l=a.x,u=void 0===l?0:l,f=a.y,h=void 0===f?0:f,d=a.width,p=a.height;if("non-transparent-pixel"===c){var g=i.config.offscreenCanvas,m=o.offscreenCanvasCreator.getOrCreateCanvas(g),y=o.offscreenCanvasCreator.getOrCreateContext(g,{willReadFrequently:!0});return m.width=d,m.height=p,i.defaultStyleRendererFactory[tu.IMAGE].render(y,we(we({},t.parsedStyle),{x:0,y:0}),t,void 0,void 0,void 0),y.getImageData(e.x-u,e.y-h,1,1).data.every((function(t){return 0!==t}))}return!0}var tA=function(t){function e(){var e=t.apply(this,_e([],Ae(arguments),!1))||this;return e.name="canvas-picker",e}return xe(e,t),e.prototype.init=function(){var t,e=((t={})[tu.CIRCLE]=IS,t[tu.ELLIPSE]=DS,t[tu.RECT]=QS,t[tu.LINE]=qS,t[tu.POLYLINE]=ZS,t[tu.POLYGON]=KS,t[tu.PATH]=XS,t[tu.TEXT]=function(){return!0},t[tu.GROUP]=null,t[tu.IMAGE]=JS,t[tu.HTML]=null,t[tu.MESH]=null,t);this.context.pointInPathPickerFactory=e,this.addRenderingPlugin(new RS)},e.prototype.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()},e}(ru),eA=function(){function t(t){this.canvasRendererPluginOptions=t,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreenLastFrame=!1,this.clearFullScreen=!1,this.vpMatrix=lt(),this.dprMatrix=lt(),this.tmpMat4=lt(),this.vec3a=Ht(),this.vec3b=Ht(),this.vec3c=Ht(),this.vec3d=Ht()}return t.prototype.apply=function(e,n){var r=this;this.context=e;var i=e.config,o=e.camera,a=e.renderingService,s=e.renderingContext,c=e.rBushRoot,l=e.pathGeneratorFactory;this.rBush=c,this.pathGeneratorFactory=l;var u=e.contextService,f=s.root.ownerDocument.defaultView,h=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)},d=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)};a.hooks.init.tap(t.tag,(function(){f.addEventListener(sp.UNMOUNTED,h),f.addEventListener(sp.CULLED,d);var t=u.getDPR(),e=i.width,n=i.height,o=u.getContext();r.clearRect(o,0,0,e*t,n*t,i.background)})),a.hooks.destroy.tap(t.tag,(function(){f.removeEventListener(sp.UNMOUNTED,h),f.removeEventListener(sp.CULLED,d),r.renderQueue=[],r.removedRBushNodeAABBs=[],r.restoreStack=[]})),a.hooks.beginFrame.tap(t.tag,(function(){var t=u.getContext(),e=u.getDPR(),n=i.width,o=i.height,s=r.canvasRendererPluginOptions,c=s.dirtyObjectNumThreshold,l=s.dirtyObjectRatioThreshold,f=a.getStats(),h=f.total,d=f.rendered,p=d/h;r.clearFullScreen=r.clearFullScreenLastFrame||a.disableDirtyRectangleRendering()||d>c&&p>l,t&&(t.resetTransform?t.resetTransform():t.setTransform(1,0,0,1,0,0),r.clearFullScreen&&r.clearRect(t,0,0,n*e,o*e,i.background))}));var p=function(t,e){t.isVisible()&&!t.isCulled()&&r.renderDisplayObject(t,e,r.context,r.restoreStack,n),(t.sortable.sorted||t.childNodes).forEach((function(t){p(t,e)}))};a.hooks.endFrame.tap(t.tag,(function(){if(0!==s.root.childNodes.length){r.clearFullScreenLastFrame=!1;var t=u.getContext(),e=u.getDPR();if(Ot(r.dprMatrix,[e,e,1]),yt(r.vpMatrix,r.dprMatrix,o.getOrthoMatrix()),r.clearFullScreen)p(s.root,t);else{var a=r.safeMergeAABB.apply(r,_e([r.mergeDirtyAABBs(r.renderQueue)],Ae(r.removedRBushNodeAABBs.map((function(t){var e=t.minX,n=t.minY,r=t.maxX,i=t.maxY,o=new Ou;return o.setMinMax([e,n,0],[r,i,0]),o}))),!1));if(r.removedRBushNodeAABBs=[],Ou.isEmpty(a))return void(r.renderQueue=[]);var c=r.convertAABB2Rect(a),l=c.x,h=c.y,d=c.width,g=c.height,m=re(r.vec3a,[l,h,0],r.vpMatrix),y=re(r.vec3b,[l+d,h,0],r.vpMatrix),v=re(r.vec3c,[l,h+g,0],r.vpMatrix),b=re(r.vec3d,[l+d,h+g,0],r.vpMatrix),x=Math.min(m[0],y[0],b[0],v[0]),w=Math.min(m[1],y[1],b[1],v[1]),M=Math.max(m[0],y[0],b[0],v[0]),O=Math.max(m[1],y[1],b[1],v[1]),E=Math.floor(x),k=Math.floor(w),S=Math.ceil(M-x),A=Math.ceil(O-w);t.save(),r.clearRect(t,E,k,S,A,i.background),t.beginPath(),t.rect(E,k,S,A),t.clip(),t.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]),i.renderer.getConfig().enableDirtyRectangleRenderingDebug&&f.dispatchEvent(new np(Np.DIRTY_RECTANGLE,{dirtyRect:{x:E,y:k,width:S,height:A}})),r.searchDirtyObjects(a).sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t,r.context,r.restoreStack,n)})),t.restore(),r.renderQueue.forEach((function(t){r.saveDirtyAABB(t)})),r.renderQueue=[]}r.restoreStack.forEach((function(){t.restore()})),r.restoreStack=[]}else r.clearFullScreenLastFrame=!0})),a.hooks.render.tap(t.tag,(function(t){r.clearFullScreen||r.renderQueue.push(t)}))},t.prototype.clearRect=function(t,e,n,r,i,o){t.clearRect(e,n,r,i),o&&(t.fillStyle=o,t.fillRect(e,n,r,i))},t.prototype.renderDisplayObject=function(t,e,n,r,i){var o=t.nodeName,a=r[r.length-1];!a||t.compareDocumentPosition(a)&ip.DOCUMENT_POSITION_CONTAINS||(e.restore(),r.pop());var s=this.context.styleRendererFactory[o],c=this.pathGeneratorFactory[o],l=t.parsedStyle.clipPath;if(l){this.applyWorldTransform(e,l);var u=this.pathGeneratorFactory[l.nodeName];u&&(e.save(),r.push(t),e.beginPath(),u(e,l.parsedStyle),e.closePath(),e.clip())}s&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),c&&(e.beginPath(),c(e,t.parsedStyle),t.nodeName!==tu.LINE&&t.nodeName!==tu.PATH&&t.nodeName!==tu.POLYLINE&&e.closePath()),s&&(s.render(e,t.parsedStyle,t,n,this,i),e.restore()),t.renderable.dirty=!1},t.prototype.convertAABB2Rect=function(t){var e=t.getMin(),n=t.getMax(),r=Math.floor(e[0]),i=Math.floor(e[1]);return{x:r,y:i,width:Math.ceil(n[0])-r,height:Math.ceil(n[1])-i}},t.prototype.mergeDirtyAABBs=function(t){var e=new Ou;return t.forEach((function(t){var n=t.getRenderBounds();e.add(n);var r=t.renderable.dirtyRenderBounds;r&&e.add(r)})),e},t.prototype.searchDirtyObjects=function(t){var e=Ae(t.getMin(),2),n=e[0],r=e[1],i=Ae(t.getMax(),2),o=i[0],a=i[1];return this.rBush.search({minX:n,minY:r,maxX:o,maxY:a}).map((function(t){return t.displayObject}))},t.prototype.saveDirtyAABB=function(t){var e=t.renderable;e.dirtyRenderBounds||(e.dirtyRenderBounds=new Ou);var n=t.getRenderBounds();n&&e.dirtyRenderBounds.update(n.center,n.halfExtents)},t.prototype.applyAttributesToContext=function(t,e){var n=e.parsedStyle,r=n.stroke,i=n.fill,o=n.opacity,a=n.lineDash,s=n.lineDashOffset;a&&t.setLineDash(a),y(s)||(t.lineDashOffset=s),y(o)||(t.globalAlpha*=o),y(r)||Array.isArray(r)||r.isNone||(t.strokeStyle=e.attributes.stroke),y(i)||Array.isArray(i)||i.isNone||(t.fillStyle=e.attributes.fill)},t.prototype.applyWorldTransform=function(t,e,n){n?(ft(this.tmpMat4,e.getLocalTransform()),yt(this.tmpMat4,n,this.tmpMat4),yt(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(ft(this.tmpMat4,e.getWorldTransform()),yt(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])},t.prototype.safeMergeAABB=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=new Ou;return t.forEach((function(t){n.add(t)})),n},t.tag="CanvasRenderer",t}(),nA=function(){function t(t){this.imagePool=t}return t.prototype.render=function(t,e,n,r,i,o){var a=e.fill,s=e.fillRule,c=e.opacity,l=void 0===c?1:c,u=e.fillOpacity,f=void 0===u?1:u,h=e.stroke,d=e.strokeOpacity,p=void 0===d?1:d,g=e.lineWidth,m=void 0===g?1:g,v=e.lineCap,b=e.lineJoin,x=e.shadowType,w=e.shadowColor,M=e.shadowBlur,O=e.filter,E=e.miterLimit,k=!y(a)&&!a.isNone,S=!y(h)&&!h.isNone&&m>0,A=0===(null==a?void 0:a.alpha),_=!(!O||!O.length),T=!y(w)&&M>0,P=n.nodeName,C="inner"===x,N=S&&T&&(P===tu.PATH||P===tu.LINE||P===tu.POLYLINE||A||C);k&&(t.globalAlpha=l*f,N||rA(n,t,T),this.fill(t,n,a,s,r,i,o),N||this.clearShadowAndFilter(t,_,T)),S&&(t.globalAlpha=l*p,t.lineWidth=m,y(E)||(t.miterLimit=E),y(v)||(t.lineCap=v),y(b)||(t.lineJoin=b),N&&(C&&(t.globalCompositeOperation="source-atop"),rA(n,t,!0),C&&(this.stroke(t,n,h,r,i,o),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,_,!0))),this.stroke(t,n,h,r,i,o))},t.prototype.clearShadowAndFilter=function(t,e,n){if(n&&(t.shadowColor="transparent",t.shadowBlur=0),e){var r=t.filter;!y(r)&&r.indexOf("drop-shadow")>-1&&(t.filter=r.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}},t.prototype.fill=function(t,e,n,r,i,o,a){var s=this;Array.isArray(n)?n.forEach((function(n){t.fillStyle=s.getColor(n,e,t),r?t.fill(r):t.fill()})):(Lf(n)&&(t.fillStyle=this.getPattern(n,e,t,i,o,a)),r?t.fill(r):t.fill())},t.prototype.stroke=function(t,e,n,r,i,o){var a=this;Array.isArray(n)?n.forEach((function(n){t.strokeStyle=a.getColor(n,e,t),t.stroke()})):(Lf(n)&&(t.strokeStyle=this.getPattern(n,e,t,r,i,o)),t.stroke())},t.prototype.getPattern=function(t,e,n,r,i,o){var a,s;if("rect"===t.image.nodeName){var c=t.image.parsedStyle,l=c.width,u=c.height;s=r.contextService.getDPR();var f=r.config.offscreenCanvas;(a=o.offscreenCanvasCreator.getOrCreateCanvas(f)).width=l*s,a.height=u*s;var h=o.offscreenCanvasCreator.getOrCreateContext(f),d=[];t.image.forEach((function(t){i.renderDisplayObject(t,h,r,d,o)})),d.forEach((function(){h.restore()}))}return this.imagePool.getOrCreatePatternSync(t,n,a,s,e.getGeometryBounds().min,(function(){e.renderable.dirty=!0,r.renderingService.dirtify()}))},t.prototype.getColor=function(t,e,n){var r;if(t.type===Hu.LinearGradient||t.type===Hu.RadialGradient){var i=e.getGeometryBounds(),o=i&&2*i.halfExtents[0]||1,a=i&&2*i.halfExtents[1]||1,s=i&&i.min||[0,0];r=this.imagePool.getOrCreateGradient(we(we({type:t.type},t.value),{min:s,width:o,height:a}),n)}return r},t}();function rA(t,e,n){var r=t.parsedStyle,i=r.filter,o=r.shadowColor,a=r.shadowBlur,s=r.shadowOffsetX,c=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=o.toString(),e.shadowBlur=a||0,e.shadowOffsetX=s||0,e.shadowOffsetY=c||0)}var iA=function(){function t(t){this.imagePool=t}return t.prototype.render=function(t,e,n){var r,i=e.x,o=void 0===i?0:i,a=e.y,s=void 0===a?0:a,c=e.width,l=e.height,u=e.src,f=e.shadowColor,h=e.shadowBlur,d=c,p=l;if(P(u)?r=this.imagePool.getImageSync(u):(d||(d=u.width),p||(p=u.height),r=u),r){rA(n,t,!y(f)&&h>0);try{t.drawImage(r,o,s,d,p)}catch(t){}}},t}(),oA=function(){function t(){}return t.prototype.render=function(t,e,n,r,i,o){n.getBounds();var a=e,s=a.lineWidth,c=void 0===s?1:s,l=a.textAlign,u=void 0===l?"start":l,f=a.textBaseline,h=void 0===f?"alphabetic":f,d=a.lineJoin,p=void 0===d?"miter":d,g=a.miterLimit,m=void 0===g?10:g,v=a.letterSpacing,b=void 0===v?0:v,x=a.stroke,w=a.fill,M=a.fillOpacity,O=void 0===M?1:M,E=a.strokeOpacity,k=void 0===E?1:E,S=a.opacity,A=void 0===S?1:S,_=a.metrics,T=a.x,P=void 0===T?0:T,C=a.y,N=void 0===C?0:C,L=a.dx,j=a.dy,R=a.shadowColor,I=a.shadowBlur,B=_.font,D=_.lines,F=_.height,z=_.lineHeight,G=_.lineMetrics;t.font=B,t.lineWidth=c,t.textAlign="middle"===u?"center":u;var W=h;o.enableCSSParsing||"alphabetic"!==W||(W="bottom"),t.lineJoin=p,y(m)||(t.miterLimit=m);var $=N;"middle"===h?$+=-F/2-z/2:"bottom"===h||"alphabetic"===h||"ideographic"===h?$+=-F:"top"!==h&&"hanging"!==h||($+=-z);var H=P+(L||0);$+=j||0,1===D.length&&("bottom"===W?(W="middle",$-=.5*F):"top"===W&&(W="middle",$+=.5*F)),t.textBaseline=W,rA(n,t,!y(R)&&I>0);for(var V=0;V<D.length;V++){var Y=c/2+H;$+=z,y(x)||x.isNone||!c||this.drawLetterSpacing(t,D[V],G[V],u,Y,$,b,O,k,A,!0),y(w)||this.drawLetterSpacing(t,D[V],G[V],u,Y,$,b,O,k,A)}},t.prototype.drawLetterSpacing=function(t,e,n,r,i,o,a,s,c,l,u){if(void 0===u&&(u=!1),0!==a){var f=t.textAlign;t.textAlign="left";var h=i;"center"===r||"middle"===r?h=i-n.width/2:"right"!==r&&"end"!==r||(h=i-n.width);for(var d=Array.from(e),p=t.measureText(e).width,g=0,m=0;m<d.length;++m){var y=d[m];u?this.strokeText(t,y,h,o,c):this.fillText(t,y,h,o,s,l),h+=p-(g=t.measureText(e.substring(m+1)).width)+a,p=g}t.textAlign=f}else u?this.strokeText(t,e,i,o,c):this.fillText(t,e,i,o,s,l)},t.prototype.fillText=function(t,e,n,r,i,o){var a,s=!y(i)&&1!==i;s&&(a=t.globalAlpha,t.globalAlpha=i*o),t.fillText(e,n,r),s&&(t.globalAlpha=a)},t.prototype.strokeText=function(t,e,n,r,i){var o,a=!y(i)&&1!==i;a&&(o=t.globalAlpha,t.globalAlpha=i),t.strokeText(e,n,r),a&&(t.globalAlpha=o)},t}();!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}xe(e,t)}(nA),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}xe(e,t)}(nA),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}xe(e,t)}(nA),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}xe(e,t)}(nA),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}xe(e,t)}(nA),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}xe(e,t)}(nA),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}xe(e,t)}(nA);var aA=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.options=e,n.name="canvas-renderer",n}return xe(e,t),e.prototype.init=function(){var t,e=we({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,r=new nA(n),i=((t={})[tu.CIRCLE]=r,t[tu.ELLIPSE]=r,t[tu.RECT]=r,t[tu.IMAGE]=new iA(n),t[tu.TEXT]=new oA,t[tu.LINE]=r,t[tu.POLYLINE]=r,t[tu.POLYGON]=r,t[tu.PATH]=r,t[tu.GROUP]=void 0,t[tu.HTML]=void 0,t[tu.MESH]=void 0,t);this.context.defaultStyleRendererFactory=i,this.context.styleRendererFactory=i,this.addRenderingPlugin(new eA(e))},e.prototype.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory},e}(ru),sA=function(){function t(){}return t.prototype.apply=function(e,n){var r=this,i=e.renderingService,o=e.renderingContext,a=e.config;this.context=e;var s=o.root.ownerDocument.defaultView,c=function(t){i.hooks.pointerMove.call(t)},l=function(t){i.hooks.pointerUp.call(t)},u=function(t){i.hooks.pointerDown.call(t)},f=function(t){i.hooks.pointerOver.call(t)},h=function(t){i.hooks.pointerOut.call(t)},d=function(t){i.hooks.pointerCancel.call(t)},p=function(t){i.hooks.pointerWheel.call(t)},g=function(t){i.hooks.click.call(t)};i.hooks.init.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="none",t.style.msTouchAction="none"):s.supportsPointerEvents&&(t.style.touchAction="none"),s.supportsPointerEvents?function(t){n.globalThis.document.addEventListener("pointermove",c,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("pointerleave",h,!0),t.addEventListener("pointerover",f,!0),n.globalThis.addEventListener("pointerup",l,!0),n.globalThis.addEventListener("pointercancel",d,!0)}(t):function(t){n.globalThis.document.addEventListener("mousemove",c,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("mouseout",h,!0),t.addEventListener("mouseover",f,!0),n.globalThis.addEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.addEventListener("touchstart",u,!0),t.addEventListener("touchend",l,!0),t.addEventListener("touchmove",c,!0),t.addEventListener("touchcancel",d,!0)}(t),a.useNativeClickEvent&&t.addEventListener("click",g,!0),t.addEventListener("wheel",p,{passive:!0,capture:!0})})),i.hooks.destroy.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):s.supportsPointerEvents&&(t.style.touchAction=""),s.supportsPointerEvents?function(t){n.globalThis.document.removeEventListener("pointermove",c,!0),t.removeEventListener("pointerdown",u,!0),t.removeEventListener("pointerleave",h,!0),t.removeEventListener("pointerover",f,!0),n.globalThis.removeEventListener("pointerup",l,!0)}(t):function(t){n.globalThis.document.removeEventListener("mousemove",c,!0),t.removeEventListener("mousedown",u,!0),t.removeEventListener("mouseout",h,!0),t.removeEventListener("mouseover",f,!0),n.globalThis.removeEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",u,!0),t.removeEventListener("touchend",l,!0),t.removeEventListener("touchmove",c,!0),t.removeEventListener("touchcancel",d,!0)}(t),a.useNativeClickEvent&&t.removeEventListener("click",g,!0),t.removeEventListener("wheel",p,!0)}))},t.tag="DOMInteraction",t}(),cA=function(t){function e(){var e=t.apply(this,_e([],Ae(arguments),!1))||this;return e.name="dom-interaction",e}return xe(e,t),e.prototype.init=function(){this.addRenderingPlugin(new sA)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(ru),lA=function(){function t(){this.displayObjectHTMLElementMap=new WeakMap}return t.prototype.joinTransformMatrix=function(t){return"matrix(".concat([t[0],t[1],t[4],t[5],t[12],t[13]].join(","),")")},t.prototype.apply=function(e,n){var r=this,i=e.camera,o=e.renderingContext,a=e.renderingService;this.context=e;var s=o.root.ownerDocument.defaultView,c=s.context.eventService.nativeHTMLMap,l=function(t,e){e.style.transform=r.joinTransformMatrix(t.getWorldTransform())},u=function(t){var e=t.target;if(e.nodeName===tu.HTML){r.$camera||(r.$camera=r.createCamera(i));var o=r.getOrCreateEl(e);if(r.$camera.appendChild(o),n.enableCSSParsing){var a=e.ownerDocument.documentElement.attributes;Object.keys(a).forEach((function(t){o.style[t]=a[t]}))}Object.keys(e.attributes).forEach((function(t){r.updateAttribute(t,e)})),l(e,o),c.set(o,e)}},f=function(t){var e=t.target;if(e.nodeName===tu.HTML&&r.$camera){var n=r.getOrCreateEl(e);n&&(n.remove(),c.delete(n))}},h=function(t){var e=t.target;if(e.nodeName===tu.HTML){var n=t.attrName;r.updateAttribute(n,e)}},d=function(t){var e=t.target;if(e.nodeName===tu.HTML){var n=r.getOrCreateEl(e);l(e,n)}},p=function(){if(r.$camera){var t=r.context.config,e=t.width,n=t.height;r.$camera.style.width="".concat(e||0,"px"),r.$camera.style.height="".concat(n||0,"px")}};a.hooks.init.tap(t.tag,(function(){s.addEventListener(Np.RESIZE,p),s.addEventListener(sp.MOUNTED,u),s.addEventListener(sp.UNMOUNTED,f),s.addEventListener(sp.ATTR_MODIFIED,h),s.addEventListener(sp.BOUNDS_CHANGED,d)})),a.hooks.endFrame.tap(t.tag,(function(){r.$camera&&o.renderReasons.has(Zd.CAMERA_CHANGED)&&(r.$camera.style.transform=r.joinTransformMatrix(i.getOrthoMatrix()))})),a.hooks.destroy.tap(t.tag,(function(){r.$camera&&r.$camera.remove(),s.removeEventListener(Np.RESIZE,p),s.removeEventListener(sp.MOUNTED,u),s.removeEventListener(sp.UNMOUNTED,f),s.removeEventListener(sp.ATTR_MODIFIED,h),s.removeEventListener(sp.BOUNDS_CHANGED,d)}))},t.prototype.createCamera=function(t){var e=this.context.config,n=e.document,r=e.width,i=e.height,o=this.context.contextService.getDomElement(),a=o.parentNode;if(a){var s="g-canvas-camera",c=a.querySelector("#"+s);if(!c){var l=(n||document).createElement("div");c=l,l.id=s,l.style.position="absolute",l.style.left="".concat(o.offsetLeft||0,"px"),l.style.top="".concat(o.offsetTop||0,"px"),l.style.transformOrigin="left top",l.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),l.style.overflow="hidden",l.style.pointerEvents="none",l.style.width="".concat(r||0,"px"),l.style.height="".concat(i||0,"px"),a.appendChild(l)}return c}return null},t.prototype.getOrCreateEl=function(t){var e=this.context.config.document,n=this.displayObjectHTMLElementMap.get(t);return n||(n=(e||document).createElement("div"),t.parsedStyle.$el=n,this.displayObjectHTMLElementMap.set(t,n),t.id&&(n.id=t.id),t.name&&n.setAttribute("name",t.name),t.className&&(n.className=t.className),n.style.position="absolute",n.style["will-change"]="transform",n.style.transform=this.joinTransformMatrix(t.getWorldTransform())),n},t.prototype.updateAttribute=function(t,e){var n=this.getOrCreateEl(e);switch(t){case"innerHTML":var r=e.parsedStyle.innerHTML;P(r)?n.innerHTML=r:(n.innerHTML="",n.appendChild(r));break;case"x":n.style.left="".concat(e.parsedStyle.x,"px");break;case"y":n.style.top="".concat(e.parsedStyle.y,"px");break;case"transformOrigin":var i=e.parsedStyle.transformOrigin;n.style["transform-origin"]="".concat(i[0].value," ").concat(i[1].value);break;case"width":if(this.context.enableCSSParsing){var o=e.computedStyleMap().get("width");n.style.width=o.toString()}else{o=e.parsedStyle.width;n.style.width=L(o)?"".concat(o,"px"):o.toString()}break;case"height":if(this.context.enableCSSParsing){var a=e.computedStyleMap().get("height");n.style.height=a.toString()}else{a=e.parsedStyle.height;n.style.height=L(a)?"".concat(a,"px"):a.toString()}break;case"zIndex":var s=e.parsedStyle.zIndex;n.style["z-index"]="".concat(s);break;case"visibility":var c=e.parsedStyle.visibility;n.style.visibility=c;break;case"pointerEvents":var l=e.parsedStyle.pointerEvents,u=void 0===l?"auto":l;n.style.pointerEvents=u;break;case"opacity":var f=e.parsedStyle.opacity;n.style.opacity="".concat(f);break;case"fill":var h=e.parsedStyle.fill,d="";jf(h)?d=h.isNone?"transparent":e.getAttribute("fill"):Array.isArray(h)&&(d=e.getAttribute("fill")),n.style.background=d;break;case"stroke":var p=e.parsedStyle.stroke,g="";jf(p)?g=p.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(p)&&(g=e.getAttribute("stroke")),n.style["border-color"]=g,n.style["border-style"]="solid";break;case"lineWidth":var m=e.parsedStyle.lineWidth;n.style["border-width"]="".concat(m||0,"px");break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":var v=e.style.filter;n.style.filter=v;break;default:y(e.style[t])||""===e.style[t]||(n.style[t]=e.style[t])}},t.tag="HTMLRendering",t}(),uA=function(t){function e(){var e=t.apply(this,_e([],Ae(arguments),!1))||this;return e.name="html-renderer",e}return xe(e,t),e.prototype.init=function(){this.addRenderingPlugin(new lA)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(ru),fA=function(){function t(t){this.canvasConfig=t,this.imageCache={},this.gradientCache={},this.patternCache={}}return t.prototype.getImageSync=function(t,e){return this.imageCache[t]?e&&e(this.imageCache[t]):this.getOrCreateImage(t).then((function(t){e&&e(t)})),this.imageCache[t]},t.prototype.getOrCreateImage=function(t){var e=this;if(this.imageCache[t])return Promise.resolve(this.imageCache[t]);var n=this.canvasConfig.createImage;return new Promise((function(r,i){var o;n?o=n(t):ud&&(o=new window.Image),o&&(o.onload=function(){e.imageCache[t]=o,r(o)},o.onerror=function(t){i(t)},o.crossOrigin="Anonymous",o.src=t)}))},t.prototype.getOrCreatePatternSync=function(t,e,n,r,i,o){var a=this.generatePatternKey(t);if(a&&this.patternCache[a])return this.patternCache[a];var s,c=t.image,l=t.repetition,u=t.transform,f=!1;P(c)?s=this.getImageSync(c,o):n?(s=n,f=!0):s=c;var h=s&&e.createPattern(s,l);if(h){var d=void 0;d=u?Fd(Sh(u),new Fp({})):dt(lt()),f&&bt(d,d,[1/r,1/r,1]),h.setTransform({a:d[0],b:d[1],c:d[4],d:d[5],e:d[12]+i[0],f:d[13]+i[1]})}return a&&h&&(this.patternCache[a]=h),h},t.prototype.getOrCreateGradient=function(t,e){var n=this.generateGradientKey(t),r=t.type,i=t.steps,o=t.min,a=t.width,s=t.height,c=t.angle,l=t.cx,u=t.cy,f=t.size;if(this.gradientCache[n])return this.gradientCache[n];var h=null;if(r===Hu.LinearGradient){var d=function(t,e,n,r){var i=fu(r.value),o=0+e/2,a=0+n/2,s=Math.abs(e*Math.cos(i))+Math.abs(n*Math.sin(i));return{x1:t[0]+o-Math.cos(i)*s/2,y1:t[1]+a-Math.sin(i)*s/2,x2:t[0]+o+Math.cos(i)*s/2,y2:t[1]+a+Math.sin(i)*s/2}}(o,a,s,c),p=d.x1,g=d.y1,m=d.x2,y=d.y2;h=e.createLinearGradient(p,g,m,y)}else if(r===Hu.RadialGradient){var v=function(t,e,n,r,i,o){var a=r.value,s=i.value;r.unit===Lu.kPercentage&&(a=r.value/100*e),i.unit===Lu.kPercentage&&(s=i.value/100*n);var c=Math.max(Je([0,0],[a,s]),Je([0,n],[a,s]),Je([e,n],[a,s]),Je([e,0],[a,s]));return o&&(o instanceof af?c=o.value:o instanceof Zu&&("closest-side"===o.value?c=Math.min(a,e-a,s,n-s):"farthest-side"===o.value?c=Math.max(a,e-a,s,n-s):"closest-corner"===o.value&&(c=Math.min(Je([0,0],[a,s]),Je([0,n],[a,s]),Je([e,n],[a,s]),Je([e,0],[a,s]))))),{x:a+t[0],y:s+t[1],r:c}}(o,a,s,l,u,f),b=v.x,x=v.y,w=v.r;h=e.createRadialGradient(b,x,0,b,x,w)}return h&&(i.forEach((function(t){var e=t.offset,n=t.color;e.unit===Lu.kPercentage&&(null==h||h.addColorStop(e.value/100,n.toString()))})),this.gradientCache[n]=h),this.gradientCache[n]},t.prototype.generateGradientKey=function(t){var e=t.type,n=t.min,r=t.width,i=t.height,o=t.steps,a=t.angle,s=t.cx,c=t.cy,l=t.size;return"gradient-".concat(e,"-").concat((null==a?void 0:a.toString())||0,"-").concat((null==s?void 0:s.toString())||0,"-").concat((null==c?void 0:c.toString())||0,"-").concat((null==l?void 0:l.toString())||0,"-").concat(n[0],"-").concat(n[1],"-").concat(r,"-").concat(i,"-").concat(o.map((function(t){var e=t.offset,n=t.color;return"".concat(e).concat(n)})).join("-"))},t.prototype.generatePatternKey=function(t){var e=t.image,n=t.repetition;return P(e)?"pattern-".concat(e,"-").concat(n):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(n):void 0},t}(),hA=function(){function t(){}return t.prototype.apply=function(e){var n=e.renderingService,r=e.renderingContext,i=e.imagePool,o=r.root.ownerDocument.defaultView,a=function(t,e,n){var r=t.parsedStyle,i=r.width,o=r.height;i&&!o?t.setAttribute("height",n/e*i):!i&&o&&t.setAttribute("width",e/n*o)},s=function(t){var e=t.target,r=e.nodeName,o=e.attributes;if(r===tu.IMAGE){var s=o.src,c=o.keepAspectRatio;P(s)&&i.getImageSync(s,(function(t){var r=t.width,i=t.height;c&&a(e,r,i),e.renderable.dirty=!0,n.dirtify()}))}},c=function(t){var e=t.target,r=t.attrName,o=t.newValue;e.nodeName===tu.IMAGE&&"src"===r&&P(o)&&i.getOrCreateImage(o).then((function(t){var r=t.width,i=t.height;e.attributes.keepAspectRatio&&a(e,r,i),e.renderable.dirty=!0,n.dirtify()}))};n.hooks.init.tap(t.tag,(function(){o.addEventListener(sp.MOUNTED,s),o.addEventListener(sp.ATTR_MODIFIED,c)})),n.hooks.destroy.tap(t.tag,(function(){o.removeEventListener(sp.MOUNTED,s),o.removeEventListener(sp.ATTR_MODIFIED,c)}))},t.tag="LoadImage",t}(),dA=function(t){function e(){var e=t.apply(this,_e([],Ae(arguments),!1))||this;return e.name="image-loader",e}return xe(e,t),e.prototype.init=function(){this.context.imagePool=new fA(this.context.config),this.addRenderingPlugin(new hA)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(ru),pA=function(){function t(t){this.renderingContext=t.renderingContext,this.canvasConfig=t.config}return t.prototype.init=function(){var t=this.canvasConfig,e=t.container,n=t.canvas;if(n)this.$canvas=n,e&&n.parentElement!==e&&e.appendChild(n),this.$container=n.parentElement,this.canvasConfig.container=this.$container;else if(e&&(this.$container=P(e)?document.getElementById(e):e,this.$container)){var r=document.createElement("canvas");this.$container.appendChild(r),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=r}this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)},t.prototype.getContext=function(){return this.context},t.prototype.getDomElement=function(){return this.$canvas},t.prototype.getDPR=function(){return this.dpr},t.prototype.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},t.prototype.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},t.prototype.resize=function(t,e){var n=this.canvasConfig.devicePixelRatio||ud&&window.devicePixelRatio||1;n=n>=1?Math.ceil(n):1,this.dpr=n,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*e,function(t,e,n){ud&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")}(this.$canvas,t,e)),this.renderingContext.renderReasons.add(Zd.CAMERA_CHANGED)},t.prototype.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},t.prototype.toDataURL=function(t){return void 0===t&&(t={}),Ee(this,void 0,void 0,(function(){var e,n;return ke(this,(function(r){return e=t.type,n=t.encoderOptions,[2,this.context.canvas.toDataURL(e,n)]}))}))},t}(),gA=function(t){function e(){var e=t.apply(this,_e([],Ae(arguments),!1))||this;return e.name="canvas-context-register",e}return xe(e,t),e.prototype.init=function(){this.context.ContextService=pA},e.prototype.destroy=function(){delete this.context.ContextService},e}(ru),mA=function(t){function e(e){var n=t.call(this,e)||this;return n.registerPlugin(new gA),n.registerPlugin(new dA),n.registerPlugin(new PS),n.registerPlugin(new aA),n.registerPlugin(new cA),n.registerPlugin(new tA),n.registerPlugin(new uA),n}return xe(e,t),e}(iu),yA=function(){function t(t){this.dragndropPluginOptions=t}return t.prototype.apply=function(e){var n=this,r=e.renderingService,i=e.renderingContext.root.ownerDocument,o=i.defaultView,a=function(t){var e=t.target,r=e===i,a=r&&n.dragndropPluginOptions.isDocumentDraggable?i:e.closest&&e.closest("[draggable=true]");if(a){var s=!1,c=t.timeStamp,l=[t.clientX,t.clientY],u=null,f=[t.clientX,t.clientY],h=function(t){return Ee(n,void 0,void 0,(function(){var n,o,h,d,p,g;return ke(this,(function(m){switch(m.label){case 0:if(!s){if(n=t.timeStamp-c,o=Je([t.clientX,t.clientY],l),n<=this.dragndropPluginOptions.dragstartTimeThreshold||o<=this.dragndropPluginOptions.dragstartDistanceThreshold)return[2];t.type="dragstart",a.dispatchEvent(t),s=!0}return t.type="drag",t.dx=t.clientX-f[0],t.dy=t.clientY-f[1],a.dispatchEvent(t),f=[t.clientX,t.clientY],r?[3,2]:(h="pointer"===this.dragndropPluginOptions.overlap?[t.canvasX,t.canvasY]:e.getBounds().center,[4,i.elementsFromPoint(h[0],h[1])]);case 1:d=m.sent(),p=d[d.indexOf(e)+1],g=(null==p?void 0:p.closest("[droppable=true]"))||(this.dragndropPluginOptions.isDocumentDroppable?i:null),u!==g&&(u&&(t.type="dragleave",t.target=u,u.dispatchEvent(t)),g&&(t.type="dragenter",t.target=g,g.dispatchEvent(t)),(u=g)&&(t.type="dragover",t.target=u,u.dispatchEvent(t))),m.label=2;case 2:return[2]}}))}))};o.addEventListener("pointermove",h);var d=function(t){if(s){t.detail={preventClick:!0};var e=t.clone();u&&(e.type="drop",e.target=u,u.dispatchEvent(e)),e.type="dragend",a.dispatchEvent(e),s=!1}o.removeEventListener("pointermove",h)};e.addEventListener("pointerup",d,{once:!0}),e.addEventListener("pointerupoutside",d,{once:!0})}};r.hooks.init.tap(t.tag,(function(){o.addEventListener("pointerdown",a)})),r.hooks.destroy.tap(t.tag,(function(){o.removeEventListener("pointerdown",a)}))},t.tag="Dragndrop",t}(),vA=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.options=e,n.name="dragndrop",n}return xe(e,t),e.prototype.init=function(){this.addRenderingPlugin(new yA(we({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e.prototype.setOptions=function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)},e}(ru),bA=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}(),xA=bA;const wA={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"},MA=[["legendCategory",[[["color","discrete"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","discrete"]],[["color","discrete"],["opacity","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"]],[["color","discrete"],["opacity","constant"],["size","constant"]],[["color","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"]],[["color","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["shape","discrete"]],[["color","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"]],[["color","discrete"],["opacity","constant"]],[["color","discrete"],["shape","constant"]],[["color","constant"],["shape","discrete"]],[["color","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"]],[["color","discrete"]]]],["legendContinuousSize",[[["color","continuous"],["opacity","continuous"],["size","continuous"]],[["color","constant"],["opacity","continuous"],["size","continuous"]],[["color","continuous"],["size","continuous"]],[["color","constant"],["size","continuous"]],[["size","continuous"],["opacity","continuous"]],[["size","continuous"]]]],["legendContinuousBlockSize",[[["color","distribution"],["opacity","distribution"],["size","distribution"]],[["color","distribution"],["size","distribution"]]]],["legendContinuousBlock",[[["color","distribution"],["opacity","continuous"]],[["color","distribution"]]]],["legendContinuous",[[["color","continuous"],["opacity","continuous"]],[["color","continuous"]],[["opacity","continuous"]]]]];function OA(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):fo}function EA(t){return t instanceof Float32Array||t instanceof Array}var kA=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},SA=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function AA(t,e,n){for(;t<e;)t+=2*Math.PI;for(;t>n;)t-=2*Math.PI;return t}var _A=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},TA=function(t,e,n,r,i){var o,a,s=_A(t,2),c=s[0],l=s[1],u=st();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},PA=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},CA=function(t,e,n,r,i){var o=new pa({range:[e,e+r]}),a=new pa({range:[n,n+i]});return{transform:function(t){var e=PA(t,2),n=e[0],r=e[1];return[o.map(n),a.map(r)]},untransform:function(t){var e=PA(t,2),n=e[0],r=e[1];return[o.invert(n),a.invert(r)]}}},NA=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},LA=function(t,e,n,r,i){return(0,NA(t,1)[0])(e,n,r,i)},jA=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},RA=function(t,e,n,r,i){return jA(t,1)[0]},IA=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},BA=function(t,e,n,r,i){var o=IA(t,4),a=o[0],s=o[1],c=o[2],l=o[3],u=new pa({range:[c,l]}),f=new pa({range:[a,s]}),h=i/r,d=h>1?1:h,p=h>1?1/h:1;return{transform:function(t){var e=IA(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=IA(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=AA(Math.atan2(o,i),a,s);return[f.invert(l),u.invert(c)]}}},DA=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},FA=function(t,e,n,r,i){return{transform:function(t){var e=DA(t,2),n=e[0];return[e[1],n]},untransform:function(t){var e=DA(t,2),n=e[0];return[e[1],n]}}},zA=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},GA=function(t,e,n,r,i){var o,a,s=zA(t,2),c=s[0],l=s[1],u=st();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},WA=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},$A=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))},HA=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return GA.apply(void 0,$A([[-1,-1]],WA(e),!1))},VA=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return GA.apply(void 0,$A([[-1,1]],WA(e),!1))},YA=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return GA.apply(void 0,$A([[1,-1]],WA(e),!1))},UA=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},qA=function(t,e,n,r,i){var o=UA(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}(st(),o)},XA=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},KA=function(t,e,n,r,i){var o=XA(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 pa({range:[c,c+.99*l]}),h=new pa({range:[a,s]}),d=i/r,p=d>1?1:d,g=d>1?1/d:1;return{transform:function(t){var e=XA(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=XA(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=AA(Math.atan2(o,i)+Math.floor(c/l)*Math.PI*2,a,s),m=c-u*d;return[h.invert(d),f.invert(m)]}}},ZA=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},QA=function(t,e,n,r,i){var o=ZA(t,4),a=o[0],s=o[1],c=o[2],l=o[3],u=new pa({range:[c,l]});return{transform:function(t){for(var e=[],n=t.length,r=new ga({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}}},JA=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};function t_(t){return 1/Math.tan(t)}var e_=function(t,e,n,r,i){var o=t_(JA(t,1)[0]);return{transform:function(t){var e=JA(t,2),n=e[0],r=e[1];return[n+r*o,r]},untransform:function(t){var e=JA(t,2),n=e[0],r=e[1];return[n-r*o,r]}}},n_=function(t,e,n,r,i){var o=t_(JA(t,1)[0]);return{transform:function(t){var e=JA(t,2),n=e[0];return[n,e[1]+n*o]},untransform:function(t){var e=JA(t,2),n=e[0];return[n,e[1]-n*o]}}},r_=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};function i_(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 o_(t,e,n,r,i){var o=t<e,a=(o?e-r:i-e)||i-r;return a/(a*(n+1)/(t-e)-n*(o?-1:1))+e}function a_(t,e,n){return n?new pa({range:[0,1],domain:[0,e]}).map(t):t}var s_=function(t,e,n,r,i){var o=r_(t,3),a=o[0],s=o[1],c=o[2],l=a_(a,r,void 0!==c&&c);return{transform:function(t){var e=r_(t,2),n=e[0],r=e[1];return[i_(n,l,s,0,1),r]},untransform:function(t){var e=r_(t,2),n=e[0],r=e[1];return[o_(n,l,s,0,1),r]}}},c_=function(t,e,n,r,i){var o=r_(t,3),a=o[0],s=o[1],c=o[2],l=a_(a,i,void 0!==c&&c);return{transform:function(t){var e=r_(t,2);return[e[0],i_(e[1],l,s,0,1)]},untransform:function(t){var e=r_(t,2);return[e[0],o_(e[1],l,s,0,1)]}}},l_=function(t,e,n,r,i){var o=r_(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,h=a_(a,r,f),d=a_(s,i,f);return{transform:function(t){var e=r_(t,2),n=e[0],r=e[1];return[i_(n,h,c,0,1),i_(r,d,l,0,1)]},untransform:function(t){var e=r_(t,2),n=e[0],r=e[1];return[o_(n,h,c,0,1),o_(r,d,l,0,1)]}}},u_=function(t,e,n,r,i){var o=r_(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,h=new pa({range:[0,r]}),d=new pa({range:[0,i]}),p=f?a:h.map(a),g=f?s:d.map(s);return{transform:function(t){var e=r_(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=i_(a,0,l,0,c),u=Math.atan2(o,i),f=p+s*Math.cos(u),m=g+s*Math.sin(u);return[h.invert(f),d.invert(m)]},untransform:function(t){var e=r_(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=o_(a,0,l,0,c),u=Math.atan2(o,i),f=p+s*Math.cos(u),m=g+s*Math.sin(u);return[h.invert(f),d.invert(m)]}}},f_=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},h_=function(t,e,n,r,i,o,a){var s=new pa({range:[e,e+i]}),c=new pa({range:[n,n+o]}),l=new pa({range:[r,r+a]});return{transform:function(t){var e=f_(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=f_(t,3),n=e[0],r=e[1],i=e[2];return[s.invert(n),c.invert(r),l.invert(i)]}}},d_=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},p_=function(t,e,n,r,i,o,a){var s=d_(t,3),c=s[0],l=s[1],u=s[2];return Mt(lt(),[c,l,u])},g_=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},m_=function(t,e,n,r,i,o,a){return{transform:function(t){var e=g_(t,3),n=e[0];return[e[1],n,e[2]]},untransform:function(t){var e=g_(t,3),n=e[0];return[e[1],n,e[2]]}}},y_=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},v_=function(t,e,n,r,i,o,a){var s=y_(t,3),c=s[0],l=s[1],u=s[2];return Ot(lt(),[c,l,u])},b_=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},x_=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))},w_=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.")},M_=function(){function t(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:CA,translate:TA,custom:LA,matrix:RA,polar:BA,transpose:FA,scale:GA,"shear.x":e_,"shear.y":n_,reflect:HA,"reflect.x":VA,"reflect.y":YA,rotate:qA,helix:KA,parallel:QA,fisheye:l_,"fisheye.x":s_,"fisheye.y":c_,"fisheye.circular":u_},this.update(t)}return t.prototype.update=function(t){this.options=lo({},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:x_(x_([],b_(n),!1),[x_([],b_(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?x_([],b_(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,SA([],kA(o),!1))}return n}}(t):t)};try{for(var c=w_(r),l=c.next();!l.done;l=c.next()){var u=b_(l.value),f=u[0],h=u.slice(1),d=this.transformers[f];if(d){var p=this.options,g=p.x,m=p.y,y=p.width,v=p.height,b=d(x_([],b_(h),!1),g,m,y,v);if(EA(b))o.push(b);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(b)||fo,"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 OA.apply(void 0,x_([],b_(a),!1))},t.prototype.createMatrixTransform=function(t,e){var n,r,i=st();return e&&t.reverse(),t.forEach((function(t){return ct(i,i,t)})),e&&function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=u*a-s*l,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)}(i,(n=i,(r=new at(9))[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=n[3],r[4]=n[4],r[5]=n[5],r[6]=n[6],r[7]=n[7],r[8]=n[8],r)),function(t){var e=[t[0],t[1],1];return ie(e,e,i),[e[0],e[1]]}},t}(),O_=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},E_=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))},k_=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.")},S_=function(){function t(t){this.options={x:0,y:0,z:0,width:300,height:150,depth:150,transformations:[]},this.transformers={cartesian3D:h_,translate3D:p_,scale3D:v_,transpose3D:m_},this.update(t)}return t.prototype.update=function(t){this.options=lo({},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:E_(E_([],O_(n),!1),[E_([],O_(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?E_([],O_(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,SA([],kA(o),!1))}return n}}(t):t)};try{for(var c=k_(r),l=c.next();!l.done;l=c.next()){var u=O_(l.value),f=u[0],h=u.slice(1),d=this.transformers[f];if(d){var p=this.options,g=p.x,m=p.y,y=p.z,v=p.width,b=p.height,x=p.depth,w=d(E_([],O_(h),!1),g,m,y,v,b,x);if(EA(w))o.push(w);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(w)||fo,!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 OA.apply(void 0,E_([],O_(a),!1))},t.prototype.createMatrixTransform=function(t,e){var n=lt();return e&&t.reverse(),t.forEach((function(t){return Gt(n,n,t)})),e&>(n,ut(n)),function(t){var e=[t[0],t[1],t[2],1];return le(e,e,n),[e[0],e[1],e[2]]}},t}();function A_(t){return(e,...n)=>X({},t(e,...n),e)}function __(t){return(e,...n)=>X({},e,t(e,...n))}function T_(t,e){if(!t)return e;if(Array.isArray(t))return t;const{value:n=e}=t,r=Me(t,["value"]);return Object.assign(Object.assign({},r),{value:n})}const P_=()=>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=Me(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},f),{data:T_(e,a),x:null!=s?s:n,y:null!=c?c:r,width:null!=l?l:i,height:null!=u?u:o})}))};P_.props={};const C_=()=>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=Me(r,["data"]),g=T_(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};C_.props={};const N_=()=>t=>{const{children:e}=t,n=Me(t,["children"]);if(!Array.isArray(e))return[];const{data:r,scale:i={},axis:o={},legend:a={},encode:s={},transform:c=[]}=n,l=Me(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=Me(t,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:T_(e,r),scale:X({},i,n),encode:X({},s,f),transform:[...c,...h],axis:!(!l||!o)&&X({},o,l),legend:!(!u||!a)&&X({},a,u)},d)}));return[Object.assign(Object.assign({},l),{marks:u,type:"standardView"})]};N_.props={};const L_=({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:m,marginBottom:y,marginTop:v,marginRight:b,data:x,coordinate:w,theme:M,component:O,interaction:E,x:k,y:S,z:A,key:_,frame:T,labelTransform:P,parentKey:C,clip:N,viewStyle:L,title:j}=e,R=Me(e,["width","height","depth","paddingLeft","paddingRight","paddingTop","paddingBottom","padding","inset","insetLeft","insetTop","insetRight","insetBottom","margin","marginLeft","marginBottom","marginTop","marginRight","data","coordinate","theme","component","interaction","x","y","z","key","frame","labelTransform","parentKey","clip","viewStyle","title"]);return[Object.assign(Object.assign({type:"standardView",x:k,y:S,z:A,key:_,width:n,height:r,depth:i,padding:l,paddingLeft:o,paddingRight:a,paddingTop:s,inset:u,insetLeft:f,insetTop:h,insetRight:d,insetBottom:p,paddingBottom:c,theme:M,coordinate:w,component:O,interaction:E,frame:T,labelTransform:P,margin:g,marginLeft:m,marginBottom:y,marginTop:v,marginRight:b,parentKey:C,clip:N,style:L},!t&&{title:j}),{marks:[Object.assign(Object.assign(Object.assign({},R),{key:`${_}-0`,data:x}),t&&{title:j})]})]};L_.props={};class j_{constructor(t){this.$value=t}static of(t){return new j_(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const R_=A_((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=zn(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"))}}})),I_=A_((t=>{const{data:e,scale:n}=t,r=[t];let i,o,a;for(;r.length;){const t=r.shift(),{children:e,encode:n={},scale:s={},legend:c={}}=t,{color:l}=n,{color:u}=s,{color:f}=c;void 0!==l&&(i=l),void 0!==u&&(o=u),void 0!==f&&(a=f),Array.isArray(e)&&r.push(...e)}const s="string"==typeof i?i:"",[c,l]=(()=>{var t;const r=null===(t=null==n?void 0:n.color)||void 0===t?void 0:t.domain;if(void 0!==r)return[r];if(void 0===i)return[void 0];const o="function"==typeof i?i:t=>t[i],a=e.map(o);return a.some((t=>"number"==typeof t))?[Rn(a)]:[Array.from(new Set(a)),"ordinal"]})();return{encode:{color:i},scale:{color:X({},o,{domain:c,type:l})},legend:{color:X({title:s},a)}}})),B_=A_((()=>({animate:{enterType:"fadeIn"}}))),D_=__((()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}}))),F_=__((()=>({type:"cell"}))),z_=__((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]}}})),G_=__(((t,e=W_,n=H_,r=V_,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:m}=c,{domain:y}=m;return{children:(t,o,a)=>{const{x:c,y:m}=o,{paddingLeft:v,paddingTop:b,marginLeft:x,marginTop:w}=a,{domain:M}=c.getOptions(),{domain:O}=m.getOptions(),E=_r(t),k=t.map(e),S=t.map((({x:t,y:e})=>[c.invert(t),m.invert(e)])),A=S.map((([t,e])=>n=>{const{[p]:r,[g]:i}=n;return(void 0===p||r===t)&&(void 0===g||i===e)})),_=A.map((t=>d.filter(t))),T=f?rr(_,(t=>t.length)):void 0,P=S.map((([t,e])=>({columnField:p,columnIndex:M.indexOf(t),columnValue:t,columnValuesLength:M.length,rowField:g,rowIndex:O.indexOf(e),rowValue:e,rowValuesLength:O.length}))),C=P.map((t=>Array.isArray(s)?s:[s(t)].flat(1)));return E.flatMap((t=>{const[e,o,a,s]=k[t],c=P[t],f=_[t];return C[t].map((m=>{var M,O,{scale:E,key:k,facet:S=!0,axis:A={},legend:_={}}=m,P=Me(m,["scale","key","facet","axis","legend"]);const C=(null===(M=null==E?void 0:E.y)||void 0===M?void 0:M.guide)||A.y,N=(null===(O=null==E?void 0:E.x)||void 0===O?void 0:O.guide)||A.x,L={x:{tickCount:p?5:void 0},y:{tickCount:g?5:void 0}},j=S?f:0===f.length?[]:d,R={color:{domain:y}},I={x:Y_(N,n)(c,j),y:Y_(C,r)(c,j)};return Object.assign(Object.assign({key:`${k}-${t}`,data:j,margin:0,x:e+v+l+x,y:o+b+u+w,parentKey:h,width:a,height:s,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!j.length,dataDomain:T,scale:X(L,E,R),axis:X({},A,I),legend:!1},P),i)}))}))}}}));function W_(t){const{points:e}=t;return _s(e)}function $_(t,e){return e.length?X({title:!1,tick:null,label:null},t):X({title:!1,tick:null,label:null,grid:null},t)}function H_(t){return(e,n)=>{const{rowIndex:r,rowValuesLength:i,columnIndex:o,columnValuesLength:a}=e;if(r!==i-1)return $_(t,n);const s=o===a-1&&void 0,c=n.length?void 0:null;return X({title:s,grid:c},t)}}function V_(t){return(e,n)=>{const{rowIndex:r,columnIndex:i}=e;if(0!==i)return $_(t,n);const o=0===r&&void 0,a=n.length?void 0:null;return X({title:o,grid:a},t)}}function Y_(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const U_=()=>t=>[j_.of(t).call(F_).call(I_).call(B_).call(R_).call(D_).call(z_).call(G_).value()];U_.props={};const q_=A_((t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),X_=__((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(),m=_r(t),y=t.map((({points:t})=>_s(t))),v=t.map((({x:t,y:e})=>[c.invert(t),l.invert(e)])),b=v.map((([t,e])=>({columnField:t,columnIndex:p.indexOf(t),columnValue:t,columnValuesLength:p.length,rowField:e,rowIndex:g.indexOf(e),rowValue:e,rowValuesLength:g.length}))),x=b.map((t=>Array.isArray(n)?n:[n(t)].flat(1)));return m.flatMap((t=>{const[n,a,s,c]=y[t],[l,p]=v[t],g=b[t];return x[t].map((m=>{var y,v;const{scale:b,key:x,encode:w,axis:M,interaction:O}=m,E=Me(m,["scale","key","encode","axis","interaction"]),k=null===(y=null==b?void 0:b.y)||void 0===y?void 0:y.guide,S={x:Z_(null===(v=null==b?void 0:b.x)||void 0===v?void 0:v.guide)(g,e),y:Q_(k)(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:X({x:{facet:!1},y:{facet:!1}},b),axis:X({x:{tickCount:5},y:{tickCount:5}},M,S),legend:!1,encode:X({},w,{x:l,y:p}),interaction:X({},O,{legendFilter:!1})},E)}))}))}}})),K_=__((t=>{const{encode:e}=t,n=Me(t,["encode"]),{position:r=[],x:i=r,y:o=[...r].reverse()}=e,a=Me(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 Z_(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{rowIndex:r,rowValuesLength:i}=e;if(r!==i-1)return $_(t,n)}}function Q_(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{columnIndex:r}=e;if(0!==r)return $_(t,n)}}const J_=()=>t=>[j_.of(t).call(F_).call(I_).call(X_).call(K_).call(B_).call(D_).call(q_).value()],tT=A_((t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),eT=A_((t=>({coordinate:{type:"polar"}}))),nT=t=>{const{encode:e}=t,n=Me(t,["encode"]),{position:r}=e;return Object.assign(Object.assign({},n),{encode:{x:r}})};function rT(t){return t=>null}function iT(t){const{points:e}=t,[n,r,i,o]=e,a=Es(n,o),s=Ms(n,o),c=As(s,Ms(r,i)),l=1/Math.sin(c/2),u=a/(1+l),f=u*Math.sqrt(2),[h,d]=i,p=Ss(s)+c/2,g=u*l;return[h+g*Math.sin(p)-f/2,d-g*Math.cos(p)-f/2,f,f]}const oT=()=>t=>[j_.of(t).call(F_).call(nT).call(I_).call(eT).call(z_).call(G_,iT,rT,rT,{frame:!1}).call(B_).call(D_).call(tT).value()];function aT(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 sT=()=>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=X({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]=aT(i,e,a);for(let e=n;e<r;e+=1){const n=Math.abs(e);t!==n&&(yield c[n]),t=n}e++}}};function cT(t,e){const{__data__:n}=t,{markKey:r,index:i,seriesIndex:o}=n,{markState:a}=e,s=Array.from(a.keys()).find((t=>t.key===r));if(s)return o?o.map((t=>s.data[t])):s.data[i]}function lT(t,e){if(e(t))return t;let n=t.parent;for(;n&&!e(n);)n=n.parent;return n}function uT(t,e,n,r=(t=>!0)){return i=>{if(!r(i))return;n.emit(`plot:${t}`,i);const{target:o}=i;if(!o)return;const{className:a}=o;if("plot"===a)return;const s=lT(o,(t=>"element"===t.className));const c=function(t){return lT(t,(t=>"component"===t.className))}(o),l=function(t){return lT(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:cT(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 fT(){return(t,e,n)=>{const{container:r,view:i}=t,o=uT(wA.CLICK,i,n,(t=>1===t.detail)),a=uT(wA.DBLCLICK,i,n,(t=>2===t.detail)),s=uT(wA.POINTER_TAP,i,n),c=uT(wA.POINTER_DOWN,i,n),l=uT(wA.POINTER_UP,i,n),u=uT(wA.POINTER_OVER,i,n),f=uT(wA.POINTER_OUT,i,n),h=uT(wA.POINTER_MOVE,i,n),d=uT(wA.POINTER_ENTER,i,n),p=uT(wA.POINTER_LEAVE,i,n),g=uT(wA.POINTER_UPOUTSIDE,i,n),m=uT(wA.DRAG_START,i,n),y=uT(wA.DRAG,i,n),v=uT(wA.DRAG_END,i,n),b=uT(wA.DRAG_ENTER,i,n),x=uT(wA.DRAG_LEAVE,i,n),w=uT(wA.DRAG_OVER,i,n),M=uT(wA.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",m),r.addEventListener("drag",y),r.addEventListener("dragend",v),r.addEventListener("dragenter",b),r.addEventListener("dragleave",x),r.addEventListener("dragover",w),r.addEventListener("drop",M),()=>{r.removeEventListener("click",o),r.removeEventListener("click",a),r.removeEventListener("pointertap",s),r.removeEventListener("pointerdown",c),r.removeEventListener("pointerup",l),r.removeEventListener("pointerover",u),r.removeEventListener("pointerout",f),r.removeEventListener("pointermove",h),r.removeEventListener("pointerenter",d),r.removeEventListener("pointerleave",p),r.removeEventListener("pointerupoutside",g),r.removeEventListener("dragstart",m),r.removeEventListener("drag",y),r.removeEventListener("dragend",v),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",x),r.removeEventListener("dragover",w),r.removeEventListener("drop",M)}}}function hT(t,e){const n=Object.assign(Object.assign({},{"component.axisRadar":yk,"component.axisLinear":hk,"component.axisArc":dk,"component.legendContinuousBlock":Ak,"component.legendContinuousBlockSize":Tk,"component.legendContinuousSize":_k,"interaction.event":fT,"composition.mark":L_,"composition.view":N_,"shape.label.label":nM}),e),r=e=>{if("string"!=typeof e)return e;const r=`${t}.${e}`;return n[r]||mr(`Unknown Component: ${r}`)};return[(t,e)=>{const{type:n}=t,i=Me(t,["type"]);n||mr("Plot type is required!");const o=r(n);return null==o?void 0:o(i,e)},r]}function dT(t){const{canvas:e,group:n}=t;return(null==e?void 0:e.document)||(null==n?void 0:n.ownerDocument)||mr("Cannot find library document")}function pT(t,e){const{coordinate:n={}}=t,r=Me(t,["coordinate"]),{type:i,transform:o=[]}=n,a=Me(n,["type","transform"]);if(!i)return Object.assign(Object.assign({},r),{coordinates:o});const[,s]=hT("coordinate",e),{transform:c=!1}=s(i).props||{};if(c)throw new Error(`Unknown coordinate: ${i}.`);return Object.assign(Object.assign({},r),{coordinates:[Object.assign({type:i},a),...o]})}function gT(t,e){return t.filter((t=>t.type===e))}function mT(t){return gT(t,"polar").length>0}function yT(t){return gT(t,"transpose").length%2==1}function vT(t){return gT(t,"theta").length>0}function bT(t){return gT(t,"radial").length>0}function xT(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}sT.props={},fT.props={reapplyWhenUpdate:!0};var wT=xT("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),MT=xT("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),OT=xT("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),ET=xT("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),kT=xT("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),ST=xT("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),AT=xT("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),_T=xT("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),TT=xT("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),PT=xT("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function CT(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function NT(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function LT(){}var jT=.7,RT=1/jT,IT="\\s*([+-]?\\d+)\\s*",BT="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",DT="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",FT=/^#([0-9a-f]{3,8})$/,zT=new RegExp(`^rgb\\(${IT},${IT},${IT}\\)$`),GT=new RegExp(`^rgb\\(${DT},${DT},${DT}\\)$`),WT=new RegExp(`^rgba\\(${IT},${IT},${IT},${BT}\\)$`),$T=new RegExp(`^rgba\\(${DT},${DT},${DT},${BT}\\)$`),HT=new RegExp(`^hsl\\(${BT},${DT},${DT}\\)$`),VT=new RegExp(`^hsla\\(${BT},${DT},${DT},${BT}\\)$`),YT={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 UT(){return this.rgb().formatHex()}function qT(){return this.rgb().formatRgb()}function XT(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=FT.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?KT(e):3===n?new tP(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?ZT(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?ZT(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=zT.exec(t))?new tP(e[1],e[2],e[3],1):(e=GT.exec(t))?new tP(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=WT.exec(t))?ZT(e[1],e[2],e[3],e[4]):(e=$T.exec(t))?ZT(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=HT.exec(t))?aP(e[1],e[2]/100,e[3]/100,1):(e=VT.exec(t))?aP(e[1],e[2]/100,e[3]/100,e[4]):YT.hasOwnProperty(t)?KT(YT[t]):"transparent"===t?new tP(NaN,NaN,NaN,0):null}function KT(t){return new tP(t>>16&255,t>>8&255,255&t,1)}function ZT(t,e,n,r){return r<=0&&(t=e=n=NaN),new tP(t,e,n,r)}function QT(t){return t instanceof LT||(t=XT(t)),t?new tP((t=t.rgb()).r,t.g,t.b,t.opacity):new tP}function JT(t,e,n,r){return 1===arguments.length?QT(t):new tP(t,e,n,null==r?1:r)}function tP(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function eP(){return`#${oP(this.r)}${oP(this.g)}${oP(this.b)}`}function nP(){const t=rP(this.opacity);return`${1===t?"rgb(":"rgba("}${iP(this.r)}, ${iP(this.g)}, ${iP(this.b)}${1===t?")":`, ${t})`}`}function rP(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function iP(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function oP(t){return((t=iP(t))<16?"0":"")+t.toString(16)}function aP(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new cP(t,e,n,r)}function sP(t){if(t instanceof cP)return new cP(t.h,t.s,t.l,t.opacity);if(t instanceof LT||(t=XT(t)),!t)return new cP;if(t instanceof cP)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 cP(a,s,c,t.opacity)}function cP(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function lP(t){return(t=(t||0)%360)<0?t+360:t}function uP(t){return Math.max(0,Math.min(1,t||0))}function fP(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}CT(LT,XT,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:UT,formatHex:UT,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return sP(this).formatHsl()},formatRgb:qT,toString:qT}),CT(tP,JT,NT(LT,{brighter(t){return t=null==t?RT:Math.pow(RT,t),new tP(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?jT:Math.pow(jT,t),new tP(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new tP(iP(this.r),iP(this.g),iP(this.b),rP(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:eP,formatHex:eP,formatHex8:function(){return`#${oP(this.r)}${oP(this.g)}${oP(this.b)}${oP(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:nP,toString:nP})),CT(cP,(function(t,e,n,r){return 1===arguments.length?sP(t):new cP(t,e,n,null==r?1:r)}),NT(LT,{brighter(t){return t=null==t?RT:Math.pow(RT,t),new cP(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?jT:Math.pow(jT,t),new cP(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 tP(fP(t>=240?t-240:t+120,i,r),fP(t,i,r),fP(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new cP(lP(this.h),uP(this.s),uP(this.l),rP(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=rP(this.opacity);return`${1===t?"hsl(":"hsla("}${lP(this.h)}, ${100*uP(this.s)}%, ${100*uP(this.l)}%${1===t?")":`, ${t})`}`}}));const hP=Math.PI/180,dP=180/Math.PI;var pP=-.14861,gP=1.78277,mP=-.29227,yP=-.90649,vP=1.97294,bP=vP*yP,xP=vP*gP,wP=gP*mP-yP*pP;function MP(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof OP)return new OP(t.h,t.s,t.l,t.opacity);t instanceof tP||(t=QT(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(wP*r+bP*e-xP*n)/(wP+bP-xP),o=r-i,a=(vP*(n-i)-mP*o)/yP,s=Math.sqrt(a*a+o*o)/(vP*i*(1-i)),c=s?Math.atan2(a,o)*dP-120:NaN;return new OP(c<0?c+360:c,s,i,t.opacity)}(t):new OP(t,e,n,null==r?1:r)}function OP(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}CT(OP,MP,NT(LT,{brighter(t){return t=null==t?RT:Math.pow(RT,t),new OP(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?jT:Math.pow(jT,t),new OP(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*hP,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new tP(255*(e+n*(pP*r+gP*i)),255*(e+n*(mP*r+yP*i)),255*(e+n*(vP*r)),this.opacity)}}));var EP=t=>()=>t;function kP(t,e){return function(n){return t+n*e}}function SP(t){return 1==(t=+t)?AP: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):EP(isNaN(e)?n:e)}}function AP(t,e){var n=e-t;return n?kP(t,n):EP(isNaN(t)?e:t)}!function t(e){var n=SP(e);function r(t,e){var r=n((t=JT(t)).r,(e=JT(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=AP(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 _P,TP=(_P=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=JT(t[e]),i[e]=n.r||0,o[e]=n.g||0,a[e]=n.b||0;return i=_P(i),o=_P(o),a=_P(a),n.opacity=1,function(t){return n.r=i(t),n.g=o(t),n.b=a(t),n+""}});function PP(t){return function e(n){function r(e,r){var i=t((e=MP(e)).h,(r=MP(r)).h),o=AP(e.s,r.s),a=AP(e.l,r.l),s=AP(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)}PP((function(t,e){var n=e-t;return n?kP(t,n>180||n<-180?n-360*Math.round(n/360):n):EP(isNaN(t)?e:t)}));var CP=PP(AP),NP=t=>TP(t[t.length-1]),LP=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(xT),jP=NP(LP),RP=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(xT),IP=NP(RP),BP=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(xT),DP=NP(BP),FP=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(xT),zP=NP(FP),GP=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(xT),WP=NP(GP),$P=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(xT),HP=NP($P),VP=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(xT),YP=NP(VP),UP=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(xT),qP=NP(UP),XP=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(xT),KP=NP(XP),ZP=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(xT),QP=NP(ZP),JP=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(xT),tC=NP(JP),eC=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(xT),nC=NP(eC),rC=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(xT),iC=NP(rC),oC=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(xT),aC=NP(oC),sC=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(xT),cC=NP(sC),lC=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(xT),uC=NP(lC),fC=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(xT),hC=NP(fC),dC=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(xT),pC=NP(dC),gC=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(xT),mC=NP(gC),yC=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(xT),vC=NP(yC),bC=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(xT),xC=NP(bC),wC=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(xT),MC=NP(wC),OC=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(xT),EC=NP(OC),kC=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(xT),SC=NP(kC),AC=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(xT),_C=NP(AC),TC=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(xT),PC=NP(TC),CC=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(xT),NC=NP(CC);var LC=CP(MP(300,.5,0),MP(-240,.5,1)),jC=CP(MP(-100,.75,.35),MP(80,1.5,.8)),RC=CP(MP(260,.75,.35),MP(80,1.5,.8)),IC=MP();var BC=JT(),DC=Math.PI/3,FC=2*Math.PI/3;function zC(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var GC=zC(xT("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),WC=zC(xT("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),$C=zC(xT("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),HC=zC(xT("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),VC=Object.freeze({__proto__:null,schemeCategory10:wT,schemeAccent:MT,schemeDark2:OT,schemePaired:ET,schemePastel1:kT,schemePastel2:ST,schemeSet1:AT,schemeSet2:_T,schemeSet3:TT,schemeTableau10:PT,interpolateBrBG:jP,schemeBrBG:LP,interpolatePRGn:IP,schemePRGn:RP,interpolatePiYG:DP,schemePiYG:BP,interpolatePuOr:zP,schemePuOr:FP,interpolateRdBu:WP,schemeRdBu:GP,interpolateRdGy:HP,schemeRdGy:$P,interpolateRdYlBu:YP,schemeRdYlBu:VP,interpolateRdYlGn:qP,schemeRdYlGn:UP,interpolateSpectral:KP,schemeSpectral:XP,interpolateBuGn:QP,schemeBuGn:ZP,interpolateBuPu:tC,schemeBuPu:JP,interpolateGnBu:nC,schemeGnBu:eC,interpolateOrRd:iC,schemeOrRd:rC,interpolatePuBuGn:aC,schemePuBuGn:oC,interpolatePuBu:cC,schemePuBu:sC,interpolatePuRd:uC,schemePuRd:lC,interpolateRdPu:hC,schemeRdPu:fC,interpolateYlGnBu:pC,schemeYlGnBu:dC,interpolateYlGn:mC,schemeYlGn:gC,interpolateYlOrBr:vC,schemeYlOrBr:yC,interpolateYlOrRd:xC,schemeYlOrRd:bC,interpolateBlues:MC,schemeBlues:wC,interpolateGreens:EC,schemeGreens:OC,interpolateGreys:SC,schemeGreys:kC,interpolatePurples:_C,schemePurples:AC,interpolateReds:PC,schemeReds:TC,interpolateOranges:NC,schemeOranges:CC,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:LC,interpolateRainbow:function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return IC.h=360*t-100,IC.s=1.5-1.5*e,IC.l=.8-.9*e,IC+""},interpolateWarm:jC,interpolateCool:RC,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,BC.r=255*(e=Math.sin(t))*e,BC.g=255*(e=Math.sin(t+DC))*e,BC.b=255*(e=Math.sin(t+FC))*e,BC+""},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:GC,interpolateMagma:WC,interpolateInferno:$C,interpolatePlasma:HC});function YC(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 lN(t,Er)}(e))return"identity";if("string"==typeof o)return"linear";if((i||o||[]).length>2)return rN(t,s);if(void 0!==i)return sN([i])?rN(t,s):cN(e)?"time":iN(t,o,a);return sN(e)?rN(t,s):cN(e)?"time":iN(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 oN(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)vr(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 aN(n);case"quantile":return function(t){return aN(t).sort()}(n);case"sequential":return oN(function(t){let e=1/0,n=-1/0;for(const r of t)for(const t of r)vr(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(JC({type:t}))return function(t,e,n){const r=t.map(Number),i=new pa({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 tN({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=Bo,nice:r=!1,tickCount:i=5}=e;return Object.assign(Object.assign({},e),{interpolate:n,nice:r,tickCount:i})}(0,r);case"band":case"point":return function(t,e,n,r){if(void 0!==r.padding||void 0!==r.paddingInner||void 0!==r.paddingOuter)return Object.assign(Object.assign({},r),{unknown:NaN});const i=function(t,e,n){return"enterDelay"===e||"enterDuration"===e||"size"===e?0:"band"===t?vT(n)?0:.1:"point"===t?.5:0}(t,e,n),{paddingInner:o=i,paddingOuter:a=i}=r;return Object.assign(Object.assign({},r),{paddingInner:o,paddingOuter:a,padding:i,unknown:NaN})}(t,e,i,r);case"sequential":return function(t){const{palette:e="ylGnBu",offset:n}=t,r=G(e),i=VC[`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:eN(s,t,e,n,l,i,o),expectedDomain:c,guide:a,name:t,type:s})}function UC(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 qC(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=rr(i)+1,a=`${e}${o}`;t[a]=r,r.getOptions().key=a}else t[e]=r}return t}function XC(t,e){const[n]=hT("scale",e),{relations:r}=t,[i]=function(t){if(!t||!Array.isArray(t))return[dr,dr];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 KC(t){const e=t.flatMap((t=>Array.from(t.values()))).flatMap((t=>t.channels.map((t=>t.scale))));QC(e,"x"),QC(e,"y")}function ZC(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 QC(t,e){const n=t.filter((({name:t,facet:n=!0})=>n&&t===e)),r=n.flatMap((t=>t.domain)),i=n.every(JC)?Rn(r):n.every(tN)?Array.from(new Set(r)):null;if(null!==i)for(const t of n)t.domain=i}function JC(t){const{type:e}=t;if("string"!=typeof e)return!1;return["linear","log","pow","time"].includes(e)}function tN(t){const{type:e}=t;if("string"!=typeof e)return!1;return["band","point","ordinal"].includes(e)}function eN(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=nN(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?[Tr(e),Pr(e)]:"opacity"===t?[0,1]:"size"===t?[1,10]:[0,1]}(e,t);return[c||s,l||u]}case"band":case"point":return[c||("size"===e?5:0),l||("size"===e?10:1)];case"ordinal":return nN(n,r,i,o,a);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}function nN(t,e,n,r,i){const[o]=hT("palette",i),{category10:a,category20:s}=r,c=function(t){return Array.from(new Set(t))}(t.flat()).length<=a.length?a:s,{palette:l=c,offset:u}=e;if(Array.isArray(l))return l;try{return o({type:l})}catch(t){const e=function(t,e,n=(t=>t)){if(!t)return null;const r=G(t),i=VC[`scheme${r}`],o=VC[`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 rN(t,e){return e||(function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")}(t)?"point":"ordinal")}function iN(t,e,n){return n||("color"!==t||e?"linear":"sequential")}function oN(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 aN(t){return Array.from(new Set(t.flat()))}function sN(t){return lN(t,(t=>{const e=typeof t;return"string"===e||"boolean"===e}))}function cN(t){return lN(t,(t=>t instanceof Date))}function lN(t,e){for(const n of t)if(n.some(e))return!0;return!1}const uN={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},fN={threshold:"threshold",quantize:"quantize",quantile:"quantile"},hN={ordinal:"ordinal",band:"band",point:"point"},dN={constant:"constant"};function pN(t,e,n){const{coordinates:r=[],title:i}=e,[,o]=hT("component",n),a=t.filter((({guide:t})=>null!==t)),s=[],c=function(t,e,n){const[,r]=hT("component",n),{coordinates:i}=t;function o(t,e,n,o){const a=function(t,e,n=[]){return"x"===t?yT(n)?`${e}Y`:`${e}X`:"y"===t?yT(n)?`${e}X`:`${e}Y`:null}(e,t,i);if(!o||!a)return;const{props:s}=r(a),{defaultPosition:c,defaultSize:l,defaultOrder:u,defaultCrossPadding:[f]}=s;return Object.assign(Object.assign({position:c,defaultSize:l,order:u,type:a,crossPadding:f},o),{scales:[n]})}return e.filter((t=>t.slider||t.scrollbar)).flatMap((t=>{const{slider:e,scrollbar:n,name:r}=t;return[o("slider",r,t,e),o("scrollbar",r,t,n)]})).filter((t=>!!t))}(e,t,n);if(s.push(...c),i){const{props:t}=o("title"),{defaultPosition:e,defaultOrientation:n,defaultOrder:r,defaultSize:a,defaultCrossPadding:c}=t,l="string"==typeof i?{title:i}:i;s.push(Object.assign({type:"title",position:e,orientation:n,order:r,crossPadding:c[0],defaultSize:a},l))}const l=function(t,e){const n=t.filter((t=>function(t){if(!t||!t.type)return!1;if("function"==typeof t.type)return!0;const{type:e,domain:n,range:r,interpolator:i}=t,o=n&&n.length>0,a=r&&r.length>0;return!!(["linear","sqrt","log","time","pow","threshold","quantize","quantile","ordinal","band","point"].includes(e)&&o&&a)||!(!["sequential"].includes(e)||!o||!a&&!i)||!(!["constant","identity"].includes(e)||!a)}(t)));return[...yN(n),...bN(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=X({},...e),{guide:m,field:y}=g,v=Array.isArray(m)?m:[m];for(const n of v){const[o,g]=MN(t,i,l,n,e,a,r);if(!o&&!g)continue;const m="left"===o||"right"===o,v=m?d[1]:d[0],b=m?p[1]:p[0],{size:x,order:w=f,length:M=h,padding:O=v,crossPadding:E=b}=n;s.push(Object.assign(Object.assign({title:y},n),{defaultSize:u,length:M,position:o,plane:c,orientation:g,padding:O,order:w,crossPadding:E,size:x,type:t,scales:e}))}})),s}function gN(t,e,n,r,i){const[o]=hT("component",r),{scaleInstances:a,scale:s,bbox:c}=t,l={bbox:c,library:r};return o(Me(t,["scaleInstances","scale","bbox"]))({coordinate:e,library:r,markState:i,scales:a,theme:n,value:l,scale:s})}function mN(t,e){const n=["left","right","bottom","top"],r=Gn(t,(({type:t,position:e,group:r})=>n.includes(e)?void 0===r?t.startsWith("legend")?`legend-${e}`:Symbol("independent"):"independent"===r?Symbol("independent"):r:Symbol("independent")));return r.flatMap((([,t])=>{if(1===t.length)return t[0];if(void 0!==e){const n=t.filter((t=>void 0!==t.length)).map((t=>t.length)),r=hr(n);if(r>e)return t.forEach((t=>t.group=Symbol("independent"))),t;const i=(e-r)/(t.length-n.length);t.forEach((t=>{void 0===t.length&&(t.length=i)}))}const n=rr(t,(t=>t.size)),r=rr(t,(t=>t.order)),i=rr(t,(t=>t.crossPadding));return{type:"group",size:n,order:r,position:t[0].position,children:t,crossPadding:i}}))}function yN(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=Gn(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(...Nr(t,n));return e}(t).sort(((t,e)=>e.length-t.length)),n=e.map((t=>({combination:t,option:t.map((t=>[t.name,vN(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 MA)for(const{option:r,combination:i}of n)if(e.some((t=>Z(s(t),s(r)))))return[t,i];return null})).filter(vr);return c}function vN(t){const{type:e}=t;return"string"!=typeof e?null:e in uN?"continuous":e in hN?"discrete":e in fN?"distribution":e in dN?"constant":null}function bN(t,e){return t.map((t=>{const{name:n}=t;if(function(t){return gT(t,"helix").length>0}(e)||vT(e))return null;if(yT(e)&&(mT(e)||bT(e)))return null;if(n.startsWith("x"))return mT(e)?["axisArc",[t]]:bT(e)?["axisLinear",[t]]:[yT(e)?"axisY":"axisX",[t]];if(n.startsWith("y"))return mT(e)?["axisLinear",[t]]:bT(e)?["axisArc",[t]]:[yT(e)?"axisX":"axisY",[t]];if(n.startsWith("z"))return["axisZ",[t]];if(n.startsWith("position")){if(function(t){return gT(t,"radar").length>0}(e))return["axisRadar",[t]];if(!mT(e))return["axisY",[t]]}return null})).filter(vr)}function xN(t){const e=gT(t,"polar");if(e.length){const t=e[e.length-1],{startAngle:r,endAngle:i}=n(t);return[r,i]}const r=gT(t,"radial");if(r.length){const t=r[r.length-1],{startAngle:e,endAngle:n}=a(t);return[e,n]}return[-Math.PI/2,Math.PI/2*3]}function wN(t,e,n,r,i){const{name:o}=n[0];if("axisRadar"===t){const t=r.filter((t=>t.name.startsWith("position"))),e=function(t){const e=/position(\d*)/g.exec(t);return e?+e[1]:null}(o);if(o===t.slice(-1)[0].name||null===e)return[null,null];const[n,a]=xN(i);return["center",(a-n)/(t.length-1)*e+n]}if("axisY"===t&&function(t){return gT(t,"parallel").length>0}(i))return yT(i)?["center","horizontal"]:["center","vertical"];if("axisLinear"===t){const[t]=xN(i);return["center",t]}return"axisArc"===t?"inner"===e[0]?["inner",null]:["outer",null]:mT(i)||bT(i)?["center",null]:"axisX"===t&&function(t){return gT(t,"reflect").length>0}(i)||"axisX"===t&&function(t){return gT(t,"reflectY").length>0}(i)?["top",null]:e}function MN(t,e,n,r,i,o,a){const[s]=xN(a),c=[r.position||e,null!=s?s:n];return"string"==typeof t&&t.startsWith("axis")?wN(t,c,i,o,a):"string"==typeof t&&t.startsWith("legend")&&mT(a)&&"center"===r.position?["center","vertical"]:c}function ON(t,e,n,r,i,o){const{type:a}=t;if(!["left","right","bottom","top"].includes(r))return;if("string"!=typeof a)return;const s=a;return(s.startsWith("axis")?_N:s.startsWith("group")?EN:s.startsWith("legendContinuous")?TN:"legendCategory"===s?PN:s.startsWith("slider")?AN:"title"===s?SN:s.startsWith("scrollbar")?kN:()=>{})(t,e,n,r,i,o)}function EN(t,e,n,r,i,o){const{children:a}=t,s=rr(a,(t=>t.crossPadding));a.forEach((t=>t.crossPadding=s)),a.forEach((t=>ON(t,e,n,r,i,o)));const c=rr(a,(t=>t.size));t.size=c,a.forEach((t=>t.size=c))}function kN(t,e,n,r,i,o){const{trackSize:a=6}=X({},i.scrollbar,t);t.size=a}function SN(t,e,n,r,i,o){const a=X({},i.title,t),{title:s,subtitle:c,spacing:l=0}=a,u=Me(a,["title","subtitle","spacing"]);if(s){const e=IN(s,xr(u,"title"));t.size=e.height}if(c){const e=IN(c,xr(u,"subtitle"));t.size+=l+e.height}}function AN(t,e,n,r,i,o){const{trackSize:a,handleIconSize:s}=(()=>{const{slider:e}=i;return X({},e,t)})(),c=Math.max(a,2.4*s);t.size=c}function _N(t,e,n,r,i,o){t.transform=t.transform||[{type:"hide"}];const a="left"===r||"right"===r,s=jN(t,r,i),{tickLength:c=0,labelSpacing:l=0,titleSpacing:u=0,labelAutoRotate:f}=s,h=Me(s,["tickLength","labelSpacing","titleSpacing","labelAutoRotate"]),d=CN(t,o),p=NN(h,d),g=c+l;if(p&&p.length){const r=rr(p,(t=>t.width)),i=rr(p,(t=>t.height));if(a)t.size=r+g;else{const{tickFilter:o,labelTransform:a}=t;!function(t,e,n,r,i){const o=hr(e,(t=>t.width));if(o>n)return!0;const a=t.clone();a.update({range:[0,n]});const s=RN(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}(d,p,e,n,o)||a||!1===f||null===f?t.size=i+g:(t.labelTransform="rotate(90)",t.size=r+g)}}else t.size=c;const m=LN(h);m&&(t.size+=a?u+m.width:u+m.height)}function TN(t,e,n,r,i,o){const a=(()=>{const{legendContinuous:e}=i;return X({},e,t)})(),{labelSpacing:s=0,titleSpacing:c=0}=a,l=Me(a,["labelSpacing","titleSpacing"]),u="left"===r||"right"===r,f=xr(l,"ribbon"),{size:h}=f,d=xr(l,"handleIcon"),{size:p}=d,g=Math.max(h,2.4*p);t.size=g;const m=NN(l,CN(t,o));if(m){const e=u?"width":"height",n=rr(m,(t=>t[e]));t.size+=n+s}const y=LN(l);y&&(u?t.size=Math.max(t.size,y.width):t.size+=c+y.height)}function PN(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 X({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=Me(a,["itemSpacing","itemMarkerSize","titleSpacing","rowPadding","colPadding","maxCols","maxRows"]),{cols:g,length:m}=t,y=t=>Math.min(t,d),v=t=>Math.min(t,h),b="left"===r||"right"===r,x=void 0===m?e+(b?0:n[0]+n[1]):m,w=LN(p),M=NN(p,CN(t,o),"itemLabel"),O=Math.max(M[0].height,c)+u,E=(t,e=0)=>c+t+s[0]+e;b?(()=>{let e=-1/0,n=0,r=1,i=0,o=-1/0,a=-1/0;const s=w?w.height:0,c=x-s;for(const{width:t}of M){const s=E(t,f);e=Math.max(e,s),n+O>c?(r++,o=Math.max(o,i),a=Math.max(a,n),i=1,n=O):(n+=O,i++)}r<=1&&(o=i,a=n),t.size=e*v(r),t.length=a+s,X(t,{cols:v(r),gridRow:o})})():"number"==typeof g?(()=>{const e=Math.ceil(M.length/g),n=rr(M,(t=>E(t.width)))*g;t.size=O*y(e)-u,t.length=Math.min(n,x)})():(()=>{let e=1,n=0,r=-1/0;for(const{width:t}of M){const i=E(t,f);n+i>x?(r=Math.max(r,n),n=i,e++):n+=i}1===e&&(r=n),t.size=O*y(e)-u,t.length=r})(),w&&(b?t.size=Math.max(t.size,w.width):t.size+=l+w.height)}function CN(t,e){const[n]=hT("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 NN(t,e,n="label"){const{labelFormatter:r,tickFilter:i,label:o=!0}=t,a=Me(t,["labelFormatter","tickFilter","label"]);if(!o)return null;const s=function(t,e,n){const r=RN(t,n),i=r.map((t=>"number"==typeof t?wm(t):t)),o=e?"string"==typeof e?YE(e):e:t.getFormatter?t.getFormatter():t=>`${t}`;return i.map(o)}(e,r,i),c=xr(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)=>IN(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 LN(t){const{title:e}=t,n=Me(t,["title"]);if((t=>!1===t||null===t)(e)||void 0===e)return null;const r=xr(n,"title"),{direction:i,transform:o}=r,a=Array.isArray(e)?e.join(","):e;if("string"!=typeof a)return null;return IN(a,Object.assign(Object.assign({},r),{transform:o||("vertical"===i?"rotate(-90)":"")}))}function jN(t,e,n){const{title:r}=t,[i,o]=Array.isArray(r)?[r,void 0]:[void 0,r],{axis:a,[`axis${gr(e)}`]:s}=n;return X({title:i},a,s,Object.assign(Object.assign({},t),{title:o}))}function RN(t,e){const n=t.getTicks?t.getTicks():t.getOptions().domain;return e?n.filter(e):n}function IN(t,e){const n=function(t){return t instanceof Fp?t:new Zp({style:{text:`${t}`}})}(t),r=Me(e,["filter"]);n.attr(Object.assign(Object.assign({},r),{visibility:"none"}));return n.getBBox()}function BN(t,e,n,r){var i,o;const{width:a,height:s,depth:c,x:l=0,y:u=0,z:f=0,inset:h=(null!==(i=n.inset)&&void 0!==i?i:0),insetLeft:d=h,insetTop:p=h,insetBottom:g=h,insetRight:m=h,margin:y=(null!==(o=n.margin)&&void 0!==o?o:0),marginLeft:v=y,marginBottom:b=y,marginTop:x=y,marginRight:w=y,padding:M=n.padding,paddingBottom:O=M,paddingLeft:E=M,paddingRight:k=M,paddingTop:S=M}=function(t,e,n,r){const{coordinates:i}=e;if(!mT(i)&&!bT(i))return e;const o=t.filter((t=>"string"==typeof t.type&&t.type.startsWith("axis")));if(0===o.length)return e;const a=o.map((t=>jN(t,"axisArc"===t.type?"arc":"linear",n))),s=rr(a,(t=>{var e;return null!==(e=t.labelSpacing)&&void 0!==e?e:0})),c=o.flatMap(((t,e)=>NN(a[e],CN(t,r)))).filter(vr),l=rr(c,(t=>t.height))+s,u=o.flatMap(((t,e)=>LN(a[e]))).filter((t=>null!==t)),f=0===u.length?0:rr(u,(t=>t.height)),{inset:h=l,insetLeft:d=h,insetBottom:p=h,insetTop:g=h+f,insetRight:m=h}=e;return Object.assign(Object.assign({},e),{insetLeft:d,insetBottom:p,insetTop:g,insetRight:m})}(t,e,n,r),A=(t,n,r,i,o)=>{const{marks:a}=e;if(0===a.length)return[i,o];if(t-i-o-.25*t>0)return[i,o];const s=.75*t;return["auto"===n?s*i/(i+o):i,"auto"===r?s*o/(i+o):o]},_=t=>"auto"===t?20:null!=t?t:20,T=_(S),P=_(O),C=DN(t,s-T-P,[T+x,P+b],["left","right"],e,n,r),{paddingLeft:N,paddingRight:L}=C,j=a-v-w,[R,I]=A(j,E,k,N,L),B=j-R-I,D=DN(t,B,[R+v,I+w],["bottom","top"],e,n,r),{paddingTop:F,paddingBottom:z}=D,G=s-b-x,[W,$]=A(G,O,S,z,F);return{width:a,height:s,depth:c,insetLeft:d,insetTop:p,insetBottom:g,insetRight:m,innerWidth:B,innerHeight:G-W-$,paddingLeft:R,paddingRight:I,paddingTop:$,paddingBottom:W,marginLeft:v,marginBottom:b,marginTop:x,marginRight:w,x:l,y:u,z:f}}function DN(t,e,n,r,i,o,a){const s=zn(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${gr(Ww(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=rr(t.children,(t=>t.size))):t.size=t.defaultSize},f=r=>{r.size||("auto"!==c?u(r):(ON(r,e,n,t,o,a),l(r)))},h=t=>{t.type.startsWith("axis")&&void 0===t.labelAutoHide&&(t.labelAutoHide=!0)},p="bottom"===t||"top"===t,g=or(i,(t=>t.order)),m=i.filter((t=>t.type.startsWith("axis")&&t.order==g));if(m.length&&(m[0].crossPadding=0),"number"==typeof c)i.forEach(l),i.forEach(h);else if(0===i.length)d[r]=0;else{const t=mN(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 FN({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 m=n+a,y=i+s,v=r+l,b=o+c,x=t-a-l,w=[m+d,y+g,f-d-p,u-g-h,"center",null,null];return{top:[m,0,f,y,"vertical",!0,On,a,x],right:[t-v,y,v,u,"horizontal",!1,On],bottom:[m,e-b,f,b,"vertical",!1,On,a,x],left:[0,y,m,u,"horizontal",!0,On],"top-left":[m,0,f,y,"vertical",!0,On],"top-right":[m,0,f,y,"vertical",!0,On],"bottom-left":[m,e-b,f,b,"vertical",!1,On],"bottom-right":[m,e-b,f,b,"vertical",!1,On],center:w,inner:w,outer:w}}function zN(t,e,n,r){const[i,o]=Cr(t,(t=>!("string"!=typeof t.type||!t.type.startsWith("axis"))));!function(t,e,n,r){"center"===r?function(t){return Zc(t)&&qc(t)}(e)?function(t,e,n,r){const[i,o,a,s]=n;for(const e of t)e.bbox={x:i,y:o,width:a,height:s},e.radar={index:t.indexOf(e),count:t.length}}(t,0,n):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):Zc(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]=tl(e),l=c*(o/2),u=a-l,f=s-l;for(let e=0;e<t.length;e++){t[e].bbox={x:r+u,y:i+f,width:2*l,height:2*l}}}(t,e,n):"outer"===r&&function(t,e,n){const[r,i,o,a]=n;for(const e of t)e.bbox={x:r,y:i,width:o,height:a}}(t,0,n)}(i,e,n,r),function(t,e,n){if(0===t.length)return;const[r,i,o,a]=n,[s]=tl(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 GN(t,e,n){const[r,i,o,a,s,c,l,u,f]=n,[h,d,p,g,m,y,v,b]="vertical"===s?["y",i,"x",r,"height",a,"width",o]:["x",r,"y",i,"width",o,"height",a];t.sort(((t,e)=>null==l?void 0:l(t.order,e.order)));const x=t=>"title"===t||"group"===t||t.startsWith("legend"),w=(t,e,n)=>void 0===n?e:x(t)?n:e,M=(t,e,n)=>void 0===n?e:x(t)?n:e;for(let e=0,n=c?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]:M(o,g,u),[m]:a,[v]:w(o,b,f)},n+=(a+i)*(c?-1:1)}const O=t.filter((t=>"group"===t.type));for(const t of O){const{bbox:e,children:n}=t,r=e[v],i=r/n.length,o=n.reduce(((t,e)=>{var n;const r=null===(n=e.layout)||void 0===n?void 0:n.justifyContent;return r||t}),"flex-start"),a=n.map(((t,e)=>{const{length:r=i,padding:o=0}=t;return r+(e===n.length-1?0:o)})),s=r-hr(a),c="flex-start"===o?0:"center"===o?s/2:s;for(let t=0,r=e[p]+c;t<n.length;t++){const i=n[t],{padding:s=0}=i,c=t===n.length-1?0:s;i.bbox={[m]:e[m],[h]:e[h],[p]:r,[v]:a[t]-c},X(i,{layout:{justifyContent:o}}),r+=a[t]}}}function WN(t,e,n){const{encode:r={},scale:i={},transform:o=[]}=e,a=Me(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},a),{encode:r,scale:i,transform:o})]}function $N(t,e,n){return Ee(this,void 0,void 0,(function*(){const{library:t}=n,{data:r}=e,[i]=hT("data",t),o=function(t){if(L(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=Me(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}(r),{transform:a=[]}=o,s=[Me(o,["transform"]),...a].map(i),c=yield function(t){return t.reduce(((t,e)=>n=>Ee(this,void 0,void 0,(function*(){const r=yield t(n);return e(r)}))),dr)}(s)(r),l=!r||Array.isArray(r)||Array.isArray(c)?c:{value:c};return[Array.isArray(c)?_r(c):[],Object.assign(Object.assign({},e),{data:l})]}))}function HN(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 VN(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const o=Ar(r,(t=>{if(function(t){if("object"!=typeof t||t instanceof Date||null===t)return!1;const{type:e}=t;return vr(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 YN(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i=Ar(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 UN(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const{library:o}=n,a=function(t){const[e]=hT("encode",t);return(t,n)=>void 0===n||void 0===t?null:Object.assign(Object.assign({},n),{type:"column",value:e(n)(t),field:tL(n)})}(o),s=Ar(r,(t=>a(i,t)));return[t,Object.assign(Object.assign({},e),{encode:s})]}function qN(t,e,n){const{tooltip:r={}}=e;return kr(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:Er(r)&&function(t){if(0===Object.keys(t).length)return!0;const{title:e,items:n}=t;return void 0!==e||void 0!==n}(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function XN(t,e,n){const{data:r,encode:i,tooltip:o={}}=e;if(kr(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(Er(e)){const{field:n,channel:o,color:a,name:s=n,valueFormatter:c=(t=>t)}=e,l="string"==typeof c?YE(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);Er(t)?n[o]=t:n[o]={value:t}}return n}return e},{title:s,items:c=[]}=o,l=Me(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 KN(t,e,n){const{encode:r}=e,i=Me(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=Me(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 ZN(t,e,n){const{axis:r={},legend:i={},slider:o={},scrollbar:a={}}=e,s=(t,e)=>{if("boolean"==typeof t)return t?{}:null;const n=t[e];return void 0===n||n?n:null},c="object"==typeof r?Array.from(new Set(["x","y",...Object.keys(r)])):["x","y"];return X(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 QN(t,e,n){const{animate:r}=e;return r||void 0===r||X(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}function JN(t,e,n){return Ee(this,void 0,void 0,(function*(){const r={library:n},[i,o]=yield function(t,e,n){return Ee(this,void 0,void 0,(function*(){const{library:r}=n,[i]=hT("transform",r),{preInference:o=[],postInference:a=[]}=e,{transform:s=[]}=t,c=[WN,$N,HN,VN,YN,UN,KN,QN,ZN,qN,...o.map(i),...s.map(i),...a.map(i),XN];let l=[],u=t;for(const t of c)[l,u]=yield t(l,u,n);return[l,u]}))}(t,e,r),{encode:a,scale:s,data:c,tooltip:l}=o;if(!1===Array.isArray(c))return null;const{channels:u}=e,f=$n(Object.entries(a).filter((([,t])=>vr(t))),(t=>t.map((([t,e])=>Object.assign({name:t},e)))),(([t])=>{var e;const n=null===(e=/([^\d]+)\d*$/.exec(t))||void 0===e?void 0:e[1],r=u.find((t=>t.name===n));return(null==r?void 0:r.independent)?t:n})),h=u.filter((t=>{const{name:e,required:n}=t;if(f.find((([t])=>t===e)))return!0;if(n)throw new Error(`Missing encoding for channel: ${e}.`);return!1})).flatMap((t=>{const{name:e,scale:n,scaleKey:r,range:i,quantitative:o,ordinal:a}=t;return f.filter((([t])=>t.startsWith(e))).map((([t,e],c)=>{const l=e.some((t=>t.visual)),u=e.some((t=>t.constant)),f=s[t]||{},{independent:h=!1,key:d=r||t,type:p=(u?"constant":l?"identity":n)}=f,g=Me(f,["independent","key","type"]),m="constant"===p,y=m?void 0:i;return{name:t,values:e,scaleKey:h||m?Symbol("independent"):d,scale:Object.assign(Object.assign({type:p,range:y},g),{quantitative:o,ordinal:a})}}))}));return[o,Object.assign(Object.assign({},e),{index:i,channels:h,tooltip:l})]}))}function tL(t){const{type:e,value:n}=t;return"field"===e&&"string"==typeof n?n:null}function eL(t,e,n,r){var i;return Ee(this,void 0,void 0,(function*(){const[o]=hT("composition",n),[a]=hT("interaction",n),s=new Set(Object.keys(n).map((t=>{var e;return null===(e=/mark\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(vr)),c=new Set(Object.keys(n).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(vr)),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,m=new Map,y=[t],v=[];for(;y.length;){const t=y.shift();if(f(t)){const e=m.get(t),[r,i]=e?sL(e,t,n):yield iL(t,n);g.set(r,t),p.push(r);const o=i.flatMap(d).map((t=>pT(t,n)));if(y.push(...o),o.every(f)){const t=yield Promise.all(o.map((t=>oL(t,n))));KC(t);for(let e=0;e<o.length;e++){const n=o[e],r=t[e];m.set(n,r)}}}else{const e=d(u(t)?t:yield ML(t,n));Array.isArray(e)?y.push(...e):"function"==typeof e&&v.push(e())}}r.emitter.emit(wA.BEFORE_PAINT);const b=new Map,w=new Map,M=[];e.selectAll(SL(vS)).data(p,(t=>t.key)).join((t=>t.append("g").attr("className",vS).attr("id",(t=>t.key)).call(nL).each((function(t,e,i){cL(t,vm(i),M,n,r),b.set(t,i)}))),(t=>t.call(nL).each((function(t,e,i){cL(t,vm(i),M,n,r),w.set(t,i)}))),(t=>t.each((function(t,e,n){const r=n.nameInteraction.values();for(const t of r)t.destroy()})).remove()));const O=(t,e,i)=>Array.from(t.entries()).map((([o,a])=>{const s=i||new Map,c=g.get(o),l=function(t,e,n,r){const i=function(t){const[,e]=hT("interaction",t);return t=>{const[n,r]=t;try{return[n,e(n)]}catch(t){return[n,r.type]}}}(n),o=t=>t[1]&&t[1].props&&t[1].props.reapplyWhenUpdate,a=wL(e),s=a.map(i).filter(o).map((t=>t[0]));return(e,i,o)=>Ee(this,void 0,void 0,(function*(){const a=[],[c,l]=yield iL(e,n);cL(c,t,a,n,r);for(const o of s.filter((t=>t!==i)))rL(o,t,e,c,n,r);for(const e of l)eL(e,t,n,r);return o(),{options:e,view:c}}))}(vm(a),c,n,r);return{view:o,container:a,options:c,setState:(t,e=(t=>t))=>s.set(t,e),update:(n,r)=>Ee(this,void 0,void 0,(function*(){const i=pr(Array.from(s.values()))(c);return yield l(i,n,(()=>{x(r)&&e(t,r,s)}))}))}})),E=(t=w,e,n)=>{var i;const o=O(t,E,n);for(const t of o){const{options:n,container:s}=t,c=s.nameInteraction;let l=wL(n);e&&(l=l.filter((t=>e.includes(t[0]))));for(const e of l){const[n,s]=e,l=c.get(n);if(l&&(null===(i=l.destroy)||void 0===i||i.call(l)),s){const e=aL(t.view,n,s,a)(t,o,r.emitter);c.set(n,{destroy:e})}}}},k=O(b,E);for(const t of k){const{options:e}=t,n=new Map;t.container.nameInteraction=n;for(const i of wL(e)){const[e,o]=i;if(o){const i=aL(t.view,e,o,a)(t,k,r.emitter);n.set(e,{destroy:i})}}}E();const{width:S,height:A}=t,_=[];for(const t of v){const i=new Promise((i=>Ee(this,void 0,void 0,(function*(){for(const i of t){const t=Object.assign({width:S,height:A},i);yield eL(t,e,n,r)}i()}))));_.push(i)}r.views=p,null===(i=r.animations)||void 0===i||i.forEach((t=>null==t?void 0:t.cancel())),r.animations=M,r.emitter.emit(wA.AFTER_PAINT);const T=M.filter(vr).map(yL).map((t=>t.finished));return Promise.all([...T,..._])}))}function nL(t){t.style("transform",(t=>`translate(${t.layout.x}, ${t.layout.y})`))}function rL(t,e,n,r,i,o){var a;const[s]=hT("interaction",i),c=e.node().nameInteraction,l=wL(n).find((([e])=>e===t)),u=c.get(t);if(!u)return;if(null===(a=u.destroy)||void 0===a||a.call(u),!l[1])return;const f=aL(r,t,l[1],s),h={options:n,view:r,container:e.node(),update:t=>Promise.resolve(t)},d=f(h,[],o.emitter);c.set(t,{destroy:d})}function iL(t,e){return Ee(this,void 0,void 0,(function*(){const n=yield function(t,e){return Ee(this,void 0,void 0,(function*(){const[n,r]=hT("mark",e),i=new Set(Object.keys(e).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(vr)),{marks:o}=t,a=[],s=[],c=[...o],{width:l,height:u}=function(t){const{height:e,width:n,padding:r=0,paddingLeft:i=r,paddingRight:o=r,paddingTop:a=r,paddingBottom:s=r,margin:c=16,marginLeft:l=c,marginRight:u=c,marginTop:f=c,marginBottom:h=c,inset:d=0,insetLeft:p=d,insetRight:g=d,insetTop:m=d,insetBottom:y=d}=t,v=t=>"auto"===t?20:t;return{width:n-v(i)-v(o)-l-u-p-g,height:e-v(a)-v(s)-f-h-m-y}}(t),f={options:t,width:l,height:u};for(;c.length;){const[t]=c.splice(0,1),o=yield ML(t,e),{type:l=mr("G2Mark type is required."),key:u}=o;if(i.has(l))s.push(o);else{const{props:t={}}=r(l),{composite:e=!0}=t;if(e){const{data:t}=o,e=Object.assign(Object.assign({},o),{data:t?Array.isArray(t)?t:t.value:t}),r=yield n(e,f),i=Array.isArray(r)?r:[r];c.unshift(...i.map(((t,e)=>Object.assign(Object.assign({},t),{key:`${u}-${e}`}))))}else a.push(o)}}return Object.assign(Object.assign({},t),{marks:a,components:s})}))}(t,e),r=function(t){const{coordinate:e={},interaction:n={},style:r={},marks:i}=t,o=Me(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)=>X(t,e)),{}),u=[n,...s].reduce(((t,e)=>X(t,e)),{}),f=[...c,r].reduce(((t,e)=>X(t,e)),{});return Object.assign(Object.assign({},o),{marks:i,coordinate:l,interaction:u,style:f})}(n);t.interaction=r.interaction,t.coordinate=r.coordinate,t.marks=[...r.marks,...r.components];const i=pT(r,e);return sL(yield oL(i,e),i,e)}))}function oL(t,e){return Ee(this,void 0,void 0,(function*(){const[n]=hT("theme",e),[,r]=hT("mark",e),{theme:i,marks:o,coordinates:a=[]}=t,s=n(xL(i)),c=new Map;for(const t of o){const{type:n}=t,{props:i={}}=r(n),o=yield JN(t,i,e);if(o){const[t,e]=o;c.set(t,e)}}const l=zn(Array.from(c.values()).flatMap((t=>t.channels)),(({scaleKey:t})=>t));for(const t of l.values()){const n=t.reduce(((t,{scale:e})=>X(t,e)),{}),{scaleKey:r}=t[0],{values:i}=t[0],o=Array.from(new Set(i.map((t=>t.field)).filter(vr))),c=X({guide:{title:0===o.length?void 0:o},field:o[0]},n),{name:l}=t[0],u=t.flatMap((({values:t})=>t.map((t=>t.value)))),f=Object.assign(Object.assign({},YC(l,u,c,a,s,e)),{key:r});t.forEach((t=>t.scale=f))}return c}))}function aL(t,e,n,r){const i=t.theme,o="string"==typeof e&&i[e]||{};return r(X(o,Object.assign({type:e},n)))}function sL(t,e,n){const[r]=hT("mark",n),[i]=hT("theme",n),[o]=hT("labelTransform",n),{key:a,frame:s=!1,theme:c,clip:l,style:u={},labelTransform:f=[]}=e,h=i(xL(c)),d=Array.from(t.values()),p=function(t,e){var n;const{components:r=[]}=e,i=["scale","encode","axis","legend","data","transform"],o=Array.from(new Set(t.flatMap((t=>t.channels.map((t=>t.scale)))))),a=new Map(o.map((t=>[t.name,t])));for(const t of r){const e=ZC(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=X({},r,t),Object.assign(e,s)}else{const e=Object.assign(Object.assign({},s),{expectedDomain:s.domain,name:r,guide:et(t,i)});o.push(e)}}}return o}(d,e),g=function(t){return t.map((t=>{const e=X(t,t.style);return delete e.style,e}))}(pN(function(t,e,n){var r;for(const[e]of n.entries())if("cell"===e.type)return t.filter((t=>"shape"!==t.name));if(1!==e.length||t.some((t=>"shape"===t.name)))return t;const{defaultShape:i}=e[0];if(!["point","line","rect","hollow"].includes(i))return t;const o={point:"point",line:"hyphen",rect:"square",hollow:"hollow"},a=(null===(r=t.find((t=>"color"===t.name)))||void 0===r?void 0:r.field)||null,s={field:a,name:"shape",type:"constant",domain:[],range:[o[i]]};return[...t,s]}(Array.from(p),d,t),e,n)),m=BN(g,e,h,n),y=function(t,e,n){const[r]=hT("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 S_(p):new M_(p)}(m,e,n),v=s?X({mainLineWidth:1,mainStroke:"#000"},u):u;!function(t,e,n){const r=zn(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:m,insetTop:y,height:v,width:b,depth:x}=n,w={xy:FN({width:b,height:v,paddingLeft:i,paddingRight:o,paddingTop:a,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:h,innerWidth:d,insetBottom:p,insetLeft:g,insetRight:m,insetTop:y}),yz:FN({width:x,height:v,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:x,innerHeight:v,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0}),xz:FN({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]=Cr(n,(t=>"string"==typeof t.type&&("center"===i||!(!t.type.startsWith("axis")||!["inner","outer"].includes(i)))));a.length&&zN(a,e,o,i),s.length&&GN(n,0,o)}}(mN(g),y,m),function(t){const e=t.find((({type:t})=>"axisZ"===t));if(e){const n=t.find((({type:t})=>"axisX"===t));n.plane="xy";const r=t.find((({type:t})=>"axisY"===t));r.plane="xy",e.plane="yz",e.origin=[n.bbox.x,n.bbox.y,0],e.eulerAngles=[0,-90,0],e.bbox.x=n.bbox.x,e.bbox.y=n.bbox.y,t.push(Object.assign(Object.assign({},n),{plane:"xz",showLabel:!1,showTitle:!1,origin:[n.bbox.x,n.bbox.y,0],eulerAngles:[-90,0,0]})),t.push(Object.assign(Object.assign({},r),{plane:"yz",showLabel:!1,showTitle:!1,origin:[r.bbox.x+r.bbox.width,r.bbox.y,0],eulerAngles:[0,-90,0]})),t.push(Object.assign(Object.assign({},e),{plane:"xz",actualPosition:"left",showLabel:!1,showTitle:!1,eulerAngles:[90,-90,0]}))}}(g);const b={};for(const t of g){const{scales:e=[]}=t,r=[];for(const t of e){const{name:e}=t,i=XC(t,n);r.push(i),"y"===e&&i.update(Object.assign(Object.assign({},i.getOptions()),{xScale:b.x})),qC(b,{[e]:i})}t.scaleInstances=r}const x=[];for(const[e,i]of t.entries()){const{children:t,dataDomain:o,modifier:s,key:c}=e,{index:l,channels:u,tooltip:f}=i,h=Object.fromEntries(u.map((({name:t,scale:e})=>[t,e]))),d=Ar(h,(t=>XC(t,n)));qC(b,d);const p=UC(u,d),g=r(e),[v,w,M]=lL(g(l,d,p,y)),O=o||v.length,E=s?s(w,O,m):[],k=t=>{var e,n;return null===(n=null===(e=f.title)||void 0===e?void 0:e[t])||void 0===n?void 0:n.value},S=t=>f.items.map((e=>e[t])),A=v.map(((t,e)=>{const n=Object.assign({points:w[e],transform:E[e],index:t,markKey:c,viewKey:a},f&&{title:k(t),items:S(t)});for(const[r,i]of Object.entries(p))n[r]=i[t],M&&(n[`series${G(r)}`]=M[e].map((t=>i[t])));return M&&(n.seriesIndex=M[e]),M&&f&&(n.seriesItems=M[e].map((t=>S(t))),n.seriesTitle=M[e].map((t=>k(t)))),n}));i.data=A,i.index=v;const _=null==t?void 0:t(A,d,m);x.push(..._||[])}return[{layout:m,theme:h,coordinate:y,markState:t,key:a,clip:l,scale:b,style:v,components:g,labelTransform:pr(f.map(o))},x]}function cL(t,e,n,r,i){return Ee(this,void 0,void 0,(function*(){const{components:o,theme:a,layout:s,markState:c,coordinate:l,key:u,style:f,clip:h,scale:d}=t,{x:p,y:g,width:m,height:y}=s,v=Me(s,["x","y","width","height"]),b=["view","plot","main","content"],x=b.map(((t,e)=>e)),w=b.map((t=>wr(Object.assign({},a.view,f),t))),M=["a","margin","padding","inset"].map((t=>xr(v,t))),O=t=>t.style("x",(t=>_[t].x)).style("y",(t=>_[t].y)).style("width",(t=>_[t].width)).style("height",(t=>_[t].height)).each((function(t,e,n){!function(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}(vm(n),w[t])}));let E=0,k=0,S=m,A=y;const _=x.map((t=>{const e=M[t],{left:n=0,top:r=0,bottom:i=0,right:o=0}=e;return E+=n,k+=r,S-=n+o,A-=r+i,{x:E,y:k,width:S,height:A}}));e.selectAll(SL(MS)).data(x.filter((t=>vr(w[t]))),(t=>b[t])).join((t=>t.append("rect").attr("className",MS).style("zIndex",-2).call(O)),(t=>t.call(O)),(t=>t.remove()));const T=function(t){let e=-1/0,n=1/0;for(const[r,i]of t){const{animate:t={}}=r,{data:o}=i,{enter:a={},update:s={},exit:c={}}=t,{type:l,duration:u=300,delay:f=0}=s,{type:h,duration:d=300,delay:p=0}=a,{type:g,duration:m=300,delay:y=0}=c;for(const t of o){const{updateType:r=l,updateDuration:i=u,updateDelay:o=f,enterType:a=h,enterDuration:s=d,enterDelay:c=p,exitDuration:v=m,exitDelay:b=y,exitType:x=g}=t;(void 0===r||r)&&(e=Math.max(e,i+o),n=Math.min(n,o)),(void 0===x||x)&&(e=Math.max(e,v+b),n=Math.min(n,b)),(void 0===a||a)&&(e=Math.max(e,s+c),n=Math.min(n,c))}}return e===-1/0?null:[n,e-n]}(c),P=!!T&&{duration:T[1]};for(const[,t]of Gn(o,(t=>`${t.type}-${t.position}`)))t.forEach(((t,e)=>t.index=e));const C=e.selectAll(SL(xS)).data(o,(t=>`${t.type}-${t.position}-${t.index}`)).join((t=>t.append("g").style("zIndex",(({zIndex:t})=>t||-1)).attr("className",xS).append((t=>gN(X({animate:P,scale:d},t),l,a,r,c)))),(t=>t.transition((function(t,e,n){const{preserve:i=!1}=t;if(i)return;const o=gN(X({animate:P,scale:d},t),l,a,r,c),{attributes:s}=o,[u]=n.childNodes;return u.update(s,!1)})))).transitions();n.push(...C.flat().filter(vr));const N=e.selectAll(SL(bS)).data([s],(()=>u)).join((t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",bS).call(OL).call(kL,Array.from(c.keys())).call(AL,h)),(t=>t.call(kL,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):OL(t))).call(AL,h))).transitions();n.push(...N.flat());for(const[o,a]of c.entries()){const{data:s}=a,{key:c,class:l,type:u}=o,f=e.select(`#${c}`),h=dL(o,a,t,r,i),d=mL(o,a,t,r),p=vL(o,a,t,r),g=bL(o,a,t,r),m=fL(e,f,l,"element"),y=f.selectAll(SL(yS)).selectFacetAll(m).data(s,(t=>t.key),(t=>t.groupKey)).join((t=>t.append(h).attr("className",yS).attr("markType",u).transition((function(t,e,n){return d(t,[n])}))),(t=>t.call((t=>{const e=t.parent(),n=br((t=>{const[e,n]=t.getBounds().min;return[e,n]}));t.transition((function(t,r,i){hL(i,e,n);const o=h(t,r),a=p(t,[i],[o]);return null!==a||(i.nodeName===o.nodeName&&"g"!==o.nodeName?yr(i,o):(i.parentNode.replaceChild(o,i),o.className=yS,o.markType=u,o.__data__=i.__data__)),a})).attr("markType",u).attr("className",yS)}))),(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",yS).attr("markType",u).transition((function(t,e,n){const{__fromElements__:r}=n,i=p(t,r,[n]);return new bm(r,null,n.parentNode).transition(i).remove(),i}))),(t=>t.transition((function(t,e,n){const r=new bm([],n.__toData__,n.parentNode).append(h).attr("className",yS).attr("markType",u).nodes();return p(t,[n],r)})).remove())).transitions();n.push(...y.flat())}!function(t,e,n,r,i){const[o]=hT("labelTransform",r),{markState:a,labelTransform:s}=t,c=e.select(SL(mS)).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]=hT("shape",r),{data:a}=t,{data:s,defaultLabelShape:c}=e,l=s.map((t=>t.points)),{theme:u,coordinate:f}=n,h=Object.assign(Object.assign({},i),{document:dT(i),theme:u,coordinate:f});return t=>{const{index:e,points:n}=t,r=a[e],{formatter:i=(t=>`${t}`),transform:s,style:f,render:d}=t,p=Me(t,["formatter","transform","style","render"]),g=Ar(Object.assign(Object.assign({},p),f),(t=>uL(t,r,e,a))),{shape:m=c,text:y}=g,v=Me(g,["shape","text"]),b="string"==typeof i?YE(i):i,x=Object.assign(Object.assign({},v),{text:b(y,r,e,a),datum:r}),w=Object.assign({type:`label.${m}`,render:d},v);return o(w,h)(n,x,pL(u,"label",m,"label"),l)}}(n,o,t,r,i),f=e.select(`#${s}`).selectAll(SL(yS)).nodes().filter((t=>!t.__removed__));return a.flatMap(((t,e)=>{const n=Me(t,["transform"]);return f.flatMap((r=>{const i=function(t,e,n){const{seriesIndex:r,seriesKey:i,points:o,key:a,index:s}=n.__data__,c=function(t){const e=t.cloneNode(),n=t.getAnimations();e.style.visibility="hidden",n.forEach((t=>{const n=t.effect.getKeyframes();e.attr(n[n.length-1])})),t.parentNode.appendChild(e);const r=e.getLocalBounds();e.destroy();const{min:i,max:o}=r;return[i,o]}(n);if(!r)return[Object.assign(Object.assign({},t),{key:`${a}-${e}`,bounds:c,index:s,points:o,dependentElement:n})];const l=function(t){const{selector:e}=t;if(!e)return null;if("function"==typeof e)return e;if("first"===e)return t=>[t[0]];if("last"===e)return t=>[t[t.length-1]];throw new Error(`Unknown selector: ${e}`)}(t),u=r.map(((r,a)=>Object.assign(Object.assign({},t),{key:`${i[a]}-${e}`,bounds:[o[a]],index:r,points:o,dependentElement:n})));return l?l(u):u}(n,e,r);return i.forEach((e=>{l.set(e,c),u.set(e,t)})),i}))}))})),h=vm(c).selectAll(SL(wS)).data(f,(t=>t.key)).join((t=>t.append((t=>l.get(t)(t))).attr("className",wS)),(t=>t.each((function(t,e,n){yr(n,l.get(t)(t))}))),(t=>t.remove())).nodes(),d=zn(h,(t=>u.get(t.__data__))),{coordinate:p}=t;for(const[t,e]of d){const{transform:n=[]}=t;pr(n.map(o))(e,p)}s&&s(h,p)}(t,e,0,r,i)}))}function lL([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])=>vr(t)&&vr(e)))&&(r.push(o),i.push(a))}return[r,i]}function uL(t,e,n,r){return"function"==typeof t?t(e,n,r):"string"!=typeof t?t:void 0!==e[t]?e[t]:t}function fL(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 hL(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 dL(t,e,n,r,i){const[o]=hT("shape",r),{data:a}=t,{defaultShape:s,data:c,shape:l}=e,u=c.map((t=>t.points)),{theme:f,coordinate:h}=n,{type:d,style:p={}}=t,g=Object.assign(Object.assign({},i),{document:dT(i),coordinate:h,theme:f});return e=>{const{shape:n=s}=p,{shape:r=n,points:i,seriesIndex:c,index:h}=e,m=Me(e,["shape","points","seriesIndex","index"]),y=Object.assign(Object.assign({},m),{index:h}),v=c?c.map((t=>a[t])):a[h],b=c||h,x=Ar(p,(t=>uL(t,v,b,a)));return(l[r]?l[r](x,g):o(Object.assign(Object.assign({},x),{type:EL(t,r)}),g))(i,y,pL(f,d,r,s),u)}}function pL(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 gL(t,e,n,r,i){var o,a;const[,s]=hT("shape",i),[c]=hT("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(EL(e,l)).props,{[t]:g={}}=f,m=(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},m);if(!l.type)return null;const u=c(l,y)(n,r,X(g,{delay:o,duration:a,easing:s}));return Array.isArray(u)?u:[u]}}function mL(t,e,n,r){return gL("enter",t,e,n,r)}function yL(t){return t.finished.then((()=>{t.cancel()})),t}function vL(t,e,n,r){return gL("update",t,e,n,r)}function bL(t,e,n,r){return gL("exit",t,e,n,r)}function xL(t={}){if("string"==typeof t)return{type:t};const{type:e="light"}=t,n=Me(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}function wL(t){const{interaction:e={}}=t;return Object.entries(X({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},e)).reverse()}function ML(t,e){return Ee(this,void 0,void 0,(function*(){const n={library:e},{data:r}=t,i=Me(t,["data"]);if(null==r)return t;const[,{data:o}]=yield $N(0,{data:r},n);return Object.assign({data:o},i)}))}function OL(t){t.style("transform",(t=>`translate(${t.paddingLeft+t.marginLeft}, ${t.paddingTop+t.marginTop})`)).style("width",(t=>t.innerWidth)).style("height",(t=>t.innerHeight))}function EL(t,e){const{type:n}=t;return"string"==typeof e?`${n}.${e}`:e}function kL(t,e){const n=t=>void 0!==t.class?`${t.class}`:"";if(0===t.nodes().length)return;t.selectAll(SL(gS)).data(e,(t=>t.key)).join((t=>t.append("g").attr("className",gS).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(SL(mS)).node()||t.append("g").attr("className",mS).style("zIndex",0)}function SL(...t){return t.map((t=>`.${t}`)).join("")}function AL(t,e){t.node()&&t.style("clipPath",(t=>{if(!e)return null;const{paddingTop:n,paddingLeft:r,marginLeft:i,marginTop:o,innerWidth:a,innerHeight:s}=t;return new Kp({style:{x:r+i,y:n+o,width:a,height:s}})}))}function _L(t){const e=X({},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=X({},e[o]);e[o]=a,n.set(a,t),r.set(a,o),i.push(a)}}return e}function TL(t,e){const n=new mA;return n.registerPlugin(new vA),new fg({width:t,height:e,container:document.createElement("div"),renderer:n})}function PL(t,e={},n=(()=>{}),r=(t=>{throw t})){const{width:i=640,height:o=480,depth:a=0}=t,s=_L(t),{canvas:c=TL(i,o),emitter:l=new xA,library:u}=e;e.canvas=c,e.emitter=l;const{width:f,height:h}=c.getConfig();f===i&&h===o||c.resize(i,o),l.emit(wA.BEFORE_RENDER);const d=vm(c.document.documentElement);return c.ready.then((()=>eL(Object.assign(Object.assign({},s),{width:i,height:o,depth:a}),d,u,e))).then((()=>{if(a){const[t,e]=c.document.documentElement.getPosition();c.document.documentElement.setPosition(t,e,-a/2)}c.requestAnimationFrame((()=>{l.emit(wA.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),"string"==typeof(p=c.getConfig().container)?document.getElementById(p):p;var p}function CL(t,e={},n=!1){const{canvas:r,emitter:i}=e;r&&(!function(t){const e=t.getRoot().querySelectorAll(`.${vS}`);null==e||e.forEach((t=>{const{nameInteraction:e=new Map}=t;(null==e?void 0:e.size)>0&&Array.from(null==e?void 0:e.values()).forEach((t=>{null==t||t.destroy()}))}))}(r),n?r.destroy():r.destroyChildren()),i.off()}const NL={visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1};function LL(t,e){var n;return null!==(n=t.style[e])&&void 0!==n?n:NL[e]}function jL(t,e,n,r){t.style[e]=n,r&&t.children.forEach((t=>jL(t,e,n,r)))}function RL(t){jL(t,"visibility","hidden",!0)}function IL(t){jL(t,"visibility","visible",!0)}function BL(t){return vm(t).selectAll(`.${yS}`).nodes().filter((t=>!t.__removed__))}function DL(t,e){return FL(t,e).flatMap((({container:t})=>BL(t)))}function FL(t,e){return e.filter((e=>e!==t&&e.options.parentKey===t.options.key))}function zL(t){return vm(t).select(`.${bS}`).node()}function GL(t){return t.getBounds()}function WL(t,e){const{offsetX:n,offsetY:r}=e,i=GL(t),{min:[o,a],max:[s,c]}=i;return n<o||n>s||(r<a||r>c)?null:[n-o,r-a]}function $L(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 HL(t){return t=>t.__data__.color}function VL(t){return t=>t.__data__.x}function YL(t){const e=Array.isArray(t)?t:[t],n=new Map(e.flatMap((t=>Array.from(t.markState.keys()).map((e=>[qL(t.key,e.key),e.data])))));return t=>{const{index:e,markKey:r,viewKey:i}=t.__data__;return n.get(qL(i,r))[e]}}function UL(t,e=((t,e)=>t),n=((t,e,n)=>t.setAttribute(e,n))){const r="__states__",i="__ordinal__",o=o=>{const{[r]:a=[],[i]:s={}}=o,c=a.reduce(((e,n)=>Object.assign(Object.assign({},e),t[n])),s);if(0!==Object.keys(c).length){for(const[t,r]of Object.entries(c)){const i=LL(o,t),a=e(r,o);n(o,t,a),t in s||(s[t]=i)}o[i]=s}},a=t=>{t[r]||(t[r]=[])};return{setState:(t,...e)=>{a(t),t[r]=[...e],o(t)},removeState:(t,...e)=>{a(t);for(const n of e){const e=t[r].indexOf(n);-1!==e&&t[r].splice(e,1)}o(t)},hasState:(t,e)=>(a(t),-1!==t[r].indexOf(e))}}function qL(t,e){return`${t},${e}`}function XL(t,e){const n=(Array.isArray(t)?t:[t]).flatMap((t=>t.marks.map((e=>[qL(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=qL(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 KL(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 ZL(t){var{link:e=!1,valueof:n=((t,e)=>t),coordinate:r}=t,i=Me(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=Vn(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=ic(),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=Ar(i,(t=>n(t,c))),{fill:g=c.getAttribute("fill")}=p,m=Me(p,["fill"]),y=new Up({className:"element-link",style:Object.assign({d:s.toString(),fill:g,zIndex:-2},m)});null===(e=c.link)||void 0===e||e.remove(),c.parentNode.appendChild(y),c.link=y}},t=>{var e;null===(e=t.link)||void 0===e||e.remove(),t.link=null}]}function QL(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]=Uc(n)?km(i):i,s=n.getCenter(),c=Ms(o,s),l=Ms(a,s),u=ks(c)+As(c,l)/2;return r(`translate(${e*Math.cos(u)}, ${e*Math.sin(u)})`)}return Uc(n)?r(`translate(${e}, 0)`):r(`translate(0, ${-e})`)}function JL(t){var{document:e,background:n,scale:r,coordinate:i,valueof:o}=t,a=Me(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(!jk(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(!jk(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 Tm(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=Me(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=Ar(a,(e=>o(e,t))),{fill:n="#CCD6EC",fillOpacity:i=.3,zIndex:c=-2,padding:f=.001,lineWidth:h=0}=e,d=Me(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(jk)})()?l:u,m=g(t,p);m.className=s,t.parentNode.parentNode.appendChild(m),t.background=m},t=>{var e;null===(e=t.background)||void 0===e||e.remove(),t.background=null},t=>t.className===s]}function tj(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 ej(t){tj(t,t.cursor)}function nj(t,e,n){return t.find((t=>Object.entries(e).every((([e,r])=>n(t)[e]===r))))}function rj(t,{elements:e,datum:n,groupKey:r=(t=>t),link:i=!1,background:o=!1,delay:a=60,scale:s,coordinate:c,emitter:l,state:u={}}){var f;const h=e(t),d=new Set(h),p=zn(h,r),g=KL(h,n),[m,y]=ZL(Object.assign({elements:h,valueof:g,link:i,coordinate:c},xr(u.active,"link"))),[v,b,x]=JL(Object.assign({document:t.ownerDocument,scale:s,coordinate:c,background:o,valueof:g},xr(u.active,"background"))),w=X(u,{active:Object.assign({},(null===(f=u.active)||void 0===f?void 0:f.offset)&&{transform:(...t)=>{const e=u.active.offset(...t),[,n]=t;return QL(h[n],e,c)}})}),{setState:M,removeState:O,hasState:E}=UL(w,g);let k;const S=t=>{const{target:e,nativeEvent:i=!0}=t;if(!d.has(e))return;k&&clearTimeout(k);const o=r(e),a=p.get(o),s=new Set(a);for(const t of h)s.has(t)?E(t,"active")||M(t,"active"):(M(t,"inactive"),y(t)),t!==e&&b(t);v(e),m(a),i&&l.emit("element:highlight",{nativeEvent:i,data:{data:n(e),group:a.map(n)}})},A=(t=!0)=>{for(const t of h)O(t,"active","inactive"),b(t),y(t);t&&l.emit("element:unhighlight",{nativeEvent:t})},_=t=>{const{target:e}=t;o&&!x(e)||(o||d.has(e))&&(a>0?(k&&clearTimeout(k),k=setTimeout((()=>{A(),k=null}),a)):A())},T=()=>{A()};t.addEventListener("pointerover",S),t.addEventListener("pointerout",_),t.addEventListener("pointerleave",T);const P=t=>{const{nativeEvent:e}=t;e||A(!1)},C=t=>{const{nativeEvent:e}=t;if(e)return;const{data:r}=t.data,i=nj(h,r,n);i&&S({target:i,nativeEvent:!1})};return l.on("element:highlight",C),l.on("element:unhighlight",P),()=>{t.removeEventListener("pointerover",S),t.removeEventListener("pointerout",_),t.removeEventListener("pointerleave",T),l.off("element:highlight",C),l.off("element:unhighlight",P);for(const t of h)b(t),y(t)}}function ij(t){var{delay:e,createGroup:n,background:r=!1,link:i=!1}=t,o=Me(t,["delay","createGroup","background","link"]);return(t,a,s)=>{const{container:c,view:l,options:u}=t,{scale:f,coordinate:h}=l;return rj(zL(c),Object.assign({elements:BL,datum:YL(l),groupKey:n?n(l):void 0,coordinate:h,scale:f,state:XL(u,[["active",r?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:r,link:i,delay:e,emitter:s},o))}}function oj(t){return ij(Object.assign(Object.assign({},t),{createGroup:VL}))}function aj(t){return ij(Object.assign(Object.assign({},t),{createGroup:HL}))}function sj(t,{elements:e,datum:n,groupKey:r=(t=>t),link:i=!1,single:o=!1,coordinate:a,background:s=!1,scale:c,emitter:l,state:u={}}){var f;const h=e(t),d=new Set(h),p=zn(h,r),g=KL(h,n),[m,y]=ZL(Object.assign({link:i,elements:h,valueof:g,coordinate:a},xr(u.selected,"link"))),[v,b]=JL(Object.assign({document:t.ownerDocument,background:s,coordinate:a,scale:c,valueof:g},xr(u.selected,"background"))),x=X(u,{selected:Object.assign({},(null===(f=u.selected)||void 0===f?void 0:f.offset)&&{transform:(...t)=>{const e=u.selected.offset(...t),[,n]=t;return QL(h[n],e,a)}})}),{setState:w,removeState:M,hasState:O}=UL(x,g),E=(t=!0)=>{for(const t of h)M(t,"selected","unselected"),y(t),b(t);t&&l.emit("element:unselect",{nativeEvent:!0})},k=t=>{const{target:e,nativeEvent:a=!0}=t;return d.has(e)?o?((t,e,i=!0)=>{if(O(e,"selected"))E();else{const o=r(e),a=p.get(o),s=new Set(a);for(const t of h)s.has(t)?w(t,"selected"):(w(t,"unselected"),y(t)),t!==e&&b(t);if(m(a),v(e),!i)return;l.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:i,data:{data:[n(e),...a.map(n)]}}))}})(t,e,a):((t,e,o=!0)=>{const a=r(e),s=p.get(a),c=new Set(s);if(O(e,"selected")){if(!h.some((t=>!c.has(t)&&O(t,"selected"))))return E();for(const t of s)w(t,"unselected"),y(t),b(t)}else{const t=s.some((t=>O(t,"selected")));for(const t of h)c.has(t)?w(t,"selected"):O(t,"selected")||w(t,"unselected");!t&&i&&m(s),v(e)}o&&l.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:o,data:{data:h.filter((t=>O(t,"selected"))).map(n)}}))})(t,e,a):E()};t.addEventListener("click",k);const S=t=>{const{nativeEvent:e,data:r}=t;if(e)return;const i=o?r.data.slice(0,1):r.data;for(const t of i){const e=nj(h,t,n);k({target:e,nativeEvent:!1})}},A=()=>{E(!1)};return l.on("element:select",S),l.on("element:unselect",A),()=>{for(const t of h)y(t);t.removeEventListener("click",k),l.off("element:select",S),l.off("element:unselect",A)}}function cj(t){var{createGroup:e,background:n=!1,link:r=!1}=t,i=Me(t,["createGroup","background","link"]);return(t,o,a)=>{const{container:s,view:c,options:l}=t,{coordinate:u,scale:f}=c;return sj(zL(s),Object.assign({elements:BL,datum:YL(c),groupKey:e?e(c):void 0,coordinate:u,scale:f,state:XL(l,[["selected",n?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:n,link:r,emitter:a},i))}}function lj(t){return cj(Object.assign(Object.assign({},t),{createGroup:VL}))}function uj(t){return cj(Object.assign(Object.assign({},t),{createGroup:HL}))}function fj(t){var{wait:e=20,leading:n,trailing:r=!1,labelFormatter:i=(t=>`${t}`)}=t,o=Me(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:m=[]}=d,y=p.map(((t,e)=>e)),v=Vn(y.map((t=>g[t]))),b=zL(s),x=s.getElementsByClassName(yS),w=zn(s.getElementsByClassName(wS),(t=>t.__data__.key.split("-")[0])),M=new Yp({style:Object.assign({x1:0,y1:0,x2:0,y2:b.getAttribute("height"),stroke:"black",lineWidth:1},xr(o,"rule"))}),O=new Zp({style:Object.assign({x:0,y:b.getAttribute("height"),text:"",fontSize:10},xr(o,"label"))});M.append(O),b.appendChild(M);const E=(t,e,n)=>{const[r]=t.invert(n),i=e.invert(r);return v[Cn(v,i)]},k=(t,e)=>{M.setAttribute("x1",t[0]),M.setAttribute("x2",t[0]),O.setAttribute("text",i(e))};let S;const A=nt((t=>{const e=WL(b,t);e&&(t=>{const{scale:e,coordinate:n}=S,{x:r,y:i}=e,o=E(n,r,t);k(t,o);for(const t of x){const{seriesIndex:e,key:r}=t.__data__,a=e[kn((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=>{Ee(this,void 0,void 0,(function*(){const{x:e}=f,n=E(h,e,t);k(t,n),l("chartIndex",(t=>{const e=X({},t),r=e.marks.find((t=>"line"===t.type)),i=rr(Wn(y,(t=>rr(t,(t=>+p[t]))/or(t,(t=>+p[t]))),(t=>m[t])).values());X(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[kn((t=>g[+t])).center(t,n)]];for(const t of e.marks)t.animate=!1;return e}));const r=yield c("chartIndex");S=r.view}))})([0,0]),b.addEventListener("pointerenter",A),b.addEventListener("pointermove",A),b.addEventListener("pointerleave",A),()=>{M.remove(),b.removeEventListener("pointerenter",A),b.removeEventListener("pointermove",A),b.removeEventListener("pointerleave",A)}}}function hj({wait:t=30,leading:e,trailing:n=!1}){return r=>{const{options:i,update:o,setState:a,container:s}=r,c=zL(s),l=nt((t=>{const e=WL(c,t);if(!e)return a("fisheye"),void o();a("fisheye",(t=>{const n=X({},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 dj(t,e){if(e)return"string"==typeof e?document.querySelector(e):e;return t.ownerDocument.defaultView.getContextService().getDomElement().parentElement}function pj(t,e,n,r,i,o,a,s={}){const c=new ew({className:"tooltip",style:{x:e,y:n,container:a,data:[],bounding:o,position:r,enterable:i,title:"",offset:[10,10],template:{prefixCls:"g2-"},style:X({".g2-tooltip":{},".g2-tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}},s)}});return t.appendChild(c.HTMLTooltipElement),c}function gj({root:t,data:e,x:n,y:r,render:i,event:o,single:a,position:s="right-bottom",enterable:c=!1,css:l,mount:u,bounding:f}){const h=dj(t,u),d=dj(t),p=a?d:t,g=f||function(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,o]}=e;return{x:n,y:r,width:i-n,height:o-r}}(t),m=function(t,e){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return{x:n.x-r.x,y:n.y-r.y}}(d,h),{tooltipElement:y=pj(h,n,r,s,c,g,m,l)}=p,{items:v,title:b=""}=e;y.update(Object.assign({x:n,y:r,data:v,title:b,position:s,enterable:c},void 0!==i&&{content:i(o,{items:v,title:b})})),p.tooltipElement=y}function mj({root:t,single:e,emitter:n,nativeEvent:r=!0,event:i=null}){r&&n.emit("tooltip:hide",{nativeEvent:r});const o=dj(t),a=e?o:t,{tooltipElement:s}=a;s&&s.hide(null==i?void 0:i.clientX,null==i?void 0:i.clientY)}function yj({root:t,single:e}){const n=dj(t),r=e?n:t;if(!r)return;const{tooltipElement:i}=r;i&&(i.destroy(),r.tooltipElement=void 0)}function vj(t){const{value:e}=t;return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function bj(t){const e=t.getAttribute("fill"),n=t.getAttribute("stroke"),{__data__:r}=t,{color:i=(e&&"transparent"!==e?e:n)}=r;return i}function xj(t,e=(t=>t)){const n=new Map(t.map((t=>[e(t),t])));return Array.from(n.values())}function wj(t,e,n,r=t.map((t=>t.__data__)),i={}){const o=t=>t instanceof Date?+t:t,a=xj(r.map((t=>t.title)),o).filter(vr),s=r.flatMap(((r,o)=>{const a=t[o],{items:s=[],title:c}=r,l=s.filter(vr),u=void 0!==n?n:s.length<=1;return l.map((t=>{var{color:n=bj(a)||i.color,name:o}=t,s=Me(t,["color","name"]);const l=function(t,e){const{color:n,series:r,facet:i=!1}=t,{color:o,series:a}=e,s=t=>t&&t.invert&&!(t instanceof Ko)&&!(t instanceof Qo);if(s(r))return r.clone().invert(a);if(a&&r instanceof Ko&&r.invert(a)!==o&&!i)return r.invert(a);if(s(n)){const t=n.invert(o);return Array.isArray(t)?null:t}return null}(e,r),f=u?l||o:o||l;return Object.assign(Object.assign({},s),{color:n,name:f||c})}))})).map(vj);return Object.assign(Object.assign({},a.length>0&&{title:a.join(",")}),{items:xj(s,(t=>`(${o(t.name)}, ${o(t.value)}, ${o(t.color)})`))})}function Mj(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=Me(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])),m=e.map((t=>t[0])),y=ur(g),v=ur(m),[b,x,w,M]=(()=>{if(u){const t=Math.min(o,a)/2,e=s+f+o/2,n=c+h+a/2,r=ks(Ms([v,y],[e,n]));return[e,e+t*Math.cos(r),n,n+t*Math.sin(r)]}return l?[s,s+r,y+c,y+c]:[v+s,v+s,c,c+i]})();if(m.length>0){const e=t.ruleY||(()=>{const e=new Yp({style:Object.assign({x1:b,x2:x,y1:w,y2:M},p)});return t.appendChild(e),e})();e.style.x1=b,e.style.x2=x,e.style.y1=w,e.style.y2=M,t.ruleY=e}}function Oj(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function Ej(t){t.markers&&(t.markers.forEach((t=>t.remove())),t.markers=[])}function kj(t,e){return Array.from(t.values()).some((t=>{var n;return null===(n=t.interaction)||void 0===n?void 0:n[e]}))}function Sj(t,e){return void 0===t?e:t}function Aj(t){const{title:e,items:n}=t;return 0===n.length&&void 0===e}function _j(t,e){var{elements:n,sort:r,filter:i,scale:o,coordinate:a,crosshairs:s,render:c,groupName:l,emitter:u,wait:f=50,leading:h=!0,trailing:d=!1,startX:p=0,startY:g=0,body:m=!0,single:y=!0,position:v,enterable:b,mount:x,bounding:w,theme:M,disableNative:O=!1,marker:E=!0,preserve:k=!1,style:S={},css:A={}}=e,_=Me(e,["elements","sort","filter","scale","coordinate","crosshairs","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","theme","disableNative","marker","preserve","style","css"]);const T=n(t),P=Uc(a),C=qc(a),N=X(S,_),{innerWidth:L,innerHeight:j,width:R,height:I,insetLeft:B,insetTop:D}=a.getOptions(),F=[],G=[];for(const t of T){const{__data__:e}=t,{seriesX:n,title:r,items:i}=e;n?F.push(t):(r||i)&&G.push(t)}const W=!!(P?o.y:o.x).getBandWidth&&G.length>0;F.sort(((t,e)=>{const n=P?0:1,r=t=>t.getBounds().min[n];return P?r(e)-r(t):r(t)-r(e)}));const $=t=>{const e=P?1:0,{min:n,max:r}=t.getLocalBounds();return Vn([n[e],r[e]])};G.sort(((t,e)=>{const[n,r]=$(t),[i,o]=$(e),a=(n+r)/2,s=(i+o)/2;return P?s-a:a-s}));const H=new Map(F.map((t=>{const{__data__:e}=t,{seriesX:n}=e;return[t,[Vn(n.map(((t,e)=>e)),(t=>n[+t])),n]]}))),{x:V}=o,Y=(null==V?void 0:V.getBandWidth)?V.getBandWidth()/2:0,U=t=>{const[e]=a.invert(t);return e-Y},q=(t,e,n)=>{const r=U(t),i=n.filter(vr),[o,a]=Vn([i[0],i[i.length-1]]);if(!W&&(r<o||r>a)&&!(o===a))return null;const s=kn((t=>n[+t])).center;return e[s(e,r)]},K=(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[z(t.replace("series","")),r]})))},Z=nt((e=>{const n=WL(t,e);if(!n)return;const f=GL(t),h=f.min[0],d=f.min[1],O=[n[0]-p,n[1]-g];if(!O)return;const k=((t,e)=>{const n=t[P?1:0],r=e.filter((t=>{const[e,r]=$(t);return n>=e&&n<=r}));if(!W||r.length>0)return r;const i=kn((t=>{const[e,n]=$(t);return(e+n)/2})).center;return[e[i(e,n)]].filter(vr)})(O,G),S=[],_=[];for(const t of F){const[e,n]=H.get(t),r=q(O,e,n);if(null!==r){S.push(t);const e=K(t,r),{x:n,y:i}=e,o=a.map([(n||0)+Y,i||0]);_.push([Object.assign(Object.assign({},e),{element:t}),o])}}const T=Array.from(new Set(_.map((t=>t[0].x)))),z=T[ar(T,(t=>Math.abs(t-U(O))))],V=_.filter((t=>t[0].x===z)),X=[...V.map((t=>t[0])),...k.map((t=>t.__data__))],Z=[...S,...k],J=wj(Z,o,l,X,M);if(r&&J.items.sort(((t,e)=>r(t)-r(e))),i&&(J.items=J.items.filter(i)),0===Z.length||Aj(J))Q(e);else{if(m&&gj({root:t,data:J,x:n[0]+h,y:n[1]+d,render:c,event:e,single:y,position:v,enterable:b,mount:x,bounding:w,css:A}),s){const e=V.map((t=>t[1])),n=xr(N,"crosshairs");Mj(t,e,Object.assign(Object.assign({},n),{plotWidth:L,plotHeight:j,mainWidth:R,mainHeight:I,insetLeft:B,insetTop:D,startX:p,startY:g,transposed:P,polar:C}))}if(E){const e=xr(N,"marker");!function(t,{data:e,style:n,theme:r}){t.markers&&t.markers.forEach((t=>t.remove()));const i=e.filter((t=>{const[{x:e,y:n}]=t;return vr(e)&&vr(n)})).map((t=>{const[{color:e,element:i},o]=t,a=e||i.style.fill||i.style.stroke||r.color;return new zp({style:Object.assign({cx:o[0],cy:o[1],fill:a,r:4,stroke:"#fff",lineWidth:2},n)})}));for(const e of i)t.appendChild(e);t.markers=i}(t,{data:V,style:e,theme:M})}u.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:{data:{x:Rk(o.x,U(O),!0)}}}))}}),f,{leading:h,trailing:d}),Q=e=>{mj({root:t,single:y,emitter:u,event:e}),s&&Oj(t),E&&Ej(t)},J=()=>{yj({root:t,single:y}),s&&Oj(t),E&&Ej(t)},tt=({nativeEvent:e,data:n})=>{if(e)return;const{x:r}=n.data,{x:i}=o,s=i.map(r),[c,l]=a.map([s,.5]),{min:[u,f]}=t.getRenderBounds();Z({offsetX:c+u,offsetY:l+f})},et=()=>{mj({root:t,single:y,emitter:u,nativeEvent:!1})},rt=()=>{at(),J()},it=()=>{ot()},ot=()=>{O||(t.addEventListener("pointerenter",Z),t.addEventListener("pointermove",Z),t.addEventListener("pointerleave",Q))},at=()=>{O||(t.removeEventListener("pointerenter",Z),t.removeEventListener("pointermove",Z),t.removeEventListener("pointerleave",Q))};return ot(),u.on("tooltip:show",tt),u.on("tooltip:hide",et),u.on("tooltip:disable",rt),u.on("tooltip:enable",it),()=>{at(),u.off("tooltip:show",tt),u.off("tooltip:hide",et),u.off("tooltip:disable",rt),u.off("tooltip:enable",it),k?mj({root:t,single:y,emitter:u,nativeEvent:!1}):J()}}function Tj(t,{elements:e,scale:n,render:r,groupName:i,sort:o,filter:a,emitter:s,wait:c=50,leading:l=!0,trailing:u=!1,groupKey:f=(t=>t),single:h=!0,position:d,enterable:p,datum:g,view:m,mount:y,bounding:v,theme:b,shared:x=!1,body:w=!0,disableNative:M=!1,preserve:O=!1,css:E={}}){const k=e(t),S=new Set(k),A=zn(k,f),_=nt((e=>{const{target:c}=e;if(!S.has(c))return void mj({root:t,single:h,emitter:s,event:e});const l=f(c),u=A.get(l),g=1!==u.length||x?wj(u,n,i,void 0,b):function(t){const{__data__:e}=t,{title:n,items:r=[]}=e,i=r.filter(vr).map((e=>{var{color:n=bj(t)}=e,r=Me(e,["color"]);return Object.assign(Object.assign({},r),{color:n})})).map(vj);return Object.assign(Object.assign({},n&&{title:n}),{items:i})}(u[0]);if(o&&g.items.sort(((t,e)=>o(t)-o(e))),a&&(g.items=g.items.filter(a)),Aj(g))return void mj({root:t,single:h,emitter:s,event:e});const{offsetX:M,offsetY:O}=e;w&&gj({root:t,data:g,x:M,y:O,render:r,event:e,single:h,position:d,enterable:p,mount:y,bounding:v,css:E}),s.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:{data:cT(c,m)}}))}),c,{leading:l,trailing:u}),T=e=>{mj({root:t,single:h,emitter:s,event:e})},P=()=>{M||(t.addEventListener("pointermove",_),t.addEventListener("pointerleave",T))},C=()=>{M||(t.removeEventListener("pointermove",_),t.removeEventListener("pointerleave",T))},N=({nativeEvent:t,data:e})=>{if(t)return;const n=nj(k,e.data,g);if(!n)return;const r=n.getBBox(),{x:i,y:o,width:a,height:s}=r;_({target:n,offsetX:i+a/2,offsetY:o+s/2})},L=({nativeEvent:e}={})=>{e||mj({root:t,single:h,emitter:s,nativeEvent:!1})};return s.on("tooltip:show",N),s.on("tooltip:hide",L),s.on("tooltip:enable",(()=>{P()})),s.on("tooltip:disable",(()=>{C(),yj({root:t,single:h})})),P(),()=>{C(),s.off("tooltip:show",N),s.off("tooltip:hide",L),O?mj({root:t,single:h,emitter:s,nativeEvent:!1}):yj({root:t,single:h})}}function Pj(t){const{shared:e,crosshairs:n,series:r,name:i,item:o=(()=>({})),facet:a=!1}=t,s=Me(t,["shared","crosshairs","series","name","item","facet"]);return(t,i,c)=>{const{container:l,view:u}=t,{scale:f,markState:h,coordinate:d,theme:p}=u,g=kj(h,"seriesTooltip"),m=kj(h,"crosshairs"),y=zL(l),v=Sj(r,g);if(v&&function(t){return Array.from(t.values()).some((t=>{var e;return(null===(e=t.interaction)||void 0===e?void 0:e.seriesTooltip)&&t.tooltip}))}(h)&&!a)return _j(y,Object.assign(Object.assign({},s),{theme:p,elements:BL,scale:f,coordinate:d,crosshairs:Sj(n,m),item:o,emitter:c}));if(v&&a){const e=i.filter((e=>e!==t&&e.options.parentKey===t.options.key)),r=DL(t,i),a=e[0].view.scale,l=y.getBounds(),u=l.min[0],f=l.min[1];return Object.assign(a,{facet:!0}),_j(y.parentNode.parentNode,Object.assign(Object.assign({},s),{theme:p,elements:()=>r,scale:a,coordinate:d,crosshairs:Sj(n,m),item:o,startX:u,startY:f,emitter:c}))}return Tj(y,Object.assign(Object.assign({},s),{datum:YL(u),elements:BL,scale:f,coordinate:d,groupKey:e?t=>t.__data__.x:void 0,item:o,emitter:c,view:u,theme:p,shared:e}))}}ij.props={reapplyWhenUpdate:!0},oj.props={reapplyWhenUpdate:!0},aj.props={reapplyWhenUpdate:!0},cj.props={reapplyWhenUpdate:!0},lj.props={reapplyWhenUpdate:!0},uj.props={reapplyWhenUpdate:!0},fj.props={reapplyWhenUpdate:!0},Pj.props={reapplyWhenUpdate:!0};const Cj="legend-category",Nj="legend-continuous",Lj="items-item",jj="legend-category-item-marker",Rj="legend-category-item-label";function Ij(t){return t.getElementsByClassName(jj)[0]}function Bj(t){return t.getElementsByClassName(Rj)[0]}function Dj(t){return t.getElementsByClassName(Lj)}function Fj(t){return t.getElementsByClassName(Cj)}function zj(t){return t.getElementsByClassName(Nj)}function Gj(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function Wj(t,{legend:e,channel:n,value:r,ordinal:i,channels:o,allChannels:a,facet:s=!1}){return Ee(this,void 0,void 0,(function*(){const{view:c,update:l,setState:u}=t;u(e,(t=>{const{marks:e}=t,l=e.map((t=>{if("legends"===t.type)return t;const{transform:e=[]}=t,l=e.findIndex((({type:t})=>t.startsWith("group")||t.startsWith("bin"))),u=[...e];u.splice(l+1,0,{type:"filter",[n]:{value:r,ordinal:i}});const f=Object.fromEntries(o.map((t=>[t,{domain:c.scale[t].getOptions().domain}])));return X({},t,Object.assign(Object.assign({transform:u,scale:f},!i&&{animate:!1}),{legend:!s&&Object.fromEntries(a.map((t=>[t,{preserve:!0}])))}))}));return Object.assign(Object.assign({},t),{marks:l})})),yield l()}))}function $j(t,e){for(const n of t)Wj(n,Object.assign(Object.assign({},e),{facet:!0}))}function Hj(){return(t,e,n)=>{const{container:r}=t,i=e.filter((e=>e!==t)),o=i.length>0,a=t=>Gj(t).scales.map((t=>t.name)),s=[...Fj(r),...zj(r)],c=s.flatMap(a),l=nt(o?$j:Wj,50,{trailing:!0}),u=s.map((e=>{const{name:s,domain:u}=Gj(e).scales[0],f={legend:e,channel:s,channels:a(e),allChannels:c};return e.className===Cj?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:xr(h,"marker")},p={unselected:xr(h,"label")},{setState:g,removeState:m}=UL(d,void 0),{setState:y,removeState:v}=UL(p,void 0),b=Array.from(e(t));let x=b.map(i);const w=()=>{for(const t of b){const e=i(t),o=n(t),a=r(t);x.includes(e)?(m(o,"unselected"),v(a,"unselected")):(g(o,"unselected"),y(a,"unselected"))}};for(const e of b){const n=()=>{tj(t,"pointer")},r=()=>{ej(t)},c=t=>Ee(this,void 0,void 0,(function*(){const n=i(e),r=x.indexOf(n);-1===r?x.push(n):x.splice(r,1),0===x.length&&x.push(...b.map(i)),yield o(x),w();const{nativeEvent:c=!0}=t;c&&(x.length===b.length?a.emit("legend:reset",{nativeEvent:c}):a.emit("legend:filter",Object.assign(Object.assign({},t),{nativeEvent:c,data:{channel:s,values:x}})))}));e.addEventListener("click",c),e.addEventListener("pointerenter",n),e.addEventListener("pointerout",r),l.set(e,c),u.set(e,n),f.set(e,r)}const M=t=>Ee(this,void 0,void 0,(function*(){const{nativeEvent:e}=t;if(e)return;const{data:n}=t,{channel:r,values:i}=n;r===s&&(x=i,yield o(x),w())})),O=t=>Ee(this,void 0,void 0,(function*(){const{nativeEvent:e}=t;e||(x=b.map(i),yield o(x),w())}));return a.on("legend:filter",M),a.on("legend:reset",O),()=>{for(const t of b)t.removeEventListener("click",l.get(t)),t.removeEventListener("pointerenter",u.get(t)),t.removeEventListener("pointerout",f.get(t)),a.off("legend:filter",M),a.off("legend:reset",O)}}(r,{legends:Dj,marker:Ij,label:Bj,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 Vj(){return(t,e,n)=>{const{container:r,view:i,options:o}=t,a=Fj(r),s=BL(r),c=t=>Gj(t).scales[0].name,l=t=>{const{scale:{[t]:e}}=i;return e},u=XL(o,["active","inactive"]),f=KL(s,YL(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=Dj(t),o=l(r),a=zn(s,(t=>o.invert(t.__data__[r]))),{state:d={}}=t.attributes,{inactive:p={}}=d,{setState:g,removeState:m}=UL(u,f),y={inactive:xr(p,"marker")},v={inactive:xr(p,"label")},{setState:b,removeState:x}=UL(y),{setState:w,removeState:M}=UL(v),O=t=>{for(const e of i){const n=Ij(e),r=Bj(e);e===t||null===t?(x(n,"inactive"),M(r,"inactive")):(b(n,"inactive"),w(r,"inactive"))}},E=(t,i)=>{const o=e(i),c=new Set(a.get(o));for(const t of s)c.has(t)?g(t,"active"):g(t,"inactive");O(i);const{nativeEvent:l=!0}=t;l&&n.emit("legend:highlight",Object.assign(Object.assign({},t),{nativeEvent:l,data:{channel:r,value:o}}))},k=new Map;for(const t of i){const e=e=>{E(e,t)};t.addEventListener("pointerover",e),k.set(t,e)}const S=t=>{for(const t of s)m(t,"inactive","active");O(null);const{nativeEvent:e=!0}=t;e&&n.emit("legend:unhighlight",{nativeEvent:e})},A=t=>{const{nativeEvent:n,data:o}=t;if(n)return;const{channel:a,value:s}=o;if(a!==r)return;const c=i.find((t=>e(t)===s));c&&E({nativeEvent:!1},c)},_=t=>{const{nativeEvent:e}=t;e||S({nativeEvent:!1})};t.addEventListener("pointerleave",S),n.on("legend:highlight",A),n.on("legend:unhighlight",_);const T=()=>{t.removeEventListener(S),n.off("legend:highlight",A),n.off("legend:unhighlight",_);for(const[t,e]of k)t.removeEventListener(e)};h.push(T)}return()=>h.forEach((t=>t()))}}function Yj(t,e){const[n,r,i,o]=t,[a,s,c,l]=e;return!(a>i||c<n||s>o||l<r)}function Uj(t){const{width:e,height:n}=t.getBBox();return[0,0,e,n]}function qj(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}const Xj=Bm((t=>{const e=t.attributes,{x:n,y:r,width:i,height:o,class:a,renders:s={},handleSize:c=10,document:l}=e,u=Me(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=xr(Mr(u,"handleNW","handleNE"),"handleN"),{render:p=h}=d,g=Me(d,["render"]),m=xr(u,"handleE"),{render:y=h}=m,v=Me(m,["render"]),b=xr(Mr(u,"handleSE","handleSW"),"handleS"),{render:x=h}=b,w=Me(b,["render"]),M=xr(u,"handleW"),{render:O=h}=M,E=Me(M,["render"]),k=xr(u,"handleNW"),{render:S=h}=k,A=Me(k,["render"]),_=xr(u,"handleNE"),{render:T=h}=_,P=Me(_,["render"]),C=xr(u,"handleSE"),{render:N=h}=C,L=Me(C,["render"]),j=xr(u,"handleSW"),{render:R=h}=j,I=Me(j,["render"]),B=t=>()=>{const e=Bm((e=>((t,e)=>{const{id:n}=t,r=Me(t.attributes,["x","y"]),i=e(t,Object.assign({x:0,y:0},r),l);i.id=n,i.style.draggable=!0})(e,t)));return new e({})},D=vm(t).attr("className",a).style("x",n).style("y",r).style("draggable",!0);D.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(qj,Object.assign({width:i,height:o},Mr(u,"handle"))),D.maybeAppend("handle-n",B(p)).style("x",f).style("y",-f).style("width",i-c).style("height",c).style("fill","transparent").call(qj,g),D.maybeAppend("handle-e",B(y)).style("x",i-f).style("y",f).style("width",c).style("height",o-c).style("fill","transparent").call(qj,v),D.maybeAppend("handle-s",B(x)).style("x",f).style("y",o-f).style("width",i-c).style("height",c).style("fill","transparent").call(qj,w),D.maybeAppend("handle-w",B(O)).style("x",-f).style("y",f).style("width",c).style("height",o-c).style("fill","transparent").call(qj,E),D.maybeAppend("handle-nw",B(S)).style("x",-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(qj,A),D.maybeAppend("handle-ne",B(T)).style("x",i-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(qj,P),D.maybeAppend("handle-se",B(N)).style("x",i-f).style("y",o-f).style("width",c).style("height",c).style("fill","transparent").call(qj,L),D.maybeAppend("handle-sw",B(R)).style("x",-f).style("y",o-f).style("width",c).style("height",c).style("fill","transparent").call(qj,I)}));function Kj(t,e){var{brushed:n=(()=>{}),brushended:r=(()=>{}),brushcreated:i=(()=>{}),brushstarted:o=(()=>{}),brushupdated:a=(()=>{}),extent:s=Uj(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=Me(e,["brushed","brushended","brushcreated","brushstarted","brushupdated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let g=null,m=null,y=null,v=null,b=null,x=!1;const[w,M,O,E]=s;tj(t,"crosshair"),t.style.draggable=!0;const k=(t,e,n)=>{if(o(n),v&&v.remove(),b&&b.remove(),g=[t,e],l)return S();A()},S=()=>{b=new Up({style:Object.assign(Object.assign({},p),{fill:u,fillOpacity:f,stroke:h,pointerEvents:"none"})}),v=new Xj({style:{x:0,y:0,width:0,height:0,draggable:!0,document:t.ownerDocument},className:"mask"}),t.appendChild(b),t.appendChild(v)},A=()=>{v=new Xj({style:Object.assign(Object.assign({document:t.ownerDocument,x:0,y:0},p),{fill:u,fillOpacity:f,stroke:h,draggable:!0}),className:"mask"}),t.appendChild(v)},_=(t=!0)=>{v&&v.remove(),b&&b.remove(),g=null,m=null,y=null,x=!1,v=null,b=null,r(t)},T=(t,e,r=!0)=>{const[i,o,a,u]=function(t,e,n,r,i){const[o,a,s,c]=i;return[Math.max(o,Math.min(t,n)),Math.max(a,Math.min(e,r)),Math.min(s,Math.max(t,n)),Math.min(c,Math.max(e,r))]}(t[0],t[1],e[0],e[1],s),[f,h,d,p]=c(i,o,a,u,s);return l?C(f,h,d,p):P(f,h,d,p),n(f,h,d,p,r),[f,h,d,p]},P=(t,e,n,r)=>{v.style.x=t,v.style.y=e,v.style.width=n-t,v.style.height=r-e},C=(t,e,n,r)=>{b.style.d=`\n M${w},${M}L${O},${M}L${O},${E}L${w},${E}Z\n M${t},${e}L${t},${r}L${n},${r}L${n},${e}Z\n `,v.style.x=t,v.style.y=e,v.style.width=n-t,v.style.height=r-e},N={"handle-n":{vector:[0,1,0,0],cursor:"ns-resize"},"handle-e":{vector:[0,0,1,0],cursor:"ew-resize"},"handle-s":{vector:[0,0,0,1],cursor:"ns-resize"},"handle-w":{vector:[1,0,0,0],cursor:"ew-resize"},"handle-nw":{vector:[1,1,0,0],cursor:"nwse-resize"},"handle-ne":{vector:[0,1,1,0],cursor:"nesw-resize"},"handle-se":{vector:[0,0,1,1],cursor:"nwse-resize"},"handle-sw":{vector:[1,0,0,1],cursor:"nesw-resize"}},L=t=>R(t)||j(t),j=t=>{const{id:e}=t;return-1!==d.indexOf(e)&&new Set(Object.keys(N)).has(e)},R=t=>t===v.getElementById("selection"),I=e=>{const{target:n}=e,[r,i]=$L(t,e);if(!v||!L(n))return k(r,i,e),void(x=!0);L(n)&&(y=[r,i])},B=e=>{const{target:n}=e,r=$L(t,e);if(!g)return;if(!y)return T(g,r);if(R(n))return(t=>{const e=(t,e,n,r,i)=>t+e<r?r-e:t+n>i?i-n:t,n=t[0]-y[0],r=t[1]-y[1],i=e(n,g[0],m[0],w,O),o=e(r,g[1],m[1],M,E),a=[g[0]+i,g[1]+o],s=[m[0]+i,m[1]+o];T(a,s)})(r);const[i,o]=[r[0]-y[0],r[1]-y[1]],{id:a}=n;if(N[a]){const[t,e,n,r]=N[a].vector;return T([g[0]+i*t,g[1]+o*e],[m[0]+i*n,m[1]+o*r])}},D=e=>{if(y){y=null;const{x:t,y:n,width:r,height:i}=v.style;return g=[t,n],m=[t+r,n+i],void a(t,n,t+r,n+i,e)}m=$L(t,e);const[n,r,o,s]=T(g,m);x=!1,i(n,r,o,s,e)},F=t=>{const{target:e}=t;v&&!L(e)&&_()},z=e=>{const{target:n}=e;v&&L(n)&&!x?R(n)?tj(t,"move"):j(n)&&tj(t,N[n.id].cursor):tj(t,"crosshair")},G=()=>{tj(t,"default")};return t.addEventListener("dragstart",I),t.addEventListener("drag",B),t.addEventListener("dragend",D),t.addEventListener("click",F),t.addEventListener("pointermove",z),t.addEventListener("pointerleave",G),{mask:v,move(t,e,n,r,i=!0){v||k(t,e,{}),g=[t,e],m=[n,r],T([t,e],[n,r],i)},remove(t=!0){v&&_(t)},destroy(){v&&_(!1),tj(t,"default"),t.removeEventListener("dragstart",I),t.removeEventListener("drag",B),t.removeEventListener("dragend",D),t.removeEventListener("click",F),t.removeEventListener("pointermove",z),t.removeEventListener("pointerleave",G)}}}function Zj(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 Qj(t,e,n){return Zj(t,e,n).map((t=>t.options))}function Jj(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,m=Me(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const y=n(t),v=i(t),b=v.flatMap(n),x=KL(y,o),w=xr(m,"mask"),{setState:M,removeState:O}=UL(p,x),E=new Map,{width:k,height:S,x:A=0,y:_=0}=d(t),T=s||[0,0,k,S],P=()=>{for(const t of[...y,...b])O(t,"active","inactive")},C=(t,e,n,r)=>{var i;for(const t of v)null===(i=t.brush)||void 0===i||i.remove();const o=new Set;for(const i of y){const{min:a,max:s}=i.getLocalBounds(),[c,l]=a,[u,f]=s;Yj([c,l,u,f],[t,e,n,r])?(M(i,"active"),o.add(h(i))):M(i,"inactive")}for(const t of b)o.has(h(t))?M(t,"active"):M(t,"inactive")},N=()=>{for(const t of y)O(t,"inactive");for(const t of E.values())t.remove();E.clear()},L=(t,e,n,r)=>{const i=t=>{const e=t.cloneNode();return e.__data__=t.__data__,t.parentNode.appendChild(e),E.set(t,e),e};for(const o of y){const a=E.get(o)||i(o);a.style.clipPath=new Kp({style:{x:t+A,y:e+_,width:n-t,height:r-e}}),M(o,"inactive"),M(a,"active")}},j=Kj(t,Object.assign(Object.assign({},w),{extent:T,brushRegion:a,reverse:c,selectedHandles:r,brushended:t=>{const e=f?N:P;t&&g.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{const o=Bk(t,e,n,r,l,u);i&&g.emit("brush:highlight",{nativeEvent:!0,data:{selection:o}});(f?L:C)(t,e,n,r)},brushcreated:(t,e,n,r,i)=>{const o=Bk(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=Bk(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=Dk(o,r),c=Dk(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 B=j.destroy.bind(j);return j.destroy=()=>{g.off("brush:highlight",R),g.off("brush:remove",I),B()},j}function tR(t){var{facet:e,brushKey:n}=t,r=Me(t,["facet","brushKey"]);return(t,i,o)=>{const{container:a,view:s,options:c}=t,l=zL(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 Jj(l.parentNode.parentNode,Object.assign(Object.assign({elements:()=>DL(t,i),datum:YL(FL(t,i).map((t=>t.view))),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[n,a,s,c],state:XL(FL(t,i).map((t=>t.options)),f),emitter:o,scale:h,coordinate:d,selectedHandles:void 0},u),r))}const p=Jj(l,Object.assign(Object.assign({elements:BL,key:t=>t.__data__.key,siblings:()=>function(t,e,n){return Zj(t,e,n).map((t=>zL(t.container)))}(t,i,n),datum:YL([s,...Zj(t,i,n).map((t=>t.view))]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:XL([c,...Qj(t,i,n)],f),emitter:o,scale:h,coordinate:d,selectedHandles:void 0},u),r));return l.brush=p,()=>p.destroy()}}function eR(t,e,n,r,i){const[,o,,a]=i;return[t,o,n,a]}function nR(t){return tR(Object.assign(Object.assign({},t),{brushRegion:eR,selectedHandles:["handle-e","handle-w"]}))}function rR(t,e,n,r,i){const[o,,a]=i;return[o,e,a,r]}function iR(t){return tR(Object.assign(Object.assign({},t),{brushRegion:rR,selectedHandles:["handle-n","handle-s"]}))}const oR="axis",aR="axis-line",sR="axis-main-group",cR="axis-hot-area";function lR(t){return t.getElementsByClassName(oR)}function uR(t){return t.getElementsByClassName(aR)[0]}function fR(t){return function(t){return t.getElementsByClassName(sR)[0]}(t).getLocalBounds()}function hR(t,e){var{cross:n,offsetX:r,offsetY:i}=e,o=Me(e,["cross","offsetX","offsetY"]);const a=fR(t),s=uR(t),[c]=s.getLocalBounds().min,[l,u]=a.min,[f,h]=a.max,d=2*(f-l);return{brushRegion:rR,hotZone:new Kp({className:cR,style:Object.assign({x:n?l:c-d/2,width:n?d/2:d,y: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 dR(t,e){var{offsetY:n,offsetX:r,cross:i=!1}=e,o=Me(e,["offsetY","offsetX","cross"]);const a=fR(t),s=uR(t),[,c]=s.getLocalBounds().min,[l,u]=a.min,[f,h]=a.max,d=h-u;return{brushRegion:eR,hotZone:new Kp({className:cR,style:Object.assign({x:l,width:f-l,y:i?u:c-d,height:i?d:2*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 pR(t){return(e,n,r)=>{const{container:i,view:o,options:a}=e,s=zL(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=Me(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const p=r(t),g=n(t),m=KL(p,a),{setState:y,removeState:v}=UL(u,m),b=new Map,x=xr(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)))),M=g.map((t=>t.attributes.scale)),O=t=>t.length>2?[t[0],t[t.length-1]]:t,E=new Map,k=()=>{E.clear();for(let t=0;t<g.length;t++){const e=M[t],{domain:n}=e.getOptions();E.set(t,O(n))}};k();const S=(t,e)=>{const n=[];for(const t of p){const e=i(t);w(e)?(y(t,"active"),n.push(t)):y(t,"inactive")}E.set(t,_(n,t)),e&&f.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!T)return Array.from(E.values());const t=[];for(const[e,n]of E){const r=M[e],{name:i}=r.getOptions();"x"===i?t[0]=n:t[1]=n}return t})()}})},A=t=>{for(const t of p)v(t,"active","inactive");k(),t&&f.emit("brushAxis:remove",{nativeEvent:!0})},_=(t,e)=>{const n=M[e],{name:r}=n.getOptions(),i=t.map((t=>{const e=t.__data__;return n.invert(e[r])}));return O(Ik(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)?dR:hR,{hotZone:r,brushRegion:i,extent:a}=n(e,{offsetY:s,offsetX:c,cross:T,zIndex:999,fill:"transparent"});e.parentNode.appendChild(r);const u=Kj(r,Object.assign(Object.assign({},x),{reverse:l,brushRegion:i,brushended(n){b.delete(e),0===Array.from(b.entries()).length?A(n):S(t,n)},brushed(n,r,i,o,s){b.set(e,a(n,r,i,o)),S(t,s)}}));P.push(u)}const C=(t={})=>{const{nativeEvent:e}=t;e||P.forEach((t=>t.remove(!1)))},N=(t,e,n)=>{const[r,i]=t,a=L(r,e,n),s=L(i,e,n)+(t=>t.getStep?t.getStep():0)(e);return o(n)?[a,-1/0,s,1/0]:[-1/0,a,1/0,s]},L=(t,e,n)=>{const{height:r,width:i}=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=M[t];r.move(...N(e,n,i),!1)}else r.remove(!1)}};return f.on("brushAxis:remove",C),f.on("brushAxis:highlight",j),()=>{P.forEach((t=>t.destroy())),f.off("brushAxis:remove",C),f.off("brushAxis:highlight",j)}}(i,Object.assign({elements:BL,axes:lR,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:YL(o),state:XL(a,["active",["inactive",{opacity:.5}]]),coordinate:u,emitter:r},t))}}function gR(t){var{hideX:e=!0,hideY:n=!0}=t,r=Me(t,["hideX","hideY"]);return(t,i,o)=>{const{container:a,view:s,options:c,update:l,setState:u}=t,f=zL(a);let h=!1,d=!1,p=s;const{scale:g,coordinate:m}=s;return function(t,e){var{filter:n,reset:r,brushRegion:i,extent:o,reverse:a,emitter:s,scale:c,coordinate:l,selection:u,series:f=!1}=e;const h=xr(Me(e,["filter","reset","brushRegion","extent","reverse","emitter","scale","coordinate","selection","series"]),"mask"),{width:d,height:p}=t.getBBox(),g=o||[0,0,d,p],m=function(t=300){let e=null;return n=>{const{timeStamp:r}=n;return null!==e&&r-e<t?(e=r,!0):(e=r,!1)}}(),y=Kj(t,Object.assign(Object.assign({},h),{extent:g,brushRegion:i,reverse:a,brushcreated:function(t,e,r,i,o){o.nativeEvent=!0,n(u(t,e,r,i),o),y.remove()}}));function v(t){m(t)&&(t.nativeEvent=!0,r(t))}t.addEventListener("click",v);const b=({nativeEvent:t,data:e})=>{if(t)return;const{selection:r}=e;n(r,{nativeEvent:!1})};return s.on("brush:filter",b),()=>{y.destroy(),s.off("brush:filter",b),t.removeEventListener("click",v)}}(f,Object.assign(Object.assign({brushRegion:(t,e,n,r)=>[t,e,n,r],selection:(t,e,n,r)=>{const{scale:i,coordinate:o}=p;return Bk(t,e,n,r,i,o)},filter:(t,r)=>Ee(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=>X({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:m},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),r))}}function mR(t){return gR(Object.assign(Object.assign({hideX:!0},t),{brushRegion:eR}))}function yR(t){return gR(Object.assign(Object.assign({hideY:!0},t),{brushRegion:rR}))}const vR="slider";function bR(t,e,n,r=!1,i="x",o="y"){const{marks:a}=t,s=a.map((t=>{var a,s;return X({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 xR(t,e,n){const[r,i]=t,o=n?t=>1-t:t=>t;return Ik(e,[Rk(e,o(r),!0),Rk(e,o(i),!1)])}function wR(t){return[t[0],t[t.length-1]]}function MR({initDomain:t={},className:e=vR,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,m=h.getElementsByClassName(e);if(!m.length)return()=>{};let y=!1;const{scale:v,coordinate:b,layout:x}=d,{paddingLeft:w,paddingTop:M,paddingBottom:O,paddingRight:E}=x,{x:k,y:S}=v,A=Uc(b),_=t=>{const e="vertical"===t?"y":"x",n="vertical"===t?"x":"y";return A?[n,e]:[e,n]},T=new Map,P=new Set,C={x:t.x||k.getOptions().domain,y:t.y||S.getOptions().domain};for(const t of m){const{orientation:e}=t.attributes,[l,u]=_(e),h=`${n}${G(l)}:filter`,d="x"===l,{ratio:m}=k.getOptions(),{ratio:b}=S.getOptions(),x=t=>{if(t.data){const{selection:e}=t.data,[n=wR(C.x),r=wR(C.y)]=e;return d?[Ik(k,n,m),Ik(S,r,b)]:[Ik(S,r,b),Ik(k,n,m)]}const{value:n}=t.detail;return[xR(n,v[l],A&&"horizontal"===e),C[u]]},N=nt((e=>Ee(this,void 0,void 0,(function*(){const{initValue:r=!1}=e;if(y&&!r)return;y=!0;const{nativeEvent:o=!0}=e,[a,s]=x(e);if(C[l]=a,C[u]=s,o){const t=d?a:s,n=d?s:a;f.emit(h,Object.assign(Object.assign({},e),{nativeEvent:o,data:{selection:[wR(t),wR(n)]}}))}g(t,(t=>Object.assign(Object.assign({},bR(t,{[l]:{domain:a,nice:!1}},n,i,l,u)),{paddingLeft:w,paddingTop:M,paddingBottom:O,paddingRight:E}))),yield p(),y=!1}))),o,{leading:a,trailing:s}),L=e=>{const{nativeEvent:n}=e;if(n)return;const{data:i}=e,{selection:o}=i,[a,s]=o;t.dispatchEvent(new np("valuechange",{data:i,nativeEvent:!1}));const c=d?Dk(a,k):Dk(s,S);r(t,c)};f.on(h,L),t.addEventListener("valuechange",N),T.set(t,N),P.add([h,L]);const j=c(t);j&&t.dispatchEvent(new np("valuechange",{detail:{value:j},nativeEvent:!1,initValue:!0}))}return p(),()=>{for(const[t,e]of T)t.removeEventListener("valuechange",e);for(const[t,e]of P)f.off(t,e)}}}const OR="g2-scrollbar";function ER(t={}){return(e,n,r)=>{const{view:i,container:o}=e;if(!o.getElementsByClassName(OR).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 MR(Object.assign(Object.assign({},t),{initDomain:l,className:OR,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 kR(t,e,n){return`<${t} style="${Object.entries(n).map((([t,e])=>{return`${n=t,n.replace(/([A-Z])/g,"-$1").toLowerCase()}:${e}`;var n})).join(";")}">${e}</${t}>`}const SR={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 AR(t){return"text"===t.nodeName&&!!t.isOverflowing()}function _R(t){var{offsetX:e=8,offsetY:n=8}=t,r=Me(t,["offsetX","offsetY"]);return t=>{const{container:i}=t,[o,a]=i.getBounds().min,s=xr(r,"tip"),c=new Set,l=t=>{const{target:r}=t;if(!AR(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 Hp({className:"poptip",style:{innerHTML:kR("div",d,Object.assign(Object.assign({},SR),s)),x:f,y:h}});i.appendChild(p),r.tip=p,c.add(p)},u=t=>{const{target:e}=t;AR(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()))}}}_R.props={reapplyWhenUpdate:!0};const TR=t=>t.querySelectorAll(".element");const PR={breadCrumbFill:"rgba(0, 0, 0, 0.85)",breadCrumbFontSize:12,breadCrumbY:12,activeFill:"rgba(0, 0, 0, 0.5)"};function CR(t={}){const{originData:e=[],layout:n}=t,r=Me(t,["originData","layout"]),i=X({},PR,r),o=xr(i,"breadCrumb"),a=xr(i,"active");return t=>{const{update:r,setState:i,container:s,options:c}=t,l=function(t){return vm(t).select(`.${bS}`).node()}(s),u=c.marks[0],{state:f}=u,h=new $p;l.appendChild(h);const d=(t,c)=>Ee(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 Zp({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 Zp({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===it(t)-1&&u.remove(),l}));c.forEach(((t,e)=>{if(e===it(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(Q(t,["style","path"]),Q(t,["style","depth"]))}))}))}!function(t,e){[...Fj(t),...zj(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=Q(t,["id"]);return e&&(e.match(`${o}/`)||o.match(e))})).map((t=>({value:0===t.height?Q(t,["value"]):void 0,name:Q(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=NO(t,l,{value:"value"})[0]}else r=e.filter((t=>1===t.depth));const i=[];return r.forEach((({path:t})=>{i.push(C(t))})),X({},t,{data:r,scale:{color:{domain:i}}})}));return Object.assign(Object.assign({},r),{marks:a})})),yield r(void 0,["legendFilter"])})),p=t=>{const n=t.target;if("rect"!==Q(n,["markType"]))return;const r=Q(n,["__data__","key"]),i=S(e,(t=>t.id===r));Q(i,"height")&&d(Q(i,"path"),Q(i,"depth"))};l.addEventListener("click",p);const g=O(Object.assign(Object.assign({},f.active),f.inactive)),m=()=>{TR(l).forEach((t=>{const n=Q(t,["style","cursor"]),r=S(e,(e=>e.id===Q(t,["__data__","key"])));if("pointer"!==n&&(null==r?void 0:r.height)){t.style.cursor="pointer";const e=tt(t.attributes,g);t.addEventListener("mouseenter",(()=>{t.attr(f.active)})),t.addEventListener("mouseleave",(()=>{t.attr(X(e,f.inactive))}))}}))};return m(),l.addEventListener("mousemove",m),()=>{h.remove(),l.removeEventListener("click",p),l.removeEventListener("mousemove",m)}}}function NR(t){const{min:e,max:n}=t;return[[e[0],e[1]],[n[0],n[1]]]}function LR(t,e){const[n,r]=t,[i,o]=e;return n>=i[0]&&n<=o[0]&&r>=i[1]&&r<=o[1]}const jR=t=>{const{priority:e}=t;return t=>{const n=[];return e&&t.sort(e),t.forEach((t=>{IL(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]}(NR(e),NR(t.getLocalBounds()))));r?RL(t):n.push(t)})),t}};function RR([t,e],[n,r]){return r>t&&e>n}function IR(){const t=new Map;return[e=>t.get(e),(e,n)=>t.set(e,n)]}function BR(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 DR=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]=IR(),[s,c]=IR(),[l,u]=IR(),[f,h]=IR();for(const e of t){const{min:t,max:n}=BR(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)=>On(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])&&!RR(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 FR(t){let e=t/255;return e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),e}function zR(t,e,n){return.2126*FR(t)+.7152*FR(e)+.0722*FR(n)}function GR(t,e){const{r:n,g:r,b:i}=t,{r:o,g:a,b:s}=e,c=zR(n,r,i),l=zR(o,a,s);return(Math.max(c,l)+.05)/(Math.min(c,l)+.05)}function WR(t,e){const n=ir(e,(e=>GR(t,function(t){return"object"==typeof t?t:Rf(t)}(e))));return e[n]}const $R=t=>{const{threshold:e=4.5,palette:n=["#000","#fff"]}=t;return t=>(t.forEach((t=>{const r=t.attr("dependentElement").parsedStyle.fill;GR(t.parsedStyle.fill,r)<e&&t.attr("fill",WR(r,n))})),t)},HR=()=>t=>(t.forEach((t=>{IL(t);const e=t.attr("bounds"),n=function(t,e){const[n,r]=t;return!(LR(n,e)&&LR(r,e))}(NR(t.getLocalBounds()),e);n&&RL(t)})),t);function VR(){return{"data.fetch":$O,"data.inline":ZO,"data.sortBy":KO,"data.sort":UO,"data.filter":YO,"data.pick":qO,"data.rename":XO,"data.fold":HO,"data.slice":nE,"data.custom":QO,"data.map":JO,"data.join":eE,"data.kde":aE,"data.log":sE,"transform.stackY":Wr,"transform.binX":Rs,"transform.bin":js,"transform.dodgeX":hi,"transform.jitter":Ha,"transform.jitterX":Va,"transform.jitterY":Ya,"transform.symmetryY":Ua,"transform.diffY":qa,"transform.stackEnter":di,"transform.normalizeY":pi,"transform.select":Ja,"transform.selectX":ts,"transform.selectY":es,"transform.groupX":ds,"transform.groupY":ps,"transform.groupColor":gs,"transform.group":hs,"transform.sortX":vs,"transform.sortY":xs,"transform.sortColor":bs,"transform.flexX":ws,"transform.pack":Cs,"transform.sample":Bs,"transform.filter":Ds,"coordinate.cartesian":e,"coordinate.polar":r,"coordinate.transpose":i,"coordinate.theta":o,"coordinate.parallel":c,"coordinate.fisheye":l,"coordinate.radial":s,"coordinate.radar":u,"encode.constant":f,"encode.field":d,"encode.transform":h,"encode.column":p,"mark.interval":gM,"mark.rect":yM,"mark.line":wM,"mark.point":OM,"mark.text":kM,"mark.cell":AM,"mark.area":TM,"mark.link":CM,"mark.image":LM,"mark.polygon":RM,"mark.box":BM,"mark.vector":FM,"mark.lineX":$M,"mark.lineY":GM,"mark.connector":VM,"mark.range":XM,"mark.rangeX":ZM,"mark.rangeY":JM,"mark.path":eO,"mark.shape":LO,"mark.density":lE,"mark.heatmap":fE,"palette.category10":hE,"palette.category20":dE,"scale.linear":gE,"scale.ordinal":mE,"scale.band":pE,"scale.identity":yE,"scale.point":vE,"scale.time":bE,"scale.log":xE,"scale.pow":wE,"scale.sqrt":kE,"scale.threshold":ME,"scale.quantile":OE,"scale.quantize":EE,"scale.sequential":SE,"scale.constant":AE,"theme.classic":CE,"theme.classicDark":jE,"theme.academy":IE,"theme.light":PE,"theme.dark":LE,"component.axisX":pk,"component.axisY":gk,"component.legendCategory":wk,"component.legendContinuous":Sk,"component.legends":Yk,"component.title":Lk,"component.sliderX":Gk,"component.sliderY":Wk,"component.scrollbarX":Hk,"component.scrollbarY":Vk,"animation.scaleInX":Uk,"animation.scaleOutX":qk,"animation.scaleInY":Xk,"animation.scaleOutY":Kk,"animation.waveIn":lS,"animation.fadeIn":Zk,"animation.fadeOut":Qk,"animation.zoomIn":uS,"animation.zoomOut":fS,"animation.pathIn":hS,"animation.morphing":cS,"animation.growInX":dS,"animation.growInY":pS,"interaction.elementHighlight":ij,"interaction.elementHighlightByX":oj,"interaction.elementHighlightByColor":aj,"interaction.elementSelect":cj,"interaction.elementSelectByX":lj,"interaction.elementSelectByColor":uj,"interaction.fisheye":hj,"interaction.chartIndex":fj,"interaction.tooltip":Pj,"interaction.legendFilter":Hj,"interaction.legendHighlight":Vj,"interaction.brushHighlight":tR,"interaction.brushXHighlight":nR,"interaction.brushYHighlight":iR,"interaction.brushAxisHighlight":pR,"interaction.brushFilter":gR,"interaction.brushXFilter":mR,"interaction.brushYFilter":yR,"interaction.sliderFilter":MR,"interaction.scrollbarFilter":ER,"interaction.poptip":_R,"interaction.treemapDrillDown":CR,"composition.spaceLayer":P_,"composition.spaceFlex":C_,"composition.facetRect":U_,"composition.repeatMatrix":J_,"composition.facetCircle":oT,"composition.timingKeyframe":sT,"labelTransform.overlapHide":jR,"labelTransform.overlapDodgeY":DR,"labelTransform.overflowHide":HR,"labelTransform.contrastReverse":$R}}function YR(t,e){return class extends t{constructor(t){super(Object.assign(Object.assign({},t),{lib:e}))}}}const UR={};const qR=t=>t?parseInt(t):0;function XR(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 KR{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 XR(this,(n=>{t===n.attr("key")&&(e=n)})),e}getNodesByType(t){const e=[];return XR(this,(n=>{t===n.type&&e.push(n)})),e}getNodeByType(t){let e=null;return XR(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 ZR=["width","height","depth","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title"],QR="__remove__",JR="__callback__";function tI(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function eI(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||qR(e.width),r=t.clientHeight||qR(e.height);return{width:n-(qR(e.paddingLeft)+qR(e.paddingRight)),height:r-(qR(e.paddingTop)+qR(e.paddingBottom))}}(e);a=t||a,s=n||s}return a=n||a,s=r||s,{width:Math.max(L(a)?a:1,1),height:Math.max(L(s)?s:1,1),depth:o}}function nI(t){const e=function(t){if(null!==t.type)return t;const e=t.children[t.children.length-1];for(const n of ZR)e.attr(n,t.attr(n));return e}(t),n=[e],r=new Map;for(r.set(e,tI(e));n.length;){const t=n.pop(),e=r.get(t),{children:i=[]}=t;for(const t of i)if(t.type===JR)e.children=t.value;else{const i=tI(t),{children:o=[]}=e;o.push(i),n.push(t),r.set(t,i),e.children=o}}return r.get(e)}function rI(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 ZR)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 ZR)void 0!==n[e]&&(t[e]=n[e],delete n[e]);return Object.assign(Object.assign({},t),{children:[n]})}return e}function iI(t,e,n){if("function"==typeof t){const e=new KR;return e.value=t,e.type=JR,e}const{type:r,children:i}=t,o=Me(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 oI(t,e){const{type:n,children:r}=e,i=Me(e,["type","children"]);t.type===n||void 0===n?Sr(t.value,i):"string"==typeof n&&(t.type=n,t.value=i)}function aI(t,e,n,r){if(!t)return;const i=[[t,e]];for(;i.length;){const[t,e]=i.shift(),o=iI(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 sI(t,e,{key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function cI(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 lI(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 uI(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(Er(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 fI(t,e,{ctor:n}){t.prototype[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}function hI(t,e,{ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}function dI(t){return e=>{for(const[n,r]of Object.entries(t)){const{type:t}=r;"value"===t?sI(e,n,r):"array"===t?cI(e,n,r):"object"===t?lI(e,n,r):"node"===t?fI(e,n,r):"container"===t?hI(e,n,r):"mix"===t&&uI(e,n)}return e}}function pI(t){return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,{type:"node",ctor:e}])))}const gI={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"}},mI=Object.assign(Object.assign({},gI),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),yI=Object.assign(Object.assign({},gI),{labelTransform:{type:"array"}});let vI=class extends KR{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()&&IL(t)}hide(){const t=this.getGroup();t&&t.isVisible()&&RL(t)}};vI=Oe([dI(yI)],vI);let bI=class extends KR{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)}};bI=Oe([dI(mI)],bI);const xI="G2_CHART_KEY";class wI extends vI{constructor(t){const{container:e,canvas:n,renderer:r,plugins:i,lib:o}=t;super(Me(t,["container","canvas","renderer","plugins","lib"]),"view"),this._hasBindAutoFit=!1,this._rendering=!1,this._trailing=!1,this._trailingResolve=null,this._trailingReject=null,this._previousDefinedType=null,this._onResize=Y((()=>{this.forceFit()}),300),this._renderer=r||new mA,this._plugins=i||[],this._container=function(t){if(void 0===t){const t=document.createElement("div");return t[QR]=!0,t}if("string"==typeof t)return document.getElementById(t);return t}(e),this._emitter=new xA,this._context={library:Object.assign(Object.assign({},o),UR),emitter:this._emitter,canvas:n},this._create()}render(){if(this._rendering)return this._addToTrailing();this._context.canvas||this._createCanvas(),this._context.canvas.getConfig().supportsCSSTransform=!0,this._bindAutoFit(),this._rendering=!0;const t=new Promise(((t,e)=>PL(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 nI(this);const{type:e}=t;return e&&(this._previousDefinedType=e),function(t,e,n,r,i){const o=[[null,t,rI(t,e,n,r,i)]];for(;o.length;){const[t,e,n]=o.shift();if(e)if(n){oI(e,n);const{children:t}=n,{children:r}=e;if(Array.isArray(t)&&Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;i<n;i++){const n=t[i],a=r[i];o.push([e,a,n])}}else"function"==typeof t&&o.push([e,null,t])}else e.remove();else aI(t,n,r,i)}}(this,t,this._previousDefinedType,this._marks,this._compositions),this}getContainer(){return this._container}getContext(){return this._context}on(t,e,n){return this._emitter.on(t,e,n),this}once(t,e){return this._emitter.once(t,e),this}emit(t,...e){return this._emitter.emit(t,...e),this}off(t,e){return this._emitter.off(t,e),this}clear(){this.options();this.emit(wA.BEFORE_CLEAR),this._reset(),CL(0,this._context,!1),this.emit(wA.AFTER_CLEAR)}destroy(){this.options();this.emit(wA.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),CL(0,this._context,!0),this._container[QR]&&function(t){const e=t.parentNode;e&&e.removeChild(t)}(this._container),this.emit(wA.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;const{width:t,height:e}=eI(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(wA.BEFORE_CHANGE_SIZE);const n=this.render();return n.then((()=>{this.emit(wA.AFTER_CHANGE_SIZE)})),n}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(wA.BEFORE_CHANGE_SIZE),this.attr("width",t),this.attr("height",e);const n=this.render();return n.then((()=>{this.emit(wA.AFTER_CHANGE_SIZE)})),n}_create(){const{library:t}=this._context,e=["mark.mark",...Object.keys(t).filter((t=>t.startsWith("mark.")||"component.axisX"===t||"component.axisY"===t||"component.legends"===t))];this._marks={};for(const t of e){const e=t.split(".").pop();class n extends bI{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 vI{constructor(){super({},e)}};return n=Oe([dI(pI(this._marks))],n),[e,n]})));for(const t of Object.values(this._compositions))dI(pI(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=xI}=t,{width:n,height:r,depth:i}=eI(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}=eI(this.options(),this._container);this._plugins.push(new vA),this._plugins.forEach((t=>this._renderer.registerPlugin(t))),this._context.canvas=new fg({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))}}Op.enableCSSParsing=!1;const MI=YR(wI,Object.assign({},VR()));t.AREA_CLASS_NAME=MS,t.Academy=IE,t.Bin=js,t.BinX=Rs,t.COMPONENT_CLASS_NAME=xS,t.Chart=MI,t.ChartEvent=wA,t.Classic=CE,t.ClassicDark=jE,t.Dark=LE,t.DiffY=qa,t.DodgeX=hi,t.ELEMENT_CLASS_NAME=yS,t.Filter=Ds,t.FlexX=ws,t.Group=hs,t.GroupColor=gs,t.GroupX=ds,t.GroupY=ps,t.Jitter=Ha,t.JitterX=Va,t.JitterY=Ya,t.LABEL_CLASS_NAME=wS,t.LABEL_LAYER_CLASS_NAME=mS,t.Light=PE,t.LinearAxis=hk,t.MAIN_LAYER_CLASS_NAME=gS,t.MASK_CLASS_NAME="mask",t.MaybeDefaultX=ii,t.MaybeDefaultY=oi,t.MaybeFunctionAttribute=li,t.MaybeGradient=fi,t.MaybeIdentityX=ri,t.MaybeIdentityY=ni,t.MaybeKey=Qr,t.MaybeSeries=Jr,t.MaybeSize=Zr,t.MaybeStackY=Hr,t.MaybeTitle=Ur,t.MaybeTooltip=ai,t.MaybeTuple=ui,t.MaybeTupleX=ei,t.MaybeTupleY=ti,t.MaybeVisualPosition=ci,t.MaybeZeroPadding=si,t.MaybeZeroX=qr,t.MaybeZeroY=Xr,t.MaybeZeroY1=Mn,t.MaybeZeroZ=Kr,t.NormalizeY=pi,t.PLOT_CLASS_NAME=bS,t.Pack=Cs,t.Runtime=wI,t.Sample=Bs,t.Select=Ja,t.SelectX=ts,t.SelectY=es,t.Selection=bm,t.SortColor=bs,t.SortX=vs,t.SortY=xs,t.StackEnter=di,t.StackY=Wr,t.SymmetryY=Ua,t.VIEW_CLASS_NAME=vS,t.corelib=VR,t.extend=YR,t.register=function(t,e){Object.assign(UR,{[t]:e})},t.render=PL,t.renderToMountedElement=function(t,e={},n=(()=>{}),r=(t=>{throw t})){var i;const{width:o=640,height:a=480}=t,s=_L(t),{group:c=new $p,emitter:l=new xA,library:u}=e;(null==c?void 0:c.parentElement)||mr("renderToMountedElement can't render chart to unmounted group.");const f=vm(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(wA.BEFORE_RENDER),eL(Object.assign(Object.assign({},s),{width:o,height:a}),f,u,e).then((()=>{var t;null===(t=e.canvas)||void 0===t||t.requestAnimationFrame((()=>{l.emit(wA.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),c},t.select=vm,Object.defineProperty(t,"__esModule",{value:!0})}));
|