@antv/g2 5.0.19 → 5.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/g2-lite.min.js +3 -3
  2. package/dist/g2.min.js +3 -3
  3. package/esm/api/chart.d.ts +13 -855
  4. package/esm/api/chart.js.map +1 -1
  5. package/esm/api/extend.d.ts +2 -1
  6. package/esm/api/extend.js.map +1 -1
  7. package/esm/api/library.d.ts +1 -0
  8. package/esm/data/index.d.ts +2 -0
  9. package/esm/data/index.js +1 -0
  10. package/esm/data/index.js.map +1 -1
  11. package/esm/data/log.d.ts +7 -0
  12. package/esm/data/log.js +11 -0
  13. package/esm/data/log.js.map +1 -0
  14. package/esm/interaction/brushFilter.js +18 -16
  15. package/esm/interaction/brushFilter.js.map +1 -1
  16. package/esm/interaction/chartIndex.js +25 -22
  17. package/esm/interaction/chartIndex.js.map +1 -1
  18. package/esm/interaction/fisheye.js +17 -13
  19. package/esm/interaction/fisheye.js.map +1 -1
  20. package/esm/interaction/legendFilter.js +32 -26
  21. package/esm/interaction/legendFilter.js.map +1 -1
  22. package/esm/interaction/sliderFilter.js +8 -9
  23. package/esm/interaction/sliderFilter.js.map +1 -1
  24. package/esm/interaction/tooltip.d.ts +1 -1
  25. package/esm/interaction/tooltip.js +39 -4
  26. package/esm/interaction/tooltip.js.map +1 -1
  27. package/esm/lib/core.d.ts +1 -0
  28. package/esm/lib/core.js +2 -1
  29. package/esm/lib/core.js.map +1 -1
  30. package/esm/lib/std.d.ts +1 -0
  31. package/esm/runtime/plot.js +21 -6
  32. package/esm/runtime/plot.js.map +1 -1
  33. package/esm/spec/dataTransform.d.ts +3 -2
  34. package/esm/spec/interaction.d.ts +2 -1
  35. package/lib/api/chart.d.ts +13 -855
  36. package/lib/api/chart.js.map +1 -1
  37. package/lib/api/extend.d.ts +2 -1
  38. package/lib/api/extend.js.map +1 -1
  39. package/lib/api/library.d.ts +1 -0
  40. package/lib/data/index.d.ts +2 -0
  41. package/lib/data/index.js +3 -1
  42. package/lib/data/index.js.map +1 -1
  43. package/lib/data/log.d.ts +7 -0
  44. package/lib/data/log.js +15 -0
  45. package/lib/data/log.js.map +1 -0
  46. package/lib/interaction/brushFilter.js +18 -16
  47. package/lib/interaction/brushFilter.js.map +1 -1
  48. package/lib/interaction/chartIndex.js +25 -22
  49. package/lib/interaction/chartIndex.js.map +1 -1
  50. package/lib/interaction/fisheye.js +17 -13
  51. package/lib/interaction/fisheye.js.map +1 -1
  52. package/lib/interaction/legendFilter.js +32 -26
  53. package/lib/interaction/legendFilter.js.map +1 -1
  54. package/lib/interaction/sliderFilter.js +8 -9
  55. package/lib/interaction/sliderFilter.js.map +1 -1
  56. package/lib/interaction/tooltip.d.ts +1 -1
  57. package/lib/interaction/tooltip.js +38 -3
  58. package/lib/interaction/tooltip.js.map +1 -1
  59. package/lib/lib/core.d.ts +1 -0
  60. package/lib/lib/core.js +1 -0
  61. package/lib/lib/core.js.map +1 -1
  62. package/lib/lib/std.d.ts +1 -0
  63. package/lib/runtime/plot.js +21 -6
  64. package/lib/runtime/plot.js.map +1 -1
  65. package/lib/spec/dataTransform.d.ts +3 -2
  66. package/lib/spec/interaction.d.ts +2 -1
  67. package/package.json +1 -1
  68. package/src/api/chart.ts +3 -3
  69. package/src/api/extend.ts +5 -3
  70. package/src/data/index.ts +2 -0
  71. package/src/data/log.ts +16 -0
  72. package/src/interaction/brushFilter.ts +31 -28
  73. package/src/interaction/chartIndex.ts +26 -23
  74. package/src/interaction/fisheye.ts +16 -12
  75. package/src/interaction/legendFilter.ts +45 -40
  76. package/src/interaction/sliderFilter.ts +15 -16
  77. package/src/interaction/tooltip.ts +47 -3
  78. package/src/lib/core.ts +2 -0
  79. package/src/runtime/plot.ts +22 -7
  80. package/src/spec/dataTransform.ts +5 -0
  81. package/src/spec/interaction.ts +3 -1
package/dist/g2.min.js CHANGED
@@ -1,10 +1,10 @@
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(l){"use strict";var S="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},T=function(t,e){return(T=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])}))(t,e)};function t(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}T(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var m=function(){return(m=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}).apply(this,arguments)};function at(t,e){var n={};for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n}function N(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(o=(a<3?i(o):3<a?i(e,n,o):i(e,n))||o);return 3<a&&o&&Object.defineProperty(e,n,o),o}function X(t,o,s,l){return new(s=s||Promise)(function(n,e){function r(t){try{a(l.next(t))}catch(t){e(t)}}function i(t){try{a(l.throw(t))}catch(t){e(t)}}function a(t){var e;t.done?n(t.value):((e=t.value)instanceof s?e:new s(function(t){t(e)})).then(r,i)}a((l=l.apply(t,o||[])).next())})}function R(r,i){var a,o,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},c={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function t(n){return function(t){var e=[n,t];if(a)throw new TypeError("Generator is already executing.");for(;l=c&&e[c=0]?0:l;)try{if(a=1,o&&(s=2&e[0]?o.return:e[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,e[1])).done)return s;switch(o=0,(e=s?[2&e[0],s.value]:e)[0]){case 0:case 1:s=e;break;case 4:return l.label++,{value:e[1],done:!1};case 5:l.label++,o=e[1],e=[0];continue;case 7:e=l.ops.pop(),l.trys.pop();continue;default:if(!(s=0<(s=l.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){l=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3]))l.label=e[1];else if(6===e[0]&&l.label<s[1])l.label=s[1],s=e;else{if(!(s&&l.label<s[2])){s[2]&&l.ops.pop(),l.trys.pop();continue}l.label=s[2],l.ops.push(e)}}e=i.call(r,l)}catch(t){e=[6,t],o=0}finally{a=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}}function I(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&r>=t.length?void 0:t)&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function j(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function O(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||((r=r||Array.prototype.slice.call(e,0,i))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function B(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))return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t);throw new TypeError("Cannot read private member from an object whose class did not declare it")}var D,F,e={exports:{}};function z(){}function W(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function G(t,e,n,r,i){if("function"!=typeof n)throw new TypeError("The listener must be a function");n=new W(n,r||t,i),r=F?F+e:e;return t._events[r]?t._events[r].fn?t._events[r]=[t._events[r],n]:t._events[r].push(n):(t._events[r]=n,t._eventsCount++),t}function H(t,e){0==--t._eventsCount?t._events=new z:delete t._events[e]}function V(){this._events=new z,this._eventsCount=0}n=e,D=Object.prototype.hasOwnProperty,F="~",Object.create&&(z.prototype=Object.create(null),(new z).__proto__||(F=!1)),V.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)D.call(t,e)&&n.push(F?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},V.prototype.listeners=function(t){var t=F?F+t:t,e=this._events[t];if(!e)return[];if(e.fn)return[e.fn];for(var n=0,r=e.length,i=new Array(r);n<r;n++)i[n]=e[n].fn;return i},V.prototype.listenerCount=function(t){t=F?F+t:t,t=this._events[t];return t?t.fn?1:t.length:0},V.prototype.emit=function(t,e,n,r,i,a){var o=F?F+t:t;if(!this._events[o])return!1;var s,l=this._events[o],c=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,n),!0;case 4:return l.fn.call(l.context,e,n,r),!0;case 5:return l.fn.call(l.context,e,n,r,i),!0;case 6:return l.fn.call(l.context,e,n,r,i,a),!0}for(f=1,s=new Array(c-1);f<c;f++)s[f-1]=arguments[f];l.fn.apply(l.context,s)}else for(var u,h=l.length,f=0;f<h;f++)switch(l[f].once&&this.removeListener(t,l[f].fn,void 0,!0),c){case 1:l[f].fn.call(l[f].context);break;case 2:l[f].fn.call(l[f].context,e);break;case 3:l[f].fn.call(l[f].context,e,n);break;case 4:l[f].fn.call(l[f].context,e,n,r);break;default:if(!s)for(u=1,s=new Array(c-1);u<c;u++)s[u-1]=arguments[u];l[f].fn.apply(l[f].context,s)}return!0},V.prototype.on=function(t,e,n){return G(this,t,e,n,!1)},V.prototype.once=function(t,e,n){return G(this,t,e,n,!0)},V.prototype.removeListener=function(t,e,n,r){t=F?F+t:t;if(this._events[t])if(e){var i=this._events[t];if(i.fn)i.fn!==e||r&&!i.once||n&&i.context!==n||H(this,t);else{for(var a=0,o=[],s=i.length;a<s;a++)(i[a].fn!==e||r&&!i[a].once||n&&i[a].context!==n)&&o.push(i[a]);o.length?this._events[t]=1===o.length?o[0]:o:H(this,t)}}else H(this,t);return this},V.prototype.removeAllListeners=function(t){return t?(t=F?F+t:t,this._events[t]&&H(this,t)):(this._events=new z,this._eventsCount=0),this},V.prototype.off=V.prototype.removeListener,V.prototype.addListener=V.prototype.on,V.prefixed=F,n.exports=V.EventEmitter=V;var Y=e.exports,q=1e-6,$="undefined"!=typeof Float32Array?Float32Array:Array;function U(){var t=new $(9);return $!=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 K=function(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],e=e[8],h=n[0],f=n[1],d=n[2],p=n[3],g=n[4],y=n[5],m=n[6],v=n[7],n=n[8];return t[0]=h*r+f*o+d*c,t[1]=h*i+f*s+d*u,t[2]=h*a+f*l+d*e,t[3]=p*r+g*o+y*c,t[4]=p*i+g*s+y*u,t[5]=p*a+g*l+y*e,t[6]=m*r+v*o+n*c,t[7]=m*i+v*s+n*u,t[8]=m*a+v*l+n*e,t};function Z(){var t=new $(16);return $!=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 Q(t){var e=new $(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 J(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 tt(t,e,n,r,i,a,o,s,l,c,u,h,f,d,p,g,y){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=l,t[8]=c,t[9]=u,t[10]=h,t[11]=f,t[12]=d,t[13]=p,t[14]=g,t[15]=y,t}function et(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 nt(t,e){var n,r,i,a,o,s;return t===e?(n=e[1],r=e[2],i=e[3],a=e[6],o=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]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s):(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]),t}function rt(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],y=e[14],e=e[15],m=n*s-r*o,v=n*l-i*o,b=n*c-a*o,x=r*l-i*s,w=r*c-a*s,M=i*c-a*l,O=u*g-h*p,k=u*y-f*p,E=u*e-d*p,S=h*y-f*g,A=h*e-d*g,_=f*e-d*y,T=m*_-v*A+b*S+x*E-w*k+M*O;return T?(t[0]=(s*_-l*A+c*S)*(T=1/T),t[1]=(i*A-r*_-a*S)*T,t[2]=(g*M-y*w+e*x)*T,t[3]=(f*w-h*M-d*x)*T,t[4]=(l*E-o*_-c*k)*T,t[5]=(n*_-i*E+a*k)*T,t[6]=(y*b-p*M-e*v)*T,t[7]=(u*M-f*b+d*v)*T,t[8]=(o*A-s*E+c*O)*T,t[9]=(r*E-n*A-a*O)*T,t[10]=(p*w-g*b+e*m)*T,t[11]=(h*b-u*w-d*m)*T,t[12]=(s*k-o*S-l*O)*T,t[13]=(n*S-r*k+i*O)*T,t[14]=(g*v-p*x-y*m)*T,t[15]=(u*x-h*v+f*m)*T,t):null}function it(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=t[10],f=t[11],d=t[12],p=t[13],g=t[14],t=t[15];return(e*o-n*a)*(h*t-f*g)-(e*s-r*a)*(u*t-f*p)+(e*l-i*a)*(u*g-h*p)+(n*s-r*o)*(c*t-f*d)-(n*l-i*o)*(c*g-h*d)+(r*l-i*s)*(c*p-u*d)}function ct(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],f=e[9],d=e[10],p=e[11],g=e[12],y=e[13],m=e[14],e=e[15],v=n[0],b=n[1],x=n[2],w=n[3];return t[0]=v*r+b*s+x*h+w*g,t[1]=v*i+b*l+x*f+w*y,t[2]=v*a+b*c+x*d+w*m,t[3]=v*o+b*u+x*p+w*e,v=n[4],b=n[5],x=n[6],w=n[7],t[4]=v*r+b*s+x*h+w*g,t[5]=v*i+b*l+x*f+w*y,t[6]=v*a+b*c+x*d+w*m,t[7]=v*o+b*u+x*p+w*e,v=n[8],b=n[9],x=n[10],w=n[11],t[8]=v*r+b*s+x*h+w*g,t[9]=v*i+b*l+x*f+w*y,t[10]=v*a+b*c+x*d+w*m,t[11]=v*o+b*u+x*p+w*e,v=n[12],b=n[13],x=n[14],w=n[15],t[12]=v*r+b*s+x*h+w*g,t[13]=v*i+b*l+x*f+w*y,t[14]=v*a+b*c+x*d+w*m,t[15]=v*o+b*u+x*p+w*e,t}function ut(t,e,n){var r,i,a,o,s,l,c,u,h,f,d,p,g=n[0],y=n[1],n=n[2];return e===t?(t[12]=e[0]*g+e[4]*y+e[8]*n+e[12],t[13]=e[1]*g+e[5]*y+e[9]*n+e[13],t[14]=e[2]*g+e[6]*y+e[10]*n+e[14],t[15]=e[3]*g+e[7]*y+e[11]*n+e[15]):(r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],f=e[9],d=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=f,t[10]=d,t[11]=p,t[12]=r*g+s*y+h*n+e[12],t[13]=i*g+l*y+f*n+e[13],t[14]=a*g+c*y+d*n+e[14],t[15]=o*g+u*y+p*n+e[15]),t}function ht(t,e,n){var r=n[0],i=n[1],n=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]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ft(t,e,n){var r=Math.sin(n),n=Math.cos(n),i=e[4],a=e[5],o=e[6],s=e[7],l=e[8],c=e[9],u=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]=i*n+l*r,t[5]=a*n+c*r,t[6]=o*n+u*r,t[7]=s*n+h*r,t[8]=l*n-i*r,t[9]=c*n-a*r,t[10]=u*n-o*r,t[11]=h*n-s*r,t}function dt(t,e,n){var r=Math.sin(n),n=Math.cos(n),i=e[0],a=e[1],o=e[2],s=e[3],l=e[8],c=e[9],u=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]=i*n-l*r,t[1]=a*n-c*r,t[2]=o*n-u*r,t[3]=s*n-h*r,t[8]=i*r+l*n,t[9]=a*r+c*n,t[10]=o*r+u*n,t[11]=s*r+h*n,t}function pt(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 gt(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 yt(t,e,n){var r=e[0],i=e[1],a=e[2],e=e[3],o=r+r,s=i+i,l=a+a,c=r*o,u=r*s,r=r*l,h=i*s,i=i*l,a=a*l,o=e*o,s=e*s,e=e*l;return t[0]=1-(h+a),t[1]=u+e,t[2]=r-s,t[3]=0,t[4]=u-e,t[5]=1-(c+a),t[6]=i+o,t[7]=0,t[8]=r+s,t[9]=i-o,t[10]=1-(c+h),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function mt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function vt(t,e){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],s=e[6],l=e[8],c=e[9],e=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(a,o,s),t[2]=Math.hypot(l,c,e),t}function bt(t,e){var n=new $(3),r=(vt(n,e),1/n[0]),i=1/n[1],n=1/n[2],a=e[0]*r,o=e[1]*i,s=e[2]*n,l=e[4]*r,c=e[5]*i,u=e[6]*n,r=e[8]*r,i=e[9]*i,e=e[10]*n,n=a+c+e,h=0;return 0<n?(h=2*Math.sqrt(1+n),t[3]=.25*h,t[0]=(u-i)/h,t[1]=(r-s)/h,t[2]=(o-l)/h):c<a&&e<a?(h=2*Math.sqrt(1+a-c-e),t[3]=(u-i)/h,t[0]=.25*h,t[1]=(o+l)/h,t[2]=(r+s)/h):e<c?(h=2*Math.sqrt(1+c-a-e),t[3]=(r-s)/h,t[0]=(o+l)/h,t[1]=.25*h,t[2]=(u+i)/h):(h=2*Math.sqrt(1+e-a-c),t[3]=(o-l)/h,t[0]=(r+s)/h,t[1]=(u+i)/h,t[2]=.25*h),t}function xt(t,e,n,r,i){var a=e[0],o=e[1],s=e[2],e=e[3],l=a+a,c=o+o,u=s+s,h=a*l,f=a*c,a=a*u,d=o*c,o=o*u,s=s*u,l=e*l,c=e*c,e=e*u,u=r[0],p=r[1],r=r[2],g=i[0],y=i[1],i=i[2],m=(1-(d+s))*u,v=(f+e)*u,u=(a-c)*u,f=(f-e)*p,e=(1-(h+s))*p,s=(o+l)*p,p=(a+c)*r,a=(o-l)*r,c=(1-(h+d))*r;return t[0]=m,t[1]=v,t[2]=u,t[3]=0,t[4]=f,t[5]=e,t[6]=s,t[7]=0,t[8]=p,t[9]=a,t[10]=c,t[11]=0,t[12]=n[0]+g-(m*g+f*y+p*i),t[13]=n[1]+y-(v*g+e*y+a*i),t[14]=n[2]+i-(u*g+s*y+c*i),t[15]=1,t}function wt(t,e){var n=e[0],r=e[1],i=e[2],e=e[3],a=n+n,o=r+r,s=i+i,n=n*a,l=r*a,r=r*o,c=i*a,u=i*o,i=i*s,a=e*a,o=e*o,e=e*s;return t[0]=1-r-i,t[1]=l+e,t[2]=c-o,t[3]=0,t[4]=l-e,t[5]=1-n-i,t[6]=u+a,t[7]=0,t[8]=c+o,t[9]=u-a,t[10]=1-n-r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Mt(t,e,n,r,i){e=1/Math.tan(e/2);return t[0]=e/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,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?(t[10]=(i+r)*(n=1/(r-i)),t[14]=2*i*r*n):(t[10]=-1,t[14]=-2*r),t}function Ot(t,e,n,r,i,a,o){var s=1/(e-n),l=1/(r-i),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*l,t[14]=(o+a)*c,t[15]=1,t}var kt=Ot;function Et(t,e,n,r,i,a,o){var s=1/(e-n),l=1/(r-i),o=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=o,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*l,t[14]=a*o,t[15]=1,t}function St(t,e,n,r){var i,a,o,s,l=e[0],c=e[1],e=e[2],u=r[0],h=r[1],r=r[2],f=n[0],d=n[1],n=n[2];return Math.abs(l-f)<q&&Math.abs(c-d)<q&&Math.abs(e-n)<q?et(t):(f=l-f,d=c-d,n=e-n,i=h*(n*=s=1/Math.hypot(f,d,n))-r*(d*=s),r=r*(f*=s)-u*n,u=u*d-h*f,(s=Math.hypot(i,r,u))?(i*=s=1/s,r*=s,u*=s):u=r=i=0,h=d*u-n*r,a=n*i-f*u,o=f*r-d*i,(s=Math.hypot(h,a,o))?(h*=s=1/s,a*=s,o*=s):o=a=h=0,t[0]=i,t[1]=h,t[2]=f,t[3]=0,t[4]=r,t[5]=a,t[6]=d,t[7]=0,t[8]=u,t[9]=o,t[10]=n,t[11]=0,t[12]=-(i*l+r*c+u*e),t[13]=-(h*l+a*c+o*e),t[14]=-(f*l+d*c+n*e),t[15]=1,t)}function At(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 _t=Object.freeze({__proto__:null,create:Z,clone:Q,copy:J,fromValues:function(t,e,n,r,i,a,o,s,l,c,u,h,f,d,p,g){var y=new $(16);return y[0]=t,y[1]=e,y[2]=n,y[3]=r,y[4]=i,y[5]=a,y[6]=o,y[7]=s,y[8]=l,y[9]=c,y[10]=u,y[11]=h,y[12]=f,y[13]=d,y[14]=p,y[15]=g,y},set:tt,identity:et,transpose:nt,invert:rt,adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],y=e[14],e=e[15];return t[0]=s*(f*e-d*y)-h*(l*e-c*y)+g*(l*d-c*f),t[1]=-(r*(f*e-d*y)-h*(i*e-a*y)+g*(i*d-a*f)),t[2]=r*(l*e-c*y)-s*(i*e-a*y)+g*(i*c-a*l),t[3]=-(r*(l*d-c*f)-s*(i*d-a*f)+h*(i*c-a*l)),t[4]=-(o*(f*e-d*y)-u*(l*e-c*y)+p*(l*d-c*f)),t[5]=n*(f*e-d*y)-u*(i*e-a*y)+p*(i*d-a*f),t[6]=-(n*(l*e-c*y)-o*(i*e-a*y)+p*(i*c-a*l)),t[7]=n*(l*d-c*f)-o*(i*d-a*f)+u*(i*c-a*l),t[8]=o*(h*e-d*g)-u*(s*e-c*g)+p*(s*d-c*h),t[9]=-(n*(h*e-d*g)-u*(r*e-a*g)+p*(r*d-a*h)),t[10]=n*(s*e-c*g)-o*(r*e-a*g)+p*(r*c-a*s),t[11]=-(n*(s*d-c*h)-o*(r*d-a*h)+u*(r*c-a*s)),t[12]=-(o*(h*y-f*g)-u*(s*y-l*g)+p*(s*f-l*h)),t[13]=n*(h*y-f*g)-u*(r*y-i*g)+p*(r*f-i*h),t[14]=-(n*(s*y-l*g)-o*(r*y-i*g)+p*(r*l-i*s)),t[15]=n*(s*f-l*h)-o*(r*f-i*h)+u*(r*l-i*s),t},determinant:it,multiply:ct,translate:ut,scale:ht,rotate:function(t,e,n,r){var i,a,o,s,l,c,u,h,f,d,p,g,y,m,v,b,x,w,M,O,k=r[0],E=r[1],r=r[2],S=Math.hypot(k,E,r);return S<q?null:(k*=S=1/S,E*=S,r*=S,S=Math.sin(n),n=Math.cos(n),a=e[0],o=e[1],s=e[2],l=e[3],c=e[4],u=e[5],h=e[6],f=e[7],d=e[8],p=e[9],g=e[10],y=e[11],v=k*E*(i=1-n)-r*S,b=E*E*i+n,x=r*E*i+k*S,w=k*r*i+E*S,M=E*r*i-k*S,O=r*r*i+n,t[0]=a*(n=k*k*i+n)+c*(m=E*k*i+r*S)+d*(r=r*k*i-E*S),t[1]=o*n+u*m+p*r,t[2]=s*n+h*m+g*r,t[3]=l*n+f*m+y*r,t[4]=a*v+c*b+d*x,t[5]=o*v+u*b+p*x,t[6]=s*v+h*b+g*x,t[7]=l*v+f*b+y*x,t[8]=a*w+c*M+d*O,t[9]=o*w+u*M+p*O,t[10]=s*w+h*M+g*O,t[11]=l*w+f*M+y*O,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:ft,rotateY:dt,rotateZ:function(t,e,n){var r=Math.sin(n),n=Math.cos(n),i=e[0],a=e[1],o=e[2],s=e[3],l=e[4],c=e[5],u=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]=i*n+l*r,t[1]=a*n+c*r,t[2]=o*n+u*r,t[3]=s*n+h*r,t[4]=l*n-i*r,t[5]=c*n-a*r,t[6]=u*n-o*r,t[7]=h*n-s*r,t},fromTranslation:pt,fromScaling:gt,fromRotation:function(t,e,n){var r,i=n[0],a=n[1],n=n[2],o=Math.hypot(i,a,n);return o<q?null:(i*=o=1/o,a*=o,n*=o,o=Math.sin(e),e=Math.cos(e),t[0]=i*i*(r=1-e)+e,t[1]=a*i*r+n*o,t[2]=n*i*r-a*o,t[3]=0,t[4]=i*a*r-n*o,t[5]=a*a*r+e,t[6]=n*a*r+i*o,t[7]=0,t[8]=i*n*r+a*o,t[9]=a*n*r-i*o,t[10]=n*n*r+e,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),e=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=e,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),e=Math.cos(e);return t[0]=e,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]=e,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),e=Math.cos(e);return t[0]=e,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=e,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:yt,fromQuat2:function(t,e){var n=new $(3),r=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=r*r+i*i+a*a+o*o;return 0<h?(n[0]=2*(s*o+u*r+l*a-c*i)/h,n[1]=2*(l*o+u*i+c*r-s*a)/h,n[2]=2*(c*o+u*a+s*i-l*r)/h):(n[0]=2*(s*o+u*r+l*a-c*i),n[1]=2*(l*o+u*i+c*r-s*a),n[2]=2*(c*o+u*a+s*i-l*r)),yt(t,e,n),t},getTranslation:mt,getScaling:vt,getRotation:bt,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],e=e[3],s=i*(u=i+i),l=i*(h=a+a),i=i*(f=o+o),c=a*h,a=a*f,o=o*f,u=e*u,h=e*h,e=e*f,f=r[0],d=r[1],r=r[2];return t[0]=(1-(c+o))*f,t[1]=(l+e)*f,t[2]=(i-h)*f,t[3]=0,t[4]=(l-e)*d,t[5]=(1-(s+o))*d,t[6]=(a+u)*d,t[7]=0,t[8]=(i+h)*r,t[9]=(a-u)*r,t[10]=(1-(s+c))*r,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:xt,fromQuat:wt,frustum:function(t,e,n,r,i,a,o){var s=1/(n-e),l=1/(i-r),c=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*l,t[10]=(o+a)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*c,t[15]=0,t},perspectiveNO:Mt,perspective:Mt,perspectiveZO:function(t,e,n,r,i){return e=1/Math.tan(e/2),t[0]=e/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,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?(t[10]=i*(n=1/(r-i)),t[14]=i*r*n):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),e=Math.tan(e.rightDegrees*Math.PI/180),s=2/(o+e),l=2/(i+a);return t[0]=s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(o-e)*s*.5,t[9]=(i-a)*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:Ot,ortho:kt,orthoZO:Et,lookAt:St,targetTo:function(t,e,n,r){var i=e[0],a=e[1],e=e[2],o=r[0],s=r[1],r=r[2],l=i-n[0],c=a-n[1],n=e-n[2],u=l*l+c*c+n*n,h=(0<u&&(l*=u=1/Math.sqrt(u),c*=u,n*=u),s*n-r*c);return 0<(u=h*h+(r=r*l-o*n)*r+(o=o*c-s*l)*o)&&(h*=u=1/Math.sqrt(u),r*=u,o*=u),t[0]=h,t[1]=r,t[2]=o,t[3]=0,t[4]=c*o-n*r,t[5]=n*h-l*o,t[6]=l*r-c*h,t[7]=0,t[8]=l,t[9]=c,t[10]=n,t[11]=0,t[12]=i,t[13]=a,t[14]=e,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:At,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],a=t[3],o=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],f=t[10],d=t[11],p=t[12],g=t[13],y=t[14],t=t[15],m=e[0],v=e[1],b=e[2],x=e[3],w=e[4],M=e[5],O=e[6],k=e[7],E=e[8],S=e[9],A=e[10],_=e[11],T=e[12],P=e[13],C=e[14],e=e[15];return Math.abs(n-m)<=q*Math.max(1,Math.abs(n),Math.abs(m))&&Math.abs(r-v)<=q*Math.max(1,Math.abs(r),Math.abs(v))&&Math.abs(i-b)<=q*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(a-x)<=q*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(o-w)<=q*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-M)<=q*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(l-O)<=q*Math.max(1,Math.abs(l),Math.abs(O))&&Math.abs(c-k)<=q*Math.max(1,Math.abs(c),Math.abs(k))&&Math.abs(u-E)<=q*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(h-S)<=q*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(f-A)<=q*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(d-_)<=q*Math.max(1,Math.abs(d),Math.abs(_))&&Math.abs(p-T)<=q*Math.max(1,Math.abs(p),Math.abs(T))&&Math.abs(g-P)<=q*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(y-C)<=q*Math.max(1,Math.abs(y),Math.abs(C))&&Math.abs(t-e)<=q*Math.max(1,Math.abs(t),Math.abs(e))},mul:ct,sub:At});function v(){var t=new $(3);return $!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Tt(t){var e=new $(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Pt(t){var e=t[0],n=t[1],t=t[2];return Math.hypot(e,n,t)}function Ct(t,e,n){var r=new $(3);return r[0]=t,r[1]=e,r[2]=n,r}function Lt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Nt(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function jt(t,e,n){t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2]}function Rt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function It(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Bt(t,e){var n=e[0],r=e[1],i=e[2],n=n*n+r*r+i*i;0<n&&(n=1/Math.sqrt(n)),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n}function Dt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Ft(t,e,n){var r=e[0],i=e[1],e=e[2],a=n[0],o=n[1],n=n[2];t[0]=i*n-e*o,t[1]=e*a-r*n,t[2]=r*o-i*a}function zt(t,e,n,r){var i=e[0],a=e[1],e=e[2];t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=e+r*(n[2]-e)}function Wt(t,e,n){var r=e[0],i=e[1],e=e[2],a=n[3]*r+n[7]*i+n[11]*e+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*e+n[12])/(a=a||1),t[1]=(n[1]*r+n[5]*i+n[9]*e+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*e+n[14])/a,t}function Gt(t,e,n){var r=e[0],i=e[1],e=e[2];t[0]=r*n[0]+i*n[3]+e*n[6],t[1]=r*n[1]+i*n[4]+e*n[7],t[2]=r*n[2]+i*n[5]+e*n[8]}function Ht(t,e){var n=t[0],r=t[1],t=t[2],i=e[0],a=e[1],e=e[2];return Math.abs(n-i)<=q*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(r-a)<=q*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(t-e)<=q*Math.max(1,Math.abs(t),Math.abs(e))}var Vt=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],e=e[2]-t[2];return Math.hypot(n,r,e)},Yt=Pt;function qt(){var t=new $(4);return $!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function $t(t,e,n){var r=e[0],i=e[1],a=e[2],e=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*e,t[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*e,t[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*e,t[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*e,t}function Ut(){var t=new $(4);return $!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Xt(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 Kt(t,e,n){var r=e[0],i=e[1],a=e[2],e=e[3],o=n[0],s=n[1],l=n[2],n=n[3];return t[0]=r*n+e*o+i*l-a*s,t[1]=i*n+e*s+a*o-r*l,t[2]=a*n+e*l+r*s-i*o,t[3]=e*n-r*o-i*s-a*l,t}function Zt(t,e){var n=e[0],r=e[1],i=e[2],e=e[3],a=n*n+r*r+i*i+e*e,a=a?1/a:0;return t[0]=-n*a,t[1]=-r*a,t[2]=-i*a,t[3]=e*a,t}function Qt(t,e,n,r){var i=.5*Math.PI/180,i=(e*=i,n*=i,r*=i,Math.sin(e)),e=Math.cos(e),a=Math.sin(n),n=Math.cos(n),o=Math.sin(r),r=Math.cos(r);t[0]=i*n*r-e*a*o,t[1]=e*a*r+i*n*o,t[2]=e*n*o-i*a*r,t[3]=e*n*r+i*a*o}v(),qt();var Jt=function(t,e,n,r){var i=new $(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},te=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},ee=Kt,ne=function(t,e){var n=e[0],r=e[1],i=e[2],e=e[3],a=n*n+r*r+i*i+e*e;return 0<a&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=e*a,t};v(),Ct(1,0,0),Ct(0,1,0),Ut(),Ut(),U(),n=new $(2),$!=Float32Array&&(n[0]=0,n[1]=0);var re={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};var ie={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function ae(t){return Array.isArray(t)&&t.every(function(t){var e=t[0].toLowerCase();return ie[e]===t.length-1&&"achlmqstvz".includes(e)})}function oe(t){return ae(t)&&t.every(function(t){t=t[0];return t===t.toUpperCase()})}function se(t){return oe(t)&&t.every(function(t){t=t[0];return"ACLMQZ".includes(t)})}function le(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=ie[n]&&("m"===n&&2<r.length?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,ie[n]))),ie[n]););}function ce(t){return 48<=t&&t<=57}function ue(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||5760<=e&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function he(t){var e,n,r,i,a,o=t.max,s=t.pathValue,l=t.index,c=s.charCodeAt(l),u=ie[s[l].toLowerCase()];if(t.segmentStart=l,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 1;default:return}}(c)){if(t.index+=1,ue(t),t.data=[],u)for(;;){for(var h=u;0<h;--h){if(97!=(32|c)||3!==h&&4!==h?function(t){var e,n,r=t.max,i=t.pathValue,a=t.index,o=a,s=!1,l=!1,c=!1;if(r<=o)t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param';else if(ce(n=43!==(n=i.charCodeAt(o))&&45!==n?n:i.charCodeAt(o+=1))||46===n){if(46!==n){if(e=48===n,n=i.charCodeAt(o+=1),e&&o<r&&n&&ce(n))return t.err="[path-util]: Invalid path value at index "+a+', "'+i[a]+'" illegal number';for(;o<r&&ce(i.charCodeAt(o));)o+=1,s=!0;n=i.charCodeAt(o)}if(46===n){for(c=!0,o+=1;ce(i.charCodeAt(o));)o+=1,l=!0;n=i.charCodeAt(o)}if(101===n||69===n){if(c&&!s&&!l)return t.err="[path-util]: Invalid path value at index "+o+', "'+i[o]+'" invalid float exponent';if(43!==(n=i.charCodeAt(o+=1))&&45!==n||(o+=1),!(o<r&&ce(i.charCodeAt(o))))return t.err="[path-util]: Invalid path value at index "+o+', "'+i[o]+'" invalid integer exponent';for(;o<r&&ce(i.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(a,o)}else t.err="[path-util]: Invalid path value at index "+o+', "'+i[o]+'" is not a number'}(t):(a=i=r=void 0,r=(n=t).index,i=n.pathValue,48===(a=i.charCodeAt(r))?(n.param=0,n.index+=1):49===a?(n.param=1,n.index+=1):n.err='[path-util]: invalid Arc flag "'+i[r]+'", expecting 0 or 1 at index '+r),t.err.length)return;t.data.push(t.param),ue(t),t.index<o&&44===s.charCodeAt(t.index)&&(t.index+=1,ue(t))}if(t.index>=t.max)break;if(!(48<=(e=s.charCodeAt(t.index))&&e<=57||43===e||45===e||46===e))break}le(t)}else t.err='[path-util]: Invalid path value "'+s[l]+'" is not a path command'}var fe=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 de(t){var o,s,l,c;return oe(t)?[].concat(t):(t=function(t){if(ae(t))return[].concat(t);var e=new fe(t);for(ue(e);e.index<e.max&&!e.err.length;)he(e);return e.err||e.segments}(t),c=l=s=o=0,t.map(function(t){var e=t.slice(1).map(Number),t=t[0],n=t.toUpperCase();if("M"===t)return o=e[0],s=e[1],["M",l=o,c=s];if(t!==n)switch(n){case"A":i=[n,e[0],e[1],e[2],e[3],e[4],e[5]+o,e[6]+s];break;case"V":i=[n,e[0]+s];break;case"H":i=[n,e[0]+o];break;default:var r=e.map(function(t,e){return t+(e%2?s:o)}),i=[n].concat(r)}else i=[n].concat(e);var a=i.length;switch(n){case"Z":o=l,s=c;break;case"H":o=i[1];break;case"V":s=i[1];break;default:o=i[a-2],s=i[a-1],"M"===n&&(l=o,c=s)}return i}))}function pe(t){if(se(t))return[].concat(t);for(var e,n,r,i,a,o,s,l=de(t),c=m({},re),u=0;u<l.length;u+=1){l[u]=(e=l[u],n=c,s=o=f=a=h=i=r=void 0,r=e[0],i=n.x1,h=n.y1,a=n.x2,f=n.y2,o=e.slice(1).map(Number),s=e,"TQ".includes(r)||(n.qx=null,n.qy=null),"H"===r?s=["L",e[1],h]:"V"===r?s=["L",i,e[1]]:"S"===r?(e=2*h-f,s=["C",n.x1=2*i-a,n.y1=e].concat(o)):"T"===r?(f=2*i-n.qx,a=2*h-n.qy,s=["Q",n.qx=f,n.qy=a].concat(o)):"Q"===r&&(e=o[0],i=o[1],n.qx=e,n.qy=i),s);var h=l[u],f=h.length;c.x1=+h[f-2],c.y1=+h[f-1],c.x2=+h[f-4]||c.x1,c.y2=+h[f-3]||c.y1}return l}function ge(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function ye(t,e,n,r,i,a,o,s,l,c){var u=120*Math.PI/180,h=Math.PI/180*(+i||0),f=[],d=(c?(b=c[0],x=c[1],m=c[2],v=c[3]):(t=(g=ge(t,e,-h)).x,e=g.y,1<(d=(p=(t-(s=(g=ge(s,l,-h)).x))/2)*p/(n*n)+(g=(e-(l=g.y))/2)*g/(r*r))&&(n*=d=Math.sqrt(d),r*=d),d=n*n,y=r*r,m=(a=(a===o?-1:1)*Math.sqrt(Math.abs((d*y-d*g*g-y*p*p)/(d*g*g+y*p*p))))*n*g/r+(t+s)/2,v=a*-r*p/n+(e+l)/2,b=Math.asin(((e-v)/r*Math.pow(10,9)>>0)/Math.pow(10,9)),x=Math.asin(((l-v)/r*Math.pow(10,9)>>0)/Math.pow(10,9)),b=t<m?Math.PI-b:b,x=s<m?Math.PI-x:x,b<0&&(b=2*Math.PI+b),x<0&&(x=2*Math.PI+x),o&&x<b&&(b-=2*Math.PI),!o&&b<x&&(x-=2*Math.PI)),x-b),p=(Math.abs(d)>u&&(y=x,g=s,a=l,x=b+u*(o&&b<x?1:-1),f=ye(s=m+n*Math.cos(x),l=v+r*Math.sin(x),n,r,i,0,o,g,a,[x,y,m,v])),d=x-b,Math.cos(b)),u=Math.sin(b),i=Math.cos(x),o=Math.sin(x),g=Math.tan(d/4),a=4/3*n*g,y=4/3*r*g,m=[t,e],v=[t+a*u,e-y*p],b=[s+a*o,l-y*i],x=[s,l];if(v[0]=2*m[0]-v[0],v[1]=2*m[1]-v[1],c)return v.concat(b,x,f);for(var w=[],M=0,O=(f=v.concat(b,x,f)).length;M<O;M+=1)w[M]=M%2?ge(f[M-1],f[M],h).y:ge(f[M],f[M+1],h).x;return w}function me(t,e,n){var r=t[0],t=t[1];return[r+(e[0]-r)*n,t+(e[1]-t)*n]}function ve(t,e,n,r){return O(O([],me([t,e],[n,r],.5),!0),[n,r,n,r],!1)}function be(t,e){var n;if(void 0===e&&(e=!1),se(n=t)&&n.every(function(t){t=t[0];return"MC".includes(t)}))return n=[].concat(t),e?[n,[]]:n;for(var r,i=pe(t),a=m({},re),o=[],s="",l=i.length,c=[],u=0;u<l;u+=1){i[u]&&(s=i[u][0]),o[u]=s;var h=function(t,e){var n,r,i,a,o,s,l=t[0],c=t.slice(1).map(Number),u=c[0],h=c[1],f=e.x1,d=e.y1,p=e.x,g=e.y;switch("TQ".includes(l)||(e.qx=null,e.qy=null),l){case"M":return e.x=u,e.y=h,t;case"A":return s=[f,d].concat(c),["C"].concat(ye(s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],s[8],s[9]));case"Q":return e.qx=u,e.qy=h,s=[f,d].concat(c),["C"].concat((n=s[0],r=s[1],i=s[2],a=s[3],o=s[4],s=s[5],[1/3*n+2/3*i,1/3*r+2/3*a,1/3*o+2/3*i,1/3*s+2/3*a,o,s]));case"L":return["C"].concat(ve(f,d,u,h));case"Z":return f===p&&d===g?["C",f,d,p,g,p,g]:["C"].concat(ve(f,d,p,g))}return t}(i[u],a),f=(i[u]=h,y=g=p=d=f=void 0,i),d=o,p=u;if(7<f[p].length){f[p].shift();for(var g=f[p],y=p;g.length;)d[p]="A",f.splice(y+=1,0,["C"].concat(g.splice(0,6)));f.splice(p,1)}l=i.length,"Z"===s&&c.push(u),r=(h=i[u]).length,a.x1=+h[r-2],a.y1=+h[r-1],a.x2=+h[r-4]||a.x1,a.y2=+h[r-3]||a.y1}return e?[i,c]:i}function xe(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function we(t,e,n,r,i){var a=xe([t,e],[n,r]),o={x:0,y:0};return{length:a,point:o="number"==typeof i?i<=0?{x:t,y:e}:a<=i?{x:n,y:r}:{x:(i=me([t,e],[n,r],i/a))[0],y:i[1]}:o,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function Me(t,e){var n=t.x,t=t.y,r=e.x,e=e.y,i=n*r+t*e,a=Math.sqrt((Math.pow(n,2)+Math.pow(t,2))*(Math.pow(r,2)+Math.pow(e,2)));return(n*e-t*r<0?-1:1)*Math.acos(i/a)}function Oe(t,e,n,r,i,I,B,a,o,s,l){var c=l.bbox,D=void 0===c||c,c=l.length,F=void 0===c||c,c=l.sampleSize,u=void 0===c?30:c,h="number"==typeof s,f=t,d=e,p=0,g=[f,d,p],y=[f,d],m={x:0,y:0},v=[{x:f,y:d}];h&&s<=0&&(m={x:f,y:d});for(var b,x,w,M,O,k,E,S,A,_,T,P,C,L,N,j,R=0;R<=u;R+=1)b=t,x=e,w=n,M=r,O=i,k=I,E=B,S=a,A=o,_=R/u,P=j=N=L=C=P=T=void 0,P=Math.abs,C=Math.sin,L=Math.cos,N=Math.sqrt,j=Math.PI,w=P(w),P=P(M),M=j/180*((O%360+360)%360),f=(T=b===S&&x===A?{x:b,y:x}:0===w||0===P?we(b,x,S,A,_).point:(O=(b-S)/2,T=(x-A)/2,O={x:L(M)*O+C(M)*T,y:-C(M)*O+L(M)*T},1<(T=Math.pow(O.x,2)/Math.pow(w,2)+Math.pow(O.y,2)/Math.pow(P,2))&&(w*=N(T),P*=N(T)),T=(Math.pow(w,2)*Math.pow(P,2)-Math.pow(w,2)*Math.pow(O.y,2)-Math.pow(P,2)*Math.pow(O.x,2))/(Math.pow(w,2)*Math.pow(O.y,2)+Math.pow(P,2)*Math.pow(O.x,2)),k=(k!==E?1:-1)*N(T<0?0:T),N=w*O.y/P*k,T=-P*O.x/w*k,k=L(M)*N-C(M)*T+(b+S)/2,b=C(M)*N+L(M)*T+(x+A)/2,x=Me({x:1,y:0},S={x:(O.x-N)/w,y:(O.y-T)/P}),A=Me(S,{x:(-O.x-N)/w,y:(-O.y-T)/P}),!E&&0<A?A-=2*j:E&&A<0&&(A+=2*j),S=x+(A%=2*j)*_,N=w*L(S),O=P*C(S),{x:L(M)*N-C(M)*O+k,y:C(M)*N+L(M)*O+b})).x,d=T.y,D&&v.push({x:f,y:d}),F&&(p+=xe(y,[f,d])),y=[f,d],h&&s<=p&&s>g[2]&&(E=(p-s)/(p-g[2]),m={x:y[0]*(1-E)+g[0]*E,y:y[1]*(1-E)+g[1]*E}),g=[f,d,p];return{length:p,point:m=h&&p<=s?{x:a,y:o}:m,min:{x:Math.min.apply(null,v.map(function(t){return t.x})),y:Math.min.apply(null,v.map(function(t){return t.y}))},max:{x:Math.max.apply(null,v.map(function(t){return t.x})),y:Math.max.apply(null,v.map(function(t){return t.y}))}}}function ke(t,e,n,r,i,a,o,s,l,c){var u=c.bbox,h=void 0===u||u,u=c.length,f=void 0===u||u,u=c.sampleSize,d=void 0===u?10:u,p="number"==typeof l,g=t,y=e,m=0,v=[g,y,m],b=[g,y],x={x:0,y:0},w=[{x:g,y:y}];p&&l<=0&&(x={x:g,y:y});for(var M,O,k,E,S,A,_,T,P,C,L=0;L<=d;L+=1)M=t,O=e,k=n,E=r,S=i,A=a,_=o,T=s,C=void 0,C=1-(P=L/d),g=(M={x:Math.pow(C,3)*M+3*Math.pow(C,2)*P*k+3*C*Math.pow(P,2)*S+Math.pow(P,3)*_,y:Math.pow(C,3)*O+3*Math.pow(C,2)*P*E+3*C*Math.pow(P,2)*A+Math.pow(P,3)*T}).x,y=M.y,h&&w.push({x:g,y:y}),f&&(m+=xe(b,[g,y])),b=[g,y],p&&l<=m&&l>v[2]&&(k=(m-l)/(m-v[2]),x={x:b[0]*(1-k)+v[0]*k,y:b[1]*(1-k)+v[1]*k}),v=[g,y,m];return{length:m,point:x=p&&m<=l?{x:o,y:s}:x,min:{x:Math.min.apply(null,w.map(function(t){return t.x})),y:Math.min.apply(null,w.map(function(t){return t.y}))},max:{x:Math.max.apply(null,w.map(function(t){return t.x})),y:Math.max.apply(null,w.map(function(t){return t.y}))}}}function Ee(t,e,n,r,i,a,o,s){var l=s.bbox,c=void 0===l||l,l=s.length,u=void 0===l||l,l=s.sampleSize,h=void 0===l?10:l,f="number"==typeof o,d=t,p=e,g=0,y=[d,p,g],m=[d,p],v={x:0,y:0},b=[{x:d,y:p}];f&&o<=0&&(v={x:d,y:p});for(var x,w,M,O,k,E,S,A,_=0;_<=h;_+=1)x=t,w=e,M=n,O=r,k=i,E=a,A=void 0,A=1-(S=_/h),d=(x={x:Math.pow(A,2)*x+2*A*S*M+Math.pow(S,2)*k,y:Math.pow(A,2)*w+2*A*S*O+Math.pow(S,2)*E}).x,p=x.y,c&&b.push({x:d,y:p}),u&&(g+=xe(m,[d,p])),m=[d,p],f&&o<=g&&o>y[2]&&(M=(g-o)/(g-y[2]),v={x:m[0]*(1-M)+y[0]*M,y:m[1]*(1-M)+y[1]*M}),y=[d,p,g];return{length:g,point:v=f&&g<=o?{x:i,y:a}:v,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,b.map(function(t){return t.x})),y:Math.max.apply(null,b.map(function(t){return t.y}))}}}function Se(t,e,n){for(var r,i,a,o=pe(t),s="number"==typeof e,l=[],c=0,u=0,h=0,f=0,d=[],p=[],g=0,y={x:0,y:0},m=y,v=y,b=y,x=0,w=0,M=o.length;w<M;w+=1)l=(r="M"===(i=(a=o[w])[0]))?l:[c,u].concat(a.slice(1)),r?(m=y={x:h=a[1],y:f=a[2]},g=0,s&&e<.001&&(b=y)):"L"===i?(g=(r=we(l[0],l[1],l[2],l[3],(e||0)-x)).length,y=r.min,m=r.max,v=r.point):"A"===i?(g=(r=Oe(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],l[8],(e||0)-x,n||{})).length,y=r.min,m=r.max,v=r.point):"C"===i?(g=(r=ke(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],(e||0)-x,n||{})).length,y=r.min,m=r.max,v=r.point):"Q"===i?(g=(r=Ee(l[0],l[1],l[2],l[3],l[4],l[5],(e||0)-x,n||{})).length,y=r.min,m=r.max,v=r.point):"Z"===i&&(g=(r=we((l=[c,u,h,f])[0],l[1],l[2],l[3],(e||0)-x)).length,y=r.min,m=r.max,v=r.point),s&&x<e&&e<=x+g&&(b=v),p.push(m),d.push(y),x+=g,c=(r="Z"!==i?a.slice(-2):[h,f])[0],u=r[1];return{length:x,point:b=s&&x<=e?{x:c,y:u}:b,min:{x:Math.min.apply(null,d.map(function(t){return t.x})),y:Math.min.apply(null,d.map(function(t){return t.y}))},max:{x:Math.max.apply(null,p.map(function(t){return t.x})),y:Math.max.apply(null,p.map(function(t){return t.y}))}}}function Ae(t){return(c=l=s=0)<=be(t).map(function(t){var e,n,r,i,a,o;return"M"===t[0]?(s=t[1],l=t[2],0):(o=t.slice(1),e=o[0],n=o[1],r=o[2],i=o[3],a=o[4],o=o[5],c=3*((o-l)*(e+r)-(a-s)*(n+i)+n*(s-r)-e*(l-i)+o*(r+s/3)-a*(i+l/3))/20,n=t.slice(-2),s=n[0],l=n[1],c)}).reduce(function(t,e){return t+e},0);var s,l,c}function _e(t){return t.map(function(t,e,n){var r,i,a,o,n=e&&n[e-1].slice(-2).concat(t.slice(1)),s=e?ke(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],{bbox:!1}).length:0,n=e?s?(void 0===r&&(r=.5),n=(e=n).slice(0,2),i=e.slice(2,4),a=e.slice(4,6),e=e.slice(6,8),n=me(n,i,r),i=me(i,a,r),a=me(a,e,r),o=me(n,i,r),i=me(i,a,r),r=me(o,i,r),[["C"].concat(n,o,r),["C"].concat(i,a,e)]):[t,t]:[t];return{s:t,ss:n,l:s}})}var Te=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},Pe=function(t){return"function"==typeof t},P=function(t){return null==t},Ce={}.toString,Le=function(t,e){return Ce.call(t)==="[object "+e+"]"},Ne=function(t){return Array.isArray?Array.isArray(t):Le(t,"Array")},je=function(t){var e=typeof t;return null!==t&&"object"==e||"function"==e};var Re=function(t){return"object"==typeof t&&null!==t},Ie=function(t){if(!Re(t)||!Le(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},Be=function(t){if(Ne(t))return t.reduce(function(t,e){return Math.max(t,e)},t[0])},De=function(t){if(Ne(t))return t.reduce(function(t,e){return Math.min(t,e)},t[0])},Fe=function(t,n,e){if(!Ne(t)&&!Ie(t))return t;var r=e,i=t,a=function(t,e){r=n(r,t,e)};if(i)if(Ne(i))for(var o=0,s=i.length;o<s&&!1!==a(i[o],o);o++);else if(je(i))for(var l in i)if(i.hasOwnProperty(l)&&!1===a(i[l],l))break;return r},ze=function(t){return Le(t,"String")};var We=function(t,e,n){return t<e?e:n<t?n:t},Ge=function(t){return Le(t,"Number")};function He(t,e,n){return void 0===n&&(n=1e-5),Math.abs(t-e)<n}function Ve(t){return P(t)?"":t.toString()}var Ye=function(t,e){return(t%e+e)%e},qe=function(t){t=Ve(t);return t.charAt(0).toLowerCase()+t.substring(1)};function $e(t){if("object"!=typeof t||null===t)return t;if(Ne(t))for(var e=[],n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=$e(t[n]):e[n]=t[n];else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=$e(t[i]):e[i]=t[i];return e}var Ue=function(t){t=Ve(t);return t.charAt(0).toUpperCase()+t.substring(1)},Xe=function(t){return Le(t,"Boolean")},Ke=function(t){return void 0===t},Ze=$e;function Qe(r,i,a){var o;return function(){var t=this,e=arguments,n=a&&!o;clearTimeout(o),o=setTimeout(function(){o=null,a||r.apply(t,e)},i),n&&r.apply(t,e)}}function Je(a,o){var s;if(Pe(a))return(s=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,r=o?o.apply(this,t):t[0],i=s.cache;return i.has(r)?i.get(r):(n=a.apply(this,t),i.set(r,n),n)}).cache=new Map,s;throw new TypeError("Expected a function")}var tn=5;function en(t,e,n,r){for(var i in n=n||0,r=r||tn,e){var a;!function(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)}(e,i)||(null!==(a=e[i])&&Ie(a)?(Ie(t[i])||(t[i]={}),n<r?en(t[i],a,n+1,r):t[i]=e[i]):Ne(a)?(t[i]=[],t[i]=t[i].concat(a)):void 0!==a&&(t[i]=a))}}function nn(t,e){if(t===e)return!0;if(t&&e&&!ze(t)&&!ze(e)){if(Te(t)||Te(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=nn(t[r],e[r]));r++);return n}if(Re(t)||Re(e)){var i=Object.keys(t),a=Object.keys(e);if(i.length!==a.length)return!1;for(n=!0,r=0;r<i.length&&(n=nn(t[i[r]],e[i[r]]));r++);return n}}return!1}function rn(t,r){return Fe(t,function(t,e,n){return r.includes(n)||(t[n]=e),t},{})}function an(){}var ot=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)en(t,e[r]);return t},on=nn,sn=function(t,e,n){for(var r=0,i=ze(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},ln=function(n,r,i){function a(){u=!1===i.leading?0:Date.now(),o=null,c=n.apply(s,l),o||(s=l=null)}function t(){var t=Date.now(),e=(u||!1!==i.leading||(u=t),r-(t-u));return s=this,l=arguments,e<=0||r<e?(o&&(clearTimeout(o),o=null),u=t,c=n.apply(s,l),o||(s=l=null)):o||!1===i.trailing||(o=setTimeout(a,e)),c}var o,s,l,c,u=0;i=i||{};return t.cancel=function(){clearTimeout(o),u=0,o=s=l=null},t};function cn(t,e,n){(t.prototype=e.prototype=n).constructor=t}function un(t,e){var n,r=Object.create(t.prototype);for(n in e)r[n]=e[n];return r}function hn(){}var e="\\s*([+-]?\\d+)\\s*",n="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",fn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",dn=/^#([0-9a-f]{3,8})$/,pn=new RegExp("^rgb\\("+[e,e,e]+"\\)$"),gn=new RegExp("^rgb\\("+[fn,fn,fn]+"\\)$"),yn=new RegExp("^rgba\\("+[e,e,e,n]+"\\)$"),mn=new RegExp("^rgba\\("+[fn,fn,fn,n]+"\\)$"),vn=new RegExp("^hsl\\("+[n,fn,fn]+"\\)$"),bn=new RegExp("^hsla\\("+[n,fn,fn,n]+"\\)$"),xn={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 wn(){return this.rgb().formatHex()}function Mn(){return this.rgb().formatRgb()}function On(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=dn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?kn(e):3===n?new Sn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?En(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?En(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=pn.exec(t))?new Sn(e[1],e[2],e[3],1):(e=gn.exec(t))?new Sn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=yn.exec(t))?En(e[1],e[2],e[3],e[4]):(e=mn.exec(t))?En(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=vn.exec(t))?Pn(e[1],e[2]/100,e[3]/100,1):(e=bn.exec(t))?Pn(e[1],e[2]/100,e[3]/100,e[4]):xn.hasOwnProperty(t)?kn(xn[t]):"transparent"===t?new Sn(NaN,NaN,NaN,0):null}function kn(t){return new Sn(t>>16&255,t>>8&255,255&t,1)}function En(t,e,n,r){return new Sn(t=r<=0?e=n=NaN:t,e,n,r)}function Sn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function An(){return"#"+Tn(this.r)+Tn(this.g)+Tn(this.b)}function _n(){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 Tn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Pn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||1<=n?t=e=NaN:e<=0&&(t=NaN),new Ln(t,e,n,r)}function Cn(t){var e,n,r,i,a,o,s,l;return t instanceof Ln?new Ln(t.h,t.s,t.l,t.opacity):(t=t instanceof hn?t:On(t))?t instanceof Ln?t:(e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=NaN,l=((a=Math.max(e,n,r))+i)/2,(s=a-i)?(o=e===a?(n-r)/s+6*(n<r):n===a?(r-e)/s+2:(e-n)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=0<l&&l<1?0:o,new Ln(o,s,l,t.opacity)):new Ln}function Ln(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Nn(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 jn(t,e,n,r){t-=n,n=e-r;return Math.sqrt(t*t+n*n)}function Rn(t,e){var n=Math.min.apply(Math,O([],j(t),!1)),r=Math.min.apply(Math,O([],j(e),!1));return{x:n,y:r,width:Math.max.apply(Math,O([],j(t),!1))-n,height:Math.max.apply(Math,O([],j(e),!1))-r}}function In(t,e,n,r,i,a,o){for(var s=Math.atan(-r/n*Math.tan(i)),l=1/0,c=-1/0,u=[a,o],h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var f=s+h;a<o?a<f&&f<o&&u.push(f):o<f&&f<a&&u.push(f)}for(var d,p,g,h=0;h<u.length;h++){d=t,y=r,p=i,g=u[h];var y=n*Math.cos(p)*Math.cos(g)-y*Math.sin(p)*Math.sin(g)+d;y<l&&(l=y),c<y&&(c=y)}for(var m=Math.atan(r/(n*Math.tan(i))),v=1/0,b=-1/0,x=[a,o],h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var w=m+h;a<o?a<w&&w<o&&x.push(w):o<w&&w<a&&x.push(w)}for(var M,O,k,h=0;h<x.length;h++){M=e,E=r,O=i,k=x[h];var E=n*Math.sin(O)*Math.cos(k)+E*Math.cos(O)*Math.sin(k)+M;E<v&&(v=E),b<E&&(b=E)}return{x:l,y:v,width:c-l,height:b-v}}cn(hn,On,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:wn,formatHex:wn,formatHsl:function(){return Cn(this).formatHsl()},formatRgb:Mn,toString:Mn}),cn(Sn,function(t,e,n,r){return 1===arguments.length?(i=(i=t)instanceof hn?i:On(i))?new Sn((i=i.rgb()).r,i.g,i.b,i.opacity):new Sn:new Sn(t,e,n,null==r?1:r);var i},un(hn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Sn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Sn(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:An,formatHex:An,formatRgb:_n,toString:_n})),cn(Ln,function(t,e,n,r){return 1===arguments.length?Cn(t):new Ln(t,e,n,null==r?1:r)},un(hn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Ln(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Ln(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,e=n+(n<.5?n:1-n)*e,n=2*n-e;return new Sn(Nn(240<=t?t-240:120+t,n,e),Nn(t,n,e),Nn(t<120?240+t:t-120,n,e),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+")")}}));function Bn(t,e,n,r,i,a){for(var o=-1,s=1/0,l=[n,r],c=20,u=1/(c=a&&200<a?a/10:c),h=u/10,f=0;f<=c;f++){var d=f*u,p=[i.apply(void 0,O([],j(t.concat([d])),!1)),i.apply(void 0,O([],j(e.concat([d])),!1))];(m=jn(l[0],l[1],p[0],p[1]))<s&&(o=d,s=m)}if(0===o)return{x:t[0],y:e[0]};if(1===o)return{x:t[(n=t.length)-1],y:e[n-1]};for(s=1/0,f=0;f<32&&!(h<1e-4);f++){var g=o-h,y=o+h,p=[i.apply(void 0,O([],j(t.concat([g])),!1)),i.apply(void 0,O([],j(e.concat([g])),!1))],m=jn(l[0],l[1],p[0],p[1]);0<=g&&m<s?(o=g,s=m):(g=[i.apply(void 0,O([],j(t.concat([y])),!1)),i.apply(void 0,O([],j(e.concat([y])),!1))],g=jn(l[0],l[1],g[0],g[1]),y<=1&&g<s?(o=y,s=g):h*=.5)}return{x:i.apply(void 0,O([],j(t.concat([o])),!1)),y:i.apply(void 0,O([],j(e.concat([o])),!1))}}function Dn(t,e,n,r){return jn(t,e,n,r)}function Fn(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function zn(t,e,n,r,i,a){var o,s,l,n=[n-t,r-e];return(r=n)[0]===(o=[0,0])[0]&&r[1]===o[1]?Math.sqrt((i-t)*(i-t)+(a-e)*(a-e)):(s=(n=o=r=[-n[1],n[0]])[0],l=n[1],0<(s=s*s+l*l)&&(s=1/Math.sqrt(s)),o[0]=n[0]*s,o[1]=n[1]*s,l=[i-t,a-e],Math.abs(l[0]*r[0]+l[1]*r[1]))}function Wn(t,e,n,r,i){var a=1-i;return a*a*a*t+3*e*i*a*a+3*n*i*i*a+r*i*i*i}function Gn(t,e,n,r){var i,a,r=-3*t+9*e-9*n+3*r,n=6*t-12*e+6*n,e=3*e-3*t,t=[];return He(r,0)?He(n,0)||0<=(i=-e/n)&&i<=1&&t.push(i):He(e=n*n-4*r*e,0)?t.push(-n/(2*r)):0<e&&(a=(-n-(e=Math.sqrt(e)))/(2*r),0<=(i=(-n+e)/(2*r))&&i<=1&&t.push(i),0<=a)&&a<=1&&t.push(a),t}function Hn(t,e,n,r,i,a,o,s,l,c,u){t=Bn([t,n,i,o],[e,r,a,s],l,c,Wn,u);return jn(t.x,t.y,l,c)}function Vn(t){var e=t;if(e.length<2)return 0;for(var n=0,r=0;r<e.length-1;r++){var i=e[r],a=e[r+1];n+=jn(i[0],i[1],a[0],a[1])}return n}function Yn(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function qn(t,e,n){n=t+n-2*e;return He(n,0)?[.5]:(t=(t-e)/n)<=1&&0<=t?[t]:[]}function $n(t,e,n,r,i,a,o,s){t=Bn([t,n,i],[e,r,a],o,s,Yn);return jn(t.x,t.y,o,s)}function Un(t,e,n,r,i){!function t(e,n,r,i,a){for(;r<i;){600<i-r&&(o=i-r+1,u=n-r+1,l=Math.log(o),s=.5*Math.exp(2*l/3),l=.5*Math.sqrt(l*s*(o-s)/o)*(u-o/2<0?-1:1),c=Math.max(r,Math.floor(n-u*s/o+l)),u=Math.min(i,Math.floor(n+(o-u)*s/o+l)),t(e,n,c,u,a));var o,s,l,c,u,h=e[n],f=r,d=i;for(Xn(e,r,n),0<a(e[i],h)&&Xn(e,r,i);f<d;){for(Xn(e,f,d),f++,d--;a(e[f],h)<0;)f++;for(;0<a(e[d],h);)d--}0===a(e[r],h)?Xn(e,r,d):Xn(e,++d,i),d<=n&&(r=d+1),n<=d&&(i=d-1)}}(t,e,n||0,r||t.length-1,i||Kn)}function Xn(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Kn(t,e){return t<e?-1:e<t?1:0}function Zn(t,e){Qn(t,0,t.children.length,e,t)}function Qn(t,e,n,r,i){(i=i||or(null)).minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var a=e;a<n;a++){var o=t.children[a];Jn(i,t.leaf?r(o):o)}return i}function Jn(t,e){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)}function tr(t,e){return t.minX-e.minX}function er(t,e){return t.minY-e.minY}function nr(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function rr(t){return t.maxX-t.minX+(t.maxY-t.minY)}function ir(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function ar(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function or(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function sr(t,e,n,r,i){for(var a,o=[e,n];o.length;)(n=o.pop())-(e=o.pop())<=r||(Un(t,a=e+Math.ceil((n-e)/r/2)*r,e,n,i),o.push(e,a,a,n))}(e=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()}).prototype.all=function(){return this._all(this.data,[])},e.prototype.search=function(t){var e=this.data,n=[];if(ar(t,e))for(var r=this.toBBox,i=[];e;){for(var a=0;a<e.children.length;a++){var o=e.children[a],s=e.leaf?r(o):o;ar(t,s)&&(e.leaf?n.push(o):ir(t,s)?this._all(o,n):i.push(o))}e=i.pop()}return n},e.prototype.collides=function(t){var e=this.data;if(ar(t,e))for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],a=e.leaf?this.toBBox(i):i;if(ar(t,a)){if(e.leaf||ir(t,a))return!0;n.push(i)}}e=n.pop()}return!1},e.prototype.load=function(t){if(t&&t.length)if(t.length<this._minEntries)for(var e=0;e<t.length;e++)this.insert(t[e]);else{var n,r=this._build(t.slice(),0,t.length-1,0);this.data.children.length?this.data.height===r.height?this._splitRoot(this.data,r):(this.data.height<r.height&&(n=this.data,this.data=r,r=n),this._insert(r,this.data.height-r.height-1,!0)):this.data=r}return this},e.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},e.prototype.clear=function(){return this.data=or([]),this},e.prototype.remove=function(t,e){if(t)for(var n,r,i,a=this.data,o=this.toBBox(t),s=[],l=[];a||s.length;){if(a||(a=s.pop(),r=s[s.length-1],n=l.pop(),i=!0),a.leaf){var c=function(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}(t,a.children,e);if(-1!==c)return a.children.splice(c,1),s.push(a),this._condense(s),this}i||a.leaf||!ir(a,o)?r?(n++,a=r.children[n],i=!1):a=null:(s.push(a),l.push(n),a=(r=a).children[n=0])}return this},e.prototype.toBBox=function(t){return t},e.prototype.compareMinX=function(t,e){return t.minX-e.minX},e.prototype.compareMinY=function(t,e){return t.minY-e.minY},e.prototype.toJSON=function(){return this.data},e.prototype.fromJSON=function(t){return this.data=t,this},e.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},e.prototype._build=function(t,e,n,r){var i,a=n-e+1,o=this._maxEntries;if(a<=o)Zn(i=or(t.slice(e,n+1)),this.toBBox);else{r||(r=Math.ceil(Math.log(a)/Math.log(o)),o=Math.ceil(a/Math.pow(o,r-1))),(i=or([])).leaf=!1,i.height=r;var s=Math.ceil(a/o),l=s*Math.ceil(Math.sqrt(o));sr(t,e,n,l,this.compareMinX);for(var c=e;c<=n;c+=l){var u=Math.min(c+l-1,n);sr(t,c,u,s,this.compareMinY);for(var h=c;h<=u;h+=s){var f=Math.min(h+s-1,u);i.children.push(this._build(t,h,f,r-1))}}Zn(i,this.toBBox)}return i},e.prototype._chooseSubtree=function(t,e,n,r){for(;;){if(r.push(e),e.leaf||r.length-1===n)break;for(var i=1/0,a=1/0,o=void 0,s=0;s<e.children.length;s++){var l=e.children[s],c=nr(l),u=(h=t,u=l,(Math.max(u.maxX,h.maxX)-Math.min(u.minX,h.minX))*(Math.max(u.maxY,h.maxY)-Math.min(u.minY,h.minY))-c);u<a?(a=u,i=c<i?c:i,o=l):u===a&&c<i&&(i=c,o=l)}e=o||e.children[0]}var h,u;return e},e.prototype._insert=function(t,e,n){var n=n?t:this.toBBox(t),r=[],i=this._chooseSubtree(n,this.data,e,r);for(i.children.push(t),Jn(i,n);0<=e&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)},e.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries,i=(this._chooseSplitAxis(n,i,r),this._chooseSplitIndex(n,i,r)),r=or(n.children.splice(i,n.children.length-i));r.height=n.height,r.leaf=n.leaf,Zn(n,this.toBBox),Zn(r,this.toBBox),e?t[e-1].children.push(r):this._splitRoot(n,r)},e.prototype._splitRoot=function(t,e){this.data=or([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Zn(this.data,this.toBBox)},e.prototype._chooseSplitIndex=function(t,e,n){for(var r,i,a,o,s=1/0,l=1/0,c=e;c<=n-e;c++){var u=Qn(t,0,c,this.toBBox),h=Qn(t,c,n,this.toBBox),f=(i=u,f=h,d=o=a=void 0,a=Math.max(i.minX,f.minX),o=Math.max(i.minY,f.minY),d=Math.min(i.maxX,f.maxX),i=Math.min(i.maxY,f.maxY),Math.max(0,d-a)*Math.max(0,i-o)),d=nr(u)+nr(h);f<s?(s=f,r=c,l=d<l?d:l):f===s&&d<l&&(l=d,r=c)}return r||n-e},e.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:tr,i=t.leaf?this.compareMinY:er;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},e.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,a=Qn(t,0,e,i),o=Qn(t,n-e,n,i),s=rr(a)+rr(o),l=e;l<n-e;l++){var c=t.children[l];Jn(a,t.leaf?i(c):c),s+=rr(a)}for(var u=n-e-1;e<=u;u--){var h=t.children[u];Jn(o,t.leaf?i(h):h),s+=rr(o)}return s},e.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;0<=r;r--)Jn(e[r],t)},e.prototype._condense=function(t){for(var e=t.length-1,n=void 0;0<=e;e--)0===t[e].children.length?0<e?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():Zn(t[e],this.toBBox)};var k,lr,cr=e,e=((fn=k=k||{}).GROUP="g",fn.CIRCLE="circle",fn.ELLIPSE="ellipse",fn.IMAGE="image",fn.RECT="rect",fn.LINE="line",fn.POLYLINE="polyline",fn.POLYGON="polygon",fn.TEXT="text",fn.PATH="path",fn.HTML="html",fn.MESH="mesh",(n=lr=lr||{})[n.ZERO=0]="ZERO",n[n.NEGATIVE_ONE=1]="NEGATIVE_ONE",ur.prototype.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},ur.prototype.removeAllRenderingPlugins=function(){var e=this;this.plugins.forEach(function(t){t=e.context.renderingPlugins.indexOf(t);0<=t&&e.context.renderingPlugins.splice(t,1)})},ur);function ur(){this.plugins=[]}hr.prototype.registerPlugin=function(e){-1===this.plugins.findIndex(function(t){return t===e})&&this.plugins.push(e)},hr.prototype.unregisterPlugin=function(e){var t=this.plugins.findIndex(function(t){return t===e});-1<t&&this.plugins.splice(t,1)},hr.prototype.getPlugins=function(){return this.plugins},hr.prototype.getPlugin=function(e){return this.plugins.find(function(t){return t.name===e})},hr.prototype.getConfig=function(){return this.config},hr.prototype.setConfig=function(t){Object.assign(this.config,t)};fn=hr;function hr(t){this.clipSpaceNearZ=lr.NEGATIVE_ONE,this.plugins=[],this.config=m({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},t)}function fr(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function dr(t,e,n){t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2]}function pr(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function gr(t,e,n){t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n}function yr(t){return void 0===t?0:360<t||t<-360?t%360:t}function mr(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?Tt(t):Ge(t)?Ct(t,e,n):Ct(t[0],t[1]||e,t[2]||n)}function vr(t){return t*(Math.PI/180)}function br(t){return t*(180/Math.PI)}function xr(t,e){return 16===e.length?(n=t,r=e,o=.5*Math.PI,s=(c=j(vt(v(),r),3))[0],l=c[1],c=c[2],(u=Math.asin(-r[2]/s))<o?-o<u?(i=Math.atan2(r[6]/l,r[10]/c),a=Math.atan2(r[1]/s,r[0]/s)):(a=0,i=-Math.atan2(r[4]/l,r[5]/l)):(a=0,i=Math.atan2(r[4]/l,r[5]/l)),n[0]=i,n[1]=u,n[2]=a,n):(o=t,s=(c=e)[0],r=c[1],l=c[2],c=c[3],.499995*(n=s*s+(i=r*r)+(u=l*l)+(a=c*c))<(t=s*c-r*l)?(o[0]=Math.PI/2,o[1]=2*Math.atan2(r,s),o[2]=0):t<-.499995*n?(o[0]=-Math.PI/2,o[1]=2*Math.atan2(r,s),o[2]=0):(o[0]=Math.asin(2*(s*l-c*r)),o[1]=Math.atan2(2*(s*c+r*l),1-2*(u+a)),o[2]=Math.atan2(2*(s*r+l*c),1-2*(i+u))),o);var n,r,i,a,o,s,l,c,u}function wr(t,e,n,r,i){var a,o,s,l,c=Math.cos(t),t=Math.sin(t);return a=r*c,o=i*t,r=-r*t,t=i*c,c=i=0,e=e,n=n,s=1,(l=new $(9))[0]=a,l[1]=o,l[2]=i,l[3]=r,l[4]=t,l[5]=c,l[6]=e,l[7]=n,l[8]=s,l}function Mr(t){var e=t[0],n=t[1],r=t[3],i=t[4],a=Math.sqrt(e*e+n*n),o=Math.sqrt(r*r+i*i);e*i-n*r<0&&(e<i?a=-a:o=-o),a&&(e*=1/a,n*=1/a);r=br(Math.atan2(n,e));return[t[6],t[7],a,o,r]}var Or=Z(),kr=Z(),Er=qt(),d=[v(),v(),v()],Sr=v();function Ar(t,e,n,r,i,a){if(function(t,e){var n=e[15];if(0===n)return;for(var r=1/n,i=0;i<16;i++)t[i]=e[i]*r;return 1}(Or,t)&&(J(kr,Or),kr[3]=0,kr[7]=0,kr[11]=0,kr[15]=1,!(Math.abs(it(kr))<1e-8))){var t=Or[3],o=Or[7],s=Or[11],l=Or[12],c=Or[13],u=Or[14],h=Or[15];if(0!==t||0!==o||0!==s){if(Er[0]=t,Er[1]=o,Er[2]=s,Er[3]=h,!rt(kr,kr))return;nt(kr,kr),$t(i,Er,kr)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=l,e[1]=c,e[2]=u,t=Or,(o=d)[0][0]=t[0],o[0][1]=t[1],o[0][2]=t[2],o[1][0]=t[4],o[1][1]=t[5],o[1][2]=t[6],o[2][0]=t[8],o[2][1]=t[9],o[2][2]=t[10],n[0]=Pt(d[0]),Bt(d[0],d[0]),r[0]=Dt(d[0],d[1]),_r(d[1],d[1],d[0],1,-r[0]),n[1]=Pt(d[1]),Bt(d[1],d[1]),r[0]/=n[1],r[1]=Dt(d[0],d[2]),_r(d[2],d[2],d[0],1,-r[1]),r[2]=Dt(d[1],d[2]),_r(d[2],d[2],d[1],1,-r[2]),n[2]=Pt(d[2]),Bt(d[2],d[2]),r[1]/=n[2],r[2]/=n[2],Ft(Sr,d[1],d[2]),Dt(d[0],Sr)<0)for(var f=0;f<3;f++)n[f]*=-1,d[f][0]*=-1,d[f][1]*=-1,d[f][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+d[0][0]-d[1][1]-d[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-d[0][0]+d[1][1]-d[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-d[0][0]-d[1][1]+d[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+d[0][0]+d[1][1]+d[2][2],0)),d[2][1]>d[1][2]&&(a[0]=-a[0]),d[0][2]>d[2][0]&&(a[1]=-a[1]),d[1][0]>d[0][1]&&(a[2]=-a[2])}}function _r(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}Pr.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]},Pr.prototype.update=function(t,e){fr(this.center,t),fr(this.halfExtents,e),dr(this.min,this.center,this.halfExtents),pr(this.max,this.center,this.halfExtents)},Pr.prototype.setMinMax=function(t,e){pr(this.center,e,t),gr(this.center,this.center,.5),dr(this.halfExtents,e,t),gr(this.halfExtents,this.halfExtents,.5),fr(this.min,t),fr(this.max,e)},Pr.prototype.getMin=function(){return this.min},Pr.prototype.getMax=function(){return this.max},Pr.prototype.add=function(t){var e,n,r,i,a,o,s,l,c,u,h,f,d,p,g;Pr.isEmpty(t)||(Pr.isEmpty(this)?this.setMinMax(t.getMin(),t.getMax()):(n=(e=this.center)[0],p=e[1],a=e[2],i=(r=this.halfExtents)[0],h=r[1],o=r[2],l=(f=t.center)[0],g=f[1],f=f[2],c=(t=t.halfExtents)[0],(d=g-(u=t[1]))<(s=p-h)&&(s=d),(d=p+h)<(p=g+u)&&(d=p),(g=f-(h=t[2]))<(u=a-o)&&(u=g),(p=a+o)<(t=f+h)&&(p=t),e[0]=.5*((a=(g=l-c)<(a=n-i)?g:a)+(o=(o=n+i)<(f=l+c)?f:o)),e[1]=.5*(s+d),e[2]=.5*(u+p),r[0]=.5*(o-a),r[1]=.5*(d-s),r[2]=.5*(p-u),this.min[0]=a,this.min[1]=s,this.min[2]=u,this.max[0]=o,this.max[1]=d,this.max[2]=p))},Pr.prototype.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,t=t.halfExtents,a=e[0],o=e[4],s=e[8],l=e[1],c=e[5],u=e[9],h=e[2],f=e[6],d=e[10],p=Math.abs(a),g=Math.abs(o),y=Math.abs(s),m=Math.abs(l),v=Math.abs(c),b=Math.abs(u),x=Math.abs(h),w=Math.abs(f),M=Math.abs(d);n[0]=e[12]+a*i[0]+o*i[1]+s*i[2],n[1]=e[13]+l*i[0]+c*i[1]+u*i[2],n[2]=e[14]+h*i[0]+f*i[1]+d*i[2],r[0]=p*t[0]+g*t[1]+y*t[2],r[1]=m*t[0]+v*t[1]+b*t[2],r[2]=x*t[0]+w*t[1]+M*t[2],dr(this.min,n,r),pr(this.max,n,r)},Pr.prototype.intersects=function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),t=t.getMin();return n[0]<=r[0]&&e[0]>=t[0]&&n[1]<=r[1]&&e[1]>=t[1]&&n[2]<=r[2]&&e[2]>=t[2]},Pr.prototype.intersection=function(t){var e,n,r,i;return this.intersects(t)?(e=new Pr,i=[0,0,0],n=this.getMin(),r=t.getMin(),i[0]=Math.max(n[0],r[0]),i[1]=Math.max(n[1],r[1]),i[2]=Math.max(n[2],r[2]),n=i,r=[0,0,0],i=this.getMax(),t=t.getMax(),r[0]=Math.min(i[0],t[0]),r[1]=Math.min(i[1],t[1]),r[2]=Math.min(i[2],t[2]),e.setMinMax(n,r),e):null},Pr.prototype.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?fr([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]]},Pr.prototype.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?fr([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]]};var Tr=Pr;function Pr(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}Nr.prototype.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(0<=this.normal[0])<<8)+(Number(0<=this.normal[1])<<4)+Number(0<=this.normal[2])},Nr.prototype.distanceToPoint=function(t){return Dt(t,this.normal)-this.distance},Nr.prototype.normalize=function(){var t=1/Yt(this.normal);It(this.normal,this.normal,t),this.distance*=t},Nr.prototype.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),r=r/(r-this.distanceToPoint(e)),i=0<=r&&r<=1;return i&&n&&zt(n,t,e,r),i};var Cr,Lr=Nr;function Nr(t,e){this.distance=t||0,this.normal=e||Ct(0,1,0),this.updatePNVertexFlag()}(n=Cr=Cr||{})[n.OUTSIDE=4294967295]="OUTSIDE",n[n.INSIDE=0]="INSIDE",n[n.INDETERMINATE=2147483647]="INDETERMINATE";Rr.prototype.extractFromVPMatrix=function(t){var t=j(t,16),e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=t[10],f=t[11],d=t[12],p=t[13],g=t[14],t=t[15];Nt(this.planes[0].normal,i-e,l-a,f-c),this.planes[0].distance=t-d,Nt(this.planes[1].normal,i+e,l+a,f+c),this.planes[1].distance=t+d,Nt(this.planes[2].normal,i+n,l+o,f+u),this.planes[2].distance=t+p,Nt(this.planes[3].normal,i-n,l-o,f-u),this.planes[3].distance=t-p,Nt(this.planes[4].normal,i-r,l-s,f-h),this.planes[4].distance=t-g,Nt(this.planes[5].normal,i+r,l+s,f+h),this.planes[5].distance=t+g,this.planes.forEach(function(t){t.normalize(),t.updatePNVertexFlag()})};var jr=Rr;function Rr(t){if(this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new Lr)}Br.prototype.clone=function(){return new Br(this.x,this.y)},Br.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y};var Ir=Br;function Br(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}Fr.prototype.toJSON=function(){};var Dr=Fr;function Fr(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}var zr,Wr,Gr,Hr="Method not implemented.",Vr="Use document.documentElement instead.";(n=zr=zr||{})[n.ORBITING=0]="ORBITING",n[n.EXPLORING=1]="EXPLORING",n[n.TRACKING=2]="TRACKING",(n=Wr=Wr||{})[n.DEFAULT=0]="DEFAULT",n[n.ROTATIONAL=1]="ROTATIONAL",n[n.TRANSLATIONAL=2]="TRANSLATIONAL",n[n.CINEMATIC=3]="CINEMATIC",(n=Gr=Gr||{})[n.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",n[n.PERSPECTIVE=1]="PERSPECTIVE";var g,Yr,qr,$r,Ur="updated",n=(r.prototype.isOrtho=function(){return this.projectionMode===Gr.ORTHOGRAPHIC},r.prototype.getProjectionMode=function(){return this.projectionMode},r.prototype.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},r.prototype.getPerspectiveInverse=function(){return this.projectionMatrixInverse},r.prototype.getFrustum=function(){return this.frustum},r.prototype.getPosition=function(){return this.position},r.prototype.getFocalPoint=function(){return this.focalPoint},r.prototype.getDollyingStep=function(){return this.dollyingStep},r.prototype.getNear=function(){return this.near},r.prototype.getFar=function(){return this.far},r.prototype.getZoom=function(){return this.zoom},r.prototype.getOrthoMatrix=function(){return this.orthoMatrix},r.prototype.getView=function(){return this.view},r.prototype.setEnableUpdate=function(t){this.enableUpdate=t},r.prototype.setType=function(t,e){return this.type=t,this.type===zr.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===zr.TRACKING&&void 0!==e&&this.setTrackingMode(e),this},r.prototype.setProjectionMode=function(t){return this.projectionMode=t,this},r.prototype.setTrackingMode=function(t){if(this.type!==zr.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this},r.prototype.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},r.prototype.getViewTransform=function(){return rt(Z(),this.matrix)},r.prototype.getWorldTransform=function(){return this.matrix},r.prototype.jitterProjectionMatrix=function(t,e){t=pt(Z(),[t,e,0]);this.jitteredProjectionMatrix=ct(Z(),t,this.projectionMatrix)},r.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},r.prototype.setMatrix=function(t){return this.matrix=t,this._update(),this},r.prototype.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},r.prototype.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},r.prototype.setNear=function(t){return this.projectionMode===Gr.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this},r.prototype.setFar=function(t){return this.projectionMode===Gr.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this},r.prototype.setViewOffset=function(t,e,n,r,i,a){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=a,this.projectionMode===Gr.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},r.prototype.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===Gr.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},r.prototype.setZoom=function(t){return this.zoom=t,this.projectionMode===Gr.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===Gr.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},r.prototype.setZoomByViewportPoint=function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,n=n.y,i=this.roll,t=(this.rotate(0,0,-i),this.setPosition(r,n),this.setFocalPoint(r,n),this.setZoom(t),this.rotate(0,0,i),this.canvas.viewport2Canvas({x:e[0],y:e[1]})),i=Ct(t.x-r,t.y-n,0),e=Dt(i,this.right)/Pt(this.right),r=Dt(i,this.up)/Pt(this.up);return this.pan(-e,-r),this},r.prototype.setPerspective=function(t,e,n,r){this.projectionMode=Gr.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var i,a,o,s,l,c,n=this.near*Math.tan(vr(.5*this.fov))/this.zoom,e=2*n,r=this.aspect*e,u=-.5*r;return null!=(i=this.view)&&i.enabled&&(i=this.view.fullWidth,a=this.view.fullHeight,u+=this.view.offsetX*r/i,n-=this.view.offsetY*e/a,r*=this.view.width/i,e*=this.view.height/a),i=this.projectionMatrix,u=(a=u)+r,n=(r=n)-e,e=t,t=this.far,o=this.clipSpaceNearZ===lr.ZERO,l=2*e/(r-n),c=(u+a)/(u-a),r=(r+n)/(r-n),n=(o=void 0===o?!1:o)?(s=-t/(t-e),-t*e/(t-e)):(s=-(t+e)/(t-e),-2*t*e/(t-e)),i[0]=2*e/(u-a),i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=l,i[6]=0,i[7]=0,i[8]=c,i[9]=r,i[10]=s,i[11]=-1,i[12]=0,i[13]=0,i[14]=n,i[15]=0,ht(this.projectionMatrix,this.projectionMatrix,Ct(1,-1,1)),rt(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},r.prototype.setOrthographic=function(t,e,n,r,i,a){this.projectionMode=Gr.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=a;var o,e=(this.rright-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.rright+this.left)/2,r=(this.top+this.bottom)/2,s=n-e,n=n+e,e=r+t,r=r-t;return null!=(t=this.view)&&t.enabled&&(t=(this.rright-this.left)/this.view.fullWidth/this.zoom,o=(this.top-this.bottom)/this.view.fullHeight/this.zoom,n=(s+=t*this.view.offsetX)+t*this.view.width,r=(e-=o*this.view.offsetY)-o*this.view.height),(this.clipSpaceNearZ===lr.NEGATIVE_ONE?kt:Et)(this.projectionMatrix,s,n,r,e,i,a),ht(this.projectionMatrix,this.projectionMatrix,Ct(1,-1,1)),rt(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},r.prototype.setPosition=function(t,e,n){t=mr(t,e=void 0===e?this.position[1]:e,n=void 0===n?this.position[2]:n);return this._setPosition(t),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},r.prototype.setFocalPoint=function(t,e,n){void 0===e&&(e=this.focalPoint[1]),void 0===n&&(n=this.focalPoint[2]);var r,i=Ct(0,1,0);return this.focalPoint=mr(t,e,n),this.trackingMode===Wr.CINEMATIC&&(t=(r=Rt(v(),this.focalPoint,this.position))[0],e=r[1],n=r[2],r=Pt(r),e=br(Math.asin(e/r)),r=90+br(Math.atan2(n,t)),dt(n=Z(),n,vr(r)),ft(n,n,vr(e)),i=Wt(v(),[0,1,0],n)),rt(this.matrix,St(Z(),this.position,this.focalPoint,i)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},r.prototype.getDistance=function(){return this.distance},r.prototype.getDistanceVector=function(){return this.distanceVector},r.prototype.setDistance=function(t){var e,n,r;return this.distance===t||t<0||(this.distance=t,this.distance<2e-4&&(this.distance=2e-4),this.dollyingStep=this.distance/100,e=v(),t=this.distance,n=this.forward,r=this.focalPoint,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},r.prototype.setMaxDistance=function(t){return this.maxDistance=t,this},r.prototype.setMinDistance=function(t){return this.minDistance=t,this},r.prototype.setAzimuth=function(t){return this.azimuth=yr(t),this.computeMatrix(),this._getAxes(),this.type===zr.ORBITING||this.type===zr.EXPLORING?this._getPosition():this.type===zr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},r.prototype.getAzimuth=function(){return this.azimuth},r.prototype.setElevation=function(t){return this.elevation=yr(t),this.computeMatrix(),this._getAxes(),this.type===zr.ORBITING||this.type===zr.EXPLORING?this._getPosition():this.type===zr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},r.prototype.getElevation=function(){return this.elevation},r.prototype.setRoll=function(t){return this.roll=yr(t),this.computeMatrix(),this._getAxes(),this.type===zr.ORBITING||this.type===zr.EXPLORING?this._getPosition():this.type===zr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},r.prototype.getRoll=function(){return this.roll},r.prototype._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},r.prototype.computeMatrix=function(){var t=Xt(Ut(),[0,0,1],vr(this.roll)),e=(et(this.matrix),Xt(Ut(),[1,0,0],vr((this.rotateWorld&&this.type!==zr.TRACKING||this.type===zr.TRACKING?1:-1)*this.elevation))),n=Xt(Ut(),[0,1,0],vr((this.rotateWorld&&this.type!==zr.TRACKING||this.type===zr.TRACKING?1:-1)*this.azimuth)),n=Kt(Ut(),n,e),n=Kt(Ut(),n,t),e=wt(Z(),n);this.type===zr.ORBITING||this.type===zr.EXPLORING?(ut(this.matrix,this.matrix,this.focalPoint),ct(this.matrix,this.matrix,e),ut(this.matrix,this.matrix,[0,0,this.distance])):this.type===zr.TRACKING&&(ut(this.matrix,this.matrix,this.position),ct(this.matrix,this.matrix,e))},r.prototype._setPosition=function(t,e,n){this.position=mr(t,e,n);t=this.matrix;t[12]=this.position[0],t[13]=this.position[1],t[14]=this.position[2],t[15]=1,this._getOrthoMatrix()},r.prototype._getAxes=function(){Lt(this.right,mr($t(qt(),[1,0,0,0],this.matrix))),Lt(this.up,mr($t(qt(),[0,1,0,0],this.matrix))),Lt(this.forward,mr($t(qt(),[0,0,1,0],this.matrix))),Bt(this.right,this.right),Bt(this.up,this.up),Bt(this.forward,this.forward)},r.prototype._getAngles=function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=Pt(this.distanceVector);0===r?(this.elevation=0,this.azimuth=0):this.type===zr.TRACKING||this.rotateWorld?(this.elevation=br(Math.asin(e/r)),this.azimuth=br(Math.atan2(-t,-n))):(this.elevation=-br(Math.asin(e/r)),this.azimuth=-br(Math.atan2(-t,-n)))},r.prototype._getPosition=function(){Lt(this.position,mr($t(qt(),[0,0,0,1],this.matrix))),this._getDistance()},r.prototype._getFocalPoint=function(){var t,e;Gt(this.distanceVector,[0,0,-this.distance],(t=U(),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)),jt(this.focalPoint,this.position,this.distanceVector),this._getDistance()},r.prototype._getDistance=function(){this.distanceVector=Rt(v(),this.focalPoint,this.position),this.distance=Pt(this.distanceVector),this.dollyingStep=this.distance/100},r.prototype._getOrthoMatrix=function(){var t,e;this.projectionMode===Gr.ORTHOGRAPHIC&&(t=this.position,e=Xt(Ut(),[0,0,1],-this.roll*Math.PI/180),xt(this.orthoMatrix,e,Ct((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),Ct(this.zoom,this.zoom,1),t))},r.prototype.triggerUpdate=function(){var t;this.enableUpdate&&(t=this.getViewTransform(),t=ct(Z(),this.getPerspective(),t),this.getFrustum().extractFromVPMatrix(t),this.eventEmitter.emit(Ur))},r.prototype.rotate=function(t,e,n){throw new Error(Hr)},r.prototype.pan=function(t,e){throw new Error(Hr)},r.prototype.dolly=function(t){throw new Error(Hr)},r.prototype.createLandmark=function(t,e){throw new Error(Hr)},r.prototype.gotoLandmark=function(t,e){throw new Error(Hr)},r.prototype.cancelLandmarkAnimation=function(){throw new Error(Hr)},r);function r(){this.clipSpaceNearZ=lr.NEGATIVE_ONE,this.eventEmitter=new Y,this.matrix=Z(),this.right=Ct(1,0,0),this.up=Ct(0,1,0),this.forward=Ct(0,0,1),this.position=Ct(0,0,1),this.focalPoint=Ct(0,0,0),this.distanceVector=Ct(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=Z(),this.projectionMatrixInverse=Z(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=zr.EXPLORING,this.trackingMode=Wr.DEFAULT,this.projectionMode=Gr.PERSPECTIVE,this.frustum=new jr,this.orthoMatrix=Z()}function Xr(a,o){if("function"!=typeof a||null!=o&&"function"!=typeof o)throw new TypeError("Expected a function");function s(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,r=o?o.apply(this,t):t[0],i=s.cache;return i.has(r)?i.get(r):(n=a.apply(this,t),s.cache=i.set(r,n)||i,n)}return s.cache=new(Xr.Cache||Map),s}Xr.Cache=Map,(i=g=g||{})[i.kUnknown=0]="kUnknown",i[i.kNumber=1]="kNumber",i[i.kPercentage=2]="kPercentage",i[i.kEms=3]="kEms",i[i.kPixels=4]="kPixels",i[i.kRems=5]="kRems",i[i.kDegrees=6]="kDegrees",i[i.kRadians=7]="kRadians",i[i.kGradians=8]="kGradians",i[i.kTurns=9]="kTurns",i[i.kMilliseconds=10]="kMilliseconds",i[i.kSeconds=11]="kSeconds",i[i.kInteger=12]="kInteger",(i=Yr=Yr||{})[i.kUNumber=0]="kUNumber",i[i.kUPercent=1]="kUPercent",i[i.kULength=2]="kULength",i[i.kUAngle=3]="kUAngle",i[i.kUTime=4]="kUTime",i[i.kUOther=5]="kUOther",(i=qr=qr||{})[i.kYes=0]="kYes",i[i.kNo=1]="kNo",(i=$r=$r||{})[i.kYes=0]="kYes",i[i.kNo=1]="kNo";function Kr(t){var e=1;switch(t){case g.kPixels:case g.kDegrees:case g.kSeconds:break;case g.kMilliseconds:e=.001;break;case g.kRadians:e=180/Math.PI;break;case g.kGradians:e=.9;break;case g.kTurns:e=360}return e}function Zr(t){switch(t){case g.kNumber:case g.kInteger:return"";case g.kPercentage:return"%";case g.kEms:return"em";case g.kRems:return"rem";case g.kPixels:return"px";case g.kDegrees:return"deg";case g.kRadians:return"rad";case g.kGradians:return"grad";case g.kMilliseconds:return"ms";case g.kSeconds:return"s";case g.kTurns:return"turn"}return""}var Qr,Jr=[{name:"em",unit_type:g.kEms},{name:"px",unit_type:g.kPixels},{name:"deg",unit_type:g.kDegrees},{name:"rad",unit_type:g.kRadians},{name:"grad",unit_type:g.kGradians},{name:"ms",unit_type:g.kMilliseconds},{name:"s",unit_type:g.kSeconds},{name:"rem",unit_type:g.kRems},{name:"turn",unit_type:g.kTurns}],ti=((i=Qr=Qr||{})[i.kUnknownType=0]="kUnknownType",i[i.kUnparsedType=1]="kUnparsedType",i[i.kKeywordType=2]="kKeywordType",i[i.kUnitType=3]="kUnitType",i[i.kSumType=4]="kSumType",i[i.kProductType=5]="kProductType",i[i.kNegateType=6]="kNegateType",i[i.kInvertType=7]="kInvertType",i[i.kMinType=8]="kMinType",i[i.kMaxType=9]="kMaxType",i[i.kClampType=10]="kClampType",i[i.kTransformType=11]="kTransformType",i[i.kPositionType=12]="kPositionType",i[i.kURLImageType=13]="kURLImageType",i[i.kColorType=14]="kColorType",i[i.kUnsupportedColorType=15]="kUnsupportedColorType",function(e){return Jr.find(function(t){return t.name===e}).unit_type}),i=(ei.isAngle=function(t){return t===g.kDegrees||t===g.kRadians||t===g.kGradians||t===g.kTurns},ei.isLength=function(t){return t>=g.kEms&&t<g.kDegrees},ei.isRelativeUnit=function(t){return t===g.kPercentage||t===g.kEms||t===g.kRems},ei.isTime=function(t){return t===g.kSeconds||t===g.kMilliseconds},ei.prototype.toString=function(){return this.buildCSSText(qr.kNo,$r.kNo,"")},ei.prototype.isNumericValue=function(){return this.getType()>=Qr.kUnitType&&this.getType()<=Qr.kClampType},ei);function ei(){}t(ai,ni=i),ai.prototype.getType=function(){return Qr.kColorType},ai.prototype.to=function(t){return this};var ni,ri,ii=ai;function ai(t){var e=ni.call(this)||this;return e.colorSpace=t,e}(o=ri=ri||{})[o.Constant=0]="Constant",o[o.LinearGradient=1]="LinearGradient",o[o.RadialGradient=2]="RadialGradient";t(li,oi=i),li.prototype.clone=function(){return new li(this.type,this.value)},li.prototype.buildCSSText=function(t,e,n){return n},li.prototype.getType=function(){return Qr.kColorType};var oi,si=li;function li(t,e){var n=oi.call(this)||this;return n.type=t,n.value=e,n}t(hi,ci=i),hi.prototype.clone=function(){return new hi(this.value)},hi.prototype.getType=function(){return Qr.kKeywordType},hi.prototype.buildCSSText=function(t,e,n){return n+this.value};var ci,ui=hi;function hi(t){var e=ci.call(this)||this;return e.value=t,e}function fi(t){return t.split("").map(function(t,e){return t.toUpperCase()===t?"".concat(0!==e?"-":"").concat(t.toLowerCase()):t}).join("")}var di=Xr(function(t){return(t=void 0===t?"":t).replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})});function pi(t){return"function"==typeof t}function gi(t,e){void 0===e&&(e="");var n="";if(Number.isFinite(t)){if(!Number.isNaN(t))throw new Error;n="NaN"}else n=0<t?"infinity":"-infinity";return n+e}function yi(t){switch(function(t){switch(t){case g.kNumber:case g.kInteger:return Yr.kUNumber;case g.kPercentage:return Yr.kUPercent;case g.kPixels:return Yr.kULength;case g.kMilliseconds:case g.kSeconds:return Yr.kUTime;case g.kDegrees:case g.kRadians:case g.kGradians:case g.kTurns:return Yr.kUAngle;default:return Yr.kUOther}}(t)){case Yr.kUNumber:return g.kNumber;case Yr.kULength:return g.kPixels;case Yr.kUPercent:return g.kPercentage;case Yr.kUTime:return g.kSeconds;case Yr.kUAngle:return g.kDegrees;default:return g.kUnknown}}var mi,vi={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},bi=Xr(function(t){var t=di(t),e=vi[t];return(null==e?void 0:e.alias)||t}),xi=(t(wi,mi=i),wi.prototype.clone=function(){return new wi(this.value,this.unit)},wi.prototype.equals=function(t){return this.value===t.value&&this.unit===t.unit},wi.prototype.getType=function(){return Qr.kUnitType},wi.prototype.convertTo=function(t){var e;return this.unit===t?new wi(this.value,this.unit):(e=yi(this.unit))!==yi(t)||e===g.kUnknown?null:(e=Kr(this.unit)/Kr(t),new wi(this.value*e,t))},wi.prototype.buildCSSText=function(t,e,n){switch(this.unit){case g.kUnknown:break;case g.kInteger:i=Number(this.value).toFixed(0);break;case g.kNumber:case g.kPercentage:case g.kEms:case g.kRems:case g.kPixels:case g.kDegrees:case g.kRadians:case g.kGradians:case g.kMilliseconds:case g.kSeconds:case g.kTurns:var r,i,a=this.value,o=Zr(this.unit);i=a<-999999||999999<a?(r=Zr(this.unit),!Number.isFinite(a)||Number.isNaN(a)?gi(a,r):a+(r||"")):"".concat(a).concat(o)}return n+=i},wi);function wi(t,e){void 0===e&&(e=g.kNumber);var n=mi.call(this)||this,r="string"==typeof e?(r=e)?"number"===r?g.kNumber:"percent"===r||"%"===r?g.kPercentage:ti(r):g.kUnknown:e;return n.unit=r,n.value=t,n}var Mi,Oi=new xi(0,"px"),ki=(new xi(1,"px"),new xi(0,"deg")),Ei=(t(Si,Mi=ii),Si.prototype.clone=function(){return new Si(this.r,this.g,this.b,this.alpha)},Si.prototype.buildCSSText=function(t,e,n){return n+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")},Si);function Si(t,e,n,r,i){void 0===r&&(r=1),void 0===i&&(i=!1);var a=Mi.call(this,"rgb")||this;return a.r=t,a.g=e,a.b=n,a.alpha=r,a.isNone=i,a}function Ai(t){return Ci[t]||(Ci[t]=new ui(t)),Ci[t]}var _i,Ti,a,Pi=new ui("unset"),o=new ui("initial"),i=new ui("inherit"),Ci={"":Pi,unset:Pi,initial:o,inherit:i},Li=new Ei(0,0,0,0,!0),Ni=new Ei(0,0,0,0),ji=Xr(function(t,e,n,r){return new Ei(t,e,n,r)},function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")}),Ri=function(t,e){return void 0===e&&(e=g.kNumber),new xi(t,e)},Ii=new xi(50,"%"),Bi=(_i=_i||{},_i[_i.Standard=0]="Standard",(ii=Ti=Ti||{})[ii.ADDED=0]="ADDED",ii[ii.REMOVED=1]="REMOVED",{absolutePath:[],hasArc:!(ii[ii.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"),segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Dr(0,0,0,0)});(o=a=a||{}).COORDINATE="<coordinate>",o.COLOR="<color>",o.PAINT="<paint>",o.NUMBER="<number>",o.ANGLE="<angle>",o.OPACITY_VALUE="<opacity-value>",o.SHADOW_BLUR="<shadow-blur>",o.LENGTH="<length>",o.PERCENTAGE="<percentage>",o.LENGTH_PERCENTAGE="<length> | <percentage>",o.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",o.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",o.LIST_OF_POINTS="<list-of-points>",o.PATH="<path>",o.FILTER="<filter>",o.Z_INDEX="<z-index>",o.OFFSET_DISTANCE="<offset-distance>",o.DEFINED_PATH="<defined-path>",o.MARKER="<marker>",o.TRANSFORM="<transform>",o.TRANSFORM_ORIGIN="<transform-origin>",o.TEXT="<text>",o.TEXT_TRANSFORM="<text-transform>";Di={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]+\.?))/},Fi="";var Di,Fi,zi=function(t){return Fi=t,Gi()};function Wi(t){throw new Error(Fi+": "+t)}function Gi(){var t=Qi(Hi);return 0<Fi.length&&Wi("Invalid input not EOF"),t}function Hi(){return Vi("linear-gradient",Di.linearGradient,qi)||Vi("repeating-linear-gradient",Di.repeatingLinearGradient,qi)||Vi("radial-gradient",Di.radialGradient,$i)||Vi("repeating-radial-gradient",Di.repeatingRadialGradient,$i)||Vi("conic-gradient",Di.conicGradient,$i)}function Vi(n,t,r){return Yi(t,function(t){var e=r();return e&&!aa(Di.comma)&&Wi("Missing comma before color stops"),{type:n,orientation:e,colorStops:Qi(Ji)}})}function Yi(t,e){t=aa(t);if(t)return aa(Di.startCall)||Wi("Missing ("),e=e(t),aa(Di.endCall)||Wi("Missing )"),e}function qi(){return ia("directional",Di.sideOrCorner,1)||ia("angular",Di.angleValue,1)}function $i(){var t,e,n=Ui();return n&&((t=[]).push(n),e=Fi,aa(Di.comma))&&((n=Ui())?t.push(n):Fi=e),t}function Ui(){var t,e=function(){var t=ia("shape",/^(circle)/i,0);t&&(t.style=ra()||Xi());return t}()||function(){var t=ia("shape",/^(ellipse)/i,0);t&&(t.style=ea()||Xi());return t}();return e?e.at=Ki():(t=Xi())?(e=t,(t=Ki())&&(e.at=t)):(t=Zi())&&(e={type:"default-radial",at:t}),e}function Xi(){return ia("extent-keyword",Di.extentKeywords,1)}function Ki(){var t;if(ia("position",/^at/,0))return(t=Zi())||Wi("Missing positioning value"),t}function Zi(){var t={x:ea(),y:ea()};if(t.x||t.y)return{type:"position",value:t}}function Qi(t){var e=t(),n=[];if(e)for(n.push(e);aa(Di.comma);)(e=t())?n.push(e):Wi("One extra comma");return n}function Ji(){var t=ia("hex",Di.hexColor,1)||Yi(Di.rgbaColor,function(){return{type:"rgba",value:Qi(ta)}})||Yi(Di.rgbColor,function(){return{type:"rgb",value:Qi(ta)}})||ia("literal",Di.literalColor,0);return t||Wi("Expected color definition"),t.length=ea(),t}function ta(){return aa(Di.number)[1]}function ea(){return ia("%",Di.percentageValue,1)||na()||ra()}function na(){return ia("position-keyword",Di.positionKeywords,1)}function ra(){return ia("px",Di.pixelValue,1)||ia("em",Di.emValue,1)}function ia(t,e,n){e=aa(e);if(e)return{type:t,value:e[n]}}function aa(t){var e=/^[\n\r\t\s]+/.exec(Fi),e=(e&&oa(e[0].length),t.exec(Fi));return e&&oa(e[0].length),e}function oa(t){Fi=Fi.substring(t)}var sa=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,la=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,ca=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,ua=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var ha={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},fa=Xr(function(t){t="angular"===t.type?Number(t.value):ha[t.value]||0;return Ri(t,"deg")}),da=Xr(function(t){var e,n=50,r=50,i="%",a="%";return"position"===(null==t?void 0:t.type)&&(e=(t=t.value).x,t=t.y,"position-keyword"===(null==e?void 0:e.type)&&("left"===e.value?n=0:"center"===e.value?n=50:"right"===e.value?n=100:"top"===e.value?r=0:"bottom"===e.value&&(r=100)),"position-keyword"===(null==t?void 0:t.type)&&("left"===t.value?n=0:"center"===t.value?r=50:"right"===t.value?n=100:"top"===t.value?r=0:"bottom"===t.value&&(r=100)),"px"!==(null==e?void 0:e.type)&&"%"!==(null==e?void 0:e.type)&&"em"!==(null==e?void 0:e.type)||(i=null==e?void 0:e.type,n=Number(e.value)),"px"!==(null==t?void 0:t.type)&&"%"!==(null==t?void 0:t.type)&&"em"!==(null==t?void 0:t.type)||(a=null==t?void 0:t.type,r=Number(t.value))),{cx:Ri(n,i),cy:Ri(r,a)}}),pa=Xr(function(t){if(-1<t.indexOf("linear")||-1<t.indexOf("radial"))return zi(t).map(function(t){for(var e,n=t.type,r=t.orientation,t=t.colorStops,i=t,a=i.length,o=(i[a-1].length=null!=(d=i[a-1].length)?d:{type:"%",value:"100"},1<a&&(i[0].length=null!=(d=i[0].length)?d:{type:"%",value:"0"}),0),s=Number(i[0].length.value),l=1;l<a;l++){var c=null==(e=i[l].length)?void 0:e.value;if(!P(c)&&!P(s)){for(var u=1;u<l-o;u++)i[o+u].length={type:"%",value:"".concat(s+(Number(c)-s)*u/(l-o))};o=l,s=Number(c)}}var h,f,d=t.map(function(t){return{offset:Ri(Number(t.length.value),"%"),color:(e=(t=t).type,t=t.value,"hex"===e?"#".concat(t):"literal"===e?t:("rgb"===e?"rgb(":"rgba(").concat(t.join(","),")"))};var e});return"linear-gradient"===n?new si(ri.LinearGradient,{angle:r?fa(r):ki,steps:d}):"radial-gradient"===n&&"shape"===(r=r||[{type:"shape",value:"circle"}])[0].type&&"circle"===r[0].value?(n=(t=da(r[0].at)).cx,t=t.cy,f=void 0,r[0].style&&(h=(r=r[0].style).type,r=r.value,f="extent-keyword"===h?Ai(r):Ri(r,h)),new si(ri.RadialGradient,{cx:n,cy:t,size:f,steps:d})):void 0});var e=t[0];if("("===t[1]||"("===t[2])if("l"===e){var n=sa.exec(t);if(n)return r=(null==(r=n[2].match(ua))?void 0:r.map(function(t){return t.split(":")}))||[],[new si(ri.LinearGradient,{angle:Ri(parseFloat(n[1]),"deg"),steps:r.map(function(t){var t=j(t,2),e=t[0],t=t[1];return{offset:Ri(100*Number(e),"%"),color:t}})})]}else if("r"===e){n=function(t){var t=la.exec(t);if(t)return t=(null==(t=t[4].match(ua))?void 0:t.map(function(t){return t.split(":")}))||[],{cx:Ri(50,"%"),cy:Ri(50,"%"),steps:t.map(function(t){var t=j(t,2),e=t[0],t=t[1];return{offset:Ri(100*Number(e),"%"),color:t}})};return null}(t);if(n&&!ze(n))return[new si(ri.RadialGradient,n)]}else if("p"===e){var r=t;if(r=ca.exec(r)){var i=r[1],r=r[2];switch(i){case"a":i="repeat";break;case"x":i="repeat-x";break;case"y":i="repeat-y";break;default:i="no-repeat"}return{image:r,repetition:i}}return null}});function ga(t){return t&&t.image}function ya(t){return t&&!P(t.r)&&!P(t.g)&&!P(t.b)}var ma=Xr(function(t){var e;return ga(t)?m({repetition:"repeat"},t):"transparent"===(t=P(t)?"":t)?Ni:pa(t="currentColor"===t?"black":t)||(e=[0,0,0,0],null!==(t=On(t))&&(e[0]=t.r||0,e[1]=t.g||0,e[2]=t.b||0,e[3]=t.opacity),ji.apply(void 0,O([],j(e),!1)))});function va(t,e){if(ya(t)&&ya(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(We(e[n],0,255));return e[3]=We(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function ba(t,e){if(P(e))return Ri(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if(0<="px".search(t))return Ri(Number(e),"px");if(0<="deg".search(t))return Ri(Number(e),"deg")}var n=[],r=(e=e.replace(t,function(t){return n.push(t),"U"+t}),"U("+t.source+")");return n.map(function(t){return Ri(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)})[0]}var xa=Xr(function(t){return ba(new RegExp("px","g"),t)}),wa=(Xr(function(t){return ba(new RegExp("%","g"),t)}),function(t){return Ge(t)||isFinite(Number(t))?Ri(Number(t)||0,"px"):ba(new RegExp("px|%|em|rem","g"),t)}),Ma=Xr(function(t){return ba(new RegExp("deg|rad|grad|turn","g"),t)});function Oa(t){var e=0;return t.unit===g.kDegrees?e=t.value:t.unit===g.kRadians?e=br(Number(t.value)):t.unit===g.kTurns&&(e=360*Number(t.value)),e}function ka(t,e){var n;return Array.isArray(t)?n=t.map(function(t){return Number(t)}):ze(t)?n=t.split(" ").map(function(t){return Number(t)}):Ge(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 Ea(t){return ze(t)?t.split(" ").map(function(t){return wa(t)}):t.map(function(t){return wa(t.toString())})}function Sa(t,e,n){return 0===t.value?0:t.unit===g.kPixels?Number(t.value):t.unit===g.kPercentage&&n?(n=n.nodeName===k.GROUP?n.getLocalBounds():n.geometry.contentBounds,t.value/100*n.halfExtents[e]*2):0}var Aa=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function _a(t){if("none"!==(t=(t=void 0===t?"":t).toLowerCase().trim()))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,-1<Aa.indexOf(e[1])&&r.push({name:e[1],params:e[2].split(" ").map(function(t){return ba(/deg|rad|grad|turn|px|%/g,t)||ma(t)})}),n.lastIndex===t.length)return r}return[]}function Ta(t){return t.toString()}var Pa=Xr(function(t){return"number"==typeof t?Ri(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Ri(Number(t)):Ri(0)});function Ca(t,e){return[t,e,Ta]}function La(n,r){return function(t,e){return[t,e,function(t){return Ta(We(t,n,r))}]}}function Na(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function ja(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=Se(t.parsedStyle.path.absolutePath,void 0,m(m({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function Ra(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ia(t,e){for(var n,r,i,a,o,s,l,c,u,h=[],f=[],d=[],p=0;p<t.length;p++){var g=(k=t[p]).currentPoint,y=k.params,m=k.prePoint,v=void 0;switch(k.command){case"Q":b=m[0],n=m[1],r=y[1],i=y[2],a=y[3],o=y[4],u=c=l=s=void 0,s=qn(b,r,a)[0],l=qn(n,i,o)[0],c=[b,a],u=[n,o],void 0!==s&&c.push(Yn(b,r,a,s)),void 0!==l&&u.push(Yn(n,i,o,l)),v=Rn(c,u);break;case"C":v=function(t,e,n,r,i,a,o,s){for(var l=[t,o],c=[e,s],u=Gn(t,n,i,o),h=Gn(e,r,a,s),f=0;f<u.length;f++)l.push(Wn(t,n,i,o,u[f]));for(f=0;f<h.length;f++)c.push(Wn(e,r,a,s,h[f]));return Rn(l,c)}(m[0],m[1],y[1],y[2],y[3],y[4],y[5],y[6]);break;case"A":var b=k.arcParams,v=In(b.cx,b.cy,b.rx,b.ry,b.xRotation,b.startAngle,b.endAngle);break;default:h.push(g[0]),f.push(g[1])}v&&(k.box=v,h.push(v.x,v.x+v.width),f.push(v.y,v.y+v.height)),e&&("L"===k.command||"M"===k.command)&&k.prePoint&&k.nextPoint&&d.push(k)}var h=h.filter(function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}),f=f.filter(function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}),x=De(h),w=De(f),M=Be(h),O=Be(f);if(0!==d.length)for(p=0;p<d.length;p++){var k;(g=(k=d[p]).currentPoint)[0]===x?x-=Ba(k,e).xExtra:g[0]===M&&(M+=Ba(k,e).xExtra),g[1]===w?w-=Ba(k,e).yExtra:g[1]===O&&(O+=Ba(k,e).yExtra)}return{x:x,y:w,width:M-x,height:O-w}}function Ba(t,e){var n=t.prePoint,r=t.currentPoint,t=t.nextPoint,i=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-t[0],2)+Math.pow(r[1]-t[1],2),n=Math.pow(n[0]-t[0],2)+Math.pow(n[1]-t[1],2),n=Math.acos((i+a-n)/(2*Math.sqrt(i)*Math.sqrt(a)));return!n||0===Math.sin(n)||He(n,0)?{xExtra:0,yExtra:0}:(i=Math.abs(Math.atan2(t[1]-r[1],t[0]-r[0])),a=Math.abs(Math.atan2(t[0]-r[0],t[1]-r[1])),i=i>Math.PI/2?Math.PI-i:i,a=a>Math.PI/2?Math.PI-a:a,{xExtra:Math.cos(n/2-i)*(e/2*(1/Math.sin(n/2)))-e/2||0,yExtra:Math.cos(a-n/2)*(e/2*(1/Math.sin(n/2)))-e/2||0})}function Da(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Xr(function(t){return(ze(t)?t.split(" "):t).map(Pa)});function Fa(t,e,n,r,i,a,o,s){var l,c,u;return e=Math.abs(e),n=Math.abs(n),r=vr(r=Ye(r,360)),t.x===o.x&&t.y===o.y?{x:t.x,y:t.y,ellipticalArcAngle:0}:0===e||0===n?{x:0,y:0,ellipticalArcAngle:0}:(u=(t.x-o.x)/2,c=(t.y-o.y)/2,u={x:Math.cos(r)*u+Math.sin(r)*c,y:-Math.sin(r)*u+Math.cos(r)*c},1<(c=Math.pow(u.x,2)/Math.pow(e,2)+Math.pow(u.y,2)/Math.pow(n,2))&&(e=Math.sqrt(c)*e,n=Math.sqrt(c)*n),c=(c=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(u.y,2)-Math.pow(n,2)*Math.pow(u.x,2))/(Math.pow(e,2)*Math.pow(u.y,2)+Math.pow(n,2)*Math.pow(u.x,2)))<0?0:c,i=(i!==a?1:-1)*Math.sqrt(c),c=e*u.y/n*i,i*=-n*u.x/e,t={x:Math.cos(r)*c-Math.sin(r)*i+(t.x+o.x)/2,y:Math.sin(r)*c+Math.cos(r)*i+(t.y+o.y)/2},l=za({x:1,y:0},o={x:(u.x-c)/e,y:(u.y-i)/n}),o=za(o,{x:(-u.x-c)/e,y:(-u.y-i)/n}),!a&&0<o?o-=2*Math.PI:a&&o<0&&(o+=2*Math.PI),c=l+(o%=2*Math.PI)*s,u=e*Math.cos(c),i=n*Math.sin(c),{x:Math.cos(r)*u-Math.sin(r)*i+t.x,y:Math.sin(r)*u+Math.cos(r)*i+t.y,ellipticalArcStartAngle:l,ellipticalArcEndAngle:l+o,ellipticalArcAngle:c,ellipticalArcCenter:t,resultantRx:e,resultantRy:n})}var za=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)};function Wa(t){for(var e=[],n=null,r=null,i=null,a=0,o=t.length,s=0;s<o;s++){var l=t[s],r=t[s+1],c=l[0],u={command:c,prePoint:n,params:l,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(c){case"M":i=[l[1],l[2]],a=s;break;case"A":var h=function(t,e){var n=e[1],r=e[2],i=Ye(vr(e[3]),2*Math.PI),a=e[4],o=e[5],s=t[0],l=t[1],c=e[6],e=e[7],u=Math.cos(i)*(s-c)/2+Math.sin(i)*(l-e)/2,h=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(l-e)/2,f=u*u/(n*n)+h*h/(r*r);1<f&&(n*=Math.sqrt(f),r*=Math.sqrt(f));f=n*n*(h*h)+r*r*(u*u),f=f?Math.sqrt((n*n*(r*r)-f)/f):1;a===o&&(f*=-1);isNaN(f)&&(f=0);var d=r?f*n*h/r:0,f=n?f*-r*u/n:0,s=(s+c)/2+Math.cos(i)*d-Math.sin(i)*f,l=(l+e)/2+Math.sin(i)*d+Math.cos(i)*f,p=[(u-d)/n,(h-f)/r],u=[(-1*u-d)/n,(-1*h-f)/r],d=Ya([1,0],p),h=Ya(p,u);Va(p,u)<=-1&&(h=Math.PI);1<=Va(p,u)&&(h=0);0===o&&0<h&&(h-=2*Math.PI);1===o&&h<0&&(h+=2*Math.PI);return{cx:s,cy:l,rx:Ra(t,[c,e])?0:n,ry:Ra(t,[c,e])?0:r,startAngle:d,endAngle:d+h,xRotation:i,arcFlag:a,sweepFlag:o}}(n,l);u.arcParams=h}"Z"===c?(n=i,r=t[a+1]):n=[l[(v=l.length)-2],l[v-1]],r&&"Z"===r[0]&&(r=t[a],e[a])&&(e[a].prePoint=n),u.currentPoint=n,e[a]&&Ra(n,e[a].currentPoint)&&(e[a].prePoint=u.prePoint);var f,d,p,g,y,m,v=r?[r[r.length-2],r[r.length-1]]:null,b=(u.nextPoint=v,u.prePoint);["L","H","V"].includes(c)?(u.startTangent=[b[0]-n[0],b[1]-n[1]],u.endTangent=[n[0]-b[0],n[1]-b[1]]):"Q"===c?(f=[l[1],l[2]],u.startTangent=[b[0]-f[0],b[1]-f[1]],u.endTangent=[n[0]-f[0],n[1]-f[1]]):"T"===c?(f=Da((d=e[s-1]).currentPoint,b),"Q"===d.command?(u.command="Q",u.startTangent=[b[0]-f[0],b[1]-f[1]],u.endTangent=[n[0]-f[0],n[1]-f[1]]):(u.command="TL",u.startTangent=[b[0]-n[0],b[1]-n[1]],u.endTangent=[n[0]-b[0],n[1]-b[1]])):"C"===c?(p=[l[1],l[2]],g=[l[3],l[4]],u.startTangent=[b[0]-p[0],b[1]-p[1]],u.endTangent=[n[0]-g[0],n[1]-g[1]],0===u.startTangent[0]&&0===u.startTangent[1]&&(u.startTangent=[p[0]-g[0],p[1]-g[1]]),0===u.endTangent[0]&&0===u.endTangent[1]&&(u.endTangent=[g[0]-p[0],g[1]-p[1]])):"S"===c?(p=Da((d=e[s-1]).currentPoint,b),g=[l[1],l[2]],"C"===d.command?(u.command="C",u.startTangent=[b[0]-p[0],b[1]-p[1]]):(u.command="SQ",u.startTangent=[b[0]-g[0],b[1]-g[1]]),u.endTangent=[n[0]-g[0],n[1]-g[1]]):"A"===c&&(c=(b=Ga(u,0)).x,b=b.y,y=(m=Ga(u,1,!1)).x,m=m.y,u.startTangent=[c,b],u.endTangent=[y,m]),e.push(u)}return e}function Ga(t,e,n){void 0===n&&(n=!0);var r=t.arcParams,i=r.rx,i=void 0===i?0:i,a=r.ry,a=void 0===a?0:a,o=r.xRotation,s=r.arcFlag,r=r.sweepFlag,l=Fa({x:t.prePoint[0],y:t.prePoint[1]},i,a,o,!!s,!!r,{x:t.currentPoint[0],y:t.currentPoint[1]},e),i=Fa({x:t.prePoint[0],y:t.prePoint[1]},i,a,o,!!s,!!r,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),a=i.x-l.x,o=i.y-l.y,s=Math.sqrt(a*a+o*o);return{x:-a/s,y:-o/s}}function Ha(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Va(t,e){return Ha(t)*Ha(e)?(t[0]*e[0]+t[1]*e[1])/(Ha(t)*Ha(e)):1}function Ya(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Va(t,e))}function qa(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,a=t*i,i=e*i,o=n-t,t=n+t,s=r-e,e=r+e;return[["M",o,r],["C",o,r-i,n-a,s,n,s],["C",n+a,s,t,r-i,t,r],["C",t,r+i,n+a,e,n,e],["C",n-a,e,o,r+i,o,r],["Z"]]}function $a(t,e){void 0===e&&(e=t.getLocalTransform());var n,r,i,a,o,s,l,c,u,h,f,d,p=[];switch(t.nodeName){case k.LINE:var g=t.parsedStyle,y=g.x1,m=g.y1,v=g.x2,g=g.y2,p=[["M",void 0===y?0:y,void 0===m?0:m],["L",void 0===v?0:v,void 0===g?0:g]];break;case k.CIRCLE:var y=t.parsedStyle,m=y.r,v=void 0===m?0:m,g=y.cx,b=void 0===g?0:g,m=y.cy;p=qa(v,v,b,void 0===m?0:m);break;case k.ELLIPSE:g=t.parsedStyle,y=g.rx,v=g.ry,m=g.cx,b=void 0===m?0:m,m=g.cy;p=qa(void 0===y?0:y,void 0===v?0:v,b,void 0===m?0:m);break;case k.POLYLINE:case k.POLYGON:g=t.parsedStyle.points;y=g.points,v=t.nodeName===k.POLYGON,y=y.map(function(t,e){return[0===e?"M":"L",t[0],t[1]]}),v&&y.push(["Z"]),p=y;break;case k.RECT:var b=t.parsedStyle,m=b.width,x=void 0===m?0:m,g=b.height,w=void 0===g?0:g,m=b.x,g=void 0===m?0:m,m=b.y,m=void 0===m?0:m,b=b.radius,M=b&&b.some(function(t){return 0!==t});n=x,r=w,g=g,m=m,p=(M=M&&b.map(function(t){return We(t,0,Math.min(Math.abs(x)/2,Math.abs(w)/2))}))?(l=(o=0<n?1:-1)+(s=0<r?1:-1)!=0?1:0,[["M",o*(i=(M=j(M,4))[0])+g,m],["L",n-o*(a=M[1])+g,m],a?["A",a,a,0,0,l,n+g,s*a+m]:null,["L",n+g,r-s*(a=M[2])+m],a?["A",a,a,0,0,l,n+g-o*a,r+m]:null,["L",g+o*(a=M[3]),r+m],a?["A",a,a,0,0,l,g,r+m-s*a]:null,["L",g,s*i+m],i?["A",i,i,0,0,l,o*i+g,m]:null,["Z"]].filter(function(t){return t})):[["M",g,m],["L",g+n,m],["L",g+n,m+r],["L",g,m+r],["Z"]];break;case k.PATH:p=O([],j(t.parsedStyle.path.absolutePath),!1)}if(p.length)return c=p,u=e,h=(e=(e=t).parsedStyle).defX,f=void 0===h?0:h,d=void 0===(h=e.defY)?0:h,c.reduce(function(t,e){var n,r,i,a="";return"M"===e[0]||"L"===e[0]?(n=Ct(e[1]-f,e[2]-d,0),u&&Wt(n,n,u),a="".concat(e[0]).concat(n[0],",").concat(n[1])):"Z"===e[0]?a=e[0]:"C"===e[0]?(r=Ct(e[1]-f,e[2]-d,0),i=Ct(e[3]-f,e[4]-d,0),n=Ct(e[5]-f,e[6]-d,0),u&&(Wt(r,r,u),Wt(i,i,u),Wt(n,n,u)),a="".concat(e[0]).concat(r[0],",").concat(r[1],",").concat(i[0],",").concat(i[1],",").concat(n[0],",").concat(n[1])):"A"===e[0]?(n=Ct(e[6]-f,e[7]-d,0),u&&Wt(n,n,u),a="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(n[0],",").concat(n[1])):"Q"===e[0]&&(r=Ct(e[1]-f,e[2]-d,0),i=Ct(e[3]-f,e[4]-d,0),u&&(Wt(r,r,u),Wt(i,i,u)),a="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}")),t+a},"")}function Ua(e){if(""===e||Array.isArray(e)&&0===e.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var n;try{n=pe(e)}catch(t){n=pe(""),console.error("[g]: Invalid SVG Path definition: ".concat(e))}for(var t=n,r=0;r<t.length;r++){var i,a,o=t[r-1],s=t[r];"M"===s[0]&&o&&(i=o[0],s=[s[1],s[2]],a=void 0,"L"===i||"M"===i?a=[o[1],o[2]]:"C"!==i&&"A"!==i&&"Q"!==i||(a=[o[o.length-2],o[o.length-1]]),a)&&Ra(s,a)&&(t.splice(r,1),r--)}var e=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}(n),l=(c=function(t){for(var e=[],n=[],r=[],i=0;i<t.length;i++){var a=t[i],o=a[0];"M"===o?(r.length&&(n.push(r),r=[]),r.push([a[1],a[2]])):"Z"===o?r.length&&(e.push(r),r=[]):r.push([a[1],a[2]])}return 0<r.length&&n.push(r),{polygons:e,polylines:n}}(n)).polygons,c=c.polylines,u=Wa(n),h=(p=Ia(u,0)).x,f=p.y,d=p.width,p=p.height;return{absolutePath:n,hasArc:e,segments:u,polygons:l,polylines:c,totalLength:0,rect:{x:Number.isFinite(h)?h:0,y:Number.isFinite(f)?f:0,width:Number.isFinite(d)?d:0,height:Number.isFinite(p)?p:0}}}var Xa=Xr(Ua);function Ka(t){return(ze(t)?Xa:Ua)(t)}function Za(t,e,n){var r,i,a,o,s,l,c,u,h,f=t.curve,d=e.curve,t=(f&&0!==f.length||(f=be(t.absolutePath,!1),t.curve=f),d&&0!==d.length||(d=be(e.absolutePath,!1),e.curve=d),[f,d]),f=Ae((t=f.length!==d.length?function t(e,n,r){var i,e=_e(e),n=_e(n),a=e.length,o=n.length,s=e.filter(function(t){return t.l}).length,l=n.filter(function(t){return t.l}).length,s=e.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/s||0,l=n.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/l||0,c=r||Math.max(a,o),u=[s,l],h=[c-a,c-o],r=[e,n].map(function(t,n){return t.l===c?t.map(function(t){return t.s}):t.map(function(t,e){return i=e&&h[n]&&t.l>=u[n],h[n]-=i?1:0,i?t.ss:[t.s]}).flat()});return r[0].length===r[1].length?r:t(r[0],r[1],c)}(f,d):t)[0])!==Ae(t[1])?(r=t[0],e=r.slice(1).map(function(t,e,n){return(e?n[e-1].slice(-2):r[0].slice(1)).concat(t.slice(1))}).map(function(n){return n.map(function(t,e){return n[n.length-e-2*(1-e%2)]})}).reverse(),[["M"].concat(e[0].slice(0,2))].concat(e.map(function(t){return["C"].concat(t.slice(2))}))):t[0].map(function(t){return Array.isArray(t)?[].concat(t):t});return[f,(i=t[1],a=f,c=i.length-1,u=[],h=0,s=(o=i).length,l=s-1,(d=o.map(function(t,r){return o.map(function(t,e){var n=r+e;return 0===e||o[n]&&"M"===o[n][0]?(e=o[n],["M"].concat(e.slice(-2))):(s<=n&&(n-=l),o[n])})})).forEach(function(t,n){i.slice(1).forEach(function(t,e){h+=xe(i[(n+e)%c].slice(-2),a[e%c].slice(-2))}),u[n]=h,h=0}),d[u.indexOf(Math.min.apply(null,u))]),function(t){return t}]}function Qa(t,e){var n,r,i=ze(t)?t.split(" ").map(function(t){var t=j(t.split(","),2),e=t[0],t=t[1];return[Number(e),Number(t)]}):t,a=[],o=0,s=Vn(i),t=(i.forEach(function(t,e){i[e+1]&&((n=[0,0])[0]=o/s,r=Dn(t[0],t[1],i[e+1][0],i[e+1][1]),o+=r,n[1]=o/s,a.push(n))}),Math.min.apply(Math,O([],j(i.map(function(t){return t[0]})),!1))),l=Math.min.apply(Math,O([],j(i.map(function(t){return t[1]})),!1));return e&&(e.parsedStyle.defX=t,e.parsedStyle.defY=l),{points:i,totalLength:s,segments:a}}function Ja(t,e){return[t.points,e.points,function(t){return t}]}var to=null;function eo(t){return function(e){var n=0;return t.map(function(t){return t===to?e[n++]:t})}}function no(t){return t}var ro={matrix:["NNNNNN",[to,to,0,0,to,to,0,0,0,0,1,0,to,to,0,1],no],matrix3d:["NNNNNNNNNNNNNNNN",no],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",eo([to,to,new xi(1)]),no],scalex:["N",eo([to,new xi(1),new xi(1)]),eo([to,new xi(1)])],scaley:["N",eo([new xi(1),to,new xi(1)]),eo([new xi(1),to])],scalez:["N",eo([new xi(1),new xi(1),to])],scale3d:["NNN",no],skew:["Aa",null,no],skewx:["A",null,eo([to,ki])],skewy:["A",null,eo([ki,to])],translate:["Tt",eo([to,to,Oi]),no],translatex:["T",eo([to,Oi,Oi]),eo([to,Oi])],translatey:["T",eo([Oi,to,Oi]),eo([Oi,to])],translatez:["L",eo([Oi,Oi,to])],translate3d:["TTL",no]};function io(t){if("none"!==(t=(t||"none").toLowerCase().trim()))for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];var i=e.index+e[0].length,a=e[1],o=ro[a];if(!o)return[];var s=e[2].split(","),l=o[0];if(l.length<s.length)return[];for(var c=[],u=0;u<l.length;u++){var h=s[u],f=l[u],d=void 0;if(void 0===(d=h?{A:function(t){return"0"===t.trim()?ki:Ma(t)},N:Pa,T:wa,L:xa}[f.toUpperCase()](h):{a:ki,n:c[0],t:Oi}[f]))return[];c.push(d)}if(r.push({t:a,d:c}),n.lastIndex===t.length)return r}return[]}function ao(t){switch(t.t){case"rotatex":return i=vr(Oa(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=vr(Oa(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=vr(Oa(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":var e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=vr(Oa(t.d[3])),a=e*e+n*n+r*r,a=(0==a?(e=1,r=n=0):1!=a&&(e/=a=Math.sqrt(a),n/=a,r/=a),Math.sin(i/2)),o=a*Math.cos(i/2),a=a*a;return[1-2*(n*n+r*r)*a,2*(e*n*a+r*o),2*(e*r*a-n*o),0,2*(e*n*a-r*o),1-2*(e*e+r*r)*a,2*(n*r*a+e*o),0,2*(e*r*a+n*o),2*(n*r*a-e*o),1-2*(e*e+n*n)*a,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":o=vr(Oa(t.d[0])),a=vr(Oa(t.d[1]));return[1,Math.tan(a),0,0,Math.tan(o),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return i=vr(Oa(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=vr(Oa(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=Sa(t.d[0],0,null)||0,n=Sa(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Sa(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=Sa(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=Sa(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Sa(t.d[0],0,null)||0,n=Sa(t.d[1],0,null)||0,r=Sa(t.d[2],0,null)||0,1];case"perspective":a=Sa(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,a?-1/a: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 oo(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 so(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],a=[0,0,0,1];return Ar(0===(t=t).length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(ao).reduce(oo),e,n,r,i,a),[[e,n,r,a,i]]}var lo=function(t,e,n,r,i){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],o=0;o<4;o++)a[o][3]=i[o];for(o=0;o<3;o++)for(var s=0;s<3;s++)a[3][o]+=t[s]*a[s][o];var l=r[0],c=r[1],u=r[2],r=r[3],h=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],u=(h[0][0]=1-2*(c*c+u*u),h[0][1]=2*(l*c-u*r),h[0][2]=2*(l*u+c*r),h[1][0]=2*(l*c+u*r),h[1][1]=1-2*(l*l+u*u),h[1][2]=2*(c*u-l*r),h[2][0]=2*(l*u-c*r),h[2][1]=2*(c*u+l*r),h[2][2]=1-2*(l*l+c*c),a=co(a,h),[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]);for(n[2]&&(u[2][1]=n[2],a=co(a,u)),n[1]&&(u[2][1]=0,u[2][0]=n[0],a=co(a,u)),n[0]&&(u[2][0]=0,u[1][0]=n[0],a=co(a,u)),o=0;o<3;o++)for(s=0;s<3;s++)a[o][s]*=e[o];return 0==(r=a)[0][2]&&0==r[0][3]&&0==r[1][2]&&0==r[1][3]&&0==r[2][0]&&0==r[2][1]&&1==r[2][2]&&0==r[2][3]&&0==r[3][2]&&1==r[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 co(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 a=0;a<4;a++)n[r][i]+=e[r][a]*t[a][i];return n}function uo(t){return t.toFixed(6).replace(".000000","")}function ho(e,n){var r,i;return e.decompositionPair!==n&&(e.decompositionPair=n,r=so(e)),n.decompositionPair!==e&&(n.decompositionPair=e,i=so(n)),null===r[0]||null===i[0]?[[!1],[!0],function(t){return(t?n:e)[0].d}]:(r[0].push(0),i[0].push(1),[r,i,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;r<t.length;r++)n+=t[r]*e[r];return n}(t,e),i=(r=We(r,-1,1),[]);if(1===r)i=t;else for(var a=Math.acos(r),o=+Math.sin(n*a)/Math.sqrt(1-r*r),s=0;s<4;s++)i.push(t[s]*(Math.cos(n*a)-r*o)+e[s]*o);return i}(r[0][3],i[0][3],t[5]);return lo(t[0],t[1],t[2],e,t[4]).map(uo).join(",")}])}function fo(t){return t.replace(/[xy]/,"")}function po(t){return t.replace(/(x|y|z|3d)?$/,"3d")}var go=function(t,e){return"perspective"===t&&"perspective"===e||("matrix"===t||"matrix3d"===t)&&("matrix"===e||"matrix3d"===e)};function yo(r,i,t){var e=!1;if(!r.length||!i.length){r.length||(e=!0,r=i,i=[]);for(var n=0;n<r.length;n++)!function(t){var t=r[t],e=t.t,t=t.d,n="scale"===e.substring(0,5)?1:0;i.push({t:e,d:t.map(function(t){return"number"==typeof t?Ri(n):Ri(n,t.unit)})})}(n)}var a=[],o=[],s=[];if(r.length!==i.length)a=[(g=ho(r,i))[0]],o=[g[1]],s=[["matrix",[g[2]]]];else for(n=0;n<r.length;n++){var l=r[n].t,c=i[n].t,u=r[n].d,h=i[n].d,f=ro[l],d=ro[c],p=void 0;if(go(l,c)){var g=ho([r[n]],[i[n]]);a.push(g[0]),o.push(g[1]),s.push(["matrix",[g[2]]])}else{if(l===c)p=l;else if(f[2]&&d[2]&&fo(l)===fo(c))p=fo(l),u=f[2](u),h=d[2](h);else{if(!f[1]||!d[1]||po(l)!==po(c)){a=[(g=ho(r,i))[0]],o=[g[1]],s=[["matrix",[g[2]]]];break}p=po(l),u=f[1](u),h=d[1](h)}for(var y=[],m=[],v=[],b=0;b<u.length;b++){g=function(t,e,n,r,i){void 0===i&&(i=0);var a="",o=t.value||0,s=e.value||0,l=yi(t.unit),c=t.convertTo(l),l=e.convertTo(l);return c&&l?(o=c.value,s=l.value,a=Zr(t.unit)):(xi.isLength(t.unit)||xi.isLength(e.unit))&&(o=Sa(t,i,n),s=Sa(e,i,n),a="px"),[o,s,function(t){return(t=r?Math.max(t,0):t)+a}]}(u[b],h[b],t,!1,b);y[b]=g[0],m[b]=g[1],v.push(g[2])}a.push(y),o.push(m),s.push([p,v])}}return e&&(e=a,a=o,o=e),[a,o,function(t){return t.map(function(t,n){t=t.map(function(t,e){return s[n][1][e](t)}).join(",");return"matrix"===s[n][0]&&16===t.split(",").length&&(s[n][0]="matrix3d"),"matrix3d"===s[n][0]&&6===t.split(",").length&&(s[n][0]="matrix"),s[n][0]+"("+t+")"}).join(" ")}]}var mo=Xr(function(t){var e;return ze(t)?"text-anchor"===t?[Ri(0,"px"),Ri(0,"px")]:(1===(e=t.split(" ")).length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[wa(vo(e[0])),wa(vo(e[1]))]):[Ri(t[0]||0,"px"),Ri(t[1]||0,"px")]});function vo(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var bo=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:a.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:a.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:a.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:a.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:a.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:a.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:a.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:a.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:a.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:a.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:a.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:a.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:a.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:a.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:a.FILTER},{n:"clipPath",syntax:a.DEFINED_PATH},{n:"textPath",syntax:a.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:a.TRANSFORM},{n:"transformOrigin",p:100,d:function(t){return t===k.CIRCLE||t===k.ELLIPSE?"center":t===k.TEXT?"text-anchor":"left top"},l:!0,syntax:a.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(t){return t===k.CIRCLE||t===k.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:a.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:a.COORDINATE},{n:"cy",int:!0,d:"0",syntax:a.COORDINATE},{n:"cz",int:!0,d:"0",syntax:a.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:a.COORDINATE},{n:"y",int:!0,d:"0",syntax:a.COORDINATE},{n:"z",int:!0,d:"0",syntax:a.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:a.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:a.COORDINATE},{n:"y1",int:!0,l:!0,syntax:a.COORDINATE},{n:"z1",int:!0,l:!0,syntax:a.COORDINATE},{n:"x2",int:!0,l:!0,syntax:a.COORDINATE},{n:"y2",int:!0,l:!0,syntax:a.COORDINATE},{n:"z2",int:!0,l:!0,syntax:a.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:a.PATH,p:50},{n:"points",int:!0,l:!0,syntax:a.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:a.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:a.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:a.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:a.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:a.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:a.NUMBER,d:function(t){return t===k.PATH||t===k.POLYGON||t===k.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:a.MARKER},{n:"markerEnd",syntax:a.MARKER},{n:"markerMid",syntax:a.MARKER},{n:"markerStartOffset",syntax:a.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:a.LENGTH,l:!0,int:!0,d:"0"}],xo=bo.filter(function(t){return!!t.l}).map(function(t){return t.n}),wo={},Mo=new WeakMap,i=(Oo.prototype.registerMetadata=function(e){O([e.n],j(e.a||[]),!1).forEach(function(t){wo[t]=e})},Oo.prototype.unregisterMetadata=function(t){delete wo[t]},Oo.prototype.getPropertySyntax=function(t){return this.runtime.CSSPropertySyntaxFactory[t]},Oo.prototype.processProperties=function(n,e,t){var r=this;if(void 0===t&&(t={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[]}),this.runtime.enableCSSParsing){var i=t.skipUpdateAttribute,a=t.skipParse,o=t.forceUpdateGeometry,s=t.usedAttributes,l=o,c=Object.keys(e);c.forEach(function(t){i||(n.attributes[t]=e[t]),!l&&null!=(t=wo[t])&&t.l&&(l=!0)}),a||c.forEach(function(t){n.computedStyle[t]=r.parseProperty(t,n.attributes[t],n)}),(c=null!=s&&s.length?Array.from(new Set(c.concat(s))):c).forEach(function(t){t in n.computedStyle&&(n.parsedStyle[t]=r.computeProperty(t,n.computedStyle[t],n))}),l&&this.updateGeometry(n),c.forEach(function(t){t in n.parsedStyle&&r.postProcessProperty(t,n,c)}),this.runtime.enableCSSParsing&&n.children.length&&c.forEach(function(e){e in n.parsedStyle&&r.isPropertyInheritable(e)&&n.children.forEach(function(t){t.internalSetAttribute(e,null,{skipUpdateAttribute:!0,skipParse:!0})})})}else{Object.assign(n.attributes,e);var o=Object.keys(e),a=n.parsedStyle.clipPath,s=n.parsedStyle.offsetPath,u=(n.parsedStyle=Object.assign(n.parsedStyle,e),!!t.forceUpdateGeometry);if(!u)for(var h=0;h<xo.length;h++)if(xo[h]in e){u=!0;break}e.fill&&(n.parsedStyle.fill=ma(e.fill)),e.stroke&&(n.parsedStyle.stroke=ma(e.stroke)),e.shadowColor&&(n.parsedStyle.shadowColor=ma(e.shadowColor)),e.filter&&(n.parsedStyle.filter=_a(e.filter)),P(e.radius)||(n.parsedStyle.radius=ka(e.radius,4)),P(e.lineDash)||(n.parsedStyle.lineDash=ka(e.lineDash,2)),e.points&&(n.parsedStyle.points=Qa(e.points,n)),""===e.path&&(n.parsedStyle.path=m({},Bi)),e.path&&(n.parsedStyle.path=Ka(e.path),n.parsedStyle.defX=n.parsedStyle.path.rect.x,n.parsedStyle.defY=n.parsedStyle.path.rect.y),e.textTransform&&this.runtime.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:e.textTransform},n,null),e.clipPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",a,e.clipPath,n,this.runtime),e.offsetPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",s,e.offsetPath,n,this.runtime),e.anchor&&(n.parsedStyle.anchor=ka(e.anchor,2)),e.transform&&(n.parsedStyle.transform=io(e.transform)),e.transformOrigin&&(n.parsedStyle.transformOrigin=mo(e.transformOrigin)),e.markerStart&&(n.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerStart,e.markerStart,null,null)),e.markerEnd&&(n.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerEnd,e.markerEnd,null,null)),e.markerMid&&(n.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator("",e.markerMid,e.markerMid,null,null)),(n.nodeName!==k.CIRCLE&&n.nodeName!==k.ELLIPSE||P(e.cx)&&P(e.cy))&&(n.nodeName!==k.RECT&&n.nodeName!==k.IMAGE&&n.nodeName!==k.GROUP&&n.nodeName!==k.HTML&&n.nodeName!==k.TEXT&&n.nodeName!==k.MESH||P(e.x)&&P(e.y)&&P(e.z))&&(n.nodeName!==k.LINE||P(e.x1)&&P(e.y1)&&P(e.z1)&&P(e.x2)&&P(e.y2)&&P(e.z2))||this.runtime.CSSPropertySyntaxFactory["<coordinate>"].postProcessor(n,o),P(e.zIndex)||this.runtime.CSSPropertySyntaxFactory["<z-index>"].postProcessor(n,o),e.path&&this.runtime.CSSPropertySyntaxFactory["<path>"].postProcessor(n,o),e.points&&this.runtime.CSSPropertySyntaxFactory["<list-of-points>"].postProcessor(n,o),P(e.offsetDistance)||this.runtime.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(n,o),e.transform&&this.runtime.CSSPropertySyntaxFactory["<transform>"].postProcessor(n,o),u&&this.updateGeometry(n)}},Oo.prototype.parseProperty=function(t,e,n){var r,t=wo[t],i=e;return"unset"===(e=""!==e&&!P(e)?e:"unset")||"initial"===e||"inherit"===e?i=Ai(e):t&&(r=t.k,t=(t=t.syntax)&&this.getPropertySyntax(t),r&&-1<r.indexOf(e)?i=Ai(e):t&&t.parser&&(i=t.parser(e,n))),i},Oo.prototype.computeProperty=function(t,e,n){var r=wo[t],i="g-root"===n.id,a=e;if(r){var o=r.syntax,s=r.inh,r=r.d;if(e instanceof ui){var l=e.value;if("initial"===(l="unset"===l?s&&!i?"inherit":"initial":l))P(r)||(e=this.parseProperty(t,pi(r)?r(n.nodeName):r,n));else if("inherit"===l)return s=this.tryToResolveProperty(n,t,{inherited:!0}),P(s)?void this.addUnresolveProperty(n,t):s}i=o&&this.getPropertySyntax(o);a=i&&i.calculator?(r=n.parsedStyle[t],i.calculator(t,r,e,n,this.runtime)):e instanceof ui?e.value:e}return a},Oo.prototype.postProcessProperty=function(t,e,n){var t=wo[t];t&&t.syntax&&(t=t.syntax&&this.getPropertySyntax(t.syntax))&&t.postProcessor&&t.postProcessor(e,n)},Oo.prototype.addUnresolveProperty=function(t,e){var n=Mo.get(t);n||(Mo.set(t,[]),n=Mo.get(t)),-1===n.indexOf(e)&&n.push(e)},Oo.prototype.tryToResolveProperty=function(t,e,n){var n=(n=void 0===n?{}:n).inherited;if(n&&(t.parentElement&&function(t,e){t=Mo.get(t);return!t||0===t.length||t.includes(e)}(t.parentElement,e)))return"unset"===(n=t.parentElement.parsedStyle[e])||"initial"===n||"inherit"===n?void 0:n},Oo.prototype.recalc=function(e){var n,t=Mo.get(e);t&&t.length&&(n={},t.forEach(function(t){n[t]=e.attributes[t]}),this.processProperties(e,n),Mo.delete(e))},Oo.prototype.updateGeometry=function(t){var s,e,n,r,i,a,o,l,c,u,h,f,d,p,g,y=t.nodeName,m=this.runtime.geometryUpdaterFactory[y];m&&((s=t.geometry).contentBounds||(s.contentBounds=new Tr),s.renderBounds||(s.renderBounds=new Tr),e=t.parsedStyle,n=(m=m.update(e,t)).width,r=m.height,h=void 0===(h=m.depth)?0:h,u=void 0===(u=m.offsetX)?0:u,p=void 0===(p=m.offsetY)?0:p,m=void 0===(m=m.offsetZ)?0:m,h=[Math.abs(n)/2,Math.abs(r)/2,h/2],l=e.stroke,c=e.lineWidth,g=e.increasedLineWidthForHitTesting,d=e.shadowType,f=e.shadowColor,i=void 0===(i=e.filter)?[]:i,a=e.transformOrigin,o=e.anchor,y===k.TEXT?delete e.anchor:y===k.MESH&&(e.anchor[2]=.5),u=[(1-2*(o&&o[0]||0))*n/2+u,(1-2*(o&&o[1]||0))*r/2+p,(1-2*(o&&o[2]||0))*h[2]+m],s.contentBounds.update(u,h),p=y===k.POLYLINE||y===k.POLYGON||y===k.PATH?Math.SQRT2:.5,l&&!l.isNone&&(h[0]+=m=((c||0)+(g||0))*p,h[1]+=m),s.renderBounds.update(u,h),f&&d&&"inner"!==d&&(l=(y=s.renderBounds).min,c=y.max,g=e.shadowBlur||0,p=e.shadowOffsetX||0,m=e.shadowOffsetY||0,u=l[0]-g+p,h=c[0]+g+p,f=l[1]-g+m,d=c[1]+g+m,l[0]=Math.min(l[0],u),c[0]=Math.max(c[0],h),l[1]=Math.min(l[1],f),c[1]=Math.max(c[1],d),s.renderBounds.setMinMax(l,c)),i.forEach(function(t){var e,n,r,i,a,o=t.name,t=t.params;"blur"===o?(i=t[0].value,s.renderBounds.update(s.renderBounds.center,pr(s.renderBounds.halfExtents,s.renderBounds.halfExtents,[i,i,0]))):"drop-shadow"===o&&(i=t[0].value,o=t[1].value,t=t[2].value,e=(n=s.renderBounds).min,n=n.max,r=e[0]-t+i,i=n[0]+t+i,a=e[1]-t+o,t=n[1]+t+o,e[0]=Math.min(e[0],r),n[0]=Math.max(n[0],i),e[1]=Math.min(e[1],a),n[1]=Math.max(n[1],t),s.renderBounds.setMinMax(e,n))}),o=e.anchor,y=r<0,g=((p=n<0)?-1:1)*(a?Sa(a[0],0,t):0),m=(y?-1:1)*(a?Sa(a[1],1,t):0),g-=(p?-1:1)*(o&&o[0]||0)*s.contentBounds.halfExtents[0]*2,m-=(y?-1:1)*(o&&o[1]||0)*s.contentBounds.halfExtents[1]*2,t.setOrigin(g,m),this.runtime.sceneGraphService.dirtifyToRoot(t))},Oo.prototype.isPropertyInheritable=function(t){t=wo[t];return!!t&&t.inh},Oo);function Oo(t){var e=this;this.runtime=t,bo.forEach(function(t){e.registerMetadata(t)})}ko.prototype.calculator=function(t,e,n,r){return Oa(n)};ii=ko;function ko(){this.parser=Ma,this.parserWithCSSDisabled=null,this.mixer=Ca}Eo.prototype.calculator=function(t,e,n,r,i){return n instanceof ui&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach(function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)}),n};o=Eo;function Eo(){}Ao.prototype.calculator=function(t,e,n,r){return n instanceof ui?"none"===n.value?Li:Ni:n};var So=Ao;function Ao(){this.parser=ma,this.parserWithCSSDisabled=ma,this.mixer=va}To.prototype.calculator=function(t,e,n){return n instanceof ui?[]:n};var _o=To;function To(){this.parser=_a}function Po(t){t=t.parsedStyle.fontSize;return P(t)?null:t}Lo.prototype.calculator=function(t,e,n,r,i){var a,o;return Ge(n)?n:xi.isRelativeUnit(n.unit)?(i=i.styleValueRegistry,n.unit===g.kPercentage?0:n.unit===g.kEms?r.parentNode&&(o=Po(r.parentNode))?o*n.value:(i.addUnresolveProperty(r,t),0):n.unit===g.kRems?null!=(a=null==r?void 0:r.ownerDocument)&&a.documentElement&&(o=Po(r.ownerDocument.documentElement))?o*n.value:(i.addUnresolveProperty(r,t),0):void 0):n.value};var Co=Lo;function Lo(){this.parser=wa,this.parserWithCSSDisabled=null,this.mixer=Ca}jo.prototype.parser=function(t){t=Ea(Ge(t)?[t]:t),t=1===t.length?[t[0],t[0]]:[t[0],t[1]];return t},jo.prototype.calculator=function(t,e,n){return n.map(function(t){return t.value})};var No=jo;function jo(){this.mixer=Na}Io.prototype.parser=function(t){t=Ea(Ge(t)?[t]:t),t=1===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:3===t.length?[t[0],t[1],t[2],t[1]]:[t[0],t[1],t[2],t[3]];return t},Io.prototype.calculator=function(t,e,n){return n.map(function(t){return t.value})};var Ro=Io;function Io(){this.mixer=Na}var Bo=Z();function Do(t,l){var c=l.parsedStyle.defX||0,u=l.parsedStyle.defY||0;return l.resetLocalTransform(),l.setLocalPosition(c,u),t.forEach(function(t){var e,n,r,i,a,o,s=t.t,t=t.d;"scale"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1,1],l.scaleLocal(o[0],o[1],1)):"scalex"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1],l.scaleLocal(o[0],1,1)):"scaley"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1],l.scaleLocal(1,o[0],1)):"scalez"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1],l.scaleLocal(1,1,o[0])):"scale3d"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1,1,1],l.scaleLocal(o[0],o[1],o[2])):"translate"===s?l.translateLocal((e=t||[Oi,Oi])[0].value,e[1].value,0):"translatex"===s?l.translateLocal((e=t||[Oi])[0].value,0,0):"translatey"===s?l.translateLocal(0,(e=t||[Oi])[0].value,0):"translatez"===s?l.translateLocal(0,0,(e=t||[Oi])[0].value):"translate3d"===s?l.translateLocal((e=t||[Oi,Oi,Oi])[0].value,e[1].value,e[2].value):"rotate"===s?l.rotateLocal(0,0,Oa((t||[ki])[0])):"rotatex"===s?l.rotateLocal(Oa((t||[ki])[0]),0,0):"rotatey"===s?l.rotateLocal(0,Oa((t||[ki])[0]),0):"rotatez"===s?l.rotateLocal(0,0,Oa((t||[ki])[0])):"rotate3d"!==s&&("skew"===s?(n=(null==t?void 0:t.map(function(t){return t.value}))||[0,0],l.setLocalSkew(vr(n[0]),vr(n[1]))):"skewx"===s?(n=(null==t?void 0:t.map(function(t){return t.value}))||[0],l.setLocalSkew(vr(n[0]),l.getLocalSkew()[1])):"skewy"===s?(n=(null==t?void 0:t.map(function(t){return t.value}))||[0],l.setLocalSkew(l.getLocalSkew()[0],vr(n[0]))):"matrix"===s?(e=(o=j(t.map(function(t){return t.value}),6))[0],n=o[1],r=o[2],i=o[3],a=o[4],o=o[5],l.setLocalTransform(tt(Bo,e,n,0,0,r,i,0,0,0,0,1,0,a+c,o+u,0,1))):"matrix3d"===s&&(tt.apply(_t,O([Bo],j(t.map(function(t){return t.value})),!1)),Bo[12]+=c,Bo[13]+=u,l.setLocalTransform(Bo)))}),l.getLocalTransform()}t(Wo,Fo=Co),Wo.prototype.postProcessor=function(t,e){var n,r;switch(t.nodeName){case k.CIRCLE:case k.ELLIPSE:var i=t.parsedStyle,a=i.cx,o=i.cy,i=i.cz;P(a)||(l=a),P(o)||(c=o),P(i)||(u=i);break;case k.LINE:var a=t.parsedStyle,o=a.x1,i=a.x2,s=a.y1,a=a.y2,l=Math.min(o,i),c=Math.min(s,a),u=0;break;case k.RECT:case k.IMAGE:case k.GROUP:case k.HTML:case k.TEXT:case k.MESH:P(t.parsedStyle.x)||(l=t.parsedStyle.x),P(t.parsedStyle.y)||(c=t.parsedStyle.y),P(t.parsedStyle.z)||(u=t.parsedStyle.z)}t.nodeName!==k.PATH&&t.nodeName!==k.POLYLINE&&t.nodeName!==k.POLYGON&&(t.parsedStyle.defX=l||0,t.parsedStyle.defY=c||0),P(l)&&P(c)&&P(u)||-1!==e.indexOf("transform")||((e=t.parsedStyle.transform)&&e.length?Do(e,t):(n=(e=j(t.getLocalPosition(),3))[0],r=e[1],e=e[2],t.setLocalPosition(P(l)?n:l,P(c)?r:c,P(u)?e:u)))};var Fo,zo=Wo;function Wo(){return null!==Fo&&Fo.apply(this,arguments)||this}Ho.prototype.calculator=function(t,e,n,r){n=null==(n=n instanceof ui?null:n)?void 0:n.cloneNode(!0);return n&&(n.style.isMarker=!0),n};var Go=Ho;function Ho(){}Yo.prototype.calculator=function(t,e,n){return n.value};var Vo=Yo;function Yo(){this.mixer=Ca,this.parser=Pa,this.parserWithCSSDisabled=null}$o.prototype.calculator=function(t,e,n){return n.value},$o.prototype.postProcessor=function(t){var e,n=t.parsedStyle,r=n.offsetPath,n=n.offsetDistance;!r||(e=r.nodeName)!==k.LINE&&e!==k.PATH&&e!==k.POLYLINE||(e=r.getPoint(n))&&(t.parsedStyle.defX=e.x,t.parsedStyle.defY=e.y,t.setLocalPosition(e.x,e.y))};var qo=$o;function $o(){this.parser=Pa,this.parserWithCSSDisabled=null,this.mixer=La(0,1)}Xo.prototype.calculator=function(t,e,n){return n.value};var Uo=Xo;function Xo(){this.parser=Pa,this.parserWithCSSDisabled=null,this.mixer=La(0,1)}Zo.prototype.calculator=function(t,e,n){return n instanceof ui&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Dr(0,0,0,0)}:n},Zo.prototype.postProcessor=function(t,e){var n;t.parsedStyle.defX=t.parsedStyle.path.rect.x,t.parsedStyle.defY=t.parsedStyle.path.rect.y,t.nodeName===k.PATH&&-1===e.indexOf("transform")&&(n=(e=t.parsedStyle).defX,e=e.defY,t.setLocalPosition(void 0===n?0:n,void 0===e?0:e))};var Ko=Zo;function Zo(){this.parser=Ka,this.parserWithCSSDisabled=Ka,this.mixer=Za}Jo.prototype.postProcessor=function(t,e){var n;t.nodeName!==k.POLYGON&&t.nodeName!==k.POLYLINE||-1!==e.indexOf("transform")||(n=(e=t.parsedStyle).defX,e=e.defY,t.setLocalPosition(n,e))};var Qo=Jo;function Jo(){this.parser=Qa,this.mixer=Ja}t(ns,ts=Co);var ts,es=ns;function ns(){var t=null!==ts&&ts.apply(this,arguments)||this;return t.mixer=La(0,1/0),t}is.prototype.calculator=function(t,e,n,r){return n instanceof ui?"unset"===n.value?"":n.value:"".concat(n)},is.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""};var rs=is;function is(){}os.prototype.calculator=function(t,e,n,r){var i,a=r.getAttribute("text");return a&&(i=a,"capitalize"===n.value?i=a.charAt(0).toUpperCase()+a.slice(1):"lowercase"===n.value?i=a.toLowerCase():"uppercase"===n.value&&(i=a.toUpperCase()),r.parsedStyle.text=i),n.value};var as=os;function os(){}var ss={},ls=0;var cs="undefined"!=typeof window&&void 0!==window.document;function us(t,e){var n=Number(t.parsedStyle.zIndex),r=Number(e.parsedStyle.zIndex);if(n===r){var i=t.parentNode;if(i)return(i=i.childNodes||[]).indexOf(t)-i.indexOf(e)}return n-r}function hs(t){var e,n=t;do{if(null==(e=n.parsedStyle)?void 0:e.clipPath)return n}while(null!==(n=n.parentElement));return null}function fs(t,e){if(cs)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var ds={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},ps="object"==typeof performance&&performance.now?performance:Date;function gs(t,e,n){var r=!1,i=!1,e=!!e&&!e.isNone,n=!!n&&!n.isNone;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=e,i=n):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(i=r=!0),[r,i]}function ys(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var n=Date.now(),e=16<(e=n-Es)?0:16-e,r=xs();return ks[r]=t,1<Object.keys(ks).length||setTimeout(function(){Es=n;var e=ks;ks={},Object.keys(e).forEach(function(t){return e[t](Os())})},e),r}function ms(t){delete ks[t]}function vs(t){return"string"!=typeof t?ys:""===t?ws.requestAnimationFrame:ws[t+"RequestAnimationFrame"]}var bs=1,xs=function(){return bs++},ws="object"==typeof self&&self.self==self?self:"object"==typeof S&&S.global==S?S:{},Ms=Date.now(),Os=function(){return ws.performance&&"function"==typeof ws.performance.now?ws.performance.now():Date.now()-Ms},ks={},Es=Date.now(),Ss=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],vs),As=vs(Ss),_s="string"!=typeof(Ss=Ss)?ms:""===Ss?ws.cancelAnimationFrame:ws[Ss+"CancelAnimationFrame"]||ws[Ss+"CancelRequestAnimationFrame"],Ts=(ws.requestAnimationFrame=As,ws.cancelAnimationFrame=_s,Ps.prototype.getCallbacksNum=function(){return this.callbacks.length},Ps.prototype.tapPromise=function(t,e){this.callbacks.push(e)},Ps.prototype.promise=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Promise.all(this.callbacks.map(function(t){return t.apply(void 0,O([],j(e),!1))}))},Ps);function Ps(){this.callbacks=[]}Ls.prototype.tapPromise=function(t,e){this.callbacks.push(e)},Ls.prototype.promise=function(){for(var i=[],t=0;t<arguments.length;t++)i[t]=arguments[t];return X(this,void 0,void 0,function(){var e,n,r;return R(this,function(t){switch(t.label){case 0:return this.callbacks.length?[4,(r=this.callbacks)[0].apply(r,O([],j(i),!1))]:[3,6];case 1:e=t.sent(),n=0,t.label=2;case 2:return n<this.callbacks.length-1?[4,(0,this.callbacks[n])(e)]:[3,5];case 3:e=t.sent(),t.label=4;case 4:return n++,[3,2];case 5:return[2,e];case 6:return[2,null]}})})};var Cs=Ls;function Ls(){this.callbacks=[]}js.prototype.tap=function(t,e){this.callbacks.push(e)},js.prototype.call=function(){var e=arguments;this.callbacks.forEach(function(t){t.apply(void 0,e)})};var Ns=js;function js(){this.callbacks=[]}Is.prototype.tap=function(t,e){this.callbacks.push(e)},Is.prototype.call=function(){if(this.callbacks.length){for(var t=this.callbacks[0].apply(void 0,arguments),e=0;e<this.callbacks.length-1;e++)t=(0,this.callbacks[e])(t);return t}return null};var Rs=Is;function Is(){this.callbacks=[]}var Bs=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Ds=/([\"\'])[^\'\"]+\1/;Fs.prototype.calculator=function(t,e,n,r){return n instanceof ui?[]:n},Fs.prototype.postProcessor=function(t){Do(t.parsedStyle.transform,t)};Ss=Fs;function Fs(){this.parser=io,this.parserWithCSSDisabled=io,this.mixer=yo}var zs=function(){this.parser=mo},Ws=(Gs.prototype.calculator=function(t,e,n,r){return n.value},Gs.prototype.postProcessor=function(t){var e;t.parentNode&&(e=(t=t.parentNode).renderable,t=t.sortable,e&&(e.dirty=!0),t)&&(t.dirty=!0,t.dirtyReason=Ti.Z_INDEX_CHANGED)},Gs);function Gs(){this.parser=Pa}Vs.prototype.update=function(t,e){t=t.r;return{width:2*t,height:2*t}};var Hs=Vs;function Vs(){}qs.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}};var Ys=qs;function qs(){}Us.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,t=t.y2,i=Math.min(e,r),e=Math.max(e,r),r=Math.min(n,t);return{width:e-i,height:Math.max(n,t)-r}};var $s=Us;function Us(){}Ks.prototype.update=function(t){t=t.path.rect;return{width:t.width,height:t.height}};var Xs=Ks;function Ks(){}Qs.prototype.update=function(t){var t=t.points.points,e=Math.min.apply(Math,O([],j(t.map(function(t){return t[0]})),!1)),n=Math.max.apply(Math,O([],j(t.map(function(t){return t[0]})),!1)),r=Math.min.apply(Math,O([],j(t.map(function(t){return t[1]})),!1));return{width:n-e,height:Math.max.apply(Math,O([],j(t.map(function(t){return t[1]})),!1))-r}};var Zs=Qs;function Qs(){}tl.prototype.update=function(t,e){var n=t.img,r=t.width,i=t.height,r=void 0===r?0:r,i=void 0===i?0:i;return n&&!ze(n)&&(r||(r=n.width,t.width=r),i||(i=n.height,t.height=i)),{width:r,height:i}};var Js=tl;function tl(){}nl.prototype.isReadyToMeasure=function(t,e){var n=t.text,r=t.textAlign,i=t.textBaseline,a=t.fontSize,o=t.fontStyle,s=t.fontWeight,l=t.fontVariant,t=t.lineWidth;return n&&a&&o&&s&&l&&r&&i&&!P(t)},nl.prototype.update=function(t,e){var n,r,i,a=t.text,o=t.textAlign,s=t.lineWidth,l=t.textBaseline,c=t.dx,u=t.dy;return this.isReadyToMeasure(t,e)?(e=((null==(e=null==(e=null==e?void 0:e.ownerDocument)?void 0:e.defaultView)?void 0:e.getConfig())||{}).offscreenCanvas,a=this.globalRuntime.textService.measureText(a,t,e),e=(t.metrics=a).width,r=a.height,n=a.lineHeight,a=a.fontProperties,e=[e/2,r/2,0],r=[0,1],i=0,"center"===o||"middle"===o?(i=s/2,r=[.5,1]):"right"!==o&&"end"!==o||(i=s,r=[1,1]),o=0,"middle"===l?o=e[1]:"top"===l||"hanging"===l?o=2*e[1]:"alphabetic"===l?o=this.globalRuntime.enableCSSParsing?n-a.ascent:0:"bottom"!==l&&"ideographic"!==l||(o=0),c&&(i+=c),u&&(o+=u),t.anchor=[r[0],r[1],0],{width:2*e[0],height:2*e[1],offsetX:i,offsetY:o}):(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 el=nl;function nl(t){this.globalRuntime=t}Object.defineProperty(il.prototype,"name",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(il.prototype,"layerX",{get:function(){return this.layer.x},enumerable:!1,configurable:!0}),Object.defineProperty(il.prototype,"layerY",{get:function(){return this.layer.y},enumerable:!1,configurable:!0}),Object.defineProperty(il.prototype,"pageX",{get:function(){return this.page.x},enumerable:!1,configurable:!0}),Object.defineProperty(il.prototype,"pageY",{get:function(){return this.page.y},enumerable:!1,configurable:!0}),Object.defineProperty(il.prototype,"x",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(il.prototype,"y",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(il.prototype,"canvasX",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(il.prototype,"canvasY",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(il.prototype,"viewportX",{get:function(){return this.viewport.x},enumerable:!1,configurable:!0}),Object.defineProperty(il.prototype,"viewportY",{get:function(){return this.viewport.y},enumerable:!1,configurable:!0}),il.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(il.prototype,"propagationPath",{get:function(){return this.composedPath()},enumerable:!1,configurable:!0}),il.prototype.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},il.prototype.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},il.prototype.stopPropagation=function(){this.propagationStopped=!0},il.prototype.initEvent=function(){},il.prototype.initUIEvent=function(){},il.prototype.clone=function(){throw new Error(Hr)};var rl=il;function il(t){this.eventPhase=il.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Ir,this.page=new Ir,this.canvas=new Ir,this.viewport=new Ir,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}t(sl,al=rl),Object.defineProperty(sl.prototype,"clientX",{get:function(){return this.client.x},enumerable:!1,configurable:!0}),Object.defineProperty(sl.prototype,"clientY",{get:function(){return this.client.y},enumerable:!1,configurable:!0}),Object.defineProperty(sl.prototype,"movementX",{get:function(){return this.movement.x},enumerable:!1,configurable:!0}),Object.defineProperty(sl.prototype,"movementY",{get:function(){return this.movement.y},enumerable:!1,configurable:!0}),Object.defineProperty(sl.prototype,"offsetX",{get:function(){return this.offset.x},enumerable:!1,configurable:!0}),Object.defineProperty(sl.prototype,"offsetY",{get:function(){return this.offset.y},enumerable:!1,configurable:!0}),Object.defineProperty(sl.prototype,"globalX",{get:function(){return this.global.x},enumerable:!1,configurable:!0}),Object.defineProperty(sl.prototype,"globalY",{get:function(){return this.global.y},enumerable:!1,configurable:!0}),Object.defineProperty(sl.prototype,"screenX",{get:function(){return this.screen.x},enumerable:!1,configurable:!0}),Object.defineProperty(sl.prototype,"screenY",{get:function(){return this.screen.y},enumerable:!1,configurable:!0}),sl.prototype.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},sl.prototype.initMouseEvent=function(){throw new Error(Hr)};var al,ol=sl;function sl(){var t=null!==al&&al.apply(this,arguments)||this;return t.client=new Ir,t.movement=new Ir,t.offset=new Ir,t.global=new Ir,t.screen=new Ir,t}t(ul,ll=ol),ul.prototype.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},ul.prototype.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},ul.prototype.clone=function(){return this.manager.clonePointerEvent(this)};var ll,cl=ul;function ul(){var t=null!==ll&&ll.apply(this,arguments)||this;return t.width=0,t.height=0,t.isPrimary=!1,t}t(dl,hl=ol),dl.prototype.clone=function(){return this.manager.cloneWheelEvent(this)};var hl,fl=dl;function dl(){return null!==hl&&hl.apply(this,arguments)||this}t(yl,pl=rl);var pl,gl=yl;function yl(t,e){var n=pl.call(this,null)||this;return n.type=t,n.detail=e,Object.assign(n,e),n}ml.prototype.on=function(t,e,n){return this.addEventListener(t,e,n),this},ml.prototype.addEventListener=function(t,e,n){var r,i,a,o=Xe(n)&&n||je(n)&&n.capture,n=je(n)&&n.once,s=pi(e)?void 0:e,l=!1,c="";return-1<t.indexOf(":")&&(i=(r=j(t.split(":"),2))[0],t=r[1],c=i,l=!0),t=o?"".concat(t,"capture"):t,e=pi(e)?e:e.handleEvent,l&&(a=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.name)===c&&a.apply(void 0,O([],j(e),!1))}),n?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this},ml.prototype.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},ml.prototype.removeAllEventListeners=function(){this.emitter.removeAllListeners()},ml.prototype.removeEventListener=function(t,e,n){var n=Xe(n)&&n||je(n)&&n.capture,r=pi(e)?void 0:e;return t=n?"".concat(t,"capture"):t,e=pi(e)?e:null==e?void 0:e.handleEvent,this.emitter.off(t,e,r),this},ml.prototype.emit=function(t,e){this.dispatchEvent(new gl(t,e))},ml.prototype.dispatchEvent=function(t,e){var n;if(void 0===e&&(e=!1),!t.type)throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");if(n=this.document?this:this.defaultView||(null==(n=this.ownerDocument)?void 0:n.defaultView)){if(t.manager=n.getEventService()||null,!t.manager)return!1;t.defaultPrevented=!1,t.path=[],e||(t.target=this),null!=(n=t.manager)&&n.dispatchEvent(t,t.type,e)}return!t.defaultPrevented};ol=ml;function ml(){this.emitter=new Y}t(p,vl=ol),p.isNode=function(t){return!!t.childNodes},Object.defineProperty(p.prototype,"textContent",{get:function(){var e,t,n="";this.nodeName===k.TEXT&&(n+=this.style.text);try{for(var r=I(this.childNodes),i=r.next();!i.done;i=r.next()){var a=i.value;a.nodeName===k.TEXT?n+=a.nodeValue:n+=a.textContent}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return n},set:function(t){var e=this;this.childNodes.slice().forEach(function(t){e.removeChild(t)}),this.nodeName===k.TEXT&&(this.style.text="".concat(t))},enumerable:!1,configurable:!0}),p.prototype.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},p.prototype.hasChildNodes=function(){return 0<this.childNodes.length},p.prototype.isDefaultNamespace=function(t){throw new Error(Hr)},p.prototype.lookupNamespaceURI=function(t){throw new Error(Hr)},p.prototype.lookupPrefix=function(t){throw new Error(Hr)},p.prototype.normalize=function(){throw new Error(Hr)},p.prototype.isEqualNode=function(t){return this===t},p.prototype.isSameNode=function(t){return this.isEqualNode(t)},Object.defineProperty(p.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"firstChild",{get:function(){return 0<this.childNodes.length?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"lastChild",{get:function(){return 0<this.childNodes.length?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),p.prototype.compareDocumentPosition=function(t){var e;if(t===this)return 0;for(var n=t,r=this,i=[n],a=[r];null!=(e=n.parentNode)?e:r.parentNode;)n=n.parentNode?(i.push(n.parentNode),n.parentNode):n,r=r.parentNode?(a.push(r.parentNode),r.parentNode):r;if(n!==r)return p.DOCUMENT_POSITION_DISCONNECTED|p.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|p.DOCUMENT_POSITION_PRECEDING;var o=a.length<i.length?i:a,s=o===i?a:i;if(o[o.length-s.length]===s[0])return o===i?p.DOCUMENT_POSITION_CONTAINED_BY|p.DOCUMENT_POSITION_FOLLOWING:p.DOCUMENT_POSITION_CONTAINS|p.DOCUMENT_POSITION_PRECEDING;for(var l=o.length-s.length,c=s.length-1;0<=c;c--){var u,h=s[c],f=o[l+c];if(f!==h)return(u=h.parentNode.childNodes).indexOf(h)<u.indexOf(f)?s===i?p.DOCUMENT_POSITION_PRECEDING:p.DOCUMENT_POSITION_FOLLOWING:o===i?p.DOCUMENT_POSITION_PRECEDING:p.DOCUMENT_POSITION_FOLLOWING}return p.DOCUMENT_POSITION_FOLLOWING},p.prototype.contain=function(t){return this.contains(t)},p.prototype.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},p.prototype.getAncestor=function(t){for(var e=this;0<t&&e;)e=e.parentNode,t--;return e},p.prototype.forEach=function(e,t){void 0===t&&(t=!1),e(this)||(t?this.childNodes.slice():this.childNodes).forEach(function(t){t.forEach(e)})},p.DOCUMENT_POSITION_DISCONNECTED=1,p.DOCUMENT_POSITION_PRECEDING=2,p.DOCUMENT_POSITION_FOLLOWING=4,p.DOCUMENT_POSITION_CONTAINS=8,p.DOCUMENT_POSITION_CONTAINED_BY=16,p.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var vl,bl=p;function p(){var t=null!==vl&&vl.apply(this,arguments)||this;return t.shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}wl.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)},wl.prototype.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},wl.prototype.client2Viewport=function(t){var e=this.context.contextService.getBoundingClientRect();return new Ir(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},wl.prototype.viewport2Client=function(t){var e=this.context.contextService.getBoundingClientRect();return new Ir(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},wl.prototype.viewport2Canvas=function(t){var e=t.x,t=t.y,n=this.rootTarget.defaultView.getCamera(),r=this.context.config,i=r.width,r=r.height,a=n.getPerspectiveInverse(),n=n.getWorldTransform(),n=ct(this.tmpMatrix,n,a),a=Nt(this.tmpVec3,e/i*2-1,2*(1-t/r)-1,0);return Wt(a,a,n),new Ir(a[0],a[1])},wl.prototype.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),e=e.getViewTransform(),n=ct(this.tmpMatrix,n,e),e=Nt(this.tmpVec3,t.x,t.y,0),t=(Wt(this.tmpVec3,this.tmpVec3,n),this.context.config),n=t.width,t=t.height;return new Ir((e[0]+1)/2*n,(1-(e[1]+1)/2)*t)},wl.prototype.setPickHandler=function(t){this.pickHandler=t},wl.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})},wl.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))}},wl.prototype.dispatchEvent=function(t,e,n){n?(t.eventPhase=t.AT_TARGET,n=this.rootTarget.defaultView||null,t.currentTarget=n,this.notifyListeners(t,e)):(t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e)),this.emitter.emit(e||t.type,t)},wl.prototype.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;1<=r;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}}},wl.prototype.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)e.unshift(n.document);else{for(var r=0;r<2048&&t!==this.rootTarget;r++)bl.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);n&&e.push(n)}return e},wl.prototype.hitTest=function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config,i=r.width,r=r.height;return!(e<0||n<0||i<e||r<n)&&(this.pickHandler(t)||this.rootTarget)||null},wl.prototype.isNativeEventFromCanvas=function(t){var e=this.context.contextService.getDomElement(),n=null==(n=t.nativeEvent)?void 0:n.target;if(n){if(n===e)return!0;if(e&&e.contains)return e.contains(n)}return!!t.nativeEvent.composedPath&&-1<t.nativeEvent.composedPath().indexOf(e)},wl.prototype.getExistedHTML=function(t){var e,n;if(t.nativeEvent.composedPath)try{for(var r=I(t.nativeEvent.composedPath()),i=r.next();!i.done;i=r.next()){var a=i.value,o=this.globalRuntime.nativeHTMLMap.get(a);if(o)return o}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return null},wl.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})},wl.prototype.createPointerEvent=function(t,e,n,r){var i=this.allocateEvent(cl),t=(this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t,this.getExistedHTML(i));return i.target=null!=n?n:t||this.isNativeEventFromCanvas(i)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i},wl.prototype.createWheelEvent=function(t){var e=this.allocateEvent(fl),t=(this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t,this.getExistedHTML(e));return e.target=t||this.isNativeEventFromCanvas(e)&&this.pickTarget(e),e},wl.prototype.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},wl.prototype.cloneWheelEvent=function(t){var e=this.allocateEvent(fl);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},wl.prototype.clonePointerEvent=function(t,e){var n=this.allocateEvent(cl);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},wl.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},wl.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)},wl.prototype.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},wl.prototype.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=ps.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},wl.prototype.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);t=this.eventPool.get(t).pop()||new t(this);return t.eventPhase=t.NONE,t.currentTarget=null,t.path=[],t.target=null,t},wl.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)},wl.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)},wl.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)},wl.prototype.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;0<=n;n--){var r=t[n];if(!(r===this.rootTarget||bl.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},wl.prototype.getCursor=function(t){for(var e=t;e;){var n=!!e.getAttribute&&e.getAttribute("cursor");if(n)return n;e=bl.isNode(e)&&e.parentNode}};var xl=wl;function wl(t,e){var c=this;this.globalRuntime=t,this.context=e,this.emitter=new Y,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=Z(),this.tmpVec3=v(),this.onPointerDown=function(t){var e,n=c.createPointerEvent(t);c.dispatchEvent(n,"pointerdown"),"touch"===n.pointerType?c.dispatchEvent(n,"touchstart"):"mouse"!==n.pointerType&&"pen"!==n.pointerType||(e=2===n.button,c.dispatchEvent(n,e?"rightdown":"mousedown")),c.trackingData(t.pointerId).pressTargetsByButton[t.button]=n.composedPath(),c.freeEvent(n)},this.onPointerUp=function(t){var e=ps.now(),n=c.createPointerEvent(t,void 0,void 0,c.context.config.alwaysTriggerPointerEventOnCanvas?c.rootTarget:void 0),r=(c.dispatchEvent(n,"pointerup"),"touch"===n.pointerType?c.dispatchEvent(n,"touchend"):"mouse"!==n.pointerType&&"pen"!==n.pointerType||(o=2===n.button,c.dispatchEvent(n,o?"rightup":"mouseup")),c.trackingData(t.pointerId)),i=c.findMountedTarget(r.pressTargetsByButton[t.button]),a=i;if(i&&!n.composedPath().includes(i)){for(var o,s=i;s&&!n.composedPath().includes(s);)n.currentTarget=s,c.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType?c.notifyTarget(n,"touchendoutside"):"mouse"!==n.pointerType&&"pen"!==n.pointerType||(o=2===n.button,c.notifyTarget(n,o?"rightupoutside":"mouseupoutside")),bl.isNode(s)&&(s=s.parentNode);delete r.pressTargetsByButton[t.button],a=s}a&&((i=c.clonePointerEvent(n,"click")).target=a,i.path=[],r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:i.target,timeStamp:e}),(a=r.clicksByButton[t.button]).target===i.target&&e-a.timeStamp<200?++a.clickCount:a.clickCount=1,a.target=i.target,a.timeStamp=e,i.detail=a.clickCount,null!=(r=n.detail)&&r.preventClick||(c.context.config.useNativeClickEvent||"mouse"!==i.pointerType&&"touch"!==i.pointerType||c.dispatchEvent(i,"click"),c.dispatchEvent(i,"pointertap")),c.freeEvent(i)),c.freeEvent(n)},this.onPointerMove=function(t){var e=c.createPointerEvent(t,void 0,void 0,c.context.config.alwaysTriggerPointerEventOnCanvas?c.rootTarget:void 0),n="mouse"===e.pointerType||"pen"===e.pointerType,r=c.trackingData(t.pointerId),i=c.findMountedTarget(r.overTargets);if(r.overTargets&&i!==e.target){var a="mousemove"===t.type?"mouseout":"pointerout",a=c.createPointerEvent(t,a,i||void 0);if(c.dispatchEvent(a,"pointerout"),n&&c.dispatchEvent(a,"mouseout"),!e.composedPath().includes(i)){var o=c.createPointerEvent(t,"pointerleave",i||void 0);for(o.eventPhase=o.AT_TARGET;o.target&&!e.composedPath().includes(o.target);)o.currentTarget=o.target,c.notifyTarget(o),n&&c.notifyTarget(o,"mouseleave"),bl.isNode(o.target)&&(o.target=o.target.parentNode);c.freeEvent(o)}c.freeEvent(a)}if(i!==e.target){for(var a="mousemove"===t.type?"mouseover":"pointerover",t=c.clonePointerEvent(e,a),s=(c.dispatchEvent(t,"pointerover"),n&&c.dispatchEvent(t,"mouseover"),i&&bl.isNode(i)&&i.parentNode);s&&s!==(bl.isNode(c.rootTarget)&&c.rootTarget.parentNode)&&s!==e.target;)s=s.parentNode;if(!s||s===(bl.isNode(c.rootTarget)&&c.rootTarget.parentNode)){var l=c.clonePointerEvent(e,"pointerenter");for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==i&&l.target!==(bl.isNode(c.rootTarget)&&c.rootTarget.parentNode);)l.currentTarget=l.target,c.notifyTarget(l),n&&c.notifyTarget(l,"mouseenter"),bl.isNode(l.target)&&(l.target=l.target.parentNode);c.freeEvent(l)}c.freeEvent(t)}c.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&c.dispatchEvent(e,"touchmove"),n&&(c.dispatchEvent(e,"mousemove"),c.cursor=c.getCursor(e.target)),r.overTargets=e.composedPath(),c.freeEvent(e)},this.onPointerOut=function(t){var e=c.trackingData(t.pointerId);if(e.overTargets){var n="mouse"===t.pointerType||"pen"===t.pointerType,r=c.findMountedTarget(e.overTargets),i=c.createPointerEvent(t,"pointerout",r||void 0),a=(c.dispatchEvent(i),n&&c.dispatchEvent(i,"mouseout"),c.createPointerEvent(t,"pointerleave",r||void 0));for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(bl.isNode(c.rootTarget)&&c.rootTarget.parentNode);)a.currentTarget=a.target,c.notifyTarget(a),n&&c.notifyTarget(a,"mouseleave"),bl.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=null,c.freeEvent(i),c.freeEvent(a)}c.cursor=null},this.onPointerOver=function(t){var e=c.trackingData(t.pointerId),t=c.createPointerEvent(t),n="mouse"===t.pointerType||"pen"===t.pointerType,r=(c.dispatchEvent(t,"pointerover"),n&&c.dispatchEvent(t,"mouseover"),"mouse"===t.pointerType&&(c.cursor=c.getCursor(t.target)),c.clonePointerEvent(t,"pointerenter"));for(r.eventPhase=r.AT_TARGET;r.target&&r.target!==(bl.isNode(c.rootTarget)&&c.rootTarget.parentNode);)r.currentTarget=r.target,c.notifyTarget(r),n&&c.notifyTarget(r,"mouseenter"),bl.isNode(r.target)&&(r.target=r.target.parentNode);e.overTargets=t.composedPath(),c.freeEvent(t),c.freeEvent(r)},this.onPointerUpOutside=function(t){var e=c.trackingData(t.pointerId),n=c.findMountedTarget(e.pressTargetsByButton[t.button]),r=c.createPointerEvent(t);if(n){for(var i=n;i;)r.currentTarget=i,c.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType||"mouse"!==r.pointerType&&"pen"!==r.pointerType||c.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),bl.isNode(i)&&(i=i.parentNode);delete e.pressTargetsByButton[t.button]}c.freeEvent(r)},this.onWheel=function(t){t=c.createWheelEvent(t);c.dispatchEvent(t),c.freeEvent(t)},this.onClick=function(t){c.context.config.useNativeClickEvent&&(t=c.createPointerEvent(t),c.dispatchEvent(t),c.freeEvent(t))},this.onPointerCancel=function(t){t=c.createPointerEvent(t,void 0,void 0,c.context.config.alwaysTriggerPointerEventOnCanvas?c.rootTarget:void 0);c.dispatchEvent(t),c.freeEvent(t)}}kl.prototype.getOrCreateCanvas=function(t,e){if(!this.canvas){if(t||E.offscreenCanvas)this.canvas=t||E.offscreenCanvas,this.context=this.canvas.getContext("2d",e);else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",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",e)}this.canvas.width=10,this.canvas.height=10}return this.canvas},kl.prototype.getOrCreateContext=function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context};var Ml,Ol=kl;function kl(){}(_l=Ml=Ml||{})[_l.CAMERA_CHANGED=0]="CAMERA_CHANGED",_l[_l.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",_l[_l.NONE=2]="NONE";Sl.prototype.init=function(t){var e=this,n=m(m({},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()})},Sl.prototype.getStats=function(){return this.stats},Sl.prototype.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(Ml.CAMERA_CHANGED)},Sl.prototype.render=function(t,e){var n=this,r=(this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0,this.context.renderingContext);this.globalRuntime.sceneGraphService.syncHierarchy(r.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),r.renderReasons.size&&this.inited&&(this.renderDisplayObject(r.root,t,r),this.hooks.beginFrame.call(),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())},Sl.prototype.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),a=i.enableDirtyCheck,i=i.enableCulling,a=(this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t),a?this.hooks.dirtycheck.call(t):t),a=(a&&(i=i?this.hooks.cull.call(a,this.context.camera):a)&&(this.stats.rendered++,n.renderListCurrentFrame.push(i)),t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++,t.sortable);a.dirty&&(this.sort(t,a),a.dirty=!1,a.dirtyChildren=[],a.dirtyReason=void 0),(a.sorted||t.childNodes).forEach(function(t){r.renderDisplayObject(t,e,n)})},Sl.prototype.sort=function(n,r){r.sorted&&r.dirtyReason!==Ti.Z_INDEX_CHANGED?r.dirtyChildren.forEach(function(t){var e;-1===n.childNodes.indexOf(t)?0<=(e=r.sorted.indexOf(t))&&r.sorted.splice(e,1):0===r.sorted.length?r.sorted.push(t):(e=function(t,e){for(var n=0,r=t.length;n<r;){var i=n+r>>>1;us(t[i],e)<0?n=1+i:r=i}return n}(r.sorted,t),r.sorted.splice(e,0,t))}):r.sorted=n.childNodes.slice().sort(us)},Sl.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},Sl.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(Ml.DISPLAY_OBJECT_CHANGED)};var El=Sl;function Sl(t,e){this.globalRuntime=t,this.context=e,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Ns,initAsync:new Ts,dirtycheck:new Rs,cull:new Rs,beginFrame:new Ns,beforeRender:new Ns,render:new Ns,afterRender:new Ns,endFrame:new Ns,destroy:new Ns,pick:new Cs,pickSync:new Rs,pointerDown:new Ns,pointerUp:new Ns,pointerMove:new Ns,pointerOut:new Ns,pointerOver:new Ns,pointerWheel:new Ns,pointerCancel:new Ns,click:new Ns}}var Al=/\[\s*(.*)=(.*)\s*\]/,_l=(Tl.prototype.selectOne=function(e,n){var t,r,i,a=this;return e.startsWith(".")?n.find(function(t){return-1<((null==t?void 0:t.classList)||[]).indexOf(a.getIdOrClassname(e))}):e.startsWith("#")?n.find(function(t){return t.id===a.getIdOrClassname(e)}):e.startsWith("[")?(t=this.getAttribute(e),r=t.name,i=t.value,r?n.find(function(t){return n!==t&&("name"===r?t.name===i:a.attributeToString(t,r)===i)}):null):n.find(function(t){return n!==t&&t.nodeName===e})},Tl.prototype.selectAll=function(e,n){var t,r,i,a=this;return e.startsWith(".")?n.findAll(function(t){return n!==t&&-1<((null==t?void 0:t.classList)||[]).indexOf(a.getIdOrClassname(e))}):e.startsWith("#")?n.findAll(function(t){return n!==t&&t.id===a.getIdOrClassname(e)}):e.startsWith("[")?(t=this.getAttribute(e),r=t.name,i=t.value,r?n.findAll(function(t){return n!==t&&("name"===r?t.name===i:a.attributeToString(t,r)===i)}):[]):n.findAll(function(t){return n!==t&&t.nodeName===e})},Tl.prototype.is=function(t,e){var n,r;return t.startsWith(".")?e.className===this.getIdOrClassname(t):t.startsWith("#")?e.id===this.getIdOrClassname(t):t.startsWith("[")?(n=(r=this.getAttribute(t)).name,r=r.value,"name"===n?e.name===r:this.attributeToString(e,n)===r):e.nodeName===t},Tl.prototype.getIdOrClassname=function(t){return t.substring(1)},Tl.prototype.getAttribute=function(t){var t=t.match(Al),e="",n="";return t&&2<t.length&&(e=t[1].replace(/"/g,""),n=t[2].replace(/"/g,"")),{name:e,value:n}},Tl.prototype.attributeToString=function(t,e){return t.getAttribute&&(t=t.getAttribute(e),!P(t))&&t.toString?t.toString():""},Tl);function Tl(){}t(Ll,Pl=rl),Ll.ADDITION=2,Ll.MODIFICATION=1,Ll.REMOVAL=3;var Pl,b,Cl=Ll;function Ll(t,e,n,r,i,a,o,s){var l=Pl.call(this,null)||this;return l.relatedNode=e,l.prevValue=n,l.newValue=r,l.attrName=i,l.attrChange=a,l.prevParsedValue=o,l.newParsedValue=s,l.type=t,l}function Nl(t){t=t.renderable;t&&(t.renderBoundsDirty=!0,t.boundsDirty=!0)}(Rl=b=b||{}).REPARENT="reparent",Rl.DESTROY="destroy",Rl.ATTR_MODIFIED="DOMAttrModified",Rl.INSERTED="DOMNodeInserted",Rl.REMOVED="removed",Rl.MOUNTED="DOMNodeInsertedIntoDocument",Rl.UNMOUNTED="DOMNodeRemovedFromDocument",Rl.BOUNDS_CHANGED="bounds-changed",Rl.CULLED="culled";var jl=new Cl(b.REPARENT,null,"","","",0,"",""),Rl=(s.prototype.matches=function(t,e){return this.runtime.sceneGraphSelector.is(t,e)},s.prototype.querySelector=function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)},s.prototype.querySelectorAll=function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)},s.prototype.attach=function(t,e,n){var r=!1,n=(t.parentNode&&(r=t.parentNode!==e,this.detach(t)),t.parentNode=e,P(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t),e.sortable),e=((null!=(e=null==n?void 0:n.sorted)&&e.length||null!=(e=t.style)&&e.zIndex)&&(-1===n.dirtyChildren.indexOf(t)&&n.dirtyChildren.push(t),n.dirty=!0,n.dirtyReason=Ti.ADDED),t.transformable);e&&this.dirtifyWorld(t,e),e.frozen&&this.unfreezeParentToRoot(t),r&&t.dispatchEvent(jl)},s.prototype.detach=function(t){var e,n,r;t.parentNode&&(e=t.transformable,(null!=(r=null==(n=t.parentNode.sortable)?void 0:n.sorted)&&r.length||null!=(r=t.style)&&r.zIndex)&&(-1===n.dirtyChildren.indexOf(t)&&n.dirtyChildren.push(t),n.dirty=!0,n.dirtyReason=Ti.REMOVED),-1<(r=t.parentNode.childNodes.indexOf(t))&&t.parentNode.childNodes.splice(r,1),e&&this.dirtifyWorld(t,e),t.parentNode=null)},s.prototype.getOrigin=function(t){return t.transformable.origin},s.prototype.setOrigin=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0);var i=t.transformable;(e="number"==typeof e?[e,n,r]:e)[0]===i.origin[0]&&e[1]===i.origin[1]&&e[2]===i.origin[2]||((n=i.origin)[0]=e[0],n[1]=e[1],n[2]=e[2]||0,this.dirtifyLocal(t,i))},s.prototype.setLocalEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ct(e,n,r));n=t.transformable;Qt(n.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,n)},s.prototype.scaleLocal=function(t,e){var n,r,i=t.transformable;n=i.localScale,r=i.localScale,e=Ct(e[0],e[1],e[2]||1),n[0]=r[0]*e[0],n[1]=r[1]*e[1],n[2]=r[2]*e[2],this.dirtifyLocal(t,i)},s.prototype.setLocalScale=function(t,e){var n=t.transformable,e=Ct(e[0],e[1],e[2]||n.localScale[2]);Ht(e,n.localScale)||(Lt(n.localScale,e),this.dirtifyLocal(t,n))},s.prototype.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=Jt(e,n,r,i));n=t.transformable;te(n.localRotation,e),this.dirtifyLocal(t,n)},s.prototype.setLocalSkew=function(t,e,n){"number"==typeof e&&(i=e,n=n,(r=new $(2))[0]=i,r[1]=n,e=r);var r,i=t.transformable;n=i.localSkew,r=e,n[0]=r[0],n[1]=r[1],this.dirtifyLocal(t,i)},s.prototype.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag)||this.dirtifyWorld(t,e)},s.prototype.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)},s.prototype.triggerPendingEvents=function(){function r(t,e){t.isConnected&&!i.has(t.entity)&&(n.boundsChangedEvent.detail=e,(n.boundsChangedEvent.target=t).isMutationObserved?t.dispatchEvent(n.boundsChangedEvent):t.ownerDocument.defaultView.dispatchEvent(n.boundsChangedEvent,!0),i.add(t.entity))}var n=this,i=new Set;this.pendingEvents.forEach(function(t){var t=j(t,2),e=t[0],n=t[1];n.affectChildren?e.forEach(function(t){r(t,n)}):r(e,n)}),this.clearPendingEvents(),i.clear()},s.prototype.clearPendingEvents=function(){this.pendingEvents=[]},s.prototype.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)Nl(n),n=n.parentNode;e&&t.forEach(function(t){Nl(t)}),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren:e}])},s.prototype.updateDisplayObjectDependency=function(t,e,n,r){var i;e&&e!==n&&(e=this.displayObjectDependencyMap.get(e))&&e[t]&&(i=e[t].indexOf(r),e[t].splice(i,1)),n&&((e=this.displayObjectDependencyMap.get(n))||(this.displayObjectDependencyMap.set(n,{}),e=this.displayObjectDependencyMap.get(n)),e[t]||(e[t]=[]),e[t].push(r))},s.prototype.informDependentDisplayObjects=function(t){var n=this,r=this.displayObjectDependencyMap.get(t);r&&Object.keys(r).forEach(function(e){r[e].forEach(function(t){n.dirtifyToRoot(t,!0),t.dispatchEvent(new Cl(b.ATTR_MODIFIED,t,n,n,e,Cl.MODIFICATION,n,n)),t.isCustomElement&&t.isConnected&&t.attributeChangedCallback&&t.attributeChangedCallback(e,n,n)})})},s.prototype.getPosition=function(t){var e=t.transformable;return mt(e.position,this.getWorldTransform(t,e))},s.prototype.getRotation=function(t){var e=t.transformable;return bt(e.rotation,this.getWorldTransform(t,e))},s.prototype.getScale=function(t){var e=t.transformable;return vt(e.scaling,this.getWorldTransform(t,e))},s.prototype.getWorldTransform=function(t,e){return((e=void 0===e?t.transformable:e).localDirtyFlag||e.dirtyFlag)&&(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e)),e.worldTransform},s.prototype.getLocalPosition=function(t){return t.transformable.localPosition},s.prototype.getLocalRotation=function(t){return t.transformable.localRotation},s.prototype.getLocalScale=function(t){return t.transformable.localScale},s.prototype.getLocalSkew=function(t){return t.transformable.localSkew},s.prototype.getLocalTransform=function(t){t=t.transformable;return t.localDirtyFlag&&(this.calcLocalTransform(t),t.localDirtyFlag=!1),t.localTransform},s.prototype.setLocalTransform=function(t,e){var n=mt(v(),e),r=bt(Ut(),e),e=vt(v(),e);this.setLocalScale(t,e),this.setLocalPosition(t,n),this.setLocalRotation(t,r)},s.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])},s.prototype.getTransformedGeometryBounds=function(t,e,n){e=this.getGeometryBounds(t,e=void 0===e?!1:e);return Tr.isEmpty(e)?null:((n=n||new Tr).setFromTransformedAABB(e,this.getWorldTransform(t)),n)},s.prototype.getGeometryBounds=function(t,e){t=t.geometry;return((e=void 0===e?!1:e)?t.renderBounds:t.contentBounds||null)||new Tr},s.prototype.getBounds=function(t,e){var n,r,i=this,a=(void 0===e&&(e=!1),t.renderable);return a.boundsDirty||e||!a.bounds?!a.renderBoundsDirty&&e&&a.renderBounds?a.renderBounds:(n=e?a.renderBounds:a.bounds,r=this.getTransformedGeometryBounds(t,e,n),t.childNodes.forEach(function(t){t=i.getBounds(t,e);t&&(r?r.add(t):(r=n||new Tr).update(t.center,t.halfExtents))}),e&&(t=hs(t))&&(t=t.parsedStyle.clipPath.getBounds(e),r?t&&(r=t.intersection(r)):r=t),(r=r||new Tr)&&(e?a.renderBounds=r:a.bounds=r),e?a.renderBoundsDirty=!1:a.boundsDirty=!1,r):a.bounds},s.prototype.getLocalBounds=function(t){if(t.parentNode){var e,n=Z(),r=(t.parentNode.transformable&&(n=rt(Z(),this.getWorldTransform(t.parentNode))),this.getBounds(t));if(!Tr.isEmpty(r))return(e=new Tr).setFromTransformedAABB(r,n),e}return this.getBounds(t)},s.prototype.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t),i=(Tr.isEmpty(i)||(r=new Tr).setFromTransformedAABB(i,this.getWorldTransform(t)),null==(t=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:t.getContextService().getBoundingClientRect());return r?(e=(t=j(r.getMin(),2))[0],t=t[1],n=(r=j(r.getMax(),2))[0],r=r[1],new Dr(e+((null==i?void 0:i.left)||0),t+((null==i?void 0:i.top)||0),n-e,r-t)):new Dr((null==i?void 0:i.left)||0,(null==i?void 0:i.top)||0,0,0)},s.prototype.dirtifyWorldInternal=function(t,e){var n=this;!e.dirtyFlag&&(e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach(function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}),e=t.renderable)&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)},s.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])}},s.prototype.sync=function(t,e){var n;e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag&&(n=(t=t.parentNode)&&t.transformable,null!==t&&n?ct(e.worldTransform,n.worldTransform,e.localTransform):J(e.worldTransform,e.localTransform),e.dirtyFlag=!1)},s.prototype.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},s);function s(t){var o,i,a,r,s,l,c,u,h,n,f,d,g=this;this.runtime=t,this.pendingEvents=[],this.boundsChangedEvent=new gl(b.BOUNDS_CHANGED),this.rotate=(o=Ut(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ct(e,n,r));var i,a,n=t.transformable;null!==t.parentNode&&t.parentNode.transformable?(Qt(r=Ut(),e[0],e[1],e[2]),i=g.getRotation(t),a=g.getRotation(t.parentNode),te(o,a),Zt(o,o),Kt(r,o,r),Kt(n.localRotation,r,i),ne(n.localRotation,n.localRotation),g.dirtifyLocal(t,n)):g.rotateLocal(t,e)}),this.rotateLocal=(i=Ut(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ct(e,n,r));n=t.transformable;Qt(i,e[0],e[1],e[2]),ee(n.localRotation,n.localRotation,i),g.dirtifyLocal(t,n)}),this.setEulerAngles=(a=Ut(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ct(e,n,r));n=t.transformable;null!==t.parentNode&&t.parentNode.transformable?(Qt(n.localRotation,e[0],e[1],e[2]),r=g.getRotation(t.parentNode),te(a,Zt(Ut(),r)),ee(n.localRotation,n.localRotation,a),g.dirtifyLocal(t,n)):g.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ct(e,n,r));var i,a,o,s,l,c,u,h,f,d,p,n=t.transformable;Ht(e,v())||(i=r=e,a=n.localRotation,o=a[0],s=a[1],l=a[2],a=a[3],c=i[0],u=i[1],i=i[2],p=s*(d=o*u-s*c)-l*(f=l*c-o*i),l=l*(h=s*i-l*u)-o*d,o=o*f-s*h,f*=s=2*a,d*=s,l*=2,o*=2,r[0]=c+(h*=s)+(p*=2),r[1]=u+f+l,r[2]=i+d+o,jt(n.localPosition,n.localPosition,e),g.dirtifyLocal(t,n))},this.setPosition=(r=Z(),s=v(),function(t,e){var n=t.transformable;s[0]=e[0],s[1]=e[1],s[2]=e[2]||0,Ht(g.getPosition(t),s)||(Lt(n.position,s),null!==t.parentNode&&t.parentNode.transformable?(e=t.parentNode.transformable,J(r,e.worldTransform),rt(r,r),Wt(n.localPosition,s,r)):Lt(n.localPosition,s),g.dirtifyLocal(t,n))}),this.setLocalPosition=(l=v(),function(t,e){var n=t.transformable;l[0]=e[0],l[1]=e[1],l[2]=e[2]||0,Ht(n.localPosition,l)||(Lt(n.localPosition,l),g.dirtifyLocal(t,n))}),this.translate=(c=v(),u=v(),h=v(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),Ht(e="number"==typeof e?Nt(u,e,n,r):e,c)||(jt(h,g.getPosition(t),e),g.setPosition(t,h))}),this.setRotation=function(){var o=Ut();return function(t,e,n,r,i){var a=t.transformable;"number"==typeof e&&(e=Jt(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable?(n=g.getRotation(t.parentNode),te(o,n),Zt(o,o),Kt(a.localRotation,o,e),ne(a.localRotation,a.localRotation),g.dirtifyLocal(t,a)):g.setLocalRotation(t,e)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=(n=Z(),f=v(),d=Jt(0,0,0,1),function(t){var e;0!==t.localSkew[0]||0!==t.localSkew[1]?(xt(t.localTransform,t.localRotation,t.localPosition,Ct(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||((e=et(n))[4]=Math.tan(t.localSkew[0]),e[1]=Math.tan(t.localSkew[1]),ct(t.localTransform,t.localTransform,e)),e=xt(n,d,f,t.localScale,t.origin),ct(t.localTransform,t.localTransform,e)):xt(t.localTransform,t.localRotation,t.localPosition,t.localScale,t.origin)})}var Il={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]},Bl=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,Dl=new RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),Fl=new RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),zl=(Wl.prototype.measureFont=function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];for(var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),e=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0}),i=(e.font=t,Il.MetricsString+Il.BaselineSymbol),a=Math.ceil(e.measureText(i).width),o=Math.ceil(e.measureText(Il.BaselineSymbol).width),s=Il.HeightMultiplier*o,o=o*Il.BaselineMultiplier|0,l=(r.width=a,r.height=s,e.fillStyle="#f00",e.fillRect(0,0,a,s),e.font=t,e.textBaseline="alphabetic",e.fillStyle="#000",e.fillText(i,0,o),e.getImageData(0,0,a||1,s||1).data),r=l.length,c=4*a,u=0,h=0,f=!1,u=0;u<o;++u){for(var d=0;d<c;d+=4)if(255!==l[h+d]){f=!0;break}if(f)break;h+=c}for(n.ascent=o-u,h=r-c,f=!1,u=s;o<u;--u){for(d=0;d<c;d+=4)if(255!==l[h+d]){f=!0;break}if(f)break;h-=c}return n.descent=u-o,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n},Wl.prototype.measureText=function(t,e,n){var r=e.fontSize,i=e.wordWrap,a=e.lineHeight,o=e.lineWidth,s=e.textBaseline,l=e.textAlign,c=e.letterSpacing,u=e.textPath,h=(e.textPathSide,e.textPathStartOffset,e.leading),h=void 0===h?0:h,f=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,t=t.fontWeight,e=Ge(e)&&"".concat(e,"px")||"16px",a=n.split(","),o=a.length-1;0<=o;o--){var s=a[o].trim();!Ds.test(s)&&Bs.indexOf(s)<0&&(s='"'.concat(s,'"')),a[o]=s}return"".concat(r," ").concat(i," ").concat(t," ").concat(e," ").concat(a.join(","))}(e),d=this.measureFont(f,n),p=(0===d.fontSize&&(d.fontSize=r,d.ascent=r),this.runtime.offscreenCanvasCreator.getOrCreateContext(n));p.font=f,e.isOverflowing=!1;var g=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),y=new Array(g.length),m=0;if(!u){for(M=0;M<g.length;M++){var v=p.measureText(g[M]).width+(g[M].length-1)*c;y[M]=v,m=Math.max(m,v)}var b=m+o,x=a||d.fontSize+o,r=Math.max(x,d.fontSize+o)+(g.length-1)*(x+h),w=0;return"middle"===s?w=-r/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?w=-r:"top"!==s&&"hanging"!==s||(w=0),{font:f,width:b,height:r,lines:g,lineWidths:y,lineHeight:x+=h,maxLineWidth:m,fontProperties:d,lineMetrics:y.map(function(t,e){var n=0;return"center"===l||"middle"===l?n-=t/2:"right"!==l&&"end"!==l||(n-=t),new Dr(n-o/2,w+e*x,t+o,x)})}}u.getTotalLength();for(var M=0;M<g.length;M++)var b=p.measureText(g[M]).width+(g[M].length-1)*c},Wl.prototype.setGraphemeOnPath=function(){},Wl.prototype.wordWrap=function(t,e,n){for(var r=this,i=e.wordWrapWidth,i=void 0===i?0:i,a=e.letterSpacing,o=e.maxLines,s=void 0===o?1/0:o,o=e.textOverflow,l=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),c=i+a,u="",h=("ellipsis"===o?u="...":o&&"clip"!==o&&(u=o),[]),f=0,d=0,p={},g=function(t){return r.getFromCache(t,a,p,l)},y=Array.from(u).reduce(function(t,e){return t+g(e)},0),m=Array.from(t),v=0;v<m.length;v++){var b=m[v],x=t[v-1],w=t[v+1],M=g(b);if(this.isNewline(b)){if(s<=++f){e.isOverflowing=!0;break}d=0,h[f]=""}else{if(0<d&&c<d+M){if(s<=f+1){if(e.isOverflowing=!0,0<y&&y<=c){for(var O=h[f].length,k=0,E=O,S=0;S<O;S++){var A=g(h[f][S]);if(c<k+A+y){E=S;break}k+=A}h[f]=(h[f]||"").slice(0,E)+u}break}if(d=0,h[++f]="",this.isBreakingSpace(b))continue;this.canBreakInLastChar(b)||(h=this.trimToBreakable(h),d=this.sumTextWidthByCache(h[f]||"",p)),this.shouldBreakByKinsokuShorui(b,w)&&(h=this.trimByKinsokuShorui(h),d+=g(x||""))}d+=M,h[f]=(h[f]||"")+b}}return h.join("\n")},Wl.prototype.isBreakingSpace=function(t){return"string"==typeof t&&0<=Il.BreakingSpaces.indexOf(t.charCodeAt(0))},Wl.prototype.isNewline=function(t){return"string"==typeof t&&0<=Il.Newlines.indexOf(t.charCodeAt(0))},Wl.prototype.trimToBreakable=function(t){var e,t=O([],j(t),!1),n=t[t.length-2],r=this.findBreakableIndex(n);return-1!==r&&n&&(e=n.slice(r,r+1),e=r+(this.isBreakingSpace(e)?0:1),t[t.length-1]+=n.slice(r+1,n.length),t[t.length-2]=n.slice(0,e)),t},Wl.prototype.canBreakInLastChar=function(t){return!t||!Bl.test(t)},Wl.prototype.sumTextWidthByCache=function(t,n){return t.split("").reduce(function(t,e){if(n[e])return t+n[e];throw Error("cannot count the word without cache")},0)},Wl.prototype.findBreakableIndex=function(t){for(var e=t.length-1;0<=e;e--)if(!Bl.test(t[e]))return e;return-1},Wl.prototype.getFromCache=function(t,e,n,r){var i=n[t];return"number"!=typeof i&&(e=t.length*e,i=r.measureText(t).width+e,n[t]=i),i},Wl);function Wl(t){var n=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!Fl.exec(e)&&!Dl.exec(t))},this.trimByKinsokuShorui=function(t){var e,n=O([],j(t),!1),r=n[n.length-2];return r?(e=r[r.length-1],n[n.length-2]=r.slice(0,-1),n[n.length-1]=e+n[n.length-1],n):t}}var Gl,E={},Hs=(Js=new Js,Zs=new Zs,(uu={})[k.CIRCLE]=new Hs,uu[k.ELLIPSE]=new Ys,uu[k.RECT]=Js,uu[k.IMAGE]=Js,uu[k.GROUP]=Js,uu[k.LINE]=new $s,uu[k.TEXT]=new el(E),uu[k.POLYLINE]=Zs,uu[k.POLYGON]=Zs,uu[k.PATH]=new Xs,uu[k.HTML]=null,uu[k.MESH]=null,uu),el=(Ys=new So,Js=new Co,($s={})[a.PERCENTAGE]=null,$s[a.NUMBER]=new Vo,$s[a.ANGLE]=new ii,$s[a.DEFINED_PATH]=new o,$s[a.PAINT]=Ys,$s[a.COLOR]=Ys,$s[a.FILTER]=new _o,$s[a.LENGTH]=Js,$s[a.LENGTH_PERCENTAGE]=Js,$s[a.LENGTH_PERCENTAGE_12]=new No,$s[a.LENGTH_PERCENTAGE_14]=new Ro,$s[a.COORDINATE]=new zo,$s[a.OFFSET_DISTANCE]=new qo,$s[a.OPACITY_VALUE]=new Uo,$s[a.PATH]=new Ko,$s[a.LIST_OF_POINTS]=new Qo,$s[a.SHADOW_BLUR]=new es,$s[a.TEXT]=new rs,$s[a.TEXT_TRANSFORM]=new as,$s[a.TRANSFORM]=new Ss,$s[a.TRANSFORM_ORIGIN]=new zs,$s[a.Z_INDEX]=new Ws,$s[a.MARKER]=new Go,$s),Hl=(E.CameraContribution=n,E.AnimationTimeline=null,E.EasingFunction=null,E.offscreenCanvasCreator=new Ol,E.nativeHTMLMap=new WeakMap,E.sceneGraphSelector=new _l,E.sceneGraphService=new Rl(E),E.textService=new zl(E),E.geometryUpdaterFactory=Hs,E.CSSPropertySyntaxFactory=el,E.styleValueRegistry=new i(E),E.layoutRegistry=null,E.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:S,E.enableCSSParsing=!0,E.enableDataset=!1,E.enableStyleSyntax=!0,0),Vl=new Cl(b.INSERTED,null,"","","",0,"",""),Yl=new Cl(b.REMOVED,null,"","","",0,"",""),ql=new gl(b.DESTROY),Zs=(t(c,Gl=bl),Object.defineProperty(c.prototype,"className",{get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"classList",{get:function(){return this.className.split(" ").filter(function(t){return""!==t})},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"tagName",{get:function(){return this.nodeName},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"parentElement",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"nextSibling",{get:function(){var t;return this.parentNode&&(t=this.parentNode.childNodes.indexOf(this),this.parentNode.childNodes[t+1])||null},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"previousSibling",{get:function(){var t;return this.parentNode&&(t=this.parentNode.childNodes.indexOf(this),this.parentNode.childNodes[t-1])||null},enumerable:!1,configurable:!0}),c.prototype.cloneNode=function(t){throw new Error(Hr)},c.prototype.appendChild=function(t,e){if(t.destroyed)throw new Error("Cannot append a destroyed element.");return E.sceneGraphService.attach(t,this,e),null!=(e=this.ownerDocument)&&e.defaultView&&this.ownerDocument.defaultView.mountChildren(t),Vl.relatedNode=this,t.dispatchEvent(Vl),t},c.prototype.insertBefore=function(t,e){return e?(e=this.childNodes.indexOf(e),this.appendChild(t,e-1)):this.appendChild(t),t},c.prototype.replaceChild=function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},c.prototype.removeChild=function(t){var e;return Yl.relatedNode=this,t.dispatchEvent(Yl),null!=(e=t.ownerDocument)&&e.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),E.sceneGraphService.detach(t),t},c.prototype.removeChildren=function(){for(var t=this.childNodes.length-1;0<=t;t--){var e=this.childNodes[t];this.removeChild(e)}},c.prototype.destroyChildren=function(){for(var t=this.childNodes.length-1;0<=t;t--){var e=this.childNodes[t];e.childNodes.length&&e.destroyChildren(),e.destroy()}},c.prototype.matches=function(t){return E.sceneGraphService.matches(t,this)},c.prototype.getElementById=function(t){return E.sceneGraphService.querySelector("#".concat(t),this)},c.prototype.getElementsByName=function(t){return E.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)},c.prototype.getElementsByClassName=function(t){return E.sceneGraphService.querySelectorAll(".".concat(t),this)},c.prototype.getElementsByTagName=function(t){return E.sceneGraphService.querySelectorAll(t,this)},c.prototype.querySelector=function(t){return E.sceneGraphService.querySelector(t,this)},c.prototype.querySelectorAll=function(t){return E.sceneGraphService.querySelectorAll(t,this)},c.prototype.closest=function(t){var e=this;do{if(E.sceneGraphService.matches(t,e))return e}while(null!==(e=e.parentElement));return null},c.prototype.find=function(e){var n=this,r=null;return this.forEach(function(t){return!(t===n||!e(t)||(r=t,0))}),r},c.prototype.findAll=function(e){var n=this,r=[];return this.forEach(function(t){t!==n&&e(t)&&r.push(t)}),r},c.prototype.after=function(){for(var r,i=this,t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.parentNode&&(r=this.parentNode.childNodes.indexOf(this),t.forEach(function(t,e){var n;return null==(n=i.parentNode)?void 0:n.appendChild(t,r+e+1)}))},c.prototype.before=function(){for(var t,e,n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];this.parentNode&&(t=this.parentNode.childNodes.indexOf(this),e=(n=j(r))[0],n=n.slice(1),this.parentNode.appendChild(e,t),e.after.apply(e,O([],j(n),!1)))},c.prototype.replaceWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.after.apply(this,O([],j(t),!1)),this.remove()},c.prototype.append=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];t.forEach(function(t){return e.appendChild(t)})},c.prototype.prepend=function(){for(var n=this,t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];t.forEach(function(t,e){return n.appendChild(t,e)})},c.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,O([],j(t),!1))},c.prototype.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},c.prototype.destroy=function(){this.dispatchEvent(ql),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},c.prototype.getGeometryBounds=function(){return E.sceneGraphService.getGeometryBounds(this)},c.prototype.getRenderBounds=function(){return E.sceneGraphService.getBounds(this,!0)},c.prototype.getBounds=function(){return E.sceneGraphService.getBounds(this)},c.prototype.getLocalBounds=function(){return E.sceneGraphService.getLocalBounds(this)},c.prototype.getBoundingClientRect=function(){return E.sceneGraphService.getBoundingClientRect(this)},c.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},c.prototype.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},c.prototype.getAttributeNames=function(){return Object.keys(this.attributes)},c.prototype.getAttribute=function(t){var e;return"symbol"==typeof t?E.enableCSSParsing?null:void 0:void 0===(e=this.attributes[t])&&(t=bi(t),e=this.attributes[t],E.enableCSSParsing)&&P(e)?null:e},c.prototype.hasAttribute=function(t){return this.getAttributeNames().includes(t)},c.prototype.hasAttributes=function(){return!!this.getAttributeNames().length},c.prototype.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},c.prototype.setAttribute=function(t,e,n){this.attributes[t]=e},c.prototype.getAttributeNS=function(t,e){throw new Error(Hr)},c.prototype.getAttributeNode=function(t){throw new Error(Hr)},c.prototype.getAttributeNodeNS=function(t,e){throw new Error(Hr)},c.prototype.hasAttributeNS=function(t,e){throw new Error(Hr)},c.prototype.removeAttributeNS=function(t,e){throw new Error(Hr)},c.prototype.removeAttributeNode=function(t){throw new Error(Hr)},c.prototype.setAttributeNS=function(t,e,n){throw new Error(Hr)},c.prototype.setAttributeNode=function(t){throw new Error(Hr)},c.prototype.setAttributeNodeNS=function(t){throw new Error(Hr)},c.prototype.toggleAttribute=function(t,e){throw new Error(Hr)},c);function c(){var t=null!==Gl&&Gl.apply(this,arguments)||this;return t.entity=Hl++,t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},t.cullable={strategy:_i.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},t.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},t.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},t.geometry={contentBounds:void 0,renderBounds:void 0},t.rBushNode={aabb:void 0},t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.destroyed=!1,t.style={},t.computedStyle=E.enableCSSParsing?{anchor:Pi,opacity:Pi,fillOpacity:Pi,strokeOpacity:Pi,fill:Pi,stroke:Pi,transform:Pi,transformOrigin:Pi,visibility:Pi,pointerEvents:Pi,lineWidth:Pi,lineCap:Pi,lineJoin:Pi,increasedLineWidthForHitTesting:Pi,fontSize:Pi,fontFamily:Pi,fontStyle:Pi,fontWeight:Pi,fontVariant:Pi,textAlign:Pi,textBaseline:Pi,textTransform:Pi,zIndex:Pi,filter:Pi,shadowType:Pi}:null,t.parsedStyle={},t.attributes={},t}function $l(t){return null!=t&&t.nodeName}var Ul,Xl=new Cl(b.ATTR_MODIFIED,null,null,null,null,Cl.MODIFICATION,null,null),Kl={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:""},Zl={anchor:[0,0],fill:Li,stroke:Li,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},Ql=m(m({},Zl),{opacity:1,fillOpacity:1,strokeOpacity:1,visibility:"visible",pointerEvents:"auto",lineWidth:1,lineCap:"butt",lineJoin:"miter",increasedLineWidthForHitTesting:0,fillRule:"nonzero"}),Jl=O(O([],j(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"]),!1),["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],!1),tc=(t(u,Ul=Zs),u.prototype.destroy=function(){Ul.prototype.destroy.call(this),this.getAnimations().forEach(function(t){t.cancel()})},u.prototype.cloneNode=function(e,t){var n,r=m({},this.attributes);for(n in r){var i=r[n];$l(i)&&"clipPath"!==n&&"offsetPath"!==n&&"textPath"!==n&&(r[n]=i.cloneNode(e)),t&&(r[n]=t(n,i))}var a=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:r});return a.setLocalTransform(this.getLocalTransform()),e&&this.children.forEach(function(t){t.style.isMarker||(t=t.cloneNode(e),a.appendChild(t))}),a},u.prototype.initAttributes=function(t){void 0===t&&(t={});var e,n=this.renderable,r={forceUpdateGeometry:!0},i=(E.enableCSSParsing&&(r.usedAttributes=Jl),{});for(e in t)i[bi(e)]=t[e];E.styleValueRegistry.processProperties(this,i,r),n.dirty=!0},u.prototype.setAttribute=function(t,e,n){void 0===n&&(n=!1);t=bi(t);Ke(e)||!n&&e===this.attributes[t]||(this.internalSetAttribute(t,e),Ul.prototype.setAttribute.call(this,t,e))},u.prototype.internalSetAttribute=function(t,e,n){void 0===n&&(n={});var r=this.renderable,i=this.attributes[t],a=this.parsedStyle[t],o=(E.styleValueRegistry.processProperties(this,((o={})[t]=e,o),n),r.dirty=!0,this.parsedStyle[t]);this.isConnected&&(Xl.relatedNode=this,Xl.prevValue=i,Xl.newValue=e,Xl.attrName=t,Xl.prevParsedValue=a,Xl.newParsedValue=o,this.isMutationObserved?this.dispatchEvent(Xl):(Xl.target=this).ownerDocument.defaultView.dispatchEvent(Xl,!0)),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,i,e,a,o)},u.prototype.getBBox=function(){var t=this.getBounds(),e=j(t.getMin(),2),n=e[0],e=e[1],t=j(t.getMax(),2),r=t[0],t=t[1];return new Dr(n,e,r-n,t-e)},u.prototype.setOrigin=function(t,e,n){return E.sceneGraphService.setOrigin(this,mr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},u.prototype.getOrigin=function(){return E.sceneGraphService.getOrigin(this)},u.prototype.setPosition=function(t,e,n){return E.sceneGraphService.setPosition(this,mr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},u.prototype.setLocalPosition=function(t,e,n){return E.sceneGraphService.setLocalPosition(this,mr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},u.prototype.translate=function(t,e,n){return E.sceneGraphService.translate(this,mr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},u.prototype.translateLocal=function(t,e,n){return E.sceneGraphService.translateLocal(this,mr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},u.prototype.getPosition=function(){return E.sceneGraphService.getPosition(this)},u.prototype.getLocalPosition=function(){return E.sceneGraphService.getLocalPosition(this)},u.prototype.scale=function(t,e,n){return this.scaleLocal(t,e,n)},u.prototype.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=mr(t,e=e||t,n=n||t)),E.sceneGraphService.scaleLocal(this,t),this},u.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=mr(t,e=e||t,n=n||t)),E.sceneGraphService.setLocalScale(this,t),this},u.prototype.getLocalScale=function(){return E.sceneGraphService.getLocalScale(this)},u.prototype.getScale=function(){return E.sceneGraphService.getScale(this)},u.prototype.getEulerAngles=function(){return br(j(xr(v(),E.sceneGraphService.getWorldTransform(this)),3)[2])},u.prototype.getLocalEulerAngles=function(){return br(j(xr(v(),E.sceneGraphService.getLocalRotation(this)),3)[2])},u.prototype.setEulerAngles=function(t){return E.sceneGraphService.setEulerAngles(this,0,0,t),this},u.prototype.setLocalEulerAngles=function(t){return E.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},u.prototype.rotateLocal=function(t,e,n){return P(e)&&P(n)?E.sceneGraphService.rotateLocal(this,0,0,t):E.sceneGraphService.rotateLocal(this,t,e,n),this},u.prototype.rotate=function(t,e,n){return P(e)&&P(n)?E.sceneGraphService.rotate(this,0,0,t):E.sceneGraphService.rotate(this,t,e,n),this},u.prototype.setRotation=function(t,e,n,r){return E.sceneGraphService.setRotation(this,t,e,n,r),this},u.prototype.setLocalRotation=function(t,e,n,r){return E.sceneGraphService.setLocalRotation(this,t,e,n,r),this},u.prototype.setLocalSkew=function(t,e){return E.sceneGraphService.setLocalSkew(this,t,e),this},u.prototype.getRotation=function(){return E.sceneGraphService.getRotation(this)},u.prototype.getLocalRotation=function(){return E.sceneGraphService.getLocalRotation(this)},u.prototype.getLocalSkew=function(){return E.sceneGraphService.getLocalSkew(this)},u.prototype.getLocalTransform=function(){return E.sceneGraphService.getLocalTransform(this)},u.prototype.getWorldTransform=function(){return E.sceneGraphService.getWorldTransform(this)},u.prototype.setLocalTransform=function(t){return E.sceneGraphService.setLocalTransform(this,t),this},u.prototype.resetLocalTransform=function(){E.sceneGraphService.resetLocalTransform(this)},u.prototype.getAnimations=function(){return this.activeAnimations},u.prototype.animate=function(t,e){var n=null==(n=this.ownerDocument)?void 0:n.timeline;return n?n.play(this,t,e):null},u.prototype.isVisible=function(){var t;return"visible"===(null==(t=this.parsedStyle)?void 0:t.visibility)},Object.defineProperty(u.prototype,"interactive",{get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"},enumerable:!1,configurable:!0}),u.prototype.isInteractive=function(){var t;return"none"!==(null==(t=this.parsedStyle)?void 0:t.pointerEvents)},u.prototype.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},u.prototype.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,O([],j(this.parentNode.children.map(function(t){return Number(t.style.zIndex)})),!1))+1),this},u.prototype.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,O([],j(this.parentNode.children.map(function(t){return Number(t.style.zIndex)})),!1))-1),this},u.prototype.getConfig=function(){return this.config},u.prototype.attr=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=j(t,2),i=r[0],r=r[1];return i?je(i)?(Object.keys(i).forEach(function(t){e.setAttribute(t,i[t])}),this):2===t.length?(this.setAttribute(i,r),this):this.attributes[i]:this.attributes},u.prototype.getMatrix=function(t){var t=t||this.getWorldTransform(),e=j(mt(v(),t),2),n=e[0],e=e[1],r=j(vt(v(),t),2),i=r[0],r=r[1],t=bt(Ut(),t),t=j(xr(v(),t),3),a=t[0],t=t[2];return wr(a||t,n,e,i,r)},u.prototype.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},u.prototype.setMatrix=function(t){var t=j(Mr(t),5),e=t[0],n=t[1],r=t[2],i=t[3],t=t[4];this.setEulerAngles(t).setPosition(e,n).setLocalScale(r,i)},u.prototype.setLocalMatrix=function(t){var t=j(Mr(t),5),e=t[0],n=t[1],r=t[2],i=t[3],t=t[4];this.setLocalEulerAngles(t).setLocalPosition(e,n).setLocalScale(r,i)},u.prototype.show=function(){E.enableCSSParsing?this.style.visibility="visible":this.forEach(function(t){t.style.visibility="visible"})},u.prototype.hide=function(){E.enableCSSParsing?this.style.visibility="hidden":this.forEach(function(t){t.style.visibility="hidden"})},u.prototype.getCount=function(){return this.childElementCount},u.prototype.getParent=function(){return this.parentElement},u.prototype.getChildren=function(){return this.children},u.prototype.getFirst=function(){return this.firstElementChild},u.prototype.getLast=function(){return this.lastElementChild},u.prototype.getChildByIndex=function(t){return this.children[t]||null},u.prototype.add=function(t,e){return this.appendChild(t,e)},u.prototype.setClip=function(t){this.style.clipPath=t},u.prototype.set=function(t,e){this.config[t]=e},u.prototype.get=function(t){return this.config[t]},u.prototype.moveTo=function(t,e,n){return this.setPosition(t,e=void 0===e?0:e,n=void 0===n?0:n),this},u.prototype.move=function(t,e,n){return this.setPosition(t,e=void 0===e?0:e,n=void 0===n?0:n),this},u.prototype.setZIndex=function(t){return this.style.zIndex=t,this},u);function u(t){var r=this,t=((r=Ul.call(this)||this).isCustomElement=!1,r.isMutationObserved=!1,r.activeAnimations=[],r.getClip=function(){return this.style.clipPath||null},r.config=t,r.config.interactive=null!=(t=r.config.capture)?t: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||k.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,E.enableCSSParsing?Zl:Ql,r.config.initialParsedStyle),E.enableCSSParsing&&Object.assign(r.attributes,Kl),r.initAttributes(r.config.style),E.globalThis.Proxy||function(){});return E.enableDataset&&(r.dataset=new t({},{get:function(t,e){e="".concat("data-").concat(fi(e));return void 0!==t[e]?t[e]:r.getAttribute(e)},set:function(t,e,n){return r.setAttribute("".concat("data-").concat(fi(e)),n),!0}})),E.enableStyleSyntax&&(r.style=new t({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}var ec,nc=function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,t=t.syntax;E.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:t})},rc=(t(ic,ec=tc),ic);function ic(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return ec.call(this,m({type:k.CIRCLE,style:E.enableCSSParsing?m({cx:"",cy:"",r:""},e):m({},e),initialParsedStyle:{anchor:[.5,.5],transformOrigin:E.enableCSSParsing?null:[Ii,Ii]}},t))||this}t(sc,ac=tc);var ac,oc=sc;function sc(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]);return(e=ac.call(this,m({style:E.enableCSSParsing?m({x:"",y:""},n):m({},n)},t))||this).isCustomElement=!0,e}t(uc,lc=tc);var lc,cc=uc;function uc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return lc.call(this,m({type:k.ELLIPSE,style:E.enableCSSParsing?m({cx:"",cy:"",rx:"",ry:""},e):m({},e),initialParsedStyle:{anchor:[.5,.5],transformOrigin:E.enableCSSParsing?null:[Ii,Ii]}},t))||this}t(dc,hc=tc);var hc,fc=dc;function dc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return hc.call(this,m({type:k.GROUP,style:E.enableCSSParsing?m({x:"",y:"",width:"",height:""},e):m({},e)},t))||this}t(yc,pc=tc),yc.prototype.getDomElement=function(){return this.parsedStyle.$el},yc.prototype.getBoundingClientRect=function(){var t,e,n,r;return this.parsedStyle.$el?this.parsedStyle.$el.getBoundingClientRect():(t=(r=this.parsedStyle).x,e=r.y,n=r.width,r=r.height,new Dr(t,e,n,r))},yc.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},yc.prototype.getBounds=function(){var t=this.getBoundingClientRect(),e=null==(e=null==(e=this.ownerDocument)?void 0:e.defaultView)?void 0:e.getContextService().getBoundingClientRect(),n=new Tr,r=t.left-((null==e?void 0:e.left)||0),e=t.top-((null==e?void 0:e.top)||0);return n.setMinMax([r,e,0],[r+t.width,e+t.height,0]),n},yc.prototype.getLocalBounds=function(){if(this.parentNode){var t,e=rt(Z(),this.parentNode.getWorldTransform()),n=this.getBounds();if(!Tr.isEmpty(n))return(t=new Tr).setFromTransformedAABB(n,e),t}return this.getBounds()};var pc,gc=yc;function yc(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]);return(e=pc.call(this,m({type:k.HTML,style:E.enableCSSParsing?m({x:"",y:"",width:"auto",height:"auto",innerHTML:""},n):m({},n)},t))||this).cullable.enable=!1,e}t(bc,mc=tc);var mc,vc=bc;function bc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return mc.call(this,m({type:k.IMAGE,style:E.enableCSSParsing?m({x:"",y:"",img:"",width:"",height:""},e):m({},e)},t))||this}t(Mc,xc=tc),Mc.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&&$l(r)&&(this.markerStartAngle=0,r.remove()),i&&$l(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&$l(r)&&(this.markerEndAngle=0,r.remove()),i)&&$l(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))},Mc.prototype.transformMarker=function(t){var e,n,r,i,a,o=this.parsedStyle,s=o.markerStart,l=o.markerEnd,c=o.markerStartOffset,u=o.markerEndOffset,h=o.x1,f=o.x2,d=o.y1,p=o.y2,g=o.defX,o=o.defY,s=t?s:l;s&&$l(s)&&(l=0,t=t?(r=h-g,i=d-o,e=f-h,n=p-d,a=c||0,this.markerStartAngle):(r=f-g,i=p-o,e=h-f,n=d-p,a=u||0,this.markerEndAngle),l=Math.atan2(n,e),s.setLocalEulerAngles(180*l/Math.PI+t),s.setLocalPosition(r+Math.cos(l)*a,i+Math.sin(l)*a))},Mc.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.x1,i=n.y1,a=n.x2,o=n.y2,s=n.defX,n=n.defY,r=Fn(r,i,a,o,t),i=r.x,a=r.y,o=Wt(v(),Ct(i-s,a-n,0),e?this.getWorldTransform():this.getLocalTransform());return new Ir(o[0],o[1])},Mc.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},Mc.prototype.getTotalLength=function(){var t=this.parsedStyle;return Dn(t.x1,t.y1,t.x2,t.y2)};var xc,wc=Mc;function Mc(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]),n=((e=xc.call(this,m({type:k.LINE,style:m({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,isBillboard:!1},n)},t))||this).markerStartAngle=0,e.markerEndAngle=0,e.parsedStyle),t=n.markerStart,n=n.markerEnd;return t&&$l(t)&&(e.markerStartAngle=t.getLocalEulerAngles(),e.appendChild(t)),n&&$l(n)&&(e.markerEndAngle=n.getLocalEulerAngles(),e.appendChild(n)),e.transformMarker(!0),e.transformMarker(!1),e}t(Ec,Oc=tc),Ec.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&&$l(r)&&(this.markerStartAngle=0,r.remove()),i&&$l(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&$l(r)&&(this.markerEndAngle=0,r.remove()),i&&$l(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},Ec.prototype.transformMarker=function(t){var e,n,r,i,a,o,s,l=this.parsedStyle,c=l.markerStart,u=l.markerEnd,h=l.markerStartOffset,f=l.markerEndOffset,d=l.defX,l=l.defY,c=t?c:u;c&&$l(c)&&(u=0,h=t?(o=(t=j(this.getStartTangent(),2))[0],e=(s=t[1])[0]-d,n=s[1]-l,r=o[0]-s[0],i=o[1]-s[1],a=h||0,this.markerStartAngle):(o=(t=j(this.getEndTangent(),2))[0],e=(s=t[1])[0]-d,n=s[1]-l,r=o[0]-s[0],i=o[1]-s[1],a=f||0,this.markerEndAngle),u=Math.atan2(i,r),c.setLocalEulerAngles(180*u/Math.PI+h),c.setLocalPosition(e+Math.cos(u)*a,n+Math.sin(u)*a))},Ec.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&&$l(t))for(var a=1;a<n.length-1;a++){var o=j(n[a].currentPoint,2),s=o[0],o=o[1],l=1===a?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(s-r,o-i)}},Ec.prototype.getTotalLength=function(){return ja(this)},Ec.prototype.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,n=Se(n.path.absolutePath,t,m(m({},a),{bbox:!1,length:!0})).point,t=n.x,a=n.y,n=Wt(v(),Ct(t-r,a-i,0),e?this.getWorldTransform():this.getLocalTransform());return new Ir(n[0],n[1])},Ec.prototype.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*ja(this),e)},Ec.prototype.getStartTangent=function(){var t,e,n=this.parsedStyle.path.segments,r=[];return 1<n.length&&(t=n[0].currentPoint,e=n[1].currentPoint,r=[],(n=n[1].startTangent)?r.push([t[0]-n[0],t[1]-n[1]]):r.push([e[0],e[1]]),r.push([t[0],t[1]])),r},Ec.prototype.getEndTangent=function(){var t,e,n=this.parsedStyle.path.segments,r=n.length,i=[];return 1<r&&(t=n[r-2].currentPoint,e=n[r-1].currentPoint,i=[],(n=n[r-1].endTangent)?i.push([e[0]-n[0],e[1]-n[1]]):i.push([t[0],t[1]]),i.push([e[0],e[1]])),i};var Oc,kc=Ec;function Ec(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]),n=((e=Oc.call(this,m({type:k.PATH,style:E.enableCSSParsing?m({path:"",miterLimit:""},n):m({},n),initialParsedStyle:E.enableCSSParsing?null:{miterLimit:4,path:m({},Bi)}},t))||this).markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[],e.parsedStyle),t=n.markerStart,r=n.markerEnd,n=n.markerMid;return t&&$l(t)&&(e.markerStartAngle=t.getLocalEulerAngles(),e.appendChild(t)),n&&$l(n)&&e.placeMarkerMid(n),r&&$l(r)&&(e.markerEndAngle=r.getLocalEulerAngles(),e.appendChild(r)),e.transformMarker(!0),e.transformMarker(!1),e}t(_c,Sc=tc),_c.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&&$l(r)&&(this.markerStartAngle=0,r.remove()),i&&$l(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&$l(r)&&(this.markerEndAngle=0,r.remove()),i&&$l(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},_c.prototype.transformMarker=function(t){var e,n,r,i,a,o=this.parsedStyle,s=o.markerStart,l=o.markerEnd,c=o.markerStartOffset,u=o.markerEndOffset,h=o.points.points,f=o.defX,o=o.defY,s=t?s:l;s&&$l(s)&&(i=h[l=0][0]-f,a=h[0][1]-o,c=t?(e=h[1][0]-h[0][0],n=h[1][1]-h[0][1],r=c||0,this.markerStartAngle):(t=h.length,n=this.parsedStyle.isClosed?(e=h[t-1][0]-h[0][0],h[t-1][1]-h[0][1]):(i=h[t-1][0]-f,a=h[t-1][1]-o,e=h[t-2][0]-h[t-1][0],h[t-2][1]-h[t-1][1]),r=u||0,this.markerEndAngle),l=Math.atan2(n,e),s.setLocalEulerAngles(180*l/Math.PI+c),s.setLocalPosition(i+Math.cos(l)*r,a+Math.sin(l)*r))},_c.prototype.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.points.points,r=e.defX,i=e.defY;if(this.markerMidList.forEach(function(t){t.remove()}),this.markerMidList=[],t&&$l(t))for(var a=1;a<(this.parsedStyle.isClosed?n.length:n.length-1);a++){var o=n[a][0]-r,s=n[a][1]-i,l=1===a?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(o,s)}};var Sc,Ac=_c;function _c(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]),n=((e=Sc.call(this,m({type:k.POLYGON,style:E.enableCSSParsing?m({points:"",miterLimit:"",isClosed:!0},n):m({},n),initialParsedStyle:E.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},t))||this).markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[],e.parsedStyle),t=n.markerStart,r=n.markerEnd,n=n.markerMid;return t&&$l(t)&&(e.markerStartAngle=t.getLocalEulerAngles(),e.appendChild(t)),n&&$l(n)&&e.placeMarkerMid(n),r&&$l(r)&&(e.markerEndAngle=r.getLocalEulerAngles(),e.appendChild(r)),e.transformMarker(!0),e.transformMarker(!1),e}t(Cc,Tc=Ac),Cc.prototype.getTotalLength=function(){return this.parsedStyle.points.totalLength},Cc.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},Cc.prototype.getPoint=function(n,t){void 0===t&&(t=!1);var e=this.parsedStyle,r=e.defX,i=e.defY,e=e.points,a=e.points,e=e.segments,o=0,s=0,e=(e.forEach(function(t,e){n>=t[0]&&n<=t[1]&&(o=(n-t[0])/(t[1]-t[0]),s=e)}),Fn(a[s][0],a[s][1],a[s+1][0],a[s+1][1],o)),a=e.x,e=e.y,a=Wt(v(),Ct(a-r,e-i,0),t?this.getWorldTransform():this.getLocalTransform());return new Ir(a[0],a[1])},Cc.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},Cc.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};var Tc,Pc=Cc;function Cc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return Tc.call(this,m({type:k.POLYLINE,style:E.enableCSSParsing?m({points:"",miterLimit:"",isClosed:!1},e):m({},e),initialParsedStyle:E.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},t))||this}t(jc,Lc=tc);var Lc,Nc=jc;function jc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return Lc.call(this,m({type:k.RECT,style:E.enableCSSParsing?m({x:"",y:"",width:"",height:"",radius:""},e):m({},e)},t))||this}t(Bc,Rc=tc),Bc.prototype.getComputedTextLength=function(){var t;return(null==(t=this.parsedStyle.metrics)?void 0:t.maxLineWidth)||0},Bc.prototype.getLineBoundingRects=function(){var t;return(null==(t=this.parsedStyle.metrics)?void 0:t.lineMetrics)||[]},Bc.prototype.isOverflowing=function(){return!!this.parsedStyle.isOverflowing};var Rc,Ic=Bc;function Bc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return Rc.call(this,m({type:k.TEXT,style:E.enableCSSParsing?m({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""},e):m({fill:"black"},e),initialParsedStyle:E.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}},t))||this}Fc.prototype.define=function(t,e){this.registry[t]=e},Fc.prototype.get=function(t){return this.registry[t]};var Dc=Fc;function Fc(){this.registry={},this.define(k.CIRCLE,rc),this.define(k.ELLIPSE,cc),this.define(k.RECT,Nc),this.define(k.IMAGE,vc),this.define(k.LINE,wc),this.define(k.GROUP,fc),this.define(k.PATH,kc),this.define(k.POLYGON,Ac),this.define(k.POLYLINE,Pc),this.define(k.TEXT,Ic),this.define(k.HTML,gc)}t(Gc,zc=bl),Object.defineProperty(Gc.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(Gc.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(Gc.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(Gc.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Gc.prototype.createElement=function(t,e){var n;return"svg"===t?this.documentElement:((n=this.defaultView.customElements.get(t))||(console.warn("Unsupported tagName: ",t),n="tspan"===t?Ic:fc),(t=new n(e)).ownerDocument=this,t)},Gc.prototype.createElementNS=function(t,e,n){return this.createElement(e,n)},Gc.prototype.cloneNode=function(t){throw new Error(Hr)},Gc.prototype.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}},Gc.prototype.elementsFromBBox=function(t,e,n,r){var t=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),i=[];return t.forEach(function(t){var t=t.displayObject,e=t.parsedStyle.pointerEvents,e=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(e);e&&!t.isVisible()||t.isCulled()||!t.isInteractive()||i.push(t)}),i.sort(function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder}),i},Gc.prototype.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,n=n.y,i=this.defaultView.getConfig(),a=i.width,i=i.height;return r<0||n<0||a<r||i<n?null:(i=(a=this.defaultView.viewport2Client({x:r,y:n})).x,a=a.y,(t=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:n,clientX:i,clientY:a},picked:[]}).picked)&&t[0]||this.documentElement)},Gc.prototype.elementFromPoint=function(a,o){return X(this,void 0,void 0,function(){var e,n,r,i;return R(this,function(t){switch(t.label){case 0:return(e=this.defaultView.canvas2Viewport({x:a,y:o}),i=e.x,e=e.y,n=this.defaultView.getConfig(),r=n.width,n=n.height,i<0||e<0||r<i||n<e)?[2,null]:(r=this.defaultView.viewport2Client({x:i,y:e}),n=r.x,r=r.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:a,y:o,viewportX:i,viewportY:e,clientX:n,clientY:r},picked:[]})]);case 1:return[2,(i=t.sent().picked)&&i[0]||this.documentElement]}})})},Gc.prototype.elementsFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,n=n.y,i=this.defaultView.getConfig(),a=i.width,i=i.height;return r<0||n<0||a<r||i<n?[]:(i=(a=this.defaultView.viewport2Client({x:r,y:n})).x,a=a.y,(t=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:n,clientX:i,clientY:a},picked:[]}).picked)[t.length-1]!==this.documentElement&&t.push(this.documentElement),t)},Gc.prototype.elementsFromPoint=function(a,o){return X(this,void 0,void 0,function(){var e,n,r,i;return R(this,function(t){switch(t.label){case 0:return(e=this.defaultView.canvas2Viewport({x:a,y:o}),i=e.x,e=e.y,n=this.defaultView.getConfig(),r=n.width,n=n.height,i<0||e<0||r<i||n<e)?[2,[]]:(r=this.defaultView.viewport2Client({x:i,y:e}),n=r.x,r=r.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:a,y:o,viewportX:i,viewportY:e,clientX:n,clientY:r},picked:[]})]);case 1:return(i=t.sent().picked)[i.length-1]!==this.documentElement&&i.push(this.documentElement),[2,i]}})})},Gc.prototype.appendChild=function(t,e){throw new Error(Vr)},Gc.prototype.insertBefore=function(t,e){throw new Error(Vr)},Gc.prototype.removeChild=function(t,e){throw new Error(Vr)},Gc.prototype.replaceChild=function(t,e,n){throw new Error(Vr)},Gc.prototype.append=function(){throw new Error(Vr)},Gc.prototype.prepend=function(){throw new Error(Vr)},Gc.prototype.getElementById=function(t){return this.documentElement.getElementById(t)},Gc.prototype.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},Gc.prototype.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},Gc.prototype.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},Gc.prototype.querySelector=function(t){return this.documentElement.querySelector(t)},Gc.prototype.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},Gc.prototype.find=function(t){return this.documentElement.find(t)},Gc.prototype.findAll=function(t){return this.documentElement.findAll(t)};var zc,Wc=Gc;function Gc(){var t=zc.call(this)||this;t.defaultView=null,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new E.AnimationTimeline(t)}catch(t){}var r={};return bo.forEach(function(t){var e=t.n,n=t.inh,t=t.d;n&&t&&(r[e]=pi(t)?t(k.GROUP):t)}),t.documentElement=new fc({id:"g-root",style:r}),((t.documentElement.ownerDocument=t).documentElement.parentNode=t).childNodes=[t.documentElement],t}Vc.prototype.apply=function(t){var n=t.camera,e=t.renderingService,r=t.renderingContext,i=this.strategies;e.hooks.cull.tap(Vc.tag,function(e){var t;return e&&(t=e.cullable,0===i.length?t.visible=-1<r.unculledEntities.indexOf(e.entity):t.visible=i.every(function(t){return t.isVisible(n,e)}),!e.isCulled()&&e.isVisible()?e:(e.dispatchEvent(new gl(b.CULLED)),null))}),e.hooks.afterRender.tap(Vc.tag,function(t){t.cullable.visibilityPlaneMask=-1})},Vc.tag="Culling";var Hc=Vc;function Vc(t){this.strategies=t}qc.prototype.apply=function(t){var e=t.renderingService;e.hooks.dirtycheck.tap(qc.tag,function(t){return t&&(t.renderable.dirty||e.disableDirtyRectangleRendering()?t:null)})},qc.tag="DirtyCheck";var Yc=qc;function qc(){}Uc.prototype.apply=function(t){var c=this,t=(this.context=t).renderingService,u=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(t){return c.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null}),t.hooks.pointerWheel.tap(Uc.tag,function(t){t=c.normalizeWheelEvent(t);c.context.eventService.mapEvent(t)}),t.hooks.pointerDown.tap(Uc.tag,function(t){var e,n;if(!u.supportsTouchEvents||"touch"!==t.pointerType){var r=c.normalizeToPointerEvent(t,u);!c.autoPreventDefault||!r[0].isNormalized||!t.cancelable&&"cancelable"in t||t.preventDefault();try{for(var i=I(r),a=i.next();!a.done;a=i.next()){var o=a.value,s=c.bootstrapEvent(c.rootPointerEvent,o,u,t);c.context.eventService.mapEvent(s)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}c.setCursor(c.context.eventService.cursor)}}),t.hooks.pointerUp.tap(Uc.tag,function(t){var e,n;if(!u.supportsTouchEvents||"touch"!==t.pointerType){var r=c.context.contextService.getDomElement(),i="outside";try{i=r&&t.target&&t.target!==r&&r.contains&&!r.contains(t.target)?"outside":""}catch(t){}r=c.normalizeToPointerEvent(t,u);try{for(var a=I(r),o=a.next();!o.done;o=a.next()){var s=o.value,l=c.bootstrapEvent(c.rootPointerEvent,s,u,t);l.type+=i,c.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}c.setCursor(c.context.eventService.cursor)}}),t.hooks.pointerMove.tap(Uc.tag,this.onPointerMove),t.hooks.pointerOver.tap(Uc.tag,this.onPointerMove),t.hooks.pointerOut.tap(Uc.tag,this.onPointerMove),t.hooks.click.tap(Uc.tag,this.onClick),t.hooks.pointerCancel.tap(Uc.tag,function(t){var e,n,r=c.normalizeToPointerEvent(t,u);try{for(var i=I(r),a=i.next();!a.done;a=i.next()){var o=a.value,s=c.bootstrapEvent(c.rootPointerEvent,o,u,t);c.context.eventService.mapEvent(s)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}c.setCursor(c.context.eventService.cursor)})},Uc.prototype.getViewportXY=function(t){var e,n=t.offsetX,r=t.offsetY,i=t.clientX,t=t.clientY;return t=!this.context.config.supportsCSSTransform||P(n)||P(r)?(e=(i=this.context.eventService.client2Viewport(new Ir(i,t))).x,i.y):(e=n,r),{x:e,y:t}},Uc.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 e=(n=this.getViewportXY(e)).x,n=n.y,n=(t.viewport.x=e,t.viewport.y=n,(e=this.context.eventService.viewport2Canvas(t.viewport)).x),e=e.y;return t.canvas.x=n,t.canvas.y=e,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=ds[t.type]||t.type),t},Uc.prototype.normalizeWheelEvent=function(t){var e=this.rootWheelEvent,n=(this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ,(r=this.getViewportXY(t)).x),r=r.y,r=(e.viewport.x=n,e.viewport.y=r,(n=this.context.eventService.viewport2Canvas(e.viewport)).x),n=n.y;return e.canvas.x=r,e.canvas.y=n,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},Uc.prototype.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=ps.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},Uc.prototype.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},Uc.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];Ke(i.button)&&(i.button=0),Ke(i.buttons)&&(i.buttons=1),Ke(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),Ke(i.width)&&(i.width=i.radiusX||1),Ke(i.height)&&(i.height=i.radiusY||1),Ke(i.tiltX)&&(i.tiltX=0),Ke(i.tiltY)&&(i.tiltY=0),Ke(i.pointerType)&&(i.pointerType="touch"),Ke(i.pointerId)&&(i.pointerId=i.identifier||0),Ke(i.pressure)&&(i.pressure=i.force||.5),Ke(i.twist)&&(i.twist=0),Ke(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else e.isMouseEvent(t)?(Ke((e=t).isPrimary)&&(e.isPrimary=!0),Ke(e.width)&&(e.width=1),Ke(e.height)&&(e.height=1),Ke(e.tiltX)&&(e.tiltX=0),Ke(e.tiltY)&&(e.tiltY=0),Ke(e.pointerType)&&(e.pointerType="mouse"),Ke(e.pointerId)&&(e.pointerId=1),Ke(e.pressure)&&(e.pressure=.5),Ke(e.twist)&&(e.twist=0),Ke(e.tangentialPressure)&&(e.tangentialPressure=0),e.isNormalized=!0,n.push(e)):n.push(t);return n},Uc.tag="Event";var $c=Uc;function Uc(){var c=this;this.autoPreventDefault=!1,this.rootPointerEvent=new cl(null),this.rootWheelEvent=new fl(null),this.onPointerMove=function(t){var e,n,r=null==(i=null==(i=c.context.renderingContext.root)?void 0:i.ownerDocument)?void 0:i.defaultView;if(!r.supportsTouchEvents||"touch"!==t.pointerType){var i=c.normalizeToPointerEvent(t,r);try{for(var a=I(i),o=a.next();!o.done;o=a.next()){var s=o.value,l=c.bootstrapEvent(c.rootPointerEvent,s,r,t);c.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}c.setCursor(c.context.eventService.cursor)}},this.onClick=function(t){var e,n,r=null==(i=null==(i=c.context.renderingContext.root)?void 0:i.ownerDocument)?void 0:i.defaultView,i=c.normalizeToPointerEvent(t,r);try{for(var a=I(i),o=a.next();!o.done;o=a.next()){var s=o.value,l=c.bootstrapEvent(c.rootPointerEvent,s,r,t);c.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}c.setCursor(c.context.eventService.cursor)}}var Xc=[k.CIRCLE,k.ELLIPSE,k.IMAGE,k.RECT,k.LINE,k.POLYLINE,k.POLYGON,k.TEXT,k.PATH,k.HTML],Kc=(Zc.prototype.isVisible=function(t,e){var n,r,i=e.cullable;return!i.enable||(n=e.getRenderBounds(),!Tr.isEmpty(n)&&(t=t.getFrustum(),r=null==(r=null==(r=e.parentNode)?void 0:r.cullable)?void 0:r.visibilityPlaneMask,i.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,n,r||Cr.INDETERMINATE,t.planes),i.visible=i.visibilityPlaneMask!==Cr.OUTSIDE,i.visible))},Zc.prototype.computeVisibilityWithPlaneMask=function(t,e,n,r){if(n===Cr.OUTSIDE||n===Cr.INSIDE)return n;for(var i=Cr.INSIDE,a=-1<Xc.indexOf(t.nodeName),o=0,s=r.length;o<s;++o){var l=1<<o;if(0!=(n&l)&&(!a||4!==o&&5!==o)){var c=r[o],u=c.normal,c=c.distance;if(Dt(u,e.getPositiveFarPoint(r[o]))+c<0)return Cr.OUTSIDE;Dt(u,e.getNegativeFarPoint(r[o]))+c<0&&(i|=l)}}return i},Zc);function Zc(){}tu.prototype.apply=function(t){function e(t){t.target.renderable.dirty=!0,o.dirtify()}function n(t){for(var e=t.detail.affectChildren,t=t.target,n=(e&&t.forEach(function(t){a.toSync.add(t)}),t);n;)n.renderable&&a.toSync.add(n),n=n.parentElement;o.dirtify()}function r(t){t=t.target,E.enableCSSParsing&&E.styleValueRegistry.recalc(t),E.sceneGraphService.dirtifyToRoot(t),o.dirtify()}function i(t){var e=(t=t.target).rBushNode;e.aabb&&a.rBush.remove(e.aabb),a.toSync.delete(t),E.sceneGraphService.dirtifyToRoot(t),o.dirtify()}var a=this,o=t.renderingService,s=t.renderingContext,t=t.rBushRoot,l=s.root.ownerDocument.defaultView;this.rBush=t;o.hooks.init.tap(tu.tag,function(){l.addEventListener(b.MOUNTED,r),l.addEventListener(b.UNMOUNTED,i),l.addEventListener(b.ATTR_MODIFIED,e),l.addEventListener(b.BOUNDS_CHANGED,n)}),o.hooks.destroy.tap(tu.tag,function(){l.removeEventListener(b.MOUNTED,r),l.removeEventListener(b.UNMOUNTED,i),l.removeEventListener(b.ATTR_MODIFIED,e),l.removeEventListener(b.BOUNDS_CHANGED,n),a.toSync.clear()}),o.hooks.endFrame.tap(tu.tag,function(){a.syncRTree()})},tu.prototype.syncRTree=function(){var o=this,s=[];Array.from(this.toSync).filter(function(t){return t.isConnected}).forEach(function(t){var e,n,r,i=t.rBushNode,a=(i&&i.aabb&&o.rBush.remove(i.aabb),t.getRenderBounds());a&&(e=(n=j(a.getMin(),2))[0],n=n[1],r=(a=j(a.getMax(),2))[0],a=a[1],i.aabb||(i.aabb={}),i.aabb.displayObject=t,i.aabb.minX=e,i.aabb.minY=n,i.aabb.maxX=r,i.aabb.maxY=a),!i.aabb||isNaN(i.aabb.maxX)||isNaN(i.aabb.maxX)||isNaN(i.aabb.minX)||isNaN(i.aabb.minY)||s.push(i.aabb)}),this.rBush.load(s),s.length=0,this.toSync.clear()},tu.tag="Prepare";var Qc,Jc=tu;function tu(){this.toSync=new Set}(Xs=Qc=Qc||{}).READY="ready",Xs.BEFORE_RENDER="beforerender",Xs.RERENDER="rerender",Xs.AFTER_RENDER="afterrender",Xs.BEFORE_DESTROY="beforedestroy",Xs.AFTER_DESTROY="afterdestroy",Xs.RESIZE="resize",Xs.DIRTY_RECTANGLE="dirtyrectangle",Xs.RENDERER_CHANGED="rendererchanged";var eu,nu=new gl(b.MOUNTED),ru=new gl(b.UNMOUNTED),iu=new gl(Qc.BEFORE_RENDER),au=new gl(Qc.RERENDER),ou=new gl(Qc.AFTER_RENDER),su=(t(lu,eu=ol),lu.prototype.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},lu.prototype.initDefaultCamera=function(t,e,n){var r=this,i=new E.CameraContribution;i.clipSpaceNearZ=n,i.setType(zr.EXPLORING,Wr.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(Ur,function(){r.context.renderingContext.renderReasons.add(Ml.CAMERA_CHANGED)}),this.context.camera=i},lu.prototype.getConfig=function(){return this.context.config},lu.prototype.getRoot=function(){return this.document.documentElement},lu.prototype.getCamera=function(){return this.context.camera},lu.prototype.getContextService=function(){return this.context.contextService},lu.prototype.getEventService=function(){return this.context.eventService},lu.prototype.getRenderingService=function(){return this.context.renderingService},lu.prototype.getRenderingContext=function(){return this.context.renderingContext},lu.prototype.getStats=function(){return this.getRenderingService().getStats()},Object.defineProperty(lu.prototype,"ready",{get:function(){var e=this;return this.readyPromise||(this.readyPromise=new Promise(function(t){e.resolveReadyPromise=function(){t(e)}}),this.inited&&this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),lu.prototype.destroy=function(t,e){void 0===t&&(t=!0),(e=void 0===e?!1:e)||this.dispatchEvent(new gl(Qc.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 gl(Qc.AFTER_DESTROY))},lu.prototype.changeSize=function(t,e){this.resize(t,e)},lu.prototype.resize=function(t,e){var n=this.context.config,n=(n.width=t,n.height=e,this.getContextService().resize(t,e),this.context.camera),r=n.getProjectionMode();n.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),r===Gr.ORTHOGRAPHIC?n.setOrthographic(t/-2,t/2,e/2,e/-2,n.getNear(),n.getFar()):n.setAspect(t/e),this.dispatchEvent(new gl(Qc.RESIZE,{width:t,height:e}))},lu.prototype.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},lu.prototype.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},lu.prototype.removeChild=function(t){return this.document.documentElement.removeChild(t)},lu.prototype.removeChildren=function(){this.document.documentElement.removeChildren()},lu.prototype.destroyChildren=function(){this.document.documentElement.destroyChildren()},lu.prototype.render=function(){var t=this;this.dispatchEvent(iu),this.getRenderingService().render(this.getConfig(),function(){t.dispatchEvent(au)}),this.dispatchEvent(ou)},lu.prototype.run=function(){function t(){e.render(),e.frameId=e.requestAnimationFrame(t)}var e=this;t()},lu.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 cr,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new $c,new Jc,new Yc,new Hc([new Kc])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(m(m({},E),this.context)),this.context.renderingService=new El(E,this.context),this.context.eventService=new xl(E,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)})},lu.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 gl(Qc.READY))}):r.dispatchEvent(new gl(Qc.READY)),r.readyPromise&&r.resolveReadyPromise()):r.dispatchEvent(new gl(Qc.RENDERER_CHANGED)),e||r.getRoot().forEach(function(t){t=t.renderable;t&&(t.renderBoundsDirty=!0,t.boundsDirty=!0,t.dirty=!0)}),r.mountChildren(r.getRoot()),t.getConfig().enableAutoRendering&&r.run()})},lu.prototype.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach(function(t){t.context=e.context,t.init(E)})},lu.prototype.setRenderer=function(t){var e,n=this.getConfig();n.renderer!==t&&(e=n.renderer,n.renderer=t,this.destroy(!1,!0),O([],j(null==e?void 0:e.getPlugins()),!1).reverse().forEach(function(t){t.destroy(E)}),this.initRenderer(t))},lu.prototype.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},lu.prototype.unmountChildren=function(t){var e=this;t.childNodes.forEach(function(t){e.unmountChildren(t)}),this.inited&&(t.isMutationObserved?t.dispatchEvent(ru):(ru.target=t,this.dispatchEvent(ru,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},lu.prototype.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(nu):(nu.target=t,this.dispatchEvent(nu,!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()},lu.prototype.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},lu.prototype.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},lu.prototype.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},lu.prototype.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},lu.prototype.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},lu.prototype.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},lu);function lu(t){var e=eu.call(this)||this,n=(e.Element=tc,e.inited=!1,e.context={},e.document=new Wc,(e.document.defaultView=e).customElements=new Dc,t.container),r=t.canvas,i=t.offscreenCanvas,a=t.width,o=t.height,s=t.devicePixelRatio,l=t.renderer,c=t.background,u=t.cursor,h=t.document,f=t.requestAnimationFrame,d=t.cancelAnimationFrame,p=t.createImage,g=t.supportsPointerEvents,y=t.supportsTouchEvents,m=t.supportsCSSTransform,v=t.supportsMutipleCanvasesInOneContainer,b=t.useNativeClickEvent,x=t.alwaysTriggerPointerEventOnCanvas,w=t.isTouchEvent,t=t.isMouseEvent,M=(!v&&(v=e,M=n)&&(M="string"==typeof M?M:M.id||ls++,ss[M]&&ss[M].destroy(),ss[M]=v),a),v=o,O=s;return r&&(O=1<=(O=s||cs&&window.devicePixelRatio||1)?Math.ceil(O):1,M=a||("auto"===(a=fs(s=r,"width"))?s.offsetWidth:parseFloat(a))||r.width/O,v=o||("auto"===(a=fs(s=r,"height"))?s.offsetHeight:parseFloat(a))||r.height/O),i&&(E.offscreenCanvas=i),e.devicePixelRatio=O,e.requestAnimationFrame=null!=f?f:As.bind(E.globalThis),e.cancelAnimationFrame=null!=d?d:_s.bind(E.globalThis),e.supportsTouchEvents=null!=y?y:"ontouchstart"in E.globalThis,e.supportsPointerEvents=null!=g?g:!!E.globalThis.PointerEvent,e.isTouchEvent=null!=w?w:function(t){return e.supportsTouchEvents&&t instanceof E.globalThis.TouchEvent},e.isMouseEvent=null!=t?t:function(t){return!E.globalThis.MouseEvent||t instanceof E.globalThis.MouseEvent&&(!e.supportsPointerEvents||!(t instanceof E.globalThis.PointerEvent))},e.initRenderingContext({container:n,canvas:r,width:M,height:v,renderer:l,offscreenCanvas:i,devicePixelRatio:O,cursor:u||"default",background:c||"transparent",createImage:p,document:h,supportsCSSTransform:m,useNativeClickEvent:b,alwaysTriggerPointerEventOnCanvas:x}),e.initDefaultCamera(M,v,l.clipSpaceNearZ),e.initRenderer(l,!0),e}t(hu,cu=n),hu.prototype.rotate=function(t,e,n){if(this.relElevation=yr(e),this.relAzimuth=yr(t),this.relRoll=yr(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===zr.EXPLORING){e=Xt(Ut(),[1,0,0],vr((this.rotateWorld?1:-1)*this.relElevation)),t=Xt(Ut(),[0,1,0],vr((this.rotateWorld?1:-1)*this.relAzimuth)),n=Xt(Ut(),[0,0,1],vr(this.relRoll)),t=Kt(Ut(),t,e),t=Kt(Ut(),t,n),e=wt(Z(),t);ut(this.matrix,this.matrix,[0,0,-this.distance]),ct(this.matrix,this.matrix,e),ut(this.matrix,this.matrix,[0,0,this.distance])}else{if(90<Math.abs(this.elevation))return this;this.computeMatrix()}return this._getAxes(),this.type===zr.ORBITING||this.type===zr.EXPLORING?this._getPosition():this.type===zr.TRACKING&&this._getFocalPoint(),this._update(),this},hu.prototype.pan=function(t,e){t=mr(t,e,0),e=Tt(this.position);return jt(e,e,It(v(),this.right,t[0])),jt(e,e,It(v(),this.up,t[1])),this._setPosition(e),this.triggerUpdate(),this},hu.prototype.dolly=function(t){var e=this.forward,n=Tt(this.position),t=(this.dollyingStep,this.distance+t*this.dollyingStep),t=Math.max(Math.min(t,this.maxDistance),this.minDistance)-this.distance;return n[0]+=t*e[0],n[1]+=t*e[1],n[2]+=t*e[2],this._setPosition(n),this.type===zr.ORBITING||this.type===zr.EXPLORING?this._getDistance():this.type===zr.TRACKING&&jt(this.focalPoint,n,this.distanceVector),this.triggerUpdate(),this},hu.prototype.cancelLandmarkAnimation=function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)},hu.prototype.createLandmark=function(t,e){var n,r=(e=void 0===e?{}:e).position,r=void 0===r?this.position:r,i=e.focalPoint,i=void 0===i?this.focalPoint:i,a=e.roll,e=e.zoom,o=new E.CameraContribution,r=(o.setType(this.type,void 0),o.setPosition(r[0],null!=(n=r[1])?n:this.position[1],null!=(n=r[2])?n:this.position[2]),o.setFocalPoint(i[0],null!=(r=i[1])?r:this.focalPoint[1],null!=(n=i[2])?n:this.focalPoint[2]),o.setRoll(null!=a?a:this.roll),o.setZoom(null!=e?e:this.zoom),{name:t,matrix:Q(o.getWorldTransform()),right:Tt(o.right),up:Tt(o.up),forward:Tt(o.forward),position:Tt(o.getPosition()),focalPoint:Tt(o.getFocalPoint()),distanceVector:Tt(o.getDistanceVector()),distance:o.getDistance(),dollyingStep:o.getDollyingStep(),azimuth:o.getAzimuth(),elevation:o.getElevation(),roll:o.getRoll(),relAzimuth:o.relAzimuth,relElevation:o.relElevation,relRoll:o.relRoll,zoom:o.getZoom()});return this.landmarks.push(r),r},hu.prototype.gotoLandmark=function(e,t){var n,o,r,i,s,l,c,u,h,f,d,p,g,y=this,a=(void 0===t&&(t={}),ze(e)?this.landmarks.find(function(t){return t.name===e}):e);a&&(n=void 0===(n=(t=Ge(t)?{duration:t}:t).easing)?"linear":n,r=t.duration,o=void 0===r?100:r,r=void 0===(r=t.easingFunction)?void 0:r,t=t.onfinish,i=void 0===t?void 0:t,s=.01,0===o?(this.syncFromLandmark(a),i&&i()):(this.cancelLandmarkAnimation(),l=a.position,c=a.focalPoint,u=a.zoom,h=a.roll,f=r||E.EasingFunction(n),p=function(){y.setFocalPoint(c),y.setPosition(l),y.setRoll(h),y.setZoom(u),y.computeMatrix(),y.triggerUpdate(),i&&i()},g=function(t){var e,n,r,i,a,t=t-(d=void 0===d?t:d);o<t||(e=f(t/o),n=v(),r=v(),i=1,a=0,zt(n,y.focalPoint,c,e),zt(r,y.position,l,e),a=y.roll*(1-e)+h*e,i=y.zoom*(1-e)+u*e,y.setFocalPoint(n),y.setPosition(r),y.setRoll(a),y.setZoom(i),Vt(n,c)+Vt(r,l)<=s&&null==u&&null==h)?p():(y.computeMatrix(),y.triggerUpdate(),t<o&&(y.landmarkAnimationID=y.canvas.requestAnimationFrame(g)))},this.canvas.requestAnimationFrame(g)))},hu.prototype.syncFromLandmark=function(t){this.matrix=J(this.matrix,t.matrix),this.right=Lt(this.right,t.right),this.up=Lt(this.up,t.up),this.forward=Lt(this.forward,t.forward),this.position=Lt(this.position,t.position),this.focalPoint=Lt(this.focalPoint,t.focalPoint),this.distanceVector=Lt(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};var cu,uu=hu;function hu(){var t=null!==cu&&cu.apply(this,arguments)||this;return t.landmarks=[],t}E.CameraContribution=uu;t(pu,fu=rl);var fu,du=pu;function pu(t,e,n,r){t=fu.call(this,t)||this;return t.currentTime=n,t.timelineTime=r,t.target=e,t.type="finish",t.bubbles=!1,t.currentTarget=e,t.defaultPrevented=!1,t.eventPhase=t.AT_TARGET,t.timeStamp=Date.now(),t.currentTime=n,t.timelineTime=r,t}var gu=0,yu=(Object.defineProperty(mu.prototype,"pending",{get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending},enumerable:!1,configurable:!0}),Object.defineProperty(mu.prototype,"playState",{get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"},enumerable:!1,configurable:!0}),Object.defineProperty(mu.prototype,"ready",{get:function(){var n=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise(function(t,e){n.resolveReadyPromise=function(){t(n)},n.rejectReadyPromise=function(){e(new Error)}}),this.pending)||this.resolveReadyPromise(),this.readyPromise},enumerable:!1,configurable:!0}),Object.defineProperty(mu.prototype,"finished",{get:function(){var n=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise(function(t,e){n.resolveFinishedPromise=function(){t(n)},n.rejectFinishedPromise=function(){e(new Error)}}),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise},enumerable:!1,configurable:!0}),Object.defineProperty(mu.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.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(mu.prototype,"startTime",{get:function(){return this._startTime},set:function(t){null!==t&&(this.updatePromises(),t=Number(t),isNaN(t)||this._paused||this._idle||(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(mu.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){var e;t!==this._playbackRate&&(this.updatePromises(),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(mu.prototype,"_isFinished",{get:function(){return!this._idle&&(0<this._playbackRate&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)},enumerable:!1,configurable:!0}),Object.defineProperty(mu.prototype,"totalDuration",{get:function(){return this._totalDuration},enumerable:!1,configurable:!0}),Object.defineProperty(mu.prototype,"_needsTick",{get:function(){return this.pending||"running"===this.playState||!this._finishedFlag},enumerable:!1,configurable:!0}),mu.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},mu.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()},mu.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()},mu.prototype.finish=function(){this.updatePromises(),this._idle||(this.currentTime=0<this._playbackRate?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},mu.prototype.cancel=function(){var t,e=this;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)&&(t=new du(null,this,this.currentTime,null),setTimeout(function(){e.oncancel(t)}))},mu.prototype.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()},mu.prototype.updatePlaybackRate=function(t){this.playbackRate=t},mu.prototype.targetAnimations=function(){var t;return(null==(t=this.effect)?void 0:t.target).getAnimations()},mu.prototype.markTarget=function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)},mu.prototype.unmarkTarget=function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)},mu.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))},mu.prototype.rewind=function(){if(0<=this.playbackRate)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}},mu.prototype.persist=function(){throw new Error(Hr)},mu.prototype.addEventListener=function(t,e,n){throw new Error(Hr)},mu.prototype.removeEventListener=function(t,e,n){throw new Error(Hr)},mu.prototype.dispatchEvent=function(t){throw new Error(Hr)},mu.prototype.commitStyles=function(){throw new Error(Hr)},mu.prototype.ensureAlive=function(){var t;this.playbackRate<0&&0===this.currentTime?this._inEffect=!(null==(t=this.effect)||!t.update(-1)):this._inEffect=!(null==(t=this.effect)||!t.update(this.currentTime)),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},mu.prototype.tickCurrentTime=function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=0<this._playbackRate?this._totalDuration:0),this.ensureAlive())},mu.prototype.fireEvents=function(t){var e,n=this;this._isFinished?this._finishedFlag||(this.onfinish&&(e=new du(null,this,this.currentTime,t),setTimeout(function(){n.onfinish&&n.onfinish(e)})),this._finishedFlag=!0):(this.onframe&&"running"===this.playState&&(t=new du(null,this,this.currentTime,t),this.onframe(t)),this._finishedFlag=!1)},mu);function mu(t,e){this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,((this.effect=t).animation=this).timeline=e,this.id="".concat(gu++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null==(t=this.effect)?void 0:t.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}function vu(b,e,x,n){if(!(0<=b&&b<=1&&0<=x&&x<=1))throw new Error("bezier x values must be in [0, 1] range");if(b===e&&x===n)return function(t){return t};for(var w=new(Fu?Float32Array:Array)(11),t=0;t<11;++t)w[t]=Hu(.1*t,b,x);function r(t){for(var e=0,n=1;10!==n&&w[n]<=t;++n)e+=.1;var r=e+.1*((t-w[--n])/(w[n+1]-w[n])),i=Vu(r,b,x);if(.001<=i){for(var a=t,o=r,s=b,l=x,c=0;c<Iu;++c){var u=Vu(o,s,l);if(0===u)return o;o-=(Hu(o,s,l)-a)/u}return o}if(0===i)return r;for(var h,f,d=t,p=e,g=e+.1,y=b,m=x,v=0;0<(h=Hu(f=p+(g-p)/2,y,m)-d)?g=f:p=f,Math.abs(h)>Bu&&++v<Du;);return f}return function(t){return 0===t||1===t?t:Hu(r(t),e,n)}}function bu(t){return Math.pow(t,2)}function xu(t){return Math.pow(t,3)}function wu(t){return Math.pow(t,4)}function Mu(t){return Math.pow(t,5)}function Ou(t){return Math.pow(t,6)}function ku(t){return 1-Math.cos(t*Math.PI/2)}function Eu(t){return 1-Math.sqrt(1-t*t)}function Su(t){return t*t*(3*t-2)}function Au(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)}function _u(t,e){var n=(e=j(e=void 0===e?[]:e,2))[0],e=void 0===(e=e[1])?.5:e,n=We(Number(void 0===n?1:n),1,10),e=We(Number(e),.1,2);return 0===t||1===t?t:-n*Math.pow(2,10*(t-1))*Math.sin((t-1-e/(2*Math.PI)*Math.asin(1/n))*(2*Math.PI)/e)}function Tu(t,e,n){var r=(e=j(e=void 0===e?[]:e,4))[0],i=void 0===(i=e[1])?100:i,a=void 0===(a=e[2])?10:a,e=void 0===(e=e[3])?0:e,r=We(void 0===r?1:r,.1,1e3),i=We(i,.1,1e3),a=We(a,.1,1e3),e=We(e,.1,1e3),o=Math.sqrt(i/r),i=(a=a/(2*Math.sqrt(i*r)))<1?o*Math.sqrt(1-a*a):0,r=a<1?(a*o-e)/i:-e+o,e=n?n*t/1e3:t,e=a<1?Math.exp(-e*a*o)*(+Math.cos(i*e)+r*Math.sin(i*e)):(1+r*e)*Math.exp(-e*o);return 0===t||1===t?t:1-e}function Pu(t,e){var e=j(e=void 0===e?[]:e,2),n=void 0===(n=e[0])?10:n;return("start"==e[1]?Math.ceil:Math.floor)(We(t,0,1)*n)/n}function Cu(t,e){var n=(e=j(e=void 0===e?[]:e,4))[0],r=e[1],i=e[2],e=e[3];return vu(n,r,i,e)(t)}function Lu(r){return function(t,e,n){return 1-r(1-t,e=void 0===e?[]:e,n)}}function Nu(r){return function(t,e,n){return void 0===e&&(e=[]),t<.5?r(2*t,e,n)/2:1-r(-2*t+2,e,n)/2}}function ju(r){return function(t,e,n){return void 0===e&&(e=[]),t<.5?(1-r(1-2*t,e,n))/2:(r(2*t-1,e,n)+1)/2}}function Ru(t){return t}var Iu=4,Bu=1e-7,Du=10,Fu="function"==typeof Float32Array,zu=function(t,e){return 1-3*e+3*t},Wu=function(t,e){return 3*e-6*t},Gu=function(t){return 3*t},Hu=function(t,e,n){return((zu(e,n)*t+Wu(e,n))*t+Gu(e))*t},Vu=function(t,e,n){return 3*zu(e,n)*t*t+2*Wu(e,n)*t+Gu(e)},So=vu(.42,0,1,1),Yu={steps:Pu,"step-start":function(t){return Pu(t,[1,"start"])},"step-end":function(t){return Pu(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":Cu,ease:function(t){return Cu(t,[.25,.1,.25,1])},in:So,out:Lu(So),"in-out":Nu(So),"out-in":ju(So),"in-quad":bu,"out-quad":Lu(bu),"in-out-quad":Nu(bu),"out-in-quad":ju(bu),"in-cubic":xu,"out-cubic":Lu(xu),"in-out-cubic":Nu(xu),"out-in-cubic":ju(xu),"in-quart":wu,"out-quart":Lu(wu),"in-out-quart":Nu(wu),"out-in-quart":ju(wu),"in-quint":Mu,"out-quint":Lu(Mu),"in-out-quint":Nu(Mu),"out-in-quint":ju(Mu),"in-expo":Ou,"out-expo":Lu(Ou),"in-out-expo":Nu(Ou),"out-in-expo":ju(Ou),"in-sine":ku,"out-sine":Lu(ku),"in-out-sine":Nu(ku),"out-in-sine":ju(ku),"in-circ":Eu,"out-circ":Lu(Eu),"in-out-circ":Nu(Eu),"out-in-circ":ju(Eu),"in-back":Su,"out-back":Lu(Su),"in-out-back":Nu(Su),"out-in-back":ju(Su),"in-bounce":Au,"out-bounce":Lu(Au),"in-out-bounce":Nu(Au),"out-in-bounce":ju(Au),"in-elastic":_u,"out-elastic":Lu(_u),"in-out-elastic":Nu(_u),"out-in-elastic":ju(_u),spring:Tu,"spring-in":Tu,"spring-out":Lu(Tu),"spring-in-out":Nu(Tu),"spring-out-in":ju(Tu)},qu=function(t){return("-"===(t=(t=t).replace(/([A-Z])/g,function(t){return"-".concat(t.toLowerCase())})).charAt(0)?t.substring(1):t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()};function $u(n,r){return function(t){var e;return 1<=t?1:(t+=r*(e=1/n))-t%e}}var Co="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Uu=new RegExp("cubic-bezier\\("+Co+","+Co+","+Co+","+Co+"\\)"),Xu=/steps\(\s*(\d+)\s*\)/,Ku=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Zu(t){var e=Uu.exec(t);return e?vu.apply(void 0,O([],j(e.slice(1).map(Number)),!1)):(e=Xu.exec(t))?$u(Number(e[1]),0):(e=Ku.exec(t))?$u(Number(e[1]),{start:1,middle:.5,end:0}[e[2]]):Yu[qu(t)]||Yu.linear}function Qu(t){return Math.abs((0!==(e=t).duration&&0!==e.iterations?("auto"===e.duration?0:Number(e.duration))*(null!=(e=e.iterations)?e:1):0)/(t.playbackRate||1));var e}var Ju=0,th=1,eh=2,nh=3;function rh(t,e,n){c=t,i=n;var r,i,a,o,s,l=null===(l=e)?Ju:(r=i.endTime,l<Math.min(i.delay,r)?th:l>=Math.min(i.delay+c+i.endDelay,r)?eh:nh),c=function(t,e,n,r,i){switch(r){case th:return"backwards"===e||"both"===e?0:null;case nh:return n-i;case eh:return"forwards"===e||"both"===e?t:null;case Ju:return null}}(t,n.fill,e,l,n.delay);return null===c?null:(i="auto"===n.duration?0:n.duration,r=i,t=l,e=n.iterations,o=c,s=n.iterationStart,0===r?t!==th&&(s+=e):s+=o/r,e=t=s,o=n.iterationStart,s=l,a=n.iterations,c=c,i=i,e=o=0!==(o=e===1/0?o%1:e%1)||s!==eh||0===a||0===c&&0!==i?o:1,s=n.iterations,a=e,c=t,i=l===eh&&s===1/0?1/0:1===a?Math.floor(c)-1:Math.floor(c),o=n.direction,t=i,l=e,a="normal"===(s="normal"!==(s=o)&&"reverse"!==o&&(t=t,"alternate-reverse"===o&&(t+=1),s="normal",t!==1/0)&&t%2!=0?"reverse":s)?l:1-l,n.currentIteration=i,n.progress=a,n.easingFunction(a))}function ih(t,e,n){var a=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r]){var a;ah(i)&&(a={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:Zu(t[r].easing)||e.easingFunction,value:t[r][i]},n[i]=n[i]||[],n[i].push(a))}return n}(t,e),o=function(t,e){var n,r=[];for(n in t)for(var i=t[n],a=0;a<i.length-1;a++){var o=a,s=a+1,l=i[o].computedOffset,c=i[s].computedOffset,u=l,h=c;0===a&&(u=-1/0,0===c)&&(s=o),a===i.length-2&&(h=1/0,1===l)&&(o=s),r.push({applyFrom:u,applyTo:h,startOffset:i[o].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[o].easingFunction,property:n,interpolation:function(t,e,n,r){var i=wo[t];if(i&&i.syntax&&i.int){i=E.styleValueRegistry.getPropertySyntax(i.syntax);if(i){var a,o,s,l=void 0,c=void 0,t=(c=E.enableCSSParsing?(o=E.styleValueRegistry.parseProperty(t,e,r),a=E.styleValueRegistry.parseProperty(t,n,r),l=E.styleValueRegistry.computeProperty(t,o,r),E.styleValueRegistry.computeProperty(t,a,r)):(o=i.parserWithCSSDisabled,l=o?o(e,r):e,o?o(n,r):n),i.mixer(l,c,r));if(t)return s=oh.apply(void 0,O([],j(t),!1)),function(t){return 0===t?e:1===t?n:s(t)}}}return oh(!1,!0,function(t){return t?n:e})}(n,i[o].value,i[s].value,e)})}return r.sort(function(t,e){return t.startOffset-e.startOffset}),r}(a,n);return function(r,i){if(null!==i)o.filter(function(t){return i>=t.applyFrom&&i<t.applyTo}).forEach(function(t){var e=i-t.startOffset,n=t.endOffset-t.startOffset,e=0==n?0:t.easingFunction(e/n);r.setAttribute(t.property,t.interpolation(e))});else for(var t in a)ah(t)&&r.setAttribute(t,null)}}function ah(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var oh=function(e,n,r){return function(t){t=function t(e,n,r){if("number"==typeof e&&"number"==typeof n)return e*(1-r)+n*r;if("boolean"==typeof e&&"boolean"==typeof n||"string"==typeof e&&"string"==typeof n)return r<.5?e:n;if(Array.isArray(e)&&Array.isArray(n)){for(var i=e.length,a=n.length,o=Math.max(i,a),s=[],l=0;l<o;l++)s.push(t(e[l<i?l:i-1],n[l<a?l:a-1],r));return s}throw new Error("Mismatched interpolation arguments "+e+":"+n)}(e,n,t);return!E.enableCSSParsing&&Ge(t)?t:r(t)}};Object.defineProperty(lh.prototype,"easing",{get:function(){return this._easing},set:function(t){this.easingFunction=Zu(t),this._easing=t},enumerable:!1,configurable:!0});var sh=lh;function lh(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Ru,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}function ch(t,i){if(null===t)return[];for(var e=(t=Array.isArray(t)?t:function(t){var e,n=[];for(e in t)if(!(e in["easing","offset","composite"]))for(var r,i=t[e],a=(i=Array.isArray(i)?i:[i]).length,o=0;o<a;o++)n[o]||(r={},"offset"in t&&(r.offset=Number(t.offset)),"easing"in t&&(r.easing=t.easing),"composite"in t&&(r.composite=t.composite),n[o]=r),void 0!==i[o]&&null!==i[o]&&(n[o][e]=i[o]);return n.sort(function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)}),n}(t)).map(function(t){var e,n={};for(e in null!=i&&i.composite&&(n.composite="auto"),t){var r=t[e];if("offset"===e){if(null!==r){if(r=Number(r),!isFinite(r))throw new Error("Keyframe offsets must be numbers.");if(r<0||1<r)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=r}}else if("composite"===e&&-1===["replace","add","accumulate","auto"].indexOf(r))throw new Error("".concat(r," compositing is not supported"));n[e]=r}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==i?void 0:i.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n}),n=!0,r=-1/0,a=0;a<e.length;a++){var o=e[a].offset;if(P(o))n=!1;else{if(o<r)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");r=o}}if(e=e.filter(function(t){return 0<=Number(t.offset)&&Number(t.offset)<=1}),!n)for(var s=e.length,l=(e[s-1].computedOffset=Number(null!=(t=e[s-1].offset)?t:1),1<s&&(e[0].computedOffset=Number(null!=(t=e[0].offset)?t:0)),0),c=Number(e[0].computedOffset),u=1;u<s;u++){var h=e[u].computedOffset;if(!P(h)&&!P(c)){for(var f=1;f<u-l;f++)e[l+f].computedOffset=c+(Number(h)-c)*f/(u-l);l=u,c=Number(h)}}return e}var uh="backwards|forwards|both|none".split("|"),hh="reverse|alternate|alternate-reverse".split("|");function fh(t,e){return t=function(t){"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t});return t}(null!=t?t:{duration:"auto"}),n=t,t=e,r=new sh,t&&(r.fill="both",r.duration="auto"),"number"!=typeof n||isNaN(n)?void 0!==n&&Object.keys(n).forEach(function(t){void 0===n[t]||null===n[t]||"auto"===n[t]||!("number"!=typeof r[t]&&"duration"!==t||"number"==typeof n[t]&&!isNaN(n[t]))||"fill"===t&&-1===uh.indexOf(n[t])||"direction"===t&&-1===hh.indexOf(n[t])||(r[t]=n[t])}):r.duration=n,r;var n,r}ph.prototype.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},ph.prototype.update=function(t){return null!==t&&(this.timeFraction=rh(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},ph.prototype.getKeyframes=function(){return this.normalizedKeyframes},ph.prototype.setKeyframes=function(t){this.normalizedKeyframes=ch(t)},ph.prototype.getComputedTiming=function(){return this.computedTiming},ph.prototype.getTiming=function(){return this.timing},ph.prototype.updateTiming=function(e){var n=this;Object.keys(e||{}).forEach(function(t){n.timing[t]=e[t]})};var dh=ph;function ph(t,e,n){var r=this,t=(this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=fh(n,!1),(this.timing.effect=this).timing.activeDuration=Qu(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=ch(e,this.timing),this.interpolations=ih(this.normalizedKeyframes,this.timing,this.target),E.globalThis.Proxy);this.computedTiming=t?new t(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}function gh(t,e){return Number(t.id)-Number(e.id)}yh.prototype.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},yh.prototype.isTicking=function(){return this.inTick},yh.prototype.play=function(t,e,n){t=new dh(t,e,n),e=new yu(t,this);return this.animations.push(e),this.restartWebAnimationsNextTick(),e.updatePromises(),e.play(),e.updatePromises(),e},yh.prototype.applyDirtiedAnimation=function(t){var e=this;this.inTick||(t.markTarget(),(t=t.targetAnimations()).sort(gh),this.tick(Number(this.currentTime),!1,t.slice())[1].forEach(function(t){t=e.animations.indexOf(t);-1!==t&&e.animations.splice(t,1)}),this.applyPendingEffects())},yh.prototype.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame(function(){}),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},yh.prototype.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},yh.prototype.applyPendingEffects=function(){this.pendingEffects.forEach(function(t){null!=t&&t.applyInterpolations()}),this.pendingEffects=[]},yh.prototype.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter(function(t){return t.updatePromises()})},yh.prototype.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter(function(t){return"finished"!==t.playState&&"idle"!==t.playState})},yh.prototype.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},yh.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},yh.prototype.requestAnimationFrame=function(e){var n=this;return this.rAF(function(t){n.updateAnimationsPromises(),e(t),n.updateAnimationsPromises()})},yh.prototype.tick=function(n,r,t){var i=this,a=(this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=n,this.ticking=!1,[]),o=[],s=[],l=[];return t.forEach(function(t){t.tick(n,r),t._inEffect?(o.push(t.effect),t.markTarget()):(a.push(t.effect),t.unmarkTarget()),t._needsTick&&(i.ticking=!0);var e=t._inEffect||t._needsTick;((t._inTimeline=e)?s:l).push(t)}),(t=this.pendingEffects).push.apply(t,O([],j(a),!1)),(t=this.pendingEffects).push.apply(t,O([],j(o),!1)),this.ticking&&this.requestAnimationFrame(function(){}),this.inTick=!1,[s,l]};Vo=yh;function yh(t){var n=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){n.currentTime=t,n.discardAnimations(),0===n.animations.length?n.timelineTicking=!1:n.requestAnimationFrame(n.webAnimationsNextTick)},this.processRafCallbacks=function(e){var t=n.rafCallbacks;n.rafCallbacks=[],e<Number(n.currentTime)&&(e=Number(n.currentTime)),n.animations.sort(gh),n.animations=n.tick(e,!0,n.animations)[0],t.forEach(function(t){t[1](e)}),n.applyPendingEffects()}}E.EasingFunction=Zu,E.AnimationTimeline=Vo;const mh="main-layer",vh="label-layer",bh="element",xh="view",wh="plot",Mh="component",Oh="label",kh="area";function Eh(t,e){e=e.r;t.arc(e,e,e,0,2*Math.PI,!1)}function Sh(t,e){var n,r,i=e.rx,e=e.ry;t.ellipse?t.ellipse(i,e,i,e,0,0,2*Math.PI,!1):(n=e<i?i:e,r=e<i?1:i/e,e=e<i?e/i:1,t.save(),t.scale(r,e),t.arc(n,n,n,0,2*Math.PI))}function Ah(t,e){var n,r,i=e.x1,a=e.y1,o=e.x2,s=e.y2,l=e.defX,l=void 0===l?0:l,c=e.defY,c=void 0===c?0:c,u=e.markerStart,h=e.markerEnd,f=e.markerStartOffset,e=e.markerEndOffset,d=0,p=0,g=0,y=0,m=0;u&&$l(u)&&f&&(n=o-i,r=s-a,m=Math.atan2(r,n),d=Math.cos(m)*(f||0),p=Math.sin(m)*(f||0)),h&&$l(h)&&e&&(n=i-o,r=a-s,m=Math.atan2(r,n),g=Math.cos(m)*(e||0),y=Math.sin(m)*(e||0)),t.moveTo(i-l+d,a-c+p),t.lineTo(o-l+g,s-c+y)}function _h(t,e){var n,r,i,a,o=e.defX,s=void 0===o?0:o,o=e.defY,l=void 0===o?0:o,o=e.markerStart,c=e.markerEnd,u=e.markerStartOffset,h=e.markerEndOffset,e=e.path,f=e.absolutePath,d=e.segments,p=0,g=0,y=0,m=0,e=0;o&&$l(o)&&u&&(i=(o=j(o.parentNode.getStartTangent(),2))[0],a=o[1],n=i[0]-a[0],r=i[1]-a[1],e=Math.atan2(r,n),p=Math.cos(e)*(u||0),g=Math.sin(e)*(u||0)),c&&$l(c)&&h&&(i=(o=j(c.parentNode.getEndTangent(),2))[0],a=o[1],n=i[0]-a[0],r=i[1]-a[1],e=Math.atan2(r,n),y=Math.cos(e)*(h||0),m=Math.sin(e)*(h||0));for(var v=0;v<f.length;v++){var b=f[v],x=b[0],w=f[v+1],M=0===v&&(0!==p||0!==g),O=(v===f.length-1||w&&("M"===w[0]||"Z"===w[0]))&&0!==y&&0!==m;switch(x){case"M":M?(t.moveTo(b[1]-s+p,b[2]-l+g),t.lineTo(b[1]-s,b[2]-l)):t.moveTo(b[1]-s,b[2]-l);break;case"L":O?t.lineTo(b[1]-s+y,b[2]-l+m):t.lineTo(b[1]-s,b[2]-l);break;case"Q":t.quadraticCurveTo(b[1]-s,b[2]-l,b[3]-s,b[4]-l),O&&t.lineTo(b[3]-s+y,b[4]-l+m);break;case"C":t.bezierCurveTo(b[1]-s,b[2]-l,b[3]-s,b[4]-l,b[5]-s,b[6]-l),O&&t.lineTo(b[5]-s+y,b[6]-l+m);break;case"A":var k,E,S=d[v].arcParams,A=S.cx,_=S.cy,T=S.rx,P=S.ry,C=S.startAngle,L=S.endAngle,N=S.xRotation,S=S.sweepFlag;t.ellipse?t.ellipse(A-s,_-l,T,P,N,C,L,!!(1-S)):(k=P<T?T:P,E=P<T?1:T/P,P=P<T?P/T:1,t.translate(A-s,_-l),t.rotate(N),t.scale(E,P),t.arc(0,0,k,C,L,!!(1-S)),t.scale(1/E,1/P),t.rotate(-N),t.translate(-(A-s),-(_-l))),O&&t.lineTo(b[6]-s+y,b[7]-l+m);break;case"Z":t.closePath()}}}function Th(t,e){var n,r,i=e.defX,a=void 0===i?0:i,i=e.defY,o=void 0===i?0:i,i=e.markerStart,s=e.markerEnd,l=e.markerStartOffset,c=e.markerEndOffset,u=e.points.points,h=u.length,e=u[0][0]-a,f=u[0][1]-o,d=u[h-1][0]-a,p=u[h-1][1]-o,g=0,y=0,m=0,v=0,b=0;i&&$l(i)&&l&&(n=u[1][0]-u[0][0],r=u[1][1]-u[0][1],b=Math.atan2(r,n),g=Math.cos(b)*(l||0),y=Math.sin(b)*(l||0)),s&&$l(s)&&c&&(n=u[h-1][0]-u[0][0],r=u[h-1][1]-u[0][1],b=Math.atan2(r,n),m=Math.cos(b)*(c||0),v=Math.sin(b)*(c||0)),t.moveTo(e+(g||m),f+(y||v));for(var x=1;x<h-1;x++){var w=u[x];t.lineTo(w[0]-a,w[1]-o)}t.lineTo(d,p)}function Ph(t,e){var n,r,i=e.defX,a=void 0===i?0:i,i=e.defY,o=void 0===i?0:i,i=e.markerStart,s=e.markerEnd,l=e.markerStartOffset,c=e.markerEndOffset,u=e.points.points,h=u.length,e=u[0][0]-a,f=u[0][1]-o,d=u[h-1][0]-a,p=u[h-1][1]-o,g=0,y=0,m=0,v=0,b=0;i&&$l(i)&&l&&(n=u[1][0]-u[0][0],r=u[1][1]-u[0][1],b=Math.atan2(r,n),g=Math.cos(b)*(l||0),y=Math.sin(b)*(l||0)),s&&$l(s)&&c&&(n=u[h-2][0]-u[h-1][0],r=u[h-2][1]-u[h-1][1],b=Math.atan2(r,n),m=Math.cos(b)*(c||0),v=Math.sin(b)*(c||0)),t.moveTo(e+g,f+y);for(var x=1;x<h-1;x++){var w=u[x];t.lineTo(w[0]-a,w[1]-o)}t.lineTo(d+m,p+v)}function Ch(t,e){var n,r,i,a,o=e.radius,s=e.width,e=e.height,l=s,c=e;o&&o.some(function(t){return 0!==t})?(n=(s=0<s?1:-1)+(e=0<e?1:-1)==0,r=(o=j(o.map(function(t){return We(t,0,Math.min(Math.abs(l)/2,Math.abs(c)/2))}),4))[0],i=o[1],a=o[2],o=o[3],t.moveTo(s*r,0),t.lineTo(l-s*i,0),0!==i&&t.arc(l-s*i,e*i,i,-e*Math.PI/2,0<s?0:Math.PI,n),t.lineTo(l,c-e*a),0!==a&&t.arc(l-s*a,c-e*a,a,0<s?0:Math.PI,0<e?Math.PI/2:1.5*Math.PI,n),t.lineTo(s*o,c),0!==o&&t.arc(s*o,c-e*o,o,0<e?Math.PI/2:-Math.PI/2,0<s?Math.PI:0,n),t.lineTo(0,e*r),0!==r&&t.arc(s*r,e*r,r,0<s?Math.PI:0,0<e?1.5*Math.PI:Math.PI/2,n)):t.rect(0,0,l,c)}t(jh,Lh=e),jh.prototype.init=function(){(t={})[k.CIRCLE]=Eh,t[k.ELLIPSE]=Sh,t[k.RECT]=Ch,t[k.LINE]=Ah,t[k.POLYLINE]=Ph,t[k.POLYGON]=Th,t[k.PATH]=_h,t[k.TEXT]=void 0,t[k.GROUP]=void 0,t[k.IMAGE]=void 0,t[k.HTML]=void 0,t[k.MESH]=void 0;var t;this.context.pathGeneratorFactory=t},jh.prototype.destroy=function(){delete this.context.pathGeneratorFactory};var Lh,Nh=jh;function jh(){var t=null!==Lh&&Lh.apply(this,arguments)||this;return t.name="canvas-path-generator",t}var Rh=v(),Ih=v(),Bh=v(),Dh=Z(),Fh=(zh.prototype.apply=function(t,e){var n=this,r=t.renderingService,i=t.renderingContext,a=(this.context=t,this.runtime=e,null==(t=i.root)?void 0:t.ownerDocument);r.hooks.pick.tapPromise(zh.tag,function(e){return X(n,void 0,void 0,function(){return R(this,function(t){return[2,this.pick(a,e)]})})}),r.hooks.pickSync.tap(zh.tag,function(t){return n.pick(a,t)})},zh.prototype.pick=function(t,e){var n,r,i=e.topmost,a=(o=e.position).x,o=o.y,s=Nt(Rh,a,o,0),a=t.elementsFromBBox(s[0],s[1],s[0],s[1]),l=[];try{for(var c=I(a),u=c.next();!u.done;u=c.next()){var h=u.value,f=h.getWorldTransform();if(this.isHit(h,s,f,!1)){var d=hs(h);if(d){var p=d.parsedStyle.clipPath;if(this.isHit(p,s,p.getWorldTransform(),!0)){if(i)return e.picked=[h],e;l.push(h)}}else{if(i)return e.picked=[h],e;l.push(h)}}}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return e.picked=l,e},zh.tag="CanvasPicker",zh);function zh(){var o=this;this.isHit=function(t,e,n,r){var i=o.context.pointInPathPickerFactory[t.nodeName];if(i){var n=rt(Dh,n),e=Wt(Ih,Nt(Bh,e[0],e[1],0),n),n=t.getGeometryBounds().halfExtents,a=t.parsedStyle.anchor;if(e[0]+=(a&&a[0]||0)*n[0]*2,e[1]+=(a&&a[1]||0)*n[1]*2,i(t,new Ir(e[0],e[1]),r,o.isPointInPath,o.context,o.runtime))return!0}return!1},this.isPointInPath=function(t,e){var n=o.runtime.offscreenCanvasCreator.getOrCreateContext(o.context.config.offscreenCanvas),r=o.context.pathGeneratorFactory[t.nodeName];return r&&(n.beginPath(),r(n,t.parsedStyle),n.closePath()),n.isPointInPath(e.x,e.y)}}function Wh(t,e,n){var t=t.parsedStyle,r=t.r,i=t.fill,a=t.stroke,o=t.lineWidth,s=t.increasedLineWidthForHitTesting,t=t.pointerEvents,o=((o||0)+(s||0))/2,s=jn(r,r,e.x,e.y),e=j(gs(t,i,a),2),t=e[0],i=e[1];return t&&i||n?s<=r+o:t?s<=r:!!i&&r-o<=s&&s<=r+o}function Gh(t,e,n,r){return t/(n*n)+e/(r*r)}function Hh(t,e,n){var t=t.parsedStyle,r=t.rx,i=t.ry,a=t.fill,o=t.stroke,s=t.lineWidth,l=t.increasedLineWidthForHitTesting,t=t.pointerEvents,c=e.x,e=e.y,t=j(gs(t,a,o),2),a=t[0],o=t[1],t=((s||0)+(l||0))/2,s=(c-r)*(c-r),l=(e-i)*(e-i);return a&&o||n?Gh(s,l,r+t,i+t)<=1:a?Gh(s,l,r,i)<=1:!!o&&1<=Gh(s,l,r-t,i-t)&&Gh(s,l,r+t,i+t)<=1}function Vh(t,e,n,r,i,a){return t<=i&&i<=t+n&&e<=a&&a<=e+r}function Yh(t,e,n,r,i,a,o,s){var l=(Math.atan2(s-e,o-t)+2*Math.PI)%(2*Math.PI),t={x:t+n*Math.cos(l),y:e+n*Math.sin(l)};return jn(t.x,t.y,o,s)<=a/2}function qh(t,e,n,r,i,a,o){var s=Math.min(t,n),l=Math.max(t,n),c=Math.min(e,r),u=Math.max(e,r),h=i/2;return s-h<=a&&a<=l+h&&c-h<=o&&o<=u+h&&zn(t,e,n,r,a,o)<=i/2}function $h(t,e,n,r,i){var a=t.length;if(!(a<2)){for(var o=0;o<a-1;o++)if(qh(t[o][0],t[o][1],t[o+1][0],t[o+1][1],e,n,r))return!0;if(i){var i=t[0],s=t[a-1];if(qh(i[0],i[1],s[0],s[1],e,n,r))return!0}}return!1}var Uh=1e-6;function Xh(t){return Math.abs(t)<Uh?0:t<0?-1:1}function Kh(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var a,o,s,l=0;l<i;l++){var c=t[l],u=t[(l+1)%i];if(o=u,((s=[e,n])[0]-(a=c)[0])*(o[1]-a[1])==(o[0]-a[0])*(s[1]-a[1])&&Math.min(a[0],o[0])<=s[0]&&s[0]<=Math.max(a[0],o[0])&&Math.min(a[1],o[1])<=s[1]&&s[1]<=Math.max(a[1],o[1]))return!0;0<Xh(c[1]-n)!=0<Xh(u[1]-n)&&Xh(e-(n-c[1])*(c[0]-u[0])/(c[1]-u[1])-c[0])<0&&(r=!r)}return r}function Zh(t,e,n){for(var r=!1,i=0;i<t.length&&!(r=Kh(t[i],e,n));i++);return r}function Qh(t,e,n){var t=t.parsedStyle,r=t.x1,i=t.y1,a=t.x2,o=t.y2,s=t.lineWidth,l=t.increasedLineWidthForHitTesting,c=t.defX,c=void 0===c?0:c,u=t.defY,u=void 0===u?0:u;return!(!j(gs(t.pointerEvents,t.fill,t.stroke),2)[1]&&!n||!s)&&qh(r,i,a,o,(s||0)+(l||0),e.x+c,e.y+u)}function Jh(t,e,n,r,i,a){var o=t.parsedStyle,s=o.lineWidth,l=o.increasedLineWidthForHitTesting,c=o.stroke,u=o.fill,h=o.defX,h=void 0===h?0:h,f=o.defY,f=void 0===f?0:f,d=o.path,o=o.pointerEvents,p=d.segments,g=d.hasArc,y=d.polylines,d=d.polygons,o=j(gs(o,(null==d?void 0:d.length)&&u,c),2),u=o[0],c=o[1],o=ja(t),m=!1;return u||n?g?r(t,e):Zh(d,e.x+h,e.y+f)||Zh(y,e.x+h,e.y+f):c||n?function(t,e,n,r,i){for(var a=!1,o=e/2,s=0;s<t.length;s++){var l=t[s],c=l.currentPoint,u=l.params,h=l.prePoint,f=l.box;if(!f||Vh(f.x-o,f.y-o,f.width+e,f.height+e,n,r))switch(l.command){case"L":case"Z":if(a=qh(h[0],h[1],c[0],c[1],e,n,r))return!0;break;case"Q":if(a=$n(h[0],h[1],u[1],u[2],u[3],u[4],n,r)<=e/2)return!0;break;case"C":if(a=Hn(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],n,r,i)<=e/2)return!0;break;case"A":l.cubicParams||(l.cubicParams=ye(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var d=l.cubicParams,p=h,g=0;g<d.length;g+=6){var y=Hn(p[0],p[1],d[g],d[g+1],d[g+2],d[g+3],d[g+4],d[g+5],n,r,i),p=[d[g+4],d[g+5]];if(a=y<=e/2)return!0}}}return a}(p,(s||0)+(l||0),e.x+h,e.y+f,o):m}function tf(t,e,n){var t=t.parsedStyle,r=t.stroke,i=t.fill,a=t.lineWidth,o=t.increasedLineWidthForHitTesting,s=t.points,l=t.defX,l=void 0===l?0:l,c=t.defY,c=void 0===c?0:c,t=j(gs(t.pointerEvents,i,r),2),i=t[0],r=!1;return r=(r=t[1]||n?$h(s.points,(a||0)+(o||0),e.x+l,e.y+c,!0):r)||!i&&!n?r:Kh(s.points,e.x+l,e.y+c)}function ef(t,e,n){var t=t.parsedStyle,r=t.lineWidth,i=t.increasedLineWidthForHitTesting,a=t.points,o=t.defX,o=void 0===o?0:o,s=t.defY,s=void 0===s?0:s;return!(!j(gs(t.pointerEvents,t.fill,t.stroke),2)[1]&&!n||!r)&&$h(a.points,(r||0)+(i||0),e.x+o,e.y+s,!1)}function nf(t,e,n,r,i){var a,o,s,l,c,u,h,f,d,p=t.parsedStyle,g=p.radius,y=p.fill,m=p.stroke,v=p.lineWidth,b=p.increasedLineWidthForHitTesting,x=p.width,w=p.height,p=j(gs(p.pointerEvents,y,m),2),y=p[0],m=p[1],p=(v||0)+(b||0);return g&&g.some(function(t){return 0!==t})?(v=!1,(m||n)&&(h=b=0,l=x,u=w,g=g.map(function(t){return We(t,0,Math.min(Math.abs(x)/2,Math.abs(w)/2))}),d=p,a=e.x,o=e.y,g=j(g,4),f=g[0],s=g[1],c=g[2],g=g[3],v=qh(b+f,h,b+l-s,h,d,a,o)||qh(b+l,h+s,b+l,h+u-c,d,a,o)||qh(b+l-c,h+u,b+g,h+u,d,a,o)||qh(b,h+u-g,b,h+f,d,a,o)||Yh(b+l-s,h+s,s,Math.PI,Math.PI,d,a,o)||Yh(b+l-c,h+u-c,c,0,Math.PI,d,a,o)||Yh(b+g,h+u-g,g,Math.PI,Math.PI,d,a,o)||Yh(b+f,h+f,f,Math.PI,Math.PI,d,a,o)),v||!y&&!n?v:r(t,e)):(s=p/2,y&&m||n?Vh(0-s,0-s,x+s,w+s,e.x,e.y):y?Vh(0,0,x,w,e.x,e.y):!!m&&(c=l=0,u=x,g=w,b=p,h=e.x,f=e.y,Vh(l-(d=b/2),c-d,u,b,h,f)||Vh(l+u-d,c-d,b,g,h,f)||Vh(l+d,c+g-d,u,b,h,f)||Vh(l-d,c+d,b,g,h,f)))}function rf(t,e,n,r,i,a){var o,s=t.parsedStyle,l=s.pointerEvents,c=s.width,s=s.height;return"non-transparent-pixel"!==l||(l=i.config.offscreenCanvas,o=a.offscreenCanvasCreator.getOrCreateCanvas(l),a=a.offscreenCanvasCreator.getOrCreateContext(l,{willReadFrequently:!0}),o.width=c,o.height=s,i.defaultStyleRendererFactory[k.IMAGE].render(a,t.parsedStyle,t,void 0,void 0,void 0),a.getImageData(e.x,e.y,1,1).data.every(function(t){return 0!==t}))}t(sf,af=e),sf.prototype.init=function(){(t={})[k.CIRCLE]=Wh,t[k.ELLIPSE]=Hh,t[k.RECT]=nf,t[k.LINE]=Qh,t[k.POLYLINE]=ef,t[k.POLYGON]=tf,t[k.PATH]=Jh,t[k.TEXT]=function(){return!0},t[k.GROUP]=null,t[k.IMAGE]=rf,t[k.HTML]=null,t[k.MESH]=null;var t;this.context.pointInPathPickerFactory=t,this.addRenderingPlugin(new Fh)},sf.prototype.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()};var af,of=sf;function sf(){var t=null!==af&&af.apply(this,arguments)||this;return t.name="canvas-picker",t}cf.prototype.apply=function(t,c){function i(t){(t=t.target.rBushNode).aabb&&u.removedRBushNodeAABBs.push(t.aabb)}function a(t){(t=t.target.rBushNode).aabb&&u.removedRBushNodeAABBs.push(t.aabb)}var u=this,h=(this.context=t).config,f=t.camera,l=t.renderingService,d=t.renderingContext,e=t.rBushRoot,n=t.pathGeneratorFactory,p=(this.rBush=e,this.pathGeneratorFactory=n,t.contextService),g=d.root.ownerDocument.defaultView,y=(l.hooks.init.tap(cf.tag,function(){g.addEventListener(b.UNMOUNTED,i),g.addEventListener(b.CULLED,a);var t=p.getDPR(),e=h.width,n=h.height,r=p.getContext();u.clearRect(r,0,0,e*t,n*t,h.background)}),l.hooks.destroy.tap(cf.tag,function(){g.removeEventListener(b.UNMOUNTED,i),g.removeEventListener(b.CULLED,a),u.renderQueue=[],u.removedRBushNodeAABBs=[],u.restoreStack=[]}),l.hooks.beginFrame.tap(cf.tag,function(){var t=p.getContext(),e=p.getDPR(),n=h.width,r=h.height,i=(a=u.canvasRendererPluginOptions).dirtyObjectNumThreshold,a=a.dirtyObjectRatioThreshold,o=(s=l.getStats()).total,s=s.rendered,o=s/o;u.clearFullScreen=l.disableDirtyRectangleRendering()||i<s&&a<o,t&&(t.resetTransform?t.resetTransform():t.setTransform(1,0,0,1,0,0),u.clearFullScreen)&&u.clearRect(t,0,0,n*e,r*e,h.background)}),function(t,e){t.isVisible()&&!t.isCulled()&&(u.renderDisplayObject(t,e,u.context,u.restoreStack,c),u.saveDirtyAABB(t)),(t.sortable.sorted||t.childNodes).forEach(function(t){y(t,e)})});l.hooks.endFrame.tap(cf.tag,function(){var e=p.getContext(),t=p.getDPR();if(gt(u.dprMatrix,[t,t,1]),ct(u.vpMatrix,u.dprMatrix,f.getOrthoMatrix()),u.clearFullScreen)y(d.root,e);else{t=u.safeMergeAABB.apply(u,O([u.mergeDirtyAABBs(u.renderQueue)],j(u.removedRBushNodeAABBs.map(function(t){var e=t.minX,n=t.minY,r=t.maxX,t=t.maxY,i=new Tr;return i.setMinMax([e,n,0],[r,t,0]),i})),!1));if(u.removedRBushNodeAABBs=[],Tr.isEmpty(t))return void(u.renderQueue=[]);var n=u.convertAABB2Rect(t),r=n.x,i=n.y,a=n.width,n=n.height,o=Wt(u.vec3a,[r,i,0],u.vpMatrix),s=Wt(u.vec3b,[r+a,i,0],u.vpMatrix),l=Wt(u.vec3c,[r,i+n,0],u.vpMatrix),r=Wt(u.vec3d,[r+a,i+n,0],u.vpMatrix),a=Math.min(o[0],s[0],r[0],l[0]),i=Math.min(o[1],s[1],r[1],l[1]),n=Math.max(o[0],s[0],r[0],l[0]),o=Math.max(o[1],s[1],r[1],l[1]),s=Math.floor(a),r=Math.floor(i),l=Math.ceil(n-a),n=Math.ceil(o-i);e.save(),u.clearRect(e,s,r,l,n,h.background),e.beginPath(),e.rect(s,r,l,n),e.clip(),e.setTransform(u.vpMatrix[0],u.vpMatrix[1],u.vpMatrix[4],u.vpMatrix[5],u.vpMatrix[12],u.vpMatrix[13]),h.renderer.getConfig().enableDirtyRectangleRenderingDebug&&g.dispatchEvent(new gl(Qc.DIRTY_RECTANGLE,{dirtyRect:{x:s,y:r,width:l,height:n}})),u.searchDirtyObjects(t).sort(function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder}).forEach(function(t){t&&t.isVisible()&&!t.isCulled()&&u.renderDisplayObject(t,e,u.context,u.restoreStack,c)}),e.restore(),u.renderQueue.forEach(function(t){u.saveDirtyAABB(t)}),u.renderQueue=[]}u.restoreStack.forEach(function(){e.restore()}),u.restoreStack=[]}),l.hooks.render.tap(cf.tag,function(t){u.clearFullScreen||u.renderQueue.push(t)})},cf.prototype.clearRect=function(t,e,n,r,i,a){t.clearRect(e,n,r,i),a&&(t.fillStyle=a,t.fillRect(e,n,r,i))},cf.prototype.renderDisplayObject=function(t,e,n,r,i){var a,o=t.nodeName,s=r[r.length-1],s=(!s||t.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_CONTAINS||(e.restore(),r.pop()),this.context.styleRendererFactory[o]),o=this.pathGeneratorFactory[o],l=t.parsedStyle.clipPath;l&&(this.applyWorldTransform(e,l),a=this.pathGeneratorFactory[l.nodeName])&&(e.save(),r.push(t),e.beginPath(),a(e,l.parsedStyle),e.closePath(),e.clip()),s&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),o&&(e.beginPath(),o(e,t.parsedStyle),t.nodeName!==k.LINE)&&t.nodeName!==k.PATH&&t.nodeName!==k.POLYLINE&&e.closePath(),s&&(s.render(e,t.parsedStyle,t,n,this,i),e.restore()),t.renderable.dirty=!1},cf.prototype.convertAABB2Rect=function(t){var e=t.getMin(),t=t.getMax(),n=Math.floor(e[0]),e=Math.floor(e[1]);return{x:n,y:e,width:Math.ceil(t[0])-n,height:Math.ceil(t[1])-e}},cf.prototype.mergeDirtyAABBs=function(t){var n=new Tr;return t.forEach(function(t){var e=t.getRenderBounds(),e=(n.add(e),t.renderable.dirtyRenderBounds);e&&n.add(e)}),n},cf.prototype.searchDirtyObjects=function(t){var e=(n=j(t.getMin(),2))[0],n=n[1],r=(t=j(t.getMax(),2))[0],t=t[1];return this.rBush.search({minX:e,minY:n,maxX:r,maxY:t}).map(function(t){return t.displayObject})},cf.prototype.saveDirtyAABB=function(t){var e=t.renderable,t=(e.dirtyRenderBounds||(e.dirtyRenderBounds=new Tr),t.getRenderBounds());t&&e.dirtyRenderBounds.update(t.center,t.halfExtents)},cf.prototype.applyAttributesToContext=function(t,e){var n=(o=e.parsedStyle).stroke,r=o.fill,i=o.opacity,a=o.lineDash,o=o.lineDashOffset;a&&t.setLineDash(a),P(o)||(t.lineDashOffset=o),P(i)||(t.globalAlpha*=i),P(n)||Array.isArray(n)||n.isNone||(t.strokeStyle=e.attributes.stroke),P(r)||Array.isArray(r)||r.isNone||(t.fillStyle=e.attributes.fill)},cf.prototype.applyWorldTransform=function(t,e,n){var r=0,i=0,a=(e.parsedStyle||{}).anchor,o=a&&a[0]||0,a=a&&a[1]||0;0===o&&0===a||(r=-o*((o=e.geometry.contentBounds)&&2*o.halfExtents[0]||0),i=-a*(o&&2*o.halfExtents[1]||0)),n?(J(this.tmpMat4,e.getLocalTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,ut(this.tmpMat4,this.tmpMat4,this.vec3a),ct(this.tmpMat4,n,this.tmpMat4)):(J(this.tmpMat4,e.getWorldTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,ut(this.tmpMat4,this.tmpMat4,this.vec3a)),ct(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])},cf.prototype.safeMergeAABB=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=new Tr;return t.forEach(function(t){n.add(t)}),n},cf.tag="CanvasRenderer";var lf=cf;function cf(t){this.canvasRendererPluginOptions=t,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.vpMatrix=Z(),this.dprMatrix=Z(),this.tmpMat4=Z(),this.vec3a=v(),this.vec3b=v(),this.vec3c=v(),this.vec3d=v()}hf.prototype.render=function(t,e,n,r,i,a){var o=e.fill,s=e.fillRule,l=e.opacity,c=e.fillOpacity,u=e.stroke,h=e.strokeOpacity,f=e.lineWidth,d=e.lineCap,p=e.lineJoin,g=e.shadowType,y=e.shadowColor,m=e.shadowBlur,v=e.filter,e=e.miterLimit,b=!P(o)&&!o.isNone,x=!P(u)&&!u.isNone&&0<f,w=0===o.alpha,v=!(!v||!v.length),y=!P(y)&&0<m,m=n.nodeName,g="inner"===g,m=x&&y&&(m===k.PATH||m===k.LINE||m===k.POLYLINE||w||g);b&&(t.globalAlpha=l*c,m||ff(n,t,y),this.fill(t,n,o,s,r,i,a),m||this.clearShadowAndFilter(t,v,y)),x&&(t.globalAlpha=l*h,t.lineWidth=f,P(e)||(t.miterLimit=e),P(d)||(t.lineCap=d),P(p)||(t.lineJoin=p),m&&(g&&(t.globalCompositeOperation="source-atop"),ff(n,t,!0),g)&&(this.stroke(t,n,u,r,i,a),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,v,!0)),this.stroke(t,n,u,r,i,a))},hf.prototype.clearShadowAndFilter=function(t,e,n){n&&(t.shadowColor="transparent",t.shadowBlur=0),e&&(n=t.filter,!P(n))&&-1<n.indexOf("drop-shadow")&&(t.filter=n.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")},hf.prototype.fill=function(e,n,t,r,i,a,o){var s=this;Array.isArray(t)?t.forEach(function(t){e.fillStyle=s.getColor(t,n,e),r?e.fill(r):e.fill()}):(ga(t)&&(e.fillStyle=this.getPattern(t,n,e,i,a,o)),r?e.fill(r):e.fill())},hf.prototype.stroke=function(e,n,t,r,i,a){var o=this;Array.isArray(t)?t.forEach(function(t){e.strokeStyle=o.getColor(t,n,e),e.stroke()}):(ga(t)&&(e.strokeStyle=this.getPattern(t,n,e,r,i,a)),e.stroke())},hf.prototype.getPattern=function(t,e,n,r,i,a){var o,s,l,c,u,h,f;return"rect"===t.image.nodeName&&(o=(s=t.image.parsedStyle).width,s=s.height,l=r.contextService.getDPR(),c=r.config.offscreenCanvas,(u=a.offscreenCanvasCreator.getOrCreateCanvas(c)).width=o*l,u.height=s*l,h=a.offscreenCanvasCreator.getOrCreateContext(c),f=[],t.image.forEach(function(t){i.renderDisplayObject(t,h,r,f,a)}),f.forEach(function(){h.restore()})),this.imagePool.getOrCreatePatternSync(t,n,u,l,function(){e.renderable.dirty=!0,r.renderingService.dirtify()})},hf.prototype.getColor=function(t,e,n){var r;return t.type!==ri.LinearGradient&&t.type!==ri.RadialGradient||(r=(e=e.getGeometryBounds())&&2*e.halfExtents[0]||1,e=e&&2*e.halfExtents[1]||1,r=this.imagePool.getOrCreateGradient(m(m({type:t.type},t.value),{width:r,height:e}),n)),r};var uf=hf;function hf(t){this.imagePool=t}function ff(t,e,n){var r=t.parsedStyle,i=r.filter,a=r.shadowColor,o=r.shadowBlur,s=r.shadowOffsetX,r=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=a.toString(),e.shadowBlur=o||0,e.shadowOffsetX=s||0,e.shadowOffsetY=r||0)}pf.prototype.render=function(t,e,n){var r=e.width,i=e.height,a=e.img,o=e.shadowColor,e=e.shadowBlur,a=ze(a)?this.imagePool.getImageSync(a):(r=r||a.width,i=i||a.height,a);if(a){ff(n,t,!P(o)&&0<e);try{t.drawImage(a,0,0,r,i)}catch(t){}}};var df=pf;function pf(t){this.imagePool=t}Of.prototype.render=function(t,e,n,r,i,a){var o=e.lineWidth,s=e.textAlign,l=e.textBaseline,c=e.lineJoin,u=e.miterLimit,h=e.letterSpacing,f=e.stroke,d=e.fill,p=e.fillOpacity,g=e.strokeOpacity,y=e.opacity,m=e.metrics,v=e.dx,b=e.dy,x=e.shadowColor,e=e.shadowBlur,w=m.font,M=m.lines,O=m.height,k=m.lineHeight,E=m.lineMetrics,m=(t.font=w,t.lineWidth=o,t.textAlign="middle"===s?"center":s,l),S=(a.enableCSSParsing||"alphabetic"!==m||(m="bottom"),t.lineJoin=c,P(u)||(t.miterLimit=u),0),A=("middle"===l?S=-O/2-k/2:"bottom"===l||"alphabetic"===l||"ideographic"===l?S=-O:"top"!==l&&"hanging"!==l||(S=-k),v||0),w=(S+=b||0,1===M.length&&("bottom"===m?(m="middle",S-=.5*O):"top"===m&&(m="middle",S+=.5*O)),t.textBaseline=m,!P(x)&&0<e);ff(n,t,w);for(var _=0;_<M.length;_++){var T=o/2+A;S+=k,P(f)||f.isNone||!o||this.drawLetterSpacing(t,M[_],E[_],s,T,S,h,p,g,y,!0),P(d)||this.drawLetterSpacing(t,M[_],E[_],s,T,S,h,p,g,y)}},Of.prototype.drawLetterSpacing=function(t,e,n,r,i,a,o,s,l,c,u){if(void 0===u&&(u=!1),0===o)u?this.strokeText(t,e,i,a,l):this.fillText(t,e,i,a,s,c);else{for(var h=t.textAlign,f=(t.textAlign="left",i),d=("center"===r||"middle"===r?f=i-n.width/2:"right"!==r&&"end"!==r||(f=i-n.width),Array.from(e)),p=t.measureText(e).width,g=0;g<d.length;++g){var y=d[g];u?this.strokeText(t,y,f,a,l):this.fillText(t,y,f,a,s,c),f+=p-(y=t.measureText(e.substring(g+1)).width)+o,p=y}t.textAlign=h}},Of.prototype.fillText=function(t,e,n,r,i,a){var o,s=!P(i)&&1!==i;s&&(o=t.globalAlpha,t.globalAlpha=i*a),t.fillText(e,n,r),s&&(t.globalAlpha=o)},Of.prototype.strokeText=function(t,e,n,r,i){var a,o=!P(i)&&1!==i;o&&(a=t.globalAlpha,t.globalAlpha=i),t.strokeText(e,n,r),o&&(t.globalAlpha=a)};var gf,yf,mf,vf,bf,xf,wf,Mf=Of;function Of(){}function kf(){return null!==gf&&gf.apply(this,arguments)||this}function Ef(){return null!==yf&&yf.apply(this,arguments)||this}function Sf(){return null!==mf&&mf.apply(this,arguments)||this}function Af(){return null!==vf&&vf.apply(this,arguments)||this}function _f(){return null!==bf&&bf.apply(this,arguments)||this}function Tf(){return null!==xf&&xf.apply(this,arguments)||this}function Pf(){return null!==wf&&wf.apply(this,arguments)||this}t(kf,gf=uf),t(Ef,yf=uf),t(Sf,mf=uf),t(Af,vf=uf),t(_f,bf=uf),t(Tf,xf=uf),t(Pf,wf=uf);t(Nf,Cf=e),Nf.prototype.init=function(){var t,e=m({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,r=new uf(n),n=((t={})[k.CIRCLE]=r,t[k.ELLIPSE]=r,t[k.RECT]=r,t[k.IMAGE]=new df(n),t[k.TEXT]=new Mf,t[k.LINE]=r,t[k.POLYLINE]=r,t[k.POLYGON]=r,t[k.PATH]=r,t[k.GROUP]=void 0,t[k.HTML]=void 0,t[k.MESH]=void 0,t);this.context.defaultStyleRendererFactory=n,this.context.styleRendererFactory=n,this.addRenderingPlugin(new lf(e))},Nf.prototype.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory};var Cf,Lf=Nf;function Nf(t){void 0===t&&(t={});var e=Cf.call(this)||this;return e.options=t,e.name="canvas-renderer",e}Rf.prototype.apply=function(t,r){function i(t){e.hooks.pointerWheel.call(t)}function a(t){e.hooks.click.call(t)}var o=this,e=t.renderingService,n=t.renderingContext,s=t.config,l=(this.context=t,n.root.ownerDocument.defaultView),c=function(t){e.hooks.pointerMove.call(t)},u=function(t){e.hooks.pointerUp.call(t)},h=function(t){e.hooks.pointerDown.call(t)},f=function(t){e.hooks.pointerOver.call(t)},d=function(t){e.hooks.pointerOut.call(t)},p=function(t){e.hooks.pointerCancel.call(t)};e.hooks.init.tap(Rf.tag,function(){var t,e,n=o.context.contextService.getDomElement();r.globalThis.navigator.msPointerEnabled?(n.style.msContentZooming="none",n.style.msTouchAction="none"):l.supportsPointerEvents&&(n.style.touchAction="none"),l.supportsPointerEvents?(t=n,r.globalThis.document.addEventListener("pointermove",c,!0),t.addEventListener("pointerdown",h,!0),t.addEventListener("pointerleave",d,!0),t.addEventListener("pointerover",f,!0),r.globalThis.addEventListener("pointerup",u,!0),r.globalThis.addEventListener("pointercancel",p,!0)):(t=n,r.globalThis.document.addEventListener("mousemove",c,!0),t.addEventListener("mousedown",h,!0),t.addEventListener("mouseout",d,!0),t.addEventListener("mouseover",f,!0),r.globalThis.addEventListener("mouseup",u,!0)),l.supportsTouchEvents&&((e=n).addEventListener("touchstart",h,!0),e.addEventListener("touchend",u,!0),e.addEventListener("touchmove",c,!0),e.addEventListener("touchcancel",p,!0)),s.useNativeClickEvent&&n.addEventListener("click",a,!0),n.addEventListener("wheel",i,{passive:!0,capture:!0})}),e.hooks.destroy.tap(Rf.tag,function(){var t,e,n=o.context.contextService.getDomElement();r.globalThis.navigator.msPointerEnabled?(n.style.msContentZooming="",n.style.msTouchAction=""):l.supportsPointerEvents&&(n.style.touchAction=""),l.supportsPointerEvents?(t=n,r.globalThis.document.removeEventListener("pointermove",c,!0),t.removeEventListener("pointerdown",h,!0),t.removeEventListener("pointerleave",d,!0),t.removeEventListener("pointerover",f,!0),r.globalThis.removeEventListener("pointerup",u,!0)):(t=n,r.globalThis.document.removeEventListener("mousemove",c,!0),t.removeEventListener("mousedown",h,!0),t.removeEventListener("mouseout",d,!0),t.removeEventListener("mouseover",f,!0),r.globalThis.removeEventListener("mouseup",u,!0)),l.supportsTouchEvents&&((e=n).removeEventListener("touchstart",h,!0),e.removeEventListener("touchend",u,!0),e.removeEventListener("touchmove",c,!0),e.removeEventListener("touchcancel",p,!0)),s.useNativeClickEvent&&n.removeEventListener("click",a,!0),n.removeEventListener("wheel",i,!0)})},Rf.tag="DOMInteraction";var jf=Rf;function Rf(){}t(Df,If=e),Df.prototype.init=function(){this.addRenderingPlugin(new jf)},Df.prototype.destroy=function(){this.removeAllRenderingPlugins()};var If,Bf=Df;function Df(){var t=null!==If&&If.apply(this,arguments)||this;return t.name="dom-interaction",t}zf.prototype.joinTransformMatrix=function(t){return"matrix(".concat([t[0],t[1],t[4],t[5],t[12],t[13]].join(","),")")},zf.prototype.apply=function(t,i){function a(t,e){e.style.transform=l.joinTransformMatrix(t.getWorldTransform())}function e(t){var e,n,r=t.target;r.nodeName===k.HTML&&(l.$camera||(l.$camera=l.createCamera(c)),e=l.getOrCreateEl(r),l.$camera.appendChild(e),i.enableCSSParsing&&(n=r.ownerDocument.documentElement.attributes,Object.keys(n).forEach(function(t){e.style[t]=n[t]})),Object.keys(r.attributes).forEach(function(t){l.updateAttribute(t,r)}),a(r,e),l.context.nativeHTMLMap.set(e,r))}function n(t){(t=t.target).nodeName===k.HTML&&l.$camera&&(t=l.getOrCreateEl(t))&&(t.remove(),l.context.nativeHTMLMap.delete(t))}function r(t){var e=t.target;e.nodeName===k.HTML&&(t=t.attrName,l.updateAttribute(t,e))}function o(t){var e;(t=t.target).nodeName===k.HTML&&(e=l.getOrCreateEl(t),a(t,e))}function s(){var t,e;l.$camera&&(t=(e=l.context.config).width,e=e.height,l.$camera.style.width="".concat(t||0,"px"),l.$camera.style.height="".concat(e||0,"px"))}var l=this,c=t.camera,u=t.renderingContext,h=t.renderingService,f=(this.context=t,u.root.ownerDocument.defaultView);h.hooks.init.tap(zf.tag,function(){f.addEventListener(Qc.RESIZE,s),f.addEventListener(b.MOUNTED,e),f.addEventListener(b.UNMOUNTED,n),f.addEventListener(b.ATTR_MODIFIED,r),f.addEventListener(b.BOUNDS_CHANGED,o)}),h.hooks.endFrame.tap(zf.tag,function(){l.$camera&&u.renderReasons.has(Ml.CAMERA_CHANGED)&&(l.$camera.style.transform=l.joinTransformMatrix(c.getOrthoMatrix()))}),h.hooks.destroy.tap(zf.tag,function(){l.$camera&&l.$camera.remove(),f.removeEventListener(Qc.RESIZE,s),f.removeEventListener(b.MOUNTED,e),f.removeEventListener(b.UNMOUNTED,n),f.removeEventListener(b.ATTR_MODIFIED,r),f.removeEventListener(b.BOUNDS_CHANGED,o)})},zf.prototype.createCamera=function(t){var e,n,r=(a=this.context.config).document,i=a.width,a=a.height,o=this.context.contextService.getDomElement(),s=o.parentNode;return s?((n=s.querySelector("#"+(e="g-canvas-camera")))||((n=r=(r||document).createElement("div")).id=e,r.style.position="absolute",r.style.left="".concat(o.offsetLeft||0,"px"),r.style.top="".concat(o.offsetTop||0,"px"),r.style.transformOrigin="left top",r.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),r.style.overflow="hidden",r.style.pointerEvents="none",r.style.width="".concat(i||0,"px"),r.style.height="".concat(a||0,"px"),s.appendChild(r)),n):null},zf.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},zf.prototype.updateAttribute=function(t,e){var n=this.getOrCreateEl(e);switch(t){case"innerHTML":var r=e.parsedStyle.innerHTML;ze(r)?n.innerHTML=r:(n.innerHTML="",n.appendChild(r));break;case"transformOrigin":r=e.parsedStyle.transformOrigin;n.style["transform-origin"]="".concat(r[0].value," ").concat(r[1].value);break;case"width":this.context.enableCSSParsing?(i=e.computedStyleMap().get("width"),n.style.width=i.toString()):(i=e.parsedStyle.width,n.style.width=Ge(i)?"".concat(i,"px"):i.toString());break;case"height":this.context.enableCSSParsing?(a=e.computedStyleMap().get("height"),n.style.height=a.toString()):(a=e.parsedStyle.height,n.style.height=Ge(a)?"".concat(a,"px"):a.toString());break;case"zIndex":r=e.parsedStyle.zIndex;n.style["z-index"]="".concat(r);break;case"visibility":var i=e.parsedStyle.visibility;n.style.visibility=i;break;case"pointerEvents":var a=e.parsedStyle.pointerEvents;n.style.pointerEvents=a;break;case"opacity":r=e.parsedStyle.opacity;n.style.opacity="".concat(r);break;case"fill":i=e.parsedStyle.fill,a="";ya(i)?a=i.isNone?"transparent":e.getAttribute("fill"):Array.isArray(i)?a=e.getAttribute("fill"):ga(i),n.style.background=a;break;case"stroke":r=e.parsedStyle.stroke,i="";ya(r)?i=r.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(r)?i=e.getAttribute("stroke"):ga(r),n.style["border-color"]=i,n.style["border-style"]="solid";break;case"lineWidth":a=e.parsedStyle.lineWidth;n.style["border-width"]="".concat(a||0,"px");break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":r=e.style.filter;n.style.filter=r;break;default:"x"===t||"y"===t||P(e.style[t])||""===e.style[t]||(n.style[t]=e.style[t])}},zf.tag="HTMLRendering";var Ff=zf;function zf(){this.displayObjectHTMLElementMap=new WeakMap}t(Hf,Wf=e),Hf.prototype.init=function(){this.addRenderingPlugin(new Ff)},Hf.prototype.destroy=function(){this.removeAllRenderingPlugins()};var Wf,Gf=Hf;function Hf(){var t=null!==Wf&&Wf.apply(this,arguments)||this;return t.name="html-renderer",t}Yf.prototype.getImageSync=function(t,e){return this.imageCache[t]?e&&e():this.getOrCreateImage(t).then(function(){e&&e()}),this.imageCache[t]},Yf.prototype.getOrCreateImage=function(r){var i,a=this;return this.imageCache[r]?Promise.resolve(this.imageCache[r]):(i=this.canvasConfig.createImage,new Promise(function(t,e){var n;i?n=i(r):cs&&(n=new window.Image),n&&(n.onload=function(){a.imageCache[r]=n,t(n)},n.onerror=function(t){e(t)},n.crossOrigin="Anonymous",n.src=r)}))},Yf.prototype.getOrCreatePatternSync=function(t,e,n,r,i){var a,o,s,l,c=this.generatePatternKey(t);return c&&this.patternCache[c]?this.patternCache[c]:(a=t.image,o=t.repetition,t=t.transform,l=!1,ze(a)?s=this.getImageSync(a,i):n?(s=n,l=!0):s=a,(i=s&&e.createPattern(s,o))&&(n=void 0,n=t?Do(io(t),new tc({})):et(Z()),l&&ht(n,n,[1/r,1/r,1]),i.setTransform({a:n[0],b:n[1],c:n[4],d:n[5],e:n[12],f:n[13]})),c&&i&&(this.patternCache[c]=i),i)},Yf.prototype.getOrCreateGradient=function(t,e){var n,r,i,a,o,s=this.generateGradientKey(t),l=t.type,c=t.steps,u=t.width,h=t.height,f=t.angle,d=t.cx,p=t.cy,t=t.size;return this.gradientCache[s]||(n=null,l===ri.LinearGradient?(r=u,i=h,f=vr((f=f).value),a=0+r/2,o=0+i/2,r=Math.abs(r*Math.cos(f))+Math.abs(i*Math.sin(f)),i={x1:a-Math.cos(f)*r/2,y1:o-Math.sin(f)*r/2,x2:a+Math.cos(f)*r/2,y2:o+Math.sin(f)*r/2},n=e.createLinearGradient(i.x1,i.y1,i.x2,i.y2)):l===ri.RadialGradient&&(a=u,o=h,f=p,r=t,l=(i=d).value,u=f.value,i.unit===g.kPercentage&&(l=i.value/100*a),f.unit===g.kPercentage&&(u=f.value/100*o),i=Math.max(xe([0,0],[l,u]),xe([0,o],[l,u]),xe([a,o],[l,u]),xe([a,0],[l,u])),r&&(r instanceof xi?i=r.value:r instanceof ui&&("closest-side"===r.value?i=Math.min(l,a-l,u,o-u):"farthest-side"===r.value?i=Math.max(l,a-l,u,o-u):"closest-corner"===r.value&&(i=Math.min(xe([0,0],[l,u]),xe([0,o],[l,u]),xe([a,o],[l,u]),xe([a,0],[l,u]))))),n=e.createRadialGradient(p=(h={x:l,y:u,r:i}).x,t=h.y,0,p,t,h.r)),n&&(c.forEach(function(t){var e=t.offset,t=t.color;e.unit===g.kPercentage&&null!=n&&n.addColorStop(e.value/100,t.toString())}),this.gradientCache[s]=n)),this.gradientCache[s]},Yf.prototype.generateGradientKey=function(t){var e=t.type,n=t.width,r=t.height,i=t.steps,a=t.angle,o=t.cx,s=t.cy,t=t.size;return"gradient-".concat(e,"-").concat((null==a?void 0:a.toString())||0,"-").concat((null==o?void 0:o.toString())||0,"-").concat((null==s?void 0:s.toString())||0,"-").concat((null==t?void 0:t.toString())||0,"-").concat(n,"-").concat(r,"-").concat(i.map(function(t){var e=t.offset,t=t.color;return"".concat(e).concat(t)}).join("-"))},Yf.prototype.generatePatternKey=function(t){var e=t.image,t=t.repetition;return ze(e)?"pattern-".concat(e,"-").concat(t):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(t):void 0};var Vf=Yf;function Yf(t){this.canvasConfig=t,this.imageCache={},this.gradientCache={},this.patternCache={}}$f.prototype.apply=function(t){function e(t){var e=t.target,t=e.nodeName,n=e.attributes;t===k.IMAGE&&(t=n.img,ze(t))&&a.getImageSync(t,function(){e.renderable.dirty=!0,r.dirtify()})}function n(t){var e=t.target,n=t.attrName,t=t.newValue;e.nodeName===k.IMAGE&&"img"===n&&ze(t)&&a.getOrCreateImage(t).then(function(){e.renderable.dirty=!0,r.dirtify()})}var r=t.renderingService,i=t.renderingContext,a=t.imagePool,o=i.root.ownerDocument.defaultView;r.hooks.init.tap($f.tag,function(){o.addEventListener(b.MOUNTED,e),o.addEventListener(b.ATTR_MODIFIED,n)}),r.hooks.destroy.tap($f.tag,function(){o.removeEventListener(b.MOUNTED,e),o.removeEventListener(b.ATTR_MODIFIED,n)})},$f.tag="LoadImage";var qf=$f;function $f(){}t(Kf,Uf=e),Kf.prototype.init=function(){this.context.imagePool=new Vf(this.context.config),this.addRenderingPlugin(new qf)},Kf.prototype.destroy=function(){this.removeAllRenderingPlugins()};var Uf,Xf=Kf;function Kf(){var t=null!==Uf&&Uf.apply(this,arguments)||this;return t.name="image-loader",t}Qf.prototype.init=function(){var t=this.canvasConfig,e=t.container,t=t.canvas;t?(this.$canvas=t,e&&t.parentElement!==e&&e.appendChild(t),this.$container=t.parentElement,this.canvasConfig.container=this.$container):e&&(this.$container=ze(e)?document.getElementById(e):e,this.$container)&&(t=document.createElement("canvas"),this.$container.appendChild(t),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=t),this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)},Qf.prototype.getContext=function(){return this.context},Qf.prototype.getDomElement=function(){return this.$canvas},Qf.prototype.getDPR=function(){return this.dpr},Qf.prototype.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},Qf.prototype.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},Qf.prototype.resize=function(t,e){var n=1<=(n=this.canvasConfig.devicePixelRatio||cs&&window.devicePixelRatio||1)?Math.ceil(n):1;this.dpr=n,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*e,n=this.$canvas,t=t,e=e,cs)&&n.style&&(n.style.width=t+"px",n.style.height=e+"px"),this.renderingContext.renderReasons.add(Ml.CAMERA_CHANGED)},Qf.prototype.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},Qf.prototype.toDataURL=function(r){return void 0===r&&(r={}),X(this,void 0,void 0,function(){var e,n;return R(this,function(t){return e=r.type,n=r.encoderOptions,[2,this.context.canvas.toDataURL(e,n)]})})};var Zf=Qf;function Qf(t){this.renderingContext=t.renderingContext,this.canvasConfig=t.config}t(ed,Jf=e),ed.prototype.init=function(){this.context.ContextService=Zf},ed.prototype.destroy=function(){delete this.context.ContextService};var Jf,td=ed;function ed(){var t=null!==Jf&&Jf.apply(this,arguments)||this;return t.name="canvas-context-register",t}t(id,nd=fn);var nd,rd=id;function id(t){t=nd.call(this,t)||this;return t.registerPlugin(new td),t.registerPlugin(new Xf),t.registerPlugin(new Nh),t.registerPlugin(new Lf),t.registerPlugin(new Bf),t.registerPlugin(new of),t.registerPlugin(new Gf),t}od.prototype.apply=function(t){function e(t){var a,o,s,l,c,e,u=t.target,h=u===d,f=h&&n.dragndropPluginOptions.isDocumentDraggable?d:u.closest&&u.closest("[draggable=true]");f&&(a=!1,o=t.timeStamp,s=[t.clientX,t.clientY],l=null,c=[t.clientX,t.clientY],i.addEventListener("pointermove",e=function(i){return X(n,void 0,void 0,function(){var e,n,r;return R(this,function(t){switch(t.label){case 0:if(!a){if(e=i.timeStamp-o,n=xe([i.clientX,i.clientY],s),e<=this.dragndropPluginOptions.dragstartTimeThreshold||n<=this.dragndropPluginOptions.dragstartDistanceThreshold)return[2];i.type="dragstart",f.dispatchEvent(i),a=!0}return(i.type="drag",i.dx=i.clientX-c[0],i.dy=i.clientY-c[1],f.dispatchEvent(i),c=[i.clientX,i.clientY],h)?[3,2]:(e="pointer"===this.dragndropPluginOptions.overlap?[i.canvasX,i.canvasY]:u.getBounds().center,[4,d.elementsFromPoint(e[0],e[1])]);case 1:n=t.sent(),r=n[n.indexOf(u)+1],r=(null==r?void 0:r.closest("[droppable=true]"))||(this.dragndropPluginOptions.isDocumentDroppable?d:null),l!==r&&(l&&(i.type="dragleave",(i.target=l).dispatchEvent(i)),r&&(i.type="dragenter",(i.target=r).dispatchEvent(i)),l=r)&&(i.type="dragover",(i.target=l).dispatchEvent(i)),t.label=2;case 2:return[2]}})})}),u.addEventListener("pointerup",t=function(t){a&&(t.detail={preventClick:!0},t=t.clone(),l&&(t.type="drop",(t.target=l).dispatchEvent(t)),t.type="dragend",f.dispatchEvent(t),a=!1),i.removeEventListener("pointermove",e)},{once:!0}),u.addEventListener("pointerupoutside",t,{once:!0}))}var n=this,r=t.renderingService,d=t.renderingContext.root.ownerDocument,i=d.defaultView;r.hooks.init.tap(od.tag,function(){i.addEventListener("pointerdown",e)}),r.hooks.destroy.tap(od.tag,function(){i.removeEventListener("pointerdown",e)})},od.tag="Dragndrop";var ad=od;function od(t){this.dragndropPluginOptions=t}t(cd,sd=e),cd.prototype.init=function(){this.addRenderingPlugin(new ad(m({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))},cd.prototype.destroy=function(){this.removeAllRenderingPlugins()},cd.prototype.setOptions=function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)};var sd,ld=cd;function cd(t){void 0===t&&(t={});var e=sd.call(this)||this;return e.options=t,e.name="dragndrop",e}hd.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},hd.prototype.once=function(t,e){return this.on(t,e,!0)},hd.prototype.emit=function(a){for(var o=this,s=[],t=1;t<arguments.length;t++)s[t-1]=arguments[t];function e(t){for(var e,n,r=t.length,i=0;i<r;i++)t[i]&&(n=(e=t[i]).callback,e.once&&(t.splice(i,1),0===t.length&&delete o._events[a],r--,i--),n.apply(o,s))}var n=this._events[a]||[],r=this._events["*"]||[];e(n),e(r)},hd.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},hd.prototype.getEvents=function(){return this._events};var ud=hd;function hd(){this._events={}}function fd(t,e){return null==t||null==e?NaN:t<e?-1:e<t?1:e<=t?0:NaN}function dd(n){let a,o,i;function s(t,e,n=0,r=t.length){if(n<r){if(0!==a(e,e))return r;do{var i=n+r>>>1;o(t[i],e)<0?n=1+i:r=i}while(n<r)}return n}return i=2!==n.length?(a=fd,o=(t,e)=>fd(n(t),e),(t,e)=>n(t)-e):(a=n===fd||n===function(t,e){return null==t||null==e?NaN:e<t?-1:t<e?1:t<=e?0:NaN}?n:pd,o=n),{left:s,center:function(t,e,n=0,r=t.length){return r=s(t,e,n,r-1),n<r&&i(t[r-1],e)>-i(t[r],e)?r-1:r},right:function(t,e,n=0,r=t.length){if(n<r){if(0!==a(e,e))return r;do{var i=n+r>>>1;o(t[i],e)<=0?n=1+i:r=i}while(n<r)}return n}}}function pd(){return 0}function gd(t){return null===t?NaN:+t}ii=dd(fd);const yd=ii.right,md=ii.left,vd=dd(gd).center;function bd(e,n){let r=0;if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&++r;else{let t=-1;for(var i of e)null!=(i=n(i,++t,e))&&(i=+i)>=i&&++r}return r}function xd(t,e){t=function(e,n){let r=0,i,a=0,o=0;if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&(i=t-a,a+=i/++r,o+=i*(t-a));else{let t=-1;for(var s of e)null!=(s=n(s,++t,e))&&(s=+s)>=s&&(i=s-a,a+=i/++r,o+=i*(s-a))}if(1<r)return o/(r-1)}(t,e);return t&&Math.sqrt(t)}function wd(e,n){let r,i;if(void 0===n)for(const t of e)null!=t&&(void 0===r?t>=t&&(r=i=t):(r>t&&(r=t),i<t&&(i=t)));else{let t=-1;for(var a of e)null!=(a=n(a,++t,e))&&(void 0===r?a>=a&&(r=i=a):(r>a&&(r=a),i<a&&(i=a)))}return[r,i]}class Md{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){var n=this._partials;let r=0;for(let t=0;t<this._n&&t<32;t++){var i=n[t],a=e+i,i=Math.abs(e)<Math.abs(i)?e-(a-i):i-(a-e);i&&(n[r++]=i),e=a}return n[r]=e,this._n=r+1,this}valueOf(){var t=this._partials;let e=this._n,n,r,i,a=0;if(0<e){for(a=t[--e];0<e&&(n=a,r=t[--e],a=n+r,!(i=r-(a-n))););0<e&&(i<0&&t[e-1]<0||0<i&&0<t[e-1])&&(r=2*i,n=a+r,r==n-a)&&(a=n)}return a}}class Od extends Map{constructor(t,e=function(t){return null!==t&&"object"==typeof t?t.valueOf():t}){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(kd(this,t))}has(t){return super.has(kd(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){e=e(n);return t.has(e)?t.get(e):(t.set(e,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){e=e(n);t.has(e)&&(n=t.get(e),t.delete(e));return n}(this,t))}}function kd({_intern:t,_key:e},n){e=e(n);return t.has(e)?t.get(e):n}function Ed(t){return t}function Sd(t,...e){return Pd(t,Ed,Ed,e)}function Ad(t,...e){return Pd(t,Array.from,Ed,e)}function _d(t,e,...n){return Pd(t,Ed,e,n)}function Td(t,e,...n){return Pd(t,Array.from,e,n)}function Pd(t,u,h,f){return function t(e,n){if(n>=f.length)return h(e);var r=new Od,i=f[n++];let a=-1;for(const l of e){var o=i(l,++a,e),s=r.get(o);s?s.push(l):r.set(o,[l])}for(const[c,e]of r)r.set(c,t(e,n));return u(r)}(t,0)}function Cd(e,...i){if("function"!=typeof e[Symbol.iterator])throw new TypeError("values is not iterable");e=Array.from(e);let[n]=i;var t,r;return n&&2!==n.length||1<i.length?(t=Uint32Array.from(e,(t,e)=>e),1<i.length?(i=i.map(t=>e.map(t)),t.sort((t,e)=>{for(const r of i){var n=Nd(r[t],r[e]);if(n)return n}})):(n=e.map(n),t.sort((t,e)=>Nd(n[t],n[e]))),r=e,Array.from(t,t=>r[t])):e.sort(Ld(n))}function Ld(r=fd){if(r===fd)return Nd;if("function"!=typeof r)throw new TypeError("compare is not a function");return(t,e)=>{var n=r(t,e);return n||0===n?n:(0===r(e,e))-(0===r(t,t))}}function Nd(t,e){return(null==t||!(t<=t))-(null==e||!(e<=e))||(t<e?-1:e<t?1:0)}var jd=Array.prototype.slice;function Rd(t){return()=>t}const Id=Math.sqrt(50),Bd=Math.sqrt(10),Dd=Math.sqrt(2);function Fd(t,e,n){var r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),r=r/Math.pow(10,i),r=r>=Id?10:r>=Bd?5:r>=Dd?2:1;let a,o,s;return i<0?(s=Math.pow(10,-i)/r,a=Math.round(t*s),o=Math.round(e*s),a/s<t&&++a,o/s>e&&--o,s=-s):(s=Math.pow(10,i)*r,a=Math.round(t/s),o=Math.round(e/s),a*s<t&&++a,o*s>e&&--o),o<a&&.5<=n&&n<2?Fd(t,e,2*n):[a,o,s]}function zd(t,e,n){return Fd(t=+t,e=+e,n=+n)[2]}function Wd(t){return Math.max(1,Math.ceil(Math.log(bd(t))/Math.LN2)+1)}function Gd(){var m=Ed,v=wd,b=Wd;function e(t){for(var e,n,r=(t=Array.isArray(t)?t:Array.from(t)).length,i=new Array(r),a=0;a<r;++a)i[a]=m(t[a],a,t);var o=v(i),s=o[0],l=o[1],c=b(i,s,l);if(!Array.isArray(c)){var o=l,u=+c;if(v===wd&&([s,l]=function(t,e,n){let r;for(;;){var i=zd(t,e,n);if(i===r||0===i||!isFinite(i))return[t,e];0<i?(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}}(s,l,u)),(c=function(t,e,n){if(!(0<(n=+n)))return[];if((t=+t)===(e=+e))return[t];var r=e<t,[i,a,o]=r?Fd(e,t,n):Fd(t,e,n);if(!(i<=a))return[];var s=a-i+1,l=new Array(s);if(r)if(o<0)for(let t=0;t<s;++t)l[t]=(a-t)/-o;else for(let t=0;t<s;++t)l[t]=(a-t)*o;else if(o<0)for(let t=0;t<s;++t)l[t]=(i+t)/-o;else for(let t=0;t<s;++t)l[t]=(i+t)*o;return l}(s,l,u))[0]<=s&&(n=zd(s,l,u)),c[c.length-1]>=l)if(l<=o&&v===wd){const n=zd(s,l,u);isFinite(n)&&(0<n?l=(Math.floor(l/n)+1)*n:n<0&&(l=(Math.ceil(l*-n)+1)/-n))}else c.pop()}for(var h=c.length,f=0,d=h;c[f]<=s;)++f;for(;c[d-1]>l;)--d;(f||d<h)&&(c=c.slice(f,d),h=d-f);var p,g,y=new Array(h+1);for(a=0;a<=h;++a)(p=y[a]=[]).x0=0<a?c[a-1]:s,p.x1=a<h?c[a]:l;if(isFinite(n)){if(0<n)for(a=0;a<r;++a)null!=(e=i[a])&&s<=e&&e<=l&&y[Math.min(h,Math.floor((e-s)/n))].push(t[a]);else if(n<0)for(a=0;a<r;++a)null!=(e=i[a])&&s<=e&&e<=l&&(g=Math.floor((s-e)*n),y[Math.min(h,g+(c[g]<=e))].push(t[a]))}else for(a=0;a<r;++a)null!=(e=i[a])&&s<=e&&e<=l&&y[yd(c,e,0,h)].push(t[a]);return y}return e.value=function(t){return arguments.length?(m="function"==typeof t?t:Rd(t),e):m},e.domain=function(t){return arguments.length?(v="function"==typeof t?t:Rd([t[0],t[1]]),e):v},e.thresholds=function(t){return arguments.length?(b="function"==typeof t?t:Rd(Array.isArray(t)?jd.call(t):t),e):b},e}function Hd(e,n){let r;if(void 0===n)for(const t of e)null!=t&&(r<t||void 0===r&&t>=t)&&(r=t);else{let t=-1;for(var i of e)null!=(i=n(i,++t,e))&&(r<i||void 0===r&&i>=i)&&(r=i)}return r}function Vd(t,e){let n,r=-1,i=-1;if(void 0===e)for(const o of t)++i,null!=o&&(n<o||void 0===n&&o>=o)&&(n=o,r=i);else for(var a of t)null!=(a=e(a,++i,t))&&(n<a||void 0===n&&a>=a)&&(n=a,r=i);return r}function Yd(e,n){let r;if(void 0===n)for(const t of e)null!=t&&(r>t||void 0===r&&t>=t)&&(r=t);else{let t=-1;for(var i of e)null!=(i=n(i,++t,e))&&(r>i||void 0===r&&i>=i)&&(r=i)}return r}function qd(t,e){let n,r=-1,i=-1;if(void 0===e)for(const o of t)++i,null!=o&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);else for(var a of t)null!=(a=e(a,++i,t))&&(n>a||void 0===n&&a>=a)&&(n=a,r=i);return r}function $d(n,r,i=0,a=1/0,o){if(r=Math.floor(r),i=Math.floor(Math.max(0,i)),a=Math.floor(Math.min(n.length-1,a)),i<=r&&r<=a)for(o=void 0===o?Nd:Ld(o);i<a;){600<a-i&&(s=a-i+1,l=r-i+1,u=Math.log(s),c=.5*Math.exp(2*u/3),u=.5*Math.sqrt(u*c*(s-c)/s)*(l-s/2<0?-1:1),$d(n,r,Math.max(i,Math.floor(r-l*c/s+u)),Math.min(a,Math.floor(r+(s-l)*c/s+u)),o));var s,l,c,u,h=n[r];let t=i,e=a;for(Ud(n,i,r),0<o(n[a],h)&&Ud(n,i,a);t<e;){for(Ud(n,t,e),++t,--e;o(n[t],h)<0;)++t;for(;0<o(n[e],h);)--e}0===o(n[i],h)?Ud(n,i,e):Ud(n,++e,a),e<=r&&(i=e+1),r<=e&&(a=e-1)}return n}function Ud(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Xd(t,e,n){var r;if((n=(t=Float64Array.from(function*(e,n){if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&(yield t);else{let t=-1;for(var r of e)null!=(r=n(r,++t,e))&&(r=+r)>=r&&(yield r)}}(t,n))).length)&&!isNaN(e=+e))return e<=0||n<2?Yd(t):1<=e?Hd(t):(n=(n-1)*e,(r=Hd($d(t,e=Math.floor(n)).subarray(0,e+1)))+(Yd(t.subarray(e+1))-r)*(n-e))}function Kd(n,t,r=gd){var i,e,a;if(!isNaN(t=+t))return i=Float64Array.from(n,(t,e)=>gd(r(n[e],e,n))),t<=0?qd(i):1<=t?Vd(i):(e=Uint32Array.from(n,(t,e)=>e),a=i.length-1,$d(e,t=Math.floor(a*t),0,a,(t,e)=>Nd(i[t],i[e])),0<=(t=function(e,n){let r,i=!1;if(1===n.length){let t;for(const o of e){var a=n(o);(i?0<fd(a,t):0===fd(a,a))&&(r=o,t=a,i=!0)}}else for(const t of e)(i?0<n(t,r):0===n(t,t))&&(r=t,i=!0);return r}(e.subarray(0,t+1),t=>i[t]))?t:-1)}function Zd(e,n){let r=0,i=0;if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&(++r,i+=t);else{let t=-1;for(var a of e)null!=(a=n(a,++t,e))&&(a=+a)>=a&&(++r,i+=a)}if(r)return i/r}function Qd(t,e){return Xd(t,.5,e)}function Jd(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function tp(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),a=new Array(i);++r<i;)a[r]=t+r*n;return a}function ep(e,n){let r=0;if(void 0===n)for(var t of e)(t=+t)&&(r+=t);else{let t=-1;for(var i of e)(i=+n(i,++t,e))&&(r+=i)}return r}function np(t){return t}function rp(t){return t.reduce((n,r)=>(t,...e)=>r(n(t,...e),...e),np)}function ip(t){return t.replace(/( |^)[a-z]/g,t=>t.toUpperCase())}function ap(t=""){throw new Error(t)}function op(t,e){var n,r,e=e["attributes"],i=new Set(["id","className"]);for([n,r]of Object.entries(e))i.has(n)||t.attr(n,r)}function sp(t){return null!=t&&!Number.isNaN(t)}function st(t,e){return lp(t,e)||{}}function lp(t,n){t=Object.entries(t||{}).filter(([t])=>t.startsWith(n)).map(([t,e])=>[qe(t.replace(n,"").trim()),e]).filter(([t])=>!!t);return 0===t.length?null:Object.fromEntries(t)}function cp(t,...n){return Object.fromEntries(Object.entries(t).filter(([e])=>n.every(t=>!e.startsWith(t))))}function up(t,e){return void 0===t?null:"number"==typeof t?t:(t=+t.replace("%",""),Number.isNaN(t)?null:t/100*e)}function hp(t){return!("object"!=typeof t||t instanceof Date||null===t||Array.isArray(t))}function fp(t){return null===t||!1===t}function lt(t){return new dp([t],null,t,t.ownerDocument)}class dp{constructor(t=null,e=null,n=null,r=null,i=[null,null,null,null,null],a=[],o=[]){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=a,this._facetElements=o}selectAll(t){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new dp(t,null,this._elements[0],this._document)}selectFacetAll(t){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new dp(this._elements,null,this._parent,this._document,void 0,void 0,t)}select(t){t="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new dp([t],null,t,this._document)}append(t){var e="function"==typeof t?t:()=>this.createElement(t),n=[];if(null!==this._data){for(let t=0;t<this._data.length;t++){var r=this._data[t],[r,i]=Array.isArray(r)?r:[r,null],a=e(r,t);a.__data__=r,null!==i&&(a.__fromElements__=i),this._parent.appendChild(a),n.push(a)}return new dp(n,null,this._parent,this._document)}for(let t=0;t<this._elements.length;t++){var o=this._elements[t],s=e(o.__data__,t);o.appendChild(s),n.push(s)}return new dp(n,null,n[0],this._document)}maybeAppend(t,e,n){var r=this._elements[0],i=r.getElementById(t);return i||((i="string"==typeof e?this.createElement(e):e()).id=t,n&&(i.className=n),r.appendChild(i)),new dp([i],null,this._parent,this._document)}data(e,n=t=>t,r=()=>null){var i=[],a=[],o=new Set(this._elements),s=[],l=new Set,c=new Map(this._elements.map((t,e)=>[n(t.__data__,e),t])),u=new Map(this._facetElements.map((t,e)=>[n(t.__data__,e),t])),h=Sd(this._elements,t=>r(t.__data__));for(let t=0;t<e.length;t++){var f=e[t],d=n(f,t),p=r(f,t);if(c.has(d)){var g=c.get(d);g.__data__=f,g.__facet__=!1,a.push(g),o.delete(g),c.delete(d)}else if(u.has(d)){g=u.get(d);g.__data__=f,g.__facet__=!0,a.push(g),u.delete(d)}else if(h.has(d)){const Sd=h.get(d);s.push([f,Sd]);for(const y of Sd)o.delete(y);h.delete(d)}else c.has(p)?((d=c.get(p)).__toData__?d.__toData__.push(f):d.__toData__=[f],l.add(d),o.delete(d)):i.push(f)}var t=[new dp([],i,this._parent,this._document),new dp(a,null,this._parent,this._document),new dp(o,null,this._parent,this._document),new dp([],s,this._parent,this._document),new dp(l,null,this._parent,this._document)];return new dp(this._elements,null,this._parent,this._document,t)}merge(t){var e=[...this._elements,...t._elements],t=[...this._transitions,...t._transitions];return new dp(e,null,this._parent,this._document,void 0,t)}createElement(t){var e;return this._document?this._document.createElement(t,{}):(e=dp.registry[t])?new e:ap("Unknown node type: "+t)}join(t=t=>t,e=t=>t,n=t=>t.remove(),r=t=>t,i=t=>t.remove()){t=t(this._enter),e=e(this._update),n=n(this._exit),r=r(this._merge),i=i(this._split);return e.merge(t).merge(n).merge(r).merge(i)}remove(){for(let t=0;t<this._elements.length;t++){var e=this._transitions[t];e?(e=Array.isArray(e)?e:[e],Promise.all(e.map(t=>t.finished)).then(()=>{this._elements[t].remove()})):this._elements[t].remove()}return new dp([],null,this._parent,this._document,void 0,this._transitions)}each(e){for(let t=0;t<this._elements.length;t++){var n=this._elements[t],r=n.__data__;e.call(n,r,t)}return this}attr(n,r){const i="function"!=typeof r?()=>r:r;return this.each(function(t,e){void 0!==r&&(this[n]=i.call(this,t,e))})}style(n,r){const i="function"!=typeof r?()=>r:r;return this.each(function(t,e){void 0!==r&&(this.style[n]=i.call(this,t,e))})}transition(t){const n="function"!=typeof t?()=>t:t,r=this["_transitions"];return this.each(function(t,e){r[e]=n.call(this,t,e)})}on(t,e){return this.each(function(){this.addEventListener(t,e)}),this}call(t,...e){return t.call(this._parent,this,...e),this}node(){return this._elements[0]}nodes(){return this._elements}transitions(){return this._transitions}parent(){return this._parent}}dp.registry={g:fc,rect:Nc,circle:rc,path:kc,text:Ic,ellipse:cc,image:vc,line:wc,polygon:Ac,polyline:Pc,html:gc};const pp=new Proxy({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"},{get(t,e){if(e in t)return t[e]},set(){return!0}});function gp(t,e){var n;return(e=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0?null:[1<(n=t.slice(0,e)).length?n[0]+n.slice(2):n,+t.slice(e+1)]}var yp,mp=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function vp(t){var e;if(e=mp.exec(t))return new bp({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]});throw new Error("invalid format: "+t)}function bp(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 xp(t,e){var n,e=gp(t,e);return e?(n=e[0],(e=e[1])<0?"0."+new Array(-e).join("0")+n:n.length>e+1?n.slice(0,e+1)+"."+n.slice(e+1):n+new Array(e-n.length+2).join("0")):t+""}vp.prototype=bp.prototype,bp.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 wp={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return 1e21<=Math.abs(t=Math.round(t))?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)=>xp(100*t,e),r:xp,s:function(t,e){var n,r,i=gp(t,e);return i?(n=i[0],(i=(i=i[1])-(yp=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1)===(r=n.length)?n:r<i?n+new Array(i-r+1).join("0"):0<i?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+gp(t,Math.max(0,e+i-1))[0]):t+""},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Mp(t){return t}var Op,kp=Array.prototype.map,Ep=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Sp(t){var e,s,l,M=void 0===t.grouping||void 0===t.thousands?Mp:(s=kp.call(t.grouping,Number),l=t.thousands+"",function(t,e){for(var n=t.length,r=[],i=0,a=s[0],o=0;0<n&&0<a&&(e<o+a+1&&(a=Math.max(1,e-o)),r.push(t.substring(n-=a,n+a)),!((o+=a+1)>e));)a=s[i=(i+1)%s.length];return r.reverse().join(l)}),r=void 0===t.currency?"":t.currency[0]+"",i=void 0===t.currency?"":t.currency[1]+"",O=void 0===t.decimal?".":t.decimal+"",k=void 0===t.numerals?Mp:(e=kp.call(t.numerals,String),function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}),a=void 0===t.percent?"%":t.percent+"",E=void 0===t.minus?"−":t.minus+"",S=void 0===t.nan?"NaN":t.nan+"";function o(t){var c=(t=vp(t)).fill,u=t.align,h=t.sign,e=t.symbol,f=t.zero,d=t.width,p=t.comma,g=t.precision,y=t.trim,m=t.type,v=("n"===m?(p=!0,m="g"):wp[m]||(void 0===g&&(g=12),y=!0,m="g"),(f||"0"===c&&"="===u)&&(f=!0,c="0",u="="),"$"===e?r:"#"===e&&/[boxX]/.test(m)?"0"+m.toLowerCase():""),b="$"===e?i:/[%p]/.test(m)?a:"",x=wp[m],w=/[defgprs%]/.test(m);function n(t){var e,n,r,i=v,a=b;if("c"===m)a=x(t)+a,t="";else{var o=(t=+t)<0||1/t<0;if(t=isNaN(t)?S:x(Math.abs(t),g),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;0<i&&(i=0)}return 0<i?t.slice(0,i)+t.slice(e+1):t}(t)),i=((o=o&&0==+t&&"+"!==h?!1:o)?"("===h?h:E:"-"===h||"("===h?"":h)+i,a=("s"===m?Ep[8+yp/3]:"")+a+(o&&"("===h?")":""),w)for(e=-1,n=t.length;++e<n;)if((r=t.charCodeAt(e))<48||57<r){a=(46===r?O+t.slice(e+1):t.slice(e))+a,t=t.slice(0,e);break}}p&&!f&&(t=M(t,1/0));var s=i.length+t.length+a.length,l=s<d?new Array(d-s+1).join(c):"";switch(p&&f&&(t=M(l+t,l.length?d-a.length:1/0),l=""),u){case"<":t=i+t+a+l;break;case"=":t=i+l+t+a;break;case"^":t=l.slice(0,s=l.length>>1)+i+t+a+l.slice(s);break;default:t=l+i+t+a}return k(t)}return g=void 0===g?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),n.toString=function(){return t+""},n}return{format:o,formatPrefix:function(t,e){var n=o(((t=vp(t)).type="f",t)),e=3*Math.max(-8,Math.min(8,Math.floor((t=e,((t=gp(Math.abs(t)))?t[1]:NaN)/3)))),r=Math.pow(10,-e),i=Ep[8+e/3];return function(t){return n(r*t)+i}}}}function Ap(r,i){return Object.entries(r).reduce((t,[e,n])=>(t[e]=i(n,e,r),t),{})}function _p(t){return t.map((t,e)=>e)}function Tp(t){return t[t.length-1]}function Pp(t,e){const n=[[],[]];return t.forEach(t=>{n[e(t)?0:1].push(t)}),n}function Cp(n,t=n.length){if(1===t)return n.map(t=>[t]);const r=[];for(let e=0;e<n.length;e++)Cp(n.slice(e+1),t-1).forEach(t=>{r.push([n[e],...t])});return r}o=Sp({thousands:",",grouping:[3],currency:["$",""]}),Op=o.format,o.formatPrefix;const Lp=()=>[["cartesian"]],Np=(Lp.props={},(t={})=>{var e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)}),jp=t=>{var{startAngle:t,endAngle:e,innerRadius:n,outerRadius:r}=Np(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",t,e,n,r]]},Rp=(jp.props={},({startAngle:t=0,endAngle:e=6*Math.PI,innerRadius:n=0,outerRadius:r=1})=>[["translate",.5,.5],["reflect.y"],["translate",-.5,-.5],["helix",t,e,n,r]]),Ip=(Rp.props={},()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]]),Bp=(Ip.props={transform:!0},t=>{[t={}]=[t],e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};var{startAngle:e,endAngle:t,innerRadius:n,outerRadius:r}=Object.assign(Object.assign({},e),t);return[...Ip(),...jp({startAngle:e,endAngle:t,innerRadius:n,outerRadius:r})]}),Dp=(Bp.props={},(t={})=>{var e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)}),Fp=t=>{var{startAngle:t,endAngle:e,innerRadius:n,outerRadius:r}=Dp(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...jp({startAngle:t,endAngle:e,innerRadius:n,outerRadius:r})]},zp=(Fp.props={},()=>[["parallel",0,1,0,1]]),Wp=(zp.props={},({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]]),Gp=(Wp.props={transform:!0},t=>{var{startAngle:t=-Math.PI/2,endAngle:e=3*Math.PI/2,innerRadius:n=0,outerRadius:r=1}=t;return[...zp(),...jp({startAngle:t,endAngle:e,innerRadius:n,outerRadius:r})]}),Hp=(Gp.props={},[["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 Vp(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)}function Yp(t){return Up(t,"Function")}function qp(t){return null==t}var $p={}.toString,Up=function(t,e){return $p.call(t)==="[object "+e+"]"},Xp=function(t){return Array.isArray?Array.isArray(t):Up(t,"Array")};var Kp=function(t){if("object"!=typeof(e=t)||null===e||!Up(t,"Object"))return!1;var e;if(null===Object.getPrototypeOf(t))return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(t)===n},Zp=function(t){return Up(t,"Number")},Qp=Object.values?function(t){return Object.values(t)}:function(n){var t,r=[],e=n,i=function(t,e){Yp(n)&&"prototype"===e||r.push(t)};if(e)if(Xp(e))for(var a=0,o=e.length;a<o&&!1!==i(e[a],a);a++);else if(t=typeof e,null!==e&&"object"==t||"function"==t)for(var s in e)if(e.hasOwnProperty(s)&&!1===i(e[s],s))break;return r},Jp=5;function t0(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)!function t(e,n,r,i){for(var a in r=r||0,i=i||Jp,n){var o;n.hasOwnProperty(a)&&(null!==(o=n[a])&&Kp(o)?(Kp(e[a])||(e[a]={}),r<i?t(e[a],o,r+1,i):e[a]=n[a]):Xp(o)?(e[a]=[],e[a]=e[a].concat(o)):void 0!==o&&(e[a]=o))}}(t,e[r]);return t}function e0(t){return t}var n0,r0=function(t,e){if(!Vp(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};function i0(t){return qp(t)?0:(Vp(t)?t:Object.keys(t)).length}!function(a,o){var s;if(Yp(a))return(s=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,r=o?o.apply(this,t):t[0],i=s.cache;return i.has(r)?i.get(r):(n=a.apply(this,t),i.set(r,n),n)}).cache=new Map;throw new TypeError("Expected a function")}(function(t,e){var n=(e=void 0===e?{}:e).fontSize,r=e.fontFamily,i=e.fontWeight,a=e.fontStyle,e=e.fontVariant;return(n0=n0||document.createElement("canvas").getContext("2d")).font=[a,e,i,n+"px",r].join(" "),n0.measureText(Up(t,"String")?t:"").width},function(t,e){return function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var r=Array(t),i=0,e=0;e<n;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}([t],Qp(e=void 0===e?{}:e)).join("")});var a0=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},o0=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||((r=r||Array.prototype.slice.call(e,0,i))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function s0(t,e,n){for(;t<e;)t+=2*Math.PI;for(;n<t;)t-=2*Math.PI;return t}function l0(t,e,n,r,i){var a=(t=c0(t,2))[0],t=t[1],o=U();return a=[a,t],(t=o)[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=a[0],t[7]=a[1],t[8]=1,t}var c0=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o};function u0(t,...e){return e.reduce((e,n)=>t=>e(n(t)),t)}function h0(e,n){return n-e?t=>(t-e)/(n-e):t=>.5}function f0(t,e,n,r,i){let a=n||0,o=r||t.length;for(var s=i||(t=>t);a<o;){var l=Math.floor((a+o)/2);s(t[l])>e?o=l:a=l+1}return a}const d0=Math.sqrt(50),p0=Math.sqrt(10),g0=Math.sqrt(2);function y0(t,e,n){e=(e-t)/Math.max(0,n),t=Math.floor(Math.log(e)/Math.LN10),n=e/10**t;return 0<=t?(n>=d0?10:n>=p0?5:n>=g0?2:1)*10**t:-(10**-t)/(n>=d0?10:n>=p0?5:n>=g0?2:1)}function m0(t,e,n){n=Math.abs(e-t)/Math.max(0,n);let r=10**Math.floor(Math.log(n)/Math.LN10);n/=r;return n>=d0?r*=10:n>=p0?r*=5:n>=g0&&(r*=2),e<t?-r:r}const v0=(t,e,n=5)=>{t=[t,e];let r=0,i=t.length-1,a=t[r],o=t[i],s;return o<a&&([a,o]=[o,a],[r,i]=[i,r]),0<(s=y0(a,o,n))?(a=Math.floor(a/s)*s,o=Math.ceil(o/s)*s,s=y0(a,o,n)):s<0&&(a=Math.ceil(a*s)/s,o=Math.floor(o*s)/s,s=y0(a,o,n)),0<s?(t[r]=Math.floor(a/s)*s,t[i]=Math.ceil(o/s)*s):s<0&&(t[r]=Math.ceil(a*s)/s,t[i]=Math.floor(o*s)/s),t},b0=36e5,x0=864e5,w0=7*x0;x0,x0;function M0(t,n,s,r){const i=(t,e)=>{let n=e;for(;n&&r(t)%e!=0;)s(t,-1),--n;return t},l=(t,e)=>{e&&i(t,e),n(t)};const c=(t,e)=>{t=new Date(+t-1);return l(t,e),s(t,e),l(t),t};return{ceil:c,floor:(t,e)=>{t=new Date(+t);return l(t,e),t},range:(t,e,n,r)=>{for(var i=[],a=Math.floor(n),o=r?c(t,n):c(t);+o<+e;s(o,a),l(o))i.push(new Date(+o));return i},duration:t}}Ys=M0(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),_o=M0(1e3,t=>{t.setMilliseconds(0)},(t,e=1)=>{t.setTime(+t+1e3*e)},t=>t.getSeconds()),Js=M0(6e4,t=>{t.setSeconds(0,0)},(t,e=1)=>{t.setTime(+t+6e4*e)},t=>t.getMinutes()),No=M0(b0,t=>{t.setMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+b0*e)},t=>t.getHours()),Ro=M0(x0,t=>{t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+x0*e)},t=>t.getDate()-1);const O0=M0(2592e6,t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e=1)=>{var n=t.getMonth();t.setMonth(n+e)},t=>t.getMonth());zo=M0(w0,t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+w0*e)},t=>{var e=O0.floor(t),t=new Date(+t);return Math.floor((+t-+e)/w0)}),qo=M0(31536e6,t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e=1)=>{var n=t.getFullYear();t.setFullYear(n+e)},t=>t.getFullYear());const k0={millisecond:Ys,second:_o,minute:Js,hour:No,day:Ro,week:zo,month:O0,year:qo};Uo=M0(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),Ko=M0(1e3,t=>{t.setUTCMilliseconds(0)},(t,e=1)=>{t.setTime(+t+1e3*e)},t=>t.getUTCSeconds()),Qo=M0(6e4,t=>{t.setUTCSeconds(0,0)},(t,e=1)=>{t.setTime(+t+6e4*e)},t=>t.getUTCMinutes()),es=M0(b0,t=>{t.setUTCMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+b0*e)},t=>t.getUTCHours()),rs=M0(x0,t=>{t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+x0*e)},t=>t.getUTCDate()-1);const E0=M0(2592e6,t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e=1)=>{var n=t.getUTCMonth();t.setUTCMonth(n+e)},t=>t.getUTCMonth());as=M0(w0,t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+w0*e)},t=>{var e=E0.floor(t),t=new Date(+t);return Math.floor((+t-+e)/w0)}),Ss=M0(31536e6,t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e=1)=>{var n=t.getUTCFullYear();t.setUTCFullYear(n+e)},t=>t.getUTCFullYear());const S0={millisecond:Uo,second:Ko,minute:Qo,hour:es,day:rs,week:as,month:E0,year:Ss};function A0(t,e,n,r,i){var t=+t,e=+e,{tickIntervals:i,year:a,millisecond:o}=function(t){var{year:t,month:e,week:n,day:r,hour:i,minute:a,second:o,millisecond:s}=t?S0:k0;return{tickIntervals:[[o,1],[o,5],[o,15],[o,30],[a,1],[a,5],[a,15],[a,30],[i,1],[i,3],[i,6],[i,12],[r,1],[r,2],[n,1],[e,1],[e,3],[t,1]],year:t,millisecond:s}}(i),s=([t,e])=>t.duration*e,n=r?(e-t)/r:n||5,l=r||(e-t)/n,c=i.length,u=f0(i,l,0,c,s);let h;return h=u===c?[a,m0(t/a.duration,e/a.duration,n)]:u?([c,a]=l/s(i[u-1])<s(i[u])/l?i[u-1]:i[u],[c,r?Math.ceil(r/c.duration):a]):[o,Math.max(m0(t,e,n),1)]}const _0=(t,e,n,r,i)=>{var a=e<t,o=a?e:t,t=a?t:e,[e,n]=A0(o,t,n,r,i),r=[e.floor(o,n),e.ceil(t,n)];return a?r.reverse():r};function T0(t){return null!=t&&!Number.isNaN(t)}const P0=e=>t=>-e(-t),C0=(t,e)=>{const n=Math.log(t);t=t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:t=>Math.log(t)/n;return e?P0(t):t},L0=(e,t)=>{var n=e===Math.E?Math.exp:t=>e**t;return t?P0(n):n},N0=(t,e,n,r)=>{var i=t<0,a=C0(r,i),r=L0(r,i),i=e<t,o=i?t:e,e=[r(Math.floor(a(i?e:t))),r(Math.ceil(a(o)))];return i?e.reverse():e};function j0(e,o){return t=>{t.prototype.rescale=function(){this.initRange(),this.nice();var[t]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t))},t.prototype.initRange=function(){var t=this.options["interpolator"];this.options.range=e(t)},t.prototype.composeOutput=function(t,e){var n,{domain:r,interpolator:i,round:a}=this.getOptions(),r=o(r.map(t)),a=a?(n=i,t=>{t=n(t);return Zp(t)?Math.round(t):t}):i;this.output=u0(a,r,e,t)},t.prototype.invert=void 0}}var R0,zs={exports:{}},Ws={exports:{}},I0=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||0<=t.length&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))},B0=Array.prototype.concat,D0=Array.prototype.slice,F0=Ws.exports=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];I0(i)?e=B0.call(e,D0.call(i)):e.push(i)}return e},z0=(F0.wrap=function(t){return function(){return t(F0(arguments))}},{aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),W0=Ws.exports,G0=Object.hasOwnProperty,H0=Object.create(null);for(R0 in z0)G0.call(z0,R0)&&(H0[z0[R0]]=R0);var V0=zs.exports={to:{},get:{}};function Y0(t,e,n){return Math.min(Math.max(e,t),n)}function q0(t){t=Math.round(t).toString(16).toUpperCase();return t.length<2?"0"+t:t}V0.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=V0.get.hsl(t),n="hsl";break;case"hwb":e=V0.get.hwb(t),n="hwb";break;default:e=V0.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},V0.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 a=2*n;i[n]=parseInt(e.slice(a,2+a),16)}r&&(i[3]=parseInt(r,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(r=(e=e[1])[3],n=0;n<3;n++)i[n]=parseInt(e[n]+e[n],16);r&&(i[3]=parseInt(r+r,16)/255)}else{if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/))for(n=0;n<3;n++)i[n]=parseInt(e[n+1],0);else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:G0.call(z0,e[1])?((i=z0[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]=Y0(i[n],0,255);return i[3]=Y0(i[3],0,1),i},V0.get.hsl=function(t){var e;return(t=t&&t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/))?(e=parseFloat(t[4]),[(parseFloat(t[1])%360+360)%360,Y0(parseFloat(t[2]),0,100),Y0(parseFloat(t[3]),0,100),Y0(isNaN(e)?1:e,0,1)]):null},V0.get.hwb=function(t){var e;return(t=t&&t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/))?(e=parseFloat(t[4]),[(parseFloat(t[1])%360+360)%360,Y0(parseFloat(t[2]),0,100),Y0(parseFloat(t[3]),0,100),Y0(isNaN(e)?1:e,0,1)]):null},V0.to.hex=function(){var t=W0(arguments);return"#"+q0(t[0])+q0(t[1])+q0(t[2])+(t[3]<1?q0(Math.round(255*t[3])):"")},V0.to.rgb=function(){var t=W0(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]+")"},V0.to.rgb.percent=function(){var t=W0(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]+")"},V0.to.hsl=function(){var t=W0(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},V0.to.hwb=function(){var t=W0(arguments),e="";return 4<=t.length&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},V0.to.keyword=function(t){return H0[t.slice(0,3)]};var $0=zs.exports;function U0(t,e,n){let r=n;return r<0&&(r+=1),1<r&&--r,r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function X0(t){var e,n,r,t=$0.get(t);return t?({model:t,value:e}=t,"rgb"===t?e:"hsl"===t?(e=(t=e)[0]/360,n=t[1]/100,r=t[2]/100,t=t[3],0==n?[255*r,255*r,255*r,t]:[255*U0(n=2*r-(r=r<.5?r*(1+n):r+n-r*n),r,e+1/3),255*U0(n,r,e),255*U0(n,r,e-1/3),t]):null):null}const K0=(e,n)=>t=>e*(1-t)+n*t,Z0=(t,e)=>{if("number"==typeof t&&"number"==typeof e)return K0(t,e);if("string"!=typeof t||"string"!=typeof e)return()=>t;{var n=t,r=e;const l=X0(n),c=X0(r);return null===l||null===c?l?()=>n:()=>r:e=>{var n=new Array(4);for(let t=0;t<4;t+=1){var r=l[t],i=c[t];n[t]=r*(1-e)+i*e}var[t,a,o,s]=n;return`rgba(${Math.round(t)}, ${Math.round(a)}, ${Math.round(o)}, ${s})`}}},Q0=(t,e)=>{const n=K0(t,e);return t=>Math.round(n(t))};function J0({map:t,initKey:e},n){e=e(n);return t.has(e)?t.get(e):n}function tg(t){return"object"==typeof t?t.valueOf():t}class eg extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=tg,null!==t)for(var[e,n]of t)this.set(e,n)}get(t){return super.get(J0({map:this.map,initKey:this.initKey},t))}has(t){return super.has(J0({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(([{map:t,initKey:n},r]=[{map:this.map,initKey:this.initKey},t],n=n(r),t.has(n)?t.get(n):(t.set(n,r),r)),e);var n,r}delete(t){return super.delete(([{map:t,initKey:e},n]=[{map:this.map,initKey:this.initKey},t],e=e(n),t.has(e)&&(n=t.get(e),t.delete(e)),n));var e,n}}class ng{constructor(t){this.options=t0({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=t0({},this.options,t),this.rescale(t)}rescale(t){}}const rg=Symbol("defaultUnknown");function ig(e,n,r){for(let t=0;t<n.length;t+=1)e.has(n[t])||e.set(r(n[t]),t)}function ag(t){var{value:t,from:e,to:n,mapper:r,notFoundReturn:i}=t;let a=r.get(t);if(void 0===a){if(i!==rg)return i;a=e.push(t)-1,r.set(t,a)}return n[a%n.length]}function og(t){return t instanceof Date?t=>""+t:"object"==typeof t?t=>JSON.stringify(t):t=>t}class sg extends ng{getDefaultOptions(){return{domain:[],range:[],unknown:rg}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&ig(this.domainIndexMap,this.getDomain(),this.domainKey),ag({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&ig(this.rangeIndexMap,this.getRange(),this.rangeKey),ag({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){var[e]=this.options.domain,[n]=this.options.range;this.domainKey=og(e),this.rangeKey=og(n),this.rangeIndexMap?(t&&!t.range||this.rangeIndexMap.clear(),t&&!t.domain&&!t.compare||(this.domainIndexMap.clear(),this.sortedDomain=void 0)):(this.rangeIndexMap=new Map,this.domainIndexMap=new Map)}clone(){return new sg(this.options)}getRange(){return this.options.range}getDomain(){var t,e;return this.sortedDomain||({domain:t,compare:e}=this.options,this.sortedDomain=e?[...t].sort(e):t),this.sortedDomain}}function lg(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:a,round:o,align:s}=t;var l=e.length,c=0<(c=(t=l)-(u=a).length)?[...u,...new Array(c).fill(1)]:c<0?u.slice(0,t):u,[t,u]=n,u=u-t,h=u/(2/l*r+1-1/l*i);const f=h*i/l;h-=l*f;const d=function(t){const e=Math.min(...t);return t.map(t=>t/e)}(c),p=h/d.reduce((t,e)=>t+e);var c=new eg(e.map((t,e)=>{e=d[e]*p;return[t,o?Math.floor(e):e]})),g=new eg(e.map((t,e)=>{e=d[e]*p+f;return[t,o?Math.floor(e):e]})),h=Array.from(g.values()).reduce((t,e)=>t+e),t=t+(u-(h-h/l*i))*s;let y=o?Math.round(t):t;var m=new Array(l);for(let t=0;t<l;t+=1){m[t]=(v=y,Math.round(1e12*v)/1e12);var v=e[t];y+=g.get(v)}return{valueBandWidth:c,valueStep:g,adjustedRange:m}}class cg extends sg{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:rg,flex:[]}}constructor(t){super(t)}clone(){return new cg(this.options)}getStep(t){return void 0===this.valueStep?1:"number"==typeof this.valueStep?this.valueStep:void 0===t?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return void 0===this.valueBandWidth?1:"number"==typeof this.valueBandWidth?this.valueBandWidth:void 0===t?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){var{padding:t,paddingInner:e}=this.options;return 0<t?t:e}getPaddingOuter(){var{padding:t,paddingOuter:e}=this.options;return 0<t?t:e}rescale(){super.rescale();var{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:t,valueBandWidth:n,valueStep:r}=function(t){var e=t["domain"];if(0===(e=e.length))return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(!(null==(n=t.flex)||!n.length))return lg(t);var{range:n,paddingOuter:t,paddingInner:r,round:i,align:a}=t;let o,s,l=n[0];return n=n[1]-l,o=n/Math.max(1,2*t+(e-r)),i&&(o=Math.floor(o)),l+=(n-o*(e-r))*a,s=o*(1-r),i&&(l=Math.round(l),s=Math.round(s)),t=new Array(e).fill(0).map((t,e)=>l+e*o),{valueStep:o,valueBandWidth:s,adjustedRange:t}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=r,this.valueBandWidth=n,this.adjustedRange=t}}const ug=(t,e,n)=>{let r,i,a=t,o=e;if(a===o&&0<n)return[a];let s=y0(a,o,n);if(0===s||!Number.isFinite(s))return[];if(0<s){a=Math.ceil(a/s),o=Math.floor(o/s),i=new Array(r=Math.ceil(o-a+1));for(let t=0;t<r;t+=1)i[t]=(a+t)*s}else{s=-s,a=Math.ceil(a*s),o=Math.floor(o*s),i=new Array(r=Math.ceil(o-a+1));for(let t=0;t<r;t+=1)i[t]=(a+t)/s}return i};class hg extends ng{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:ug}}map(t){var[e]=this.options.range;return void 0!==e?e:this.options.unknown}invert(t){var[e]=this.options.range;return t===e&&void 0!==e?this.options.domain:[]}getTicks(){var{tickMethod:t,domain:e,tickCount:n}=this.options,[e,r]=e;return Zp(e)&&Zp(r)?t(e,r,n):[]}clone(){return new hg(this.options)}}function fg(t){return Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}const dg=[1,5,2,2.5,4,3],pg=100*Number.EPSILON;const gg=(n,r,t=5,i=!0,a=dg,o=[.25,.2,.5,.05])=>{var s=t<0?0:Math.round(t);if(Number.isNaN(n)||Number.isNaN(r)||"number"!=typeof n||"number"!=typeof r||!s)return[];if(r-n<1e-15||1===s)return[n];var l,c,u,h,f,d,p,g={score:-2,lmin:0,lmax:0,lstep:0};let y=1;for(;y<1/0;){for(let t=0;t<a.length;t+=1){var m=a[t],v=(h=m,f=a,d=y,p=void 0,p=i0(f),1-r0(f,h)/(p-1)-d+1);if(o[0]*v+o[1]+o[2]+o[3]<g.score){y=1/0;break}let e=2;for(;e<1/0;){x=e;var b=(u=s)<=x?2-(x-1)/(u-1):1;if(o[0]*v+o[1]+o[2]*b+o[3]<g.score)break;var x=(r-n)/(e+1)/y/m;let t=Math.ceil(Math.log10(x));for(;t<1/0;){var w=y*m*10**t,M=(k=r,M=w*(e-1),(k-=n)<M?1-((M-k)/2)**2/(.1*k)**2:1);if(o[0]*v+o[1]*M+o[2]*b+o[3]<g.score)break;var O=Math.floor(r/w)*y-(e-1)*y,k=Math.ceil(n/w)*y;if(O<=k){var E=k-O;for(let t=0;t<=E;t+=1){var S=(O+t)*(w/y),A=S+w*(e-1),_=w,T=function(t,e,n,r,i,a){var o=i0(e),e=r0(e,t);let s=0;return t=(r%a+a)%a,1-e/(o-1)-n+(s=(t<pg||a-t<pg)&&r<=0&&0<=i?1:s)}(m,a,y,S,A,_),P=1-.5*((r-A)**2+(n-S)**2)/(.1*(r-n))**2,C=(l=e,C=n,l=(l-1)/(A-(L=S)),c=((c=s)-1)/(Math.max(A,r)-Math.min(C,L)),2-Math.max(l/c,c/l)),L=o[0]*T+o[1]*P+o[2]*C+ +o[3];g.score<L&&(!i||S<=n&&r<=A)&&(g.lmin=S,g.lmax=A,g.lstep=_,g.score=L)}}t+=1}e+=1}}y+=1}var t=fg(g.lmax),e=fg(g.lmin),N=fg(g.lstep),j=Math.floor((t=(t-e)/N,Math.round(1e12*t)/1e12))+1,R=new Array(j);R[0]=fg(e);for(let t=1;t<j;t+=1)R[t]=fg(R[t-1]+N);return R};class yg extends ng{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:gg}}map(t){return T0(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new yg(this.options)}getTicks(){var{domain:t,tickCount:e,tickMethod:n}=this.options,[t,r]=t;return Zp(t)&&Zp(r)?n(t,r,e):[]}}const mg=(t,e,n)=>{var[t,r]=t,[e,i]=e;let a,o;return u0(o=t<r?(a=h0(t,r),n(e,i)):(a=h0(r,t),n(i,e)),a)},vg=(r,t,e)=>{const i=Math.min(r.length,t.length)-1,a=new Array(i),o=new Array(i);var n=r[0]>r[i],s=n?[...r].reverse():r,l=n?[...t].reverse():t;for(let t=0;t<i;t+=1)a[t]=h0(s[t],s[t+1]),o[t]=e(l[t],l[t+1]);return t=>{var e=f0(r,t,1,i)-1,n=a[e];return u0(o[e],n)(t)}},bg=(t,e,n,r)=>{return(2<Math.min(t.length,e.length)?vg:mg)(t,e,r?Q0:n)};class xg extends ng{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:K0,tickCount:5}}map(t){return T0(t)?this.output(t):this.options.unknown}invert(t){return T0(t)?this.input(t):this.options.unknown}nice(){var t,e,n,r;this.options.nice&&([t,e,n,...r]=this.getTickMethodOptions(),this.options.domain=this.chooseNice()(t,e,n,...r))}getTicks(){var t=this.options["tickMethod"],[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){var{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return v0}rescale(){this.nice();var[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){var{clamp:e,range:n}=this.options,t=this.options.domain.map(t),n=Math.min(t.length,n.length);if(e){e=t[0],t=t[n-1];const r=t<e?t:e,i=t<e?e:t;return t=>Math.min(Math.max(r,t),i)}return e0}composeOutput(t,e){var{domain:n,range:r,round:i,interpolate:a}=this.options,n=bg(n.map(t),r,a,i);this.output=u0(n,e,t)}composeInput(t,e,n){var{domain:r,range:i}=this.options,i=bg(i,r.map(t),K0);this.input=u0(e,n,i)}}class wg extends xg{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:Z0,tickMethod:ug,tickCount:5}}chooseTransforms(){return[e0,e0]}clone(){return new wg(this.options)}}class Mg extends cg{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:rg,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new Mg(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const Og=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class kg extends xg{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:Z0,tickMethod:ug,tickCount:5}}constructor(t){super(t)}chooseTransforms(){var t,e,n,r=this.options["exponent"];return 1===r?[e0,e0]:(t=.5===r?Og:(e=r,t=>t<0?-((-t)**e):t**e),n=r,[t,t=>t<0?-((-t)**(1/n)):t**(1/n)])}clone(){return new kg(this.options)}}class Eg extends kg{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Z0,tickMethod:ug,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new Eg(this.options)}}class Sg extends ng{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){return T0(t)?(t=f0(this.thresholds,t,0,this.n),this.options.range[t]):this.options.unknown}invert(t){var e=this.options["range"],e=e.indexOf(t),t=this.thresholds;return[t[e-1],t[e]]}clone(){return new Sg(this.options)}rescale(){var{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const Ag=(t,e,n,r=10)=>{var i=t<0,a=L0(r,i),o=C0(r,i),s=e<t,l=s?e:t,c=s?t:e;let u=o(l),h=o(c),f=[];if(!(r%1)&&h-u<n){if(u=Math.floor(u),h=Math.ceil(h),i)for(;u<=h;u+=1){var d=a(u);for(let t=r-1;1<=t;--t){var p=d*t;if(c<p)break;l<=p&&f.push(p)}}else for(;u<=h;u+=1){var g=a(u);for(let t=1;t<r;t+=1){var y=g*t;if(c<y)break;l<=y&&f.push(y)}}2*f.length<n&&(f=ug(l,c,n))}else{t=-1===n?h-u:Math.min(h-u,n);f=ug(u,h,t).map(a)}return s?f.reverse():f};class _g extends xg{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:Z0,tickMethod:Ag,tickCount:5}}chooseNice(){return N0}getTickMethodOptions(){var{domain:t,tickCount:e,base:n}=this.options;return[t[0],t[t.length-1],e,n]}chooseTransforms(){var{base:t,domain:e}=this.options,e=e[0]<0;return[C0(t,e),L0(t,e)]}clone(){return new _g(this.options)}}class Tg extends Sg{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:gg}}constructor(t){super(t)}nice(){var t,e,n=this.options["nice"];n&&([n,t,e]=this.getTickMethodOptions(),this.options.domain=v0(n,t,e))}getTicks(){var t=this.options["tickMethod"],[e,n,r]=this.getTickMethodOptions();return t(e,n,r)}getTickMethodOptions(){var{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}rescale(){this.nice();var{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){var[t,e]=super.invert(t),[n,r]=this.options.domain;return void 0===t&&void 0===e?[t,e]:[t||n,e||r]}getThresholds(){return this.thresholds}clone(){return new Tg(this.options)}}function Pg(t,e,n=!1){var r=t,i=(n||r.sort((t,e)=>t-e),[]);for(let t=1;t<e;t+=1)i.push(function(t,e){var n,r=t.length;if(r)return r<2?t[r-1]:(r=(r-1)*e,(n=t[e=Math.floor(r)])+(t[e+1]-n)*(r-e))}(r,t/e));return i}class Cg extends Sg{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:gg}}constructor(t){super(t)}rescale(){var{domain:t,range:e}=this.options;this.n=e.length-1,this.thresholds=Pg(t,this.n+1,!1)}invert(t){var[t,e]=super.invert(t),n=this.options["domain"],r=n[0],n=n[n.length-1];return void 0===t&&void 0===e?[t,e]:[t||r,e||n]}getThresholds(){return this.thresholds}clone(){return new Cg(this.options)}getTicks(){var{tickCount:t,domain:e,tickMethod:n}=this.options,r=e.length-1;return n(e[0],e[r],t)}}var Lg=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,Ng=/\[([^]*?)\]/gm;function jg(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function Rg(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 a,o=i[r];for(a in o)t[a]=o[a]}return t}function Ig(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t}var Bg,Go=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],$s=["January","February","March","April","May","June","July","August","September","October","November","December"],Ol=jg($s,3),Dg=Rg({},{dayNamesShort:jg(Go,3),dayNames:Go,monthNamesShort:Ol,monthNames:$s,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][3<t%10?0:(t-t%10!=10?1:0)*t%10]}}),Fg={D:function(t){return String(t.getDate())},DD:function(t){return Ig(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return Ig(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 Ig(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 Ig(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return Ig(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return Ig(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return Ig(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return Ig(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return Ig(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return Ig(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return Ig(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]:e.amPm[1]).toUpperCase()},ZZ:function(t){t=t.getTimezoneOffset();return(0<t?"-":"+")+Ig(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4)},Z:function(t){t=t.getTimezoneOffset();return(0<t?"-":"+")+Ig(Math.floor(Math.abs(t)/60),2)+":"+Ig(Math.abs(t)%60,2)}},zg={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 Wg=(t,e,n,r,i)=>{var a=e<t,o=a?e:t,t=a?t:e,[e,n]=A0(o,t,n,r,i),r=e.range(o,new Date(+t+1),n,!0);return a?r.reverse():r};function Gg(t){var e=t.getTimezoneOffset(),t=new Date(t);return t.setMinutes(t.getMinutes()+e,t.getSeconds(),t.getMilliseconds()),t}class Hg extends xg{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:Wg,interpolate:K0,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return _0}getTickMethodOptions(){var{domain:t,tickCount:e,tickInterval:n,utc:r}=this.options;return[t[0],t[t.length-1],e,n,r]}getFormatter(){const{mask:a,utc:t}=this.options,o=t?S0:k0,s=t?Gg:e0;return t=>{var e=s(t),t=a||function(t,e){var{second:e,minute:n,hour:r,day:i,week:a,month:o,year:s}=e;return e.floor(t)<t?".SSS":n.floor(t)<t?":ss":r.floor(t)<t?"hh:mm":i.floor(t)<t?"hh A":o.floor(t)<t?a.floor(t)<t?"MMM DD":"ddd DD":s.floor(t)<t?"MMMM":"YYYY"}(t,o),n=void 0;if(void 0===t&&(t=zg.default),void 0===n&&(n={}),"number"==typeof e&&(e=new Date(e)),"[object Date]"!==Object.prototype.toString.call(e)||isNaN(e.getTime()))throw new Error("Invalid Date pass to format");var r=[],i=(t=(t=zg[t]||t).replace(Ng,function(t,e){return r.push(e),"@@@"}),Rg(Rg({},Dg),n));return(t=t.replace(Lg,function(t){return Fg[t](e,i)})).replace(/@@@/g,function(){return r.shift()})}}clone(){return new Hg(this.options)}}var Vg;let Yg=Bg=class extends wg{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:e0,tickMethod:ug,tickCount:5}}constructor(t){super(t)}clone(){return new Bg(this.options)}};Yg=Bg=function(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(o=(a<3?i(o):3<a?i(e,n,o):i(e,n))||o);return 3<a&&o&&Object.defineProperty(e,n,o),o}([j0(function(t){return[t(0),t(1)]},t=>{var[t,e]=t;return u0(K0(0,1),h0(t,e))})],Yg);let qg=Vg=class extends wg{getDefaultOptions(){return{domain:[0,.5,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:e0,tickMethod:ug,tickCount:5}}constructor(t){super(t)}clone(){return new Vg(this.options)}};qg=Vg=function(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(o=(a<3?i(o):3<a?i(e,n,o):i(e,n))||o);return 3<a&&o&&Object.defineProperty(e,n,o),o}([j0(function(t){return[t(0),t(.5),t(1)]},t=>{const[e,n,r]=t,i=u0(K0(0,.5),h0(e,n)),a=u0(K0(.5,1),h0(n,r));return t=>(e>r?t<n?a:i:t<n?i:a)(t)})],qg);function $g(t,e,n,r,i){var a=new wg({range:[e,e+r]}),o=new wg({range:[n,n+i]});return{transform:function(t){var t=i1(t,2),e=t[0],t=t[1];return[a.map(e),o.map(t)]},untransform:function(t){var t=i1(t,2),e=t[0],t=t[1];return[a.invert(e),o.invert(t)]}}}function Ug(t,e,n,r,i){return(0,a1(t,1)[0])(e,n,r,i)}function Xg(t,e,n,r,i){return o1(t,1)[0]}function Kg(t,e,n,r,i){var a=(t=s1(t,4))[0],o=t[1],s=t[2],t=t[3],l=new wg({range:[s,t]}),c=new wg({range:[a,o]}),u=1<(s=i/r)?1:s,h=1<s?1/s:1;return{transform:function(t){var t=s1(t,2),e=t[0],t=t[1],e=c.map(e),t=l.map(t);return[.5*(t*Math.cos(e)*u)+.5,.5*(t*Math.sin(e)*h)+.5]},untransform:function(t){var t=s1(t,2),e=t[0],t=t[1],e=2*(e-.5)/u,t=2*(t-.5)/h,n=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),t=s0(Math.atan2(t,e),a,o);return[c.invert(t),l.invert(n)]}}}function Zg(t,e,n,r,i){return{transform:function(t){var t=l1(t,2),e=t[0];return[t[1],e]},untransform:function(t){var t=l1(t,2),e=t[0];return[t[1],e]}}}function Qg(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return u1.apply(void 0,f1([[-1,-1]],h1(e),!1))}function Jg(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return u1.apply(void 0,f1([[-1,1]],h1(e),!1))}function t1(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return u1.apply(void 0,f1([[1,-1]],h1(e),!1))}function e1(t,e,n,r,i){var a,t=d1(t,1)[0],o=U();return o=o,t=t,a=Math.sin(t),t=Math.cos(t),o[0]=t,o[1]=a,o[2]=0,o[3]=-a,o[4]=t,o[5]=0,o[6]=0,o[7]=0,o[8]=1,o}function n1(t,e,n,r,i){var a=(t=p1(t,4))[0],o=t[1],s=t[2],l=(t[3]-s)/(+o/(2*Math.PI)+1),c=l/(2*Math.PI),u=new wg({range:[s,s+.99*l]}),h=new wg({range:[a,o]}),f=1<(t=i/r)?1:t,d=1<t?1/t:1;return{transform:function(t){var t=p1(t,2),e=t[0],t=t[1],e=h.map(e),t=u.map(t);return[.5*(Math.cos(e)*(c*e+t)*f)+.5,.5*(Math.sin(e)*(c*e+t)*d)+.5]},untransform:function(t){var t=p1(t,2),e=t[0],t=t[1],e=2*(e-.5)/f,t=2*(t-.5)/d,n=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),t=s0(Math.atan2(t,e)+Math.floor(n/l)*Math.PI*2,a,o),e=n-c*t;return[h.invert(t),u.invert(e)]}}}function r1(t,e,n,r,i){var s=(t=g1(t,4))[0],l=t[1],a=t[2],t=t[3],c=new wg({range:[a,t]});return{transform:function(t){for(var e=[],n=t.length,r=new Mg({domain:new Array(n).fill(0).map(function(t,e){return e}),range:[s,l]}),i=0;i<n;i++){var a=t[i],o=r.map(i),a=c.map(a);e.push(o,a)}return e},untransform:function(t){for(var e=[],n=0;n<t.length;n+=2){var r=t[n+1];e.push(c.invert(r))}return e}}}var i1=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},a1=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},o1=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},s1=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},l1=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},c1=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},u1=function(t,e,n,r,i){var t=c1(t,2),a=t[0],t=t[1],o=U();return a=[a,t],(t=o)[0]=a[0],t[1]=0,t[2]=0,t[3]=0,t[4]=a[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},h1=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},f1=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||((r=r||Array.prototype.slice.call(e,0,i))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},d1=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},p1=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},g1=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},y1=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o};function m1(t){return 1/Math.tan(t)}function v1(t,e,n,r,i){var a=m1(y1(t,1)[0]);return{transform:function(t){var t=y1(t,2),e=t[0],t=t[1];return[e+t*a,t]},untransform:function(t){var t=y1(t,2),e=t[0],t=t[1];return[e-t*a,t]}}}function b1(t,e,n,r,i){var a=m1(y1(t,1)[0]);return{transform:function(t){var t=y1(t,2),e=t[0];return[e,t[1]+e*a]},untransform:function(t){var t=y1(t,2),e=t[0];return[e,t[1]-e*a]}}}var x1=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o};function w1(t,e,n,r,i){var a=t<e,i=(a?e-r:i-e)||i-r,r=a?-1:1;return r*i*(n+1)/(n+i/((t-e)*r))+e}function M1(t,e,n,r,i){var a=t<e,i=(a?e-r:i-e)||i-r;return i/(i*(n+1)/(t-e)-n*(a?-1:1))+e}function O1(t,e,n){return n?new wg({range:[0,1],domain:[0,e]}).map(t):t}function k1(t,e,n,r,i){var a=(t=x1(t,3))[0],o=t[1],t=t[2],s=O1(a,r,void 0!==t&&t);return{transform:function(t){var t=x1(t,2),e=t[0],t=t[1];return[w1(e,s,o,0,1),t]},untransform:function(t){var t=x1(t,2),e=t[0],t=t[1];return[M1(e,s,o,0,1),t]}}}function E1(t,e,n,r,i){var a=(t=x1(t,3))[0],o=t[1],t=t[2],s=O1(a,i,void 0!==t&&t);return{transform:function(t){t=x1(t,2);return[t[0],w1(t[1],s,o,0,1)]},untransform:function(t){t=x1(t,2);return[t[0],M1(t[1],s,o,0,1)]}}}function S1(t,e,n,r,i){var a=(t=x1(t,5))[0],o=t[1],s=t[2],l=t[3],t=t[4],c=O1(a,r,t=void 0!==t&&t),u=O1(o,i,t);return{transform:function(t){var t=x1(t,2),e=t[0],t=t[1];return[w1(e,c,s,0,1),w1(t,u,l,0,1)]},untransform:function(t){var t=x1(t,2),e=t[0],t=t[1];return[M1(e,c,s,0,1),M1(t,u,l,0,1)]}}}function A1(t,e,n,r,i){var a=(t=x1(t,5))[0],o=t[1],s=t[2],l=t[3],t=void 0!==(t=t[4])&&t,c=new wg({range:[0,r]}),u=new wg({range:[0,i]}),h=t?a:c.map(a),f=t?o:u.map(o);return{transform:function(t){var t=x1(t,2),e=t[0],t=t[1],n=c.map(e)-h,r=u.map(t)-f,i=Math.sqrt(n*n+r*r);return s<i?[e,t]:(e=w1(i,0,l,0,s),t=Math.atan2(r,n),i=h+e*Math.cos(t),r=f+e*Math.sin(t),[c.invert(i),u.invert(r)])},untransform:function(t){var t=x1(t,2),e=t[0],t=t[1],n=c.map(e)-h,r=u.map(t)-f,i=Math.sqrt(n*n+r*r);return s<i?[e,t]:(e=M1(i,0,l,0,s),t=Math.atan2(r,n),i=h+e*Math.cos(t),r=f+e*Math.sin(t),[c.invert(i),u.invert(r)])}}}var _1=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},T1=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||((r=r||Array.prototype.slice.call(e,0,i))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},P1=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{value:(t=t&&r>=t.length?void 0:t)&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},C1=(L1.prototype.update=function(t){this.options=t0({},this.options,t),this.recoordinate()},L1.prototype.clone=function(){return new L1(this.options)},L1.prototype.getOptions=function(){return this.options},L1.prototype.clear=function(){this.update({transformations:[]})},L1.prototype.getSize=function(){var t=this.options;return[t.width,t.height]},L1.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y;return[(2*e+t.width)/2,(2*n+t.height)/2]},L1.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:T1(T1([],_1(n),!1),[T1([],_1(t),!1)],!1)}),this},L1.prototype.map=function(t){return this.output(t)},L1.prototype.invert=function(t){return this.input(t)},L1.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},L1.prototype.compose=function(t){function e(t,e){var i;l.push((e=void 0===e?!0:e)?(i=t,function(t){for(var e=[],n=0;n<t.length-1;n+=2){var r=[t[n],t[n+1]],r=i(r);e.push.apply(e,o0([],a0(r),!1))}return e}):t)}var n,r,i,a=(t=void 0===t?!1:t)?T1([],_1(this.options.transformations),!1).reverse():this.options.transformations,o=t?function(t){return t.untransform}:function(t){return t.transform},s=[],l=[];try{for(var c=P1(a),u=c.next();!u.done;u=c.next()){var h,f,d,p,g,y,m=_1(u.value),v=m[0],b=m.slice(1),x=this.transformers[v];x&&(f=(h=this.options).x,d=h.y,p=h.width,g=h.height,y=x(T1([],_1(b),!1),f,d,p,g),(i=y)instanceof Float32Array||i instanceof Array?s.push(y):(s.length&&(e(this.createMatrixTransform(s,t)),s.splice(0,s.length)),e(o(y)||e0,"parallel"!==v)))}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return s.length&&e(this.createMatrixTransform(s,t)),function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t?e.reduce(function(e,n){return function(t){return n(e(t))}},t):e0}.apply(void 0,T1([],_1(l),!1))},L1.prototype.createMatrixTransform=function(t,e){var n,r,i,a,o,s,l,c,u,h,f,d,p=U();return e&&t.reverse(),t.forEach(function(t){return K(p,p,t)}),e&&(e=t=p,(d=new $(9))[0]=e[0],d[1]=e[1],d[2]=e[2],d[3]=e[3],d[4]=e[4],d[5]=e[5],d[6]=e[6],d[7]=e[7],d[8]=e[8],d=(e=d)[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=(e=e[8])*a-o*l,f=d*c+n*(u=-e*i+o*s)+r*(h=l*i-a*s))&&(t[0]=c*(f=1/f),t[1]=(-e*n+r*l)*f,t[2]=(o*n-r*a)*f,t[3]=u*f,t[4]=(e*d-r*s)*f,t[5]=(-o*d+r*i)*f,t[6]=h*f,t[7]=(-l*d+n*s)*f,t[8]=(a*d-n*i)*f),function(t){t=[t[0],t[1],1];return Gt(t,t,p),[t[0],t[1]]}},L1);function L1(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:$g,translate:l0,custom:Ug,matrix:Xg,polar:Kg,transpose:Zg,scale:u1,"shear.x":v1,"shear.y":b1,reflect:Qg,"reflect.x":Jg,"reflect.y":t1,rotate:e1,helix:n1,parallel:r1,fisheye:S1,"fisheye.x":k1,"fisheye.y":E1,"fisheye.circular":A1},this.update(t)}function N1(e,n){const r=t=>{return"string"!=typeof t?t:n[t=e+"."+t]||ap("Unknown Component: "+t)};return[(t,e)=>{var n=t["type"],t=at(t,["type"]);return r(n)(t,e)},r]}function j1(t){var{canvas:t,group:e}=t;return e?e.ownerDocument:t.document}function R1(t,e){var{coordinate:n={}}=t,t=at(t,["coordinate"]),{type:r,transform:i=[]}=n,n=at(n,["type","transform"]);if(!r)return Object.assign(Object.assign({},t),{coordinates:i});var[,e]=N1("coordinate",e),{transform:e=!1}=e(r).props||{};if(e)throw new Error(`Unknown coordinate: ${r}.`);return Object.assign(Object.assign({},t),{coordinates:[Object.assign({type:r},n),...i]})}function I1(t,e){return t.filter(t=>t.type===e)}function B1(t){return 0<I1(t,"polar").length}function D1(t){return I1(t,"transpose").length%2==1}function F1(t){return 0<I1(t,"theta").length}function z1(t){return 0<I1(t,"radial").length}function h(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}_l=h("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),Rl=h("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),zl=h("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),Hs=h("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),el=h("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),i=h("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),S=h("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),Zs=h("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),Xs=h("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),ol=h("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function W1(t,e,n){(t.prototype=e.prototype=n).constructor=t}function G1(t,e){var n,r=Object.create(t.prototype);for(n in e)r[n]=e[n];return r}function H1(){}var V1=1/.7,n="\\s*([+-]?\\d+)\\s*",uu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",rl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Y1=/^#([0-9a-f]{3,8})$/,q1=new RegExp(`^rgb\\(${n},${n},${n}\\)$`),$1=new RegExp(`^rgb\\(${rl},${rl},${rl}\\)$`),U1=new RegExp(`^rgba\\(${n},${n},${n},${uu}\\)$`),X1=new RegExp(`^rgba\\(${rl},${rl},${rl},${uu}\\)$`),K1=new RegExp(`^hsl\\(${uu},${rl},${rl}\\)$`),Z1=new RegExp(`^hsla\\(${uu},${rl},${rl},${uu}\\)$`),Q1={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 J1(){return this.rgb().formatHex()}function ty(){return this.rgb().formatRgb()}function ey(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Y1.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?ny(e):3===n?new oy(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?ry(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?ry(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=q1.exec(t))?new oy(e[1],e[2],e[3],1):(e=$1.exec(t))?new oy(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=U1.exec(t))?ry(e[1],e[2],e[3],e[4]):(e=X1.exec(t))?ry(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=K1.exec(t))?fy(e[1],e[2]/100,e[3]/100,1):(e=Z1.exec(t))?fy(e[1],e[2]/100,e[3]/100,e[4]):Q1.hasOwnProperty(t)?ny(Q1[t]):"transparent"===t?new oy(NaN,NaN,NaN,0):null}function ny(t){return new oy(t>>16&255,t>>8&255,255&t,1)}function ry(t,e,n,r){return new oy(t=r<=0?e=n=NaN:t,e,n,r)}function iy(t){return(t=t instanceof H1?t:ey(t))?new oy((t=t.rgb()).r,t.g,t.b,t.opacity):new oy}function ay(t,e,n,r){return 1===arguments.length?iy(t):new oy(t,e,n,null==r?1:r)}function oy(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function sy(){return"#"+hy(this.r)+hy(this.g)+hy(this.b)}function ly(){var t=cy(this.opacity);return(1===t?"rgb(":"rgba(")+uy(this.r)+`, ${uy(this.g)}, `+uy(this.b)+(1===t?")":`, ${t})`)}function cy(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function uy(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function hy(t){return((t=uy(t))<16?"0":"")+t.toString(16)}function fy(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||1<=n?t=e=NaN:e<=0&&(t=NaN),new py(t,e,n,r)}function dy(t){var e,n,r,i,a,o,s,l;return t instanceof py?new py(t.h,t.s,t.l,t.opacity):(t=t instanceof H1?t:ey(t))?t instanceof py?t:(e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=NaN,l=((a=Math.max(e,n,r))+i)/2,(s=a-i)?(o=e===a?(n-r)/s+6*(n<r):n===a?(r-e)/s+2:(e-n)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=0<l&&l<1?0:o,new py(o,s,l,t.opacity)):new py}function py(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function gy(t){return(t=(t||0)%360)<0?t+360:t}function yy(t){return Math.max(0,Math.min(1,t||0))}function my(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}W1(H1,ey,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:J1,formatHex:J1,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return dy(this).formatHsl()},formatRgb:ty,toString:ty}),W1(oy,ay,G1(H1,{brighter(t){return t=null==t?V1:Math.pow(V1,t),new oy(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new oy(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new oy(uy(this.r),uy(this.g),uy(this.b),cy(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:sy,formatHex:sy,formatHex8:function(){return"#"+hy(this.r)+hy(this.g)+hy(this.b)+hy(255*(isNaN(this.opacity)?1:this.opacity))},formatRgb:ly,toString:ly})),W1(py,function(t,e,n,r){return 1===arguments.length?dy(t):new py(t,e,n,null==r?1:r)},G1(H1,{brighter(t){return t=null==t?V1:Math.pow(V1,t),new py(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new py(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,e=n+(n<.5?n:1-n)*e,n=2*n-e;return new oy(my(240<=t?t-240:120+t,n,e),my(t,n,e),my(t<120?240+t:t-120,n,e),this.opacity)},clamp(){return new py(gy(this.h),yy(this.s),yy(this.l),cy(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(){var t=cy(this.opacity);return(1===t?"hsl(":"hsla(")+gy(this.h)+`, ${100*yy(this.s)}%, ${100*yy(this.l)}%`+(1===t?")":`, ${t})`)}}));const vy=Math.PI/180,by=180/Math.PI;var xy=1.78277,wy=-.29227,My=-.90649,Oy=1.97294,ky=Oy*My,Ey=Oy*xy,Sy=xy*wy- -.14861*My;function Ay(t,e,n,r){return 1===arguments.length?(i=t)instanceof _y?new _y(i.h,i.s,i.l,i.opacity):(a=(i=i instanceof oy?i:iy(i)).r/255,o=i.g/255,l=i.b/255,l=(Oy*(o-(a=(Sy*l+ky*a-Ey*o)/(Sy+ky-Ey)))-wy*(o=l-a))/My,new _y((l=(s=Math.sqrt(l*l+o*o)/(Oy*a*(1-a)))?Math.atan2(l,o)*by-120:NaN)<0?l+360:l,s,a,i.opacity)):new _y(t,e,n,null==r?1:r);var i,a,o,s,l}function _y(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}W1(_y,Ay,G1(H1,{brighter(t){return t=null==t?V1:Math.pow(V1,t),new _y(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new _y(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*vy,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),t=Math.sin(t);return new oy(255*(e+n*(-.14861*r+xy*t)),255*(e+n*(wy*r+My*t)),255*(e+Oy*r*n),this.opacity)}}));var Ty=t=>()=>t;function Py(e,n){return function(t){return e+t*n}}function Cy(a){return 1==(a=+a)?Ly:function(t,e){return e-t?(n=t,r=e,i=a,n=Math.pow(n,i),r=Math.pow(r,i)-n,i=1/i,function(t){return Math.pow(n+t*r,i)}):Ty(isNaN(t)?e:t);var n,r,i}}function Ly(t,e){var n=e-t;return n?Py(t,n):Ty(isNaN(t)?e:t)}!function t(e){var o=Cy(e);function n(e,t){var n=o((e=ay(e)).r,(t=ay(t)).r),r=o(e.g,t.g),i=o(e.b,t.b),a=Ly(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=r(t),e.b=i(t),e.opacity=a(t),e+""}}return n.gamma=t,n}(1);Ny=function(s){var l=s.length-1;return function(t){var e,n=t<=0?t=0:1<=t?l-(t=1):Math.floor(t*l),r=s[n],i=s[n+1],a=0<n?s[n-1]:2*r-i,o=n<l-1?s[n+2]:2*i-r;return((1-3*(t=(t-n/l)*l)+3*(n=t*t)-(e=n*t))*a+(4-6*n+3*e)*r+(1+3*t+3*n-3*e)*i+e*o)/6}};var Ny,jy=function(t){for(var e,n=t.length,r=new Array(n),i=new Array(n),a=new Array(n),o=0;o<n;++o)e=ay(t[o]),r[o]=e.r||0,i[o]=e.g||0,a[o]=e.b||0;return r=Ny(r),i=Ny(i),a=Ny(a),e.opacity=1,function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e+""}};function Ry(s){return function t(o){function e(e,t){var n=s((e=Ay(e)).h,(t=Ay(t)).h),r=Ly(e.s,t.s),i=Ly(e.l,t.l),a=Ly(e.opacity,t.opacity);return function(t){return e.h=n(t),e.s=r(t),e.l=i(Math.pow(t,o)),e.opacity=a(t),e+""}}return o=+o,e.gamma=t,e}(1)}Ry(function(t,e){var n=e-t;return n?Py(t,180<n||n<-180?n-360*Math.round(n/360):n):Ty(isNaN(t)?e:t)});var So=Ry(Ly),Co=t=>jy(t[t.length-1]),Vo=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(h),fn=Co(Vo),e=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(h),ii=Co(e),o=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(h),Ys=Co(o),_o=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(h),Js=Co(_o),No=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(h),Ro=Co(No),zo=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(h),qo=Co(zo),Uo=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(h),Ko=Co(Uo),Qo=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(h),es=Co(Qo),rs=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(h),as=Co(rs),Ss=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(h),Ws=Co(Ss),zs=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(h),Go=Co(zs),Ol=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(h),$s=Co(Ol),n=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(h),rl=Co(n),uu=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(h),Iy=Co(uu),By=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(h),Dy=Co(By),Fy=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(h),zy=Co(Fy),Wy=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(h),Gy=Co(Wy),Hy=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(h),Vy=Co(Hy),Yy=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(h),qy=Co(Yy),$y=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(h),Uy=Co($y),Xy=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(h),Ky=Co(Xy),Zy=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(h),Qy=Co(Zy),Jy=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(h),tm=Co(Jy),em=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(h),nm=Co(em),rm=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(h),im=Co(rm),am=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(h),om=Co(am),sm=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(h),Co=Co(sm);var lm=So(Ay(300,.5,0),Ay(-240,.5,1)),cm=So(Ay(-100,.75,.35),Ay(80,1.5,.8)),So=So(Ay(260,.75,.35),Ay(80,1.5,.8)),um=Ay();var hm=ay(),fm=Math.PI/3,dm=2*Math.PI/3;function pm(e){var n=e.length;return function(t){return e[Math.max(0,Math.min(n-1,Math.floor(t*n)))]}}var gm=pm(h("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),ym=pm(h("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),mm=pm(h("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),vm=pm(h("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),bm=Object.freeze({__proto__:null,schemeCategory10:_l,schemeAccent:Rl,schemeDark2:zl,schemePaired:Hs,schemePastel1:el,schemePastel2:i,schemeSet1:S,schemeSet2:Zs,schemeSet3:Xs,schemeTableau10:ol,interpolateBrBG:fn,schemeBrBG:Vo,interpolatePRGn:ii,schemePRGn:e,interpolatePiYG:Ys,schemePiYG:o,interpolatePuOr:Js,schemePuOr:_o,interpolateRdBu:Ro,schemeRdBu:No,interpolateRdGy:qo,schemeRdGy:zo,interpolateRdYlBu:Ko,schemeRdYlBu:Uo,interpolateRdYlGn:es,schemeRdYlGn:Qo,interpolateSpectral:as,schemeSpectral:rs,interpolateBuGn:Ws,schemeBuGn:Ss,interpolateBuPu:Go,schemeBuPu:zs,interpolateGnBu:$s,schemeGnBu:Ol,interpolateOrRd:rl,schemeOrRd:n,interpolatePuBuGn:Iy,schemePuBuGn:uu,interpolatePuBu:Dy,schemePuBu:By,interpolatePuRd:zy,schemePuRd:Fy,interpolateRdPu:Gy,schemeRdPu:Wy,interpolateYlGnBu:Vy,schemeYlGnBu:Hy,interpolateYlGn:qy,schemeYlGn:Yy,interpolateYlOrBr:Uy,schemeYlOrBr:$y,interpolateYlOrRd:Ky,schemeYlOrRd:Xy,interpolateBlues:Qy,schemeBlues:Zy,interpolateGreens:tm,schemeGreens:Jy,interpolateGreys:nm,schemeGreys:em,interpolatePurples:im,schemePurples:rm,interpolateReds:om,schemeReds:am,interpolateOranges:Co,schemeOranges:sm,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:lm,interpolateRainbow:function(t){(t<0||1<t)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return um.h=360*t-100,um.s=1.5-1.5*e,um.l=.8-.9*e,um+""},interpolateWarm:cm,interpolateCool:So,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,hm.r=255*(e=Math.sin(t))*e,hm.g=255*(e=Math.sin(t+fm))*e,hm.b=255*(e=Math.sin(t+dm))*e,hm+""},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:gm,interpolateMagma:ym,interpolateInferno:mm,interpolatePlasma:vm});function xm(t,e,n,r,i,a){var o,s,{guide:l={}}=n,c=function(t,e,n){var{type:n,domain:r,range:i,quantitative:a,ordinal:o}=n;return void 0!==n?n:function(t){return jm(t,hp)}(e)?"identity":"string"==typeof i?"linear":2<(r||i||[]).length?_m(t,o):void 0===r?Lm(e)?_m(t,o):Nm(e)?"time":Tm(t,i,a):Lm([r])?_m(t,o):Nm(e)?"time":Tm(t,i,a)}(t,e,n);return"string"!=typeof c?n:(s=function(t,e,n){const r=n["ratio"];if(void 0===r||null===r)return e;if(Em({type:t}))return function(t,e,n){const r=t.map(Number),i=new wg({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 Sm({type:t})?(n=e,t=r,t=Math.round(n.length*r),n.slice(0,t)):e}(c,o=function(t,e,n){var r=n["domain"];if(void 0!==r)return r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":case"quantize":case"threshold":return Pm(function(t,e){var{zero:e=!1}=e;let n=1/0,r=-1/0;for(const i of t)for(const a of i)sp(a)&&(n=Math.min(n,+a),r=Math.max(r,+a));return n===1/0?[]:e?[Math.min(0,n),r]:[n,r]}(e,n),n);case"band":case"ordinal":case"point":return Cm(e);case"quantile":return function(t){return Cm(t).sort()}(e);case"sequential":return Pm(function(t){let e=1/0,n=-1/0;for(const r of t)for(const i of r)sp(i)&&(e=Math.min(e,+i),n=Math.max(n,+i));return e===1/0?[]:[e<0?-n:e,n]}(e),n);default:return[]}}(c,e,n),n),Object.assign(Object.assign(Object.assign({},n),function(t,e,n,r){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return function(t){var{interpolate:e=Z0,nice:n=!1,tickCount:r=5}=t;return Object.assign(Object.assign({},t),{interpolate:e,nice:n,tickCount:r})}(n);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});var t=function(t,e,n){return"enterDelay"===e||"enterDuration"===e||"size"===e?0:"band"===t?F1(n)?0:.1:"point"===t?.5:0}(t,e,n),{paddingInner:e=t,paddingOuter:n=t}=r;return Object.assign(Object.assign({},r),{paddingInner:e,paddingOuter:n,padding:t,unknown:NaN})}(t,e,r,n);case"sequential":return function(t){const{palette:e="ylGnBu",offset:n}=t,r=Ue(e),i=bm["interpolate"+r];if(i)return{interpolator:n?t=>i(n(t)):i};throw new Error("Unknown palette: "+r)}(n);default:return n}}(c,t,n,r)),{domain:s,range:function(t,e,n,r,i,a,o){var s=r["range"];if("string"==typeof s)return s.split("-");if(void 0!==s)return s;var{rangeMin:l,rangeMax:c}=r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":var u=Am(n,r,i,a,o),[u,h]=function(t,e){return"enterDelay"===t?[0,1e3]:"enterDuration"==t?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:"color"===t?[e[0],Tp(e)]:"opacity"!==t&&"size"===t?[1,10]:[0,1]}(e,u);return[l||u,c||h];case"band":case"point":return[l||("size"===e?5:0),c||("size"===e?10:1)];case"ordinal":return Am(n,r,i,a,o);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}(c,t,e,n,s,i,a),expectedDomain:o,guide:l,name:t,type:c}))}function wm(t,e){var{components:e=[]}=e,n=["scale","encode","axis","legend","data","transform"],r=Array.from(new Set(t.flatMap(t=>t.channels.map(t=>t.scale)))),i=new Map(r.map(t=>[t.name,t]));for(const l of e)for(const c of function(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)):[]}(l)){var a=i.get(c),o=(null==(o=l.scale)?void 0:o[c])||{},{independent:s=!1}=o;a&&!s?(s=a["guide"],a.guide=ot({},"boolean"==typeof s?{}:s,l),Object.assign(a,o)):(s=Object.assign(Object.assign({},o),{expectedDomain:o.domain,name:c,guide:rn(l,n)}),r.push(s))}return r}function Mm(t,e){var n,r=Object.keys(t);for(const i of Object.values(e)){const{name:a,key:o}=i.getOptions();"string"==typeof o?o in t||(t[o]=i):a in t?(n=Hd(r.filter(t=>t.startsWith(a)).map(t=>+(t.replace(a,"")||0)))+1,(t[n=""+a+n]=i).getOptions().key=n):t[a]=i}}function Om(t,e){var[e]=N1("scale",e),n=t["relations"],[n]=function(o){if(!o||!Array.isArray(o))return[np,np];let s,l;return[t=>{s=t.map.bind(t),l=null==(e=t.invert)?void 0:e.bind(t);const r=o.filter(([t])=>"function"==typeof t);var e=o.filter(([t])=>"function"!=typeof t);const i=new Map(e);if(t.map=t=>{for(var[e,n]of r)if(e(t))return n;return i.has(t)?i.get(t):s(t)},l){const n=new Map(e.map(([t,e])=>[e,t])),a=new Map(r.map(([t,e])=>[e,t]));t.invert=t=>a.has(t)?t:n.has(t)?n.get(t):l(t)}return t},t=>(null!==s&&(t.map=s),null!==l&&(t.invert=l),t)]}(n);return n(e(t))}function km(t,n){var t=t.filter(({name:t,facet:e=!0})=>e&&t===n),e=t.flatMap(t=>t.domain),r=t.every(Em)?wd(e):t.every(Sm)?Array.from(new Set(e)):null;if(null!==r)for(const i of t)i.domain=r}function Em(t){t=t.type;return"string"==typeof t&&["linear","log","pow","time"].includes(t)}function Sm(t){t=t.type;return"string"==typeof t&&["band","point","ordinal"].includes(t)}function Am(t,e,n,r,i){var[i]=N1("palette",i),{category10:r,category20:a}=r,t=(t=t.flat(),Array.from(new Set(t)).length<=r.length?r:a),{palette:r=t,offset:a}=e;try{return i({type:r})}catch(t){e=function(t,n,r=t=>t){if(!t)return null;const e=Ue(t),i=bm["scheme"+e],a=bm["interpolate"+e];if(!i&&!a)return null;if(i){if(!i.some(Array.isArray))return i;t=i[n.length];if(t)return t}return n.map((t,e)=>a(r(e/n.length)))}(r,n,a);if(e)return e;throw new Error(`Unknown Component: ${r} `)}}function _m(t,e){return e||((e=t).startsWith("x")||e.startsWith("y")||e.startsWith("position")||e.startsWith("size")?"point":"ordinal")}function Tm(t,e,n){return n||("color"!==t||e?"linear":"sequential")}function Pm(t,e){var n,r;return 0===t.length?t:({domainMin:e,domainMax:n}=e,[t,r]=t,[null!=e?e:t,null!=n?n:r])}function Cm(t){return Array.from(new Set(t.flat()))}function Lm(t){return jm(t,t=>{t=typeof t;return"string"==t||"boolean"==t})}function Nm(t){return jm(t,t=>t instanceof Date)}function jm(t,e){for(const n of t)if(n.some(e))return!0;return!1}const Rm={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},Im={threshold:"threshold",quantize:"quantize",quantile:"quantile"},Bm={ordinal:"ordinal",band:"band",point:"point"},Dm={constant:"constant"};function Fm(t,e,n){const{coordinates:b=[],title:r}=e,[,x]=N1("component",n),w=t.filter(({guide:t})=>null!==t),M=[];var i,e=function(t,e,n){const[,o]=N1("component",n),s=t["coordinates"];function i(t,e,n,r){[e,t,i=[]]=[e,t,s];var i,a,e="x"===e?D1(i)?t+"Y":t+"X":"y"===e?D1(i)?t+"X":t+"Y":null;if(r&&e)return i=o(e)["props"],{defaultPosition:t,defaultSize:i,defaultOrder:a}=i,Object.assign(Object.assign({position:t,defaultSize:i,order:a,type:e},r),{scales:[n]})}return e.filter(t=>t.slider||t.scrollbar).flatMap(t=>{var{slider:e,scrollbar:n,name:r}=t;return[i("slider",r,t,e),i("scrollbar",r,t,n)]}).filter(t=>!!t)}(e,t,n);return M.push(...e),r&&(t=x("title")["props"],{defaultPosition:n,defaultOrientation:e,defaultOrder:t,defaultSize:i}=t,M.push(Object.assign({type:"title",position:n,orientation:e,order:t,defaultSize:i},"string"==typeof r?{title:r}:r))),function(t,e){t=t.filter(t=>{return!!((t=t)&&t.type&&("function"==typeof t.type||({type:t,domain:n,range:r,interpolator:e}=t,n=n&&0<n.length,r=r&&0<r.length,["linear","sqrt","log","time","pow","threshold","quantize","quantile","ordinal","band","point"].includes(t)&&n&&r)||["sequential"].includes(t)&&n&&(r||e)||["constant","identity"].includes(t)&&r));var e,n,r});return[...function(t){const n=["shape","size","color","opacity"],e=t.filter(({type:t,name:e})=>"string"==typeof t&&n.includes(e)&&!("constant"===t&&"size"===e)),r=e.filter(({type:t})=>"constant"===t),i=e.filter(({type:t})=>"constant"!==t),a=Ad(i,t=>t.field||Symbol("independent")).map(([t,e])=>[t,[...e,...r]]).filter(([,t])=>t.some(t=>"constant"!==t.type)),o=new Map(a);if(0===o.size)return[];const l=t=>t.sort(([t],[e])=>t.localeCompare(e)),s=Array.from(o).map(([,t])=>{var e,n,r,i,a=function(e){if(1===e.length)return[e];var n=[];for(let t=1;t<=e.length;t++)n.push(...Cp(e,t));return n}(t).sort((t,e)=>e.length-t.length).map(t=>({combination:t,option:t.map(t=>[t.name,function(t){t=t.type;return"string"!=typeof t?null:t in Rm?"continuous":t in Bm?"discrete":t in Im?"distribution":t in Dm?"constant":null}(t)])}));for({option:e,combination:n}of a)if(!e.every(t=>"constant"===t[1])&&e.every(t=>"discrete"===t[1]||"constant"===t[1]))return["legendCategory",n];for([r,i]of Hp)for(const{option:o,combination:s}of a)if(i.some(t=>on(l(t),l(o))))return[r,s];return null}).filter(sp);return s}(t),...function(t,n){return t.map(t=>{var e=t["name"];if(!(0<I1(n,"helix").length||F1(n))&&(!D1(n)||!B1(n)&&!z1(n))){if(e.startsWith("x"))return B1(n)?["axisArc",[t]]:z1(n)?["axisLinear",[t]]:[D1(n)?"axisY":"axisX",[t]];if(e.startsWith("y"))return B1(n)?["axisLinear",[t]]:z1(n)?["axisArc",[t]]:[D1(n)?"axisX":"axisY",[t]];if(e.startsWith("position")){if(0<I1(n,"radar").length)return["axisRadar",[t]];if(!B1(n))return["axisY",[t]]}}return null}).filter(sp)}(t,e)]}(w,b).forEach(([t,e])=>{var n=x(t)["props"],{defaultPosition:r,defaultOrientation:i,defaultSize:a,defaultOrder:o,defaultLength:s,defaultPadding:l=[0,0],defaultCrossPadding:c=[0,0]}=n,{guide:n,field:u}=ot({},...e);for(const v of Array.isArray(n)?n:[n]){var h,f,d,p,g,[y,m]=function(t,e,n,r,i,a,o){var[s]=Gm(o),e=[r.position||e,null!=s?s:n];if("string"==typeof t&&t.startsWith("axis"))return function(t,e,n,r,i){n=n[0].name;{var a,o;if("axisRadar"===t)return r=r.filter(t=>t.name.startsWith("position")),a=Hm(n),n===r.slice(-1)[0].name||null===a?[null,null]:([o,s]=Gm(i),["center",(s-o)/(r.length-1)*a+o])}{var s;if("axisY"===t&&function(t){return 0<I1(t,"parallel").length}(i))return null===(s=Hm(n))?e:D1(i)?0===s?["top",null]:["center","horizontal"]:0===s?e:["center","vertical"]}if("axisLinear"===t)return[r]=Gm(i),["center",r];if("axisArc"===t)return"inner"===e[0]?["inner",null]:["outer",null];if(B1(i))return["center",null];if(z1(i))return["center",null];if("axisX"===t&&function(t){return 0<I1(t,"reflect").length}(i)||"axisX"===t&&function(t){return 0<I1(t,"reflectY").length}(i))return["top",null];return e}(t,e,i,a,o);if("string"==typeof t&&t.startsWith("legend")&&B1(o)&&"center"===r.position)return["center","vertical"];return e}(t,r,i,v,e,w,b);(y||m)&&(p=(g="left"===y||"right"===y)?l[1]:l[0],g=g?c[1]:c[0],{size:h,order:f=o,length:d=s,padding:p=p,crossPadding:g=g}=v,M.push(Object.assign(Object.assign({title:u},v),{defaultSize:a,length:d,position:y,orientation:m,padding:p,order:f,crossPadding:g,size:h,type:t,scales:e})))}}),M}function zm(t,e,n,r,i){var[a]=N1("component",r),{scaleInstances:o,scale:s,bbox:l}=t,l={bbox:l,library:r};return a(at(t,["scaleInstances","scale","bbox"]))({coordinate:e,library:r,markState:i,scales:o,theme:n,value:l,scale:s})}function Wm(t,o){const r=["left","right","bottom","top"];return Ad(t,({type:t,position:e,group:n})=>r.includes(e)?void 0===n?t.startsWith("legend")?"legend-"+e:Symbol("independent"):"independent"===n?Symbol("independent"):n:Symbol("independent")).flatMap(([,t],e)=>{if(1===t.length)return t[0];if(void 0!==o){var n=t.filter(t=>void 0!==t.length).map(t=>t.length),r=ep(n);if(o<r)return t.forEach(t=>t.group=Symbol("independent")),t;const a=(o-r)/(t.length-n.length);t.forEach(t=>{void 0===t.length&&(t.length=a)})}var r=Hd(t,t=>t.size),n=Hd(t,t=>t.order),i=Hd(t,t=>t.crossPadding);return{type:"group",size:r,order:n,position:t[0].position,children:t,crossPadding:i}})}function Gm(t){var e,n=I1(t,"polar");return n.length?(n=n[n.length-1],{startAngle:n,endAngle:e}=Np(n),[n,e]):(n=I1(t,"radial")).length?(e=n[n.length-1],{startAngle:t,endAngle:n}=Dp(e),[t,n]):[-Math.PI/2,Math.PI/2*3]}function Hm(t){t=/position(\d*)/g.exec(t);return t?+t[1]:null}function Vm(t,e,n,r,i,a){var o=t["type"];if(["left","right","bottom","top"].includes(r)&&"string"==typeof o){const s=o;return(s.startsWith("axis")?Um:s.startsWith("group")?Ym:s.startsWith("legendContinuous")?Xm:"legendCategory"===s?Km:s.startsWith("slider")?$m:"title"===s?qm:()=>{})(t,e,n,r,i,a)}}function Ym(t,e,n,r,i,a){var o=t["children"];const s=Hd(o,t=>t.crossPadding),l=(o.forEach(t=>t.crossPadding=s),o.forEach(t=>Vm(t,e,n,r,i,a)),Hd(o,t=>t.size));t.size=l,o.forEach(t=>t.size=l)}function qm(t,e,n,r,i,a){var i=ot({},i.title,t),{title:o,subtitle:s,spacing:l=0}=i,i=at(i,["title","subtitle","spacing"]);o&&(o=nv(o,st(i,"title")),t.size=o.height),s&&(o=nv(s,st(i,"subtitle")),t.size+=l+o.height)}function $m(t,e,n,r,i,a){i=i.slider;var{trackSize:i,handleIconSize:o}=ot({},i,t),i=Math.max(i,2.4*o);t.size=i}function Um(t,e,n,r,i,a){t.transform=t.transform||[{type:"hide"}];var o,s,l,c="left"===r||"right"===r,r=tv(t,r,i),{tickLength:i=0,labelSpacing:u=0,titleSpacing:h=0}=r,r=at(r,["tickLength","labelSpacing","titleSpacing"]),a=Zm(t,a),f=Qm(r,a),i=i+u,a=(f?(u=Hd(f,t=>t.width),o=Hd(f,t=>t.height),c?t.size=u+i:({tickFilter:s,labelTransform:l}=t,!function(t,e,n,r,i){var a=ep(e,t=>t.width);if(n<a)return 1;const o=t.clone(),s=(o.update({range:[0,n]}),ev(t,i)),l=s.map(t=>o.map(t)+function(t,e){if(!t.getBandWidth)return 0;t=t.getBandWidth(e)/2;return t}(o,t)),c=s.map((t,e)=>e),u=-r[0],h=n+r[1],f=(t,e)=>{e=e.width;return[t-e/2,t+e/2]};for(let t=0;t<c.length;t++){var d=l[t],[d,p]=f(d,e[t]);if(d<u||h<p)return 1;d=l[t+1];if(d){var[d]=f(d,e[t+1]);if(d<p)return 1}}return}(a,f,e,n,s)||l?t.size=o+i:(t.labelTransform="rotate(90)",t.size=u+i))):t.size=i,Jm(r));a&&(t.size+=c?h+a.width:h+a.height)}function Xm(t,e,n,r,i,a){i=i.legendContinuous;var i=ot({},i,t),{labelSpacing:o=0,titleSpacing:s=0}=i,i=at(i,["labelSpacing","titleSpacing"]),r="left"===r||"right"===r,l=st(i,"ribbon")["size"],c=st(i,"handleIcon")["size"],l=Math.max(l,2.4*c),c=(t.size=l,Zm(t,a)),l=Qm(i,c);if(l){const u=r?"width":"height";a=Hd(l,t=>t[u]);t.size+=a+o}var c=Jm(i),{crossPadding:l=0}=(c&&(r?t.size=Math.max(t.size,c.width):t.size+=s+c.height),t);t.size+=2*l}function Km(o,s,t,e,n,r){n=n.legendCategory;const i=ot({},n,o),{itemSpacing:a,itemMarkerSize:l,titleSpacing:c,rowPadding:u,colPadding:h}=i,f=at(i,["itemSpacing","itemMarkerSize","titleSpacing","rowPadding","colPadding"]),{cols:d,length:p}=o,g=void 0===p?s:p;n="left"===e||"right"===e;const y=Jm(f),m=Qm(f,Zm(o,r),"itemLabel"),v=Math.max(m[0].height,l)+u,b=(t,e=0)=>l+t+a[0]+e;if(n){let t=-1/0,e=0,n=1,r=0,i=-1/0,a=-1/0;var x,s=y?y.height:0,w=g-s;for({width:x}of m){var M=b(x);t=Math.max(t,M),e+v>w?(n++,i=Math.max(i,r),a=Math.max(a,e),r=1,e=v):(e+=v,r++)}n<=1&&(i=r,a=e),o.size=t*n,o.length=a+s,ot(o,{cols:n,gridRow:i})}else if("number"==typeof d)e=Math.ceil(m.length/d),r=Hd(m,t=>b(t.width))*d,o.size=v*e,o.length=Math.min(r,g);else{let t=1,e=0,n=-1/0;for(var{width:O}of m){O=b(O,h);e+O>g?(n=Math.max(n,e),e=O,t++):e+=O}1===t&&(n=e),o.size=v*t,o.length=n}y&&(n?o.size=Math.max(o.size,y.width):o.size+=c+y.height);var{crossPadding:s=0}=o;o.size+=2*s}function Zm(t,e){var[e]=N1("scale",e),{scales:t,tickCount:n,tickMethod:r}=t,t=t.find(t=>"constant"!==t.type&&"identity"!==t.type);return void 0!==n&&(t.tickCount=n),void 0!==r&&(t.tickMethod=r),e(t)}function Qm(t,e,n="label"){var{labelFormatter:r,tickFilter:i,label:a=!0}=t,o=at(t,["labelFormatter","tickFilter","label"]);if(!a)return null;const s=function(t,e,n){n=ev(t,n),n=n.map(t=>{return"number"==typeof t?(e=t,Math.abs(e)<1e-15?e:parseFloat(e.toFixed(15))):t;var e}),e=e?"string"==typeof e?Op(e):e:t.getFormatter?t.getFormatter():t=>""+t;return n.map(e)}(e,r,i),l=st(o,n),c=s.map((n,r)=>Object.fromEntries(Object.entries(l).map(([t,e])=>[t,"function"==typeof e?e(n,r):e]))),u=s.map((t,e)=>{return nv(t,c[e])});return c.some(t=>t.transform)||(a=s.map((t,e)=>e),t.indexBBox=new Map(a.map(t=>[t,[s[t],u[t]]]))),u}function Jm(t){var e,n,r=t["title"],t=at(t,["title"]);return!1===(e=r)||null===e||void 0===r||({direction:t,transform:n}=e=st(t,"title"),"string"!=typeof(r=Array.isArray(r)?r.join(","):r))?null:nv(r,Object.assign(Object.assign({},e),{transform:n||("vertical"===t?"rotate(-90)":"")}))}function tv(t,e,n){var r=t["title"],[r,i]=Array.isArray(r)?[r,void 0]:[void 0,r],{axis:n,["axis"+ip(e)]:e}=n;return ot({title:r},n,e,Object.assign(Object.assign({},t),{title:i}))}function ev(t,e){t=t.getTicks?t.getTicks():t.getOptions().domain;return e?t.filter(e):t}function nv(t,e){t=(t=t)instanceof tc?t:new Ic({style:{text:""+t}}),t.attr(Object.assign(Object.assign({},e),{visibility:"none"})),e=t.getBBox();return e}function rv(t){t=t.getOptions().transformations;return t.map(([t])=>t).filter(t=>"transpose"===t).length%2!=0}function iv(t){t=t.getOptions().transformations;return t.some(([t])=>"polar"===t)}function av(t){t=t.getOptions().transformations;return t.some(([t])=>"reflect"===t)&&t.some(([t])=>t.startsWith("transpose"))}function ov(t){t=t.getOptions().transformations;return t.some(([t])=>"helix"===t)}function sv(t){t=t.getOptions().transformations;return t.some(([t])=>"parallel"===t)}function lv(t){t=t.getOptions().transformations;return t.some(([t])=>"fisheye"===t)}function cv(t){return ov(t)||iv(t)}function uv(t){var t=t.getOptions()["transformations"],[,,,t,e]=t.find(t=>"polar"===t[0]);return[+t,+e]}function hv(t,e=!0){var t=t.getOptions()["transformations"],[,t,n]=t.find(t=>"polar"===t[0]);return e?[180*+t/Math.PI,180*+n/Math.PI]:[t,n]}function fv(t){return t.replace(/-(\w)/g,function(t,e){return e.toUpperCase()})}function dv(t,o,e,n){var{width:r,height:i,x:a=0,y:s=0,inset:l=0,insetLeft:c=l,insetTop:u=l,insetBottom:h=l,insetRight:l=l,margin:f=0,marginLeft:d=f,marginBottom:p=f,marginTop:g=f,marginRight:f=f,padding:y,paddingBottom:m=y,paddingLeft:v=y,paddingRight:b=y,paddingTop:y=y}=function(t,e,n,r){var i=e["coordinates"];if(!B1(i))return e;i=t.filter(t=>"string"==typeof t.type&&t.type.startsWith("axis"));if(0===i.length)return e;const a=i.map(t=>{return tv(t,"axisArc"===t.type?"arc":"linear",n)}),o=Hd(a,t=>{return null!=(t=t.labelSpacing)?t:0}),s=i.flatMap((t,e)=>{return Qm(a[e],Zm(t,r))}).filter(sp),l=Hd(s,t=>t.height)+o,c=i.flatMap((t,e)=>{return Jm(a[e])}).filter(t=>null!==t),u=0===c.length?0:Hd(c,t=>t.height),{inset:h=l,insetLeft:f=h,insetBottom:d=h,insetTop:p=h+u,insetRight:g=h}=e;return Object.assign(Object.assign({},e),{insetLeft:f,insetBottom:d,insetTop:p,insetRight:g})}(t,o,e,n);var x=(t,e,n,r,i)=>{var a=o["marks"];return 0===a.length||0<t-r-i-.25*t?[r,i]:(a=.75*t/2,["auto"===e?a:r,"auto"===n?a:i])},w=t=>"auto"!==t&&null!=t?t:30,M=w(y),w=w(m),{paddingLeft:M,paddingRight:w}=pv(t,i-M-w,[M,w],["left","right"],o,e,n),O=r-d-f,[v,b]=x(O,v,b,M,w),M=O-v-b,{paddingTop:w,paddingBottom:O}=pv(t,M,[v,b],["bottom","top"],o,e,n),t=i-p-g,[e,n]=x(t,m,y,O,w);return{width:r,height:i,insetLeft:c,insetTop:u,insetBottom:h,insetRight:l,innerWidth:M,innerHeight:t-e-n,paddingLeft:v,paddingRight:b,paddingTop:n,paddingBottom:e,marginLeft:d,marginBottom:p,marginTop:g,marginRight:f,x:a,y:s}}function pv(t,n,r,e,i,a,o){var s=Sd(t,t=>t.position),{padding:t,paddingLeft:i=t,paddingRight:l=t,paddingBottom:c=t,paddingTop:t=t}=i,u={paddingBottom:c,paddingLeft:i,paddingTop:t,paddingRight:l};for(const p of e){var h="padding"+ip(fv(p));const t=s.get(p)||[],g=u[h],y=t=>{void 0===t.size&&(t.size=t.defaultSize)};var f,d=t=>{var e;t.size||("auto"!==g?"group"===(e=t).type?(e.children.forEach(y),e.size=Hd(e.children,t=>t.size)):e.size=e.defaultSize:(Vm(t,n,r,p,a,o),y(t)))};"number"==typeof g?t.forEach(y):0===t.length?u[h]=30:((f=Wm(t,n)).forEach(d),d=f.reduce((t,{size:e})=>t+e,0),u[h]=d)}return u}function gv(t,I,e){var B=Sd(t,t=>t.position),{paddingLeft:t,paddingRight:e,paddingTop:n,paddingBottom:D,marginLeft:r,marginTop:i,marginBottom:F,marginRight:z,innerHeight:a,innerWidth:o,insetBottom:W,insetLeft:s,insetRight:G,insetTop:l,height:c,width:H}=e,t=t+r,r=n+i,n=e+z,i=D+F,e=[t+s,r+l,o-s-G,a-l-W,"center",null,null],V={top:[t,0,o,r,"vertical",!0,fd],right:[H-n,r,n,a,"horizontal",!1,fd],bottom:[t,c-i,o,i,"vertical",!1,fd],left:[0,r,t,a,"horizontal",!0,fd],"top-left":[t,0,o,r,"vertical",!0,fd],"top-right":[t,0,o,r,"vertical",!0,fd],"bottom-left":[t,c-i,o,i,"vertical",!1,fd],"bottom-right":[t,c-i,o,i,"vertical",!1,fd],center:e,inner:e,outer:e};for(const[j,t]of B.entries()){var u=V[j],[h,Y]=Pp(t,t=>"string"==typeof t.type&&("center"===j||!(!t.type.startsWith("axis")||!["inner","outer"].includes(j))));if(h.length){y=g=p=d=f=void 0;var f=h,d=I,p=u,g=j,[f,y]=Pp(f,t=>!("string"!=typeof t.type||!t.type.startsWith("axis"))),h=(b=v=m=h=void 0,f),m=d,v=p,b=g;if("center"===b)if(!function(t){return sv(t)&&iv(t)}(m)){if(iv(m)){f=void 0;g=void 0;x=void 0;w=void 0;M=void 0;O=void 0;f=h;g=v;var[x,w,M,O]=g;for(const it of f)it.bbox={x:x,y:w,width:M,height:O}}else if(sv(m)){g=void 0;f=void 0;k=void 0;E=void 0;g=h;f=m;var k=v;var E=h[0].orientation;"horizontal"===E?function(e,t,n){const[r,i,a]=n,o=new Array(e.length+1).fill(0),s=t.map(o),l=s.filter((t,e)=>e%2==1).map(t=>t+i);for(let t=0;t<e.length;t++){var c=e[t];const i=l[t];var u=l[t+1]-i;c.bbox={x:r,y:i,width:a,height:u}}}(g,f,k):"vertical"===E&&function(e,t,n){const[r,i,,a]=n,o=new Array(e.length+1).fill(0),s=t.map(o),l=s.filter((t,e)=>e%2==0).map(t=>t+r);for(let t=0;t<e.length;t++){var c=e[t];const r=l[t];var u=l[t+1]-r;c.bbox={x:r,y:i,width:u,height:a}}}(g,f,k)}}else{S=void 0;E=void 0;A=void 0;_=void 0;q=void 0;$=void 0;var S=h;E=v;var[A,_,q,$]=E;for(const R of S)R.bbox={x:A,y:_,width:q,height:$},R.radar={index:S.indexOf(R),count:S.length}}else if("inner"===b){T=void 0;g=void 0;f=void 0;U=void 0;X=void 0;k=void 0;P=void 0;C=void 0;K=void 0;Z=void 0;var T=h;g=m;f=v;var[U,X,,f]=f,[k,P]=g.getCenter(),[g]=uv(g),f=f/2,C=g*f,K=k-C,Z=P-C;for(let t=0;t<T.length;t++)T[t].bbox={x:U+K,y:X+Z,width:2*C,height:2*C}}else if("outer"===b){m=void 0;g=void 0;Q=void 0;J=void 0;tt=void 0;et=void 0;m=h;g=v;var[Q,J,tt,et]=g;for(const at of m)at.bbox={x:Q,y:J,width:tt,height:et}}rt=nt=N=v=h=b=P=f=L=void 0;var L=y,f=d,P=p;if(0!==L.length){var[P,b,h,v]=P,[f]=uv(f),N=v/2*f/Math.sqrt(2),nt=P+h/2,rt=b+v/2;for(let t=0;t<L.length;t++)L[t].bbox={x:nt-N,y:rt-N,width:2*N,height:2*N}}}Y.length&&!function(n,t){const[e,r,i,a,o,s,l]=t,[c,u,h,f,d,p,g,y]="vertical"===o?["y",r,"x",e,"height",a,"width",i]:["x",e,"y",r,"width",i,"height",a],m=(n.sort((t,e)=>null===l||void 0===l?void 0:l(t.order,e.order)),s?u+p:u);for(let t=0,e=m;t<n.length;t++){var v=n[t],{crossPadding:b=0}=v,x=v["size"];v.bbox={[c]:s?e-x+b:e+b,[h]:f,[d]:x-2*b,[g]:y},e+=x*(s?-1:1)}t=n.filter(t=>"group"===t.type);for(const A of t){const{bbox:_,children:T}=A;var w=_[g];const P=w/T.length;var M=T.reduce((t,e)=>{e=null==(e=e.layout)?void 0:e.justifyContent;return e||t},"flex-start"),O=T.map((t,e)=>{var{length:t=P,padding:n=0}=t;return t+(e===T.length-1?0:n)}),k=ep(O),w=w-k,k="flex-start"===M?0:"center"===M?w/2:w;for(let t=0,e=_[h]+k;t<T.length;t++){var E=T[t],{padding:S=0}=E,S=t===T.length-1?0:S;E.bbox={[d]:_[d],[c]:_[c],[h]:e,[g]:O[t]-S},ot(E,{layout:{justifyContent:M}}),e+=O[t]}}}(t,u)}}function yv(t,e,n={},r=!1){return fp(t)||Array.isArray(t)&&r?t:(r=st(t,e),ot(n,r))}function mv(t,e={}){return!fp(t)&&!Array.isArray(t)&&vv(t)?ot(e,t):t}function vv(t){var e;return 0===Object.keys(t).length||({title:t,items:e}=t,void 0!==t)||void 0!==e}function bv(t,e){return"object"==typeof t?st(t,e):t}function xv(t,e,n){var{encode:r={},scale:i={},transform:a=[]}=e,e=at(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},e),{encode:r,scale:i,transform:a})]}function wv(t,i,a){return X(this,void 0,void 0,function*(){var t=a["library"],e=i["data"],[t]=N1("data",t),n=function(t){if(!t)return{type:"inline",value:null};if(Array.isArray(t))return{type:"inline",value:t};var{type:e="inline"}=t,t=at(t,["type"]);return Object.assign(Object.assign({},t),{type:e})}(e),{transform:r=[]}=n,n=yield function(t){return t.reduce((n,r)=>e=>X(this,void 0,void 0,function*(){var t=yield n(e);return r(t)}),np)}([at(n,["transform"]),...r].map(t))(e);return[Array.isArray(n)?_p(n):[],Object.assign(Object.assign({},i),{data:n})]})}function Mv(t,e,n){var r=e["encode"];if(!r)return[t,e];var i,a,o={};for([i,a]of Object.entries(r))if(Array.isArray(a))for(let t=0;t<a.length;t++)o[""+i+(0===t?"":t)]=a[t];else o[i]=a;return[t,Object.assign(Object.assign({},e),{encode:o})]}function Ov(t,e,n){const{encode:r,data:i}=e;var a;return r?(a=Ap(r,t=>{var e,n;return function(t){if("object"!=typeof t||t instanceof Date||null===t)return;t=t.type;return sp(t)}(t)?t:(e=i,{type:"function"==typeof(n=t)?"transform":"string"==typeof n&&function(t,e){return Array.isArray(t)&&t.some(t=>void 0!==t[e])}(e,n)?"field":"constant",value:t})}),[t,Object.assign(Object.assign({},e),{encode:a})]):[t,e]}function kv(t,e,n){var r=e["encode"];return r?(r=Ap(r,(t,e)=>{var n=t["type"];return"constant"!==n||(n=e).startsWith("x")||n.startsWith("y")||n.startsWith("position")||"enterDelay"===n||"enterDuration"===n||"updateDelay"===n||"updateDuration"===n||"exitDelay"===n||"exitDuration"===n?t:Object.assign(Object.assign({},t),{constant:!0})}),[t,Object.assign(Object.assign({},e),{encode:r})]):[t,e]}function Ev(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];n=n.library;const a=function(t){const[n]=N1("encode",t);return(t,e)=>void 0===e||void 0===t?null:Object.assign(Object.assign({},e),{type:"column",value:n(e)(t),field:function(t){var{type:t,value:e}=t;return"field"===t&&"string"==typeof e?e:null}(e)})}(n);n=Ap(r,t=>a(i,t));return[t,Object.assign(Object.assign({},e),{encode:n})]}function Sv(t,e,n){var{tooltip:r={}}=e;return fp(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:hp(r)&&vv(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function Av(g,t,e){const{data:y,encode:m,tooltip:n={}}=t;var r,i,a,o;return fp(n)?[g,t]:(r=e=>{if(!e)return e;if("string"==typeof e)return g.map(t=>({name:e,value:y[t][e]}));if(hp(e)){var{field:t,channel:n,color:r,name:i=t,valueFormatter:a=t=>t}=e,o="string"==typeof a?Op(a):a,s=n&&m[n],a=s&&m[n].field,l=i||a||n,c=[];for(const d of g){var u=t?y[d][t]:s?m[n].value[d]:null;c[d]={name:l,color:r,value:o(u)}}return c}if("function"!=typeof e)return e;var h=[];for(const p of g){var f=e(y[p],p,y,m);hp(f)?h[p]=f:h[p]={value:f}}return h},{title:o,items:i=[]}=n,a=at(n,["title","items"]),o=Object.assign({title:r(o),items:Array.isArray(i)?i.map(r):[]},a),[g,Object.assign(Object.assign({},t),{tooltip:o})])}function _v(l,t,e){var n,r=t["encode"],i=at(t,["encode"]);return r?(n=(r=Object.entries(r)).filter(([,t])=>{t=t.value;return Array.isArray(t[0])}).flatMap(([n,t])=>{var r=[[n,new Array(l.length).fill(void 0)]];const i=t["value"],a=at(t,["value"]);for(let e=0;e<i.length;e++){var o=i[e];if(Array.isArray(o))for(let t=0;t<o.length;t++){var s=r[t]||[""+n+t,new Array(l).fill(void 0)];s[1][e]=o[t],r[t]=s}}return r.map(([t,e])=>[t,Object.assign({type:"column",value:e},a)])}),r=Object.fromEntries([...r,...n]),[l,Object.assign(Object.assign({},i),{encode:r})]):[l,t]}function Tv(t,e,n){const{axis:r={},legend:i={},slider:a={},scrollbar:o={}}=e,s=(t,e)=>{return"boolean"==typeof t?t?{}:null:void 0===(t=t[e])||t?t:null};var l="object"==typeof r?Array.from(new Set(["x","y",...Object.keys(r)])):["x","y"];return ot(e,{scale:Object.assign(Object.assign({},Object.fromEntries(l.map(t=>{var e=s(o,t);return[t,Object.assign({guide:s(r,t),slider:s(a,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 Pv(t,e,n){var r=e["animate"];return r||void 0===r||ot(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}function Cv(l,c,u){return X(this,void 0,void 0,function*(){var[t,e]=yield function(s,l,c){return X(this,void 0,void 0,function*(){var t=c["library"],[t]=N1("transform",t),{preInference:e=[],postInference:n=[]}=l,{transform:r=[]}=s,e=[xv,wv,Mv,Ov,kv,Ev,_v,Pv,Tv,Sv,...e.map(t),...r.map(t),...n.map(t),Av];let i=[],a=s;for(const o of e)[i,a]=yield o(i,a,c);return[i,a]})}(l,c,{library:u});const{encode:n,scale:p,data:r,tooltip:i}=e;if(!1===Array.isArray(r))return null;const a=c["channels"],o=Td(Object.entries(n).filter(([,t])=>sp(t)),t=>t.map(([t,e])=>Object.assign({name:t},e)),([t])=>{const e=null==(n=/([^\d]+)\d*$/.exec(t))?void 0:n[1];var n=a.find(t=>t.name===e);return null!=n&&n.independent?t:e});var s=a.filter(t=>{const{name:e,required:n}=t;if(o.find(([t])=>t===e))return!0;if(n)throw new Error(`Missing encoding for channel: ${e}.`);return!1}).flatMap(t=>{const{name:e,scale:c,scaleKey:u,range:h,quantitative:f,ordinal:d}=t;return o.filter(([t])=>t.startsWith(e)).map(([t,e],n)=>{var r=e.some(t=>t.visual),i=e.some(t=>t.constant),a=p[t]||{},{independent:o=!1,key:s=u||t,type:i=i?"constant":r?"identity":c}=a,r=at(a,["independent","key","type"]),a="constant"===i,l=a?void 0:h;return{name:t,values:e,scaleKey:o||a?Symbol("independent"):s,scale:Object.assign(Object.assign({type:i,range:l},r),{quantitative:f,ordinal:d})}})});return[e,Object.assign(Object.assign({},c),{index:t,channels:s,tooltip:i})]})}function Lv(H,V,Y,q){var $,U;return X(this,void 0,void 0,function*(){const[n]=N1("composition",Y);var[t]=N1("interaction",Y);const I=new Set(Object.keys(Y).map(t=>{return null==(t=/mark\.(.*)/.exec(t))?void 0:t[1]}).filter(sp)),r=new Set(Object.keys(Y).map(t=>{return null==(t=/component\.(.*)/.exec(t))?void 0:t[1]}).filter(sp)),i=t=>{t=t.type;if("function"==typeof t){var{props:e={}}=t,{composite:e=!0}=e;if(e)return"mark"}return"string"==typeof t&&(I.has(t)||r.has(t))?"mark":t};const a=t=>"standardView"===i(t),B=t=>{t=t.type;return"string"==typeof t&&!!r.has(t)};var e=t=>{var e;return a(t)?[t]:(e=i(t),n({type:e,static:B(t)})(t))},o=[];const s=new Map;for(var l=new Map,c=[H],u=[];c.length;){var h=c.shift();if(a(h)){var f=l.get(h),[f,d]=f?Iv(f,h,Y):yield jv(h,Y),p=(s.set(f,h),o.push(f),d.flatMap(e).map(t=>R1(t,Y)));if(c.push(...p),p.every(a)){var g=yield Promise.all(p.map(t=>Rv(t,Y)));km(f=(f=g).flatMap(t=>Array.from(t.values())).flatMap(t=>t.channels.map(t=>t.scale)),"x"),km(f,"y");for(let t=0;t<p.length;t++){var D=p[t],F=g[t];l.set(D,F)}}}else{d="mark"===i(h)?h:yield Vv(h,Y),f=e(d);Array.isArray(f)?c.push(...f):"function"==typeof f&&u.push(f())}}q.emitter.emit(pp.BEFORE_PAINT);const y=new Map,m=new Map,v=[];V.selectAll(Uv(xh)).data(o,t=>t.key).join(t=>t.append("g").attr("className",xh).attr("id",t=>t.key).call(Nv).each(function(t){Bv(t,lt(this),v,Y,q),y.set(t,this)}),t=>t.call(Nv).each(function(t){Bv(t,lt(this),v,Y,q),m.set(t,this)}),t=>t.each(function(){for(const t of this.nameInteraction.values())t.destroy()}).remove());var b=t=>Array.from(t.entries()).map(([t,e])=>({view:t,container:e,options:s.get(t),update:function(f,d,p){return h=>X(this,void 0,void 0,function*(){var t,[e,n]=yield jv(h,d),r=(Bv(e,f,[],d,p),f),i=h,a=e,o=p,[s]=N1("interaction",s=d),l=(l=r.node()).nameInteraction,c=Hv(i).find(([t])=>"tooltip"===t);(l=l.get("tooltip"))&&(null!=(t=l.destroy)&&t.call(l),c[1])&&(t=s(Object.assign({type:"tooltip"},c[1])),l={options:i,view:a,container:r.node(),update:t=>Promise.resolve(t)},t(l,[],o.emitter));for(const u of n)Lv(u,f,d,p);return{options:h,view:e}})}(lt(e),Y,q)})),x=b(y);for(const P of x){const H=P["options"];var w=new Map;P.container.nameInteraction=w;for(const C of Hv(H)){var[M,O]=C;O&&(O=t(Object.assign({type:M},O))(P,x,q.emitter),w.set(M,{destroy:O}))}}var k=b(m);for(const L of k){const{options:H,container:N}=L;var E=N.nameInteraction;for(const j of Hv(H)){var[S,A]=j,_=E.get(S);_&&null!=($=_.destroy)&&$.call(_),A&&(_=t(Object.assign({type:S},A))(L,k,q.emitter),E.set(S,{destroy:_}))}}const{width:z,height:W}=H;var T=[];for(const R of u){var G=new Promise(e=>X(this,void 0,void 0,function*(){for(const t of R)yield Lv(Object.assign({width:z,height:W},t),V,Y,q);e()}));T.push(G)}q.views=o,null!=(U=q.animations)&&U.forEach(t=>null==t?void 0:t.cancel()),q.animations=v,q.emitter.emit(pp.AFTER_PAINT);b=v.filter(sp).map(Wv).map(t=>t.finished);return Promise.all([...b,...T])})}function Nv(t){t.style("transform",t=>`translate(${t.layout.x}, ${t.layout.y})`)}function jv(e,n){return X(this,void 0,void 0,function*(){var t=function(t){var{coordinate:e={},interaction:n={},style:r={},marks:i}=t,t=at(t,["coordinate","interaction","style","marks"]),a=i.map(t=>t.coordinate||{}),o=i.map(t=>t.interaction||{}),s=i.map(t=>t.viewStyle||{}),a=[...a,e].reduceRight((t,e)=>ot(t,e),{}),e=[n,...o].reduce((t,e)=>ot(t,e),{}),n=[...s,r].reduce((t,e)=>ot(t,e),{});return Object.assign(Object.assign({},t),{marks:i,coordinate:a,interaction:e,style:n})}(yield function(p,g){return X(this,void 0,void 0,function*(){var[t,e]=N1("mark",g),n=new Set(Object.keys(g).map(t=>{return null==(t=/component\.(.*)/.exec(t))?void 0:t[1]}).filter(sp));const r=p["marks"];for(var i=[],a=[],o=[...r],{width:s,height:l}=function(t){var{height:t,width:e,padding:n=0,paddingLeft:r=n,paddingRight:i=n,paddingTop:a=n,paddingBottom:n=n,margin:o=0,marginLeft:s=o,marginRight:l=o,marginTop:c=o,marginBottom:o=o,inset:u=0,insetLeft:h=u,insetRight:f=u,insetTop:d=u,insetBottom:u=u}=t,p=t=>"auto"===t?30:t;return{width:e-p(r)-p(i)-s-l-h-f,height:t-p(a)-p(n)-c-o-d-u}}(p),c={options:p,width:s,height:l};o.length;){var[u]=o.splice(0,1),u=yield Vv(u,g);const{type:f=ap("G2Mark type is required."),key:d}=u;if(n.has(f))a.push(u);else{var{props:h={}}=e(f),{composite:h=!0}=h;if(h){const r=yield t(u,c);h=Array.isArray(r)?r:[r];o.unshift(...h.map((t,e)=>Object.assign(Object.assign({},t),{key:d+"-"+e})))}else i.push(u)}}return Object.assign(Object.assign({},p),{marks:i,components:a})})}(e,n)),t=(e.interaction=t.interaction,e.coordinate=t.coordinate,R1(t,n));return Iv(yield Rv(t,n),t,n)})}function Rv(g,y){return X(this,void 0,void 0,function*(){var[t]=N1("theme",y),[,e]=N1("mark",y),{theme:n,marks:r,coordinates:i=[]}=g,a=t(Gv(n)),o=new Map;for(const f of r){var s,l=f["type"],{props:l={}}=e(l),l=yield Cv(f,l,y);l&&([l,s]=l,o.set(l,s))}for(const d of Sd(Array.from(o.values()).flatMap(t=>t.channels),({scaleKey:t})=>t).values()){var c=d.reduce((t,{scale:e})=>ot(t,e),{}),u=d[0]["scaleKey"],h=d[0]["values"],h=Array.from(new Set(h.map(t=>t.field).filter(sp)));const g=ot({guide:{title:0===h.length?void 0:h},field:h[0]},c);h=d[0]["name"],c=d.flatMap(({values:t})=>t.map(t=>t.value));const p=Object.assign(Object.assign({},xm(h,c,g,i,a,y)),{key:u});d.forEach(t=>t.scale=p)}return o})}function Iv(t,e,n){var[r]=N1("mark",n),[i]=N1("theme",n),[a]=N1("labelTransform",n);const{key:o,frame:s=!1,theme:I,clip:B,style:l={},labelTransform:D=[]}=e;var i=i(Gv(I)),c=Array.from(t.values());const u=wm(c,e);var c=Fm(function(t,e,n){for(var[r]of n.entries())if("cell"===r.type)return t.filter(t=>"shape"!==t.name);if(1!==e.length||t.some(t=>"shape"===t.name))return t;n=e[0].defaultShape;if(!["point","line","rect","hollow"].includes(n))return t;e=(null==(e=t.find(t=>"color"===t.name))?void 0:e.field)||null,e={field:e,name:"shape",type:"constant",domain:[],range:[{point:"point",line:"hyphen",rect:"square",hollow:"hollow"}[n]]};return[...t,e]}(Array.from(u),c,t),e,n).map(t=>{t=ot(t,t.style);return delete t.style,t}),h=dv(c,e,i,n),f=function(t,e,n){var[n]=N1("coordinate",n),{innerHeight:r,innerWidth:i,insetLeft:a,insetTop:o,insetRight:s,insetBottom:l,marginLeft:c,marginTop:u}=t,{coordinates:e=[]}=e,e=(e=e).find(t=>"cartesian"===t.type)?e:[...e,{type:"cartesian"}];return new C1(Object.assign(Object.assign({},t),{x:a+c,y:o+u,width:i-a-s,height:r-l-o,transformations:e.map(n).flat()}))}(h,e,n),e=s?ot({mainLineWidth:1,mainStroke:"#000"},l):l,d=(gv(Wm(c),f,h),{});for(const x of c){var{scales:F=[]}=x;const u=[];for(const w of F){var z=w["name"],p=Om(w,n);u.push(p),Mm(d,{[z]:p})}x.scaleInstances=u}var g,y,m=[];for([g,y]of t.entries()){const{children:M,dataDomain:O,modifier:k,key:E}=g,{index:S,channels:A,tooltip:_}=y;var v=Ap(Object.fromEntries(A.map(({name:t,scale:e})=>[t,e])),t=>Om(t,n));Mm(d,v);const T=function(t,e){var n={};for(const s of t){var{values:r,name:i}=s;const l=e[i];for(const c of r){var{name:a,value:o}=c;n[a]=o.map(t=>l.map(t))}}return n}(A,v),[P,C,L]=function([e,n,t]){if(t)return[e,n,t];var r=[],i=[];for(let t=0;t<e.length;t++){var a=e[t],o=n[t];o.every(([t,e])=>sp(t)&&sp(e))&&(r.push(a),i.push(o))}return[r,i]}(r(g)(S,v,T,f));var b=O||P.length;const N=k?k(C,b,h):[],j=t=>{var e;return null==(e=null==(e=_.title)?void 0:e[t])?void 0:e.value},R=e=>_.items.map(t=>t[e]);b=P.map((t,e)=>{var n=Object.assign({points:C[e],transform:N[e],index:t,markKey:E,viewKey:o},_&&{title:j(t),items:R(t)});for(const[r,i]of Object.entries(T))n[r]=i[t],L&&(n["series"+Ue(r)]=L[e].map(t=>i[t]));return L&&(n.seriesIndex=L[e]),L&&_&&(n.seriesItems=L[e].map(t=>R(t)),n.seriesTitle=L[e].map(t=>j(t))),n}),b=(y.data=b,y.index=P,null==M?void 0:M(b,v,h));m.push(...b||[])}return[{layout:h,theme:i,coordinate:f,markState:t,key:o,clip:B,scale:d,style:e,components:c,labelTransform:rp(D.map(a))},m]}function Bv(tt,et,nt,rt,it){X(this,void 0,void 0,function*(){const{components:t,theme:n,layout:e,markState:r,coordinate:i,key:a,style:I,clip:o,scale:s}=tt,{width:B,height:D}=e,F=at(e,["x","y","width","height"]),l=["view","plot","main","content"];var c,u=l.map((t,e)=>e);const h=l.map(t=>lp(Object.assign({},n.view,I),t)),z=["a","margin","padding","inset"].map(t=>st(F,t)),f=t=>t.style("x",t=>m[t].x).style("y",t=>m[t].y).style("width",t=>m[t].width).style("height",t=>m[t].height).each(function(t){var e,n,r=lt(this),t=h[t];for([e,n]of Object.entries(t))r.style(e,n)});let d=0,p=0,g=B,y=D;const m=u.map(t=>{var{left:t=0,top:e=0,bottom:n=0,right:r=0}=z[t];return d+=t,p+=e,g-=t+r,y-=e+n,{x:d,y:p,width:g,height:y}}),v=(et.selectAll(Uv(kh)).data(u.filter(t=>sp(h[t])),t=>l[t]).join(t=>t.append("rect").attr("className",kh).style("zIndex",-2).call(f),t=>t.call(f),t=>t.remove()),function(t){let e=-1/0,n=1/0;for(var[r,i]of t){var{animate:r={}}=r,i=i["data"],{enter:r={},update:a={},exit:o={}}=r,{type:s,duration:l=300,delay:c=0}=a,{type:u,duration:h=300,delay:f=0}=r,{type:d,duration:p=300,delay:g=0}=o;for(const E of i){var{updateType:y=s,updateDuration:m=l,updateDelay:v=c,enterType:b=u,enterDuration:x=h,enterDelay:w=f,exitDuration:M=p,exitDelay:O=g,exitType:k=d}=E;void 0!==y&&!y||(e=Math.max(e,m+v),n=Math.min(n,v)),void 0!==k&&!k||(e=Math.max(e,M+O),n=Math.min(n,O)),void 0!==b&&!b||(e=Math.max(e,x+w),n=Math.min(n,w))}}return e===-1/0?null:[n,e-n]}(r)),b=!!v&&{duration:v[1]};for([,c]of Ad(t,t=>t.type+"-"+t.position))c.forEach((t,e)=>t.index=e);var x,w,M,u=et.selectAll(Uv(Mh)).data(t,t=>`${t.type}-${t.position}-`+t.index).join(t=>t.append("g").style("zIndex",({zIndex:t})=>t||-1).attr("className",Mh).append(t=>zm(ot({animate:b,scale:s},t),i,n,rt,r)),t=>t.transition(function(t){var{preserve:e=!1}=t;if(!e)return e=zm(ot({animate:b,scale:s},t),i,n,rt,r)["attributes"],[t]=this.childNodes,t.update(e)})).transitions();nt.push(...u.flat().filter(sp));const O=et.selectAll(Uv(wh)).data([e],()=>a).join(t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",wh).call(Yv).call($v,Array.from(r.keys())).call(Xv,o),t=>t.call($v,Array.from(r.keys())).call(t=>{if(!v)return Yv(t);{const[l,c]=v;t.transition(function(t){var{x:e,y:n,width:r,height:i}=this.style,{paddingLeft:t,paddingTop:a,innerWidth:o,innerHeight:s}=t;return this.animate([{x:e,y:n,width:r,height:i},{x:t,y:a,width:o,height:s}],{delay:l,duration:c,fill:"both"})})}}).call(Xv,o)).transitions();nt.push(...O.flat());for([x,w]of r.entries()){var W=w["data"];const{key:a,class:q,type:_}=x;var k=et.select("#"+a);const T=function(s,t,e,n,r){const[l]=N1("shape",n),c=s["data"],{defaultShape:u,data:i,shape:h}=t,f=i.map(t=>t.points),{theme:d,coordinate:a}=e,{type:p,style:g={}}=s,y=Object.assign(Object.assign({},r),{document:j1(r),coordinate:a,theme:d});return t=>{var{shape:e=u}=g,{shape:e=e,points:n,seriesIndex:r,index:i}=t,t=at(t,["shape","points","seriesIndex","index"]),t=Object.assign(Object.assign({},t),{index:i});const a=r?r.map(t=>c[t]):c[i],o=r||i;r=Ap(g,t=>Dv(t,a,o,c));return(h[e]?h[e](r,y):l(Object.assign(Object.assign({},r),{type:qv(s,e)}),y))(n,t,Fv(d,p,e,u),f)}}(x,w,tt,rt,it),$=(E=x,M=w,zv("enter",E,M,tt,rt)),P=(E=x,M=w,zv("update",E,M,tt,rt)),U=(E=x,M=w,zv("exit",E,M,tt,rt));var E=function(t,e,n,r){t=t.node().parentElement;return t.findAll(t=>void 0!==t.style.facet&&t.style.facet===n&&t!==e.node()).flatMap(t=>t.getElementsByClassName(r))}(et,k,q,"element");const O=k.selectAll(Uv(bh)).selectFacetAll(E).data(W,t=>t.key,t=>t.groupKey).join(t=>t.append(T).attr("className",bh).attr("markType",_).transition(function(t){return $(t,[this])}),t=>t.call(t=>{const l=t.parent(),c=function(n){const r=new Map;return t=>{var e;return r.has(t)?r.get(t):(e=n(t),r.set(t,e),e)}}(t=>{var[t,e]=t.getBounds().min;return[t,e]});t.transition(function(t,e){n=this,r=l,s=c,n.__facet__&&(i=n.parentNode.parentNode,o=r.parentNode,[i,a]=s(i),[s,o]=s(o),i=`translate(${i-s}, ${a-o})`,s=n.style.transform,a="none"===(a=s)||void 0===a?"":s,n.style.transform=(a+" "+i).trimStart(),r.append(n));var n,r,i,a,o=T(t,e),s=P(t,[this],[o]);return null===s&&(this.nodeName===o.nodeName?op(this,o):(this.parentNode.replaceChild(o,this),o.className=bh,o.markType=_)),s}).attr("markType",_).attr("className",bh)}),t=>t.each(function(){this.__removed__=!0}).transition(function(t){return U(t,[this])}).remove(),t=>t.append(T).attr("className",bh).attr("markType",_).transition(function(t){var e=this["__fromElements__"],t=P(t,e,[this]);return new dp(e,null,this.parentNode).transition(t).remove(),t}),t=>t.transition(function(t){var e=new dp([],this.__toData__,this.parentNode).append(T).attr("className",bh).attr("markType",_).nodes();return P(t,[this],e)}).remove()).transitions();nt.push(...O.flat())}{var S=tt,G=et,H=rt,V=it,A,Y;const[X]=N1("labelTransform",H),{markState:K,labelTransform:C}=S,Z=G.select(Uv(vh)).node(),L=new Map,N=new Map,Q=Array.from(K.entries()).flatMap(([t,e])=>{var{labels:n=[],key:r}=t;const i=function(t,e,n,r,i){const[l]=N1("shape",r),c=t["data"],{data:a,defaultLabelShape:u}=e,h=a.map(t=>t.points),{theme:f,coordinate:o}=n,d=Object.assign(Object.assign({},i),{document:j1(i),theme:f,coordinate:o});return t=>{const{index:e,points:n}=t,r=c[e];var{formatter:i=t=>""+t,style:a,render:o}=t,t=at(t,["formatter","transform","style","render"]),t=Ap(Object.assign(Object.assign({},t),a),t=>Dv(t,r,e,c)),{shape:a=u,text:s}=t,t=at(t,["shape","text"]),i="string"==typeof i?Op(i):i,i=Object.assign(Object.assign({},t),{text:i(s,r,e,c),datum:r}),s=Object.assign({type:"label."+a,render:o},t);return l(s,d)(n,i,Fv(f,"label",a,"label"),h)}}(t,e,S,H,V),a=G.select("#"+r).selectAll(Uv(bh)).nodes().filter(t=>!t.__removed__);return n.flatMap((e,n)=>{const r=at(e,["transform"]);return a.flatMap(t=>{t=function(n,r,i){const{seriesIndex:t,seriesKey:a,points:o,key:e,index:s}=i.__data__,l=function(t){const e=t.cloneNode(),n=t.getAnimations(),r=(e.style.visibility="hidden",n.forEach(t=>{t=t.effect.getKeyframes();e.attr(t[t.length-1])}),t.parentNode.appendChild(e),e.getLocalBounds()),{min:i,max:a}=(e.destroy(),r);return[i,a]}(i);if(!t)return[Object.assign(Object.assign({},n),{key:e+"-"+r,bounds:l,index:s,points:o,dependentElement:i})];var c=function(t){t=t.selector;if(!t)return null;if("function"==typeof t)return t;if("first"===t)return t=>[t[0]];if("last"===t)return t=>[t[t.length-1]];throw new Error("Unknown selector: "+t)}(n),u=t.map((t,e)=>Object.assign(Object.assign({},n),{key:a[e]+"-"+r,bounds:[o[e]],index:t,points:o,dependentElement:i}));return c?c(u):u}(r,n,t);return t.forEach(t=>{L.set(t,i),N.set(t,e)}),t})})}),j=lt(Z).selectAll(Uv(Oh)).data(Q,t=>t.key).join(t=>t.append(t=>L.get(t)(t)).attr("className",Oh),t=>t.each(function(t){op(this,L.get(t)(t))}),t=>t.remove()).nodes(),J=Sd(j,t=>N.get(t.__data__)),R=S["coordinate"];for([A,Y]of J){var{transform:A=[]}=A;rp(A.map(X))(Y,R)}C&&C(j,R)}})}function Dv(t,e,n,r){return"function"==typeof t?t(e,n,r):"string"==typeof t&&void 0!==e[t]?e[t]:t}function Fv(t,e,n,r){var i;if("string"==typeof e)return i=t["color"],e=(t=t[e]||{})[n]||t[r],Object.assign({color:i},e)}function zv(o,t,e,n,r){var[,i]=N1("shape",r);const[s]=N1("animation",r);var{defaultShape:r,shape:e}=e,{theme:n,coordinate:a}=n,l=`default${Ue(o)}Animation`;const{[l]:c}=(null==(e=e[r])?void 0:e.props)||i(qv(t,r)).props,{[o]:u={}}=n,h=(null==(e=t.animate)?void 0:e[o])||{},f={coordinate:a};return(t,e,n)=>{var{[o+"Type"]:t,[o+"Delay"]:r,[o+"Duration"]:i,[o+"Easing"]:a}=t,t=Object.assign({type:t||c},h);return t.type?(r={delay:r,duration:i,easing:a},i=s(t,f)(e,n,ot(u,r)),Array.isArray(i)?i:[i]):null}}function Wv(t){return t.finished.then(()=>{t.cancel()}),t}function Gv(t={}){var e;return"string"==typeof t?{type:t}:({type:e="classic"}=t,t=at(t,["type"]),Object.assign(Object.assign({},t),{type:e}))}function Hv(t){var{interaction:t={}}=t;return Object.entries(ot({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},t))}function Vv(r,i){return X(this,void 0,void 0,function*(){var t={library:i},e=r["data"],n=at(r,["data"]);return null==e?r:([,{data:e}]=yield wv(0,{data:e},t),Object.assign({data:e},n))})}function Yv(t){t.style("x",t=>t.paddingLeft).style("y",t=>t.paddingTop).style("width",t=>t.innerWidth).style("height",t=>t.innerHeight)}function qv(t,e){t=t.type;return"string"==typeof e?t+"."+e:e}function $v(t,e){const n=t=>void 0!==t.class?""+t.class:"";0===t.nodes().length||(t.selectAll(Uv(mh)).data(e,t=>t.key).join(t=>t.append("g").attr("className",mh).attr("id",t=>t.key).style("facet",n).style("fill","transparent").style("zIndex",t=>{return null!=(t=t.zIndex)?t:0}),t=>t.style("facet",n).style("fill","transparent").style("zIndex",t=>{return null!=(t=t.zIndex)?t:0}),t=>t.remove()),t.select(Uv(vh)).node())||t.append("g").attr("className",vh).style("zIndex",0)}function Uv(...t){return t.map(t=>"."+t).join("")}function Xv(t,i){t.node()&&t.style("clipPath",t=>{var e,n,r;return i?({paddingTop:t,paddingLeft:e,innerWidth:n,innerHeight:r}=t,new Nc({style:{x:e,y:t,width:n,height:r}})):null})}function Kv(t){for(var t=ot({},t),e=new Map([[t,null]]),n=new Map([[null,-1]]),r=[t];r.length;){var i,a,o=r.shift(),{children:s=[]}=(void 0===o.key&&(a=e.get(o),i=n.get(o),a=null===a?"0":a.key+"-"+i,o.key=a),o);if(Array.isArray(s))for(let t=0;t<s.length;t++){var l=ot({},s[t]);s[t]=l,e.set(l,o),n.set(l,t),r.push(l)}}return t}function Zv(t,e={},n=()=>{},r=t=>{throw t}){const{width:i=640,height:a=480,theme:o}=t,s=(o||ap('ChartOptions.theme is required, such as `const chart = new Chart({ theme: "classic"})`.'),Kv(t)),{canvas:l=(t=i,h=a,f=new rd,f.registerPlugin(new ld),new su({width:t,height:h,container:document.createElement("div"),renderer:f})),emitter:c=new ud,library:u}=e;var h,f;e.canvas=l,e.emitter=c,l.resize(i,a),c.emit(pp.BEFORE_RENDER);const d=lt(l.document.documentElement);return l.ready.then(()=>Lv(Object.assign(Object.assign({},s),{width:i,height:a}),d,u,e)).then(()=>{l.requestAnimationFrame(()=>{c.emit(pp.AFTER_RENDER),null!=n&&n()})}).catch(t=>{null!=r&&r(t)}),"string"==typeof(t=l.getConfig().container)?document.getElementById(t):t}function Qv(t,e={},n=!1){var r,{canvas:e,emitter:i}=e;e&&(null!=(r=(r=e).getRoot().querySelectorAll("."+xh))&&r.forEach(t=>{var{nameInteraction:t=new Map}=t;0<(null==t?void 0:t.size)&&Array.from(null==t?void 0:t.values()).forEach(t=>{null!=t&&t.destroy()})}),n?e.destroy():e.destroyChildren()),i.off()}const Jv=({value:e})=>t=>t.map(()=>e),tb=(Jv.props={},({value:e})=>t=>t.map(e)),eb=(tb.props={},({value:e})=>t=>t.map(t=>t[e])),nb=(eb.props={},({value:t})=>()=>t);function rb(t,e){if(null!==t)return{type:"column",value:t,field:e}}function ib(t,e){t=rb(t,e);return Object.assign(Object.assign({},t),{inferred:!0})}function ab(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function ob(t,e){var n=[];for(const r of t)n[r]=e;return n}function sb(t,e){var t=t[e];return t?({value:e,field:t=null}=t,[e,t]):[null,null]}function lb(t,...e){for(const i of e){if("string"!=typeof i)return[i,null];var[n,r]=sb(t,i);if(null!==n)return[n,r]}return[null,null]}function cb(t){return!(t instanceof Date)&&"object"==typeof t}nb.props={};_l=()=>(t,e)=>{var n=e["encode"],n=n["y1"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{y1:ib(ob(t,0))}})]};function ub(t,e,n){const r=n["encode"];if(null===t)return[e];n=t;const i=(Array.isArray(n)?n:[n]).map(t=>{return[t,null==(t=sb(r,t))?void 0:t[0]]}).filter(([,t])=>sp(t));return Array.from(Sd(e,e=>i.map(([,t])=>t[e]).join("-")).values())}function hb(t){var a,r;return Array.isArray(t)?(a=t,(i,t,e)=>(n,r)=>a.reduce((t,e)=>0!==t?t:fd(i[n][e],i[r][e]),0)):"function"==typeof t?(r=t,(e,t,n)=>vb(t=>r(e[t]))):"series"===t?pb:"value"===t?gb:"sum"===t?yb:"maxIndex"===t?mb:()=>null}function fb(t,e){for(const n of t)n.sort(e)}function db(t,e){return(null==e?void 0:e.domain)||Array.from(new Set(t))}function pb(t,e,n){return vb(t=>n[t])}function gb(t,e,n){return vb(t=>e[t])}function yb(t,n,e){t=_p(t),t=Array.from(Sd(t,t=>e[+t]).entries());const r=new Map(t.map(([t,e])=>[t,e.reduce((t,e)=>t+ +n[e])]));return vb(t=>r.get(e[t]))}function mb(t,n,e){t=_p(t),t=Array.from(Sd(t,t=>e[+t]).entries());const r=new Map(t.map(([t,e])=>[t,Vd(e,t=>n[t])]));return vb(t=>r.get(e[t]))}function vb(n){return(t,e)=>fd(n(t),n(e))}_l.props={};const bb=(t={})=>{const{groupBy:T="x",orderBy:P=null,reverse:C=!1,y:L="y",y1:N="y1",series:j=!0}=t;return(t,e)=>{var{data:n,encode:r,style:i={}}=e,[a,o]=sb(r,"y"),[s,l]=sb(r,"y1"),[r]=j?lb(r,"series","color"):sb(r,"color"),c=ub(T,t,e),n=hb(P)(n,a,r),u=(n&&fb(c,n),new Array(t.length)),h=new Array(t.length),f=new Array(t.length),d=[],p=[];for(const E of c){C&&E.reverse();var g=s?+s[E[0]]:0,y=[],m=[];for(const S of E){var v=f[S]=+a[S]-g;v<0?m.push(S):0<=v&&y.push(S)}var b=0<y.length?y:m,x=0<m.length?m:y;let t=y.length-1,e=0;for(;0<t&&0===a[b[t]];)t--;for(;e<x.length-1&&0===a[x[e]];)e++;d.push(b[t]),p.push(x[e]);let n=g;for(const A of m.reverse()){var w=f[A];n=u[A]=(h[A]=n)+w}let r=g;for(const _ of y){var M=f[_];0<M?r=u[_]=(h[_]=r)+M:u[_]=h[_]=r}}const O=new Set(d),k=new Set(p);r="y"===L?u:h,n="y"===N?u:h;return[t,ot({},e,{encode:{y0:ib(a,o),y:rb(r,o),y1:rb(n,l)},style:Object.assign({first:(t,e)=>O.has(e),last:(t,e)=>k.has(e)},i)})]}},xb=(bb.props={},(t={})=>{const{channel:s="x"}=t;return(t,e)=>{const n=e["encode"];var r=e["tooltip"];if(fp(r))return[t,e];r=r.title;if(void 0!==r)return[t,e];var i=Object.keys(n).filter(t=>t.startsWith(s)).filter(t=>!n[t].inferred).map(t=>sb(n,t)).filter(([t])=>t).map(t=>t[0]);if(0===i.length)return[t,e];var a=[];for(const o of t)a[o]={value:i.map(t=>t[o]).join(", ")};return[t,ot({},e,{tooltip:{title:a}})]}});xb.props={};Rl=()=>(t,e)=>{var n=e["encode"],n=n["x"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{x:ib(ob(t,0))},scale:{x:{guide:null}}})]},Rl.props={},zl=()=>(t,e)=>{var n=e["encode"],n=n["y"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{y:ib(ob(t,0))},scale:{y:{guide:null}}})]},zl.props={},Hs=()=>(t,e)=>{var n=e["encode"],n=n["size"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{size:ab(ob(t,3))}})]};Hs.props={};const wb=()=>(t,e)=>{var n=e["encode"],r=n["key"],n=at(n,["key"]);if(void 0!==r)return[t,e];const i=Object.values(n).map(({value:t})=>t);r=t.map(e=>i.filter(Array.isArray).map(t=>t[e]).join("-"));return[t,ot({},e,{encode:{key:rb(r)}})]};wb.props={};el=()=>(t,e)=>{var n=e["encode"],{series:r,color:i}=n;return void 0!==r||void 0===i?[t,e]:([r,i]=sb(n,"color"),[t,ot({},e,{encode:{series:rb(r,i)}})])},el.props={},i=()=>(t,e)=>{var n=e["data"];return!Array.isArray(n)||n.some(cb)?[t,e]:[t,ot({},e,{encode:{y:rb(n)}})]},i.props={},S=()=>(t,e)=>{var n=e["data"];return!Array.isArray(n)||n.some(cb)?[t,e]:[t,ot({},e,{encode:{x:rb(n)}})]},S.props={},Zs=()=>(t,e)=>{var n=e["encode"],r=n["y1"];return r?[t,e]:([r]=sb(n,"y"),[t,ot({},e,{encode:{y1:rb([...r])}})])},Zs.props={},Xs=()=>(t,e)=>{var n=e["encode"],r=n["x1"];return r?[t,e]:([r]=sb(n,"x"),[t,ot({},e,{encode:{x1:rb([...r])}})])};Xs.props={};const Mb=t=>{const i=t["channel"];return(t,e)=>{const{encode:a,tooltip:n}=e;var r;return fp(n)||({items:r=[]}=n,!r)||0<r.length?[t,e]:(r=(Array.isArray(i)?i:[i]).flatMap(e=>Object.keys(a).filter(t=>t.startsWith(e)).map(t=>{var{field:e,value:n,inferred:r=!1,aggregate:i}=a[t];return r?null:i&&n?{channel:t}:e?{field:e}:n?{channel:t}:null}).filter(t=>null!==t)),[t,ot({},e,{tooltip:{items:r}})])}};Mb.props={};ol=()=>(t,e)=>[t,ot({scale:{x:{padding:0},y:{padding:0}}},e)],ol.props={},fn=()=>(t,e)=>{var{style:n={}}=e,r=at(e,["data","style"]),{x:i,y:a}=n,n=at(n,["x","y"]);return null==i||null==a?[t,e]:[[0],ot({},r,{data:[0],cartesian:!0,encode:{x:rb([i||0]),y:rb([a||0])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:n})]},fn.props={},Vo=()=>(t,e)=>{var{style:n={}}=e;return[t,ot({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter(([,t])=>"function"==typeof t).map(([t,e])=>[t,()=>e])))})]},Vo.props={},ii=()=>(t,e)=>{var n,r=e["data"];return!Array.isArray(r)||r.some(cb)?[t,e]:(n=(r=Array.isArray(r[0])?r:[r]).map(t=>t[0]),r=r.map(t=>t[1]),[t,ot({},e,{encode:{x:rb(n),y:rb(r)}})])},ii.props={},e=()=>(t,e)=>{var{style:n={},encode:r}=e,r=r["series"],n=n["gradient"];return!n||r?[t,e]:[t,ot({},e,{encode:{series:ab(ob(t,void 0))}})]};e.props={};const Ob=(t={})=>{const{groupBy:c="x",reverse:u=!1,orderBy:h,padding:f}=t;return at(t,["groupBy","reverse","orderBy","padding"]),(t,e)=>{var{data:n,encode:r,scale:i}=e,i=i["series"],[a]=sb(r,"y"),[r]=lb(r,"series","color"),o=db(r,i),i=ub(c,t,e),n=hb(h)(n,a,r),s=(n&&fb(i,n),new Array(t.length));for(const l of i){u&&l.reverse();for(let t=0;t<l.length;t++)s[l[t]]=o[t]}return[t,ot({},e,{scale:{series:{domain:o,paddingInner:f}},encode:{series:rb(s)}})]}},kb=(Ob.props={},t=>{const{groupBy:p=["x"],reducer:g=(t,e)=>e[t[0]],orderBy:y=null,reverse:m=!1,duration:v}=t;return(n,t)=>{const e=t["encode"];var r=(Array.isArray(p)?p:[p]).map(t=>[t,sb(e,t)[0]]);if(0===r.length)return[n,t];let i=[n];for(const[,h]of r){var a=[];for(const n of i){var o=Array.from(Sd(n,t=>h[t]).values());a.push(...o)}i=a}if(y){const[f]=sb(e,y);f&&i.sort((t,e)=>g(t,f)-g(e,f)),m&&i.reverse()}r=(v||3e3)/i.length;const[s]=v?[ob(n,r)]:lb(e,"enterDuration",ob(n,r));var[l]=lb(e,"enterDelay",ob(n,0)),c=new Array(n.length);for(let t=0,e=0;t<i.length;t++){const n=i[t];var u=Hd(n,t=>+s[t]);for(const d of n)c[d]=+l[d]+e;e+=u}return[n,ot({},t,{encode:{enterDuration:ab(s),enterDelay:ab(c)}})]}});kb.props={};const Eb=(t={})=>{const{groupBy:p="x",basis:g="max"}=t;return(e,t)=>{const{encode:n,tooltip:r}=t;var i=at(n,["x"]),a=Object.entries(i).filter(([t])=>t.startsWith("y")).map(([t])=>[t,sb(n,t)[0]]),[,o]=a.find(([t])=>"y"===t),s=a.map(([t])=>[t,new Array(e.length)]),i=ub(p,e,t),l="function"==typeof(f=g)?f:{min:(t,e)=>Yd(t,t=>e[+t]),max:(t,e)=>Hd(t,t=>e[+t]),first:(t,e)=>e[t[0]],last:(t,e)=>e[t[t.length-1]],mean:(t,e)=>Zd(t,t=>e[+t]),median:(t,e)=>Qd(t,t=>e[+t]),sum:(t,e)=>ep(t,t=>e[+t]),deviation:(t,e)=>xd(t,t=>e[+t])}[f]||Hd;for(const e of i){var c=l(e,o);for(const d of e)for(let t=0;t<a.length;t++){var[,u]=a[t],[,h]=s[t];h[d]=+u[d]/c}}var f=fp(r)||(null==r?void 0:r.items)&&0!==(null==r?void 0:r.items.length);return[e,ot({},t,Object.assign({encode:Object.fromEntries(s.map(([t,e])=>[t,rb(e,sb(n,t)[1])]))},!f&&n.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};function Sb(t,e,n){return null===t?[-.5,.5]:(t=db(t,e),[-(e=new cg({domain:t,range:[0,1],padding:n}).getBandWidth())/2,e/2])}function Ab(t,e,n){return e*(1-t)+n*t}Eb.props={};const _b=(t={})=>{const{padding:e=0,paddingX:l=e,paddingY:c=e,random:u=Math.random}=t;return(t,e)=>{var{encode:n,scale:r}=e,{x:r,y:i}=r,[a]=sb(n,"x"),[n]=sb(n,"y");const o=Sb(a,r,l),s=Sb(n,i,c);a=t.map(()=>Ab(u(),...s)),r=t.map(()=>Ab(u(),...o));return[t,ot({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:rb(a),dx:rb(r)}})]}},Tb=(_b.props={},(t={})=>{const{padding:a=0,random:o=Math.random}=t;return(t,e)=>{var{encode:n,scale:r}=e,r=r["x"],[n]=sb(n,"x");const i=Sb(n,r,a);n=t.map(()=>Ab(o(),...i));return[t,ot({scale:{x:{padding:.5}}},e,{encode:{dx:rb(n)}})]}}),Pb=(Tb.props={},(t={})=>{const{groupBy:g="x"}=t;return(e,t)=>{const n=t["encode"];var r=at(n,["x"]);const i=Object.entries(r).filter(([t])=>t.startsWith("y")).map(([t])=>[t,sb(n,t)[0]]);var a=i.map(([t])=>[t,new Array(e.length)]),o=ub(g,e,t),s=new Array(o.length);for(let t=0;t<o.length;t++){const e=o[t];var[l,c]=wd(e.flatMap(e=>i.map(([,t])=>+t[e])));s[t]=(l+c)/2}var u=Math.max(...s);for(let t=0;t<o.length;t++){var h=u-s[t];const e=o[t];for(const p of e)for(let t=0;t<i.length;t++){var[,f]=i[t],[,d]=a[t];d[p]=+f[p]+h}}return[e,ot({},t,{encode:Object.fromEntries(a.map(([t,e])=>[t,rb(e,sb(n,t)[1])]))})]}}),Cb=(Pb.props={},(t={})=>{const{groupBy:u="x",series:h=!0}=t;return(t,e)=>{var n=e["encode"];const[r]=sb(n,"y");var[,i]=sb(n,"y1"),n=(h?lb(n,"series","color"):sb(n,"color"),ub(u,t,e)),a=new Array(t.length);for(const c of n){var o=c.map(t=>+r[t]);for(let n=0;n<c.length;n++){var s=c[n],l=Math.max(...o.filter((t,e)=>e!==n));a[s]=r[s]>l?l:r[s]}}return[t,ot({},e,{encode:{y1:rb(a,i)}})]}});function Lb(t,e){return[t[0]]}function Nb(t,e){return[t[t.length-1]]}function jb(t,e){return[t[Vd(t,t=>e[t])]]}function Rb(t,e){return[t[qd(t,t=>e[t])]]}Cb.props={};const Ib=(t={})=>{const{groupBy:a="series",channel:o,selector:s}=t;return(t,e)=>{var n=e["encode"],t=ub(a,t,e);const[r]=sb(n,o),i="function"==typeof(n=s)?n:{first:Lb,last:Nb,max:jb,min:Rb}[n]||Lb;return[t.flatMap(t=>i(t,r)),e]}},Bb=(Ib.props={},(t={})=>{var e=t["selector"],t=at(t,["selector"]);return Ib(Object.assign({channel:"x",selector:e},t))}),Db=(Bb.props={},(t={})=>{var e=t["selector"],t=at(t,["selector"]);return Ib(Object.assign({channel:"y",selector:e},t))});function Fb(e){return t=>null===t?e:e+" of "+t}function zb(){return[(t,e)=>Zd(t,t=>+e[t]),Fb("mean")]}function Wb(){return[(t,e)=>Qd(t,t=>+e[t]),Fb("median")]}function Gb(){return[(t,e)=>Hd(t,t=>+e[t]),Fb("max")]}function Hb(){return[(t,e)=>Yd(t,t=>+e[t]),Fb("min")]}function Vb(){return[(t,e)=>t.length,Fb("count")]}function Yb(){return[(t,e)=>ep(t,t=>+e[t]),Fb("sum")]}function qb(){return[(t,e)=>e[t[0]],Fb("first")]}function $b(){return[(t,e)=>e[t[t.length-1]],Fb("last")]}Db.props={};const Ub=(t={})=>{const i=t["groupBy"],a=at(t,["groupBy"]);return(t,e)=>{const{data:s,encode:l}=e,c=i(t,e);if(!c)return[t,e];var t=Object.entries(a).map(([t,e])=>{const[n,r]=function(t){if("function"==typeof t)return[t,null];var e={mean:zb,max:Gb,count:Vb,first:qb,last:$b,sum:Yb,min:Hb,median:Wb}[t];if(e)return e();throw new Error(`Unknown reducer: ${t}.`)}(e),[i,a]=sb(l,t);e=e;var e=(o=a)||((e=e["from"])?([,e]=sb(l,e),e):o),o=c.map(t=>n(t,null!==i&&void 0!==i?i:s));return[t,Object.assign(Object.assign({},(t=o,o=(null==r?void 0:r(e))||e,t=rb(t,o),Object.assign(Object.assign({},t),{constant:!1}))),{aggregate:!0})]}),n=Object.keys(l).map(t=>{const[e,n]=sb(l,t);return[t,rb(c.map(t=>e[t[0]]),n)]}),r=c.map(t=>s[t[0]]);return[_p(c),ot({},e,{data:r,encode:Object.fromEntries([...n,...t])})]}},Xb=(Ub.props={},(t={})=>{const{channels:n=["x","y"]}=t,e=at(t,["channels"]);return Ub(Object.assign(Object.assign({},e),{groupBy:(t,e)=>ub(n,t,e)}))}),Kb=(Xb.props={},(t={})=>Xb(Object.assign(Object.assign({},t),{channels:["x","color","series"]}))),Zb=(Kb.props={},(t={})=>Xb(Object.assign(Object.assign({},t),{channels:["y","color","series"]}))),Qb=(Zb.props={},(t={})=>Xb(Object.assign(Object.assign({},t),{channels:["color"]})));function Jb(t,e,n){var{reverse:r,slice:i,channel:a}=n,n=at(n,["reverse","slice","channel"]),{encode:o,scale:s={}}=e,s=null==(s=s[a])?void 0:s.domain;const[l]=sb(o,a);var c,n=function(t,e,n){const{by:r=t,reducer:i="max"}=e,[a]=sb(n,r);if("function"==typeof i)return t=>i(t,a);if("max"===i)return t=>Hd(t,t=>+a[t]);if("min"===i)return t=>Yd(t,t=>+a[t]);if("sum"===i)return t=>ep(t,t=>+a[t]);if("median"===i)return t=>Qd(t,t=>+a[t]);if("mean"===i)return t=>Zd(t,t=>+a[t]);if("first"===i)return t=>a[t[0]];if("last"===i)return t=>a[t[t.length-1]];throw new Error("Unknown reducer: "+i)}(a,n,o),o=function(t,e,n){if(!Array.isArray(n))return t;const r=new Set(n);return t.filter(t=>r.has(e[t]))}(t,l,s),n=(s=o,o=t=>l[t],(2!==(c=n).length?Cd(_d(s,c,o),([t,e],[n,r])=>fd(e,r)||fd(t,n)):Cd(Sd(s,o),([t,e],[n,r])=>c(e,r)||fd(t,n))).map(([t])=>t)),s=(r&&n.reverse(),"number"==typeof i?[0,i]:i),o=i?n.slice(...s):n;return[t,ot(e,{scale:{[a]:{domain:o}}})]}Qb.props={};const t2=(t={})=>{const{reverse:o=!1,slice:s,channel:l,ordinal:c=!0}=t,u=at(t,["reverse","slice","channel","ordinal"]);return(t,e)=>{if(c)return Jb(t,e,Object.assign({reverse:o,slice:s,channel:l},u));{var n=Object.assign({reverse:o,slice:s,channel:l},u);var{reverse:n,channel:r}=n,i=e["encode"];const[a]=sb(i,r);return i=Cd(t,t=>a[t]),n&&i.reverse(),[i,e]}}},e2=(t2.props={},(t={})=>t2(Object.assign(Object.assign({},t),{channel:"x"}))),n2=(e2.props={},(t={})=>t2(Object.assign(Object.assign({},t),{channel:"color"}))),r2=(n2.props={},(t={})=>t2(Object.assign(Object.assign({},t),{channel:"y"})));r2.props={};const i2=(t={})=>{const{field:o,channel:s="y",reducer:l="sum"}=t;return(t,e)=>{var{data:n,encode:r}=e;const[i]=sb(r,"x");var a,n=o?(n=n,"string"==typeof(a=o)?n.map(t=>t[a]):n.map(a)):sb(r,s)[0],r=Td(t,function(e,n){if("function"==typeof e)return t=>e(t,n);if("sum"===e)return t=>ep(t,t=>+n[t]);throw new Error("Unknown reducer: "+e)}(l,n),t=>i[t]).map(t=>t[1]);return[t,ot({},e,{scale:{x:{flex:r}}})]}};function a2([t,e],[n,r]){return[t-n,e-r]}function o2([t,e],[n,r]){return[t+n,e+r]}function s2([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function l2([t,e]){return Math.atan2(e,t)}function c2([t,e]){return l2([t,e])+Math.PI/2}function u2(t,e){t=l2(t),e=l2(e);return t<e?e-t:2*Math.PI-(t-e)}function h2(t){let e=1/0,n=-1/0,r=1/0,i=-1/0;for(var[a,o]of t)e=Math.min(a,e),n=Math.max(a,n),r=Math.min(o,r),i=Math.max(o,i);var t=n-e,s=i-r;return[e,r,t,s]}function f2([t,e],[n,r]){return[(t+n)/2,(e+r)/2]}function d2(t,e,n){var r=t.length;if(0===r)return[];var{innerWidth:i,innerHeight:a}=n;let l=Math.ceil(Math.sqrt(e/(a/i))),c=i/l,u=Math.ceil(e/l),o=u*c;for(;o>a;)l+=1,c=i/l,u=Math.ceil(e/l),o=u*c;const h=a-u*c,f=u<=1?0:h/(u-1),[d,p]=u<=1?[(i-r*c)/(r-1),(a-c)/2]:[0,0];return t.map((t,e)=>{var[t,n,r,i]=h2(t),a=e%l,e=Math.floor(e/l),o=a*c,s=(u-e-1)*c+h,r=c/r,i=c/i;return`translate(${o-t+d*a}, ${s-n-f*e-p}) scale(${r}, ${i})`})}i2.props={};const p2=()=>(t,e)=>[t,ot({},e,{modifier:d2,axis:!1})],g2=(p2.props={},"thresholds");function y2(t){var e,[n,r]=wd(t);return Math.min(200,(n=n,r=r,e=bd(t=t),t=xd(t),e&&t?Math.ceil((r-n)*Math.cbrt(e)/(3.49*t)):1))}const m2=(t={})=>{const{groupChannels:s=["color"],binChannels:l=["x","y"]}=t,c=at(t,["groupChannels","binChannels"]),u={};return Ub(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(c).filter(([t])=>!t.startsWith(g2)))),Object.fromEntries(l.flatMap(e=>{var t=([t])=>+u[e].get(t).split(",")[1];return[[t.from=e,([t])=>+u[e].get(t).split(",")[0]],[e+"1",t]]}))),{groupBy:(t,e)=>{const n=e["encode"],i=l.map(t=>{var[t]=sb(n,t);return t}),a=st(c,g2),o=t.filter(e=>i.every(t=>sp(t[e]))),r=[...s.map(t=>{var[t]=sb(n,t);return t}).filter(sp).map(e=>t=>e[t]),...l.map((t,e)=>{const n=i[e];e=a[t]||y2(n),e=Gd().thresholds(e).value(t=>+n[t])(o);const r=new Map(e.flatMap(t=>{var{x0:e,x1:n}=t;const r=e+","+n;return t.map(t=>[t,r])}));return u[t]=r,t=>r.get(t)})];return Array.from(Sd(o,e=>r.map(t=>t(e)).join("-")).values())}}))},v2=(m2.props={},(t={})=>{var e=t["thresholds"];return m2(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))});function b2(e,n,r,t){var a=e.length;if(a<=t||0===t)return e;var o,s=t=>+n[e[t]],l=t=>+r[e[t]],c=[],u=(a-2)/(t-2);let h=0,f,d;c.push(h);for(let i=0;i<t-2;i++){let t=0,e=0,n=Math.floor((i+1)*u)+1;for(var p=Math.floor((i+2)*u)+1,g=(p=Math.min(p,a))-n;n<p;n++)t+=s(n),e+=l(n);t/=g,e/=g;let r=Math.floor((i+0)*u)+1;var y=Math.floor((i+1)*u)+1,m=[s(h),l(h)];for(f=-1;r<y;r++)(o=.5*Math.abs((m[0]-t)*(s(r)-m[1])-(m[0]-l(r))*(e-m[0])))>f&&(f=o,d=r);c.push(d),h=d}return c.push(a-1),c.map(t=>e[t])}function x2(t){if("function"==typeof t)return t;if("lttb"===t)return b2;var e={first:t=>[t[0]],last:t=>[t[t.length-1]],min:(t,e,n)=>[t[qd(t,t=>n[t])]],max:(t,e,n)=>[t[Vd(t,t=>n[t])]],median:(t,e,n)=>{return[t[Kd(t,.5,t=>n[t])]]}};const i=e[t]||e.median;return(t,e,n,r)=>{return function(t,e){var 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/r))).flatMap(t=>i(t,e,n))}}v2.props={};const w2=(t={})=>{const{strategy:e="median",thresholds:a=2e3,groupBy:o=["series","color"]}=t,s=x2(e);return(t,e)=>{var n=e["encode"],t=ub(o,t,e);const[r]=sb(n,"x"),[i]=sb(n,"y");return[t.flatMap(t=>s(t,r,i,a)),e]}};w2.props={};const M2=(o={})=>(t,e)=>{const{encode:l,data:n}=e,r=Object.entries(o).map(([t,e])=>{const[n]=sb(l,t);if(!n)return null;const[r,i=!0]="object"==typeof(t=e)?[t.value,t.ordinal]:[t,!0];if("function"==typeof r)return t=>r(n[t]);if(i){const a=Array.isArray(r)?r:[r];return 0===a.length?null:t=>a.includes(n[t])}{const[o,s]=r;return t=>n[t]>=o&&n[t]<=s}}).filter(sp);if(0===r.length)return[t,e];const i=t.filter(e=>r.every(t=>t(e))),a=i.map((t,e)=>e);t=Object.entries(l).map(([t,e])=>[t,Object.assign(Object.assign({},e),{value:a.map(t=>e.value[i[t]])})]);return[a,ot({},e,{encode:Object.fromEntries(t),data:i.map(t=>n[t])})]};function O2(t){return function(){return t}}M2.props={};const k2=Math.abs,E2=Math.atan2,S2=Math.cos,A2=Math.max,_2=Math.min,T2=Math.sin,P2=Math.sqrt,C2=1e-12,L2=Math.PI,N2=L2/2,j2=2*L2;function R2(t){return 1<=t?N2:t<=-1?-N2:Math.asin(t)}const I2=Math.PI,B2=2*I2,D2=1e-6,F2=B2-D2;function z2(n){this._+=n[0];for(let t=1,e=n.length;t<e;++t)this._+=arguments[t]+n[t]}class W2{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?z2:function(t){var e=Math.floor(t);if(!(0<=e))throw new Error("invalid digits: "+t);if(15<e)return z2;const r=10**e;return function(n){this._+=n[0];for(let t=1,e=n.length;t<e;++t)this._+=Math.round(arguments[t]*r)/r+n[t]}}(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,a){this._append`C${+t},${+e},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(t,e,n,r,i){if(t=+t,e=+e,n=+n,r=+r,(i=+i)<0)throw new Error("negative radius: "+i);var a,o,s=this._x1,l=this._y1,c=n-t,u=r-e,h=s-t,f=l-e,d=h*h+f*f;null===this._x1?this._append`M${this._x1=t},${this._y1=e}`:d>D2&&(Math.abs(f*c-u*h)>D2&&i?(o=c*c+u*u,r=(n=n-s)*n+(s=r-l)*s,l=Math.sqrt(o),a=Math.sqrt(d),d=(o=i*Math.tan((I2-Math.acos((o+d-r)/(2*l*a)))/2))/a,r=o/l,Math.abs(d-1)>D2&&this._append`L${t+d*h},${e+d*f}`,this._append`A${i},${i},0,0,${+(h*s<f*n)},${this._x1=t+r*c},${this._y1=e+r*u}`):this._append`L${this._x1=t},${this._y1=e}`)}arc(t,e,n,r,i,a){if(t=+t,e=+e,a=!!a,(n=+n)<0)throw new Error("negative radius: "+n);let o=n*Math.cos(r),s=n*Math.sin(r),l=t+o,c=e+s,u=1^a,h=a?r-i:i-r;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>D2||Math.abs(this._y1-c)>D2)&&this._append`L${l},${c}`,n&&((h=h<0?h%B2+B2:h)>F2?this._append`A${n},${n},0,1,${u},${t-o},${e-s}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:h>D2&&this._append`A${n},${n},0,${+(h>=I2)},${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 G2(){return new W2}function H2(n){let r=3;return n.digits=function(t){if(!arguments.length)return r;if(null==t)r=null;else{var e=Math.floor(t);if(!(0<=e))throw new RangeError("invalid digits: "+t);r=e}return n},()=>new W2(r)}function V2(t){return t.innerRadius}function Y2(t){return t.outerRadius}function q2(t){return t.startAngle}function $2(t){return t.endAngle}function U2(t){return t&&t.padAngle}function X2(t,e,n,r,i,a,o){var s=t-n,l=e-r,o=(o?a:-a)/P2(s*s+l*l),l=o*l,o=-o*s,s=t+l,t=e+o,e=n+l,n=r+o,r=(s+e)/2,c=(t+n)/2,u=e-s,h=n-t,f=u*u+h*h,a=i-a,s=s*n-e*t,n=(h<0?-1:1)*P2(A2(0,a*a*f-s*s)),e=(s*h-u*n)/f,t=(-s*u-h*n)/f,d=(s*h+u*n)/f,s=(-s*u+h*n)/f,u=e-r,h=t-c,n=d-r,f=s-c;return n*n+f*f<u*u+h*h&&(e=d,t=s),{cx:e,cy:t,x01:-l,y01:-o,x11:e*(i/a-1),y11:t*(i/a-1)}}function K2(){var _=V2,T=Y2,P=O2(0),C=null,L=q2,N=$2,j=U2,R=null,I=H2(e);function e(){var t,e,n,r,i,a,o,s,l,c,u,h,f,d,p,g,y,m,v,b,x,w,M=+_.apply(this,arguments),O=+T.apply(this,arguments),k=L.apply(this,arguments)-N2,E=N.apply(this,arguments)-N2,S=k2(E-k),A=k<E;if(R=R||(t=I()),O<M&&(e=O,O=M,M=e),O>C2?S>j2-C2?(R.moveTo(O*S2(k),O*T2(k)),R.arc(0,0,O,k,E,!A),M>C2&&(R.moveTo(M*S2(E),M*T2(E)),R.arc(0,0,M,E,k,A))):(r=e=k,i=n=E,o=a=S,f=(u=j.apply(this,arguments)/2)>C2&&(C?+C.apply(this,arguments):P2(M*M+O*O)),w=x=s=_2(k2(O-M)/2,+P.apply(this,arguments)),f>C2&&(h=R2(f/M*T2(u)),f=R2(f/O*T2(u)),(a-=2*h)>C2?(r+=h*=A?1:-1,i-=h):(a=0,r=i=(k+E)/2),(o-=2*f)>C2?(e+=f*=A?1:-1,n-=f):(o=0,e=n=(k+E)/2)),u=O*S2(e),h=O*T2(e),f=M*S2(i),k=M*T2(i),s>C2&&(d=O*S2(n),p=O*T2(n),g=M*S2(r),y=M*T2(r),S<L2)&&((E=function(t,e,n,r,i,a,o,s){var l=(s=s-a)*(n=n-t)-(o=o-i)*(r=r-e);if(!(l*l<C2))return[t+(l=(o*(e-a)-s*(t-i))/l)*n,e+l*r]}(u,h,g,y,d,p,f,k))?(S=u-E[0],v=h-E[1],b=d-E[0],m=p-E[1],v=1/T2((1<(S=(S*b+v*m)/(P2(S*S+v*v)*P2(b*b+m*m)))?0:S<-1?L2:Math.acos(S))/2),b=P2(E[0]*E[0]+E[1]*E[1]),x=_2(s,(M-b)/(v-1)),w=_2(s,(O-b)/(1+v))):x=w=0),o>C2?w>C2?(l=X2(g,y,u,h,O,w,A),c=X2(d,p,f,k,O,w,A),R.moveTo(l.cx+l.x01,l.cy+l.y01),w<s?R.arc(l.cx,l.cy,w,E2(l.y01,l.x01),E2(c.y01,c.x01),!A):(R.arc(l.cx,l.cy,w,E2(l.y01,l.x01),E2(l.y11,l.x11),!A),R.arc(0,0,O,E2(l.cy+l.y11,l.cx+l.x11),E2(c.cy+c.y11,c.cx+c.x11),!A),R.arc(c.cx,c.cy,w,E2(c.y11,c.x11),E2(c.y01,c.x01),!A))):(R.moveTo(u,h),R.arc(0,0,O,e,n,!A)):R.moveTo(u,h),M>C2&&a>C2?x>C2?(l=X2(f,k,d,p,M,-x,A),c=X2(u,h,g,y,M,-x,A),R.lineTo(l.cx+l.x01,l.cy+l.y01),x<s?R.arc(l.cx,l.cy,x,E2(l.y01,l.x01),E2(c.y01,c.x01),!A):(R.arc(l.cx,l.cy,x,E2(l.y01,l.x01),E2(l.y11,l.x11),!A),R.arc(0,0,M,E2(l.cy+l.y11,l.cx+l.x11),E2(c.cy+c.y11,c.cx+c.x11),A),R.arc(c.cx,c.cy,x,E2(c.y11,c.x11),E2(c.y01,c.x01),!A))):R.arc(0,0,M,i,r,A):R.lineTo(f,k)):R.moveTo(0,0),R.closePath(),t)return R=null,t+""||null}return e.centroid=function(){var t=(+_.apply(this,arguments)+ +T.apply(this,arguments))/2,e=(+L.apply(this,arguments)+ +N.apply(this,arguments))/2-L2/2;return[S2(e)*t,T2(e)*t]},e.innerRadius=function(t){return arguments.length?(_="function"==typeof t?t:O2(+t),e):_},e.outerRadius=function(t){return arguments.length?(T="function"==typeof t?t:O2(+t),e):T},e.cornerRadius=function(t){return arguments.length?(P="function"==typeof t?t:O2(+t),e):P},e.padRadius=function(t){return arguments.length?(C=null==t?null:"function"==typeof t?t:O2(+t),e):C},e.startAngle=function(t){return arguments.length?(L="function"==typeof t?t:O2(+t),e):L},e.endAngle=function(t){return arguments.length?(N="function"==typeof t?t:O2(+t),e):N},e.padAngle=function(t){return arguments.length?(j="function"==typeof t?t:O2(+t),e):j},e.context=function(t){return arguments.length?(R=null==t?null:t,e):R},e}function Z2(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Q2(t){this._context=t}function J2(t){return new Q2(t)}function tx(t){return t[0]}function ex(t){return t[1]}function nx(o,s){var l=O2(!0),c=null,u=J2,h=null,f=H2(e);function e(t){var e,n,r,i=(t=Z2(t)).length,a=!1;for(null==c&&(h=u(r=f())),e=0;e<=i;++e)!(e<i&&l(n=t[e],e,t))===a&&((a=!a)?h.lineStart():h.lineEnd()),a&&h.point(+o(n,e,t),+s(n,e,t));if(r)return h=null,r+""||null}return o="function"==typeof o?o:void 0===o?tx:O2(o),s="function"==typeof s?s:void 0===s?ex:O2(s),e.x=function(t){return arguments.length?(o="function"==typeof t?t:O2(+t),e):o},e.y=function(t){return arguments.length?(s="function"==typeof t?t:O2(+t),e):s},e.defined=function(t){return arguments.length?(l="function"==typeof t?t:O2(!!t),e):l},e.curve=function(t){return arguments.length?(u=t,null!=c&&(h=u(c)),e):u},e.context=function(t){return arguments.length?(null==t?c=h=null:h=u(c=t),e):c},e}function rx(u,h,f){var d=null,p=O2(!0),g=null,y=J2,m=null,v=H2(e);function e(t){var e,n,r,i,a,o=(t=Z2(t)).length,s=!1,l=new Array(o),c=new Array(o);for(null==g&&(m=y(a=v())),e=0;e<=o;++e){if(!(e<o&&p(i=t[e],e,t))===s)if(s=!s)n=e,m.areaStart(),m.lineStart();else{for(m.lineEnd(),m.lineStart(),r=e-1;n<=r;--r)m.point(l[r],c[r]);m.lineEnd(),m.areaEnd()}s&&(l[e]=+u(i,e,t),c[e]=+h(i,e,t),m.point(d?+d(i,e,t):l[e],f?+f(i,e,t):c[e]))}if(a)return m=null,a+""||null}function t(){return nx().defined(p).curve(y).context(g)}return u="function"==typeof u?u:void 0===u?tx:O2(+u),h="function"==typeof h?h:O2(void 0===h?0:+h),f="function"==typeof f?f:void 0===f?ex:O2(+f),e.x=function(t){return arguments.length?(u="function"==typeof t?t:O2(+t),d=null,e):u},e.x0=function(t){return arguments.length?(u="function"==typeof t?t:O2(+t),e):u},e.x1=function(t){return arguments.length?(d=null==t?null:"function"==typeof t?t:O2(+t),e):d},e.y=function(t){return arguments.length?(h="function"==typeof t?t:O2(+t),f=null,e):h},e.y0=function(t){return arguments.length?(h="function"==typeof t?t:O2(+t),e):h},e.y1=function(t){return arguments.length?(f=null==t?null:"function"==typeof t?t:O2(+t),e):f},e.lineX0=e.lineY0=function(){return t().x(u).y(h)},e.lineY1=function(){return t().x(u).y(f)},e.lineX1=function(){return t().x(d).y(h)},e.defined=function(t){return arguments.length?(p="function"==typeof t?t:O2(!!t),e):p},e.curve=function(t){return arguments.length?(y=t,null!=g&&(m=y(g)),e):y},e.context=function(t){return arguments.length?(null==t?g=m=null:m=y(g=t),e):g},e}G2.prototype=W2.prototype,Q2.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 ix=ox(J2);function ax(t){this._curve=t}function ox(e){function t(t){return new ax(e(t))}return t._curve=e,t}function sx(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(ox(t)):e()._curve},t}function lx(){}function cx(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 ux(t,e){this._context=t,this._k=(1-e)/6}function hx(t,e){this._context=t,this._k=(1-e)/6}function fx(t,e,n){var r,i,a=t._x1,o=t._y1,s=t._x2,l=t._y2;t._l01_a>C2&&(r=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a),a=(a*r-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,o=(o*r-t._y0*t._l12_2a+t._y2*t._l01_2a)/i),t._l23_a>C2&&(r=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,i=3*t._l23_a*(t._l23_a+t._l12_a),s=(s*r+t._x1*t._l23_2a-e*t._l12_2a)/i,l=(l*r+t._y1*t._l23_2a-n*t._l12_2a)/i),t._context.bezierCurveTo(a,o,s,l,t._x2,t._y2)}function dx(t,e){this._context=t,this._alpha=e}ax.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))}},ux.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:cx(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:cx(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 e(n){function t(t){return new ux(t,n)}return t.tension=function(t){return e(+t)},t}(0),hx.prototype={areaStart:lx,areaEnd:lx,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:cx(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 e(n){function t(t){return new hx(t,n)}return t.tension=function(t){return e(+t)},t}(0),dx.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){var n,r;switch(t=+t,e=+e,this._point&&(n=this._x2-t,r=this._y2-e,this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))),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:fx(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 px=function e(n){function t(t){return n?new dx(t,n):new ux(t,0)}return t.alpha=function(t){return e(+t)},t}(.5);function gx(t,e){this._context=t,this._alpha=e}gx.prototype={areaStart:lx,areaEnd:lx,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){var n,r;switch(t=+t,e=+e,this._point&&(n=this._x2-t,r=this._y2-e,this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))),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:fx(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 yx=function e(n){function t(t){return n?new gx(t,n):new hx(t,0)}return t.alpha=function(t){return e(+t)},t}(.5);function mx(t){this._context=t}function vx(t){return new mx(t)}function bx(t,e){this._context=t,this._t=e}function xx(t){return new bx(t,.5)}function wx(t){return new bx(t,0)}function Mx(t){return new bx(t,1)}function Ox(t,e,n){return Math.max(e,Math.min(t,n))}function L(t,e){for(var[n,r]of Object.entries(e))t.style(n,r)}function kx(t,e,n,r,i){e=l2(a2(r,e))+Math.PI,n=l2(a2(r,n))+Math.PI;t.arc(r[0],r[1],i,e,n,n-e<0)}function Ex(e,t,n,r="y",i="between"){const a="y"===r||!0===r?n:t;var n="y"===r||!0===r?90:0,t=_p(a),[r,o]=wd(t,t=>a[t]);const s=new wg({domain:[r,o],range:[0,100]}),l=t=>s.map(a[t]);r={between:t=>`${e[t]} ${l(t)}%`,start:t=>0===t?`${e[t]} ${l(t)}%`:`${e[t-1]} ${l(t)}%, ${e[t]} ${l(t)}%`,end:t=>t===e.length-1?`${e[t]} ${l(t)}%`:`${e[t]} ${l(t)}%, ${e[t+1]} ${l(t)}%`};return`linear-gradient(${n}deg, ${t.sort((t,e)=>l(t)-l(e)).map(r[i]||r.between).join(",")})`}function Sx(t){var[t,e,n,r]=t;return[r,t,e,n]}function Ax(t,e,n){var[e,r,,i]=rv(t)?Sx(e):e,[n,a]=n,t=t.getCenter(),o=c2(a2(e,t)),r=c2(a2(r,t)),n=r===o&&n!==a?r+2*Math.PI:r;return{startAngle:o,endAngle:0<=n-o?n:2*Math.PI+n,innerRadius:s2(i,t),outerRadius:s2(e,t)}}function _x(t){var{colorAttribute:t,opacityAttribute:t=t}=t;return t+"Opacity"}function Tx(t,e){return iv(t)?(e=e["transform"],`translate(${(t=t.getCenter())[0]}, ${t[1]}) `+(e||"")):""}function Px(t){var e,n,r;return 1===t.length?t[0]:([[t,e],[n,r]]=t,[(t+n)/2,(e+r)/2])}function Cx(t,e,n,r,i={}){var{inset:a=0,radius:o=0,insetLeft:s=a,insetTop:l=a,insetRight:c=a,insetBottom:u=a,radiusBottomLeft:h=o,radiusBottomRight:f=o,radiusTopLeft:d=o,radiusTopRight:p=o,minWidth:g=-1/0,maxWidth:y=1/0}=i,i=at(i,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth"]);if(!iv(r)&&!ov(r)){var m=!!rv(r),[v,,b]=m?Sx(e):e;const[k,M]=v;var[b,v]=a2(b,v),x=(0<b?k:k+b)+s,w=(0<v?M:M+v)+l,b=Math.abs(b)-(s+c),s=Math.abs(v)-(l+u),c=m?b:Ox(b,g,y),v=m?Ox(s,g,y):s,l=x-(c-b)/2,u=w-(v-s)/2;return lt(t.createElement("rect",{})).style("x",l).style("y",u).style("width",c).style("height",v).style("radius",[d,p,f,h]).call(L,i).node()}const{y:M,y1:O}=n;m=r.getCenter(),g=Ax(r,e,[M,O]),y=K2().cornerRadius(o).padAngle(a*Math.PI/180);return lt(t.createElement("path",{})).style("path",y(g)).style("transform",`translate(${m[0]}, ${m[1]})`).style("radius",o).style("inset",a).call(L,i).node()}mx.prototype={areaStart:lx,areaEnd:lx,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))}},bx.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(),0<=this._line&&(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:var n;this._t<=0?(this._context.lineTo(this._x,e),this._context.lineTo(t,e)):(n=this._x*(1-this._t)+t*this._t,this._context.lineTo(n,this._y),this._context.lineTo(n,e))}this._x=t,this._y=e}};const Lx=(E,t)=>{const{colorAttribute:S,first:A=!0,last:_=!0}=E,T=at(E,["colorAttribute","opacityAttribute","first","last"]),{coordinate:P,document:C}=t;return(t,e,n)=>{var{color:r,radius:i=0}=n,n=at(n,["color","radius"]),a=n.lineWidth||1,{stroke:o,radius:i=i,radiusTopLeft:s=i,radiusTopRight:l=i,radiusBottomRight:c=i,radiusBottomLeft:u=i,innerRadius:h=0,innerRadiusTopLeft:f=h,innerRadiusTopRight:d=h,innerRadiusBottomRight:p=h,innerRadiusBottomLeft:h=h,lineWidth:a="stroke"===S||o?a:0,inset:g=0,insetLeft:y=g,insetRight:m=g,insetBottom:v=g,insetTop:b=g,minWidth:x,maxWidth:w}=T,M=at(T,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop","minWidth","maxWidth"]),{color:r=r,opacity:O}=e;const k=[A?s:f,A?l:d,_?c:p,_?u:h];s=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"],rv(P)&&s.push(s.shift()),f=Object.assign(Object.assign({radius:i},Object.fromEntries(s.map((t,e)=>[t,k[e]]))),{inset:g,insetLeft:y,insetRight:m,insetBottom:v,insetTop:b,minWidth:x,maxWidth:w});return lt(Cx(C,t,e,P,f)).call(L,n).style("fill","transparent").style(S,r).style(_x(E),O).style("lineWidth",a).style("stroke",void 0===o?r:o).call(L,M).node()}};Lx.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};Ys=(t,e)=>Lx(Object.assign({colorAttribute:"fill"},t),e),Ys.props=Object.assign(Object.assign({},Lx.props),{defaultMarker:"square"}),o=(t,e)=>Lx(Object.assign({colorAttribute:"stroke"},t),e);o.props=Object.assign(Object.assign({},Lx.props),{defaultMarker:"hollowSquare"});const Nx=(t,e)=>{const{adjustPoints:s=function(t,e,n){var[t,r,i,a]=t;if(rv(n)){const o=[(e?e[0]:r)[0],r[1]],s=[(e?e[3]:i)[0],i[1]];return[t,o,s,a]}const o=[r[0],(e?e[0]:r)[1]],s=[i[0],(e?e[3]:i)[1]];return[t,o,s,a]}}=t,l=at(t,["adjustPoints"]),{coordinate:c,document:u}=e;return(t,e,n,r)=>{var i=e["index"],a=n["color"],n=at(n,["color"]),r=r[i+1],i=s(t,r,c),[t,r,i,o]=!!rv(c)?Sx(i):i,{color:e=a,opacity:a}=e,t=nx().curve(vx)([t,r,i,o]);return lt(u.createElement("path",{})).call(L,n).style("path",t).style("fill",e).style("fillOpacity",a).call(L,l).node()}};function jx(t,e,n){var[t,r,i,a]=t;if(rv(n)){const o=[e?e[0][0]:(r[0]+i[0])/2,r[1]],s=[e?e[3][0]:(r[0]+i[0])/2,i[1]];return[t,o,s,a]}const o=[r[0],e?e[0][1]:(r[1]+i[1])/2],s=[i[0],e?e[3][1]:(r[1]+i[1])/2];return[t,o,s,a]}Nx.props={defaultMarker:"square"};Js=(t,e)=>Nx(Object.assign({adjustPoints:jx},t),e);function Rx(t){const e="function"==typeof t?t:t.render;return class extends oc{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}Js.props={defaultMarker:"square"};const Ix=Rx(t=>{var{d1:e,d2:n,style1:r,style2:i}=t.attributes;const a=t.ownerDocument;lt(t).maybeAppend("line",()=>a.createElement("path",{})).style("d",e).call(L,r),lt(t).maybeAppend("line1",()=>a.createElement("path",{})).style("d",n).call(L,i)});const Bx=(t,e)=>{const{curve:u,gradient:h=!1,gradientColor:f="between",defined:d=t=>!Number.isNaN(t)&&null!=t,connect:p=!1}=t,g=at(t,["curve","gradient","gradientColor","defined","connect"]),{coordinate:y,document:m}=e;return(t,e,n)=>{var{color:r,lineWidth:i}=n,n=at(n,["color","lineWidth"]),{color:r=r,size:i=i,seriesColor:a,seriesX:o,seriesY:s}=e,a=h&&a?Ex(a,o,s,h,f):r,o=Tx(y,e),s=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n),a&&{stroke:a}),i&&{lineWidth:i}),o&&{transform:o}),g);let l;if(iv(y)){const c=y.getCenter();l=n=>sx(nx().curve(ix)).angle((t,e)=>c2(a2(n[e],c))).radius((t,e)=>s2(n[e],c)).defined(([t,e])=>d(t)&&d(e)).curve(u)(n)}else l=nx().x(t=>t[0]).y(t=>t[1]).defined(([t,e])=>d(t)&&d(e)).curve(u);var[r,e]=function(t,e){var n=[],r=[];let i=!1,a=null;for(const o of t)e(o[0])&&e(o[1])?(n.push(o),i&&(i=!1,r.push([a,o])),a=o):i=!0;return[n,r]}(t,d),n=st(s,"connect"),a=!!e.length;return(!a||p&&!Object.keys(n).length?lt(m.createElement("path",{})).style("d",l(r)||[]).call(L,s):a&&!p?lt(m.createElement("path",{})).style("d",l(t)).call(L,s):lt(new Ix).style("style1",Object.assign(Object.assign({},s),n)).style("style2",s).style("d1",e.map(l).join(",")).style("d2",l(t))).node()}};Bx.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};_o=(n,r)=>{const i=r["coordinate"];return(...t)=>{var e=iv(i)?vx:J2;return Bx(Object.assign({curve:e},n),r)(...t)}},_o.props=Object.assign(Object.assign({},Bx.props),{defaultMarker:"line"}),Ro=(t,n)=>{const{alpha:r=.5}=t,i=at(t,["alpha"]),a=n["coordinate"];return(...t)=>{var e=iv(a)?yx:px;return Bx(Object.assign({curve:e.alpha(r)},i),n)(...t)}},Ro.props=Object.assign(Object.assign({},Bx.props),{defaultMarker:"smooth"}),No=(t,e)=>Bx(Object.assign({curve:Mx},t),e),No.props=Object.assign(Object.assign({},Bx.props),{defaultMarker:"hv"}),qo=(t,e)=>Bx(Object.assign({curve:wx},t),e),qo.props=Object.assign(Object.assign({},Bx.props),{defaultMarker:"vh"}),zo=(t,e)=>Bx(Object.assign({curve:xx},t),e);zo.props=Object.assign(Object.assign({},Bx.props),{defaultMarker:"hvh"});Ko=(b,t)=>{const x=t["document"];return(e,t,n)=>{var r,i,a,o,s,l,c,u,h,{seriesSize:f,color:t}=t,d=n["color"],n=at(n,["color"]),p=G2();for(let t=0;t<e.length-1;t++){var g=e[t],y=e[t+1],m=f[t],v=f[t+1];[...g,...y].every(sp)&&(r=p,m=m,v=v,s=a=i=h=u=c=l=s=o=i=a=i=void 0,i=(s=l2(a2(y=y,g=g)))+Math.PI/2,a=[m/2*Math.cos(i),m/2*Math.sin(i)],i=[v/2*Math.cos(i),v/2*Math.sin(i)],o=[v/2*Math.cos(s),v/2*Math.sin(s)],s=[m/2*Math.cos(s),m/2*Math.sin(s)],l=o2(g,a),c=o2(y,i),u=o2(c,o),h=a2(o=o2(y,o),i),y=a2(y,i),i=a2(g,a),a=a2(i,s),g=a2(g,s),s=a2(l,s),r.moveTo(...l),r.lineTo(...c),r.arcTo(...u,...o,v/2),r.arcTo(...h,...y,v/2),r.lineTo(...i),r.arcTo(...a,...g,m/2),r.arcTo(...s,...l,m/2),r.closePath())}return lt(x.createElement("path",{})).call(L,n).style("fill",t||d).style("d",p.toString()).call(L,b).node()}},Ko.props=Object.assign(Object.assign({},Bx.props),{defaultMarker:"line"}),Uo=(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"]],Uo.style=["fill"],es=Uo.bind(void 0),es.style=["stroke","lineWidth"],Qo=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]],Qo.style=["fill"],as=Qo.bind(void 0),as.style=["fill"],rs=Qo.bind(void 0),rs.style=["stroke","lineWidth"],Ws=(t,e,n)=>{var r=.618*n;return[["M",t-r,e],["L",t,e-n],["L",t+r,e],["L",t,e+n],["Z"]]},Ws.style=["fill"],Ss=Ws.bind(void 0),Ss.style=["stroke","lineWidth"],Go=(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"]]},Go.style=["fill"],zs=Go.bind(void 0),zs.style=["stroke","lineWidth"],$s=(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"]]},$s.style=["fill"],Ol=$s.bind(void 0),Ol.style=["stroke","lineWidth"],rl=(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"]]},rl.style=["fill"],n=rl.bind(void 0),n.style=["stroke","lineWidth"],Iy=(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"]]},Iy.style=["fill"],uu=Iy.bind(void 0),uu.style=["stroke","lineWidth"],Dy=(t,e,n)=>[["M",t,e+n],["L",t,e-n]],Dy.style=["stroke","lineWidth"],By=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]],By.style=["stroke","lineWidth"],zy=(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]],zy.style=["stroke","lineWidth"],Fy=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]],Fy.style=["stroke","lineWidth"],Gy=(t,e,n)=>[["M",t-n,e],["L",t+n,e]],Gy.style=["stroke","lineWidth"],Wy=(t,e,n)=>[["M",t-n,e],["L",t+n,e]],Wy.style=["stroke","lineWidth"],Vy=Wy.bind(void 0),Vy.style=["stroke","lineWidth"],Hy=(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]],Hy.style=["stroke","lineWidth"],qy=(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]],qy.style=["stroke","lineWidth"],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"],Uy=(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]],Uy.style=["stroke","lineWidth"],$y=(t,e,n)=>[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]];$y.style=["stroke","lineWidth"];const Dx=new Map([["bowtie",Iy],["cross",By],["dash",Vy],["diamond",Ws],["dot",Wy],["hexagon",rl],["hollowBowtie",uu],["hollowDiamond",Ss],["hollowHexagon",n],["hollowPoint",es],["hollowSquare",rs],["hollowTriangle",zs],["hollowTriangleDown",Ol],["hv",qy],["hvh",Uy],["hyphen",Gy],["line",Dy],["plus",Fy],["point",Uo],["rect",as],["smooth",Hy],["square",Qo],["tick",zy],["triangleDown",$s],["triangle",Go],["vh",Yy],["vhv",$y]]);const f=(c,t)=>{const{colorAttribute:u,symbol:e,mode:h="auto"}=c,f=at(c,["colorAttribute","symbol","mode"]),d=Dx.get(e)||Dx.get("point"),{coordinate:p,document:g}=t;return(t,e,n)=>{var{lineWidth:r,color:i}=n,r=f.stroke?r||1:r,{color:i=i,transform:a,opacity:o}=e,[s,l]=Px(t),t=function(t,e,n,r){var i;if(1!==e.length)return n=n["size"],"fixed"!==t&&("normal"===t||lv(r))?([[t,r],[e,i]]=e,e=Math.abs((e-t)/2),t=Math.abs((i-r)/2),Math.max(0,(e+t)/2)):n}(h,t,e,p)||f.r||n.r;return lt(g.createElement("path",{})).call(L,n).style("fill","transparent").style("d",d(s,l,t)).style("lineWidth",r).style("transform",a).style("stroke",i).style(_x(c),o).style(u,i).call(L,f).node()}};f.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};Ky=(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e),Ky.props=Object.assign({defaultMarker:"hollowBowtie"},f.props),Xy=(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e),Xy.props=Object.assign({defaultMarker:"hollowDiamond"},f.props),Qy=(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e),Qy.props=Object.assign({defaultMarker:"hollowHexagon"},f.props),Zy=(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e),Zy.props=Object.assign({defaultMarker:"hollowPoint"},f.props),tm=(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e),tm.props=Object.assign({defaultMarker:"hollowSquare"},f.props),Jy=(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e),Jy.props=Object.assign({defaultMarker:"hollowTriangle"},f.props),nm=(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e),nm.props=Object.assign({defaultMarker:"hollowTriangleDown"},f.props),em=(t,e)=>f(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e),em.props=Object.assign({defaultMarker:"bowtie"},f.props),im=(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e),im.props=Object.assign({defaultMarker:"cross"},f.props),rm=(t,e)=>f(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e),rm.props=Object.assign({defaultMarker:"diamond"},f.props),om=(t,e)=>f(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e),om.props=Object.assign({defaultMarker:"hexagon"},f.props),am=(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e),am.props=Object.assign({defaultMarker:"hyphen"},f.props),Co=(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e),Co.props=Object.assign({defaultMarker:"line"},f.props),sm=(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e),sm.props=Object.assign({defaultMarker:"plus"},f.props),lm=(t,e)=>f(Object.assign({colorAttribute:"fill",symbol:"point"},t),e),lm.props=Object.assign({defaultMarker:"point"},f.props),cm=(t,e)=>f(Object.assign({colorAttribute:"fill",symbol:"square"},t),e),cm.props=Object.assign({defaultMarker:"square"},f.props),So=(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e),So.props=Object.assign({defaultMarker:"tick"},f.props),gm=(t,e)=>f(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e),gm.props=Object.assign({defaultMarker:"triangle"},f.props),ym=(t,e)=>f(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e);ym.props=Object.assign({defaultMarker:"triangleDown"},f.props);const Fx=(t,e)=>{const{arrow:u=!0,arrowSize:h="40%"}=t,f=at(t,["arrow","arrowSize"]),d=e["document"];return(t,e,n)=>{var r,i,a,o,s=n["defaultColor"],n=at(n,["defaultColor"]),{color:e=s,transform:s}=e,[t,l]=t,c=G2();return c.moveTo(...t),c.lineTo(...l),u&&([a,o]=(t=t,r=l,i="string"==typeof(i=(i={arrowSize:h})["arrowSize"])?+parseFloat(i)/100*s2(t,r):i,a=Math.PI/6,t=Math.atan2(r[1]-t[1],r[0]-t[0]),o=Math.PI/2-t-a,t-=a,[[r[0]-i*Math.sin(o),r[1]-i*Math.cos(o)],[r[0]-i*Math.cos(t),r[1]-i*Math.sin(t)]]),c.moveTo(...l),c.lineTo(...a),c.moveTo(...l),c.lineTo(...o)),lt(d.createElement("path",{})).call(L,n).style("d",c.toString()).style("stroke",e).style("transform",s).call(L,f).node()}};function zx(t){Gx(t,!0)}function Wx(t){Gx(t,!1)}function Gx(t,e){var n=e?"visible":"hidden";!function e(t,n){n(t),t.children&&t.children.forEach(function(t){t&&e(t,n)})}(t,function(t){t.attr("visibility",n)})}Fx.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};t(Yx,Hx=fc);var Hx,Vx=Yx;function Yx(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Hx.apply(this,O([],j(t),!1))||this;return n.addEventListener(b.INSERTED,function(){Wx(n)}),n}function qx(t){t=t.appendChild(new Vx({class:"offscreen"}));return Wx(t),t}t(Xx,$x=Ic),Object.defineProperty(Xx.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=qx(this)),this._offscreen},enumerable:!1,configurable:!0}),Xx.prototype.disconnectedCallback=function(){var t;null!=(t=this._offscreen)&&t.destroy()};var $x,Ux=Xx;function Xx(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return $x.call(this,m({style:m({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},e)},t))||this}function Kx(t){return t*Math.PI/180}function Zx(t){return Number((180*t/Math.PI).toPrecision(5))}Object.defineProperty(Jx.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(Jx.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(Jx.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(Jx.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Jx.fromRect=function(t){return new Jx(t.x,t.y,t.width,t.height)},Jx.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}};var Qx=Jx;function Jx(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}function tw(t,e){return Pe(t)?t.apply(void 0,O([],j(e),!1)):t}function ew(t,e){function r(t){return"".concat(e,"-").concat(t)}return t=Object.fromEntries(Object.entries(t).map(function(t){var t=j(t,2),e=t[0],t=t[1],n=r(t);return[e,{name:n,class:".".concat(n),id:"#".concat(n),toString:function(){return n}}]})),Object.assign(t,{prefix:r}),t}function nw(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)iw(t,e[r]);return t}var rw,iw=function(r,i,a,o){void 0===a&&(a=0),void 0===o&&(o=5),Object.entries(i).forEach(function(t){var t=j(t,2),e=t[0],t=t[1],n=r;Object.prototype.hasOwnProperty.call(i,e)&&(t?Ie(t)?(Ie(r[e])||(n[e]={}),a<o?iw(r[e],t,a+1,o):n[e]=i[e]):Ne(t)?(n[e]=[],n[e]=n[e].concat(t)):n[e]=t:n[e]=t)})},aw=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},ow=Je(function(t,e){var n=ze(t)?t:t.style.text.toString(),e=e||sw(t),t=e.fontSize,r=e.fontFamily,i=e.fontWeight,a=e.fontStyle,e=e.fontVariant;return(rw=rw||document.createElement("canvas").getContext("2d")).font=[a,e,i,"".concat(t,"px"),r].join(" "),rw.measureText(n).width},function(t,e){return[ze(t)?t:t.style.text.toString(),Object.values(e||sw(t)).join()].join("")}),sw=function(t){var e=t.style.fontFamily||"sans-serif",n=t.style.fontWeight||"normal",r=t.style.fontStyle||"normal",i=t.style.fontVariant,t=t.style.fontSize;return{fontSize:"object"==typeof t?t.value:t,fontFamily:e,fontWeight:n,fontStyle:r,fontVariant:i}};function lw(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function cw(t,e){t=lw(t);t&&t.attr(e)}function uw(t,e,n){cw(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n=void 0===n?"...":n})}function hw(t){var e=t.canvas,n=t.touches,r=t.offsetX,t=t.offsetY;return e?[e.x,e.y]:n?[(e=n[0]).clientX,e.clientY]:r&&t?[r,t]:[0,0]}function fw(t){return"function"==typeof t?t():ze(t)||Ge(t)?new Ux({style:{text:String(t)}}):t}function dw(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 pw(t,e,n,r,i){return(r=void 0===r?!0:r)&&t===e||i&&t===n||e<t&&t<n}var gw=function(e,n){return function(t){return e*(1-t)+n*t}};function yw(e,t){var i,a,o,s,n,r,l;return"number"==typeof e&&"number"==typeof t?gw(e,t):Array.isArray(e)&&Array.isArray(t)?(i=e,o=(a=t)?a.length:0,s=i?Math.min(o,i.length):0,function(t){for(var e=new Array(s),n=new Array(o),r=0,r=0;r<s;++r)e[r]=yw(i[r],a[r]);for(;r<o;++r)n[r]=a[r];for(r=0;r<s;++r)n[r]=e[r](t);return n}):"object"==typeof e&&"object"==typeof t?(void 0===(n=e)&&(n={}),void 0===(t=t)&&(t={}),r={},l={},Object.entries(t).forEach(function(t){var t=j(t,2),e=t[0],t=t[1];e in n?r[e]=yw(n[e],t):l[e]=t}),function(n){return Object.entries(r).forEach(function(t){var t=j(t,2),e=t[0],t=t[1];return l[e]=t(n)}),l}):function(t){return e}}function mw(t){for(var e=1/0,n=1/0,r=-1/0,i=-1/0,a=0;a<t.length;a++){var o=t[a],s=o.x,l=o.y,o=j([s+o.width,l+o.height],2),c=o[0],o=o[1];s<e&&(e=s),l<n&&(n=l),r<c&&(r=c),i<o&&(i=o)}return new Qx(e,n,r-e,i-n)}function vw(n,t,e){function r(t){var e=j(u?["height",a]:["width",i],2),n=e[0],r=e[1];switch(c){case"flex-start":return 0;case"flex-end":return r-t[n];case"center":return r/2-t[n]/2;default:return 0}}var i=n.width,a=n.height,o=void 0===(o=e.flexDirection)?"row":o,s=(e.flexWrap,e.justifyContent),l=void 0===s?"flex-start":s;e.alignContent;var c=void 0===(s=e.alignItems)?"flex-start":s,u="row"===o,e="row"===o||"column"===o,h=u?e?[1,0]:[-1,0]:e?[0,1]:[0,-1],f=(s=j([0,0],2))[0],d=s[1],e=mw(o=t.map(function(t){var e=t.width,t=t.height,n=j([f,d],2),r=n[0],n=n[1],i=j([f+e*h[0],d+t*h[1]],2);return f=i[0],d=i[1],new Qx(r,n,e,t)})),p={"flex-start":0,"flex-end":u?i-e.width:a-e.height,center:u?(i-e.width)/2:(a-e.height)/2};return mw(s=o.map(function(t){var e=t.x,n=t.y,t=Qx.fromRect(t);return t.x=u?e+p[l]:e,t.y=u?n:n+p[l],t})),s.map(function(t){var e=t.x,n=t.y,t=Qx.fromRect(t);return t.x=u?e:e+r(t),t.y=u?n+r(t):n,t}).map(function(t){var e,t=Qx.fromRect(t);return t.x+=null!=(e=n.x)?e:0,t.y+=null!=(e=n.y)?e:0,t})}function bw(t,e,n){return[]}function xw(t,e){return[t[0]*e,t[1]*e]}function ww(t,e){return[t[0]+e[0],t[1]+e[1]]}function Mw(t,e){return[t[0]-e[0],t[1]-e[1]]}function Ow(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function kw(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function Ew(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Sw(t){var e;return 0===t[0]&&0===t[1]?[0,0]:(e=Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)),[t[0]/e,t[1]/e])}function Aw(t,e){return+t.toPrecision(e)}function _w(t,e){var n,r={},i=Array.isArray(e)?e:[e];for(n in t)i.includes(n)||(r[n]=t[n]);return r}function Tw(t,e,n){void 0===n&&(n=[[0,0],[1,1]]);for(var e=!!(e=void 0===e?!1:e),r=[],i=0,a=t.length;i<a;i+=2)r.push([t[i],t[i+1]]);for(var o,s,l,c=function(t,e,n,r){var i,a=[],o=!!r,s=[1/0,1/0],l=[-1/0,-1/0];if(o){s=(r=j(r,2))[0],l=r[1];for(var c=0,u=t.length;c<u;c+=1)s=Ow(s,x=t[c]),l=kw(l,x)}for(var c=0,h=t.length;c<h;c+=1){var f,d,p,g,y,m,v,b,x=t[c];0!==c||n?c!==h-1||n?(f=t[[c?c-1:h-1,c-1][n?0:1]],m=[0,0],m=xw(m=Mw(d=t[n?(c+1)%h:c+1],f),e),0!==(y=(p=Ew(x,f))+(g=Ew(x,d)))&&(p/=y,g/=y),y=xw(m,-p),m=xw(m,g),v=ww(x,y),b=Ow(b=ww(x,m),kw(d,x)),b=kw(b,Ow(d,x)),v=Ow(v=ww(x,y=xw(y=Mw(b,x),-p/g)),kw(f,x)),b=ww(x,m=xw(m=Mw(x,v=kw(v,Ow(f,x))),g/p)),o&&(v=Ow(v=kw(v,s),l),b=Ow(b=kw(b,s),l)),a.push(i),a.push(v),i=b):(v=x,a.push(i),a.push(v)):i=x}return n&&a.push(a.shift()),a}(r,.4,e,n),u=r.length,h=[],i=0;i<u-1;i+=1)o=c[2*i],s=c[2*i+1],h.push(["C",o[0],o[1],s[0],s[1],(l=r[i+1])[0],l[1]]);return e&&(o=c[u],s=c[u+1],l=j(r,1)[0],h.push(["C",o[0],o[1],s[0],s[1],l[0],l[1]])),h}var Pw=["$el","anchor","cx","cy","d","defX","defY","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","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 Cw(t){var e,n,r={};for(e in t)n=e,Pw.includes(n)&&(r[e]=t[e]);return r}function Lw(t,e,n){void 0===n&&(n=!1);var r=t.getBBox(),i=r.width,r=r.height,e=e/Math.max(i,r);n&&t.scale(e)}M.prototype.selectAll=function(t){return new M("string"==typeof t?this._parent.querySelectorAll(t):t,null,this._elements[0],this._document)},M.prototype.selectFacetAll=function(t){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new M(this._elements,null,this._parent,this._document,void 0,void 0,t)},M.prototype.select=function(t){t="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new M([t],null,t,this._document)},M.prototype.append=function(t){var e=this,n="function"==typeof t?t:function(){return e.createElement(t)},r=[];if(null!==this._data){for(var i=0;i<this._data.length;i++){var a=this._data[i],a=j(Array.isArray(a)?a:[a,null],2),o=a[0],a=a[1];(l=n(o,i)).__data__=o,null!==a&&(l.__fromElements__=a),this._parent.appendChild(l),r.push(l)}return new M(r,null,this._parent,this._document)}for(i=0;i<this._elements.length;i++){var s=this._elements[i],l=n(o=s.__data__,i);s.appendChild(l),r.push(l)}return new M(r,null,r[0],this._document)},M.prototype.maybeAppend=function(t,e){e=B(this,Nw,"m",jw).call(this,"#"===t[0]?t:"#".concat(t),e);return e.attr("id",t),e},M.prototype.maybeAppendByClassName=function(t,e){t=t.toString(),e=B(this,Nw,"m",jw).call(this,"."===t[0]?t:".".concat(t),e);return e.attr("className",t),e},M.prototype.maybeAppendByName=function(t,e){e=B(this,Nw,"m",jw).call(this,'[name="'.concat(t,'"]'),e);return e.attr("name",t),e},M.prototype.data=function(t,n,e){void 0===n&&(n=function(t){return t}),void 0===e&&(e=function(){return null});for(var r,i,a=[],o=[],s=new Set(this._elements),l=[],c=new Set,u=new Map(this._elements.map(function(t,e){return[n(t.__data__,e),t]})),h=new Map(this._facetElements.map(function(t,e){return[n(t.__data__,e),t]})),f=Sd(this._elements,function(t){return e(t.__data__)}),d=0;d<t.length;d++){var p=t[d],g=n(p,d),y=e(p,d);if(u.has(g))(x=u.get(g)).__data__=p,x.__facet__=!1,o.push(x),s.delete(x),u.delete(g);else if(h.has(g))(x=h.get(g)).__data__=p,x.__facet__=!0,o.push(x),h.delete(g);else if(f.has(g)){var m=f.get(g);l.push([p,m]);try{r=void 0;for(var v=I(m),b=v.next();!b.done;b=v.next()){var x=b.value;s.delete(x)}}catch(t){r={error:t}}finally{try{b&&!b.done&&(i=v.return)&&i.call(v)}finally{if(r)throw r.error}}f.delete(g)}else u.has(y)?((x=u.get(y)).__toData__?x.__toData__.push(p):x.__toData__=[p],c.add(x),s.delete(x)):a.push(p)}var w=[new M([],a,this._parent,this._document),new M(o,null,this._parent,this._document),new M(s,null,this._parent,this._document),new M([],l,this._parent,this._document),new M(c,null,this._parent,this._document)];return new M(this._elements,null,this._parent,this._document,w)},M.prototype.merge=function(t){var e=O(O([],j(this._elements),!1),j(t._elements),!1),t=O(O([],j(this._transitions),!1),j(t._transitions),!1);return new M(e,null,this._parent,this._document,void 0,t)},M.prototype.createElement=function(t){if(this._document)return this._document.createElement(t,{});var e=M.registry[t];if(e)return new e;throw e="Unknown node type: ".concat(t),new Error(e)},M.prototype.join=function(t,e,n,r,i){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()});t=(t=void 0===t?function(t){return t}:t)(this._enter),e=e(this._update),n=n(this._exit),r=r(this._merge),i=i(this._split);return e.merge(t).merge(n).merge(r).merge(i)},M.prototype.remove=function(){for(var n=this,t=0;t<this._elements.length;t++)!function(t){var e=n._elements[t],t=n._transitions[t];t?t.then(function(){return e.remove()}):e.remove()}(t);return new M([],null,this._parent,this._document,void 0,this._transitions)},M.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},M.prototype.attr=function(n,r){var i="function"!=typeof r?function(){return r}:r;return this.each(function(t,e){void 0!==r&&(this[n]=i.call(this,t,e))})},M.prototype.style=function(n,r,t){void 0===t&&(t=!0);var i="function"==typeof r&&t?r:function(){return r};return this.each(function(t,e){void 0!==r&&(this.style[n]=i.call(this,t,e))})},M.prototype.styles=function(t,o){return void 0===t&&(t={}),void 0===o&&(o=!0),this.each(function(r,i){var a=this;Object.entries(t).forEach(function(t){var t=j(t,2),e=t[0],n=t[1],t="function"==typeof n&&o?n:function(){return n};void 0!==n&&a.attr(e,t.call(a,r,i))})})},M.prototype.update=function(n,t){void 0===t&&(t=!0);var r="function"==typeof n&&t?n:function(){return n};return this.each(function(t,e){n&&this.update&&this.update(r.call(this,t,e))})},M.prototype.maybeUpdate=function(n,t){void 0===t&&(t=!0);var r="function"==typeof n&&t?n:function(){return n};return this.each(function(t,e){n&&this.update&&this.update(r.call(this,t,e))})},M.prototype.transition=function(n){var r=this._transitions;return this.each(function(t,e){r[e]=n.call(this,t,e)})},M.prototype.on=function(t,e){return this.each(function(){this.addEventListener(t,e)}),this},M.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.call.apply(t,O([this._parent,this],j(e),!1)),this},M.prototype.node=function(){return this._elements[0]},M.prototype.nodes=function(){return this._elements},M.prototype.transitions=function(){return this._transitions.filter(function(t){return!!t})},M.prototype.parent=function(){return this._parent},Nw=new WeakSet,jw=function(t,e){var n=this._elements[0],t=n.querySelector(t);return t||(t="string"==typeof e?this.createElement(e):e(),n.appendChild(t)),new M([t],null,this._parent,this._document)},M.registry={g:fc,rect:Nc,circle:rc,path:kc,text:Ux,ellipse:cc,image:vc,line:wc,polygon:Ac,polyline:Pc,html:gc};var Nw,jw,Rw=M;function M(t,e,n,r,i,a,o){void 0===t&&(t=null),void 0===e&&(e=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===i&&(i=[null,null,null,null,null]),void 0===a&&(a=[]),void 0===o&&(o=[]),Nw.add(this),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=a,this._facetElements=o}function x(t){return new Rw([t],null,t,t.ownerDocument)}function Iw(t,e,n){return t.querySelector(e)?x(t).select(e):x(t).append(n)}function Bw(t){if(Ge(t))return[t,t,t,t];if(Ne(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 Dw(t){var t=t.getLocalBounds(),t=j([t.min,t.max],2),e=j(t[0],2),n=e[0],e=e[1],t=j(t[1],2),r=t[0],t=t[1];return{x:n,y:e,width:r-n,height:t-e,left:n,bottom:t,top:e,right:r}}function Fw(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function zw(t,e,n){void 0===n&&(n=!0);var e=e||(null==(e=t.match(/^([a-z][a-z0-9]+)/))?void 0:e[0])||"",t=t.replace(new RegExp("^(".concat(e,")")),"");return n?(e=t).toString().charAt(0).toLowerCase()+e.toString().slice(1):t}function w(t,r,i){void 0===i&&(i=!1);var a={};return Object.entries(t).forEach(function(t){var e,t=j(t,2),n=t[0],t=t[1];"className"!==n&&"class"!==n&&(n.startsWith("show")&&zw(n,"show").startsWith(r)!==i?n===(e=r,"".concat("show").concat(Fw(e)))?a[n]=t:a[n.replace(new RegExp(Fw(r)),"")]=t:n.startsWith("show")||n.startsWith(r)===i||"filter"===(e=zw(n,r))&&"function"==typeof t||(a[e]=t))}),a}function Ww(t,r){return Object.entries(t).reduce(function(t,e){var e=j(e,2),n=e[0],e=e[1];return n.startsWith("show")?t["show".concat(r).concat(n.slice(4))]=e:t["".concat(r).concat(Fw(n))]=e,t},{})}function Gw(t,n){void 0===n&&(n=["x","y","class","className"]);var r=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],i={},a={};return Object.entries(t).forEach(function(t){var t=j(t,2),e=t[0],t=t[1];n.includes(e)||(-1!==r.indexOf(e)?a[e]=t:i[e]=t)}),[i,a]}function Hw(o,t){if(t)try{var e=t.replace(/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,function(t,e,n){return"translate(".concat((e=e,n=n,i=(r=(r=o).getBBox()).width,a=r.height,[(r=j([e,n].map(function(t,e){var n;return t.includes("%")?parseFloat((null==(n=t.match(/[+-]?([0-9]*[.])?[0-9]+/))?void 0:n[0])||"0")/100*(0===e?i:a):t}),2))[0],r[1]]),")");var r,i,a});o.attr("transform",e)}catch(t){}}t(Yw,Vw=oc),Object.defineProperty(Yw.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=qx(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(Yw.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),Yw.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},Yw.prototype.disconnectedCallback=function(){var t;null!=(t=this._offscreen)&&t.destroy()},Yw.prototype.attributeChangedCallback=function(t){"visibility"===t&&!function(){Gx(this,"hidden"!==this.attributes.visibility)}.call(this)},Yw.prototype.update=function(t,e){return this.attr(nw({},this.attributes,t=void 0===t?{}:t)),null==(t=this.render)?void 0:t.call(this,this.attributes,this,e)},Yw.prototype.clear=function(){this.removeChildren()},Yw.prototype.bindEvents=function(t,e){};var Vw,mm=Yw;function Yw(t,e){t=Vw.call(this,nw({},{style:e=void 0===e?{}:e},t))||this;return t.initialized=!1,t._defaultOptions=e,t}function qw(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"]]}function $w(t,e,n){return[["M",t,e+n],["L",t,e-n]]}function Uw(t,e,n){return[["M",t-n,e],["L",t+n,e]]}vm=qw,Iy=Uw;function Xw(t){n="default",je(e=t)&&e instanceof Image?n="image":Pe(e)?n="symbol":ze(e)&&(r=new RegExp("data:(image|text)"),n=e.match(r)?"base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(e)?"url":"symbol");var e,n,r=n;return["base64","url","image"].includes(r)?"image":t&&"symbol"===r?"path":null}t(Qw,Kw=mm),Qw.prototype.render=function(t,e){var r=t.symbol,n=t.size,i=void 0===n?16:n,a=at(t,["symbol","size"]),o=Xw(r);dw(!!o,x(e),function(t){t.maybeAppendByClassName("marker",o).attr("className","marker ".concat(o,"-marker")).call(function(t){var e,n;"image"===o?t.styles({img:r,width:e=2*i,height:e,x:-i,y:-i}):(e=i/2,n=Pe(r)?r:Qw.getSymbol(r),t.styles(m({path:null==n?void 0:n(0,0,e)},a)))})})},Qw.MARKER_SYMBOL_MAP=new Map,Qw.registerSymbol=function(t,e){Qw.MARKER_SYMBOL_MAP.set(t,e)},Qw.getSymbol=function(t){return Qw.MARKER_SYMBOL_MAP.get(t)};var Kw,Zw=Qw;function Qw(){return null!==Kw&&Kw.apply(this,arguments)||this}Zw.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]]}),Zw.registerSymbol("hyphen",function(t,e,n){return[["M",t-n,e],["L",t+n,e]]}),Zw.registerSymbol("line",$w),Zw.registerSymbol("plus",function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]}),Zw.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]]}),Zw.registerSymbol("circle",qw),Zw.registerSymbol("point",vm),Zw.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"]]}),Zw.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"]]}),Zw.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"]]}),Zw.registerSymbol("diamond",function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]}),Zw.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"]]}),Zw.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"]]}),Zw.registerSymbol("line",$w),Zw.registerSymbol("dot",Uw),Zw.registerSymbol("dash",Iy),Zw.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]]}),Zw.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]]}),Zw.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]]}),Zw.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]]}),Zw.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]]});t(eM,Jw=tc),eM.prototype.render=function(){var t=this.attributes.columns;x(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()})},eM.prototype.update=function(t){this.attr(nw({},this.attributes,t)),this.render()},eM.prototype.clear=function(){this.removeChildren()};var Jw,tM=eM;function eM(t){var e=this,n=t.style,t=at(t,["style"]);return(e=Jw.call(this,ot({},{type:"column"},m({style:n},t)))||this).columnsGroup=new fc({name:"columns"}),e.appendChild(e.columnsGroup),e.render(),e}t(iM,nM=tc),iM.prototype.render=function(){var t=this.attributes,e=t.lines,t=t.areas;e&&this.renderLines(e),t&&this.renderAreas(t)},iM.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},iM.prototype.update=function(t){this.attr(nw({},this.attributes,t)),this.render()},iM.prototype.renderLines=function(t){x(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()})},iM.prototype.renderAreas=function(t){x(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()})};var nM,rM=iM;function iM(t){var e=this,n=t.style,t=at(t,["style"]);return(e=nM.call(this,ot({},{type:"lines"},m({style:n},t)))||this).linesGroup=e.appendChild(new fc),e.areasGroup=e.appendChild(new fc),e.render(),e}function aM(t,e){var n=(e=void 0===e?!1:e)?t.length-1:0,t=t.map(function(t,e){return O([e===n?"M":"L"],j(t),!1)});return e?t.reverse():t}function oM(t,e){if(void 0===e&&(e=!1),t.length<=2)return aM(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var a=e?t[r-i-1]:t[i];on(a,n.slice(-2))||n.push.apply(n,O([],j(a),!1))}var o=Tw(n,!1);return e?o.unshift(O(["M"],j(t[r-1]),!1)):o.unshift(O(["M"],j(t[0]),!1)),o}function sM(t,e,n){t=Ze(t);return t.push(["L",e,n],["L",0,n],["Z"]),t}function lM(t){return 0===t.length?[0,0]:[De(function(t,e){if(Ne(t)){for(var n,r=1/0,i=0;i<t.length;i++){var a=t[i],o=Pe(e)?e(a):a[e];o<r&&(n=a,r=o)}return n}}(t,function(t){return De(t)||0})),Be(function(t,e){if(Ne(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var a=t[i],o=Pe(e)?e(a):a[e];r<o&&(n=a,r=o)}return n}}(t,function(t){return Be(t)||0}))]}function cM(t){for(var e=Ze(t),n=e[0].length,t=j([Array(n).fill(0),Array(n).fill(0)],2),r=t[0],i=t[1],a=0;a<e.length;a+=1)for(var o=e[a],s=0;s<n;s+=1)0<=o[s]?(o[s]+=r[s],r[s]=o[s]):(o[s]+=i[s],i[s]=o[s]);return e}t(fM,uM=mm),Object.defineProperty(fM.prototype,"rawData",{get:function(){var t=this.attributes.data;return t&&0!==(null==t?void 0:t.length)?(t=Ze(t),Ge(t[0])?[t]:t):[[]]},enumerable:!1,configurable:!0}),Object.defineProperty(fM.prototype,"data",{get:function(){return this.attributes.isStack?cM(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(fM.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(fM.prototype,"baseline",{get:function(){var t=this.scales.y,e=j(t.getOptions().domain||[0,0],2),n=e[0],e=e[1];return e<0?t.map(e):t.map(n<0?0:n)},enumerable:!1,configurable:!0}),Object.defineProperty(fM.prototype,"containerShape",{get:function(){var t=this.attributes;return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),Object.defineProperty(fM.prototype,"linesStyle",{get:function(){var n=this,t=this.attributes,e=t.type,r=t.isStack,i=t.smooth;if("line"!==e)throw new Error("linesStyle can only be used in line type");var a,o,s,l,c,u,h,f,d,p=w(this.attributes,"area"),g=w(this.attributes,"line"),t=this.containerShape.width,e=this.data;return 0===e[0].length?{lines:[],areas:[]}:(a=this.scales,u=a.x,a=a.y,e=e,o=(u={type:"line",x:u,y:a}).x,s=u.y,l=(u=j(s.getOptions().range||[0,0],2))[0],c=u[1],l<c&&(u=j([l,c],2),c=u[0],l=u[1]),a=e.map(function(t){return t.map(function(t,e){return[o.map(e),We(s.map(t),c,l)]})}),u=[],p&&(e=this.baseline,u=r?(i?function(t,e,n){for(var r=[],i=t.length-1;0<=i;--i){var a,o=t[i],s=oM(o),l=void 0,l=0===i?sM(s,e,n):(a=oM(t[i-1],!0),o=o[0],a[0][0]="L",O(O(O([],j(s),!1),j(a),!1),[O(["M"],j(o),!1),["Z"]],!1));r.push(l)}return r}:function(t,e,n){for(var r=[],i=t.length-1;0<=i;--i){var a,o=aM(t[i]),s=void 0,s=0===i?sM(o,e,n):((a=aM(t[i-1],!0))[0][0]="L",O(O(O([],j(o),!1),j(a),!1),[["Z"]],!1));r.push(s)}return r})(a,t,e):(h=i,f=t,d=e,a.map(function(t){return sM((h?oM:aM)(t),f,d)}))),{lines:a.map(function(t,e){return m({stroke:n.getColor(e),path:(i?oM:aM)(t)},g)}),areas:u.map(function(t,e){return m({path:t,fill:n.getColor(e)},p)})})},enumerable:!1,configurable:!0}),Object.defineProperty(fM.prototype,"columnsStyle",{get:function(){var i=this,a=w(this.attributes,"column"),t=this.attributes,o=t.isStack;if("column"!==t.type)throw new Error("columnsStyle can only be used in column type");var t=this.containerShape.height,s=this.rawData;if(!s)return{columns:[]};o&&(s=cM(s));var e=this.createScales(s),l=e.x,c=e.y,e=j(lM(s),2),n=e[0],e=e[1],u=new wg({domain:[0,e-(0<n?0:n)],range:[0,t]}),h=l.getBandWidth(),f=this.rawData;return{columns:s.map(function(t,r){return t.map(function(t,e){var n=h/s.length;return m(m({fill:i.getColor(r)},a),o?{x:l.map(e),y:c.map(t),width:h,height:u.map(f[r][e])}:{x:l.map(e)+n*r,y:0<=t?c.map(t):c.map(0),width:n,height:u.map(Math.abs(t))})})})}},enumerable:!1,configurable:!0}),fM.prototype.render=function(t,e){this.container=Iw(e,".container","rect").attr("className","container").node();var n=t.type,r="spark".concat(n),i="line"===n?this.linesStyle:this.columnsStyle;this.spark=Iw(e,".".concat(r),function(){return new("line"===n?rM:tM)({className:r,style:i})}).styles(i).node()},fM.prototype.getColor=function(t){var e=this.attributes.color;return Ne(e)?e[t%e.length]:Pe(e)?e.call(null,t):e},fM.prototype.createScales=function(t){var e,n=this.attributes,r=n.type,i=n.range,i=void 0===i?[]:i,a=n.isGroup,n=n.spacing,o=this.containerShape,s=o.width,o=o.height,l=j(lM(t),2),c=l[0],l=l[1],c=new wg({domain:[null!=(e=i[0])?e:c,null!=(e=i[1])?e:l],range:[o,0]});return"line"===r?{type:r,x:new wg({domain:[0,t[0].length-1],range:[0,s]}),y:c}:{type:r,x:new cg({domain:t[0].map(function(t,e){return e}),range:[0,s],paddingInner:a?n:0}),y:c}},fM.tag="sparkline";var uM,hM=fM;function fM(t){return uM.call(this,t,{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"})||this}function dM(n){var e,r;return n?(e=["enter","update","exit"],r=Object.fromEntries(Object.entries(n).filter(function(t){t=j(t,1)[0];return!e.includes(t)})),Object.fromEntries(e.map(function(t){var e;return"boolean"!=typeof(e=n)&&"enter"in e&&"update"in e&&"exit"in e?!1===n[t]?[t,!1]:[t,m(m({},n[t]),r)]:[t,r]}))):{enter:!1,update:!1,exit:!1}}function pM(t,e){t?t.finished.then(e):e()}function gM(t,e){"update"in t?t.update(e):t.attr(e)}function yM(t,e,n){return 0===e.length?null:n?t.animate(e,n):(gM(t,{style:e.slice(-1)[0]}),null)}function mM(r,t,e){var i={},a={};return Object.entries(t).forEach(function(t){var e,t=j(t,2),n=t[0],t=t[1];P(t)||(e=r.style[n]||r.parsedStyle[n]||0)!==t&&(i[n]=e,a[n]=t)}),e?yM(r,[i,a],m({fill:"both"},e)):(gM(r,a),null)}function vM(t,e){return t.style.opacity||(t.style.opacity=1),mM(t,{opacity:0},e)}var bM,xM={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},wM={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},MM={orientation:"horizontal",showLabel:!0,type:"start"},OM=ew({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track"},"slider"),kM=ew({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),EM=(t(SM,bM=mm),SM.prototype.render=function(t,e){var n=t.size,n=void 0===n?10:n,r=t.radius,r=void 0===r?n/4:r,i=t.orientation,t=at(t,["size","radius","orientation"]),a=2.4*n,r=x(e).maybeAppendByClassName(kM.iconRect,"rect").styles(m(m({},t),{width:n,height:a,radius:r,x:-n/2,y:-a/2})),o=1/3*n,s=2/3*n,l=.25*a,c=.75*a;r.maybeAppendByClassName("".concat(kM.iconLine,"-1"),"line").styles(m({x1:o,x2:o,y1:l,y2:c},t)),r.maybeAppendByClassName("".concat(kM.iconLine,"-2"),"line").styles(m({x1:s,x2:s,y1:l,y2:c},t)),r.node().setOrigin(n/2,a/2),"vertical"===i?e.setLocalEulerAngles(90):e.setLocalEulerAngles(0)},SM);function SM(){return null!==bM&&bM.apply(this,arguments)||this}t(TM,AM=mm),TM.prototype.renderLabel=function(t){var e=this,n=this.attributes.showLabel,r=w(this.attributes,"label"),i=r.transform,r=j(Gw(at(r,["transform"]),[]),2),a=r[0],r=r[1],t=x(t).maybeAppendByClassName(kM.labelGroup,"g").styles(r),r=m(m({},wM),a),o=r.text,s=at(r,["text"]);dw(!!n,t,function(t){e.label=t.maybeAppendByClassName(kM.label,"text").styles(m(m({},s),{transform:i,text:"".concat(o)})),e.label.on("mousedown",function(t){t.stopPropagation()}),e.label.on("touchstart",function(t){t.stopPropagation()})})},TM.prototype.renderIcon=function(t){var e=this.attributes.orientation,n=m(m({orientation:e},xM),w(this.attributes,"icon")),e=this.attributes.iconShape,r=void 0===e?function(){return new EM({style:n})}:e;x(t).maybeAppendByClassName(kM.iconGroup,"g").selectAll(kM.icon.class).data([r]).join(function(t){return t.append(r).attr("className",kM.icon.name)},function(t){return t.update(n)},function(t){return t.remove()})},TM.prototype.render=function(t,e){this.renderIcon(e),this.renderLabel(e)};var AM,_M=TM;function TM(t){return AM.call(this,t,MM)||this}t(LM,PM=mm),Object.defineProperty(LM.prototype,"values",{get:function(){return this.attributes.values},set:function(t){this.attributes.values=this.clampValues(t)},enumerable:!1,configurable:!0}),Object.defineProperty(LM.prototype,"sparklineStyle",{get:function(){var t;return"horizontal"!==this.attributes.orientation?null:(t=w(this.attributes,"sparkline"),m(m({zIndex:0},this.availableSpace),t))},enumerable:!1,configurable:!0}),Object.defineProperty(LM.prototype,"shape",{get:function(){var t=this.attributes,e=t.trackLength,t=t.trackSize,t=j(this.getOrientVal([[e,t],[t,e]]),2);return{width:t[0],height:t[1]}},enumerable:!1,configurable:!0}),Object.defineProperty(LM.prototype,"availableSpace",{get:function(){var t=j(Bw(this.attributes.padding),4),e=t[0],n=t[1],r=t[2],t=t[3],i=this.shape;return{x:t,y:e,width:i.width-(t+n),height:i.height-(e+r)}},enumerable:!1,configurable:!0}),LM.prototype.getValues=function(){return this.values},LM.prototype.setValues=function(t,e){void 0===e&&(e=!1),this.attributes.values=t=void 0===t?[0,0]:t;t=!1!==e&&this.attributes.animate;mM(this.selectionShape.node(),this.selectionStyle,t),this.updateHandlesPosition(t)},LM.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(mM(this.startHandle,this.getHandleStyle("start"),t),mM(this.endHandle,this.getHandleStyle("end"),t))},LM.prototype.innerSetValues=function(t,e){void 0===e&&(e=!1);var n=this.values,t=this.clampValues(t=void 0===t?[0,0]:t);this.attr("values",t),this.setValues(t),e&&this.onValueChange(n)},LM.prototype.renderTrack=function(t){var e=this.attributes.brushable,n=w(this.attributes,"track");this.trackShape=x(t).maybeAppendByClassName(OM.track,"rect").styles(m(m({cursor:e?"crosshair":"default"},this.shape),n))},LM.prototype.renderSparkline=function(t){var n=this;dw("horizontal"===this.attributes.orientation,x(t).maybeAppendByClassName(OM.sparklineGroup,"g"),function(t){var e=n.sparklineStyle;t.maybeAppendByClassName(OM.sparkline,function(){return new hM({style:e})}).update(e)})},Object.defineProperty(LM.prototype,"selectionStyle",{get:function(){var t=w(this.attributes,"selection");return m(m({},t),this.calcMask())},enumerable:!1,configurable:!0}),LM.prototype.renderHandles=function(){var t,e=this,n=(this.attributes.showHandle?["start","end"]:[]).map(function(t){return{type:t}}),r=this;null!=(t=this.foregroundGroup)&&t.selectAll(OM.handle.class).data(n,function(t){return t.type}).join(function(t){return t.append(function(t){t=t.type;return new _M({style:e.getHandleStyle(t)})}).each(function(t){var e=t.type,t=(this.attr("class","".concat(OM.handle.name," ").concat(e,"-handle")),"".concat(e,"Handle"));(r[t]=this).addEventListener("pointerdown",function(t){r.onDragStart(e)(t)})})},function(t){return t.each(function(t){t=t.type;this.update(r.getHandleStyle(t))})},function(t){return t.each(function(t){t=t.type,t="".concat(t,"Handle");r[t]=void 0}).remove()})},LM.prototype.renderSelection=function(t){this.foregroundGroup=x(t).maybeAppendByClassName(OM.foreground,"g"),this.selectionShape=this.foregroundGroup.maybeAppendByClassName(OM.selection,"rect").styles(this.selectionStyle),this.renderHandles()},LM.prototype.render=function(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderSelection(e)},LM.prototype.clampValues=function(t,e){void 0===e&&(e=4);var n=j(this.range,2),r=n[0],n=n[1],i=j(this.getValues().map(function(t){return Aw(t,e)}),2),a=i[0],i=i[1],t=j((t||[a,i]).map(function(t){return Aw(t,e)}),2),o=t[0],t=t[1],s=(t<o&&(o=(s=j([t,o],2))[0],t=s[1]),t-o);return n-r<s?[r,n]:o<r?a===r&&i===t?[r,t]:[r,s+r]:n<t?i===n&&a===o?[o,n]:[n-s,n]:[o,t]},LM.prototype.calcMask=function(t){var t=j(this.clampValues(t),2),e=t[0],t=t[1],n=this.availableSpace,r=n.x,i=n.y,a=n.width,n=n.height;return this.getOrientVal([{y:i,height:n,x:e*a+r,width:(t-e)*a},{x:r,width:a,y:e*n+i,height:(t-e)*n}])},LM.prototype.calcHandlePosition=function(t){var e=this.availableSpace,n=e.x,r=e.y,i=e.width,e=e.height,a=j(this.clampValues(),2),o=a[0],a=a[1],t=("start"===t?o:a)*this.getOrientVal([i,e]);return{x:n+this.getOrientVal([t,i/2]),y:r+this.getOrientVal([e/2,t])}},LM.prototype.inferTextStyle=function(t){return"horizontal"===this.attributes.orientation?{}:"start"===t?{transform:"rotate(90)",textAlign:"start"}:"end"===t?{transform:"rotate(90)",textAlign:"end"}:{}},LM.prototype.calcHandleText=function(t){var e,n,r,i,a,o,s,l,c=this.attributes,u=c.orientation,h=c.formatter,c=c.autoFitLabel,f=w(this.attributes,"handle"),d=w(f,"label"),f=f.spacing,p=this.getHandleSize(),g=this.clampValues(),h=h("start"===t?g[0]:g[1]),g=new Ux({style:m(m(m({},d),this.inferTextStyle(t)),{text:h})}),d=g.getBBox(),y=d.width,d=d.height;return g.destroy(),c?(c=g=0,l=(e=this.availableSpace).width,e=e.height,n=(a=this.calcMask()).x,r=a.y,i=a.width,a=a.height,o=f+p,"horizontal"===u?(s=o+y/2,g="start"===t?0<n-o-y?-s:s:y<l-n-i-o?s:-s):(l=d+o,c="start"===t?d<r-p?-l:o:d<e-(r+a)-p?l:-o),{x:g,y:c,text:h}):(n=f+p+("horizontal"===u?y/2:0),(i={text:h})["horizontal"===u?"x":"y"]="start"===t?-n:n,i)},LM.prototype.getHandleLabelStyle=function(t){var e;return this.attributes.showLabel?(e=w(this.attributes,"handleLabel"),m(m(m({},e),this.calcHandleText(t)),this.inferTextStyle(t))):{}},LM.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=w(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),r=this.getHandleSize();return m({cursor:n,shape:t,size:r},e)},LM.prototype.getHandleStyle=function(t){var e=this.attributes,n=e.showLabel,e=e.orientation,r=this.calcHandlePosition(t),i=this.calcHandleText(t);return m(m(m(m({},Ww(this.getHandleIconStyle(),"icon")),Ww(m(m({},this.getHandleLabelStyle(t)),i),"label")),r),{orientation:e,showLabel:n,type:t,zIndex:3})},LM.prototype.getHandleSize=function(){var t=this.attributes,e=t.handleIconSize,n=t.width,t=t.height;return e||Math.floor((this.getOrientVal([+t,+n])+4)/2.4)},LM.prototype.getOrientVal=function(t){var t=j(t,2),e=t[0],t=t[1];return"horizontal"===this.attributes.orientation?e:t},LM.prototype.setValuesOffset=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=!1);var r=j(this.getValues(),2),t=[r[0]+t,r[1]+e].sort();n?this.setValues(t):this.innerSetValues(t,!0)},LM.prototype.getRatio=function(t){var e=this.availableSpace,n=e.width,e=e.height;return t/this.getOrientVal([n,e])},LM.prototype.dispatchCustomEvent=function(t,e,n){var r=this;t.on(e,function(t){t.stopPropagation(),r.dispatchEvent(new gl(n,{detail:t}))})},LM.prototype.bindEvents=function(){var t=this.selectionShape,t=(this.addEventListener("wheel",this.onScroll),t.on("mousedown",this.onDragStart("selection")),t.on("touchstart",this.onDragStart("selection")),this.dispatchCustomEvent(t,"mouseenter","selectionMouseenter"),this.dispatchCustomEvent(t,"mouseleave","selectionMouseleave"),this.dispatchCustomEvent(t,"click","selectionClick"),this.trackShape);this.dispatchCustomEvent(t,"click","trackClick"),this.dispatchCustomEvent(t,"mouseenter","trackMouseenter"),this.dispatchCustomEvent(t,"mouseleave","trackMouseleave"),t.on("mousedown",this.onDragStart("track")),t.on("touchstart",this.onDragStart("track"))},LM.prototype.onScroll=function(t){var e;this.attributes.scrollable&&(e=t.deltaX,t=t.deltaY,t=this.getRatio(t||e),this.setValuesOffset(t,t,!0))},LM.tag="slider";var PM,CM=LM;function LM(t){var a=PM.call(this,t,m(m(m({animate:{duration:100,fill:"both"},brushable:!0,formatter:function(t){return t.toString()},handleSpacing:2,orientation:"horizontal",padding:0,autoFitLabel:!0,scrollable:!0,selectionCursor:"move",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]},Ww(MM,"handle")),Ww(xM,"handleIcon")),Ww(wM,"handleLabel")))||this;return a.range=[0,1],a.onDragStart=function(i){return function(t){t.stopPropagation(),a.target=i,a.prevPos=a.getOrientVal(hw(t));var t=a.availableSpace,e=t.x,t=t.y,n=a.attributes,r=n.x,n=n.y;a.selectionStartPos=a.getRatio(a.prevPos-a.getOrientVal([e,t])-a.getOrientVal([+r,+n])),a.selectionWidth=0,document.addEventListener("mousemove",a.onDragging),document.addEventListener("touchmove",a.onDragging),document.addEventListener("mouseup",a.onDragEnd),document.addEventListener("touchend",a.onDragEnd)}},a.onDragging=function(t){var e=a.attributes,n=e.slidable,r=e.brushable,e=(t.stopPropagation(),a.getOrientVal(hw(t))),t=e-a.prevPos;if(t){var i=a.getRatio(t);switch(a.target){case"start":n&&a.setValuesOffset(i);break;case"end":n&&a.setValuesOffset(0,i);break;case"selection":n&&a.setValuesOffset(i,i);break;case"track":if(!r)return;a.selectionWidth+=i,a.innerSetValues([a.selectionStartPos,a.selectionStartPos+a.selectionWidth].sort(),!0)}a.prevPos=e}},a.onDragEnd=function(){document.removeEventListener("mousemove",a.onDragging),document.removeEventListener("mousemove",a.onDragging),document.removeEventListener("mouseup",a.onDragEnd),document.removeEventListener("touchend",a.onDragEnd)},a.onValueChange=function(t){t=new gl("valuechange",{detail:{oldValue:t,value:a.getValues()}});a.dispatchEvent(t)},a.selectionStartPos=0,a.selectionWidth=0,a.prevPos=0,a.target="",a}t(RM,NM=mm),Object.defineProperty(RM.prototype,"padding",{get:function(){return Bw(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(RM.prototype,"value",{get:function(){var t=this.attributes.value,e=j(this.range,2),n=e[0],e=e[1];return We(t,n,e)},enumerable:!1,configurable:!0}),Object.defineProperty(RM.prototype,"trackLength",{get:function(){var t=this.attributes,e=t.viewportLength,t=t.trackLength;return void 0===t?e:t},enumerable:!1,configurable:!0}),Object.defineProperty(RM.prototype,"availableSpace",{get:function(){var t=this.attributes.trackSize,e=this.trackLength,n=j(this.padding,4),r=n[0],i=n[1],a=n[2],n=n[3],t=j(this.getOrientVal([[e,t],[t,e]]),2);return{x:n,y:r,width:+t[0]-(n+i),height:+t[1]-(r+a)}},enumerable:!1,configurable:!0}),Object.defineProperty(RM.prototype,"trackRadius",{get:function(){var t=this.attributes,e=t.isRound,t=t.trackSize;return e?t/2:0},enumerable:!1,configurable:!0}),Object.defineProperty(RM.prototype,"thumbRadius",{get:function(){var t,e=this.attributes,n=e.isRound,e=e.thumbRadius;return n?(t=(n=this.availableSpace).width,n=n.height,e||this.getOrientVal([n,t])/2):0},enumerable:!1,configurable:!0}),RM.prototype.getValues=function(t){void 0===t&&(t=this.value);var e=this.attributes,e=e.viewportLength/e.contentLength,n=j(this.range,2),r=n[0],t=t*(n[1]-r-e);return[t,t+e]},RM.prototype.getValue=function(){return this.value},RM.prototype.renderSlider=function(t){var e=this.attributes,n=e.orientation,r=e.trackSize,i=e.padding,e=e.slidable,a=w(this.attributes,"track"),o=w(this.attributes,"thumb"),s=m(m({brushable:!1,orientation:n,padding:i,selectionRadius:this.thumbRadius,showHandle:!1,slidable:e,trackLength:this.trackLength,trackRadius:this.trackRadius,trackSize:r,values:this.getValues()},Ww(a,"track")),Ww(o,"selection"));this.slider=x(t).maybeAppendByClassName("scrollbar",function(){return new CM({style:s})}).update(s).node()},RM.prototype.render=function(t,e){this.renderSlider(e)},RM.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.attributes.value,r=j(this.range,2),i=r[0],r=r[1];this.slider.setValues(this.getValues(We(t,i,r)),e),this.onValueChange(n)},RM.prototype.bindEvents=function(){var e=this;this.slider.addEventListener("trackClick",function(t){t.stopPropagation(),e.onTrackClick(t.detail)}),this.onHover()},RM.prototype.getOrientVal=function(t){return"horizontal"===this.attributes.orientation?t[0]:t[1]},RM.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)},RM.tag="scrollbar";var NM,jM=RM;function RM(t){var a=NM.call(this,t,{isRound:!0,orientation:"vertical",padding:[2,2,2,2],scrollable:!0,slidable:!0,thumbCursor:"default",trackSize:10,value:0})||this;return a.range=[0,1],a.onValueChange=function(t){var e=a.attributes.value;t!==e&&(a.dispatchEvent(new gl("scroll",t={detail:{oldValue:t,value:e}})),a.dispatchEvent(new gl("valuechange",t)))},a.onTrackClick=function(t){var e,n,r,i;a.attributes.slidable&&(r=(e=j(a.getLocalPosition(),2))[0],e=e[1],n=(i=j(a.padding,4))[0],i=i[3],r=a.getOrientVal([r+i,e+n]),i=(a.getOrientVal(hw(t))-r)/a.trackLength,a.setValue(i,!0))},a.onThumbMouseenter=function(t){a.dispatchEvent(new gl("thumbMouseenter",{detail:t.detail}))},a.onTrackMouseenter=function(t){a.dispatchEvent(new gl("trackMouseenter",{detail:t.detail}))},a.onThumbMouseleave=function(t){a.dispatchEvent(new gl("thumbMouseleave",{detail:t.detail}))},a.onTrackMouseleave=function(t){a.dispatchEvent(new gl("trackMouseleave",{detail:t.detail}))},a}var IM={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 kc({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",tickStrokeOpacity:.65,labelOverlap:[]},BM=(ot({},IM,{style:{type:"arc"}}),ot({},IM,{style:{}}),ew({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")),DM=ew({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function FM(t){return t.reduce(function(t,e,n){return t.push(O([0===n?"M":"L"],j(e),!1)),t},[])}function zM(t,e,n){var r,i,a,o;return"surround"===e.type?(r=t,n=n,o=(e=e).connect,e=e.center,"line"===(void 0===o?"line":o)?FM(r):e?(i=Ew(r[0],e),a=n?0:1,r.reduce(function(t,e,n){return 0===n?t.push(O(["M"],j(e),!1)):t.push(O(["A",i,i,0,0,a],j(e),!1)),t},[])):[]):FM(t)}function WM(t,e,n){function r(t,e){return[l,t,c,e,s].flat()}var i=n.type,a=n.connect,o=n.center,s=n.closed?[["Z"]]:[],n=j([zM(t,n),zM(e.slice().reverse(),n,!0)],2),l=n[0],c=n[1],n=j([t[0],e.slice(-1)[0]],2),t=n[0],e=n[1];if("line"===a||"surround"===i)return r([O(["L"],j(e),!1)],[O(["L"],j(t),!1)]);if(o)return a=(n=j([Ew(e,o),Ew(t,o)],2))[0],i=n[1],r([O(["A",a,a,0,0,1],j(e),!1),O(["L"],j(e),!1)],[O(["A",i,i,0,0,0],j(t),!1),O(["L"],j(t),!1)]);throw new Error("Arc grid need to specified center")}function GM(t,e,n){var r=n.animate,i=n.connect,a=n.areaFill;if(e.length<2||!a||!i)return[];for(var o=Array.isArray(a)?a:[a,"transparent"],s=[],l=0;l<e.length-1;l++){var c=j([e[l].points,e[l+1].points],2),c=WM(c[0],c[1],n);s.push({path:c,fill:o[l%o.length]})}return t.selectAll(DM.region.class).data(s,function(t,e){return e}).join(function(t){return t.append("path").each(function(t,e){t=tw(t,[t,e,s]);this.attr(t)}).attr("className",DM.region.name)},function(t){return t.transition(function(t,e){return mM(this,tw(t,[t,e,s]),r.update)})},function(t){return t.transition(function(){var t=this,e=vM(this,r.exit);return pM(e,function(){return t.remove()}),e})}).transitions()}t(YM,HM=mm),YM.prototype.render=function(t,e){t.type,t.center,t.areaFill,t.closed;var n,r,i,a,o=at(t,["type","center","areaFill","closed"]),s=(s=void 0===(s=t.data)?[]:s,t.closed?s.map(function(t){var e=t.points,n=j(e,1)[0];return m(m({},t),{points:O(O([],j(e),!1),[n],!1)})}):s),l=x(e).maybeAppendByClassName(DM.lineGroup,"g"),e=x(e).maybeAppendByClassName(DM.regionGroup,"g"),o=(l=l,r=o,i=(n=t).animate,a=s.map(function(t,e){return{id:t.id||"grid-line-".concat(e),path:zM(t.points,n)}}),l.selectAll(DM.line.class).data(a,function(t){return t.id}).join(function(t){return t.append("path").each(function(t,e){t=tw(Cw(m({path:t.path},r)),[t,e,a]);this.attr(m({class:DM.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4]},t))})},function(t){return t.transition(function(t,e){return mM(this,tw(Cw(m({path:t.path},r)),[t,e,a]),i.update)})},function(t){return t.transition(function(){var t=this,e=vM(this,i.exit);return pM(e,function(){return t.remove()}),e})}).transitions()),l=GM(e,s,t);return O(O([],j(o),!1),j(l),!1)};var HM,VM=YM;function YM(){return null!==HM&&HM.apply(this,arguments)||this}function qM(t,e){return Object.fromEntries(Object.entries(t).map(function(t){t=j(t,2);return[t[0],tw(t[1],e)]}))}function $M(t,e){return e&&Pe(e)?t.filter(e):t}var UM=Je(function(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n},function(t,e){return[t,e.startAngle,e.endAngle].join()}),XM=Je(function(t,e){var n,r,i;return"linear"===e.type?(r=(n=j(e.startPos,2))[0],n=n[1],i=j(e.endPos,2),Sw([(r=j([i[0]-r,i[1]-n],2))[0],r[1]])):(i=Kx(UM(t,e)),[-Math.sin(i),Math.cos(i)])},function(t,e){var n,r,i,a="linear"===(n=e).type?(a=n.startPos,r=n.endPos,O(O([],j(a),!1),j(r),!1)):(a=n.startAngle,r=n.endAngle,i=n.center,n=n.radius,O(O([a,r],j(i),!1),[n],!1));return"arc"===e.type&&a.push(t),a.join()});function KM(t,e,n){t=XM(t,n);return n=t,"positive"!==e?[n[1],-n[0]]:[-n[1],n[0]]}function ZM(t,e){return KM(t,e.labelDirection,e)}var QM=Je(function(t,e){var n=j(e.startPos,2),r=n[0],n=n[1],e=j(e.endPos,2),e=j([e[0]-r,e[1]-n],2);return[r+e[0]*t,n+e[1]*t]},function(t,e){return O(O([t],j(e.startPos),!1),j(e.endPos),!1).join()}),JM=Je(function(t,e){var n=e.radius,r=j(e.center,2),i=r[0],r=r[1],t=Kx(UM(t,e));return[i+n*Math.cos(t),r+n*Math.sin(t)]},function(t,e){return O([t,e.startAngle,e.endAngle,e.radius],j(e.center),!1).join()});function tO(t,e){return("linear"===e.type?QM:JM)(t,e)}function eO(t){return 0===XM(0,t)[1]}function nO(t){return 0===XM(0,t)[0]}function rO(t,e){return e-t==360}function iO(t,e,n,r,i){function a(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]}var o=e-t,s=j([i,i],2),l=s[0],s=s[1],c=j([Kx(t),Kx(e)],2),u=c[0],c=c[1],h=j(a(u),2),f=h[0],h=h[1],d=j(a(c),2),p=d[0],d=d[1];return rO(t,e)?[["M",f,h],["A",l,s,0,1,0,(c=j(a((c+u)/2),2))[0],c[1]],["A",l,s,0,1,0,p,d]]:(u=180<o?1:0,c=e<t?0:1,"M".concat(f,",").concat(h,",A").concat(l,",").concat(s,",0,").concat(u,",").concat(c,",").concat(p,",").concat(d))}function aO(t,e,n,s){var l=e.startAngle,c=e.endAngle,u=e.center,h=e.radius;return t.selectAll(BM.line.class).data([{path:iO.apply(void 0,O(O([l,c],j(u),!1),[h],!1))}],function(t,e){return e}).join(function(t){return t.append("path").attr("className",BM.line.name).styles(e).styles({path:function(t){return t.path}})},function(t){return t.transition(function(){var t,r,e,n,i,a=this,o=(o=(i=(i=t=this).attributes).startAngle,e=i.endAngle,n=i.center,i=i.radius,o=O(O([o,e],j(n),!1),[i],!1),e=O(O([l,c],j(u),!1),[h],!1),(n=s.update)?(i=void 0===(i=n.duration)?0:i,r=yw(o,e),o=Math.ceil(+i/16),i=new Array(o).fill(0).map(function(t,e,n){return{__keyframe_data__:r(e/(n.length-1))}}),t.animate(i,m({fill:"both"},n))):(t.attr("__keyframe_data__",e),null));return o&&(o.onframe=i=function(){var t=sn(a.attributes,"__keyframe_data__");a.style.path=iO.apply(void 0,O([],j(t),!1))},o.onfinish=i),o}).styles(e)},function(t){return t.remove()}).styles(n).transitions()}function oO(t){var t=j(t,2),e=j(t[0],2),n=e[0],e=e[1],t=j(t[1],2);return{x1:n,y1:e,x2:t[0],y2:t[1]}}function sO(e,t,n,r){function i(t){return e.selectAll(BM.line.class).data(t,function(t,e){return e}).join(function(t){return t.append("line").attr("className",function(t){return"".concat(BM.line.name," ").concat(t.className)}).styles(n).transition(function(t){return mM(this,oO(t.line),!1)})},function(t){return t.styles(n).transition(function(t){return mM(this,oO(t.line),r.update)})},function(t){return t.remove()}).transitions()}var a,o,s,l=t.showTrunc,c=t.startPos,u=t.endPos,h=t.truncRange,f=t.lineExtension,d=j([c,u],2),p=j(d[0],2),g=p[0],p=p[1],d=j(d[1],2),y=d[0],d=d[1],u=j(f?(c=j([c=c,u=u,f=void 0===(f=f)?[0,0]:f],3),f=(u=j(c[0],2))[0],u=u[1],m=(a=j(c[1],2))[0],a=a[1],v=(c=j(c[2],2))[0],c=c[1],f=(m=j([m-f,a-u],2))[0],a=m[1],u=Math.sqrt(Math.pow(f,2)+Math.pow(a,2)),v=(m=j([-v/u,c/u],2))[0],c=m[1],[v*f,v*a,c*f,c*a]):new Array(4).fill(0),4),m=u[0],v=u[1],f=u[2],c=u[3];return l&&h?(u=(a=j(h,2))[0],l=a[1],o=(u=j([g+(h=y-g)*u,p+(s=d-p)*u],2))[0],u=u[1],s=(h=j([g+h*l,p+s*l],2))[0],l=h[1],h=i([{line:[[g+m,p+v],[o,u]],className:BM.lineFirst.name},{line:[[s,l],[y+f,d+c]],className:BM.lineSecond.name}]),t.truncRange,t.truncShape,t.lineExtension,h):i([{line:[[g+m,p+v],[y+f,d+c]],className:BM.line.name}])}function lO(t,e,n){var r,i,a,o,s,l=e.type,c=w(e,"line"),n=("linear"===l?sO:aO)(t,e,_w(c,"arrow"),n);return t=t,l=l,c=c,r=(e=e).showArrow,i=e.showTrunc,a=e.lineArrow,o=e.lineArrowOffset,s=e.lineArrowSize,l="arc"!==l&&i?t.select(BM.lineSecond.class):t.select(BM.line.class),!r||!a||"arc"===e.type&&rO(e.startAngle,e.endAngle)?(i=l.node())&&(i.style.markerEnd=void 0):((t=fw(a)).attr(c),Lw(t,s,!0),l.style("markerEnd",t).style("markerEndOffset",-o)),n}function cO(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function uO(t,i){var a=i.gridLength;return t.map(function(t,e){var t=t.value,n=j(tO(t,i),2),r=n[0],n=n[1],t=j(xw(KM(t,i.gridDirection,i),a),2);return{id:e,points:[[r,n],[r+t[0],n+t[1]]]}})}function hO(t,e,n,r){var i=w(n,"grid"),a=i.type,o=i.areaFill,s=cO(n),l=$M(e,n.gridFilter),e=("segment"===a?uO:function(t,o){var s,l,c=o.gridControlAngles,e=cO(o);if(!e)throw new Error("grid center is not provide");if(t.length<2)throw new Error("Invalid grid data");if(c&&0!==c.length)return e=j(e,2),s=e[0],l=e[1],t.map(function(t,e){var t=j(tO(t.value,o),2),n=t[0],t=t[1],n=j([n-s,t-l],2),r=n[0],i=n[1],a=[];return c.forEach(function(t){var t=Kx(t),t=j([Math.cos(t),Math.sin(t)],2),e=t[0],t=t[1];a.push([r*e-i*t+s,r*t+i*e+l])}),{points:a,id:e}});throw new Error("Invalid gridControlAngles")})(l,n),c=m(m({},i),{center:s,areaFill:Pe(o)?l.map(function(t,e){return tw(o,[t,e,l])}):o,animate:r,data:e});return t.selectAll(BM.grid.class).data([1]).join(function(t){return t.append(function(){return new VM({style:c})}).attr("className",BM.grid.name)},function(t){return t.transition(function(){return this.update(c)})},function(t){return t.remove()}).transitions()}Object.defineProperty(dO.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(dO.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(dO.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(dO.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(dO.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(dO.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),dO.prototype.rotatedPoints=function(t,e,n){var r=this.x1,i=this.y1,a=this.x2,o=this.y2,s=Math.cos(t),t=Math.sin(t),l=e-e*s+n*t,e=n-e*t-n*s;return[[s*r-t*o+l,t*r+s*o+e],[s*a-t*o+l,t*a+s*o+e],[s*r-t*i+l,t*r+s*i+e],[s*a-t*i+l,t*a+s*i+e]]},dO.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},dO.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE};var fO=dO;function dO(t,e,n,r){this.set(t,e,n,r)}function pO(t,e){var n=t.getEulerAngles()||0,r=(t.setEulerAngles(0),t.getLocalBounds()),i=j(r.min,2),a=i[0],i=i[1],r=j(r.max,2),o=r[0],r=r[1],s=gO(t),l=s.width,s=s.height,c=0,u=0,h=a,f=i,d=lw(t),o=(d&&(s-=1.5,"center"===(p=d.style.textAlign)?h=(a+o)/2:"right"!==p&&"end"!==p||(h=o),"middle"===(p=d.style.textBaseline)?f=(i+r)/2:"bottom"===p&&(f=r)),j(Bw(e),4)),d=o[0],p=void 0===d?0:d,r=o[1],e=void 0===r?0:r,d=o[2],r=o[3],o=new fO((c+=a)-(void 0===r?e:r),(u+=i)-p,c+l+e,u+s+(void 0===d?p:d));return t.setEulerAngles(n),o.rotatedPoints(Kx(n),h,f)}function gO(t){return t.__bbox__||t.getBBox()}function yO(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 mO(t,e,n){t=(e[1]-t[1])*(n[0]-e[0])-(e[0]-t[0])*(n[1]-e[1]);return 0==t?0:t<0?2:1}function vO(t,e){var n=t.length;if(n<3)return!1;var r,i,a,o,s,l,c=[e,[9999,e[1]]],u=0,h=0;do{var f=[t[h],t[(h+1)%n]];if(i=c,l=s=o=a=void 0,a=mO((r=f)[0],r[1],i[0]),o=mO(r[0],r[1],i[1]),s=mO(i[0],i[1],r[0]),l=mO(i[0],i[1],r[1]),a!==o&&s!==l||0===a&&yO(r,i[0])||0===o&&yO(r,i[1])||0===s&&yO(i,r[0])||!(0!==l||!yO(i,r[1]))){if(0===mO(f[0],e,f[1]))return yO(f,e);u++}}while(0!==(h=(h+1)%n));return!!(1&u)}function bO(t,e,n){var r,i=t.x1,a=t.x2,o=t.y1,t=t.y2,o=[[i,o],[a,o],[a,t],[i,t]],a=pO(e,n);return r=o,a.every(function(t){return vO(r,t)})}function xO(t,c){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 t=t,n=(e=j(e=c,4))[0],r=e[1],i=e[2],e=e[3],a=(t=j(t,4))[0],o=t[1],i-=n,e-=r,s=t[2]-a,t=t[3]-o,0!=(l=i*t-s*e)&&(o=i*(i=r-o)-e*(r=n-a))<0!=(e=0<l)&&(n=s*i-t*r)<0!=e&&l<o!=e&&l<n!=e;var e,n,r,i,a,o,s,l})}function wO(t,e,l){function n(t,e){if(t){var n,r,i=Bw(l),t=pO(t,i).flat(1),a=pO(e,i).flat(1),e=[[t[0],t[1],t[2],t[3]],[t[0],t[1],t[4],t[5]],[t[4],t[5],t[6],t[7]],[t[2],t[3],t[6],t[7]]];try{for(var o=I(e),s=o.next();!s.done;s=o.next())if(xO(a,s.value))return}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}return 1}var r,i,a,o,s,c,u,h,f,d,p,g,y=e.crossPadding,m=new Set,v=null,b=(y=y,f=(e=e).type,d=e.labelDirection,!!(p=e.crossSize)&&("arc"===f?(f=e.center,h=e.radius,u=(f=j(f,2))[0],f=f[1],a=-h-(d="negative"===d?0:p),h=h+d,o=(d=j(Bw(y),4))[0],s=d[1],c=d[2],d=d[3],new fO(u+a-d,f+a-o,u+h+s,f+h+c)):(a=(d=j(e.startPos,2))[0],o=d[1],s=(u=j(e.endPos,2))[0],f=u[1],c=(h=j(nO(e)?[-y,0,y,0]:[0,y,0,-y],4))[0],d=h[1],u=h[2],y=h[3],h=xw(ZM(0,e),p),(e=new fO(a,o,s,f)).x1+=y,e.y1+=c,e.x2+=d+h[0],e.y2+=u+h[1],e)));try{for(var x=I(t),w=x.next();!w.done;w=x.next()){var M=w.value;g=M,b&&!bO(b,g)?m.add(M):!v||n(v,M)?v=M:(m.add(v),m.add(M))}}catch(t){r={error:t}}finally{try{w&&!w.done&&(i=x.return)&&i.call(x)}finally{if(r)throw r.error}}return Array.from(m)}function MO(t,e){return void 0===e&&(e={}),P(t)?0:"number"==typeof t?t:Math.floor(ow(t,e))}var OO=function(t,e){var e=e.seq,n=void 0===e?2:e;return t.filter(function(t,e){return!(e%n&&(Wx(t),1))})};var kO=new Map([["hide",function(t,e,n,r){var i=t.length,a=e.keepHeader,o=e.keepTail;if(!(i<=1||2===i&&a&&o)){var s,l,c,u,h=OO,f=function(t){return t.forEach(r.show),t},d=2,p=t.slice(),g=t.slice(),y=Math.min.apply(Math,O([1],j(t.map(function(t){return gO(t).width})),!1));for("linear"===n.type&&(eO(n)||nO(n))&&(s=Dw(t[0]).left,l=Dw(t[i-1]).right,l=Math.abs(l-s)||1,d=Math.max(Math.floor(i*y/l),d)),a&&(c=p.splice(0,1)[0]),o&&(u=p.splice(-1,1)[0],p.reverse()),f(p);d<t.length&&wO((u?O(O([u],j(g),!1),[c],!1):O([c],j(g),!1)).filter(aw),n,null==e?void 0:e.margin).length;)(u&&!c&&d%2==0||u&&c)&&p.splice(0,1).forEach(r.hide),g=h(f(p),{seq:d}),d++}}],["rotate",function(t,e,n,r){function i(n){t.forEach(function(t,e){e=Array.isArray(n)?n[e]:n;r.rotate(t,+e)})}var a,o,s=void 0===(s=e.optionalAngles)?[0,45,90]:s,l=e.margin,e=void 0===(e=e.recoverWhenFailed)||e,c=t.map(function(t){return t.getLocalEulerAngles()});try{for(var u=I(s),h=u.next();!h.done;h=u.next())if(i(h.value),wO(t,n,l).length<1)return}catch(t){a={error:t}}finally{try{h&&!h.done&&(o=u.return)&&o.call(u)}finally{if(a)throw a.error}}e&&i(c)}],["ellipsis",function(t,e,n,r){if(!(t.length<=1))for(var i=void 0===(a=e.suffix)?"...":a,a=e.minLength,o=void 0===(o=e.maxLength)?1/0:o,s=void 0===(s=e.step)?" ":s,l=void 0===(e=e.margin)?[0,0,0,0]:e,e=sw(r.getTextShape(t[0])),c=MO(s,e),u=a?MO(a,e):c,s=MO(o,e),h=(!P(s)&&s!==1/0||(s=Math.max.apply(null,t.map(function(t){return gO(t).width}))),t.slice()),f=((a=j(l,4))[0],a[1],a[2],a[3],s);u+c<f;f-=c){var d=function(e){if(h.forEach(function(t){r.ellipsis(r.getTextShape(t),e,i)}),(h=wO(t,n,l)).length<1)return{value:void 0}}(f);if("object"==typeof d)return d.value}}],["wrap",function(t,e,n,r){function i(n){t.forEach(function(t,e){e=Array.isArray(n)?n[e]:n;r.wrap(t,l,e,d)})}var a,o,s,l=void 0===(u=e.wordWrapWidth)?50:u,c=void 0===(u=e.maxLines)?3:u,u=void 0===(u=e.recoverWhenFailed)||u,h=void 0===(e=e.margin)?[0,0,0,0]:e,e=t.map(function(t){return t.attr("maxLines")||1}),f=Math.min.apply(Math,O([],j(e),!1)),d=(o=(a=n).type,s=a.labelDirection,"linear"===o&&eO(a)?"negative"===s?"bottom":"top":"middle");if(!(c<f)){for(var p=f;p<=c;p++)if(i(p),wO(t,n,h).length<1)return;u&&i(e)}}]]);function EO(r,i,a){var t=i.labelOverlap,t=void 0===t?[]:t;t.length&&t.forEach(function(t){var e=t.type,n=kO.get(e);!function(t,e,n){if(!(e.labelOverlap.length<1))if("hide"===n){for(var r=t[0];r;){if("offscreen"===r.className)return;r=r.parent}return 1}else return"rotate"===n?!t.some(function(t){return!(null==(t=t.attr("transform"))||!t.includes("rotate"))}):"ellipsis"!==n&&"wrap"!==n||1<t.filter(function(t){return t.querySelector("text")}).length}(r,i,e)||null==n||n(r,t,i,a)})}function SO(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}var AO=Je(function(t,e){var t=j(t,2),n=t[0],t=t[1],e=j(e,2),r=e[0],e=e[1],n=j([n*r+t*e,n*e-t*r],2),e=n[0],t=n[1];return Math.atan2(t,e)},function(t,e){return O(O([],j(t),!1),j(e),!1).join()});function _O(t,e,n){var r,i=n.labelAlign;return(null==(r=e.style.transform)?void 0:r.includes("rotate"))?e.getLocalEulerAngles():(r=0,e=ZM(t.value,n),t=XM(t.value,n),"horizontal"===i?0:(r="perpendicular"===i?AO([1,0],e):AO([t[0]<0?-1:1,0],t),pw(n=((n=Zx(r))+360)%180,-90,90)||(n+=180),n))}function TO(t,e,n){var r=n.type,i=n.labelAlign,t=ZM(t,n),n=SO(e),e=SO(Zx(AO([1,0],t))),a="center",o="middle";return"linear"===r?[90,270].includes(e)&&0===n?(a="center",o=1===t[1]?"top":"bottom"):e%180||![90,270].includes(n)?0===e?(pw(n,0,90,!1,!0)||pw(n,0,90)||pw(n,270,360))&&(a="start"):90===e?pw(n,0,90,!1,!0)?a="start":(pw(n,90,180)||pw(n,270,360))&&(a="end"):270===e?pw(n,0,90,!1,!0)?a="end":(pw(n,90,180)||pw(n,270,360))&&(a="start"):180===e&&(90===n?a="start":(pw(n,0,90)||pw(n,270,360))&&(a="end")):a="center":"parallel"===i?o=pw(e,0,180,!0)?"top":"bottom":"horizontal"===i?pw(e,90,270,!1)?a="end":(pw(e,270,360,!1)||pw(e,0,90))&&(a="start"):"perpendicular"===i&&(a=pw(e,90,270)?"end":"start"),{textAlign:a,textBaseline:o}}function PO(t,e,n){var r=n.showTick,i=n.tickLength,a=n.tickDirection,o=n.labelDirection,s=n.labelSpacing,l=e.indexOf(t),s=tw(s,[t,l,e]),o=j([ZM(t.value,n),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(function(t,e){return t*("positive"===e?-1:1)},1)}(o,a)],2),a=j(ww(xw(o[0],s+(1===o[1]?tw(r?i:0,[t,l,e]):0)),tO(t.value,n)),2);return{x:a[0],y:a[1]}}function CO(t,e){"text"===t.nodeName&&t.attr(e)}function LO(r){EO(this.node().childNodes,r,{hide:Wx,show:zx,rotate:function(t,e){var n;e=+e,n=r,(t=t).setLocalEulerAngles(e),e=TO(t.__data__.value,e,n),(n=t.querySelector(BM.labelItem.class))&&CO(n,e)},ellipsis:function(t,e,n){void 0===e&&(e=1/0),t&&uw(t,e,n)},wrap:function(t,e,n){var r;t&&cw(t,{wordWrap:!0,wordWrapWidth:e,maxLines:t=void 0===(t=n)?2:t,textBaseline:r=void 0===r?"top":r})},getTextShape:function(t){return t.querySelector("text")}})}function NO(t,e,n,r,i){var a,o,s,l,c,u=n.indexOf(e),h=x(t).append((a=e,o=u,s=n,c=(l=i).labelFormatter,Pe(c)?function(){return fw(tw(c,[a,o,s,ZM(a.value,l)]))}:function(){return fw(a.label||"")})).attr("className",BM.labelItem.name).node(),r=j(Gw(qM(r,[e,u,n])),2),u=r[0],n=r[1],r=n.transform,n=at(n,["transform"]),f=(Hw(t,r),_O(e,t,i));return t.setLocalEulerAngles(+f),CO(h,m(m({},TO(e.value,f,i)),u)),Hw(t,r),t.attr(n),h}function jO(n,f,d,p){var t=$M(f,d.labelFilter),g=w(d,"label");return n.selectAll(BM.label.class).data(t,function(t,e){return e}).join(function(t){return t.append("g").attr("className",BM.label.name).transition(function(t){return NO(this,t,f,g,d),this.attr(PO(t,f,d)),this.__bbox__=t.bbox,null}).call(function(){return LO.call(n,d)})},function(t){return t.transition(function(t){var e,n,r,i,a,o,s,l,c=this.querySelector(BM.labelItem.class),u=NO(this,t,f,g,d),h=(e=c,n=u,c=p.update,void 0===r&&(r="destroy"),u=n,"text"===(i=e).nodeName&&"text"===u.nodeName&&i.attributes.text===u.attributes.text?(e.remove(),[null]):(i=function(){"destroy"===r?e.destroy():"hide"===r&&Wx(e),n.isVisible()&&zx(n)},c?(u=void 0===(u=c.duration)?0:u,a=void 0===(a=c.delay)?0:a,o=Math.ceil(+u/2),u=+u/4,s=(h=j((l=function(t){var e,n;return"circle"===t.nodeName?(n=(e=j(t.getLocalPosition(),2))[0],e=e[1],[n-(n=t.attr("r")),e-n]):t.getLocalPosition()})(e),2))[0],h=h[1],l=j(l(n),2),l=(s=j([(s+l[0])/2-s,(h+l[1])/2-h],2))[0],h=s[1],s=e.animate([{opacity:1,transform:"translate(0, 0)"},{opacity:0,transform:"translate(".concat(l,", ").concat(h,")")}],m(m({fill:"both"},c),{duration:a+o+u})),pM(l=n.animate([{opacity:0,transform:"translate(".concat(-l,", ").concat(-h,")"),offset:.01},{opacity:1,transform:"translate(0, 0)"}],m(m({fill:"both"},c),{duration:o+u,delay:a+o-u})),i),[s,l]):(i(),[null]))),c=mM(this,PO(t,f,d),p.update);return this.__bbox__=t.bbox,O(O([],j(h),!1),[c],!1)}).call(function(t){var e,t=sn(t,"_transitions").flat().filter(aw);e=function(){return LO.call(n,d)},0===(t=t).length?e():Promise.all(t.map(function(t){return null==t?void 0:t.finished})).then(e)})},function(t){return t.transition(function(){var t=this,e=vM(this.childNodes[0],p.exit);return pM(e,function(){return x(t).remove()}),e})}).transitions()}function RO(t,e){return KM(t,e.tickDirection,e)}var IO=Je(function(t,e){t=j(t,2);return[[0,0],[t[0]*e,t[1]*e]]},function(t,e){return O(O([],j(t),!1),[e],!1).join()});function BO(t,e,n,r,i,a,o){var s=RO(t.value,a),a=(c=t,u=e,h=n,l=s,a=(a=a).tickLength,l=j(IO(l,tw(a,[c,u,h])),2),a=j(l[0],2),c=a[0],u=a[1],h=j(l[1],2),{x1:c,x2:h[0],y1:u,y2:h[1]}),l=a.x1,c=a.x2,u=a.y1,h=a.y2,a=j(Gw(qM(o,[t,e,n,s])),2),o=a[0],t=a[1];"line"===r.node().nodeName&&r.styles(m({x1:l,x2:c,y1:u,y2:h},o)),i.attr(t),r.styles(o)}function DO(t,e,n,r,i,a){o=x(this),s=t,l=e,c=n,h=(u=r).tickFormatter,f=RO(s.value,u),u="line",Pe(h)&&(u=function(){return tw(h,[s,l,c,f])});BO(t,e,n,o.append(u).attr("className",BM.tickItem.name),this,r,i);var o,s,l,c,u,h,f,e=j(tO(t.value,r),2);return mM(this,{x:e[0],y:e[1]},a)}var FO=ew({text:"text"},"title");function zO(t){return/\S+-\S+/g.test(t)?t.split("-").map(function(t){return t[0]}):2<t.length?[t[0]]:t.split("")}function WO(r,t){t=Object.entries(t).reduce(function(t,e){var e=j(e,2),n=e[0],e=e[1];return r.node().attr(n)||(t[n]=e),t},{});r.styles(t)}t(VO,GO=mm),VO.prototype.getAvailableSpace=function(){var t=this.attributes,r=t.width,i=t.height,e=t.position,n=t.spacing,t=t.inset,a=this.querySelector(FO.text.class);if(!a)return new Qx(0,0,+r,+i);var a=a.getBBox(),o=a.width,s=a.height,a=j(Bw(n),4),l=a[0],c=a[1],u=a[2],h=a[3],n=j([0,0,+r,+i],4),f=n[0],d=n[1],p=n[2],g=n[3],a=zO(e);if(a.includes("i"))return new Qx(f,d,p,g);a.forEach(function(t,e){var n;"t"===t&&(n=j(0===e?[s+u,+i-s-u]:[0,+i],2),d=n[0],g=n[1]),"r"===t&&(n=j([+r-o-h],1),p=n[0]),"b"===t&&(n=j([+i-s-l],1),g=n[0]),"l"===t&&(n=j(0===e?[o+c,+r-o-c]:[0,+r],2),f=n[0],p=n[1])});n=j(Bw(t),4),e=n[0],a=n[1],t=n[2],n=n[3],a=j([n+a,e+t],2),t=a[0],a=a[1];return new Qx(f+n,d+e,p-t,g-a)},VO.prototype.getBBox=function(){return this.title?this.title.getBBox():new Qx(0,0,0,0)},VO.prototype.render=function(t,e){var n,r,i,a,o,s,l=this,c=(t.width,t.height,t.position,t.spacing,at(t,["width","height","position","spacing"])),u=j(Gw(c),1)[0],h=(h=(t=t).width,r=t.height,t=t.position,i=j([+h/2,+r/2],2),a=(i=j([+i[0],+i[1],"center","middle"],4))[0],o=i[1],s=i[2],i=i[3],(t=zO(t)).includes("l")&&(a=(n=j([0,"start"],2))[0],s=n[1]),t.includes("r")&&(a=(n=j([+h,"end"],2))[0],s=n[1]),t.includes("t")&&(o=(h=j([0,"top"],2))[0],i=h[1]),t.includes("b")&&(o=(n=j([+r,"bottom"],2))[0],i=n[1]),{x:a,y:o,textAlign:s,textBaseline:i}),f=h.x,d=h.y,p=h.textAlign,g=h.textBaseline;dw(!!c.text,x(e),function(t){l.title=t.maybeAppendByClassName(FO.text,"text").styles(u).call(WO,{x:f,y:d,textAlign:p,textBaseline:g}).node()})};var GO,HO=VO;function VO(t){return GO.call(this,t,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"})||this}function YO(t,e,n,r,i){var a,o,s,l,c,u,h,f,d=j(Gw(w(r,"title")),2),p=d[0],d=d[1],g=d.transform,d=at(d,["transform"]),d=(t.styles(p),e.styles(d),g||function(t,e,n){if((t=t.cloneNode(!0)).style.transform="scale(1, 1)",t.style.transform="none",t=t.getBBox().height,"vertical"===e){if("left"===n)return"rotate(-90) translate(0, ".concat(t/2,")");if("right"===n)return"rotate(-90) translate(0, -".concat(t/2,")")}return""}(t.node(),p.direction,p.position)),y=(Hw(t.node(),d),g=x(n._offscreen||n.querySelector(BM.mainGroup.class)),p=e,r=void 0===(r=(n=r).titlePosition)?"lb":r,a=n.titleSpacing,o=zO(r),g=g.node().getLocalBounds(),s=(l=j(g.min,2))[0],l=l[1],c=(g=j(g.halfExtents,2))[0],g=g[1],u=(p=j(p.node().getLocalBounds().halfExtents,2))[0],p=p[1],l=(s=j([s+c,l+g],2))[0],s=s[1],m=(a=j(Bw(a),4))[0],h=a[1],f=a[2],a=a[3],["start","end"].includes(r)&&"linear"===n.type?(y=n.startPos,n=n.endPos,n=(r=j("start"===r?[y,n]:[n,y],2))[0],y=(r=j(xw(Sw([-(y=r[1])[0]+n[0],-y[1]+n[1]]),m),2))[0],r=r[1],{x:n[0]+y,y:n[1]+r}):(o.includes("t")&&(s-=g+p+m),o.includes("r")&&(l+=c+u+h),o.includes("l")&&(l-=c+u+a),o.includes("b")&&(s+=g+p+f),{x:l,y:s})),n=y.x,r=y.y,m=mM(e.node(),{x:n,y:r},i);return Hw(t.node(),d),m}function qO(e,t,o,s){var n=e.showLine,r=e.showTick,i=e.showLabel,n=dw(n,t.maybeAppendByClassName(BM.lineGroup,"g"),function(t){return lO(t,e,s)})||[],r=dw(r,t.maybeAppendByClassName(BM.tickGroup,"g"),function(t){return t=t,r=s,i=$M(o,(n=e).tickFilter),a=w(n,"tick"),t.selectAll(BM.tick.class).data(i,function(t){return t.id||t.label}).join(function(t){return t.append("g").attr("className",BM.tick.name).transition(function(t,e){return DO.call(this,t,e,i,n,a,!1)})},function(t){return t.transition(function(t,e){return this.removeChildren(),DO.call(this,t,e,i,n,a,r.update)})},function(t){return t.transition(function(){var t=this,e=vM(this.childNodes[0],r.exit);return pM(e,function(){return t.remove()}),e})}).transitions();var n,r,i,a})||[],i=dw(i,t.maybeAppendByClassName(BM.labelGroup,"g"),function(t){return jO(t,o,e,s)})||[];return O(O(O([],j(n),!1),j(r),!1),j(i),!1).filter(function(t){return!!t})}t(XO,$O=mm),XO.prototype.render=function(o,t,e){var s=this,n=o.titleText,r=o.data,i=o.animate,a=o.showTitle,l=o.showGrid,c=o.dataThreshold,u=o.truncRange,h=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}(r,c).filter(function(t){t=t.value;return!(u&&t>u[0]&&t<u[1])}),f=dM(void 0===e?i:e),r=dw(l,x(t).maybeAppendByClassName(BM.gridGroup,"g"),function(t){return hO(t,h,o,f)})||[],c=x(t).maybeAppendByClassName(BM.mainGroup,"g"),i=(n&&(!this.initialized&&f.enter||this.initialized&&f.update)&&qO(o,x(this.offscreenGroup),h,dM(!1)),qO(o,x(c.node()),h,f)),e=dw(a,x(t).maybeAppendByClassName(BM.titleGroup,"g"),function(t){return e=t,n=s,i=f,a=(r=o).titleText,e.selectAll(BM.title.class).data([{title:a}].filter(function(t){return!!t.title}),function(t,e){return t.title}).join(function(t){return t.append(function(){return fw(a)}).attr("className",BM.title.name).transition(function(){return YO(x(this),e,n,r,i.enter)})},function(t){return t.transition(function(){return YO(x(this),e,n,r,i.update)})},function(t){return t.remove()}).transitions();var e,n,r,i,a})||[];return O(O(O([],j(r),!1),j(i),!1),j(e),!1).flat().filter(function(t){return!!t})};var $O,UO=XO;function XO(t){return $O.call(this,t,IM)||this}var KO,ZO=ew({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"),QO=(t(JO,KO=mm),Object.defineProperty(JO.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return We(t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(JO.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(JO.prototype,"controllerShape",{get:function(){return 1<this.totalPages?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(JO.prototype,"pageShape",{get:function(){var n,t=this.pageViews,t=j((n=t.map(function(t){t=t.getBBox();return[t.width,t.height]}),((null==(t=n[0])?void 0:t.map(function(t,e){return n.map(function(t){return t[e]})}))||[]).map(function(t){return Math.max.apply(Math,O([],j(t),!1))})),2),e=t[0],t=t[1],r=this.attributes,i=r.pageWidth,r=r.pageHeight;return{pageWidth:void 0===i?e:i,pageHeight:void 0===r?t:r}},enumerable:!1,configurable:!0}),JO.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(JO.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(JO.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),JO.prototype.getBBox=function(){var t=KO.prototype.getBBox.call(this),e=t.x,t=t.y,n=this.controllerShape,r=this.pageShape,i=r.pageWidth,r=r.pageHeight;return new Qx(e,t,i+n.width,r)},JO.prototype.goTo=function(t){var e=this,n=this.attributes.animate,r=this.currPage,i=this.playState,a=this.playWindow,o=this.pageViews;if("idle"!==i||t<0||o.length<=0||t>=o.length)return null;o[r].setLocalPosition(0,0),this.prepareFollowingPage(t);i=j(this.getFollowingPageDiff(t),2),o=i[0],r=i[1],this.playState="running",i=yM(a,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-o,", ").concat(-r,")")}],n);return pM(i,function(){e.innerCurrPage=t,e.playState="idle",e.setVisiblePages([t]),e.updatePageInfo()}),i},JO.prototype.prev=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;return!t&&n<=0?null:(t=t?(n-1+e)%e:We(n-1,0,e),this.goTo(t))},JO.prototype.next=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;return!t&&e-1<=n?null:(t=t?(n+1)%e:We(n+1,0,e),this.goTo(t))},JO.prototype.renderClipPath=function(t){var e=this.pageShape,n=e.pageWidth,e=e.pageHeight;n&&e?(this.clipPath=t.maybeAppendByClassName(ZO.clipPath,"rect").styles({width:n,height:e}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0},JO.prototype.setVisiblePages=function(n){this.playWindow.children.forEach(function(t,e){(n.includes(e)?zx:Wx)(t)})},JO.prototype.adjustControllerLayout=function(){var t=this.prevBtnGroup,e=this.nextBtnGroup,n=this.pageInfoGroup,r=this.attributes,i=r.orientation,r=r.controllerPadding,a=n.getBBox(),o=a.width,a=(a.height,j("horizontal"===i?[-180,0]:[-90,90],2)),s=a[0],a=a[1],s=(t.setLocalEulerAngles(s),e.setLocalEulerAngles(a),t.getBBox()),a=s.width,s=s.height,l=e.getBBox(),c=l.width,l=l.height,c=Math.max(a,o,c),i="horizontal"===i?{offset:[[0,0],[a/2+r,0],[a+o+2*r,0]],textAlign:"start"}:{offset:[[c/2,-s-r],[c/2,0],[c/2,l+r]],textAlign:"center"},a=j(i.offset,3),o=j(a[0],2),s=o[0],c=o[1],l=j(a[1],2),r=l[0],o=l[1],l=j(a[2],2),a=l[0],l=l[1],i=i.textAlign,u=n.querySelector("text");u&&(u.style.textAlign=i),t.setLocalPosition(s,c),n.setLocalPosition(r,o),e.setLocalPosition(a,l)},JO.prototype.updatePageInfo=function(){var t,e=this.currPage,n=this.pageViews,r=this.attributes.formatter;n.length<2||(null!=(t=this.pageInfoGroup.querySelector(ZO.pageInfo.class))&&t.attr("text",r(e+1,n.length)),this.adjustControllerLayout())},JO.prototype.getFollowingPageDiff=function(t){var e,n,r,i=this.currPage;return i===t?[0,0]:(e=this.attributes.orientation,n=(r=this.pageShape).pageWidth,r=r.pageHeight,t=t<i?-1:1,"horizontal"===e?[t*n,0]:[0,t*r])},JO.prototype.prepareFollowingPage=function(t){var e,n=this.currPage,r=this.pageViews;this.setVisiblePages([t,n]),t!==n&&(e=(n=j(this.getFollowingPageDiff(t),2))[0],n=n[1],r[t].setLocalPosition(e,n))},JO.prototype.renderController=function(t){var e,n,r,i,a,o=this,s=this.attributes.controllerSpacing,l=this.pageShape,c=l.pageWidth,l=l.pageHeight,u=2<=this.pageViews.length,t=t.maybeAppendByClassName(ZO.controller,"g");Gx(t.node(),u),u&&(u=w(this.attributes,"button"),e=w(this.attributes,"pageNum"),i=(u=j(Gw(u),2))[0],u=u[1],n=i.size,r=at(i,["size"]),i=!t.select(ZO.prevBtnGroup.class).node(),a=t.maybeAppendByClassName(ZO.prevBtnGroup,"g").styles(u),this.prevBtnGroup=a.node(),a=a.maybeAppendByClassName(ZO.prevBtn,"path"),u=t.maybeAppendByClassName(ZO.nextBtnGroup,"g").styles(u),this.nextBtnGroup=u.node(),[a,u.maybeAppendByClassName(ZO.nextBtn,"path")].forEach(function(t){t.styles(m(m({},r),{transformOrigin:"center"})),Lw(t.node(),n,!0)}),a=t.maybeAppendByClassName(ZO.pageInfoGroup,"g"),this.pageInfoGroup=a.node(),a.maybeAppendByClassName(ZO.pageInfo,"text").styles(e),this.updatePageInfo(),t.node().setLocalPosition(c+s,l/2),i)&&(this.prevBtnGroup.addEventListener("click",function(){o.prev()}),this.nextBtnGroup.addEventListener("click",function(){o.next()}))},JO.prototype.render=function(t,e){e=x(e);this.renderClipPath(e),this.renderController(e),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},JO.prototype.bindEvents=function(){var t=this,e=Qe(function(){return t.render(t.attributes,t)},50);this.playWindow.addEventListener(b.INSERTED,e),this.playWindow.addEventListener(b.REMOVED,e)},JO);function JO(t){var e,n,t=KO.call(this,t,{animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonPath:[["M",(t=0)-(n=6),(e=0)-n],["L",t+n,e],["L",t-n,e+n],["Z"]],buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:function(t,e){return"".concat(t,"/").concat(e)},defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"})||this;return t.playState="idle",t.contentGroup=t.appendChild(new fc({class:ZO.contentGroup.name})),t.playWindow=t.contentGroup.appendChild(new fc({class:ZO.playWindow.name})),t.innerCurrPage=t.defaultPage,t}function tk(t,e,n){return"horizontal"===(t=void 0===t?"horizontal":t)?e:n}Zw.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"]]}),Zw.registerSymbol("verticalHandle",function(t,e,n){var r=1.4*n,i=n/2,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+(n=n/6)],["L",t+r-2,e+n],["M",a,e-n],["L",t+r-2,e-n]]}),Zw.registerSymbol("horizontalHandle",function(t,e,n){var r=1.4*n,i=n/2,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-(n=n/6),a],["L",t-n,e+r-2],["M",t+n,a],["L",t+n,e+r-2]]});var ek=ew({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");t(ik,nk=mm),Object.defineProperty(ik.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(ik.prototype,"actualSpace",{get:function(){var t=this.labelGroup,e=this.valueGroup,n=this.attributes.markerSize,t=t.node().getBBox(),r=t.width,t=t.height,e=e.node().getBBox(),i=e.width,e=e.height;return{markerWidth:n,labelWidth:r,valueWidth:i,height:Math.max(n,t,e)}},enumerable:!1,configurable:!0}),Object.defineProperty(ik.prototype,"span",{get:function(){var t,e=this.attributes.span;return e?(t=(e=j(Bw(e),2))[0],e=e[1],[t/(e=t+(t=this.showValue?e:0)),t/e]):[1,1]},enumerable:!1,configurable:!0}),Object.defineProperty(ik.prototype,"shape",{get:function(){var t=this.attributes,e=t.markerSize,t=t.width,n=this.actualSpace,r=n.markerWidth,n=n.height,i=this.actualSpace,a=i.labelWidth,i=i.valueWidth,o=j(this.spacing,2),s=o[0],o=o[1];return t&&(t=t-e-s-o,e=j(this.span,2),a=(e=j([e[0]*t,e[1]*t],2))[0],i=e[1]),{width:r+a+i+s+o,height:n,markerWidth:r,labelWidth:a,valueWidth:i}},enumerable:!1,configurable:!0}),Object.defineProperty(ik.prototype,"spacing",{get:function(){var t,e=this.attributes.spacing;return e?(t=(e=j(Bw(e),2))[0],e=e[1],this.showValue?[t,e]:[t,0]):[0,0]},enumerable:!1,configurable:!0}),Object.defineProperty(ik.prototype,"layout",{get:function(){var t=this.shape,e=t.markerWidth,n=t.labelWidth,r=t.valueWidth,i=t.width,t=t.height,a=j(this.spacing,2),o=a[0];return{height:t,width:i,markerWidth:e,labelWidth:n,valueWidth:r,position:[e/2,e+o,e+n+o+a[1]]}},enumerable:!1,configurable:!0}),Object.defineProperty(ik.prototype,"scaleSize",{get:function(){var t=(t=(t=this.markerGroup.node()).querySelector(ek.marker.class))?t.style:{},e=this.attributes,n=e.markerSize,r=e.markerStrokeWidth,r=void 0===r?t.strokeWidth:r,i=e.markerLineWidth,i=void 0===i?t.lineWidth:i,e=e.markerStroke,t=void 0===e?t.stroke:e,e=+(r||i||(t?1:0))*Math.sqrt(2),r=this.markerGroup.node().getBBox(),i=r.width,t=r.height;return(1-e/Math.max(i,t))*n},enumerable:!1,configurable:!0}),ik.prototype.renderMarker=function(t){var f=this,d=this.attributes.marker,p=w(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(ek.markerGroup,"g").style("zIndex",0),dw(!!d,this.markerGroup,function(){var t=f.markerGroup.node(),e=t.getElementsByClassName(ek.marker.name)[0],n=d();if(e)if(n.nodeName===e.nodeName){var r,i,a=e,o=(o=n).attributes;try{for(var s=I(Object.entries(o)),l=s.next();!l.done;l=s.next()){var c=j(l.value,2),u=c[0],h=c[1];"id"!==u&&"className"!==u&&a.attr(u,h)}}catch(t){r={error:t}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}x(e).styles(p)}else e.remove(),x(n).attr("className",ek.marker.name).styles(p),t.appendChild(n);else x(n).attr("className",ek.marker.name).styles(p),t.appendChild(n);f.markerGroup.node().scale(1/f.markerGroup.node().getScale()[0]),Lw(f.markerGroup.node(),f.scaleSize,!0)})},ik.prototype.renderLabel=function(t){var e=w(this.attributes,"label"),n=e.text,e=at(e,["text"]);this.labelGroup=t.maybeAppendByClassName(ek.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(ek.label,function(){return fw(n)}).styles(e)},ik.prototype.renderValue=function(t){var e=this,n=w(this.attributes,"value"),r=n.text,i=at(n,["text"]);this.valueGroup=t.maybeAppendByClassName(ek.valueGroup,"g").style("zIndex",0),dw(this.showValue,this.valueGroup,function(){e.valueGroup.maybeAppendByClassName(ek.value,function(){return fw(r)}).styles(i)})},ik.prototype.renderBackground=function(t){var e=this.shape,n=e.width,e=e.height,r=w(this.attributes,"background");this.background=t.maybeAppendByClassName(ek.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(ek.background,"rect").styles(m({width:n,height:e},r))},ik.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,t=j(t.position,3),i=t[0],a=t[1],t=t[2],r=r/2;this.markerGroup.styles({x:i,y:r}),this.labelGroup.styles({x:a,y:r}),uw(this.labelGroup.select(ek.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({x:t,y:r}),uw(this.valueGroup.select(ek.value.class).node(),Math.ceil(n)))},ik.prototype.render=function(t,e){e=x(e);this.renderMarker(e),this.renderLabel(e),this.renderValue(e),this.renderBackground(e),this.adjustLayout()};var nk,rk=ik;function ik(t){return nk.call(this,t,{span:[1,1],marker:function(){return new rc({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}function ak(t,e,n){return void 0===n&&(n=!0),t?e(t):n}var ok,sk=ew({page:"item-page",navigator:"navigator",item:"item"},"items"),lk=(t(ck,ok=mm),Object.defineProperty(ck.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(ck.prototype,"grid",{get:function(){var t=this.attributes,e=t.gridRow,n=t.gridCol,t=t.data;if(e||n)return e&&n?[e,n]:e?[e,t.length]:[t.length,n];throw new Error("gridRow and gridCol can not be set null at the same time")},enumerable:!1,configurable:!0}),Object.defineProperty(ck.prototype,"renderData",{get:function(){var t=this.attributes,a=t.data,o=t.layout,s=w(this.attributes,"item");return a.map(function(e,n){var t=e.id,r=e.label,i=e.value;return{id:"".concat(void 0===t?n:t),index:n,style:m({layout:o,labelText:r,valueText:i},Object.fromEntries(Object.entries(s).map(function(t){t=j(t,2);return[t[0],tw(t[1],[e,n,a])]})))}})},enumerable:!1,configurable:!0}),ck.prototype.getGridLayout=function(){var u=this,t=this.attributes,h=t.orientation,f=t.width,d=t.rowPadding,p=t.colPadding,g=j(this.navigatorShape,1)[0],t=j(this.grid,2),y=t[0],m=t[1],v=m*y,b=0;return this.pageViews.children.map(function(t,e){var n,r=Math.floor(e/v),i=e%v,a=u.ifHorizontal(m,y),a=[Math.floor(i/a),i%a],a=("vertical"===h&&a.reverse(),j(a,2)),o=a[0],a=a[1],s=(f-g-(m-1)*p)/m,t=t.getBBox().height,l=j([0,0],2),c=l[0],l=l[1];return b="horizontal"===h?(c=(n=j([b,o*(t+d)],2))[0],l=n[1],a===m-1?0:b+s+p):(c=(n=j([a*(s+p),b],2))[0],l=n[1],o===y-1?0:b+t+d),{page:r,index:e,row:o,col:a,pageIndex:i,width:s,height:t,x:c,y:l}})},ck.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,a=t.rowPadding,o=t.colPadding,t=j(this.navigatorShape,1)[0],r=j(this.grid,2),s=r[0],l=r[1],r=j([e-t,n],2),c=r[0],u=r[1],e=j([0,0,0,0,0,0,0,0],8),h=e[0],f=e[1],d=e[2],p=e[3],g=e[4],y=e[5],m=e[6],v=e[7];return this.pageViews.children.map(function(t,e){var t=t.getBBox(),n=t.width,t=t.height,r=0===m?0:o,i=m+r+n;return i<=c&&ak(g,function(t){return t<l})?(r=j([m+r,v,i],3),h=r[0],f=r[1],m=r[2]):(i=j([y+1,0,0,v+t+a],4),y=i[0],g=i[1],m=i[2],(v=i[3])+a+t<=u&&ak(y,function(t){return t<s})?(r=j([m,v,n],3),h=r[0],f=r[1],m=r[2]):(i=j([0,0,n,0,d+1,0,0,0],8),h=i[0],f=i[1],m=i[2],v=i[3],d=i[4],p=i[5],y=i[6],g=i[7])),{width:n,height:t,x:h,y:f,page:d,index:e,pageIndex:p++,row:y,col:g++}})},Object.defineProperty(ck.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var t="grid"===this.attributes.layout?this.getGridLayout:this.getFlexLayout,e=t.call(this);return 0<e.slice(-1)[0].page?(this.navigatorShape=[55,0],t.call(this)):e},enumerable:!1,configurable:!0}),ck.prototype.ifHorizontal=function(t,e){return tk(this.attributes.orientation,t,e)},ck.prototype.flattenPage=function(e){e.querySelectorAll(sk.item.class).forEach(function(t){e.appendChild(t)}),e.querySelectorAll(sk.page.class).forEach(function(t){e.removeChild(t).destroy()})},ck.prototype.renderItems=function(t){var e=this.attributes,n=e.click,r=e.mouseenter,i=e.mouseleave,a=(this.flattenPage(t),this.dispatchCustomEvent.bind(this));x(t).selectAll(sk.item.class).data(this.renderData,function(t){return t.id}).join(function(t){return t.append(function(t){t=t.style;return new rk({style:t})}).attr("className",sk.item.name).on("click",function(){null!=n&&n(this),a("itemClick",{item:this})}).on("pointerenter",function(){null!=r&&r(this),a("itemMouseenter",{item:this})}).on("pointerleave",function(){null!=i&&i(this),a("itemMouseleave",{item:this})})},function(t){return t.each(function(t){t=t.style;this.update(t)})},function(t){return t.remove()})},ck.prototype.relayoutNavigator=function(){var t=this.attributes,e=t.layout,t=t.width,n=(null==(n=this.pageViews.children[0])?void 0:n.getBBox().height)||0,r=j(this.navigatorShape,2),i=r[0],r=r[1];this.navigator.update("grid"===e?{pageWidth:t-i,pageHeight:n-r}:{})},ck.prototype.adjustLayout=function(){var n,e=this,t=Object.entries((t=this.itemsLayout,n="page",t.reduce(function(t,e){return(t[e[n]]=t[e[n]]||[]).push(e),t},{}))).map(function(t){t=j(t,2);return{page:t[0],layouts:t[1]}}),u=O([],j(this.navigator.getContainer().children),!1);t.forEach(function(t){var t=t.layouts,c=e.pageViews.appendChild(new fc({className:sk.page.name}));t.forEach(function(t){var n,r,i,e=t.x,a=t.y,o=t.index,s=t.width,l=t.height,o=u[o];c.appendChild(o),n=t,r=o,(i=ze(t="__layout__")?t.split("."):t).forEach(function(t,e){e<i.length-1?(je(r[t])||(r[t]=Ge(i[e+1])?[]:{}),r=r[t]):r[t]=n}),o.update({x:e,y:a,width:s,height:l})})}),this.relayoutNavigator()},ck.prototype.renderNavigator=function(t){var e=this.attributes.orientation,n=w(this.attributes,"nav"),r=nw({orientation:e},n),i=this;return t.selectAll(sk.navigator.class).data(["nav"]).join(function(t){return t.append(function(){return new QO({style:r})}).attr("className",sk.navigator.name).each(function(){i.navigator=this})},function(t){return t.each(function(){this.update(r)})},function(t){return t.remove()}),this.navigator},ck.prototype.getBBox=function(){return this.navigator.getBBox()},ck.prototype.render=function(t,e){var n=this.attributes.data;n&&0!==n.length&&(n=this.renderNavigator(x(e)),this.renderItems(n.getContainer()),this.adjustLayout())},ck.prototype.dispatchCustomEvent=function(t,e){t=new gl(t,{detail:e});this.dispatchEvent(t)},ck);function ck(t){t=ok.call(this,t,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:an,mouseenter:an,mouseleave:an})||this;return t.navigatorShape=[0,0],t}var uk,hk=ew({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),fk={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},dk=(t(pk,uk=mm),pk.prototype.render=function(t,e){var n=x(e).maybeAppendByClassName(hk.markerGroup,"g"),n=(this.renderMarker(n),x(e).maybeAppendByClassName(hk.labelGroup,"g"));this.renderLabel(n)},pk.prototype.renderMarker=function(t){var r=this,e=this.attributes,n=e.orientation,e=e.markerSymbol,i=void 0===e?tk(n,"horizontalHandle","verticalHandle"):e;dw(!!i,t,function(t){var e=w(r.attributes,"marker"),n=m({symbol:i},e);r.marker=t.maybeAppendByClassName(hk.marker,function(){return new Zw({style:n})}).update(n)})},pk.prototype.renderLabel=function(t){var s=this,e=this.attributes,n=e.showLabel,l=e.orientation,r=e.spacing,c=void 0===r?0:r,u=e.formatter;dw(n,t,function(t){var e=w(s.attributes,"label"),n=e.text,e=at(e,["text"]),r=(null==(r=t.select(hk.marker.class))?void 0:r.node().getBBox())||{},i=r.width,r=r.height,r=j(tk(l,[0,(void 0===r?0:r)+c,"center","top"],[(void 0===i?0:i)+c,0,"start","middle"]),4),i=r[0],a=r[1],o=r[2],r=r[3];t.maybeAppendByClassName(hk.label,"text").styles(m(m({},e),{x:i,y:a,text:u(n).toString(),textAlign:o,textBaseline:r}))})},pk);function pk(t){return uk.call(this,t,fk)||this}var gk,By={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},yk=nw({},By,{}),mk=nw({},By,Ww(fk,"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"}),vk=ew({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"),bk=(t(xk,gk=mm),xk.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,r=r.titleText,a=j(Gw(w(this.attributes,"title")),2),o=a[0],a=a[1],s=(this.titleGroup=t.maybeAppendByClassName(vk.titleGroup,"g").styles(a),m(m({width:e,height:n},o),{text:i?r:""}));this.title=this.titleGroup.maybeAppendByClassName(vk.title,function(){return new HO({style:s})}).update(s)},xk.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,e=e.height,a=j(Gw(w(this.attributes,"title",!0)),2),o=a[0],a=a[1],s=m(m({},o),{width:i,height:e,x:0,y:0}),l=(this.itemsGroup=t.maybeAppendByClassName(vk.itemsGroup,"g").styles(m({x:n,y:r},a)),this);this.itemsGroup.selectAll(vk.items.class).data(["items"]).join(function(t){return t.append(function(){return new lk({style:s})}).attr("className",vk.items.name).each(function(){l.items=x(this)})},function(t){return t.update(s)},function(t){return t.remove()})},xk.prototype.adjustLayout=function(){var t,e;this.attributes.showTitle&&(t=(e=this.title.node().getAvailableSpace()).x,e=e.y,this.itemsGroup.node().setLocalPosition(t,e))},Object.defineProperty(xk.prototype,"availableSpace",{get:function(){var t=this.attributes,e=t.showTitle,n=t.width,t=t.height;return e?this.title.node().getAvailableSpace():new Qx(0,0,n,t)},enumerable:!1,configurable:!0}),xk.prototype.getBBox=function(){var t,e,n,r,i,a,o,s,l,c,u=null==(u=this.title)?void 0:u.node(),h=null==(h=this.items)?void 0:h.node();return u&&h?(h=h,t=(r=(u=u).attributes).position,e=r.spacing,n=r.inset,r=r.text,u=u.getBBox(),i=h.getBBox(),t=zO(t),e=(r=j(Bw(r?e:0),4))[0],a=r[1],o=r[2],r=r[3],s=(n=j(Bw(n),4))[0],l=n[1],c=n[2],n=n[3],a=(r=j([r+a,e+o],2))[0],e=r[1],r=(o=j([n+l,s+c],2))[0],n=o[1],"l"===t[0]?new Qx(u.x,u.y,i.width+u.width+a+r,Math.max(i.height+n,u.height)):"t"===t[0]?new Qx(u.x,u.y,Math.max(i.width+r,u.width),i.height+u.height+e+n):(s=(l=j([h.attributes.width||i.width,h.attributes.height||i.height],2))[0],c=l[1],new Qx(i.x,i.y,s+u.width+a+r,c+u.height+e+n))):gk.prototype.getBBox.call(this)},xk.prototype.render=function(t,e){var n=t.width,t=t.height,e=x(e);this.renderTitle(e,n,t),this.renderItems(e,this.availableSpace),this.adjustLayout()},xk);function xk(t){return gk.call(this,t,yk)||this}var wk,Mk={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",zIndex:999},Ok=ew({background:"background",labelGroup:"label-group",label:"label"},"indicator"),kk=(t(Ek,wk=mm),Ek.prototype.renderBackground=function(){var t,e,n,r,i,a,o;this.label&&(t=(i=this.attributes).position,o=(i=j(Bw(i.padding),4))[0],e=i[1],n=i[2],i=i[3],a=(r=this.label.node().getLocalBounds()).min,r=r.max,i=[[a[0]-i,a[1]-o],[r[0]+e,r[1]+n]],a=this.getPath(t,i),o=w(this.attributes,"background"),this.background=x(this.group).maybeAppendByClassName(Ok.background,"path").styles(m(m({},o),{path:a})),this.group.appendChild(this.label.node()))},Ek.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,t=j(Gw(w(this.attributes,"label")),2),r=t[0],t=t[1],r=(r.text,at(r,["text"]));this.label=x(this.group).maybeAppendByClassName(Ok.labelGroup,"g").styles(t),n&&this.label.maybeAppendByClassName(Ok.label,function(){return fw(e(n))}).style("text",e(n).toString()).selectAll("text").styles(r)},Ek.prototype.adjustLayout=function(){var t=j(this.point,2),e=t[0],t=t[1];this.group.attr("x",-e).attr("y",-t)},Ek.prototype.getPath=function(n,t){var r=this,t=j(t,2),e=j(t[0],2),i=e[0],e=e[1],t=j(t[1],2),a=t[0],t=t[1],o={top:"bottom",right:"left",bottom:"top",left:"right"},a=Object.entries({top:[[i,e],[a,e]],right:[[a,e],[a,t]],bottom:[[a,t],[i,t]],left:[[i,t],[i,e]]}).map(function(t){var t=j(t,2),e=t[0],t=t[1];return e===o[n]?r.createCorner(t):[O(["M"],j(t[0]),!1),O(["L"],j(t[1]),!1)]});return a.push([["Z"]]),a.flat().filter(function(t,e,n){return 0===e||"M"!==t[0]})},Ek.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=function(t,e){var n=(t=j(t,2))[0],t=t[1],r=(e=j(e,2))[0],e=e[1];return n!==r&&t===e}.apply(void 0,O([],j(t),!1)),t=j(t,2),r=j(t[0],2),i=r[0],r=r[1],t=j(t[1],2),a=t[0],t=t[1],a=j(n?[a-i,[i,a]]:[t-r,[r,t]],2),t=a[0],a=j(a[1],2),o=a[0],a=a[1],s=t/2,e=e*(t/Math.abs(t)),t=e/2,e=e*Math.sqrt(3)/2*.8,o=j([o,o+s-t,o+s,o+s+t,a],5),s=o[0],t=o[1],a=o[2],l=o[3],o=o[4];return n?(this.point=[a,r-e],[["M",s,r],["L",t,r],["L",a,r-e],["L",l,r],["L",o,r]]):(this.point=[i+e,a],[["M",i,s],["L",i,t],["L",i+e,a],["L",i,l],["L",i,o]])},Ek.prototype.bindEvents=function(){this.label.on(b.BOUNDS_CHANGED,this.renderBackground)},Ek.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout()},Ek);function Ek(t){t=wk.call(this,t,Mk)||this;return t.point=[0,0],t.group=t.appendChild(new fc({})),t.isMutationObserved=!0,t}function Sk(t,e){var t=j(function(t,e){for(var n=1;n<t.length;n+=1){var r=t[n-1],i=t[n];if(r<=e&&e<=i)return[r,i]}return[e,e]}(t,e),2),n=t[0],t=t[1];return{tick:(n+t)/2<e?t:n,range:[n,t]}}var Ak=ew({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function _k(t){var e=t.orientation,n=t.size,t=t.length;return tk(e,[t,n],[n,t])}function Tk(t){var e=t.type,t=j(_k(t),2),n=t[0],t=t[1];return"size"===e?[["M",0,t],["L",0+n,0],["L",0+n,t],["Z"]]:[["M",0,t],["L",0,0],["L",0+n,0],["L",0+n,t],["Z"]]}function Pk(t){var i,a,o,e=t.orientation,r=t.color,n=t.block,t=t.partition,s=(l=Pe(r)?new Array(20).fill(0).map(function(t,e,n){return r(e/(n.length-1))}):r).length,l=l.map(function(t){return ma(t).toString()});return s?1===s?l[0]:n?(i=t,n=e,a=Array.from(l),o=i.length,new Array(o).fill(0).reduce(function(t,e,n){var r=a[n%a.length];return t+" ".concat(i[n],":").concat(r).concat(n<o-1?" ".concat(i[n+1],":").concat(r):"")},"l(".concat("horizontal"===n?"0":"270",")"))):l.reduce(function(t,e,n){return t+" ".concat(n/(s-1),":").concat(e)},"l(".concat(tk(e,"0","270"),")")):""}function Ck(t,e){var n,r,i,a=w(e,"selection"),o=Pk(e),t=t.maybeAppendByClassName(Ak.selection,"path").styles(m({path:Tk(e),fill:o},a)),a=t.maybeAppendByClassName(Ak.clipPath,"path").styles({path:(a=(o=e).orientation,(e=o.range)?(r=(o=j(_k(o),2))[0],o=o[1],n=(e=j(e,2))[0],e=e[1],i=tk(a,n*r,0),n=tk(a,0,n*o),r=tk(a,e*r,r),[["M",i,n],["L",i,i=tk(a,o,e*o)],["L",r,i],["L",r,n],["Z"]]):[])}).node();t.style("clip-path",a)}t(jk,Lk=mm),jk.prototype.render=function(t,e){var n,r,i=x(e).maybeAppendByClassName(Ak.trackGroup,"g");i=i,r=w(n=t,"track"),i.maybeAppendByClassName(Ak.track,"path").styles(m({path:Tk(n)},r)),Ck(x(e).maybeAppendByClassName(Ak.selectionGroup,"g"),t)};var Lk,Nk=jk;function jk(t){return Lk.call(this,t,{type:"color",orientation:"horizontal",size:30,range:[0,1],length:200,block:!1,partition:[],color:["#fff","#000"],trackFill:"#e5e5e5"})||this}var Rk,Ik,Bk,Dk,Fk=Je(function(t){return{min:Math.min.apply(Math,O([],j(t.map(function(t){return t.value})),!1)),max:Math.max.apply(Math,O([],j(t.map(function(t){return t.value})),!1))}},function(t){return t.map(function(t){return t.id})}),zk=(t(y,Rk=mm),Object.defineProperty(y.prototype,"handleOffsetRatio",{get:function(){return this.ifHorizontal(.5,.5)},enumerable:!1,configurable:!0}),y.prototype.getBBox=function(){var t=this.attributes,e=t.width,t=t.height;return new Qx(0,0,e,t)},y.prototype.render=function(t,e){var n=this,t=t.showLabel,r=(this.renderTitle(x(e)),this.availableSpace),i=r.x,r=r.y,e=x(e).maybeAppendByClassName(vk.contentGroup,"g").styles({x:i,y:r}),i=(dw(!!t,e.maybeAppendByClassName(vk.labelGroup,"g").styles({zIndex:1}),function(t){n.renderLabel(t)}),e.maybeAppendByClassName(vk.ribbonGroup,"g").styles({zIndex:0}));this.handlesGroup=e.maybeAppendByClassName(vk.handlesGroup,"g").styles({zIndex:2}),this.renderHandles(),this.renderRibbon(i),this.renderIndicator(e),this.adjustLabel(),this.adjustHandles()},Object.defineProperty(y.prototype,"range",{get:function(){var t=this.attributes,e=t.data,t=t.domain;return t?{min:t[0],max:t[1]}:Fk(e)},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"ribbonScale",{get:function(){var t=this.range,e=t.min,t=t.max;return this.innerRibbonScale.update({domain:[e,t],range:[0,1]}),this.innerRibbonScale},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"ribbonRange",{get:function(){var t=j(this.selection,2),e=t[0],t=t[1],n=this.ribbonScale;return[n.map(e),n.map(t)]},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"selection",{get:function(){var t=this.range,e=t.min,t=t.max,n=this.attributes.defaultValue,e=j(void 0===n?[e,t]:n,2);return[e[0],e[1]]},enumerable:!1,configurable:!0}),y.prototype.ifHorizontal=function(t,e){return tk(this.attributes.orientation,"function"==typeof t?t():t,"function"==typeof e?e():e)},y.prototype.renderTitle=function(t){var e=this.attributes,n=e.showTitle,r=e.titleText,i=e.width,e=e.height,a=w(this.attributes,"title"),o=m(m({},a),{width:i,height:e,text:r}),s=this;t.selectAll(vk.title.class).data(n?[r]:[]).join(function(t){return t.append(function(){return new HO({style:o})}).attr("className",vk.title.name).each(function(){s.title=this})},function(t){return t.update(o)},function(t){return t.each(function(){s.title=void 0}).remove()})},Object.defineProperty(y.prototype,"availableSpace",{get:function(){var t,e;return this.title?this.title.getAvailableSpace():(t=(e=this.attributes).width,e=e.height,new Qx(0,0,t,e))},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"labelFixedSpacing",{get:function(){return this.attributes.showTick?5:0},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"labelPosition",{get:function(){var t=this.attributes,e=t.orientation,t=t.labelDirection;return{vertical:{positive:"right",negative:"left"},horizontal:{positive:"bottom",negative:"top"}}[e][t]},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"labelBBox",{get:function(){var t,e;return this.attributes.showLabel?(this.cacheLabelBBox||(t=(e=(null==(e=this.label.querySelector(BM.labelGroup.class))?void 0:e.children.slice(-1)[0]).getBBox()).width,e=e.height,this.cacheLabelBBox=new Qx(0,0,t,e)),this.cacheLabelBBox):new Qx(0,0,0,0)},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"labelShape",{get:function(){var t,e=this.attributes,n=e.showLabel,e=e.labelSpacing,e=void 0===e?0:e;return n?{width:t=(n=this.labelBBox).width,height:n=n.height,size:this.ifHorizontal(n,t)+e+this.labelFixedSpacing,length:this.ifHorizontal(t,n)}:{width:0,height:0,size:0,length:0}},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"ribbonBBox",{get:function(){var t=this.attributes,e=t.showHandle,t=t.ribbonSize,n=this.availableSpace,r=n.width,n=n.height,i=this.labelShape,a=i.size,i=i.length,r=j(this.ifHorizontal([n,r],[r,n]),2),n=r[0],r=r[1],e=e?this.handleShape:{size:0,length:0},o=e.size,e=e.length,s=this.handleOffsetRatio,l=0,c=this.labelPosition,l=t||(["bottom","right"].includes(c)?Math.min(n-a,(n-o)/s):o<n*(1-s)?Math.max(n-a,0):Math.max((n-a-o)/s,0)),t=Math.max(e,i),n=r-t,o=j(this.ifHorizontal([n,l],[l,n]),2),s=o[0],e=o[1],i=["top","left"].includes(c)?a:0,r=j(this.ifHorizontal([t/2,i],[i,t/2]),2),l=r[0],n=r[1];return new Qx(l,n,s,e)},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"ribbonShape",{get:function(){var t=this.ribbonBBox,e=t.width,t=t.height;return this.ifHorizontal({size:t,length:e},{size:e,length:t})},enumerable:!1,configurable:!0}),y.prototype.renderRibbon=function(t){var e=this.attributes,n=e.data,r=e.type,i=e.orientation,a=e.color,e=e.block,o=w(this.attributes,"ribbon"),s=this.range,l=s.min,c=s.max,s=this.ribbonBBox,u=s.x,s=s.y,h=this.ribbonShape,f=h.length,h=h.size,d=nw({x:u,y:s,length:f,size:h,type:r,orientation:i,color:a,block:e,partition:n.map(function(t){return(t.value-l)/(c-l)}),range:this.ribbonRange},o);this.ribbon=t.maybeAppendByClassName(vk.ribbon,function(){return new Nk({style:d})}).update(d)},y.prototype.getHandleClassName=function(t){return"".concat(vk.prefix("".concat(t,"-handle")))},y.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,t=t.orientation,n=w(this.attributes,"handle"),r=j(this.selection,2),i=r[0],r=r[1],a=m(m({},n),{orientation:t}),t=n.shape,o="basic"===(void 0===t?"slider":t)?dk:_M,s=this;this.handlesGroup.selectAll(vk.handle.class).data(e?[{value:i,type:"start"},{value:r,type:"end"}]:[],function(t){return t.type}).join(function(t){return t.append(function(){return new o({style:a})}).attr("className",function(t){t=t.type;return"".concat(vk.handle," ").concat(s.getHandleClassName(t))}).each(function(t){var e=t.type,t=t.value,t=(this.update({labelText:t}),"".concat(e,"Handle"));(s[t]=this).addEventListener("pointerdown",s.onDragStart(e))})},function(t){return t.update(a).each(function(t){t=t.value;this.update({labelText:t})})},function(t){return t.each(function(t){t=t.type,t="".concat(t,"Handle");s[t]=void 0}).remove()})},y.prototype.adjustHandles=function(){var t=j(this.selection,2),e=t[0],t=t[1];this.setHandlePosition("start",e),this.setHandlePosition("end",t)},y.prototype.adjustTitle=function(){var t=this.attributes,e=t.titlePosition,t=t.orientation,n=j(this.getElementsByClassName(vk.title.name),1)[0],r=this.handlesGroup.select(".".concat(this.getHandleClassName("start"))).node();n&&r&&"top-left"===e&&"horizontal"===t&&(e=j(r.getLocalBounds().min,1)[0],t=j(n.getLocalBounds().min,1)[0],n.style.x=+(this.style.x||0)+(e-t))},Object.defineProperty(y.prototype,"handleBBox",{get:function(){if(!this.cacheHandleBBox){if(!this.attributes.showHandle)return new Qx(0,0,0,0);var t=this.startHandle.getBBox(),e=t.width,t=t.height,n=this.endHandle.getBBox(),r=n.width,n=n.height,e=j([Math.max(e,r),Math.max(t,n)],2),r=e[0],t=e[1];this.cacheHandleBBox=new Qx(0,0,r,t)}return this.cacheHandleBBox},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"handleShape",{get:function(){var t=this.handleBBox,e=t.width,t=t.height,n=j(this.ifHorizontal([t,e],[e,t]),2);return{width:e,height:t,size:n[0],length:n[1]}},enumerable:!1,configurable:!0}),y.prototype.setHandlePosition=function(t,e){var n=this.attributes.handleFormatter,r=this.ribbonBBox,i=r.x,r=r.y,a=this.ribbonShape.size,e=this.getOffset(e),i=j(this.ifHorizontal([i+e,r+a*this.handleOffsetRatio],[i+a*this.handleOffsetRatio,r+e]),2),a=i[0],r=i[1],e=this.handlesGroup.select(".".concat(this.getHandleClassName(t))).node();null!=e&&e.update({x:a,y:r,formatter:n})},y.prototype.renderIndicator=function(t){var e=w(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(vk.indicator,function(){return new kk({})}).update(e)},Object.defineProperty(y.prototype,"labelData",{get:function(){var s=this;return this.attributes.data.reduce(function(t,e,n,r){var i,a,o=null!=(o=null==e?void 0:e.id)?o:n.toString();return t.push(m(m({},e),{id:o,index:n,type:"value",label:null!=(i=null==e?void 0:e.label)?i:e.value.toString(),value:s.ribbonScale.map(e.value)})),n<r.length-1&&(i=r[n+1],a=((i=(r=j([e.value,i.value],2))[0])+(r=r[1]))/2,t.push(m(m({},e),{id:o,index:n,type:"range",range:[i,r],label:[i,r].join("~"),value:s.ribbonScale.map(a)}))),t},[])},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"labelStyle",{get:function(){var t=j(["center","middle"],2),e=t[0],t=t[1],n=this.labelPosition;return"top"===n?t="bottom":"bottom"===n?t="top":"left"===n?e="end":"right"===n&&(e="start"),{labelTextAlign:e,labelTextBaseline:t}},enumerable:!1,configurable:!0}),y.prototype.renderLabel=function(t){var e=this.attributes,n=e.showTick,n=void 0!==n&&n,r=e.labelFilter,e=e.labelFormatter,i=w(this.attributes,"tick"),a=w(this.attributes,"label"),o=a.align,n=nw(m({showLine:!1,showGrid:!1,showTick:n,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),Ww(i,"tick"),Ww(a,"label"),{data:this.labelData}),i={tickFilter:function(t,e,n){return"value"===(null==t?void 0:t.type)&&(!r||r(t,t.index,n.filter(function(t){return"value"!==t.type})))},labelFilter:function(t,e,n){return(null==t?void 0:t.type)===o&&(!r||r(t,t.index,n.filter(function(t){return t.type===o})))},labelFormatter:e},s=m(m(m({},n),i),{labelOverlap:[{type:"hide"}]});this.label=t.maybeAppendByClassName(vk.label,function(){return new UO({style:s})}).node(),this.label.update(s,!1)},Object.defineProperty(y.prototype,"labelAxisStyle",{get:function(){var t=this.attributes,e=t.showTick,n=t.labelDirection,r=t.labelSpacing,t=t.tickLength,i=this.ribbonShape.size,a=this.labelPosition,o=this.labelFixedSpacing,s=j([0,0,0],3),l=s[0],s=(s[1],s[2]),t=null!=t?t:i;return e?(s=t,"positive"===n?"right"===a?s=l=t:"bottom"===a&&(l=s):"negative"!==n||"top"!==a&&"left"!==a||(l=i)):"positive"===n&&"right"!==a&&"bottom"===a&&(l=i+o),{offset:l,spacing:r,tickLength:s}},enumerable:!1,configurable:!0}),y.prototype.adjustLabel=function(){var t,e,n,r,i,a,o;this.attributes.showLabel&&(o=(a=this.ribbonBBox).x,t=a.y,i=a.width,a=a.height,e=(r=this.labelAxisStyle).offset,n=r.spacing,r=r.tickLength,a=(i=j(this.ifHorizontal([[o,t+e],[o+i,t+e]],[[o+e,t+a],[o+e,t]]),2))[0],o=i[1],this.label.update({startPos:a,endPos:o,tickLength:r,labelSpacing:n},!1))},y.prototype.bindEvents=function(){this.ribbon.on("pointerdown",this.onDragStart("ribbon")),this.ribbon.on("pointermove",this.onHovering),this.addEventListener("pointerout",this.hideIndicator)},y.prototype.showIndicator=function(t,e){var n,r,i,a;void 0===e&&(e="".concat(t)),this.attributes.showIndicator&&"number"==typeof t?(i=(a=this.range).min,a=a.max,n=(r=this.ribbonBBox).x,r=r.y,t=We(t,i,a),i=this.getOffset(t),a=this.ifHorizontal([i+n,r],[n,i+r]),this.indicator.update({x:a[0],y:a[1],position:this.ifHorizontal("top","left"),labelText:e}),zx(this.indicator.node())):this.hideIndicator()},y.prototype.hideIndicator=function(){Wx(this.indicator.node())},y.prototype.updateMouse=function(){this.attributes.slidable&&(this.style.cursor="grabbing")},y.prototype.setSelection=function(t,e){this.updateSelection(t,e)},y.prototype.updateSelection=function(t,e,n){void 0===n&&(n=!1);var r,i,a,o,s=j(this.selection,2),l=s[0],s=s[1],t=j([t,e],2),e=t[0],t=t[1],n=(n&&(e+=l,t+=s),this.range),l=n.min,s=n.max,c=j((n=[l,s],l=[e,t],s=this.selection,r=(n=j(n,2))[0],n=n[1],i=(l=j(l,2))[0],l=l[1],a=(s=j(s,2))[0],s=s[1],l=(i=j([i,l],2))[0],o=(i=i[1])-l,i<l&&(l=(c=j([i,l],2))[0],i=c[1]),n-r<o?[r,n]:l<r?a===r&&s===i?[r,i]:[r,o+r]:n<i?s===n&&a===l?[l,n]:[n-o,n]:[l,i]),2),e=c[0],t=c[1];this.update({defaultValue:[e,t]}),this.dispatchSelection()},Object.defineProperty(y.prototype,"step",{get:function(){var t=this.attributes.step,t=void 0===t?1:t,e=this.range,n=e.min,e=e.max;return Ke(t)?Aw(.01*(e-n),0):t},enumerable:!1,configurable:!0}),y.prototype.getTickValue=function(t){var e=this.attributes,n=e.data,e=e.block,r=this.range.min;return e?Sk(n.map(function(t){return t.value}),t).tick:(e=this.step,r+Math.round((t-r)/e)*e)},y.prototype.getValueByCanvasPoint=function(t,e){var n=this.range,r=n.min,n=n.max,i=j(this.ribbon.node().getPosition(),2),a=i[0],i=i[1],a=this.ifHorizontal(a,i),i=this.ifHorizontal.apply(this,O([],j(hw(t)),!1));return We(this.getOffset(i-a,!0),r,n)},y.prototype.getOffset=function(t,e){void 0===e&&(e=!1);var n=this.range,r=n.min,n=n.max,i=this.ribbonShape.length,a=this.eventToOffsetScale;return a.update({domain:[r,n],range:[0,i]}),e?a.invert(t):a.map(t)},y.prototype.dispatchSelection=function(){var t=new gl("valuechange",{detail:{value:this.selection}});this.dispatchEvent(t)},y.prototype.dispatchIndicated=function(t,e){t=new gl("indicate",{detail:{value:t,range:e}});this.dispatchEvent(t)},y);function y(t){var a=Rk.call(this,t,mk)||this;return a.eventToOffsetScale=new wg({}),a.innerRibbonScale=new wg({}),a.cacheLabelBBox=null,a.cacheHandleBBox=null,a.onHovering=function(t){var e=a.attributes,n=e.data,e=e.block,t=(t.stopPropagation(),a.getValueByCanvasPoint(t));e?(e=Sk(n.map(function(t){return t.value}),t).range,a.showIndicator((e[0]+e[1])/2,"".concat(e[0],"-").concat(e[1])),a.dispatchIndicated(t,e)):(n=a.getTickValue(t),a.showIndicator(n),a.dispatchIndicated(n))},a.onDragStart=function(e){return function(t){t.stopPropagation(),a.attributes.slidable&&(a.target=e,a.prevValue=a.getTickValue(a.getValueByCanvasPoint(t)),document.addEventListener("mousemove",a.onDragging),document.addEventListener("touchmove",a.onDragging),document.addEventListener("mouseleave",a.onDragEnd),document.addEventListener("mouseup",a.onDragEnd),document.addEventListener("mouseup",a.onDragEnd),document.addEventListener("touchend",a.onDragEnd))}},a.onDragging=function(t){var e=a.target,n=(a.updateMouse(),j(a.selection,2)),r=n[0],n=n[1],t=a.getTickValue(a.getValueByCanvasPoint(t)),i=t-a.prevValue;"start"===e?r!==t&&a.updateSelection(t,n):"end"===e?n!==t&&a.updateSelection(r,t):"ribbon"===e&&0!=i&&(a.prevValue=t,a.updateSelection(i,i,!0))},a.onDragEnd=function(){a.style.cursor="default",document.removeEventListener("mousemove",a.onDragging),document.removeEventListener("touchmove",a.onDragging),document.removeEventListener("mouseup",a.onDragEnd),document.removeEventListener("touchend",a.onDragEnd)},a}function Wk(t){Ik||(Ik=document.createElement("table"),Dk=document.createElement("tr"),Bk=/^\s*<(\w+|!)[^>]*>/,Dk={tr:document.createElement("tbody"),tbody:Ik,thead:Ik,tfoot:Ik,td:Dk,th:Dk,"*":document.createElement("div")});var e=Bk.test(t)&&RegExp.$1,e=(e&&e in Dk||(e="*"),Dk[e]),t=(t="string"==typeof t?t.replace(/(^\s*)|(\s*$)/g,""):t,e.innerHTML=""+t,e.childNodes[0]);return t&&e.contains(t)&&e.removeChild(t),t}function Gk(t){return{CONTAINER:"".concat(t=void 0===t?"":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 Hk={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};t(Uk,Vk=mm),Object.defineProperty(Uk.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),Uk.prototype.getContainer=function(){return this.element},Object.defineProperty(Uk.prototype,"position",{set:function(t){var t=j(t,2),e=t[0],t=t[1];this.attributes.x=e,this.attributes.y=t,this.updatePosition()},enumerable:!1,configurable:!0}),Object.defineProperty(Uk.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(Uk.prototype,"HTMLTooltipItemsElements",{get:function(){var t=this.attributes,e=t.data,o=t.template;return e.map(function(t,e){var n,r=t.name,r=void 0===r?"":r,i=t.color,i=void 0===i?"black":i,a=t.index,t=at(t,["name","color","index"]),r=m({name:r,color:i,index:null!=a?a:e},t);return Wk((i=o.item,n=r,i&&n?i.replace(/\\?\{([^{}]+)\}/g,function(t,e){return"\\"===t.charAt(0)?t.slice(1):void 0===n[e]?"":n[e]}):i))})},enumerable:!1,configurable:!0}),Uk.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},Uk.prototype.destroy=function(){var t;null!=(t=this.element)&&t.remove(),Vk.prototype.destroy.call(this)},Uk.prototype.show=function(t,e){var n,r=this;void 0!==t&&void 0!==e&&(n=this.element.style.transition,this.element.style.transition="none",this.position=[null!=t?t:+this.attributes.x,null!=e?e:+this.attributes.y],setTimeout(function(){r.element.style.transition=n},10)),this.element.style.visibility="visible"},Uk.prototype.hide=function(){this.element.style.visibility="hidden"},Uk.prototype.initShape=function(){var t=this.attributes.template;this.element=Wk(t.container),this.id&&this.element.setAttribute("id",this.id)},Uk.prototype.renderCustomContent=function(){var t;(void 0===this.prevCustomContentKey||this.prevCustomContentKey!==this.attributes.contentKey)&&(this.prevCustomContentKey=this.attributes.contentKey,t=this.attributes.content)&&("string"==typeof t?this.element.innerHTML=t:this.element.replaceChildren(t))},Uk.prototype.renderHTMLTooltipElement=function(){var r,t=this.attributes,e=t.template,n=t.title,i=t.enterable,a=t.style,t=t.content,o=Gk(e.prefixCls),s=this.element;this.element.style.pointerEvents=i?"auto":"none",t?this.renderCustomContent():(n?(s.innerHTML=e.title,s.getElementsByClassName(o.TITLE)[0].innerHTML=n):null!=(t=null==(i=s.getElementsByClassName(o.TITLE))?void 0:i[0])&&t.remove(),e=this.HTMLTooltipItemsElements,(n=document.createElement("ul")).className=o.LIST,n.replaceChildren.apply(n,O([],j(e),!1)),(i=this.element.querySelector(".".concat(o.LIST)))?i.replaceWith(n):s.appendChild(n)),r=s,Object.entries(a).forEach(function(t){var t=j(t,2),e=t[0],n=t[1];O([r],j(r.querySelectorAll(e)),!1).filter(function(t){return t.matches(e)}).forEach(function(t){t&&(t.style.cssText+=Object.entries(n).reduce(function(t,e){return"".concat(t).concat(e.join(":"),";")},""))})})},Uk.prototype.getRelativeOffsetFromCursor=function(t){var e=this.attributes,n=e.position,i=e.offset,e=(t||n).split("-"),a={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},t=this.elementSize,o=t.width,s=t.height,l=[-o/2,-s/2];return e.forEach(function(t){var e=j(l,2),n=e[0],e=e[1],t=j(a[t],2),r=t[0],t=t[1];l=[n+(o/2+i[0])*r,e+(s/2+i[1])*t]}),l},Uk.prototype.setOffsetPosition=function(t){var t=j(t,2),e=t[0],t=t[1],n=this.attributes,r=n.x,i=n.y,i=void 0===i?0:i,n=n.container,a=n.x,n=n.y;this.element.style.left="".concat(+(void 0===r?0:r)+a+e,"px"),this.element.style.top="".concat(+i+n+t,"px")},Uk.prototype.updatePosition=function(){this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor()))},Uk.prototype.autoPosition=function(t){var e,n,r,i,a,o,s,t=j(t,2),l=t[0],t=t[1],c=this.attributes,u=c.x,h=c.y,f=c.bounding,c=c.position;return f?(e=(n=this.element).offsetWidth,n=n.offsetHeight,h=(u=j([+u+l,+h+t],2))[0],u=u[1],r={left:"right",right:"left",top:"bottom",bottom:"top"},s=f.x,i=f.y,a={left:h<s,right:s+f.width<h+e,top:u<i,bottom:i+f.height<u+n},o=[],c.split("-").forEach(function(t){o.push(a[t]?r[t]:t)}),s=o.join("-"),this.getRelativeOffsetFromCursor(s)):[l,t]},Uk.tag="tooltip",N([(void 0===(Yk=100)&&(Yk=0),void 0===(qk=!0)&&(qk=!1),function(t,e,n){var r,i=n.value;"function"==typeof i&&(n.value=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r||(t=this,qk&&i.apply(t,e),r=window.setTimeout(function(){i.apply(t,e),r=null},Yk))})})],Uk.prototype,"updatePosition",null);var Vk,Yk,qk,$k=Uk;function Uk(t){var e=this,n=null==(n=null==(n=t.style)?void 0:n.template)?void 0:n.prefixCls,r=Gk(n);return(e=Vk.call(this,t,{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(r.CONTAINER,'"></div>'),title:'<div class="'.concat(r.TITLE,'"></div>'),item:'<li class="'.concat(r.LIST_ITEM,'" data-index={index}>\n <span class="').concat(r.NAME,'">\n <span class="').concat(r.MARKER,'" style="background:{color}"></span>\n <span class="').concat(r.NAME_LABEL,'" title="{name}">{name}</span>\n </span>\n <span class="').concat(r.VALUE,'" title="{value}">{value}</span>\n </li>')},style:(t=Gk(t=void 0===(t=n)?"":t),(r={})[".".concat(t.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"},r[".".concat(t.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},r[".".concat(t.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},r[".".concat(t.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},r[".".concat(t.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},r[".".concat(t.NAME)]={display:"flex","align-items":"center","max-width":"216px"},r[".".concat(t.NAME_LABEL)]=m({flex:1},Hk),r[".".concat(t.VALUE)]=m({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},Hk),r[".".concat(t.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},r[".".concat(t.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},r)})||this).prevCustomContentKey=e.attributes.contentKey,e.initShape(),e.render(e.attributes,e),e}t(Kk,Xk=fc),Object.defineProperty(Kk.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=Bw(t)},enumerable:!1,configurable:!0}),Object.defineProperty(Kk.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=Bw(t)},enumerable:!1,configurable:!0}),Kk.prototype.getBBox=function(){var t=this.attributes,e=t.x,e=void 0===e?0:e,n=t.y,n=void 0===n?0:n,r=t.width,t=t.height,i=j(this.$margin,4),a=i[0],o=i[1],s=i[2],i=i[3];return new Qx(e-i,n-a,r+i+o,t+a+s)},Kk.prototype.appendChild=function(t,e){return t.isMutationObserved=!0,Xk.prototype.appendChild.call(this,t,e),t},Kk.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,t=t.height,n=j(this.$padding,4),r=n[0],i=n[1],a=n[2],n=n[3],o=j(this.$margin,4),s=o[0],o=o[3];return new Qx(n+o,r+s,e-n-i,t-r-a)},Kk.prototype.layout=function(){var t,e,n,r;if(this.attributes.display&&this.isConnected&&!this.children.some(function(t){return!t.isConnected}))try{t=this.getAvailableSpace(),e=this.children.map(function(t){return t.getBBox()}),n=this.attributes;var i=0!==e.length&&(null==(r=n.display in(r={flex:vw,grid:bw})?r[n.display]:null)?void 0:r.call(null,t,e,n))||[];this.children.forEach(function(t,e){var e=i[e],n=e.x,e=e.y;t.attr({x:n,y:e})})}catch(t){}},Kk.prototype.bindEvents=function(){var e=this;this.layoutEvents.forEach(function(t){e.addEventListener(t,function(t){t.target.isMutationObserved=!0,e.layout()})})},Kk.prototype.attributeChangedCallback=function(t,e,n){"margin"===t?this.margin=n:"padding"===t&&(this.padding=n),this.layout()};var Xk,Vy=Kk;function Kk(t){var e=Xk.call(this,t)||this,t=(e.layoutEvents=[b.BOUNDS_CHANGED,b.INSERTED,b.REMOVED],e.$margin=Bw(0),e.$padding=Bw(0),t.style||{}),n=t.margin,t=t.padding,t=void 0===t?0:t;return e.margin=void 0===n?0:n,e.padding=t,e.isMutationObserved=!0,e.bindEvents(),e}function Zk(r,t,e,n){var[[t,i],[a,o]]=t,[s,l]=function(t){var{min:[t,e],max:[n,r]}=t.getLocalBounds();let i=0,a=0;return 0<t&&(i=t),n<0&&(i=n),0<e&&(a=e),r<0&&(a=r),[i,a]}(r);if(t===a&&i===o)return nx()([[0,0],[s,l]]);s=[[t-a,i-o]].concat(e.length?e:[[0,0]]);const c=[n[0]-a,n[1]-o],[u,h]=s;return l=c,t=u,i=h,e=s2(l,t),t=s2(t,i),i=s2(i,l),0<(Math.pow(e,2)+Math.pow(t,2)-Math.pow(i,2))/(2*e*t)&&(a=(()=>{var{min:t,max:e}=r.getLocalBounds(),n=u[0]+(u[1]-c[1])*+u[1]/(u[0]-c[0]);return e[0]<c[0]?Math.min(e[0],n):Math.max(t[0],n)})(),s.splice(1,1,[a,0])),nx()(s)}const Qk=Rx(e=>{var n=e.attributes,{className:r,labelTransform:i,labelTransformOrigin:a,x:o,y:s,x0:l=o,y0:c=s,text:u,background:h,connector:f,startMarker:d,endMarker:p,coordCenter:g,innerHTML:y}=n,n=at(n,["className","class","transform","rotate","labelTransform","labelTransformOrigin","x","y","x0","y0","text","background","connector","startMarker","endMarker","coordCenter","innerHTML"]);if([o,s,l,c].some(t=>!Ge(t)))e.children.forEach(t=>t.remove());else{var m=st(n,"background"),v=m["padding"],m=at(m,["padding"]),b=st(n,"connector"),{points:x=[]}=b,b=at(b,["points"]),l=[[+l,+c],[+o,+s]];let t;t=(y?lt(e).maybeAppend("html","html",r).style("zIndex",0).style("innerHTML",y).call(L,Object.assign({transform:i,transformOrigin:a},n)):lt(e).maybeAppend("text","text").style("zIndex",0).style("text",u).call(L,Object.assign({textBaseline:"middle",transform:i,transformOrigin:a},n))).node();c=Zk(lt(e).maybeAppend("background","rect").style("zIndex",-1).call(L,function(t,e=[]){var[e=0,n=0,r=e,i=n]=e,a=t.parentNode,o=a.getEulerAngles(),{min:t,halfExtents:s}=(a.setEulerAngles(0),t.getLocalBounds()),[t,l]=t,[s,c]=s;return a.setEulerAngles(o),{x:t-i,y:l-e,width:2*s+i+n,height:2*c+e+r}}(t,v)).call(L,h?m:{}).node(),l,x,g),o=d&&new Zw({id:"startMarker",style:Object.assign({x:0,y:0},st(n,"startMarker"))}),s=p&&new Zw({id:"endMarker",style:Object.assign({x:0,y:0},st(n,"endMarker"))});lt(e).maybeAppend("connector","path").style("zIndex",0).style("path",c).style("markerStart",o).style("markerEnd",s).call(L,f?b:{})}});Ws=(s,t)=>{const l=t["coordinate"];return(t,e,n)=>{var{color:e,text:r="",fontSize:i,rotate:a=0,transform:o=""}=e,r={text:String(r),stroke:e,fill:e,fontSize:i},[[e,i]]=t;return lt(new Qk).style("x",e).style("y",i).call(L,n).style("transform",o+`rotate(${+a})`).style("coordCenter",l.getCenter()).call(L,r).call(L,s).node()}};Ws.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Jk=Rx(t=>{var e=at(t.attributes,["class","x","y"]);const n=st(e,"marker"),{size:s=24}=n,r=()=>{var t=s/2,e=t/Math.sqrt(2),n=t*Math.sqrt(2),[r,i]=[-e,e-n],[a,o]=[0,0],[e,n]=[e,e-n];return[["M",r,i],["A",t,t,0,1,1,e,n],["L",a,o],["Z"]]};var[i,a]=function(t){var{min:t,max:e}=t.getLocalBounds();return[.5*(t[0]+e[0]),.5*(t[1]+e[1])]}(lt(t).maybeAppend("marker",()=>new Zw({})).call(t=>t.node().update(Object.assign({symbol:r},n))).node());lt(t).maybeAppend("text","text").style("x",i).style("y",a).call(L,e)});Wy=(t,e)=>{const i=at(t,[]);return(t,e,n)=>{var r=n["color"],n=at(n,["color"]),{color:e=r,text:r=""}=e,r={text:String(r),stroke:e,fill:e},[[e,t]]=t;return lt(new Jk).call(L,n).style("x",e).style("y",t).call(L,r).call(L,i).node()}};Wy.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const tE=Rx(t=>{var{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes;const a=t.ownerDocument;lt(t).maybeAppend("connect-path",()=>a.createElement("path",{})).style("d",n).call(L,i),lt(t).maybeAppend("area-path",()=>a.createElement("path",{})).style("d",e).call(L,r)}),eE=(t,e)=>{const{curve:c,gradient:l=!1,defined:u=t=>!Number.isNaN(t)&&null!=t,connect:h=!1}=t,f=at(t,["curve","gradient","defined","connect"]),{coordinate:d,document:p}=e;return(t,e,n)=>{var r=n["color"],{color:r=r,seriesColor:i,seriesX:a,seriesY:o}=e,e=Tx(d,e),i=l&&i?Ex(i,a,o,l):r;const s=Object.assign(Object.assign(Object.assign(Object.assign({},n),{stroke:i,fill:i}),e&&{transform:e}),f);var[a,o]=function(e,n){var r=[],i=[],a=[];let o=!1,s=null;var l=e.length/2;for(let t=0;t<l;t++){var c,u,h=e[t],f=e[t+l];[...h,...f].some(t=>!n(t))?o=!0:(r.push(h),i.push(f),o&&s&&(o=!1,[c,u]=s,a.push([c,h,u,f])),s=[h,f])}return[r.concat(i),a]}(t,u),r=st(s,"connect"),n=!!o.length,i=t=>lt(p.createElement("path",{})).style("d",t||"").call(L,s).node();return iv(d)?(e=t=>{const n=d.getCenter(),r=t.slice(0,t.length/2),i=t.slice(t.length/2);return t=rx().curve(ix),e=t.curve,a=t.lineX0,o=t.lineX1,s=t.lineY0,l=t.lineY1,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 sx(a())},delete t.lineX0,t.lineEndAngle=function(){return sx(o())},delete t.lineX1,t.lineInnerRadius=function(){return sx(s())},delete t.lineY0,t.lineOuterRadius=function(){return sx(l())},delete t.lineY1,t.curve=function(t){return arguments.length?e(ox(t)):e()._curve},t.angle((t,e)=>c2(a2(r[e],n))).outerRadius((t,e)=>s2(r[e],n)).innerRadius((t,e)=>s2(i[e],n)).defined((t,e)=>[...r[e],...i[e]].every(u)).curve(c)(i);var e,a,o,s,l},!n||h&&!Object.keys(r).length?i(e(a)):n&&!h?i(e(t)):lt(new tE).style("areaStyle",s).style("connectStyle",Object.assign(Object.assign({},r),f)).style("areaPath",e(t)).style("connectPath",o.map(e).join("")).node()):(e=t=>{const n=t.slice(0,t.length/2),r=t.slice(t.length/2);return(rv(d)?rx().y((t,e)=>n[e][1]).x1((t,e)=>n[e][0]).x0((t,e)=>r[e][0]).defined((t,e)=>[...n[e],...r[e]].every(u)):rx().x((t,e)=>n[e][0]).y1((t,e)=>n[e][1]).y0((t,e)=>r[e][1]).defined((t,e)=>[...n[e],...r[e]].every(u))).curve(c)(n)},!n||h&&!Object.keys(r).length?i(e(a)):n&&!h?i(e(t)):lt(new tE).style("areaStyle",s).style("connectStyle",Object.assign(Object.assign({},r),f)).style("areaPath",e(t)).style("connectPath",o.map(e).join("")).node())}};eE.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};rl=(n,r)=>{const i=r["coordinate"];return(...t)=>{var e=iv(i)?vx:J2;return eE(Object.assign({curve:e},n),r)(...t)}},rl.props=Object.assign(Object.assign({},eE.props),{defaultMarker:"square"}),uu=(t,n)=>{const{alpha:r=.5}=t,i=at(t,["alpha"]),a=n["coordinate"];return(...t)=>{var e=iv(a)?yx:px;return eE(Object.assign({curve:e.alpha(r)},i),n)(...t)}},uu.props=Object.assign(Object.assign({},eE.props),{defaultMarker:"smooth"}),Ss=(e,n)=>(...t)=>eE(Object.assign({curve:xx},e),n)(...t),Ss.props=Object.assign(Object.assign({},eE.props),{defaultMarker:"hvh"}),n=(e,n)=>(...t)=>eE(Object.assign({curve:wx},e),n)(...t),n.props=Object.assign(Object.assign({},eE.props),{defaultMarker:"vh"}),es=(e,n)=>(...t)=>eE(Object.assign({curve:Mx},e),n)(...t),es.props=Object.assign(Object.assign({},eE.props),{defaultMarker:"hv"}),rs=(e,n)=>{const{arrow:r=!1}=e;return(...t)=>Fx(Object.assign(Object.assign({},e),{arrow:r}),n)(...t)},rs.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},zs=(t,e)=>{const o=at(t,[]),s=e["document"];return(t,e,n)=>{var r=n["color"],n=at(n,["color"]),{color:e=r,transform:r}=e,[t,i]=t,a=G2();return a.moveTo(t[0],t[1]),a.bezierCurveTo(t[0]/2+i[0]/2,t[1],t[0]/2+i[0]/2,i[1],i[0],i[1]),lt(s.createElement("path",{})).call(L,n).style("d",a.toString()).style("stroke",e).style("transform",r).call(L,o).node()}};zs.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};Ol=(t,e)=>{const{cornerRatio:u=1/3}=t,h=at(t,["cornerRatio"]),{coordinate:f,document:d}=e;return(t,e,n)=>{var r,i,a,o,s=n["defaultColor"],n=at(n,["defaultColor"]),{color:e=s,transform:s}=e,[t,l]=t,c=(t=t,l=l,r=f,i=u,o=G2(),iv(r)?(a=s2(t,c=r.getCenter()),a=(s2(l,c)-a)*i+a,o.moveTo(t[0],t[1]),kx(o,t,l,c,a)):rv(r)?(o.moveTo(t[0],t[1]),o.lineTo(t[0]+(l[0]-t[0])*i,t[1]),o.lineTo(t[0]+(l[0]-t[0])*i,l[1])):(o.moveTo(t[0],t[1]),o.lineTo(t[0],t[1]+(l[1]-t[1])*i),o.lineTo(l[0],t[1]+(l[1]-t[1])*i)),o.lineTo(l[0],l[1]),o);return lt(d.createElement("path",{})).call(L,n).style("d",c.toString()).style("stroke",e).style("transform",s).call(L,h).node()}},Ol.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},qy=(t,e)=>{const s=at(t,[]),{coordinate:l,document:c}=e;return(t,e,n)=>{var r,i=n["color"],n=at(n,["color"]),{color:e=i,transform:i}=e,[t,a]=t,o=G2();return o.moveTo(t[0],t[1]),iv(l)?(r=l.getCenter(),o.quadraticCurveTo(r[0],r[1],a[0],a[1])):kx(o,t,a,f2(t,a),s2(t,a)/2),lt(c.createElement("path",{})).call(L,n).style("d",o.toString()).style("stroke",e).style("transform",i).call(L,s).node()}};function nE(t,e){return t.parent===e.parent?1:2}function rE(t,e){return t+e.x}function iE(t,e){return Math.max(t,e.y)}function aE(){var s=nE,l=1,c=1,u=!1;function e(e){var r,i=0,t=(e.eachAfter(function(t){var e,n=t.children;n?(t.x=(e=n).reduce(rE,0)/e.length,t.y=1+n.reduce(iE,0)):(t.x=r?i+=s(t,r):0,t.y=0,r=t)}),function(t){for(var e;e=t.children;)t=e[0];return t}(e)),n=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(e),a=t.x-s(t,n)/2,o=n.x+s(n,t)/2;return e.eachAfter(u?function(t){t.x=(t.x-e.x)*l,t.y=(e.y-t.y)*c}:function(t){t.x=(t.x-a)/(o-a)*l,t.y=(1-(e.y?t.y/e.y:1))*c})}return e.separation=function(t){return arguments.length?(s=t,e):s},e.size=function(t){return arguments.length?(u=!1,l=+t[0],c=+t[1],e):u?null:[l,c]},e.nodeSize=function(t){return arguments.length?(u=!0,l=+t[0],c=+t[1],e):u?[l,c]:null},e}function oE(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;0<=--r;)e+=n[r].value;else e=1;t.value=e}function sE(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=cE)):void 0===e&&(e=lE);for(var n,r,i,a,o,t=new fE(t),s=[t];n=s.pop();)if((i=e(n.data))&&(o=(i=Array.from(i)).length))for(n.children=i,a=o-1;0<=a;--a)s.push(r=i[a]=new fE(i[a])),r.parent=n,r.depth=n.depth+1;return t.eachBefore(hE)}function lE(t){return t.children}function cE(t){return Array.isArray(t)?t[1]:null}function uE(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function hE(t){for(var e=0;t.height=e,(t=t.parent)&&t.height<++e;);}function fE(t){this.data=t,this.depth=this.height=0,this.parent=null}function dE(t){return null==t?null:pE(t)}function pE(t){if("function"!=typeof t)throw new Error;return t}function gE(){return 0}function yE(t){return function(){return t}}qy.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},fE.prototype=sE.prototype={constructor:fE,count:function(){return this.eachAfter(oE)},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,a=this,o=[a],s=[],l=-1;a=o.pop();)if(s.push(a),n=a.children)for(r=0,i=n.length;r<i;++r)o.push(n[r]);for(;a=s.pop();)t.call(e,a,++l,this);return this},eachBefore:function(t,e){for(var n,r,i,a=[this],o=-1;n=a.pop();)if(t.call(e,n,++o,this),r=n.children)for(i=r.length-1;0<=i;--i)a.push(r[i]);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(i){return this.eachAfter(function(t){for(var e=+i(t.data)||0,n=t.children,r=n&&n.length;0<=--r;)e+=n[r].value;t.value=e})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},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 e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e},links:function(){var e=this,n=[];return e.each(function(t){t!==e&&n.push({source:t.parent,target:t})}),n},copy:function(){return sE(this).eachBefore(uE)},[Symbol.iterator]:function*(){var t,e,n,r,i,a=[this];do{for(e=a.reverse(),a=[];t=e.pop();)if(yield t,n=t.children)for(r=0,i=n.length;r<i;++r)a.push(n[r])}while(a.length)}};const mE=4294967296;function vE(t,e){for(var n,r,i=0,a=(t=function(t,e){let n=t.length,r,i;for(;n;)i=e()*n--|0,r=t[n],t[n]=t[i],t[i]=r;return t}(Array.from(t),e)).length,o=[];i<a;)n=t[i],r&&xE(r,n)?++i:(r=function(t){switch(t.length){case 1:return function(t){return{x:t.x,y:t.y,r:t.r}}(t[0]);case 2:return ME(t[0],t[1]);case 3:return OE(t[0],t[1],t[2])}}(o=function(t,e){var n,r;if(wE(e,t))return[e];for(n=0;n<t.length;++n)if(bE(e,t[n])&&wE(ME(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(r=n+1;r<t.length;++r)if(bE(ME(t[n],t[r]),e)&&bE(ME(t[n],e),t[r])&&bE(ME(t[r],e),t[n])&&wE(OE(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}(o,n)),i=0);return r}function bE(t,e){var n=t.r-e.r,r=e.x-t.x,e=e.y-t.y;return n<0||n*n<r*r+e*e}function xE(t,e){var n=t.r-e.r+1e-9*Math.max(t.r,e.r,1),r=e.x-t.x,e=e.y-t.y;return 0<n&&r*r+e*e<n*n}function wE(t,e){for(var n=0;n<e.length;++n)if(!xE(t,e[n]))return;return 1}function ME(t,e){var n=t.x,r=t.y,t=t.r,i=e.x,a=e.y,e=e.r,o=i-n,s=a-r,l=e-t,c=Math.sqrt(o*o+s*s);return{x:(n+i+o/c*l)/2,y:(r+a+s/c*l)/2,r:(c+t+e)/2}}function OE(t,e,n){var r=t.x,i=t.y,t=t.r,a=e.x,o=e.y,e=e.r,s=n.x,l=n.y,n=n.r,c=r-a,u=r-s,h=i-o,f=i-l,d=e-t,p=n-t,g=r*r+i*i-t*t,a=g-a*a-o*o+e*e,o=g-s*s-l*l+n*n,e=u*h-c*f,g=(h*o-f*a)/(2*e)-r,s=(f*d-h*p)/e,l=(u*a-c*o)/(2*e)-i,n=(c*p-u*d)/e,f=s*s+n*n-1,h=2*(t+g*s+l*n),a=g*g+l*l-t*t,o=-(1e-6<Math.abs(f)?(h+Math.sqrt(h*h-4*f*a))/(2*f):a/h);return{x:r+g+s*o,y:i+l+n*o,r:o}}function kE(t,e,n){var r,i,a,o,s=t.x-e.x,l=t.y-e.y,c=s*s+l*l;c?(i=e.r+n.r,o=t.r+n.r,(o*=o)<(i*=i)?(r=(c+o-i)/(2*c),a=Math.sqrt(Math.max(0,o/c-r*r)),n.x=t.x-r*s-a*l,n.y=t.y-r*l+a*s):(r=(c+i-o)/(2*c),a=Math.sqrt(Math.max(0,i/c-r*r)),n.x=e.x+r*s-a*l,n.y=e.y+r*l+a*s)):(n.x=e.x+n.r,n.y=e.y)}function EE(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,e=e.y-t.y;return 0<n&&r*r+e*e<n*n}function SE(t){var e=t._,t=t.next._,n=e.r+t.r,r=(e.x*t.r+t.x*e.r)/n,t=(e.y*t.r+t.y*e.r)/n;return r*r+t*t}function AE(t){this._=t,this.next=null,this.previous=null}function _E(t,e){if(!(a=(t="object"==typeof(n=t)&&"length"in n?n:Array.from(n)).length))return 0;var n,r,i,a,o,s,l,c,u,h,f,d=t[0];if(d.x=0,d.y=0,!(1<a))return d.r;if(r=t[1],d.x=-r.r,r.x=d.r,r.y=0,!(2<a))return d.r+r.r;kE(r,d,i=t[2]),d=new AE(d),r=new AE(r),i=new AE(i),((d.next=i.previous=r).next=d.previous=i).next=r.previous=d;t:for(l=3;l<a;++l){kE(d._,r._,i=t[l]),i=new AE(i),c=r.next,u=d.previous,h=r._.r,f=d._.r;do{if(h<=f){if(EE(c._,i._)){r=c,(d.next=r).previous=d,--l;continue t}h+=c._.r,c=c.next}else{if(EE(u._,i._)){((d=u).next=r).previous=d,--l;continue t}f+=u._.r,u=u.previous}}while(c!==u.next);for(i.previous=d,i.next=r,d.next=r.previous=r=i,o=SE(d);(i=i.next)!==r;)(s=SE(i))<o&&(d=i,o=s);r=d.next}for(d=[r._],i=r;(i=i.next)!==r;)d.push(i._);for(i=vE(d,e),l=0;l<a;++l)(d=t[l]).x-=i.x,d.y-=i.y;return i.r}function TE(t){return Math.sqrt(t.value)}function PE(){var n=null,r=1,i=1,a=gE;function e(t){var e=function(){let t=1;return()=>(t=(1664525*t+1013904223)%mE)/mE}();return t.x=r/2,t.y=i/2,n?t.eachBefore(CE(n)).eachAfter(LE(a,.5,e)).eachBefore(NE(1)):t.eachBefore(CE(TE)).eachAfter(LE(gE,1,e)).eachAfter(LE(a,t.r/Math.min(r,i),e)).eachBefore(NE(Math.min(r,i)/(2*t.r))),t}return e.radius=function(t){return arguments.length?(n=dE(t),e):n},e.size=function(t){return arguments.length?(r=+t[0],i=+t[1],e):[r,i]},e.padding=function(t){return arguments.length?(a="function"==typeof t?t:yE(+t),e):a},e}function CE(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function LE(o,s,l){return function(t){if(e=t.children){var e,n,r,i=e.length,a=o(t)*s||0;if(a)for(n=0;n<i;++n)e[n].r+=a;if(r=_E(e,l),a)for(n=0;n<i;++n)e[n].r-=a;t.r=r+a}}}function NE(n){return function(t){var e=t.parent;t.r*=n,e&&(t.x=e.x+n*t.x,t.y=e.y+n*t.y)}}function jE(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 RE(t,e,n,r,i){for(var a,o=t.children,s=-1,l=o.length,c=t.value&&(r-e)/t.value;++s<l;)(a=o[s]).y0=n,a.y1=i,a.x0=e,a.x1=e+=a.value*c}var IE={depth:-1},BE={},DE={};function FE(t){return t.id}function zE(t){return t.parentId}function WE(){var y,m=FE,v=zE;function e(n){var e,t,r,i,a,o,s,l,c=Array.from(n),u=m,h=v,f=new Map;if(null!=y){const p=c.map((t,e)=>{t=y(t,e,n),e=(t=""+t).length;return"/"===(t=HE(t,e-1)&&!HE(t,e-2)?t.slice(0,-1):t)[0]?t:"/"+t}),g=p.map(GE);var d=new Set(p).add("");for(const r of g)d.has(r)||(d.add(r),p.push(r),g.push(GE(r)),c.push(DE));u=(t,e)=>p[e],h=(t,e)=>g[e]}for(r=0,e=c.length;r<e;++r)t=c[r],o=c[r]=new fE(t),null!=(s=u(t,r,n))&&(s+="")&&(l=o.id=s,f.set(l,f.has(l)?BE:o)),null!=(s=h(t,r,n))&&(s+="")&&(o.parent=s);for(r=0;r<e;++r)if(s=(o=c[r]).parent){if(!(a=f.get(s)))throw new Error("missing: "+s);if(a===BE)throw new Error("ambiguous: "+s);a.children?a.children.push(o):a.children=[o],o.parent=a}else{if(i)throw new Error("multiple roots");i=o}if(!i)throw new Error("no root");if(null!=y){for(;i.data===DE&&1===i.children.length;)i=i.children[0],--e;for(let t=c.length-1;0<=t&&(o=c[t]).data===DE;--t)o.data=null}if(i.parent=IE,i.eachBefore(function(t){t.depth=t.parent.depth+1,--e}).eachBefore(hE),i.parent=null,0<e)throw new Error("cycle");return i}return e.id=function(t){return arguments.length?(m=dE(t),e):m},e.parentId=function(t){return arguments.length?(v=dE(t),e):v},e.path=function(t){return arguments.length?(y=dE(t),e):y},e}function GE(t){let e=t.length;if(e<2)return"";for(;1<--e&&!HE(t,e););return t.slice(0,e)}function HE(e,n){if("/"===e[n]){let t=0;for(;0<n&&"\\"===e[--n];)++t;if(0==(1&t))return 1}}function VE(t,e){return t.parent===e.parent?1:2}function YE(t){var e=t.children;return e?e[0]:t.t}function qE(t){var e=t.children;return e?e[e.length-1]:t.t}function $E(t,e){this._=t,this.parent=null,this.children=null,this.A=null,(this.a=this).z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function UE(){var f=VE,l=1,c=1,u=null;function e(t){var e,n,r,i,a,o,s=function(t){for(var e,n,r,i,a,o=[t=new $E(t,0)];e=o.pop();)if(r=e._.children)for(e.children=new Array(a=r.length),i=a-1;0<=i;--i)o.push(n=e.children[i]=new $E(r[i],i)),n.parent=e;return(t.parent=new $E(null,0)).children=[t],t}(t);return s.eachAfter(h),s.parent.m=-s.z,s.eachBefore(d),u?t.eachBefore(p):((r=n=e=t).eachBefore(function(t){t.x<e.x&&(e=t),t.x>n.x&&(n=t),t.depth>r.depth&&(r=t)}),s=e===n?1:f(e,n)/2,i=s-e.x,a=l/(n.x+s+i),o=c/(r.depth||1),t.eachBefore(function(t){t.x=(t.x+i)*a,t.y=t.depth*o})),t}function h(t){var e=t.children,n=t.parent.children,r=t.i?n[t.i-1]:null;if(e){for(var i,a=0,o=0,s=t.children,l=s.length;0<=--l;)(i=s[l]).z+=a,i.m+=a,a+=i.s+(o+=i.c);e=(e[0].z+e[e.length-1].z)/2;r?(t.z=r.z+f(t._,r._),t.m=t.z-e):t.z=e}else r&&(t.z=r.z+f(t._,r._));t.parent.A=function(t,e,n){if(e){for(var r,i=t,a=t,o=e,s=i.parent.children[0],l=i.m,c=a.m,u=o.m,h=s.m;o=qE(o),i=YE(i),o&&i;)s=YE(s),(a=qE(a)).a=t,0<(r=o.z+u-i.z-l+f(o._,i._))&&(function(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}(function(t,e,n){return t.a.parent===e.parent?t.a:n}(o,t,n),t,r),l+=r,c+=r),u+=o.m,l+=i.m,h+=s.m,c+=a.m;o&&!qE(a)&&(a.t=o,a.m+=u-c),i&&!YE(s)&&(s.t=i,s.m+=l-h,n=t)}return n}(t,r,t.parent.A||n[0])}function d(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function p(t){t.x*=l,t.y=t.depth*c}return e.separation=function(t){return arguments.length?(f=t,e):f},e.size=function(t){return arguments.length?(u=!1,l=+t[0],c=+t[1],e):u?null:[l,c]},e.nodeSize=function(t){return arguments.length?(u=!0,l=+t[0],c=+t[1],e):u?[l,c]:null},e}function XE(t,e,n,r,i){for(var a,o=t.children,s=-1,l=o.length,c=t.value&&(i-n)/t.value;++s<l;)(a=o[s]).x0=e,a.x1=r,a.y0=n,a.y1=n+=a.value*c}$E.prototype=Object.create(fE.prototype);Uy=(1+Math.sqrt(5))/2;function KE(t,e,n,r,i,a){for(var o,s,l,c,u,h,f,d,p,g,y,m=[],v=e.children,b=0,x=0,w=v.length,M=e.value;b<w;){for(l=i-n,c=a-r;!(u=v[x++].value)&&x<w;);for(y=(h=f=u)*u*(g=Math.max(c/l,l/c)/(M*t)),p=Math.max(f/y,y/h);x<w;++x){if(u+=s=v[x].value,s<h&&(h=s),f<s&&(f=s),y=u*u*g,p<(d=Math.max(f/y,y/h))){u-=s;break}p=d}m.push(o={value:u,dice:l<c,children:v.slice(b,x)}),o.dice?RE(o,n,r,i,M?r+=c*u/M:a):XE(o,n,r,M?n+=l*u/M:i,a),M-=u,b=x}return m}var ZE=function e(a){function t(t,e,n,r,i){KE(a,t,e,n,r,i)}return t.ratio=function(t){return e(1<(t=+t)?t:1)},t}(Uy);function QE(t,e,n,r,i){var a,o,g=t.children,s=g.length,y=new Array(s+1);for(y[0]=o=a=0;a<s;++a)y[a+1]=o+=g[a].value;!function t(e,n,r,i,a,o,s){if(n-1<=e)return(l=g[e]).x0=i,l.y0=a,l.x1=o,void(l.y1=s);var l=y[e],c=r/2+l,u=e+1,h=n-1;for(;u<h;){var f=u+h>>>1;y[f]<c?u=1+f:h=f}c-y[u-1]<y[u]-c&&e+1<u&&--u;var l=y[u]-l,d=r-l;{var p;s-a<o-i?(t(e,u,l,i,a,p=r?(i*d+o*l)/r:o,s),t(u,n,d,p,a,o,s)):(t(e,u,l,i,a,o,p=r?(a*d+s*l)/r:s),t(u,n,d,i,p,o,s))}}(0,s,t.value,e,n,r,i)}function JE(t,e,n,r,i){(1&t.depth?XE:RE)(t,e,n,r,i)}var t5=function e(d){function t(t,e,n,r,i){if((a=t._squarify)&&a.ratio===d)for(var a,o,s,l,c,u=-1,h=a.length,f=t.value;++u<h;){for(s=(o=a[u]).children,l=o.value=0,c=s.length;l<c;++l)o.value+=s[l].value;o.dice?RE(o,e,n,r,f?n+=(i-n)*o.value/f:i):XE(o,e,n,f?e+=(r-e)*o.value/f:r,i),f-=o.value}else t._squarify=a=KE(d,t,e,n,r,i),a.ratio=d}return t.ratio=function(t){return e(1<(t=+t)?t:1)},t}(Uy);function e5(t={}){t=t.shapes;return[{name:"color"},{name:"opacity"},{name:"shape",range:t},{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 n5(t={}){return[...e5(t),{name:"title",scale:"identity"}]}function r5(){return[{type:xb,channel:"color"},{type:Mb,channel:["x","y"]}]}function i5(){return[{type:xb,channel:"x"},{type:Mb,channel:["y"]}]}function a5(t={}){return e5(t)}function o5(){return[{type:wb}]}function s5(t,e){return t.getBandWidth(t.invert(e))}function l5(t,e,n={}){const{x:a,y:o,series:s}=e,{x:l,y:c,series:u}=t,{style:{bandOffset:r=u?0:.5,bandOffsetX:h=r,bandOffsetY:f=r}={}}=n,d=!(null===l||void 0===l||!l.getBandWidth),p=!(null===c||void 0===c||!c.getBandWidth),g=!(null===u||void 0===u||!u.getBandWidth);return d||p?(t,e)=>{const n=d?s5(l,a[e]):0;var r=p?s5(c,o[e]):0,e=g&&s?(s5(u,s[e])/2+ +s[e])*n:0,[t,i]=t;return[t+h*n+e,i+f*r]}:t=>t}function c5(t){return parseFloat(t)/100}function u5(t,e,n,r){const{x:i,y:a}=n,{innerWidth:o,innerHeight:s}=r.getOptions();return[t,Array.from(t,t=>{var e=i[t],t=a[t];return[["string"==typeof e?c5(e)*o:+e,"string"==typeof t?c5(t)*s:+t]]})]}function h5(e){return"function"==typeof e?e:t=>t[e]}function f5(t,e){return Array.from(t,h5(e))}function d5(t,e){var{source:e=t=>t.source,target:n=t=>t.target,value:r=t=>t.value}=e,{links:t,nodes:i}=t;const a=f5(t,e),o=f5(t,n),s=f5(t,r);return{links:t.map((t,e)=>({target:o[e],source:a[e],value:s[e]})),nodes:i||Array.from(new Set([...a,...o]),t=>({key:t}))}}Gy=(u,t)=>{const{coordinate:h,document:f}=t;return(t,e,n)=>{var r=n["color"],n=at(n,["color"]),{color:e=r,src:r="",size:i=32,transform:a=""}=e,{width:o=i,height:i=i}=u,[[t,s]]=t,[l,c]=h.getSize(),o="string"==typeof o?c5(o)*l:o,i="string"==typeof i?c5(i)*c:i,l=t-Number(o)/2,c=s-Number(i)/2;return lt(f.createElement("image",{})).call(L,n).style("x",l).style("y",c).style("img",r).style("stroke",e).style("transform",a).call(L,u).style("width",o).style("height",i).node()}};Gy.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};Dy=(i,t)=>{const{coordinate:a,document:o}=t;return(t,e,n)=>{var r=n["color"],n=at(n,["color"]),{color:e=r,transform:r}=e,t=function(i,t){const a=G2();if(iv(t)){const o=t.getCenter();t=[...i,i[0]];const s=t.map(t=>s2(t,o));return t.forEach((t,e)=>{var n,r;0===e?a.moveTo(t[0],t[1]):(n=s[e],r=i[e-1],void 0!==(e=s[e-1])&&Math.abs(n-e)<1e-10?kx(a,r,t,o,n):a.lineTo(t[0],t[1]))}),a.closePath(),a}return n=a,i.forEach((t,e)=>0===e?n.moveTo(t[0],t[1]):n.lineTo(t[0],t[1])),n.closePath(),n;var n}(t,a);return lt(o.createElement("path",{})).call(L,n).style("d",t.toString()).style("stroke",e).style("fill",e).style("transform",r).call(L,i).node()}};Dy.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};Fy=(t,e)=>{const a=at(t,[]),{coordinate:o,document:s}=e;return(t,e,n)=>{var r=n["color"],n=at(n,["color"]),{color:e=r,transform:i}=e,t=function(t,e){var n,[t,r,i,a]=t,o=G2();return iv(e)?(n=s2(e=e.getCenter(),t),o.moveTo(t[0],t[1]),o.quadraticCurveTo(e[0],e[1],i[0],i[1]),kx(o,i,a,e,n),o.quadraticCurveTo(e[0],e[1],r[0],r[1]),kx(o,r,t,e,n),o.closePath()):(o.moveTo(t[0],t[1]),o.bezierCurveTo(t[0]/2+i[0]/2,t[1],t[0]/2+i[0]/2,i[1],i[0],i[1]),o.lineTo(a[0],a[1]),o.bezierCurveTo(a[0]/2+r[0]/2,a[1],a[0]/2+r[0]/2,r[1],r[0],r[1]),o.lineTo(t[0],t[1]),o.closePath()),o}(t,o);return lt(s.createElement("path",{})).call(L,n).style("d",t.toString()).style("fill",e||r).style("stroke",e||r).style("transform",i).call(L,a).node()}};Fy.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};Uo=(y,t)=>{const{coordinate:m,document:v}=t;return(t,e,n)=>{var r,i,a,o,s,l,c,u,h,{color:e,transform:f}=e,{color:d,fill:p=d,stroke:d=d}=n,n=at(n,["color","fill","stroke"]),g=(t=t,r=m,h=G2(),iv(r)?([i,a]=r=r.getCenter(),o=l2(a2(t[0],r)),s=l2(a2(t[1],r)),g=s2(r,t[2]),l=s2(r,t[3]),c=s2(r,t[8]),u=s2(r,t[10]),r=s2(r,t[11]),h.moveTo(...t[0]),h.arc(i,a,g,o,s),h.arc(i,a,g,s,o,!0),h.moveTo(...t[2]),h.lineTo(...t[3]),h.moveTo(...t[4]),h.arc(i,a,l,o,s),h.lineTo(...t[6]),h.arc(i,a,u,s,o,!0),h.closePath(),h.moveTo(...t[8]),h.arc(i,a,c,o,s),h.arc(i,a,c,s,o,!0),h.moveTo(...t[10]),h.lineTo(...t[11]),h.moveTo(...t[12]),h.arc(i,a,r,o,s),h.arc(i,a,r,s,o,!0)):(h.moveTo(...t[0]),h.lineTo(...t[1]),h.moveTo(...t[2]),h.lineTo(...t[3]),h.moveTo(...t[4]),h.lineTo(...t[5]),h.lineTo(...t[6]),h.lineTo(...t[7]),h.closePath(),h.moveTo(...t[8]),h.lineTo(...t[9]),h.moveTo(...t[10]),h.lineTo(...t[11]),h.moveTo(...t[12]),h.lineTo(...t[13])),h);return lt(v.createElement("path",{})).call(L,n).style("d",g.toString()).style("stroke",d).style("fill",e||p).style("transform",f).call(L,y).node()}};Uo.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};as=(y,t)=>{const{coordinate:m,document:v}=t;return(t,e,n)=>{var r,i,a,o,s,l,c,u,h,{color:e,transform:f}=e,{color:d,fill:p=d,stroke:d=d}=n,n=at(n,["color","fill","stroke"]),g=(t=t,r=m,i=4,h=G2(),iv(r)?([a,o]=r=r.getCenter(),s=s2(r,t[3]),l=s2(r,t[8]),g=s2(r,t[10]),c=(r=l2(a2(t[2],r)))-(u=Math.asin(i/l)),r+=u,h.moveTo(...t[2]),h.lineTo(...t[3]),h.moveTo(Math.cos(c)*s+a,Math.sin(c)*s+o),h.arc(a,o,s,c,r),h.lineTo(Math.cos(r)*g+a,Math.sin(r)*g+o),h.arc(a,o,g,r,c,!0),h.lineTo(Math.cos(c)*s+a,Math.sin(c)*s+o),h.closePath(),h.moveTo(...t[10]),h.lineTo(...t[11]),u=(c+r)/2,h.moveTo(Math.cos(u)*(l+i/2)+a,Math.sin(u)*(l+i/2)+o),h.arc(Math.cos(u)*l+a,Math.sin(u)*l+o,i/2,u,2*Math.PI+u)):(h.moveTo(...t[2]),h.lineTo(...t[3]),h.lineTo(t[3][0]-i,t[3][1]),h.lineTo(t[10][0]-i,t[10][1]),h.lineTo(t[10][0]+i,t[10][1]),h.lineTo(t[3][0]+i,t[3][1]),h.lineTo(...t[3]),h.closePath(),h.moveTo(...t[10]),h.lineTo(...t[11]),h.moveTo(t[3][0]+i/2,t[8][1]),h.arc(t[3][0],t[8][1],i/2,0,2*Math.PI)),h.closePath(),h);return lt(v.createElement("path",{})).call(L,n).style("d",g.toString()).style("stroke",d).style("fill",e||p).style("transform",f).call(L,y).node()}};as.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};Hy=(t,e)=>{const{arrow:u,arrowSize:h=4}=t,f=at(t,["arrow","arrowSize"]),{coordinate:d,document:p}=e;return(t,e,n)=>{var r,i,a,{color:o,lineWidth:s}=n,n=at(n,["color","lineWidth"]),{color:o=o,size:s=s}=e,l=u?(l=p,r=h,i=Object.assign({fill:f.stroke||o,stroke:f.stroke||o},st(f,"arrow")),l.createElement("path",{style:Object.assign({path:`M ${r},${r} L -${r},0 L ${r},-${r} L 0,0 Z`,anchor:"0.5 0.5",transformOrigin:"center"},i)})):null,t=(r=t,iv(i=d)?(i=i.getCenter(),K2()({startAngle:0,endAngle:2*Math.PI,outerRadius:s2(r[0],i),innerRadius:s2(r[1],i)})):nx().x(t=>t[0]).y(t=>t[1])(r)),c=(c=d,e=e.transform,iv(c)?([c,a]=c.getCenter(),`translate(${c}, ${a}) `+(e||"")):e);return lt(p.createElement("path",{})).call(L,n).style("d",t).style("stroke",o).style("lineWidth",s).style("transform",c).style("markerEnd",l).call(L,f).node()}};function p5(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}Hy.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const g5=Rx(t=>{var e=t.attributes,{points:n,endMarker:r=!0}=e,e=at(e,["points","class","endMarker","direction"]),i=st(e,"endMarker"),n=(n=n,nx().x(t=>t[0]).y(t=>t[1])(n));lt(t).maybeAppend("connector","path").style("path",n).style("markerEnd",r?new Zw({className:"marker",style:Object.assign(Object.assign({},i),{symbol:p5})}):null).call(L,e)});Qo=(t,e)=>{const{offset:o=0,connectLength1:s}=t,l=at(t,["offset","connectLength1"]),c=e["coordinate"];return(t,e,n)=>{var{color:r,connectLength1:i=s}=n,n=at(n,["color","connectLength1"]),{color:e,transform:a}=e,t=function(t,e,n,r=0){var[[e,i],[a,o]]=e;if(rv(t)){const l=n;var t=e+l,s=t+r;return[[t,i],[s,i],[s,o],[a+l,o]]}const l=-n;return t=i+l,[[e,t],[e,s=t+-r],[a,s],[a,o+l]]}(c,t,o,i);return lt(new g5).call(L,n).style("points",t).style("stroke",e||r).style("transform",a).call(L,l).node()}};function y5(t,e,a,n){var r=a["bounds"];const[[o,s],[i,l]]=r,c=i-o,u=l-s;r=t=>{var{x:e,y:n}=t,r=up(a.x,c),i=up(a.y,u);return Object.assign(Object.assign({},t),{x:(r||e)+o,y:(i||n)+s})};return r("left"===t?{x:0,y:u/2,textAnchor:"start",textBaseline:"middle"}:"right"===t?{x:c,y:u/2,textAnchor:"end",textBaseline:"middle"}:"top"===t?{x:c/2,y:0,textAnchor:"center",textBaseline:"top"}:"bottom"===t?{x:c/2,y:u,textAnchor:"center",textBaseline:"bottom"}:"top-left"===t?{x:0,y:0,textAnchor:"start",textBaseline:"top"}:"top-right"===t?{x:c,y:0,textAnchor:"end",textBaseline:"top"}:"bottom-left"===t?{x:0,y:u,textAnchor:"start",textBaseline:"bottom"}:"bottom-right"===t?{x:c,y:u,textAnchor:"end",textBaseline:"bottom"}:{x:c/2,y:u/2,textAnchor:"center",textBaseline:"middle"})}function m5(r,i,t,e){var{y:t,y1:n,autoRotate:a,rotateToAlignArc:o}=t;const s=e.getCenter(),{innerRadius:l,outerRadius:c,startAngle:u,endAngle:h}=Ax(e,i,[t,n]),f="inside"===r?(u+h)/2:h;e=b5(f,a,o),t=(()=>{var[t,e]=i,n=l+.5*(c-l),[n,t]="inside"===r?v5(s,f,n):f2(t,e);return{x:n,y:t}})();return Object.assign(Object.assign({},t),{textAlign:"inside"===r?"center":"start",textBaseline:"middle",rotate:e})}function v5(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function b5(t,e,n){return e?(e=n?0:Math.sin(t)<0?90:-90,t/Math.PI*180+e):0}function x5(t,e,n,r){var{y:n,y1:i,autoRotate:a,rotateToAlignArc:o,radius:s=.5,offset:l=0}=n,e=Ax(r,e,[n,i]),{startAngle:n,endAngle:i}=e,r=r.getCenter(),n=(n+i)/2,i={textAlign:"center",textBaseline:"middle",rotate:b5(n,a,o)},{innerRadius:a,outerRadius:o}=e,[e,r]=v5(r,n,a+(o-a)*s+l);return Object.assign({x:e,y:r},i)}function w5(t){return void 0===t?null:t}function M5(t,e,n){var n=n["bounds"],[n]=n;return{x:w5(n[0]),y:w5(n[1])}}function O5(t,e,n,r){var i=n["bounds"];return 1===i.length?M5(0,0,n):(av(r)?m5:cv(r)?x5:y5)(t,e,n,r)}function k5(t,e,n){var{innerRadius:n,outerRadius:t}=Ax(n,t,[e.y,e.y1]);return n+(t-n)}function E5(t,e,n){var{startAngle:n,endAngle:t}=Ax(n,t,[e.y,e.y1]);return(n+t)/2}function S5(t,e,n,r){var{autoRotate:i,rotateToAlignArc:a,offset:o=0,connector:s=!0,connectorLength:l=o,connectorLength2:c=0,connectorDistance:u=0}=n,h=r.getCenter(),f=E5(e,n,r),d=0<Math.sin(f)?1:-1,i=b5(f,i,a),a={textAlign:0<d||av(r)?"start":"end",textBaseline:"middle",rotate:i},i=k5(e,n,r),[[e,n],[r,h],[f,i]]=function(t,e,n,r,i){var[n,a]=v5(t,e,n),[t,r]=v5(t,e,r);return[[n,a],[t,r],[t+(0<Math.sin(e)?1:-1)*i,r]]}(h,f,i,i+(s?l:o),s?c:0),l=s?+u*d:0,o=f+l,c={connector:s,connectorPoints:[[r-o,h-i],[f-o,i-i]]};return Object.assign(Object.assign({x0:e,y0:n,x:f+l,y:i},a),c)}Qo.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var A5=Object.freeze({__proto__:null,area:function(t,e,n,r){var i=e.length/2;const a=e.slice(0,i),o=e.slice(i);var e=Vd(a,(t,e)=>Math.abs(t[1]-o[e][1])),i=(l=t=>[a[t][0],(a[t][1]+o[t][1])/2])(e=Math.max(Math.min(e,i-2),1)),s=l(e-1),l=l2(a2(l(e+1),s))/Math.PI*180;return{x:i[0],y:i[1],transform:`rotate(${l})`,textAlign:"center",textBaseline:"middle"}},bottom:O5,bottomLeft:O5,bottomRight:O5,inside:O5,left:O5,outside:function(t,e,n,r){var i=n["bounds"];return 1===i.length?M5(0,0,n):(av(r)?m5:cv(r)?S5:y5)(t,e,n,r)},right:O5,spider:function(t,e,n,r){var i,a,o,s,l,c;return cv(r)?({connectorLength:c,connectorLength2:i,connectorDistance:a}=n,o=at(S5(0,e,n,r),[]),s=r.getCenter(),l=k5(e,n,r),e=E5(e,n,r),n=l+c+i,r=0<Math.sin(e)?1:-1,l=o["x"],c=s[0]+(n+ +a)*r-l,o.x+=c,o.connectorPoints[0][0]-=c,o):{}},surround:function(t,e,n,r){var i,a,o,s,l;return cv(r)?({connectorLength:o,connectorLength2:i,connectorDistance:a}=n,{x0:n,y0:s}=e=at(S5(0,e,n,r),[]),l=r.getCenter(),r=function(t){if(cv(t)){var[e,n]=t.getSize(),t=t.getOptions().transformations.find(t=>"polar"===t[0]);if(t)return Math.max(e,n)/2*t[4]}return 0}(r)+o,o=c2([n-l[0],s-l[1]]),n=0<Math.sin(o)?1:-1,[s,l]=v5(l,o,r),e.x=s+(i+a)*n,e.y=l,e):{}},top:O5,topLeft:O5,topRight:O5});function _5(t,e,n,r,i){var a=e["position"],o=i["render"],a=(s=n,void 0!==(a=a)?a:cv(s)?"inside":rv(s)?"right":"top"),s=r[o?"htmlLabel":"inside"===a?"innerLabel":"label"],r=Object.assign({},s,e),o=A5[fv(a)];if(o)return Object.assign(Object.assign({},s),o(a,t,r,n,i));throw new Error("Unknown position: "+a)}const T5=(c,t)=>{const{coordinate:u,theme:h}=t,f=c["render"];return(t,e)=>{var{text:n,transform:r="",transformOrigin:i,className:a=""}=e,o=at(e,["text","x","y","transform","transformOrigin","className"]),t=_5(t,e,u,h,c),{rotate:s=0,transform:l=""}=t,t=at(t,["rotate","transform"]);return lt(new Qk).call(L,t).style("text",""+n).style("className",a+" g2-label").style("innerHTML",f?f(n,e.datum,e.index):void 0).style("labelTransform",(l+` rotate(${+s}) `+r).trim()).style("labelTransformOrigin",i).style("coordCenter",u.getCenter()).call(L,o).node()}},P5=(T5.props={defaultMarker:"point"},(t,e)=>{const o=t["colorAttribute"],s=at(t,["arrow","colorAttribute"]),{coordinate:l,document:c}=e;return(t,e,n)=>{var r=n["color"],n=at(n,["color","stroke"]),{d:e,color:r=r}=e,[i,a]=l.getSize();return lt(c.createElement("path",{})).call(L,n).style("d","function"==typeof e?e({width:i,height:a}):e).style(o,r).call(L,s).node()}});P5.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};zy=(t,e)=>P5(Object.assign({colorAttribute:"fill"},t),e),zy.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},$s=(t,e)=>P5(Object.assign({fill:"none",colorAttribute:"stroke"},t),e),$s.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},Go=(s,t)=>{const l=t["document"];return(t,e,n)=>{var r=e["transform"],i=n["color"],n=at(n,["color"]),{color:e=i}=e,[t,...a]=t;const o=G2();return o.moveTo(...t),a.forEach(([t,e])=>{o.lineTo(t,e)}),o.closePath(),lt(l.createElement("path",{})).call(L,n).style("d",o.toString()).style("stroke",e||i).style("fill",e||i).style("fillOpacity",.4).style("transform",r).call(L,s).node()}};function C5(t){var n,r,i,a=t||1;function o(t,e){++n>a&&(i=r,s(1),++n),r[t]=e}function s(t){n=0,r=Object.create(null),t||(i=Object.create(null))}return s(),{clear:s,has:function(t){return void 0!==r[t]||void 0!==i[t]},get:function(t){var e=r[t];return void 0!==e?e:void 0!==(e=i[t])?(o(t,e),e):void 0},set:function(t,e){void 0!==r[t]?r[t]=e:o(t,e)}}}function L5(t,e,n){t=t?t():document.createElement("canvas");return t.width=e,t.height=n,t}Go.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},C5(3);const N5=function(n,r,t=16){const i=C5(t);return(...t)=>{var e=r(...t);i.get(e);return i.has(e)?i.get(e):(t=n(...t),i.set(e,t),t)}}((t,e,n)=>{var n=L5(n,2*t,2*t),r=n.getContext("2d"),i=t,a=t;return 1===e?(r.beginPath(),r.arc(i,a,t,0,2*Math.PI,!1),r.fillStyle="rgba(0,0,0,1)",r.fill()):((e=r.createRadialGradient(i,a,t*e,i,a,t)).addColorStop(0,"rgba(0,0,0,1)"),e.addColorStop(1,"rgba(0,0,0,0)"),r.fillStyle=e,r.fillRect(0,0,2*t,2*t)),n},t=>""+t);function j5(t,e,n,r,i,a,o){a=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)"]]},a);a.minOpacity*=255,a.opacity*=255,a.maxOpacity*=255;var s=L5(o,t,e).getContext("2d"),l=function(t,e){const n=(e=L5(e,256,1).getContext("2d")).createLinearGradient(0,0,256,1);return("string"==typeof(t=t)?t.split(" ").map(t=>{var[t,e]=t.split(":");return[+t,e]}):t).forEach(([t,e])=>{n.addColorStop(t,e)}),e.fillStyle=n,e.fillRect(0,0,256,1),e.getImageData(0,0,256,1).data}(a.gradient,o);s.clearRect(0,0,t,e);{var c=s,u=n,h=r,f=i,d=o,p=(n=a)["blur"];let t=f.length;for(;t--;){var{x:g,y,value:m,radius:v}=f[t],m=Math.min(m,h),g=g-v,y=y-v,v=N5(v,1-p,d);c.globalAlpha=Math.max((m-u)/(h-u),.001),c.drawImage(v,g,y)}}r=function(t,e,n,r,i){var{minOpacity:a,opacity:o,maxOpacity:s,useGradientOpacity:l}=i,c=(i=t.getImageData(0,0,e,n)).data,u=c.length;for(let t=3;t<u;t+=4){var h=c[t],f=4*h;f&&(h=o||Math.max(0,Math.min(s,Math.max(a,h))),c[t-3]=r[f],c[t-2]=r[1+f],c[t-1]=r[2+f],c[t]=l?r[3+f]:h)}return i}(s,t,e,l,a),i=L5(o,t,e).getContext("2d");return i.putImageData(r,0,0),i}Yy=(t,e)=>{const{gradient:u,opacity:h,maxOpacity:f,minOpacity:d,blur:p,useGradientOpacity:g}=t,y=at(t,["gradient","opacity","maxOpacity","minOpacity","blur","useGradientOpacity"]),{coordinate:m,createCanvas:v,document:b}=e;return(t,e,n)=>{var r,i,e=e["transform"],[a,o]=m.getSize(),s=t.map(t=>({x:t[0],y:t[1],value:t[2],radius:t[3]})),l=Yd(t,t=>t[2]),t=Hd(t,t=>t[2]),c={gradient:u,opacity:h,minOpacity:d,maxOpacity:f,blur:p,useGradientOpacity:g},l=a&&o?j5(a,o,l,t,s,(r=c,i=t=>void 0===t,Object.keys(r).reduce((t,e)=>{var n=r[e];return i(n,e)||(t[e]=n),t},{})),v):{canvas:null};return lt(b.createElement("image",{})).call(L,n).style("x",0).style("y",0).style("width",a).style("height",o).style("src",l.canvas).style("transform",e).call(L,y).node()}},Yy.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},$y=t=>{const n=t["render"],r=at(t,["render"]);return t=>{var[[t,e]]=t;return n(Object.assign(Object.assign({},r),{x:t,y:e}))}};function R5(t,e){return t.getBandWidth(t.invert(e))}$y.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};vm={rect:Ys,hollow:o,funnel:Nx,pyramid:Js};const I5=()=>(t,e,n,i)=>{const{x:a,y:o,y1:s,series:l,size:r}=n,c=e.x,u=e.series,[h]=i.getSize(),f=r?r.map(t=>+t/h):null,d=r?(t,e,n)=>{t+=e/2,e=f[n];return[t-e/2,t+e/2]}:(t,e,n)=>[t,t+e];return[t,Array.from(t,t=>{var e=R5(c,a[t]),n=e*(u?R5(u,null===l||void 0===l?void 0:l[t]):1),e=(+(null===l||void 0===l?void 0:l[t])||0)*e,e=+a[t]+e,[e,n]=d(e,n,t),r=+o[t],t=+s[t];return[[e,r],[n,r],[n,t],[e,t]].map(t=>i.map(t))})]};I5.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:vm,channels:[...n5({shapes:Object.keys(vm)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...o5(),{type:_l},{type:Rl}],postInference:[...i5()],interaction:{shareTooltip:!0}};Iy={rect:Ys,hollow:o};const B5=()=>(t,e,n,r)=>{const{x:i,x1:a,y:o,y1:s}=n;return[t,Array.from(t,t=>{return[[+i[t],+o[t]],[+a[t],+o[t]],[+a[t],+s[t]],[+i[t],+s[t]]].map(t=>r.map(t))})]};B5.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:Iy,channels:[...n5({shapes:Object.keys(Iy)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...o5(),{type:_l}],postInference:[...i5()],interaction:{shareTooltip:!0}};By={line:_o,smooth:Ro,hv:No,vh:qo,hvh:zo,trail:Ko};const D5=(t,e,n,r)=>{var i;const{series:a,x:o,y:s}=n;var{x:n,y:e}=e;if(void 0===o||void 0===s)throw new Error("Missing encode for x or y channel.");var t=a?Array.from(Sd(t,t=>a[t]).values()):[t],l=t.map(t=>t[0]).filter(t=>void 0!==t);const c=((null==(i=null==n?void 0:n.getBandWidth)?void 0:i.call(n))||0)/2,u=((null==(i=null==e?void 0:e.getBandWidth)?void 0:i.call(e))||0)/2;return[l,Array.from(t,t=>t.map(t=>r.map([+o[t]+c,+s[t]+u]))),t]},F5=(t,e,n,i)=>{const a=Object.entries(n).filter(([t])=>t.startsWith("position")).map(([,t])=>t);if(0===a.length)throw new Error("Missing encode for position channel.");return[t,Array.from(t,e=>{var t=a.map(t=>+t[e]),n=i.map(t),r=[];for(let t=0;t<n.length;t+=2)r.push([n[t],n[t+1]]);return r})]},z5=()=>(t,e,n,r)=>{return(sv(r)?F5:D5)(t,e,n,r)};z5.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:By,channels:[...n5({shapes:Object.keys(By)}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"identity"}],preInference:[...o5(),{type:e},{type:el}],postInference:[...i5(),{type:xb,channel:"color"},{type:Mb,channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};mm={hollow:Zy,hollowDiamond:Xy,hollowHexagon:Qy,hollowSquare:tm,hollowTriangleDown:nm,hollowTriangle:Jy,hollowBowtie:Ky,point:lm,plus:sm,diamond:rm,square:cm,triangle:gm,hexagon:om,cross:im,bowtie:em,hyphen:am,line:Co,tick:So,triangleDown:ym};const W5=g=>(t,e,n,o)=>{const{x:r,y:i,x1:a,y1:s,size:l,dx:c,dy:u}=n,[h,f]=o.getSize(),d=l5(e,n,g),p=t=>{var e=+((null===c||void 0===c?void 0:c[t])||0),n=+((null===u||void 0===u?void 0:u[t])||0);return[(a?(+r[t]+ +a[t])/2:+r[t])+e,(s?(+i[t]+ +s[t])/2:+i[t])+n]};return[t,l?Array.from(t,t=>{var[e,n]=p(t),r=+l[t],i=r/h,r=r/f,a=[e-i,n-r],e=[e+i,n+r];return[o.map(d(a,t)),o.map(d(e,t))]}):Array.from(t,t=>[o.map(d(p(t),t))])]};W5.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,shape:mm,channels:[...n5({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:[...o5(),{type:Rl},{type:zl}],postInference:[{type:Hs},...r5()]};Uy={text:Ws,badge:Wy};const G5=s=>{var{cartesian:t=!1}=s;return t?u5:(t,e,n,r)=>{const{x:i,y:a}=n,o=l5(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}};G5.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,shape:Uy,channels:[...n5({shapes:Object.keys(Uy)}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize"},{name:"rotate"}],preInference:[...o5(),{type:ii},{type:fn}],postInference:[...r5()]};Js={cell:Ys,hollow:o};const H5=()=>(t,e,n,i)=>{const{x:a,y:o}=n,s=e.x,l=e.y;return[t,Array.from(t,t=>{var e=s.getBandWidth(s.invert(+a[t])),n=l.getBandWidth(l.invert(+o[t])),r=+a[t],t=+o[t];return[[r,t],[r+e,t],[r+e,t+n],[r,t+n]].map(t=>i.map(t))})]};H5.props={defaultShape:"cell",defaultLabelShape:"label",shape:Js,composite:!1,channels:[...n5({shapes:Object.keys(Js)}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...o5(),{type:Rl},{type:zl},{type:ol}],postInference:[...r5()]};vm={area:rl,smooth:uu,hvh:Ss,vh:n,hv:es};const V5=()=>(t,e,n,a)=>{var r;const{x:o,y:s,y1:l,series:i}=n;var{x:n,y:e}=e,t=i?Array.from(Sd(t,t=>i[t]).values()):[t],c=t.map(t=>t[0]).filter(t=>void 0!==t);const u=((null==(r=null==n?void 0:n.getBandWidth)?void 0:r.call(n))||0)/2,h=((null==(r=null==e?void 0:e.getBandWidth)?void 0:r.call(e))||0)/2;return[c,Array.from(t,e=>{var n=e.length,r=new Array(2*n);for(let t=0;t<e.length;t++){var i=e[t];r[t]=a.map([+o[i]+u,+s[i]+h]),r[n+t]=a.map([+o[i]+u,+l[i]+h])}return r}),t]};V5.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,shape:vm,channels:[...n5({shapes:Object.keys(vm)}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"identity"}],preInference:[...o5(),{type:el},{type:_l},{type:ol}],postInference:[...i5()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};Iy={link:rs,arc:qy,smooth:zs,vhv:Ol};const Y5=c=>(t,e,n,r)=>{const{x:i,y:a,x1:o=i,y1:s=a}=n,l=l5(e,n,c);e=t.map(t=>[r.map(l([+i[t],+a[t]],t)),r.map(l([+o[t],+s[t]],t))]);return[t,e]};Y5.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,shape:Iy,channels:[...n5({shapes:Object.keys(Iy)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...o5(),{type:Zs},{type:Xs}],postInference:[...r5()]};_o={image:Gy};const q5=s=>{var t=s["cartesian"];return t?u5:(t,e,n,r)=>{const{x:i,y:a}=n,o=l5(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}};q5.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,shape:_o,channels:[...n5({shapes:Object.keys(_o)}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...o5(),{type:ii},{type:fn}],postInference:[...r5()]};Ro={polygon:Dy,ribbon:Fy};const $5=()=>(t,e,n,a)=>{const o=Object.entries(n).filter(([t])=>t.startsWith("x")).map(([,t])=>t),s=Object.entries(n).filter(([t])=>t.startsWith("y")).map(([,t])=>t);n=t.map(e=>{var n=[];for(let t=0;t<o.length;t++){var r=o[t][e];if(void 0===r)break;var i=s[t][e];n.push(a.map([+r,+i]))}return n});return[t,n]};$5.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,shape:Ro,channels:[...n5({shapes:Object.keys(Ro)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...o5()],postInference:[...r5()]};No={box:Uo,violin:as};const U5=()=>(t,e,n,s)=>{const{x:l,y:c,y1:u,y2:h,y3:f,y4:d,series:p}=n,g=e.x,y=e.series;return[t,Array.from(t,t=>{var e=g.getBandWidth(g.invert(+l[t])),n=e*(y?y.getBandWidth(y.invert(+(null===p||void 0===p?void 0:p[t]))):1),e=(+(null===p||void 0===p?void 0:p[t])||0)*e,e=+l[t]+e+n/2,[t,r,i,a,o]=[+c[t],+u[t],+h[t],+f[t],+d[t]];return[[e-n/2,o],[e+n/2,o],[e,o],[e,a],[e-n/2,a],[e+n/2,a],[e+n/2,r],[e-n/2,r],[e-n/2,i],[e+n/2,i],[e,r],[e,t],[e-n/2,t],[e+n/2,t]].map(t=>s.map(t))})]};U5.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,shape:No,channels:[...n5({shapes:Object.keys(No)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...o5(),{type:Rl}],postInference:[...i5()],interaction:{shareTooltip:!0}};qo={vector:Fx};const X5=()=>(t,e,n,i)=>{const{x:a,y:o,size:s,rotate:l}=n,[c,u]=i.getSize();n=t.map(t=>{var e=+l[t]/180*Math.PI,n=+s[t],r=n/c,n=n/u,r=r*Math.cos(e),n=-n*Math.sin(e);return[i.map([+a[t]-r/2,+o[t]-n/2]),i.map([+a[t]+r/2,+o[t]+n/2])]});return[t,n]};X5.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,shape:qo,channels:[...n5({shapes:Object.keys(qo)}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...o5()],postInference:[...r5()]};zo={line:Hy};const K5=o=>(t,e,n,r)=>{const i=n["y"],a=l5(e,n,ot({style:{bandOffset:0}},o));return[t,Array.from(t,e=>{return[[0,i[e]],[1,i[e]]].map(t=>r.map(a(t,e)))})]};K5.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:zo,channels:[...a5({shapes:Object.keys(zo)}),{name:"y",required:!0}],preInference:[...o5(),{type:i}],postInference:[]};Ko={line:Hy};const Z5=o=>(t,e,n,r)=>{const i=n["x"],a=l5(e,n,ot({style:{bandOffset:0}},o));return[t,Array.from(t,e=>{return[[i[e],1],[i[e],0]].map(t=>r.map(a(t,e)))})]};Z5.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:Ko,channels:[...a5({shapes:Object.keys(Ko)}),{name:"x",required:!0}],preInference:[...o5(),{type:S}],postInference:[]};By={connector:Qo};const Q5=(...t)=>Y5(...t);function J5(t,e,n,r){if(e)return()=>[0,1];const{[t]:i,[t+"1"]:a}=n;return t=>{var e=(null==(e=r.getBandWidth)?void 0:e.call(r,r.invert(+a[t])))||0;return[i[t],a[t]+e]}}function tS(t={}){const{extendX:r=!1,extendY:s=!1}=t;return(t,e,n,i)=>{const a=J5("x",r,n,e.x),o=J5("y",s,n,e.y);return[t,Array.from(t,t=>{var[e,n]=a(t),[t,r]=o(t);return[[e,t],[n,t],[n,r],[e,r]].map(t=>i.map(t))})]}}Q5.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,shape:By,channels:[...a5({shapes:Object.keys(By)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...o5()],postInference:[]};e={range:Ys};const eS=()=>tS();eS.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:e,channels:[...a5({shapes:Object.keys(e)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...o5()],postInference:[]};Zy={range:Ys};const nS=()=>tS({extendY:!0});nS.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:Zy,channels:[...a5({shapes:Object.keys(Zy)}),{name:"x",required:!0}],preInference:[...o5()],postInference:[]};Xy={range:Ys};const rS=()=>tS({extendX:!0});function iS(t){return t.target.depth}function aS(t,e){return t.sourceLinks.length?t.depth:e-1}function oS(t){return function(){return t}}function sS(t,e){return cS(t.source,e.source)||t.index-e.index}function lS(t,e){return cS(t.target,e.target)||t.index-e.index}function cS(t,e){return t.y0-e.y0}function uS(t){return t.value}function hS(t){return t.index}function fS(t){return t.nodes}function dS(t){return t.links}function pS(t,e){t=t.get(e);if(t)return t;throw new Error("missing: "+e)}function gS({nodes:t}){for(const n of t){let t=n.y0,e=t;for(const r of n.sourceLinks)r.y0=t+r.width/2,t+=r.width;for(const i of n.targetLinks)i.y1=e+i.width/2,e+=i.width}}function yS(){let x=0,w=0,M=1,O=1,k=24,E=8,S,A=hS,_=aS,T,P,C,L=fS,N=dS,j=6;function e(e){e={nodes:L(e),links:N(e)};{var{nodes:i,links:t}=e;i.forEach((t,e)=>{t.index=e,t.sourceLinks=[],t.targetLinks=[]});const g=new Map(i.map(t=>[A(t),t]));if(t.forEach((t,e)=>{t.index=e;let{source:n,target:r}=t;"object"!=typeof n&&(n=t.source=pS(g,n)),"object"!=typeof r&&(r=t.target=pS(g,r)),n.sourceLinks.push(t),r.targetLinks.push(t)}),null!=C)for(var{sourceLinks:n,targetLinks:r}of i)n.sort(C),r.sort(C)}t=e.nodes;for(const y of t)y.value=void 0===y.fixedValue?Math.max(ep(y.sourceLinks,uS),ep(y.targetLinks,uS)):y.fixedValue;{var a=e.nodes,o=a.length;let t=new Set(a),n=new Set,r=0;for(;t.size;){if(t.forEach(t=>{t.depth=r;for(var{target:e}of t.sourceLinks)n.add(e)}),++r>o)throw new Error("circular link");t=n,n=new Set}if(T){var s,l=Math.max(Hd(a,t=>t.depth)+1,0);for(let t=0;t<a.length;t++)(s=a[t]).depth=T.call(null,s,l)}}{var c=(i=e.nodes).length;let t=new Set(i),n=new Set,r=0;for(;t.size;){if(t.forEach(t=>{t.height=r;for(var{source:e}of t.targetLinks)n.add(e)}),++r>c)throw new Error("circular link");t=n,n=new Set}}var u=function({nodes:t}){var e=Math.max(Hd(t,t=>t.depth)+1,0),n=(M-x-k)/(e-1),r=new Array(e).fill(0).map(()=>[]);for(const a of t){var i=Math.max(0,Math.min(e-1,Math.floor(_.call(null,a,e))));a.layer=i,a.x0=x+i*n,a.x1=a.x0+k,r[i]?r[i].push(a):r[i]=[a]}if(P)for(const o of r)o.sort(P);return r}(e),t=(S=Math.min(E,(O-w)/(Hd(u,t=>t.length)-1)),u),h=Yd(t,t=>(O-w-(t.length-1)*S)/ep(t,uS));for(const m of t){let e=w;for(const v of m){v.y0=e,v.y1=e+v.value*h,e=v.y1+S;for(const b of v.sourceLinks)b.width=b.value*h}e=(O-e+S)/(m.length+1);for(let t=0;t<m.length;++t){var f=m[t];f.y0+=e*(t+1),f.y1+=e*(t+1)}!function(t){if(void 0===C)for(var{sourceLinks:e,targetLinks:n}of t)e.sort(lS),n.sort(sS)}(m)}for(let t=0;t<j;++t){var d=Math.pow(.99,t),p=Math.max(1-d,(t+1)/j);!function(n,r,i){for(let t=n.length,e=t-2;0<=e;--e){var a,o=n[e];for(const c of o){let t=0,e=0;for(var{target:s,value:l}of c.sourceLinks){l=l*(s.layer-c.layer);t+=function(t,e){let n=e.y0-(e.targetLinks.length-1)*S/2;for(var{source:r,width:i}of e.targetLinks){if(r===t)break;n+=i+S}for(var{target:a,width:o}of t.sourceLinks){if(a===e)break;n-=o}return n}(c,s)*l,e+=l}0<e&&(a=(t/e-c.y0)*r,c.y0+=a,c.y1+=a,I(c))}void 0===P&&o.sort(cS),o.length&&R(o,i)}}(u,d,p),!function(n,r,i){for(let t=1,e=n.length;t<e;++t){var a,o=n[t];for(const c of o){let t=0,e=0;for(var{source:s,value:l}of c.targetLinks){l=l*(c.layer-s.layer);t+=function(t,e){let n=t.y0-(t.sourceLinks.length-1)*S/2;for(var{target:r,width:i}of t.sourceLinks){if(r===e)break;n+=i+S}for(var{source:a,width:o}of e.targetLinks){if(a===t)break;n-=o}return n}(s,c)*l,e+=l}0<e&&(a=(t/e-c.y0)*r,c.y0+=a,c.y1+=a,I(c))}void 0===P&&o.sort(cS),o.length&&R(o,i)}}(u,d,p)}return gS(e),e}function R(t,e){var n=t.length>>1,r=t[n];a(t,r.y0-S,n-1,e),i(t,r.y1+S,1+n,e),a(t,O,t.length-1,e),i(t,w,0,e)}function i(t,e,n,r){for(;n<t.length;++n){var i=t[n],a=(e-i.y0)*r;1e-6<a&&(i.y0+=a,i.y1+=a),e=i.y1+S}}function a(t,e,n,r){for(;0<=n;--n){var i=t[n],a=(i.y1-e)*r;1e-6<a&&(i.y0-=a,i.y1-=a),e=i.y0-S}}function I({sourceLinks:t,targetLinks:e}){if(void 0===C){for(const{source:{sourceLinks:t}}of e)t.sort(lS);for(const{target:{targetLinks:e}}of t)e.sort(sS)}}return e.update=function(t){return gS(t),t},e.nodeId=function(t){return arguments.length?(A="function"==typeof t?t:oS(t),e):A},e.nodeAlign=function(t){return arguments.length?(_="function"==typeof t?t:oS(t),e):_},e.nodeDepth=function(t){return arguments.length?(T=t,e):T},e.nodeSort=function(t){return arguments.length?(P=t,e):P},e.nodeWidth=function(t){return arguments.length?(k=+t,e):k},e.nodePadding=function(t){return arguments.length?(E=S=+t,e):E},e.nodes=function(t){return arguments.length?(L="function"==typeof t?t:oS(t),e):L},e.links=function(t){return arguments.length?(N="function"==typeof t?t:oS(t),e):N},e.linkSort=function(t){return arguments.length?(C=t,e):C},e.size=function(t){return arguments.length?(x=w=0,M=+t[0],O=+t[1],e):[M-x,O-w]},e.extent=function(t){return arguments.length?(x=+t[0][0],M=+t[1][0],w=+t[0][1],O=+t[1][1],e):[[x,w],[M,O]]},e.iterations=function(t){return arguments.length?(j=+t,e):j},e}rS.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:Xy,channels:[...a5({shapes:Object.keys(Xy)}),{name:"y",required:!0}],preInference:[...o5()],postInference:[]};const mS={nodeAlign:"justify",nodeWidth:.008,nodePadding:.03,nodes:t=>t.nodes,links:t=>t.links,nodeSort:void 0,linkSort:void 0,iterations:6},vS={left:function(t){return t.depth},right:function(t,e){return e-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?Yd(t.sourceLinks,iS)-1:0},justify:aS};const bS=h=>t=>{var{nodeId:e,nodeSort:n,nodeAlign:r,nodeWidth:i,nodePadding:a,nodeDepth:o,nodes:s,links:l,linkSort:c,iterations:u}=Object.assign({},mS,h),l=yS().nodeSort(n).linkSort(c).links(l).nodes(s).nodeWidth(i).nodePadding(a).nodeDepth(o).nodeAlign("string"==(c=typeof(n=r))?vS[n]||aS:"function"==c?n:aS).iterations(u).extent([[0,0],[1,1]]),s=("function"==typeof e&&l.nodeId(e),l(t)),{nodes:i,links:a}=s;return{nodes:i.map(t=>{var{x0:e,x1:n,y0:r,y1:i}=t;return Object.assign(Object.assign({},t),{x:[e,n,n,e],y:[r,r,i,i]})}),links:a.map(t=>{var{source:e,target:n}=t,e=e.x1,n=n.x0,r=t.width/2;return Object.assign(Object.assign({},t),{x:[e,e,n,n],y:[t.y0+r,t.y0-r,t.y1+r,t.y1-r]})})}},xS=(bS.props={},{nodeId:t=>t.key,nodeWidth:.02,nodePadding:.02}),wS={type:"polygon",axis:!1,legend:!1,encode:{shape:"polygon",x:"x",y:"y"},scale:{x:{type:"identity"},y:{type:"identity"}},style:{stroke:"#000"}},MS={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{fillOpacity:.5,stroke:void 0}},OS={textAlign:t=>t.x[0]<.5?"start":"end",position:t=>t.x[0]<.5?"right":"left",fontSize:10},kS=t=>{var{data:t,encode:e={},scale:n,style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={},tooltip:l={}}=t,{links:t,nodes:c}=d5(t,e),u=st(e,"node"),e=st(e,"link"),{key:h=t=>t.key,color:f=h}=u,{links:i,nodes:t}=bS(Object.assign(Object.assign(Object.assign({},xS),{nodeId:h5(h)}),i))({links:t,nodes:c});const d=st(r,"label"),{text:p=h,spacing:g=5}=d,y=at(d,["text","spacing"]),m=h5(h);c=yv(l,"node",{title:m,items:[{field:"value"}]},!0),h=yv(l,"link",{title:"",items:[t=>({name:"source",value:m(t.source)}),t=>({name:"target",value:m(t.target)})]});return[ot({},wS,{data:t,encode:Object.assign(Object.assign({},u),{color:f}),scale:n,style:st(r,"node"),labels:[Object.assign(Object.assign(Object.assign({},OS),{text:p,dx:t=>t.x[0]<.5?g:-g}),y),...a],tooltip:c,animate:bv(s,"node"),axis:!1}),ot({},MS,{data:i,encode:e,labels:o,style:Object.assign({fill:e.color?void 0:"#aaa",strokeWidth:0},st(r,"link")),tooltip:h,animate:bv(s,"link")})]};kS.props={};Qy={path:zy,hollow:$s};const ES=t=>(t,e,n,r)=>[t,t.map(()=>[[0,0]])];function SS(t,e,n){const r=n["value"];var o,i,a,s,l,c,u,h,f,d,n=function(t,e){var n={treemapBinary:QE,treemapDice:RE,treemapSlice:XE,treemapSliceDice:JE,treemapSquarify:ZE,treemapResquarify:t5};if(e="treemapSquarify"===t?n[t].ratio(e):n[t])return e;throw new TypeError("Invalid tile method!")}(e.tile,e.ratio),p=(t=t,p=e.path,(Array.isArray(t)?"function"==typeof p?WE().path(p):WE():sE)(t));function g(t){return t.x0=t.y0=0,t.x1=a,t.y1=s,t.eachBefore(y),l=[0],i&&t.eachBefore(jE),t}function y(t){var e=l[t.depth],n=t.x0+e,r=t.y0+e,i=t.x1-e,a=t.y1-e;i<n&&(n=i=(n+i)/2),a<r&&(r=a=(r+a)/2),t.x0=n,t.y0=r,t.x1=i,t.y1=a,t.children&&(e=l[t.depth+1]=c(t)/2,n+=d(t)-e,r+=u(t)-e,(i-=h(t)-e)<n&&(n=i=(n+i)/2),(a-=f(t)-e)<r&&(r=a=(r+a)/2),o(t,n,r,i,a))}return r?p.sum(t=>e.ignoreParentValue&&t.children?0:h5(r)(t)).sort(e.sort):p.count(),o=ZE,i=!1,s=a=1,l=[0],d=f=h=u=c=gE,g.round=function(t){return arguments.length?(i=!!t,g):i},g.size=function(t){return arguments.length?(a=+t[0],s=+t[1],g):[a,s]},g.tile=function(t){return arguments.length?(o=pE(t),g):o},g.padding=function(t){return arguments.length?g.paddingInner(t).paddingOuter(t):g.paddingInner()},g.paddingInner=function(t){return arguments.length?(c="function"==typeof t?t:yE(+t),g):c},g.paddingOuter=function(t){return arguments.length?g.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):g.paddingTop()},g.paddingTop=function(t){return arguments.length?(u="function"==typeof t?t:yE(+t),g):u},g.paddingRight=function(t){return arguments.length?(h="function"==typeof t?t:yE(+t),g):h},g.paddingBottom=function(t){return arguments.length?(f="function"==typeof t?t:yE(+t),g):f},g.paddingLeft=function(t){return arguments.length?(d="function"==typeof t?t:yE(+t),g):d},g.tile(n).size(e.size).round(e.round).paddingInner(e.paddingInner).paddingOuter(e.paddingOuter).paddingTop(e.paddingTop).paddingRight(e.paddingRight).paddingBottom(e.paddingBottom).paddingLeft(e.paddingLeft)(p),p.descendants().map(t=>Object.assign(t,{x:[t.x0,t.x1],y:[t.y0,t.y1]})).filter("function"==typeof e.layer?e.layer:t=>t.height===e.layer)}ES.props={defaultShape:"path",defaultLabelShape:"label",shape:Qy,composite:!1,channels:[...n5({shapes:Object.keys(Qy)}),{name:"d",scale:"identity"}],preInference:[...o5()],postInference:[]};const AS={fontSize:10,text:t=>t.data.name,position:"inside",fill:"#000",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>t.x1-t.x0},_S={title:t=>t.data.name,items:[{field:"value"}]},TS=(t,e)=>{var{width:e,height:n}=e,{data:r,encode:i={},scale:a,style:o={},layout:s={},labels:l=[],tooltip:c={}}=t,t=at(t,["data","encode","scale","style","layout","labels","tooltip"]),r=SS(r,ot({},(r=e,u=n,{tile:"treemapSquarify",ratio:.5*(1+Math.sqrt(5)),size:[r,u],round:!1,ignoreParentValue:!0,padding:0,paddingInner:0,paddingOuter:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,sort:(t,e)=>e.value-t.value,layer:0}),s),i),u=st(o,"label");return ot({},{type:"rect",axis:!1,encode:{x:"x",y:"y",color:t=>t.data.parent.name},scale:{x:{domain:[0,e],range:[0,1]},y:{domain:[0,n],range:[0,1]}},style:{stroke:"#fff"}},Object.assign(Object.assign({data:r,encode:i,scale:a,style:o,labels:[Object.assign(Object.assign({},AS),u),...l]},t),{tooltip:mv(c,_S),axis:!1}))},PS=(TS.props={},{text:"",position:"inside",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>2*t.r}),CS={title:t=>t.data.name,items:[{field:"value"}]},LS=(t,e)=>{var{width:e,height:n}=e,{data:r,encode:i={},scale:a={},style:o={},layout:s={},labels:l=[],tooltip:c={}}=t,t=at(t,["data","encode","scale","style","layout","labels","tooltip"]),u={type:"point",axis:!1,legend:!1,scale:{x:{domain:[0,e]},y:{domain:[0,n]},size:{type:"identity"}},encode:{x:"x",y:"y",size:"r",shape:"point"},style:{fill:i.color?void 0:t=>0===t.height?"#ddd":"#fff",stroke:i.color?void 0:t=>0===t.height?"":"#000"}},r=((t,e,n)=>{const r=n["value"];n=(Ne(t)?WE().path(e.path):sE)(t);return r?n.sum(t=>h5(r)(t)).sort(e.sort):n.count(),PE().size(e.size).padding(e.padding)(n),n.descendants()})(r,ot({},{size:[e,n],padding:0,sort:(t,e)=>e.value-t.value},s),ot({},u.encode,i)),e=st(o,"label");return ot({},u,Object.assign(Object.assign({data:r,encode:i,scale:a,style:o,labels:[Object.assign(Object.assign({},PS),e),...l]},t),{tooltip:mv(c,CS),axis:!1}))};function NS(t,e){return Yd(t,t=>e[t])}function jS(t,e){return Hd(t,t=>e[t])}function RS(t,e){const n=2.5*IS(t,e)-1.5*DS(t,e);return Yd(t,t=>e[t]>=n?e[t]:NaN)}function IS(t,e){return Xd(t,.25,t=>e[t])}function BS(t,e){return Xd(t,.5,t=>e[t])}function DS(t,e){return Xd(t,.75,t=>e[t])}function FS(t,e){const n=2.5*DS(t,e)-1.5*IS(t,e);return Hd(t,t=>e[t]<=n?e[t]:NaN)}function zS(){return(t,e)=>{var n=e["encode"],{y:n,x:r}=n;const i=n["value"],a=r["value"];return[Array.from(Sd(t,t=>a[+t]).values()).flatMap(t=>{const e=RS(t,i),n=FS(t,i);return t.filter(t=>i[t]<e||i[t]>n)}),e]}}LS.props={};const WS=t=>{var e,{data:n,encode:r,style:i={},tooltip:a={},animate:o}=t,t=at(t,["data","encode","style","tooltip","transform","animate"]),{point:s=!0}=i,i=at(i,["point"]),l=r["y"],l={y:l,y1:l,y2:l,y3:l,y4:l},c={y1:IS,y2:BS,y3:DS},u=yv(a,"box",{items:[{channel:"y",name:"min"},{channel:"y1",name:"q1"},{channel:"y2",name:"q2"},{channel:"y3",name:"q3"},{channel:"y4",name:"max"}]},!0),a=yv(a,"point",{title:{channel:"x"},items:[{name:"outlier",channel:"y"}]});return s?(s=st(i,"box"),e=st(i,"point"),[Object.assign({type:"box",data:n,transform:[Object.assign(Object.assign({type:"groupX",y:RS},c),{y4:FS})],encode:Object.assign(Object.assign({},r),l),style:s,tooltip:u,animate:bv(o,"box")},t),{type:"point",data:n,transform:[{type:zS}],encode:r,style:Object.assign({},e),tooltip:a,animate:bv(o,"point")}]):Object.assign({type:"box",data:n,transform:[Object.assign(Object.assign({type:"groupX",y:NS},c),{y4:jS})],encode:Object.assign(Object.assign({},r),l),style:i,tooltip:u},t)},GS=(WS.props={},s=>{var t=s["cartesian"];return t?u5:(t,e,n,r)=>{const{x:i,y:a}=n,o=l5(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}});function HS(t,e,n,r){if(!isNaN(e)&&!isNaN(n)){var i,a,o,s,l,c,u,h,f,d=t._root,p={data:r},g=t._x0,y=t._y0,m=t._x1,v=t._y1;if(d){for(;d.length;)if((c=e>=(a=(g+m)/2))?g=a:m=a,(u=n>=(o=(y+v)/2))?y=o:v=o,!(d=(i=d)[h=u<<1|c]))return i[h]=p,t;if(s=+t._x.call(null,d.data),l=+t._y.call(null,d.data),e===s&&n===l)p.next=d,i?i[h]=p:t._root=p;else{for(;i=i?i[h]=new Array(4):t._root=new Array(4),(c=e>=(a=(g+m)/2))?g=a:m=a,(u=n>=(o=(y+v)/2))?y=o:v=o,(h=u<<1|c)==(f=(o<=l)<<1|a<=s););i[f]=d,i[h]=p}}else t._root=p}return t}function VS(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function YS(t){return t[0]}function qS(t){return t[1]}function $S(t,e,n){e=new US(null==e?YS:e,null==n?qS:n,NaN,NaN,NaN,NaN);return null==t?e:e.addAll(t)}function US(t,e,n,r,i,a){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function XS(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}GS.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,shape:{shape:$y},channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...o5(),{type:ii},{type:fn},{type:Vo}]};tm=$S.prototype=US.prototype;function KS(t){return function(){return t}}function ZS(t){return 1e-6*(t()-.5)}function QS(t){return t.index}function JS(t,e){t=t.get(e);if(t)return t;throw new Error("node not found: "+e)}function t3(c){var u,h,a,o,f,d,s=QS,n=function(t){return 1/Math.min(o[t.source.index],o[t.target.index])},r=KS(30),p=1;function e(t){for(var e=0,n=c.length;e<p;++e)for(var r,i,a,o,s,l=0;l<n;++l)r=(i=c[l]).source,a=(i=i.target).x+i.vx-r.x-r.vx||ZS(d),o=i.y+i.vy-r.y-r.vy||ZS(d),a*=s=((s=Math.sqrt(a*a+o*o))-h[l])/s*t*u[l],o*=s,i.vx-=a*(s=f[l]),i.vy-=o*s,r.vx+=a*(s=1-s),r.vy+=o*s}function i(){if(a){var t,e=a.length,n=c.length,r=new Map(a.map((t,e)=>[s(t,e,a),t])),i=0;for(o=new Array(e);i<n;++i)(t=c[i]).index=i,"object"!=typeof t.source&&(t.source=JS(r,t.source)),"object"!=typeof t.target&&(t.target=JS(r,t.target)),o[t.source.index]=(o[t.source.index]||0)+1,o[t.target.index]=(o[t.target.index]||0)+1;for(i=0,f=new Array(n);i<n;++i)t=c[i],f[i]=o[t.source.index]/(o[t.source.index]+o[t.target.index]);u=new Array(n),l(),h=new Array(n),g()}}function l(){if(a)for(var t=0,e=c.length;t<e;++t)u[t]=+n(c[t],t,c)}function g(){if(a)for(var t=0,e=c.length;t<e;++t)h[t]=+r(c[t],t,c)}return null==c&&(c=[]),e.initialize=function(t,e){a=t,d=e,i()},e.links=function(t){return arguments.length?(c=t,i(),e):c},e.id=function(t){return arguments.length?(s=t,e):s},e.iterations=function(t){return arguments.length?(p=+t,e):p},e.strength=function(t){return arguments.length?(n="function"==typeof t?t:KS(+t),l(),e):n},e.distance=function(t){return arguments.length?(r="function"==typeof t?t:KS(+t),g(),e):r},e}tm.copy=function(){var t,e,n=new US(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(r)if(r.length)for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=XS(e));else n._root=XS(r);return n},tm.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return HS(this.cover(e,n),e,n,t)},tm.addAll=function(t){for(var e,n,r=t.length,i=new Array(r),a=new Array(r),o=1/0,s=1/0,l=-1/0,c=-1/0,u=0;u<r;++u)isNaN(e=+this._x.call(null,n=t[u]))||isNaN(n=+this._y.call(null,n))||((i[u]=e)<o&&(o=e),l<e&&(l=e),(a[u]=n)<s&&(s=n),c<n&&(c=n));if(!(l<o||c<s))for(this.cover(o,s).cover(l,c),u=0;u<r;++u)HS(this,i[u],a[u],t[u]);return this},tm.cover=function(t,e){if(!isNaN(t=+t)&&!isNaN(e=+e)){var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,a=(r=Math.floor(e))+1;else{for(var o,s,l=i-n||1,c=this._root;t<n||i<=t||e<r||a<=e;)switch(s=(e<r)<<1|t<n,(o=new Array(4))[s]=c,c=o,l*=2,s){case 0:i=n+l,a=r+l;break;case 1:n=i-l,a=r+l;break;case 2:i=n+l,r=a-l;break;case 3:n=i-l,r=a-l}this._root&&this._root.length&&(this._root=c)}this._x0=n,this._y0=r,this._x1=i,this._y1=a}return this},tm.data=function(){var e=[];return this.visit(function(t){if(!t.length)for(;e.push(t.data),t=t.next;);}),e},tm.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},tm.find=function(t,e,n){var r,i,a,o,s,l,c,u,h=this._x0,f=this._y0,d=this._x1,p=this._y1,g=[],y=this._root;for(y&&g.push(new VS(y,h,f,d,p)),null==n?n=1/0:(h=t-n,f=e-n,d=t+n,p=e+n,n*=n);r=g.pop();)!(y=r.node)||(s=r.x0)>d||(l=r.y0)>p||(o=r.x1)<h||(i=r.y1)<f||(y.length?(g.push(new VS(y[3],a=(s+o)/2,c=(l+i)/2,o,i),new VS(y[2],s,c,a,i),new VS(y[1],a,l,o,c),new VS(y[0],s,l,a,c)),(i=(c<=e)<<1|a<=t)&&(r=g[g.length-1],g[g.length-1]=g[g.length-1-i],g[g.length-1-i]=r)):(l=(o=t-+this._x.call(null,y.data))*o+(s=e-+this._y.call(null,y.data))*s)<n&&(h=t-(c=Math.sqrt(n=l)),f=e-c,d=t+c,p=e+c,u=y.data));return u},tm.remove=function(t){if(!isNaN(a=+this._x.call(null,t))&&!isNaN(o=+this._y.call(null,t))){var e,n,r,i,a,o,s,l,c,u,h,f=this._root,d=this._x0,p=this._y0,g=this._x1,y=this._y1;if(f){if(f.length)for(;;){if((l=a>=(s=(d+g)/2))?d=s:g=s,(c=o>=(s=(p+y)/2))?p=s:y=s,!(f=(e=f)[u=c<<1|l]))return this;if(!f.length)break;(e[u+1&3]||e[u+2&3]||e[u+3&3])&&(n=e,h=u)}for(;f.data!==t;)if(!(f=(r=f).next))return this;(i=f.next)&&delete f.next,r?i?r.next=i:delete r.next:e?(i?e[u]=i:delete e[u],(f=e[0]||e[1]||e[2]||e[3])&&f===(e[3]||e[2]||e[1]||e[0])&&!f.length&&(n?n[h]=f:this._root=f)):this._root=i}}return this},tm.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},tm.root=function(){return this._root},tm.size=function(){var e=0;return this.visit(function(t){if(!t.length)for(;++e,t=t.next;);}),e},tm.visit=function(t){var e,n,r,i,a,o,s,l=[],c=this._root;for(c&&l.push(new VS(c,this._x0,this._y0,this._x1,this._y1));a=l.pop();)!t(c=a.node,n=a.x0,r=a.y0,i=a.x1,a=a.y1)&&c.length&&(o=(n+i)/2,s=(r+a)/2,(e=c[3])&&l.push(new VS(e,o,s,i,a)),(e=c[2])&&l.push(new VS(e,n,s,o,a)),(e=c[1])&&l.push(new VS(e,o,r,i,s)),e=c[0])&&l.push(new VS(e,n,r,o,s));return this},tm.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new VS(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i,a,o,s,l,c,u,h=e.node;h.length&&(a=e.x0,o=e.y0,c=(a+(s=e.x1))/2,u=(o+(l=e.y1))/2,(i=h[0])&&n.push(new VS(i,a,o,c,u)),(i=h[1])&&n.push(new VS(i,c,o,s,u)),(i=h[2])&&n.push(new VS(i,a,u,c,l)),i=h[3])&&n.push(new VS(i,c,u,s,l)),r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},tm.x=function(t){return arguments.length?(this._x=t,this):this._x},tm.y=function(t){return arguments.length?(this._y=t,this):this._y};var e3={value:()=>{}};function n3(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new r3(r)}function r3(t){this._=t}function i3(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=e3,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}r3.prototype=n3.prototype={constructor:r3,on:function(t,e){var n,r,i=this._,a=(r=i,(t+"").trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");if(0<=n&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<s;)if(n=(t=a[o]).type)i[n]=i3(i[n],t.name,e);else if(null==e)for(n in i)i[n]=i3(i[n],t.name,null);return this}for(;++o<s;)if(n=(n=(t=a[o]).type)&&function(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}(i[n],t.name))return n},copy:function(){var t,e={},n=this._;for(t in n)e[t]=n[t].slice();return new r3(e)},call:function(t,e){if(0<(n=arguments.length-2))for(var n,r,i=new Array(n),a=0;a<n;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=0,n=(r=this._[t]).length;a<n;++a)r[a].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};var a3,o3,s3=0,l3=0,c3=0,u3=1e3,h3=0,f3=0,d3=0,p3="object"==typeof performance&&performance.now?performance:Date,g3="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function y3(){return f3||(g3(m3),f3=p3.now()+d3)}function m3(){f3=0}function v3(){this._call=this._time=this._next=null}function b3(t,e,n){var r=new v3;return r.restart(t,e,n),r}function x3(){f3=(h3=p3.now())+d3,s3=l3=0;try{y3(),++s3;for(var t,e=a3;e;)0<=(t=f3-e._time)&&e._call.call(void 0,t),e=e._next;--s3}finally{for(var n,r,i=a3,a=1/(s3=0);i;)i=i._call?(a>i._time&&(a=i._time),(n=i)._next):(r=i._next,i._next=null,n?n._next=r:a3=r);o3=n,M3(a),f3=0}}function w3(){var t=p3.now(),e=t-h3;u3<e&&(d3-=e,h3=t)}function M3(t){s3||(l3=l3&&clearTimeout(l3),24<t-f3?(t<1/0&&(l3=setTimeout(x3,t-p3.now()-d3)),c3=c3&&clearInterval(c3)):(c3||(h3=p3.now(),c3=setInterval(w3,u3)),s3=1,g3(x3)))}v3.prototype=b3.prototype={constructor:v3,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?y3():+n)+(null==e?0:+e),this._next||o3===this||(o3?o3._next=this:a3=this,o3=this),this._call=t,this._time=n,M3()},stop:function(){this._call&&(this._call=null,this._time=1/0,M3())}};const O3=4294967296;function k3(t){return t.x}function E3(t){return t.y}var S3=10,A3=Math.PI*(3-Math.sqrt(5));function _3(l){var a,o=1,e=.001,s=1-Math.pow(e,1/300),c=0,u=.6,h=new Map,t=b3(i),n=n3("tick","end"),r=function(){let t=1;return()=>(t=(1664525*t+1013904223)%O3)/O3}();function i(){f(),n.call("tick",a),o<e&&(t.stop(),n.call("end",a))}function f(t){var e,n,r=l.length;void 0===t&&(t=1);for(var i=0;i<t;++i)for(o+=(c-o)*s,h.forEach(function(t){t(o)}),e=0;e<r;++e)null==(n=l[e]).fx?n.x+=n.vx*=u:(n.x=n.fx,n.vx=0),null==n.fy?n.y+=n.vy*=u:(n.y=n.fy,n.vy=0);return a}function d(){for(var t,e,n,r=0,i=l.length;r<i;++r)(n=l[r]).index=r,null!=n.fx&&(n.x=n.fx),null!=n.fy&&(n.y=n.fy),(isNaN(n.x)||isNaN(n.y))&&(t=S3*Math.sqrt(.5+r),e=r*A3,n.x=t*Math.cos(e),n.y=t*Math.sin(e)),(isNaN(n.vx)||isNaN(n.vy))&&(n.vx=n.vy=0)}function p(t){return t.initialize&&t.initialize(l,r),t}return null==l&&(l=[]),d(),a={tick:f,restart:function(){return t.restart(i),a},stop:function(){return t.stop(),a},nodes:function(t){return arguments.length?(l=t,d(),h.forEach(p),a):l},alpha:function(t){return arguments.length?(o=+t,a):o},alphaMin:function(t){return arguments.length?(e=+t,a):e},alphaDecay:function(t){return arguments.length?(s=+t,a):+s},alphaTarget:function(t){return arguments.length?(c=+t,a):c},velocityDecay:function(t){return arguments.length?(u=1-t,a):1-u},randomSource:function(t){return arguments.length?(r=t,h.forEach(p),a):r},force:function(t,e){return 1<arguments.length?(null==e?h.delete(t):h.set(t,p(e)),a):h.get(t)},find:function(t,e,n){var r,i,a,o=0,s=l.length;for(null==n?n=1/0:n*=n,o=0;o<s;++o)(r=(r=t-(i=l[o]).x)*r+(r=e-i.y)*r)<n&&(a=i,n=r);return a},on:function(t,e){return 1<arguments.length?(n.on(t,e),a):n.on(t)}}}const T3={joint:!0},P3={type:"link",axis:!1,legend:!1,encode:{x:[t=>t.source.x,t=>t.target.x],y:[t=>t.source.y,t=>t.target.y]},style:{stroke:"#999",strokeOpacity:.6}},C3={type:"point",axis:!1,legend:!1,encode:{x:"x",y:"y",size:5,color:"group",shape:"point"},style:{stroke:"#fff"}},L3={text:""};function N3(t,e,n){var i,l,c,u,h,r,f,d,p,{nodes:t,links:a}=t,{joint:e,nodeStrength:o,linkStrength:s}=e,{linkKey:n=t=>t.id}=n,I=(r=KS(-30),d=(f=1)/0,p=.81,g.initialize=function(t,e){i=t,c=e,B()},g.strength=function(t){return arguments.length?(r="function"==typeof t?t:KS(+t),B(),g):r},g.distanceMin=function(t){return arguments.length?(f=t*t,g):Math.sqrt(f)},g.distanceMax=function(t){return arguments.length?(d=t*t,g):Math.sqrt(d)},g.theta=function(t){return arguments.length?(p=t*t,g):Math.sqrt(p)},g);function g(t){var e,n=i.length,r=$S(i,k3,E3).visitAfter(D);for(u=t,e=0;e<n;++e)l=i[e],r.visit(F)}function B(){if(i){var t,e,n=i.length;for(h=new Array(n),t=0;t<n;++t)e=i[t],h[e.index]=+r(e,t,i)}}function D(t){var e,n,r,i,a,o=0,s=0;if(t.length){for(r=i=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(o+=e.value,s+=n,r+=n*e.x,i+=n*e.y);t.x=r/s,t.y=i/s}else for((e=t).x=e.data.x,e.y=e.data.y;o+=h[e.data.index],e=e.next;);t.value=o}function F(t,e,n,r){if(!t.value)return!0;var i=t.x-l.x,a=t.y-l.y,o=r-e,s=i*i+a*a;if(o*o/p<s)return s<d&&(0===i&&(s+=(i=ZS(c))*i),0===a&&(s+=(a=ZS(c))*a),s<f&&(s=Math.sqrt(f*s)),l.vx+=i*t.value*u/s,l.vy+=a*t.value*u/s),!0;if(!(t.length||d<=s))for((t.data!==l||t.next)&&(0===i&&(s+=(i=ZS(c))*i),0===a&&(s+=(a=ZS(c))*a),s<f)&&(s=Math.sqrt(f*s));t.data!==l&&(o=h[t.data.index]*u/s,l.vx+=i*o,l.vy+=a*o),t=t.next;);}var y,m,v,b,x,w,M,O,k,E,S,A,_,T,n=t3(a).id(h5(n)),P=("function"==typeof o&&I.strength(o),"function"==typeof s&&n.strength(s),_3(t).force("link",n).force("charge",I));function C(t){for(var e,n=0,r=m.length;n<r;++n)(e=m[n]).vy+=(b[n]-e.y)*v[n]*t}function L(){if(m){var t,e=m.length;for(v=new Array(e),b=new Array(e),t=0;t<e;++t)v[t]=isNaN(b[t]=+y(m[t],t,m))?0:+x(m[t],t,m)}}function N(t){for(var e,n=0,r=M.length;n<r;++n)(e=M[n]).vx+=(k[n]-e.x)*O[n]*t}function j(){if(M){var t,e=M.length;for(O=new Array(e),k=new Array(e),t=0;t<e;++t)O[t]=isNaN(k[t]=+w(M[t],t,M))?0:+E(M[t],t,M)}}function R(){for(var t,e=_.length,n=0,r=0,i=0;i<e;++i)n+=(t=_[i]).x,r+=t.y;for(n=(n/e-S)*T,r=(r/e-A)*T,i=0;i<e;++i)(t=_[i]).x-=n,t.y-=r}e?P.force("center",(T=1,null==S&&(S=0),null==A&&(A=0),R.initialize=function(t){_=t},R.x=function(t){return arguments.length?(S=+t,R):S},R.y=function(t){return arguments.length?(A=+t,R):A},R.strength=function(t){return arguments.length?(T=+t,R):T},R)):P.force("x",(E=KS(.1),"function"!=typeof w&&(w=KS(null==w?0:+w)),N.initialize=function(t){M=t,j()},N.strength=function(t){return arguments.length?(E="function"==typeof t?t:KS(+t),j(),N):E},N.x=function(t){return arguments.length?(w="function"==typeof t?t:KS(+t),j(),N):w},N)).force("y",(x=KS(.1),"function"!=typeof y&&(y=KS(null==y?0:+y)),C.initialize=function(t){m=t,L()},C.strength=function(t){return arguments.length?(x="function"==typeof t?t:KS(+t),L(),C):x},C.y=function(t){return arguments.length?(y="function"==typeof t?t:KS(+t),L(),C):y},C)),P.stop();var z=Math.ceil(Math.log(P.alphaMin())/Math.log(1-P.alphaDecay()));for(let t=0;t<z;t++)P.tick();return{nodesData:t,linksData:a}}const j3=t=>{var{data:t,encode:e={},scale:n,style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={},tooltip:l={}}=t;const{nodeKey:c=t=>t.id,linkKey:u=t=>t.id}=e,h=at(e,["nodeKey","linkKey"]);var e=Object.assign({nodeKey:c,linkKey:u},h),f=st(e,"node"),d=st(e,"link"),{links:t,nodes:p}=d5(t,e),{nodesData:t,linksData:p}=N3({links:t,nodes:p},ot({},T3,i),e),i=yv(l,"link",{items:[t=>({name:"source",value:h5(u)(t.source)}),t=>({name:"target",value:h5(u)(t.target)})]}),e=yv(l,"node",{items:[t=>({name:"key",value:h5(c)(t)})]},!0);return[ot({},P3,{data:p,encode:d,labels:o,style:st(r,"link"),tooltip:i,animate:bv(s,"link")}),ot({},C3,{data:t,encode:Object.assign({},f),scale:n,style:st(r,"node"),tooltip:e,labels:[Object.assign(Object.assign({},L3),st(r,"label")),...a],animate:bv(s,"link")})]},R3=(j3.props={},h=>u=>t=>{const{field:e="value",nodeSize:n,separation:r,sortBy:i,as:a=["x","y"]}=u,[o,s]=a;var t=sE(t,t=>t.children).sum(t=>t[e]).sort(i),l=h();l.size([1,1]),n&&l.nodeSize(n),r&&l.separation(r),l(t);const c=[];t.each(t=>{t[o]=t.x,t[s]=t.y,t.name=t.data.name,c.push(t)});l=t.links();return l.forEach(t=>{t[o]=[t.source[o],t.target[o]],t[s]=[t.source[s],t.target[s]]}),{nodes:c,edges:l}}),I3=t=>R3(aE)(t),B3=(I3.props={},t=>R3(UE)(t)),D3=(B3.props={},{sortBy:(t,e)=>e.value-t.value}),F3={axis:!1,legend:!1,type:"point",encode:{x:"x",y:"y",size:2,shape:"point"}},z3={type:"link",encode:{x:"x",y:"y",shape:"smooth"}},W3={text:"",fontSize:10},G3=t=>{var{data:t,encode:e={},scale:n={},style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={},tooltip:l={}}=t,c=null==e?void 0:e.value,{nodes:i,edges:c}=B3(Object.assign(Object.assign(Object.assign({},D3),i),{field:c}))(t),t=yv(l,"node",{title:"name",items:["value"]},!0),l=yv(l,"link",{title:"",items:[t=>({name:"source",value:t.source.name}),t=>({name:"target",value:t.target.name})]});return[ot({},z3,{data:c,encode:st(e,"link"),scale:st(n,"link"),labels:o,style:Object.assign({stroke:"#999"},st(r,"link")),tooltip:l,animate:bv(s,"link")}),ot({},F3,{data:i,scale:st(n,"node"),encode:st(e,"node"),labels:[Object.assign(Object.assign({},W3),st(r,"label")),...a],style:Object.assign({},st(r,"node")),tooltip:t,animate:bv(s,"node")})]};G3.props={};var H3={},V3={},Y3=34,q3=10,$3=13;function U3(t){return new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'}).join(",")+"}")}function X3(t){var n=Object.create(null),r=[];return t.forEach(function(t){for(var e in t)e in n||r.push(n[e]=e)}),r}function K3(t,e){var t=t+"",n=t.length;return n<e?new Array(e-n+1).join(0)+t:t}function Z3(t){var e,n=t.getUTCHours(),r=t.getUTCMinutes(),i=t.getUTCSeconds(),a=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((e=t.getUTCFullYear())<0?"-"+K3(-e,6):9999<e?"+"+K3(e,6):K3(e,4))+"-"+K3(t.getUTCMonth()+1,2)+"-"+K3(t.getUTCDate(),2)+(a?"T"+K3(n,2)+":"+K3(r,2)+":"+K3(i,2)+"."+K3(a,3)+"Z":i?"T"+K3(n,2)+":"+K3(r,2)+":"+K3(i,2)+"Z":r||n?"T"+K3(n,2)+":"+K3(r,2)+"Z":"")}function Q3(r){var e=new RegExp('["'+r+"\n\r]"),h=r.charCodeAt(0);function n(r,t){var e,n=[],i=r.length,a=0,o=0,s=i<=0,l=!1;function c(){if(s)return V3;if(l)return l=!1,H3;var t,e,n=a;if(r.charCodeAt(n)===Y3){for(;a++<i&&r.charCodeAt(a)!==Y3||r.charCodeAt(++a)===Y3;);return(t=a)>=i?s=!0:(e=r.charCodeAt(a++))===q3?l=!0:e===$3&&(l=!0,r.charCodeAt(a)===q3)&&++a,r.slice(n+1,t-1).replace(/""/g,'"')}for(;a<i;){if((e=r.charCodeAt(t=a++))===q3)l=!0;else if(e===$3)l=!0,r.charCodeAt(a)===q3&&++a;else if(e!==h)continue;return r.slice(n,t)}return s=!0,r.slice(n,i)}for(r.charCodeAt(i-1)===q3&&--i,r.charCodeAt(i-1)===$3&&--i;(e=c())!==V3;){for(var u=[];e!==H3&&e!==V3;)u.push(e),e=c();t&&null==(u=t(u,o++))||n.push(u)}return n}function i(t,n){return t.map(function(e){return n.map(function(t){return o(e[t])}).join(r)})}function a(t){return t.map(o).join(r)}function o(t){return null==t?"":t instanceof Date?Z3(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,a){var o,s;return(t=n(t,function(t,e){if(o)return o(t,e-1);var n,r,i;s=t,o=a?(r=a,i=U3(n=t),function(t,e){return r(i(t),e,n)}):U3(t)})).columns=s||[],t},parseRows:n,format:function(t,e){return[(e=null==e?X3(t):e).map(o).join(r)].concat(i(t,e)).join("\n")},formatBody:function(t,e){return i(t,e=null==e?X3(t):e).join("\n")},formatRows:function(t){return t.map(a).join("\n")},formatRow:a,formatValue:o}}function J3(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;tA&&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 tA=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),eA=t=>{const{value:n,format:r=n.split(".").pop(),delimiter:i=",",autoType:a=!0}=t;return()=>X(void 0,void 0,void 0,function*(){var t,e=yield fetch(n);if("csv"===r)return t=yield e.text(),Q3(i).parse(t,a?J3:np);if("json"===r)return yield e.json();throw new Error(`Unknown format: ${r}.`)})};eA.props={};const nA=t=>{const{fields:n,key:r="key",value:i="value"}=t;return t=>{var e;return(e=n)&&0!==Object.keys(e).length?t.flatMap(e=>n.map(t=>Object.assign(Object.assign({},e),{[r]:t,[i]:e[t]}))):t}};nA.props={};const rA=t=>{const{callback:e=function(t){return null!=t&&!Number.isNaN(t)}}=t;return t=>t.filter(e)},iA=(rA.props={},t=>{const e=t["callback"];return t=>Array.isArray(t)?[...t].sort(e):t});iA.props={};const aA=t=>{const e=t["fields"];return t=>t.map(t=>{return[n,t=[]]=[t,e],t.reduce((t,e)=>(e in n&&(t[e]=n[e]),t),{});var n})};aA.props={};const oA=r=>t=>{return r&&0!==Object.keys(r).length?t.map(t=>Object.entries(t).reduce((t,[e,n])=>(t[r[e]||e]=n,t),{})):t};oA.props={};const sA=t=>{var r,{fields:t=[]}=t;r=!0;const e=t.map(t=>{var e,n;return Array.isArray(t)?([e,n=r]=t,[e,n]):[t,r]});return t=>{return[...t].sort((r,i)=>e.reduce((t,[e,n=!0])=>0!==t?t:n?r[e]<i[e]?-1:+(r[e]!==i[e]):r[e]>i[e]?-1:+(r[e]!==i[e]),0))}},lA=(sA.props={},t=>{const e=t["value"];return()=>e}),cA=(lA.props={},t=>{const{callback:e=np}=t;return t=>e(t)}),uA=(cA.props={},t=>{const{callback:e=np}=t;return t=>Array.isArray(t)?t.map(e):t});uA.props={};var hA=Object.freeze({__proto__:null,weight:function(t,e){return e.value-t.value},frequency:function(t,e){return e.frequency-t.frequency},id:function(t,e){return(""+t.id).localeCompare(""+e.id)},name:function(t,e){return(""+t.name).localeCompare(""+e.name)}});const fA={y:0,thickness:.05,weight:!1,marginRatio:.1,id:t=>t.id,source:t=>t.source,target:t=>t.target,sourceWeight:t=>t.value||1,targetWeight:t=>t.value||1,sortBy:null};function dA(t){const{y:c,thickness:u,weight:h,marginRatio:f,id:d,source:p,target:g,sourceWeight:y,targetWeight:m,sortBy:v}=Object.assign(Object.assign({},fA),t);return function(t){var e=t.nodes.map(t=>Object.assign({},t)),t=t.edges.map(t=>Object.assign({},t));{var n=e,r=t;r.forEach(t=>{t.source=p(t),t.target=g(t),t.sourceWeight=y(t),t.targetWeight=m(t)});const i=Sd(r,t=>t.source),a=Sd(r,t=>t.target);n.forEach(t=>{t.id=d(t);var e=i.has(t.id)?i.get(t.id):[],n=a.has(t.id)?a.get(t.id):[];t.frequency=e.length+n.length,t.value=ep(e,t=>t.sourceWeight)+ep(n,t=>t.targetWeight)})}if(r=e,(n="function"==typeof v?v:hA[v])&&r.sort(n),!(n=(r=e).length))throw ap("Invalid nodes: it's empty!");if(h){const o=f/(2*n),s=r.reduce((t,e)=>t+e.value,0);r.reduce((t,e)=>{e.weight=e.value/s,e.width=e.weight*(1-f),e.height=u;var n=o+t,r=n+e.width,i=c-u/2,a=i+u;return e.x=[n,r,r,n],e.y=[i,i,a,a],t+e.width+2*o},0)}else{const l=1/n;r.forEach((t,e)=>{t.x=(e+.5)*l,t.y=c})}return function(t,e){const r=new Map(t.map(t=>[t.id,t]));if(!h)return e.forEach(t=>{var e=p(t),n=g(t),e=r.get(e),n=r.get(n);e&&n&&(t.x=[e.x,n.x],t.y=[e.y,n.y])});e.forEach(t=>{t.x=[0,0,0,0],t.y=[c,c,c,c]});const s=Sd(e,t=>t.source),l=Sd(e,t=>t.target);t.forEach(n=>{const{width:r,value:i,id:t}=n;var e=s.get(t)||[],a=l.get(t)||[];let o=0;e.map(t=>{var e=t.sourceWeight/i*r;t.x[0]=n.x[0]+o,t.x[1]=n.x[0]+o+e,o+=e}),a.forEach(t=>{var e=t.targetWeight/i*r;t.x[3]=n.x[0]+o,t.x[2]=n.x[0]+o+e,o+=e})})}(e,t),{nodes:e,edges:t}}}const pA=e=>t=>dA(e)(t),gA=(pA.props={},Math.PI/180),yA=64,mA=2048;function vA(t){return t.text}function bA(){return"serif"}function xA(){return"normal"}function wA(t){return t.value}function MA(){return 90*~~(2*Math.random())}function OA(){return 1}function kA(){}function EA(t,o,r,s){if(!o.sprite){var l=t.context,c=t.ratio;l.clearRect(0,0,(yA<<5)/c,mA/c);let i=0,a=0,n=0;var u,h,f,d,e=r.length;for(--s;++s<e;){o=r[s],l.save(),l.font=o.style+" "+o.weight+" "+~~((o.size+1)/c)+"px "+o.font;let t=l.measureText(o.text+"m").width*c,e=o.size<<1;if(o.rotate?(d=Math.sin(o.rotate*gA),f=Math.cos(o.rotate*gA),u=t*f,h=t*d,f=e*f,d=e*d,t=Math.max(Math.abs(u+d),Math.abs(u-d))+31>>5<<5,e=~~Math.max(Math.abs(h+f),Math.abs(h-f))):t=t+31>>5<<5,e>n&&(n=e),i+t>=yA<<5&&(i=0,a+=n,n=0),a+e>=mA)break;l.translate((i+(t>>1))/c,(a+(e>>1))/c),o.rotate&&l.rotate(o.rotate*gA),l.fillText(o.text,0,0),o.padding&&(l.lineWidth=2*o.padding,l.strokeText(o.text,0,0)),l.restore(),o.width=t,o.height=e,o.xoff=i,o.yoff=a,o.x1=t>>1,o.y1=e>>1,o.x0=-o.x1,o.y0=-o.y1,o.hasText=!0,i+=t}for(var p=l.getImageData(0,0,(yA<<5)/c,mA/c).data,g=[];0<=--s;)if((o=r[s]).hasText){var y=o.width,m=y>>5;let n=o.y1-o.y0;for(let t=0;t<n*m;t++)g[t]=0;if(null==(i=o.xoff))return;a=o.yoff;let r=0,t=-1;for(let e=0;e<n;e++){for(let t=0;t<y;t++){var v=m*e+(t>>5),b=p[(a+e)*(yA<<5)+(i+t)<<2]?1<<31-t%32:0;g[v]|=b,r|=b}r?t=e:(o.y0++,n--,e--,a++)}o.y1=o.y0+t,o.sprite=g.slice(0,(o.y1-o.y0)*m)}}}function SA(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function AA(t){var e=[];let n=-1;for(;++n<t;)e[n]=0;return e}function _A(){return document.createElement("canvas")}function TA(t){return"function"==typeof t?t:function(){return t}}const PA={archimedean:SA,rectangular:function(t){const n=4*t[0]/t[1];let r=0,i=0;return function(t){var e=t<0?-1:1;switch(Math.sqrt(1+4*e*t)-e&3){case 0:r+=n;break;case 1:i+=4;break;case 2:r-=n;break;default:i-=4}return[r,i]}}};function CA(){let b=[256,256],r=vA,i=bA,p=wA,g=xA,y=MA,m=OA,x=SA,w=Math.random,v=kA,M=[],O=null,k=1/0;const E=xA,S=_A,A={};return A.start=function(){const[a,o]=b,s=((t=S()).width=t.height=1,e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2),t.width=(yA<<5)/e,t.height=mA/e,(t=t.getContext("2d")).fillStyle=t.strokeStyle="red",t.textAlign="center",{context:t,ratio:e}),l=A.board||AA((b[0]>>5)*b[1]),c=M.length,u=[],h=M.map(function(t,e,n){return t.text=r.call(this,t,e,n),t.font=i.call(this,t,e,n),t.style=E.call(this,t,e,n),t.weight=g.call(this,t,e,n),t.rotate=y.call(this,t,e,n),t.size=~~p.call(this,t,e,n),t.padding=m.call(this,t,e,n),t}).sort(function(t,e){return e.size-t.size});var t,e;let f=-1,d=A.board?[{x:0,y:0},{x:a,y:o}]:void 0;function n(){for(var t,e,n,r=Date.now();Date.now()-r<k&&++f<c;){var i=h[f];i.x=a*(w()+.5)>>1,i.y=o*(w()+.5)>>1,EA(s,i,h,f),i.hasText&&function(i,t,e){var n=t.x,r=t.y,a=Math.sqrt(b[0]*b[0]+b[1]*b[1]),o=x(b),s=w()<.5?1:-1;let l,c=-s,u,h;for(;(l=o(c+=s))&&(u=~~l[0],h=~~l[1],!(Math.min(Math.abs(u),Math.abs(h))>=a));)if(t.x=n+u,t.y=r+h,!(t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>b[0]||t.y+t.y1>b[1])&&(!e||!function(t,n,r){var i=t.sprite,a=t.width>>5,e=t.x-(a<<4),o=127&e,s=32-o,l=t.y1-t.y0;let c=(t.y+t.y0)*(r>>=5)+(e>>5),u;for(let e=0;e<l;e++){for(let t=u=0;t<=a;t++)if((u<<s|(t<a?(u=i[e*a+t])>>>o:0))&n[c+t])return 1;c+=r}}(t,i,b[0]))&&(!e||function(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}(t,e))){var f=t.sprite,d=t.width>>5,p=b[0]>>5,g=t.x-(d<<4),y=127&g,m=32-y,v=t.y1-t.y0;let n,r=(t.y+t.y0)*p+(g>>5);for(let e=0;e<v;e++){for(let t=n=0;t<=d;t++)i[r+t]|=n<<m|(t<d?(n=f[e*d+t])>>>y:0);r+=p}return delete t.sprite,1}return}(l,i,d)&&(v.call(null,"word",{cloud:A,word:i}),u.push(i),d?A.hasImage||(t=d,e=i,n=void 0,n=t[0],t=t[1],e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>t.x&&(t.x=e.x+e.x1),e.y+e.y1>t.y&&(t.y=e.y+e.y1)):d=[{x:i.x+i.x0,y:i.y+i.y0},{x:i.x+i.x1,y:i.y+i.y1}],i.x-=b[0]>>1,i.y-=b[1]>>1)}A._tags=u,A._bounds=d,f>=c&&(A.stop(),v.call(null,"end",{cloud:A,words:u,bounds:d}))}return O&&clearInterval(O),O=setInterval(n,0),n(),A},A.stop=function(){return O&&(clearInterval(O),O=null),A},A.createMask=t=>{var e=document.createElement("canvas"),[n,r]=b;if(n&&r){var i=n>>5,a=AA((n>>5)*r),e=(e.width=n,e.height=r,e.getContext("2d")),o=(e.drawImage(t,0,0,t.width,t.height,0,0,n,r),e.getImageData(0,0,n,r).data);for(let e=0;e<r;e++)for(let t=0;t<n;t++){var s=i*e+(t>>5),l=e*n+t<<2,l=250<=o[l]&&250<=o[1+l]&&250<=o[2+l]?1<<31-t%32:0;a[s]|=l}A.board=a,A.hasImage=!0}},A.timeInterval=function(t){k=null==t?1/0:t},A.words=function(t){M=t},A.size=function(t=[]){b=[+t[0],+t[1]]},A.text=function(t){r=TA(t)},A.font=function(t){i=TA(t)},A.fontWeight=function(t){g=TA(t)},A.rotate=function(t){y=TA(t)},A.spiral=function(t){x=PA[t]||t},A.fontSize=function(t){p=TA(t)},A.padding=function(t){m=TA(t)},A.random=function(t){w=TA(t)},A.on=function(t){v=TA(t)},A}const LA={size:[500,500],fontSize:[14,28]};function NA(r){return new Promise((t,e)=>{if(r instanceof HTMLImageElement)t(r);else if("string"==typeof r){const n=new Image;n.crossOrigin="anonymous",n.src=r,n.onload=()=>t(n),void(n.onerror=()=>{console.error(`'image ${r} load failed !!!'`),e()})}else e()})}const jA=f=>h=>X(void 0,void 0,void 0,function*(){var i,a,t=Object.assign({},LA,f),e=CA(),e=(i=e,a=t,yield{set(t,e,n){return void 0!==a[t]&&(e=e?e.call(null,a[t]):a[t],n?n.call(null,e):"function"==typeof i[t]?i[t](e):i[t]=e),this},setAsync(e,n,r){return X(this,void 0,void 0,function*(){var t;return void 0!==a[e]&&(t=n?yield n.call(null,a[e]):a[e],r?r.call(null,t):"function"==typeof i[e]?i[e](t):i[e]=t),this})}}.set("fontSize",t=>{var e=h.map(t=>t.value),n=t,t=[Yd(e),Hd(e)];if("function"==typeof n)return n;if(Array.isArray(n)){const[r,i]=n;if(!t)return()=>(i+r)/2;const[a,o]=t;return o===a?()=>(i+r)/2:({value:t})=>(i-r)/(o-a)*(t-a)+r}return()=>n}).set("font").set("fontStyle").set("fontWeight").set("padding").set("rotate").set("size").set("spiral").set("timeInterval").set("random").set("text").set("on").setAsync("imageMask",NA,e.createMask),e.words([...h]),e.start());const[r,o]=t.size;var t=[{x:0,y:0},{x:r,y:o}],{_bounds:e=t,_tags:t,hasImage:n}=e,t=t.map(t=>{var{x:e,y:n}=t,t=at(t,["x","y"]);return Object.assign(Object.assign({},t),{x:e+r/2,y:n+o/2})}),[{x:e,y:s},{x:l,y:c}]=e,u={text:"",value:0,opacity:0,fontSize:0};return t.push(Object.assign(Object.assign({},u),{x:n?0:e,y:n?0:s}),Object.assign(Object.assign({},u),{x:n?r:l,y:n?o:c})),t});function RA(e){return"string"==typeof e?t=>t[e]:e}jA.props={};const IA=t=>{const{join:e,on:n,select:i=[],as:a=i,unknown:o=NaN}=t;var[t,r]=n;const s=RA(r),l=RA(t),c=_d(e,([t])=>t,t=>s(t));return t=>t.map(t=>{const r=c.get(l(t));return Object.assign(Object.assign({},t),i.reduce((t,e,n)=>(t[a[n]]=r?r[e]:o,t),{}))})},BA=(IA.props={},t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)});BA.props={};var DA,FA,zA,WA,nm={exports:{}},Jy={exports:{}};function GA(t){return 1-Math.abs(t)}DA=(Ky=Jy).exports,Ky.exports.isNumber=function(t){return"number"==typeof t},Ky.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},Ky.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},Ky.exports.findMinMulti=function(t){for(var e=DA.findMin(t[0]),n=1;n<t.length;n++)e=Math.min(e,DA.findMin(t[n]));return e},Ky.exports.findMaxMulti=function(t){for(var e=DA.findMax(t[0]),n=1;n<t.length;n++)e=Math.max(e,DA.findMax(t[n]));return e},Ky.exports.inside=function(t,e,n){return t<=n&&n<=e},lm=nm,FA=Math.log(2),zA=lm.exports,WA=Jy.exports,lm.exports.getUnifiedMinMax=function(t,e){return zA.getUnifiedMinMaxMulti([t],e)},lm.exports.getUnifiedMinMaxMulti=function(t,e){var n=!1,r=!1,i=WA.isNumber((e=e||{}).width)?e.width:2,a=WA.isNumber(e.size)?e.size:50,o=WA.isNumber(e.min)?e.min:(n=!0,WA.findMinMulti(t)),e=WA.isNumber(e.max)?e.max:(r=!0,WA.findMaxMulti(t)),t=(e-o)/(a-1);return n&&(o-=2*i*t),r&&(e+=2*i*t),{min:o,max:e}},lm.exports.create=function(t,e){if(!t||0===t.length)return[];var n=WA.isNumber((e=e||{}).size)?e.size:50,o=WA.isNumber(e.width)?e.width:2,e=zA.getUnifiedMinMax(t,{size:n,width:o,min:e.min,max:e.max}),s=e.min,e=e.max-s,l=e/(n-1);if(0==e)return[{x:s,y:1}];for(var c=[],r=0;r<n;r++)c.push({x:s+r*l,y:0});var u=function(t,e){for(var n={},r=0,i=-e;i<=e;i++)r+=t(i/e),n[i]=r;return n}(GA,o),h=u[o],f=u[o-1]-u[o-2],d=0,i=(t.forEach(function(t){var e,n,r,i,a,t=Math.floor((t-s)/l);t+o<0||c.length<=t-o||(r=Math.max(t-o,0),e=t,n=Math.min(t+o,c.length-1),i=u[-o-1+(r=r-(t-o))]||0,a=u[-o-1+(t+o-n)]||0,i=h/(h-i-a),0<r&&(d+=i*(r-1)*f),a=Math.max(0,t-o+1),WA.inside(0,c.length-1,a)&&(c[a].y+=i*f),WA.inside(0,c.length-1,e+1)&&(c[e+1].y-=2*i*f),WA.inside(0,c.length-1,n+1)&&(c[n+1].y+=i*f))}),d),a=0,p=0;return c.forEach(function(t){a+=t.y,i+=a,t.y=i,p+=i}),0<p&&c.forEach(function(t){t.y/=p}),c},lm.exports.getExpectedValueFromPdf=function(t){var e;if(t&&0!==t.length)return e=0,t.forEach(function(t){e+=t.x*t.y}),e},lm.exports.getXWithLeftTailArea=function(t,e){if(t&&0!==t.length){for(var n=0,r=0,i=0;i<t.length&&!(e<=(n+=t[r=i].y));i++);return t[r].x}},lm.exports.getPerplexity=function(t){var n;if(t&&0!==t.length)return n=0,t.forEach(function(t){var e=Math.log(t.y);isFinite(e)&&(n+=t.y*e)}),n=-n/FA,Math.pow(2,n)};var HA=nm.exports;const VA=t=>{const{field:r,groupBy:n,as:e=["y","size"],min:i,max:a,size:o=10,width:s}=t,[l,c]=e;return t=>{return Array.from(Sd(t,e=>n.map(t=>e[t]).join("-")).values()).map(t=>{var e=HA.create(t.map(t=>t[r]),{min:i,max:a,size:o,width:s}),n=e.map(t=>t.x),e=e.map(t=>t.y);return Object.assign(Object.assign({},t[0]),{[l]:n,[c]:e})})}};VA.props={};var YA={exports:{}};function qA(t){for(var e=new Array(t),n=0;n<t;++n)e[n]=0;return e}function $A(t,e){for(var n=0,r=0;r<t.length;++r)n+=t[r]*e[r];return n}function UA(t){return Math.sqrt($A(t,t))}function XA(t,e,n){for(var r=0;r<e.length;++r)t[r]=e[r]*n}function KA(t,e,n,r,i){for(var a=0;a<t.length;++a)t[a]=e*n[a]+r*i[a]}function ZA(i,a,o,s,l,c,u){var h=o.fx,f=$A(o.fxprime,a),d=h,t=h,p=f,e=0;function n(t,e,n){for(var r=0;r<16;++r)if(l=(t+e)/2,KA(s.x,1,o.x,l,a),d=s.fx=i(s.x,s.fxprime),p=$A(s.fxprime,a),h+c*l*f<d||n<=d)e=l;else{if(Math.abs(p)<=-u*f)return l;0<=p*(e-t)&&(e=t),t=l,n=d}return 0}l=l||1,c=c||1e-6,u=u||.1;for(var r=0;r<10;++r){if(KA(s.x,1,o.x,l,a),d=s.fx=i(s.x,s.fxprime),p=$A(s.fxprime,a),h+c*l*f<d||r&&t<=d)return n(e,l,t);if(Math.abs(p)<=-u*f)return l;if(0<=p)return n(l,e,d);t=d,e=l,l*=2}return l}(sm=sm=YA.exports).bisect=function(t,e,n,r){var i=(r=r||{}).maxIterations||100,a=r.tolerance||1e-10,o=t(e),r=t(n),s=n-e;if(0<o*r)throw"Initial bisect points must have opposite signs";if(0===o)return e;if(0===r)return n;for(var l=0;l<i;++l){var c=e+(s/=2),u=t(c);if(0<=u*o&&(e=c),Math.abs(s)<a||0===u)return c}return e+s},sm.nelderMead=function(t,e,n){var r,i=(n=n||{}).maxIterations||200*e.length,a=n.nonZeroDelta||1.05,o=n.zeroDelta||.001,s=n.minErrorDelta||1e-6,l=n.minErrorDelta||1e-5,c=void 0!==n.rho?n.rho:1,u=void 0!==n.chi?n.chi:2,h=void 0!==n.psi?n.psi:-.5,f=void 0!==n.sigma?n.sigma:.5,d=e.length,p=new Array(d+1);p[0]=e,p[0].fx=t(e);for(var g=p[0].id=0;g<d;++g){var y=e.slice();y[g]=y[g]?y[g]*a:o,p[g+1]=y,p[g+1].fx=t(y),p[g+1].id=g+1}function m(t){for(var e=0;e<t.length;e++)p[d][e]=t[e];p[d].fx=t.fx}for(var v=function(t,e){return t.fx-e.fx},b=e.slice(),x=e.slice(),w=e.slice(),M=e.slice(),O=0;O<i;++O){for(p.sort(v),n.history&&((E=p.map(function(t){var e=t.slice();return e.fx=t.fx,e.id=t.id,e})).sort(function(t,e){return t.id-e.id}),n.history.push({x:p[0].slice(),fx:p[0].fx,simplex:E})),g=r=0;g<d;++g)r=Math.max(r,Math.abs(p[0][g]-p[1][g]));if(Math.abs(p[0].fx-p[d].fx)<s&&r<l)break;for(g=0;g<d;++g){for(var k=b[g]=0;k<d;++k)b[g]+=p[k][g];b[g]/=d}var E=p[d];if(KA(x,1+c,b,-c,E),x.fx=t(x),x.fx<p[0].fx)KA(M,1+u,b,-u,E),M.fx=t(M),M.fx<x.fx?m(M):m(x);else if(x.fx>=p[d-1].fx){var S=!1;if(x.fx>E.fx?(KA(w,1+h,b,-h,E),w.fx=t(w),w.fx<E.fx?m(w):S=!0):(KA(w,1-h*c,b,h*c,E),w.fx=t(w),w.fx<x.fx?m(w):S=!0),S){if(1<=f)break;for(g=1;g<p.length;++g)KA(p[g],1-f,p[0],f,p[g]),p[g].fx=t(p[g])}}else m(x)}return p.sort(v),{fx:p[0].fx,x:p[0]}},sm.conjugateGradient=function(t,e,n){var r,i,a={x:e.slice(),fx:0,fxprime:e.slice()},o={x:e.slice(),fx:0,fxprime:e.slice()},s=e.slice(),l=1;i=(n=n||{}).maxIterations||20*e.length,a.fx=t(a.x,a.fxprime),XA(r=a.fxprime.slice(),a.fxprime,-1);for(var c=0;c<i;++c){var u;if(l=ZA(t,r,a,o,l),n.history&&n.history.push({x:a.x.slice(),fx:a.fx,fxprime:a.fxprime.slice(),alpha:l}),l?(KA(s,1,o.fxprime,-1,a.fxprime),u=$A(a.fxprime,a.fxprime),u=Math.max(0,$A(s,o.fxprime)/u),KA(r,u,r,-1,o.fxprime),u=a,a=o,o=u):XA(r,a.fxprime,-1),UA(a.fxprime)<=1e-5)break}n.history&&n.history.push({x:a.x.slice(),fx:a.fx,fxprime:a.fxprime.slice(),alpha:l});return a},sm.gradientDescent=function(t,e,n){for(var r=(n=n||{}).maxIterations||100*e.length,i=n.learnRate||.001,a={x:e.slice(),fx:0,fxprime:e.slice()},o=0;o<r&&(a.fx=t(a.x,a.fxprime),n.history&&n.history.push({x:a.x.slice(),fx:a.fx,fxprime:a.fxprime.slice()}),KA(a.x,1,a.x,-i,a.fxprime),!(UA(a.fxprime)<=1e-5));++o);return a},sm.gradientDescentLineSearch=function(t,e,n){n=n||{};var r,i={x:e.slice(),fx:0,fxprime:e.slice()},a={x:e.slice(),fx:0,fxprime:e.slice()},o=n.maxIterations||100*e.length,s=n.learnRate||1,l=e.slice(),c=n.c1||.001,u=n.c2||.1,h=[];{var f;n.history&&(f=t,t=function(t,e){return h.push(t.slice()),f(t,e)})}i.fx=t(i.x,i.fxprime);for(var d=0;d<o&&(XA(l,i.fxprime,-1),s=ZA(t,l,i,a,s,c,u),n.history&&(n.history.push({x:i.x.slice(),fx:i.fx,fxprime:i.fxprime.slice(),functionCalls:h,learnRate:s,alpha:s}),h=[]),r=i,i=a,a=r,!(0===s||UA(i.fxprime)<1e-5));++d);return i},sm.zeros=qA,sm.zerosM=function(t,e){return qA(t).map(function(){return qA(e)})},sm.norm2=UA,sm.weightedSum=KA,sm.scale=XA;const QA=1e-10;function JA(a,t){var e=function(t){var r=[];for(let n=0;n<t.length;++n)for(let e=n+1;e<t.length;++e){var i=r4(t[n],t[e]);for(let t=0;t<i.length;++t){var a=i[t];a.parentIndex=[n,e],r.push(a)}}return r}(a),n=e.filter(function(t){var e=t,n=a;for(let t=0;t<n.length;++t)if(e4(e,n[t])>n[t].radius+QA)return!1;return!0});let o=0,s=0,l;var c=[];if(1<n.length){var r=function(e){var n={x:0,y:0};for(let t=0;t<e.length;++t)n.x+=e[t].x,n.y+=e[t].y;return n.x/=e.length,n.y/=e.length,n}(n);for(l=0;l<n.length;++l){var u=n[l];u.angle=Math.atan2(u.x-r.x,u.y-r.y)}n.sort(function(t,e){return e.angle-t.angle});let i=n[n.length-1];for(l=0;l<n.length;++l){var h=n[l],f=(s+=(i.x+h.x)*(h.y-i.y),{x:(h.x+i.x)/2,y:(h.y+i.y)/2});let r=null;for(let n=0;n<h.parentIndex.length;++n)if(-1<i.parentIndex.indexOf(h.parentIndex[n])){var d=a[h.parentIndex[n]],p=Math.atan2(h.x-d.x,h.y-d.y),g=Math.atan2(i.x-d.x,i.y-d.y);let t=g-p;t<0&&(t+=2*Math.PI);p=g-t/2;let e=e4(f,{x:d.x+d.radius*Math.sin(p),y:d.y+d.radius*Math.cos(p)});e>2*d.radius&&(e=2*d.radius),(null===r||r.width>e)&&(r={circle:d,width:e,p1:h,p2:i})}null!==r&&(c.push(r),o+=t4(r.circle.radius,r.width),i=h)}}else{let t=a[0];for(l=1;l<a.length;++l)a[l].radius<t.radius&&(t=a[l]);let e=!1;for(l=0;l<a.length;++l)if(e4(a[l],t)>Math.abs(t.radius-a[l].radius)){e=!0;break}e?o=s=0:(o=t.radius*t.radius*Math.PI,c.push({circle:t,p1:{x:t.x,y:t.y+t.radius},p2:{x:t.x-QA,y:t.y+t.radius},width:2*t.radius}))}return s/=2,t&&(t.area=o+s,t.arcArea=o,t.polygonArea=s,t.arcs=c,t.innerPoints=n,t.intersectionPoints=e),o+s}function t4(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function e4(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function n4(t,e,n){var r;return t+e<=n?0:n<=Math.abs(t-e)?Math.PI*Math.min(t,e)*Math.min(t,e):(r=e-(n*n-t*t+e*e)/(2*n),t4(t,t-(n*n-e*e+t*t)/(2*n))+t4(e,r))}function r4(t,e){var n,r,i=e4(t,e),a=t.radius,o=e.radius;return a+o<=i||i<=Math.abs(a-o)?[]:(o=(a*a-o*o+i*i)/(2*i),a=Math.sqrt(a*a-o*o),n=t.x+o*(e.x-t.x)/i,o=t.y+o*(e.y-t.y)/i,[{x:n+(r=-(e.y-t.y)*(a/i)),y:o-(e=-(e.x-t.x)*(a/i))},{x:n-r,y:o+e}])}function i4(t,e){(e=e||{}).maxIterations=e.maxIterations||500;var n=e.initialLayout||s4;const i=e.lossFunction||l4,a=n(t=function(t){t=t.slice();var e=[],n={};let r,i,a,o;for(r=0;r<t.length;++r){var s=t[r];1==s.sets.length?e.push(s.sets[0]):2==s.sets.length&&(a=s.sets[0],o=s.sets[1],n[[a,o]]=!0,n[[o,a]]=!0)}for(e.sort((t,e)=>e<t?1:-1),r=0;r<e.length;++r)for(a=e[r],i=r+1;i<e.length;++i)o=e[i],[a,o]in n||t.push({sets:[a,o],size:0});return t}(t),e),r=[],o=[];let s;for(s in a)a.hasOwnProperty(s)&&(r.push(a[s].x),r.push(a[s].y),o.push(s));var l=YA.exports.nelderMead(function(e){var n={};for(let t=0;t<o.length;++t){var r=o[t];n[r]={x:e[2*t],y:e[2*t+1],radius:a[r].radius}}return i(n,t)},r,e).x;for(let t=0;t<o.length;++t)s=o[t],a[s].x=l[2*t],a[s].y=l[2*t+1];return a}const a4=1e-10;function o4(e,n,r){return Math.min(e,n)*Math.min(e,n)*Math.PI<=r+a4?Math.abs(e-n):YA.exports.bisect(function(t){return n4(e,n,t)-r},0,e+n)}function s4(t,e){let n=function(r,t){const i=t&&t.lossFunction?t.lossFunction:l4,a={},o={};let s;for(let t=0;t<r.length;++t){var e=r[t];1==e.sets.length&&(s=e.sets[0],a[s]={x:1e10,y:1e10,rowid:Object.keys(a).length,size:e.size,radius:Math.sqrt(e.size/Math.PI)},o[s]=[])}r=r.filter(function(t){return 2==t.sets.length});for(let e=0;e<r.length;++e){var n=r[e];let t=n.hasOwnProperty("weight")?n.weight:1;var l=n.sets[0],c=n.sets[1];n.size+a4>=Math.min(a[l].size,a[c].size)&&(t=0),o[l].push({set:c,size:n.size,weight:t}),o[c].push({set:l,size:n.size,weight:t})}var u=[];for(s in o)if(o.hasOwnProperty(s)){let e=0;for(let t=0;t<o[s].length;++t)e+=o[s][t].size*o[s][t].weight;u.push({set:s,size:e})}function h(t,e){return e.size-t.size}u.sort(h);const f={};function d(t){return t.set in f}function p(t,e){a[e].x=t.x,a[e].y=t.y,f[e]=!0}p({x:0,y:0},u[0].set);for(let t=1;t<u.length;++t){var g=u[t].set,y=o[g].filter(d);if(s=a[g],y.sort(h),0===y.length)throw"ERROR: missing pairwise overlap information";var m=[];for(let e=0;e<y.length;++e){var v=a[y[e].set],b=o4(s.radius,v.radius,y[e].size);m.push({x:v.x+b,y:v.y}),m.push({x:v.x-b,y:v.y}),m.push({y:v.y+b,x:v.x}),m.push({y:v.y-b,x:v.x});for(let t=e+1;t<y.length;++t){var x=a[y[t].set],w=o4(s.radius,x.radius,y[t].size),M=r4({x:v.x,y:v.y,radius:b},{x:x.x,y:x.y,radius:w});for(let t=0;t<M.length;++t)m.push(M[t])}}let e=1e50,n=m[0];for(let t=0;t<m.length;++t){a[g].x=m[t].x,a[g].y=m[t].y;var O=i(a,r);O<e&&(e=O,n=m[t])}p(n,g)}return a}(t,e);var r=e.lossFunction||l4;return n=8<=t.length&&r(e=function(t,e){var n=(e=e||{}).restarts||10,r=[],i={};let a;for(a=0;a<t.length;++a){var o=t[a];1==o.sets.length&&(i[o.sets[0]]=r.length,r.push(o))}var s=function(t,a,o){const s=YA.exports.zerosM(a.length,a.length),l=YA.exports.zerosM(a.length,a.length);return t.filter(function(t){return 2==t.sets.length}).map(function(t){var e=o[t.sets[0]],n=o[t.sets[1]],r=o4(Math.sqrt(a[e].size/Math.PI),Math.sqrt(a[n].size/Math.PI),t.size);s[e][n]=s[n][e]=r;let i=0;t.size+1e-10>=Math.min(a[e].size,a[n].size)?i=1:t.size<=1e-10&&(i=-1),l[e][n]=l[n][e]=i}),{distances:s,constraints:l}}(t,r,i);let y=s.distances;function l(t,r){{var i=t,a=r,o=y,s=m;let e=0,n;for(n=0;n<a.length;++n)a[n]=0;for(n=0;n<o.length;++n){var l=i[2*n],c=i[2*n+1];for(let t=n+1;t<o.length;++t){var u=i[2*t],h=i[2*t+1],f=o[n][t],d=s[n][t],p=(u-l)*(u-l)+(h-c)*(h-c),g=Math.sqrt(p),p=p-f*f;0<d&&g<=f||d<0&&f<=g||(e+=2*p*p,a[2*n]+=4*p*(l-u),a[2*n+1]+=4*p*(c-h),a[2*t]+=4*p*(u-l),a[2*t+1]+=4*p*(h-c))}}return e}}const m=s.constraints,c=YA.exports.norm2(y.map(YA.exports.norm2))/y.length;y=y.map(function(t){return t.map(function(t){return t/c})});let u,h;for(a=0;a<n;++a){var f=YA.exports.zeros(2*y.length).map(Math.random);h=YA.exports.conjugateGradient(l,f,e),(!u||h.fx<u.fx)&&(u=h)}var d=u.x,p={};for(a=0;a<r.length;++a){var g=r[a];p[g.sets[0]]={x:d[2*a]*c,y:d[2*a+1]*c,radius:Math.sqrt(g.size/Math.PI)}}if(e.history)for(a=0;a<e.history.length;++a)YA.exports.scale(e.history[a].x,c);return p}(t,e),t)+1e-8<r(n,t)?e:n}function l4(n,r){let i=0;for(let e=0;e<r.length;++e){var a,o,s=r[e];let t;1!=s.sets.length&&(t=2==s.sets.length?(o=n[s.sets[0]],a=n[s.sets[1]],n4(o.radius,a.radius,e4(o,a))):JA(s.sets.map(function(t){return n[t]})),o=s.hasOwnProperty("weight")?s.weight:1,i+=o*(t-s.size)*(t-s.size))}return i}function c4(t){function e(e){return{max:Math.max.apply(null,t.map(function(t){return t[e]+t.radius})),min:Math.min.apply(null,t.map(function(t){return t[e]-t.radius}))}}return{xRange:e("x"),yRange:e("y")}}const u4=t=>{const{sets:e="sets",size:n="size",as:r=["key","path"],padding:o=0}=t,[s,l]=r;return t=>{t=t.map(t=>Object.assign(Object.assign({},t),{sets:t[e],size:t[n],[s]:t.sets.join("&")}));t.sort((t,e)=>t.sets.length-e.sets.length);const i=i4(t);let a;return t.map(t=>{const r=t[e];return Object.assign(Object.assign({},t),{[l]:({width:t,height:e})=>{a=a||function(t,e,n,r){var i=[],a=[];for(const g in t)t.hasOwnProperty(g)&&(a.push(g),i.push(t[g]));e-=2*r,n-=2*r;var o=(l=c4(i)).xRange,s=l.yRange;if(o.max==o.min||s.max==s.min)return console.log("not scaling solution: zero size detected"),t;var l=e/(o.max-o.min),c=n/(s.max-s.min),u=Math.min(c,l),h=(e-(o.max-o.min)*u)/2,f=(n-(s.max-s.min)*u)/2,d={};for(let t=0;t<i.length;++t){var p=i[t];d[a[t]]={radius:u*p.radius,x:r+h+(p.x-o.min)*u,y:r+f+(p.y-s.min)*u}}return d}(i,t,e,o);let n=function(t){var e={},n=(JA(t,e),e.arcs);if(0===n.length)return"M 0 0";if(1==n.length)return t=n[0].circle,e=t.x,r=t.y,t=t.radius,(i=[]).push("M",e-=t,r),i.push("A",t,t,0,1,0,e+2*t,r),i.push("A",t,t,0,1,0,e,r),i.join(" ");var r,i,a=["\nM",n[0].p2.x,n[0].p2.y];for(let t=0;t<n.length;++t){var o=n[t],s=o.circle.radius,l=o.width>s;a.push("\nA",s,s,0,l?1:0,1,o.p1.x,o.p1.y)}return a.join(" ")}(r.map(t=>a[t]));return/[zZ]$/.test(n)||(n+=" Z"),n}})})}};u4.props={};const h4=(l,c)=>X(void 0,void 0,void 0,function*(){var{width:t,height:e}=c,{data:n,encode:r={},scale:i,style:a={},layout:o={}}=l,s=at(l,["data","encode","scale","style","layout"]),n=function(t,e){const{text:n="text",value:r="value"}=e;return t.map(t=>Object.assign(Object.assign({},t),{text:t[n],value:t[r]}))}(n,r),o=yield jA(Object.assign(Object.assign({},{size:[t,e]}),o))(n);return ot({},{axis:!1,type:"text",encode:{x:"x",y:"y",text:"text",rotate:"rotate",fontSize:"size"},scale:{x:{domain:[0,t],range:[0,1]},y:{domain:[0,e],range:[0,1]},fontSize:{type:"identity"},rotate:{type:"identity"}},style:{textAlign:"center"}},Object.assign(Object.assign({data:o,encode:r,scale:i,style:a},s),{axis:!1}))});h4.props={};const f4={coordinate:{type:"radial",innerRadius:.9,outerRadius:1,startAngle:-1.1*Math.PI,endAngle:.1*Math.PI},axis:{x:!1},legend:!1,tooltip:!1,encode:{x:"x",y:"y",color:"color"},scale:{color:{range:["#30BF78","#D0D0D0"]}}},d4={style:{shape:(t,e)=>{const l=t["radius"],c=at(t,["shape","radius"]);var t=st(c,"pointer"),n=st(c,"pin");const u=t["shape"],h=at(t,["shape"]),f=n["shape"],d=at(n,["shape"]),{coordinate:p,theme:g}=e;return(t,e)=>{var t=t.map(t=>p.invert(t)),[n,r,i]=function(t,e){var[,...t]=(t=t.getOptions()["transformations"]).find(t=>t[0]===e);return t}(p,"polar");const a=p.clone();var o=e["color"],n=Fp({startAngle:n,endAngle:r,innerRadius:i,outerRadius:l});n.push(["cartesian"]),a.update({transformations:n});const s=t.map(t=>a.map(t));var[r,i]=Px(s),[n,t]=p.getCenter(),r=Object.assign(Object.assign({x1:r,y1:i,x2:n,y2:t,stroke:o},h),c),i=Object.assign(Object.assign({cx:n,cy:t,stroke:o},d),c),n=lt(new fc);return fp(u)||("function"==typeof u?n.append(()=>u(s,e,a,g)):n.append("line").call(L,r).node()),fp(f)||("function"==typeof f?n.append(()=>f(s,e,a,g)):n.append("circle").call(L,i).node()),n.node()}},lineWidth:4,pointerLineCap:"round",pinR:10,pinFill:"#fff",radius:.6}},p4={type:"text",style:{x:"50%",y:"60%",textAlign:"center",textBaseline:"middle",fontSize:20,fontWeight:800,fill:"#888"}};const g4=t=>{var n,{data:e={},scale:r={},style:i={},animate:a={}}=t,t=at(t,["data","scale","style","animate","transform"]),{targetData:e,totalData:r,target:o,total:s,scale:l}=function(t,e){const{name:n="score",target:r,total:i,percent:a,thresholds:o=[]}=t;var t=a||r,s=a?1:i,e=Object.assign({y:{domain:[0,s]}},e);return o.length?{targetData:[{x:n,y:t,color:"target"}],totalData:o.map((t,e)=>({x:n,y:1<=e?t-o[e-1]:t,color:e})),target:t,total:s,scale:e}:{targetData:[{x:n,y:t,color:"target"}],totalData:[{x:n,y:t,color:"target"},{x:n,y:s-t,color:"total"}],target:t,total:s,scale:e}}(e,r),c=st(i,"text"),u=(n=["pointer","pin"],Object.fromEntries(Object.entries(i).filter(([e])=>n.find(t=>e.startsWith(t)))));return[ot({},f4,Object.assign({type:"interval",transform:[{type:"stackY"}],data:r,scale:l,style:st(i,"arc"),animate:"object"==typeof a?st(a,"arc"):a},t)),ot({},f4,d4,Object.assign({type:"point",data:e,scale:l,style:u,animate:"object"==typeof a?st(a,"indicator"):a},t)),ot({},p4,{style:Object.assign({text:([r,{target:i,total:e}]=[c,{target:o,total:s}],(r=r.content)?r(i,e):i.toString())},c),animate:"object"==typeof a?st(a,"text"):a})]};g4.props={};rm={density:Go};const y4=()=>(i,t,e,a)=>{const{x:o,series:s}=e,l=Object.entries(e).filter(([t])=>t.startsWith("y")).map(([,t])=>t),c=Object.entries(e).filter(([t])=>t.startsWith("size")).map(([,t])=>t);if(void 0===o||void 0===l||void 0===c)throw new Error("Missing encode for x or y or size channel.");const u=t.x,h=t.series;e=Array.from(i,n=>{var t=u.getBandWidth(u.invert(+o[n])),e=t*(h?h.getBandWidth(h.invert(+(null===s||void 0===s?void 0:s[n]))):1),t=(+(null===s||void 0===s?void 0:s[n])||0)*t;const r=+o[n]+t+e/2;return[...l.map((t,e)=>[r+ +c[e][n]/i.length,+l[e][n]]),...l.map((t,e)=>[r-+c[e][n]/i.length,+l[e][n]]).reverse()].map(t=>a.map(t))});return[i,e]};y4.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,shape:rm,channels:[...n5({shapes:Object.keys(rm)}),{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:[...o5(),{type:_l},{type:Rl}],postInference:[...i5()],interaction:{shareTooltip:!0}};cm={heatmap:Yy};const m4=t=>(t,e,n,r)=>{const{x:i,y:a,size:o,color:s}=n;return[[0],[Array.from(t,t=>{var e=o?+o[t]:40;return[...r.map([+i[t],+a[t]]),s[t],e]})]]},v4=(m4.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,shape:cm,channels:[...n5({shapes:Object.keys(cm)}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...o5(),{type:Rl},{type:zl}],postInference:[...r5()]},()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"]),b4=(v4.props={},()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"]),x4=(b4.props={},t=>new cg(t)),w4=(x4.props={},t=>new wg(t)),M4=(w4.props={},t=>new sg(t)),O4=(M4.props={},t=>new yg(t)),k4=(O4.props={},t=>new Mg(t)),E4=(k4.props={},t=>new Hg(t)),S4=(E4.props={},t=>new _g(t)),A4=(S4.props={},t=>new kg(t)),_4=(A4.props={},t=>new Sg(t)),T4=(_4.props={},t=>new Cg(t)),P4=(T4.props={},t=>new Tg(t)),C4=(P4.props={},t=>new Eg(t)),L4=(C4.props={},t=>new Yg(t)),N4=(L4.props={},t=>new hg(t)),j4=(N4.props={},{BLACK:"#000",WHITE:"#fff",STROKE:"#416180"}),R4="#5B8FF9",I4=t=>{var e={color:R4,size:1,category10:"category10",category20:"category20",enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},view:{viewFill:"transparent",plotFill:"transparent",mainFill:"transparent",contentFill:"transparent"},line:{line:{fill:"",strokeOpacity:1,lineWidth:1}},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:j4.BLACK,lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:12,strokeWidth:0,connectorStroke:j4.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:j4.STROKE,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:j4.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:j4.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:j4.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:j4.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:j4.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:j4.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:j4.STROKE,endMarkerFillOpacity:.95}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:.5,gridStroke:j4.BLACK,gridStrokeOpacity:.05,labelAlign:"horizontal",labelFill:j4.BLACK,labelFillOpacity:.65,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:8,line:!1,lineLineWidth:.5,lineStroke:j4.BLACK,lineStrokeOpacity:.45,tickLength:4,tickLineWidth:1,tickStroke:j4.BLACK,tickStrokeOpacity:.25,titleFill:j4.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,titleTransformOrigin:"center"},axisTop:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"top",titleSpacing:0,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,labelAutoRotate:!0,tickDirection:"positive",titlePosition:"bottom",titleSpacing:10,titleTextBaseline:"bottom"},axisLeft:{gridDirection:"positive",labelAutoRotate:!1,labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"left",titleSpacing:10,titleTextBaseline:"middle",titleDirection:"vertical",titleTransformOrigin:"center"},axisRight:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"right",titleSpacing:0,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:j4.BLACK,itemLabelFillOpacity:.65,itemLabelFontSize:12,itemLabelFontWeight:"lighter",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,8],itemValueFill:j4.BLACK,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"lighter",navButtonFill:j4.BLACK,navButtonFillOpacity:.65,navPageNumFill:j4.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!0,titleFill:j4.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:j4.BLACK,tickStrokeOpacity:.25,rowPadding:0,colPadding:8},legendContinuous:{handleHeight:12,handleLabelFill:j4.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:j4.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:j4.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:j4.BLACK,labelFillOpacity:.45,labelFontSize:12,labelFontWeight:"lighter",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:.65,tickStroke:j4.BLACK,tickStrokeOpacity:.25},label:{fill:j4.BLACK,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:j4.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:j4.WHITE,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},htmlLabel:{fontSize:12,opacity:.65,color:j4.BLACK,fontWeight:"normal"},slider:{trackSize:16,trackFill:j4.STROKE,trackFillOpacity:1,selectionFill:R4,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:j4.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:j4.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{padding:[2,2,2,2],trackSize:10,isRound:!0,slidable:!0,scrollable:!0,trackFill:"#e5e5e5",trackFillOpacity:0,thumbFill:"#000",thumbFillOpacity:.15,thumbHighlightedFillOpacity:.2},title:{spacing:8,titleFill:j4.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:j4.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)},B4=(I4.props={},{BLACK:"#fff",WHITE:"#000",STROKE:"#416180"}),D4="#5B8FF9",F4=t=>{var e={color:D4,category10:"category10",category20:"category20",size:1,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},view:{viewFill:"#141414",plotFill:"transparent",mainFill:"transparent",contentFill:"transparent"},line:{line:{fill:"",strokeOpacity:1,lineWidth:1}},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:B4.BLACK,lineWidth:1}},text:{text:{fill:B4.BLACK,fillOpacity:.65,fontSize:12,strokeWidth:0,connectorStroke:B4.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:B4.STROKE,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:B4.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:B4.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:B4.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:B4.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:B4.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:B4.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:B4.STROKE,endMarkerFillOpacity:.95}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:.5,gridStroke:B4.BLACK,gridStrokeOpacity:.05,labelAlign:"horizontal",labelFill:B4.BLACK,labelFillOpacity:.65,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:8,lineLineWidth:.5,lineStroke:B4.BLACK,lineStrokeOpacity:.45,tickLength:4,tickLineWidth:1,tickStroke:B4.BLACK,tickStrokeOpacity:.25,titleFill:B4.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,titleTransformOrigin:"center"},axisTop:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"top",titleSpacing:0,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"bottom",titleSpacing:10,titleTextBaseline:"bottom"},axisLeft:{gridDirection:"positive",labelAutoRotate:!1,labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"left",titleSpacing:10,titleTextBaseline:"middle",titleDirection:"vertical",titleTransformOrigin:"center"},axisRight:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"right",titleSpacing:0,titleTextBaseline:"top",titleDirection:"vertical",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleTextBaseline:"bottom"},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},axisArc:{title:!1,titlePosition:"inner",line:!1,tick:!0,labelSpacing:4},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:B4.BLACK,itemLabelFillOpacity:.65,itemLabelFontSize:12,itemLabelFontWeight:"lighter",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,8],itemValueFill:B4.BLACK,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"lighter",navButtonFill:B4.BLACK,navButtonFillOpacity:.45,navPageNumFill:B4.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!0,titleFill:B4.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:B4.BLACK,tickStrokeOpacity:.25,rowPadding:0,colPadding:8},legendContinuous:{handleHeight:12,handleLabelFill:B4.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:B4.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:B4.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:B4.BLACK,labelFillOpacity:.45,labelFontSize:12,labelFontWeight:"lighter",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:.65,tickStroke:B4.BLACK,tickStrokeOpacity:.25},label:{fill:B4.BLACK,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:B4.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:B4.WHITE,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},htmlLabel:{fontSize:12,opacity:.65,color:B4.BLACK,fontWeight:"normal"},slider:{trackSize:16,trackFill:B4.STROKE,trackFillOpacity:1,selectionFill:D4,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:B4.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:B4.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{},title:{titleFill:B4.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:B4.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)},z4=(F4.props={},{BLACK:"#000",WHITE:"#fff",STROKE:"#888"}),W4="#4e79a7",G4=t=>{var e={color:W4,size:1,category10:"tableau10",category20:"tableau10",enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},view:{viewFill:"transparent",plotFill:"transparent",mainFill:"transparent",contentFill:"transparent"},line:{line:{fill:"",strokeOpacity:1,lineWidth:1,connectStroke:"#aaa"}},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,connectFill:z4.BLACK,connectFillOpacity:.1}},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:"#1D2129",lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:10,strokeWidth:0,connectorStroke:z4.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:z4.STROKE,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:z4.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:z4.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:z4.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:z4.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:z4.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:z4.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:z4.STROKE,endMarkerFillOpacity:.95}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:1,gridStroke:"#ddd",gridStrokeOpacity:1,labelAlign:"horizontal",labelAutoRotate:!1,labelFill:z4.BLACK,labelFillOpacity:1,labelFontSize:10,labelFontWeight:"normal",labelSpacing:4,line:!0,lineLineWidth:1,lineStroke:"#888",lineStrokeOpacity:1,tickLength:5,tickLineWidth:1,tickStroke:z4.STROKE,tickStrokeOpacity:1,titleFill:z4.BLACK,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold",titleSpacing:12,titleTransformOrigin:"center"},axisTop:{gridDirection:"positive",labelDirection:"negative",tickDirection:"negative",titlePosition:"top",titleSpacing:0,titleTextBaseline:"middle",labelSpacing:4},axisBottom:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"bottom",titleSpacing:4,titleTextBaseline:"bottom"},axisLeft:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"left",titleSpacing:4,titleTextBaseline:"middle",titleDirection:"vertical",titleTransformOrigin:"center"},axisRight:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"right",titleSpacing:0,titleTextBaseline:"top",titleDirection:"vertical",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleTextBaseline:"bottom"},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:z4.BLACK,itemLabelFillOpacity:1,itemLabelFontSize:10,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,4],itemValueFill:z4.BLACK,itemValueFillOpacity:1,itemValueFontSize:10,itemValueFontWeight:"normal",navButtonFill:z4.BLACK,navButtonFillOpacity:.45,navButtonSize:6,navPageNumFill:z4.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:10,padding:8,title:!0,titleFill:z4.BLACK,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold",titleSpacing:4,rowPadding:0,colPadding:8},legendContinuous:{handleHeight:12,handleLabelFill:z4.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:10,handleLabelFontWeight:"normal",handleMarkerFill:z4.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:z4.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:z4.BLACK,labelFillOpacity:.45,labelFontSize:10,labelFontWeight:"normal",title:!0,titleSpacing:4,ribbonFill:"#aaa",handle:!0,handleLabel:!1,handleShape:"slider",handleIconSize:12/1.8,indicator:!1,titleFontWeight:"bold"},label:{fill:z4.BLACK,fillOpacity:.65,fontSize:10,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:z4.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:z4.WHITE,fontSize:10,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},htmlLabel:{fontSize:12,opacity:.65,color:z4.BLACK,fontWeight:"normal"},slider:{trackSize:16,trackFill:z4.STROKE,trackFillOpacity:.05,selectionFill:W4,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:z4.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:z4.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:10,handleLabelFontWeight:"normal"},scrollbar:{},title:{titleFill:z4.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:z4.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)};function H4(t,e,n){return t.querySelector(e)?lt(t).select(e):lt(t).append(n)}function V4(t){return Array.isArray(t)?t.join(", "):""+(t||"")}function Y4(t,e){let{flexDirection:n,justifyContent:r,alignItems:i}={flexDirection:"row",justifyContent:"flex-start",alignItems:"center"};var a={top:["row","flex-start","center"],bottom:["row","flex-start","center"],left:["column","center","center"],right:["column","center","center"],center:["column","center","center"]};return t in a&&([n,r,i]=a[t]),Object.assign({display:"flex",flexDirection:n,justifyContent:r,alignItems:i},e)}G4.props={};class q4 extends Vy{get child(){var t;return null==(t=this.children)?void 0:t[0]}update(t){var e,t=(this.attr(t),t)["subOptions"];null!=(e=this.child)&&e.update(t)}}class $4 extends q4{update(t){var e=t["subOptions"];this.attr(t),null!=(t=this.child)&&t.update(e)}}function U4(t,e){return null==(t=t.filter(t=>t.getOptions().name===e))?void 0:t[0]}function X4(t,e,n){var t=t["bbox"],{position:e="top",size:r,length:i,crossPadding:a=0}=e,e=["top","bottom","center"].includes(e),[t,o]=e?[t.height,t.width]:[t.width,t.height],{defaultSize:n,defaultLength:s}=n.props,r=(r||n||t)-2*a,n=i||s||o,[t,a]=e?[n,r]:[r,n];return{orientation:e?"horizontal":"vertical",width:t,height:a,size:r,length:n}}function K4(t){const n=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"];var e=t["style"],t=at(t,["style"]);const r={};return Object.entries(t).forEach(([t,e])=>{n.includes(t)?r["show"+Ue(t)]=e:r[t]=e}),Object.assign(Object.assign({},r),e)}function Z4(t){var{innerWidth:t,innerHeight:e}=t.getOptions();return[t,e]}function Q4(t){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}function J4(a,t,e,n,r,i,o,s){void 0===e&&void 0===i||a.update(Object.assign(Object.assign({},e&&{tickCount:e}),i&&{tickMethod:i})),e=t,t=i;var l,t=(i=a).getTicks?i.getTicks():t?([c,l]=wd(e,t=>+t),i=i.getOptions()["tickCount"],t(c,l,i)):e,c=r?t.filter(r):t;const u=t=>!(t instanceof Date)&&"object"==typeof t&&t?t:String(t),h=n||(null==(l=a.getFormatter)?void 0:l.call(a))||u,f=function(t,e){if(iv(e))return t=>t;var{innerWidth:e,innerHeight:n,insetTop:r,insetBottom:i,insetLeft:a,insetRight:o}=e.getOptions(),[t,r,i]="left"===t||"right"===t?[r,i,n]:[a,o,e];const s=new wg({domain:[0,1],range:[t/i,1-r/i]});return t=>s.map(t)}(o,s),d=function(r,i){const{width:a,height:o}=i.getOptions();return t=>{var e,n;return lv(i)?(e=i.map("bottom"===r?[t,1]:[0,t]),"bottom"===r?(n=e[0],new wg({domain:[0,a],range:[0,1]}).map(n)):"left"===r?(n=e[1],new wg({domain:[0,o],range:[0,1]}).map(n)):t):t}}(o,s),p=t=>["left","right"].includes(t);return iv(s)||rv(s)?c.map((t,e,n)=>{var r,i=(null==(i=a.getBandWidth)?void 0:i.call(a,t))/2||0,i=f(a.map(t)+i);return{value:av(s)&&"center"===o||rv(s)&&(null==(r=a.getTicks)?void 0:r.call(a))&&["top","bottom","center","outer"].includes(o)||rv(s)&&p(o)?1-i:i,label:u(h(Q4(t),e,n)),id:String(e)}}):c.map((t,e,n)=>{var r=(null==(r=a.getBandWidth)?void 0:r.call(a,t))/2||0,r=d(f(a.map(t)+r));return{value:p(o)?1-r:r,label:u(h(Q4(t),e,n)),id:String(e)}})}function t_(t,e,n){var r;return!(iv(r=e)&&rv(r)||sv(e))&&(void 0===t?!!n.getTicks:t)}function e_(t,e,n,r,i,a){n=function(t,e){var n=t.axis;let r=t.axisLinear;return["top","right","bottom","left"].includes(e)&&(r=t["axis"+ip(e)]),Object.assign({},n,r)}(n,i);return"center"===i?Object.assign(Object.assign(Object.assign(Object.assign({},n),{labelDirection:"right"===r?"negative":"positive"}),"center"===r?{labelTransform:"translate(50%,0)"}:null),{tickDirection:"right"===r?"negative":"positive",labelSpacing:"center"===r?0:4,titleSpacing:"vertical"===(i=a)||i===-Math.PI/2?10:0,tick:"center"!==r&&void 0}):n}var n_,gm=s=>i=>{const{labelFormatter:a,labelFilter:o=()=>!0}=i;return t=>{var[e]=t["scales"];const r=(null==(n=e.getTicks)?void 0:n.call(e))||e.getOptions().domain;var n="string"==typeof a?Op(a):a,n=Object.assign(Object.assign({},i),{labelFormatter:n,labelFilter:(t,e,n)=>o(r[e],e,r),scale:e});return s(n)(t)}};const r_=gm(t=>{const{direction:o="left",important:s={},labelFormatter:l,orientation:c,position:u,size:h,style:f={},title:d,tickCount:p,tickFilter:g,tickMethod:y,transform:m,indexBBox:v}=t,b=at(t,["direction","important","labelFormatter","order","orientation","position","size","style","title","tickCount","tickFilter","tickMethod","transform","indexBBox"]);return({scales:[t],value:e,coordinate:n,theme:r})=>{var e=e["bbox"],i=t.getOptions()["domain"],r=e_(0,0,r,o,u,c),r=Object.assign(Object.assign(Object.assign({},r),f),b),a=function(t,e){var[e,n]=Z4(e);return t.includes("bottom")||t.includes("top")?n:e}(u,n),e=function(t,e,n,r){var{x:n,y:i,width:a,height:o}=n;if("bottom"===t)return{startPos:[n,i],endPos:[n+a,i]};if("left"===t)return{startPos:[n+a,i+o],endPos:[n+a,i]};if("right"===t)return{startPos:[n,i+o],endPos:[n,i]};if("top"===t)return{startPos:[n,i+o],endPos:[n+a,i+o]};if("center"===t){if("vertical"===e)return{startPos:[n+a,i],endPos:[n+a,i+o]};if("horizontal"===e)return{startPos:[n,i+o],endPos:[n+a,i+o]};if("number"==typeof e){var[t,s]=r.getCenter(),[l,c]=uv(r);const[u,h]=hv(r);var a=Math.min(a,o)/2,{insetLeft:o,insetTop:r}=r.getOptions(),l=l*a,c=c*a,[a,t]=[t+n-o,s+i-r],[n,o]=[Math.cos(e),Math.sin(e)];return{startPos:[a+c*n,t+c*o],endPos:[a+l*n,t+l*o],gridClosed:h-u==360,gridCenter:[a,t],gridControlAngles:new Array(3).fill(0).map((t,e,n)=>(h-u)/(n.length-1)*e)}}}return{}}(u,c,e,n),i=J4(t,i,p,l,g,y,u,n),i=v?i.map((t,e)=>{e=v.get(e);return!e||e[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:e[1]})}):i,i=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},r),{type:"linear",data:i,crossSize:h,titleText:V4(d),labelOverlap:function(t=[],e){if(0<t.length)return t;var{labelAutoRotate:t,labelAutoHide:e,labelAutoEllipsis:n,labelAutoWrap:r}=e;const i=[];var a=(t,e)=>{e&&i.push(t)};return a({type:"rotate",optionalAngles:[0,15,30,45,60,90]},t),a({type:"ellipsis",minLength:20},n),a({type:"hide"},e),a({type:"wrap",wordWrapWidth:100,maxLines:3,recoveryWhenFail:!0},r),i}(m,r),grid:t_(r.grid,n,t),gridLength:a,line:!0,indexBBox:v}),r.line?null:{lineOpacity:0}),e),s);return i.labelOverlap.find(t=>"hide"===t.type)&&(i.crossSize=!1),new UO({className:"axis",style:K4(i)})}}),i_=gm(t=>{const{position:o,labelFormatter:s,tickFilter:l,tickCount:c,tickMethod:u,important:h={},indexBBox:f,title:d,grid:p=!1}=t,g=at(t,["order","size","position","orientation","labelFormatter","tickFilter","tickCount","tickMethod","important","style","indexBBox","title","grid"]);return({scales:[t],value:e,coordinate:n,theme:r})=>{var e=e["bbox"],i=t.getOptions()["domain"],t=J4(t,i,c,s,l,u,o,n),i=f?t.map((t,e)=>{e=f.get(e);return!e||e[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:e[1]})}):t,[t,a]=uv(n),e=function(t,e,n,r,i){var{x:e,y:a,width:o,height:s}=e,e=[e+o/2,a+s/2],a=Math.min(o,s)/2,[o,s]=hv(i),[l,c]=Z4(i),a={center:e,radius:a,startAngle:o,endAngle:s,gridLength:(r-n)*(Math.min(l,c)/2)};return"inner"===t?({insetLeft:o,insetTop:s}=i.getOptions(),Object.assign(Object.assign({},a),{center:[e[0]-o,e[1]-s],labelAlign:"perpendicular",labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"})):Object.assign(Object.assign({},a),{labelAlign:"parallel",labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"})}(o,e,t,a,n),{axis:t,axisArc:a={}}=r,n=K4(ot({},t,a,e,Object.assign(Object.assign({type:"arc",data:i,titleText:V4(d),grid:p},g),h)));return new UO({style:rn(n,["transform"])})}}),a_=(r_.props={defaultPosition:"center",defaultSize:45,defaultOrder:0},i_.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0},e=>(...t)=>r_(Object.assign({},{crossPadding:50},e))(...t)),o_=(a_.props=Object.assign(Object.assign({},r_.props),{defaultPosition:"bottom"}),e=>(...t)=>r_(Object.assign({},{crossPadding:10},e))(...t));o_.props=Object.assign(Object.assign({},r_.props),{defaultPosition:"left"});const s_=a=>{const{important:o={}}=a,s=at(a,["important"]);return t=>{var e,{theme:n,coordinate:r,scales:i}=t;return r_(Object.assign(Object.assign(Object.assign({},s),(e=a.orientation,(e%=2*Math.PI)==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)"}:{})),{important:Object.assign(Object.assign({},function(t,e,n,r){const i=t["radar"];var[t]=r,r=t.getOptions().name;const[a,o]=hv(n);var{axisRadar:t={}}=e;return Object.assign(Object.assign({},t),{grid:"position"===r,gridConnect:"line",gridControlAngles:new Array(i.count).fill(0).map((t,e)=>{return(o-a)/i.count*e})})}(a,n,r,i)),o)}))(t)}};function l_(t,e){const{scales:n,library:a,markState:r}=e,[o,i]=function(t,e){var n=U4(t,"shape"),r=U4(t,"color");const i=n?n.clone():null,a=[];for(const[c,u]of e){var o=c.type,s=(0<(null==r?void 0:r.getOptions().domain.length)?null==r?void 0:r.getOptions().domain:u.data).map((t,e)=>{return i?i.map(t||"point"):(null==(t=null===c||void 0===c?void 0:c.style)?void 0:t.shape)||u.defaultShape||"point"});"string"==typeof o&&a.push([o,s])}if(0===a.length)return["point",["point"]];if(1===a.length)return a[0];if(!n)return a[0];const l=n.getOptions()["range"];return a.map(([t,e])=>{let n=0;for(let t=0;t<a.length;t++){var r=l[t%l.length];e[t]===r&&n++}return[n/e.length,[t,e]]}).sort((t,e)=>e[0]-t[0])[0][1]}(n,r),{itemMarker:s,itemMarkerSize:l}=t,c=(t,e)=>{var n;const r=(null==(n=null==(n=null==(n=a["mark."+o])?void 0:n.props)?void 0:n.shape[t])?void 0:n.props.defaultMarker)||function(t){if(Te(t))return t[t.length-1]}(t.split(".")),i="function"==typeof l?l(e):l;return()=>function(t,e){var{fill:n,stroke:r,lineWidth:i,color:a}=e,o=at(e,["d","fill","strokeWidth","path","stroke","lineWidth","color"]);const s=Dx.get(t)||Dx.get("point");return(...t)=>{return new kc({style:Object.assign(Object.assign({},o),{path:s(...t),stroke:s.style.includes("stroke")?a||r:"",fill:s.style.includes("fill")?a||n:"",lineWidth:s.style.includes("lineWidth")?i||2:0})})}}(r,{color:e.color})(0,0,i)},u=t=>""+i[t];return U4(n,"shape")&&!s?(t,e)=>c(u(e),t):"function"==typeof s?(t,e)=>{e=s(t.id,e);return"string"==typeof e?c(e,t):e}:(t,e)=>c(s||u(e),t)}function c_(t,e){var{labelFormatter:n=t=>""+t}=t,{scales:r,theme:i}=e,i=i.legendCategory.itemMarkerSize,a=(i=i,(a=U4(a=r,"size"))instanceof yg?2*a.map(NaN):i),i={itemMarker:l_(Object.assign(Object.assign({},t),{itemMarkerSize:a}),e),itemMarkerSize:a,itemMarkerOpacity:function(t){if(t=U4(t,"opacity")){const n=t.getOptions()["range"];return(t,e)=>n[e]}}(r)};const o="string"==typeof n?Op(n):n,s=U4(r,"color");t=r.find(t=>0<t.getOptions().domain.length).getOptions().domain;const l=s?t=>s.map(t):()=>e.theme.color;return Object.assign(Object.assign({},i),{data:t.map(t=>({id:t,label:o(t),color:l(t)}))})}s_.props=Object.assign(Object.assign({},r_.props),{defaultPosition:"center"});const u_=o=>{const{layout:s,position:l,title:c,cols:u}=o,h=at(o,["labelFormatter","layout","order","orientation","position","size","title","cols","itemMarker"]),f=h["gridRow"];return t=>{var{value:e,theme:n}=t,r=e["bbox"],{width:e,height:i}=function(t,e,n){var r;if("center"===(r=e["position"])){r=t["bbox"];const{width:i,height:a}=r;return{width:i,height:a}}const{width:i,height:a}=X4(t,e,n);return{width:i,height:a}}(e,o,u_),a=Y4(l,s),e=Object.assign(Object.assign(Object.assign(Object.assign({orientation:["right","left","center"].includes(l)?"vertical":"horizontal",width:e,height:i,layout:void 0!==u?"grid":"flex"},void 0!==u&&{gridCol:u}),void 0!==f&&{gridRow:f}),{titleText:V4(c)}),c_(o,t)),{legendCategory:i={}}=n,t=K4(Object.assign({},i,e,h)),n=new $4({style:Object.assign(Object.assign({x:r.x,y:r.y,width:r.width,height:r.height},a),{subOptions:t})});return n.appendChild(new bk({className:"legend-category",style:t})),n}};function h_(t,e,n,r,i){var a,e=e.thresholds,o=(a=r,t=>({value:t/a,label:String(t)}));return Object.assign(Object.assign({},t),{color:i,data:[n,...e,r].map(o)})}function f_(t){var t=t.getOptions()["domain"],[t,e]=[t[0],Tp(t)];return[t,e]}function d_(t,e,n,r,i,a){const o=t["length"];var i=i.color?a.legendContinuous.ribbonFill||"black":a.color;const s=e||(a=i,u=(i=n||r).getOptions(),(i=i.clone()).update(Object.assign(Object.assign({},u),{range:[ma(a).toString()]})),i),[l,c]=f_(s);var[u,a]=f_([e,n,r].filter(t=>void 0!==t).find(t=>!(t instanceof hg)));return Object.assign(Object.assign({},t),{domain:[u,a],data:s.getTicks().map(t=>({value:t})),color:new Array(o).fill(0).map((t,e)=>{var e=(c-l)/(o-1)*e+l,n=s.map(e);const i=r?r.map(e):1;return n.replace(/rgb[a]*\(([\d]{1,3}) *, *([\d]{1,3}) *, *([\d]{1,3})[\S\s]*\)/,(t,e,n,r)=>`rgba(${e}, ${n}, ${r}, ${i})`)})})}function p_(t,e,n,r,i,a){var o=U4(t,"color"),n=function(t,e,n){var{size:r,crossPadding:i=0}=e,t=X4(t,e,n);return e=r-2*i,r=(n=t).orientation,n.size=e,"horizontal"===(r=r)||0===r?n.height=e:n.width=e,n}(n,r,i);if(o instanceof Sg){var r=o.getOptions()["range"],[i,s]=f_(o);if(o instanceof Tg||o instanceof Cg)return h_(n,o,i,s,r);{i=n;s=o;const l=[-1/0,...s.thresholds,1/0].map((t,e)=>({value:e,label:t}));return Object.assign(Object.assign({},i),{data:l,color:r,labelFilter:(t,e)=>0<e&&e<l.length-1})}}return d_(n,o,U4(t,"size"),U4(t,"opacity"),e,a)}u_.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultPadding:[20,10],defaultCrossPadding:[5,10]};const g_=u=>{const{labelFormatter:h,layout:f,position:d,title:p,style:g}=u,y=at(u,["labelFormatter","layout","order","orientation","position","size","title","style","crossPadding","padding"]);return({scales:t,value:e,theme:n,scale:r})=>{var i=e["bbox"],{x:i,y:a,width:o,height:s}=i,l=Y4(d,f),{legendContinuous:c={}}=n,c=K4(Object.assign({},c,Object.assign(Object.assign({titleText:V4(p),labelAlign:"value",labelFormatter:"string"==typeof h?t=>Op(h)(t.label):h},p_(t,r,e,u,g_,n)),g),y)),t=new q4({style:Object.assign(Object.assign({x:i,y:a,width:o,height:s},l),{subOptions:c})});return t.appendChild(new zk({className:"legend-continuous",style:c})),t}},y_=(g_.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[5,10]},e=>(...t)=>g_(Object.assign({},{block:!0},e))(...t)),m_=(y_.props=Object.assign(Object.assign({},g_.props),{defaultPosition:"top",defaultOrientation:"horizontal"}),n=>t=>{var e=t["scales"],e=U4(e,"size");return g_(Object.assign({},{type:"size",data:e.getTicks().map((t,e)=>({value:t,label:String(t)}))},n))(t)}),v_=(m_.props=Object.assign(Object.assign({},g_.props),{defaultPosition:"top",defaultOrientation:"horizontal"}),t=>m_(Object.assign({},{block:!0},t)));function b_(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"}}}v_.props=Object.assign(Object.assign({},g_.props),{defaultPosition:"top",defaultOrientation:"horizontal"});n_={render(t,e){const{y:n,width:r,title:i,subtitle:a,spacing:o=2,align:s="left"}=t,l=at(t,["x","y","width","title","subtitle","spacing","align"]);t=st(l,"title");const c=st(l,"subtitle"),u=H4(e,".title","text").attr("className","title").call(L,Object.assign(Object.assign(Object.assign({},b_(0,n,r,s)),{fontSize:14,textBaseline:"top",text:i}),t)).node().getLocalBounds();H4(e,".sub-title","text").attr("className","sub-title").call(t=>{if(!a)return t.node().remove();t.node().attr(Object.assign(Object.assign(Object.assign({},b_(0,u.max[1]+o,r,s)),{fontSize:12,textBaseline:"top",text:a}),c))})}};const x_=class extends oc{constructor(t){super(t),this.descriptor=n_}connectedCallback(){var t,e;null!=(e=(t=this.descriptor).render)&&e.call(t,this.attributes,this)}update(t={}){var e;this.attr(ot({},this.attributes,t)),null!=(e=(t=this.descriptor).render)&&e.call(t,this.attributes,this)}},w_=a=>({value:t,theme:e})=>{var{x:t,y:n,width:r,height:i}=t.bbox;return new x_({style:ot({},e.title,Object.assign({x:t,y:n,width:r,height:i},a))})};function M_(t){return!!t.getBandWidth}function O_(t,e,n){if(!M_(t))return t.invert(e);var r=t["adjustedRange"],i=t.getOptions()["domain"],a=n?-1:0;const o=t.getStep();var t=n?r:r.map(t=>t+o),n=md(t,e);return r=n+a,t=0,e=i.length-1,i[Math.min(e,Math.max(t,r))]}function k_(t,e,n){if(!e)return t.getOptions().domain;if(!M_(t))return o=Cd(e),n?([i]=o,r=t.getOptions()["range"],[r,a]=r,a=a<r?-1:1,[i,t.invert(t.map(i)+a*n)]):o;var r=t.getOptions()["domain"],i=e[0],a=r.indexOf(i);if(n){const s=a+Math.round(r.length*n);return r.slice(a,s)}var o=e[e.length-1];const s=r.indexOf(o);return r.slice(a,s+1)}function E_(t,e,n,r,i,a){const{x:o,y:s}=i;i=(t,e)=>{var[t,n]=a.invert(t);return[O_(o,t,e),O_(s,n,e)]},t=i([t,e],!0),e=i([n,r],!1);return[k_(o,[t[0],e[0]]),k_(s,[t[1],e[1]])]}function S_(t,e){var[t,n]=t;return[e.map(t),e.map(n)+((t=e).getStep?t.getStep():0)]}w_.props={defaultPosition:"top",defaultOrder:2,defaultSize:36};const A_=t=>{const{orientation:u,labelFormatter:h,style:f={},position:d}=t,p=at(t,["orientation","labelFormatter","size","style","position"]);return({scales:[n],value:t,theme:e,coordinate:r})=>{var t=t["bbox"],{width:i,height:a}=t,{slider:e={}}=e;const o=(null==(l=n.getFormatter)?void 0:l.call(n))||(t=>t.toString()),s="string"==typeof h?Op(h):h;var l="horizontal"===u;const c=rv(r)&&l;var{trackSize:r=e.trackSize}=f,[t,r]=function(t,e,n){var{x:t,y:r,width:i,height:a}=t;return"left"===e?[t+i-n,r]:"right"===e||"bottom"===e?[t,r]:"top"===e?[t,r+a-n]:void 0}(t,d,r);return new CM({className:"slider",style:Object.assign({},e,Object.assign(Object.assign({x:t,y:r,trackLength:l?i:a,orientation:u,formatter:t=>{var e=s||o,t=c?1-t:t;return e(O_(n,t,!0))}},f),p))})}},__=(A_.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1},t=>A_(Object.assign(Object.assign({},t),{orientation:"horizontal"}))),T_=(__.props=Object.assign(Object.assign({},A_.props),{defaultPosition:"bottom"}),t=>A_(Object.assign(Object.assign({},t),{orientation:"vertical"}))),P_=(T_.props=Object.assign(Object.assign({},A_.props),{defaultPosition:"left"}),t=>{const{orientation:s,style:l}=t,c=at(t,["orientation","labelFormatter","style"]);return({scales:[t],value:e,theme:n})=>{var e=e["bbox"],{x:e,y:r,width:i,height:a}=e,{scrollbar:n={}}=n,{ratio:t,range:o}=t.getOptions(),i="horizontal"===s?i:a,a=i/t,[t,o]=o,t=t<o?0:1;return new jM({className:"g2-scrollbar",style:Object.assign({},n,Object.assign(Object.assign(Object.assign(Object.assign({},l),{x:e,y:r,trackLength:i}),c),{orientation:s,value:t,contentLength:a,viewportLength:i}))})}}),C_=(P_.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1},t=>P_(Object.assign(Object.assign({},t),{orientation:"horizontal"}))),L_=(C_.props=Object.assign(Object.assign({},P_.props),{defaultPosition:"bottom"}),t=>P_(Object.assign(Object.assign({},t),{orientation:"vertical"}))),N_=(L_.props=Object.assign(Object.assign({},P_.props),{defaultPosition:"left"}),t=>()=>new fc),j_=(N_.props={},(c,t)=>{const u=t["coordinate"];return(t,e,n)=>{const[r]=t;var t=r.getBoundingClientRect()["height"],{transform:i="",fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=r.style,[t,l]=rv(u)?[[0,t],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],l=[{transform:(i+" "+l).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(i+" "+l).trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s,offset:.01},{transform:(i+" scale(1, 1)").trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s}],i=(r.setOrigin(t),r.animate(l,Object.assign(Object.assign({},n),c)));return i.finished.then(()=>r.setOrigin(0,0)),i}}),R_=(c,t)=>{const u=t["coordinate"];return(t,e,n)=>{const[r]=t;var t=r.getBoundingClientRect()["height"],{transform:i="",fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=r.style,[t,l]=rv(u)?[[0,t],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],a=[{transform:(i+" scale(1, 1)").trimStart()},{transform:(i+" "+l).trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s,offset:.99},{transform:(i+" "+l).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],o=(r.setOrigin(t),r.animate(a,Object.assign(Object.assign({},n),c)));return o.finished.then(()=>r.setOrigin(0,0)),o}},I_=(c,t)=>{const u=t["coordinate"];return(t,e,n)=>{const[r]=t;var t=r.getBoundingClientRect()["height"],{transform:i="",fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=r.style,[t,l]=rv(u)?[[0,0],"scale(0.0001, 1)"]:[[0,t],"scale(1, 0.0001)"],l=[{transform:(i+" "+l).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(i+" "+l).trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s,offset:.01},{transform:(i+" scale(1, 1)").trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s}],i=(r.setOrigin(t),r.animate(l,Object.assign(Object.assign({},n),c)));return i.finished.then(()=>r.setOrigin(0,0)),i}},B_=(c,t)=>{const u=t["coordinate"];return(t,e,n)=>{const[r]=t;var t=r.getBoundingClientRect()["height"],{transform:i="",fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=r.style,[t,l]=rv(u)?[[0,0],"scale(0.0001, 1)"]:[[0,t],"scale(1, 0.0001)"],a=[{transform:(i+" scale(1, 1)").trimStart()},{transform:(i+" "+l).trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s,offset:.99},{transform:(i+" "+l).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],o=(r.setOrigin(t),r.animate(a,Object.assign(Object.assign({},n),c)));return o.finished.then(()=>r.setOrigin(0,0)),o}},D_=o=>(t,e,n)=>{var[t]=t,{fillOpacity:r=1,strokeOpacity:i=1,opacity:a=1}=t.style;return t.animate([{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:r,strokeOpacity:i,opacity:a}],Object.assign(Object.assign({},n),o))},F_=(D_.props={},o=>(t,e,n)=>{var[t]=t,{fillOpacity:r=1,strokeOpacity:i=1,opacity:a=1}=t.style;return t.animate([{fillOpacity:r,strokeOpacity:i,opacity:a},{fillOpacity:0,strokeOpacity:0,opacity:0}],Object.assign(Object.assign({},n),o))});function z_(t,e){var n={};for(const i of e){var r=t.style[i];r&&(n[i]=r)}return n}F_.props={};const W_=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function G_(t){var{min:t,max:e}=t.getLocalBounds(),[t,n]=t,[e,r]=e;return[t,n,e-t,r-n]}function H_(t,e){var[n,r,i,t]=G_(t),a=Math.ceil(Math.sqrt(e/(t/i))),o=[],s=t/Math.ceil(e/a);let l=0,c=e;for(;0<c;){var u=Math.min(c,a),h=i/u;for(let t=0;t<u;t++){var f=n+t*h,d=r+l*s;o.push(function(t){var[t,e,n,r]=t;return`
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(l){"use strict";var S="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},T=function(t,e){return(T=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])}))(t,e)};function t(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}T(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var m=function(){return(m=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}).apply(this,arguments)};function at(t,e){var n={};for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n}function N(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(o=(a<3?i(o):3<a?i(e,n,o):i(e,n))||o);return 3<a&&o&&Object.defineProperty(e,n,o),o}function X(t,o,s,l){return new(s=s||Promise)(function(n,e){function r(t){try{a(l.next(t))}catch(t){e(t)}}function i(t){try{a(l.throw(t))}catch(t){e(t)}}function a(t){var e;t.done?n(t.value):((e=t.value)instanceof s?e:new s(function(t){t(e)})).then(r,i)}a((l=l.apply(t,o||[])).next())})}function R(r,i){var a,o,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},c={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function t(n){return function(t){var e=[n,t];if(a)throw new TypeError("Generator is already executing.");for(;l=c&&e[c=0]?0:l;)try{if(a=1,o&&(s=2&e[0]?o.return:e[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,e[1])).done)return s;switch(o=0,(e=s?[2&e[0],s.value]:e)[0]){case 0:case 1:s=e;break;case 4:return l.label++,{value:e[1],done:!1};case 5:l.label++,o=e[1],e=[0];continue;case 7:e=l.ops.pop(),l.trys.pop();continue;default:if(!(s=0<(s=l.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){l=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3]))l.label=e[1];else if(6===e[0]&&l.label<s[1])l.label=s[1],s=e;else{if(!(s&&l.label<s[2])){s[2]&&l.ops.pop(),l.trys.pop();continue}l.label=s[2],l.ops.push(e)}}e=i.call(r,l)}catch(t){e=[6,t],o=0}finally{a=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}}function I(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&r>=t.length?void 0:t)&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function j(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function O(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||((r=r||Array.prototype.slice.call(e,0,i))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function B(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))return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t);throw new TypeError("Cannot read private member from an object whose class did not declare it")}var D,F,e={exports:{}};function z(){}function W(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function G(t,e,n,r,i){if("function"!=typeof n)throw new TypeError("The listener must be a function");n=new W(n,r||t,i),r=F?F+e:e;return t._events[r]?t._events[r].fn?t._events[r]=[t._events[r],n]:t._events[r].push(n):(t._events[r]=n,t._eventsCount++),t}function H(t,e){0==--t._eventsCount?t._events=new z:delete t._events[e]}function V(){this._events=new z,this._eventsCount=0}n=e,D=Object.prototype.hasOwnProperty,F="~",Object.create&&(z.prototype=Object.create(null),(new z).__proto__||(F=!1)),V.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)D.call(t,e)&&n.push(F?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},V.prototype.listeners=function(t){var t=F?F+t:t,e=this._events[t];if(!e)return[];if(e.fn)return[e.fn];for(var n=0,r=e.length,i=new Array(r);n<r;n++)i[n]=e[n].fn;return i},V.prototype.listenerCount=function(t){t=F?F+t:t,t=this._events[t];return t?t.fn?1:t.length:0},V.prototype.emit=function(t,e,n,r,i,a){var o=F?F+t:t;if(!this._events[o])return!1;var s,l=this._events[o],c=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,n),!0;case 4:return l.fn.call(l.context,e,n,r),!0;case 5:return l.fn.call(l.context,e,n,r,i),!0;case 6:return l.fn.call(l.context,e,n,r,i,a),!0}for(f=1,s=new Array(c-1);f<c;f++)s[f-1]=arguments[f];l.fn.apply(l.context,s)}else for(var u,h=l.length,f=0;f<h;f++)switch(l[f].once&&this.removeListener(t,l[f].fn,void 0,!0),c){case 1:l[f].fn.call(l[f].context);break;case 2:l[f].fn.call(l[f].context,e);break;case 3:l[f].fn.call(l[f].context,e,n);break;case 4:l[f].fn.call(l[f].context,e,n,r);break;default:if(!s)for(u=1,s=new Array(c-1);u<c;u++)s[u-1]=arguments[u];l[f].fn.apply(l[f].context,s)}return!0},V.prototype.on=function(t,e,n){return G(this,t,e,n,!1)},V.prototype.once=function(t,e,n){return G(this,t,e,n,!0)},V.prototype.removeListener=function(t,e,n,r){t=F?F+t:t;if(this._events[t])if(e){var i=this._events[t];if(i.fn)i.fn!==e||r&&!i.once||n&&i.context!==n||H(this,t);else{for(var a=0,o=[],s=i.length;a<s;a++)(i[a].fn!==e||r&&!i[a].once||n&&i[a].context!==n)&&o.push(i[a]);o.length?this._events[t]=1===o.length?o[0]:o:H(this,t)}}else H(this,t);return this},V.prototype.removeAllListeners=function(t){return t?(t=F?F+t:t,this._events[t]&&H(this,t)):(this._events=new z,this._eventsCount=0),this},V.prototype.off=V.prototype.removeListener,V.prototype.addListener=V.prototype.on,V.prefixed=F,n.exports=V.EventEmitter=V;var Y=e.exports,q=1e-6,$="undefined"!=typeof Float32Array?Float32Array:Array;function U(){var t=new $(9);return $!=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 K=function(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],e=e[8],h=n[0],f=n[1],d=n[2],p=n[3],g=n[4],y=n[5],m=n[6],v=n[7],n=n[8];return t[0]=h*r+f*o+d*c,t[1]=h*i+f*s+d*u,t[2]=h*a+f*l+d*e,t[3]=p*r+g*o+y*c,t[4]=p*i+g*s+y*u,t[5]=p*a+g*l+y*e,t[6]=m*r+v*o+n*c,t[7]=m*i+v*s+n*u,t[8]=m*a+v*l+n*e,t};function Z(){var t=new $(16);return $!=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 Q(t){var e=new $(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 J(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 tt(t,e,n,r,i,a,o,s,l,c,u,h,f,d,p,g,y){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=l,t[8]=c,t[9]=u,t[10]=h,t[11]=f,t[12]=d,t[13]=p,t[14]=g,t[15]=y,t}function et(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 nt(t,e){var n,r,i,a,o,s;return t===e?(n=e[1],r=e[2],i=e[3],a=e[6],o=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]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s):(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]),t}function rt(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],y=e[14],e=e[15],m=n*s-r*o,v=n*l-i*o,b=n*c-a*o,x=r*l-i*s,w=r*c-a*s,M=i*c-a*l,O=u*g-h*p,k=u*y-f*p,E=u*e-d*p,S=h*y-f*g,A=h*e-d*g,_=f*e-d*y,T=m*_-v*A+b*S+x*E-w*k+M*O;return T?(t[0]=(s*_-l*A+c*S)*(T=1/T),t[1]=(i*A-r*_-a*S)*T,t[2]=(g*M-y*w+e*x)*T,t[3]=(f*w-h*M-d*x)*T,t[4]=(l*E-o*_-c*k)*T,t[5]=(n*_-i*E+a*k)*T,t[6]=(y*b-p*M-e*v)*T,t[7]=(u*M-f*b+d*v)*T,t[8]=(o*A-s*E+c*O)*T,t[9]=(r*E-n*A-a*O)*T,t[10]=(p*w-g*b+e*m)*T,t[11]=(h*b-u*w-d*m)*T,t[12]=(s*k-o*S-l*O)*T,t[13]=(n*S-r*k+i*O)*T,t[14]=(g*v-p*x-y*m)*T,t[15]=(u*x-h*v+f*m)*T,t):null}function it(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=t[10],f=t[11],d=t[12],p=t[13],g=t[14],t=t[15];return(e*o-n*a)*(h*t-f*g)-(e*s-r*a)*(u*t-f*p)+(e*l-i*a)*(u*g-h*p)+(n*s-r*o)*(c*t-f*d)-(n*l-i*o)*(c*g-h*d)+(r*l-i*s)*(c*p-u*d)}function ct(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],f=e[9],d=e[10],p=e[11],g=e[12],y=e[13],m=e[14],e=e[15],v=n[0],b=n[1],x=n[2],w=n[3];return t[0]=v*r+b*s+x*h+w*g,t[1]=v*i+b*l+x*f+w*y,t[2]=v*a+b*c+x*d+w*m,t[3]=v*o+b*u+x*p+w*e,v=n[4],b=n[5],x=n[6],w=n[7],t[4]=v*r+b*s+x*h+w*g,t[5]=v*i+b*l+x*f+w*y,t[6]=v*a+b*c+x*d+w*m,t[7]=v*o+b*u+x*p+w*e,v=n[8],b=n[9],x=n[10],w=n[11],t[8]=v*r+b*s+x*h+w*g,t[9]=v*i+b*l+x*f+w*y,t[10]=v*a+b*c+x*d+w*m,t[11]=v*o+b*u+x*p+w*e,v=n[12],b=n[13],x=n[14],w=n[15],t[12]=v*r+b*s+x*h+w*g,t[13]=v*i+b*l+x*f+w*y,t[14]=v*a+b*c+x*d+w*m,t[15]=v*o+b*u+x*p+w*e,t}function ut(t,e,n){var r,i,a,o,s,l,c,u,h,f,d,p,g=n[0],y=n[1],n=n[2];return e===t?(t[12]=e[0]*g+e[4]*y+e[8]*n+e[12],t[13]=e[1]*g+e[5]*y+e[9]*n+e[13],t[14]=e[2]*g+e[6]*y+e[10]*n+e[14],t[15]=e[3]*g+e[7]*y+e[11]*n+e[15]):(r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],f=e[9],d=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=f,t[10]=d,t[11]=p,t[12]=r*g+s*y+h*n+e[12],t[13]=i*g+l*y+f*n+e[13],t[14]=a*g+c*y+d*n+e[14],t[15]=o*g+u*y+p*n+e[15]),t}function ht(t,e,n){var r=n[0],i=n[1],n=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]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ft(t,e,n){var r=Math.sin(n),n=Math.cos(n),i=e[4],a=e[5],o=e[6],s=e[7],l=e[8],c=e[9],u=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]=i*n+l*r,t[5]=a*n+c*r,t[6]=o*n+u*r,t[7]=s*n+h*r,t[8]=l*n-i*r,t[9]=c*n-a*r,t[10]=u*n-o*r,t[11]=h*n-s*r,t}function dt(t,e,n){var r=Math.sin(n),n=Math.cos(n),i=e[0],a=e[1],o=e[2],s=e[3],l=e[8],c=e[9],u=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]=i*n-l*r,t[1]=a*n-c*r,t[2]=o*n-u*r,t[3]=s*n-h*r,t[8]=i*r+l*n,t[9]=a*r+c*n,t[10]=o*r+u*n,t[11]=s*r+h*n,t}function pt(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 gt(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 yt(t,e,n){var r=e[0],i=e[1],a=e[2],e=e[3],o=r+r,s=i+i,l=a+a,c=r*o,u=r*s,r=r*l,h=i*s,i=i*l,a=a*l,o=e*o,s=e*s,e=e*l;return t[0]=1-(h+a),t[1]=u+e,t[2]=r-s,t[3]=0,t[4]=u-e,t[5]=1-(c+a),t[6]=i+o,t[7]=0,t[8]=r+s,t[9]=i-o,t[10]=1-(c+h),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function mt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function vt(t,e){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],s=e[6],l=e[8],c=e[9],e=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(a,o,s),t[2]=Math.hypot(l,c,e),t}function bt(t,e){var n=new $(3),r=(vt(n,e),1/n[0]),i=1/n[1],n=1/n[2],a=e[0]*r,o=e[1]*i,s=e[2]*n,l=e[4]*r,c=e[5]*i,u=e[6]*n,r=e[8]*r,i=e[9]*i,e=e[10]*n,n=a+c+e,h=0;return 0<n?(h=2*Math.sqrt(1+n),t[3]=.25*h,t[0]=(u-i)/h,t[1]=(r-s)/h,t[2]=(o-l)/h):c<a&&e<a?(h=2*Math.sqrt(1+a-c-e),t[3]=(u-i)/h,t[0]=.25*h,t[1]=(o+l)/h,t[2]=(r+s)/h):e<c?(h=2*Math.sqrt(1+c-a-e),t[3]=(r-s)/h,t[0]=(o+l)/h,t[1]=.25*h,t[2]=(u+i)/h):(h=2*Math.sqrt(1+e-a-c),t[3]=(o-l)/h,t[0]=(r+s)/h,t[1]=(u+i)/h,t[2]=.25*h),t}function xt(t,e,n,r,i){var a=e[0],o=e[1],s=e[2],e=e[3],l=a+a,c=o+o,u=s+s,h=a*l,f=a*c,a=a*u,d=o*c,o=o*u,s=s*u,l=e*l,c=e*c,e=e*u,u=r[0],p=r[1],r=r[2],g=i[0],y=i[1],i=i[2],m=(1-(d+s))*u,v=(f+e)*u,u=(a-c)*u,f=(f-e)*p,e=(1-(h+s))*p,s=(o+l)*p,p=(a+c)*r,a=(o-l)*r,c=(1-(h+d))*r;return t[0]=m,t[1]=v,t[2]=u,t[3]=0,t[4]=f,t[5]=e,t[6]=s,t[7]=0,t[8]=p,t[9]=a,t[10]=c,t[11]=0,t[12]=n[0]+g-(m*g+f*y+p*i),t[13]=n[1]+y-(v*g+e*y+a*i),t[14]=n[2]+i-(u*g+s*y+c*i),t[15]=1,t}function wt(t,e){var n=e[0],r=e[1],i=e[2],e=e[3],a=n+n,o=r+r,s=i+i,n=n*a,l=r*a,r=r*o,c=i*a,u=i*o,i=i*s,a=e*a,o=e*o,e=e*s;return t[0]=1-r-i,t[1]=l+e,t[2]=c-o,t[3]=0,t[4]=l-e,t[5]=1-n-i,t[6]=u+a,t[7]=0,t[8]=c+o,t[9]=u-a,t[10]=1-n-r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Mt(t,e,n,r,i){e=1/Math.tan(e/2);return t[0]=e/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,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?(t[10]=(i+r)*(n=1/(r-i)),t[14]=2*i*r*n):(t[10]=-1,t[14]=-2*r),t}function Ot(t,e,n,r,i,a,o){var s=1/(e-n),l=1/(r-i),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*l,t[14]=(o+a)*c,t[15]=1,t}var kt=Ot;function Et(t,e,n,r,i,a,o){var s=1/(e-n),l=1/(r-i),o=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=o,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*l,t[14]=a*o,t[15]=1,t}function St(t,e,n,r){var i,a,o,s,l=e[0],c=e[1],e=e[2],u=r[0],h=r[1],r=r[2],f=n[0],d=n[1],n=n[2];return Math.abs(l-f)<q&&Math.abs(c-d)<q&&Math.abs(e-n)<q?et(t):(f=l-f,d=c-d,n=e-n,i=h*(n*=s=1/Math.hypot(f,d,n))-r*(d*=s),r=r*(f*=s)-u*n,u=u*d-h*f,(s=Math.hypot(i,r,u))?(i*=s=1/s,r*=s,u*=s):u=r=i=0,h=d*u-n*r,a=n*i-f*u,o=f*r-d*i,(s=Math.hypot(h,a,o))?(h*=s=1/s,a*=s,o*=s):o=a=h=0,t[0]=i,t[1]=h,t[2]=f,t[3]=0,t[4]=r,t[5]=a,t[6]=d,t[7]=0,t[8]=u,t[9]=o,t[10]=n,t[11]=0,t[12]=-(i*l+r*c+u*e),t[13]=-(h*l+a*c+o*e),t[14]=-(f*l+d*c+n*e),t[15]=1,t)}function At(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 _t=Object.freeze({__proto__:null,create:Z,clone:Q,copy:J,fromValues:function(t,e,n,r,i,a,o,s,l,c,u,h,f,d,p,g){var y=new $(16);return y[0]=t,y[1]=e,y[2]=n,y[3]=r,y[4]=i,y[5]=a,y[6]=o,y[7]=s,y[8]=l,y[9]=c,y[10]=u,y[11]=h,y[12]=f,y[13]=d,y[14]=p,y[15]=g,y},set:tt,identity:et,transpose:nt,invert:rt,adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],y=e[14],e=e[15];return t[0]=s*(f*e-d*y)-h*(l*e-c*y)+g*(l*d-c*f),t[1]=-(r*(f*e-d*y)-h*(i*e-a*y)+g*(i*d-a*f)),t[2]=r*(l*e-c*y)-s*(i*e-a*y)+g*(i*c-a*l),t[3]=-(r*(l*d-c*f)-s*(i*d-a*f)+h*(i*c-a*l)),t[4]=-(o*(f*e-d*y)-u*(l*e-c*y)+p*(l*d-c*f)),t[5]=n*(f*e-d*y)-u*(i*e-a*y)+p*(i*d-a*f),t[6]=-(n*(l*e-c*y)-o*(i*e-a*y)+p*(i*c-a*l)),t[7]=n*(l*d-c*f)-o*(i*d-a*f)+u*(i*c-a*l),t[8]=o*(h*e-d*g)-u*(s*e-c*g)+p*(s*d-c*h),t[9]=-(n*(h*e-d*g)-u*(r*e-a*g)+p*(r*d-a*h)),t[10]=n*(s*e-c*g)-o*(r*e-a*g)+p*(r*c-a*s),t[11]=-(n*(s*d-c*h)-o*(r*d-a*h)+u*(r*c-a*s)),t[12]=-(o*(h*y-f*g)-u*(s*y-l*g)+p*(s*f-l*h)),t[13]=n*(h*y-f*g)-u*(r*y-i*g)+p*(r*f-i*h),t[14]=-(n*(s*y-l*g)-o*(r*y-i*g)+p*(r*l-i*s)),t[15]=n*(s*f-l*h)-o*(r*f-i*h)+u*(r*l-i*s),t},determinant:it,multiply:ct,translate:ut,scale:ht,rotate:function(t,e,n,r){var i,a,o,s,l,c,u,h,f,d,p,g,y,m,v,b,x,w,M,O,k=r[0],E=r[1],r=r[2],S=Math.hypot(k,E,r);return S<q?null:(k*=S=1/S,E*=S,r*=S,S=Math.sin(n),n=Math.cos(n),a=e[0],o=e[1],s=e[2],l=e[3],c=e[4],u=e[5],h=e[6],f=e[7],d=e[8],p=e[9],g=e[10],y=e[11],v=k*E*(i=1-n)-r*S,b=E*E*i+n,x=r*E*i+k*S,w=k*r*i+E*S,M=E*r*i-k*S,O=r*r*i+n,t[0]=a*(n=k*k*i+n)+c*(m=E*k*i+r*S)+d*(r=r*k*i-E*S),t[1]=o*n+u*m+p*r,t[2]=s*n+h*m+g*r,t[3]=l*n+f*m+y*r,t[4]=a*v+c*b+d*x,t[5]=o*v+u*b+p*x,t[6]=s*v+h*b+g*x,t[7]=l*v+f*b+y*x,t[8]=a*w+c*M+d*O,t[9]=o*w+u*M+p*O,t[10]=s*w+h*M+g*O,t[11]=l*w+f*M+y*O,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:ft,rotateY:dt,rotateZ:function(t,e,n){var r=Math.sin(n),n=Math.cos(n),i=e[0],a=e[1],o=e[2],s=e[3],l=e[4],c=e[5],u=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]=i*n+l*r,t[1]=a*n+c*r,t[2]=o*n+u*r,t[3]=s*n+h*r,t[4]=l*n-i*r,t[5]=c*n-a*r,t[6]=u*n-o*r,t[7]=h*n-s*r,t},fromTranslation:pt,fromScaling:gt,fromRotation:function(t,e,n){var r,i=n[0],a=n[1],n=n[2],o=Math.hypot(i,a,n);return o<q?null:(i*=o=1/o,a*=o,n*=o,o=Math.sin(e),e=Math.cos(e),t[0]=i*i*(r=1-e)+e,t[1]=a*i*r+n*o,t[2]=n*i*r-a*o,t[3]=0,t[4]=i*a*r-n*o,t[5]=a*a*r+e,t[6]=n*a*r+i*o,t[7]=0,t[8]=i*n*r+a*o,t[9]=a*n*r-i*o,t[10]=n*n*r+e,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),e=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=e,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),e=Math.cos(e);return t[0]=e,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]=e,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),e=Math.cos(e);return t[0]=e,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=e,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:yt,fromQuat2:function(t,e){var n=new $(3),r=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=r*r+i*i+a*a+o*o;return 0<h?(n[0]=2*(s*o+u*r+l*a-c*i)/h,n[1]=2*(l*o+u*i+c*r-s*a)/h,n[2]=2*(c*o+u*a+s*i-l*r)/h):(n[0]=2*(s*o+u*r+l*a-c*i),n[1]=2*(l*o+u*i+c*r-s*a),n[2]=2*(c*o+u*a+s*i-l*r)),yt(t,e,n),t},getTranslation:mt,getScaling:vt,getRotation:bt,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],e=e[3],s=i*(u=i+i),l=i*(h=a+a),i=i*(f=o+o),c=a*h,a=a*f,o=o*f,u=e*u,h=e*h,e=e*f,f=r[0],d=r[1],r=r[2];return t[0]=(1-(c+o))*f,t[1]=(l+e)*f,t[2]=(i-h)*f,t[3]=0,t[4]=(l-e)*d,t[5]=(1-(s+o))*d,t[6]=(a+u)*d,t[7]=0,t[8]=(i+h)*r,t[9]=(a-u)*r,t[10]=(1-(s+c))*r,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:xt,fromQuat:wt,frustum:function(t,e,n,r,i,a,o){var s=1/(n-e),l=1/(i-r),c=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*l,t[10]=(o+a)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*c,t[15]=0,t},perspectiveNO:Mt,perspective:Mt,perspectiveZO:function(t,e,n,r,i){return e=1/Math.tan(e/2),t[0]=e/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,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?(t[10]=i*(n=1/(r-i)),t[14]=i*r*n):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),e=Math.tan(e.rightDegrees*Math.PI/180),s=2/(o+e),l=2/(i+a);return t[0]=s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(o-e)*s*.5,t[9]=(i-a)*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:Ot,ortho:kt,orthoZO:Et,lookAt:St,targetTo:function(t,e,n,r){var i=e[0],a=e[1],e=e[2],o=r[0],s=r[1],r=r[2],l=i-n[0],c=a-n[1],n=e-n[2],u=l*l+c*c+n*n,h=(0<u&&(l*=u=1/Math.sqrt(u),c*=u,n*=u),s*n-r*c);return 0<(u=h*h+(r=r*l-o*n)*r+(o=o*c-s*l)*o)&&(h*=u=1/Math.sqrt(u),r*=u,o*=u),t[0]=h,t[1]=r,t[2]=o,t[3]=0,t[4]=c*o-n*r,t[5]=n*h-l*o,t[6]=l*r-c*h,t[7]=0,t[8]=l,t[9]=c,t[10]=n,t[11]=0,t[12]=i,t[13]=a,t[14]=e,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:At,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],a=t[3],o=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],f=t[10],d=t[11],p=t[12],g=t[13],y=t[14],t=t[15],m=e[0],v=e[1],b=e[2],x=e[3],w=e[4],M=e[5],O=e[6],k=e[7],E=e[8],S=e[9],A=e[10],_=e[11],T=e[12],P=e[13],C=e[14],e=e[15];return Math.abs(n-m)<=q*Math.max(1,Math.abs(n),Math.abs(m))&&Math.abs(r-v)<=q*Math.max(1,Math.abs(r),Math.abs(v))&&Math.abs(i-b)<=q*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(a-x)<=q*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(o-w)<=q*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-M)<=q*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(l-O)<=q*Math.max(1,Math.abs(l),Math.abs(O))&&Math.abs(c-k)<=q*Math.max(1,Math.abs(c),Math.abs(k))&&Math.abs(u-E)<=q*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(h-S)<=q*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(f-A)<=q*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(d-_)<=q*Math.max(1,Math.abs(d),Math.abs(_))&&Math.abs(p-T)<=q*Math.max(1,Math.abs(p),Math.abs(T))&&Math.abs(g-P)<=q*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(y-C)<=q*Math.max(1,Math.abs(y),Math.abs(C))&&Math.abs(t-e)<=q*Math.max(1,Math.abs(t),Math.abs(e))},mul:ct,sub:At});function v(){var t=new $(3);return $!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Tt(t){var e=new $(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Pt(t){var e=t[0],n=t[1],t=t[2];return Math.hypot(e,n,t)}function Ct(t,e,n){var r=new $(3);return r[0]=t,r[1]=e,r[2]=n,r}function Lt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Nt(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function jt(t,e,n){t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2]}function Rt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function It(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Bt(t,e){var n=e[0],r=e[1],i=e[2],n=n*n+r*r+i*i;0<n&&(n=1/Math.sqrt(n)),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n}function Dt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Ft(t,e,n){var r=e[0],i=e[1],e=e[2],a=n[0],o=n[1],n=n[2];t[0]=i*n-e*o,t[1]=e*a-r*n,t[2]=r*o-i*a}function zt(t,e,n,r){var i=e[0],a=e[1],e=e[2];t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=e+r*(n[2]-e)}function Wt(t,e,n){var r=e[0],i=e[1],e=e[2],a=n[3]*r+n[7]*i+n[11]*e+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*e+n[12])/(a=a||1),t[1]=(n[1]*r+n[5]*i+n[9]*e+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*e+n[14])/a,t}function Gt(t,e,n){var r=e[0],i=e[1],e=e[2];t[0]=r*n[0]+i*n[3]+e*n[6],t[1]=r*n[1]+i*n[4]+e*n[7],t[2]=r*n[2]+i*n[5]+e*n[8]}function Ht(t,e){var n=t[0],r=t[1],t=t[2],i=e[0],a=e[1],e=e[2];return Math.abs(n-i)<=q*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(r-a)<=q*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(t-e)<=q*Math.max(1,Math.abs(t),Math.abs(e))}var Vt=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],e=e[2]-t[2];return Math.hypot(n,r,e)},Yt=Pt;function qt(){var t=new $(4);return $!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function $t(t,e,n){var r=e[0],i=e[1],a=e[2],e=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*e,t[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*e,t[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*e,t[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*e,t}function Ut(){var t=new $(4);return $!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Xt(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 Kt(t,e,n){var r=e[0],i=e[1],a=e[2],e=e[3],o=n[0],s=n[1],l=n[2],n=n[3];return t[0]=r*n+e*o+i*l-a*s,t[1]=i*n+e*s+a*o-r*l,t[2]=a*n+e*l+r*s-i*o,t[3]=e*n-r*o-i*s-a*l,t}function Zt(t,e){var n=e[0],r=e[1],i=e[2],e=e[3],a=n*n+r*r+i*i+e*e,a=a?1/a:0;return t[0]=-n*a,t[1]=-r*a,t[2]=-i*a,t[3]=e*a,t}function Qt(t,e,n,r){var i=.5*Math.PI/180,i=(e*=i,n*=i,r*=i,Math.sin(e)),e=Math.cos(e),a=Math.sin(n),n=Math.cos(n),o=Math.sin(r),r=Math.cos(r);t[0]=i*n*r-e*a*o,t[1]=e*a*r+i*n*o,t[2]=e*n*o-i*a*r,t[3]=e*n*r+i*a*o}v(),qt();var Jt=function(t,e,n,r){var i=new $(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},te=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},ee=Kt,ne=function(t,e){var n=e[0],r=e[1],i=e[2],e=e[3],a=n*n+r*r+i*i+e*e;return 0<a&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=e*a,t};v(),Ct(1,0,0),Ct(0,1,0),Ut(),Ut(),U(),n=new $(2),$!=Float32Array&&(n[0]=0,n[1]=0);var re={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};var ie={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function ae(t){return Array.isArray(t)&&t.every(function(t){var e=t[0].toLowerCase();return ie[e]===t.length-1&&"achlmqstvz".includes(e)})}function oe(t){return ae(t)&&t.every(function(t){t=t[0];return t===t.toUpperCase()})}function se(t){return oe(t)&&t.every(function(t){t=t[0];return"ACLMQZ".includes(t)})}function le(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=ie[n]&&("m"===n&&2<r.length?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,ie[n]))),ie[n]););}function ce(t){return 48<=t&&t<=57}function ue(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||5760<=e&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function he(t){var e,n,r,i,a,o=t.max,s=t.pathValue,l=t.index,c=s.charCodeAt(l),u=ie[s[l].toLowerCase()];if(t.segmentStart=l,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 1;default:return}}(c)){if(t.index+=1,ue(t),t.data=[],u)for(;;){for(var h=u;0<h;--h){if(97!=(32|c)||3!==h&&4!==h?function(t){var e,n,r=t.max,i=t.pathValue,a=t.index,o=a,s=!1,l=!1,c=!1;if(r<=o)t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param';else if(ce(n=43!==(n=i.charCodeAt(o))&&45!==n?n:i.charCodeAt(o+=1))||46===n){if(46!==n){if(e=48===n,n=i.charCodeAt(o+=1),e&&o<r&&n&&ce(n))return t.err="[path-util]: Invalid path value at index "+a+', "'+i[a]+'" illegal number';for(;o<r&&ce(i.charCodeAt(o));)o+=1,s=!0;n=i.charCodeAt(o)}if(46===n){for(c=!0,o+=1;ce(i.charCodeAt(o));)o+=1,l=!0;n=i.charCodeAt(o)}if(101===n||69===n){if(c&&!s&&!l)return t.err="[path-util]: Invalid path value at index "+o+', "'+i[o]+'" invalid float exponent';if(43!==(n=i.charCodeAt(o+=1))&&45!==n||(o+=1),!(o<r&&ce(i.charCodeAt(o))))return t.err="[path-util]: Invalid path value at index "+o+', "'+i[o]+'" invalid integer exponent';for(;o<r&&ce(i.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(a,o)}else t.err="[path-util]: Invalid path value at index "+o+', "'+i[o]+'" is not a number'}(t):(a=i=r=void 0,r=(n=t).index,i=n.pathValue,48===(a=i.charCodeAt(r))?(n.param=0,n.index+=1):49===a?(n.param=1,n.index+=1):n.err='[path-util]: invalid Arc flag "'+i[r]+'", expecting 0 or 1 at index '+r),t.err.length)return;t.data.push(t.param),ue(t),t.index<o&&44===s.charCodeAt(t.index)&&(t.index+=1,ue(t))}if(t.index>=t.max)break;if(!(48<=(e=s.charCodeAt(t.index))&&e<=57||43===e||45===e||46===e))break}le(t)}else t.err='[path-util]: Invalid path value "'+s[l]+'" is not a path command'}var fe=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 de(t){var o,s,l,c;return oe(t)?[].concat(t):(t=function(t){if(ae(t))return[].concat(t);var e=new fe(t);for(ue(e);e.index<e.max&&!e.err.length;)he(e);return e.err||e.segments}(t),c=l=s=o=0,t.map(function(t){var e=t.slice(1).map(Number),t=t[0],n=t.toUpperCase();if("M"===t)return o=e[0],s=e[1],["M",l=o,c=s];if(t!==n)switch(n){case"A":i=[n,e[0],e[1],e[2],e[3],e[4],e[5]+o,e[6]+s];break;case"V":i=[n,e[0]+s];break;case"H":i=[n,e[0]+o];break;default:var r=e.map(function(t,e){return t+(e%2?s:o)}),i=[n].concat(r)}else i=[n].concat(e);var a=i.length;switch(n){case"Z":o=l,s=c;break;case"H":o=i[1];break;case"V":s=i[1];break;default:o=i[a-2],s=i[a-1],"M"===n&&(l=o,c=s)}return i}))}function pe(t){if(se(t))return[].concat(t);for(var e,n,r,i,a,o,s,l=de(t),c=m({},re),u=0;u<l.length;u+=1){l[u]=(e=l[u],n=c,s=o=f=a=h=i=r=void 0,r=e[0],i=n.x1,h=n.y1,a=n.x2,f=n.y2,o=e.slice(1).map(Number),s=e,"TQ".includes(r)||(n.qx=null,n.qy=null),"H"===r?s=["L",e[1],h]:"V"===r?s=["L",i,e[1]]:"S"===r?(e=2*h-f,s=["C",n.x1=2*i-a,n.y1=e].concat(o)):"T"===r?(f=2*i-n.qx,a=2*h-n.qy,s=["Q",n.qx=f,n.qy=a].concat(o)):"Q"===r&&(e=o[0],i=o[1],n.qx=e,n.qy=i),s);var h=l[u],f=h.length;c.x1=+h[f-2],c.y1=+h[f-1],c.x2=+h[f-4]||c.x1,c.y2=+h[f-3]||c.y1}return l}function ge(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function ye(t,e,n,r,i,a,o,s,l,c){var u=120*Math.PI/180,h=Math.PI/180*(+i||0),f=[],d=(c?(b=c[0],x=c[1],m=c[2],v=c[3]):(t=(g=ge(t,e,-h)).x,e=g.y,1<(d=(p=(t-(s=(g=ge(s,l,-h)).x))/2)*p/(n*n)+(g=(e-(l=g.y))/2)*g/(r*r))&&(n*=d=Math.sqrt(d),r*=d),d=n*n,y=r*r,m=(a=(a===o?-1:1)*Math.sqrt(Math.abs((d*y-d*g*g-y*p*p)/(d*g*g+y*p*p))))*n*g/r+(t+s)/2,v=a*-r*p/n+(e+l)/2,b=Math.asin(((e-v)/r*Math.pow(10,9)>>0)/Math.pow(10,9)),x=Math.asin(((l-v)/r*Math.pow(10,9)>>0)/Math.pow(10,9)),b=t<m?Math.PI-b:b,x=s<m?Math.PI-x:x,b<0&&(b=2*Math.PI+b),x<0&&(x=2*Math.PI+x),o&&x<b&&(b-=2*Math.PI),!o&&b<x&&(x-=2*Math.PI)),x-b),p=(Math.abs(d)>u&&(y=x,g=s,a=l,x=b+u*(o&&b<x?1:-1),f=ye(s=m+n*Math.cos(x),l=v+r*Math.sin(x),n,r,i,0,o,g,a,[x,y,m,v])),d=x-b,Math.cos(b)),u=Math.sin(b),i=Math.cos(x),o=Math.sin(x),g=Math.tan(d/4),a=4/3*n*g,y=4/3*r*g,m=[t,e],v=[t+a*u,e-y*p],b=[s+a*o,l-y*i],x=[s,l];if(v[0]=2*m[0]-v[0],v[1]=2*m[1]-v[1],c)return v.concat(b,x,f);for(var w=[],M=0,O=(f=v.concat(b,x,f)).length;M<O;M+=1)w[M]=M%2?ge(f[M-1],f[M],h).y:ge(f[M],f[M+1],h).x;return w}function me(t,e,n){var r=t[0],t=t[1];return[r+(e[0]-r)*n,t+(e[1]-t)*n]}function ve(t,e,n,r){return O(O([],me([t,e],[n,r],.5),!0),[n,r,n,r],!1)}function be(t,e){var n;if(void 0===e&&(e=!1),se(n=t)&&n.every(function(t){t=t[0];return"MC".includes(t)}))return n=[].concat(t),e?[n,[]]:n;for(var r,i=pe(t),a=m({},re),o=[],s="",l=i.length,c=[],u=0;u<l;u+=1){i[u]&&(s=i[u][0]),o[u]=s;var h=function(t,e){var n,r,i,a,o,s,l=t[0],c=t.slice(1).map(Number),u=c[0],h=c[1],f=e.x1,d=e.y1,p=e.x,g=e.y;switch("TQ".includes(l)||(e.qx=null,e.qy=null),l){case"M":return e.x=u,e.y=h,t;case"A":return s=[f,d].concat(c),["C"].concat(ye(s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],s[8],s[9]));case"Q":return e.qx=u,e.qy=h,s=[f,d].concat(c),["C"].concat((n=s[0],r=s[1],i=s[2],a=s[3],o=s[4],s=s[5],[1/3*n+2/3*i,1/3*r+2/3*a,1/3*o+2/3*i,1/3*s+2/3*a,o,s]));case"L":return["C"].concat(ve(f,d,u,h));case"Z":return f===p&&d===g?["C",f,d,p,g,p,g]:["C"].concat(ve(f,d,p,g))}return t}(i[u],a),f=(i[u]=h,y=g=p=d=f=void 0,i),d=o,p=u;if(7<f[p].length){f[p].shift();for(var g=f[p],y=p;g.length;)d[p]="A",f.splice(y+=1,0,["C"].concat(g.splice(0,6)));f.splice(p,1)}l=i.length,"Z"===s&&c.push(u),r=(h=i[u]).length,a.x1=+h[r-2],a.y1=+h[r-1],a.x2=+h[r-4]||a.x1,a.y2=+h[r-3]||a.y1}return e?[i,c]:i}function xe(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function we(t,e,n,r,i){var a=xe([t,e],[n,r]),o={x:0,y:0};return{length:a,point:o="number"==typeof i?i<=0?{x:t,y:e}:a<=i?{x:n,y:r}:{x:(i=me([t,e],[n,r],i/a))[0],y:i[1]}:o,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function Me(t,e){var n=t.x,t=t.y,r=e.x,e=e.y,i=n*r+t*e,a=Math.sqrt((Math.pow(n,2)+Math.pow(t,2))*(Math.pow(r,2)+Math.pow(e,2)));return(n*e-t*r<0?-1:1)*Math.acos(i/a)}function Oe(t,e,n,r,i,I,B,a,o,s,l){var c=l.bbox,D=void 0===c||c,c=l.length,F=void 0===c||c,c=l.sampleSize,u=void 0===c?30:c,h="number"==typeof s,f=t,d=e,p=0,g=[f,d,p],y=[f,d],m={x:0,y:0},v=[{x:f,y:d}];h&&s<=0&&(m={x:f,y:d});for(var b,x,w,M,O,k,E,S,A,_,T,P,C,L,N,j,R=0;R<=u;R+=1)b=t,x=e,w=n,M=r,O=i,k=I,E=B,S=a,A=o,_=R/u,P=j=N=L=C=P=T=void 0,P=Math.abs,C=Math.sin,L=Math.cos,N=Math.sqrt,j=Math.PI,w=P(w),P=P(M),M=j/180*((O%360+360)%360),f=(T=b===S&&x===A?{x:b,y:x}:0===w||0===P?we(b,x,S,A,_).point:(O=(b-S)/2,T=(x-A)/2,O={x:L(M)*O+C(M)*T,y:-C(M)*O+L(M)*T},1<(T=Math.pow(O.x,2)/Math.pow(w,2)+Math.pow(O.y,2)/Math.pow(P,2))&&(w*=N(T),P*=N(T)),T=(Math.pow(w,2)*Math.pow(P,2)-Math.pow(w,2)*Math.pow(O.y,2)-Math.pow(P,2)*Math.pow(O.x,2))/(Math.pow(w,2)*Math.pow(O.y,2)+Math.pow(P,2)*Math.pow(O.x,2)),k=(k!==E?1:-1)*N(T<0?0:T),N=w*O.y/P*k,T=-P*O.x/w*k,k=L(M)*N-C(M)*T+(b+S)/2,b=C(M)*N+L(M)*T+(x+A)/2,x=Me({x:1,y:0},S={x:(O.x-N)/w,y:(O.y-T)/P}),A=Me(S,{x:(-O.x-N)/w,y:(-O.y-T)/P}),!E&&0<A?A-=2*j:E&&A<0&&(A+=2*j),S=x+(A%=2*j)*_,N=w*L(S),O=P*C(S),{x:L(M)*N-C(M)*O+k,y:C(M)*N+L(M)*O+b})).x,d=T.y,D&&v.push({x:f,y:d}),F&&(p+=xe(y,[f,d])),y=[f,d],h&&s<=p&&s>g[2]&&(E=(p-s)/(p-g[2]),m={x:y[0]*(1-E)+g[0]*E,y:y[1]*(1-E)+g[1]*E}),g=[f,d,p];return{length:p,point:m=h&&p<=s?{x:a,y:o}:m,min:{x:Math.min.apply(null,v.map(function(t){return t.x})),y:Math.min.apply(null,v.map(function(t){return t.y}))},max:{x:Math.max.apply(null,v.map(function(t){return t.x})),y:Math.max.apply(null,v.map(function(t){return t.y}))}}}function ke(t,e,n,r,i,a,o,s,l,c){var u=c.bbox,h=void 0===u||u,u=c.length,f=void 0===u||u,u=c.sampleSize,d=void 0===u?10:u,p="number"==typeof l,g=t,y=e,m=0,v=[g,y,m],b=[g,y],x={x:0,y:0},w=[{x:g,y:y}];p&&l<=0&&(x={x:g,y:y});for(var M,O,k,E,S,A,_,T,P,C,L=0;L<=d;L+=1)M=t,O=e,k=n,E=r,S=i,A=a,_=o,T=s,C=void 0,C=1-(P=L/d),g=(M={x:Math.pow(C,3)*M+3*Math.pow(C,2)*P*k+3*C*Math.pow(P,2)*S+Math.pow(P,3)*_,y:Math.pow(C,3)*O+3*Math.pow(C,2)*P*E+3*C*Math.pow(P,2)*A+Math.pow(P,3)*T}).x,y=M.y,h&&w.push({x:g,y:y}),f&&(m+=xe(b,[g,y])),b=[g,y],p&&l<=m&&l>v[2]&&(k=(m-l)/(m-v[2]),x={x:b[0]*(1-k)+v[0]*k,y:b[1]*(1-k)+v[1]*k}),v=[g,y,m];return{length:m,point:x=p&&m<=l?{x:o,y:s}:x,min:{x:Math.min.apply(null,w.map(function(t){return t.x})),y:Math.min.apply(null,w.map(function(t){return t.y}))},max:{x:Math.max.apply(null,w.map(function(t){return t.x})),y:Math.max.apply(null,w.map(function(t){return t.y}))}}}function Ee(t,e,n,r,i,a,o,s){var l=s.bbox,c=void 0===l||l,l=s.length,u=void 0===l||l,l=s.sampleSize,h=void 0===l?10:l,f="number"==typeof o,d=t,p=e,g=0,y=[d,p,g],m=[d,p],v={x:0,y:0},b=[{x:d,y:p}];f&&o<=0&&(v={x:d,y:p});for(var x,w,M,O,k,E,S,A,_=0;_<=h;_+=1)x=t,w=e,M=n,O=r,k=i,E=a,A=void 0,A=1-(S=_/h),d=(x={x:Math.pow(A,2)*x+2*A*S*M+Math.pow(S,2)*k,y:Math.pow(A,2)*w+2*A*S*O+Math.pow(S,2)*E}).x,p=x.y,c&&b.push({x:d,y:p}),u&&(g+=xe(m,[d,p])),m=[d,p],f&&o<=g&&o>y[2]&&(M=(g-o)/(g-y[2]),v={x:m[0]*(1-M)+y[0]*M,y:m[1]*(1-M)+y[1]*M}),y=[d,p,g];return{length:g,point:v=f&&g<=o?{x:i,y:a}:v,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,b.map(function(t){return t.x})),y:Math.max.apply(null,b.map(function(t){return t.y}))}}}function Se(t,e,n){for(var r,i,a,o=pe(t),s="number"==typeof e,l=[],c=0,u=0,h=0,f=0,d=[],p=[],g=0,y={x:0,y:0},m=y,v=y,b=y,x=0,w=0,M=o.length;w<M;w+=1)l=(r="M"===(i=(a=o[w])[0]))?l:[c,u].concat(a.slice(1)),r?(m=y={x:h=a[1],y:f=a[2]},g=0,s&&e<.001&&(b=y)):"L"===i?(g=(r=we(l[0],l[1],l[2],l[3],(e||0)-x)).length,y=r.min,m=r.max,v=r.point):"A"===i?(g=(r=Oe(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],l[8],(e||0)-x,n||{})).length,y=r.min,m=r.max,v=r.point):"C"===i?(g=(r=ke(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],(e||0)-x,n||{})).length,y=r.min,m=r.max,v=r.point):"Q"===i?(g=(r=Ee(l[0],l[1],l[2],l[3],l[4],l[5],(e||0)-x,n||{})).length,y=r.min,m=r.max,v=r.point):"Z"===i&&(g=(r=we((l=[c,u,h,f])[0],l[1],l[2],l[3],(e||0)-x)).length,y=r.min,m=r.max,v=r.point),s&&x<e&&e<=x+g&&(b=v),p.push(m),d.push(y),x+=g,c=(r="Z"!==i?a.slice(-2):[h,f])[0],u=r[1];return{length:x,point:b=s&&x<=e?{x:c,y:u}:b,min:{x:Math.min.apply(null,d.map(function(t){return t.x})),y:Math.min.apply(null,d.map(function(t){return t.y}))},max:{x:Math.max.apply(null,p.map(function(t){return t.x})),y:Math.max.apply(null,p.map(function(t){return t.y}))}}}function Ae(t){return(c=l=s=0)<=be(t).map(function(t){var e,n,r,i,a,o;return"M"===t[0]?(s=t[1],l=t[2],0):(o=t.slice(1),e=o[0],n=o[1],r=o[2],i=o[3],a=o[4],o=o[5],c=3*((o-l)*(e+r)-(a-s)*(n+i)+n*(s-r)-e*(l-i)+o*(r+s/3)-a*(i+l/3))/20,n=t.slice(-2),s=n[0],l=n[1],c)}).reduce(function(t,e){return t+e},0);var s,l,c}function _e(t){return t.map(function(t,e,n){var r,i,a,o,n=e&&n[e-1].slice(-2).concat(t.slice(1)),s=e?ke(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],{bbox:!1}).length:0,n=e?s?(void 0===r&&(r=.5),n=(e=n).slice(0,2),i=e.slice(2,4),a=e.slice(4,6),e=e.slice(6,8),n=me(n,i,r),i=me(i,a,r),a=me(a,e,r),o=me(n,i,r),i=me(i,a,r),r=me(o,i,r),[["C"].concat(n,o,r),["C"].concat(i,a,e)]):[t,t]:[t];return{s:t,ss:n,l:s}})}var Te=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},Pe=function(t){return"function"==typeof t},P=function(t){return null==t},Ce={}.toString,Le=function(t,e){return Ce.call(t)==="[object "+e+"]"},Ne=function(t){return Array.isArray?Array.isArray(t):Le(t,"Array")},je=function(t){var e=typeof t;return null!==t&&"object"==e||"function"==e};var Re=function(t){return"object"==typeof t&&null!==t},Ie=function(t){if(!Re(t)||!Le(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},Be=function(t){if(Ne(t))return t.reduce(function(t,e){return Math.max(t,e)},t[0])},De=function(t){if(Ne(t))return t.reduce(function(t,e){return Math.min(t,e)},t[0])},Fe=function(t,n,e){if(!Ne(t)&&!Ie(t))return t;var r=e,i=t,a=function(t,e){r=n(r,t,e)};if(i)if(Ne(i))for(var o=0,s=i.length;o<s&&!1!==a(i[o],o);o++);else if(je(i))for(var l in i)if(i.hasOwnProperty(l)&&!1===a(i[l],l))break;return r},ze=function(t){return Le(t,"String")};var We=function(t,e,n){return t<e?e:n<t?n:t},Ge=function(t){return Le(t,"Number")};function He(t,e,n){return void 0===n&&(n=1e-5),Math.abs(t-e)<n}function Ve(t){return P(t)?"":t.toString()}var Ye=function(t,e){return(t%e+e)%e},qe=function(t){t=Ve(t);return t.charAt(0).toLowerCase()+t.substring(1)};function $e(t){if("object"!=typeof t||null===t)return t;if(Ne(t))for(var e=[],n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=$e(t[n]):e[n]=t[n];else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=$e(t[i]):e[i]=t[i];return e}var Ue=function(t){t=Ve(t);return t.charAt(0).toUpperCase()+t.substring(1)},Xe=function(t){return Le(t,"Boolean")},Ke=function(t){return void 0===t},Ze=$e;function Qe(r,i,a){var o;return function(){var t=this,e=arguments,n=a&&!o;clearTimeout(o),o=setTimeout(function(){o=null,a||r.apply(t,e)},i),n&&r.apply(t,e)}}function Je(a,o){var s;if(Pe(a))return(s=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,r=o?o.apply(this,t):t[0],i=s.cache;return i.has(r)?i.get(r):(n=a.apply(this,t),i.set(r,n),n)}).cache=new Map,s;throw new TypeError("Expected a function")}var tn=5;function en(t,e,n,r){for(var i in n=n||0,r=r||tn,e){var a;!function(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)}(e,i)||(null!==(a=e[i])&&Ie(a)?(Ie(t[i])||(t[i]={}),n<r?en(t[i],a,n+1,r):t[i]=e[i]):Ne(a)?(t[i]=[],t[i]=t[i].concat(a)):void 0!==a&&(t[i]=a))}}function nn(t,e){if(t===e)return!0;if(t&&e&&!ze(t)&&!ze(e)){if(Te(t)||Te(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=nn(t[r],e[r]));r++);return n}if(Re(t)||Re(e)){var i=Object.keys(t),a=Object.keys(e);if(i.length!==a.length)return!1;for(n=!0,r=0;r<i.length&&(n=nn(t[i[r]],e[i[r]]));r++);return n}}return!1}function rn(t,r){return Fe(t,function(t,e,n){return r.includes(n)||(t[n]=e),t},{})}function an(){}var ot=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)en(t,e[r]);return t},on=nn,sn=function(t,e,n){for(var r=0,i=ze(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},ln=function(n,r,i){function a(){u=!1===i.leading?0:Date.now(),o=null,c=n.apply(s,l),o||(s=l=null)}function t(){var t=Date.now(),e=(u||!1!==i.leading||(u=t),r-(t-u));return s=this,l=arguments,e<=0||r<e?(o&&(clearTimeout(o),o=null),u=t,c=n.apply(s,l),o||(s=l=null)):o||!1===i.trailing||(o=setTimeout(a,e)),c}var o,s,l,c,u=0;i=i||{};return t.cancel=function(){clearTimeout(o),u=0,o=s=l=null},t};function cn(t,e,n){(t.prototype=e.prototype=n).constructor=t}function un(t,e){var n,r=Object.create(t.prototype);for(n in e)r[n]=e[n];return r}function hn(){}var e="\\s*([+-]?\\d+)\\s*",n="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",fn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",dn=/^#([0-9a-f]{3,8})$/,pn=new RegExp("^rgb\\("+[e,e,e]+"\\)$"),gn=new RegExp("^rgb\\("+[fn,fn,fn]+"\\)$"),yn=new RegExp("^rgba\\("+[e,e,e,n]+"\\)$"),mn=new RegExp("^rgba\\("+[fn,fn,fn,n]+"\\)$"),vn=new RegExp("^hsl\\("+[n,fn,fn]+"\\)$"),bn=new RegExp("^hsla\\("+[n,fn,fn,n]+"\\)$"),xn={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 wn(){return this.rgb().formatHex()}function Mn(){return this.rgb().formatRgb()}function On(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=dn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?kn(e):3===n?new Sn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?En(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?En(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=pn.exec(t))?new Sn(e[1],e[2],e[3],1):(e=gn.exec(t))?new Sn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=yn.exec(t))?En(e[1],e[2],e[3],e[4]):(e=mn.exec(t))?En(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=vn.exec(t))?Pn(e[1],e[2]/100,e[3]/100,1):(e=bn.exec(t))?Pn(e[1],e[2]/100,e[3]/100,e[4]):xn.hasOwnProperty(t)?kn(xn[t]):"transparent"===t?new Sn(NaN,NaN,NaN,0):null}function kn(t){return new Sn(t>>16&255,t>>8&255,255&t,1)}function En(t,e,n,r){return new Sn(t=r<=0?e=n=NaN:t,e,n,r)}function Sn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function An(){return"#"+Tn(this.r)+Tn(this.g)+Tn(this.b)}function _n(){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 Tn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Pn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||1<=n?t=e=NaN:e<=0&&(t=NaN),new Ln(t,e,n,r)}function Cn(t){var e,n,r,i,a,o,s,l;return t instanceof Ln?new Ln(t.h,t.s,t.l,t.opacity):(t=t instanceof hn?t:On(t))?t instanceof Ln?t:(e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=NaN,l=((a=Math.max(e,n,r))+i)/2,(s=a-i)?(o=e===a?(n-r)/s+6*(n<r):n===a?(r-e)/s+2:(e-n)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=0<l&&l<1?0:o,new Ln(o,s,l,t.opacity)):new Ln}function Ln(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Nn(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 jn(t,e,n,r){t-=n,n=e-r;return Math.sqrt(t*t+n*n)}function Rn(t,e){var n=Math.min.apply(Math,O([],j(t),!1)),r=Math.min.apply(Math,O([],j(e),!1));return{x:n,y:r,width:Math.max.apply(Math,O([],j(t),!1))-n,height:Math.max.apply(Math,O([],j(e),!1))-r}}function In(t,e,n,r,i,a,o){for(var s=Math.atan(-r/n*Math.tan(i)),l=1/0,c=-1/0,u=[a,o],h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var f=s+h;a<o?a<f&&f<o&&u.push(f):o<f&&f<a&&u.push(f)}for(var d,p,g,h=0;h<u.length;h++){d=t,y=r,p=i,g=u[h];var y=n*Math.cos(p)*Math.cos(g)-y*Math.sin(p)*Math.sin(g)+d;y<l&&(l=y),c<y&&(c=y)}for(var m=Math.atan(r/(n*Math.tan(i))),v=1/0,b=-1/0,x=[a,o],h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var w=m+h;a<o?a<w&&w<o&&x.push(w):o<w&&w<a&&x.push(w)}for(var M,O,k,h=0;h<x.length;h++){M=e,E=r,O=i,k=x[h];var E=n*Math.sin(O)*Math.cos(k)+E*Math.cos(O)*Math.sin(k)+M;E<v&&(v=E),b<E&&(b=E)}return{x:l,y:v,width:c-l,height:b-v}}cn(hn,On,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:wn,formatHex:wn,formatHsl:function(){return Cn(this).formatHsl()},formatRgb:Mn,toString:Mn}),cn(Sn,function(t,e,n,r){return 1===arguments.length?(i=(i=t)instanceof hn?i:On(i))?new Sn((i=i.rgb()).r,i.g,i.b,i.opacity):new Sn:new Sn(t,e,n,null==r?1:r);var i},un(hn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Sn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Sn(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:An,formatHex:An,formatRgb:_n,toString:_n})),cn(Ln,function(t,e,n,r){return 1===arguments.length?Cn(t):new Ln(t,e,n,null==r?1:r)},un(hn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Ln(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Ln(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,e=n+(n<.5?n:1-n)*e,n=2*n-e;return new Sn(Nn(240<=t?t-240:120+t,n,e),Nn(t,n,e),Nn(t<120?240+t:t-120,n,e),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+")")}}));function Bn(t,e,n,r,i,a){for(var o=-1,s=1/0,l=[n,r],c=20,u=1/(c=a&&200<a?a/10:c),h=u/10,f=0;f<=c;f++){var d=f*u,p=[i.apply(void 0,O([],j(t.concat([d])),!1)),i.apply(void 0,O([],j(e.concat([d])),!1))];(m=jn(l[0],l[1],p[0],p[1]))<s&&(o=d,s=m)}if(0===o)return{x:t[0],y:e[0]};if(1===o)return{x:t[(n=t.length)-1],y:e[n-1]};for(s=1/0,f=0;f<32&&!(h<1e-4);f++){var g=o-h,y=o+h,p=[i.apply(void 0,O([],j(t.concat([g])),!1)),i.apply(void 0,O([],j(e.concat([g])),!1))],m=jn(l[0],l[1],p[0],p[1]);0<=g&&m<s?(o=g,s=m):(g=[i.apply(void 0,O([],j(t.concat([y])),!1)),i.apply(void 0,O([],j(e.concat([y])),!1))],g=jn(l[0],l[1],g[0],g[1]),y<=1&&g<s?(o=y,s=g):h*=.5)}return{x:i.apply(void 0,O([],j(t.concat([o])),!1)),y:i.apply(void 0,O([],j(e.concat([o])),!1))}}function Dn(t,e,n,r){return jn(t,e,n,r)}function Fn(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function zn(t,e,n,r,i,a){var o,s,l,n=[n-t,r-e];return(r=n)[0]===(o=[0,0])[0]&&r[1]===o[1]?Math.sqrt((i-t)*(i-t)+(a-e)*(a-e)):(s=(n=o=r=[-n[1],n[0]])[0],l=n[1],0<(s=s*s+l*l)&&(s=1/Math.sqrt(s)),o[0]=n[0]*s,o[1]=n[1]*s,l=[i-t,a-e],Math.abs(l[0]*r[0]+l[1]*r[1]))}function Wn(t,e,n,r,i){var a=1-i;return a*a*a*t+3*e*i*a*a+3*n*i*i*a+r*i*i*i}function Gn(t,e,n,r){var i,a,r=-3*t+9*e-9*n+3*r,n=6*t-12*e+6*n,e=3*e-3*t,t=[];return He(r,0)?He(n,0)||0<=(i=-e/n)&&i<=1&&t.push(i):He(e=n*n-4*r*e,0)?t.push(-n/(2*r)):0<e&&(a=(-n-(e=Math.sqrt(e)))/(2*r),0<=(i=(-n+e)/(2*r))&&i<=1&&t.push(i),0<=a)&&a<=1&&t.push(a),t}function Hn(t,e,n,r,i,a,o,s,l,c,u){t=Bn([t,n,i,o],[e,r,a,s],l,c,Wn,u);return jn(t.x,t.y,l,c)}function Vn(t){var e=t;if(e.length<2)return 0;for(var n=0,r=0;r<e.length-1;r++){var i=e[r],a=e[r+1];n+=jn(i[0],i[1],a[0],a[1])}return n}function Yn(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function qn(t,e,n){n=t+n-2*e;return He(n,0)?[.5]:(t=(t-e)/n)<=1&&0<=t?[t]:[]}function $n(t,e,n,r,i,a,o,s){t=Bn([t,n,i],[e,r,a],o,s,Yn);return jn(t.x,t.y,o,s)}function Un(t,e,n,r,i){!function t(e,n,r,i,a){for(;r<i;){600<i-r&&(o=i-r+1,u=n-r+1,l=Math.log(o),s=.5*Math.exp(2*l/3),l=.5*Math.sqrt(l*s*(o-s)/o)*(u-o/2<0?-1:1),c=Math.max(r,Math.floor(n-u*s/o+l)),u=Math.min(i,Math.floor(n+(o-u)*s/o+l)),t(e,n,c,u,a));var o,s,l,c,u,h=e[n],f=r,d=i;for(Xn(e,r,n),0<a(e[i],h)&&Xn(e,r,i);f<d;){for(Xn(e,f,d),f++,d--;a(e[f],h)<0;)f++;for(;0<a(e[d],h);)d--}0===a(e[r],h)?Xn(e,r,d):Xn(e,++d,i),d<=n&&(r=d+1),n<=d&&(i=d-1)}}(t,e,n||0,r||t.length-1,i||Kn)}function Xn(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Kn(t,e){return t<e?-1:e<t?1:0}function Zn(t,e){Qn(t,0,t.children.length,e,t)}function Qn(t,e,n,r,i){(i=i||or(null)).minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var a=e;a<n;a++){var o=t.children[a];Jn(i,t.leaf?r(o):o)}return i}function Jn(t,e){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)}function tr(t,e){return t.minX-e.minX}function er(t,e){return t.minY-e.minY}function nr(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function rr(t){return t.maxX-t.minX+(t.maxY-t.minY)}function ir(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function ar(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function or(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function sr(t,e,n,r,i){for(var a,o=[e,n];o.length;)(n=o.pop())-(e=o.pop())<=r||(Un(t,a=e+Math.ceil((n-e)/r/2)*r,e,n,i),o.push(e,a,a,n))}(e=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()}).prototype.all=function(){return this._all(this.data,[])},e.prototype.search=function(t){var e=this.data,n=[];if(ar(t,e))for(var r=this.toBBox,i=[];e;){for(var a=0;a<e.children.length;a++){var o=e.children[a],s=e.leaf?r(o):o;ar(t,s)&&(e.leaf?n.push(o):ir(t,s)?this._all(o,n):i.push(o))}e=i.pop()}return n},e.prototype.collides=function(t){var e=this.data;if(ar(t,e))for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],a=e.leaf?this.toBBox(i):i;if(ar(t,a)){if(e.leaf||ir(t,a))return!0;n.push(i)}}e=n.pop()}return!1},e.prototype.load=function(t){if(t&&t.length)if(t.length<this._minEntries)for(var e=0;e<t.length;e++)this.insert(t[e]);else{var n,r=this._build(t.slice(),0,t.length-1,0);this.data.children.length?this.data.height===r.height?this._splitRoot(this.data,r):(this.data.height<r.height&&(n=this.data,this.data=r,r=n),this._insert(r,this.data.height-r.height-1,!0)):this.data=r}return this},e.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},e.prototype.clear=function(){return this.data=or([]),this},e.prototype.remove=function(t,e){if(t)for(var n,r,i,a=this.data,o=this.toBBox(t),s=[],l=[];a||s.length;){if(a||(a=s.pop(),r=s[s.length-1],n=l.pop(),i=!0),a.leaf){var c=function(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}(t,a.children,e);if(-1!==c)return a.children.splice(c,1),s.push(a),this._condense(s),this}i||a.leaf||!ir(a,o)?r?(n++,a=r.children[n],i=!1):a=null:(s.push(a),l.push(n),a=(r=a).children[n=0])}return this},e.prototype.toBBox=function(t){return t},e.prototype.compareMinX=function(t,e){return t.minX-e.minX},e.prototype.compareMinY=function(t,e){return t.minY-e.minY},e.prototype.toJSON=function(){return this.data},e.prototype.fromJSON=function(t){return this.data=t,this},e.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},e.prototype._build=function(t,e,n,r){var i,a=n-e+1,o=this._maxEntries;if(a<=o)Zn(i=or(t.slice(e,n+1)),this.toBBox);else{r||(r=Math.ceil(Math.log(a)/Math.log(o)),o=Math.ceil(a/Math.pow(o,r-1))),(i=or([])).leaf=!1,i.height=r;var s=Math.ceil(a/o),l=s*Math.ceil(Math.sqrt(o));sr(t,e,n,l,this.compareMinX);for(var c=e;c<=n;c+=l){var u=Math.min(c+l-1,n);sr(t,c,u,s,this.compareMinY);for(var h=c;h<=u;h+=s){var f=Math.min(h+s-1,u);i.children.push(this._build(t,h,f,r-1))}}Zn(i,this.toBBox)}return i},e.prototype._chooseSubtree=function(t,e,n,r){for(;;){if(r.push(e),e.leaf||r.length-1===n)break;for(var i=1/0,a=1/0,o=void 0,s=0;s<e.children.length;s++){var l=e.children[s],c=nr(l),u=(h=t,u=l,(Math.max(u.maxX,h.maxX)-Math.min(u.minX,h.minX))*(Math.max(u.maxY,h.maxY)-Math.min(u.minY,h.minY))-c);u<a?(a=u,i=c<i?c:i,o=l):u===a&&c<i&&(i=c,o=l)}e=o||e.children[0]}var h,u;return e},e.prototype._insert=function(t,e,n){var n=n?t:this.toBBox(t),r=[],i=this._chooseSubtree(n,this.data,e,r);for(i.children.push(t),Jn(i,n);0<=e&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)},e.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries,i=(this._chooseSplitAxis(n,i,r),this._chooseSplitIndex(n,i,r)),r=or(n.children.splice(i,n.children.length-i));r.height=n.height,r.leaf=n.leaf,Zn(n,this.toBBox),Zn(r,this.toBBox),e?t[e-1].children.push(r):this._splitRoot(n,r)},e.prototype._splitRoot=function(t,e){this.data=or([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Zn(this.data,this.toBBox)},e.prototype._chooseSplitIndex=function(t,e,n){for(var r,i,a,o,s=1/0,l=1/0,c=e;c<=n-e;c++){var u=Qn(t,0,c,this.toBBox),h=Qn(t,c,n,this.toBBox),f=(i=u,f=h,d=o=a=void 0,a=Math.max(i.minX,f.minX),o=Math.max(i.minY,f.minY),d=Math.min(i.maxX,f.maxX),i=Math.min(i.maxY,f.maxY),Math.max(0,d-a)*Math.max(0,i-o)),d=nr(u)+nr(h);f<s?(s=f,r=c,l=d<l?d:l):f===s&&d<l&&(l=d,r=c)}return r||n-e},e.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:tr,i=t.leaf?this.compareMinY:er;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},e.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,a=Qn(t,0,e,i),o=Qn(t,n-e,n,i),s=rr(a)+rr(o),l=e;l<n-e;l++){var c=t.children[l];Jn(a,t.leaf?i(c):c),s+=rr(a)}for(var u=n-e-1;e<=u;u--){var h=t.children[u];Jn(o,t.leaf?i(h):h),s+=rr(o)}return s},e.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;0<=r;r--)Jn(e[r],t)},e.prototype._condense=function(t){for(var e=t.length-1,n=void 0;0<=e;e--)0===t[e].children.length?0<e?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():Zn(t[e],this.toBBox)};var k,lr,cr=e,e=((fn=k=k||{}).GROUP="g",fn.CIRCLE="circle",fn.ELLIPSE="ellipse",fn.IMAGE="image",fn.RECT="rect",fn.LINE="line",fn.POLYLINE="polyline",fn.POLYGON="polygon",fn.TEXT="text",fn.PATH="path",fn.HTML="html",fn.MESH="mesh",(n=lr=lr||{})[n.ZERO=0]="ZERO",n[n.NEGATIVE_ONE=1]="NEGATIVE_ONE",ur.prototype.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},ur.prototype.removeAllRenderingPlugins=function(){var e=this;this.plugins.forEach(function(t){t=e.context.renderingPlugins.indexOf(t);0<=t&&e.context.renderingPlugins.splice(t,1)})},ur);function ur(){this.plugins=[]}hr.prototype.registerPlugin=function(e){-1===this.plugins.findIndex(function(t){return t===e})&&this.plugins.push(e)},hr.prototype.unregisterPlugin=function(e){var t=this.plugins.findIndex(function(t){return t===e});-1<t&&this.plugins.splice(t,1)},hr.prototype.getPlugins=function(){return this.plugins},hr.prototype.getPlugin=function(e){return this.plugins.find(function(t){return t.name===e})},hr.prototype.getConfig=function(){return this.config},hr.prototype.setConfig=function(t){Object.assign(this.config,t)};fn=hr;function hr(t){this.clipSpaceNearZ=lr.NEGATIVE_ONE,this.plugins=[],this.config=m({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},t)}function fr(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function dr(t,e,n){t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2]}function pr(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function gr(t,e,n){t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n}function yr(t){return void 0===t?0:360<t||t<-360?t%360:t}function mr(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?Tt(t):Ge(t)?Ct(t,e,n):Ct(t[0],t[1]||e,t[2]||n)}function vr(t){return t*(Math.PI/180)}function br(t){return t*(180/Math.PI)}function xr(t,e){return 16===e.length?(n=t,r=e,o=.5*Math.PI,s=(c=j(vt(v(),r),3))[0],l=c[1],c=c[2],(u=Math.asin(-r[2]/s))<o?-o<u?(i=Math.atan2(r[6]/l,r[10]/c),a=Math.atan2(r[1]/s,r[0]/s)):(a=0,i=-Math.atan2(r[4]/l,r[5]/l)):(a=0,i=Math.atan2(r[4]/l,r[5]/l)),n[0]=i,n[1]=u,n[2]=a,n):(o=t,s=(c=e)[0],r=c[1],l=c[2],c=c[3],.499995*(n=s*s+(i=r*r)+(u=l*l)+(a=c*c))<(t=s*c-r*l)?(o[0]=Math.PI/2,o[1]=2*Math.atan2(r,s),o[2]=0):t<-.499995*n?(o[0]=-Math.PI/2,o[1]=2*Math.atan2(r,s),o[2]=0):(o[0]=Math.asin(2*(s*l-c*r)),o[1]=Math.atan2(2*(s*c+r*l),1-2*(u+a)),o[2]=Math.atan2(2*(s*r+l*c),1-2*(i+u))),o);var n,r,i,a,o,s,l,c,u}function wr(t,e,n,r,i){var a,o,s,l,c=Math.cos(t),t=Math.sin(t);return a=r*c,o=i*t,r=-r*t,t=i*c,c=i=0,e=e,n=n,s=1,(l=new $(9))[0]=a,l[1]=o,l[2]=i,l[3]=r,l[4]=t,l[5]=c,l[6]=e,l[7]=n,l[8]=s,l}function Mr(t){var e=t[0],n=t[1],r=t[3],i=t[4],a=Math.sqrt(e*e+n*n),o=Math.sqrt(r*r+i*i);e*i-n*r<0&&(e<i?a=-a:o=-o),a&&(e*=1/a,n*=1/a);r=br(Math.atan2(n,e));return[t[6],t[7],a,o,r]}var Or=Z(),kr=Z(),Er=qt(),d=[v(),v(),v()],Sr=v();function Ar(t,e,n,r,i,a){if(function(t,e){var n=e[15];if(0===n)return;for(var r=1/n,i=0;i<16;i++)t[i]=e[i]*r;return 1}(Or,t)&&(J(kr,Or),kr[3]=0,kr[7]=0,kr[11]=0,kr[15]=1,!(Math.abs(it(kr))<1e-8))){var t=Or[3],o=Or[7],s=Or[11],l=Or[12],c=Or[13],u=Or[14],h=Or[15];if(0!==t||0!==o||0!==s){if(Er[0]=t,Er[1]=o,Er[2]=s,Er[3]=h,!rt(kr,kr))return;nt(kr,kr),$t(i,Er,kr)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=l,e[1]=c,e[2]=u,t=Or,(o=d)[0][0]=t[0],o[0][1]=t[1],o[0][2]=t[2],o[1][0]=t[4],o[1][1]=t[5],o[1][2]=t[6],o[2][0]=t[8],o[2][1]=t[9],o[2][2]=t[10],n[0]=Pt(d[0]),Bt(d[0],d[0]),r[0]=Dt(d[0],d[1]),_r(d[1],d[1],d[0],1,-r[0]),n[1]=Pt(d[1]),Bt(d[1],d[1]),r[0]/=n[1],r[1]=Dt(d[0],d[2]),_r(d[2],d[2],d[0],1,-r[1]),r[2]=Dt(d[1],d[2]),_r(d[2],d[2],d[1],1,-r[2]),n[2]=Pt(d[2]),Bt(d[2],d[2]),r[1]/=n[2],r[2]/=n[2],Ft(Sr,d[1],d[2]),Dt(d[0],Sr)<0)for(var f=0;f<3;f++)n[f]*=-1,d[f][0]*=-1,d[f][1]*=-1,d[f][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+d[0][0]-d[1][1]-d[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-d[0][0]+d[1][1]-d[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-d[0][0]-d[1][1]+d[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+d[0][0]+d[1][1]+d[2][2],0)),d[2][1]>d[1][2]&&(a[0]=-a[0]),d[0][2]>d[2][0]&&(a[1]=-a[1]),d[1][0]>d[0][1]&&(a[2]=-a[2])}}function _r(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}Pr.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]},Pr.prototype.update=function(t,e){fr(this.center,t),fr(this.halfExtents,e),dr(this.min,this.center,this.halfExtents),pr(this.max,this.center,this.halfExtents)},Pr.prototype.setMinMax=function(t,e){pr(this.center,e,t),gr(this.center,this.center,.5),dr(this.halfExtents,e,t),gr(this.halfExtents,this.halfExtents,.5),fr(this.min,t),fr(this.max,e)},Pr.prototype.getMin=function(){return this.min},Pr.prototype.getMax=function(){return this.max},Pr.prototype.add=function(t){var e,n,r,i,a,o,s,l,c,u,h,f,d,p,g;Pr.isEmpty(t)||(Pr.isEmpty(this)?this.setMinMax(t.getMin(),t.getMax()):(n=(e=this.center)[0],p=e[1],a=e[2],i=(r=this.halfExtents)[0],h=r[1],o=r[2],l=(f=t.center)[0],g=f[1],f=f[2],c=(t=t.halfExtents)[0],(d=g-(u=t[1]))<(s=p-h)&&(s=d),(d=p+h)<(p=g+u)&&(d=p),(g=f-(h=t[2]))<(u=a-o)&&(u=g),(p=a+o)<(t=f+h)&&(p=t),e[0]=.5*((a=(g=l-c)<(a=n-i)?g:a)+(o=(o=n+i)<(f=l+c)?f:o)),e[1]=.5*(s+d),e[2]=.5*(u+p),r[0]=.5*(o-a),r[1]=.5*(d-s),r[2]=.5*(p-u),this.min[0]=a,this.min[1]=s,this.min[2]=u,this.max[0]=o,this.max[1]=d,this.max[2]=p))},Pr.prototype.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,t=t.halfExtents,a=e[0],o=e[4],s=e[8],l=e[1],c=e[5],u=e[9],h=e[2],f=e[6],d=e[10],p=Math.abs(a),g=Math.abs(o),y=Math.abs(s),m=Math.abs(l),v=Math.abs(c),b=Math.abs(u),x=Math.abs(h),w=Math.abs(f),M=Math.abs(d);n[0]=e[12]+a*i[0]+o*i[1]+s*i[2],n[1]=e[13]+l*i[0]+c*i[1]+u*i[2],n[2]=e[14]+h*i[0]+f*i[1]+d*i[2],r[0]=p*t[0]+g*t[1]+y*t[2],r[1]=m*t[0]+v*t[1]+b*t[2],r[2]=x*t[0]+w*t[1]+M*t[2],dr(this.min,n,r),pr(this.max,n,r)},Pr.prototype.intersects=function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),t=t.getMin();return n[0]<=r[0]&&e[0]>=t[0]&&n[1]<=r[1]&&e[1]>=t[1]&&n[2]<=r[2]&&e[2]>=t[2]},Pr.prototype.intersection=function(t){var e,n,r,i;return this.intersects(t)?(e=new Pr,i=[0,0,0],n=this.getMin(),r=t.getMin(),i[0]=Math.max(n[0],r[0]),i[1]=Math.max(n[1],r[1]),i[2]=Math.max(n[2],r[2]),n=i,r=[0,0,0],i=this.getMax(),t=t.getMax(),r[0]=Math.min(i[0],t[0]),r[1]=Math.min(i[1],t[1]),r[2]=Math.min(i[2],t[2]),e.setMinMax(n,r),e):null},Pr.prototype.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?fr([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]]},Pr.prototype.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?fr([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]]};var Tr=Pr;function Pr(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}Nr.prototype.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(0<=this.normal[0])<<8)+(Number(0<=this.normal[1])<<4)+Number(0<=this.normal[2])},Nr.prototype.distanceToPoint=function(t){return Dt(t,this.normal)-this.distance},Nr.prototype.normalize=function(){var t=1/Yt(this.normal);It(this.normal,this.normal,t),this.distance*=t},Nr.prototype.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),r=r/(r-this.distanceToPoint(e)),i=0<=r&&r<=1;return i&&n&&zt(n,t,e,r),i};var Cr,Lr=Nr;function Nr(t,e){this.distance=t||0,this.normal=e||Ct(0,1,0),this.updatePNVertexFlag()}(n=Cr=Cr||{})[n.OUTSIDE=4294967295]="OUTSIDE",n[n.INSIDE=0]="INSIDE",n[n.INDETERMINATE=2147483647]="INDETERMINATE";Rr.prototype.extractFromVPMatrix=function(t){var t=j(t,16),e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=t[10],f=t[11],d=t[12],p=t[13],g=t[14],t=t[15];Nt(this.planes[0].normal,i-e,l-a,f-c),this.planes[0].distance=t-d,Nt(this.planes[1].normal,i+e,l+a,f+c),this.planes[1].distance=t+d,Nt(this.planes[2].normal,i+n,l+o,f+u),this.planes[2].distance=t+p,Nt(this.planes[3].normal,i-n,l-o,f-u),this.planes[3].distance=t-p,Nt(this.planes[4].normal,i-r,l-s,f-h),this.planes[4].distance=t-g,Nt(this.planes[5].normal,i+r,l+s,f+h),this.planes[5].distance=t+g,this.planes.forEach(function(t){t.normalize(),t.updatePNVertexFlag()})};var jr=Rr;function Rr(t){if(this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new Lr)}Br.prototype.clone=function(){return new Br(this.x,this.y)},Br.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y};var Ir=Br;function Br(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}Fr.prototype.toJSON=function(){};var Dr=Fr;function Fr(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}var zr,Wr,Gr,Hr="Method not implemented.",Vr="Use document.documentElement instead.";(n=zr=zr||{})[n.ORBITING=0]="ORBITING",n[n.EXPLORING=1]="EXPLORING",n[n.TRACKING=2]="TRACKING",(n=Wr=Wr||{})[n.DEFAULT=0]="DEFAULT",n[n.ROTATIONAL=1]="ROTATIONAL",n[n.TRANSLATIONAL=2]="TRANSLATIONAL",n[n.CINEMATIC=3]="CINEMATIC",(n=Gr=Gr||{})[n.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",n[n.PERSPECTIVE=1]="PERSPECTIVE";var g,Yr,qr,$r,Ur="updated",n=(r.prototype.isOrtho=function(){return this.projectionMode===Gr.ORTHOGRAPHIC},r.prototype.getProjectionMode=function(){return this.projectionMode},r.prototype.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},r.prototype.getPerspectiveInverse=function(){return this.projectionMatrixInverse},r.prototype.getFrustum=function(){return this.frustum},r.prototype.getPosition=function(){return this.position},r.prototype.getFocalPoint=function(){return this.focalPoint},r.prototype.getDollyingStep=function(){return this.dollyingStep},r.prototype.getNear=function(){return this.near},r.prototype.getFar=function(){return this.far},r.prototype.getZoom=function(){return this.zoom},r.prototype.getOrthoMatrix=function(){return this.orthoMatrix},r.prototype.getView=function(){return this.view},r.prototype.setEnableUpdate=function(t){this.enableUpdate=t},r.prototype.setType=function(t,e){return this.type=t,this.type===zr.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===zr.TRACKING&&void 0!==e&&this.setTrackingMode(e),this},r.prototype.setProjectionMode=function(t){return this.projectionMode=t,this},r.prototype.setTrackingMode=function(t){if(this.type!==zr.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this},r.prototype.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},r.prototype.getViewTransform=function(){return rt(Z(),this.matrix)},r.prototype.getWorldTransform=function(){return this.matrix},r.prototype.jitterProjectionMatrix=function(t,e){t=pt(Z(),[t,e,0]);this.jitteredProjectionMatrix=ct(Z(),t,this.projectionMatrix)},r.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},r.prototype.setMatrix=function(t){return this.matrix=t,this._update(),this},r.prototype.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},r.prototype.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},r.prototype.setNear=function(t){return this.projectionMode===Gr.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this},r.prototype.setFar=function(t){return this.projectionMode===Gr.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this},r.prototype.setViewOffset=function(t,e,n,r,i,a){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=a,this.projectionMode===Gr.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},r.prototype.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===Gr.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},r.prototype.setZoom=function(t){return this.zoom=t,this.projectionMode===Gr.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===Gr.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},r.prototype.setZoomByViewportPoint=function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,n=n.y,i=this.roll,t=(this.rotate(0,0,-i),this.setPosition(r,n),this.setFocalPoint(r,n),this.setZoom(t),this.rotate(0,0,i),this.canvas.viewport2Canvas({x:e[0],y:e[1]})),i=Ct(t.x-r,t.y-n,0),e=Dt(i,this.right)/Pt(this.right),r=Dt(i,this.up)/Pt(this.up);return this.pan(-e,-r),this},r.prototype.setPerspective=function(t,e,n,r){this.projectionMode=Gr.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var i,a,o,s,l,c,n=this.near*Math.tan(vr(.5*this.fov))/this.zoom,e=2*n,r=this.aspect*e,u=-.5*r;return null!=(i=this.view)&&i.enabled&&(i=this.view.fullWidth,a=this.view.fullHeight,u+=this.view.offsetX*r/i,n-=this.view.offsetY*e/a,r*=this.view.width/i,e*=this.view.height/a),i=this.projectionMatrix,u=(a=u)+r,n=(r=n)-e,e=t,t=this.far,o=this.clipSpaceNearZ===lr.ZERO,l=2*e/(r-n),c=(u+a)/(u-a),r=(r+n)/(r-n),n=(o=void 0===o?!1:o)?(s=-t/(t-e),-t*e/(t-e)):(s=-(t+e)/(t-e),-2*t*e/(t-e)),i[0]=2*e/(u-a),i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=l,i[6]=0,i[7]=0,i[8]=c,i[9]=r,i[10]=s,i[11]=-1,i[12]=0,i[13]=0,i[14]=n,i[15]=0,ht(this.projectionMatrix,this.projectionMatrix,Ct(1,-1,1)),rt(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},r.prototype.setOrthographic=function(t,e,n,r,i,a){this.projectionMode=Gr.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=a;var o,e=(this.rright-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.rright+this.left)/2,r=(this.top+this.bottom)/2,s=n-e,n=n+e,e=r+t,r=r-t;return null!=(t=this.view)&&t.enabled&&(t=(this.rright-this.left)/this.view.fullWidth/this.zoom,o=(this.top-this.bottom)/this.view.fullHeight/this.zoom,n=(s+=t*this.view.offsetX)+t*this.view.width,r=(e-=o*this.view.offsetY)-o*this.view.height),(this.clipSpaceNearZ===lr.NEGATIVE_ONE?kt:Et)(this.projectionMatrix,s,n,r,e,i,a),ht(this.projectionMatrix,this.projectionMatrix,Ct(1,-1,1)),rt(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},r.prototype.setPosition=function(t,e,n){t=mr(t,e=void 0===e?this.position[1]:e,n=void 0===n?this.position[2]:n);return this._setPosition(t),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},r.prototype.setFocalPoint=function(t,e,n){void 0===e&&(e=this.focalPoint[1]),void 0===n&&(n=this.focalPoint[2]);var r,i=Ct(0,1,0);return this.focalPoint=mr(t,e,n),this.trackingMode===Wr.CINEMATIC&&(t=(r=Rt(v(),this.focalPoint,this.position))[0],e=r[1],n=r[2],r=Pt(r),e=br(Math.asin(e/r)),r=90+br(Math.atan2(n,t)),dt(n=Z(),n,vr(r)),ft(n,n,vr(e)),i=Wt(v(),[0,1,0],n)),rt(this.matrix,St(Z(),this.position,this.focalPoint,i)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},r.prototype.getDistance=function(){return this.distance},r.prototype.getDistanceVector=function(){return this.distanceVector},r.prototype.setDistance=function(t){var e,n,r;return this.distance===t||t<0||(this.distance=t,this.distance<2e-4&&(this.distance=2e-4),this.dollyingStep=this.distance/100,e=v(),t=this.distance,n=this.forward,r=this.focalPoint,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},r.prototype.setMaxDistance=function(t){return this.maxDistance=t,this},r.prototype.setMinDistance=function(t){return this.minDistance=t,this},r.prototype.setAzimuth=function(t){return this.azimuth=yr(t),this.computeMatrix(),this._getAxes(),this.type===zr.ORBITING||this.type===zr.EXPLORING?this._getPosition():this.type===zr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},r.prototype.getAzimuth=function(){return this.azimuth},r.prototype.setElevation=function(t){return this.elevation=yr(t),this.computeMatrix(),this._getAxes(),this.type===zr.ORBITING||this.type===zr.EXPLORING?this._getPosition():this.type===zr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},r.prototype.getElevation=function(){return this.elevation},r.prototype.setRoll=function(t){return this.roll=yr(t),this.computeMatrix(),this._getAxes(),this.type===zr.ORBITING||this.type===zr.EXPLORING?this._getPosition():this.type===zr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},r.prototype.getRoll=function(){return this.roll},r.prototype._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},r.prototype.computeMatrix=function(){var t=Xt(Ut(),[0,0,1],vr(this.roll)),e=(et(this.matrix),Xt(Ut(),[1,0,0],vr((this.rotateWorld&&this.type!==zr.TRACKING||this.type===zr.TRACKING?1:-1)*this.elevation))),n=Xt(Ut(),[0,1,0],vr((this.rotateWorld&&this.type!==zr.TRACKING||this.type===zr.TRACKING?1:-1)*this.azimuth)),n=Kt(Ut(),n,e),n=Kt(Ut(),n,t),e=wt(Z(),n);this.type===zr.ORBITING||this.type===zr.EXPLORING?(ut(this.matrix,this.matrix,this.focalPoint),ct(this.matrix,this.matrix,e),ut(this.matrix,this.matrix,[0,0,this.distance])):this.type===zr.TRACKING&&(ut(this.matrix,this.matrix,this.position),ct(this.matrix,this.matrix,e))},r.prototype._setPosition=function(t,e,n){this.position=mr(t,e,n);t=this.matrix;t[12]=this.position[0],t[13]=this.position[1],t[14]=this.position[2],t[15]=1,this._getOrthoMatrix()},r.prototype._getAxes=function(){Lt(this.right,mr($t(qt(),[1,0,0,0],this.matrix))),Lt(this.up,mr($t(qt(),[0,1,0,0],this.matrix))),Lt(this.forward,mr($t(qt(),[0,0,1,0],this.matrix))),Bt(this.right,this.right),Bt(this.up,this.up),Bt(this.forward,this.forward)},r.prototype._getAngles=function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=Pt(this.distanceVector);0===r?(this.elevation=0,this.azimuth=0):this.type===zr.TRACKING||this.rotateWorld?(this.elevation=br(Math.asin(e/r)),this.azimuth=br(Math.atan2(-t,-n))):(this.elevation=-br(Math.asin(e/r)),this.azimuth=-br(Math.atan2(-t,-n)))},r.prototype._getPosition=function(){Lt(this.position,mr($t(qt(),[0,0,0,1],this.matrix))),this._getDistance()},r.prototype._getFocalPoint=function(){var t,e;Gt(this.distanceVector,[0,0,-this.distance],(t=U(),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)),jt(this.focalPoint,this.position,this.distanceVector),this._getDistance()},r.prototype._getDistance=function(){this.distanceVector=Rt(v(),this.focalPoint,this.position),this.distance=Pt(this.distanceVector),this.dollyingStep=this.distance/100},r.prototype._getOrthoMatrix=function(){var t,e;this.projectionMode===Gr.ORTHOGRAPHIC&&(t=this.position,e=Xt(Ut(),[0,0,1],-this.roll*Math.PI/180),xt(this.orthoMatrix,e,Ct((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),Ct(this.zoom,this.zoom,1),t))},r.prototype.triggerUpdate=function(){var t;this.enableUpdate&&(t=this.getViewTransform(),t=ct(Z(),this.getPerspective(),t),this.getFrustum().extractFromVPMatrix(t),this.eventEmitter.emit(Ur))},r.prototype.rotate=function(t,e,n){throw new Error(Hr)},r.prototype.pan=function(t,e){throw new Error(Hr)},r.prototype.dolly=function(t){throw new Error(Hr)},r.prototype.createLandmark=function(t,e){throw new Error(Hr)},r.prototype.gotoLandmark=function(t,e){throw new Error(Hr)},r.prototype.cancelLandmarkAnimation=function(){throw new Error(Hr)},r);function r(){this.clipSpaceNearZ=lr.NEGATIVE_ONE,this.eventEmitter=new Y,this.matrix=Z(),this.right=Ct(1,0,0),this.up=Ct(0,1,0),this.forward=Ct(0,0,1),this.position=Ct(0,0,1),this.focalPoint=Ct(0,0,0),this.distanceVector=Ct(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=Z(),this.projectionMatrixInverse=Z(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=zr.EXPLORING,this.trackingMode=Wr.DEFAULT,this.projectionMode=Gr.PERSPECTIVE,this.frustum=new jr,this.orthoMatrix=Z()}function Xr(a,o){if("function"!=typeof a||null!=o&&"function"!=typeof o)throw new TypeError("Expected a function");function s(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,r=o?o.apply(this,t):t[0],i=s.cache;return i.has(r)?i.get(r):(n=a.apply(this,t),s.cache=i.set(r,n)||i,n)}return s.cache=new(Xr.Cache||Map),s}Xr.Cache=Map,(i=g=g||{})[i.kUnknown=0]="kUnknown",i[i.kNumber=1]="kNumber",i[i.kPercentage=2]="kPercentage",i[i.kEms=3]="kEms",i[i.kPixels=4]="kPixels",i[i.kRems=5]="kRems",i[i.kDegrees=6]="kDegrees",i[i.kRadians=7]="kRadians",i[i.kGradians=8]="kGradians",i[i.kTurns=9]="kTurns",i[i.kMilliseconds=10]="kMilliseconds",i[i.kSeconds=11]="kSeconds",i[i.kInteger=12]="kInteger",(i=Yr=Yr||{})[i.kUNumber=0]="kUNumber",i[i.kUPercent=1]="kUPercent",i[i.kULength=2]="kULength",i[i.kUAngle=3]="kUAngle",i[i.kUTime=4]="kUTime",i[i.kUOther=5]="kUOther",(i=qr=qr||{})[i.kYes=0]="kYes",i[i.kNo=1]="kNo",(i=$r=$r||{})[i.kYes=0]="kYes",i[i.kNo=1]="kNo";function Kr(t){var e=1;switch(t){case g.kPixels:case g.kDegrees:case g.kSeconds:break;case g.kMilliseconds:e=.001;break;case g.kRadians:e=180/Math.PI;break;case g.kGradians:e=.9;break;case g.kTurns:e=360}return e}function Zr(t){switch(t){case g.kNumber:case g.kInteger:return"";case g.kPercentage:return"%";case g.kEms:return"em";case g.kRems:return"rem";case g.kPixels:return"px";case g.kDegrees:return"deg";case g.kRadians:return"rad";case g.kGradians:return"grad";case g.kMilliseconds:return"ms";case g.kSeconds:return"s";case g.kTurns:return"turn"}return""}var Qr,Jr=[{name:"em",unit_type:g.kEms},{name:"px",unit_type:g.kPixels},{name:"deg",unit_type:g.kDegrees},{name:"rad",unit_type:g.kRadians},{name:"grad",unit_type:g.kGradians},{name:"ms",unit_type:g.kMilliseconds},{name:"s",unit_type:g.kSeconds},{name:"rem",unit_type:g.kRems},{name:"turn",unit_type:g.kTurns}],ti=((i=Qr=Qr||{})[i.kUnknownType=0]="kUnknownType",i[i.kUnparsedType=1]="kUnparsedType",i[i.kKeywordType=2]="kKeywordType",i[i.kUnitType=3]="kUnitType",i[i.kSumType=4]="kSumType",i[i.kProductType=5]="kProductType",i[i.kNegateType=6]="kNegateType",i[i.kInvertType=7]="kInvertType",i[i.kMinType=8]="kMinType",i[i.kMaxType=9]="kMaxType",i[i.kClampType=10]="kClampType",i[i.kTransformType=11]="kTransformType",i[i.kPositionType=12]="kPositionType",i[i.kURLImageType=13]="kURLImageType",i[i.kColorType=14]="kColorType",i[i.kUnsupportedColorType=15]="kUnsupportedColorType",function(e){return Jr.find(function(t){return t.name===e}).unit_type}),i=(ei.isAngle=function(t){return t===g.kDegrees||t===g.kRadians||t===g.kGradians||t===g.kTurns},ei.isLength=function(t){return t>=g.kEms&&t<g.kDegrees},ei.isRelativeUnit=function(t){return t===g.kPercentage||t===g.kEms||t===g.kRems},ei.isTime=function(t){return t===g.kSeconds||t===g.kMilliseconds},ei.prototype.toString=function(){return this.buildCSSText(qr.kNo,$r.kNo,"")},ei.prototype.isNumericValue=function(){return this.getType()>=Qr.kUnitType&&this.getType()<=Qr.kClampType},ei);function ei(){}t(ai,ni=i),ai.prototype.getType=function(){return Qr.kColorType},ai.prototype.to=function(t){return this};var ni,ri,ii=ai;function ai(t){var e=ni.call(this)||this;return e.colorSpace=t,e}(o=ri=ri||{})[o.Constant=0]="Constant",o[o.LinearGradient=1]="LinearGradient",o[o.RadialGradient=2]="RadialGradient";t(li,oi=i),li.prototype.clone=function(){return new li(this.type,this.value)},li.prototype.buildCSSText=function(t,e,n){return n},li.prototype.getType=function(){return Qr.kColorType};var oi,si=li;function li(t,e){var n=oi.call(this)||this;return n.type=t,n.value=e,n}t(hi,ci=i),hi.prototype.clone=function(){return new hi(this.value)},hi.prototype.getType=function(){return Qr.kKeywordType},hi.prototype.buildCSSText=function(t,e,n){return n+this.value};var ci,ui=hi;function hi(t){var e=ci.call(this)||this;return e.value=t,e}function fi(t){return t.split("").map(function(t,e){return t.toUpperCase()===t?"".concat(0!==e?"-":"").concat(t.toLowerCase()):t}).join("")}var di=Xr(function(t){return(t=void 0===t?"":t).replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})});function pi(t){return"function"==typeof t}function gi(t,e){void 0===e&&(e="");var n="";if(Number.isFinite(t)){if(!Number.isNaN(t))throw new Error;n="NaN"}else n=0<t?"infinity":"-infinity";return n+e}function yi(t){switch(function(t){switch(t){case g.kNumber:case g.kInteger:return Yr.kUNumber;case g.kPercentage:return Yr.kUPercent;case g.kPixels:return Yr.kULength;case g.kMilliseconds:case g.kSeconds:return Yr.kUTime;case g.kDegrees:case g.kRadians:case g.kGradians:case g.kTurns:return Yr.kUAngle;default:return Yr.kUOther}}(t)){case Yr.kUNumber:return g.kNumber;case Yr.kULength:return g.kPixels;case Yr.kUPercent:return g.kPercentage;case Yr.kUTime:return g.kSeconds;case Yr.kUAngle:return g.kDegrees;default:return g.kUnknown}}var mi,vi={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},bi=Xr(function(t){var t=di(t),e=vi[t];return(null==e?void 0:e.alias)||t}),xi=(t(wi,mi=i),wi.prototype.clone=function(){return new wi(this.value,this.unit)},wi.prototype.equals=function(t){return this.value===t.value&&this.unit===t.unit},wi.prototype.getType=function(){return Qr.kUnitType},wi.prototype.convertTo=function(t){var e;return this.unit===t?new wi(this.value,this.unit):(e=yi(this.unit))!==yi(t)||e===g.kUnknown?null:(e=Kr(this.unit)/Kr(t),new wi(this.value*e,t))},wi.prototype.buildCSSText=function(t,e,n){switch(this.unit){case g.kUnknown:break;case g.kInteger:i=Number(this.value).toFixed(0);break;case g.kNumber:case g.kPercentage:case g.kEms:case g.kRems:case g.kPixels:case g.kDegrees:case g.kRadians:case g.kGradians:case g.kMilliseconds:case g.kSeconds:case g.kTurns:var r,i,a=this.value,o=Zr(this.unit);i=a<-999999||999999<a?(r=Zr(this.unit),!Number.isFinite(a)||Number.isNaN(a)?gi(a,r):a+(r||"")):"".concat(a).concat(o)}return n+=i},wi);function wi(t,e){void 0===e&&(e=g.kNumber);var n=mi.call(this)||this,r="string"==typeof e?(r=e)?"number"===r?g.kNumber:"percent"===r||"%"===r?g.kPercentage:ti(r):g.kUnknown:e;return n.unit=r,n.value=t,n}var Mi,Oi=new xi(0,"px"),ki=(new xi(1,"px"),new xi(0,"deg")),Ei=(t(Si,Mi=ii),Si.prototype.clone=function(){return new Si(this.r,this.g,this.b,this.alpha)},Si.prototype.buildCSSText=function(t,e,n){return n+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")},Si);function Si(t,e,n,r,i){void 0===r&&(r=1),void 0===i&&(i=!1);var a=Mi.call(this,"rgb")||this;return a.r=t,a.g=e,a.b=n,a.alpha=r,a.isNone=i,a}function Ai(t){return Ci[t]||(Ci[t]=new ui(t)),Ci[t]}var _i,Ti,a,Pi=new ui("unset"),o=new ui("initial"),i=new ui("inherit"),Ci={"":Pi,unset:Pi,initial:o,inherit:i},Li=new Ei(0,0,0,0,!0),Ni=new Ei(0,0,0,0),ji=Xr(function(t,e,n,r){return new Ei(t,e,n,r)},function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")}),Ri=function(t,e){return void 0===e&&(e=g.kNumber),new xi(t,e)},Ii=new xi(50,"%"),Bi=(_i=_i||{},_i[_i.Standard=0]="Standard",(ii=Ti=Ti||{})[ii.ADDED=0]="ADDED",ii[ii.REMOVED=1]="REMOVED",{absolutePath:[],hasArc:!(ii[ii.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"),segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Dr(0,0,0,0)});(o=a=a||{}).COORDINATE="<coordinate>",o.COLOR="<color>",o.PAINT="<paint>",o.NUMBER="<number>",o.ANGLE="<angle>",o.OPACITY_VALUE="<opacity-value>",o.SHADOW_BLUR="<shadow-blur>",o.LENGTH="<length>",o.PERCENTAGE="<percentage>",o.LENGTH_PERCENTAGE="<length> | <percentage>",o.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",o.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",o.LIST_OF_POINTS="<list-of-points>",o.PATH="<path>",o.FILTER="<filter>",o.Z_INDEX="<z-index>",o.OFFSET_DISTANCE="<offset-distance>",o.DEFINED_PATH="<defined-path>",o.MARKER="<marker>",o.TRANSFORM="<transform>",o.TRANSFORM_ORIGIN="<transform-origin>",o.TEXT="<text>",o.TEXT_TRANSFORM="<text-transform>";Di={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]+\.?))/},Fi="";var Di,Fi,zi=function(t){return Fi=t,Gi()};function Wi(t){throw new Error(Fi+": "+t)}function Gi(){var t=Qi(Hi);return 0<Fi.length&&Wi("Invalid input not EOF"),t}function Hi(){return Vi("linear-gradient",Di.linearGradient,qi)||Vi("repeating-linear-gradient",Di.repeatingLinearGradient,qi)||Vi("radial-gradient",Di.radialGradient,$i)||Vi("repeating-radial-gradient",Di.repeatingRadialGradient,$i)||Vi("conic-gradient",Di.conicGradient,$i)}function Vi(n,t,r){return Yi(t,function(t){var e=r();return e&&!aa(Di.comma)&&Wi("Missing comma before color stops"),{type:n,orientation:e,colorStops:Qi(Ji)}})}function Yi(t,e){t=aa(t);if(t)return aa(Di.startCall)||Wi("Missing ("),e=e(t),aa(Di.endCall)||Wi("Missing )"),e}function qi(){return ia("directional",Di.sideOrCorner,1)||ia("angular",Di.angleValue,1)}function $i(){var t,e,n=Ui();return n&&((t=[]).push(n),e=Fi,aa(Di.comma))&&((n=Ui())?t.push(n):Fi=e),t}function Ui(){var t,e=function(){var t=ia("shape",/^(circle)/i,0);t&&(t.style=ra()||Xi());return t}()||function(){var t=ia("shape",/^(ellipse)/i,0);t&&(t.style=ea()||Xi());return t}();return e?e.at=Ki():(t=Xi())?(e=t,(t=Ki())&&(e.at=t)):(t=Zi())&&(e={type:"default-radial",at:t}),e}function Xi(){return ia("extent-keyword",Di.extentKeywords,1)}function Ki(){var t;if(ia("position",/^at/,0))return(t=Zi())||Wi("Missing positioning value"),t}function Zi(){var t={x:ea(),y:ea()};if(t.x||t.y)return{type:"position",value:t}}function Qi(t){var e=t(),n=[];if(e)for(n.push(e);aa(Di.comma);)(e=t())?n.push(e):Wi("One extra comma");return n}function Ji(){var t=ia("hex",Di.hexColor,1)||Yi(Di.rgbaColor,function(){return{type:"rgba",value:Qi(ta)}})||Yi(Di.rgbColor,function(){return{type:"rgb",value:Qi(ta)}})||ia("literal",Di.literalColor,0);return t||Wi("Expected color definition"),t.length=ea(),t}function ta(){return aa(Di.number)[1]}function ea(){return ia("%",Di.percentageValue,1)||na()||ra()}function na(){return ia("position-keyword",Di.positionKeywords,1)}function ra(){return ia("px",Di.pixelValue,1)||ia("em",Di.emValue,1)}function ia(t,e,n){e=aa(e);if(e)return{type:t,value:e[n]}}function aa(t){var e=/^[\n\r\t\s]+/.exec(Fi),e=(e&&oa(e[0].length),t.exec(Fi));return e&&oa(e[0].length),e}function oa(t){Fi=Fi.substring(t)}var sa=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,la=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,ca=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,ua=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var ha={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},fa=Xr(function(t){t="angular"===t.type?Number(t.value):ha[t.value]||0;return Ri(t,"deg")}),da=Xr(function(t){var e,n=50,r=50,i="%",a="%";return"position"===(null==t?void 0:t.type)&&(e=(t=t.value).x,t=t.y,"position-keyword"===(null==e?void 0:e.type)&&("left"===e.value?n=0:"center"===e.value?n=50:"right"===e.value?n=100:"top"===e.value?r=0:"bottom"===e.value&&(r=100)),"position-keyword"===(null==t?void 0:t.type)&&("left"===t.value?n=0:"center"===t.value?r=50:"right"===t.value?n=100:"top"===t.value?r=0:"bottom"===t.value&&(r=100)),"px"!==(null==e?void 0:e.type)&&"%"!==(null==e?void 0:e.type)&&"em"!==(null==e?void 0:e.type)||(i=null==e?void 0:e.type,n=Number(e.value)),"px"!==(null==t?void 0:t.type)&&"%"!==(null==t?void 0:t.type)&&"em"!==(null==t?void 0:t.type)||(a=null==t?void 0:t.type,r=Number(t.value))),{cx:Ri(n,i),cy:Ri(r,a)}}),pa=Xr(function(t){if(-1<t.indexOf("linear")||-1<t.indexOf("radial"))return zi(t).map(function(t){for(var e,n=t.type,r=t.orientation,t=t.colorStops,i=t,a=i.length,o=(i[a-1].length=null!=(d=i[a-1].length)?d:{type:"%",value:"100"},1<a&&(i[0].length=null!=(d=i[0].length)?d:{type:"%",value:"0"}),0),s=Number(i[0].length.value),l=1;l<a;l++){var c=null==(e=i[l].length)?void 0:e.value;if(!P(c)&&!P(s)){for(var u=1;u<l-o;u++)i[o+u].length={type:"%",value:"".concat(s+(Number(c)-s)*u/(l-o))};o=l,s=Number(c)}}var h,f,d=t.map(function(t){return{offset:Ri(Number(t.length.value),"%"),color:(e=(t=t).type,t=t.value,"hex"===e?"#".concat(t):"literal"===e?t:("rgb"===e?"rgb(":"rgba(").concat(t.join(","),")"))};var e});return"linear-gradient"===n?new si(ri.LinearGradient,{angle:r?fa(r):ki,steps:d}):"radial-gradient"===n&&"shape"===(r=r||[{type:"shape",value:"circle"}])[0].type&&"circle"===r[0].value?(n=(t=da(r[0].at)).cx,t=t.cy,f=void 0,r[0].style&&(h=(r=r[0].style).type,r=r.value,f="extent-keyword"===h?Ai(r):Ri(r,h)),new si(ri.RadialGradient,{cx:n,cy:t,size:f,steps:d})):void 0});var e=t[0];if("("===t[1]||"("===t[2])if("l"===e){var n=sa.exec(t);if(n)return r=(null==(r=n[2].match(ua))?void 0:r.map(function(t){return t.split(":")}))||[],[new si(ri.LinearGradient,{angle:Ri(parseFloat(n[1]),"deg"),steps:r.map(function(t){var t=j(t,2),e=t[0],t=t[1];return{offset:Ri(100*Number(e),"%"),color:t}})})]}else if("r"===e){n=function(t){var t=la.exec(t);if(t)return t=(null==(t=t[4].match(ua))?void 0:t.map(function(t){return t.split(":")}))||[],{cx:Ri(50,"%"),cy:Ri(50,"%"),steps:t.map(function(t){var t=j(t,2),e=t[0],t=t[1];return{offset:Ri(100*Number(e),"%"),color:t}})};return null}(t);if(n&&!ze(n))return[new si(ri.RadialGradient,n)]}else if("p"===e){var r=t;if(r=ca.exec(r)){var i=r[1],r=r[2];switch(i){case"a":i="repeat";break;case"x":i="repeat-x";break;case"y":i="repeat-y";break;default:i="no-repeat"}return{image:r,repetition:i}}return null}});function ga(t){return t&&t.image}function ya(t){return t&&!P(t.r)&&!P(t.g)&&!P(t.b)}var ma=Xr(function(t){var e;return ga(t)?m({repetition:"repeat"},t):"transparent"===(t=P(t)?"":t)?Ni:pa(t="currentColor"===t?"black":t)||(e=[0,0,0,0],null!==(t=On(t))&&(e[0]=t.r||0,e[1]=t.g||0,e[2]=t.b||0,e[3]=t.opacity),ji.apply(void 0,O([],j(e),!1)))});function va(t,e){if(ya(t)&&ya(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(We(e[n],0,255));return e[3]=We(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function ba(t,e){if(P(e))return Ri(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if(0<="px".search(t))return Ri(Number(e),"px");if(0<="deg".search(t))return Ri(Number(e),"deg")}var n=[],r=(e=e.replace(t,function(t){return n.push(t),"U"+t}),"U("+t.source+")");return n.map(function(t){return Ri(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)})[0]}var xa=Xr(function(t){return ba(new RegExp("px","g"),t)}),wa=(Xr(function(t){return ba(new RegExp("%","g"),t)}),function(t){return Ge(t)||isFinite(Number(t))?Ri(Number(t)||0,"px"):ba(new RegExp("px|%|em|rem","g"),t)}),Ma=Xr(function(t){return ba(new RegExp("deg|rad|grad|turn","g"),t)});function Oa(t){var e=0;return t.unit===g.kDegrees?e=t.value:t.unit===g.kRadians?e=br(Number(t.value)):t.unit===g.kTurns&&(e=360*Number(t.value)),e}function ka(t,e){var n;return Array.isArray(t)?n=t.map(function(t){return Number(t)}):ze(t)?n=t.split(" ").map(function(t){return Number(t)}):Ge(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 Ea(t){return ze(t)?t.split(" ").map(function(t){return wa(t)}):t.map(function(t){return wa(t.toString())})}function Sa(t,e,n){return 0===t.value?0:t.unit===g.kPixels?Number(t.value):t.unit===g.kPercentage&&n?(n=n.nodeName===k.GROUP?n.getLocalBounds():n.geometry.contentBounds,t.value/100*n.halfExtents[e]*2):0}var Aa=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function _a(t){if("none"!==(t=(t=void 0===t?"":t).toLowerCase().trim()))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,-1<Aa.indexOf(e[1])&&r.push({name:e[1],params:e[2].split(" ").map(function(t){return ba(/deg|rad|grad|turn|px|%/g,t)||ma(t)})}),n.lastIndex===t.length)return r}return[]}function Ta(t){return t.toString()}var Pa=Xr(function(t){return"number"==typeof t?Ri(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Ri(Number(t)):Ri(0)});function Ca(t,e){return[t,e,Ta]}function La(n,r){return function(t,e){return[t,e,function(t){return Ta(We(t,n,r))}]}}function Na(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function ja(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=Se(t.parsedStyle.path.absolutePath,void 0,m(m({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function Ra(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ia(t,e){for(var n,r,i,a,o,s,l,c,u,h=[],f=[],d=[],p=0;p<t.length;p++){var g=(k=t[p]).currentPoint,y=k.params,m=k.prePoint,v=void 0;switch(k.command){case"Q":b=m[0],n=m[1],r=y[1],i=y[2],a=y[3],o=y[4],u=c=l=s=void 0,s=qn(b,r,a)[0],l=qn(n,i,o)[0],c=[b,a],u=[n,o],void 0!==s&&c.push(Yn(b,r,a,s)),void 0!==l&&u.push(Yn(n,i,o,l)),v=Rn(c,u);break;case"C":v=function(t,e,n,r,i,a,o,s){for(var l=[t,o],c=[e,s],u=Gn(t,n,i,o),h=Gn(e,r,a,s),f=0;f<u.length;f++)l.push(Wn(t,n,i,o,u[f]));for(f=0;f<h.length;f++)c.push(Wn(e,r,a,s,h[f]));return Rn(l,c)}(m[0],m[1],y[1],y[2],y[3],y[4],y[5],y[6]);break;case"A":var b=k.arcParams,v=In(b.cx,b.cy,b.rx,b.ry,b.xRotation,b.startAngle,b.endAngle);break;default:h.push(g[0]),f.push(g[1])}v&&(k.box=v,h.push(v.x,v.x+v.width),f.push(v.y,v.y+v.height)),e&&("L"===k.command||"M"===k.command)&&k.prePoint&&k.nextPoint&&d.push(k)}var h=h.filter(function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}),f=f.filter(function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}),x=De(h),w=De(f),M=Be(h),O=Be(f);if(0!==d.length)for(p=0;p<d.length;p++){var k;(g=(k=d[p]).currentPoint)[0]===x?x-=Ba(k,e).xExtra:g[0]===M&&(M+=Ba(k,e).xExtra),g[1]===w?w-=Ba(k,e).yExtra:g[1]===O&&(O+=Ba(k,e).yExtra)}return{x:x,y:w,width:M-x,height:O-w}}function Ba(t,e){var n=t.prePoint,r=t.currentPoint,t=t.nextPoint,i=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-t[0],2)+Math.pow(r[1]-t[1],2),n=Math.pow(n[0]-t[0],2)+Math.pow(n[1]-t[1],2),n=Math.acos((i+a-n)/(2*Math.sqrt(i)*Math.sqrt(a)));return!n||0===Math.sin(n)||He(n,0)?{xExtra:0,yExtra:0}:(i=Math.abs(Math.atan2(t[1]-r[1],t[0]-r[0])),a=Math.abs(Math.atan2(t[0]-r[0],t[1]-r[1])),i=i>Math.PI/2?Math.PI-i:i,a=a>Math.PI/2?Math.PI-a:a,{xExtra:Math.cos(n/2-i)*(e/2*(1/Math.sin(n/2)))-e/2||0,yExtra:Math.cos(a-n/2)*(e/2*(1/Math.sin(n/2)))-e/2||0})}function Da(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Xr(function(t){return(ze(t)?t.split(" "):t).map(Pa)});function Fa(t,e,n,r,i,a,o,s){var l,c,u;return e=Math.abs(e),n=Math.abs(n),r=vr(r=Ye(r,360)),t.x===o.x&&t.y===o.y?{x:t.x,y:t.y,ellipticalArcAngle:0}:0===e||0===n?{x:0,y:0,ellipticalArcAngle:0}:(u=(t.x-o.x)/2,c=(t.y-o.y)/2,u={x:Math.cos(r)*u+Math.sin(r)*c,y:-Math.sin(r)*u+Math.cos(r)*c},1<(c=Math.pow(u.x,2)/Math.pow(e,2)+Math.pow(u.y,2)/Math.pow(n,2))&&(e=Math.sqrt(c)*e,n=Math.sqrt(c)*n),c=(c=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(u.y,2)-Math.pow(n,2)*Math.pow(u.x,2))/(Math.pow(e,2)*Math.pow(u.y,2)+Math.pow(n,2)*Math.pow(u.x,2)))<0?0:c,i=(i!==a?1:-1)*Math.sqrt(c),c=e*u.y/n*i,i*=-n*u.x/e,t={x:Math.cos(r)*c-Math.sin(r)*i+(t.x+o.x)/2,y:Math.sin(r)*c+Math.cos(r)*i+(t.y+o.y)/2},l=za({x:1,y:0},o={x:(u.x-c)/e,y:(u.y-i)/n}),o=za(o,{x:(-u.x-c)/e,y:(-u.y-i)/n}),!a&&0<o?o-=2*Math.PI:a&&o<0&&(o+=2*Math.PI),c=l+(o%=2*Math.PI)*s,u=e*Math.cos(c),i=n*Math.sin(c),{x:Math.cos(r)*u-Math.sin(r)*i+t.x,y:Math.sin(r)*u+Math.cos(r)*i+t.y,ellipticalArcStartAngle:l,ellipticalArcEndAngle:l+o,ellipticalArcAngle:c,ellipticalArcCenter:t,resultantRx:e,resultantRy:n})}var za=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)};function Wa(t){for(var e=[],n=null,r=null,i=null,a=0,o=t.length,s=0;s<o;s++){var l=t[s],r=t[s+1],c=l[0],u={command:c,prePoint:n,params:l,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(c){case"M":i=[l[1],l[2]],a=s;break;case"A":var h=function(t,e){var n=e[1],r=e[2],i=Ye(vr(e[3]),2*Math.PI),a=e[4],o=e[5],s=t[0],l=t[1],c=e[6],e=e[7],u=Math.cos(i)*(s-c)/2+Math.sin(i)*(l-e)/2,h=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(l-e)/2,f=u*u/(n*n)+h*h/(r*r);1<f&&(n*=Math.sqrt(f),r*=Math.sqrt(f));f=n*n*(h*h)+r*r*(u*u),f=f?Math.sqrt((n*n*(r*r)-f)/f):1;a===o&&(f*=-1);isNaN(f)&&(f=0);var d=r?f*n*h/r:0,f=n?f*-r*u/n:0,s=(s+c)/2+Math.cos(i)*d-Math.sin(i)*f,l=(l+e)/2+Math.sin(i)*d+Math.cos(i)*f,p=[(u-d)/n,(h-f)/r],u=[(-1*u-d)/n,(-1*h-f)/r],d=Ya([1,0],p),h=Ya(p,u);Va(p,u)<=-1&&(h=Math.PI);1<=Va(p,u)&&(h=0);0===o&&0<h&&(h-=2*Math.PI);1===o&&h<0&&(h+=2*Math.PI);return{cx:s,cy:l,rx:Ra(t,[c,e])?0:n,ry:Ra(t,[c,e])?0:r,startAngle:d,endAngle:d+h,xRotation:i,arcFlag:a,sweepFlag:o}}(n,l);u.arcParams=h}"Z"===c?(n=i,r=t[a+1]):n=[l[(v=l.length)-2],l[v-1]],r&&"Z"===r[0]&&(r=t[a],e[a])&&(e[a].prePoint=n),u.currentPoint=n,e[a]&&Ra(n,e[a].currentPoint)&&(e[a].prePoint=u.prePoint);var f,d,p,g,y,m,v=r?[r[r.length-2],r[r.length-1]]:null,b=(u.nextPoint=v,u.prePoint);["L","H","V"].includes(c)?(u.startTangent=[b[0]-n[0],b[1]-n[1]],u.endTangent=[n[0]-b[0],n[1]-b[1]]):"Q"===c?(f=[l[1],l[2]],u.startTangent=[b[0]-f[0],b[1]-f[1]],u.endTangent=[n[0]-f[0],n[1]-f[1]]):"T"===c?(f=Da((d=e[s-1]).currentPoint,b),"Q"===d.command?(u.command="Q",u.startTangent=[b[0]-f[0],b[1]-f[1]],u.endTangent=[n[0]-f[0],n[1]-f[1]]):(u.command="TL",u.startTangent=[b[0]-n[0],b[1]-n[1]],u.endTangent=[n[0]-b[0],n[1]-b[1]])):"C"===c?(p=[l[1],l[2]],g=[l[3],l[4]],u.startTangent=[b[0]-p[0],b[1]-p[1]],u.endTangent=[n[0]-g[0],n[1]-g[1]],0===u.startTangent[0]&&0===u.startTangent[1]&&(u.startTangent=[p[0]-g[0],p[1]-g[1]]),0===u.endTangent[0]&&0===u.endTangent[1]&&(u.endTangent=[g[0]-p[0],g[1]-p[1]])):"S"===c?(p=Da((d=e[s-1]).currentPoint,b),g=[l[1],l[2]],"C"===d.command?(u.command="C",u.startTangent=[b[0]-p[0],b[1]-p[1]]):(u.command="SQ",u.startTangent=[b[0]-g[0],b[1]-g[1]]),u.endTangent=[n[0]-g[0],n[1]-g[1]]):"A"===c&&(c=(b=Ga(u,0)).x,b=b.y,y=(m=Ga(u,1,!1)).x,m=m.y,u.startTangent=[c,b],u.endTangent=[y,m]),e.push(u)}return e}function Ga(t,e,n){void 0===n&&(n=!0);var r=t.arcParams,i=r.rx,i=void 0===i?0:i,a=r.ry,a=void 0===a?0:a,o=r.xRotation,s=r.arcFlag,r=r.sweepFlag,l=Fa({x:t.prePoint[0],y:t.prePoint[1]},i,a,o,!!s,!!r,{x:t.currentPoint[0],y:t.currentPoint[1]},e),i=Fa({x:t.prePoint[0],y:t.prePoint[1]},i,a,o,!!s,!!r,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),a=i.x-l.x,o=i.y-l.y,s=Math.sqrt(a*a+o*o);return{x:-a/s,y:-o/s}}function Ha(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Va(t,e){return Ha(t)*Ha(e)?(t[0]*e[0]+t[1]*e[1])/(Ha(t)*Ha(e)):1}function Ya(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Va(t,e))}function qa(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,a=t*i,i=e*i,o=n-t,t=n+t,s=r-e,e=r+e;return[["M",o,r],["C",o,r-i,n-a,s,n,s],["C",n+a,s,t,r-i,t,r],["C",t,r+i,n+a,e,n,e],["C",n-a,e,o,r+i,o,r],["Z"]]}function $a(t,e){void 0===e&&(e=t.getLocalTransform());var n,r,i,a,o,s,l,c,u,h,f,d,p=[];switch(t.nodeName){case k.LINE:var g=t.parsedStyle,y=g.x1,m=g.y1,v=g.x2,g=g.y2,p=[["M",void 0===y?0:y,void 0===m?0:m],["L",void 0===v?0:v,void 0===g?0:g]];break;case k.CIRCLE:var y=t.parsedStyle,m=y.r,v=void 0===m?0:m,g=y.cx,b=void 0===g?0:g,m=y.cy;p=qa(v,v,b,void 0===m?0:m);break;case k.ELLIPSE:g=t.parsedStyle,y=g.rx,v=g.ry,m=g.cx,b=void 0===m?0:m,m=g.cy;p=qa(void 0===y?0:y,void 0===v?0:v,b,void 0===m?0:m);break;case k.POLYLINE:case k.POLYGON:g=t.parsedStyle.points;y=g.points,v=t.nodeName===k.POLYGON,y=y.map(function(t,e){return[0===e?"M":"L",t[0],t[1]]}),v&&y.push(["Z"]),p=y;break;case k.RECT:var b=t.parsedStyle,m=b.width,x=void 0===m?0:m,g=b.height,w=void 0===g?0:g,m=b.x,g=void 0===m?0:m,m=b.y,m=void 0===m?0:m,b=b.radius,M=b&&b.some(function(t){return 0!==t});n=x,r=w,g=g,m=m,p=(M=M&&b.map(function(t){return We(t,0,Math.min(Math.abs(x)/2,Math.abs(w)/2))}))?(l=(o=0<n?1:-1)+(s=0<r?1:-1)!=0?1:0,[["M",o*(i=(M=j(M,4))[0])+g,m],["L",n-o*(a=M[1])+g,m],a?["A",a,a,0,0,l,n+g,s*a+m]:null,["L",n+g,r-s*(a=M[2])+m],a?["A",a,a,0,0,l,n+g-o*a,r+m]:null,["L",g+o*(a=M[3]),r+m],a?["A",a,a,0,0,l,g,r+m-s*a]:null,["L",g,s*i+m],i?["A",i,i,0,0,l,o*i+g,m]:null,["Z"]].filter(function(t){return t})):[["M",g,m],["L",g+n,m],["L",g+n,m+r],["L",g,m+r],["Z"]];break;case k.PATH:p=O([],j(t.parsedStyle.path.absolutePath),!1)}if(p.length)return c=p,u=e,h=(e=(e=t).parsedStyle).defX,f=void 0===h?0:h,d=void 0===(h=e.defY)?0:h,c.reduce(function(t,e){var n,r,i,a="";return"M"===e[0]||"L"===e[0]?(n=Ct(e[1]-f,e[2]-d,0),u&&Wt(n,n,u),a="".concat(e[0]).concat(n[0],",").concat(n[1])):"Z"===e[0]?a=e[0]:"C"===e[0]?(r=Ct(e[1]-f,e[2]-d,0),i=Ct(e[3]-f,e[4]-d,0),n=Ct(e[5]-f,e[6]-d,0),u&&(Wt(r,r,u),Wt(i,i,u),Wt(n,n,u)),a="".concat(e[0]).concat(r[0],",").concat(r[1],",").concat(i[0],",").concat(i[1],",").concat(n[0],",").concat(n[1])):"A"===e[0]?(n=Ct(e[6]-f,e[7]-d,0),u&&Wt(n,n,u),a="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(n[0],",").concat(n[1])):"Q"===e[0]&&(r=Ct(e[1]-f,e[2]-d,0),i=Ct(e[3]-f,e[4]-d,0),u&&(Wt(r,r,u),Wt(i,i,u)),a="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}")),t+a},"")}function Ua(e){if(""===e||Array.isArray(e)&&0===e.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var n;try{n=pe(e)}catch(t){n=pe(""),console.error("[g]: Invalid SVG Path definition: ".concat(e))}for(var t=n,r=0;r<t.length;r++){var i,a,o=t[r-1],s=t[r];"M"===s[0]&&o&&(i=o[0],s=[s[1],s[2]],a=void 0,"L"===i||"M"===i?a=[o[1],o[2]]:"C"!==i&&"A"!==i&&"Q"!==i||(a=[o[o.length-2],o[o.length-1]]),a)&&Ra(s,a)&&(t.splice(r,1),r--)}var e=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}(n),l=(c=function(t){for(var e=[],n=[],r=[],i=0;i<t.length;i++){var a=t[i],o=a[0];"M"===o?(r.length&&(n.push(r),r=[]),r.push([a[1],a[2]])):"Z"===o?r.length&&(e.push(r),r=[]):r.push([a[1],a[2]])}return 0<r.length&&n.push(r),{polygons:e,polylines:n}}(n)).polygons,c=c.polylines,u=Wa(n),h=(p=Ia(u,0)).x,f=p.y,d=p.width,p=p.height;return{absolutePath:n,hasArc:e,segments:u,polygons:l,polylines:c,totalLength:0,rect:{x:Number.isFinite(h)?h:0,y:Number.isFinite(f)?f:0,width:Number.isFinite(d)?d:0,height:Number.isFinite(p)?p:0}}}var Xa=Xr(Ua);function Ka(t){return(ze(t)?Xa:Ua)(t)}function Za(t,e,n){var r,i,a,o,s,l,c,u,h,f=t.curve,d=e.curve,t=(f&&0!==f.length||(f=be(t.absolutePath,!1),t.curve=f),d&&0!==d.length||(d=be(e.absolutePath,!1),e.curve=d),[f,d]),f=Ae((t=f.length!==d.length?function t(e,n,r){var i,e=_e(e),n=_e(n),a=e.length,o=n.length,s=e.filter(function(t){return t.l}).length,l=n.filter(function(t){return t.l}).length,s=e.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/s||0,l=n.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/l||0,c=r||Math.max(a,o),u=[s,l],h=[c-a,c-o],r=[e,n].map(function(t,n){return t.l===c?t.map(function(t){return t.s}):t.map(function(t,e){return i=e&&h[n]&&t.l>=u[n],h[n]-=i?1:0,i?t.ss:[t.s]}).flat()});return r[0].length===r[1].length?r:t(r[0],r[1],c)}(f,d):t)[0])!==Ae(t[1])?(r=t[0],e=r.slice(1).map(function(t,e,n){return(e?n[e-1].slice(-2):r[0].slice(1)).concat(t.slice(1))}).map(function(n){return n.map(function(t,e){return n[n.length-e-2*(1-e%2)]})}).reverse(),[["M"].concat(e[0].slice(0,2))].concat(e.map(function(t){return["C"].concat(t.slice(2))}))):t[0].map(function(t){return Array.isArray(t)?[].concat(t):t});return[f,(i=t[1],a=f,c=i.length-1,u=[],h=0,s=(o=i).length,l=s-1,(d=o.map(function(t,r){return o.map(function(t,e){var n=r+e;return 0===e||o[n]&&"M"===o[n][0]?(e=o[n],["M"].concat(e.slice(-2))):(s<=n&&(n-=l),o[n])})})).forEach(function(t,n){i.slice(1).forEach(function(t,e){h+=xe(i[(n+e)%c].slice(-2),a[e%c].slice(-2))}),u[n]=h,h=0}),d[u.indexOf(Math.min.apply(null,u))]),function(t){return t}]}function Qa(t,e){var n,r,i=ze(t)?t.split(" ").map(function(t){var t=j(t.split(","),2),e=t[0],t=t[1];return[Number(e),Number(t)]}):t,a=[],o=0,s=Vn(i),t=(i.forEach(function(t,e){i[e+1]&&((n=[0,0])[0]=o/s,r=Dn(t[0],t[1],i[e+1][0],i[e+1][1]),o+=r,n[1]=o/s,a.push(n))}),Math.min.apply(Math,O([],j(i.map(function(t){return t[0]})),!1))),l=Math.min.apply(Math,O([],j(i.map(function(t){return t[1]})),!1));return e&&(e.parsedStyle.defX=t,e.parsedStyle.defY=l),{points:i,totalLength:s,segments:a}}function Ja(t,e){return[t.points,e.points,function(t){return t}]}var to=null;function eo(t){return function(e){var n=0;return t.map(function(t){return t===to?e[n++]:t})}}function no(t){return t}var ro={matrix:["NNNNNN",[to,to,0,0,to,to,0,0,0,0,1,0,to,to,0,1],no],matrix3d:["NNNNNNNNNNNNNNNN",no],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",eo([to,to,new xi(1)]),no],scalex:["N",eo([to,new xi(1),new xi(1)]),eo([to,new xi(1)])],scaley:["N",eo([new xi(1),to,new xi(1)]),eo([new xi(1),to])],scalez:["N",eo([new xi(1),new xi(1),to])],scale3d:["NNN",no],skew:["Aa",null,no],skewx:["A",null,eo([to,ki])],skewy:["A",null,eo([ki,to])],translate:["Tt",eo([to,to,Oi]),no],translatex:["T",eo([to,Oi,Oi]),eo([to,Oi])],translatey:["T",eo([Oi,to,Oi]),eo([Oi,to])],translatez:["L",eo([Oi,Oi,to])],translate3d:["TTL",no]};function io(t){if("none"!==(t=(t||"none").toLowerCase().trim()))for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];var i=e.index+e[0].length,a=e[1],o=ro[a];if(!o)return[];var s=e[2].split(","),l=o[0];if(l.length<s.length)return[];for(var c=[],u=0;u<l.length;u++){var h=s[u],f=l[u],d=void 0;if(void 0===(d=h?{A:function(t){return"0"===t.trim()?ki:Ma(t)},N:Pa,T:wa,L:xa}[f.toUpperCase()](h):{a:ki,n:c[0],t:Oi}[f]))return[];c.push(d)}if(r.push({t:a,d:c}),n.lastIndex===t.length)return r}return[]}function ao(t){switch(t.t){case"rotatex":return i=vr(Oa(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=vr(Oa(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=vr(Oa(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":var e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=vr(Oa(t.d[3])),a=e*e+n*n+r*r,a=(0==a?(e=1,r=n=0):1!=a&&(e/=a=Math.sqrt(a),n/=a,r/=a),Math.sin(i/2)),o=a*Math.cos(i/2),a=a*a;return[1-2*(n*n+r*r)*a,2*(e*n*a+r*o),2*(e*r*a-n*o),0,2*(e*n*a-r*o),1-2*(e*e+r*r)*a,2*(n*r*a+e*o),0,2*(e*r*a+n*o),2*(n*r*a-e*o),1-2*(e*e+n*n)*a,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":o=vr(Oa(t.d[0])),a=vr(Oa(t.d[1]));return[1,Math.tan(a),0,0,Math.tan(o),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return i=vr(Oa(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=vr(Oa(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=Sa(t.d[0],0,null)||0,n=Sa(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Sa(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=Sa(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=Sa(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Sa(t.d[0],0,null)||0,n=Sa(t.d[1],0,null)||0,r=Sa(t.d[2],0,null)||0,1];case"perspective":a=Sa(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,a?-1/a: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 oo(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 so(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],a=[0,0,0,1];return Ar(0===(t=t).length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(ao).reduce(oo),e,n,r,i,a),[[e,n,r,a,i]]}var lo=function(t,e,n,r,i){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],o=0;o<4;o++)a[o][3]=i[o];for(o=0;o<3;o++)for(var s=0;s<3;s++)a[3][o]+=t[s]*a[s][o];var l=r[0],c=r[1],u=r[2],r=r[3],h=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],u=(h[0][0]=1-2*(c*c+u*u),h[0][1]=2*(l*c-u*r),h[0][2]=2*(l*u+c*r),h[1][0]=2*(l*c+u*r),h[1][1]=1-2*(l*l+u*u),h[1][2]=2*(c*u-l*r),h[2][0]=2*(l*u-c*r),h[2][1]=2*(c*u+l*r),h[2][2]=1-2*(l*l+c*c),a=co(a,h),[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]);for(n[2]&&(u[2][1]=n[2],a=co(a,u)),n[1]&&(u[2][1]=0,u[2][0]=n[0],a=co(a,u)),n[0]&&(u[2][0]=0,u[1][0]=n[0],a=co(a,u)),o=0;o<3;o++)for(s=0;s<3;s++)a[o][s]*=e[o];return 0==(r=a)[0][2]&&0==r[0][3]&&0==r[1][2]&&0==r[1][3]&&0==r[2][0]&&0==r[2][1]&&1==r[2][2]&&0==r[2][3]&&0==r[3][2]&&1==r[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 co(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 a=0;a<4;a++)n[r][i]+=e[r][a]*t[a][i];return n}function uo(t){return t.toFixed(6).replace(".000000","")}function ho(e,n){var r,i;return e.decompositionPair!==n&&(e.decompositionPair=n,r=so(e)),n.decompositionPair!==e&&(n.decompositionPair=e,i=so(n)),null===r[0]||null===i[0]?[[!1],[!0],function(t){return(t?n:e)[0].d}]:(r[0].push(0),i[0].push(1),[r,i,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;r<t.length;r++)n+=t[r]*e[r];return n}(t,e),i=(r=We(r,-1,1),[]);if(1===r)i=t;else for(var a=Math.acos(r),o=+Math.sin(n*a)/Math.sqrt(1-r*r),s=0;s<4;s++)i.push(t[s]*(Math.cos(n*a)-r*o)+e[s]*o);return i}(r[0][3],i[0][3],t[5]);return lo(t[0],t[1],t[2],e,t[4]).map(uo).join(",")}])}function fo(t){return t.replace(/[xy]/,"")}function po(t){return t.replace(/(x|y|z|3d)?$/,"3d")}var go=function(t,e){return"perspective"===t&&"perspective"===e||("matrix"===t||"matrix3d"===t)&&("matrix"===e||"matrix3d"===e)};function yo(r,i,t){var e=!1;if(!r.length||!i.length){r.length||(e=!0,r=i,i=[]);for(var n=0;n<r.length;n++)!function(t){var t=r[t],e=t.t,t=t.d,n="scale"===e.substring(0,5)?1:0;i.push({t:e,d:t.map(function(t){return"number"==typeof t?Ri(n):Ri(n,t.unit)})})}(n)}var a=[],o=[],s=[];if(r.length!==i.length)a=[(g=ho(r,i))[0]],o=[g[1]],s=[["matrix",[g[2]]]];else for(n=0;n<r.length;n++){var l=r[n].t,c=i[n].t,u=r[n].d,h=i[n].d,f=ro[l],d=ro[c],p=void 0;if(go(l,c)){var g=ho([r[n]],[i[n]]);a.push(g[0]),o.push(g[1]),s.push(["matrix",[g[2]]])}else{if(l===c)p=l;else if(f[2]&&d[2]&&fo(l)===fo(c))p=fo(l),u=f[2](u),h=d[2](h);else{if(!f[1]||!d[1]||po(l)!==po(c)){a=[(g=ho(r,i))[0]],o=[g[1]],s=[["matrix",[g[2]]]];break}p=po(l),u=f[1](u),h=d[1](h)}for(var y=[],m=[],v=[],b=0;b<u.length;b++){g=function(t,e,n,r,i){void 0===i&&(i=0);var a="",o=t.value||0,s=e.value||0,l=yi(t.unit),c=t.convertTo(l),l=e.convertTo(l);return c&&l?(o=c.value,s=l.value,a=Zr(t.unit)):(xi.isLength(t.unit)||xi.isLength(e.unit))&&(o=Sa(t,i,n),s=Sa(e,i,n),a="px"),[o,s,function(t){return(t=r?Math.max(t,0):t)+a}]}(u[b],h[b],t,!1,b);y[b]=g[0],m[b]=g[1],v.push(g[2])}a.push(y),o.push(m),s.push([p,v])}}return e&&(e=a,a=o,o=e),[a,o,function(t){return t.map(function(t,n){t=t.map(function(t,e){return s[n][1][e](t)}).join(",");return"matrix"===s[n][0]&&16===t.split(",").length&&(s[n][0]="matrix3d"),"matrix3d"===s[n][0]&&6===t.split(",").length&&(s[n][0]="matrix"),s[n][0]+"("+t+")"}).join(" ")}]}var mo=Xr(function(t){var e;return ze(t)?"text-anchor"===t?[Ri(0,"px"),Ri(0,"px")]:(1===(e=t.split(" ")).length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[wa(vo(e[0])),wa(vo(e[1]))]):[Ri(t[0]||0,"px"),Ri(t[1]||0,"px")]});function vo(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var bo=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:a.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:a.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:a.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:a.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:a.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:a.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:a.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:a.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:a.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:a.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:a.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:a.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:a.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:a.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:a.FILTER},{n:"clipPath",syntax:a.DEFINED_PATH},{n:"textPath",syntax:a.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:a.TRANSFORM},{n:"transformOrigin",p:100,d:function(t){return t===k.CIRCLE||t===k.ELLIPSE?"center":t===k.TEXT?"text-anchor":"left top"},l:!0,syntax:a.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(t){return t===k.CIRCLE||t===k.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:a.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:a.COORDINATE},{n:"cy",int:!0,d:"0",syntax:a.COORDINATE},{n:"cz",int:!0,d:"0",syntax:a.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:a.COORDINATE},{n:"y",int:!0,d:"0",syntax:a.COORDINATE},{n:"z",int:!0,d:"0",syntax:a.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:a.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:a.COORDINATE},{n:"y1",int:!0,l:!0,syntax:a.COORDINATE},{n:"z1",int:!0,l:!0,syntax:a.COORDINATE},{n:"x2",int:!0,l:!0,syntax:a.COORDINATE},{n:"y2",int:!0,l:!0,syntax:a.COORDINATE},{n:"z2",int:!0,l:!0,syntax:a.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:a.PATH,p:50},{n:"points",int:!0,l:!0,syntax:a.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:a.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:a.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:a.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:a.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:a.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:a.NUMBER,d:function(t){return t===k.PATH||t===k.POLYGON||t===k.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:a.MARKER},{n:"markerEnd",syntax:a.MARKER},{n:"markerMid",syntax:a.MARKER},{n:"markerStartOffset",syntax:a.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:a.LENGTH,l:!0,int:!0,d:"0"}],xo=bo.filter(function(t){return!!t.l}).map(function(t){return t.n}),wo={},Mo=new WeakMap,i=(Oo.prototype.registerMetadata=function(e){O([e.n],j(e.a||[]),!1).forEach(function(t){wo[t]=e})},Oo.prototype.unregisterMetadata=function(t){delete wo[t]},Oo.prototype.getPropertySyntax=function(t){return this.runtime.CSSPropertySyntaxFactory[t]},Oo.prototype.processProperties=function(n,e,t){var r=this;if(void 0===t&&(t={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[]}),this.runtime.enableCSSParsing){var i=t.skipUpdateAttribute,a=t.skipParse,o=t.forceUpdateGeometry,s=t.usedAttributes,l=o,c=Object.keys(e);c.forEach(function(t){i||(n.attributes[t]=e[t]),!l&&null!=(t=wo[t])&&t.l&&(l=!0)}),a||c.forEach(function(t){n.computedStyle[t]=r.parseProperty(t,n.attributes[t],n)}),(c=null!=s&&s.length?Array.from(new Set(c.concat(s))):c).forEach(function(t){t in n.computedStyle&&(n.parsedStyle[t]=r.computeProperty(t,n.computedStyle[t],n))}),l&&this.updateGeometry(n),c.forEach(function(t){t in n.parsedStyle&&r.postProcessProperty(t,n,c)}),this.runtime.enableCSSParsing&&n.children.length&&c.forEach(function(e){e in n.parsedStyle&&r.isPropertyInheritable(e)&&n.children.forEach(function(t){t.internalSetAttribute(e,null,{skipUpdateAttribute:!0,skipParse:!0})})})}else{Object.assign(n.attributes,e);var o=Object.keys(e),a=n.parsedStyle.clipPath,s=n.parsedStyle.offsetPath,u=(n.parsedStyle=Object.assign(n.parsedStyle,e),!!t.forceUpdateGeometry);if(!u)for(var h=0;h<xo.length;h++)if(xo[h]in e){u=!0;break}e.fill&&(n.parsedStyle.fill=ma(e.fill)),e.stroke&&(n.parsedStyle.stroke=ma(e.stroke)),e.shadowColor&&(n.parsedStyle.shadowColor=ma(e.shadowColor)),e.filter&&(n.parsedStyle.filter=_a(e.filter)),P(e.radius)||(n.parsedStyle.radius=ka(e.radius,4)),P(e.lineDash)||(n.parsedStyle.lineDash=ka(e.lineDash,2)),e.points&&(n.parsedStyle.points=Qa(e.points,n)),""===e.path&&(n.parsedStyle.path=m({},Bi)),e.path&&(n.parsedStyle.path=Ka(e.path),n.parsedStyle.defX=n.parsedStyle.path.rect.x,n.parsedStyle.defY=n.parsedStyle.path.rect.y),e.textTransform&&this.runtime.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:e.textTransform},n,null),e.clipPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",a,e.clipPath,n,this.runtime),e.offsetPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",s,e.offsetPath,n,this.runtime),e.anchor&&(n.parsedStyle.anchor=ka(e.anchor,2)),e.transform&&(n.parsedStyle.transform=io(e.transform)),e.transformOrigin&&(n.parsedStyle.transformOrigin=mo(e.transformOrigin)),e.markerStart&&(n.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerStart,e.markerStart,null,null)),e.markerEnd&&(n.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerEnd,e.markerEnd,null,null)),e.markerMid&&(n.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator("",e.markerMid,e.markerMid,null,null)),(n.nodeName!==k.CIRCLE&&n.nodeName!==k.ELLIPSE||P(e.cx)&&P(e.cy))&&(n.nodeName!==k.RECT&&n.nodeName!==k.IMAGE&&n.nodeName!==k.GROUP&&n.nodeName!==k.HTML&&n.nodeName!==k.TEXT&&n.nodeName!==k.MESH||P(e.x)&&P(e.y)&&P(e.z))&&(n.nodeName!==k.LINE||P(e.x1)&&P(e.y1)&&P(e.z1)&&P(e.x2)&&P(e.y2)&&P(e.z2))||this.runtime.CSSPropertySyntaxFactory["<coordinate>"].postProcessor(n,o),P(e.zIndex)||this.runtime.CSSPropertySyntaxFactory["<z-index>"].postProcessor(n,o),e.path&&this.runtime.CSSPropertySyntaxFactory["<path>"].postProcessor(n,o),e.points&&this.runtime.CSSPropertySyntaxFactory["<list-of-points>"].postProcessor(n,o),P(e.offsetDistance)||this.runtime.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(n,o),e.transform&&this.runtime.CSSPropertySyntaxFactory["<transform>"].postProcessor(n,o),u&&this.updateGeometry(n)}},Oo.prototype.parseProperty=function(t,e,n){var r,t=wo[t],i=e;return"unset"===(e=""!==e&&!P(e)?e:"unset")||"initial"===e||"inherit"===e?i=Ai(e):t&&(r=t.k,t=(t=t.syntax)&&this.getPropertySyntax(t),r&&-1<r.indexOf(e)?i=Ai(e):t&&t.parser&&(i=t.parser(e,n))),i},Oo.prototype.computeProperty=function(t,e,n){var r=wo[t],i="g-root"===n.id,a=e;if(r){var o=r.syntax,s=r.inh,r=r.d;if(e instanceof ui){var l=e.value;if("initial"===(l="unset"===l?s&&!i?"inherit":"initial":l))P(r)||(e=this.parseProperty(t,pi(r)?r(n.nodeName):r,n));else if("inherit"===l)return s=this.tryToResolveProperty(n,t,{inherited:!0}),P(s)?void this.addUnresolveProperty(n,t):s}i=o&&this.getPropertySyntax(o);a=i&&i.calculator?(r=n.parsedStyle[t],i.calculator(t,r,e,n,this.runtime)):e instanceof ui?e.value:e}return a},Oo.prototype.postProcessProperty=function(t,e,n){var t=wo[t];t&&t.syntax&&(t=t.syntax&&this.getPropertySyntax(t.syntax))&&t.postProcessor&&t.postProcessor(e,n)},Oo.prototype.addUnresolveProperty=function(t,e){var n=Mo.get(t);n||(Mo.set(t,[]),n=Mo.get(t)),-1===n.indexOf(e)&&n.push(e)},Oo.prototype.tryToResolveProperty=function(t,e,n){var n=(n=void 0===n?{}:n).inherited;if(n&&(t.parentElement&&function(t,e){t=Mo.get(t);return!t||0===t.length||t.includes(e)}(t.parentElement,e)))return"unset"===(n=t.parentElement.parsedStyle[e])||"initial"===n||"inherit"===n?void 0:n},Oo.prototype.recalc=function(e){var n,t=Mo.get(e);t&&t.length&&(n={},t.forEach(function(t){n[t]=e.attributes[t]}),this.processProperties(e,n),Mo.delete(e))},Oo.prototype.updateGeometry=function(t){var s,e,n,r,i,a,o,l,c,u,h,f,d,p,g,y=t.nodeName,m=this.runtime.geometryUpdaterFactory[y];m&&((s=t.geometry).contentBounds||(s.contentBounds=new Tr),s.renderBounds||(s.renderBounds=new Tr),e=t.parsedStyle,n=(m=m.update(e,t)).width,r=m.height,h=void 0===(h=m.depth)?0:h,u=void 0===(u=m.offsetX)?0:u,p=void 0===(p=m.offsetY)?0:p,m=void 0===(m=m.offsetZ)?0:m,h=[Math.abs(n)/2,Math.abs(r)/2,h/2],l=e.stroke,c=e.lineWidth,g=e.increasedLineWidthForHitTesting,d=e.shadowType,f=e.shadowColor,i=void 0===(i=e.filter)?[]:i,a=e.transformOrigin,o=e.anchor,y===k.TEXT?delete e.anchor:y===k.MESH&&(e.anchor[2]=.5),u=[(1-2*(o&&o[0]||0))*n/2+u,(1-2*(o&&o[1]||0))*r/2+p,(1-2*(o&&o[2]||0))*h[2]+m],s.contentBounds.update(u,h),p=y===k.POLYLINE||y===k.POLYGON||y===k.PATH?Math.SQRT2:.5,l&&!l.isNone&&(h[0]+=m=((c||0)+(g||0))*p,h[1]+=m),s.renderBounds.update(u,h),f&&d&&"inner"!==d&&(l=(y=s.renderBounds).min,c=y.max,g=e.shadowBlur||0,p=e.shadowOffsetX||0,m=e.shadowOffsetY||0,u=l[0]-g+p,h=c[0]+g+p,f=l[1]-g+m,d=c[1]+g+m,l[0]=Math.min(l[0],u),c[0]=Math.max(c[0],h),l[1]=Math.min(l[1],f),c[1]=Math.max(c[1],d),s.renderBounds.setMinMax(l,c)),i.forEach(function(t){var e,n,r,i,a,o=t.name,t=t.params;"blur"===o?(i=t[0].value,s.renderBounds.update(s.renderBounds.center,pr(s.renderBounds.halfExtents,s.renderBounds.halfExtents,[i,i,0]))):"drop-shadow"===o&&(i=t[0].value,o=t[1].value,t=t[2].value,e=(n=s.renderBounds).min,n=n.max,r=e[0]-t+i,i=n[0]+t+i,a=e[1]-t+o,t=n[1]+t+o,e[0]=Math.min(e[0],r),n[0]=Math.max(n[0],i),e[1]=Math.min(e[1],a),n[1]=Math.max(n[1],t),s.renderBounds.setMinMax(e,n))}),o=e.anchor,y=r<0,g=((p=n<0)?-1:1)*(a?Sa(a[0],0,t):0),m=(y?-1:1)*(a?Sa(a[1],1,t):0),g-=(p?-1:1)*(o&&o[0]||0)*s.contentBounds.halfExtents[0]*2,m-=(y?-1:1)*(o&&o[1]||0)*s.contentBounds.halfExtents[1]*2,t.setOrigin(g,m),this.runtime.sceneGraphService.dirtifyToRoot(t))},Oo.prototype.isPropertyInheritable=function(t){t=wo[t];return!!t&&t.inh},Oo);function Oo(t){var e=this;this.runtime=t,bo.forEach(function(t){e.registerMetadata(t)})}ko.prototype.calculator=function(t,e,n,r){return Oa(n)};ii=ko;function ko(){this.parser=Ma,this.parserWithCSSDisabled=null,this.mixer=Ca}Eo.prototype.calculator=function(t,e,n,r,i){return n instanceof ui&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach(function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)}),n};o=Eo;function Eo(){}Ao.prototype.calculator=function(t,e,n,r){return n instanceof ui?"none"===n.value?Li:Ni:n};var So=Ao;function Ao(){this.parser=ma,this.parserWithCSSDisabled=ma,this.mixer=va}To.prototype.calculator=function(t,e,n){return n instanceof ui?[]:n};var _o=To;function To(){this.parser=_a}function Po(t){t=t.parsedStyle.fontSize;return P(t)?null:t}Lo.prototype.calculator=function(t,e,n,r,i){var a,o;return Ge(n)?n:xi.isRelativeUnit(n.unit)?(i=i.styleValueRegistry,n.unit===g.kPercentage?0:n.unit===g.kEms?r.parentNode&&(o=Po(r.parentNode))?o*n.value:(i.addUnresolveProperty(r,t),0):n.unit===g.kRems?null!=(a=null==r?void 0:r.ownerDocument)&&a.documentElement&&(o=Po(r.ownerDocument.documentElement))?o*n.value:(i.addUnresolveProperty(r,t),0):void 0):n.value};var Co=Lo;function Lo(){this.parser=wa,this.parserWithCSSDisabled=null,this.mixer=Ca}jo.prototype.parser=function(t){t=Ea(Ge(t)?[t]:t),t=1===t.length?[t[0],t[0]]:[t[0],t[1]];return t},jo.prototype.calculator=function(t,e,n){return n.map(function(t){return t.value})};var No=jo;function jo(){this.mixer=Na}Io.prototype.parser=function(t){t=Ea(Ge(t)?[t]:t),t=1===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:3===t.length?[t[0],t[1],t[2],t[1]]:[t[0],t[1],t[2],t[3]];return t},Io.prototype.calculator=function(t,e,n){return n.map(function(t){return t.value})};var Ro=Io;function Io(){this.mixer=Na}var Bo=Z();function Do(t,l){var c=l.parsedStyle.defX||0,u=l.parsedStyle.defY||0;return l.resetLocalTransform(),l.setLocalPosition(c,u),t.forEach(function(t){var e,n,r,i,a,o,s=t.t,t=t.d;"scale"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1,1],l.scaleLocal(o[0],o[1],1)):"scalex"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1],l.scaleLocal(o[0],1,1)):"scaley"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1],l.scaleLocal(1,o[0],1)):"scalez"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1],l.scaleLocal(1,1,o[0])):"scale3d"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1,1,1],l.scaleLocal(o[0],o[1],o[2])):"translate"===s?l.translateLocal((e=t||[Oi,Oi])[0].value,e[1].value,0):"translatex"===s?l.translateLocal((e=t||[Oi])[0].value,0,0):"translatey"===s?l.translateLocal(0,(e=t||[Oi])[0].value,0):"translatez"===s?l.translateLocal(0,0,(e=t||[Oi])[0].value):"translate3d"===s?l.translateLocal((e=t||[Oi,Oi,Oi])[0].value,e[1].value,e[2].value):"rotate"===s?l.rotateLocal(0,0,Oa((t||[ki])[0])):"rotatex"===s?l.rotateLocal(Oa((t||[ki])[0]),0,0):"rotatey"===s?l.rotateLocal(0,Oa((t||[ki])[0]),0):"rotatez"===s?l.rotateLocal(0,0,Oa((t||[ki])[0])):"rotate3d"!==s&&("skew"===s?(n=(null==t?void 0:t.map(function(t){return t.value}))||[0,0],l.setLocalSkew(vr(n[0]),vr(n[1]))):"skewx"===s?(n=(null==t?void 0:t.map(function(t){return t.value}))||[0],l.setLocalSkew(vr(n[0]),l.getLocalSkew()[1])):"skewy"===s?(n=(null==t?void 0:t.map(function(t){return t.value}))||[0],l.setLocalSkew(l.getLocalSkew()[0],vr(n[0]))):"matrix"===s?(e=(o=j(t.map(function(t){return t.value}),6))[0],n=o[1],r=o[2],i=o[3],a=o[4],o=o[5],l.setLocalTransform(tt(Bo,e,n,0,0,r,i,0,0,0,0,1,0,a+c,o+u,0,1))):"matrix3d"===s&&(tt.apply(_t,O([Bo],j(t.map(function(t){return t.value})),!1)),Bo[12]+=c,Bo[13]+=u,l.setLocalTransform(Bo)))}),l.getLocalTransform()}t(Wo,Fo=Co),Wo.prototype.postProcessor=function(t,e){var n,r;switch(t.nodeName){case k.CIRCLE:case k.ELLIPSE:var i=t.parsedStyle,a=i.cx,o=i.cy,i=i.cz;P(a)||(l=a),P(o)||(c=o),P(i)||(u=i);break;case k.LINE:var a=t.parsedStyle,o=a.x1,i=a.x2,s=a.y1,a=a.y2,l=Math.min(o,i),c=Math.min(s,a),u=0;break;case k.RECT:case k.IMAGE:case k.GROUP:case k.HTML:case k.TEXT:case k.MESH:P(t.parsedStyle.x)||(l=t.parsedStyle.x),P(t.parsedStyle.y)||(c=t.parsedStyle.y),P(t.parsedStyle.z)||(u=t.parsedStyle.z)}t.nodeName!==k.PATH&&t.nodeName!==k.POLYLINE&&t.nodeName!==k.POLYGON&&(t.parsedStyle.defX=l||0,t.parsedStyle.defY=c||0),P(l)&&P(c)&&P(u)||-1!==e.indexOf("transform")||((e=t.parsedStyle.transform)&&e.length?Do(e,t):(n=(e=j(t.getLocalPosition(),3))[0],r=e[1],e=e[2],t.setLocalPosition(P(l)?n:l,P(c)?r:c,P(u)?e:u)))};var Fo,zo=Wo;function Wo(){return null!==Fo&&Fo.apply(this,arguments)||this}Ho.prototype.calculator=function(t,e,n,r){n=null==(n=n instanceof ui?null:n)?void 0:n.cloneNode(!0);return n&&(n.style.isMarker=!0),n};var Go=Ho;function Ho(){}Yo.prototype.calculator=function(t,e,n){return n.value};var Vo=Yo;function Yo(){this.mixer=Ca,this.parser=Pa,this.parserWithCSSDisabled=null}$o.prototype.calculator=function(t,e,n){return n.value},$o.prototype.postProcessor=function(t){var e,n=t.parsedStyle,r=n.offsetPath,n=n.offsetDistance;!r||(e=r.nodeName)!==k.LINE&&e!==k.PATH&&e!==k.POLYLINE||(e=r.getPoint(n))&&(t.parsedStyle.defX=e.x,t.parsedStyle.defY=e.y,t.setLocalPosition(e.x,e.y))};var qo=$o;function $o(){this.parser=Pa,this.parserWithCSSDisabled=null,this.mixer=La(0,1)}Xo.prototype.calculator=function(t,e,n){return n.value};var Uo=Xo;function Xo(){this.parser=Pa,this.parserWithCSSDisabled=null,this.mixer=La(0,1)}Zo.prototype.calculator=function(t,e,n){return n instanceof ui&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Dr(0,0,0,0)}:n},Zo.prototype.postProcessor=function(t,e){var n;t.parsedStyle.defX=t.parsedStyle.path.rect.x,t.parsedStyle.defY=t.parsedStyle.path.rect.y,t.nodeName===k.PATH&&-1===e.indexOf("transform")&&(n=(e=t.parsedStyle).defX,e=e.defY,t.setLocalPosition(void 0===n?0:n,void 0===e?0:e))};var Ko=Zo;function Zo(){this.parser=Ka,this.parserWithCSSDisabled=Ka,this.mixer=Za}Jo.prototype.postProcessor=function(t,e){var n;t.nodeName!==k.POLYGON&&t.nodeName!==k.POLYLINE||-1!==e.indexOf("transform")||(n=(e=t.parsedStyle).defX,e=e.defY,t.setLocalPosition(n,e))};var Qo=Jo;function Jo(){this.parser=Qa,this.mixer=Ja}t(ns,ts=Co);var ts,es=ns;function ns(){var t=null!==ts&&ts.apply(this,arguments)||this;return t.mixer=La(0,1/0),t}is.prototype.calculator=function(t,e,n,r){return n instanceof ui?"unset"===n.value?"":n.value:"".concat(n)},is.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""};var rs=is;function is(){}os.prototype.calculator=function(t,e,n,r){var i,a=r.getAttribute("text");return a&&(i=a,"capitalize"===n.value?i=a.charAt(0).toUpperCase()+a.slice(1):"lowercase"===n.value?i=a.toLowerCase():"uppercase"===n.value&&(i=a.toUpperCase()),r.parsedStyle.text=i),n.value};var as=os;function os(){}var ss={},ls=0;var cs="undefined"!=typeof window&&void 0!==window.document;function us(t,e){var n=Number(t.parsedStyle.zIndex),r=Number(e.parsedStyle.zIndex);if(n===r){var i=t.parentNode;if(i)return(i=i.childNodes||[]).indexOf(t)-i.indexOf(e)}return n-r}function hs(t){var e,n=t;do{if(null==(e=n.parsedStyle)?void 0:e.clipPath)return n}while(null!==(n=n.parentElement));return null}function fs(t,e){if(cs)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var ds={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},ps="object"==typeof performance&&performance.now?performance:Date;function gs(t,e,n){var r=!1,i=!1,e=!!e&&!e.isNone,n=!!n&&!n.isNone;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=e,i=n):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(i=r=!0),[r,i]}function ys(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var n=Date.now(),e=16<(e=n-Es)?0:16-e,r=xs();return ks[r]=t,1<Object.keys(ks).length||setTimeout(function(){Es=n;var e=ks;ks={},Object.keys(e).forEach(function(t){return e[t](Os())})},e),r}function ms(t){delete ks[t]}function vs(t){return"string"!=typeof t?ys:""===t?ws.requestAnimationFrame:ws[t+"RequestAnimationFrame"]}var bs=1,xs=function(){return bs++},ws="object"==typeof self&&self.self==self?self:"object"==typeof S&&S.global==S?S:{},Ms=Date.now(),Os=function(){return ws.performance&&"function"==typeof ws.performance.now?ws.performance.now():Date.now()-Ms},ks={},Es=Date.now(),Ss=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],vs),As=vs(Ss),_s="string"!=typeof(Ss=Ss)?ms:""===Ss?ws.cancelAnimationFrame:ws[Ss+"CancelAnimationFrame"]||ws[Ss+"CancelRequestAnimationFrame"],Ts=(ws.requestAnimationFrame=As,ws.cancelAnimationFrame=_s,Ps.prototype.getCallbacksNum=function(){return this.callbacks.length},Ps.prototype.tapPromise=function(t,e){this.callbacks.push(e)},Ps.prototype.promise=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Promise.all(this.callbacks.map(function(t){return t.apply(void 0,O([],j(e),!1))}))},Ps);function Ps(){this.callbacks=[]}Ls.prototype.tapPromise=function(t,e){this.callbacks.push(e)},Ls.prototype.promise=function(){for(var i=[],t=0;t<arguments.length;t++)i[t]=arguments[t];return X(this,void 0,void 0,function(){var e,n,r;return R(this,function(t){switch(t.label){case 0:return this.callbacks.length?[4,(r=this.callbacks)[0].apply(r,O([],j(i),!1))]:[3,6];case 1:e=t.sent(),n=0,t.label=2;case 2:return n<this.callbacks.length-1?[4,(0,this.callbacks[n])(e)]:[3,5];case 3:e=t.sent(),t.label=4;case 4:return n++,[3,2];case 5:return[2,e];case 6:return[2,null]}})})};var Cs=Ls;function Ls(){this.callbacks=[]}js.prototype.tap=function(t,e){this.callbacks.push(e)},js.prototype.call=function(){var e=arguments;this.callbacks.forEach(function(t){t.apply(void 0,e)})};var Ns=js;function js(){this.callbacks=[]}Is.prototype.tap=function(t,e){this.callbacks.push(e)},Is.prototype.call=function(){if(this.callbacks.length){for(var t=this.callbacks[0].apply(void 0,arguments),e=0;e<this.callbacks.length-1;e++)t=(0,this.callbacks[e])(t);return t}return null};var Rs=Is;function Is(){this.callbacks=[]}var Bs=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Ds=/([\"\'])[^\'\"]+\1/;Fs.prototype.calculator=function(t,e,n,r){return n instanceof ui?[]:n},Fs.prototype.postProcessor=function(t){Do(t.parsedStyle.transform,t)};Ss=Fs;function Fs(){this.parser=io,this.parserWithCSSDisabled=io,this.mixer=yo}var zs=function(){this.parser=mo},Ws=(Gs.prototype.calculator=function(t,e,n,r){return n.value},Gs.prototype.postProcessor=function(t){var e;t.parentNode&&(e=(t=t.parentNode).renderable,t=t.sortable,e&&(e.dirty=!0),t)&&(t.dirty=!0,t.dirtyReason=Ti.Z_INDEX_CHANGED)},Gs);function Gs(){this.parser=Pa}Vs.prototype.update=function(t,e){t=t.r;return{width:2*t,height:2*t}};var Hs=Vs;function Vs(){}qs.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}};var Ys=qs;function qs(){}Us.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,t=t.y2,i=Math.min(e,r),e=Math.max(e,r),r=Math.min(n,t);return{width:e-i,height:Math.max(n,t)-r}};var $s=Us;function Us(){}Ks.prototype.update=function(t){t=t.path.rect;return{width:t.width,height:t.height}};var Xs=Ks;function Ks(){}Qs.prototype.update=function(t){var t=t.points.points,e=Math.min.apply(Math,O([],j(t.map(function(t){return t[0]})),!1)),n=Math.max.apply(Math,O([],j(t.map(function(t){return t[0]})),!1)),r=Math.min.apply(Math,O([],j(t.map(function(t){return t[1]})),!1));return{width:n-e,height:Math.max.apply(Math,O([],j(t.map(function(t){return t[1]})),!1))-r}};var Zs=Qs;function Qs(){}tl.prototype.update=function(t,e){var n=t.img,r=t.width,i=t.height,r=void 0===r?0:r,i=void 0===i?0:i;return n&&!ze(n)&&(r||(r=n.width,t.width=r),i||(i=n.height,t.height=i)),{width:r,height:i}};var Js=tl;function tl(){}nl.prototype.isReadyToMeasure=function(t,e){var n=t.text,r=t.textAlign,i=t.textBaseline,a=t.fontSize,o=t.fontStyle,s=t.fontWeight,l=t.fontVariant,t=t.lineWidth;return n&&a&&o&&s&&l&&r&&i&&!P(t)},nl.prototype.update=function(t,e){var n,r,i,a=t.text,o=t.textAlign,s=t.lineWidth,l=t.textBaseline,c=t.dx,u=t.dy;return this.isReadyToMeasure(t,e)?(e=((null==(e=null==(e=null==e?void 0:e.ownerDocument)?void 0:e.defaultView)?void 0:e.getConfig())||{}).offscreenCanvas,a=this.globalRuntime.textService.measureText(a,t,e),e=(t.metrics=a).width,r=a.height,n=a.lineHeight,a=a.fontProperties,e=[e/2,r/2,0],r=[0,1],i=0,"center"===o||"middle"===o?(i=s/2,r=[.5,1]):"right"!==o&&"end"!==o||(i=s,r=[1,1]),o=0,"middle"===l?o=e[1]:"top"===l||"hanging"===l?o=2*e[1]:"alphabetic"===l?o=this.globalRuntime.enableCSSParsing?n-a.ascent:0:"bottom"!==l&&"ideographic"!==l||(o=0),c&&(i+=c),u&&(o+=u),t.anchor=[r[0],r[1],0],{width:2*e[0],height:2*e[1],offsetX:i,offsetY:o}):(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 el=nl;function nl(t){this.globalRuntime=t}Object.defineProperty(il.prototype,"name",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(il.prototype,"layerX",{get:function(){return this.layer.x},enumerable:!1,configurable:!0}),Object.defineProperty(il.prototype,"layerY",{get:function(){return this.layer.y},enumerable:!1,configurable:!0}),Object.defineProperty(il.prototype,"pageX",{get:function(){return this.page.x},enumerable:!1,configurable:!0}),Object.defineProperty(il.prototype,"pageY",{get:function(){return this.page.y},enumerable:!1,configurable:!0}),Object.defineProperty(il.prototype,"x",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(il.prototype,"y",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(il.prototype,"canvasX",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(il.prototype,"canvasY",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(il.prototype,"viewportX",{get:function(){return this.viewport.x},enumerable:!1,configurable:!0}),Object.defineProperty(il.prototype,"viewportY",{get:function(){return this.viewport.y},enumerable:!1,configurable:!0}),il.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(il.prototype,"propagationPath",{get:function(){return this.composedPath()},enumerable:!1,configurable:!0}),il.prototype.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},il.prototype.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},il.prototype.stopPropagation=function(){this.propagationStopped=!0},il.prototype.initEvent=function(){},il.prototype.initUIEvent=function(){},il.prototype.clone=function(){throw new Error(Hr)};var rl=il;function il(t){this.eventPhase=il.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Ir,this.page=new Ir,this.canvas=new Ir,this.viewport=new Ir,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}t(sl,al=rl),Object.defineProperty(sl.prototype,"clientX",{get:function(){return this.client.x},enumerable:!1,configurable:!0}),Object.defineProperty(sl.prototype,"clientY",{get:function(){return this.client.y},enumerable:!1,configurable:!0}),Object.defineProperty(sl.prototype,"movementX",{get:function(){return this.movement.x},enumerable:!1,configurable:!0}),Object.defineProperty(sl.prototype,"movementY",{get:function(){return this.movement.y},enumerable:!1,configurable:!0}),Object.defineProperty(sl.prototype,"offsetX",{get:function(){return this.offset.x},enumerable:!1,configurable:!0}),Object.defineProperty(sl.prototype,"offsetY",{get:function(){return this.offset.y},enumerable:!1,configurable:!0}),Object.defineProperty(sl.prototype,"globalX",{get:function(){return this.global.x},enumerable:!1,configurable:!0}),Object.defineProperty(sl.prototype,"globalY",{get:function(){return this.global.y},enumerable:!1,configurable:!0}),Object.defineProperty(sl.prototype,"screenX",{get:function(){return this.screen.x},enumerable:!1,configurable:!0}),Object.defineProperty(sl.prototype,"screenY",{get:function(){return this.screen.y},enumerable:!1,configurable:!0}),sl.prototype.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},sl.prototype.initMouseEvent=function(){throw new Error(Hr)};var al,ol=sl;function sl(){var t=null!==al&&al.apply(this,arguments)||this;return t.client=new Ir,t.movement=new Ir,t.offset=new Ir,t.global=new Ir,t.screen=new Ir,t}t(ul,ll=ol),ul.prototype.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},ul.prototype.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},ul.prototype.clone=function(){return this.manager.clonePointerEvent(this)};var ll,cl=ul;function ul(){var t=null!==ll&&ll.apply(this,arguments)||this;return t.width=0,t.height=0,t.isPrimary=!1,t}t(dl,hl=ol),dl.prototype.clone=function(){return this.manager.cloneWheelEvent(this)};var hl,fl=dl;function dl(){return null!==hl&&hl.apply(this,arguments)||this}t(yl,pl=rl);var pl,gl=yl;function yl(t,e){var n=pl.call(this,null)||this;return n.type=t,n.detail=e,Object.assign(n,e),n}ml.prototype.on=function(t,e,n){return this.addEventListener(t,e,n),this},ml.prototype.addEventListener=function(t,e,n){var r,i,a,o=Xe(n)&&n||je(n)&&n.capture,n=je(n)&&n.once,s=pi(e)?void 0:e,l=!1,c="";return-1<t.indexOf(":")&&(i=(r=j(t.split(":"),2))[0],t=r[1],c=i,l=!0),t=o?"".concat(t,"capture"):t,e=pi(e)?e:e.handleEvent,l&&(a=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.name)===c&&a.apply(void 0,O([],j(e),!1))}),n?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this},ml.prototype.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},ml.prototype.removeAllEventListeners=function(){this.emitter.removeAllListeners()},ml.prototype.removeEventListener=function(t,e,n){var n=Xe(n)&&n||je(n)&&n.capture,r=pi(e)?void 0:e;return t=n?"".concat(t,"capture"):t,e=pi(e)?e:null==e?void 0:e.handleEvent,this.emitter.off(t,e,r),this},ml.prototype.emit=function(t,e){this.dispatchEvent(new gl(t,e))},ml.prototype.dispatchEvent=function(t,e){var n;if(void 0===e&&(e=!1),!t.type)throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");if(n=this.document?this:this.defaultView||(null==(n=this.ownerDocument)?void 0:n.defaultView)){if(t.manager=n.getEventService()||null,!t.manager)return!1;t.defaultPrevented=!1,t.path=[],e||(t.target=this),null!=(n=t.manager)&&n.dispatchEvent(t,t.type,e)}return!t.defaultPrevented};ol=ml;function ml(){this.emitter=new Y}t(p,vl=ol),p.isNode=function(t){return!!t.childNodes},Object.defineProperty(p.prototype,"textContent",{get:function(){var e,t,n="";this.nodeName===k.TEXT&&(n+=this.style.text);try{for(var r=I(this.childNodes),i=r.next();!i.done;i=r.next()){var a=i.value;a.nodeName===k.TEXT?n+=a.nodeValue:n+=a.textContent}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return n},set:function(t){var e=this;this.childNodes.slice().forEach(function(t){e.removeChild(t)}),this.nodeName===k.TEXT&&(this.style.text="".concat(t))},enumerable:!1,configurable:!0}),p.prototype.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},p.prototype.hasChildNodes=function(){return 0<this.childNodes.length},p.prototype.isDefaultNamespace=function(t){throw new Error(Hr)},p.prototype.lookupNamespaceURI=function(t){throw new Error(Hr)},p.prototype.lookupPrefix=function(t){throw new Error(Hr)},p.prototype.normalize=function(){throw new Error(Hr)},p.prototype.isEqualNode=function(t){return this===t},p.prototype.isSameNode=function(t){return this.isEqualNode(t)},Object.defineProperty(p.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"firstChild",{get:function(){return 0<this.childNodes.length?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"lastChild",{get:function(){return 0<this.childNodes.length?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),p.prototype.compareDocumentPosition=function(t){var e;if(t===this)return 0;for(var n=t,r=this,i=[n],a=[r];null!=(e=n.parentNode)?e:r.parentNode;)n=n.parentNode?(i.push(n.parentNode),n.parentNode):n,r=r.parentNode?(a.push(r.parentNode),r.parentNode):r;if(n!==r)return p.DOCUMENT_POSITION_DISCONNECTED|p.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|p.DOCUMENT_POSITION_PRECEDING;var o=a.length<i.length?i:a,s=o===i?a:i;if(o[o.length-s.length]===s[0])return o===i?p.DOCUMENT_POSITION_CONTAINED_BY|p.DOCUMENT_POSITION_FOLLOWING:p.DOCUMENT_POSITION_CONTAINS|p.DOCUMENT_POSITION_PRECEDING;for(var l=o.length-s.length,c=s.length-1;0<=c;c--){var u,h=s[c],f=o[l+c];if(f!==h)return(u=h.parentNode.childNodes).indexOf(h)<u.indexOf(f)?s===i?p.DOCUMENT_POSITION_PRECEDING:p.DOCUMENT_POSITION_FOLLOWING:o===i?p.DOCUMENT_POSITION_PRECEDING:p.DOCUMENT_POSITION_FOLLOWING}return p.DOCUMENT_POSITION_FOLLOWING},p.prototype.contain=function(t){return this.contains(t)},p.prototype.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},p.prototype.getAncestor=function(t){for(var e=this;0<t&&e;)e=e.parentNode,t--;return e},p.prototype.forEach=function(e,t){void 0===t&&(t=!1),e(this)||(t?this.childNodes.slice():this.childNodes).forEach(function(t){t.forEach(e)})},p.DOCUMENT_POSITION_DISCONNECTED=1,p.DOCUMENT_POSITION_PRECEDING=2,p.DOCUMENT_POSITION_FOLLOWING=4,p.DOCUMENT_POSITION_CONTAINS=8,p.DOCUMENT_POSITION_CONTAINED_BY=16,p.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var vl,bl=p;function p(){var t=null!==vl&&vl.apply(this,arguments)||this;return t.shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}wl.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)},wl.prototype.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},wl.prototype.client2Viewport=function(t){var e=this.context.contextService.getBoundingClientRect();return new Ir(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},wl.prototype.viewport2Client=function(t){var e=this.context.contextService.getBoundingClientRect();return new Ir(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},wl.prototype.viewport2Canvas=function(t){var e=t.x,t=t.y,n=this.rootTarget.defaultView.getCamera(),r=this.context.config,i=r.width,r=r.height,a=n.getPerspectiveInverse(),n=n.getWorldTransform(),n=ct(this.tmpMatrix,n,a),a=Nt(this.tmpVec3,e/i*2-1,2*(1-t/r)-1,0);return Wt(a,a,n),new Ir(a[0],a[1])},wl.prototype.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),e=e.getViewTransform(),n=ct(this.tmpMatrix,n,e),e=Nt(this.tmpVec3,t.x,t.y,0),t=(Wt(this.tmpVec3,this.tmpVec3,n),this.context.config),n=t.width,t=t.height;return new Ir((e[0]+1)/2*n,(1-(e[1]+1)/2)*t)},wl.prototype.setPickHandler=function(t){this.pickHandler=t},wl.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})},wl.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))}},wl.prototype.dispatchEvent=function(t,e,n){n?(t.eventPhase=t.AT_TARGET,n=this.rootTarget.defaultView||null,t.currentTarget=n,this.notifyListeners(t,e)):(t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e)),this.emitter.emit(e||t.type,t)},wl.prototype.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;1<=r;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}}},wl.prototype.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)e.unshift(n.document);else{for(var r=0;r<2048&&t!==this.rootTarget;r++)bl.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);n&&e.push(n)}return e},wl.prototype.hitTest=function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config,i=r.width,r=r.height;return!(e<0||n<0||i<e||r<n)&&(this.pickHandler(t)||this.rootTarget)||null},wl.prototype.isNativeEventFromCanvas=function(t){var e=this.context.contextService.getDomElement(),n=null==(n=t.nativeEvent)?void 0:n.target;if(n){if(n===e)return!0;if(e&&e.contains)return e.contains(n)}return!!t.nativeEvent.composedPath&&-1<t.nativeEvent.composedPath().indexOf(e)},wl.prototype.getExistedHTML=function(t){var e,n;if(t.nativeEvent.composedPath)try{for(var r=I(t.nativeEvent.composedPath()),i=r.next();!i.done;i=r.next()){var a=i.value,o=this.globalRuntime.nativeHTMLMap.get(a);if(o)return o}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return null},wl.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})},wl.prototype.createPointerEvent=function(t,e,n,r){var i=this.allocateEvent(cl),t=(this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t,this.getExistedHTML(i));return i.target=null!=n?n:t||this.isNativeEventFromCanvas(i)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i},wl.prototype.createWheelEvent=function(t){var e=this.allocateEvent(fl),t=(this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t,this.getExistedHTML(e));return e.target=t||this.isNativeEventFromCanvas(e)&&this.pickTarget(e),e},wl.prototype.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},wl.prototype.cloneWheelEvent=function(t){var e=this.allocateEvent(fl);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},wl.prototype.clonePointerEvent=function(t,e){var n=this.allocateEvent(cl);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},wl.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},wl.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)},wl.prototype.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},wl.prototype.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=ps.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},wl.prototype.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);t=this.eventPool.get(t).pop()||new t(this);return t.eventPhase=t.NONE,t.currentTarget=null,t.path=[],t.target=null,t},wl.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)},wl.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)},wl.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)},wl.prototype.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;0<=n;n--){var r=t[n];if(!(r===this.rootTarget||bl.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},wl.prototype.getCursor=function(t){for(var e=t;e;){var n=!!e.getAttribute&&e.getAttribute("cursor");if(n)return n;e=bl.isNode(e)&&e.parentNode}};var xl=wl;function wl(t,e){var c=this;this.globalRuntime=t,this.context=e,this.emitter=new Y,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=Z(),this.tmpVec3=v(),this.onPointerDown=function(t){var e,n=c.createPointerEvent(t);c.dispatchEvent(n,"pointerdown"),"touch"===n.pointerType?c.dispatchEvent(n,"touchstart"):"mouse"!==n.pointerType&&"pen"!==n.pointerType||(e=2===n.button,c.dispatchEvent(n,e?"rightdown":"mousedown")),c.trackingData(t.pointerId).pressTargetsByButton[t.button]=n.composedPath(),c.freeEvent(n)},this.onPointerUp=function(t){var e=ps.now(),n=c.createPointerEvent(t,void 0,void 0,c.context.config.alwaysTriggerPointerEventOnCanvas?c.rootTarget:void 0),r=(c.dispatchEvent(n,"pointerup"),"touch"===n.pointerType?c.dispatchEvent(n,"touchend"):"mouse"!==n.pointerType&&"pen"!==n.pointerType||(o=2===n.button,c.dispatchEvent(n,o?"rightup":"mouseup")),c.trackingData(t.pointerId)),i=c.findMountedTarget(r.pressTargetsByButton[t.button]),a=i;if(i&&!n.composedPath().includes(i)){for(var o,s=i;s&&!n.composedPath().includes(s);)n.currentTarget=s,c.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType?c.notifyTarget(n,"touchendoutside"):"mouse"!==n.pointerType&&"pen"!==n.pointerType||(o=2===n.button,c.notifyTarget(n,o?"rightupoutside":"mouseupoutside")),bl.isNode(s)&&(s=s.parentNode);delete r.pressTargetsByButton[t.button],a=s}a&&((i=c.clonePointerEvent(n,"click")).target=a,i.path=[],r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:i.target,timeStamp:e}),(a=r.clicksByButton[t.button]).target===i.target&&e-a.timeStamp<200?++a.clickCount:a.clickCount=1,a.target=i.target,a.timeStamp=e,i.detail=a.clickCount,null!=(r=n.detail)&&r.preventClick||(c.context.config.useNativeClickEvent||"mouse"!==i.pointerType&&"touch"!==i.pointerType||c.dispatchEvent(i,"click"),c.dispatchEvent(i,"pointertap")),c.freeEvent(i)),c.freeEvent(n)},this.onPointerMove=function(t){var e=c.createPointerEvent(t,void 0,void 0,c.context.config.alwaysTriggerPointerEventOnCanvas?c.rootTarget:void 0),n="mouse"===e.pointerType||"pen"===e.pointerType,r=c.trackingData(t.pointerId),i=c.findMountedTarget(r.overTargets);if(r.overTargets&&i!==e.target){var a="mousemove"===t.type?"mouseout":"pointerout",a=c.createPointerEvent(t,a,i||void 0);if(c.dispatchEvent(a,"pointerout"),n&&c.dispatchEvent(a,"mouseout"),!e.composedPath().includes(i)){var o=c.createPointerEvent(t,"pointerleave",i||void 0);for(o.eventPhase=o.AT_TARGET;o.target&&!e.composedPath().includes(o.target);)o.currentTarget=o.target,c.notifyTarget(o),n&&c.notifyTarget(o,"mouseleave"),bl.isNode(o.target)&&(o.target=o.target.parentNode);c.freeEvent(o)}c.freeEvent(a)}if(i!==e.target){for(var a="mousemove"===t.type?"mouseover":"pointerover",t=c.clonePointerEvent(e,a),s=(c.dispatchEvent(t,"pointerover"),n&&c.dispatchEvent(t,"mouseover"),i&&bl.isNode(i)&&i.parentNode);s&&s!==(bl.isNode(c.rootTarget)&&c.rootTarget.parentNode)&&s!==e.target;)s=s.parentNode;if(!s||s===(bl.isNode(c.rootTarget)&&c.rootTarget.parentNode)){var l=c.clonePointerEvent(e,"pointerenter");for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==i&&l.target!==(bl.isNode(c.rootTarget)&&c.rootTarget.parentNode);)l.currentTarget=l.target,c.notifyTarget(l),n&&c.notifyTarget(l,"mouseenter"),bl.isNode(l.target)&&(l.target=l.target.parentNode);c.freeEvent(l)}c.freeEvent(t)}c.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&c.dispatchEvent(e,"touchmove"),n&&(c.dispatchEvent(e,"mousemove"),c.cursor=c.getCursor(e.target)),r.overTargets=e.composedPath(),c.freeEvent(e)},this.onPointerOut=function(t){var e=c.trackingData(t.pointerId);if(e.overTargets){var n="mouse"===t.pointerType||"pen"===t.pointerType,r=c.findMountedTarget(e.overTargets),i=c.createPointerEvent(t,"pointerout",r||void 0),a=(c.dispatchEvent(i),n&&c.dispatchEvent(i,"mouseout"),c.createPointerEvent(t,"pointerleave",r||void 0));for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(bl.isNode(c.rootTarget)&&c.rootTarget.parentNode);)a.currentTarget=a.target,c.notifyTarget(a),n&&c.notifyTarget(a,"mouseleave"),bl.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=null,c.freeEvent(i),c.freeEvent(a)}c.cursor=null},this.onPointerOver=function(t){var e=c.trackingData(t.pointerId),t=c.createPointerEvent(t),n="mouse"===t.pointerType||"pen"===t.pointerType,r=(c.dispatchEvent(t,"pointerover"),n&&c.dispatchEvent(t,"mouseover"),"mouse"===t.pointerType&&(c.cursor=c.getCursor(t.target)),c.clonePointerEvent(t,"pointerenter"));for(r.eventPhase=r.AT_TARGET;r.target&&r.target!==(bl.isNode(c.rootTarget)&&c.rootTarget.parentNode);)r.currentTarget=r.target,c.notifyTarget(r),n&&c.notifyTarget(r,"mouseenter"),bl.isNode(r.target)&&(r.target=r.target.parentNode);e.overTargets=t.composedPath(),c.freeEvent(t),c.freeEvent(r)},this.onPointerUpOutside=function(t){var e=c.trackingData(t.pointerId),n=c.findMountedTarget(e.pressTargetsByButton[t.button]),r=c.createPointerEvent(t);if(n){for(var i=n;i;)r.currentTarget=i,c.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType||"mouse"!==r.pointerType&&"pen"!==r.pointerType||c.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),bl.isNode(i)&&(i=i.parentNode);delete e.pressTargetsByButton[t.button]}c.freeEvent(r)},this.onWheel=function(t){t=c.createWheelEvent(t);c.dispatchEvent(t),c.freeEvent(t)},this.onClick=function(t){c.context.config.useNativeClickEvent&&(t=c.createPointerEvent(t),c.dispatchEvent(t),c.freeEvent(t))},this.onPointerCancel=function(t){t=c.createPointerEvent(t,void 0,void 0,c.context.config.alwaysTriggerPointerEventOnCanvas?c.rootTarget:void 0);c.dispatchEvent(t),c.freeEvent(t)}}kl.prototype.getOrCreateCanvas=function(t,e){if(!this.canvas){if(t||E.offscreenCanvas)this.canvas=t||E.offscreenCanvas,this.context=this.canvas.getContext("2d",e);else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",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",e)}this.canvas.width=10,this.canvas.height=10}return this.canvas},kl.prototype.getOrCreateContext=function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context};var Ml,Ol=kl;function kl(){}(_l=Ml=Ml||{})[_l.CAMERA_CHANGED=0]="CAMERA_CHANGED",_l[_l.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",_l[_l.NONE=2]="NONE";Sl.prototype.init=function(t){var e=this,n=m(m({},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()})},Sl.prototype.getStats=function(){return this.stats},Sl.prototype.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(Ml.CAMERA_CHANGED)},Sl.prototype.render=function(t,e){var n=this,r=(this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0,this.context.renderingContext);this.globalRuntime.sceneGraphService.syncHierarchy(r.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),r.renderReasons.size&&this.inited&&(this.renderDisplayObject(r.root,t,r),this.hooks.beginFrame.call(),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())},Sl.prototype.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),a=i.enableDirtyCheck,i=i.enableCulling,a=(this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t),a?this.hooks.dirtycheck.call(t):t),a=(a&&(i=i?this.hooks.cull.call(a,this.context.camera):a)&&(this.stats.rendered++,n.renderListCurrentFrame.push(i)),t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++,t.sortable);a.dirty&&(this.sort(t,a),a.dirty=!1,a.dirtyChildren=[],a.dirtyReason=void 0),(a.sorted||t.childNodes).forEach(function(t){r.renderDisplayObject(t,e,n)})},Sl.prototype.sort=function(n,r){r.sorted&&r.dirtyReason!==Ti.Z_INDEX_CHANGED?r.dirtyChildren.forEach(function(t){var e;-1===n.childNodes.indexOf(t)?0<=(e=r.sorted.indexOf(t))&&r.sorted.splice(e,1):0===r.sorted.length?r.sorted.push(t):(e=function(t,e){for(var n=0,r=t.length;n<r;){var i=n+r>>>1;us(t[i],e)<0?n=1+i:r=i}return n}(r.sorted,t),r.sorted.splice(e,0,t))}):r.sorted=n.childNodes.slice().sort(us)},Sl.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},Sl.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(Ml.DISPLAY_OBJECT_CHANGED)};var El=Sl;function Sl(t,e){this.globalRuntime=t,this.context=e,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Ns,initAsync:new Ts,dirtycheck:new Rs,cull:new Rs,beginFrame:new Ns,beforeRender:new Ns,render:new Ns,afterRender:new Ns,endFrame:new Ns,destroy:new Ns,pick:new Cs,pickSync:new Rs,pointerDown:new Ns,pointerUp:new Ns,pointerMove:new Ns,pointerOut:new Ns,pointerOver:new Ns,pointerWheel:new Ns,pointerCancel:new Ns,click:new Ns}}var Al=/\[\s*(.*)=(.*)\s*\]/,_l=(Tl.prototype.selectOne=function(e,n){var t,r,i,a=this;return e.startsWith(".")?n.find(function(t){return-1<((null==t?void 0:t.classList)||[]).indexOf(a.getIdOrClassname(e))}):e.startsWith("#")?n.find(function(t){return t.id===a.getIdOrClassname(e)}):e.startsWith("[")?(t=this.getAttribute(e),r=t.name,i=t.value,r?n.find(function(t){return n!==t&&("name"===r?t.name===i:a.attributeToString(t,r)===i)}):null):n.find(function(t){return n!==t&&t.nodeName===e})},Tl.prototype.selectAll=function(e,n){var t,r,i,a=this;return e.startsWith(".")?n.findAll(function(t){return n!==t&&-1<((null==t?void 0:t.classList)||[]).indexOf(a.getIdOrClassname(e))}):e.startsWith("#")?n.findAll(function(t){return n!==t&&t.id===a.getIdOrClassname(e)}):e.startsWith("[")?(t=this.getAttribute(e),r=t.name,i=t.value,r?n.findAll(function(t){return n!==t&&("name"===r?t.name===i:a.attributeToString(t,r)===i)}):[]):n.findAll(function(t){return n!==t&&t.nodeName===e})},Tl.prototype.is=function(t,e){var n,r;return t.startsWith(".")?e.className===this.getIdOrClassname(t):t.startsWith("#")?e.id===this.getIdOrClassname(t):t.startsWith("[")?(n=(r=this.getAttribute(t)).name,r=r.value,"name"===n?e.name===r:this.attributeToString(e,n)===r):e.nodeName===t},Tl.prototype.getIdOrClassname=function(t){return t.substring(1)},Tl.prototype.getAttribute=function(t){var t=t.match(Al),e="",n="";return t&&2<t.length&&(e=t[1].replace(/"/g,""),n=t[2].replace(/"/g,"")),{name:e,value:n}},Tl.prototype.attributeToString=function(t,e){return t.getAttribute&&(t=t.getAttribute(e),!P(t))&&t.toString?t.toString():""},Tl);function Tl(){}t(Ll,Pl=rl),Ll.ADDITION=2,Ll.MODIFICATION=1,Ll.REMOVAL=3;var Pl,b,Cl=Ll;function Ll(t,e,n,r,i,a,o,s){var l=Pl.call(this,null)||this;return l.relatedNode=e,l.prevValue=n,l.newValue=r,l.attrName=i,l.attrChange=a,l.prevParsedValue=o,l.newParsedValue=s,l.type=t,l}function Nl(t){t=t.renderable;t&&(t.renderBoundsDirty=!0,t.boundsDirty=!0)}(Rl=b=b||{}).REPARENT="reparent",Rl.DESTROY="destroy",Rl.ATTR_MODIFIED="DOMAttrModified",Rl.INSERTED="DOMNodeInserted",Rl.REMOVED="removed",Rl.MOUNTED="DOMNodeInsertedIntoDocument",Rl.UNMOUNTED="DOMNodeRemovedFromDocument",Rl.BOUNDS_CHANGED="bounds-changed",Rl.CULLED="culled";var jl=new Cl(b.REPARENT,null,"","","",0,"",""),Rl=(s.prototype.matches=function(t,e){return this.runtime.sceneGraphSelector.is(t,e)},s.prototype.querySelector=function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)},s.prototype.querySelectorAll=function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)},s.prototype.attach=function(t,e,n){var r=!1,n=(t.parentNode&&(r=t.parentNode!==e,this.detach(t)),t.parentNode=e,P(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t),e.sortable),e=((null!=(e=null==n?void 0:n.sorted)&&e.length||null!=(e=t.style)&&e.zIndex)&&(-1===n.dirtyChildren.indexOf(t)&&n.dirtyChildren.push(t),n.dirty=!0,n.dirtyReason=Ti.ADDED),t.transformable);e&&this.dirtifyWorld(t,e),e.frozen&&this.unfreezeParentToRoot(t),r&&t.dispatchEvent(jl)},s.prototype.detach=function(t){var e,n,r;t.parentNode&&(e=t.transformable,(null!=(r=null==(n=t.parentNode.sortable)?void 0:n.sorted)&&r.length||null!=(r=t.style)&&r.zIndex)&&(-1===n.dirtyChildren.indexOf(t)&&n.dirtyChildren.push(t),n.dirty=!0,n.dirtyReason=Ti.REMOVED),-1<(r=t.parentNode.childNodes.indexOf(t))&&t.parentNode.childNodes.splice(r,1),e&&this.dirtifyWorld(t,e),t.parentNode=null)},s.prototype.getOrigin=function(t){return t.transformable.origin},s.prototype.setOrigin=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0);var i=t.transformable;(e="number"==typeof e?[e,n,r]:e)[0]===i.origin[0]&&e[1]===i.origin[1]&&e[2]===i.origin[2]||((n=i.origin)[0]=e[0],n[1]=e[1],n[2]=e[2]||0,this.dirtifyLocal(t,i))},s.prototype.setLocalEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ct(e,n,r));n=t.transformable;Qt(n.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,n)},s.prototype.scaleLocal=function(t,e){var n,r,i=t.transformable;n=i.localScale,r=i.localScale,e=Ct(e[0],e[1],e[2]||1),n[0]=r[0]*e[0],n[1]=r[1]*e[1],n[2]=r[2]*e[2],this.dirtifyLocal(t,i)},s.prototype.setLocalScale=function(t,e){var n=t.transformable,e=Ct(e[0],e[1],e[2]||n.localScale[2]);Ht(e,n.localScale)||(Lt(n.localScale,e),this.dirtifyLocal(t,n))},s.prototype.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=Jt(e,n,r,i));n=t.transformable;te(n.localRotation,e),this.dirtifyLocal(t,n)},s.prototype.setLocalSkew=function(t,e,n){"number"==typeof e&&(i=e,n=n,(r=new $(2))[0]=i,r[1]=n,e=r);var r,i=t.transformable;n=i.localSkew,r=e,n[0]=r[0],n[1]=r[1],this.dirtifyLocal(t,i)},s.prototype.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag)||this.dirtifyWorld(t,e)},s.prototype.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)},s.prototype.triggerPendingEvents=function(){function r(t,e){t.isConnected&&!i.has(t.entity)&&(n.boundsChangedEvent.detail=e,(n.boundsChangedEvent.target=t).isMutationObserved?t.dispatchEvent(n.boundsChangedEvent):t.ownerDocument.defaultView.dispatchEvent(n.boundsChangedEvent,!0),i.add(t.entity))}var n=this,i=new Set;this.pendingEvents.forEach(function(t){var t=j(t,2),e=t[0],n=t[1];n.affectChildren?e.forEach(function(t){r(t,n)}):r(e,n)}),this.clearPendingEvents(),i.clear()},s.prototype.clearPendingEvents=function(){this.pendingEvents=[]},s.prototype.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)Nl(n),n=n.parentNode;e&&t.forEach(function(t){Nl(t)}),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren:e}])},s.prototype.updateDisplayObjectDependency=function(t,e,n,r){var i;e&&e!==n&&(e=this.displayObjectDependencyMap.get(e))&&e[t]&&(i=e[t].indexOf(r),e[t].splice(i,1)),n&&((e=this.displayObjectDependencyMap.get(n))||(this.displayObjectDependencyMap.set(n,{}),e=this.displayObjectDependencyMap.get(n)),e[t]||(e[t]=[]),e[t].push(r))},s.prototype.informDependentDisplayObjects=function(t){var n=this,r=this.displayObjectDependencyMap.get(t);r&&Object.keys(r).forEach(function(e){r[e].forEach(function(t){n.dirtifyToRoot(t,!0),t.dispatchEvent(new Cl(b.ATTR_MODIFIED,t,n,n,e,Cl.MODIFICATION,n,n)),t.isCustomElement&&t.isConnected&&t.attributeChangedCallback&&t.attributeChangedCallback(e,n,n)})})},s.prototype.getPosition=function(t){var e=t.transformable;return mt(e.position,this.getWorldTransform(t,e))},s.prototype.getRotation=function(t){var e=t.transformable;return bt(e.rotation,this.getWorldTransform(t,e))},s.prototype.getScale=function(t){var e=t.transformable;return vt(e.scaling,this.getWorldTransform(t,e))},s.prototype.getWorldTransform=function(t,e){return((e=void 0===e?t.transformable:e).localDirtyFlag||e.dirtyFlag)&&(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e)),e.worldTransform},s.prototype.getLocalPosition=function(t){return t.transformable.localPosition},s.prototype.getLocalRotation=function(t){return t.transformable.localRotation},s.prototype.getLocalScale=function(t){return t.transformable.localScale},s.prototype.getLocalSkew=function(t){return t.transformable.localSkew},s.prototype.getLocalTransform=function(t){t=t.transformable;return t.localDirtyFlag&&(this.calcLocalTransform(t),t.localDirtyFlag=!1),t.localTransform},s.prototype.setLocalTransform=function(t,e){var n=mt(v(),e),r=bt(Ut(),e),e=vt(v(),e);this.setLocalScale(t,e),this.setLocalPosition(t,n),this.setLocalRotation(t,r)},s.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])},s.prototype.getTransformedGeometryBounds=function(t,e,n){e=this.getGeometryBounds(t,e=void 0===e?!1:e);return Tr.isEmpty(e)?null:((n=n||new Tr).setFromTransformedAABB(e,this.getWorldTransform(t)),n)},s.prototype.getGeometryBounds=function(t,e){t=t.geometry;return((e=void 0===e?!1:e)?t.renderBounds:t.contentBounds||null)||new Tr},s.prototype.getBounds=function(t,e){var n,r,i=this,a=(void 0===e&&(e=!1),t.renderable);return a.boundsDirty||e||!a.bounds?!a.renderBoundsDirty&&e&&a.renderBounds?a.renderBounds:(n=e?a.renderBounds:a.bounds,r=this.getTransformedGeometryBounds(t,e,n),t.childNodes.forEach(function(t){t=i.getBounds(t,e);t&&(r?r.add(t):(r=n||new Tr).update(t.center,t.halfExtents))}),e&&(t=hs(t))&&(t=t.parsedStyle.clipPath.getBounds(e),r?t&&(r=t.intersection(r)):r=t),(r=r||new Tr)&&(e?a.renderBounds=r:a.bounds=r),e?a.renderBoundsDirty=!1:a.boundsDirty=!1,r):a.bounds},s.prototype.getLocalBounds=function(t){if(t.parentNode){var e,n=Z(),r=(t.parentNode.transformable&&(n=rt(Z(),this.getWorldTransform(t.parentNode))),this.getBounds(t));if(!Tr.isEmpty(r))return(e=new Tr).setFromTransformedAABB(r,n),e}return this.getBounds(t)},s.prototype.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t),i=(Tr.isEmpty(i)||(r=new Tr).setFromTransformedAABB(i,this.getWorldTransform(t)),null==(t=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:t.getContextService().getBoundingClientRect());return r?(e=(t=j(r.getMin(),2))[0],t=t[1],n=(r=j(r.getMax(),2))[0],r=r[1],new Dr(e+((null==i?void 0:i.left)||0),t+((null==i?void 0:i.top)||0),n-e,r-t)):new Dr((null==i?void 0:i.left)||0,(null==i?void 0:i.top)||0,0,0)},s.prototype.dirtifyWorldInternal=function(t,e){var n=this;!e.dirtyFlag&&(e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach(function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}),e=t.renderable)&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)},s.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])}},s.prototype.sync=function(t,e){var n;e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag&&(n=(t=t.parentNode)&&t.transformable,null!==t&&n?ct(e.worldTransform,n.worldTransform,e.localTransform):J(e.worldTransform,e.localTransform),e.dirtyFlag=!1)},s.prototype.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},s);function s(t){var o,i,a,r,s,l,c,u,h,n,f,d,g=this;this.runtime=t,this.pendingEvents=[],this.boundsChangedEvent=new gl(b.BOUNDS_CHANGED),this.rotate=(o=Ut(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ct(e,n,r));var i,a,n=t.transformable;null!==t.parentNode&&t.parentNode.transformable?(Qt(r=Ut(),e[0],e[1],e[2]),i=g.getRotation(t),a=g.getRotation(t.parentNode),te(o,a),Zt(o,o),Kt(r,o,r),Kt(n.localRotation,r,i),ne(n.localRotation,n.localRotation),g.dirtifyLocal(t,n)):g.rotateLocal(t,e)}),this.rotateLocal=(i=Ut(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ct(e,n,r));n=t.transformable;Qt(i,e[0],e[1],e[2]),ee(n.localRotation,n.localRotation,i),g.dirtifyLocal(t,n)}),this.setEulerAngles=(a=Ut(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ct(e,n,r));n=t.transformable;null!==t.parentNode&&t.parentNode.transformable?(Qt(n.localRotation,e[0],e[1],e[2]),r=g.getRotation(t.parentNode),te(a,Zt(Ut(),r)),ee(n.localRotation,n.localRotation,a),g.dirtifyLocal(t,n)):g.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ct(e,n,r));var i,a,o,s,l,c,u,h,f,d,p,n=t.transformable;Ht(e,v())||(i=r=e,a=n.localRotation,o=a[0],s=a[1],l=a[2],a=a[3],c=i[0],u=i[1],i=i[2],p=s*(d=o*u-s*c)-l*(f=l*c-o*i),l=l*(h=s*i-l*u)-o*d,o=o*f-s*h,f*=s=2*a,d*=s,l*=2,o*=2,r[0]=c+(h*=s)+(p*=2),r[1]=u+f+l,r[2]=i+d+o,jt(n.localPosition,n.localPosition,e),g.dirtifyLocal(t,n))},this.setPosition=(r=Z(),s=v(),function(t,e){var n=t.transformable;s[0]=e[0],s[1]=e[1],s[2]=e[2]||0,Ht(g.getPosition(t),s)||(Lt(n.position,s),null!==t.parentNode&&t.parentNode.transformable?(e=t.parentNode.transformable,J(r,e.worldTransform),rt(r,r),Wt(n.localPosition,s,r)):Lt(n.localPosition,s),g.dirtifyLocal(t,n))}),this.setLocalPosition=(l=v(),function(t,e){var n=t.transformable;l[0]=e[0],l[1]=e[1],l[2]=e[2]||0,Ht(n.localPosition,l)||(Lt(n.localPosition,l),g.dirtifyLocal(t,n))}),this.translate=(c=v(),u=v(),h=v(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),Ht(e="number"==typeof e?Nt(u,e,n,r):e,c)||(jt(h,g.getPosition(t),e),g.setPosition(t,h))}),this.setRotation=function(){var o=Ut();return function(t,e,n,r,i){var a=t.transformable;"number"==typeof e&&(e=Jt(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable?(n=g.getRotation(t.parentNode),te(o,n),Zt(o,o),Kt(a.localRotation,o,e),ne(a.localRotation,a.localRotation),g.dirtifyLocal(t,a)):g.setLocalRotation(t,e)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=(n=Z(),f=v(),d=Jt(0,0,0,1),function(t){var e;0!==t.localSkew[0]||0!==t.localSkew[1]?(xt(t.localTransform,t.localRotation,t.localPosition,Ct(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||((e=et(n))[4]=Math.tan(t.localSkew[0]),e[1]=Math.tan(t.localSkew[1]),ct(t.localTransform,t.localTransform,e)),e=xt(n,d,f,t.localScale,t.origin),ct(t.localTransform,t.localTransform,e)):xt(t.localTransform,t.localRotation,t.localPosition,t.localScale,t.origin)})}var Il={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]},Bl=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,Dl=new RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),Fl=new RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),zl=(Wl.prototype.measureFont=function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];for(var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),e=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0}),i=(e.font=t,Il.MetricsString+Il.BaselineSymbol),a=Math.ceil(e.measureText(i).width),o=Math.ceil(e.measureText(Il.BaselineSymbol).width),s=Il.HeightMultiplier*o,o=o*Il.BaselineMultiplier|0,l=(r.width=a,r.height=s,e.fillStyle="#f00",e.fillRect(0,0,a,s),e.font=t,e.textBaseline="alphabetic",e.fillStyle="#000",e.fillText(i,0,o),e.getImageData(0,0,a||1,s||1).data),r=l.length,c=4*a,u=0,h=0,f=!1,u=0;u<o;++u){for(var d=0;d<c;d+=4)if(255!==l[h+d]){f=!0;break}if(f)break;h+=c}for(n.ascent=o-u,h=r-c,f=!1,u=s;o<u;--u){for(d=0;d<c;d+=4)if(255!==l[h+d]){f=!0;break}if(f)break;h-=c}return n.descent=u-o,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n},Wl.prototype.measureText=function(t,e,n){var r=e.fontSize,i=e.wordWrap,a=e.lineHeight,o=e.lineWidth,s=e.textBaseline,l=e.textAlign,c=e.letterSpacing,u=e.textPath,h=(e.textPathSide,e.textPathStartOffset,e.leading),h=void 0===h?0:h,f=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,t=t.fontWeight,e=Ge(e)&&"".concat(e,"px")||"16px",a=n.split(","),o=a.length-1;0<=o;o--){var s=a[o].trim();!Ds.test(s)&&Bs.indexOf(s)<0&&(s='"'.concat(s,'"')),a[o]=s}return"".concat(r," ").concat(i," ").concat(t," ").concat(e," ").concat(a.join(","))}(e),d=this.measureFont(f,n),p=(0===d.fontSize&&(d.fontSize=r,d.ascent=r),this.runtime.offscreenCanvasCreator.getOrCreateContext(n));p.font=f,e.isOverflowing=!1;var g=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),y=new Array(g.length),m=0;if(!u){for(M=0;M<g.length;M++){var v=p.measureText(g[M]).width+(g[M].length-1)*c;y[M]=v,m=Math.max(m,v)}var b=m+o,x=a||d.fontSize+o,r=Math.max(x,d.fontSize+o)+(g.length-1)*(x+h),w=0;return"middle"===s?w=-r/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?w=-r:"top"!==s&&"hanging"!==s||(w=0),{font:f,width:b,height:r,lines:g,lineWidths:y,lineHeight:x+=h,maxLineWidth:m,fontProperties:d,lineMetrics:y.map(function(t,e){var n=0;return"center"===l||"middle"===l?n-=t/2:"right"!==l&&"end"!==l||(n-=t),new Dr(n-o/2,w+e*x,t+o,x)})}}u.getTotalLength();for(var M=0;M<g.length;M++)var b=p.measureText(g[M]).width+(g[M].length-1)*c},Wl.prototype.setGraphemeOnPath=function(){},Wl.prototype.wordWrap=function(t,e,n){for(var r=this,i=e.wordWrapWidth,i=void 0===i?0:i,a=e.letterSpacing,o=e.maxLines,s=void 0===o?1/0:o,o=e.textOverflow,l=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),c=i+a,u="",h=("ellipsis"===o?u="...":o&&"clip"!==o&&(u=o),[]),f=0,d=0,p={},g=function(t){return r.getFromCache(t,a,p,l)},y=Array.from(u).reduce(function(t,e){return t+g(e)},0),m=Array.from(t),v=0;v<m.length;v++){var b=m[v],x=t[v-1],w=t[v+1],M=g(b);if(this.isNewline(b)){if(s<=++f){e.isOverflowing=!0;break}d=0,h[f]=""}else{if(0<d&&c<d+M){if(s<=f+1){if(e.isOverflowing=!0,0<y&&y<=c){for(var O=h[f].length,k=0,E=O,S=0;S<O;S++){var A=g(h[f][S]);if(c<k+A+y){E=S;break}k+=A}h[f]=(h[f]||"").slice(0,E)+u}break}if(d=0,h[++f]="",this.isBreakingSpace(b))continue;this.canBreakInLastChar(b)||(h=this.trimToBreakable(h),d=this.sumTextWidthByCache(h[f]||"",p)),this.shouldBreakByKinsokuShorui(b,w)&&(h=this.trimByKinsokuShorui(h),d+=g(x||""))}d+=M,h[f]=(h[f]||"")+b}}return h.join("\n")},Wl.prototype.isBreakingSpace=function(t){return"string"==typeof t&&0<=Il.BreakingSpaces.indexOf(t.charCodeAt(0))},Wl.prototype.isNewline=function(t){return"string"==typeof t&&0<=Il.Newlines.indexOf(t.charCodeAt(0))},Wl.prototype.trimToBreakable=function(t){var e,t=O([],j(t),!1),n=t[t.length-2],r=this.findBreakableIndex(n);return-1!==r&&n&&(e=n.slice(r,r+1),e=r+(this.isBreakingSpace(e)?0:1),t[t.length-1]+=n.slice(r+1,n.length),t[t.length-2]=n.slice(0,e)),t},Wl.prototype.canBreakInLastChar=function(t){return!t||!Bl.test(t)},Wl.prototype.sumTextWidthByCache=function(t,n){return t.split("").reduce(function(t,e){if(n[e])return t+n[e];throw Error("cannot count the word without cache")},0)},Wl.prototype.findBreakableIndex=function(t){for(var e=t.length-1;0<=e;e--)if(!Bl.test(t[e]))return e;return-1},Wl.prototype.getFromCache=function(t,e,n,r){var i=n[t];return"number"!=typeof i&&(e=t.length*e,i=r.measureText(t).width+e,n[t]=i),i},Wl);function Wl(t){var n=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!Fl.exec(e)&&!Dl.exec(t))},this.trimByKinsokuShorui=function(t){var e,n=O([],j(t),!1),r=n[n.length-2];return r?(e=r[r.length-1],n[n.length-2]=r.slice(0,-1),n[n.length-1]=e+n[n.length-1],n):t}}var Gl,E={},Hs=(Js=new Js,Zs=new Zs,(uu={})[k.CIRCLE]=new Hs,uu[k.ELLIPSE]=new Ys,uu[k.RECT]=Js,uu[k.IMAGE]=Js,uu[k.GROUP]=Js,uu[k.LINE]=new $s,uu[k.TEXT]=new el(E),uu[k.POLYLINE]=Zs,uu[k.POLYGON]=Zs,uu[k.PATH]=new Xs,uu[k.HTML]=null,uu[k.MESH]=null,uu),el=(Ys=new So,Js=new Co,($s={})[a.PERCENTAGE]=null,$s[a.NUMBER]=new Vo,$s[a.ANGLE]=new ii,$s[a.DEFINED_PATH]=new o,$s[a.PAINT]=Ys,$s[a.COLOR]=Ys,$s[a.FILTER]=new _o,$s[a.LENGTH]=Js,$s[a.LENGTH_PERCENTAGE]=Js,$s[a.LENGTH_PERCENTAGE_12]=new No,$s[a.LENGTH_PERCENTAGE_14]=new Ro,$s[a.COORDINATE]=new zo,$s[a.OFFSET_DISTANCE]=new qo,$s[a.OPACITY_VALUE]=new Uo,$s[a.PATH]=new Ko,$s[a.LIST_OF_POINTS]=new Qo,$s[a.SHADOW_BLUR]=new es,$s[a.TEXT]=new rs,$s[a.TEXT_TRANSFORM]=new as,$s[a.TRANSFORM]=new Ss,$s[a.TRANSFORM_ORIGIN]=new zs,$s[a.Z_INDEX]=new Ws,$s[a.MARKER]=new Go,$s),Hl=(E.CameraContribution=n,E.AnimationTimeline=null,E.EasingFunction=null,E.offscreenCanvasCreator=new Ol,E.nativeHTMLMap=new WeakMap,E.sceneGraphSelector=new _l,E.sceneGraphService=new Rl(E),E.textService=new zl(E),E.geometryUpdaterFactory=Hs,E.CSSPropertySyntaxFactory=el,E.styleValueRegistry=new i(E),E.layoutRegistry=null,E.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:S,E.enableCSSParsing=!0,E.enableDataset=!1,E.enableStyleSyntax=!0,0),Vl=new Cl(b.INSERTED,null,"","","",0,"",""),Yl=new Cl(b.REMOVED,null,"","","",0,"",""),ql=new gl(b.DESTROY),Zs=(t(c,Gl=bl),Object.defineProperty(c.prototype,"className",{get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"classList",{get:function(){return this.className.split(" ").filter(function(t){return""!==t})},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"tagName",{get:function(){return this.nodeName},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"parentElement",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"nextSibling",{get:function(){var t;return this.parentNode&&(t=this.parentNode.childNodes.indexOf(this),this.parentNode.childNodes[t+1])||null},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"previousSibling",{get:function(){var t;return this.parentNode&&(t=this.parentNode.childNodes.indexOf(this),this.parentNode.childNodes[t-1])||null},enumerable:!1,configurable:!0}),c.prototype.cloneNode=function(t){throw new Error(Hr)},c.prototype.appendChild=function(t,e){if(t.destroyed)throw new Error("Cannot append a destroyed element.");return E.sceneGraphService.attach(t,this,e),null!=(e=this.ownerDocument)&&e.defaultView&&this.ownerDocument.defaultView.mountChildren(t),Vl.relatedNode=this,t.dispatchEvent(Vl),t},c.prototype.insertBefore=function(t,e){return e?(e=this.childNodes.indexOf(e),this.appendChild(t,e-1)):this.appendChild(t),t},c.prototype.replaceChild=function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},c.prototype.removeChild=function(t){var e;return Yl.relatedNode=this,t.dispatchEvent(Yl),null!=(e=t.ownerDocument)&&e.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),E.sceneGraphService.detach(t),t},c.prototype.removeChildren=function(){for(var t=this.childNodes.length-1;0<=t;t--){var e=this.childNodes[t];this.removeChild(e)}},c.prototype.destroyChildren=function(){for(var t=this.childNodes.length-1;0<=t;t--){var e=this.childNodes[t];e.childNodes.length&&e.destroyChildren(),e.destroy()}},c.prototype.matches=function(t){return E.sceneGraphService.matches(t,this)},c.prototype.getElementById=function(t){return E.sceneGraphService.querySelector("#".concat(t),this)},c.prototype.getElementsByName=function(t){return E.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)},c.prototype.getElementsByClassName=function(t){return E.sceneGraphService.querySelectorAll(".".concat(t),this)},c.prototype.getElementsByTagName=function(t){return E.sceneGraphService.querySelectorAll(t,this)},c.prototype.querySelector=function(t){return E.sceneGraphService.querySelector(t,this)},c.prototype.querySelectorAll=function(t){return E.sceneGraphService.querySelectorAll(t,this)},c.prototype.closest=function(t){var e=this;do{if(E.sceneGraphService.matches(t,e))return e}while(null!==(e=e.parentElement));return null},c.prototype.find=function(e){var n=this,r=null;return this.forEach(function(t){return!(t===n||!e(t)||(r=t,0))}),r},c.prototype.findAll=function(e){var n=this,r=[];return this.forEach(function(t){t!==n&&e(t)&&r.push(t)}),r},c.prototype.after=function(){for(var r,i=this,t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.parentNode&&(r=this.parentNode.childNodes.indexOf(this),t.forEach(function(t,e){var n;return null==(n=i.parentNode)?void 0:n.appendChild(t,r+e+1)}))},c.prototype.before=function(){for(var t,e,n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];this.parentNode&&(t=this.parentNode.childNodes.indexOf(this),e=(n=j(r))[0],n=n.slice(1),this.parentNode.appendChild(e,t),e.after.apply(e,O([],j(n),!1)))},c.prototype.replaceWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.after.apply(this,O([],j(t),!1)),this.remove()},c.prototype.append=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];t.forEach(function(t){return e.appendChild(t)})},c.prototype.prepend=function(){for(var n=this,t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];t.forEach(function(t,e){return n.appendChild(t,e)})},c.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,O([],j(t),!1))},c.prototype.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},c.prototype.destroy=function(){this.dispatchEvent(ql),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},c.prototype.getGeometryBounds=function(){return E.sceneGraphService.getGeometryBounds(this)},c.prototype.getRenderBounds=function(){return E.sceneGraphService.getBounds(this,!0)},c.prototype.getBounds=function(){return E.sceneGraphService.getBounds(this)},c.prototype.getLocalBounds=function(){return E.sceneGraphService.getLocalBounds(this)},c.prototype.getBoundingClientRect=function(){return E.sceneGraphService.getBoundingClientRect(this)},c.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},c.prototype.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},c.prototype.getAttributeNames=function(){return Object.keys(this.attributes)},c.prototype.getAttribute=function(t){var e;return"symbol"==typeof t?E.enableCSSParsing?null:void 0:void 0===(e=this.attributes[t])&&(t=bi(t),e=this.attributes[t],E.enableCSSParsing)&&P(e)?null:e},c.prototype.hasAttribute=function(t){return this.getAttributeNames().includes(t)},c.prototype.hasAttributes=function(){return!!this.getAttributeNames().length},c.prototype.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},c.prototype.setAttribute=function(t,e,n){this.attributes[t]=e},c.prototype.getAttributeNS=function(t,e){throw new Error(Hr)},c.prototype.getAttributeNode=function(t){throw new Error(Hr)},c.prototype.getAttributeNodeNS=function(t,e){throw new Error(Hr)},c.prototype.hasAttributeNS=function(t,e){throw new Error(Hr)},c.prototype.removeAttributeNS=function(t,e){throw new Error(Hr)},c.prototype.removeAttributeNode=function(t){throw new Error(Hr)},c.prototype.setAttributeNS=function(t,e,n){throw new Error(Hr)},c.prototype.setAttributeNode=function(t){throw new Error(Hr)},c.prototype.setAttributeNodeNS=function(t){throw new Error(Hr)},c.prototype.toggleAttribute=function(t,e){throw new Error(Hr)},c);function c(){var t=null!==Gl&&Gl.apply(this,arguments)||this;return t.entity=Hl++,t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},t.cullable={strategy:_i.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},t.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},t.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},t.geometry={contentBounds:void 0,renderBounds:void 0},t.rBushNode={aabb:void 0},t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.destroyed=!1,t.style={},t.computedStyle=E.enableCSSParsing?{anchor:Pi,opacity:Pi,fillOpacity:Pi,strokeOpacity:Pi,fill:Pi,stroke:Pi,transform:Pi,transformOrigin:Pi,visibility:Pi,pointerEvents:Pi,lineWidth:Pi,lineCap:Pi,lineJoin:Pi,increasedLineWidthForHitTesting:Pi,fontSize:Pi,fontFamily:Pi,fontStyle:Pi,fontWeight:Pi,fontVariant:Pi,textAlign:Pi,textBaseline:Pi,textTransform:Pi,zIndex:Pi,filter:Pi,shadowType:Pi}:null,t.parsedStyle={},t.attributes={},t}function $l(t){return null!=t&&t.nodeName}var Ul,Xl=new Cl(b.ATTR_MODIFIED,null,null,null,null,Cl.MODIFICATION,null,null),Kl={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:""},Zl={anchor:[0,0],fill:Li,stroke:Li,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},Ql=m(m({},Zl),{opacity:1,fillOpacity:1,strokeOpacity:1,visibility:"visible",pointerEvents:"auto",lineWidth:1,lineCap:"butt",lineJoin:"miter",increasedLineWidthForHitTesting:0,fillRule:"nonzero"}),Jl=O(O([],j(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"]),!1),["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],!1),tc=(t(u,Ul=Zs),u.prototype.destroy=function(){Ul.prototype.destroy.call(this),this.getAnimations().forEach(function(t){t.cancel()})},u.prototype.cloneNode=function(e,t){var n,r=m({},this.attributes);for(n in r){var i=r[n];$l(i)&&"clipPath"!==n&&"offsetPath"!==n&&"textPath"!==n&&(r[n]=i.cloneNode(e)),t&&(r[n]=t(n,i))}var a=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:r});return a.setLocalTransform(this.getLocalTransform()),e&&this.children.forEach(function(t){t.style.isMarker||(t=t.cloneNode(e),a.appendChild(t))}),a},u.prototype.initAttributes=function(t){void 0===t&&(t={});var e,n=this.renderable,r={forceUpdateGeometry:!0},i=(E.enableCSSParsing&&(r.usedAttributes=Jl),{});for(e in t)i[bi(e)]=t[e];E.styleValueRegistry.processProperties(this,i,r),n.dirty=!0},u.prototype.setAttribute=function(t,e,n){void 0===n&&(n=!1);t=bi(t);Ke(e)||!n&&e===this.attributes[t]||(this.internalSetAttribute(t,e),Ul.prototype.setAttribute.call(this,t,e))},u.prototype.internalSetAttribute=function(t,e,n){void 0===n&&(n={});var r=this.renderable,i=this.attributes[t],a=this.parsedStyle[t],o=(E.styleValueRegistry.processProperties(this,((o={})[t]=e,o),n),r.dirty=!0,this.parsedStyle[t]);this.isConnected&&(Xl.relatedNode=this,Xl.prevValue=i,Xl.newValue=e,Xl.attrName=t,Xl.prevParsedValue=a,Xl.newParsedValue=o,this.isMutationObserved?this.dispatchEvent(Xl):(Xl.target=this).ownerDocument.defaultView.dispatchEvent(Xl,!0)),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,i,e,a,o)},u.prototype.getBBox=function(){var t=this.getBounds(),e=j(t.getMin(),2),n=e[0],e=e[1],t=j(t.getMax(),2),r=t[0],t=t[1];return new Dr(n,e,r-n,t-e)},u.prototype.setOrigin=function(t,e,n){return E.sceneGraphService.setOrigin(this,mr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},u.prototype.getOrigin=function(){return E.sceneGraphService.getOrigin(this)},u.prototype.setPosition=function(t,e,n){return E.sceneGraphService.setPosition(this,mr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},u.prototype.setLocalPosition=function(t,e,n){return E.sceneGraphService.setLocalPosition(this,mr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},u.prototype.translate=function(t,e,n){return E.sceneGraphService.translate(this,mr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},u.prototype.translateLocal=function(t,e,n){return E.sceneGraphService.translateLocal(this,mr(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},u.prototype.getPosition=function(){return E.sceneGraphService.getPosition(this)},u.prototype.getLocalPosition=function(){return E.sceneGraphService.getLocalPosition(this)},u.prototype.scale=function(t,e,n){return this.scaleLocal(t,e,n)},u.prototype.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=mr(t,e=e||t,n=n||t)),E.sceneGraphService.scaleLocal(this,t),this},u.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=mr(t,e=e||t,n=n||t)),E.sceneGraphService.setLocalScale(this,t),this},u.prototype.getLocalScale=function(){return E.sceneGraphService.getLocalScale(this)},u.prototype.getScale=function(){return E.sceneGraphService.getScale(this)},u.prototype.getEulerAngles=function(){return br(j(xr(v(),E.sceneGraphService.getWorldTransform(this)),3)[2])},u.prototype.getLocalEulerAngles=function(){return br(j(xr(v(),E.sceneGraphService.getLocalRotation(this)),3)[2])},u.prototype.setEulerAngles=function(t){return E.sceneGraphService.setEulerAngles(this,0,0,t),this},u.prototype.setLocalEulerAngles=function(t){return E.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},u.prototype.rotateLocal=function(t,e,n){return P(e)&&P(n)?E.sceneGraphService.rotateLocal(this,0,0,t):E.sceneGraphService.rotateLocal(this,t,e,n),this},u.prototype.rotate=function(t,e,n){return P(e)&&P(n)?E.sceneGraphService.rotate(this,0,0,t):E.sceneGraphService.rotate(this,t,e,n),this},u.prototype.setRotation=function(t,e,n,r){return E.sceneGraphService.setRotation(this,t,e,n,r),this},u.prototype.setLocalRotation=function(t,e,n,r){return E.sceneGraphService.setLocalRotation(this,t,e,n,r),this},u.prototype.setLocalSkew=function(t,e){return E.sceneGraphService.setLocalSkew(this,t,e),this},u.prototype.getRotation=function(){return E.sceneGraphService.getRotation(this)},u.prototype.getLocalRotation=function(){return E.sceneGraphService.getLocalRotation(this)},u.prototype.getLocalSkew=function(){return E.sceneGraphService.getLocalSkew(this)},u.prototype.getLocalTransform=function(){return E.sceneGraphService.getLocalTransform(this)},u.prototype.getWorldTransform=function(){return E.sceneGraphService.getWorldTransform(this)},u.prototype.setLocalTransform=function(t){return E.sceneGraphService.setLocalTransform(this,t),this},u.prototype.resetLocalTransform=function(){E.sceneGraphService.resetLocalTransform(this)},u.prototype.getAnimations=function(){return this.activeAnimations},u.prototype.animate=function(t,e){var n=null==(n=this.ownerDocument)?void 0:n.timeline;return n?n.play(this,t,e):null},u.prototype.isVisible=function(){var t;return"visible"===(null==(t=this.parsedStyle)?void 0:t.visibility)},Object.defineProperty(u.prototype,"interactive",{get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"},enumerable:!1,configurable:!0}),u.prototype.isInteractive=function(){var t;return"none"!==(null==(t=this.parsedStyle)?void 0:t.pointerEvents)},u.prototype.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},u.prototype.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,O([],j(this.parentNode.children.map(function(t){return Number(t.style.zIndex)})),!1))+1),this},u.prototype.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,O([],j(this.parentNode.children.map(function(t){return Number(t.style.zIndex)})),!1))-1),this},u.prototype.getConfig=function(){return this.config},u.prototype.attr=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=j(t,2),i=r[0],r=r[1];return i?je(i)?(Object.keys(i).forEach(function(t){e.setAttribute(t,i[t])}),this):2===t.length?(this.setAttribute(i,r),this):this.attributes[i]:this.attributes},u.prototype.getMatrix=function(t){var t=t||this.getWorldTransform(),e=j(mt(v(),t),2),n=e[0],e=e[1],r=j(vt(v(),t),2),i=r[0],r=r[1],t=bt(Ut(),t),t=j(xr(v(),t),3),a=t[0],t=t[2];return wr(a||t,n,e,i,r)},u.prototype.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},u.prototype.setMatrix=function(t){var t=j(Mr(t),5),e=t[0],n=t[1],r=t[2],i=t[3],t=t[4];this.setEulerAngles(t).setPosition(e,n).setLocalScale(r,i)},u.prototype.setLocalMatrix=function(t){var t=j(Mr(t),5),e=t[0],n=t[1],r=t[2],i=t[3],t=t[4];this.setLocalEulerAngles(t).setLocalPosition(e,n).setLocalScale(r,i)},u.prototype.show=function(){E.enableCSSParsing?this.style.visibility="visible":this.forEach(function(t){t.style.visibility="visible"})},u.prototype.hide=function(){E.enableCSSParsing?this.style.visibility="hidden":this.forEach(function(t){t.style.visibility="hidden"})},u.prototype.getCount=function(){return this.childElementCount},u.prototype.getParent=function(){return this.parentElement},u.prototype.getChildren=function(){return this.children},u.prototype.getFirst=function(){return this.firstElementChild},u.prototype.getLast=function(){return this.lastElementChild},u.prototype.getChildByIndex=function(t){return this.children[t]||null},u.prototype.add=function(t,e){return this.appendChild(t,e)},u.prototype.setClip=function(t){this.style.clipPath=t},u.prototype.set=function(t,e){this.config[t]=e},u.prototype.get=function(t){return this.config[t]},u.prototype.moveTo=function(t,e,n){return this.setPosition(t,e=void 0===e?0:e,n=void 0===n?0:n),this},u.prototype.move=function(t,e,n){return this.setPosition(t,e=void 0===e?0:e,n=void 0===n?0:n),this},u.prototype.setZIndex=function(t){return this.style.zIndex=t,this},u);function u(t){var r=this,t=((r=Ul.call(this)||this).isCustomElement=!1,r.isMutationObserved=!1,r.activeAnimations=[],r.getClip=function(){return this.style.clipPath||null},r.config=t,r.config.interactive=null!=(t=r.config.capture)?t: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||k.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,E.enableCSSParsing?Zl:Ql,r.config.initialParsedStyle),E.enableCSSParsing&&Object.assign(r.attributes,Kl),r.initAttributes(r.config.style),E.globalThis.Proxy||function(){});return E.enableDataset&&(r.dataset=new t({},{get:function(t,e){e="".concat("data-").concat(fi(e));return void 0!==t[e]?t[e]:r.getAttribute(e)},set:function(t,e,n){return r.setAttribute("".concat("data-").concat(fi(e)),n),!0}})),E.enableStyleSyntax&&(r.style=new t({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}var ec,nc=function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,t=t.syntax;E.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:t})},rc=(t(ic,ec=tc),ic);function ic(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return ec.call(this,m({type:k.CIRCLE,style:E.enableCSSParsing?m({cx:"",cy:"",r:""},e):m({},e),initialParsedStyle:{anchor:[.5,.5],transformOrigin:E.enableCSSParsing?null:[Ii,Ii]}},t))||this}t(sc,ac=tc);var ac,oc=sc;function sc(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]);return(e=ac.call(this,m({style:E.enableCSSParsing?m({x:"",y:""},n):m({},n)},t))||this).isCustomElement=!0,e}t(uc,lc=tc);var lc,cc=uc;function uc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return lc.call(this,m({type:k.ELLIPSE,style:E.enableCSSParsing?m({cx:"",cy:"",rx:"",ry:""},e):m({},e),initialParsedStyle:{anchor:[.5,.5],transformOrigin:E.enableCSSParsing?null:[Ii,Ii]}},t))||this}t(dc,hc=tc);var hc,fc=dc;function dc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return hc.call(this,m({type:k.GROUP,style:E.enableCSSParsing?m({x:"",y:"",width:"",height:""},e):m({},e)},t))||this}t(yc,pc=tc),yc.prototype.getDomElement=function(){return this.parsedStyle.$el},yc.prototype.getBoundingClientRect=function(){var t,e,n,r;return this.parsedStyle.$el?this.parsedStyle.$el.getBoundingClientRect():(t=(r=this.parsedStyle).x,e=r.y,n=r.width,r=r.height,new Dr(t,e,n,r))},yc.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},yc.prototype.getBounds=function(){var t=this.getBoundingClientRect(),e=null==(e=null==(e=this.ownerDocument)?void 0:e.defaultView)?void 0:e.getContextService().getBoundingClientRect(),n=new Tr,r=t.left-((null==e?void 0:e.left)||0),e=t.top-((null==e?void 0:e.top)||0);return n.setMinMax([r,e,0],[r+t.width,e+t.height,0]),n},yc.prototype.getLocalBounds=function(){if(this.parentNode){var t,e=rt(Z(),this.parentNode.getWorldTransform()),n=this.getBounds();if(!Tr.isEmpty(n))return(t=new Tr).setFromTransformedAABB(n,e),t}return this.getBounds()};var pc,gc=yc;function yc(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]);return(e=pc.call(this,m({type:k.HTML,style:E.enableCSSParsing?m({x:"",y:"",width:"auto",height:"auto",innerHTML:""},n):m({},n)},t))||this).cullable.enable=!1,e}t(bc,mc=tc);var mc,vc=bc;function bc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return mc.call(this,m({type:k.IMAGE,style:E.enableCSSParsing?m({x:"",y:"",img:"",width:"",height:""},e):m({},e)},t))||this}t(Mc,xc=tc),Mc.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&&$l(r)&&(this.markerStartAngle=0,r.remove()),i&&$l(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&$l(r)&&(this.markerEndAngle=0,r.remove()),i)&&$l(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))},Mc.prototype.transformMarker=function(t){var e,n,r,i,a,o=this.parsedStyle,s=o.markerStart,l=o.markerEnd,c=o.markerStartOffset,u=o.markerEndOffset,h=o.x1,f=o.x2,d=o.y1,p=o.y2,g=o.defX,o=o.defY,s=t?s:l;s&&$l(s)&&(l=0,t=t?(r=h-g,i=d-o,e=f-h,n=p-d,a=c||0,this.markerStartAngle):(r=f-g,i=p-o,e=h-f,n=d-p,a=u||0,this.markerEndAngle),l=Math.atan2(n,e),s.setLocalEulerAngles(180*l/Math.PI+t),s.setLocalPosition(r+Math.cos(l)*a,i+Math.sin(l)*a))},Mc.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.x1,i=n.y1,a=n.x2,o=n.y2,s=n.defX,n=n.defY,r=Fn(r,i,a,o,t),i=r.x,a=r.y,o=Wt(v(),Ct(i-s,a-n,0),e?this.getWorldTransform():this.getLocalTransform());return new Ir(o[0],o[1])},Mc.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},Mc.prototype.getTotalLength=function(){var t=this.parsedStyle;return Dn(t.x1,t.y1,t.x2,t.y2)};var xc,wc=Mc;function Mc(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]),n=((e=xc.call(this,m({type:k.LINE,style:m({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,isBillboard:!1},n)},t))||this).markerStartAngle=0,e.markerEndAngle=0,e.parsedStyle),t=n.markerStart,n=n.markerEnd;return t&&$l(t)&&(e.markerStartAngle=t.getLocalEulerAngles(),e.appendChild(t)),n&&$l(n)&&(e.markerEndAngle=n.getLocalEulerAngles(),e.appendChild(n)),e.transformMarker(!0),e.transformMarker(!1),e}t(Ec,Oc=tc),Ec.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&&$l(r)&&(this.markerStartAngle=0,r.remove()),i&&$l(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&$l(r)&&(this.markerEndAngle=0,r.remove()),i&&$l(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},Ec.prototype.transformMarker=function(t){var e,n,r,i,a,o,s,l=this.parsedStyle,c=l.markerStart,u=l.markerEnd,h=l.markerStartOffset,f=l.markerEndOffset,d=l.defX,l=l.defY,c=t?c:u;c&&$l(c)&&(u=0,h=t?(o=(t=j(this.getStartTangent(),2))[0],e=(s=t[1])[0]-d,n=s[1]-l,r=o[0]-s[0],i=o[1]-s[1],a=h||0,this.markerStartAngle):(o=(t=j(this.getEndTangent(),2))[0],e=(s=t[1])[0]-d,n=s[1]-l,r=o[0]-s[0],i=o[1]-s[1],a=f||0,this.markerEndAngle),u=Math.atan2(i,r),c.setLocalEulerAngles(180*u/Math.PI+h),c.setLocalPosition(e+Math.cos(u)*a,n+Math.sin(u)*a))},Ec.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&&$l(t))for(var a=1;a<n.length-1;a++){var o=j(n[a].currentPoint,2),s=o[0],o=o[1],l=1===a?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(s-r,o-i)}},Ec.prototype.getTotalLength=function(){return ja(this)},Ec.prototype.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,n=Se(n.path.absolutePath,t,m(m({},a),{bbox:!1,length:!0})).point,t=n.x,a=n.y,n=Wt(v(),Ct(t-r,a-i,0),e?this.getWorldTransform():this.getLocalTransform());return new Ir(n[0],n[1])},Ec.prototype.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*ja(this),e)},Ec.prototype.getStartTangent=function(){var t,e,n=this.parsedStyle.path.segments,r=[];return 1<n.length&&(t=n[0].currentPoint,e=n[1].currentPoint,r=[],(n=n[1].startTangent)?r.push([t[0]-n[0],t[1]-n[1]]):r.push([e[0],e[1]]),r.push([t[0],t[1]])),r},Ec.prototype.getEndTangent=function(){var t,e,n=this.parsedStyle.path.segments,r=n.length,i=[];return 1<r&&(t=n[r-2].currentPoint,e=n[r-1].currentPoint,i=[],(n=n[r-1].endTangent)?i.push([e[0]-n[0],e[1]-n[1]]):i.push([t[0],t[1]]),i.push([e[0],e[1]])),i};var Oc,kc=Ec;function Ec(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]),n=((e=Oc.call(this,m({type:k.PATH,style:E.enableCSSParsing?m({path:"",miterLimit:""},n):m({},n),initialParsedStyle:E.enableCSSParsing?null:{miterLimit:4,path:m({},Bi)}},t))||this).markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[],e.parsedStyle),t=n.markerStart,r=n.markerEnd,n=n.markerMid;return t&&$l(t)&&(e.markerStartAngle=t.getLocalEulerAngles(),e.appendChild(t)),n&&$l(n)&&e.placeMarkerMid(n),r&&$l(r)&&(e.markerEndAngle=r.getLocalEulerAngles(),e.appendChild(r)),e.transformMarker(!0),e.transformMarker(!1),e}t(_c,Sc=tc),_c.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&&$l(r)&&(this.markerStartAngle=0,r.remove()),i&&$l(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&$l(r)&&(this.markerEndAngle=0,r.remove()),i&&$l(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},_c.prototype.transformMarker=function(t){var e,n,r,i,a,o=this.parsedStyle,s=o.markerStart,l=o.markerEnd,c=o.markerStartOffset,u=o.markerEndOffset,h=o.points.points,f=o.defX,o=o.defY,s=t?s:l;s&&$l(s)&&(i=h[l=0][0]-f,a=h[0][1]-o,c=t?(e=h[1][0]-h[0][0],n=h[1][1]-h[0][1],r=c||0,this.markerStartAngle):(t=h.length,n=this.parsedStyle.isClosed?(e=h[t-1][0]-h[0][0],h[t-1][1]-h[0][1]):(i=h[t-1][0]-f,a=h[t-1][1]-o,e=h[t-2][0]-h[t-1][0],h[t-2][1]-h[t-1][1]),r=u||0,this.markerEndAngle),l=Math.atan2(n,e),s.setLocalEulerAngles(180*l/Math.PI+c),s.setLocalPosition(i+Math.cos(l)*r,a+Math.sin(l)*r))},_c.prototype.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.points.points,r=e.defX,i=e.defY;if(this.markerMidList.forEach(function(t){t.remove()}),this.markerMidList=[],t&&$l(t))for(var a=1;a<(this.parsedStyle.isClosed?n.length:n.length-1);a++){var o=n[a][0]-r,s=n[a][1]-i,l=1===a?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(o,s)}};var Sc,Ac=_c;function _c(t){var e=this,n=(t=void 0===t?{}:t).style,t=at(t,["style"]),n=((e=Sc.call(this,m({type:k.POLYGON,style:E.enableCSSParsing?m({points:"",miterLimit:"",isClosed:!0},n):m({},n),initialParsedStyle:E.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},t))||this).markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[],e.parsedStyle),t=n.markerStart,r=n.markerEnd,n=n.markerMid;return t&&$l(t)&&(e.markerStartAngle=t.getLocalEulerAngles(),e.appendChild(t)),n&&$l(n)&&e.placeMarkerMid(n),r&&$l(r)&&(e.markerEndAngle=r.getLocalEulerAngles(),e.appendChild(r)),e.transformMarker(!0),e.transformMarker(!1),e}t(Cc,Tc=Ac),Cc.prototype.getTotalLength=function(){return this.parsedStyle.points.totalLength},Cc.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},Cc.prototype.getPoint=function(n,t){void 0===t&&(t=!1);var e=this.parsedStyle,r=e.defX,i=e.defY,e=e.points,a=e.points,e=e.segments,o=0,s=0,e=(e.forEach(function(t,e){n>=t[0]&&n<=t[1]&&(o=(n-t[0])/(t[1]-t[0]),s=e)}),Fn(a[s][0],a[s][1],a[s+1][0],a[s+1][1],o)),a=e.x,e=e.y,a=Wt(v(),Ct(a-r,e-i,0),t?this.getWorldTransform():this.getLocalTransform());return new Ir(a[0],a[1])},Cc.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},Cc.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};var Tc,Pc=Cc;function Cc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return Tc.call(this,m({type:k.POLYLINE,style:E.enableCSSParsing?m({points:"",miterLimit:"",isClosed:!1},e):m({},e),initialParsedStyle:E.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},t))||this}t(jc,Lc=tc);var Lc,Nc=jc;function jc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return Lc.call(this,m({type:k.RECT,style:E.enableCSSParsing?m({x:"",y:"",width:"",height:"",radius:""},e):m({},e)},t))||this}t(Bc,Rc=tc),Bc.prototype.getComputedTextLength=function(){var t;return(null==(t=this.parsedStyle.metrics)?void 0:t.maxLineWidth)||0},Bc.prototype.getLineBoundingRects=function(){var t;return(null==(t=this.parsedStyle.metrics)?void 0:t.lineMetrics)||[]},Bc.prototype.isOverflowing=function(){return!!this.parsedStyle.isOverflowing};var Rc,Ic=Bc;function Bc(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return Rc.call(this,m({type:k.TEXT,style:E.enableCSSParsing?m({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""},e):m({fill:"black"},e),initialParsedStyle:E.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}},t))||this}Fc.prototype.define=function(t,e){this.registry[t]=e},Fc.prototype.get=function(t){return this.registry[t]};var Dc=Fc;function Fc(){this.registry={},this.define(k.CIRCLE,rc),this.define(k.ELLIPSE,cc),this.define(k.RECT,Nc),this.define(k.IMAGE,vc),this.define(k.LINE,wc),this.define(k.GROUP,fc),this.define(k.PATH,kc),this.define(k.POLYGON,Ac),this.define(k.POLYLINE,Pc),this.define(k.TEXT,Ic),this.define(k.HTML,gc)}t(Gc,zc=bl),Object.defineProperty(Gc.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(Gc.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(Gc.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(Gc.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Gc.prototype.createElement=function(t,e){var n;return"svg"===t?this.documentElement:((n=this.defaultView.customElements.get(t))||(console.warn("Unsupported tagName: ",t),n="tspan"===t?Ic:fc),(t=new n(e)).ownerDocument=this,t)},Gc.prototype.createElementNS=function(t,e,n){return this.createElement(e,n)},Gc.prototype.cloneNode=function(t){throw new Error(Hr)},Gc.prototype.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}},Gc.prototype.elementsFromBBox=function(t,e,n,r){var t=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),i=[];return t.forEach(function(t){var t=t.displayObject,e=t.parsedStyle.pointerEvents,e=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(e);e&&!t.isVisible()||t.isCulled()||!t.isInteractive()||i.push(t)}),i.sort(function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder}),i},Gc.prototype.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,n=n.y,i=this.defaultView.getConfig(),a=i.width,i=i.height;return r<0||n<0||a<r||i<n?null:(i=(a=this.defaultView.viewport2Client({x:r,y:n})).x,a=a.y,(t=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:n,clientX:i,clientY:a},picked:[]}).picked)&&t[0]||this.documentElement)},Gc.prototype.elementFromPoint=function(a,o){return X(this,void 0,void 0,function(){var e,n,r,i;return R(this,function(t){switch(t.label){case 0:return(e=this.defaultView.canvas2Viewport({x:a,y:o}),i=e.x,e=e.y,n=this.defaultView.getConfig(),r=n.width,n=n.height,i<0||e<0||r<i||n<e)?[2,null]:(r=this.defaultView.viewport2Client({x:i,y:e}),n=r.x,r=r.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:a,y:o,viewportX:i,viewportY:e,clientX:n,clientY:r},picked:[]})]);case 1:return[2,(i=t.sent().picked)&&i[0]||this.documentElement]}})})},Gc.prototype.elementsFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,n=n.y,i=this.defaultView.getConfig(),a=i.width,i=i.height;return r<0||n<0||a<r||i<n?[]:(i=(a=this.defaultView.viewport2Client({x:r,y:n})).x,a=a.y,(t=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:n,clientX:i,clientY:a},picked:[]}).picked)[t.length-1]!==this.documentElement&&t.push(this.documentElement),t)},Gc.prototype.elementsFromPoint=function(a,o){return X(this,void 0,void 0,function(){var e,n,r,i;return R(this,function(t){switch(t.label){case 0:return(e=this.defaultView.canvas2Viewport({x:a,y:o}),i=e.x,e=e.y,n=this.defaultView.getConfig(),r=n.width,n=n.height,i<0||e<0||r<i||n<e)?[2,[]]:(r=this.defaultView.viewport2Client({x:i,y:e}),n=r.x,r=r.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:a,y:o,viewportX:i,viewportY:e,clientX:n,clientY:r},picked:[]})]);case 1:return(i=t.sent().picked)[i.length-1]!==this.documentElement&&i.push(this.documentElement),[2,i]}})})},Gc.prototype.appendChild=function(t,e){throw new Error(Vr)},Gc.prototype.insertBefore=function(t,e){throw new Error(Vr)},Gc.prototype.removeChild=function(t,e){throw new Error(Vr)},Gc.prototype.replaceChild=function(t,e,n){throw new Error(Vr)},Gc.prototype.append=function(){throw new Error(Vr)},Gc.prototype.prepend=function(){throw new Error(Vr)},Gc.prototype.getElementById=function(t){return this.documentElement.getElementById(t)},Gc.prototype.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},Gc.prototype.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},Gc.prototype.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},Gc.prototype.querySelector=function(t){return this.documentElement.querySelector(t)},Gc.prototype.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},Gc.prototype.find=function(t){return this.documentElement.find(t)},Gc.prototype.findAll=function(t){return this.documentElement.findAll(t)};var zc,Wc=Gc;function Gc(){var t=zc.call(this)||this;t.defaultView=null,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new E.AnimationTimeline(t)}catch(t){}var r={};return bo.forEach(function(t){var e=t.n,n=t.inh,t=t.d;n&&t&&(r[e]=pi(t)?t(k.GROUP):t)}),t.documentElement=new fc({id:"g-root",style:r}),((t.documentElement.ownerDocument=t).documentElement.parentNode=t).childNodes=[t.documentElement],t}Vc.prototype.apply=function(t){var n=t.camera,e=t.renderingService,r=t.renderingContext,i=this.strategies;e.hooks.cull.tap(Vc.tag,function(e){var t;return e&&(t=e.cullable,0===i.length?t.visible=-1<r.unculledEntities.indexOf(e.entity):t.visible=i.every(function(t){return t.isVisible(n,e)}),!e.isCulled()&&e.isVisible()?e:(e.dispatchEvent(new gl(b.CULLED)),null))}),e.hooks.afterRender.tap(Vc.tag,function(t){t.cullable.visibilityPlaneMask=-1})},Vc.tag="Culling";var Hc=Vc;function Vc(t){this.strategies=t}qc.prototype.apply=function(t){var e=t.renderingService;e.hooks.dirtycheck.tap(qc.tag,function(t){return t&&(t.renderable.dirty||e.disableDirtyRectangleRendering()?t:null)})},qc.tag="DirtyCheck";var Yc=qc;function qc(){}Uc.prototype.apply=function(t){var c=this,t=(this.context=t).renderingService,u=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(t){return c.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null}),t.hooks.pointerWheel.tap(Uc.tag,function(t){t=c.normalizeWheelEvent(t);c.context.eventService.mapEvent(t)}),t.hooks.pointerDown.tap(Uc.tag,function(t){var e,n;if(!u.supportsTouchEvents||"touch"!==t.pointerType){var r=c.normalizeToPointerEvent(t,u);!c.autoPreventDefault||!r[0].isNormalized||!t.cancelable&&"cancelable"in t||t.preventDefault();try{for(var i=I(r),a=i.next();!a.done;a=i.next()){var o=a.value,s=c.bootstrapEvent(c.rootPointerEvent,o,u,t);c.context.eventService.mapEvent(s)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}c.setCursor(c.context.eventService.cursor)}}),t.hooks.pointerUp.tap(Uc.tag,function(t){var e,n;if(!u.supportsTouchEvents||"touch"!==t.pointerType){var r=c.context.contextService.getDomElement(),i="outside";try{i=r&&t.target&&t.target!==r&&r.contains&&!r.contains(t.target)?"outside":""}catch(t){}r=c.normalizeToPointerEvent(t,u);try{for(var a=I(r),o=a.next();!o.done;o=a.next()){var s=o.value,l=c.bootstrapEvent(c.rootPointerEvent,s,u,t);l.type+=i,c.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}c.setCursor(c.context.eventService.cursor)}}),t.hooks.pointerMove.tap(Uc.tag,this.onPointerMove),t.hooks.pointerOver.tap(Uc.tag,this.onPointerMove),t.hooks.pointerOut.tap(Uc.tag,this.onPointerMove),t.hooks.click.tap(Uc.tag,this.onClick),t.hooks.pointerCancel.tap(Uc.tag,function(t){var e,n,r=c.normalizeToPointerEvent(t,u);try{for(var i=I(r),a=i.next();!a.done;a=i.next()){var o=a.value,s=c.bootstrapEvent(c.rootPointerEvent,o,u,t);c.context.eventService.mapEvent(s)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}c.setCursor(c.context.eventService.cursor)})},Uc.prototype.getViewportXY=function(t){var e,n=t.offsetX,r=t.offsetY,i=t.clientX,t=t.clientY;return t=!this.context.config.supportsCSSTransform||P(n)||P(r)?(e=(i=this.context.eventService.client2Viewport(new Ir(i,t))).x,i.y):(e=n,r),{x:e,y:t}},Uc.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 e=(n=this.getViewportXY(e)).x,n=n.y,n=(t.viewport.x=e,t.viewport.y=n,(e=this.context.eventService.viewport2Canvas(t.viewport)).x),e=e.y;return t.canvas.x=n,t.canvas.y=e,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=ds[t.type]||t.type),t},Uc.prototype.normalizeWheelEvent=function(t){var e=this.rootWheelEvent,n=(this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ,(r=this.getViewportXY(t)).x),r=r.y,r=(e.viewport.x=n,e.viewport.y=r,(n=this.context.eventService.viewport2Canvas(e.viewport)).x),n=n.y;return e.canvas.x=r,e.canvas.y=n,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},Uc.prototype.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=ps.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},Uc.prototype.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},Uc.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];Ke(i.button)&&(i.button=0),Ke(i.buttons)&&(i.buttons=1),Ke(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),Ke(i.width)&&(i.width=i.radiusX||1),Ke(i.height)&&(i.height=i.radiusY||1),Ke(i.tiltX)&&(i.tiltX=0),Ke(i.tiltY)&&(i.tiltY=0),Ke(i.pointerType)&&(i.pointerType="touch"),Ke(i.pointerId)&&(i.pointerId=i.identifier||0),Ke(i.pressure)&&(i.pressure=i.force||.5),Ke(i.twist)&&(i.twist=0),Ke(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else e.isMouseEvent(t)?(Ke((e=t).isPrimary)&&(e.isPrimary=!0),Ke(e.width)&&(e.width=1),Ke(e.height)&&(e.height=1),Ke(e.tiltX)&&(e.tiltX=0),Ke(e.tiltY)&&(e.tiltY=0),Ke(e.pointerType)&&(e.pointerType="mouse"),Ke(e.pointerId)&&(e.pointerId=1),Ke(e.pressure)&&(e.pressure=.5),Ke(e.twist)&&(e.twist=0),Ke(e.tangentialPressure)&&(e.tangentialPressure=0),e.isNormalized=!0,n.push(e)):n.push(t);return n},Uc.tag="Event";var $c=Uc;function Uc(){var c=this;this.autoPreventDefault=!1,this.rootPointerEvent=new cl(null),this.rootWheelEvent=new fl(null),this.onPointerMove=function(t){var e,n,r=null==(i=null==(i=c.context.renderingContext.root)?void 0:i.ownerDocument)?void 0:i.defaultView;if(!r.supportsTouchEvents||"touch"!==t.pointerType){var i=c.normalizeToPointerEvent(t,r);try{for(var a=I(i),o=a.next();!o.done;o=a.next()){var s=o.value,l=c.bootstrapEvent(c.rootPointerEvent,s,r,t);c.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}c.setCursor(c.context.eventService.cursor)}},this.onClick=function(t){var e,n,r=null==(i=null==(i=c.context.renderingContext.root)?void 0:i.ownerDocument)?void 0:i.defaultView,i=c.normalizeToPointerEvent(t,r);try{for(var a=I(i),o=a.next();!o.done;o=a.next()){var s=o.value,l=c.bootstrapEvent(c.rootPointerEvent,s,r,t);c.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}c.setCursor(c.context.eventService.cursor)}}var Xc=[k.CIRCLE,k.ELLIPSE,k.IMAGE,k.RECT,k.LINE,k.POLYLINE,k.POLYGON,k.TEXT,k.PATH,k.HTML],Kc=(Zc.prototype.isVisible=function(t,e){var n,r,i=e.cullable;return!i.enable||(n=e.getRenderBounds(),!Tr.isEmpty(n)&&(t=t.getFrustum(),r=null==(r=null==(r=e.parentNode)?void 0:r.cullable)?void 0:r.visibilityPlaneMask,i.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,n,r||Cr.INDETERMINATE,t.planes),i.visible=i.visibilityPlaneMask!==Cr.OUTSIDE,i.visible))},Zc.prototype.computeVisibilityWithPlaneMask=function(t,e,n,r){if(n===Cr.OUTSIDE||n===Cr.INSIDE)return n;for(var i=Cr.INSIDE,a=-1<Xc.indexOf(t.nodeName),o=0,s=r.length;o<s;++o){var l=1<<o;if(0!=(n&l)&&(!a||4!==o&&5!==o)){var c=r[o],u=c.normal,c=c.distance;if(Dt(u,e.getPositiveFarPoint(r[o]))+c<0)return Cr.OUTSIDE;Dt(u,e.getNegativeFarPoint(r[o]))+c<0&&(i|=l)}}return i},Zc);function Zc(){}tu.prototype.apply=function(t){function e(t){t.target.renderable.dirty=!0,o.dirtify()}function n(t){for(var e=t.detail.affectChildren,t=t.target,n=(e&&t.forEach(function(t){a.toSync.add(t)}),t);n;)n.renderable&&a.toSync.add(n),n=n.parentElement;o.dirtify()}function r(t){t=t.target,E.enableCSSParsing&&E.styleValueRegistry.recalc(t),E.sceneGraphService.dirtifyToRoot(t),o.dirtify()}function i(t){var e=(t=t.target).rBushNode;e.aabb&&a.rBush.remove(e.aabb),a.toSync.delete(t),E.sceneGraphService.dirtifyToRoot(t),o.dirtify()}var a=this,o=t.renderingService,s=t.renderingContext,t=t.rBushRoot,l=s.root.ownerDocument.defaultView;this.rBush=t;o.hooks.init.tap(tu.tag,function(){l.addEventListener(b.MOUNTED,r),l.addEventListener(b.UNMOUNTED,i),l.addEventListener(b.ATTR_MODIFIED,e),l.addEventListener(b.BOUNDS_CHANGED,n)}),o.hooks.destroy.tap(tu.tag,function(){l.removeEventListener(b.MOUNTED,r),l.removeEventListener(b.UNMOUNTED,i),l.removeEventListener(b.ATTR_MODIFIED,e),l.removeEventListener(b.BOUNDS_CHANGED,n),a.toSync.clear()}),o.hooks.endFrame.tap(tu.tag,function(){a.syncRTree()})},tu.prototype.syncRTree=function(){var o=this,s=[];Array.from(this.toSync).filter(function(t){return t.isConnected}).forEach(function(t){var e,n,r,i=t.rBushNode,a=(i&&i.aabb&&o.rBush.remove(i.aabb),t.getRenderBounds());a&&(e=(n=j(a.getMin(),2))[0],n=n[1],r=(a=j(a.getMax(),2))[0],a=a[1],i.aabb||(i.aabb={}),i.aabb.displayObject=t,i.aabb.minX=e,i.aabb.minY=n,i.aabb.maxX=r,i.aabb.maxY=a),!i.aabb||isNaN(i.aabb.maxX)||isNaN(i.aabb.maxX)||isNaN(i.aabb.minX)||isNaN(i.aabb.minY)||s.push(i.aabb)}),this.rBush.load(s),s.length=0,this.toSync.clear()},tu.tag="Prepare";var Qc,Jc=tu;function tu(){this.toSync=new Set}(Xs=Qc=Qc||{}).READY="ready",Xs.BEFORE_RENDER="beforerender",Xs.RERENDER="rerender",Xs.AFTER_RENDER="afterrender",Xs.BEFORE_DESTROY="beforedestroy",Xs.AFTER_DESTROY="afterdestroy",Xs.RESIZE="resize",Xs.DIRTY_RECTANGLE="dirtyrectangle",Xs.RENDERER_CHANGED="rendererchanged";var eu,nu=new gl(b.MOUNTED),ru=new gl(b.UNMOUNTED),iu=new gl(Qc.BEFORE_RENDER),au=new gl(Qc.RERENDER),ou=new gl(Qc.AFTER_RENDER),su=(t(lu,eu=ol),lu.prototype.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},lu.prototype.initDefaultCamera=function(t,e,n){var r=this,i=new E.CameraContribution;i.clipSpaceNearZ=n,i.setType(zr.EXPLORING,Wr.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(Ur,function(){r.context.renderingContext.renderReasons.add(Ml.CAMERA_CHANGED)}),this.context.camera=i},lu.prototype.getConfig=function(){return this.context.config},lu.prototype.getRoot=function(){return this.document.documentElement},lu.prototype.getCamera=function(){return this.context.camera},lu.prototype.getContextService=function(){return this.context.contextService},lu.prototype.getEventService=function(){return this.context.eventService},lu.prototype.getRenderingService=function(){return this.context.renderingService},lu.prototype.getRenderingContext=function(){return this.context.renderingContext},lu.prototype.getStats=function(){return this.getRenderingService().getStats()},Object.defineProperty(lu.prototype,"ready",{get:function(){var e=this;return this.readyPromise||(this.readyPromise=new Promise(function(t){e.resolveReadyPromise=function(){t(e)}}),this.inited&&this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),lu.prototype.destroy=function(t,e){void 0===t&&(t=!0),(e=void 0===e?!1:e)||this.dispatchEvent(new gl(Qc.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 gl(Qc.AFTER_DESTROY))},lu.prototype.changeSize=function(t,e){this.resize(t,e)},lu.prototype.resize=function(t,e){var n=this.context.config,n=(n.width=t,n.height=e,this.getContextService().resize(t,e),this.context.camera),r=n.getProjectionMode();n.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),r===Gr.ORTHOGRAPHIC?n.setOrthographic(t/-2,t/2,e/2,e/-2,n.getNear(),n.getFar()):n.setAspect(t/e),this.dispatchEvent(new gl(Qc.RESIZE,{width:t,height:e}))},lu.prototype.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},lu.prototype.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},lu.prototype.removeChild=function(t){return this.document.documentElement.removeChild(t)},lu.prototype.removeChildren=function(){this.document.documentElement.removeChildren()},lu.prototype.destroyChildren=function(){this.document.documentElement.destroyChildren()},lu.prototype.render=function(){var t=this;this.dispatchEvent(iu),this.getRenderingService().render(this.getConfig(),function(){t.dispatchEvent(au)}),this.dispatchEvent(ou)},lu.prototype.run=function(){function t(){e.render(),e.frameId=e.requestAnimationFrame(t)}var e=this;t()},lu.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 cr,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new $c,new Jc,new Yc,new Hc([new Kc])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(m(m({},E),this.context)),this.context.renderingService=new El(E,this.context),this.context.eventService=new xl(E,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)})},lu.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 gl(Qc.READY))}):r.dispatchEvent(new gl(Qc.READY)),r.readyPromise&&r.resolveReadyPromise()):r.dispatchEvent(new gl(Qc.RENDERER_CHANGED)),e||r.getRoot().forEach(function(t){t=t.renderable;t&&(t.renderBoundsDirty=!0,t.boundsDirty=!0,t.dirty=!0)}),r.mountChildren(r.getRoot()),t.getConfig().enableAutoRendering&&r.run()})},lu.prototype.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach(function(t){t.context=e.context,t.init(E)})},lu.prototype.setRenderer=function(t){var e,n=this.getConfig();n.renderer!==t&&(e=n.renderer,n.renderer=t,this.destroy(!1,!0),O([],j(null==e?void 0:e.getPlugins()),!1).reverse().forEach(function(t){t.destroy(E)}),this.initRenderer(t))},lu.prototype.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},lu.prototype.unmountChildren=function(t){var e=this;t.childNodes.forEach(function(t){e.unmountChildren(t)}),this.inited&&(t.isMutationObserved?t.dispatchEvent(ru):(ru.target=t,this.dispatchEvent(ru,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},lu.prototype.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(nu):(nu.target=t,this.dispatchEvent(nu,!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()},lu.prototype.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},lu.prototype.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},lu.prototype.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},lu.prototype.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},lu.prototype.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},lu.prototype.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},lu);function lu(t){var e=eu.call(this)||this,n=(e.Element=tc,e.inited=!1,e.context={},e.document=new Wc,(e.document.defaultView=e).customElements=new Dc,t.container),r=t.canvas,i=t.offscreenCanvas,a=t.width,o=t.height,s=t.devicePixelRatio,l=t.renderer,c=t.background,u=t.cursor,h=t.document,f=t.requestAnimationFrame,d=t.cancelAnimationFrame,p=t.createImage,g=t.supportsPointerEvents,y=t.supportsTouchEvents,m=t.supportsCSSTransform,v=t.supportsMutipleCanvasesInOneContainer,b=t.useNativeClickEvent,x=t.alwaysTriggerPointerEventOnCanvas,w=t.isTouchEvent,t=t.isMouseEvent,M=(!v&&(v=e,M=n)&&(M="string"==typeof M?M:M.id||ls++,ss[M]&&ss[M].destroy(),ss[M]=v),a),v=o,O=s;return r&&(O=1<=(O=s||cs&&window.devicePixelRatio||1)?Math.ceil(O):1,M=a||("auto"===(a=fs(s=r,"width"))?s.offsetWidth:parseFloat(a))||r.width/O,v=o||("auto"===(a=fs(s=r,"height"))?s.offsetHeight:parseFloat(a))||r.height/O),i&&(E.offscreenCanvas=i),e.devicePixelRatio=O,e.requestAnimationFrame=null!=f?f:As.bind(E.globalThis),e.cancelAnimationFrame=null!=d?d:_s.bind(E.globalThis),e.supportsTouchEvents=null!=y?y:"ontouchstart"in E.globalThis,e.supportsPointerEvents=null!=g?g:!!E.globalThis.PointerEvent,e.isTouchEvent=null!=w?w:function(t){return e.supportsTouchEvents&&t instanceof E.globalThis.TouchEvent},e.isMouseEvent=null!=t?t:function(t){return!E.globalThis.MouseEvent||t instanceof E.globalThis.MouseEvent&&(!e.supportsPointerEvents||!(t instanceof E.globalThis.PointerEvent))},e.initRenderingContext({container:n,canvas:r,width:M,height:v,renderer:l,offscreenCanvas:i,devicePixelRatio:O,cursor:u||"default",background:c||"transparent",createImage:p,document:h,supportsCSSTransform:m,useNativeClickEvent:b,alwaysTriggerPointerEventOnCanvas:x}),e.initDefaultCamera(M,v,l.clipSpaceNearZ),e.initRenderer(l,!0),e}t(hu,cu=n),hu.prototype.rotate=function(t,e,n){if(this.relElevation=yr(e),this.relAzimuth=yr(t),this.relRoll=yr(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===zr.EXPLORING){e=Xt(Ut(),[1,0,0],vr((this.rotateWorld?1:-1)*this.relElevation)),t=Xt(Ut(),[0,1,0],vr((this.rotateWorld?1:-1)*this.relAzimuth)),n=Xt(Ut(),[0,0,1],vr(this.relRoll)),t=Kt(Ut(),t,e),t=Kt(Ut(),t,n),e=wt(Z(),t);ut(this.matrix,this.matrix,[0,0,-this.distance]),ct(this.matrix,this.matrix,e),ut(this.matrix,this.matrix,[0,0,this.distance])}else{if(90<Math.abs(this.elevation))return this;this.computeMatrix()}return this._getAxes(),this.type===zr.ORBITING||this.type===zr.EXPLORING?this._getPosition():this.type===zr.TRACKING&&this._getFocalPoint(),this._update(),this},hu.prototype.pan=function(t,e){t=mr(t,e,0),e=Tt(this.position);return jt(e,e,It(v(),this.right,t[0])),jt(e,e,It(v(),this.up,t[1])),this._setPosition(e),this.triggerUpdate(),this},hu.prototype.dolly=function(t){var e=this.forward,n=Tt(this.position),t=(this.dollyingStep,this.distance+t*this.dollyingStep),t=Math.max(Math.min(t,this.maxDistance),this.minDistance)-this.distance;return n[0]+=t*e[0],n[1]+=t*e[1],n[2]+=t*e[2],this._setPosition(n),this.type===zr.ORBITING||this.type===zr.EXPLORING?this._getDistance():this.type===zr.TRACKING&&jt(this.focalPoint,n,this.distanceVector),this.triggerUpdate(),this},hu.prototype.cancelLandmarkAnimation=function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)},hu.prototype.createLandmark=function(t,e){var n,r=(e=void 0===e?{}:e).position,r=void 0===r?this.position:r,i=e.focalPoint,i=void 0===i?this.focalPoint:i,a=e.roll,e=e.zoom,o=new E.CameraContribution,r=(o.setType(this.type,void 0),o.setPosition(r[0],null!=(n=r[1])?n:this.position[1],null!=(n=r[2])?n:this.position[2]),o.setFocalPoint(i[0],null!=(r=i[1])?r:this.focalPoint[1],null!=(n=i[2])?n:this.focalPoint[2]),o.setRoll(null!=a?a:this.roll),o.setZoom(null!=e?e:this.zoom),{name:t,matrix:Q(o.getWorldTransform()),right:Tt(o.right),up:Tt(o.up),forward:Tt(o.forward),position:Tt(o.getPosition()),focalPoint:Tt(o.getFocalPoint()),distanceVector:Tt(o.getDistanceVector()),distance:o.getDistance(),dollyingStep:o.getDollyingStep(),azimuth:o.getAzimuth(),elevation:o.getElevation(),roll:o.getRoll(),relAzimuth:o.relAzimuth,relElevation:o.relElevation,relRoll:o.relRoll,zoom:o.getZoom()});return this.landmarks.push(r),r},hu.prototype.gotoLandmark=function(e,t){var n,o,r,i,s,l,c,u,h,f,d,p,g,y=this,a=(void 0===t&&(t={}),ze(e)?this.landmarks.find(function(t){return t.name===e}):e);a&&(n=void 0===(n=(t=Ge(t)?{duration:t}:t).easing)?"linear":n,r=t.duration,o=void 0===r?100:r,r=void 0===(r=t.easingFunction)?void 0:r,t=t.onfinish,i=void 0===t?void 0:t,s=.01,0===o?(this.syncFromLandmark(a),i&&i()):(this.cancelLandmarkAnimation(),l=a.position,c=a.focalPoint,u=a.zoom,h=a.roll,f=r||E.EasingFunction(n),p=function(){y.setFocalPoint(c),y.setPosition(l),y.setRoll(h),y.setZoom(u),y.computeMatrix(),y.triggerUpdate(),i&&i()},g=function(t){var e,n,r,i,a,t=t-(d=void 0===d?t:d);o<t||(e=f(t/o),n=v(),r=v(),i=1,a=0,zt(n,y.focalPoint,c,e),zt(r,y.position,l,e),a=y.roll*(1-e)+h*e,i=y.zoom*(1-e)+u*e,y.setFocalPoint(n),y.setPosition(r),y.setRoll(a),y.setZoom(i),Vt(n,c)+Vt(r,l)<=s&&null==u&&null==h)?p():(y.computeMatrix(),y.triggerUpdate(),t<o&&(y.landmarkAnimationID=y.canvas.requestAnimationFrame(g)))},this.canvas.requestAnimationFrame(g)))},hu.prototype.syncFromLandmark=function(t){this.matrix=J(this.matrix,t.matrix),this.right=Lt(this.right,t.right),this.up=Lt(this.up,t.up),this.forward=Lt(this.forward,t.forward),this.position=Lt(this.position,t.position),this.focalPoint=Lt(this.focalPoint,t.focalPoint),this.distanceVector=Lt(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};var cu,uu=hu;function hu(){var t=null!==cu&&cu.apply(this,arguments)||this;return t.landmarks=[],t}E.CameraContribution=uu;t(pu,fu=rl);var fu,du=pu;function pu(t,e,n,r){t=fu.call(this,t)||this;return t.currentTime=n,t.timelineTime=r,t.target=e,t.type="finish",t.bubbles=!1,t.currentTarget=e,t.defaultPrevented=!1,t.eventPhase=t.AT_TARGET,t.timeStamp=Date.now(),t.currentTime=n,t.timelineTime=r,t}var gu=0,yu=(Object.defineProperty(mu.prototype,"pending",{get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending},enumerable:!1,configurable:!0}),Object.defineProperty(mu.prototype,"playState",{get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"},enumerable:!1,configurable:!0}),Object.defineProperty(mu.prototype,"ready",{get:function(){var n=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise(function(t,e){n.resolveReadyPromise=function(){t(n)},n.rejectReadyPromise=function(){e(new Error)}}),this.pending)||this.resolveReadyPromise(),this.readyPromise},enumerable:!1,configurable:!0}),Object.defineProperty(mu.prototype,"finished",{get:function(){var n=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise(function(t,e){n.resolveFinishedPromise=function(){t(n)},n.rejectFinishedPromise=function(){e(new Error)}}),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise},enumerable:!1,configurable:!0}),Object.defineProperty(mu.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.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(mu.prototype,"startTime",{get:function(){return this._startTime},set:function(t){null!==t&&(this.updatePromises(),t=Number(t),isNaN(t)||this._paused||this._idle||(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(mu.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){var e;t!==this._playbackRate&&(this.updatePromises(),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(mu.prototype,"_isFinished",{get:function(){return!this._idle&&(0<this._playbackRate&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)},enumerable:!1,configurable:!0}),Object.defineProperty(mu.prototype,"totalDuration",{get:function(){return this._totalDuration},enumerable:!1,configurable:!0}),Object.defineProperty(mu.prototype,"_needsTick",{get:function(){return this.pending||"running"===this.playState||!this._finishedFlag},enumerable:!1,configurable:!0}),mu.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},mu.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()},mu.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()},mu.prototype.finish=function(){this.updatePromises(),this._idle||(this.currentTime=0<this._playbackRate?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},mu.prototype.cancel=function(){var t,e=this;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)&&(t=new du(null,this,this.currentTime,null),setTimeout(function(){e.oncancel(t)}))},mu.prototype.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()},mu.prototype.updatePlaybackRate=function(t){this.playbackRate=t},mu.prototype.targetAnimations=function(){var t;return(null==(t=this.effect)?void 0:t.target).getAnimations()},mu.prototype.markTarget=function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)},mu.prototype.unmarkTarget=function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)},mu.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))},mu.prototype.rewind=function(){if(0<=this.playbackRate)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}},mu.prototype.persist=function(){throw new Error(Hr)},mu.prototype.addEventListener=function(t,e,n){throw new Error(Hr)},mu.prototype.removeEventListener=function(t,e,n){throw new Error(Hr)},mu.prototype.dispatchEvent=function(t){throw new Error(Hr)},mu.prototype.commitStyles=function(){throw new Error(Hr)},mu.prototype.ensureAlive=function(){var t;this.playbackRate<0&&0===this.currentTime?this._inEffect=!(null==(t=this.effect)||!t.update(-1)):this._inEffect=!(null==(t=this.effect)||!t.update(this.currentTime)),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},mu.prototype.tickCurrentTime=function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=0<this._playbackRate?this._totalDuration:0),this.ensureAlive())},mu.prototype.fireEvents=function(t){var e,n=this;this._isFinished?this._finishedFlag||(this.onfinish&&(e=new du(null,this,this.currentTime,t),setTimeout(function(){n.onfinish&&n.onfinish(e)})),this._finishedFlag=!0):(this.onframe&&"running"===this.playState&&(t=new du(null,this,this.currentTime,t),this.onframe(t)),this._finishedFlag=!1)},mu);function mu(t,e){this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,((this.effect=t).animation=this).timeline=e,this.id="".concat(gu++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null==(t=this.effect)?void 0:t.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}function vu(b,e,x,n){if(!(0<=b&&b<=1&&0<=x&&x<=1))throw new Error("bezier x values must be in [0, 1] range");if(b===e&&x===n)return function(t){return t};for(var w=new(Fu?Float32Array:Array)(11),t=0;t<11;++t)w[t]=Hu(.1*t,b,x);function r(t){for(var e=0,n=1;10!==n&&w[n]<=t;++n)e+=.1;var r=e+.1*((t-w[--n])/(w[n+1]-w[n])),i=Vu(r,b,x);if(.001<=i){for(var a=t,o=r,s=b,l=x,c=0;c<Iu;++c){var u=Vu(o,s,l);if(0===u)return o;o-=(Hu(o,s,l)-a)/u}return o}if(0===i)return r;for(var h,f,d=t,p=e,g=e+.1,y=b,m=x,v=0;0<(h=Hu(f=p+(g-p)/2,y,m)-d)?g=f:p=f,Math.abs(h)>Bu&&++v<Du;);return f}return function(t){return 0===t||1===t?t:Hu(r(t),e,n)}}function bu(t){return Math.pow(t,2)}function xu(t){return Math.pow(t,3)}function wu(t){return Math.pow(t,4)}function Mu(t){return Math.pow(t,5)}function Ou(t){return Math.pow(t,6)}function ku(t){return 1-Math.cos(t*Math.PI/2)}function Eu(t){return 1-Math.sqrt(1-t*t)}function Su(t){return t*t*(3*t-2)}function Au(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)}function _u(t,e){var n=(e=j(e=void 0===e?[]:e,2))[0],e=void 0===(e=e[1])?.5:e,n=We(Number(void 0===n?1:n),1,10),e=We(Number(e),.1,2);return 0===t||1===t?t:-n*Math.pow(2,10*(t-1))*Math.sin((t-1-e/(2*Math.PI)*Math.asin(1/n))*(2*Math.PI)/e)}function Tu(t,e,n){var r=(e=j(e=void 0===e?[]:e,4))[0],i=void 0===(i=e[1])?100:i,a=void 0===(a=e[2])?10:a,e=void 0===(e=e[3])?0:e,r=We(void 0===r?1:r,.1,1e3),i=We(i,.1,1e3),a=We(a,.1,1e3),e=We(e,.1,1e3),o=Math.sqrt(i/r),i=(a=a/(2*Math.sqrt(i*r)))<1?o*Math.sqrt(1-a*a):0,r=a<1?(a*o-e)/i:-e+o,e=n?n*t/1e3:t,e=a<1?Math.exp(-e*a*o)*(+Math.cos(i*e)+r*Math.sin(i*e)):(1+r*e)*Math.exp(-e*o);return 0===t||1===t?t:1-e}function Pu(t,e){var e=j(e=void 0===e?[]:e,2),n=void 0===(n=e[0])?10:n;return("start"==e[1]?Math.ceil:Math.floor)(We(t,0,1)*n)/n}function Cu(t,e){var n=(e=j(e=void 0===e?[]:e,4))[0],r=e[1],i=e[2],e=e[3];return vu(n,r,i,e)(t)}function Lu(r){return function(t,e,n){return 1-r(1-t,e=void 0===e?[]:e,n)}}function Nu(r){return function(t,e,n){return void 0===e&&(e=[]),t<.5?r(2*t,e,n)/2:1-r(-2*t+2,e,n)/2}}function ju(r){return function(t,e,n){return void 0===e&&(e=[]),t<.5?(1-r(1-2*t,e,n))/2:(r(2*t-1,e,n)+1)/2}}function Ru(t){return t}var Iu=4,Bu=1e-7,Du=10,Fu="function"==typeof Float32Array,zu=function(t,e){return 1-3*e+3*t},Wu=function(t,e){return 3*e-6*t},Gu=function(t){return 3*t},Hu=function(t,e,n){return((zu(e,n)*t+Wu(e,n))*t+Gu(e))*t},Vu=function(t,e,n){return 3*zu(e,n)*t*t+2*Wu(e,n)*t+Gu(e)},So=vu(.42,0,1,1),Yu={steps:Pu,"step-start":function(t){return Pu(t,[1,"start"])},"step-end":function(t){return Pu(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":Cu,ease:function(t){return Cu(t,[.25,.1,.25,1])},in:So,out:Lu(So),"in-out":Nu(So),"out-in":ju(So),"in-quad":bu,"out-quad":Lu(bu),"in-out-quad":Nu(bu),"out-in-quad":ju(bu),"in-cubic":xu,"out-cubic":Lu(xu),"in-out-cubic":Nu(xu),"out-in-cubic":ju(xu),"in-quart":wu,"out-quart":Lu(wu),"in-out-quart":Nu(wu),"out-in-quart":ju(wu),"in-quint":Mu,"out-quint":Lu(Mu),"in-out-quint":Nu(Mu),"out-in-quint":ju(Mu),"in-expo":Ou,"out-expo":Lu(Ou),"in-out-expo":Nu(Ou),"out-in-expo":ju(Ou),"in-sine":ku,"out-sine":Lu(ku),"in-out-sine":Nu(ku),"out-in-sine":ju(ku),"in-circ":Eu,"out-circ":Lu(Eu),"in-out-circ":Nu(Eu),"out-in-circ":ju(Eu),"in-back":Su,"out-back":Lu(Su),"in-out-back":Nu(Su),"out-in-back":ju(Su),"in-bounce":Au,"out-bounce":Lu(Au),"in-out-bounce":Nu(Au),"out-in-bounce":ju(Au),"in-elastic":_u,"out-elastic":Lu(_u),"in-out-elastic":Nu(_u),"out-in-elastic":ju(_u),spring:Tu,"spring-in":Tu,"spring-out":Lu(Tu),"spring-in-out":Nu(Tu),"spring-out-in":ju(Tu)},qu=function(t){return("-"===(t=(t=t).replace(/([A-Z])/g,function(t){return"-".concat(t.toLowerCase())})).charAt(0)?t.substring(1):t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()};function $u(n,r){return function(t){var e;return 1<=t?1:(t+=r*(e=1/n))-t%e}}var Co="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Uu=new RegExp("cubic-bezier\\("+Co+","+Co+","+Co+","+Co+"\\)"),Xu=/steps\(\s*(\d+)\s*\)/,Ku=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Zu(t){var e=Uu.exec(t);return e?vu.apply(void 0,O([],j(e.slice(1).map(Number)),!1)):(e=Xu.exec(t))?$u(Number(e[1]),0):(e=Ku.exec(t))?$u(Number(e[1]),{start:1,middle:.5,end:0}[e[2]]):Yu[qu(t)]||Yu.linear}function Qu(t){return Math.abs((0!==(e=t).duration&&0!==e.iterations?("auto"===e.duration?0:Number(e.duration))*(null!=(e=e.iterations)?e:1):0)/(t.playbackRate||1));var e}var Ju=0,th=1,eh=2,nh=3;function rh(t,e,n){c=t,i=n;var r,i,a,o,s,l=null===(l=e)?Ju:(r=i.endTime,l<Math.min(i.delay,r)?th:l>=Math.min(i.delay+c+i.endDelay,r)?eh:nh),c=function(t,e,n,r,i){switch(r){case th:return"backwards"===e||"both"===e?0:null;case nh:return n-i;case eh:return"forwards"===e||"both"===e?t:null;case Ju:return null}}(t,n.fill,e,l,n.delay);return null===c?null:(i="auto"===n.duration?0:n.duration,r=i,t=l,e=n.iterations,o=c,s=n.iterationStart,0===r?t!==th&&(s+=e):s+=o/r,e=t=s,o=n.iterationStart,s=l,a=n.iterations,c=c,i=i,e=o=0!==(o=e===1/0?o%1:e%1)||s!==eh||0===a||0===c&&0!==i?o:1,s=n.iterations,a=e,c=t,i=l===eh&&s===1/0?1/0:1===a?Math.floor(c)-1:Math.floor(c),o=n.direction,t=i,l=e,a="normal"===(s="normal"!==(s=o)&&"reverse"!==o&&(t=t,"alternate-reverse"===o&&(t+=1),s="normal",t!==1/0)&&t%2!=0?"reverse":s)?l:1-l,n.currentIteration=i,n.progress=a,n.easingFunction(a))}function ih(t,e,n){var a=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r]){var a;ah(i)&&(a={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:Zu(t[r].easing)||e.easingFunction,value:t[r][i]},n[i]=n[i]||[],n[i].push(a))}return n}(t,e),o=function(t,e){var n,r=[];for(n in t)for(var i=t[n],a=0;a<i.length-1;a++){var o=a,s=a+1,l=i[o].computedOffset,c=i[s].computedOffset,u=l,h=c;0===a&&(u=-1/0,0===c)&&(s=o),a===i.length-2&&(h=1/0,1===l)&&(o=s),r.push({applyFrom:u,applyTo:h,startOffset:i[o].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[o].easingFunction,property:n,interpolation:function(t,e,n,r){var i=wo[t];if(i&&i.syntax&&i.int){i=E.styleValueRegistry.getPropertySyntax(i.syntax);if(i){var a,o,s,l=void 0,c=void 0,t=(c=E.enableCSSParsing?(o=E.styleValueRegistry.parseProperty(t,e,r),a=E.styleValueRegistry.parseProperty(t,n,r),l=E.styleValueRegistry.computeProperty(t,o,r),E.styleValueRegistry.computeProperty(t,a,r)):(o=i.parserWithCSSDisabled,l=o?o(e,r):e,o?o(n,r):n),i.mixer(l,c,r));if(t)return s=oh.apply(void 0,O([],j(t),!1)),function(t){return 0===t?e:1===t?n:s(t)}}}return oh(!1,!0,function(t){return t?n:e})}(n,i[o].value,i[s].value,e)})}return r.sort(function(t,e){return t.startOffset-e.startOffset}),r}(a,n);return function(r,i){if(null!==i)o.filter(function(t){return i>=t.applyFrom&&i<t.applyTo}).forEach(function(t){var e=i-t.startOffset,n=t.endOffset-t.startOffset,e=0==n?0:t.easingFunction(e/n);r.setAttribute(t.property,t.interpolation(e))});else for(var t in a)ah(t)&&r.setAttribute(t,null)}}function ah(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var oh=function(e,n,r){return function(t){t=function t(e,n,r){if("number"==typeof e&&"number"==typeof n)return e*(1-r)+n*r;if("boolean"==typeof e&&"boolean"==typeof n||"string"==typeof e&&"string"==typeof n)return r<.5?e:n;if(Array.isArray(e)&&Array.isArray(n)){for(var i=e.length,a=n.length,o=Math.max(i,a),s=[],l=0;l<o;l++)s.push(t(e[l<i?l:i-1],n[l<a?l:a-1],r));return s}throw new Error("Mismatched interpolation arguments "+e+":"+n)}(e,n,t);return!E.enableCSSParsing&&Ge(t)?t:r(t)}};Object.defineProperty(lh.prototype,"easing",{get:function(){return this._easing},set:function(t){this.easingFunction=Zu(t),this._easing=t},enumerable:!1,configurable:!0});var sh=lh;function lh(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Ru,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}function ch(t,i){if(null===t)return[];for(var e=(t=Array.isArray(t)?t:function(t){var e,n=[];for(e in t)if(!(e in["easing","offset","composite"]))for(var r,i=t[e],a=(i=Array.isArray(i)?i:[i]).length,o=0;o<a;o++)n[o]||(r={},"offset"in t&&(r.offset=Number(t.offset)),"easing"in t&&(r.easing=t.easing),"composite"in t&&(r.composite=t.composite),n[o]=r),void 0!==i[o]&&null!==i[o]&&(n[o][e]=i[o]);return n.sort(function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)}),n}(t)).map(function(t){var e,n={};for(e in null!=i&&i.composite&&(n.composite="auto"),t){var r=t[e];if("offset"===e){if(null!==r){if(r=Number(r),!isFinite(r))throw new Error("Keyframe offsets must be numbers.");if(r<0||1<r)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=r}}else if("composite"===e&&-1===["replace","add","accumulate","auto"].indexOf(r))throw new Error("".concat(r," compositing is not supported"));n[e]=r}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==i?void 0:i.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n}),n=!0,r=-1/0,a=0;a<e.length;a++){var o=e[a].offset;if(P(o))n=!1;else{if(o<r)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");r=o}}if(e=e.filter(function(t){return 0<=Number(t.offset)&&Number(t.offset)<=1}),!n)for(var s=e.length,l=(e[s-1].computedOffset=Number(null!=(t=e[s-1].offset)?t:1),1<s&&(e[0].computedOffset=Number(null!=(t=e[0].offset)?t:0)),0),c=Number(e[0].computedOffset),u=1;u<s;u++){var h=e[u].computedOffset;if(!P(h)&&!P(c)){for(var f=1;f<u-l;f++)e[l+f].computedOffset=c+(Number(h)-c)*f/(u-l);l=u,c=Number(h)}}return e}var uh="backwards|forwards|both|none".split("|"),hh="reverse|alternate|alternate-reverse".split("|");function fh(t,e){return t=function(t){"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t});return t}(null!=t?t:{duration:"auto"}),n=t,t=e,r=new sh,t&&(r.fill="both",r.duration="auto"),"number"!=typeof n||isNaN(n)?void 0!==n&&Object.keys(n).forEach(function(t){void 0===n[t]||null===n[t]||"auto"===n[t]||!("number"!=typeof r[t]&&"duration"!==t||"number"==typeof n[t]&&!isNaN(n[t]))||"fill"===t&&-1===uh.indexOf(n[t])||"direction"===t&&-1===hh.indexOf(n[t])||(r[t]=n[t])}):r.duration=n,r;var n,r}ph.prototype.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},ph.prototype.update=function(t){return null!==t&&(this.timeFraction=rh(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},ph.prototype.getKeyframes=function(){return this.normalizedKeyframes},ph.prototype.setKeyframes=function(t){this.normalizedKeyframes=ch(t)},ph.prototype.getComputedTiming=function(){return this.computedTiming},ph.prototype.getTiming=function(){return this.timing},ph.prototype.updateTiming=function(e){var n=this;Object.keys(e||{}).forEach(function(t){n.timing[t]=e[t]})};var dh=ph;function ph(t,e,n){var r=this,t=(this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=fh(n,!1),(this.timing.effect=this).timing.activeDuration=Qu(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=ch(e,this.timing),this.interpolations=ih(this.normalizedKeyframes,this.timing,this.target),E.globalThis.Proxy);this.computedTiming=t?new t(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}function gh(t,e){return Number(t.id)-Number(e.id)}yh.prototype.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},yh.prototype.isTicking=function(){return this.inTick},yh.prototype.play=function(t,e,n){t=new dh(t,e,n),e=new yu(t,this);return this.animations.push(e),this.restartWebAnimationsNextTick(),e.updatePromises(),e.play(),e.updatePromises(),e},yh.prototype.applyDirtiedAnimation=function(t){var e=this;this.inTick||(t.markTarget(),(t=t.targetAnimations()).sort(gh),this.tick(Number(this.currentTime),!1,t.slice())[1].forEach(function(t){t=e.animations.indexOf(t);-1!==t&&e.animations.splice(t,1)}),this.applyPendingEffects())},yh.prototype.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame(function(){}),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},yh.prototype.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},yh.prototype.applyPendingEffects=function(){this.pendingEffects.forEach(function(t){null!=t&&t.applyInterpolations()}),this.pendingEffects=[]},yh.prototype.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter(function(t){return t.updatePromises()})},yh.prototype.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter(function(t){return"finished"!==t.playState&&"idle"!==t.playState})},yh.prototype.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},yh.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},yh.prototype.requestAnimationFrame=function(e){var n=this;return this.rAF(function(t){n.updateAnimationsPromises(),e(t),n.updateAnimationsPromises()})},yh.prototype.tick=function(n,r,t){var i=this,a=(this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=n,this.ticking=!1,[]),o=[],s=[],l=[];return t.forEach(function(t){t.tick(n,r),t._inEffect?(o.push(t.effect),t.markTarget()):(a.push(t.effect),t.unmarkTarget()),t._needsTick&&(i.ticking=!0);var e=t._inEffect||t._needsTick;((t._inTimeline=e)?s:l).push(t)}),(t=this.pendingEffects).push.apply(t,O([],j(a),!1)),(t=this.pendingEffects).push.apply(t,O([],j(o),!1)),this.ticking&&this.requestAnimationFrame(function(){}),this.inTick=!1,[s,l]};Vo=yh;function yh(t){var n=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){n.currentTime=t,n.discardAnimations(),0===n.animations.length?n.timelineTicking=!1:n.requestAnimationFrame(n.webAnimationsNextTick)},this.processRafCallbacks=function(e){var t=n.rafCallbacks;n.rafCallbacks=[],e<Number(n.currentTime)&&(e=Number(n.currentTime)),n.animations.sort(gh),n.animations=n.tick(e,!0,n.animations)[0],t.forEach(function(t){t[1](e)}),n.applyPendingEffects()}}E.EasingFunction=Zu,E.AnimationTimeline=Vo;const mh="main-layer",vh="label-layer",bh="element",xh="view",wh="plot",Mh="component",Oh="label",kh="area";function Eh(t,e){e=e.r;t.arc(e,e,e,0,2*Math.PI,!1)}function Sh(t,e){var n,r,i=e.rx,e=e.ry;t.ellipse?t.ellipse(i,e,i,e,0,0,2*Math.PI,!1):(n=e<i?i:e,r=e<i?1:i/e,e=e<i?e/i:1,t.save(),t.scale(r,e),t.arc(n,n,n,0,2*Math.PI))}function Ah(t,e){var n,r,i=e.x1,a=e.y1,o=e.x2,s=e.y2,l=e.defX,l=void 0===l?0:l,c=e.defY,c=void 0===c?0:c,u=e.markerStart,h=e.markerEnd,f=e.markerStartOffset,e=e.markerEndOffset,d=0,p=0,g=0,y=0,m=0;u&&$l(u)&&f&&(n=o-i,r=s-a,m=Math.atan2(r,n),d=Math.cos(m)*(f||0),p=Math.sin(m)*(f||0)),h&&$l(h)&&e&&(n=i-o,r=a-s,m=Math.atan2(r,n),g=Math.cos(m)*(e||0),y=Math.sin(m)*(e||0)),t.moveTo(i-l+d,a-c+p),t.lineTo(o-l+g,s-c+y)}function _h(t,e){var n,r,i,a,o=e.defX,s=void 0===o?0:o,o=e.defY,l=void 0===o?0:o,o=e.markerStart,c=e.markerEnd,u=e.markerStartOffset,h=e.markerEndOffset,e=e.path,f=e.absolutePath,d=e.segments,p=0,g=0,y=0,m=0,e=0;o&&$l(o)&&u&&(i=(o=j(o.parentNode.getStartTangent(),2))[0],a=o[1],n=i[0]-a[0],r=i[1]-a[1],e=Math.atan2(r,n),p=Math.cos(e)*(u||0),g=Math.sin(e)*(u||0)),c&&$l(c)&&h&&(i=(o=j(c.parentNode.getEndTangent(),2))[0],a=o[1],n=i[0]-a[0],r=i[1]-a[1],e=Math.atan2(r,n),y=Math.cos(e)*(h||0),m=Math.sin(e)*(h||0));for(var v=0;v<f.length;v++){var b=f[v],x=b[0],w=f[v+1],M=0===v&&(0!==p||0!==g),O=(v===f.length-1||w&&("M"===w[0]||"Z"===w[0]))&&0!==y&&0!==m;switch(x){case"M":M?(t.moveTo(b[1]-s+p,b[2]-l+g),t.lineTo(b[1]-s,b[2]-l)):t.moveTo(b[1]-s,b[2]-l);break;case"L":O?t.lineTo(b[1]-s+y,b[2]-l+m):t.lineTo(b[1]-s,b[2]-l);break;case"Q":t.quadraticCurveTo(b[1]-s,b[2]-l,b[3]-s,b[4]-l),O&&t.lineTo(b[3]-s+y,b[4]-l+m);break;case"C":t.bezierCurveTo(b[1]-s,b[2]-l,b[3]-s,b[4]-l,b[5]-s,b[6]-l),O&&t.lineTo(b[5]-s+y,b[6]-l+m);break;case"A":var k,E,S=d[v].arcParams,A=S.cx,_=S.cy,T=S.rx,P=S.ry,C=S.startAngle,L=S.endAngle,N=S.xRotation,S=S.sweepFlag;t.ellipse?t.ellipse(A-s,_-l,T,P,N,C,L,!!(1-S)):(k=P<T?T:P,E=P<T?1:T/P,P=P<T?P/T:1,t.translate(A-s,_-l),t.rotate(N),t.scale(E,P),t.arc(0,0,k,C,L,!!(1-S)),t.scale(1/E,1/P),t.rotate(-N),t.translate(-(A-s),-(_-l))),O&&t.lineTo(b[6]-s+y,b[7]-l+m);break;case"Z":t.closePath()}}}function Th(t,e){var n,r,i=e.defX,a=void 0===i?0:i,i=e.defY,o=void 0===i?0:i,i=e.markerStart,s=e.markerEnd,l=e.markerStartOffset,c=e.markerEndOffset,u=e.points.points,h=u.length,e=u[0][0]-a,f=u[0][1]-o,d=u[h-1][0]-a,p=u[h-1][1]-o,g=0,y=0,m=0,v=0,b=0;i&&$l(i)&&l&&(n=u[1][0]-u[0][0],r=u[1][1]-u[0][1],b=Math.atan2(r,n),g=Math.cos(b)*(l||0),y=Math.sin(b)*(l||0)),s&&$l(s)&&c&&(n=u[h-1][0]-u[0][0],r=u[h-1][1]-u[0][1],b=Math.atan2(r,n),m=Math.cos(b)*(c||0),v=Math.sin(b)*(c||0)),t.moveTo(e+(g||m),f+(y||v));for(var x=1;x<h-1;x++){var w=u[x];t.lineTo(w[0]-a,w[1]-o)}t.lineTo(d,p)}function Ph(t,e){var n,r,i=e.defX,a=void 0===i?0:i,i=e.defY,o=void 0===i?0:i,i=e.markerStart,s=e.markerEnd,l=e.markerStartOffset,c=e.markerEndOffset,u=e.points.points,h=u.length,e=u[0][0]-a,f=u[0][1]-o,d=u[h-1][0]-a,p=u[h-1][1]-o,g=0,y=0,m=0,v=0,b=0;i&&$l(i)&&l&&(n=u[1][0]-u[0][0],r=u[1][1]-u[0][1],b=Math.atan2(r,n),g=Math.cos(b)*(l||0),y=Math.sin(b)*(l||0)),s&&$l(s)&&c&&(n=u[h-2][0]-u[h-1][0],r=u[h-2][1]-u[h-1][1],b=Math.atan2(r,n),m=Math.cos(b)*(c||0),v=Math.sin(b)*(c||0)),t.moveTo(e+g,f+y);for(var x=1;x<h-1;x++){var w=u[x];t.lineTo(w[0]-a,w[1]-o)}t.lineTo(d+m,p+v)}function Ch(t,e){var n,r,i,a,o=e.radius,s=e.width,e=e.height,l=s,c=e;o&&o.some(function(t){return 0!==t})?(n=(s=0<s?1:-1)+(e=0<e?1:-1)==0,r=(o=j(o.map(function(t){return We(t,0,Math.min(Math.abs(l)/2,Math.abs(c)/2))}),4))[0],i=o[1],a=o[2],o=o[3],t.moveTo(s*r,0),t.lineTo(l-s*i,0),0!==i&&t.arc(l-s*i,e*i,i,-e*Math.PI/2,0<s?0:Math.PI,n),t.lineTo(l,c-e*a),0!==a&&t.arc(l-s*a,c-e*a,a,0<s?0:Math.PI,0<e?Math.PI/2:1.5*Math.PI,n),t.lineTo(s*o,c),0!==o&&t.arc(s*o,c-e*o,o,0<e?Math.PI/2:-Math.PI/2,0<s?Math.PI:0,n),t.lineTo(0,e*r),0!==r&&t.arc(s*r,e*r,r,0<s?Math.PI:0,0<e?1.5*Math.PI:Math.PI/2,n)):t.rect(0,0,l,c)}t(jh,Lh=e),jh.prototype.init=function(){(t={})[k.CIRCLE]=Eh,t[k.ELLIPSE]=Sh,t[k.RECT]=Ch,t[k.LINE]=Ah,t[k.POLYLINE]=Ph,t[k.POLYGON]=Th,t[k.PATH]=_h,t[k.TEXT]=void 0,t[k.GROUP]=void 0,t[k.IMAGE]=void 0,t[k.HTML]=void 0,t[k.MESH]=void 0;var t;this.context.pathGeneratorFactory=t},jh.prototype.destroy=function(){delete this.context.pathGeneratorFactory};var Lh,Nh=jh;function jh(){var t=null!==Lh&&Lh.apply(this,arguments)||this;return t.name="canvas-path-generator",t}var Rh=v(),Ih=v(),Bh=v(),Dh=Z(),Fh=(zh.prototype.apply=function(t,e){var n=this,r=t.renderingService,i=t.renderingContext,a=(this.context=t,this.runtime=e,null==(t=i.root)?void 0:t.ownerDocument);r.hooks.pick.tapPromise(zh.tag,function(e){return X(n,void 0,void 0,function(){return R(this,function(t){return[2,this.pick(a,e)]})})}),r.hooks.pickSync.tap(zh.tag,function(t){return n.pick(a,t)})},zh.prototype.pick=function(t,e){var n,r,i=e.topmost,a=(o=e.position).x,o=o.y,s=Nt(Rh,a,o,0),a=t.elementsFromBBox(s[0],s[1],s[0],s[1]),l=[];try{for(var c=I(a),u=c.next();!u.done;u=c.next()){var h=u.value,f=h.getWorldTransform();if(this.isHit(h,s,f,!1)){var d=hs(h);if(d){var p=d.parsedStyle.clipPath;if(this.isHit(p,s,p.getWorldTransform(),!0)){if(i)return e.picked=[h],e;l.push(h)}}else{if(i)return e.picked=[h],e;l.push(h)}}}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return e.picked=l,e},zh.tag="CanvasPicker",zh);function zh(){var o=this;this.isHit=function(t,e,n,r){var i=o.context.pointInPathPickerFactory[t.nodeName];if(i){var n=rt(Dh,n),e=Wt(Ih,Nt(Bh,e[0],e[1],0),n),n=t.getGeometryBounds().halfExtents,a=t.parsedStyle.anchor;if(e[0]+=(a&&a[0]||0)*n[0]*2,e[1]+=(a&&a[1]||0)*n[1]*2,i(t,new Ir(e[0],e[1]),r,o.isPointInPath,o.context,o.runtime))return!0}return!1},this.isPointInPath=function(t,e){var n=o.runtime.offscreenCanvasCreator.getOrCreateContext(o.context.config.offscreenCanvas),r=o.context.pathGeneratorFactory[t.nodeName];return r&&(n.beginPath(),r(n,t.parsedStyle),n.closePath()),n.isPointInPath(e.x,e.y)}}function Wh(t,e,n){var t=t.parsedStyle,r=t.r,i=t.fill,a=t.stroke,o=t.lineWidth,s=t.increasedLineWidthForHitTesting,t=t.pointerEvents,o=((o||0)+(s||0))/2,s=jn(r,r,e.x,e.y),e=j(gs(t,i,a),2),t=e[0],i=e[1];return t&&i||n?s<=r+o:t?s<=r:!!i&&r-o<=s&&s<=r+o}function Gh(t,e,n,r){return t/(n*n)+e/(r*r)}function Hh(t,e,n){var t=t.parsedStyle,r=t.rx,i=t.ry,a=t.fill,o=t.stroke,s=t.lineWidth,l=t.increasedLineWidthForHitTesting,t=t.pointerEvents,c=e.x,e=e.y,t=j(gs(t,a,o),2),a=t[0],o=t[1],t=((s||0)+(l||0))/2,s=(c-r)*(c-r),l=(e-i)*(e-i);return a&&o||n?Gh(s,l,r+t,i+t)<=1:a?Gh(s,l,r,i)<=1:!!o&&1<=Gh(s,l,r-t,i-t)&&Gh(s,l,r+t,i+t)<=1}function Vh(t,e,n,r,i,a){return t<=i&&i<=t+n&&e<=a&&a<=e+r}function Yh(t,e,n,r,i,a,o,s){var l=(Math.atan2(s-e,o-t)+2*Math.PI)%(2*Math.PI),t={x:t+n*Math.cos(l),y:e+n*Math.sin(l)};return jn(t.x,t.y,o,s)<=a/2}function qh(t,e,n,r,i,a,o){var s=Math.min(t,n),l=Math.max(t,n),c=Math.min(e,r),u=Math.max(e,r),h=i/2;return s-h<=a&&a<=l+h&&c-h<=o&&o<=u+h&&zn(t,e,n,r,a,o)<=i/2}function $h(t,e,n,r,i){var a=t.length;if(!(a<2)){for(var o=0;o<a-1;o++)if(qh(t[o][0],t[o][1],t[o+1][0],t[o+1][1],e,n,r))return!0;if(i){var i=t[0],s=t[a-1];if(qh(i[0],i[1],s[0],s[1],e,n,r))return!0}}return!1}var Uh=1e-6;function Xh(t){return Math.abs(t)<Uh?0:t<0?-1:1}function Kh(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var a,o,s,l=0;l<i;l++){var c=t[l],u=t[(l+1)%i];if(o=u,((s=[e,n])[0]-(a=c)[0])*(o[1]-a[1])==(o[0]-a[0])*(s[1]-a[1])&&Math.min(a[0],o[0])<=s[0]&&s[0]<=Math.max(a[0],o[0])&&Math.min(a[1],o[1])<=s[1]&&s[1]<=Math.max(a[1],o[1]))return!0;0<Xh(c[1]-n)!=0<Xh(u[1]-n)&&Xh(e-(n-c[1])*(c[0]-u[0])/(c[1]-u[1])-c[0])<0&&(r=!r)}return r}function Zh(t,e,n){for(var r=!1,i=0;i<t.length&&!(r=Kh(t[i],e,n));i++);return r}function Qh(t,e,n){var t=t.parsedStyle,r=t.x1,i=t.y1,a=t.x2,o=t.y2,s=t.lineWidth,l=t.increasedLineWidthForHitTesting,c=t.defX,c=void 0===c?0:c,u=t.defY,u=void 0===u?0:u;return!(!j(gs(t.pointerEvents,t.fill,t.stroke),2)[1]&&!n||!s)&&qh(r,i,a,o,(s||0)+(l||0),e.x+c,e.y+u)}function Jh(t,e,n,r,i,a){var o=t.parsedStyle,s=o.lineWidth,l=o.increasedLineWidthForHitTesting,c=o.stroke,u=o.fill,h=o.defX,h=void 0===h?0:h,f=o.defY,f=void 0===f?0:f,d=o.path,o=o.pointerEvents,p=d.segments,g=d.hasArc,y=d.polylines,d=d.polygons,o=j(gs(o,(null==d?void 0:d.length)&&u,c),2),u=o[0],c=o[1],o=ja(t),m=!1;return u||n?g?r(t,e):Zh(d,e.x+h,e.y+f)||Zh(y,e.x+h,e.y+f):c||n?function(t,e,n,r,i){for(var a=!1,o=e/2,s=0;s<t.length;s++){var l=t[s],c=l.currentPoint,u=l.params,h=l.prePoint,f=l.box;if(!f||Vh(f.x-o,f.y-o,f.width+e,f.height+e,n,r))switch(l.command){case"L":case"Z":if(a=qh(h[0],h[1],c[0],c[1],e,n,r))return!0;break;case"Q":if(a=$n(h[0],h[1],u[1],u[2],u[3],u[4],n,r)<=e/2)return!0;break;case"C":if(a=Hn(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],n,r,i)<=e/2)return!0;break;case"A":l.cubicParams||(l.cubicParams=ye(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var d=l.cubicParams,p=h,g=0;g<d.length;g+=6){var y=Hn(p[0],p[1],d[g],d[g+1],d[g+2],d[g+3],d[g+4],d[g+5],n,r,i),p=[d[g+4],d[g+5]];if(a=y<=e/2)return!0}}}return a}(p,(s||0)+(l||0),e.x+h,e.y+f,o):m}function tf(t,e,n){var t=t.parsedStyle,r=t.stroke,i=t.fill,a=t.lineWidth,o=t.increasedLineWidthForHitTesting,s=t.points,l=t.defX,l=void 0===l?0:l,c=t.defY,c=void 0===c?0:c,t=j(gs(t.pointerEvents,i,r),2),i=t[0],r=!1;return r=(r=t[1]||n?$h(s.points,(a||0)+(o||0),e.x+l,e.y+c,!0):r)||!i&&!n?r:Kh(s.points,e.x+l,e.y+c)}function ef(t,e,n){var t=t.parsedStyle,r=t.lineWidth,i=t.increasedLineWidthForHitTesting,a=t.points,o=t.defX,o=void 0===o?0:o,s=t.defY,s=void 0===s?0:s;return!(!j(gs(t.pointerEvents,t.fill,t.stroke),2)[1]&&!n||!r)&&$h(a.points,(r||0)+(i||0),e.x+o,e.y+s,!1)}function nf(t,e,n,r,i){var a,o,s,l,c,u,h,f,d,p=t.parsedStyle,g=p.radius,y=p.fill,m=p.stroke,v=p.lineWidth,b=p.increasedLineWidthForHitTesting,x=p.width,w=p.height,p=j(gs(p.pointerEvents,y,m),2),y=p[0],m=p[1],p=(v||0)+(b||0);return g&&g.some(function(t){return 0!==t})?(v=!1,(m||n)&&(h=b=0,l=x,u=w,g=g.map(function(t){return We(t,0,Math.min(Math.abs(x)/2,Math.abs(w)/2))}),d=p,a=e.x,o=e.y,g=j(g,4),f=g[0],s=g[1],c=g[2],g=g[3],v=qh(b+f,h,b+l-s,h,d,a,o)||qh(b+l,h+s,b+l,h+u-c,d,a,o)||qh(b+l-c,h+u,b+g,h+u,d,a,o)||qh(b,h+u-g,b,h+f,d,a,o)||Yh(b+l-s,h+s,s,Math.PI,Math.PI,d,a,o)||Yh(b+l-c,h+u-c,c,0,Math.PI,d,a,o)||Yh(b+g,h+u-g,g,Math.PI,Math.PI,d,a,o)||Yh(b+f,h+f,f,Math.PI,Math.PI,d,a,o)),v||!y&&!n?v:r(t,e)):(s=p/2,y&&m||n?Vh(0-s,0-s,x+s,w+s,e.x,e.y):y?Vh(0,0,x,w,e.x,e.y):!!m&&(c=l=0,u=x,g=w,b=p,h=e.x,f=e.y,Vh(l-(d=b/2),c-d,u,b,h,f)||Vh(l+u-d,c-d,b,g,h,f)||Vh(l+d,c+g-d,u,b,h,f)||Vh(l-d,c+d,b,g,h,f)))}function rf(t,e,n,r,i,a){var o,s=t.parsedStyle,l=s.pointerEvents,c=s.width,s=s.height;return"non-transparent-pixel"!==l||(l=i.config.offscreenCanvas,o=a.offscreenCanvasCreator.getOrCreateCanvas(l),a=a.offscreenCanvasCreator.getOrCreateContext(l,{willReadFrequently:!0}),o.width=c,o.height=s,i.defaultStyleRendererFactory[k.IMAGE].render(a,t.parsedStyle,t,void 0,void 0,void 0),a.getImageData(e.x,e.y,1,1).data.every(function(t){return 0!==t}))}t(sf,af=e),sf.prototype.init=function(){(t={})[k.CIRCLE]=Wh,t[k.ELLIPSE]=Hh,t[k.RECT]=nf,t[k.LINE]=Qh,t[k.POLYLINE]=ef,t[k.POLYGON]=tf,t[k.PATH]=Jh,t[k.TEXT]=function(){return!0},t[k.GROUP]=null,t[k.IMAGE]=rf,t[k.HTML]=null,t[k.MESH]=null;var t;this.context.pointInPathPickerFactory=t,this.addRenderingPlugin(new Fh)},sf.prototype.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()};var af,of=sf;function sf(){var t=null!==af&&af.apply(this,arguments)||this;return t.name="canvas-picker",t}cf.prototype.apply=function(t,c){function i(t){(t=t.target.rBushNode).aabb&&u.removedRBushNodeAABBs.push(t.aabb)}function a(t){(t=t.target.rBushNode).aabb&&u.removedRBushNodeAABBs.push(t.aabb)}var u=this,h=(this.context=t).config,f=t.camera,l=t.renderingService,d=t.renderingContext,e=t.rBushRoot,n=t.pathGeneratorFactory,p=(this.rBush=e,this.pathGeneratorFactory=n,t.contextService),g=d.root.ownerDocument.defaultView,y=(l.hooks.init.tap(cf.tag,function(){g.addEventListener(b.UNMOUNTED,i),g.addEventListener(b.CULLED,a);var t=p.getDPR(),e=h.width,n=h.height,r=p.getContext();u.clearRect(r,0,0,e*t,n*t,h.background)}),l.hooks.destroy.tap(cf.tag,function(){g.removeEventListener(b.UNMOUNTED,i),g.removeEventListener(b.CULLED,a),u.renderQueue=[],u.removedRBushNodeAABBs=[],u.restoreStack=[]}),l.hooks.beginFrame.tap(cf.tag,function(){var t=p.getContext(),e=p.getDPR(),n=h.width,r=h.height,i=(a=u.canvasRendererPluginOptions).dirtyObjectNumThreshold,a=a.dirtyObjectRatioThreshold,o=(s=l.getStats()).total,s=s.rendered,o=s/o;u.clearFullScreen=l.disableDirtyRectangleRendering()||i<s&&a<o,t&&(t.resetTransform?t.resetTransform():t.setTransform(1,0,0,1,0,0),u.clearFullScreen)&&u.clearRect(t,0,0,n*e,r*e,h.background)}),function(t,e){t.isVisible()&&!t.isCulled()&&(u.renderDisplayObject(t,e,u.context,u.restoreStack,c),u.saveDirtyAABB(t)),(t.sortable.sorted||t.childNodes).forEach(function(t){y(t,e)})});l.hooks.endFrame.tap(cf.tag,function(){var e=p.getContext(),t=p.getDPR();if(gt(u.dprMatrix,[t,t,1]),ct(u.vpMatrix,u.dprMatrix,f.getOrthoMatrix()),u.clearFullScreen)y(d.root,e);else{t=u.safeMergeAABB.apply(u,O([u.mergeDirtyAABBs(u.renderQueue)],j(u.removedRBushNodeAABBs.map(function(t){var e=t.minX,n=t.minY,r=t.maxX,t=t.maxY,i=new Tr;return i.setMinMax([e,n,0],[r,t,0]),i})),!1));if(u.removedRBushNodeAABBs=[],Tr.isEmpty(t))return void(u.renderQueue=[]);var n=u.convertAABB2Rect(t),r=n.x,i=n.y,a=n.width,n=n.height,o=Wt(u.vec3a,[r,i,0],u.vpMatrix),s=Wt(u.vec3b,[r+a,i,0],u.vpMatrix),l=Wt(u.vec3c,[r,i+n,0],u.vpMatrix),r=Wt(u.vec3d,[r+a,i+n,0],u.vpMatrix),a=Math.min(o[0],s[0],r[0],l[0]),i=Math.min(o[1],s[1],r[1],l[1]),n=Math.max(o[0],s[0],r[0],l[0]),o=Math.max(o[1],s[1],r[1],l[1]),s=Math.floor(a),r=Math.floor(i),l=Math.ceil(n-a),n=Math.ceil(o-i);e.save(),u.clearRect(e,s,r,l,n,h.background),e.beginPath(),e.rect(s,r,l,n),e.clip(),e.setTransform(u.vpMatrix[0],u.vpMatrix[1],u.vpMatrix[4],u.vpMatrix[5],u.vpMatrix[12],u.vpMatrix[13]),h.renderer.getConfig().enableDirtyRectangleRenderingDebug&&g.dispatchEvent(new gl(Qc.DIRTY_RECTANGLE,{dirtyRect:{x:s,y:r,width:l,height:n}})),u.searchDirtyObjects(t).sort(function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder}).forEach(function(t){t&&t.isVisible()&&!t.isCulled()&&u.renderDisplayObject(t,e,u.context,u.restoreStack,c)}),e.restore(),u.renderQueue.forEach(function(t){u.saveDirtyAABB(t)}),u.renderQueue=[]}u.restoreStack.forEach(function(){e.restore()}),u.restoreStack=[]}),l.hooks.render.tap(cf.tag,function(t){u.clearFullScreen||u.renderQueue.push(t)})},cf.prototype.clearRect=function(t,e,n,r,i,a){t.clearRect(e,n,r,i),a&&(t.fillStyle=a,t.fillRect(e,n,r,i))},cf.prototype.renderDisplayObject=function(t,e,n,r,i){var a,o=t.nodeName,s=r[r.length-1],s=(!s||t.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_CONTAINS||(e.restore(),r.pop()),this.context.styleRendererFactory[o]),o=this.pathGeneratorFactory[o],l=t.parsedStyle.clipPath;l&&(this.applyWorldTransform(e,l),a=this.pathGeneratorFactory[l.nodeName])&&(e.save(),r.push(t),e.beginPath(),a(e,l.parsedStyle),e.closePath(),e.clip()),s&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),o&&(e.beginPath(),o(e,t.parsedStyle),t.nodeName!==k.LINE)&&t.nodeName!==k.PATH&&t.nodeName!==k.POLYLINE&&e.closePath(),s&&(s.render(e,t.parsedStyle,t,n,this,i),e.restore()),t.renderable.dirty=!1},cf.prototype.convertAABB2Rect=function(t){var e=t.getMin(),t=t.getMax(),n=Math.floor(e[0]),e=Math.floor(e[1]);return{x:n,y:e,width:Math.ceil(t[0])-n,height:Math.ceil(t[1])-e}},cf.prototype.mergeDirtyAABBs=function(t){var n=new Tr;return t.forEach(function(t){var e=t.getRenderBounds(),e=(n.add(e),t.renderable.dirtyRenderBounds);e&&n.add(e)}),n},cf.prototype.searchDirtyObjects=function(t){var e=(n=j(t.getMin(),2))[0],n=n[1],r=(t=j(t.getMax(),2))[0],t=t[1];return this.rBush.search({minX:e,minY:n,maxX:r,maxY:t}).map(function(t){return t.displayObject})},cf.prototype.saveDirtyAABB=function(t){var e=t.renderable,t=(e.dirtyRenderBounds||(e.dirtyRenderBounds=new Tr),t.getRenderBounds());t&&e.dirtyRenderBounds.update(t.center,t.halfExtents)},cf.prototype.applyAttributesToContext=function(t,e){var n=(o=e.parsedStyle).stroke,r=o.fill,i=o.opacity,a=o.lineDash,o=o.lineDashOffset;a&&t.setLineDash(a),P(o)||(t.lineDashOffset=o),P(i)||(t.globalAlpha*=i),P(n)||Array.isArray(n)||n.isNone||(t.strokeStyle=e.attributes.stroke),P(r)||Array.isArray(r)||r.isNone||(t.fillStyle=e.attributes.fill)},cf.prototype.applyWorldTransform=function(t,e,n){var r=0,i=0,a=(e.parsedStyle||{}).anchor,o=a&&a[0]||0,a=a&&a[1]||0;0===o&&0===a||(r=-o*((o=e.geometry.contentBounds)&&2*o.halfExtents[0]||0),i=-a*(o&&2*o.halfExtents[1]||0)),n?(J(this.tmpMat4,e.getLocalTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,ut(this.tmpMat4,this.tmpMat4,this.vec3a),ct(this.tmpMat4,n,this.tmpMat4)):(J(this.tmpMat4,e.getWorldTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,ut(this.tmpMat4,this.tmpMat4,this.vec3a)),ct(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])},cf.prototype.safeMergeAABB=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=new Tr;return t.forEach(function(t){n.add(t)}),n},cf.tag="CanvasRenderer";var lf=cf;function cf(t){this.canvasRendererPluginOptions=t,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.vpMatrix=Z(),this.dprMatrix=Z(),this.tmpMat4=Z(),this.vec3a=v(),this.vec3b=v(),this.vec3c=v(),this.vec3d=v()}hf.prototype.render=function(t,e,n,r,i,a){var o=e.fill,s=e.fillRule,l=e.opacity,c=e.fillOpacity,u=e.stroke,h=e.strokeOpacity,f=e.lineWidth,d=e.lineCap,p=e.lineJoin,g=e.shadowType,y=e.shadowColor,m=e.shadowBlur,v=e.filter,e=e.miterLimit,b=!P(o)&&!o.isNone,x=!P(u)&&!u.isNone&&0<f,w=0===o.alpha,v=!(!v||!v.length),y=!P(y)&&0<m,m=n.nodeName,g="inner"===g,m=x&&y&&(m===k.PATH||m===k.LINE||m===k.POLYLINE||w||g);b&&(t.globalAlpha=l*c,m||ff(n,t,y),this.fill(t,n,o,s,r,i,a),m||this.clearShadowAndFilter(t,v,y)),x&&(t.globalAlpha=l*h,t.lineWidth=f,P(e)||(t.miterLimit=e),P(d)||(t.lineCap=d),P(p)||(t.lineJoin=p),m&&(g&&(t.globalCompositeOperation="source-atop"),ff(n,t,!0),g)&&(this.stroke(t,n,u,r,i,a),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,v,!0)),this.stroke(t,n,u,r,i,a))},hf.prototype.clearShadowAndFilter=function(t,e,n){n&&(t.shadowColor="transparent",t.shadowBlur=0),e&&(n=t.filter,!P(n))&&-1<n.indexOf("drop-shadow")&&(t.filter=n.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")},hf.prototype.fill=function(e,n,t,r,i,a,o){var s=this;Array.isArray(t)?t.forEach(function(t){e.fillStyle=s.getColor(t,n,e),r?e.fill(r):e.fill()}):(ga(t)&&(e.fillStyle=this.getPattern(t,n,e,i,a,o)),r?e.fill(r):e.fill())},hf.prototype.stroke=function(e,n,t,r,i,a){var o=this;Array.isArray(t)?t.forEach(function(t){e.strokeStyle=o.getColor(t,n,e),e.stroke()}):(ga(t)&&(e.strokeStyle=this.getPattern(t,n,e,r,i,a)),e.stroke())},hf.prototype.getPattern=function(t,e,n,r,i,a){var o,s,l,c,u,h,f;return"rect"===t.image.nodeName&&(o=(s=t.image.parsedStyle).width,s=s.height,l=r.contextService.getDPR(),c=r.config.offscreenCanvas,(u=a.offscreenCanvasCreator.getOrCreateCanvas(c)).width=o*l,u.height=s*l,h=a.offscreenCanvasCreator.getOrCreateContext(c),f=[],t.image.forEach(function(t){i.renderDisplayObject(t,h,r,f,a)}),f.forEach(function(){h.restore()})),this.imagePool.getOrCreatePatternSync(t,n,u,l,function(){e.renderable.dirty=!0,r.renderingService.dirtify()})},hf.prototype.getColor=function(t,e,n){var r;return t.type!==ri.LinearGradient&&t.type!==ri.RadialGradient||(r=(e=e.getGeometryBounds())&&2*e.halfExtents[0]||1,e=e&&2*e.halfExtents[1]||1,r=this.imagePool.getOrCreateGradient(m(m({type:t.type},t.value),{width:r,height:e}),n)),r};var uf=hf;function hf(t){this.imagePool=t}function ff(t,e,n){var r=t.parsedStyle,i=r.filter,a=r.shadowColor,o=r.shadowBlur,s=r.shadowOffsetX,r=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=a.toString(),e.shadowBlur=o||0,e.shadowOffsetX=s||0,e.shadowOffsetY=r||0)}pf.prototype.render=function(t,e,n){var r=e.width,i=e.height,a=e.img,o=e.shadowColor,e=e.shadowBlur,a=ze(a)?this.imagePool.getImageSync(a):(r=r||a.width,i=i||a.height,a);if(a){ff(n,t,!P(o)&&0<e);try{t.drawImage(a,0,0,r,i)}catch(t){}}};var df=pf;function pf(t){this.imagePool=t}Of.prototype.render=function(t,e,n,r,i,a){var o=e.lineWidth,s=e.textAlign,l=e.textBaseline,c=e.lineJoin,u=e.miterLimit,h=e.letterSpacing,f=e.stroke,d=e.fill,p=e.fillOpacity,g=e.strokeOpacity,y=e.opacity,m=e.metrics,v=e.dx,b=e.dy,x=e.shadowColor,e=e.shadowBlur,w=m.font,M=m.lines,O=m.height,k=m.lineHeight,E=m.lineMetrics,m=(t.font=w,t.lineWidth=o,t.textAlign="middle"===s?"center":s,l),S=(a.enableCSSParsing||"alphabetic"!==m||(m="bottom"),t.lineJoin=c,P(u)||(t.miterLimit=u),0),A=("middle"===l?S=-O/2-k/2:"bottom"===l||"alphabetic"===l||"ideographic"===l?S=-O:"top"!==l&&"hanging"!==l||(S=-k),v||0),w=(S+=b||0,1===M.length&&("bottom"===m?(m="middle",S-=.5*O):"top"===m&&(m="middle",S+=.5*O)),t.textBaseline=m,!P(x)&&0<e);ff(n,t,w);for(var _=0;_<M.length;_++){var T=o/2+A;S+=k,P(f)||f.isNone||!o||this.drawLetterSpacing(t,M[_],E[_],s,T,S,h,p,g,y,!0),P(d)||this.drawLetterSpacing(t,M[_],E[_],s,T,S,h,p,g,y)}},Of.prototype.drawLetterSpacing=function(t,e,n,r,i,a,o,s,l,c,u){if(void 0===u&&(u=!1),0===o)u?this.strokeText(t,e,i,a,l):this.fillText(t,e,i,a,s,c);else{for(var h=t.textAlign,f=(t.textAlign="left",i),d=("center"===r||"middle"===r?f=i-n.width/2:"right"!==r&&"end"!==r||(f=i-n.width),Array.from(e)),p=t.measureText(e).width,g=0;g<d.length;++g){var y=d[g];u?this.strokeText(t,y,f,a,l):this.fillText(t,y,f,a,s,c),f+=p-(y=t.measureText(e.substring(g+1)).width)+o,p=y}t.textAlign=h}},Of.prototype.fillText=function(t,e,n,r,i,a){var o,s=!P(i)&&1!==i;s&&(o=t.globalAlpha,t.globalAlpha=i*a),t.fillText(e,n,r),s&&(t.globalAlpha=o)},Of.prototype.strokeText=function(t,e,n,r,i){var a,o=!P(i)&&1!==i;o&&(a=t.globalAlpha,t.globalAlpha=i),t.strokeText(e,n,r),o&&(t.globalAlpha=a)};var gf,yf,mf,vf,bf,xf,wf,Mf=Of;function Of(){}function kf(){return null!==gf&&gf.apply(this,arguments)||this}function Ef(){return null!==yf&&yf.apply(this,arguments)||this}function Sf(){return null!==mf&&mf.apply(this,arguments)||this}function Af(){return null!==vf&&vf.apply(this,arguments)||this}function _f(){return null!==bf&&bf.apply(this,arguments)||this}function Tf(){return null!==xf&&xf.apply(this,arguments)||this}function Pf(){return null!==wf&&wf.apply(this,arguments)||this}t(kf,gf=uf),t(Ef,yf=uf),t(Sf,mf=uf),t(Af,vf=uf),t(_f,bf=uf),t(Tf,xf=uf),t(Pf,wf=uf);t(Nf,Cf=e),Nf.prototype.init=function(){var t,e=m({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,r=new uf(n),n=((t={})[k.CIRCLE]=r,t[k.ELLIPSE]=r,t[k.RECT]=r,t[k.IMAGE]=new df(n),t[k.TEXT]=new Mf,t[k.LINE]=r,t[k.POLYLINE]=r,t[k.POLYGON]=r,t[k.PATH]=r,t[k.GROUP]=void 0,t[k.HTML]=void 0,t[k.MESH]=void 0,t);this.context.defaultStyleRendererFactory=n,this.context.styleRendererFactory=n,this.addRenderingPlugin(new lf(e))},Nf.prototype.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory};var Cf,Lf=Nf;function Nf(t){void 0===t&&(t={});var e=Cf.call(this)||this;return e.options=t,e.name="canvas-renderer",e}Rf.prototype.apply=function(t,r){function i(t){e.hooks.pointerWheel.call(t)}function a(t){e.hooks.click.call(t)}var o=this,e=t.renderingService,n=t.renderingContext,s=t.config,l=(this.context=t,n.root.ownerDocument.defaultView),c=function(t){e.hooks.pointerMove.call(t)},u=function(t){e.hooks.pointerUp.call(t)},h=function(t){e.hooks.pointerDown.call(t)},f=function(t){e.hooks.pointerOver.call(t)},d=function(t){e.hooks.pointerOut.call(t)},p=function(t){e.hooks.pointerCancel.call(t)};e.hooks.init.tap(Rf.tag,function(){var t,e,n=o.context.contextService.getDomElement();r.globalThis.navigator.msPointerEnabled?(n.style.msContentZooming="none",n.style.msTouchAction="none"):l.supportsPointerEvents&&(n.style.touchAction="none"),l.supportsPointerEvents?(t=n,r.globalThis.document.addEventListener("pointermove",c,!0),t.addEventListener("pointerdown",h,!0),t.addEventListener("pointerleave",d,!0),t.addEventListener("pointerover",f,!0),r.globalThis.addEventListener("pointerup",u,!0),r.globalThis.addEventListener("pointercancel",p,!0)):(t=n,r.globalThis.document.addEventListener("mousemove",c,!0),t.addEventListener("mousedown",h,!0),t.addEventListener("mouseout",d,!0),t.addEventListener("mouseover",f,!0),r.globalThis.addEventListener("mouseup",u,!0)),l.supportsTouchEvents&&((e=n).addEventListener("touchstart",h,!0),e.addEventListener("touchend",u,!0),e.addEventListener("touchmove",c,!0),e.addEventListener("touchcancel",p,!0)),s.useNativeClickEvent&&n.addEventListener("click",a,!0),n.addEventListener("wheel",i,{passive:!0,capture:!0})}),e.hooks.destroy.tap(Rf.tag,function(){var t,e,n=o.context.contextService.getDomElement();r.globalThis.navigator.msPointerEnabled?(n.style.msContentZooming="",n.style.msTouchAction=""):l.supportsPointerEvents&&(n.style.touchAction=""),l.supportsPointerEvents?(t=n,r.globalThis.document.removeEventListener("pointermove",c,!0),t.removeEventListener("pointerdown",h,!0),t.removeEventListener("pointerleave",d,!0),t.removeEventListener("pointerover",f,!0),r.globalThis.removeEventListener("pointerup",u,!0)):(t=n,r.globalThis.document.removeEventListener("mousemove",c,!0),t.removeEventListener("mousedown",h,!0),t.removeEventListener("mouseout",d,!0),t.removeEventListener("mouseover",f,!0),r.globalThis.removeEventListener("mouseup",u,!0)),l.supportsTouchEvents&&((e=n).removeEventListener("touchstart",h,!0),e.removeEventListener("touchend",u,!0),e.removeEventListener("touchmove",c,!0),e.removeEventListener("touchcancel",p,!0)),s.useNativeClickEvent&&n.removeEventListener("click",a,!0),n.removeEventListener("wheel",i,!0)})},Rf.tag="DOMInteraction";var jf=Rf;function Rf(){}t(Df,If=e),Df.prototype.init=function(){this.addRenderingPlugin(new jf)},Df.prototype.destroy=function(){this.removeAllRenderingPlugins()};var If,Bf=Df;function Df(){var t=null!==If&&If.apply(this,arguments)||this;return t.name="dom-interaction",t}zf.prototype.joinTransformMatrix=function(t){return"matrix(".concat([t[0],t[1],t[4],t[5],t[12],t[13]].join(","),")")},zf.prototype.apply=function(t,i){function a(t,e){e.style.transform=l.joinTransformMatrix(t.getWorldTransform())}function e(t){var e,n,r=t.target;r.nodeName===k.HTML&&(l.$camera||(l.$camera=l.createCamera(c)),e=l.getOrCreateEl(r),l.$camera.appendChild(e),i.enableCSSParsing&&(n=r.ownerDocument.documentElement.attributes,Object.keys(n).forEach(function(t){e.style[t]=n[t]})),Object.keys(r.attributes).forEach(function(t){l.updateAttribute(t,r)}),a(r,e),l.context.nativeHTMLMap.set(e,r))}function n(t){(t=t.target).nodeName===k.HTML&&l.$camera&&(t=l.getOrCreateEl(t))&&(t.remove(),l.context.nativeHTMLMap.delete(t))}function r(t){var e=t.target;e.nodeName===k.HTML&&(t=t.attrName,l.updateAttribute(t,e))}function o(t){var e;(t=t.target).nodeName===k.HTML&&(e=l.getOrCreateEl(t),a(t,e))}function s(){var t,e;l.$camera&&(t=(e=l.context.config).width,e=e.height,l.$camera.style.width="".concat(t||0,"px"),l.$camera.style.height="".concat(e||0,"px"))}var l=this,c=t.camera,u=t.renderingContext,h=t.renderingService,f=(this.context=t,u.root.ownerDocument.defaultView);h.hooks.init.tap(zf.tag,function(){f.addEventListener(Qc.RESIZE,s),f.addEventListener(b.MOUNTED,e),f.addEventListener(b.UNMOUNTED,n),f.addEventListener(b.ATTR_MODIFIED,r),f.addEventListener(b.BOUNDS_CHANGED,o)}),h.hooks.endFrame.tap(zf.tag,function(){l.$camera&&u.renderReasons.has(Ml.CAMERA_CHANGED)&&(l.$camera.style.transform=l.joinTransformMatrix(c.getOrthoMatrix()))}),h.hooks.destroy.tap(zf.tag,function(){l.$camera&&l.$camera.remove(),f.removeEventListener(Qc.RESIZE,s),f.removeEventListener(b.MOUNTED,e),f.removeEventListener(b.UNMOUNTED,n),f.removeEventListener(b.ATTR_MODIFIED,r),f.removeEventListener(b.BOUNDS_CHANGED,o)})},zf.prototype.createCamera=function(t){var e,n,r=(a=this.context.config).document,i=a.width,a=a.height,o=this.context.contextService.getDomElement(),s=o.parentNode;return s?((n=s.querySelector("#"+(e="g-canvas-camera")))||((n=r=(r||document).createElement("div")).id=e,r.style.position="absolute",r.style.left="".concat(o.offsetLeft||0,"px"),r.style.top="".concat(o.offsetTop||0,"px"),r.style.transformOrigin="left top",r.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),r.style.overflow="hidden",r.style.pointerEvents="none",r.style.width="".concat(i||0,"px"),r.style.height="".concat(a||0,"px"),s.appendChild(r)),n):null},zf.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},zf.prototype.updateAttribute=function(t,e){var n=this.getOrCreateEl(e);switch(t){case"innerHTML":var r=e.parsedStyle.innerHTML;ze(r)?n.innerHTML=r:(n.innerHTML="",n.appendChild(r));break;case"transformOrigin":r=e.parsedStyle.transformOrigin;n.style["transform-origin"]="".concat(r[0].value," ").concat(r[1].value);break;case"width":this.context.enableCSSParsing?(i=e.computedStyleMap().get("width"),n.style.width=i.toString()):(i=e.parsedStyle.width,n.style.width=Ge(i)?"".concat(i,"px"):i.toString());break;case"height":this.context.enableCSSParsing?(a=e.computedStyleMap().get("height"),n.style.height=a.toString()):(a=e.parsedStyle.height,n.style.height=Ge(a)?"".concat(a,"px"):a.toString());break;case"zIndex":r=e.parsedStyle.zIndex;n.style["z-index"]="".concat(r);break;case"visibility":var i=e.parsedStyle.visibility;n.style.visibility=i;break;case"pointerEvents":var a=e.parsedStyle.pointerEvents;n.style.pointerEvents=a;break;case"opacity":r=e.parsedStyle.opacity;n.style.opacity="".concat(r);break;case"fill":i=e.parsedStyle.fill,a="";ya(i)?a=i.isNone?"transparent":e.getAttribute("fill"):Array.isArray(i)?a=e.getAttribute("fill"):ga(i),n.style.background=a;break;case"stroke":r=e.parsedStyle.stroke,i="";ya(r)?i=r.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(r)?i=e.getAttribute("stroke"):ga(r),n.style["border-color"]=i,n.style["border-style"]="solid";break;case"lineWidth":a=e.parsedStyle.lineWidth;n.style["border-width"]="".concat(a||0,"px");break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":r=e.style.filter;n.style.filter=r;break;default:"x"===t||"y"===t||P(e.style[t])||""===e.style[t]||(n.style[t]=e.style[t])}},zf.tag="HTMLRendering";var Ff=zf;function zf(){this.displayObjectHTMLElementMap=new WeakMap}t(Hf,Wf=e),Hf.prototype.init=function(){this.addRenderingPlugin(new Ff)},Hf.prototype.destroy=function(){this.removeAllRenderingPlugins()};var Wf,Gf=Hf;function Hf(){var t=null!==Wf&&Wf.apply(this,arguments)||this;return t.name="html-renderer",t}Yf.prototype.getImageSync=function(t,e){return this.imageCache[t]?e&&e():this.getOrCreateImage(t).then(function(){e&&e()}),this.imageCache[t]},Yf.prototype.getOrCreateImage=function(r){var i,a=this;return this.imageCache[r]?Promise.resolve(this.imageCache[r]):(i=this.canvasConfig.createImage,new Promise(function(t,e){var n;i?n=i(r):cs&&(n=new window.Image),n&&(n.onload=function(){a.imageCache[r]=n,t(n)},n.onerror=function(t){e(t)},n.crossOrigin="Anonymous",n.src=r)}))},Yf.prototype.getOrCreatePatternSync=function(t,e,n,r,i){var a,o,s,l,c=this.generatePatternKey(t);return c&&this.patternCache[c]?this.patternCache[c]:(a=t.image,o=t.repetition,t=t.transform,l=!1,ze(a)?s=this.getImageSync(a,i):n?(s=n,l=!0):s=a,(i=s&&e.createPattern(s,o))&&(n=void 0,n=t?Do(io(t),new tc({})):et(Z()),l&&ht(n,n,[1/r,1/r,1]),i.setTransform({a:n[0],b:n[1],c:n[4],d:n[5],e:n[12],f:n[13]})),c&&i&&(this.patternCache[c]=i),i)},Yf.prototype.getOrCreateGradient=function(t,e){var n,r,i,a,o,s=this.generateGradientKey(t),l=t.type,c=t.steps,u=t.width,h=t.height,f=t.angle,d=t.cx,p=t.cy,t=t.size;return this.gradientCache[s]||(n=null,l===ri.LinearGradient?(r=u,i=h,f=vr((f=f).value),a=0+r/2,o=0+i/2,r=Math.abs(r*Math.cos(f))+Math.abs(i*Math.sin(f)),i={x1:a-Math.cos(f)*r/2,y1:o-Math.sin(f)*r/2,x2:a+Math.cos(f)*r/2,y2:o+Math.sin(f)*r/2},n=e.createLinearGradient(i.x1,i.y1,i.x2,i.y2)):l===ri.RadialGradient&&(a=u,o=h,f=p,r=t,l=(i=d).value,u=f.value,i.unit===g.kPercentage&&(l=i.value/100*a),f.unit===g.kPercentage&&(u=f.value/100*o),i=Math.max(xe([0,0],[l,u]),xe([0,o],[l,u]),xe([a,o],[l,u]),xe([a,0],[l,u])),r&&(r instanceof xi?i=r.value:r instanceof ui&&("closest-side"===r.value?i=Math.min(l,a-l,u,o-u):"farthest-side"===r.value?i=Math.max(l,a-l,u,o-u):"closest-corner"===r.value&&(i=Math.min(xe([0,0],[l,u]),xe([0,o],[l,u]),xe([a,o],[l,u]),xe([a,0],[l,u]))))),n=e.createRadialGradient(p=(h={x:l,y:u,r:i}).x,t=h.y,0,p,t,h.r)),n&&(c.forEach(function(t){var e=t.offset,t=t.color;e.unit===g.kPercentage&&null!=n&&n.addColorStop(e.value/100,t.toString())}),this.gradientCache[s]=n)),this.gradientCache[s]},Yf.prototype.generateGradientKey=function(t){var e=t.type,n=t.width,r=t.height,i=t.steps,a=t.angle,o=t.cx,s=t.cy,t=t.size;return"gradient-".concat(e,"-").concat((null==a?void 0:a.toString())||0,"-").concat((null==o?void 0:o.toString())||0,"-").concat((null==s?void 0:s.toString())||0,"-").concat((null==t?void 0:t.toString())||0,"-").concat(n,"-").concat(r,"-").concat(i.map(function(t){var e=t.offset,t=t.color;return"".concat(e).concat(t)}).join("-"))},Yf.prototype.generatePatternKey=function(t){var e=t.image,t=t.repetition;return ze(e)?"pattern-".concat(e,"-").concat(t):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(t):void 0};var Vf=Yf;function Yf(t){this.canvasConfig=t,this.imageCache={},this.gradientCache={},this.patternCache={}}$f.prototype.apply=function(t){function e(t){var e=t.target,t=e.nodeName,n=e.attributes;t===k.IMAGE&&(t=n.img,ze(t))&&a.getImageSync(t,function(){e.renderable.dirty=!0,r.dirtify()})}function n(t){var e=t.target,n=t.attrName,t=t.newValue;e.nodeName===k.IMAGE&&"img"===n&&ze(t)&&a.getOrCreateImage(t).then(function(){e.renderable.dirty=!0,r.dirtify()})}var r=t.renderingService,i=t.renderingContext,a=t.imagePool,o=i.root.ownerDocument.defaultView;r.hooks.init.tap($f.tag,function(){o.addEventListener(b.MOUNTED,e),o.addEventListener(b.ATTR_MODIFIED,n)}),r.hooks.destroy.tap($f.tag,function(){o.removeEventListener(b.MOUNTED,e),o.removeEventListener(b.ATTR_MODIFIED,n)})},$f.tag="LoadImage";var qf=$f;function $f(){}t(Kf,Uf=e),Kf.prototype.init=function(){this.context.imagePool=new Vf(this.context.config),this.addRenderingPlugin(new qf)},Kf.prototype.destroy=function(){this.removeAllRenderingPlugins()};var Uf,Xf=Kf;function Kf(){var t=null!==Uf&&Uf.apply(this,arguments)||this;return t.name="image-loader",t}Qf.prototype.init=function(){var t=this.canvasConfig,e=t.container,t=t.canvas;t?(this.$canvas=t,e&&t.parentElement!==e&&e.appendChild(t),this.$container=t.parentElement,this.canvasConfig.container=this.$container):e&&(this.$container=ze(e)?document.getElementById(e):e,this.$container)&&(t=document.createElement("canvas"),this.$container.appendChild(t),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=t),this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)},Qf.prototype.getContext=function(){return this.context},Qf.prototype.getDomElement=function(){return this.$canvas},Qf.prototype.getDPR=function(){return this.dpr},Qf.prototype.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},Qf.prototype.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},Qf.prototype.resize=function(t,e){var n=1<=(n=this.canvasConfig.devicePixelRatio||cs&&window.devicePixelRatio||1)?Math.ceil(n):1;this.dpr=n,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*e,n=this.$canvas,t=t,e=e,cs)&&n.style&&(n.style.width=t+"px",n.style.height=e+"px"),this.renderingContext.renderReasons.add(Ml.CAMERA_CHANGED)},Qf.prototype.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},Qf.prototype.toDataURL=function(r){return void 0===r&&(r={}),X(this,void 0,void 0,function(){var e,n;return R(this,function(t){return e=r.type,n=r.encoderOptions,[2,this.context.canvas.toDataURL(e,n)]})})};var Zf=Qf;function Qf(t){this.renderingContext=t.renderingContext,this.canvasConfig=t.config}t(ed,Jf=e),ed.prototype.init=function(){this.context.ContextService=Zf},ed.prototype.destroy=function(){delete this.context.ContextService};var Jf,td=ed;function ed(){var t=null!==Jf&&Jf.apply(this,arguments)||this;return t.name="canvas-context-register",t}t(id,nd=fn);var nd,rd=id;function id(t){t=nd.call(this,t)||this;return t.registerPlugin(new td),t.registerPlugin(new Xf),t.registerPlugin(new Nh),t.registerPlugin(new Lf),t.registerPlugin(new Bf),t.registerPlugin(new of),t.registerPlugin(new Gf),t}od.prototype.apply=function(t){function e(t){var a,o,s,l,c,e,u=t.target,h=u===d,f=h&&n.dragndropPluginOptions.isDocumentDraggable?d:u.closest&&u.closest("[draggable=true]");f&&(a=!1,o=t.timeStamp,s=[t.clientX,t.clientY],l=null,c=[t.clientX,t.clientY],i.addEventListener("pointermove",e=function(i){return X(n,void 0,void 0,function(){var e,n,r;return R(this,function(t){switch(t.label){case 0:if(!a){if(e=i.timeStamp-o,n=xe([i.clientX,i.clientY],s),e<=this.dragndropPluginOptions.dragstartTimeThreshold||n<=this.dragndropPluginOptions.dragstartDistanceThreshold)return[2];i.type="dragstart",f.dispatchEvent(i),a=!0}return(i.type="drag",i.dx=i.clientX-c[0],i.dy=i.clientY-c[1],f.dispatchEvent(i),c=[i.clientX,i.clientY],h)?[3,2]:(e="pointer"===this.dragndropPluginOptions.overlap?[i.canvasX,i.canvasY]:u.getBounds().center,[4,d.elementsFromPoint(e[0],e[1])]);case 1:n=t.sent(),r=n[n.indexOf(u)+1],r=(null==r?void 0:r.closest("[droppable=true]"))||(this.dragndropPluginOptions.isDocumentDroppable?d:null),l!==r&&(l&&(i.type="dragleave",(i.target=l).dispatchEvent(i)),r&&(i.type="dragenter",(i.target=r).dispatchEvent(i)),l=r)&&(i.type="dragover",(i.target=l).dispatchEvent(i)),t.label=2;case 2:return[2]}})})}),u.addEventListener("pointerup",t=function(t){a&&(t.detail={preventClick:!0},t=t.clone(),l&&(t.type="drop",(t.target=l).dispatchEvent(t)),t.type="dragend",f.dispatchEvent(t),a=!1),i.removeEventListener("pointermove",e)},{once:!0}),u.addEventListener("pointerupoutside",t,{once:!0}))}var n=this,r=t.renderingService,d=t.renderingContext.root.ownerDocument,i=d.defaultView;r.hooks.init.tap(od.tag,function(){i.addEventListener("pointerdown",e)}),r.hooks.destroy.tap(od.tag,function(){i.removeEventListener("pointerdown",e)})},od.tag="Dragndrop";var ad=od;function od(t){this.dragndropPluginOptions=t}t(cd,sd=e),cd.prototype.init=function(){this.addRenderingPlugin(new ad(m({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))},cd.prototype.destroy=function(){this.removeAllRenderingPlugins()},cd.prototype.setOptions=function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)};var sd,ld=cd;function cd(t){void 0===t&&(t={});var e=sd.call(this)||this;return e.options=t,e.name="dragndrop",e}hd.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},hd.prototype.once=function(t,e){return this.on(t,e,!0)},hd.prototype.emit=function(a){for(var o=this,s=[],t=1;t<arguments.length;t++)s[t-1]=arguments[t];function e(t){for(var e,n,r=t.length,i=0;i<r;i++)t[i]&&(n=(e=t[i]).callback,e.once&&(t.splice(i,1),0===t.length&&delete o._events[a],r--,i--),n.apply(o,s))}var n=this._events[a]||[],r=this._events["*"]||[];e(n),e(r)},hd.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},hd.prototype.getEvents=function(){return this._events};var ud=hd;function hd(){this._events={}}function fd(t,e){return null==t||null==e?NaN:t<e?-1:e<t?1:e<=t?0:NaN}function dd(n){let a,o,i;function s(t,e,n=0,r=t.length){if(n<r){if(0!==a(e,e))return r;do{var i=n+r>>>1;o(t[i],e)<0?n=1+i:r=i}while(n<r)}return n}return i=2!==n.length?(a=fd,o=(t,e)=>fd(n(t),e),(t,e)=>n(t)-e):(a=n===fd||n===function(t,e){return null==t||null==e?NaN:e<t?-1:t<e?1:t<=e?0:NaN}?n:pd,o=n),{left:s,center:function(t,e,n=0,r=t.length){return r=s(t,e,n,r-1),n<r&&i(t[r-1],e)>-i(t[r],e)?r-1:r},right:function(t,e,n=0,r=t.length){if(n<r){if(0!==a(e,e))return r;do{var i=n+r>>>1;o(t[i],e)<=0?n=1+i:r=i}while(n<r)}return n}}}function pd(){return 0}function gd(t){return null===t?NaN:+t}ii=dd(fd);const yd=ii.right,md=ii.left,vd=dd(gd).center;function bd(e,n){let r=0;if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&++r;else{let t=-1;for(var i of e)null!=(i=n(i,++t,e))&&(i=+i)>=i&&++r}return r}function xd(t,e){t=function(e,n){let r=0,i,a=0,o=0;if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&(i=t-a,a+=i/++r,o+=i*(t-a));else{let t=-1;for(var s of e)null!=(s=n(s,++t,e))&&(s=+s)>=s&&(i=s-a,a+=i/++r,o+=i*(s-a))}if(1<r)return o/(r-1)}(t,e);return t&&Math.sqrt(t)}function wd(e,n){let r,i;if(void 0===n)for(const t of e)null!=t&&(void 0===r?t>=t&&(r=i=t):(r>t&&(r=t),i<t&&(i=t)));else{let t=-1;for(var a of e)null!=(a=n(a,++t,e))&&(void 0===r?a>=a&&(r=i=a):(r>a&&(r=a),i<a&&(i=a)))}return[r,i]}class Md{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){var n=this._partials;let r=0;for(let t=0;t<this._n&&t<32;t++){var i=n[t],a=e+i,i=Math.abs(e)<Math.abs(i)?e-(a-i):i-(a-e);i&&(n[r++]=i),e=a}return n[r]=e,this._n=r+1,this}valueOf(){var t=this._partials;let e=this._n,n,r,i,a=0;if(0<e){for(a=t[--e];0<e&&(n=a,r=t[--e],a=n+r,!(i=r-(a-n))););0<e&&(i<0&&t[e-1]<0||0<i&&0<t[e-1])&&(r=2*i,n=a+r,r==n-a)&&(a=n)}return a}}class Od extends Map{constructor(t,e=function(t){return null!==t&&"object"==typeof t?t.valueOf():t}){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(kd(this,t))}has(t){return super.has(kd(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){e=e(n);return t.has(e)?t.get(e):(t.set(e,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){e=e(n);t.has(e)&&(n=t.get(e),t.delete(e));return n}(this,t))}}function kd({_intern:t,_key:e},n){e=e(n);return t.has(e)?t.get(e):n}function Ed(t){return t}function Sd(t,...e){return Pd(t,Ed,Ed,e)}function Ad(t,...e){return Pd(t,Array.from,Ed,e)}function _d(t,e,...n){return Pd(t,Ed,e,n)}function Td(t,e,...n){return Pd(t,Array.from,e,n)}function Pd(t,u,h,f){return function t(e,n){if(n>=f.length)return h(e);var r=new Od,i=f[n++];let a=-1;for(const l of e){var o=i(l,++a,e),s=r.get(o);s?s.push(l):r.set(o,[l])}for(const[c,e]of r)r.set(c,t(e,n));return u(r)}(t,0)}function Cd(e,...i){if("function"!=typeof e[Symbol.iterator])throw new TypeError("values is not iterable");e=Array.from(e);let[n]=i;var t,r;return n&&2!==n.length||1<i.length?(t=Uint32Array.from(e,(t,e)=>e),1<i.length?(i=i.map(t=>e.map(t)),t.sort((t,e)=>{for(const r of i){var n=Nd(r[t],r[e]);if(n)return n}})):(n=e.map(n),t.sort((t,e)=>Nd(n[t],n[e]))),r=e,Array.from(t,t=>r[t])):e.sort(Ld(n))}function Ld(r=fd){if(r===fd)return Nd;if("function"!=typeof r)throw new TypeError("compare is not a function");return(t,e)=>{var n=r(t,e);return n||0===n?n:(0===r(e,e))-(0===r(t,t))}}function Nd(t,e){return(null==t||!(t<=t))-(null==e||!(e<=e))||(t<e?-1:e<t?1:0)}var jd=Array.prototype.slice;function Rd(t){return()=>t}const Id=Math.sqrt(50),Bd=Math.sqrt(10),Dd=Math.sqrt(2);function Fd(t,e,n){var r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),r=r/Math.pow(10,i),r=r>=Id?10:r>=Bd?5:r>=Dd?2:1;let a,o,s;return i<0?(s=Math.pow(10,-i)/r,a=Math.round(t*s),o=Math.round(e*s),a/s<t&&++a,o/s>e&&--o,s=-s):(s=Math.pow(10,i)*r,a=Math.round(t/s),o=Math.round(e/s),a*s<t&&++a,o*s>e&&--o),o<a&&.5<=n&&n<2?Fd(t,e,2*n):[a,o,s]}function zd(t,e,n){return Fd(t=+t,e=+e,n=+n)[2]}function Wd(t){return Math.max(1,Math.ceil(Math.log(bd(t))/Math.LN2)+1)}function Gd(){var m=Ed,v=wd,b=Wd;function e(t){for(var e,n,r=(t=Array.isArray(t)?t:Array.from(t)).length,i=new Array(r),a=0;a<r;++a)i[a]=m(t[a],a,t);var o=v(i),s=o[0],l=o[1],c=b(i,s,l);if(!Array.isArray(c)){var o=l,u=+c;if(v===wd&&([s,l]=function(t,e,n){let r;for(;;){var i=zd(t,e,n);if(i===r||0===i||!isFinite(i))return[t,e];0<i?(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}}(s,l,u)),(c=function(t,e,n){if(!(0<(n=+n)))return[];if((t=+t)===(e=+e))return[t];var r=e<t,[i,a,o]=r?Fd(e,t,n):Fd(t,e,n);if(!(i<=a))return[];var s=a-i+1,l=new Array(s);if(r)if(o<0)for(let t=0;t<s;++t)l[t]=(a-t)/-o;else for(let t=0;t<s;++t)l[t]=(a-t)*o;else if(o<0)for(let t=0;t<s;++t)l[t]=(i+t)/-o;else for(let t=0;t<s;++t)l[t]=(i+t)*o;return l}(s,l,u))[0]<=s&&(n=zd(s,l,u)),c[c.length-1]>=l)if(l<=o&&v===wd){const n=zd(s,l,u);isFinite(n)&&(0<n?l=(Math.floor(l/n)+1)*n:n<0&&(l=(Math.ceil(l*-n)+1)/-n))}else c.pop()}for(var h=c.length,f=0,d=h;c[f]<=s;)++f;for(;c[d-1]>l;)--d;(f||d<h)&&(c=c.slice(f,d),h=d-f);var p,g,y=new Array(h+1);for(a=0;a<=h;++a)(p=y[a]=[]).x0=0<a?c[a-1]:s,p.x1=a<h?c[a]:l;if(isFinite(n)){if(0<n)for(a=0;a<r;++a)null!=(e=i[a])&&s<=e&&e<=l&&y[Math.min(h,Math.floor((e-s)/n))].push(t[a]);else if(n<0)for(a=0;a<r;++a)null!=(e=i[a])&&s<=e&&e<=l&&(g=Math.floor((s-e)*n),y[Math.min(h,g+(c[g]<=e))].push(t[a]))}else for(a=0;a<r;++a)null!=(e=i[a])&&s<=e&&e<=l&&y[yd(c,e,0,h)].push(t[a]);return y}return e.value=function(t){return arguments.length?(m="function"==typeof t?t:Rd(t),e):m},e.domain=function(t){return arguments.length?(v="function"==typeof t?t:Rd([t[0],t[1]]),e):v},e.thresholds=function(t){return arguments.length?(b="function"==typeof t?t:Rd(Array.isArray(t)?jd.call(t):t),e):b},e}function Hd(e,n){let r;if(void 0===n)for(const t of e)null!=t&&(r<t||void 0===r&&t>=t)&&(r=t);else{let t=-1;for(var i of e)null!=(i=n(i,++t,e))&&(r<i||void 0===r&&i>=i)&&(r=i)}return r}function Vd(t,e){let n,r=-1,i=-1;if(void 0===e)for(const o of t)++i,null!=o&&(n<o||void 0===n&&o>=o)&&(n=o,r=i);else for(var a of t)null!=(a=e(a,++i,t))&&(n<a||void 0===n&&a>=a)&&(n=a,r=i);return r}function Yd(e,n){let r;if(void 0===n)for(const t of e)null!=t&&(r>t||void 0===r&&t>=t)&&(r=t);else{let t=-1;for(var i of e)null!=(i=n(i,++t,e))&&(r>i||void 0===r&&i>=i)&&(r=i)}return r}function qd(t,e){let n,r=-1,i=-1;if(void 0===e)for(const o of t)++i,null!=o&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);else for(var a of t)null!=(a=e(a,++i,t))&&(n>a||void 0===n&&a>=a)&&(n=a,r=i);return r}function $d(n,r,i=0,a=1/0,o){if(r=Math.floor(r),i=Math.floor(Math.max(0,i)),a=Math.floor(Math.min(n.length-1,a)),i<=r&&r<=a)for(o=void 0===o?Nd:Ld(o);i<a;){600<a-i&&(s=a-i+1,l=r-i+1,u=Math.log(s),c=.5*Math.exp(2*u/3),u=.5*Math.sqrt(u*c*(s-c)/s)*(l-s/2<0?-1:1),$d(n,r,Math.max(i,Math.floor(r-l*c/s+u)),Math.min(a,Math.floor(r+(s-l)*c/s+u)),o));var s,l,c,u,h=n[r];let t=i,e=a;for(Ud(n,i,r),0<o(n[a],h)&&Ud(n,i,a);t<e;){for(Ud(n,t,e),++t,--e;o(n[t],h)<0;)++t;for(;0<o(n[e],h);)--e}0===o(n[i],h)?Ud(n,i,e):Ud(n,++e,a),e<=r&&(i=e+1),r<=e&&(a=e-1)}return n}function Ud(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Xd(t,e,n){var r;if((n=(t=Float64Array.from(function*(e,n){if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&(yield t);else{let t=-1;for(var r of e)null!=(r=n(r,++t,e))&&(r=+r)>=r&&(yield r)}}(t,n))).length)&&!isNaN(e=+e))return e<=0||n<2?Yd(t):1<=e?Hd(t):(n=(n-1)*e,(r=Hd($d(t,e=Math.floor(n)).subarray(0,e+1)))+(Yd(t.subarray(e+1))-r)*(n-e))}function Kd(n,t,r=gd){var i,e,a;if(!isNaN(t=+t))return i=Float64Array.from(n,(t,e)=>gd(r(n[e],e,n))),t<=0?qd(i):1<=t?Vd(i):(e=Uint32Array.from(n,(t,e)=>e),a=i.length-1,$d(e,t=Math.floor(a*t),0,a,(t,e)=>Nd(i[t],i[e])),0<=(t=function(e,n){let r,i=!1;if(1===n.length){let t;for(const o of e){var a=n(o);(i?0<fd(a,t):0===fd(a,a))&&(r=o,t=a,i=!0)}}else for(const t of e)(i?0<n(t,r):0===n(t,t))&&(r=t,i=!0);return r}(e.subarray(0,t+1),t=>i[t]))?t:-1)}function Zd(e,n){let r=0,i=0;if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&(++r,i+=t);else{let t=-1;for(var a of e)null!=(a=n(a,++t,e))&&(a=+a)>=a&&(++r,i+=a)}if(r)return i/r}function Qd(t,e){return Xd(t,.5,e)}function Jd(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function tp(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),a=new Array(i);++r<i;)a[r]=t+r*n;return a}function ep(e,n){let r=0;if(void 0===n)for(var t of e)(t=+t)&&(r+=t);else{let t=-1;for(var i of e)(i=+n(i,++t,e))&&(r+=i)}return r}function np(t){return t}function rp(t){return t.reduce((n,r)=>(t,...e)=>r(n(t,...e),...e),np)}function ip(t){return t.replace(/( |^)[a-z]/g,t=>t.toUpperCase())}function ap(t=""){throw new Error(t)}function op(t,e){var n,r,e=e["attributes"],i=new Set(["id","className"]);for([n,r]of Object.entries(e))i.has(n)||t.attr(n,r)}function sp(t){return null!=t&&!Number.isNaN(t)}function st(t,e){return lp(t,e)||{}}function lp(t,n){t=Object.entries(t||{}).filter(([t])=>t.startsWith(n)).map(([t,e])=>[qe(t.replace(n,"").trim()),e]).filter(([t])=>!!t);return 0===t.length?null:Object.fromEntries(t)}function cp(t,...n){return Object.fromEntries(Object.entries(t).filter(([e])=>n.every(t=>!e.startsWith(t))))}function up(t,e){return void 0===t?null:"number"==typeof t?t:(t=+t.replace("%",""),Number.isNaN(t)?null:t/100*e)}function hp(t){return!("object"!=typeof t||t instanceof Date||null===t||Array.isArray(t))}function fp(t){return null===t||!1===t}function lt(t){return new dp([t],null,t,t.ownerDocument)}class dp{constructor(t=null,e=null,n=null,r=null,i=[null,null,null,null,null],a=[],o=[]){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=a,this._facetElements=o}selectAll(t){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new dp(t,null,this._elements[0],this._document)}selectFacetAll(t){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new dp(this._elements,null,this._parent,this._document,void 0,void 0,t)}select(t){t="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new dp([t],null,t,this._document)}append(t){var e="function"==typeof t?t:()=>this.createElement(t),n=[];if(null!==this._data){for(let t=0;t<this._data.length;t++){var r=this._data[t],[r,i]=Array.isArray(r)?r:[r,null],a=e(r,t);a.__data__=r,null!==i&&(a.__fromElements__=i),this._parent.appendChild(a),n.push(a)}return new dp(n,null,this._parent,this._document)}for(let t=0;t<this._elements.length;t++){var o=this._elements[t],s=e(o.__data__,t);o.appendChild(s),n.push(s)}return new dp(n,null,n[0],this._document)}maybeAppend(t,e,n){var r=this._elements[0],i=r.getElementById(t);return i||((i="string"==typeof e?this.createElement(e):e()).id=t,n&&(i.className=n),r.appendChild(i)),new dp([i],null,this._parent,this._document)}data(e,n=t=>t,r=()=>null){var i=[],a=[],o=new Set(this._elements),s=[],l=new Set,c=new Map(this._elements.map((t,e)=>[n(t.__data__,e),t])),u=new Map(this._facetElements.map((t,e)=>[n(t.__data__,e),t])),h=Sd(this._elements,t=>r(t.__data__));for(let t=0;t<e.length;t++){var f=e[t],d=n(f,t),p=r(f,t);if(c.has(d)){var g=c.get(d);g.__data__=f,g.__facet__=!1,a.push(g),o.delete(g),c.delete(d)}else if(u.has(d)){g=u.get(d);g.__data__=f,g.__facet__=!0,a.push(g),u.delete(d)}else if(h.has(d)){const Sd=h.get(d);s.push([f,Sd]);for(const y of Sd)o.delete(y);h.delete(d)}else c.has(p)?((d=c.get(p)).__toData__?d.__toData__.push(f):d.__toData__=[f],l.add(d),o.delete(d)):i.push(f)}var t=[new dp([],i,this._parent,this._document),new dp(a,null,this._parent,this._document),new dp(o,null,this._parent,this._document),new dp([],s,this._parent,this._document),new dp(l,null,this._parent,this._document)];return new dp(this._elements,null,this._parent,this._document,t)}merge(t){var e=[...this._elements,...t._elements],t=[...this._transitions,...t._transitions];return new dp(e,null,this._parent,this._document,void 0,t)}createElement(t){var e;return this._document?this._document.createElement(t,{}):(e=dp.registry[t])?new e:ap("Unknown node type: "+t)}join(t=t=>t,e=t=>t,n=t=>t.remove(),r=t=>t,i=t=>t.remove()){t=t(this._enter),e=e(this._update),n=n(this._exit),r=r(this._merge),i=i(this._split);return e.merge(t).merge(n).merge(r).merge(i)}remove(){for(let t=0;t<this._elements.length;t++){var e=this._transitions[t];e?(e=Array.isArray(e)?e:[e],Promise.all(e.map(t=>t.finished)).then(()=>{this._elements[t].remove()})):this._elements[t].remove()}return new dp([],null,this._parent,this._document,void 0,this._transitions)}each(e){for(let t=0;t<this._elements.length;t++){var n=this._elements[t],r=n.__data__;e.call(n,r,t)}return this}attr(n,r){const i="function"!=typeof r?()=>r:r;return this.each(function(t,e){void 0!==r&&(this[n]=i.call(this,t,e))})}style(n,r){const i="function"!=typeof r?()=>r:r;return this.each(function(t,e){void 0!==r&&(this.style[n]=i.call(this,t,e))})}transition(t){const n="function"!=typeof t?()=>t:t,r=this["_transitions"];return this.each(function(t,e){r[e]=n.call(this,t,e)})}on(t,e){return this.each(function(){this.addEventListener(t,e)}),this}call(t,...e){return t.call(this._parent,this,...e),this}node(){return this._elements[0]}nodes(){return this._elements}transitions(){return this._transitions}parent(){return this._parent}}dp.registry={g:fc,rect:Nc,circle:rc,path:kc,text:Ic,ellipse:cc,image:vc,line:wc,polygon:Ac,polyline:Pc,html:gc};const pp=new Proxy({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"},{get(t,e){if(e in t)return t[e]},set(){return!0}});function gp(t,e){var n;return(e=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0?null:[1<(n=t.slice(0,e)).length?n[0]+n.slice(2):n,+t.slice(e+1)]}var yp,mp=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function vp(t){var e;if(e=mp.exec(t))return new bp({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]});throw new Error("invalid format: "+t)}function bp(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 xp(t,e){var n,e=gp(t,e);return e?(n=e[0],(e=e[1])<0?"0."+new Array(-e).join("0")+n:n.length>e+1?n.slice(0,e+1)+"."+n.slice(e+1):n+new Array(e-n.length+2).join("0")):t+""}vp.prototype=bp.prototype,bp.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 wp={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return 1e21<=Math.abs(t=Math.round(t))?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)=>xp(100*t,e),r:xp,s:function(t,e){var n,r,i=gp(t,e);return i?(n=i[0],(i=(i=i[1])-(yp=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1)===(r=n.length)?n:r<i?n+new Array(i-r+1).join("0"):0<i?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+gp(t,Math.max(0,e+i-1))[0]):t+""},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Mp(t){return t}var Op,kp=Array.prototype.map,Ep=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Sp(t){var e,s,l,M=void 0===t.grouping||void 0===t.thousands?Mp:(s=kp.call(t.grouping,Number),l=t.thousands+"",function(t,e){for(var n=t.length,r=[],i=0,a=s[0],o=0;0<n&&0<a&&(e<o+a+1&&(a=Math.max(1,e-o)),r.push(t.substring(n-=a,n+a)),!((o+=a+1)>e));)a=s[i=(i+1)%s.length];return r.reverse().join(l)}),r=void 0===t.currency?"":t.currency[0]+"",i=void 0===t.currency?"":t.currency[1]+"",O=void 0===t.decimal?".":t.decimal+"",k=void 0===t.numerals?Mp:(e=kp.call(t.numerals,String),function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}),a=void 0===t.percent?"%":t.percent+"",E=void 0===t.minus?"−":t.minus+"",S=void 0===t.nan?"NaN":t.nan+"";function o(t){var c=(t=vp(t)).fill,u=t.align,h=t.sign,e=t.symbol,f=t.zero,d=t.width,p=t.comma,g=t.precision,y=t.trim,m=t.type,v=("n"===m?(p=!0,m="g"):wp[m]||(void 0===g&&(g=12),y=!0,m="g"),(f||"0"===c&&"="===u)&&(f=!0,c="0",u="="),"$"===e?r:"#"===e&&/[boxX]/.test(m)?"0"+m.toLowerCase():""),b="$"===e?i:/[%p]/.test(m)?a:"",x=wp[m],w=/[defgprs%]/.test(m);function n(t){var e,n,r,i=v,a=b;if("c"===m)a=x(t)+a,t="";else{var o=(t=+t)<0||1/t<0;if(t=isNaN(t)?S:x(Math.abs(t),g),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;0<i&&(i=0)}return 0<i?t.slice(0,i)+t.slice(e+1):t}(t)),i=((o=o&&0==+t&&"+"!==h?!1:o)?"("===h?h:E:"-"===h||"("===h?"":h)+i,a=("s"===m?Ep[8+yp/3]:"")+a+(o&&"("===h?")":""),w)for(e=-1,n=t.length;++e<n;)if((r=t.charCodeAt(e))<48||57<r){a=(46===r?O+t.slice(e+1):t.slice(e))+a,t=t.slice(0,e);break}}p&&!f&&(t=M(t,1/0));var s=i.length+t.length+a.length,l=s<d?new Array(d-s+1).join(c):"";switch(p&&f&&(t=M(l+t,l.length?d-a.length:1/0),l=""),u){case"<":t=i+t+a+l;break;case"=":t=i+l+t+a;break;case"^":t=l.slice(0,s=l.length>>1)+i+t+a+l.slice(s);break;default:t=l+i+t+a}return k(t)}return g=void 0===g?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),n.toString=function(){return t+""},n}return{format:o,formatPrefix:function(t,e){var n=o(((t=vp(t)).type="f",t)),e=3*Math.max(-8,Math.min(8,Math.floor((t=e,((t=gp(Math.abs(t)))?t[1]:NaN)/3)))),r=Math.pow(10,-e),i=Ep[8+e/3];return function(t){return n(r*t)+i}}}}function Ap(r,i){return Object.entries(r).reduce((t,[e,n])=>(t[e]=i(n,e,r),t),{})}function _p(t){return t.map((t,e)=>e)}function Tp(t){return t[t.length-1]}function Pp(t,e){const n=[[],[]];return t.forEach(t=>{n[e(t)?0:1].push(t)}),n}function Cp(n,t=n.length){if(1===t)return n.map(t=>[t]);const r=[];for(let e=0;e<n.length;e++)Cp(n.slice(e+1),t-1).forEach(t=>{r.push([n[e],...t])});return r}o=Sp({thousands:",",grouping:[3],currency:["$",""]}),Op=o.format,o.formatPrefix;const Lp=()=>[["cartesian"]],Np=(Lp.props={},(t={})=>{var e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)}),jp=t=>{var{startAngle:t,endAngle:e,innerRadius:n,outerRadius:r}=Np(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",t,e,n,r]]},Rp=(jp.props={},({startAngle:t=0,endAngle:e=6*Math.PI,innerRadius:n=0,outerRadius:r=1})=>[["translate",.5,.5],["reflect.y"],["translate",-.5,-.5],["helix",t,e,n,r]]),Ip=(Rp.props={},()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]]),Bp=(Ip.props={transform:!0},t=>{[t={}]=[t],e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};var{startAngle:e,endAngle:t,innerRadius:n,outerRadius:r}=Object.assign(Object.assign({},e),t);return[...Ip(),...jp({startAngle:e,endAngle:t,innerRadius:n,outerRadius:r})]}),Dp=(Bp.props={},(t={})=>{var e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)}),Fp=t=>{var{startAngle:t,endAngle:e,innerRadius:n,outerRadius:r}=Dp(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...jp({startAngle:t,endAngle:e,innerRadius:n,outerRadius:r})]},zp=(Fp.props={},()=>[["parallel",0,1,0,1]]),Wp=(zp.props={},({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]]),Gp=(Wp.props={transform:!0},t=>{var{startAngle:t=-Math.PI/2,endAngle:e=3*Math.PI/2,innerRadius:n=0,outerRadius:r=1}=t;return[...zp(),...jp({startAngle:t,endAngle:e,innerRadius:n,outerRadius:r})]}),Hp=(Gp.props={},[["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 Vp(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)}function Yp(t){return Up(t,"Function")}function qp(t){return null==t}var $p={}.toString,Up=function(t,e){return $p.call(t)==="[object "+e+"]"},Xp=function(t){return Array.isArray?Array.isArray(t):Up(t,"Array")};var Kp=function(t){if("object"!=typeof(e=t)||null===e||!Up(t,"Object"))return!1;var e;if(null===Object.getPrototypeOf(t))return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(t)===n},Zp=function(t){return Up(t,"Number")},Qp=Object.values?function(t){return Object.values(t)}:function(n){var t,r=[],e=n,i=function(t,e){Yp(n)&&"prototype"===e||r.push(t)};if(e)if(Xp(e))for(var a=0,o=e.length;a<o&&!1!==i(e[a],a);a++);else if(t=typeof e,null!==e&&"object"==t||"function"==t)for(var s in e)if(e.hasOwnProperty(s)&&!1===i(e[s],s))break;return r},Jp=5;function t0(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)!function t(e,n,r,i){for(var a in r=r||0,i=i||Jp,n){var o;n.hasOwnProperty(a)&&(null!==(o=n[a])&&Kp(o)?(Kp(e[a])||(e[a]={}),r<i?t(e[a],o,r+1,i):e[a]=n[a]):Xp(o)?(e[a]=[],e[a]=e[a].concat(o)):void 0!==o&&(e[a]=o))}}(t,e[r]);return t}function e0(t){return t}var n0,r0=function(t,e){if(!Vp(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};function i0(t){return qp(t)?0:(Vp(t)?t:Object.keys(t)).length}!function(a,o){var s;if(Yp(a))return(s=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,r=o?o.apply(this,t):t[0],i=s.cache;return i.has(r)?i.get(r):(n=a.apply(this,t),i.set(r,n),n)}).cache=new Map;throw new TypeError("Expected a function")}(function(t,e){var n=(e=void 0===e?{}:e).fontSize,r=e.fontFamily,i=e.fontWeight,a=e.fontStyle,e=e.fontVariant;return(n0=n0||document.createElement("canvas").getContext("2d")).font=[a,e,i,n+"px",r].join(" "),n0.measureText(Up(t,"String")?t:"").width},function(t,e){return function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var r=Array(t),i=0,e=0;e<n;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}([t],Qp(e=void 0===e?{}:e)).join("")});var a0=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},o0=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||((r=r||Array.prototype.slice.call(e,0,i))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function s0(t,e,n){for(;t<e;)t+=2*Math.PI;for(;n<t;)t-=2*Math.PI;return t}function l0(t,e,n,r,i){var a=(t=c0(t,2))[0],t=t[1],o=U();return a=[a,t],(t=o)[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=a[0],t[7]=a[1],t[8]=1,t}var c0=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o};function u0(t,...e){return e.reduce((e,n)=>t=>e(n(t)),t)}function h0(e,n){return n-e?t=>(t-e)/(n-e):t=>.5}function f0(t,e,n,r,i){let a=n||0,o=r||t.length;for(var s=i||(t=>t);a<o;){var l=Math.floor((a+o)/2);s(t[l])>e?o=l:a=l+1}return a}const d0=Math.sqrt(50),p0=Math.sqrt(10),g0=Math.sqrt(2);function y0(t,e,n){e=(e-t)/Math.max(0,n),t=Math.floor(Math.log(e)/Math.LN10),n=e/10**t;return 0<=t?(n>=d0?10:n>=p0?5:n>=g0?2:1)*10**t:-(10**-t)/(n>=d0?10:n>=p0?5:n>=g0?2:1)}function m0(t,e,n){n=Math.abs(e-t)/Math.max(0,n);let r=10**Math.floor(Math.log(n)/Math.LN10);n/=r;return n>=d0?r*=10:n>=p0?r*=5:n>=g0&&(r*=2),e<t?-r:r}const v0=(t,e,n=5)=>{t=[t,e];let r=0,i=t.length-1,a=t[r],o=t[i],s;return o<a&&([a,o]=[o,a],[r,i]=[i,r]),0<(s=y0(a,o,n))?(a=Math.floor(a/s)*s,o=Math.ceil(o/s)*s,s=y0(a,o,n)):s<0&&(a=Math.ceil(a*s)/s,o=Math.floor(o*s)/s,s=y0(a,o,n)),0<s?(t[r]=Math.floor(a/s)*s,t[i]=Math.ceil(o/s)*s):s<0&&(t[r]=Math.ceil(a*s)/s,t[i]=Math.floor(o*s)/s),t},b0=36e5,x0=864e5,w0=7*x0;x0,x0;function M0(t,n,s,r){const i=(t,e)=>{let n=e;for(;n&&r(t)%e!=0;)s(t,-1),--n;return t},l=(t,e)=>{e&&i(t,e),n(t)};const c=(t,e)=>{t=new Date(+t-1);return l(t,e),s(t,e),l(t),t};return{ceil:c,floor:(t,e)=>{t=new Date(+t);return l(t,e),t},range:(t,e,n,r)=>{for(var i=[],a=Math.floor(n),o=r?c(t,n):c(t);+o<+e;s(o,a),l(o))i.push(new Date(+o));return i},duration:t}}Ys=M0(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),_o=M0(1e3,t=>{t.setMilliseconds(0)},(t,e=1)=>{t.setTime(+t+1e3*e)},t=>t.getSeconds()),Js=M0(6e4,t=>{t.setSeconds(0,0)},(t,e=1)=>{t.setTime(+t+6e4*e)},t=>t.getMinutes()),No=M0(b0,t=>{t.setMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+b0*e)},t=>t.getHours()),Ro=M0(x0,t=>{t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+x0*e)},t=>t.getDate()-1);const O0=M0(2592e6,t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e=1)=>{var n=t.getMonth();t.setMonth(n+e)},t=>t.getMonth());zo=M0(w0,t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+w0*e)},t=>{var e=O0.floor(t),t=new Date(+t);return Math.floor((+t-+e)/w0)}),qo=M0(31536e6,t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e=1)=>{var n=t.getFullYear();t.setFullYear(n+e)},t=>t.getFullYear());const k0={millisecond:Ys,second:_o,minute:Js,hour:No,day:Ro,week:zo,month:O0,year:qo};Uo=M0(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),Ko=M0(1e3,t=>{t.setUTCMilliseconds(0)},(t,e=1)=>{t.setTime(+t+1e3*e)},t=>t.getUTCSeconds()),Qo=M0(6e4,t=>{t.setUTCSeconds(0,0)},(t,e=1)=>{t.setTime(+t+6e4*e)},t=>t.getUTCMinutes()),es=M0(b0,t=>{t.setUTCMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+b0*e)},t=>t.getUTCHours()),rs=M0(x0,t=>{t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+x0*e)},t=>t.getUTCDate()-1);const E0=M0(2592e6,t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e=1)=>{var n=t.getUTCMonth();t.setUTCMonth(n+e)},t=>t.getUTCMonth());as=M0(w0,t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+w0*e)},t=>{var e=E0.floor(t),t=new Date(+t);return Math.floor((+t-+e)/w0)}),Ss=M0(31536e6,t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e=1)=>{var n=t.getUTCFullYear();t.setUTCFullYear(n+e)},t=>t.getUTCFullYear());const S0={millisecond:Uo,second:Ko,minute:Qo,hour:es,day:rs,week:as,month:E0,year:Ss};function A0(t,e,n,r,i){var t=+t,e=+e,{tickIntervals:i,year:a,millisecond:o}=function(t){var{year:t,month:e,week:n,day:r,hour:i,minute:a,second:o,millisecond:s}=t?S0:k0;return{tickIntervals:[[o,1],[o,5],[o,15],[o,30],[a,1],[a,5],[a,15],[a,30],[i,1],[i,3],[i,6],[i,12],[r,1],[r,2],[n,1],[e,1],[e,3],[t,1]],year:t,millisecond:s}}(i),s=([t,e])=>t.duration*e,n=r?(e-t)/r:n||5,l=r||(e-t)/n,c=i.length,u=f0(i,l,0,c,s);let h;return h=u===c?[a,m0(t/a.duration,e/a.duration,n)]:u?([c,a]=l/s(i[u-1])<s(i[u])/l?i[u-1]:i[u],[c,r?Math.ceil(r/c.duration):a]):[o,Math.max(m0(t,e,n),1)]}const _0=(t,e,n,r,i)=>{var a=e<t,o=a?e:t,t=a?t:e,[e,n]=A0(o,t,n,r,i),r=[e.floor(o,n),e.ceil(t,n)];return a?r.reverse():r};function T0(t){return null!=t&&!Number.isNaN(t)}const P0=e=>t=>-e(-t),C0=(t,e)=>{const n=Math.log(t);t=t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:t=>Math.log(t)/n;return e?P0(t):t},L0=(e,t)=>{var n=e===Math.E?Math.exp:t=>e**t;return t?P0(n):n},N0=(t,e,n,r)=>{var i=t<0,a=C0(r,i),r=L0(r,i),i=e<t,o=i?t:e,e=[r(Math.floor(a(i?e:t))),r(Math.ceil(a(o)))];return i?e.reverse():e};function j0(e,o){return t=>{t.prototype.rescale=function(){this.initRange(),this.nice();var[t]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t))},t.prototype.initRange=function(){var t=this.options["interpolator"];this.options.range=e(t)},t.prototype.composeOutput=function(t,e){var n,{domain:r,interpolator:i,round:a}=this.getOptions(),r=o(r.map(t)),a=a?(n=i,t=>{t=n(t);return Zp(t)?Math.round(t):t}):i;this.output=u0(a,r,e,t)},t.prototype.invert=void 0}}var R0,zs={exports:{}},Ws={exports:{}},I0=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||0<=t.length&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))},B0=Array.prototype.concat,D0=Array.prototype.slice,F0=Ws.exports=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];I0(i)?e=B0.call(e,D0.call(i)):e.push(i)}return e},z0=(F0.wrap=function(t){return function(){return t(F0(arguments))}},{aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),W0=Ws.exports,G0=Object.hasOwnProperty,H0=Object.create(null);for(R0 in z0)G0.call(z0,R0)&&(H0[z0[R0]]=R0);var V0=zs.exports={to:{},get:{}};function Y0(t,e,n){return Math.min(Math.max(e,t),n)}function q0(t){t=Math.round(t).toString(16).toUpperCase();return t.length<2?"0"+t:t}V0.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=V0.get.hsl(t),n="hsl";break;case"hwb":e=V0.get.hwb(t),n="hwb";break;default:e=V0.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},V0.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 a=2*n;i[n]=parseInt(e.slice(a,2+a),16)}r&&(i[3]=parseInt(r,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(r=(e=e[1])[3],n=0;n<3;n++)i[n]=parseInt(e[n]+e[n],16);r&&(i[3]=parseInt(r+r,16)/255)}else{if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/))for(n=0;n<3;n++)i[n]=parseInt(e[n+1],0);else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:G0.call(z0,e[1])?((i=z0[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]=Y0(i[n],0,255);return i[3]=Y0(i[3],0,1),i},V0.get.hsl=function(t){var e;return(t=t&&t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/))?(e=parseFloat(t[4]),[(parseFloat(t[1])%360+360)%360,Y0(parseFloat(t[2]),0,100),Y0(parseFloat(t[3]),0,100),Y0(isNaN(e)?1:e,0,1)]):null},V0.get.hwb=function(t){var e;return(t=t&&t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/))?(e=parseFloat(t[4]),[(parseFloat(t[1])%360+360)%360,Y0(parseFloat(t[2]),0,100),Y0(parseFloat(t[3]),0,100),Y0(isNaN(e)?1:e,0,1)]):null},V0.to.hex=function(){var t=W0(arguments);return"#"+q0(t[0])+q0(t[1])+q0(t[2])+(t[3]<1?q0(Math.round(255*t[3])):"")},V0.to.rgb=function(){var t=W0(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]+")"},V0.to.rgb.percent=function(){var t=W0(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]+")"},V0.to.hsl=function(){var t=W0(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},V0.to.hwb=function(){var t=W0(arguments),e="";return 4<=t.length&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},V0.to.keyword=function(t){return H0[t.slice(0,3)]};var $0=zs.exports;function U0(t,e,n){let r=n;return r<0&&(r+=1),1<r&&--r,r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function X0(t){var e,n,r,t=$0.get(t);return t?({model:t,value:e}=t,"rgb"===t?e:"hsl"===t?(e=(t=e)[0]/360,n=t[1]/100,r=t[2]/100,t=t[3],0==n?[255*r,255*r,255*r,t]:[255*U0(n=2*r-(r=r<.5?r*(1+n):r+n-r*n),r,e+1/3),255*U0(n,r,e),255*U0(n,r,e-1/3),t]):null):null}const K0=(e,n)=>t=>e*(1-t)+n*t,Z0=(t,e)=>{if("number"==typeof t&&"number"==typeof e)return K0(t,e);if("string"!=typeof t||"string"!=typeof e)return()=>t;{var n=t,r=e;const l=X0(n),c=X0(r);return null===l||null===c?l?()=>n:()=>r:e=>{var n=new Array(4);for(let t=0;t<4;t+=1){var r=l[t],i=c[t];n[t]=r*(1-e)+i*e}var[t,a,o,s]=n;return`rgba(${Math.round(t)}, ${Math.round(a)}, ${Math.round(o)}, ${s})`}}},Q0=(t,e)=>{const n=K0(t,e);return t=>Math.round(n(t))};function J0({map:t,initKey:e},n){e=e(n);return t.has(e)?t.get(e):n}function tg(t){return"object"==typeof t?t.valueOf():t}class eg extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=tg,null!==t)for(var[e,n]of t)this.set(e,n)}get(t){return super.get(J0({map:this.map,initKey:this.initKey},t))}has(t){return super.has(J0({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(([{map:t,initKey:n},r]=[{map:this.map,initKey:this.initKey},t],n=n(r),t.has(n)?t.get(n):(t.set(n,r),r)),e);var n,r}delete(t){return super.delete(([{map:t,initKey:e},n]=[{map:this.map,initKey:this.initKey},t],e=e(n),t.has(e)&&(n=t.get(e),t.delete(e)),n));var e,n}}class ng{constructor(t){this.options=t0({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=t0({},this.options,t),this.rescale(t)}rescale(t){}}const rg=Symbol("defaultUnknown");function ig(e,n,r){for(let t=0;t<n.length;t+=1)e.has(n[t])||e.set(r(n[t]),t)}function ag(t){var{value:t,from:e,to:n,mapper:r,notFoundReturn:i}=t;let a=r.get(t);if(void 0===a){if(i!==rg)return i;a=e.push(t)-1,r.set(t,a)}return n[a%n.length]}function og(t){return t instanceof Date?t=>""+t:"object"==typeof t?t=>JSON.stringify(t):t=>t}class sg extends ng{getDefaultOptions(){return{domain:[],range:[],unknown:rg}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&ig(this.domainIndexMap,this.getDomain(),this.domainKey),ag({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&ig(this.rangeIndexMap,this.getRange(),this.rangeKey),ag({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){var[e]=this.options.domain,[n]=this.options.range;this.domainKey=og(e),this.rangeKey=og(n),this.rangeIndexMap?(t&&!t.range||this.rangeIndexMap.clear(),t&&!t.domain&&!t.compare||(this.domainIndexMap.clear(),this.sortedDomain=void 0)):(this.rangeIndexMap=new Map,this.domainIndexMap=new Map)}clone(){return new sg(this.options)}getRange(){return this.options.range}getDomain(){var t,e;return this.sortedDomain||({domain:t,compare:e}=this.options,this.sortedDomain=e?[...t].sort(e):t),this.sortedDomain}}function lg(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:a,round:o,align:s}=t;var l=e.length,c=0<(c=(t=l)-(u=a).length)?[...u,...new Array(c).fill(1)]:c<0?u.slice(0,t):u,[t,u]=n,u=u-t,h=u/(2/l*r+1-1/l*i);const f=h*i/l;h-=l*f;const d=function(t){const e=Math.min(...t);return t.map(t=>t/e)}(c),p=h/d.reduce((t,e)=>t+e);var c=new eg(e.map((t,e)=>{e=d[e]*p;return[t,o?Math.floor(e):e]})),g=new eg(e.map((t,e)=>{e=d[e]*p+f;return[t,o?Math.floor(e):e]})),h=Array.from(g.values()).reduce((t,e)=>t+e),t=t+(u-(h-h/l*i))*s;let y=o?Math.round(t):t;var m=new Array(l);for(let t=0;t<l;t+=1){m[t]=(v=y,Math.round(1e12*v)/1e12);var v=e[t];y+=g.get(v)}return{valueBandWidth:c,valueStep:g,adjustedRange:m}}class cg extends sg{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:rg,flex:[]}}constructor(t){super(t)}clone(){return new cg(this.options)}getStep(t){return void 0===this.valueStep?1:"number"==typeof this.valueStep?this.valueStep:void 0===t?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return void 0===this.valueBandWidth?1:"number"==typeof this.valueBandWidth?this.valueBandWidth:void 0===t?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){var{padding:t,paddingInner:e}=this.options;return 0<t?t:e}getPaddingOuter(){var{padding:t,paddingOuter:e}=this.options;return 0<t?t:e}rescale(){super.rescale();var{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:t,valueBandWidth:n,valueStep:r}=function(t){var e=t["domain"];if(0===(e=e.length))return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(!(null==(n=t.flex)||!n.length))return lg(t);var{range:n,paddingOuter:t,paddingInner:r,round:i,align:a}=t;let o,s,l=n[0];return n=n[1]-l,o=n/Math.max(1,2*t+(e-r)),i&&(o=Math.floor(o)),l+=(n-o*(e-r))*a,s=o*(1-r),i&&(l=Math.round(l),s=Math.round(s)),t=new Array(e).fill(0).map((t,e)=>l+e*o),{valueStep:o,valueBandWidth:s,adjustedRange:t}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=r,this.valueBandWidth=n,this.adjustedRange=t}}const ug=(t,e,n)=>{let r,i,a=t,o=e;if(a===o&&0<n)return[a];let s=y0(a,o,n);if(0===s||!Number.isFinite(s))return[];if(0<s){a=Math.ceil(a/s),o=Math.floor(o/s),i=new Array(r=Math.ceil(o-a+1));for(let t=0;t<r;t+=1)i[t]=(a+t)*s}else{s=-s,a=Math.ceil(a*s),o=Math.floor(o*s),i=new Array(r=Math.ceil(o-a+1));for(let t=0;t<r;t+=1)i[t]=(a+t)/s}return i};class hg extends ng{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:ug}}map(t){var[e]=this.options.range;return void 0!==e?e:this.options.unknown}invert(t){var[e]=this.options.range;return t===e&&void 0!==e?this.options.domain:[]}getTicks(){var{tickMethod:t,domain:e,tickCount:n}=this.options,[e,r]=e;return Zp(e)&&Zp(r)?t(e,r,n):[]}clone(){return new hg(this.options)}}function fg(t){return Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}const dg=[1,5,2,2.5,4,3],pg=100*Number.EPSILON;const gg=(n,r,t=5,i=!0,a=dg,o=[.25,.2,.5,.05])=>{var s=t<0?0:Math.round(t);if(Number.isNaN(n)||Number.isNaN(r)||"number"!=typeof n||"number"!=typeof r||!s)return[];if(r-n<1e-15||1===s)return[n];var l,c,u,h,f,d,p,g={score:-2,lmin:0,lmax:0,lstep:0};let y=1;for(;y<1/0;){for(let t=0;t<a.length;t+=1){var m=a[t],v=(h=m,f=a,d=y,p=void 0,p=i0(f),1-r0(f,h)/(p-1)-d+1);if(o[0]*v+o[1]+o[2]+o[3]<g.score){y=1/0;break}let e=2;for(;e<1/0;){x=e;var b=(u=s)<=x?2-(x-1)/(u-1):1;if(o[0]*v+o[1]+o[2]*b+o[3]<g.score)break;var x=(r-n)/(e+1)/y/m;let t=Math.ceil(Math.log10(x));for(;t<1/0;){var w=y*m*10**t,M=(k=r,M=w*(e-1),(k-=n)<M?1-((M-k)/2)**2/(.1*k)**2:1);if(o[0]*v+o[1]*M+o[2]*b+o[3]<g.score)break;var O=Math.floor(r/w)*y-(e-1)*y,k=Math.ceil(n/w)*y;if(O<=k){var E=k-O;for(let t=0;t<=E;t+=1){var S=(O+t)*(w/y),A=S+w*(e-1),_=w,T=function(t,e,n,r,i,a){var o=i0(e),e=r0(e,t);let s=0;return t=(r%a+a)%a,1-e/(o-1)-n+(s=(t<pg||a-t<pg)&&r<=0&&0<=i?1:s)}(m,a,y,S,A,_),P=1-.5*((r-A)**2+(n-S)**2)/(.1*(r-n))**2,C=(l=e,C=n,l=(l-1)/(A-(L=S)),c=((c=s)-1)/(Math.max(A,r)-Math.min(C,L)),2-Math.max(l/c,c/l)),L=o[0]*T+o[1]*P+o[2]*C+ +o[3];g.score<L&&(!i||S<=n&&r<=A)&&(g.lmin=S,g.lmax=A,g.lstep=_,g.score=L)}}t+=1}e+=1}}y+=1}var t=fg(g.lmax),e=fg(g.lmin),N=fg(g.lstep),j=Math.floor((t=(t-e)/N,Math.round(1e12*t)/1e12))+1,R=new Array(j);R[0]=fg(e);for(let t=1;t<j;t+=1)R[t]=fg(R[t-1]+N);return R};class yg extends ng{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:gg}}map(t){return T0(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new yg(this.options)}getTicks(){var{domain:t,tickCount:e,tickMethod:n}=this.options,[t,r]=t;return Zp(t)&&Zp(r)?n(t,r,e):[]}}const mg=(t,e,n)=>{var[t,r]=t,[e,i]=e;let a,o;return u0(o=t<r?(a=h0(t,r),n(e,i)):(a=h0(r,t),n(i,e)),a)},vg=(r,t,e)=>{const i=Math.min(r.length,t.length)-1,a=new Array(i),o=new Array(i);var n=r[0]>r[i],s=n?[...r].reverse():r,l=n?[...t].reverse():t;for(let t=0;t<i;t+=1)a[t]=h0(s[t],s[t+1]),o[t]=e(l[t],l[t+1]);return t=>{var e=f0(r,t,1,i)-1,n=a[e];return u0(o[e],n)(t)}},bg=(t,e,n,r)=>{return(2<Math.min(t.length,e.length)?vg:mg)(t,e,r?Q0:n)};class xg extends ng{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:K0,tickCount:5}}map(t){return T0(t)?this.output(t):this.options.unknown}invert(t){return T0(t)?this.input(t):this.options.unknown}nice(){var t,e,n,r;this.options.nice&&([t,e,n,...r]=this.getTickMethodOptions(),this.options.domain=this.chooseNice()(t,e,n,...r))}getTicks(){var t=this.options["tickMethod"],[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){var{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return v0}rescale(){this.nice();var[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){var{clamp:e,range:n}=this.options,t=this.options.domain.map(t),n=Math.min(t.length,n.length);if(e){e=t[0],t=t[n-1];const r=t<e?t:e,i=t<e?e:t;return t=>Math.min(Math.max(r,t),i)}return e0}composeOutput(t,e){var{domain:n,range:r,round:i,interpolate:a}=this.options,n=bg(n.map(t),r,a,i);this.output=u0(n,e,t)}composeInput(t,e,n){var{domain:r,range:i}=this.options,i=bg(i,r.map(t),K0);this.input=u0(e,n,i)}}class wg extends xg{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:Z0,tickMethod:ug,tickCount:5}}chooseTransforms(){return[e0,e0]}clone(){return new wg(this.options)}}class Mg extends cg{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:rg,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new Mg(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const Og=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class kg extends xg{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:Z0,tickMethod:ug,tickCount:5}}constructor(t){super(t)}chooseTransforms(){var t,e,n,r=this.options["exponent"];return 1===r?[e0,e0]:(t=.5===r?Og:(e=r,t=>t<0?-((-t)**e):t**e),n=r,[t,t=>t<0?-((-t)**(1/n)):t**(1/n)])}clone(){return new kg(this.options)}}class Eg extends kg{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Z0,tickMethod:ug,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new Eg(this.options)}}class Sg extends ng{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){return T0(t)?(t=f0(this.thresholds,t,0,this.n),this.options.range[t]):this.options.unknown}invert(t){var e=this.options["range"],e=e.indexOf(t),t=this.thresholds;return[t[e-1],t[e]]}clone(){return new Sg(this.options)}rescale(){var{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const Ag=(t,e,n,r=10)=>{var i=t<0,a=L0(r,i),o=C0(r,i),s=e<t,l=s?e:t,c=s?t:e;let u=o(l),h=o(c),f=[];if(!(r%1)&&h-u<n){if(u=Math.floor(u),h=Math.ceil(h),i)for(;u<=h;u+=1){var d=a(u);for(let t=r-1;1<=t;--t){var p=d*t;if(c<p)break;l<=p&&f.push(p)}}else for(;u<=h;u+=1){var g=a(u);for(let t=1;t<r;t+=1){var y=g*t;if(c<y)break;l<=y&&f.push(y)}}2*f.length<n&&(f=ug(l,c,n))}else{t=-1===n?h-u:Math.min(h-u,n);f=ug(u,h,t).map(a)}return s?f.reverse():f};class _g extends xg{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:Z0,tickMethod:Ag,tickCount:5}}chooseNice(){return N0}getTickMethodOptions(){var{domain:t,tickCount:e,base:n}=this.options;return[t[0],t[t.length-1],e,n]}chooseTransforms(){var{base:t,domain:e}=this.options,e=e[0]<0;return[C0(t,e),L0(t,e)]}clone(){return new _g(this.options)}}class Tg extends Sg{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:gg}}constructor(t){super(t)}nice(){var t,e,n=this.options["nice"];n&&([n,t,e]=this.getTickMethodOptions(),this.options.domain=v0(n,t,e))}getTicks(){var t=this.options["tickMethod"],[e,n,r]=this.getTickMethodOptions();return t(e,n,r)}getTickMethodOptions(){var{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}rescale(){this.nice();var{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){var[t,e]=super.invert(t),[n,r]=this.options.domain;return void 0===t&&void 0===e?[t,e]:[t||n,e||r]}getThresholds(){return this.thresholds}clone(){return new Tg(this.options)}}function Pg(t,e,n=!1){var r=t,i=(n||r.sort((t,e)=>t-e),[]);for(let t=1;t<e;t+=1)i.push(function(t,e){var n,r=t.length;if(r)return r<2?t[r-1]:(r=(r-1)*e,(n=t[e=Math.floor(r)])+(t[e+1]-n)*(r-e))}(r,t/e));return i}class Cg extends Sg{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:gg}}constructor(t){super(t)}rescale(){var{domain:t,range:e}=this.options;this.n=e.length-1,this.thresholds=Pg(t,this.n+1,!1)}invert(t){var[t,e]=super.invert(t),n=this.options["domain"],r=n[0],n=n[n.length-1];return void 0===t&&void 0===e?[t,e]:[t||r,e||n]}getThresholds(){return this.thresholds}clone(){return new Cg(this.options)}getTicks(){var{tickCount:t,domain:e,tickMethod:n}=this.options,r=e.length-1;return n(e[0],e[r],t)}}var Lg=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,Ng=/\[([^]*?)\]/gm;function jg(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function Rg(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 a,o=i[r];for(a in o)t[a]=o[a]}return t}function Ig(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t}var Bg,Go=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],$s=["January","February","March","April","May","June","July","August","September","October","November","December"],Ol=jg($s,3),Dg=Rg({},{dayNamesShort:jg(Go,3),dayNames:Go,monthNamesShort:Ol,monthNames:$s,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][3<t%10?0:(t-t%10!=10?1:0)*t%10]}}),Fg={D:function(t){return String(t.getDate())},DD:function(t){return Ig(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return Ig(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 Ig(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 Ig(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return Ig(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return Ig(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return Ig(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return Ig(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return Ig(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return Ig(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return Ig(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]:e.amPm[1]).toUpperCase()},ZZ:function(t){t=t.getTimezoneOffset();return(0<t?"-":"+")+Ig(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4)},Z:function(t){t=t.getTimezoneOffset();return(0<t?"-":"+")+Ig(Math.floor(Math.abs(t)/60),2)+":"+Ig(Math.abs(t)%60,2)}},zg={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 Wg=(t,e,n,r,i)=>{var a=e<t,o=a?e:t,t=a?t:e,[e,n]=A0(o,t,n,r,i),r=e.range(o,new Date(+t+1),n,!0);return a?r.reverse():r};function Gg(t){var e=t.getTimezoneOffset(),t=new Date(t);return t.setMinutes(t.getMinutes()+e,t.getSeconds(),t.getMilliseconds()),t}class Hg extends xg{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:Wg,interpolate:K0,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return _0}getTickMethodOptions(){var{domain:t,tickCount:e,tickInterval:n,utc:r}=this.options;return[t[0],t[t.length-1],e,n,r]}getFormatter(){const{mask:a,utc:t}=this.options,o=t?S0:k0,s=t?Gg:e0;return t=>{var e=s(t),t=a||function(t,e){var{second:e,minute:n,hour:r,day:i,week:a,month:o,year:s}=e;return e.floor(t)<t?".SSS":n.floor(t)<t?":ss":r.floor(t)<t?"hh:mm":i.floor(t)<t?"hh A":o.floor(t)<t?a.floor(t)<t?"MMM DD":"ddd DD":s.floor(t)<t?"MMMM":"YYYY"}(t,o),n=void 0;if(void 0===t&&(t=zg.default),void 0===n&&(n={}),"number"==typeof e&&(e=new Date(e)),"[object Date]"!==Object.prototype.toString.call(e)||isNaN(e.getTime()))throw new Error("Invalid Date pass to format");var r=[],i=(t=(t=zg[t]||t).replace(Ng,function(t,e){return r.push(e),"@@@"}),Rg(Rg({},Dg),n));return(t=t.replace(Lg,function(t){return Fg[t](e,i)})).replace(/@@@/g,function(){return r.shift()})}}clone(){return new Hg(this.options)}}var Vg;let Yg=Bg=class extends wg{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:e0,tickMethod:ug,tickCount:5}}constructor(t){super(t)}clone(){return new Bg(this.options)}};Yg=Bg=function(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(o=(a<3?i(o):3<a?i(e,n,o):i(e,n))||o);return 3<a&&o&&Object.defineProperty(e,n,o),o}([j0(function(t){return[t(0),t(1)]},t=>{var[t,e]=t;return u0(K0(0,1),h0(t,e))})],Yg);let qg=Vg=class extends wg{getDefaultOptions(){return{domain:[0,.5,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:e0,tickMethod:ug,tickCount:5}}constructor(t){super(t)}clone(){return new Vg(this.options)}};qg=Vg=function(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(o=(a<3?i(o):3<a?i(e,n,o):i(e,n))||o);return 3<a&&o&&Object.defineProperty(e,n,o),o}([j0(function(t){return[t(0),t(.5),t(1)]},t=>{const[e,n,r]=t,i=u0(K0(0,.5),h0(e,n)),a=u0(K0(.5,1),h0(n,r));return t=>(e>r?t<n?a:i:t<n?i:a)(t)})],qg);function $g(t,e,n,r,i){var a=new wg({range:[e,e+r]}),o=new wg({range:[n,n+i]});return{transform:function(t){var t=i1(t,2),e=t[0],t=t[1];return[a.map(e),o.map(t)]},untransform:function(t){var t=i1(t,2),e=t[0],t=t[1];return[a.invert(e),o.invert(t)]}}}function Ug(t,e,n,r,i){return(0,a1(t,1)[0])(e,n,r,i)}function Xg(t,e,n,r,i){return o1(t,1)[0]}function Kg(t,e,n,r,i){var a=(t=s1(t,4))[0],o=t[1],s=t[2],t=t[3],l=new wg({range:[s,t]}),c=new wg({range:[a,o]}),u=1<(s=i/r)?1:s,h=1<s?1/s:1;return{transform:function(t){var t=s1(t,2),e=t[0],t=t[1],e=c.map(e),t=l.map(t);return[.5*(t*Math.cos(e)*u)+.5,.5*(t*Math.sin(e)*h)+.5]},untransform:function(t){var t=s1(t,2),e=t[0],t=t[1],e=2*(e-.5)/u,t=2*(t-.5)/h,n=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),t=s0(Math.atan2(t,e),a,o);return[c.invert(t),l.invert(n)]}}}function Zg(t,e,n,r,i){return{transform:function(t){var t=l1(t,2),e=t[0];return[t[1],e]},untransform:function(t){var t=l1(t,2),e=t[0];return[t[1],e]}}}function Qg(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return u1.apply(void 0,f1([[-1,-1]],h1(e),!1))}function Jg(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return u1.apply(void 0,f1([[-1,1]],h1(e),!1))}function t1(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return u1.apply(void 0,f1([[1,-1]],h1(e),!1))}function e1(t,e,n,r,i){var a,t=d1(t,1)[0],o=U();return o=o,t=t,a=Math.sin(t),t=Math.cos(t),o[0]=t,o[1]=a,o[2]=0,o[3]=-a,o[4]=t,o[5]=0,o[6]=0,o[7]=0,o[8]=1,o}function n1(t,e,n,r,i){var a=(t=p1(t,4))[0],o=t[1],s=t[2],l=(t[3]-s)/(+o/(2*Math.PI)+1),c=l/(2*Math.PI),u=new wg({range:[s,s+.99*l]}),h=new wg({range:[a,o]}),f=1<(t=i/r)?1:t,d=1<t?1/t:1;return{transform:function(t){var t=p1(t,2),e=t[0],t=t[1],e=h.map(e),t=u.map(t);return[.5*(Math.cos(e)*(c*e+t)*f)+.5,.5*(Math.sin(e)*(c*e+t)*d)+.5]},untransform:function(t){var t=p1(t,2),e=t[0],t=t[1],e=2*(e-.5)/f,t=2*(t-.5)/d,n=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),t=s0(Math.atan2(t,e)+Math.floor(n/l)*Math.PI*2,a,o),e=n-c*t;return[h.invert(t),u.invert(e)]}}}function r1(t,e,n,r,i){var s=(t=g1(t,4))[0],l=t[1],a=t[2],t=t[3],c=new wg({range:[a,t]});return{transform:function(t){for(var e=[],n=t.length,r=new Mg({domain:new Array(n).fill(0).map(function(t,e){return e}),range:[s,l]}),i=0;i<n;i++){var a=t[i],o=r.map(i),a=c.map(a);e.push(o,a)}return e},untransform:function(t){for(var e=[],n=0;n<t.length;n+=2){var r=t[n+1];e.push(c.invert(r))}return e}}}var i1=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},a1=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},o1=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},s1=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},l1=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},c1=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},u1=function(t,e,n,r,i){var t=c1(t,2),a=t[0],t=t[1],o=U();return a=[a,t],(t=o)[0]=a[0],t[1]=0,t[2]=0,t[3]=0,t[4]=a[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},h1=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},f1=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||((r=r||Array.prototype.slice.call(e,0,i))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},d1=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},p1=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},g1=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},y1=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o};function m1(t){return 1/Math.tan(t)}function v1(t,e,n,r,i){var a=m1(y1(t,1)[0]);return{transform:function(t){var t=y1(t,2),e=t[0],t=t[1];return[e+t*a,t]},untransform:function(t){var t=y1(t,2),e=t[0],t=t[1];return[e-t*a,t]}}}function b1(t,e,n,r,i){var a=m1(y1(t,1)[0]);return{transform:function(t){var t=y1(t,2),e=t[0];return[e,t[1]+e*a]},untransform:function(t){var t=y1(t,2),e=t[0];return[e,t[1]-e*a]}}}var x1=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o};function w1(t,e,n,r,i){var a=t<e,i=(a?e-r:i-e)||i-r,r=a?-1:1;return r*i*(n+1)/(n+i/((t-e)*r))+e}function M1(t,e,n,r,i){var a=t<e,i=(a?e-r:i-e)||i-r;return i/(i*(n+1)/(t-e)-n*(a?-1:1))+e}function O1(t,e,n){return n?new wg({range:[0,1],domain:[0,e]}).map(t):t}function k1(t,e,n,r,i){var a=(t=x1(t,3))[0],o=t[1],t=t[2],s=O1(a,r,void 0!==t&&t);return{transform:function(t){var t=x1(t,2),e=t[0],t=t[1];return[w1(e,s,o,0,1),t]},untransform:function(t){var t=x1(t,2),e=t[0],t=t[1];return[M1(e,s,o,0,1),t]}}}function E1(t,e,n,r,i){var a=(t=x1(t,3))[0],o=t[1],t=t[2],s=O1(a,i,void 0!==t&&t);return{transform:function(t){t=x1(t,2);return[t[0],w1(t[1],s,o,0,1)]},untransform:function(t){t=x1(t,2);return[t[0],M1(t[1],s,o,0,1)]}}}function S1(t,e,n,r,i){var a=(t=x1(t,5))[0],o=t[1],s=t[2],l=t[3],t=t[4],c=O1(a,r,t=void 0!==t&&t),u=O1(o,i,t);return{transform:function(t){var t=x1(t,2),e=t[0],t=t[1];return[w1(e,c,s,0,1),w1(t,u,l,0,1)]},untransform:function(t){var t=x1(t,2),e=t[0],t=t[1];return[M1(e,c,s,0,1),M1(t,u,l,0,1)]}}}function A1(t,e,n,r,i){var a=(t=x1(t,5))[0],o=t[1],s=t[2],l=t[3],t=void 0!==(t=t[4])&&t,c=new wg({range:[0,r]}),u=new wg({range:[0,i]}),h=t?a:c.map(a),f=t?o:u.map(o);return{transform:function(t){var t=x1(t,2),e=t[0],t=t[1],n=c.map(e)-h,r=u.map(t)-f,i=Math.sqrt(n*n+r*r);return s<i?[e,t]:(e=w1(i,0,l,0,s),t=Math.atan2(r,n),i=h+e*Math.cos(t),r=f+e*Math.sin(t),[c.invert(i),u.invert(r)])},untransform:function(t){var t=x1(t,2),e=t[0],t=t[1],n=c.map(e)-h,r=u.map(t)-f,i=Math.sqrt(n*n+r*r);return s<i?[e,t]:(e=M1(i,0,l,0,s),t=Math.atan2(r,n),i=h+e*Math.cos(t),r=f+e*Math.sin(t),[c.invert(i),u.invert(r)])}}}var _1=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},T1=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||((r=r||Array.prototype.slice.call(e,0,i))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},P1=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{value:(t=t&&r>=t.length?void 0:t)&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},C1=(L1.prototype.update=function(t){this.options=t0({},this.options,t),this.recoordinate()},L1.prototype.clone=function(){return new L1(this.options)},L1.prototype.getOptions=function(){return this.options},L1.prototype.clear=function(){this.update({transformations:[]})},L1.prototype.getSize=function(){var t=this.options;return[t.width,t.height]},L1.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y;return[(2*e+t.width)/2,(2*n+t.height)/2]},L1.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:T1(T1([],_1(n),!1),[T1([],_1(t),!1)],!1)}),this},L1.prototype.map=function(t){return this.output(t)},L1.prototype.invert=function(t){return this.input(t)},L1.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},L1.prototype.compose=function(t){function e(t,e){var i;l.push((e=void 0===e?!0:e)?(i=t,function(t){for(var e=[],n=0;n<t.length-1;n+=2){var r=[t[n],t[n+1]],r=i(r);e.push.apply(e,o0([],a0(r),!1))}return e}):t)}var n,r,i,a=(t=void 0===t?!1:t)?T1([],_1(this.options.transformations),!1).reverse():this.options.transformations,o=t?function(t){return t.untransform}:function(t){return t.transform},s=[],l=[];try{for(var c=P1(a),u=c.next();!u.done;u=c.next()){var h,f,d,p,g,y,m=_1(u.value),v=m[0],b=m.slice(1),x=this.transformers[v];x&&(f=(h=this.options).x,d=h.y,p=h.width,g=h.height,y=x(T1([],_1(b),!1),f,d,p,g),(i=y)instanceof Float32Array||i instanceof Array?s.push(y):(s.length&&(e(this.createMatrixTransform(s,t)),s.splice(0,s.length)),e(o(y)||e0,"parallel"!==v)))}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return s.length&&e(this.createMatrixTransform(s,t)),function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t?e.reduce(function(e,n){return function(t){return n(e(t))}},t):e0}.apply(void 0,T1([],_1(l),!1))},L1.prototype.createMatrixTransform=function(t,e){var n,r,i,a,o,s,l,c,u,h,f,d,p=U();return e&&t.reverse(),t.forEach(function(t){return K(p,p,t)}),e&&(e=t=p,(d=new $(9))[0]=e[0],d[1]=e[1],d[2]=e[2],d[3]=e[3],d[4]=e[4],d[5]=e[5],d[6]=e[6],d[7]=e[7],d[8]=e[8],d=(e=d)[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=(e=e[8])*a-o*l,f=d*c+n*(u=-e*i+o*s)+r*(h=l*i-a*s))&&(t[0]=c*(f=1/f),t[1]=(-e*n+r*l)*f,t[2]=(o*n-r*a)*f,t[3]=u*f,t[4]=(e*d-r*s)*f,t[5]=(-o*d+r*i)*f,t[6]=h*f,t[7]=(-l*d+n*s)*f,t[8]=(a*d-n*i)*f),function(t){t=[t[0],t[1],1];return Gt(t,t,p),[t[0],t[1]]}},L1);function L1(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:$g,translate:l0,custom:Ug,matrix:Xg,polar:Kg,transpose:Zg,scale:u1,"shear.x":v1,"shear.y":b1,reflect:Qg,"reflect.x":Jg,"reflect.y":t1,rotate:e1,helix:n1,parallel:r1,fisheye:S1,"fisheye.x":k1,"fisheye.y":E1,"fisheye.circular":A1},this.update(t)}function N1(e,n){const r=t=>{return"string"!=typeof t?t:n[t=e+"."+t]||ap("Unknown Component: "+t)};return[(t,e)=>{var n=t["type"],t=at(t,["type"]);return r(n)(t,e)},r]}function j1(t){var{canvas:t,group:e}=t;return e?e.ownerDocument:t.document}function R1(t,e){var{coordinate:n={}}=t,t=at(t,["coordinate"]),{type:r,transform:i=[]}=n,n=at(n,["type","transform"]);if(!r)return Object.assign(Object.assign({},t),{coordinates:i});var[,e]=N1("coordinate",e),{transform:e=!1}=e(r).props||{};if(e)throw new Error(`Unknown coordinate: ${r}.`);return Object.assign(Object.assign({},t),{coordinates:[Object.assign({type:r},n),...i]})}function I1(t,e){return t.filter(t=>t.type===e)}function B1(t){return 0<I1(t,"polar").length}function D1(t){return I1(t,"transpose").length%2==1}function F1(t){return 0<I1(t,"theta").length}function z1(t){return 0<I1(t,"radial").length}function h(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}_l=h("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),Rl=h("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),zl=h("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),Hs=h("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),el=h("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),i=h("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),S=h("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),Zs=h("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),Xs=h("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),ol=h("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function W1(t,e,n){(t.prototype=e.prototype=n).constructor=t}function G1(t,e){var n,r=Object.create(t.prototype);for(n in e)r[n]=e[n];return r}function H1(){}var V1=1/.7,n="\\s*([+-]?\\d+)\\s*",uu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",rl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Y1=/^#([0-9a-f]{3,8})$/,q1=new RegExp(`^rgb\\(${n},${n},${n}\\)$`),$1=new RegExp(`^rgb\\(${rl},${rl},${rl}\\)$`),U1=new RegExp(`^rgba\\(${n},${n},${n},${uu}\\)$`),X1=new RegExp(`^rgba\\(${rl},${rl},${rl},${uu}\\)$`),K1=new RegExp(`^hsl\\(${uu},${rl},${rl}\\)$`),Z1=new RegExp(`^hsla\\(${uu},${rl},${rl},${uu}\\)$`),Q1={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 J1(){return this.rgb().formatHex()}function ty(){return this.rgb().formatRgb()}function ey(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Y1.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?ny(e):3===n?new oy(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?ry(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?ry(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=q1.exec(t))?new oy(e[1],e[2],e[3],1):(e=$1.exec(t))?new oy(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=U1.exec(t))?ry(e[1],e[2],e[3],e[4]):(e=X1.exec(t))?ry(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=K1.exec(t))?fy(e[1],e[2]/100,e[3]/100,1):(e=Z1.exec(t))?fy(e[1],e[2]/100,e[3]/100,e[4]):Q1.hasOwnProperty(t)?ny(Q1[t]):"transparent"===t?new oy(NaN,NaN,NaN,0):null}function ny(t){return new oy(t>>16&255,t>>8&255,255&t,1)}function ry(t,e,n,r){return new oy(t=r<=0?e=n=NaN:t,e,n,r)}function iy(t){return(t=t instanceof H1?t:ey(t))?new oy((t=t.rgb()).r,t.g,t.b,t.opacity):new oy}function ay(t,e,n,r){return 1===arguments.length?iy(t):new oy(t,e,n,null==r?1:r)}function oy(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function sy(){return"#"+hy(this.r)+hy(this.g)+hy(this.b)}function ly(){var t=cy(this.opacity);return(1===t?"rgb(":"rgba(")+uy(this.r)+`, ${uy(this.g)}, `+uy(this.b)+(1===t?")":`, ${t})`)}function cy(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function uy(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function hy(t){return((t=uy(t))<16?"0":"")+t.toString(16)}function fy(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||1<=n?t=e=NaN:e<=0&&(t=NaN),new py(t,e,n,r)}function dy(t){var e,n,r,i,a,o,s,l;return t instanceof py?new py(t.h,t.s,t.l,t.opacity):(t=t instanceof H1?t:ey(t))?t instanceof py?t:(e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=NaN,l=((a=Math.max(e,n,r))+i)/2,(s=a-i)?(o=e===a?(n-r)/s+6*(n<r):n===a?(r-e)/s+2:(e-n)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=0<l&&l<1?0:o,new py(o,s,l,t.opacity)):new py}function py(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function gy(t){return(t=(t||0)%360)<0?t+360:t}function yy(t){return Math.max(0,Math.min(1,t||0))}function my(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}W1(H1,ey,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:J1,formatHex:J1,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return dy(this).formatHsl()},formatRgb:ty,toString:ty}),W1(oy,ay,G1(H1,{brighter(t){return t=null==t?V1:Math.pow(V1,t),new oy(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new oy(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new oy(uy(this.r),uy(this.g),uy(this.b),cy(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:sy,formatHex:sy,formatHex8:function(){return"#"+hy(this.r)+hy(this.g)+hy(this.b)+hy(255*(isNaN(this.opacity)?1:this.opacity))},formatRgb:ly,toString:ly})),W1(py,function(t,e,n,r){return 1===arguments.length?dy(t):new py(t,e,n,null==r?1:r)},G1(H1,{brighter(t){return t=null==t?V1:Math.pow(V1,t),new py(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new py(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,e=n+(n<.5?n:1-n)*e,n=2*n-e;return new oy(my(240<=t?t-240:120+t,n,e),my(t,n,e),my(t<120?240+t:t-120,n,e),this.opacity)},clamp(){return new py(gy(this.h),yy(this.s),yy(this.l),cy(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(){var t=cy(this.opacity);return(1===t?"hsl(":"hsla(")+gy(this.h)+`, ${100*yy(this.s)}%, ${100*yy(this.l)}%`+(1===t?")":`, ${t})`)}}));const vy=Math.PI/180,by=180/Math.PI;var xy=1.78277,wy=-.29227,My=-.90649,Oy=1.97294,ky=Oy*My,Ey=Oy*xy,Sy=xy*wy- -.14861*My;function Ay(t,e,n,r){return 1===arguments.length?(i=t)instanceof _y?new _y(i.h,i.s,i.l,i.opacity):(a=(i=i instanceof oy?i:iy(i)).r/255,o=i.g/255,l=i.b/255,l=(Oy*(o-(a=(Sy*l+ky*a-Ey*o)/(Sy+ky-Ey)))-wy*(o=l-a))/My,new _y((l=(s=Math.sqrt(l*l+o*o)/(Oy*a*(1-a)))?Math.atan2(l,o)*by-120:NaN)<0?l+360:l,s,a,i.opacity)):new _y(t,e,n,null==r?1:r);var i,a,o,s,l}function _y(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}W1(_y,Ay,G1(H1,{brighter(t){return t=null==t?V1:Math.pow(V1,t),new _y(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new _y(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*vy,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),t=Math.sin(t);return new oy(255*(e+n*(-.14861*r+xy*t)),255*(e+n*(wy*r+My*t)),255*(e+Oy*r*n),this.opacity)}}));var Ty=t=>()=>t;function Py(e,n){return function(t){return e+t*n}}function Cy(a){return 1==(a=+a)?Ly:function(t,e){return e-t?(n=t,r=e,i=a,n=Math.pow(n,i),r=Math.pow(r,i)-n,i=1/i,function(t){return Math.pow(n+t*r,i)}):Ty(isNaN(t)?e:t);var n,r,i}}function Ly(t,e){var n=e-t;return n?Py(t,n):Ty(isNaN(t)?e:t)}!function t(e){var o=Cy(e);function n(e,t){var n=o((e=ay(e)).r,(t=ay(t)).r),r=o(e.g,t.g),i=o(e.b,t.b),a=Ly(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=r(t),e.b=i(t),e.opacity=a(t),e+""}}return n.gamma=t,n}(1);Ny=function(s){var l=s.length-1;return function(t){var e,n=t<=0?t=0:1<=t?l-(t=1):Math.floor(t*l),r=s[n],i=s[n+1],a=0<n?s[n-1]:2*r-i,o=n<l-1?s[n+2]:2*i-r;return((1-3*(t=(t-n/l)*l)+3*(n=t*t)-(e=n*t))*a+(4-6*n+3*e)*r+(1+3*t+3*n-3*e)*i+e*o)/6}};var Ny,jy=function(t){for(var e,n=t.length,r=new Array(n),i=new Array(n),a=new Array(n),o=0;o<n;++o)e=ay(t[o]),r[o]=e.r||0,i[o]=e.g||0,a[o]=e.b||0;return r=Ny(r),i=Ny(i),a=Ny(a),e.opacity=1,function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e+""}};function Ry(s){return function t(o){function e(e,t){var n=s((e=Ay(e)).h,(t=Ay(t)).h),r=Ly(e.s,t.s),i=Ly(e.l,t.l),a=Ly(e.opacity,t.opacity);return function(t){return e.h=n(t),e.s=r(t),e.l=i(Math.pow(t,o)),e.opacity=a(t),e+""}}return o=+o,e.gamma=t,e}(1)}Ry(function(t,e){var n=e-t;return n?Py(t,180<n||n<-180?n-360*Math.round(n/360):n):Ty(isNaN(t)?e:t)});var So=Ry(Ly),Co=t=>jy(t[t.length-1]),Vo=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(h),fn=Co(Vo),e=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(h),ii=Co(e),o=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(h),Ys=Co(o),_o=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(h),Js=Co(_o),No=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(h),Ro=Co(No),zo=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(h),qo=Co(zo),Uo=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(h),Ko=Co(Uo),Qo=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(h),es=Co(Qo),rs=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(h),as=Co(rs),Ss=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(h),Ws=Co(Ss),zs=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(h),Go=Co(zs),Ol=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(h),$s=Co(Ol),n=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(h),rl=Co(n),uu=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(h),Iy=Co(uu),By=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(h),Dy=Co(By),Fy=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(h),zy=Co(Fy),Wy=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(h),Gy=Co(Wy),Hy=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(h),Vy=Co(Hy),Yy=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(h),qy=Co(Yy),$y=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(h),Uy=Co($y),Xy=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(h),Ky=Co(Xy),Zy=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(h),Qy=Co(Zy),Jy=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(h),tm=Co(Jy),em=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(h),nm=Co(em),rm=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(h),im=Co(rm),am=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(h),om=Co(am),sm=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(h),Co=Co(sm);var lm=So(Ay(300,.5,0),Ay(-240,.5,1)),cm=So(Ay(-100,.75,.35),Ay(80,1.5,.8)),So=So(Ay(260,.75,.35),Ay(80,1.5,.8)),um=Ay();var hm=ay(),fm=Math.PI/3,dm=2*Math.PI/3;function pm(e){var n=e.length;return function(t){return e[Math.max(0,Math.min(n-1,Math.floor(t*n)))]}}var gm=pm(h("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),ym=pm(h("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),mm=pm(h("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),vm=pm(h("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),bm=Object.freeze({__proto__:null,schemeCategory10:_l,schemeAccent:Rl,schemeDark2:zl,schemePaired:Hs,schemePastel1:el,schemePastel2:i,schemeSet1:S,schemeSet2:Zs,schemeSet3:Xs,schemeTableau10:ol,interpolateBrBG:fn,schemeBrBG:Vo,interpolatePRGn:ii,schemePRGn:e,interpolatePiYG:Ys,schemePiYG:o,interpolatePuOr:Js,schemePuOr:_o,interpolateRdBu:Ro,schemeRdBu:No,interpolateRdGy:qo,schemeRdGy:zo,interpolateRdYlBu:Ko,schemeRdYlBu:Uo,interpolateRdYlGn:es,schemeRdYlGn:Qo,interpolateSpectral:as,schemeSpectral:rs,interpolateBuGn:Ws,schemeBuGn:Ss,interpolateBuPu:Go,schemeBuPu:zs,interpolateGnBu:$s,schemeGnBu:Ol,interpolateOrRd:rl,schemeOrRd:n,interpolatePuBuGn:Iy,schemePuBuGn:uu,interpolatePuBu:Dy,schemePuBu:By,interpolatePuRd:zy,schemePuRd:Fy,interpolateRdPu:Gy,schemeRdPu:Wy,interpolateYlGnBu:Vy,schemeYlGnBu:Hy,interpolateYlGn:qy,schemeYlGn:Yy,interpolateYlOrBr:Uy,schemeYlOrBr:$y,interpolateYlOrRd:Ky,schemeYlOrRd:Xy,interpolateBlues:Qy,schemeBlues:Zy,interpolateGreens:tm,schemeGreens:Jy,interpolateGreys:nm,schemeGreys:em,interpolatePurples:im,schemePurples:rm,interpolateReds:om,schemeReds:am,interpolateOranges:Co,schemeOranges:sm,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:lm,interpolateRainbow:function(t){(t<0||1<t)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return um.h=360*t-100,um.s=1.5-1.5*e,um.l=.8-.9*e,um+""},interpolateWarm:cm,interpolateCool:So,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,hm.r=255*(e=Math.sin(t))*e,hm.g=255*(e=Math.sin(t+fm))*e,hm.b=255*(e=Math.sin(t+dm))*e,hm+""},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:gm,interpolateMagma:ym,interpolateInferno:mm,interpolatePlasma:vm});function xm(t,e,n,r,i,a){var o,s,{guide:l={}}=n,c=function(t,e,n){var{type:n,domain:r,range:i,quantitative:a,ordinal:o}=n;return void 0!==n?n:function(t){return jm(t,hp)}(e)?"identity":"string"==typeof i?"linear":2<(r||i||[]).length?_m(t,o):void 0===r?Lm(e)?_m(t,o):Nm(e)?"time":Tm(t,i,a):Lm([r])?_m(t,o):Nm(e)?"time":Tm(t,i,a)}(t,e,n);return"string"!=typeof c?n:(s=function(t,e,n){const r=n["ratio"];if(void 0===r||null===r)return e;if(Em({type:t}))return function(t,e,n){const r=t.map(Number),i=new wg({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 Sm({type:t})?(n=e,t=r,t=Math.round(n.length*r),n.slice(0,t)):e}(c,o=function(t,e,n){var r=n["domain"];if(void 0!==r)return r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":case"quantize":case"threshold":return Pm(function(t,e){var{zero:e=!1}=e;let n=1/0,r=-1/0;for(const i of t)for(const a of i)sp(a)&&(n=Math.min(n,+a),r=Math.max(r,+a));return n===1/0?[]:e?[Math.min(0,n),r]:[n,r]}(e,n),n);case"band":case"ordinal":case"point":return Cm(e);case"quantile":return function(t){return Cm(t).sort()}(e);case"sequential":return Pm(function(t){let e=1/0,n=-1/0;for(const r of t)for(const i of r)sp(i)&&(e=Math.min(e,+i),n=Math.max(n,+i));return e===1/0?[]:[e<0?-n:e,n]}(e),n);default:return[]}}(c,e,n),n),Object.assign(Object.assign(Object.assign({},n),function(t,e,n,r){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return function(t){var{interpolate:e=Z0,nice:n=!1,tickCount:r=5}=t;return Object.assign(Object.assign({},t),{interpolate:e,nice:n,tickCount:r})}(n);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});var t=function(t,e,n){return"enterDelay"===e||"enterDuration"===e||"size"===e?0:"band"===t?F1(n)?0:.1:"point"===t?.5:0}(t,e,n),{paddingInner:e=t,paddingOuter:n=t}=r;return Object.assign(Object.assign({},r),{paddingInner:e,paddingOuter:n,padding:t,unknown:NaN})}(t,e,r,n);case"sequential":return function(t){const{palette:e="ylGnBu",offset:n}=t,r=Ue(e),i=bm["interpolate"+r];if(i)return{interpolator:n?t=>i(n(t)):i};throw new Error("Unknown palette: "+r)}(n);default:return n}}(c,t,n,r)),{domain:s,range:function(t,e,n,r,i,a,o){var s=r["range"];if("string"==typeof s)return s.split("-");if(void 0!==s)return s;var{rangeMin:l,rangeMax:c}=r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":var u=Am(n,r,i,a,o),[u,h]=function(t,e){return"enterDelay"===t?[0,1e3]:"enterDuration"==t?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:"color"===t?[e[0],Tp(e)]:"opacity"!==t&&"size"===t?[1,10]:[0,1]}(e,u);return[l||u,c||h];case"band":case"point":return[l||("size"===e?5:0),c||("size"===e?10:1)];case"ordinal":return Am(n,r,i,a,o);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}(c,t,e,n,s,i,a),expectedDomain:o,guide:l,name:t,type:c}))}function wm(t,e){var{components:e=[]}=e,n=["scale","encode","axis","legend","data","transform"],r=Array.from(new Set(t.flatMap(t=>t.channels.map(t=>t.scale)))),i=new Map(r.map(t=>[t.name,t]));for(const l of e)for(const c of function(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)):[]}(l)){var a=i.get(c),o=(null==(o=l.scale)?void 0:o[c])||{},{independent:s=!1}=o;a&&!s?(s=a["guide"],a.guide=ot({},"boolean"==typeof s?{}:s,l),Object.assign(a,o)):(s=Object.assign(Object.assign({},o),{expectedDomain:o.domain,name:c,guide:rn(l,n)}),r.push(s))}return r}function Mm(t,e){var n,r=Object.keys(t);for(const i of Object.values(e)){const{name:a,key:o}=i.getOptions();"string"==typeof o?o in t||(t[o]=i):a in t?(n=Hd(r.filter(t=>t.startsWith(a)).map(t=>+(t.replace(a,"")||0)))+1,(t[n=""+a+n]=i).getOptions().key=n):t[a]=i}}function Om(t,e){var[e]=N1("scale",e),n=t["relations"],[n]=function(o){if(!o||!Array.isArray(o))return[np,np];let s,l;return[t=>{s=t.map.bind(t),l=null==(e=t.invert)?void 0:e.bind(t);const r=o.filter(([t])=>"function"==typeof t);var e=o.filter(([t])=>"function"!=typeof t);const i=new Map(e);if(t.map=t=>{for(var[e,n]of r)if(e(t))return n;return i.has(t)?i.get(t):s(t)},l){const n=new Map(e.map(([t,e])=>[e,t])),a=new Map(r.map(([t,e])=>[e,t]));t.invert=t=>a.has(t)?t:n.has(t)?n.get(t):l(t)}return t},t=>(null!==s&&(t.map=s),null!==l&&(t.invert=l),t)]}(n);return n(e(t))}function km(t,n){var t=t.filter(({name:t,facet:e=!0})=>e&&t===n),e=t.flatMap(t=>t.domain),r=t.every(Em)?wd(e):t.every(Sm)?Array.from(new Set(e)):null;if(null!==r)for(const i of t)i.domain=r}function Em(t){t=t.type;return"string"==typeof t&&["linear","log","pow","time"].includes(t)}function Sm(t){t=t.type;return"string"==typeof t&&["band","point","ordinal"].includes(t)}function Am(t,e,n,r,i){var[i]=N1("palette",i),{category10:r,category20:a}=r,t=(t=t.flat(),Array.from(new Set(t)).length<=r.length?r:a),{palette:r=t,offset:a}=e;try{return i({type:r})}catch(t){e=function(t,n,r=t=>t){if(!t)return null;const e=Ue(t),i=bm["scheme"+e],a=bm["interpolate"+e];if(!i&&!a)return null;if(i){if(!i.some(Array.isArray))return i;t=i[n.length];if(t)return t}return n.map((t,e)=>a(r(e/n.length)))}(r,n,a);if(e)return e;throw new Error(`Unknown Component: ${r} `)}}function _m(t,e){return e||((e=t).startsWith("x")||e.startsWith("y")||e.startsWith("position")||e.startsWith("size")?"point":"ordinal")}function Tm(t,e,n){return n||("color"!==t||e?"linear":"sequential")}function Pm(t,e){var n,r;return 0===t.length?t:({domainMin:e,domainMax:n}=e,[t,r]=t,[null!=e?e:t,null!=n?n:r])}function Cm(t){return Array.from(new Set(t.flat()))}function Lm(t){return jm(t,t=>{t=typeof t;return"string"==t||"boolean"==t})}function Nm(t){return jm(t,t=>t instanceof Date)}function jm(t,e){for(const n of t)if(n.some(e))return!0;return!1}const Rm={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},Im={threshold:"threshold",quantize:"quantize",quantile:"quantile"},Bm={ordinal:"ordinal",band:"band",point:"point"},Dm={constant:"constant"};function Fm(t,e,n){const{coordinates:b=[],title:r}=e,[,x]=N1("component",n),w=t.filter(({guide:t})=>null!==t),M=[];var i,e=function(t,e,n){const[,o]=N1("component",n),s=t["coordinates"];function i(t,e,n,r){[e,t,i=[]]=[e,t,s];var i,a,e="x"===e?D1(i)?t+"Y":t+"X":"y"===e?D1(i)?t+"X":t+"Y":null;if(r&&e)return i=o(e)["props"],{defaultPosition:t,defaultSize:i,defaultOrder:a}=i,Object.assign(Object.assign({position:t,defaultSize:i,order:a,type:e},r),{scales:[n]})}return e.filter(t=>t.slider||t.scrollbar).flatMap(t=>{var{slider:e,scrollbar:n,name:r}=t;return[i("slider",r,t,e),i("scrollbar",r,t,n)]}).filter(t=>!!t)}(e,t,n);return M.push(...e),r&&(t=x("title")["props"],{defaultPosition:n,defaultOrientation:e,defaultOrder:t,defaultSize:i}=t,M.push(Object.assign({type:"title",position:n,orientation:e,order:t,defaultSize:i},"string"==typeof r?{title:r}:r))),function(t,e){t=t.filter(t=>{return!!((t=t)&&t.type&&("function"==typeof t.type||({type:t,domain:n,range:r,interpolator:e}=t,n=n&&0<n.length,r=r&&0<r.length,["linear","sqrt","log","time","pow","threshold","quantize","quantile","ordinal","band","point"].includes(t)&&n&&r)||["sequential"].includes(t)&&n&&(r||e)||["constant","identity"].includes(t)&&r));var e,n,r});return[...function(t){const n=["shape","size","color","opacity"],e=t.filter(({type:t,name:e})=>"string"==typeof t&&n.includes(e)&&!("constant"===t&&"size"===e)),r=e.filter(({type:t})=>"constant"===t),i=e.filter(({type:t})=>"constant"!==t),a=Ad(i,t=>t.field||Symbol("independent")).map(([t,e])=>[t,[...e,...r]]).filter(([,t])=>t.some(t=>"constant"!==t.type)),o=new Map(a);if(0===o.size)return[];const l=t=>t.sort(([t],[e])=>t.localeCompare(e)),s=Array.from(o).map(([,t])=>{var e,n,r,i,a=function(e){if(1===e.length)return[e];var n=[];for(let t=1;t<=e.length;t++)n.push(...Cp(e,t));return n}(t).sort((t,e)=>e.length-t.length).map(t=>({combination:t,option:t.map(t=>[t.name,function(t){t=t.type;return"string"!=typeof t?null:t in Rm?"continuous":t in Bm?"discrete":t in Im?"distribution":t in Dm?"constant":null}(t)])}));for({option:e,combination:n}of a)if(!e.every(t=>"constant"===t[1])&&e.every(t=>"discrete"===t[1]||"constant"===t[1]))return["legendCategory",n];for([r,i]of Hp)for(const{option:o,combination:s}of a)if(i.some(t=>on(l(t),l(o))))return[r,s];return null}).filter(sp);return s}(t),...function(t,n){return t.map(t=>{var e=t["name"];if(!(0<I1(n,"helix").length||F1(n))&&(!D1(n)||!B1(n)&&!z1(n))){if(e.startsWith("x"))return B1(n)?["axisArc",[t]]:z1(n)?["axisLinear",[t]]:[D1(n)?"axisY":"axisX",[t]];if(e.startsWith("y"))return B1(n)?["axisLinear",[t]]:z1(n)?["axisArc",[t]]:[D1(n)?"axisX":"axisY",[t]];if(e.startsWith("position")){if(0<I1(n,"radar").length)return["axisRadar",[t]];if(!B1(n))return["axisY",[t]]}}return null}).filter(sp)}(t,e)]}(w,b).forEach(([t,e])=>{var n=x(t)["props"],{defaultPosition:r,defaultOrientation:i,defaultSize:a,defaultOrder:o,defaultLength:s,defaultPadding:l=[0,0],defaultCrossPadding:c=[0,0]}=n,{guide:n,field:u}=ot({},...e);for(const v of Array.isArray(n)?n:[n]){var h,f,d,p,g,[y,m]=function(t,e,n,r,i,a,o){var[s]=Gm(o),e=[r.position||e,null!=s?s:n];if("string"==typeof t&&t.startsWith("axis"))return function(t,e,n,r,i){n=n[0].name;{var a,o;if("axisRadar"===t)return r=r.filter(t=>t.name.startsWith("position")),a=Hm(n),n===r.slice(-1)[0].name||null===a?[null,null]:([o,s]=Gm(i),["center",(s-o)/(r.length-1)*a+o])}{var s;if("axisY"===t&&function(t){return 0<I1(t,"parallel").length}(i))return null===(s=Hm(n))?e:D1(i)?0===s?["top",null]:["center","horizontal"]:0===s?e:["center","vertical"]}if("axisLinear"===t)return[r]=Gm(i),["center",r];if("axisArc"===t)return"inner"===e[0]?["inner",null]:["outer",null];if(B1(i))return["center",null];if(z1(i))return["center",null];if("axisX"===t&&function(t){return 0<I1(t,"reflect").length}(i)||"axisX"===t&&function(t){return 0<I1(t,"reflectY").length}(i))return["top",null];return e}(t,e,i,a,o);if("string"==typeof t&&t.startsWith("legend")&&B1(o)&&"center"===r.position)return["center","vertical"];return e}(t,r,i,v,e,w,b);(y||m)&&(p=(g="left"===y||"right"===y)?l[1]:l[0],g=g?c[1]:c[0],{size:h,order:f=o,length:d=s,padding:p=p,crossPadding:g=g}=v,M.push(Object.assign(Object.assign({title:u},v),{defaultSize:a,length:d,position:y,orientation:m,padding:p,order:f,crossPadding:g,size:h,type:t,scales:e})))}}),M}function zm(t,e,n,r,i){var[a]=N1("component",r),{scaleInstances:o,scale:s,bbox:l}=t,l={bbox:l,library:r};return a(at(t,["scaleInstances","scale","bbox"]))({coordinate:e,library:r,markState:i,scales:o,theme:n,value:l,scale:s})}function Wm(t,o){const r=["left","right","bottom","top"];return Ad(t,({type:t,position:e,group:n})=>r.includes(e)?void 0===n?t.startsWith("legend")?"legend-"+e:Symbol("independent"):"independent"===n?Symbol("independent"):n:Symbol("independent")).flatMap(([,t],e)=>{if(1===t.length)return t[0];if(void 0!==o){var n=t.filter(t=>void 0!==t.length).map(t=>t.length),r=ep(n);if(o<r)return t.forEach(t=>t.group=Symbol("independent")),t;const a=(o-r)/(t.length-n.length);t.forEach(t=>{void 0===t.length&&(t.length=a)})}var r=Hd(t,t=>t.size),n=Hd(t,t=>t.order),i=Hd(t,t=>t.crossPadding);return{type:"group",size:r,order:n,position:t[0].position,children:t,crossPadding:i}})}function Gm(t){var e,n=I1(t,"polar");return n.length?(n=n[n.length-1],{startAngle:n,endAngle:e}=Np(n),[n,e]):(n=I1(t,"radial")).length?(e=n[n.length-1],{startAngle:t,endAngle:n}=Dp(e),[t,n]):[-Math.PI/2,Math.PI/2*3]}function Hm(t){t=/position(\d*)/g.exec(t);return t?+t[1]:null}function Vm(t,e,n,r,i,a){var o=t["type"];if(["left","right","bottom","top"].includes(r)&&"string"==typeof o){const s=o;return(s.startsWith("axis")?Um:s.startsWith("group")?Ym:s.startsWith("legendContinuous")?Xm:"legendCategory"===s?Km:s.startsWith("slider")?$m:"title"===s?qm:()=>{})(t,e,n,r,i,a)}}function Ym(t,e,n,r,i,a){var o=t["children"];const s=Hd(o,t=>t.crossPadding),l=(o.forEach(t=>t.crossPadding=s),o.forEach(t=>Vm(t,e,n,r,i,a)),Hd(o,t=>t.size));t.size=l,o.forEach(t=>t.size=l)}function qm(t,e,n,r,i,a){var i=ot({},i.title,t),{title:o,subtitle:s,spacing:l=0}=i,i=at(i,["title","subtitle","spacing"]);o&&(o=nv(o,st(i,"title")),t.size=o.height),s&&(o=nv(s,st(i,"subtitle")),t.size+=l+o.height)}function $m(t,e,n,r,i,a){i=i.slider;var{trackSize:i,handleIconSize:o}=ot({},i,t),i=Math.max(i,2.4*o);t.size=i}function Um(t,e,n,r,i,a){t.transform=t.transform||[{type:"hide"}];var o,s,l,c="left"===r||"right"===r,r=tv(t,r,i),{tickLength:i=0,labelSpacing:u=0,titleSpacing:h=0}=r,r=at(r,["tickLength","labelSpacing","titleSpacing"]),a=Zm(t,a),f=Qm(r,a),i=i+u,a=(f?(u=Hd(f,t=>t.width),o=Hd(f,t=>t.height),c?t.size=u+i:({tickFilter:s,labelTransform:l}=t,!function(t,e,n,r,i){var a=ep(e,t=>t.width);if(n<a)return 1;const o=t.clone(),s=(o.update({range:[0,n]}),ev(t,i)),l=s.map(t=>o.map(t)+function(t,e){if(!t.getBandWidth)return 0;t=t.getBandWidth(e)/2;return t}(o,t)),c=s.map((t,e)=>e),u=-r[0],h=n+r[1],f=(t,e)=>{e=e.width;return[t-e/2,t+e/2]};for(let t=0;t<c.length;t++){var d=l[t],[d,p]=f(d,e[t]);if(d<u||h<p)return 1;d=l[t+1];if(d){var[d]=f(d,e[t+1]);if(d<p)return 1}}return}(a,f,e,n,s)||l?t.size=o+i:(t.labelTransform="rotate(90)",t.size=u+i))):t.size=i,Jm(r));a&&(t.size+=c?h+a.width:h+a.height)}function Xm(t,e,n,r,i,a){i=i.legendContinuous;var i=ot({},i,t),{labelSpacing:o=0,titleSpacing:s=0}=i,i=at(i,["labelSpacing","titleSpacing"]),r="left"===r||"right"===r,l=st(i,"ribbon")["size"],c=st(i,"handleIcon")["size"],l=Math.max(l,2.4*c),c=(t.size=l,Zm(t,a)),l=Qm(i,c);if(l){const u=r?"width":"height";a=Hd(l,t=>t[u]);t.size+=a+o}var c=Jm(i),{crossPadding:l=0}=(c&&(r?t.size=Math.max(t.size,c.width):t.size+=s+c.height),t);t.size+=2*l}function Km(o,s,t,e,n,r){n=n.legendCategory;const i=ot({},n,o),{itemSpacing:a,itemMarkerSize:l,titleSpacing:c,rowPadding:u,colPadding:h}=i,f=at(i,["itemSpacing","itemMarkerSize","titleSpacing","rowPadding","colPadding"]),{cols:d,length:p}=o,g=void 0===p?s:p;n="left"===e||"right"===e;const y=Jm(f),m=Qm(f,Zm(o,r),"itemLabel"),v=Math.max(m[0].height,l)+u,b=(t,e=0)=>l+t+a[0]+e;if(n){let t=-1/0,e=0,n=1,r=0,i=-1/0,a=-1/0;var x,s=y?y.height:0,w=g-s;for({width:x}of m){var M=b(x);t=Math.max(t,M),e+v>w?(n++,i=Math.max(i,r),a=Math.max(a,e),r=1,e=v):(e+=v,r++)}n<=1&&(i=r,a=e),o.size=t*n,o.length=a+s,ot(o,{cols:n,gridRow:i})}else if("number"==typeof d)e=Math.ceil(m.length/d),r=Hd(m,t=>b(t.width))*d,o.size=v*e,o.length=Math.min(r,g);else{let t=1,e=0,n=-1/0;for(var{width:O}of m){O=b(O,h);e+O>g?(n=Math.max(n,e),e=O,t++):e+=O}1===t&&(n=e),o.size=v*t,o.length=n}y&&(n?o.size=Math.max(o.size,y.width):o.size+=c+y.height);var{crossPadding:s=0}=o;o.size+=2*s}function Zm(t,e){var[e]=N1("scale",e),{scales:t,tickCount:n,tickMethod:r}=t,t=t.find(t=>"constant"!==t.type&&"identity"!==t.type);return void 0!==n&&(t.tickCount=n),void 0!==r&&(t.tickMethod=r),e(t)}function Qm(t,e,n="label"){var{labelFormatter:r,tickFilter:i,label:a=!0}=t,o=at(t,["labelFormatter","tickFilter","label"]);if(!a)return null;const s=function(t,e,n){n=ev(t,n),n=n.map(t=>{return"number"==typeof t?(e=t,Math.abs(e)<1e-15?e:parseFloat(e.toFixed(15))):t;var e}),e=e?"string"==typeof e?Op(e):e:t.getFormatter?t.getFormatter():t=>""+t;return n.map(e)}(e,r,i),l=st(o,n),c=s.map((n,r)=>Object.fromEntries(Object.entries(l).map(([t,e])=>[t,"function"==typeof e?e(n,r):e]))),u=s.map((t,e)=>{return nv(t,c[e])});return c.some(t=>t.transform)||(a=s.map((t,e)=>e),t.indexBBox=new Map(a.map(t=>[t,[s[t],u[t]]]))),u}function Jm(t){var e,n,r=t["title"],t=at(t,["title"]);return!1===(e=r)||null===e||void 0===r||({direction:t,transform:n}=e=st(t,"title"),"string"!=typeof(r=Array.isArray(r)?r.join(","):r))?null:nv(r,Object.assign(Object.assign({},e),{transform:n||("vertical"===t?"rotate(-90)":"")}))}function tv(t,e,n){var r=t["title"],[r,i]=Array.isArray(r)?[r,void 0]:[void 0,r],{axis:n,["axis"+ip(e)]:e}=n;return ot({title:r},n,e,Object.assign(Object.assign({},t),{title:i}))}function ev(t,e){t=t.getTicks?t.getTicks():t.getOptions().domain;return e?t.filter(e):t}function nv(t,e){t=(t=t)instanceof tc?t:new Ic({style:{text:""+t}}),t.attr(Object.assign(Object.assign({},e),{visibility:"none"})),e=t.getBBox();return e}function rv(t){t=t.getOptions().transformations;return t.map(([t])=>t).filter(t=>"transpose"===t).length%2!=0}function iv(t){t=t.getOptions().transformations;return t.some(([t])=>"polar"===t)}function av(t){t=t.getOptions().transformations;return t.some(([t])=>"reflect"===t)&&t.some(([t])=>t.startsWith("transpose"))}function ov(t){t=t.getOptions().transformations;return t.some(([t])=>"helix"===t)}function sv(t){t=t.getOptions().transformations;return t.some(([t])=>"parallel"===t)}function lv(t){t=t.getOptions().transformations;return t.some(([t])=>"fisheye"===t)}function cv(t){return ov(t)||iv(t)}function uv(t){var t=t.getOptions()["transformations"],[,,,t,e]=t.find(t=>"polar"===t[0]);return[+t,+e]}function hv(t,e=!0){var t=t.getOptions()["transformations"],[,t,n]=t.find(t=>"polar"===t[0]);return e?[180*+t/Math.PI,180*+n/Math.PI]:[t,n]}function fv(t){return t.replace(/-(\w)/g,function(t,e){return e.toUpperCase()})}function dv(t,o,e,n){var{width:r,height:i,x:a=0,y:s=0,inset:l=0,insetLeft:c=l,insetTop:u=l,insetBottom:h=l,insetRight:l=l,margin:f=0,marginLeft:d=f,marginBottom:p=f,marginTop:g=f,marginRight:f=f,padding:y,paddingBottom:m=y,paddingLeft:v=y,paddingRight:b=y,paddingTop:y=y}=function(t,e,n,r){var i=e["coordinates"];if(!B1(i))return e;i=t.filter(t=>"string"==typeof t.type&&t.type.startsWith("axis"));if(0===i.length)return e;const a=i.map(t=>{return tv(t,"axisArc"===t.type?"arc":"linear",n)}),o=Hd(a,t=>{return null!=(t=t.labelSpacing)?t:0}),s=i.flatMap((t,e)=>{return Qm(a[e],Zm(t,r))}).filter(sp),l=Hd(s,t=>t.height)+o,c=i.flatMap((t,e)=>{return Jm(a[e])}).filter(t=>null!==t),u=0===c.length?0:Hd(c,t=>t.height),{inset:h=l,insetLeft:f=h,insetBottom:d=h,insetTop:p=h+u,insetRight:g=h}=e;return Object.assign(Object.assign({},e),{insetLeft:f,insetBottom:d,insetTop:p,insetRight:g})}(t,o,e,n);var x=(t,e,n,r,i)=>{var a=o["marks"];return 0===a.length||0<t-r-i-.25*t?[r,i]:(a=.75*t/2,["auto"===e?a:r,"auto"===n?a:i])},w=t=>"auto"!==t&&null!=t?t:30,M=w(y),w=w(m),{paddingLeft:M,paddingRight:w}=pv(t,i-M-w,[M,w],["left","right"],o,e,n),O=r-d-f,[v,b]=x(O,v,b,M,w),M=O-v-b,{paddingTop:w,paddingBottom:O}=pv(t,M,[v,b],["bottom","top"],o,e,n),t=i-p-g,[e,n]=x(t,m,y,O,w);return{width:r,height:i,insetLeft:c,insetTop:u,insetBottom:h,insetRight:l,innerWidth:M,innerHeight:t-e-n,paddingLeft:v,paddingRight:b,paddingTop:n,paddingBottom:e,marginLeft:d,marginBottom:p,marginTop:g,marginRight:f,x:a,y:s}}function pv(t,n,r,e,i,a,o){var s=Sd(t,t=>t.position),{padding:t,paddingLeft:i=t,paddingRight:l=t,paddingBottom:c=t,paddingTop:t=t}=i,u={paddingBottom:c,paddingLeft:i,paddingTop:t,paddingRight:l};for(const p of e){var h="padding"+ip(fv(p));const t=s.get(p)||[],g=u[h],y=t=>{void 0===t.size&&(t.size=t.defaultSize)};var f,d=t=>{var e;t.size||("auto"!==g?"group"===(e=t).type?(e.children.forEach(y),e.size=Hd(e.children,t=>t.size)):e.size=e.defaultSize:(Vm(t,n,r,p,a,o),y(t)))};"number"==typeof g?t.forEach(y):0===t.length?u[h]=30:((f=Wm(t,n)).forEach(d),d=f.reduce((t,{size:e})=>t+e,0),u[h]=d)}return u}function gv(t,I,e){var B=Sd(t,t=>t.position),{paddingLeft:t,paddingRight:e,paddingTop:n,paddingBottom:D,marginLeft:r,marginTop:i,marginBottom:F,marginRight:z,innerHeight:a,innerWidth:o,insetBottom:W,insetLeft:s,insetRight:G,insetTop:l,height:c,width:H}=e,t=t+r,r=n+i,n=e+z,i=D+F,e=[t+s,r+l,o-s-G,a-l-W,"center",null,null],V={top:[t,0,o,r,"vertical",!0,fd],right:[H-n,r,n,a,"horizontal",!1,fd],bottom:[t,c-i,o,i,"vertical",!1,fd],left:[0,r,t,a,"horizontal",!0,fd],"top-left":[t,0,o,r,"vertical",!0,fd],"top-right":[t,0,o,r,"vertical",!0,fd],"bottom-left":[t,c-i,o,i,"vertical",!1,fd],"bottom-right":[t,c-i,o,i,"vertical",!1,fd],center:e,inner:e,outer:e};for(const[j,t]of B.entries()){var u=V[j],[h,Y]=Pp(t,t=>"string"==typeof t.type&&("center"===j||!(!t.type.startsWith("axis")||!["inner","outer"].includes(j))));if(h.length){y=g=p=d=f=void 0;var f=h,d=I,p=u,g=j,[f,y]=Pp(f,t=>!("string"!=typeof t.type||!t.type.startsWith("axis"))),h=(b=v=m=h=void 0,f),m=d,v=p,b=g;if("center"===b)if(!function(t){return sv(t)&&iv(t)}(m)){if(iv(m)){f=void 0;g=void 0;x=void 0;w=void 0;M=void 0;O=void 0;f=h;g=v;var[x,w,M,O]=g;for(const it of f)it.bbox={x:x,y:w,width:M,height:O}}else if(sv(m)){g=void 0;f=void 0;k=void 0;E=void 0;g=h;f=m;var k=v;var E=h[0].orientation;"horizontal"===E?function(e,t,n){const[r,i,a]=n,o=new Array(e.length+1).fill(0),s=t.map(o),l=s.filter((t,e)=>e%2==1).map(t=>t+i);for(let t=0;t<e.length;t++){var c=e[t];const i=l[t];var u=l[t+1]-i;c.bbox={x:r,y:i,width:a,height:u}}}(g,f,k):"vertical"===E&&function(e,t,n){const[r,i,,a]=n,o=new Array(e.length+1).fill(0),s=t.map(o),l=s.filter((t,e)=>e%2==0).map(t=>t+r);for(let t=0;t<e.length;t++){var c=e[t];const r=l[t];var u=l[t+1]-r;c.bbox={x:r,y:i,width:u,height:a}}}(g,f,k)}}else{S=void 0;E=void 0;A=void 0;_=void 0;q=void 0;$=void 0;var S=h;E=v;var[A,_,q,$]=E;for(const R of S)R.bbox={x:A,y:_,width:q,height:$},R.radar={index:S.indexOf(R),count:S.length}}else if("inner"===b){T=void 0;g=void 0;f=void 0;U=void 0;X=void 0;k=void 0;P=void 0;C=void 0;K=void 0;Z=void 0;var T=h;g=m;f=v;var[U,X,,f]=f,[k,P]=g.getCenter(),[g]=uv(g),f=f/2,C=g*f,K=k-C,Z=P-C;for(let t=0;t<T.length;t++)T[t].bbox={x:U+K,y:X+Z,width:2*C,height:2*C}}else if("outer"===b){m=void 0;g=void 0;Q=void 0;J=void 0;tt=void 0;et=void 0;m=h;g=v;var[Q,J,tt,et]=g;for(const at of m)at.bbox={x:Q,y:J,width:tt,height:et}}rt=nt=N=v=h=b=P=f=L=void 0;var L=y,f=d,P=p;if(0!==L.length){var[P,b,h,v]=P,[f]=uv(f),N=v/2*f/Math.sqrt(2),nt=P+h/2,rt=b+v/2;for(let t=0;t<L.length;t++)L[t].bbox={x:nt-N,y:rt-N,width:2*N,height:2*N}}}Y.length&&!function(n,t){const[e,r,i,a,o,s,l]=t,[c,u,h,f,d,p,g,y]="vertical"===o?["y",r,"x",e,"height",a,"width",i]:["x",e,"y",r,"width",i,"height",a],m=(n.sort((t,e)=>null===l||void 0===l?void 0:l(t.order,e.order)),s?u+p:u);for(let t=0,e=m;t<n.length;t++){var v=n[t],{crossPadding:b=0}=v,x=v["size"];v.bbox={[c]:s?e-x+b:e+b,[h]:f,[d]:x-2*b,[g]:y},e+=x*(s?-1:1)}t=n.filter(t=>"group"===t.type);for(const A of t){const{bbox:_,children:T}=A;var w=_[g];const P=w/T.length;var M=T.reduce((t,e)=>{e=null==(e=e.layout)?void 0:e.justifyContent;return e||t},"flex-start"),O=T.map((t,e)=>{var{length:t=P,padding:n=0}=t;return t+(e===T.length-1?0:n)}),k=ep(O),w=w-k,k="flex-start"===M?0:"center"===M?w/2:w;for(let t=0,e=_[h]+k;t<T.length;t++){var E=T[t],{padding:S=0}=E,S=t===T.length-1?0:S;E.bbox={[d]:_[d],[c]:_[c],[h]:e,[g]:O[t]-S},ot(E,{layout:{justifyContent:M}}),e+=O[t]}}}(t,u)}}function yv(t,e,n={},r=!1){return fp(t)||Array.isArray(t)&&r?t:(r=st(t,e),ot(n,r))}function mv(t,e={}){return!fp(t)&&!Array.isArray(t)&&vv(t)?ot(e,t):t}function vv(t){var e;return 0===Object.keys(t).length||({title:t,items:e}=t,void 0!==t)||void 0!==e}function bv(t,e){return"object"==typeof t?st(t,e):t}function xv(t,e,n){var{encode:r={},scale:i={},transform:a=[]}=e,e=at(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},e),{encode:r,scale:i,transform:a})]}function wv(t,i,a){return X(this,void 0,void 0,function*(){var t=a["library"],e=i["data"],[t]=N1("data",t),n=function(t){if(!t)return{type:"inline",value:null};if(Array.isArray(t))return{type:"inline",value:t};var{type:e="inline"}=t,t=at(t,["type"]);return Object.assign(Object.assign({},t),{type:e})}(e),{transform:r=[]}=n,n=yield function(t){return t.reduce((n,r)=>e=>X(this,void 0,void 0,function*(){var t=yield n(e);return r(t)}),np)}([at(n,["transform"]),...r].map(t))(e);return[Array.isArray(n)?_p(n):[],Object.assign(Object.assign({},i),{data:n})]})}function Mv(t,e,n){var r=e["encode"];if(!r)return[t,e];var i,a,o={};for([i,a]of Object.entries(r))if(Array.isArray(a))for(let t=0;t<a.length;t++)o[""+i+(0===t?"":t)]=a[t];else o[i]=a;return[t,Object.assign(Object.assign({},e),{encode:o})]}function Ov(t,e,n){const{encode:r,data:i}=e;var a;return r?(a=Ap(r,t=>{var e,n;return function(t){if("object"!=typeof t||t instanceof Date||null===t)return;t=t.type;return sp(t)}(t)?t:(e=i,{type:"function"==typeof(n=t)?"transform":"string"==typeof n&&function(t,e){return Array.isArray(t)&&t.some(t=>void 0!==t[e])}(e,n)?"field":"constant",value:t})}),[t,Object.assign(Object.assign({},e),{encode:a})]):[t,e]}function kv(t,e,n){var r=e["encode"];return r?(r=Ap(r,(t,e)=>{var n=t["type"];return"constant"!==n||(n=e).startsWith("x")||n.startsWith("y")||n.startsWith("position")||"enterDelay"===n||"enterDuration"===n||"updateDelay"===n||"updateDuration"===n||"exitDelay"===n||"exitDuration"===n?t:Object.assign(Object.assign({},t),{constant:!0})}),[t,Object.assign(Object.assign({},e),{encode:r})]):[t,e]}function Ev(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];n=n.library;const a=function(t){const[n]=N1("encode",t);return(t,e)=>void 0===e||void 0===t?null:Object.assign(Object.assign({},e),{type:"column",value:n(e)(t),field:function(t){var{type:t,value:e}=t;return"field"===t&&"string"==typeof e?e:null}(e)})}(n);n=Ap(r,t=>a(i,t));return[t,Object.assign(Object.assign({},e),{encode:n})]}function Sv(t,e,n){var{tooltip:r={}}=e;return fp(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:hp(r)&&vv(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function Av(g,t,e){const{data:y,encode:m,tooltip:n={}}=t;var r,i,a,o;return fp(n)?[g,t]:(r=e=>{if(!e)return e;if("string"==typeof e)return g.map(t=>({name:e,value:y[t][e]}));if(hp(e)){var{field:t,channel:n,color:r,name:i=t,valueFormatter:a=t=>t}=e,o="string"==typeof a?Op(a):a,s=n&&m[n],a=s&&m[n].field,l=i||a||n,c=[];for(const d of g){var u=t?y[d][t]:s?m[n].value[d]:null;c[d]={name:l,color:r,value:o(u)}}return c}if("function"!=typeof e)return e;var h=[];for(const p of g){var f=e(y[p],p,y,m);hp(f)?h[p]=f:h[p]={value:f}}return h},{title:o,items:i=[]}=n,a=at(n,["title","items"]),o=Object.assign({title:r(o),items:Array.isArray(i)?i.map(r):[]},a),[g,Object.assign(Object.assign({},t),{tooltip:o})])}function _v(l,t,e){var n,r=t["encode"],i=at(t,["encode"]);return r?(n=(r=Object.entries(r)).filter(([,t])=>{t=t.value;return Array.isArray(t[0])}).flatMap(([n,t])=>{var r=[[n,new Array(l.length).fill(void 0)]];const i=t["value"],a=at(t,["value"]);for(let e=0;e<i.length;e++){var o=i[e];if(Array.isArray(o))for(let t=0;t<o.length;t++){var s=r[t]||[""+n+t,new Array(l).fill(void 0)];s[1][e]=o[t],r[t]=s}}return r.map(([t,e])=>[t,Object.assign({type:"column",value:e},a)])}),r=Object.fromEntries([...r,...n]),[l,Object.assign(Object.assign({},i),{encode:r})]):[l,t]}function Tv(t,e,n){const{axis:r={},legend:i={},slider:a={},scrollbar:o={}}=e,s=(t,e)=>{return"boolean"==typeof t?t?{}:null:void 0===(t=t[e])||t?t:null};var l="object"==typeof r?Array.from(new Set(["x","y",...Object.keys(r)])):["x","y"];return ot(e,{scale:Object.assign(Object.assign({},Object.fromEntries(l.map(t=>{var e=s(o,t);return[t,Object.assign({guide:s(r,t),slider:s(a,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 Pv(t,e,n){var r=e["animate"];return r||void 0===r||ot(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}function Cv(l,c,u){return X(this,void 0,void 0,function*(){var[t,e]=yield function(s,l,c){return X(this,void 0,void 0,function*(){var t=c["library"],[t]=N1("transform",t),{preInference:e=[],postInference:n=[]}=l,{transform:r=[]}=s,e=[xv,wv,Mv,Ov,kv,Ev,_v,Pv,Tv,Sv,...e.map(t),...r.map(t),...n.map(t),Av];let i=[],a=s;for(const o of e)[i,a]=yield o(i,a,c);return[i,a]})}(l,c,{library:u});const{encode:n,scale:p,data:r,tooltip:i}=e;if(!1===Array.isArray(r))return null;const a=c["channels"],o=Td(Object.entries(n).filter(([,t])=>sp(t)),t=>t.map(([t,e])=>Object.assign({name:t},e)),([t])=>{const e=null==(n=/([^\d]+)\d*$/.exec(t))?void 0:n[1];var n=a.find(t=>t.name===e);return null!=n&&n.independent?t:e});var s=a.filter(t=>{const{name:e,required:n}=t;if(o.find(([t])=>t===e))return!0;if(n)throw new Error(`Missing encoding for channel: ${e}.`);return!1}).flatMap(t=>{const{name:e,scale:c,scaleKey:u,range:h,quantitative:f,ordinal:d}=t;return o.filter(([t])=>t.startsWith(e)).map(([t,e],n)=>{var r=e.some(t=>t.visual),i=e.some(t=>t.constant),a=p[t]||{},{independent:o=!1,key:s=u||t,type:i=i?"constant":r?"identity":c}=a,r=at(a,["independent","key","type"]),a="constant"===i,l=a?void 0:h;return{name:t,values:e,scaleKey:o||a?Symbol("independent"):s,scale:Object.assign(Object.assign({type:i,range:l},r),{quantitative:f,ordinal:d})}})});return[e,Object.assign(Object.assign({},c),{index:t,channels:s,tooltip:i})]})}function Lv(H,V,Y,q){var $,U;return X(this,void 0,void 0,function*(){const[n]=N1("composition",Y);var[t]=N1("interaction",Y);const I=new Set(Object.keys(Y).map(t=>{return null==(t=/mark\.(.*)/.exec(t))?void 0:t[1]}).filter(sp)),r=new Set(Object.keys(Y).map(t=>{return null==(t=/component\.(.*)/.exec(t))?void 0:t[1]}).filter(sp)),i=t=>{t=t.type;if("function"==typeof t){var{props:e={}}=t,{composite:e=!0}=e;if(e)return"mark"}return"string"==typeof t&&(I.has(t)||r.has(t))?"mark":t};const a=t=>"standardView"===i(t),B=t=>{t=t.type;return"string"==typeof t&&!!r.has(t)};var e=t=>{var e;return a(t)?[t]:(e=i(t),n({type:e,static:B(t)})(t))},o=[];const s=new Map;for(var l=new Map,c=[H],u=[];c.length;){var h=c.shift();if(a(h)){var f=l.get(h),[f,d]=f?Iv(f,h,Y):yield jv(h,Y),p=(s.set(f,h),o.push(f),d.flatMap(e).map(t=>R1(t,Y)));if(c.push(...p),p.every(a)){var g=yield Promise.all(p.map(t=>Rv(t,Y)));km(f=(f=g).flatMap(t=>Array.from(t.values())).flatMap(t=>t.channels.map(t=>t.scale)),"x"),km(f,"y");for(let t=0;t<p.length;t++){var D=p[t],F=g[t];l.set(D,F)}}}else{d="mark"===i(h)?h:yield Vv(h,Y),f=e(d);Array.isArray(f)?c.push(...f):"function"==typeof f&&u.push(f())}}q.emitter.emit(pp.BEFORE_PAINT);const y=new Map,m=new Map,v=[];V.selectAll(Uv(xh)).data(o,t=>t.key).join(t=>t.append("g").attr("className",xh).attr("id",t=>t.key).call(Nv).each(function(t){Bv(t,lt(this),v,Y,q),y.set(t,this)}),t=>t.call(Nv).each(function(t){Bv(t,lt(this),v,Y,q),m.set(t,this)}),t=>t.each(function(){for(const t of this.nameInteraction.values())t.destroy()}).remove());var b=t=>Array.from(t.entries()).map(([t,e])=>{const n=new Map;const r=function(f,d,p){return h=>X(this,void 0,void 0,function*(){var t,[e,n]=yield jv(h,d),r=(Bv(e,f,[],d,p),f),i=h,a=e,o=p,[s]=N1("interaction",s=d),l=(l=r.node()).nameInteraction,c=Hv(i).find(([t])=>"tooltip"===t);(l=l.get("tooltip"))&&(null!=(t=l.destroy)&&t.call(l),c[1])&&(t=s(Object.assign({type:"tooltip"},c[1])),l={options:i,view:a,container:r.node(),update:t=>Promise.resolve(t)},t(l,[],o.emitter));for(const u of n)Lv(u,f,d,p);return{options:h,view:e}})}(lt(e),Y,q),i=s.get(t);return{view:t,container:e,options:i,setState:(t,e=t=>t)=>n.set(t,e),update:()=>X(this,void 0,void 0,function*(){var t=rp(Array.from(n.values()))(i);return yield r(t)})}}),x=b(y);for(const P of x){const H=P["options"];var w=new Map;P.container.nameInteraction=w;for(const C of Hv(H)){var[M,O]=C;O&&(O=t(Object.assign({type:M},O))(P,x,q.emitter),w.set(M,{destroy:O}))}}var k=b(m);for(const L of k){const{options:H,container:N}=L;var E=N.nameInteraction;for(const j of Hv(H)){var[S,A]=j,_=E.get(S);_&&null!=($=_.destroy)&&$.call(_),A&&(_=t(Object.assign({type:S},A))(L,k,q.emitter),E.set(S,{destroy:_}))}}const{width:z,height:W}=H;var T=[];for(const R of u){var G=new Promise(e=>X(this,void 0,void 0,function*(){for(const t of R)yield Lv(Object.assign({width:z,height:W},t),V,Y,q);e()}));T.push(G)}q.views=o,null!=(U=q.animations)&&U.forEach(t=>null==t?void 0:t.cancel()),q.animations=v,q.emitter.emit(pp.AFTER_PAINT);b=v.filter(sp).map(Wv).map(t=>t.finished);return Promise.all([...b,...T])})}function Nv(t){t.style("transform",t=>`translate(${t.layout.x}, ${t.layout.y})`)}function jv(e,n){return X(this,void 0,void 0,function*(){var t=function(t){var{coordinate:e={},interaction:n={},style:r={},marks:i}=t,t=at(t,["coordinate","interaction","style","marks"]),a=i.map(t=>t.coordinate||{}),o=i.map(t=>t.interaction||{}),s=i.map(t=>t.viewStyle||{}),a=[...a,e].reduceRight((t,e)=>ot(t,e),{}),e=[n,...o].reduce((t,e)=>ot(t,e),{}),n=[...s,r].reduce((t,e)=>ot(t,e),{});return Object.assign(Object.assign({},t),{marks:i,coordinate:a,interaction:e,style:n})}(yield function(p,g){return X(this,void 0,void 0,function*(){var[t,e]=N1("mark",g),n=new Set(Object.keys(g).map(t=>{return null==(t=/component\.(.*)/.exec(t))?void 0:t[1]}).filter(sp));const r=p["marks"];for(var i=[],a=[],o=[...r],{width:s,height:l}=function(t){var{height:t,width:e,padding:n=0,paddingLeft:r=n,paddingRight:i=n,paddingTop:a=n,paddingBottom:n=n,margin:o=0,marginLeft:s=o,marginRight:l=o,marginTop:c=o,marginBottom:o=o,inset:u=0,insetLeft:h=u,insetRight:f=u,insetTop:d=u,insetBottom:u=u}=t,p=t=>"auto"===t?30:t;return{width:e-p(r)-p(i)-s-l-h-f,height:t-p(a)-p(n)-c-o-d-u}}(p),c={options:p,width:s,height:l};o.length;){var[u]=o.splice(0,1),u=yield Vv(u,g);const{type:f=ap("G2Mark type is required."),key:d}=u;if(n.has(f))a.push(u);else{var{props:h={}}=e(f),{composite:h=!0}=h;if(h){const r=yield t(u,c);h=Array.isArray(r)?r:[r];o.unshift(...h.map((t,e)=>Object.assign(Object.assign({},t),{key:d+"-"+e})))}else i.push(u)}}return Object.assign(Object.assign({},p),{marks:i,components:a})})}(e,n)),t=(e.interaction=t.interaction,e.coordinate=t.coordinate,R1(t,n));return Iv(yield Rv(t,n),t,n)})}function Rv(g,y){return X(this,void 0,void 0,function*(){var[t]=N1("theme",y),[,e]=N1("mark",y),{theme:n,marks:r,coordinates:i=[]}=g,a=t(Gv(n)),o=new Map;for(const f of r){var s,l=f["type"],{props:l={}}=e(l),l=yield Cv(f,l,y);l&&([l,s]=l,o.set(l,s))}for(const d of Sd(Array.from(o.values()).flatMap(t=>t.channels),({scaleKey:t})=>t).values()){var c=d.reduce((t,{scale:e})=>ot(t,e),{}),u=d[0]["scaleKey"],h=d[0]["values"],h=Array.from(new Set(h.map(t=>t.field).filter(sp)));const g=ot({guide:{title:0===h.length?void 0:h},field:h[0]},c);h=d[0]["name"],c=d.flatMap(({values:t})=>t.map(t=>t.value));const p=Object.assign(Object.assign({},xm(h,c,g,i,a,y)),{key:u});d.forEach(t=>t.scale=p)}return o})}function Iv(t,e,n){var[r]=N1("mark",n),[i]=N1("theme",n),[a]=N1("labelTransform",n);const{key:o,frame:s=!1,theme:I,clip:B,style:l={},labelTransform:D=[]}=e;var i=i(Gv(I)),c=Array.from(t.values());const u=wm(c,e);var c=Fm(function(t,e,n){for(var[r]of n.entries())if("cell"===r.type)return t.filter(t=>"shape"!==t.name);if(1!==e.length||t.some(t=>"shape"===t.name))return t;n=e[0].defaultShape;if(!["point","line","rect","hollow"].includes(n))return t;e=(null==(e=t.find(t=>"color"===t.name))?void 0:e.field)||null,e={field:e,name:"shape",type:"constant",domain:[],range:[{point:"point",line:"hyphen",rect:"square",hollow:"hollow"}[n]]};return[...t,e]}(Array.from(u),c,t),e,n).map(t=>{t=ot(t,t.style);return delete t.style,t}),h=dv(c,e,i,n),f=function(t,e,n){var[n]=N1("coordinate",n),{innerHeight:r,innerWidth:i,insetLeft:a,insetTop:o,insetRight:s,insetBottom:l,marginLeft:c,marginTop:u}=t,{coordinates:e=[]}=e,e=(e=e).find(t=>"cartesian"===t.type)?e:[...e,{type:"cartesian"}];return new C1(Object.assign(Object.assign({},t),{x:a+c,y:o+u,width:i-a-s,height:r-l-o,transformations:e.map(n).flat()}))}(h,e,n),e=s?ot({mainLineWidth:1,mainStroke:"#000"},l):l,d=(gv(Wm(c),f,h),{});for(const x of c){var{scales:F=[]}=x;const u=[];for(const w of F){var z=w["name"],p=Om(w,n);u.push(p),Mm(d,{[z]:p})}x.scaleInstances=u}var g,y,m=[];for([g,y]of t.entries()){const{children:M,dataDomain:O,modifier:k,key:E}=g,{index:S,channels:A,tooltip:_}=y;var v=Ap(Object.fromEntries(A.map(({name:t,scale:e})=>[t,e])),t=>Om(t,n));Mm(d,v);const T=function(t,e){var n={};for(const s of t){var{values:r,name:i}=s;const l=e[i];for(const c of r){var{name:a,value:o}=c;n[a]=o.map(t=>l.map(t))}}return n}(A,v),[P,C,L]=function([e,n,t]){if(t)return[e,n,t];var r=[],i=[];for(let t=0;t<e.length;t++){var a=e[t],o=n[t];o.every(([t,e])=>sp(t)&&sp(e))&&(r.push(a),i.push(o))}return[r,i]}(r(g)(S,v,T,f));var b=O||P.length;const N=k?k(C,b,h):[],j=t=>{var e;return null==(e=null==(e=_.title)?void 0:e[t])?void 0:e.value},R=e=>_.items.map(t=>t[e]);b=P.map((t,e)=>{var n=Object.assign({points:C[e],transform:N[e],index:t,markKey:E,viewKey:o},_&&{title:j(t),items:R(t)});for(const[r,i]of Object.entries(T))n[r]=i[t],L&&(n["series"+Ue(r)]=L[e].map(t=>i[t]));return L&&(n.seriesIndex=L[e]),L&&_&&(n.seriesItems=L[e].map(t=>R(t)),n.seriesTitle=L[e].map(t=>j(t))),n}),b=(y.data=b,y.index=P,null==M?void 0:M(b,v,h));m.push(...b||[])}return[{layout:h,theme:i,coordinate:f,markState:t,key:o,clip:B,scale:d,style:e,components:c,labelTransform:rp(D.map(a))},m]}function Bv(tt,et,nt,rt,it){X(this,void 0,void 0,function*(){const{components:t,theme:n,layout:e,markState:r,coordinate:i,key:a,style:I,clip:o,scale:s}=tt,{width:B,height:D}=e,F=at(e,["x","y","width","height"]),l=["view","plot","main","content"];var c,u=l.map((t,e)=>e);const h=l.map(t=>lp(Object.assign({},n.view,I),t)),z=["a","margin","padding","inset"].map(t=>st(F,t)),f=t=>t.style("x",t=>m[t].x).style("y",t=>m[t].y).style("width",t=>m[t].width).style("height",t=>m[t].height).each(function(t){var e,n,r=lt(this),t=h[t];for([e,n]of Object.entries(t))r.style(e,n)});let d=0,p=0,g=B,y=D;const m=u.map(t=>{var{left:t=0,top:e=0,bottom:n=0,right:r=0}=z[t];return d+=t,p+=e,g-=t+r,y-=e+n,{x:d,y:p,width:g,height:y}}),v=(et.selectAll(Uv(kh)).data(u.filter(t=>sp(h[t])),t=>l[t]).join(t=>t.append("rect").attr("className",kh).style("zIndex",-2).call(f),t=>t.call(f),t=>t.remove()),function(t){let e=-1/0,n=1/0;for(var[r,i]of t){var{animate:r={}}=r,i=i["data"],{enter:r={},update:a={},exit:o={}}=r,{type:s,duration:l=300,delay:c=0}=a,{type:u,duration:h=300,delay:f=0}=r,{type:d,duration:p=300,delay:g=0}=o;for(const E of i){var{updateType:y=s,updateDuration:m=l,updateDelay:v=c,enterType:b=u,enterDuration:x=h,enterDelay:w=f,exitDuration:M=p,exitDelay:O=g,exitType:k=d}=E;void 0!==y&&!y||(e=Math.max(e,m+v),n=Math.min(n,v)),void 0!==k&&!k||(e=Math.max(e,M+O),n=Math.min(n,O)),void 0!==b&&!b||(e=Math.max(e,x+w),n=Math.min(n,w))}}return e===-1/0?null:[n,e-n]}(r)),b=!!v&&{duration:v[1]};for([,c]of Ad(t,t=>t.type+"-"+t.position))c.forEach((t,e)=>t.index=e);var x,w,M,u=et.selectAll(Uv(Mh)).data(t,t=>`${t.type}-${t.position}-`+t.index).join(t=>t.append("g").style("zIndex",({zIndex:t})=>t||-1).attr("className",Mh).append(t=>zm(ot({animate:b,scale:s},t),i,n,rt,r)),t=>t.transition(function(t){var{preserve:e=!1}=t;if(!e)return e=zm(ot({animate:b,scale:s},t),i,n,rt,r)["attributes"],[t]=this.childNodes,t.update(e)})).transitions();nt.push(...u.flat().filter(sp));const O=et.selectAll(Uv(wh)).data([e],()=>a).join(t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",wh).call(Yv).call($v,Array.from(r.keys())).call(Xv,o),t=>t.call($v,Array.from(r.keys())).call(t=>{if(!v)return Yv(t);{const[l,c]=v;t.transition(function(t){var{x:e,y:n,width:r,height:i}=this.style,{paddingLeft:t,paddingTop:a,innerWidth:o,innerHeight:s}=t;return this.animate([{x:e,y:n,width:r,height:i},{x:t,y:a,width:o,height:s}],{delay:l,duration:c,fill:"both"})})}}).call(Xv,o)).transitions();nt.push(...O.flat());for([x,w]of r.entries()){var W=w["data"];const{key:a,class:q,type:_}=x;var k=et.select("#"+a);const T=function(s,t,e,n,r){const[l]=N1("shape",n),c=s["data"],{defaultShape:u,data:i,shape:h}=t,f=i.map(t=>t.points),{theme:d,coordinate:a}=e,{type:p,style:g={}}=s,y=Object.assign(Object.assign({},r),{document:j1(r),coordinate:a,theme:d});return t=>{var{shape:e=u}=g,{shape:e=e,points:n,seriesIndex:r,index:i}=t,t=at(t,["shape","points","seriesIndex","index"]),t=Object.assign(Object.assign({},t),{index:i});const a=r?r.map(t=>c[t]):c[i],o=r||i;r=Ap(g,t=>Dv(t,a,o,c));return(h[e]?h[e](r,y):l(Object.assign(Object.assign({},r),{type:qv(s,e)}),y))(n,t,Fv(d,p,e,u),f)}}(x,w,tt,rt,it),$=(E=x,M=w,zv("enter",E,M,tt,rt)),P=(E=x,M=w,zv("update",E,M,tt,rt)),U=(E=x,M=w,zv("exit",E,M,tt,rt));var E=function(t,e,n,r){t=t.node().parentElement;return t.findAll(t=>void 0!==t.style.facet&&t.style.facet===n&&t!==e.node()).flatMap(t=>t.getElementsByClassName(r))}(et,k,q,"element");const O=k.selectAll(Uv(bh)).selectFacetAll(E).data(W,t=>t.key,t=>t.groupKey).join(t=>t.append(T).attr("className",bh).attr("markType",_).transition(function(t){return $(t,[this])}),t=>t.call(t=>{const l=t.parent(),c=function(n){const r=new Map;return t=>{var e;return r.has(t)?r.get(t):(e=n(t),r.set(t,e),e)}}(t=>{var[t,e]=t.getBounds().min;return[t,e]});t.transition(function(t,e){n=this,r=l,s=c,n.__facet__&&(i=n.parentNode.parentNode,o=r.parentNode,[i,a]=s(i),[s,o]=s(o),i=`translate(${i-s}, ${a-o})`,s=n.style.transform,a="none"===(a=s)||void 0===a?"":s,n.style.transform=(a+" "+i).trimStart(),r.append(n));var n,r,i,a,o=T(t,e),s=P(t,[this],[o]);return null===s&&(this.nodeName===o.nodeName?op(this,o):(this.parentNode.replaceChild(o,this),o.className=bh,o.markType=_)),s}).attr("markType",_).attr("className",bh)}),t=>t.each(function(){this.__removed__=!0}).transition(function(t){return U(t,[this])}).remove(),t=>t.append(T).attr("className",bh).attr("markType",_).transition(function(t){var e=this["__fromElements__"],t=P(t,e,[this]);return new dp(e,null,this.parentNode).transition(t).remove(),t}),t=>t.transition(function(t){var e=new dp([],this.__toData__,this.parentNode).append(T).attr("className",bh).attr("markType",_).nodes();return P(t,[this],e)}).remove()).transitions();nt.push(...O.flat())}{var S=tt,G=et,H=rt,V=it,A,Y;const[X]=N1("labelTransform",H),{markState:K,labelTransform:C}=S,Z=G.select(Uv(vh)).node(),L=new Map,N=new Map,Q=Array.from(K.entries()).flatMap(([t,e])=>{var{labels:n=[],key:r}=t;const i=function(t,e,n,r,i){const[l]=N1("shape",r),c=t["data"],{data:a,defaultLabelShape:u}=e,h=a.map(t=>t.points),{theme:f,coordinate:o}=n,d=Object.assign(Object.assign({},i),{document:j1(i),theme:f,coordinate:o});return t=>{const{index:e,points:n}=t,r=c[e];var{formatter:i=t=>""+t,style:a,render:o}=t,t=at(t,["formatter","transform","style","render"]),t=Ap(Object.assign(Object.assign({},t),a),t=>Dv(t,r,e,c)),{shape:a=u,text:s}=t,t=at(t,["shape","text"]),i="string"==typeof i?Op(i):i,i=Object.assign(Object.assign({},t),{text:i(s,r,e,c),datum:r}),s=Object.assign({type:"label."+a,render:o},t);return l(s,d)(n,i,Fv(f,"label",a,"label"),h)}}(t,e,S,H,V),a=G.select("#"+r).selectAll(Uv(bh)).nodes().filter(t=>!t.__removed__);return n.flatMap((e,n)=>{const r=at(e,["transform"]);return a.flatMap(t=>{t=function(n,r,i){const{seriesIndex:t,seriesKey:a,points:o,key:e,index:s}=i.__data__,l=function(t){const e=t.cloneNode(),n=t.getAnimations(),r=(e.style.visibility="hidden",n.forEach(t=>{t=t.effect.getKeyframes();e.attr(t[t.length-1])}),t.parentNode.appendChild(e),e.getLocalBounds()),{min:i,max:a}=(e.destroy(),r);return[i,a]}(i);if(!t)return[Object.assign(Object.assign({},n),{key:e+"-"+r,bounds:l,index:s,points:o,dependentElement:i})];var c=function(t){t=t.selector;if(!t)return null;if("function"==typeof t)return t;if("first"===t)return t=>[t[0]];if("last"===t)return t=>[t[t.length-1]];throw new Error("Unknown selector: "+t)}(n),u=t.map((t,e)=>Object.assign(Object.assign({},n),{key:a[e]+"-"+r,bounds:[o[e]],index:t,points:o,dependentElement:i}));return c?c(u):u}(r,n,t);return t.forEach(t=>{L.set(t,i),N.set(t,e)}),t})})}),j=lt(Z).selectAll(Uv(Oh)).data(Q,t=>t.key).join(t=>t.append(t=>L.get(t)(t)).attr("className",Oh),t=>t.each(function(t){op(this,L.get(t)(t))}),t=>t.remove()).nodes(),J=Sd(j,t=>N.get(t.__data__)),R=S["coordinate"];for([A,Y]of J){var{transform:A=[]}=A;rp(A.map(X))(Y,R)}C&&C(j,R)}})}function Dv(t,e,n,r){return"function"==typeof t?t(e,n,r):"string"==typeof t&&void 0!==e[t]?e[t]:t}function Fv(t,e,n,r){var i;if("string"==typeof e)return i=t["color"],e=(t=t[e]||{})[n]||t[r],Object.assign({color:i},e)}function zv(o,t,e,n,r){var[,i]=N1("shape",r);const[s]=N1("animation",r);var{defaultShape:r,shape:e}=e,{theme:n,coordinate:a}=n,l=`default${Ue(o)}Animation`;const{[l]:c}=(null==(e=e[r])?void 0:e.props)||i(qv(t,r)).props,{[o]:u={}}=n,h=(null==(e=t.animate)?void 0:e[o])||{},f={coordinate:a};return(t,e,n)=>{var{[o+"Type"]:t,[o+"Delay"]:r,[o+"Duration"]:i,[o+"Easing"]:a}=t,t=Object.assign({type:t||c},h);return t.type?(r={delay:r,duration:i,easing:a},i=s(t,f)(e,n,ot(u,r)),Array.isArray(i)?i:[i]):null}}function Wv(t){return t.finished.then(()=>{t.cancel()}),t}function Gv(t={}){var e;return"string"==typeof t?{type:t}:({type:e="classic"}=t,t=at(t,["type"]),Object.assign(Object.assign({},t),{type:e}))}function Hv(t){var{interaction:t={}}=t;return Object.entries(ot({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},t))}function Vv(r,i){return X(this,void 0,void 0,function*(){var t={library:i},e=r["data"],n=at(r,["data"]);return null==e?r:([,{data:e}]=yield wv(0,{data:e},t),Object.assign({data:e},n))})}function Yv(t){t.style("x",t=>t.paddingLeft).style("y",t=>t.paddingTop).style("width",t=>t.innerWidth).style("height",t=>t.innerHeight)}function qv(t,e){t=t.type;return"string"==typeof e?t+"."+e:e}function $v(t,e){const n=t=>void 0!==t.class?""+t.class:"";0===t.nodes().length||(t.selectAll(Uv(mh)).data(e,t=>t.key).join(t=>t.append("g").attr("className",mh).attr("id",t=>t.key).style("facet",n).style("fill","transparent").style("zIndex",t=>{return null!=(t=t.zIndex)?t:0}),t=>t.style("facet",n).style("fill","transparent").style("zIndex",t=>{return null!=(t=t.zIndex)?t:0}),t=>t.remove()),t.select(Uv(vh)).node())||t.append("g").attr("className",vh).style("zIndex",0)}function Uv(...t){return t.map(t=>"."+t).join("")}function Xv(t,i){t.node()&&t.style("clipPath",t=>{var e,n,r;return i?({paddingTop:t,paddingLeft:e,innerWidth:n,innerHeight:r}=t,new Nc({style:{x:e,y:t,width:n,height:r}})):null})}function Kv(t){for(var t=ot({},t),e=new Map([[t,null]]),n=new Map([[null,-1]]),r=[t];r.length;){var i,a,o=r.shift(),{children:s=[]}=(void 0===o.key&&(a=e.get(o),i=n.get(o),a=null===a?"0":a.key+"-"+i,o.key=a),o);if(Array.isArray(s))for(let t=0;t<s.length;t++){var l=ot({},s[t]);s[t]=l,e.set(l,o),n.set(l,t),r.push(l)}}return t}function Zv(t,e={},n=()=>{},r=t=>{throw t}){const{width:i=640,height:a=480,theme:o}=t,s=(o||ap('ChartOptions.theme is required, such as `const chart = new Chart({ theme: "classic"})`.'),Kv(t)),{canvas:l=(t=i,h=a,f=new rd,f.registerPlugin(new ld),new su({width:t,height:h,container:document.createElement("div"),renderer:f})),emitter:c=new ud,library:u}=e;var h,f;e.canvas=l,e.emitter=c,l.resize(i,a),c.emit(pp.BEFORE_RENDER);const d=lt(l.document.documentElement);return l.ready.then(()=>Lv(Object.assign(Object.assign({},s),{width:i,height:a}),d,u,e)).then(()=>{l.requestAnimationFrame(()=>{c.emit(pp.AFTER_RENDER),null!=n&&n()})}).catch(t=>{null!=r&&r(t)}),"string"==typeof(t=l.getConfig().container)?document.getElementById(t):t}function Qv(t,e={},n=!1){var r,{canvas:e,emitter:i}=e;e&&(null!=(r=(r=e).getRoot().querySelectorAll("."+xh))&&r.forEach(t=>{var{nameInteraction:t=new Map}=t;0<(null==t?void 0:t.size)&&Array.from(null==t?void 0:t.values()).forEach(t=>{null!=t&&t.destroy()})}),n?e.destroy():e.destroyChildren()),i.off()}const Jv=({value:e})=>t=>t.map(()=>e),tb=(Jv.props={},({value:e})=>t=>t.map(e)),eb=(tb.props={},({value:e})=>t=>t.map(t=>t[e])),nb=(eb.props={},({value:t})=>()=>t);function rb(t,e){if(null!==t)return{type:"column",value:t,field:e}}function ib(t,e){t=rb(t,e);return Object.assign(Object.assign({},t),{inferred:!0})}function ab(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function ob(t,e){var n=[];for(const r of t)n[r]=e;return n}function sb(t,e){var t=t[e];return t?({value:e,field:t=null}=t,[e,t]):[null,null]}function lb(t,...e){for(const i of e){if("string"!=typeof i)return[i,null];var[n,r]=sb(t,i);if(null!==n)return[n,r]}return[null,null]}function cb(t){return!(t instanceof Date)&&"object"==typeof t}nb.props={};_l=()=>(t,e)=>{var n=e["encode"],n=n["y1"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{y1:ib(ob(t,0))}})]};function ub(t,e,n){const r=n["encode"];if(null===t)return[e];n=t;const i=(Array.isArray(n)?n:[n]).map(t=>{return[t,null==(t=sb(r,t))?void 0:t[0]]}).filter(([,t])=>sp(t));return Array.from(Sd(e,e=>i.map(([,t])=>t[e]).join("-")).values())}function hb(t){var a,r;return Array.isArray(t)?(a=t,(i,t,e)=>(n,r)=>a.reduce((t,e)=>0!==t?t:fd(i[n][e],i[r][e]),0)):"function"==typeof t?(r=t,(e,t,n)=>vb(t=>r(e[t]))):"series"===t?pb:"value"===t?gb:"sum"===t?yb:"maxIndex"===t?mb:()=>null}function fb(t,e){for(const n of t)n.sort(e)}function db(t,e){return(null==e?void 0:e.domain)||Array.from(new Set(t))}function pb(t,e,n){return vb(t=>n[t])}function gb(t,e,n){return vb(t=>e[t])}function yb(t,n,e){t=_p(t),t=Array.from(Sd(t,t=>e[+t]).entries());const r=new Map(t.map(([t,e])=>[t,e.reduce((t,e)=>t+ +n[e])]));return vb(t=>r.get(e[t]))}function mb(t,n,e){t=_p(t),t=Array.from(Sd(t,t=>e[+t]).entries());const r=new Map(t.map(([t,e])=>[t,Vd(e,t=>n[t])]));return vb(t=>r.get(e[t]))}function vb(n){return(t,e)=>fd(n(t),n(e))}_l.props={};const bb=(t={})=>{const{groupBy:T="x",orderBy:P=null,reverse:C=!1,y:L="y",y1:N="y1",series:j=!0}=t;return(t,e)=>{var{data:n,encode:r,style:i={}}=e,[a,o]=sb(r,"y"),[s,l]=sb(r,"y1"),[r]=j?lb(r,"series","color"):sb(r,"color"),c=ub(T,t,e),n=hb(P)(n,a,r),u=(n&&fb(c,n),new Array(t.length)),h=new Array(t.length),f=new Array(t.length),d=[],p=[];for(const E of c){C&&E.reverse();var g=s?+s[E[0]]:0,y=[],m=[];for(const S of E){var v=f[S]=+a[S]-g;v<0?m.push(S):0<=v&&y.push(S)}var b=0<y.length?y:m,x=0<m.length?m:y;let t=y.length-1,e=0;for(;0<t&&0===a[b[t]];)t--;for(;e<x.length-1&&0===a[x[e]];)e++;d.push(b[t]),p.push(x[e]);let n=g;for(const A of m.reverse()){var w=f[A];n=u[A]=(h[A]=n)+w}let r=g;for(const _ of y){var M=f[_];0<M?r=u[_]=(h[_]=r)+M:u[_]=h[_]=r}}const O=new Set(d),k=new Set(p);r="y"===L?u:h,n="y"===N?u:h;return[t,ot({},e,{encode:{y0:ib(a,o),y:rb(r,o),y1:rb(n,l)},style:Object.assign({first:(t,e)=>O.has(e),last:(t,e)=>k.has(e)},i)})]}},xb=(bb.props={},(t={})=>{const{channel:s="x"}=t;return(t,e)=>{const n=e["encode"];var r=e["tooltip"];if(fp(r))return[t,e];r=r.title;if(void 0!==r)return[t,e];var i=Object.keys(n).filter(t=>t.startsWith(s)).filter(t=>!n[t].inferred).map(t=>sb(n,t)).filter(([t])=>t).map(t=>t[0]);if(0===i.length)return[t,e];var a=[];for(const o of t)a[o]={value:i.map(t=>t[o]).join(", ")};return[t,ot({},e,{tooltip:{title:a}})]}});xb.props={};Rl=()=>(t,e)=>{var n=e["encode"],n=n["x"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{x:ib(ob(t,0))},scale:{x:{guide:null}}})]},Rl.props={},zl=()=>(t,e)=>{var n=e["encode"],n=n["y"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{y:ib(ob(t,0))},scale:{y:{guide:null}}})]},zl.props={},Hs=()=>(t,e)=>{var n=e["encode"],n=n["size"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{size:ab(ob(t,3))}})]};Hs.props={};const wb=()=>(t,e)=>{var n=e["encode"],r=n["key"],n=at(n,["key"]);if(void 0!==r)return[t,e];const i=Object.values(n).map(({value:t})=>t);r=t.map(e=>i.filter(Array.isArray).map(t=>t[e]).join("-"));return[t,ot({},e,{encode:{key:rb(r)}})]};wb.props={};el=()=>(t,e)=>{var n=e["encode"],{series:r,color:i}=n;return void 0!==r||void 0===i?[t,e]:([r,i]=sb(n,"color"),[t,ot({},e,{encode:{series:rb(r,i)}})])},el.props={},i=()=>(t,e)=>{var n=e["data"];return!Array.isArray(n)||n.some(cb)?[t,e]:[t,ot({},e,{encode:{y:rb(n)}})]},i.props={},S=()=>(t,e)=>{var n=e["data"];return!Array.isArray(n)||n.some(cb)?[t,e]:[t,ot({},e,{encode:{x:rb(n)}})]},S.props={},Zs=()=>(t,e)=>{var n=e["encode"],r=n["y1"];return r?[t,e]:([r]=sb(n,"y"),[t,ot({},e,{encode:{y1:rb([...r])}})])},Zs.props={},Xs=()=>(t,e)=>{var n=e["encode"],r=n["x1"];return r?[t,e]:([r]=sb(n,"x"),[t,ot({},e,{encode:{x1:rb([...r])}})])};Xs.props={};const Mb=t=>{const i=t["channel"];return(t,e)=>{const{encode:a,tooltip:n}=e;var r;return fp(n)||({items:r=[]}=n,!r)||0<r.length?[t,e]:(r=(Array.isArray(i)?i:[i]).flatMap(e=>Object.keys(a).filter(t=>t.startsWith(e)).map(t=>{var{field:e,value:n,inferred:r=!1,aggregate:i}=a[t];return r?null:i&&n?{channel:t}:e?{field:e}:n?{channel:t}:null}).filter(t=>null!==t)),[t,ot({},e,{tooltip:{items:r}})])}};Mb.props={};ol=()=>(t,e)=>[t,ot({scale:{x:{padding:0},y:{padding:0}}},e)],ol.props={},fn=()=>(t,e)=>{var{style:n={}}=e,r=at(e,["data","style"]),{x:i,y:a}=n,n=at(n,["x","y"]);return null==i||null==a?[t,e]:[[0],ot({},r,{data:[0],cartesian:!0,encode:{x:rb([i||0]),y:rb([a||0])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:n})]},fn.props={},Vo=()=>(t,e)=>{var{style:n={}}=e;return[t,ot({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter(([,t])=>"function"==typeof t).map(([t,e])=>[t,()=>e])))})]},Vo.props={},ii=()=>(t,e)=>{var n,r=e["data"];return!Array.isArray(r)||r.some(cb)?[t,e]:(n=(r=Array.isArray(r[0])?r:[r]).map(t=>t[0]),r=r.map(t=>t[1]),[t,ot({},e,{encode:{x:rb(n),y:rb(r)}})])},ii.props={},e=()=>(t,e)=>{var{style:n={},encode:r}=e,r=r["series"],n=n["gradient"];return!n||r?[t,e]:[t,ot({},e,{encode:{series:ab(ob(t,void 0))}})]};e.props={};const Ob=(t={})=>{const{groupBy:c="x",reverse:u=!1,orderBy:h,padding:f}=t;return at(t,["groupBy","reverse","orderBy","padding"]),(t,e)=>{var{data:n,encode:r,scale:i}=e,i=i["series"],[a]=sb(r,"y"),[r]=lb(r,"series","color"),o=db(r,i),i=ub(c,t,e),n=hb(h)(n,a,r),s=(n&&fb(i,n),new Array(t.length));for(const l of i){u&&l.reverse();for(let t=0;t<l.length;t++)s[l[t]]=o[t]}return[t,ot({},e,{scale:{series:{domain:o,paddingInner:f}},encode:{series:rb(s)}})]}},kb=(Ob.props={},t=>{const{groupBy:p=["x"],reducer:g=(t,e)=>e[t[0]],orderBy:y=null,reverse:m=!1,duration:v}=t;return(n,t)=>{const e=t["encode"];var r=(Array.isArray(p)?p:[p]).map(t=>[t,sb(e,t)[0]]);if(0===r.length)return[n,t];let i=[n];for(const[,h]of r){var a=[];for(const n of i){var o=Array.from(Sd(n,t=>h[t]).values());a.push(...o)}i=a}if(y){const[f]=sb(e,y);f&&i.sort((t,e)=>g(t,f)-g(e,f)),m&&i.reverse()}r=(v||3e3)/i.length;const[s]=v?[ob(n,r)]:lb(e,"enterDuration",ob(n,r));var[l]=lb(e,"enterDelay",ob(n,0)),c=new Array(n.length);for(let t=0,e=0;t<i.length;t++){const n=i[t];var u=Hd(n,t=>+s[t]);for(const d of n)c[d]=+l[d]+e;e+=u}return[n,ot({},t,{encode:{enterDuration:ab(s),enterDelay:ab(c)}})]}});kb.props={};const Eb=(t={})=>{const{groupBy:p="x",basis:g="max"}=t;return(e,t)=>{const{encode:n,tooltip:r}=t;var i=at(n,["x"]),a=Object.entries(i).filter(([t])=>t.startsWith("y")).map(([t])=>[t,sb(n,t)[0]]),[,o]=a.find(([t])=>"y"===t),s=a.map(([t])=>[t,new Array(e.length)]),i=ub(p,e,t),l="function"==typeof(f=g)?f:{min:(t,e)=>Yd(t,t=>e[+t]),max:(t,e)=>Hd(t,t=>e[+t]),first:(t,e)=>e[t[0]],last:(t,e)=>e[t[t.length-1]],mean:(t,e)=>Zd(t,t=>e[+t]),median:(t,e)=>Qd(t,t=>e[+t]),sum:(t,e)=>ep(t,t=>e[+t]),deviation:(t,e)=>xd(t,t=>e[+t])}[f]||Hd;for(const e of i){var c=l(e,o);for(const d of e)for(let t=0;t<a.length;t++){var[,u]=a[t],[,h]=s[t];h[d]=+u[d]/c}}var f=fp(r)||(null==r?void 0:r.items)&&0!==(null==r?void 0:r.items.length);return[e,ot({},t,Object.assign({encode:Object.fromEntries(s.map(([t,e])=>[t,rb(e,sb(n,t)[1])]))},!f&&n.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};function Sb(t,e,n){return null===t?[-.5,.5]:(t=db(t,e),[-(e=new cg({domain:t,range:[0,1],padding:n}).getBandWidth())/2,e/2])}function Ab(t,e,n){return e*(1-t)+n*t}Eb.props={};const _b=(t={})=>{const{padding:e=0,paddingX:l=e,paddingY:c=e,random:u=Math.random}=t;return(t,e)=>{var{encode:n,scale:r}=e,{x:r,y:i}=r,[a]=sb(n,"x"),[n]=sb(n,"y");const o=Sb(a,r,l),s=Sb(n,i,c);a=t.map(()=>Ab(u(),...s)),r=t.map(()=>Ab(u(),...o));return[t,ot({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:rb(a),dx:rb(r)}})]}},Tb=(_b.props={},(t={})=>{const{padding:a=0,random:o=Math.random}=t;return(t,e)=>{var{encode:n,scale:r}=e,r=r["x"],[n]=sb(n,"x");const i=Sb(n,r,a);n=t.map(()=>Ab(o(),...i));return[t,ot({scale:{x:{padding:.5}}},e,{encode:{dx:rb(n)}})]}}),Pb=(Tb.props={},(t={})=>{const{groupBy:g="x"}=t;return(e,t)=>{const n=t["encode"];var r=at(n,["x"]);const i=Object.entries(r).filter(([t])=>t.startsWith("y")).map(([t])=>[t,sb(n,t)[0]]);var a=i.map(([t])=>[t,new Array(e.length)]),o=ub(g,e,t),s=new Array(o.length);for(let t=0;t<o.length;t++){const e=o[t];var[l,c]=wd(e.flatMap(e=>i.map(([,t])=>+t[e])));s[t]=(l+c)/2}var u=Math.max(...s);for(let t=0;t<o.length;t++){var h=u-s[t];const e=o[t];for(const p of e)for(let t=0;t<i.length;t++){var[,f]=i[t],[,d]=a[t];d[p]=+f[p]+h}}return[e,ot({},t,{encode:Object.fromEntries(a.map(([t,e])=>[t,rb(e,sb(n,t)[1])]))})]}}),Cb=(Pb.props={},(t={})=>{const{groupBy:u="x",series:h=!0}=t;return(t,e)=>{var n=e["encode"];const[r]=sb(n,"y");var[,i]=sb(n,"y1"),n=(h?lb(n,"series","color"):sb(n,"color"),ub(u,t,e)),a=new Array(t.length);for(const c of n){var o=c.map(t=>+r[t]);for(let n=0;n<c.length;n++){var s=c[n],l=Math.max(...o.filter((t,e)=>e!==n));a[s]=r[s]>l?l:r[s]}}return[t,ot({},e,{encode:{y1:rb(a,i)}})]}});function Lb(t,e){return[t[0]]}function Nb(t,e){return[t[t.length-1]]}function jb(t,e){return[t[Vd(t,t=>e[t])]]}function Rb(t,e){return[t[qd(t,t=>e[t])]]}Cb.props={};const Ib=(t={})=>{const{groupBy:a="series",channel:o,selector:s}=t;return(t,e)=>{var n=e["encode"],t=ub(a,t,e);const[r]=sb(n,o),i="function"==typeof(n=s)?n:{first:Lb,last:Nb,max:jb,min:Rb}[n]||Lb;return[t.flatMap(t=>i(t,r)),e]}},Bb=(Ib.props={},(t={})=>{var e=t["selector"],t=at(t,["selector"]);return Ib(Object.assign({channel:"x",selector:e},t))}),Db=(Bb.props={},(t={})=>{var e=t["selector"],t=at(t,["selector"]);return Ib(Object.assign({channel:"y",selector:e},t))});function Fb(e){return t=>null===t?e:e+" of "+t}function zb(){return[(t,e)=>Zd(t,t=>+e[t]),Fb("mean")]}function Wb(){return[(t,e)=>Qd(t,t=>+e[t]),Fb("median")]}function Gb(){return[(t,e)=>Hd(t,t=>+e[t]),Fb("max")]}function Hb(){return[(t,e)=>Yd(t,t=>+e[t]),Fb("min")]}function Vb(){return[(t,e)=>t.length,Fb("count")]}function Yb(){return[(t,e)=>ep(t,t=>+e[t]),Fb("sum")]}function qb(){return[(t,e)=>e[t[0]],Fb("first")]}function $b(){return[(t,e)=>e[t[t.length-1]],Fb("last")]}Db.props={};const Ub=(t={})=>{const i=t["groupBy"],a=at(t,["groupBy"]);return(t,e)=>{const{data:s,encode:l}=e,c=i(t,e);if(!c)return[t,e];var t=Object.entries(a).map(([t,e])=>{const[n,r]=function(t){if("function"==typeof t)return[t,null];var e={mean:zb,max:Gb,count:Vb,first:qb,last:$b,sum:Yb,min:Hb,median:Wb}[t];if(e)return e();throw new Error(`Unknown reducer: ${t}.`)}(e),[i,a]=sb(l,t);e=e;var e=(o=a)||((e=e["from"])?([,e]=sb(l,e),e):o),o=c.map(t=>n(t,null!==i&&void 0!==i?i:s));return[t,Object.assign(Object.assign({},(t=o,o=(null==r?void 0:r(e))||e,t=rb(t,o),Object.assign(Object.assign({},t),{constant:!1}))),{aggregate:!0})]}),n=Object.keys(l).map(t=>{const[e,n]=sb(l,t);return[t,rb(c.map(t=>e[t[0]]),n)]}),r=c.map(t=>s[t[0]]);return[_p(c),ot({},e,{data:r,encode:Object.fromEntries([...n,...t])})]}},Xb=(Ub.props={},(t={})=>{const{channels:n=["x","y"]}=t,e=at(t,["channels"]);return Ub(Object.assign(Object.assign({},e),{groupBy:(t,e)=>ub(n,t,e)}))}),Kb=(Xb.props={},(t={})=>Xb(Object.assign(Object.assign({},t),{channels:["x","color","series"]}))),Zb=(Kb.props={},(t={})=>Xb(Object.assign(Object.assign({},t),{channels:["y","color","series"]}))),Qb=(Zb.props={},(t={})=>Xb(Object.assign(Object.assign({},t),{channels:["color"]})));function Jb(t,e,n){var{reverse:r,slice:i,channel:a}=n,n=at(n,["reverse","slice","channel"]),{encode:o,scale:s={}}=e,s=null==(s=s[a])?void 0:s.domain;const[l]=sb(o,a);var c,n=function(t,e,n){const{by:r=t,reducer:i="max"}=e,[a]=sb(n,r);if("function"==typeof i)return t=>i(t,a);if("max"===i)return t=>Hd(t,t=>+a[t]);if("min"===i)return t=>Yd(t,t=>+a[t]);if("sum"===i)return t=>ep(t,t=>+a[t]);if("median"===i)return t=>Qd(t,t=>+a[t]);if("mean"===i)return t=>Zd(t,t=>+a[t]);if("first"===i)return t=>a[t[0]];if("last"===i)return t=>a[t[t.length-1]];throw new Error("Unknown reducer: "+i)}(a,n,o),o=function(t,e,n){if(!Array.isArray(n))return t;const r=new Set(n);return t.filter(t=>r.has(e[t]))}(t,l,s),n=(s=o,o=t=>l[t],(2!==(c=n).length?Cd(_d(s,c,o),([t,e],[n,r])=>fd(e,r)||fd(t,n)):Cd(Sd(s,o),([t,e],[n,r])=>c(e,r)||fd(t,n))).map(([t])=>t)),s=(r&&n.reverse(),"number"==typeof i?[0,i]:i),o=i?n.slice(...s):n;return[t,ot(e,{scale:{[a]:{domain:o}}})]}Qb.props={};const t2=(t={})=>{const{reverse:o=!1,slice:s,channel:l,ordinal:c=!0}=t,u=at(t,["reverse","slice","channel","ordinal"]);return(t,e)=>{if(c)return Jb(t,e,Object.assign({reverse:o,slice:s,channel:l},u));{var n=Object.assign({reverse:o,slice:s,channel:l},u);var{reverse:n,channel:r}=n,i=e["encode"];const[a]=sb(i,r);return i=Cd(t,t=>a[t]),n&&i.reverse(),[i,e]}}},e2=(t2.props={},(t={})=>t2(Object.assign(Object.assign({},t),{channel:"x"}))),n2=(e2.props={},(t={})=>t2(Object.assign(Object.assign({},t),{channel:"color"}))),r2=(n2.props={},(t={})=>t2(Object.assign(Object.assign({},t),{channel:"y"})));r2.props={};const i2=(t={})=>{const{field:o,channel:s="y",reducer:l="sum"}=t;return(t,e)=>{var{data:n,encode:r}=e;const[i]=sb(r,"x");var a,n=o?(n=n,"string"==typeof(a=o)?n.map(t=>t[a]):n.map(a)):sb(r,s)[0],r=Td(t,function(e,n){if("function"==typeof e)return t=>e(t,n);if("sum"===e)return t=>ep(t,t=>+n[t]);throw new Error("Unknown reducer: "+e)}(l,n),t=>i[t]).map(t=>t[1]);return[t,ot({},e,{scale:{x:{flex:r}}})]}};function a2([t,e],[n,r]){return[t-n,e-r]}function o2([t,e],[n,r]){return[t+n,e+r]}function s2([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function l2([t,e]){return Math.atan2(e,t)}function c2([t,e]){return l2([t,e])+Math.PI/2}function u2(t,e){t=l2(t),e=l2(e);return t<e?e-t:2*Math.PI-(t-e)}function h2(t){let e=1/0,n=-1/0,r=1/0,i=-1/0;for(var[a,o]of t)e=Math.min(a,e),n=Math.max(a,n),r=Math.min(o,r),i=Math.max(o,i);var t=n-e,s=i-r;return[e,r,t,s]}function f2([t,e],[n,r]){return[(t+n)/2,(e+r)/2]}function d2(t,e,n){var r=t.length;if(0===r)return[];var{innerWidth:i,innerHeight:a}=n;let l=Math.ceil(Math.sqrt(e/(a/i))),c=i/l,u=Math.ceil(e/l),o=u*c;for(;o>a;)l+=1,c=i/l,u=Math.ceil(e/l),o=u*c;const h=a-u*c,f=u<=1?0:h/(u-1),[d,p]=u<=1?[(i-r*c)/(r-1),(a-c)/2]:[0,0];return t.map((t,e)=>{var[t,n,r,i]=h2(t),a=e%l,e=Math.floor(e/l),o=a*c,s=(u-e-1)*c+h,r=c/r,i=c/i;return`translate(${o-t+d*a}, ${s-n-f*e-p}) scale(${r}, ${i})`})}i2.props={};const p2=()=>(t,e)=>[t,ot({},e,{modifier:d2,axis:!1})],g2=(p2.props={},"thresholds");function y2(t){var e,[n,r]=wd(t);return Math.min(200,(n=n,r=r,e=bd(t=t),t=xd(t),e&&t?Math.ceil((r-n)*Math.cbrt(e)/(3.49*t)):1))}const m2=(t={})=>{const{groupChannels:s=["color"],binChannels:l=["x","y"]}=t,c=at(t,["groupChannels","binChannels"]),u={};return Ub(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(c).filter(([t])=>!t.startsWith(g2)))),Object.fromEntries(l.flatMap(e=>{var t=([t])=>+u[e].get(t).split(",")[1];return[[t.from=e,([t])=>+u[e].get(t).split(",")[0]],[e+"1",t]]}))),{groupBy:(t,e)=>{const n=e["encode"],i=l.map(t=>{var[t]=sb(n,t);return t}),a=st(c,g2),o=t.filter(e=>i.every(t=>sp(t[e]))),r=[...s.map(t=>{var[t]=sb(n,t);return t}).filter(sp).map(e=>t=>e[t]),...l.map((t,e)=>{const n=i[e];e=a[t]||y2(n),e=Gd().thresholds(e).value(t=>+n[t])(o);const r=new Map(e.flatMap(t=>{var{x0:e,x1:n}=t;const r=e+","+n;return t.map(t=>[t,r])}));return u[t]=r,t=>r.get(t)})];return Array.from(Sd(o,e=>r.map(t=>t(e)).join("-")).values())}}))},v2=(m2.props={},(t={})=>{var e=t["thresholds"];return m2(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))});function b2(e,n,r,t){var a=e.length;if(a<=t||0===t)return e;var o,s=t=>+n[e[t]],l=t=>+r[e[t]],c=[],u=(a-2)/(t-2);let h=0,f,d;c.push(h);for(let i=0;i<t-2;i++){let t=0,e=0,n=Math.floor((i+1)*u)+1;for(var p=Math.floor((i+2)*u)+1,g=(p=Math.min(p,a))-n;n<p;n++)t+=s(n),e+=l(n);t/=g,e/=g;let r=Math.floor((i+0)*u)+1;var y=Math.floor((i+1)*u)+1,m=[s(h),l(h)];for(f=-1;r<y;r++)(o=.5*Math.abs((m[0]-t)*(s(r)-m[1])-(m[0]-l(r))*(e-m[0])))>f&&(f=o,d=r);c.push(d),h=d}return c.push(a-1),c.map(t=>e[t])}function x2(t){if("function"==typeof t)return t;if("lttb"===t)return b2;var e={first:t=>[t[0]],last:t=>[t[t.length-1]],min:(t,e,n)=>[t[qd(t,t=>n[t])]],max:(t,e,n)=>[t[Vd(t,t=>n[t])]],median:(t,e,n)=>{return[t[Kd(t,.5,t=>n[t])]]}};const i=e[t]||e.median;return(t,e,n,r)=>{return function(t,e){var 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/r))).flatMap(t=>i(t,e,n))}}v2.props={};const w2=(t={})=>{const{strategy:e="median",thresholds:a=2e3,groupBy:o=["series","color"]}=t,s=x2(e);return(t,e)=>{var n=e["encode"],t=ub(o,t,e);const[r]=sb(n,"x"),[i]=sb(n,"y");return[t.flatMap(t=>s(t,r,i,a)),e]}};w2.props={};const M2=(o={})=>(t,e)=>{const{encode:l,data:n}=e,r=Object.entries(o).map(([t,e])=>{const[n]=sb(l,t);if(!n)return null;const[r,i=!0]="object"==typeof(t=e)?[t.value,t.ordinal]:[t,!0];if("function"==typeof r)return t=>r(n[t]);if(i){const a=Array.isArray(r)?r:[r];return 0===a.length?null:t=>a.includes(n[t])}{const[o,s]=r;return t=>n[t]>=o&&n[t]<=s}}).filter(sp);if(0===r.length)return[t,e];const i=t.filter(e=>r.every(t=>t(e))),a=i.map((t,e)=>e);t=Object.entries(l).map(([t,e])=>[t,Object.assign(Object.assign({},e),{value:a.map(t=>e.value[i[t]])})]);return[a,ot({},e,{encode:Object.fromEntries(t),data:i.map(t=>n[t])})]};function O2(t){return function(){return t}}M2.props={};const k2=Math.abs,E2=Math.atan2,S2=Math.cos,A2=Math.max,_2=Math.min,T2=Math.sin,P2=Math.sqrt,C2=1e-12,L2=Math.PI,N2=L2/2,j2=2*L2;function R2(t){return 1<=t?N2:t<=-1?-N2:Math.asin(t)}const I2=Math.PI,B2=2*I2,D2=1e-6,F2=B2-D2;function z2(n){this._+=n[0];for(let t=1,e=n.length;t<e;++t)this._+=arguments[t]+n[t]}class W2{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?z2:function(t){var e=Math.floor(t);if(!(0<=e))throw new Error("invalid digits: "+t);if(15<e)return z2;const r=10**e;return function(n){this._+=n[0];for(let t=1,e=n.length;t<e;++t)this._+=Math.round(arguments[t]*r)/r+n[t]}}(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,a){this._append`C${+t},${+e},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(t,e,n,r,i){if(t=+t,e=+e,n=+n,r=+r,(i=+i)<0)throw new Error("negative radius: "+i);var a,o,s=this._x1,l=this._y1,c=n-t,u=r-e,h=s-t,f=l-e,d=h*h+f*f;null===this._x1?this._append`M${this._x1=t},${this._y1=e}`:d>D2&&(Math.abs(f*c-u*h)>D2&&i?(o=c*c+u*u,r=(n=n-s)*n+(s=r-l)*s,l=Math.sqrt(o),a=Math.sqrt(d),d=(o=i*Math.tan((I2-Math.acos((o+d-r)/(2*l*a)))/2))/a,r=o/l,Math.abs(d-1)>D2&&this._append`L${t+d*h},${e+d*f}`,this._append`A${i},${i},0,0,${+(h*s<f*n)},${this._x1=t+r*c},${this._y1=e+r*u}`):this._append`L${this._x1=t},${this._y1=e}`)}arc(t,e,n,r,i,a){if(t=+t,e=+e,a=!!a,(n=+n)<0)throw new Error("negative radius: "+n);let o=n*Math.cos(r),s=n*Math.sin(r),l=t+o,c=e+s,u=1^a,h=a?r-i:i-r;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>D2||Math.abs(this._y1-c)>D2)&&this._append`L${l},${c}`,n&&((h=h<0?h%B2+B2:h)>F2?this._append`A${n},${n},0,1,${u},${t-o},${e-s}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:h>D2&&this._append`A${n},${n},0,${+(h>=I2)},${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 G2(){return new W2}function H2(n){let r=3;return n.digits=function(t){if(!arguments.length)return r;if(null==t)r=null;else{var e=Math.floor(t);if(!(0<=e))throw new RangeError("invalid digits: "+t);r=e}return n},()=>new W2(r)}function V2(t){return t.innerRadius}function Y2(t){return t.outerRadius}function q2(t){return t.startAngle}function $2(t){return t.endAngle}function U2(t){return t&&t.padAngle}function X2(t,e,n,r,i,a,o){var s=t-n,l=e-r,o=(o?a:-a)/P2(s*s+l*l),l=o*l,o=-o*s,s=t+l,t=e+o,e=n+l,n=r+o,r=(s+e)/2,c=(t+n)/2,u=e-s,h=n-t,f=u*u+h*h,a=i-a,s=s*n-e*t,n=(h<0?-1:1)*P2(A2(0,a*a*f-s*s)),e=(s*h-u*n)/f,t=(-s*u-h*n)/f,d=(s*h+u*n)/f,s=(-s*u+h*n)/f,u=e-r,h=t-c,n=d-r,f=s-c;return n*n+f*f<u*u+h*h&&(e=d,t=s),{cx:e,cy:t,x01:-l,y01:-o,x11:e*(i/a-1),y11:t*(i/a-1)}}function K2(){var _=V2,T=Y2,P=O2(0),C=null,L=q2,N=$2,j=U2,R=null,I=H2(e);function e(){var t,e,n,r,i,a,o,s,l,c,u,h,f,d,p,g,y,m,v,b,x,w,M=+_.apply(this,arguments),O=+T.apply(this,arguments),k=L.apply(this,arguments)-N2,E=N.apply(this,arguments)-N2,S=k2(E-k),A=k<E;if(R=R||(t=I()),O<M&&(e=O,O=M,M=e),O>C2?S>j2-C2?(R.moveTo(O*S2(k),O*T2(k)),R.arc(0,0,O,k,E,!A),M>C2&&(R.moveTo(M*S2(E),M*T2(E)),R.arc(0,0,M,E,k,A))):(r=e=k,i=n=E,o=a=S,f=(u=j.apply(this,arguments)/2)>C2&&(C?+C.apply(this,arguments):P2(M*M+O*O)),w=x=s=_2(k2(O-M)/2,+P.apply(this,arguments)),f>C2&&(h=R2(f/M*T2(u)),f=R2(f/O*T2(u)),(a-=2*h)>C2?(r+=h*=A?1:-1,i-=h):(a=0,r=i=(k+E)/2),(o-=2*f)>C2?(e+=f*=A?1:-1,n-=f):(o=0,e=n=(k+E)/2)),u=O*S2(e),h=O*T2(e),f=M*S2(i),k=M*T2(i),s>C2&&(d=O*S2(n),p=O*T2(n),g=M*S2(r),y=M*T2(r),S<L2)&&((E=function(t,e,n,r,i,a,o,s){var l=(s=s-a)*(n=n-t)-(o=o-i)*(r=r-e);if(!(l*l<C2))return[t+(l=(o*(e-a)-s*(t-i))/l)*n,e+l*r]}(u,h,g,y,d,p,f,k))?(S=u-E[0],v=h-E[1],b=d-E[0],m=p-E[1],v=1/T2((1<(S=(S*b+v*m)/(P2(S*S+v*v)*P2(b*b+m*m)))?0:S<-1?L2:Math.acos(S))/2),b=P2(E[0]*E[0]+E[1]*E[1]),x=_2(s,(M-b)/(v-1)),w=_2(s,(O-b)/(1+v))):x=w=0),o>C2?w>C2?(l=X2(g,y,u,h,O,w,A),c=X2(d,p,f,k,O,w,A),R.moveTo(l.cx+l.x01,l.cy+l.y01),w<s?R.arc(l.cx,l.cy,w,E2(l.y01,l.x01),E2(c.y01,c.x01),!A):(R.arc(l.cx,l.cy,w,E2(l.y01,l.x01),E2(l.y11,l.x11),!A),R.arc(0,0,O,E2(l.cy+l.y11,l.cx+l.x11),E2(c.cy+c.y11,c.cx+c.x11),!A),R.arc(c.cx,c.cy,w,E2(c.y11,c.x11),E2(c.y01,c.x01),!A))):(R.moveTo(u,h),R.arc(0,0,O,e,n,!A)):R.moveTo(u,h),M>C2&&a>C2?x>C2?(l=X2(f,k,d,p,M,-x,A),c=X2(u,h,g,y,M,-x,A),R.lineTo(l.cx+l.x01,l.cy+l.y01),x<s?R.arc(l.cx,l.cy,x,E2(l.y01,l.x01),E2(c.y01,c.x01),!A):(R.arc(l.cx,l.cy,x,E2(l.y01,l.x01),E2(l.y11,l.x11),!A),R.arc(0,0,M,E2(l.cy+l.y11,l.cx+l.x11),E2(c.cy+c.y11,c.cx+c.x11),A),R.arc(c.cx,c.cy,x,E2(c.y11,c.x11),E2(c.y01,c.x01),!A))):R.arc(0,0,M,i,r,A):R.lineTo(f,k)):R.moveTo(0,0),R.closePath(),t)return R=null,t+""||null}return e.centroid=function(){var t=(+_.apply(this,arguments)+ +T.apply(this,arguments))/2,e=(+L.apply(this,arguments)+ +N.apply(this,arguments))/2-L2/2;return[S2(e)*t,T2(e)*t]},e.innerRadius=function(t){return arguments.length?(_="function"==typeof t?t:O2(+t),e):_},e.outerRadius=function(t){return arguments.length?(T="function"==typeof t?t:O2(+t),e):T},e.cornerRadius=function(t){return arguments.length?(P="function"==typeof t?t:O2(+t),e):P},e.padRadius=function(t){return arguments.length?(C=null==t?null:"function"==typeof t?t:O2(+t),e):C},e.startAngle=function(t){return arguments.length?(L="function"==typeof t?t:O2(+t),e):L},e.endAngle=function(t){return arguments.length?(N="function"==typeof t?t:O2(+t),e):N},e.padAngle=function(t){return arguments.length?(j="function"==typeof t?t:O2(+t),e):j},e.context=function(t){return arguments.length?(R=null==t?null:t,e):R},e}function Z2(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Q2(t){this._context=t}function J2(t){return new Q2(t)}function tx(t){return t[0]}function ex(t){return t[1]}function nx(o,s){var l=O2(!0),c=null,u=J2,h=null,f=H2(e);function e(t){var e,n,r,i=(t=Z2(t)).length,a=!1;for(null==c&&(h=u(r=f())),e=0;e<=i;++e)!(e<i&&l(n=t[e],e,t))===a&&((a=!a)?h.lineStart():h.lineEnd()),a&&h.point(+o(n,e,t),+s(n,e,t));if(r)return h=null,r+""||null}return o="function"==typeof o?o:void 0===o?tx:O2(o),s="function"==typeof s?s:void 0===s?ex:O2(s),e.x=function(t){return arguments.length?(o="function"==typeof t?t:O2(+t),e):o},e.y=function(t){return arguments.length?(s="function"==typeof t?t:O2(+t),e):s},e.defined=function(t){return arguments.length?(l="function"==typeof t?t:O2(!!t),e):l},e.curve=function(t){return arguments.length?(u=t,null!=c&&(h=u(c)),e):u},e.context=function(t){return arguments.length?(null==t?c=h=null:h=u(c=t),e):c},e}function rx(u,h,f){var d=null,p=O2(!0),g=null,y=J2,m=null,v=H2(e);function e(t){var e,n,r,i,a,o=(t=Z2(t)).length,s=!1,l=new Array(o),c=new Array(o);for(null==g&&(m=y(a=v())),e=0;e<=o;++e){if(!(e<o&&p(i=t[e],e,t))===s)if(s=!s)n=e,m.areaStart(),m.lineStart();else{for(m.lineEnd(),m.lineStart(),r=e-1;n<=r;--r)m.point(l[r],c[r]);m.lineEnd(),m.areaEnd()}s&&(l[e]=+u(i,e,t),c[e]=+h(i,e,t),m.point(d?+d(i,e,t):l[e],f?+f(i,e,t):c[e]))}if(a)return m=null,a+""||null}function t(){return nx().defined(p).curve(y).context(g)}return u="function"==typeof u?u:void 0===u?tx:O2(+u),h="function"==typeof h?h:O2(void 0===h?0:+h),f="function"==typeof f?f:void 0===f?ex:O2(+f),e.x=function(t){return arguments.length?(u="function"==typeof t?t:O2(+t),d=null,e):u},e.x0=function(t){return arguments.length?(u="function"==typeof t?t:O2(+t),e):u},e.x1=function(t){return arguments.length?(d=null==t?null:"function"==typeof t?t:O2(+t),e):d},e.y=function(t){return arguments.length?(h="function"==typeof t?t:O2(+t),f=null,e):h},e.y0=function(t){return arguments.length?(h="function"==typeof t?t:O2(+t),e):h},e.y1=function(t){return arguments.length?(f=null==t?null:"function"==typeof t?t:O2(+t),e):f},e.lineX0=e.lineY0=function(){return t().x(u).y(h)},e.lineY1=function(){return t().x(u).y(f)},e.lineX1=function(){return t().x(d).y(h)},e.defined=function(t){return arguments.length?(p="function"==typeof t?t:O2(!!t),e):p},e.curve=function(t){return arguments.length?(y=t,null!=g&&(m=y(g)),e):y},e.context=function(t){return arguments.length?(null==t?g=m=null:m=y(g=t),e):g},e}G2.prototype=W2.prototype,Q2.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 ix=ox(J2);function ax(t){this._curve=t}function ox(e){function t(t){return new ax(e(t))}return t._curve=e,t}function sx(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(ox(t)):e()._curve},t}function lx(){}function cx(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 ux(t,e){this._context=t,this._k=(1-e)/6}function hx(t,e){this._context=t,this._k=(1-e)/6}function fx(t,e,n){var r,i,a=t._x1,o=t._y1,s=t._x2,l=t._y2;t._l01_a>C2&&(r=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a),a=(a*r-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,o=(o*r-t._y0*t._l12_2a+t._y2*t._l01_2a)/i),t._l23_a>C2&&(r=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,i=3*t._l23_a*(t._l23_a+t._l12_a),s=(s*r+t._x1*t._l23_2a-e*t._l12_2a)/i,l=(l*r+t._y1*t._l23_2a-n*t._l12_2a)/i),t._context.bezierCurveTo(a,o,s,l,t._x2,t._y2)}function dx(t,e){this._context=t,this._alpha=e}ax.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))}},ux.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:cx(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:cx(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 e(n){function t(t){return new ux(t,n)}return t.tension=function(t){return e(+t)},t}(0),hx.prototype={areaStart:lx,areaEnd:lx,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:cx(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 e(n){function t(t){return new hx(t,n)}return t.tension=function(t){return e(+t)},t}(0),dx.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){var n,r;switch(t=+t,e=+e,this._point&&(n=this._x2-t,r=this._y2-e,this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))),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:fx(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 px=function e(n){function t(t){return n?new dx(t,n):new ux(t,0)}return t.alpha=function(t){return e(+t)},t}(.5);function gx(t,e){this._context=t,this._alpha=e}gx.prototype={areaStart:lx,areaEnd:lx,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){var n,r;switch(t=+t,e=+e,this._point&&(n=this._x2-t,r=this._y2-e,this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))),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:fx(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 yx=function e(n){function t(t){return n?new gx(t,n):new hx(t,0)}return t.alpha=function(t){return e(+t)},t}(.5);function mx(t){this._context=t}function vx(t){return new mx(t)}function bx(t,e){this._context=t,this._t=e}function xx(t){return new bx(t,.5)}function wx(t){return new bx(t,0)}function Mx(t){return new bx(t,1)}function Ox(t,e,n){return Math.max(e,Math.min(t,n))}function L(t,e){for(var[n,r]of Object.entries(e))t.style(n,r)}function kx(t,e,n,r,i){e=l2(a2(r,e))+Math.PI,n=l2(a2(r,n))+Math.PI;t.arc(r[0],r[1],i,e,n,n-e<0)}function Ex(e,t,n,r="y",i="between"){const a="y"===r||!0===r?n:t;var n="y"===r||!0===r?90:0,t=_p(a),[r,o]=wd(t,t=>a[t]);const s=new wg({domain:[r,o],range:[0,100]}),l=t=>s.map(a[t]);r={between:t=>`${e[t]} ${l(t)}%`,start:t=>0===t?`${e[t]} ${l(t)}%`:`${e[t-1]} ${l(t)}%, ${e[t]} ${l(t)}%`,end:t=>t===e.length-1?`${e[t]} ${l(t)}%`:`${e[t]} ${l(t)}%, ${e[t+1]} ${l(t)}%`};return`linear-gradient(${n}deg, ${t.sort((t,e)=>l(t)-l(e)).map(r[i]||r.between).join(",")})`}function Sx(t){var[t,e,n,r]=t;return[r,t,e,n]}function Ax(t,e,n){var[e,r,,i]=rv(t)?Sx(e):e,[n,a]=n,t=t.getCenter(),o=c2(a2(e,t)),r=c2(a2(r,t)),n=r===o&&n!==a?r+2*Math.PI:r;return{startAngle:o,endAngle:0<=n-o?n:2*Math.PI+n,innerRadius:s2(i,t),outerRadius:s2(e,t)}}function _x(t){var{colorAttribute:t,opacityAttribute:t=t}=t;return t+"Opacity"}function Tx(t,e){return iv(t)?(e=e["transform"],`translate(${(t=t.getCenter())[0]}, ${t[1]}) `+(e||"")):""}function Px(t){var e,n,r;return 1===t.length?t[0]:([[t,e],[n,r]]=t,[(t+n)/2,(e+r)/2])}function Cx(t,e,n,r,i={}){var{inset:a=0,radius:o=0,insetLeft:s=a,insetTop:l=a,insetRight:c=a,insetBottom:u=a,radiusBottomLeft:h=o,radiusBottomRight:f=o,radiusTopLeft:d=o,radiusTopRight:p=o,minWidth:g=-1/0,maxWidth:y=1/0}=i,i=at(i,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth"]);if(!iv(r)&&!ov(r)){var m=!!rv(r),[v,,b]=m?Sx(e):e;const[k,M]=v;var[b,v]=a2(b,v),x=(0<b?k:k+b)+s,w=(0<v?M:M+v)+l,b=Math.abs(b)-(s+c),s=Math.abs(v)-(l+u),c=m?b:Ox(b,g,y),v=m?Ox(s,g,y):s,l=x-(c-b)/2,u=w-(v-s)/2;return lt(t.createElement("rect",{})).style("x",l).style("y",u).style("width",c).style("height",v).style("radius",[d,p,f,h]).call(L,i).node()}const{y:M,y1:O}=n;m=r.getCenter(),g=Ax(r,e,[M,O]),y=K2().cornerRadius(o).padAngle(a*Math.PI/180);return lt(t.createElement("path",{})).style("path",y(g)).style("transform",`translate(${m[0]}, ${m[1]})`).style("radius",o).style("inset",a).call(L,i).node()}mx.prototype={areaStart:lx,areaEnd:lx,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))}},bx.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(),0<=this._line&&(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:var n;this._t<=0?(this._context.lineTo(this._x,e),this._context.lineTo(t,e)):(n=this._x*(1-this._t)+t*this._t,this._context.lineTo(n,this._y),this._context.lineTo(n,e))}this._x=t,this._y=e}};const Lx=(E,t)=>{const{colorAttribute:S,first:A=!0,last:_=!0}=E,T=at(E,["colorAttribute","opacityAttribute","first","last"]),{coordinate:P,document:C}=t;return(t,e,n)=>{var{color:r,radius:i=0}=n,n=at(n,["color","radius"]),a=n.lineWidth||1,{stroke:o,radius:i=i,radiusTopLeft:s=i,radiusTopRight:l=i,radiusBottomRight:c=i,radiusBottomLeft:u=i,innerRadius:h=0,innerRadiusTopLeft:f=h,innerRadiusTopRight:d=h,innerRadiusBottomRight:p=h,innerRadiusBottomLeft:h=h,lineWidth:a="stroke"===S||o?a:0,inset:g=0,insetLeft:y=g,insetRight:m=g,insetBottom:v=g,insetTop:b=g,minWidth:x,maxWidth:w}=T,M=at(T,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop","minWidth","maxWidth"]),{color:r=r,opacity:O}=e;const k=[A?s:f,A?l:d,_?c:p,_?u:h];s=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"],rv(P)&&s.push(s.shift()),f=Object.assign(Object.assign({radius:i},Object.fromEntries(s.map((t,e)=>[t,k[e]]))),{inset:g,insetLeft:y,insetRight:m,insetBottom:v,insetTop:b,minWidth:x,maxWidth:w});return lt(Cx(C,t,e,P,f)).call(L,n).style("fill","transparent").style(S,r).style(_x(E),O).style("lineWidth",a).style("stroke",void 0===o?r:o).call(L,M).node()}};Lx.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};Ys=(t,e)=>Lx(Object.assign({colorAttribute:"fill"},t),e),Ys.props=Object.assign(Object.assign({},Lx.props),{defaultMarker:"square"}),o=(t,e)=>Lx(Object.assign({colorAttribute:"stroke"},t),e);o.props=Object.assign(Object.assign({},Lx.props),{defaultMarker:"hollowSquare"});const Nx=(t,e)=>{const{adjustPoints:s=function(t,e,n){var[t,r,i,a]=t;if(rv(n)){const o=[(e?e[0]:r)[0],r[1]],s=[(e?e[3]:i)[0],i[1]];return[t,o,s,a]}const o=[r[0],(e?e[0]:r)[1]],s=[i[0],(e?e[3]:i)[1]];return[t,o,s,a]}}=t,l=at(t,["adjustPoints"]),{coordinate:c,document:u}=e;return(t,e,n,r)=>{var i=e["index"],a=n["color"],n=at(n,["color"]),r=r[i+1],i=s(t,r,c),[t,r,i,o]=!!rv(c)?Sx(i):i,{color:e=a,opacity:a}=e,t=nx().curve(vx)([t,r,i,o]);return lt(u.createElement("path",{})).call(L,n).style("path",t).style("fill",e).style("fillOpacity",a).call(L,l).node()}};function jx(t,e,n){var[t,r,i,a]=t;if(rv(n)){const o=[e?e[0][0]:(r[0]+i[0])/2,r[1]],s=[e?e[3][0]:(r[0]+i[0])/2,i[1]];return[t,o,s,a]}const o=[r[0],e?e[0][1]:(r[1]+i[1])/2],s=[i[0],e?e[3][1]:(r[1]+i[1])/2];return[t,o,s,a]}Nx.props={defaultMarker:"square"};Js=(t,e)=>Nx(Object.assign({adjustPoints:jx},t),e);function Rx(t){const e="function"==typeof t?t:t.render;return class extends oc{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}Js.props={defaultMarker:"square"};const Ix=Rx(t=>{var{d1:e,d2:n,style1:r,style2:i}=t.attributes;const a=t.ownerDocument;lt(t).maybeAppend("line",()=>a.createElement("path",{})).style("d",e).call(L,r),lt(t).maybeAppend("line1",()=>a.createElement("path",{})).style("d",n).call(L,i)});const Bx=(t,e)=>{const{curve:u,gradient:h=!1,gradientColor:f="between",defined:d=t=>!Number.isNaN(t)&&null!=t,connect:p=!1}=t,g=at(t,["curve","gradient","gradientColor","defined","connect"]),{coordinate:y,document:m}=e;return(t,e,n)=>{var{color:r,lineWidth:i}=n,n=at(n,["color","lineWidth"]),{color:r=r,size:i=i,seriesColor:a,seriesX:o,seriesY:s}=e,a=h&&a?Ex(a,o,s,h,f):r,o=Tx(y,e),s=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n),a&&{stroke:a}),i&&{lineWidth:i}),o&&{transform:o}),g);let l;if(iv(y)){const c=y.getCenter();l=n=>sx(nx().curve(ix)).angle((t,e)=>c2(a2(n[e],c))).radius((t,e)=>s2(n[e],c)).defined(([t,e])=>d(t)&&d(e)).curve(u)(n)}else l=nx().x(t=>t[0]).y(t=>t[1]).defined(([t,e])=>d(t)&&d(e)).curve(u);var[r,e]=function(t,e){var n=[],r=[];let i=!1,a=null;for(const o of t)e(o[0])&&e(o[1])?(n.push(o),i&&(i=!1,r.push([a,o])),a=o):i=!0;return[n,r]}(t,d),n=st(s,"connect"),a=!!e.length;return(!a||p&&!Object.keys(n).length?lt(m.createElement("path",{})).style("d",l(r)||[]).call(L,s):a&&!p?lt(m.createElement("path",{})).style("d",l(t)).call(L,s):lt(new Ix).style("style1",Object.assign(Object.assign({},s),n)).style("style2",s).style("d1",e.map(l).join(",")).style("d2",l(t))).node()}};Bx.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};_o=(n,r)=>{const i=r["coordinate"];return(...t)=>{var e=iv(i)?vx:J2;return Bx(Object.assign({curve:e},n),r)(...t)}},_o.props=Object.assign(Object.assign({},Bx.props),{defaultMarker:"line"}),Ro=(t,n)=>{const{alpha:r=.5}=t,i=at(t,["alpha"]),a=n["coordinate"];return(...t)=>{var e=iv(a)?yx:px;return Bx(Object.assign({curve:e.alpha(r)},i),n)(...t)}},Ro.props=Object.assign(Object.assign({},Bx.props),{defaultMarker:"smooth"}),No=(t,e)=>Bx(Object.assign({curve:Mx},t),e),No.props=Object.assign(Object.assign({},Bx.props),{defaultMarker:"hv"}),qo=(t,e)=>Bx(Object.assign({curve:wx},t),e),qo.props=Object.assign(Object.assign({},Bx.props),{defaultMarker:"vh"}),zo=(t,e)=>Bx(Object.assign({curve:xx},t),e);zo.props=Object.assign(Object.assign({},Bx.props),{defaultMarker:"hvh"});Ko=(b,t)=>{const x=t["document"];return(e,t,n)=>{var r,i,a,o,s,l,c,u,h,{seriesSize:f,color:t}=t,d=n["color"],n=at(n,["color"]),p=G2();for(let t=0;t<e.length-1;t++){var g=e[t],y=e[t+1],m=f[t],v=f[t+1];[...g,...y].every(sp)&&(r=p,m=m,v=v,s=a=i=h=u=c=l=s=o=i=a=i=void 0,i=(s=l2(a2(y=y,g=g)))+Math.PI/2,a=[m/2*Math.cos(i),m/2*Math.sin(i)],i=[v/2*Math.cos(i),v/2*Math.sin(i)],o=[v/2*Math.cos(s),v/2*Math.sin(s)],s=[m/2*Math.cos(s),m/2*Math.sin(s)],l=o2(g,a),c=o2(y,i),u=o2(c,o),h=a2(o=o2(y,o),i),y=a2(y,i),i=a2(g,a),a=a2(i,s),g=a2(g,s),s=a2(l,s),r.moveTo(...l),r.lineTo(...c),r.arcTo(...u,...o,v/2),r.arcTo(...h,...y,v/2),r.lineTo(...i),r.arcTo(...a,...g,m/2),r.arcTo(...s,...l,m/2),r.closePath())}return lt(x.createElement("path",{})).call(L,n).style("fill",t||d).style("d",p.toString()).call(L,b).node()}},Ko.props=Object.assign(Object.assign({},Bx.props),{defaultMarker:"line"}),Uo=(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"]],Uo.style=["fill"],es=Uo.bind(void 0),es.style=["stroke","lineWidth"],Qo=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]],Qo.style=["fill"],as=Qo.bind(void 0),as.style=["fill"],rs=Qo.bind(void 0),rs.style=["stroke","lineWidth"],Ws=(t,e,n)=>{var r=.618*n;return[["M",t-r,e],["L",t,e-n],["L",t+r,e],["L",t,e+n],["Z"]]},Ws.style=["fill"],Ss=Ws.bind(void 0),Ss.style=["stroke","lineWidth"],Go=(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"]]},Go.style=["fill"],zs=Go.bind(void 0),zs.style=["stroke","lineWidth"],$s=(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"]]},$s.style=["fill"],Ol=$s.bind(void 0),Ol.style=["stroke","lineWidth"],rl=(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"]]},rl.style=["fill"],n=rl.bind(void 0),n.style=["stroke","lineWidth"],Iy=(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"]]},Iy.style=["fill"],uu=Iy.bind(void 0),uu.style=["stroke","lineWidth"],Dy=(t,e,n)=>[["M",t,e+n],["L",t,e-n]],Dy.style=["stroke","lineWidth"],By=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]],By.style=["stroke","lineWidth"],zy=(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]],zy.style=["stroke","lineWidth"],Fy=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]],Fy.style=["stroke","lineWidth"],Gy=(t,e,n)=>[["M",t-n,e],["L",t+n,e]],Gy.style=["stroke","lineWidth"],Wy=(t,e,n)=>[["M",t-n,e],["L",t+n,e]],Wy.style=["stroke","lineWidth"],Vy=Wy.bind(void 0),Vy.style=["stroke","lineWidth"],Hy=(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]],Hy.style=["stroke","lineWidth"],qy=(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]],qy.style=["stroke","lineWidth"],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"],Uy=(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]],Uy.style=["stroke","lineWidth"],$y=(t,e,n)=>[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]];$y.style=["stroke","lineWidth"];const Dx=new Map([["bowtie",Iy],["cross",By],["dash",Vy],["diamond",Ws],["dot",Wy],["hexagon",rl],["hollowBowtie",uu],["hollowDiamond",Ss],["hollowHexagon",n],["hollowPoint",es],["hollowSquare",rs],["hollowTriangle",zs],["hollowTriangleDown",Ol],["hv",qy],["hvh",Uy],["hyphen",Gy],["line",Dy],["plus",Fy],["point",Uo],["rect",as],["smooth",Hy],["square",Qo],["tick",zy],["triangleDown",$s],["triangle",Go],["vh",Yy],["vhv",$y]]);const f=(c,t)=>{const{colorAttribute:u,symbol:e,mode:h="auto"}=c,f=at(c,["colorAttribute","symbol","mode"]),d=Dx.get(e)||Dx.get("point"),{coordinate:p,document:g}=t;return(t,e,n)=>{var{lineWidth:r,color:i}=n,r=f.stroke?r||1:r,{color:i=i,transform:a,opacity:o}=e,[s,l]=Px(t),t=function(t,e,n,r){var i;if(1!==e.length)return n=n["size"],"fixed"!==t&&("normal"===t||lv(r))?([[t,r],[e,i]]=e,e=Math.abs((e-t)/2),t=Math.abs((i-r)/2),Math.max(0,(e+t)/2)):n}(h,t,e,p)||f.r||n.r;return lt(g.createElement("path",{})).call(L,n).style("fill","transparent").style("d",d(s,l,t)).style("lineWidth",r).style("transform",a).style("stroke",i).style(_x(c),o).style(u,i).call(L,f).node()}};f.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};Ky=(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e),Ky.props=Object.assign({defaultMarker:"hollowBowtie"},f.props),Xy=(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e),Xy.props=Object.assign({defaultMarker:"hollowDiamond"},f.props),Qy=(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e),Qy.props=Object.assign({defaultMarker:"hollowHexagon"},f.props),Zy=(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e),Zy.props=Object.assign({defaultMarker:"hollowPoint"},f.props),tm=(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e),tm.props=Object.assign({defaultMarker:"hollowSquare"},f.props),Jy=(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e),Jy.props=Object.assign({defaultMarker:"hollowTriangle"},f.props),nm=(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e),nm.props=Object.assign({defaultMarker:"hollowTriangleDown"},f.props),em=(t,e)=>f(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e),em.props=Object.assign({defaultMarker:"bowtie"},f.props),im=(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e),im.props=Object.assign({defaultMarker:"cross"},f.props),rm=(t,e)=>f(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e),rm.props=Object.assign({defaultMarker:"diamond"},f.props),om=(t,e)=>f(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e),om.props=Object.assign({defaultMarker:"hexagon"},f.props),am=(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e),am.props=Object.assign({defaultMarker:"hyphen"},f.props),Co=(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e),Co.props=Object.assign({defaultMarker:"line"},f.props),sm=(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e),sm.props=Object.assign({defaultMarker:"plus"},f.props),lm=(t,e)=>f(Object.assign({colorAttribute:"fill",symbol:"point"},t),e),lm.props=Object.assign({defaultMarker:"point"},f.props),cm=(t,e)=>f(Object.assign({colorAttribute:"fill",symbol:"square"},t),e),cm.props=Object.assign({defaultMarker:"square"},f.props),So=(t,e)=>f(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e),So.props=Object.assign({defaultMarker:"tick"},f.props),gm=(t,e)=>f(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e),gm.props=Object.assign({defaultMarker:"triangle"},f.props),ym=(t,e)=>f(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e);ym.props=Object.assign({defaultMarker:"triangleDown"},f.props);const Fx=(t,e)=>{const{arrow:u=!0,arrowSize:h="40%"}=t,f=at(t,["arrow","arrowSize"]),d=e["document"];return(t,e,n)=>{var r,i,a,o,s=n["defaultColor"],n=at(n,["defaultColor"]),{color:e=s,transform:s}=e,[t,l]=t,c=G2();return c.moveTo(...t),c.lineTo(...l),u&&([a,o]=(t=t,r=l,i="string"==typeof(i=(i={arrowSize:h})["arrowSize"])?+parseFloat(i)/100*s2(t,r):i,a=Math.PI/6,t=Math.atan2(r[1]-t[1],r[0]-t[0]),o=Math.PI/2-t-a,t-=a,[[r[0]-i*Math.sin(o),r[1]-i*Math.cos(o)],[r[0]-i*Math.cos(t),r[1]-i*Math.sin(t)]]),c.moveTo(...l),c.lineTo(...a),c.moveTo(...l),c.lineTo(...o)),lt(d.createElement("path",{})).call(L,n).style("d",c.toString()).style("stroke",e).style("transform",s).call(L,f).node()}};function zx(t){Gx(t,!0)}function Wx(t){Gx(t,!1)}function Gx(t,e){var n=e?"visible":"hidden";!function e(t,n){n(t),t.children&&t.children.forEach(function(t){t&&e(t,n)})}(t,function(t){t.attr("visibility",n)})}Fx.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};t(Yx,Hx=fc);var Hx,Vx=Yx;function Yx(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Hx.apply(this,O([],j(t),!1))||this;return n.addEventListener(b.INSERTED,function(){Wx(n)}),n}function qx(t){t=t.appendChild(new Vx({class:"offscreen"}));return Wx(t),t}t(Xx,$x=Ic),Object.defineProperty(Xx.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=qx(this)),this._offscreen},enumerable:!1,configurable:!0}),Xx.prototype.disconnectedCallback=function(){var t;null!=(t=this._offscreen)&&t.destroy()};var $x,Ux=Xx;function Xx(t){var e=(t=void 0===t?{}:t).style,t=at(t,["style"]);return $x.call(this,m({style:m({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},e)},t))||this}function Kx(t){return t*Math.PI/180}function Zx(t){return Number((180*t/Math.PI).toPrecision(5))}Object.defineProperty(Jx.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(Jx.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(Jx.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(Jx.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Jx.fromRect=function(t){return new Jx(t.x,t.y,t.width,t.height)},Jx.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}};var Qx=Jx;function Jx(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}function tw(t,e){return Pe(t)?t.apply(void 0,O([],j(e),!1)):t}function ew(t,e){function r(t){return"".concat(e,"-").concat(t)}return t=Object.fromEntries(Object.entries(t).map(function(t){var t=j(t,2),e=t[0],t=t[1],n=r(t);return[e,{name:n,class:".".concat(n),id:"#".concat(n),toString:function(){return n}}]})),Object.assign(t,{prefix:r}),t}function nw(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)iw(t,e[r]);return t}var rw,iw=function(r,i,a,o){void 0===a&&(a=0),void 0===o&&(o=5),Object.entries(i).forEach(function(t){var t=j(t,2),e=t[0],t=t[1],n=r;Object.prototype.hasOwnProperty.call(i,e)&&(t?Ie(t)?(Ie(r[e])||(n[e]={}),a<o?iw(r[e],t,a+1,o):n[e]=i[e]):Ne(t)?(n[e]=[],n[e]=n[e].concat(t)):n[e]=t:n[e]=t)})},aw=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},ow=Je(function(t,e){var n=ze(t)?t:t.style.text.toString(),e=e||sw(t),t=e.fontSize,r=e.fontFamily,i=e.fontWeight,a=e.fontStyle,e=e.fontVariant;return(rw=rw||document.createElement("canvas").getContext("2d")).font=[a,e,i,"".concat(t,"px"),r].join(" "),rw.measureText(n).width},function(t,e){return[ze(t)?t:t.style.text.toString(),Object.values(e||sw(t)).join()].join("")}),sw=function(t){var e=t.style.fontFamily||"sans-serif",n=t.style.fontWeight||"normal",r=t.style.fontStyle||"normal",i=t.style.fontVariant,t=t.style.fontSize;return{fontSize:"object"==typeof t?t.value:t,fontFamily:e,fontWeight:n,fontStyle:r,fontVariant:i}};function lw(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function cw(t,e){t=lw(t);t&&t.attr(e)}function uw(t,e,n){cw(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n=void 0===n?"...":n})}function hw(t){var e=t.canvas,n=t.touches,r=t.offsetX,t=t.offsetY;return e?[e.x,e.y]:n?[(e=n[0]).clientX,e.clientY]:r&&t?[r,t]:[0,0]}function fw(t){return"function"==typeof t?t():ze(t)||Ge(t)?new Ux({style:{text:String(t)}}):t}function dw(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 pw(t,e,n,r,i){return(r=void 0===r?!0:r)&&t===e||i&&t===n||e<t&&t<n}var gw=function(e,n){return function(t){return e*(1-t)+n*t}};function yw(e,t){var i,a,o,s,n,r,l;return"number"==typeof e&&"number"==typeof t?gw(e,t):Array.isArray(e)&&Array.isArray(t)?(i=e,o=(a=t)?a.length:0,s=i?Math.min(o,i.length):0,function(t){for(var e=new Array(s),n=new Array(o),r=0,r=0;r<s;++r)e[r]=yw(i[r],a[r]);for(;r<o;++r)n[r]=a[r];for(r=0;r<s;++r)n[r]=e[r](t);return n}):"object"==typeof e&&"object"==typeof t?(void 0===(n=e)&&(n={}),void 0===(t=t)&&(t={}),r={},l={},Object.entries(t).forEach(function(t){var t=j(t,2),e=t[0],t=t[1];e in n?r[e]=yw(n[e],t):l[e]=t}),function(n){return Object.entries(r).forEach(function(t){var t=j(t,2),e=t[0],t=t[1];return l[e]=t(n)}),l}):function(t){return e}}function mw(t){for(var e=1/0,n=1/0,r=-1/0,i=-1/0,a=0;a<t.length;a++){var o=t[a],s=o.x,l=o.y,o=j([s+o.width,l+o.height],2),c=o[0],o=o[1];s<e&&(e=s),l<n&&(n=l),r<c&&(r=c),i<o&&(i=o)}return new Qx(e,n,r-e,i-n)}function vw(n,t,e){function r(t){var e=j(u?["height",a]:["width",i],2),n=e[0],r=e[1];switch(c){case"flex-start":return 0;case"flex-end":return r-t[n];case"center":return r/2-t[n]/2;default:return 0}}var i=n.width,a=n.height,o=void 0===(o=e.flexDirection)?"row":o,s=(e.flexWrap,e.justifyContent),l=void 0===s?"flex-start":s;e.alignContent;var c=void 0===(s=e.alignItems)?"flex-start":s,u="row"===o,e="row"===o||"column"===o,h=u?e?[1,0]:[-1,0]:e?[0,1]:[0,-1],f=(s=j([0,0],2))[0],d=s[1],e=mw(o=t.map(function(t){var e=t.width,t=t.height,n=j([f,d],2),r=n[0],n=n[1],i=j([f+e*h[0],d+t*h[1]],2);return f=i[0],d=i[1],new Qx(r,n,e,t)})),p={"flex-start":0,"flex-end":u?i-e.width:a-e.height,center:u?(i-e.width)/2:(a-e.height)/2};return mw(s=o.map(function(t){var e=t.x,n=t.y,t=Qx.fromRect(t);return t.x=u?e+p[l]:e,t.y=u?n:n+p[l],t})),s.map(function(t){var e=t.x,n=t.y,t=Qx.fromRect(t);return t.x=u?e:e+r(t),t.y=u?n+r(t):n,t}).map(function(t){var e,t=Qx.fromRect(t);return t.x+=null!=(e=n.x)?e:0,t.y+=null!=(e=n.y)?e:0,t})}function bw(t,e,n){return[]}function xw(t,e){return[t[0]*e,t[1]*e]}function ww(t,e){return[t[0]+e[0],t[1]+e[1]]}function Mw(t,e){return[t[0]-e[0],t[1]-e[1]]}function Ow(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function kw(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function Ew(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Sw(t){var e;return 0===t[0]&&0===t[1]?[0,0]:(e=Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)),[t[0]/e,t[1]/e])}function Aw(t,e){return+t.toPrecision(e)}function _w(t,e){var n,r={},i=Array.isArray(e)?e:[e];for(n in t)i.includes(n)||(r[n]=t[n]);return r}function Tw(t,e,n){void 0===n&&(n=[[0,0],[1,1]]);for(var e=!!(e=void 0===e?!1:e),r=[],i=0,a=t.length;i<a;i+=2)r.push([t[i],t[i+1]]);for(var o,s,l,c=function(t,e,n,r){var i,a=[],o=!!r,s=[1/0,1/0],l=[-1/0,-1/0];if(o){s=(r=j(r,2))[0],l=r[1];for(var c=0,u=t.length;c<u;c+=1)s=Ow(s,x=t[c]),l=kw(l,x)}for(var c=0,h=t.length;c<h;c+=1){var f,d,p,g,y,m,v,b,x=t[c];0!==c||n?c!==h-1||n?(f=t[[c?c-1:h-1,c-1][n?0:1]],m=[0,0],m=xw(m=Mw(d=t[n?(c+1)%h:c+1],f),e),0!==(y=(p=Ew(x,f))+(g=Ew(x,d)))&&(p/=y,g/=y),y=xw(m,-p),m=xw(m,g),v=ww(x,y),b=Ow(b=ww(x,m),kw(d,x)),b=kw(b,Ow(d,x)),v=Ow(v=ww(x,y=xw(y=Mw(b,x),-p/g)),kw(f,x)),b=ww(x,m=xw(m=Mw(x,v=kw(v,Ow(f,x))),g/p)),o&&(v=Ow(v=kw(v,s),l),b=Ow(b=kw(b,s),l)),a.push(i),a.push(v),i=b):(v=x,a.push(i),a.push(v)):i=x}return n&&a.push(a.shift()),a}(r,.4,e,n),u=r.length,h=[],i=0;i<u-1;i+=1)o=c[2*i],s=c[2*i+1],h.push(["C",o[0],o[1],s[0],s[1],(l=r[i+1])[0],l[1]]);return e&&(o=c[u],s=c[u+1],l=j(r,1)[0],h.push(["C",o[0],o[1],s[0],s[1],l[0],l[1]])),h}var Pw=["$el","anchor","cx","cy","d","defX","defY","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","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 Cw(t){var e,n,r={};for(e in t)n=e,Pw.includes(n)&&(r[e]=t[e]);return r}function Lw(t,e,n){void 0===n&&(n=!1);var r=t.getBBox(),i=r.width,r=r.height,e=e/Math.max(i,r);n&&t.scale(e)}M.prototype.selectAll=function(t){return new M("string"==typeof t?this._parent.querySelectorAll(t):t,null,this._elements[0],this._document)},M.prototype.selectFacetAll=function(t){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new M(this._elements,null,this._parent,this._document,void 0,void 0,t)},M.prototype.select=function(t){t="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new M([t],null,t,this._document)},M.prototype.append=function(t){var e=this,n="function"==typeof t?t:function(){return e.createElement(t)},r=[];if(null!==this._data){for(var i=0;i<this._data.length;i++){var a=this._data[i],a=j(Array.isArray(a)?a:[a,null],2),o=a[0],a=a[1];(l=n(o,i)).__data__=o,null!==a&&(l.__fromElements__=a),this._parent.appendChild(l),r.push(l)}return new M(r,null,this._parent,this._document)}for(i=0;i<this._elements.length;i++){var s=this._elements[i],l=n(o=s.__data__,i);s.appendChild(l),r.push(l)}return new M(r,null,r[0],this._document)},M.prototype.maybeAppend=function(t,e){e=B(this,Nw,"m",jw).call(this,"#"===t[0]?t:"#".concat(t),e);return e.attr("id",t),e},M.prototype.maybeAppendByClassName=function(t,e){t=t.toString(),e=B(this,Nw,"m",jw).call(this,"."===t[0]?t:".".concat(t),e);return e.attr("className",t),e},M.prototype.maybeAppendByName=function(t,e){e=B(this,Nw,"m",jw).call(this,'[name="'.concat(t,'"]'),e);return e.attr("name",t),e},M.prototype.data=function(t,n,e){void 0===n&&(n=function(t){return t}),void 0===e&&(e=function(){return null});for(var r,i,a=[],o=[],s=new Set(this._elements),l=[],c=new Set,u=new Map(this._elements.map(function(t,e){return[n(t.__data__,e),t]})),h=new Map(this._facetElements.map(function(t,e){return[n(t.__data__,e),t]})),f=Sd(this._elements,function(t){return e(t.__data__)}),d=0;d<t.length;d++){var p=t[d],g=n(p,d),y=e(p,d);if(u.has(g))(x=u.get(g)).__data__=p,x.__facet__=!1,o.push(x),s.delete(x),u.delete(g);else if(h.has(g))(x=h.get(g)).__data__=p,x.__facet__=!0,o.push(x),h.delete(g);else if(f.has(g)){var m=f.get(g);l.push([p,m]);try{r=void 0;for(var v=I(m),b=v.next();!b.done;b=v.next()){var x=b.value;s.delete(x)}}catch(t){r={error:t}}finally{try{b&&!b.done&&(i=v.return)&&i.call(v)}finally{if(r)throw r.error}}f.delete(g)}else u.has(y)?((x=u.get(y)).__toData__?x.__toData__.push(p):x.__toData__=[p],c.add(x),s.delete(x)):a.push(p)}var w=[new M([],a,this._parent,this._document),new M(o,null,this._parent,this._document),new M(s,null,this._parent,this._document),new M([],l,this._parent,this._document),new M(c,null,this._parent,this._document)];return new M(this._elements,null,this._parent,this._document,w)},M.prototype.merge=function(t){var e=O(O([],j(this._elements),!1),j(t._elements),!1),t=O(O([],j(this._transitions),!1),j(t._transitions),!1);return new M(e,null,this._parent,this._document,void 0,t)},M.prototype.createElement=function(t){if(this._document)return this._document.createElement(t,{});var e=M.registry[t];if(e)return new e;throw e="Unknown node type: ".concat(t),new Error(e)},M.prototype.join=function(t,e,n,r,i){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()});t=(t=void 0===t?function(t){return t}:t)(this._enter),e=e(this._update),n=n(this._exit),r=r(this._merge),i=i(this._split);return e.merge(t).merge(n).merge(r).merge(i)},M.prototype.remove=function(){for(var n=this,t=0;t<this._elements.length;t++)!function(t){var e=n._elements[t],t=n._transitions[t];t?t.then(function(){return e.remove()}):e.remove()}(t);return new M([],null,this._parent,this._document,void 0,this._transitions)},M.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},M.prototype.attr=function(n,r){var i="function"!=typeof r?function(){return r}:r;return this.each(function(t,e){void 0!==r&&(this[n]=i.call(this,t,e))})},M.prototype.style=function(n,r,t){void 0===t&&(t=!0);var i="function"==typeof r&&t?r:function(){return r};return this.each(function(t,e){void 0!==r&&(this.style[n]=i.call(this,t,e))})},M.prototype.styles=function(t,o){return void 0===t&&(t={}),void 0===o&&(o=!0),this.each(function(r,i){var a=this;Object.entries(t).forEach(function(t){var t=j(t,2),e=t[0],n=t[1],t="function"==typeof n&&o?n:function(){return n};void 0!==n&&a.attr(e,t.call(a,r,i))})})},M.prototype.update=function(n,t){void 0===t&&(t=!0);var r="function"==typeof n&&t?n:function(){return n};return this.each(function(t,e){n&&this.update&&this.update(r.call(this,t,e))})},M.prototype.maybeUpdate=function(n,t){void 0===t&&(t=!0);var r="function"==typeof n&&t?n:function(){return n};return this.each(function(t,e){n&&this.update&&this.update(r.call(this,t,e))})},M.prototype.transition=function(n){var r=this._transitions;return this.each(function(t,e){r[e]=n.call(this,t,e)})},M.prototype.on=function(t,e){return this.each(function(){this.addEventListener(t,e)}),this},M.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.call.apply(t,O([this._parent,this],j(e),!1)),this},M.prototype.node=function(){return this._elements[0]},M.prototype.nodes=function(){return this._elements},M.prototype.transitions=function(){return this._transitions.filter(function(t){return!!t})},M.prototype.parent=function(){return this._parent},Nw=new WeakSet,jw=function(t,e){var n=this._elements[0],t=n.querySelector(t);return t||(t="string"==typeof e?this.createElement(e):e(),n.appendChild(t)),new M([t],null,this._parent,this._document)},M.registry={g:fc,rect:Nc,circle:rc,path:kc,text:Ux,ellipse:cc,image:vc,line:wc,polygon:Ac,polyline:Pc,html:gc};var Nw,jw,Rw=M;function M(t,e,n,r,i,a,o){void 0===t&&(t=null),void 0===e&&(e=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===i&&(i=[null,null,null,null,null]),void 0===a&&(a=[]),void 0===o&&(o=[]),Nw.add(this),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=a,this._facetElements=o}function x(t){return new Rw([t],null,t,t.ownerDocument)}function Iw(t,e,n){return t.querySelector(e)?x(t).select(e):x(t).append(n)}function Bw(t){if(Ge(t))return[t,t,t,t];if(Ne(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 Dw(t){var t=t.getLocalBounds(),t=j([t.min,t.max],2),e=j(t[0],2),n=e[0],e=e[1],t=j(t[1],2),r=t[0],t=t[1];return{x:n,y:e,width:r-n,height:t-e,left:n,bottom:t,top:e,right:r}}function Fw(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function zw(t,e,n){void 0===n&&(n=!0);var e=e||(null==(e=t.match(/^([a-z][a-z0-9]+)/))?void 0:e[0])||"",t=t.replace(new RegExp("^(".concat(e,")")),"");return n?(e=t).toString().charAt(0).toLowerCase()+e.toString().slice(1):t}function w(t,r,i){void 0===i&&(i=!1);var a={};return Object.entries(t).forEach(function(t){var e,t=j(t,2),n=t[0],t=t[1];"className"!==n&&"class"!==n&&(n.startsWith("show")&&zw(n,"show").startsWith(r)!==i?n===(e=r,"".concat("show").concat(Fw(e)))?a[n]=t:a[n.replace(new RegExp(Fw(r)),"")]=t:n.startsWith("show")||n.startsWith(r)===i||"filter"===(e=zw(n,r))&&"function"==typeof t||(a[e]=t))}),a}function Ww(t,r){return Object.entries(t).reduce(function(t,e){var e=j(e,2),n=e[0],e=e[1];return n.startsWith("show")?t["show".concat(r).concat(n.slice(4))]=e:t["".concat(r).concat(Fw(n))]=e,t},{})}function Gw(t,n){void 0===n&&(n=["x","y","class","className"]);var r=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],i={},a={};return Object.entries(t).forEach(function(t){var t=j(t,2),e=t[0],t=t[1];n.includes(e)||(-1!==r.indexOf(e)?a[e]=t:i[e]=t)}),[i,a]}function Hw(o,t){if(t)try{var e=t.replace(/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,function(t,e,n){return"translate(".concat((e=e,n=n,i=(r=(r=o).getBBox()).width,a=r.height,[(r=j([e,n].map(function(t,e){var n;return t.includes("%")?parseFloat((null==(n=t.match(/[+-]?([0-9]*[.])?[0-9]+/))?void 0:n[0])||"0")/100*(0===e?i:a):t}),2))[0],r[1]]),")");var r,i,a});o.attr("transform",e)}catch(t){}}t(Yw,Vw=oc),Object.defineProperty(Yw.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=qx(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(Yw.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),Yw.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},Yw.prototype.disconnectedCallback=function(){var t;null!=(t=this._offscreen)&&t.destroy()},Yw.prototype.attributeChangedCallback=function(t){"visibility"===t&&!function(){Gx(this,"hidden"!==this.attributes.visibility)}.call(this)},Yw.prototype.update=function(t,e){return this.attr(nw({},this.attributes,t=void 0===t?{}:t)),null==(t=this.render)?void 0:t.call(this,this.attributes,this,e)},Yw.prototype.clear=function(){this.removeChildren()},Yw.prototype.bindEvents=function(t,e){};var Vw,mm=Yw;function Yw(t,e){t=Vw.call(this,nw({},{style:e=void 0===e?{}:e},t))||this;return t.initialized=!1,t._defaultOptions=e,t}function qw(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"]]}function $w(t,e,n){return[["M",t,e+n],["L",t,e-n]]}function Uw(t,e,n){return[["M",t-n,e],["L",t+n,e]]}vm=qw,Iy=Uw;function Xw(t){n="default",je(e=t)&&e instanceof Image?n="image":Pe(e)?n="symbol":ze(e)&&(r=new RegExp("data:(image|text)"),n=e.match(r)?"base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(e)?"url":"symbol");var e,n,r=n;return["base64","url","image"].includes(r)?"image":t&&"symbol"===r?"path":null}t(Qw,Kw=mm),Qw.prototype.render=function(t,e){var r=t.symbol,n=t.size,i=void 0===n?16:n,a=at(t,["symbol","size"]),o=Xw(r);dw(!!o,x(e),function(t){t.maybeAppendByClassName("marker",o).attr("className","marker ".concat(o,"-marker")).call(function(t){var e,n;"image"===o?t.styles({img:r,width:e=2*i,height:e,x:-i,y:-i}):(e=i/2,n=Pe(r)?r:Qw.getSymbol(r),t.styles(m({path:null==n?void 0:n(0,0,e)},a)))})})},Qw.MARKER_SYMBOL_MAP=new Map,Qw.registerSymbol=function(t,e){Qw.MARKER_SYMBOL_MAP.set(t,e)},Qw.getSymbol=function(t){return Qw.MARKER_SYMBOL_MAP.get(t)};var Kw,Zw=Qw;function Qw(){return null!==Kw&&Kw.apply(this,arguments)||this}Zw.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]]}),Zw.registerSymbol("hyphen",function(t,e,n){return[["M",t-n,e],["L",t+n,e]]}),Zw.registerSymbol("line",$w),Zw.registerSymbol("plus",function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]}),Zw.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]]}),Zw.registerSymbol("circle",qw),Zw.registerSymbol("point",vm),Zw.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"]]}),Zw.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"]]}),Zw.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"]]}),Zw.registerSymbol("diamond",function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]}),Zw.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"]]}),Zw.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"]]}),Zw.registerSymbol("line",$w),Zw.registerSymbol("dot",Uw),Zw.registerSymbol("dash",Iy),Zw.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]]}),Zw.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]]}),Zw.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]]}),Zw.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]]}),Zw.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]]});t(eM,Jw=tc),eM.prototype.render=function(){var t=this.attributes.columns;x(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()})},eM.prototype.update=function(t){this.attr(nw({},this.attributes,t)),this.render()},eM.prototype.clear=function(){this.removeChildren()};var Jw,tM=eM;function eM(t){var e=this,n=t.style,t=at(t,["style"]);return(e=Jw.call(this,ot({},{type:"column"},m({style:n},t)))||this).columnsGroup=new fc({name:"columns"}),e.appendChild(e.columnsGroup),e.render(),e}t(iM,nM=tc),iM.prototype.render=function(){var t=this.attributes,e=t.lines,t=t.areas;e&&this.renderLines(e),t&&this.renderAreas(t)},iM.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},iM.prototype.update=function(t){this.attr(nw({},this.attributes,t)),this.render()},iM.prototype.renderLines=function(t){x(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()})},iM.prototype.renderAreas=function(t){x(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()})};var nM,rM=iM;function iM(t){var e=this,n=t.style,t=at(t,["style"]);return(e=nM.call(this,ot({},{type:"lines"},m({style:n},t)))||this).linesGroup=e.appendChild(new fc),e.areasGroup=e.appendChild(new fc),e.render(),e}function aM(t,e){var n=(e=void 0===e?!1:e)?t.length-1:0,t=t.map(function(t,e){return O([e===n?"M":"L"],j(t),!1)});return e?t.reverse():t}function oM(t,e){if(void 0===e&&(e=!1),t.length<=2)return aM(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var a=e?t[r-i-1]:t[i];on(a,n.slice(-2))||n.push.apply(n,O([],j(a),!1))}var o=Tw(n,!1);return e?o.unshift(O(["M"],j(t[r-1]),!1)):o.unshift(O(["M"],j(t[0]),!1)),o}function sM(t,e,n){t=Ze(t);return t.push(["L",e,n],["L",0,n],["Z"]),t}function lM(t){return 0===t.length?[0,0]:[De(function(t,e){if(Ne(t)){for(var n,r=1/0,i=0;i<t.length;i++){var a=t[i],o=Pe(e)?e(a):a[e];o<r&&(n=a,r=o)}return n}}(t,function(t){return De(t)||0})),Be(function(t,e){if(Ne(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var a=t[i],o=Pe(e)?e(a):a[e];r<o&&(n=a,r=o)}return n}}(t,function(t){return Be(t)||0}))]}function cM(t){for(var e=Ze(t),n=e[0].length,t=j([Array(n).fill(0),Array(n).fill(0)],2),r=t[0],i=t[1],a=0;a<e.length;a+=1)for(var o=e[a],s=0;s<n;s+=1)0<=o[s]?(o[s]+=r[s],r[s]=o[s]):(o[s]+=i[s],i[s]=o[s]);return e}t(fM,uM=mm),Object.defineProperty(fM.prototype,"rawData",{get:function(){var t=this.attributes.data;return t&&0!==(null==t?void 0:t.length)?(t=Ze(t),Ge(t[0])?[t]:t):[[]]},enumerable:!1,configurable:!0}),Object.defineProperty(fM.prototype,"data",{get:function(){return this.attributes.isStack?cM(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(fM.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(fM.prototype,"baseline",{get:function(){var t=this.scales.y,e=j(t.getOptions().domain||[0,0],2),n=e[0],e=e[1];return e<0?t.map(e):t.map(n<0?0:n)},enumerable:!1,configurable:!0}),Object.defineProperty(fM.prototype,"containerShape",{get:function(){var t=this.attributes;return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),Object.defineProperty(fM.prototype,"linesStyle",{get:function(){var n=this,t=this.attributes,e=t.type,r=t.isStack,i=t.smooth;if("line"!==e)throw new Error("linesStyle can only be used in line type");var a,o,s,l,c,u,h,f,d,p=w(this.attributes,"area"),g=w(this.attributes,"line"),t=this.containerShape.width,e=this.data;return 0===e[0].length?{lines:[],areas:[]}:(a=this.scales,u=a.x,a=a.y,e=e,o=(u={type:"line",x:u,y:a}).x,s=u.y,l=(u=j(s.getOptions().range||[0,0],2))[0],c=u[1],l<c&&(u=j([l,c],2),c=u[0],l=u[1]),a=e.map(function(t){return t.map(function(t,e){return[o.map(e),We(s.map(t),c,l)]})}),u=[],p&&(e=this.baseline,u=r?(i?function(t,e,n){for(var r=[],i=t.length-1;0<=i;--i){var a,o=t[i],s=oM(o),l=void 0,l=0===i?sM(s,e,n):(a=oM(t[i-1],!0),o=o[0],a[0][0]="L",O(O(O([],j(s),!1),j(a),!1),[O(["M"],j(o),!1),["Z"]],!1));r.push(l)}return r}:function(t,e,n){for(var r=[],i=t.length-1;0<=i;--i){var a,o=aM(t[i]),s=void 0,s=0===i?sM(o,e,n):((a=aM(t[i-1],!0))[0][0]="L",O(O(O([],j(o),!1),j(a),!1),[["Z"]],!1));r.push(s)}return r})(a,t,e):(h=i,f=t,d=e,a.map(function(t){return sM((h?oM:aM)(t),f,d)}))),{lines:a.map(function(t,e){return m({stroke:n.getColor(e),path:(i?oM:aM)(t)},g)}),areas:u.map(function(t,e){return m({path:t,fill:n.getColor(e)},p)})})},enumerable:!1,configurable:!0}),Object.defineProperty(fM.prototype,"columnsStyle",{get:function(){var i=this,a=w(this.attributes,"column"),t=this.attributes,o=t.isStack;if("column"!==t.type)throw new Error("columnsStyle can only be used in column type");var t=this.containerShape.height,s=this.rawData;if(!s)return{columns:[]};o&&(s=cM(s));var e=this.createScales(s),l=e.x,c=e.y,e=j(lM(s),2),n=e[0],e=e[1],u=new wg({domain:[0,e-(0<n?0:n)],range:[0,t]}),h=l.getBandWidth(),f=this.rawData;return{columns:s.map(function(t,r){return t.map(function(t,e){var n=h/s.length;return m(m({fill:i.getColor(r)},a),o?{x:l.map(e),y:c.map(t),width:h,height:u.map(f[r][e])}:{x:l.map(e)+n*r,y:0<=t?c.map(t):c.map(0),width:n,height:u.map(Math.abs(t))})})})}},enumerable:!1,configurable:!0}),fM.prototype.render=function(t,e){this.container=Iw(e,".container","rect").attr("className","container").node();var n=t.type,r="spark".concat(n),i="line"===n?this.linesStyle:this.columnsStyle;this.spark=Iw(e,".".concat(r),function(){return new("line"===n?rM:tM)({className:r,style:i})}).styles(i).node()},fM.prototype.getColor=function(t){var e=this.attributes.color;return Ne(e)?e[t%e.length]:Pe(e)?e.call(null,t):e},fM.prototype.createScales=function(t){var e,n=this.attributes,r=n.type,i=n.range,i=void 0===i?[]:i,a=n.isGroup,n=n.spacing,o=this.containerShape,s=o.width,o=o.height,l=j(lM(t),2),c=l[0],l=l[1],c=new wg({domain:[null!=(e=i[0])?e:c,null!=(e=i[1])?e:l],range:[o,0]});return"line"===r?{type:r,x:new wg({domain:[0,t[0].length-1],range:[0,s]}),y:c}:{type:r,x:new cg({domain:t[0].map(function(t,e){return e}),range:[0,s],paddingInner:a?n:0}),y:c}},fM.tag="sparkline";var uM,hM=fM;function fM(t){return uM.call(this,t,{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"})||this}function dM(n){var e,r;return n?(e=["enter","update","exit"],r=Object.fromEntries(Object.entries(n).filter(function(t){t=j(t,1)[0];return!e.includes(t)})),Object.fromEntries(e.map(function(t){var e;return"boolean"!=typeof(e=n)&&"enter"in e&&"update"in e&&"exit"in e?!1===n[t]?[t,!1]:[t,m(m({},n[t]),r)]:[t,r]}))):{enter:!1,update:!1,exit:!1}}function pM(t,e){t?t.finished.then(e):e()}function gM(t,e){"update"in t?t.update(e):t.attr(e)}function yM(t,e,n){return 0===e.length?null:n?t.animate(e,n):(gM(t,{style:e.slice(-1)[0]}),null)}function mM(r,t,e){var i={},a={};return Object.entries(t).forEach(function(t){var e,t=j(t,2),n=t[0],t=t[1];P(t)||(e=r.style[n]||r.parsedStyle[n]||0)!==t&&(i[n]=e,a[n]=t)}),e?yM(r,[i,a],m({fill:"both"},e)):(gM(r,a),null)}function vM(t,e){return t.style.opacity||(t.style.opacity=1),mM(t,{opacity:0},e)}var bM,xM={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},wM={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},MM={orientation:"horizontal",showLabel:!0,type:"start"},OM=ew({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track"},"slider"),kM=ew({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),EM=(t(SM,bM=mm),SM.prototype.render=function(t,e){var n=t.size,n=void 0===n?10:n,r=t.radius,r=void 0===r?n/4:r,i=t.orientation,t=at(t,["size","radius","orientation"]),a=2.4*n,r=x(e).maybeAppendByClassName(kM.iconRect,"rect").styles(m(m({},t),{width:n,height:a,radius:r,x:-n/2,y:-a/2})),o=1/3*n,s=2/3*n,l=.25*a,c=.75*a;r.maybeAppendByClassName("".concat(kM.iconLine,"-1"),"line").styles(m({x1:o,x2:o,y1:l,y2:c},t)),r.maybeAppendByClassName("".concat(kM.iconLine,"-2"),"line").styles(m({x1:s,x2:s,y1:l,y2:c},t)),r.node().setOrigin(n/2,a/2),"vertical"===i?e.setLocalEulerAngles(90):e.setLocalEulerAngles(0)},SM);function SM(){return null!==bM&&bM.apply(this,arguments)||this}t(TM,AM=mm),TM.prototype.renderLabel=function(t){var e=this,n=this.attributes.showLabel,r=w(this.attributes,"label"),i=r.transform,r=j(Gw(at(r,["transform"]),[]),2),a=r[0],r=r[1],t=x(t).maybeAppendByClassName(kM.labelGroup,"g").styles(r),r=m(m({},wM),a),o=r.text,s=at(r,["text"]);dw(!!n,t,function(t){e.label=t.maybeAppendByClassName(kM.label,"text").styles(m(m({},s),{transform:i,text:"".concat(o)})),e.label.on("mousedown",function(t){t.stopPropagation()}),e.label.on("touchstart",function(t){t.stopPropagation()})})},TM.prototype.renderIcon=function(t){var e=this.attributes.orientation,n=m(m({orientation:e},xM),w(this.attributes,"icon")),e=this.attributes.iconShape,r=void 0===e?function(){return new EM({style:n})}:e;x(t).maybeAppendByClassName(kM.iconGroup,"g").selectAll(kM.icon.class).data([r]).join(function(t){return t.append(r).attr("className",kM.icon.name)},function(t){return t.update(n)},function(t){return t.remove()})},TM.prototype.render=function(t,e){this.renderIcon(e),this.renderLabel(e)};var AM,_M=TM;function TM(t){return AM.call(this,t,MM)||this}t(LM,PM=mm),Object.defineProperty(LM.prototype,"values",{get:function(){return this.attributes.values},set:function(t){this.attributes.values=this.clampValues(t)},enumerable:!1,configurable:!0}),Object.defineProperty(LM.prototype,"sparklineStyle",{get:function(){var t;return"horizontal"!==this.attributes.orientation?null:(t=w(this.attributes,"sparkline"),m(m({zIndex:0},this.availableSpace),t))},enumerable:!1,configurable:!0}),Object.defineProperty(LM.prototype,"shape",{get:function(){var t=this.attributes,e=t.trackLength,t=t.trackSize,t=j(this.getOrientVal([[e,t],[t,e]]),2);return{width:t[0],height:t[1]}},enumerable:!1,configurable:!0}),Object.defineProperty(LM.prototype,"availableSpace",{get:function(){var t=j(Bw(this.attributes.padding),4),e=t[0],n=t[1],r=t[2],t=t[3],i=this.shape;return{x:t,y:e,width:i.width-(t+n),height:i.height-(e+r)}},enumerable:!1,configurable:!0}),LM.prototype.getValues=function(){return this.values},LM.prototype.setValues=function(t,e){void 0===e&&(e=!1),this.attributes.values=t=void 0===t?[0,0]:t;t=!1!==e&&this.attributes.animate;mM(this.selectionShape.node(),this.selectionStyle,t),this.updateHandlesPosition(t)},LM.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(mM(this.startHandle,this.getHandleStyle("start"),t),mM(this.endHandle,this.getHandleStyle("end"),t))},LM.prototype.innerSetValues=function(t,e){void 0===e&&(e=!1);var n=this.values,t=this.clampValues(t=void 0===t?[0,0]:t);this.attr("values",t),this.setValues(t),e&&this.onValueChange(n)},LM.prototype.renderTrack=function(t){var e=this.attributes.brushable,n=w(this.attributes,"track");this.trackShape=x(t).maybeAppendByClassName(OM.track,"rect").styles(m(m({cursor:e?"crosshair":"default"},this.shape),n))},LM.prototype.renderSparkline=function(t){var n=this;dw("horizontal"===this.attributes.orientation,x(t).maybeAppendByClassName(OM.sparklineGroup,"g"),function(t){var e=n.sparklineStyle;t.maybeAppendByClassName(OM.sparkline,function(){return new hM({style:e})}).update(e)})},Object.defineProperty(LM.prototype,"selectionStyle",{get:function(){var t=w(this.attributes,"selection");return m(m({},t),this.calcMask())},enumerable:!1,configurable:!0}),LM.prototype.renderHandles=function(){var t,e=this,n=(this.attributes.showHandle?["start","end"]:[]).map(function(t){return{type:t}}),r=this;null!=(t=this.foregroundGroup)&&t.selectAll(OM.handle.class).data(n,function(t){return t.type}).join(function(t){return t.append(function(t){t=t.type;return new _M({style:e.getHandleStyle(t)})}).each(function(t){var e=t.type,t=(this.attr("class","".concat(OM.handle.name," ").concat(e,"-handle")),"".concat(e,"Handle"));(r[t]=this).addEventListener("pointerdown",function(t){r.onDragStart(e)(t)})})},function(t){return t.each(function(t){t=t.type;this.update(r.getHandleStyle(t))})},function(t){return t.each(function(t){t=t.type,t="".concat(t,"Handle");r[t]=void 0}).remove()})},LM.prototype.renderSelection=function(t){this.foregroundGroup=x(t).maybeAppendByClassName(OM.foreground,"g"),this.selectionShape=this.foregroundGroup.maybeAppendByClassName(OM.selection,"rect").styles(this.selectionStyle),this.renderHandles()},LM.prototype.render=function(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderSelection(e)},LM.prototype.clampValues=function(t,e){void 0===e&&(e=4);var n=j(this.range,2),r=n[0],n=n[1],i=j(this.getValues().map(function(t){return Aw(t,e)}),2),a=i[0],i=i[1],t=j((t||[a,i]).map(function(t){return Aw(t,e)}),2),o=t[0],t=t[1],s=(t<o&&(o=(s=j([t,o],2))[0],t=s[1]),t-o);return n-r<s?[r,n]:o<r?a===r&&i===t?[r,t]:[r,s+r]:n<t?i===n&&a===o?[o,n]:[n-s,n]:[o,t]},LM.prototype.calcMask=function(t){var t=j(this.clampValues(t),2),e=t[0],t=t[1],n=this.availableSpace,r=n.x,i=n.y,a=n.width,n=n.height;return this.getOrientVal([{y:i,height:n,x:e*a+r,width:(t-e)*a},{x:r,width:a,y:e*n+i,height:(t-e)*n}])},LM.prototype.calcHandlePosition=function(t){var e=this.availableSpace,n=e.x,r=e.y,i=e.width,e=e.height,a=j(this.clampValues(),2),o=a[0],a=a[1],t=("start"===t?o:a)*this.getOrientVal([i,e]);return{x:n+this.getOrientVal([t,i/2]),y:r+this.getOrientVal([e/2,t])}},LM.prototype.inferTextStyle=function(t){return"horizontal"===this.attributes.orientation?{}:"start"===t?{transform:"rotate(90)",textAlign:"start"}:"end"===t?{transform:"rotate(90)",textAlign:"end"}:{}},LM.prototype.calcHandleText=function(t){var e,n,r,i,a,o,s,l,c=this.attributes,u=c.orientation,h=c.formatter,c=c.autoFitLabel,f=w(this.attributes,"handle"),d=w(f,"label"),f=f.spacing,p=this.getHandleSize(),g=this.clampValues(),h=h("start"===t?g[0]:g[1]),g=new Ux({style:m(m(m({},d),this.inferTextStyle(t)),{text:h})}),d=g.getBBox(),y=d.width,d=d.height;return g.destroy(),c?(c=g=0,l=(e=this.availableSpace).width,e=e.height,n=(a=this.calcMask()).x,r=a.y,i=a.width,a=a.height,o=f+p,"horizontal"===u?(s=o+y/2,g="start"===t?0<n-o-y?-s:s:y<l-n-i-o?s:-s):(l=d+o,c="start"===t?d<r-p?-l:o:d<e-(r+a)-p?l:-o),{x:g,y:c,text:h}):(n=f+p+("horizontal"===u?y/2:0),(i={text:h})["horizontal"===u?"x":"y"]="start"===t?-n:n,i)},LM.prototype.getHandleLabelStyle=function(t){var e;return this.attributes.showLabel?(e=w(this.attributes,"handleLabel"),m(m(m({},e),this.calcHandleText(t)),this.inferTextStyle(t))):{}},LM.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=w(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),r=this.getHandleSize();return m({cursor:n,shape:t,size:r},e)},LM.prototype.getHandleStyle=function(t){var e=this.attributes,n=e.showLabel,e=e.orientation,r=this.calcHandlePosition(t),i=this.calcHandleText(t);return m(m(m(m({},Ww(this.getHandleIconStyle(),"icon")),Ww(m(m({},this.getHandleLabelStyle(t)),i),"label")),r),{orientation:e,showLabel:n,type:t,zIndex:3})},LM.prototype.getHandleSize=function(){var t=this.attributes,e=t.handleIconSize,n=t.width,t=t.height;return e||Math.floor((this.getOrientVal([+t,+n])+4)/2.4)},LM.prototype.getOrientVal=function(t){var t=j(t,2),e=t[0],t=t[1];return"horizontal"===this.attributes.orientation?e:t},LM.prototype.setValuesOffset=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=!1);var r=j(this.getValues(),2),t=[r[0]+t,r[1]+e].sort();n?this.setValues(t):this.innerSetValues(t,!0)},LM.prototype.getRatio=function(t){var e=this.availableSpace,n=e.width,e=e.height;return t/this.getOrientVal([n,e])},LM.prototype.dispatchCustomEvent=function(t,e,n){var r=this;t.on(e,function(t){t.stopPropagation(),r.dispatchEvent(new gl(n,{detail:t}))})},LM.prototype.bindEvents=function(){var t=this.selectionShape,t=(this.addEventListener("wheel",this.onScroll),t.on("mousedown",this.onDragStart("selection")),t.on("touchstart",this.onDragStart("selection")),this.dispatchCustomEvent(t,"mouseenter","selectionMouseenter"),this.dispatchCustomEvent(t,"mouseleave","selectionMouseleave"),this.dispatchCustomEvent(t,"click","selectionClick"),this.trackShape);this.dispatchCustomEvent(t,"click","trackClick"),this.dispatchCustomEvent(t,"mouseenter","trackMouseenter"),this.dispatchCustomEvent(t,"mouseleave","trackMouseleave"),t.on("mousedown",this.onDragStart("track")),t.on("touchstart",this.onDragStart("track"))},LM.prototype.onScroll=function(t){var e;this.attributes.scrollable&&(e=t.deltaX,t=t.deltaY,t=this.getRatio(t||e),this.setValuesOffset(t,t,!0))},LM.tag="slider";var PM,CM=LM;function LM(t){var a=PM.call(this,t,m(m(m({animate:{duration:100,fill:"both"},brushable:!0,formatter:function(t){return t.toString()},handleSpacing:2,orientation:"horizontal",padding:0,autoFitLabel:!0,scrollable:!0,selectionCursor:"move",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]},Ww(MM,"handle")),Ww(xM,"handleIcon")),Ww(wM,"handleLabel")))||this;return a.range=[0,1],a.onDragStart=function(i){return function(t){t.stopPropagation(),a.target=i,a.prevPos=a.getOrientVal(hw(t));var t=a.availableSpace,e=t.x,t=t.y,n=a.attributes,r=n.x,n=n.y;a.selectionStartPos=a.getRatio(a.prevPos-a.getOrientVal([e,t])-a.getOrientVal([+r,+n])),a.selectionWidth=0,document.addEventListener("mousemove",a.onDragging),document.addEventListener("touchmove",a.onDragging),document.addEventListener("mouseup",a.onDragEnd),document.addEventListener("touchend",a.onDragEnd)}},a.onDragging=function(t){var e=a.attributes,n=e.slidable,r=e.brushable,e=(t.stopPropagation(),a.getOrientVal(hw(t))),t=e-a.prevPos;if(t){var i=a.getRatio(t);switch(a.target){case"start":n&&a.setValuesOffset(i);break;case"end":n&&a.setValuesOffset(0,i);break;case"selection":n&&a.setValuesOffset(i,i);break;case"track":if(!r)return;a.selectionWidth+=i,a.innerSetValues([a.selectionStartPos,a.selectionStartPos+a.selectionWidth].sort(),!0)}a.prevPos=e}},a.onDragEnd=function(){document.removeEventListener("mousemove",a.onDragging),document.removeEventListener("mousemove",a.onDragging),document.removeEventListener("mouseup",a.onDragEnd),document.removeEventListener("touchend",a.onDragEnd)},a.onValueChange=function(t){t=new gl("valuechange",{detail:{oldValue:t,value:a.getValues()}});a.dispatchEvent(t)},a.selectionStartPos=0,a.selectionWidth=0,a.prevPos=0,a.target="",a}t(RM,NM=mm),Object.defineProperty(RM.prototype,"padding",{get:function(){return Bw(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(RM.prototype,"value",{get:function(){var t=this.attributes.value,e=j(this.range,2),n=e[0],e=e[1];return We(t,n,e)},enumerable:!1,configurable:!0}),Object.defineProperty(RM.prototype,"trackLength",{get:function(){var t=this.attributes,e=t.viewportLength,t=t.trackLength;return void 0===t?e:t},enumerable:!1,configurable:!0}),Object.defineProperty(RM.prototype,"availableSpace",{get:function(){var t=this.attributes.trackSize,e=this.trackLength,n=j(this.padding,4),r=n[0],i=n[1],a=n[2],n=n[3],t=j(this.getOrientVal([[e,t],[t,e]]),2);return{x:n,y:r,width:+t[0]-(n+i),height:+t[1]-(r+a)}},enumerable:!1,configurable:!0}),Object.defineProperty(RM.prototype,"trackRadius",{get:function(){var t=this.attributes,e=t.isRound,t=t.trackSize;return e?t/2:0},enumerable:!1,configurable:!0}),Object.defineProperty(RM.prototype,"thumbRadius",{get:function(){var t,e=this.attributes,n=e.isRound,e=e.thumbRadius;return n?(t=(n=this.availableSpace).width,n=n.height,e||this.getOrientVal([n,t])/2):0},enumerable:!1,configurable:!0}),RM.prototype.getValues=function(t){void 0===t&&(t=this.value);var e=this.attributes,e=e.viewportLength/e.contentLength,n=j(this.range,2),r=n[0],t=t*(n[1]-r-e);return[t,t+e]},RM.prototype.getValue=function(){return this.value},RM.prototype.renderSlider=function(t){var e=this.attributes,n=e.orientation,r=e.trackSize,i=e.padding,e=e.slidable,a=w(this.attributes,"track"),o=w(this.attributes,"thumb"),s=m(m({brushable:!1,orientation:n,padding:i,selectionRadius:this.thumbRadius,showHandle:!1,slidable:e,trackLength:this.trackLength,trackRadius:this.trackRadius,trackSize:r,values:this.getValues()},Ww(a,"track")),Ww(o,"selection"));this.slider=x(t).maybeAppendByClassName("scrollbar",function(){return new CM({style:s})}).update(s).node()},RM.prototype.render=function(t,e){this.renderSlider(e)},RM.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.attributes.value,r=j(this.range,2),i=r[0],r=r[1];this.slider.setValues(this.getValues(We(t,i,r)),e),this.onValueChange(n)},RM.prototype.bindEvents=function(){var e=this;this.slider.addEventListener("trackClick",function(t){t.stopPropagation(),e.onTrackClick(t.detail)}),this.onHover()},RM.prototype.getOrientVal=function(t){return"horizontal"===this.attributes.orientation?t[0]:t[1]},RM.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)},RM.tag="scrollbar";var NM,jM=RM;function RM(t){var a=NM.call(this,t,{isRound:!0,orientation:"vertical",padding:[2,2,2,2],scrollable:!0,slidable:!0,thumbCursor:"default",trackSize:10,value:0})||this;return a.range=[0,1],a.onValueChange=function(t){var e=a.attributes.value;t!==e&&(a.dispatchEvent(new gl("scroll",t={detail:{oldValue:t,value:e}})),a.dispatchEvent(new gl("valuechange",t)))},a.onTrackClick=function(t){var e,n,r,i;a.attributes.slidable&&(r=(e=j(a.getLocalPosition(),2))[0],e=e[1],n=(i=j(a.padding,4))[0],i=i[3],r=a.getOrientVal([r+i,e+n]),i=(a.getOrientVal(hw(t))-r)/a.trackLength,a.setValue(i,!0))},a.onThumbMouseenter=function(t){a.dispatchEvent(new gl("thumbMouseenter",{detail:t.detail}))},a.onTrackMouseenter=function(t){a.dispatchEvent(new gl("trackMouseenter",{detail:t.detail}))},a.onThumbMouseleave=function(t){a.dispatchEvent(new gl("thumbMouseleave",{detail:t.detail}))},a.onTrackMouseleave=function(t){a.dispatchEvent(new gl("trackMouseleave",{detail:t.detail}))},a}var IM={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 kc({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",tickStrokeOpacity:.65,labelOverlap:[]},BM=(ot({},IM,{style:{type:"arc"}}),ot({},IM,{style:{}}),ew({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")),DM=ew({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function FM(t){return t.reduce(function(t,e,n){return t.push(O([0===n?"M":"L"],j(e),!1)),t},[])}function zM(t,e,n){var r,i,a,o;return"surround"===e.type?(r=t,n=n,o=(e=e).connect,e=e.center,"line"===(void 0===o?"line":o)?FM(r):e?(i=Ew(r[0],e),a=n?0:1,r.reduce(function(t,e,n){return 0===n?t.push(O(["M"],j(e),!1)):t.push(O(["A",i,i,0,0,a],j(e),!1)),t},[])):[]):FM(t)}function WM(t,e,n){function r(t,e){return[l,t,c,e,s].flat()}var i=n.type,a=n.connect,o=n.center,s=n.closed?[["Z"]]:[],n=j([zM(t,n),zM(e.slice().reverse(),n,!0)],2),l=n[0],c=n[1],n=j([t[0],e.slice(-1)[0]],2),t=n[0],e=n[1];if("line"===a||"surround"===i)return r([O(["L"],j(e),!1)],[O(["L"],j(t),!1)]);if(o)return a=(n=j([Ew(e,o),Ew(t,o)],2))[0],i=n[1],r([O(["A",a,a,0,0,1],j(e),!1),O(["L"],j(e),!1)],[O(["A",i,i,0,0,0],j(t),!1),O(["L"],j(t),!1)]);throw new Error("Arc grid need to specified center")}function GM(t,e,n){var r=n.animate,i=n.connect,a=n.areaFill;if(e.length<2||!a||!i)return[];for(var o=Array.isArray(a)?a:[a,"transparent"],s=[],l=0;l<e.length-1;l++){var c=j([e[l].points,e[l+1].points],2),c=WM(c[0],c[1],n);s.push({path:c,fill:o[l%o.length]})}return t.selectAll(DM.region.class).data(s,function(t,e){return e}).join(function(t){return t.append("path").each(function(t,e){t=tw(t,[t,e,s]);this.attr(t)}).attr("className",DM.region.name)},function(t){return t.transition(function(t,e){return mM(this,tw(t,[t,e,s]),r.update)})},function(t){return t.transition(function(){var t=this,e=vM(this,r.exit);return pM(e,function(){return t.remove()}),e})}).transitions()}t(YM,HM=mm),YM.prototype.render=function(t,e){t.type,t.center,t.areaFill,t.closed;var n,r,i,a,o=at(t,["type","center","areaFill","closed"]),s=(s=void 0===(s=t.data)?[]:s,t.closed?s.map(function(t){var e=t.points,n=j(e,1)[0];return m(m({},t),{points:O(O([],j(e),!1),[n],!1)})}):s),l=x(e).maybeAppendByClassName(DM.lineGroup,"g"),e=x(e).maybeAppendByClassName(DM.regionGroup,"g"),o=(l=l,r=o,i=(n=t).animate,a=s.map(function(t,e){return{id:t.id||"grid-line-".concat(e),path:zM(t.points,n)}}),l.selectAll(DM.line.class).data(a,function(t){return t.id}).join(function(t){return t.append("path").each(function(t,e){t=tw(Cw(m({path:t.path},r)),[t,e,a]);this.attr(m({class:DM.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4]},t))})},function(t){return t.transition(function(t,e){return mM(this,tw(Cw(m({path:t.path},r)),[t,e,a]),i.update)})},function(t){return t.transition(function(){var t=this,e=vM(this,i.exit);return pM(e,function(){return t.remove()}),e})}).transitions()),l=GM(e,s,t);return O(O([],j(o),!1),j(l),!1)};var HM,VM=YM;function YM(){return null!==HM&&HM.apply(this,arguments)||this}function qM(t,e){return Object.fromEntries(Object.entries(t).map(function(t){t=j(t,2);return[t[0],tw(t[1],e)]}))}function $M(t,e){return e&&Pe(e)?t.filter(e):t}var UM=Je(function(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n},function(t,e){return[t,e.startAngle,e.endAngle].join()}),XM=Je(function(t,e){var n,r,i;return"linear"===e.type?(r=(n=j(e.startPos,2))[0],n=n[1],i=j(e.endPos,2),Sw([(r=j([i[0]-r,i[1]-n],2))[0],r[1]])):(i=Kx(UM(t,e)),[-Math.sin(i),Math.cos(i)])},function(t,e){var n,r,i,a="linear"===(n=e).type?(a=n.startPos,r=n.endPos,O(O([],j(a),!1),j(r),!1)):(a=n.startAngle,r=n.endAngle,i=n.center,n=n.radius,O(O([a,r],j(i),!1),[n],!1));return"arc"===e.type&&a.push(t),a.join()});function KM(t,e,n){t=XM(t,n);return n=t,"positive"!==e?[n[1],-n[0]]:[-n[1],n[0]]}function ZM(t,e){return KM(t,e.labelDirection,e)}var QM=Je(function(t,e){var n=j(e.startPos,2),r=n[0],n=n[1],e=j(e.endPos,2),e=j([e[0]-r,e[1]-n],2);return[r+e[0]*t,n+e[1]*t]},function(t,e){return O(O([t],j(e.startPos),!1),j(e.endPos),!1).join()}),JM=Je(function(t,e){var n=e.radius,r=j(e.center,2),i=r[0],r=r[1],t=Kx(UM(t,e));return[i+n*Math.cos(t),r+n*Math.sin(t)]},function(t,e){return O([t,e.startAngle,e.endAngle,e.radius],j(e.center),!1).join()});function tO(t,e){return("linear"===e.type?QM:JM)(t,e)}function eO(t){return 0===XM(0,t)[1]}function nO(t){return 0===XM(0,t)[0]}function rO(t,e){return e-t==360}function iO(t,e,n,r,i){function a(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]}var o=e-t,s=j([i,i],2),l=s[0],s=s[1],c=j([Kx(t),Kx(e)],2),u=c[0],c=c[1],h=j(a(u),2),f=h[0],h=h[1],d=j(a(c),2),p=d[0],d=d[1];return rO(t,e)?[["M",f,h],["A",l,s,0,1,0,(c=j(a((c+u)/2),2))[0],c[1]],["A",l,s,0,1,0,p,d]]:(u=180<o?1:0,c=e<t?0:1,"M".concat(f,",").concat(h,",A").concat(l,",").concat(s,",0,").concat(u,",").concat(c,",").concat(p,",").concat(d))}function aO(t,e,n,s){var l=e.startAngle,c=e.endAngle,u=e.center,h=e.radius;return t.selectAll(BM.line.class).data([{path:iO.apply(void 0,O(O([l,c],j(u),!1),[h],!1))}],function(t,e){return e}).join(function(t){return t.append("path").attr("className",BM.line.name).styles(e).styles({path:function(t){return t.path}})},function(t){return t.transition(function(){var t,r,e,n,i,a=this,o=(o=(i=(i=t=this).attributes).startAngle,e=i.endAngle,n=i.center,i=i.radius,o=O(O([o,e],j(n),!1),[i],!1),e=O(O([l,c],j(u),!1),[h],!1),(n=s.update)?(i=void 0===(i=n.duration)?0:i,r=yw(o,e),o=Math.ceil(+i/16),i=new Array(o).fill(0).map(function(t,e,n){return{__keyframe_data__:r(e/(n.length-1))}}),t.animate(i,m({fill:"both"},n))):(t.attr("__keyframe_data__",e),null));return o&&(o.onframe=i=function(){var t=sn(a.attributes,"__keyframe_data__");a.style.path=iO.apply(void 0,O([],j(t),!1))},o.onfinish=i),o}).styles(e)},function(t){return t.remove()}).styles(n).transitions()}function oO(t){var t=j(t,2),e=j(t[0],2),n=e[0],e=e[1],t=j(t[1],2);return{x1:n,y1:e,x2:t[0],y2:t[1]}}function sO(e,t,n,r){function i(t){return e.selectAll(BM.line.class).data(t,function(t,e){return e}).join(function(t){return t.append("line").attr("className",function(t){return"".concat(BM.line.name," ").concat(t.className)}).styles(n).transition(function(t){return mM(this,oO(t.line),!1)})},function(t){return t.styles(n).transition(function(t){return mM(this,oO(t.line),r.update)})},function(t){return t.remove()}).transitions()}var a,o,s,l=t.showTrunc,c=t.startPos,u=t.endPos,h=t.truncRange,f=t.lineExtension,d=j([c,u],2),p=j(d[0],2),g=p[0],p=p[1],d=j(d[1],2),y=d[0],d=d[1],u=j(f?(c=j([c=c,u=u,f=void 0===(f=f)?[0,0]:f],3),f=(u=j(c[0],2))[0],u=u[1],m=(a=j(c[1],2))[0],a=a[1],v=(c=j(c[2],2))[0],c=c[1],f=(m=j([m-f,a-u],2))[0],a=m[1],u=Math.sqrt(Math.pow(f,2)+Math.pow(a,2)),v=(m=j([-v/u,c/u],2))[0],c=m[1],[v*f,v*a,c*f,c*a]):new Array(4).fill(0),4),m=u[0],v=u[1],f=u[2],c=u[3];return l&&h?(u=(a=j(h,2))[0],l=a[1],o=(u=j([g+(h=y-g)*u,p+(s=d-p)*u],2))[0],u=u[1],s=(h=j([g+h*l,p+s*l],2))[0],l=h[1],h=i([{line:[[g+m,p+v],[o,u]],className:BM.lineFirst.name},{line:[[s,l],[y+f,d+c]],className:BM.lineSecond.name}]),t.truncRange,t.truncShape,t.lineExtension,h):i([{line:[[g+m,p+v],[y+f,d+c]],className:BM.line.name}])}function lO(t,e,n){var r,i,a,o,s,l=e.type,c=w(e,"line"),n=("linear"===l?sO:aO)(t,e,_w(c,"arrow"),n);return t=t,l=l,c=c,r=(e=e).showArrow,i=e.showTrunc,a=e.lineArrow,o=e.lineArrowOffset,s=e.lineArrowSize,l="arc"!==l&&i?t.select(BM.lineSecond.class):t.select(BM.line.class),!r||!a||"arc"===e.type&&rO(e.startAngle,e.endAngle)?(i=l.node())&&(i.style.markerEnd=void 0):((t=fw(a)).attr(c),Lw(t,s,!0),l.style("markerEnd",t).style("markerEndOffset",-o)),n}function cO(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function uO(t,i){var a=i.gridLength;return t.map(function(t,e){var t=t.value,n=j(tO(t,i),2),r=n[0],n=n[1],t=j(xw(KM(t,i.gridDirection,i),a),2);return{id:e,points:[[r,n],[r+t[0],n+t[1]]]}})}function hO(t,e,n,r){var i=w(n,"grid"),a=i.type,o=i.areaFill,s=cO(n),l=$M(e,n.gridFilter),e=("segment"===a?uO:function(t,o){var s,l,c=o.gridControlAngles,e=cO(o);if(!e)throw new Error("grid center is not provide");if(t.length<2)throw new Error("Invalid grid data");if(c&&0!==c.length)return e=j(e,2),s=e[0],l=e[1],t.map(function(t,e){var t=j(tO(t.value,o),2),n=t[0],t=t[1],n=j([n-s,t-l],2),r=n[0],i=n[1],a=[];return c.forEach(function(t){var t=Kx(t),t=j([Math.cos(t),Math.sin(t)],2),e=t[0],t=t[1];a.push([r*e-i*t+s,r*t+i*e+l])}),{points:a,id:e}});throw new Error("Invalid gridControlAngles")})(l,n),c=m(m({},i),{center:s,areaFill:Pe(o)?l.map(function(t,e){return tw(o,[t,e,l])}):o,animate:r,data:e});return t.selectAll(BM.grid.class).data([1]).join(function(t){return t.append(function(){return new VM({style:c})}).attr("className",BM.grid.name)},function(t){return t.transition(function(){return this.update(c)})},function(t){return t.remove()}).transitions()}Object.defineProperty(dO.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(dO.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(dO.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(dO.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(dO.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(dO.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),dO.prototype.rotatedPoints=function(t,e,n){var r=this.x1,i=this.y1,a=this.x2,o=this.y2,s=Math.cos(t),t=Math.sin(t),l=e-e*s+n*t,e=n-e*t-n*s;return[[s*r-t*o+l,t*r+s*o+e],[s*a-t*o+l,t*a+s*o+e],[s*r-t*i+l,t*r+s*i+e],[s*a-t*i+l,t*a+s*i+e]]},dO.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},dO.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE};var fO=dO;function dO(t,e,n,r){this.set(t,e,n,r)}function pO(t,e){var n=t.getEulerAngles()||0,r=(t.setEulerAngles(0),t.getLocalBounds()),i=j(r.min,2),a=i[0],i=i[1],r=j(r.max,2),o=r[0],r=r[1],s=gO(t),l=s.width,s=s.height,c=0,u=0,h=a,f=i,d=lw(t),o=(d&&(s-=1.5,"center"===(p=d.style.textAlign)?h=(a+o)/2:"right"!==p&&"end"!==p||(h=o),"middle"===(p=d.style.textBaseline)?f=(i+r)/2:"bottom"===p&&(f=r)),j(Bw(e),4)),d=o[0],p=void 0===d?0:d,r=o[1],e=void 0===r?0:r,d=o[2],r=o[3],o=new fO((c+=a)-(void 0===r?e:r),(u+=i)-p,c+l+e,u+s+(void 0===d?p:d));return t.setEulerAngles(n),o.rotatedPoints(Kx(n),h,f)}function gO(t){return t.__bbox__||t.getBBox()}function yO(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 mO(t,e,n){t=(e[1]-t[1])*(n[0]-e[0])-(e[0]-t[0])*(n[1]-e[1]);return 0==t?0:t<0?2:1}function vO(t,e){var n=t.length;if(n<3)return!1;var r,i,a,o,s,l,c=[e,[9999,e[1]]],u=0,h=0;do{var f=[t[h],t[(h+1)%n]];if(i=c,l=s=o=a=void 0,a=mO((r=f)[0],r[1],i[0]),o=mO(r[0],r[1],i[1]),s=mO(i[0],i[1],r[0]),l=mO(i[0],i[1],r[1]),a!==o&&s!==l||0===a&&yO(r,i[0])||0===o&&yO(r,i[1])||0===s&&yO(i,r[0])||!(0!==l||!yO(i,r[1]))){if(0===mO(f[0],e,f[1]))return yO(f,e);u++}}while(0!==(h=(h+1)%n));return!!(1&u)}function bO(t,e,n){var r,i=t.x1,a=t.x2,o=t.y1,t=t.y2,o=[[i,o],[a,o],[a,t],[i,t]],a=pO(e,n);return r=o,a.every(function(t){return vO(r,t)})}function xO(t,c){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 t=t,n=(e=j(e=c,4))[0],r=e[1],i=e[2],e=e[3],a=(t=j(t,4))[0],o=t[1],i-=n,e-=r,s=t[2]-a,t=t[3]-o,0!=(l=i*t-s*e)&&(o=i*(i=r-o)-e*(r=n-a))<0!=(e=0<l)&&(n=s*i-t*r)<0!=e&&l<o!=e&&l<n!=e;var e,n,r,i,a,o,s,l})}function wO(t,e,l){function n(t,e){if(t){var n,r,i=Bw(l),t=pO(t,i).flat(1),a=pO(e,i).flat(1),e=[[t[0],t[1],t[2],t[3]],[t[0],t[1],t[4],t[5]],[t[4],t[5],t[6],t[7]],[t[2],t[3],t[6],t[7]]];try{for(var o=I(e),s=o.next();!s.done;s=o.next())if(xO(a,s.value))return}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}return 1}var r,i,a,o,s,c,u,h,f,d,p,g,y=e.crossPadding,m=new Set,v=null,b=(y=y,f=(e=e).type,d=e.labelDirection,!!(p=e.crossSize)&&("arc"===f?(f=e.center,h=e.radius,u=(f=j(f,2))[0],f=f[1],a=-h-(d="negative"===d?0:p),h=h+d,o=(d=j(Bw(y),4))[0],s=d[1],c=d[2],d=d[3],new fO(u+a-d,f+a-o,u+h+s,f+h+c)):(a=(d=j(e.startPos,2))[0],o=d[1],s=(u=j(e.endPos,2))[0],f=u[1],c=(h=j(nO(e)?[-y,0,y,0]:[0,y,0,-y],4))[0],d=h[1],u=h[2],y=h[3],h=xw(ZM(0,e),p),(e=new fO(a,o,s,f)).x1+=y,e.y1+=c,e.x2+=d+h[0],e.y2+=u+h[1],e)));try{for(var x=I(t),w=x.next();!w.done;w=x.next()){var M=w.value;g=M,b&&!bO(b,g)?m.add(M):!v||n(v,M)?v=M:(m.add(v),m.add(M))}}catch(t){r={error:t}}finally{try{w&&!w.done&&(i=x.return)&&i.call(x)}finally{if(r)throw r.error}}return Array.from(m)}function MO(t,e){return void 0===e&&(e={}),P(t)?0:"number"==typeof t?t:Math.floor(ow(t,e))}var OO=function(t,e){var e=e.seq,n=void 0===e?2:e;return t.filter(function(t,e){return!(e%n&&(Wx(t),1))})};var kO=new Map([["hide",function(t,e,n,r){var i=t.length,a=e.keepHeader,o=e.keepTail;if(!(i<=1||2===i&&a&&o)){var s,l,c,u,h=OO,f=function(t){return t.forEach(r.show),t},d=2,p=t.slice(),g=t.slice(),y=Math.min.apply(Math,O([1],j(t.map(function(t){return gO(t).width})),!1));for("linear"===n.type&&(eO(n)||nO(n))&&(s=Dw(t[0]).left,l=Dw(t[i-1]).right,l=Math.abs(l-s)||1,d=Math.max(Math.floor(i*y/l),d)),a&&(c=p.splice(0,1)[0]),o&&(u=p.splice(-1,1)[0],p.reverse()),f(p);d<t.length&&wO((u?O(O([u],j(g),!1),[c],!1):O([c],j(g),!1)).filter(aw),n,null==e?void 0:e.margin).length;)(u&&!c&&d%2==0||u&&c)&&p.splice(0,1).forEach(r.hide),g=h(f(p),{seq:d}),d++}}],["rotate",function(t,e,n,r){function i(n){t.forEach(function(t,e){e=Array.isArray(n)?n[e]:n;r.rotate(t,+e)})}var a,o,s=void 0===(s=e.optionalAngles)?[0,45,90]:s,l=e.margin,e=void 0===(e=e.recoverWhenFailed)||e,c=t.map(function(t){return t.getLocalEulerAngles()});try{for(var u=I(s),h=u.next();!h.done;h=u.next())if(i(h.value),wO(t,n,l).length<1)return}catch(t){a={error:t}}finally{try{h&&!h.done&&(o=u.return)&&o.call(u)}finally{if(a)throw a.error}}e&&i(c)}],["ellipsis",function(t,e,n,r){if(!(t.length<=1))for(var i=void 0===(a=e.suffix)?"...":a,a=e.minLength,o=void 0===(o=e.maxLength)?1/0:o,s=void 0===(s=e.step)?" ":s,l=void 0===(e=e.margin)?[0,0,0,0]:e,e=sw(r.getTextShape(t[0])),c=MO(s,e),u=a?MO(a,e):c,s=MO(o,e),h=(!P(s)&&s!==1/0||(s=Math.max.apply(null,t.map(function(t){return gO(t).width}))),t.slice()),f=((a=j(l,4))[0],a[1],a[2],a[3],s);u+c<f;f-=c){var d=function(e){if(h.forEach(function(t){r.ellipsis(r.getTextShape(t),e,i)}),(h=wO(t,n,l)).length<1)return{value:void 0}}(f);if("object"==typeof d)return d.value}}],["wrap",function(t,e,n,r){function i(n){t.forEach(function(t,e){e=Array.isArray(n)?n[e]:n;r.wrap(t,l,e,d)})}var a,o,s,l=void 0===(u=e.wordWrapWidth)?50:u,c=void 0===(u=e.maxLines)?3:u,u=void 0===(u=e.recoverWhenFailed)||u,h=void 0===(e=e.margin)?[0,0,0,0]:e,e=t.map(function(t){return t.attr("maxLines")||1}),f=Math.min.apply(Math,O([],j(e),!1)),d=(o=(a=n).type,s=a.labelDirection,"linear"===o&&eO(a)?"negative"===s?"bottom":"top":"middle");if(!(c<f)){for(var p=f;p<=c;p++)if(i(p),wO(t,n,h).length<1)return;u&&i(e)}}]]);function EO(r,i,a){var t=i.labelOverlap,t=void 0===t?[]:t;t.length&&t.forEach(function(t){var e=t.type,n=kO.get(e);!function(t,e,n){if(!(e.labelOverlap.length<1))if("hide"===n){for(var r=t[0];r;){if("offscreen"===r.className)return;r=r.parent}return 1}else return"rotate"===n?!t.some(function(t){return!(null==(t=t.attr("transform"))||!t.includes("rotate"))}):"ellipsis"!==n&&"wrap"!==n||1<t.filter(function(t){return t.querySelector("text")}).length}(r,i,e)||null==n||n(r,t,i,a)})}function SO(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}var AO=Je(function(t,e){var t=j(t,2),n=t[0],t=t[1],e=j(e,2),r=e[0],e=e[1],n=j([n*r+t*e,n*e-t*r],2),e=n[0],t=n[1];return Math.atan2(t,e)},function(t,e){return O(O([],j(t),!1),j(e),!1).join()});function _O(t,e,n){var r,i=n.labelAlign;return(null==(r=e.style.transform)?void 0:r.includes("rotate"))?e.getLocalEulerAngles():(r=0,e=ZM(t.value,n),t=XM(t.value,n),"horizontal"===i?0:(r="perpendicular"===i?AO([1,0],e):AO([t[0]<0?-1:1,0],t),pw(n=((n=Zx(r))+360)%180,-90,90)||(n+=180),n))}function TO(t,e,n){var r=n.type,i=n.labelAlign,t=ZM(t,n),n=SO(e),e=SO(Zx(AO([1,0],t))),a="center",o="middle";return"linear"===r?[90,270].includes(e)&&0===n?(a="center",o=1===t[1]?"top":"bottom"):e%180||![90,270].includes(n)?0===e?(pw(n,0,90,!1,!0)||pw(n,0,90)||pw(n,270,360))&&(a="start"):90===e?pw(n,0,90,!1,!0)?a="start":(pw(n,90,180)||pw(n,270,360))&&(a="end"):270===e?pw(n,0,90,!1,!0)?a="end":(pw(n,90,180)||pw(n,270,360))&&(a="start"):180===e&&(90===n?a="start":(pw(n,0,90)||pw(n,270,360))&&(a="end")):a="center":"parallel"===i?o=pw(e,0,180,!0)?"top":"bottom":"horizontal"===i?pw(e,90,270,!1)?a="end":(pw(e,270,360,!1)||pw(e,0,90))&&(a="start"):"perpendicular"===i&&(a=pw(e,90,270)?"end":"start"),{textAlign:a,textBaseline:o}}function PO(t,e,n){var r=n.showTick,i=n.tickLength,a=n.tickDirection,o=n.labelDirection,s=n.labelSpacing,l=e.indexOf(t),s=tw(s,[t,l,e]),o=j([ZM(t.value,n),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(function(t,e){return t*("positive"===e?-1:1)},1)}(o,a)],2),a=j(ww(xw(o[0],s+(1===o[1]?tw(r?i:0,[t,l,e]):0)),tO(t.value,n)),2);return{x:a[0],y:a[1]}}function CO(t,e){"text"===t.nodeName&&t.attr(e)}function LO(r){EO(this.node().childNodes,r,{hide:Wx,show:zx,rotate:function(t,e){var n;e=+e,n=r,(t=t).setLocalEulerAngles(e),e=TO(t.__data__.value,e,n),(n=t.querySelector(BM.labelItem.class))&&CO(n,e)},ellipsis:function(t,e,n){void 0===e&&(e=1/0),t&&uw(t,e,n)},wrap:function(t,e,n){var r;t&&cw(t,{wordWrap:!0,wordWrapWidth:e,maxLines:t=void 0===(t=n)?2:t,textBaseline:r=void 0===r?"top":r})},getTextShape:function(t){return t.querySelector("text")}})}function NO(t,e,n,r,i){var a,o,s,l,c,u=n.indexOf(e),h=x(t).append((a=e,o=u,s=n,c=(l=i).labelFormatter,Pe(c)?function(){return fw(tw(c,[a,o,s,ZM(a.value,l)]))}:function(){return fw(a.label||"")})).attr("className",BM.labelItem.name).node(),r=j(Gw(qM(r,[e,u,n])),2),u=r[0],n=r[1],r=n.transform,n=at(n,["transform"]),f=(Hw(t,r),_O(e,t,i));return t.setLocalEulerAngles(+f),CO(h,m(m({},TO(e.value,f,i)),u)),Hw(t,r),t.attr(n),h}function jO(n,f,d,p){var t=$M(f,d.labelFilter),g=w(d,"label");return n.selectAll(BM.label.class).data(t,function(t,e){return e}).join(function(t){return t.append("g").attr("className",BM.label.name).transition(function(t){return NO(this,t,f,g,d),this.attr(PO(t,f,d)),this.__bbox__=t.bbox,null}).call(function(){return LO.call(n,d)})},function(t){return t.transition(function(t){var e,n,r,i,a,o,s,l,c=this.querySelector(BM.labelItem.class),u=NO(this,t,f,g,d),h=(e=c,n=u,c=p.update,void 0===r&&(r="destroy"),u=n,"text"===(i=e).nodeName&&"text"===u.nodeName&&i.attributes.text===u.attributes.text?(e.remove(),[null]):(i=function(){"destroy"===r?e.destroy():"hide"===r&&Wx(e),n.isVisible()&&zx(n)},c?(u=void 0===(u=c.duration)?0:u,a=void 0===(a=c.delay)?0:a,o=Math.ceil(+u/2),u=+u/4,s=(h=j((l=function(t){var e,n;return"circle"===t.nodeName?(n=(e=j(t.getLocalPosition(),2))[0],e=e[1],[n-(n=t.attr("r")),e-n]):t.getLocalPosition()})(e),2))[0],h=h[1],l=j(l(n),2),l=(s=j([(s+l[0])/2-s,(h+l[1])/2-h],2))[0],h=s[1],s=e.animate([{opacity:1,transform:"translate(0, 0)"},{opacity:0,transform:"translate(".concat(l,", ").concat(h,")")}],m(m({fill:"both"},c),{duration:a+o+u})),pM(l=n.animate([{opacity:0,transform:"translate(".concat(-l,", ").concat(-h,")"),offset:.01},{opacity:1,transform:"translate(0, 0)"}],m(m({fill:"both"},c),{duration:o+u,delay:a+o-u})),i),[s,l]):(i(),[null]))),c=mM(this,PO(t,f,d),p.update);return this.__bbox__=t.bbox,O(O([],j(h),!1),[c],!1)}).call(function(t){var e,t=sn(t,"_transitions").flat().filter(aw);e=function(){return LO.call(n,d)},0===(t=t).length?e():Promise.all(t.map(function(t){return null==t?void 0:t.finished})).then(e)})},function(t){return t.transition(function(){var t=this,e=vM(this.childNodes[0],p.exit);return pM(e,function(){return x(t).remove()}),e})}).transitions()}function RO(t,e){return KM(t,e.tickDirection,e)}var IO=Je(function(t,e){t=j(t,2);return[[0,0],[t[0]*e,t[1]*e]]},function(t,e){return O(O([],j(t),!1),[e],!1).join()});function BO(t,e,n,r,i,a,o){var s=RO(t.value,a),a=(c=t,u=e,h=n,l=s,a=(a=a).tickLength,l=j(IO(l,tw(a,[c,u,h])),2),a=j(l[0],2),c=a[0],u=a[1],h=j(l[1],2),{x1:c,x2:h[0],y1:u,y2:h[1]}),l=a.x1,c=a.x2,u=a.y1,h=a.y2,a=j(Gw(qM(o,[t,e,n,s])),2),o=a[0],t=a[1];"line"===r.node().nodeName&&r.styles(m({x1:l,x2:c,y1:u,y2:h},o)),i.attr(t),r.styles(o)}function DO(t,e,n,r,i,a){o=x(this),s=t,l=e,c=n,h=(u=r).tickFormatter,f=RO(s.value,u),u="line",Pe(h)&&(u=function(){return tw(h,[s,l,c,f])});BO(t,e,n,o.append(u).attr("className",BM.tickItem.name),this,r,i);var o,s,l,c,u,h,f,e=j(tO(t.value,r),2);return mM(this,{x:e[0],y:e[1]},a)}var FO=ew({text:"text"},"title");function zO(t){return/\S+-\S+/g.test(t)?t.split("-").map(function(t){return t[0]}):2<t.length?[t[0]]:t.split("")}function WO(r,t){t=Object.entries(t).reduce(function(t,e){var e=j(e,2),n=e[0],e=e[1];return r.node().attr(n)||(t[n]=e),t},{});r.styles(t)}t(VO,GO=mm),VO.prototype.getAvailableSpace=function(){var t=this.attributes,r=t.width,i=t.height,e=t.position,n=t.spacing,t=t.inset,a=this.querySelector(FO.text.class);if(!a)return new Qx(0,0,+r,+i);var a=a.getBBox(),o=a.width,s=a.height,a=j(Bw(n),4),l=a[0],c=a[1],u=a[2],h=a[3],n=j([0,0,+r,+i],4),f=n[0],d=n[1],p=n[2],g=n[3],a=zO(e);if(a.includes("i"))return new Qx(f,d,p,g);a.forEach(function(t,e){var n;"t"===t&&(n=j(0===e?[s+u,+i-s-u]:[0,+i],2),d=n[0],g=n[1]),"r"===t&&(n=j([+r-o-h],1),p=n[0]),"b"===t&&(n=j([+i-s-l],1),g=n[0]),"l"===t&&(n=j(0===e?[o+c,+r-o-c]:[0,+r],2),f=n[0],p=n[1])});n=j(Bw(t),4),e=n[0],a=n[1],t=n[2],n=n[3],a=j([n+a,e+t],2),t=a[0],a=a[1];return new Qx(f+n,d+e,p-t,g-a)},VO.prototype.getBBox=function(){return this.title?this.title.getBBox():new Qx(0,0,0,0)},VO.prototype.render=function(t,e){var n,r,i,a,o,s,l=this,c=(t.width,t.height,t.position,t.spacing,at(t,["width","height","position","spacing"])),u=j(Gw(c),1)[0],h=(h=(t=t).width,r=t.height,t=t.position,i=j([+h/2,+r/2],2),a=(i=j([+i[0],+i[1],"center","middle"],4))[0],o=i[1],s=i[2],i=i[3],(t=zO(t)).includes("l")&&(a=(n=j([0,"start"],2))[0],s=n[1]),t.includes("r")&&(a=(n=j([+h,"end"],2))[0],s=n[1]),t.includes("t")&&(o=(h=j([0,"top"],2))[0],i=h[1]),t.includes("b")&&(o=(n=j([+r,"bottom"],2))[0],i=n[1]),{x:a,y:o,textAlign:s,textBaseline:i}),f=h.x,d=h.y,p=h.textAlign,g=h.textBaseline;dw(!!c.text,x(e),function(t){l.title=t.maybeAppendByClassName(FO.text,"text").styles(u).call(WO,{x:f,y:d,textAlign:p,textBaseline:g}).node()})};var GO,HO=VO;function VO(t){return GO.call(this,t,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"})||this}function YO(t,e,n,r,i){var a,o,s,l,c,u,h,f,d=j(Gw(w(r,"title")),2),p=d[0],d=d[1],g=d.transform,d=at(d,["transform"]),d=(t.styles(p),e.styles(d),g||function(t,e,n){if((t=t.cloneNode(!0)).style.transform="scale(1, 1)",t.style.transform="none",t=t.getBBox().height,"vertical"===e){if("left"===n)return"rotate(-90) translate(0, ".concat(t/2,")");if("right"===n)return"rotate(-90) translate(0, -".concat(t/2,")")}return""}(t.node(),p.direction,p.position)),y=(Hw(t.node(),d),g=x(n._offscreen||n.querySelector(BM.mainGroup.class)),p=e,r=void 0===(r=(n=r).titlePosition)?"lb":r,a=n.titleSpacing,o=zO(r),g=g.node().getLocalBounds(),s=(l=j(g.min,2))[0],l=l[1],c=(g=j(g.halfExtents,2))[0],g=g[1],u=(p=j(p.node().getLocalBounds().halfExtents,2))[0],p=p[1],l=(s=j([s+c,l+g],2))[0],s=s[1],m=(a=j(Bw(a),4))[0],h=a[1],f=a[2],a=a[3],["start","end"].includes(r)&&"linear"===n.type?(y=n.startPos,n=n.endPos,n=(r=j("start"===r?[y,n]:[n,y],2))[0],y=(r=j(xw(Sw([-(y=r[1])[0]+n[0],-y[1]+n[1]]),m),2))[0],r=r[1],{x:n[0]+y,y:n[1]+r}):(o.includes("t")&&(s-=g+p+m),o.includes("r")&&(l+=c+u+h),o.includes("l")&&(l-=c+u+a),o.includes("b")&&(s+=g+p+f),{x:l,y:s})),n=y.x,r=y.y,m=mM(e.node(),{x:n,y:r},i);return Hw(t.node(),d),m}function qO(e,t,o,s){var n=e.showLine,r=e.showTick,i=e.showLabel,n=dw(n,t.maybeAppendByClassName(BM.lineGroup,"g"),function(t){return lO(t,e,s)})||[],r=dw(r,t.maybeAppendByClassName(BM.tickGroup,"g"),function(t){return t=t,r=s,i=$M(o,(n=e).tickFilter),a=w(n,"tick"),t.selectAll(BM.tick.class).data(i,function(t){return t.id||t.label}).join(function(t){return t.append("g").attr("className",BM.tick.name).transition(function(t,e){return DO.call(this,t,e,i,n,a,!1)})},function(t){return t.transition(function(t,e){return this.removeChildren(),DO.call(this,t,e,i,n,a,r.update)})},function(t){return t.transition(function(){var t=this,e=vM(this.childNodes[0],r.exit);return pM(e,function(){return t.remove()}),e})}).transitions();var n,r,i,a})||[],i=dw(i,t.maybeAppendByClassName(BM.labelGroup,"g"),function(t){return jO(t,o,e,s)})||[];return O(O(O([],j(n),!1),j(r),!1),j(i),!1).filter(function(t){return!!t})}t(XO,$O=mm),XO.prototype.render=function(o,t,e){var s=this,n=o.titleText,r=o.data,i=o.animate,a=o.showTitle,l=o.showGrid,c=o.dataThreshold,u=o.truncRange,h=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}(r,c).filter(function(t){t=t.value;return!(u&&t>u[0]&&t<u[1])}),f=dM(void 0===e?i:e),r=dw(l,x(t).maybeAppendByClassName(BM.gridGroup,"g"),function(t){return hO(t,h,o,f)})||[],c=x(t).maybeAppendByClassName(BM.mainGroup,"g"),i=(n&&(!this.initialized&&f.enter||this.initialized&&f.update)&&qO(o,x(this.offscreenGroup),h,dM(!1)),qO(o,x(c.node()),h,f)),e=dw(a,x(t).maybeAppendByClassName(BM.titleGroup,"g"),function(t){return e=t,n=s,i=f,a=(r=o).titleText,e.selectAll(BM.title.class).data([{title:a}].filter(function(t){return!!t.title}),function(t,e){return t.title}).join(function(t){return t.append(function(){return fw(a)}).attr("className",BM.title.name).transition(function(){return YO(x(this),e,n,r,i.enter)})},function(t){return t.transition(function(){return YO(x(this),e,n,r,i.update)})},function(t){return t.remove()}).transitions();var e,n,r,i,a})||[];return O(O(O([],j(r),!1),j(i),!1),j(e),!1).flat().filter(function(t){return!!t})};var $O,UO=XO;function XO(t){return $O.call(this,t,IM)||this}var KO,ZO=ew({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"),QO=(t(JO,KO=mm),Object.defineProperty(JO.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return We(t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(JO.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(JO.prototype,"controllerShape",{get:function(){return 1<this.totalPages?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(JO.prototype,"pageShape",{get:function(){var n,t=this.pageViews,t=j((n=t.map(function(t){t=t.getBBox();return[t.width,t.height]}),((null==(t=n[0])?void 0:t.map(function(t,e){return n.map(function(t){return t[e]})}))||[]).map(function(t){return Math.max.apply(Math,O([],j(t),!1))})),2),e=t[0],t=t[1],r=this.attributes,i=r.pageWidth,r=r.pageHeight;return{pageWidth:void 0===i?e:i,pageHeight:void 0===r?t:r}},enumerable:!1,configurable:!0}),JO.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(JO.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(JO.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),JO.prototype.getBBox=function(){var t=KO.prototype.getBBox.call(this),e=t.x,t=t.y,n=this.controllerShape,r=this.pageShape,i=r.pageWidth,r=r.pageHeight;return new Qx(e,t,i+n.width,r)},JO.prototype.goTo=function(t){var e=this,n=this.attributes.animate,r=this.currPage,i=this.playState,a=this.playWindow,o=this.pageViews;if("idle"!==i||t<0||o.length<=0||t>=o.length)return null;o[r].setLocalPosition(0,0),this.prepareFollowingPage(t);i=j(this.getFollowingPageDiff(t),2),o=i[0],r=i[1],this.playState="running",i=yM(a,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-o,", ").concat(-r,")")}],n);return pM(i,function(){e.innerCurrPage=t,e.playState="idle",e.setVisiblePages([t]),e.updatePageInfo()}),i},JO.prototype.prev=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;return!t&&n<=0?null:(t=t?(n-1+e)%e:We(n-1,0,e),this.goTo(t))},JO.prototype.next=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;return!t&&e-1<=n?null:(t=t?(n+1)%e:We(n+1,0,e),this.goTo(t))},JO.prototype.renderClipPath=function(t){var e=this.pageShape,n=e.pageWidth,e=e.pageHeight;n&&e?(this.clipPath=t.maybeAppendByClassName(ZO.clipPath,"rect").styles({width:n,height:e}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0},JO.prototype.setVisiblePages=function(n){this.playWindow.children.forEach(function(t,e){(n.includes(e)?zx:Wx)(t)})},JO.prototype.adjustControllerLayout=function(){var t=this.prevBtnGroup,e=this.nextBtnGroup,n=this.pageInfoGroup,r=this.attributes,i=r.orientation,r=r.controllerPadding,a=n.getBBox(),o=a.width,a=(a.height,j("horizontal"===i?[-180,0]:[-90,90],2)),s=a[0],a=a[1],s=(t.setLocalEulerAngles(s),e.setLocalEulerAngles(a),t.getBBox()),a=s.width,s=s.height,l=e.getBBox(),c=l.width,l=l.height,c=Math.max(a,o,c),i="horizontal"===i?{offset:[[0,0],[a/2+r,0],[a+o+2*r,0]],textAlign:"start"}:{offset:[[c/2,-s-r],[c/2,0],[c/2,l+r]],textAlign:"center"},a=j(i.offset,3),o=j(a[0],2),s=o[0],c=o[1],l=j(a[1],2),r=l[0],o=l[1],l=j(a[2],2),a=l[0],l=l[1],i=i.textAlign,u=n.querySelector("text");u&&(u.style.textAlign=i),t.setLocalPosition(s,c),n.setLocalPosition(r,o),e.setLocalPosition(a,l)},JO.prototype.updatePageInfo=function(){var t,e=this.currPage,n=this.pageViews,r=this.attributes.formatter;n.length<2||(null!=(t=this.pageInfoGroup.querySelector(ZO.pageInfo.class))&&t.attr("text",r(e+1,n.length)),this.adjustControllerLayout())},JO.prototype.getFollowingPageDiff=function(t){var e,n,r,i=this.currPage;return i===t?[0,0]:(e=this.attributes.orientation,n=(r=this.pageShape).pageWidth,r=r.pageHeight,t=t<i?-1:1,"horizontal"===e?[t*n,0]:[0,t*r])},JO.prototype.prepareFollowingPage=function(t){var e,n=this.currPage,r=this.pageViews;this.setVisiblePages([t,n]),t!==n&&(e=(n=j(this.getFollowingPageDiff(t),2))[0],n=n[1],r[t].setLocalPosition(e,n))},JO.prototype.renderController=function(t){var e,n,r,i,a,o=this,s=this.attributes.controllerSpacing,l=this.pageShape,c=l.pageWidth,l=l.pageHeight,u=2<=this.pageViews.length,t=t.maybeAppendByClassName(ZO.controller,"g");Gx(t.node(),u),u&&(u=w(this.attributes,"button"),e=w(this.attributes,"pageNum"),i=(u=j(Gw(u),2))[0],u=u[1],n=i.size,r=at(i,["size"]),i=!t.select(ZO.prevBtnGroup.class).node(),a=t.maybeAppendByClassName(ZO.prevBtnGroup,"g").styles(u),this.prevBtnGroup=a.node(),a=a.maybeAppendByClassName(ZO.prevBtn,"path"),u=t.maybeAppendByClassName(ZO.nextBtnGroup,"g").styles(u),this.nextBtnGroup=u.node(),[a,u.maybeAppendByClassName(ZO.nextBtn,"path")].forEach(function(t){t.styles(m(m({},r),{transformOrigin:"center"})),Lw(t.node(),n,!0)}),a=t.maybeAppendByClassName(ZO.pageInfoGroup,"g"),this.pageInfoGroup=a.node(),a.maybeAppendByClassName(ZO.pageInfo,"text").styles(e),this.updatePageInfo(),t.node().setLocalPosition(c+s,l/2),i)&&(this.prevBtnGroup.addEventListener("click",function(){o.prev()}),this.nextBtnGroup.addEventListener("click",function(){o.next()}))},JO.prototype.render=function(t,e){e=x(e);this.renderClipPath(e),this.renderController(e),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},JO.prototype.bindEvents=function(){var t=this,e=Qe(function(){return t.render(t.attributes,t)},50);this.playWindow.addEventListener(b.INSERTED,e),this.playWindow.addEventListener(b.REMOVED,e)},JO);function JO(t){var e,n,t=KO.call(this,t,{animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonPath:[["M",(t=0)-(n=6),(e=0)-n],["L",t+n,e],["L",t-n,e+n],["Z"]],buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:function(t,e){return"".concat(t,"/").concat(e)},defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"})||this;return t.playState="idle",t.contentGroup=t.appendChild(new fc({class:ZO.contentGroup.name})),t.playWindow=t.contentGroup.appendChild(new fc({class:ZO.playWindow.name})),t.innerCurrPage=t.defaultPage,t}function tk(t,e,n){return"horizontal"===(t=void 0===t?"horizontal":t)?e:n}Zw.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"]]}),Zw.registerSymbol("verticalHandle",function(t,e,n){var r=1.4*n,i=n/2,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+(n=n/6)],["L",t+r-2,e+n],["M",a,e-n],["L",t+r-2,e-n]]}),Zw.registerSymbol("horizontalHandle",function(t,e,n){var r=1.4*n,i=n/2,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-(n=n/6),a],["L",t-n,e+r-2],["M",t+n,a],["L",t+n,e+r-2]]});var ek=ew({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");t(ik,nk=mm),Object.defineProperty(ik.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(ik.prototype,"actualSpace",{get:function(){var t=this.labelGroup,e=this.valueGroup,n=this.attributes.markerSize,t=t.node().getBBox(),r=t.width,t=t.height,e=e.node().getBBox(),i=e.width,e=e.height;return{markerWidth:n,labelWidth:r,valueWidth:i,height:Math.max(n,t,e)}},enumerable:!1,configurable:!0}),Object.defineProperty(ik.prototype,"span",{get:function(){var t,e=this.attributes.span;return e?(t=(e=j(Bw(e),2))[0],e=e[1],[t/(e=t+(t=this.showValue?e:0)),t/e]):[1,1]},enumerable:!1,configurable:!0}),Object.defineProperty(ik.prototype,"shape",{get:function(){var t=this.attributes,e=t.markerSize,t=t.width,n=this.actualSpace,r=n.markerWidth,n=n.height,i=this.actualSpace,a=i.labelWidth,i=i.valueWidth,o=j(this.spacing,2),s=o[0],o=o[1];return t&&(t=t-e-s-o,e=j(this.span,2),a=(e=j([e[0]*t,e[1]*t],2))[0],i=e[1]),{width:r+a+i+s+o,height:n,markerWidth:r,labelWidth:a,valueWidth:i}},enumerable:!1,configurable:!0}),Object.defineProperty(ik.prototype,"spacing",{get:function(){var t,e=this.attributes.spacing;return e?(t=(e=j(Bw(e),2))[0],e=e[1],this.showValue?[t,e]:[t,0]):[0,0]},enumerable:!1,configurable:!0}),Object.defineProperty(ik.prototype,"layout",{get:function(){var t=this.shape,e=t.markerWidth,n=t.labelWidth,r=t.valueWidth,i=t.width,t=t.height,a=j(this.spacing,2),o=a[0];return{height:t,width:i,markerWidth:e,labelWidth:n,valueWidth:r,position:[e/2,e+o,e+n+o+a[1]]}},enumerable:!1,configurable:!0}),Object.defineProperty(ik.prototype,"scaleSize",{get:function(){var t=(t=(t=this.markerGroup.node()).querySelector(ek.marker.class))?t.style:{},e=this.attributes,n=e.markerSize,r=e.markerStrokeWidth,r=void 0===r?t.strokeWidth:r,i=e.markerLineWidth,i=void 0===i?t.lineWidth:i,e=e.markerStroke,t=void 0===e?t.stroke:e,e=+(r||i||(t?1:0))*Math.sqrt(2),r=this.markerGroup.node().getBBox(),i=r.width,t=r.height;return(1-e/Math.max(i,t))*n},enumerable:!1,configurable:!0}),ik.prototype.renderMarker=function(t){var f=this,d=this.attributes.marker,p=w(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(ek.markerGroup,"g").style("zIndex",0),dw(!!d,this.markerGroup,function(){var t=f.markerGroup.node(),e=t.getElementsByClassName(ek.marker.name)[0],n=d();if(e)if(n.nodeName===e.nodeName){var r,i,a=e,o=(o=n).attributes;try{for(var s=I(Object.entries(o)),l=s.next();!l.done;l=s.next()){var c=j(l.value,2),u=c[0],h=c[1];"id"!==u&&"className"!==u&&a.attr(u,h)}}catch(t){r={error:t}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}x(e).styles(p)}else e.remove(),x(n).attr("className",ek.marker.name).styles(p),t.appendChild(n);else x(n).attr("className",ek.marker.name).styles(p),t.appendChild(n);f.markerGroup.node().scale(1/f.markerGroup.node().getScale()[0]),Lw(f.markerGroup.node(),f.scaleSize,!0)})},ik.prototype.renderLabel=function(t){var e=w(this.attributes,"label"),n=e.text,e=at(e,["text"]);this.labelGroup=t.maybeAppendByClassName(ek.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(ek.label,function(){return fw(n)}).styles(e)},ik.prototype.renderValue=function(t){var e=this,n=w(this.attributes,"value"),r=n.text,i=at(n,["text"]);this.valueGroup=t.maybeAppendByClassName(ek.valueGroup,"g").style("zIndex",0),dw(this.showValue,this.valueGroup,function(){e.valueGroup.maybeAppendByClassName(ek.value,function(){return fw(r)}).styles(i)})},ik.prototype.renderBackground=function(t){var e=this.shape,n=e.width,e=e.height,r=w(this.attributes,"background");this.background=t.maybeAppendByClassName(ek.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(ek.background,"rect").styles(m({width:n,height:e},r))},ik.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,t=j(t.position,3),i=t[0],a=t[1],t=t[2],r=r/2;this.markerGroup.styles({x:i,y:r}),this.labelGroup.styles({x:a,y:r}),uw(this.labelGroup.select(ek.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({x:t,y:r}),uw(this.valueGroup.select(ek.value.class).node(),Math.ceil(n)))},ik.prototype.render=function(t,e){e=x(e);this.renderMarker(e),this.renderLabel(e),this.renderValue(e),this.renderBackground(e),this.adjustLayout()};var nk,rk=ik;function ik(t){return nk.call(this,t,{span:[1,1],marker:function(){return new rc({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}function ak(t,e,n){return void 0===n&&(n=!0),t?e(t):n}var ok,sk=ew({page:"item-page",navigator:"navigator",item:"item"},"items"),lk=(t(ck,ok=mm),Object.defineProperty(ck.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(ck.prototype,"grid",{get:function(){var t=this.attributes,e=t.gridRow,n=t.gridCol,t=t.data;if(e||n)return e&&n?[e,n]:e?[e,t.length]:[t.length,n];throw new Error("gridRow and gridCol can not be set null at the same time")},enumerable:!1,configurable:!0}),Object.defineProperty(ck.prototype,"renderData",{get:function(){var t=this.attributes,a=t.data,o=t.layout,s=w(this.attributes,"item");return a.map(function(e,n){var t=e.id,r=e.label,i=e.value;return{id:"".concat(void 0===t?n:t),index:n,style:m({layout:o,labelText:r,valueText:i},Object.fromEntries(Object.entries(s).map(function(t){t=j(t,2);return[t[0],tw(t[1],[e,n,a])]})))}})},enumerable:!1,configurable:!0}),ck.prototype.getGridLayout=function(){var u=this,t=this.attributes,h=t.orientation,f=t.width,d=t.rowPadding,p=t.colPadding,g=j(this.navigatorShape,1)[0],t=j(this.grid,2),y=t[0],m=t[1],v=m*y,b=0;return this.pageViews.children.map(function(t,e){var n,r=Math.floor(e/v),i=e%v,a=u.ifHorizontal(m,y),a=[Math.floor(i/a),i%a],a=("vertical"===h&&a.reverse(),j(a,2)),o=a[0],a=a[1],s=(f-g-(m-1)*p)/m,t=t.getBBox().height,l=j([0,0],2),c=l[0],l=l[1];return b="horizontal"===h?(c=(n=j([b,o*(t+d)],2))[0],l=n[1],a===m-1?0:b+s+p):(c=(n=j([a*(s+p),b],2))[0],l=n[1],o===y-1?0:b+t+d),{page:r,index:e,row:o,col:a,pageIndex:i,width:s,height:t,x:c,y:l}})},ck.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,a=t.rowPadding,o=t.colPadding,t=j(this.navigatorShape,1)[0],r=j(this.grid,2),s=r[0],l=r[1],r=j([e-t,n],2),c=r[0],u=r[1],e=j([0,0,0,0,0,0,0,0],8),h=e[0],f=e[1],d=e[2],p=e[3],g=e[4],y=e[5],m=e[6],v=e[7];return this.pageViews.children.map(function(t,e){var t=t.getBBox(),n=t.width,t=t.height,r=0===m?0:o,i=m+r+n;return i<=c&&ak(g,function(t){return t<l})?(r=j([m+r,v,i],3),h=r[0],f=r[1],m=r[2]):(i=j([y+1,0,0,v+t+a],4),y=i[0],g=i[1],m=i[2],(v=i[3])+a+t<=u&&ak(y,function(t){return t<s})?(r=j([m,v,n],3),h=r[0],f=r[1],m=r[2]):(i=j([0,0,n,0,d+1,0,0,0],8),h=i[0],f=i[1],m=i[2],v=i[3],d=i[4],p=i[5],y=i[6],g=i[7])),{width:n,height:t,x:h,y:f,page:d,index:e,pageIndex:p++,row:y,col:g++}})},Object.defineProperty(ck.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var t="grid"===this.attributes.layout?this.getGridLayout:this.getFlexLayout,e=t.call(this);return 0<e.slice(-1)[0].page?(this.navigatorShape=[55,0],t.call(this)):e},enumerable:!1,configurable:!0}),ck.prototype.ifHorizontal=function(t,e){return tk(this.attributes.orientation,t,e)},ck.prototype.flattenPage=function(e){e.querySelectorAll(sk.item.class).forEach(function(t){e.appendChild(t)}),e.querySelectorAll(sk.page.class).forEach(function(t){e.removeChild(t).destroy()})},ck.prototype.renderItems=function(t){var e=this.attributes,n=e.click,r=e.mouseenter,i=e.mouseleave,a=(this.flattenPage(t),this.dispatchCustomEvent.bind(this));x(t).selectAll(sk.item.class).data(this.renderData,function(t){return t.id}).join(function(t){return t.append(function(t){t=t.style;return new rk({style:t})}).attr("className",sk.item.name).on("click",function(){null!=n&&n(this),a("itemClick",{item:this})}).on("pointerenter",function(){null!=r&&r(this),a("itemMouseenter",{item:this})}).on("pointerleave",function(){null!=i&&i(this),a("itemMouseleave",{item:this})})},function(t){return t.each(function(t){t=t.style;this.update(t)})},function(t){return t.remove()})},ck.prototype.relayoutNavigator=function(){var t=this.attributes,e=t.layout,t=t.width,n=(null==(n=this.pageViews.children[0])?void 0:n.getBBox().height)||0,r=j(this.navigatorShape,2),i=r[0],r=r[1];this.navigator.update("grid"===e?{pageWidth:t-i,pageHeight:n-r}:{})},ck.prototype.adjustLayout=function(){var n,e=this,t=Object.entries((t=this.itemsLayout,n="page",t.reduce(function(t,e){return(t[e[n]]=t[e[n]]||[]).push(e),t},{}))).map(function(t){t=j(t,2);return{page:t[0],layouts:t[1]}}),u=O([],j(this.navigator.getContainer().children),!1);t.forEach(function(t){var t=t.layouts,c=e.pageViews.appendChild(new fc({className:sk.page.name}));t.forEach(function(t){var n,r,i,e=t.x,a=t.y,o=t.index,s=t.width,l=t.height,o=u[o];c.appendChild(o),n=t,r=o,(i=ze(t="__layout__")?t.split("."):t).forEach(function(t,e){e<i.length-1?(je(r[t])||(r[t]=Ge(i[e+1])?[]:{}),r=r[t]):r[t]=n}),o.update({x:e,y:a,width:s,height:l})})}),this.relayoutNavigator()},ck.prototype.renderNavigator=function(t){var e=this.attributes.orientation,n=w(this.attributes,"nav"),r=nw({orientation:e},n),i=this;return t.selectAll(sk.navigator.class).data(["nav"]).join(function(t){return t.append(function(){return new QO({style:r})}).attr("className",sk.navigator.name).each(function(){i.navigator=this})},function(t){return t.each(function(){this.update(r)})},function(t){return t.remove()}),this.navigator},ck.prototype.getBBox=function(){return this.navigator.getBBox()},ck.prototype.render=function(t,e){var n=this.attributes.data;n&&0!==n.length&&(n=this.renderNavigator(x(e)),this.renderItems(n.getContainer()),this.adjustLayout())},ck.prototype.dispatchCustomEvent=function(t,e){t=new gl(t,{detail:e});this.dispatchEvent(t)},ck);function ck(t){t=ok.call(this,t,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:an,mouseenter:an,mouseleave:an})||this;return t.navigatorShape=[0,0],t}var uk,hk=ew({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),fk={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},dk=(t(pk,uk=mm),pk.prototype.render=function(t,e){var n=x(e).maybeAppendByClassName(hk.markerGroup,"g"),n=(this.renderMarker(n),x(e).maybeAppendByClassName(hk.labelGroup,"g"));this.renderLabel(n)},pk.prototype.renderMarker=function(t){var r=this,e=this.attributes,n=e.orientation,e=e.markerSymbol,i=void 0===e?tk(n,"horizontalHandle","verticalHandle"):e;dw(!!i,t,function(t){var e=w(r.attributes,"marker"),n=m({symbol:i},e);r.marker=t.maybeAppendByClassName(hk.marker,function(){return new Zw({style:n})}).update(n)})},pk.prototype.renderLabel=function(t){var s=this,e=this.attributes,n=e.showLabel,l=e.orientation,r=e.spacing,c=void 0===r?0:r,u=e.formatter;dw(n,t,function(t){var e=w(s.attributes,"label"),n=e.text,e=at(e,["text"]),r=(null==(r=t.select(hk.marker.class))?void 0:r.node().getBBox())||{},i=r.width,r=r.height,r=j(tk(l,[0,(void 0===r?0:r)+c,"center","top"],[(void 0===i?0:i)+c,0,"start","middle"]),4),i=r[0],a=r[1],o=r[2],r=r[3];t.maybeAppendByClassName(hk.label,"text").styles(m(m({},e),{x:i,y:a,text:u(n).toString(),textAlign:o,textBaseline:r}))})},pk);function pk(t){return uk.call(this,t,fk)||this}var gk,By={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},yk=nw({},By,{}),mk=nw({},By,Ww(fk,"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"}),vk=ew({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"),bk=(t(xk,gk=mm),xk.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,r=r.titleText,a=j(Gw(w(this.attributes,"title")),2),o=a[0],a=a[1],s=(this.titleGroup=t.maybeAppendByClassName(vk.titleGroup,"g").styles(a),m(m({width:e,height:n},o),{text:i?r:""}));this.title=this.titleGroup.maybeAppendByClassName(vk.title,function(){return new HO({style:s})}).update(s)},xk.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,e=e.height,a=j(Gw(w(this.attributes,"title",!0)),2),o=a[0],a=a[1],s=m(m({},o),{width:i,height:e,x:0,y:0}),l=(this.itemsGroup=t.maybeAppendByClassName(vk.itemsGroup,"g").styles(m({x:n,y:r},a)),this);this.itemsGroup.selectAll(vk.items.class).data(["items"]).join(function(t){return t.append(function(){return new lk({style:s})}).attr("className",vk.items.name).each(function(){l.items=x(this)})},function(t){return t.update(s)},function(t){return t.remove()})},xk.prototype.adjustLayout=function(){var t,e;this.attributes.showTitle&&(t=(e=this.title.node().getAvailableSpace()).x,e=e.y,this.itemsGroup.node().setLocalPosition(t,e))},Object.defineProperty(xk.prototype,"availableSpace",{get:function(){var t=this.attributes,e=t.showTitle,n=t.width,t=t.height;return e?this.title.node().getAvailableSpace():new Qx(0,0,n,t)},enumerable:!1,configurable:!0}),xk.prototype.getBBox=function(){var t,e,n,r,i,a,o,s,l,c,u=null==(u=this.title)?void 0:u.node(),h=null==(h=this.items)?void 0:h.node();return u&&h?(h=h,t=(r=(u=u).attributes).position,e=r.spacing,n=r.inset,r=r.text,u=u.getBBox(),i=h.getBBox(),t=zO(t),e=(r=j(Bw(r?e:0),4))[0],a=r[1],o=r[2],r=r[3],s=(n=j(Bw(n),4))[0],l=n[1],c=n[2],n=n[3],a=(r=j([r+a,e+o],2))[0],e=r[1],r=(o=j([n+l,s+c],2))[0],n=o[1],"l"===t[0]?new Qx(u.x,u.y,i.width+u.width+a+r,Math.max(i.height+n,u.height)):"t"===t[0]?new Qx(u.x,u.y,Math.max(i.width+r,u.width),i.height+u.height+e+n):(s=(l=j([h.attributes.width||i.width,h.attributes.height||i.height],2))[0],c=l[1],new Qx(i.x,i.y,s+u.width+a+r,c+u.height+e+n))):gk.prototype.getBBox.call(this)},xk.prototype.render=function(t,e){var n=t.width,t=t.height,e=x(e);this.renderTitle(e,n,t),this.renderItems(e,this.availableSpace),this.adjustLayout()},xk);function xk(t){return gk.call(this,t,yk)||this}var wk,Mk={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",zIndex:999},Ok=ew({background:"background",labelGroup:"label-group",label:"label"},"indicator"),kk=(t(Ek,wk=mm),Ek.prototype.renderBackground=function(){var t,e,n,r,i,a,o;this.label&&(t=(i=this.attributes).position,o=(i=j(Bw(i.padding),4))[0],e=i[1],n=i[2],i=i[3],a=(r=this.label.node().getLocalBounds()).min,r=r.max,i=[[a[0]-i,a[1]-o],[r[0]+e,r[1]+n]],a=this.getPath(t,i),o=w(this.attributes,"background"),this.background=x(this.group).maybeAppendByClassName(Ok.background,"path").styles(m(m({},o),{path:a})),this.group.appendChild(this.label.node()))},Ek.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,t=j(Gw(w(this.attributes,"label")),2),r=t[0],t=t[1],r=(r.text,at(r,["text"]));this.label=x(this.group).maybeAppendByClassName(Ok.labelGroup,"g").styles(t),n&&this.label.maybeAppendByClassName(Ok.label,function(){return fw(e(n))}).style("text",e(n).toString()).selectAll("text").styles(r)},Ek.prototype.adjustLayout=function(){var t=j(this.point,2),e=t[0],t=t[1];this.group.attr("x",-e).attr("y",-t)},Ek.prototype.getPath=function(n,t){var r=this,t=j(t,2),e=j(t[0],2),i=e[0],e=e[1],t=j(t[1],2),a=t[0],t=t[1],o={top:"bottom",right:"left",bottom:"top",left:"right"},a=Object.entries({top:[[i,e],[a,e]],right:[[a,e],[a,t]],bottom:[[a,t],[i,t]],left:[[i,t],[i,e]]}).map(function(t){var t=j(t,2),e=t[0],t=t[1];return e===o[n]?r.createCorner(t):[O(["M"],j(t[0]),!1),O(["L"],j(t[1]),!1)]});return a.push([["Z"]]),a.flat().filter(function(t,e,n){return 0===e||"M"!==t[0]})},Ek.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=function(t,e){var n=(t=j(t,2))[0],t=t[1],r=(e=j(e,2))[0],e=e[1];return n!==r&&t===e}.apply(void 0,O([],j(t),!1)),t=j(t,2),r=j(t[0],2),i=r[0],r=r[1],t=j(t[1],2),a=t[0],t=t[1],a=j(n?[a-i,[i,a]]:[t-r,[r,t]],2),t=a[0],a=j(a[1],2),o=a[0],a=a[1],s=t/2,e=e*(t/Math.abs(t)),t=e/2,e=e*Math.sqrt(3)/2*.8,o=j([o,o+s-t,o+s,o+s+t,a],5),s=o[0],t=o[1],a=o[2],l=o[3],o=o[4];return n?(this.point=[a,r-e],[["M",s,r],["L",t,r],["L",a,r-e],["L",l,r],["L",o,r]]):(this.point=[i+e,a],[["M",i,s],["L",i,t],["L",i+e,a],["L",i,l],["L",i,o]])},Ek.prototype.bindEvents=function(){this.label.on(b.BOUNDS_CHANGED,this.renderBackground)},Ek.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout()},Ek);function Ek(t){t=wk.call(this,t,Mk)||this;return t.point=[0,0],t.group=t.appendChild(new fc({})),t.isMutationObserved=!0,t}function Sk(t,e){var t=j(function(t,e){for(var n=1;n<t.length;n+=1){var r=t[n-1],i=t[n];if(r<=e&&e<=i)return[r,i]}return[e,e]}(t,e),2),n=t[0],t=t[1];return{tick:(n+t)/2<e?t:n,range:[n,t]}}var Ak=ew({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function _k(t){var e=t.orientation,n=t.size,t=t.length;return tk(e,[t,n],[n,t])}function Tk(t){var e=t.type,t=j(_k(t),2),n=t[0],t=t[1];return"size"===e?[["M",0,t],["L",0+n,0],["L",0+n,t],["Z"]]:[["M",0,t],["L",0,0],["L",0+n,0],["L",0+n,t],["Z"]]}function Pk(t){var i,a,o,e=t.orientation,r=t.color,n=t.block,t=t.partition,s=(l=Pe(r)?new Array(20).fill(0).map(function(t,e,n){return r(e/(n.length-1))}):r).length,l=l.map(function(t){return ma(t).toString()});return s?1===s?l[0]:n?(i=t,n=e,a=Array.from(l),o=i.length,new Array(o).fill(0).reduce(function(t,e,n){var r=a[n%a.length];return t+" ".concat(i[n],":").concat(r).concat(n<o-1?" ".concat(i[n+1],":").concat(r):"")},"l(".concat("horizontal"===n?"0":"270",")"))):l.reduce(function(t,e,n){return t+" ".concat(n/(s-1),":").concat(e)},"l(".concat(tk(e,"0","270"),")")):""}function Ck(t,e){var n,r,i,a=w(e,"selection"),o=Pk(e),t=t.maybeAppendByClassName(Ak.selection,"path").styles(m({path:Tk(e),fill:o},a)),a=t.maybeAppendByClassName(Ak.clipPath,"path").styles({path:(a=(o=e).orientation,(e=o.range)?(r=(o=j(_k(o),2))[0],o=o[1],n=(e=j(e,2))[0],e=e[1],i=tk(a,n*r,0),n=tk(a,0,n*o),r=tk(a,e*r,r),[["M",i,n],["L",i,i=tk(a,o,e*o)],["L",r,i],["L",r,n],["Z"]]):[])}).node();t.style("clip-path",a)}t(jk,Lk=mm),jk.prototype.render=function(t,e){var n,r,i=x(e).maybeAppendByClassName(Ak.trackGroup,"g");i=i,r=w(n=t,"track"),i.maybeAppendByClassName(Ak.track,"path").styles(m({path:Tk(n)},r)),Ck(x(e).maybeAppendByClassName(Ak.selectionGroup,"g"),t)};var Lk,Nk=jk;function jk(t){return Lk.call(this,t,{type:"color",orientation:"horizontal",size:30,range:[0,1],length:200,block:!1,partition:[],color:["#fff","#000"],trackFill:"#e5e5e5"})||this}var Rk,Ik,Bk,Dk,Fk=Je(function(t){return{min:Math.min.apply(Math,O([],j(t.map(function(t){return t.value})),!1)),max:Math.max.apply(Math,O([],j(t.map(function(t){return t.value})),!1))}},function(t){return t.map(function(t){return t.id})}),zk=(t(y,Rk=mm),Object.defineProperty(y.prototype,"handleOffsetRatio",{get:function(){return this.ifHorizontal(.5,.5)},enumerable:!1,configurable:!0}),y.prototype.getBBox=function(){var t=this.attributes,e=t.width,t=t.height;return new Qx(0,0,e,t)},y.prototype.render=function(t,e){var n=this,t=t.showLabel,r=(this.renderTitle(x(e)),this.availableSpace),i=r.x,r=r.y,e=x(e).maybeAppendByClassName(vk.contentGroup,"g").styles({x:i,y:r}),i=(dw(!!t,e.maybeAppendByClassName(vk.labelGroup,"g").styles({zIndex:1}),function(t){n.renderLabel(t)}),e.maybeAppendByClassName(vk.ribbonGroup,"g").styles({zIndex:0}));this.handlesGroup=e.maybeAppendByClassName(vk.handlesGroup,"g").styles({zIndex:2}),this.renderHandles(),this.renderRibbon(i),this.renderIndicator(e),this.adjustLabel(),this.adjustHandles()},Object.defineProperty(y.prototype,"range",{get:function(){var t=this.attributes,e=t.data,t=t.domain;return t?{min:t[0],max:t[1]}:Fk(e)},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"ribbonScale",{get:function(){var t=this.range,e=t.min,t=t.max;return this.innerRibbonScale.update({domain:[e,t],range:[0,1]}),this.innerRibbonScale},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"ribbonRange",{get:function(){var t=j(this.selection,2),e=t[0],t=t[1],n=this.ribbonScale;return[n.map(e),n.map(t)]},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"selection",{get:function(){var t=this.range,e=t.min,t=t.max,n=this.attributes.defaultValue,e=j(void 0===n?[e,t]:n,2);return[e[0],e[1]]},enumerable:!1,configurable:!0}),y.prototype.ifHorizontal=function(t,e){return tk(this.attributes.orientation,"function"==typeof t?t():t,"function"==typeof e?e():e)},y.prototype.renderTitle=function(t){var e=this.attributes,n=e.showTitle,r=e.titleText,i=e.width,e=e.height,a=w(this.attributes,"title"),o=m(m({},a),{width:i,height:e,text:r}),s=this;t.selectAll(vk.title.class).data(n?[r]:[]).join(function(t){return t.append(function(){return new HO({style:o})}).attr("className",vk.title.name).each(function(){s.title=this})},function(t){return t.update(o)},function(t){return t.each(function(){s.title=void 0}).remove()})},Object.defineProperty(y.prototype,"availableSpace",{get:function(){var t,e;return this.title?this.title.getAvailableSpace():(t=(e=this.attributes).width,e=e.height,new Qx(0,0,t,e))},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"labelFixedSpacing",{get:function(){return this.attributes.showTick?5:0},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"labelPosition",{get:function(){var t=this.attributes,e=t.orientation,t=t.labelDirection;return{vertical:{positive:"right",negative:"left"},horizontal:{positive:"bottom",negative:"top"}}[e][t]},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"labelBBox",{get:function(){var t,e;return this.attributes.showLabel?(this.cacheLabelBBox||(t=(e=(null==(e=this.label.querySelector(BM.labelGroup.class))?void 0:e.children.slice(-1)[0]).getBBox()).width,e=e.height,this.cacheLabelBBox=new Qx(0,0,t,e)),this.cacheLabelBBox):new Qx(0,0,0,0)},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"labelShape",{get:function(){var t,e=this.attributes,n=e.showLabel,e=e.labelSpacing,e=void 0===e?0:e;return n?{width:t=(n=this.labelBBox).width,height:n=n.height,size:this.ifHorizontal(n,t)+e+this.labelFixedSpacing,length:this.ifHorizontal(t,n)}:{width:0,height:0,size:0,length:0}},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"ribbonBBox",{get:function(){var t=this.attributes,e=t.showHandle,t=t.ribbonSize,n=this.availableSpace,r=n.width,n=n.height,i=this.labelShape,a=i.size,i=i.length,r=j(this.ifHorizontal([n,r],[r,n]),2),n=r[0],r=r[1],e=e?this.handleShape:{size:0,length:0},o=e.size,e=e.length,s=this.handleOffsetRatio,l=0,c=this.labelPosition,l=t||(["bottom","right"].includes(c)?Math.min(n-a,(n-o)/s):o<n*(1-s)?Math.max(n-a,0):Math.max((n-a-o)/s,0)),t=Math.max(e,i),n=r-t,o=j(this.ifHorizontal([n,l],[l,n]),2),s=o[0],e=o[1],i=["top","left"].includes(c)?a:0,r=j(this.ifHorizontal([t/2,i],[i,t/2]),2),l=r[0],n=r[1];return new Qx(l,n,s,e)},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"ribbonShape",{get:function(){var t=this.ribbonBBox,e=t.width,t=t.height;return this.ifHorizontal({size:t,length:e},{size:e,length:t})},enumerable:!1,configurable:!0}),y.prototype.renderRibbon=function(t){var e=this.attributes,n=e.data,r=e.type,i=e.orientation,a=e.color,e=e.block,o=w(this.attributes,"ribbon"),s=this.range,l=s.min,c=s.max,s=this.ribbonBBox,u=s.x,s=s.y,h=this.ribbonShape,f=h.length,h=h.size,d=nw({x:u,y:s,length:f,size:h,type:r,orientation:i,color:a,block:e,partition:n.map(function(t){return(t.value-l)/(c-l)}),range:this.ribbonRange},o);this.ribbon=t.maybeAppendByClassName(vk.ribbon,function(){return new Nk({style:d})}).update(d)},y.prototype.getHandleClassName=function(t){return"".concat(vk.prefix("".concat(t,"-handle")))},y.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,t=t.orientation,n=w(this.attributes,"handle"),r=j(this.selection,2),i=r[0],r=r[1],a=m(m({},n),{orientation:t}),t=n.shape,o="basic"===(void 0===t?"slider":t)?dk:_M,s=this;this.handlesGroup.selectAll(vk.handle.class).data(e?[{value:i,type:"start"},{value:r,type:"end"}]:[],function(t){return t.type}).join(function(t){return t.append(function(){return new o({style:a})}).attr("className",function(t){t=t.type;return"".concat(vk.handle," ").concat(s.getHandleClassName(t))}).each(function(t){var e=t.type,t=t.value,t=(this.update({labelText:t}),"".concat(e,"Handle"));(s[t]=this).addEventListener("pointerdown",s.onDragStart(e))})},function(t){return t.update(a).each(function(t){t=t.value;this.update({labelText:t})})},function(t){return t.each(function(t){t=t.type,t="".concat(t,"Handle");s[t]=void 0}).remove()})},y.prototype.adjustHandles=function(){var t=j(this.selection,2),e=t[0],t=t[1];this.setHandlePosition("start",e),this.setHandlePosition("end",t)},y.prototype.adjustTitle=function(){var t=this.attributes,e=t.titlePosition,t=t.orientation,n=j(this.getElementsByClassName(vk.title.name),1)[0],r=this.handlesGroup.select(".".concat(this.getHandleClassName("start"))).node();n&&r&&"top-left"===e&&"horizontal"===t&&(e=j(r.getLocalBounds().min,1)[0],t=j(n.getLocalBounds().min,1)[0],n.style.x=+(this.style.x||0)+(e-t))},Object.defineProperty(y.prototype,"handleBBox",{get:function(){if(!this.cacheHandleBBox){if(!this.attributes.showHandle)return new Qx(0,0,0,0);var t=this.startHandle.getBBox(),e=t.width,t=t.height,n=this.endHandle.getBBox(),r=n.width,n=n.height,e=j([Math.max(e,r),Math.max(t,n)],2),r=e[0],t=e[1];this.cacheHandleBBox=new Qx(0,0,r,t)}return this.cacheHandleBBox},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"handleShape",{get:function(){var t=this.handleBBox,e=t.width,t=t.height,n=j(this.ifHorizontal([t,e],[e,t]),2);return{width:e,height:t,size:n[0],length:n[1]}},enumerable:!1,configurable:!0}),y.prototype.setHandlePosition=function(t,e){var n=this.attributes.handleFormatter,r=this.ribbonBBox,i=r.x,r=r.y,a=this.ribbonShape.size,e=this.getOffset(e),i=j(this.ifHorizontal([i+e,r+a*this.handleOffsetRatio],[i+a*this.handleOffsetRatio,r+e]),2),a=i[0],r=i[1],e=this.handlesGroup.select(".".concat(this.getHandleClassName(t))).node();null!=e&&e.update({x:a,y:r,formatter:n})},y.prototype.renderIndicator=function(t){var e=w(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(vk.indicator,function(){return new kk({})}).update(e)},Object.defineProperty(y.prototype,"labelData",{get:function(){var s=this;return this.attributes.data.reduce(function(t,e,n,r){var i,a,o=null!=(o=null==e?void 0:e.id)?o:n.toString();return t.push(m(m({},e),{id:o,index:n,type:"value",label:null!=(i=null==e?void 0:e.label)?i:e.value.toString(),value:s.ribbonScale.map(e.value)})),n<r.length-1&&(i=r[n+1],a=((i=(r=j([e.value,i.value],2))[0])+(r=r[1]))/2,t.push(m(m({},e),{id:o,index:n,type:"range",range:[i,r],label:[i,r].join("~"),value:s.ribbonScale.map(a)}))),t},[])},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"labelStyle",{get:function(){var t=j(["center","middle"],2),e=t[0],t=t[1],n=this.labelPosition;return"top"===n?t="bottom":"bottom"===n?t="top":"left"===n?e="end":"right"===n&&(e="start"),{labelTextAlign:e,labelTextBaseline:t}},enumerable:!1,configurable:!0}),y.prototype.renderLabel=function(t){var e=this.attributes,n=e.showTick,n=void 0!==n&&n,r=e.labelFilter,e=e.labelFormatter,i=w(this.attributes,"tick"),a=w(this.attributes,"label"),o=a.align,n=nw(m({showLine:!1,showGrid:!1,showTick:n,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),Ww(i,"tick"),Ww(a,"label"),{data:this.labelData}),i={tickFilter:function(t,e,n){return"value"===(null==t?void 0:t.type)&&(!r||r(t,t.index,n.filter(function(t){return"value"!==t.type})))},labelFilter:function(t,e,n){return(null==t?void 0:t.type)===o&&(!r||r(t,t.index,n.filter(function(t){return t.type===o})))},labelFormatter:e},s=m(m(m({},n),i),{labelOverlap:[{type:"hide"}]});this.label=t.maybeAppendByClassName(vk.label,function(){return new UO({style:s})}).node(),this.label.update(s,!1)},Object.defineProperty(y.prototype,"labelAxisStyle",{get:function(){var t=this.attributes,e=t.showTick,n=t.labelDirection,r=t.labelSpacing,t=t.tickLength,i=this.ribbonShape.size,a=this.labelPosition,o=this.labelFixedSpacing,s=j([0,0,0],3),l=s[0],s=(s[1],s[2]),t=null!=t?t:i;return e?(s=t,"positive"===n?"right"===a?s=l=t:"bottom"===a&&(l=s):"negative"!==n||"top"!==a&&"left"!==a||(l=i)):"positive"===n&&"right"!==a&&"bottom"===a&&(l=i+o),{offset:l,spacing:r,tickLength:s}},enumerable:!1,configurable:!0}),y.prototype.adjustLabel=function(){var t,e,n,r,i,a,o;this.attributes.showLabel&&(o=(a=this.ribbonBBox).x,t=a.y,i=a.width,a=a.height,e=(r=this.labelAxisStyle).offset,n=r.spacing,r=r.tickLength,a=(i=j(this.ifHorizontal([[o,t+e],[o+i,t+e]],[[o+e,t+a],[o+e,t]]),2))[0],o=i[1],this.label.update({startPos:a,endPos:o,tickLength:r,labelSpacing:n},!1))},y.prototype.bindEvents=function(){this.ribbon.on("pointerdown",this.onDragStart("ribbon")),this.ribbon.on("pointermove",this.onHovering),this.addEventListener("pointerout",this.hideIndicator)},y.prototype.showIndicator=function(t,e){var n,r,i,a;void 0===e&&(e="".concat(t)),this.attributes.showIndicator&&"number"==typeof t?(i=(a=this.range).min,a=a.max,n=(r=this.ribbonBBox).x,r=r.y,t=We(t,i,a),i=this.getOffset(t),a=this.ifHorizontal([i+n,r],[n,i+r]),this.indicator.update({x:a[0],y:a[1],position:this.ifHorizontal("top","left"),labelText:e}),zx(this.indicator.node())):this.hideIndicator()},y.prototype.hideIndicator=function(){Wx(this.indicator.node())},y.prototype.updateMouse=function(){this.attributes.slidable&&(this.style.cursor="grabbing")},y.prototype.setSelection=function(t,e){this.updateSelection(t,e)},y.prototype.updateSelection=function(t,e,n){void 0===n&&(n=!1);var r,i,a,o,s=j(this.selection,2),l=s[0],s=s[1],t=j([t,e],2),e=t[0],t=t[1],n=(n&&(e+=l,t+=s),this.range),l=n.min,s=n.max,c=j((n=[l,s],l=[e,t],s=this.selection,r=(n=j(n,2))[0],n=n[1],i=(l=j(l,2))[0],l=l[1],a=(s=j(s,2))[0],s=s[1],l=(i=j([i,l],2))[0],o=(i=i[1])-l,i<l&&(l=(c=j([i,l],2))[0],i=c[1]),n-r<o?[r,n]:l<r?a===r&&s===i?[r,i]:[r,o+r]:n<i?s===n&&a===l?[l,n]:[n-o,n]:[l,i]),2),e=c[0],t=c[1];this.update({defaultValue:[e,t]}),this.dispatchSelection()},Object.defineProperty(y.prototype,"step",{get:function(){var t=this.attributes.step,t=void 0===t?1:t,e=this.range,n=e.min,e=e.max;return Ke(t)?Aw(.01*(e-n),0):t},enumerable:!1,configurable:!0}),y.prototype.getTickValue=function(t){var e=this.attributes,n=e.data,e=e.block,r=this.range.min;return e?Sk(n.map(function(t){return t.value}),t).tick:(e=this.step,r+Math.round((t-r)/e)*e)},y.prototype.getValueByCanvasPoint=function(t,e){var n=this.range,r=n.min,n=n.max,i=j(this.ribbon.node().getPosition(),2),a=i[0],i=i[1],a=this.ifHorizontal(a,i),i=this.ifHorizontal.apply(this,O([],j(hw(t)),!1));return We(this.getOffset(i-a,!0),r,n)},y.prototype.getOffset=function(t,e){void 0===e&&(e=!1);var n=this.range,r=n.min,n=n.max,i=this.ribbonShape.length,a=this.eventToOffsetScale;return a.update({domain:[r,n],range:[0,i]}),e?a.invert(t):a.map(t)},y.prototype.dispatchSelection=function(){var t=new gl("valuechange",{detail:{value:this.selection}});this.dispatchEvent(t)},y.prototype.dispatchIndicated=function(t,e){t=new gl("indicate",{detail:{value:t,range:e}});this.dispatchEvent(t)},y);function y(t){var a=Rk.call(this,t,mk)||this;return a.eventToOffsetScale=new wg({}),a.innerRibbonScale=new wg({}),a.cacheLabelBBox=null,a.cacheHandleBBox=null,a.onHovering=function(t){var e=a.attributes,n=e.data,e=e.block,t=(t.stopPropagation(),a.getValueByCanvasPoint(t));e?(e=Sk(n.map(function(t){return t.value}),t).range,a.showIndicator((e[0]+e[1])/2,"".concat(e[0],"-").concat(e[1])),a.dispatchIndicated(t,e)):(n=a.getTickValue(t),a.showIndicator(n),a.dispatchIndicated(n))},a.onDragStart=function(e){return function(t){t.stopPropagation(),a.attributes.slidable&&(a.target=e,a.prevValue=a.getTickValue(a.getValueByCanvasPoint(t)),document.addEventListener("mousemove",a.onDragging),document.addEventListener("touchmove",a.onDragging),document.addEventListener("mouseleave",a.onDragEnd),document.addEventListener("mouseup",a.onDragEnd),document.addEventListener("mouseup",a.onDragEnd),document.addEventListener("touchend",a.onDragEnd))}},a.onDragging=function(t){var e=a.target,n=(a.updateMouse(),j(a.selection,2)),r=n[0],n=n[1],t=a.getTickValue(a.getValueByCanvasPoint(t)),i=t-a.prevValue;"start"===e?r!==t&&a.updateSelection(t,n):"end"===e?n!==t&&a.updateSelection(r,t):"ribbon"===e&&0!=i&&(a.prevValue=t,a.updateSelection(i,i,!0))},a.onDragEnd=function(){a.style.cursor="default",document.removeEventListener("mousemove",a.onDragging),document.removeEventListener("touchmove",a.onDragging),document.removeEventListener("mouseup",a.onDragEnd),document.removeEventListener("touchend",a.onDragEnd)},a}function Wk(t){Ik||(Ik=document.createElement("table"),Dk=document.createElement("tr"),Bk=/^\s*<(\w+|!)[^>]*>/,Dk={tr:document.createElement("tbody"),tbody:Ik,thead:Ik,tfoot:Ik,td:Dk,th:Dk,"*":document.createElement("div")});var e=Bk.test(t)&&RegExp.$1,e=(e&&e in Dk||(e="*"),Dk[e]),t=(t="string"==typeof t?t.replace(/(^\s*)|(\s*$)/g,""):t,e.innerHTML=""+t,e.childNodes[0]);return t&&e.contains(t)&&e.removeChild(t),t}function Gk(t){return{CONTAINER:"".concat(t=void 0===t?"":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 Hk={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};t(Uk,Vk=mm),Object.defineProperty(Uk.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),Uk.prototype.getContainer=function(){return this.element},Object.defineProperty(Uk.prototype,"position",{set:function(t){var t=j(t,2),e=t[0],t=t[1];this.attributes.x=e,this.attributes.y=t,this.updatePosition()},enumerable:!1,configurable:!0}),Object.defineProperty(Uk.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(Uk.prototype,"HTMLTooltipItemsElements",{get:function(){var t=this.attributes,e=t.data,o=t.template;return e.map(function(t,e){var n,r=t.name,r=void 0===r?"":r,i=t.color,i=void 0===i?"black":i,a=t.index,t=at(t,["name","color","index"]),r=m({name:r,color:i,index:null!=a?a:e},t);return Wk((i=o.item,n=r,i&&n?i.replace(/\\?\{([^{}]+)\}/g,function(t,e){return"\\"===t.charAt(0)?t.slice(1):void 0===n[e]?"":n[e]}):i))})},enumerable:!1,configurable:!0}),Uk.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},Uk.prototype.destroy=function(){var t;null!=(t=this.element)&&t.remove(),Vk.prototype.destroy.call(this)},Uk.prototype.show=function(t,e){var n,r=this;void 0!==t&&void 0!==e&&(n=this.element.style.transition,this.element.style.transition="none",this.position=[null!=t?t:+this.attributes.x,null!=e?e:+this.attributes.y],setTimeout(function(){r.element.style.transition=n},10)),this.element.style.visibility="visible"},Uk.prototype.hide=function(){this.element.style.visibility="hidden"},Uk.prototype.initShape=function(){var t=this.attributes.template;this.element=Wk(t.container),this.id&&this.element.setAttribute("id",this.id)},Uk.prototype.renderCustomContent=function(){var t;(void 0===this.prevCustomContentKey||this.prevCustomContentKey!==this.attributes.contentKey)&&(this.prevCustomContentKey=this.attributes.contentKey,t=this.attributes.content)&&("string"==typeof t?this.element.innerHTML=t:this.element.replaceChildren(t))},Uk.prototype.renderHTMLTooltipElement=function(){var r,t=this.attributes,e=t.template,n=t.title,i=t.enterable,a=t.style,t=t.content,o=Gk(e.prefixCls),s=this.element;this.element.style.pointerEvents=i?"auto":"none",t?this.renderCustomContent():(n?(s.innerHTML=e.title,s.getElementsByClassName(o.TITLE)[0].innerHTML=n):null!=(t=null==(i=s.getElementsByClassName(o.TITLE))?void 0:i[0])&&t.remove(),e=this.HTMLTooltipItemsElements,(n=document.createElement("ul")).className=o.LIST,n.replaceChildren.apply(n,O([],j(e),!1)),(i=this.element.querySelector(".".concat(o.LIST)))?i.replaceWith(n):s.appendChild(n)),r=s,Object.entries(a).forEach(function(t){var t=j(t,2),e=t[0],n=t[1];O([r],j(r.querySelectorAll(e)),!1).filter(function(t){return t.matches(e)}).forEach(function(t){t&&(t.style.cssText+=Object.entries(n).reduce(function(t,e){return"".concat(t).concat(e.join(":"),";")},""))})})},Uk.prototype.getRelativeOffsetFromCursor=function(t){var e=this.attributes,n=e.position,i=e.offset,e=(t||n).split("-"),a={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},t=this.elementSize,o=t.width,s=t.height,l=[-o/2,-s/2];return e.forEach(function(t){var e=j(l,2),n=e[0],e=e[1],t=j(a[t],2),r=t[0],t=t[1];l=[n+(o/2+i[0])*r,e+(s/2+i[1])*t]}),l},Uk.prototype.setOffsetPosition=function(t){var t=j(t,2),e=t[0],t=t[1],n=this.attributes,r=n.x,i=n.y,i=void 0===i?0:i,n=n.container,a=n.x,n=n.y;this.element.style.left="".concat(+(void 0===r?0:r)+a+e,"px"),this.element.style.top="".concat(+i+n+t,"px")},Uk.prototype.updatePosition=function(){this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor()))},Uk.prototype.autoPosition=function(t){var e,n,r,i,a,o,s,t=j(t,2),l=t[0],t=t[1],c=this.attributes,u=c.x,h=c.y,f=c.bounding,c=c.position;return f?(e=(n=this.element).offsetWidth,n=n.offsetHeight,h=(u=j([+u+l,+h+t],2))[0],u=u[1],r={left:"right",right:"left",top:"bottom",bottom:"top"},s=f.x,i=f.y,a={left:h<s,right:s+f.width<h+e,top:u<i,bottom:i+f.height<u+n},o=[],c.split("-").forEach(function(t){o.push(a[t]?r[t]:t)}),s=o.join("-"),this.getRelativeOffsetFromCursor(s)):[l,t]},Uk.tag="tooltip",N([(void 0===(Yk=100)&&(Yk=0),void 0===(qk=!0)&&(qk=!1),function(t,e,n){var r,i=n.value;"function"==typeof i&&(n.value=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r||(t=this,qk&&i.apply(t,e),r=window.setTimeout(function(){i.apply(t,e),r=null},Yk))})})],Uk.prototype,"updatePosition",null);var Vk,Yk,qk,$k=Uk;function Uk(t){var e=this,n=null==(n=null==(n=t.style)?void 0:n.template)?void 0:n.prefixCls,r=Gk(n);return(e=Vk.call(this,t,{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(r.CONTAINER,'"></div>'),title:'<div class="'.concat(r.TITLE,'"></div>'),item:'<li class="'.concat(r.LIST_ITEM,'" data-index={index}>\n <span class="').concat(r.NAME,'">\n <span class="').concat(r.MARKER,'" style="background:{color}"></span>\n <span class="').concat(r.NAME_LABEL,'" title="{name}">{name}</span>\n </span>\n <span class="').concat(r.VALUE,'" title="{value}">{value}</span>\n </li>')},style:(t=Gk(t=void 0===(t=n)?"":t),(r={})[".".concat(t.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"},r[".".concat(t.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},r[".".concat(t.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},r[".".concat(t.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},r[".".concat(t.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},r[".".concat(t.NAME)]={display:"flex","align-items":"center","max-width":"216px"},r[".".concat(t.NAME_LABEL)]=m({flex:1},Hk),r[".".concat(t.VALUE)]=m({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},Hk),r[".".concat(t.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},r[".".concat(t.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},r)})||this).prevCustomContentKey=e.attributes.contentKey,e.initShape(),e.render(e.attributes,e),e}t(Kk,Xk=fc),Object.defineProperty(Kk.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=Bw(t)},enumerable:!1,configurable:!0}),Object.defineProperty(Kk.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=Bw(t)},enumerable:!1,configurable:!0}),Kk.prototype.getBBox=function(){var t=this.attributes,e=t.x,e=void 0===e?0:e,n=t.y,n=void 0===n?0:n,r=t.width,t=t.height,i=j(this.$margin,4),a=i[0],o=i[1],s=i[2],i=i[3];return new Qx(e-i,n-a,r+i+o,t+a+s)},Kk.prototype.appendChild=function(t,e){return t.isMutationObserved=!0,Xk.prototype.appendChild.call(this,t,e),t},Kk.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,t=t.height,n=j(this.$padding,4),r=n[0],i=n[1],a=n[2],n=n[3],o=j(this.$margin,4),s=o[0],o=o[3];return new Qx(n+o,r+s,e-n-i,t-r-a)},Kk.prototype.layout=function(){var t,e,n,r;if(this.attributes.display&&this.isConnected&&!this.children.some(function(t){return!t.isConnected}))try{t=this.getAvailableSpace(),e=this.children.map(function(t){return t.getBBox()}),n=this.attributes;var i=0!==e.length&&(null==(r=n.display in(r={flex:vw,grid:bw})?r[n.display]:null)?void 0:r.call(null,t,e,n))||[];this.children.forEach(function(t,e){var e=i[e],n=e.x,e=e.y;t.attr({x:n,y:e})})}catch(t){}},Kk.prototype.bindEvents=function(){var e=this;this.layoutEvents.forEach(function(t){e.addEventListener(t,function(t){t.target.isMutationObserved=!0,e.layout()})})},Kk.prototype.attributeChangedCallback=function(t,e,n){"margin"===t?this.margin=n:"padding"===t&&(this.padding=n),this.layout()};var Xk,Vy=Kk;function Kk(t){var e=Xk.call(this,t)||this,t=(e.layoutEvents=[b.BOUNDS_CHANGED,b.INSERTED,b.REMOVED],e.$margin=Bw(0),e.$padding=Bw(0),t.style||{}),n=t.margin,t=t.padding,t=void 0===t?0:t;return e.margin=void 0===n?0:n,e.padding=t,e.isMutationObserved=!0,e.bindEvents(),e}function Zk(r,t,e,n){var[[t,i],[a,o]]=t,[s,l]=function(t){var{min:[t,e],max:[n,r]}=t.getLocalBounds();let i=0,a=0;return 0<t&&(i=t),n<0&&(i=n),0<e&&(a=e),r<0&&(a=r),[i,a]}(r);if(t===a&&i===o)return nx()([[0,0],[s,l]]);s=[[t-a,i-o]].concat(e.length?e:[[0,0]]);const c=[n[0]-a,n[1]-o],[u,h]=s;return l=c,t=u,i=h,e=s2(l,t),t=s2(t,i),i=s2(i,l),0<(Math.pow(e,2)+Math.pow(t,2)-Math.pow(i,2))/(2*e*t)&&(a=(()=>{var{min:t,max:e}=r.getLocalBounds(),n=u[0]+(u[1]-c[1])*+u[1]/(u[0]-c[0]);return e[0]<c[0]?Math.min(e[0],n):Math.max(t[0],n)})(),s.splice(1,1,[a,0])),nx()(s)}const Qk=Rx(e=>{var n=e.attributes,{className:r,labelTransform:i,labelTransformOrigin:a,x:o,y:s,x0:l=o,y0:c=s,text:u,background:h,connector:f,startMarker:d,endMarker:p,coordCenter:g,innerHTML:y}=n,n=at(n,["className","class","transform","rotate","labelTransform","labelTransformOrigin","x","y","x0","y0","text","background","connector","startMarker","endMarker","coordCenter","innerHTML"]);if([o,s,l,c].some(t=>!Ge(t)))e.children.forEach(t=>t.remove());else{var m=st(n,"background"),v=m["padding"],m=at(m,["padding"]),b=st(n,"connector"),{points:x=[]}=b,b=at(b,["points"]),l=[[+l,+c],[+o,+s]];let t;t=(y?lt(e).maybeAppend("html","html",r).style("zIndex",0).style("innerHTML",y).call(L,Object.assign({transform:i,transformOrigin:a},n)):lt(e).maybeAppend("text","text").style("zIndex",0).style("text",u).call(L,Object.assign({textBaseline:"middle",transform:i,transformOrigin:a},n))).node();c=Zk(lt(e).maybeAppend("background","rect").style("zIndex",-1).call(L,function(t,e=[]){var[e=0,n=0,r=e,i=n]=e,a=t.parentNode,o=a.getEulerAngles(),{min:t,halfExtents:s}=(a.setEulerAngles(0),t.getLocalBounds()),[t,l]=t,[s,c]=s;return a.setEulerAngles(o),{x:t-i,y:l-e,width:2*s+i+n,height:2*c+e+r}}(t,v)).call(L,h?m:{}).node(),l,x,g),o=d&&new Zw({id:"startMarker",style:Object.assign({x:0,y:0},st(n,"startMarker"))}),s=p&&new Zw({id:"endMarker",style:Object.assign({x:0,y:0},st(n,"endMarker"))});lt(e).maybeAppend("connector","path").style("zIndex",0).style("path",c).style("markerStart",o).style("markerEnd",s).call(L,f?b:{})}});Ws=(s,t)=>{const l=t["coordinate"];return(t,e,n)=>{var{color:e,text:r="",fontSize:i,rotate:a=0,transform:o=""}=e,r={text:String(r),stroke:e,fill:e,fontSize:i},[[e,i]]=t;return lt(new Qk).style("x",e).style("y",i).call(L,n).style("transform",o+`rotate(${+a})`).style("coordCenter",l.getCenter()).call(L,r).call(L,s).node()}};Ws.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Jk=Rx(t=>{var e=at(t.attributes,["class","x","y"]);const n=st(e,"marker"),{size:s=24}=n,r=()=>{var t=s/2,e=t/Math.sqrt(2),n=t*Math.sqrt(2),[r,i]=[-e,e-n],[a,o]=[0,0],[e,n]=[e,e-n];return[["M",r,i],["A",t,t,0,1,1,e,n],["L",a,o],["Z"]]};var[i,a]=function(t){var{min:t,max:e}=t.getLocalBounds();return[.5*(t[0]+e[0]),.5*(t[1]+e[1])]}(lt(t).maybeAppend("marker",()=>new Zw({})).call(t=>t.node().update(Object.assign({symbol:r},n))).node());lt(t).maybeAppend("text","text").style("x",i).style("y",a).call(L,e)});Wy=(t,e)=>{const i=at(t,[]);return(t,e,n)=>{var r=n["color"],n=at(n,["color"]),{color:e=r,text:r=""}=e,r={text:String(r),stroke:e,fill:e},[[e,t]]=t;return lt(new Jk).call(L,n).style("x",e).style("y",t).call(L,r).call(L,i).node()}};Wy.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const tE=Rx(t=>{var{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes;const a=t.ownerDocument;lt(t).maybeAppend("connect-path",()=>a.createElement("path",{})).style("d",n).call(L,i),lt(t).maybeAppend("area-path",()=>a.createElement("path",{})).style("d",e).call(L,r)}),eE=(t,e)=>{const{curve:c,gradient:l=!1,defined:u=t=>!Number.isNaN(t)&&null!=t,connect:h=!1}=t,f=at(t,["curve","gradient","defined","connect"]),{coordinate:d,document:p}=e;return(t,e,n)=>{var r=n["color"],{color:r=r,seriesColor:i,seriesX:a,seriesY:o}=e,e=Tx(d,e),i=l&&i?Ex(i,a,o,l):r;const s=Object.assign(Object.assign(Object.assign(Object.assign({},n),{stroke:i,fill:i}),e&&{transform:e}),f);var[a,o]=function(e,n){var r=[],i=[],a=[];let o=!1,s=null;var l=e.length/2;for(let t=0;t<l;t++){var c,u,h=e[t],f=e[t+l];[...h,...f].some(t=>!n(t))?o=!0:(r.push(h),i.push(f),o&&s&&(o=!1,[c,u]=s,a.push([c,h,u,f])),s=[h,f])}return[r.concat(i),a]}(t,u),r=st(s,"connect"),n=!!o.length,i=t=>lt(p.createElement("path",{})).style("d",t||"").call(L,s).node();return iv(d)?(e=t=>{const n=d.getCenter(),r=t.slice(0,t.length/2),i=t.slice(t.length/2);return t=rx().curve(ix),e=t.curve,a=t.lineX0,o=t.lineX1,s=t.lineY0,l=t.lineY1,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 sx(a())},delete t.lineX0,t.lineEndAngle=function(){return sx(o())},delete t.lineX1,t.lineInnerRadius=function(){return sx(s())},delete t.lineY0,t.lineOuterRadius=function(){return sx(l())},delete t.lineY1,t.curve=function(t){return arguments.length?e(ox(t)):e()._curve},t.angle((t,e)=>c2(a2(r[e],n))).outerRadius((t,e)=>s2(r[e],n)).innerRadius((t,e)=>s2(i[e],n)).defined((t,e)=>[...r[e],...i[e]].every(u)).curve(c)(i);var e,a,o,s,l},!n||h&&!Object.keys(r).length?i(e(a)):n&&!h?i(e(t)):lt(new tE).style("areaStyle",s).style("connectStyle",Object.assign(Object.assign({},r),f)).style("areaPath",e(t)).style("connectPath",o.map(e).join("")).node()):(e=t=>{const n=t.slice(0,t.length/2),r=t.slice(t.length/2);return(rv(d)?rx().y((t,e)=>n[e][1]).x1((t,e)=>n[e][0]).x0((t,e)=>r[e][0]).defined((t,e)=>[...n[e],...r[e]].every(u)):rx().x((t,e)=>n[e][0]).y1((t,e)=>n[e][1]).y0((t,e)=>r[e][1]).defined((t,e)=>[...n[e],...r[e]].every(u))).curve(c)(n)},!n||h&&!Object.keys(r).length?i(e(a)):n&&!h?i(e(t)):lt(new tE).style("areaStyle",s).style("connectStyle",Object.assign(Object.assign({},r),f)).style("areaPath",e(t)).style("connectPath",o.map(e).join("")).node())}};eE.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};rl=(n,r)=>{const i=r["coordinate"];return(...t)=>{var e=iv(i)?vx:J2;return eE(Object.assign({curve:e},n),r)(...t)}},rl.props=Object.assign(Object.assign({},eE.props),{defaultMarker:"square"}),uu=(t,n)=>{const{alpha:r=.5}=t,i=at(t,["alpha"]),a=n["coordinate"];return(...t)=>{var e=iv(a)?yx:px;return eE(Object.assign({curve:e.alpha(r)},i),n)(...t)}},uu.props=Object.assign(Object.assign({},eE.props),{defaultMarker:"smooth"}),Ss=(e,n)=>(...t)=>eE(Object.assign({curve:xx},e),n)(...t),Ss.props=Object.assign(Object.assign({},eE.props),{defaultMarker:"hvh"}),n=(e,n)=>(...t)=>eE(Object.assign({curve:wx},e),n)(...t),n.props=Object.assign(Object.assign({},eE.props),{defaultMarker:"vh"}),es=(e,n)=>(...t)=>eE(Object.assign({curve:Mx},e),n)(...t),es.props=Object.assign(Object.assign({},eE.props),{defaultMarker:"hv"}),rs=(e,n)=>{const{arrow:r=!1}=e;return(...t)=>Fx(Object.assign(Object.assign({},e),{arrow:r}),n)(...t)},rs.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},zs=(t,e)=>{const o=at(t,[]),s=e["document"];return(t,e,n)=>{var r=n["color"],n=at(n,["color"]),{color:e=r,transform:r}=e,[t,i]=t,a=G2();return a.moveTo(t[0],t[1]),a.bezierCurveTo(t[0]/2+i[0]/2,t[1],t[0]/2+i[0]/2,i[1],i[0],i[1]),lt(s.createElement("path",{})).call(L,n).style("d",a.toString()).style("stroke",e).style("transform",r).call(L,o).node()}};zs.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};Ol=(t,e)=>{const{cornerRatio:u=1/3}=t,h=at(t,["cornerRatio"]),{coordinate:f,document:d}=e;return(t,e,n)=>{var r,i,a,o,s=n["defaultColor"],n=at(n,["defaultColor"]),{color:e=s,transform:s}=e,[t,l]=t,c=(t=t,l=l,r=f,i=u,o=G2(),iv(r)?(a=s2(t,c=r.getCenter()),a=(s2(l,c)-a)*i+a,o.moveTo(t[0],t[1]),kx(o,t,l,c,a)):rv(r)?(o.moveTo(t[0],t[1]),o.lineTo(t[0]+(l[0]-t[0])*i,t[1]),o.lineTo(t[0]+(l[0]-t[0])*i,l[1])):(o.moveTo(t[0],t[1]),o.lineTo(t[0],t[1]+(l[1]-t[1])*i),o.lineTo(l[0],t[1]+(l[1]-t[1])*i)),o.lineTo(l[0],l[1]),o);return lt(d.createElement("path",{})).call(L,n).style("d",c.toString()).style("stroke",e).style("transform",s).call(L,h).node()}},Ol.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},qy=(t,e)=>{const s=at(t,[]),{coordinate:l,document:c}=e;return(t,e,n)=>{var r,i=n["color"],n=at(n,["color"]),{color:e=i,transform:i}=e,[t,a]=t,o=G2();return o.moveTo(t[0],t[1]),iv(l)?(r=l.getCenter(),o.quadraticCurveTo(r[0],r[1],a[0],a[1])):kx(o,t,a,f2(t,a),s2(t,a)/2),lt(c.createElement("path",{})).call(L,n).style("d",o.toString()).style("stroke",e).style("transform",i).call(L,s).node()}};function nE(t,e){return t.parent===e.parent?1:2}function rE(t,e){return t+e.x}function iE(t,e){return Math.max(t,e.y)}function aE(){var s=nE,l=1,c=1,u=!1;function e(e){var r,i=0,t=(e.eachAfter(function(t){var e,n=t.children;n?(t.x=(e=n).reduce(rE,0)/e.length,t.y=1+n.reduce(iE,0)):(t.x=r?i+=s(t,r):0,t.y=0,r=t)}),function(t){for(var e;e=t.children;)t=e[0];return t}(e)),n=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(e),a=t.x-s(t,n)/2,o=n.x+s(n,t)/2;return e.eachAfter(u?function(t){t.x=(t.x-e.x)*l,t.y=(e.y-t.y)*c}:function(t){t.x=(t.x-a)/(o-a)*l,t.y=(1-(e.y?t.y/e.y:1))*c})}return e.separation=function(t){return arguments.length?(s=t,e):s},e.size=function(t){return arguments.length?(u=!1,l=+t[0],c=+t[1],e):u?null:[l,c]},e.nodeSize=function(t){return arguments.length?(u=!0,l=+t[0],c=+t[1],e):u?[l,c]:null},e}function oE(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;0<=--r;)e+=n[r].value;else e=1;t.value=e}function sE(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=cE)):void 0===e&&(e=lE);for(var n,r,i,a,o,t=new fE(t),s=[t];n=s.pop();)if((i=e(n.data))&&(o=(i=Array.from(i)).length))for(n.children=i,a=o-1;0<=a;--a)s.push(r=i[a]=new fE(i[a])),r.parent=n,r.depth=n.depth+1;return t.eachBefore(hE)}function lE(t){return t.children}function cE(t){return Array.isArray(t)?t[1]:null}function uE(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function hE(t){for(var e=0;t.height=e,(t=t.parent)&&t.height<++e;);}function fE(t){this.data=t,this.depth=this.height=0,this.parent=null}function dE(t){return null==t?null:pE(t)}function pE(t){if("function"!=typeof t)throw new Error;return t}function gE(){return 0}function yE(t){return function(){return t}}qy.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},fE.prototype=sE.prototype={constructor:fE,count:function(){return this.eachAfter(oE)},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,a=this,o=[a],s=[],l=-1;a=o.pop();)if(s.push(a),n=a.children)for(r=0,i=n.length;r<i;++r)o.push(n[r]);for(;a=s.pop();)t.call(e,a,++l,this);return this},eachBefore:function(t,e){for(var n,r,i,a=[this],o=-1;n=a.pop();)if(t.call(e,n,++o,this),r=n.children)for(i=r.length-1;0<=i;--i)a.push(r[i]);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(i){return this.eachAfter(function(t){for(var e=+i(t.data)||0,n=t.children,r=n&&n.length;0<=--r;)e+=n[r].value;t.value=e})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},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 e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e},links:function(){var e=this,n=[];return e.each(function(t){t!==e&&n.push({source:t.parent,target:t})}),n},copy:function(){return sE(this).eachBefore(uE)},[Symbol.iterator]:function*(){var t,e,n,r,i,a=[this];do{for(e=a.reverse(),a=[];t=e.pop();)if(yield t,n=t.children)for(r=0,i=n.length;r<i;++r)a.push(n[r])}while(a.length)}};const mE=4294967296;function vE(t,e){for(var n,r,i=0,a=(t=function(t,e){let n=t.length,r,i;for(;n;)i=e()*n--|0,r=t[n],t[n]=t[i],t[i]=r;return t}(Array.from(t),e)).length,o=[];i<a;)n=t[i],r&&xE(r,n)?++i:(r=function(t){switch(t.length){case 1:return function(t){return{x:t.x,y:t.y,r:t.r}}(t[0]);case 2:return ME(t[0],t[1]);case 3:return OE(t[0],t[1],t[2])}}(o=function(t,e){var n,r;if(wE(e,t))return[e];for(n=0;n<t.length;++n)if(bE(e,t[n])&&wE(ME(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(r=n+1;r<t.length;++r)if(bE(ME(t[n],t[r]),e)&&bE(ME(t[n],e),t[r])&&bE(ME(t[r],e),t[n])&&wE(OE(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}(o,n)),i=0);return r}function bE(t,e){var n=t.r-e.r,r=e.x-t.x,e=e.y-t.y;return n<0||n*n<r*r+e*e}function xE(t,e){var n=t.r-e.r+1e-9*Math.max(t.r,e.r,1),r=e.x-t.x,e=e.y-t.y;return 0<n&&r*r+e*e<n*n}function wE(t,e){for(var n=0;n<e.length;++n)if(!xE(t,e[n]))return;return 1}function ME(t,e){var n=t.x,r=t.y,t=t.r,i=e.x,a=e.y,e=e.r,o=i-n,s=a-r,l=e-t,c=Math.sqrt(o*o+s*s);return{x:(n+i+o/c*l)/2,y:(r+a+s/c*l)/2,r:(c+t+e)/2}}function OE(t,e,n){var r=t.x,i=t.y,t=t.r,a=e.x,o=e.y,e=e.r,s=n.x,l=n.y,n=n.r,c=r-a,u=r-s,h=i-o,f=i-l,d=e-t,p=n-t,g=r*r+i*i-t*t,a=g-a*a-o*o+e*e,o=g-s*s-l*l+n*n,e=u*h-c*f,g=(h*o-f*a)/(2*e)-r,s=(f*d-h*p)/e,l=(u*a-c*o)/(2*e)-i,n=(c*p-u*d)/e,f=s*s+n*n-1,h=2*(t+g*s+l*n),a=g*g+l*l-t*t,o=-(1e-6<Math.abs(f)?(h+Math.sqrt(h*h-4*f*a))/(2*f):a/h);return{x:r+g+s*o,y:i+l+n*o,r:o}}function kE(t,e,n){var r,i,a,o,s=t.x-e.x,l=t.y-e.y,c=s*s+l*l;c?(i=e.r+n.r,o=t.r+n.r,(o*=o)<(i*=i)?(r=(c+o-i)/(2*c),a=Math.sqrt(Math.max(0,o/c-r*r)),n.x=t.x-r*s-a*l,n.y=t.y-r*l+a*s):(r=(c+i-o)/(2*c),a=Math.sqrt(Math.max(0,i/c-r*r)),n.x=e.x+r*s-a*l,n.y=e.y+r*l+a*s)):(n.x=e.x+n.r,n.y=e.y)}function EE(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,e=e.y-t.y;return 0<n&&r*r+e*e<n*n}function SE(t){var e=t._,t=t.next._,n=e.r+t.r,r=(e.x*t.r+t.x*e.r)/n,t=(e.y*t.r+t.y*e.r)/n;return r*r+t*t}function AE(t){this._=t,this.next=null,this.previous=null}function _E(t,e){if(!(a=(t="object"==typeof(n=t)&&"length"in n?n:Array.from(n)).length))return 0;var n,r,i,a,o,s,l,c,u,h,f,d=t[0];if(d.x=0,d.y=0,!(1<a))return d.r;if(r=t[1],d.x=-r.r,r.x=d.r,r.y=0,!(2<a))return d.r+r.r;kE(r,d,i=t[2]),d=new AE(d),r=new AE(r),i=new AE(i),((d.next=i.previous=r).next=d.previous=i).next=r.previous=d;t:for(l=3;l<a;++l){kE(d._,r._,i=t[l]),i=new AE(i),c=r.next,u=d.previous,h=r._.r,f=d._.r;do{if(h<=f){if(EE(c._,i._)){r=c,(d.next=r).previous=d,--l;continue t}h+=c._.r,c=c.next}else{if(EE(u._,i._)){((d=u).next=r).previous=d,--l;continue t}f+=u._.r,u=u.previous}}while(c!==u.next);for(i.previous=d,i.next=r,d.next=r.previous=r=i,o=SE(d);(i=i.next)!==r;)(s=SE(i))<o&&(d=i,o=s);r=d.next}for(d=[r._],i=r;(i=i.next)!==r;)d.push(i._);for(i=vE(d,e),l=0;l<a;++l)(d=t[l]).x-=i.x,d.y-=i.y;return i.r}function TE(t){return Math.sqrt(t.value)}function PE(){var n=null,r=1,i=1,a=gE;function e(t){var e=function(){let t=1;return()=>(t=(1664525*t+1013904223)%mE)/mE}();return t.x=r/2,t.y=i/2,n?t.eachBefore(CE(n)).eachAfter(LE(a,.5,e)).eachBefore(NE(1)):t.eachBefore(CE(TE)).eachAfter(LE(gE,1,e)).eachAfter(LE(a,t.r/Math.min(r,i),e)).eachBefore(NE(Math.min(r,i)/(2*t.r))),t}return e.radius=function(t){return arguments.length?(n=dE(t),e):n},e.size=function(t){return arguments.length?(r=+t[0],i=+t[1],e):[r,i]},e.padding=function(t){return arguments.length?(a="function"==typeof t?t:yE(+t),e):a},e}function CE(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function LE(o,s,l){return function(t){if(e=t.children){var e,n,r,i=e.length,a=o(t)*s||0;if(a)for(n=0;n<i;++n)e[n].r+=a;if(r=_E(e,l),a)for(n=0;n<i;++n)e[n].r-=a;t.r=r+a}}}function NE(n){return function(t){var e=t.parent;t.r*=n,e&&(t.x=e.x+n*t.x,t.y=e.y+n*t.y)}}function jE(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 RE(t,e,n,r,i){for(var a,o=t.children,s=-1,l=o.length,c=t.value&&(r-e)/t.value;++s<l;)(a=o[s]).y0=n,a.y1=i,a.x0=e,a.x1=e+=a.value*c}var IE={depth:-1},BE={},DE={};function FE(t){return t.id}function zE(t){return t.parentId}function WE(){var y,m=FE,v=zE;function e(n){var e,t,r,i,a,o,s,l,c=Array.from(n),u=m,h=v,f=new Map;if(null!=y){const p=c.map((t,e)=>{t=y(t,e,n),e=(t=""+t).length;return"/"===(t=HE(t,e-1)&&!HE(t,e-2)?t.slice(0,-1):t)[0]?t:"/"+t}),g=p.map(GE);var d=new Set(p).add("");for(const r of g)d.has(r)||(d.add(r),p.push(r),g.push(GE(r)),c.push(DE));u=(t,e)=>p[e],h=(t,e)=>g[e]}for(r=0,e=c.length;r<e;++r)t=c[r],o=c[r]=new fE(t),null!=(s=u(t,r,n))&&(s+="")&&(l=o.id=s,f.set(l,f.has(l)?BE:o)),null!=(s=h(t,r,n))&&(s+="")&&(o.parent=s);for(r=0;r<e;++r)if(s=(o=c[r]).parent){if(!(a=f.get(s)))throw new Error("missing: "+s);if(a===BE)throw new Error("ambiguous: "+s);a.children?a.children.push(o):a.children=[o],o.parent=a}else{if(i)throw new Error("multiple roots");i=o}if(!i)throw new Error("no root");if(null!=y){for(;i.data===DE&&1===i.children.length;)i=i.children[0],--e;for(let t=c.length-1;0<=t&&(o=c[t]).data===DE;--t)o.data=null}if(i.parent=IE,i.eachBefore(function(t){t.depth=t.parent.depth+1,--e}).eachBefore(hE),i.parent=null,0<e)throw new Error("cycle");return i}return e.id=function(t){return arguments.length?(m=dE(t),e):m},e.parentId=function(t){return arguments.length?(v=dE(t),e):v},e.path=function(t){return arguments.length?(y=dE(t),e):y},e}function GE(t){let e=t.length;if(e<2)return"";for(;1<--e&&!HE(t,e););return t.slice(0,e)}function HE(e,n){if("/"===e[n]){let t=0;for(;0<n&&"\\"===e[--n];)++t;if(0==(1&t))return 1}}function VE(t,e){return t.parent===e.parent?1:2}function YE(t){var e=t.children;return e?e[0]:t.t}function qE(t){var e=t.children;return e?e[e.length-1]:t.t}function $E(t,e){this._=t,this.parent=null,this.children=null,this.A=null,(this.a=this).z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function UE(){var f=VE,l=1,c=1,u=null;function e(t){var e,n,r,i,a,o,s=function(t){for(var e,n,r,i,a,o=[t=new $E(t,0)];e=o.pop();)if(r=e._.children)for(e.children=new Array(a=r.length),i=a-1;0<=i;--i)o.push(n=e.children[i]=new $E(r[i],i)),n.parent=e;return(t.parent=new $E(null,0)).children=[t],t}(t);return s.eachAfter(h),s.parent.m=-s.z,s.eachBefore(d),u?t.eachBefore(p):((r=n=e=t).eachBefore(function(t){t.x<e.x&&(e=t),t.x>n.x&&(n=t),t.depth>r.depth&&(r=t)}),s=e===n?1:f(e,n)/2,i=s-e.x,a=l/(n.x+s+i),o=c/(r.depth||1),t.eachBefore(function(t){t.x=(t.x+i)*a,t.y=t.depth*o})),t}function h(t){var e=t.children,n=t.parent.children,r=t.i?n[t.i-1]:null;if(e){for(var i,a=0,o=0,s=t.children,l=s.length;0<=--l;)(i=s[l]).z+=a,i.m+=a,a+=i.s+(o+=i.c);e=(e[0].z+e[e.length-1].z)/2;r?(t.z=r.z+f(t._,r._),t.m=t.z-e):t.z=e}else r&&(t.z=r.z+f(t._,r._));t.parent.A=function(t,e,n){if(e){for(var r,i=t,a=t,o=e,s=i.parent.children[0],l=i.m,c=a.m,u=o.m,h=s.m;o=qE(o),i=YE(i),o&&i;)s=YE(s),(a=qE(a)).a=t,0<(r=o.z+u-i.z-l+f(o._,i._))&&(function(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}(function(t,e,n){return t.a.parent===e.parent?t.a:n}(o,t,n),t,r),l+=r,c+=r),u+=o.m,l+=i.m,h+=s.m,c+=a.m;o&&!qE(a)&&(a.t=o,a.m+=u-c),i&&!YE(s)&&(s.t=i,s.m+=l-h,n=t)}return n}(t,r,t.parent.A||n[0])}function d(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function p(t){t.x*=l,t.y=t.depth*c}return e.separation=function(t){return arguments.length?(f=t,e):f},e.size=function(t){return arguments.length?(u=!1,l=+t[0],c=+t[1],e):u?null:[l,c]},e.nodeSize=function(t){return arguments.length?(u=!0,l=+t[0],c=+t[1],e):u?[l,c]:null},e}function XE(t,e,n,r,i){for(var a,o=t.children,s=-1,l=o.length,c=t.value&&(i-n)/t.value;++s<l;)(a=o[s]).x0=e,a.x1=r,a.y0=n,a.y1=n+=a.value*c}$E.prototype=Object.create(fE.prototype);Uy=(1+Math.sqrt(5))/2;function KE(t,e,n,r,i,a){for(var o,s,l,c,u,h,f,d,p,g,y,m=[],v=e.children,b=0,x=0,w=v.length,M=e.value;b<w;){for(l=i-n,c=a-r;!(u=v[x++].value)&&x<w;);for(y=(h=f=u)*u*(g=Math.max(c/l,l/c)/(M*t)),p=Math.max(f/y,y/h);x<w;++x){if(u+=s=v[x].value,s<h&&(h=s),f<s&&(f=s),y=u*u*g,p<(d=Math.max(f/y,y/h))){u-=s;break}p=d}m.push(o={value:u,dice:l<c,children:v.slice(b,x)}),o.dice?RE(o,n,r,i,M?r+=c*u/M:a):XE(o,n,r,M?n+=l*u/M:i,a),M-=u,b=x}return m}var ZE=function e(a){function t(t,e,n,r,i){KE(a,t,e,n,r,i)}return t.ratio=function(t){return e(1<(t=+t)?t:1)},t}(Uy);function QE(t,e,n,r,i){var a,o,g=t.children,s=g.length,y=new Array(s+1);for(y[0]=o=a=0;a<s;++a)y[a+1]=o+=g[a].value;!function t(e,n,r,i,a,o,s){if(n-1<=e)return(l=g[e]).x0=i,l.y0=a,l.x1=o,void(l.y1=s);var l=y[e],c=r/2+l,u=e+1,h=n-1;for(;u<h;){var f=u+h>>>1;y[f]<c?u=1+f:h=f}c-y[u-1]<y[u]-c&&e+1<u&&--u;var l=y[u]-l,d=r-l;{var p;s-a<o-i?(t(e,u,l,i,a,p=r?(i*d+o*l)/r:o,s),t(u,n,d,p,a,o,s)):(t(e,u,l,i,a,o,p=r?(a*d+s*l)/r:s),t(u,n,d,i,p,o,s))}}(0,s,t.value,e,n,r,i)}function JE(t,e,n,r,i){(1&t.depth?XE:RE)(t,e,n,r,i)}var t5=function e(d){function t(t,e,n,r,i){if((a=t._squarify)&&a.ratio===d)for(var a,o,s,l,c,u=-1,h=a.length,f=t.value;++u<h;){for(s=(o=a[u]).children,l=o.value=0,c=s.length;l<c;++l)o.value+=s[l].value;o.dice?RE(o,e,n,r,f?n+=(i-n)*o.value/f:i):XE(o,e,n,f?e+=(r-e)*o.value/f:r,i),f-=o.value}else t._squarify=a=KE(d,t,e,n,r,i),a.ratio=d}return t.ratio=function(t){return e(1<(t=+t)?t:1)},t}(Uy);function e5(t={}){t=t.shapes;return[{name:"color"},{name:"opacity"},{name:"shape",range:t},{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 n5(t={}){return[...e5(t),{name:"title",scale:"identity"}]}function r5(){return[{type:xb,channel:"color"},{type:Mb,channel:["x","y"]}]}function i5(){return[{type:xb,channel:"x"},{type:Mb,channel:["y"]}]}function a5(t={}){return e5(t)}function o5(){return[{type:wb}]}function s5(t,e){return t.getBandWidth(t.invert(e))}function l5(t,e,n={}){const{x:a,y:o,series:s}=e,{x:l,y:c,series:u}=t,{style:{bandOffset:r=u?0:.5,bandOffsetX:h=r,bandOffsetY:f=r}={}}=n,d=!(null===l||void 0===l||!l.getBandWidth),p=!(null===c||void 0===c||!c.getBandWidth),g=!(null===u||void 0===u||!u.getBandWidth);return d||p?(t,e)=>{const n=d?s5(l,a[e]):0;var r=p?s5(c,o[e]):0,e=g&&s?(s5(u,s[e])/2+ +s[e])*n:0,[t,i]=t;return[t+h*n+e,i+f*r]}:t=>t}function c5(t){return parseFloat(t)/100}function u5(t,e,n,r){const{x:i,y:a}=n,{innerWidth:o,innerHeight:s}=r.getOptions();return[t,Array.from(t,t=>{var e=i[t],t=a[t];return[["string"==typeof e?c5(e)*o:+e,"string"==typeof t?c5(t)*s:+t]]})]}function h5(e){return"function"==typeof e?e:t=>t[e]}function f5(t,e){return Array.from(t,h5(e))}function d5(t,e){var{source:e=t=>t.source,target:n=t=>t.target,value:r=t=>t.value}=e,{links:t,nodes:i}=t;const a=f5(t,e),o=f5(t,n),s=f5(t,r);return{links:t.map((t,e)=>({target:o[e],source:a[e],value:s[e]})),nodes:i||Array.from(new Set([...a,...o]),t=>({key:t}))}}Gy=(u,t)=>{const{coordinate:h,document:f}=t;return(t,e,n)=>{var r=n["color"],n=at(n,["color"]),{color:e=r,src:r="",size:i=32,transform:a=""}=e,{width:o=i,height:i=i}=u,[[t,s]]=t,[l,c]=h.getSize(),o="string"==typeof o?c5(o)*l:o,i="string"==typeof i?c5(i)*c:i,l=t-Number(o)/2,c=s-Number(i)/2;return lt(f.createElement("image",{})).call(L,n).style("x",l).style("y",c).style("img",r).style("stroke",e).style("transform",a).call(L,u).style("width",o).style("height",i).node()}};Gy.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};Dy=(i,t)=>{const{coordinate:a,document:o}=t;return(t,e,n)=>{var r=n["color"],n=at(n,["color"]),{color:e=r,transform:r}=e,t=function(i,t){const a=G2();if(iv(t)){const o=t.getCenter();t=[...i,i[0]];const s=t.map(t=>s2(t,o));return t.forEach((t,e)=>{var n,r;0===e?a.moveTo(t[0],t[1]):(n=s[e],r=i[e-1],void 0!==(e=s[e-1])&&Math.abs(n-e)<1e-10?kx(a,r,t,o,n):a.lineTo(t[0],t[1]))}),a.closePath(),a}return n=a,i.forEach((t,e)=>0===e?n.moveTo(t[0],t[1]):n.lineTo(t[0],t[1])),n.closePath(),n;var n}(t,a);return lt(o.createElement("path",{})).call(L,n).style("d",t.toString()).style("stroke",e).style("fill",e).style("transform",r).call(L,i).node()}};Dy.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};Fy=(t,e)=>{const a=at(t,[]),{coordinate:o,document:s}=e;return(t,e,n)=>{var r=n["color"],n=at(n,["color"]),{color:e=r,transform:i}=e,t=function(t,e){var n,[t,r,i,a]=t,o=G2();return iv(e)?(n=s2(e=e.getCenter(),t),o.moveTo(t[0],t[1]),o.quadraticCurveTo(e[0],e[1],i[0],i[1]),kx(o,i,a,e,n),o.quadraticCurveTo(e[0],e[1],r[0],r[1]),kx(o,r,t,e,n),o.closePath()):(o.moveTo(t[0],t[1]),o.bezierCurveTo(t[0]/2+i[0]/2,t[1],t[0]/2+i[0]/2,i[1],i[0],i[1]),o.lineTo(a[0],a[1]),o.bezierCurveTo(a[0]/2+r[0]/2,a[1],a[0]/2+r[0]/2,r[1],r[0],r[1]),o.lineTo(t[0],t[1]),o.closePath()),o}(t,o);return lt(s.createElement("path",{})).call(L,n).style("d",t.toString()).style("fill",e||r).style("stroke",e||r).style("transform",i).call(L,a).node()}};Fy.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};Uo=(y,t)=>{const{coordinate:m,document:v}=t;return(t,e,n)=>{var r,i,a,o,s,l,c,u,h,{color:e,transform:f}=e,{color:d,fill:p=d,stroke:d=d}=n,n=at(n,["color","fill","stroke"]),g=(t=t,r=m,h=G2(),iv(r)?([i,a]=r=r.getCenter(),o=l2(a2(t[0],r)),s=l2(a2(t[1],r)),g=s2(r,t[2]),l=s2(r,t[3]),c=s2(r,t[8]),u=s2(r,t[10]),r=s2(r,t[11]),h.moveTo(...t[0]),h.arc(i,a,g,o,s),h.arc(i,a,g,s,o,!0),h.moveTo(...t[2]),h.lineTo(...t[3]),h.moveTo(...t[4]),h.arc(i,a,l,o,s),h.lineTo(...t[6]),h.arc(i,a,u,s,o,!0),h.closePath(),h.moveTo(...t[8]),h.arc(i,a,c,o,s),h.arc(i,a,c,s,o,!0),h.moveTo(...t[10]),h.lineTo(...t[11]),h.moveTo(...t[12]),h.arc(i,a,r,o,s),h.arc(i,a,r,s,o,!0)):(h.moveTo(...t[0]),h.lineTo(...t[1]),h.moveTo(...t[2]),h.lineTo(...t[3]),h.moveTo(...t[4]),h.lineTo(...t[5]),h.lineTo(...t[6]),h.lineTo(...t[7]),h.closePath(),h.moveTo(...t[8]),h.lineTo(...t[9]),h.moveTo(...t[10]),h.lineTo(...t[11]),h.moveTo(...t[12]),h.lineTo(...t[13])),h);return lt(v.createElement("path",{})).call(L,n).style("d",g.toString()).style("stroke",d).style("fill",e||p).style("transform",f).call(L,y).node()}};Uo.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};as=(y,t)=>{const{coordinate:m,document:v}=t;return(t,e,n)=>{var r,i,a,o,s,l,c,u,h,{color:e,transform:f}=e,{color:d,fill:p=d,stroke:d=d}=n,n=at(n,["color","fill","stroke"]),g=(t=t,r=m,i=4,h=G2(),iv(r)?([a,o]=r=r.getCenter(),s=s2(r,t[3]),l=s2(r,t[8]),g=s2(r,t[10]),c=(r=l2(a2(t[2],r)))-(u=Math.asin(i/l)),r+=u,h.moveTo(...t[2]),h.lineTo(...t[3]),h.moveTo(Math.cos(c)*s+a,Math.sin(c)*s+o),h.arc(a,o,s,c,r),h.lineTo(Math.cos(r)*g+a,Math.sin(r)*g+o),h.arc(a,o,g,r,c,!0),h.lineTo(Math.cos(c)*s+a,Math.sin(c)*s+o),h.closePath(),h.moveTo(...t[10]),h.lineTo(...t[11]),u=(c+r)/2,h.moveTo(Math.cos(u)*(l+i/2)+a,Math.sin(u)*(l+i/2)+o),h.arc(Math.cos(u)*l+a,Math.sin(u)*l+o,i/2,u,2*Math.PI+u)):(h.moveTo(...t[2]),h.lineTo(...t[3]),h.lineTo(t[3][0]-i,t[3][1]),h.lineTo(t[10][0]-i,t[10][1]),h.lineTo(t[10][0]+i,t[10][1]),h.lineTo(t[3][0]+i,t[3][1]),h.lineTo(...t[3]),h.closePath(),h.moveTo(...t[10]),h.lineTo(...t[11]),h.moveTo(t[3][0]+i/2,t[8][1]),h.arc(t[3][0],t[8][1],i/2,0,2*Math.PI)),h.closePath(),h);return lt(v.createElement("path",{})).call(L,n).style("d",g.toString()).style("stroke",d).style("fill",e||p).style("transform",f).call(L,y).node()}};as.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};Hy=(t,e)=>{const{arrow:u,arrowSize:h=4}=t,f=at(t,["arrow","arrowSize"]),{coordinate:d,document:p}=e;return(t,e,n)=>{var r,i,a,{color:o,lineWidth:s}=n,n=at(n,["color","lineWidth"]),{color:o=o,size:s=s}=e,l=u?(l=p,r=h,i=Object.assign({fill:f.stroke||o,stroke:f.stroke||o},st(f,"arrow")),l.createElement("path",{style:Object.assign({path:`M ${r},${r} L -${r},0 L ${r},-${r} L 0,0 Z`,anchor:"0.5 0.5",transformOrigin:"center"},i)})):null,t=(r=t,iv(i=d)?(i=i.getCenter(),K2()({startAngle:0,endAngle:2*Math.PI,outerRadius:s2(r[0],i),innerRadius:s2(r[1],i)})):nx().x(t=>t[0]).y(t=>t[1])(r)),c=(c=d,e=e.transform,iv(c)?([c,a]=c.getCenter(),`translate(${c}, ${a}) `+(e||"")):e);return lt(p.createElement("path",{})).call(L,n).style("d",t).style("stroke",o).style("lineWidth",s).style("transform",c).style("markerEnd",l).call(L,f).node()}};function p5(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}Hy.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const g5=Rx(t=>{var e=t.attributes,{points:n,endMarker:r=!0}=e,e=at(e,["points","class","endMarker","direction"]),i=st(e,"endMarker"),n=(n=n,nx().x(t=>t[0]).y(t=>t[1])(n));lt(t).maybeAppend("connector","path").style("path",n).style("markerEnd",r?new Zw({className:"marker",style:Object.assign(Object.assign({},i),{symbol:p5})}):null).call(L,e)});Qo=(t,e)=>{const{offset:o=0,connectLength1:s}=t,l=at(t,["offset","connectLength1"]),c=e["coordinate"];return(t,e,n)=>{var{color:r,connectLength1:i=s}=n,n=at(n,["color","connectLength1"]),{color:e,transform:a}=e,t=function(t,e,n,r=0){var[[e,i],[a,o]]=e;if(rv(t)){const l=n;var t=e+l,s=t+r;return[[t,i],[s,i],[s,o],[a+l,o]]}const l=-n;return t=i+l,[[e,t],[e,s=t+-r],[a,s],[a,o+l]]}(c,t,o,i);return lt(new g5).call(L,n).style("points",t).style("stroke",e||r).style("transform",a).call(L,l).node()}};function y5(t,e,a,n){var r=a["bounds"];const[[o,s],[i,l]]=r,c=i-o,u=l-s;r=t=>{var{x:e,y:n}=t,r=up(a.x,c),i=up(a.y,u);return Object.assign(Object.assign({},t),{x:(r||e)+o,y:(i||n)+s})};return r("left"===t?{x:0,y:u/2,textAnchor:"start",textBaseline:"middle"}:"right"===t?{x:c,y:u/2,textAnchor:"end",textBaseline:"middle"}:"top"===t?{x:c/2,y:0,textAnchor:"center",textBaseline:"top"}:"bottom"===t?{x:c/2,y:u,textAnchor:"center",textBaseline:"bottom"}:"top-left"===t?{x:0,y:0,textAnchor:"start",textBaseline:"top"}:"top-right"===t?{x:c,y:0,textAnchor:"end",textBaseline:"top"}:"bottom-left"===t?{x:0,y:u,textAnchor:"start",textBaseline:"bottom"}:"bottom-right"===t?{x:c,y:u,textAnchor:"end",textBaseline:"bottom"}:{x:c/2,y:u/2,textAnchor:"center",textBaseline:"middle"})}function m5(r,i,t,e){var{y:t,y1:n,autoRotate:a,rotateToAlignArc:o}=t;const s=e.getCenter(),{innerRadius:l,outerRadius:c,startAngle:u,endAngle:h}=Ax(e,i,[t,n]),f="inside"===r?(u+h)/2:h;e=b5(f,a,o),t=(()=>{var[t,e]=i,n=l+.5*(c-l),[n,t]="inside"===r?v5(s,f,n):f2(t,e);return{x:n,y:t}})();return Object.assign(Object.assign({},t),{textAlign:"inside"===r?"center":"start",textBaseline:"middle",rotate:e})}function v5(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function b5(t,e,n){return e?(e=n?0:Math.sin(t)<0?90:-90,t/Math.PI*180+e):0}function x5(t,e,n,r){var{y:n,y1:i,autoRotate:a,rotateToAlignArc:o,radius:s=.5,offset:l=0}=n,e=Ax(r,e,[n,i]),{startAngle:n,endAngle:i}=e,r=r.getCenter(),n=(n+i)/2,i={textAlign:"center",textBaseline:"middle",rotate:b5(n,a,o)},{innerRadius:a,outerRadius:o}=e,[e,r]=v5(r,n,a+(o-a)*s+l);return Object.assign({x:e,y:r},i)}function w5(t){return void 0===t?null:t}function M5(t,e,n){var n=n["bounds"],[n]=n;return{x:w5(n[0]),y:w5(n[1])}}function O5(t,e,n,r){var i=n["bounds"];return 1===i.length?M5(0,0,n):(av(r)?m5:cv(r)?x5:y5)(t,e,n,r)}function k5(t,e,n){var{innerRadius:n,outerRadius:t}=Ax(n,t,[e.y,e.y1]);return n+(t-n)}function E5(t,e,n){var{startAngle:n,endAngle:t}=Ax(n,t,[e.y,e.y1]);return(n+t)/2}function S5(t,e,n,r){var{autoRotate:i,rotateToAlignArc:a,offset:o=0,connector:s=!0,connectorLength:l=o,connectorLength2:c=0,connectorDistance:u=0}=n,h=r.getCenter(),f=E5(e,n,r),d=0<Math.sin(f)?1:-1,i=b5(f,i,a),a={textAlign:0<d||av(r)?"start":"end",textBaseline:"middle",rotate:i},i=k5(e,n,r),[[e,n],[r,h],[f,i]]=function(t,e,n,r,i){var[n,a]=v5(t,e,n),[t,r]=v5(t,e,r);return[[n,a],[t,r],[t+(0<Math.sin(e)?1:-1)*i,r]]}(h,f,i,i+(s?l:o),s?c:0),l=s?+u*d:0,o=f+l,c={connector:s,connectorPoints:[[r-o,h-i],[f-o,i-i]]};return Object.assign(Object.assign({x0:e,y0:n,x:f+l,y:i},a),c)}Qo.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var A5=Object.freeze({__proto__:null,area:function(t,e,n,r){var i=e.length/2;const a=e.slice(0,i),o=e.slice(i);var e=Vd(a,(t,e)=>Math.abs(t[1]-o[e][1])),i=(l=t=>[a[t][0],(a[t][1]+o[t][1])/2])(e=Math.max(Math.min(e,i-2),1)),s=l(e-1),l=l2(a2(l(e+1),s))/Math.PI*180;return{x:i[0],y:i[1],transform:`rotate(${l})`,textAlign:"center",textBaseline:"middle"}},bottom:O5,bottomLeft:O5,bottomRight:O5,inside:O5,left:O5,outside:function(t,e,n,r){var i=n["bounds"];return 1===i.length?M5(0,0,n):(av(r)?m5:cv(r)?S5:y5)(t,e,n,r)},right:O5,spider:function(t,e,n,r){var i,a,o,s,l,c;return cv(r)?({connectorLength:c,connectorLength2:i,connectorDistance:a}=n,o=at(S5(0,e,n,r),[]),s=r.getCenter(),l=k5(e,n,r),e=E5(e,n,r),n=l+c+i,r=0<Math.sin(e)?1:-1,l=o["x"],c=s[0]+(n+ +a)*r-l,o.x+=c,o.connectorPoints[0][0]-=c,o):{}},surround:function(t,e,n,r){var i,a,o,s,l;return cv(r)?({connectorLength:o,connectorLength2:i,connectorDistance:a}=n,{x0:n,y0:s}=e=at(S5(0,e,n,r),[]),l=r.getCenter(),r=function(t){if(cv(t)){var[e,n]=t.getSize(),t=t.getOptions().transformations.find(t=>"polar"===t[0]);if(t)return Math.max(e,n)/2*t[4]}return 0}(r)+o,o=c2([n-l[0],s-l[1]]),n=0<Math.sin(o)?1:-1,[s,l]=v5(l,o,r),e.x=s+(i+a)*n,e.y=l,e):{}},top:O5,topLeft:O5,topRight:O5});function _5(t,e,n,r,i){var a=e["position"],o=i["render"],a=(s=n,void 0!==(a=a)?a:cv(s)?"inside":rv(s)?"right":"top"),s=r[o?"htmlLabel":"inside"===a?"innerLabel":"label"],r=Object.assign({},s,e),o=A5[fv(a)];if(o)return Object.assign(Object.assign({},s),o(a,t,r,n,i));throw new Error("Unknown position: "+a)}const T5=(c,t)=>{const{coordinate:u,theme:h}=t,f=c["render"];return(t,e)=>{var{text:n,transform:r="",transformOrigin:i,className:a=""}=e,o=at(e,["text","x","y","transform","transformOrigin","className"]),t=_5(t,e,u,h,c),{rotate:s=0,transform:l=""}=t,t=at(t,["rotate","transform"]);return lt(new Qk).call(L,t).style("text",""+n).style("className",a+" g2-label").style("innerHTML",f?f(n,e.datum,e.index):void 0).style("labelTransform",(l+` rotate(${+s}) `+r).trim()).style("labelTransformOrigin",i).style("coordCenter",u.getCenter()).call(L,o).node()}},P5=(T5.props={defaultMarker:"point"},(t,e)=>{const o=t["colorAttribute"],s=at(t,["arrow","colorAttribute"]),{coordinate:l,document:c}=e;return(t,e,n)=>{var r=n["color"],n=at(n,["color","stroke"]),{d:e,color:r=r}=e,[i,a]=l.getSize();return lt(c.createElement("path",{})).call(L,n).style("d","function"==typeof e?e({width:i,height:a}):e).style(o,r).call(L,s).node()}});P5.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};zy=(t,e)=>P5(Object.assign({colorAttribute:"fill"},t),e),zy.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},$s=(t,e)=>P5(Object.assign({fill:"none",colorAttribute:"stroke"},t),e),$s.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},Go=(s,t)=>{const l=t["document"];return(t,e,n)=>{var r=e["transform"],i=n["color"],n=at(n,["color"]),{color:e=i}=e,[t,...a]=t;const o=G2();return o.moveTo(...t),a.forEach(([t,e])=>{o.lineTo(t,e)}),o.closePath(),lt(l.createElement("path",{})).call(L,n).style("d",o.toString()).style("stroke",e||i).style("fill",e||i).style("fillOpacity",.4).style("transform",r).call(L,s).node()}};function C5(t){var n,r,i,a=t||1;function o(t,e){++n>a&&(i=r,s(1),++n),r[t]=e}function s(t){n=0,r=Object.create(null),t||(i=Object.create(null))}return s(),{clear:s,has:function(t){return void 0!==r[t]||void 0!==i[t]},get:function(t){var e=r[t];return void 0!==e?e:void 0!==(e=i[t])?(o(t,e),e):void 0},set:function(t,e){void 0!==r[t]?r[t]=e:o(t,e)}}}function L5(t,e,n){t=t?t():document.createElement("canvas");return t.width=e,t.height=n,t}Go.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},C5(3);const N5=function(n,r,t=16){const i=C5(t);return(...t)=>{var e=r(...t);i.get(e);return i.has(e)?i.get(e):(t=n(...t),i.set(e,t),t)}}((t,e,n)=>{var n=L5(n,2*t,2*t),r=n.getContext("2d"),i=t,a=t;return 1===e?(r.beginPath(),r.arc(i,a,t,0,2*Math.PI,!1),r.fillStyle="rgba(0,0,0,1)",r.fill()):((e=r.createRadialGradient(i,a,t*e,i,a,t)).addColorStop(0,"rgba(0,0,0,1)"),e.addColorStop(1,"rgba(0,0,0,0)"),r.fillStyle=e,r.fillRect(0,0,2*t,2*t)),n},t=>""+t);function j5(t,e,n,r,i,a,o){a=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)"]]},a);a.minOpacity*=255,a.opacity*=255,a.maxOpacity*=255;var s=L5(o,t,e).getContext("2d"),l=function(t,e){const n=(e=L5(e,256,1).getContext("2d")).createLinearGradient(0,0,256,1);return("string"==typeof(t=t)?t.split(" ").map(t=>{var[t,e]=t.split(":");return[+t,e]}):t).forEach(([t,e])=>{n.addColorStop(t,e)}),e.fillStyle=n,e.fillRect(0,0,256,1),e.getImageData(0,0,256,1).data}(a.gradient,o);s.clearRect(0,0,t,e);{var c=s,u=n,h=r,f=i,d=o,p=(n=a)["blur"];let t=f.length;for(;t--;){var{x:g,y,value:m,radius:v}=f[t],m=Math.min(m,h),g=g-v,y=y-v,v=N5(v,1-p,d);c.globalAlpha=Math.max((m-u)/(h-u),.001),c.drawImage(v,g,y)}}r=function(t,e,n,r,i){var{minOpacity:a,opacity:o,maxOpacity:s,useGradientOpacity:l}=i,c=(i=t.getImageData(0,0,e,n)).data,u=c.length;for(let t=3;t<u;t+=4){var h=c[t],f=4*h;f&&(h=o||Math.max(0,Math.min(s,Math.max(a,h))),c[t-3]=r[f],c[t-2]=r[1+f],c[t-1]=r[2+f],c[t]=l?r[3+f]:h)}return i}(s,t,e,l,a),i=L5(o,t,e).getContext("2d");return i.putImageData(r,0,0),i}Yy=(t,e)=>{const{gradient:u,opacity:h,maxOpacity:f,minOpacity:d,blur:p,useGradientOpacity:g}=t,y=at(t,["gradient","opacity","maxOpacity","minOpacity","blur","useGradientOpacity"]),{coordinate:m,createCanvas:v,document:b}=e;return(t,e,n)=>{var r,i,e=e["transform"],[a,o]=m.getSize(),s=t.map(t=>({x:t[0],y:t[1],value:t[2],radius:t[3]})),l=Yd(t,t=>t[2]),t=Hd(t,t=>t[2]),c={gradient:u,opacity:h,minOpacity:d,maxOpacity:f,blur:p,useGradientOpacity:g},l=a&&o?j5(a,o,l,t,s,(r=c,i=t=>void 0===t,Object.keys(r).reduce((t,e)=>{var n=r[e];return i(n,e)||(t[e]=n),t},{})),v):{canvas:null};return lt(b.createElement("image",{})).call(L,n).style("x",0).style("y",0).style("width",a).style("height",o).style("src",l.canvas).style("transform",e).call(L,y).node()}},Yy.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},$y=t=>{const n=t["render"],r=at(t,["render"]);return t=>{var[[t,e]]=t;return n(Object.assign(Object.assign({},r),{x:t,y:e}))}};function R5(t,e){return t.getBandWidth(t.invert(e))}$y.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};vm={rect:Ys,hollow:o,funnel:Nx,pyramid:Js};const I5=()=>(t,e,n,i)=>{const{x:a,y:o,y1:s,series:l,size:r}=n,c=e.x,u=e.series,[h]=i.getSize(),f=r?r.map(t=>+t/h):null,d=r?(t,e,n)=>{t+=e/2,e=f[n];return[t-e/2,t+e/2]}:(t,e,n)=>[t,t+e];return[t,Array.from(t,t=>{var e=R5(c,a[t]),n=e*(u?R5(u,null===l||void 0===l?void 0:l[t]):1),e=(+(null===l||void 0===l?void 0:l[t])||0)*e,e=+a[t]+e,[e,n]=d(e,n,t),r=+o[t],t=+s[t];return[[e,r],[n,r],[n,t],[e,t]].map(t=>i.map(t))})]};I5.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:vm,channels:[...n5({shapes:Object.keys(vm)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...o5(),{type:_l},{type:Rl}],postInference:[...i5()],interaction:{shareTooltip:!0}};Iy={rect:Ys,hollow:o};const B5=()=>(t,e,n,r)=>{const{x:i,x1:a,y:o,y1:s}=n;return[t,Array.from(t,t=>{return[[+i[t],+o[t]],[+a[t],+o[t]],[+a[t],+s[t]],[+i[t],+s[t]]].map(t=>r.map(t))})]};B5.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:Iy,channels:[...n5({shapes:Object.keys(Iy)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...o5(),{type:_l}],postInference:[...i5()],interaction:{shareTooltip:!0}};By={line:_o,smooth:Ro,hv:No,vh:qo,hvh:zo,trail:Ko};const D5=(t,e,n,r)=>{var i;const{series:a,x:o,y:s}=n;var{x:n,y:e}=e;if(void 0===o||void 0===s)throw new Error("Missing encode for x or y channel.");var t=a?Array.from(Sd(t,t=>a[t]).values()):[t],l=t.map(t=>t[0]).filter(t=>void 0!==t);const c=((null==(i=null==n?void 0:n.getBandWidth)?void 0:i.call(n))||0)/2,u=((null==(i=null==e?void 0:e.getBandWidth)?void 0:i.call(e))||0)/2;return[l,Array.from(t,t=>t.map(t=>r.map([+o[t]+c,+s[t]+u]))),t]},F5=(t,e,n,i)=>{const a=Object.entries(n).filter(([t])=>t.startsWith("position")).map(([,t])=>t);if(0===a.length)throw new Error("Missing encode for position channel.");return[t,Array.from(t,e=>{var t=a.map(t=>+t[e]),n=i.map(t),r=[];for(let t=0;t<n.length;t+=2)r.push([n[t],n[t+1]]);return r})]},z5=()=>(t,e,n,r)=>{return(sv(r)?F5:D5)(t,e,n,r)};z5.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:By,channels:[...n5({shapes:Object.keys(By)}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"identity"}],preInference:[...o5(),{type:e},{type:el}],postInference:[...i5(),{type:xb,channel:"color"},{type:Mb,channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};mm={hollow:Zy,hollowDiamond:Xy,hollowHexagon:Qy,hollowSquare:tm,hollowTriangleDown:nm,hollowTriangle:Jy,hollowBowtie:Ky,point:lm,plus:sm,diamond:rm,square:cm,triangle:gm,hexagon:om,cross:im,bowtie:em,hyphen:am,line:Co,tick:So,triangleDown:ym};const W5=g=>(t,e,n,o)=>{const{x:r,y:i,x1:a,y1:s,size:l,dx:c,dy:u}=n,[h,f]=o.getSize(),d=l5(e,n,g),p=t=>{var e=+((null===c||void 0===c?void 0:c[t])||0),n=+((null===u||void 0===u?void 0:u[t])||0);return[(a?(+r[t]+ +a[t])/2:+r[t])+e,(s?(+i[t]+ +s[t])/2:+i[t])+n]};return[t,l?Array.from(t,t=>{var[e,n]=p(t),r=+l[t],i=r/h,r=r/f,a=[e-i,n-r],e=[e+i,n+r];return[o.map(d(a,t)),o.map(d(e,t))]}):Array.from(t,t=>[o.map(d(p(t),t))])]};W5.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,shape:mm,channels:[...n5({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:[...o5(),{type:Rl},{type:zl}],postInference:[{type:Hs},...r5()]};Uy={text:Ws,badge:Wy};const G5=s=>{var{cartesian:t=!1}=s;return t?u5:(t,e,n,r)=>{const{x:i,y:a}=n,o=l5(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}};G5.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,shape:Uy,channels:[...n5({shapes:Object.keys(Uy)}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize"},{name:"rotate"}],preInference:[...o5(),{type:ii},{type:fn}],postInference:[...r5()]};Js={cell:Ys,hollow:o};const H5=()=>(t,e,n,i)=>{const{x:a,y:o}=n,s=e.x,l=e.y;return[t,Array.from(t,t=>{var e=s.getBandWidth(s.invert(+a[t])),n=l.getBandWidth(l.invert(+o[t])),r=+a[t],t=+o[t];return[[r,t],[r+e,t],[r+e,t+n],[r,t+n]].map(t=>i.map(t))})]};H5.props={defaultShape:"cell",defaultLabelShape:"label",shape:Js,composite:!1,channels:[...n5({shapes:Object.keys(Js)}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...o5(),{type:Rl},{type:zl},{type:ol}],postInference:[...r5()]};vm={area:rl,smooth:uu,hvh:Ss,vh:n,hv:es};const V5=()=>(t,e,n,a)=>{var r;const{x:o,y:s,y1:l,series:i}=n;var{x:n,y:e}=e,t=i?Array.from(Sd(t,t=>i[t]).values()):[t],c=t.map(t=>t[0]).filter(t=>void 0!==t);const u=((null==(r=null==n?void 0:n.getBandWidth)?void 0:r.call(n))||0)/2,h=((null==(r=null==e?void 0:e.getBandWidth)?void 0:r.call(e))||0)/2;return[c,Array.from(t,e=>{var n=e.length,r=new Array(2*n);for(let t=0;t<e.length;t++){var i=e[t];r[t]=a.map([+o[i]+u,+s[i]+h]),r[n+t]=a.map([+o[i]+u,+l[i]+h])}return r}),t]};V5.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,shape:vm,channels:[...n5({shapes:Object.keys(vm)}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"identity"}],preInference:[...o5(),{type:el},{type:_l},{type:ol}],postInference:[...i5()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};Iy={link:rs,arc:qy,smooth:zs,vhv:Ol};const Y5=c=>(t,e,n,r)=>{const{x:i,y:a,x1:o=i,y1:s=a}=n,l=l5(e,n,c);e=t.map(t=>[r.map(l([+i[t],+a[t]],t)),r.map(l([+o[t],+s[t]],t))]);return[t,e]};Y5.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,shape:Iy,channels:[...n5({shapes:Object.keys(Iy)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...o5(),{type:Zs},{type:Xs}],postInference:[...r5()]};_o={image:Gy};const q5=s=>{var t=s["cartesian"];return t?u5:(t,e,n,r)=>{const{x:i,y:a}=n,o=l5(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}};q5.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,shape:_o,channels:[...n5({shapes:Object.keys(_o)}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...o5(),{type:ii},{type:fn}],postInference:[...r5()]};Ro={polygon:Dy,ribbon:Fy};const $5=()=>(t,e,n,a)=>{const o=Object.entries(n).filter(([t])=>t.startsWith("x")).map(([,t])=>t),s=Object.entries(n).filter(([t])=>t.startsWith("y")).map(([,t])=>t);n=t.map(e=>{var n=[];for(let t=0;t<o.length;t++){var r=o[t][e];if(void 0===r)break;var i=s[t][e];n.push(a.map([+r,+i]))}return n});return[t,n]};$5.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,shape:Ro,channels:[...n5({shapes:Object.keys(Ro)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...o5()],postInference:[...r5()]};No={box:Uo,violin:as};const U5=()=>(t,e,n,s)=>{const{x:l,y:c,y1:u,y2:h,y3:f,y4:d,series:p}=n,g=e.x,y=e.series;return[t,Array.from(t,t=>{var e=g.getBandWidth(g.invert(+l[t])),n=e*(y?y.getBandWidth(y.invert(+(null===p||void 0===p?void 0:p[t]))):1),e=(+(null===p||void 0===p?void 0:p[t])||0)*e,e=+l[t]+e+n/2,[t,r,i,a,o]=[+c[t],+u[t],+h[t],+f[t],+d[t]];return[[e-n/2,o],[e+n/2,o],[e,o],[e,a],[e-n/2,a],[e+n/2,a],[e+n/2,r],[e-n/2,r],[e-n/2,i],[e+n/2,i],[e,r],[e,t],[e-n/2,t],[e+n/2,t]].map(t=>s.map(t))})]};U5.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,shape:No,channels:[...n5({shapes:Object.keys(No)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...o5(),{type:Rl}],postInference:[...i5()],interaction:{shareTooltip:!0}};qo={vector:Fx};const X5=()=>(t,e,n,i)=>{const{x:a,y:o,size:s,rotate:l}=n,[c,u]=i.getSize();n=t.map(t=>{var e=+l[t]/180*Math.PI,n=+s[t],r=n/c,n=n/u,r=r*Math.cos(e),n=-n*Math.sin(e);return[i.map([+a[t]-r/2,+o[t]-n/2]),i.map([+a[t]+r/2,+o[t]+n/2])]});return[t,n]};X5.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,shape:qo,channels:[...n5({shapes:Object.keys(qo)}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...o5()],postInference:[...r5()]};zo={line:Hy};const K5=o=>(t,e,n,r)=>{const i=n["y"],a=l5(e,n,ot({style:{bandOffset:0}},o));return[t,Array.from(t,e=>{return[[0,i[e]],[1,i[e]]].map(t=>r.map(a(t,e)))})]};K5.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:zo,channels:[...a5({shapes:Object.keys(zo)}),{name:"y",required:!0}],preInference:[...o5(),{type:i}],postInference:[]};Ko={line:Hy};const Z5=o=>(t,e,n,r)=>{const i=n["x"],a=l5(e,n,ot({style:{bandOffset:0}},o));return[t,Array.from(t,e=>{return[[i[e],1],[i[e],0]].map(t=>r.map(a(t,e)))})]};Z5.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:Ko,channels:[...a5({shapes:Object.keys(Ko)}),{name:"x",required:!0}],preInference:[...o5(),{type:S}],postInference:[]};By={connector:Qo};const Q5=(...t)=>Y5(...t);function J5(t,e,n,r){if(e)return()=>[0,1];const{[t]:i,[t+"1"]:a}=n;return t=>{var e=(null==(e=r.getBandWidth)?void 0:e.call(r,r.invert(+a[t])))||0;return[i[t],a[t]+e]}}function tS(t={}){const{extendX:r=!1,extendY:s=!1}=t;return(t,e,n,i)=>{const a=J5("x",r,n,e.x),o=J5("y",s,n,e.y);return[t,Array.from(t,t=>{var[e,n]=a(t),[t,r]=o(t);return[[e,t],[n,t],[n,r],[e,r]].map(t=>i.map(t))})]}}Q5.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,shape:By,channels:[...a5({shapes:Object.keys(By)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...o5()],postInference:[]};e={range:Ys};const eS=()=>tS();eS.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:e,channels:[...a5({shapes:Object.keys(e)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...o5()],postInference:[]};Zy={range:Ys};const nS=()=>tS({extendY:!0});nS.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:Zy,channels:[...a5({shapes:Object.keys(Zy)}),{name:"x",required:!0}],preInference:[...o5()],postInference:[]};Xy={range:Ys};const rS=()=>tS({extendX:!0});function iS(t){return t.target.depth}function aS(t,e){return t.sourceLinks.length?t.depth:e-1}function oS(t){return function(){return t}}function sS(t,e){return cS(t.source,e.source)||t.index-e.index}function lS(t,e){return cS(t.target,e.target)||t.index-e.index}function cS(t,e){return t.y0-e.y0}function uS(t){return t.value}function hS(t){return t.index}function fS(t){return t.nodes}function dS(t){return t.links}function pS(t,e){t=t.get(e);if(t)return t;throw new Error("missing: "+e)}function gS({nodes:t}){for(const n of t){let t=n.y0,e=t;for(const r of n.sourceLinks)r.y0=t+r.width/2,t+=r.width;for(const i of n.targetLinks)i.y1=e+i.width/2,e+=i.width}}function yS(){let x=0,w=0,M=1,O=1,k=24,E=8,S,A=hS,_=aS,T,P,C,L=fS,N=dS,j=6;function e(e){e={nodes:L(e),links:N(e)};{var{nodes:i,links:t}=e;i.forEach((t,e)=>{t.index=e,t.sourceLinks=[],t.targetLinks=[]});const g=new Map(i.map(t=>[A(t),t]));if(t.forEach((t,e)=>{t.index=e;let{source:n,target:r}=t;"object"!=typeof n&&(n=t.source=pS(g,n)),"object"!=typeof r&&(r=t.target=pS(g,r)),n.sourceLinks.push(t),r.targetLinks.push(t)}),null!=C)for(var{sourceLinks:n,targetLinks:r}of i)n.sort(C),r.sort(C)}t=e.nodes;for(const y of t)y.value=void 0===y.fixedValue?Math.max(ep(y.sourceLinks,uS),ep(y.targetLinks,uS)):y.fixedValue;{var a=e.nodes,o=a.length;let t=new Set(a),n=new Set,r=0;for(;t.size;){if(t.forEach(t=>{t.depth=r;for(var{target:e}of t.sourceLinks)n.add(e)}),++r>o)throw new Error("circular link");t=n,n=new Set}if(T){var s,l=Math.max(Hd(a,t=>t.depth)+1,0);for(let t=0;t<a.length;t++)(s=a[t]).depth=T.call(null,s,l)}}{var c=(i=e.nodes).length;let t=new Set(i),n=new Set,r=0;for(;t.size;){if(t.forEach(t=>{t.height=r;for(var{source:e}of t.targetLinks)n.add(e)}),++r>c)throw new Error("circular link");t=n,n=new Set}}var u=function({nodes:t}){var e=Math.max(Hd(t,t=>t.depth)+1,0),n=(M-x-k)/(e-1),r=new Array(e).fill(0).map(()=>[]);for(const a of t){var i=Math.max(0,Math.min(e-1,Math.floor(_.call(null,a,e))));a.layer=i,a.x0=x+i*n,a.x1=a.x0+k,r[i]?r[i].push(a):r[i]=[a]}if(P)for(const o of r)o.sort(P);return r}(e),t=(S=Math.min(E,(O-w)/(Hd(u,t=>t.length)-1)),u),h=Yd(t,t=>(O-w-(t.length-1)*S)/ep(t,uS));for(const m of t){let e=w;for(const v of m){v.y0=e,v.y1=e+v.value*h,e=v.y1+S;for(const b of v.sourceLinks)b.width=b.value*h}e=(O-e+S)/(m.length+1);for(let t=0;t<m.length;++t){var f=m[t];f.y0+=e*(t+1),f.y1+=e*(t+1)}!function(t){if(void 0===C)for(var{sourceLinks:e,targetLinks:n}of t)e.sort(lS),n.sort(sS)}(m)}for(let t=0;t<j;++t){var d=Math.pow(.99,t),p=Math.max(1-d,(t+1)/j);!function(n,r,i){for(let t=n.length,e=t-2;0<=e;--e){var a,o=n[e];for(const c of o){let t=0,e=0;for(var{target:s,value:l}of c.sourceLinks){l=l*(s.layer-c.layer);t+=function(t,e){let n=e.y0-(e.targetLinks.length-1)*S/2;for(var{source:r,width:i}of e.targetLinks){if(r===t)break;n+=i+S}for(var{target:a,width:o}of t.sourceLinks){if(a===e)break;n-=o}return n}(c,s)*l,e+=l}0<e&&(a=(t/e-c.y0)*r,c.y0+=a,c.y1+=a,I(c))}void 0===P&&o.sort(cS),o.length&&R(o,i)}}(u,d,p),!function(n,r,i){for(let t=1,e=n.length;t<e;++t){var a,o=n[t];for(const c of o){let t=0,e=0;for(var{source:s,value:l}of c.targetLinks){l=l*(c.layer-s.layer);t+=function(t,e){let n=t.y0-(t.sourceLinks.length-1)*S/2;for(var{target:r,width:i}of t.sourceLinks){if(r===e)break;n+=i+S}for(var{source:a,width:o}of e.targetLinks){if(a===t)break;n-=o}return n}(s,c)*l,e+=l}0<e&&(a=(t/e-c.y0)*r,c.y0+=a,c.y1+=a,I(c))}void 0===P&&o.sort(cS),o.length&&R(o,i)}}(u,d,p)}return gS(e),e}function R(t,e){var n=t.length>>1,r=t[n];a(t,r.y0-S,n-1,e),i(t,r.y1+S,1+n,e),a(t,O,t.length-1,e),i(t,w,0,e)}function i(t,e,n,r){for(;n<t.length;++n){var i=t[n],a=(e-i.y0)*r;1e-6<a&&(i.y0+=a,i.y1+=a),e=i.y1+S}}function a(t,e,n,r){for(;0<=n;--n){var i=t[n],a=(i.y1-e)*r;1e-6<a&&(i.y0-=a,i.y1-=a),e=i.y0-S}}function I({sourceLinks:t,targetLinks:e}){if(void 0===C){for(const{source:{sourceLinks:t}}of e)t.sort(lS);for(const{target:{targetLinks:e}}of t)e.sort(sS)}}return e.update=function(t){return gS(t),t},e.nodeId=function(t){return arguments.length?(A="function"==typeof t?t:oS(t),e):A},e.nodeAlign=function(t){return arguments.length?(_="function"==typeof t?t:oS(t),e):_},e.nodeDepth=function(t){return arguments.length?(T=t,e):T},e.nodeSort=function(t){return arguments.length?(P=t,e):P},e.nodeWidth=function(t){return arguments.length?(k=+t,e):k},e.nodePadding=function(t){return arguments.length?(E=S=+t,e):E},e.nodes=function(t){return arguments.length?(L="function"==typeof t?t:oS(t),e):L},e.links=function(t){return arguments.length?(N="function"==typeof t?t:oS(t),e):N},e.linkSort=function(t){return arguments.length?(C=t,e):C},e.size=function(t){return arguments.length?(x=w=0,M=+t[0],O=+t[1],e):[M-x,O-w]},e.extent=function(t){return arguments.length?(x=+t[0][0],M=+t[1][0],w=+t[0][1],O=+t[1][1],e):[[x,w],[M,O]]},e.iterations=function(t){return arguments.length?(j=+t,e):j},e}rS.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:Xy,channels:[...a5({shapes:Object.keys(Xy)}),{name:"y",required:!0}],preInference:[...o5()],postInference:[]};const mS={nodeAlign:"justify",nodeWidth:.008,nodePadding:.03,nodes:t=>t.nodes,links:t=>t.links,nodeSort:void 0,linkSort:void 0,iterations:6},vS={left:function(t){return t.depth},right:function(t,e){return e-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?Yd(t.sourceLinks,iS)-1:0},justify:aS};const bS=h=>t=>{var{nodeId:e,nodeSort:n,nodeAlign:r,nodeWidth:i,nodePadding:a,nodeDepth:o,nodes:s,links:l,linkSort:c,iterations:u}=Object.assign({},mS,h),l=yS().nodeSort(n).linkSort(c).links(l).nodes(s).nodeWidth(i).nodePadding(a).nodeDepth(o).nodeAlign("string"==(c=typeof(n=r))?vS[n]||aS:"function"==c?n:aS).iterations(u).extent([[0,0],[1,1]]),s=("function"==typeof e&&l.nodeId(e),l(t)),{nodes:i,links:a}=s;return{nodes:i.map(t=>{var{x0:e,x1:n,y0:r,y1:i}=t;return Object.assign(Object.assign({},t),{x:[e,n,n,e],y:[r,r,i,i]})}),links:a.map(t=>{var{source:e,target:n}=t,e=e.x1,n=n.x0,r=t.width/2;return Object.assign(Object.assign({},t),{x:[e,e,n,n],y:[t.y0+r,t.y0-r,t.y1+r,t.y1-r]})})}},xS=(bS.props={},{nodeId:t=>t.key,nodeWidth:.02,nodePadding:.02}),wS={type:"polygon",axis:!1,legend:!1,encode:{shape:"polygon",x:"x",y:"y"},scale:{x:{type:"identity"},y:{type:"identity"}},style:{stroke:"#000"}},MS={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{fillOpacity:.5,stroke:void 0}},OS={textAlign:t=>t.x[0]<.5?"start":"end",position:t=>t.x[0]<.5?"right":"left",fontSize:10},kS=t=>{var{data:t,encode:e={},scale:n,style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={},tooltip:l={}}=t,{links:t,nodes:c}=d5(t,e),u=st(e,"node"),e=st(e,"link"),{key:h=t=>t.key,color:f=h}=u,{links:i,nodes:t}=bS(Object.assign(Object.assign(Object.assign({},xS),{nodeId:h5(h)}),i))({links:t,nodes:c});const d=st(r,"label"),{text:p=h,spacing:g=5}=d,y=at(d,["text","spacing"]),m=h5(h);c=yv(l,"node",{title:m,items:[{field:"value"}]},!0),h=yv(l,"link",{title:"",items:[t=>({name:"source",value:m(t.source)}),t=>({name:"target",value:m(t.target)})]});return[ot({},wS,{data:t,encode:Object.assign(Object.assign({},u),{color:f}),scale:n,style:st(r,"node"),labels:[Object.assign(Object.assign(Object.assign({},OS),{text:p,dx:t=>t.x[0]<.5?g:-g}),y),...a],tooltip:c,animate:bv(s,"node"),axis:!1}),ot({},MS,{data:i,encode:e,labels:o,style:Object.assign({fill:e.color?void 0:"#aaa",strokeWidth:0},st(r,"link")),tooltip:h,animate:bv(s,"link")})]};kS.props={};Qy={path:zy,hollow:$s};const ES=t=>(t,e,n,r)=>[t,t.map(()=>[[0,0]])];function SS(t,e,n){const r=n["value"];var o,i,a,s,l,c,u,h,f,d,n=function(t,e){var n={treemapBinary:QE,treemapDice:RE,treemapSlice:XE,treemapSliceDice:JE,treemapSquarify:ZE,treemapResquarify:t5};if(e="treemapSquarify"===t?n[t].ratio(e):n[t])return e;throw new TypeError("Invalid tile method!")}(e.tile,e.ratio),p=(t=t,p=e.path,(Array.isArray(t)?"function"==typeof p?WE().path(p):WE():sE)(t));function g(t){return t.x0=t.y0=0,t.x1=a,t.y1=s,t.eachBefore(y),l=[0],i&&t.eachBefore(jE),t}function y(t){var e=l[t.depth],n=t.x0+e,r=t.y0+e,i=t.x1-e,a=t.y1-e;i<n&&(n=i=(n+i)/2),a<r&&(r=a=(r+a)/2),t.x0=n,t.y0=r,t.x1=i,t.y1=a,t.children&&(e=l[t.depth+1]=c(t)/2,n+=d(t)-e,r+=u(t)-e,(i-=h(t)-e)<n&&(n=i=(n+i)/2),(a-=f(t)-e)<r&&(r=a=(r+a)/2),o(t,n,r,i,a))}return r?p.sum(t=>e.ignoreParentValue&&t.children?0:h5(r)(t)).sort(e.sort):p.count(),o=ZE,i=!1,s=a=1,l=[0],d=f=h=u=c=gE,g.round=function(t){return arguments.length?(i=!!t,g):i},g.size=function(t){return arguments.length?(a=+t[0],s=+t[1],g):[a,s]},g.tile=function(t){return arguments.length?(o=pE(t),g):o},g.padding=function(t){return arguments.length?g.paddingInner(t).paddingOuter(t):g.paddingInner()},g.paddingInner=function(t){return arguments.length?(c="function"==typeof t?t:yE(+t),g):c},g.paddingOuter=function(t){return arguments.length?g.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):g.paddingTop()},g.paddingTop=function(t){return arguments.length?(u="function"==typeof t?t:yE(+t),g):u},g.paddingRight=function(t){return arguments.length?(h="function"==typeof t?t:yE(+t),g):h},g.paddingBottom=function(t){return arguments.length?(f="function"==typeof t?t:yE(+t),g):f},g.paddingLeft=function(t){return arguments.length?(d="function"==typeof t?t:yE(+t),g):d},g.tile(n).size(e.size).round(e.round).paddingInner(e.paddingInner).paddingOuter(e.paddingOuter).paddingTop(e.paddingTop).paddingRight(e.paddingRight).paddingBottom(e.paddingBottom).paddingLeft(e.paddingLeft)(p),p.descendants().map(t=>Object.assign(t,{x:[t.x0,t.x1],y:[t.y0,t.y1]})).filter("function"==typeof e.layer?e.layer:t=>t.height===e.layer)}ES.props={defaultShape:"path",defaultLabelShape:"label",shape:Qy,composite:!1,channels:[...n5({shapes:Object.keys(Qy)}),{name:"d",scale:"identity"}],preInference:[...o5()],postInference:[]};const AS={fontSize:10,text:t=>t.data.name,position:"inside",fill:"#000",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>t.x1-t.x0},_S={title:t=>t.data.name,items:[{field:"value"}]},TS=(t,e)=>{var{width:e,height:n}=e,{data:r,encode:i={},scale:a,style:o={},layout:s={},labels:l=[],tooltip:c={}}=t,t=at(t,["data","encode","scale","style","layout","labels","tooltip"]),r=SS(r,ot({},(r=e,u=n,{tile:"treemapSquarify",ratio:.5*(1+Math.sqrt(5)),size:[r,u],round:!1,ignoreParentValue:!0,padding:0,paddingInner:0,paddingOuter:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,sort:(t,e)=>e.value-t.value,layer:0}),s),i),u=st(o,"label");return ot({},{type:"rect",axis:!1,encode:{x:"x",y:"y",color:t=>t.data.parent.name},scale:{x:{domain:[0,e],range:[0,1]},y:{domain:[0,n],range:[0,1]}},style:{stroke:"#fff"}},Object.assign(Object.assign({data:r,encode:i,scale:a,style:o,labels:[Object.assign(Object.assign({},AS),u),...l]},t),{tooltip:mv(c,_S),axis:!1}))},PS=(TS.props={},{text:"",position:"inside",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>2*t.r}),CS={title:t=>t.data.name,items:[{field:"value"}]},LS=(t,e)=>{var{width:e,height:n}=e,{data:r,encode:i={},scale:a={},style:o={},layout:s={},labels:l=[],tooltip:c={}}=t,t=at(t,["data","encode","scale","style","layout","labels","tooltip"]),u={type:"point",axis:!1,legend:!1,scale:{x:{domain:[0,e]},y:{domain:[0,n]},size:{type:"identity"}},encode:{x:"x",y:"y",size:"r",shape:"point"},style:{fill:i.color?void 0:t=>0===t.height?"#ddd":"#fff",stroke:i.color?void 0:t=>0===t.height?"":"#000"}},r=((t,e,n)=>{const r=n["value"];n=(Ne(t)?WE().path(e.path):sE)(t);return r?n.sum(t=>h5(r)(t)).sort(e.sort):n.count(),PE().size(e.size).padding(e.padding)(n),n.descendants()})(r,ot({},{size:[e,n],padding:0,sort:(t,e)=>e.value-t.value},s),ot({},u.encode,i)),e=st(o,"label");return ot({},u,Object.assign(Object.assign({data:r,encode:i,scale:a,style:o,labels:[Object.assign(Object.assign({},PS),e),...l]},t),{tooltip:mv(c,CS),axis:!1}))};function NS(t,e){return Yd(t,t=>e[t])}function jS(t,e){return Hd(t,t=>e[t])}function RS(t,e){const n=2.5*IS(t,e)-1.5*DS(t,e);return Yd(t,t=>e[t]>=n?e[t]:NaN)}function IS(t,e){return Xd(t,.25,t=>e[t])}function BS(t,e){return Xd(t,.5,t=>e[t])}function DS(t,e){return Xd(t,.75,t=>e[t])}function FS(t,e){const n=2.5*DS(t,e)-1.5*IS(t,e);return Hd(t,t=>e[t]<=n?e[t]:NaN)}function zS(){return(t,e)=>{var n=e["encode"],{y:n,x:r}=n;const i=n["value"],a=r["value"];return[Array.from(Sd(t,t=>a[+t]).values()).flatMap(t=>{const e=RS(t,i),n=FS(t,i);return t.filter(t=>i[t]<e||i[t]>n)}),e]}}LS.props={};const WS=t=>{var e,{data:n,encode:r,style:i={},tooltip:a={},animate:o}=t,t=at(t,["data","encode","style","tooltip","transform","animate"]),{point:s=!0}=i,i=at(i,["point"]),l=r["y"],l={y:l,y1:l,y2:l,y3:l,y4:l},c={y1:IS,y2:BS,y3:DS},u=yv(a,"box",{items:[{channel:"y",name:"min"},{channel:"y1",name:"q1"},{channel:"y2",name:"q2"},{channel:"y3",name:"q3"},{channel:"y4",name:"max"}]},!0),a=yv(a,"point",{title:{channel:"x"},items:[{name:"outlier",channel:"y"}]});return s?(s=st(i,"box"),e=st(i,"point"),[Object.assign({type:"box",data:n,transform:[Object.assign(Object.assign({type:"groupX",y:RS},c),{y4:FS})],encode:Object.assign(Object.assign({},r),l),style:s,tooltip:u,animate:bv(o,"box")},t),{type:"point",data:n,transform:[{type:zS}],encode:r,style:Object.assign({},e),tooltip:a,animate:bv(o,"point")}]):Object.assign({type:"box",data:n,transform:[Object.assign(Object.assign({type:"groupX",y:NS},c),{y4:jS})],encode:Object.assign(Object.assign({},r),l),style:i,tooltip:u},t)},GS=(WS.props={},s=>{var t=s["cartesian"];return t?u5:(t,e,n,r)=>{const{x:i,y:a}=n,o=l5(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}});function HS(t,e,n,r){if(!isNaN(e)&&!isNaN(n)){var i,a,o,s,l,c,u,h,f,d=t._root,p={data:r},g=t._x0,y=t._y0,m=t._x1,v=t._y1;if(d){for(;d.length;)if((c=e>=(a=(g+m)/2))?g=a:m=a,(u=n>=(o=(y+v)/2))?y=o:v=o,!(d=(i=d)[h=u<<1|c]))return i[h]=p,t;if(s=+t._x.call(null,d.data),l=+t._y.call(null,d.data),e===s&&n===l)p.next=d,i?i[h]=p:t._root=p;else{for(;i=i?i[h]=new Array(4):t._root=new Array(4),(c=e>=(a=(g+m)/2))?g=a:m=a,(u=n>=(o=(y+v)/2))?y=o:v=o,(h=u<<1|c)==(f=(o<=l)<<1|a<=s););i[f]=d,i[h]=p}}else t._root=p}return t}function VS(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function YS(t){return t[0]}function qS(t){return t[1]}function $S(t,e,n){e=new US(null==e?YS:e,null==n?qS:n,NaN,NaN,NaN,NaN);return null==t?e:e.addAll(t)}function US(t,e,n,r,i,a){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function XS(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}GS.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,shape:{shape:$y},channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...o5(),{type:ii},{type:fn},{type:Vo}]};tm=$S.prototype=US.prototype;function KS(t){return function(){return t}}function ZS(t){return 1e-6*(t()-.5)}function QS(t){return t.index}function JS(t,e){t=t.get(e);if(t)return t;throw new Error("node not found: "+e)}function t3(c){var u,h,a,o,f,d,s=QS,n=function(t){return 1/Math.min(o[t.source.index],o[t.target.index])},r=KS(30),p=1;function e(t){for(var e=0,n=c.length;e<p;++e)for(var r,i,a,o,s,l=0;l<n;++l)r=(i=c[l]).source,a=(i=i.target).x+i.vx-r.x-r.vx||ZS(d),o=i.y+i.vy-r.y-r.vy||ZS(d),a*=s=((s=Math.sqrt(a*a+o*o))-h[l])/s*t*u[l],o*=s,i.vx-=a*(s=f[l]),i.vy-=o*s,r.vx+=a*(s=1-s),r.vy+=o*s}function i(){if(a){var t,e=a.length,n=c.length,r=new Map(a.map((t,e)=>[s(t,e,a),t])),i=0;for(o=new Array(e);i<n;++i)(t=c[i]).index=i,"object"!=typeof t.source&&(t.source=JS(r,t.source)),"object"!=typeof t.target&&(t.target=JS(r,t.target)),o[t.source.index]=(o[t.source.index]||0)+1,o[t.target.index]=(o[t.target.index]||0)+1;for(i=0,f=new Array(n);i<n;++i)t=c[i],f[i]=o[t.source.index]/(o[t.source.index]+o[t.target.index]);u=new Array(n),l(),h=new Array(n),g()}}function l(){if(a)for(var t=0,e=c.length;t<e;++t)u[t]=+n(c[t],t,c)}function g(){if(a)for(var t=0,e=c.length;t<e;++t)h[t]=+r(c[t],t,c)}return null==c&&(c=[]),e.initialize=function(t,e){a=t,d=e,i()},e.links=function(t){return arguments.length?(c=t,i(),e):c},e.id=function(t){return arguments.length?(s=t,e):s},e.iterations=function(t){return arguments.length?(p=+t,e):p},e.strength=function(t){return arguments.length?(n="function"==typeof t?t:KS(+t),l(),e):n},e.distance=function(t){return arguments.length?(r="function"==typeof t?t:KS(+t),g(),e):r},e}tm.copy=function(){var t,e,n=new US(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(r)if(r.length)for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=XS(e));else n._root=XS(r);return n},tm.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return HS(this.cover(e,n),e,n,t)},tm.addAll=function(t){for(var e,n,r=t.length,i=new Array(r),a=new Array(r),o=1/0,s=1/0,l=-1/0,c=-1/0,u=0;u<r;++u)isNaN(e=+this._x.call(null,n=t[u]))||isNaN(n=+this._y.call(null,n))||((i[u]=e)<o&&(o=e),l<e&&(l=e),(a[u]=n)<s&&(s=n),c<n&&(c=n));if(!(l<o||c<s))for(this.cover(o,s).cover(l,c),u=0;u<r;++u)HS(this,i[u],a[u],t[u]);return this},tm.cover=function(t,e){if(!isNaN(t=+t)&&!isNaN(e=+e)){var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,a=(r=Math.floor(e))+1;else{for(var o,s,l=i-n||1,c=this._root;t<n||i<=t||e<r||a<=e;)switch(s=(e<r)<<1|t<n,(o=new Array(4))[s]=c,c=o,l*=2,s){case 0:i=n+l,a=r+l;break;case 1:n=i-l,a=r+l;break;case 2:i=n+l,r=a-l;break;case 3:n=i-l,r=a-l}this._root&&this._root.length&&(this._root=c)}this._x0=n,this._y0=r,this._x1=i,this._y1=a}return this},tm.data=function(){var e=[];return this.visit(function(t){if(!t.length)for(;e.push(t.data),t=t.next;);}),e},tm.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},tm.find=function(t,e,n){var r,i,a,o,s,l,c,u,h=this._x0,f=this._y0,d=this._x1,p=this._y1,g=[],y=this._root;for(y&&g.push(new VS(y,h,f,d,p)),null==n?n=1/0:(h=t-n,f=e-n,d=t+n,p=e+n,n*=n);r=g.pop();)!(y=r.node)||(s=r.x0)>d||(l=r.y0)>p||(o=r.x1)<h||(i=r.y1)<f||(y.length?(g.push(new VS(y[3],a=(s+o)/2,c=(l+i)/2,o,i),new VS(y[2],s,c,a,i),new VS(y[1],a,l,o,c),new VS(y[0],s,l,a,c)),(i=(c<=e)<<1|a<=t)&&(r=g[g.length-1],g[g.length-1]=g[g.length-1-i],g[g.length-1-i]=r)):(l=(o=t-+this._x.call(null,y.data))*o+(s=e-+this._y.call(null,y.data))*s)<n&&(h=t-(c=Math.sqrt(n=l)),f=e-c,d=t+c,p=e+c,u=y.data));return u},tm.remove=function(t){if(!isNaN(a=+this._x.call(null,t))&&!isNaN(o=+this._y.call(null,t))){var e,n,r,i,a,o,s,l,c,u,h,f=this._root,d=this._x0,p=this._y0,g=this._x1,y=this._y1;if(f){if(f.length)for(;;){if((l=a>=(s=(d+g)/2))?d=s:g=s,(c=o>=(s=(p+y)/2))?p=s:y=s,!(f=(e=f)[u=c<<1|l]))return this;if(!f.length)break;(e[u+1&3]||e[u+2&3]||e[u+3&3])&&(n=e,h=u)}for(;f.data!==t;)if(!(f=(r=f).next))return this;(i=f.next)&&delete f.next,r?i?r.next=i:delete r.next:e?(i?e[u]=i:delete e[u],(f=e[0]||e[1]||e[2]||e[3])&&f===(e[3]||e[2]||e[1]||e[0])&&!f.length&&(n?n[h]=f:this._root=f)):this._root=i}}return this},tm.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},tm.root=function(){return this._root},tm.size=function(){var e=0;return this.visit(function(t){if(!t.length)for(;++e,t=t.next;);}),e},tm.visit=function(t){var e,n,r,i,a,o,s,l=[],c=this._root;for(c&&l.push(new VS(c,this._x0,this._y0,this._x1,this._y1));a=l.pop();)!t(c=a.node,n=a.x0,r=a.y0,i=a.x1,a=a.y1)&&c.length&&(o=(n+i)/2,s=(r+a)/2,(e=c[3])&&l.push(new VS(e,o,s,i,a)),(e=c[2])&&l.push(new VS(e,n,s,o,a)),(e=c[1])&&l.push(new VS(e,o,r,i,s)),e=c[0])&&l.push(new VS(e,n,r,o,s));return this},tm.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new VS(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i,a,o,s,l,c,u,h=e.node;h.length&&(a=e.x0,o=e.y0,c=(a+(s=e.x1))/2,u=(o+(l=e.y1))/2,(i=h[0])&&n.push(new VS(i,a,o,c,u)),(i=h[1])&&n.push(new VS(i,c,o,s,u)),(i=h[2])&&n.push(new VS(i,a,u,c,l)),i=h[3])&&n.push(new VS(i,c,u,s,l)),r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},tm.x=function(t){return arguments.length?(this._x=t,this):this._x},tm.y=function(t){return arguments.length?(this._y=t,this):this._y};var e3={value:()=>{}};function n3(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new r3(r)}function r3(t){this._=t}function i3(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=e3,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}r3.prototype=n3.prototype={constructor:r3,on:function(t,e){var n,r,i=this._,a=(r=i,(t+"").trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");if(0<=n&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<s;)if(n=(t=a[o]).type)i[n]=i3(i[n],t.name,e);else if(null==e)for(n in i)i[n]=i3(i[n],t.name,null);return this}for(;++o<s;)if(n=(n=(t=a[o]).type)&&function(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}(i[n],t.name))return n},copy:function(){var t,e={},n=this._;for(t in n)e[t]=n[t].slice();return new r3(e)},call:function(t,e){if(0<(n=arguments.length-2))for(var n,r,i=new Array(n),a=0;a<n;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=0,n=(r=this._[t]).length;a<n;++a)r[a].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};var a3,o3,s3=0,l3=0,c3=0,u3=1e3,h3=0,f3=0,d3=0,p3="object"==typeof performance&&performance.now?performance:Date,g3="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function y3(){return f3||(g3(m3),f3=p3.now()+d3)}function m3(){f3=0}function v3(){this._call=this._time=this._next=null}function b3(t,e,n){var r=new v3;return r.restart(t,e,n),r}function x3(){f3=(h3=p3.now())+d3,s3=l3=0;try{y3(),++s3;for(var t,e=a3;e;)0<=(t=f3-e._time)&&e._call.call(void 0,t),e=e._next;--s3}finally{for(var n,r,i=a3,a=1/(s3=0);i;)i=i._call?(a>i._time&&(a=i._time),(n=i)._next):(r=i._next,i._next=null,n?n._next=r:a3=r);o3=n,M3(a),f3=0}}function w3(){var t=p3.now(),e=t-h3;u3<e&&(d3-=e,h3=t)}function M3(t){s3||(l3=l3&&clearTimeout(l3),24<t-f3?(t<1/0&&(l3=setTimeout(x3,t-p3.now()-d3)),c3=c3&&clearInterval(c3)):(c3||(h3=p3.now(),c3=setInterval(w3,u3)),s3=1,g3(x3)))}v3.prototype=b3.prototype={constructor:v3,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?y3():+n)+(null==e?0:+e),this._next||o3===this||(o3?o3._next=this:a3=this,o3=this),this._call=t,this._time=n,M3()},stop:function(){this._call&&(this._call=null,this._time=1/0,M3())}};const O3=4294967296;function k3(t){return t.x}function E3(t){return t.y}var S3=10,A3=Math.PI*(3-Math.sqrt(5));function _3(l){var a,o=1,e=.001,s=1-Math.pow(e,1/300),c=0,u=.6,h=new Map,t=b3(i),n=n3("tick","end"),r=function(){let t=1;return()=>(t=(1664525*t+1013904223)%O3)/O3}();function i(){f(),n.call("tick",a),o<e&&(t.stop(),n.call("end",a))}function f(t){var e,n,r=l.length;void 0===t&&(t=1);for(var i=0;i<t;++i)for(o+=(c-o)*s,h.forEach(function(t){t(o)}),e=0;e<r;++e)null==(n=l[e]).fx?n.x+=n.vx*=u:(n.x=n.fx,n.vx=0),null==n.fy?n.y+=n.vy*=u:(n.y=n.fy,n.vy=0);return a}function d(){for(var t,e,n,r=0,i=l.length;r<i;++r)(n=l[r]).index=r,null!=n.fx&&(n.x=n.fx),null!=n.fy&&(n.y=n.fy),(isNaN(n.x)||isNaN(n.y))&&(t=S3*Math.sqrt(.5+r),e=r*A3,n.x=t*Math.cos(e),n.y=t*Math.sin(e)),(isNaN(n.vx)||isNaN(n.vy))&&(n.vx=n.vy=0)}function p(t){return t.initialize&&t.initialize(l,r),t}return null==l&&(l=[]),d(),a={tick:f,restart:function(){return t.restart(i),a},stop:function(){return t.stop(),a},nodes:function(t){return arguments.length?(l=t,d(),h.forEach(p),a):l},alpha:function(t){return arguments.length?(o=+t,a):o},alphaMin:function(t){return arguments.length?(e=+t,a):e},alphaDecay:function(t){return arguments.length?(s=+t,a):+s},alphaTarget:function(t){return arguments.length?(c=+t,a):c},velocityDecay:function(t){return arguments.length?(u=1-t,a):1-u},randomSource:function(t){return arguments.length?(r=t,h.forEach(p),a):r},force:function(t,e){return 1<arguments.length?(null==e?h.delete(t):h.set(t,p(e)),a):h.get(t)},find:function(t,e,n){var r,i,a,o=0,s=l.length;for(null==n?n=1/0:n*=n,o=0;o<s;++o)(r=(r=t-(i=l[o]).x)*r+(r=e-i.y)*r)<n&&(a=i,n=r);return a},on:function(t,e){return 1<arguments.length?(n.on(t,e),a):n.on(t)}}}const T3={joint:!0},P3={type:"link",axis:!1,legend:!1,encode:{x:[t=>t.source.x,t=>t.target.x],y:[t=>t.source.y,t=>t.target.y]},style:{stroke:"#999",strokeOpacity:.6}},C3={type:"point",axis:!1,legend:!1,encode:{x:"x",y:"y",size:5,color:"group",shape:"point"},style:{stroke:"#fff"}},L3={text:""};function N3(t,e,n){var i,l,c,u,h,r,f,d,p,{nodes:t,links:a}=t,{joint:e,nodeStrength:o,linkStrength:s}=e,{linkKey:n=t=>t.id}=n,I=(r=KS(-30),d=(f=1)/0,p=.81,g.initialize=function(t,e){i=t,c=e,B()},g.strength=function(t){return arguments.length?(r="function"==typeof t?t:KS(+t),B(),g):r},g.distanceMin=function(t){return arguments.length?(f=t*t,g):Math.sqrt(f)},g.distanceMax=function(t){return arguments.length?(d=t*t,g):Math.sqrt(d)},g.theta=function(t){return arguments.length?(p=t*t,g):Math.sqrt(p)},g);function g(t){var e,n=i.length,r=$S(i,k3,E3).visitAfter(D);for(u=t,e=0;e<n;++e)l=i[e],r.visit(F)}function B(){if(i){var t,e,n=i.length;for(h=new Array(n),t=0;t<n;++t)e=i[t],h[e.index]=+r(e,t,i)}}function D(t){var e,n,r,i,a,o=0,s=0;if(t.length){for(r=i=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(o+=e.value,s+=n,r+=n*e.x,i+=n*e.y);t.x=r/s,t.y=i/s}else for((e=t).x=e.data.x,e.y=e.data.y;o+=h[e.data.index],e=e.next;);t.value=o}function F(t,e,n,r){if(!t.value)return!0;var i=t.x-l.x,a=t.y-l.y,o=r-e,s=i*i+a*a;if(o*o/p<s)return s<d&&(0===i&&(s+=(i=ZS(c))*i),0===a&&(s+=(a=ZS(c))*a),s<f&&(s=Math.sqrt(f*s)),l.vx+=i*t.value*u/s,l.vy+=a*t.value*u/s),!0;if(!(t.length||d<=s))for((t.data!==l||t.next)&&(0===i&&(s+=(i=ZS(c))*i),0===a&&(s+=(a=ZS(c))*a),s<f)&&(s=Math.sqrt(f*s));t.data!==l&&(o=h[t.data.index]*u/s,l.vx+=i*o,l.vy+=a*o),t=t.next;);}var y,m,v,b,x,w,M,O,k,E,S,A,_,T,n=t3(a).id(h5(n)),P=("function"==typeof o&&I.strength(o),"function"==typeof s&&n.strength(s),_3(t).force("link",n).force("charge",I));function C(t){for(var e,n=0,r=m.length;n<r;++n)(e=m[n]).vy+=(b[n]-e.y)*v[n]*t}function L(){if(m){var t,e=m.length;for(v=new Array(e),b=new Array(e),t=0;t<e;++t)v[t]=isNaN(b[t]=+y(m[t],t,m))?0:+x(m[t],t,m)}}function N(t){for(var e,n=0,r=M.length;n<r;++n)(e=M[n]).vx+=(k[n]-e.x)*O[n]*t}function j(){if(M){var t,e=M.length;for(O=new Array(e),k=new Array(e),t=0;t<e;++t)O[t]=isNaN(k[t]=+w(M[t],t,M))?0:+E(M[t],t,M)}}function R(){for(var t,e=_.length,n=0,r=0,i=0;i<e;++i)n+=(t=_[i]).x,r+=t.y;for(n=(n/e-S)*T,r=(r/e-A)*T,i=0;i<e;++i)(t=_[i]).x-=n,t.y-=r}e?P.force("center",(T=1,null==S&&(S=0),null==A&&(A=0),R.initialize=function(t){_=t},R.x=function(t){return arguments.length?(S=+t,R):S},R.y=function(t){return arguments.length?(A=+t,R):A},R.strength=function(t){return arguments.length?(T=+t,R):T},R)):P.force("x",(E=KS(.1),"function"!=typeof w&&(w=KS(null==w?0:+w)),N.initialize=function(t){M=t,j()},N.strength=function(t){return arguments.length?(E="function"==typeof t?t:KS(+t),j(),N):E},N.x=function(t){return arguments.length?(w="function"==typeof t?t:KS(+t),j(),N):w},N)).force("y",(x=KS(.1),"function"!=typeof y&&(y=KS(null==y?0:+y)),C.initialize=function(t){m=t,L()},C.strength=function(t){return arguments.length?(x="function"==typeof t?t:KS(+t),L(),C):x},C.y=function(t){return arguments.length?(y="function"==typeof t?t:KS(+t),L(),C):y},C)),P.stop();var z=Math.ceil(Math.log(P.alphaMin())/Math.log(1-P.alphaDecay()));for(let t=0;t<z;t++)P.tick();return{nodesData:t,linksData:a}}const j3=t=>{var{data:t,encode:e={},scale:n,style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={},tooltip:l={}}=t;const{nodeKey:c=t=>t.id,linkKey:u=t=>t.id}=e,h=at(e,["nodeKey","linkKey"]);var e=Object.assign({nodeKey:c,linkKey:u},h),f=st(e,"node"),d=st(e,"link"),{links:t,nodes:p}=d5(t,e),{nodesData:t,linksData:p}=N3({links:t,nodes:p},ot({},T3,i),e),i=yv(l,"link",{items:[t=>({name:"source",value:h5(u)(t.source)}),t=>({name:"target",value:h5(u)(t.target)})]}),e=yv(l,"node",{items:[t=>({name:"key",value:h5(c)(t)})]},!0);return[ot({},P3,{data:p,encode:d,labels:o,style:st(r,"link"),tooltip:i,animate:bv(s,"link")}),ot({},C3,{data:t,encode:Object.assign({},f),scale:n,style:st(r,"node"),tooltip:e,labels:[Object.assign(Object.assign({},L3),st(r,"label")),...a],animate:bv(s,"link")})]},R3=(j3.props={},h=>u=>t=>{const{field:e="value",nodeSize:n,separation:r,sortBy:i,as:a=["x","y"]}=u,[o,s]=a;var t=sE(t,t=>t.children).sum(t=>t[e]).sort(i),l=h();l.size([1,1]),n&&l.nodeSize(n),r&&l.separation(r),l(t);const c=[];t.each(t=>{t[o]=t.x,t[s]=t.y,t.name=t.data.name,c.push(t)});l=t.links();return l.forEach(t=>{t[o]=[t.source[o],t.target[o]],t[s]=[t.source[s],t.target[s]]}),{nodes:c,edges:l}}),I3=t=>R3(aE)(t),B3=(I3.props={},t=>R3(UE)(t)),D3=(B3.props={},{sortBy:(t,e)=>e.value-t.value}),F3={axis:!1,legend:!1,type:"point",encode:{x:"x",y:"y",size:2,shape:"point"}},z3={type:"link",encode:{x:"x",y:"y",shape:"smooth"}},W3={text:"",fontSize:10},G3=t=>{var{data:t,encode:e={},scale:n={},style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={},tooltip:l={}}=t,c=null==e?void 0:e.value,{nodes:i,edges:c}=B3(Object.assign(Object.assign(Object.assign({},D3),i),{field:c}))(t),t=yv(l,"node",{title:"name",items:["value"]},!0),l=yv(l,"link",{title:"",items:[t=>({name:"source",value:t.source.name}),t=>({name:"target",value:t.target.name})]});return[ot({},z3,{data:c,encode:st(e,"link"),scale:st(n,"link"),labels:o,style:Object.assign({stroke:"#999"},st(r,"link")),tooltip:l,animate:bv(s,"link")}),ot({},F3,{data:i,scale:st(n,"node"),encode:st(e,"node"),labels:[Object.assign(Object.assign({},W3),st(r,"label")),...a],style:Object.assign({},st(r,"node")),tooltip:t,animate:bv(s,"node")})]};G3.props={};var H3={},V3={},Y3=34,q3=10,$3=13;function U3(t){return new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'}).join(",")+"}")}function X3(t){var n=Object.create(null),r=[];return t.forEach(function(t){for(var e in t)e in n||r.push(n[e]=e)}),r}function K3(t,e){var t=t+"",n=t.length;return n<e?new Array(e-n+1).join(0)+t:t}function Z3(t){var e,n=t.getUTCHours(),r=t.getUTCMinutes(),i=t.getUTCSeconds(),a=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((e=t.getUTCFullYear())<0?"-"+K3(-e,6):9999<e?"+"+K3(e,6):K3(e,4))+"-"+K3(t.getUTCMonth()+1,2)+"-"+K3(t.getUTCDate(),2)+(a?"T"+K3(n,2)+":"+K3(r,2)+":"+K3(i,2)+"."+K3(a,3)+"Z":i?"T"+K3(n,2)+":"+K3(r,2)+":"+K3(i,2)+"Z":r||n?"T"+K3(n,2)+":"+K3(r,2)+"Z":"")}function Q3(r){var e=new RegExp('["'+r+"\n\r]"),h=r.charCodeAt(0);function n(r,t){var e,n=[],i=r.length,a=0,o=0,s=i<=0,l=!1;function c(){if(s)return V3;if(l)return l=!1,H3;var t,e,n=a;if(r.charCodeAt(n)===Y3){for(;a++<i&&r.charCodeAt(a)!==Y3||r.charCodeAt(++a)===Y3;);return(t=a)>=i?s=!0:(e=r.charCodeAt(a++))===q3?l=!0:e===$3&&(l=!0,r.charCodeAt(a)===q3)&&++a,r.slice(n+1,t-1).replace(/""/g,'"')}for(;a<i;){if((e=r.charCodeAt(t=a++))===q3)l=!0;else if(e===$3)l=!0,r.charCodeAt(a)===q3&&++a;else if(e!==h)continue;return r.slice(n,t)}return s=!0,r.slice(n,i)}for(r.charCodeAt(i-1)===q3&&--i,r.charCodeAt(i-1)===$3&&--i;(e=c())!==V3;){for(var u=[];e!==H3&&e!==V3;)u.push(e),e=c();t&&null==(u=t(u,o++))||n.push(u)}return n}function i(t,n){return t.map(function(e){return n.map(function(t){return o(e[t])}).join(r)})}function a(t){return t.map(o).join(r)}function o(t){return null==t?"":t instanceof Date?Z3(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,a){var o,s;return(t=n(t,function(t,e){if(o)return o(t,e-1);var n,r,i;s=t,o=a?(r=a,i=U3(n=t),function(t,e){return r(i(t),e,n)}):U3(t)})).columns=s||[],t},parseRows:n,format:function(t,e){return[(e=null==e?X3(t):e).map(o).join(r)].concat(i(t,e)).join("\n")},formatBody:function(t,e){return i(t,e=null==e?X3(t):e).join("\n")},formatRows:function(t){return t.map(a).join("\n")},formatRow:a,formatValue:o}}function J3(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;tA&&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 tA=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),eA=t=>{const{value:n,format:r=n.split(".").pop(),delimiter:i=",",autoType:a=!0}=t;return()=>X(void 0,void 0,void 0,function*(){var t,e=yield fetch(n);if("csv"===r)return t=yield e.text(),Q3(i).parse(t,a?J3:np);if("json"===r)return yield e.json();throw new Error(`Unknown format: ${r}.`)})};eA.props={};const nA=t=>{const{fields:n,key:r="key",value:i="value"}=t;return t=>{var e;return(e=n)&&0!==Object.keys(e).length?t.flatMap(e=>n.map(t=>Object.assign(Object.assign({},e),{[r]:t,[i]:e[t]}))):t}};nA.props={};const rA=t=>{const{callback:e=function(t){return null!=t&&!Number.isNaN(t)}}=t;return t=>t.filter(e)},iA=(rA.props={},t=>{const e=t["callback"];return t=>Array.isArray(t)?[...t].sort(e):t});iA.props={};const aA=t=>{const e=t["fields"];return t=>t.map(t=>{return[n,t=[]]=[t,e],t.reduce((t,e)=>(e in n&&(t[e]=n[e]),t),{});var n})};aA.props={};const oA=r=>t=>{return r&&0!==Object.keys(r).length?t.map(t=>Object.entries(t).reduce((t,[e,n])=>(t[r[e]||e]=n,t),{})):t};oA.props={};const sA=t=>{var r,{fields:t=[]}=t;r=!0;const e=t.map(t=>{var e,n;return Array.isArray(t)?([e,n=r]=t,[e,n]):[t,r]});return t=>{return[...t].sort((r,i)=>e.reduce((t,[e,n=!0])=>0!==t?t:n?r[e]<i[e]?-1:+(r[e]!==i[e]):r[e]>i[e]?-1:+(r[e]!==i[e]),0))}},lA=(sA.props={},t=>{const e=t["value"];return()=>e}),cA=(lA.props={},t=>{const{callback:e=np}=t;return t=>e(t)}),uA=(cA.props={},t=>{const{callback:e=np}=t;return t=>Array.isArray(t)?t.map(e):t});uA.props={};var hA=Object.freeze({__proto__:null,weight:function(t,e){return e.value-t.value},frequency:function(t,e){return e.frequency-t.frequency},id:function(t,e){return(""+t.id).localeCompare(""+e.id)},name:function(t,e){return(""+t.name).localeCompare(""+e.name)}});const fA={y:0,thickness:.05,weight:!1,marginRatio:.1,id:t=>t.id,source:t=>t.source,target:t=>t.target,sourceWeight:t=>t.value||1,targetWeight:t=>t.value||1,sortBy:null};function dA(t){const{y:c,thickness:u,weight:h,marginRatio:f,id:d,source:p,target:g,sourceWeight:y,targetWeight:m,sortBy:v}=Object.assign(Object.assign({},fA),t);return function(t){var e=t.nodes.map(t=>Object.assign({},t)),t=t.edges.map(t=>Object.assign({},t));{var n=e,r=t;r.forEach(t=>{t.source=p(t),t.target=g(t),t.sourceWeight=y(t),t.targetWeight=m(t)});const i=Sd(r,t=>t.source),a=Sd(r,t=>t.target);n.forEach(t=>{t.id=d(t);var e=i.has(t.id)?i.get(t.id):[],n=a.has(t.id)?a.get(t.id):[];t.frequency=e.length+n.length,t.value=ep(e,t=>t.sourceWeight)+ep(n,t=>t.targetWeight)})}if(r=e,(n="function"==typeof v?v:hA[v])&&r.sort(n),!(n=(r=e).length))throw ap("Invalid nodes: it's empty!");if(h){const o=f/(2*n),s=r.reduce((t,e)=>t+e.value,0);r.reduce((t,e)=>{e.weight=e.value/s,e.width=e.weight*(1-f),e.height=u;var n=o+t,r=n+e.width,i=c-u/2,a=i+u;return e.x=[n,r,r,n],e.y=[i,i,a,a],t+e.width+2*o},0)}else{const l=1/n;r.forEach((t,e)=>{t.x=(e+.5)*l,t.y=c})}return function(t,e){const r=new Map(t.map(t=>[t.id,t]));if(!h)return e.forEach(t=>{var e=p(t),n=g(t),e=r.get(e),n=r.get(n);e&&n&&(t.x=[e.x,n.x],t.y=[e.y,n.y])});e.forEach(t=>{t.x=[0,0,0,0],t.y=[c,c,c,c]});const s=Sd(e,t=>t.source),l=Sd(e,t=>t.target);t.forEach(n=>{const{width:r,value:i,id:t}=n;var e=s.get(t)||[],a=l.get(t)||[];let o=0;e.map(t=>{var e=t.sourceWeight/i*r;t.x[0]=n.x[0]+o,t.x[1]=n.x[0]+o+e,o+=e}),a.forEach(t=>{var e=t.targetWeight/i*r;t.x[3]=n.x[0]+o,t.x[2]=n.x[0]+o+e,o+=e})})}(e,t),{nodes:e,edges:t}}}const pA=e=>t=>dA(e)(t),gA=(pA.props={},Math.PI/180),yA=64,mA=2048;function vA(t){return t.text}function bA(){return"serif"}function xA(){return"normal"}function wA(t){return t.value}function MA(){return 90*~~(2*Math.random())}function OA(){return 1}function kA(){}function EA(t,o,r,s){if(!o.sprite){var l=t.context,c=t.ratio;l.clearRect(0,0,(yA<<5)/c,mA/c);let i=0,a=0,n=0;var u,h,f,d,e=r.length;for(--s;++s<e;){o=r[s],l.save(),l.font=o.style+" "+o.weight+" "+~~((o.size+1)/c)+"px "+o.font;let t=l.measureText(o.text+"m").width*c,e=o.size<<1;if(o.rotate?(d=Math.sin(o.rotate*gA),f=Math.cos(o.rotate*gA),u=t*f,h=t*d,f=e*f,d=e*d,t=Math.max(Math.abs(u+d),Math.abs(u-d))+31>>5<<5,e=~~Math.max(Math.abs(h+f),Math.abs(h-f))):t=t+31>>5<<5,e>n&&(n=e),i+t>=yA<<5&&(i=0,a+=n,n=0),a+e>=mA)break;l.translate((i+(t>>1))/c,(a+(e>>1))/c),o.rotate&&l.rotate(o.rotate*gA),l.fillText(o.text,0,0),o.padding&&(l.lineWidth=2*o.padding,l.strokeText(o.text,0,0)),l.restore(),o.width=t,o.height=e,o.xoff=i,o.yoff=a,o.x1=t>>1,o.y1=e>>1,o.x0=-o.x1,o.y0=-o.y1,o.hasText=!0,i+=t}for(var p=l.getImageData(0,0,(yA<<5)/c,mA/c).data,g=[];0<=--s;)if((o=r[s]).hasText){var y=o.width,m=y>>5;let n=o.y1-o.y0;for(let t=0;t<n*m;t++)g[t]=0;if(null==(i=o.xoff))return;a=o.yoff;let r=0,t=-1;for(let e=0;e<n;e++){for(let t=0;t<y;t++){var v=m*e+(t>>5),b=p[(a+e)*(yA<<5)+(i+t)<<2]?1<<31-t%32:0;g[v]|=b,r|=b}r?t=e:(o.y0++,n--,e--,a++)}o.y1=o.y0+t,o.sprite=g.slice(0,(o.y1-o.y0)*m)}}}function SA(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function AA(t){var e=[];let n=-1;for(;++n<t;)e[n]=0;return e}function _A(){return document.createElement("canvas")}function TA(t){return"function"==typeof t?t:function(){return t}}const PA={archimedean:SA,rectangular:function(t){const n=4*t[0]/t[1];let r=0,i=0;return function(t){var e=t<0?-1:1;switch(Math.sqrt(1+4*e*t)-e&3){case 0:r+=n;break;case 1:i+=4;break;case 2:r-=n;break;default:i-=4}return[r,i]}}};function CA(){let b=[256,256],r=vA,i=bA,p=wA,g=xA,y=MA,m=OA,x=SA,w=Math.random,v=kA,M=[],O=null,k=1/0;const E=xA,S=_A,A={};return A.start=function(){const[a,o]=b,s=((t=S()).width=t.height=1,e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2),t.width=(yA<<5)/e,t.height=mA/e,(t=t.getContext("2d")).fillStyle=t.strokeStyle="red",t.textAlign="center",{context:t,ratio:e}),l=A.board||AA((b[0]>>5)*b[1]),c=M.length,u=[],h=M.map(function(t,e,n){return t.text=r.call(this,t,e,n),t.font=i.call(this,t,e,n),t.style=E.call(this,t,e,n),t.weight=g.call(this,t,e,n),t.rotate=y.call(this,t,e,n),t.size=~~p.call(this,t,e,n),t.padding=m.call(this,t,e,n),t}).sort(function(t,e){return e.size-t.size});var t,e;let f=-1,d=A.board?[{x:0,y:0},{x:a,y:o}]:void 0;function n(){for(var t,e,n,r=Date.now();Date.now()-r<k&&++f<c;){var i=h[f];i.x=a*(w()+.5)>>1,i.y=o*(w()+.5)>>1,EA(s,i,h,f),i.hasText&&function(i,t,e){var n=t.x,r=t.y,a=Math.sqrt(b[0]*b[0]+b[1]*b[1]),o=x(b),s=w()<.5?1:-1;let l,c=-s,u,h;for(;(l=o(c+=s))&&(u=~~l[0],h=~~l[1],!(Math.min(Math.abs(u),Math.abs(h))>=a));)if(t.x=n+u,t.y=r+h,!(t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>b[0]||t.y+t.y1>b[1])&&(!e||!function(t,n,r){var i=t.sprite,a=t.width>>5,e=t.x-(a<<4),o=127&e,s=32-o,l=t.y1-t.y0;let c=(t.y+t.y0)*(r>>=5)+(e>>5),u;for(let e=0;e<l;e++){for(let t=u=0;t<=a;t++)if((u<<s|(t<a?(u=i[e*a+t])>>>o:0))&n[c+t])return 1;c+=r}}(t,i,b[0]))&&(!e||function(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}(t,e))){var f=t.sprite,d=t.width>>5,p=b[0]>>5,g=t.x-(d<<4),y=127&g,m=32-y,v=t.y1-t.y0;let n,r=(t.y+t.y0)*p+(g>>5);for(let e=0;e<v;e++){for(let t=n=0;t<=d;t++)i[r+t]|=n<<m|(t<d?(n=f[e*d+t])>>>y:0);r+=p}return delete t.sprite,1}return}(l,i,d)&&(v.call(null,"word",{cloud:A,word:i}),u.push(i),d?A.hasImage||(t=d,e=i,n=void 0,n=t[0],t=t[1],e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>t.x&&(t.x=e.x+e.x1),e.y+e.y1>t.y&&(t.y=e.y+e.y1)):d=[{x:i.x+i.x0,y:i.y+i.y0},{x:i.x+i.x1,y:i.y+i.y1}],i.x-=b[0]>>1,i.y-=b[1]>>1)}A._tags=u,A._bounds=d,f>=c&&(A.stop(),v.call(null,"end",{cloud:A,words:u,bounds:d}))}return O&&clearInterval(O),O=setInterval(n,0),n(),A},A.stop=function(){return O&&(clearInterval(O),O=null),A},A.createMask=t=>{var e=document.createElement("canvas"),[n,r]=b;if(n&&r){var i=n>>5,a=AA((n>>5)*r),e=(e.width=n,e.height=r,e.getContext("2d")),o=(e.drawImage(t,0,0,t.width,t.height,0,0,n,r),e.getImageData(0,0,n,r).data);for(let e=0;e<r;e++)for(let t=0;t<n;t++){var s=i*e+(t>>5),l=e*n+t<<2,l=250<=o[l]&&250<=o[1+l]&&250<=o[2+l]?1<<31-t%32:0;a[s]|=l}A.board=a,A.hasImage=!0}},A.timeInterval=function(t){k=null==t?1/0:t},A.words=function(t){M=t},A.size=function(t=[]){b=[+t[0],+t[1]]},A.text=function(t){r=TA(t)},A.font=function(t){i=TA(t)},A.fontWeight=function(t){g=TA(t)},A.rotate=function(t){y=TA(t)},A.spiral=function(t){x=PA[t]||t},A.fontSize=function(t){p=TA(t)},A.padding=function(t){m=TA(t)},A.random=function(t){w=TA(t)},A.on=function(t){v=TA(t)},A}const LA={size:[500,500],fontSize:[14,28]};function NA(r){return new Promise((t,e)=>{if(r instanceof HTMLImageElement)t(r);else if("string"==typeof r){const n=new Image;n.crossOrigin="anonymous",n.src=r,n.onload=()=>t(n),void(n.onerror=()=>{console.error(`'image ${r} load failed !!!'`),e()})}else e()})}const jA=f=>h=>X(void 0,void 0,void 0,function*(){var i,a,t=Object.assign({},LA,f),e=CA(),e=(i=e,a=t,yield{set(t,e,n){return void 0!==a[t]&&(e=e?e.call(null,a[t]):a[t],n?n.call(null,e):"function"==typeof i[t]?i[t](e):i[t]=e),this},setAsync(e,n,r){return X(this,void 0,void 0,function*(){var t;return void 0!==a[e]&&(t=n?yield n.call(null,a[e]):a[e],r?r.call(null,t):"function"==typeof i[e]?i[e](t):i[e]=t),this})}}.set("fontSize",t=>{var e=h.map(t=>t.value),n=t,t=[Yd(e),Hd(e)];if("function"==typeof n)return n;if(Array.isArray(n)){const[r,i]=n;if(!t)return()=>(i+r)/2;const[a,o]=t;return o===a?()=>(i+r)/2:({value:t})=>(i-r)/(o-a)*(t-a)+r}return()=>n}).set("font").set("fontStyle").set("fontWeight").set("padding").set("rotate").set("size").set("spiral").set("timeInterval").set("random").set("text").set("on").setAsync("imageMask",NA,e.createMask),e.words([...h]),e.start());const[r,o]=t.size;var t=[{x:0,y:0},{x:r,y:o}],{_bounds:e=t,_tags:t,hasImage:n}=e,t=t.map(t=>{var{x:e,y:n}=t,t=at(t,["x","y"]);return Object.assign(Object.assign({},t),{x:e+r/2,y:n+o/2})}),[{x:e,y:s},{x:l,y:c}]=e,u={text:"",value:0,opacity:0,fontSize:0};return t.push(Object.assign(Object.assign({},u),{x:n?0:e,y:n?0:s}),Object.assign(Object.assign({},u),{x:n?r:l,y:n?o:c})),t});function RA(e){return"string"==typeof e?t=>t[e]:e}jA.props={};const IA=t=>{const{join:e,on:n,select:i=[],as:a=i,unknown:o=NaN}=t;var[t,r]=n;const s=RA(r),l=RA(t),c=_d(e,([t])=>t,t=>s(t));return t=>t.map(t=>{const r=c.get(l(t));return Object.assign(Object.assign({},t),i.reduce((t,e,n)=>(t[a[n]]=r?r[e]:o,t),{}))})},BA=(IA.props={},t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)});BA.props={};var DA,FA,zA,WA,nm={exports:{}},Jy={exports:{}};function GA(t){return 1-Math.abs(t)}DA=(Ky=Jy).exports,Ky.exports.isNumber=function(t){return"number"==typeof t},Ky.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},Ky.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},Ky.exports.findMinMulti=function(t){for(var e=DA.findMin(t[0]),n=1;n<t.length;n++)e=Math.min(e,DA.findMin(t[n]));return e},Ky.exports.findMaxMulti=function(t){for(var e=DA.findMax(t[0]),n=1;n<t.length;n++)e=Math.max(e,DA.findMax(t[n]));return e},Ky.exports.inside=function(t,e,n){return t<=n&&n<=e},lm=nm,FA=Math.log(2),zA=lm.exports,WA=Jy.exports,lm.exports.getUnifiedMinMax=function(t,e){return zA.getUnifiedMinMaxMulti([t],e)},lm.exports.getUnifiedMinMaxMulti=function(t,e){var n=!1,r=!1,i=WA.isNumber((e=e||{}).width)?e.width:2,a=WA.isNumber(e.size)?e.size:50,o=WA.isNumber(e.min)?e.min:(n=!0,WA.findMinMulti(t)),e=WA.isNumber(e.max)?e.max:(r=!0,WA.findMaxMulti(t)),t=(e-o)/(a-1);return n&&(o-=2*i*t),r&&(e+=2*i*t),{min:o,max:e}},lm.exports.create=function(t,e){if(!t||0===t.length)return[];var n=WA.isNumber((e=e||{}).size)?e.size:50,o=WA.isNumber(e.width)?e.width:2,e=zA.getUnifiedMinMax(t,{size:n,width:o,min:e.min,max:e.max}),s=e.min,e=e.max-s,l=e/(n-1);if(0==e)return[{x:s,y:1}];for(var c=[],r=0;r<n;r++)c.push({x:s+r*l,y:0});var u=function(t,e){for(var n={},r=0,i=-e;i<=e;i++)r+=t(i/e),n[i]=r;return n}(GA,o),h=u[o],f=u[o-1]-u[o-2],d=0,i=(t.forEach(function(t){var e,n,r,i,a,t=Math.floor((t-s)/l);t+o<0||c.length<=t-o||(r=Math.max(t-o,0),e=t,n=Math.min(t+o,c.length-1),i=u[-o-1+(r=r-(t-o))]||0,a=u[-o-1+(t+o-n)]||0,i=h/(h-i-a),0<r&&(d+=i*(r-1)*f),a=Math.max(0,t-o+1),WA.inside(0,c.length-1,a)&&(c[a].y+=i*f),WA.inside(0,c.length-1,e+1)&&(c[e+1].y-=2*i*f),WA.inside(0,c.length-1,n+1)&&(c[n+1].y+=i*f))}),d),a=0,p=0;return c.forEach(function(t){a+=t.y,i+=a,t.y=i,p+=i}),0<p&&c.forEach(function(t){t.y/=p}),c},lm.exports.getExpectedValueFromPdf=function(t){var e;if(t&&0!==t.length)return e=0,t.forEach(function(t){e+=t.x*t.y}),e},lm.exports.getXWithLeftTailArea=function(t,e){if(t&&0!==t.length){for(var n=0,r=0,i=0;i<t.length&&!(e<=(n+=t[r=i].y));i++);return t[r].x}},lm.exports.getPerplexity=function(t){var n;if(t&&0!==t.length)return n=0,t.forEach(function(t){var e=Math.log(t.y);isFinite(e)&&(n+=t.y*e)}),n=-n/FA,Math.pow(2,n)};var HA=nm.exports;const VA=t=>{const{field:r,groupBy:n,as:e=["y","size"],min:i,max:a,size:o=10,width:s}=t,[l,c]=e;return t=>{return Array.from(Sd(t,e=>n.map(t=>e[t]).join("-")).values()).map(t=>{var e=HA.create(t.map(t=>t[r]),{min:i,max:a,size:o,width:s}),n=e.map(t=>t.x),e=e.map(t=>t.y);return Object.assign(Object.assign({},t[0]),{[l]:n,[c]:e})})}};VA.props={};var YA={exports:{}};function qA(t){for(var e=new Array(t),n=0;n<t;++n)e[n]=0;return e}function $A(t,e){for(var n=0,r=0;r<t.length;++r)n+=t[r]*e[r];return n}function UA(t){return Math.sqrt($A(t,t))}function XA(t,e,n){for(var r=0;r<e.length;++r)t[r]=e[r]*n}function KA(t,e,n,r,i){for(var a=0;a<t.length;++a)t[a]=e*n[a]+r*i[a]}function ZA(i,a,o,s,l,c,u){var h=o.fx,f=$A(o.fxprime,a),d=h,t=h,p=f,e=0;function n(t,e,n){for(var r=0;r<16;++r)if(l=(t+e)/2,KA(s.x,1,o.x,l,a),d=s.fx=i(s.x,s.fxprime),p=$A(s.fxprime,a),h+c*l*f<d||n<=d)e=l;else{if(Math.abs(p)<=-u*f)return l;0<=p*(e-t)&&(e=t),t=l,n=d}return 0}l=l||1,c=c||1e-6,u=u||.1;for(var r=0;r<10;++r){if(KA(s.x,1,o.x,l,a),d=s.fx=i(s.x,s.fxprime),p=$A(s.fxprime,a),h+c*l*f<d||r&&t<=d)return n(e,l,t);if(Math.abs(p)<=-u*f)return l;if(0<=p)return n(l,e,d);t=d,e=l,l*=2}return l}(sm=sm=YA.exports).bisect=function(t,e,n,r){var i=(r=r||{}).maxIterations||100,a=r.tolerance||1e-10,o=t(e),r=t(n),s=n-e;if(0<o*r)throw"Initial bisect points must have opposite signs";if(0===o)return e;if(0===r)return n;for(var l=0;l<i;++l){var c=e+(s/=2),u=t(c);if(0<=u*o&&(e=c),Math.abs(s)<a||0===u)return c}return e+s},sm.nelderMead=function(t,e,n){var r,i=(n=n||{}).maxIterations||200*e.length,a=n.nonZeroDelta||1.05,o=n.zeroDelta||.001,s=n.minErrorDelta||1e-6,l=n.minErrorDelta||1e-5,c=void 0!==n.rho?n.rho:1,u=void 0!==n.chi?n.chi:2,h=void 0!==n.psi?n.psi:-.5,f=void 0!==n.sigma?n.sigma:.5,d=e.length,p=new Array(d+1);p[0]=e,p[0].fx=t(e);for(var g=p[0].id=0;g<d;++g){var y=e.slice();y[g]=y[g]?y[g]*a:o,p[g+1]=y,p[g+1].fx=t(y),p[g+1].id=g+1}function m(t){for(var e=0;e<t.length;e++)p[d][e]=t[e];p[d].fx=t.fx}for(var v=function(t,e){return t.fx-e.fx},b=e.slice(),x=e.slice(),w=e.slice(),M=e.slice(),O=0;O<i;++O){for(p.sort(v),n.history&&((E=p.map(function(t){var e=t.slice();return e.fx=t.fx,e.id=t.id,e})).sort(function(t,e){return t.id-e.id}),n.history.push({x:p[0].slice(),fx:p[0].fx,simplex:E})),g=r=0;g<d;++g)r=Math.max(r,Math.abs(p[0][g]-p[1][g]));if(Math.abs(p[0].fx-p[d].fx)<s&&r<l)break;for(g=0;g<d;++g){for(var k=b[g]=0;k<d;++k)b[g]+=p[k][g];b[g]/=d}var E=p[d];if(KA(x,1+c,b,-c,E),x.fx=t(x),x.fx<p[0].fx)KA(M,1+u,b,-u,E),M.fx=t(M),M.fx<x.fx?m(M):m(x);else if(x.fx>=p[d-1].fx){var S=!1;if(x.fx>E.fx?(KA(w,1+h,b,-h,E),w.fx=t(w),w.fx<E.fx?m(w):S=!0):(KA(w,1-h*c,b,h*c,E),w.fx=t(w),w.fx<x.fx?m(w):S=!0),S){if(1<=f)break;for(g=1;g<p.length;++g)KA(p[g],1-f,p[0],f,p[g]),p[g].fx=t(p[g])}}else m(x)}return p.sort(v),{fx:p[0].fx,x:p[0]}},sm.conjugateGradient=function(t,e,n){var r,i,a={x:e.slice(),fx:0,fxprime:e.slice()},o={x:e.slice(),fx:0,fxprime:e.slice()},s=e.slice(),l=1;i=(n=n||{}).maxIterations||20*e.length,a.fx=t(a.x,a.fxprime),XA(r=a.fxprime.slice(),a.fxprime,-1);for(var c=0;c<i;++c){var u;if(l=ZA(t,r,a,o,l),n.history&&n.history.push({x:a.x.slice(),fx:a.fx,fxprime:a.fxprime.slice(),alpha:l}),l?(KA(s,1,o.fxprime,-1,a.fxprime),u=$A(a.fxprime,a.fxprime),u=Math.max(0,$A(s,o.fxprime)/u),KA(r,u,r,-1,o.fxprime),u=a,a=o,o=u):XA(r,a.fxprime,-1),UA(a.fxprime)<=1e-5)break}n.history&&n.history.push({x:a.x.slice(),fx:a.fx,fxprime:a.fxprime.slice(),alpha:l});return a},sm.gradientDescent=function(t,e,n){for(var r=(n=n||{}).maxIterations||100*e.length,i=n.learnRate||.001,a={x:e.slice(),fx:0,fxprime:e.slice()},o=0;o<r&&(a.fx=t(a.x,a.fxprime),n.history&&n.history.push({x:a.x.slice(),fx:a.fx,fxprime:a.fxprime.slice()}),KA(a.x,1,a.x,-i,a.fxprime),!(UA(a.fxprime)<=1e-5));++o);return a},sm.gradientDescentLineSearch=function(t,e,n){n=n||{};var r,i={x:e.slice(),fx:0,fxprime:e.slice()},a={x:e.slice(),fx:0,fxprime:e.slice()},o=n.maxIterations||100*e.length,s=n.learnRate||1,l=e.slice(),c=n.c1||.001,u=n.c2||.1,h=[];{var f;n.history&&(f=t,t=function(t,e){return h.push(t.slice()),f(t,e)})}i.fx=t(i.x,i.fxprime);for(var d=0;d<o&&(XA(l,i.fxprime,-1),s=ZA(t,l,i,a,s,c,u),n.history&&(n.history.push({x:i.x.slice(),fx:i.fx,fxprime:i.fxprime.slice(),functionCalls:h,learnRate:s,alpha:s}),h=[]),r=i,i=a,a=r,!(0===s||UA(i.fxprime)<1e-5));++d);return i},sm.zeros=qA,sm.zerosM=function(t,e){return qA(t).map(function(){return qA(e)})},sm.norm2=UA,sm.weightedSum=KA,sm.scale=XA;const QA=1e-10;function JA(a,t){var e=function(t){var r=[];for(let n=0;n<t.length;++n)for(let e=n+1;e<t.length;++e){var i=r4(t[n],t[e]);for(let t=0;t<i.length;++t){var a=i[t];a.parentIndex=[n,e],r.push(a)}}return r}(a),n=e.filter(function(t){var e=t,n=a;for(let t=0;t<n.length;++t)if(e4(e,n[t])>n[t].radius+QA)return!1;return!0});let o=0,s=0,l;var c=[];if(1<n.length){var r=function(e){var n={x:0,y:0};for(let t=0;t<e.length;++t)n.x+=e[t].x,n.y+=e[t].y;return n.x/=e.length,n.y/=e.length,n}(n);for(l=0;l<n.length;++l){var u=n[l];u.angle=Math.atan2(u.x-r.x,u.y-r.y)}n.sort(function(t,e){return e.angle-t.angle});let i=n[n.length-1];for(l=0;l<n.length;++l){var h=n[l],f=(s+=(i.x+h.x)*(h.y-i.y),{x:(h.x+i.x)/2,y:(h.y+i.y)/2});let r=null;for(let n=0;n<h.parentIndex.length;++n)if(-1<i.parentIndex.indexOf(h.parentIndex[n])){var d=a[h.parentIndex[n]],p=Math.atan2(h.x-d.x,h.y-d.y),g=Math.atan2(i.x-d.x,i.y-d.y);let t=g-p;t<0&&(t+=2*Math.PI);p=g-t/2;let e=e4(f,{x:d.x+d.radius*Math.sin(p),y:d.y+d.radius*Math.cos(p)});e>2*d.radius&&(e=2*d.radius),(null===r||r.width>e)&&(r={circle:d,width:e,p1:h,p2:i})}null!==r&&(c.push(r),o+=t4(r.circle.radius,r.width),i=h)}}else{let t=a[0];for(l=1;l<a.length;++l)a[l].radius<t.radius&&(t=a[l]);let e=!1;for(l=0;l<a.length;++l)if(e4(a[l],t)>Math.abs(t.radius-a[l].radius)){e=!0;break}e?o=s=0:(o=t.radius*t.radius*Math.PI,c.push({circle:t,p1:{x:t.x,y:t.y+t.radius},p2:{x:t.x-QA,y:t.y+t.radius},width:2*t.radius}))}return s/=2,t&&(t.area=o+s,t.arcArea=o,t.polygonArea=s,t.arcs=c,t.innerPoints=n,t.intersectionPoints=e),o+s}function t4(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function e4(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function n4(t,e,n){var r;return t+e<=n?0:n<=Math.abs(t-e)?Math.PI*Math.min(t,e)*Math.min(t,e):(r=e-(n*n-t*t+e*e)/(2*n),t4(t,t-(n*n-e*e+t*t)/(2*n))+t4(e,r))}function r4(t,e){var n,r,i=e4(t,e),a=t.radius,o=e.radius;return a+o<=i||i<=Math.abs(a-o)?[]:(o=(a*a-o*o+i*i)/(2*i),a=Math.sqrt(a*a-o*o),n=t.x+o*(e.x-t.x)/i,o=t.y+o*(e.y-t.y)/i,[{x:n+(r=-(e.y-t.y)*(a/i)),y:o-(e=-(e.x-t.x)*(a/i))},{x:n-r,y:o+e}])}function i4(t,e){(e=e||{}).maxIterations=e.maxIterations||500;var n=e.initialLayout||s4;const i=e.lossFunction||l4,a=n(t=function(t){t=t.slice();var e=[],n={};let r,i,a,o;for(r=0;r<t.length;++r){var s=t[r];1==s.sets.length?e.push(s.sets[0]):2==s.sets.length&&(a=s.sets[0],o=s.sets[1],n[[a,o]]=!0,n[[o,a]]=!0)}for(e.sort((t,e)=>e<t?1:-1),r=0;r<e.length;++r)for(a=e[r],i=r+1;i<e.length;++i)o=e[i],[a,o]in n||t.push({sets:[a,o],size:0});return t}(t),e),r=[],o=[];let s;for(s in a)a.hasOwnProperty(s)&&(r.push(a[s].x),r.push(a[s].y),o.push(s));var l=YA.exports.nelderMead(function(e){var n={};for(let t=0;t<o.length;++t){var r=o[t];n[r]={x:e[2*t],y:e[2*t+1],radius:a[r].radius}}return i(n,t)},r,e).x;for(let t=0;t<o.length;++t)s=o[t],a[s].x=l[2*t],a[s].y=l[2*t+1];return a}const a4=1e-10;function o4(e,n,r){return Math.min(e,n)*Math.min(e,n)*Math.PI<=r+a4?Math.abs(e-n):YA.exports.bisect(function(t){return n4(e,n,t)-r},0,e+n)}function s4(t,e){let n=function(r,t){const i=t&&t.lossFunction?t.lossFunction:l4,a={},o={};let s;for(let t=0;t<r.length;++t){var e=r[t];1==e.sets.length&&(s=e.sets[0],a[s]={x:1e10,y:1e10,rowid:Object.keys(a).length,size:e.size,radius:Math.sqrt(e.size/Math.PI)},o[s]=[])}r=r.filter(function(t){return 2==t.sets.length});for(let e=0;e<r.length;++e){var n=r[e];let t=n.hasOwnProperty("weight")?n.weight:1;var l=n.sets[0],c=n.sets[1];n.size+a4>=Math.min(a[l].size,a[c].size)&&(t=0),o[l].push({set:c,size:n.size,weight:t}),o[c].push({set:l,size:n.size,weight:t})}var u=[];for(s in o)if(o.hasOwnProperty(s)){let e=0;for(let t=0;t<o[s].length;++t)e+=o[s][t].size*o[s][t].weight;u.push({set:s,size:e})}function h(t,e){return e.size-t.size}u.sort(h);const f={};function d(t){return t.set in f}function p(t,e){a[e].x=t.x,a[e].y=t.y,f[e]=!0}p({x:0,y:0},u[0].set);for(let t=1;t<u.length;++t){var g=u[t].set,y=o[g].filter(d);if(s=a[g],y.sort(h),0===y.length)throw"ERROR: missing pairwise overlap information";var m=[];for(let e=0;e<y.length;++e){var v=a[y[e].set],b=o4(s.radius,v.radius,y[e].size);m.push({x:v.x+b,y:v.y}),m.push({x:v.x-b,y:v.y}),m.push({y:v.y+b,x:v.x}),m.push({y:v.y-b,x:v.x});for(let t=e+1;t<y.length;++t){var x=a[y[t].set],w=o4(s.radius,x.radius,y[t].size),M=r4({x:v.x,y:v.y,radius:b},{x:x.x,y:x.y,radius:w});for(let t=0;t<M.length;++t)m.push(M[t])}}let e=1e50,n=m[0];for(let t=0;t<m.length;++t){a[g].x=m[t].x,a[g].y=m[t].y;var O=i(a,r);O<e&&(e=O,n=m[t])}p(n,g)}return a}(t,e);var r=e.lossFunction||l4;return n=8<=t.length&&r(e=function(t,e){var n=(e=e||{}).restarts||10,r=[],i={};let a;for(a=0;a<t.length;++a){var o=t[a];1==o.sets.length&&(i[o.sets[0]]=r.length,r.push(o))}var s=function(t,a,o){const s=YA.exports.zerosM(a.length,a.length),l=YA.exports.zerosM(a.length,a.length);return t.filter(function(t){return 2==t.sets.length}).map(function(t){var e=o[t.sets[0]],n=o[t.sets[1]],r=o4(Math.sqrt(a[e].size/Math.PI),Math.sqrt(a[n].size/Math.PI),t.size);s[e][n]=s[n][e]=r;let i=0;t.size+1e-10>=Math.min(a[e].size,a[n].size)?i=1:t.size<=1e-10&&(i=-1),l[e][n]=l[n][e]=i}),{distances:s,constraints:l}}(t,r,i);let y=s.distances;function l(t,r){{var i=t,a=r,o=y,s=m;let e=0,n;for(n=0;n<a.length;++n)a[n]=0;for(n=0;n<o.length;++n){var l=i[2*n],c=i[2*n+1];for(let t=n+1;t<o.length;++t){var u=i[2*t],h=i[2*t+1],f=o[n][t],d=s[n][t],p=(u-l)*(u-l)+(h-c)*(h-c),g=Math.sqrt(p),p=p-f*f;0<d&&g<=f||d<0&&f<=g||(e+=2*p*p,a[2*n]+=4*p*(l-u),a[2*n+1]+=4*p*(c-h),a[2*t]+=4*p*(u-l),a[2*t+1]+=4*p*(h-c))}}return e}}const m=s.constraints,c=YA.exports.norm2(y.map(YA.exports.norm2))/y.length;y=y.map(function(t){return t.map(function(t){return t/c})});let u,h;for(a=0;a<n;++a){var f=YA.exports.zeros(2*y.length).map(Math.random);h=YA.exports.conjugateGradient(l,f,e),(!u||h.fx<u.fx)&&(u=h)}var d=u.x,p={};for(a=0;a<r.length;++a){var g=r[a];p[g.sets[0]]={x:d[2*a]*c,y:d[2*a+1]*c,radius:Math.sqrt(g.size/Math.PI)}}if(e.history)for(a=0;a<e.history.length;++a)YA.exports.scale(e.history[a].x,c);return p}(t,e),t)+1e-8<r(n,t)?e:n}function l4(n,r){let i=0;for(let e=0;e<r.length;++e){var a,o,s=r[e];let t;1!=s.sets.length&&(t=2==s.sets.length?(o=n[s.sets[0]],a=n[s.sets[1]],n4(o.radius,a.radius,e4(o,a))):JA(s.sets.map(function(t){return n[t]})),o=s.hasOwnProperty("weight")?s.weight:1,i+=o*(t-s.size)*(t-s.size))}return i}function c4(t){function e(e){return{max:Math.max.apply(null,t.map(function(t){return t[e]+t.radius})),min:Math.min.apply(null,t.map(function(t){return t[e]-t.radius}))}}return{xRange:e("x"),yRange:e("y")}}const u4=t=>{const{sets:e="sets",size:n="size",as:r=["key","path"],padding:o=0}=t,[s,l]=r;return t=>{t=t.map(t=>Object.assign(Object.assign({},t),{sets:t[e],size:t[n],[s]:t.sets.join("&")}));t.sort((t,e)=>t.sets.length-e.sets.length);const i=i4(t);let a;return t.map(t=>{const r=t[e];return Object.assign(Object.assign({},t),{[l]:({width:t,height:e})=>{a=a||function(t,e,n,r){var i=[],a=[];for(const g in t)t.hasOwnProperty(g)&&(a.push(g),i.push(t[g]));e-=2*r,n-=2*r;var o=(l=c4(i)).xRange,s=l.yRange;if(o.max==o.min||s.max==s.min)return console.log("not scaling solution: zero size detected"),t;var l=e/(o.max-o.min),c=n/(s.max-s.min),u=Math.min(c,l),h=(e-(o.max-o.min)*u)/2,f=(n-(s.max-s.min)*u)/2,d={};for(let t=0;t<i.length;++t){var p=i[t];d[a[t]]={radius:u*p.radius,x:r+h+(p.x-o.min)*u,y:r+f+(p.y-s.min)*u}}return d}(i,t,e,o);let n=function(t){var e={},n=(JA(t,e),e.arcs);if(0===n.length)return"M 0 0";if(1==n.length)return t=n[0].circle,e=t.x,r=t.y,t=t.radius,(i=[]).push("M",e-=t,r),i.push("A",t,t,0,1,0,e+2*t,r),i.push("A",t,t,0,1,0,e,r),i.join(" ");var r,i,a=["\nM",n[0].p2.x,n[0].p2.y];for(let t=0;t<n.length;++t){var o=n[t],s=o.circle.radius,l=o.width>s;a.push("\nA",s,s,0,l?1:0,1,o.p1.x,o.p1.y)}return a.join(" ")}(r.map(t=>a[t]));return/[zZ]$/.test(n)||(n+=" Z"),n}})})}},h4=(u4.props={},()=>t=>(console.log("G2 data section:",t),t));h4.props={};const f4=(l,c)=>X(void 0,void 0,void 0,function*(){var{width:t,height:e}=c,{data:n,encode:r={},scale:i,style:a={},layout:o={}}=l,s=at(l,["data","encode","scale","style","layout"]),n=function(t,e){const{text:n="text",value:r="value"}=e;return t.map(t=>Object.assign(Object.assign({},t),{text:t[n],value:t[r]}))}(n,r),o=yield jA(Object.assign(Object.assign({},{size:[t,e]}),o))(n);return ot({},{axis:!1,type:"text",encode:{x:"x",y:"y",text:"text",rotate:"rotate",fontSize:"size"},scale:{x:{domain:[0,t],range:[0,1]},y:{domain:[0,e],range:[0,1]},fontSize:{type:"identity"},rotate:{type:"identity"}},style:{textAlign:"center"}},Object.assign(Object.assign({data:o,encode:r,scale:i,style:a},s),{axis:!1}))});f4.props={};const d4={coordinate:{type:"radial",innerRadius:.9,outerRadius:1,startAngle:-1.1*Math.PI,endAngle:.1*Math.PI},axis:{x:!1},legend:!1,tooltip:!1,encode:{x:"x",y:"y",color:"color"},scale:{color:{range:["#30BF78","#D0D0D0"]}}},p4={style:{shape:(t,e)=>{const l=t["radius"],c=at(t,["shape","radius"]);var t=st(c,"pointer"),n=st(c,"pin");const u=t["shape"],h=at(t,["shape"]),f=n["shape"],d=at(n,["shape"]),{coordinate:p,theme:g}=e;return(t,e)=>{var t=t.map(t=>p.invert(t)),[n,r,i]=function(t,e){var[,...t]=(t=t.getOptions()["transformations"]).find(t=>t[0]===e);return t}(p,"polar");const a=p.clone();var o=e["color"],n=Fp({startAngle:n,endAngle:r,innerRadius:i,outerRadius:l});n.push(["cartesian"]),a.update({transformations:n});const s=t.map(t=>a.map(t));var[r,i]=Px(s),[n,t]=p.getCenter(),r=Object.assign(Object.assign({x1:r,y1:i,x2:n,y2:t,stroke:o},h),c),i=Object.assign(Object.assign({cx:n,cy:t,stroke:o},d),c),n=lt(new fc);return fp(u)||("function"==typeof u?n.append(()=>u(s,e,a,g)):n.append("line").call(L,r).node()),fp(f)||("function"==typeof f?n.append(()=>f(s,e,a,g)):n.append("circle").call(L,i).node()),n.node()}},lineWidth:4,pointerLineCap:"round",pinR:10,pinFill:"#fff",radius:.6}},g4={type:"text",style:{x:"50%",y:"60%",textAlign:"center",textBaseline:"middle",fontSize:20,fontWeight:800,fill:"#888"}};const y4=t=>{var n,{data:e={},scale:r={},style:i={},animate:a={}}=t,t=at(t,["data","scale","style","animate","transform"]),{targetData:e,totalData:r,target:o,total:s,scale:l}=function(t,e){const{name:n="score",target:r,total:i,percent:a,thresholds:o=[]}=t;var t=a||r,s=a?1:i,e=Object.assign({y:{domain:[0,s]}},e);return o.length?{targetData:[{x:n,y:t,color:"target"}],totalData:o.map((t,e)=>({x:n,y:1<=e?t-o[e-1]:t,color:e})),target:t,total:s,scale:e}:{targetData:[{x:n,y:t,color:"target"}],totalData:[{x:n,y:t,color:"target"},{x:n,y:s-t,color:"total"}],target:t,total:s,scale:e}}(e,r),c=st(i,"text"),u=(n=["pointer","pin"],Object.fromEntries(Object.entries(i).filter(([e])=>n.find(t=>e.startsWith(t)))));return[ot({},d4,Object.assign({type:"interval",transform:[{type:"stackY"}],data:r,scale:l,style:st(i,"arc"),animate:"object"==typeof a?st(a,"arc"):a},t)),ot({},d4,p4,Object.assign({type:"point",data:e,scale:l,style:u,animate:"object"==typeof a?st(a,"indicator"):a},t)),ot({},g4,{style:Object.assign({text:([r,{target:i,total:e}]=[c,{target:o,total:s}],(r=r.content)?r(i,e):i.toString())},c),animate:"object"==typeof a?st(a,"text"):a})]};y4.props={};rm={density:Go};const m4=()=>(i,t,e,a)=>{const{x:o,series:s}=e,l=Object.entries(e).filter(([t])=>t.startsWith("y")).map(([,t])=>t),c=Object.entries(e).filter(([t])=>t.startsWith("size")).map(([,t])=>t);if(void 0===o||void 0===l||void 0===c)throw new Error("Missing encode for x or y or size channel.");const u=t.x,h=t.series;e=Array.from(i,n=>{var t=u.getBandWidth(u.invert(+o[n])),e=t*(h?h.getBandWidth(h.invert(+(null===s||void 0===s?void 0:s[n]))):1),t=(+(null===s||void 0===s?void 0:s[n])||0)*t;const r=+o[n]+t+e/2;return[...l.map((t,e)=>[r+ +c[e][n]/i.length,+l[e][n]]),...l.map((t,e)=>[r-+c[e][n]/i.length,+l[e][n]]).reverse()].map(t=>a.map(t))});return[i,e]};m4.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,shape:rm,channels:[...n5({shapes:Object.keys(rm)}),{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:[...o5(),{type:_l},{type:Rl}],postInference:[...i5()],interaction:{shareTooltip:!0}};cm={heatmap:Yy};const v4=t=>(t,e,n,r)=>{const{x:i,y:a,size:o,color:s}=n;return[[0],[Array.from(t,t=>{var e=o?+o[t]:40;return[...r.map([+i[t],+a[t]]),s[t],e]})]]},b4=(v4.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,shape:cm,channels:[...n5({shapes:Object.keys(cm)}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...o5(),{type:Rl},{type:zl}],postInference:[...r5()]},()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"]),x4=(b4.props={},()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"]),w4=(x4.props={},t=>new cg(t)),M4=(w4.props={},t=>new wg(t)),O4=(M4.props={},t=>new sg(t)),k4=(O4.props={},t=>new yg(t)),E4=(k4.props={},t=>new Mg(t)),S4=(E4.props={},t=>new Hg(t)),A4=(S4.props={},t=>new _g(t)),_4=(A4.props={},t=>new kg(t)),T4=(_4.props={},t=>new Sg(t)),P4=(T4.props={},t=>new Cg(t)),C4=(P4.props={},t=>new Tg(t)),L4=(C4.props={},t=>new Eg(t)),N4=(L4.props={},t=>new Yg(t)),j4=(N4.props={},t=>new hg(t)),R4=(j4.props={},{BLACK:"#000",WHITE:"#fff",STROKE:"#416180"}),I4="#5B8FF9",B4=t=>{var e={color:I4,size:1,category10:"category10",category20:"category20",enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},view:{viewFill:"transparent",plotFill:"transparent",mainFill:"transparent",contentFill:"transparent"},line:{line:{fill:"",strokeOpacity:1,lineWidth:1}},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:R4.BLACK,lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:12,strokeWidth:0,connectorStroke:R4.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:R4.STROKE,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:R4.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:R4.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:R4.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:R4.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:R4.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:R4.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:R4.STROKE,endMarkerFillOpacity:.95}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:.5,gridStroke:R4.BLACK,gridStrokeOpacity:.05,labelAlign:"horizontal",labelFill:R4.BLACK,labelFillOpacity:.65,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:8,line:!1,lineLineWidth:.5,lineStroke:R4.BLACK,lineStrokeOpacity:.45,tickLength:4,tickLineWidth:1,tickStroke:R4.BLACK,tickStrokeOpacity:.25,titleFill:R4.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,titleTransformOrigin:"center"},axisTop:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"top",titleSpacing:0,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,labelAutoRotate:!0,tickDirection:"positive",titlePosition:"bottom",titleSpacing:10,titleTextBaseline:"bottom"},axisLeft:{gridDirection:"positive",labelAutoRotate:!1,labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"left",titleSpacing:10,titleTextBaseline:"middle",titleDirection:"vertical",titleTransformOrigin:"center"},axisRight:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"right",titleSpacing:0,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:R4.BLACK,itemLabelFillOpacity:.65,itemLabelFontSize:12,itemLabelFontWeight:"lighter",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,8],itemValueFill:R4.BLACK,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"lighter",navButtonFill:R4.BLACK,navButtonFillOpacity:.65,navPageNumFill:R4.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!0,titleFill:R4.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:R4.BLACK,tickStrokeOpacity:.25,rowPadding:0,colPadding:8},legendContinuous:{handleHeight:12,handleLabelFill:R4.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:R4.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:R4.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:R4.BLACK,labelFillOpacity:.45,labelFontSize:12,labelFontWeight:"lighter",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:.65,tickStroke:R4.BLACK,tickStrokeOpacity:.25},label:{fill:R4.BLACK,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:R4.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:R4.WHITE,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},htmlLabel:{fontSize:12,opacity:.65,color:R4.BLACK,fontWeight:"normal"},slider:{trackSize:16,trackFill:R4.STROKE,trackFillOpacity:1,selectionFill:I4,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:R4.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:R4.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{padding:[2,2,2,2],trackSize:10,isRound:!0,slidable:!0,scrollable:!0,trackFill:"#e5e5e5",trackFillOpacity:0,thumbFill:"#000",thumbFillOpacity:.15,thumbHighlightedFillOpacity:.2},title:{spacing:8,titleFill:R4.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:R4.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)},D4=(B4.props={},{BLACK:"#fff",WHITE:"#000",STROKE:"#416180"}),F4="#5B8FF9",z4=t=>{var e={color:F4,category10:"category10",category20:"category20",size:1,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},view:{viewFill:"#141414",plotFill:"transparent",mainFill:"transparent",contentFill:"transparent"},line:{line:{fill:"",strokeOpacity:1,lineWidth:1}},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:D4.BLACK,lineWidth:1}},text:{text:{fill:D4.BLACK,fillOpacity:.65,fontSize:12,strokeWidth:0,connectorStroke:D4.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:D4.STROKE,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:D4.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:D4.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:D4.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:D4.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:D4.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:D4.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:D4.STROKE,endMarkerFillOpacity:.95}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:.5,gridStroke:D4.BLACK,gridStrokeOpacity:.05,labelAlign:"horizontal",labelFill:D4.BLACK,labelFillOpacity:.65,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:8,lineLineWidth:.5,lineStroke:D4.BLACK,lineStrokeOpacity:.45,tickLength:4,tickLineWidth:1,tickStroke:D4.BLACK,tickStrokeOpacity:.25,titleFill:D4.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,titleTransformOrigin:"center"},axisTop:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"top",titleSpacing:0,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"bottom",titleSpacing:10,titleTextBaseline:"bottom"},axisLeft:{gridDirection:"positive",labelAutoRotate:!1,labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"left",titleSpacing:10,titleTextBaseline:"middle",titleDirection:"vertical",titleTransformOrigin:"center"},axisRight:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"right",titleSpacing:0,titleTextBaseline:"top",titleDirection:"vertical",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleTextBaseline:"bottom"},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},axisArc:{title:!1,titlePosition:"inner",line:!1,tick:!0,labelSpacing:4},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:D4.BLACK,itemLabelFillOpacity:.65,itemLabelFontSize:12,itemLabelFontWeight:"lighter",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,8],itemValueFill:D4.BLACK,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"lighter",navButtonFill:D4.BLACK,navButtonFillOpacity:.45,navPageNumFill:D4.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!0,titleFill:D4.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:D4.BLACK,tickStrokeOpacity:.25,rowPadding:0,colPadding:8},legendContinuous:{handleHeight:12,handleLabelFill:D4.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:D4.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:D4.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:D4.BLACK,labelFillOpacity:.45,labelFontSize:12,labelFontWeight:"lighter",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:.65,tickStroke:D4.BLACK,tickStrokeOpacity:.25},label:{fill:D4.BLACK,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:D4.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:D4.WHITE,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},htmlLabel:{fontSize:12,opacity:.65,color:D4.BLACK,fontWeight:"normal"},slider:{trackSize:16,trackFill:D4.STROKE,trackFillOpacity:1,selectionFill:F4,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:D4.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:D4.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{},title:{titleFill:D4.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:D4.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)},W4=(z4.props={},{BLACK:"#000",WHITE:"#fff",STROKE:"#888"}),G4="#4e79a7",H4=t=>{var e={color:G4,size:1,category10:"tableau10",category20:"tableau10",enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},view:{viewFill:"transparent",plotFill:"transparent",mainFill:"transparent",contentFill:"transparent"},line:{line:{fill:"",strokeOpacity:1,lineWidth:1,connectStroke:"#aaa"}},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,connectFill:W4.BLACK,connectFillOpacity:.1}},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:"#1D2129",lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:10,strokeWidth:0,connectorStroke:W4.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:W4.STROKE,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:W4.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:W4.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:W4.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:W4.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:W4.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:W4.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:W4.STROKE,endMarkerFillOpacity:.95}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:1,gridStroke:"#ddd",gridStrokeOpacity:1,labelAlign:"horizontal",labelAutoRotate:!1,labelFill:W4.BLACK,labelFillOpacity:1,labelFontSize:10,labelFontWeight:"normal",labelSpacing:4,line:!0,lineLineWidth:1,lineStroke:"#888",lineStrokeOpacity:1,tickLength:5,tickLineWidth:1,tickStroke:W4.STROKE,tickStrokeOpacity:1,titleFill:W4.BLACK,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold",titleSpacing:12,titleTransformOrigin:"center"},axisTop:{gridDirection:"positive",labelDirection:"negative",tickDirection:"negative",titlePosition:"top",titleSpacing:0,titleTextBaseline:"middle",labelSpacing:4},axisBottom:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"bottom",titleSpacing:4,titleTextBaseline:"bottom"},axisLeft:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"left",titleSpacing:4,titleTextBaseline:"middle",titleDirection:"vertical",titleTransformOrigin:"center"},axisRight:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"right",titleSpacing:0,titleTextBaseline:"top",titleDirection:"vertical",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleTextBaseline:"bottom"},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:W4.BLACK,itemLabelFillOpacity:1,itemLabelFontSize:10,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,4],itemValueFill:W4.BLACK,itemValueFillOpacity:1,itemValueFontSize:10,itemValueFontWeight:"normal",navButtonFill:W4.BLACK,navButtonFillOpacity:.45,navButtonSize:6,navPageNumFill:W4.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:10,padding:8,title:!0,titleFill:W4.BLACK,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold",titleSpacing:4,rowPadding:0,colPadding:8},legendContinuous:{handleHeight:12,handleLabelFill:W4.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:10,handleLabelFontWeight:"normal",handleMarkerFill:W4.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:W4.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:W4.BLACK,labelFillOpacity:.45,labelFontSize:10,labelFontWeight:"normal",title:!0,titleSpacing:4,ribbonFill:"#aaa",handle:!0,handleLabel:!1,handleShape:"slider",handleIconSize:12/1.8,indicator:!1,titleFontWeight:"bold"},label:{fill:W4.BLACK,fillOpacity:.65,fontSize:10,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:W4.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:W4.WHITE,fontSize:10,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},htmlLabel:{fontSize:12,opacity:.65,color:W4.BLACK,fontWeight:"normal"},slider:{trackSize:16,trackFill:W4.STROKE,trackFillOpacity:.05,selectionFill:G4,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:W4.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:W4.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:10,handleLabelFontWeight:"normal"},scrollbar:{},title:{titleFill:W4.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:W4.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)};function V4(t,e,n){return t.querySelector(e)?lt(t).select(e):lt(t).append(n)}function Y4(t){return Array.isArray(t)?t.join(", "):""+(t||"")}function q4(t,e){let{flexDirection:n,justifyContent:r,alignItems:i}={flexDirection:"row",justifyContent:"flex-start",alignItems:"center"};var a={top:["row","flex-start","center"],bottom:["row","flex-start","center"],left:["column","center","center"],right:["column","center","center"],center:["column","center","center"]};return t in a&&([n,r,i]=a[t]),Object.assign({display:"flex",flexDirection:n,justifyContent:r,alignItems:i},e)}H4.props={};class $4 extends Vy{get child(){var t;return null==(t=this.children)?void 0:t[0]}update(t){var e,t=(this.attr(t),t)["subOptions"];null!=(e=this.child)&&e.update(t)}}class U4 extends $4{update(t){var e=t["subOptions"];this.attr(t),null!=(t=this.child)&&t.update(e)}}function X4(t,e){return null==(t=t.filter(t=>t.getOptions().name===e))?void 0:t[0]}function K4(t,e,n){var t=t["bbox"],{position:e="top",size:r,length:i,crossPadding:a=0}=e,e=["top","bottom","center"].includes(e),[t,o]=e?[t.height,t.width]:[t.width,t.height],{defaultSize:n,defaultLength:s}=n.props,r=(r||n||t)-2*a,n=i||s||o,[t,a]=e?[n,r]:[r,n];return{orientation:e?"horizontal":"vertical",width:t,height:a,size:r,length:n}}function Z4(t){const n=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"];var e=t["style"],t=at(t,["style"]);const r={};return Object.entries(t).forEach(([t,e])=>{n.includes(t)?r["show"+Ue(t)]=e:r[t]=e}),Object.assign(Object.assign({},r),e)}function Q4(t){var{innerWidth:t,innerHeight:e}=t.getOptions();return[t,e]}function J4(t){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}function t_(a,t,e,n,r,i,o,s){void 0===e&&void 0===i||a.update(Object.assign(Object.assign({},e&&{tickCount:e}),i&&{tickMethod:i})),e=t,t=i;var l,t=(i=a).getTicks?i.getTicks():t?([c,l]=wd(e,t=>+t),i=i.getOptions()["tickCount"],t(c,l,i)):e,c=r?t.filter(r):t;const u=t=>!(t instanceof Date)&&"object"==typeof t&&t?t:String(t),h=n||(null==(l=a.getFormatter)?void 0:l.call(a))||u,f=function(t,e){if(iv(e))return t=>t;var{innerWidth:e,innerHeight:n,insetTop:r,insetBottom:i,insetLeft:a,insetRight:o}=e.getOptions(),[t,r,i]="left"===t||"right"===t?[r,i,n]:[a,o,e];const s=new wg({domain:[0,1],range:[t/i,1-r/i]});return t=>s.map(t)}(o,s),d=function(r,i){const{width:a,height:o}=i.getOptions();return t=>{var e,n;return lv(i)?(e=i.map("bottom"===r?[t,1]:[0,t]),"bottom"===r?(n=e[0],new wg({domain:[0,a],range:[0,1]}).map(n)):"left"===r?(n=e[1],new wg({domain:[0,o],range:[0,1]}).map(n)):t):t}}(o,s),p=t=>["left","right"].includes(t);return iv(s)||rv(s)?c.map((t,e,n)=>{var r,i=(null==(i=a.getBandWidth)?void 0:i.call(a,t))/2||0,i=f(a.map(t)+i);return{value:av(s)&&"center"===o||rv(s)&&(null==(r=a.getTicks)?void 0:r.call(a))&&["top","bottom","center","outer"].includes(o)||rv(s)&&p(o)?1-i:i,label:u(h(J4(t),e,n)),id:String(e)}}):c.map((t,e,n)=>{var r=(null==(r=a.getBandWidth)?void 0:r.call(a,t))/2||0,r=d(f(a.map(t)+r));return{value:p(o)?1-r:r,label:u(h(J4(t),e,n)),id:String(e)}})}function e_(t,e,n){var r;return!(iv(r=e)&&rv(r)||sv(e))&&(void 0===t?!!n.getTicks:t)}function n_(t,e,n,r,i,a){n=function(t,e){var n=t.axis;let r=t.axisLinear;return["top","right","bottom","left"].includes(e)&&(r=t["axis"+ip(e)]),Object.assign({},n,r)}(n,i);return"center"===i?Object.assign(Object.assign(Object.assign(Object.assign({},n),{labelDirection:"right"===r?"negative":"positive"}),"center"===r?{labelTransform:"translate(50%,0)"}:null),{tickDirection:"right"===r?"negative":"positive",labelSpacing:"center"===r?0:4,titleSpacing:"vertical"===(i=a)||i===-Math.PI/2?10:0,tick:"center"!==r&&void 0}):n}var r_,gm=s=>i=>{const{labelFormatter:a,labelFilter:o=()=>!0}=i;return t=>{var[e]=t["scales"];const r=(null==(n=e.getTicks)?void 0:n.call(e))||e.getOptions().domain;var n="string"==typeof a?Op(a):a,n=Object.assign(Object.assign({},i),{labelFormatter:n,labelFilter:(t,e,n)=>o(r[e],e,r),scale:e});return s(n)(t)}};const i_=gm(t=>{const{direction:o="left",important:s={},labelFormatter:l,orientation:c,position:u,size:h,style:f={},title:d,tickCount:p,tickFilter:g,tickMethod:y,transform:m,indexBBox:v}=t,b=at(t,["direction","important","labelFormatter","order","orientation","position","size","style","title","tickCount","tickFilter","tickMethod","transform","indexBBox"]);return({scales:[t],value:e,coordinate:n,theme:r})=>{var e=e["bbox"],i=t.getOptions()["domain"],r=n_(0,0,r,o,u,c),r=Object.assign(Object.assign(Object.assign({},r),f),b),a=function(t,e){var[e,n]=Q4(e);return t.includes("bottom")||t.includes("top")?n:e}(u,n),e=function(t,e,n,r){var{x:n,y:i,width:a,height:o}=n;if("bottom"===t)return{startPos:[n,i],endPos:[n+a,i]};if("left"===t)return{startPos:[n+a,i+o],endPos:[n+a,i]};if("right"===t)return{startPos:[n,i+o],endPos:[n,i]};if("top"===t)return{startPos:[n,i+o],endPos:[n+a,i+o]};if("center"===t){if("vertical"===e)return{startPos:[n+a,i],endPos:[n+a,i+o]};if("horizontal"===e)return{startPos:[n,i+o],endPos:[n+a,i+o]};if("number"==typeof e){var[t,s]=r.getCenter(),[l,c]=uv(r);const[u,h]=hv(r);var a=Math.min(a,o)/2,{insetLeft:o,insetTop:r}=r.getOptions(),l=l*a,c=c*a,[a,t]=[t+n-o,s+i-r],[n,o]=[Math.cos(e),Math.sin(e)];return{startPos:[a+c*n,t+c*o],endPos:[a+l*n,t+l*o],gridClosed:h-u==360,gridCenter:[a,t],gridControlAngles:new Array(3).fill(0).map((t,e,n)=>(h-u)/(n.length-1)*e)}}}return{}}(u,c,e,n),i=t_(t,i,p,l,g,y,u,n),i=v?i.map((t,e)=>{e=v.get(e);return!e||e[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:e[1]})}):i,i=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},r),{type:"linear",data:i,crossSize:h,titleText:Y4(d),labelOverlap:function(t=[],e){if(0<t.length)return t;var{labelAutoRotate:t,labelAutoHide:e,labelAutoEllipsis:n,labelAutoWrap:r}=e;const i=[];var a=(t,e)=>{e&&i.push(t)};return a({type:"rotate",optionalAngles:[0,15,30,45,60,90]},t),a({type:"ellipsis",minLength:20},n),a({type:"hide"},e),a({type:"wrap",wordWrapWidth:100,maxLines:3,recoveryWhenFail:!0},r),i}(m,r),grid:e_(r.grid,n,t),gridLength:a,line:!0,indexBBox:v}),r.line?null:{lineOpacity:0}),e),s);return i.labelOverlap.find(t=>"hide"===t.type)&&(i.crossSize=!1),new UO({className:"axis",style:Z4(i)})}}),a_=gm(t=>{const{position:o,labelFormatter:s,tickFilter:l,tickCount:c,tickMethod:u,important:h={},indexBBox:f,title:d,grid:p=!1}=t,g=at(t,["order","size","position","orientation","labelFormatter","tickFilter","tickCount","tickMethod","important","style","indexBBox","title","grid"]);return({scales:[t],value:e,coordinate:n,theme:r})=>{var e=e["bbox"],i=t.getOptions()["domain"],t=t_(t,i,c,s,l,u,o,n),i=f?t.map((t,e)=>{e=f.get(e);return!e||e[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:e[1]})}):t,[t,a]=uv(n),e=function(t,e,n,r,i){var{x:e,y:a,width:o,height:s}=e,e=[e+o/2,a+s/2],a=Math.min(o,s)/2,[o,s]=hv(i),[l,c]=Q4(i),a={center:e,radius:a,startAngle:o,endAngle:s,gridLength:(r-n)*(Math.min(l,c)/2)};return"inner"===t?({insetLeft:o,insetTop:s}=i.getOptions(),Object.assign(Object.assign({},a),{center:[e[0]-o,e[1]-s],labelAlign:"perpendicular",labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"})):Object.assign(Object.assign({},a),{labelAlign:"parallel",labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"})}(o,e,t,a,n),{axis:t,axisArc:a={}}=r,n=Z4(ot({},t,a,e,Object.assign(Object.assign({type:"arc",data:i,titleText:Y4(d),grid:p},g),h)));return new UO({style:rn(n,["transform"])})}}),o_=(i_.props={defaultPosition:"center",defaultSize:45,defaultOrder:0},a_.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0},e=>(...t)=>i_(Object.assign({},{crossPadding:50},e))(...t)),s_=(o_.props=Object.assign(Object.assign({},i_.props),{defaultPosition:"bottom"}),e=>(...t)=>i_(Object.assign({},{crossPadding:10},e))(...t));s_.props=Object.assign(Object.assign({},i_.props),{defaultPosition:"left"});const l_=a=>{const{important:o={}}=a,s=at(a,["important"]);return t=>{var e,{theme:n,coordinate:r,scales:i}=t;return i_(Object.assign(Object.assign(Object.assign({},s),(e=a.orientation,(e%=2*Math.PI)==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)"}:{})),{important:Object.assign(Object.assign({},function(t,e,n,r){const i=t["radar"];var[t]=r,r=t.getOptions().name;const[a,o]=hv(n);var{axisRadar:t={}}=e;return Object.assign(Object.assign({},t),{grid:"position"===r,gridConnect:"line",gridControlAngles:new Array(i.count).fill(0).map((t,e)=>{return(o-a)/i.count*e})})}(a,n,r,i)),o)}))(t)}};function c_(t,e){const{scales:n,library:a,markState:r}=e,[o,i]=function(t,e){var n=X4(t,"shape"),r=X4(t,"color");const i=n?n.clone():null,a=[];for(const[c,u]of e){var o=c.type,s=(0<(null==r?void 0:r.getOptions().domain.length)?null==r?void 0:r.getOptions().domain:u.data).map((t,e)=>{return i?i.map(t||"point"):(null==(t=null===c||void 0===c?void 0:c.style)?void 0:t.shape)||u.defaultShape||"point"});"string"==typeof o&&a.push([o,s])}if(0===a.length)return["point",["point"]];if(1===a.length)return a[0];if(!n)return a[0];const l=n.getOptions()["range"];return a.map(([t,e])=>{let n=0;for(let t=0;t<a.length;t++){var r=l[t%l.length];e[t]===r&&n++}return[n/e.length,[t,e]]}).sort((t,e)=>e[0]-t[0])[0][1]}(n,r),{itemMarker:s,itemMarkerSize:l}=t,c=(t,e)=>{var n;const r=(null==(n=null==(n=null==(n=a["mark."+o])?void 0:n.props)?void 0:n.shape[t])?void 0:n.props.defaultMarker)||function(t){if(Te(t))return t[t.length-1]}(t.split(".")),i="function"==typeof l?l(e):l;return()=>function(t,e){var{fill:n,stroke:r,lineWidth:i,color:a}=e,o=at(e,["d","fill","strokeWidth","path","stroke","lineWidth","color"]);const s=Dx.get(t)||Dx.get("point");return(...t)=>{return new kc({style:Object.assign(Object.assign({},o),{path:s(...t),stroke:s.style.includes("stroke")?a||r:"",fill:s.style.includes("fill")?a||n:"",lineWidth:s.style.includes("lineWidth")?i||2:0})})}}(r,{color:e.color})(0,0,i)},u=t=>""+i[t];return X4(n,"shape")&&!s?(t,e)=>c(u(e),t):"function"==typeof s?(t,e)=>{e=s(t.id,e);return"string"==typeof e?c(e,t):e}:(t,e)=>c(s||u(e),t)}function u_(t,e){var{labelFormatter:n=t=>""+t}=t,{scales:r,theme:i}=e,i=i.legendCategory.itemMarkerSize,a=(i=i,(a=X4(a=r,"size"))instanceof yg?2*a.map(NaN):i),i={itemMarker:c_(Object.assign(Object.assign({},t),{itemMarkerSize:a}),e),itemMarkerSize:a,itemMarkerOpacity:function(t){if(t=X4(t,"opacity")){const n=t.getOptions()["range"];return(t,e)=>n[e]}}(r)};const o="string"==typeof n?Op(n):n,s=X4(r,"color");t=r.find(t=>0<t.getOptions().domain.length).getOptions().domain;const l=s?t=>s.map(t):()=>e.theme.color;return Object.assign(Object.assign({},i),{data:t.map(t=>({id:t,label:o(t),color:l(t)}))})}l_.props=Object.assign(Object.assign({},i_.props),{defaultPosition:"center"});const h_=o=>{const{layout:s,position:l,title:c,cols:u}=o,h=at(o,["labelFormatter","layout","order","orientation","position","size","title","cols","itemMarker"]),f=h["gridRow"];return t=>{var{value:e,theme:n}=t,r=e["bbox"],{width:e,height:i}=function(t,e,n){var r;if("center"===(r=e["position"])){r=t["bbox"];const{width:i,height:a}=r;return{width:i,height:a}}const{width:i,height:a}=K4(t,e,n);return{width:i,height:a}}(e,o,h_),a=q4(l,s),e=Object.assign(Object.assign(Object.assign(Object.assign({orientation:["right","left","center"].includes(l)?"vertical":"horizontal",width:e,height:i,layout:void 0!==u?"grid":"flex"},void 0!==u&&{gridCol:u}),void 0!==f&&{gridRow:f}),{titleText:Y4(c)}),u_(o,t)),{legendCategory:i={}}=n,t=Z4(Object.assign({},i,e,h)),n=new U4({style:Object.assign(Object.assign({x:r.x,y:r.y,width:r.width,height:r.height},a),{subOptions:t})});return n.appendChild(new bk({className:"legend-category",style:t})),n}};function f_(t,e,n,r,i){var a,e=e.thresholds,o=(a=r,t=>({value:t/a,label:String(t)}));return Object.assign(Object.assign({},t),{color:i,data:[n,...e,r].map(o)})}function d_(t){var t=t.getOptions()["domain"],[t,e]=[t[0],Tp(t)];return[t,e]}function p_(t,e,n,r,i,a){const o=t["length"];var i=i.color?a.legendContinuous.ribbonFill||"black":a.color;const s=e||(a=i,u=(i=n||r).getOptions(),(i=i.clone()).update(Object.assign(Object.assign({},u),{range:[ma(a).toString()]})),i),[l,c]=d_(s);var[u,a]=d_([e,n,r].filter(t=>void 0!==t).find(t=>!(t instanceof hg)));return Object.assign(Object.assign({},t),{domain:[u,a],data:s.getTicks().map(t=>({value:t})),color:new Array(o).fill(0).map((t,e)=>{var e=(c-l)/(o-1)*e+l,n=s.map(e);const i=r?r.map(e):1;return n.replace(/rgb[a]*\(([\d]{1,3}) *, *([\d]{1,3}) *, *([\d]{1,3})[\S\s]*\)/,(t,e,n,r)=>`rgba(${e}, ${n}, ${r}, ${i})`)})})}function g_(t,e,n,r,i,a){var o=X4(t,"color"),n=function(t,e,n){var{size:r,crossPadding:i=0}=e,t=K4(t,e,n);return e=r-2*i,r=(n=t).orientation,n.size=e,"horizontal"===(r=r)||0===r?n.height=e:n.width=e,n}(n,r,i);if(o instanceof Sg){var r=o.getOptions()["range"],[i,s]=d_(o);if(o instanceof Tg||o instanceof Cg)return f_(n,o,i,s,r);{i=n;s=o;const l=[-1/0,...s.thresholds,1/0].map((t,e)=>({value:e,label:t}));return Object.assign(Object.assign({},i),{data:l,color:r,labelFilter:(t,e)=>0<e&&e<l.length-1})}}return p_(n,o,X4(t,"size"),X4(t,"opacity"),e,a)}h_.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultPadding:[20,10],defaultCrossPadding:[5,10]};const y_=u=>{const{labelFormatter:h,layout:f,position:d,title:p,style:g}=u,y=at(u,["labelFormatter","layout","order","orientation","position","size","title","style","crossPadding","padding"]);return({scales:t,value:e,theme:n,scale:r})=>{var i=e["bbox"],{x:i,y:a,width:o,height:s}=i,l=q4(d,f),{legendContinuous:c={}}=n,c=Z4(Object.assign({},c,Object.assign(Object.assign({titleText:Y4(p),labelAlign:"value",labelFormatter:"string"==typeof h?t=>Op(h)(t.label):h},g_(t,r,e,u,y_,n)),g),y)),t=new $4({style:Object.assign(Object.assign({x:i,y:a,width:o,height:s},l),{subOptions:c})});return t.appendChild(new zk({className:"legend-continuous",style:c})),t}},m_=(y_.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[5,10]},e=>(...t)=>y_(Object.assign({},{block:!0},e))(...t)),v_=(m_.props=Object.assign(Object.assign({},y_.props),{defaultPosition:"top",defaultOrientation:"horizontal"}),n=>t=>{var e=t["scales"],e=X4(e,"size");return y_(Object.assign({},{type:"size",data:e.getTicks().map((t,e)=>({value:t,label:String(t)}))},n))(t)}),b_=(v_.props=Object.assign(Object.assign({},y_.props),{defaultPosition:"top",defaultOrientation:"horizontal"}),t=>v_(Object.assign({},{block:!0},t)));function x_(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"}}}b_.props=Object.assign(Object.assign({},y_.props),{defaultPosition:"top",defaultOrientation:"horizontal"});r_={render(t,e){const{y:n,width:r,title:i,subtitle:a,spacing:o=2,align:s="left"}=t,l=at(t,["x","y","width","title","subtitle","spacing","align"]);t=st(l,"title");const c=st(l,"subtitle"),u=V4(e,".title","text").attr("className","title").call(L,Object.assign(Object.assign(Object.assign({},x_(0,n,r,s)),{fontSize:14,textBaseline:"top",text:i}),t)).node().getLocalBounds();V4(e,".sub-title","text").attr("className","sub-title").call(t=>{if(!a)return t.node().remove();t.node().attr(Object.assign(Object.assign(Object.assign({},x_(0,u.max[1]+o,r,s)),{fontSize:12,textBaseline:"top",text:a}),c))})}};const w_=class extends oc{constructor(t){super(t),this.descriptor=r_}connectedCallback(){var t,e;null!=(e=(t=this.descriptor).render)&&e.call(t,this.attributes,this)}update(t={}){var e;this.attr(ot({},this.attributes,t)),null!=(e=(t=this.descriptor).render)&&e.call(t,this.attributes,this)}},M_=a=>({value:t,theme:e})=>{var{x:t,y:n,width:r,height:i}=t.bbox;return new w_({style:ot({},e.title,Object.assign({x:t,y:n,width:r,height:i},a))})};function O_(t){return!!t.getBandWidth}function k_(t,e,n){if(!O_(t))return t.invert(e);var r=t["adjustedRange"],i=t.getOptions()["domain"],a=n?-1:0;const o=t.getStep();var t=n?r:r.map(t=>t+o),n=md(t,e);return r=n+a,t=0,e=i.length-1,i[Math.min(e,Math.max(t,r))]}function E_(t,e,n){if(!e)return t.getOptions().domain;if(!O_(t))return o=Cd(e),n?([i]=o,r=t.getOptions()["range"],[r,a]=r,a=a<r?-1:1,[i,t.invert(t.map(i)+a*n)]):o;var r=t.getOptions()["domain"],i=e[0],a=r.indexOf(i);if(n){const s=a+Math.round(r.length*n);return r.slice(a,s)}var o=e[e.length-1];const s=r.indexOf(o);return r.slice(a,s+1)}function S_(t,e,n,r,i,a){const{x:o,y:s}=i;i=(t,e)=>{var[t,n]=a.invert(t);return[k_(o,t,e),k_(s,n,e)]},t=i([t,e],!0),e=i([n,r],!1);return[E_(o,[t[0],e[0]]),E_(s,[t[1],e[1]])]}function A_(t,e){var[t,n]=t;return[e.map(t),e.map(n)+((t=e).getStep?t.getStep():0)]}M_.props={defaultPosition:"top",defaultOrder:2,defaultSize:36};const __=t=>{const{orientation:u,labelFormatter:h,style:f={},position:d}=t,p=at(t,["orientation","labelFormatter","size","style","position"]);return({scales:[n],value:t,theme:e,coordinate:r})=>{var t=t["bbox"],{width:i,height:a}=t,{slider:e={}}=e;const o=(null==(l=n.getFormatter)?void 0:l.call(n))||(t=>t.toString()),s="string"==typeof h?Op(h):h;var l="horizontal"===u;const c=rv(r)&&l;var{trackSize:r=e.trackSize}=f,[t,r]=function(t,e,n){var{x:t,y:r,width:i,height:a}=t;return"left"===e?[t+i-n,r]:"right"===e||"bottom"===e?[t,r]:"top"===e?[t,r+a-n]:void 0}(t,d,r);return new CM({className:"slider",style:Object.assign({},e,Object.assign(Object.assign({x:t,y:r,trackLength:l?i:a,orientation:u,formatter:t=>{var e=s||o,t=c?1-t:t;return e(k_(n,t,!0))}},f),p))})}},T_=(__.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1},t=>__(Object.assign(Object.assign({},t),{orientation:"horizontal"}))),P_=(T_.props=Object.assign(Object.assign({},__.props),{defaultPosition:"bottom"}),t=>__(Object.assign(Object.assign({},t),{orientation:"vertical"}))),C_=(P_.props=Object.assign(Object.assign({},__.props),{defaultPosition:"left"}),t=>{const{orientation:s,style:l}=t,c=at(t,["orientation","labelFormatter","style"]);return({scales:[t],value:e,theme:n})=>{var e=e["bbox"],{x:e,y:r,width:i,height:a}=e,{scrollbar:n={}}=n,{ratio:t,range:o}=t.getOptions(),i="horizontal"===s?i:a,a=i/t,[t,o]=o,t=t<o?0:1;return new jM({className:"g2-scrollbar",style:Object.assign({},n,Object.assign(Object.assign(Object.assign(Object.assign({},l),{x:e,y:r,trackLength:i}),c),{orientation:s,value:t,contentLength:a,viewportLength:i}))})}}),L_=(C_.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1},t=>C_(Object.assign(Object.assign({},t),{orientation:"horizontal"}))),N_=(L_.props=Object.assign(Object.assign({},C_.props),{defaultPosition:"bottom"}),t=>C_(Object.assign(Object.assign({},t),{orientation:"vertical"}))),j_=(N_.props=Object.assign(Object.assign({},C_.props),{defaultPosition:"left"}),t=>()=>new fc),R_=(j_.props={},(c,t)=>{const u=t["coordinate"];return(t,e,n)=>{const[r]=t;var t=r.getBoundingClientRect()["height"],{transform:i="",fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=r.style,[t,l]=rv(u)?[[0,t],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],l=[{transform:(i+" "+l).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(i+" "+l).trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s,offset:.01},{transform:(i+" scale(1, 1)").trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s}],i=(r.setOrigin(t),r.animate(l,Object.assign(Object.assign({},n),c)));return i.finished.then(()=>r.setOrigin(0,0)),i}}),I_=(c,t)=>{const u=t["coordinate"];return(t,e,n)=>{const[r]=t;var t=r.getBoundingClientRect()["height"],{transform:i="",fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=r.style,[t,l]=rv(u)?[[0,t],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],a=[{transform:(i+" scale(1, 1)").trimStart()},{transform:(i+" "+l).trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s,offset:.99},{transform:(i+" "+l).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],o=(r.setOrigin(t),r.animate(a,Object.assign(Object.assign({},n),c)));return o.finished.then(()=>r.setOrigin(0,0)),o}},B_=(c,t)=>{const u=t["coordinate"];return(t,e,n)=>{const[r]=t;var t=r.getBoundingClientRect()["height"],{transform:i="",fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=r.style,[t,l]=rv(u)?[[0,0],"scale(0.0001, 1)"]:[[0,t],"scale(1, 0.0001)"],l=[{transform:(i+" "+l).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(i+" "+l).trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s,offset:.01},{transform:(i+" scale(1, 1)").trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s}],i=(r.setOrigin(t),r.animate(l,Object.assign(Object.assign({},n),c)));return i.finished.then(()=>r.setOrigin(0,0)),i}},D_=(c,t)=>{const u=t["coordinate"];return(t,e,n)=>{const[r]=t;var t=r.getBoundingClientRect()["height"],{transform:i="",fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=r.style,[t,l]=rv(u)?[[0,0],"scale(0.0001, 1)"]:[[0,t],"scale(1, 0.0001)"],a=[{transform:(i+" scale(1, 1)").trimStart()},{transform:(i+" "+l).trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s,offset:.99},{transform:(i+" "+l).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],o=(r.setOrigin(t),r.animate(a,Object.assign(Object.assign({},n),c)));return o.finished.then(()=>r.setOrigin(0,0)),o}},F_=o=>(t,e,n)=>{var[t]=t,{fillOpacity:r=1,strokeOpacity:i=1,opacity:a=1}=t.style;return t.animate([{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:r,strokeOpacity:i,opacity:a}],Object.assign(Object.assign({},n),o))},z_=(F_.props={},o=>(t,e,n)=>{var[t]=t,{fillOpacity:r=1,strokeOpacity:i=1,opacity:a=1}=t.style;return t.animate([{fillOpacity:r,strokeOpacity:i,opacity:a},{fillOpacity:0,strokeOpacity:0,opacity:0}],Object.assign(Object.assign({},n),o))});function W_(t,e){var n={};for(const i of e){var r=t.style[i];r&&(n[i]=r)}return n}z_.props={};const G_=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function H_(t){var{min:t,max:e}=t.getLocalBounds(),[t,n]=t,[e,r]=e;return[t,n,e-t,r-n]}function V_(t,e){var[n,r,i,t]=H_(t),a=Math.ceil(Math.sqrt(e/(t/i))),o=[],s=t/Math.ceil(e/a);let l=0,c=e;for(;0<c;){var u=Math.min(c,a),h=i/u;for(let t=0;t<u;t++){var f=n+t*h,d=r+l*s;o.push(function(t){var[t,e,n,r]=t;return`
2
2
  M ${t} ${e}
3
3
  L ${t+n} ${e}
4
4
  L ${t+n} ${e+r}
5
5
  L ${t} ${e+r}
6
6
  Z
7
- `}([f,d,h,s]))}c-=u,l+=1}return o}function V_(t,e){t.__data__=e.__data__,t.className=e.className,t.markType=e.markType,e.parentNode.replaceChild(t,e)}function Y_(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function q_(t){var e,t=$a(t);if(t&&(Y_(e=t,"m")&&Y_(e,"M")))return t}function $_(t,e,n,r){var i,a,o,s,l,c,u,h,f,d=e["nodeName"],p=n["nodeName"],g=q_(e),y=q_(n);if(d===p&&"path"!==d||(void 0===g||void 0===y))return p=n,d=r,[a,o,v,s]=G_(i=e),f=i.style.transform,l=p.style.transform,[c,m,u,h]=(V_(p,i),G_(p)),f=[Object.assign({transform:`${f?f+" ":""}translate(${a-c}, ${o-m}) scale(${v/u}, ${s/h})`},z_(i,W_)),Object.assign({transform:`${l?l+" ":""}translate(0, 0) scale(1, 1)`},z_(p,W_))],p.animate(f,d);{a=g;const b="path"===(o=(c=t)["nodeName"])?c:(V_(o=new kc({style:Object.assign(Object.assign({},z_(c,W_)),{d:a})}),c),o);var m=[Object.assign({path:g},z_(e,W_)),Object.assign({path:y},z_(n,W_))],v=b.animate(m,r);return v.onfinish=()=>{b.style.transform="none",op(b,n)},b.style.transform="none",v}}const U_=p=>(t,e,n)=>{[r="pack"]=[p.split];var r="function"==typeof r?r:H_,n=Object.assign(Object.assign({},n),p),i=t["length"],a=e["length"];if(1===i&&1===a||1<i&&1<a)return[o]=t,[l]=e,$_(o,o,l,n);if(1===i&&1<a){var[o]=t;{var s=o,l=e,c=n,o=r;s.style.visibility="hidden";const f=o(s,l.length);return l.map((t,e)=>{return $_(t,new kc({style:Object.assign({path:f[e]},z_(s,W_))}),t,c)})}}if(1<i&&1===a){var[i]=e;{var a=t,u=i,h=n;const d=(e=r)(u,a.length);var{fillOpacity:e=1,strokeOpacity:t=1,opacity:i=1}=u.style,e=u.animate([{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:0,strokeOpacity:0,opacity:0,offset:.99},{fillOpacity:e,strokeOpacity:t,opacity:i}],h);return[...a.map((t,e)=>{return $_(t,t,new kc({style:{path:d[e],fill:u.style.fill}}),h)}),e]}}return null},X_=(U_.props={},(m,v)=>{const b=(nc({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:a.NUMBER}),v)["coordinate"];return(t,e,n)=>{const[r]=t;if(!iv(b))return j_(m,v)(t,e,n);const i=b.getCenter();var{__data__:t,style:e}=r,{radius:e=0,inset:a=0,fillOpacity:o=1,strokeOpacity:s=1,opacity:l=1}=e,{points:t,y:c,y1:u}=t;const h=K2().cornerRadius(e).padAngle(a*Math.PI/180),f=Ax(b,t,[c,u]),{startAngle:d,endAngle:p}=f,g=new kc({}),y=t=>{g.attr({d:h(t),transform:`translate(${i[0]}, ${i[1]})`});t=$a(g);return g.style.transform="",t};e=[{waveInArcAngle:d+1e-4,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:d+1e-4,fillOpacity:o,strokeOpacity:s,opacity:l,offset:.01},{waveInArcAngle:p,fillOpacity:o,strokeOpacity:s,opacity:l}],a=r.animate(e,Object.assign(Object.assign({},n),m));return a.onframe=function(){r.style.path=y(Object.assign(Object.assign({},f),{endAngle:Number(r.style.waveInArcAngle)}))},a.onfinish=function(){r.style.path=y(Object.assign(Object.assign({},f),{endAngle:p}))},a}}),K_=(X_.props={},s=>{return(t,e,n)=>{const[r]=t;var{transform:t="",fillOpacity:i=1,strokeOpacity:a=1,opacity:o=1}=r.style,t=[{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:i,strokeOpacity:a,opacity:o,offset:.01},{transform:(t+" scale(1)").trimStart(),fillOpacity:i,strokeOpacity:a,opacity:o}],{width:i,height:a}=r.getBoundingClientRect(),o=(r.setOrigin([i/2,a/2]),r.animate(t,Object.assign(Object.assign({},n),s)));return o.finished.then(()=>r.setOrigin(0,0)),o}}),Z_=s=>{return(t,e,n)=>{const[r]=t;var{transform:t="",fillOpacity:i=1,strokeOpacity:a=1,opacity:o=1}=r.style,i=[{transform:(t+" scale(1)").trimStart()},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:i,strokeOpacity:a,opacity:o,offset:.99},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],{width:a,height:o}=r.getBoundingClientRect(),t=(r.setOrigin([a/2,o/2]),r.animate(i,Object.assign(Object.assign({},n),s)));return t.finished.then(()=>r.setOrigin(0,0)),t}},Q_=i=>(t,e,n)=>{var[t]=t,r=(null==(r=t.getTotalLength)?void 0:r.call(t))||0;return t.animate([{lineDash:[0,r]},{lineDash:[r,0]}],Object.assign(Object.assign({},n),i))},J_=(Q_.props={},(o,s)=>(t,e,n)=>{const[r]=t;var{height:t,width:i}=r.getBoundingClientRect();const a=new kc({style:{path:`M0,0L${i},0L${i},${t}L0,${t}Z`}});r.appendChild(a),r.style.clipPath=a;i=j_(o,s)([a],e,n);return i.finished.then(()=>{a.remove(),r.style.clipPath=null}),i}),tT=(J_.props={},(o,s)=>(t,e,n)=>{const[r]=t;var{height:t,width:i}=r.getBoundingClientRect();const a=new kc({style:{path:`M0,0L${i},0L${i},${t}L0,${t}Z`}});r.appendChild(a),r.style.clipPath=a;i=I_(o,s)([a],e,n);return i.finished.then(()=>{a.remove(),r.style.clipPath=null}),i}),eT=(tT.props={},{visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1});function nT(t,e,n,r){t.style[e]=n,r&&t.children.forEach(t=>nT(t,e,n,r))}function rT(t){nT(t,"visibility","hidden",!0)}function iT(t){nT(t,"visibility","visible",!0)}function aT(t){return lt(t).selectAll("."+bh).nodes().filter(t=>!t.__removed__)}function oT(t,e){return sT(t,e).flatMap(({container:t})=>aT(t))}function sT(e,t){return t.filter(t=>t!==e&&t.options.parentKey===e.options.key)}function lT(t){return lt(t).select("."+wh).node()}function cT(t,e){var{offsetX:e,offsetY:n}=e,{min:[t,r],max:[i,a]}=t.getRenderBounds();return e<t||i<e||(n<r||a<n)?null:[e-t,n-r]}function uT(t,e){var{offsetX:e,offsetY:n}=e,[t,r,i,a]=function(t){var t=t.getRenderBounds(),{min:[t,e],max:[n,r]}=t;return[t,e,n,r]}(t);return[Math.min(i,Math.max(t,e))-t,Math.min(a,Math.max(r,n))-r]}function hT(t){return t=>t.__data__.color}function fT(t){const e=t.scale["x"];return t=>{t=t.__data__.x;return e.invert(t)}}function dT(t){t=Array.isArray(t)?t:[t];const r=new Map(t.flatMap(e=>{return Array.from(e.markState.keys()).map(t=>[e.key+","+t.key,t.data])}));return t=>{var{index:t,markKey:e,viewKey:n}=t.__data__;return r.get(n+","+e)[t]}}function pT(s,l=(t,e)=>t,c=(t,e,n)=>t.setAttribute(e,n)){const u="__states__",h="__ordinal__",i=t=>{var{[u]:e=[],[h]:n={}}=t,e=e.reduce((t,e)=>Object.assign(Object.assign({},t),s[e]),n);if(0!==Object.keys(e).length){for(var[r,i]of Object.entries(e)){a=t,o=r;var a=null!=(a=t.style[o])?a:eT[o],o=l(i,t);c(t,r,o),r in n||(n[r]=a)}t[h]=n}},a=t=>{t[u]||(t[u]=[])};return{setState:(t,...e)=>{a(t),t[u]=[...e],i(t)},removeState:(t,...e)=>{a(t);for(const r of e){var n=t[u].indexOf(r);-1!==n&&t[u].splice(n,1)}i(t)},hasState:(t,e)=>(a(t),-1!==t[u].indexOf(e))}}function gT(t,e){var n=(Array.isArray(t)?t:[t]).flatMap(e=>e.marks.map(t=>[e.key+","+t.key,t.state])),r={};for(const i of e){const[l,c]=Array.isArray(i)?i:[i,{}];r[l]=n.reduce((t,e)=>{const[a,n={}]=e;e=void 0===(e=n[l])||"object"==typeof e&&0===Object.keys(e).length?c:n[l];for(const[r,o]of Object.entries(e)){const s=t[r];t[r]=(t,e,n,r)=>{var i=r.__data__.viewKey+","+r.__data__.markKey;return a!==i?null===s||void 0===s?void 0:s(t,e,n,r):"function"!=typeof o?o:o(t,e,n,r)}}return t},{})}return r}function yT(t,r){const i=new Map(t.map((t,e)=>[t,e])),a=r?t.map(r):t;return(t,e)=>{var n;return"function"!=typeof t?t:(n=i.get(e),t(r?r(e):e,n,a,e))}}function mT(t){var{link:e=!1,valueof:l=(t,e)=>t}=t,c=at(t,["link","valueof","coordinate"]);if(!e)return[()=>{},()=>{}];const u=t=>t.__data__.points;return[t=>{if(!(t.length<=1)){var e=Cd(t,(t,e)=>{t=t.__data__.x,e=e.__data__.x;return t-e});for(let t=1;t<e.length;t++){var n=G2();const s=e[t-1];var r=e[t],[r,i,a,o]=((t,e)=>{var[,t,n]=t,[e,,,r]=e;return[t,e,r,n]})(u(s),u(r)),r=(n.moveTo(...r),n.lineTo(...i),n.lineTo(...a),n.lineTo(...o),n.closePath(),Ap(c,t=>l(t,s))),{fill:i=s.getAttribute("fill")}=r,a=at(r,["fill"]),o=new kc({className:"element-link",style:Object.assign({d:n.toString(),fill:i,zIndex:-2},a)});null!=(r=s.link)&&r.remove(),s.parentNode.appendChild(o),s.link=o}}},t=>{var e;null!=(e=t.link)&&e.remove(),t.link=null}]}function vT(n,t,e){var r,i,a,o=t=>{var e=n.style["transform"];return e?e+" "+t:t};return iv(e)?(a=n.__data__["points"],[a,i]=rv(e)?Sx(a):a,r=a2(a,a=e.getCenter()),i=a2(i,a),a=l2(r)+u2(r,i)/2,o(`translate(${t*Math.cos(a)}, ${t*Math.sin(a)})`)):rv(e)?o(`translate(${t}, 0)`):o(`translate(0, ${-t})`)}function bT(t){var{document:o,background:e,scale:s,coordinate:l,valueof:c}=t,u=at(t,["document","background","scale","coordinate","valueof"]);const h="element-background";if(!e)return[()=>{},()=>{}];const r=(t,e,n)=>{var r=t.invert(e),e=e+t.getBandWidth(r)/2,t=t.getStep(r)/2,r=t*n;return[e-t+r,e+t-r]},f=(t,e)=>{var n=s["x"];return M_(n)?(t=t["__data__"],t=t["x"],[n,t]=r(n,t,e),[n,t]):[0,1]},d=(t,e)=>{var n=s["y"];return M_(n)?(t=t["__data__"],t=t["y"],[n,t]=r(n,t,e),[n,t]):[0,1]},p=(t,e)=>{var n=e["padding"],[r,i]=f(t,n),[n,a]=d(t,n),n=[[r,n],[i,n],[i,a],[r,a]].map(t=>l.map(t)),i=t["__data__"],{y:r,y1:a}=i;return Cx(o,n,{y:r,y1:a},l,e)},g=(t,e)=>{var n,r,{transform:i="scale(1.2, 1.2)",transformOrigin:a="center center",stroke:o=""}=e,e=at(e,["transform","transformOrigin","stroke"]),i=Object.assign({transform:i,transformOrigin:a,stroke:o},e),s=t.cloneNode(!0);for([n,r]of Object.entries(i))s.style[n]=r;return s};return[e=>{e.background&&e.background.remove();var t=Ap(u,t=>c(t,e)),{fill:n="#CCD6EC",fillOpacity:r=.3,zIndex:i=-2,padding:a=.001,strokeWidth:o=0}=t,t=at(t,["fill","fillOpacity","zIndex","padding","strokeWidth"]),t=Object.assign(Object.assign({},t),{fill:n,fillOpacity:r,zIndex:i,padding:a,strokeWidth:o}),n=((()=>{var{x:t,y:e}=s;return[t,e].some(M_)})()?p:g)(e,t);n.className=h,e.parentNode.appendChild(n),e.background=n},t=>{var e;null!=(e=t.background)&&e.remove(),t.background=null},t=>t.className===h]}function xT(t,e){t=t.getRootNode().defaultView.getContextService().getDomElement();null!=t&&t.style&&(t.style.cursor=e)}function wT(t,e,r){return t.find(n=>Object.entries(e).every(([t,e])=>r(n)[t]===e))}function MT(e,{elements:t,datum:a,groupKey:o=t=>t,link:n=!1,background:r=!1,delay:i=60,scale:s,coordinate:l,emitter:c,state:u={}}){const h=t(e),f=new Set(h),d=Sd(h,o);t=yT(h,a);const[p,g]=mT(Object.assign({elements:h,valueof:t,link:n,coordinate:l},st(u.active,"link"))),[y,m,v]=bT(Object.assign({document:e.ownerDocument,scale:s,coordinate:l,background:r,valueof:t},st(u.active,"background"))),{setState:b,removeState:x,hasState:w}=pT(ot(u,{active:Object.assign({},(null==(n=u.active)?void 0:n.offset)&&{transform:(...t)=>{var e=u.active.offset(...t),[,t]=t;return vT(h[t],e,l)}})}),t);let M;const O=t=>{var{target:e,nativeEvent:t=!0}=t;if(f.has(e)){M&&clearTimeout(M);var n=o(e),n=d.get(n),r=new Set(n);for(const i of h)r.has(i)?w(i,"active")||b(i,"active"):(b(i,"inactive"),g(i)),i!==e&&m(i);y(e),p(n),t&&c.emit("element:highlight",{nativeEvent:t,data:{data:a(e),group:n.map(a)}})}},k=(t=!0)=>{for(const e of h)x(e,"active","inactive"),m(e),g(e);t&&c.emit("element:unhighlight",{nativeEvent:t})},E=t=>{t=t.target;r&&!v(t)||(r||f.has(t))&&(0<i?(M&&clearTimeout(M),M=setTimeout(()=>{k(),M=null},i)):k())},S=()=>{k()},A=(e.addEventListener("pointerover",O),e.addEventListener("pointerout",E),e.addEventListener("pointerleave",S),t=>{t=t.nativeEvent;t||k(!1)}),_=t=>{var e=t["nativeEvent"];!e&&(e=t.data["data"],t=wT(h,e,a))&&O({target:t,nativeEvent:!1})};return c.on("element:highlight",_),c.on("element:unhighlight",A),()=>{e.removeEventListener("pointerover",O),e.removeEventListener("pointerout",E),e.removeEventListener("pointerleave",S),c.off("element:highlight",_),c.off("element:unhighlight",A);for(const t of h)m(t),g(t)}}function OT(t){var{delay:s,createGroup:l,background:c=!1,link:u=!1}=t,h=at(t,["delay","createGroup","background","link"]);return(t,e,n)=>{var{container:t,view:r,options:i}=t,{scale:a,coordinate:o}=r;return MT(lT(t),Object.assign({elements:aT,datum:dT(r),groupKey:l?l(r):void 0,coordinate:o,scale:a,state:gT(i,[["active",c?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:c,link:u,delay:s,emitter:n},h))}}function kT(t){return OT(Object.assign(Object.assign({},t),{createGroup:fT}))}function ET(t){return OT(Object.assign(Object.assign({},t),{createGroup:hT}))}function ST(e,{elements:t,datum:f,groupKey:d=t=>t,link:p=!1,single:g=!1,coordinate:n,background:r=!1,scale:i,emitter:y,state:a={}}){const m=t(e),v=new Set(m),b=Sd(m,d);t=yT(m,f);const[x,w]=mT(Object.assign({link:p,elements:m,valueof:t,coordinate:n},st(a.selected,"link"))),[M,O]=bT(Object.assign({document:e.ownerDocument,background:r,coordinate:n,scale:i,valueof:t},st(a.selected,"background"))),{setState:k,removeState:o,hasState:E}=pT(ot(a,{selected:Object.assign({},(null==(r=a.selected)?void 0:r.offset)&&{transform:(...t)=>{var e=a.selected.offset(...t),[,t]=t;return vT(m[t],e,n)}})}),t),S=(t=!0)=>{for(const e of m)o(e,"selected","unselected"),w(e),O(e);t&&y.emit("element:unselect",{nativeEvent:!0})},s=t=>{var{target:e,nativeEvent:n=!0}=t;if(!v.has(e))return S();if(g){var[r,i,a=!0]=[t,e,n];if(E(i,"selected"))S();else{var o=d(i),o=b.get(o),s=new Set(o);for(const l of m)s.has(l)?k(l,"selected"):(k(l,"unselected"),w(l)),l!==i&&O(l);x(o),M(i),a&&y.emit("element:select",Object.assign(Object.assign({},r),{nativeEvent:a,data:{data:[f(i),...o.map(f)]}}))}}else{var[r,a,o=!0]=[t,e,n];t=d(a),t=b.get(t);const c=new Set(t);if(E(a,"selected")){if(!m.some(t=>!c.has(t)&&E(t,"selected")))return S();for(const u of t)k(u,"unselected"),w(u),O(u)}else{e=t.some(t=>E(t,"selected"));for(const h of m)c.has(h)?k(h,"selected"):E(h,"selected")||k(h,"unselected");!e&&p&&x(t),M(a)}o&&y.emit("element:select",Object.assign(Object.assign({},r),{nativeEvent:o,data:{data:m.filter(t=>E(t,"selected")).map(f)}}))}},l=(e.addEventListener("click",s),t=>{var{nativeEvent:t,data:e}=t;if(!t)for(const r of g?e.data.slice(0,1):e.data){var n=wT(m,r,f);s({target:n,nativeEvent:!1})}}),c=()=>{S(!1)};return y.on("element:select",l),y.on("element:unselect",c),()=>{for(const t of m)w(t);e.removeEventListener("click",s),y.off("element:select",l),y.off("element:unselect",c)}}function AT(t){var{createGroup:s,background:l=!1,link:c=!1}=t,u=at(t,["createGroup","background","link"]);return(t,e,n)=>{var{container:t,view:r,options:i}=t,{coordinate:a,scale:o}=r;return ST(lT(t),Object.assign({elements:aT,datum:dT(r),groupKey:s?s(r):void 0,coordinate:a,scale:o,state:gT(i,[["selected",l?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:l,link:c,emitter:n},u))}}function _T(t){return AT(Object.assign(Object.assign({},t),{createGroup:fT}))}function TT(t){return AT(Object.assign(Object.assign({},t),{createGroup:hT}))}function PT(t){var{wait:k=20,leading:E,trailing:S=!1,labelFormatter:A=t=>""+t}=t,_=at(t,["wait","leading","trailing","labelFormatter"]);return t=>{const{options:e,view:n,container:r,update:i}=t,{markState:a,scale:o,coordinate:s}=n;t=function(t,e,r){var[t]=Array.from(t.entries()).filter(([t])=>t.type===e).map(([t])=>{const n=t["encode"];return Object.fromEntries(r.map(t=>{var e=n[t];return[t,e?e.value:void 0]}))});return t}(a,"line",["x","y","series"]);if(!t)return;const{y:f,x:d,series:l=[]}=t;t=f.map((t,e)=>e);const c=Cd(t.map(t=>d[t])),u=ot({},e),h=u.marks.find(t=>"line"===t.type);t=Hd(_d(t,t=>Hd(t,t=>+f[t])/Yd(t,t=>+f[t]),t=>l[t]).values());ot(h,{scale:{y:{domain:[1/t,t]}}});const p=lT(r),g=r.getElementsByClassName(bh);const y=Sd(r.getElementsByClassName(Oh),t=>t.__data__.key.split("-")[0]),m=new wc({style:Object.assign({x1:0,y1:0,x2:0,y2:p.getAttribute("height"),stroke:"black",lineWidth:1},st(_,"rule"))}),v=new Ic({style:Object.assign({x:0,y:p.getAttribute("height"),text:"",fontSize:10},st(_,"label"))}),b=(m.append(v),p.appendChild(m),(t,e,n)=>{var[t]=t.invert(n),n=e.invert(t);return c[vd(c,n)]}),x=(t,e)=>{m.setAttribute("x1",t[0]),m.setAttribute("x2",t[0]),v.setAttribute("text",A(e))};let w;var M;const O=ln(t=>{t=cT(p,t);if(t){var{scale:e,coordinate:n}=w,{x:e,y:r}=e,i=b(n,e,t);x(t,i);for(const u of g){var{seriesIndex:a,key:o}=u.__data__,s=a[dd(t=>d[+t]).center(a,i)],l=[0,r.map(1)],s=[0,r.map(f[s]/f[a[0]])],[,a]=n.map(l),[,l]=n.map(s),c=a-l,s=(u.setAttribute("transform",`translate(0, ${c})`),y.get(o)||[]);for(const h of s)h.setAttribute("dy",c)}}},k,{leading:E,trailing:S});return M=[0,0],X(this,void 0,void 0,function*(){var t=o["x"];const n=b(s,t,M);x(M,n);t=function(t){var{transform:e=[]}=t,n=e.find(t=>"normalizeY"===t.type);return n||(e.push(n={type:"normalizeY"}),t.transform=e,n)}(h);t.groupBy="color",t.basis=(t,e)=>{return e[t[dd(t=>d[+t]).center(t,n)]]};for(const e of u.marks)e.animate=!1;t=yield i(u);w=t.view}),p.addEventListener("pointerenter",O),p.addEventListener("pointermove",O),p.addEventListener("pointerleave",O),()=>{m.remove(),p.removeEventListener("pointerenter",O),p.removeEventListener("pointermove",O),p.removeEventListener("pointerleave",O)}}}function CT({wait:l=30,leading:c,trailing:u=!1}){return t=>{const{options:r,update:i,container:e}=t,a=lT(e),o=ot({},r);for(const s of o.marks)s.animate=!1;const n=ln(t=>{var e,n,t=cT(a,t);t?([t,e]=t,(n=function(t){var{coordinate:e={}}=t,{transform:n=[]}=e,r=n.find(t=>"fisheye"===t.type);return r||(n.push(r={type:"fisheye"}),e.transform=n,t.coordinate=e,r)}(o)).focusX=t,n.focusY=e,n.visual=!0,i(o)):i(r)},l,{leading:c,trailing:u});return a.addEventListener("pointerenter",n),a.addEventListener("pointermove",n),a.addEventListener("pointerleave",n),()=>{a.removeEventListener("pointerenter",n),a.removeEventListener("pointermove",n),a.removeEventListener("pointerleave",n)}}}function LT(t,e){t=t.__data__;const{markKey:n,index:r,seriesIndex:i}=t;t=e.markState;const a=Array.from(t.keys()).find(t=>t.key===n);if(a)return i?i.map(t=>a.data[t]):a.data[r]}function NT(i,a,o,s=t=>!0){return t=>{var e,n,r;s(t)&&(o.emit("plot:"+i,t),e=t["target"],e)&&(r=e["className"],"plot"!==r)&&(r=function(t){if("element"===t.className)return t;let e=t.parent;for(;e&&"element"!==e.className;)e=e.parent;return e}(e))&&({className:e,markType:n}=r,"element"===e?(r=Object.assign(Object.assign({},t),{nativeEvent:!0,data:{data:LT(r,a)}}),o.emit("element:"+i,r),o.emit(n+":"+i,r)):o.emit(e+":"+i,t))}}function jT(){return(t,e,n)=>{const{container:r,view:i}=t,a=NT(pp.CLICK,i,n,t=>1===t.detail),o=NT(pp.DBLCLICK,i,n,t=>2===t.detail),s=NT(pp.POINTER_TAP,i,n),l=NT(pp.POINTER_DOWN,i,n),c=NT(pp.POINTER_UP,i,n),u=NT(pp.POINTER_OVER,i,n),h=NT(pp.POINTER_OUT,i,n),f=NT(pp.POINTER_MOVE,i,n),d=NT(pp.POINTER_ENTER,i,n),p=NT(pp.POINTER_LEAVE,i,n),g=NT(pp.POINTER_UPOUTSIDE,i,n),y=NT(pp.DRAG_START,i,n),m=NT(pp.DRAG,i,n),v=NT(pp.DRAG_END,i,n),b=NT(pp.DRAG_ENTER,i,n),x=NT(pp.DRAG_LEAVE,i,n),w=NT(pp.DRAG_OVER,i,n),M=NT(pp.DROP,i,n);return r.addEventListener("click",a),r.addEventListener("click",o),r.addEventListener("pointertap",s),r.addEventListener("pointerdown",l),r.addEventListener("pointerup",c),r.addEventListener("pointerover",u),r.addEventListener("pointerout",h),r.addEventListener("pointermove",f),r.addEventListener("pointerenter",d),r.addEventListener("pointerleave",p),r.addEventListener("pointerupoutside",g),r.addEventListener("dragstart",y),r.addEventListener("drag",m),r.addEventListener("dragend",v),r.addEventListener("dragenter",b),r.addEventListener("dragleave",x),r.addEventListener("dragover",w),r.addEventListener("drop",M),()=>{r.removeEventListener("click",a),r.removeEventListener("click",o),r.removeEventListener("pointertap",s),r.removeEventListener("pointerdown",l),r.removeEventListener("pointerup",c),r.removeEventListener("pointerover",u),r.removeEventListener("pointerout",h),r.removeEventListener("pointermove",f),r.removeEventListener("pointerenter",d),r.removeEventListener("pointerleave",p),r.removeEventListener("pointerupoutside",g),r.removeEventListener("dragstart",y),r.removeEventListener("drag",m),r.removeEventListener("dragend",v),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",x),r.removeEventListener("dragover",w),r.removeEventListener("drop",M)}}}function RT({root:t,data:e,x:n,y:r,render:i,event:a,single:o,position:s="right-bottom",enterable:l=!1,mount:c,bounding:u}){var h,f,d=t.getRootNode().defaultView.getConfig().container,c=(p=t,(c=c)?"string"==typeof c?document.querySelector(c):c:p.getRootNode().defaultView.getConfig().container),p=o?d:t,o=u||function(t){var{min:[t,e],max:[n,r]}=t.getBounds();return{x:t,y:e,width:n-t,height:r-e}}(t),d=(u=c,t=(t=d).getBoundingClientRect(),u=u.getBoundingClientRect(),{x:t.x-u.x,y:t.y-u.y}),{tooltipElement:c=(t=c,u=n,c=r,h=s,f=l,o=o,d=d,u=new $k({className:"tooltip",style:{x:u,y:c,container:d,data:[],bounding:o,position:h,enterable:f,title:"",offset:[10,10],template:{prefixCls:"g2-"},style:{".g2-tooltip":{},".g2-tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}}}}),t.appendChild(u.HTMLTooltipElement),u)}=p,{items:d,title:o=""}=e;c.update(Object.assign({x:n,y:r,data:d,title:o,position:s,enterable:l},void 0!==i&&{content:i(a,{items:d,title:o})})),p.tooltipElement=c}function IT({root:t,single:e,emitter:n,nativeEvent:r=!0}){r&&n.emit("tooltip:hide",{nativeEvent:r});n=t.getRootNode().defaultView.getConfig().container,r=(e?n:t).tooltipElement;r&&r.hide()}function BT(t){var e=t["tooltipElement"];e&&(e.destroy(),t.tooltipElement=void 0)}function DT(t){var e=t["value"];return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function FT(t,e){var{color:t,series:n}=t,{color:e,series:r}=e,i=t=>t&&t.invert&&!(t instanceof yg)&&!(t instanceof hg);return i(n)?n.invert(r):r&&r!==e?r:!i(t)||(n=t.invert(e),Array.isArray(n))?null:n}function zT(t){var e=t.getAttribute("fill"),n=t.getAttribute("stroke"),t=t["__data__"],{color:t=e&&"transparent"!==e?e:n}=t;return t}function WT(t,e=t=>t){t=new Map(t.map(t=>[e(t),t]));return Array.from(t.values())}function GT(n,s,l,t=n.map(t=>t.__data__)){const e=t=>t instanceof Date?+t:t;var r=WT(t.map(t=>t.title),e).filter(sp),t=t.flatMap((r,t)=>{const i=n[t],{items:e=[],title:a}=r;t=e.filter(sp);const o=void 0!==l?l:e.length<=1;return t.map(t=>{var{color:e=zT(i),name:n}=t,t=at(t,["color","name"]),n=o?FT(s,r)||n:n||FT(s,r);return Object.assign(Object.assign({},t),{color:e,name:n||a})})}).map(DT);return Object.assign(Object.assign({},0<r.length&&{title:r.join(",")}),{items:WT(t,t=>`(${e(t.name)}, ${e(t.value)}, ${e(t.color)})`)})}function HT(t,e,n){var{plotWidth:r,plotHeight:i,mainWidth:a,mainHeight:o,startX:s,startY:l,transposed:c,polar:u,insetLeft:h,insetTop:f}=n,n=at(n,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const d=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},n);n=e.map(t=>t[1]),e=e.map(t=>t[0]);const p=Zd(n),g=Zd(e);const[y,m,v,b]=u?(n=Math.min(a,o)/2,a=l2(a2([g,p],[u=s+h+a/2,h=l+f+o/2])),[u,u+n*Math.cos(a),h,h+n*Math.sin(a)]):c?[s,s+r,p+l,p+l]:[g+s,g+s,l,l+i];0<e.length&&((o=t.ruleY||(f=new wc({style:Object.assign({x1:y,x2:m,y1:v,y2:b},d)}),t.appendChild(f),f)).style.x1=y,o.style.x2=m,o.style.y1=v,o.style.y2=b,t.ruleY=o)}function VT(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function YT(t,e){return Array.from(t.values()).some(t=>{return null==(t=t.interaction)?void 0:t[e]})}function qT(t,e){return void 0===t?e:t}function $T(t){var{title:t,items:e}=t;return 0===e.length&&void 0===t}function UT(p,t){var{elements:e,sort:g,filter:y,scale:m,coordinate:v,crosshairs:b,render:x,groupName:w,emitter:M,wait:n=50,leading:r=!0,trailing:i=!1,startX:O=0,startY:k=0,body:E=!0,single:S=!0,position:A,enterable:_,mount:T,bounding:P,disableNative:a=!1,style:o={}}=t,t=at(t,["elements","sort","filter","scale","coordinate","crosshairs","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","disableNative","style"]),e=e(p);const C=rv(v),L=iv(v);o=ot(o,t);const{innerWidth:D,innerHeight:F,width:z,height:W,insetLeft:G,insetTop:H}=v.getOptions(),N=[],j=[];for(const h of e){var s=h["__data__"],s=s["seriesX"];(s?N:j).push(h)}N.sort((t,e)=>{const n=C?0:1;var r=t=>t.getBounds().min[n];return C?r(e)-r(t):r(t)-r(e)});const V=new Map(N.map(t=>{var e=t["__data__"];const n=e["seriesX"];return[t,[Cd(n.map((t,e)=>e),t=>n[+t]),n]]})),Y=st(o,"crosshairs");t=m.x;const R=null!=t&&t.getBandWidth?t.getBandWidth()/2:0,I=t=>{var[t]=v.invert(t);return t-R},q=(t,e)=>{const n=C?1:0,r=t[n];return e.filter(t=>{var[t,e]=(t=>{var{min:t,max:e}=t.getLocalBounds();return Cd([t[n],e[n]])})(t);return r>=t&&r<=e})},l=ln(t=>{var e=cT(p,t);if(e){var n=p.getRenderBounds();const c=n.min[0],u=n.min[1],h=[e[0]-O,e[1]-k];h;var n=q(h,j),r=[],i=[];for(const d of N){var[a,o]=V.get(d),a=((t,e,n)=>{var t=I(t),[r,i]=Cd([n[0],n[n.length-1]]);return t<r||i<t?null:e[(0,dd(t=>n[+t]).center)(e,t)]})(h,a,o);if(null!==a){r.push(d);o=((t,n)=>{t=t.__data__;return Object.fromEntries(Object.entries(t).filter(([t])=>t.startsWith("series")&&"series"!==t).map(([t,e])=>{e=e[n];return[qe(t.replace("series","")),e]}))})(d,a);const{x:c,y:u}=o;a=v.map([(c||0)+R,u||0]);i.push([o,a])}}var s=Array.from(new Set(i.map(t=>t[0].x)));const f=s[qd(s,t=>Math.abs(t-I(h)))];var s=i.filter(t=>t[0].x===f),l=[...s.map(t=>t[0]),...n.map(t=>t.__data__)],n=[...r,...n],l=GT(n,m,w,l);g&&l.items.sort((t,e)=>g(t)-g(e)),y&&(l.items=l.items.filter(y)),0===n.length||$T(l)?B():(E&&RT({root:p,data:l,x:e[0]+c,y:e[1]+u,render:x,event:t,single:S,position:A,enterable:_,mount:T,bounding:P}),b&&(n=s.map(t=>t[1]),HT(p,n,Object.assign(Object.assign({},Y),{plotWidth:D,plotHeight:F,mainWidth:z,mainHeight:W,insetLeft:G,insetTop:H,startX:O,startY:k,transposed:C,polar:L}))),M.emit("tooltip:show",Object.assign(Object.assign({},t),{nativeEvent:!0,data:{data:{x:O_(m.x,I(h),!0)}}})))}},n,{leading:r,trailing:i}),B=()=>{IT({root:p,single:S,emitter:M,mount:T}),b&&VT(p)},c=({nativeEvent:t,data:e})=>{var n,r;t||(t=e.data["x"],e=m["x"],e=e.map(t),[t,e]=v.map([e,.5]),[n,r]=p.getRenderBounds()["min"],l({offsetX:t+n,offsetY:e+r}))},u=()=>{IT({root:p,single:S,emitter:M,nativeEvent:!1,mount:T})};return M.on("tooltip:show",c),M.on("tooltip:hide",u),a||(p.addEventListener("pointerenter",l),p.addEventListener("pointermove",l),p.addEventListener("pointerleave",B)),()=>{a||(p.removeEventListener("pointerenter",l),p.removeEventListener("pointermove",l),p.removeEventListener("pointerleave",B)),M.off("tooltip:show",c),M.off("tooltip:hide",u),BT(p),b&&VT(p)}}function XT(a,{elements:t,scale:o,render:s,groupName:l,sort:c,filter:u,emitter:h,wait:e=50,leading:n=!0,trailing:r=!1,groupKey:f=t=>t,single:d=!0,position:p,enterable:g,datum:y,view:m,mount:v,bounding:b,body:x=!0,disableNative:i=!1}){const w=t(a),M=new Set(w),O=Sd(w,f),k=ln(t=>{var e,n,r,i=t["target"];!M.has(i)||(e=f(i),e=1===(e=O.get(e)).length?function(n){var{title:t,items:e=[]}=t=n["__data__"],e=e.filter(sp).map(t=>{var{color:e=zT(n)}=t,t=at(t,["color"]);return Object.assign(Object.assign({},t),{color:e})}).map(DT);return Object.assign(Object.assign({},t&&{title:t}),{items:e})}(e[0]):GT(e,o,l),c&&e.items.sort((t,e)=>c(t)-c(e)),u&&(e.items=e.items.filter(u)),$T(e))?IT({root:a,single:d,emitter:h,mount:v}):({offsetX:n,offsetY:r}=t,x&&RT({root:a,data:e,x:n,y:r,render:s,event:t,single:d,position:p,enterable:g,mount:v,bounding:b}),h.emit("tooltip:show",Object.assign(Object.assign({},t),{nativeEvent:!0,data:{data:LT(i,m)}})))},e,{leading:n,trailing:r}),E=t=>{t=t.target;M.has(t)&&IT({root:a,single:d,emitter:h,mount:v})},S=({nativeEvent:t,data:e})=>{var n,r,i;t||(t=wT(w,e.data,y))&&({x:e,y:n,width:r,height:i}=t.getBBox(),k({target:t,offsetX:e+r/2,offsetY:n+i/2}))},A=({nativeEvent:t}={})=>{t||IT({root:a,single:d,emitter:h,nativeEvent:!1,mount:v})};return h.on("tooltip:show",S),h.on("tooltip:hide",A),i||(a.addEventListener("pointerover",k),a.addEventListener("pointermove",k),a.addEventListener("pointerout",E)),()=>{i||(a.removeEventListener("pointerover",k),a.removeEventListener("pointermove",k),a.removeEventListener("pointerout",E)),h.off("tooltip:show",S),h.off("tooltip:hide",A),BT(a)}}function KT(t){const{shared:h,crosshairs:f,series:d,item:p=()=>({}),facet:g=!1}=t,y=at(t,["shared","crosshairs","series","name","item","facet"]);return(e,t,n)=>{var{container:r,view:i}=e;const{scale:a,markState:o,coordinate:s}=i;var l=YT(o,"seriesTooltip"),c=YT(o,"crosshairs"),r=lT(r),l=qT(d,l);if(l&&Array.from(o.values()).some(t=>{var e;return(null==(e=t.interaction)?void 0:e.seriesTooltip)&&t.tooltip})&&!g)return UT(r,Object.assign(Object.assign({},y),{elements:aT,scale:a,coordinate:s,crosshairs:qT(f,c),item:p,emitter:n}));if(l&&g){l=t.filter(t=>t!==e&&t.options.parentKey===e.options.key);const u=oT(e,t),a=l[0].view.scale;t=r.getBounds(),l=t.min[0],t=t.min[1];return UT(r.parentNode.parentNode,Object.assign(Object.assign({},y),{elements:()=>u,scale:a,coordinate:s,crosshairs:qT(f,c),item:p,startX:l,startY:t,emitter:n}))}return XT(r,Object.assign(Object.assign({},y),{datum:dT(i),elements:aT,scale:a,coordinate:s,groupKey:h?fT(i):void 0,item:p,emitter:n,view:i}))}}const ZT="legend-category",QT="legend-continuous",JT="items-item",t6="legend-category-item-marker",e6="legend-category-item-label";function n6(t){return t.getElementsByClassName(t6)[0]}function r6(t){return t.getElementsByClassName(e6)[0]}function i6(t){return t.getElementsByClassName(JT)}function a6(t){return t.getElementsByClassName(ZT)}function o6(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function s6(t,{legends:e,marker:i,label:a,datum:o,filter:r,emitter:s,channel:l,state:n={}}){const c=new Map,u=new Map,h=new Map;var{unselected:n={markerStroke:"#aaa",markerFill:"#aaa",labelFill:"#aaa"}}=n,f={unselected:st(n,"marker")},n={unselected:st(n,"label")};const{setState:d,removeState:p}=pT(f,void 0),{setState:g,removeState:y}=pT(n,void 0),m=Array.from(e(t));let v=m.map(o);const b=()=>{for(const r of m){var t=o(r),e=i(r),n=a(r);(v.includes(t)?(p(e,"unselected"),y):(d(e,"unselected"),g))(n,"unselected")}};for(const E of m){var x=()=>{xT(t,"pointer")},w=()=>{xT(t,"default")},M=n=>X(this,void 0,void 0,function*(){var t=o(E),e=v.indexOf(t),{nativeEvent:t=!0}=(-1===e?v.push(t):v.splice(e,1),0===v.length&&v.push(...m.map(o)),yield r(v),b(),n);t&&(v.length===m.length?s.emit("legend:reset",{nativeEvent:t}):s.emit("legend:filter",Object.assign(Object.assign({},n),{nativeEvent:t,data:{channel:l,values:v}})))});E.addEventListener("click",M),E.addEventListener("pointerenter",x),E.addEventListener("pointerout",w),c.set(E,M),u.set(E,x),h.set(E,w)}const O=n=>X(this,void 0,void 0,function*(){var t,e=n["nativeEvent"];e||(e=n["data"],{channel:e,values:t}=e,e===l&&(v=t,yield r(v),b()))}),k=e=>X(this,void 0,void 0,function*(){var t=e["nativeEvent"];t||(v=m.map(o),yield r(v),b())});return s.on("legend:filter",O),s.on("legend:reset",k),()=>{for(const t of m)t.removeEventListener("click",c.get(t)),t.removeEventListener("pointerenter",u.get(t)),t.removeEventListener("pointerout",h.get(t)),s.off("legend:filter",O),s.off("legend:reset",k)}}function l6(){return(t,e,c)=>{const{container:u,view:s,options:n,update:l}=t;t=[...a6(u),...u.getElementsByClassName(QT)];const h=ln((r,i,a,o)=>X(this,void 0,void 0,function*(){var t=n["marks"],t=t.map(t=>{var e,n;return"legends"===t.type?t:({transform:e=[]}=t,n=e.findIndex(({type:t})=>t.startsWith("group")||t.startsWith("bin")),(e=[...e]).splice(n+1,0,{type:"filter",[r]:{value:i,ordinal:a}}),n=Object.fromEntries(o.map(t=>[t,{domain:s.scale[t].getOptions().domain}])),ot({},t,Object.assign(Object.assign({transform:e,scale:n},!a&&{animate:!1}),{legend:{[r]:{preserve:!0}}})))}),t=Object.assign(Object.assign({},n),{marks:t});yield l(t)}),50,{trailing:!0}),r=t.map(t=>{const{name:e,domain:n}=o6(t).scales[0],r=o6(t).scales.map(t=>t.name);if(t.className===ZT)return s6(u,{legends:i6,marker:n6,label:r6,datum:t=>{t=t.__data__,t=t.index;return n[t]},filter:t=>h(e,t,!0,r),state:t.attributes.state,channel:e,emitter:c});{var{legend:i,filter:a,emitter:o,channel:s}=[(u,{legend:t,filter:t=>h(e,t,!1,r),emitter:c,channel:e})][0];const l=({detail:{value:t}})=>{a(t),o.emit({nativeEvent:!0,data:{channel:s,values:t}})};return i.addEventListener("valuechange",l),()=>{i.removeEventListener("valuechange",l)};return}});return()=>{r.forEach(t=>t())}}}function c6(){return(t,e,a)=>{const{container:n,view:r,options:i}=t;t=a6(n);const o=aT(n);var s=gT(i,["active","inactive"]),l=yT(o,dT(r));const c=[];for(const d of t){const p=t=>{var e=d.attributes["data"],t=t["__data__"],t=t["index"];return e[t].label},g=o6(d).scales[0].name,y=i6(d),m=(t=>{var{scale:{[t]:t}}=r;return t})(g),v=Sd(o,t=>m.invert(t.__data__[g]));var{state:u={}}=d.attributes,{inactive:u={}}=u;const{setState:b,removeState:x}=pT(s,l);var h={inactive:st(u,"marker")},u={inactive:st(u,"label")};const{setState:w,removeState:M}=pT(h),{setState:O,removeState:k}=pT(u),E=t=>{for(const r of y){var e=n6(r),n=r6(r);(r===t||null===t?(M(e,"inactive"),k):(w(e,"inactive"),O))(n,"inactive")}},S=(t,e)=>{var n=p(e),r=new Set(v.get(n));for(const i of o)r.has(i)?b(i,"active"):b(i,"inactive");E(e);var{nativeEvent:e=!0}=t;e&&a.emit("legend:highlight",Object.assign(Object.assign({},t),{nativeEvent:e,data:{channel:g,value:n}}))},A=new Map;for(const C of y){var f=t=>{S(t,C)};C.addEventListener("pointerover",f),A.set(C,f)}const _=t=>{for(const e of o)x(e,"inactive","active");E(null);var{nativeEvent:t=!0}=t;t&&a.emit("legend:unhighlight",{nativeEvent:t})},T=t=>{var{nativeEvent:t,data:e}=t;if(!t){const{channel:n,value:r}=e;n===g&&(t=y.find(t=>p(t)===r))&&S({nativeEvent:!1},t)}},P=t=>{t=t.nativeEvent;t||_({nativeEvent:!1})};d.addEventListener("pointerleave",_),a.on("legend:highlight",T),a.on("legend:unhighlight",P);c.push(()=>{d.removeEventListener(_),a.off("legend:highlight",T),a.off("legend:unhighlight",P);for(var[t,e]of A)t.removeEventListener(e)})}return()=>c.forEach(t=>t())}}function u6(t,e){for(var[n,r]of Object.entries(e))t.style(n,r)}const h6=Rx(t=>{const e=t.attributes,{x:n,y:r,width:i,height:a,class:o,handleSize:s=10,document:l}=e,c=at(e,["x","y","width","height","class","renders","handleSize","document"]);if(l&&void 0!==i&&void 0!==a&&void 0!==n&&void 0!==r){var u=s/2,h=(t,e,n)=>{t.handle||(t.handle=n.createElement("rect"),t.append(t.handle));n=t.handle;return n.attr(e),n},f=st(cp(c,"handleNW","handleNE"),"handleN"),{render:d=h}=f,f=at(f,["render"]),p=st(c,"handleE"),{render:g=h}=p,p=at(p,["render"]),y=st(cp(c,"handleSE","handleSW"),"handleS"),{render:m=h}=y,y=at(y,["render"]),v=st(c,"handleW"),{render:b=h}=v,v=at(v,["render"]),x=st(c,"handleNW"),{render:w=h}=x,x=at(x,["render"]),M=st(c,"handleNE"),{render:O=h}=M,M=at(M,["render"]),k=st(c,"handleSE"),{render:E=h}=k,k=at(k,["render"]),S=st(c,"handleSW"),{render:h=h}=S,S=at(S,["render"]);var A=i=>()=>{return new(Rx(t=>{return e=i,n=(t=t).id,r=at(t.attributes,["x","y"]),(e=e(t,Object.assign({x:0,y:0},r),l)).id=n,void(e.style.draggable=!0);var e,n,r}))({})},t=lt(t).attr("className",o).style("x",n).style("y",r).style("draggable",!0);t.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(u6,Object.assign({width:i,height:a},cp(c,"handle"))),t.maybeAppend("handle-n",A(d)).style("x",u).style("y",-u).style("width",i-s).style("height",s).style("fill","transparent").call(u6,f),t.maybeAppend("handle-e",A(g)).style("x",i-u).style("y",u).style("width",s).style("height",a-s).style("fill","transparent").call(u6,p),t.maybeAppend("handle-s",A(m)).style("x",u).style("y",a-u).style("width",i-s).style("height",s).style("fill","transparent").call(u6,y),t.maybeAppend("handle-w",A(b)).style("x",-u).style("y",u).style("width",s).style("height",a-s).style("fill","transparent").call(u6,v),t.maybeAppend("handle-nw",A(w)).style("x",-u).style("y",-u).style("width",s).style("height",s).style("fill","transparent").call(u6,x),t.maybeAppend("handle-ne",A(O)).style("x",i-u).style("y",-u).style("width",s).style("height",s).style("fill","transparent").call(u6,M),t.maybeAppend("handle-se",A(E)).style("x",i-u).style("y",a-u).style("width",s).style("height",s).style("fill","transparent").call(u6,k),t.maybeAppend("handle-sw",A(h)).style("x",-u).style("y",a-u).style("width",s).style("height",s).style("fill","transparent").call(u6,S)}});function f6(l,t){var{brushed:a=()=>{},brushended:e=()=>{},brushcreated:o=()=>{},extent:s=function(t){var{width:t,height:e}=t.getBBox();return[0,0,t,e]}(l),brushRegion:c=(t,e,n,r,i)=>[t,e,n,r],reverse:u=!1,fill:n="#777",fillOpacity:r="0.3",stroke:i="#fff",selectedHandles:h=["handle-n","handle-e","handle-s","handle-w","handle-nw","handle-ne","handle-se","handle-sw"]}=t,f=at(t,["brushed","brushended","brushcreated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let d=null,p=null,g=null,y=null,m=null,v=!1;const[b,x,w,M]=s,O=(xT(l,"crosshair"),l.style.draggable=!0,(t,e)=>{if(y&&y.remove(),m&&m.remove(),d=[t,e],u)return I();B()}),I=()=>{m=new kc({style:Object.assign(Object.assign({},f),{fill:n,fillOpacity:r,stroke:i,pointerEvents:"none"})}),y=new h6({style:{x:0,y:0,width:0,height:0,draggable:!0,document:l.ownerDocument},className:"mask"}),l.appendChild(m),l.appendChild(y)},B=()=>{y=new h6({style:Object.assign(Object.assign({document:l.ownerDocument,x:0,y:0},f),{fill:n,fillOpacity:r,stroke:i,draggable:!0}),className:"mask"}),l.appendChild(y)},k=(t=!0)=>{y&&y.remove(),m&&m.remove(),d=null,p=null,g=null,v=!1,y=null,m=null,e(t)},E=(t,e,n=!0)=>{var[t,e,r,i]=function(t,e,n,r,i){var[i,a,o,s]=i;return[Math.max(i,Math.min(t,n)),Math.max(a,Math.min(e,r)),Math.min(o,Math.max(t,n)),Math.min(s,Math.max(e,r))]}(t[0],t[1],e[0],e[1],s),[t,e,r,i]=c(t,e,r,i,s);return(u?F:D)(t,e,r,i),a(t,e,r,i,n),[t,e,r,i]},D=(t,e,n,r)=>{y.style.x=t,y.style.y=e,y.style.width=n-t,y.style.height=r-e},F=(t,e,n,r)=>{m.style.d=`
7
+ `}([f,d,h,s]))}c-=u,l+=1}return o}function Y_(t,e){t.__data__=e.__data__,t.className=e.className,t.markType=e.markType,e.parentNode.replaceChild(t,e)}function q_(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function $_(t){var e,t=$a(t);if(t&&(q_(e=t,"m")&&q_(e,"M")))return t}function U_(t,e,n,r){var i,a,o,s,l,c,u,h,f,d=e["nodeName"],p=n["nodeName"],g=$_(e),y=$_(n);if(d===p&&"path"!==d||(void 0===g||void 0===y))return p=n,d=r,[a,o,v,s]=H_(i=e),f=i.style.transform,l=p.style.transform,[c,m,u,h]=(Y_(p,i),H_(p)),f=[Object.assign({transform:`${f?f+" ":""}translate(${a-c}, ${o-m}) scale(${v/u}, ${s/h})`},W_(i,G_)),Object.assign({transform:`${l?l+" ":""}translate(0, 0) scale(1, 1)`},W_(p,G_))],p.animate(f,d);{a=g;const b="path"===(o=(c=t)["nodeName"])?c:(Y_(o=new kc({style:Object.assign(Object.assign({},W_(c,G_)),{d:a})}),c),o);var m=[Object.assign({path:g},W_(e,G_)),Object.assign({path:y},W_(n,G_))],v=b.animate(m,r);return v.onfinish=()=>{b.style.transform="none",op(b,n)},b.style.transform="none",v}}const X_=p=>(t,e,n)=>{[r="pack"]=[p.split];var r="function"==typeof r?r:V_,n=Object.assign(Object.assign({},n),p),i=t["length"],a=e["length"];if(1===i&&1===a||1<i&&1<a)return[o]=t,[l]=e,U_(o,o,l,n);if(1===i&&1<a){var[o]=t;{var s=o,l=e,c=n,o=r;s.style.visibility="hidden";const f=o(s,l.length);return l.map((t,e)=>{return U_(t,new kc({style:Object.assign({path:f[e]},W_(s,G_))}),t,c)})}}if(1<i&&1===a){var[i]=e;{var a=t,u=i,h=n;const d=(e=r)(u,a.length);var{fillOpacity:e=1,strokeOpacity:t=1,opacity:i=1}=u.style,e=u.animate([{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:0,strokeOpacity:0,opacity:0,offset:.99},{fillOpacity:e,strokeOpacity:t,opacity:i}],h);return[...a.map((t,e)=>{return U_(t,t,new kc({style:{path:d[e],fill:u.style.fill}}),h)}),e]}}return null},K_=(X_.props={},(m,v)=>{const b=(nc({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:a.NUMBER}),v)["coordinate"];return(t,e,n)=>{const[r]=t;if(!iv(b))return R_(m,v)(t,e,n);const i=b.getCenter();var{__data__:t,style:e}=r,{radius:e=0,inset:a=0,fillOpacity:o=1,strokeOpacity:s=1,opacity:l=1}=e,{points:t,y:c,y1:u}=t;const h=K2().cornerRadius(e).padAngle(a*Math.PI/180),f=Ax(b,t,[c,u]),{startAngle:d,endAngle:p}=f,g=new kc({}),y=t=>{g.attr({d:h(t),transform:`translate(${i[0]}, ${i[1]})`});t=$a(g);return g.style.transform="",t};e=[{waveInArcAngle:d+1e-4,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:d+1e-4,fillOpacity:o,strokeOpacity:s,opacity:l,offset:.01},{waveInArcAngle:p,fillOpacity:o,strokeOpacity:s,opacity:l}],a=r.animate(e,Object.assign(Object.assign({},n),m));return a.onframe=function(){r.style.path=y(Object.assign(Object.assign({},f),{endAngle:Number(r.style.waveInArcAngle)}))},a.onfinish=function(){r.style.path=y(Object.assign(Object.assign({},f),{endAngle:p}))},a}}),Z_=(K_.props={},s=>{return(t,e,n)=>{const[r]=t;var{transform:t="",fillOpacity:i=1,strokeOpacity:a=1,opacity:o=1}=r.style,t=[{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:i,strokeOpacity:a,opacity:o,offset:.01},{transform:(t+" scale(1)").trimStart(),fillOpacity:i,strokeOpacity:a,opacity:o}],{width:i,height:a}=r.getBoundingClientRect(),o=(r.setOrigin([i/2,a/2]),r.animate(t,Object.assign(Object.assign({},n),s)));return o.finished.then(()=>r.setOrigin(0,0)),o}}),Q_=s=>{return(t,e,n)=>{const[r]=t;var{transform:t="",fillOpacity:i=1,strokeOpacity:a=1,opacity:o=1}=r.style,i=[{transform:(t+" scale(1)").trimStart()},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:i,strokeOpacity:a,opacity:o,offset:.99},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],{width:a,height:o}=r.getBoundingClientRect(),t=(r.setOrigin([a/2,o/2]),r.animate(i,Object.assign(Object.assign({},n),s)));return t.finished.then(()=>r.setOrigin(0,0)),t}},J_=i=>(t,e,n)=>{var[t]=t,r=(null==(r=t.getTotalLength)?void 0:r.call(t))||0;return t.animate([{lineDash:[0,r]},{lineDash:[r,0]}],Object.assign(Object.assign({},n),i))},tT=(J_.props={},(o,s)=>(t,e,n)=>{const[r]=t;var{height:t,width:i}=r.getBoundingClientRect();const a=new kc({style:{path:`M0,0L${i},0L${i},${t}L0,${t}Z`}});r.appendChild(a),r.style.clipPath=a;i=R_(o,s)([a],e,n);return i.finished.then(()=>{a.remove(),r.style.clipPath=null}),i}),eT=(tT.props={},(o,s)=>(t,e,n)=>{const[r]=t;var{height:t,width:i}=r.getBoundingClientRect();const a=new kc({style:{path:`M0,0L${i},0L${i},${t}L0,${t}Z`}});r.appendChild(a),r.style.clipPath=a;i=B_(o,s)([a],e,n);return i.finished.then(()=>{a.remove(),r.style.clipPath=null}),i}),nT=(eT.props={},{visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1});function rT(t,e,n,r){t.style[e]=n,r&&t.children.forEach(t=>rT(t,e,n,r))}function iT(t){rT(t,"visibility","hidden",!0)}function aT(t){rT(t,"visibility","visible",!0)}function oT(t){return lt(t).selectAll("."+bh).nodes().filter(t=>!t.__removed__)}function sT(t,e){return lT(t,e).flatMap(({container:t})=>oT(t))}function lT(e,t){return t.filter(t=>t!==e&&t.options.parentKey===e.options.key)}function cT(t){return lt(t).select("."+wh).node()}function uT(t,e){var{offsetX:e,offsetY:n}=e,{min:[t,r],max:[i,a]}=t.getRenderBounds();return e<t||i<e||(n<r||a<n)?null:[e-t,n-r]}function hT(t,e){var{offsetX:e,offsetY:n}=e,[t,r,i,a]=function(t){var t=t.getRenderBounds(),{min:[t,e],max:[n,r]}=t;return[t,e,n,r]}(t);return[Math.min(i,Math.max(t,e))-t,Math.min(a,Math.max(r,n))-r]}function fT(t){return t=>t.__data__.color}function dT(t){const e=t.scale["x"];return t=>{t=t.__data__.x;return e.invert(t)}}function pT(t){t=Array.isArray(t)?t:[t];const r=new Map(t.flatMap(e=>{return Array.from(e.markState.keys()).map(t=>[e.key+","+t.key,t.data])}));return t=>{var{index:t,markKey:e,viewKey:n}=t.__data__;return r.get(n+","+e)[t]}}function gT(s,l=(t,e)=>t,c=(t,e,n)=>t.setAttribute(e,n)){const u="__states__",h="__ordinal__",i=t=>{var{[u]:e=[],[h]:n={}}=t,e=e.reduce((t,e)=>Object.assign(Object.assign({},t),s[e]),n);if(0!==Object.keys(e).length){for(var[r,i]of Object.entries(e)){a=t,o=r;var a=null!=(a=t.style[o])?a:nT[o],o=l(i,t);c(t,r,o),r in n||(n[r]=a)}t[h]=n}},a=t=>{t[u]||(t[u]=[])};return{setState:(t,...e)=>{a(t),t[u]=[...e],i(t)},removeState:(t,...e)=>{a(t);for(const r of e){var n=t[u].indexOf(r);-1!==n&&t[u].splice(n,1)}i(t)},hasState:(t,e)=>(a(t),-1!==t[u].indexOf(e))}}function yT(t,e){var n=(Array.isArray(t)?t:[t]).flatMap(e=>e.marks.map(t=>[e.key+","+t.key,t.state])),r={};for(const i of e){const[l,c]=Array.isArray(i)?i:[i,{}];r[l]=n.reduce((t,e)=>{const[a,n={}]=e;e=void 0===(e=n[l])||"object"==typeof e&&0===Object.keys(e).length?c:n[l];for(const[r,o]of Object.entries(e)){const s=t[r];t[r]=(t,e,n,r)=>{var i=r.__data__.viewKey+","+r.__data__.markKey;return a!==i?null===s||void 0===s?void 0:s(t,e,n,r):"function"!=typeof o?o:o(t,e,n,r)}}return t},{})}return r}function mT(t,r){const i=new Map(t.map((t,e)=>[t,e])),a=r?t.map(r):t;return(t,e)=>{var n;return"function"!=typeof t?t:(n=i.get(e),t(r?r(e):e,n,a,e))}}function vT(t){var{link:e=!1,valueof:l=(t,e)=>t}=t,c=at(t,["link","valueof","coordinate"]);if(!e)return[()=>{},()=>{}];const u=t=>t.__data__.points;return[t=>{if(!(t.length<=1)){var e=Cd(t,(t,e)=>{t=t.__data__.x,e=e.__data__.x;return t-e});for(let t=1;t<e.length;t++){var n=G2();const s=e[t-1];var r=e[t],[r,i,a,o]=((t,e)=>{var[,t,n]=t,[e,,,r]=e;return[t,e,r,n]})(u(s),u(r)),r=(n.moveTo(...r),n.lineTo(...i),n.lineTo(...a),n.lineTo(...o),n.closePath(),Ap(c,t=>l(t,s))),{fill:i=s.getAttribute("fill")}=r,a=at(r,["fill"]),o=new kc({className:"element-link",style:Object.assign({d:n.toString(),fill:i,zIndex:-2},a)});null!=(r=s.link)&&r.remove(),s.parentNode.appendChild(o),s.link=o}}},t=>{var e;null!=(e=t.link)&&e.remove(),t.link=null}]}function bT(n,t,e){var r,i,a,o=t=>{var e=n.style["transform"];return e?e+" "+t:t};return iv(e)?(a=n.__data__["points"],[a,i]=rv(e)?Sx(a):a,r=a2(a,a=e.getCenter()),i=a2(i,a),a=l2(r)+u2(r,i)/2,o(`translate(${t*Math.cos(a)}, ${t*Math.sin(a)})`)):rv(e)?o(`translate(${t}, 0)`):o(`translate(0, ${-t})`)}function xT(t){var{document:o,background:e,scale:s,coordinate:l,valueof:c}=t,u=at(t,["document","background","scale","coordinate","valueof"]);const h="element-background";if(!e)return[()=>{},()=>{}];const r=(t,e,n)=>{var r=t.invert(e),e=e+t.getBandWidth(r)/2,t=t.getStep(r)/2,r=t*n;return[e-t+r,e+t-r]},f=(t,e)=>{var n=s["x"];return O_(n)?(t=t["__data__"],t=t["x"],[n,t]=r(n,t,e),[n,t]):[0,1]},d=(t,e)=>{var n=s["y"];return O_(n)?(t=t["__data__"],t=t["y"],[n,t]=r(n,t,e),[n,t]):[0,1]},p=(t,e)=>{var n=e["padding"],[r,i]=f(t,n),[n,a]=d(t,n),n=[[r,n],[i,n],[i,a],[r,a]].map(t=>l.map(t)),i=t["__data__"],{y:r,y1:a}=i;return Cx(o,n,{y:r,y1:a},l,e)},g=(t,e)=>{var n,r,{transform:i="scale(1.2, 1.2)",transformOrigin:a="center center",stroke:o=""}=e,e=at(e,["transform","transformOrigin","stroke"]),i=Object.assign({transform:i,transformOrigin:a,stroke:o},e),s=t.cloneNode(!0);for([n,r]of Object.entries(i))s.style[n]=r;return s};return[e=>{e.background&&e.background.remove();var t=Ap(u,t=>c(t,e)),{fill:n="#CCD6EC",fillOpacity:r=.3,zIndex:i=-2,padding:a=.001,strokeWidth:o=0}=t,t=at(t,["fill","fillOpacity","zIndex","padding","strokeWidth"]),t=Object.assign(Object.assign({},t),{fill:n,fillOpacity:r,zIndex:i,padding:a,strokeWidth:o}),n=((()=>{var{x:t,y:e}=s;return[t,e].some(O_)})()?p:g)(e,t);n.className=h,e.parentNode.appendChild(n),e.background=n},t=>{var e;null!=(e=t.background)&&e.remove(),t.background=null},t=>t.className===h]}function wT(t,e){t=t.getRootNode().defaultView.getContextService().getDomElement();null!=t&&t.style&&(t.style.cursor=e)}function MT(t,e,r){return t.find(n=>Object.entries(e).every(([t,e])=>r(n)[t]===e))}function OT(e,{elements:t,datum:a,groupKey:o=t=>t,link:n=!1,background:r=!1,delay:i=60,scale:s,coordinate:l,emitter:c,state:u={}}){const h=t(e),f=new Set(h),d=Sd(h,o);t=mT(h,a);const[p,g]=vT(Object.assign({elements:h,valueof:t,link:n,coordinate:l},st(u.active,"link"))),[y,m,v]=xT(Object.assign({document:e.ownerDocument,scale:s,coordinate:l,background:r,valueof:t},st(u.active,"background"))),{setState:b,removeState:x,hasState:w}=gT(ot(u,{active:Object.assign({},(null==(n=u.active)?void 0:n.offset)&&{transform:(...t)=>{var e=u.active.offset(...t),[,t]=t;return bT(h[t],e,l)}})}),t);let M;const O=t=>{var{target:e,nativeEvent:t=!0}=t;if(f.has(e)){M&&clearTimeout(M);var n=o(e),n=d.get(n),r=new Set(n);for(const i of h)r.has(i)?w(i,"active")||b(i,"active"):(b(i,"inactive"),g(i)),i!==e&&m(i);y(e),p(n),t&&c.emit("element:highlight",{nativeEvent:t,data:{data:a(e),group:n.map(a)}})}},k=(t=!0)=>{for(const e of h)x(e,"active","inactive"),m(e),g(e);t&&c.emit("element:unhighlight",{nativeEvent:t})},E=t=>{t=t.target;r&&!v(t)||(r||f.has(t))&&(0<i?(M&&clearTimeout(M),M=setTimeout(()=>{k(),M=null},i)):k())},S=()=>{k()},A=(e.addEventListener("pointerover",O),e.addEventListener("pointerout",E),e.addEventListener("pointerleave",S),t=>{t=t.nativeEvent;t||k(!1)}),_=t=>{var e=t["nativeEvent"];!e&&(e=t.data["data"],t=MT(h,e,a))&&O({target:t,nativeEvent:!1})};return c.on("element:highlight",_),c.on("element:unhighlight",A),()=>{e.removeEventListener("pointerover",O),e.removeEventListener("pointerout",E),e.removeEventListener("pointerleave",S),c.off("element:highlight",_),c.off("element:unhighlight",A);for(const t of h)m(t),g(t)}}function kT(t){var{delay:s,createGroup:l,background:c=!1,link:u=!1}=t,h=at(t,["delay","createGroup","background","link"]);return(t,e,n)=>{var{container:t,view:r,options:i}=t,{scale:a,coordinate:o}=r;return OT(cT(t),Object.assign({elements:oT,datum:pT(r),groupKey:l?l(r):void 0,coordinate:o,scale:a,state:yT(i,[["active",c?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:c,link:u,delay:s,emitter:n},h))}}function ET(t){return kT(Object.assign(Object.assign({},t),{createGroup:dT}))}function ST(t){return kT(Object.assign(Object.assign({},t),{createGroup:fT}))}function AT(e,{elements:t,datum:f,groupKey:d=t=>t,link:p=!1,single:g=!1,coordinate:n,background:r=!1,scale:i,emitter:y,state:a={}}){const m=t(e),v=new Set(m),b=Sd(m,d);t=mT(m,f);const[x,w]=vT(Object.assign({link:p,elements:m,valueof:t,coordinate:n},st(a.selected,"link"))),[M,O]=xT(Object.assign({document:e.ownerDocument,background:r,coordinate:n,scale:i,valueof:t},st(a.selected,"background"))),{setState:k,removeState:o,hasState:E}=gT(ot(a,{selected:Object.assign({},(null==(r=a.selected)?void 0:r.offset)&&{transform:(...t)=>{var e=a.selected.offset(...t),[,t]=t;return bT(m[t],e,n)}})}),t),S=(t=!0)=>{for(const e of m)o(e,"selected","unselected"),w(e),O(e);t&&y.emit("element:unselect",{nativeEvent:!0})},s=t=>{var{target:e,nativeEvent:n=!0}=t;if(!v.has(e))return S();if(g){var[r,i,a=!0]=[t,e,n];if(E(i,"selected"))S();else{var o=d(i),o=b.get(o),s=new Set(o);for(const l of m)s.has(l)?k(l,"selected"):(k(l,"unselected"),w(l)),l!==i&&O(l);x(o),M(i),a&&y.emit("element:select",Object.assign(Object.assign({},r),{nativeEvent:a,data:{data:[f(i),...o.map(f)]}}))}}else{var[r,a,o=!0]=[t,e,n];t=d(a),t=b.get(t);const c=new Set(t);if(E(a,"selected")){if(!m.some(t=>!c.has(t)&&E(t,"selected")))return S();for(const u of t)k(u,"unselected"),w(u),O(u)}else{e=t.some(t=>E(t,"selected"));for(const h of m)c.has(h)?k(h,"selected"):E(h,"selected")||k(h,"unselected");!e&&p&&x(t),M(a)}o&&y.emit("element:select",Object.assign(Object.assign({},r),{nativeEvent:o,data:{data:m.filter(t=>E(t,"selected")).map(f)}}))}},l=(e.addEventListener("click",s),t=>{var{nativeEvent:t,data:e}=t;if(!t)for(const r of g?e.data.slice(0,1):e.data){var n=MT(m,r,f);s({target:n,nativeEvent:!1})}}),c=()=>{S(!1)};return y.on("element:select",l),y.on("element:unselect",c),()=>{for(const t of m)w(t);e.removeEventListener("click",s),y.off("element:select",l),y.off("element:unselect",c)}}function _T(t){var{createGroup:s,background:l=!1,link:c=!1}=t,u=at(t,["createGroup","background","link"]);return(t,e,n)=>{var{container:t,view:r,options:i}=t,{coordinate:a,scale:o}=r;return AT(cT(t),Object.assign({elements:oT,datum:pT(r),groupKey:s?s(r):void 0,coordinate:a,scale:o,state:yT(i,[["selected",l?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:l,link:c,emitter:n},u))}}function TT(t){return _T(Object.assign(Object.assign({},t),{createGroup:dT}))}function PT(t){return _T(Object.assign(Object.assign({},t),{createGroup:fT}))}function CT(t){var{wait:O=20,leading:k,trailing:E=!1,labelFormatter:S=t=>""+t}=t,A=at(t,["wait","leading","trailing","labelFormatter"]);return t=>{const{view:e,container:n,update:r,setState:a}=t,{markState:i,scale:o,coordinate:s}=e;t=function(t,e,r){var[t]=Array.from(t.entries()).filter(([t])=>t.type===e).map(([t])=>{const n=t["encode"];return Object.fromEntries(r.map(t=>{var e=n[t];return[t,e?e.value:void 0]}))});return t}(i,"line",["x","y","series"]);if(!t)return;const{y:f,x:d,series:l=[]}=t,c=f.map((t,e)=>e),u=Cd(c.map(t=>d[t])),p=cT(n),g=n.getElementsByClassName(bh);const y=Sd(n.getElementsByClassName(Oh),t=>t.__data__.key.split("-")[0]),h=new wc({style:Object.assign({x1:0,y1:0,x2:0,y2:p.getAttribute("height"),stroke:"black",lineWidth:1},st(A,"rule"))}),m=new Ic({style:Object.assign({x:0,y:p.getAttribute("height"),text:"",fontSize:10},st(A,"label"))}),v=(h.append(m),p.appendChild(h),(t,e,n)=>{var[t]=t.invert(n),n=e.invert(t);return u[vd(u,n)]}),b=(t,e)=>{h.setAttribute("x1",t[0]),h.setAttribute("x2",t[0]),m.setAttribute("text",S(e))};let x;var w;const M=ln(t=>{t=uT(p,t);if(t){var{scale:e,coordinate:n}=x,{x:e,y:r}=e,i=v(n,e,t);b(t,i);for(const u of g){var{seriesIndex:a,key:o}=u.__data__,s=a[dd(t=>d[+t]).center(a,i)],l=[0,r.map(1)],s=[0,r.map(f[s]/f[a[0]])],[,a]=n.map(l),[,l]=n.map(s),c=a-l,s=(u.setAttribute("transform",`translate(0, ${c})`),y.get(o)||[]);for(const h of s)h.setAttribute("dy",c)}}},O,{leading:k,trailing:E});return w=[0,0],X(this,void 0,void 0,function*(){var t=o["x"];const i=v(s,t,w);b(w,i),a("chartIndex",t=>{var t=ot({},t),e=t.marks.find(t=>"line"===t.type),n=Hd(_d(c,t=>Hd(t,t=>+f[t])/Yd(t,t=>+f[t]),t=>l[t]).values()),n=(ot(e,{scale:{y:{domain:[1/n,n]}}}),function(t){var{transform:e=[]}=t,n=e.find(t=>"normalizeY"===t.type);return n||(e.push(n={type:"normalizeY"}),t.transform=e,n)}(e));n.groupBy="color",n.basis=(t,e)=>{return e[t[dd(t=>d[+t]).center(t,i)]]};for(const r of t.marks)r.animate=!1;return t});t=yield r();x=t.view}),p.addEventListener("pointerenter",M),p.addEventListener("pointermove",M),p.addEventListener("pointerleave",M),()=>{h.remove(),p.removeEventListener("pointerenter",M),p.removeEventListener("pointermove",M),p.removeEventListener("pointerleave",M)}}}function LT({wait:o=30,leading:s,trailing:l=!1}){return t=>{const{update:e,setState:n,container:r}=t,i=cT(r),a=ln(t=>{const a=uT(i,t);a?n("fisheye",t=>{t=ot({},t);for(const i of t.marks)i.animate=!1;var[e,n]=a,r=function(t){var{coordinate:e={}}=t,{transform:n=[]}=e,r=n.find(t=>"fisheye"===t.type);return r||(n.push(r={type:"fisheye"}),e.transform=n,t.coordinate=e,r)}(t);return r.focusX=e,r.focusY=n,r.visual=!0,t}):n("fisheye"),e()},o,{leading:s,trailing:l});return i.addEventListener("pointerenter",a),i.addEventListener("pointermove",a),i.addEventListener("pointerleave",a),()=>{i.removeEventListener("pointerenter",a),i.removeEventListener("pointermove",a),i.removeEventListener("pointerleave",a)}}}function NT(t,e){t=t.__data__;const{markKey:n,index:r,seriesIndex:i}=t;t=e.markState;const a=Array.from(t.keys()).find(t=>t.key===n);if(a)return i?i.map(t=>a.data[t]):a.data[r]}function jT(i,a,o,s=t=>!0){return t=>{var e,n,r;s(t)&&(o.emit("plot:"+i,t),e=t["target"],e)&&(r=e["className"],"plot"!==r)&&(r=function(t){if("element"===t.className)return t;let e=t.parent;for(;e&&"element"!==e.className;)e=e.parent;return e}(e))&&({className:e,markType:n}=r,"element"===e?(r=Object.assign(Object.assign({},t),{nativeEvent:!0,data:{data:NT(r,a)}}),o.emit("element:"+i,r),o.emit(n+":"+i,r)):o.emit(e+":"+i,t))}}function RT(){return(t,e,n)=>{const{container:r,view:i}=t,a=jT(pp.CLICK,i,n,t=>1===t.detail),o=jT(pp.DBLCLICK,i,n,t=>2===t.detail),s=jT(pp.POINTER_TAP,i,n),l=jT(pp.POINTER_DOWN,i,n),c=jT(pp.POINTER_UP,i,n),u=jT(pp.POINTER_OVER,i,n),h=jT(pp.POINTER_OUT,i,n),f=jT(pp.POINTER_MOVE,i,n),d=jT(pp.POINTER_ENTER,i,n),p=jT(pp.POINTER_LEAVE,i,n),g=jT(pp.POINTER_UPOUTSIDE,i,n),y=jT(pp.DRAG_START,i,n),m=jT(pp.DRAG,i,n),v=jT(pp.DRAG_END,i,n),b=jT(pp.DRAG_ENTER,i,n),x=jT(pp.DRAG_LEAVE,i,n),w=jT(pp.DRAG_OVER,i,n),M=jT(pp.DROP,i,n);return r.addEventListener("click",a),r.addEventListener("click",o),r.addEventListener("pointertap",s),r.addEventListener("pointerdown",l),r.addEventListener("pointerup",c),r.addEventListener("pointerover",u),r.addEventListener("pointerout",h),r.addEventListener("pointermove",f),r.addEventListener("pointerenter",d),r.addEventListener("pointerleave",p),r.addEventListener("pointerupoutside",g),r.addEventListener("dragstart",y),r.addEventListener("drag",m),r.addEventListener("dragend",v),r.addEventListener("dragenter",b),r.addEventListener("dragleave",x),r.addEventListener("dragover",w),r.addEventListener("drop",M),()=>{r.removeEventListener("click",a),r.removeEventListener("click",o),r.removeEventListener("pointertap",s),r.removeEventListener("pointerdown",l),r.removeEventListener("pointerup",c),r.removeEventListener("pointerover",u),r.removeEventListener("pointerout",h),r.removeEventListener("pointermove",f),r.removeEventListener("pointerenter",d),r.removeEventListener("pointerleave",p),r.removeEventListener("pointerupoutside",g),r.removeEventListener("dragstart",y),r.removeEventListener("drag",m),r.removeEventListener("dragend",v),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",x),r.removeEventListener("dragover",w),r.removeEventListener("drop",M)}}}function IT({root:t,data:e,x:n,y:r,render:i,event:a,single:o,position:s="right-bottom",enterable:l=!1,mount:c,bounding:u}){var h,f,d=t.getRootNode().defaultView.getConfig().container,c=(p=t,(c=c)?"string"==typeof c?document.querySelector(c):c:p.getRootNode().defaultView.getConfig().container),p=o?d:t,o=u||function(t){var{min:[t,e],max:[n,r]}=t.getBounds();return{x:t,y:e,width:n-t,height:r-e}}(t),d=(u=c,t=(t=d).getBoundingClientRect(),u=u.getBoundingClientRect(),{x:t.x-u.x,y:t.y-u.y}),{tooltipElement:c=(t=c,u=n,c=r,h=s,f=l,o=o,d=d,u=new $k({className:"tooltip",style:{x:u,y:c,container:d,data:[],bounding:o,position:h,enterable:f,title:"",offset:[10,10],template:{prefixCls:"g2-"},style:{".g2-tooltip":{},".g2-tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}}}}),t.appendChild(u.HTMLTooltipElement),u)}=p,{items:d,title:o=""}=e;c.update(Object.assign({x:n,y:r,data:d,title:o,position:s,enterable:l},void 0!==i&&{content:i(a,{items:d,title:o})})),p.tooltipElement=c}function BT({root:t,single:e,emitter:n,nativeEvent:r=!0}){r&&n.emit("tooltip:hide",{nativeEvent:r});n=t.getRootNode().defaultView.getConfig().container,r=(e?n:t).tooltipElement;r&&r.hide()}function DT(t){var e=t["tooltipElement"];e&&(e.destroy(),t.tooltipElement=void 0)}function FT(t){var e=t["value"];return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function zT(t,e){var{color:t,series:n}=t,{color:e,series:r}=e,i=t=>t&&t.invert&&!(t instanceof yg)&&!(t instanceof hg);return i(n)?n.invert(r):r&&r!==e?r:!i(t)||(n=t.invert(e),Array.isArray(n))?null:n}function WT(t){var e=t.getAttribute("fill"),n=t.getAttribute("stroke"),t=t["__data__"],{color:t=e&&"transparent"!==e?e:n}=t;return t}function GT(t,e=t=>t){t=new Map(t.map(t=>[e(t),t]));return Array.from(t.values())}function HT(n,s,l,t=n.map(t=>t.__data__)){const e=t=>t instanceof Date?+t:t;var r=GT(t.map(t=>t.title),e).filter(sp),t=t.flatMap((r,t)=>{const i=n[t],{items:e=[],title:a}=r;t=e.filter(sp);const o=void 0!==l?l:e.length<=1;return t.map(t=>{var{color:e=WT(i),name:n}=t,t=at(t,["color","name"]),n=o?zT(s,r)||n:n||zT(s,r);return Object.assign(Object.assign({},t),{color:e,name:n||a})})}).map(FT);return Object.assign(Object.assign({},0<r.length&&{title:r.join(",")}),{items:GT(t,t=>`(${e(t.name)}, ${e(t.value)}, ${e(t.color)})`)})}function VT(t,e,n){var{plotWidth:r,plotHeight:i,mainWidth:a,mainHeight:o,startX:s,startY:l,transposed:c,polar:u,insetLeft:h,insetTop:f}=n,n=at(n,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const d=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},n);n=e.map(t=>t[1]),e=e.map(t=>t[0]);const p=Zd(n),g=Zd(e);const[y,m,v,b]=u?(n=Math.min(a,o)/2,a=l2(a2([g,p],[u=s+h+a/2,h=l+f+o/2])),[u,u+n*Math.cos(a),h,h+n*Math.sin(a)]):c?[s,s+r,p+l,p+l]:[g+s,g+s,l,l+i];0<e.length&&((o=t.ruleY||(f=new wc({style:Object.assign({x1:y,x2:m,y1:v,y2:b},d)}),t.appendChild(f),f)).style.x1=y,o.style.x2=m,o.style.y1=v,o.style.y2=b,t.ruleY=o)}function YT(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function qT(t){t.markers&&(t.markers.forEach(t=>t.remove()),t.markers=[])}function $T(t,e){return Array.from(t.values()).some(t=>{return null==(t=t.interaction)?void 0:t[e]})}function UT(t,e){return void 0===t?e:t}function XT(t){var{title:t,items:e}=t;return 0===e.length&&void 0===t}function KT(m,t){var{elements:e,sort:v,filter:b,scale:x,coordinate:w,crosshairs:M,render:O,groupName:k,emitter:E,wait:n=50,leading:r=!0,trailing:i=!1,startX:S=0,startY:A=0,body:_=!0,single:T=!0,position:P,enterable:C,mount:L,bounding:W,disableNative:a=!1,marker:N=!0,style:o={}}=t,t=at(t,["elements","sort","filter","scale","coordinate","crosshairs","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","disableNative","marker","style"]),e=e(m);const j=rv(w),G=iv(w),R=ot(o,t),{innerWidth:H,innerHeight:V,width:Y,height:q,insetLeft:$,insetTop:U}=w.getOptions(),I=[],B=[];for(const h of e){var s=h["__data__"],s=s["seriesX"];(s?I:B).push(h)}I.sort((t,e)=>{const n=j?0:1;var r=t=>t.getBounds().min[n];return j?r(e)-r(t):r(t)-r(e)});const X=new Map(I.map(t=>{var e=t["__data__"];const n=e["seriesX"];return[t,[Cd(n.map((t,e)=>e),t=>n[+t]),n]]}));o=x.x;const D=null!=o&&o.getBandWidth?o.getBandWidth()/2:0,F=t=>{var[t]=w.invert(t);return t-D},K=(t,e)=>{const n=j?1:0,r=t[n];return e.filter(t=>{var[t,e]=(t=>{var{min:t,max:e}=t.getLocalBounds();return Cd([t[n],e[n]])})(t);return r>=t&&r<=e})},l=ln(t=>{var e=uT(m,t);if(e){var n=m.getRenderBounds();const h=n.min[0],f=n.min[1],d=[e[0]-S,e[1]-A];d;var n=K(d,B),r=[],i=[];for(const g of I){var[a,o]=X.get(g),a=((t,e,n)=>{var t=F(t),[r,i]=Cd([n[0],n[n.length-1]]);return t<r||i<t?null:e[(0,dd(t=>n[+t]).center)(e,t)]})(d,a,o);if(null!==a){r.push(g);o=((t,n)=>{t=t.__data__;return Object.fromEntries(Object.entries(t).filter(([t])=>t.startsWith("series")&&"series"!==t).map(([t,e])=>{e=e[n];return[qe(t.replace("series","")),e]}))})(g,a);const{x:h,y:f}=o;a=w.map([(h||0)+D,f||0]);i.push([Object.assign(Object.assign({},o),{element:g}),a])}}var s=Array.from(new Set(i.map(t=>t[0].x)));const p=s[qd(s,t=>Math.abs(t-F(d)))];var s=i.filter(t=>t[0].x===p),l=[...s.map(t=>t[0]),...n.map(t=>t.__data__)],n=[...r,...n],l=HT(n,x,k,l);if(v&&l.items.sort((t,e)=>v(t)-v(e)),b&&(l.items=l.items.filter(b)),0===n.length||XT(l))z();else{if(_&&IT({root:m,data:l,x:e[0]+h,y:e[1]+f,render:O,event:t,single:T,position:P,enterable:C,mount:L,bounding:W}),M&&(n=s.map(t=>t[1]),e=st(R,"crosshairs"),VT(m,n,Object.assign(Object.assign({},e),{plotWidth:H,plotHeight:V,mainWidth:Y,mainHeight:q,insetLeft:$,insetTop:U,startX:S,startY:A,transposed:j,polar:G}))),N){var n=st(R,"marker"),[c,{data:e,style:u}]=[m,{data:s,items:l.items,style:n}];c.markers&&c.markers.forEach(t=>t.remove());for(const y of e=e.map(t=>{var[{color:t,element:e},n]=t,t=t||e.style.fill||e.style.stroke;return new rc({style:Object.assign({cx:n[0],cy:n[1],fill:t,r:4,stroke:"#fff",strokeWidth:2},u)})}))c.appendChild(y);c.markers=e}E.emit("tooltip:show",Object.assign(Object.assign({},t),{nativeEvent:!0,data:{data:{x:k_(x.x,F(d),!0)}}}))}}},n,{leading:r,trailing:i}),z=()=>{BT({root:m,single:T,emitter:E,mount:L}),M&&YT(m),N&&qT(m)},c=({nativeEvent:t,data:e})=>{var n,r;t||(t=e.data["x"],e=x["x"],e=e.map(t),[t,e]=w.map([e,.5]),[n,r]=m.getRenderBounds()["min"],l({offsetX:t+n,offsetY:e+r}))},u=()=>{BT({root:m,single:T,emitter:E,nativeEvent:!1,mount:L})};return E.on("tooltip:show",c),E.on("tooltip:hide",u),a||(m.addEventListener("pointerenter",l),m.addEventListener("pointermove",l),m.addEventListener("pointerleave",z)),()=>{a||(m.removeEventListener("pointerenter",l),m.removeEventListener("pointermove",l),m.removeEventListener("pointerleave",z)),E.off("tooltip:show",c),E.off("tooltip:hide",u),DT(m),M&&YT(m),N&&qT(m)}}function ZT(a,{elements:t,scale:o,render:s,groupName:l,sort:c,filter:u,emitter:h,wait:e=50,leading:n=!0,trailing:r=!1,groupKey:f=t=>t,single:d=!0,position:p,enterable:g,datum:y,view:m,mount:v,bounding:b,body:x=!0,disableNative:i=!1}){const w=t(a),M=new Set(w),O=Sd(w,f),k=ln(t=>{var e,n,r,i=t["target"];!M.has(i)||(e=f(i),e=1===(e=O.get(e)).length?function(n){var{title:t,items:e=[]}=t=n["__data__"],e=e.filter(sp).map(t=>{var{color:e=WT(n)}=t,t=at(t,["color"]);return Object.assign(Object.assign({},t),{color:e})}).map(FT);return Object.assign(Object.assign({},t&&{title:t}),{items:e})}(e[0]):HT(e,o,l),c&&e.items.sort((t,e)=>c(t)-c(e)),u&&(e.items=e.items.filter(u)),XT(e))?BT({root:a,single:d,emitter:h,mount:v}):({offsetX:n,offsetY:r}=t,x&&IT({root:a,data:e,x:n,y:r,render:s,event:t,single:d,position:p,enterable:g,mount:v,bounding:b}),h.emit("tooltip:show",Object.assign(Object.assign({},t),{nativeEvent:!0,data:{data:NT(i,m)}})))},e,{leading:n,trailing:r}),E=t=>{t=t.target;M.has(t)&&BT({root:a,single:d,emitter:h,mount:v})},S=({nativeEvent:t,data:e})=>{var n,r,i;t||(t=MT(w,e.data,y))&&({x:e,y:n,width:r,height:i}=t.getBBox(),k({target:t,offsetX:e+r/2,offsetY:n+i/2}))},A=({nativeEvent:t}={})=>{t||BT({root:a,single:d,emitter:h,nativeEvent:!1,mount:v})};return h.on("tooltip:show",S),h.on("tooltip:hide",A),i||(a.addEventListener("pointerover",k),a.addEventListener("pointermove",k),a.addEventListener("pointerout",E)),()=>{i||(a.removeEventListener("pointerover",k),a.removeEventListener("pointermove",k),a.removeEventListener("pointerout",E)),h.off("tooltip:show",S),h.off("tooltip:hide",A),DT(a)}}function QT(t){const{shared:h,crosshairs:f,series:d,item:p=()=>({}),facet:g=!1}=t,y=at(t,["shared","crosshairs","series","name","item","facet"]);return(e,t,n)=>{var{container:r,view:i}=e;const{scale:a,markState:o,coordinate:s}=i;var l=$T(o,"seriesTooltip"),c=$T(o,"crosshairs"),r=cT(r),l=UT(d,l);if(l&&Array.from(o.values()).some(t=>{var e;return(null==(e=t.interaction)?void 0:e.seriesTooltip)&&t.tooltip})&&!g)return KT(r,Object.assign(Object.assign({},y),{elements:oT,scale:a,coordinate:s,crosshairs:UT(f,c),item:p,emitter:n}));if(l&&g){l=t.filter(t=>t!==e&&t.options.parentKey===e.options.key);const u=sT(e,t),a=l[0].view.scale;t=r.getBounds(),l=t.min[0],t=t.min[1];return KT(r.parentNode.parentNode,Object.assign(Object.assign({},y),{elements:()=>u,scale:a,coordinate:s,crosshairs:UT(f,c),item:p,startX:l,startY:t,emitter:n}))}return ZT(r,Object.assign(Object.assign({},y),{datum:pT(i),elements:oT,scale:a,coordinate:s,groupKey:h?dT(i):void 0,item:p,emitter:n,view:i}))}}const JT="legend-category",t6="legend-continuous",e6="items-item",n6="legend-category-item-marker",r6="legend-category-item-label";function i6(t){return t.getElementsByClassName(n6)[0]}function a6(t){return t.getElementsByClassName(r6)[0]}function o6(t){return t.getElementsByClassName(e6)}function s6(t){return t.getElementsByClassName(JT)}function l6(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function c6(t,{legends:e,marker:i,label:a,datum:o,filter:r,emitter:s,channel:l,state:n={}}){const c=new Map,u=new Map,h=new Map;var{unselected:n={markerStroke:"#aaa",markerFill:"#aaa",labelFill:"#aaa"}}=n,f={unselected:st(n,"marker")},n={unselected:st(n,"label")};const{setState:d,removeState:p}=gT(f,void 0),{setState:g,removeState:y}=gT(n,void 0),m=Array.from(e(t));let v=m.map(o);const b=()=>{for(const r of m){var t=o(r),e=i(r),n=a(r);(v.includes(t)?(p(e,"unselected"),y):(d(e,"unselected"),g))(n,"unselected")}};for(const E of m){var x=()=>{wT(t,"pointer")},w=()=>{wT(t,"default")},M=n=>X(this,void 0,void 0,function*(){var t=o(E),e=v.indexOf(t),{nativeEvent:t=!0}=(-1===e?v.push(t):v.splice(e,1),0===v.length&&v.push(...m.map(o)),yield r(v),b(),n);t&&(v.length===m.length?s.emit("legend:reset",{nativeEvent:t}):s.emit("legend:filter",Object.assign(Object.assign({},n),{nativeEvent:t,data:{channel:l,values:v}})))});E.addEventListener("click",M),E.addEventListener("pointerenter",x),E.addEventListener("pointerout",w),c.set(E,M),u.set(E,x),h.set(E,w)}const O=n=>X(this,void 0,void 0,function*(){var t,e=n["nativeEvent"];e||(e=n["data"],{channel:e,values:t}=e,e===l&&(v=t,yield r(v),b()))}),k=e=>X(this,void 0,void 0,function*(){var t=e["nativeEvent"];t||(v=m.map(o),yield r(v),b())});return s.on("legend:filter",O),s.on("legend:reset",k),()=>{for(const t of m)t.removeEventListener("click",c.get(t)),t.removeEventListener("pointerenter",u.get(t)),t.removeEventListener("pointerout",h.get(t)),s.off("legend:filter",O),s.off("legend:reset",k)}}function u6(){return(t,e,c)=>{const{container:u,view:s,update:n,setState:l}=t,h=t=>l6(t).scales.map(t=>t.name);t=[...s6(u),...u.getElementsByClassName(t6)];const f=t.flatMap(h),d=ln((t,r,i,a,o)=>X(this,void 0,void 0,function*(){l(t,t=>{var e=t["marks"],e=e.map(t=>{var e,n;return"legends"===t.type?t:({transform:e=[]}=t,n=e.findIndex(({type:t})=>t.startsWith("group")||t.startsWith("bin")),(e=[...e]).splice(n+1,0,{type:"filter",[r]:{value:i,ordinal:a}}),n=Object.fromEntries(o.map(t=>[t,{domain:s.scale[t].getOptions().domain}])),ot({},t,Object.assign(Object.assign({transform:e,scale:n},!a&&{animate:!1}),{legend:Object.fromEntries(f.map(t=>[t,{preserve:!0}]))})))});return Object.assign(Object.assign({},t),{marks:e})}),yield n()}),50,{trailing:!0}),r=t.map(e=>{const{name:n,domain:r}=l6(e).scales[0],i=h(e);if(e.className===JT)return c6(u,{legends:o6,marker:i6,label:a6,datum:t=>{t=t.__data__,t=t.index;return r[t]},filter:t=>d(e,n,t,!0,i),state:e.attributes.state,channel:n,emitter:c});{var{legend:t,filter:a,emitter:o,channel:s}=[(u,{legend:e,filter:t=>d(e,n,t,!1,i),emitter:c,channel:n})][0];const l=({detail:{value:t}})=>{a(t),o.emit({nativeEvent:!0,data:{channel:s,values:t}})};return t.addEventListener("valuechange",l),()=>{t.removeEventListener("valuechange",l)};return}});return()=>{r.forEach(t=>t())}}}function h6(){return(t,e,a)=>{const{container:n,view:r,options:i}=t;t=s6(n);const o=oT(n);var s=yT(i,["active","inactive"]),l=mT(o,pT(r));const c=[];for(const d of t){const p=t=>{var e=d.attributes["data"],t=t["__data__"],t=t["index"];return e[t].label},g=l6(d).scales[0].name,y=o6(d),m=(t=>{var{scale:{[t]:t}}=r;return t})(g),v=Sd(o,t=>m.invert(t.__data__[g]));var{state:u={}}=d.attributes,{inactive:u={}}=u;const{setState:b,removeState:x}=gT(s,l);var h={inactive:st(u,"marker")},u={inactive:st(u,"label")};const{setState:w,removeState:M}=gT(h),{setState:O,removeState:k}=gT(u),E=t=>{for(const r of y){var e=i6(r),n=a6(r);(r===t||null===t?(M(e,"inactive"),k):(w(e,"inactive"),O))(n,"inactive")}},S=(t,e)=>{var n=p(e),r=new Set(v.get(n));for(const i of o)r.has(i)?b(i,"active"):b(i,"inactive");E(e);var{nativeEvent:e=!0}=t;e&&a.emit("legend:highlight",Object.assign(Object.assign({},t),{nativeEvent:e,data:{channel:g,value:n}}))},A=new Map;for(const C of y){var f=t=>{S(t,C)};C.addEventListener("pointerover",f),A.set(C,f)}const _=t=>{for(const e of o)x(e,"inactive","active");E(null);var{nativeEvent:t=!0}=t;t&&a.emit("legend:unhighlight",{nativeEvent:t})},T=t=>{var{nativeEvent:t,data:e}=t;if(!t){const{channel:n,value:r}=e;n===g&&(t=y.find(t=>p(t)===r))&&S({nativeEvent:!1},t)}},P=t=>{t=t.nativeEvent;t||_({nativeEvent:!1})};d.addEventListener("pointerleave",_),a.on("legend:highlight",T),a.on("legend:unhighlight",P);c.push(()=>{d.removeEventListener(_),a.off("legend:highlight",T),a.off("legend:unhighlight",P);for(var[t,e]of A)t.removeEventListener(e)})}return()=>c.forEach(t=>t())}}function f6(t,e){for(var[n,r]of Object.entries(e))t.style(n,r)}const d6=Rx(t=>{const e=t.attributes,{x:n,y:r,width:i,height:a,class:o,handleSize:s=10,document:l}=e,c=at(e,["x","y","width","height","class","renders","handleSize","document"]);if(l&&void 0!==i&&void 0!==a&&void 0!==n&&void 0!==r){var u=s/2,h=(t,e,n)=>{t.handle||(t.handle=n.createElement("rect"),t.append(t.handle));n=t.handle;return n.attr(e),n},f=st(cp(c,"handleNW","handleNE"),"handleN"),{render:d=h}=f,f=at(f,["render"]),p=st(c,"handleE"),{render:g=h}=p,p=at(p,["render"]),y=st(cp(c,"handleSE","handleSW"),"handleS"),{render:m=h}=y,y=at(y,["render"]),v=st(c,"handleW"),{render:b=h}=v,v=at(v,["render"]),x=st(c,"handleNW"),{render:w=h}=x,x=at(x,["render"]),M=st(c,"handleNE"),{render:O=h}=M,M=at(M,["render"]),k=st(c,"handleSE"),{render:E=h}=k,k=at(k,["render"]),S=st(c,"handleSW"),{render:h=h}=S,S=at(S,["render"]);var A=i=>()=>{return new(Rx(t=>{return e=i,n=(t=t).id,r=at(t.attributes,["x","y"]),(e=e(t,Object.assign({x:0,y:0},r),l)).id=n,void(e.style.draggable=!0);var e,n,r}))({})},t=lt(t).attr("className",o).style("x",n).style("y",r).style("draggable",!0);t.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(f6,Object.assign({width:i,height:a},cp(c,"handle"))),t.maybeAppend("handle-n",A(d)).style("x",u).style("y",-u).style("width",i-s).style("height",s).style("fill","transparent").call(f6,f),t.maybeAppend("handle-e",A(g)).style("x",i-u).style("y",u).style("width",s).style("height",a-s).style("fill","transparent").call(f6,p),t.maybeAppend("handle-s",A(m)).style("x",u).style("y",a-u).style("width",i-s).style("height",s).style("fill","transparent").call(f6,y),t.maybeAppend("handle-w",A(b)).style("x",-u).style("y",u).style("width",s).style("height",a-s).style("fill","transparent").call(f6,v),t.maybeAppend("handle-nw",A(w)).style("x",-u).style("y",-u).style("width",s).style("height",s).style("fill","transparent").call(f6,x),t.maybeAppend("handle-ne",A(O)).style("x",i-u).style("y",-u).style("width",s).style("height",s).style("fill","transparent").call(f6,M),t.maybeAppend("handle-se",A(E)).style("x",i-u).style("y",a-u).style("width",s).style("height",s).style("fill","transparent").call(f6,k),t.maybeAppend("handle-sw",A(h)).style("x",-u).style("y",a-u).style("width",s).style("height",s).style("fill","transparent").call(f6,S)}});function p6(l,t){var{brushed:a=()=>{},brushended:e=()=>{},brushcreated:o=()=>{},extent:s=function(t){var{width:t,height:e}=t.getBBox();return[0,0,t,e]}(l),brushRegion:c=(t,e,n,r,i)=>[t,e,n,r],reverse:u=!1,fill:n="#777",fillOpacity:r="0.3",stroke:i="#fff",selectedHandles:h=["handle-n","handle-e","handle-s","handle-w","handle-nw","handle-ne","handle-se","handle-sw"]}=t,f=at(t,["brushed","brushended","brushcreated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let d=null,p=null,g=null,y=null,m=null,v=!1;const[b,x,w,M]=s,O=(wT(l,"crosshair"),l.style.draggable=!0,(t,e)=>{if(y&&y.remove(),m&&m.remove(),d=[t,e],u)return I();B()}),I=()=>{m=new kc({style:Object.assign(Object.assign({},f),{fill:n,fillOpacity:r,stroke:i,pointerEvents:"none"})}),y=new d6({style:{x:0,y:0,width:0,height:0,draggable:!0,document:l.ownerDocument},className:"mask"}),l.appendChild(m),l.appendChild(y)},B=()=>{y=new d6({style:Object.assign(Object.assign({document:l.ownerDocument,x:0,y:0},f),{fill:n,fillOpacity:r,stroke:i,draggable:!0}),className:"mask"}),l.appendChild(y)},k=(t=!0)=>{y&&y.remove(),m&&m.remove(),d=null,p=null,g=null,v=!1,y=null,m=null,e(t)},E=(t,e,n=!0)=>{var[t,e,r,i]=function(t,e,n,r,i){var[i,a,o,s]=i;return[Math.max(i,Math.min(t,n)),Math.max(a,Math.min(e,r)),Math.min(o,Math.max(t,n)),Math.min(s,Math.max(e,r))]}(t[0],t[1],e[0],e[1],s),[t,e,r,i]=c(t,e,r,i,s);return(u?F:D)(t,e,r,i),a(t,e,r,i,n),[t,e,r,i]},D=(t,e,n,r)=>{y.style.x=t,y.style.y=e,y.style.width=n-t,y.style.height=r-e},F=(t,e,n,r)=>{m.style.d=`
8
8
  M${b},${x}L${w},${x}L${w},${M}L${b},${M}Z
9
9
  M${t},${e}L${t},${r}L${n},${r}L${n},${e}Z
10
- `,y.style.x=t,y.style.y=e,y.style.width=n-t,y.style.height=r-e},S={"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"}},A=t=>T(t)||_(t),_=t=>{t=t.id;return-1!==h.indexOf(t)&&new Set(Object.keys(S)).has(t)},T=t=>t===y.getElementById("selection"),P=t=>{var e=t["target"],[t,n]=uT(l,t);y&&A(e)?A(e)&&(g=[t,n]):(O(t,n),v=!0)},C=t=>{var e,n,r,i,a,o,s=t["target"],t=uT(l,t);if(d)return g?T(s)?(e=(t,e,n,r,i)=>t+e<r?r-e:i<t+n?i-n:t,r=(n=t)[0]-g[0],n=n[1]-g[1],r=e(r,d[0],p[0],b,w),e=e(n,d[1],p[1],x,M),n=[d[0]+r,d[1]+e],r=[p[0]+r,p[1]+e],void E(n,r)):([e,n]=[t[0]-g[0],t[1]-g[1]],r=s["id"],S[r]?([s,i,a,o]=S[r].vector,E([d[0]+e*s,d[1]+n*i],[p[0]+e*a,p[1]+n*o])):void 0):E(d,t)},L=t=>{var e,n,r,i;g?(g=null,{x:e,y:r,width:n,height:i}=y.style,d=[e,r],p=[e+n,r+i]):(p=uT(l,t),[e,n,r,i]=E(d,p),v=!1,o(e,n,r,i,t))},N=t=>{t=t.target;y&&!A(t)&&k()},j=t=>{t=t.target;y&&A(t)&&!v?T(t)?xT(l,"move"):_(t)&&xT(l,S[t.id].cursor):xT(l,"crosshair")},R=()=>{xT(l,"default")};return l.addEventListener("dragstart",P),l.addEventListener("drag",C),l.addEventListener("dragend",L),l.addEventListener("click",N),l.addEventListener("pointermove",j),l.addEventListener("pointerleave",R),{mask:y,move(t,e,n,r,i=!0){y||O(t,e),d=[t,e],p=[n,r],E([t,e],[n,r],i)},remove(t=!0){y&&k(t)},destroy(){y&&k(!1),xT(l,"default"),l.removeEventListener("dragstart",P),l.removeEventListener("drag",C),l.removeEventListener("dragend",L),l.removeEventListener("click",N),l.removeEventListener("pointermove",j),l.removeEventListener("pointerleave",R)}}}function d6(e,t,n){return t.filter(t=>{return t!==e&&({interaction:t={}}=t.options,Object.values(t).find(t=>t.brushKey===n))})}function p6(t,e){var{elements:n,selectedHandles:r,siblings:i=t=>[],datum:a,brushRegion:o,extent:s,reverse:l,scale:c,coordinate:u,series:h=!1,key:d=t=>t,bboxOf:f=t=>{var{x:t,y:e,width:n,height:r}=t.style;return{x:t,y:e,width:n,height:r}},state:p={},emitter:g}=e,e=at(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const y=n(t),m=i(t),v=m.flatMap(n);i=yT(y,a),n=st(e,"mask");const{setState:b,removeState:x}=pT(p,i),w=new Map,{width:M,height:O,x:k=0,y:E=0}=f(t);a=s||[0,0,M,O];const S=()=>{for(const t of[...y,...v])x(t,"active","inactive")},A=(t,e,n,r)=>{var i;for(const u of m)null!=(i=u.brush)&&i.remove();var a=new Set;for(const h of y){var{min:o,max:s}=h.getLocalBounds(),[o,l]=o,[s,c]=s;!function(t,e){var[t,n,r,i]=t,[e,a,o,s]=e;return!(r<e||o<t||i<a||s<n)}([o,l,s,c],[t,e,n,r])?b(h,"inactive"):(b(h,"active"),a.add(d(h)))}for(const f of v)a.has(d(f))?b(f,"active"):b(f,"inactive")},_=()=>{for(const t of y)x(t,"inactive");for(const e of w.values())e.remove();w.clear()},T=(t,e,n,r)=>{var i;for(const o of y){var a=w.get(o)||(a=o,i=void 0,(i=a.cloneNode()).__data__=a.__data__,a.parentNode.appendChild(i),w.set(a,i),i);a.style.clipPath=new Nc({style:{x:t+k,y:e+E,width:n-t,height:r-e}}),b(o,"inactive"),b(a,"active")}},P=f6(t,Object.assign(Object.assign({},n),{extent:a,brushRegion:o,reverse:l,selectedHandles:r,brushended:t=>{var e=h?_:S;t&&g.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{var a=E_(t,e,n,r,c,u);i&&g.emit("brush:highlight",{nativeEvent:!0,data:{selection:a}}),(h?T:A)(t,e,n,r)}})),C=({nativeEvent:t,data:e})=>{var n,r;t||(t=e["selection"],[e,t,n,r]=function(t,e,n){var{x:e,y:r}=e,[t,i]=t,t=S_(t,e),e=S_(i,r),i=[t[0],e[0]],r=[t[1],e[1]],[t,e]=n.map(i),[i,n]=n.map(r);return[t,e,i,n]}(t,c,u),P.move(e,t,n,r,!1))},L=(g.on("brush:highlight",C),({nativeEvent:t}={})=>{t||P.remove(!1)}),N=(g.on("brush:remove",L),P.destroy.bind(P));return P.destroy=()=>{g.off("brush:highlight",C),g.off("brush:remove",L),N()},P}function g6(t){var{facet:g,brushKey:y}=t,m=at(t,["facet","brushKey"]);return(t,e,n)=>{var r,i,a,o,{container:s,view:l,options:c}=t,s=lT(s),u={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",reverse:!1},h=["active",["inactive",{opacity:.5}]],{scale:f,coordinate:d}=l;if(g)return r=(o=s.getBounds()).min[0],i=o.min[1],a=o.max[0],o=o.max[1],p6(s.parentNode.parentNode,Object.assign(Object.assign({elements:()=>oT(t,e),datum:dT(sT(t,e).map(t=>t.view)),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[r,i,a,o],state:gT(sT(t,e).map(t=>t.options),h),emitter:n,scale:f,coordinate:d,selectedHandles:void 0},u),m));const p=p6(s,Object.assign(Object.assign({elements:aT,key:t=>t.__data__.key,siblings:()=>{return d6(t,e,y).map(t=>lT(t.container))},datum:dT([l,...d6(t,e,y).map(t=>t.view)]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:gT([c,...d6(t,e,y).map(t=>t.options)],h),emitter:n,scale:f,coordinate:d,selectedHandles:void 0},u),m));return s.brush=p,()=>p.destroy()}}function y6(t,e,n,r,i){var[,i,,a]=i;return[t,i,n,a]}function m6(t){return g6(Object.assign(Object.assign({},t),{brushRegion:y6,selectedHandles:["handle-e","handle-w"]}))}function v6(t,e,n,r,i){var[i,,a]=i;return[i,e,a,r]}function b6(t){return g6(Object.assign(Object.assign({},t),{brushRegion:v6,selectedHandles:["handle-n","handle-s"]}))}const x6="axis-hot-area";function w6(t){return t.getElementsByClassName("axis")}function M6(t){return t.getElementsByClassName("axis-line")[0]}function O6(t){return t.getElementsByClassName("axis-main-group")[0].getLocalBounds()}function k6(t,e){var{cross:n,offsetX:i}=e,e=at(e,["cross","offsetX","offsetY"]),r=O6(t),[t]=M6(t).getLocalBounds().min;const[a,o]=r.min,[s,l]=r.max;r=2*(s-a);return{brushRegion:v6,hotZone:new Nc({className:x6,style:Object.assign({x:n?a:t-r/2,width:n?r/2:r,y:o,height:l-o},e)}),extent:n?(t,e,n,r)=>[-1/0,e,1/0,r]:(t,e,n,r)=>[Math.floor(a-i),e,Math.ceil(s-i),r]}}function E6(t,e){var{offsetY:i,cross:n=!1}=e,e=at(e,["offsetY","offsetX","cross"]),r=O6(t),[,t]=M6(t).getLocalBounds().min;const[a,o]=r.min,[s,l]=r.max;r=l-o;return{brushRegion:y6,hotZone:new Nc({className:x6,style:Object.assign({x:a,width:s-a,y:n?o:t-r,height:n?r:2*r},e)}),extent:n?(t,e,n,r)=>[t,-1/0,n,1/0]:(t,e,n,r)=>[t,Math.floor(o-i),n,Math.ceil(l-i)]}}function S6(t,e){var{axes:n,elements:r,points:i,horizontal:s,datum:a,offsetY:o,offsetX:l,reverse:c=!1,state:u={},emitter:h,coordinate:f}=e,e=at(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const d=r(t),p=n(t),{setState:g,removeState:y}=pT(u,yT(d,a)),m=new Map;var v=st(e,"mask");const b=p.map(t=>t.attributes.scale),x=t=>2<t.length?[t[0],t[t.length-1]]:t,w=new Map,M=()=>{w.clear();for(let t=0;t<p.length;t++){var e=b[t].getOptions()["domain"];w.set(t,x(e))}},O=(M(),(t,e)=>{var n=[];for(const r of d)(t=>Array.from(m.values()).every(([n,r,i,a])=>t.some(([t,e])=>n<=t&&t<=i&&r<=e&&e<=a)))(i(r))?(g(r,"active"),n.push(r)):g(r,"inactive");w.set(t,((t,e)=>{const n=b[e],{name:r}=n.getOptions(),i=t.map(t=>{const e=t.__data__;return n.invert(e[r])});return x(k_(n,i))})(n,t)),e&&h.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!k)return Array.from(w.values());var t,e,n=[];for([t,e]of w){var r=b[t].getOptions()["name"];"x"===r?n[0]=e:n[1]=e}return n})()}})}),k=p.some(s)&&p.some(t=>!s(t)),E=[];for(let a=0;a<p.length;a++){const P=p[a];const{hotZone:C,brushRegion:L,extent:N}=(s(P)?E6:k6)(P,{offsetY:o,offsetX:l,cross:k,zIndex:999,fill:"transparent"});P.parentNode.appendChild(C);var S=f6(C,Object.assign(Object.assign({},v),{reverse:c,brushRegion:L,brushended(t){if(m.delete(P),0===Array.from(m.entries()).length){var e=t;for(const n of d)y(n,"active","inactive");M(),e&&h.emit("brushAxis:remove",{nativeEvent:!0})}else O(a,t)},brushed(t,e,n,r,i){m.set(P,N(t,e,n,r)),O(a,i)}}));E.push(S)}const A=(t={})=>{t=t.nativeEvent;t||E.forEach(t=>t.remove(!1))},_=(t,e,n)=>{var{height:r,width:i}=f.getOptions(),e=e.clone();return s(n)?e.update({range:[0,i]}):e.update({range:[r,0]}),e.map(t)},T=t=>{var e=t["nativeEvent"];if(!e){var n=t.data["selection"];for(let t=0;t<E.length;t++){var r,i=n[t],a=E[t],o=p[t];i?(r=b[t],a.move(...((t,e,n)=>{var[t,r]=t,t=_(t,e,n),e=_(r,e,n)+((r=e).getStep?r.getStep():0);return s(n)?[t,-1/0,e,1/0]:[-1/0,t,1/0,e]})(i,r,o),!1)):a.remove(!1)}}};return h.on("brushAxis:remove",A),h.on("brushAxis:highlight",T),()=>{E.forEach(t=>t.destroy()),h.off("brushAxis:remove",A),h.off("brushAxis:highlight",T)}}function A6(l){return(t,e,n)=>{var{container:t,view:r,options:i}=t,{x:a,y:o}=lT(t).getBBox(),s=r["coordinate"];return S6(t,Object.assign({elements:aT,axes:w6,offsetY:o,offsetX:a,points:t=>t.__data__.points,horizontal:t=>{var{startPos:[t,e],endPos:[n,r]}=t.attributes;return t!==n&&e===r},datum:dT(r),state:gT(i,["active",["inactive",{opacity:.5}]]),coordinate:s,emitter:n},l))}}function _6(t,e){var{filter:a,reset:n,brushRegion:r,extent:i,reverse:o,emitter:s,selection:l}=e,e=st(at(e,["filter","reset","brushRegion","extent","reverse","emitter","scale","coordinate","selection","series"]),"mask"),{width:c,height:u}=t.getBBox(),i=i||[0,0,c,u];const h=function(e=300){let n=null;return t=>{t=t.timeStamp;return null!==n&&t-n<e?(n=t,!0):(n=t,!1)}}(),f=f6(t,Object.assign(Object.assign({},e),{extent:i,brushRegion:r,reverse:o,brushcreated:function(t,e,n,r,i){i.nativeEvent=!0,a(l(t,e,n,r),i),f.remove()}}));function d(t){h(t)&&(t.nativeEvent=!0,n(t))}t.addEventListener("click",d);const p=({nativeEvent:t,data:e})=>{t||(t=e["selection"],a(t,{nativeEvent:!1}))};return s.on("brush:filter",p),()=>{f.destroy(),s.off("brush:filter",p),t.removeEventListener("click",d)}}function T6(t){var{hideX:f=!0,hideY:d=!0}=t,p=at(t,["hideX","hideY"]);return(t,e,a)=>{const{container:n,view:r,options:o,update:s}=t;t=lT(n);let l=!1,c=!1,u=r;var{scale:i,coordinate:h}=r;return _6(t,Object.assign(Object.assign({brushRegion:(t,e,n,r)=>[t,e,n,r],selection:(t,e,n,r)=>{var{scale:i,coordinate:a}=u;return E_(t,e,n,r,i,a)},filter:(r,i)=>X(this,void 0,void 0,function*(){if(!c){c=!0;const[e,n]=r;var t=o["marks"],t=t.map(t=>ot({axis:Object.assign(Object.assign({},f&&{x:{transform:[{type:"hide"}]}}),d&&{y:{transform:[{type:"hide"}]}})},t,{scale:{x:{domain:e,nice:!1},y:{domain:n,nice:!1}}})),t=(a.emit("brush:filter",Object.assign(Object.assign({},i),{data:{selection:[e,n]}})),Object.assign(Object.assign({},o),{marks:t,clip:!0})),t=yield s(t);u=t.view,c=!1,l=!0}}),reset:t=>{var e,n;!c&&l&&(e=r["scale"],{x:e,y:n}=e,e=e.getOptions().domain,n=n.getOptions().domain,a.emit("brush:filter",Object.assign(Object.assign({},t),{data:{selection:[e,n]}})),l=!1,u=r,s(o))},extent:void 0,emitter:a,scale:i,coordinate:h},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),p))}}function P6(t){return T6(Object.assign(Object.assign({hideX:!0},t),{brushRegion:y6}))}function C6(t){return T6(Object.assign(Object.assign({hideY:!0},t),{brushRegion:v6}))}const L6="slider";function N6(t){return[t[0],t[t.length-1]]}function j6({channelDomain:C,className:L=L6,prefix:N="slider",setValue:j=(t,e)=>t.setValues(e),hasState:R=!1,wait:I=50,leading:B=!0,trailing:D=!1}){return(t,e,c)=>{const{container:n,view:r,options:u,update:h}=t;t=n.getElementsByClassName(L);if(!t.length)return()=>{};let f=!1;const{scale:i,coordinate:a,layout:o}=r,{paddingLeft:d,paddingTop:p,paddingBottom:g,paddingRight:y}=o,{x:s,y:l}=i,m=rv(a);const v=new Map,b=new Set;C=C||{x:s.getOptions().domain,y:l.getOptions().domain};for(const M of t){const O=M.attributes["orientation"],[k,E]=(w=O,x=void 0,x="vertical"===w?"y":"x",w="vertical"===w?"x":"y",m?[w,x]:[x,w]),S=""+N+Ue(k)+":filter",A="x"===k,_=s.getOptions()["ratio"],T=l.getOptions()["ratio"],P=t=>{var e,n;return t.data?(e=t.data["selection"],[e=N6(C.x),n=N6(C.y)]=e,A?[k_(s,e,_),k_(l,n,T)]:[k_(l,n,T),k_(s,e,_)]):(n=t.detail["value"],[function(t,e,n){var[t,r]=t;return k_(e,[O_(e,(n=n?t=>1-t:t=>t)(t),!0),O_(e,n(r),!1)])}(n,i[k],m&&"horizontal"===O),C[E]])};var x=ln(l=>X(this,void 0,void 0,function*(){var t,e,n,r,i,a,o,s;f||(f=!0,{nativeEvent:t=!0}=l,[e,s]=P(l),C[k]=e,C[E]=s,[n,r,i,a=!1]=[u,{[k]:{domain:e,nice:!1},[E]:{domain:s,nice:!1}},N,R],o=(o=n["marks"]).map(t=>{var e;return ot({axis:{x:{transform:[{type:"hide"}]},y:{transform:[{type:"hide"}]}}},t,{scale:r,[i]:Object.assign(Object.assign({},(null==(e=t[i])?void 0:e.x)&&{x:Object.assign({preserve:!0},a&&{ratio:null})}),(null==(e=t[i])?void 0:e.y)&&{y:Object.assign({preserve:!0},a&&{ratio:null})}),animate:!1})}),n=Object.assign(Object.assign({},n),{marks:o,clip:!0,animate:!1}),t&&(o=A?e:s,s=A?s:e,c.emit(S,Object.assign(Object.assign({},l),{nativeEvent:t,data:{selection:[N6(o),N6(s)]}}))),yield h(Object.assign(Object.assign({},n),{paddingLeft:d,paddingTop:p,paddingBottom:g,paddingRight:y})),f=!1)}),I,{leading:B,trailing:D}),w=t=>{var e,n=t["nativeEvent"];n||(n=t["data"],t=n["selection"],[t,e]=t,M.dispatchEvent(new gl("valuechange",{data:n,nativeEvent:!1})),n=A?S_(t,s):S_(e,l),j(M,n))};c.on(S,w),M.addEventListener("valuechange",x),v.set(M,x),b.add([S,w])}return()=>{for(var[t,e]of v)t.removeEventListener("valuechange",e);for(var[n,r]of b)c.off(n,r)}}}const R6="g2-scrollbar";function I6(o={}){return(t,e,n)=>{var r,{view:i,container:a}=t;return a.getElementsByClassName(R6).length?(a=i["scale"],{x:i,y:a}=a,r={x:i.getOptions().domain,y:a.getOptions().domain},i.update({domain:i.getOptions().expectedDomain}),a.update({domain:a.getOptions().expectedDomain}),j6(Object.assign(Object.assign({},o),{channelDomain:r,className:R6,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0])}))(t,e,n)):()=>{}}}const B6={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 D6(t){return"text"===t.nodeName&&!!t.isOverflowing()}function F6(t){var{offsetX:f=8,offsetY:d=8}=t,r=at(t,["offsetX","offsetY"]);return t=>{const s=t["container"],[l,c]=s.getBounds().min,u=st(r,"tip"),h=new Set,e=t=>{var e,n,r,i,a,o=t["target"];D6(o)?({offsetX:e,offsetY:n}=t,e=e+f-l,n=n+d-c,o.tip?(o.tip.style.x=e,o.tip.style.y=n):(i=o.style["text"],a=new gc({className:"poptip",style:{innerHTML:(r="div",i=i,a=Object.assign(Object.assign({},B6),u),`<${r} style="${Object.entries(a).map(([t,e])=>t.replace(/([A-Z])/g,"-$1").toLowerCase()+":"+e).join(";")}">${i}</${r}>`),x:e,y:n}}),s.appendChild(a),o.tip=a,h.add(a))):t.stopPropagation()},n=t=>{var e=t["target"];D6(e)?e.tip&&(e.tip.remove(),e.tip=null,h.delete(e.tip)):t.stopPropagation()};return s.addEventListener("pointerover",e),s.addEventListener("pointerout",n),()=>{s.removeEventListener("pointerover",e),s.removeEventListener("pointerout",n),h.forEach(t=>t.remove())}}}function z6(n){return(t,...e)=>ot({},n(t,...e),t)}function W6(n){return(t,...e)=>ot({},t,n(t,...e))}function G6(t,e){var n;return t?Array.isArray(t)?t:({value:n=e}=t,t=at(t,["value"]),Object.assign(Object.assign({},t),{value:n})):e}const H6=()=>t=>{var e=t["children"];if(!Array.isArray(e))return[];const{x:o=0,y:s=0,width:l,height:c,data:u}=t;return e.map(t=>{var{data:e,x:n,y:r,width:i,height:a}=t,t=at(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},t),{data:G6(e,u),x:null!=n?n:o,y:null!=r?r:s,width:null!=i?i:l,height:null!=a?a:c})})},V6=(H6.props={},()=>e=>{var n=e["children"];if(!Array.isArray(n))return[];var{direction:t="row",ratio:r=n.map(()=>1),padding:i=0,data:a}=e,[o,s,l,c]="col"===t?["y","height","width","x"]:["x","width","height","y"];const u=r.reduce((t,e)=>t+e),h=e[s]-i*(n.length-1);var f=r.map(t=>h*(t/u)),d=[];let p=e[o]||0;for(let t=0;t<f.length;t+=1){var g=n[t],y=g["data"],g=at(g,["data"]),y=G6(y,a);d.push(Object.assign({[o]:p,[s]:f[t],[c]:e[c]||0,[l]:e[l],data:y},g)),p+=f[t]+i}return d}),Y6=(V6.props={},()=>t=>{var e=t["children"],t=at(t,["children"]);if(!Array.isArray(e))return[];const{data:s,scale:l={},axis:c={},legend:u={},encode:h={},transform:f=[]}=t,n=at(t,["data","scale","axis","legend","encode","transform"]);t=e.map(t=>{var{data:e,scale:n={},axis:r={},legend:i={},encode:a={},transform:o=[]}=t,t=at(t,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:G6(e,s),scale:ot({},l,n),encode:ot({},h,a),transform:[...f,...o],axis:!(!r||!c)&&ot({},c,r),legend:!(!i||!u)&&ot({},u,i)},t)});return[Object.assign(Object.assign({},n),{marks:t,type:"standardView"})]}),q6=(Y6.props={},({static:L=!1}={})=>t=>{var{width:e,height:n,paddingLeft:r,paddingRight:i,paddingTop:a,paddingBottom:o,padding:s,inset:l,insetLeft:c,insetTop:u,insetRight:h,insetBottom:f,margin:d,marginLeft:p,marginBottom:g,marginTop:y,marginRight:m,data:v,coordinate:b,theme:x,component:w,interaction:M,x:O,y:k,key:E,frame:S,labelTransform:A,parentKey:_,clip:T,viewStyle:P,title:C}=t,t=at(t,["width","height","paddingLeft","paddingRight","paddingTop","paddingBottom","padding","inset","insetLeft","insetTop","insetRight","insetBottom","margin","marginLeft","marginBottom","marginTop","marginRight","data","coordinate","theme","component","interaction","x","y","key","frame","labelTransform","parentKey","clip","viewStyle","title"]);return[Object.assign(Object.assign({type:"standardView",x:O,y:k,key:E,width:e,height:n,padding:s,paddingLeft:r,paddingRight:i,paddingTop:a,inset:l,insetLeft:c,insetTop:u,insetRight:h,insetBottom:f,paddingBottom:o,theme:x,coordinate:b,component:w,interaction:M,frame:S,labelTransform:A,margin:d,marginLeft:p,marginBottom:g,marginTop:y,marginRight:m,parentKey:_,clip:T,style:P},!L&&{title:C}),{marks:[Object.assign(Object.assign(Object.assign({},t),{key:E+"-0",data:v}),L&&{title:C})]})]});q6.props={};class $6{constructor(t){this.$value=t}static of(t){return new $6(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const U6=z6(t=>{const{encode:e,data:i,scale:a,shareSize:o=!1}=t;var{x:t,y:n}=e,r=(e,t)=>{if(void 0===e||!o)return{};const n=Sd(i,t=>t[e]);var t=(null==(t=null===a||void 0===a?void 0:a[t])?void 0:t.domain)||Array.from(n.keys()),r=t.map(t=>n.has(t)?n.get(t).length:1);return{domain:t,flex:r}};return{scale:{x:Object.assign(Object.assign({paddingOuter:0,paddingInner:.1,guide:void 0===t?null:{position:"top"}},void 0===t&&{paddingInner:0}),r(t,"x")),y:Object.assign(Object.assign({range:[0,1],paddingOuter:0,paddingInner:.1,guide:void 0===n?null:{position:"right"}},void 0===n&&{paddingInner:0}),r(n,"y"))}}}),X6=z6(t=>{const{data:e,scale:n}=t;var r=[t];let i,a,o;for(;r.length;){const{children:f,encode:d={},scale:n={},legend:p={}}=r.shift();var s=d["color"],l=n["color"],c=p["color"];void 0!==s&&(i=s),void 0!==l&&(a=l),void 0!==c&&(o=c),Array.isArray(f)&&r.push(...f)}var t="string"==typeof i?i:"",[u,h]=void 0!==(u=null==(u=null===n||void 0===n?void 0:n.color)?void 0:u.domain)?[u]:void 0===i?[void 0]:(u="function"==typeof i?i:t=>t[i],(u=e.map(u)).some(t=>"number"==typeof t)?[wd(u)]:[Array.from(new Set(u)),"ordinal"]);return{encode:{color:i},scale:{color:ot({},a,{domain:u,type:h})},legend:{color:ot({title:t},o)}}}),K6=z6(()=>({animate:{enterType:"fadeIn"}})),Z6=W6(()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}})),Q6=W6(()=>({type:"cell"})),J6=W6(c=>{var t=c["data"];return{data:{type:"inline",value:t,transform:[{type:"custom",callback:()=>{var{data:t,encode:e}=c;const{x:n,y:r}=e,i=n?Array.from(new Set(t.map(t=>t[n]))):[],a=r?Array.from(new Set(t.map(t=>t[r]))):[];if(i.length&&a.length){var o=[];for(const s of i)for(const l of a)o.push({[n]:s,[r]:l});return o}return i.length?i.map(t=>({[n]:t})):a.length?a.map(t=>({[r]:t})):void 0}}]}}}),tP=W6((t,c=function(t){t=t.points;return h2(t)},w=function(a){return(t,e)=>{var{rowIndex:t,rowValuesLength:n,columnIndex:r,columnValuesLength:i}=t;return t!==n-1?eP(a,e):(t=e.length?void 0:null,ot({title:r===i-1&&void 0,grid:t},a))}},M=function(r){return(t,e)=>{var{rowIndex:t,columnIndex:n}=t;return 0!==n?eP(r,e):(n=e.length?void 0:null,ot({title:0===t&&void 0,grid:n},r))}},O={})=>{const{data:e,encode:n,children:u,scale:r,x:k=0,y:E=0,shareData:h=!1,key:S}=t,A=e["value"],{x:_,y:T}=n;t=r.color;const P=t["domain"];return{children:(t,e,n)=>{const{x:r,y:i}=e,{paddingLeft:y,paddingTop:m}=n,a=r.getOptions()["domain"],o=i.getOptions()["domain"];e=_p(t);const s=t.map(c);n=t.map(({x:t,y:e})=>[r.invert(t),i.invert(e)]);const l=n.map(([n,r])=>t=>{var{[_]:t,[T]:e}=t,t=void 0===_||t===n,e=void 0===T||e===r;return t&&e}).map(t=>A.filter(t)),v=h?Hd(l,t=>t.length):void 0,b=n.map(([t,e])=>({columnField:_,columnIndex:a.indexOf(t),columnValue:t,columnValuesLength:a.length,rowField:T,rowIndex:o.indexOf(e),rowValue:e,rowValuesLength:o.length})),x=b.map(t=>Array.isArray(u)?u:[u(t)].flat(1));return e.flatMap(c=>{const[u,h,f,d]=s[c],p=b[c],g=l[c];return x[c].map(t=>{var{scale:e,key:n,facet:r=!0,axis:i={}}=t,t=at(t,["scale","key","facet","axis","legend"]),a=(null==(a=null==e?void 0:e.y)?void 0:a.guide)||i.y,o=(null==(o=null==e?void 0:e.x)?void 0:o.guide)||i.x,s={x:{tickCount:_?5:void 0},y:{tickCount:T?5:void 0}},r=r?g:0===g.length?[]:A,l={color:{domain:P}},o={x:nP(o,w)(p,r),y:nP(a,M)(p,r)};return Object.assign(Object.assign({key:n+"-"+c,data:r,x:u+y+k,y:h+m+E,parentKey:S,width:f,height:d,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!r.length,dataDomain:v,scale:ot(s,e,l),axis:ot({},i,o),legend:!1},t),O)})})}}});function eP(t,e){return e.length?ot({title:!1,tick:null,label:null},t):ot({title:!1,tick:null,label:null,grid:null},t)}function nP(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const rP=()=>t=>{return[$6.of(t).call(Q6).call(X6).call(K6).call(U6).call(Z6).call(J6).call(tP).value()]},iP=(rP.props={},z6(t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),aP=W6(t=>{const{data:w,children:c,x:M=0,y:O=0,key:k}=t;return{children:(t,e,n)=>{const{x:r,y:i}=e,{paddingLeft:m,paddingTop:v}=n,a=r.getOptions()["domain"],o=i.getOptions()["domain"];e=_p(t);const s=t.map(({points:t})=>h2(t)),l=t.map(({x:t,y:e})=>[r.invert(t),i.invert(e)]),b=l.map(([t,e])=>({columnField:t,columnIndex:a.indexOf(t),columnValue:t,columnValuesLength:a.length,rowField:e,rowIndex:o.indexOf(e),rowValue:e,rowValuesLength:o.length})),x=b.map(t=>Array.isArray(c)?c:[c(t)].flat(1));return e.flatMap(c=>{const[u,h,f,d]=s[c],[p,g]=l[c],y=b[c];return x[c].map(t=>{var n,r,{scale:e,key:i,encode:a,axis:o}=t,t=at(t,["scale","key","encode","axis"]),s=null==(s=null==e?void 0:e.y)?void 0:s.guide,l=null==(l=null==e?void 0:e.x)?void 0:l.guide,l={x:("function"==typeof(r=l)?r:null===r?()=>null:(t,e)=>{var{rowIndex:t,rowValuesLength:n}=t;if(t!==n-1)return eP(r,e)})(y,w),y:("function"==typeof(n=s)?n:null===n?()=>null:(t,e)=>{t=t.columnIndex;if(0!==t)return eP(n,e)})(y,w)};return Object.assign({data:w,parentKey:k,key:i+"-"+c,x:u+m+M,y:h+v+O,width:f,height:d,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:ot({x:{facet:!1},y:{facet:!1}},e),axis:ot({x:{tickCount:5},y:{tickCount:5}},o,l),legend:!1,encode:ot({},a,{x:p,y:g})},t)})})}}}),oP=W6(t=>{var e=t["encode"],t=at(t,["encode"]),{position:n=[],x:r=n,y:i=[...n].reverse()}=e,n=at(e,["position","x","y"]),a=[];for(const o of[r].flat(1))for(const s of[i].flat(1))a.push({$x:o,$y:s});return Object.assign(Object.assign({},t),{data:a,encode:Object.assign(Object.assign({},n),{x:"$x",y:"$y"}),scale:Object.assign(Object.assign({},1===[r].flat(1).length&&{x:{paddingInner:0}}),1===[i].flat(1).length&&{y:{paddingInner:0}})})});const sP=()=>t=>{return[$6.of(t).call(Q6).call(X6).call(aP).call(oP).call(K6).call(Z6).call(iP).value()]},lP=z6(t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}})),cP=z6(t=>({coordinate:{type:"polar"}})),uP=t=>{var e=t["encode"],t=at(t,["encode"]),e=e["position"];return Object.assign(Object.assign({},t),{encode:{x:e}})};function hP(t){return t=>null}function fP(t){var t=t["points"],[t,e,n,r]=t,i=s2(t,r),t=a2(t,r),r=u2(t,a2(e,n)),e=1/Math.sin(r/2),i=i/(1+e),a=i*Math.sqrt(2),[n,o]=n,t=c2(t)+r/2,r=i*e;return[n+r*Math.sin(t)-a/2,o+r*Math.cos(t)-a/2,a,a]}const dP=()=>t=>{return[$6.of(t).call(Q6).call(uP).call(X6).call(cP).call(J6).call(tP,fP,hP,hP,{frame:!1}).call(K6).call(Z6).call(lP).value()]};const pP=()=>t=>{const{children:e=[],duration:a=1e3,iterationCount:l=1,direction:c="normal",easing:o="ease-in-out-sine"}=t,u=e.length;if(!Array.isArray(e)||0===u)return[];const n=e[0]["key"],h=e.map(t=>Object.assign(Object.assign({},t),{key:n})).map(t=>{for(var e=a,n=o,r=[t];r.length;){var i=r.pop(),i=(i.animate=ot({enter:{duration:e},update:{duration:e,easing:n,type:"morphing",fill:"both"},exit:{type:"fadeOut",duration:e}},i.animate||{}),i)["children"];Array.isArray(i)&&r.push(...i)}return t});return function*(){let t=0,e;for(;"infinite"===l||t<l;){n=c,a=t,o=u,s=void 0,s=[0,o],o=[1-o,1];var[n,r]="normal"===n?s:"reverse"===n?o:"alternate"===n?a%2==0?s:o:"reverse-alternate"===n?a%2==0?o:s:void 0;for(let t=n;t<r;t+=1){var i=Math.abs(t);e!==i&&(yield h[i]),e=i}t++}var a,o,s}},gP=(pP.props={},()=>t=>{var{data:e,scale:n,encode:r,style:i,animate:a,key:o,state:s}=t,t=at(t,["type","data","scale","encode","style","animate","key","state"]);return[Object.assign(Object.assign({type:"geoView"},t),{children:[{type:"geoPath",key:o+"-0",data:{value:e},scale:n,encode:r,style:i,animate:a,state:s}]})]});gP.props={};var C=1e-6,yP=1e-12,mP=Math.PI,vP=mP/2,bP=mP/4,xP=2*mP,wP=180/mP,MP=mP/180,OP=Math.abs,kP=Math.atan,EP=Math.atan2,A=Math.cos,SP=Math.ceil,AP=Math.exp,_P=Math.log,TP=Math.pow,_=Math.sin,PP=Math.sign||function(t){return 0<t?1:t<0?-1:0},CP=Math.sqrt,LP=Math.tan;function NP(t){return 1<t?0:t<-1?mP:Math.acos(t)}function jP(t){return 1<t?vP:t<-1?-vP:Math.asin(t)}function RP(){}function IP(t,e){t&&DP.hasOwnProperty(t.type)&&DP[t.type](t,e)}var BP={Feature:function(t,e){IP(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)IP(n[r].geometry,e)}},DP={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){FP(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)FP(n[r],e,0)},Polygon:function(t,e){zP(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)zP(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)IP(n[r],e)}};function FP(t,e,n){var r,i=-1,a=t.length-n;for(e.lineStart();++i<a;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function zP(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)FP(t[n],e,1);e.polygonEnd()}function WP(t,e){t&&BP.hasOwnProperty(t.type)?BP[t.type](t,e):IP(t,e)}function GP(t){return[EP(t[1],t[0]),jP(t[2])]}function HP(t){var e=t[0],t=t[1],n=A(t);return[n*A(e),n*_(e),_(t)]}function VP(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function YP(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function qP(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function $P(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function UP(t){var e=CP(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function XP(n,r){function t(t,e){return t=n(t,e),r(t[0],t[1])}return n.invert&&r.invert&&(t.invert=function(t,e){return(t=r.invert(t,e))&&n.invert(t[0],t[1])}),t}function KP(t,e){return OP(t)>mP&&(t-=Math.round(t/xP)*xP),[t,e]}function ZP(t,e,n){return(t%=xP)?e||n?XP(JP(t),t8(e,n)):JP(t):e||n?t8(e,n):KP}function QP(n){return function(t,e){return OP(t+=n)>mP&&(t-=Math.round(t/xP)*xP),[t,e]}}function JP(t){var e=QP(t);return e.invert=QP(-t),e}function t8(t,e){var i=A(t),a=_(t),o=A(e),s=_(e);function n(t,e){var n=A(e),r=A(t)*n,t=_(t)*n,n=_(e),e=n*i+r*a;return[EP(t*o-e*s,r*i-n*a),jP(e*o+t*s)]}return n.invert=function(t,e){var n=A(e),r=A(t)*n,t=_(t)*n,n=_(e),e=n*o-t*s;return[EP(t*o+n*s,r*i+e*a),jP(e*i-r*a)]},n}function e8(t,e){(e=HP(e))[0]-=t,UP(e);t=NP(-e[1]);return((-e[2]<0?-t:t)+xP-C)%xP}function n8(){var r,e=[];return{point:function(t,e,n){r.push([t,e,n])},lineStart:function(){e.push(r=[])},lineEnd:RP,rejoin:function(){1<e.length&&e.push(e.pop().concat(e.shift()))},result:function(){var t=e;return e=[],r=null,t}}}function r8(t,e){return OP(t[0]-e[0])<C&&OP(t[1]-e[1])<C}function i8(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function a8(t,e,n,r,a){var o,i,s=[],l=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],i=t[e];if(r8(r,i)){if(!r[2]&&!i[2]){for(a.lineStart(),o=0;o<e;++o)a.point((r=t[o])[0],r[1]);return void a.lineEnd()}i[0]+=2*C}s.push(n=new i8(r,t,null,!0)),l.push(n.o=new i8(r,null,n,!1)),s.push(n=new i8(i,t,null,!1)),l.push(n.o=new i8(i,null,n,!0))}}),s.length){for(l.sort(e),o8(s),o8(l),o=0,i=l.length;o<i;++o)l[o].e=n=!n;for(var c,u,h=s[0];;){for(var f=h,d=!0;f.v;)if((f=f.n)===h)return;c=f.z,a.lineStart();do{if(f.v=f.o.v=!0,f.e){if(d)for(o=0,i=c.length;o<i;++o)a.point((u=c[o])[0],u[1]);else r(f.x,f.n.x,1,a);f=f.n}else{if(d)for(c=f.p.z,o=c.length-1;0<=o;--o)a.point((u=c[o])[0],u[1]);else r(f.x,f.p.x,-1,a);f=f.p}}while(c=(f=f.o).z,d=!d,!f.v);a.lineEnd()}}}function o8(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function s8(t){return OP(t[0])<=mP?t[0]:PP(t[0])*((OP(t[0])+mP)%xP-mP)}function l8(y,m,v,b){return function(s){var l,c,u,n=m(s),h=n8(),f=m(h),d=!1,e={point:r,lineStart:i,lineEnd:a,polygonStart:function(){e.point=p,e.lineStart=o,e.lineEnd=g,c=[],l=[]},polygonEnd:function(){e.point=r,e.lineStart=i,e.lineEnd=a,c=Jd(c);var t=function(t,e){var n=s8(e),r=e[1],e=_(r),i=[_(n),-A(n),0],a=0,o=0,s=new Md;1===e?r=vP+C:-1===e&&(r=-vP-C);for(var l=0,c=t.length;l<c;++l)if(h=(u=t[l]).length)for(var u,h,f=u[h-1],d=s8(f),p=f[1]/2+bP,g=_(p),y=A(p),m=0;m<h;++m,d=b,g=w,y=x,f=v){var v=u[m],b=s8(v),x=v[1]/2+bP,w=_(x),x=A(x),M=b-d,O=0<=M?1:-1,k=O*M,E=mP<k,S=g*w;s.add(EP(S*O*_(k),y*x+S*A(k))),a+=E?M+O*xP:M,E^n<=d^n<=b&&(UP(S=YP(HP(f),HP(v))),UP(k=YP(i,S)),(O=(E^0<=M?-1:1)*jP(k[2]))<r||r===O&&(S[0]||S[1]))&&(o+=E^0<=M?1:-1)}return(a<-C||a<C&&s<-yP)^1&o}(l,b);c.length?(d||(s.polygonStart(),d=!0),a8(c,u8,t,v,s)):t&&(d||(s.polygonStart(),d=!0),s.lineStart(),v(null,null,1,s),s.lineEnd()),d&&(s.polygonEnd(),d=!1),c=l=null},sphere:function(){s.polygonStart(),s.lineStart(),v(null,null,1,s),s.lineEnd(),s.polygonEnd()}};function r(t,e){y(t,e)&&s.point(t,e)}function t(t,e){n.point(t,e)}function i(){e.point=t,n.lineStart()}function a(){e.point=r,n.lineEnd()}function p(t,e){u.push([t,e]),f.point(t,e)}function o(){f.lineStart(),u=[]}function g(){p(u[0][0],u[0][1]),f.lineEnd();var t,e,n,r,i=f.clean(),a=h.result(),o=a.length;if(u.pop(),l.push(u),u=null,o)if(1&i){if(0<(e=(n=a[0]).length-1)){for(d||(s.polygonStart(),d=!0),s.lineStart(),t=0;t<e;++t)s.point((r=n[t])[0],r[1]);s.lineEnd()}}else 1<o&&2&i&&a.push(a.pop().concat(a.shift())),c.push(a.filter(c8))}return e}}function c8(t){return 1<t.length}function u8(t,e){return((t=t.x)[0]<0?t[1]-vP-C:vP-t[1])-((e=e.x)[0]<0?e[1]-vP-C:vP-e[1])}KP.invert=KP;var h8=l8(function(){return 1},function(c){var u,h=NaN,f=NaN,d=NaN;return{lineStart:function(){c.lineStart(),u=1},point:function(t,e){var n,r,i,a,o,s=0<t?mP:-mP,l=OP(t-h);OP(l-mP)<C?(c.point(h,f=0<(f+e)/2?vP:-vP),c.point(d,f),c.lineEnd(),c.lineStart(),c.point(s,f),c.point(t,f),u=0):d!==s&&mP<=l&&(OP(h-d)<C&&(h-=d*C),OP(t-s)<C&&(t-=s*C),l=f,i=e,o=_((n=h)-(r=t)),f=OP(o)>C?kP((_(l)*(a=A(i))*_(r)-_(i)*(r=A(l))*_(n))/(r*a*o)):(l+i)/2,c.point(d,f),c.lineEnd(),c.lineStart(),c.point(s,f),u=0),c.point(h=t,f=e),d=s},lineEnd:function(){c.lineEnd(),h=f=NaN},clean:function(){return 2-u}}},function(t,e,n,r){var i;null==t?(i=n*vP,r.point(-mP,i),r.point(0,i),r.point(mP,i),r.point(mP,0),r.point(mP,-i),r.point(0,-i),r.point(-mP,-i),r.point(-mP,0),r.point(-mP,i)):OP(t[0]-e[0])>C?(t=t[0]<e[0]?mP:-mP,i=n*t/2,r.point(-t,i),r.point(0,i),r.point(t,i)):r.point(e[0],e[1])},[-mP,-vP]);function f8(d){var g=A(d),p=6*MP,h=0<g,f=OP(g)>C;function y(t,e){return A(t)*A(e)>g}function m(t,e,n){var r,i,a,o,s,l,c,u=[1,0,0],h=YP(HP(t),HP(e)),f=VP(h,h),d=h[0],p=f-d*d;return p?(r=YP(u,h),qP(u=$P(u,g*f/p),$P(h,-g*d/p)),(p=(h=VP(u,f=r))*h-(d=VP(f,f))*(VP(u,u)-1))<0?void 0:(qP(p=$P(f,(-h-(r=CP(p)))/d),u),p=GP(p),n?(i=t[0],a=e[0],o=t[1],e=e[1],a<i&&(c=i,i=a,a=c),!(l=OP((s=a-i)-mP)<C)&&e<o&&(c=o,o=e,e=c),(l||s<C?l?0<o+e^p[1]<(OP(p[0]-i)<C?o:e):o<=p[1]&&p[1]<=e:mP<s^(i<=p[0]&&p[0]<=a))?(qP(c=$P(f,(-h+r)/d),u),[p,GP(c)]):void 0):p)):!n&&t}function v(t,e){var n=h?d:mP-d,r=0;return t<-n?r|=1:n<t&&(r|=2),e<-n?r|=4:n<e&&(r|=8),r}return l8(y,function(a){var o,s,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(t,e){var n,r=[t,e],i=y(t,e),t=h?i?0:v(t,e):i?v(t+(t<0?mP:-mP),e):0;!o&&(c=l=i)&&a.lineStart(),i===l||(n=m(o,r))&&!r8(o,n)&&!r8(r,n)||(r[2]=1),i!==l?(u=0,i?(a.lineStart(),n=m(r,o),a.point(n[0],n[1])):(n=m(o,r),a.point(n[0],n[1],2),a.lineEnd()),o=n):f&&o&&h^i&&(t&s||!(e=m(r,o,!0))||(u=0,h?(a.lineStart(),a.point(e[0][0],e[0][1]),a.point(e[1][0],e[1][1]),a.lineEnd()):(a.point(e[1][0],e[1][1]),a.lineEnd(),a.lineStart(),a.point(e[0][0],e[0][1],3)))),!i||o&&r8(o,r)||a.point(r[0],r[1]),o=r,l=i,s=t},lineEnd:function(){l&&a.lineEnd(),o=null},clean:function(){return u|(c&&l)<<1}}},function(t,e,n,r){var i=r,r=d,a=p,o=n,n=t,s=e;if(a){var l=A(r),c=_(r),u=o*a;null==n?(n=r+o*xP,s=r-u/2):(n=e8(l,n),s=e8(l,s),(0<o?n<s:s<n)&&(n+=o*xP));for(var h,f=n;0<o?s<f:f<s;f-=u)h=GP([l,-c*A(f),-c*_(f)]),i.point(h[0],h[1])}},h?[0,-d]:[-mP,d-mP])}var d8=1e9,p8=-d8;function g8(m,v,b,x){function w(t,e){return m<=t&&t<=b&&v<=e&&e<=x}function M(t,e,n,r){var i=0,a=0;if(null==t||(i=o(t,n))!==(a=o(e,n))||s(t,e)<0^0<n)for(;r.point(0===i||3===i?m:b,1<i?x:v),(i=(i+n+4)%4)!==a;);else r.point(e[0],e[1])}function o(t,e){return OP(t[0]-m)<C?0<e?0:3:OP(t[0]-b)<C?0<e?2:1:OP(t[1]-v)<C?0<e?1:0:0<e?3:2}function O(t,e){return s(t.x,e.x)}function s(t,e){var n=o(t,1),r=o(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(r){var i,h,a,o,s,l,c,u,f,d,p,g=r,t=n8(),e={point:n,lineStart:function(){e.point=y,h&&h.push(a=[]);d=!0,f=!1,c=u=NaN},lineEnd:function(){i&&(y(o,s),l&&f&&t.rejoin(),i.push(t.result()));e.point=n,f&&g.lineEnd()},polygonStart:function(){g=t,i=[],h=[],p=!0},polygonEnd:function(){var t=function(){for(var t=0,e=0,n=h.length;e<n;++e)for(var r,i,a=h[e],o=1,s=a.length,l=a[0],c=l[0],u=l[1];o<s;++o)r=c,i=u,l=a[o],c=l[0],u=l[1],i<=x?x<u&&(u-i)*(m-r)<(c-r)*(x-i)&&++t:u<=x&&(c-r)*(x-i)<(u-i)*(m-r)&&--t;return t}(),e=p&&t,n=(i=Jd(i)).length;(e||n)&&(r.polygonStart(),e&&(r.lineStart(),M(null,null,1,r),r.lineEnd()),n&&a8(i,O,t,M,r),r.polygonEnd());g=r,i=h=a=null}};function n(t,e){w(t,e)&&g.point(t,e)}function y(t,e){var n,r,i=w(t,e);h&&a.push([t,e]),d?(o=t,s=e,d=!1,(l=i)&&(g.lineStart(),g.point(t,e))):i&&f?g.point(t,e):!function(t,e,n,r,i,a){var o=t[0],s=t[1],l=0,c=1,u=e[0]-o,h=e[1]-s,n=n-o;if(u||!(0<n)){if(n/=u,u<0){if(n<l)return;n<c&&(c=n)}else if(0<u){if(c<n)return;l<n&&(l=n)}if(n=i-o,u||!(n<0)){if(n/=u,u<0){if(c<n)return;l<n&&(l=n)}else if(0<u){if(n<l)return;n<c&&(c=n)}if(n=r-s,h||!(0<n)){if(n/=h,h<0){if(n<l)return;n<c&&(c=n)}else if(0<h){if(c<n)return;l<n&&(l=n)}if(n=a-s,h||!(n<0)){if(n/=h,h<0){if(c<n)return;l<n&&(l=n)}else if(0<h){if(n<l)return;n<c&&(c=n)}return 0<l&&(t[0]=o+l*u,t[1]=s+l*h),c<1&&(e[0]=o+c*u,e[1]=s+c*h),1}}}}}(n=[c=Math.max(p8,Math.min(d8,c)),u=Math.max(p8,Math.min(d8,u))],r=[t=Math.max(p8,Math.min(d8,t)),e=Math.max(p8,Math.min(d8,e))],m,v,b,x)?i&&(g.lineStart(),g.point(t,e),p=!1):(f||(g.lineStart(),g.point(n[0],n[1])),g.point(r[0],r[1]),i||g.lineEnd(),p=!1),c=t,u=e,f=i}return e}}function y8(t,e,n){var r=tp(t,e-C,n).concat(e);return function(e){return r.map(function(t){return[e,t]})}}function m8(t,e,n){var r=tp(t,e-C,n).concat(e);return function(e){return r.map(function(t){return[t,e]})}}function v8(){return g=p=10,y=90,m=360,v=2.5,e.lines=function(){return t().map(function(t){return{type:"LineString",coordinates:t}})},e.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(d(l).slice(1),f(i).reverse().slice(1),d(c).reverse().slice(1))]}},e.extent=function(t){return arguments.length?e.extentMajor(t).extentMinor(t):e.extentMinor()},e.extentMajor=function(t){return arguments.length?(a=+t[0][0],i=+t[1][0],c=+t[0][1],l=+t[1][1],i<a&&(t=a,a=i,i=t),l<c&&(t=c,c=l,l=t),e.precision(v)):[[a,c],[i,l]]},e.extentMinor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],o=+t[1][1],n<r&&(t=r,r=n,n=t),o<s&&(t=s,s=o,o=t),e.precision(v)):[[r,s],[n,o]]},e.step=function(t){return arguments.length?e.stepMajor(t).stepMinor(t):e.stepMinor()},e.stepMajor=function(t){return arguments.length?(y=+t[0],m=+t[1],e):[y,m]},e.stepMinor=function(t){return arguments.length?(p=+t[0],g=+t[1],e):[p,g]},e.precision=function(t){return arguments.length?(v=+t,u=y8(s,o,90),h=m8(r,n,v),f=y8(c,l,90),d=m8(a,i,v),e):v},e.extentMajor([[-180,-90+C],[180,90-C]]).extentMinor([[-180,-80-C],[180,80+C]])();function e(){return{type:"MultiLineString",coordinates:t()}}function t(){return tp(SP(a/y)*y,i,y).map(f).concat(tp(SP(c/m)*m,l,m).map(d)).concat(tp(SP(r/p)*p,n,p).filter(function(t){return OP(t%y)>C}).map(u)).concat(tp(SP(s/g)*g,o,g).filter(function(t){return OP(t%m)>C}).map(h))}var n,r,i,a,o,s,l,c,u,h,f,d,p,g,y,m,v}var b8,x8,w8,M8,O8=t=>t,k8=new Md,E8=new Md,S8={point:RP,lineStart:RP,lineEnd:RP,polygonStart:function(){S8.lineStart=A8,S8.lineEnd=P8},polygonEnd:function(){S8.lineStart=S8.lineEnd=S8.point=RP,k8.add(OP(E8)),E8=new Md},result:function(){var t=k8/2;return k8=new Md,t}};function A8(){S8.point=_8}function _8(t,e){S8.point=T8,b8=w8=t,x8=M8=e}function T8(t,e){E8.add(M8*t-w8*e),w8=t,M8=e}function P8(){T8(b8,x8)}var C8=S8,L8=1/0,N8=L8,j8=-L8,R8=j8;var I8,B8,D8,F8,z8={point:function(t,e){t<L8&&(L8=t);j8<t&&(j8=t);e<N8&&(N8=e);R8<e&&(R8=e)},lineStart:RP,lineEnd:RP,polygonStart:RP,polygonEnd:RP,result:function(){var t=[[L8,N8],[j8,R8]];return j8=R8=-(N8=L8=1/0),t}},W8=0,G8=0,H8=0,V8=0,Y8=0,q8=0,$8=0,U8=0,X8=0,K8={point:Z8,lineStart:Q8,lineEnd:eC,polygonStart:function(){K8.lineStart=nC,K8.lineEnd=rC},polygonEnd:function(){K8.point=Z8,K8.lineStart=Q8,K8.lineEnd=eC},result:function(){var t=X8?[$8/X8,U8/X8]:q8?[V8/q8,Y8/q8]:H8?[W8/H8,G8/H8]:[NaN,NaN];return W8=G8=H8=V8=Y8=q8=$8=U8=X8=0,t}};function Z8(t,e){W8+=t,G8+=e,++H8}function Q8(){K8.point=J8}function J8(t,e){K8.point=tC,Z8(D8=t,F8=e)}function tC(t,e){var n=t-D8,r=e-F8,n=CP(n*n+r*r);V8+=n*(D8+t)/2,Y8+=n*(F8+e)/2,q8+=n,Z8(D8=t,F8=e)}function eC(){K8.point=Z8}function nC(){K8.point=iC}function rC(){aC(I8,B8)}function iC(t,e){K8.point=aC,Z8(I8=D8=t,B8=F8=e)}function aC(t,e){var n=t-D8,r=e-F8,n=CP(n*n+r*r);V8+=n*(D8+t)/2,Y8+=n*(F8+e)/2,q8+=n,$8+=(n=F8*t-D8*e)*(D8+t),U8+=n*(F8+e),X8+=3*n,Z8(D8=t,F8=e)}var oC=K8;function sC(t){this._context=t}sC.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,xP)}},result:RP};var lC,cC,uC,hC,fC,dC=new Md,pC={point:RP,lineStart:function(){pC.point=gC},lineEnd:function(){lC&&yC(cC,uC),pC.point=RP},polygonStart:function(){lC=!0},polygonEnd:function(){lC=null},result:function(){var t=+dC;return dC=new Md,t}};function gC(t,e){pC.point=yC,cC=hC=t,uC=fC=e}function yC(t,e){hC-=t,fC-=e,dC.add(CP(hC*hC+fC*fC)),hC=t,fC=e}var mC=pC;let vC,bC,xC,wC;class MC{constructor(t){this._append=null==t?OC:function(t){var e=Math.floor(t);if(!(0<=e))throw new RangeError("invalid digits: "+t);if(15<e)return OC;if(e!==vC){const r=10**e;vC=e,bC=function(t){let e=1;this._+=t[0];for(var n=t.length;e<n;++e)this._+=Math.round(arguments[e]*r)/r+t[e]}}return bC}(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(t,e){switch(this._point){case 0:this._append`M${t},${e}`,this._point=1;break;case 1:this._append`L${t},${e}`;break;default:var n,r;this._append`M${t},${e}`,this._radius===xC&&this._append===bC||(n=this._radius,r=this._,this._="",this._append`m0,${n}a${n},${n} 0 1,1 0,${-2*n}a${n},${n} 0 1,1 0,${2*n}z`,xC=n,bC=this._append,wC=this._,this._=r),this._+=wC}}result(){var t=this._;return this._="",t.length?t:null}}function OC(t){let e=1;this._+=t[0];for(var n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function kC(e,n){let r=3,i=4.5,a,o;function s(t){return t&&("function"==typeof i&&o.pointRadius(+i.apply(this,arguments)),WP(t,a(o))),o.result()}return s.area=function(t){return WP(t,a(C8)),C8.result()},s.measure=function(t){return WP(t,a(mC)),mC.result()},s.bounds=function(t){return WP(t,a(z8)),z8.result()},s.centroid=function(t){return WP(t,a(oC)),oC.result()},s.projection=function(t){return arguments.length?(a=null==t?(e=null,O8):(e=t).stream,s):e},s.context=function(t){return arguments.length?(o=null==t?(n=null,new MC(r)):new sC(n=t),"function"!=typeof i&&o.pointRadius(i),s):n},s.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(o.pointRadius(+t),+t),s):i},s.digits=function(t){if(!arguments.length)return r;if(null==t)r=null;else{var e=Math.floor(t);if(!(0<=e))throw new RangeError("invalid digits: "+t);r=e}return null===n&&(o=new MC(r)),s},s.projection(e).digits(r).context(n)}function EC(r){return function(t){var e,n=new SC;for(e in r)n[e]=r[e];return n.stream=t,n}}function SC(){}function AC(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),WP(n,t.stream(z8)),e(z8.result()),null!=r&&t.clipExtent(r),t}function _C(i,a,t){return AC(i,function(t){var e=a[1][0]-a[0][0],n=a[1][1]-a[0][1],r=Math.min(e/(t[1][0]-t[0][0]),n/(t[1][1]-t[0][1])),e=+a[0][0]+(e-r*(t[1][0]+t[0][0]))/2,n=+a[0][1]+(n-r*(t[1][1]+t[0][1]))/2;i.scale(150*r).translate([e,n])},t)}function TC(t,e,n){return _C(t,[[0,0],e],n)}function PC(r,i,t){return AC(r,function(t){var e=+i,n=e/(t[1][0]-t[0][0]),e=(e-n*(t[1][0]+t[0][0]))/2,t=-n*t[0][1];r.scale(150*n).translate([e,t])},t)}function CC(i,a,t){return AC(i,function(t){var e=+a,n=e/(t[1][1]-t[0][1]),r=-n*t[0][0],e=(e-n*(t[1][1]+t[0][1]))/2;i.scale(150*n).translate([r,e])},t)}SC.prototype={constructor:SC,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var LC=16,NC=A(30*MP);function jC(t,e){return+e?(A=t,_=e,function(r){var n,i,a,o,s,l,c,u,h,f,d,p,g={point:t,lineStart:e,lineEnd:m,polygonStart:function(){r.polygonStart(),g.lineStart=v},polygonEnd:function(){r.polygonEnd(),g.lineStart=e}};function t(t,e){t=A(t,e),r.point(t[0],t[1])}function e(){u=NaN,g.point=y,r.lineStart()}function y(t,e){var n=HP([t,e]),e=A(t,e);T(u,h,c,f,d,p,u=e[0],h=e[1],c=t,f=n[0],d=n[1],p=n[2],LC,r),r.point(u,h)}function m(){g.point=t,r.lineEnd()}function v(){e(),g.point=b,g.lineEnd=x}function b(t,e){y(n=t,e),i=u,a=h,o=f,s=d,l=p,g.point=y}function x(){T(u,h,c,f,d,p,i,a,n,o,s,l,LC,r),g.lineEnd=m,m()}return g}):(n=t,EC({point:function(t,e){t=n(t,e),this.stream.point(t[0],t[1])}}));var n,A,_;function T(t,e,n,r,i,a,o,s,l,c,u,h,f,d){var p,g,y,m,v,b,x,w,M,O,k=o-t,E=s-e,S=k*k+E*E;4*_<S&&f--&&(y=a+h,x=jP(y/=m=CP((p=r+c)*p+(g=i+u)*g+y*y)),v=OP(OP(y)-1)<C||OP(n-l)<C?(n+l)/2:EP(g,p),b=(x=A(v,x))[0],x=x[1],_<(O=E*(w=b-t)-k*(M=x-e))*O/S||.3<OP((k*w+E*M)/S-.5)||r*c+i*u+a*h<NC)&&(T(t,e,n,r,i,a,b,x,v,p/=m,g/=m,y,f,d),d.point(b,x),T(b,x,v,p,g,y,o,s,l,c,u,h,f,d))}}var RC=EC({point:function(t,e){this.stream.point(t*MP,e*MP)}});function IC(t,n,r,i,a,e){var o,s,l,c,u,h,f,d,p,g,y,m;return e?(h=A(e),e=_(e),f=h*t,d=e*t,p=h/t,g=e/t,y=(e*r-h*n)/t,m=(e*n+h*r)/t,b.invert=function(t,e){return[i*(p*t-g*e+y),a*(m-g*t-p*e)]},b):(o=t,s=n,l=r,c=i,u=a,v.invert=function(t,e){return[(t-s)/o*c,(l-e)/o*u]},v);function v(t,e){return[s+o*(t*=c),l-o*(e*=u)]}function b(t,e){return[f*(t*=i)-d*(e*=a)+n,r-d*t-f*e]}}function BC(t){return DC(function(){return t})()}function DC(t){var e,r,n,i,a,o,s,l,c,u,h=150,f=480,d=250,p=0,g=0,y=0,m=0,v=0,b=0,x=1,w=1,M=null,O=h8,k=null,E=O8,S=.5;function A(t){return l(t[0]*MP,t[1]*MP)}function _(t){return(t=l.invert(t[0],t[1]))&&[t[0]*wP,t[1]*wP]}function T(){var t=IC(h,0,0,x,w,b).apply(null,e(p,g)),t=IC(h,f-t[0],d-t[1],x,w,b);return r=ZP(y,m,v),s=XP(e,t),l=XP(r,s),o=jC(s,S),P()}function P(){return c=u=null,A}return A.stream=function(t){return c&&u===t?c:c=RC((n=r,EC({point:function(t,e){t=n(t,e);return this.stream.point(t[0],t[1])}})(O(o(E(u=t))))));var n},A.preclip=function(t){return arguments.length?(O=t,M=void 0,P()):O},A.postclip=function(t){return arguments.length?(E=t,k=n=i=a=null,P()):E},A.clipAngle=function(t){return arguments.length?(O=+t?f8(M=t*MP):(M=null,h8),P()):M*wP},A.clipExtent=function(t){return arguments.length?(E=null==t?(k=n=i=a=null,O8):g8(k=+t[0][0],n=+t[0][1],i=+t[1][0],a=+t[1][1]),P()):null==k?null:[[k,n],[i,a]]},A.scale=function(t){return arguments.length?(h=+t,T()):h},A.translate=function(t){return arguments.length?(f=+t[0],d=+t[1],T()):[f,d]},A.center=function(t){return arguments.length?(p=t[0]%360*MP,g=t[1]%360*MP,T()):[p*wP,g*wP]},A.rotate=function(t){return arguments.length?(y=t[0]%360*MP,m=t[1]%360*MP,v=2<t.length?t[2]%360*MP:0,T()):[y*wP,m*wP,v*wP]},A.angle=function(t){return arguments.length?(b=t%360*MP,T()):b*wP},A.reflectX=function(t){return arguments.length?(x=t?-1:1,T()):x<0},A.reflectY=function(t){return arguments.length?(w=t?-1:1,T()):w<0},A.precision=function(t){return arguments.length?(o=jC(s,S=t*t),P()):CP(S)},A.fitExtent=function(t,e){return _C(A,t,e)},A.fitSize=function(t,e){return TC(A,t,e)},A.fitWidth=function(t,e){return PC(A,t,e)},A.fitHeight=function(t,e){return CC(A,t,e)},function(){return e=t.apply(this,arguments),A.invert=e.invert&&_,T()}}function FC(t){var e=0,n=mP/3,r=DC(t),t=r(e,n);return t.parallels=function(t){return arguments.length?r(e=t[0]*MP,n=t[1]*MP):[e*wP,n*wP]},t}function zC(t,e){var n,r,i,a=_(t),o=(a+_(e))/2;return OP(o)<C?(n=A(t),s.invert=function(t,e){return[t/n,jP(e*n)]},s):(i=CP(r=1+a*(2*o-a))/o,l.invert=function(t,e){var e=i-e,n=EP(t,OP(e))*PP(e);return e*o<0&&(n-=mP*PP(t)*PP(e)),[n/o,jP((r-(t*t+e*e)*o*o)/(2*o))]},l);function s(t,e){return[t*n,_(e)/n]}function l(t,e){e=CP(r-2*o*_(e))/o;return[e*_(t*=o),i-e*A(t)]}}function WC(){return FC(zC).scale(155.424).center([0,33.6442])}function GC(){return WC().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function HC(i){return function(t,e){var n=A(t),r=A(e),n=i(n*r);return n===1/0?[2,0]:[n*r*_(t),n*_(e)]}}function VC(a){return function(t,e){var n=CP(t*t+e*e),r=a(n),i=_(r),r=A(r);return[EP(t*i,n*r),jP(n&&e*i/n)]}}var YC=HC(function(t){return CP(2/(1+t))});YC.invert=VC(function(t){return 2*jP(t/2)});var qC=HC(function(t){return(t=NP(t))&&t/_(t)});function $C(t,e){return[t,_P(LP((vP+e)/2))]}function UC(r){var i,a,o,s=BC(r),e=s.center,l=s.scale,n=s.translate,c=s.clipExtent,u=null;function h(){var e,t=mP*l(),n=s((e=ZP((e=s.rotate())[0]*MP,e[1]*MP,2<e.length?e[2]*MP:0),function(t){return(t=e.invert(t[0]*MP,t[1]*MP))[0]*=wP,t[1]*=wP,t}([0,0])));return c(null==u?[[n[0]-t,n[1]-t],[n[0]+t,n[1]+t]]:r===$C?[[Math.max(n[0]-t,u),i],[Math.min(n[0]+t,a),o]]:[[u,Math.max(n[1]-t,i)],[a,Math.min(n[1]+t,o)]])}return s.scale=function(t){return(arguments.length?(l(t),h):l)()},s.translate=function(t){return(arguments.length?(n(t),h):n)()},s.center=function(t){return(arguments.length?(e(t),h):e)()},s.clipExtent=function(t){return arguments.length?(null==t?u=i=a=o=null:(u=+t[0][0],i=+t[0][1],a=+t[1][0],o=+t[1][1]),h()):null==u?null:[[u,i],[a,o]]},h()}function XC(t){return LP((vP+t)/2)}function KC(t,e){var n=A(t),i=t===e?_(t):_P(n/A(e))/_P(XC(e)/XC(t)),a=n*TP(XC(t),i)/i;return i?(r.invert=function(t,e){var e=a-e,n=PP(i)*CP(t*t+e*e),r=EP(t,OP(e))*PP(e);return e*i<0&&(r-=mP*PP(t)*PP(e)),[r/i,2*kP(TP(a/n,1/i))-vP]},r):$C;function r(t,e){0<a?e<-vP+C&&(e=-vP+C):vP-C<e&&(e=vP-C);e=a/TP(XC(e),i);return[e*_(i*t),a-e*A(i*t)]}}function ZC(t,e){return[t,e]}function QC(t,e){var n=A(t),r=t===e?_(t):(n-A(e))/(e-t),i=n/r+t;return OP(r)<C?ZC:(a.invert=function(t,e){var e=i-e,n=EP(t,OP(e))*PP(e);return e*r<0&&(n-=mP*PP(t)*PP(e)),[n/r,i-PP(r)*CP(t*t+e*e)]},a);function a(t,e){e=i-e,t*=r;return[e*_(t),i-e*A(t)]}}qC.invert=VC(function(t){return t}),$C.invert=function(t,e){return[t,2*kP(AP(e))-vP]},ZC.invert=ZC;var JC=1.340264,tL=-.081106,eL=893e-6,nL=.003796,rL=CP(3)/2;function iL(t,e){var e=jP(rL*_(e)),n=e*e,r=n*n*n;return[t*A(e)/(rL*(JC+3*tL*n+r*(7*eL+9*nL*n))),e*(JC+tL*n+r*(eL+nL*n))]}function aL(t,e){var n=A(e),r=A(t)*n;return[n*_(t)/r,_(e)/r]}function oL(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function sL(t,e){return[A(e)*_(t),_(e)]}function lL(t,e){var n=A(e),r=1+A(t)*n;return[n*_(t)/r,_(e)/r]}function cL(t,e){return[_P(LP((vP+e)/2)),-t]}iL.invert=function(t,e){for(var n,r=e,i=r*r,a=i*i*i,o=0;o<12&&(a=(i=(r-=n=(r*(JC+tL*i+a*(eL+nL*i))-e)/(JC+3*tL*i+a*(7*eL+9*nL*i)))*r)*i*i,!(OP(n)<yP));++o);return[rL*t*(JC+3*tL*i+a*(7*eL+9*nL*i))/A(r),jP(_(r)/rL)]},aL.invert=VC(kP),oL.invert=function(t,e){var n=e,r=25;do{var i=n*n,a=i*i}while(n-=a=(n*(1.007226+i*(.015085+a*(.028874*i-.044475-.005916*a)))-e)/(1.007226+i*(.045255+a*(.259866*i-.311325-.005916*11*a))),OP(a)>C&&0<--r);return[t/(.8707+(i=n*n)*(i*(i*i*i*(.003971-.001529*i)-.013791)-.131979)),n]},sL.invert=VC(jP),lL.invert=VC(function(t){return 2*kP(t)}),cL.invert=function(t,e){return[-e,2*kP(AP(t))-vP]};var uL=Object.freeze({__proto__:null,geoAlbersUsa:function(){var e,n,i,a,o,r,s=GC(),l=WC().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=WC().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(t,e){r=[t,e]}};function h(t){var e=t[0],t=t[1];return r=null,i.point(e,t),r||(a.point(e,t),r)||(o.point(e,t),r)}function f(){return e=n=null,h}return h.invert=function(t){var e=s.scale(),n=s.translate(),r=(t[0]-n[0])/e,n=(t[1]-n[1])/e;return(.12<=n&&n<.234&&-.425<=r&&r<-.214?l:.166<=n&&n<.234&&-.214<=r&&r<-.115?c:s).invert(t)},h.stream=function(t){return e&&n===t?e:(r=[s.stream(n=t),l.stream(t),c.stream(t)],i=r.length,e={point:function(t,e){for(var n=-1;++n<i;)r[n].point(t,e)},sphere:function(){for(var t=-1;++t<i;)r[t].sphere()},lineStart:function(){for(var t=-1;++t<i;)r[t].lineStart()},lineEnd:function(){for(var t=-1;++t<i;)r[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<i;)r[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<i;)r[t].polygonEnd()}});var r,i},h.precision=function(t){return arguments.length?(s.precision(t),l.precision(t),c.precision(t),f()):s.precision()},h.scale=function(t){return arguments.length?(s.scale(t),l.scale(.35*t),c.scale(t),h.translate(s.translate())):s.scale()},h.translate=function(t){var e,n,r;return arguments.length?(e=s.scale(),n=+t[0],r=+t[1],i=s.translate(t).clipExtent([[n-.455*e,r-.238*e],[n+.455*e,r+.238*e]]).stream(u),a=l.translate([n-.307*e,r+.201*e]).clipExtent([[n-.425*e+C,r+.12*e+C],[n-.214*e-C,r+.234*e-C]]).stream(u),o=c.translate([n-.205*e,r+.212*e]).clipExtent([[n-.214*e+C,r+.166*e+C],[n-.115*e-C,r+.234*e-C]]).stream(u),f()):s.translate()},h.fitExtent=function(t,e){return _C(h,t,e)},h.fitSize=function(t,e){return TC(h,t,e)},h.fitWidth=function(t,e){return PC(h,t,e)},h.fitHeight=function(t,e){return CC(h,t,e)},h.scale(1070)},geoAlbers:GC,geoAzimuthalEqualArea:function(){return BC(YC).scale(124.75).clipAngle(179.999)},geoAzimuthalEqualAreaRaw:YC,geoAzimuthalEquidistant:function(){return BC(qC).scale(79.4188).clipAngle(179.999)},geoAzimuthalEquidistantRaw:qC,geoConicConformal:function(){return FC(KC).scale(109.5).parallels([30,30])},geoConicConformalRaw:KC,geoConicEqualArea:WC,geoConicEqualAreaRaw:zC,geoConicEquidistant:function(){return FC(QC).scale(131.154).center([0,13.9389])},geoConicEquidistantRaw:QC,geoEqualEarth:function(){return BC(iL).scale(177.158)},geoEqualEarthRaw:iL,geoEquirectangular:function(){return BC(ZC).scale(152.63)},geoEquirectangularRaw:ZC,geoGnomonic:function(){return BC(aL).scale(144.049).clipAngle(60)},geoGnomonicRaw:aL,geoIdentity:function(){var r,i,e,n,a,o,s,l=1,c=0,u=0,h=1,f=1,d=0,p=null,g=1,y=1,m=EC({point:function(t,e){t=x([t,e]);this.stream.point(t[0],t[1])}}),v=O8;function b(){return g=l*h,y=l*f,o=s=null,x}function x(t){var e,n=t[0]*g,t=t[1]*y;return d&&(e=t*r-n*i,n=n*r+t*i,t=e),[n+c,t+u]}return x.invert=function(t){var e,n=t[0]-c,t=t[1]-u;return d&&(e=t*r+n*i,n=n*r-t*i,t=e),[n/g,t/y]},x.stream=function(t){return o&&s===t?o:o=m(v(s=t))},x.postclip=function(t){return arguments.length?(v=t,p=e=n=a=null,b()):v},x.clipExtent=function(t){return arguments.length?(v=null==t?(p=e=n=a=null,O8):g8(p=+t[0][0],e=+t[0][1],n=+t[1][0],a=+t[1][1]),b()):null==p?null:[[p,e],[n,a]]},x.scale=function(t){return arguments.length?(l=+t,b()):l},x.translate=function(t){return arguments.length?(c=+t[0],u=+t[1],b()):[c,u]},x.angle=function(t){return arguments.length?(i=_(d=t%360*MP),r=A(d),b()):d*wP},x.reflectX=function(t){return arguments.length?(h=t?-1:1,b()):h<0},x.reflectY=function(t){return arguments.length?(f=t?-1:1,b()):f<0},x.fitExtent=function(t,e){return _C(x,t,e)},x.fitSize=function(t,e){return TC(x,t,e)},x.fitWidth=function(t,e){return PC(x,t,e)},x.fitHeight=function(t,e){return CC(x,t,e)},x},geoProjection:BC,geoProjectionMutator:DC,geoMercator:function(){return UC($C).scale(961/xP)},geoMercatorRaw:$C,geoNaturalEarth1:function(){return BC(oL).scale(175.295)},geoNaturalEarth1Raw:oL,geoOrthographic:function(){return BC(sL).scale(249.5).clipAngle(90+C)},geoOrthographicRaw:sL,geoStereographic:function(){return BC(lL).scale(250).clipAngle(142)},geoStereographicRaw:lL,geoTransverseMercator:function(){var t=UC(cL),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],2<t.length?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)},geoTransverseMercatorRaw:cL});function hL(t){return{type:"FeatureCollection",features:t.flatMap(t=>function(t){if(!t||!t.type)return null;var e={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featureCollection"}[t.type];if(!e)return null;return"geometry"===e?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]}:"feature"===e?{type:"FeatureCollection",features:[t]}:"featureCollection"===e?t:void 0}(t).features)}}function fL(t,e,n,r){var i,a,o,s,l,c,{outline:e=(e=e.filter(pL),e.find(t=>t.sphere)?{type:"Sphere"}:hL(e.filter(t=>!t.sphere).flatMap(t=>t.data.value)))}=r,{size:r="fitExtent"}=r;"fitExtent"===r?(i=t,o=e,{x:c,y:l,width:a,height:s}=c=n,i.fitExtent([[c,l],[a,s]],o)):"fitWidth"===r&&(i=t,c=e,{width:l,height:a}=l=n,[[l,c],[s,o]]=kC(i.fitWidth(l,c)).bounds(c),o=Math.ceil(o-c),c=Math.min(Math.ceil(s-l),o),s=i.scale()*(c-1)/c,[l,c]=i.translate(),c+=(a-o)/2,i.scale(s).translate([l,c]).precision(.2))}function dL(t){var e=t["data"];return Array.isArray(e)?Object.assign(Object.assign({},t),{data:{value:e}}):(e=e["type"],"graticule10"===e?Object.assign(Object.assign({},t),{data:{value:[v8()]}}):"sphere"===e?Object.assign(Object.assign({},t),{sphere:!0,data:{value:[{type:"Sphere"}]}}):t)}function pL(t){return"geoPath"===t.type}const gL=()=>t=>{var{children:e,coordinate:n={}}=t;if(!Array.isArray(e))return[];const{type:r="equalEarth"}=n,f=at(n,["type"]),d=function(t){if("function"==typeof t)return t;var e="geo"+Ue(t);if(e=uL[e])return e;throw new Error("Unknown coordinate: "+t)}(r),p=e.map(dL);let g;return[Object.assign(Object.assign({},t),{type:"view",scale:{x:{type:"identity"},y:{type:"identity"}},axis:!1,coordinate:{type:function(){return[["custom",(t,e,n,r)=>{const i=d();var a,o,s,l={x:t,y:e,width:n,height:r},c=(fL(i,p,l,f),i),l=f;for([o,s]of Object.entries(l))null!=(a=c[o])&&a.call(c,s);g=kC(i);const u=new wg({domain:[t,t+n]}),h=new wg({domain:[e,e+r]});return{transform:t=>{return t=t,(t=i(t))?([t,e]=t,[u.map(t),h.map(e)]):[null,null];var e},untransform:t=>{return(t=t)?([t,e]=t,t=[u.invert(t),h.invert(e)],i.invert(t)):null;var e}}}]]}},children:p.flatMap(t=>{var e,n,r;return pL(t)?({style:n,tooltip:r={}}=e=t,Object.assign(Object.assign({},e),{type:"path",tooltip:mv(r,{title:"id",items:[{channel:"color"}]}),style:Object.assign(Object.assign({},n),{d:t=>g(t)||[]})})):t})})]};function yL(t){var{min:t,max:e}=t;return[[t[0],t[1]],[e[0],e[1]]]}function mL(t,e){var[t,n]=t,[e,r]=e;return t>=e[0]&&t<=r[0]&&n>=e[1]&&n<=r[1]}gL.props={};const vL=t=>{const n=t["priority"];return t=>{const e=[];return n&&t.sort(n),t.forEach(t=>{iT(t);const i=t.getLocalBounds();e.some(t=>{var e=yL(i),t=yL(t.getLocalBounds()),[e,n]=e,[t,r]=t;return e[0]<r[0]&&n[0]>t[0]&&e[1]<r[1]&&n[1]>t[1]})?rT(t):e.push(t)}),t}};function bL(){const n=new Map;return[t=>n.get(t),(t,e)=>n.set(t,e)]}const xL=t=>{const{maxIterations:M=10,maxError:O=.1,padding:k=1}=t;return i=>{var e=i.length;if(!(e<=1)){const[g,y]=bL(),[m,v]=bL();var a,o,s,l,[c,t]=bL(),[u,n]=bL();for(const b of i){var{min:r,max:h}=function(t){var t=t.cloneNode(!0),{min:e,max:n}=((e=t.getElementById("connector"))&&t.removeChild(e),t.getRenderBounds());return t.destroy(),{min:e,max:n}}(b);const[x,g]=r;var[r,h]=h;y(b,g),v(b,g),t(b,h-g),n(b,[x,r])}for(let t=0;t<M;t++){i.sort((t,e)=>fd(m(t),m(e)));let r=0;for(let n=0;n<e-1;n++){var f=i[n];let t=n+1,e;for(;(e=i[t])&&([[a,o],[s,l]]=[u(f),u(e)],!(a<l&&s<o));)t+=1;if(e){const g=m(f);var d=c(f),p=m(e),d=p-(g+d);d<k&&(d=(k-d)/2,r=Math.max(r,d),v(f,g-d),v(e,p+d))}}if(r<O)break}for(const w of i)w.style.y+=m(w)-g(w)}return i}};function wL(t){t/=255;return t<=.03928?t/12.92:Math.pow((.055+t)/1.055,2.4)}function ML(t,e,n){return.2126*wL(t)+.7152*wL(e)+.0722*wL(n)}function OL(t,e){var{r:t,g:n,b:r}=t,{r:e,g:i,b:a}=e,t=ML(t,n,r),n=ML(e,i,a);return(Math.max(t,n)+.05)/(Math.min(t,n)+.05)}function kL(e,t){return t[Vd(t,t=>{return OL(e,"object"==typeof(t=t)?t:ma(t))})]}const EL=t=>{const{threshold:n=4.5,palette:r=["#000","#fff"]}=t;return t=>(t.forEach(t=>{var e=t.attr("dependentElement").parsedStyle.fill;OL(t.parsedStyle.fill,e)<n&&t.attr("fill",kL(e,r))}),t)},SL=()=>t=>(t.forEach(t=>{iT(t);var e=t.attr("bounds");!function(t,e){var[t,n]=t;return!(mL(t,e)&&mL(n,e))}(yL(t.getLocalBounds()),e)||rT(t)}),t);function AL(){return{"data.fetch":eA,"data.inline":lA,"data.sortBy":sA,"data.sort":iA,"data.filter":rA,"data.pick":aA,"data.rename":oA,"data.fold":nA,"data.slice":BA,"data.custom":cA,"data.map":uA,"data.join":IA,"data.kde":VA,"transform.stackY":bb,"transform.binX":v2,"transform.bin":m2,"transform.dodgeX":Ob,"transform.jitter":_b,"transform.jitterX":Tb,"transform.symmetryY":Pb,"transform.diffY":Cb,"transform.stackEnter":kb,"transform.normalizeY":Eb,"transform.select":Ib,"transform.selectX":Bb,"transform.selectY":Db,"transform.groupX":Kb,"transform.groupY":Zb,"transform.groupColor":Qb,"transform.group":Xb,"transform.sortX":e2,"transform.sortY":r2,"transform.sortColor":n2,"transform.flexX":i2,"transform.pack":p2,"transform.sample":w2,"transform.filter":M2,"coordinate.cartesian":Lp,"coordinate.polar":jp,"coordinate.helix":Rp,"coordinate.transpose":Ip,"coordinate.theta":Bp,"coordinate.parallel":zp,"coordinate.fisheye":Wp,"coordinate.radial":Fp,"coordinate.radar":Gp,"encode.constant":Jv,"encode.field":eb,"encode.transform":tb,"encode.column":nb,"mark.interval":I5,"mark.rect":B5,"mark.line":z5,"mark.point":W5,"mark.text":G5,"mark.cell":H5,"mark.area":V5,"mark.link":Y5,"mark.image":q5,"mark.polygon":$5,"mark.box":U5,"mark.vector":X5,"mark.lineX":Z5,"mark.lineY":K5,"mark.connector":Q5,"mark.range":eS,"mark.rangeX":nS,"mark.rangeY":rS,"mark.path":ES,"mark.shape":GS,"mark.density":y4,"mark.heatmap":m4,"shape.label.label":T5,"palette.category10":v4,"palette.category20":b4,"scale.linear":w4,"scale.ordinal":M4,"scale.band":x4,"scale.identity":O4,"scale.point":k4,"scale.time":E4,"scale.log":S4,"scale.pow":A4,"scale.sqrt":C4,"scale.threshold":_4,"scale.quantile":T4,"scale.quantize":P4,"scale.sequential":L4,"scale.constant":N4,"theme.classic":I4,"theme.classicDark":F4,"theme.academy":G4,"component.axisX":a_,"component.axisY":o_,"component.axisRadar":s_,"component.axisLinear":r_,"component.axisArc":i_,"component.legendCategory":u_,"component.legendContinuous":g_,"component.legendContinuousBlock":y_,"component.legendContinuousBlockSize":v_,"component.legendContinuousSize":m_,"component.legends":N_,"component.title":w_,"component.sliderX":__,"component.sliderY":T_,"component.scrollbarX":C_,"component.scrollbarY":L_,"animation.scaleInX":j_,"animation.scaleOutX":R_,"animation.scaleInY":I_,"animation.scaleOutY":B_,"animation.waveIn":X_,"animation.fadeIn":D_,"animation.fadeOut":F_,"animation.zoomIn":K_,"animation.zoomOut":Z_,"animation.pathIn":Q_,"animation.morphing":U_,"animation.growInX":J_,"animation.growInY":tT,"interaction.elementHighlight":OT,"interaction.elementHighlightByX":kT,"interaction.elementHighlightByColor":ET,"interaction.elementSelect":AT,"interaction.elementSelectByX":_T,"interaction.elementSelectByColor":TT,"interaction.fisheye":CT,"interaction.chartIndex":PT,"interaction.tooltip":KT,"interaction.legendFilter":l6,"interaction.legendHighlight":c6,"interaction.brushHighlight":g6,"interaction.brushXHighlight":m6,"interaction.brushYHighlight":b6,"interaction.brushAxisHighlight":A6,"interaction.brushFilter":T6,"interaction.brushXFilter":P6,"interaction.brushYFilter":C6,"interaction.sliderFilter":j6,"interaction.scrollbarFilter":I6,"interaction.poptip":F6,"interaction.event":jT,"composition.spaceLayer":H6,"composition.spaceFlex":V6,"composition.mark":q6,"composition.view":Y6,"composition.facetRect":rP,"composition.repeatMatrix":sP,"composition.facetCircle":dP,"composition.timingKeyframe":pP,"labelTransform.overlapHide":vL,"labelTransform.overlapDodgeY":xL,"labelTransform.overflowHide":SL,"labelTransform.contrastReverse":EL}}function _L(){return Object.assign(Object.assign(Object.assign(Object.assign({},{"composition.geoView":gL,"composition.geoPath":gP}),{"mark.forceGraph":j3,"mark.tree":G3}),{"data.venn":u4,"data.arc":pA,"data.cluster":I3,"mark.sankey":kS,"mark.treemap":TS,"mark.boxplot":WS,"mark.pack":LS,"mark.gauge":g4,"mark.wordCloud":h4}),AL())}function TL(t,e){class n extends t{constructor(t){super(Object.assign(Object.assign({},t),{lib:e}))}}return n}const PL=_L();const CL=t=>t?parseInt(t):0;const LL=["width","height","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title"];function NL(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function jL(t,e){var n,r=t["autoFit"];return r?(r=e,e=getComputedStyle(r),n=r.clientWidth||CL(e.width),r=r.clientHeight||CL(e.height),{width:n-(CL(e.paddingLeft)+CL(e.paddingRight)),height:r-(CL(e.paddingTop)+CL(e.paddingBottom))}):({width:n=640,height:r=480}=t,{width:n,height:r})}function RL(t){var t=function(t){if(null!==t.type)return t;var e=t.children[t.children.length-1];for(const n of LL)e.attr(n,t.attr(n));return e}(t),e=[t],n=new Map;for(n.set(t,NL(t));e.length;){const t=e.pop();var r=n.get(t),{children:i=[]}=t;for(const s of i){var a=NL(s),{children:o=[]}=r;o.push(a),e.push(s),n.set(s,a),r.children=o}}return n.get(t)}function IL(t,e,n,r){var t=t["type"],{type:n=n||t}=e;if("view"===n)return e;if(t=r,"function"!=typeof(r=n)&&!new Set(Object.keys(t)).has(r))return e;var i={type:"view"},a=Object.assign({},e);for(const o of LL)void 0!==a[o]&&(i[o]=a[o],delete a[o]);return Object.assign(Object.assign({},i),{children:[a]})}function BL(t,e,n){var r=t["type"],t=at(t,["type","children"]),e=new(function(t,e,n){if("function"==typeof t)return e.mark;if(e=Object.assign(Object.assign({},e),n)[t])return e;throw new Error(`Unknown mark: ${t}.`)}(r,e,n));return e.value=t,e.type=r,e}function DL(t,e){var n=e["type"],e=at(e,["type","children"]);t.type===n||void 0===n?function t(e,n,r=5,i=0){if(!(r<=i))for(const o of Object.keys(n)){var a=n[o];Ie(a)&&Ie(e[o])?t(e[o],a,r,i+1):e[o]=a}}(t.value,e):"string"==typeof n&&(t.type=n,t.value=e)}function FL(t,e,n,r,i){for(var a=[[null,t,IL(t,e,n,r)]];a.length;){var[o,s,l]=a.shift();if(s)if(l){DL(s,l);var c=l["children"],u=s["children"];if(Array.isArray(c)&&Array.isArray(u)){var h=Math.max(c.length,u.length);for(let t=0;t<h;t++){var f=c[t],d=u[t];a.push([s,d,f])}}}else s.remove();else{x=b=v=m=y=g=p=void 0;var p=o,g=l,y=r,m=i;if(p)for(var v=[[p,g]];v.length;){const[p,w]=v.shift();var b=BL(w,y,m),x=(Array.isArray(p.children)&&p.push(b),w)["children"];if(Array.isArray(x))for(const M of x)v.push([b,M])}}}}function zL(t,e){for(var n=[t];n.length;){var r=n.shift(),r=(e&&e(r),r.children||[]);for(const i of r)n.push(i)}}class WL{constructor(t={},e){this.parentNode=null,this.children=[],this.index=0,this.type=e,this.value=t}map(t=t=>t){t=t(this.value);return this.value=t,this}attr(e,n){return 1===arguments.length?this.value[e]:this.map(t=>(t[e]=n,t))}append(t){t=new t({});return t.children=[],this.push(t),t}push(t){return t.parentNode=this,t.index=this.children.length,this.children.push(t),this}remove(){var t,e=this.parentNode;return e&&(e=e["children"],t=e.findIndex(t=>t===this),e.splice(t,1)),this}getNodeByKey(e){let n=null;return zL(this,t=>{e===t.attr("key")&&(n=t)}),n}getNodesByType(e){const n=[];return zL(this,t=>{e===t.type&&n.push(t)}),n}getNodeByType(e){let n=null;return zL(this,t=>{n||e===t.type&&(n=t)}),n}call(t,...e){return t(this.map(),...e),this}getRoot(){let t=this;for(;t&&t.parentNode;)t=t.parentNode;return t}}function GL(t,e,{key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function HL(t,e,{key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):Array.isArray(t)?this.attr(n,t):(t=[...this.attr(n)||[],t],this.attr(n,t))}}function VL(t,e,{key:r=e}){t.prototype[e]=function(t,e){var n;return 0===arguments.length?this.attr(r):1===arguments.length&&"string"!=typeof t?this.attr(r,t):((n=this.attr(r)||{})[t]=1===arguments.length||e,this.attr(r,n))}}function YL(i){return t=>{for(var[e,n]of Object.entries(i)){var r=n["type"];"value"===r?GL(t,e,n):"array"===r?HL(t,e,n):"object"===r?VL(t,e,n):"node"===r?function(t,n,{ctor:r}){t.prototype[n]=function(t){var e=this.append(r);return"mark"===n&&(e.type=t),e}}(t,e,n):"container"===r?function(t,e,{ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}(t,e,n):"mix"===r&&function(t,r){t.prototype[r]=function(t){var e,n;return 0===arguments.length?this.attr(r):Array.isArray(t)?this.attr(r,{items:t}):hp(t)&&(void 0!==t.title||void 0!==t.items)||null===t||!1===t?this.attr(r,t):({items:n=[]}=e=this.attr(r)||{},n.push(t),e.items=n,this.attr(r,e))}}(t,e)}return t}}function qL(t){return Object.fromEntries(Object.entries(t).map(([t,e])=>[t,{type:"node",ctor:e}]))}om={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"}},im=Object.assign(Object.assign({},om),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),em=Object.assign(Object.assign({},om),{labelTransform:{type:"array"}});l.CompositionNode=class extends WL{changeData(e){var t,n=this.getRoot();if(n)return this.attr("data",e),null!=(t=this.children)&&t.length&&this.children.forEach(t=>{t.attr("data",e)}),null==n?void 0:n.render()}getView(){var t=this.getRoot().getContext()["views"];if(null!=t&&t.length)return t.find(t=>t.key===this._key)}getScale(){var t;return null==(t=this.getView())?void 0:t.scale}getScaleByChannel(t){var e=this.getScale();if(e)return e[t]}getCoordinate(){var t;return null==(t=this.getView())?void 0:t.coordinate}getTheme(){var t;return null==(t=this.getView())?void 0:t.theme}getGroup(){var t=this._key;if(t)return this.getRoot().getContext().canvas.getRoot().getElementById(t)}show(){var t=this.getGroup();t&&!t.isVisible()&&iT(t)}hide(){var t=this.getGroup();t&&t.isVisible()&&rT(t)}},l.CompositionNode=N([YL(em)],l.CompositionNode),l.MarkNode=class extends WL{changeData(t){var e=this.getRoot();if(e)return this.attr("data",t),null==e?void 0:e.render()}getMark(){var t,e=null==(e=this.getRoot())?void 0:e.getView();if(e)return e=e["markState"],t=Array.from(e.keys()).find(t=>t.key===this.attr("key")),e.get(t)}getScale(){var t=null==(t=this.getRoot())?void 0:t.getView();return!t||null==t?void 0:t.scale}getScaleByChannel(t){var e=null==(e=this.getRoot())?void 0:e.getView();return!e||null==(e=null==e?void 0:e.scale)?void 0:e[t]}getGroup(){var t=this.attr("key");if(t)return this.getRoot().getContext().canvas.getRoot().getElementById(t)}},l.MarkNode=N([YL(im)],l.MarkNode);class $L extends l.CompositionNode{constructor(t){var{container:e,canvas:n,renderer:r,plugins:i,lib:a}=t;super(at(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=Qe(()=>{this.forceFit()},300),this._renderer=r||new rd,this._plugins=i||[],this._container=void 0===(t=e)?document.createElement("div"):"string"==typeof t?document.getElementById(t):t,this._emitter=new ud,this._context={library:a,emitter:this._emitter,canvas:n},this._create()}render(){if(this._rendering)return this._addToTrailing();this._context.canvas||this._createCanvas(),this._bindAutoFit(),this._rendering=!0;var t=new Promise((t,e)=>Zv(this._computedOptions(),this._context,this._createResolve(t),this._createReject(e))),[e,n,r]=function(){let n,r;return[new Promise((t,e)=>{r=t,n=e}),r,n]}();return t.then(n).catch(r).then(()=>this._renderTrailing()),e}options(t){var e;return 0===arguments.length?RL(this):(e=t["type"],e&&(this._previousDefinedType=e),FL(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(pp.BEFORE_CLEAR),this._reset(),Qv(0,this._context,!1),this.emit(pp.AFTER_CLEAR)}destroy(){var t,e;this.options();this.emit(pp.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),Qv(0,this._context,!0),t=this._container,(e=t.parentNode)&&e.removeChild(t),this.emit(pp.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;var{width:t,height:e}=jL(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(pp.BEFORE_CHANGE_SIZE);t=this.render();return t.then(()=>{this.emit(pp.AFTER_CHANGE_SIZE)}),t}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(pp.BEFORE_CHANGE_SIZE),this.attr("width",t),this.attr("height",e);t=this.render();return t.then(()=>{this.emit(pp.AFTER_CHANGE_SIZE)}),t}_create(){var t=this._context["library"],e=["mark.mark",...Object.keys(t).filter(t=>t.startsWith("mark.")||"component.axisX"===t||"component.axisY"===t||"component.legends"===t)];this._marks={};for(const n of e){const r=n.split(".").pop();class i extends l.MarkNode{constructor(){super({},r)}}this._marks[r]=i,this[r]=function(t){var e=this.append(i);return"mark"===r&&(e.type=t),e}}e=Object.keys(t).filter(t=>t.startsWith("composition.")&&"composition.mark"!==t);this._compositions=Object.fromEntries(e.map(t=>{const e=t.split(".").pop();let n=class extends l.CompositionNode{constructor(){super({},e)}};return n=N([YL(qL(this._marks))],n),[e,n]}));for(const a of Object.values(this._compositions))YL(qL(this._compositions))(a);for(const o of e){const s=o.split(".").pop();this[s]=function(){var t=this._compositions[s];return this.type=null,this.append(t)}}}_reset(){const e=["theme","type","width","height","autoFit"];this.type="view",this.value=Object.fromEntries(Object.entries(this.value).filter(([t])=>t.startsWith("margin")||t.startsWith("padding")||t.startsWith("inset")||e.includes(t))),this.children=[]}_renderTrailing(){this._trailing&&(this._trailing=!1,this.render().then(()=>{var t=this._trailingResolve.bind(this);this._trailingResolve=null,t(this)}).catch(t=>{var e=this._trailingReject.bind(this);this._trailingReject=null,e(t)}))}_createResolve(t){return()=>{this._rendering=!1,t(this)}}_createReject(e){return t=>{this._rendering=!1,e(t)}}_computedOptions(){var t=this.options(),{key:e="G2_CHART_KEY"}=t,{width:n,height:r}=jL(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})}_createCanvas(){var{width:t,height:e}=jL(this.options(),this._container);this._plugins.push(new ld),this._plugins.forEach(t=>this._renderer.registerPlugin(t)),this._context.canvas=new su({container:this._container,width:t,height:e,renderer:this._renderer})}_addToTrailing(){null!=(t=this._trailingResolve)&&t.call(this,this),this._trailing=!0;var t=new Promise((t,e)=>{this._trailingResolve=t,this._trailingReject=e});return t}_bindAutoFit(){var t=this.options()["autoFit"];this._hasBindAutoFit?t||this._unbindAutoFit():t&&(this._hasBindAutoFit=!0,window.addEventListener("resize",this._onResize))}_unbindAutoFit(){this._hasBindAutoFit&&(this._hasBindAutoFit=!1,window.removeEventListener("resize",this._onResize))}}am=TL($L,PL);E.enableCSSParsing=!1,l.AREA_CLASS_NAME=kh,l.Area=V5,l.Box=U5,l.Boxplot=WS,l.COMPONENT_CLASS_NAME=Mh,l.Cell=H5,l.Chart=am,l.ChartEvent=pp,l.Connector=Q5,l.Density=y4,l.ELEMENT_CLASS_NAME=bh,l.ForceGraph=j3,l.Gauge=g4,l.Heatmap=m4,l.Image=q5,l.Interval=I5,l.LABEL_CLASS_NAME=Oh,l.LABEL_LAYER_CLASS_NAME=vh,l.Line=z5,l.LineX=Z5,l.LineY=K5,l.Link=Y5,l.MAIN_LAYER_CLASS_NAME=mh,l.PLOT_CLASS_NAME=wh,l.Pack=LS,l.Path=ES,l.Point=W5,l.Polygon=$5,l.Range=eS,l.RangeX=nS,l.RangeY=rS,l.Rect=B5,l.Runtime=$L,l.Sankey=kS,l.Shape=GS,l.Text=G5,l.Tree=G3,l.Treemap=TS,l.VIEW_CLASS_NAME=xh,l.Vector=X5,l.WordCloud=h4,l.corelib=AL,l.extend=TL,l.litelib=function(){return{"data.inline":lA,"coordinate.cartesian":Lp,"encode.constant":Jv,"encode.field":eb,"encode.transform":tb,"encode.column":nb,"mark.interval":I5,"shape.label.label":T5,"palette.category10":v4,"palette.category20":b4,"scale.linear":w4,"scale.ordinal":M4,"scale.band":x4,"scale.identity":O4,"scale.point":k4,"scale.time":E4,"scale.log":S4,"scale.pow":A4,"scale.sqrt":C4,"scale.threshold":_4,"scale.quantile":T4,"scale.quantize":P4,"scale.sequential":L4,"scale.constant":N4,"theme.classic":I4,"component.axisX":a_,"component.axisY":o_,"component.axisRadar":s_,"component.axisLinear":r_,"component.axisArc":i_,"component.legendCategory":u_,"component.legendContinuous":g_,"component.legendContinuousBlock":y_,"component.legendContinuousBlockSize":v_,"component.legendContinuousSize":m_,"component.legends":N_,"component.title":w_,"component.sliderX":__,"component.sliderY":T_,"component.scrollbarX":C_,"component.scrollbarY":L_,"animation.scaleInX":j_,"animation.scaleOutX":R_,"animation.scaleInY":I_,"animation.scaleOutY":B_,"animation.waveIn":X_,"animation.fadeIn":D_,"animation.fadeOut":F_,"animation.morphing":U_,"interaction.tooltip":KT,"interaction.legendFilter":l6,"interaction.legendHighlight":c6,"interaction.sliderFilter":j6,"interaction.scrollbarFilter":I6,"interaction.poptip":F6,"interaction.event":jT,"composition.mark":q6,"composition.view":Y6}},l.register=function(t,e){Object.assign(PL,{[t]:e})},l.render=Zv,l.renderToMountedElement=function(t,e={},n=()=>{},r=t=>{throw t}){var{width:i=640,height:a=480}=t,t=Kv(t);const{group:o=new fc,emitter:s=new ud,library:l}=e;null!==o&&void 0!==o&&o.parentElement||ap("renderToMountedElement can't render chart to unmounted group.");var c=lt(o);return e.group=o,(e.emitter=s).emit(pp.BEFORE_RENDER),Lv(Object.assign(Object.assign({},t),{width:i,height:a}),c,l,e).then(()=>{o.ownerDocument.defaultView.requestAnimationFrame(()=>{s.emit(pp.AFTER_RENDER),null!=n&&n()})}).catch(t=>{null!=r&&r(t)}),o},l.stdlib=_L,Object.defineProperty(l,"__esModule",{value:!0})});
10
+ `,y.style.x=t,y.style.y=e,y.style.width=n-t,y.style.height=r-e},S={"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"}},A=t=>T(t)||_(t),_=t=>{t=t.id;return-1!==h.indexOf(t)&&new Set(Object.keys(S)).has(t)},T=t=>t===y.getElementById("selection"),P=t=>{var e=t["target"],[t,n]=hT(l,t);y&&A(e)?A(e)&&(g=[t,n]):(O(t,n),v=!0)},C=t=>{var e,n,r,i,a,o,s=t["target"],t=hT(l,t);if(d)return g?T(s)?(e=(t,e,n,r,i)=>t+e<r?r-e:i<t+n?i-n:t,r=(n=t)[0]-g[0],n=n[1]-g[1],r=e(r,d[0],p[0],b,w),e=e(n,d[1],p[1],x,M),n=[d[0]+r,d[1]+e],r=[p[0]+r,p[1]+e],void E(n,r)):([e,n]=[t[0]-g[0],t[1]-g[1]],r=s["id"],S[r]?([s,i,a,o]=S[r].vector,E([d[0]+e*s,d[1]+n*i],[p[0]+e*a,p[1]+n*o])):void 0):E(d,t)},L=t=>{var e,n,r,i;g?(g=null,{x:e,y:r,width:n,height:i}=y.style,d=[e,r],p=[e+n,r+i]):(p=hT(l,t),[e,n,r,i]=E(d,p),v=!1,o(e,n,r,i,t))},N=t=>{t=t.target;y&&!A(t)&&k()},j=t=>{t=t.target;y&&A(t)&&!v?T(t)?wT(l,"move"):_(t)&&wT(l,S[t.id].cursor):wT(l,"crosshair")},R=()=>{wT(l,"default")};return l.addEventListener("dragstart",P),l.addEventListener("drag",C),l.addEventListener("dragend",L),l.addEventListener("click",N),l.addEventListener("pointermove",j),l.addEventListener("pointerleave",R),{mask:y,move(t,e,n,r,i=!0){y||O(t,e),d=[t,e],p=[n,r],E([t,e],[n,r],i)},remove(t=!0){y&&k(t)},destroy(){y&&k(!1),wT(l,"default"),l.removeEventListener("dragstart",P),l.removeEventListener("drag",C),l.removeEventListener("dragend",L),l.removeEventListener("click",N),l.removeEventListener("pointermove",j),l.removeEventListener("pointerleave",R)}}}function g6(e,t,n){return t.filter(t=>{return t!==e&&({interaction:t={}}=t.options,Object.values(t).find(t=>t.brushKey===n))})}function y6(t,e){var{elements:n,selectedHandles:r,siblings:i=t=>[],datum:a,brushRegion:o,extent:s,reverse:l,scale:c,coordinate:u,series:h=!1,key:d=t=>t,bboxOf:f=t=>{var{x:t,y:e,width:n,height:r}=t.style;return{x:t,y:e,width:n,height:r}},state:p={},emitter:g}=e,e=at(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const y=n(t),m=i(t),v=m.flatMap(n);i=mT(y,a),n=st(e,"mask");const{setState:b,removeState:x}=gT(p,i),w=new Map,{width:M,height:O,x:k=0,y:E=0}=f(t);a=s||[0,0,M,O];const S=()=>{for(const t of[...y,...v])x(t,"active","inactive")},A=(t,e,n,r)=>{var i;for(const u of m)null!=(i=u.brush)&&i.remove();var a=new Set;for(const h of y){var{min:o,max:s}=h.getLocalBounds(),[o,l]=o,[s,c]=s;!function(t,e){var[t,n,r,i]=t,[e,a,o,s]=e;return!(r<e||o<t||i<a||s<n)}([o,l,s,c],[t,e,n,r])?b(h,"inactive"):(b(h,"active"),a.add(d(h)))}for(const f of v)a.has(d(f))?b(f,"active"):b(f,"inactive")},_=()=>{for(const t of y)x(t,"inactive");for(const e of w.values())e.remove();w.clear()},T=(t,e,n,r)=>{var i;for(const o of y){var a=w.get(o)||(a=o,i=void 0,(i=a.cloneNode()).__data__=a.__data__,a.parentNode.appendChild(i),w.set(a,i),i);a.style.clipPath=new Nc({style:{x:t+k,y:e+E,width:n-t,height:r-e}}),b(o,"inactive"),b(a,"active")}},P=p6(t,Object.assign(Object.assign({},n),{extent:a,brushRegion:o,reverse:l,selectedHandles:r,brushended:t=>{var e=h?_:S;t&&g.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{var a=S_(t,e,n,r,c,u);i&&g.emit("brush:highlight",{nativeEvent:!0,data:{selection:a}}),(h?T:A)(t,e,n,r)}})),C=({nativeEvent:t,data:e})=>{var n,r;t||(t=e["selection"],[e,t,n,r]=function(t,e,n){var{x:e,y:r}=e,[t,i]=t,t=A_(t,e),e=A_(i,r),i=[t[0],e[0]],r=[t[1],e[1]],[t,e]=n.map(i),[i,n]=n.map(r);return[t,e,i,n]}(t,c,u),P.move(e,t,n,r,!1))},L=(g.on("brush:highlight",C),({nativeEvent:t}={})=>{t||P.remove(!1)}),N=(g.on("brush:remove",L),P.destroy.bind(P));return P.destroy=()=>{g.off("brush:highlight",C),g.off("brush:remove",L),N()},P}function m6(t){var{facet:g,brushKey:y}=t,m=at(t,["facet","brushKey"]);return(t,e,n)=>{var r,i,a,o,{container:s,view:l,options:c}=t,s=cT(s),u={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",reverse:!1},h=["active",["inactive",{opacity:.5}]],{scale:f,coordinate:d}=l;if(g)return r=(o=s.getBounds()).min[0],i=o.min[1],a=o.max[0],o=o.max[1],y6(s.parentNode.parentNode,Object.assign(Object.assign({elements:()=>sT(t,e),datum:pT(lT(t,e).map(t=>t.view)),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[r,i,a,o],state:yT(lT(t,e).map(t=>t.options),h),emitter:n,scale:f,coordinate:d,selectedHandles:void 0},u),m));const p=y6(s,Object.assign(Object.assign({elements:oT,key:t=>t.__data__.key,siblings:()=>{return g6(t,e,y).map(t=>cT(t.container))},datum:pT([l,...g6(t,e,y).map(t=>t.view)]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:yT([c,...g6(t,e,y).map(t=>t.options)],h),emitter:n,scale:f,coordinate:d,selectedHandles:void 0},u),m));return s.brush=p,()=>p.destroy()}}function v6(t,e,n,r,i){var[,i,,a]=i;return[t,i,n,a]}function b6(t){return m6(Object.assign(Object.assign({},t),{brushRegion:v6,selectedHandles:["handle-e","handle-w"]}))}function x6(t,e,n,r,i){var[i,,a]=i;return[i,e,a,r]}function w6(t){return m6(Object.assign(Object.assign({},t),{brushRegion:x6,selectedHandles:["handle-n","handle-s"]}))}const M6="axis-hot-area";function O6(t){return t.getElementsByClassName("axis")}function k6(t){return t.getElementsByClassName("axis-line")[0]}function E6(t){return t.getElementsByClassName("axis-main-group")[0].getLocalBounds()}function S6(t,e){var{cross:n,offsetX:i}=e,e=at(e,["cross","offsetX","offsetY"]),r=E6(t),[t]=k6(t).getLocalBounds().min;const[a,o]=r.min,[s,l]=r.max;r=2*(s-a);return{brushRegion:x6,hotZone:new Nc({className:M6,style:Object.assign({x:n?a:t-r/2,width:n?r/2:r,y:o,height:l-o},e)}),extent:n?(t,e,n,r)=>[-1/0,e,1/0,r]:(t,e,n,r)=>[Math.floor(a-i),e,Math.ceil(s-i),r]}}function A6(t,e){var{offsetY:i,cross:n=!1}=e,e=at(e,["offsetY","offsetX","cross"]),r=E6(t),[,t]=k6(t).getLocalBounds().min;const[a,o]=r.min,[s,l]=r.max;r=l-o;return{brushRegion:v6,hotZone:new Nc({className:M6,style:Object.assign({x:a,width:s-a,y:n?o:t-r,height:n?r:2*r},e)}),extent:n?(t,e,n,r)=>[t,-1/0,n,1/0]:(t,e,n,r)=>[t,Math.floor(o-i),n,Math.ceil(l-i)]}}function _6(t,e){var{axes:n,elements:r,points:i,horizontal:s,datum:a,offsetY:o,offsetX:l,reverse:c=!1,state:u={},emitter:h,coordinate:f}=e,e=at(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const d=r(t),p=n(t),{setState:g,removeState:y}=gT(u,mT(d,a)),m=new Map;var v=st(e,"mask");const b=p.map(t=>t.attributes.scale),x=t=>2<t.length?[t[0],t[t.length-1]]:t,w=new Map,M=()=>{w.clear();for(let t=0;t<p.length;t++){var e=b[t].getOptions()["domain"];w.set(t,x(e))}},O=(M(),(t,e)=>{var n=[];for(const r of d)(t=>Array.from(m.values()).every(([n,r,i,a])=>t.some(([t,e])=>n<=t&&t<=i&&r<=e&&e<=a)))(i(r))?(g(r,"active"),n.push(r)):g(r,"inactive");w.set(t,((t,e)=>{const n=b[e],{name:r}=n.getOptions(),i=t.map(t=>{const e=t.__data__;return n.invert(e[r])});return x(E_(n,i))})(n,t)),e&&h.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!k)return Array.from(w.values());var t,e,n=[];for([t,e]of w){var r=b[t].getOptions()["name"];"x"===r?n[0]=e:n[1]=e}return n})()}})}),k=p.some(s)&&p.some(t=>!s(t)),E=[];for(let a=0;a<p.length;a++){const P=p[a];const{hotZone:C,brushRegion:L,extent:N}=(s(P)?A6:S6)(P,{offsetY:o,offsetX:l,cross:k,zIndex:999,fill:"transparent"});P.parentNode.appendChild(C);var S=p6(C,Object.assign(Object.assign({},v),{reverse:c,brushRegion:L,brushended(t){if(m.delete(P),0===Array.from(m.entries()).length){var e=t;for(const n of d)y(n,"active","inactive");M(),e&&h.emit("brushAxis:remove",{nativeEvent:!0})}else O(a,t)},brushed(t,e,n,r,i){m.set(P,N(t,e,n,r)),O(a,i)}}));E.push(S)}const A=(t={})=>{t=t.nativeEvent;t||E.forEach(t=>t.remove(!1))},_=(t,e,n)=>{var{height:r,width:i}=f.getOptions(),e=e.clone();return s(n)?e.update({range:[0,i]}):e.update({range:[r,0]}),e.map(t)},T=t=>{var e=t["nativeEvent"];if(!e){var n=t.data["selection"];for(let t=0;t<E.length;t++){var r,i=n[t],a=E[t],o=p[t];i?(r=b[t],a.move(...((t,e,n)=>{var[t,r]=t,t=_(t,e,n),e=_(r,e,n)+((r=e).getStep?r.getStep():0);return s(n)?[t,-1/0,e,1/0]:[-1/0,t,1/0,e]})(i,r,o),!1)):a.remove(!1)}}};return h.on("brushAxis:remove",A),h.on("brushAxis:highlight",T),()=>{E.forEach(t=>t.destroy()),h.off("brushAxis:remove",A),h.off("brushAxis:highlight",T)}}function T6(l){return(t,e,n)=>{var{container:t,view:r,options:i}=t,{x:a,y:o}=cT(t).getBBox(),s=r["coordinate"];return _6(t,Object.assign({elements:oT,axes:O6,offsetY:o,offsetX:a,points:t=>t.__data__.points,horizontal:t=>{var{startPos:[t,e],endPos:[n,r]}=t.attributes;return t!==n&&e===r},datum:pT(r),state:yT(i,["active",["inactive",{opacity:.5}]]),coordinate:s,emitter:n},l))}}function P6(t,e){var{filter:a,reset:n,brushRegion:r,extent:i,reverse:o,emitter:s,selection:l}=e,e=st(at(e,["filter","reset","brushRegion","extent","reverse","emitter","scale","coordinate","selection","series"]),"mask"),{width:c,height:u}=t.getBBox(),i=i||[0,0,c,u];const h=function(e=300){let n=null;return t=>{t=t.timeStamp;return null!==n&&t-n<e?(n=t,!0):(n=t,!1)}}(),f=p6(t,Object.assign(Object.assign({},e),{extent:i,brushRegion:r,reverse:o,brushcreated:function(t,e,n,r,i){i.nativeEvent=!0,a(l(t,e,n,r),i),f.remove()}}));function d(t){h(t)&&(t.nativeEvent=!0,n(t))}t.addEventListener("click",d);const p=({nativeEvent:t,data:e})=>{t||(t=e["selection"],a(t,{nativeEvent:!1}))};return s.on("brush:filter",p),()=>{f.destroy(),s.off("brush:filter",p),t.removeEventListener("click",d)}}function C6(t){var{hideX:d=!0,hideY:p=!0}=t,g=at(t,["hideX","hideY"]);return(t,e,a)=>{const{container:n,view:r,options:o,update:s,setState:l}=t;t=cT(n);let c=!1,u=!1,h=r;var{scale:i,coordinate:f}=r;return P6(t,Object.assign(Object.assign({brushRegion:(t,e,n,r)=>[t,e,n,r],selection:(t,e,n,r)=>{var{scale:i,coordinate:a}=h;return S_(t,e,n,r,i,a)},filter:(r,i)=>X(this,void 0,void 0,function*(){if(!u){u=!0;const[e,n]=r;l("brushFilter",t=>{t=t.marks,t=t.map(t=>ot({axis:Object.assign(Object.assign({},d&&{x:{transform:[{type:"hide"}]}}),p&&{y:{transform:[{type:"hide"}]}})},t,{scale:{x:{domain:e,nice:!1},y:{domain:n,nice:!1}}}));return Object.assign(Object.assign({},o),{marks:t,clip:!0})}),a.emit("brush:filter",Object.assign(Object.assign({},i),{data:{selection:[e,n]}}));var t=yield s();h=t.view,u=!1,c=!0}}),reset:t=>{var e,n;!u&&c&&(e=r["scale"],{x:e,y:n}=e,e=e.getOptions().domain,n=n.getOptions().domain,a.emit("brush:filter",Object.assign(Object.assign({},t),{data:{selection:[e,n]}})),c=!1,h=r,l("brushFilter"),s())},extent:void 0,emitter:a,scale:i,coordinate:f},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),g))}}function L6(t){return C6(Object.assign(Object.assign({hideX:!0},t),{brushRegion:v6}))}function N6(t){return C6(Object.assign(Object.assign({hideY:!0},t),{brushRegion:x6}))}const j6="slider";function R6(t){return[t[0],t[t.length-1]]}function I6({channelDomain:C,className:L=j6,prefix:N="slider",setValue:j=(t,e)=>t.setValues(e),hasState:R=!1,wait:I=50,leading:B=!0,trailing:D=!1}){return(t,e,i)=>{const{container:n,view:r,update:s,setState:l}=t;t=n.getElementsByClassName(L);if(!t.length)return()=>{};let c=!1;const{scale:a,coordinate:o,layout:u}=r,{paddingLeft:h,paddingTop:f,paddingBottom:d,paddingRight:p}=u,{x:g,y}=a,m=rv(o);const v=new Map,b=new Set;C=C||{x:g.getOptions().domain,y:y.getOptions().domain};for(const M of t){const O=M.attributes["orientation"],[k,E]=(w=O,x=void 0,x="vertical"===w?"y":"x",w="vertical"===w?"x":"y",m?[w,x]:[x,w]),S=""+N+Ue(k)+":filter",A="x"===k,_=g.getOptions()["ratio"],T=y.getOptions()["ratio"],P=t=>{var e,n;return t.data?(e=t.data["selection"],[e=R6(C.x),n=R6(C.y)]=e,A?[E_(g,e,_),E_(y,n,T)]:[E_(y,n,T),E_(g,e,_)]):(n=t.detail["value"],[function(t,e,n){var[t,r]=t;return E_(e,[k_(e,(n=n?t=>1-t:t=>t)(t),!0),k_(e,n(r),!1)])}(n,a[k],m&&"horizontal"===O),C[E]])};var x=ln(r=>X(this,void 0,void 0,function*(){if(!c){c=!0;var t,e,{nativeEvent:n=!0}=r;const[a,o]=P(r);C[k]=a,C[E]=o,n&&(t=A?a:o,e=A?o:a,i.emit(S,Object.assign(Object.assign({},r),{nativeEvent:n,data:{selection:[R6(t),R6(e)]}}))),l(M,t=>{return Object.assign(Object.assign({},([t,n,r,i=!1]=[t,{[k]:{domain:a,nice:!1},[E]:{domain:o,nice:!1}},N,R],e=(e=t["marks"]).map(t=>{var e;return ot({axis:{x:{transform:[{type:"hide"}]},y:{transform:[{type:"hide"}]}}},t,{scale:n,[r]:Object.assign(Object.assign({},(null==(e=t[r])?void 0:e.x)&&{x:Object.assign({preserve:!0},i&&{ratio:null})}),(null==(e=t[r])?void 0:e.y)&&{y:Object.assign({preserve:!0},i&&{ratio:null})}),animate:!1})}),Object.assign(Object.assign({},t),{marks:e,clip:!0,animate:!1}))),{paddingLeft:h,paddingTop:f,paddingBottom:d,paddingRight:p});var n,r,i,e}),yield s(),c=!1}}),I,{leading:B,trailing:D}),w=t=>{var e,n=t["nativeEvent"];n||(n=t["data"],t=n["selection"],[t,e]=t,M.dispatchEvent(new gl("valuechange",{data:n,nativeEvent:!1})),n=A?A_(t,g):A_(e,y),j(M,n))};i.on(S,w),M.addEventListener("valuechange",x),v.set(M,x),b.add([S,w])}return()=>{for(var[t,e]of v)t.removeEventListener("valuechange",e);for(var[n,r]of b)i.off(n,r)}}}const B6="g2-scrollbar";function D6(o={}){return(t,e,n)=>{var r,{view:i,container:a}=t;return a.getElementsByClassName(B6).length?(a=i["scale"],{x:i,y:a}=a,r={x:i.getOptions().domain,y:a.getOptions().domain},i.update({domain:i.getOptions().expectedDomain}),a.update({domain:a.getOptions().expectedDomain}),I6(Object.assign(Object.assign({},o),{channelDomain:r,className:B6,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0])}))(t,e,n)):()=>{}}}const F6={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 z6(t){return"text"===t.nodeName&&!!t.isOverflowing()}function W6(t){var{offsetX:f=8,offsetY:d=8}=t,r=at(t,["offsetX","offsetY"]);return t=>{const s=t["container"],[l,c]=s.getBounds().min,u=st(r,"tip"),h=new Set,e=t=>{var e,n,r,i,a,o=t["target"];z6(o)?({offsetX:e,offsetY:n}=t,e=e+f-l,n=n+d-c,o.tip?(o.tip.style.x=e,o.tip.style.y=n):(i=o.style["text"],a=new gc({className:"poptip",style:{innerHTML:(r="div",i=i,a=Object.assign(Object.assign({},F6),u),`<${r} style="${Object.entries(a).map(([t,e])=>t.replace(/([A-Z])/g,"-$1").toLowerCase()+":"+e).join(";")}">${i}</${r}>`),x:e,y:n}}),s.appendChild(a),o.tip=a,h.add(a))):t.stopPropagation()},n=t=>{var e=t["target"];z6(e)?e.tip&&(e.tip.remove(),e.tip=null,h.delete(e.tip)):t.stopPropagation()};return s.addEventListener("pointerover",e),s.addEventListener("pointerout",n),()=>{s.removeEventListener("pointerover",e),s.removeEventListener("pointerout",n),h.forEach(t=>t.remove())}}}function G6(n){return(t,...e)=>ot({},n(t,...e),t)}function H6(n){return(t,...e)=>ot({},t,n(t,...e))}function V6(t,e){var n;return t?Array.isArray(t)?t:({value:n=e}=t,t=at(t,["value"]),Object.assign(Object.assign({},t),{value:n})):e}const Y6=()=>t=>{var e=t["children"];if(!Array.isArray(e))return[];const{x:o=0,y:s=0,width:l,height:c,data:u}=t;return e.map(t=>{var{data:e,x:n,y:r,width:i,height:a}=t,t=at(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},t),{data:V6(e,u),x:null!=n?n:o,y:null!=r?r:s,width:null!=i?i:l,height:null!=a?a:c})})},q6=(Y6.props={},()=>e=>{var n=e["children"];if(!Array.isArray(n))return[];var{direction:t="row",ratio:r=n.map(()=>1),padding:i=0,data:a}=e,[o,s,l,c]="col"===t?["y","height","width","x"]:["x","width","height","y"];const u=r.reduce((t,e)=>t+e),h=e[s]-i*(n.length-1);var f=r.map(t=>h*(t/u)),d=[];let p=e[o]||0;for(let t=0;t<f.length;t+=1){var g=n[t],y=g["data"],g=at(g,["data"]),y=V6(y,a);d.push(Object.assign({[o]:p,[s]:f[t],[c]:e[c]||0,[l]:e[l],data:y},g)),p+=f[t]+i}return d}),$6=(q6.props={},()=>t=>{var e=t["children"],t=at(t,["children"]);if(!Array.isArray(e))return[];const{data:s,scale:l={},axis:c={},legend:u={},encode:h={},transform:f=[]}=t,n=at(t,["data","scale","axis","legend","encode","transform"]);t=e.map(t=>{var{data:e,scale:n={},axis:r={},legend:i={},encode:a={},transform:o=[]}=t,t=at(t,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:V6(e,s),scale:ot({},l,n),encode:ot({},h,a),transform:[...f,...o],axis:!(!r||!c)&&ot({},c,r),legend:!(!i||!u)&&ot({},u,i)},t)});return[Object.assign(Object.assign({},n),{marks:t,type:"standardView"})]}),U6=($6.props={},({static:L=!1}={})=>t=>{var{width:e,height:n,paddingLeft:r,paddingRight:i,paddingTop:a,paddingBottom:o,padding:s,inset:l,insetLeft:c,insetTop:u,insetRight:h,insetBottom:f,margin:d,marginLeft:p,marginBottom:g,marginTop:y,marginRight:m,data:v,coordinate:b,theme:x,component:w,interaction:M,x:O,y:k,key:E,frame:S,labelTransform:A,parentKey:_,clip:T,viewStyle:P,title:C}=t,t=at(t,["width","height","paddingLeft","paddingRight","paddingTop","paddingBottom","padding","inset","insetLeft","insetTop","insetRight","insetBottom","margin","marginLeft","marginBottom","marginTop","marginRight","data","coordinate","theme","component","interaction","x","y","key","frame","labelTransform","parentKey","clip","viewStyle","title"]);return[Object.assign(Object.assign({type:"standardView",x:O,y:k,key:E,width:e,height:n,padding:s,paddingLeft:r,paddingRight:i,paddingTop:a,inset:l,insetLeft:c,insetTop:u,insetRight:h,insetBottom:f,paddingBottom:o,theme:x,coordinate:b,component:w,interaction:M,frame:S,labelTransform:A,margin:d,marginLeft:p,marginBottom:g,marginTop:y,marginRight:m,parentKey:_,clip:T,style:P},!L&&{title:C}),{marks:[Object.assign(Object.assign(Object.assign({},t),{key:E+"-0",data:v}),L&&{title:C})]})]});U6.props={};class X6{constructor(t){this.$value=t}static of(t){return new X6(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const K6=G6(t=>{const{encode:e,data:i,scale:a,shareSize:o=!1}=t;var{x:t,y:n}=e,r=(e,t)=>{if(void 0===e||!o)return{};const n=Sd(i,t=>t[e]);var t=(null==(t=null===a||void 0===a?void 0:a[t])?void 0:t.domain)||Array.from(n.keys()),r=t.map(t=>n.has(t)?n.get(t).length:1);return{domain:t,flex:r}};return{scale:{x:Object.assign(Object.assign({paddingOuter:0,paddingInner:.1,guide:void 0===t?null:{position:"top"}},void 0===t&&{paddingInner:0}),r(t,"x")),y:Object.assign(Object.assign({range:[0,1],paddingOuter:0,paddingInner:.1,guide:void 0===n?null:{position:"right"}},void 0===n&&{paddingInner:0}),r(n,"y"))}}}),Z6=G6(t=>{const{data:e,scale:n}=t;var r=[t];let i,a,o;for(;r.length;){const{children:f,encode:d={},scale:n={},legend:p={}}=r.shift();var s=d["color"],l=n["color"],c=p["color"];void 0!==s&&(i=s),void 0!==l&&(a=l),void 0!==c&&(o=c),Array.isArray(f)&&r.push(...f)}var t="string"==typeof i?i:"",[u,h]=void 0!==(u=null==(u=null===n||void 0===n?void 0:n.color)?void 0:u.domain)?[u]:void 0===i?[void 0]:(u="function"==typeof i?i:t=>t[i],(u=e.map(u)).some(t=>"number"==typeof t)?[wd(u)]:[Array.from(new Set(u)),"ordinal"]);return{encode:{color:i},scale:{color:ot({},a,{domain:u,type:h})},legend:{color:ot({title:t},o)}}}),Q6=G6(()=>({animate:{enterType:"fadeIn"}})),J6=H6(()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}})),tP=H6(()=>({type:"cell"})),eP=H6(c=>{var t=c["data"];return{data:{type:"inline",value:t,transform:[{type:"custom",callback:()=>{var{data:t,encode:e}=c;const{x:n,y:r}=e,i=n?Array.from(new Set(t.map(t=>t[n]))):[],a=r?Array.from(new Set(t.map(t=>t[r]))):[];if(i.length&&a.length){var o=[];for(const s of i)for(const l of a)o.push({[n]:s,[r]:l});return o}return i.length?i.map(t=>({[n]:t})):a.length?a.map(t=>({[r]:t})):void 0}}]}}}),nP=H6((t,c=function(t){t=t.points;return h2(t)},w=function(a){return(t,e)=>{var{rowIndex:t,rowValuesLength:n,columnIndex:r,columnValuesLength:i}=t;return t!==n-1?rP(a,e):(t=e.length?void 0:null,ot({title:r===i-1&&void 0,grid:t},a))}},M=function(r){return(t,e)=>{var{rowIndex:t,columnIndex:n}=t;return 0!==n?rP(r,e):(n=e.length?void 0:null,ot({title:0===t&&void 0,grid:n},r))}},O={})=>{const{data:e,encode:n,children:u,scale:r,x:k=0,y:E=0,shareData:h=!1,key:S}=t,A=e["value"],{x:_,y:T}=n;t=r.color;const P=t["domain"];return{children:(t,e,n)=>{const{x:r,y:i}=e,{paddingLeft:y,paddingTop:m}=n,a=r.getOptions()["domain"],o=i.getOptions()["domain"];e=_p(t);const s=t.map(c);n=t.map(({x:t,y:e})=>[r.invert(t),i.invert(e)]);const l=n.map(([n,r])=>t=>{var{[_]:t,[T]:e}=t,t=void 0===_||t===n,e=void 0===T||e===r;return t&&e}).map(t=>A.filter(t)),v=h?Hd(l,t=>t.length):void 0,b=n.map(([t,e])=>({columnField:_,columnIndex:a.indexOf(t),columnValue:t,columnValuesLength:a.length,rowField:T,rowIndex:o.indexOf(e),rowValue:e,rowValuesLength:o.length})),x=b.map(t=>Array.isArray(u)?u:[u(t)].flat(1));return e.flatMap(c=>{const[u,h,f,d]=s[c],p=b[c],g=l[c];return x[c].map(t=>{var{scale:e,key:n,facet:r=!0,axis:i={}}=t,t=at(t,["scale","key","facet","axis","legend"]),a=(null==(a=null==e?void 0:e.y)?void 0:a.guide)||i.y,o=(null==(o=null==e?void 0:e.x)?void 0:o.guide)||i.x,s={x:{tickCount:_?5:void 0},y:{tickCount:T?5:void 0}},r=r?g:0===g.length?[]:A,l={color:{domain:P}},o={x:iP(o,w)(p,r),y:iP(a,M)(p,r)};return Object.assign(Object.assign({key:n+"-"+c,data:r,x:u+y+k,y:h+m+E,parentKey:S,width:f,height:d,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!r.length,dataDomain:v,scale:ot(s,e,l),axis:ot({},i,o),legend:!1},t),O)})})}}});function rP(t,e){return e.length?ot({title:!1,tick:null,label:null},t):ot({title:!1,tick:null,label:null,grid:null},t)}function iP(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const aP=()=>t=>{return[X6.of(t).call(tP).call(Z6).call(Q6).call(K6).call(J6).call(eP).call(nP).value()]},oP=(aP.props={},G6(t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),sP=H6(t=>{const{data:w,children:c,x:M=0,y:O=0,key:k}=t;return{children:(t,e,n)=>{const{x:r,y:i}=e,{paddingLeft:m,paddingTop:v}=n,a=r.getOptions()["domain"],o=i.getOptions()["domain"];e=_p(t);const s=t.map(({points:t})=>h2(t)),l=t.map(({x:t,y:e})=>[r.invert(t),i.invert(e)]),b=l.map(([t,e])=>({columnField:t,columnIndex:a.indexOf(t),columnValue:t,columnValuesLength:a.length,rowField:e,rowIndex:o.indexOf(e),rowValue:e,rowValuesLength:o.length})),x=b.map(t=>Array.isArray(c)?c:[c(t)].flat(1));return e.flatMap(c=>{const[u,h,f,d]=s[c],[p,g]=l[c],y=b[c];return x[c].map(t=>{var n,r,{scale:e,key:i,encode:a,axis:o}=t,t=at(t,["scale","key","encode","axis"]),s=null==(s=null==e?void 0:e.y)?void 0:s.guide,l=null==(l=null==e?void 0:e.x)?void 0:l.guide,l={x:("function"==typeof(r=l)?r:null===r?()=>null:(t,e)=>{var{rowIndex:t,rowValuesLength:n}=t;if(t!==n-1)return rP(r,e)})(y,w),y:("function"==typeof(n=s)?n:null===n?()=>null:(t,e)=>{t=t.columnIndex;if(0!==t)return rP(n,e)})(y,w)};return Object.assign({data:w,parentKey:k,key:i+"-"+c,x:u+m+M,y:h+v+O,width:f,height:d,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:ot({x:{facet:!1},y:{facet:!1}},e),axis:ot({x:{tickCount:5},y:{tickCount:5}},o,l),legend:!1,encode:ot({},a,{x:p,y:g})},t)})})}}}),lP=H6(t=>{var e=t["encode"],t=at(t,["encode"]),{position:n=[],x:r=n,y:i=[...n].reverse()}=e,n=at(e,["position","x","y"]),a=[];for(const o of[r].flat(1))for(const s of[i].flat(1))a.push({$x:o,$y:s});return Object.assign(Object.assign({},t),{data:a,encode:Object.assign(Object.assign({},n),{x:"$x",y:"$y"}),scale:Object.assign(Object.assign({},1===[r].flat(1).length&&{x:{paddingInner:0}}),1===[i].flat(1).length&&{y:{paddingInner:0}})})});const cP=()=>t=>{return[X6.of(t).call(tP).call(Z6).call(sP).call(lP).call(Q6).call(J6).call(oP).value()]},uP=G6(t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}})),hP=G6(t=>({coordinate:{type:"polar"}})),fP=t=>{var e=t["encode"],t=at(t,["encode"]),e=e["position"];return Object.assign(Object.assign({},t),{encode:{x:e}})};function dP(t){return t=>null}function pP(t){var t=t["points"],[t,e,n,r]=t,i=s2(t,r),t=a2(t,r),r=u2(t,a2(e,n)),e=1/Math.sin(r/2),i=i/(1+e),a=i*Math.sqrt(2),[n,o]=n,t=c2(t)+r/2,r=i*e;return[n+r*Math.sin(t)-a/2,o+r*Math.cos(t)-a/2,a,a]}const gP=()=>t=>{return[X6.of(t).call(tP).call(fP).call(Z6).call(hP).call(eP).call(nP,pP,dP,dP,{frame:!1}).call(Q6).call(J6).call(uP).value()]};const yP=()=>t=>{const{children:e=[],duration:a=1e3,iterationCount:l=1,direction:c="normal",easing:o="ease-in-out-sine"}=t,u=e.length;if(!Array.isArray(e)||0===u)return[];const n=e[0]["key"],h=e.map(t=>Object.assign(Object.assign({},t),{key:n})).map(t=>{for(var e=a,n=o,r=[t];r.length;){var i=r.pop(),i=(i.animate=ot({enter:{duration:e},update:{duration:e,easing:n,type:"morphing",fill:"both"},exit:{type:"fadeOut",duration:e}},i.animate||{}),i)["children"];Array.isArray(i)&&r.push(...i)}return t});return function*(){let t=0,e;for(;"infinite"===l||t<l;){n=c,a=t,o=u,s=void 0,s=[0,o],o=[1-o,1];var[n,r]="normal"===n?s:"reverse"===n?o:"alternate"===n?a%2==0?s:o:"reverse-alternate"===n?a%2==0?o:s:void 0;for(let t=n;t<r;t+=1){var i=Math.abs(t);e!==i&&(yield h[i]),e=i}t++}var a,o,s}},mP=(yP.props={},()=>t=>{var{data:e,scale:n,encode:r,style:i,animate:a,key:o,state:s}=t,t=at(t,["type","data","scale","encode","style","animate","key","state"]);return[Object.assign(Object.assign({type:"geoView"},t),{children:[{type:"geoPath",key:o+"-0",data:{value:e},scale:n,encode:r,style:i,animate:a,state:s}]})]});mP.props={};var C=1e-6,vP=1e-12,bP=Math.PI,xP=bP/2,wP=bP/4,MP=2*bP,OP=180/bP,kP=bP/180,EP=Math.abs,SP=Math.atan,AP=Math.atan2,A=Math.cos,_P=Math.ceil,TP=Math.exp,PP=Math.log,CP=Math.pow,_=Math.sin,LP=Math.sign||function(t){return 0<t?1:t<0?-1:0},NP=Math.sqrt,jP=Math.tan;function RP(t){return 1<t?0:t<-1?bP:Math.acos(t)}function IP(t){return 1<t?xP:t<-1?-xP:Math.asin(t)}function BP(){}function DP(t,e){t&&zP.hasOwnProperty(t.type)&&zP[t.type](t,e)}var FP={Feature:function(t,e){DP(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)DP(n[r].geometry,e)}},zP={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){WP(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)WP(n[r],e,0)},Polygon:function(t,e){GP(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)GP(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)DP(n[r],e)}};function WP(t,e,n){var r,i=-1,a=t.length-n;for(e.lineStart();++i<a;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function GP(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)WP(t[n],e,1);e.polygonEnd()}function HP(t,e){t&&FP.hasOwnProperty(t.type)?FP[t.type](t,e):DP(t,e)}function VP(t){return[AP(t[1],t[0]),IP(t[2])]}function YP(t){var e=t[0],t=t[1],n=A(t);return[n*A(e),n*_(e),_(t)]}function qP(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function $P(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function UP(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function XP(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function KP(t){var e=NP(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function ZP(n,r){function t(t,e){return t=n(t,e),r(t[0],t[1])}return n.invert&&r.invert&&(t.invert=function(t,e){return(t=r.invert(t,e))&&n.invert(t[0],t[1])}),t}function QP(t,e){return EP(t)>bP&&(t-=Math.round(t/MP)*MP),[t,e]}function JP(t,e,n){return(t%=MP)?e||n?ZP(e8(t),n8(e,n)):e8(t):e||n?n8(e,n):QP}function t8(n){return function(t,e){return EP(t+=n)>bP&&(t-=Math.round(t/MP)*MP),[t,e]}}function e8(t){var e=t8(t);return e.invert=t8(-t),e}function n8(t,e){var i=A(t),a=_(t),o=A(e),s=_(e);function n(t,e){var n=A(e),r=A(t)*n,t=_(t)*n,n=_(e),e=n*i+r*a;return[AP(t*o-e*s,r*i-n*a),IP(e*o+t*s)]}return n.invert=function(t,e){var n=A(e),r=A(t)*n,t=_(t)*n,n=_(e),e=n*o-t*s;return[AP(t*o+n*s,r*i+e*a),IP(e*i-r*a)]},n}function r8(t,e){(e=YP(e))[0]-=t,KP(e);t=RP(-e[1]);return((-e[2]<0?-t:t)+MP-C)%MP}function i8(){var r,e=[];return{point:function(t,e,n){r.push([t,e,n])},lineStart:function(){e.push(r=[])},lineEnd:BP,rejoin:function(){1<e.length&&e.push(e.pop().concat(e.shift()))},result:function(){var t=e;return e=[],r=null,t}}}function a8(t,e){return EP(t[0]-e[0])<C&&EP(t[1]-e[1])<C}function o8(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function s8(t,e,n,r,a){var o,i,s=[],l=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],i=t[e];if(a8(r,i)){if(!r[2]&&!i[2]){for(a.lineStart(),o=0;o<e;++o)a.point((r=t[o])[0],r[1]);return void a.lineEnd()}i[0]+=2*C}s.push(n=new o8(r,t,null,!0)),l.push(n.o=new o8(r,null,n,!1)),s.push(n=new o8(i,t,null,!1)),l.push(n.o=new o8(i,null,n,!0))}}),s.length){for(l.sort(e),l8(s),l8(l),o=0,i=l.length;o<i;++o)l[o].e=n=!n;for(var c,u,h=s[0];;){for(var f=h,d=!0;f.v;)if((f=f.n)===h)return;c=f.z,a.lineStart();do{if(f.v=f.o.v=!0,f.e){if(d)for(o=0,i=c.length;o<i;++o)a.point((u=c[o])[0],u[1]);else r(f.x,f.n.x,1,a);f=f.n}else{if(d)for(c=f.p.z,o=c.length-1;0<=o;--o)a.point((u=c[o])[0],u[1]);else r(f.x,f.p.x,-1,a);f=f.p}}while(c=(f=f.o).z,d=!d,!f.v);a.lineEnd()}}}function l8(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function c8(t){return EP(t[0])<=bP?t[0]:LP(t[0])*((EP(t[0])+bP)%MP-bP)}function u8(y,m,v,b){return function(s){var l,c,u,n=m(s),h=i8(),f=m(h),d=!1,e={point:r,lineStart:i,lineEnd:a,polygonStart:function(){e.point=p,e.lineStart=o,e.lineEnd=g,c=[],l=[]},polygonEnd:function(){e.point=r,e.lineStart=i,e.lineEnd=a,c=Jd(c);var t=function(t,e){var n=c8(e),r=e[1],e=_(r),i=[_(n),-A(n),0],a=0,o=0,s=new Md;1===e?r=xP+C:-1===e&&(r=-xP-C);for(var l=0,c=t.length;l<c;++l)if(h=(u=t[l]).length)for(var u,h,f=u[h-1],d=c8(f),p=f[1]/2+wP,g=_(p),y=A(p),m=0;m<h;++m,d=b,g=w,y=x,f=v){var v=u[m],b=c8(v),x=v[1]/2+wP,w=_(x),x=A(x),M=b-d,O=0<=M?1:-1,k=O*M,E=bP<k,S=g*w;s.add(AP(S*O*_(k),y*x+S*A(k))),a+=E?M+O*MP:M,E^n<=d^n<=b&&(KP(S=$P(YP(f),YP(v))),KP(k=$P(i,S)),(O=(E^0<=M?-1:1)*IP(k[2]))<r||r===O&&(S[0]||S[1]))&&(o+=E^0<=M?1:-1)}return(a<-C||a<C&&s<-vP)^1&o}(l,b);c.length?(d||(s.polygonStart(),d=!0),s8(c,f8,t,v,s)):t&&(d||(s.polygonStart(),d=!0),s.lineStart(),v(null,null,1,s),s.lineEnd()),d&&(s.polygonEnd(),d=!1),c=l=null},sphere:function(){s.polygonStart(),s.lineStart(),v(null,null,1,s),s.lineEnd(),s.polygonEnd()}};function r(t,e){y(t,e)&&s.point(t,e)}function t(t,e){n.point(t,e)}function i(){e.point=t,n.lineStart()}function a(){e.point=r,n.lineEnd()}function p(t,e){u.push([t,e]),f.point(t,e)}function o(){f.lineStart(),u=[]}function g(){p(u[0][0],u[0][1]),f.lineEnd();var t,e,n,r,i=f.clean(),a=h.result(),o=a.length;if(u.pop(),l.push(u),u=null,o)if(1&i){if(0<(e=(n=a[0]).length-1)){for(d||(s.polygonStart(),d=!0),s.lineStart(),t=0;t<e;++t)s.point((r=n[t])[0],r[1]);s.lineEnd()}}else 1<o&&2&i&&a.push(a.pop().concat(a.shift())),c.push(a.filter(h8))}return e}}function h8(t){return 1<t.length}function f8(t,e){return((t=t.x)[0]<0?t[1]-xP-C:xP-t[1])-((e=e.x)[0]<0?e[1]-xP-C:xP-e[1])}QP.invert=QP;var d8=u8(function(){return 1},function(c){var u,h=NaN,f=NaN,d=NaN;return{lineStart:function(){c.lineStart(),u=1},point:function(t,e){var n,r,i,a,o,s=0<t?bP:-bP,l=EP(t-h);EP(l-bP)<C?(c.point(h,f=0<(f+e)/2?xP:-xP),c.point(d,f),c.lineEnd(),c.lineStart(),c.point(s,f),c.point(t,f),u=0):d!==s&&bP<=l&&(EP(h-d)<C&&(h-=d*C),EP(t-s)<C&&(t-=s*C),l=f,i=e,o=_((n=h)-(r=t)),f=EP(o)>C?SP((_(l)*(a=A(i))*_(r)-_(i)*(r=A(l))*_(n))/(r*a*o)):(l+i)/2,c.point(d,f),c.lineEnd(),c.lineStart(),c.point(s,f),u=0),c.point(h=t,f=e),d=s},lineEnd:function(){c.lineEnd(),h=f=NaN},clean:function(){return 2-u}}},function(t,e,n,r){var i;null==t?(i=n*xP,r.point(-bP,i),r.point(0,i),r.point(bP,i),r.point(bP,0),r.point(bP,-i),r.point(0,-i),r.point(-bP,-i),r.point(-bP,0),r.point(-bP,i)):EP(t[0]-e[0])>C?(t=t[0]<e[0]?bP:-bP,i=n*t/2,r.point(-t,i),r.point(0,i),r.point(t,i)):r.point(e[0],e[1])},[-bP,-xP]);function p8(d){var g=A(d),p=6*kP,h=0<g,f=EP(g)>C;function y(t,e){return A(t)*A(e)>g}function m(t,e,n){var r,i,a,o,s,l,c,u=[1,0,0],h=$P(YP(t),YP(e)),f=qP(h,h),d=h[0],p=f-d*d;return p?(r=$P(u,h),UP(u=XP(u,g*f/p),XP(h,-g*d/p)),(p=(h=qP(u,f=r))*h-(d=qP(f,f))*(qP(u,u)-1))<0?void 0:(UP(p=XP(f,(-h-(r=NP(p)))/d),u),p=VP(p),n?(i=t[0],a=e[0],o=t[1],e=e[1],a<i&&(c=i,i=a,a=c),!(l=EP((s=a-i)-bP)<C)&&e<o&&(c=o,o=e,e=c),(l||s<C?l?0<o+e^p[1]<(EP(p[0]-i)<C?o:e):o<=p[1]&&p[1]<=e:bP<s^(i<=p[0]&&p[0]<=a))?(UP(c=XP(f,(-h+r)/d),u),[p,VP(c)]):void 0):p)):!n&&t}function v(t,e){var n=h?d:bP-d,r=0;return t<-n?r|=1:n<t&&(r|=2),e<-n?r|=4:n<e&&(r|=8),r}return u8(y,function(a){var o,s,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(t,e){var n,r=[t,e],i=y(t,e),t=h?i?0:v(t,e):i?v(t+(t<0?bP:-bP),e):0;!o&&(c=l=i)&&a.lineStart(),i===l||(n=m(o,r))&&!a8(o,n)&&!a8(r,n)||(r[2]=1),i!==l?(u=0,i?(a.lineStart(),n=m(r,o),a.point(n[0],n[1])):(n=m(o,r),a.point(n[0],n[1],2),a.lineEnd()),o=n):f&&o&&h^i&&(t&s||!(e=m(r,o,!0))||(u=0,h?(a.lineStart(),a.point(e[0][0],e[0][1]),a.point(e[1][0],e[1][1]),a.lineEnd()):(a.point(e[1][0],e[1][1]),a.lineEnd(),a.lineStart(),a.point(e[0][0],e[0][1],3)))),!i||o&&a8(o,r)||a.point(r[0],r[1]),o=r,l=i,s=t},lineEnd:function(){l&&a.lineEnd(),o=null},clean:function(){return u|(c&&l)<<1}}},function(t,e,n,r){var i=r,r=d,a=p,o=n,n=t,s=e;if(a){var l=A(r),c=_(r),u=o*a;null==n?(n=r+o*MP,s=r-u/2):(n=r8(l,n),s=r8(l,s),(0<o?n<s:s<n)&&(n+=o*MP));for(var h,f=n;0<o?s<f:f<s;f-=u)h=VP([l,-c*A(f),-c*_(f)]),i.point(h[0],h[1])}},h?[0,-d]:[-bP,d-bP])}var g8=1e9,y8=-g8;function m8(m,v,b,x){function w(t,e){return m<=t&&t<=b&&v<=e&&e<=x}function M(t,e,n,r){var i=0,a=0;if(null==t||(i=o(t,n))!==(a=o(e,n))||s(t,e)<0^0<n)for(;r.point(0===i||3===i?m:b,1<i?x:v),(i=(i+n+4)%4)!==a;);else r.point(e[0],e[1])}function o(t,e){return EP(t[0]-m)<C?0<e?0:3:EP(t[0]-b)<C?0<e?2:1:EP(t[1]-v)<C?0<e?1:0:0<e?3:2}function O(t,e){return s(t.x,e.x)}function s(t,e){var n=o(t,1),r=o(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(r){var i,h,a,o,s,l,c,u,f,d,p,g=r,t=i8(),e={point:n,lineStart:function(){e.point=y,h&&h.push(a=[]);d=!0,f=!1,c=u=NaN},lineEnd:function(){i&&(y(o,s),l&&f&&t.rejoin(),i.push(t.result()));e.point=n,f&&g.lineEnd()},polygonStart:function(){g=t,i=[],h=[],p=!0},polygonEnd:function(){var t=function(){for(var t=0,e=0,n=h.length;e<n;++e)for(var r,i,a=h[e],o=1,s=a.length,l=a[0],c=l[0],u=l[1];o<s;++o)r=c,i=u,l=a[o],c=l[0],u=l[1],i<=x?x<u&&(u-i)*(m-r)<(c-r)*(x-i)&&++t:u<=x&&(c-r)*(x-i)<(u-i)*(m-r)&&--t;return t}(),e=p&&t,n=(i=Jd(i)).length;(e||n)&&(r.polygonStart(),e&&(r.lineStart(),M(null,null,1,r),r.lineEnd()),n&&s8(i,O,t,M,r),r.polygonEnd());g=r,i=h=a=null}};function n(t,e){w(t,e)&&g.point(t,e)}function y(t,e){var n,r,i=w(t,e);h&&a.push([t,e]),d?(o=t,s=e,d=!1,(l=i)&&(g.lineStart(),g.point(t,e))):i&&f?g.point(t,e):!function(t,e,n,r,i,a){var o=t[0],s=t[1],l=0,c=1,u=e[0]-o,h=e[1]-s,n=n-o;if(u||!(0<n)){if(n/=u,u<0){if(n<l)return;n<c&&(c=n)}else if(0<u){if(c<n)return;l<n&&(l=n)}if(n=i-o,u||!(n<0)){if(n/=u,u<0){if(c<n)return;l<n&&(l=n)}else if(0<u){if(n<l)return;n<c&&(c=n)}if(n=r-s,h||!(0<n)){if(n/=h,h<0){if(n<l)return;n<c&&(c=n)}else if(0<h){if(c<n)return;l<n&&(l=n)}if(n=a-s,h||!(n<0)){if(n/=h,h<0){if(c<n)return;l<n&&(l=n)}else if(0<h){if(n<l)return;n<c&&(c=n)}return 0<l&&(t[0]=o+l*u,t[1]=s+l*h),c<1&&(e[0]=o+c*u,e[1]=s+c*h),1}}}}}(n=[c=Math.max(y8,Math.min(g8,c)),u=Math.max(y8,Math.min(g8,u))],r=[t=Math.max(y8,Math.min(g8,t)),e=Math.max(y8,Math.min(g8,e))],m,v,b,x)?i&&(g.lineStart(),g.point(t,e),p=!1):(f||(g.lineStart(),g.point(n[0],n[1])),g.point(r[0],r[1]),i||g.lineEnd(),p=!1),c=t,u=e,f=i}return e}}function v8(t,e,n){var r=tp(t,e-C,n).concat(e);return function(e){return r.map(function(t){return[e,t]})}}function b8(t,e,n){var r=tp(t,e-C,n).concat(e);return function(e){return r.map(function(t){return[t,e]})}}function x8(){return g=p=10,y=90,m=360,v=2.5,e.lines=function(){return t().map(function(t){return{type:"LineString",coordinates:t}})},e.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(d(l).slice(1),f(i).reverse().slice(1),d(c).reverse().slice(1))]}},e.extent=function(t){return arguments.length?e.extentMajor(t).extentMinor(t):e.extentMinor()},e.extentMajor=function(t){return arguments.length?(a=+t[0][0],i=+t[1][0],c=+t[0][1],l=+t[1][1],i<a&&(t=a,a=i,i=t),l<c&&(t=c,c=l,l=t),e.precision(v)):[[a,c],[i,l]]},e.extentMinor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],o=+t[1][1],n<r&&(t=r,r=n,n=t),o<s&&(t=s,s=o,o=t),e.precision(v)):[[r,s],[n,o]]},e.step=function(t){return arguments.length?e.stepMajor(t).stepMinor(t):e.stepMinor()},e.stepMajor=function(t){return arguments.length?(y=+t[0],m=+t[1],e):[y,m]},e.stepMinor=function(t){return arguments.length?(p=+t[0],g=+t[1],e):[p,g]},e.precision=function(t){return arguments.length?(v=+t,u=v8(s,o,90),h=b8(r,n,v),f=v8(c,l,90),d=b8(a,i,v),e):v},e.extentMajor([[-180,-90+C],[180,90-C]]).extentMinor([[-180,-80-C],[180,80+C]])();function e(){return{type:"MultiLineString",coordinates:t()}}function t(){return tp(_P(a/y)*y,i,y).map(f).concat(tp(_P(c/m)*m,l,m).map(d)).concat(tp(_P(r/p)*p,n,p).filter(function(t){return EP(t%y)>C}).map(u)).concat(tp(_P(s/g)*g,o,g).filter(function(t){return EP(t%m)>C}).map(h))}var n,r,i,a,o,s,l,c,u,h,f,d,p,g,y,m,v}var w8,M8,O8,k8,E8=t=>t,S8=new Md,A8=new Md,_8={point:BP,lineStart:BP,lineEnd:BP,polygonStart:function(){_8.lineStart=T8,_8.lineEnd=L8},polygonEnd:function(){_8.lineStart=_8.lineEnd=_8.point=BP,S8.add(EP(A8)),A8=new Md},result:function(){var t=S8/2;return S8=new Md,t}};function T8(){_8.point=P8}function P8(t,e){_8.point=C8,w8=O8=t,M8=k8=e}function C8(t,e){A8.add(k8*t-O8*e),O8=t,k8=e}function L8(){C8(w8,M8)}var N8=_8,j8=1/0,R8=j8,I8=-j8,B8=I8;var D8,F8,z8,W8,G8={point:function(t,e){t<j8&&(j8=t);I8<t&&(I8=t);e<R8&&(R8=e);B8<e&&(B8=e)},lineStart:BP,lineEnd:BP,polygonStart:BP,polygonEnd:BP,result:function(){var t=[[j8,R8],[I8,B8]];return I8=B8=-(R8=j8=1/0),t}},H8=0,V8=0,Y8=0,q8=0,$8=0,U8=0,X8=0,K8=0,Z8=0,Q8={point:J8,lineStart:tC,lineEnd:rC,polygonStart:function(){Q8.lineStart=iC,Q8.lineEnd=aC},polygonEnd:function(){Q8.point=J8,Q8.lineStart=tC,Q8.lineEnd=rC},result:function(){var t=Z8?[X8/Z8,K8/Z8]:U8?[q8/U8,$8/U8]:Y8?[H8/Y8,V8/Y8]:[NaN,NaN];return H8=V8=Y8=q8=$8=U8=X8=K8=Z8=0,t}};function J8(t,e){H8+=t,V8+=e,++Y8}function tC(){Q8.point=eC}function eC(t,e){Q8.point=nC,J8(z8=t,W8=e)}function nC(t,e){var n=t-z8,r=e-W8,n=NP(n*n+r*r);q8+=n*(z8+t)/2,$8+=n*(W8+e)/2,U8+=n,J8(z8=t,W8=e)}function rC(){Q8.point=J8}function iC(){Q8.point=oC}function aC(){sC(D8,F8)}function oC(t,e){Q8.point=sC,J8(D8=z8=t,F8=W8=e)}function sC(t,e){var n=t-z8,r=e-W8,n=NP(n*n+r*r);q8+=n*(z8+t)/2,$8+=n*(W8+e)/2,U8+=n,X8+=(n=W8*t-z8*e)*(z8+t),K8+=n*(W8+e),Z8+=3*n,J8(z8=t,W8=e)}var lC=Q8;function cC(t){this._context=t}cC.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,MP)}},result:BP};var uC,hC,fC,dC,pC,gC=new Md,yC={point:BP,lineStart:function(){yC.point=mC},lineEnd:function(){uC&&vC(hC,fC),yC.point=BP},polygonStart:function(){uC=!0},polygonEnd:function(){uC=null},result:function(){var t=+gC;return gC=new Md,t}};function mC(t,e){yC.point=vC,hC=dC=t,fC=pC=e}function vC(t,e){dC-=t,pC-=e,gC.add(NP(dC*dC+pC*pC)),dC=t,pC=e}var bC=yC;let xC,wC,MC,OC;class kC{constructor(t){this._append=null==t?EC:function(t){var e=Math.floor(t);if(!(0<=e))throw new RangeError("invalid digits: "+t);if(15<e)return EC;if(e!==xC){const r=10**e;xC=e,wC=function(t){let e=1;this._+=t[0];for(var n=t.length;e<n;++e)this._+=Math.round(arguments[e]*r)/r+t[e]}}return wC}(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(t,e){switch(this._point){case 0:this._append`M${t},${e}`,this._point=1;break;case 1:this._append`L${t},${e}`;break;default:var n,r;this._append`M${t},${e}`,this._radius===MC&&this._append===wC||(n=this._radius,r=this._,this._="",this._append`m0,${n}a${n},${n} 0 1,1 0,${-2*n}a${n},${n} 0 1,1 0,${2*n}z`,MC=n,wC=this._append,OC=this._,this._=r),this._+=OC}}result(){var t=this._;return this._="",t.length?t:null}}function EC(t){let e=1;this._+=t[0];for(var n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function SC(e,n){let r=3,i=4.5,a,o;function s(t){return t&&("function"==typeof i&&o.pointRadius(+i.apply(this,arguments)),HP(t,a(o))),o.result()}return s.area=function(t){return HP(t,a(N8)),N8.result()},s.measure=function(t){return HP(t,a(bC)),bC.result()},s.bounds=function(t){return HP(t,a(G8)),G8.result()},s.centroid=function(t){return HP(t,a(lC)),lC.result()},s.projection=function(t){return arguments.length?(a=null==t?(e=null,E8):(e=t).stream,s):e},s.context=function(t){return arguments.length?(o=null==t?(n=null,new kC(r)):new cC(n=t),"function"!=typeof i&&o.pointRadius(i),s):n},s.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(o.pointRadius(+t),+t),s):i},s.digits=function(t){if(!arguments.length)return r;if(null==t)r=null;else{var e=Math.floor(t);if(!(0<=e))throw new RangeError("invalid digits: "+t);r=e}return null===n&&(o=new kC(r)),s},s.projection(e).digits(r).context(n)}function AC(r){return function(t){var e,n=new _C;for(e in r)n[e]=r[e];return n.stream=t,n}}function _C(){}function TC(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),HP(n,t.stream(G8)),e(G8.result()),null!=r&&t.clipExtent(r),t}function PC(i,a,t){return TC(i,function(t){var e=a[1][0]-a[0][0],n=a[1][1]-a[0][1],r=Math.min(e/(t[1][0]-t[0][0]),n/(t[1][1]-t[0][1])),e=+a[0][0]+(e-r*(t[1][0]+t[0][0]))/2,n=+a[0][1]+(n-r*(t[1][1]+t[0][1]))/2;i.scale(150*r).translate([e,n])},t)}function CC(t,e,n){return PC(t,[[0,0],e],n)}function LC(r,i,t){return TC(r,function(t){var e=+i,n=e/(t[1][0]-t[0][0]),e=(e-n*(t[1][0]+t[0][0]))/2,t=-n*t[0][1];r.scale(150*n).translate([e,t])},t)}function NC(i,a,t){return TC(i,function(t){var e=+a,n=e/(t[1][1]-t[0][1]),r=-n*t[0][0],e=(e-n*(t[1][1]+t[0][1]))/2;i.scale(150*n).translate([r,e])},t)}_C.prototype={constructor:_C,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var jC=16,RC=A(30*kP);function IC(t,e){return+e?(A=t,_=e,function(r){var n,i,a,o,s,l,c,u,h,f,d,p,g={point:t,lineStart:e,lineEnd:m,polygonStart:function(){r.polygonStart(),g.lineStart=v},polygonEnd:function(){r.polygonEnd(),g.lineStart=e}};function t(t,e){t=A(t,e),r.point(t[0],t[1])}function e(){u=NaN,g.point=y,r.lineStart()}function y(t,e){var n=YP([t,e]),e=A(t,e);T(u,h,c,f,d,p,u=e[0],h=e[1],c=t,f=n[0],d=n[1],p=n[2],jC,r),r.point(u,h)}function m(){g.point=t,r.lineEnd()}function v(){e(),g.point=b,g.lineEnd=x}function b(t,e){y(n=t,e),i=u,a=h,o=f,s=d,l=p,g.point=y}function x(){T(u,h,c,f,d,p,i,a,n,o,s,l,jC,r),g.lineEnd=m,m()}return g}):(n=t,AC({point:function(t,e){t=n(t,e),this.stream.point(t[0],t[1])}}));var n,A,_;function T(t,e,n,r,i,a,o,s,l,c,u,h,f,d){var p,g,y,m,v,b,x,w,M,O,k=o-t,E=s-e,S=k*k+E*E;4*_<S&&f--&&(y=a+h,x=IP(y/=m=NP((p=r+c)*p+(g=i+u)*g+y*y)),v=EP(EP(y)-1)<C||EP(n-l)<C?(n+l)/2:AP(g,p),b=(x=A(v,x))[0],x=x[1],_<(O=E*(w=b-t)-k*(M=x-e))*O/S||.3<EP((k*w+E*M)/S-.5)||r*c+i*u+a*h<RC)&&(T(t,e,n,r,i,a,b,x,v,p/=m,g/=m,y,f,d),d.point(b,x),T(b,x,v,p,g,y,o,s,l,c,u,h,f,d))}}var BC=AC({point:function(t,e){this.stream.point(t*kP,e*kP)}});function DC(t,n,r,i,a,e){var o,s,l,c,u,h,f,d,p,g,y,m;return e?(h=A(e),e=_(e),f=h*t,d=e*t,p=h/t,g=e/t,y=(e*r-h*n)/t,m=(e*n+h*r)/t,b.invert=function(t,e){return[i*(p*t-g*e+y),a*(m-g*t-p*e)]},b):(o=t,s=n,l=r,c=i,u=a,v.invert=function(t,e){return[(t-s)/o*c,(l-e)/o*u]},v);function v(t,e){return[s+o*(t*=c),l-o*(e*=u)]}function b(t,e){return[f*(t*=i)-d*(e*=a)+n,r-d*t-f*e]}}function FC(t){return zC(function(){return t})()}function zC(t){var e,r,n,i,a,o,s,l,c,u,h=150,f=480,d=250,p=0,g=0,y=0,m=0,v=0,b=0,x=1,w=1,M=null,O=d8,k=null,E=E8,S=.5;function A(t){return l(t[0]*kP,t[1]*kP)}function _(t){return(t=l.invert(t[0],t[1]))&&[t[0]*OP,t[1]*OP]}function T(){var t=DC(h,0,0,x,w,b).apply(null,e(p,g)),t=DC(h,f-t[0],d-t[1],x,w,b);return r=JP(y,m,v),s=ZP(e,t),l=ZP(r,s),o=IC(s,S),P()}function P(){return c=u=null,A}return A.stream=function(t){return c&&u===t?c:c=BC((n=r,AC({point:function(t,e){t=n(t,e);return this.stream.point(t[0],t[1])}})(O(o(E(u=t))))));var n},A.preclip=function(t){return arguments.length?(O=t,M=void 0,P()):O},A.postclip=function(t){return arguments.length?(E=t,k=n=i=a=null,P()):E},A.clipAngle=function(t){return arguments.length?(O=+t?p8(M=t*kP):(M=null,d8),P()):M*OP},A.clipExtent=function(t){return arguments.length?(E=null==t?(k=n=i=a=null,E8):m8(k=+t[0][0],n=+t[0][1],i=+t[1][0],a=+t[1][1]),P()):null==k?null:[[k,n],[i,a]]},A.scale=function(t){return arguments.length?(h=+t,T()):h},A.translate=function(t){return arguments.length?(f=+t[0],d=+t[1],T()):[f,d]},A.center=function(t){return arguments.length?(p=t[0]%360*kP,g=t[1]%360*kP,T()):[p*OP,g*OP]},A.rotate=function(t){return arguments.length?(y=t[0]%360*kP,m=t[1]%360*kP,v=2<t.length?t[2]%360*kP:0,T()):[y*OP,m*OP,v*OP]},A.angle=function(t){return arguments.length?(b=t%360*kP,T()):b*OP},A.reflectX=function(t){return arguments.length?(x=t?-1:1,T()):x<0},A.reflectY=function(t){return arguments.length?(w=t?-1:1,T()):w<0},A.precision=function(t){return arguments.length?(o=IC(s,S=t*t),P()):NP(S)},A.fitExtent=function(t,e){return PC(A,t,e)},A.fitSize=function(t,e){return CC(A,t,e)},A.fitWidth=function(t,e){return LC(A,t,e)},A.fitHeight=function(t,e){return NC(A,t,e)},function(){return e=t.apply(this,arguments),A.invert=e.invert&&_,T()}}function WC(t){var e=0,n=bP/3,r=zC(t),t=r(e,n);return t.parallels=function(t){return arguments.length?r(e=t[0]*kP,n=t[1]*kP):[e*OP,n*OP]},t}function GC(t,e){var n,r,i,a=_(t),o=(a+_(e))/2;return EP(o)<C?(n=A(t),s.invert=function(t,e){return[t/n,IP(e*n)]},s):(i=NP(r=1+a*(2*o-a))/o,l.invert=function(t,e){var e=i-e,n=AP(t,EP(e))*LP(e);return e*o<0&&(n-=bP*LP(t)*LP(e)),[n/o,IP((r-(t*t+e*e)*o*o)/(2*o))]},l);function s(t,e){return[t*n,_(e)/n]}function l(t,e){e=NP(r-2*o*_(e))/o;return[e*_(t*=o),i-e*A(t)]}}function HC(){return WC(GC).scale(155.424).center([0,33.6442])}function VC(){return HC().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function YC(i){return function(t,e){var n=A(t),r=A(e),n=i(n*r);return n===1/0?[2,0]:[n*r*_(t),n*_(e)]}}function qC(a){return function(t,e){var n=NP(t*t+e*e),r=a(n),i=_(r),r=A(r);return[AP(t*i,n*r),IP(n&&e*i/n)]}}var $C=YC(function(t){return NP(2/(1+t))});$C.invert=qC(function(t){return 2*IP(t/2)});var UC=YC(function(t){return(t=RP(t))&&t/_(t)});function XC(t,e){return[t,PP(jP((xP+e)/2))]}function KC(r){var i,a,o,s=FC(r),e=s.center,l=s.scale,n=s.translate,c=s.clipExtent,u=null;function h(){var e,t=bP*l(),n=s((e=JP((e=s.rotate())[0]*kP,e[1]*kP,2<e.length?e[2]*kP:0),function(t){return(t=e.invert(t[0]*kP,t[1]*kP))[0]*=OP,t[1]*=OP,t}([0,0])));return c(null==u?[[n[0]-t,n[1]-t],[n[0]+t,n[1]+t]]:r===XC?[[Math.max(n[0]-t,u),i],[Math.min(n[0]+t,a),o]]:[[u,Math.max(n[1]-t,i)],[a,Math.min(n[1]+t,o)]])}return s.scale=function(t){return(arguments.length?(l(t),h):l)()},s.translate=function(t){return(arguments.length?(n(t),h):n)()},s.center=function(t){return(arguments.length?(e(t),h):e)()},s.clipExtent=function(t){return arguments.length?(null==t?u=i=a=o=null:(u=+t[0][0],i=+t[0][1],a=+t[1][0],o=+t[1][1]),h()):null==u?null:[[u,i],[a,o]]},h()}function ZC(t){return jP((xP+t)/2)}function QC(t,e){var n=A(t),i=t===e?_(t):PP(n/A(e))/PP(ZC(e)/ZC(t)),a=n*CP(ZC(t),i)/i;return i?(r.invert=function(t,e){var e=a-e,n=LP(i)*NP(t*t+e*e),r=AP(t,EP(e))*LP(e);return e*i<0&&(r-=bP*LP(t)*LP(e)),[r/i,2*SP(CP(a/n,1/i))-xP]},r):XC;function r(t,e){0<a?e<-xP+C&&(e=-xP+C):xP-C<e&&(e=xP-C);e=a/CP(ZC(e),i);return[e*_(i*t),a-e*A(i*t)]}}function JC(t,e){return[t,e]}function tL(t,e){var n=A(t),r=t===e?_(t):(n-A(e))/(e-t),i=n/r+t;return EP(r)<C?JC:(a.invert=function(t,e){var e=i-e,n=AP(t,EP(e))*LP(e);return e*r<0&&(n-=bP*LP(t)*LP(e)),[n/r,i-LP(r)*NP(t*t+e*e)]},a);function a(t,e){e=i-e,t*=r;return[e*_(t),i-e*A(t)]}}UC.invert=qC(function(t){return t}),XC.invert=function(t,e){return[t,2*SP(TP(e))-xP]},JC.invert=JC;var eL=1.340264,nL=-.081106,rL=893e-6,iL=.003796,aL=NP(3)/2;function oL(t,e){var e=IP(aL*_(e)),n=e*e,r=n*n*n;return[t*A(e)/(aL*(eL+3*nL*n+r*(7*rL+9*iL*n))),e*(eL+nL*n+r*(rL+iL*n))]}function sL(t,e){var n=A(e),r=A(t)*n;return[n*_(t)/r,_(e)/r]}function lL(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function cL(t,e){return[A(e)*_(t),_(e)]}function uL(t,e){var n=A(e),r=1+A(t)*n;return[n*_(t)/r,_(e)/r]}function hL(t,e){return[PP(jP((xP+e)/2)),-t]}oL.invert=function(t,e){for(var n,r=e,i=r*r,a=i*i*i,o=0;o<12&&(a=(i=(r-=n=(r*(eL+nL*i+a*(rL+iL*i))-e)/(eL+3*nL*i+a*(7*rL+9*iL*i)))*r)*i*i,!(EP(n)<vP));++o);return[aL*t*(eL+3*nL*i+a*(7*rL+9*iL*i))/A(r),IP(_(r)/aL)]},sL.invert=qC(SP),lL.invert=function(t,e){var n=e,r=25;do{var i=n*n,a=i*i}while(n-=a=(n*(1.007226+i*(.015085+a*(.028874*i-.044475-.005916*a)))-e)/(1.007226+i*(.045255+a*(.259866*i-.311325-.005916*11*a))),EP(a)>C&&0<--r);return[t/(.8707+(i=n*n)*(i*(i*i*i*(.003971-.001529*i)-.013791)-.131979)),n]},cL.invert=qC(IP),uL.invert=qC(function(t){return 2*SP(t)}),hL.invert=function(t,e){return[-e,2*SP(TP(t))-xP]};var fL=Object.freeze({__proto__:null,geoAlbersUsa:function(){var e,n,i,a,o,r,s=VC(),l=HC().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=HC().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(t,e){r=[t,e]}};function h(t){var e=t[0],t=t[1];return r=null,i.point(e,t),r||(a.point(e,t),r)||(o.point(e,t),r)}function f(){return e=n=null,h}return h.invert=function(t){var e=s.scale(),n=s.translate(),r=(t[0]-n[0])/e,n=(t[1]-n[1])/e;return(.12<=n&&n<.234&&-.425<=r&&r<-.214?l:.166<=n&&n<.234&&-.214<=r&&r<-.115?c:s).invert(t)},h.stream=function(t){return e&&n===t?e:(r=[s.stream(n=t),l.stream(t),c.stream(t)],i=r.length,e={point:function(t,e){for(var n=-1;++n<i;)r[n].point(t,e)},sphere:function(){for(var t=-1;++t<i;)r[t].sphere()},lineStart:function(){for(var t=-1;++t<i;)r[t].lineStart()},lineEnd:function(){for(var t=-1;++t<i;)r[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<i;)r[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<i;)r[t].polygonEnd()}});var r,i},h.precision=function(t){return arguments.length?(s.precision(t),l.precision(t),c.precision(t),f()):s.precision()},h.scale=function(t){return arguments.length?(s.scale(t),l.scale(.35*t),c.scale(t),h.translate(s.translate())):s.scale()},h.translate=function(t){var e,n,r;return arguments.length?(e=s.scale(),n=+t[0],r=+t[1],i=s.translate(t).clipExtent([[n-.455*e,r-.238*e],[n+.455*e,r+.238*e]]).stream(u),a=l.translate([n-.307*e,r+.201*e]).clipExtent([[n-.425*e+C,r+.12*e+C],[n-.214*e-C,r+.234*e-C]]).stream(u),o=c.translate([n-.205*e,r+.212*e]).clipExtent([[n-.214*e+C,r+.166*e+C],[n-.115*e-C,r+.234*e-C]]).stream(u),f()):s.translate()},h.fitExtent=function(t,e){return PC(h,t,e)},h.fitSize=function(t,e){return CC(h,t,e)},h.fitWidth=function(t,e){return LC(h,t,e)},h.fitHeight=function(t,e){return NC(h,t,e)},h.scale(1070)},geoAlbers:VC,geoAzimuthalEqualArea:function(){return FC($C).scale(124.75).clipAngle(179.999)},geoAzimuthalEqualAreaRaw:$C,geoAzimuthalEquidistant:function(){return FC(UC).scale(79.4188).clipAngle(179.999)},geoAzimuthalEquidistantRaw:UC,geoConicConformal:function(){return WC(QC).scale(109.5).parallels([30,30])},geoConicConformalRaw:QC,geoConicEqualArea:HC,geoConicEqualAreaRaw:GC,geoConicEquidistant:function(){return WC(tL).scale(131.154).center([0,13.9389])},geoConicEquidistantRaw:tL,geoEqualEarth:function(){return FC(oL).scale(177.158)},geoEqualEarthRaw:oL,geoEquirectangular:function(){return FC(JC).scale(152.63)},geoEquirectangularRaw:JC,geoGnomonic:function(){return FC(sL).scale(144.049).clipAngle(60)},geoGnomonicRaw:sL,geoIdentity:function(){var r,i,e,n,a,o,s,l=1,c=0,u=0,h=1,f=1,d=0,p=null,g=1,y=1,m=AC({point:function(t,e){t=x([t,e]);this.stream.point(t[0],t[1])}}),v=E8;function b(){return g=l*h,y=l*f,o=s=null,x}function x(t){var e,n=t[0]*g,t=t[1]*y;return d&&(e=t*r-n*i,n=n*r+t*i,t=e),[n+c,t+u]}return x.invert=function(t){var e,n=t[0]-c,t=t[1]-u;return d&&(e=t*r+n*i,n=n*r-t*i,t=e),[n/g,t/y]},x.stream=function(t){return o&&s===t?o:o=m(v(s=t))},x.postclip=function(t){return arguments.length?(v=t,p=e=n=a=null,b()):v},x.clipExtent=function(t){return arguments.length?(v=null==t?(p=e=n=a=null,E8):m8(p=+t[0][0],e=+t[0][1],n=+t[1][0],a=+t[1][1]),b()):null==p?null:[[p,e],[n,a]]},x.scale=function(t){return arguments.length?(l=+t,b()):l},x.translate=function(t){return arguments.length?(c=+t[0],u=+t[1],b()):[c,u]},x.angle=function(t){return arguments.length?(i=_(d=t%360*kP),r=A(d),b()):d*OP},x.reflectX=function(t){return arguments.length?(h=t?-1:1,b()):h<0},x.reflectY=function(t){return arguments.length?(f=t?-1:1,b()):f<0},x.fitExtent=function(t,e){return PC(x,t,e)},x.fitSize=function(t,e){return CC(x,t,e)},x.fitWidth=function(t,e){return LC(x,t,e)},x.fitHeight=function(t,e){return NC(x,t,e)},x},geoProjection:FC,geoProjectionMutator:zC,geoMercator:function(){return KC(XC).scale(961/MP)},geoMercatorRaw:XC,geoNaturalEarth1:function(){return FC(lL).scale(175.295)},geoNaturalEarth1Raw:lL,geoOrthographic:function(){return FC(cL).scale(249.5).clipAngle(90+C)},geoOrthographicRaw:cL,geoStereographic:function(){return FC(uL).scale(250).clipAngle(142)},geoStereographicRaw:uL,geoTransverseMercator:function(){var t=KC(hL),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],2<t.length?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)},geoTransverseMercatorRaw:hL});function dL(t){return{type:"FeatureCollection",features:t.flatMap(t=>function(t){if(!t||!t.type)return null;var e={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featureCollection"}[t.type];if(!e)return null;return"geometry"===e?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]}:"feature"===e?{type:"FeatureCollection",features:[t]}:"featureCollection"===e?t:void 0}(t).features)}}function pL(t,e,n,r){var i,a,o,s,l,c,{outline:e=(e=e.filter(yL),e.find(t=>t.sphere)?{type:"Sphere"}:dL(e.filter(t=>!t.sphere).flatMap(t=>t.data.value)))}=r,{size:r="fitExtent"}=r;"fitExtent"===r?(i=t,o=e,{x:c,y:l,width:a,height:s}=c=n,i.fitExtent([[c,l],[a,s]],o)):"fitWidth"===r&&(i=t,c=e,{width:l,height:a}=l=n,[[l,c],[s,o]]=SC(i.fitWidth(l,c)).bounds(c),o=Math.ceil(o-c),c=Math.min(Math.ceil(s-l),o),s=i.scale()*(c-1)/c,[l,c]=i.translate(),c+=(a-o)/2,i.scale(s).translate([l,c]).precision(.2))}function gL(t){var e=t["data"];return Array.isArray(e)?Object.assign(Object.assign({},t),{data:{value:e}}):(e=e["type"],"graticule10"===e?Object.assign(Object.assign({},t),{data:{value:[x8()]}}):"sphere"===e?Object.assign(Object.assign({},t),{sphere:!0,data:{value:[{type:"Sphere"}]}}):t)}function yL(t){return"geoPath"===t.type}const mL=()=>t=>{var{children:e,coordinate:n={}}=t;if(!Array.isArray(e))return[];const{type:r="equalEarth"}=n,f=at(n,["type"]),d=function(t){if("function"==typeof t)return t;var e="geo"+Ue(t);if(e=fL[e])return e;throw new Error("Unknown coordinate: "+t)}(r),p=e.map(gL);let g;return[Object.assign(Object.assign({},t),{type:"view",scale:{x:{type:"identity"},y:{type:"identity"}},axis:!1,coordinate:{type:function(){return[["custom",(t,e,n,r)=>{const i=d();var a,o,s,l={x:t,y:e,width:n,height:r},c=(pL(i,p,l,f),i),l=f;for([o,s]of Object.entries(l))null!=(a=c[o])&&a.call(c,s);g=SC(i);const u=new wg({domain:[t,t+n]}),h=new wg({domain:[e,e+r]});return{transform:t=>{return t=t,(t=i(t))?([t,e]=t,[u.map(t),h.map(e)]):[null,null];var e},untransform:t=>{return(t=t)?([t,e]=t,t=[u.invert(t),h.invert(e)],i.invert(t)):null;var e}}}]]}},children:p.flatMap(t=>{var e,n,r;return yL(t)?({style:n,tooltip:r={}}=e=t,Object.assign(Object.assign({},e),{type:"path",tooltip:mv(r,{title:"id",items:[{channel:"color"}]}),style:Object.assign(Object.assign({},n),{d:t=>g(t)||[]})})):t})})]};function vL(t){var{min:t,max:e}=t;return[[t[0],t[1]],[e[0],e[1]]]}function bL(t,e){var[t,n]=t,[e,r]=e;return t>=e[0]&&t<=r[0]&&n>=e[1]&&n<=r[1]}mL.props={};const xL=t=>{const n=t["priority"];return t=>{const e=[];return n&&t.sort(n),t.forEach(t=>{aT(t);const i=t.getLocalBounds();e.some(t=>{var e=vL(i),t=vL(t.getLocalBounds()),[e,n]=e,[t,r]=t;return e[0]<r[0]&&n[0]>t[0]&&e[1]<r[1]&&n[1]>t[1]})?iT(t):e.push(t)}),t}};function wL(){const n=new Map;return[t=>n.get(t),(t,e)=>n.set(t,e)]}const ML=t=>{const{maxIterations:M=10,maxError:O=.1,padding:k=1}=t;return i=>{var e=i.length;if(!(e<=1)){const[g,y]=wL(),[m,v]=wL();var a,o,s,l,[c,t]=wL(),[u,n]=wL();for(const b of i){var{min:r,max:h}=function(t){var t=t.cloneNode(!0),{min:e,max:n}=((e=t.getElementById("connector"))&&t.removeChild(e),t.getRenderBounds());return t.destroy(),{min:e,max:n}}(b);const[x,g]=r;var[r,h]=h;y(b,g),v(b,g),t(b,h-g),n(b,[x,r])}for(let t=0;t<M;t++){i.sort((t,e)=>fd(m(t),m(e)));let r=0;for(let n=0;n<e-1;n++){var f=i[n];let t=n+1,e;for(;(e=i[t])&&([[a,o],[s,l]]=[u(f),u(e)],!(a<l&&s<o));)t+=1;if(e){const g=m(f);var d=c(f),p=m(e),d=p-(g+d);d<k&&(d=(k-d)/2,r=Math.max(r,d),v(f,g-d),v(e,p+d))}}if(r<O)break}for(const w of i)w.style.y+=m(w)-g(w)}return i}};function OL(t){t/=255;return t<=.03928?t/12.92:Math.pow((.055+t)/1.055,2.4)}function kL(t,e,n){return.2126*OL(t)+.7152*OL(e)+.0722*OL(n)}function EL(t,e){var{r:t,g:n,b:r}=t,{r:e,g:i,b:a}=e,t=kL(t,n,r),n=kL(e,i,a);return(Math.max(t,n)+.05)/(Math.min(t,n)+.05)}function SL(e,t){return t[Vd(t,t=>{return EL(e,"object"==typeof(t=t)?t:ma(t))})]}const AL=t=>{const{threshold:n=4.5,palette:r=["#000","#fff"]}=t;return t=>(t.forEach(t=>{var e=t.attr("dependentElement").parsedStyle.fill;EL(t.parsedStyle.fill,e)<n&&t.attr("fill",SL(e,r))}),t)},_L=()=>t=>(t.forEach(t=>{aT(t);var e=t.attr("bounds");!function(t,e){var[t,n]=t;return!(bL(t,e)&&bL(n,e))}(vL(t.getLocalBounds()),e)||iT(t)}),t);function TL(){return{"data.fetch":eA,"data.inline":lA,"data.sortBy":sA,"data.sort":iA,"data.filter":rA,"data.pick":aA,"data.rename":oA,"data.fold":nA,"data.slice":BA,"data.custom":cA,"data.map":uA,"data.join":IA,"data.kde":VA,"data.log":h4,"transform.stackY":bb,"transform.binX":v2,"transform.bin":m2,"transform.dodgeX":Ob,"transform.jitter":_b,"transform.jitterX":Tb,"transform.symmetryY":Pb,"transform.diffY":Cb,"transform.stackEnter":kb,"transform.normalizeY":Eb,"transform.select":Ib,"transform.selectX":Bb,"transform.selectY":Db,"transform.groupX":Kb,"transform.groupY":Zb,"transform.groupColor":Qb,"transform.group":Xb,"transform.sortX":e2,"transform.sortY":r2,"transform.sortColor":n2,"transform.flexX":i2,"transform.pack":p2,"transform.sample":w2,"transform.filter":M2,"coordinate.cartesian":Lp,"coordinate.polar":jp,"coordinate.helix":Rp,"coordinate.transpose":Ip,"coordinate.theta":Bp,"coordinate.parallel":zp,"coordinate.fisheye":Wp,"coordinate.radial":Fp,"coordinate.radar":Gp,"encode.constant":Jv,"encode.field":eb,"encode.transform":tb,"encode.column":nb,"mark.interval":I5,"mark.rect":B5,"mark.line":z5,"mark.point":W5,"mark.text":G5,"mark.cell":H5,"mark.area":V5,"mark.link":Y5,"mark.image":q5,"mark.polygon":$5,"mark.box":U5,"mark.vector":X5,"mark.lineX":Z5,"mark.lineY":K5,"mark.connector":Q5,"mark.range":eS,"mark.rangeX":nS,"mark.rangeY":rS,"mark.path":ES,"mark.shape":GS,"mark.density":m4,"mark.heatmap":v4,"shape.label.label":T5,"palette.category10":b4,"palette.category20":x4,"scale.linear":M4,"scale.ordinal":O4,"scale.band":w4,"scale.identity":k4,"scale.point":E4,"scale.time":S4,"scale.log":A4,"scale.pow":_4,"scale.sqrt":L4,"scale.threshold":T4,"scale.quantile":P4,"scale.quantize":C4,"scale.sequential":N4,"scale.constant":j4,"theme.classic":B4,"theme.classicDark":z4,"theme.academy":H4,"component.axisX":o_,"component.axisY":s_,"component.axisRadar":l_,"component.axisLinear":i_,"component.axisArc":a_,"component.legendCategory":h_,"component.legendContinuous":y_,"component.legendContinuousBlock":m_,"component.legendContinuousBlockSize":b_,"component.legendContinuousSize":v_,"component.legends":j_,"component.title":M_,"component.sliderX":T_,"component.sliderY":P_,"component.scrollbarX":L_,"component.scrollbarY":N_,"animation.scaleInX":R_,"animation.scaleOutX":I_,"animation.scaleInY":B_,"animation.scaleOutY":D_,"animation.waveIn":K_,"animation.fadeIn":F_,"animation.fadeOut":z_,"animation.zoomIn":Z_,"animation.zoomOut":Q_,"animation.pathIn":J_,"animation.morphing":X_,"animation.growInX":tT,"animation.growInY":eT,"interaction.elementHighlight":kT,"interaction.elementHighlightByX":ET,"interaction.elementHighlightByColor":ST,"interaction.elementSelect":_T,"interaction.elementSelectByX":TT,"interaction.elementSelectByColor":PT,"interaction.fisheye":LT,"interaction.chartIndex":CT,"interaction.tooltip":QT,"interaction.legendFilter":u6,"interaction.legendHighlight":h6,"interaction.brushHighlight":m6,"interaction.brushXHighlight":b6,"interaction.brushYHighlight":w6,"interaction.brushAxisHighlight":T6,"interaction.brushFilter":C6,"interaction.brushXFilter":L6,"interaction.brushYFilter":N6,"interaction.sliderFilter":I6,"interaction.scrollbarFilter":D6,"interaction.poptip":W6,"interaction.event":RT,"composition.spaceLayer":Y6,"composition.spaceFlex":q6,"composition.mark":U6,"composition.view":$6,"composition.facetRect":aP,"composition.repeatMatrix":cP,"composition.facetCircle":gP,"composition.timingKeyframe":yP,"labelTransform.overlapHide":xL,"labelTransform.overlapDodgeY":ML,"labelTransform.overflowHide":_L,"labelTransform.contrastReverse":AL}}function PL(){return Object.assign(Object.assign(Object.assign(Object.assign({},{"composition.geoView":mL,"composition.geoPath":mP}),{"mark.forceGraph":j3,"mark.tree":G3}),{"data.venn":u4,"data.arc":pA,"data.cluster":I3,"mark.sankey":kS,"mark.treemap":TS,"mark.boxplot":WS,"mark.pack":LS,"mark.gauge":y4,"mark.wordCloud":f4}),TL())}function CL(t,e){class n extends t{constructor(t){super(Object.assign(Object.assign({},t),{lib:e}))}}return n}const LL=PL();const NL=t=>t?parseInt(t):0;const jL=["width","height","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title"];function RL(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function IL(t,e){var n,r=t["autoFit"];return r?(r=e,e=getComputedStyle(r),n=r.clientWidth||NL(e.width),r=r.clientHeight||NL(e.height),{width:n-(NL(e.paddingLeft)+NL(e.paddingRight)),height:r-(NL(e.paddingTop)+NL(e.paddingBottom))}):({width:n=640,height:r=480}=t,{width:n,height:r})}function BL(t){var t=function(t){if(null!==t.type)return t;var e=t.children[t.children.length-1];for(const n of jL)e.attr(n,t.attr(n));return e}(t),e=[t],n=new Map;for(n.set(t,RL(t));e.length;){const t=e.pop();var r=n.get(t),{children:i=[]}=t;for(const s of i){var a=RL(s),{children:o=[]}=r;o.push(a),e.push(s),n.set(s,a),r.children=o}}return n.get(t)}function DL(t,e,n,r){var t=t["type"],{type:n=n||t}=e;if("view"===n)return e;if(t=r,"function"!=typeof(r=n)&&!new Set(Object.keys(t)).has(r))return e;var i={type:"view"},a=Object.assign({},e);for(const o of jL)void 0!==a[o]&&(i[o]=a[o],delete a[o]);return Object.assign(Object.assign({},i),{children:[a]})}function FL(t,e,n){var r=t["type"],t=at(t,["type","children"]),e=new(function(t,e,n){if("function"==typeof t)return e.mark;if(e=Object.assign(Object.assign({},e),n)[t])return e;throw new Error(`Unknown mark: ${t}.`)}(r,e,n));return e.value=t,e.type=r,e}function zL(t,e){var n=e["type"],e=at(e,["type","children"]);t.type===n||void 0===n?function t(e,n,r=5,i=0){if(!(r<=i))for(const o of Object.keys(n)){var a=n[o];Ie(a)&&Ie(e[o])?t(e[o],a,r,i+1):e[o]=a}}(t.value,e):"string"==typeof n&&(t.type=n,t.value=e)}function WL(t,e,n,r,i){for(var a=[[null,t,DL(t,e,n,r)]];a.length;){var[o,s,l]=a.shift();if(s)if(l){zL(s,l);var c=l["children"],u=s["children"];if(Array.isArray(c)&&Array.isArray(u)){var h=Math.max(c.length,u.length);for(let t=0;t<h;t++){var f=c[t],d=u[t];a.push([s,d,f])}}}else s.remove();else{x=b=v=m=y=g=p=void 0;var p=o,g=l,y=r,m=i;if(p)for(var v=[[p,g]];v.length;){const[p,w]=v.shift();var b=FL(w,y,m),x=(Array.isArray(p.children)&&p.push(b),w)["children"];if(Array.isArray(x))for(const M of x)v.push([b,M])}}}}function GL(t,e){for(var n=[t];n.length;){var r=n.shift(),r=(e&&e(r),r.children||[]);for(const i of r)n.push(i)}}class HL{constructor(t={},e){this.parentNode=null,this.children=[],this.index=0,this.type=e,this.value=t}map(t=t=>t){t=t(this.value);return this.value=t,this}attr(e,n){return 1===arguments.length?this.value[e]:this.map(t=>(t[e]=n,t))}append(t){t=new t({});return t.children=[],this.push(t),t}push(t){return t.parentNode=this,t.index=this.children.length,this.children.push(t),this}remove(){var t,e=this.parentNode;return e&&(e=e["children"],t=e.findIndex(t=>t===this),e.splice(t,1)),this}getNodeByKey(e){let n=null;return GL(this,t=>{e===t.attr("key")&&(n=t)}),n}getNodesByType(e){const n=[];return GL(this,t=>{e===t.type&&n.push(t)}),n}getNodeByType(e){let n=null;return GL(this,t=>{n||e===t.type&&(n=t)}),n}call(t,...e){return t(this.map(),...e),this}getRoot(){let t=this;for(;t&&t.parentNode;)t=t.parentNode;return t}}function VL(t,e,{key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function YL(t,e,{key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):Array.isArray(t)?this.attr(n,t):(t=[...this.attr(n)||[],t],this.attr(n,t))}}function qL(t,e,{key:r=e}){t.prototype[e]=function(t,e){var n;return 0===arguments.length?this.attr(r):1===arguments.length&&"string"!=typeof t?this.attr(r,t):((n=this.attr(r)||{})[t]=1===arguments.length||e,this.attr(r,n))}}function $L(i){return t=>{for(var[e,n]of Object.entries(i)){var r=n["type"];"value"===r?VL(t,e,n):"array"===r?YL(t,e,n):"object"===r?qL(t,e,n):"node"===r?function(t,n,{ctor:r}){t.prototype[n]=function(t){var e=this.append(r);return"mark"===n&&(e.type=t),e}}(t,e,n):"container"===r?function(t,e,{ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}(t,e,n):"mix"===r&&function(t,r){t.prototype[r]=function(t){var e,n;return 0===arguments.length?this.attr(r):Array.isArray(t)?this.attr(r,{items:t}):hp(t)&&(void 0!==t.title||void 0!==t.items)||null===t||!1===t?this.attr(r,t):({items:n=[]}=e=this.attr(r)||{},n.push(t),e.items=n,this.attr(r,e))}}(t,e)}return t}}function UL(t){return Object.fromEntries(Object.entries(t).map(([t,e])=>[t,{type:"node",ctor:e}]))}om={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"}},im=Object.assign(Object.assign({},om),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),em=Object.assign(Object.assign({},om),{labelTransform:{type:"array"}});l.CompositionNode=class extends HL{changeData(e){var t,n=this.getRoot();if(n)return this.attr("data",e),null!=(t=this.children)&&t.length&&this.children.forEach(t=>{t.attr("data",e)}),null==n?void 0:n.render()}getView(){var t=this.getRoot().getContext()["views"];if(null!=t&&t.length)return t.find(t=>t.key===this._key)}getScale(){var t;return null==(t=this.getView())?void 0:t.scale}getScaleByChannel(t){var e=this.getScale();if(e)return e[t]}getCoordinate(){var t;return null==(t=this.getView())?void 0:t.coordinate}getTheme(){var t;return null==(t=this.getView())?void 0:t.theme}getGroup(){var t=this._key;if(t)return this.getRoot().getContext().canvas.getRoot().getElementById(t)}show(){var t=this.getGroup();t&&!t.isVisible()&&aT(t)}hide(){var t=this.getGroup();t&&t.isVisible()&&iT(t)}},l.CompositionNode=N([$L(em)],l.CompositionNode),l.MarkNode=class extends HL{changeData(t){var e=this.getRoot();if(e)return this.attr("data",t),null==e?void 0:e.render()}getMark(){var t,e=null==(e=this.getRoot())?void 0:e.getView();if(e)return e=e["markState"],t=Array.from(e.keys()).find(t=>t.key===this.attr("key")),e.get(t)}getScale(){var t=null==(t=this.getRoot())?void 0:t.getView();return!t||null==t?void 0:t.scale}getScaleByChannel(t){var e=null==(e=this.getRoot())?void 0:e.getView();return!e||null==(e=null==e?void 0:e.scale)?void 0:e[t]}getGroup(){var t=this.attr("key");if(t)return this.getRoot().getContext().canvas.getRoot().getElementById(t)}},l.MarkNode=N([$L(im)],l.MarkNode);class XL extends l.CompositionNode{constructor(t){var{container:e,canvas:n,renderer:r,plugins:i,lib:a}=t;super(at(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=Qe(()=>{this.forceFit()},300),this._renderer=r||new rd,this._plugins=i||[],this._container=void 0===(t=e)?document.createElement("div"):"string"==typeof t?document.getElementById(t):t,this._emitter=new ud,this._context={library:a,emitter:this._emitter,canvas:n},this._create()}render(){if(this._rendering)return this._addToTrailing();this._context.canvas||this._createCanvas(),this._bindAutoFit(),this._rendering=!0;var t=new Promise((t,e)=>Zv(this._computedOptions(),this._context,this._createResolve(t),this._createReject(e))),[e,n,r]=function(){let n,r;return[new Promise((t,e)=>{r=t,n=e}),r,n]}();return t.then(n).catch(r).then(()=>this._renderTrailing()),e}options(t){var e;return 0===arguments.length?BL(this):(e=t["type"],e&&(this._previousDefinedType=e),WL(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(pp.BEFORE_CLEAR),this._reset(),Qv(0,this._context,!1),this.emit(pp.AFTER_CLEAR)}destroy(){var t,e;this.options();this.emit(pp.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),Qv(0,this._context,!0),t=this._container,(e=t.parentNode)&&e.removeChild(t),this.emit(pp.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;var{width:t,height:e}=IL(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(pp.BEFORE_CHANGE_SIZE);t=this.render();return t.then(()=>{this.emit(pp.AFTER_CHANGE_SIZE)}),t}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(pp.BEFORE_CHANGE_SIZE),this.attr("width",t),this.attr("height",e);t=this.render();return t.then(()=>{this.emit(pp.AFTER_CHANGE_SIZE)}),t}_create(){var t=this._context["library"],e=["mark.mark",...Object.keys(t).filter(t=>t.startsWith("mark.")||"component.axisX"===t||"component.axisY"===t||"component.legends"===t)];this._marks={};for(const n of e){const r=n.split(".").pop();class i extends l.MarkNode{constructor(){super({},r)}}this._marks[r]=i,this[r]=function(t){var e=this.append(i);return"mark"===r&&(e.type=t),e}}e=Object.keys(t).filter(t=>t.startsWith("composition.")&&"composition.mark"!==t);this._compositions=Object.fromEntries(e.map(t=>{const e=t.split(".").pop();let n=class extends l.CompositionNode{constructor(){super({},e)}};return n=N([$L(UL(this._marks))],n),[e,n]}));for(const a of Object.values(this._compositions))$L(UL(this._compositions))(a);for(const o of e){const s=o.split(".").pop();this[s]=function(){var t=this._compositions[s];return this.type=null,this.append(t)}}}_reset(){const e=["theme","type","width","height","autoFit"];this.type="view",this.value=Object.fromEntries(Object.entries(this.value).filter(([t])=>t.startsWith("margin")||t.startsWith("padding")||t.startsWith("inset")||e.includes(t))),this.children=[]}_renderTrailing(){this._trailing&&(this._trailing=!1,this.render().then(()=>{var t=this._trailingResolve.bind(this);this._trailingResolve=null,t(this)}).catch(t=>{var e=this._trailingReject.bind(this);this._trailingReject=null,e(t)}))}_createResolve(t){return()=>{this._rendering=!1,t(this)}}_createReject(e){return t=>{this._rendering=!1,e(t)}}_computedOptions(){var t=this.options(),{key:e="G2_CHART_KEY"}=t,{width:n,height:r}=IL(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})}_createCanvas(){var{width:t,height:e}=IL(this.options(),this._container);this._plugins.push(new ld),this._plugins.forEach(t=>this._renderer.registerPlugin(t)),this._context.canvas=new su({container:this._container,width:t,height:e,renderer:this._renderer})}_addToTrailing(){null!=(t=this._trailingResolve)&&t.call(this,this),this._trailing=!0;var t=new Promise((t,e)=>{this._trailingResolve=t,this._trailingReject=e});return t}_bindAutoFit(){var t=this.options()["autoFit"];this._hasBindAutoFit?t||this._unbindAutoFit():t&&(this._hasBindAutoFit=!0,window.addEventListener("resize",this._onResize))}_unbindAutoFit(){this._hasBindAutoFit&&(this._hasBindAutoFit=!1,window.removeEventListener("resize",this._onResize))}}am=CL(XL,LL);E.enableCSSParsing=!1,l.AREA_CLASS_NAME=kh,l.Area=V5,l.Box=U5,l.Boxplot=WS,l.COMPONENT_CLASS_NAME=Mh,l.Cell=H5,l.Chart=am,l.ChartEvent=pp,l.Connector=Q5,l.Density=m4,l.ELEMENT_CLASS_NAME=bh,l.ForceGraph=j3,l.Gauge=y4,l.Heatmap=v4,l.Image=q5,l.Interval=I5,l.LABEL_CLASS_NAME=Oh,l.LABEL_LAYER_CLASS_NAME=vh,l.Line=z5,l.LineX=Z5,l.LineY=K5,l.Link=Y5,l.MAIN_LAYER_CLASS_NAME=mh,l.PLOT_CLASS_NAME=wh,l.Pack=LS,l.Path=ES,l.Point=W5,l.Polygon=$5,l.Range=eS,l.RangeX=nS,l.RangeY=rS,l.Rect=B5,l.Runtime=XL,l.Sankey=kS,l.Shape=GS,l.Text=G5,l.Tree=G3,l.Treemap=TS,l.VIEW_CLASS_NAME=xh,l.Vector=X5,l.WordCloud=f4,l.corelib=TL,l.extend=CL,l.litelib=function(){return{"data.inline":lA,"coordinate.cartesian":Lp,"encode.constant":Jv,"encode.field":eb,"encode.transform":tb,"encode.column":nb,"mark.interval":I5,"shape.label.label":T5,"palette.category10":b4,"palette.category20":x4,"scale.linear":M4,"scale.ordinal":O4,"scale.band":w4,"scale.identity":k4,"scale.point":E4,"scale.time":S4,"scale.log":A4,"scale.pow":_4,"scale.sqrt":L4,"scale.threshold":T4,"scale.quantile":P4,"scale.quantize":C4,"scale.sequential":N4,"scale.constant":j4,"theme.classic":B4,"component.axisX":o_,"component.axisY":s_,"component.axisRadar":l_,"component.axisLinear":i_,"component.axisArc":a_,"component.legendCategory":h_,"component.legendContinuous":y_,"component.legendContinuousBlock":m_,"component.legendContinuousBlockSize":b_,"component.legendContinuousSize":v_,"component.legends":j_,"component.title":M_,"component.sliderX":T_,"component.sliderY":P_,"component.scrollbarX":L_,"component.scrollbarY":N_,"animation.scaleInX":R_,"animation.scaleOutX":I_,"animation.scaleInY":B_,"animation.scaleOutY":D_,"animation.waveIn":K_,"animation.fadeIn":F_,"animation.fadeOut":z_,"animation.morphing":X_,"interaction.tooltip":QT,"interaction.legendFilter":u6,"interaction.legendHighlight":h6,"interaction.sliderFilter":I6,"interaction.scrollbarFilter":D6,"interaction.poptip":W6,"interaction.event":RT,"composition.mark":U6,"composition.view":$6}},l.register=function(t,e){Object.assign(LL,{[t]:e})},l.render=Zv,l.renderToMountedElement=function(t,e={},n=()=>{},r=t=>{throw t}){var{width:i=640,height:a=480}=t,t=Kv(t);const{group:o=new fc,emitter:s=new ud,library:l}=e;null!==o&&void 0!==o&&o.parentElement||ap("renderToMountedElement can't render chart to unmounted group.");var c=lt(o);return e.group=o,(e.emitter=s).emit(pp.BEFORE_RENDER),Lv(Object.assign(Object.assign({},t),{width:i,height:a}),c,l,e).then(()=>{o.ownerDocument.defaultView.requestAnimationFrame(()=>{s.emit(pp.AFTER_RENDER),null!=n&&n()})}).catch(t=>{null!=r&&r(t)}),o},l.stdlib=PL,Object.defineProperty(l,"__esModule",{value:!0})});