@antv/g2 5.1.5-beta.0 → 5.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +436 -0
- package/dist/g2.full.min.js +1 -0
- package/dist/g2.lite.min.js +1 -0
- package/dist/g2.min.js +1 -1
- package/esm/api/chart.d.ts +2 -164
- package/esm/api/library.d.ts +1 -163
- package/esm/api/library.js +1 -2
- package/esm/api/library.js.map +1 -1
- package/esm/api/runtime.d.ts +1 -1
- package/esm/api/runtime.js +6 -1
- package/esm/api/runtime.js.map +1 -1
- package/esm/exports.d.ts +5 -0
- package/esm/exports.js +7 -0
- package/esm/exports.js.map +1 -0
- package/esm/index.d.ts +338 -7
- package/esm/index.js +9 -8
- package/esm/index.js.map +1 -1
- package/esm/interaction/tooltip.js +0 -1
- package/esm/interaction/tooltip.js.map +1 -1
- package/esm/lib/auto.d.ts +3 -0
- package/esm/lib/auto.js +7 -0
- package/esm/lib/auto.js.map +1 -0
- package/esm/lib/index.d.ts +1 -0
- package/esm/lib/index.js +1 -0
- package/esm/lib/index.js.map +1 -1
- package/esm/lib/std.d.ts +29 -29
- package/esm/mark/auto.d.ts +1 -0
- package/esm/mark/auto.js +26 -0
- package/esm/mark/auto.js.map +1 -0
- package/esm/mark/index.d.ts +1 -0
- package/esm/mark/index.js +1 -0
- package/esm/mark/index.js.map +1 -1
- package/esm/runtime/plot.js +2 -2
- package/esm/runtime/plot.js.map +1 -1
- package/esm/shape/index.d.ts +1 -1
- package/esm/spec/index.d.ts +3 -3
- package/esm/spec/mark.d.ts +4 -2
- package/esm/utils/event.d.ts +31 -32
- package/esm/utils/event.js +2 -12
- package/esm/utils/event.js.map +1 -1
- package/lib/api/chart.d.ts +2 -164
- package/lib/api/library.d.ts +1 -163
- package/lib/api/library.js +1 -2
- package/lib/api/library.js.map +1 -1
- package/lib/api/runtime.d.ts +1 -1
- package/lib/api/runtime.js +6 -1
- package/lib/api/runtime.js.map +1 -1
- package/lib/exports.d.ts +5 -0
- package/lib/exports.js +39 -0
- package/lib/exports.js.map +1 -0
- package/lib/index.d.ts +338 -7
- package/lib/index.js +11 -28
- package/lib/index.js.map +1 -1
- package/lib/interaction/tooltip.js +0 -1
- package/lib/interaction/tooltip.js.map +1 -1
- package/lib/lib/auto.d.ts +3 -0
- package/lib/lib/auto.js +11 -0
- package/lib/lib/auto.js.map +1 -0
- package/lib/lib/index.d.ts +1 -0
- package/lib/lib/index.js +3 -1
- package/lib/lib/index.js.map +1 -1
- package/lib/lib/std.d.ts +29 -29
- package/lib/mark/auto.d.ts +1 -0
- package/lib/mark/auto.js +30 -0
- package/lib/mark/auto.js.map +1 -0
- package/lib/mark/index.d.ts +1 -0
- package/lib/mark/index.js +3 -1
- package/lib/mark/index.js.map +1 -1
- package/lib/runtime/plot.js +2 -2
- package/lib/runtime/plot.js.map +1 -1
- package/lib/shape/index.d.ts +1 -1
- package/lib/spec/index.d.ts +3 -3
- package/lib/spec/mark.d.ts +4 -2
- package/lib/utils/event.d.ts +31 -32
- package/lib/utils/event.js +2 -12
- package/lib/utils/event.js.map +1 -1
- package/package.json +23 -8
- package/src/api/chart.ts +1 -1
- package/src/api/library.ts +1 -2
- package/src/api/runtime.ts +7 -2
- package/src/exports.ts +32 -0
- package/src/index.ts +13 -41
- package/src/interaction/tooltip.ts +0 -1
- package/src/lib/auto.ts +7 -0
- package/src/lib/index.ts +1 -0
- package/src/mark/auto.ts +22 -0
- package/src/mark/index.ts +1 -0
- package/src/runtime/plot.ts +2 -2
- package/src/shape/index.ts +1 -1
- package/src/spec/index.ts +3 -3
- package/src/spec/mark.ts +4 -0
- package/src/utils/event.ts +32 -45
- package/dist/g2-lite.min.js +0 -1
package/dist/g2-lite.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G2={})}(this,(function(t){"use strict";var e="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},n=function(t,e){return n=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])},n(t,e)};function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var i=function(){return i=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},i.apply(this,arguments)};function o(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function a(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function s(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))}function c(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function l(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function f(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function d(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}"function"==typeof SuppressedError&&SuppressedError;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var h={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||t,a),c=n?n+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],s]:t._events[c].push(s):(t._events[c]=s,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(t){var e=n?n+t:t,r=this._events[e];return r?r.fn?1:r.length:0},s.prototype.emit=function(t,e,r,i,o,a){var s=n?n+t:t;if(!this._events[s])return!1;var c,l,u=this._events[s],f=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),f){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,r),!0;case 4:return u.fn.call(u.context,e,r,i),!0;case 5:return u.fn.call(u.context,e,r,i,o),!0;case 6:return u.fn.call(u.context,e,r,i,o,a),!0}for(l=1,c=new Array(f-1);l<f;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var d,h=u.length;for(l=0;l<h;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),f){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,r);break;case 4:u[l].fn.call(u[l].context,e,r,i);break;default:if(!c)for(d=1,c=new Array(f-1);d<f;d++)c[d-1]=arguments[d];u[l].fn.apply(u[l].context,c)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var c=0,l=[],u=s.length;c<u;c++)(s[c].fn!==e||i&&!s[c].once||r&&s[c].context!==r)&&l.push(s[c]);l.length?this._events[o]=1===l.length?l[0]:l:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&a(this,e)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}(h);var p=h.exports,g=1e-6,m="undefined"!=typeof Float32Array?Float32Array:Array;function v(){var t=new m(9);return m!=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 y=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],d=n[0],h=n[1],p=n[2],g=n[3],m=n[4],v=n[5],y=n[6],_=n[7],b=n[8];return t[0]=d*r+h*a+p*l,t[1]=d*i+h*s+p*u,t[2]=d*o+h*c+p*f,t[3]=g*r+m*a+v*l,t[4]=g*i+m*s+v*u,t[5]=g*o+m*c+v*f,t[6]=y*r+_*a+b*l,t[7]=y*i+_*s+b*u,t[8]=y*o+_*c+b*f,t};function _(){var t=new m(16);return m!=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 b(t){var e=new m(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 E(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 x(t,e,n,r,i,o,a,s,c,l,u,f,d,h,p,g){var v=new m(16);return v[0]=t,v[1]=e,v[2]=n,v[3]=r,v[4]=i,v[5]=o,v[6]=a,v[7]=s,v[8]=c,v[9]=l,v[10]=u,v[11]=f,v[12]=d,v[13]=h,v[14]=p,v[15]=g,v}function M(t,e,n,r,i,o,a,s,c,l,u,f,d,h,p,g,m){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=c,t[8]=l,t[9]=u,t[10]=f,t[11]=d,t[12]=h,t[13]=p,t[14]=g,t[15]=m,t}function S(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 A(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function T(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],d=e[10],h=e[11],p=e[12],g=e[13],m=e[14],v=e[15],y=n*s-r*a,_=n*c-i*a,b=n*l-o*a,E=r*c-i*s,x=r*l-o*s,M=i*l-o*c,S=u*g-f*p,A=u*m-d*p,T=u*v-h*p,O=f*m-d*g,R=f*v-h*g,P=d*v-h*m,C=y*P-_*R+b*O+E*T-x*A+M*S;return C?(C=1/C,t[0]=(s*P-c*R+l*O)*C,t[1]=(i*R-r*P-o*O)*C,t[2]=(g*M-m*x+v*E)*C,t[3]=(d*x-f*M-h*E)*C,t[4]=(c*T-a*P-l*A)*C,t[5]=(n*P-i*T+o*A)*C,t[6]=(m*b-p*M-v*_)*C,t[7]=(u*M-d*b+h*_)*C,t[8]=(a*R-s*T+l*S)*C,t[9]=(r*T-n*R-o*S)*C,t[10]=(p*x-g*b+v*y)*C,t[11]=(f*b-u*x-h*y)*C,t[12]=(s*A-a*O-c*S)*C,t[13]=(n*O-r*A+i*S)*C,t[14]=(g*_-p*E-m*y)*C,t[15]=(u*E-f*_+d*y)*C,t):null}function O(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],c=t[7],l=t[8],u=t[9],f=t[10],d=t[11],h=t[12],p=t[13],g=t[14],m=t[15];return(e*a-n*o)*(f*m-d*g)-(e*s-r*o)*(u*m-d*p)+(e*c-i*o)*(u*g-f*p)+(n*s-r*a)*(l*m-d*h)-(n*c-i*a)*(l*g-f*h)+(r*c-i*s)*(l*p-u*h)}function R(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],d=e[9],h=e[10],p=e[11],g=e[12],m=e[13],v=e[14],y=e[15],_=n[0],b=n[1],E=n[2],x=n[3];return t[0]=_*r+b*s+E*f+x*g,t[1]=_*i+b*c+E*d+x*m,t[2]=_*o+b*l+E*h+x*v,t[3]=_*a+b*u+E*p+x*y,_=n[4],b=n[5],E=n[6],x=n[7],t[4]=_*r+b*s+E*f+x*g,t[5]=_*i+b*c+E*d+x*m,t[6]=_*o+b*l+E*h+x*v,t[7]=_*a+b*u+E*p+x*y,_=n[8],b=n[9],E=n[10],x=n[11],t[8]=_*r+b*s+E*f+x*g,t[9]=_*i+b*c+E*d+x*m,t[10]=_*o+b*l+E*h+x*v,t[11]=_*a+b*u+E*p+x*y,_=n[12],b=n[13],E=n[14],x=n[15],t[12]=_*r+b*s+E*f+x*g,t[13]=_*i+b*c+E*d+x*m,t[14]=_*o+b*l+E*h+x*v,t[15]=_*a+b*u+E*p+x*y,t}function P(t,e,n){var r,i,o,a,s,c,l,u,f,d,h,p,g=n[0],m=n[1],v=n[2];return e===t?(t[12]=e[0]*g+e[4]*m+e[8]*v+e[12],t[13]=e[1]*g+e[5]*m+e[9]*v+e[13],t[14]=e[2]*g+e[6]*m+e[10]*v+e[14],t[15]=e[3]*g+e[7]*m+e[11]*v+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],d=e[9],h=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=f,t[9]=d,t[10]=h,t[11]=p,t[12]=r*g+s*m+f*v+e[12],t[13]=i*g+c*m+d*v+e[13],t[14]=o*g+l*m+h*v+e[14],t[15]=a*g+u*m+p*v+e[15]),t}function C(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function w(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],c=e[7],l=e[8],u=e[9],f=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+l*r,t[5]=a*i+u*r,t[6]=s*i+f*r,t[7]=c*i+d*r,t[8]=l*i-o*r,t[9]=u*i-a*r,t[10]=f*i-s*r,t[11]=d*i-c*r,t}function N(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],c=e[3],l=e[8],u=e[9],f=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-l*r,t[1]=a*i-u*r,t[2]=s*i-f*r,t[3]=c*i-d*r,t[8]=o*r+l*i,t[9]=a*r+u*i,t[10]=s*r+f*i,t[11]=c*r+d*i,t}function I(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 k(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 L(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,c=i+i,l=o+o,u=r*s,f=r*c,d=r*l,h=i*c,p=i*l,g=o*l,m=a*s,v=a*c,y=a*l;return t[0]=1-(h+g),t[1]=f+y,t[2]=d-v,t[3]=0,t[4]=f-y,t[5]=1-(u+g),t[6]=p+m,t[7]=0,t[8]=d+v,t[9]=p-m,t[10]=1-(u+h),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function D(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function B(t,e){var n=e[0],r=e[1],i=e[2],o=e[4],a=e[5],s=e[6],c=e[8],l=e[9],u=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(c,l,u),t}function F(t,e){var n=new m(3);B(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,s=e[1]*i,c=e[2]*o,l=e[4]*r,u=e[5]*i,f=e[6]*o,d=e[8]*r,h=e[9]*i,p=e[10]*o,g=a+u+p,v=0;return g>0?(v=2*Math.sqrt(g+1),t[3]=.25*v,t[0]=(f-h)/v,t[1]=(d-c)/v,t[2]=(s-l)/v):a>u&&a>p?(v=2*Math.sqrt(1+a-u-p),t[3]=(f-h)/v,t[0]=.25*v,t[1]=(s+l)/v,t[2]=(d+c)/v):u>p?(v=2*Math.sqrt(1+u-a-p),t[3]=(d-c)/v,t[0]=(s+l)/v,t[1]=.25*v,t[2]=(f+h)/v):(v=2*Math.sqrt(1+p-a-u),t[3]=(s-l)/v,t[0]=(d+c)/v,t[1]=(f+h)/v,t[2]=.25*v),t}function U(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],c=e[3],l=o+o,u=a+a,f=s+s,d=o*l,h=o*u,p=o*f,g=a*u,m=a*f,v=s*f,y=c*l,_=c*u,b=c*f,E=r[0],x=r[1],M=r[2],S=i[0],A=i[1],T=i[2],O=(1-(g+v))*E,R=(h+b)*E,P=(p-_)*E,C=(h-b)*x,w=(1-(d+v))*x,N=(m+y)*x,I=(p+_)*M,k=(m-y)*M,L=(1-(d+g))*M;return t[0]=O,t[1]=R,t[2]=P,t[3]=0,t[4]=C,t[5]=w,t[6]=N,t[7]=0,t[8]=I,t[9]=k,t[10]=L,t[11]=0,t[12]=n[0]+S-(O*S+C*A+I*T),t[13]=n[1]+A-(R*S+w*A+k*T),t[14]=n[2]+T-(P*S+N*A+L*T),t[15]=1,t}function j(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,c=i+i,l=n*a,u=r*a,f=r*s,d=i*a,h=i*s,p=i*c,g=o*a,m=o*s,v=o*c;return t[0]=1-f-p,t[1]=u+v,t[2]=d-m,t[3]=0,t[4]=u-v,t[5]=1-l-p,t[6]=h+g,t[7]=0,t[8]=d+m,t[9]=h-g,t[10]=1-l-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function G(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}var W=G;function z(t,e,n,r,i,o,a){var s=1/(e-n),c=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*c,t[14]=(a+o)*l,t[15]=1,t}var V=z;function H(t,e,n,r,i,o,a){var s=1/(e-n),c=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*c,t[14]=o*l,t[15]=1,t}function X(t,e,n,r){var i,o,a,s,c,l,u,f,d,h,p=e[0],m=e[1],v=e[2],y=r[0],_=r[1],b=r[2],E=n[0],x=n[1],M=n[2];return Math.abs(p-E)<g&&Math.abs(m-x)<g&&Math.abs(v-M)<g?S(t):(u=p-E,f=m-x,d=v-M,i=_*(d*=h=1/Math.hypot(u,f,d))-b*(f*=h),o=b*(u*=h)-y*d,a=y*f-_*u,(h=Math.hypot(i,o,a))?(i*=h=1/h,o*=h,a*=h):(i=0,o=0,a=0),s=f*a-d*o,c=d*i-u*a,l=u*o-f*i,(h=Math.hypot(s,c,l))?(s*=h=1/h,c*=h,l*=h):(s=0,c=0,l=0),t[0]=i,t[1]=s,t[2]=u,t[3]=0,t[4]=o,t[5]=c,t[6]=f,t[7]=0,t[8]=a,t[9]=l,t[10]=d,t[11]=0,t[12]=-(i*p+o*m+a*v),t[13]=-(s*p+c*m+l*v),t[14]=-(u*p+f*m+d*v),t[15]=1,t)}function Y(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 $=R,q=Y,K=Object.freeze({__proto__:null,create:_,clone:b,copy:E,fromValues:x,set:M,identity:S,transpose:A,invert:T,adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],d=e[10],h=e[11],p=e[12],g=e[13],m=e[14],v=e[15];return t[0]=s*(d*v-h*m)-f*(c*v-l*m)+g*(c*h-l*d),t[1]=-(r*(d*v-h*m)-f*(i*v-o*m)+g*(i*h-o*d)),t[2]=r*(c*v-l*m)-s*(i*v-o*m)+g*(i*l-o*c),t[3]=-(r*(c*h-l*d)-s*(i*h-o*d)+f*(i*l-o*c)),t[4]=-(a*(d*v-h*m)-u*(c*v-l*m)+p*(c*h-l*d)),t[5]=n*(d*v-h*m)-u*(i*v-o*m)+p*(i*h-o*d),t[6]=-(n*(c*v-l*m)-a*(i*v-o*m)+p*(i*l-o*c)),t[7]=n*(c*h-l*d)-a*(i*h-o*d)+u*(i*l-o*c),t[8]=a*(f*v-h*g)-u*(s*v-l*g)+p*(s*h-l*f),t[9]=-(n*(f*v-h*g)-u*(r*v-o*g)+p*(r*h-o*f)),t[10]=n*(s*v-l*g)-a*(r*v-o*g)+p*(r*l-o*s),t[11]=-(n*(s*h-l*f)-a*(r*h-o*f)+u*(r*l-o*s)),t[12]=-(a*(f*m-d*g)-u*(s*m-c*g)+p*(s*d-c*f)),t[13]=n*(f*m-d*g)-u*(r*m-i*g)+p*(r*d-i*f),t[14]=-(n*(s*m-c*g)-a*(r*m-i*g)+p*(r*c-i*s)),t[15]=n*(s*d-c*f)-a*(r*d-i*f)+u*(r*c-i*s),t},determinant:O,multiply:R,translate:P,scale:C,rotate:function(t,e,n,r){var i,o,a,s,c,l,u,f,d,h,p,m,v,y,_,b,E,x,M,S,A,T,O,R,P=r[0],C=r[1],w=r[2],N=Math.hypot(P,C,w);return N<g?null:(P*=N=1/N,C*=N,w*=N,i=Math.sin(n),a=1-(o=Math.cos(n)),s=e[0],c=e[1],l=e[2],u=e[3],f=e[4],d=e[5],h=e[6],p=e[7],m=e[8],v=e[9],y=e[10],_=e[11],b=P*P*a+o,E=C*P*a+w*i,x=w*P*a-C*i,M=P*C*a-w*i,S=C*C*a+o,A=w*C*a+P*i,T=P*w*a+C*i,O=C*w*a-P*i,R=w*w*a+o,t[0]=s*b+f*E+m*x,t[1]=c*b+d*E+v*x,t[2]=l*b+h*E+y*x,t[3]=u*b+p*E+_*x,t[4]=s*M+f*S+m*A,t[5]=c*M+d*S+v*A,t[6]=l*M+h*S+y*A,t[7]=u*M+p*S+_*A,t[8]=s*T+f*O+m*R,t[9]=c*T+d*O+v*R,t[10]=l*T+h*O+y*R,t[11]=u*T+p*O+_*R,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:w,rotateY:N,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],c=e[3],l=e[4],u=e[5],f=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+l*r,t[1]=a*i+u*r,t[2]=s*i+f*r,t[3]=c*i+d*r,t[4]=l*i-o*r,t[5]=u*i-a*r,t[6]=f*i-s*r,t[7]=d*i-c*r,t},fromTranslation:I,fromScaling:k,fromRotation:function(t,e,n){var r,i,o,a=n[0],s=n[1],c=n[2],l=Math.hypot(a,s,c);return l<g?null:(a*=l=1/l,s*=l,c*=l,r=Math.sin(e),o=1-(i=Math.cos(e)),t[0]=a*a*o+i,t[1]=s*a*o+c*r,t[2]=c*a*o-s*r,t[3]=0,t[4]=a*s*o-c*r,t[5]=s*s*o+i,t[6]=c*s*o+a*r,t[7]=0,t[8]=a*c*o+s*r,t[9]=s*c*o-a*r,t[10]=c*c*o+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},fromXRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromYRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromZRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotationTranslation:L,fromQuat2:function(t,e){var n=new m(3),r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=r*r+i*i+o*o+a*a;return f>0?(n[0]=2*(s*a+u*r+c*o-l*i)/f,n[1]=2*(c*a+u*i+l*r-s*o)/f,n[2]=2*(l*a+u*o+s*i-c*r)/f):(n[0]=2*(s*a+u*r+c*o-l*i),n[1]=2*(c*a+u*i+l*r-s*o),n[2]=2*(l*a+u*o+s*i-c*r)),L(t,e,n),t},getTranslation:D,getScaling:B,getRotation:F,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],c=i+i,l=o+o,u=a+a,f=i*c,d=i*l,h=i*u,p=o*l,g=o*u,m=a*u,v=s*c,y=s*l,_=s*u,b=r[0],E=r[1],x=r[2];return t[0]=(1-(p+m))*b,t[1]=(d+_)*b,t[2]=(h-y)*b,t[3]=0,t[4]=(d-_)*E,t[5]=(1-(f+m))*E,t[6]=(g+v)*E,t[7]=0,t[8]=(h+y)*x,t[9]=(g-v)*x,t[10]=(1-(f+p))*x,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:U,fromQuat:j,frustum:function(t,e,n,r,i,o,a){var s=1/(n-e),c=1/(i-r),l=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*c,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*c,t[10]=(a+o)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*l,t[15]=0,t},perspectiveNO:G,perspective:W,perspectiveZO:function(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=i*o,t[14]=i*r*o):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),c=2/(a+s),l=2/(i+o);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(a-s)*c*.5,t[9]=(i-o)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},orthoNO:z,ortho:V,orthoZO:H,lookAt:X,targetTo:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],c=r[1],l=r[2],u=i-n[0],f=o-n[1],d=a-n[2],h=u*u+f*f+d*d;h>0&&(u*=h=1/Math.sqrt(h),f*=h,d*=h);var p=c*d-l*f,g=l*u-s*d,m=s*f-c*u;return(h=p*p+g*g+m*m)>0&&(p*=h=1/Math.sqrt(h),g*=h,m*=h),t[0]=p,t[1]=g,t[2]=m,t[3]=0,t[4]=f*m-d*g,t[5]=d*p-u*m,t[6]=u*g-f*p,t[7]=0,t[8]=u,t[9]=f,t[10]=d,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t},str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},subtract:Y,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},equals:function(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],c=t[6],l=t[7],u=t[8],f=t[9],d=t[10],h=t[11],p=t[12],m=t[13],v=t[14],y=t[15],_=e[0],b=e[1],E=e[2],x=e[3],M=e[4],S=e[5],A=e[6],T=e[7],O=e[8],R=e[9],P=e[10],C=e[11],w=e[12],N=e[13],I=e[14],k=e[15];return Math.abs(n-_)<=g*Math.max(1,Math.abs(n),Math.abs(_))&&Math.abs(r-b)<=g*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-E)<=g*Math.max(1,Math.abs(i),Math.abs(E))&&Math.abs(o-x)<=g*Math.max(1,Math.abs(o),Math.abs(x))&&Math.abs(a-M)<=g*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(s-S)<=g*Math.max(1,Math.abs(s),Math.abs(S))&&Math.abs(c-A)<=g*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(l-T)<=g*Math.max(1,Math.abs(l),Math.abs(T))&&Math.abs(u-O)<=g*Math.max(1,Math.abs(u),Math.abs(O))&&Math.abs(f-R)<=g*Math.max(1,Math.abs(f),Math.abs(R))&&Math.abs(d-P)<=g*Math.max(1,Math.abs(d),Math.abs(P))&&Math.abs(h-C)<=g*Math.max(1,Math.abs(h),Math.abs(C))&&Math.abs(p-w)<=g*Math.max(1,Math.abs(p),Math.abs(w))&&Math.abs(m-N)<=g*Math.max(1,Math.abs(m),Math.abs(N))&&Math.abs(v-I)<=g*Math.max(1,Math.abs(v),Math.abs(I))&&Math.abs(y-k)<=g*Math.max(1,Math.abs(y),Math.abs(k))},mul:$,sub:q});function Z(){var t=new m(3);return m!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Q(t){var e=new m(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function J(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function tt(t,e,n){var r=new m(3);return r[0]=t,r[1]=e,r[2]=n,r}function et(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 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[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function ot(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function at(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function st(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ct(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],c=n[2];return t[0]=i*c-o*s,t[1]=o*a-r*c,t[2]=r*s-i*a,t}function lt(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function ut(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function ft(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}function dt(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(n-o)<=g*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=g*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=g*Math.max(1,Math.abs(i),Math.abs(s))}var ht=it,pt=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)},gt=J;function mt(){var t=new m(4);return m!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function vt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}function yt(){var t=new m(4);return m!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function _t(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 bt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],c=n[1],l=n[2],u=n[3];return t[0]=r*u+a*s+i*l-o*c,t[1]=i*u+a*c+o*s-r*l,t[2]=o*u+a*l+r*c-i*s,t[3]=a*u-r*s-i*c-o*l,t}function Et(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function xt(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(n),c=Math.cos(n),l=Math.sin(r),u=Math.cos(r);return t[0]=o*c*u-a*s*l,t[1]=a*s*u+o*c*l,t[2]=a*c*l-o*s*u,t[3]=a*c*u+o*s*l,t}Z(),function(){var t=mt()}();var Mt=function(t,e,n,r){var i=new m(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},St=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},At=bt,Tt=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t};Z(),tt(1,0,0),tt(0,1,0),yt(),yt(),v(),function(){var t,e=(t=new m(2),m!=Float32Array&&(t[0]=0,t[1]=0),t)}();var Ot={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function Rt(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Pt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Ct(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Pt[e]===t.length-1&&"achlmqstvz".includes(e)}))}function wt(t){return Ct(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function Nt(t){return wt(t)&&t.every((function(t){var e=t[0];return"ACLMQZ".includes(e)}))}function It(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=Pt[n]&&("m"===n&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,Pt[n]))),Pt[n]););}function kt(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'+n[e]+'", expecting 0 or 1 at index '+e)}function Lt(t){return t>=48&&t<=57||43===t||45===t||46===t}function Dt(t){return t>=48&&t<=57}function Bt(t){var e,n=t.max,r=t.pathValue,i=t.index,o=i,a=!1,s=!1,c=!1,l=!1;if(o>=n)t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param';else if(43!==(e=r.charCodeAt(o))&&45!==e||(o+=1,e=r.charCodeAt(o)),Dt(e)||46===e){if(46!==e){if(a=48===e,o+=1,e=r.charCodeAt(o),a&&o<n&&e&&Dt(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;o<n&&Dt(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(l=!0,o+=1;Dt(r.charCodeAt(o));)o+=1,c=!0;e=r.charCodeAt(o)}if(101===e||69===e){if(l&&!s&&!c)return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid float exponent');if(o+=1,43!==(e=r.charCodeAt(o))&&45!==e||(o+=1),!(o<n&&Dt(r.charCodeAt(o))))return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid integer exponent');for(;o<n&&Dt(r.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(i,o)}else t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" is not a number'}function Ft(t){return 10===t||13===t||8232===t||8233===t||32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(t)}function Ut(t){for(var e=t.pathValue,n=t.max;t.index<n&&Ft(e.charCodeAt(t.index));)t.index+=1}function jt(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=Pt[n[r].toLowerCase()];if(t.segmentStart=r,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,Ut(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?Bt(t):kt(t),t.err.length)return;t.data.push(t.param),Ut(t),t.index<e&&44===n.charCodeAt(t.index)&&(t.index+=1,Ut(t))}if(t.index>=t.max)break;if(!Lt(n.charCodeAt(t.index)))break}It(t)}else It(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var Gt=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 Wt(t){if(wt(t))return[].concat(t);var e=function(t){if(Ct(t))return[].concat(t);var e=new Gt(t);for(Ut(e);e.index<e.max&&!e.err.length;)jt(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,o=0;return e.map((function(t){var e,a=t.slice(1).map(Number),s=t[0],c=s.toUpperCase();if("M"===s)return n=a[0],r=a[1],i=n,o=r,["M",n,r];if(s!==c)switch(c){case"A":e=[c,a[0],a[1],a[2],a[3],a[4],a[5]+n,a[6]+r];break;case"V":e=[c,a[0]+r];break;case"H":e=[c,a[0]+n];break;default:var l=a.map((function(t,e){return t+(e%2?r:n)}));e=[c].concat(l)}else e=[c].concat(a);var u=e.length;switch(c){case"Z":n=i,r=o;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[u-2],r=e[u-1],"M"===c&&(i=n,o=r)}return e}))}function zt(t,e){var n=t[0],r=e.x1,i=e.y1,o=e.x2,a=e.y2,s=t.slice(1).map(Number),c=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)c=["L",t[1],i];else if("V"===n)c=["L",r,t[1]];else if("S"===n){var l=2*r-o,u=2*i-a;e.x1=l,e.y1=u,c=["C",l,u].concat(s)}else if("T"===n){var f=2*r-e.qx,d=2*i-e.qy;e.qx=f,e.qy=d,c=["Q",f,d].concat(s)}else if("Q"===n){var h=s[0],p=s[1];e.qx=h,e.qy=p}return c}function Vt(t){if(Nt(t))return[].concat(t);for(var e=Wt(t),n=i({},Ot),r=0;r<e.length;r+=1){e[r]=zt(e[r],n);var o=e[r],a=o.length;n.x1=+o[a-2],n.y1=+o[a-1],n.x2=+o[a-4]||n.x1,n.y2=+o[a-3]||n.y1}return e}function Ht(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function Xt(t,e,n,r,i,o,a,s,c,l){var u,f,d,h,p,g=t,m=e,v=n,y=r,_=s,b=c,E=120*Math.PI/180,x=Math.PI/180*(+i||0),M=[];if(l)f=l[0],d=l[1],h=l[2],p=l[3];else{g=(u=Ht(g,m,-x)).x,m=u.y;var S=(g-(_=(u=Ht(_,b,-x)).x))/2,A=(m-(b=u.y))/2,T=S*S/(v*v)+A*A/(y*y);T>1&&(v*=T=Math.sqrt(T),y*=T);var O=v*v,R=y*y,P=(o===a?-1:1)*Math.sqrt(Math.abs((O*R-O*A*A-R*S*S)/(O*A*A+R*S*S)));h=P*v*A/y+(g+_)/2,p=P*-y*S/v+(m+b)/2,f=Math.asin(((m-p)/y*Math.pow(10,9)>>0)/Math.pow(10,9)),d=Math.asin(((b-p)/y*Math.pow(10,9)>>0)/Math.pow(10,9)),f=g<h?Math.PI-f:f,d=_<h?Math.PI-d:d,f<0&&(f=2*Math.PI+f),d<0&&(d=2*Math.PI+d),a&&f>d&&(f-=2*Math.PI),!a&&d>f&&(d-=2*Math.PI)}var C=d-f;if(Math.abs(C)>E){var w=d,N=_,I=b;d=f+E*(a&&d>f?1:-1),M=Xt(_=h+v*Math.cos(d),b=p+y*Math.sin(d),v,y,i,0,a,N,I,[d,w,h,p])}C=d-f;var k=Math.cos(f),L=Math.sin(f),D=Math.cos(d),B=Math.sin(d),F=Math.tan(C/4),U=4/3*v*F,j=4/3*y*F,G=[g,m],W=[g+U*L,m-j*k],z=[_+U*B,b-j*D],V=[_,b];if(W[0]=2*G[0]-W[0],W[1]=2*G[1]-W[1],l)return W.concat(z,V,M);for(var H=[],X=0,Y=(M=W.concat(z,V,M)).length;X<Y;X+=1)H[X]=X%2?Ht(M[X-1],M[X],x).y:Ht(M[X],M[X+1],x).x;return H}function Yt(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}var $t=function(t,e,n,r){return f(f([],Yt([t,e],[n,r],.5),!0),[n,r,n,r],!1)};function qt(t,e){var n,r=t[0],i=t.slice(1).map(Number),o=i[0],a=i[1],s=e.x1,c=e.y1,l=e.x,u=e.y;switch("TQ".includes(r)||(e.qx=null,e.qy=null),r){case"M":return e.x=o,e.y=a,t;case"A":return n=[s,c].concat(i),["C"].concat(Xt(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=o,e.qy=a,n=[s,c].concat(i),["C"].concat(function(t,e,n,r,i,o){var a=1/3,s=2/3;return[a*t+s*n,a*e+s*r,a*i+s*n,a*o+s*r,i,o]}(n[0],n[1],n[2],n[3],n[4],n[5]));case"L":return["C"].concat($t(s,c,o,a));case"Z":return s===l&&c===u?["C",s,c,l,u,l,u]:["C"].concat($t(s,c,l,u))}return t}function Kt(t,e){if(void 0===e&&(e=!1),function(t){return Nt(t)&&t.every((function(t){var e=t[0];return"MC".includes(e)}))}(t)){var n=[].concat(t);return e?[n,[]]:n}for(var r,o,a=Vt(t),s=i({},Ot),c=[],l="",u=a.length,f=[],d=0;d<u;d+=1){a[d]&&(l=a[d][0]),c[d]=l;var h=qt(a[d],s);a[d]=h,Rt(a,c,d),u=a.length,"Z"===l&&f.push(d),o=(r=a[d]).length,s.x1=+r[o-2],s.y1=+r[o-1],s.x2=+r[o-4]||s.x1,s.y2=+r[o-3]||s.y1}return e?[a,f]:a}function Zt(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Qt(t,e,n,r,i){var o=Zt([t,e],[n,r]),a={x:0,y:0};if("number"==typeof i)if(i<=0)a={x:t,y:e};else if(i>=o)a={x:n,y:r};else{var s=Yt([t,e],[n,r],i/o);a={x:s[0],y:s[1]}}return{length:o,point:a,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function Jt(t,e){var n=t.x,r=t.y,i=e.x,o=e.y,a=n*i+r*o,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2)));return(n*o-r*i<0?-1:1)*Math.acos(a/s)}function te(t,e,n,r,i,o,a,s,c,l){var u=Math.abs,f=Math.sin,d=Math.cos,h=Math.sqrt,p=Math.PI,g=u(n),m=u(r),v=(i%360+360)%360*(p/180);if(t===s&&e===c)return{x:t,y:e};if(0===g||0===m)return Qt(t,e,s,c,l).point;var y=(t-s)/2,_=(e-c)/2,b={x:d(v)*y+f(v)*_,y:-f(v)*y+d(v)*_},E=Math.pow(b.x,2)/Math.pow(g,2)+Math.pow(b.y,2)/Math.pow(m,2);E>1&&(g*=h(E),m*=h(E));var x=(Math.pow(g,2)*Math.pow(m,2)-Math.pow(g,2)*Math.pow(b.y,2)-Math.pow(m,2)*Math.pow(b.x,2))/(Math.pow(g,2)*Math.pow(b.y,2)+Math.pow(m,2)*Math.pow(b.x,2)),M=(o!==a?1:-1)*h(x=x<0?0:x),S=M*(g*b.y/m),A=M*(-m*b.x/g),T=d(v)*S-f(v)*A+(t+s)/2,O=f(v)*S+d(v)*A+(e+c)/2,R={x:(b.x-S)/g,y:(b.y-A)/m},P=Jt({x:1,y:0},R),C=Jt(R,{x:(-b.x-S)/g,y:(-b.y-A)/m});!a&&C>0?C-=2*p:a&&C<0&&(C+=2*p);var w=P+(C%=2*p)*l,N=g*d(w),I=m*f(w);return{x:d(v)*N-f(v)*I+T,y:f(v)*N+d(v)*I+O}}function ee(t,e,n,r,i,o,a,s,c,l,u){var f,d=u.bbox,h=void 0===d||d,p=u.length,g=void 0===p||p,m=u.sampleSize,v=void 0===m?30:m,y="number"==typeof l,_=t,b=e,E=0,x=[_,b,E],M=[_,b],S={x:0,y:0},A=[{x:_,y:b}];y&&l<=0&&(S={x:_,y:b});for(var T=0;T<=v;T+=1){if(_=(f=te(t,e,n,r,i,o,a,s,c,T/v)).x,b=f.y,h&&A.push({x:_,y:b}),g&&(E+=Zt(M,[_,b])),M=[_,b],y&&E>=l&&l>x[2]){var O=(E-l)/(E-x[2]);S={x:M[0]*(1-O)+x[0]*O,y:M[1]*(1-O)+x[1]*O}}x=[_,b,E]}return y&&l>=E&&(S={x:s,y:c}),{length:E,point:S,min:{x:Math.min.apply(null,A.map((function(t){return t.x}))),y:Math.min.apply(null,A.map((function(t){return t.y})))},max:{x:Math.max.apply(null,A.map((function(t){return t.x}))),y:Math.max.apply(null,A.map((function(t){return t.y})))}}}function ne(t,e,n,r,i,o,a,s,c){var l=1-c;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*c*n+3*l*Math.pow(c,2)*i+Math.pow(c,3)*a,y:Math.pow(l,3)*e+3*Math.pow(l,2)*c*r+3*l*Math.pow(c,2)*o+Math.pow(c,3)*s}}function re(t,e,n,r,i,o,a,s,c,l){var u,f=l.bbox,d=void 0===f||f,h=l.length,p=void 0===h||h,g=l.sampleSize,m=void 0===g?10:g,v="number"==typeof c,y=t,_=e,b=0,E=[y,_,b],x=[y,_],M={x:0,y:0},S=[{x:y,y:_}];v&&c<=0&&(M={x:y,y:_});for(var A=0;A<=m;A+=1){if(y=(u=ne(t,e,n,r,i,o,a,s,A/m)).x,_=u.y,d&&S.push({x:y,y:_}),p&&(b+=Zt(x,[y,_])),x=[y,_],v&&b>=c&&c>E[2]){var T=(b-c)/(b-E[2]);M={x:x[0]*(1-T)+E[0]*T,y:x[1]*(1-T)+E[1]*T}}E=[y,_,b]}return v&&c>=b&&(M={x:a,y:s}),{length:b,point:M,min:{x:Math.min.apply(null,S.map((function(t){return t.x}))),y:Math.min.apply(null,S.map((function(t){return t.y})))},max:{x:Math.max.apply(null,S.map((function(t){return t.x}))),y:Math.max.apply(null,S.map((function(t){return t.y})))}}}function ie(t,e,n,r,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*n+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*r+Math.pow(a,2)*o}}function oe(t,e,n,r,i,o,a,s){var c,l=s.bbox,u=void 0===l||l,f=s.length,d=void 0===f||f,h=s.sampleSize,p=void 0===h?10:h,g="number"==typeof a,m=t,v=e,y=0,_=[m,v,y],b=[m,v],E={x:0,y:0},x=[{x:m,y:v}];g&&a<=0&&(E={x:m,y:v});for(var M=0;M<=p;M+=1){if(m=(c=ie(t,e,n,r,i,o,M/p)).x,v=c.y,u&&x.push({x:m,y:v}),d&&(y+=Zt(b,[m,v])),b=[m,v],g&&y>=a&&a>_[2]){var S=(y-a)/(y-_[2]);E={x:b[0]*(1-S)+_[0]*S,y:b[1]*(1-S)+_[1]*S}}_=[m,v,y]}return g&&a>=y&&(E={x:i,y:o}),{length:y,point:E,min:{x:Math.min.apply(null,x.map((function(t){return t.x}))),y:Math.min.apply(null,x.map((function(t){return t.y})))},max:{x:Math.max.apply(null,x.map((function(t){return t.x}))),y:Math.max.apply(null,x.map((function(t){return t.y})))}}}function ae(t,e,n){for(var r,i,o,a,s,c,l,u,f,d=Vt(t),h="number"==typeof e,p=[],g=0,m=0,v=0,y=0,_=[],b=[],E=0,x={x:0,y:0},M=x,S=x,A=x,T=0,O=0,R=d.length;O<R;O+=1)p=(l="M"===(u=(f=d[O])[0]))?p:[g,m].concat(f.slice(1)),l?(M=x={x:v=f[1],y:y=f[2]},E=0,h&&e<.001&&(A=x)):"L"===u?(E=(r=Qt(p[0],p[1],p[2],p[3],(e||0)-T)).length,x=r.min,M=r.max,S=r.point):"A"===u?(E=(i=ee(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],(e||0)-T,n||{})).length,x=i.min,M=i.max,S=i.point):"C"===u?(E=(o=re(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],(e||0)-T,n||{})).length,x=o.min,M=o.max,S=o.point):"Q"===u?(E=(a=oe(p[0],p[1],p[2],p[3],p[4],p[5],(e||0)-T,n||{})).length,x=a.min,M=a.max,S=a.point):"Z"===u&&(E=(s=Qt((p=[g,m,v,y])[0],p[1],p[2],p[3],(e||0)-T)).length,x=s.min,M=s.max,S=s.point),h&&T<e&&T+E>=e&&(A=S),b.push(M),_.push(x),T+=E,g=(c="Z"!==u?f.slice(-2):[v,y])[0],m=c[1];return h&&e>=T&&(A={x:g,y:m}),{length:T,point:A,min:{x:Math.min.apply(null,_.map((function(t){return t.x}))),y:Math.min.apply(null,_.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){var n=t.length-1,r=[],i=0,o=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,o){var a,s=i+o;return 0===o||t[s]&&"M"===t[s][0]?(a=t[s],["M"].concat(a.slice(-2))):(s>=e&&(s-=n),t[s])}))}))}(t);return o.forEach((function(o,a){t.slice(1).forEach((function(r,o){i+=Zt(t[(a+o)%n].slice(-2),e[o%n].slice(-2))})),r[a]=i,i=0})),o[r.indexOf(Math.min.apply(null,r))]}function ce(t){return function(t){var e=0,n=0,r=0;return Kt(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var o=t.slice(1),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=o[5];return r=function(t,e,n,r,i,o,a,s){return 3*((s-e)*(n+i)-(a-t)*(r+o)+r*(t-i)-n*(e-o)+s*(i+t/3)-a*(o+e/3))/20}(e,n,a,s,c,l,u,f),i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}(t)>=0}function le(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?re(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=Yt(n,r,e),s=Yt(r,i,e),c=Yt(i,o,e),l=Yt(a,s,e),u=Yt(s,c,e),f=Yt(l,u,e);return[["C"].concat(a,l,f),["C"].concat(u,c,o)]}(r):[t,t]:[t],l:i}}))}function ue(t,e,n){var r=le(t),i=le(e),o=r.length,a=i.length,s=r.filter((function(t){return t.l})).length,c=i.filter((function(t){return t.l})).length,l=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,u=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/c||0,f=n||Math.max(o,a),d=[l,u],h=[f-o,f-a],p=0,g=[r,i].map((function(t,e){return t.l===f?t.map((function(t){return t.s})):t.map((function(t,n){return p=n&&h[e]&&t.l>=d[e],h[e]-=p?1:0,p?t.ss:[t.s]})).flat()}));return g[0].length===g[1].length?g:ue(g[0],g[1],f)}var fe=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},de=function(t){return"function"==typeof t},he=function(t){return null==t},pe={}.toString,ge=function(t,e){return pe.call(t)==="[object "+e+"]"},me=function(t){return Array.isArray?Array.isArray(t):ge(t,"Array")},ve=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e};var ye=function(t){return"object"==typeof t&&null!==t},_e=function(t){if(!ye(t)||!ge(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(me(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},Ee=function(t){if(me(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},xe=function(t,e,n){if(!me(t)&&!_e(t))return t;var r=n;return function(t,e){if(t)if(me(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(ve(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break}(t,(function(t,n){r=e(r,t,n)})),r},Me=function(t){return ge(t,"String")};var Se=function(t,e,n){return t<e?e:t>n?n:t},Ae=function(t){return ge(t,"Number")},Te=1e-5;function Oe(t,e,n){return void 0===n&&(n=Te),Math.abs(t-e)<n}var Re=function(t,e){if(me(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var o=t[i],a=de(e)?e(o):o[e];a>r&&(n=o,r=a)}return n}},Pe=function(t,e){if(me(t)){for(var n,r=1/0,i=0;i<t.length;i++){var o=t[i],a=de(e)?e(o):o[e];a<r&&(n=o,r=a)}return n}},Ce=function(t,e){return(t%e+e)%e},we=function(t){return he(t)?"":t.toString()},Ne=function(t){var e=we(t);return e.charAt(0).toLowerCase()+e.substring(1)};var Ie=function(t){var e=we(t);return e.charAt(0).toUpperCase()+e.substring(1)},ke=function(t){return ge(t,"Boolean")},Le=function(t){return void 0===t},De=function(t){if("object"!=typeof t||null===t)return t;var e;if(me(t)){e=[];for(var n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=De(t[n]):e[n]=t[n]}else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=De(t[i]):e[i]=t[i];return e},Be=De;function Fe(t,e,n){var r;return function(){var i=this,o=arguments,a=n&&!r;clearTimeout(r),r=setTimeout((function(){r=null,n||t.apply(i,o)}),e),a&&t.apply(i,o)}}var Ue=function(t,e){if(!de(t))throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return a.set(o,s),s};return n.cache=new Map,n};function je(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(null==t)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function Ge(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(je(e,i)){var o=e[i];null!==o&&_e(o)?(_e(t[i])||(t[i]={}),n<r?Ge(t[i],o,n+1,r):t[i]=e[i]):me(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var We=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)Ge(t,e[r]);return t},ze=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(Me(t)||Me(e))return!1;if(fe(t)||fe(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=ze(t[r],e[r]));r++);return n}if(ye(t)||ye(e)){var i=Object.keys(t),o=Object.keys(e);if(i.length!==o.length)return!1;for(n=!0,r=0;r<i.length&&(n=ze(t[i[r]],e[i[r]]));r++);return n}return!1},Ve=ze,He=function(t,e,n){for(var r=0,i=Me(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},Xe=function(t,e){return xe(t,(function(t,n,r){return e.includes(r)||(t[r]=n),t}),{})},Ye=function(t,e,n){var r,i,o,a,s=0;n||(n={});var c=function(){s=!1===n.leading?0:Date.now(),r=null,a=t.apply(i,o),r||(i=o=null)},l=function(){var l=Date.now();s||!1!==n.leading||(s=l);var u=e-(l-s);return i=this,o=arguments,u<=0||u>e?(r&&(clearTimeout(r),r=null),s=l,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(c,u)),a};return l.cancel=function(){clearTimeout(r),s=0,r=i=o=null},l},$e=function(){};function qe(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Ke(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Ze(){}var Qe=.7,Je=1/Qe,tn="\\s*([+-]?\\d+)\\s*",en="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",nn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",rn=/^#([0-9a-f]{3,8})$/,on=new RegExp("^rgb\\("+[tn,tn,tn]+"\\)$"),an=new RegExp("^rgb\\("+[nn,nn,nn]+"\\)$"),sn=new RegExp("^rgba\\("+[tn,tn,tn,en]+"\\)$"),cn=new RegExp("^rgba\\("+[nn,nn,nn,en]+"\\)$"),ln=new RegExp("^hsl\\("+[en,nn,nn]+"\\)$"),un=new RegExp("^hsla\\("+[en,nn,nn,en]+"\\)$"),fn={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 dn(){return this.rgb().formatHex()}function hn(){return this.rgb().formatRgb()}function pn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=rn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?gn(e):3===n?new vn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?mn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?mn(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=on.exec(t))?new vn(e[1],e[2],e[3],1):(e=an.exec(t))?new vn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=sn.exec(t))?mn(e[1],e[2],e[3],e[4]):(e=cn.exec(t))?mn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=ln.exec(t))?En(e[1],e[2]/100,e[3]/100,1):(e=un.exec(t))?En(e[1],e[2]/100,e[3]/100,e[4]):fn.hasOwnProperty(t)?gn(fn[t]):"transparent"===t?new vn(NaN,NaN,NaN,0):null}function gn(t){return new vn(t>>16&255,t>>8&255,255&t,1)}function mn(t,e,n,r){return r<=0&&(t=e=n=NaN),new vn(t,e,n,r)}function vn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function yn(){return"#"+bn(this.r)+bn(this.g)+bn(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 bn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function En(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Mn(t,e,n,r)}function xn(t){if(t instanceof Mn)return new Mn(t.h,t.s,t.l,t.opacity);if(t instanceof Ze||(t=pn(t)),!t)return new Mn;if(t instanceof Mn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,c=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=c<.5?o+i:2-o-i,a*=60):s=c>0&&c<1?0:a,new Mn(a,s,c,t.opacity)}function Mn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Sn(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 An(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function Tn(t,e){var n=Math.min.apply(Math,f([],u(t),!1)),r=Math.min.apply(Math,f([],u(e),!1));return{x:n,y:r,width:Math.max.apply(Math,f([],u(t),!1))-n,height:Math.max.apply(Math,f([],u(e),!1))-r}}function On(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function Rn(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function Pn(t,e,n,r,i,o,a){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),c=1/0,l=-1/0,u=[o,a],f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var d=s+f;o<a?o<d&&d<a&&u.push(d):a<d&&d<o&&u.push(d)}for(f=0;f<u.length;f++){var h=On(t,0,n,r,i,u[f]);h<c&&(c=h),h>l&&(l=h)}var p=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),g=1/0,m=-1/0,v=[o,a];for(f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var y=p+f;o<a?o<y&&y<a&&v.push(y):a<y&&y<o&&v.push(y)}for(f=0;f<v.length;f++){var _=Rn(0,e,n,r,i,v[f]);_<g&&(g=_),_>m&&(m=_)}return{x:c,y:g,width:l-c,height:m-g}}qe(Ze,pn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:dn,formatHex:dn,formatHsl:function(){return xn(this).formatHsl()},formatRgb:hn,toString:hn}),qe(vn,(function(t,e,n,r){return 1===arguments.length?((i=t)instanceof Ze||(i=pn(i)),i?new vn((i=i.rgb()).r,i.g,i.b,i.opacity):new vn):new vn(t,e,n,null==r?1:r);var i}),Ke(Ze,{brighter:function(t){return t=null==t?Je:Math.pow(Je,t),new vn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?Qe:Math.pow(Qe,t),new vn(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:yn,formatHex:yn,formatRgb:_n,toString:_n})),qe(Mn,(function(t,e,n,r){return 1===arguments.length?xn(t):new Mn(t,e,n,null==r?1:r)}),Ke(Ze,{brighter:function(t){return t=null==t?Je:Math.pow(Je,t),new Mn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Qe:Math.pow(Qe,t),new Mn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new vn(Sn(t>=240?t-240:t+120,i,r),Sn(t,i,r),Sn(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Cn=1e-4;function wn(t,e,n,r,i,o){var a=-1,s=1/0,c=[n,r],l=20;o&&o>200&&(l=o/10);for(var d=1/l,h=d/10,p=0;p<=l;p++){var g=p*d,m=[i.apply(void 0,f([],u(t.concat([g])),!1)),i.apply(void 0,f([],u(e.concat([g])),!1))];(b=An(c[0],c[1],m[0],m[1]))<s&&(a=g,s=b)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var v=t.length;return{x:t[v-1],y:e[v-1]}}s=1/0;for(p=0;p<32&&!(h<Cn);p++){var y=a-h,_=a+h,b=(m=[i.apply(void 0,f([],u(t.concat([y])),!1)),i.apply(void 0,f([],u(e.concat([y])),!1))],An(c[0],c[1],m[0],m[1]));if(y>=0&&b<s)a=y,s=b;else{var E=[i.apply(void 0,f([],u(t.concat([_])),!1)),i.apply(void 0,f([],u(e.concat([_])),!1))],x=An(c[0],c[1],E[0],E[1]);_<=1&&x<s?(a=_,s=x):h*=.5}}return{x:i.apply(void 0,f([],u(t.concat([a])),!1)),y:i.apply(void 0,f([],u(e.concat([a])),!1))}}function Nn(t,e,n,r){return An(t,e,n,r)}function In(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function kn(t,e,n,r,i,o){var a=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];!function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s);var c=[i-t,o-e];return Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}(c,s))}function Ln(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function Dn(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,c=6*t-12*e+6*n,l=3*e-3*t,u=[];if(Oe(s,0))Oe(c,0)||(i=-l/c)>=0&&i<=1&&u.push(i);else{var f=c*c-4*s*l;Oe(f,0)?u.push(-c/(2*s)):f>0&&(o=(-c-(a=Math.sqrt(f)))/(2*s),(i=(-c+a)/(2*s))>=0&&i<=1&&u.push(i),o>=0&&o<=1&&u.push(o))}return u}function Bn(t,e,n,r,i,o,a,s,c){if(0===c)return function(t,e){for(var n=0,r=t.length,i=0;i<r;i++)n+=An(t[i],e[i],t[(i+1)%r],e[(i+1)%r]);return n/2}([t,n,i,a],[e,r,o,s]);var l=function(t,e,n,r,i,o,a,s,c){var l=Ln(t,n,i,a,c),u=Ln(e,r,o,s,c),f=In(t,e,n,r,c),d=In(n,r,i,o,c),h=In(i,o,a,s,c),p=In(f.x,f.y,d.x,d.y,c),g=In(d.x,d.y,h.x,h.y,c);return[[t,e,f.x,f.y,p.x,p.y,l,u],[l,u,g.x,g.y,h.x,h.y,a,s]]}(t,e,n,r,i,o,a,s,.5),d=f(f([],u(l[0]),!1),[c-1],!1),h=f(f([],u(l[1]),!1),[c-1],!1);return Bn.apply(void 0,f([],u(d),!1))+Bn.apply(void 0,f([],u(h),!1))}function Fn(t,e,n,r,i,o,a,s){for(var c=[t,a],l=[e,s],u=Dn(t,n,i,a),f=Dn(e,r,o,s),d=0;d<u.length;d++)c.push(Ln(t,n,i,a,u[d]));for(d=0;d<f.length;d++)l.push(Ln(e,r,o,s,f[d]));return Tn(c,l)}function Un(t,e,n,r,i,o,a,s,c,l,u){var f=function(t,e,n,r,i,o,a,s,c,l,u){return wn([t,n,i,a],[e,r,o,s],c,l,Ln,u)}(t,e,n,r,i,o,a,s,c,l,u);return An(f.x,f.y,c,l)}function jn(t){return function(t){if(t.length<2)return 0;for(var e=0,n=0;n<t.length-1;n++){var r=t[n],i=t[n+1];e+=An(r[0],r[1],i[0],i[1])}return e}(t)}function Gn(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Wn(t,e,n){var r=t+n-2*e;if(Oe(r,0))return[.5];var i=(t-e)/r;return i<=1&&i>=0?[i]:[]}function zn(t,e,n,r,i,o,a){if(0===a)return(An(t,e,n,r)+An(n,r,i,o)+An(t,e,i,o))/2;var s=function(t,e,n,r,i,o,a){var s=Gn(t,n,i,a),c=Gn(e,r,o,a),l=In(t,e,n,r,a),u=In(n,r,i,o,a);return[[t,e,l.x,l.y,s,c],[s,c,u.x,u.y,i,o]]}(t,e,n,r,i,o,.5),c=s[0],l=s[1];return c.push(a-1),l.push(a-1),zn.apply(void 0,f([],u(c),!1))+zn.apply(void 0,f([],u(l),!1))}function Vn(t,e,n,r,i,o){var a=Wn(t,n,i)[0],s=Wn(e,r,o)[0],c=[t,i],l=[e,o];return void 0!==a&&c.push(Gn(t,n,i,a)),void 0!==s&&l.push(Gn(e,r,o,s)),Tn(c,l)}function Hn(t,e,n,r,i,o,a,s){var c=function(t,e,n,r,i,o,a,s){return wn([t,n,i],[e,r,o],a,s,Gn)}(t,e,n,r,i,o,a,s);return An(c.x,c.y,a,s)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e||"undefined"!=typeof self&&self;var Xn={exports:{}};!function(t,e){t.exports=function(){function t(t,n,i,o,a){e(t,n,i||0,o||t.length-1,a||r)}function e(t,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,c=r-i+1,l=Math.log(s),u=.5*Math.exp(2*l/3),f=.5*Math.sqrt(l*u*(s-u)/s)*(c-s/2<0?-1:1);e(t,r,Math.max(i,Math.floor(r-c*u/s+f)),Math.min(o,Math.floor(r+(s-c)*u/s+f)),a)}var d=t[r],h=i,p=o;for(n(t,i,r),a(t[o],d)>0&&n(t,i,o);h<p;){for(n(t,h,p),h++,p--;a(t[h],d)<0;)h++;for(;a(t[p],d)>0;)p--}0===a(t[i],d)?n(t,i,p):n(t,++p,o),p<=r&&(i=p+1),r<=p&&(o=p-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return t<e?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function a(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=v(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;o<n;o++){var a=t.children[o];c(i,t.leaf?r(a):a)}return i}function c(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function f(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function d(t){return t.maxX-t.minX+(t.maxY-t.minY)}function h(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function p(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function g(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function m(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function v(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(e,n,r,i,o){for(var a=[n,r];a.length;)if(!((r=a.pop())-(n=a.pop())<=i)){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,o),a.push(n,s,s,r)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!m(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;o<e.children.length;o++){var a=e.children[o],s=e.leaf?r(a):a;m(t,s)&&(e.leaf?n.push(a):g(t,s)?this._all(a,n):i.push(a))}e=i.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!m(t,e))return!1;for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(m(t,o)){if(e.leaf||g(t,o))return!0;n.push(i)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=v([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,a=this.data,s=this.toBBox(t),c=[],l=[];a||c.length;){if(a||(a=c.pop(),r=c[c.length-1],n=l.pop(),i=!0),a.leaf){var u=o(t,a.children,e);if(-1!==u)return a.children.splice(u,1),c.push(a),this._condense(c),this}i||a.leaf||!g(a,s)?r?(n++,a=r.children[n],i=!1):a=null:(c.push(a),l.push(n),n=0,r=a,a=a.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,r){var i,o=n-e+1,s=this._maxEntries;if(o<=s)return a(i=v(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),(i=v([])).leaf=!1,i.height=r;var c=Math.ceil(o/s),l=c*Math.ceil(Math.sqrt(s));y(t,e,n,l,this.compareMinX);for(var u=e;u<=n;u+=l){var f=Math.min(u+l-1,n);y(t,u,f,c,this.compareMinY);for(var d=u;d<=f;d+=c){var h=Math.min(d+c-1,f);i.children.push(this._build(t,d,h,r-1))}}return a(i,this.toBBox),i},i.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,o=1/0,a=void 0,s=0;s<e.children.length;s++){var c=e.children[s],l=f(c),u=h(t,c)-l;u<o?(o=u,i=l<i?l:i,a=c):u===o&&l<i&&(i=l,a=c)}e=a||e.children[0]}return e},i.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),c(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},i.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=v(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,a(n,this.toBBox),a(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},i.prototype._splitRoot=function(t,e){this.data=v([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var r,i=1/0,o=1/0,a=e;a<=n-e;a++){var c=s(t,0,a,this.toBBox),l=s(t,a,n,this.toBBox),u=p(c,l),d=f(c)+f(l);u<i?(i=u,r=a,o=d<o?d:o):u===i&&d<o&&(o=d,r=a)}return r||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:l,i=t.leaf?this.compareMinY:u;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},i.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,o=s(t,0,e,i),a=s(t,n-e,n,i),l=d(o)+d(a),u=e;u<n-e;u++){var f=t.children[u];c(o,t.leaf?i(f):f),l+=d(o)}for(var h=n-e-1;h>=e;h--){var p=t.children[h];c(a,t.leaf?i(p):p),l+=d(a)}return l},i.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)c(e[r],t)},i.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():a(t[e],this.toBBox)},i}()}(Xn);var Yn,$n,qn=Xn.exports;!function(t){t.GROUP="g",t.CIRCLE="circle",t.ELLIPSE="ellipse",t.IMAGE="image",t.RECT="rect",t.LINE="line",t.POLYLINE="polyline",t.POLYGON="polygon",t.TEXT="text",t.PATH="path",t.HTML="html",t.MESH="mesh"}(Yn||(Yn={})),function(t){t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE"}($n||($n={}));var Kn=function(){function t(){this.plugins=[]}return t.prototype.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},t.prototype.removeAllRenderingPlugins=function(){var t=this;this.plugins.forEach((function(e){var n=t.context.renderingPlugins.indexOf(e);n>=0&&t.context.renderingPlugins.splice(n,1)}))},t}(),Zn=function(){function t(t){this.clipSpaceNearZ=$n.NEGATIVE_ONE,this.plugins=[],this.config=i({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},t)}return t.prototype.registerPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));-1===e&&this.plugins.push(t)},t.prototype.unregisterPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)},t.prototype.getPlugins=function(){return this.plugins},t.prototype.getPlugin=function(t){return this.plugins.find((function(e){return e.name===t}))},t.prototype.getConfig=function(){return this.config},t.prototype.setConfig=function(t){Object.assign(this.config,t)},t}();function Qn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Jn(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function tr(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function er(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function nr(t){return void 0===t?0:t>360||t<-360?t%360:t}function rr(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?Q(t):Ae(t)?tt(t,e,n):tt(t[0],t[1]||e,t[2]||n)}function ir(t){return t*(Math.PI/180)}function or(t){return t*(180/Math.PI)}function ar(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,o=u(B(Z(),e),3),a=o[0],s=o[1],c=o[2],l=Math.asin(-e[2]/a);return l<i?l>-i?(n=Math.atan2(e[6]/s,e[10]/c),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/s,e[5]/s)):(r=0,n=Math.atan2(e[4]/s,e[5]/s)),t[0]=n,t[1]=l,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=r*r,s=i*i,c=o*o,l=n*n+a+s+c,u=n*o-r*i;return u>.499995*l?(t[0]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):u<-.499995*l?(t[0]=-Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-o*r)),t[1]=Math.atan2(2*(n*o+r*i),1-2*(s+c)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(a+s))),t}(t,e)}function sr(t,e,n,r,i){var o,a,s,c,l,u,f,d,h,p,g=Math.cos(t),v=Math.sin(t);return o=r*g,a=i*v,s=0,c=-r*v,l=i*g,u=0,f=e,d=n,h=1,(p=new m(9))[0]=o,p[1]=a,p[2]=s,p[3]=c,p[4]=l,p[5]=u,p[6]=f,p[7]=d,p[8]=h,p}function cr(t){var e=t[0],n=t[1],r=t[3],i=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(r*r+i*i);e*i-n*r<0&&(e<i?o=-o:a=-a),o&&(e*=1/o,n*=1/o),a&&(r*=1/a,i*=1/a);var s=or(Math.atan2(n,e));return[t[6],t[7],o,a,s]}var lr=_(),ur=_(),fr=mt(),dr=[Z(),Z(),Z()],hr=Z();function pr(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}var gr,mr=function(){function t(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return t.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]},t.prototype.update=function(t,e){Qn(this.center,t),Qn(this.halfExtents,e),Jn(this.min,this.center,this.halfExtents),tr(this.max,this.center,this.halfExtents)},t.prototype.setMinMax=function(t,e){tr(this.center,e,t),er(this.center,this.center,.5),Jn(this.halfExtents,e,t),er(this.halfExtents,this.halfExtents,.5),Qn(this.min,t),Qn(this.max,e)},t.prototype.getMin=function(){return this.min},t.prototype.getMax=function(){return this.max},t.prototype.add=function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],o=n[2],a=this.halfExtents,s=a[0],c=a[1],l=a[2],u=r-s,f=r+s,d=i-c,h=i+c,p=o-l,g=o+l,m=e.center,v=m[0],y=m[1],_=m[2],b=e.halfExtents,E=b[0],x=b[1],M=b[2],S=v-E,A=v+E,T=y-x,O=y+x,R=_-M,P=_+M;S<u&&(u=S),A>f&&(f=A),T<d&&(d=T),O>h&&(h=O),R<p&&(p=R),P>g&&(g=P),n[0]=.5*(u+f),n[1]=.5*(d+h),n[2]=.5*(p+g),a[0]=.5*(f-u),a[1]=.5*(h-d),a[2]=.5*(g-p),this.min[0]=u,this.min[1]=d,this.min[2]=p,this.max[0]=f,this.max[1]=h,this.max[2]=g}},t.prototype.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,o=t.halfExtents,a=e[0],s=e[4],c=e[8],l=e[1],u=e[5],f=e[9],d=e[2],h=e[6],p=e[10],g=Math.abs(a),m=Math.abs(s),v=Math.abs(c),y=Math.abs(l),_=Math.abs(u),b=Math.abs(f),E=Math.abs(d),x=Math.abs(h),M=Math.abs(p);n[0]=e[12]+a*i[0]+s*i[1]+c*i[2],n[1]=e[13]+l*i[0]+u*i[1]+f*i[2],n[2]=e[14]+d*i[0]+h*i[1]+p*i[2],r[0]=g*o[0]+m*o[1]+v*o[2],r[1]=y*o[0]+_*o[1]+b*o[2],r[2]=E*o[0]+x*o[1]+M*o[2],Jn(this.min,n,r),tr(this.max,n,r)},t.prototype.intersects=function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return n[0]<=r[0]&&e[0]>=i[0]&&n[1]<=r[1]&&e[1]>=i[1]&&n[2]<=r[2]&&e[2]>=i[2]},t.prototype.intersection=function(e){if(!this.intersects(e))return null;var n=new t,r=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t}([0,0,0],this.getMin(),e.getMin()),i=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}([0,0,0],this.getMax(),e.getMax());return n.setMinMax(r,i),n},t.prototype.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?Qn([0,0,0],this.min):272===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]},t.prototype.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?Qn([0,0,0],this.max):272===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]},t}(),vr=function(){function t(t,e){this.distance=t||0,this.normal=e||tt(0,1,0),this.updatePNVertexFlag()}return t.prototype.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)},t.prototype.distanceToPoint=function(t){return st(t,this.normal)-this.distance},t.prototype.normalize=function(){var t=1/gt(this.normal);ot(this.normal,this.normal,t),this.distance*=t},t.prototype.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&i<=1;return o&&n&<(n,t,e,i),o},t}();!function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"}(gr||(gr={}));var yr,_r,br,Er=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new vr)}return t.prototype.extractFromVPMatrix=function(t){var e=u(t,16),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=e[9],h=e[10],p=e[11],g=e[12],m=e[13],v=e[14],y=e[15];nt(this.planes[0].normal,o-n,l-a,p-f),this.planes[0].distance=y-g,nt(this.planes[1].normal,o+n,l+a,p+f),this.planes[1].distance=y+g,nt(this.planes[2].normal,o+r,l+s,p+d),this.planes[2].distance=y+m,nt(this.planes[3].normal,o-r,l-s,p-d),this.planes[3].distance=y-m,nt(this.planes[4].normal,o-i,l-c,p-h),this.planes[4].distance=y-v,nt(this.planes[5].normal,o+i,l+c,p+h),this.planes[5].distance=y+v,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),xr=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y},t}(),Mr=function(){function t(t,e,n,r){this.x=t,this.y=e,this.width=n,this.height=r,this.left=t,this.right=t+n,this.top=e,this.bottom=e+r}return t.prototype.toJSON=function(){},t}(),Sr="Method not implemented.",Ar="Use document.documentElement instead.";!function(t){t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING"}(yr||(yr={})),function(t){t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC"}(_r||(_r={})),function(t){t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE"}(br||(br={}));var Tr,Or,Rr,Pr,Cr,wr="updated",Nr=2e-4,Ir=function(){function t(){this.clipSpaceNearZ=$n.NEGATIVE_ONE,this.eventEmitter=new p,this.matrix=_(),this.right=tt(1,0,0),this.up=tt(0,1,0),this.forward=tt(0,0,1),this.position=tt(0,0,1),this.focalPoint=tt(0,0,0),this.distanceVector=tt(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=_(),this.projectionMatrixInverse=_(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=yr.EXPLORING,this.trackingMode=_r.DEFAULT,this.projectionMode=br.PERSPECTIVE,this.frustum=new Er,this.orthoMatrix=_()}return t.prototype.isOrtho=function(){return this.projectionMode===br.ORTHOGRAPHIC},t.prototype.getProjectionMode=function(){return this.projectionMode},t.prototype.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},t.prototype.getPerspectiveInverse=function(){return this.projectionMatrixInverse},t.prototype.getFrustum=function(){return this.frustum},t.prototype.getPosition=function(){return this.position},t.prototype.getFocalPoint=function(){return this.focalPoint},t.prototype.getDollyingStep=function(){return this.dollyingStep},t.prototype.getNear=function(){return this.near},t.prototype.getFar=function(){return this.far},t.prototype.getZoom=function(){return this.zoom},t.prototype.getOrthoMatrix=function(){return this.orthoMatrix},t.prototype.getView=function(){return this.view},t.prototype.setEnableUpdate=function(t){this.enableUpdate=t},t.prototype.setType=function(t,e){return this.type=t,this.type===yr.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===yr.TRACKING&&void 0!==e&&this.setTrackingMode(e),this},t.prototype.setProjectionMode=function(t){return this.projectionMode=t,this},t.prototype.setTrackingMode=function(t){if(this.type!==yr.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this},t.prototype.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},t.prototype.getViewTransform=function(){return T(_(),this.matrix)},t.prototype.getWorldTransform=function(){return this.matrix},t.prototype.jitterProjectionMatrix=function(t,e){var n=I(_(),[t,e,0]);this.jitteredProjectionMatrix=R(_(),n,this.projectionMatrix)},t.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},t.prototype.setMatrix=function(t){return this.matrix=t,this._update(),this},t.prototype.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},t.prototype.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},t.prototype.setNear=function(t){return this.projectionMode===br.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this},t.prototype.setFar=function(t){return this.projectionMode===br.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this},t.prototype.setViewOffset=function(t,e,n,r,i,o){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.projectionMode===br.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},t.prototype.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===br.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},t.prototype.setZoom=function(t){return this.zoom=t,this.projectionMode===br.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===br.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},t.prototype.setZoomByViewportPoint=function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,i=n.y,o=this.roll;this.rotate(0,0,-o),this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t),this.rotate(0,0,o);var a=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=tt(a.x-r,a.y-i,0),c=st(s,this.right)/J(this.right),l=st(s,this.up)/J(this.up);return this.pan(-c,-l),this},t.prototype.setPerspective=function(t,e,n,r){var i;this.projectionMode=br.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var o=this.near*Math.tan(ir(.5*this.fov))/this.zoom,a=2*o,s=this.aspect*a,c=-.5*s;if(null===(i=this.view)||void 0===i?void 0:i.enabled){var l=this.view.fullWidth,u=this.view.fullHeight;c+=this.view.offsetX*s/l,o-=this.view.offsetY*a/u,s*=this.view.width/l,a*=this.view.height/u}return function(t,e,n,r,i,o,a,s){void 0===s&&(s=!1);var c,l,u=2*o/(n-e),f=2*o/(r-i),d=(n+e)/(n-e),h=(r+i)/(r-i);s?(c=-a/(a-o),l=-a*o/(a-o)):(c=-(a+o)/(a-o),l=-2*a*o/(a-o)),t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=f,t[6]=0,t[7]=0,t[8]=d,t[9]=h,t[10]=c,t[11]=-1,t[12]=0,t[13]=0,t[14]=l,t[15]=0}(this.projectionMatrix,c,c+s,o,o-a,t,this.far,this.clipSpaceNearZ===$n.ZERO),C(this.projectionMatrix,this.projectionMatrix,tt(1,-1,1)),T(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},t.prototype.setOrthographic=function(t,e,n,r,i,o){var a;this.projectionMode=br.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=o;var s=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,u=(this.top+this.bottom)/2,f=l-s,d=l+s,h=u+c,p=u-c;if(null===(a=this.view)||void 0===a?void 0:a.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,m=(this.top-this.bottom)/this.view.fullHeight/this.zoom;d=(f+=g*this.view.offsetX)+g*this.view.width,p=(h-=m*this.view.offsetY)-m*this.view.height}return this.clipSpaceNearZ===$n.NEGATIVE_ONE?V(this.projectionMatrix,f,d,p,h,i,o):H(this.projectionMatrix,f,d,p,h,i,o),C(this.projectionMatrix,this.projectionMatrix,tt(1,-1,1)),T(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},t.prototype.setPosition=function(t,e,n){void 0===e&&(e=this.position[1]),void 0===n&&(n=this.position[2]);var r=rr(t,e,n);return this._setPosition(r),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},t.prototype.setFocalPoint=function(t,e,n){void 0===e&&(e=this.focalPoint[1]),void 0===n&&(n=this.focalPoint[2]);var r=tt(0,1,0);if(this.focalPoint=rr(t,e,n),this.trackingMode===_r.CINEMATIC){var i=it(Z(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var o=J(i),a=or(Math.asin(e/o)),s=90+or(Math.atan2(n,t)),c=_();N(c,c,ir(s)),w(c,c,ir(a)),r=ut(Z(),[0,1,0],c)}return T(this.matrix,X(_(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},t.prototype.getDistance=function(){return this.distance},t.prototype.getDistanceVector=function(){return this.distanceVector},t.prototype.setDistance=function(t){if(this.distance===t||t<0)return this;this.distance=t,this.distance<Nr&&(this.distance=Nr),this.dollyingStep=this.distance/100;var e=Z();t=this.distance;var n=this.forward,r=this.focalPoint;return e[0]=t*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate(),this},t.prototype.setMaxDistance=function(t){return this.maxDistance=t,this},t.prototype.setMinDistance=function(t){return this.minDistance=t,this},t.prototype.setAzimuth=function(t){return this.azimuth=nr(t),this.computeMatrix(),this._getAxes(),this.type===yr.ORBITING||this.type===yr.EXPLORING?this._getPosition():this.type===yr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getAzimuth=function(){return this.azimuth},t.prototype.setElevation=function(t){return this.elevation=nr(t),this.computeMatrix(),this._getAxes(),this.type===yr.ORBITING||this.type===yr.EXPLORING?this._getPosition():this.type===yr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getElevation=function(){return this.elevation},t.prototype.setRoll=function(t){return this.roll=nr(t),this.computeMatrix(),this._getAxes(),this.type===yr.ORBITING||this.type===yr.EXPLORING?this._getPosition():this.type===yr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getRoll=function(){return this.roll},t.prototype._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},t.prototype.computeMatrix=function(){var t=_t(yt(),[0,0,1],ir(this.roll));S(this.matrix);var e=_t(yt(),[1,0,0],ir((this.rotateWorld&&this.type!==yr.TRACKING||this.type===yr.TRACKING?1:-1)*this.elevation)),n=_t(yt(),[0,1,0],ir((this.rotateWorld&&this.type!==yr.TRACKING||this.type===yr.TRACKING?1:-1)*this.azimuth)),r=bt(yt(),n,e);r=bt(yt(),r,t);var i=j(_(),r);this.type===yr.ORBITING||this.type===yr.EXPLORING?(P(this.matrix,this.matrix,this.focalPoint),R(this.matrix,this.matrix,i),P(this.matrix,this.matrix,[0,0,this.distance])):this.type===yr.TRACKING&&(P(this.matrix,this.matrix,this.position),R(this.matrix,this.matrix,i))},t.prototype._setPosition=function(t,e,n){this.position=rr(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1,this._getOrthoMatrix()},t.prototype._getAxes=function(){et(this.right,rr(vt(mt(),[1,0,0,0],this.matrix))),et(this.up,rr(vt(mt(),[0,1,0,0],this.matrix))),et(this.forward,rr(vt(mt(),[0,0,1,0],this.matrix))),at(this.right,this.right),at(this.up,this.up),at(this.forward,this.forward)},t.prototype._getAngles=function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=J(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===yr.TRACKING||this.rotateWorld?(this.elevation=or(Math.asin(e/r)),this.azimuth=or(Math.atan2(-t,-n))):(this.elevation=-or(Math.asin(e/r)),this.azimuth=-or(Math.atan2(-t,-n)))},t.prototype._getPosition=function(){et(this.position,rr(vt(mt(),[0,0,0,1],this.matrix))),this._getDistance()},t.prototype._getFocalPoint=function(){ft(this.distanceVector,[0,0,-this.distance],function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}(v(),this.matrix)),rt(this.focalPoint,this.position,this.distanceVector),this._getDistance()},t.prototype._getDistance=function(){this.distanceVector=it(Z(),this.focalPoint,this.position),this.distance=J(this.distanceVector),this.dollyingStep=this.distance/100},t.prototype._getOrthoMatrix=function(){if(this.projectionMode===br.ORTHOGRAPHIC){var t=this.position,e=_t(yt(),[0,0,1],-this.roll*Math.PI/180);U(this.orthoMatrix,e,tt((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),tt(this.zoom,this.zoom,1),t)}},t.prototype.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=R(_(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(wr)}},t.prototype.rotate=function(t,e,n){throw new Error(Sr)},t.prototype.pan=function(t,e){throw new Error(Sr)},t.prototype.dolly=function(t){throw new Error(Sr)},t.prototype.createLandmark=function(t,e){throw new Error(Sr)},t.prototype.gotoLandmark=function(t,e){throw new Error(Sr)},t.prototype.cancelLandmarkAnimation=function(){throw new Error(Sr)},t}();function kr(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return n.cache=a.set(o,s)||a,s};return n.cache=new(kr.Cache||Map),n}kr.Cache=Map,function(t){t[t.kUnknown=0]="kUnknown",t[t.kNumber=1]="kNumber",t[t.kPercentage=2]="kPercentage",t[t.kEms=3]="kEms",t[t.kPixels=4]="kPixels",t[t.kRems=5]="kRems",t[t.kDegrees=6]="kDegrees",t[t.kRadians=7]="kRadians",t[t.kGradians=8]="kGradians",t[t.kTurns=9]="kTurns",t[t.kMilliseconds=10]="kMilliseconds",t[t.kSeconds=11]="kSeconds",t[t.kInteger=12]="kInteger"}(Tr||(Tr={})),function(t){t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther"}(Or||(Or={})),function(t){t[t.kAll=0]="kAll",t[t.kNonNegative=1]="kNonNegative",t[t.kInteger=2]="kInteger",t[t.kNonNegativeInteger=3]="kNonNegativeInteger",t[t.kPositiveInteger=4]="kPositiveInteger"}(Rr||(Rr={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Pr||(Pr={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Cr||(Cr={}));var Lr,Dr=[{name:"em",unit_type:Tr.kEms},{name:"px",unit_type:Tr.kPixels},{name:"deg",unit_type:Tr.kDegrees},{name:"rad",unit_type:Tr.kRadians},{name:"grad",unit_type:Tr.kGradians},{name:"ms",unit_type:Tr.kMilliseconds},{name:"s",unit_type:Tr.kSeconds},{name:"rem",unit_type:Tr.kRems},{name:"turn",unit_type:Tr.kTurns}];!function(t){t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType"}(Lr||(Lr={}));var Br,Fr=function(t){return t?"number"===t?Tr.kNumber:"percent"===t||"%"===t?Tr.kPercentage:function(t){return Dr.find((function(e){return e.name===t})).unit_type}(t):Tr.kUnknown},Ur=function(t){var e=1;switch(t){case Tr.kPixels:case Tr.kDegrees:case Tr.kSeconds:break;case Tr.kMilliseconds:e=.001;break;case Tr.kRadians:e=180/Math.PI;break;case Tr.kGradians:e=.9;break;case Tr.kTurns:e=360}return e},jr=function(t){switch(t){case Tr.kNumber:case Tr.kInteger:return"";case Tr.kPercentage:return"%";case Tr.kEms:return"em";case Tr.kRems:return"rem";case Tr.kPixels:return"px";case Tr.kDegrees:return"deg";case Tr.kRadians:return"rad";case Tr.kGradians:return"grad";case Tr.kMilliseconds:return"ms";case Tr.kSeconds:return"s";case Tr.kTurns:return"turn"}return""},Gr=function(){function t(){}return t.isAngle=function(t){return t===Tr.kDegrees||t===Tr.kRadians||t===Tr.kGradians||t===Tr.kTurns},t.isLength=function(t){return t>=Tr.kEms&&t<Tr.kDegrees},t.isRelativeUnit=function(t){return t===Tr.kPercentage||t===Tr.kEms||t===Tr.kRems},t.isTime=function(t){return t===Tr.kSeconds||t===Tr.kMilliseconds},t.prototype.toString=function(){return this.buildCSSText(Pr.kNo,Cr.kNo,"")},t.prototype.isNumericValue=function(){return this.getType()>=Lr.kUnitType&&this.getType()<=Lr.kClampType},t}(),Wr=function(t){function e(e){var n=t.call(this)||this;return n.colorSpace=e,n}return r(e,t),e.prototype.getType=function(){return Lr.kColorType},e.prototype.to=function(t){return this},e}(Gr);!function(t){t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient"}(Br||(Br={}));var zr=function(t){function e(e,n){var r=t.call(this)||this;return r.type=e,r.value=n,r}return r(e,t),e.prototype.clone=function(){return new e(this.type,this.value)},e.prototype.buildCSSText=function(t,e,n){return n},e.prototype.getType=function(){return Lr.kColorType},e}(Gr),Vr=function(t){function e(e){var n=t.call(this)||this;return n.value=e,n}return r(e,t),e.prototype.clone=function(){return new e(this.value)},e.prototype.getType=function(){return Lr.kKeywordType},e.prototype.buildCSSText=function(t,e,n){return n+this.value},e}(Gr),Hr=kr((function(t){return void 0===t&&(t=""),t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))})),Xr=function(t){return t.split("").map((function(t,e){return t.toUpperCase()===t?"".concat(0!==e?"-":"").concat(t.toLowerCase()):t})).join("")};function Yr(t){return"function"==typeof t}var $r={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},qr=kr((function(t){var e=Hr(t),n=$r[e];return e=(null==n?void 0:n.alias)||e})),Kr=function(t,e){void 0===e&&(e="");var n="";return Number.isFinite(t)?(!function(t){if(!t)throw new Error}(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e},Zr=function(t){return function(t){switch(t){case Or.kUNumber:return Tr.kNumber;case Or.kULength:return Tr.kPixels;case Or.kUPercent:return Tr.kPercentage;case Or.kUTime:return Tr.kSeconds;case Or.kUAngle:return Tr.kDegrees;default:return Tr.kUnknown}}(function(t){switch(t){case Tr.kNumber:case Tr.kInteger:return Or.kUNumber;case Tr.kPercentage:return Or.kUPercent;case Tr.kPixels:return Or.kULength;case Tr.kMilliseconds:case Tr.kSeconds:return Or.kUTime;case Tr.kDegrees:case Tr.kRadians:case Tr.kGradians:case Tr.kTurns:return Or.kUAngle;default:return Or.kUOther}}(t))},Qr=function(t){function e(e,n){void 0===n&&(n=Tr.kNumber);var r,i=t.call(this)||this;return r="string"==typeof n?Fr(n):n,i.unit=r,i.value=e,i}return r(e,t),e.prototype.clone=function(){return new e(this.value,this.unit)},e.prototype.equals=function(t){var e=t;return this.value===e.value&&this.unit===e.unit},e.prototype.getType=function(){return Lr.kUnitType},e.prototype.convertTo=function(t){if(this.unit===t)return new e(this.value,this.unit);var n=Zr(this.unit);if(n!==Zr(t)||n===Tr.kUnknown)return null;var r=Ur(this.unit)/Ur(t);return new e(this.value*r,t)},e.prototype.buildCSSText=function(t,e,n){var r;switch(this.unit){case Tr.kUnknown:break;case Tr.kInteger:r=Number(this.value).toFixed(0);break;case Tr.kNumber:case Tr.kPercentage:case Tr.kEms:case Tr.kRems:case Tr.kPixels:case Tr.kDegrees:case Tr.kRadians:case Tr.kGradians:case Tr.kMilliseconds:case Tr.kSeconds:case Tr.kTurns:var i=this.value,o=jr(this.unit);if(i<-999999||i>999999){var a=jr(this.unit);r=!Number.isFinite(i)||Number.isNaN(i)?Kr(i,a):i+(a||"")}else r="".concat(i).concat(o)}return n+=r},e}(Gr),Jr=new Qr(0,"px");new Qr(1,"px");var ti,ei,ni=new Qr(0,"deg"),ri=function(t){function e(e,n,r,i,o){void 0===i&&(i=1),void 0===o&&(o=!1);var a=t.call(this,"rgb")||this;return a.r=e,a.g=n,a.b=r,a.alpha=i,a.isNone=o,a}return r(e,t),e.prototype.clone=function(){return new e(this.r,this.g,this.b,this.alpha)},e.prototype.buildCSSText=function(t,e,n){return n+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")},e}(Wr),ii=new Vr("unset"),oi=new Vr("initial"),ai=new Vr("inherit"),si={"":ii,unset:ii,initial:oi,inherit:ai},ci=function(t){return si[t]||(si[t]=new Vr(t)),si[t]},li=new ri(0,0,0,0,!0),ui=new ri(0,0,0,0),fi=kr((function(t,e,n,r){return new ri(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),di=function(t,e){return void 0===e&&(e=Tr.kNumber),new Qr(t,e)},hi=new Qr(50,"%");!function(t){t[t.Standard=0]="Standard"}(ti||(ti={})),function(t){t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"}(ei||(ei={}));var pi,gi={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Mr(0,0,0,0)};function mi(t){var e=t.type,n=t.value;return"hex"===e?"#".concat(n):"literal"===e?n:"rgb"===e?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}!function(t){t.COORDINATE="<coordinate>",t.COLOR="<color>",t.PAINT="<paint>",t.NUMBER="<number>",t.ANGLE="<angle>",t.OPACITY_VALUE="<opacity-value>",t.SHADOW_BLUR="<shadow-blur>",t.LENGTH="<length>",t.PERCENTAGE="<percentage>",t.LENGTH_PERCENTAGE="<length> | <percentage>",t.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",t.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",t.LIST_OF_POINTS="<list-of-points>",t.PATH="<path>",t.FILTER="<filter>",t.Z_INDEX="<z-index>",t.OFFSET_DISTANCE="<offset-distance>",t.DEFINED_PATH="<defined-path>",t.MARKER="<marker>",t.TRANSFORM="<transform>",t.TRANSFORM_ORIGIN="<transform-origin>",t.TEXT="<text>",t.TEXT_TRANSFORM="<text-transform>"}(pi||(pi={}));var vi=function(){var t={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},e="";function n(t){throw new Error(e+": "+t)}function r(){var t=h(i);return e.length>0&&n("Invalid input not EOF"),t}function i(){return o("linear-gradient",t.linearGradient,s)||o("repeating-linear-gradient",t.repeatingLinearGradient,s)||o("radial-gradient",t.radialGradient,c)||o("repeating-radial-gradient",t.repeatingRadialGradient,c)||o("conic-gradient",t.conicGradient,c)}function o(e,r,i){return a(r,(function(r){var o=i();return o&&(_(t.comma)||n("Missing comma before color stops")),{type:e,orientation:o,colorStops:h(p)}}))}function a(e,r){var i=_(e);if(i){_(t.startCall)||n("Missing (");var o=r(i);return _(t.endCall)||n("Missing )"),o}}function s(){return y("directional",t.sideOrCorner,1)||y("angular",t.angleValue,1)}function c(){var n,r,i=l();return i&&((n=[]).push(i),r=e,_(t.comma)&&((i=l())?n.push(i):e=r)),n}function l(){var t=function(){var t=y("shape",/^(circle)/i,0);t&&(t.style=v()||u());return t}()||function(){var t=y("shape",/^(ellipse)/i,0);t&&(t.style=m()||u());return t}();if(t)t.at=f();else{var e=u();if(e){t=e;var n=f();n&&(t.at=n)}else{var r=d();r&&(t={type:"default-radial",at:r})}}return t}function u(){return y("extent-keyword",t.extentKeywords,1)}function f(){if(y("position",/^at/,0)){var t=d();return t||n("Missing positioning value"),t}}function d(){var t={x:m(),y:m()};if(t.x||t.y)return{type:"position",value:t}}function h(e){var r=e(),i=[];if(r)for(i.push(r);_(t.comma);)(r=e())?i.push(r):n("One extra comma");return i}function p(){var e=y("hex",t.hexColor,1)||a(t.rgbaColor,(function(){return{type:"rgba",value:h(g)}}))||a(t.rgbColor,(function(){return{type:"rgb",value:h(g)}}))||y("literal",t.literalColor,0);return e||n("Expected color definition"),e.length=m(),e}function g(){return _(t.number)[1]}function m(){return y("%",t.percentageValue,1)||y("position-keyword",t.positionKeywords,1)||v()}function v(){return y("px",t.pixelValue,1)||y("em",t.emValue,1)}function y(t,e,n){var r=_(e);if(r)return{type:t,value:r[n]}}function _(t){var n=/^[\n\r\t\s]+/.exec(e);n&&b(n[0].length);var r=t.exec(e);return r&&b(r[0].length),r}function b(t){e=e.substring(t)}return function(t){return e=t,r()}}();var yi=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,_i=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,bi=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Ei=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var xi={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},Mi=kr((function(t){var e;return e="angular"===t.type?Number(t.value):xi[t.value]||0,di(e,"deg")})),Si=kr((function(t){var e=50,n=50,r="%",i="%";if("position"===(null==t?void 0:t.type)){var o=t.value,a=o.x,s=o.y;"position-keyword"===(null==a?void 0:a.type)&&("left"===a.value?e=0:"center"===a.value?e=50:"right"===a.value?e=100:"top"===a.value?n=0:"bottom"===a.value&&(n=100)),"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?n=50:"right"===s.value?e=100:"top"===s.value?n=0:"bottom"===s.value&&(n=100)),"px"!==(null==a?void 0:a.type)&&"%"!==(null==a?void 0:a.type)&&"em"!==(null==a?void 0:a.type)||(r=null==a?void 0:a.type,e=Number(a.value)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(i=null==s?void 0:s.type,n=Number(s.value))}return{cx:di(e,r),cy:di(n,i)}})),Ai=kr((function(t){var e;if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return vi(t).map((function(t){var e=t.type,n=t.orientation,r=t.colorStops;!function(t){var e,n,r,i=t.length;t[i-1].length=null!==(e=t[i-1].length)&&void 0!==e?e:{type:"%",value:"100"},i>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var o=0,a=Number(t[0].length.value),s=1;s<i;s++){var c=null===(r=t[s].length)||void 0===r?void 0:r.value;if(!he(c)&&!he(a)){for(var l=1;l<s-o;l++)t[o+l].length={type:"%",value:"".concat(a+(Number(c)-a)*l/(s-o))};o=s,a=Number(c)}}}(r);var i=r.map((function(t){return{offset:di(Number(t.length.value),"%"),color:mi(t)}}));if("linear-gradient"===e)return new zr(Br.LinearGradient,{angle:n?Mi(n):ni,steps:i});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var o=Si(n[0].at),a=o.cx,s=o.cy,c=void 0;if(n[0].style){var l=n[0].style,u=l.type,f=l.value;c="extent-keyword"===u?ci(f):di(f,u)}return new zr(Br.RadialGradient,{cx:a,cy:s,size:c,steps:i})}}));var n=t[0];if("("===t[1]||"("===t[2])if("l"===n){var r=yi.exec(t);if(r){var i=(null===(e=r[2].match(Ei))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return[new zr(Br.LinearGradient,{angle:di(parseFloat(r[1]),"deg"),steps:i.map((function(t){var e=u(t,2),n=e[0],r=e[1];return{offset:di(100*Number(n),"%"),color:r}}))})]}}else if("r"===n){var o=function(t){var e,n=_i.exec(t);if(n){var r=(null===(e=n[4].match(Ei))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return{cx:di(50,"%"),cy:di(50,"%"),steps:r.map((function(t){var e=u(t,2),n=e[0],r=e[1];return{offset:di(100*Number(n),"%"),color:r}}))}}return null}(t);if(o){if(!Me(o))return[new zr(Br.RadialGradient,o)];t=o}}else if("p"===n)return function(t){var e=bi.exec(t);if(e){var n=e[1],r=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}(t)}));function Ti(t){return t&&!!t.image}function Oi(t){return t&&!he(t.r)&&!he(t.g)&&!he(t.b)}var Ri=kr((function(t){if(Ti(t))return i({repetition:"repeat"},t);if(he(t)&&(t=""),"transparent"===t)return ui;"currentColor"===t&&(t="black");var e=Ai(t);if(e)return e;var n=pn(t),r=[0,0,0,0];return null!==n&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),fi.apply(void 0,f([],u(r),!1))}));function Pi(t,e){if(Oi(t)&&Oi(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(Se(e[n],0,255));return e[3]=Se(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function Ci(t,e){if(he(e))return di(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return di(Number(e),"px");if("deg".search(t)>=0)return di(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U"+t}));var r="U("+t.source+")";return n.map((function(t){return di(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)}))[0]}var wi=kr((function(t){return Ci(new RegExp("px","g"),t)}));kr((function(t){return Ci(new RegExp("%","g"),t)}));var Ni=function(t){return Ae(t)||isFinite(Number(t))?di(Number(t)||0,"px"):Ci(new RegExp("px|%|em|rem","g"),t)},Ii=kr((function(t){return Ci(new RegExp("deg|rad|grad|turn","g"),t)}));function ki(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0,c=Zr(t.unit),l=t.convertTo(c),u=e.convertTo(c);return l&&u?(a=l.value,s=u.value,o=jr(t.unit)):(Qr.isLength(t.unit)||Qr.isLength(e.unit))&&(a=Fi(t,i,n),s=Fi(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function Li(t){var e=0;return t.unit===Tr.kDegrees?e=t.value:t.unit===Tr.kRadians?e=or(Number(t.value)):t.unit===Tr.kTurns&&(e=360*Number(t.value)),e}function Di(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):Me(t)?n=t.split(" ").map((function(t){return Number(t)})):Ae(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 Bi(t){return Me(t)?t.split(" ").map((function(t){return Ni(t)})):t.map((function(t){return Ni(t.toString())}))}function Fi(t,e,n){if(0===t.value)return 0;if(t.unit===Tr.kPixels)return Number(t.value);if(t.unit===Tr.kPercentage&&n){var r=n.nodeName===Yn.GROUP?n.getLocalBounds():n.geometry.contentBounds;return t.value/100*r.halfExtents[e]*2}return 0}var Ui=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function ji(t){if(void 0===t&&(t=""),"none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,Ui.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return Ci(/deg|rad|grad|turn|px|%/g,t)||Ri(t)}))}),n.lastIndex===t.length)return r}return[]}function Gi(t){return t.toString()}var Wi=kr((function(t){return"number"==typeof t?di(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?di(Number(t)):di(0)}));function zi(t,e){return[t,e,Gi]}function Vi(t,e){return function(n,r){return[n,r,function(n){return Gi(Se(n,t,e))}]}}function Hi(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function Xi(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=ae(t.parsedStyle.path.absolutePath,void 0,i(i({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function Yi(t,e){return t[0]===e[0]&&t[1]===e[1]}function $i(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,o=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),c=Math.acos((o+a-s)/(2*Math.sqrt(o)*Math.sqrt(a)));if(!c||0===Math.sin(c)||Oe(c,0))return{xExtra:0,yExtra:0};var l=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),u=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return l=l>Math.PI/2?Math.PI-l:l,u=u>Math.PI/2?Math.PI-u:u,{xExtra:Math.cos(c/2-l)*(e/2*(1/Math.sin(c/2)))-e/2||0,yExtra:Math.cos(u-c/2)*(e/2*(1/Math.sin(c/2)))-e/2||0}}function qi(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}kr((function(t){return Me(t)?t.split(" ").map(Wi):t.map(Wi)}));var Ki=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)},Zi=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n);var c=ir(r=Ce(r,360));if(t.x===a.x&&t.y===a.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var l=(t.x-a.x)/2,u=(t.y-a.y)/2,f={x:Math.cos(c)*l+Math.sin(c)*u,y:-Math.sin(c)*l+Math.cos(c)*u},d=Math.pow(f.x,2)/Math.pow(e,2)+Math.pow(f.y,2)/Math.pow(n,2);d>1&&(e=Math.sqrt(d)*e,n=Math.sqrt(d)*n);var h=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(f.y,2)-Math.pow(n,2)*Math.pow(f.x,2))/(Math.pow(e,2)*Math.pow(f.y,2)+Math.pow(n,2)*Math.pow(f.x,2));h=h<0?0:h;var p=(i!==o?1:-1)*Math.sqrt(h),g=p*(e*f.y/n),m=p*(-n*f.x/e),v={x:Math.cos(c)*g-Math.sin(c)*m+(t.x+a.x)/2,y:Math.sin(c)*g+Math.cos(c)*m+(t.y+a.y)/2},y={x:(f.x-g)/e,y:(f.y-m)/n},_=Ki({x:1,y:0},y),b=Ki(y,{x:(-f.x-g)/e,y:(-f.y-m)/n});!o&&b>0?b-=2*Math.PI:o&&b<0&&(b+=2*Math.PI);var E=_+(b%=2*Math.PI)*s,x=e*Math.cos(E),M=n*Math.sin(E);return{x:Math.cos(c)*x-Math.sin(c)*M+v.x,y:Math.sin(c)*x+Math.cos(c)*M+v.y,ellipticalArcStartAngle:_,ellipticalArcEndAngle:_+b,ellipticalArcAngle:E,ellipticalArcCenter:v,resultantRx:e,resultantRy:n}};function Qi(t,e,n){void 0===n&&(n=!0);var r=t.arcParams,i=r.rx,o=void 0===i?0:i,a=r.ry,s=void 0===a?0:a,c=r.xRotation,l=r.arcFlag,u=r.sweepFlag,f=Zi({x:t.prePoint[0],y:t.prePoint[1]},o,s,c,!!l,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},e),d=Zi({x:t.prePoint[0],y:t.prePoint[1]},o,s,c,!!l,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),h=d.x-f.x,p=d.y-f.y,g=Math.sqrt(h*h+p*p);return{x:-h/g,y:-p/g}}function Ji(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function to(t,e){return Ji(t)*Ji(e)?(t[0]*e[0]+t[1]*e[1])/(Ji(t)*Ji(e)):1}function eo(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(to(t,e))}function no(t,e){var n=e[1],r=e[2],i=Ce(ir(e[3]),2*Math.PI),o=e[4],a=e[5],s=t[0],c=t[1],l=e[6],u=e[7],f=Math.cos(i)*(s-l)/2+Math.sin(i)*(c-u)/2,d=-1*Math.sin(i)*(s-l)/2+Math.cos(i)*(c-u)/2,h=f*f/(n*n)+d*d/(r*r);h>1&&(n*=Math.sqrt(h),r*=Math.sqrt(h));var p=n*n*(d*d)+r*r*(f*f),g=p?Math.sqrt((n*n*(r*r)-p)/p):1;o===a&&(g*=-1),isNaN(g)&&(g=0);var m=r?g*n*d/r:0,v=n?g*-r*f/n:0,y=(s+l)/2+Math.cos(i)*m-Math.sin(i)*v,_=(c+u)/2+Math.sin(i)*m+Math.cos(i)*v,b=[(f-m)/n,(d-v)/r],E=[(-1*f-m)/n,(-1*d-v)/r],x=eo([1,0],b),M=eo(b,E);return to(b,E)<=-1&&(M=Math.PI),to(b,E)>=1&&(M=0),0===a&&M>0&&(M-=2*Math.PI),1===a&&M<0&&(M+=2*Math.PI),{cx:y,cy:_,rx:Yi(t,[l,u])?0:n,ry:Yi(t,[l,u])?0:r,startAngle:x,endAngle:x+M,xRotation:i,arcFlag:o,sweepFlag:a}}function ro(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,o=t*i,a=e*i,s=n-t,c=n+t,l=r-e,u=r+e;return[["M",s,r],["C",s,r-a,n-o,l,n,l],["C",n+o,l,c,r-a,c,r],["C",c,r+a,n+o,u,n,u],["C",n-o,u,s,r+a,s,r],["Z"]]}function io(t,e){void 0===e&&(e=t.getLocalTransform());var n=[];switch(t.nodeName){case Yn.LINE:var r=t.parsedStyle,i=r.x1,o=void 0===i?0:i,a=r.y1,s=void 0===a?0:a,c=r.x2,l=void 0===c?0:c,d=r.y2;n=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(o,s,l,void 0===d?0:d);break;case Yn.CIRCLE:var h=t.parsedStyle,p=h.r,g=void 0===p?0:p,m=h.cx,v=void 0===m?0:m,y=h.cy;n=ro(g,g,v,void 0===y?0:y);break;case Yn.ELLIPSE:var _=t.parsedStyle,b=_.rx,E=void 0===b?0:b,x=_.ry,M=void 0===x?0:x,S=_.cx,A=(v=void 0===S?0:S,_.cy);n=ro(E,M,v,void 0===A?0:A);break;case Yn.POLYLINE:case Yn.POLYGON:n=function(t,e){var n=t.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]}));return e&&n.push(["Z"]),n}(t.parsedStyle.points.points,t.nodeName===Yn.POLYGON);break;case Yn.RECT:var T=t.parsedStyle,O=T.width,R=void 0===O?0:O,P=T.height,C=void 0===P?0:P,w=T.x,N=void 0===w?0:w,I=T.y,k=void 0===I?0:I,L=T.radius,D=L&&L.some((function(t){return 0!==t}));n=function(t,e,n,r,i){if(i){var o=u(i,4),a=o[0],s=o[1],c=o[2],l=o[3],f=t>0?1:-1,d=e>0?1:-1,h=f+d!==0?1:0;return[["M",f*a+n,r],["L",t-f*s+n,r],s?["A",s,s,0,0,h,t+n,d*s+r]:null,["L",t+n,e-d*c+r],c?["A",c,c,0,0,h,t+n-f*c,e+r]:null,["L",n+f*l,e+r],l?["A",l,l,0,0,h,n,e+r-d*l]:null,["L",n,d*a+r],a?["A",a,a,0,0,h,f*a+n,r]:null,["Z"]].filter((function(t){return t}))}return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}(R,C,N,k,D&&L.map((function(t){return Se(t,0,Math.min(Math.abs(R)/2,Math.abs(C)/2))})));break;case Yn.PATH:n=f([],u(t.parsedStyle.path.absolutePath),!1)}if(n.length)return function(t,e,n){var r=e.parsedStyle,i=r.defX,o=void 0===i?0:i,a=r.defY,s=void 0===a?0:a;return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=tt(e[1]-o,e[2]-s,0);n&&ut(i,i,n),r="".concat(e[0]).concat(i[0],",").concat(i[1])}else if("Z"===e[0])r=e[0];else if("C"===e[0]){var a=tt(e[1]-o,e[2]-s,0),c=tt(e[3]-o,e[4]-s,0),l=tt(e[5]-o,e[6]-s,0);n&&(ut(a,a,n),ut(c,c,n),ut(l,l,n)),r="".concat(e[0]).concat(a[0],",").concat(a[1],",").concat(c[0],",").concat(c[1],",").concat(l[0],",").concat(l[1])}else if("A"===e[0]){var u=tt(e[6]-o,e[7]-s,0);n&&ut(u,u,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(u[0],",").concat(u[1])}else"Q"===e[0]&&(a=tt(e[1]-o,e[2]-s,0),c=tt(e[3]-o,e[4]-s,0),n&&(ut(a,a,n),ut(c,c,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}"));return t+r}),"")}(n,t,e)}var oo=function(t){if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=Vt(t)}catch(n){e=Vt(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}!function(t){for(var e=0;e<t.length;e++){var n=t[e-1],r=t[e];if("M"===r[0]&&n){var i=n[0],o=[r[1],r[2]],a=void 0;"L"===i||"M"===i?a=[n[1],n[2]]:"C"!==i&&"A"!==i&&"Q"!==i||(a=[n[n.length-2],n[n.length-1]]),a&&Yi(o,a)&&(t.splice(e,1),e--)}}}(e);var n=function(t){for(var e=!1,n=t.length,r=0;r<n;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(e),r=function(t){for(var e=[],n=[],r=[],i=0;i<t.length;i++){var o=t[i],a=o[0];"M"===a?(r.length&&(n.push(r),r=[]),r.push([o[1],o[2]])):"Z"===a?r.length&&(e.push(r),r=[]):r.push([o[1],o[2]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}(e),i=r.polygons,o=r.polylines,a=function(t){for(var e=[],n=null,r=null,i=null,o=0,a=t.length,s=0;s<a;s++){var c=t[s];r=t[s+1];var l=c[0],u={command:l,prePoint:n,params:c,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(l){case"M":i=[c[1],c[2]],o=s;break;case"A":var f=no(n,c);u.arcParams=f}if("Z"===l)n=i,r=t[o+1];else{var d=c.length;n=[c[d-2],c[d-1]]}r&&"Z"===r[0]&&(r=t[o],e[o]&&(e[o].prePoint=n)),u.currentPoint=n,e[o]&&Yi(n,e[o].currentPoint)&&(e[o].prePoint=u.prePoint);var h=r?[r[r.length-2],r[r.length-1]]:null;u.nextPoint=h;var p=u.prePoint;if(["L","H","V"].includes(l))u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]];else if("Q"===l){var g=[c[1],c[2]];u.startTangent=[p[0]-g[0],p[1]-g[1]],u.endTangent=[n[0]-g[0],n[1]-g[1]]}else if("T"===l)g=qi((y=e[s-1]).currentPoint,p),"Q"===y.command?(u.command="Q",u.startTangent=[p[0]-g[0],p[1]-g[1]],u.endTangent=[n[0]-g[0],n[1]-g[1]]):(u.command="TL",u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]]);else if("C"===l){var m=[c[1],c[2]],v=[c[3],c[4]];u.startTangent=[p[0]-m[0],p[1]-m[1]],u.endTangent=[n[0]-v[0],n[1]-v[1]],0===u.startTangent[0]&&0===u.startTangent[1]&&(u.startTangent=[m[0]-v[0],m[1]-v[1]]),0===u.endTangent[0]&&0===u.endTangent[1]&&(u.endTangent=[v[0]-m[0],v[1]-m[1]])}else if("S"===l){var y;m=qi((y=e[s-1]).currentPoint,p),v=[c[1],c[2]],"C"===y.command?(u.command="C",u.startTangent=[p[0]-m[0],p[1]-m[1]],u.endTangent=[n[0]-v[0],n[1]-v[1]]):(u.command="SQ",u.startTangent=[p[0]-v[0],p[1]-v[1]],u.endTangent=[n[0]-v[0],n[1]-v[1]])}else if("A"===l){var _=Qi(u,0),b=_.x,E=_.y,x=Qi(u,1,!1),M=x.x,S=x.y;u.startTangent=[b,E],u.endTangent=[M,S]}e.push(u)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],o=0;o<t.length;o++){var a=(g=t[o]).currentPoint,s=g.params,c=g.prePoint,l=void 0;switch(g.command){case"Q":l=Vn(c[0],c[1],s[1],s[2],s[3],s[4]);break;case"C":l=Fn(c[0],c[1],s[1],s[2],s[3],s[4],s[5],s[6]);break;case"A":var u=g.arcParams;l=Pn(u.cx,u.cy,u.rx,u.ry,u.xRotation,u.startAngle,u.endAngle);break;default:n.push(a[0]),r.push(a[1])}l&&(g.box=l,n.push(l.x,l.x+l.width),r.push(l.y,l.y+l.height)),e&&("L"===g.command||"M"===g.command)&&g.prePoint&&g.nextPoint&&i.push(g)}n=n.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0})),r=r.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}));var f=Ee(n),d=Ee(r),h=be(n),p=be(r);if(0===i.length)return{x:f,y:d,width:h-f,height:p-d};for(o=0;o<i.length;o++){var g;(a=(g=i[o]).currentPoint)[0]===f?f-=$i(g,e).xExtra:a[0]===h&&(h+=$i(g,e).xExtra),a[1]===d?d-=$i(g,e).yExtra:a[1]===p&&(p+=$i(g,e).yExtra)}return{x:f,y:d,width:h-f,height:p-d}}(a,0),c=s.x,l=s.y,u=s.width,f=s.height;return{absolutePath:e,hasArc:n,segments:a,polygons:i,polylines:o,totalLength:0,rect:{x:Number.isFinite(c)?c:0,y:Number.isFinite(l)?l:0,width:Number.isFinite(u)?u:0,height:Number.isFinite(f)?f:0}}},ao=kr(oo);function so(t){return Me(t)?ao(t):oo(t)}function co(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=Kt(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=Kt(e.absolutePath,!1),e.curve=i);var o=[r,i];r.length!==i.length&&(o=ue(r,i));var a,s,c=ce(o[0])!==ce(o[1])?(a=o[0],s=a.slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):a[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map((function(t){return["C"].concat(t.slice(2))})))):function(t){return t.map((function(t){return Array.isArray(t)?[].concat(t):t}))}(o[0]);return[c,se(o[1],c),function(t){return t}]}function lo(t,e){var n;n=Me(t)?t.split(" ").map((function(t){var e=u(t.split(","),2),n=e[0],r=e[1];return[Number(n),Number(r)]})):t;var r,i,o=[],a=0,s=jn(n);n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=Nn(t[0],t[1],n[e+1][0],n[e+1][1]),a+=i,r[1]=a/s,o.push(r))}));var c=Math.min.apply(Math,f([],u(n.map((function(t){return t[0]}))),!1)),l=Math.min.apply(Math,f([],u(n.map((function(t){return t[1]}))),!1));return e&&(e.parsedStyle.defX=c,e.parsedStyle.defY=l),{points:n,totalLength:s,segments:o}}function uo(t,e){return[t.points,e.points,function(t){return t}]}var fo=null;function ho(t){return function(e){var n=0;return t.map((function(t){return t===fo?e[n++]:t}))}}function po(t){return t}var go={matrix:["NNNNNN",[fo,fo,0,0,fo,fo,0,0,0,0,1,0,fo,fo,0,1],po],matrix3d:["NNNNNNNNNNNNNNNN",po],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",ho([fo,fo,new Qr(1)]),po],scalex:["N",ho([fo,new Qr(1),new Qr(1)]),ho([fo,new Qr(1)])],scaley:["N",ho([new Qr(1),fo,new Qr(1)]),ho([new Qr(1),fo])],scalez:["N",ho([new Qr(1),new Qr(1),fo])],scale3d:["NNN",po],skew:["Aa",null,po],skewx:["A",null,ho([fo,ni])],skewy:["A",null,ho([ni,fo])],translate:["Tt",ho([fo,fo,Jr]),po],translatex:["T",ho([fo,Jr,Jr]),ho([fo,Jr])],translatey:["T",ho([Jr,fo,Jr]),ho([Jr,fo])],translatez:["L",ho([Jr,Jr,fo])],translate3d:["TTL",po]};function mo(t){if("none"===(t=(t||"none").toLowerCase().trim()))return[];for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var o=e[1],a=go[o];if(!a)return[];var s=e[2].split(","),c=a[0];if(c.length<s.length)return[];for(var l=[],u=0;u<c.length;u++){var f=s[u],d=c[u],h=void 0;if(void 0===(h=f?{A:function(t){return"0"===t.trim()?ni:Ii(t)},N:Wi,T:Ni,L:wi}[d.toUpperCase()](f):{a:ni,n:l[0],t:Jr}[d]))return[];l.push(h)}if(r.push({t:o,d:l}),n.lastIndex===t.length)return r}return[]}function vo(t){var e,n,r,i;switch(t.t){case"rotatex":return i=ir(Li(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=ir(Li(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=ir(Li(t.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=ir(Li(t.d[3]));var o=e*e+n*n+r*r;if(0===o)e=1,n=0,r=0;else if(1!==o){var a=Math.sqrt(o);e/=a,n/=a,r/=a}var s=Math.sin(i/2),c=s*Math.cos(i/2),l=s*s;return[1-2*(n*n+r*r)*l,2*(e*n*l+r*c),2*(e*r*l-n*c),0,2*(e*n*l-r*c),1-2*(e*e+r*r)*l,2*(n*r*l+e*c),0,2*(e*r*l+n*c),2*(n*r*l-e*c),1-2*(e*e+n*n)*l,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scalex":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaley":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scalez":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var u=ir(Li(t.d[0])),f=ir(Li(t.d[1]));return[1,Math.tan(f),0,0,Math.tan(u),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return i=ir(Li(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=ir(Li(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=Fi(t.d[0],0,null)||0,n=Fi(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Fi(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=Fi(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=Fi(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Fi(t.d[0],0,null)||0,n=Fi(t.d[1],0,null)||0,r=Fi(t.d[2],0,null)||0,1];case"perspective":var d=Fi(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,d?-1/d:0,0,0,0,1];case"matrix":return[t.d[0].value,t.d[1].value,0,0,t.d[2].value,t.d[3].value,0,0,0,0,1,0,t.d[4].value,t.d[5].value,0,1];case"matrix3d":return t.d.map((function(t){return t.value}))}}function yo(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 _o(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],o=[0,0,0,1];return function(t,e,n,r,i,o){if(!function(t,e){var n=e[15];if(0===n)return!1;for(var r=1/n,i=0;i<16;i++)t[i]=e[i]*r;return!0}(lr,t))return!1;if(E(ur,lr),ur[3]=0,ur[7]=0,ur[11]=0,ur[15]=1,Math.abs(O(ur))<1e-8)return!1;var a,s,c=lr[3],l=lr[7],u=lr[11],f=lr[12],d=lr[13],h=lr[14],p=lr[15];if(0!==c||0!==l||0!==u){if(fr[0]=c,fr[1]=l,fr[2]=u,fr[3]=p,!T(ur,ur))return!1;A(ur,ur),vt(i,fr,ur)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=f,e[1]=d,e[2]=h,s=lr,(a=dr)[0][0]=s[0],a[0][1]=s[1],a[0][2]=s[2],a[1][0]=s[4],a[1][1]=s[5],a[1][2]=s[6],a[2][0]=s[8],a[2][1]=s[9],a[2][2]=s[10],n[0]=J(dr[0]),at(dr[0],dr[0]),r[0]=st(dr[0],dr[1]),pr(dr[1],dr[1],dr[0],1,-r[0]),n[1]=J(dr[1]),at(dr[1],dr[1]),r[0]/=n[1],r[1]=st(dr[0],dr[2]),pr(dr[2],dr[2],dr[0],1,-r[1]),r[2]=st(dr[1],dr[2]),pr(dr[2],dr[2],dr[1],1,-r[2]),n[2]=J(dr[2]),at(dr[2],dr[2]),r[1]/=n[2],r[2]/=n[2],ct(hr,dr[1],dr[2]),st(dr[0],hr)<0)for(var g=0;g<3;g++)n[g]*=-1,dr[g][0]*=-1,dr[g][1]*=-1,dr[g][2]*=-1;o[0]=.5*Math.sqrt(Math.max(1+dr[0][0]-dr[1][1]-dr[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-dr[0][0]+dr[1][1]-dr[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-dr[0][0]-dr[1][1]+dr[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+dr[0][0]+dr[1][1]+dr[2][2],0)),dr[2][1]>dr[1][2]&&(o[0]=-o[0]),dr[0][2]>dr[2][0]&&(o[1]=-o[1]),dr[1][0]>dr[0][1]&&(o[2]=-o[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(vo).reduce(yo)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var bo=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;r<4;r++)for(var i=0;i<4;i++)for(var o=0;o<4;o++)n[r][i]+=e[r][o]*t[o][i];return n}return function(e,n,r,i,o){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;s<4;s++)a[s][3]=o[s];for(s=0;s<3;s++)for(var c=0;c<3;c++)a[3][s]+=e[c]*a[c][s];var l=i[0],u=i[1],f=i[2],d=i[3],h=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];h[0][0]=1-2*(u*u+f*f),h[0][1]=2*(l*u-f*d),h[0][2]=2*(l*f+u*d),h[1][0]=2*(l*u+f*d),h[1][1]=1-2*(l*l+f*f),h[1][2]=2*(u*f-l*d),h[2][0]=2*(l*f-u*d),h[2][1]=2*(u*f+l*d),h[2][2]=1-2*(l*l+u*u),a=t(a,h);var p=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];for(r[2]&&(p[2][1]=r[2],a=t(a,p)),r[1]&&(p[2][1]=0,p[2][0]=r[0],a=t(a,p)),r[0]&&(p[2][0]=0,p[1][0]=r[0],a=t(a,p)),s=0;s<3;s++)for(c=0;c<3;c++)a[s][c]*=n[s];return function(t){return 0==t[0][2]&&0==t[0][3]&&0==t[1][2]&&0==t[1][3]&&0==t[2][0]&&0==t[2][1]&&1==t[2][2]&&0==t[2][3]&&0==t[3][2]&&1==t[3][3]}(a)?[a[0][0],a[0][1],a[1][0],a[1][1],a[3][0],a[3][1]]:a[0].concat(a[1],a[2],a[3])}}();function Eo(t){return t.toFixed(6).replace(".000000","")}function xo(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=_o(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=_o(e)),null===n[0]||null===r[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;r<t.length;r++)n+=t[r]*e[r];return n}(t,e);r=Se(r,-1,1);var i=[];if(1===r)i=t;else for(var o=Math.acos(r),a=1*Math.sin(n*o)/Math.sqrt(1-r*r),s=0;s<4;s++)i.push(t[s]*(Math.cos(n*o)-r*a)+e[s]*a);return i}(n[0][3],r[0][3],t[5]);return bo(t[0],t[1],t[2],e,t[4]).map(Eo).join(",")}])}function Mo(t){return t.replace(/[xy]/,"")}function So(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function Ao(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(n){var r=t[n],i=r.t,o=r.d,a="scale"===i.substring(0,5)?1:0;e.push({t:i,d:o.map((function(t){return"number"==typeof t?di(a):di(a,t.unit)}))})},o=0;o<t.length;o++)i(o)}var a,s,c=[],l=[],u=[];if(t.length!==e.length)c=[(y=xo(t,e))[0]],l=[y[1]],u=[["matrix",[y[2]]]];else for(o=0;o<t.length;o++){var f=t[o].t,d=e[o].t,h=t[o].d,p=e[o].d,g=go[f],m=go[d],v=void 0;if(s=d,"perspective"===(a=f)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var y=xo([t[o]],[e[o]]);c.push(y[0]),l.push(y[1]),u.push(["matrix",[y[2]]])}else{if(f===d)v=f;else if(g[2]&&m[2]&&Mo(f)===Mo(d))v=Mo(f),h=g[2](h),p=m[2](p);else{if(!g[1]||!m[1]||So(f)!==So(d)){c=[(y=xo(t,e))[0]],l=[y[1]],u=[["matrix",[y[2]]]];break}v=So(f),h=g[1](h),p=m[1](p)}for(var _=[],b=[],E=[],x=0;x<h.length;x++){y=ki(h[x],p[x],n,!1,x);_[x]=y[0],b[x]=y[1],E.push(y[2])}c.push(_),l.push(b),u.push([v,E])}}if(r){var M=c;c=l,l=M}return[c,l,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return u[e][1][n](t)})).join(",");return"matrix"===u[e][0]&&16===n.split(",").length&&(u[e][0]="matrix3d"),"matrix3d"===u[e][0]&&6===n.split(",").length&&(u[e][0]="matrix"),u[e][0]+"("+n+")"})).join(" ")}]}var To=kr((function(t){if(Me(t)){if("text-anchor"===t)return[di(0,"px"),di(0,"px")];var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[Ni(Oo(e[0])),Ni(Oo(e[1]))]}return[di(t[0]||0,"px"),di(t[1]||0,"px")]}));function Oo(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var Ro=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:pi.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:pi.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:pi.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:pi.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:pi.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:pi.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:pi.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:pi.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:pi.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:pi.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:pi.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:pi.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:pi.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:pi.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:pi.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:pi.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:pi.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:pi.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:pi.FILTER},{n:"clipPath",syntax:pi.DEFINED_PATH},{n:"textPath",syntax:pi.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:pi.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:pi.TRANSFORM},{n:"transformOrigin",p:100,d:function(t){return t===Yn.CIRCLE||t===Yn.ELLIPSE?"center":t===Yn.TEXT?"text-anchor":"left top"},l:!0,syntax:pi.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(t){return t===Yn.CIRCLE||t===Yn.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:pi.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:pi.COORDINATE},{n:"cy",int:!0,d:"0",syntax:pi.COORDINATE},{n:"cz",int:!0,d:"0",syntax:pi.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:pi.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:pi.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:pi.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:pi.COORDINATE},{n:"y",int:!0,d:"0",syntax:pi.COORDINATE},{n:"z",int:!0,d:"0",syntax:pi.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:pi.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:pi.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:pi.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:pi.COORDINATE},{n:"y1",int:!0,l:!0,syntax:pi.COORDINATE},{n:"z1",int:!0,l:!0,syntax:pi.COORDINATE},{n:"x2",int:!0,l:!0,syntax:pi.COORDINATE},{n:"y2",int:!0,l:!0,syntax:pi.COORDINATE},{n:"z2",int:!0,l:!0,syntax:pi.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:pi.PATH,p:50},{n:"points",int:!0,l:!0,syntax:pi.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:pi.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:pi.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:pi.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:pi.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:pi.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:pi.NUMBER,d:function(t){return t===Yn.PATH||t===Yn.POLYGON||t===Yn.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:pi.MARKER},{n:"markerEnd",syntax:pi.MARKER},{n:"markerMid",syntax:pi.MARKER},{n:"markerStartOffset",syntax:pi.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:pi.LENGTH,l:!0,int:!0,d:"0"}],Po=Ro.filter((function(t){return!!t.l})).map((function(t){return t.n})),Co={},wo=new WeakMap,No=function(){function t(t){var e=this;this.runtime=t,Ro.forEach((function(t){e.registerMetadata(t)}))}return t.prototype.registerMetadata=function(t){f([t.n],u(t.a||[]),!1).forEach((function(e){Co[e]=t}))},t.prototype.unregisterMetadata=function(t){delete Co[t]},t.prototype.getPropertySyntax=function(t){return this.runtime.CSSPropertySyntaxFactory[t]},t.prototype.processProperties=function(t,e,n){var r=this;if(void 0===n&&(n={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[]}),!this.runtime.enableCSSParsing){Object.assign(t.attributes,e);var o=Object.keys(e),a=t.parsedStyle.clipPath,s=t.parsedStyle.offsetPath;t.parsedStyle=Object.assign(t.parsedStyle,e);var c=!!n.forceUpdateGeometry;if(!c)for(var l=0;l<Po.length;l++)if(Po[l]in e){c=!0;break}return e.fill&&(t.parsedStyle.fill=Ri(e.fill)),e.stroke&&(t.parsedStyle.stroke=Ri(e.stroke)),e.shadowColor&&(t.parsedStyle.shadowColor=Ri(e.shadowColor)),e.filter&&(t.parsedStyle.filter=ji(e.filter)),he(e.radius)||(t.parsedStyle.radius=Di(e.radius,4)),he(e.lineDash)||(t.parsedStyle.lineDash=Di(e.lineDash,2)),e.points&&(t.parsedStyle.points=lo(e.points,t)),""===e.path&&(t.parsedStyle.path=i({},gi)),e.path&&(t.parsedStyle.path=so(e.path),t.parsedStyle.defX=t.parsedStyle.path.rect.x,t.parsedStyle.defY=t.parsedStyle.path.rect.y),e.textTransform&&this.runtime.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:e.textTransform},t,null),e.clipPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",a,e.clipPath,t,this.runtime),e.offsetPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",s,e.offsetPath,t,this.runtime),e.anchor&&(t.parsedStyle.anchor=Di(e.anchor,2)),e.transform&&(t.parsedStyle.transform=mo(e.transform)),e.transformOrigin&&(t.parsedStyle.transformOrigin=To(e.transformOrigin)),e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerStart,e.markerStart,null,null)),e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerEnd,e.markerEnd,null,null)),e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator("",e.markerMid,e.markerMid,null,null)),(t.nodeName!==Yn.CIRCLE&&t.nodeName!==Yn.ELLIPSE||he(e.cx)&&he(e.cy))&&(t.nodeName!==Yn.RECT&&t.nodeName!==Yn.IMAGE&&t.nodeName!==Yn.GROUP&&t.nodeName!==Yn.HTML&&t.nodeName!==Yn.TEXT&&t.nodeName!==Yn.MESH||he(e.x)&&he(e.y)&&he(e.z))&&(t.nodeName!==Yn.LINE||he(e.x1)&&he(e.y1)&&he(e.z1)&&he(e.x2)&&he(e.y2)&&he(e.z2))||this.runtime.CSSPropertySyntaxFactory["<coordinate>"].postProcessor(t,o),he(e.zIndex)||this.runtime.CSSPropertySyntaxFactory["<z-index>"].postProcessor(t,o),e.path&&this.runtime.CSSPropertySyntaxFactory["<path>"].postProcessor(t,o),e.points&&this.runtime.CSSPropertySyntaxFactory["<list-of-points>"].postProcessor(t,o),he(e.offsetDistance)||this.runtime.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(t,o),e.transform&&this.runtime.CSSPropertySyntaxFactory["<transform>"].postProcessor(t,o),void(c&&this.updateGeometry(t))}var u=n.skipUpdateAttribute,f=n.skipParse,d=n.forceUpdateGeometry,h=n.usedAttributes,p=d,g=Object.keys(e);g.forEach((function(n){var r;u||(t.attributes[n]=e[n]),!p&&(null===(r=Co[n])||void 0===r?void 0:r.l)&&(p=!0)})),f||g.forEach((function(e){t.computedStyle[e]=r.parseProperty(e,t.attributes[e],t)})),(null==h?void 0:h.length)&&(g=Array.from(new Set(g.concat(h)))),g.forEach((function(e){e in t.computedStyle&&(t.parsedStyle[e]=r.computeProperty(e,t.computedStyle[e],t))})),p&&this.updateGeometry(t),g.forEach((function(e){e in t.parsedStyle&&r.postProcessProperty(e,t,g)})),this.runtime.enableCSSParsing&&t.children.length&&g.forEach((function(e){e in t.parsedStyle&&r.isPropertyInheritable(e)&&t.children.forEach((function(t){t.internalSetAttribute(e,null,{skipUpdateAttribute:!0,skipParse:!0})}))}))},t.prototype.parseProperty=function(t,e,n){var r=Co[t],i=e;if((""===e||he(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)i=ci(e);else if(r){var o=r.k,a=r.syntax,s=a&&this.getPropertySyntax(a);o&&o.indexOf(e)>-1?i=ci(e):s&&s.parser&&(i=s.parser(e,n))}return i},t.prototype.computeProperty=function(t,e,n){var r=Co[t],i="g-root"===n.id,o=e;if(r){var a=r.syntax,s=r.inh,c=r.d;if(e instanceof Vr){var l=e.value;if("unset"===l&&(l=s&&!i?"inherit":"initial"),"initial"===l)he(c)||(e=this.parseProperty(t,Yr(c)?c(n.nodeName):c,n));else if("inherit"===l){var u=this.tryToResolveProperty(n,t,{inherited:!0});return he(u)?void this.addUnresolveProperty(n,t):u}}var f=a&&this.getPropertySyntax(a);if(f&&f.calculator){var d=n.parsedStyle[t];o=f.calculator(t,d,e,n,this.runtime)}else o=e instanceof Vr?e.value:e}return o},t.prototype.postProcessProperty=function(t,e,n){var r=Co[t];if(r&&r.syntax){var i=r.syntax&&this.getPropertySyntax(r.syntax);i&&i.postProcessor&&i.postProcessor(e,n)}},t.prototype.addUnresolveProperty=function(t,e){var n=wo.get(t);n||(wo.set(t,[]),n=wo.get(t)),-1===n.indexOf(e)&&n.push(e)},t.prototype.tryToResolveProperty=function(t,e,n){if(void 0===n&&(n={}),n.inherited&&t.parentElement&&function(t,e){var n=wo.get(t);return!n||0===n.length||n.includes(e)}(t.parentElement,e)){var r=t.parentElement.parsedStyle[e];if("unset"===r||"initial"===r||"inherit"===r)return;return r}},t.prototype.recalc=function(t){var e=wo.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),wo.delete(t)}},t.prototype.updateGeometry=function(t){var e=t.nodeName,n=this.runtime.geometryUpdaterFactory[e];if(n){var r=t.geometry;r.contentBounds||(r.contentBounds=new mr),r.renderBounds||(r.renderBounds=new mr);var i=t.parsedStyle,o=n.update(i,t),a=o.width,s=o.height,c=o.depth,l=void 0===c?0:c,u=o.offsetX,f=void 0===u?0:u,d=o.offsetY,h=void 0===d?0:d,p=o.offsetZ,g=void 0===p?0:p,m=[Math.abs(a)/2,Math.abs(s)/2,l/2],v=i,y=v.stroke,_=v.lineWidth,b=v.increasedLineWidthForHitTesting,E=v.shadowType,x=v.shadowColor,M=v.filter,S=void 0===M?[]:M,A=v.transformOrigin,T=i.anchor;e===Yn.TEXT?delete i.anchor:e===Yn.MESH&&(i.anchor[2]=.5);var O=[(1-2*(T&&T[0]||0))*a/2+f,(1-2*(T&&T[1]||0))*s/2+h,(1-2*(T&&T[2]||0))*m[2]+g];r.contentBounds.update(O,m);var R=e===Yn.POLYLINE||e===Yn.POLYGON||e===Yn.PATH?Math.SQRT2:.5;if(y&&!y.isNone){var P=((_||0)+(b||0))*R;m[0]+=P,m[1]+=P}if(r.renderBounds.update(O,m),x&&E&&"inner"!==E){var C=r.renderBounds,w=C.min,N=C.max,I=i,k=I.shadowBlur||0,L=I.shadowOffsetX||0,D=I.shadowOffsetY||0,B=w[0]-k+L,F=N[0]+k+L,U=w[1]-k+D,j=N[1]+k+D;w[0]=Math.min(w[0],B),N[0]=Math.max(N[0],F),w[1]=Math.min(w[1],U),N[1]=Math.max(N[1],j),r.renderBounds.setMinMax(w,N)}S.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,tr(r.renderBounds.halfExtents,r.renderBounds.halfExtents,[i,i,0]))}else if("drop-shadow"===e){var o=n[0].value,a=n[1].value,s=n[2].value,c=r.renderBounds,l=c.min,u=c.max,f=l[0]-s+o,d=u[0]+s+o,h=l[1]-s+a,p=u[1]+s+a;l[0]=Math.min(l[0],f),u[0]=Math.max(u[0],d),l[1]=Math.min(l[1],h),u[1]=Math.max(u[1],p),r.renderBounds.setMinMax(l,u)}})),T=i.anchor;var G=a<0,W=s<0,z=(G?-1:1)*(A?Fi(A[0],0,t):0),V=(W?-1:1)*(A?Fi(A[1],1,t):0);z-=(G?-1:1)*(T&&T[0]||0)*r.contentBounds.halfExtents[0]*2,V-=(W?-1:1)*(T&&T[1]||0)*r.contentBounds.halfExtents[1]*2,t.setOrigin(z,V),this.runtime.sceneGraphService.dirtifyToRoot(t)}},t.prototype.isPropertyInheritable=function(t){var e=Co[t];return!!e&&e.inh},t}(),Io=function(){function t(){this.parser=Ii,this.parserWithCSSDisabled=null,this.mixer=zi}return t.prototype.calculator=function(t,e,n,r){return Li(n)},t}(),ko=function(){function t(){}return t.prototype.calculator=function(t,e,n,r,i){return n instanceof Vr&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)})),n},t}(),Lo=function(){function t(){this.parser=Ri,this.parserWithCSSDisabled=Ri,this.mixer=Pi}return t.prototype.calculator=function(t,e,n,r){return n instanceof Vr?"none"===n.value?li:ui:n},t}(),Do=function(){function t(){this.parser=ji}return t.prototype.calculator=function(t,e,n){return n instanceof Vr?[]:n},t}();function Bo(t){var e=t.parsedStyle.fontSize;return he(e)?null:e}var Fo=function(){function t(){this.parser=Ni,this.parserWithCSSDisabled=null,this.mixer=zi}return t.prototype.calculator=function(t,e,n,r,i){var o;if(Ae(n))return n;if(!Qr.isRelativeUnit(n.unit))return n.value;var a=i.styleValueRegistry;if(n.unit===Tr.kPercentage)return 0;if(n.unit===Tr.kEms){if(r.parentNode){if(s=Bo(r.parentNode))return s*=n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}if(n.unit===Tr.kRems){if(null===(o=null==r?void 0:r.ownerDocument)||void 0===o?void 0:o.documentElement){var s;if(s=Bo(r.ownerDocument.documentElement))return s*=n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}},t}(),Uo=function(){function t(){this.mixer=Hi}return t.prototype.parser=function(t){var e=Bi(Ae(t)?[t]:t);return 1===e.length?[e[0],e[0]]:[e[0],e[1]]},t.prototype.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),jo=function(){function t(){this.mixer=Hi}return t.prototype.parser=function(t){var e=Bi(Ae(t)?[t]:t);return 1===e.length?[e[0],e[0],e[0],e[0]]:2===e.length?[e[0],e[1],e[0],e[1]]:3===e.length?[e[0],e[1],e[2],e[1]]:[e[0],e[1],e[2],e[3]]},t.prototype.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),Go=_();function Wo(t,e){var n=e.parsedStyle.defX||0,r=e.parsedStyle.defY||0;return e.resetLocalTransform(),e.setLocalPosition(n,r),t.forEach((function(t){var i=t.t,o=t.d;if("scale"===i){var a=(null==o?void 0:o.map((function(t){return t.value})))||[1,1];e.scaleLocal(a[0],a[1],1)}else if("scalex"===i){a=(null==o?void 0:o.map((function(t){return t.value})))||[1];e.scaleLocal(a[0],1,1)}else if("scaley"===i){a=(null==o?void 0:o.map((function(t){return t.value})))||[1];e.scaleLocal(1,a[0],1)}else if("scalez"===i){a=(null==o?void 0:o.map((function(t){return t.value})))||[1];e.scaleLocal(1,1,a[0])}else if("scale3d"===i){a=(null==o?void 0:o.map((function(t){return t.value})))||[1,1,1];e.scaleLocal(a[0],a[1],a[2])}else if("translate"===i){var s=o||[Jr,Jr];e.translateLocal(s[0].value,s[1].value,0)}else if("translatex"===i){s=o||[Jr];e.translateLocal(s[0].value,0,0)}else if("translatey"===i){s=o||[Jr];e.translateLocal(0,s[0].value,0)}else if("translatez"===i){s=o||[Jr];e.translateLocal(0,0,s[0].value)}else if("translate3d"===i){s=o||[Jr,Jr,Jr];e.translateLocal(s[0].value,s[1].value,s[2].value)}else if("rotate"===i){var c=o||[ni];e.rotateLocal(0,0,Li(c[0]))}else if("rotatex"===i){c=o||[ni];e.rotateLocal(Li(c[0]),0,0)}else if("rotatey"===i){c=o||[ni];e.rotateLocal(0,Li(c[0]),0)}else if("rotatez"===i){c=o||[ni];e.rotateLocal(0,0,Li(c[0]))}else if("rotate3d"===i);else if("skew"===i){var l=(null==o?void 0:o.map((function(t){return t.value})))||[0,0];e.setLocalSkew(ir(l[0]),ir(l[1]))}else if("skewx"===i){l=(null==o?void 0:o.map((function(t){return t.value})))||[0];e.setLocalSkew(ir(l[0]),e.getLocalSkew()[1])}else if("skewy"===i){l=(null==o?void 0:o.map((function(t){return t.value})))||[0];e.setLocalSkew(e.getLocalSkew()[0],ir(l[0]))}else if("matrix"===i){var d=u(o.map((function(t){return t.value})),6),h=d[0],p=d[1],g=d[2],m=d[3],v=d[4],y=d[5];e.setLocalTransform(M(Go,h,p,0,0,g,m,0,0,0,0,1,0,v+n,y+r,0,1))}else"matrix3d"===i&&(M.apply(K,f([Go],u(o.map((function(t){return t.value}))),!1)),Go[12]+=n,Go[13]+=r,e.setLocalTransform(Go))})),e.getLocalTransform()}var zo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.postProcessor=function(t,e){var n,r,i;switch(t.nodeName){case Yn.CIRCLE:case Yn.ELLIPSE:var o=t.parsedStyle,a=o.cx,s=o.cy,c=o.cz;he(a)||(n=a),he(s)||(r=s),he(c)||(i=c);break;case Yn.LINE:var l=t.parsedStyle,f=l.x1,d=l.x2,h=l.y1,p=l.y2;n=Math.min(f,d),r=Math.min(h,p),i=0;break;case Yn.RECT:case Yn.IMAGE:case Yn.GROUP:case Yn.HTML:case Yn.TEXT:case Yn.MESH:he(t.parsedStyle.x)||(n=t.parsedStyle.x),he(t.parsedStyle.y)||(r=t.parsedStyle.y),he(t.parsedStyle.z)||(i=t.parsedStyle.z)}if(t.nodeName!==Yn.PATH&&t.nodeName!==Yn.POLYLINE&&t.nodeName!==Yn.POLYGON&&(t.parsedStyle.defX=n||0,t.parsedStyle.defY=r||0),(!he(n)||!he(r)||!he(i))&&-1===e.indexOf("transform")){var g=t.parsedStyle.transform;if(g&&g.length)Wo(g,t);else{var m=u(t.getLocalPosition(),3),v=m[0],y=m[1],_=m[2];t.setLocalPosition(he(n)?v:n,he(r)?y:r,he(i)?_:i)}}},e}(Fo),Vo=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){n instanceof Vr&&(n=null);var i=null==n?void 0:n.cloneNode(!0);return i&&(i.style.isMarker=!0),i},t}(),Ho=function(){function t(){this.mixer=zi,this.parser=Wi,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(t,e,n){return n.value},t}(),Xo=function(){function t(){this.parser=Wi,this.parserWithCSSDisabled=null,this.mixer=Vi(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t.prototype.postProcessor=function(t){var e=t.parsedStyle,n=e.offsetPath,r=e.offsetDistance;if(n){var i=n.nodeName;if(i===Yn.LINE||i===Yn.PATH||i===Yn.POLYLINE){var o=n.getPoint(r);o&&(t.parsedStyle.defX=o.x,t.parsedStyle.defY=o.y,t.setLocalPosition(o.x,o.y))}}},t}(),Yo=function(){function t(){this.parser=Wi,this.parserWithCSSDisabled=null,this.mixer=Vi(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),$o=function(){function t(){this.parser=so,this.parserWithCSSDisabled=so,this.mixer=co}return t.prototype.calculator=function(t,e,n){return n instanceof Vr&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Mr(0,0,0,0)}:n},t.prototype.postProcessor=function(t,e){if(t.parsedStyle.defX=t.parsedStyle.path.rect.x,t.parsedStyle.defY=t.parsedStyle.path.rect.y,t.nodeName===Yn.PATH&&-1===e.indexOf("transform")){var n=t.parsedStyle,r=n.defX,i=void 0===r?0:r,o=n.defY,a=void 0===o?0:o;t.setLocalPosition(i,a)}},t}(),qo=function(){function t(){this.parser=lo,this.mixer=uo}return t.prototype.postProcessor=function(t,e){if((t.nodeName===Yn.POLYGON||t.nodeName===Yn.POLYLINE)&&-1===e.indexOf("transform")){var n=t.parsedStyle,r=n.defX,i=n.defY;t.setLocalPosition(r,i)}},t}(),Ko=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.mixer=Vi(0,1/0),e}return r(e,t),e}(Fo),Zo=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof Vr?"unset"===n.value?"":n.value:"".concat(n)},t.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""},t}(),Qo=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i=r.getAttribute("text");if(i){var o=i;"capitalize"===n.value?o=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?o=i.toLowerCase():"uppercase"===n.value&&(o=i.toUpperCase()),r.parsedStyle.text=o}return n.value},t}(),Jo={},ta=0;var ea="undefined"!=typeof window&&void 0!==window.document;function na(t){return!!t.getAttribute}function ra(t,e){var n=Number(t.parsedStyle.zIndex),r=Number(e.parsedStyle.zIndex);if(n===r){var i=t.parentNode;if(i){var o=i.childNodes||[];return o.indexOf(t)-o.indexOf(e)}}return n-r}function ia(t){var e,n=t;do{if(null===(e=n.parsedStyle)||void 0===e?void 0:e.clipPath)return n;n=n.parentElement}while(null!==n);return null}function oa(t,e){if(ea)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var aa={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},sa="object"==typeof performance&&performance.now?performance:Date;function ca(t,e,n){var r=!1,i=!1,o=!!e&&!e.isNone,a=!!n&&!n.isNone;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=o,i=a):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]}var la=1,ua="object"==typeof self&&self.self==self?self:"object"==typeof e&&e.global==e?e:{},fa=Date.now(),da={},ha=Date.now(),pa=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-ha,r=n>16?0:16-n,i=la++;return da[i]=t,Object.keys(da).length>1||setTimeout((function(){ha=e;var t=da;da={},Object.keys(t).forEach((function(e){return t[e](ua.performance&&"function"==typeof ua.performance.now?ua.performance.now():Date.now()-fa)}))}),r),i},ga=function(t){delete da[t]},ma=function(t){return"string"!=typeof t?pa:""===t?ua.requestAnimationFrame:ua[t+"RequestAnimationFrame"]},va=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],(function(t){return!!ma(t)})),ya=ma(va),_a=function(t){return"string"!=typeof t?ga:""===t?ua.cancelAnimationFrame:ua[t+"CancelAnimationFrame"]||ua[t+"CancelRequestAnimationFrame"]}(va);ua.requestAnimationFrame=ya,ua.cancelAnimationFrame=_a;var ba=function(){function t(){this.callbacks=[]}return t.prototype.getCallbacksNum=function(){return this.callbacks.length},t.prototype.tapPromise=function(t,e){this.callbacks.push(e)},t.prototype.promise=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Promise.all(this.callbacks.map((function(e){return e.apply(void 0,f([],u(t),!1))})))},t}(),Ea=function(){function t(){this.callbacks=[]}return t.prototype.tapPromise=function(t,e){this.callbacks.push(e)},t.prototype.promise=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return s(this,void 0,void 0,(function(){var e,n,r;return c(this,(function(i){switch(i.label){case 0:return this.callbacks.length?[4,(r=this.callbacks)[0].apply(r,f([],u(t),!1))]:[3,6];case 1:e=i.sent(),n=0,i.label=2;case 2:return n<this.callbacks.length-1?[4,(0,this.callbacks[n])(e)]:[3,5];case 3:e=i.sent(),i.label=4;case 4:return n++,[3,2];case 5:return[2,e];case 6:return[2,null]}}))}))},t}(),xa=function(){function t(){this.callbacks=[]}return t.prototype.tap=function(t,e){this.callbacks.push(e)},t.prototype.call=function(){var t=arguments;this.callbacks.forEach((function(e){e.apply(void 0,t)}))},t}(),Ma=function(){function t(){this.callbacks=[]}return t.prototype.tap=function(t,e){this.callbacks.push(e)},t.prototype.call=function(){if(this.callbacks.length){for(var t=arguments,e=this.callbacks[0].apply(void 0,t),n=0;n<this.callbacks.length-1;n++){e=(0,this.callbacks[n])(e)}return e}return null},t}(),Sa=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Aa=/([\"\'])[^\'\"]+\1/;var Ta=function(){function t(){this.parser=mo,this.parserWithCSSDisabled=mo,this.mixer=Ao}return t.prototype.calculator=function(t,e,n,r){return n instanceof Vr?[]:n},t.prototype.postProcessor=function(t){Wo(t.parsedStyle.transform,t)},t}(),Oa=function(){this.parser=To},Ra=function(){function t(){this.parser=Wi}return t.prototype.calculator=function(t,e,n,r){return n.value},t.prototype.postProcessor=function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,r=e.sortable;n&&(n.dirty=!0),r&&(r.dirty=!0,r.dirtyReason=ei.Z_INDEX_CHANGED)}},t}(),Pa=function(){function t(){}return t.prototype.update=function(t,e){var n=t.r;return{width:2*n,height:2*n}},t}(),Ca=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}},t}(),wa=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=Math.min(e,r),a=Math.max(e,r),s=Math.min(n,i);return{width:a-o,height:Math.max(n,i)-s}},t}(),Na=function(){function t(){}return t.prototype.update=function(t){var e=t.path.rect;return{width:e.width,height:e.height}},t}(),Ia=function(){function t(){}return t.prototype.update=function(t){var e=t.points.points,n=Math.min.apply(Math,f([],u(e.map((function(t){return t[0]}))),!1)),r=Math.max.apply(Math,f([],u(e.map((function(t){return t[0]}))),!1)),i=Math.min.apply(Math,f([],u(e.map((function(t){return t[1]}))),!1)),o=Math.max.apply(Math,f([],u(e.map((function(t){return t[1]}))),!1));return{width:r-n,height:o-i}},t}(),ka=function(){function t(){}return t.prototype.update=function(t,e){var n=t.img,r=t.width,i=void 0===r?0:r,o=t.height,a=i,s=void 0===o?0:o;return n&&!Me(n)&&(a||(a=n.width,t.width=a),s||(s=n.height,t.height=s)),{width:a,height:s}},t}(),La=function(){function t(t){this.globalRuntime=t}return t.prototype.isReadyToMeasure=function(t,e){var n=t.text,r=t.textAlign,i=t.textBaseline,o=t.fontSize,a=t.fontStyle,s=t.fontWeight,c=t.fontVariant,l=t.lineWidth;return n&&o&&a&&s&&c&&r&&i&&!he(l)},t.prototype.update=function(t,e){var n,r,i=t.text,o=t.textAlign,a=t.lineWidth,s=t.textBaseline,c=t.dx,l=t.dy;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0};var u=((null===(r=null===(n=null==e?void 0:e.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===r?void 0:r.getConfig())||{}).offscreenCanvas,f=this.globalRuntime.textService.measureText(i,t,u);t.metrics=f;var d=f.width,h=f.height,p=f.lineHeight,g=f.fontProperties,m=[d/2,h/2,0],v=[0,1],y=0;"center"===o||"middle"===o?(y=a/2,v=[.5,1]):"right"!==o&&"end"!==o||(y=a,v=[1,1]);var _=0;return"middle"===s?_=m[1]:"top"===s||"hanging"===s?_=2*m[1]:"alphabetic"===s?_=this.globalRuntime.enableCSSParsing?p-g.ascent:0:"bottom"!==s&&"ideographic"!==s||(_=0),c&&(y+=c),l&&(_+=l),t.anchor=[v[0],v[1],0],{width:2*m[0],height:2*m[1],offsetX:y,offsetY:_}},t}();var Da,Ba=function(){function t(e){this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new xr,this.page=new xr,this.canvas=new xr,this.viewport=new xr,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}return Object.defineProperty(t.prototype,"name",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerX",{get:function(){return this.layer.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerY",{get:function(){return this.layer.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageX",{get:function(){return this.page.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageY",{get:function(){return this.page.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasX",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasY",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportX",{get:function(){return this.viewport.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportY",{get:function(){return this.viewport.y},enumerable:!1,configurable:!0}),t.prototype.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},Object.defineProperty(t.prototype,"propagationPath",{get:function(){return this.composedPath()},enumerable:!1,configurable:!0}),t.prototype.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},t.prototype.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t.prototype.initEvent=function(){},t.prototype.initUIEvent=function(){},t.prototype.clone=function(){throw new Error(Sr)},t}(),Fa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.client=new xr,e.movement=new xr,e.offset=new xr,e.global=new xr,e.screen=new xr,e}return r(e,t),Object.defineProperty(e.prototype,"clientX",{get:function(){return this.client.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clientY",{get:function(){return this.client.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementX",{get:function(){return this.movement.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementY",{get:function(){return this.movement.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetX",{get:function(){return this.offset.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetY",{get:function(){return this.offset.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalX",{get:function(){return this.global.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalY",{get:function(){return this.global.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenX",{get:function(){return this.screen.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenY",{get:function(){return this.screen.y},enumerable:!1,configurable:!0}),e.prototype.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},e.prototype.initMouseEvent=function(){throw new Error(Sr)},e}(Ba),Ua=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.width=0,e.height=0,e.isPrimary=!1,e}return r(e,t),e.prototype.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},e.prototype.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},e.prototype.clone=function(){return this.manager.clonePointerEvent(this)},e}(Fa),ja=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(Fa),Ga=function(t){function e(e,n){var r=t.call(this,null)||this;return r.type=e,r.detail=n,Object.assign(r,n),r}return r(e,t),e}(Ba),Wa=function(){function t(){this.emitter=new p}return t.prototype.on=function(t,e,n){return this.addEventListener(t,e,n),this},t.prototype.addEventListener=function(t,e,n){var r=ke(n)&&n||ve(n)&&n.capture,i=ve(n)&&n.once,o=Yr(e)?void 0:e,a=!1,s="";if(t.indexOf(":")>-1){var c=u(t.split(":"),2),l=c[0];t=c[1],s=l,a=!0}if(t=r?"".concat(t,"capture"):t,e=Yr(e)?e:e.handleEvent,a){var d=e;e=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];(null===(t=e[0].target)||void 0===t?void 0:t.name)===s&&d.apply(void 0,f([],u(e),!1))}}return i?this.emitter.once(t,e,o):this.emitter.on(t,e,o),this},t.prototype.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},t.prototype.removeAllEventListeners=function(){this.emitter.removeAllListeners()},t.prototype.removeEventListener=function(t,e,n){var r=ke(n)&&n||ve(n)&&n.capture,i=Yr(e)?void 0:e;return t=r?"".concat(t,"capture"):t,e=Yr(e)?e:null==e?void 0:e.handleEvent,this.emitter.off(t,e,i),this},t.prototype.emit=function(t,e){this.dispatchEvent(new Ga(t,e))},t.prototype.dispatchEvent=function(t,e){var n,r,i;if(void 0===e&&(e=!1),!function(t){return!!t.type}(t))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");if(i=this.document?this:this.defaultView?this.defaultView:null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView){if(t.manager=i.getEventService()||null,!t.manager)return!1;t.defaultPrevented=!1,t.path=[],e||(t.target=this),null===(r=t.manager)||void 0===r||r.dispatchEvent(t,t.type,e)}return!t.defaultPrevented},t}(),za=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.shadow=!1,e.ownerDocument=null,e.isConnected=!1,e.baseURI="",e.childNodes=[],e.nodeType=0,e.nodeName="",e.nodeValue=null,e.parentNode=null,e}return r(e,t),e.isNode=function(t){return!!t.childNodes},Object.defineProperty(e.prototype,"textContent",{get:function(){var t,e,n="";this.nodeName===Yn.TEXT&&(n+=this.style.text);try{for(var r=l(this.childNodes),i=r.next();!i.done;i=r.next()){var o=i.value;o.nodeName===Yn.TEXT?n+=o.nodeValue:n+=o.textContent}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},set:function(t){var e=this;this.childNodes.slice().forEach((function(t){e.removeChild(t)})),this.nodeName===Yn.TEXT&&(this.style.text="".concat(t))},enumerable:!1,configurable:!0}),e.prototype.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},e.prototype.hasChildNodes=function(){return this.childNodes.length>0},e.prototype.isDefaultNamespace=function(t){throw new Error(Sr)},e.prototype.lookupNamespaceURI=function(t){throw new Error(Sr)},e.prototype.lookupPrefix=function(t){throw new Error(Sr)},e.prototype.normalize=function(){throw new Error(Sr)},e.prototype.isEqualNode=function(t){return this===t},e.prototype.isSameNode=function(t){return this.isEqualNode(t)},Object.defineProperty(e.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstChild",{get:function(){return this.childNodes.length>0?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastChild",{get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),e.prototype.compareDocumentPosition=function(t){var n;if(t===this)return 0;for(var r=t,i=this,o=[r],a=[i];null!==(n=r.parentNode)&&void 0!==n?n:i.parentNode;)r=r.parentNode?(o.push(r.parentNode),r.parentNode):r,i=i.parentNode?(a.push(i.parentNode),i.parentNode):i;if(r!==i)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var s=o.length>a.length?o:a,c=s===o?a:o;if(s[s.length-c.length]===c[0])return s===o?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var l=s.length-c.length,u=c.length-1;u>=0;u--){var f=c[u],d=s[l+u];if(d!==f){var h=f.parentNode.childNodes;return h.indexOf(f)<h.indexOf(d)?c===o?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:s===o?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING},e.prototype.contain=function(t){return this.contains(t)},e.prototype.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},e.prototype.getAncestor=function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e},e.prototype.forEach=function(t,e){void 0===e&&(e=!1),t(this)||(e?this.childNodes.slice():this.childNodes).forEach((function(e){e.forEach(t)}))},e.DOCUMENT_POSITION_DISCONNECTED=1,e.DOCUMENT_POSITION_PRECEDING=2,e.DOCUMENT_POSITION_FOLLOWING=4,e.DOCUMENT_POSITION_CONTAINS=8,e.DOCUMENT_POSITION_CONTAINED_BY=16,e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,e}(Wa),Va=function(){function t(t,e){var n=this;this.globalRuntime=t,this.context=e,this.emitter=new p,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=_(),this.tmpVec3=Z(),this.onPointerDown=function(t){var e=n.createPointerEvent(t);if(n.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)n.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){var r=2===e.button;n.dispatchEvent(e,r?"rightdown":"mousedown")}n.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),n.freeEvent(e)},this.onPointerUp=function(t){var e,r=sa.now(),i=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);if(n.dispatchEvent(i,"pointerup"),"touch"===i.pointerType)n.dispatchEvent(i,"touchend");else if("mouse"===i.pointerType||"pen"===i.pointerType){var o=2===i.button;n.dispatchEvent(i,o?"rightup":"mouseup")}var a=n.trackingData(t.pointerId),s=n.findMountedTarget(a.pressTargetsByButton[t.button]),c=s;if(s&&!i.composedPath().includes(s)){for(var l=s;l&&!i.composedPath().includes(l);){if(i.currentTarget=l,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType)n.notifyTarget(i,"touchendoutside");else if("mouse"===i.pointerType||"pen"===i.pointerType){o=2===i.button;n.notifyTarget(i,o?"rightupoutside":"mouseupoutside")}za.isNode(l)&&(l=l.parentNode)}delete a.pressTargetsByButton[t.button],c=l}if(c){var u=n.clonePointerEvent(i,"click");u.target=c,u.path=[],a.clicksByButton[t.button]||(a.clicksByButton[t.button]={clickCount:0,target:u.target,timeStamp:r});var f=a.clicksByButton[t.button];f.target===u.target&&r-f.timeStamp<200?++f.clickCount:f.clickCount=1,f.target=u.target,f.timeStamp=r,u.detail=f.clickCount,(null===(e=i.detail)||void 0===e?void 0:e.preventClick)||(n.context.config.useNativeClickEvent||"mouse"!==u.pointerType&&"touch"!==u.pointerType||n.dispatchEvent(u,"click"),n.dispatchEvent(u,"pointertap")),n.freeEvent(u)}n.freeEvent(i)},this.onPointerMove=function(t){var e=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0),r="mouse"===e.pointerType||"pen"===e.pointerType,i=n.trackingData(t.pointerId),o=n.findMountedTarget(i.overTargets);if(i.overTargets&&o!==e.target){var a="mousemove"===t.type?"mouseout":"pointerout",s=n.createPointerEvent(t,a,o||void 0);if(n.dispatchEvent(s,"pointerout"),r&&n.dispatchEvent(s,"mouseout"),!e.composedPath().includes(o)){var c=n.createPointerEvent(t,"pointerleave",o||void 0);for(c.eventPhase=c.AT_TARGET;c.target&&!e.composedPath().includes(c.target);)c.currentTarget=c.target,n.notifyTarget(c),r&&n.notifyTarget(c,"mouseleave"),za.isNode(c.target)&&(c.target=c.target.parentNode);n.freeEvent(c)}n.freeEvent(s)}if(o!==e.target){var l="mousemove"===t.type?"mouseover":"pointerover",u=n.clonePointerEvent(e,l);n.dispatchEvent(u,"pointerover"),r&&n.dispatchEvent(u,"mouseover");for(var f=o&&za.isNode(o)&&o.parentNode;f&&f!==(za.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&f!==e.target;)f=f.parentNode;if(!f||f===(za.isNode(n.rootTarget)&&n.rootTarget.parentNode)){var d=n.clonePointerEvent(e,"pointerenter");for(d.eventPhase=d.AT_TARGET;d.target&&d.target!==o&&d.target!==(za.isNode(n.rootTarget)&&n.rootTarget.parentNode);)d.currentTarget=d.target,n.notifyTarget(d),r&&n.notifyTarget(d,"mouseenter"),za.isNode(d.target)&&(d.target=d.target.parentNode);n.freeEvent(d)}n.freeEvent(u)}n.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&n.dispatchEvent(e,"touchmove"),r&&(n.dispatchEvent(e,"mousemove"),n.cursor=n.getCursor(e.target)),i.overTargets=e.composedPath(),n.freeEvent(e)},this.onPointerOut=function(t){var e=n.trackingData(t.pointerId);if(e.overTargets){var r="mouse"===t.pointerType||"pen"===t.pointerType,i=n.findMountedTarget(e.overTargets),o=n.createPointerEvent(t,"pointerout",i||void 0);n.dispatchEvent(o),r&&n.dispatchEvent(o,"mouseout");var a=n.createPointerEvent(t,"pointerleave",i||void 0);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(za.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),r&&n.notifyTarget(a,"mouseleave"),za.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=null,n.freeEvent(o),n.freeEvent(a)}n.cursor=null},this.onPointerOver=function(t){var e=n.trackingData(t.pointerId),r=n.createPointerEvent(t),i="mouse"===r.pointerType||"pen"===r.pointerType;n.dispatchEvent(r,"pointerover"),i&&n.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(n.cursor=n.getCursor(r.target));var o=n.clonePointerEvent(r,"pointerenter");for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(za.isNode(n.rootTarget)&&n.rootTarget.parentNode);)o.currentTarget=o.target,n.notifyTarget(o),i&&n.notifyTarget(o,"mouseenter"),za.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=r.composedPath(),n.freeEvent(r),n.freeEvent(o)},this.onPointerUpOutside=function(t){var e=n.trackingData(t.pointerId),r=n.findMountedTarget(e.pressTargetsByButton[t.button]),i=n.createPointerEvent(t);if(r){for(var o=r;o;)i.currentTarget=o,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||n.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),za.isNode(o)&&(o=o.parentNode);delete e.pressTargetsByButton[t.button]}n.freeEvent(i)},this.onWheel=function(t){var e=n.createWheelEvent(t);n.dispatchEvent(e),n.freeEvent(e)},this.onClick=function(t){if(n.context.config.useNativeClickEvent){var e=n.createPointerEvent(t);n.dispatchEvent(e),n.freeEvent(e)}},this.onPointerCancel=function(t){var e=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);n.dispatchEvent(e),n.freeEvent(e)}}return t.prototype.init=function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)},t.prototype.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},t.prototype.client2Viewport=function(t){var e=this.context.contextService.getBoundingClientRect();return new xr(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},t.prototype.viewport2Client=function(t){var e=this.context.contextService.getBoundingClientRect();return new xr(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},t.prototype.viewport2Canvas=function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,o=i.width,a=i.height,s=r.getPerspectiveInverse(),c=r.getWorldTransform(),l=R(this.tmpMatrix,c,s),u=nt(this.tmpVec3,e/o*2-1,2*(1-n/a)-1,0);return ut(u,u,l),new xr(u[0],u[1])},t.prototype.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=R(this.tmpMatrix,n,r),o=nt(this.tmpVec3,t.x,t.y,0);ut(this.tmpVec3,this.tmpVec3,i);var a=this.context.config,s=a.width,c=a.height;return new xr((o[0]+1)/2*s,(1-(o[1]+1)/2)*c)},t.prototype.setPickHandler=function(t){this.pickHandler=t},t.prototype.addEventMapping=function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))},t.prototype.mapEvent=function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;n<r;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}},t.prototype.dispatchEvent=function(t,e,n){if(n){t.eventPhase=t.AT_TARGET;var r=this.rootTarget.defaultView||null;t.currentTarget=r,this.notifyListeners(t,e)}else t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e);this.emitter.emit(e||t.type,t)},t.prototype.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(r=i+1;r<n.length;r++)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},t.prototype.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;r<2048&&t!==this.rootTarget;r++)za.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e},t.prototype.hitTest=function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config,i=r.width,o=r.height;return e<0||n<0||e>i||n>o?null:this.pickHandler(t)||this.rootTarget||null},t.prototype.isNativeEventFromCanvas=function(t){var e,n=this.context.contextService.getDomElement(),r=null===(e=t.nativeEvent)||void 0===e?void 0:e.target;if(r){if(r===n)return!0;if(n&&n.contains)return n.contains(r)}return!!t.nativeEvent.composedPath&&t.nativeEvent.composedPath().indexOf(n)>-1},t.prototype.getExistedHTML=function(t){var e,n;if(t.nativeEvent.composedPath)try{for(var r=l(t.nativeEvent.composedPath()),i=r.next();!i.done;i=r.next()){var o=i.value,a=this.globalRuntime.nativeHTMLMap.get(o);if(a)return a}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return null},t.prototype.pickTarget=function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})},t.prototype.createPointerEvent=function(t,e,n,r){var i=this.allocateEvent(Ua);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var o=this.getExistedHTML(i);return i.target=null!=n?n:o||this.isNativeEventFromCanvas(i)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i},t.prototype.createWheelEvent=function(t){var e=this.allocateEvent(ja);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e);return e.target=n||this.isNativeEventFromCanvas(e)&&this.pickTarget(e),e},t.prototype.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},t.prototype.cloneWheelEvent=function(t){var e=this.allocateEvent(ja);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e},t.prototype.clonePointerEvent=function(t,e){var n=this.allocateEvent(Ua);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n},t.prototype.copyPointerData=function(t,e){e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist},t.prototype.copyMouseData=function(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)},t.prototype.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},t.prototype.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=sa.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},t.prototype.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e},t.prototype.freeEvent=function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)},t.prototype.notifyTarget=function(t,e){e=null!=e?e:t.type;var n=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e;this.notifyListeners(t,n),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)},t.prototype.notifyListeners=function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;i<r.length&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)},t.prototype.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||za.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},t.prototype.getCursor=function(t){for(var e=t;e;){var n=na(e)&&e.getAttribute("cursor");if(n)return n;e=za.isNode(e)&&e.parentNode}},t}(),Ha=function(){function t(){}return t.prototype.getOrCreateCanvas=function(t,e){if(this.canvas)return this.canvas;if(t||os.offscreenCanvas)this.canvas=t||os.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)}return this.canvas.width=10,this.canvas.height=10,this.canvas},t.prototype.getOrCreateContext=function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context},t}();!function(t){t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE"}(Da||(Da={}));var Xa,Ya=function(){function t(t,e){this.globalRuntime=t,this.context=e,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new xa,initAsync:new ba,dirtycheck:new Ma,cull:new Ma,beginFrame:new xa,beforeRender:new xa,render:new xa,afterRender:new xa,endFrame:new xa,destroy:new xa,pick:new Ea,pickSync:new Ma,pointerDown:new xa,pointerUp:new xa,pointerMove:new xa,pointerOut:new xa,pointerOver:new xa,pointerWheel:new xa,pointerCancel:new xa,click:new xa}}return t.prototype.init=function(t){var e=this,n=i(i({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach((function(t){t.apply(n,e.globalRuntime)})),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,t()):this.hooks.initAsync.promise().then((function(){e.inited=!0,t()}))},t.prototype.getStats=function(){return this.stats},t.prototype.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(Da.CAMERA_CHANGED)},t.prototype.render=function(t,e){var n=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var r=this.context.renderingContext;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())},t.prototype.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),o=i.enableDirtyCheck,a=i.enableCulling;this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t);var s=o?this.hooks.dirtycheck.call(t):t;if(s){var c=a?this.hooks.cull.call(s,this.context.camera):s;c&&(this.stats.rendered++,n.renderListCurrentFrame.push(c))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var l=t.sortable;l.dirty&&(this.sort(t,l),l.dirty=!1,l.dirtyChildren=[],l.dirtyReason=void 0),(l.sorted||t.childNodes).forEach((function(t){r.renderDisplayObject(t,e,n)}))},t.prototype.sort=function(t,e){e.sorted&&e.dirtyReason!==ei.Z_INDEX_CHANGED?e.dirtyChildren.forEach((function(n){if(-1===t.childNodes.indexOf(n)){var r=e.sorted.indexOf(n);r>=0&&e.sorted.splice(r,1)}else if(0===e.sorted.length)e.sorted.push(n);else{var i=function(t,e){for(var n=0,r=t.length;n<r;){var i=n+r>>>1;ra(t[i],e)<0?n=i+1:r=i}return n}(e.sorted,n);e.sorted.splice(i,0,n)}})):e.sorted=t.childNodes.slice().sort(ra)},t.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},t.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(Da.DISPLAY_OBJECT_CHANGED)},t}(),$a=/\[\s*(.*)=(.*)\s*\]/,qa=function(){function t(){}return t.prototype.selectOne=function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))},t.prototype.selectAll=function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(r){return e!==r&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.findAll((function(r){return e!==r&&r.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))},t.prototype.is=function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t},t.prototype.getIdOrClassname=function(t){return t.substring(1)},t.prototype.getAttribute=function(t){var e=t.match($a),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}},t.prototype.attributeToString=function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return he(n)?"":n.toString?n.toString():""},t}(),Ka=function(t){function e(e,n,r,i,o,a,s,c){var l=t.call(this,null)||this;return l.relatedNode=n,l.prevValue=r,l.newValue=i,l.attrName=o,l.attrChange=a,l.prevParsedValue=s,l.newParsedValue=c,l.type=e,l}return r(e,t),e.ADDITION=2,e.MODIFICATION=1,e.REMOVAL=3,e}(Ba);function Za(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}!function(t){t.REPARENT="reparent",t.DESTROY="destroy",t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.REMOVED="removed",t.MOUNTED="DOMNodeInsertedIntoDocument",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled"}(Xa||(Xa={}));var Qa=new Ka(Xa.REPARENT,null,"","","",0,"",""),Ja=function(){function t(t){var e,n,r,i,o,a,s,c=this;this.runtime=t,this.pendingEvents=[],this.boundsChangedEvent=new Ga(Xa.BOUNDS_CHANGED),this.rotate=(e=yt(),function(t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof n&&(n=tt(n,r,i));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var a=yt();xt(a,n[0],n[1],n[2]);var s=c.getRotation(t),l=c.getRotation(t.parentNode);St(e,l),Et(e,e),bt(a,e,a),bt(o.localRotation,a,s),Tt(o.localRotation,o.localRotation),c.dirtifyLocal(t,o)}else c.rotateLocal(t,n)}),this.rotateLocal=function(){var t=yt();return function(e,n,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof n&&(n=tt(n,r,i));var o=e.transformable;xt(t,n[0],n[1],n[2]),At(o.localRotation,o.localRotation,t),c.dirtifyLocal(e,o)}}(),this.setEulerAngles=(n=yt(),function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof e&&(e=tt(e,r,i));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){xt(o.localRotation,e[0],e[1],e[2]);var a=c.getRotation(t.parentNode);St(n,Et(yt(),a)),At(o.localRotation,o.localRotation,n),c.dirtifyLocal(t,o)}else c.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=tt(e,n,r));var i=t.transformable;dt(e,Z())||(function(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=e[0],c=e[1],l=e[2],u=i*l-o*c,f=o*s-r*l,d=r*c-i*s,h=i*d-o*f,p=o*u-r*d,g=r*f-i*u,m=2*a;u*=m,f*=m,d*=m,h*=2,p*=2,g*=2,t[0]=s+u+h,t[1]=c+f+p,t[2]=l+d+g}(e,e,i.localRotation),rt(i.localPosition,i.localPosition,e),c.dirtifyLocal(t,i))},this.setPosition=(r=_(),i=Z(),function(t,e){var n=t.transformable;if(i[0]=e[0],i[1]=e[1],i[2]=e[2]||0,!dt(c.getPosition(t),i)){if(et(n.position,i),null!==t.parentNode&&t.parentNode.transformable){var o=t.parentNode.transformable;E(r,o.worldTransform),T(r,r),ut(n.localPosition,i,r)}else et(n.localPosition,i);c.dirtifyLocal(t,n)}}),this.setLocalPosition=function(){var t=Z();return function(e,n){var r=e.transformable;t[0]=n[0],t[1]=n[1],t[2]=n[2]||0,dt(r.localPosition,t)||(et(r.localPosition,t),c.dirtifyLocal(e,r))}}(),this.translate=(o=Z(),a=Z(),s=Z(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=nt(a,e,n,r)),dt(e,o)||(rt(s,c.getPosition(t),e),c.setPosition(t,s))}),this.setRotation=function(){var t=yt();return function(e,n,r,i,o){var a=e.transformable;if("number"==typeof n&&(n=Mt(n,r,i,o)),null!==e.parentNode&&e.parentNode.transformable){var s=c.getRotation(e.parentNode);St(t,s),Et(t,t),bt(a.localRotation,t,n),Tt(a.localRotation,a.localRotation),c.dirtifyLocal(e,a)}else c.setLocalRotation(e,n)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var t=_(),e=Z(),n=Mt(0,0,0,1);return function(r){if(0!==r.localSkew[0]||0!==r.localSkew[1]){if(U(r.localTransform,r.localRotation,r.localPosition,tt(1,1,1),r.origin),0!==r.localSkew[0]||0!==r.localSkew[1]){var i=S(t);i[4]=Math.tan(r.localSkew[0]),i[1]=Math.tan(r.localSkew[1]),R(r.localTransform,r.localTransform,i)}var o=U(t,n,e,r.localScale,r.origin);R(r.localTransform,r.localTransform,o)}else U(r.localTransform,r.localRotation,r.localPosition,r.localScale,r.origin)}}()}return t.prototype.matches=function(t,e){return this.runtime.sceneGraphSelector.is(t,e)},t.prototype.querySelector=function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)},t.prototype.querySelectorAll=function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)},t.prototype.attach=function(t,e,n){var r,i,o=!1;t.parentNode&&(o=t.parentNode!==e,this.detach(t)),t.parentNode=e,he(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);var a=e.sortable;((null===(r=null==a?void 0:a.sorted)||void 0===r?void 0:r.length)||(null===(i=t.style)||void 0===i?void 0:i.zIndex))&&(-1===a.dirtyChildren.indexOf(t)&&a.dirtyChildren.push(t),a.dirty=!0,a.dirtyReason=ei.ADDED);var s=t.transformable;s&&this.dirtifyWorld(t,s),s.frozen&&this.unfreezeParentToRoot(t),o&&t.dispatchEvent(Qa)},t.prototype.detach=function(t){var e,n;if(t.parentNode){var r=t.transformable,i=t.parentNode.sortable;((null===(e=null==i?void 0:i.sorted)||void 0===e?void 0:e.length)||(null===(n=t.style)||void 0===n?void 0:n.zIndex))&&(-1===i.dirtyChildren.indexOf(t)&&i.dirtyChildren.push(t),i.dirty=!0,i.dirtyReason=ei.REMOVED);var o=t.parentNode.childNodes.indexOf(t);o>-1&&t.parentNode.childNodes.splice(o,1),r&&this.dirtifyWorld(t,r),t.parentNode=null}},t.prototype.getOrigin=function(t){return t.transformable.origin},t.prototype.setOrigin=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=[e,n,r]);var i=t.transformable;if(e[0]!==i.origin[0]||e[1]!==i.origin[1]||e[2]!==i.origin[2]){var o=i.origin;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,this.dirtifyLocal(t,i)}},t.prototype.setLocalEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=tt(e,n,r));var i=t.transformable;xt(i.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,i)},t.prototype.scaleLocal=function(t,e){var n=t.transformable;!function(t,e,n){t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2]}(n.localScale,n.localScale,tt(e[0],e[1],e[2]||1)),this.dirtifyLocal(t,n)},t.prototype.setLocalScale=function(t,e){var n=t.transformable,r=tt(e[0],e[1],e[2]||n.localScale[2]);dt(r,n.localScale)||(et(n.localScale,r),this.dirtifyLocal(t,n))},t.prototype.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=Mt(e,n,r,i));var o=t.transformable;St(o.localRotation,e),this.dirtifyLocal(t,o)},t.prototype.setLocalSkew=function(t,e,n){"number"==typeof e&&(e=function(t,e){var n=new m(2);return n[0]=t,n[1]=e,n}(e,n));var r=t.transformable;!function(t,e){t[0]=e[0],t[1]=e[1]}(r.localSkew,e),this.dirtifyLocal(t,r)},t.prototype.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))},t.prototype.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)},t.prototype.triggerPendingEvents=function(){var t=this,e=new Set,n=function(n,r){n.isConnected&&!e.has(n.entity)&&(t.boundsChangedEvent.detail=r,t.boundsChangedEvent.target=n,n.isMutationObserved?n.dispatchEvent(t.boundsChangedEvent):n.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),e.add(n.entity))};this.pendingEvents.forEach((function(t){var e=u(t,2),r=e[0],i=e[1];i.affectChildren?r.forEach((function(t){n(t,i)})):n(r,i)})),this.clearPendingEvents(),e.clear()},t.prototype.clearPendingEvents=function(){this.pendingEvents=[]},t.prototype.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)Za(n),n=n.parentNode;e&&t.forEach((function(t){Za(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren:e}])},t.prototype.updateDisplayObjectDependency=function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var o=i[t].indexOf(r);i[t].splice(o,1)}}if(n){var a=this.displayObjectDependencyMap.get(n);a||(this.displayObjectDependencyMap.set(n,{}),a=this.displayObjectDependencyMap.get(n)),a[t]||(a[t]=[]),a[t].push(r)}},t.prototype.informDependentDisplayObjects=function(t){var e=this,n=this.displayObjectDependencyMap.get(t);n&&Object.keys(n).forEach((function(t){n[t].forEach((function(n){e.dirtifyToRoot(n,!0),n.dispatchEvent(new Ka(Xa.ATTR_MODIFIED,n,e,e,t,Ka.MODIFICATION,e,e)),n.isCustomElement&&n.isConnected&&n.attributeChangedCallback&&n.attributeChangedCallback(t,e,e)}))}))},t.prototype.getPosition=function(t){var e=t.transformable;return D(e.position,this.getWorldTransform(t,e))},t.prototype.getRotation=function(t){var e=t.transformable;return F(e.rotation,this.getWorldTransform(t,e))},t.prototype.getScale=function(t){var e=t.transformable;return B(e.scaling,this.getWorldTransform(t,e))},t.prototype.getWorldTransform=function(t,e){return void 0===e&&(e=t.transformable),e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform},t.prototype.getLocalPosition=function(t){return t.transformable.localPosition},t.prototype.getLocalRotation=function(t){return t.transformable.localRotation},t.prototype.getLocalScale=function(t){return t.transformable.localScale},t.prototype.getLocalSkew=function(t){return t.transformable.localSkew},t.prototype.getLocalTransform=function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform},t.prototype.setLocalTransform=function(t,e){var n=D(Z(),e),r=F(yt(),e),i=B(Z(),e);this.setLocalScale(t,i),this.setLocalPosition(t,n),this.setLocalRotation(t,r)},t.prototype.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0]),this.setLocalSkew(t,[0,0])},t.prototype.getTransformedGeometryBounds=function(t,e,n){void 0===e&&(e=!1);var r=this.getGeometryBounds(t,e);if(mr.isEmpty(r))return null;var i=n||new mr;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i},t.prototype.getGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=t.geometry;return(e?n.renderBounds:n.contentBounds||null)||new mr},t.prototype.getBounds=function(t,e){var n=this;void 0===e&&(e=!1);var r=t.renderable;if(!r.boundsDirty&&!e&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&e&&r.renderBounds)return r.renderBounds;var i=e?r.renderBounds:r.bounds,o=this.getTransformedGeometryBounds(t,e,i);if(t.childNodes.forEach((function(t){var r=n.getBounds(t,e);r&&(o?o.add(r):(o=i||new mr).update(r.center,r.halfExtents))})),e){var a=ia(t);if(a){var s=a.parsedStyle.clipPath.getBounds(e);o?s&&(o=s.intersection(o)):o=s}}return o||(o=new mr),o&&(e?r.renderBounds=o:r.bounds=o),e?r.renderBoundsDirty=!1:r.boundsDirty=!1,o},t.prototype.getLocalBounds=function(t){if(t.parentNode){var e=_();t.parentNode.transformable&&(e=T(_(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!mr.isEmpty(n)){var r=new mr;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},t.prototype.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);mr.isEmpty(i)||(r=new mr).setFromTransformedAABB(i,this.getWorldTransform(t));var o=null===(n=null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)||void 0===n?void 0:n.getContextService().getBoundingClientRect();if(r){var a=u(r.getMin(),2),s=a[0],c=a[1],l=u(r.getMax(),2),f=l[0],d=l[1];return new Mr(s+((null==o?void 0:o.left)||0),c+((null==o?void 0:o.top)||0),f-s,d-c)}return new Mr((null==o?void 0:o.left)||0,(null==o?void 0:o.top)||0,0,0)},t.prototype.dirtifyWorldInternal=function(t,e){var n=this;if(!e.dirtyFlag){e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}));var r=t.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0)}},t.prototype.syncHierarchy=function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;r<n.length;r++)this.syncHierarchy(n[r])}},t.prototype.sync=function(t,e){if(e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,r=n&&n.transformable;null!==n&&r?R(e.worldTransform,r.worldTransform,e.localTransform):E(e.worldTransform,e.localTransform),e.dirtyFlag=!1}},t.prototype.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},t}(),ts={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]},es=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,ns=new RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),rs=new RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),is=function(){function t(t){var e=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!rs.exec(n)&&!ns.exec(t))},this.trimByKinsokuShorui=function(t){var e=f([],u(t),!1),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e}}return t.prototype.measureFont=function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),i=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0});i.font=t;var o=ts.MetricsString+ts.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(ts.BaselineSymbol).width),c=ts.HeightMultiplier*s;s=s*ts.BaselineMultiplier|0,r.width=a,r.height=c,i.fillStyle="#f00",i.fillRect(0,0,a,c),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(o,0,s);var l=i.getImageData(0,0,a||1,c||1).data,u=l.length,f=4*a,d=0,h=0,p=!1;for(d=0;d<s;++d){for(var g=0;g<f;g+=4)if(255!==l[h+g]){p=!0;break}if(p)break;h+=f}for(n.ascent=s-d,h=u-f,p=!1,d=c;d>s;--d){for(g=0;g<f;g+=4)if(255!==l[h+g]){p=!0;break}if(p)break;h-=f}return n.descent=d-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n},t.prototype.measureText=function(t,e,n){var r=e.fontSize,i=e.wordWrap,o=e.lineHeight,a=e.lineWidth,s=e.textBaseline,c=e.textAlign,l=e.letterSpacing,u=e.textPath;e.textPathSide,e.textPathStartOffset;var f=e.leading,d=void 0===f?0:f,h=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,o=t.fontWeight,a=Ae(e)&&"".concat(e,"px")||"16px",s=n.split(","),c=s.length-1;c>=0;c--){var l=s[c].trim();!Aa.test(l)&&Sa.indexOf(l)<0&&(l='"'.concat(l,'"')),s[c]=l}return"".concat(r," ").concat(i," ").concat(o," ").concat(a," ").concat(s.join(","))}(e),p=this.measureFont(h,n);0===p.fontSize&&(p.fontSize=r,p.ascent=r);var g=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);g.font=h,e.isOverflowing=!1;var m=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),v=new Array(m.length),y=0;if(!u){for(M=0;M<m.length;M++){var _=g.measureText(m[M]).width+(m[M].length-1)*l;v[M]=_,y=Math.max(y,_)}S=y+a;var b=o||p.fontSize+a,E=Math.max(b,p.fontSize+a)+(m.length-1)*(b+d),x=0;return"middle"===s?x=-E/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?x=-E:"top"!==s&&"hanging"!==s||(x=0),{font:h,width:S,height:E,lines:m,lineWidths:v,lineHeight:b+=d,maxLineWidth:y,fontProperties:p,lineMetrics:v.map((function(t,e){var n=0;return"center"===c||"middle"===c?n-=t/2:"right"!==c&&"end"!==c||(n-=t),new Mr(n-a/2,x+e*b,t+a,b)}))}}u.getTotalLength();for(var M=0;M<m.length;M++)var S=g.measureText(m[M]).width+(m[M].length-1)*l},t.prototype.setGraphemeOnPath=function(){},t.prototype.wordWrap=function(t,e,n){var r=this,i=e.wordWrapWidth,o=void 0===i?0:i,a=e.letterSpacing,s=e.maxLines,c=void 0===s?1/0:s,l=e.textOverflow,u=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),f=o+a,d="";"ellipsis"===l?d="...":l&&"clip"!==l&&(d=l);for(var h=[],p=0,g=0,m={},v=function(t){return r.getFromCache(t,a,m,u)},y=Array.from(d).reduce((function(t,e){return t+v(e)}),0),_=Array.from(t),b=0;b<_.length;b++){var E=_[b],x=t[b-1],M=t[b+1],S=v(E);if(this.isNewline(E)){if(++p>=c){e.isOverflowing=!0;break}g=0,h[p]=""}else{if(g>0&&g+S>f){if(p+1>=c){if(e.isOverflowing=!0,y>0&&y<=f){for(var A=h[p].length,T=0,O=A,R=0;R<A;R++){var P=v(h[p][R]);if(T+P+y>f){O=R;break}T+=P}h[p]=(h[p]||"").slice(0,O)+d}break}if(g=0,h[++p]="",this.isBreakingSpace(E))continue;this.canBreakInLastChar(E)||(h=this.trimToBreakable(h),g=this.sumTextWidthByCache(h[p]||"",m)),this.shouldBreakByKinsokuShorui(E,M)&&(h=this.trimByKinsokuShorui(h),g+=v(x||""))}g+=S,h[p]=(h[p]||"")+E}}return h.join("\n")},t.prototype.isBreakingSpace=function(t){return"string"==typeof t&&ts.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},t.prototype.isNewline=function(t){return"string"==typeof t&&ts.Newlines.indexOf(t.charCodeAt(0))>=0},t.prototype.trimToBreakable=function(t){var e=f([],u(t),!1),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),o=r+1,a=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(o,n.length),e[e.length-2]=n.slice(0,a),e},t.prototype.canBreakInLastChar=function(t){return!t||!es.test(t)},t.prototype.sumTextWidthByCache=function(t,e){return t.split("").reduce((function(t,n){if(!e[n])throw Error("cannot count the word without cache");return t+e[n]}),0)},t.prototype.findBreakableIndex=function(t){for(var e=t.length-1;e>=0;e--)if(!es.test(t[e]))return e;return-1},t.prototype.getFromCache=function(t,e,n,r){var i=n[t];if("number"!=typeof i){var o=t.length*e;i=r.measureText(t).width+o,n[t]=i}return i},t}(),os={},as=function(){var t,e=new ka,n=new Ia;return(t={})[Yn.CIRCLE]=new Pa,t[Yn.ELLIPSE]=new Ca,t[Yn.RECT]=e,t[Yn.IMAGE]=e,t[Yn.GROUP]=e,t[Yn.LINE]=new wa,t[Yn.TEXT]=new La(os),t[Yn.POLYLINE]=n,t[Yn.POLYGON]=n,t[Yn.PATH]=new Na,t[Yn.HTML]=null,t[Yn.MESH]=null,t}(),ss=function(){var t,e=new Lo,n=new Fo;return(t={})[pi.PERCENTAGE]=null,t[pi.NUMBER]=new Ho,t[pi.ANGLE]=new Io,t[pi.DEFINED_PATH]=new ko,t[pi.PAINT]=e,t[pi.COLOR]=e,t[pi.FILTER]=new Do,t[pi.LENGTH]=n,t[pi.LENGTH_PERCENTAGE]=n,t[pi.LENGTH_PERCENTAGE_12]=new Uo,t[pi.LENGTH_PERCENTAGE_14]=new jo,t[pi.COORDINATE]=new zo,t[pi.OFFSET_DISTANCE]=new Xo,t[pi.OPACITY_VALUE]=new Yo,t[pi.PATH]=new $o,t[pi.LIST_OF_POINTS]=new qo,t[pi.SHADOW_BLUR]=new Ko,t[pi.TEXT]=new Zo,t[pi.TEXT_TRANSFORM]=new Qo,t[pi.TRANSFORM]=new Ta,t[pi.TRANSFORM_ORIGIN]=new Oa,t[pi.Z_INDEX]=new Ra,t[pi.MARKER]=new Vo,t}();os.CameraContribution=Ir,os.AnimationTimeline=null,os.EasingFunction=null,os.offscreenCanvasCreator=new Ha,os.nativeHTMLMap=new WeakMap,os.sceneGraphSelector=new qa,os.sceneGraphService=new Ja(os),os.textService=new is(os),os.geometryUpdaterFactory=as,os.CSSPropertySyntaxFactory=ss,os.styleValueRegistry=new No(os),os.layoutRegistry=null,os.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:{},os.enableCSSParsing=!0,os.enableDataset=!1,os.enableStyleSyntax=!0;var cs=0,ls=new Ka(Xa.INSERTED,null,"","","",0,"",""),us=new Ka(Xa.REMOVED,null,"","","",0,"",""),fs=new Ga(Xa.DESTROY),ds=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.entity=cs++,e.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},e.cullable={strategy:ti.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},e.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},e.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},e.geometry={contentBounds:void 0,renderBounds:void 0},e.rBushNode={aabb:void 0},e.namespaceURI="g",e.scrollLeft=0,e.scrollTop=0,e.clientTop=0,e.clientLeft=0,e.destroyed=!1,e.style={},e.computedStyle=os.enableCSSParsing?{anchor:ii,opacity:ii,fillOpacity:ii,strokeOpacity:ii,fill:ii,stroke:ii,transform:ii,transformOrigin:ii,visibility:ii,pointerEvents:ii,lineWidth:ii,lineCap:ii,lineJoin:ii,increasedLineWidthForHitTesting:ii,fontSize:ii,fontFamily:ii,fontStyle:ii,fontWeight:ii,fontVariant:ii,textAlign:ii,textBaseline:ii,textTransform:ii,zIndex:ii,filter:ii,shadowType:ii}:null,e.parsedStyle={},e.attributes={},e}return r(e,t),Object.defineProperty(e.prototype,"className",{get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"classList",{get:function(){return this.className.split(" ").filter((function(t){return""!==t}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tagName",{get:function(){return this.nodeName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentElement",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(t){throw new Error(Sr)},e.prototype.appendChild=function(t,e){var n;if(t.destroyed)throw new Error("Cannot append a destroyed element.");return os.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),ls.relatedNode=this,t.dispatchEvent(ls),t},e.prototype.insertBefore=function(t,e){if(e){var n=this.childNodes.indexOf(e);this.appendChild(t,n-1)}else this.appendChild(t);return t},e.prototype.replaceChild=function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},e.prototype.removeChild=function(t){var e;return us.relatedNode=this,t.dispatchEvent(us),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),os.sceneGraphService.detach(t),t},e.prototype.removeChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];this.removeChild(e)}},e.prototype.destroyChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length&&e.destroyChildren(),e.destroy()}},e.prototype.matches=function(t){return os.sceneGraphService.matches(t,this)},e.prototype.getElementById=function(t){return os.sceneGraphService.querySelector("#".concat(t),this)},e.prototype.getElementsByName=function(t){return os.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)},e.prototype.getElementsByClassName=function(t){return os.sceneGraphService.querySelectorAll(".".concat(t),this)},e.prototype.getElementsByTagName=function(t){return os.sceneGraphService.querySelectorAll(t,this)},e.prototype.querySelector=function(t){return os.sceneGraphService.querySelector(t,this)},e.prototype.querySelectorAll=function(t){return os.sceneGraphService.querySelectorAll(t,this)},e.prototype.closest=function(t){var e=this;do{if(os.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null},e.prototype.find=function(t){var e=this,n=null;return this.forEach((function(r){return!(r===e||!t(r))&&(n=r,!0)})),n},e.prototype.findAll=function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n},e.prototype.after=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this);e.forEach((function(e,n){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(e,r+n+1)}))}},e.prototype.before=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this),i=u(e),o=i[0],a=i.slice(1);this.parentNode.appendChild(o,r),(t=o).after.apply(t,f([],u(a),!1))}},e.prototype.replaceWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.after.apply(this,f([],u(t),!1)),this.remove()},e.prototype.append=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach((function(e){return t.appendChild(e)}))},e.prototype.prepend=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach((function(e,n){return t.appendChild(e,n)}))},e.prototype.replaceChildren=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,f([],u(t),!1))},e.prototype.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},e.prototype.destroy=function(){this.dispatchEvent(fs),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},e.prototype.getGeometryBounds=function(){return os.sceneGraphService.getGeometryBounds(this)},e.prototype.getRenderBounds=function(){return os.sceneGraphService.getBounds(this,!0)},e.prototype.getBounds=function(){return os.sceneGraphService.getBounds(this)},e.prototype.getLocalBounds=function(){return os.sceneGraphService.getLocalBounds(this)},e.prototype.getBoundingClientRect=function(){return os.sceneGraphService.getBoundingClientRect(this)},e.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},e.prototype.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},e.prototype.getAttributeNames=function(){return Object.keys(this.attributes)},e.prototype.getAttribute=function(t){if(function(t){return"symbol"==typeof t}(t))return os.enableCSSParsing?null:void 0;var e=this.attributes[t];if(void 0===e){var n=qr(t);return e=this.attributes[n],os.enableCSSParsing&&he(e)?null:e}return e},e.prototype.hasAttribute=function(t){return this.getAttributeNames().includes(t)},e.prototype.hasAttributes=function(){return!!this.getAttributeNames().length},e.prototype.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},e.prototype.setAttribute=function(t,e,n){this.attributes[t]=e},e.prototype.getAttributeNS=function(t,e){throw new Error(Sr)},e.prototype.getAttributeNode=function(t){throw new Error(Sr)},e.prototype.getAttributeNodeNS=function(t,e){throw new Error(Sr)},e.prototype.hasAttributeNS=function(t,e){throw new Error(Sr)},e.prototype.removeAttributeNS=function(t,e){throw new Error(Sr)},e.prototype.removeAttributeNode=function(t){throw new Error(Sr)},e.prototype.setAttributeNS=function(t,e,n){throw new Error(Sr)},e.prototype.setAttributeNode=function(t){throw new Error(Sr)},e.prototype.setAttributeNodeNS=function(t){throw new Error(Sr)},e.prototype.toggleAttribute=function(t,e){throw new Error(Sr)},e}(za);function hs(t){return!!(null==t?void 0:t.nodeName)}var ps,gs=new Ka(Xa.ATTR_MODIFIED,null,null,null,null,Ka.MODIFICATION,null,null),ms={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:""},vs={anchor:[0,0],fill:li,stroke:li,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},ys=i(i({},vs),{opacity:1,fillOpacity:1,strokeOpacity:1,visibility:"visible",pointerEvents:"auto",lineWidth:1,lineCap:"butt",lineJoin:"miter",increasedLineWidthForHitTesting:0,fillRule:"nonzero"}),_s=f(f([],u(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"]),!1),["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],!1),bs="data-",Es=function(t){function e(e){var n,r=this;(r=t.call(this)||this).isCustomElement=!1,r.isMutationObserved=!1,r.activeAnimations=[],r.getClip=function(){return this.style.clipPath||null},r.config=e,r.config.interactive=null!==(n=r.config.capture)&&void 0!==n?n:r.config.interactive,r.id=r.config.id||"",r.name=r.config.name||"",(r.config.className||r.config.class)&&(r.className=r.config.className||r.config.class),r.nodeName=r.config.type||Yn.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,os.enableCSSParsing?vs:ys,r.config.initialParsedStyle),os.enableCSSParsing&&Object.assign(r.attributes,ms),r.initAttributes(r.config.style);var i=os.globalThis.Proxy?os.globalThis.Proxy:function(){};return os.enableDataset&&(r.dataset=new i({},{get:function(t,e){var n="".concat(bs).concat(Xr(e));return void 0!==t[n]?t[n]:r.getAttribute(n)},set:function(t,e,n){return r.setAttribute("".concat(bs).concat(Xr(e)),n),!0}})),os.enableStyleSyntax&&(r.style=new i({setProperty:function(t,e){r.setAttribute(t,e)},getPropertyValue:function(t){return r.getAttribute(t)},removeProperty:function(t){r.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:r.getAttribute(e)},set:function(t,e,n){return r.setAttribute(e,n),!0}})),r}return r(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.getAnimations().forEach((function(t){t.cancel()}))},e.prototype.cloneNode=function(t,e){var n=i({},this.attributes);for(var r in n){var o=n[r];hs(o)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=o.cloneNode(t)),e&&(n[r]=e(r,o))}var a=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:n});return a.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);a.appendChild(n)}})),a},e.prototype.initAttributes=function(t){void 0===t&&(t={});var e=this.renderable,n={forceUpdateGeometry:!0};os.enableCSSParsing&&(n.usedAttributes=_s);var r={};for(var i in t){r[qr(i)]=t[i]}os.styleValueRegistry.processProperties(this,r,n),e.dirty=!0},e.prototype.setAttribute=function(e,n,r){void 0===r&&(r=!1);var i=qr(e);Le(n)||(r||n!==this.attributes[i])&&(this.internalSetAttribute(i,n),t.prototype.setAttribute.call(this,i,n))},e.prototype.internalSetAttribute=function(t,e,n){var r;void 0===n&&(n={});var i=this.renderable,o=this.attributes[t],a=this.parsedStyle[t];os.styleValueRegistry.processProperties(this,((r={})[t]=e,r),n),i.dirty=!0;var s=this.parsedStyle[t];this.isConnected&&(gs.relatedNode=this,gs.prevValue=o,gs.newValue=e,gs.attrName=t,gs.prevParsedValue=a,gs.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(gs):(gs.target=this,this.ownerDocument.defaultView.dispatchEvent(gs,!0))),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,o,e,a,s)},e.prototype.getBBox=function(){var t=this.getBounds(),e=u(t.getMin(),2),n=e[0],r=e[1],i=u(t.getMax(),2),o=i[0],a=i[1];return new Mr(n,r,o-n,a-r)},e.prototype.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),os.sceneGraphService.setOrigin(this,rr(t,e,n)),this},e.prototype.getOrigin=function(){return os.sceneGraphService.getOrigin(this)},e.prototype.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),os.sceneGraphService.setPosition(this,rr(t,e,n)),this},e.prototype.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),os.sceneGraphService.setLocalPosition(this,rr(t,e,n)),this},e.prototype.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),os.sceneGraphService.translate(this,rr(t,e,n)),this},e.prototype.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),os.sceneGraphService.translateLocal(this,rr(t,e,n)),this},e.prototype.getPosition=function(){return os.sceneGraphService.getPosition(this)},e.prototype.getLocalPosition=function(){return os.sceneGraphService.getLocalPosition(this)},e.prototype.scale=function(t,e,n){return this.scaleLocal(t,e,n)},e.prototype.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=rr(t,e=e||t,n=n||t)),os.sceneGraphService.scaleLocal(this,t),this},e.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=rr(t,e=e||t,n=n||t)),os.sceneGraphService.setLocalScale(this,t),this},e.prototype.getLocalScale=function(){return os.sceneGraphService.getLocalScale(this)},e.prototype.getScale=function(){return os.sceneGraphService.getScale(this)},e.prototype.getEulerAngles=function(){return or(u(ar(Z(),os.sceneGraphService.getWorldTransform(this)),3)[2])},e.prototype.getLocalEulerAngles=function(){return or(u(ar(Z(),os.sceneGraphService.getLocalRotation(this)),3)[2])},e.prototype.setEulerAngles=function(t){return os.sceneGraphService.setEulerAngles(this,0,0,t),this},e.prototype.setLocalEulerAngles=function(t){return os.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},e.prototype.rotateLocal=function(t,e,n){return he(e)&&he(n)?os.sceneGraphService.rotateLocal(this,0,0,t):os.sceneGraphService.rotateLocal(this,t,e,n),this},e.prototype.rotate=function(t,e,n){return he(e)&&he(n)?os.sceneGraphService.rotate(this,0,0,t):os.sceneGraphService.rotate(this,t,e,n),this},e.prototype.setRotation=function(t,e,n,r){return os.sceneGraphService.setRotation(this,t,e,n,r),this},e.prototype.setLocalRotation=function(t,e,n,r){return os.sceneGraphService.setLocalRotation(this,t,e,n,r),this},e.prototype.setLocalSkew=function(t,e){return os.sceneGraphService.setLocalSkew(this,t,e),this},e.prototype.getRotation=function(){return os.sceneGraphService.getRotation(this)},e.prototype.getLocalRotation=function(){return os.sceneGraphService.getLocalRotation(this)},e.prototype.getLocalSkew=function(){return os.sceneGraphService.getLocalSkew(this)},e.prototype.getLocalTransform=function(){return os.sceneGraphService.getLocalTransform(this)},e.prototype.getWorldTransform=function(){return os.sceneGraphService.getWorldTransform(this)},e.prototype.setLocalTransform=function(t){return os.sceneGraphService.setLocalTransform(this,t),this},e.prototype.resetLocalTransform=function(){os.sceneGraphService.resetLocalTransform(this)},e.prototype.getAnimations=function(){return this.activeAnimations},e.prototype.animate=function(t,e){var n,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return r?r.play(this,t,e):null},e.prototype.isVisible=function(){var t;return"visible"===(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)},Object.defineProperty(e.prototype,"interactive",{get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"},enumerable:!1,configurable:!0}),e.prototype.isInteractive=function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)},e.prototype.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},e.prototype.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,f([],u(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))+1),this},e.prototype.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,f([],u(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))-1),this},e.prototype.getConfig=function(){return this.config},e.prototype.attr=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=u(e,2),i=r[0],o=r[1];return i?ve(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===e.length?(this.setAttribute(i,o),this):this.attributes[i]:this.attributes},e.prototype.getMatrix=function(t){var e=t||this.getWorldTransform(),n=u(D(Z(),e),2),r=n[0],i=n[1],o=u(B(Z(),e),2),a=o[0],s=o[1],c=F(yt(),e),l=u(ar(Z(),c),3),f=l[0],d=l[2];return sr(f||d,r,i,a,s)},e.prototype.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},e.prototype.setMatrix=function(t){var e=u(cr(t),5),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4];this.setEulerAngles(a).setPosition(n,r).setLocalScale(i,o)},e.prototype.setLocalMatrix=function(t){var e=u(cr(t),5),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4];this.setLocalEulerAngles(a).setLocalPosition(n,r).setLocalScale(i,o)},e.prototype.show=function(){os.enableCSSParsing?this.style.visibility="visible":this.forEach((function(t){t.style.visibility="visible"}))},e.prototype.hide=function(){os.enableCSSParsing?this.style.visibility="hidden":this.forEach((function(t){t.style.visibility="hidden"}))},e.prototype.getCount=function(){return this.childElementCount},e.prototype.getParent=function(){return this.parentElement},e.prototype.getChildren=function(){return this.children},e.prototype.getFirst=function(){return this.firstElementChild},e.prototype.getLast=function(){return this.lastElementChild},e.prototype.getChildByIndex=function(t){return this.children[t]||null},e.prototype.add=function(t,e){return this.appendChild(t,e)},e.prototype.setClip=function(t){this.style.clipPath=t},e.prototype.set=function(t,e){this.config[t]=e},e.prototype.get=function(t){return this.config[t]},e.prototype.moveTo=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},e.prototype.move=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},e.prototype.setZIndex=function(t){return this.style.zIndex=t,this},e}(ds),xs=function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,o=t.syntax;os.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:o})},Ms=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=o(e,["style"]);return t.call(this,i({type:Yn.CIRCLE,style:os.enableCSSParsing?i({cx:"",cy:"",r:""},n):i({},n),initialParsedStyle:{anchor:[.5,.5],transformOrigin:os.enableCSSParsing?null:[hi,hi]}},r))||this}return r(e,t),e}(Es),Ss=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,a=o(e,["style"]);return(n=t.call(this,i({style:os.enableCSSParsing?i({x:"",y:""},r):i({},r)},a))||this).isCustomElement=!0,n}return r(e,t),e}(Es),As=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=o(e,["style"]);return t.call(this,i({type:Yn.ELLIPSE,style:os.enableCSSParsing?i({cx:"",cy:"",rx:"",ry:""},n):i({},n),initialParsedStyle:{anchor:[.5,.5],transformOrigin:os.enableCSSParsing?null:[hi,hi]}},r))||this}return r(e,t),e}(Es),Ts=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=o(e,["style"]);return t.call(this,i({type:Yn.GROUP,style:os.enableCSSParsing?i({x:"",y:"",width:"",height:""},n):i({},n)},r))||this}return r(e,t),e}(Es),Os=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,a=o(e,["style"]);return(n=t.call(this,i({type:Yn.HTML,style:os.enableCSSParsing?i({x:"",y:"",width:"auto",height:"auto",innerHTML:""},r):i({},r)},a))||this).cullable.enable=!1,n}return r(e,t),e.prototype.getDomElement=function(){return this.parsedStyle.$el},e.prototype.getBoundingClientRect=function(){if(this.parsedStyle.$el)return this.parsedStyle.$el.getBoundingClientRect();var t=this.parsedStyle,e=t.x,n=t.y,r=t.width,i=t.height;return new Mr(e,n,r,i)},e.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},e.prototype.getBounds=function(){var t,e,n=this.getBoundingClientRect(),r=null===(e=null===(t=this.ownerDocument)||void 0===t?void 0:t.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect(),i=new mr,o=n.left-((null==r?void 0:r.left)||0),a=n.top-((null==r?void 0:r.top)||0);return i.setMinMax([o,a,0],[o+n.width,a+n.height,0]),i},e.prototype.getLocalBounds=function(){if(this.parentNode){var t=T(_(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!mr.isEmpty(e)){var n=new mr;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},e}(Es),Rs=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=o(e,["style"]);return t.call(this,i({type:Yn.IMAGE,style:os.enableCSSParsing?i({x:"",y:"",img:"",width:"",height:""},n):i({},n)},r))||this}return r(e,t),e}(Es),Ps=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,a=o(e,["style"]);(n=t.call(this,i({type:Yn.LINE,style:i({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,isBillboard:!1},r)},a))||this).markerStartAngle=0,n.markerEndAngle=0;var s=n.parsedStyle,c=s.markerStart,l=s.markerEnd;return c&&hs(c)&&(n.markerStartAngle=c.getLocalEulerAngles(),n.appendChild(c)),l&&hs(l)&&(n.markerEndAngle=l.getLocalEulerAngles(),n.appendChild(l)),n.transformMarker(!0),n.transformMarker(!1),n}return r(e,t),e.prototype.attributeChangedCallback=function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&hs(r)&&(this.markerStartAngle=0,r.remove()),i&&hs(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&hs(r)&&(this.markerEndAngle=0,r.remove()),i&&hs(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))},e.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=e.x1,s=e.x2,c=e.y1,l=e.y2,u=e.defX,f=e.defY,d=t?n:r;if(d&&hs(d)){var h,p,g,m,v,y,_;t?(m=a-u,v=c-f,p=s-a,g=l-c,y=i||0,_=this.markerStartAngle):(m=s-u,v=l-f,p=a-s,g=c-l,y=o||0,_=this.markerEndAngle),h=Math.atan2(g,p),d.setLocalEulerAngles(180*h/Math.PI+_),d.setLocalPosition(m+Math.cos(h)*y,v+Math.sin(h)*y)}},e.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.x1,i=n.y1,o=n.x2,a=n.y2,s=n.defX,c=n.defY,l=In(r,i,o,a,t),u=l.x,f=l.y,d=ut(Z(),tt(u-s,f-c,0),e?this.getWorldTransform():this.getLocalTransform());return new xr(d[0],d[1])},e.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},e.prototype.getTotalLength=function(){var t=this.parsedStyle;return Nn(t.x1,t.y1,t.x2,t.y2)},e}(Es),Cs=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,a=o(e,["style"]);(n=t.call(this,i({type:Yn.PATH,style:os.enableCSSParsing?i({path:"",miterLimit:""},r):i({},r),initialParsedStyle:os.enableCSSParsing?null:{miterLimit:4,path:i({},gi)}},a))||this).markerStartAngle=0,n.markerEndAngle=0,n.markerMidList=[];var s=n.parsedStyle,c=s.markerStart,l=s.markerEnd,u=s.markerMid;return c&&hs(c)&&(n.markerStartAngle=c.getLocalEulerAngles(),n.appendChild(c)),u&&hs(u)&&n.placeMarkerMid(u),l&&hs(l)&&(n.markerEndAngle=l.getLocalEulerAngles(),n.appendChild(l)),n.transformMarker(!0),n.transformMarker(!1),n}return r(e,t),e.prototype.attributeChangedCallback=function(t,e,n,r,i){"path"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&hs(r)&&(this.markerStartAngle=0,r.remove()),i&&hs(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&hs(r)&&(this.markerEndAngle=0,r.remove()),i&&hs(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},e.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=e.defX,s=e.defY,c=t?n:r;if(c&&hs(c)){var l,f,d,h,p,g,m;if(t){var v=u(this.getStartTangent(),2),y=v[0];h=(_=v[1])[0]-a,p=_[1]-s,f=y[0]-_[0],d=y[1]-_[1],g=i||0,m=this.markerStartAngle}else{var _,b=u(this.getEndTangent(),2);y=b[0];h=(_=b[1])[0]-a,p=_[1]-s,f=y[0]-_[0],d=y[1]-_[1],g=o||0,m=this.markerEndAngle}l=Math.atan2(d,f),c.setLocalEulerAngles(180*l/Math.PI+m),c.setLocalPosition(h+Math.cos(l)*g,p+Math.sin(l)*g)}},e.prototype.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.path.segments,r=e.defX,i=e.defY;if(this.markerMidList.forEach((function(t){t.remove()})),t&&hs(t))for(var o=1;o<n.length-1;o++){var a=u(n[o].currentPoint,2),s=a[0],c=a[1],l=1===o?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(s-r,c-i)}},e.prototype.getTotalLength=function(){return Xi(this)},e.prototype.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,o=n.defY,a=function(t,e,n){return ae(t,e,i(i({},n),{bbox:!1,length:!0})).point}(n.path.absolutePath,t),s=a.x,c=a.y,l=ut(Z(),tt(s-r,c-o,0),e?this.getWorldTransform():this.getLocalTransform());return new xr(l[0],l[1])},e.prototype.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*Xi(this),e)},e.prototype.getStartTangent=function(){var t=this.parsedStyle.path.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e},e.prototype.getEndTangent=function(){var t=this.parsedStyle.path.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,o=t[e-1].endTangent;n=[],o?(n.push([i[0]-o[0],i[1]-o[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n},e}(Es),ws=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,a=o(e,["style"]);(n=t.call(this,i({type:Yn.POLYGON,style:os.enableCSSParsing?i({points:"",miterLimit:"",isClosed:!0},r):i({},r),initialParsedStyle:os.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},a))||this).markerStartAngle=0,n.markerEndAngle=0,n.markerMidList=[];var s=n.parsedStyle,c=s.markerStart,l=s.markerEnd,u=s.markerMid;return c&&hs(c)&&(n.markerStartAngle=c.getLocalEulerAngles(),n.appendChild(c)),u&&hs(u)&&n.placeMarkerMid(u),l&&hs(l)&&(n.markerEndAngle=l.getLocalEulerAngles(),n.appendChild(l)),n.transformMarker(!0),n.transformMarker(!1),n}return r(e,t),e.prototype.attributeChangedCallback=function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&hs(r)&&(this.markerStartAngle=0,r.remove()),i&&hs(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&hs(r)&&(this.markerEndAngle=0,r.remove()),i&&hs(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},e.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=e.points.points,s=e.defX,c=e.defY,l=t?n:r;if(l&&hs(l)){var u,f,d,h,p,g,m;if(h=a[0][0]-s,p=a[0][1]-c,t)f=a[1][0]-a[0][0],d=a[1][1]-a[0][1],g=i||0,m=this.markerStartAngle;else{var v=a.length;this.parsedStyle.isClosed?(f=a[v-1][0]-a[0][0],d=a[v-1][1]-a[0][1]):(h=a[v-1][0]-s,p=a[v-1][1]-c,f=a[v-2][0]-a[v-1][0],d=a[v-2][1]-a[v-1][1]),g=o||0,m=this.markerEndAngle}u=Math.atan2(d,f),l.setLocalEulerAngles(180*u/Math.PI+m),l.setLocalPosition(h+Math.cos(u)*g,p+Math.sin(u)*g)}},e.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&&hs(t))for(var o=1;o<(this.parsedStyle.isClosed?n.length:n.length-1);o++){var a=n[o][0]-r,s=n[o][1]-i,c=1===o?t:t.cloneNode(!0);this.markerMidList.push(c),this.appendChild(c),c.setLocalPosition(a,s)}},e}(Es),Ns=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=o(e,["style"]);return t.call(this,i({type:Yn.POLYLINE,style:os.enableCSSParsing?i({points:"",miterLimit:"",isClosed:!1},n):i({},n),initialParsedStyle:os.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},r))||this}return r(e,t),e.prototype.getTotalLength=function(){return this.parsedStyle.points.totalLength},e.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},e.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,o=n.points,a=o.points,s=o.segments,c=0,l=0;s.forEach((function(e,n){t>=e[0]&&t<=e[1]&&(c=(t-e[0])/(e[1]-e[0]),l=n)}));var u=In(a[l][0],a[l][1],a[l+1][0],a[l+1][1],c),f=u.x,d=u.y,h=ut(Z(),tt(f-r,d-i,0),e?this.getWorldTransform():this.getLocalTransform());return new xr(h[0],h[1])},e.prototype.getStartTangent=function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.prototype.getEndTangent=function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},e}(ws),Is=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=o(e,["style"]);return t.call(this,i({type:Yn.RECT,style:os.enableCSSParsing?i({x:"",y:"",width:"",height:"",radius:""},n):i({},n)},r))||this}return r(e,t),e}(Es),ks=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=o(e,["style"]);return t.call(this,i({type:Yn.TEXT,style:os.enableCSSParsing?i({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""},n):i({fill:"black"},n),initialParsedStyle:os.enableCSSParsing?{}:{x:0,y:0,fontSize:16,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",lineHeight:0,letterSpacing:0,textBaseline:"alphabetic",textAlign:"start",wordWrap:!1,wordWrapWidth:0,leading:0,dx:0,dy:0}},r))||this}return r(e,t),e.prototype.getComputedTextLength=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0},e.prototype.getLineBoundingRects=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]},e.prototype.isOverflowing=function(){return!!this.parsedStyle.isOverflowing},e}(Es),Ls=function(){function t(){this.registry={},this.define(Yn.CIRCLE,Ms),this.define(Yn.ELLIPSE,As),this.define(Yn.RECT,Is),this.define(Yn.IMAGE,Rs),this.define(Yn.LINE,Ps),this.define(Yn.GROUP,Ts),this.define(Yn.PATH,Cs),this.define(Yn.POLYGON,ws),this.define(Yn.POLYLINE,Ns),this.define(Yn.TEXT,ks),this.define(Yn.HTML,Os)}return t.prototype.define=function(t,e){this.registry[t]=e},t.prototype.get=function(t){return this.registry[t]},t}(),Ds=function(t){function e(){var e=t.call(this)||this;e.defaultView=null,e.ownerDocument=null,e.nodeName="document";try{e.timeline=new os.AnimationTimeline(e)}catch(t){}var n={};return Ro.forEach((function(t){var e=t.n,r=t.inh,i=t.d;r&&i&&(n[e]=Yr(i)?i(Yn.GROUP):i)})),e.documentElement=new Ts({id:"g-root",style:n}),e.documentElement.ownerDocument=e,e.documentElement.parentNode=e,e.childNodes=[e.documentElement],e}return r(e,t),Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),e.prototype.createElement=function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?ks:Ts);var r=new n(e);return r.ownerDocument=this,r},e.prototype.createElementNS=function(t,e,n){return this.createElement(e,n)},e.prototype.cloneNode=function(t){throw new Error(Sr)},e.prototype.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}},e.prototype.elementsFromBBox=function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),o=[];return i.forEach((function(t){var e=t.displayObject,n=e.parsedStyle.pointerEvents,r=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(n);(!r||r&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&o.push(e)})),o.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),o},e.prototype.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height;if(r<0||i<0||r>a||i>s)return null;var c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,f=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]}).picked;return f&&f[0]||this.documentElement},e.prototype.elementFromPoint=function(t,e){return s(this,void 0,void 0,(function(){var n,r,i,o,a,s,l,u,f,d;return c(this,(function(c){switch(c.label){case 0:return n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height,r<0||i<0||r>a||i>s?[2,null]:(l=this.defaultView.viewport2Client({x:r,y:i}),u=l.x,f=l.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:u,clientY:f},picked:[]})]);case 1:return[2,(d=c.sent().picked)&&d[0]||this.documentElement]}}))}))},e.prototype.elementsFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height;if(r<0||i<0||r>a||i>s)return[];var c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,f=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]}).picked;return f[f.length-1]!==this.documentElement&&f.push(this.documentElement),f},e.prototype.elementsFromPoint=function(t,e){return s(this,void 0,void 0,(function(){var n,r,i,o,a,s,l,u,f,d;return c(this,(function(c){switch(c.label){case 0:return n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height,r<0||i<0||r>a||i>s?[2,[]]:(l=this.defaultView.viewport2Client({x:r,y:i}),u=l.x,f=l.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:u,clientY:f},picked:[]})]);case 1:return(d=c.sent().picked)[d.length-1]!==this.documentElement&&d.push(this.documentElement),[2,d]}}))}))},e.prototype.appendChild=function(t,e){throw new Error(Ar)},e.prototype.insertBefore=function(t,e){throw new Error(Ar)},e.prototype.removeChild=function(t,e){throw new Error(Ar)},e.prototype.replaceChild=function(t,e,n){throw new Error(Ar)},e.prototype.append=function(){throw new Error(Ar)},e.prototype.prepend=function(){throw new Error(Ar)},e.prototype.getElementById=function(t){return this.documentElement.getElementById(t)},e.prototype.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},e.prototype.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},e.prototype.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},e.prototype.querySelector=function(t){return this.documentElement.querySelector(t)},e.prototype.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},e.prototype.find=function(t){return this.documentElement.find(t)},e.prototype.findAll=function(t){return this.documentElement.findAll(t)},e}(za),Bs=function(){function t(t){this.strategies=t}return t.prototype.apply=function(e){var n=e.camera,r=e.renderingService,i=e.renderingContext,o=this.strategies;r.hooks.cull.tap(t.tag,(function(t){if(t){var e=t.cullable;return 0===o.length?e.visible=i.unculledEntities.indexOf(t.entity)>-1:e.visible=o.every((function(e){return e.isVisible(n,t)})),!t.isCulled()&&t.isVisible()?t:(t.dispatchEvent(new Ga(Xa.CULLED)),null)}return t})),r.hooks.afterRender.tap(t.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},t.tag="Culling",t}(),Fs=function(){function t(){}return t.prototype.apply=function(e){var n=e.renderingService;n.hooks.dirtycheck.tap(t.tag,(function(t){return t?t.renderable.dirty||n.disableDirtyRectangleRendering()?t:null:t}))},t.tag="DirtyCheck",t}(),Us=function(){function t(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new Ua(null),this.rootWheelEvent=new ja(null),this.onPointerMove=function(e){var n,r,i,o,a=null===(o=null===(i=t.context.renderingContext.root)||void 0===i?void 0:i.ownerDocument)||void 0===o?void 0:o.defaultView;if(!a.supportsTouchEvents||"touch"!==e.pointerType){var s=t.normalizeToPointerEvent(e,a);try{for(var c=l(s),u=c.next();!u.done;u=c.next()){var f=u.value,d=t.bootstrapEvent(t.rootPointerEvent,f,a,e);t.context.eventService.mapEvent(d)}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}t.setCursor(t.context.eventService.cursor)}},this.onClick=function(e){var n,r,i,o,a=null===(o=null===(i=t.context.renderingContext.root)||void 0===i?void 0:i.ownerDocument)||void 0===o?void 0:o.defaultView,s=t.normalizeToPointerEvent(e,a);try{for(var c=l(s),u=c.next();!u.done;u=c.next()){var f=u.value,d=t.bootstrapEvent(t.rootPointerEvent,f,a,e);t.context.eventService.mapEvent(d)}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}t.setCursor(t.context.eventService.cursor)}}return t.prototype.apply=function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler((function(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null})),r.hooks.pointerWheel.tap(t.tag,(function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)})),r.hooks.pointerDown.tap(t.tag,(function(t){var e,r;if(!i.supportsTouchEvents||"touch"!==t.pointerType){var o=n.normalizeToPointerEvent(t,i);if(n.autoPreventDefault&&o[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();try{for(var a=l(o),s=a.next();!s.done;s=a.next()){var c=s.value,u=n.bootstrapEvent(n.rootPointerEvent,c,i,t);n.context.eventService.mapEvent(u)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){var e,r;if(!i.supportsTouchEvents||"touch"!==t.pointerType){var o=n.context.contextService.getDomElement(),a="outside";try{a=o&&t.target&&t.target!==o&&o.contains&&!o.contains(t.target)?"outside":""}catch(t){}var s=n.normalizeToPointerEvent(t,i);try{for(var c=l(s),u=c.next();!u.done;u=c.next()){var f=u.value,d=n.bootstrapEvent(n.rootPointerEvent,f,i,t);d.type+=a,n.context.eventService.mapEvent(d)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerMove.tap(t.tag,this.onPointerMove),r.hooks.pointerOver.tap(t.tag,this.onPointerMove),r.hooks.pointerOut.tap(t.tag,this.onPointerMove),r.hooks.click.tap(t.tag,this.onClick),r.hooks.pointerCancel.tap(t.tag,(function(t){var e,r,o=n.normalizeToPointerEvent(t,i);try{for(var a=l(o),s=a.next();!s.done;s=a.next()){var c=s.value,u=n.bootstrapEvent(n.rootPointerEvent,c,i,t);n.context.eventService.mapEvent(u)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}))},t.prototype.getViewportXY=function(t){var e,n,r=t.offsetX,i=t.offsetY,o=t.clientX,a=t.clientY;if(!this.context.config.supportsCSSTransform||he(r)||he(i)){var s=this.context.eventService.client2Viewport(new xr(o,a));e=s.x,n=s.y}else e=r,n=i;return{x:e,y:n}},t.prototype.bootstrapEvent=function(t,e,n,r){var i,o;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 a=(i=this.getViewportXY(e)).x,s=i.y;t.viewport.x=a,t.viewport.y=s;var c=(o=this.context.eventService.viewport2Canvas(t.viewport)).x,l=o.y;return t.canvas.x=c,t.canvas.y=l,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=aa[t.type]||t.type),t},t.prototype.normalizeWheelEvent=function(t){var e,n,r=this.rootWheelEvent;this.transferMouseData(r,t),r.deltaMode=t.deltaMode,r.deltaX=t.deltaX,r.deltaY=t.deltaY,r.deltaZ=t.deltaZ;var i=(e=this.getViewportXY(t)).x,o=e.y;r.viewport.x=i,r.viewport.y=o;var a=(n=this.context.eventService.viewport2Canvas(r.viewport)).x,s=n.y;return r.canvas.x=a,r.canvas.y=s,r.global.copyFrom(r.canvas),r.offset.copyFrom(r.canvas),r.nativeEvent=t,r.type=t.type,r},t.prototype.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=sa.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null},t.prototype.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},t.prototype.normalizeToPointerEvent=function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;r<t.changedTouches.length;r++){var i=t.changedTouches[r];Le(i.button)&&(i.button=0),Le(i.buttons)&&(i.buttons=1),Le(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),Le(i.width)&&(i.width=i.radiusX||1),Le(i.height)&&(i.height=i.radiusY||1),Le(i.tiltX)&&(i.tiltX=0),Le(i.tiltY)&&(i.tiltY=0),Le(i.pointerType)&&(i.pointerType="touch"),Le(i.pointerId)&&(i.pointerId=i.identifier||0),Le(i.pressure)&&(i.pressure=i.force||.5),Le(i.twist)&&(i.twist=0),Le(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;Le(o.isPrimary)&&(o.isPrimary=!0),Le(o.width)&&(o.width=1),Le(o.height)&&(o.height=1),Le(o.tiltX)&&(o.tiltX=0),Le(o.tiltY)&&(o.tiltY=0),Le(o.pointerType)&&(o.pointerType="mouse"),Le(o.pointerId)&&(o.pointerId=1),Le(o.pressure)&&(o.pressure=.5),Le(o.twist)&&(o.twist=0),Le(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t.tag="Event",t}(),js=[Yn.CIRCLE,Yn.ELLIPSE,Yn.IMAGE,Yn.RECT,Yn.LINE,Yn.POLYLINE,Yn.POLYGON,Yn.TEXT,Yn.PATH,Yn.HTML],Gs=function(){function t(){}return t.prototype.isVisible=function(t,e){var n,r,i=e.cullable;if(!i.enable)return!0;var o=e.getRenderBounds();if(mr.isEmpty(o))return!1;var a=t.getFrustum(),s=null===(r=null===(n=e.parentNode)||void 0===n?void 0:n.cullable)||void 0===r?void 0:r.visibilityPlaneMask;return i.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,o,s||gr.INDETERMINATE,a.planes),i.visible=i.visibilityPlaneMask!==gr.OUTSIDE,i.visible},t.prototype.computeVisibilityWithPlaneMask=function(t,e,n,r){if(n===gr.OUTSIDE||n===gr.INSIDE)return n;for(var i=gr.INSIDE,o=js.indexOf(t.nodeName)>-1,a=0,s=r.length;a<s;++a){var c=1<<a;if(0!=(n&c)&&(!o||4!==a&&5!==a)){var l=r[a],u=l.normal,f=l.distance;if(st(u,e.getPositiveFarPoint(r[a]))+f<0)return gr.OUTSIDE;st(u,e.getNegativeFarPoint(r[a]))+f<0&&(i|=c)}}return i},t}(),Ws=function(){function t(){this.toSync=new Set}return t.prototype.apply=function(e){var n=this,r=e.renderingService,i=e.renderingContext,o=e.rBushRoot,a=i.root.ownerDocument.defaultView;this.rBush=o;var s=function(t){t.target.renderable.dirty=!0,r.dirtify()},c=function(t){var e=t.detail.affectChildren,i=t.target;e&&i.forEach((function(t){n.toSync.add(t)}));for(var o=i;o;)o.renderable&&n.toSync.add(o),o=o.parentElement;r.dirtify()},l=function(t){var e=t.target;os.enableCSSParsing&&os.styleValueRegistry.recalc(e),os.sceneGraphService.dirtifyToRoot(e),r.dirtify()},u=function(t){var e=t.target,i=e.rBushNode;i.aabb&&n.rBush.remove(i.aabb),n.toSync.delete(e),os.sceneGraphService.dirtifyToRoot(e),r.dirtify()};r.hooks.init.tap(t.tag,(function(){a.addEventListener(Xa.MOUNTED,l),a.addEventListener(Xa.UNMOUNTED,u),a.addEventListener(Xa.ATTR_MODIFIED,s),a.addEventListener(Xa.BOUNDS_CHANGED,c)})),r.hooks.destroy.tap(t.tag,(function(){a.removeEventListener(Xa.MOUNTED,l),a.removeEventListener(Xa.UNMOUNTED,u),a.removeEventListener(Xa.ATTR_MODIFIED,s),a.removeEventListener(Xa.BOUNDS_CHANGED,c),n.toSync.clear()})),r.hooks.endFrame.tap(t.tag,(function(){n.syncRTree()}))},t.prototype.syncRTree=function(){var t=this,e=[];Array.from(this.toSync).filter((function(t){return t.isConnected})).forEach((function(n){var r,i,o=n.rBushNode;o&&o.aabb&&t.rBush.remove(o.aabb);var a=n.getRenderBounds();if(a){var s=(r=u(a.getMin(),2))[0],c=r[1],l=(i=u(a.getMax(),2))[0],f=i[1];o.aabb||(o.aabb={}),o.aabb.displayObject=n,o.aabb.minX=s,o.aabb.minY=c,o.aabb.maxX=l,o.aabb.maxY=f}o.aabb&&(isNaN(o.aabb.maxX)||isNaN(o.aabb.maxX)||isNaN(o.aabb.minX)||isNaN(o.aabb.minY)||e.push(o.aabb))})),this.rBush.load(e),e.length=0,this.toSync.clear()},t.tag="Prepare",t}();!function(t){t.READY="ready",t.BEFORE_RENDER="beforerender",t.RERENDER="rerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.RESIZE="resize",t.DIRTY_RECTANGLE="dirtyrectangle",t.RENDERER_CHANGED="rendererchanged"}(ps||(ps={}));var zs=new Ga(Xa.MOUNTED),Vs=new Ga(Xa.UNMOUNTED),Hs=new Ga(ps.BEFORE_RENDER),Xs=new Ga(ps.RERENDER),Ys=new Ga(ps.AFTER_RENDER),$s=function(t){function e(e){var n=t.call(this)||this;n.Element=Es,n.inited=!1,n.context={},n.document=new Ds,n.document.defaultView=n,n.customElements=new Ls;var r=e.container,i=e.canvas,o=e.offscreenCanvas,a=e.width,s=e.height,c=e.devicePixelRatio,l=e.renderer,u=e.background,f=e.cursor,d=e.document,h=e.requestAnimationFrame,p=e.cancelAnimationFrame,g=e.createImage,m=e.supportsPointerEvents,v=e.supportsTouchEvents,y=e.supportsCSSTransform,_=e.supportsMutipleCanvasesInOneContainer,b=e.useNativeClickEvent,E=e.alwaysTriggerPointerEventOnCanvas,x=e.isTouchEvent,M=e.isMouseEvent;_||function(t,e){if(t){var n="string"==typeof t?t:t.id||ta++;Jo[n]&&Jo[n].destroy(),Jo[n]=e}}(r,n);var S=a,A=s,T=c;return i&&(T=(T=c||ea&&window.devicePixelRatio||1)>=1?Math.ceil(T):1,S=a||function(t){var e=oa(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/T,A=s||function(t){var e=oa(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/T),o&&(os.offscreenCanvas=o),n.devicePixelRatio=T,n.requestAnimationFrame=null!=h?h:ya.bind(os.globalThis),n.cancelAnimationFrame=null!=p?p:_a.bind(os.globalThis),n.supportsTouchEvents=null!=v?v:"ontouchstart"in os.globalThis,n.supportsPointerEvents=null!=m?m:!!os.globalThis.PointerEvent,n.isTouchEvent=null!=x?x:function(t){return n.supportsTouchEvents&&t instanceof os.globalThis.TouchEvent},n.isMouseEvent=null!=M?M:function(t){return!os.globalThis.MouseEvent||t instanceof os.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof os.globalThis.PointerEvent))},n.initRenderingContext({container:r,canvas:i,width:S,height:A,renderer:l,offscreenCanvas:o,devicePixelRatio:T,cursor:f||"default",background:u||"transparent",createImage:g,document:d,supportsCSSTransform:y,useNativeClickEvent:b,alwaysTriggerPointerEventOnCanvas:E}),n.initDefaultCamera(S,A,l.clipSpaceNearZ),n.initRenderer(l,!0),n}return r(e,t),e.prototype.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},e.prototype.initDefaultCamera=function(t,e,n){var r=this,i=new os.CameraContribution;i.clipSpaceNearZ=n,i.setType(yr.EXPLORING,_r.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(wr,(function(){r.context.renderingContext.renderReasons.add(Da.CAMERA_CHANGED)})),this.context.camera=i},e.prototype.getConfig=function(){return this.context.config},e.prototype.getRoot=function(){return this.document.documentElement},e.prototype.getCamera=function(){return this.context.camera},e.prototype.getContextService=function(){return this.context.contextService},e.prototype.getEventService=function(){return this.context.eventService},e.prototype.getRenderingService=function(){return this.context.renderingService},e.prototype.getRenderingContext=function(){return this.context.renderingContext},e.prototype.getStats=function(){return this.getRenderingService().getStats()},Object.defineProperty(e.prototype,"ready",{get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),e.prototype.destroy=function(t,e){(void 0===t&&(t=!0),void 0===e&&(e=!1),e||this.dispatchEvent(new Ga(ps.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 Ga(ps.AFTER_DESTROY))},e.prototype.changeSize=function(t,e){this.resize(t,e)},e.prototype.resize=function(t,e){var n=this.context.config;n.width=t,n.height=e,this.getContextService().resize(t,e);var r=this.context.camera,i=r.getProjectionMode();r.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),i===br.ORTHOGRAPHIC?r.setOrthographic(t/-2,t/2,e/2,e/-2,r.getNear(),r.getFar()):r.setAspect(t/e),this.dispatchEvent(new Ga(ps.RESIZE,{width:t,height:e}))},e.prototype.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},e.prototype.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},e.prototype.removeChild=function(t){return this.document.documentElement.removeChild(t)},e.prototype.removeChildren=function(){this.document.documentElement.removeChildren()},e.prototype.destroyChildren=function(){this.document.documentElement.destroyChildren()},e.prototype.render=function(){var t=this;this.dispatchEvent(Hs),this.getRenderingService().render(this.getConfig(),(function(){t.dispatchEvent(Xs)})),this.dispatchEvent(Ys)},e.prototype.run=function(){var t=this,e=function(){t.render(),t.frameId=t.requestAnimationFrame(e)};e()},e.prototype.initRenderer=function(t,e){var n=this;if(void 0===e&&(e=!1),!t)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new qn,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new Us,new Ws,new Fs,new Bs([new Gs])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(i(i({},os),this.context)),this.context.renderingService=new Ya(os,this.context),this.context.eventService=new Va(os,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,e,!0)):this.context.contextService.initAsync().then((function(){n.initRenderingService(t,e)}))},e.prototype.initRenderingService=function(t,e,n){var r=this;void 0===e&&(e=!1),void 0===n&&(n=!1),this.context.renderingService.init((function(){r.inited=!0,e?(n?r.requestAnimationFrame((function(){r.dispatchEvent(new Ga(ps.READY))})):r.dispatchEvent(new Ga(ps.READY)),r.readyPromise&&r.resolveReadyPromise()):r.dispatchEvent(new Ga(ps.RENDERER_CHANGED)),e||r.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),r.mountChildren(r.getRoot()),t.getConfig().enableAutoRendering&&r.run()}))},e.prototype.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(os)}))},e.prototype.setRenderer=function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),f([],u(null==n?void 0:n.getPlugins()),!1).reverse().forEach((function(t){t.destroy(os)})),this.initRenderer(t)}},e.prototype.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},e.prototype.unmountChildren=function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(Vs):(Vs.target=t,this.dispatchEvent(Vs,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},e.prototype.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(zs):(zs.target=t,this.dispatchEvent(zs,!0))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName),t.childNodes.forEach((function(t){e.mountChildren(t)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()},e.prototype.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},e.prototype.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},e.prototype.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},e.prototype.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},e.prototype.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},e.prototype.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},e}(Wa),qs=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.landmarks=[],e}return r(e,t),e.prototype.rotate=function(t,e,n){if(this.relElevation=nr(e),this.relAzimuth=nr(t),this.relRoll=nr(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===yr.EXPLORING){var r=_t(yt(),[1,0,0],ir((this.rotateWorld?1:-1)*this.relElevation)),i=_t(yt(),[0,1,0],ir((this.rotateWorld?1:-1)*this.relAzimuth)),o=_t(yt(),[0,0,1],ir(this.relRoll)),a=bt(yt(),i,r);a=bt(yt(),a,o);var s=j(_(),a);P(this.matrix,this.matrix,[0,0,-this.distance]),R(this.matrix,this.matrix,s),P(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===yr.ORBITING||this.type===yr.EXPLORING?this._getPosition():this.type===yr.TRACKING&&this._getFocalPoint(),this._update(),this},e.prototype.pan=function(t,e){var n=rr(t,e,0),r=Q(this.position);return rt(r,r,ot(Z(),this.right,n[0])),rt(r,r,ot(Z(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this},e.prototype.dolly=function(t){var e=this.forward,n=Q(this.position),r=this.dollyingStep,i=this.distance+t*this.dollyingStep;return r=Math.max(Math.min(i,this.maxDistance),this.minDistance)-this.distance,n[0]+=r*e[0],n[1]+=r*e[1],n[2]+=r*e[2],this._setPosition(n),this.type===yr.ORBITING||this.type===yr.EXPLORING?this._getDistance():this.type===yr.TRACKING&&rt(this.focalPoint,n,this.distanceVector),this.triggerUpdate(),this},e.prototype.cancelLandmarkAnimation=function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)},e.prototype.createLandmark=function(t,e){var n,r,i,o;void 0===e&&(e={});var a=e.position,s=void 0===a?this.position:a,c=e.focalPoint,l=void 0===c?this.focalPoint:c,u=e.roll,f=e.zoom,d=new os.CameraContribution;d.setType(this.type,void 0),d.setPosition(s[0],null!==(n=s[1])&&void 0!==n?n:this.position[1],null!==(r=s[2])&&void 0!==r?r:this.position[2]),d.setFocalPoint(l[0],null!==(i=l[1])&&void 0!==i?i:this.focalPoint[1],null!==(o=l[2])&&void 0!==o?o:this.focalPoint[2]),d.setRoll(null!=u?u:this.roll),d.setZoom(null!=f?f:this.zoom);var h={name:t,matrix:b(d.getWorldTransform()),right:Q(d.right),up:Q(d.up),forward:Q(d.forward),position:Q(d.getPosition()),focalPoint:Q(d.getFocalPoint()),distanceVector:Q(d.getDistanceVector()),distance:d.getDistance(),dollyingStep:d.getDollyingStep(),azimuth:d.getAzimuth(),elevation:d.getElevation(),roll:d.getRoll(),relAzimuth:d.relAzimuth,relElevation:d.relElevation,relRoll:d.relRoll,zoom:d.getZoom()};return this.landmarks.push(h),h},e.prototype.gotoLandmark=function(t,e){var n=this;void 0===e&&(e={});var r=Me(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=Ae(e)?{duration:e}:e,o=i.easing,a=void 0===o?"linear":o,s=i.duration,c=void 0===s?100:s,l=i.easingFunction,u=void 0===l?void 0:l,f=i.onfinish,d=void 0===f?void 0:f;if(0===c)return this.syncFromLandmark(r),void(d&&d());this.cancelLandmarkAnimation();var h,p=r.position,g=r.focalPoint,m=r.zoom,v=r.roll,y=u||os.EasingFunction(a),_=function(){n.setFocalPoint(g),n.setPosition(p),n.setRoll(v),n.setZoom(m),n.computeMatrix(),n.triggerUpdate(),d&&d()},b=function(t){void 0===h&&(h=t);var e=t-h;if(e>c)_();else{var r,i,o=y(e/c),a=Z(),s=Z();lt(a,n.focalPoint,g,o),lt(s,n.position,p,o),i=n.roll*(1-o)+v*o,r=n.zoom*(1-o)+m*o,n.setFocalPoint(a),n.setPosition(s),n.setRoll(i),n.setZoom(r),pt(a,g)+pt(s,p)<=.01&&null==m&&null==v?_():(n.computeMatrix(),n.triggerUpdate(),e<c&&(n.landmarkAnimationID=n.canvas.requestAnimationFrame(b)))}};this.canvas.requestAnimationFrame(b)}},e.prototype.syncFromLandmark=function(t){this.matrix=E(this.matrix,t.matrix),this.right=et(this.right,t.right),this.up=et(this.up,t.up),this.forward=et(this.forward,t.forward),this.position=et(this.position,t.position),this.focalPoint=et(this.focalPoint,t.focalPoint),this.distanceVector=et(this.distanceVector,t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance,this.zoom=t.zoom},e}(Ir);os.CameraContribution=qs;var Ks=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.currentTime=r,o.timelineTime=i,o.target=n,o.type="finish",o.bubbles=!1,o.currentTarget=n,o.defaultPrevented=!1,o.eventPhase=o.AT_TARGET,o.timeStamp=Date.now(),o.currentTime=r,o.timelineTime=i,o}return r(e,t),e}(Ba),Zs=0,Qs=function(){function t(t,e){var n;this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=t,t.animation=this,this.timeline=e,this.id="".concat(Zs++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null===(n=this.effect)||void 0===n?void 0:n.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}return Object.defineProperty(t.prototype,"pending",{get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playState",{get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ready",{get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise((function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(new Error)}})),this.pending||this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"finished",{get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise((function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(new Error)}})),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentTime",{get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){var e;t=Number(t),isNaN(t)||(this.timeline.restart(),this._paused||null===this._startTime||(this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate),this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this)))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"startTime",{get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),t=Number(t),isNaN(t))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_isFinished",{get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"totalDuration",{get:function(){return this._totalDuration},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_needsTick",{get:function(){return this.pending||"running"===this.playState||!this._finishedFlag},enumerable:!1,configurable:!0}),t.prototype.updatePromises=function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,this.readyPromise||this.finishedPromise},t.prototype.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()},t.prototype.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()},t.prototype.finish=function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},t.prototype.cancel=function(){var t=this;if(this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var e=new Ks(null,this,this.currentTime,null);setTimeout((function(){t.oncancel(e)}))}},t.prototype.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()},t.prototype.updatePlaybackRate=function(t){this.playbackRate=t},t.prototype.targetAnimations=function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()},t.prototype.markTarget=function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)},t.prototype.unmarkTarget=function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)},t.prototype.tick=function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))},t.prototype.rewind=function(){if(this.playbackRate>=0)this.currentTime=0;else{if(!(this._totalDuration<1/0))throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}},t.prototype.persist=function(){throw new Error(Sr)},t.prototype.addEventListener=function(t,e,n){throw new Error(Sr)},t.prototype.removeEventListener=function(t,e,n){throw new Error(Sr)},t.prototype.dispatchEvent=function(t){throw new Error(Sr)},t.prototype.commitStyles=function(){throw new Error(Sr)},t.prototype.ensureAlive=function(){var t,e;this.playbackRate<0&&0===this.currentTime?this._inEffect=!!(null===(t=this.effect)||void 0===t?void 0:t.update(-1)):this._inEffect=!!(null===(e=this.effect)||void 0===e?void 0:e.update(this.currentTime)),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},t.prototype.tickCurrentTime=function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())},t.prototype.fireEvents=function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new Ks(null,this,this.currentTime,t);setTimeout((function(){e.onfinish&&e.onfinish(n)}))}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var r=new Ks(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}},t}(),Js=.1,tc="function"==typeof Float32Array,ec=function(t,e){return 1-3*e+3*t},nc=function(t,e){return 3*e-6*t},rc=function(t){return 3*t},ic=function(t,e,n){return((ec(e,n)*t+nc(e,n))*t+rc(e))*t},oc=function(t,e,n){return 3*ec(e,n)*t*t+2*nc(e,n)*t+rc(e)},ac=function(t,e,n,r){if(!(0<=t&&t<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=tc?new Float32Array(11):new Array(11),o=0;o<11;++o)i[o]=ic(o*Js,t,n);var a=function(e){for(var r=0,o=1;10!==o&&i[o]<=e;++o)r+=Js;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*Js,s=oc(a,t,n);return s>=.001?function(t,e,n,r){for(var i=0;i<4;++i){var o=oc(e,n,r);if(0===o)return e;e-=(ic(e,n,r)-t)/o}return e}(e,a,t,n):0===s?a:function(t,e,n,r,i){var o,a,s=0;do{(o=ic(a=e+(n-e)/2,r,i)-t)>0?n=a:e=a}while(Math.abs(o)>1e-7&&++s<10);return a}(e,r,r+Js,t,n)};return function(t){return 0===t||1===t?t:ic(a(t),e,r)}},sc=function(t){return Math.pow(t,2)},cc=function(t){return Math.pow(t,3)},lc=function(t){return Math.pow(t,4)},uc=function(t){return Math.pow(t,5)},fc=function(t){return Math.pow(t,6)},dc=function(t){return 1-Math.cos(t*Math.PI/2)},hc=function(t){return 1-Math.sqrt(1-t*t)},pc=function(t){return t*t*(3*t-2)},gc=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)},mc=function(t,e){void 0===e&&(e=[]);var n=u(e,2),r=n[0],i=void 0===r?1:r,o=n[1],a=void 0===o?.5:o,s=Se(Number(i),1,10),c=Se(Number(a),.1,2);return 0===t||1===t?t:-s*Math.pow(2,10*(t-1))*Math.sin((t-1-c/(2*Math.PI)*Math.asin(1/s))*(2*Math.PI)/c)},vc=function(t,e,n){void 0===e&&(e=[]);var r=u(e,4),i=r[0],o=void 0===i?1:i,a=r[1],s=void 0===a?100:a,c=r[2],l=void 0===c?10:c,f=r[3],d=void 0===f?0:f;o=Se(o,.1,1e3),s=Se(s,.1,1e3),l=Se(l,.1,1e3),d=Se(d,.1,1e3);var h=Math.sqrt(s/o),p=l/(2*Math.sqrt(s*o)),g=p<1?h*Math.sqrt(1-p*p):0,m=p<1?(p*h-d)/g:-d+h,v=n?n*t/1e3:t;return v=p<1?Math.exp(-v*p*h)*(1*Math.cos(g*v)+m*Math.sin(g*v)):(1+m*v)*Math.exp(-v*h),0===t||1===t?t:1-v},yc=function(t,e){void 0===e&&(e=[]);var n=u(e,2),r=n[0],i=void 0===r?10:r;return("start"==n[1]?Math.ceil:Math.floor)(Se(t,0,1)*i)/i},_c=function(t,e){void 0===e&&(e=[]);var n=u(e,4),r=n[0],i=n[1],o=n[2],a=n[3];return ac(r,i,o,a)(t)},bc=ac(.42,0,1,1),Ec=function(t){return function(e,n,r){return void 0===n&&(n=[]),1-t(1-e,n,r)}},xc=function(t){return function(e,n,r){return void 0===n&&(n=[]),e<.5?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},Mc=function(t){return function(e,n,r){return void 0===n&&(n=[]),e<.5?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},Sc={steps:yc,"step-start":function(t){return yc(t,[1,"start"])},"step-end":function(t){return yc(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":_c,ease:function(t){return _c(t,[.25,.1,.25,1])},in:bc,out:Ec(bc),"in-out":xc(bc),"out-in":Mc(bc),"in-quad":sc,"out-quad":Ec(sc),"in-out-quad":xc(sc),"out-in-quad":Mc(sc),"in-cubic":cc,"out-cubic":Ec(cc),"in-out-cubic":xc(cc),"out-in-cubic":Mc(cc),"in-quart":lc,"out-quart":Ec(lc),"in-out-quart":xc(lc),"out-in-quart":Mc(lc),"in-quint":uc,"out-quint":Ec(uc),"in-out-quint":xc(uc),"out-in-quint":Mc(uc),"in-expo":fc,"out-expo":Ec(fc),"in-out-expo":xc(fc),"out-in-expo":Mc(fc),"in-sine":dc,"out-sine":Ec(dc),"in-out-sine":xc(dc),"out-in-sine":Mc(dc),"in-circ":hc,"out-circ":Ec(hc),"in-out-circ":xc(hc),"out-in-circ":Mc(hc),"in-back":pc,"out-back":Ec(pc),"in-out-back":xc(pc),"out-in-back":Mc(pc),"in-bounce":gc,"out-bounce":Ec(gc),"in-out-bounce":xc(gc),"out-in-bounce":Mc(gc),"in-elastic":mc,"out-elastic":Ec(mc),"in-out-elastic":xc(mc),"out-in-elastic":Mc(mc),spring:vc,"spring-in":vc,"spring-out":Ec(vc),"spring-in-out":xc(vc),"spring-out-in":Mc(vc)},Ac=function(t){return Sc[function(t){return function(t){return"-"===(t=t.replace(/([A-Z])/g,(function(t){return"-".concat(t.toLowerCase())}))).charAt(0)?t.substring(1):t}(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||Sc.linear},Tc=function(t){return t},Oc=1,Rc=.5,Pc=0;function Cc(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var wc="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Nc=new RegExp("cubic-bezier\\("+wc+","+wc+","+wc+","+wc+"\\)"),Ic=/steps\(\s*(\d+)\s*\)/,kc=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Lc(t){var e=Nc.exec(t);if(e)return ac.apply(void 0,f([],u(e.slice(1).map(Number)),!1));var n=Ic.exec(t);if(n)return Cc(Number(n[1]),Pc);var r=kc.exec(t);return r?Cc(Number(r[1]),{start:Oc,middle:Rc,end:Pc}[r[2]]):Ac(t)}function Dc(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}var Bc=0,Fc=1,Uc=2,jc=3;function Gc(t,e,n){var r=function(t,e,n){if(null===e)return Bc;var r=n.endTime;return e<Math.min(n.delay,r)?Fc:e>=Math.min(n.delay+t+n.endDelay,r)?Uc:jc}(t,e,n),i=function(t,e,n,r,i){switch(r){case Fc:return"backwards"===e||"both"===e?0:null;case jc:return n-i;case Uc:return"forwards"===e||"both"===e?t:null;case Bc:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var o="auto"===n.duration?0:n.duration,a=function(t,e,n,r,i){var o=i;return 0===t?e!==Fc&&(o+=n):o+=r/t,o}(o,r,n.iterations,i,n.iterationStart),s=function(t,e,n,r,i,o){var a=t===1/0?e%1:t%1;return 0!==a||n!==Uc||0===r||0===i&&0!==o||(a=1),a}(a,n.iterationStart,r,n.iterations,i,o),c=function(t,e,n,r){return t===Uc&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,a),l=function(t,e,n){var r=t;if("normal"!==t&&"reverse"!==t){var i=e;"alternate-reverse"===t&&(i+=1),r="normal",i!==1/0&&i%2!=0&&(r="reverse")}return"normal"===r?n:1-n}(n.direction,c,s);return n.currentIteration=c,n.progress=l,n.easingFunction(l)}function Wc(t,e,n){var r=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r])if(zc(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:Lc(t[r].easing)||e.easingFunction,value:t[r][i]};n[i]=n[i]||[],n[i].push(o)}return n}(t,e),i=function(t,e){var n=[];for(var r in t)for(var i=t[r],o=0;o<i.length-1;o++){var a=o,s=o+1,c=i[a].computedOffset,l=i[s].computedOffset,u=c,f=l;0===o&&(u=-1/0,0===l&&(s=a)),o===i.length-2&&(f=1/0,1===c&&(a=s)),n.push({applyFrom:u,applyTo:f,startOffset:i[a].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[a].easingFunction,property:r,interpolation:Hc(r,i[a].value,i[s].value,e)})}return n.sort((function(t,e){return t.startOffset-e.startOffset})),n}(r,n);return function(t,e){if(null!==e)i.filter((function(t){return e>=t.applyFrom&&e<t.applyTo})).forEach((function(n){var r=e-n.startOffset,i=n.endOffset-n.startOffset,o=0===i?0:n.easingFunction(r/i);t.setAttribute(n.property,n.interpolation(o))}));else for(var n in r)zc(n)&&t.setAttribute(n,null)}}function zc(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var Vc=function(t,e,n){return function(r){var i=Xc(t,e,r);return!os.enableCSSParsing&&Ae(i)?i:n(i)}};function Hc(t,e,n,r){var i=Co[t];if(i&&i.syntax&&i.int){var o=os.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a=void 0,s=void 0;if(os.enableCSSParsing){var c=os.styleValueRegistry.parseProperty(t,e,r),l=os.styleValueRegistry.parseProperty(t,n,r);a=os.styleValueRegistry.computeProperty(t,c,r),s=os.styleValueRegistry.computeProperty(t,l,r)}else{var d=o.parserWithCSSDisabled;a=d?d(e,r):e,s=d?d(n,r):n}var h=o.mixer(a,s,r);if(h){var p=Vc.apply(void 0,f([],u(h),!1));return function(t){return 0===t?e:1===t?n:p(t)}}}}return Vc(!1,!0,(function(t){return t?n:e}))}function Xc(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e||"string"==typeof t&&"string"==typeof e)return n<.5?t:e;if(Array.isArray(t)&&Array.isArray(e)){for(var r=t.length,i=e.length,o=Math.max(r,i),a=[],s=0;s<o;s++)a.push(Xc(t[s<r?s:r-1],e[s<i?s:i-1],n));return a}throw new Error("Mismatched interpolation arguments "+t+":"+e)}var Yc=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Tc,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}return Object.defineProperty(t.prototype,"easing",{get:function(){return this._easing},set:function(t){this.easingFunction=Lc(t),this._easing=t},enumerable:!1,configurable:!0}),t}();function $c(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var r=t[n];Array.isArray(r)||(r=[r]);for(var i=r.length,o=0;o<i;o++){if(!e[o]){var a={};"offset"in t&&(a.offset=Number(t.offset)),"easing"in t&&(a.easing=t.easing),"composite"in t&&(a.composite=t.composite),e[o]=a}void 0!==r[o]&&null!==r[o]&&(e[o][n]=r[o])}}return e.sort((function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)})),e}(t));for(var n=t.map((function(t){var n={};for(var r in(null==e?void 0:e.composite)&&(n.composite="auto"),t){var i=t[r];if("offset"===r){if(null!==i){if(i=Number(i),!isFinite(i))throw new Error("Keyframe offsets must be numbers.");if(i<0||i>1)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw new Error("".concat(i," compositing is not supported"));n[r]=i}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n})),r=!0,i=-1/0,o=0;o<n.length;o++){var a=n[o].offset;if(he(a))r=!1;else{if(a<i)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=a}}return n=n.filter((function(t){return Number(t.offset)>=0&&Number(t.offset)<=1})),r||function(){var t,e,r=n.length;n[r-1].computedOffset=Number(null!==(t=n[r-1].offset)&&void 0!==t?t:1),r>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var i=0,o=Number(n[0].computedOffset),a=1;a<r;a++){var s=n[a].computedOffset;if(!he(s)&&!he(o)){for(var c=1;c<a-i;c++)n[i+c].computedOffset=o+(Number(s)-o)*c/(a-i);i=a,o=Number(s)}}}(),n}var qc="backwards|forwards|both|none".split("|"),Kc="reverse|alternate|alternate-reverse".split("|");function Zc(t,e){return function(t,e){var n=new Yc;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach((function(e){if(void 0!==t[e]&&null!==t[e]&&"auto"!==t[e]){if(("number"==typeof n[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===qc.indexOf(t[e]))return;if("direction"===e&&-1===Kc.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}(t=function(t){"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t});return t}(null!=t?t:{duration:"auto"}),e)}var Qc=function(){function t(t,e,n){var r=this;this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=Zc(n,!1),this.timing.effect=this,this.timing.activeDuration=Dc(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=$c(e,this.timing),this.interpolations=Wc(this.normalizedKeyframes,this.timing,this.target);var i=os.globalThis.Proxy;this.computedTiming=i?new i(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?r.animation&&r.animation.currentTime||null:"currentIteration"===e?r.animation&&"running"===r.animation.playState?t.currentIteration||0:null:"progress"===e?r.animation&&"running"===r.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}}):this.timing}return t.prototype.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},t.prototype.update=function(t){return null!==t&&(this.timeFraction=Gc(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},t.prototype.getKeyframes=function(){return this.normalizedKeyframes},t.prototype.setKeyframes=function(t){this.normalizedKeyframes=$c(t)},t.prototype.getComputedTiming=function(){return this.computedTiming},t.prototype.getTiming=function(){return this.timing},t.prototype.updateTiming=function(t){var e=this;Object.keys(t||{}).forEach((function(n){e.timing[n]=t[n]}))},t}();function Jc(t,e){return Number(t.id)-Number(e.id)}var tl=function(){function t(t){var e=this;this.document=t,this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.webAnimationsNextTick=function(t){e.currentTime=t,e.discardAnimations(),0===e.animations.length?e.timelineTicking=!1:e.requestAnimationFrame(e.webAnimationsNextTick)},this.processRafCallbacks=function(t){var n=e.rafCallbacks;e.rafCallbacks=[],t<Number(e.currentTime)&&(t=Number(e.currentTime)),e.animations.sort(Jc),e.animations=e.tick(t,!0,e.animations)[0],n.forEach((function(e){e[1](t)})),e.applyPendingEffects()}}return t.prototype.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},t.prototype.isTicking=function(){return this.inTick},t.prototype.play=function(t,e,n){var r=new Qc(t,e,n),i=new Qs(r,this);return this.animations.push(i),this.restartWebAnimationsNextTick(),i.updatePromises(),i.play(),i.updatePromises(),i},t.prototype.applyDirtiedAnimation=function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(Jc),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach((function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,1)})),this.applyPendingEffects()}},t.prototype.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},t.prototype.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},t.prototype.applyPendingEffects=function(){this.pendingEffects.forEach((function(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]},t.prototype.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))},t.prototype.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))},t.prototype.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},t.prototype.rAF=function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e},t.prototype.requestAnimationFrame=function(t){var e=this;return this.rAF((function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()}))},t.prototype.tick=function(t,e,n){var r,i,o=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var a=[],s=[],c=[],l=[];return n.forEach((function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(a.push(n.effect),n.unmarkTarget()),n._needsTick&&(o.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?c.push(n):l.push(n)})),(r=this.pendingEffects).push.apply(r,f([],u(a),!1)),(i=this.pendingEffects).push.apply(i,f([],u(s),!1)),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[c,l]},t}();os.EasingFunction=Lc,os.AnimationTimeline=tl;const el="main-layer",nl="label-layer",rl="element",il="view",ol="plot",al="component",sl="label",cl="area";function ll(t,e){var n=e.r;t.arc(n,n,n,0,2*Math.PI,!1)}function ul(t,e){var n=e.rx,r=e.ry;if(t.ellipse)t.ellipse(n,r,n,r,0,0,2*Math.PI,!1);else{var i=n>r?n:r,o=n>r?1:n/r,a=n>r?r/n:1;t.save(),t.scale(o,a),t.arc(i,i,i,0,2*Math.PI)}}function fl(t,e){var n,r,i=e.x1,o=e.y1,a=e.x2,s=e.y2,c=e.defX,l=void 0===c?0:c,u=e.defY,f=void 0===u?0:u,d=e.markerStart,h=e.markerEnd,p=e.markerStartOffset,g=e.markerEndOffset,m=0,v=0,y=0,_=0,b=0;d&&hs(d)&&p&&(n=a-i,r=s-o,b=Math.atan2(r,n),m=Math.cos(b)*(p||0),v=Math.sin(b)*(p||0)),h&&hs(h)&&g&&(n=i-a,r=o-s,b=Math.atan2(r,n),y=Math.cos(b)*(g||0),_=Math.sin(b)*(g||0)),t.moveTo(i-l+m,o-f+v),t.lineTo(a-l+y,s-f+_)}function dl(t,e){var n,r,i=e.defX,o=void 0===i?0:i,a=e.defY,s=void 0===a?0:a,c=e.markerStart,l=e.markerEnd,f=e.markerStartOffset,d=e.markerEndOffset,h=e.path,p=h.absolutePath,g=h.segments,m=0,v=0,y=0,_=0,b=0;if(c&&hs(c)&&f){var E=u(c.parentNode.getStartTangent(),2),x=E[0],M=E[1];n=x[0]-M[0],r=x[1]-M[1],b=Math.atan2(r,n),m=Math.cos(b)*(f||0),v=Math.sin(b)*(f||0)}if(l&&hs(l)&&d){var S=u(l.parentNode.getEndTangent(),2);x=S[0],M=S[1];n=x[0]-M[0],r=x[1]-M[1],b=Math.atan2(r,n),y=Math.cos(b)*(d||0),_=Math.sin(b)*(d||0)}for(var A=0;A<p.length;A++){var T=p[A],O=T[0],R=p[A+1],P=0===A&&(0!==m||0!==v),C=(A===p.length-1||R&&("M"===R[0]||"Z"===R[0]))&&0!==y&&0!==_;switch(O){case"M":P?(t.moveTo(T[1]-o+m,T[2]-s+v),t.lineTo(T[1]-o,T[2]-s)):t.moveTo(T[1]-o,T[2]-s);break;case"L":C?t.lineTo(T[1]-o+y,T[2]-s+_):t.lineTo(T[1]-o,T[2]-s);break;case"Q":t.quadraticCurveTo(T[1]-o,T[2]-s,T[3]-o,T[4]-s),C&&t.lineTo(T[3]-o+y,T[4]-s+_);break;case"C":t.bezierCurveTo(T[1]-o,T[2]-s,T[3]-o,T[4]-s,T[5]-o,T[6]-s),C&&t.lineTo(T[5]-o+y,T[6]-s+_);break;case"A":var w=g[A].arcParams,N=w.cx,I=w.cy,k=w.rx,L=w.ry,D=w.startAngle,B=w.endAngle,F=w.xRotation,U=w.sweepFlag;if(t.ellipse)t.ellipse(N-o,I-s,k,L,F,D,B,!!(1-U));else{var j=k>L?k:L,G=k>L?1:k/L,W=k>L?L/k:1;t.translate(N-o,I-s),t.rotate(F),t.scale(G,W),t.arc(0,0,j,D,B,!!(1-U)),t.scale(1/G,1/W),t.rotate(-F),t.translate(-(N-o),-(I-s))}C&&t.lineTo(T[6]-o+y,T[7]-s+_);break;case"Z":t.closePath()}}}function hl(t,e){var n,r,i=e.defX,o=void 0===i?0:i,a=e.defY,s=void 0===a?0:a,c=e.markerStart,l=e.markerEnd,u=e.markerStartOffset,f=e.markerEndOffset,d=e.points.points,h=d.length,p=d[0][0]-o,g=d[0][1]-s,m=d[h-1][0]-o,v=d[h-1][1]-s,y=0,_=0,b=0,E=0,x=0;c&&hs(c)&&u&&(n=d[1][0]-d[0][0],r=d[1][1]-d[0][1],x=Math.atan2(r,n),y=Math.cos(x)*(u||0),_=Math.sin(x)*(u||0)),l&&hs(l)&&f&&(n=d[h-1][0]-d[0][0],r=d[h-1][1]-d[0][1],x=Math.atan2(r,n),b=Math.cos(x)*(f||0),E=Math.sin(x)*(f||0)),t.moveTo(p+(y||b),g+(_||E));for(var M=1;M<h-1;M++){var S=d[M];t.lineTo(S[0]-o,S[1]-s)}t.lineTo(m,v)}function pl(t,e){var n,r,i=e.defX,o=void 0===i?0:i,a=e.defY,s=void 0===a?0:a,c=e.markerStart,l=e.markerEnd,u=e.markerStartOffset,f=e.markerEndOffset,d=e.points.points,h=d.length,p=d[0][0]-o,g=d[0][1]-s,m=d[h-1][0]-o,v=d[h-1][1]-s,y=0,_=0,b=0,E=0,x=0;c&&hs(c)&&u&&(n=d[1][0]-d[0][0],r=d[1][1]-d[0][1],x=Math.atan2(r,n),y=Math.cos(x)*(u||0),_=Math.sin(x)*(u||0)),l&&hs(l)&&f&&(n=d[h-2][0]-d[h-1][0],r=d[h-2][1]-d[h-1][1],x=Math.atan2(r,n),b=Math.cos(x)*(f||0),E=Math.sin(x)*(f||0)),t.moveTo(p+y,g+_);for(var M=1;M<h-1;M++){var S=d[M];t.lineTo(S[0]-o,S[1]-s)}t.lineTo(m+b,v+E)}function gl(t,e){var n=e.radius,r=e.width,i=e.height,o=r,a=i;if(n&&n.some((function(t){return 0!==t}))){var s=r>0?1:-1,c=i>0?1:-1,l=s+c===0,f=u(n.map((function(t){return Se(t,0,Math.min(Math.abs(o)/2,Math.abs(a)/2))})),4),d=f[0],h=f[1],p=f[2],g=f[3];t.moveTo(s*d,0),t.lineTo(o-s*h,0),0!==h&&t.arc(o-s*h,c*h,h,-c*Math.PI/2,s>0?0:Math.PI,l),t.lineTo(o,a-c*p),0!==p&&t.arc(o-s*p,a-c*p,p,s>0?0:Math.PI,c>0?Math.PI/2:1.5*Math.PI,l),t.lineTo(s*g,a),0!==g&&t.arc(s*g,a-c*g,g,c>0?Math.PI/2:-Math.PI/2,s>0?Math.PI:0,l),t.lineTo(0,c*d),0!==d&&t.arc(s*d,c*d,d,s>0?Math.PI:0,c>0?1.5*Math.PI:Math.PI/2,l)}else t.rect(0,0,o,a)}var ml=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="canvas-path-generator",e}return r(e,t),e.prototype.init=function(){var t,e=((t={})[Yn.CIRCLE]=ll,t[Yn.ELLIPSE]=ul,t[Yn.RECT]=gl,t[Yn.LINE]=fl,t[Yn.POLYLINE]=pl,t[Yn.POLYGON]=hl,t[Yn.PATH]=dl,t[Yn.TEXT]=void 0,t[Yn.GROUP]=void 0,t[Yn.IMAGE]=void 0,t[Yn.HTML]=void 0,t[Yn.MESH]=void 0,t);this.context.pathGeneratorFactory=e},e.prototype.destroy=function(){delete this.context.pathGeneratorFactory},e}(Kn),vl=Z(),yl=Z(),_l=Z(),bl=_(),El=function(){function t(){var t=this;this.isHit=function(e,n,r,i){var o=t.context.pointInPathPickerFactory[e.nodeName];if(o){var a=T(bl,r),s=ut(yl,nt(_l,n[0],n[1],0),a),c=e.getGeometryBounds().halfExtents,l=e.parsedStyle.anchor;if(s[0]+=(l&&l[0]||0)*c[0]*2,s[1]+=(l&&l[1]||0)*c[1]*2,o(e,new xr(s[0],s[1]),i,t.isPointInPath,t.context,t.runtime))return!0}return!1},this.isPointInPath=function(e,n){var r=t.runtime.offscreenCanvasCreator.getOrCreateContext(t.context.config.offscreenCanvas),i=t.context.pathGeneratorFactory[e.nodeName];return i&&(r.beginPath(),i(r,e.parsedStyle),r.closePath()),r.isPointInPath(n.x,n.y)}}return t.prototype.apply=function(e,n){var r,i=this,o=e.renderingService,a=e.renderingContext;this.context=e,this.runtime=n;var l=null===(r=a.root)||void 0===r?void 0:r.ownerDocument;o.hooks.pick.tapPromise(t.tag,(function(t){return s(i,void 0,void 0,(function(){return c(this,(function(e){return[2,this.pick(l,t)]}))}))})),o.hooks.pickSync.tap(t.tag,(function(t){return i.pick(l,t)}))},t.prototype.pick=function(t,e){var n,r,i,o=e.topmost,a=(n=e.position).x,s=n.y,c=nt(vl,a,s,0),u=t.elementsFromBBox(c[0],c[1],c[0],c[1]),f=[];try{for(var d=l(u),h=d.next();!h.done;h=d.next()){var p=h.value,g=p.getWorldTransform();if(this.isHit(p,c,g,!1)){var m=ia(p);if(m){var v=m.parsedStyle.clipPath;if(this.isHit(v,c,v.getWorldTransform(),!0)){if(o)return e.picked=[p],e;f.push(p)}}else{if(o)return e.picked=[p],e;f.push(p)}}}}catch(t){r={error:t}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}return e.picked=f,e},t.tag="CanvasPicker",t}();function xl(t,e,n){var r=t.parsedStyle,i=r.r,o=r.fill,a=r.stroke,s=r.lineWidth,c=r.increasedLineWidthForHitTesting,l=r.pointerEvents,f=((s||0)+(c||0))/2,d=An(i,i,e.x,e.y),h=u(ca(l,o,a),2),p=h[0],g=h[1];return p&&g||n?d<=i+f:p?d<=i:!!g&&(d>=i-f&&d<=i+f)}function Ml(t,e,n,r){return t/(n*n)+e/(r*r)}function Sl(t,e,n){var r=t.parsedStyle,i=r.rx,o=r.ry,a=r.fill,s=r.stroke,c=r.lineWidth,l=r.increasedLineWidthForHitTesting,f=r.pointerEvents,d=e.x,h=e.y,p=u(ca(f,a,s),2),g=p[0],m=p[1],v=((c||0)+(l||0))/2,y=(d-i)*(d-i),_=(h-o)*(h-o);return g&&m||n?Ml(y,_,i+v,o+v)<=1:g?Ml(y,_,i,o)<=1:!!m&&(Ml(y,_,i-v,o-v)>=1&&Ml(y,_,i+v,o+v)<=1)}function Al(t,e,n,r,i,o){return i>=t&&i<=t+n&&o>=e&&o<=e+r}function Tl(t,e,n,r,i,o,a,s){var c=(Math.atan2(s-e,a-t)+2*Math.PI)%(2*Math.PI),l={x:t+n*Math.cos(c),y:e+n*Math.sin(c)};return An(l.x,l.y,a,s)<=o/2}function Ol(t,e,n,r,i,o,a){var s=Math.min(t,n),c=Math.max(t,n),l=Math.min(e,r),u=Math.max(e,r),f=i/2;return o>=s-f&&o<=c+f&&a>=l-f&&a<=u+f&&kn(t,e,n,r,o,a)<=i/2}function Rl(t,e,n,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a<o-1;a++){if(Ol(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,n,r))return!0}if(i){var s=t[0],c=t[o-1];if(Ol(s[0],s[1],c[0],c[1],e,n,r))return!0}return!1}var Pl=1e-6;function Cl(t){return Math.abs(t)<Pl?0:t<0?-1:1}function wl(t,e,n){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}function Nl(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var o=0;o<i;o++){var a=t[o],s=t[(o+1)%i];if(wl(a,s,[e,n]))return!0;Cl(a[1]-n)>0!=Cl(s[1]-n)>0&&Cl(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}function Il(t,e,n){for(var r=!1,i=0;i<t.length;i++){if(r=Nl(t[i],e,n))break}return r}function kl(t,e,n){var r=t.parsedStyle,i=r.x1,o=r.y1,a=r.x2,s=r.y2,c=r.lineWidth,l=r.increasedLineWidthForHitTesting,f=r.defX,d=void 0===f?0:f,h=r.defY,p=void 0===h?0:h;return!(!u(ca(r.pointerEvents,r.fill,r.stroke),2)[1]&&!n||!c)&&Ol(i,o,a,s,(c||0)+(l||0),e.x+d,e.y+p)}function Ll(t,e,n,r,i,o){var a=t.parsedStyle,s=a.lineWidth,c=a.increasedLineWidthForHitTesting,l=a.stroke,f=a.fill,d=a.defX,h=void 0===d?0:d,p=a.defY,g=void 0===p?0:p,m=a.path,v=a.pointerEvents,y=m.segments,_=m.hasArc,b=m.polylines,E=m.polygons,x=u(ca(v,(null==E?void 0:E.length)&&f,l),2),M=x[0],S=x[1],A=Xi(t),T=!1;return M||n?T=_?r(t,e):Il(E,e.x+h,e.y+g)||Il(b,e.x+h,e.y+g):((S||n)&&(T=function(t,e,n,r,i){for(var o=!1,a=e/2,s=0;s<t.length;s++){var c=t[s],l=c.currentPoint,u=c.params,f=c.prePoint,d=c.box;if(!d||Al(d.x-a,d.y-a,d.width+e,d.height+e,n,r))switch(c.command){case"L":case"Z":if(o=Ol(f[0],f[1],l[0],l[1],e,n,r))return!0;break;case"Q":if(o=Hn(f[0],f[1],u[1],u[2],u[3],u[4],n,r)<=e/2)return!0;break;case"C":if(o=Un(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],n,r,i)<=e/2)return!0;break;case"A":c.cubicParams||(c.cubicParams=Xt(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var h=c.cubicParams,p=f,g=0;g<h.length;g+=6){var m=Un(p[0],p[1],h[g],h[g+1],h[g+2],h[g+3],h[g+4],h[g+5],n,r,i);if(p=[h[g+4],h[g+5]],o=m<=e/2)return!0}}}return o}(y,(s||0)+(c||0),e.x+h,e.y+g,A)),T)}function Dl(t,e,n){var r=t.parsedStyle,i=r.stroke,o=r.fill,a=r.lineWidth,s=r.increasedLineWidthForHitTesting,c=r.points,l=r.defX,f=void 0===l?0:l,d=r.defY,h=void 0===d?0:d,p=u(ca(r.pointerEvents,o,i),2),g=p[0],m=!1;return(p[1]||n)&&(m=Rl(c.points,(a||0)+(s||0),e.x+f,e.y+h,!0)),m||!g&&!n||(m=Nl(c.points,e.x+f,e.y+h)),m}function Bl(t,e,n){var r=t.parsedStyle,i=r.lineWidth,o=r.increasedLineWidthForHitTesting,a=r.points,s=r.defX,c=void 0===s?0:s,l=r.defY,f=void 0===l?0:l;return!(!u(ca(r.pointerEvents,r.fill,r.stroke),2)[1]&&!n||!i)&&Rl(a.points,(i||0)+(o||0),e.x+c,e.y+f,!1)}function Fl(t,e,n,r,i){var o=t.parsedStyle,a=o.radius,s=o.fill,c=o.stroke,l=o.lineWidth,f=o.increasedLineWidthForHitTesting,d=o.width,h=o.height,p=u(ca(o.pointerEvents,s,c),2),g=p[0],m=p[1],v=(l||0)+(f||0);if(a&&a.some((function(t){return 0!==t}))){var y=!1;return(m||n)&&(y=function(t,e,n,r,i,o,a,s){var c=u(i,4),l=c[0],f=c[1],d=c[2],h=c[3];return Ol(t+l,e,t+n-f,e,o,a,s)||Ol(t+n,e+f,t+n,e+r-d,o,a,s)||Ol(t+n-d,e+r,t+h,e+r,o,a,s)||Ol(t,e+r-h,t,e+l,o,a,s)||Tl(t+n-f,e+f,f,Math.PI,Math.PI,o,a,s)||Tl(t+n-d,e+r-d,d,0,Math.PI,o,a,s)||Tl(t+h,e+r-h,h,Math.PI,Math.PI,o,a,s)||Tl(t+l,e+l,l,Math.PI,Math.PI,o,a,s)}(0,0,d,h,a.map((function(t){return Se(t,0,Math.min(Math.abs(d)/2,Math.abs(h)/2))})),v,e.x,e.y)),y||!g&&!n||(y=r(t,e)),y}var _=v/2;return g&&m||n?Al(0-_,0-_,d+_,h+_,e.x,e.y):g?Al(0,0,d,h,e.x,e.y):!!m&&function(t,e,n,r,i,o,a){var s=i/2;return Al(t-s,e-s,n,i,o,a)||Al(t+n-s,e-s,i,r,o,a)||Al(t+s,e+r-s,n,i,o,a)||Al(t-s,e+s,i,r,o,a)}(0,0,d,h,v,e.x,e.y)}function Ul(t,e,n,r,i,o){var a=t.parsedStyle,s=a.pointerEvents,c=a.width,l=a.height;if("non-transparent-pixel"===s){var u=i.config.offscreenCanvas,f=o.offscreenCanvasCreator.getOrCreateCanvas(u),d=o.offscreenCanvasCreator.getOrCreateContext(u,{willReadFrequently:!0});return f.width=c,f.height=l,i.defaultStyleRendererFactory[Yn.IMAGE].render(d,t.parsedStyle,t,void 0,void 0,void 0),d.getImageData(e.x,e.y,1,1).data.every((function(t){return 0!==t}))}return!0}var jl=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="canvas-picker",e}return r(e,t),e.prototype.init=function(){var t,e=((t={})[Yn.CIRCLE]=xl,t[Yn.ELLIPSE]=Sl,t[Yn.RECT]=Fl,t[Yn.LINE]=kl,t[Yn.POLYLINE]=Bl,t[Yn.POLYGON]=Dl,t[Yn.PATH]=Ll,t[Yn.TEXT]=function(){return!0},t[Yn.GROUP]=null,t[Yn.IMAGE]=Ul,t[Yn.HTML]=null,t[Yn.MESH]=null,t);this.context.pointInPathPickerFactory=e,this.addRenderingPlugin(new El)},e.prototype.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()},e}(Kn),Gl=function(){function t(t){this.canvasRendererPluginOptions=t,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.vpMatrix=_(),this.dprMatrix=_(),this.tmpMat4=_(),this.vec3a=Z(),this.vec3b=Z(),this.vec3c=Z(),this.vec3d=Z()}return t.prototype.apply=function(e,n){var r=this;this.context=e;var i=e.config,o=e.camera,a=e.renderingService,s=e.renderingContext,c=e.rBushRoot,l=e.pathGeneratorFactory;this.rBush=c,this.pathGeneratorFactory=l;var d=e.contextService,h=s.root.ownerDocument.defaultView,p=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)},g=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)};a.hooks.init.tap(t.tag,(function(){h.addEventListener(Xa.UNMOUNTED,p),h.addEventListener(Xa.CULLED,g);var t=d.getDPR(),e=i.width,n=i.height,o=d.getContext();r.clearRect(o,0,0,e*t,n*t,i.background)})),a.hooks.destroy.tap(t.tag,(function(){h.removeEventListener(Xa.UNMOUNTED,p),h.removeEventListener(Xa.CULLED,g),r.renderQueue=[],r.removedRBushNodeAABBs=[],r.restoreStack=[]})),a.hooks.beginFrame.tap(t.tag,(function(){var t,e,n=d.getContext(),o=d.getDPR(),s=i.width,c=i.height,l=(t=r.canvasRendererPluginOptions).dirtyObjectNumThreshold,u=t.dirtyObjectRatioThreshold,f=(e=a.getStats()).total,h=e.rendered,p=h/f;r.clearFullScreen=a.disableDirtyRectangleRendering()||h>l&&p>u,n&&(n.resetTransform?n.resetTransform():n.setTransform(1,0,0,1,0,0),r.clearFullScreen&&r.clearRect(n,0,0,s*o,c*o,i.background))}));var m=function(t,e){t.isVisible()&&!t.isCulled()&&(r.renderDisplayObject(t,e,r.context,r.restoreStack,n),r.saveDirtyAABB(t)),(t.sortable.sorted||t.childNodes).forEach((function(t){m(t,e)}))};a.hooks.endFrame.tap(t.tag,(function(){var t=d.getContext(),e=d.getDPR();if(k(r.dprMatrix,[e,e,1]),R(r.vpMatrix,r.dprMatrix,o.getOrthoMatrix()),r.clearFullScreen)m(s.root,t);else{var a=r.safeMergeAABB.apply(r,f([r.mergeDirtyAABBs(r.renderQueue)],u(r.removedRBushNodeAABBs.map((function(t){var e=t.minX,n=t.minY,r=t.maxX,i=t.maxY,o=new mr;return o.setMinMax([e,n,0],[r,i,0]),o}))),!1));if(r.removedRBushNodeAABBs=[],mr.isEmpty(a))return void(r.renderQueue=[]);var c=r.convertAABB2Rect(a),l=c.x,p=c.y,g=c.width,v=c.height,y=ut(r.vec3a,[l,p,0],r.vpMatrix),_=ut(r.vec3b,[l+g,p,0],r.vpMatrix),b=ut(r.vec3c,[l,p+v,0],r.vpMatrix),E=ut(r.vec3d,[l+g,p+v,0],r.vpMatrix),x=Math.min(y[0],_[0],E[0],b[0]),M=Math.min(y[1],_[1],E[1],b[1]),S=Math.max(y[0],_[0],E[0],b[0]),A=Math.max(y[1],_[1],E[1],b[1]),T=Math.floor(x),O=Math.floor(M),P=Math.ceil(S-x),C=Math.ceil(A-M);t.save(),r.clearRect(t,T,O,P,C,i.background),t.beginPath(),t.rect(T,O,P,C),t.clip(),t.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]),i.renderer.getConfig().enableDirtyRectangleRenderingDebug&&h.dispatchEvent(new Ga(ps.DIRTY_RECTANGLE,{dirtyRect:{x:T,y:O,width:P,height:C}})),r.searchDirtyObjects(a).sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t,r.context,r.restoreStack,n)})),t.restore(),r.renderQueue.forEach((function(t){r.saveDirtyAABB(t)})),r.renderQueue=[]}r.restoreStack.forEach((function(){t.restore()})),r.restoreStack=[]})),a.hooks.render.tap(t.tag,(function(t){r.clearFullScreen||r.renderQueue.push(t)}))},t.prototype.clearRect=function(t,e,n,r,i,o){t.clearRect(e,n,r,i),o&&(t.fillStyle=o,t.fillRect(e,n,r,i))},t.prototype.renderDisplayObject=function(t,e,n,r,i){var o=t.nodeName,a=r[r.length-1];!a||t.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINS||(e.restore(),r.pop());var s=this.context.styleRendererFactory[o],c=this.pathGeneratorFactory[o],l=t.parsedStyle.clipPath;if(l){this.applyWorldTransform(e,l);var u=this.pathGeneratorFactory[l.nodeName];u&&(e.save(),r.push(t),e.beginPath(),u(e,l.parsedStyle),e.closePath(),e.clip())}s&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),c&&(e.beginPath(),c(e,t.parsedStyle),t.nodeName!==Yn.LINE&&t.nodeName!==Yn.PATH&&t.nodeName!==Yn.POLYLINE&&e.closePath()),s&&(s.render(e,t.parsedStyle,t,n,this,i),e.restore()),t.renderable.dirty=!1},t.prototype.convertAABB2Rect=function(t){var e=t.getMin(),n=t.getMax(),r=Math.floor(e[0]),i=Math.floor(e[1]);return{x:r,y:i,width:Math.ceil(n[0])-r,height:Math.ceil(n[1])-i}},t.prototype.mergeDirtyAABBs=function(t){var e=new mr;return t.forEach((function(t){var n=t.getRenderBounds();e.add(n);var r=t.renderable.dirtyRenderBounds;r&&e.add(r)})),e},t.prototype.searchDirtyObjects=function(t){var e,n,r=(e=u(t.getMin(),2))[0],i=e[1],o=(n=u(t.getMax(),2))[0],a=n[1];return this.rBush.search({minX:r,minY:i,maxX:o,maxY:a}).map((function(t){return t.displayObject}))},t.prototype.saveDirtyAABB=function(t){var e=t.renderable;e.dirtyRenderBounds||(e.dirtyRenderBounds=new mr);var n=t.getRenderBounds();n&&e.dirtyRenderBounds.update(n.center,n.halfExtents)},t.prototype.applyAttributesToContext=function(t,e){var n,r=(n=e.parsedStyle).stroke,i=n.fill,o=n.opacity,a=n.lineDash,s=n.lineDashOffset;a&&t.setLineDash(a),he(s)||(t.lineDashOffset=s),he(o)||(t.globalAlpha*=o),he(r)||Array.isArray(r)||r.isNone||(t.strokeStyle=e.attributes.stroke),he(i)||Array.isArray(i)||i.isNone||(t.fillStyle=e.attributes.fill)},t.prototype.applyWorldTransform=function(t,e,n){var r=0,i=0,o=(e.parsedStyle||{}).anchor,a=o&&o[0]||0,s=o&&o[1]||0;if(0!==a||0!==s){var c=e.geometry.contentBounds;r=-a*(c&&2*c.halfExtents[0]||0),i=-s*(c&&2*c.halfExtents[1]||0)}n?(E(this.tmpMat4,e.getLocalTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,P(this.tmpMat4,this.tmpMat4,this.vec3a),R(this.tmpMat4,n,this.tmpMat4),R(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(E(this.tmpMat4,e.getWorldTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,P(this.tmpMat4,this.tmpMat4,this.vec3a),R(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])},t.prototype.safeMergeAABB=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=new mr;return t.forEach((function(t){n.add(t)})),n},t.tag="CanvasRenderer",t}(),Wl=function(){function t(t){this.imagePool=t}return t.prototype.render=function(t,e,n,r,i,o){var a=e.fill,s=e.fillRule,c=e.opacity,l=e.fillOpacity,u=e.stroke,f=e.strokeOpacity,d=e.lineWidth,h=e.lineCap,p=e.lineJoin,g=e.shadowType,m=e.shadowColor,v=e.shadowBlur,y=e.filter,_=e.miterLimit,b=!he(a)&&!a.isNone,E=!he(u)&&!u.isNone&&d>0,x=0===a.alpha,M=!(!y||!y.length),S=!he(m)&&v>0,A=n.nodeName,T="inner"===g,O=E&&S&&(A===Yn.PATH||A===Yn.LINE||A===Yn.POLYLINE||x||T);b&&(t.globalAlpha=c*l,O||zl(n,t,S),this.fill(t,n,a,s,r,i,o),O||this.clearShadowAndFilter(t,M,S)),E&&(t.globalAlpha=c*f,t.lineWidth=d,he(_)||(t.miterLimit=_),he(h)||(t.lineCap=h),he(p)||(t.lineJoin=p),O&&(T&&(t.globalCompositeOperation="source-atop"),zl(n,t,!0),T&&(this.stroke(t,n,u,r,i,o),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,M,!0))),this.stroke(t,n,u,r,i,o))},t.prototype.clearShadowAndFilter=function(t,e,n){if(n&&(t.shadowColor="transparent",t.shadowBlur=0),e){var r=t.filter;!he(r)&&r.indexOf("drop-shadow")>-1&&(t.filter=r.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}},t.prototype.fill=function(t,e,n,r,i,o,a){var s=this;Array.isArray(n)?n.forEach((function(n){t.fillStyle=s.getColor(n,e,t),r?t.fill(r):t.fill()})):(Ti(n)&&(t.fillStyle=this.getPattern(n,e,t,i,o,a)),r?t.fill(r):t.fill())},t.prototype.stroke=function(t,e,n,r,i,o){var a=this;Array.isArray(n)?n.forEach((function(n){t.strokeStyle=a.getColor(n,e,t),t.stroke()})):(Ti(n)&&(t.strokeStyle=this.getPattern(n,e,t,r,i,o)),t.stroke())},t.prototype.getPattern=function(t,e,n,r,i,o){var a,s;if("rect"===t.image.nodeName){var c=t.image.parsedStyle,l=c.width,u=c.height;s=r.contextService.getDPR();var f=r.config.offscreenCanvas;(a=o.offscreenCanvasCreator.getOrCreateCanvas(f)).width=l*s,a.height=u*s;var d=o.offscreenCanvasCreator.getOrCreateContext(f),h=[];t.image.forEach((function(t){i.renderDisplayObject(t,d,r,h,o)})),h.forEach((function(){d.restore()}))}return this.imagePool.getOrCreatePatternSync(t,n,a,s,(function(){e.renderable.dirty=!0,r.renderingService.dirtify()}))},t.prototype.getColor=function(t,e,n){var r;if(t.type===Br.LinearGradient||t.type===Br.RadialGradient){var o=e.getGeometryBounds(),a=o&&2*o.halfExtents[0]||1,s=o&&2*o.halfExtents[1]||1;r=this.imagePool.getOrCreateGradient(i(i({type:t.type},t.value),{width:a,height:s}),n)}return r},t}();function zl(t,e,n){var r=t.parsedStyle,i=r.filter,o=r.shadowColor,a=r.shadowBlur,s=r.shadowOffsetX,c=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=o.toString(),e.shadowBlur=a||0,e.shadowOffsetX=s||0,e.shadowOffsetY=c||0)}var Vl=function(){function t(t){this.imagePool=t}return t.prototype.render=function(t,e,n){var r,i=e.width,o=e.height,a=e.img,s=e.shadowColor,c=e.shadowBlur,l=i,u=o;if(Me(a)?r=this.imagePool.getImageSync(a):(l||(l=a.width),u||(u=a.height),r=a),r){zl(n,t,!he(s)&&c>0);try{t.drawImage(r,0,0,l,u)}catch(t){}}},t}(),Hl=function(){function t(){}return t.prototype.render=function(t,e,n,r,i,o){var a=e,s=a.lineWidth,c=a.textAlign,l=a.textBaseline,u=a.lineJoin,f=a.miterLimit,d=a.letterSpacing,h=a.stroke,p=a.fill,g=a.fillOpacity,m=a.strokeOpacity,v=a.opacity,y=a.metrics,_=a.dx,b=a.dy,E=a.shadowColor,x=a.shadowBlur,M=y.font,S=y.lines,A=y.height,T=y.lineHeight,O=y.lineMetrics;t.font=M,t.lineWidth=s,t.textAlign="middle"===c?"center":c;var R=l;o.enableCSSParsing||"alphabetic"!==R||(R="bottom"),t.lineJoin=u,he(f)||(t.miterLimit=f);var P=0;"middle"===l?P=-A/2-T/2:"bottom"===l||"alphabetic"===l||"ideographic"===l?P=-A:"top"!==l&&"hanging"!==l||(P=-T);var C=_||0;P+=b||0,1===S.length&&("bottom"===R?(R="middle",P-=.5*A):"top"===R&&(R="middle",P+=.5*A)),t.textBaseline=R,zl(n,t,!he(E)&&x>0);for(var w=0;w<S.length;w++){var N=s/2+C;P+=T,he(h)||h.isNone||!s||this.drawLetterSpacing(t,S[w],O[w],c,N,P,d,g,m,v,!0),he(p)||this.drawLetterSpacing(t,S[w],O[w],c,N,P,d,g,m,v)}},t.prototype.drawLetterSpacing=function(t,e,n,r,i,o,a,s,c,l,u){if(void 0===u&&(u=!1),0!==a){var f=t.textAlign;t.textAlign="left";var d=i;"center"===r||"middle"===r?d=i-n.width/2:"right"!==r&&"end"!==r||(d=i-n.width);for(var h=Array.from(e),p=t.measureText(e).width,g=0,m=0;m<h.length;++m){var v=h[m];u?this.strokeText(t,v,d,o,c):this.fillText(t,v,d,o,s,l),d+=p-(g=t.measureText(e.substring(m+1)).width)+a,p=g}t.textAlign=f}else u?this.strokeText(t,e,i,o,c):this.fillText(t,e,i,o,s,l)},t.prototype.fillText=function(t,e,n,r,i,o){var a,s=!he(i)&&1!==i;s&&(a=t.globalAlpha,t.globalAlpha=i*o),t.fillText(e,n,r),s&&(t.globalAlpha=a)},t.prototype.strokeText=function(t,e,n,r,i){var o,a=!he(i)&&1!==i;a&&(o=t.globalAlpha,t.globalAlpha=i),t.strokeText(e,n,r),a&&(t.globalAlpha=o)},t}();!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}r(e,t)}(Wl),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}r(e,t)}(Wl),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}r(e,t)}(Wl),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}r(e,t)}(Wl),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}r(e,t)}(Wl),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}r(e,t)}(Wl),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}r(e,t)}(Wl);var Xl=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.options=e,n.name="canvas-renderer",n}return r(e,t),e.prototype.init=function(){var t,e=i({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,r=new Wl(n),o=((t={})[Yn.CIRCLE]=r,t[Yn.ELLIPSE]=r,t[Yn.RECT]=r,t[Yn.IMAGE]=new Vl(n),t[Yn.TEXT]=new Hl,t[Yn.LINE]=r,t[Yn.POLYLINE]=r,t[Yn.POLYGON]=r,t[Yn.PATH]=r,t[Yn.GROUP]=void 0,t[Yn.HTML]=void 0,t[Yn.MESH]=void 0,t);this.context.defaultStyleRendererFactory=o,this.context.styleRendererFactory=o,this.addRenderingPlugin(new Gl(e))},e.prototype.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory},e}(Kn),Yl=function(){function t(){}return t.prototype.apply=function(e,n){var r=this,i=e.renderingService,o=e.renderingContext,a=e.config;this.context=e;var s=o.root.ownerDocument.defaultView,c=function(t){i.hooks.pointerMove.call(t)},l=function(t){i.hooks.pointerUp.call(t)},u=function(t){i.hooks.pointerDown.call(t)},f=function(t){i.hooks.pointerOver.call(t)},d=function(t){i.hooks.pointerOut.call(t)},h=function(t){i.hooks.pointerCancel.call(t)},p=function(t){i.hooks.pointerWheel.call(t)},g=function(t){i.hooks.click.call(t)};i.hooks.init.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="none",t.style.msTouchAction="none"):s.supportsPointerEvents&&(t.style.touchAction="none"),s.supportsPointerEvents?function(t){n.globalThis.document.addEventListener("pointermove",c,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("pointerleave",d,!0),t.addEventListener("pointerover",f,!0),n.globalThis.addEventListener("pointerup",l,!0),n.globalThis.addEventListener("pointercancel",h,!0)}(t):function(t){n.globalThis.document.addEventListener("mousemove",c,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("mouseout",d,!0),t.addEventListener("mouseover",f,!0),n.globalThis.addEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.addEventListener("touchstart",u,!0),t.addEventListener("touchend",l,!0),t.addEventListener("touchmove",c,!0),t.addEventListener("touchcancel",h,!0)}(t),a.useNativeClickEvent&&t.addEventListener("click",g,!0),t.addEventListener("wheel",p,{passive:!0,capture:!0})})),i.hooks.destroy.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):s.supportsPointerEvents&&(t.style.touchAction=""),s.supportsPointerEvents?function(t){n.globalThis.document.removeEventListener("pointermove",c,!0),t.removeEventListener("pointerdown",u,!0),t.removeEventListener("pointerleave",d,!0),t.removeEventListener("pointerover",f,!0),n.globalThis.removeEventListener("pointerup",l,!0)}(t):function(t){n.globalThis.document.removeEventListener("mousemove",c,!0),t.removeEventListener("mousedown",u,!0),t.removeEventListener("mouseout",d,!0),t.removeEventListener("mouseover",f,!0),n.globalThis.removeEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",u,!0),t.removeEventListener("touchend",l,!0),t.removeEventListener("touchmove",c,!0),t.removeEventListener("touchcancel",h,!0)}(t),a.useNativeClickEvent&&t.removeEventListener("click",g,!0),t.removeEventListener("wheel",p,!0)}))},t.tag="DOMInteraction",t}(),$l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="dom-interaction",e}return r(e,t),e.prototype.init=function(){this.addRenderingPlugin(new Yl)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(Kn),ql=function(){function t(){this.displayObjectHTMLElementMap=new WeakMap}return t.prototype.joinTransformMatrix=function(t){return"matrix(".concat([t[0],t[1],t[4],t[5],t[12],t[13]].join(","),")")},t.prototype.apply=function(e,n){var r=this,i=e.camera,o=e.renderingContext,a=e.renderingService;this.context=e;var s=o.root.ownerDocument.defaultView,c=function(t,e){e.style.transform=r.joinTransformMatrix(t.getWorldTransform())},l=function(t){var e=t.target;if(e.nodeName===Yn.HTML){r.$camera||(r.$camera=r.createCamera(i));var o=r.getOrCreateEl(e);if(r.$camera.appendChild(o),n.enableCSSParsing){var a=e.ownerDocument.documentElement.attributes;Object.keys(a).forEach((function(t){o.style[t]=a[t]}))}Object.keys(e.attributes).forEach((function(t){r.updateAttribute(t,e)})),c(e,o),r.context.nativeHTMLMap.set(o,e)}},u=function(t){var e=t.target;if(e.nodeName===Yn.HTML&&r.$camera){var n=r.getOrCreateEl(e);n&&(n.remove(),r.context.nativeHTMLMap.delete(n))}},f=function(t){var e=t.target;if(e.nodeName===Yn.HTML){var n=t.attrName;r.updateAttribute(n,e)}},d=function(t){var e=t.target;if(e.nodeName===Yn.HTML){var n=r.getOrCreateEl(e);c(e,n)}},h=function(){if(r.$camera){var t=r.context.config,e=t.width,n=t.height;r.$camera.style.width="".concat(e||0,"px"),r.$camera.style.height="".concat(n||0,"px")}};a.hooks.init.tap(t.tag,(function(){s.addEventListener(ps.RESIZE,h),s.addEventListener(Xa.MOUNTED,l),s.addEventListener(Xa.UNMOUNTED,u),s.addEventListener(Xa.ATTR_MODIFIED,f),s.addEventListener(Xa.BOUNDS_CHANGED,d)})),a.hooks.endFrame.tap(t.tag,(function(){r.$camera&&o.renderReasons.has(Da.CAMERA_CHANGED)&&(r.$camera.style.transform=r.joinTransformMatrix(i.getOrthoMatrix()))})),a.hooks.destroy.tap(t.tag,(function(){r.$camera&&r.$camera.remove(),s.removeEventListener(ps.RESIZE,h),s.removeEventListener(Xa.MOUNTED,l),s.removeEventListener(Xa.UNMOUNTED,u),s.removeEventListener(Xa.ATTR_MODIFIED,f),s.removeEventListener(Xa.BOUNDS_CHANGED,d)}))},t.prototype.createCamera=function(t){var e,n=(e=this.context.config).document,r=e.width,i=e.height,o=this.context.contextService.getDomElement(),a=o.parentNode;if(a){var s="g-canvas-camera",c=a.querySelector("#"+s);if(!c){var l=(n||document).createElement("div");c=l,l.id=s,l.style.position="absolute",l.style.left="".concat(o.offsetLeft||0,"px"),l.style.top="".concat(o.offsetTop||0,"px"),l.style.transformOrigin="left top",l.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),l.style.overflow="hidden",l.style.pointerEvents="none",l.style.width="".concat(r||0,"px"),l.style.height="".concat(i||0,"px"),a.appendChild(l)}return c}return null},t.prototype.getOrCreateEl=function(t){var e=this.context.config.document,n=this.displayObjectHTMLElementMap.get(t);return n||(n=(e||document).createElement("div"),t.parsedStyle.$el=n,this.displayObjectHTMLElementMap.set(t,n),t.id&&(n.id=t.id),t.name&&n.setAttribute("name",t.name),t.className&&(n.className=t.className),n.style.position="absolute",n.style.left="0px",n.style.top="0px",n.style["will-change"]="transform",n.style.transform=this.joinTransformMatrix(t.getWorldTransform())),n},t.prototype.updateAttribute=function(t,e){var n=this.getOrCreateEl(e);switch(t){case"innerHTML":var r=e.parsedStyle.innerHTML;Me(r)?n.innerHTML=r:(n.innerHTML="",n.appendChild(r));break;case"transformOrigin":var i=e.parsedStyle.transformOrigin;n.style["transform-origin"]="".concat(i[0].value," ").concat(i[1].value);break;case"width":if(this.context.enableCSSParsing){var o=e.computedStyleMap().get("width");n.style.width=o.toString()}else{o=e.parsedStyle.width;n.style.width=Ae(o)?"".concat(o,"px"):o.toString()}break;case"height":if(this.context.enableCSSParsing){var a=e.computedStyleMap().get("height");n.style.height=a.toString()}else{a=e.parsedStyle.height;n.style.height=Ae(a)?"".concat(a,"px"):a.toString()}break;case"zIndex":var s=e.parsedStyle.zIndex;n.style["z-index"]="".concat(s);break;case"visibility":var c=e.parsedStyle.visibility;n.style.visibility=c;break;case"pointerEvents":var l=e.parsedStyle.pointerEvents;n.style.pointerEvents=l;break;case"opacity":var u=e.parsedStyle.opacity;n.style.opacity="".concat(u);break;case"fill":var f=e.parsedStyle.fill,d="";Oi(f)?d=f.isNone?"transparent":e.getAttribute("fill"):Array.isArray(f)?d=e.getAttribute("fill"):Ti(f),n.style.background=d;break;case"stroke":var h=e.parsedStyle.stroke,p="";Oi(h)?p=h.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(h)?p=e.getAttribute("stroke"):Ti(h),n.style["border-color"]=p,n.style["border-style"]="solid";break;case"lineWidth":var g=e.parsedStyle.lineWidth;n.style["border-width"]="".concat(g||0,"px");break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":var m=e.style.filter;n.style.filter=m;break;default:"x"!==t&&"y"!==t&&(he(e.style[t])||""===e.style[t]||(n.style[t]=e.style[t]))}},t.tag="HTMLRendering",t}(),Kl=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="html-renderer",e}return r(e,t),e.prototype.init=function(){this.addRenderingPlugin(new ql)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(Kn),Zl=function(){function t(t){this.canvasConfig=t,this.imageCache={},this.gradientCache={},this.patternCache={}}return t.prototype.getImageSync=function(t,e){return this.imageCache[t]?e&&e():this.getOrCreateImage(t).then((function(){e&&e()})),this.imageCache[t]},t.prototype.getOrCreateImage=function(t){var e=this;if(this.imageCache[t])return Promise.resolve(this.imageCache[t]);var n=this.canvasConfig.createImage;return new Promise((function(r,i){var o;n?o=n(t):ea&&(o=new window.Image),o&&(o.onload=function(){e.imageCache[t]=o,r(o)},o.onerror=function(t){i(t)},o.crossOrigin="Anonymous",o.src=t)}))},t.prototype.getOrCreatePatternSync=function(t,e,n,r,i){var o=this.generatePatternKey(t);if(o&&this.patternCache[o])return this.patternCache[o];var a,s=t.image,c=t.repetition,l=t.transform,u=!1;Me(s)?a=this.getImageSync(s,i):n?(a=n,u=!0):a=s;var f=a&&e.createPattern(a,c);if(f){var d=void 0;d=l?Wo(mo(l),new Es({})):S(_()),u&&C(d,d,[1/r,1/r,1]),f.setTransform({a:d[0],b:d[1],c:d[4],d:d[5],e:d[12],f:d[13]})}return o&&f&&(this.patternCache[o]=f),f},t.prototype.getOrCreateGradient=function(t,e){var n=this.generateGradientKey(t),r=t.type,i=t.steps,o=t.width,a=t.height,s=t.angle,c=t.cx,l=t.cy,u=t.size;if(this.gradientCache[n])return this.gradientCache[n];var f=null;if(r===Br.LinearGradient){var d=function(t,e,n){var r=ir(n.value),i=0+t/2,o=0+e/2,a=Math.abs(t*Math.cos(r))+Math.abs(e*Math.sin(r));return{x1:i-Math.cos(r)*a/2,y1:o-Math.sin(r)*a/2,x2:i+Math.cos(r)*a/2,y2:o+Math.sin(r)*a/2}}(o,a,s),h=d.x1,p=d.y1,g=d.x2,m=d.y2;f=e.createLinearGradient(h,p,g,m)}else if(r===Br.RadialGradient){var v=function(t,e,n,r,i){var o=n.value,a=r.value;n.unit===Tr.kPercentage&&(o=n.value/100*t),r.unit===Tr.kPercentage&&(a=r.value/100*e);var s=Math.max(Zt([0,0],[o,a]),Zt([0,e],[o,a]),Zt([t,e],[o,a]),Zt([t,0],[o,a]));return i&&(i instanceof Qr?s=i.value:i instanceof Vr&&("closest-side"===i.value?s=Math.min(o,t-o,a,e-a):"farthest-side"===i.value?s=Math.max(o,t-o,a,e-a):"closest-corner"===i.value&&(s=Math.min(Zt([0,0],[o,a]),Zt([0,e],[o,a]),Zt([t,e],[o,a]),Zt([t,0],[o,a]))))),{x:o,y:a,r:s}}(o,a,c,l,u),y=v.x,_=v.y,b=v.r;f=e.createRadialGradient(y,_,0,y,_,b)}return f&&(i.forEach((function(t){var e=t.offset,n=t.color;e.unit===Tr.kPercentage&&(null==f||f.addColorStop(e.value/100,n.toString()))})),this.gradientCache[n]=f),this.gradientCache[n]},t.prototype.generateGradientKey=function(t){var e=t.type,n=t.width,r=t.height,i=t.steps,o=t.angle,a=t.cx,s=t.cy,c=t.size;return"gradient-".concat(e,"-").concat((null==o?void 0:o.toString())||0,"-").concat((null==a?void 0:a.toString())||0,"-").concat((null==s?void 0:s.toString())||0,"-").concat((null==c?void 0:c.toString())||0,"-").concat(n,"-").concat(r,"-").concat(i.map((function(t){var e=t.offset,n=t.color;return"".concat(e).concat(n)})).join("-"))},t.prototype.generatePatternKey=function(t){var e=t.image,n=t.repetition;return Me(e)?"pattern-".concat(e,"-").concat(n):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(n):void 0},t}(),Ql=function(){function t(){}return t.prototype.apply=function(e){var n=e.renderingService,r=e.renderingContext,i=e.imagePool,o=r.root.ownerDocument.defaultView,a=function(t){var e=t.target,r=e.nodeName,o=e.attributes;if(r===Yn.IMAGE){var a=o.img;Me(a)&&i.getImageSync(a,(function(){e.renderable.dirty=!0,n.dirtify()}))}},s=function(t){var e=t.target,r=t.attrName,o=t.newValue;e.nodeName===Yn.IMAGE&&"img"===r&&Me(o)&&i.getOrCreateImage(o).then((function(){e.renderable.dirty=!0,n.dirtify()}))};n.hooks.init.tap(t.tag,(function(){o.addEventListener(Xa.MOUNTED,a),o.addEventListener(Xa.ATTR_MODIFIED,s)})),n.hooks.destroy.tap(t.tag,(function(){o.removeEventListener(Xa.MOUNTED,a),o.removeEventListener(Xa.ATTR_MODIFIED,s)}))},t.tag="LoadImage",t}(),Jl=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="image-loader",e}return r(e,t),e.prototype.init=function(){this.context.imagePool=new Zl(this.context.config),this.addRenderingPlugin(new Ql)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(Kn),tu=function(){function t(t){this.renderingContext=t.renderingContext,this.canvasConfig=t.config}return t.prototype.init=function(){var t=this.canvasConfig,e=t.container,n=t.canvas;if(n)this.$canvas=n,e&&n.parentElement!==e&&e.appendChild(n),this.$container=n.parentElement,this.canvasConfig.container=this.$container;else if(e&&(this.$container=Me(e)?document.getElementById(e):e,this.$container)){var r=document.createElement("canvas");this.$container.appendChild(r),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=r}this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)},t.prototype.getContext=function(){return this.context},t.prototype.getDomElement=function(){return this.$canvas},t.prototype.getDPR=function(){return this.dpr},t.prototype.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},t.prototype.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},t.prototype.resize=function(t,e){var n=this.canvasConfig.devicePixelRatio||ea&&window.devicePixelRatio||1;n=n>=1?Math.ceil(n):1,this.dpr=n,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*e,function(t,e,n){ea&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")}(this.$canvas,t,e)),this.renderingContext.renderReasons.add(Da.CAMERA_CHANGED)},t.prototype.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},t.prototype.toDataURL=function(t){return void 0===t&&(t={}),s(this,void 0,void 0,(function(){var e,n;return c(this,(function(r){return e=t.type,n=t.encoderOptions,[2,this.context.canvas.toDataURL(e,n)]}))}))},t}(),eu=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="canvas-context-register",e}return r(e,t),e.prototype.init=function(){this.context.ContextService=tu},e.prototype.destroy=function(){delete this.context.ContextService},e}(Kn),nu=function(t){function e(e){var n=t.call(this,e)||this;return n.registerPlugin(new eu),n.registerPlugin(new Jl),n.registerPlugin(new ml),n.registerPlugin(new Xl),n.registerPlugin(new $l),n.registerPlugin(new jl),n.registerPlugin(new Kl),n}return r(e,t),e}(Zn),ru=function(){function t(t){this.dragndropPluginOptions=t}return t.prototype.apply=function(e){var n=this,r=e.renderingService,i=e.renderingContext.root.ownerDocument,o=i.defaultView,a=function(t){var e=t.target,r=e===i,a=r&&n.dragndropPluginOptions.isDocumentDraggable?i:e.closest&&e.closest("[draggable=true]");if(a){var l=!1,u=t.timeStamp,f=[t.clientX,t.clientY],d=null,h=[t.clientX,t.clientY],p=function(t){return s(n,void 0,void 0,(function(){var n,o,s,p,g,m;return c(this,(function(c){switch(c.label){case 0:if(!l){if(n=t.timeStamp-u,o=Zt([t.clientX,t.clientY],f),n<=this.dragndropPluginOptions.dragstartTimeThreshold||o<=this.dragndropPluginOptions.dragstartDistanceThreshold)return[2];t.type="dragstart",a.dispatchEvent(t),l=!0}return t.type="drag",t.dx=t.clientX-h[0],t.dy=t.clientY-h[1],a.dispatchEvent(t),h=[t.clientX,t.clientY],r?[3,2]:(s="pointer"===this.dragndropPluginOptions.overlap?[t.canvasX,t.canvasY]:e.getBounds().center,[4,i.elementsFromPoint(s[0],s[1])]);case 1:p=c.sent(),g=p[p.indexOf(e)+1],m=(null==g?void 0:g.closest("[droppable=true]"))||(this.dragndropPluginOptions.isDocumentDroppable?i:null),d!==m&&(d&&(t.type="dragleave",t.target=d,d.dispatchEvent(t)),m&&(t.type="dragenter",t.target=m,m.dispatchEvent(t)),(d=m)&&(t.type="dragover",t.target=d,d.dispatchEvent(t))),c.label=2;case 2:return[2]}}))}))};o.addEventListener("pointermove",p);var g=function(t){if(l){t.detail={preventClick:!0};var e=t.clone();d&&(e.type="drop",e.target=d,d.dispatchEvent(e)),e.type="dragend",a.dispatchEvent(e),l=!1}o.removeEventListener("pointermove",p)};e.addEventListener("pointerup",g,{once:!0}),e.addEventListener("pointerupoutside",g,{once:!0})}};r.hooks.init.tap(t.tag,(function(){o.addEventListener("pointerdown",a)})),r.hooks.destroy.tap(t.tag,(function(){o.removeEventListener("pointerdown",a)}))},t.tag="Dragndrop",t}(),iu=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.options=e,n.name="dragndrop",n}return r(e,t),e.prototype.init=function(){this.addRenderingPlugin(new ru(i({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e.prototype.setOptions=function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)},e}(Kn),ou=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},t.prototype.once=function(t,e){return this.on(t,e,!0)},t.prototype.emit=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this._events[t]||[],o=this._events["*"]||[],a=function(r){for(var i=r.length,o=0;o<i;o++)if(r[o]){var a=r[o],s=a.callback;a.once&&(r.splice(o,1),0===r.length&&delete e._events[t],i--,o--),s.apply(e,n)}};a(i),a(o)},t.prototype.off=function(t,e){if(t)if(e){for(var n=this._events[t]||[],r=n.length,i=0;i<r;i++)n[i].callback===e&&(n.splice(i,1),r--,i--);0===n.length&&delete this._events[t]}else delete this._events[t];else this._events={};return this},t.prototype.getEvents=function(){return this._events},t}();function au(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function su(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function cu(t){let e,n,r;function i(t,r,i=0,o=t.length){if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<0?i=e+1:o=e}while(i<o)}return i}return 2!==t.length?(e=au,n=(e,n)=>au(t(e),n),r=(e,n)=>t(e)-n):(e=t===au||t===su?t:lu,n=t,r=t),{left:i,center:function(t,e,n=0,o=t.length){const a=i(t,e,n,o-1);return a>n&&r(t[a-1],e)>-r(t[a],e)?a-1:a},right:function(t,r,i=0,o=t.length){if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<=0?i=e+1:o=e}while(i<o)}return i}}}function lu(){return 0}function uu(t){return null===t?NaN:+t}const fu=cu(au),du=fu.right,hu=fu.left,pu=cu(uu).center;function gu(t,e){let n=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&++n;else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(i=+i)>=i&&++n}return n}function mu(t,e){const n=function(t,e){let n,r=0,i=0,o=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(n=e-i,i+=n/++r,o+=n*(e-i));else{let a=-1;for(let s of t)null!=(s=e(s,++a,t))&&(s=+s)>=s&&(n=s-i,i+=n/++r,o+=n*(s-i))}if(r>1)return o/(r-1)}(t,e);return n?Math.sqrt(n):n}function vu(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r<e&&(r=e)));else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(void 0===n?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}class yu{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let r=0;r<this._n&&r<32;r++){const i=e[r],o=t+i,a=Math.abs(t)<Math.abs(i)?t-(o-i):i-(o-t);a&&(e[n++]=a),t=o}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,r,i=this._n,o=0;if(i>0){for(o=t[--i];i>0&&(e=o,n=t[--i],o=e+n,r=n-(o-e),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(n=2*r,e=o+n,n==e-o&&(o=e))}return o}}class _u extends Map{constructor(t,e=Eu){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(bu(this,t))}has(t){return super.has(bu(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){const r=e(n);t.has(r)&&(n=t.get(r),t.delete(r));return n}(this,t))}}function bu({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Eu(t){return null!==t&&"object"==typeof t?t.valueOf():t}function xu(t){return t}function Mu(t,...e){return Ou(t,xu,xu,e)}function Su(t,...e){return Ou(t,Array.from,xu,e)}function Au(t,e,...n){return Ou(t,xu,e,n)}function Tu(t,e,...n){return Ou(t,Array.from,e,n)}function Ou(t,e,n,r){return function t(i,o){if(o>=r.length)return n(i);const a=new _u,s=r[o++];let c=-1;for(const t of i){const e=s(t,++c,i),n=a.get(e);n?n.push(t):a.set(e,[t])}for(const[e,n]of a)a.set(e,t(n,o));return e(a)}(t,0)}function Ru(t,...e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&2!==n.length||e.length>1){const o=Uint32Array.from(t,((t,e)=>e));return e.length>1?(e=e.map((e=>t.map(e))),o.sort(((t,n)=>{for(const r of e){const e=Cu(r[t],r[n]);if(e)return e}}))):(n=t.map(n),o.sort(((t,e)=>Cu(n[t],n[e])))),r=t,i=o,Array.from(i,(t=>r[t]))}var r,i;return t.sort(Pu(n))}function Pu(t=au){if(t===au)return Cu;if("function"!=typeof t)throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||0===r?r:(0===t(n,n))-(0===t(e,e))}}function Cu(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(t<e?-1:t>e?1:0)}var wu=Array.prototype.slice;function Nu(t){return()=>t}const Iu=Math.sqrt(50),ku=Math.sqrt(10),Lu=Math.sqrt(2);function Du(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=Iu?10:o>=ku?5:o>=Lu?2:1;let s,c,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(t*l),c=Math.round(e*l),s/l<t&&++s,c/l>e&&--c,l=-l):(l=Math.pow(10,i)*a,s=Math.round(t/l),c=Math.round(e/l),s*l<t&&++s,c*l>e&&--c),c<s&&.5<=n&&n<2?Du(t,e,2*n):[s,c,l]}function Bu(t,e,n){return Du(t=+t,e=+e,n=+n)[2]}function Fu(t){return Math.max(1,Math.ceil(Math.log(gu(t))/Math.LN2)+1)}function Uu(){var t=xu,e=vu,n=Fu;function r(r){Array.isArray(r)||(r=Array.from(r));var i,o,a,s=r.length,c=new Array(s);for(i=0;i<s;++i)c[i]=t(r[i],i,r);var l=e(c),u=l[0],f=l[1],d=n(c,u,f);if(!Array.isArray(d)){const t=f,n=+d;if(e===vu&&([u,f]=function(t,e,n){let r;for(;;){const i=Bu(t,e,n);if(i===r||0===i||!isFinite(i))return[t,e];i>0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}(u,f,n)),d=function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const r=e<t,[i,o,a]=r?Du(e,t,n):Du(t,e,n);if(!(o>=i))return[];const s=o-i+1,c=new Array(s);if(r)if(a<0)for(let t=0;t<s;++t)c[t]=(o-t)/-a;else for(let t=0;t<s;++t)c[t]=(o-t)*a;else if(a<0)for(let t=0;t<s;++t)c[t]=(i+t)/-a;else for(let t=0;t<s;++t)c[t]=(i+t)*a;return c}(u,f,n),d[0]<=u&&(a=Bu(u,f,n)),d[d.length-1]>=f)if(t>=f&&e===vu){const t=Bu(u,f,n);isFinite(t)&&(t>0?f=(Math.floor(f/t)+1)*t:t<0&&(f=(Math.ceil(f*-t)+1)/-t))}else d.pop()}for(var h=d.length,p=0,g=h;d[p]<=u;)++p;for(;d[g-1]>f;)--g;(p||g<h)&&(d=d.slice(p,g),h=g-p);var m,v=new Array(h+1);for(i=0;i<=h;++i)(m=v[i]=[]).x0=i>0?d[i-1]:u,m.x1=i<h?d[i]:f;if(isFinite(a)){if(a>0)for(i=0;i<s;++i)null!=(o=c[i])&&u<=o&&o<=f&&v[Math.min(h,Math.floor((o-u)/a))].push(r[i]);else if(a<0)for(i=0;i<s;++i)if(null!=(o=c[i])&&u<=o&&o<=f){const t=Math.floor((u-o)*a);v[Math.min(h,t+(d[t]<=o))].push(r[i])}}else for(i=0;i<s;++i)null!=(o=c[i])&&u<=o&&o<=f&&v[du(d,o,0,h)].push(r[i]);return v}return r.value=function(e){return arguments.length?(t="function"==typeof e?e:Nu(e),r):t},r.domain=function(t){return arguments.length?(e="function"==typeof t?t:Nu([t[0],t[1]]),r):e},r.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Nu(Array.isArray(t)?wu.call(t):t),r):n},r}function ju(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}function Gu(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n<e||void 0===n&&e>=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n<o||void 0===n&&o>=o)&&(n=o,r=i);return r}function Wu(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function zu(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n>e||void 0===n&&e>=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);return r}function Vu(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=void 0===i?Cu:Pu(i);r>n;){if(r-n>600){const o=r-n+1,a=e-n+1,s=Math.log(o),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(o-c)/o)*(a-o/2<0?-1:1);Vu(t,e,Math.max(n,Math.floor(e-a*c/o+l)),Math.min(r,Math.floor(e+(o-a)*c/o+l)),i)}const o=t[e];let a=n,s=r;for(Hu(t,n,e),i(t[r],o)>0&&Hu(t,n,r);a<s;){for(Hu(t,a,s),++a,--s;i(t[a],o)<0;)++a;for(;i(t[s],o)>0;)--s}0===i(t[n],o)?Hu(t,n,s):(++s,Hu(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function Hu(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function Xu(t,e,n){if(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,n)),(r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return Wu(t);if(e>=1)return ju(t);var r,i=(r-1)*e,o=Math.floor(i),a=ju(Vu(t,o).subarray(0,o+1));return a+(Wu(t.subarray(o+1))-a)*(i-o)}}function Yu(t,e,n=uu){if(!isNaN(e=+e)){if(r=Float64Array.from(t,((e,r)=>uu(n(t[r],r,t)))),e<=0)return zu(r);if(e>=1)return Gu(r);var r,i=Uint32Array.from(t,((t,e)=>e)),o=r.length-1,a=Math.floor(o*e);return Vu(i,a,0,o,((t,e)=>Cu(r[t],r[e]))),a=function(t,e=au){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?au(t,i)>0:0===au(t,t))&&(n=o,i=t,r=!0)}}else for(const i of t)(r?e(i,n)>0:0===e(i,i))&&(n=i,r=!0);return n}(i.subarray(0,a+1),(t=>r[t])),a>=0?a:-1}}function $u(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function qu(t,e){return Xu(t,.5,e)}function Ku(t,e){return Yu(t,.5,e)}function Zu(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function Qu(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r<i;)o[r]=t+r*n;return o}function Ju(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function tf(t){return t}function ef(t){return t.reduce(((t,e)=>(n,...r)=>e(t(n,...r),...r)),tf)}function nf(t){return t.replace(/( |^)[a-z]/g,(t=>t.toUpperCase()))}function rf(t=""){throw new Error(t)}function of(t,e){const{attributes:n}=e,r=new Set(["id","className"]);for(const[e,i]of Object.entries(n))r.has(e)||("transform"===e?(t.attr(e,""),t.attr(e,i)):t.attr(e,i))}function af(t){return null!=t&&!Number.isNaN(t)}function sf(t){const e=new Map;return n=>{if(e.has(n))return e.get(n);const r=t(n);return e.set(n,r),r}}function cf(t,e){return lf(t,e)||{}}function lf(t,e){const n=Object.entries(t||{}).filter((([t])=>t.startsWith(e))).map((([t,n])=>[Ne(t.replace(e,"").trim()),n])).filter((([t])=>!!t));return 0===n.length?null:Object.fromEntries(n)}function uf(t,...e){return Object.fromEntries(Object.entries(t).filter((([t])=>e.every((e=>!t.startsWith(e))))))}function ff(t,e){if(void 0===t)return null;if("number"==typeof t)return t;const n=+t.replace("%","");return Number.isNaN(n)?null:n/100*e}function df(t){return!("object"!=typeof t||t instanceof Date||null===t||Array.isArray(t))}function hf(t){return null===t||!1===t}function pf(t,e,n=5,r=0){if(!(r>=n)){for(const i of Object.keys(e)){const o=e[i];_e(o)&&_e(t[i])?pf(t[i],o,n,r+1):t[i]=o}return t}}function gf(t){return new mf([t],null,t,t.ownerDocument)}class mf{constructor(t=null,e=null,n=null,r=null,i=[null,null,null,null,null],o=[],a=[]){this._elements=Array.from(t),this._data=e,this._parent=n,this._document=r,this._enter=i[0],this._update=i[1],this._exit=i[2],this._merge=i[3],this._split=i[4],this._transitions=o,this._facetElements=a}selectAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new mf(e,null,this._elements[0],this._document)}selectFacetAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new mf(this._elements,null,this._parent,this._document,void 0,void 0,e)}select(t){const e="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new mf([e],null,e,this._document)}append(t){const e="function"==typeof t?t:()=>this.createElement(t),n=[];if(null!==this._data){for(let t=0;t<this._data.length;t++){const r=this._data[t],[i,o]=Array.isArray(r)?r:[r,null],a=e(i,t);a.__data__=i,null!==o&&(a.__fromElements__=o),this._parent.appendChild(a),n.push(a)}return new mf(n,null,this._parent,this._document)}for(let t=0;t<this._elements.length;t++){const r=this._elements[t],i=e(r.__data__,t);r.appendChild(i),n.push(i)}return new mf(n,null,n[0],this._document)}maybeAppend(t,e,n){const r=this._elements[0],i=r.getElementById(t);if(i)return new mf([i],null,this._parent,this._document);const o="string"==typeof e?this.createElement(e):e();return o.id=t,n&&(o.className=n),r.appendChild(o),new mf([o],null,this._parent,this._document)}data(t,e=(t=>t),n=(()=>null)){const r=[],i=[],o=new Set(this._elements),a=[],s=new Set,c=new Map(this._elements.map(((t,n)=>[e(t.__data__,n),t]))),l=new Map(this._facetElements.map(((t,n)=>[e(t.__data__,n),t]))),u=Mu(this._elements,(t=>n(t.__data__)));for(let f=0;f<t.length;f++){const d=t[f],h=e(d,f),p=n(d,f);if(c.has(h)){const t=c.get(h);t.__data__=d,t.__facet__=!1,i.push(t),o.delete(t),c.delete(h)}else if(l.has(h)){const t=l.get(h);t.__data__=d,t.__facet__=!0,i.push(t),l.delete(h)}else if(u.has(h)){const t=u.get(h);a.push([d,t]);for(const e of t)o.delete(e);u.delete(h)}else if(c.has(p)){const t=c.get(p);t.__toData__?t.__toData__.push(d):t.__toData__=[d],s.add(t),o.delete(t)}else r.push(d)}const f=[new mf([],r,this._parent,this._document),new mf(i,null,this._parent,this._document),new mf(o,null,this._parent,this._document),new mf([],a,this._parent,this._document),new mf(s,null,this._parent,this._document)];return new mf(this._elements,null,this._parent,this._document,f)}merge(t){const e=[...this._elements,...t._elements],n=[...this._transitions,...t._transitions];return new mf(e,null,this._parent,this._document,void 0,n)}createElement(t){if(this._document)return this._document.createElement(t,{});const e=mf.registry[t];return e?new e:rf(`Unknown node type: ${t}`)}join(t=(t=>t),e=(t=>t),n=(t=>t.remove()),r=(t=>t),i=(t=>t.remove())){const o=t(this._enter),a=e(this._update),s=n(this._exit),c=r(this._merge),l=i(this._split);return a.merge(o).merge(s).merge(c).merge(l)}remove(){for(let t=0;t<this._elements.length;t++){const e=this._transitions[t];if(e){const n=Array.isArray(e)?e:[e];Promise.all(n.map((t=>t.finished))).then((()=>{this._elements[t].remove()}))}else{this._elements[t].remove()}}return new mf([],null,this._parent,this._document,void 0,this._transitions)}each(t){for(let e=0;e<this._elements.length;e++){const n=this._elements[e];t(n.__data__,e,n)}return this}attr(t,e){const n="function"!=typeof e?()=>e:e;return this.each((function(r,i,o){void 0!==e&&(o[t]=n(r,i,o))}))}style(t,e){const n="function"!=typeof e?()=>e:e;return this.each((function(r,i,o){void 0!==e&&(o.style[t]=n(r,i,o))}))}transition(t){const e="function"!=typeof t?()=>t:t,{_transitions:n}=this;return this.each((function(t,r,i){n[r]=e(t,r,i)}))}on(t,e){return this.each((function(n,r,i){i.addEventListener(t,e)})),this}call(t,...e){return t(this,...e),this}node(){return this._elements[0]}nodes(){return this._elements}transitions(){return this._transitions}parent(){return this._parent}}mf.registry={g:Ts,rect:Is,circle:Ms,path:Cs,text:ks,ellipse:As,image:Rs,line:Ps,polygon:ws,polyline:Ns,html:Os};const vf=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:()=>!0});function yf(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}var _f,bf=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ef(t){if(!(e=bf.exec(t)))throw new Error("invalid format: "+t);var e;return new xf({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function xf(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 Mf(t,e){var n=yf(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}Ef.prototype=xf.prototype,xf.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 Sf={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Mf(100*t,e),r:Mf,s:function(t,e){var n=yf(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(_f=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+yf(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Af(t){return t}var Tf,Of,Rf=Array.prototype.map,Pf=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Cf(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?Af:(e=Rf.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),o.push(t.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?Af:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Rf.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"−":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=Ef(t)).fill,n=t.align,f=t.sign,d=t.symbol,h=t.zero,p=t.width,g=t.comma,m=t.precision,v=t.trim,y=t.type;"n"===y?(g=!0,y="g"):Sf[y]||(void 0===m&&(m=12),v=!0,y="g"),(h||"0"===e&&"="===n)&&(h=!0,e="0",n="=");var _="$"===d?i:"#"===d&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",b="$"===d?o:/[%p]/.test(y)?c:"",E=Sf[y],x=/[defgprs%]/.test(y);function M(t){var i,o,c,d=_,M=b;if("c"===y)M=E(t)+M,t="";else{var S=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:E(Math.abs(t),m),v&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),S&&0==+t&&"+"!==f&&(S=!1),d=(S?"("===f?f:l:"-"===f||"("===f?"":f)+d,M=("s"===y?Pf[8+_f/3]:"")+M+(S&&"("===f?")":""),x)for(i=-1,o=t.length;++i<o;)if(48>(c=t.charCodeAt(i))||c>57){M=(46===c?a+t.slice(i+1):t.slice(i))+M,t=t.slice(0,i);break}}g&&!h&&(t=r(t,1/0));var A=d.length+t.length+M.length,T=A<p?new Array(p-A+1).join(e):"";switch(g&&h&&(t=r(T+t,T.length?p-M.length:1/0),T=""),n){case"<":t=d+t+M+T;break;case"=":t=d+T+t+M;break;case"^":t=T.slice(0,A=T.length>>1)+d+t+M+T.slice(A);break;default:t=T+d+t+M}return s(t)}return m=void 0===m?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),M.toString=function(){return t+""},M}return{format:f,formatPrefix:function(t,e){var n=f(((t=Ef(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(function(t){return(t=yf(Math.abs(t)))?t[1]:NaN}(e)/3))),i=Math.pow(10,-r),o=Pf[8+r/3];return function(t){return n(i*t)+o}}}}function wf(t,e){return Object.entries(t).reduce(((n,[r,i])=>(n[r]=e(i,r,t),n)),{})}function Nf(t){return t.map(((t,e)=>e))}function If(t){return t[0]}function kf(t){return t[t.length-1]}function Lf(t,e){const n=[[],[]];return t.forEach((t=>{n[e(t)?0:1].push(t)})),n}function Df(t,e=t.length){if(1===e)return t.map((t=>[t]));const n=[];for(let r=0;r<t.length;r++){Df(t.slice(r+1),e-1).forEach((e=>{n.push([t[r],...e])}))}return n}Tf=Cf({thousands:",",grouping:[3],currency:["$",""]}),Of=Tf.format,Tf.formatPrefix;const Bf=()=>[["cartesian"]];Bf.props={};const Ff=()=>[["cartesian3D"]];Ff.props={};const Uf=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)},jf=t=>{const{startAngle:e,endAngle:n,innerRadius:r,outerRadius:i}=Uf(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",e,n,r,i]]};jf.props={};const Gf=()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]];Gf.props={transform:!0};const Wf=t=>{const{startAngle:e,endAngle:n,innerRadius:r,outerRadius:i}=((t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)})(t);return[...Gf(),...jf({startAngle:e,endAngle:n,innerRadius:r,outerRadius:i})]};Wf.props={};const zf=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)},Vf=t=>{const{startAngle:e,endAngle:n,innerRadius:r,outerRadius:i}=zf(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...jf({startAngle:e,endAngle:n,innerRadius:r,outerRadius:i})]};Vf.props={};const Hf=()=>[["parallel",0,1,0,1]];Hf.props={};const Xf=({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]];Xf.props={transform:!0};const Yf=t=>{const{startAngle:e=-Math.PI/2,endAngle:n=3*Math.PI/2,innerRadius:r=0,outerRadius:i=1}=t;return[...Hf(),...jf({startAngle:e,endAngle:n,innerRadius:r,outerRadius:i})]};Yf.props={};const $f=[["legendCategory",[[["color","discrete"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","discrete"]],[["color","discrete"],["opacity","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"]],[["color","discrete"],["opacity","constant"],["size","constant"]],[["color","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"]],[["color","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["shape","discrete"]],[["color","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"]],[["color","discrete"],["opacity","constant"]],[["color","discrete"],["shape","constant"]],[["color","constant"],["shape","discrete"]],[["color","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"]],[["color","discrete"]]]],["legendContinuousSize",[[["color","continuous"],["opacity","continuous"],["size","continuous"]],[["color","constant"],["opacity","continuous"],["size","continuous"]],[["color","continuous"],["size","continuous"]],[["color","constant"],["size","continuous"]],[["size","continuous"],["opacity","continuous"]],[["size","continuous"]]]],["legendContinuousBlockSize",[[["color","distribution"],["opacity","distribution"],["size","distribution"]],[["color","distribution"],["size","distribution"]]]],["legendContinuousBlock",[[["color","distribution"],["opacity","continuous"]],[["color","distribution"]]]],["legendContinuous",[[["color","continuous"],["opacity","continuous"]],[["color","continuous"]],[["opacity","continuous"]]]]];var qf=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},Kf={}.toString,Zf=function(t,e){return Kf.call(t)==="[object "+e+"]"},Qf=function(t){return Zf(t,"Function")},Jf=function(t){return null==t},td=function(t){return Array.isArray?Array.isArray(t):Zf(t,"Array")};var ed=function(t){if(!function(t){return"object"==typeof t&&null!==t}(t)||!Zf(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},nd=function(t){return Zf(t,"Number")},rd=Object.values?function(t){return Object.values(t)}:function(t){var e=[];return function(t,e){if(t)if(td(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e}(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break}(t,(function(n,r){Qf(t)&&"prototype"===r||e.push(n)})),e};function id(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(e.hasOwnProperty(i)){var o=e[i];null!==o&&ed(o)?(ed(t[i])||(t[i]={}),n<r?id(t[i],o,n+1,r):t[i]=e[i]):td(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var od,ad=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)id(t,e[r]);return t},sd=function(t,e){if(!qf(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},cd=function(t){return t};function ld(t){return Jf(t)?0:qf(t)?t.length:Object.keys(t).length}function ud(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t?e.reduce((function(t,e){return function(n){return e(t(n))}}),t):cd}function fd(t){return t instanceof Float32Array||t instanceof Array}!function(t,e){if(!Qf(t))throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return a.set(o,s),s};n.cache=new Map}((function(t,e){void 0===e&&(e={});var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return od||(od=document.createElement("canvas").getContext("2d")),od.font=[o,a,i,n+"px",r].join(" "),od.measureText(function(t){return Zf(t,"String")}(t)?t:"").width}),(function(t,e){return void 0===e&&(e={}),function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}([t],rd(e)).join("")}));var dd=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},hd=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function pd(t,e,n){for(;t<e;)t+=2*Math.PI;for(;t>n;)t-=2*Math.PI;return t}var gd=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},md=function(t,e,n,r,i){var o,a,s=gd(t,2),c=s[0],l=s[1],u=v();return a=[c,l],(o=u)[0]=1,o[1]=0,o[2]=0,o[3]=0,o[4]=1,o[5]=0,o[6]=a[0],o[7]=a[1],o[8]=1,o};function vd(t,...e){return e.reduce(((t,e)=>n=>t(e(n))),t)}function yd(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}function _d(t,e,n,r,i){let o=n||0,a=r||t.length;const s=i||(t=>t);for(;o<a;){const n=Math.floor((o+a)/2);s(t[n])>e?a=n:o=n+1}return o}const bd=Math.sqrt(50),Ed=Math.sqrt(10),xd=Math.sqrt(2);function Md(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/10**i;return i>=0?(o>=bd?10:o>=Ed?5:o>=xd?2:1)*10**i:-(10**-i)/(o>=bd?10:o>=Ed?5:o>=xd?2:1)}function Sd(t,e,n){const r=Math.abs(e-t)/Math.max(0,n);let i=10**Math.floor(Math.log(r)/Math.LN10);const o=r/i;return o>=bd?i*=10:o>=Ed?i*=5:o>=xd&&(i*=2),e<t?-i:i}const Ad=(t,e,n=5)=>{const r=[t,e];let i,o=0,a=r.length-1,s=r[o],c=r[a];return c<s&&([s,c]=[c,s],[o,a]=[a,o]),i=Md(s,c,n),i>0?(s=Math.floor(s/i)*i,c=Math.ceil(c/i)*i,i=Md(s,c,n)):i<0&&(s=Math.ceil(s*i)/i,c=Math.floor(c*i)/i,i=Md(s,c,n)),i>0?(r[o]=Math.floor(s/i)*i,r[a]=Math.ceil(c/i)*i):i<0&&(r[o]=Math.ceil(s*i)/i,r[a]=Math.floor(c*i)/i),r},Td=1e3,Od=6e4,Rd=36e5,Pd=864e5,Cd=6048e5,wd=2592e6,Nd=31536e6;function Id(t,e,n,r){const i=(t,i)=>{i&&((t,e)=>{const i=t=>r(t)%e==0;let o=e;for(;o&&!i(t);)n(t,-1),o-=1})(t,i),e(t)},o=(t,e)=>{const r=new Date(+t-1);return i(r,e),n(r,e),i(r),r};return{ceil:o,floor:(t,e)=>{const n=new Date(+t);return i(n,e),n},range:(t,e,r,a)=>{const s=[],c=Math.floor(r);for(let l=a?o(t,r):o(t);+l<+e;n(l,c),i(l))s.push(new Date(+l));return s},duration:t}}const kd=Id(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),Ld=Id(Td,(t=>{t.setMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+Td*e)}),(t=>t.getSeconds())),Dd=Id(Od,(t=>{t.setSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+Od*e)}),(t=>t.getMinutes())),Bd=Id(Rd,(t=>{t.setMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+Rd*e)}),(t=>t.getHours())),Fd=Id(Pd,(t=>{t.setHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+Pd*e)}),(t=>t.getDate()-1)),Ud=Id(wd,(t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e=1)=>{const n=t.getMonth();t.setMonth(n+e)}),(t=>t.getMonth())),jd=Id(Cd,(t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+Cd*e)}),(t=>{const e=Ud.floor(t),n=new Date(+t);return Math.floor((+n-+e)/Cd)})),Gd=Id(Nd,(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e=1)=>{const n=t.getFullYear();t.setFullYear(n+e)}),(t=>t.getFullYear())),Wd={millisecond:kd,second:Ld,minute:Dd,hour:Bd,day:Fd,week:jd,month:Ud,year:Gd},zd=Id(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),Vd=Id(Td,(t=>{t.setUTCMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+Td*e)}),(t=>t.getUTCSeconds())),Hd=Id(Od,(t=>{t.setUTCSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+Od*e)}),(t=>t.getUTCMinutes())),Xd=Id(Rd,(t=>{t.setUTCMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+Rd*e)}),(t=>t.getUTCHours())),Yd=Id(Pd,(t=>{t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+Pd*e)}),(t=>t.getUTCDate()-1)),$d=Id(wd,(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{const n=t.getUTCMonth();t.setUTCMonth(n+e)}),(t=>t.getUTCMonth())),qd=Id(Cd,(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+Cd*e)}),(t=>{const e=$d.floor(t),n=new Date(+t);return Math.floor((+n-+e)/Cd)})),Kd=Id(Nd,(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{const n=t.getUTCFullYear();t.setUTCFullYear(n+e)}),(t=>t.getUTCFullYear())),Zd={millisecond:zd,second:Vd,minute:Hd,hour:Xd,day:Yd,week:qd,month:$d,year:Kd};function Qd(t,e,n,r,i){const o=+t,a=+e,{tickIntervals:s,year:c,millisecond:l}=function(t){const e=t?Zd:Wd,{year:n,month:r,week:i,day:o,hour:a,minute:s,second:c,millisecond:l}=e;return{tickIntervals:[[c,1],[c,5],[c,15],[c,30],[s,1],[s,5],[s,15],[s,30],[a,1],[a,3],[a,6],[a,12],[o,1],[o,2],[i,1],[r,1],[r,3],[n,1]],year:n,millisecond:l}}(i),u=([t,e])=>t.duration*e,f=r?(a-o)/r:n||5,d=r||(a-o)/f,h=s.length,p=_d(s,d,0,h,u);let g;if(p===h){g=[c,Sd(o/c.duration,a/c.duration,f)]}else if(p){const t=d/u(s[p-1])<u(s[p])/d,[e,n]=t?s[p-1]:s[p];g=[e,r?Math.ceil(r/e.duration):n]}else{g=[l,Math.max(Sd(o,a,f),1)]}return g}const Jd=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[c,l]=Qd(a,s,n,r,i),u=[c.floor(a,l),c.ceil(s,l)];return o?u.reverse():u};function th(t){return!function(t){return void 0===t}(t)&&!function(t){return null===t}(t)&&!Number.isNaN(t)}const eh=t=>e=>-t(-e),nh=(t,e)=>{const n=Math.log(t),r=t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:t=>Math.log(t)/n;return e?eh(r):r},rh=(t,e)=>{const n=t===Math.E?Math.exp:e=>t**e;return e?eh(n):n},ih=(t,e,n,r)=>{const i=t<0,o=nh(r,i),a=rh(r,i),s=t>e,c=s?e:t,l=s?t:e,u=[a(Math.floor(o(c))),a(Math.ceil(o(l)))];return s?u.reverse():u};function oh(t,e){return n=>{n.prototype.rescale=function(){this.initRange(),this.nice();const[t]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t))},n.prototype.initRange=function(){const{interpolator:e}=this.options;this.options.range=t(e)},n.prototype.composeOutput=function(t,n){const{domain:r,interpolator:i,round:o}=this.getOptions(),a=e(r.map(t)),s=o?(t=>e=>{const n=t(e);return nd(n)?Math.round(n):n})(i):i;this.output=vd(s,a,n,t)},n.prototype.invert=void 0}}var ah={exports:{}},sh={exports:{}},ch=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))},lh=Array.prototype.concat,uh=Array.prototype.slice,fh=sh.exports=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];ch(i)?e=lh.call(e,uh.call(i)):e.push(i)}return e};fh.wrap=function(t){return function(){return t(fh(arguments))}};var dh={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]},hh=sh.exports,ph=Object.hasOwnProperty,gh=Object.create(null);for(var mh in dh)ph.call(dh,mh)&&(gh[dh[mh]]=mh);var vh=ah.exports={to:{},get:{}};function yh(t,e,n){return Math.min(Math.max(e,t),n)}function _h(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}vh.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=vh.get.hsl(t),n="hsl";break;case"hwb":e=vh.get.hwb(t),n="hwb";break;default:e=vh.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},vh.get.rgb=function(t){if(!t)return null;var e,n,r,i=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=e[2],e=e[1],n=0;n<3;n++){var o=2*n;i[n]=parseInt(e.slice(o,o+2),16)}r&&(i[3]=parseInt(r,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(r=(e=e[1])[3],n=0;n<3;n++)i[n]=parseInt(e[n]+e[n],16);r&&(i[3]=parseInt(r+r,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)i[n]=parseInt(e[n+1],0);e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:ph.call(dh,e[1])?((i=dh[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]=yh(i[n],0,255);return i[3]=yh(i[3],0,1),i},vh.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,yh(parseFloat(e[2]),0,100),yh(parseFloat(e[3]),0,100),yh(isNaN(n)?1:n,0,1)]}return null},vh.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,yh(parseFloat(e[2]),0,100),yh(parseFloat(e[3]),0,100),yh(isNaN(n)?1:n,0,1)]}return null},vh.to.hex=function(){var t=hh(arguments);return"#"+_h(t[0])+_h(t[1])+_h(t[2])+(t[3]<1?_h(Math.round(255*t[3])):"")},vh.to.rgb=function(){var t=hh(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]+")"},vh.to.rgb.percent=function(){var t=hh(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]+")"},vh.to.hsl=function(){var t=hh(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},vh.to.hwb=function(){var t=hh(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},vh.to.keyword=function(t){return gh[t.slice(0,3)]};var bh=ah.exports;function Eh(t,e,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function xh(t){const e=bh.get(t);if(!e)return null;const{model:n,value:r}=e;return"rgb"===n?r:"hsl"===n?function(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100,i=t[3];if(0===n)return[255*r,255*r,255*r,i];const o=r<.5?r*(1+n):r+n-r*n,a=2*r-o;return[255*Eh(a,o,e+1/3),255*Eh(a,o,e),255*Eh(a,o,e-1/3),i]}(r):null}const Mh=(t,e)=>n=>t*(1-n)+e*n,Sh=(t,e)=>"number"==typeof t&&"number"==typeof e?Mh(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=xh(t),r=xh(e);return null===n||null===r?n?()=>t:()=>e:t=>{const e=new Array(4);for(let i=0;i<4;i+=1){const o=n[i],a=r[i];e[i]=o*(1-t)+a*t}const[i,o,a,s]=e;return`rgba(${Math.round(i)}, ${Math.round(o)}, ${Math.round(a)}, ${s})`}})(t,e):()=>t,Ah=(t,e)=>{const n=Mh(t,e);return t=>Math.round(n(t))};function Th({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Oh(t){return"object"==typeof t?t.valueOf():t}class Rh extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=Oh,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Th({map:this.map,initKey:this.initKey},t))}has(t){return super.has(Th({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(function({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(function({map:t,initKey:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}({map:this.map,initKey:this.initKey},t))}}class Ph{constructor(t){this.options=ad({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=ad({},this.options,t),this.rescale(t)}rescale(t){}}const Ch=Symbol("defaultUnknown");function wh(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function Nh(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:o}=t;let a=i.get(e);if(void 0===a){if(o!==Ch)return o;a=n.push(e)-1,i.set(e,a)}return r[a%r.length]}function Ih(t){return t instanceof Date?t=>`${t}`:"object"==typeof t?t=>JSON.stringify(t):t=>t}class kh extends Ph{getDefaultOptions(){return{domain:[],range:[],unknown:Ch}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&wh(this.domainIndexMap,this.getDomain(),this.domainKey),Nh({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&wh(this.rangeIndexMap,this.getRange(),this.rangeKey),Nh({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[e]=this.options.domain,[n]=this.options.range;if(this.domainKey=Ih(e),this.rangeKey=Ih(n),!this.rangeIndexMap)return this.rangeIndexMap=new Map,void(this.domainIndexMap=new Map);t&&!t.range||this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new kh(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:t,compare:e}=this.options;return this.sortedDomain=e?[...t].sort(e):t,this.sortedDomain}}function Lh(t){return Math.round(1e12*t)/1e12}function Dh(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:o,round:a,align:s}=t,c=e.length,l=function(t,e){const n=e-t.length;return n>0?[...t,...new Array(n).fill(1)]:n<0?t.slice(0,e):t}(o,c),[u,f]=n,d=f-u,h=d/(2/c*r+1-1/c*i),p=h*i/c,g=h-c*p,m=function(t){const e=Math.min(...t);return t.map((t=>t/e))}(l),v=m.reduce(((t,e)=>t+e)),y=g/v,_=new Rh(e.map(((t,e)=>{const n=m[e]*y;return[t,a?Math.floor(n):n]}))),b=new Rh(e.map(((t,e)=>{const n=m[e]*y+p;return[t,a?Math.floor(n):n]}))),E=Array.from(b.values()).reduce(((t,e)=>t+e)),x=u+(d-(E-E/c*i))*s;let M=a?Math.round(x):x;const S=new Array(c);for(let t=0;t<c;t+=1){S[t]=Lh(M);const n=e[t];M+=b.get(n)}return{valueBandWidth:_,valueStep:b,adjustedRange:S}}class Bh extends kh{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:Ch,flex:[]}}constructor(t){super(t)}clone(){return new Bh(this.options)}getStep(t){return void 0===this.valueStep?1:"number"==typeof this.valueStep?this.valueStep:void 0===t?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return void 0===this.valueBandWidth?1:"number"==typeof this.valueBandWidth?this.valueBandWidth:void 0===t?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:t,paddingInner:e}=this.options;return t>0?t:e}getPaddingOuter(){const{padding:t,paddingOuter:e}=this.options;return t>0?t:e}rescale(){super.rescale();const{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:o,valueBandWidth:a,valueStep:s}=function(t){var e;const{domain:n}=t,r=n.length;if(0===r)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(null===(e=t.flex)||void 0===e?void 0:e.length)return Dh(t);const{range:i,paddingOuter:o,paddingInner:a,round:s,align:c}=t;let l,u,f=i[0];const d=i[1]-f,h=2*o,p=r-a;l=d/Math.max(1,h+p),s&&(l=Math.floor(l)),f+=(d-l*(r-a))*c,u=l*(1-a),s&&(f=Math.round(f),u=Math.round(u));const g=new Array(r).fill(0).map(((t,e)=>f+e*l));return{valueStep:l,valueBandWidth:u,adjustedRange:g}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=s,this.valueBandWidth=a,this.adjustedRange=o}}const Fh=(t,e,n)=>{let r,i,o=t,a=e;if(o===a&&n>0)return[o];let s=Md(o,a,n);if(0===s||!Number.isFinite(s))return[];if(s>0){o=Math.ceil(o/s),a=Math.floor(a/s),i=new Array(r=Math.ceil(a-o+1));for(let t=0;t<r;t+=1)i[t]=(o+t)*s}else{s=-s,o=Math.ceil(o*s),a=Math.floor(a*s),i=new Array(r=Math.ceil(a-o+1));for(let t=0;t<r;t+=1)i[t]=(o+t)/s}return i};class Uh extends Ph{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:Fh}}map(t){const[e]=this.options.range;return void 0!==e?e:this.options.unknown}invert(t){const[e]=this.options.range;return t===e&&void 0!==e?this.options.domain:[]}getTicks(){const{tickMethod:t,domain:e,tickCount:n}=this.options,[r,i]=e;return nd(r)&&nd(i)?t(r,i,n):[]}clone(){return new Uh(this.options)}}function jh(t){return Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}const Gh=[1,5,2,2.5,4,3],Wh=100*Number.EPSILON;function zh(t,e,n,r,i,o){const a=ld(e),s=sd(e,t);let c=0;const l=function(t,e){return(t%e+e)%e}(r,o);return(l<Wh||o-l<Wh)&&r<=0&&i>=0&&(c=1),1-s/(a-1)-n+c}function Vh(t,e,n){const r=ld(e);return 1-sd(e,t)/(r-1)-n+1}function Hh(t,e,n,r,i,o){const a=(t-1)/(o-i),s=(e-1)/(Math.max(o,r)-Math.min(n,i));return 2-Math.max(a/s,s/a)}function Xh(t,e){return t>=e?2-(t-1)/(e-1):1}function Yh(t,e,n,r){return 1-.5*((e-r)**2+(t-n)**2)/(.1*(e-t))**2}function $h(t,e,n){const r=e-t;if(n>r){return 1-((n-r)/2)**2/(.1*r)**2}return 1}const qh=(t,e,n=5,r=!0,i=Gh,o=[.25,.2,.5,.05])=>{const a=n<0?0:Math.round(n);if(Number.isNaN(t)||Number.isNaN(e)||"number"!=typeof t||"number"!=typeof e||!a)return[];if(e-t<1e-15||1===a)return[t];const s={score:-2,lmin:0,lmax:0,lstep:0};let c=1;for(;c<1/0;){for(let n=0;n<i.length;n+=1){const l=i[n],u=Vh(l,i,c);if(o[0]*u+o[1]+o[2]+o[3]<s.score){c=1/0;break}let f=2;for(;f<1/0;){const n=Xh(f,a);if(o[0]*u+o[1]+o[2]*n+o[3]<s.score)break;const d=(e-t)/(f+1)/c/l;let h=Math.ceil(Math.log10(d));for(;h<1/0;){const d=c*l*10**h,p=$h(t,e,d*(f-1));if(o[0]*u+o[1]*p+o[2]*n+o[3]<s.score)break;const g=Math.floor(e/d)*c-(f-1)*c,m=Math.ceil(t/d)*c;if(g<=m){const n=m-g;for(let u=0;u<=n;u+=1){const n=(g+u)*(d/c),h=n+d*(f-1),p=d,m=zh(l,i,c,n,h,p),v=Yh(t,e,n,h),y=Hh(f,a,t,e,n,h),_=1,b=o[0]*m+o[1]*v+o[2]*y+o[3]*_;b>s.score&&(!r||n<=t&&h>=e)&&(s.lmin=n,s.lmax=h,s.lstep=p,s.score=b)}}h+=1}f+=1}}c+=1}const l=jh(s.lmax),u=jh(s.lmin),f=jh(s.lstep),d=Math.floor(function(t){return Math.round(1e12*t)/1e12}((l-u)/f))+1,h=new Array(d);h[0]=jh(u);for(let t=1;t<d;t+=1)h[t]=jh(h[t-1]+f);return h};class Kh extends Ph{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:qh}}map(t){return th(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new Kh(this.options)}getTicks(){const{domain:t,tickCount:e,tickMethod:n}=this.options,[r,i]=t;return nd(r)&&nd(i)?n(r,i,e):[]}}const Zh=(t,e,n)=>{const[r,i]=t,[o,a]=e;let s,c;return r<i?(s=yd(r,i),c=n(o,a)):(s=yd(i,r),c=n(a,o)),vd(c,s)},Qh=(t,e,n)=>{const r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=t[0]>t[r],s=a?[...t].reverse():t,c=a?[...e].reverse():e;for(let t=0;t<r;t+=1)i[t]=yd(s[t],s[t+1]),o[t]=n(c[t],c[t+1]);return e=>{const n=_d(t,e,1,r)-1,a=i[n];return vd(o[n],a)(e)}},Jh=(t,e,n,r)=>(Math.min(t.length,e.length)>2?Qh:Zh)(t,e,r?Ah:n);class tp extends Ph{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Mh,tickCount:5}}map(t){return th(t)?this.output(t):this.options.unknown}invert(t){return th(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,e,n,...r]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,e,n,...r)}getTicks(){const{tickMethod:t}=this.options,[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return Ad}rescale(){this.nice();const[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){const{clamp:e,range:n}=this.options,r=this.options.domain.map(t),i=Math.min(r.length,n.length);return e?function(t,e){const n=e<t?e:t,r=t>e?t:e;return t=>Math.min(Math.max(n,t),r)}(r[0],r[i-1]):cd}composeOutput(t,e){const{domain:n,range:r,round:i,interpolate:o}=this.options,a=Jh(n.map(t),r,o,i);this.output=vd(a,e,t)}composeInput(t,e,n){const{domain:r,range:i}=this.options,o=Jh(i,r.map(t),Mh);this.input=vd(e,n,o)}}class ep extends tp{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:Sh,tickMethod:Fh,tickCount:5}}chooseTransforms(){return[cd,cd]}clone(){return new ep(this.options)}}class np extends Bh{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:Ch,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new np(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const rp=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class ip extends tp{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:Sh,tickMethod:Fh,tickCount:5}}constructor(t){super(t)}chooseTransforms(){const{exponent:t}=this.options;if(1===t)return[cd,cd];const e=.5===t?rp:(t=>e=>e<0?-((-e)**t):e**t)(t),n=(t=>e=>e<0?-((-e)**(1/t)):e**(1/t))(t);return[e,n]}clone(){return new ip(this.options)}}class op extends ip{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Sh,tickMethod:Fh,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new op(this.options)}}class ap extends Ph{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){if(!th(t))return this.options.unknown;const e=_d(this.thresholds,t,0,this.n);return this.options.range[e]}invert(t){const{range:e}=this.options,n=e.indexOf(t),r=this.thresholds;return[r[n-1],r[n]]}clone(){return new ap(this.options)}rescale(){const{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const sp=(t,e,n,r=10)=>{const i=t<0,o=rh(r,i),a=nh(r,i),s=e<t,c=s?e:t,l=s?t:e;let u=a(c),f=a(l),d=[];if(!(r%1)&&f-u<n){if(u=Math.floor(u),f=Math.ceil(f),i)for(;u<=f;u+=1){const t=o(u);for(let e=r-1;e>=1;e-=1){const n=t*e;if(n>l)break;n>=c&&d.push(n)}}else for(;u<=f;u+=1){const t=o(u);for(let e=1;e<r;e+=1){const n=t*e;if(n>l)break;n>=c&&d.push(n)}}2*d.length<n&&(d=Fh(c,l,n))}else{const t=-1===n?f-u:Math.min(f-u,n);d=Fh(u,f,t).map(o)}return s?d.reverse():d};class cp extends tp{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:Sh,tickMethod:sp,tickCount:5}}chooseNice(){return ih}getTickMethodOptions(){const{domain:t,tickCount:e,base:n}=this.options;return[t[0],t[t.length-1],e,n]}chooseTransforms(){const{base:t,domain:e}=this.options,n=e[0]<0;return[nh(t,n),rh(t,n)]}clone(){return new cp(this.options)}}class lp extends ap{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:qh}}constructor(t){super(t)}nice(){const{nice:t}=this.options;if(t){const[t,e,n]=this.getTickMethodOptions();this.options.domain=Ad(t,e,n)}}getTicks(){const{tickMethod:t}=this.options,[e,n,r]=this.getTickMethodOptions();return t(e,n,r)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}rescale(){this.nice();const{range:t,domain:e}=this.options,[n,r]=e;this.n=t.length-1,this.thresholds=new Array(this.n);for(let t=0;t<this.n;t+=1)this.thresholds[t]=((t+1)*r-(t-this.n)*n)/(this.n+1)}invert(t){const[e,n]=super.invert(t),[r,i]=this.options.domain;return void 0===e&&void 0===n?[e,n]:[e||r,n||i]}getThresholds(){return this.thresholds}clone(){return new lp(this.options)}}function up(t,e){const n=t.length;if(!n)return;if(n<2)return t[n-1];const r=(n-1)*e,i=Math.floor(r),o=t[i];return o+(t[i+1]-o)*(r-i)}class fp extends ap{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:qh}}constructor(t){super(t)}rescale(){const{domain:t,range:e}=this.options;this.n=e.length-1,this.thresholds=function(t,e,n=!1){const r=t;n||r.sort(((t,e)=>t-e));const i=[];for(let t=1;t<e;t+=1)i.push(up(r,t/e));return i}(t,this.n+1,!1)}invert(t){const[e,n]=super.invert(t),{domain:r}=this.options,i=r[0],o=r[r.length-1];return void 0===e&&void 0===n?[e,n]:[e||i,n||o]}getThresholds(){return this.thresholds}clone(){return new fp(this.options)}getTicks(){const{tickCount:t,domain:e,tickMethod:n}=this.options,r=e.length-1;return n(e[0],e[r],t)}}var dp=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,hp=/\[([^]*?)\]/gm;function pp(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function gp(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++){var o=i[r];for(var a in o)t[a]=o[a]}return t}var mp=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],vp=["January","February","March","April","May","June","July","August","September","October","November","December"],yp=pp(vp,3),_p=gp({},{dayNamesShort:pp(mp,3),dayNames:mp,monthNamesShort:yp,monthNames:vp,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10?1:0)*t%10]}}),bp=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t},Ep={D:function(t){return String(t.getDate())},DD:function(t){return bp(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return bp(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 bp(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 bp(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return bp(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return bp(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return bp(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return bp(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return bp(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return bp(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return bp(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return t.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+bp(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+bp(Math.floor(Math.abs(e)/60),2)+":"+bp(Math.abs(e)%60,2)}},xp={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 Mp=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[c,l]=Qd(a,s,n,r,i),u=c.range(a,new Date(+s+1),l,!0);return o?u.reverse():u};function Sp(t){const e=t.getTimezoneOffset(),n=new Date(t);return n.setMinutes(n.getMinutes()+e,n.getSeconds(),n.getMilliseconds()),n}class Ap extends tp{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:Mp,interpolate:Mh,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return Jd}getTickMethodOptions(){const{domain:t,tickCount:e,tickInterval:n,utc:r}=this.options;return[t[0],t[t.length-1],e,n,r]}getFormatter(){const{mask:t,utc:e}=this.options,n=e?Zd:Wd,r=e?Sp:cd;return e=>function(t,e,n){if(void 0===e&&(e=xp.default),void 0===n&&(n={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");var r=[];e=(e=xp[e]||e).replace(hp,(function(t,e){return r.push(e),"@@@"}));var i=gp(gp({},_p),n);return(e=e.replace(dp,(function(e){return Ep[e](t,i)}))).replace(/@@@/g,(function(){return r.shift()}))}(r(e),t||function(t,e){const{second:n,minute:r,hour:i,day:o,week:a,month:s,year:c}=e;return n.floor(t)<t?".SSS":r.floor(t)<t?":ss":i.floor(t)<t?"hh:mm":o.floor(t)<t?"hh A":s.floor(t)<t?a.floor(t)<t?"MMM DD":"ddd DD":c.floor(t)<t?"MMMM":"YYYY"}(e,n))}clone(){return new Ap(this.options)}}var Tp,Op=window&&window.__decorate||function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};let Rp=Tp=class extends ep{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:cd,tickMethod:Fh,tickCount:5}}constructor(t){super(t)}clone(){return new Tp(this.options)}};Rp=Tp=Op([oh((function(t){return[t(0),t(1)]}),(t=>{const[e,n]=t;return vd(Mh(0,1),yd(e,n))}))],Rp);var Pp,Cp=window&&window.__decorate||function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};let wp=Pp=class extends ep{getDefaultOptions(){return{domain:[0,.5,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:cd,tickMethod:Fh,tickCount:5}}constructor(t){super(t)}clone(){return new Pp(this.options)}};wp=Pp=Cp([oh((function(t){return[t(0),t(.5),t(1)]}),(t=>{const[e,n,r]=t,i=vd(Mh(0,.5),yd(e,n)),o=vd(Mh(.5,1),yd(n,r));return t=>e>r?t<n?o(t):i(t):t<n?i(t):o(t)}))],wp);var Np=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Ip=function(t,e,n,r,i){var o=new ep({range:[e,e+r]}),a=new ep({range:[n,n+i]});return{transform:function(t){var e=Np(t,2),n=e[0],r=e[1];return[o.map(n),a.map(r)]},untransform:function(t){var e=Np(t,2),n=e[0],r=e[1];return[o.invert(n),a.invert(r)]}}},kp=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Lp=function(t,e,n,r,i){return(0,kp(t,1)[0])(e,n,r,i)},Dp=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Bp=function(t,e,n,r,i){return Dp(t,1)[0]},Fp=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Up=function(t,e,n,r,i){var o=Fp(t,4),a=o[0],s=o[1],c=o[2],l=o[3],u=new ep({range:[c,l]}),f=new ep({range:[a,s]}),d=i/r,h=d>1?1:d,p=d>1?1/d:1;return{transform:function(t){var e=Fp(t,2),n=e[0],r=e[1],i=f.map(n),o=u.map(r);return[.5*(o*Math.cos(i)*h)+.5,.5*(o*Math.sin(i)*p)+.5]},untransform:function(t){var e=Fp(t,2),n=e[0],r=e[1],i=2*(n-.5)/h,o=2*(r-.5)/p,c=Math.sqrt(Math.pow(i,2)+Math.pow(o,2)),l=pd(Math.atan2(o,i),a,s);return[f.invert(l),u.invert(c)]}}},jp=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Gp=function(t,e,n,r,i){return{transform:function(t){var e=jp(t,2),n=e[0];return[e[1],n]},untransform:function(t){var e=jp(t,2),n=e[0];return[e[1],n]}}},Wp=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},zp=function(t,e,n,r,i){var o,a,s=Wp(t,2),c=s[0],l=s[1],u=v();return a=[c,l],(o=u)[0]=a[0],o[1]=0,o[2]=0,o[3]=0,o[4]=a[1],o[5]=0,o[6]=0,o[7]=0,o[8]=1,o},Vp=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Hp=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},Xp=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return zp.apply(void 0,Hp([[-1,-1]],Vp(e),!1))},Yp=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return zp.apply(void 0,Hp([[-1,1]],Vp(e),!1))},$p=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return zp.apply(void 0,Hp([[1,-1]],Vp(e),!1))},qp=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Kp=function(t,e,n,r,i){var o=qp(t,1)[0];return function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}(v(),o)},Zp=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Qp=function(t,e,n,r,i){var o=Zp(t,4),a=o[0],s=o[1],c=o[2],l=(o[3]-c)/((s-0)/(2*Math.PI)+1),u=l/(2*Math.PI),f=new ep({range:[c,c+.99*l]}),d=new ep({range:[a,s]}),h=i/r,p=h>1?1:h,g=h>1?1/h:1;return{transform:function(t){var e=Zp(t,2),n=e[0],r=e[1],i=d.map(n),o=f.map(r);return[.5*(Math.cos(i)*(u*i+o)*p)+.5,.5*(Math.sin(i)*(u*i+o)*g)+.5]},untransform:function(t){var e=Zp(t,2),n=e[0],r=e[1],i=2*(n-.5)/p,o=2*(r-.5)/g,c=Math.sqrt(Math.pow(i,2)+Math.pow(o,2)),h=pd(Math.atan2(o,i)+Math.floor(c/l)*Math.PI*2,a,s),m=c-u*h;return[d.invert(h),f.invert(m)]}}},Jp=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},tg=function(t,e,n,r,i){var o=Jp(t,4),a=o[0],s=o[1],c=o[2],l=o[3],u=new ep({range:[c,l]});return{transform:function(t){for(var e=[],n=t.length,r=new np({domain:new Array(n).fill(0).map((function(t,e){return e})),range:[a,s]}),i=0;i<n;i++){var o=t[i],c=r.map(i),l=u.map(o);e.push(c,l)}return e},untransform:function(t){for(var e=[],n=0;n<t.length;n+=2){var r=t[n+1];e.push(u.invert(r))}return e}}},eg=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};function ng(t){return 1/Math.tan(t)}var rg=function(t,e,n,r,i){var o=ng(eg(t,1)[0]);return{transform:function(t){var e=eg(t,2),n=e[0],r=e[1];return[n+r*o,r]},untransform:function(t){var e=eg(t,2),n=e[0],r=e[1];return[n-r*o,r]}}},ig=function(t,e,n,r,i){var o=ng(eg(t,1)[0]);return{transform:function(t){var e=eg(t,2),n=e[0];return[n,e[1]+n*o]},untransform:function(t){var e=eg(t,2),n=e[0];return[n,e[1]-n*o]}}},og=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};function ag(t,e,n,r,i){var o=t<e,a=(o?e-r:i-e)||i-r,s=o?-1:1;return s*a*(n+1)/(n+a/((t-e)*s))+e}function sg(t,e,n,r,i){var o=t<e,a=(o?e-r:i-e)||i-r;return a/(a*(n+1)/(t-e)-n*(o?-1:1))+e}function cg(t,e,n){return n?new ep({range:[0,1],domain:[0,e]}).map(t):t}var lg=function(t,e,n,r,i){var o=og(t,3),a=o[0],s=o[1],c=o[2],l=cg(a,r,void 0!==c&&c);return{transform:function(t){var e=og(t,2),n=e[0],r=e[1];return[ag(n,l,s,0,1),r]},untransform:function(t){var e=og(t,2),n=e[0],r=e[1];return[sg(n,l,s,0,1),r]}}},ug=function(t,e,n,r,i){var o=og(t,3),a=o[0],s=o[1],c=o[2],l=cg(a,i,void 0!==c&&c);return{transform:function(t){var e=og(t,2);return[e[0],ag(e[1],l,s,0,1)]},untransform:function(t){var e=og(t,2);return[e[0],sg(e[1],l,s,0,1)]}}},fg=function(t,e,n,r,i){var o=og(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,d=cg(a,r,f),h=cg(s,i,f);return{transform:function(t){var e=og(t,2),n=e[0],r=e[1];return[ag(n,d,c,0,1),ag(r,h,l,0,1)]},untransform:function(t){var e=og(t,2),n=e[0],r=e[1];return[sg(n,d,c,0,1),sg(r,h,l,0,1)]}}},dg=function(t,e,n,r,i){var o=og(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,d=new ep({range:[0,r]}),h=new ep({range:[0,i]}),p=f?a:d.map(a),g=f?s:h.map(s);return{transform:function(t){var e=og(t,2),n=e[0],r=e[1],i=d.map(n)-p,o=h.map(r)-g,a=Math.sqrt(i*i+o*o);if(a>c)return[n,r];var s=ag(a,0,l,0,c),u=Math.atan2(o,i),f=p+s*Math.cos(u),m=g+s*Math.sin(u);return[d.invert(f),h.invert(m)]},untransform:function(t){var e=og(t,2),n=e[0],r=e[1],i=d.map(n)-p,o=h.map(r)-g,a=Math.sqrt(i*i+o*o);if(a>c)return[n,r];var s=sg(a,0,l,0,c),u=Math.atan2(o,i),f=p+s*Math.cos(u),m=g+s*Math.sin(u);return[d.invert(f),h.invert(m)]}}},hg=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},pg=function(t,e,n,r,i,o,a){var s=new ep({range:[e,e+i]}),c=new ep({range:[n,n+o]}),l=new ep({range:[r,r+a]});return{transform:function(t){var e=hg(t,3),n=e[0],r=e[1],i=e[2];return[s.map(n),c.map(r),l.map(i)]},untransform:function(t){var e=hg(t,3),n=e[0],r=e[1],i=e[2];return[s.invert(n),c.invert(r),l.invert(i)]}}},gg=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},mg=function(t,e,n,r,i,o,a){var s=gg(t,3),c=s[0],l=s[1],u=s[2];return I(_(),[c,l,u])},vg=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},yg=function(t,e,n,r,i,o,a){var s=vg(t,3),c=s[0],l=s[1],u=s[2];return k(_(),[c,l,u])},_g=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},bg=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},Eg=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},xg=function(){function t(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:Ip,translate:md,custom:Lp,matrix:Bp,polar:Up,transpose:Gp,scale:zp,"shear.x":rg,"shear.y":ig,reflect:Xp,"reflect.x":Yp,"reflect.y":$p,rotate:Kp,helix:Qp,parallel:tg,fisheye:fg,"fisheye.x":lg,"fisheye.y":ug,"fisheye.circular":dg},this.update(t)}return t.prototype.update=function(t){this.options=ad({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y;return[(2*e+t.width)/2,(2*n+t.height)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:bg(bg([],_g(n),!1),[bg([],_g(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?bg([],_g(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},o=[],a=[],s=function(t,e){return void 0===e&&(e=!0),a.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=2){var i=[e[r],e[r+1]],o=t(i);n.push.apply(n,hd([],dd(o),!1))}return n}}(t):t)};try{for(var c=Eg(r),l=c.next();!l.done;l=c.next()){var u=_g(l.value),f=u[0],d=u.slice(1),h=this.transformers[f];if(h){var p=this.options,g=p.x,m=p.y,v=p.width,y=p.height,_=h(bg([],_g(d),!1),g,m,v,y);if(fd(_))o.push(_);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(_)||cd,"parallel"!==f)}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}o.length&&s(this.createMatrixTransform(o,t));return ud.apply(void 0,bg([],_g(a),!1))},t.prototype.createMatrixTransform=function(t,e){var n=v();return e&&t.reverse(),t.forEach((function(t){return y(n,n,t)})),e&&function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=u*a-s*l,d=-u*o+s*c,h=l*o-a*c,p=n*f+r*d+i*h;p&&(p=1/p,t[0]=f*p,t[1]=(-u*r+i*l)*p,t[2]=(s*r-i*a)*p,t[3]=d*p,t[4]=(u*n-i*c)*p,t[5]=(-s*n+i*o)*p,t[6]=h*p,t[7]=(-l*n+r*c)*p,t[8]=(a*n-r*o)*p)}(n,function(t){var e=new m(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}(n)),function(t){var e=[t[0],t[1],1];return ft(e,e,n),[e[0],e[1]]}},t}(),Mg=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Sg=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},Ag=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Tg=function(){function t(t){this.options={x:0,y:0,z:0,width:300,height:150,depth:150,transformations:[]},this.transformers={cartesian3D:pg,translate3D:mg,scale3D:yg},this.update(t)}return t.prototype.update=function(t){this.options=ad({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height,t.depth]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y,r=t.z;return[(2*e+t.width)/2,(2*n+t.height)/2,(2*r+t.depth)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:Sg(Sg([],Mg(n),!1),[Sg([],Mg(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?Sg([],Mg(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},o=[],a=[],s=function(t,e){return void 0===e&&(e=!0),a.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=3){var i=[e[r],e[r+1],e[r+2]],o=t(i);n.push.apply(n,hd([],dd(o),!1))}return n}}(t):t)};try{for(var c=Ag(r),l=c.next();!l.done;l=c.next()){var u=Mg(l.value),f=u[0],d=u.slice(1),h=this.transformers[f];if(h){var p=this.options,g=p.x,m=p.y,v=p.z,y=p.width,_=p.height,b=p.depth,E=h(Sg([],Mg(d),!1),g,m,v,y,_,b);if(fd(E))o.push(E);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(E)||cd,!0)}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}o.length&&s(this.createMatrixTransform(o,t));return ud.apply(void 0,Sg([],Mg(a),!1))},t.prototype.createMatrixTransform=function(t,e){var n=_();return e&&t.reverse(),t.forEach((function(t){return $(n,n,t)})),e&&T(n,b(n)),function(t){var e=[t[0],t[1],t[2],1];return vt(e,e,n),[e[0],e[1],e[2]]}},t}();function Og(t,e){e(t),t.children&&t.children.forEach((function(t){t&&Og(t,e)}))}function Rg(t){Cg(t,!0)}function Pg(t){Cg(t,!1)}function Cg(t,e){var n=e?"visible":"hidden";Og(t,(function(t){t.attr("visibility",n)}))}var wg=function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.apply(this,f([],u(e),!1))||this;return r.addEventListener(Xa.INSERTED,(function(){Pg(r)})),r}return r(e,t),e}(Ts);function Ng(t){var e=t.appendChild(new wg({class:"offscreen"}));return Pg(e),e}var Ig=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=o(e,["style"]);return t.call(this,i({style:i({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},n)},r))||this}return r(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=Ng(this)),this._offscreen},enumerable:!1,configurable:!0}),e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e}(ks);function kg(t){return t*Math.PI/180}function Lg(t){return Number((180*t/Math.PI).toPrecision(5))}var Dg=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=e,this.width=n,this.height=r}return Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t.prototype.toJSON=function(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.top,right:this.right,bottom:this.bottom,left:this.left}},t}();function Bg(t,e){return de(t)?t.apply(void 0,f([],u(e),!1)):t}var Fg,Ug=function(t,e){var n=function(t){return"".concat(e,"-").concat(t)},r=Object.fromEntries(Object.entries(t).map((function(t){var e=u(t,2),r=e[0],i=e[1],o=n(i);return[r,{name:o,class:".".concat(o),id:"#".concat(o),toString:function(){return o}}]})));return Object.assign(r,{prefix:n}),r},jg=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=5),Object.entries(e).forEach((function(i){var o=u(i,2),a=o[0],s=o[1],c=t;Object.prototype.hasOwnProperty.call(e,a)&&(s?_e(s)?(_e(t[a])||(c[a]={}),n<r?jg(t[a],s,n+1,r):c[a]=e[a]):me(s)?(c[a]=[],c[a]=c[a].concat(s)):c[a]=s:c[a]=s)}))},Gg=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)jg(t,e[r]);return t},Wg=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},zg=Ue((function(t,e){var n=Me(t)?t:t.style.text.toString(),r=e||Vg(t),i=r.fontSize,o=r.fontFamily,a=r.fontWeight,s=r.fontStyle,c=r.fontVariant;return Fg||(Fg=document.createElement("canvas").getContext("2d")),Fg.font=[s,c,a,"".concat(i,"px"),o].join(" "),Fg.measureText(n).width}),(function(t,e){return[Me(t)?t:t.style.text.toString(),Object.values(e||Vg(t)).join()].join("")})),Vg=function(t){var e=t.style.fontFamily||"sans-serif",n=t.style.fontWeight||"normal",r=t.style.fontStyle||"normal",i=t.style.fontVariant,o=t.style.fontSize;return{fontSize:o="object"==typeof o?o.value:o,fontFamily:e,fontWeight:n,fontStyle:r,fontVariant:i}};function Hg(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function Xg(t,e){var n=Hg(t);n&&n.attr(e)}function Yg(t,e,n){void 0===n&&(n="..."),Xg(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n})}function $g(t){var e=t.canvas,n=t.touches,r=t.offsetX,i=t.offsetY;if(e)return[e.x,e.y];if(n){var o=n[0];return[o.clientX,o.clientY]}return r&&i?[r,i]:[0,0]}function qg(t){return"function"==typeof t?t():Me(t)||Ae(t)?new Ig({style:{text:String(t)}}):t}function Kg(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 Zg(t,e,n,r,i){return void 0===r&&(r=!0),!!(r&&t===e||i&&t===n)||t>e&&t<n}var Qg=function(t,e){return function(n){return t*(1-n)+e*n}};function Jg(t,e){return"number"==typeof t&&"number"==typeof e?Qg(t,e):Array.isArray(t)&&Array.isArray(e)?function(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0;return function(i){var o=new Array(r),a=new Array(n),s=0;for(s=0;s<r;++s)o[s]=Jg(t[s],e[s]);for(;s<n;++s)a[s]=e[s];for(s=0;s<r;++s)a[s]=o[s](i);return a}}(t,e):"object"==typeof t&&"object"==typeof e?function(t,e){void 0===t&&(t={}),void 0===e&&(e={});var n={},r={};return Object.entries(e).forEach((function(e){var i=u(e,2),o=i[0],a=i[1];o in t?n[o]=Jg(t[o],a):r[o]=a})),function(t){return Object.entries(n).forEach((function(e){var n=u(e,2),i=n[0],o=n[1];return r[i]=o(t)})),r}}(t,e):function(e){return t}}function tm(t){for(var e=1/0,n=1/0,r=-1/0,i=-1/0,o=0;o<t.length;o++){var a=t[o],s=a.x,c=a.y,l=u([s+a.width,c+a.height],2),f=l[0],d=l[1];s<e&&(e=s),c<n&&(n=c),f>r&&(r=f),d>i&&(i=d)}return new Dg(e,n,r-e,i-n)}var em=function(t,e,n){var r=t.width,i=t.height,o=n.flexDirection,a=void 0===o?"row":o;n.flexWrap;var s=n.justifyContent,c=void 0===s?"flex-start":s;n.alignContent;var l=n.alignItems,f=void 0===l?"flex-start":l,d="row"===a,h="row"===a||"column"===a,p=d?h?[1,0]:[-1,0]:h?[0,1]:[0,-1],g=u([0,0],2),m=g[0],v=g[1],y=e.map((function(t){var e,n=t.width,r=t.height,i=u([m,v],2),o=i[0],a=i[1];return e=u([m+n*p[0],v+r*p[1]],2),m=e[0],v=e[1],new Dg(o,a,n,r)})),_=tm(y),b={"flex-start":0,"flex-end":d?r-_.width:i-_.height,center:d?(r-_.width)/2:(i-_.height)/2},E=y.map((function(t){var e=t.x,n=t.y,r=Dg.fromRect(t);return r.x=d?e+b[c]:e,r.y=d?n:n+b[c],r}));tm(E);var x=function(t){var e=u(d?["height",i]:["width",r],2),n=e[0],o=e[1];switch(f){case"flex-start":default:return 0;case"flex-end":return o-t[n];case"center":return o/2-t[n]/2}},M=E.map((function(t){var e=t.x,n=t.y,r=Dg.fromRect(t);return r.x=d?e:e+x(r),r.y=d?n+x(r):n,r})),S=M.map((function(e){var n,r,i=Dg.fromRect(e);return i.x+=null!==(n=t.x)&&void 0!==n?n:0,i.y+=null!==(r=t.y)&&void 0!==r?r:0,i}));return S},nm=function(t,e,n){return[]};function rm(t,e){return[t[0]*e,t[1]*e]}function im(t,e){return[t[0]+e[0],t[1]+e[1]]}function om(t,e){return[t[0]-e[0],t[1]-e[1]]}function am(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function sm(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function cm(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function lm(t){if(0===t[0]&&0===t[1])return[0,0];var e=Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2));return[t[0]/e,t[1]/e]}function um(t,e){return+t.toPrecision(e)}function fm(t,e){var n={},r=Array.isArray(e)?e:[e];for(var i in t)r.includes(i)||(n[i]=t[i]);return n}function dm(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=[[0,0],[1,1]]);for(var r=!!e,i=[],o=0,a=t.length;o<a;o+=2)i.push([t[o],t[o+1]]);var s,c,l,f=function(t,e,n,r){var i,o,a,s,c,l,f=[],d=!!r,h=[1/0,1/0],p=[-1/0,-1/0];if(d){h=(i=u(r,2))[0],p=i[1];for(var g=0,m=t.length;g<m;g+=1)h=am(h,y=t[g]),p=sm(p,y)}g=0;for(var v=t.length;g<v;g+=1){var y=t[g];if(0!==g||n)if(g!==v-1||n){o=t[[g?g-1:v-1,g-1][n?0:1]];var _=[0,0];_=rm(_=om(a=t[n?(g+1)%v:g+1],o),e);var b=cm(y,o),E=cm(y,a),x=b+E;0!==x&&(b/=x,E/=x);var M=rm(_,-b),S=rm(_,E);c=im(y,M),s=am(s=im(y,S),sm(a,y)),s=sm(s,am(a,y)),c=am(c=im(y,M=rm(M=om(s,y),-b/E)),sm(o,y)),s=im(y,S=rm(S=om(y,c=sm(c,am(o,y))),E/b)),d&&(c=am(c=sm(c,h),p),s=am(s=sm(s,h),p)),f.push(l),f.push(c),l=s}else c=y,f.push(l),f.push(c);else l=y}return n&&f.push(f.shift()),f}(i,.4,r,n),d=i.length,h=[];for(o=0;o<d-1;o+=1)s=f[2*o],c=f[2*o+1],l=i[o+1],h.push(["C",s[0],s[1],c[0],c[1],l[0],l[1]]);return r&&(s=f[d],c=f[d+1],l=u(i,1)[0],h.push(["C",s[0],s[1],c[0],c[1],l[0],l[1]])),h}var hm=["$el","anchor","cx","cy","d","defX","defY","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","billboardRotation","isSizeAttenuation","isClosed","isOverflowing","leading","letterSpacing","lineDash","lineHeight","lineWidth","markerEnd","markerEndOffset","markerMid","markerStart","markerStartOffset","maxLines","metrics","miterLimit","offsetX","offsetY","opacity","path","points","r","radius","rx","ry","shadowColor","src","stroke","strokeOpacity","text","textAlign","textBaseline","textDecorationColor","textDecorationLine","textDecorationStyle","textOverflow","textPath","textPathSide","textPathStartOffset","transform","transformOrigin","visibility","width","wordWrap","wordWrapWidth","x","x1","x2","y","y1","y2","z1","z2","zIndex"];function pm(t){return hm.includes(t)}function gm(t){var e={};for(var n in t)pm(n)&&(e[n]=t[n]);return e}function mm(t,e,n){void 0===n&&(n=!1);var r=t.getBBox(),i=r.width,o=r.height,a=e/Math.max(i,o);return n&&t.scale(a),a}var vm=function(){function t(t,n,r,i,o,a,s){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===i&&(i=null),void 0===o&&(o=[null,null,null,null,null]),void 0===a&&(a=[]),void 0===s&&(s=[]),e.add(this),this._elements=Array.from(t),this._data=n,this._parent=r,this._document=i,this._enter=o[0],this._update=o[1],this._exit=o[2],this._merge=o[3],this._split=o[4],this._transitions=a,this._facetElements=s}var e,n;return t.prototype.selectAll=function(e){return new t("string"==typeof e?this._parent.querySelectorAll(e):e,null,this._elements[0],this._document)},t.prototype.selectFacetAll=function(e){var n="string"==typeof e?this._parent.querySelectorAll(e):e;return new t(this._elements,null,this._parent,this._document,void 0,void 0,n)},t.prototype.select=function(e){var n="string"==typeof e?this._parent.querySelectorAll(e)[0]||null:e;return new t([n],null,n,this._document)},t.prototype.append=function(e){var n=this,r="function"==typeof e?e:function(){return n.createElement(e)},i=[];if(null!==this._data){for(var o=0;o<this._data.length;o++){var a=this._data[o],s=u(Array.isArray(a)?a:[a,null],2),c=s[0],l=s[1];(d=r(c,o)).__data__=c,null!==l&&(d.__fromElements__=l),this._parent.appendChild(d),i.push(d)}return new t(i,null,this._parent,this._document)}for(o=0;o<this._elements.length;o++){var f=this._elements[o],d=r(c=f.__data__,o);f.appendChild(d),i.push(d)}return new t(i,null,i[0],this._document)},t.prototype.maybeAppend=function(t,r){var i=d(this,e,"m",n).call(this,"#"===t[0]?t:"#".concat(t),r);return i.attr("id",t),i},t.prototype.maybeAppendByClassName=function(t,r){var i=t.toString(),o=d(this,e,"m",n).call(this,"."===i[0]?i:".".concat(i),r);return o.attr("className",i),o},t.prototype.maybeAppendByName=function(t,r){var i=d(this,e,"m",n).call(this,'[name="'.concat(t,'"]'),r);return i.attr("name",t),i},t.prototype.data=function(e,n,r){var i,o;void 0===n&&(n=function(t){return t}),void 0===r&&(r=function(){return null});for(var a=[],s=[],c=new Set(this._elements),u=[],f=new Set,d=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]}))),p=Mu(this._elements,(function(t){return r(t.__data__)})),g=0;g<e.length;g++){var m=e[g],v=n(m,g),y=r(m,g);if(d.has(v))(x=d.get(v)).__data__=m,x.__facet__=!1,s.push(x),c.delete(x),d.delete(v);else if(h.has(v)){(x=h.get(v)).__data__=m,x.__facet__=!0,s.push(x),h.delete(v)}else if(p.has(v)){var _=p.get(v);u.push([m,_]);try{for(var b=(i=void 0,l(_)),E=b.next();!E.done;E=b.next()){var x=E.value;c.delete(x)}}catch(t){i={error:t}}finally{try{E&&!E.done&&(o=b.return)&&o.call(b)}finally{if(i)throw i.error}}p.delete(v)}else if(d.has(y)){(x=d.get(y)).__toData__?x.__toData__.push(m):x.__toData__=[m],f.add(x),c.delete(x)}else a.push(m)}var M=[new t([],a,this._parent,this._document),new t(s,null,this._parent,this._document),new t(c,null,this._parent,this._document),new t([],u,this._parent,this._document),new t(f,null,this._parent,this._document)];return new t(this._elements,null,this._parent,this._document,M)},t.prototype.merge=function(e){var n=f(f([],u(this._elements),!1),u(e._elements),!1),r=f(f([],u(this._transitions),!1),u(e._transitions),!1);return new t(n,null,this._parent,this._document,void 0,r)},t.prototype.createElement=function(e){if(this._document)return this._document.createElement(e,{});var n=t.registry[e];return n?new n:function(t){throw new Error(t)}("Unknown node type: ".concat(e))},t.prototype.join=function(t,e,n,r,i){void 0===t&&(t=function(t){return t}),void 0===e&&(e=function(t){return t}),void 0===n&&(n=function(t){return t.remove()}),void 0===r&&(r=function(t){return t}),void 0===i&&(i=function(t){return t.remove()});var o=t(this._enter),a=e(this._update),s=n(this._exit),c=r(this._merge),l=i(this._split);return a.merge(o).merge(s).merge(c).merge(l)},t.prototype.remove=function(){for(var e=function(t){var e=n._elements[t],r=n._transitions[t];r?r.then((function(){return e.remove()})):e.remove()},n=this,r=0;r<this._elements.length;r++)e(r);return new t([],null,this._parent,this._document,void 0,this._transitions)},t.prototype.each=function(t){for(var e=0;e<this._elements.length;e++){var n=this._elements[e],r=n.__data__;t.call(n,r,e)}return this},t.prototype.attr=function(t,e){var n="function"!=typeof e?function(){return e}:e;return this.each((function(r,i){void 0!==e&&(this[t]=n.call(this,r,i))}))},t.prototype.style=function(t,e,n){void 0===n&&(n=!0);var r="function"==typeof e&&n?e:function(){return e};return this.each((function(n,i){void 0!==e&&(this.style[t]=r.call(this,n,i))}))},t.prototype.styles=function(t,e){return void 0===t&&(t={}),void 0===e&&(e=!0),this.each((function(n,r){var i=this;Object.entries(t).forEach((function(t){var o=u(t,2),a=o[0],s=o[1],c="function"==typeof s&&e?s:function(){return s};void 0!==s&&i.attr(a,c.call(i,n,r))}))}))},t.prototype.update=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each((function(e,r){t&&this.update&&this.update(n.call(this,e,r))}))},t.prototype.maybeUpdate=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each((function(e,r){t&&this.update&&this.update(n.call(this,e,r))}))},t.prototype.transition=function(t){var e=this._transitions;return this.each((function(n,r){e[r]=t.call(this,n,r)}))},t.prototype.on=function(t,e){return this.each((function(){this.addEventListener(t,e)})),this},t.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.call.apply(t,f([this._parent,this],u(e),!1)),this},t.prototype.node=function(){return this._elements[0]},t.prototype.nodes=function(){return this._elements},t.prototype.transitions=function(){return this._transitions.filter((function(t){return!!t}))},t.prototype.parent=function(){return this._parent},e=new WeakSet,n=function(e,n){var r=this._elements[0],i=r.querySelector(e);if(i)return new t([i],null,this._parent,this._document);var o="string"==typeof n?this.createElement(n):n();return r.appendChild(o),new t([o],null,this._parent,this._document)},t.registry={g:Ts,rect:Is,circle:Ms,path:Cs,text:Ig,ellipse:As,image:Rs,line:Ps,polygon:ws,polyline:Ns,html:Os},t}();function ym(t){return new vm([t],null,t,t.ownerDocument)}function _m(t,e,n){return t.querySelector(e)?ym(t).select(e):ym(t).append(n)}function bm(t){if(Ae(t))return[t,t,t,t];if(me(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 Em(t){var e=t.getLocalBounds(),n=u([e.min,e.max],2),r=u(n[0],2),i=r[0],o=r[1],a=u(n[1],2),s=a[0],c=a[1];return{x:i,y:o,width:s-i,height:c-o,left:i,bottom:c,top:o,right:s}}function xm(t,e){var n=u(t,2),r=n[0],i=n[1],o=u(e,2),a=o[0],s=o[1];return r!==a&&i===s}function Mm(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function Sm(t,e,n){var r;void 0===n&&(n=!0);var i=e||(null===(r=t.match(/^([a-z][a-z0-9]+)/))||void 0===r?void 0:r[0])||"",o=t.replace(new RegExp("^(".concat(i,")")),"");return n?function(t){return t.toString().charAt(0).toLowerCase()+t.toString().slice(1)}(o):o}var Am=function(t,e){if(!(null==t?void 0:t.startsWith(e)))return!1;var n=t[e.length];return n>="A"&&n<="Z"};function Tm(t,e,n){void 0===n&&(n=!1);var r={};return Object.entries(t).forEach((function(t){var i=u(t,2),o=i[0],a=i[1];if("className"===o||"class"===o);else if(Am(o,"show")&&Am(Sm(o,"show"),e)!==n)o===function(t,e){return"".concat(e).concat(Mm(t))}(e,"show")?r[o]=a:r[o.replace(new RegExp(Mm(e)),"")]=a;else if(!Am(o,"show")&&Am(o,e)!==n){var s=Sm(o,e);"filter"===s&&"function"==typeof a||(r[s]=a)}})),r}function Om(t,e){return Object.entries(t).reduce((function(t,n){var r=u(n,2),i=r[0],o=r[1];return i.startsWith("show")?t["show".concat(e).concat(i.slice(4))]=o:t["".concat(e).concat(Mm(i))]=o,t}),{})}function Rm(t,e){void 0===e&&(e=["x","y","class","className"]);var n=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],r={},i={};return Object.entries(t).forEach((function(t){var o=u(t,2),a=o[0],s=o[1];e.includes(a)||(-1!==n.indexOf(a)?i[a]=s:r[a]=s)})),[r,i]}function Pm(t,e){if(e)try{var n=e.replace(/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,(function(e,n,r){return"translate(".concat(function(t,e,n){var r=t.getBBox(),i=r.width,o=r.height,a=u([e,n].map((function(t,e){var n;return t.includes("%")?parseFloat((null===(n=t.match(/[+-]?([0-9]*[.])?[0-9]+/))||void 0===n?void 0:n[0])||"0")/100*(0===e?i:o):t})),2);return[a[0],a[1]]}(t,n,r),")")}));t.attr("transform",n)}catch(t){}}function Cm(){Cg(this,"hidden"!==this.attributes.visibility)}var wm=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,Gg({},{style:n},e))||this;return r.initialized=!1,r._defaultOptions=n,r}return r(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=Ng(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),e.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e.prototype.attributeChangedCallback=function(t){"visibility"===t&&Cm.call(this)},e.prototype.update=function(t,e){var n;return void 0===t&&(t={}),this.attr(Gg({},this.attributes,t)),null===(n=this.render)||void 0===n?void 0:n.call(this,this.attributes,this,e)},e.prototype.clear=function(){this.removeChildren()},e.prototype.bindEvents=function(t,e){},e}(Ss),Nm=function(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]]},Im=Nm,km=function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},Lm=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},Dm=Lm;var Bm=function(t,e,n){return[["M",t-n,e-n],["L",t+n,e],["L",t-n,e+n],["Z"]]};function Fm(t){var e=function(t){var e="default";if(ve(t)&&t instanceof Image)e="image";else if(de(t))e="symbol";else if(Me(t)){var n=new RegExp("data:(image|text)");e=t.match(n)?"base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(t)?"url":"symbol"}return e}(t);return["base64","url","image"].includes(e)?"image":t&&"symbol"===e?"path":null}var Um=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.render=function(t,n){var r=t.symbol,a=t.size,s=void 0===a?16:a,c=o(t,["symbol","size"]),l=Fm(r);Kg(!!l,ym(n),(function(t){t.maybeAppendByClassName("marker",l).attr("className","marker ".concat(l,"-marker")).call((function(t){if("image"===l){var n=2*s;t.styles({img:r,width:n,height:n,x:-s,y:-s})}else{n=s/2;var o=de(r)?r:e.getSymbol(r);t.styles(i({path:null==o?void 0:o(0,0,n)},c))}}))}))},e.MARKER_SYMBOL_MAP=new Map,e.registerSymbol=function(t,n){e.MARKER_SYMBOL_MAP.set(t,n)},e.getSymbol=function(t){return e.MARKER_SYMBOL_MAP.get(t)},e}(wm);Um.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]]})),Um.registerSymbol("hyphen",(function(t,e,n){return[["M",t-n,e],["L",t+n,e]]})),Um.registerSymbol("line",km),Um.registerSymbol("plus",(function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]})),Um.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]]})),Um.registerSymbol("circle",Nm),Um.registerSymbol("point",Im),Um.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"]]})),Um.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"]]})),Um.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"]]})),Um.registerSymbol("diamond",(function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]})),Um.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"]]})),Um.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"]]})),Um.registerSymbol("line",km),Um.registerSymbol("dot",Lm),Um.registerSymbol("dash",Dm),Um.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]]})),Um.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]]})),Um.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]]})),Um.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]]})),Um.registerSymbol("vhv",(function(t,e){return[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]]}));var jm=function(t){function e(e){var n=this,r=e.style,a=o(e,["style"]);return(n=t.call(this,We({},{type:"column"},i({style:r},a)))||this).columnsGroup=new Ts({name:"columns"}),n.appendChild(n.columnsGroup),n.render(),n}return r(e,t),e.prototype.render=function(){var t=this.attributes.columns;ym(this.columnsGroup).selectAll(".column").data(t.flat()).join((function(t){return t.append("rect").attr("className","column").each((function(t){this.attr(t)}))}),(function(t){return t.each((function(t){this.attr(t)}))}),(function(t){return t.remove()}))},e.prototype.update=function(t){this.attr(Gg({},this.attributes,t)),this.render()},e.prototype.clear=function(){this.removeChildren()},e}(Es),Gm=function(t){function e(e){var n=this,r=e.style,a=o(e,["style"]);return(n=t.call(this,We({},{type:"lines"},i({style:r},a)))||this).linesGroup=n.appendChild(new Ts),n.areasGroup=n.appendChild(new Ts),n.render(),n}return r(e,t),e.prototype.render=function(){var t=this.attributes,e=t.lines,n=t.areas;e&&this.renderLines(e),n&&this.renderAreas(n)},e.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},e.prototype.update=function(t){this.attr(Gg({},this.attributes,t)),this.render()},e.prototype.renderLines=function(t){ym(this.linesGroup).selectAll(".line").data(t).join((function(t){return t.append("path").attr("className","line").each((function(t){this.attr(t)}))}),(function(t){return t.each((function(t){this.attr(t)}))}),(function(t){return t.remove()}))},e.prototype.renderAreas=function(t){ym(this.linesGroup).selectAll(".area").data(t).join((function(t){return t.append("path").attr("className","area").each((function(t){this.attr(t)}))}),(function(t){return t.each((function(t){this.style(t)}))}),(function(t){return t.remove()}))},e}(Es);function Wm(t,e){void 0===e&&(e=!1);var n=e?t.length-1:0,r=t.map((function(t,e){return f([e===n?"M":"L"],u(t),!1)}));return e?r.reverse():r}function zm(t,e){if(void 0===e&&(e=!1),t.length<=2)return Wm(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var o=e?t[r-i-1]:t[i];Ve(o,n.slice(-2))||n.push.apply(n,f([],u(o),!1))}var a=dm(n,!1);return e?a.unshift(f(["M"],u(t[r-1]),!1)):a.unshift(f(["M"],u(t[0]),!1)),a}function Vm(t,e,n){var r=Be(t);return r.push(["L",e,n],["L",0,n],["Z"]),r}function Hm(t){return 0===t.length?[0,0]:[Ee(Pe(t,(function(t){return Ee(t)||0}))),be(Re(t,(function(t){return be(t)||0})))]}function Xm(t){for(var e=Be(t),n=e[0].length,r=u([Array(n).fill(0),Array(n).fill(0)],2),i=r[0],o=r[1],a=0;a<e.length;a+=1)for(var s=e[a],c=0;c<n;c+=1)s[c]>=0?(s[c]+=i[c],i[c]=s[c]):(s[c]+=o[c],o[c]=s[c]);return e}var Ym=function(t){function e(e){return t.call(this,e,{type:"line",width:200,height:20,isStack:!1,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff"})||this}return r(e,t),Object.defineProperty(e.prototype,"rawData",{get:function(){var t=this.attributes.data;if(!t||0===(null==t?void 0:t.length))return[[]];var e=Be(t);return Ae(e[0])?[e]:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?Xm(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseline",{get:function(){var t=this.scales.y,e=u(t.getOptions().domain||[0,0],2),n=e[0],r=e[1];return r<0?t.map(r):t.map(n<0?0:n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"containerShape",{get:function(){var t=this.attributes;return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linesStyle",{get:function(){var t=this,e=this.attributes,n=e.type,r=e.isStack,o=e.smooth;if("line"!==n)throw new Error("linesStyle can only be used in line type");var a=Tm(this.attributes,"area"),s=Tm(this.attributes,"line"),c=this.containerShape.width,l=this.data;if(0===l[0].length)return{lines:[],areas:[]};var d=this.scales,h=function(t,e){var n,r=e.x,i=e.y,o=u(i.getOptions().range||[0,0],2),a=o[0],s=o[1];return s>a&&(n=u([a,s],2),s=n[0],a=n[1]),t.map((function(t){return t.map((function(t,e){return[r.map(e),Se(i.map(t),s,a)]}))}))}(l,{type:"line",x:d.x,y:d.y}),p=[];if(a){var g=this.baseline;p=r?o?function(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var o=t[i],a=zm(o),s=void 0;if(0===i)s=Vm(a,e,n);else{var c=zm(t[i-1],!0),l=o[0];c[0][0]="L",s=f(f(f([],u(a),!1),u(c),!1),[f(["M"],u(l),!1),["Z"]],!1)}r.push(s)}return r}(h,c,g):function(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var o=Wm(t[i]),a=void 0;if(0===i)a=Vm(o,e,n);else{var s=Wm(t[i-1],!0);s[0][0]="L",a=f(f(f([],u(o),!1),u(s),!1),[["Z"]],!1)}r.push(a)}return r}(h,c,g):function(t,e,n,r){return t.map((function(t){return Vm(e?zm(t):Wm(t),n,r)}))}(h,o,c,g)}return{lines:h.map((function(e,n){return i({stroke:t.getColor(n),path:o?zm(e):Wm(e)},s)})),areas:p.map((function(e,n){return i({path:e,fill:t.getColor(n)},a)}))}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columnsStyle",{get:function(){var t=this,e=Tm(this.attributes,"column"),n=this.attributes,r=n.isStack;if("column"!==n.type)throw new Error("columnsStyle can only be used in column type");var o=this.containerShape.height,a=this.rawData;if(!a)return{columns:[]};r&&(a=Xm(a));var s=this.createScales(a),c=s.x,l=s.y,f=u(Hm(a),2),d=f[0],h=f[1],p=new ep({domain:[0,h-(d>0?0:d)],range:[0,o]}),g=c.getBandWidth(),m=this.rawData;return{columns:a.map((function(n,o){return n.map((function(n,s){var u=g/a.length;return i(i({fill:t.getColor(o)},e),r?{x:c.map(s),y:l.map(n),width:g,height:p.map(m[o][s])}:{x:c.map(s)+u*o,y:n>=0?l.map(n):l.map(0),width:u,height:p.map(Math.abs(n))})}))}))}},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){this.container=_m(e,".container","rect").attr("className","container").node();var n=t.type,r="spark".concat(n),i="line"===n?this.linesStyle:this.columnsStyle;this.spark=_m(e,".".concat(r),(function(){return"line"===n?new Gm({className:r,style:i}):new jm({className:r,style:i})})).styles(i).node()},e.prototype.getColor=function(t){var e=this.attributes.color;return me(e)?e[t%e.length]:de(e)?e.call(null,t):e},e.prototype.createScales=function(t){var e,n,r=this.attributes,i=r.type,o=r.range,a=void 0===o?[]:o,s=r.isGroup,c=r.spacing,l=this.containerShape,f=l.width,d=l.height,h=u(Hm(t),2),p=h[0],g=h[1],m=new ep({domain:[null!==(e=a[0])&&void 0!==e?e:p,null!==(n=a[1])&&void 0!==n?n:g],range:[d,0]});return"line"===i?{type:i,x:new ep({domain:[0,t[0].length-1],range:[0,f]}),y:m}:{type:i,x:new Bh({domain:t[0].map((function(t,e){return e})),range:[0,f],paddingInner:s?c:0}),y:m}},e.tag="sparkline",e}(wm);function $m(t){if(!t)return{enter:!1,update:!1,exit:!1};var e=["enter","update","exit"],n=Object.fromEntries(Object.entries(t).filter((function(t){var n=u(t,1)[0];return!e.includes(n)})));return Object.fromEntries(e.map((function(e){return function(t){return"boolean"!=typeof t&&"enter"in t&&"update"in t&&"exit"in t}(t)?!1===t[e]?[e,!1]:[e,i(i({},t[e]),n)]:[e,n]})))}function qm(t,e){t?t.finished.then(e):e()}function Km(t,e){"update"in t?t.update(e):t.attr(e)}function Zm(t,e,n){return 0===e.length?null:n?t.animate(e,n):(Km(t,{style:e.slice(-1)[0]}),null)}function Qm(t,e,n){var r={},o={};return Object.entries(e).forEach((function(e){var n=u(e,2),i=n[0],a=n[1];if(!he(a)){var s=t.style[i]||t.parsedStyle[i]||0;s!==a&&(r[i]=s,o[i]=a)}})),n?Zm(t,[r,o],i({fill:"both"},n)):(Km(t,o),null)}function Jm(t,e){return t.style.opacity||(t.style.opacity=1),Qm(t,{opacity:0},e)}var tv={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},ev={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},nv={orientation:"horizontal",showLabel:!0,type:"start"},rv=Ug({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track"},"slider"),iv=Ug({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),ov=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.render=function(t,e){var n=t.size,r=void 0===n?10:n,a=t.radius,s=void 0===a?r/4:a,c=t.orientation,l=o(t,["size","radius","orientation"]),u=r,f=2.4*u,d=ym(e).maybeAppendByClassName(iv.iconRect,"rect").styles(i(i({},l),{width:u,height:f,radius:s,x:-u/2,y:-f/2})),h=1/3*u,p=2/3*u,g=1/4*f,m=3/4*f;d.maybeAppendByClassName("".concat(iv.iconLine,"-1"),"line").styles(i({x1:h,x2:h,y1:g,y2:m},l)),d.maybeAppendByClassName("".concat(iv.iconLine,"-2"),"line").styles(i({x1:p,x2:p,y1:g,y2:m},l)),d.node().setOrigin(u/2,f/2),"vertical"===c?e.setLocalEulerAngles(90):e.setLocalEulerAngles(0)},e}(wm),av=function(t){function e(e){return t.call(this,e,nv)||this}return r(e,t),e.prototype.renderLabel=function(t){var e=this,n=this.attributes.showLabel,r=Tm(this.attributes,"label"),a=r.transform,s=u(Rm(o(r,["transform"]),[]),2),c=s[0],l=s[1],f=ym(t).maybeAppendByClassName(iv.labelGroup,"g").styles(l),d=i(i({},ev),c),h=d.text,p=o(d,["text"]);Kg(!!n,f,(function(t){e.label=t.maybeAppendByClassName(iv.label,"text").styles(i(i({},p),{transform:a,text:"".concat(h)})),e.label.on("mousedown",(function(t){t.stopPropagation()})),e.label.on("touchstart",(function(t){t.stopPropagation()}))}))},e.prototype.renderIcon=function(t){var e=this.attributes.orientation,n=i(i({orientation:e},tv),Tm(this.attributes,"icon")),r=this.attributes.iconShape,o=void 0===r?function(){return new ov({style:n})}:r;ym(t).maybeAppendByClassName(iv.iconGroup,"g").selectAll(iv.icon.class).data([o]).join((function(t){return t.append(o).attr("className",iv.icon.name)}),(function(t){return t.update(n)}),(function(t){return t.remove()}))},e.prototype.render=function(t,e){this.renderIcon(e),this.renderLabel(e)},e}(wm),sv=function(t){function e(e){var n=t.call(this,e,i(i(i({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]},Om(nv,"handle")),Om(tv,"handleIcon")),Om(ev,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(t){return function(e){e.stopPropagation(),n.target=t,n.prevPos=n.getOrientVal($g(e));var r=n.availableSpace,i=r.x,o=r.y,a=n.attributes,s=a.x,c=a.y;n.selectionStartPos=n.getRatio(n.prevPos-n.getOrientVal([i,o])-n.getOrientVal([+s,+c])),n.selectionWidth=0,document.addEventListener("mousemove",n.onDragging),document.addEventListener("touchmove",n.onDragging),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("touchend",n.onDragEnd)}},n.onDragging=function(t){var e=n.attributes,r=e.slidable,i=e.brushable;t.stopPropagation();var o=n.getOrientVal($g(t)),a=o-n.prevPos;if(a){var s=n.getRatio(a);switch(n.target){case"start":r&&n.setValuesOffset(s);break;case"end":r&&n.setValuesOffset(0,s);break;case"selection":r&&n.setValuesOffset(s,s);break;case"track":if(!i)return;n.selectionWidth+=s,n.innerSetValues([n.selectionStartPos,n.selectionStartPos+n.selectionWidth].sort(),!0)}n.prevPos=o}},n.onDragEnd=function(){document.removeEventListener("mousemove",n.onDragging),document.removeEventListener("mousemove",n.onDragging),document.removeEventListener("mouseup",n.onDragEnd),document.removeEventListener("touchend",n.onDragEnd)},n.onValueChange=function(t){var e=new Ga("valuechange",{detail:{oldValue:t,value:n.getValues()}});n.dispatchEvent(e)},n.selectionStartPos=0,n.selectionWidth=0,n.prevPos=0,n.target="",n}return r(e,t),Object.defineProperty(e.prototype,"values",{get:function(){return this.attributes.values},set:function(t){this.attributes.values=this.clampValues(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sparklineStyle",{get:function(){if("horizontal"!==this.attributes.orientation)return null;var t=Tm(this.attributes,"sparkline");return i(i({zIndex:0},this.availableSpace),t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t=this.attributes,e=t.trackLength,n=t.trackSize,r=u(this.getOrientVal([[e,n],[n,e]]),2);return{width:r[0],height:r[1]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=u(bm(this.attributes.padding),4),e=t[0],n=t[1],r=t[2],i=t[3],o=this.shape;return{x:i,y:e,width:o.width-(i+n),height:o.height-(e+r)}},enumerable:!1,configurable:!0}),e.prototype.getValues=function(){return this.values},e.prototype.setValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1),this.attributes.values=t;var n=!1!==e&&this.attributes.animate;Qm(this.selectionShape.node(),this.selectionStyle,n),this.updateHandlesPosition(n)},e.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(Qm(this.startHandle,this.getHandleStyle("start"),t),Qm(this.endHandle,this.getHandleStyle("end"),t))},e.prototype.innerSetValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1);var n=this.values,r=this.clampValues(t);this.attr("values",r),this.setValues(r),e&&this.onValueChange(n)},e.prototype.renderTrack=function(t){var e=this.attributes.brushable,n=Tm(this.attributes,"track");this.trackShape=ym(t).maybeAppendByClassName(rv.track,"rect").styles(i(i({cursor:e?"crosshair":"default"},this.shape),n))},e.prototype.renderSparkline=function(t){var e=this;Kg("horizontal"===this.attributes.orientation,ym(t).maybeAppendByClassName(rv.sparklineGroup,"g"),(function(t){var n=e.sparklineStyle;t.maybeAppendByClassName(rv.sparkline,(function(){return new Ym({style:n})})).update(n)}))},Object.defineProperty(e.prototype,"selectionStyle",{get:function(){var t=Tm(this.attributes,"selection");return i(i({},t),this.calcMask())},enumerable:!1,configurable:!0}),e.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)||void 0===t||t.selectAll(rv.handle.class).data(n,(function(t){return t.type})).join((function(t){return t.append((function(t){var n=t.type;return new av({style:e.getHandleStyle(n)})})).each((function(t){var e=t.type;this.attr("class","".concat(rv.handle.name," ").concat(e,"-handle"));var n="".concat(e,"Handle");r[n]=this,this.addEventListener("pointerdown",(function(t){r.onDragStart(e)(t)}))}))}),(function(t){return t.each((function(t){var e=t.type;this.update(r.getHandleStyle(e))}))}),(function(t){return t.each((function(t){var e=t.type,n="".concat(e,"Handle");r[n]=void 0})).remove()}))},e.prototype.renderSelection=function(t){this.foregroundGroup=ym(t).maybeAppendByClassName(rv.foreground,"g"),this.selectionShape=this.foregroundGroup.maybeAppendByClassName(rv.selection,"rect").styles(this.selectionStyle),this.renderHandles()},e.prototype.render=function(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderSelection(e)},e.prototype.clampValues=function(t,e){var n;void 0===e&&(e=4);var r=u(this.range,2),i=r[0],o=r[1],a=u(this.getValues().map((function(t){return um(t,e)})),2),s=a[0],c=a[1],l=u((t||[s,c]).map((function(t){return um(t,e)})),2),f=l[0],d=l[1];f>d&&(f=(n=u([d,f],2))[0],d=n[1]);var h=d-f;return h>o-i?[i,o]:f<i?s===i&&c===d?[i,d]:[i,h+i]:d>o?c===o&&s===f?[f,o]:[o-h,o]:[f,d]},e.prototype.calcMask=function(t){var e=u(this.clampValues(t),2),n=e[0],r=e[1],i=this.availableSpace,o=i.x,a=i.y,s=i.width,c=i.height;return this.getOrientVal([{y:a,height:c,x:n*s+o,width:(r-n)*s},{x:o,width:s,y:n*c+a,height:(r-n)*c}])},e.prototype.calcHandlePosition=function(t){var e=this.availableSpace,n=e.x,r=e.y,i=e.width,o=e.height,a=u(this.clampValues(),2),s=a[0],c=a[1],l=("start"===t?s:c)*this.getOrientVal([i,o]);return{x:n+this.getOrientVal([l,i/2]),y:r+this.getOrientVal([o/2,l])}},e.prototype.inferTextStyle=function(t){return"horizontal"===this.attributes.orientation?{}:"start"===t?{transform:"rotate(90)",textAlign:"start"}:"end"===t?{transform:"rotate(90)",textAlign:"end"}:{}},e.prototype.calcHandleText=function(t){var e,n=this.attributes,r=n.orientation,o=n.formatter,a=n.autoFitLabel,s=Tm(this.attributes,"handle"),c=Tm(s,"label"),l=s.spacing,u=this.getHandleSize(),f=this.clampValues(),d=o("start"===t?f[0]:f[1]),h=new Ig({style:i(i(i({},c),this.inferTextStyle(t)),{text:d})}),p=h.getBBox(),g=p.width,m=p.height;if(h.destroy(),!a){var v=l+u+("horizontal"===r?g/2:0);return(e={text:d})["horizontal"===r?"x":"y"]="start"===t?-v:v,e}var y=0,_=0,b=this.availableSpace,E=b.width,x=b.height,M=this.calcMask(),S=M.x,A=M.y,T=M.width,O=M.height,R=l+u;if("horizontal"===r){var P=R+g/2;if("start"===t)y=S-R-g>0?-P:P;else y=E-S-T-R>g?P:-P}else{var C=m+R;_="start"===t?A-u>m?-C:R:x-(A+O)-u>m?C:-R}return{x:y,y:_,text:d}},e.prototype.getHandleLabelStyle=function(t){if(!this.attributes.showLabel)return{};var e=Tm(this.attributes,"handleLabel");return i(i(i({},e),this.calcHandleText(t)),this.inferTextStyle(t))},e.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=Tm(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),r=this.getHandleSize();return i({cursor:n,shape:t,size:r},e)},e.prototype.getHandleStyle=function(t){var e=this.attributes,n=e.showLabel,r=e.orientation,o=this.calcHandlePosition(t),a=this.calcHandleText(t);return i(i(i(i({},Om(this.getHandleIconStyle(),"icon")),Om(i(i({},this.getHandleLabelStyle(t)),a),"label")),o),{orientation:r,showLabel:n,type:t,zIndex:3})},e.prototype.getHandleSize=function(){var t=this.attributes,e=t.handleIconSize,n=t.width,r=t.height;return e||Math.floor((this.getOrientVal([+r,+n])+4)/2.4)},e.prototype.getOrientVal=function(t){var e=u(t,2),n=e[0],r=e[1];return"horizontal"===this.attributes.orientation?n:r},e.prototype.setValuesOffset=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=!1);var r=u(this.getValues(),2),i=[r[0]+t,r[1]+e].sort();n?this.setValues(i):this.innerSetValues(i,!0)},e.prototype.getRatio=function(t){var e=this.availableSpace,n=e.width,r=e.height;return t/this.getOrientVal([n,r])},e.prototype.dispatchCustomEvent=function(t,e,n){var r=this;t.on(e,(function(t){t.stopPropagation(),r.dispatchEvent(new Ga(n,{detail:t}))}))},e.prototype.bindEvents=function(){var t=this.selectionShape;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");var e=this.trackShape;this.dispatchCustomEvent(e,"click","trackClick"),this.dispatchCustomEvent(e,"mouseenter","trackMouseenter"),this.dispatchCustomEvent(e,"mouseleave","trackMouseleave"),e.on("mousedown",this.onDragStart("track")),e.on("touchstart",this.onDragStart("track"))},e.prototype.onScroll=function(t){if(this.attributes.scrollable){var e=t.deltaX,n=t.deltaY||e,r=this.getRatio(n);this.setValuesOffset(r,r,!0)}},e.tag="slider",e}(wm),cv=function(t){function e(e){var n=t.call(this,e,{isRound:!0,orientation:"vertical",padding:[2,2,2,2],scrollable:!0,slidable:!0,thumbCursor:"default",trackSize:10,value:0})||this;return n.range=[0,1],n.onValueChange=function(t){var e=n.attributes.value;if(t!==e){var r={detail:{oldValue:t,value:e}};n.dispatchEvent(new Ga("scroll",r)),n.dispatchEvent(new Ga("valuechange",r))}},n.onTrackClick=function(t){if(n.attributes.slidable){var e=u(n.getLocalPosition(),2),r=e[0],i=e[1],o=u(n.padding,4),a=o[0],s=o[3],c=n.getOrientVal([r+s,i+a]),l=(n.getOrientVal($g(t))-c)/n.trackLength;n.setValue(l,!0)}},n.onThumbMouseenter=function(t){n.dispatchEvent(new Ga("thumbMouseenter",{detail:t.detail}))},n.onTrackMouseenter=function(t){n.dispatchEvent(new Ga("trackMouseenter",{detail:t.detail}))},n.onThumbMouseleave=function(t){n.dispatchEvent(new Ga("thumbMouseleave",{detail:t.detail}))},n.onTrackMouseleave=function(t){n.dispatchEvent(new Ga("trackMouseleave",{detail:t.detail}))},n}return r(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return bm(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){var t=this.attributes.value,e=u(this.range,2),n=e[0],r=e[1];return Se(t,n,r)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackLength",{get:function(){var t=this.attributes,e=t.viewportLength,n=t.trackLength;return void 0===n?e:n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes.trackSize,e=this.trackLength,n=u(this.padding,4),r=n[0],i=n[1],o=n[2],a=n[3],s=u(this.getOrientVal([[e,t],[t,e]]),2);return{x:a,y:r,width:+s[0]-(a+i),height:+s[1]-(r+o)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackRadius",{get:function(){var t=this.attributes,e=t.isRound,n=t.trackSize;return e?n/2:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbRadius",{get:function(){var t=this.attributes,e=t.isRound,n=t.thumbRadius;if(!e)return 0;var r=this.availableSpace,i=r.width,o=r.height;return n||this.getOrientVal([o,i])/2},enumerable:!1,configurable:!0}),e.prototype.getValues=function(t){void 0===t&&(t=this.value);var e=this.attributes,n=e.viewportLength/e.contentLength,r=u(this.range,2),i=r[0],o=t*(r[1]-i-n);return[o,o+n]},e.prototype.getValue=function(){return this.value},e.prototype.renderSlider=function(t){var e=this.attributes,n=e.orientation,r=e.trackSize,o=e.padding,a=e.slidable,s=Tm(this.attributes,"track"),c=Tm(this.attributes,"thumb"),l=i(i({brushable:!1,orientation:n,padding:o,selectionRadius:this.thumbRadius,showHandle:!1,slidable:a,trackLength:this.trackLength,trackRadius:this.trackRadius,trackSize:r,values:this.getValues()},Om(s,"track")),Om(c,"selection"));this.slider=ym(t).maybeAppendByClassName("scrollbar",(function(){return new sv({style:l})})).update(l).node()},e.prototype.render=function(t,e){this.renderSlider(e)},e.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.attributes.value,r=u(this.range,2),i=r[0],o=r[1];this.slider.setValues(this.getValues(Se(t,i,o)),e),this.onValueChange(n)},e.prototype.bindEvents=function(){var t=this;this.slider.addEventListener("trackClick",(function(e){e.stopPropagation(),t.onTrackClick(e.detail)})),this.onHover()},e.prototype.getOrientVal=function(t){return"horizontal"===this.attributes.orientation?t[0]:t[1]},e.prototype.onHover=function(){this.slider.addEventListener("selectionMouseenter",this.onThumbMouseenter),this.slider.addEventListener("trackMouseenter",this.onTrackMouseenter),this.slider.addEventListener("selectionMouseleave",this.onThumbMouseleave),this.slider.addEventListener("trackMouseleave",this.onTrackMouseleave)},e.tag="scrollbar",e}(wm),lv={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 Cs({style:{path:[["M",10,10],["L",-10,0],["L",10,-10],["L",0,0],["L",10,10],["Z"]],anchor:"0.5 0.5",fill:"black",transformOrigin:"center"}})},labelAlign:"parallel",labelDirection:"positive",labelFontSize:12,labelSpacing:0,gridConnect:"line",gridControlAngles:[],gridDirection:"positive",gridLength:0,gridType:"segment",lineArrowOffset:15,lineArrowSize:10,tickDirection:"positive",tickLength:5,tickLineWidth:1,tickStroke:"black",labelOverlap:[]};We({},lv,{style:{type:"arc"}}),We({},lv,{style:{}});var uv=Ug({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"),fv=Ug({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function dv(t){return t.reduce((function(t,e,n){return t.push(f([0===n?"M":"L"],u(e),!1)),t}),[])}function hv(t,e,n){return"surround"===e.type?function(t,e,n){var r=e.connect,i=void 0===r?"line":r,o=e.center;if("line"===i)return dv(t);if(!o)return[];var a=cm(t[0],o),s=n?0:1;return t.reduce((function(t,e,n){return 0===n?t.push(f(["M"],u(e),!1)):t.push(f(["A",a,a,0,0,s],u(e),!1)),t}),[])}(t,e,n):dv(t)}function pv(t,e,n){var r=n.type,i=n.connect,o=n.center,a=n.closed?[["Z"]]:[],s=u([hv(t,n),hv(e.slice().reverse(),n,!0)],2),c=s[0],l=s[1],d=u([t[0],e.slice(-1)[0]],2),h=d[0],p=d[1],g=function(t,e){return[c,t,l,e,a].flat()};if("line"===i||"surround"===r)return g([f(["L"],u(p),!1)],[f(["L"],u(h),!1)]);if(!o)throw new Error("Arc grid need to specified center");var m=u([cm(p,o),cm(h,o)],2),v=m[0],y=m[1];return g([f(["A",v,v,0,0,1],u(p),!1),f(["L"],u(p),!1)],[f(["A",y,y,0,0,0],u(h),!1),f(["L"],u(h),!1)])}var gv=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.render=function(t,e){t.type,t.center,t.areaFill,t.closed;var n=o(t,["type","center","areaFill","closed"]),r=function(t){var e=t.data,n=void 0===e?[]:e;return t.closed?n.map((function(t){var e=t.points,n=u(e,1)[0];return i(i({},t),{points:f(f([],u(e),!1),[n],!1)})})):n}(t),a=ym(e).maybeAppendByClassName(fv.lineGroup,"g"),s=ym(e).maybeAppendByClassName(fv.regionGroup,"g"),c=function(t,e,n,r){var o=n.animate,a=n.isBillboard,s=e.map((function(t,e){return{id:t.id||"grid-line-".concat(e),path:hv(t.points,n)}}));return t.selectAll(fv.line.class).data(s,(function(t){return t.id})).join((function(t){return t.append("path").each((function(t,e){var n=Bg(gm(i({path:t.path},r)),[t,e,s]);this.attr(i({class:fv.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:a},n))}))}),(function(t){return t.transition((function(t,e){return Qm(this,Bg(gm(i({path:t.path},r)),[t,e,s]),o.update)}))}),(function(t){return t.transition((function(){var t=this,e=Jm(this,o.exit);return qm(e,(function(){return t.remove()})),e}))})).transitions()}(a,r,t,n),l=function(t,e,n){var r=n.animate,i=n.connect,o=n.areaFill;if(e.length<2||!o||!i)return[];for(var a=Array.isArray(o)?o:[o,"transparent"],s=function(t){return a[t%a.length]},c=[],l=0;l<e.length-1;l++){var f=u([e[l].points,e[l+1].points],2),d=pv(f[0],f[1],n);c.push({path:d,fill:s(l)})}return t.selectAll(fv.region.class).data(c,(function(t,e){return e})).join((function(t){return t.append("path").each((function(t,e){var n=Bg(t,[t,e,c]);this.attr(n)})).attr("className",fv.region.name)}),(function(t){return t.transition((function(t,e){return Qm(this,Bg(t,[t,e,c]),r.update)}))}),(function(t){return t.transition((function(){var t=this,e=Jm(this,r.exit);return qm(e,(function(){return t.remove()})),e}))})).transitions()}(s,r,t);return f(f([],u(c),!1),u(l),!1)},e}(wm);function mv(t,e){return Object.fromEntries(Object.entries(t).map((function(t){var n=u(t,2);return[n[0],Bg(n[1],e)]})))}function vv(t,e){return e&&de(e)?t.filter(e):t}var yv=Ue((function(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n}),(function(t,e){return[t,e.startAngle,e.endAngle].join()})),_v=Ue((function(t,e){if("linear"===e.type){var n=u(e.startPos,2),r=n[0],i=n[1],o=u(e.endPos,2),a=u([o[0]-r,o[1]-i],2);return lm([a[0],a[1]])}var s=kg(yv(t,e));return[-Math.sin(s),Math.cos(s)]}),(function(t,e){var n=function(t){if("linear"===t.type){var e=t.startPos,n=t.endPos;return f(f([],u(e),!1),u(n),!1)}var r=t.startAngle,i=t.endAngle,o=t.center,a=t.radius;return f(f([r,i],u(o),!1),[a],!1)}(e);return"arc"===e.type&&n.push(t),n.join()}));function bv(t,e,n){return function(t,e){return e?[t[1],-t[0]]:[-t[1],t[0]]}(_v(t,n),"positive"!==e)}function Ev(t,e){return bv(t,e.labelDirection,e)}var xv=Ue((function(t,e){var n=u(e.startPos,2),r=n[0],i=n[1],o=u(e.endPos,2),a=u([o[0]-r,o[1]-i],2);return[r+a[0]*t,i+a[1]*t]}),(function(t,e){return f(f([t],u(e.startPos),!1),u(e.endPos),!1).join()})),Mv=Ue((function(t,e){var n=e.radius,r=u(e.center,2),i=r[0],o=r[1],a=kg(yv(t,e));return[i+n*Math.cos(a),o+n*Math.sin(a)]}),(function(t,e){return f([t,e.startAngle,e.endAngle,e.radius],u(e.center),!1).join()}));function Sv(t,e){return"linear"===e.type?xv(t,e):Mv(t,e)}function Av(t){return 0===_v(0,t)[1]}function Tv(t){return 0===_v(0,t)[0]}function Ov(t,e){return e-t==360}function Rv(t,e,n,r,i){var o=e-t,a=u([i,i],2),s=a[0],c=a[1],l=u([kg(t),kg(e)],2),f=l[0],d=l[1],h=function(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]},p=u(h(f),2),g=p[0],m=p[1],v=u(h(d),2),y=v[0],_=v[1];if(Ov(t,e)){var b=u(h((d+f)/2),2);return[["M",g,m],["A",s,c,0,1,0,b[0],b[1]],["A",s,c,0,1,0,y,_]]}var E=o>180?1:0,x=t>e?0:1;return"M".concat(g,",").concat(m,",A").concat(s,",").concat(c,",0,").concat(E,",").concat(x,",").concat(y,",").concat(_)}function Pv(t,e,n,r){var o=e.startAngle,a=e.endAngle,s=e.center,c=e.radius;return t.selectAll(uv.line.class).data([{path:Rv.apply(void 0,f(f([o,a],u(s),!1),[c],!1))}],(function(t,e){return e})).join((function(t){return t.append("path").attr("className",uv.line.name).styles(e).styles({path:function(t){return t.path}})}),(function(t){return t.transition((function(){var t=this,e=function(t,e,n,r){if(!r)return t.attr("__keyframe_data__",n),null;var o=r.duration,a=void 0===o?0:o,s=Jg(e,n),c=Math.ceil(+a/16),l=new Array(c).fill(0).map((function(t,e,n){return{__keyframe_data__:s(e/(n.length-1))}}));return t.animate(l,i({fill:"both"},r))}(this,function(t){var e=t.attributes,n=e.startAngle,r=e.endAngle,i=e.center,o=e.radius;return f(f([n,r],u(i),!1),[o],!1)}(this),f(f([o,a],u(s),!1),[c],!1),r.update);if(e){var n=function(){var e=He(t.attributes,"__keyframe_data__");t.style.path=Rv.apply(void 0,f([],u(e),!1))};e.onframe=n,e.onfinish=n}return e})).styles(e)}),(function(t){return t.remove()})).styles(n).transitions()}function Cv(t){var e=u(t,2),n=u(e[0],2),r=n[0],i=n[1],o=u(e[1],2);return{x1:r,y1:i,x2:o[0],y2:o[1]}}function wv(t,e,n,r){var i=e.showTrunc,o=e.startPos,a=e.endPos,s=e.truncRange,c=e.lineExtension,l=u([o,a],2),f=u(l[0],2),d=f[0],h=f[1],p=u(l[1],2),g=p[0],m=p[1],v=u(c?function(t,e,n){void 0===n&&(n=[0,0]);var r=u([t,e,n],3),i=u(r[0],2),o=i[0],a=i[1],s=u(r[1],2),c=s[0],l=s[1],f=u(r[2],2),d=f[0],h=f[1],p=u([c-o,l-a],2),g=p[0],m=p[1],v=Math.sqrt(Math.pow(g,2)+Math.pow(m,2)),y=u([-d/v,h/v],2),_=y[0],b=y[1];return[_*g,_*m,b*g,b*m]}(o,a,c):new Array(4).fill(0),4),y=v[0],_=v[1],b=v[2],E=v[3],x=function(e){return t.selectAll(uv.line.class).data(e,(function(t,e){return e})).join((function(t){return t.append("line").attr("className",(function(t){return"".concat(uv.line.name," ").concat(t.className)})).styles(n).transition((function(t){return Qm(this,Cv(t.line),!1)}))}),(function(t){return t.styles(n).transition((function(t){return Qm(this,Cv(t.line),r.update)}))}),(function(t){return t.remove()})).transitions()};if(!i||!s)return x([{line:[[d+y,h+_],[g+b,m+E]],className:uv.line.name}]);var M=u(s,2),S=M[0],A=M[1],T=g-d,O=m-h,R=u([d+T*S,h+O*S],2),P=R[0],C=R[1],w=u([d+T*A,h+O*A],2),N=w[0],I=w[1],k=x([{line:[[d+y,h+_],[P,C]],className:uv.lineFirst.name},{line:[[N,I],[g+b,m+E]],className:uv.lineSecond.name}]);return function(t,e){e.truncRange,e.truncShape,e.lineExtension}(0,e),k}function Nv(t,e,n){var r,i=e.type,o=Tm(e,"line");return r="linear"===i?wv(t,e,fm(o,"arrow"),n):Pv(t,e,fm(o,"arrow"),n),function(t,e,n,r){var i,o=n.showArrow,a=n.showTrunc,s=n.lineArrow,c=n.lineArrowOffset,l=n.lineArrowSize;if(i="arc"===e?t.select(uv.line.class):a?t.select(uv.lineSecond.class):t.select(uv.line.class),!o||!s||"arc"===n.type&&Ov(n.startAngle,n.endAngle)){var u=i.node();u&&(u.style.markerEnd=void 0)}else{var f=qg(s);f.attr(r),mm(f,l,!0),i.style("markerEnd",f).style("markerEndOffset",-c)}}(t,i,e,o),r}function Iv(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function kv(t,e){var n=e.gridLength;return t.map((function(t,r){var i=t.value,o=u(Sv(i,e),2),a=o[0],s=o[1],c=u(rm(function(t,e){return bv(t,e.gridDirection,e)}(i,e),n),2);return{id:r,points:[[a,s],[a+c[0],s+c[1]]]}}))}function Lv(t,e,n,r){var o=Tm(n,"grid"),a=o.type,s=o.areaFill,c=Iv(n),l=vv(e,n.gridFilter),f="segment"===a?kv(l,n):function(t,e){var n=e.gridControlAngles,r=Iv(e);if(!r)throw new Error("grid center is not provide");if(t.length<2)throw new Error("Invalid grid data");if(!n||0===n.length)throw new Error("Invalid gridControlAngles");var i=u(r,2),o=i[0],a=i[1];return t.map((function(t,r){var i=u(Sv(t.value,e),2),s=i[0],c=i[1],l=u([s-o,c-a],2),f=l[0],d=l[1],h=[];return n.forEach((function(t){var e=kg(t),n=u([Math.cos(e),Math.sin(e)],2),r=n[0],i=n[1],s=f*r-d*i+o,c=f*i+d*r+a;h.push([s,c])})),{points:h,id:r}}))}(l,n),d=i(i({},o),{center:c,areaFill:de(s)?l.map((function(t,e){return Bg(s,[t,e,l])})):s,animate:r,data:f});return t.selectAll(uv.grid.class).data([1]).join((function(t){return t.append((function(){return new gv({style:d})})).attr("className",uv.grid.name)}),(function(t){return t.transition((function(){return this.update(d)}))}),(function(t){return t.remove()})).transitions()}var Dv=function(){function t(t,e,n,r){this.set(t,e,n,r)}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),t.prototype.rotatedPoints=function(t,e,n){var r=this,i=r.x1,o=r.y1,a=r.x2,s=r.y2,c=Math.cos(t),l=Math.sin(t),u=e-e*c+n*l,f=n-e*l-n*c;return[[c*i-l*s+u,l*i+c*s+f],[c*a-l*s+u,l*a+c*s+f],[c*i-l*o+u,l*i+c*o+f],[c*a-l*o+u,l*a+c*o+f]]},t.prototype.set=function(t,e,n,r){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),r<e?(this.y2=e,this.y1=r):(this.y1=e,this.y2=r),this},t.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE},t}();function Bv(t,e){var n=t.getEulerAngles()||0;t.setEulerAngles(0);var r=t.getLocalBounds(),i=u(r.min,2),o=i[0],a=i[1],s=u(r.max,2),c=s[0],l=s[1],f=Fv(t),d=f.width,h=f.height,p=0,g=0,m=o,v=a,y=Hg(t);if(y){h-=1.5;var _=y.style.textAlign,b=y.style.textBaseline;"center"===_?m=(o+c)/2:"right"!==_&&"end"!==_||(m=c),"middle"===b?v=(a+l)/2:"bottom"===b&&(v=l)}var E=u(bm(e),4),x=E[0],M=void 0===x?0:x,S=E[1],A=void 0===S?0:S,T=E[2],O=void 0===T?M:T,R=E[3],P=new Dv((p+=o)-(void 0===R?A:R),(g+=a)-M,p+d+A,g+h+O);return t.setEulerAngles(n),P.rotatedPoints(kg(n),m,v)}function Fv(t){return t.__bbox__?t.__bbox__:t.getBBox()}function Uv(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 jv(t,e,n){var r=(e[1]-t[1])*(n[0]-e[0])-(e[0]-t[0])*(n[1]-e[1]);return 0===r?0:r<0?2:1}function Gv(t,e){return e.every((function(e){return function(t,e){var n=t.length;if(n<3)return!1;var r,i,o,a,s,c,l=[e,[9999,e[1]]],u=0,f=0;do{var d=[t[f],t[(f+1)%n]];if(i=l,o=void 0,a=void 0,s=void 0,c=void 0,o=jv((r=d)[0],r[1],i[0]),a=jv(r[0],r[1],i[1]),s=jv(i[0],i[1],r[0]),c=jv(i[0],i[1],r[1]),o!==a&&s!==c||0===o&&Uv(r,i[0])||0===a&&Uv(r,i[1])||0===s&&Uv(i,r[0])||0===c&&Uv(i,r[1])){if(0===jv(d[0],e,d[1]))return Uv(d,e);u++}f=(f+1)%n}while(0!==f);return!!(1&u)}(t,e)}))}function Wv(t,e){return[[t[0],t[1],t[2],t[3]],[t[2],t[3],t[4],t[5]],[t[4],t[5],t[6],t[7]],[t[6],t[7],t[0],t[1]]].some((function(t){return function(t,e){var n=u(t,4),r=n[0],i=n[1],o=n[2],a=n[3],s=u(e,4),c=s[0],l=s[1],f=o-r,d=a-i,h=s[2]-c,p=s[3]-l,g=f*p-h*d;if(0===g)return!1;var m=g>0,v=r-c,y=i-l,_=f*y-d*v;if(_<0===m)return!1;var b=h*y-p*v;return b<0!==m&&_>g!==m&&b>g!==m}(e,t)}))}function zv(t,e,n){var r,i,o=e.crossPadding,a=new Set,s=null,c=function(t,e){var n=t.type,r=t.labelDirection,i=t.crossSize;if(!i)return!1;if("arc"===n){var o=t.center,a=t.radius,s=u(o,2),c=s[0],l=s[1],f="negative"===r?0:i,d=-a-f,h=a+f,p=u(bm(e),4),g=p[0],m=p[1],v=p[2],y=p[3];return new Dv(c+d-y,l+d-g,c+h+m,l+h+v)}var _=u(t.startPos,2),b=_[0],E=_[1],x=u(t.endPos,2),M=x[0],S=x[1],A=u(Tv(t)?[-e,0,e,0]:[0,e,0,-e],4),T=A[0],O=A[1],R=A[2],P=A[3],C=rm(Ev(0,t),i),w=new Dv(b,E,M,S);return w.x1+=P,w.y1+=T,w.x2+=O+C[0],w.y2+=R+C[1],w}(e,o),f=function(t){return!c||function(t,e,n){var r=t.x1,i=t.x2,o=t.y1,a=t.y2;return Gv([[r,o],[i,o],[i,a],[r,a]],Bv(e,n))}(c,t)},d=function(t,e){return!t||!function(t,e,n){var r,i,o=Bv(t,n).flat(1),a=Bv(e,n).flat(1),s=[[o[0],o[1],o[2],o[3]],[o[0],o[1],o[4],o[5]],[o[4],o[5],o[6],o[7]],[o[2],o[3],o[6],o[7]]];try{for(var c=l(s),u=c.next();!u.done;u=c.next())if(Wv(a,u.value))return!0}catch(t){r={error:t}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}return!1}(t,e,bm(n))};try{for(var h=l(t),p=h.next();!p.done;p=h.next()){var g=p.value;f(g)?!s||d(s,g)?s=g:(a.add(s),a.add(g)):a.add(g)}}catch(t){r={error:t}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}return Array.from(a)}function Vv(t,e){return void 0===e&&(e={}),he(t)?0:"number"==typeof t?t:Math.floor(zg(t,e))}var Hv=function(t,e){var n=e.seq,r=void 0===n?2:n;return t.filter((function(t,e){return!(e%r)||(Pg(t),!1)}))};var Xv=new Map([["hide",function(t,e,n,r){var i=t.length,o=e.keepHeader,a=e.keepTail;if(!(i<=1||2===i&&o&&a)){var s,c,l,d=Hv,h=function(t){return t.forEach(r.show),t},p=2,g=t.slice(),m=t.slice(),v=Math.min.apply(Math,f([1],u(t.map((function(t){return Fv(t).width}))),!1));if("linear"===n.type&&(Av(n)||Tv(n))){var y=Em(t[0]).left,_=Em(t[i-1]).right,b=Math.abs(_-y)||1;p=Math.max(Math.floor(i*v/b),p)}for(o&&(s=g.splice(0,1)[0]),a&&(c=g.splice(-1,1)[0],g.reverse()),h(g);p<t.length&&zv((l=c?f(f([c],u(m),!1),[s],!1):f([s],u(m),!1),l.filter(Wg)),n,null==e?void 0:e.margin).length;){if(c&&!s&&p%2==0)g.splice(0,1).forEach(r.hide);else if(c&&s){g.splice(0,1).forEach(r.hide)}m=d(h(g),{seq:p}),p++}}}],["rotate",function(t,e,n,r){var i,o,a=e.optionalAngles,s=void 0===a?[0,45,90]:a,c=e.margin,u=e.recoverWhenFailed,f=void 0===u||u,d=t.map((function(t){return t.getLocalEulerAngles()})),h=function(e){return t.forEach((function(t,n){var i=Array.isArray(e)?e[n]:e;r.rotate(t,+i)}))};try{for(var p=l(s),g=p.next();!g.done;g=p.next()){if(h(g.value),zv(t,n,c).length<1)return}}catch(t){i={error:t}}finally{try{g&&!g.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}f&&h(d)}],["ellipsis",function(t,e,n,r){if(!(t.length<=1)){var i=e.suffix,o=void 0===i?"...":i,a=e.minLength,s=e.maxLength,c=void 0===s?1/0:s,l=e.step,f=void 0===l?" ":l,d=e.margin,h=void 0===d?[0,0,0,0]:d,p=Vg(r.getTextShape(t[0])),g=Vv(f,p),m=a?Vv(a,p):g,v=Vv(c,p);(he(v)||v===1/0)&&(v=Math.max.apply(null,t.map((function(t){return Fv(t).width}))));var y=t.slice(),_=u(h,4);_[0],_[1],_[2],_[3];for(var b=function(e){if(y.forEach((function(t){r.ellipsis(r.getTextShape(t),e,o)})),(y=zv(t,n,h)).length<1)return{value:void 0}},E=v;E>m+g;E-=g){var x=b(E);if("object"==typeof x)return x.value}}}],["wrap",function(t,e,n,r){var i=e.wordWrapWidth,o=void 0===i?50:i,a=e.maxLines,s=void 0===a?3:a,c=e.recoverWhenFailed,l=void 0===c||c,d=e.margin,h=void 0===d?[0,0,0,0]:d,p=t.map((function(t){return t.attr("maxLines")||1})),g=Math.min.apply(Math,f([],u(p),!1)),m=function(t){var e=t.type,n=t.labelDirection;return"linear"===e&&Av(t)?"negative"===n?"bottom":"top":"middle"}(n),v=function(e){return t.forEach((function(t,n){var i=Array.isArray(e)?e[n]:e;r.wrap(t,o,i,m)}))};if(!(g>s)){for(var y=g;y<=s;y++)if(v(y),zv(t,n,h).length<1)return;l&&v(p)}}]]);function Yv(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce((function(t,e){return t*function(t){return"positive"===t?-1:1}(e)}),1)}var $v=function(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)},qv=Ue((function(t,e){var n=u(t,2),r=n[0],i=n[1],o=u(e,2),a=o[0],s=o[1],c=u([r*a+i*s,r*s-i*a],2),l=c[0],f=c[1];return Math.atan2(f,l)}),(function(t,e){return f(f([],u(t),!1),u(e),!1).join()}));function Kv(t,e,n){var r,i=n.labelAlign;if(null===(r=e.style.transform)||void 0===r?void 0:r.includes("rotate"))return e.getLocalEulerAngles();var o=Ev(t.value,n),a=_v(t.value,n);return"horizontal"===i?0:function(t){var e=(t+360)%180;return Zg(e,-90,90)||(e+=180),e}(Lg("perpendicular"===i?qv([1,0],o):qv([a[0]<0?-1:1,0],a)))}function Zv(t,e,n){var r=n.type,i=n.labelAlign,o=Ev(t,n),a=$v(e),s=$v(Lg(qv([1,0],o))),c="center",l="middle";return"linear"===r?[90,270].includes(s)&&0===a?(c="center",l=1===o[1]?"top":"bottom"):s%180||![90,270].includes(a)?0===s?(Zg(a,0,90,!1,!0)||Zg(a,0,90)||Zg(a,270,360))&&(c="start"):90===s?Zg(a,0,90,!1,!0)?c="start":(Zg(a,90,180)||Zg(a,270,360))&&(c="end"):270===s?Zg(a,0,90,!1,!0)?c="end":(Zg(a,90,180)||Zg(a,270,360))&&(c="start"):180===s&&(90===a?c="start":(Zg(a,0,90)||Zg(a,270,360))&&(c="end")):c="center":"parallel"===i?l=Zg(s,0,180,!0)?"top":"bottom":"horizontal"===i?Zg(s,90,270,!1)?c="end":(Zg(s,270,360,!1)||Zg(s,0,90))&&(c="start"):"perpendicular"===i&&(c=Zg(s,90,270)?"end":"start"),{textAlign:c,textBaseline:l}}function Qv(t,e,n){var r=n.showTick,i=n.tickLength,o=n.tickDirection,a=n.labelDirection,s=n.labelSpacing,c=e.indexOf(t),l=Bg(s,[t,c,e]),f=u([Ev(t.value,n),Yv(a,o)],2),d=u(im(rm(f[0],l+(1===f[1]?Bg(r?i:0,[t,c,e]):0)),Sv(t.value,n)),2);return{x:d[0],y:d[1]}}function Jv(t,e){"text"===t.nodeName&&t.attr(e)}function ty(t){!function(t,e,n){var r=e.labelOverlap,i=void 0===r?[]:r;i.length&&i.forEach((function(r){var i=r.type,o=Xv.get(i);(function(t,e,n){return!(e.labelOverlap.length<1)&&("hide"===n?!function(t){for(var e=t;e;){if("offscreen"===e.className)return!0;e=e.parent}return!1}(t[0]):"rotate"===n?!t.some((function(t){var e;return!!(null===(e=t.attr("transform"))||void 0===e?void 0:e.includes("rotate"))})):"ellipsis"!==n&&"wrap"!==n||t.filter((function(t){return t.querySelector("text")})).length>1)})(t,e,i)&&(null==o||o(t,r,e,n))}))}(this.node().childNodes,t,{hide:Pg,show:Rg,rotate:function(e,n){!function(t,e,n){e.setLocalEulerAngles(t);var r=Zv(e.__data__.value,t,n),i=e.querySelector(uv.labelItem.class);i&&Jv(i,r)}(+n,e,t)},ellipsis:function(t,e,n){void 0===e&&(e=1/0),t&&Yg(t,e,n)},wrap:function(t,e,n){var r,i;t&&(void 0===(r=n)&&(r=2),void 0===i&&(i="top"),Xg(t,{wordWrap:!0,wordWrapWidth:e,maxLines:r,textBaseline:i}))},getTextShape:function(t){return t.querySelector("text")}})}function ey(t,e,n,r,a){var s=n.indexOf(e),c=ym(t).append(function(t,e,n,r){var i=r.labelFormatter;return de(i)?function(){return qg(Bg(i,[t,e,n,Ev(t.value,r)]))}:function(){return qg(t.label||"")}}(e,s,n,a)).attr("className",uv.labelItem.name).node(),l=u(Rm(mv(r,[e,s,n])),2),f=l[0],d=l[1],h=d.transform,p=o(d,["transform"]);Pm(t,h);var g=Kv(e,t,a);return t.setLocalEulerAngles(+g),Jv(c,i(i({},Zv(e.value,g,a)),f)),Pm(t,h),t.attr(p),c}function ny(t,e,n,r){var o=vv(e,n.labelFilter),a=Tm(n,"label");return t.selectAll(uv.label.class).data(o,(function(t,e){return e})).join((function(r){return r.append("g").attr("className",uv.label.name).transition((function(t){return ey(this,t,e,a,n),this.attr(Qv(t,e,n)),this.__bbox__=t.bbox,null})).call((function(){return ty.call(t,n)}))}),(function(o){return o.transition((function(t){var o=function(t,e,n,r){if(void 0===r&&(r="destroy"),function(t,e){return"text"===t.nodeName&&"text"===e.nodeName&&t.attributes.text===e.attributes.text}(t,e))return t.remove(),[null];var o=function(){"destroy"===r?t.destroy():"hide"===r&&Pg(t),e.isVisible()&&Rg(e)};if(!n)return o(),[null];var a=n.duration,s=void 0===a?0:a,c=n.delay,l=void 0===c?0:c,f=Math.ceil(+s/2),d=+s/4,h=function(t){if("circle"===t.nodeName){var e=u(t.getLocalPosition(),2),n=e[0],r=e[1],i=t.attr("r");return[n-i,r-i]}return t.getLocalPosition()},p=u(h(t),2),g=p[0],m=p[1],v=u(h(e),2),y=u([(g+v[0])/2-g,(m+v[1])/2-m],2),_=y[0],b=y[1],E=t.style.opacity,x=void 0===E?1:E,M=e.style.opacity,S=void 0===M?1:M,A=t.animate([{opacity:x,transform:"translate(0, 0)"},{opacity:0,transform:"translate(".concat(_,", ").concat(b,")")}],i(i({fill:"both"},n),{duration:l+f+d})),T=e.animate([{opacity:0,transform:"translate(".concat(-_,", ").concat(-b,")"),offset:.01},{opacity:S,transform:"translate(0, 0)"}],i(i({fill:"both"},n),{duration:f+d,delay:l+f-d}));return qm(T,o),[A,T]}(this.querySelector(uv.labelItem.class),ey(this,t,e,a,n),r.update),s=Qm(this,Qv(t,e,n),r.update);return this.__bbox__=t.bbox,f(f([],u(o),!1),[s],!1)})).call((function(e){var r,i,o=He(e,"_transitions").flat().filter(Wg);i=function(){return ty.call(t,n)},0===(r=o).length?i():Promise.all(r.map((function(t){return null==t?void 0:t.finished}))).then(i)}))}),(function(t){return t.transition((function(){var t=this,e=Jm(this.childNodes[0],r.exit);return qm(e,(function(){return ym(t).remove()})),e}))})).transitions()}function ry(t,e){return bv(t,e.tickDirection,e)}var iy=Ue((function(t,e){var n=u(t,2);return[[0,0],[n[0]*e,n[1]*e]]}),(function(t,e){return f(f([],u(t),!1),[e],!1).join()}));function oy(t,e,n,r,o,a,s){var c=ry(t.value,a),l=function(t,e,n,r,i){var o=i.tickLength,a=u(iy(r,Bg(o,[t,e,n])),2),s=u(a[0],2),c=s[0],l=s[1],f=u(a[1],2);return{x1:c,x2:f[0],y1:l,y2:f[1]}}(t,e,n,c,a),f=l.x1,d=l.x2,h=l.y1,p=l.y2,g=u(Rm(mv(s,[t,e,n,c])),2),m=g[0],v=g[1];"line"===r.node().nodeName&&r.styles(i({x1:f,x2:d,y1:h,y2:p},m)),o.attr(v),r.styles(m)}function ay(t,e,n,r,i,o){var a=function(t,e,n,r,i){var o=i.tickFormatter,a=ry(e.value,i),s="line";return de(o)&&(s=function(){return Bg(o,[e,n,r,a])}),t.append(s).attr("className",uv.tickItem.name)}(ym(this),t,e,n,r);oy(t,e,n,a,this,r,i);var s=u(Sv(t.value,r),2);return Qm(this,{x:s[0],y:s[1]},o)}var sy=Ug({text:"text"},"title");function cy(t){return/\S+-\S+/g.test(t)?t.split("-").map((function(t){return t[0]})):t.length>2?[t[0]]:t.split("")}function ly(t,e){var n=Object.entries(e).reduce((function(e,n){var r=u(n,2),i=r[0],o=r[1];return t.node().attr(i)||(e[i]=o),e}),{});t.styles(n)}var uy=function(t){function e(e){return t.call(this,e,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"})||this}return r(e,t),e.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,r=t.position,i=t.spacing,o=t.inset,a=this.querySelector(sy.text.class);if(!a)return new Dg(0,0,+e,+n);var s=a.getBBox(),c=s.width,l=s.height,f=u(bm(i),4),d=f[0],h=f[1],p=f[2],g=f[3],m=u([0,0,+e,+n],4),v=m[0],y=m[1],_=m[2],b=m[3],E=cy(r);if(E.includes("i"))return new Dg(v,y,_,b);E.forEach((function(t,r){var i,o,a,s;"t"===t&&(i=u(0===r?[l+p,+n-l-p]:[0,+n],2),y=i[0],b=i[1]),"r"===t&&(o=u([+e-c-g],1),_=o[0]),"b"===t&&(a=u([+n-l-d],1),b=a[0]),"l"===t&&(s=u(0===r?[c+h,+e-c-h]:[0,+e],2),v=s[0],_=s[1])}));var x=u(bm(o),4),M=x[0],S=x[1],A=x[2],T=x[3],O=u([T+S,M+A],2),R=O[0],P=O[1];return new Dg(v+T,y+M,_-R,b-P)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new Dg(0,0,0,0)},e.prototype.render=function(t,e){var n=this;t.width,t.height,t.position,t.spacing;var r=o(t,["width","height","position","spacing"]),i=u(Rm(r),1)[0],a=function(t){var e,n,r,i,o=t,a=o.width,s=o.height,c=o.position,l=u([+a/2,+s/2],2),f=u([+l[0],+l[1],"center","middle"],4),d=f[0],h=f[1],p=f[2],g=f[3],m=cy(c);return m.includes("l")&&(d=(e=u([0,"start"],2))[0],p=e[1]),m.includes("r")&&(d=(n=u([+a,"end"],2))[0],p=n[1]),m.includes("t")&&(h=(r=u([0,"top"],2))[0],g=r[1]),m.includes("b")&&(h=(i=u([+s,"bottom"],2))[0],g=i[1]),{x:d,y:h,textAlign:p,textBaseline:g}}(t),s=a.x,c=a.y,l=a.textAlign,f=a.textBaseline;Kg(!!r.text,ym(e),(function(t){n.title=t.maybeAppendByClassName(sy.text,"text").styles(i).call(ly,{x:s,y:c,textAlign:l,textBaseline:f}).node()}))},e}(wm);function fy(t,e,n,r,i){var a=u(Rm(Tm(r,"title")),2),s=a[0],c=a[1],l=c.transform,f=o(c,["transform"]);t.styles(s),e.styles(f);var d=l||function(t,e,n){var r=t.cloneNode(!0);r.style.transform="scale(1, 1)",r.style.transform="none";var i=r.getBBox().height;if("vertical"===e){if("left"===n)return"rotate(-90) translate(0, ".concat(i/2,")");if("right"===n)return"rotate(-90) translate(0, -".concat(i/2,")")}return""}(t.node(),s.direction,s.position);Pm(t.node(),d);var h=function(t,e,n){var r=n.titlePosition,i=void 0===r?"lb":r,o=n.titleSpacing,a=cy(i),s=t.node().getLocalBounds(),c=u(s.min,2),l=c[0],f=c[1],d=u(s.halfExtents,2),h=d[0],p=d[1],g=u(e.node().getLocalBounds().halfExtents,2),m=g[0],v=g[1],y=u([l+h,f+p],2),_=y[0],b=y[1],E=u(bm(o),4),x=E[0],M=E[1],S=E[2],A=E[3];if(["start","end"].includes(i)&&"linear"===n.type){var T=n.startPos,O=n.endPos,R=u("start"===i?[T,O]:[O,T],2),P=R[0],C=R[1],w=u(rm(lm([-C[0]+P[0],-C[1]+P[1]]),x),2),N=w[0],I=w[1];return{x:P[0]+N,y:P[1]+I}}return a.includes("t")&&(b-=p+v+x),a.includes("r")&&(_+=h+m+M),a.includes("l")&&(_-=h+2*m+A),a.includes("b")&&(b+=p+2*v+S),{x:_,y:b}}(ym(n._offscreen||n.querySelector(uv.mainGroup.class)),e,r),p=h.x,g=h.y,m=Qm(e.node(),{x:p,y:g},i);return Pm(t.node(),d),m}function dy(t,e,n,r){var i=t.showLine,o=t.showTick,a=t.showLabel,s=Kg(i,e.maybeAppendByClassName(uv.lineGroup,"g"),(function(e){return Nv(e,t,r)}))||[],c=Kg(o,e.maybeAppendByClassName(uv.tickGroup,"g"),(function(e){return function(t,e,n,r){var i=vv(e,n.tickFilter),o=Tm(n,"tick");return t.selectAll(uv.tick.class).data(i,(function(t){return t.id||t.label})).join((function(t){return t.append("g").attr("className",uv.tick.name).transition((function(t,e){return ay.call(this,t,e,i,n,o,!1)}))}),(function(t){return t.transition((function(t,e){return this.removeChildren(),ay.call(this,t,e,i,n,o,r.update)}))}),(function(t){return t.transition((function(){var t=this,e=Jm(this.childNodes[0],r.exit);return qm(e,(function(){return t.remove()})),e}))})).transitions()}(e,n,t,r)}))||[],l=Kg(a,e.maybeAppendByClassName(uv.labelGroup,"g"),(function(e){return ny(e,n,t,r)}))||[];return f(f(f([],u(s),!1),u(c),!1),u(l),!1).filter((function(t){return!!t}))}var hy=function(t){function e(e){return t.call(this,e,lv)||this}return r(e,t),e.prototype.render=function(t,e,n){var r=this,i=t.titleText,o=t.data,a=t.animate,s=t.showTitle,c=t.showGrid,l=t.dataThreshold,d=t.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}(o,l).filter((function(t){var e=t.value;return!(d&&e>d[0]&&e<d[1])})),p=$m(void 0===n?a:n),g=Kg(c,ym(e).maybeAppendByClassName(uv.gridGroup,"g"),(function(e){return Lv(e,h,t,p)}))||[],m=ym(e).maybeAppendByClassName(uv.mainGroup,"g");i&&(!this.initialized&&p.enter||this.initialized&&p.update)&&dy(t,ym(this.offscreenGroup),h,$m(!1));var v=dy(t,ym(m.node()),h,p),y=Kg(s,ym(e).maybeAppendByClassName(uv.titleGroup,"g"),(function(e){return function(t,e,n,r){var i=n.titleText;return t.selectAll(uv.title.class).data([{title:i}].filter((function(t){return!!t.title})),(function(t,e){return t.title})).join((function(o){return o.append((function(){return qg(i)})).attr("className",uv.title.name).transition((function(){return fy(ym(this),t,e,n,r.enter)}))}),(function(i){return i.transition((function(){return fy(ym(this),t,e,n,r.update)}))}),(function(t){return t.remove()})).transitions()}(e,r,t,p)}))||[];return f(f(f([],u(g),!1),u(v),!1),u(y),!1).flat().filter((function(t){return!!t}))},e}(wm),py=Ug({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"),gy=function(t){function e(e){var n=t.call(this,e,{animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonPath:Bm(0,0,6),buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:function(t,e){return"".concat(t,"/").concat(e)},defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"})||this;return n.playState="idle",n.contentGroup=n.appendChild(new Ts({class:py.contentGroup.name})),n.playWindow=n.contentGroup.appendChild(new Ts({class:py.playWindow.name})),n.innerCurrPage=n.defaultPage,n}return r(e,t),Object.defineProperty(e.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return Se(t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"controllerShape",{get:function(){return this.totalPages>1?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageShape",{get:function(){var t=u(function(t){var e;return(null===(e=t[0])||void 0===e?void 0:e.map((function(e,n){return t.map((function(t){return t[n]}))})))||[]}(this.pageViews.map((function(t){var e=t.getBBox();return[e.width,e.height]}))).map((function(t){return Math.max.apply(Math,f([],u(t),!1))})),2),e=t[0],n=t[1],r=this.attributes,i=r.pageWidth,o=void 0===i?e:i,a=r.pageHeight;return{pageWidth:o,pageHeight:void 0===a?n:a}},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(e.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e=t.prototype.getBBox.call(this),n=e.x,r=e.y,i=this.controllerShape,o=this.pageShape,a=o.pageWidth,s=o.pageHeight;return new Dg(n,r,a+i.width,s)},e.prototype.goTo=function(t){var e=this,n=this.attributes.animate,r=this,i=r.currPage,o=r.playState,a=r.playWindow,s=r.pageViews;if("idle"!==o||t<0||s.length<=0||t>=s.length)return null;s[i].setLocalPosition(0,0),this.prepareFollowingPage(t);var c=u(this.getFollowingPageDiff(t),2),l=c[0],f=c[1];this.playState="running";var d=Zm(a,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-l,", ").concat(-f,")")}],n);return qm(d,(function(){e.innerCurrPage=t,e.playState="idle",e.setVisiblePages([t]),e.updatePageInfo()})),d},e.prototype.prev=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n<=0)return null;var r=t?(n-1+e)%e:Se(n-1,0,e);return this.goTo(r)},e.prototype.next=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n>=e-1)return null;var r=t?(n+1)%e:Se(n+1,0,e);return this.goTo(r)},e.prototype.renderClipPath=function(t){var e=this.pageShape,n=e.pageWidth,r=e.pageHeight;n&&r?(this.clipPath=t.maybeAppendByClassName(py.clipPath,"rect").styles({width:n,height:r}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0},e.prototype.setVisiblePages=function(t){this.playWindow.children.forEach((function(e,n){t.includes(n)?Rg(e):Pg(e)}))},e.prototype.adjustControllerLayout=function(){var t=this,e=t.prevBtnGroup,n=t.nextBtnGroup,r=t.pageInfoGroup,i=this.attributes,o=i.orientation,a=i.controllerPadding,s=r.getBBox(),c=s.width;s.height;var l=u("horizontal"===o?[-180,0]:[-90,90],2),f=l[0],d=l[1];e.setLocalEulerAngles(f),n.setLocalEulerAngles(d);var h=e.getBBox(),p=h.width,g=h.height,m=n.getBBox(),v=m.width,y=m.height,_=Math.max(p,c,v),b="horizontal"===o?{offset:[[0,0],[p/2+a,0],[p+c+2*a,0]],textAlign:"start"}:{offset:[[_/2,-g-a],[_/2,0],[_/2,y+a]],textAlign:"center"},E=u(b.offset,3),x=u(E[0],2),M=x[0],S=x[1],A=u(E[1],2),T=A[0],O=A[1],R=u(E[2],2),P=R[0],C=R[1],w=b.textAlign,N=r.querySelector("text");N&&(N.style.textAlign=w),e.setLocalPosition(M,S),r.setLocalPosition(T,O),n.setLocalPosition(P,C)},e.prototype.updatePageInfo=function(){var t,e=this,n=e.currPage,r=e.pageViews,i=e.attributes.formatter;r.length<2||(null===(t=this.pageInfoGroup.querySelector(py.pageInfo.class))||void 0===t||t.attr("text",i(n+1,r.length)),this.adjustControllerLayout())},e.prototype.getFollowingPageDiff=function(t){var e=this.currPage;if(e===t)return[0,0];var n=this.attributes.orientation,r=this.pageShape,i=r.pageWidth,o=r.pageHeight,a=t<e?-1:1;return"horizontal"===n?[a*i,0]:[0,a*o]},e.prototype.prepareFollowingPage=function(t){var e=this.currPage,n=this.pageViews;if(this.setVisiblePages([t,e]),t!==e){var r=u(this.getFollowingPageDiff(t),2),i=r[0],o=r[1];n[t].setLocalPosition(i,o)}},e.prototype.renderController=function(t){var e=this,n=this.attributes.controllerSpacing,r=this.pageShape,a=r.pageWidth,s=r.pageHeight,c=this.pageViews.length>=2,l=t.maybeAppendByClassName(py.controller,"g");if(Cg(l.node(),c),c){var f=Tm(this.attributes,"button"),d=Tm(this.attributes,"pageNum"),h=u(Rm(f),2),p=h[0],g=h[1],m=p.size,v=o(p,["size"]),y=!l.select(py.prevBtnGroup.class).node(),_=l.maybeAppendByClassName(py.prevBtnGroup,"g").styles(g);this.prevBtnGroup=_.node();var b=_.maybeAppendByClassName(py.prevBtn,"path"),E=l.maybeAppendByClassName(py.nextBtnGroup,"g").styles(g);this.nextBtnGroup=E.node(),[b,E.maybeAppendByClassName(py.nextBtn,"path")].forEach((function(t){t.styles(i(i({},v),{transformOrigin:"center"})),mm(t.node(),m,!0)}));var x=l.maybeAppendByClassName(py.pageInfoGroup,"g");this.pageInfoGroup=x.node(),x.maybeAppendByClassName(py.pageInfo,"text").styles(d),this.updatePageInfo(),l.node().setLocalPosition(a+n,s/2),y&&(this.prevBtnGroup.addEventListener("click",(function(){e.prev()})),this.nextBtnGroup.addEventListener("click",(function(){e.next()})))}},e.prototype.render=function(t,e){var n=ym(e);this.renderClipPath(n),this.renderController(n),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},e.prototype.bindEvents=function(){var t=this,e=Fe((function(){return t.render(t.attributes,t)}),50);this.playWindow.addEventListener(Xa.INSERTED,e),this.playWindow.addEventListener(Xa.REMOVED,e)},e}(wm);function my(t,e,n){return void 0===t&&(t="horizontal"),"horizontal"===t?e:n}Um.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"]]})),Um.registerSymbol("verticalHandle",(function(t,e,n){var r=1.4*n,i=n/2,o=n/6,a=t+.4*r;return[["M",t,e],["L",a,e+i],["L",t+r,e+i],["L",t+r,e-i],["L",a,e-i],["Z"],["M",a,e+o],["L",t+r-2,e+o],["M",a,e-o],["L",t+r-2,e-o]]})),Um.registerSymbol("horizontalHandle",(function(t,e,n){var r=1.4*n,i=n/2,o=n/6,a=e+.4*r;return[["M",t,e],["L",t-i,a],["L",t-i,e+r],["L",t+i,e+r],["L",t+i,a],["Z"],["M",t-o,a],["L",t-o,e+r-2],["M",t+o,a],["L",t+o,e+r-2]]}));var vy=Ug({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item");var yy=function(t){function e(e){return t.call(this,e,{span:[1,1],marker:function(){return new Ms({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}return r(e,t),Object.defineProperty(e.prototype,"showValue",{get:function(){var t=this.attributes.valueText;return!!t&&("string"==typeof t||"number"==typeof t?""!==t:"function"==typeof t||""!==t.attr("text"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"actualSpace",{get:function(){var t=this.labelGroup,e=this.valueGroup,n=this.attributes.markerSize,r=t.node().getBBox(),i=r.width,o=r.height,a=e.node().getBBox(),s=a.width,c=a.height;return{markerWidth:n,labelWidth:i,valueWidth:s,height:Math.max(n,o,c)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"span",{get:function(){var t=this.attributes.span;if(!t)return[1,1];var e=u(bm(t),2),n=e[0],r=e[1],i=this.showValue?r:0,o=n+i;return[n/o,i/o]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t,e=this.attributes,n=e.markerSize,r=e.width,i=this.actualSpace,o=i.markerWidth,a=i.height,s=this.actualSpace,c=s.labelWidth,l=s.valueWidth,f=u(this.spacing,2),d=f[0],h=f[1];if(r){var p=r-n-d-h,g=u(this.span,2);c=(t=u([g[0]*p,g[1]*p],2))[0],l=t[1]}return{width:o+c+l+d+h,height:a,markerWidth:o,labelWidth:c,valueWidth:l}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){var t=this.attributes.spacing;if(!t)return[0,0];var e=u(bm(t),2),n=e[0],r=e[1];return this.showValue?[n,r]:[n,0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layout",{get:function(){var t=this.shape,e=t.markerWidth,n=t.labelWidth,r=t.valueWidth,i=t.width,o=t.height,a=u(this.spacing,2),s=a[0];return{height:o,width:i,markerWidth:e,labelWidth:n,valueWidth:r,position:[e/2,e+s,e+n+s+a[1]]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleSize",{get:function(){var t=function(t){var e=t.querySelector(vy.marker.class);return e?e.style:{}}(this.markerGroup.node()),e=this.attributes,n=e.markerSize,r=e.markerStrokeWidth,i=void 0===r?t.strokeWidth:r,o=e.markerLineWidth,a=void 0===o?t.lineWidth:o,s=e.markerStroke,c=void 0===s?t.stroke:s,l=+(i||a||(c?1:0))*Math.sqrt(2),u=this.markerGroup.node().getBBox(),f=u.width,d=u.height;return(1-l/Math.max(f,d))*n},enumerable:!1,configurable:!0}),e.prototype.renderMarker=function(t){var e=this,n=this.attributes.marker,r=Tm(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(vy.markerGroup,"g").style("zIndex",0),Kg(!!n,this.markerGroup,(function(){var t=e.markerGroup.node(),i=t.getElementsByClassName(vy.marker.name)[0],o=n();i?o.nodeName===i.nodeName?(!function(t,e){var n,r,i=e.attributes;try{for(var o=l(Object.entries(i)),a=o.next();!a.done;a=o.next()){var s=u(a.value,2),c=s[0],f=s[1];"id"!==c&&"className"!==c&&t.attr(c,f)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}(i,o),ym(i).styles(r)):(i.remove(),ym(o).attr("className",vy.marker.name).styles(r),t.appendChild(o)):(ym(o).attr("className",vy.marker.name).styles(r),t.appendChild(o)),e.markerGroup.node().scale(1/e.markerGroup.node().getScale()[0]),mm(e.markerGroup.node(),e.scaleSize,!0)}))},e.prototype.renderLabel=function(t){var e=Tm(this.attributes,"label"),n=e.text,r=o(e,["text"]);this.labelGroup=t.maybeAppendByClassName(vy.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(vy.label,(function(){return qg(n)})).styles(r)},e.prototype.renderValue=function(t){var e=this,n=Tm(this.attributes,"value"),r=n.text,i=o(n,["text"]);this.valueGroup=t.maybeAppendByClassName(vy.valueGroup,"g").style("zIndex",0),Kg(this.showValue,this.valueGroup,(function(){e.valueGroup.maybeAppendByClassName(vy.value,(function(){return qg(r)})).styles(i)}))},e.prototype.renderBackground=function(t){var e=this.shape,n=e.width,r=e.height,o=Tm(this.attributes,"background");this.background=t.maybeAppendByClassName(vy.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(vy.background,"rect").styles(i({width:n,height:r},o))},e.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,i=u(t.position,3),o=i[0],a=i[1],s=i[2],c=r/2;this.markerGroup.styles({x:o,y:c}),this.labelGroup.styles({x:a,y:c}),Yg(this.labelGroup.select(vy.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({x:s,y:c}),Yg(this.valueGroup.select(vy.value.class).node(),Math.ceil(n)))},e.prototype.render=function(t,e){var n=ym(e);this.renderMarker(n),this.renderLabel(n),this.renderValue(n),this.renderBackground(n),this.adjustLayout()},e}(wm),_y=Ug({page:"item-page",navigator:"navigator",item:"item"},"items"),by=function(t,e,n){return void 0===n&&(n=!0),t?e(t):n},Ey=function(t){function e(e){var n=t.call(this,e,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:$e,mouseenter:$e,mouseleave:$e})||this;return n.navigatorShape=[0,0],n}return r(e,t),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"grid",{get:function(){var t=this.attributes,e=t.gridRow,n=t.gridCol,r=t.data;if(!e&&!n)throw new Error("gridRow and gridCol can not be set null at the same time");return e&&n?[e,n]:e?[e,r.length]:[r.length,n]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderData",{get:function(){var t=this.attributes,e=t.data,n=t.layout,r=Tm(this.attributes,"item"),o=e.map((function(t,o){var a=t.id,s=void 0===a?o:a,c=t.label,l=t.value;return{id:"".concat(s),index:o,style:i({layout:n,labelText:c,valueText:l},Object.fromEntries(Object.entries(r).map((function(n){var r=u(n,2);return[r[0],Bg(r[1],[t,o,e])]}))))}}));return o},enumerable:!1,configurable:!0}),e.prototype.getGridLayout=function(){var t=this,e=this.attributes,n=e.orientation,r=e.width,i=e.rowPadding,o=e.colPadding,a=u(this.navigatorShape,1)[0],s=u(this.grid,2),c=s[0],l=s[1],f=l*c,d=0;return this.pageViews.children.map((function(e,s){var h,p,g=Math.floor(s/f),m=s%f,v=t.ifHorizontal(l,c),y=[Math.floor(m/v),m%v];"vertical"===n&&y.reverse();var _=u(y,2),b=_[0],E=_[1],x=(r-a-(l-1)*o)/l,M=e.getBBox().height,S=u([0,0],2),A=S[0],T=S[1];return"horizontal"===n?(A=(h=u([d,b*(M+i)],2))[0],T=h[1],d=E===l-1?0:d+x+o):(A=(p=u([E*(x+o),d],2))[0],T=p[1],d=b===c-1?0:d+M+i),{page:g,index:s,row:b,col:E,pageIndex:m,width:x,height:M,x:A,y:T}}))},e.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,r=t.rowPadding,i=t.colPadding,o=u(this.navigatorShape,1)[0],a=u(this.grid,2),s=a[0],c=a[1],l=u([e-o,n],2),f=l[0],d=l[1],h=u([0,0,0,0,0,0,0,0],8),p=h[0],g=h[1],m=h[2],v=h[3],y=h[4],_=h[5],b=h[6],E=h[7];return this.pageViews.children.map((function(t,e){var n,o,a,l,h=t.getBBox(),x=h.width,M=h.height,S=0===b?0:i,A=b+S+x;return A<=f&&by(y,(function(t){return t<c}))?(n=u([b+S,E,A],3),p=n[0],g=n[1],b=n[2],{width:x,height:M,x:p,y:g,page:m,index:e,pageIndex:v++,row:_,col:y++}):(o=u([_+1,0,0,E+M+r],4),_=o[0],y=o[1],b=o[2],(E=o[3])+M<=d&&by(_,(function(t){return t<s}))?(a=u([b,E,x],3),p=a[0],g=a[1],b=a[2],{width:x,height:M,x:p,y:g,page:m,index:e,pageIndex:v++,row:_,col:y++}):(l=u([0,0,x,0,m+1,0,0,0],8),p=l[0],g=l[1],b=l[2],E=l[3],m=l[4],v=l[5],_=l[6],y=l[7],{width:x,height:M,x:p,y:g,page:m,index:e,pageIndex:v++,row:_,col:y++}))}))},Object.defineProperty(e.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var t="grid"===this.attributes.layout?this.getGridLayout:this.getFlexLayout,e=t.call(this);return e.slice(-1)[0].page>0?(this.navigatorShape=[55,0],t.call(this)):e},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return my(this.attributes.orientation,t,e)},e.prototype.flattenPage=function(t){t.querySelectorAll(_y.item.class).forEach((function(e){t.appendChild(e)})),t.querySelectorAll(_y.page.class).forEach((function(e){t.removeChild(e).destroy()}))},e.prototype.renderItems=function(t){var e=this.attributes,n=e.click,r=e.mouseenter,i=e.mouseleave;this.flattenPage(t);var o=this.dispatchCustomEvent.bind(this);ym(t).selectAll(_y.item.class).data(this.renderData,(function(t){return t.id})).join((function(t){return t.append((function(t){var e=t.style;return new yy({style:e})})).attr("className",_y.item.name).on("click",(function(){null==n||n(this),o("itemClick",{item:this})})).on("pointerenter",(function(){null==r||r(this),o("itemMouseenter",{item:this})})).on("pointerleave",(function(){null==i||i(this),o("itemMouseleave",{item:this})}))}),(function(t){return t.each((function(t){var e=t.style;this.update(e)}))}),(function(t){return t.remove()}))},e.prototype.relayoutNavigator=function(){var t,e=this.attributes,n=e.layout,r=e.width,i=(null===(t=this.pageViews.children[0])||void 0===t?void 0:t.getBBox().height)||0,o=u(this.navigatorShape,2),a=o[0],s=o[1];this.navigator.update("grid"===n?{pageWidth:r-a,pageHeight:i-s}:{})},e.prototype.adjustLayout=function(){var t,e,n=this,r=Object.entries((t=this.itemsLayout,e="page",t.reduce((function(t,n){return(t[n[e]]=t[n[e]]||[]).push(n),t}),{}))).map((function(t){var e=u(t,2);return{page:e[0],layouts:e[1]}})),i=f([],u(this.navigator.getContainer().children),!1);r.forEach((function(t){var e=t.layouts,r=n.pageViews.appendChild(new Ts({className:_y.page.name}));e.forEach((function(t){var e=t.x,n=t.y,o=t.index,a=t.width,s=t.height,c=i[o];r.appendChild(c),function(t,e,n){var r=t,i=Me(e)?e.split("."):e;i.forEach((function(t,e){e<i.length-1?(ve(r[t])||(r[t]=Ae(i[e+1])?[]:{}),r=r[t]):r[t]=n}))}(c,"__layout__",t),c.update({x:e,y:n,width:a,height:s})}))})),this.relayoutNavigator()},e.prototype.renderNavigator=function(t){var e=this.attributes.orientation,n=Tm(this.attributes,"nav"),r=Gg({orientation:e},n),i=this;return t.selectAll(_y.navigator.class).data(["nav"]).join((function(t){return t.append((function(){return new gy({style:r})})).attr("className",_y.navigator.name).each((function(){i.navigator=this}))}),(function(t){return t.each((function(){this.update(r)}))}),(function(t){return t.remove()})),this.navigator},e.prototype.getBBox=function(){return this.navigator.getBBox()},e.prototype.render=function(t,e){var n=this.attributes.data;if(n&&0!==n.length){var r=this.renderNavigator(ym(e));this.renderItems(r.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(t,e){var n=new Ga(t,{detail:e});this.dispatchEvent(n)},e}(wm),xy=Ug({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),My={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},Sy=function(t){function e(e){return t.call(this,e,My)||this}return r(e,t),e.prototype.render=function(t,e){var n=ym(e).maybeAppendByClassName(xy.markerGroup,"g");this.renderMarker(n);var r=ym(e).maybeAppendByClassName(xy.labelGroup,"g");this.renderLabel(r)},e.prototype.renderMarker=function(t){var e=this,n=this.attributes,r=n.orientation,o=n.markerSymbol,a=void 0===o?my(r,"horizontalHandle","verticalHandle"):o;Kg(!!a,t,(function(t){var n=Tm(e.attributes,"marker"),r=i({symbol:a},n);e.marker=t.maybeAppendByClassName(xy.marker,(function(){return new Um({style:r})})).update(r)}))},e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.showLabel,a=n.orientation,s=n.spacing,c=void 0===s?0:s,l=n.formatter;Kg(r,t,(function(t){var n,r=Tm(e.attributes,"label"),s=r.text,f=o(r,["text"]),d=(null===(n=t.select(xy.marker.class))||void 0===n?void 0:n.node().getBBox())||{},h=d.width,p=void 0===h?0:h,g=d.height,m=u(my(a,[0,(void 0===g?0:g)+c,"center","top"],[p+c,0,"start","middle"]),4),v=m[0],y=m[1],_=m[2],b=m[3];t.maybeAppendByClassName(xy.label,"text").styles(i(i({},f),{x:v,y:y,text:l(s).toString(),textAlign:_,textBaseline:b}))}))},e}(wm),Ay={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},Ty=Gg({},Ay,{}),Oy=Gg({},Ay,Om(My,"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"}),Ry=Ug({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"),Py=function(t){function e(e){return t.call(this,e,Ty)||this}return r(e,t),e.prototype.renderTitle=function(t,e,n){var r=this.attributes,o=r.showTitle,a=r.titleText,s=u(Rm(Tm(this.attributes,"title")),2),c=s[0],l=s[1];this.titleGroup=t.maybeAppendByClassName(Ry.titleGroup,"g").styles(l);var f=i(i({width:e,height:n},c),{text:o?a:""});this.title=this.titleGroup.maybeAppendByClassName(Ry.title,(function(){return new uy({style:f})})).update(f)},e.prototype.renderItems=function(t,e){var n=e.x,r=e.y,o=e.width,a=e.height,s=u(Rm(Tm(this.attributes,"title",!0)),2),c=s[0],l=s[1],f=i(i({},c),{width:o,height:a,x:0,y:0});this.itemsGroup=t.maybeAppendByClassName(Ry.itemsGroup,"g").styles(i({x:n,y:r},l));var d=this;this.itemsGroup.selectAll(Ry.items.class).data(["items"]).join((function(t){return t.append((function(){return new Ey({style:f})})).attr("className",Ry.items.name).each((function(){d.items=ym(this)}))}),(function(t){return t.update(f)}),(function(t){return t.remove()}))},e.prototype.adjustLayout=function(){if(this.attributes.showTitle){var t=this.title.node().getAvailableSpace(),e=t.x,n=t.y;this.itemsGroup.node().setLocalPosition(e,n)}},Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes,e=t.showTitle,n=t.width,r=t.height;return e?this.title.node().getAvailableSpace():new Dg(0,0,n,r)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e,n,r=null===(e=this.title)||void 0===e?void 0:e.node(),i=null===(n=this.items)||void 0===n?void 0:n.node();return r&&i?function(t,e){var n=t.attributes,r=n.position,i=n.spacing,o=n.inset,a=n.text,s=t.getBBox(),c=e.getBBox(),l=cy(r),f=u(bm(a?i:0),4),d=f[0],h=f[1],p=f[2],g=f[3],m=u(bm(o),4),v=m[0],y=m[1],_=m[2],b=m[3],E=u([g+h,d+p],2),x=E[0],M=E[1],S=u([b+y,v+_],2),A=S[0],T=S[1];if("l"===l[0])return new Dg(s.x,s.y,c.width+s.width+x+A,Math.max(c.height+T,s.height));if("t"===l[0])return new Dg(s.x,s.y,Math.max(c.width+A,s.width),c.height+s.height+M+T);var O=u([e.attributes.width||c.width,e.attributes.height||c.height],2),R=O[0],P=O[1];return new Dg(c.x,c.y,R+s.width+x+A,P+s.height+M+T)}(r,i):t.prototype.getBBox.call(this)},e.prototype.render=function(t,e){var n=t.width,r=t.height,i=ym(e);this.renderTitle(i,n,r),this.renderItems(i,this.availableSpace),this.adjustLayout()},e}(wm),Cy={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},wy=Ug({background:"background",labelGroup:"label-group",label:"label"},"indicator"),Ny=function(t){function e(e){var n=t.call(this,e,Cy)||this;return n.point=[0,0],n.group=n.appendChild(new Ts({})),n.isMutationObserved=!0,n}return r(e,t),e.prototype.renderBackground=function(){if(this.label){var t=this.attributes,e=t.position,n=u(bm(t.padding),4),r=n[0],o=n[1],a=n[2],s=n[3],c=this.label.node().getLocalBounds(),l=c.min,f=c.max,d=[[l[0]-s,l[1]-r],[f[0]+o,f[1]+a]],h=this.getPath(e,d),p=Tm(this.attributes,"background");this.background=ym(this.group).maybeAppendByClassName(wy.background,"path").styles(i(i({},p),{path:h})),this.group.appendChild(this.label.node())}},e.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,r=u(Rm(Tm(this.attributes,"label")),2),i=r[0],a=r[1];i.text;var s=o(i,["text"]);(this.label=ym(this.group).maybeAppendByClassName(wy.labelGroup,"g").styles(a),n)&&this.label.maybeAppendByClassName(wy.label,(function(){return qg(e(n))})).style("text",e(n).toString()).selectAll("text").styles(s)},e.prototype.adjustLayout=function(){var t=u(this.point,2),e=t[0],n=t[1];this.group.attr("x",-e).attr("y",-n)},e.prototype.getPath=function(t,e){var n=this,r=u(e,2),i=u(r[0],2),o=i[0],a=i[1],s=u(r[1],2),c=s[0],l=s[1],d={top:[[o,a],[c,a]],right:[[c,a],[c,l]],bottom:[[c,l],[o,l]],left:[[o,l],[o,a]]},h={top:"bottom",right:"left",bottom:"top",left:"right"},p=Object.entries(d).map((function(e){var r=u(e,2),i=r[0],o=r[1];return i===h[t]?n.createCorner(o):[f(["M"],u(o[0]),!1),f(["L"],u(o[1]),!1)]}));return p.push([["Z"]]),p.flat().filter((function(t,e,n){return 0===e||"M"!==t[0]}))},e.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=xm.apply(void 0,f([],u(t),!1)),r=u(t,2),i=u(r[0],2),o=i[0],a=i[1],s=u(r[1],2),c=s[0],l=s[1],d=u(n?[c-o,[o,c]]:[l-a,[a,l]],2),h=d[0],p=u(d[1],2),g=p[0],m=p[1],v=h/2,y=e*(h/Math.abs(h)),_=y/2,b=y*Math.sqrt(3)/2*.8,E=u([g,g+v-_,g+v,g+v+_,m],5),x=E[0],M=E[1],S=E[2],A=E[3],T=E[4];return n?(this.point=[S,a-b],[["M",x,a],["L",M,a],["L",S,a-b],["L",A,a],["L",T,a]]):(this.point=[o+b,S],[["M",o,x],["L",o,M],["L",o+b,S],["L",o,A],["L",o,T]])},e.prototype.bindEvents=function(){this.label.on(Xa.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout()},e}(wm);function Iy(t,e){var n=u(function(t,e){for(var n=1;n<t.length;n+=1){var r=t[n-1],i=t[n];if(e>=r&&e<=i)return[r,i]}return[e,e]}(t,e),2),r=n[0],i=n[1];return{tick:e>(r+i)/2?i:r,range:[r,i]}}var ky=Ug({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function Ly(t){var e=t.orientation,n=t.size,r=t.length;return my(e,[r,n],[n,r])}function Dy(t){var e=t.type,n=u(Ly(t),2),r=n[0],i=n[1];return"size"===e?[["M",0,i],["L",0+r,0],["L",0+r,i],["Z"]]:[["M",0,i],["L",0,0],["L",0+r,0],["L",0+r,i],["Z"]]}function By(t){return Dy(t)}function Fy(t){var e,n=t.orientation,r=t.color,i=t.block,o=t.partition;if(de(r)){e=new Array(20).fill(0).map((function(t,e,n){return r(e/(n.length-1))}))}else e=r;var a=e.length,s=e.map((function(t){return Ri(t).toString()}));return a?1===a?s[0]:i?function(t,e,n){var r=Array.from(e),i=t.length;return new Array(i).fill(0).reduce((function(e,n,o){var a=r[o%r.length];return e+" ".concat(t[o],":").concat(a).concat(o<i-1?" ".concat(t[o+1],":").concat(a):"")}),"l(".concat("horizontal"===n?"0":"270",")"))}(o,s,n):s.reduce((function(t,e,n){return t+" ".concat(n/(a-1),":").concat(e)}),"l(".concat(my(n,"0","270"),")")):""}function Uy(t){var e=t.orientation,n=t.range;if(!n)return[];var r=u(Ly(t),2),i=r[0],o=r[1],a=u(n,2),s=a[0],c=a[1],l=my(e,s*i,0),f=my(e,0,s*o),d=my(e,c*i,i),h=my(e,o,c*o);return[["M",l,f],["L",l,h],["L",d,h],["L",d,f],["Z"]]}var jy,Gy,Wy,zy,Vy=function(t){function e(e){return t.call(this,e,{type:"color",orientation:"horizontal",size:30,range:[0,1],length:200,block:!1,partition:[],color:["#fff","#000"],trackFill:"#e5e5e5"})||this}return r(e,t),e.prototype.render=function(t,e){!function(t,e){var n=Tm(e,"track");t.maybeAppendByClassName(ky.track,"path").styles(i({path:Dy(e)},n))}(ym(e).maybeAppendByClassName(ky.trackGroup,"g"),t),function(t,e){var n=Tm(e,"selection"),r=Fy(e),o=t.maybeAppendByClassName(ky.selection,"path").styles(i({path:By(e),fill:r},n)),a=o.maybeAppendByClassName(ky.clipPath,"path").styles({path:Uy(e)}).node();o.style("clip-path",a)}(ym(e).maybeAppendByClassName(ky.selectionGroup,"g"),t)},e}(wm),Hy=Ue((function(t){return{min:Math.min.apply(Math,f([],u(t.map((function(t){return t.value}))),!1)),max:Math.max.apply(Math,f([],u(t.map((function(t){return t.value}))),!1))}}),(function(t){return t.map((function(t){return t.id}))})),Xy=function(t){function e(e){var n=t.call(this,e,Oy)||this;return n.eventToOffsetScale=new ep({}),n.innerRibbonScale=new ep({}),n.cacheLabelBBox=null,n.cacheHandleBBox=null,n.onHovering=function(t){var e=n.attributes,r=e.data,i=e.block;t.stopPropagation();var o=n.getValueByCanvasPoint(t);if(i){var a=Iy(r.map((function(t){return t.value})),o).range;n.showIndicator((a[0]+a[1])/2,"".concat(a[0],"-").concat(a[1])),n.dispatchIndicated(o,a)}else{var s=n.getTickValue(o);n.showIndicator(s),n.dispatchIndicated(s)}},n.onDragStart=function(t){return function(e){e.stopPropagation(),n.attributes.slidable&&(n.target=t,n.prevValue=n.getTickValue(n.getValueByCanvasPoint(e)),document.addEventListener("mousemove",n.onDragging),document.addEventListener("touchmove",n.onDragging),document.addEventListener("mouseleave",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("touchend",n.onDragEnd))}},n.onDragging=function(t){var e=n.target;n.updateMouse();var r=u(n.selection,2),i=r[0],o=r[1],a=n.getTickValue(n.getValueByCanvasPoint(t)),s=a-n.prevValue;"start"===e?i!==a&&n.updateSelection(a,o):"end"===e?o!==a&&n.updateSelection(i,a):"ribbon"===e&&0!==s&&(n.prevValue=a,n.updateSelection(s,s,!0))},n.onDragEnd=function(){n.style.cursor="default",document.removeEventListener("mousemove",n.onDragging),document.removeEventListener("touchmove",n.onDragging),document.removeEventListener("mouseup",n.onDragEnd),document.removeEventListener("touchend",n.onDragEnd)},n}return r(e,t),Object.defineProperty(e.prototype,"handleOffsetRatio",{get:function(){return this.ifHorizontal(.5,.5)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var t=this.attributes,e=t.width,n=t.height;return new Dg(0,0,e,n)},e.prototype.render=function(t,e){var n=this,r=t.showLabel;this.renderTitle(ym(e));var i=this.availableSpace,o=i.x,a=i.y,s=ym(e).maybeAppendByClassName(Ry.contentGroup,"g").styles({x:o,y:a});Kg(!!r,s.maybeAppendByClassName(Ry.labelGroup,"g").styles({zIndex:1}),(function(t){n.renderLabel(t)}));var c=s.maybeAppendByClassName(Ry.ribbonGroup,"g").styles({zIndex:0});this.handlesGroup=s.maybeAppendByClassName(Ry.handlesGroup,"g").styles({zIndex:2}),this.renderHandles(),this.renderRibbon(c),this.renderIndicator(s),this.adjustLabel(),this.adjustHandles()},Object.defineProperty(e.prototype,"range",{get:function(){var t=this.attributes,e=t.data,n=t.domain;return n?{min:n[0],max:n[1]}:Hy(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonScale",{get:function(){var t=this.range,e=t.min,n=t.max;return this.innerRibbonScale.update({domain:[e,n],range:[0,1]}),this.innerRibbonScale},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonRange",{get:function(){var t=u(this.selection,2),e=t[0],n=t[1],r=this.ribbonScale;return[r.map(e),r.map(n)]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){var t=this.range,e=t.min,n=t.max,r=this.attributes.defaultValue,i=u(void 0===r?[e,n]:r,2);return[i[0],i[1]]},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return my(this.attributes.orientation,"function"==typeof t?t():t,"function"==typeof e?e():e)},e.prototype.renderTitle=function(t){var e=this.attributes,n=e.showTitle,r=e.titleText,o=e.width,a=e.height,s=Tm(this.attributes,"title"),c=i(i({},s),{width:o,height:a,text:r}),l=this;t.selectAll(Ry.title.class).data(n?[r]:[]).join((function(t){return t.append((function(){return new uy({style:c})})).attr("className",Ry.title.name).each((function(){l.title=this}))}),(function(t){return t.update(c)}),(function(t){return t.each((function(){l.title=void 0})).remove()}))},Object.defineProperty(e.prototype,"availableSpace",{get:function(){if(this.title)return this.title.getAvailableSpace();var t=this.attributes,e=t.width,n=t.height;return new Dg(0,0,e,n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelFixedSpacing",{get:function(){return this.attributes.showTick?5:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelPosition",{get:function(){var t=this.attributes,e=t.orientation,n=t.labelDirection;return{vertical:{positive:"right",negative:"left"},horizontal:{positive:"bottom",negative:"top"}}[e][n]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelBBox",{get:function(){var t;if(!this.attributes.showLabel)return new Dg(0,0,0,0);if(this.cacheLabelBBox)return this.cacheLabelBBox;var e=(null===(t=this.label.querySelector(uv.labelGroup.class))||void 0===t?void 0:t.children.slice(-1)[0]).getBBox(),n=e.width,r=e.height;return this.cacheLabelBBox=new Dg(0,0,n,r),this.cacheLabelBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelShape",{get:function(){var t=this.attributes,e=t.showLabel,n=t.labelSpacing,r=void 0===n?0:n;if(!e)return{width:0,height:0,size:0,length:0};var i=this.labelBBox,o=i.width,a=i.height;return{width:o,height:a,size:this.ifHorizontal(a,o)+r+this.labelFixedSpacing,length:this.ifHorizontal(o,a)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonBBox",{get:function(){var t=this.attributes,e=t.showHandle,n=t.ribbonSize,r=this.availableSpace,i=r.width,o=r.height,a=this.labelShape,s=a.size,c=a.length,l=u(this.ifHorizontal([o,i],[i,o]),2),f=l[0],d=l[1],h=e?this.handleShape:{size:0,length:0},p=h.size,g=h.length,m=this.handleOffsetRatio,v=0,y=this.labelPosition;v=n||(["bottom","right"].includes(y)?Math.min(f-s,(f-p)/m):f*(1-m)>p?Math.max(f-s,0):Math.max((f-s-p)/m,0));var _=Math.max(g,c),b=d-_,E=u(this.ifHorizontal([b,v],[v,b]),2),x=E[0],M=E[1],S=["top","left"].includes(y)?s:0,A=u(this.ifHorizontal([_/2,S],[S,_/2]),2),T=A[0],O=A[1];return new Dg(T,O,x,M)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonShape",{get:function(){var t=this.ribbonBBox,e=t.width,n=t.height;return this.ifHorizontal({size:n,length:e},{size:e,length:n})},enumerable:!1,configurable:!0}),e.prototype.renderRibbon=function(t){var e=this.attributes,n=e.data,r=e.type,i=e.orientation,o=e.color,a=e.block,s=Tm(this.attributes,"ribbon"),c=this.range,l=c.min,u=c.max,f=this.ribbonBBox,d=f.x,h=f.y,p=this.ribbonShape,g=p.length,m=p.size,v=Gg({x:d,y:h,length:g,size:m,type:r,orientation:i,color:o,block:a,partition:n.map((function(t){return(t.value-l)/(u-l)})),range:this.ribbonRange},s);this.ribbon=t.maybeAppendByClassName(Ry.ribbon,(function(){return new Vy({style:v})})).update(v)},e.prototype.getHandleClassName=function(t){return"".concat(Ry.prefix("".concat(t,"-handle")))},e.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,n=t.orientation,r=Tm(this.attributes,"handle"),o=u(this.selection,2),a=o[0],s=o[1],c=i(i({},r),{orientation:n}),l=r.shape,f="basic"===(void 0===l?"slider":l)?Sy:av,d=this;this.handlesGroup.selectAll(Ry.handle.class).data(e?[{value:a,type:"start"},{value:s,type:"end"}]:[],(function(t){return t.type})).join((function(t){return t.append((function(){return new f({style:c})})).attr("className",(function(t){var e=t.type;return"".concat(Ry.handle," ").concat(d.getHandleClassName(e))})).each((function(t){var e=t.type,n=t.value;this.update({labelText:n});var r="".concat(e,"Handle");d[r]=this,this.addEventListener("pointerdown",d.onDragStart(e))}))}),(function(t){return t.update(c).each((function(t){var e=t.value;this.update({labelText:e})}))}),(function(t){return t.each((function(t){var e=t.type,n="".concat(e,"Handle");d[n]=void 0})).remove()}))},e.prototype.adjustHandles=function(){var t=u(this.selection,2),e=t[0],n=t[1];this.setHandlePosition("start",e),this.setHandlePosition("end",n)},e.prototype.adjustTitle=function(){var t=this.attributes,e=t.titlePosition,n=t.orientation,r=u(this.getElementsByClassName(Ry.title.name),1)[0],i=this.handlesGroup.select(".".concat(this.getHandleClassName("start"))).node();if(r&&i&&"top-left"===e&&"horizontal"===n){var o=u(i.getLocalBounds().min,1)[0]-u(r.getLocalBounds().min,1)[0];r.style.x=+(this.style.x||0)+o}},Object.defineProperty(e.prototype,"handleBBox",{get:function(){if(this.cacheHandleBBox)return this.cacheHandleBBox;if(!this.attributes.showHandle)return new Dg(0,0,0,0);var t=this.startHandle.getBBox(),e=t.width,n=t.height,r=this.endHandle.getBBox(),i=r.width,o=r.height,a=u([Math.max(e,i),Math.max(n,o)],2),s=a[0],c=a[1];return this.cacheHandleBBox=new Dg(0,0,s,c),this.cacheHandleBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"handleShape",{get:function(){var t=this.handleBBox,e=t.width,n=t.height,r=u(this.ifHorizontal([n,e],[e,n]),2);return{width:e,height:n,size:r[0],length:r[1]}},enumerable:!1,configurable:!0}),e.prototype.setHandlePosition=function(t,e){var n=this.attributes.handleFormatter,r=this.ribbonBBox,i=r.x,o=r.y,a=this.ribbonShape.size,s=this.getOffset(e),c=u(this.ifHorizontal([i+s,o+a*this.handleOffsetRatio],[i+a*this.handleOffsetRatio,o+s]),2),l=c[0],f=c[1],d=this.handlesGroup.select(".".concat(this.getHandleClassName(t))).node();null==d||d.update({x:l,y:f,formatter:n})},e.prototype.renderIndicator=function(t){var e=Tm(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(Ry.indicator,(function(){return new Ny({})})).update(e)},Object.defineProperty(e.prototype,"labelData",{get:function(){var t=this;return this.attributes.data.reduce((function(e,n,r,o){var a,s,c=null!==(a=null==n?void 0:n.id)&&void 0!==a?a:r.toString();if(e.push(i(i({},n),{id:c,index:r,type:"value",label:null!==(s=null==n?void 0:n.label)&&void 0!==s?s:n.value.toString(),value:t.ribbonScale.map(n.value)})),r<o.length-1){var l=o[r+1],f=u([n.value,l.value],2),d=f[0],h=f[1],p=(d+h)/2;e.push(i(i({},n),{id:c,index:r,type:"range",range:[d,h],label:[d,h].join("~"),value:t.ribbonScale.map(p)}))}return e}),[])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelStyle",{get:function(){var t=u(["center","middle"],2),e=t[0],n=t[1],r=this.labelPosition;return"top"===r?n="bottom":"bottom"===r?n="top":"left"===r?e="end":"right"===r&&(e="start"),{labelTextAlign:e,labelTextBaseline:n}},enumerable:!1,configurable:!0}),e.prototype.renderLabel=function(t){var e=this.attributes,n=e.showTick,r=void 0!==n&&n,o=e.labelFilter,a=e.labelFormatter,s=Tm(this.attributes,"tick"),c=Tm(this.attributes,"label"),l=c.align,u=Gg(i({showLine:!1,showGrid:!1,showTick:r,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),Om(s,"tick"),Om(c,"label"),{data:this.labelData}),f={tickFilter:function(t,e,n){return"value"===(null==t?void 0:t.type)&&(!o||o(t,t.index,n.filter((function(t){return"value"!==t.type}))))},labelFilter:function(t,e,n){return(null==t?void 0:t.type)===l&&(!o||o(t,t.index,n.filter((function(t){return t.type===l}))))},labelFormatter:a},d=i(i(i({},u),f),{labelOverlap:[{type:"hide"}]});this.label=t.maybeAppendByClassName(Ry.label,(function(){return new hy({style:d})})).node(),this.label.update(d,!1)},Object.defineProperty(e.prototype,"labelAxisStyle",{get:function(){var t=this.attributes,e=t.showTick,n=t.labelDirection,r=t.labelSpacing,i=t.tickLength,o=this.ribbonShape.size,a=this.labelPosition,s=this.labelFixedSpacing,c=u([0,0,0],3),l=c[0];c[1];var f=c[2],d=null!=i?i:o;return e?(f=d,"positive"===n?"right"===a?(l=d,f=d):"bottom"===a&&(l=f):"negative"===n&&("top"===a||"left"===a)&&(l=o)):"positive"===n&&("right"===a||"bottom"===a&&(l=o+s)),{offset:l,spacing:r,tickLength:f}},enumerable:!1,configurable:!0}),e.prototype.adjustLabel=function(){if(this.attributes.showLabel){var t=this.ribbonBBox,e=t.x,n=t.y,r=t.width,i=t.height,o=this.labelAxisStyle,a=o.offset,s=o.spacing,c=o.tickLength,l=u(this.ifHorizontal([[e,n+a],[e+r,n+a]],[[e+a,n+i],[e+a,n]]),2),f=l[0],d=l[1];this.label.update({startPos:f,endPos:d,tickLength:c,labelSpacing:s},!1)}},e.prototype.bindEvents=function(){this.ribbon.on("pointerdown",this.onDragStart("ribbon")),this.ribbon.on("pointermove",this.onHovering),this.addEventListener("pointerout",this.hideIndicator)},e.prototype.showIndicator=function(t,e){if(void 0===e&&(e="".concat(t)),this.attributes.showIndicator&&"number"==typeof t){var n=this.range,r=n.min,i=n.max,o=this.ribbonBBox,a=o.x,s=o.y,c=Se(t,r,i),l=this.getOffset(c),u=this.ifHorizontal([l+a,s],[a,l+s]);this.indicator.update({x:u[0],y:u[1],position:this.ifHorizontal("top","left"),labelText:e}),Rg(this.indicator.node())}else this.hideIndicator()},e.prototype.hideIndicator=function(){Pg(this.indicator.node())},e.prototype.updateMouse=function(){this.attributes.slidable&&(this.style.cursor="grabbing")},e.prototype.setSelection=function(t,e){this.updateSelection(t,e)},e.prototype.updateSelection=function(t,e,n){var r;void 0===n&&(n=!1);var i=u(this.selection,2),o=i[0],a=i[1],s=u([t,e],2),c=s[0],l=s[1];n&&(c+=o,l+=a);var f=this.range;r=u(function(t,e,n,r){var i,o=u(t,2),a=o[0],s=o[1],c=u(e,2),l=c[0],f=c[1],d=u(n,2),h=d[0],p=d[1],g=u([l,f],2),m=g[0],v=g[1],y=v-m;return m>v&&(m=(i=u([v,m],2))[0],v=i[1]),y>s-a?[a,s]:m<a?h===a&&p===v?[a,v]:[a,y+a]:v>s?p===s&&h===m?[m,s]:[s-y,s]:[m,v]}([f.min,f.max],[c,l],this.selection),2),c=r[0],l=r[1],this.update({defaultValue:[c,l]}),this.dispatchSelection()},Object.defineProperty(e.prototype,"step",{get:function(){var t=this.attributes.step,e=void 0===t?1:t,n=this.range,r=n.min,i=n.max;return Le(e)?um(.01*(i-r),0):e},enumerable:!1,configurable:!0}),e.prototype.getTickValue=function(t){var e=this.attributes,n=e.data,r=e.block,i=this.range.min;return r?Iy(n.map((function(t){return t.value})),t).tick:function(t,e,n){return n+Math.round((t-n)/e)*e}(t,this.step,i)},e.prototype.getValueByCanvasPoint=function(t,e){var n=this.range,r=n.min,i=n.max,o=u(this.ribbon.node().getPosition(),2),a=o[0],s=o[1],c=this.ifHorizontal(a,s),l=this.ifHorizontal.apply(this,f([],u($g(t)),!1))-c;return Se(this.getOffset(l,!0),r,i)},e.prototype.getOffset=function(t,e){void 0===e&&(e=!1);var n=this.range,r=n.min,i=n.max,o=this.ribbonShape.length,a=this.eventToOffsetScale;return a.update({domain:[r,i],range:[0,o]}),e?a.invert(t):a.map(t)},e.prototype.dispatchSelection=function(){var t=new Ga("valuechange",{detail:{value:this.selection}});this.dispatchEvent(t)},e.prototype.dispatchIndicated=function(t,e){var n=new Ga("indicate",{detail:{value:t,range:e}});this.dispatchEvent(n)},e}(wm);function Yy(t){jy||(jy=document.createElement("table"),Gy=document.createElement("tr"),Wy=/^\s*<(\w+|!)[^>]*>/,zy={tr:document.createElement("tbody"),tbody:jy,thead:jy,tfoot:jy,td:Gy,th:Gy,"*":document.createElement("div")});var e=Wy.test(t)&&RegExp.$1;e&&e in zy||(e="*");var n=zy[e];t="string"==typeof t?t.replace(/(^\s*)|(\s*$)/g,""):t,n.innerHTML=""+t;var r=n.childNodes[0];return r&&n.contains(r)&&n.removeChild(r),r}function $y(t){return void 0===t&&(t=""),{CONTAINER:"".concat(t,"tooltip"),TITLE:"".concat(t,"tooltip-title"),LIST:"".concat(t,"tooltip-list"),LIST_ITEM:"".concat(t,"tooltip-list-item"),NAME:"".concat(t,"tooltip-list-item-name"),MARKER:"".concat(t,"tooltip-list-item-marker"),NAME_LABEL:"".concat(t,"tooltip-list-item-name-label"),VALUE:"".concat(t,"tooltip-list-item-value"),CROSSHAIR_X:"".concat(t,"tooltip-crosshair-x"),CROSSHAIR_Y:"".concat(t,"tooltip-crosshair-y")}}var qy={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function Ky(t){var e;void 0===t&&(t="");var n=$y(t);return(e={})[".".concat(n.CONTAINER)]={position:"absolute",visibility:"visible","z-index":8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)","background-color":"rgba(255, 255, 255, 0.96)","box-shadow":"0 6px 12px 0 rgba(0, 0, 0, 0.12)","border-radius":"4px",color:"rgba(0, 0, 0, 0.65)","font-size":"12px","line-height":"20px",padding:"12px","min-width":"120px","max-width":"360px","font-family":"Roboto-Regular"},e[".".concat(n.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},e[".".concat(n.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},e[".".concat(n.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},e[".".concat(n.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},e[".".concat(n.NAME)]={display:"flex","align-items":"center","max-width":"216px"},e[".".concat(n.NAME_LABEL)]=i({flex:1},qy),e[".".concat(n.VALUE)]=i({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},qy),e[".".concat(n.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e[".".concat(n.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e}var Zy=function(t){function e(e){var n,r,i=this,o=null===(r=null===(n=e.style)||void 0===n?void 0:n.template)||void 0===r?void 0:r.prefixCls,a=$y(o);return(i=t.call(this,e,{data:[],x:0,y:0,visibility:"visible",title:"",position:"bottom-right",offset:[5,5],enterable:!1,container:{x:0,y:0},bounding:null,template:{prefixCls:"",container:'<div class="'.concat(a.CONTAINER,'"></div>'),title:'<div class="'.concat(a.TITLE,'"></div>'),item:'<li class="'.concat(a.LIST_ITEM,'" data-index={index}>\n <span class="').concat(a.NAME,'">\n <span class="').concat(a.MARKER,'" style="background:{color}"></span>\n <span class="').concat(a.NAME_LABEL,'" title="{name}">{name}</span>\n </span>\n <span class="').concat(a.VALUE,'" title="{value}">{value}</span>\n </li>')},style:Ky(o)})||this).prevCustomContentKey=i.attributes.contentKey,i.initShape(),i.render(i.attributes,i),i}var n,s;return r(e,t),Object.defineProperty(e.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.element},Object.defineProperty(e.prototype,"position",{set:function(t){var e=u(t,2),n=e[0],r=e[1];this.attributes.x=n,this.attributes.y=r,this.updatePosition()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HTMLTooltipItemsElements",{get:function(){var t=this.attributes,e=t.data,n=t.template;return e.map((function(t,e){var r=t.name,a=void 0===r?"":r,s=t.color,c=void 0===s?"black":s,l=t.index,u=o(t,["name","color","index"]),f=i({name:a,color:c,index:null!=l?l:e},u);return Yy(function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,(function(t,n){return"\\"===t.charAt(0)?t.slice(1):void 0===e[n]?"":e[n]})):t}(n.item,f))}))},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},e.prototype.destroy=function(){var e;null===(e=this.element)||void 0===e||e.remove(),t.prototype.destroy.call(this)},e.prototype.show=function(t,e){var n=this;if(void 0!==t&&void 0!==e){var r=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(){n.element.style.transition=r}),10)}this.element.style.visibility="visible"},e.prototype.hide=function(){this.element.style.visibility="hidden"},e.prototype.initShape=function(){var t=this.attributes.template;this.element=Yy(t.container),this.id&&this.element.setAttribute("id",this.id)},e.prototype.renderCustomContent=function(){if(void 0===this.prevCustomContentKey||this.prevCustomContentKey!==this.attributes.contentKey){this.prevCustomContentKey=this.attributes.contentKey;var t=this.attributes.content;t&&("string"==typeof t?this.element.innerHTML=t:this.element.replaceChildren(t))}},e.prototype.renderHTMLTooltipElement=function(){var t,e,n=this.attributes,r=n.template,i=n.title,o=n.enterable,a=n.style,s=n.content,c=$y(r.prefixCls),l=this.element;if(this.element.style.pointerEvents=o?"auto":"none",s)this.renderCustomContent();else{i?(l.innerHTML=r.title,l.getElementsByClassName(c.TITLE)[0].innerHTML=i):null===(e=null===(t=l.getElementsByClassName(c.TITLE))||void 0===t?void 0:t[0])||void 0===e||e.remove();var d=this.HTMLTooltipItemsElements,h=document.createElement("ul");h.className=c.LIST,h.replaceChildren.apply(h,f([],u(d),!1));var p=this.element.querySelector(".".concat(c.LIST));p?p.replaceWith(h):l.appendChild(h)}!function(t,e){Object.entries(e).forEach((function(e){var n=u(e,2),r=n[0],i=n[1];f([t],u(t.querySelectorAll(r)),!1).filter((function(t){return t.matches(r)})).forEach((function(t){t&&(t.style.cssText+=Object.entries(i).reduce((function(t,e){return"".concat(t).concat(e.join(":"),";")}),""))}))}))}(l,a)},e.prototype.getRelativeOffsetFromCursor=function(t){var e=this.attributes,n=e.position,r=e.offset,i=(t||n).split("-"),o={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},a=this.elementSize,s=a.width,c=a.height,l=[-s/2,-c/2];return i.forEach((function(t){var e=u(l,2),n=e[0],i=e[1],a=u(o[t],2),f=a[0],d=a[1];l=[n+(s/2+r[0])*f,i+(c/2+r[1])*d]})),l},e.prototype.setOffsetPosition=function(t){var e=u(t,2),n=e[0],r=e[1],i=this.attributes,o=i.x,a=void 0===o?0:o,s=i.y,c=void 0===s?0:s,l=i.container,f=l.x,d=l.y;this.element.style.left="".concat(+a+f+n,"px"),this.element.style.top="".concat(+c+d+r,"px")},e.prototype.updatePosition=function(){this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor()))},e.prototype.autoPosition=function(t){var e=u(t,2),n=e[0],r=e[1],i=this.attributes,o=i.x,a=i.y,s=i.bounding,c=i.position;if(!s)return[n,r];var l=this.element,f=l.offsetWidth,d=l.offsetHeight,h=u([+o+n,+a+r],2),p=h[0],g=h[1],m={left:"right",right:"left",top:"bottom",bottom:"top"},v=s.x,y=s.y,_={left:p<v,right:p+f>v+s.width,top:g<y,bottom:g+d>y+s.height},b=[];c.split("-").forEach((function(t){_[t]?b.push(m[t]):b.push(t)}));var E=b.join("-");return this.getRelativeOffsetFromCursor(E)},e.tag="tooltip",a([(n=100,s=!0,void 0===n&&(n=0),void 0===s&&(s=!1),function(t,e,r){var i,o=r.value;"function"==typeof o&&(r.value=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!i){var r=this;s&&o.apply(r,t),i=window.setTimeout((function(){o.apply(r,t),i=null}),n)}})})],e.prototype,"updatePosition",null),e}(wm),Qy=function(t){function e(e){var n=t.call(this,e)||this;n.layoutEvents=[Xa.BOUNDS_CHANGED,Xa.INSERTED,Xa.REMOVED],n.$margin=bm(0),n.$padding=bm(0);var r=e.style||{},i=r.margin,o=void 0===i?0:i,a=r.padding,s=void 0===a?0:a;return n.margin=o,n.padding=s,n.isMutationObserved=!0,n.bindEvents(),n}return r(e,t),Object.defineProperty(e.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=bm(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=bm(t)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var t=this.attributes,e=t.x,n=void 0===e?0:e,r=t.y,i=void 0===r?0:r,o=t.width,a=t.height,s=u(this.$margin,4),c=s[0],l=s[1],f=s[2],d=s[3];return new Dg(n-d,i-c,o+d+l,a+c+f)},e.prototype.appendChild=function(e,n){return e.isMutationObserved=!0,t.prototype.appendChild.call(this,e,n),e},e.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,r=u(this.$padding,4),i=r[0],o=r[1],a=r[2],s=r[3],c=u(this.$margin,4),l=c[0],f=c[3];return new Dg(s+f,i+l,e-s-o,n-i-a)},e.prototype.layout=function(){if(this.attributes.display&&this.isConnected&&!this.children.some((function(t){return!t.isConnected})))try{var t=function(t,e,n){if(0===e.length)return[];var r={flex:em,grid:nm},i=n.display in r?r[n.display]:null;return(null==i?void 0:i.call(null,t,e,n))||[]}(this.getAvailableSpace(),this.children.map((function(t){return t.getBBox()})),this.attributes);this.children.forEach((function(e,n){var r=t[n],i=r.x,o=r.y;e.attr({x:i,y:o})}))}catch(t){}},e.prototype.bindEvents=function(){var t=this;this.layoutEvents.forEach((function(e){t.addEventListener(e,(function(e){e.target.isMutationObserved=!0,t.layout()}))}))},e.prototype.attributeChangedCallback=function(t,e,n){"margin"===t?this.margin=n:"padding"===t&&(this.padding=n),this.layout()},e}(Ts);function Jy(t){const{transformations:e}=t.getOptions();return e.map((([t])=>t)).filter((t=>"transpose"===t)).length%2!=0}function t_(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"polar"===t))}function e_(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"reflect"===t))&&e.some((([t])=>t.startsWith("transpose")))}function n_(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"helix"===t))}function r_(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"parallel"===t))}function i_(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"fisheye"===t))}function o_(t){return n_(t)||t_(t)}function a_(t){const{transformations:e}=t.getOptions(),[,,,n,r]=e.find((t=>"polar"===t[0]));return[+n,+r]}function s_(t,e=!0){const{transformations:n}=t.getOptions(),[,r,i]=n.find((t=>"polar"===t[0]));return e?[180*+r/Math.PI,180*+i/Math.PI]:[r,i]}function c_(t,e,n){return t.querySelector(e)?gf(t).select(e):gf(t).append(n)}function l_(t){return Array.isArray(t)?t.join(", "):`${t||""}`}function u_(t,e){let{flexDirection:n,justifyContent:r,alignItems:i}={display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"};const o={top:["row","flex-start","center"],bottom:["row","flex-start","center"],left:["column","center","center"],right:["column","center","center"],center:["column","center","center"]};return t in o&&([n,r,i]=o[t]),Object.assign({display:"flex",flexDirection:n,justifyContent:r,alignItems:i},e)}class f_ extends Qy{get child(){var t;return null===(t=this.children)||void 0===t?void 0:t[0]}update(t){var e;this.attr(t);const{subOptions:n}=t;null===(e=this.child)||void 0===e||e.update(n)}}class d_ extends f_{update(t){var e;const{subOptions:n}=t;this.attr(t),null===(e=this.child)||void 0===e||e.update(n)}}function h_(t,e){var n;return null===(n=t.filter((t=>t.getOptions().name===e)))||void 0===n?void 0:n[0]}function p_(t){return"vertical"===t||t===-Math.PI/2}function g_(t,e,n){const{bbox:r}=t,{position:i="top",size:o,length:a}=e,s=["top","bottom","center"].includes(i),[c,l]=s?[r.height,r.width]:[r.width,r.height],{defaultSize:u,defaultLength:f}=n.props,d=o||u||c,h=a||f||l,p=s?"horizontal":"vertical",[g,m]=s?[h,d]:[d,h];return{orientation:p,width:g,height:m,size:d,length:h}}function m_(t){const e=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"],{style:n}=t,r=o(t,["style"]),i={};return Object.entries(r).forEach((([t,n])=>{e.includes(t)?i[`show${Ie(t)}`]=n:i[t]=n})),Object.assign(Object.assign({},i),n)}function v_(t,e){const{eulerAngles:n,origin:r}=e;r&&t.setOrigin(r),n&&t.rotate(n[0],n[1],n[2])}function y_(t){const{innerWidth:e,innerHeight:n,depth:r}=t.getOptions();return[e,n,r]}function __(t){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}function b_(t,e,n,r,i,o,a,s){var c;void 0===n&&void 0===o||t.update(Object.assign(Object.assign({},n&&{tickCount:n}),o&&{tickMethod:o}));const l=function(t,e,n){if(t.getTicks)return t.getTicks();if(!n)return e;const[r,i]=vu(e,(t=>+t)),{tickCount:o}=t.getOptions();return n(r,i,o)}(t,e,o),u=i?l.filter(i):l,f=t=>t instanceof Date?String(t):"object"==typeof t&&t?t:String(t),d=r||(null===(c=t.getFormatter)||void 0===c?void 0:c.call(t))||f,h=function(t,e){if(t_(e))return t=>t;const n=e.getOptions(),{innerWidth:r,innerHeight:i,insetTop:o,insetBottom:a,insetLeft:s,insetRight:c}=n,[l,u,f]="left"===t||"right"===t?[o,a,i]:[s,c,r],d=new ep({domain:[0,1],range:[l/f,1-u/f]});return t=>d.map(t)}(a,s),p=function(t,e){const{width:n,height:r}=e.getOptions();return i=>{if(!i_(e))return i;const o="bottom"===t?[i,1]:[0,i],a=e.map(o);if("bottom"===t){const t=a[0];return new ep({domain:[0,n],range:[0,1]}).map(t)}if("left"===t){const t=a[1];return new ep({domain:[0,r],range:[0,1]}).map(t)}return i}}(a,s),g=t=>["left","right"].includes(t);return t_(s)||Jy(s)?u.map(((e,n,r)=>{var i,o;const c=(null===(i=t.getBandWidth)||void 0===i?void 0:i.call(t,e))/2||0,l=h(t.map(e)+c);return{value:e_(s)&&"center"===a||Jy(s)&&(null===(o=t.getTicks)||void 0===o?void 0:o.call(t))&&(t=>["top","bottom","center","outer"].includes(t))(a)||Jy(s)&&g(a)?1-l:l,label:f(d(__(e),n,r)),id:String(n)}})):u.map(((e,n,r)=>{var i;const o=(null===(i=t.getBandWidth)||void 0===i?void 0:i.call(t,e))/2||0,s=p(h(t.map(e)+o));return{value:g(a)?1-s:s,label:f(d(__(e),n,r)),id:String(n)}}))}function E_(t=[],e){if(t.length>0)return t;const{labelAutoRotate:n,labelAutoHide:r,labelAutoEllipsis:i,labelAutoWrap:o}=e,a=[],s=(t,e)=>{e&&a.push(Object.assign(Object.assign({},t),e))};return s({type:"rotate",optionalAngles:[0,15,30,45,60,90]},n),s({type:"ellipsis",minLength:20},i),s({type:"hide"},r),s({type:"wrap",wordWrapWidth:100,maxLines:3,recoveryWhenFail:!0},o),a}function x_(t,e,n){return!function(t){return t_(t)&&Jy(t)}(e)&&!r_(e)&&(void 0===t?!!n.getTicks:t)}function M_(t,e,n,r,i,o){const a=function(t,e,n,r,i,o){const a=n.axis,s=["top","right","bottom","left"].includes(i)?n[`axis${nf(i)}`]:n.axisLinear,c=t.getOptions().name,l=n[`axis${Ie(c)}`]||{};return Object.assign({},a,s,l)}(t,0,n,0,i);return"center"===i?Object.assign(Object.assign(Object.assign(Object.assign({},a),{labelDirection:"right"===r?"negative":"positive"}),"center"===r?{labelTransform:"translate(50%,0)"}:null),{tickDirection:"right"===r?"negative":"positive",labelSpacing:"center"===r?0:4,titleSpacing:p_(o)?10:0,tick:"center"!==r&&void 0}):a}const S_=t=>e=>{const{labelFormatter:n,labelFilter:r=(()=>!0)}=e;return i=>{var o;const{scales:[a]}=i,s=(null===(o=a.getTicks)||void 0===o?void 0:o.call(a))||a.getOptions().domain,c="string"==typeof n?Of(n):n,l=Object.assign(Object.assign({},e),{labelFormatter:c,labelFilter:(t,e,n)=>r(s[e],e,s),scale:a});return t(l)(i)}},A_=S_((t=>{const{direction:e="left",important:n={},labelFormatter:r,order:i,orientation:a,actualPosition:s,position:c,size:l,style:u={},title:f,tickCount:d,tickFilter:h,tickMethod:p,transform:g,indexBBox:m}=t,v=o(t,["direction","important","labelFormatter","order","orientation","actualPosition","position","size","style","title","tickCount","tickFilter","tickMethod","transform","indexBBox"]);return({scales:[i],value:o,coordinate:y,theme:_})=>{const{bbox:b}=o,{domain:E}=i.getOptions(),x=M_(i,0,_,e,c,a),M=Object.assign(Object.assign(Object.assign({},x),u),v),S=function(t,e,n="xy"){const[r,i,o]=y_(e);return"xy"===n?t.includes("bottom")||t.includes("top")?i:r:"xz"===n?t.includes("bottom")||t.includes("top")?o:r:t.includes("bottom")||t.includes("top")?i:o}(s||c,y,t.plane),A=function(t,e,n,r){const{x:i,y:o,width:a,height:s}=n;if("bottom"===t)return{startPos:[i,o],endPos:[i+a,o]};if("left"===t)return{startPos:[i+a,o+s],endPos:[i+a,o]};if("right"===t)return{startPos:[i,o+s],endPos:[i,o]};if("top"===t)return{startPos:[i,o+s],endPos:[i+a,o+s]};if("center"===t){if("vertical"===e)return{startPos:[i,o],endPos:[i,o+s]};if("horizontal"===e)return{startPos:[i,o],endPos:[i+a,o]};if("number"==typeof e){const[t,n]=r.getCenter(),[c,l]=a_(r),[u,f]=s_(r),d=Math.min(a,s)/2,{insetLeft:h,insetTop:p}=r.getOptions(),g=c*d,m=l*d,[v,y]=[t+i-h,n+o-p],[_,b]=[Math.cos(e),Math.sin(e)];return{startPos:[v+m*_,y+m*b],endPos:[v+g*_,y+g*b],gridClosed:f-u==360,gridCenter:[v,y],gridControlAngles:new Array(3).fill(0).map(((t,e,n)=>(f-u)/(n.length-1)*e))}}}return{}}(c,a,b,y),T=function(t){const{depth:e}=t.getOptions();return e?{tickIsBillboard:!0,lineIsBillboard:!0,labelIsBillboard:!0,titleIsBillboard:!0,gridIsBillboard:!0}:{}}(y),O=b_(i,E,d,r,h,p,c,y),R=m?O.map(((t,e)=>{const n=m.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t})):O,P=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},M),{type:"linear",data:R,crossSize:l,titleText:l_(f),labelOverlap:E_(g,M),grid:x_(M.grid,y,i),gridLength:S,line:!0,indexBBox:m}),M.line?null:{lineOpacity:0}),A),T),n),C=P.labelOverlap.find((t=>"hide"===t.type));return C&&(P.crossSize=!1),new hy({className:"axis",style:m_(P)})}})),T_=S_((t=>{const{order:e,size:n,position:r,orientation:i,labelFormatter:a,tickFilter:s,tickCount:c,tickMethod:l,important:u={},style:f={},indexBBox:d,title:h,grid:p=!1}=t,g=o(t,["order","size","position","orientation","labelFormatter","tickFilter","tickCount","tickMethod","important","style","indexBBox","title","grid"]);return({scales:[t],value:e,coordinate:n,theme:i})=>{const{bbox:o}=e,{domain:f}=t.getOptions(),m=b_(t,f,c,a,s,l,r,n),v=d?m.map(((t,e)=>{const n=d.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t})):m,[y,_]=a_(n),b=function(t,e,n,r,i){const{x:o,y:a,width:s,height:c}=e,l=[o+s/2,a+c/2],u=Math.min(s,c)/2,[f,d]=s_(i),[h,p]=y_(i),g={center:l,radius:u,startAngle:f,endAngle:d,gridLength:(r-n)*(Math.min(h,p)/2)};if("inner"===t){const{insetLeft:t,insetTop:e}=i.getOptions();return Object.assign(Object.assign({},g),{center:[l[0]-t,l[1]-e],labelAlign:"perpendicular",labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"})}return Object.assign(Object.assign({},g),{labelAlign:"parallel",labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"})}(r,o,y,_,n),{axis:E,axisArc:x={}}=i,M=m_(We({},E,x,b,Object.assign(Object.assign({type:"arc",data:v,titleText:l_(h),grid:p},g),u)));return new hy({style:Xe(M,["transform"])})}}));A_.props={defaultPosition:"center",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]},T_.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const O_=t=>(...e)=>{const n=A_(Object.assign({},{crossPadding:50},t))(...e);return v_(n,t),n};O_.props=Object.assign(Object.assign({},A_.props),{defaultPosition:"bottom"});const R_=t=>(...e)=>{const n=A_(Object.assign({},{crossPadding:10},t))(...e);return v_(n,t),n};R_.props=Object.assign(Object.assign({},A_.props),{defaultPosition:"left"});const P_=t=>(...e)=>{const n=A_(Object.assign({},{crossPadding:10},t))(...e);return v_(n,t),n};function C_(t,e,n,r){const{radar:i}=t,[o]=r,a=o.getOptions().name,[s,c]=s_(n),{axisRadar:l={}}=e;return Object.assign(Object.assign({},l),{grid:"position"===a,gridConnect:"line",gridControlAngles:new Array(i.count).fill(0).map(((t,e)=>(c-s)/i.count*e))})}P_.props=Object.assign(Object.assign({},A_.props),{defaultPosition:"bottom",defaultPlane:"yz"});const w_=t=>{const{important:e={}}=t,n=o(t,["important"]);return r=>{const{theme:i,coordinate:o,scales:a}=r;return A_(Object.assign(Object.assign(Object.assign({},n),function(t){const e=t%(2*Math.PI);return e===Math.PI/2?{titleTransform:"translate(0, 50%)"}:e>-Math.PI/2&&e<Math.PI/2?{titleTransform:"translate(50%, 0)"}:e>Math.PI/2&&e<3*Math.PI/2?{titleTransform:"translate(-50%, 0)"}:{}}(t.orientation)),{important:Object.assign(Object.assign({},C_(t,i,o,a)),e)}))(r)}};w_.props=Object.assign(Object.assign({},A_.props),{defaultPosition:"center"});const N_=(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"]];N_.style=["fill"];const I_=N_.bind(void 0);I_.style=["stroke","lineWidth"];const k_=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]];k_.style=["fill"];const L_=k_.bind(void 0);L_.style=["fill"];const D_=k_.bind(void 0);D_.style=["stroke","lineWidth"];const B_=(t,e,n)=>{const r=.618*n;return[["M",t-r,e],["L",t,e-n],["L",t+r,e],["L",t,e+n],["Z"]]};B_.style=["fill"];const F_=B_.bind(void 0);F_.style=["stroke","lineWidth"];const U_=(t,e,n)=>{const r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]};U_.style=["fill"];const j_=U_.bind(void 0);j_.style=["stroke","lineWidth"];const G_=(t,e,n)=>{const r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]};G_.style=["fill"];const W_=G_.bind(void 0);W_.style=["stroke","lineWidth"];const z_=(t,e,n)=>{const r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]};z_.style=["fill"];const V_=z_.bind(void 0);V_.style=["stroke","lineWidth"];const H_=(t,e,n)=>{const r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]};H_.style=["fill"];const X_=H_.bind(void 0);X_.style=["stroke","lineWidth"];const Y_=(t,e,n)=>[["M",t,e+n],["L",t,e-n]];Y_.style=["stroke","lineWidth"];const $_=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]];$_.style=["stroke","lineWidth"];const q_=(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]];q_.style=["stroke","lineWidth"];const K_=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]];K_.style=["stroke","lineWidth"];const Z_=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];Z_.style=["stroke","lineWidth"];const Q_=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];Q_.style=["stroke","lineWidth"];const J_=Q_.bind(void 0);J_.style=["stroke","lineWidth"];const tb=(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]];tb.style=["stroke","lineWidth"];const eb=(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]];eb.style=["stroke","lineWidth"];const nb=(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]];nb.style=["stroke","lineWidth"];const rb=(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]];rb.style=["stroke","lineWidth"];const ib=(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]];ib.style=["stroke","lineWidth"];const ob=new Map([["bowtie",H_],["cross",$_],["dash",J_],["diamond",B_],["dot",Q_],["hexagon",z_],["hollowBowtie",X_],["hollowDiamond",F_],["hollowHexagon",V_],["hollowPoint",I_],["hollowSquare",D_],["hollowTriangle",j_],["hollowTriangleDown",W_],["hv",eb],["hvh",rb],["hyphen",Z_],["line",Y_],["plus",K_],["point",N_],["rect",L_],["smooth",tb],["square",k_],["tick",q_],["triangleDown",G_],["triangle",U_],["vh",nb],["vhv",ib]]);function ab(t,e){const{scales:n,library:r,markState:i}=e,[a,s]=function(t,e){const n=h_(t,"shape"),r=h_(t,"color"),i=n?n.clone():null,o=[];for(const[t,n]of e){const e=t.type,a=((null==r?void 0:r.getOptions().domain.length)>0?null==r?void 0:r.getOptions().domain:n.data).map(((e,r)=>{var o;return i?i.map(e||"point"):(null===(o=null==t?void 0:t.style)||void 0===o?void 0:o.shape)||n.defaultShape||"point"}));"string"==typeof e&&o.push([e,a])}if(0===o.length)return["point",["point"]];if(1===o.length)return o[0];if(!n)return o[0];const{range:a}=n.getOptions();return o.map((([t,e])=>{let n=0;for(let t=0;t<o.length;t++){const r=a[t%a.length];e[t]===r&&n++}return[n/e.length,[t,e]]})).sort(((t,e)=>e[0]-t[0]))[0][1]}(n,i),{itemMarker:c,itemMarkerSize:l}=t,u=(t,e)=>{var n,i,s;const c=(null===(s=null===(i=null===(n=r[`mark.${a}`])||void 0===n?void 0:n.props)||void 0===i?void 0:i.shape[t])||void 0===s?void 0:s.props.defaultMarker)||function(t){if(fe(t))return t[t.length-1]}(t.split(".")),u="function"==typeof l?l(e):l;return()=>function(t,e){var{d:n,fill:r,strokeWidth:i,path:a,stroke:s,lineWidth:c,color:l}=e,u=o(e,["d","fill","strokeWidth","path","stroke","lineWidth","color"]);const f=ob.get(t)||ob.get("point");return(...t)=>new Cs({style:Object.assign(Object.assign({},u),{path:f(...t),stroke:f.style.includes("stroke")?l||s:"",fill:f.style.includes("fill")?l||r:"",lineWidth:f.style.includes("lineWidth")?c||c||2:0})})}(c,{color:e.color})(0,0,u)},f=t=>`${s[t]}`;return h_(n,"shape")&&!c?(t,e)=>u(f(e),t):"function"==typeof c?(t,e)=>{const n=c(t.id,e);return"string"==typeof n?u(n,t):n}:(t,e)=>u(c||f(e),t)}function sb(t){const e=h_(t,"opacity");if(e){const{range:t}=e.getOptions();return(e,n)=>t[n]}}function cb(t,e){const{labelFormatter:n=(t=>`${t}`)}=t,{scales:r,theme:i}=e,o=function(t,e){const n=h_(t,"size");return n instanceof Kh?2*n.map(NaN):e}(r,i.legendCategory.itemMarkerSize),a={itemMarker:ab(Object.assign(Object.assign({},t),{itemMarkerSize:o}),e),itemMarkerSize:o,itemMarkerOpacity:sb(r)},s="string"==typeof n?Of(n):n,c=h_(r,"color"),l=function(t){return t.find((t=>t.getOptions().domain.length>0)).getOptions().domain}(r),u=c?t=>c.map(t):()=>e.theme.color;return Object.assign(Object.assign({},a),{data:l.map((t=>({id:t,label:s(t),color:u(t)})))})}const lb=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:a,size:s,title:c,cols:l,itemMarker:u}=t,f=o(t,["labelFormatter","layout","order","orientation","position","size","title","cols","itemMarker"]),{gridRow:d}=f;return e=>{const{value:r,theme:i}=e,{bbox:o}=r,{width:s,height:u}=function(t,e,n){const{position:r}=e;if("center"===r){const{bbox:e}=t,{width:n,height:r}=e;return{width:n,height:r}}const{width:i,height:o}=g_(t,e,n);return{width:i,height:o}}(r,t,lb),h=u_(a,n),p=Object.assign(Object.assign(Object.assign(Object.assign({orientation:["right","left","center"].includes(a)?"vertical":"horizontal",width:s,height:u,layout:void 0!==l?"grid":"flex"},void 0!==l&&{gridCol:l}),void 0!==d&&{gridRow:d}),{titleText:l_(c)}),cb(t,e)),{legendCategory:g={}}=i,m=m_(Object.assign({},g,p,f)),v=new d_({style:Object.assign(Object.assign({x:o.x,y:o.y,width:o.width,height:o.height},h),{subOptions:m})});return v.appendChild(new Py({className:"legend-category",style:m})),v}};function ub(t,e,n,r,i){const o=e.thresholds,a=function(t){return e=>({value:e/t,label:String(e)})}(r);return Object.assign(Object.assign({},t),{color:i,data:[n,...o,r].map(a)})}function fb(t){const{domain:e}=t.getOptions(),[n,r]=[e[0],kf(e)];return[n,r]}function db(t,e,n,r,i,o){const{length:a}=t,s=n||r,c=i.color?o.legendContinuous.ribbonFill||"black":o.color,l=e||function(t,e){const n=t.getOptions(),r=t.clone();return r.update(Object.assign(Object.assign({},n),{range:[Ri(e).toString()]})),r}(s,c),[u,f]=fb(l),[d,h]=fb([e,n,r].filter((t=>void 0!==t)).find((t=>!(t instanceof Uh))));return Object.assign(Object.assign({},t),{domain:[d,h],data:l.getTicks().map((t=>({value:t}))),color:new Array(Math.floor(a)).fill(0).map(((t,e)=>{const n=(f-u)/(a-1)*e+u,i=l.map(n),o=r?r.map(n):1;return i.replace(/rgb[a]*\(([\d]{1,3}) *, *([\d]{1,3}) *, *([\d]{1,3})[\S\s]*\)/,((t,e,n,r)=>`rgba(${e}, ${n}, ${r}, ${o})`))}))})}function hb(t,e,n,r,i,o){const a=h_(t,"color"),s=function(t,e,n){const{size:r}=e,i=g_(t,e,n);return function(t,e,n){return t.size=e,function(t){return"horizontal"===t||0===t}(n)?t.height=e:t.width=e,t}(i,r,i.orientation)}(n,r,i);if(a instanceof ap){const{range:t}=a.getOptions(),[e,n]=fb(a);return a instanceof lp||a instanceof fp?ub(s,a,e,n,t):function(t,e,n){const r=[-1/0,...e.thresholds,1/0].map(((t,e)=>({value:e,label:t})));return Object.assign(Object.assign({},t),{data:r,color:n,labelFilter:(t,e)=>e>0&&e<r.length-1})}(s,a,t)}return db(s,a,h_(t,"size"),h_(t,"opacity"),e,o)}lb.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const pb=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:a,size:s,title:c,style:l,crossPadding:u,padding:f}=t,d=o(t,["labelFormatter","layout","order","orientation","position","size","title","style","crossPadding","padding"]);return({scales:r,value:i,theme:o,scale:s})=>{const{bbox:u}=i,{x:f,y:h,width:p,height:g}=u,m=u_(a,n),{legendContinuous:v={}}=o,y=m_(Object.assign({},v,Object.assign(Object.assign({titleText:l_(c),labelAlign:"value",labelFormatter:"string"==typeof e?t=>Of(e)(t.label):e},hb(r,s,i,t,pb,o)),l),d)),_=new f_({style:Object.assign(Object.assign({x:f,y:h,width:p,height:g},m),{subOptions:y})});return _.appendChild(new Xy({className:"legend-continuous",style:y})),_}};pb.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[12,12]};const gb=t=>(...e)=>pb(Object.assign({},{block:!0},t))(...e);gb.props=Object.assign(Object.assign({},pb.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const mb=t=>e=>{const{scales:n}=e,r=h_(n,"size");return pb(Object.assign({},{type:"size",data:r.getTicks().map(((t,e)=>({value:t,label:String(t)})))},t))(e)};mb.props=Object.assign(Object.assign({},pb.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const vb=t=>mb(Object.assign({},{block:!0},t));function yb([t,e],[n,r]){return[t-n,e-r]}function _b([t,e],[n,r]){return[t+n,e+r]}function bb([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function Eb([t,e]){return Math.atan2(e,t)}function xb([t,e]){return Eb([t,e])+Math.PI/2}function Mb(t,e){const n=Eb(t),r=Eb(e);return n<r?r-n:2*Math.PI-(n-r)}function Sb(t){let e=1/0,n=-1/0,r=1/0,i=-1/0;for(const[o,a]of t)e=Math.min(o,e),n=Math.max(o,n),r=Math.min(a,r),i=Math.max(a,i);return[e,r,n-e,i-r]}function Ab([t,e],[n,r]){return[(t+n)/2,(e+r)/2]}function Tb(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}function Ob(t,e,n,r,i){const o=Eb(yb(r,e))+Math.PI,a=Eb(yb(r,n))+Math.PI;return t.arc(r[0],r[1],i,o,a,a-o<0),t}function Rb(t,e,n,r="y",i="between"){const o="y"===r||!0===r?n:e,a="y"===r||!0===r?90:0,s=Nf(o),[c,l]=vu(s,(t=>o[t])),u=new ep({domain:[c,l],range:[0,100]}),f=t=>u.map(o[t]),d={between:e=>`${t[e]} ${f(e)}%`,start:e=>0===e?`${t[e]} ${f(e)}%`:`${t[e-1]} ${f(e)}%, ${t[e]} ${f(e)}%`,end:e=>e===t.length-1?`${t[e]} ${f(e)}%`:`${t[e]} ${f(e)}%, ${t[e+1]} ${f(e)}%`},h=s.sort(((t,e)=>f(t)-f(e))).map(d[i]||d.between).join(",");return`linear-gradient(${a}deg, ${h})`}function Pb(t){const[e,n,r,i]=t;return[i,e,n,r]}function Cb(t,e,n){const[r,i,,o]=Jy(t)?Pb(e):e,[a,s]=n,c=t.getCenter(),l=xb(yb(r,c)),u=xb(yb(i,c)),f=u===l&&a!==s?u+2*Math.PI:u;return{startAngle:l,endAngle:f-l>=0?f:2*Math.PI+f,innerRadius:bb(o,c),outerRadius:bb(r,c)}}function wb(t){const{colorAttribute:e,opacityAttribute:n=e}=t;return`${n}Opacity`}function Nb(t,e){if(!t_(t))return"";const n=t.getCenter(),{transform:r}=e;return`translate(${n[0]}, ${n[1]}) ${r||""}`}function Ib(t){if(1===t.length)return t[0];const[[e,n,r=0],[i,o,a=0]]=t;return[(e+i)/2,(n+o)/2,(r+a)/2]}function kb(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"}}}vb.props=Object.assign(Object.assign({},pb.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const Lb=(Db={render(t,e){const{width:n,title:r,subtitle:i,spacing:a=2,align:s="left"}=t,c=o(t,["width","title","subtitle","spacing","align"]),l=cf(c,"title"),u=cf(c,"subtitle"),f=c_(e,".title","text").attr("className","title").call(Tb,Object.assign(Object.assign(Object.assign({},kb(0,0,n,s)),{fontSize:14,textBaseline:"top",text:r}),l)).node().getLocalBounds();c_(e,".sub-title","text").attr("className","sub-title").call((t=>{if(!i)return t.node().remove();t.node().attr(Object.assign(Object.assign(Object.assign({},kb(0,f.max[1]+a,n,s)),{fontSize:12,textBaseline:"top",text:i}),u))}))}},class extends Ss{constructor(t){super(t),this.descriptor=Db}connectedCallback(){var t,e;null===(e=(t=this.descriptor).render)||void 0===e||e.call(t,this.attributes,this)}update(t={}){var e,n;this.attr(We({},this.attributes,t)),null===(n=(e=this.descriptor).render)||void 0===n||n.call(e,this.attributes,this)}});var Db;const Bb=t=>({value:e,theme:n})=>{const{x:r,y:i,width:o,height:a}=e.bbox;return new Lb({style:We({},n.title,Object.assign({x:r,y:i,width:o,height:a},t))})};function Fb(t){return!!t.getBandWidth}function Ub(t,e,n){if(!Fb(t))return t.invert(e);const{adjustedRange:r}=t,{domain:i}=t.getOptions(),o=n?-1:0,a=t.getStep(),s=n?r:r.map((t=>t+a)),c=function(t,e,n){return Math.min(n,Math.max(e,t))}(hu(s,e)+o,0,i.length-1);return i[c]}function jb(t,e,n){if(!e)return t.getOptions().domain;if(!Fb(t)){const r=Ru(e);if(!n)return r;const[i]=r,{range:o}=t.getOptions(),[a,s]=o,c=a>s?-1:1;return[i,t.invert(t.map(i)+c*n)]}const{domain:r}=t.getOptions(),i=e[0],o=r.indexOf(i);if(n){const t=o+Math.round(r.length*n);return r.slice(o,t)}const a=e[e.length-1],s=r.indexOf(a);return r.slice(o,s+1)}function Gb(t,e,n,r,i,o){const{x:a,y:s}=i,c=(t,e)=>{const[n,r]=o.invert(t);return[Ub(a,n,e),Ub(s,r,e)]},l=c([t,e],!0),u=c([n,r],!1);return[jb(a,[l[0],u[0]]),jb(s,[l[1],u[1]])]}function Wb(t,e){const[n,r]=t;return[e.map(n),e.map(r)+(t=>t.getStep?t.getStep():0)(e)]}Bb.props={defaultPosition:"top",defaultOrder:2,defaultSize:36,defaultCrossPadding:[20,20],defaultPadding:[12,12]};const zb=t=>{const{orientation:e,labelFormatter:n,size:r,style:i={},position:a}=t,s=o(t,["orientation","labelFormatter","size","style","position"]);return({scales:[t],value:r,theme:o,coordinate:c})=>{var l;const{bbox:u}=r,{width:f,height:d}=u,{slider:h={}}=o,p=(null===(l=t.getFormatter)||void 0===l?void 0:l.call(t))||(t=>t.toString()),g="string"==typeof n?Of(n):n,m="horizontal"===e,v=Jy(c)&&m,{trackSize:y=h.trackSize}=i,[_,b]=function(t,e,n){const{x:r,y:i,width:o,height:a}=t;return"left"===e?[r+o-n,i]:"right"===e||"bottom"===e?[r,i]:"top"===e?[r,i+a-n]:void 0}(u,a,y);return new sv({className:"slider",style:Object.assign({},h,Object.assign(Object.assign({x:_,y:b,trackLength:m?f:d,orientation:e,formatter:e=>(g||p)(Ub(t,v?1-e:e,!0))},i),s))})}};zb.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const Vb=t=>zb(Object.assign(Object.assign({},t),{orientation:"horizontal"}));Vb.props=Object.assign(Object.assign({},zb.props),{defaultPosition:"bottom"});const Hb=t=>zb(Object.assign(Object.assign({},t),{orientation:"vertical"}));Hb.props=Object.assign(Object.assign({},zb.props),{defaultPosition:"left"});const Xb=t=>{const{orientation:e,labelFormatter:n,style:r}=t,i=o(t,["orientation","labelFormatter","style"]);return({scales:[t],value:n,theme:o})=>{const{bbox:a}=n,{x:s,y:c,width:l,height:u}=a,{scrollbar:f={}}=o,{ratio:d,range:h}=t.getOptions(),p="horizontal"===e?l:u,g=p/d,[m,v]=h,y=v>m?0:1;return new cv({className:"g2-scrollbar",style:Object.assign({},f,Object.assign(Object.assign(Object.assign(Object.assign({},r),{x:s,y:c,trackLength:p,value:y}),i),{orientation:e,contentLength:g,viewportLength:p}))})}};Xb.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const Yb=t=>Xb(Object.assign(Object.assign({},t),{orientation:"horizontal"}));Yb.props=Object.assign(Object.assign({},Xb.props),{defaultPosition:"bottom"});const $b=t=>Xb(Object.assign(Object.assign({},t),{orientation:"vertical"}));$b.props=Object.assign(Object.assign({},Xb.props),{defaultPosition:"left"});const qb=t=>()=>new Ts;function Kb(t){return(e,...n)=>We({},t(e,...n),e)}function Zb(t){return(e,...n)=>We({},e,t(e,...n))}function Qb(t,e){if(!t)return e;if(Array.isArray(t))return t;const{value:n=e}=t,r=o(t,["value"]);return Object.assign(Object.assign({},r),{value:n})}qb.props={};const Jb=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{x:n=0,y:r=0,width:i,height:a,data:s}=t;return e.map((t=>{var{data:e,x:c,y:l,width:u,height:f}=t,d=o(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},d),{data:Qb(e,s),x:null!=c?c:n,y:null!=l?l:r,width:null!=u?u:i,height:null!=f?f:a})}))};Jb.props={};const tE=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{direction:n="row",ratio:r=e.map((()=>1)),padding:i=0,data:a}=t,[s,c,l,u]="col"===n?["y","height","width","x"]:["x","width","height","y"],f=r.reduce(((t,e)=>t+e)),d=t[c]-i*(e.length-1),h=r.map((t=>d*(t/f))),p=[];let g=t[s]||0;for(let n=0;n<h.length;n+=1){const r=e[n],{data:f}=r,d=o(r,["data"]),m=Qb(f,a);p.push(Object.assign({[s]:g,[c]:h[n],[u]:t[u]||0,[l]:t[l],data:m},d)),g+=h[n]+i}return p};tE.props={};const eE=()=>t=>{const{children:e}=t,n=o(t,["children"]);if(!Array.isArray(e))return[];const{data:r,scale:i={},axis:a={},legend:s={},encode:c={},transform:l=[]}=n,u=o(n,["data","scale","axis","legend","encode","transform"]),f=e.map((t=>{var{data:e,scale:n={},axis:u={},legend:f={},encode:d={},transform:h=[]}=t,p=o(t,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:Qb(e,r),scale:We({},i,n),encode:We({},c,d),transform:[...l,...h],axis:!(!u||!a)&&We({},a,u),legend:!(!f||!s)&&We({},s,f)},p)}));return[Object.assign(Object.assign({},u),{marks:f,type:"standardView"})]};eE.props={};const nE=({static:t=!1}={})=>e=>{const{width:n,height:r,depth:i,paddingLeft:a,paddingRight:s,paddingTop:c,paddingBottom:l,padding:u,inset:f,insetLeft:d,insetTop:h,insetRight:p,insetBottom:g,margin:m,marginLeft:v,marginBottom:y,marginTop:_,marginRight:b,data:E,coordinate:x,theme:M,component:S,interaction:A,x:T,y:O,z:R,key:P,frame:C,labelTransform:w,parentKey:N,clip:I,viewStyle:k,title:L}=e,D=o(e,["width","height","depth","paddingLeft","paddingRight","paddingTop","paddingBottom","padding","inset","insetLeft","insetTop","insetRight","insetBottom","margin","marginLeft","marginBottom","marginTop","marginRight","data","coordinate","theme","component","interaction","x","y","z","key","frame","labelTransform","parentKey","clip","viewStyle","title"]);return[Object.assign(Object.assign({type:"standardView",x:T,y:O,z:R,key:P,width:n,height:r,depth:i,padding:u,paddingLeft:a,paddingRight:s,paddingTop:c,inset:f,insetLeft:d,insetTop:h,insetRight:p,insetBottom:g,paddingBottom:l,theme:M,coordinate:x,component:S,interaction:A,frame:C,labelTransform:w,margin:m,marginLeft:v,marginBottom:y,marginTop:_,marginRight:b,parentKey:N,clip:I,style:k},!t&&{title:L}),{marks:[Object.assign(Object.assign(Object.assign({},D),{key:`${P}-0`,data:E}),t&&{title:L})]})]};nE.props={};class rE{constructor(t){this.$value=t}static of(t){return new rE(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const iE=Kb((t=>{const{encode:e,data:n,scale:r,shareSize:i=!1}=t,{x:o,y:a}=e,s=(t,e)=>{var o;if(void 0===t||!i)return{};const a=Mu(n,(e=>e[t])),s=(null===(o=null==r?void 0:r[e])||void 0===o?void 0:o.domain)||Array.from(a.keys()),c=s.map((t=>a.has(t)?a.get(t).length:1));return{domain:s,flex:c}};return{scale:{x:Object.assign(Object.assign({paddingOuter:0,paddingInner:.1,guide:void 0===o?null:{position:"top"}},void 0===o&&{paddingInner:0}),s(o,"x")),y:Object.assign(Object.assign({range:[0,1],paddingOuter:0,paddingInner:.1,guide:void 0===a?null:{position:"right"}},void 0===a&&{paddingInner:0}),s(a,"y"))}}})),oE=Kb((t=>{const{data:e,scale:n}=t,r=[t];let i,o,a;for(;r.length;){const t=r.shift(),{children:e,encode:n={},scale:s={},legend:c={}}=t,{color:l}=n,{color:u}=s,{color:f}=c;void 0!==l&&(i=l),void 0!==u&&(o=u),void 0!==f&&(a=f),Array.isArray(e)&&r.push(...e)}const s="string"==typeof i?i:"",[c,l]=(()=>{var t;const r=null===(t=null==n?void 0:n.color)||void 0===t?void 0:t.domain;if(void 0!==r)return[r];if(void 0===i)return[void 0];const o="function"==typeof i?i:t=>t[i],a=e.map(o);return a.some((t=>"number"==typeof t))?[vu(a)]:[Array.from(new Set(a)),"ordinal"]})();return{encode:{color:i},scale:{color:We({},o,{domain:c,type:l})},legend:{color:We({title:s},a)}}})),aE=Kb((()=>({animate:{enterType:"fadeIn"}}))),sE=Zb((()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}}))),cE=Zb((()=>({type:"cell"}))),lE=Zb((t=>{const{data:e}=t,n={type:"custom",callback:()=>{const{data:e,encode:n}=t,{x:r,y:i}=n,o=r?Array.from(new Set(e.map((t=>t[r])))):[],a=i?Array.from(new Set(e.map((t=>t[i])))):[];return(()=>{if(o.length&&a.length){const t=[];for(const e of o)for(const n of a)t.push({[r]:e,[i]:n});return t}return o.length?o.map((t=>({[r]:t}))):a.length?a.map((t=>({[i]:t}))):void 0})()}};return{data:{type:"inline",value:e,transform:[n]}}})),uE=Zb(((t,e=fE,n=hE,r=pE,i={})=>{const{data:a,encode:s,children:c,scale:l,x:u=0,y:f=0,shareData:d=!1,key:h}=t,{value:p}=a,{x:g,y:m}=s,{color:v}=l,{domain:y}=v;return{children:(t,a,s)=>{const{x:l,y:v}=a,{paddingLeft:_,paddingTop:b,marginLeft:E,marginTop:x}=s,{domain:M}=l.getOptions(),{domain:S}=v.getOptions(),A=Nf(t),T=t.map(e),O=t.map((({x:t,y:e})=>[l.invert(t),v.invert(e)])),R=O.map((([t,e])=>n=>{const{[g]:r,[m]:i}=n;return(void 0===g||r===t)&&(void 0===m||i===e)})),P=R.map((t=>p.filter(t))),C=d?ju(P,(t=>t.length)):void 0,w=O.map((([t,e])=>({columnField:g,columnIndex:M.indexOf(t),columnValue:t,columnValuesLength:M.length,rowField:m,rowIndex:S.indexOf(e),rowValue:e,rowValuesLength:S.length}))),N=w.map((t=>Array.isArray(c)?c:[c(t)].flat(1)));return A.flatMap((t=>{const[e,a,s,c]=T[t],l=w[t],d=P[t];return N[t].map((v=>{var M,S,{scale:A,key:T,facet:O=!0,axis:R={},legend:P={}}=v,w=o(v,["scale","key","facet","axis","legend"]);const N=(null===(M=null==A?void 0:A.y)||void 0===M?void 0:M.guide)||R.y,I=(null===(S=null==A?void 0:A.x)||void 0===S?void 0:S.guide)||R.x,k={x:{tickCount:g?5:void 0},y:{tickCount:m?5:void 0}},L=O?d:0===d.length?[]:p,D={color:{domain:y}},B={x:gE(I,n)(l,L),y:gE(N,r)(l,L)};return Object.assign(Object.assign({key:`${T}-${t}`,data:L,margin:0,x:e+_+u+E,y:a+b+f+x,parentKey:h,width:s,height:c,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!L.length,dataDomain:C,scale:We(k,A,D),axis:We({},R,B),legend:!1},w),i)}))}))}}}));function fE(t){const{points:e}=t;return Sb(e)}function dE(t,e){return e.length?We({title:!1,tick:null,label:null},t):We({title:!1,tick:null,label:null,grid:null},t)}function hE(t){return(e,n)=>{const{rowIndex:r,rowValuesLength:i,columnIndex:o,columnValuesLength:a}=e;if(r!==i-1)return dE(t,n);const s=o===a-1&&void 0,c=n.length?void 0:null;return We({title:s,grid:c},t)}}function pE(t){return(e,n)=>{const{rowIndex:r,columnIndex:i}=e;if(0!==i)return dE(t,n);const o=0===r&&void 0,a=n.length?void 0:null;return We({title:o,grid:a},t)}}function gE(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const mE=()=>t=>[rE.of(t).call(cE).call(oE).call(aE).call(iE).call(sE).call(lE).call(uE).value()];mE.props={};const vE=Kb((t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),yE=Zb((t=>{const{data:e,children:n,x:r=0,y:i=0,key:a}=t;return{children:(t,s,c)=>{const{x:l,y:u}=s,{paddingLeft:f,paddingTop:d,marginLeft:h,marginTop:p}=c,{domain:g}=l.getOptions(),{domain:m}=u.getOptions(),v=Nf(t),y=t.map((({points:t})=>Sb(t))),_=t.map((({x:t,y:e})=>[l.invert(t),u.invert(e)])),b=_.map((([t,e])=>({columnField:t,columnIndex:g.indexOf(t),columnValue:t,columnValuesLength:g.length,rowField:e,rowIndex:m.indexOf(e),rowValue:e,rowValuesLength:m.length}))),E=b.map((t=>Array.isArray(n)?n:[n(t)].flat(1)));return v.flatMap((t=>{const[n,s,c,l]=y[t],[u,g]=_[t],m=b[t];return E[t].map((v=>{var y,_;const{scale:b,key:E,encode:x,axis:M,interaction:S}=v,A=o(v,["scale","key","encode","axis","interaction"]),T=null===(y=null==b?void 0:b.y)||void 0===y?void 0:y.guide,O={x:bE(null===(_=null==b?void 0:b.x)||void 0===_?void 0:_.guide)(m,e),y:EE(T)(m,e)};return Object.assign({data:e,parentKey:a,key:`${E}-${t}`,x:n+f+r+h,y:s+d+i+p,width:c,height:l,margin:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:We({x:{facet:!1},y:{facet:!1}},b),axis:We({x:{tickCount:5},y:{tickCount:5}},M,O),legend:!1,encode:We({},x,{x:u,y:g}),interaction:We({},S,{legendFilter:!1})},A)}))}))}}})),_E=Zb((t=>{const{encode:e}=t,n=o(t,["encode"]),{position:r=[],x:i=r,y:a=[...r].reverse()}=e,s=o(e,["position","x","y"]),c=[];for(const t of[i].flat(1))for(const e of[a].flat(1))c.push({$x:t,$y:e});return Object.assign(Object.assign({},n),{data:c,encode:Object.assign(Object.assign({},s),{x:"$x",y:"$y"}),scale:Object.assign(Object.assign({},1===[i].flat(1).length&&{x:{paddingInner:0}}),1===[a].flat(1).length&&{y:{paddingInner:0}})})}));function bE(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{rowIndex:r,rowValuesLength:i}=e;if(r!==i-1)return dE(t,n)}}function EE(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{columnIndex:r}=e;if(0!==r)return dE(t,n)}}const xE=()=>t=>[rE.of(t).call(cE).call(oE).call(yE).call(_E).call(aE).call(sE).call(vE).value()],ME=Kb((t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),SE=Kb((t=>({coordinate:{type:"polar"}}))),AE=t=>{const{encode:e}=t,n=o(t,["encode"]),{position:r}=e;return Object.assign(Object.assign({},n),{encode:{x:r}})};function TE(t){return t=>null}function OE(t){const{points:e}=t,[n,r,i,o]=e,a=bb(n,o),s=yb(n,o),c=Mb(s,yb(r,i)),l=1/Math.sin(c/2),u=a/(1+l),f=u*Math.sqrt(2),[d,h]=i,p=xb(s)+c/2,g=u*l;return[d+g*Math.sin(p)-f/2,h+g*Math.cos(p)-f/2,f,f]}const RE=()=>t=>[rE.of(t).call(cE).call(AE).call(oE).call(SE).call(lE).call(uE,OE,TE,TE,{frame:!1}).call(aE).call(sE).call(ME).value()];function PE(t,e,n){const r=[0,n],i=[1-n,1];return"normal"===t?r:"reverse"===t?i:"alternate"===t?e%2==0?r:i:"reverse-alternate"===t?e%2==0?i:r:void 0}const CE=()=>t=>{const{children:e=[],duration:n=1e3,iterationCount:r=1,direction:i="normal",easing:o="ease-in-out-sine"}=t,a=e.length;if(!Array.isArray(e)||0===a)return[];const{key:s}=e[0],c=e.map((t=>Object.assign(Object.assign({},t),{key:s}))).map((t=>function(t,e,n){const r=[t];for(;r.length;){const t=r.pop();t.animate=We({enter:{duration:e},update:{duration:e,easing:n,type:"morphing",fill:"both"},exit:{type:"fadeOut",duration:e}},t.animate||{});const{children:i}=t;Array.isArray(i)&&r.push(...i)}return t}(t,n,o)));return function*(){let t,e=0;for(;"infinite"===r||e<r;){const[n,r]=PE(i,e,a);for(let e=n;e<r;e+=1){const n=Math.abs(e);t!==n&&(yield c[n]),t=n}e++}}};CE.props={};const wE=()=>t=>{const{type:e,data:n,scale:r,encode:i,style:a,animate:s,key:c,state:l}=t,u=o(t,["type","data","scale","encode","style","animate","key","state"]);return[Object.assign(Object.assign({type:"geoView"},u),{children:[{type:"geoPath",key:`${c}-0`,data:{value:n},scale:r,encode:i,style:a,animate:s,state:l}]})]};wE.props={};var NE=1e-6,IE=1e-12,kE=Math.PI,LE=kE/2,DE=kE/4,BE=2*kE,FE=180/kE,UE=kE/180,jE=Math.abs,GE=Math.atan,WE=Math.atan2,zE=Math.cos,VE=Math.ceil,HE=Math.exp,XE=Math.log,YE=Math.pow,$E=Math.sin,qE=Math.sign||function(t){return t>0?1:t<0?-1:0},KE=Math.sqrt,ZE=Math.tan;function QE(t){return t>1?0:t<-1?kE:Math.acos(t)}function JE(t){return t>1?LE:t<-1?-LE:Math.asin(t)}function tx(){}function ex(t,e){t&&rx.hasOwnProperty(t.type)&&rx[t.type](t,e)}var nx={Feature:function(t,e){ex(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)ex(n[r].geometry,e)}},rx={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){ix(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)ix(n[r],e,0)},Polygon:function(t,e){ox(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)ox(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)ex(n[r],e)}};function ix(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function ox(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)ix(t[n],e,1);e.polygonEnd()}function ax(t,e){t&&nx.hasOwnProperty(t.type)?nx[t.type](t,e):ex(t,e)}function sx(t){return[WE(t[1],t[0]),JE(t[2])]}function cx(t){var e=t[0],n=t[1],r=zE(n);return[r*zE(e),r*$E(e),$E(n)]}function lx(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ux(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 fx(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function dx(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function hx(t){var e=KE(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function px(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function gx(t,e){return jE(t)>kE&&(t-=Math.round(t/BE)*BE),[t,e]}function mx(t,e,n){return(t%=BE)?e||n?px(yx(t),_x(e,n)):yx(t):e||n?_x(e,n):gx}function vx(t){return function(e,n){return jE(e+=t)>kE&&(e-=Math.round(e/BE)*BE),[e,n]}}function yx(t){var e=vx(t);return e.invert=vx(-t),e}function _x(t,e){var n=zE(t),r=$E(t),i=zE(e),o=$E(e);function a(t,e){var a=zE(e),s=zE(t)*a,c=$E(t)*a,l=$E(e),u=l*n+s*r;return[WE(c*i-u*o,s*n-l*r),JE(u*i+c*o)]}return a.invert=function(t,e){var a=zE(e),s=zE(t)*a,c=$E(t)*a,l=$E(e),u=l*i-c*o;return[WE(c*i+l*o,s*n+u*r),JE(u*n-s*r)]},a}function bx(t,e){(e=cx(e))[0]-=t,hx(e);var n=QE(-e[1]);return((-e[2]<0?-n:n)+BE-NE)%BE}function Ex(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:tx,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function xx(t,e){return jE(t[0]-e[0])<NE&&jE(t[1]-e[1])<NE}function Mx(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 Sx(t,e,n,r,i){var o,a,s=[],c=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],a=t[e];if(xx(r,a)){if(!r[2]&&!a[2]){for(i.lineStart(),o=0;o<e;++o)i.point((r=t[o])[0],r[1]);return void i.lineEnd()}a[0]+=2*NE}s.push(n=new Mx(r,t,null,!0)),c.push(n.o=new Mx(r,null,n,!1)),s.push(n=new Mx(a,t,null,!1)),c.push(n.o=new Mx(a,null,n,!0))}})),s.length){for(c.sort(e),Ax(s),Ax(c),o=0,a=c.length;o<a;++o)c[o].e=n=!n;for(var l,u,f=s[0];;){for(var d=f,h=!0;d.v;)if((d=d.n)===f)return;l=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(o=0,a=l.length;o<a;++o)i.point((u=l[o])[0],u[1]);else r(d.x,d.n.x,1,i);d=d.n}else{if(h)for(l=d.p.z,o=l.length-1;o>=0;--o)i.point((u=l[o])[0],u[1]);else r(d.x,d.p.x,-1,i);d=d.p}l=(d=d.o).z,h=!h}while(!d.v);i.lineEnd()}}}function Ax(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 Tx(t){return jE(t[0])<=kE?t[0]:qE(t[0])*((jE(t[0])+kE)%BE-kE)}function Ox(t,e,n,r){return function(i){var o,a,s,c=e(i),l=Ex(),u=e(l),f=!1,d={point:h,lineStart:g,lineEnd:m,polygonStart:function(){d.point=v,d.lineStart=y,d.lineEnd=_,a=[],o=[]},polygonEnd:function(){d.point=h,d.lineStart=g,d.lineEnd=m,a=Zu(a);var t=function(t,e){var n=Tx(e),r=e[1],i=$E(r),o=[$E(n),-zE(n),0],a=0,s=0,c=new yu;1===i?r=LE+NE:-1===i&&(r=-LE-NE);for(var l=0,u=t.length;l<u;++l)if(d=(f=t[l]).length)for(var f,d,h=f[d-1],p=Tx(h),g=h[1]/2+DE,m=$E(g),v=zE(g),y=0;y<d;++y,p=b,m=x,v=M,h=_){var _=f[y],b=Tx(_),E=_[1]/2+DE,x=$E(E),M=zE(E),S=b-p,A=S>=0?1:-1,T=A*S,O=T>kE,R=m*x;if(c.add(WE(R*A*$E(T),v*M+R*zE(T))),a+=O?S+A*BE:S,O^p>=n^b>=n){var P=ux(cx(h),cx(_));hx(P);var C=ux(o,P);hx(C);var w=(O^S>=0?-1:1)*JE(C[2]);(r>w||r===w&&(P[0]||P[1]))&&(s+=O^S>=0?1:-1)}}return(a<-NE||a<NE&&c<-IE)^1&s}(o,r);a.length?(f||(i.polygonStart(),f=!0),Sx(a,Px,t,n,i)):t&&(f||(i.polygonStart(),f=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),f&&(i.polygonEnd(),f=!1),a=o=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function h(e,n){t(e,n)&&i.point(e,n)}function p(t,e){c.point(t,e)}function g(){d.point=p,c.lineStart()}function m(){d.point=h,c.lineEnd()}function v(t,e){s.push([t,e]),u.point(t,e)}function y(){u.lineStart(),s=[]}function _(){v(s[0][0],s[0][1]),u.lineEnd();var t,e,n,r,c=u.clean(),d=l.result(),h=d.length;if(s.pop(),o.push(s),s=null,h)if(1&c){if((e=(n=d[0]).length-1)>0){for(f||(i.polygonStart(),f=!0),i.lineStart(),t=0;t<e;++t)i.point((r=n[t])[0],r[1]);i.lineEnd()}}else h>1&&2&c&&d.push(d.pop().concat(d.shift())),a.push(d.filter(Rx))}return d}}function Rx(t){return t.length>1}function Px(t,e){return((t=t.x)[0]<0?t[1]-LE-NE:LE-t[1])-((e=e.x)[0]<0?e[1]-LE-NE:LE-e[1])}gx.invert=gx;var Cx=Ox((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var s=o>0?kE:-kE,c=jE(o-n);jE(c-kE)<NE?(t.point(n,r=(r+a)/2>0?LE:-LE),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(o,r),e=0):i!==s&&c>=kE&&(jE(n-i)<NE&&(n-=i*NE),jE(o-s)<NE&&(o-=s*NE),r=function(t,e,n,r){var i,o,a=$E(t-n);return jE(a)>NE?GE(($E(e)*(o=zE(r))*$E(n)-$E(r)*(i=zE(e))*$E(t))/(i*o*a)):(e+r)/2}(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=o,r=a),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*LE,r.point(-kE,i),r.point(0,i),r.point(kE,i),r.point(kE,0),r.point(kE,-i),r.point(0,-i),r.point(-kE,-i),r.point(-kE,0),r.point(-kE,i);else if(jE(t[0]-e[0])>NE){var o=t[0]<e[0]?kE:-kE;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}),[-kE,-LE]);function wx(t){var e=zE(t),n=6*UE,r=e>0,i=jE(e)>NE;function o(t,n){return zE(t)*zE(n)>e}function a(t,n,r){var i=[1,0,0],o=ux(cx(t),cx(n)),a=lx(o,o),s=o[0],c=a-s*s;if(!c)return!r&&t;var l=e*a/c,u=-e*s/c,f=ux(i,o),d=dx(i,l);fx(d,dx(o,u));var h=f,p=lx(d,h),g=lx(h,h),m=p*p-g*(lx(d,d)-1);if(!(m<0)){var v=KE(m),y=dx(h,(-p-v)/g);if(fx(y,d),y=sx(y),!r)return y;var _,b=t[0],E=n[0],x=t[1],M=n[1];E<b&&(_=b,b=E,E=_);var S=E-b,A=jE(S-kE)<NE;if(!A&&M<x&&(_=x,x=M,M=_),A||S<NE?A?x+M>0^y[1]<(jE(y[0]-b)<NE?x:M):x<=y[1]&&y[1]<=M:S>kE^(b<=y[0]&&y[0]<=E)){var T=dx(h,(-p+v)/g);return fx(T,d),[y,sx(T)]}}}function s(e,n){var i=r?t:kE-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return Ox(o,(function(t){var e,n,c,l,u;return{lineStart:function(){l=c=!1,u=1},point:function(f,d){var h,p=[f,d],g=o(f,d),m=r?g?0:s(f,d):g?s(f+(f<0?kE:-kE),d):0;if(!e&&(l=c=g)&&t.lineStart(),g!==c&&(!(h=a(e,p))||xx(e,h)||xx(p,h))&&(p[2]=1),g!==c)u=0,g?(t.lineStart(),h=a(p,e),t.point(h[0],h[1])):(h=a(e,p),t.point(h[0],h[1],2),t.lineEnd()),e=h;else if(i&&e&&r^g){var v;m&n||!(v=a(p,e,!0))||(u=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1],3)))}!g||e&&xx(e,p)||t.point(p[0],p[1]),e=p,c=g,n=m},lineEnd:function(){c&&t.lineEnd(),e=null},clean:function(){return u|(l&&c)<<1}}}),(function(e,r,i,o){!function(t,e,n,r,i,o){if(n){var a=zE(e),s=$E(e),c=r*n;null==i?(i=e+r*BE,o=e-c/2):(i=bx(a,i),o=bx(a,o),(r>0?i<o:i>o)&&(i+=r*BE));for(var l,u=i;r>0?u>o:u<o;u-=c)l=sx([a,-s*zE(u),-s*$E(u)]),t.point(l[0],l[1])}}(o,t,n,i,e,r)}),r?[0,-t]:[-kE,t-kE])}var Nx=1e9,Ix=-Nx;function kx(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,s,l){var u=0,f=0;if(null==i||(u=a(i,s))!==(f=a(o,s))||c(i,o)<0^s>0)do{l.point(0===u||3===u?t:n,u>1?r:e)}while((u=(u+s+4)%4)!==f);else l.point(o[0],o[1])}function a(r,i){return jE(r[0]-t)<NE?i>0?0:3:jE(r[0]-n)<NE?i>0?2:1:jE(r[1]-e)<NE?i>0?1:0:i>0?3:2}function s(t,e){return c(t.x,e.x)}function c(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var c,l,u,f,d,h,p,g,m,v,y,_=a,b=Ex(),E={point:x,lineStart:function(){E.point=M,l&&l.push(u=[]);v=!0,m=!1,p=g=NaN},lineEnd:function(){c&&(M(f,d),h&&m&&b.rejoin(),c.push(b.result()));E.point=x,m&&_.lineEnd()},polygonStart:function(){_=b,c=[],l=[],y=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;n<i;++n)for(var o,a,s=l[n],c=1,u=s.length,f=s[0],d=f[0],h=f[1];c<u;++c)o=d,a=h,d=(f=s[c])[0],h=f[1],a<=r?h>r&&(d-o)*(r-a)>(h-a)*(t-o)&&++e:h<=r&&(d-o)*(r-a)<(h-a)*(t-o)&&--e;return e}(),n=y&&e,i=(c=Zu(c)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&Sx(c,s,e,o,a),a.polygonEnd());_=a,c=l=u=null}};function x(t,e){i(t,e)&&_.point(t,e)}function M(o,a){var s=i(o,a);if(l&&u.push([o,a]),v)f=o,d=a,h=s,v=!1,s&&(_.lineStart(),_.point(o,a));else if(s&&m)_.point(o,a);else{var c=[p=Math.max(Ix,Math.min(Nx,p)),g=Math.max(Ix,Math.min(Nx,g))],b=[o=Math.max(Ix,Math.min(Nx,o)),a=Math.max(Ix,Math.min(Nx,a))];!function(t,e,n,r,i,o){var a,s=t[0],c=t[1],l=0,u=1,f=e[0]-s,d=e[1]-c;if(a=n-s,f||!(a>0)){if(a/=f,f<0){if(a<l)return;a<u&&(u=a)}else if(f>0){if(a>u)return;a>l&&(l=a)}if(a=i-s,f||!(a<0)){if(a/=f,f<0){if(a>u)return;a>l&&(l=a)}else if(f>0){if(a<l)return;a<u&&(u=a)}if(a=r-c,d||!(a>0)){if(a/=d,d<0){if(a<l)return;a<u&&(u=a)}else if(d>0){if(a>u)return;a>l&&(l=a)}if(a=o-c,d||!(a<0)){if(a/=d,d<0){if(a>u)return;a>l&&(l=a)}else if(d>0){if(a<l)return;a<u&&(u=a)}return l>0&&(t[0]=s+l*f,t[1]=c+l*d),u<1&&(e[0]=s+u*f,e[1]=c+u*d),!0}}}}}(c,b,t,e,n,r)?s&&(_.lineStart(),_.point(o,a),y=!1):(m||(_.lineStart(),_.point(c[0],c[1])),_.point(b[0],b[1]),s||_.lineEnd(),y=!1)}p=o,g=a,m=s}return E}}function Lx(t,e,n){var r=Qu(t,e-NE,n).concat(e);return function(t){return r.map((function(e){return[t,e]}))}}function Dx(t,e,n){var r=Qu(t,e-NE,n).concat(e);return function(t){return r.map((function(e){return[e,t]}))}}function Bx(){return function(){var t,e,n,r,i,o,a,s,c,l,u,f,d=10,h=d,p=90,g=360,m=2.5;function v(){return{type:"MultiLineString",coordinates:y()}}function y(){return Qu(VE(r/p)*p,n,p).map(u).concat(Qu(VE(s/g)*g,a,g).map(f)).concat(Qu(VE(e/d)*d,t,d).filter((function(t){return jE(t%p)>NE})).map(c)).concat(Qu(VE(o/h)*h,i,h).filter((function(t){return jE(t%g)>NE})).map(l))}return v.lines=function(){return y().map((function(t){return{type:"LineString",coordinates:t}}))},v.outline=function(){return{type:"Polygon",coordinates:[u(r).concat(f(a).slice(1),u(n).reverse().slice(1),f(s).reverse().slice(1))]}},v.extent=function(t){return arguments.length?v.extentMajor(t).extentMinor(t):v.extentMinor()},v.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),s>a&&(t=s,s=a,a=t),v.precision(m)):[[r,s],[n,a]]},v.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),o>i&&(n=o,o=i,i=n),v.precision(m)):[[e,o],[t,i]]},v.step=function(t){return arguments.length?v.stepMajor(t).stepMinor(t):v.stepMinor()},v.stepMajor=function(t){return arguments.length?(p=+t[0],g=+t[1],v):[p,g]},v.stepMinor=function(t){return arguments.length?(d=+t[0],h=+t[1],v):[d,h]},v.precision=function(d){return arguments.length?(m=+d,c=Lx(o,i,90),l=Dx(e,t,m),u=Lx(s,a,90),f=Dx(r,n,m),v):m},v.extentMajor([[-180,-90+NE],[180,90-NE]]).extentMinor([[-180,-80-NE],[180,80+NE]])}()()}var Fx,Ux,jx,Gx,Wx=t=>t,zx=new yu,Vx=new yu,Hx={point:tx,lineStart:tx,lineEnd:tx,polygonStart:function(){Hx.lineStart=Xx,Hx.lineEnd=qx},polygonEnd:function(){Hx.lineStart=Hx.lineEnd=Hx.point=tx,zx.add(jE(Vx)),Vx=new yu},result:function(){var t=zx/2;return zx=new yu,t}};function Xx(){Hx.point=Yx}function Yx(t,e){Hx.point=$x,Fx=jx=t,Ux=Gx=e}function $x(t,e){Vx.add(Gx*t-jx*e),jx=t,Gx=e}function qx(){$x(Fx,Ux)}var Kx=Hx,Zx=1/0,Qx=Zx,Jx=-Zx,tM=Jx,eM={point:function(t,e){t<Zx&&(Zx=t);t>Jx&&(Jx=t);e<Qx&&(Qx=e);e>tM&&(tM=e)},lineStart:tx,lineEnd:tx,polygonStart:tx,polygonEnd:tx,result:function(){var t=[[Zx,Qx],[Jx,tM]];return Jx=tM=-(Qx=Zx=1/0),t}};var nM,rM,iM,oM,aM=eM,sM=0,cM=0,lM=0,uM=0,fM=0,dM=0,hM=0,pM=0,gM=0,mM={point:vM,lineStart:yM,lineEnd:EM,polygonStart:function(){mM.lineStart=xM,mM.lineEnd=MM},polygonEnd:function(){mM.point=vM,mM.lineStart=yM,mM.lineEnd=EM},result:function(){var t=gM?[hM/gM,pM/gM]:dM?[uM/dM,fM/dM]:lM?[sM/lM,cM/lM]:[NaN,NaN];return sM=cM=lM=uM=fM=dM=hM=pM=gM=0,t}};function vM(t,e){sM+=t,cM+=e,++lM}function yM(){mM.point=_M}function _M(t,e){mM.point=bM,vM(iM=t,oM=e)}function bM(t,e){var n=t-iM,r=e-oM,i=KE(n*n+r*r);uM+=i*(iM+t)/2,fM+=i*(oM+e)/2,dM+=i,vM(iM=t,oM=e)}function EM(){mM.point=vM}function xM(){mM.point=SM}function MM(){AM(nM,rM)}function SM(t,e){mM.point=AM,vM(nM=iM=t,rM=oM=e)}function AM(t,e){var n=t-iM,r=e-oM,i=KE(n*n+r*r);uM+=i*(iM+t)/2,fM+=i*(oM+e)/2,dM+=i,hM+=(i=oM*t-iM*e)*(iM+t),pM+=i*(oM+e),gM+=3*i,vM(iM=t,oM=e)}var TM=mM;function OM(t){this._context=t}OM.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,BE)}},result:tx};var RM,PM,CM,wM,NM,IM=new yu,kM={point:tx,lineStart:function(){kM.point=LM},lineEnd:function(){RM&&DM(PM,CM),kM.point=tx},polygonStart:function(){RM=!0},polygonEnd:function(){RM=null},result:function(){var t=+IM;return IM=new yu,t}};function LM(t,e){kM.point=DM,PM=wM=t,CM=NM=e}function DM(t,e){wM-=t,NM-=e,IM.add(KE(wM*wM+NM*NM)),wM=t,NM=e}var BM=kM;let FM,UM,jM,GM;class WM{constructor(t){this._append=null==t?zM:function(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return zM;if(e!==FM){const t=10**e;FM=e,UM=function(e){let n=1;this._+=e[0];for(const r=e.length;n<r;++n)this._+=Math.round(arguments[n]*t)/t+e[n]}}return UM}(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(t,e){switch(this._point){case 0:this._append`M${t},${e}`,this._point=1;break;case 1:this._append`L${t},${e}`;break;default:if(this._append`M${t},${e}`,this._radius!==jM||this._append!==UM){const t=this._radius,e=this._;this._="",this._append`m0,${t}a${t},${t} 0 1,1 0,${-2*t}a${t},${t} 0 1,1 0,${2*t}z`,jM=t,UM=this._append,GM=this._,this._=e}this._+=GM}}result(){const t=this._;return this._="",t.length?t:null}}function zM(t){let e=1;this._+=t[0];for(const n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function VM(t,e){let n,r,i=3,o=4.5;function a(t){return t&&("function"==typeof o&&r.pointRadius(+o.apply(this,arguments)),ax(t,n(r))),r.result()}return a.area=function(t){return ax(t,n(Kx)),Kx.result()},a.measure=function(t){return ax(t,n(BM)),BM.result()},a.bounds=function(t){return ax(t,n(aM)),aM.result()},a.centroid=function(t){return ax(t,n(TM)),TM.result()},a.projection=function(e){return arguments.length?(n=null==e?(t=null,Wx):(t=e).stream,a):t},a.context=function(t){return arguments.length?(r=null==t?(e=null,new WM(i)):new OM(e=t),"function"!=typeof o&&r.pointRadius(o),a):e},a.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(r.pointRadius(+t),+t),a):o},a.digits=function(t){if(!arguments.length)return i;if(null==t)i=null;else{const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);i=e}return null===e&&(r=new WM(i)),a},a.projection(t).digits(i).context(e)}function HM(t){return function(e){var n=new XM;for(var r in t)n[r]=t[r];return n.stream=e,n}}function XM(){}function YM(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),ax(n,t.stream(aM)),e(aM.result()),null!=r&&t.clipExtent(r),t}function $M(t,e,n){return YM(t,(function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+e[0][0]+(r-o*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(i-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,s])}),n)}function qM(t,e,n){return $M(t,[[0,0],e],n)}function KM(t,e,n){return YM(t,(function(n){var r=+e,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];t.scale(150*i).translate([o,a])}),n)}function ZM(t,e,n){return YM(t,(function(n){var r=+e,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([o,a])}),n)}XM.prototype={constructor:XM,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 QM=16,JM=zE(30*UE);function tS(t,e){return+e?function(t,e){function n(r,i,o,a,s,c,l,u,f,d,h,p,g,m){var v=l-r,y=u-i,_=v*v+y*y;if(_>4*e&&g--){var b=a+d,E=s+h,x=c+p,M=KE(b*b+E*E+x*x),S=JE(x/=M),A=jE(jE(x)-1)<NE||jE(o-f)<NE?(o+f)/2:WE(E,b),T=t(A,S),O=T[0],R=T[1],P=O-r,C=R-i,w=y*P-v*C;(w*w/_>e||jE((v*P+y*C)/_-.5)>.3||a*d+s*h+c*p<JM)&&(n(r,i,o,a,s,c,O,R,A,b/=M,E/=M,x,g,m),m.point(O,R),n(O,R,A,b,E,x,l,u,f,d,h,p,g,m))}}return function(e){var r,i,o,a,s,c,l,u,f,d,h,p,g={point:m,lineStart:v,lineEnd:_,polygonStart:function(){e.polygonStart(),g.lineStart=b},polygonEnd:function(){e.polygonEnd(),g.lineStart=v}};function m(n,r){n=t(n,r),e.point(n[0],n[1])}function v(){u=NaN,g.point=y,e.lineStart()}function y(r,i){var o=cx([r,i]),a=t(r,i);n(u,f,l,d,h,p,u=a[0],f=a[1],l=r,d=o[0],h=o[1],p=o[2],QM,e),e.point(u,f)}function _(){g.point=m,e.lineEnd()}function b(){v(),g.point=E,g.lineEnd=x}function E(t,e){y(r=t,e),i=u,o=f,a=d,s=h,c=p,g.point=y}function x(){n(u,f,l,d,h,p,i,o,r,a,s,c,QM,e),g.lineEnd=_,_()}return g}}(t,e):function(t){return HM({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var eS=HM({point:function(t,e){this.stream.point(t*UE,e*UE)}});function nS(t,e,n,r,i,o){if(!o)return function(t,e,n,r,i){function o(o,a){return[e+t*(o*=r),n-t*(a*=i)]}return o.invert=function(o,a){return[(o-e)/t*r,(n-a)/t*i]},o}(t,e,n,r,i);var a=zE(o),s=$E(o),c=a*t,l=s*t,u=a/t,f=s/t,d=(s*n-a*e)/t,h=(s*e+a*n)/t;function p(t,o){return[c*(t*=r)-l*(o*=i)+e,n-l*t-c*o]}return p.invert=function(t,e){return[r*(u*t-f*e+d),i*(h-f*t-u*e)]},p}function rS(t){return iS((function(){return t}))()}function iS(t){var e,n,r,i,o,a,s,c,l,u,f=150,d=480,h=250,p=0,g=0,m=0,v=0,y=0,_=0,b=1,E=1,x=null,M=Cx,S=null,A=Wx,T=.5;function O(t){return c(t[0]*UE,t[1]*UE)}function R(t){return(t=c.invert(t[0],t[1]))&&[t[0]*FE,t[1]*FE]}function P(){var t=nS(f,0,0,b,E,_).apply(null,e(p,g)),r=nS(f,d-t[0],h-t[1],b,E,_);return n=mx(m,v,y),s=px(e,r),c=px(n,s),a=tS(s,T),C()}function C(){return l=u=null,O}return O.stream=function(t){return l&&u===t?l:l=eS(function(t){return HM({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(M(a(A(u=t)))))},O.preclip=function(t){return arguments.length?(M=t,x=void 0,C()):M},O.postclip=function(t){return arguments.length?(A=t,S=r=i=o=null,C()):A},O.clipAngle=function(t){return arguments.length?(M=+t?wx(x=t*UE):(x=null,Cx),C()):x*FE},O.clipExtent=function(t){return arguments.length?(A=null==t?(S=r=i=o=null,Wx):kx(S=+t[0][0],r=+t[0][1],i=+t[1][0],o=+t[1][1]),C()):null==S?null:[[S,r],[i,o]]},O.scale=function(t){return arguments.length?(f=+t,P()):f},O.translate=function(t){return arguments.length?(d=+t[0],h=+t[1],P()):[d,h]},O.center=function(t){return arguments.length?(p=t[0]%360*UE,g=t[1]%360*UE,P()):[p*FE,g*FE]},O.rotate=function(t){return arguments.length?(m=t[0]%360*UE,v=t[1]%360*UE,y=t.length>2?t[2]%360*UE:0,P()):[m*FE,v*FE,y*FE]},O.angle=function(t){return arguments.length?(_=t%360*UE,P()):_*FE},O.reflectX=function(t){return arguments.length?(b=t?-1:1,P()):b<0},O.reflectY=function(t){return arguments.length?(E=t?-1:1,P()):E<0},O.precision=function(t){return arguments.length?(a=tS(s,T=t*t),C()):KE(T)},O.fitExtent=function(t,e){return $M(O,t,e)},O.fitSize=function(t,e){return qM(O,t,e)},O.fitWidth=function(t,e){return KM(O,t,e)},O.fitHeight=function(t,e){return ZM(O,t,e)},function(){return e=t.apply(this,arguments),O.invert=e.invert&&R,P()}}function oS(t){var e=0,n=kE/3,r=iS(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*UE,n=t[1]*UE):[e*FE,n*FE]},i}function aS(t,e){var n=$E(t),r=(n+$E(e))/2;if(jE(r)<NE)return function(t){var e=zE(t);function n(t,n){return[t*e,$E(n)/e]}return n.invert=function(t,n){return[t/e,JE(n*e)]},n}(t);var i=1+n*(2*r-n),o=KE(i)/r;function a(t,e){var n=KE(i-2*r*$E(e))/r;return[n*$E(t*=r),o-n*zE(t)]}return a.invert=function(t,e){var n=o-e,a=WE(t,jE(n))*qE(n);return n*r<0&&(a-=kE*qE(t)*qE(n)),[a/r,JE((i-(t*t+n*n)*r*r)/(2*r))]},a}function sS(){return oS(aS).scale(155.424).center([0,33.6442])}function cS(){return sS().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function lS(t){return function(e,n){var r=zE(e),i=zE(n),o=t(r*i);return o===1/0?[2,0]:[o*i*$E(e),o*$E(n)]}}function uS(t){return function(e,n){var r=KE(e*e+n*n),i=t(r),o=$E(i),a=zE(i);return[WE(e*o,r*a),JE(r&&n*o/r)]}}var fS=lS((function(t){return KE(2/(1+t))}));fS.invert=uS((function(t){return 2*JE(t/2)}));var dS=lS((function(t){return(t=QE(t))&&t/$E(t)}));function hS(t,e){return[t,XE(ZE((LE+e)/2))]}function pS(t){var e,n,r,i=rS(t),o=i.center,a=i.scale,s=i.translate,c=i.clipExtent,l=null;function u(){var o=kE*a(),s=i(function(t){function e(e){return(e=t(e[0]*UE,e[1]*UE))[0]*=FE,e[1]*=FE,e}return t=mx(t[0]*UE,t[1]*UE,t.length>2?t[2]*UE:0),e.invert=function(e){return(e=t.invert(e[0]*UE,e[1]*UE))[0]*=FE,e[1]*=FE,e},e}(i.rotate()).invert([0,0]));return c(null==l?[[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]]:t===hS?[[Math.max(s[0]-o,l),e],[Math.min(s[0]+o,n),r]]:[[l,Math.max(s[1]-o,e)],[n,Math.min(s[1]+o,r)]])}return i.scale=function(t){return arguments.length?(a(t),u()):a()},i.translate=function(t){return arguments.length?(s(t),u()):s()},i.center=function(t){return arguments.length?(o(t),u()):o()},i.clipExtent=function(t){return arguments.length?(null==t?l=e=n=r=null:(l=+t[0][0],e=+t[0][1],n=+t[1][0],r=+t[1][1]),u()):null==l?null:[[l,e],[n,r]]},u()}function gS(t){return ZE((LE+t)/2)}function mS(t,e){var n=zE(t),r=t===e?$E(t):XE(n/zE(e))/XE(gS(e)/gS(t)),i=n*YE(gS(t),r)/r;if(!r)return hS;function o(t,e){i>0?e<-LE+NE&&(e=-LE+NE):e>LE-NE&&(e=LE-NE);var n=i/YE(gS(e),r);return[n*$E(r*t),i-n*zE(r*t)]}return o.invert=function(t,e){var n=i-e,o=qE(r)*KE(t*t+n*n),a=WE(t,jE(n))*qE(n);return n*r<0&&(a-=kE*qE(t)*qE(n)),[a/r,2*GE(YE(i/o,1/r))-LE]},o}function vS(t,e){return[t,e]}function yS(t,e){var n=zE(t),r=t===e?$E(t):(n-zE(e))/(e-t),i=n/r+t;if(jE(r)<NE)return vS;function o(t,e){var n=i-e,o=r*t;return[n*$E(o),i-n*zE(o)]}return o.invert=function(t,e){var n=i-e,o=WE(t,jE(n))*qE(n);return n*r<0&&(o-=kE*qE(t)*qE(n)),[o/r,i-qE(r)*KE(t*t+n*n)]},o}dS.invert=uS((function(t){return t})),hS.invert=function(t,e){return[t,2*GE(HE(e))-LE]},vS.invert=vS;var _S=1.340264,bS=-.081106,ES=893e-6,xS=.003796,MS=KE(3)/2;function SS(t,e){var n=JE(MS*$E(e)),r=n*n,i=r*r*r;return[t*zE(n)/(MS*(_S+3*bS*r+i*(7*ES+9*xS*r))),n*(_S+bS*r+i*(ES+xS*r))]}function AS(t,e){var n=zE(e),r=zE(t)*n;return[n*$E(t)/r,$E(e)/r]}function TS(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 OS(t,e){return[zE(e)*$E(t),$E(e)]}function RS(t,e){var n=zE(e),r=1+zE(t)*n;return[n*$E(t)/r,$E(e)/r]}function PS(t,e){return[XE(ZE((LE+e)/2)),-t]}function CS(t,e,n={},r=!1){if(hf(t))return t;if(Array.isArray(t)&&r)return t;const i=cf(t,e);return We(n,i)}function wS(t,e={}){return hf(t)||Array.isArray(t)?t:NS(t)?We(e,t):t}function NS(t){if(0===Object.keys(t).length)return!0;const{title:e,items:n}=t;return void 0!==e||void 0!==n}function IS(t,e){return"object"==typeof t?cf(t,e):t}SS.invert=function(t,e){for(var n,r=e,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=n=(r*(_S+bS*i+o*(ES+xS*i))-e)/(_S+3*bS*i+o*(7*ES+9*xS*i)))*r)*i*i,!(jE(n)<IE));++a);return[MS*t*(_S+3*bS*i+o*(7*ES+9*xS*i))/zE(r),JE($E(r)/MS)]},AS.invert=uS(GE),TS.invert=function(t,e){var n,r=e,i=25;do{var o=r*r,a=o*o;r-=n=(r*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))-e)/(1.007226+o*(.045255+a*(.259866*o-.311325-.005916*11*a)))}while(jE(n)>NE&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},OS.invert=uS(JE),RS.invert=uS((function(t){return 2*GE(t)})),PS.invert=function(t,e){return[-e,2*GE(HE(t))-LE]};var kS=Object.freeze({__proto__:null,geoAlbersUsa:function(){var t,e,n,r,i,o,a=cS(),s=sS().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=sS().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,e){o=[t,e]}};function u(t){var e=t[0],a=t[1];return o=null,n.point(e,a),o||(r.point(e,a),o)||(i.point(e,a),o)}function f(){return t=e=null,u}return u.invert=function(t){var e=a.scale(),n=a.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?s:i>=.166&&i<.234&&r>=-.214&&r<-.115?c:a).invert(t)},u.stream=function(n){return t&&e===n?t:(r=[a.stream(e=n),s.stream(n),c.stream(n)],i=r.length,t={point:function(t,e){for(var n=-1;++n<i;)r[n].point(t,e)},sphere:function(){for(var t=-1;++t<i;)r[t].sphere()},lineStart:function(){for(var t=-1;++t<i;)r[t].lineStart()},lineEnd:function(){for(var t=-1;++t<i;)r[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<i;)r[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<i;)r[t].polygonEnd()}});var r,i},u.precision=function(t){return arguments.length?(a.precision(t),s.precision(t),c.precision(t),f()):a.precision()},u.scale=function(t){return arguments.length?(a.scale(t),s.scale(.35*t),c.scale(t),u.translate(a.translate())):a.scale()},u.translate=function(t){if(!arguments.length)return a.translate();var e=a.scale(),o=+t[0],u=+t[1];return n=a.translate(t).clipExtent([[o-.455*e,u-.238*e],[o+.455*e,u+.238*e]]).stream(l),r=s.translate([o-.307*e,u+.201*e]).clipExtent([[o-.425*e+NE,u+.12*e+NE],[o-.214*e-NE,u+.234*e-NE]]).stream(l),i=c.translate([o-.205*e,u+.212*e]).clipExtent([[o-.214*e+NE,u+.166*e+NE],[o-.115*e-NE,u+.234*e-NE]]).stream(l),f()},u.fitExtent=function(t,e){return $M(u,t,e)},u.fitSize=function(t,e){return qM(u,t,e)},u.fitWidth=function(t,e){return KM(u,t,e)},u.fitHeight=function(t,e){return ZM(u,t,e)},u.scale(1070)},geoAlbers:cS,geoAzimuthalEqualArea:function(){return rS(fS).scale(124.75).clipAngle(179.999)},geoAzimuthalEqualAreaRaw:fS,geoAzimuthalEquidistant:function(){return rS(dS).scale(79.4188).clipAngle(179.999)},geoAzimuthalEquidistantRaw:dS,geoConicConformal:function(){return oS(mS).scale(109.5).parallels([30,30])},geoConicConformalRaw:mS,geoConicEqualArea:sS,geoConicEqualAreaRaw:aS,geoConicEquidistant:function(){return oS(yS).scale(131.154).center([0,13.9389])},geoConicEquidistantRaw:yS,geoEqualEarth:function(){return rS(SS).scale(177.158)},geoEqualEarthRaw:SS,geoEquirectangular:function(){return rS(vS).scale(152.63)},geoEquirectangularRaw:vS,geoGnomonic:function(){return rS(AS).scale(144.049).clipAngle(60)},geoGnomonicRaw:AS,geoIdentity:function(){var t,e,n,r,i,o,a,s=1,c=0,l=0,u=1,f=1,d=0,h=null,p=1,g=1,m=HM({point:function(t,e){var n=_([t,e]);this.stream.point(n[0],n[1])}}),v=Wx;function y(){return p=s*u,g=s*f,o=a=null,_}function _(n){var r=n[0]*p,i=n[1]*g;if(d){var o=i*t-r*e;r=r*t+i*e,i=o}return[r+c,i+l]}return _.invert=function(n){var r=n[0]-c,i=n[1]-l;if(d){var o=i*t+r*e;r=r*t-i*e,i=o}return[r/p,i/g]},_.stream=function(t){return o&&a===t?o:o=m(v(a=t))},_.postclip=function(t){return arguments.length?(v=t,h=n=r=i=null,y()):v},_.clipExtent=function(t){return arguments.length?(v=null==t?(h=n=r=i=null,Wx):kx(h=+t[0][0],n=+t[0][1],r=+t[1][0],i=+t[1][1]),y()):null==h?null:[[h,n],[r,i]]},_.scale=function(t){return arguments.length?(s=+t,y()):s},_.translate=function(t){return arguments.length?(c=+t[0],l=+t[1],y()):[c,l]},_.angle=function(n){return arguments.length?(e=$E(d=n%360*UE),t=zE(d),y()):d*FE},_.reflectX=function(t){return arguments.length?(u=t?-1:1,y()):u<0},_.reflectY=function(t){return arguments.length?(f=t?-1:1,y()):f<0},_.fitExtent=function(t,e){return $M(_,t,e)},_.fitSize=function(t,e){return qM(_,t,e)},_.fitWidth=function(t,e){return KM(_,t,e)},_.fitHeight=function(t,e){return ZM(_,t,e)},_},geoProjection:rS,geoProjectionMutator:iS,geoMercator:function(){return pS(hS).scale(961/BE)},geoMercatorRaw:hS,geoNaturalEarth1:function(){return rS(TS).scale(175.295)},geoNaturalEarth1Raw:TS,geoOrthographic:function(){return rS(OS).scale(249.5).clipAngle(90+NE)},geoOrthographicRaw:OS,geoStereographic:function(){return rS(RS).scale(250).clipAngle(142)},geoStereographicRaw:RS,geoTransverseMercator:function(){var t=pS(PS),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)},geoTransverseMercatorRaw:PS});function LS(t,e,n,r){const i=()=>{const t=e.filter(BS),n=t.find((t=>t.sphere));return n?{type:"Sphere"}:(r=t.filter((t=>!t.sphere)).flatMap((t=>t.data.value)),{type:"FeatureCollection",features:r.flatMap((t=>function(t){const e={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featureCollection"};if(!t||!t.type)return null;const n=e[t.type];return n?"geometry"===n?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]}:"feature"===n?{type:"FeatureCollection",features:[t]}:"featureCollection"===n?t:void 0:null}(t).features))});var r},{outline:o=i()}=r,{size:a="fitExtent"}=r;return"fitExtent"===a?function(t,e,n){const{x:r,y:i,width:o,height:a}=n;t.fitExtent([[r,i],[o,a]],e)}(t,o,n):"fitWidth"===a?function(t,e,n){const{width:r,height:i}=n,[[o,a],[s,c]]=VM(t.fitWidth(r,e)).bounds(e),l=Math.ceil(c-a),u=Math.min(Math.ceil(s-o),l),f=t.scale()*(u-1)/u,[d,h]=t.translate(),p=h+(i-l)/2;t.scale(f).translate([d,p]).precision(.2)}(t,o,n):void 0}function DS(t){const{data:e}=t;if(Array.isArray(e))return Object.assign(Object.assign({},t),{data:{value:e}});const{type:n}=e;return"graticule10"===n?Object.assign(Object.assign({},t),{data:{value:[Bx()]}}):"sphere"===n?Object.assign(Object.assign({},t),{sphere:!0,data:{value:[{type:"Sphere"}]}}):t}function BS(t){return"geoPath"===t.type}const FS=()=>t=>{const{children:e,coordinate:n={}}=t;if(!Array.isArray(e))return[];const{type:r="equalEarth"}=n,i=o(n,["type"]),a=function(t){if("function"==typeof t)return t;const e=`geo${Ie(t)}`,n=kS[e];if(!n)throw new Error(`Unknown coordinate: ${t}`);return n}(r),s=e.map(DS);let c;return[Object.assign(Object.assign({},t),{type:"view",scale:{x:{type:"identity"},y:{type:"identity"}},axis:!1,coordinate:{type:function(){return[["custom",(t,e,n,r)=>{const o=a();LS(o,s,{x:t,y:e,width:n,height:r},i),function(t,e){var n;for(const[r,i]of Object.entries(e))null===(n=t[r])||void 0===n||n.call(t,i)}(o,i),c=VM(o);const l=new ep({domain:[t,t+n]}),u=new ep({domain:[e,e+r]});return{transform:t=>(t=>{const e=o(t);if(!e)return[null,null];const[n,r]=e;return[l.map(n),u.map(r)]})(t),untransform:t=>(t=>{if(!t)return null;const[e,n]=t,r=[l.invert(e),u.invert(n)];return o.invert(r)})(t)}}]]}},children:s.flatMap((t=>BS(t)?function(t){const{style:e,tooltip:n={}}=t;return Object.assign(Object.assign({},t),{type:"path",tooltip:wS(n,{title:"id",items:[{channel:"color"}]}),style:Object.assign(Object.assign({},e),{d:t=>c(t)||[]})})}(t):t))})]};function US(t){return function(){return t}}FS.props={};const jS=Math.abs,GS=Math.atan2,WS=Math.cos,zS=Math.max,VS=Math.min,HS=Math.sin,XS=Math.sqrt,YS=1e-12,$S=Math.PI,qS=$S/2,KS=2*$S;function ZS(t){return t>=1?qS:t<=-1?-qS:Math.asin(t)}const QS=Math.PI,JS=2*QS,tA=1e-6,eA=JS-tA;function nA(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class rA{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?nA:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return nA;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=Math.round(arguments[e]*n)/n+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,r){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(t,e,n,r,i,o){this._append`C${+t},${+e},${+n},${+r},${this._x1=+i},${this._y1=+o}`}arcTo(t,e,n,r,i){if(t=+t,e=+e,n=+n,r=+r,(i=+i)<0)throw new Error(`negative radius: ${i}`);let o=this._x1,a=this._y1,s=n-t,c=r-e,l=o-t,u=a-e,f=l*l+u*u;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(f>tA)if(Math.abs(u*s-c*l)>tA&&i){let d=n-o,h=r-a,p=s*s+c*c,g=d*d+h*h,m=Math.sqrt(p),v=Math.sqrt(f),y=i*Math.tan((QS-Math.acos((p+f-g)/(2*m*v)))/2),_=y/v,b=y/m;Math.abs(_-1)>tA&&this._append`L${t+_*l},${e+_*u}`,this._append`A${i},${i},0,0,${+(u*d>l*h)},${this._x1=t+b*s},${this._y1=e+b*c}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,n,r,i,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(r),s=n*Math.sin(r),c=t+a,l=e+s,u=1^o,f=o?r-i:i-r;null===this._x1?this._append`M${c},${l}`:(Math.abs(this._x1-c)>tA||Math.abs(this._y1-l)>tA)&&this._append`L${c},${l}`,n&&(f<0&&(f=f%JS+JS),f>eA?this._append`A${n},${n},0,1,${u},${t-a},${e-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:f>tA&&this._append`A${n},${n},0,${+(f>=QS)},${u},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function iA(){return new rA}function oA(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new rA(e)}function aA(t){return t.innerRadius}function sA(t){return t.outerRadius}function cA(t){return t.startAngle}function lA(t){return t.endAngle}function uA(t){return t&&t.padAngle}function fA(t,e,n,r,i,o,a){var s=t-n,c=e-r,l=(a?o:-o)/XS(s*s+c*c),u=l*c,f=-l*s,d=t+u,h=e+f,p=n+u,g=r+f,m=(d+p)/2,v=(h+g)/2,y=p-d,_=g-h,b=y*y+_*_,E=i-o,x=d*g-p*h,M=(_<0?-1:1)*XS(zS(0,E*E*b-x*x)),S=(x*_-y*M)/b,A=(-x*y-_*M)/b,T=(x*_+y*M)/b,O=(-x*y+_*M)/b,R=S-m,P=A-v,C=T-m,w=O-v;return R*R+P*P>C*C+w*w&&(S=T,A=O),{cx:S,cy:A,x01:-u,y01:-f,x11:S*(i/E-1),y11:A*(i/E-1)}}function dA(){var t=aA,e=sA,n=US(0),r=null,i=cA,o=lA,a=uA,s=null,c=oA(l);function l(){var l,u,f=+t.apply(this,arguments),d=+e.apply(this,arguments),h=i.apply(this,arguments)-qS,p=o.apply(this,arguments)-qS,g=jS(p-h),m=p>h;if(s||(s=l=c()),d<f&&(u=d,d=f,f=u),d>YS)if(g>KS-YS)s.moveTo(d*WS(h),d*HS(h)),s.arc(0,0,d,h,p,!m),f>YS&&(s.moveTo(f*WS(p),f*HS(p)),s.arc(0,0,f,p,h,m));else{var v,y,_=h,b=p,E=h,x=p,M=g,S=g,A=a.apply(this,arguments)/2,T=A>YS&&(r?+r.apply(this,arguments):XS(f*f+d*d)),O=VS(jS(d-f)/2,+n.apply(this,arguments)),R=O,P=O;if(T>YS){var C=ZS(T/f*HS(A)),w=ZS(T/d*HS(A));(M-=2*C)>YS?(E+=C*=m?1:-1,x-=C):(M=0,E=x=(h+p)/2),(S-=2*w)>YS?(_+=w*=m?1:-1,b-=w):(S=0,_=b=(h+p)/2)}var N=d*WS(_),I=d*HS(_),k=f*WS(x),L=f*HS(x);if(O>YS){var D,B=d*WS(b),F=d*HS(b),U=f*WS(E),j=f*HS(E);if(g<$S)if(D=function(t,e,n,r,i,o,a,s){var c=n-t,l=r-e,u=a-i,f=s-o,d=f*c-u*l;if(!(d*d<YS))return[t+(d=(u*(e-o)-f*(t-i))/d)*c,e+d*l]}(N,I,U,j,B,F,k,L)){var G=N-D[0],W=I-D[1],z=B-D[0],V=F-D[1],H=1/HS(function(t){return t>1?0:t<-1?$S:Math.acos(t)}((G*z+W*V)/(XS(G*G+W*W)*XS(z*z+V*V)))/2),X=XS(D[0]*D[0]+D[1]*D[1]);R=VS(O,(f-X)/(H-1)),P=VS(O,(d-X)/(H+1))}else R=P=0}S>YS?P>YS?(v=fA(U,j,N,I,d,P,m),y=fA(B,F,k,L,d,P,m),s.moveTo(v.cx+v.x01,v.cy+v.y01),P<O?s.arc(v.cx,v.cy,P,GS(v.y01,v.x01),GS(y.y01,y.x01),!m):(s.arc(v.cx,v.cy,P,GS(v.y01,v.x01),GS(v.y11,v.x11),!m),s.arc(0,0,d,GS(v.cy+v.y11,v.cx+v.x11),GS(y.cy+y.y11,y.cx+y.x11),!m),s.arc(y.cx,y.cy,P,GS(y.y11,y.x11),GS(y.y01,y.x01),!m))):(s.moveTo(N,I),s.arc(0,0,d,_,b,!m)):s.moveTo(N,I),f>YS&&M>YS?R>YS?(v=fA(k,L,B,F,f,-R,m),y=fA(N,I,U,j,f,-R,m),s.lineTo(v.cx+v.x01,v.cy+v.y01),R<O?s.arc(v.cx,v.cy,R,GS(v.y01,v.x01),GS(y.y01,y.x01),!m):(s.arc(v.cx,v.cy,R,GS(v.y01,v.x01),GS(v.y11,v.x11),!m),s.arc(0,0,f,GS(v.cy+v.y11,v.cx+v.x11),GS(y.cy+y.y11,y.cx+y.x11),m),s.arc(y.cx,y.cy,R,GS(y.y11,y.x11),GS(y.y01,y.x01),!m))):s.arc(0,0,f,x,E,m):s.lineTo(k,L)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-$S/2;return[WS(r)*n,HS(r)*n]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:US(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:US(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:US(+t),l):n},l.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:US(+t),l):r},l.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:US(+t),l):i},l.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:US(+t),l):o},l.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:US(+t),l):a},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function hA(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function pA(t){this._context=t}function gA(t){return new pA(t)}function mA(t){return t[0]}function vA(t){return t[1]}function yA(t,e){var n=US(!0),r=null,i=gA,o=null,a=oA(s);function s(s){var c,l,u,f=(s=hA(s)).length,d=!1;for(null==r&&(o=i(u=a())),c=0;c<=f;++c)!(c<f&&n(l=s[c],c,s))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+t(l,c,s),+e(l,c,s));if(u)return o=null,u+""||null}return t="function"==typeof t?t:void 0===t?mA:US(t),e="function"==typeof e?e:void 0===e?vA:US(e),s.x=function(e){return arguments.length?(t="function"==typeof e?e:US(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:US(+t),s):e},s.defined=function(t){return arguments.length?(n="function"==typeof t?t:US(!!t),s):n},s.curve=function(t){return arguments.length?(i=t,null!=r&&(o=i(r)),s):i},s.context=function(t){return arguments.length?(null==t?r=o=null:o=i(r=t),s):r},s}function _A(t,e,n){var r=null,i=US(!0),o=null,a=gA,s=null,c=oA(l);function l(l){var u,f,d,h,p,g=(l=hA(l)).length,m=!1,v=new Array(g),y=new Array(g);for(null==o&&(s=a(p=c())),u=0;u<=g;++u){if(!(u<g&&i(h=l[u],u,l))===m)if(m=!m)f=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=u-1;d>=f;--d)s.point(v[d],y[d]);s.lineEnd(),s.areaEnd()}m&&(v[u]=+t(h,u,l),y[u]=+e(h,u,l),s.point(r?+r(h,u,l):v[u],n?+n(h,u,l):y[u]))}if(p)return s=null,p+""||null}function u(){return yA().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?mA:US(+t),e="function"==typeof e?e:US(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?vA:US(+n),l.x=function(e){return arguments.length?(t="function"==typeof e?e:US(+e),r=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:US(+e),l):t},l.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:US(+t),l):r},l.y=function(t){return arguments.length?(e="function"==typeof t?t:US(+t),n=null,l):e},l.y0=function(t){return arguments.length?(e="function"==typeof t?t:US(+t),l):e},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:US(+t),l):n},l.lineX0=l.lineY0=function(){return u().x(t).y(e)},l.lineY1=function(){return u().x(t).y(n)},l.lineX1=function(){return u().x(r).y(e)},l.defined=function(t){return arguments.length?(i="function"==typeof t?t:US(!!t),l):i},l.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),l):a},l.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),l):o},l}iA.prototype=rA.prototype,pA.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 bA=xA(gA);function EA(t){this._curve=t}function xA(t){function e(e){return new EA(t(e))}return e._curve=t,e}function MA(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(xA(t)):e()._curve},t}function SA(){}function AA(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 TA(t,e){this._context=t,this._k=(1-e)/6}function OA(t,e){this._context=t,this._k=(1-e)/6}function RA(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>YS){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>YS){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*l+t._x1*t._l23_2a-e*t._l12_2a)/u,a=(a*l+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function PA(t,e){this._context=t,this._alpha=e}EA.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))}},TA.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:AA(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:AA(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new TA(t,e)}return n.tension=function(e){return t(+e)},n}(0),OA.prototype={areaStart:SA,areaEnd:SA,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:AA(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new OA(t,e)}return n.tension=function(e){return t(+e)},n}(0),PA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:RA(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 CA=function t(e){function n(t){return e?new PA(t,e):new TA(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function wA(t,e){this._context=t,this._alpha=e}wA.prototype={areaStart:SA,areaEnd:SA,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:RA(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 NA=function t(e){function n(t){return e?new wA(t,e):new OA(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function IA(t){this._context=t}function kA(t){return new IA(t)}function LA(t,e){this._context=t,this._t=e}function DA(t){return new LA(t,.5)}function BA(t){return new LA(t,0)}function FA(t){return new LA(t,1)}function UA(t,e,n){return Math.max(e,Math.min(t,n))}function jA(t,e,n,r,i={}){const{inset:a=0,radius:s=0,insetLeft:c=a,insetTop:l=a,insetRight:u=a,insetBottom:f=a,radiusBottomLeft:d=s,radiusBottomRight:h=s,radiusTopLeft:p=s,radiusTopRight:g=s,minWidth:m=-1/0,maxWidth:v=1/0}=i,y=o(i,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth"]);if(!t_(r)&&!n_(r)){const n=!!Jy(r),[i,,o]=n?Pb(e):e,[a,s]=i,[_,b]=yb(o,i),E=(_>0?a:a+_)+c,x=(b>0?s:s+b)+l,M=Math.abs(_)-(c+u),S=Math.abs(b)-(l+f),A=n?M:UA(M,m,v),T=n?UA(S,m,v):S,O=E-(A-M)/2,R=x-(T-S)/2;return gf(t.createElement("rect",{})).style("x",O).style("y",R).style("width",A).style("height",T).style("radius",[p,g,h,d]).call(Tb,y).node()}const{y:_,y1:b}=n,E=r.getCenter(),x=Cb(r,e,[_,b]),M=dA().cornerRadius(s).padAngle(a*Math.PI/180);return gf(t.createElement("path",{})).style("path",M(x)).style("transform",`translate(${E[0]}, ${E[1]})`).style("radius",s).style("inset",a).call(Tb,y).node()}IA.prototype={areaStart:SA,areaEnd:SA,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))}},LA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};const GA=(t,e)=>{const{colorAttribute:n,opacityAttribute:r="fill",first:i=!0,last:a=!0}=t,s=o(t,["colorAttribute","opacityAttribute","first","last"]),{coordinate:c,document:l}=e;return(e,r,u)=>{const{color:f,radius:d=0}=u,h=o(u,["color","radius"]),p=h.lineWidth||1,{stroke:g,radius:m=d,radiusTopLeft:v=m,radiusTopRight:y=m,radiusBottomRight:_=m,radiusBottomLeft:b=m,innerRadius:E=0,innerRadiusTopLeft:x=E,innerRadiusTopRight:M=E,innerRadiusBottomRight:S=E,innerRadiusBottomLeft:A=E,lineWidth:T=("stroke"===n||g?p:0),inset:O=0,insetLeft:R=O,insetRight:P=O,insetBottom:C=O,insetTop:w=O,minWidth:N,maxWidth:I}=s,k=o(s,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop","minWidth","maxWidth"]),{color:L=f,opacity:D}=r,B=[i?v:x,i?y:M,a?_:S,a?b:A],F=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"];Jy(c)&&F.push(F.shift());const U=Object.assign(Object.assign({radius:m},Object.fromEntries(F.map(((t,e)=>[t,B[e]])))),{inset:O,insetLeft:R,insetRight:P,insetBottom:C,insetTop:w,minWidth:N,maxWidth:I});return gf(jA(l,e,r,c,U)).call(Tb,h).style("fill","transparent").style(n,L).style(wb(t),D).style("lineWidth",T).style("stroke",void 0===g?L:g).call(Tb,k).node()}};GA.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const WA=(t,e)=>GA(Object.assign({colorAttribute:"fill"},t),e);WA.props=Object.assign(Object.assign({},GA.props),{defaultMarker:"square"});const zA=(t,e)=>GA(Object.assign({colorAttribute:"stroke"},t),e);function VA(t,e,n){const[r,i,o,a]=t;if(Jy(n)){return[r,[e?e[0][0]:i[0],i[1]],[e?e[3][0]:o[0],o[1]],a]}return[r,[i[0],e?e[0][1]:i[1]],[o[0],e?e[3][1]:o[1]],a]}zA.props=Object.assign(Object.assign({},GA.props),{defaultMarker:"hollowSquare"});const HA=(t,e)=>{const{adjustPoints:n=VA}=t,r=o(t,["adjustPoints"]),{coordinate:i,document:a}=e;return(t,e,s,c)=>{const{index:l}=e,{color:u}=s,f=o(s,["color"]),d=c[l+1],h=n(t,d,i),p=!!Jy(i),[g,m,v,y]=p?Pb(h):h,{color:_=u,opacity:b}=e,E=yA().curve(kA)([g,m,v,y]);return gf(a.createElement("path",{})).call(Tb,f).style("path",E).style("fill",_).style("fillOpacity",b).call(Tb,r).node()}};function XA(t,e,n){const[r,i,o,a]=t;if(Jy(n)){return[r,[e?e[0][0]:(i[0]+o[0])/2,i[1]],[e?e[3][0]:(i[0]+o[0])/2,o[1]],a]}return[r,[i[0],e?e[0][1]:(i[1]+o[1])/2],[o[0],e?e[3][1]:(i[1]+o[1])/2],a]}HA.props={defaultMarker:"square"};const YA=(t,e)=>HA(Object.assign({adjustPoints:XA},t),e);function $A(t){const e="function"==typeof t?t:t.render;return class extends Ss{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}YA.props={defaultMarker:"square"};const qA=$A((t=>{const{d1:e,d2:n,style1:r,style2:i}=t.attributes,o=t.ownerDocument;gf(t).maybeAppend("line",(()=>o.createElement("path",{}))).style("d",e).call(Tb,r),gf(t).maybeAppend("line1",(()=>o.createElement("path",{}))).style("d",n).call(Tb,i)}));const KA=(t,e)=>{const{curve:n,gradient:r=!1,gradientColor:i="between",defined:a=(t=>!Number.isNaN(t)&&null!=t),connect:s=!1}=t,c=o(t,["curve","gradient","gradientColor","defined","connect"]),{coordinate:l,document:u}=e;return(t,e,f)=>{const{color:d,lineWidth:h}=f,p=o(f,["color","lineWidth"]),{color:g=d,size:m=h,seriesColor:v,seriesX:y,seriesY:_}=e,b=r&&v?Rb(v,y,_,r,i):g,E=Nb(l,e),x=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},p),b&&{stroke:b}),m&&{lineWidth:m}),E&&{transform:E}),c);let M;if(t_(l)){const t=l.getCenter();M=e=>MA(yA().curve(bA)).angle(((n,r)=>xb(yb(e[r],t)))).radius(((n,r)=>bb(e[r],t))).defined((([t,e])=>a(t)&&a(e))).curve(n)(e)}else M=yA().x((t=>t[0])).y((t=>t[1])).defined((([t,e])=>a(t)&&a(e))).curve(n);const[S,A]=function(t,e){const n=[],r=[];let i=!1,o=null;for(const a of t)e(a[0])&&e(a[1])?(n.push(a),i&&(i=!1,r.push([o,a])),o=a):i=!0;return[n,r]}(t,a),T=cf(x,"connect"),O=!!A.length;if(!O||s&&!Object.keys(T).length)return gf(u.createElement("path",{})).style("d",M(S)||[]).call(Tb,x).node();if(O&&!s)return gf(u.createElement("path",{})).style("d",M(t)).call(Tb,x).node();return gf(new qA).style("style1",Object.assign(Object.assign({},x),T)).style("style2",x).style("d1",(R=A,R.map(M).join(","))).style("d2",M(t)).node();var R}};KA.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const ZA=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=t_(n)?kA:gA;return KA(Object.assign({curve:i},t),e)(...r)}};ZA.props=Object.assign(Object.assign({},KA.props),{defaultMarker:"line"});const QA=(t,e)=>{const{alpha:n=.5}=t,r=o(t,["alpha"]),{coordinate:i}=e;return(...t)=>{const o=t_(i)?NA:CA;return KA(Object.assign({curve:o.alpha(n)},r),e)(...t)}};QA.props=Object.assign(Object.assign({},KA.props),{defaultMarker:"smooth"});const JA=(t,e)=>KA(Object.assign({curve:FA},t),e);JA.props=Object.assign(Object.assign({},KA.props),{defaultMarker:"hv"});const tT=(t,e)=>KA(Object.assign({curve:BA},t),e);tT.props=Object.assign(Object.assign({},KA.props),{defaultMarker:"vh"});const eT=(t,e)=>KA(Object.assign({curve:DA},t),e);function nT(t,e,n,r,i){const o=Eb(yb(n,e)),a=o+Math.PI/2,s=[r/2*Math.cos(a),r/2*Math.sin(a)],c=[i/2*Math.cos(a),i/2*Math.sin(a)],l=[i/2*Math.cos(o),i/2*Math.sin(o)],u=[r/2*Math.cos(o),r/2*Math.sin(o)],f=_b(e,s),d=_b(n,c),h=_b(d,l),p=_b(n,l),g=yb(p,c),m=yb(n,c),v=yb(e,s),y=yb(v,u),_=yb(e,u),b=yb(f,u);t.moveTo(...f),t.lineTo(...d),t.arcTo(...h,...p,i/2),t.arcTo(...g,...m,i/2),t.lineTo(...v),t.arcTo(...y,..._,r/2),t.arcTo(...b,...f,r/2),t.closePath()}eT.props=Object.assign(Object.assign({},KA.props),{defaultMarker:"hvh"});const rT=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{seriesSize:a,color:s}=r,{color:c}=i,l=o(i,["color"]),u=iA();for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1],i=a[t],o=a[t+1];[...n,...r].every(af)&&nT(u,n,r,i,o)}return gf(n.createElement("path",{})).call(Tb,l).style("fill",s||c).style("d",u.toString()).call(Tb,t).node()}};rT.props=Object.assign(Object.assign({},KA.props),{defaultMarker:"line"});const iT=(t,e)=>(t,e,n)=>{const{color:r,lineWidth:i}=n,a=o(n,["color","lineWidth"]),{color:s=r,size:c=i}=e,l=s,u=Object.assign(Object.assign(Object.assign({isBillboard:!0},a),l&&{stroke:l}),c&&{lineWidth:c});return gf(new Ns).style("points",t).call(Tb,u).node()};iT.props={defaultMarker:"line"};const oT=(t,e)=>{const{colorAttribute:n,symbol:r,mode:i="auto"}=t,a=o(t,["colorAttribute","symbol","mode"]),s=ob.get(r)||ob.get("point"),{coordinate:c,document:l}=e;return(e,r,o)=>{const{lineWidth:u,color:f}=o,d=a.stroke?u||1:u,{color:h=f,transform:p,opacity:g}=r,[m,v]=Ib(e),y=function(t,e,n,r){if(1===e.length)return;const{size:i}=n;if("fixed"===t)return i;if("normal"===t||i_(r)){const[[t,n],[r,i]]=e,o=Math.abs((r-t)/2),a=Math.abs((i-n)/2);return Math.max(0,(o+a)/2)}return i}(i,e,r,c),_=y||a.r||o.r;return gf(l.createElement("path",{})).call(Tb,o).style("fill","transparent").style("d",s(m,v,_)).style("lineWidth",d).style("transform",p).style("stroke",h).style(wb(t),g).style(n,h).call(Tb,a).node()}};oT.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const aT=(t,e)=>oT(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e);aT.props=Object.assign({defaultMarker:"hollowBowtie"},oT.props);const sT=(t,e)=>oT(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e);sT.props=Object.assign({defaultMarker:"hollowDiamond"},oT.props);const cT=(t,e)=>oT(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e);cT.props=Object.assign({defaultMarker:"hollowHexagon"},oT.props);const lT=(t,e)=>oT(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e);lT.props=Object.assign({defaultMarker:"hollowPoint"},oT.props);const uT=(t,e)=>oT(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e);uT.props=Object.assign({defaultMarker:"hollowSquare"},oT.props);const fT=(t,e)=>oT(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e);fT.props=Object.assign({defaultMarker:"hollowTriangle"},oT.props);const dT=(t,e)=>oT(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e);dT.props=Object.assign({defaultMarker:"hollowTriangleDown"},oT.props);const hT=(t,e)=>oT(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e);hT.props=Object.assign({defaultMarker:"bowtie"},oT.props);const pT=(t,e)=>oT(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e);pT.props=Object.assign({defaultMarker:"cross"},oT.props);const gT=(t,e)=>oT(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e);gT.props=Object.assign({defaultMarker:"diamond"},oT.props);const mT=(t,e)=>oT(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e);mT.props=Object.assign({defaultMarker:"hexagon"},oT.props);const vT=(t,e)=>oT(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e);vT.props=Object.assign({defaultMarker:"hyphen"},oT.props);const yT=(t,e)=>oT(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e);yT.props=Object.assign({defaultMarker:"line"},oT.props);const _T=(t,e)=>oT(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e);_T.props=Object.assign({defaultMarker:"plus"},oT.props);const bT=(t,e)=>oT(Object.assign({colorAttribute:"fill",symbol:"point"},t),e);bT.props=Object.assign({defaultMarker:"point"},oT.props);const ET=(t,e)=>oT(Object.assign({colorAttribute:"fill",symbol:"square"},t),e);ET.props=Object.assign({defaultMarker:"square"},oT.props);const xT=(t,e)=>oT(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e);xT.props=Object.assign({defaultMarker:"tick"},oT.props);const MT=(t,e)=>oT(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e);MT.props=Object.assign({defaultMarker:"triangle"},oT.props);const ST=(t,e)=>oT(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e);ST.props=Object.assign({defaultMarker:"triangleDown"},oT.props);var AT={exports:{}};function TT(t,e,n){n=n||2;var r,i,o,a,s,c,l,u=e&&e.length,f=u?e[0]*n:t.length,d=OT(t,0,f,n,!0),h=[];if(!d||d.next===d.prev)return h;if(u&&(d=function(t,e,n,r){var i,o,a,s=[];for(i=0,o=e.length;i<o;i++)(a=OT(t,e[i]*r,i<o-1?e[i+1]*r:t.length,r,!1))===a.next&&(a.steiner=!0),s.push(FT(a));for(s.sort(kT),i=0;i<s.length;i++)n=LT(s[i],n);return n}(t,e,d,n)),t.length>80*n){r=o=t[0],i=a=t[1];for(var p=n;p<f;p+=n)(s=t[p])<r&&(r=s),(c=t[p+1])<i&&(i=c),s>o&&(o=s),c>a&&(a=c);l=0!==(l=Math.max(o-r,a-i))?32767/l:0}return PT(d,h,n,r,i,l,0),h}function OT(t,e,n,r,i){var o,a;if(i===ZT(t,e,n,r)>0)for(o=e;o<n;o+=r)a=$T(o,t[o],t[o+1],a);else for(o=n-r;o>=e;o-=r)a=$T(o,t[o],t[o+1],a);return a&&WT(a,a.next)&&(qT(a),a=a.next),a}function RT(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!WT(r,r.next)&&0!==GT(r.prev,r,r.next))r=r.next;else{if(qT(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function PT(t,e,n,r,i,o,a){if(t){!a&&o&&function(t,e,n,r){var i=t;do{0===i.z&&(i.z=BT(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,a,s,c,l=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,r=n,s=0,e=0;e<l&&(s++,r=r.nextZ);e++);for(c=l;s>0||c>0&&r;)0!==s&&(0===c||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,c--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(a>1)}(i)}(t,r,i,o);for(var s,c,l=t;t.prev!==t.next;)if(s=t.prev,c=t.next,o?wT(t,r,i,o):CT(t))e.push(s.i/n|0),e.push(t.i/n|0),e.push(c.i/n|0),qT(t),t=c.next,l=c.next;else if((t=c)===l){a?1===a?PT(t=NT(RT(t),e,n),e,n,r,i,o,2):2===a&&IT(t,e,n,r,i,o):PT(RT(t),e,n,r,i,o,1);break}}}function CT(t){var e=t.prev,n=t,r=t.next;if(GT(e,n,r)>=0)return!1;for(var i=e.x,o=n.x,a=r.x,s=e.y,c=n.y,l=r.y,u=i<o?i<a?i:a:o<a?o:a,f=s<c?s<l?s:l:c<l?c:l,d=i>o?i>a?i:a:o>a?o:a,h=s>c?s>l?s:l:c>l?c:l,p=r.next;p!==e;){if(p.x>=u&&p.x<=d&&p.y>=f&&p.y<=h&&UT(i,s,o,c,a,l,p.x,p.y)&>(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function wT(t,e,n,r){var i=t.prev,o=t,a=t.next;if(GT(i,o,a)>=0)return!1;for(var s=i.x,c=o.x,l=a.x,u=i.y,f=o.y,d=a.y,h=s<c?s<l?s:l:c<l?c:l,p=u<f?u<d?u:d:f<d?f:d,g=s>c?s>l?s:l:c>l?c:l,m=u>f?u>d?u:d:f>d?f:d,v=BT(h,p,e,n,r),y=BT(g,m,e,n,r),_=t.prevZ,b=t.nextZ;_&&_.z>=v&&b&&b.z<=y;){if(_.x>=h&&_.x<=g&&_.y>=p&&_.y<=m&&_!==i&&_!==a&&UT(s,u,c,f,l,d,_.x,_.y)&>(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,b.x>=h&&b.x<=g&&b.y>=p&&b.y<=m&&b!==i&&b!==a&&UT(s,u,c,f,l,d,b.x,b.y)&>(b.prev,b,b.next)>=0)return!1;b=b.nextZ}for(;_&&_.z>=v;){if(_.x>=h&&_.x<=g&&_.y>=p&&_.y<=m&&_!==i&&_!==a&&UT(s,u,c,f,l,d,_.x,_.y)&>(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;b&&b.z<=y;){if(b.x>=h&&b.x<=g&&b.y>=p&&b.y<=m&&b!==i&&b!==a&&UT(s,u,c,f,l,d,b.x,b.y)&>(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function NT(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!WT(i,o)&&zT(i,r,r.next,o)&&XT(i,o)&&XT(o,i)&&(e.push(i.i/n|0),e.push(r.i/n|0),e.push(o.i/n|0),qT(r),qT(r.next),r=t=o),r=r.next}while(r!==t);return RT(r)}function IT(t,e,n,r,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&jT(a,s)){var c=YT(a,s);return a=RT(a,a.next),c=RT(c,c.next),PT(a,e,n,r,i,o,0),void PT(c,e,n,r,i,o,0)}s=s.next}a=a.next}while(a!==t)}function kT(t,e){return t.x-e.x}function LT(t,e){var n=function(t,e){var n,r=e,i=t.x,o=t.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a&&(a=s,n=r.x<r.next.x?r:r.next,s===i))return n}r=r.next}while(r!==e);if(!n)return null;var c,l=n,u=n.x,f=n.y,d=1/0;r=n;do{i>=r.x&&r.x>=u&&i!==r.x&&UT(o<f?i:a,o,u,f,o<f?a:i,o,r.x,r.y)&&(c=Math.abs(o-r.y)/(i-r.x),XT(r,t)&&(c<d||c===d&&(r.x>n.x||r.x===n.x&&DT(n,r)))&&(n=r,d=c)),r=r.next}while(r!==l);return n}(t,e);if(!n)return e;var r=YT(n,t);return RT(r,r.next),RT(n,n.next)}function DT(t,e){return GT(t.prev,t,e.prev)<0&>(e.next,t,t.next)<0}function BT(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function FT(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function UT(t,e,n,r,i,o,a,s){return(i-a)*(e-s)>=(t-a)*(o-s)&&(t-a)*(r-s)>=(n-a)*(e-s)&&(n-a)*(o-s)>=(i-a)*(r-s)}function jT(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&zT(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(XT(t,e)&&XT(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(GT(t.prev,t,e.prev)||GT(t,e.prev,e))||WT(t,e)&>(t.prev,t,t.next)>0&>(e.prev,e,e.next)>0)}function GT(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function WT(t,e){return t.x===e.x&&t.y===e.y}function zT(t,e,n,r){var i=HT(GT(t,e,n)),o=HT(GT(t,e,r)),a=HT(GT(n,r,t)),s=HT(GT(n,r,e));return i!==o&&a!==s||(!(0!==i||!VT(t,n,e))||(!(0!==o||!VT(t,r,e))||(!(0!==a||!VT(n,t,r))||!(0!==s||!VT(n,e,r)))))}function VT(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function HT(t){return t>0?1:t<0?-1:0}function XT(t,e){return GT(t.prev,t,t.next)<0?GT(t,e,t.next)>=0&>(t,t.prev,e)>=0:GT(t,e,t.prev)<0||GT(t,t.next,e)<0}function YT(t,e){var n=new KT(t.i,t.x,t.y),r=new KT(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function $T(t,e,n,r){var i=new KT(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function qT(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function KT(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ZT(t,e,n,r){for(var i=0,o=e,a=n-r;o<n;o+=r)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}AT.exports=TT,AT.exports.default=TT,TT.deviation=function(t,e,n,r){var i=e&&e.length,o=i?e[0]*n:t.length,a=Math.abs(ZT(t,0,o,n));if(i)for(var s=0,c=e.length;s<c;s++){var l=e[s]*n,u=s<c-1?e[s+1]*n:t.length;a-=Math.abs(ZT(t,l,u,n))}var f=0;for(s=0;s<r.length;s+=3){var d=r[s]*n,h=r[s+1]*n,p=r[s+2]*n;f+=Math.abs((t[d]-t[p])*(t[h+1]-t[d+1])-(t[d]-t[h])*(t[p+1]-t[d+1]))}return 0===a&&0===f?0:Math.abs((f-a)/a)},TT.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var a=0;a<e;a++)n.vertices.push(t[i][o][a]);i>0&&(r+=t[i-1].length,n.holes.push(r))}return n};var QT,JT,tO,eO,nO,rO,iO,oO,aO,sO,cO,lO,uO,fO,dO,hO,pO,gO,mO,vO,yO,_O,bO,EO,xO,MO,SO,AO=AT.exports,TO=function(){function t(){this.drawcalls=[]}return t.tag="c-renderable-3d",t}(),OO=function(){function t(){this.lights=[]}return t.prototype.addLight=function(t){this.lights.push(t),this.sortLights()},t.prototype.removeLight=function(t){var e=this.lights.indexOf(t);this.lights.splice(e,1),this.sortLights()},t.prototype.addFog=function(t){this.fog=t},t.prototype.removeFog=function(t){this.fog=null},t.prototype.getFog=function(){return this.fog},t.prototype.getAllLights=function(){return this.lights},t.prototype.getDefines=function(){var t={USE_LIGHT:!!this.lights.length};return this.lights.forEach((function(e){t[e.define]||(t[e.define]=0),t[e.define]++})),t},t.prototype.sortLights=function(){this.lights.sort((function(t,e){return t.order-e.order}))},t}(),RO=function(t){function e(e){var n=this,r=e.style,a=o(e,["style"]);return(n=t.call(this,i({type:Yn.MESH,style:i({x:"",y:"",z:"",lineWidth:0,anchor:[.5,.5,.5]},r)},a))||this).cullable.enable=!1,n.style.geometry.meshes.push(n),n.style.material.meshes.push(n),n}return r(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this);var e=this.style.geometry.meshes,n=e.indexOf(this);e.splice(n,1),n=(e=this.style.material.meshes).indexOf(this),e.splice(n,1)},e}(Es),PO=function(){function t(){}return t.prototype.update=function(t){var e=t.geometry.computeBoundingBox(),n=e.getMax(),r=e.getMin();return{width:n[0]-r[0],height:n[1]-r[1],depth:n[2]-r[2]}},t}(),CO=function(){function t(){this.counter=0,this.id2DisplayObjectMap={}}return t.prototype.getId=function(t){var e=this.counter++;return this.id2DisplayObjectMap[e]=t,e},t.prototype.getById=function(t){return this.id2DisplayObjectMap[t]},t.prototype.deleteById=function(t){delete this.id2DisplayObjectMap[t]},t.prototype.reset=function(){this.counter=0,this.id2DisplayObjectMap={}},t.prototype.decodePickingColor=function(t){var e=u(t,3);return e[0]+256*e[1]+65536*e[2]-1},t.prototype.encodePickingColor=function(t){return[t+1&255,t+1>>8&255,t+1>>8>>8&255]},t}();function wO(t,e,n,r){return{dimension:hO.TEXTURE_2D,pixelFormat:t,width:e,height:n,depth:1,numLevels:r,usage:pO.SAMPLED}}function NO(t,e,n){return t<<16|e<<8|n}function IO(t,e){if(void 0===e&&(e=""),!t)throw console.error((new Error).stack),new Error("Assert fail: ".concat(e))}function kO(t){if(null!=t)return t;throw new Error("Missing object")}function LO(t){return{r:t.r,g:t.g,b:t.b,a:t.a}}function DO(t,e,n,r){return void 0===r&&(r=1),{r:t,g:e,b:n,a:r}}!function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",t[t.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",t[t.BLEND_EQUATION=32777]="BLEND_EQUATION",t[t.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",t[t.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",t[t.BLEND_DST_RGB=32968]="BLEND_DST_RGB",t[t.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",t[t.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",t[t.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",t[t.BLEND_COLOR=32773]="BLEND_COLOR",t[t.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",t[t.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",t[t.LINE_WIDTH=2849]="LINE_WIDTH",t[t.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",t[t.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",t[t.CULL_FACE_MODE=2885]="CULL_FACE_MODE",t[t.FRONT_FACE=2886]="FRONT_FACE",t[t.DEPTH_RANGE=2928]="DEPTH_RANGE",t[t.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",t[t.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",t[t.DEPTH_FUNC=2932]="DEPTH_FUNC",t[t.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",t[t.STENCIL_FUNC=2962]="STENCIL_FUNC",t[t.STENCIL_FAIL=2964]="STENCIL_FAIL",t[t.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",t[t.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",t[t.STENCIL_REF=2967]="STENCIL_REF",t[t.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",t[t.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",t[t.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",t[t.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",t[t.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",t[t.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",t[t.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",t[t.VIEWPORT=2978]="VIEWPORT",t[t.SCISSOR_BOX=3088]="SCISSOR_BOX",t[t.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",t[t.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",t[t.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",t[t.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",t[t.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",t[t.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",t[t.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",t[t.RED_BITS=3410]="RED_BITS",t[t.GREEN_BITS=3411]="GREEN_BITS",t[t.BLUE_BITS=3412]="BLUE_BITS",t[t.ALPHA_BITS=3413]="ALPHA_BITS",t[t.DEPTH_BITS=3414]="DEPTH_BITS",t[t.STENCIL_BITS=3415]="STENCIL_BITS",t[t.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",t[t.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",t[t.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",t[t.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",t[t.SAMPLES=32937]="SAMPLES",t[t.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",t[t.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",t[t.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",t[t.VENDOR=7936]="VENDOR",t[t.RENDERER=7937]="RENDERER",t[t.VERSION=7938]="VERSION",t[t.IMPLEMENTATION_COLOR_READ_TYPE=35738]="IMPLEMENTATION_COLOR_READ_TYPE",t[t.IMPLEMENTATION_COLOR_READ_FORMAT=35739]="IMPLEMENTATION_COLOR_READ_FORMAT",t[t.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.BUFFER_SIZE=34660]="BUFFER_SIZE",t[t.BUFFER_USAGE=34661]="BUFFER_USAGE",t[t.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",t[t.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",t[t.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",t[t.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",t[t.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",t[t.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",t[t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",t[t.CULL_FACE=2884]="CULL_FACE",t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK",t[t.BLEND=3042]="BLEND",t[t.DEPTH_TEST=2929]="DEPTH_TEST",t[t.DITHER=3024]="DITHER",t[t.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",t[t.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",t[t.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",t[t.SCISSOR_TEST=3089]="SCISSOR_TEST",t[t.STENCIL_TEST=2960]="STENCIL_TEST",t[t.NO_ERROR=0]="NO_ERROR",t[t.INVALID_ENUM=1280]="INVALID_ENUM",t[t.INVALID_VALUE=1281]="INVALID_VALUE",t[t.INVALID_OPERATION=1282]="INVALID_OPERATION",t[t.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",t[t.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",t[t.CW=2304]="CW",t[t.CCW=2305]="CCW",t[t.DONT_CARE=4352]="DONT_CARE",t[t.FASTEST=4353]="FASTEST",t[t.NICEST=4354]="NICEST",t[t.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT",t[t.DOUBLE=5130]="DOUBLE",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER",t[t.COMPILE_STATUS=35713]="COMPILE_STATUS",t[t.DELETE_STATUS=35712]="DELETE_STATUS",t[t.LINK_STATUS=35714]="LINK_STATUS",t[t.VALIDATE_STATUS=35715]="VALIDATE_STATUS",t[t.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",t[t.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",t[t.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",t[t.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",t[t.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",t[t.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",t[t.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",t[t.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",t[t.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",t[t.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",t[t.SHADER_TYPE=35663]="SHADER_TYPE",t[t.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",t[t.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",t[t.NEVER=512]="NEVER",t[t.ALWAYS=519]="ALWAYS",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.GEQUAL=518]="GEQUAL",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP",t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",t[t.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",t[t.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE=5890]="TEXTURE",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",t[t.TEXTURE0=33984]="TEXTURE0",t[t.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",t[t.REPEAT=10497]="REPEAT",t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t[t.TEXTURE_WIDTH=4096]="TEXTURE_WIDTH",t[t.TEXTURE_HEIGHT=4097]="TEXTURE_HEIGHT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.LOW_FLOAT=36336]="LOW_FLOAT",t[t.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",t[t.HIGH_FLOAT=36338]="HIGH_FLOAT",t[t.LOW_INT=36339]="LOW_INT",t[t.MEDIUM_INT=36340]="MEDIUM_INT",t[t.HIGH_INT=36341]="HIGH_INT",t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.RENDERBUFFER=36161]="RENDERBUFFER",t[t.RGBA4=32854]="RGBA4",t[t.RGB5_A1=32855]="RGB5_A1",t[t.RGB565=36194]="RGB565",t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX=6401]="STENCIL_INDEX",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",t[t.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",t[t.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",t[t.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",t[t.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",t[t.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",t[t.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",t[t.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",t[t.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",t[t.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",t[t.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",t[t.NONE=0]="NONE",t[t.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",t[t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",t[t.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",t[t.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",t[t.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",t[t.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER",t[t.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",t[t.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t[t.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",t[t.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",t[t.READ_BUFFER=3074]="READ_BUFFER",t[t.UNPACK_ROW_LENGTH=3314]="UNPACK_ROW_LENGTH",t[t.UNPACK_SKIP_ROWS=3315]="UNPACK_SKIP_ROWS",t[t.UNPACK_SKIP_PIXELS=3316]="UNPACK_SKIP_PIXELS",t[t.PACK_ROW_LENGTH=3330]="PACK_ROW_LENGTH",t[t.PACK_SKIP_ROWS=3331]="PACK_SKIP_ROWS",t[t.PACK_SKIP_PIXELS=3332]="PACK_SKIP_PIXELS",t[t.TEXTURE_BINDING_3D=32874]="TEXTURE_BINDING_3D",t[t.UNPACK_SKIP_IMAGES=32877]="UNPACK_SKIP_IMAGES",t[t.UNPACK_IMAGE_HEIGHT=32878]="UNPACK_IMAGE_HEIGHT",t[t.MAX_3D_TEXTURE_SIZE=32883]="MAX_3D_TEXTURE_SIZE",t[t.MAX_ELEMENTS_VERTICES=33e3]="MAX_ELEMENTS_VERTICES",t[t.MAX_ELEMENTS_INDICES=33001]="MAX_ELEMENTS_INDICES",t[t.MAX_TEXTURE_LOD_BIAS=34045]="MAX_TEXTURE_LOD_BIAS",t[t.MAX_FRAGMENT_UNIFORM_COMPONENTS=35657]="MAX_FRAGMENT_UNIFORM_COMPONENTS",t[t.MAX_VERTEX_UNIFORM_COMPONENTS=35658]="MAX_VERTEX_UNIFORM_COMPONENTS",t[t.MAX_ARRAY_TEXTURE_LAYERS=35071]="MAX_ARRAY_TEXTURE_LAYERS",t[t.MIN_PROGRAM_TEXEL_OFFSET=35076]="MIN_PROGRAM_TEXEL_OFFSET",t[t.MAX_PROGRAM_TEXEL_OFFSET=35077]="MAX_PROGRAM_TEXEL_OFFSET",t[t.MAX_VARYING_COMPONENTS=35659]="MAX_VARYING_COMPONENTS",t[t.FRAGMENT_SHADER_DERIVATIVE_HINT=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT",t[t.RASTERIZER_DISCARD=35977]="RASTERIZER_DISCARD",t[t.VERTEX_ARRAY_BINDING=34229]="VERTEX_ARRAY_BINDING",t[t.MAX_VERTEX_OUTPUT_COMPONENTS=37154]="MAX_VERTEX_OUTPUT_COMPONENTS",t[t.MAX_FRAGMENT_INPUT_COMPONENTS=37157]="MAX_FRAGMENT_INPUT_COMPONENTS",t[t.MAX_SERVER_WAIT_TIMEOUT=37137]="MAX_SERVER_WAIT_TIMEOUT",t[t.MAX_ELEMENT_INDEX=36203]="MAX_ELEMENT_INDEX",t[t.RED=6403]="RED",t[t.RGB8=32849]="RGB8",t[t.RGBA8=32856]="RGBA8",t[t.RGB10_A2=32857]="RGB10_A2",t[t.TEXTURE_3D=32879]="TEXTURE_3D",t[t.TEXTURE_WRAP_R=32882]="TEXTURE_WRAP_R",t[t.TEXTURE_MIN_LOD=33082]="TEXTURE_MIN_LOD",t[t.TEXTURE_MAX_LOD=33083]="TEXTURE_MAX_LOD",t[t.TEXTURE_BASE_LEVEL=33084]="TEXTURE_BASE_LEVEL",t[t.TEXTURE_MAX_LEVEL=33085]="TEXTURE_MAX_LEVEL",t[t.TEXTURE_COMPARE_MODE=34892]="TEXTURE_COMPARE_MODE",t[t.TEXTURE_COMPARE_FUNC=34893]="TEXTURE_COMPARE_FUNC",t[t.SRGB=35904]="SRGB",t[t.SRGB8=35905]="SRGB8",t[t.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",t[t.COMPARE_REF_TO_TEXTURE=34894]="COMPARE_REF_TO_TEXTURE",t[t.RGBA32F=34836]="RGBA32F",t[t.RGB32F=34837]="RGB32F",t[t.RGBA16F=34842]="RGBA16F",t[t.RGB16F=34843]="RGB16F",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_BINDING_2D_ARRAY=35869]="TEXTURE_BINDING_2D_ARRAY",t[t.R11F_G11F_B10F=35898]="R11F_G11F_B10F",t[t.RGB9_E5=35901]="RGB9_E5",t[t.RGBA32UI=36208]="RGBA32UI",t[t.RGB32UI=36209]="RGB32UI",t[t.RGBA16UI=36214]="RGBA16UI",t[t.RGB16UI=36215]="RGB16UI",t[t.RGBA8UI=36220]="RGBA8UI",t[t.RGB8UI=36221]="RGB8UI",t[t.RGBA32I=36226]="RGBA32I",t[t.RGB32I=36227]="RGB32I",t[t.RGBA16I=36232]="RGBA16I",t[t.RGB16I=36233]="RGB16I",t[t.RGBA8I=36238]="RGBA8I",t[t.RGB8I=36239]="RGB8I",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.R8=33321]="R8",t[t.RG8=33323]="RG8",t[t.R16F=33325]="R16F",t[t.R32F=33326]="R32F",t[t.RG16F=33327]="RG16F",t[t.RG32F=33328]="RG32F",t[t.R8I=33329]="R8I",t[t.R8UI=33330]="R8UI",t[t.R16I=33331]="R16I",t[t.R16UI=33332]="R16UI",t[t.R32I=33333]="R32I",t[t.R32UI=33334]="R32UI",t[t.RG8I=33335]="RG8I",t[t.RG8UI=33336]="RG8UI",t[t.RG16I=33337]="RG16I",t[t.RG16UI=33338]="RG16UI",t[t.RG32I=33339]="RG32I",t[t.RG32UI=33340]="RG32UI",t[t.R8_SNORM=36756]="R8_SNORM",t[t.RG8_SNORM=36757]="RG8_SNORM",t[t.RGB8_SNORM=36758]="RGB8_SNORM",t[t.RGBA8_SNORM=36759]="RGBA8_SNORM",t[t.RGB10_A2UI=36975]="RGB10_A2UI",t[t.TEXTURE_IMMUTABLE_FORMAT=37167]="TEXTURE_IMMUTABLE_FORMAT",t[t.TEXTURE_IMMUTABLE_LEVELS=33503]="TEXTURE_IMMUTABLE_LEVELS",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.HALF_FLOAT=5131]="HALF_FLOAT",t[t.RG=33319]="RG",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.INT_2_10_10_10_REV=36255]="INT_2_10_10_10_REV",t[t.CURRENT_QUERY=34917]="CURRENT_QUERY",t[t.QUERY_RESULT=34918]="QUERY_RESULT",t[t.QUERY_RESULT_AVAILABLE=34919]="QUERY_RESULT_AVAILABLE",t[t.ANY_SAMPLES_PASSED=35887]="ANY_SAMPLES_PASSED",t[t.ANY_SAMPLES_PASSED_CONSERVATIVE=36202]="ANY_SAMPLES_PASSED_CONSERVATIVE",t[t.MAX_DRAW_BUFFERS=34852]="MAX_DRAW_BUFFERS",t[t.DRAW_BUFFER0=34853]="DRAW_BUFFER0",t[t.DRAW_BUFFER1=34854]="DRAW_BUFFER1",t[t.DRAW_BUFFER2=34855]="DRAW_BUFFER2",t[t.DRAW_BUFFER3=34856]="DRAW_BUFFER3",t[t.DRAW_BUFFER4=34857]="DRAW_BUFFER4",t[t.DRAW_BUFFER5=34858]="DRAW_BUFFER5",t[t.DRAW_BUFFER6=34859]="DRAW_BUFFER6",t[t.DRAW_BUFFER7=34860]="DRAW_BUFFER7",t[t.DRAW_BUFFER8=34861]="DRAW_BUFFER8",t[t.DRAW_BUFFER9=34862]="DRAW_BUFFER9",t[t.DRAW_BUFFER10=34863]="DRAW_BUFFER10",t[t.DRAW_BUFFER11=34864]="DRAW_BUFFER11",t[t.DRAW_BUFFER12=34865]="DRAW_BUFFER12",t[t.DRAW_BUFFER13=34866]="DRAW_BUFFER13",t[t.DRAW_BUFFER14=34867]="DRAW_BUFFER14",t[t.DRAW_BUFFER15=34868]="DRAW_BUFFER15",t[t.MAX_COLOR_ATTACHMENTS=36063]="MAX_COLOR_ATTACHMENTS",t[t.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",t[t.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",t[t.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",t[t.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",t[t.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",t[t.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",t[t.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",t[t.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",t[t.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",t[t.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",t[t.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",t[t.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",t[t.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",t[t.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",t[t.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15",t[t.SAMPLER_3D=35679]="SAMPLER_3D",t[t.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",t[t.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",t[t.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",t[t.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",t[t.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",t[t.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",t[t.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",t[t.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",t[t.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",t[t.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",t[t.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",t[t.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY",t[t.MAX_SAMPLES=36183]="MAX_SAMPLES",t[t.SAMPLER_BINDING=35097]="SAMPLER_BINDING",t[t.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",t[t.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",t[t.PIXEL_PACK_BUFFER_BINDING=35053]="PIXEL_PACK_BUFFER_BINDING",t[t.PIXEL_UNPACK_BUFFER_BINDING=35055]="PIXEL_UNPACK_BUFFER_BINDING",t[t.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",t[t.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",t[t.COPY_READ_BUFFER_BINDING=36662]="COPY_READ_BUFFER_BINDING",t[t.COPY_WRITE_BUFFER_BINDING=36663]="COPY_WRITE_BUFFER_BINDING",t[t.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",t[t.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",t[t.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",t[t.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",t[t.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",t[t.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",t[t.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",t[t.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",t[t.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",t[t.UNSIGNED_NORMALIZED=35863]="UNSIGNED_NORMALIZED",t[t.SIGNED_NORMALIZED=36764]="SIGNED_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_INTEGER=35069]="VERTEX_ATTRIB_ARRAY_INTEGER",t[t.VERTEX_ATTRIB_ARRAY_DIVISOR=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR",t[t.TRANSFORM_FEEDBACK_BUFFER_MODE=35967]="TRANSFORM_FEEDBACK_BUFFER_MODE",t[t.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS=35968]="MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",t[t.TRANSFORM_FEEDBACK_VARYINGS=35971]="TRANSFORM_FEEDBACK_VARYINGS",t[t.TRANSFORM_FEEDBACK_BUFFER_START=35972]="TRANSFORM_FEEDBACK_BUFFER_START",t[t.TRANSFORM_FEEDBACK_BUFFER_SIZE=35973]="TRANSFORM_FEEDBACK_BUFFER_SIZE",t[t.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN=35976]="TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",t[t.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS=35978]="MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",t[t.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS=35979]="MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",t[t.INTERLEAVED_ATTRIBS=35980]="INTERLEAVED_ATTRIBS",t[t.SEPARATE_ATTRIBS=35981]="SEPARATE_ATTRIBS",t[t.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER",t[t.TRANSFORM_FEEDBACK_BUFFER_BINDING=35983]="TRANSFORM_FEEDBACK_BUFFER_BINDING",t[t.TRANSFORM_FEEDBACK=36386]="TRANSFORM_FEEDBACK",t[t.TRANSFORM_FEEDBACK_PAUSED=36387]="TRANSFORM_FEEDBACK_PAUSED",t[t.TRANSFORM_FEEDBACK_ACTIVE=36388]="TRANSFORM_FEEDBACK_ACTIVE",t[t.TRANSFORM_FEEDBACK_BINDING=36389]="TRANSFORM_FEEDBACK_BINDING",t[t.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",t[t.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_RED_SIZE=33298]="FRAMEBUFFER_ATTACHMENT_RED_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE=33299]="FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE=33300]="FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE=33301]="FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE=33302]="FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE=33303]="FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",t[t.FRAMEBUFFER_DEFAULT=33304]="FRAMEBUFFER_DEFAULT",t[t.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",t[t.DRAW_FRAMEBUFFER_BINDING=36006]="DRAW_FRAMEBUFFER_BINDING",t[t.READ_FRAMEBUFFER_BINDING=36010]="READ_FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_SAMPLES=36011]="RENDERBUFFER_SAMPLES",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER=36052]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",t[t.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE=36182]="FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t[t.UNIFORM_BUFFER_BINDING=35368]="UNIFORM_BUFFER_BINDING",t[t.UNIFORM_BUFFER_START=35369]="UNIFORM_BUFFER_START",t[t.UNIFORM_BUFFER_SIZE=35370]="UNIFORM_BUFFER_SIZE",t[t.MAX_VERTEX_UNIFORM_BLOCKS=35371]="MAX_VERTEX_UNIFORM_BLOCKS",t[t.MAX_FRAGMENT_UNIFORM_BLOCKS=35373]="MAX_FRAGMENT_UNIFORM_BLOCKS",t[t.MAX_COMBINED_UNIFORM_BLOCKS=35374]="MAX_COMBINED_UNIFORM_BLOCKS",t[t.MAX_UNIFORM_BUFFER_BINDINGS=35375]="MAX_UNIFORM_BUFFER_BINDINGS",t[t.MAX_UNIFORM_BLOCK_SIZE=35376]="MAX_UNIFORM_BLOCK_SIZE",t[t.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS=35377]="MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",t[t.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS=35379]="MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",t[t.UNIFORM_BUFFER_OFFSET_ALIGNMENT=35380]="UNIFORM_BUFFER_OFFSET_ALIGNMENT",t[t.ACTIVE_UNIFORM_BLOCKS=35382]="ACTIVE_UNIFORM_BLOCKS",t[t.UNIFORM_TYPE=35383]="UNIFORM_TYPE",t[t.UNIFORM_SIZE=35384]="UNIFORM_SIZE",t[t.UNIFORM_BLOCK_INDEX=35386]="UNIFORM_BLOCK_INDEX",t[t.UNIFORM_OFFSET=35387]="UNIFORM_OFFSET",t[t.UNIFORM_ARRAY_STRIDE=35388]="UNIFORM_ARRAY_STRIDE",t[t.UNIFORM_MATRIX_STRIDE=35389]="UNIFORM_MATRIX_STRIDE",t[t.UNIFORM_IS_ROW_MAJOR=35390]="UNIFORM_IS_ROW_MAJOR",t[t.UNIFORM_BLOCK_BINDING=35391]="UNIFORM_BLOCK_BINDING",t[t.UNIFORM_BLOCK_DATA_SIZE=35392]="UNIFORM_BLOCK_DATA_SIZE",t[t.UNIFORM_BLOCK_ACTIVE_UNIFORMS=35394]="UNIFORM_BLOCK_ACTIVE_UNIFORMS",t[t.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES=35395]="UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",t[t.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER=35396]="UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",t[t.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER=35398]="UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",t[t.OBJECT_TYPE=37138]="OBJECT_TYPE",t[t.SYNC_CONDITION=37139]="SYNC_CONDITION",t[t.SYNC_STATUS=37140]="SYNC_STATUS",t[t.SYNC_FLAGS=37141]="SYNC_FLAGS",t[t.SYNC_FENCE=37142]="SYNC_FENCE",t[t.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE",t[t.UNSIGNALED=37144]="UNSIGNALED",t[t.SIGNALED=37145]="SIGNALED",t[t.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",t[t.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",t[t.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",t[t.WAIT_FAILED=37149]="WAIT_FAILED",t[t.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT",t[t.COLOR=6144]="COLOR",t[t.DEPTH=6145]="DEPTH",t[t.STENCIL=6146]="STENCIL",t[t.MIN=32775]="MIN",t[t.MAX=32776]="MAX",t[t.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",t[t.STREAM_READ=35041]="STREAM_READ",t[t.STREAM_COPY=35042]="STREAM_COPY",t[t.STATIC_READ=35045]="STATIC_READ",t[t.STATIC_COPY=35046]="STATIC_COPY",t[t.DYNAMIC_READ=35049]="DYNAMIC_READ",t[t.DYNAMIC_COPY=35050]="DYNAMIC_COPY",t[t.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",t[t.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8",t[t.INVALID_INDEX=4294967295]="INVALID_INDEX",t[t.TIMEOUT_IGNORED=-1]="TIMEOUT_IGNORED",t[t.MAX_CLIENT_WAIT_TIMEOUT_WEBGL=37447]="MAX_CLIENT_WAIT_TIMEOUT_WEBGL",t[t.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE",t[t.UNMASKED_VENDOR_WEBGL=37445]="UNMASKED_VENDOR_WEBGL",t[t.UNMASKED_RENDERER_WEBGL=37446]="UNMASKED_RENDERER_WEBGL",t[t.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047]="MAX_TEXTURE_MAX_ANISOTROPY_EXT",t[t.TEXTURE_MAX_ANISOTROPY_EXT=34046]="TEXTURE_MAX_ANISOTROPY_EXT",t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",t[t.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",t[t.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",t[t.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_RGBA8_ETC2_EAC=37493]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ETC2=37494]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37495]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37496]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37497]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",t[t.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",t[t.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",t[t.UNSIGNED_INT_24_8_WEBGL=34042]="UNSIGNED_INT_24_8_WEBGL",t[t.HALF_FLOAT_OES=36193]="HALF_FLOAT_OES",t[t.RGBA32F_EXT=34836]="RGBA32F_EXT",t[t.RGB32F_EXT=34837]="RGB32F_EXT",t[t.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT",t[t.UNSIGNED_NORMALIZED_EXT=35863]="UNSIGNED_NORMALIZED_EXT",t[t.MIN_EXT=32775]="MIN_EXT",t[t.MAX_EXT=32776]="MAX_EXT",t[t.SRGB_EXT=35904]="SRGB_EXT",t[t.SRGB_ALPHA_EXT=35906]="SRGB_ALPHA_EXT",t[t.SRGB8_ALPHA8_EXT=35907]="SRGB8_ALPHA8_EXT",t[t.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT",t[t.FRAGMENT_SHADER_DERIVATIVE_HINT_OES=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT_OES",t[t.COLOR_ATTACHMENT0_WEBGL=36064]="COLOR_ATTACHMENT0_WEBGL",t[t.COLOR_ATTACHMENT1_WEBGL=36065]="COLOR_ATTACHMENT1_WEBGL",t[t.COLOR_ATTACHMENT2_WEBGL=36066]="COLOR_ATTACHMENT2_WEBGL",t[t.COLOR_ATTACHMENT3_WEBGL=36067]="COLOR_ATTACHMENT3_WEBGL",t[t.COLOR_ATTACHMENT4_WEBGL=36068]="COLOR_ATTACHMENT4_WEBGL",t[t.COLOR_ATTACHMENT5_WEBGL=36069]="COLOR_ATTACHMENT5_WEBGL",t[t.COLOR_ATTACHMENT6_WEBGL=36070]="COLOR_ATTACHMENT6_WEBGL",t[t.COLOR_ATTACHMENT7_WEBGL=36071]="COLOR_ATTACHMENT7_WEBGL",t[t.COLOR_ATTACHMENT8_WEBGL=36072]="COLOR_ATTACHMENT8_WEBGL",t[t.COLOR_ATTACHMENT9_WEBGL=36073]="COLOR_ATTACHMENT9_WEBGL",t[t.COLOR_ATTACHMENT10_WEBGL=36074]="COLOR_ATTACHMENT10_WEBGL",t[t.COLOR_ATTACHMENT11_WEBGL=36075]="COLOR_ATTACHMENT11_WEBGL",t[t.COLOR_ATTACHMENT12_WEBGL=36076]="COLOR_ATTACHMENT12_WEBGL",t[t.COLOR_ATTACHMENT13_WEBGL=36077]="COLOR_ATTACHMENT13_WEBGL",t[t.COLOR_ATTACHMENT14_WEBGL=36078]="COLOR_ATTACHMENT14_WEBGL",t[t.COLOR_ATTACHMENT15_WEBGL=36079]="COLOR_ATTACHMENT15_WEBGL",t[t.DRAW_BUFFER0_WEBGL=34853]="DRAW_BUFFER0_WEBGL",t[t.DRAW_BUFFER1_WEBGL=34854]="DRAW_BUFFER1_WEBGL",t[t.DRAW_BUFFER2_WEBGL=34855]="DRAW_BUFFER2_WEBGL",t[t.DRAW_BUFFER3_WEBGL=34856]="DRAW_BUFFER3_WEBGL",t[t.DRAW_BUFFER4_WEBGL=34857]="DRAW_BUFFER4_WEBGL",t[t.DRAW_BUFFER5_WEBGL=34858]="DRAW_BUFFER5_WEBGL",t[t.DRAW_BUFFER6_WEBGL=34859]="DRAW_BUFFER6_WEBGL",t[t.DRAW_BUFFER7_WEBGL=34860]="DRAW_BUFFER7_WEBGL",t[t.DRAW_BUFFER8_WEBGL=34861]="DRAW_BUFFER8_WEBGL",t[t.DRAW_BUFFER9_WEBGL=34862]="DRAW_BUFFER9_WEBGL",t[t.DRAW_BUFFER10_WEBGL=34863]="DRAW_BUFFER10_WEBGL",t[t.DRAW_BUFFER11_WEBGL=34864]="DRAW_BUFFER11_WEBGL",t[t.DRAW_BUFFER12_WEBGL=34865]="DRAW_BUFFER12_WEBGL",t[t.DRAW_BUFFER13_WEBGL=34866]="DRAW_BUFFER13_WEBGL",t[t.DRAW_BUFFER14_WEBGL=34867]="DRAW_BUFFER14_WEBGL",t[t.DRAW_BUFFER15_WEBGL=34868]="DRAW_BUFFER15_WEBGL",t[t.MAX_COLOR_ATTACHMENTS_WEBGL=36063]="MAX_COLOR_ATTACHMENTS_WEBGL",t[t.MAX_DRAW_BUFFERS_WEBGL=34852]="MAX_DRAW_BUFFERS_WEBGL",t[t.VERTEX_ARRAY_BINDING_OES=34229]="VERTEX_ARRAY_BINDING_OES",t[t.QUERY_COUNTER_BITS_EXT=34916]="QUERY_COUNTER_BITS_EXT",t[t.CURRENT_QUERY_EXT=34917]="CURRENT_QUERY_EXT",t[t.QUERY_RESULT_EXT=34918]="QUERY_RESULT_EXT",t[t.QUERY_RESULT_AVAILABLE_EXT=34919]="QUERY_RESULT_AVAILABLE_EXT",t[t.TIME_ELAPSED_EXT=35007]="TIME_ELAPSED_EXT",t[t.TIMESTAMP_EXT=36392]="TIMESTAMP_EXT",t[t.GPU_DISJOINT_EXT=36795]="GPU_DISJOINT_EXT"}(QT||(QT={})),function(t){t[t.Buffer=0]="Buffer",t[t.Texture=1]="Texture",t[t.RenderTarget=2]="RenderTarget",t[t.Sampler=3]="Sampler",t[t.Program=4]="Program",t[t.Bindings=5]="Bindings",t[t.InputLayout=6]="InputLayout",t[t.RenderPipeline=7]="RenderPipeline",t[t.ComputePipeline=8]="ComputePipeline",t[t.Readback=9]="Readback",t[t.QueryPool=10]="QueryPool"}(JT||(JT={})),function(t){t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS"}(tO||(tO={})),function(t){t[t.CCW=2305]="CCW",t[t.CW=2304]="CW"}(eO||(eO={})),function(t){t[t.NONE=0]="NONE",t[t.FRONT=1]="FRONT",t[t.BACK=2]="BACK",t[t.FRONT_AND_BACK=3]="FRONT_AND_BACK"}(nO||(nO={})),function(t){t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC=768]="SRC",t[t.ONE_MINUS_SRC=769]="ONE_MINUS_SRC",t[t.DST=774]="DST",t[t.ONE_MINUS_DST=775]="ONE_MINUS_DST",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.CONST=32769]="CONST",t[t.ONE_MINUS_CONSTANT=32770]="ONE_MINUS_CONSTANT",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE"}(rO||(rO={})),function(t){t[t.ADD=32774]="ADD",t[t.SUBSTRACT=32778]="SUBSTRACT",t[t.REVERSE_SUBSTRACT=32779]="REVERSE_SUBSTRACT",t[t.MIN=32775]="MIN",t[t.MAX=32776]="MAX"}(iO||(iO={})),function(t){t[t.CLAMP=0]="CLAMP",t[t.REPEAT=1]="REPEAT",t[t.MIRROR=2]="MIRROR"}(oO||(oO={})),function(t){t[t.POINT=0]="POINT",t[t.BILINEAR=1]="BILINEAR"}(aO||(aO={})),function(t){t[t.NO_MIP=0]="NO_MIP",t[t.NEAREST=1]="NEAREST",t[t.LINEAR=2]="LINEAR"}(sO||(sO={})),function(t){t[t.POINTS=0]="POINTS",t[t.TRIANGLES=1]="TRIANGLES",t[t.TRIANGLE_STRIP=2]="TRIANGLE_STRIP",t[t.LINES=3]="LINES",t[t.LINE_STRIP=4]="LINE_STRIP"}(cO||(cO={})),function(t){t[t.MAP_READ=1]="MAP_READ",t[t.MAP_WRITE=2]="MAP_WRITE",t[t.COPY_SRC=4]="COPY_SRC",t[t.COPY_DST=8]="COPY_DST",t[t.INDEX=16]="INDEX",t[t.VERTEX=32]="VERTEX",t[t.UNIFORM=64]="UNIFORM",t[t.STORAGE=128]="STORAGE",t[t.INDIRECT=256]="INDIRECT",t[t.QUERY_RESOLVE=512]="QUERY_RESOLVE"}(lO||(lO={})),function(t){t[t.STATIC=1]="STATIC",t[t.DYNAMIC=2]="DYNAMIC"}(uO||(uO={})),function(t){t[t.VERTEX=1]="VERTEX",t[t.INSTANCE=2]="INSTANCE"}(fO||(fO={})),function(t){t.LOADED="loaded"}(dO||(dO={})),function(t){t[t.TEXTURE_2D=0]="TEXTURE_2D",t[t.TEXTURE_2D_ARRAY=1]="TEXTURE_2D_ARRAY",t[t.TEXTURE_3D=2]="TEXTURE_3D",t[t.TEXTURE_CUBE_MAP=3]="TEXTURE_CUBE_MAP"}(hO||(hO={})),function(t){t[t.SAMPLED=1]="SAMPLED",t[t.RENDER_TARGET=2]="RENDER_TARGET"}(pO||(pO={})),function(t){t[t.NONE=0]="NONE",t[t.RED=1]="RED",t[t.GREEN=2]="GREEN",t[t.BLUE=4]="BLUE",t[t.ALPHA=8]="ALPHA",t[t.RGB=7]="RGB",t[t.ALL=15]="ALL"}(gO||(gO={})),function(t){t[t.KEEP=7680]="KEEP",t[t.ZERO=0]="ZERO",t[t.REPLACE=7681]="REPLACE",t[t.INVERT=5386]="INVERT",t[t.INCREMENT_CLAMP=7682]="INCREMENT_CLAMP",t[t.DECREMENT_CLAMP=7683]="DECREMENT_CLAMP",t[t.INCREMENT_WRAP=34055]="INCREMENT_WRAP",t[t.DECREMENT_WRAP=34056]="DECREMENT_WRAP"}(mO||(mO={})),function(t){t[t.Float=0]="Float",t[t.Uint=1]="Uint",t[t.Sint=2]="Sint",t[t.Depth=3]="Depth"}(vO||(vO={})),function(t){t[t.LOWER_LEFT=0]="LOWER_LEFT",t[t.UPPER_LEFT=1]="UPPER_LEFT"}(yO||(yO={})),function(t){t[t.NEGATIVE_ONE=0]="NEGATIVE_ONE",t[t.ZERO=1]="ZERO"}(_O||(_O={})),function(t){t[t.OcclusionConservative=0]="OcclusionConservative"}(bO||(bO={})),function(t){t[t.U8=1]="U8",t[t.U16=2]="U16",t[t.U32=3]="U32",t[t.S8=4]="S8",t[t.S16=5]="S16",t[t.S32=6]="S32",t[t.F16=7]="F16",t[t.F32=8]="F32",t[t.BC1=65]="BC1",t[t.BC2=66]="BC2",t[t.BC3=67]="BC3",t[t.BC4_UNORM=68]="BC4_UNORM",t[t.BC4_SNORM=69]="BC4_SNORM",t[t.BC5_UNORM=70]="BC5_UNORM",t[t.BC5_SNORM=71]="BC5_SNORM",t[t.U16_PACKED_5551=97]="U16_PACKED_5551",t[t.U16_PACKED_565=98]="U16_PACKED_565",t[t.D24=129]="D24",t[t.D32F=130]="D32F",t[t.D24S8=131]="D24S8",t[t.D32FS8=132]="D32FS8"}(EO||(EO={})),function(t){t[t.R=1]="R",t[t.RG=2]="RG",t[t.RGB=3]="RGB",t[t.RGBA=4]="RGBA",t[t.A=5]="A"}(xO||(xO={})),function(t){t[t.None=0]="None",t[t.Normalized=1]="Normalized",t[t.sRGB=2]="sRGB",t[t.Depth=4]="Depth",t[t.Stencil=8]="Stencil",t[t.RenderTarget=16]="RenderTarget"}(MO||(MO={})),function(t){t[t.ALPHA=NO(EO.U8,xO.A,MO.None)]="ALPHA",t[t.F16_R=NO(EO.F16,xO.R,MO.None)]="F16_R",t[t.F16_RG=NO(EO.F16,xO.RG,MO.None)]="F16_RG",t[t.F16_RGB=NO(EO.F16,xO.RGB,MO.None)]="F16_RGB",t[t.F16_RGBA=NO(EO.F16,xO.RGBA,MO.None)]="F16_RGBA",t[t.F32_R=NO(EO.F32,xO.R,MO.None)]="F32_R",t[t.F32_RG=NO(EO.F32,xO.RG,MO.None)]="F32_RG",t[t.F32_RGB=NO(EO.F32,xO.RGB,MO.None)]="F32_RGB",t[t.F32_RGBA=NO(EO.F32,xO.RGBA,MO.None)]="F32_RGBA",t[t.U8_R=NO(EO.U8,xO.R,MO.None)]="U8_R",t[t.U8_R_NORM=NO(EO.U8,xO.R,MO.Normalized)]="U8_R_NORM",t[t.U8_RG=NO(EO.U8,xO.RG,MO.None)]="U8_RG",t[t.U8_RG_NORM=NO(EO.U8,xO.RG,MO.Normalized)]="U8_RG_NORM",t[t.U8_RGB=NO(EO.U8,xO.RGB,MO.None)]="U8_RGB",t[t.U8_RGB_NORM=NO(EO.U8,xO.RGB,MO.Normalized)]="U8_RGB_NORM",t[t.U8_RGB_SRGB=NO(EO.U8,xO.RGB,MO.sRGB|MO.Normalized)]="U8_RGB_SRGB",t[t.U8_RGBA=NO(EO.U8,xO.RGBA,MO.None)]="U8_RGBA",t[t.U8_RGBA_NORM=NO(EO.U8,xO.RGBA,MO.Normalized)]="U8_RGBA_NORM",t[t.U8_RGBA_SRGB=NO(EO.U8,xO.RGBA,MO.sRGB|MO.Normalized)]="U8_RGBA_SRGB",t[t.U16_R=NO(EO.U16,xO.R,MO.None)]="U16_R",t[t.U16_R_NORM=NO(EO.U16,xO.R,MO.Normalized)]="U16_R_NORM",t[t.U16_RG_NORM=NO(EO.U16,xO.RG,MO.Normalized)]="U16_RG_NORM",t[t.U16_RGBA_NORM=NO(EO.U16,xO.RGBA,MO.Normalized)]="U16_RGBA_NORM",t[t.U16_RGB=NO(EO.U16,xO.RGB,MO.None)]="U16_RGB",t[t.U32_R=NO(EO.U32,xO.R,MO.None)]="U32_R",t[t.U32_RG=NO(EO.U32,xO.RG,MO.None)]="U32_RG",t[t.S8_R=NO(EO.S8,xO.R,MO.None)]="S8_R",t[t.S8_R_NORM=NO(EO.S8,xO.R,MO.Normalized)]="S8_R_NORM",t[t.S8_RG_NORM=NO(EO.S8,xO.RG,MO.Normalized)]="S8_RG_NORM",t[t.S8_RGB_NORM=NO(EO.S8,xO.RGB,MO.Normalized)]="S8_RGB_NORM",t[t.S8_RGBA_NORM=NO(EO.S8,xO.RGBA,MO.Normalized)]="S8_RGBA_NORM",t[t.S16_R=NO(EO.S16,xO.R,MO.None)]="S16_R",t[t.S16_RG=NO(EO.S16,xO.RG,MO.None)]="S16_RG",t[t.S16_RG_NORM=NO(EO.S16,xO.RG,MO.Normalized)]="S16_RG_NORM",t[t.S16_RGB_NORM=NO(EO.S16,xO.RGB,MO.Normalized)]="S16_RGB_NORM",t[t.S16_RGBA=NO(EO.S16,xO.RGBA,MO.None)]="S16_RGBA",t[t.S16_RGBA_NORM=NO(EO.S16,xO.RGBA,MO.Normalized)]="S16_RGBA_NORM",t[t.S32_R=NO(EO.S32,xO.R,MO.None)]="S32_R",t[t.U16_RGBA_5551=NO(EO.U16_PACKED_5551,xO.RGBA,MO.Normalized)]="U16_RGBA_5551",t[t.U16_RGB_565=NO(EO.U16_PACKED_565,xO.RGB,MO.Normalized)]="U16_RGB_565",t[t.BC1=NO(EO.BC1,xO.RGBA,MO.Normalized)]="BC1",t[t.BC1_SRGB=NO(EO.BC1,xO.RGBA,MO.Normalized|MO.sRGB)]="BC1_SRGB",t[t.BC2=NO(EO.BC2,xO.RGBA,MO.Normalized)]="BC2",t[t.BC2_SRGB=NO(EO.BC2,xO.RGBA,MO.Normalized|MO.sRGB)]="BC2_SRGB",t[t.BC3=NO(EO.BC3,xO.RGBA,MO.Normalized)]="BC3",t[t.BC3_SRGB=NO(EO.BC3,xO.RGBA,MO.Normalized|MO.sRGB)]="BC3_SRGB",t[t.BC4_UNORM=NO(EO.BC4_UNORM,xO.R,MO.Normalized)]="BC4_UNORM",t[t.BC4_SNORM=NO(EO.BC4_SNORM,xO.R,MO.Normalized)]="BC4_SNORM",t[t.BC5_UNORM=NO(EO.BC5_UNORM,xO.RG,MO.Normalized)]="BC5_UNORM",t[t.BC5_SNORM=NO(EO.BC5_SNORM,xO.RG,MO.Normalized)]="BC5_SNORM",t[t.D24=NO(EO.D24,xO.R,MO.Depth)]="D24",t[t.D24_S8=NO(EO.D24S8,xO.RG,MO.Depth|MO.Stencil)]="D24_S8",t[t.D32F=NO(EO.D32F,xO.R,MO.Depth)]="D32F",t[t.D32F_S8=NO(EO.D32FS8,xO.RG,MO.Depth|MO.Stencil)]="D32F_S8",t[t.U8_RGB_RT=NO(EO.U8,xO.RGB,MO.RenderTarget|MO.Normalized)]="U8_RGB_RT",t[t.U8_RGBA_RT=NO(EO.U8,xO.RGBA,MO.RenderTarget|MO.Normalized)]="U8_RGBA_RT",t[t.U8_RGBA_RT_SRGB=NO(EO.U8,xO.RGBA,MO.RenderTarget|MO.Normalized|MO.sRGB)]="U8_RGBA_RT_SRGB"}(SO||(SO={}));var BO=DO(0,0,0,0);DO(0,0,0,1);var FO=DO(1,1,1,0),UO=DO(1,1,1,1);function jO(t,e){return null!=t?t:e}function GO(t,e,n){t.length=e,t.fill(n)}function WO(t,e){return((t+e-1)/e|0)*e}function zO(t,e,n){return n?t|=e:t&=~e,t}function VO(t,e){for(var n=new Array(t),r=0;r<t;r++)n[r]=e();return n}function HO(t,e){t.blendDstFactor=e.blendDstFactor,t.blendSrcFactor=e.blendSrcFactor,t.blendMode=e.blendMode}function XO(t,e){return void 0===t&&(t={rgbBlendState:{},alphaBlendState:{},channelWriteMask:0}),HO(t.rgbBlendState,e.rgbBlendState),HO(t.alphaBlendState,e.alphaBlendState),t.channelWriteMask=e.channelWriteMask,t}function YO(t,e){t.length!==e.length&&(t.length=e.length);for(var n=0;n<e.length;n++)t[n]=XO(t[n],e[n])}function $O(t,e){void 0!==e.attachmentsState&&YO(t.attachmentsState,e.attachmentsState),void 0!==e.blendConstant&&function(t,e){t.r=e.r,t.g=e.g,t.b=e.b,t.a=e.a}(t.blendConstant,e.blendConstant),t.depthCompare=jO(e.depthCompare,t.depthCompare),t.depthWrite=jO(e.depthWrite,t.depthWrite),t.stencilCompare=jO(e.stencilCompare,t.stencilCompare),t.stencilWrite=jO(e.stencilWrite,t.stencilWrite),t.stencilPassOp=jO(e.stencilPassOp,t.stencilPassOp),t.stencilRef=jO(e.stencilRef,t.stencilRef),t.cullMode=jO(e.cullMode,t.cullMode),t.frontFace=jO(e.frontFace,t.frontFace),t.polygonOffset=jO(e.polygonOffset,t.polygonOffset)}function qO(t){var e=Object.assign({},t);return e.attachmentsState=[],YO(e.attachmentsState,t.attachmentsState),e.blendConstant=LO(e.blendConstant),e}var KO={blendMode:iO.ADD,blendSrcFactor:rO.ONE,blendDstFactor:rO.ZERO},ZO={attachmentsState:[{channelWriteMask:gO.ALL,rgbBlendState:KO,alphaBlendState:KO}],blendConstant:LO(BO),depthWrite:!0,depthCompare:tO.LEQUAL,stencilCompare:tO.ALWAYS,stencilWrite:!1,stencilPassOp:mO.KEEP,stencilRef:0,cullMode:nO.NONE,frontFace:eO.CCW,polygonOffset:!1};var QO,JO=function(t,e){void 0===t&&(t=null),void 0===e&&(e=ZO);var n=qO(e);return null!==t&&$O(n,t),n}({depthCompare:tO.ALWAYS,depthWrite:!1},ZO);function tR(t,e){return void 0===t.attachmentsState&&(t.attachmentsState=[],YO(t.attachmentsState,ZO.attachmentsState)),function(t,e){void 0!==e.channelWriteMask&&(t.channelWriteMask=e.channelWriteMask),void 0!==e.rgbBlendMode&&(t.rgbBlendState.blendMode=e.rgbBlendMode),void 0!==e.alphaBlendMode&&(t.alphaBlendState.blendMode=e.alphaBlendMode),void 0!==e.rgbBlendSrcFactor&&(t.rgbBlendState.blendSrcFactor=e.rgbBlendSrcFactor),void 0!==e.alphaBlendSrcFactor&&(t.alphaBlendState.blendSrcFactor=e.alphaBlendSrcFactor),void 0!==e.rgbBlendDstFactor&&(t.rgbBlendState.blendDstFactor=e.rgbBlendDstFactor),void 0!==e.alphaBlendDstFactor&&(t.alphaBlendState.blendDstFactor=e.alphaBlendDstFactor)}(t.attachmentsState[0],e),t}function eR(t,e,n){if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1;return!0}function nR(t,e){for(var n=Array(t.length),r=0;r<t.length;r++)n[r]=e(t[r]);return n}function rR(t,e){return t.buffer===e.buffer&&t.wordCount===e.wordCount}function iR(t,e){return null===t?null===e:null!==e&&(t.sampler===e.sampler&&t.texture===e.texture)}function oR(t,e){return t.samplerBindings.length===e.samplerBindings.length&&(!!eR(t.samplerBindings,e.samplerBindings,iR)&&(!!eR(t.uniformBufferBindings,e.uniformBufferBindings,rR)&&!!cR(t.bindingLayout,e.bindingLayout)))}function aR(t,e){return t.blendMode==e.blendMode&&t.blendSrcFactor===e.blendSrcFactor&&t.blendDstFactor===e.blendDstFactor}function sR(t,e){return!!aR(t.rgbBlendState,e.rgbBlendState)&&(!!aR(t.alphaBlendState,e.alphaBlendState)&&t.channelWriteMask===e.channelWriteMask)}function cR(t,e){return t.numSamplers===e.numSamplers&&t.numUniformBuffers===e.numUniformBuffers}function lR(t,e){return t.id===e.id}function uR(t,e){return t===e}function fR(t,e){return t.topology===e.topology&&(t.inputLayout===e.inputLayout&&(t.sampleCount===e.sampleCount&&(!!function(t,e){return!!eR(t.attachmentsState,e.attachmentsState,sR)&&(n=t.blendConstant,r=e.blendConstant,n.r===r.r&&n.g===r.g&&n.b===r.b&&n.a===r.a&&t.depthCompare===e.depthCompare&&t.depthWrite===e.depthWrite&&t.stencilCompare===e.stencilCompare&&t.stencilWrite===e.stencilWrite&&t.stencilPassOp===e.stencilPassOp&&t.stencilRef===e.stencilRef&&t.cullMode===e.cullMode&&t.frontFace===e.frontFace&&t.polygonOffset===e.polygonOffset);var n,r}(t.megaStateDescriptor,e.megaStateDescriptor)&&(!!lR(t.program,e.program)&&(!!eR(t.bindingLayouts,e.bindingLayouts,cR)&&(!!eR(t.colorAttachmentFormats,e.colorAttachmentFormats,uR)&&t.depthStencilAttachmentFormat===e.depthStencilAttachmentFormat))))))}function dR(t,e){return t.bufferIndex===e.bufferIndex&&t.bufferByteOffset===e.bufferByteOffset&&t.location===e.location&&t.format===e.format&&t.divisor===e.divisor}function hR(t,e){return he(t)?he(e):!he(e)&&(t.byteStride===e.byteStride&&t.stepMode===e.stepMode)}function pR(t,e){return t.indexBufferFormat===e.indexBufferFormat&&(!!eR(t.vertexBufferDescriptors,e.vertexBufferDescriptors,hR)&&(!!eR(t.vertexAttributeDescriptors,e.vertexAttributeDescriptors,dR)&&!!lR(t.program,e.program)))}function gR(t,e){return t.wrapS===e.wrapS&&t.wrapT===e.wrapT&&t.minFilter===e.minFilter&&t.magFilter===e.magFilter&&t.mipFilter===e.mipFilter&&t.minLOD===e.minLOD&&t.maxLOD===e.maxLOD&&t.maxAnisotropy===e.maxAnisotropy&&t.compareMode===e.compareMode}function mR(t){return{sampler:t.sampler,texture:t.texture}}function vR(t){return{buffer:t.buffer,wordCount:t.wordCount}}function yR(t){return{dimension:t.dimension,formatKind:t.formatKind}}function _R(t){return{numSamplers:t.numSamplers,numUniformBuffers:t.numUniformBuffers,samplerEntries:void 0!==t.samplerEntries?nR(t.samplerEntries,yR):void 0}}function bR(t){return{location:t.location,format:t.format,bufferIndex:t.bufferIndex,bufferByteOffset:t.bufferByteOffset,divisor:t.divisor}}function ER(t){return he(t)?t:{byteStride:t.byteStride,stepMode:t.stepMode}}vO.Float,hO.TEXTURE_2D,function(t){t[t.LITTLE_ENDIAN=0]="LITTLE_ENDIAN",t[t.BIG_ENDIAN=1]="BIG_ENDIAN"}(QO||(QO={}));var xR,MR=new Uint16Array([65279]);function SR(){var t=null;return function(e,n,r){var i=t!==r;return i&&(e.uniform1i(n,r),t=r),i}}function AR(t,e,n,r){var i=null,o=null;return function(a,s,c){var l=e(c,n),u=l.length,f=!1;if(null===i)i=new Float32Array(u),o=u,f=!0;else{IO(o===u,"Uniform length cannot change.");for(var d=0;d<u;++d)if(l[d]!==i[d]){f=!0;break}}return f&&(r(a,t,s,l),i.set(l)),f}}function TR(t,e,n,r){t[e](n,r)}function OR(t,e,n,r){t[e](n,!1,r)}255==new DataView(MR.buffer).getUint8(0)?QO.LITTLE_ENDIAN:QO.BIG_ENDIAN;var RR={},PR={},CR={},wR=[0];function NR(t,e,n,r){1===e&&"boolean"==typeof t&&(t=t?1:0),Number.isFinite(t)&&(wR[0]=t,t=wR);var i=t.length;if(t instanceof n)return t;var o=r[i];o||(o=new n(i),r[i]=o);for(var a=0;a<i;a++)o[a]=t[a];return o}function IR(t,e){return NR(t,e,Float32Array,RR)}function kR(t,e){return NR(t,e,Int32Array,PR)}function LR(t,e){return NR(t,e,Uint32Array,CR)}(xR={})[QT.FLOAT]=AR.bind(null,"uniform1fv",IR,1,TR),xR[QT.FLOAT_VEC2]=AR.bind(null,"uniform2fv",IR,2,TR),xR[QT.FLOAT_VEC3]=AR.bind(null,"uniform3fv",IR,3,TR),xR[QT.FLOAT_VEC4]=AR.bind(null,"uniform4fv",IR,4,TR),xR[QT.INT]=AR.bind(null,"uniform1iv",kR,1,TR),xR[QT.INT_VEC2]=AR.bind(null,"uniform2iv",kR,2,TR),xR[QT.INT_VEC3]=AR.bind(null,"uniform3iv",kR,3,TR),xR[QT.INT_VEC4]=AR.bind(null,"uniform4iv",kR,4,TR),xR[QT.BOOL]=AR.bind(null,"uniform1iv",kR,1,TR),xR[QT.BOOL_VEC2]=AR.bind(null,"uniform2iv",kR,2,TR),xR[QT.BOOL_VEC3]=AR.bind(null,"uniform3iv",kR,3,TR),xR[QT.BOOL_VEC4]=AR.bind(null,"uniform4iv",kR,4,TR),xR[QT.FLOAT_MAT2]=AR.bind(null,"uniformMatrix2fv",IR,4,OR),xR[QT.FLOAT_MAT3]=AR.bind(null,"uniformMatrix3fv",IR,9,OR),xR[QT.FLOAT_MAT4]=AR.bind(null,"uniformMatrix4fv",IR,16,OR),xR[QT.UNSIGNED_INT]=AR.bind(null,"uniform1uiv",LR,1,TR),xR[QT.UNSIGNED_INT_VEC2]=AR.bind(null,"uniform2uiv",LR,2,TR),xR[QT.UNSIGNED_INT_VEC3]=AR.bind(null,"uniform3uiv",LR,3,TR),xR[QT.UNSIGNED_INT_VEC4]=AR.bind(null,"uniform4uiv",LR,4,TR),xR[QT.FLOAT_MAT2x3]=AR.bind(null,"uniformMatrix2x3fv",IR,6,OR),xR[QT.FLOAT_MAT2x4]=AR.bind(null,"uniformMatrix2x4fv",IR,8,OR),xR[QT.FLOAT_MAT3x2]=AR.bind(null,"uniformMatrix3x2fv",IR,6,OR),xR[QT.FLOAT_MAT3x4]=AR.bind(null,"uniformMatrix3x4fv",IR,12,OR),xR[QT.FLOAT_MAT4x2]=AR.bind(null,"uniformMatrix4x2fv",IR,8,OR),xR[QT.FLOAT_MAT4x3]=AR.bind(null,"uniformMatrix4x3fv",IR,12,OR),xR[QT.SAMPLER_2D]=SR,xR[QT.SAMPLER_CUBE]=SR,xR[QT.SAMPLER_3D]=SR,xR[QT.SAMPLER_2D_SHADOW]=SR,xR[QT.SAMPLER_2D_ARRAY]=SR,xR[QT.SAMPLER_2D_ARRAY_SHADOW]=SR,xR[QT.SAMPLER_CUBE_SHADOW]=SR,xR[QT.INT_SAMPLER_2D]=SR,xR[QT.INT_SAMPLER_3D]=SR,xR[QT.INT_SAMPLER_CUBE]=SR,xR[QT.INT_SAMPLER_2D_ARRAY]=SR,xR[QT.UNSIGNED_INT_SAMPLER_2D]=SR,xR[QT.UNSIGNED_INT_SAMPLER_3D]=SR,xR[QT.UNSIGNED_INT_SAMPLER_CUBE]=SR,xR[QT.UNSIGNED_INT_SAMPLER_2D_ARRAY]=SR;var DR=function(){function t(){this.name="(unnamed)",this.preprocessedVert="",this.preprocessedFrag="",this.both="",this.vert="",this.frag="",this.defines={}}return t.prototype.definesChanged=function(){this.preprocessedVert="",this.preprocessedFrag=""},t.prototype.setDefineString=function(t,e){if(null!==e){if(this.defines[t]===e)return!1;this.defines[t]=e}else{if(he(this.defines[t]))return!1;delete this.defines[t]}return this.definesChanged(),!0},t.prototype.setDefineBool=function(t,e){return this.setDefineString(t,e?"1":null)},t.prototype.getDefineString=function(t){return void 0===(e=this.defines[t])?null:e;var e},t.prototype.getDefineBool=function(t){var e=this.getDefineString(t);return null!==e&&IO("1"===e),null!==e},t}(),BR=function(){function t(t){this.currentBufferWordSize=-1,this.currentWordOffset=0,this.buffer=null,this.shadowBufferF32=null,this.shadowBufferU8=null,this.device=t;var e=t.queryLimits();this.uniformBufferWordAlignment=e.uniformBufferWordAlignment,this.uniformBufferMaxPageWordSize=e.uniformBufferMaxPageWordSize}return t.prototype.isSupportedUBO=function(){return"WebGL1"!==this.device.queryVendorInfo().platformString},t.prototype.findPageIndex=function(t){return t/this.uniformBufferMaxPageWordSize|0},t.prototype.allocateChunk=function(t){IO((t=WO(t,this.uniformBufferWordAlignment))<this.uniformBufferMaxPageWordSize);var e=this.currentWordOffset;return this.findPageIndex(e)!==this.findPageIndex(e+t-1)&&(e=WO(e,this.uniformBufferMaxPageWordSize)),this.currentWordOffset=e+t,this.ensureShadowBuffer(e,t),e},t.prototype.ensureShadowBuffer=function(t,e){if(null===this.shadowBufferU8||null===this.shadowBufferF32){var n=WO(this.currentWordOffset,this.uniformBufferMaxPageWordSize);this.shadowBufferU8=new Uint8Array(4*n),this.shadowBufferF32=new Float32Array(this.shadowBufferU8.buffer)}else if(t+e>=this.shadowBufferF32.length){IO(t<this.currentWordOffset&&t+e<=this.currentWordOffset);n=WO(Math.max(this.currentWordOffset,2*this.shadowBufferF32.length),this.uniformBufferMaxPageWordSize);var r=new Uint8Array(4*n);if(r.set(this.shadowBufferU8,0),this.shadowBufferU8=r,this.shadowBufferF32=new Float32Array(this.shadowBufferU8.buffer),!(this.currentWordOffset<=n))throw new Error("Assert fail: this.currentWordOffset [".concat(this.currentWordOffset,"] <= newWordCount [").concat(n,"]"))}},t.prototype.mapBufferF32=function(){return kO(this.shadowBufferF32)},t.prototype.prepareToRender=function(){if(null!==this.shadowBufferF32){var t=kO(this.shadowBufferF32);t.length!==this.currentBufferWordSize&&(this.currentBufferWordSize=t.length,null!==this.buffer&&this.buffer.destroy(),this.buffer=this.device.createBuffer({viewOrSize:4*this.currentBufferWordSize,usage:lO.UNIFORM,hint:uO.DYNAMIC}));var e=WO(this.currentWordOffset,this.uniformBufferMaxPageWordSize);if(!(e<=this.currentBufferWordSize))throw new Error("Assert fail: wordCount [".concat(e,"] (").concat(this.currentWordOffset," aligned ").concat(this.uniformBufferMaxPageWordSize,") <= this.currentBufferWordSize [").concat(this.currentBufferWordSize,"]"));if(this.isSupportedUBO())kO(this.buffer).setSubData(0,this.shadowBufferU8,0,4*e);this.currentWordOffset=0}},t.prototype.destroy=function(){null!==this.buffer&&this.buffer.destroy(),this.shadowBufferF32=null,this.shadowBufferU8=null},t}();function FR(t,e){return t+=e,t+=t<<10,(t+=t>>>6)>>>0}function UR(t){return t+=t<<3,t^=t>>>11,(t+=t<<15)>>>0}function jR(t){return 0}var GR=function(){this.keys=[],this.values=[]},WR=function(){function t(t,e){this.keyEqualFunc=t,this.keyHashFunc=e,this.buckets=new Map}return t.prototype.findBucketIndex=function(t,e){for(var n=0;n<t.keys.length;n++)if(this.keyEqualFunc(e,t.keys[n]))return n;return-1},t.prototype.findBucket=function(t){var e=this.keyHashFunc(t);return this.buckets.get(e)},t.prototype.get=function(t){var e=this.findBucket(t);if(void 0===e)return null;var n=this.findBucketIndex(e,t);return n<0?null:e.values[n]},t.prototype.add=function(t,e){var n=this.keyHashFunc(t);void 0===this.buckets.get(n)&&this.buckets.set(n,new GR);var r=this.buckets.get(n);r.keys.push(t),r.values.push(e)},t.prototype.delete=function(t){var e=this.findBucket(t);if(void 0!==e){var n=this.findBucketIndex(e,t);-1!==n&&(e.keys.splice(n,1),e.values.splice(n,1))}},t.prototype.clear=function(){this.buckets.clear()},t.prototype.size=function(){var t,e,n=0;try{for(var r=l(this.buckets.values()),i=r.next();!i.done;i=r.next()){n+=i.value.values.length}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},t.prototype.values=function(){var t,e,n,r,i,o,a;return c(this,(function(s){switch(s.label){case 0:s.trys.push([0,7,8,9]),t=l(this.buckets.values()),e=t.next(),s.label=1;case 1:if(e.done)return[3,6];n=e.value,r=n.values.length-1,s.label=2;case 2:return r>=0?[4,n.values[r]]:[3,5];case 3:s.sent(),s.label=4;case 4:return r--,[3,2];case 5:return e=t.next(),[3,1];case 6:return[3,9];case 7:return i=s.sent(),o={error:i},[3,9];case 8:try{e&&!e.done&&(a=t.return)&&a.call(t)}finally{if(o)throw o.error}return[7];case 9:return[2]}}))},t}(),zR=[[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]];function VR(t,e){return"#define ".concat(t," ").concat(e)}function HR(t){var e="",n=t;return t.endsWith("Shadow")&&(n=n.slice(0,-6),e="Shadow"),[n,e]}function XR(t,e,n,r){var i,o;void 0===r&&(r=null);var a="#version 100"===t.glslVersion,s=n.split("\n").map((function(t){return t.replace(/[/][/].*$/,"")})).filter((function(t){return!(!t||/^\s+$/.test(t))})),c="";null!==r&&(c=Object.keys(r).map((function(t){return VR(t,r[t])})).join("\n"));var f=s.find((function(t){return t.startsWith("precision")}))||"precision mediump float;",d=s.filter((function(t){return!t.startsWith("precision")})).join("\n"),h="";if(t.viewportOrigin===yO.UPPER_LEFT&&(h+="".concat(VR("VIEWPORT_ORIGIN_TL","1"),"\n")),t.clipSpaceNearZ===_O.ZERO&&(h+="".concat(VR("CLIPSPACE_NEAR_ZERO","1"),"\n")),t.explicitBindingLocations){var p=0,g=0,m=0;d=d.replace(/^(layout\((.*)\))?\s*uniform(.+{)$/gm,(function(t,e,n,r){var i=n?"".concat(n,", "):"";return"layout(".concat(i,"set = ").concat(p,", binding = ").concat(g++,") uniform ").concat(r)})),p++,g=0,IO(t.separateSamplerTextures),d=d.replace(/^(layout\((.*)\))?\s*uniform sampler(\w+) (.*);/gm,(function(t,n,r,i,o){var a=function(t){if(void 0===t)return null;var e=/binding\s*=\s*(\d+)/.exec(t);if(null!==e){var n=parseInt(e[1],10);if(!Number.isNaN(n))return n}return null}(r);null===a&&(a=g++);var s=u(HR(i),2),c=s[0],l=s[1];return"frag"===e?"\nlayout(set = ".concat(p,", binding = ").concat(2*a+0,") uniform texture").concat(c," T_").concat(o,";\nlayout(set = ").concat(p,", binding = ").concat(2*a+1,") uniform sampler").concat(l," S_").concat(o,";").trim():""})),d=d.replace("frag"===e?/^\b(varying|in)\b/gm:/^\b(varying|out)\b/gm,(function(t,e){return"layout(location = ".concat(m++,") ").concat(e)})),h+="".concat(VR("gl_VertexID","gl_VertexIndex"),"\n"),h+="".concat(VR("gl_InstanceID","gl_InstanceIndex"),"\n")}t.separateSamplerTextures?(d=d.replace(/\bPD_SAMPLER_(\w+)\((.*?)\)/g,(function(t,e,n){var r=u(HR(e),2),i=r[0],o=r[1];return"texture".concat(i," T_P_").concat(n,", sampler").concat(o," S_P_").concat(n)})),d=(d=(d=d.replace(/\bPP_SAMPLER_(\w+)\((.*?)\)/g,(function(t,e,n){return"T_".concat(n,", S_").concat(n)}))).replace(/\bSAMPLER_(\w+)\((.*?)\)/g,(function(t,e,n){return"sampler".concat(e,"(T_").concat(n,", S_").concat(n,")")}))).replace(/\bTEXTURE\((.*?)\)/g,(function(t,e){return"T_".concat(e)}))):d=(d=(d=(d=d.replace(/\bPD_SAMPLER_(\w+)\((.*?)\)/g,(function(t,e,n){return"sampler".concat(e," P_").concat(n)}))).replace(/\bPP_SAMPLER_(\w+)\((.*?)\)/g,(function(t,e,n){return n}))).replace(/\bSAMPLER_(\w+)\((.*?)\)/g,(function(t,e,n){return n}))).replace(/\bTEXTURE\((.*?)\)/g,(function(t,e){return e}));var v="".concat(a?"":t.glslVersion,"\n").concat("","\n").concat(a&&"frag"===e?"#extension GL_OES_standard_derivatives : enable":"","\n").concat(f,"\n").concat(h,"\n").concat(c,"\n").concat(d,"\n").trim();if(t.explicitBindingLocations&&"frag"===e&&(v=v.replace(/^\b(out)\b/gm,(function(t,e){return"layout(location = 0) ".concat(e)}))),a){if("frag"===e&&(v=v.replace(/^\s*in\s+(\S+)\s*(.*);$/gm,(function(t,e,n){return"varying ".concat(e," ").concat(n,";\n")}))),"vert"===e&&(v=v.replace(/^\s*out\s+(\S+)\s*(.*);$/gm,(function(t,e,n){return"varying ".concat(e," ").concat(n,";\n")})),v=v.replace(/^\s*layout\(location\s*=\s*\S*\)\s*in\s+(\S+)\s*(.*);$/gm,(function(t,e,n){return"attribute ".concat(e," ").concat(n,";\n")}))),v=v.replace(/\s*uniform\s*.*\s*{((?:\s*.*\s*)*?)};/g,(function(t,e){return e.trim().replace(/^.*$/gm,(function(t){var e=t.trim();return e.startsWith("#")?e:t?"uniform ".concat(e):""}))})),"frag"===e){var y;v=v.replace(/^\s*out\s+(\S+)\s*(.*);$/gm,(function(t,e,n){return y=n,"".concat(e," ").concat(n,";\n")}));var _=v.lastIndexOf("}");v=v.substring(0,_)+"\n gl_FragColor = vec4(".concat(y,");\n")+v.substring(_)}v=v.replace(/^\s*layout\((.*)\)/gm,"");try{for(var b=l(zR),E=b.next();!E.done;E=b.next()){var x=u(E.value,2),M=x[0],S=x[1];v=v.replace(M,S)}}catch(t){i={error:t}}finally{try{E&&!E.done&&(o=b.return)&&o.call(b)}finally{if(i)throw i.error}}}return v}function YR(t,e){var n=void 0!==e.defines?e.defines:null,r=void 0!==e.both?e.both+e.vert:e.vert,i=void 0!==e.both?e.both+e.frag:e.frag;return function(t,e,n,r){return void 0===r&&(r=null),{vert:e,frag:n,preprocessedVert:XR(t,"vert",e,r),preprocessedFrag:XR(t,"frag",n,r)}}(t.queryVendorInfo(),r,i,n)}function $R(t,e){return IO(""!==t.preprocessedVert&&""!==e.preprocessedVert),IO(""!==t.preprocessedFrag&&""!==e.preprocessedFrag),t.preprocessedVert===e.preprocessedVert&&t.preprocessedFrag===e.preprocessedFrag}function qR(t,e){return t=FR(t,e.numUniformBuffers),t=FR(t,e.numSamplers)}function KR(t,e){return t=FR(t,e.blendMode),t=FR(t,e.blendSrcFactor),t=FR(t,e.blendDstFactor)}function ZR(t,e){return t=KR(t,e.rgbBlendState),t=FR(t=KR(t,e.alphaBlendState),e.channelWriteMask)}function QR(t,e){for(var n=0;n<e.attachmentsState.length;n++)t=ZR(t,e.attachmentsState[n]);return t=function(t,e){return FR(t,e.r<<24|e.g<<16|e.b<<8|e.a)}(t,e.blendConstant),t=FR(t,e.depthCompare),t=FR(t,e.depthWrite?1:0),t=FR(t,e.stencilCompare),t=FR(t,e.stencilPassOp),t=FR(t,e.stencilWrite?1:0),t=FR(t,e.cullMode),t=FR(t,e.frontFace?1:0),t=FR(t,e.polygonOffset?1:0)}function JR(t){var e=0;e=FR(e,t.program.id),null!==t.inputLayout&&(e=FR(e,t.inputLayout.id));for(var n=0;n<t.bindingLayouts.length;n++)e=qR(e,t.bindingLayouts[n]);e=QR(e,t.megaStateDescriptor);for(n=0;n<t.colorAttachmentFormats.length;n++)e=FR(e,t.colorAttachmentFormats[n]||0);return UR(e=FR(e,t.depthStencilAttachmentFormat||0))}function tP(t){for(var e=0,n=0;n<t.samplerBindings.length;n++){null!==(r=t.samplerBindings[n])&&null!==r.texture&&(e=FR(e,r.texture.id))}for(n=0;n<t.uniformBufferBindings.length;n++){var r;null!==(r=t.uniformBufferBindings[n])&&null!==r.buffer&&(e=FR(e,r.buffer.id),e=FR(e,r.wordCount))}return UR(e)}var eP,nP,rP=function(){function t(t){this.bindingsCache=new WR(oR,tP),this.renderPipelinesCache=new WR(fR,JR),this.inputLayoutsCache=new WR(pR,jR),this.programCache=new WR($R,jR),this.samplerCache=new WR(gR,jR),this.device=t}return t.prototype.createBindings=function(t){var e=this.bindingsCache.get(t);if(null===e){var n=function(t){return{bindingLayout:t.bindingLayout,samplerBindings:nR(t.samplerBindings,mR),uniformBufferBindings:nR(t.uniformBufferBindings,vR),pipeline:t.pipeline}}(t);e=this.device.createBindings(n),this.bindingsCache.add(n,e)}return e},t.prototype.createRenderPipeline=function(t){var e=this.renderPipelinesCache.get(t);if(null===e){var n=function(t){var e=nR(t.bindingLayouts,_R),n=t.inputLayout,r=t.program,i=t.topology;return{bindingLayouts:e,inputLayout:n,megaStateDescriptor:qO(t.megaStateDescriptor),program:r,topology:i,colorAttachmentFormats:t.colorAttachmentFormats.slice(),depthStencilAttachmentFormat:t.depthStencilAttachmentFormat,sampleCount:t.sampleCount}}(t);e=this.device.createRenderPipeline(n),this.renderPipelinesCache.add(n,e)}return e},t.prototype.createInputLayout=function(t){var e=this.inputLayoutsCache.get(t);if(null===e){var n=function(t){return{vertexAttributeDescriptors:nR(t.vertexAttributeDescriptors,bR),vertexBufferDescriptors:nR(t.vertexBufferDescriptors,ER),indexBufferFormat:t.indexBufferFormat,program:t.program}}(t);e=this.device.createInputLayout(n),this.inputLayoutsCache.add(n,e)}return e},t.prototype.createProgramSimple=function(t){var e=t.vert,n=t.frag,r=t.preprocessedFrag,i=t.preprocessedVert,o=null;if(i&&r&&(o=this.programCache.get({vert:e,frag:n,preprocessedFrag:r,preprocessedVert:i})),null===o){var a=YR(this.device,t),s=a.preprocessedVert,c=a.preprocessedFrag;t.preprocessedVert=s,t.preprocessedFrag=c;var l=function(t){return{preprocessedVert:t.preprocessedVert,preprocessedFrag:t.preprocessedFrag,vert:t.vert,frag:t.frag}}(t);o=this.device.createProgramSimple({vertex:{glsl:s},fragment:{glsl:c}},e),this.programCache.add(l,o)}return o},t.prototype.createSampler=function(t){var e=this.samplerCache.get(t);return null===e&&(e=this.device.createSampler(t),this.samplerCache.add(t,e)),e},t.prototype.destroy=function(){var t,e,n,r,i,o,a,s,c,u;try{for(var f=l(this.bindingsCache.values()),d=f.next();!d.done;d=f.next()){d.value.destroy()}}catch(e){t={error:e}}finally{try{d&&!d.done&&(e=f.return)&&e.call(f)}finally{if(t)throw t.error}}try{for(var h=l(this.renderPipelinesCache.values()),p=h.next();!p.done;p=h.next()){p.value.destroy()}}catch(t){n={error:t}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}try{for(var g=l(this.inputLayoutsCache.values()),m=g.next();!m.done;m=g.next()){m.value.destroy()}}catch(t){i={error:t}}finally{try{m&&!m.done&&(o=g.return)&&o.call(g)}finally{if(i)throw i.error}}try{for(var v=l(this.programCache.values()),y=v.next();!y.done;y=v.next()){y.value.destroy()}}catch(t){a={error:t}}finally{try{y&&!y.done&&(s=v.return)&&s.call(v)}finally{if(a)throw a.error}}try{for(var _=l(this.samplerCache.values()),b=_.next();!b.done;b=_.next()){b.value.destroy()}}catch(t){c={error:t}}finally{try{b&&!b.done&&(u=_.return)&&u.call(_)}finally{if(c)throw c.error}}this.bindingsCache.clear(),this.renderPipelinesCache.clear(),this.inputLayoutsCache.clear(),this.programCache.clear(),this.samplerCache.clear()},t}();!function(t){t.NONE="none",t.LINEAR="LinearToneMapping",t.REINHARD="ReinhardToneMapping",t.CINEON="OptimizedCineonToneMapping",t.ACES_FILMIC="ACESFilmicToneMapping",t.CUSTOM="CustomToneMapping"}(eP||(eP={})),function(t){t[t.Color0=0]="Color0",t[t.Color1=1]="Color1",t[t.Color2=2]="Color2",t[t.Color3=3]="Color3",t[t.ColorMax=3]="ColorMax",t[t.DepthStencil=4]="DepthStencil"}(nP||(nP={}));var iP,oP,aP=function(){function t(){this.renderTargetIDs=[],this.renderTargetLevels=[],this.resolveTextureOutputIDs=[],this.resolveTextureOutputExternalTextures=[],this.resolveTextureOutputExternalTextureLevel=[],this.resolveTextureInputIDs=[],this.renderTargetExtraRefs=[],this.resolveTextureInputTextures=[],this.renderTargets=[],this.descriptor={colorAttachment:[],colorAttachmentLevel:[],colorResolveTo:[],colorResolveToLevel:[],colorStore:[],depthStencilAttachment:null,depthStencilResolveTo:null,depthStencilStore:!0,colorClearColor:["load"],depthClearValue:"load",stencilClearValue:"load",occlusionQueryPool:null},this.viewportX=0,this.viewportY=0,this.viewportW=1,this.viewportH=1,this.execFunc=null,this.postFunc=null,this.debugThumbnails=[]}return t.prototype.setDebugName=function(t){this.debugName=t},t.prototype.pushDebugThumbnail=function(t){this.debugThumbnails[t]=!0},t.prototype.setViewport=function(t,e,n,r){this.viewportX=t,this.viewportY=e,this.viewportW=n,this.viewportH=r},t.prototype.attachRenderTargetID=function(t,e,n){void 0===n&&(n=0),IO(void 0===this.renderTargetIDs[t]),this.renderTargetIDs[t]=e,this.renderTargetLevels[t]=n},t.prototype.attachResolveTexture=function(t){this.resolveTextureInputIDs.push(t)},t.prototype.attachOcclusionQueryPool=function(t){this.descriptor.occlusionQueryPool=t},t.prototype.exec=function(t){IO(null===this.execFunc),this.execFunc=t},t.prototype.post=function(t){IO(null===this.postFunc),this.postFunc=t},t.prototype.addExtraRef=function(t){this.renderTargetExtraRefs[t]=!0},t}(),sP=function(){function t(t,e){this.dimension=hO.TEXTURE_2D,this.depth=1,this.numLevels=1,this.width=0,this.height=0,this.sampleCount=0,this.usage=pO.RENDER_TARGET,this.immutable=!0,this.needsClear=!0,this.texture=null,this.age=0,this.pixelFormat=e.pixelFormat,this.width=e.width,this.height=e.height,this.sampleCount=e.sampleCount,IO(this.sampleCount>=1),this.sampleCount>1?this.attachment=t.createRenderTarget(this):(this.texture=t.createTexture(this),this.attachment=t.createRenderTargetFromTexture(this.texture))}return t.prototype.setDebugName=function(t,e){this.debugName=e,null!==this.texture&&t.setResourceName(this.texture,this.debugName),t.setResourceName(this.attachment,this.debugName)},t.prototype.matchesDescription=function(t){return this.pixelFormat===t.pixelFormat&&this.width===t.width&&this.height===t.height&&this.sampleCount===t.sampleCount},t.prototype.reset=function(t){IO(this.matchesDescription(t)),this.age=0},t.prototype.destroy=function(){this.attachment.destroy()},t}(),cP=function(){function t(t,e){this.dimension=hO.TEXTURE_2D,this.depth=1,this.numLevels=1,this.usage=pO.RENDER_TARGET,this.width=0,this.height=0,this.age=0,this.immutable=!0,this.pixelFormat=e.pixelFormat,this.width=e.width,this.height=e.height,this.texture=t.createTexture(this)}return t.prototype.matchesDescription=function(t){return this.pixelFormat===t.pixelFormat&&this.width===t.width&&this.height===t.height},t.prototype.reset=function(t){IO(this.matchesDescription(t)),this.age=0},t.prototype.destroy=function(){this.texture.destroy()},t}(),lP=function(){this.renderTargetDescriptions=[],this.resolveTextureRenderTargetIDs=[],this.passes=[],this.renderTargetDebugNames=[]},uP=function(){function t(t){this.currentPass=null,this.renderTargetDeadPool=[],this.singleSampledTextureDeadPool=[],this.currentGraph=null,this.renderTargetOutputCount=[],this.renderTargetResolveCount=[],this.resolveTextureUseCount=[],this.renderTargetAliveForID=[],this.singleSampledTextureForResolveTextureID=[],this.device=t}return t.prototype.acquireRenderTargetForDescription=function(t){for(var e=0;e<this.renderTargetDeadPool.length;e++){var n=this.renderTargetDeadPool[e];if(n.matchesDescription(t))return n.reset(t),this.renderTargetDeadPool.splice(e--,1),n}return new sP(this.device,t)},t.prototype.acquireSingleSampledTextureForDescription=function(t){for(var e=0;e<this.singleSampledTextureDeadPool.length;e++){var n=this.singleSampledTextureDeadPool[e];if(n.matchesDescription(t))return n.reset(t),this.singleSampledTextureDeadPool.splice(e--,1),n}return new cP(this.device,t)},t.prototype.beginGraphBuilder=function(){IO(null===this.currentGraph),this.currentGraph=new lP},t.prototype.pushPass=function(t){var e=new aP;t(e),this.currentGraph.passes.push(e)},t.prototype.createRenderTargetID=function(t,e){return this.currentGraph.renderTargetDebugNames.push(e),this.currentGraph.renderTargetDescriptions.push(t)-1},t.prototype.createResolveTextureID=function(t){return this.currentGraph.resolveTextureRenderTargetIDs.push(t)-1},t.prototype.findMostRecentPassThatAttachedRenderTarget=function(t){for(var e=this.currentGraph.passes.length-1;e>=0;e--){var n=this.currentGraph.passes[e];if(n.renderTargetIDs.includes(t))return n}return null},t.prototype.resolveRenderTargetPassAttachmentSlot=function(t,e){var n=t;if(void 0===n.resolveTextureOutputIDs[e]){var r=n.renderTargetIDs[e],i=this.createResolveTextureID(r);n.resolveTextureOutputIDs[e]=i}return n.resolveTextureOutputIDs[e]},t.prototype.findPassForResolveRenderTarget=function(t){var e=kO(this.findMostRecentPassThatAttachedRenderTarget(t)),n=e.renderTargetIDs.indexOf(t);return IO(void 0===e.resolveTextureOutputExternalTextures[n]),e},t.prototype.resolveRenderTarget=function(t){var e=this.findPassForResolveRenderTarget(t),n=e.renderTargetIDs.indexOf(t);return this.resolveRenderTargetPassAttachmentSlot(e,n)},t.prototype.resolveRenderTargetToExternalTexture=function(t,e,n){void 0===n&&(n=0);var r=this.findPassForResolveRenderTarget(t),i=r.renderTargetIDs.indexOf(t);IO(void 0===r.resolveTextureOutputIDs[i]),r.resolveTextureOutputExternalTextures[i]=e,r.resolveTextureOutputExternalTextureLevel[i]=n},t.prototype.getRenderTargetDescription=function(t){return kO(this.currentGraph.renderTargetDescriptions[t])},t.prototype.scheduleAddUseCount=function(t,e){for(var n=0;n<e.renderTargetIDs.length;n++){void 0!==(o=e.renderTargetIDs[n])&&(this.renderTargetOutputCount[o]++,e.renderTargetExtraRefs[n]&&this.renderTargetOutputCount[o]++)}for(var r=0;r<e.resolveTextureInputIDs.length;r++){var i=e.resolveTextureInputIDs[r];if(void 0!==i){this.resolveTextureUseCount[i]++;var o=t.resolveTextureRenderTargetIDs[i];this.renderTargetResolveCount[o]++}}},t.prototype.acquireRenderTargetForID=function(t,e){if(void 0===e)return null;if(IO(this.renderTargetOutputCount[e]>0),!this.renderTargetAliveForID[e]){var n=t.renderTargetDescriptions[e],r=this.acquireRenderTargetForDescription(n);r.setDebugName(this.device,t.renderTargetDebugNames[e]),this.renderTargetAliveForID[e]=r}return this.renderTargetAliveForID[e]},t.prototype.releaseRenderTargetForID=function(t,e){if(void 0===t)return null;var n=kO(this.renderTargetAliveForID[t]);return e?(IO(this.renderTargetOutputCount[t]>0),this.renderTargetOutputCount[t]--):(IO(this.renderTargetResolveCount[t]>0),this.renderTargetResolveCount[t]--),0===this.renderTargetOutputCount[t]&&0===this.renderTargetResolveCount[t]&&(n.needsClear=!0,delete this.renderTargetAliveForID[t],this.renderTargetDeadPool.push(n)),n},t.prototype.acquireResolveTextureInputTextureForID=function(t,e){var n=t.resolveTextureRenderTargetIDs[e];IO(this.resolveTextureUseCount[e]>0),this.resolveTextureUseCount[e]--;var r=kO(this.releaseRenderTargetForID(n,!1));if(void 0!==this.singleSampledTextureForResolveTextureID[e]){var i=this.singleSampledTextureForResolveTextureID[e];return 0===this.resolveTextureUseCount[e]&&this.singleSampledTextureDeadPool.push(i),i.texture}return kO(r.texture)},t.prototype.determineResolveParam=function(t,e,n){var r=e.renderTargetIDs[n],i=e.resolveTextureOutputIDs[n],o=e.resolveTextureOutputExternalTextures[n],a=void 0!==i,s=void 0!==o;IO(!(a&&s));var c=null,l=!1,u=0;if(this.renderTargetOutputCount[r]>1&&(l=!0),a){IO(t.resolveTextureRenderTargetIDs[i]===r),IO(this.resolveTextureUseCount[i]>0),IO(this.renderTargetOutputCount[r]>0);var f=kO(this.renderTargetAliveForID[r]);if(null!==f.texture&&1===this.renderTargetOutputCount[r])c=null,l=!0;else{if(!this.singleSampledTextureForResolveTextureID[i]){var d=kO(t.renderTargetDescriptions[r]);this.singleSampledTextureForResolveTextureID[i]=this.acquireSingleSampledTextureForDescription(d),this.device.setResourceName(this.singleSampledTextureForResolveTextureID[i].texture,f.debugName+" (Resolve ".concat(i,")"))}c=this.singleSampledTextureForResolveTextureID[i].texture}}else s?(c=o,u=e.resolveTextureOutputExternalTextureLevel[n]):c=null;return{resolveTo:c,store:l,level:u}},t.prototype.schedulePass=function(t,e){for(var n=e.renderTargetIDs[nP.DepthStencil],r=nP.Color0;r<=nP.ColorMax;r++){var i=e.renderTargetIDs[r],o=this.acquireRenderTargetForID(t,i);e.renderTargets[r]=o,e.descriptor.colorAttachment[r]=null!==o?o.attachment:null,e.descriptor.colorAttachmentLevel[r]=e.renderTargetLevels[r];var a=this.determineResolveParam(t,e,r),s=a.resolveTo,c=a.store,l=a.level;e.descriptor.colorResolveTo[r]=s,e.descriptor.colorResolveToLevel[r]=l,e.descriptor.colorStore[r]=c,e.descriptor.colorClearColor[r]=null!==o&&o.needsClear?t.renderTargetDescriptions[i].colorClearColor:"load"}var u=this.acquireRenderTargetForID(t,n);e.renderTargets[nP.DepthStencil]=u,e.descriptor.depthStencilAttachment=null!==u?u.attachment:null;var f=this.determineResolveParam(t,e,nP.DepthStencil),d=f.resolveTo,h=f.store;e.descriptor.depthStencilResolveTo=d,e.descriptor.depthStencilStore=h,e.descriptor.depthClearValue=null!==u&&u.needsClear?t.renderTargetDescriptions[n].depthClearValue:"load",e.descriptor.stencilClearValue=null!==u&&u.needsClear?t.renderTargetDescriptions[n].stencilClearValue:"load";for(var p=0,g=0,m=0,v=0;v<e.renderTargets.length;v++){var y=e.renderTargets[v];if(y){var _=y.width>>>e.renderTargetLevels[v],b=y.height>>>e.renderTargetLevels[v];0===p&&(p=_,g=b,m=y.sampleCount),IO(_===p),IO(b===g),IO(y.sampleCount===m),y.needsClear=!1}}p>0&&g>0&&(e.viewportX*=p,e.viewportY*=g,e.viewportW*=p,e.viewportH*=g);for(v=0;v<e.resolveTextureInputIDs.length;v++){var E=e.resolveTextureInputIDs[v];e.resolveTextureInputTextures[v]=this.acquireResolveTextureInputTextureForID(t,E)}for(v=0;v<e.renderTargetIDs.length;v++)this.releaseRenderTargetForID(e.renderTargetIDs[v],!0);for(r=0;r<e.renderTargetExtraRefs.length;r++)e.renderTargetExtraRefs[r]&&this.releaseRenderTargetForID(e.renderTargetIDs[r],!0)},t.prototype.scheduleGraph=function(t){IO(0===this.renderTargetOutputCount.length),IO(0===this.renderTargetResolveCount.length),IO(0===this.resolveTextureUseCount.length);for(var e=0;e<this.renderTargetDeadPool.length;e++)this.renderTargetDeadPool[e].age++;for(e=0;e<this.singleSampledTextureDeadPool.length;e++)this.singleSampledTextureDeadPool[e].age++;GO(this.renderTargetOutputCount,t.renderTargetDescriptions.length,0),GO(this.renderTargetResolveCount,t.renderTargetDescriptions.length,0),GO(this.resolveTextureUseCount,t.resolveTextureRenderTargetIDs.length,0);for(e=0;e<t.passes.length;e++)this.scheduleAddUseCount(t,t.passes[e]);for(e=0;e<t.passes.length;e++)this.schedulePass(t,t.passes[e]);for(e=0;e<this.renderTargetOutputCount.length;e++)IO(0===this.renderTargetOutputCount[e]);for(e=0;e<this.renderTargetResolveCount.length;e++)IO(0===this.renderTargetResolveCount[e]);for(e=0;e<this.resolveTextureUseCount.length;e++)IO(0===this.resolveTextureUseCount[e]);for(e=0;e<this.renderTargetAliveForID.length;e++)IO(void 0===this.renderTargetAliveForID[e]);for(e=0;e<this.renderTargetDeadPool.length;e++)this.renderTargetDeadPool[e].age>=1&&(this.renderTargetDeadPool[e].destroy(),this.renderTargetDeadPool.splice(e--,1));for(e=0;e<this.singleSampledTextureDeadPool.length;e++)this.singleSampledTextureDeadPool[e].age>=1&&(this.singleSampledTextureDeadPool[e].destroy(),this.singleSampledTextureDeadPool.splice(e--,1));this.renderTargetResolveCount.length=0,this.renderTargetOutputCount.length=0,this.resolveTextureUseCount.length=0},t.prototype.execPass=function(t){IO(null===this.currentPass),this.currentPass=t;var e=this.device.createRenderPass(t.descriptor);e.pushDebugGroup(t.debugName),e.setViewport(t.viewportX,t.viewportY,t.viewportW,t.viewportH),null!==t.execFunc&&t.execFunc(e,this),e.popDebugGroup(),this.device.submitPass(e),null!==t.postFunc&&t.postFunc(this),this.currentPass=null},t.prototype.execGraph=function(t){var e=this;this.scheduleGraph(t),this.device.beginFrame(),t.passes.forEach((function(t){e.execPass(t)})),this.device.endFrame(),this.singleSampledTextureForResolveTextureID.length=0},t.prototype.execute=function(){var t=kO(this.currentGraph);this.execGraph(t),this.currentGraph=null},t.prototype.getDebug=function(){return this},t.prototype.getPasses=function(){return this.currentGraph.passes},t.prototype.getPassDebugThumbnails=function(t){return t.debugThumbnails},t.prototype.getPassRenderTargetID=function(t,e){return t.renderTargetIDs[e]},t.prototype.getRenderTargetIDDebugName=function(t){return this.currentGraph.renderTargetDebugNames[t]},t.prototype.getResolveTextureForID=function(t){var e=this.currentPass,n=e.resolveTextureInputIDs.indexOf(t);return IO(n>=0),kO(e.resolveTextureInputTextures[n])},t.prototype.getRenderTargetAttachment=function(t){var e=this.currentPass.renderTargets[t];return e?e.attachment:null},t.prototype.getRenderTargetTexture=function(t){var e=this.currentPass.renderTargets[t];return e?e.texture:null},t.prototype.newGraphBuilder=function(){return this.beginGraphBuilder(),this},t.prototype.destroy=function(){for(var t=0;t<this.renderTargetAliveForID.length;t++)IO(void 0===this.renderTargetAliveForID[t]);for(t=0;t<this.singleSampledTextureForResolveTextureID.length;t++)IO(void 0===this.singleSampledTextureForResolveTextureID[t]);for(t=0;t<this.renderTargetDeadPool.length;t++)this.renderTargetDeadPool[t].destroy();for(t=0;t<this.singleSampledTextureDeadPool.length;t++)this.singleSampledTextureDeadPool[t].destroy()},t}();function fP(t,e,n,r,i,o){return void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=0),t[e+0]=n,t[e+1]=r,t[e+2]=i,t[e+3]=o,4}!function(t){t[t.BACKGROUND=0]="BACKGROUND",t[t.ALPHA_TEST=16]="ALPHA_TEST",t[t.OPAQUE=32]="OPAQUE",t[t.TRANSLUCENT=128]="TRANSLUCENT"}(iP||(iP={})),x(1,0,0,0,0,1,0,0,0,0,2,0,0,0,-1,1),x(1,0,0,0,0,1,0,0,0,0,.5,0,0,0,.5,1),function(t){t[t.None=0]="None",t[t.Indexed=1]="Indexed",t[t.AllowSkippingIfPipelineNotReady=2]="AllowSkippingIfPipelineNotReady",t[t.Template=4]="Template",t[t.Draw=8]="Draw",t[t.InheritedFlags=3]="InheritedFlags"}(oP||(oP={}));var dP,hP=function(){function t(){this.sortKey=0,this.debug=null,this.uniforms=[],this.bindingDescriptors=VO(1,(function(){return{bindingLayout:null,samplerBindings:[],uniformBufferBindings:[]}})),this.dynamicUniformBufferByteOffsets=VO(4,(function(){return 0})),this.flags=0,this.vertexBuffers=null,this.indexBuffer=null,this.drawStart=0,this.drawCount=0,this.drawInstanceCount=0,this.renderPipelineDescriptor={bindingLayouts:[],inputLayout:null,megaStateDescriptor:qO(ZO),program:null,topology:cO.TRIANGLES,colorAttachmentFormats:[],depthStencilAttachmentFormat:null,sampleCount:1},this.reset()}return t.prototype.reset=function(){this.sortKey=0,this.flags=oP.AllowSkippingIfPipelineNotReady,this.vertexBuffers=null,this.indexBuffer=null,this.renderPipelineDescriptor.inputLayout=null},t.prototype.setFromTemplate=function(t){$O(this.renderPipelineDescriptor.megaStateDescriptor,t.renderPipelineDescriptor.megaStateDescriptor),this.renderPipelineDescriptor.program=t.renderPipelineDescriptor.program,this.renderPipelineDescriptor.inputLayout=t.renderPipelineDescriptor.inputLayout,this.renderPipelineDescriptor.topology=t.renderPipelineDescriptor.topology,this.renderPipelineDescriptor.colorAttachmentFormats.length=Math.max(this.renderPipelineDescriptor.colorAttachmentFormats.length,t.renderPipelineDescriptor.colorAttachmentFormats.length);for(var e=0;e<t.renderPipelineDescriptor.colorAttachmentFormats.length;e++)this.renderPipelineDescriptor.colorAttachmentFormats[e]=t.renderPipelineDescriptor.colorAttachmentFormats[e];this.renderPipelineDescriptor.depthStencilAttachmentFormat=t.renderPipelineDescriptor.depthStencilAttachmentFormat,this.renderPipelineDescriptor.sampleCount=t.renderPipelineDescriptor.sampleCount,this.uniformBuffer=t.uniformBuffer,this.uniforms=f([],u(t.uniforms),!1),this.drawCount=t.drawCount,this.drawStart=t.drawStart,this.drawInstanceCount=t.drawInstanceCount,this.vertexBuffers=t.vertexBuffers,this.indexBuffer=t.indexBuffer,this.flags=this.flags&~oP.InheritedFlags|t.flags&oP.InheritedFlags,this.sortKey=t.sortKey;var n=this.bindingDescriptors[0],r=t.bindingDescriptors[0];null!==r.bindingLayout&&this.setBindingLayout(r.bindingLayout);for(e=0;e<Math.min(n.uniformBufferBindings.length,r.uniformBufferBindings.length);e++)n.uniformBufferBindings[e].wordCount=t.bindingDescriptors[0].uniformBufferBindings[e].wordCount;this.setSamplerBindingsFromTextureMappings(r.samplerBindings);for(e=0;e<t.dynamicUniformBufferByteOffsets.length;e++)this.dynamicUniformBufferByteOffsets[e]=t.dynamicUniformBufferByteOffsets[e]},t.prototype.validate=function(){for(var t=0;t<this.bindingDescriptors.length;t++)for(var e=this.bindingDescriptors[t],n=0;n<e.bindingLayout.numUniformBuffers;n++)IO(e.uniformBufferBindings[n].wordCount>0);IO(this.drawCount>0)},t.prototype.setProgram=function(t){this.renderPipelineDescriptor.program=t},t.prototype.setMegaStateFlags=function(t){return $O(this.renderPipelineDescriptor.megaStateDescriptor,t),this.renderPipelineDescriptor.megaStateDescriptor},t.prototype.getMegaStateFlags=function(){return this.renderPipelineDescriptor.megaStateDescriptor},t.prototype.setVertexInput=function(t,e,n){this.vertexBuffers=e,this.indexBuffer=n,this.renderPipelineDescriptor.inputLayout=t},t.prototype.setBindingLayout=function(t){IO(t.numUniformBuffers<this.dynamicUniformBufferByteOffsets.length),this.renderPipelineDescriptor.bindingLayouts[0]=t,this.bindingDescriptors[0].bindingLayout=t;for(var e=this.bindingDescriptors[0].uniformBufferBindings.length;e<t.numUniformBuffers;e++)this.bindingDescriptors[0].uniformBufferBindings.push({buffer:null,wordCount:0});for(e=this.bindingDescriptors[0].samplerBindings.length;e<t.numSamplers;e++)this.bindingDescriptors[0].samplerBindings.push({sampler:null,texture:null})},t.prototype.setBindingLayouts=function(t){IO(t.length<=this.bindingDescriptors.length),IO(1===t.length),this.setBindingLayout(t[0])},t.prototype.drawIndexes=function(t,e){void 0===e&&(e=0),this.flags=zO(this.flags,oP.Indexed,!0),this.drawCount=t,this.drawStart=e,this.drawInstanceCount=1},t.prototype.drawIndexesInstanced=function(t,e,n){void 0===n&&(n=0),this.flags=zO(this.flags,oP.Indexed,!0),this.drawCount=t,this.drawStart=n,this.drawInstanceCount=e},t.prototype.drawPrimitives=function(t,e){void 0===e&&(e=0),this.flags=zO(this.flags,oP.Indexed,!1),this.drawCount=t,this.drawStart=e,this.drawInstanceCount=1},t.prototype.setUniforms=function(t,e){if(0!==e.length){this.uniforms[t]=e;var n=0,r=[];e.forEach((function(t){var e=t.value;if(Ae(e)||Array.isArray(e)||e instanceof Float32Array){var i=Ae(e)?[e]:e,o=i.length>4?4:i.length,a=4-n%4;if(4!==a)if(a>=o);else{n+=a;for(var s=0;s<a;s++)r.push(0)}n+=i.length,r.push.apply(r,f([],u(i),!1))}}));var i=4-r.length%4;if(4!==i)for(var o=0;o<i;o++)r.push(0);for(var a=this.allocateUniformBuffer(t,r.length),s=this.mapUniformBufferF32(t),c=0;c<r.length;c+=4)a+=fP(s,a,r[c],r[c+1],r[c+2],r[c+3])}},t.prototype.setUniformBuffer=function(t){this.uniformBuffer=t},t.prototype.allocateUniformBuffer=function(t,e){return IO(this.bindingDescriptors[0].bindingLayout.numUniformBuffers<this.dynamicUniformBufferByteOffsets.length),this.dynamicUniformBufferByteOffsets[t]=this.uniformBuffer.allocateChunk(e)<<2,this.bindingDescriptors[0].uniformBufferBindings[t].wordCount=e,this.getUniformBufferOffset(t)},t.prototype.getUniformBufferOffset=function(t){return this.dynamicUniformBufferByteOffsets[t]>>>2},t.prototype.setUniformBufferOffset=function(t,e,n){this.dynamicUniformBufferByteOffsets[t]=e<<2,this.bindingDescriptors[0].uniformBufferBindings[t].wordCount=n},t.prototype.mapUniformBufferF32=function(t){return this.uniformBuffer.mapBufferF32()},t.prototype.getUniformBuffer=function(){return this.uniformBuffer},t.prototype.setSamplerBindingsFromTextureMappings=function(t){t=t.filter((function(t){return t}));for(var e=0;e<this.bindingDescriptors[0].samplerBindings.length;e++){var n=this.bindingDescriptors[0].samplerBindings[e],r=t[e];null!=r?(n.texture=r.texture,n.sampler=r.sampler):(n.texture=null,n.sampler=null)}},t.prototype.setAllowSkippingIfPipelineNotReady=function(t){this.flags=zO(this.flags,oP.AllowSkippingIfPipelineNotReady,t)},t.prototype.setAttachmentFormatsFromRenderPass=function(t,e){for(var n=t.queryRenderPass(e),r=-1,i=0;i<n.colorAttachment.length;i++){var o=null!==n.colorAttachment[i]?t.queryRenderTarget(n.colorAttachment[i]):null;this.renderPipelineDescriptor.colorAttachmentFormats[i]=null!==o?o.pixelFormat:null,null!==o&&(-1===r?r=o.sampleCount:IO(r===o.sampleCount))}var a=null!==n.depthStencilAttachment?t.queryRenderTarget(n.depthStencilAttachment):null;this.renderPipelineDescriptor.depthStencilAttachmentFormat=null!==a?a.pixelFormat:null,null!==a&&(-1===r?r=a.sampleCount:IO(r==a.sampleCount)),IO(r>0),this.renderPipelineDescriptor.sampleCount=r},t.prototype.drawOnPass=function(t,e){var n=this,r=t.device;this.setAttachmentFormatsFromRenderPass(r,e);var o=t.createRenderPipeline(this.renderPipelineDescriptor);if(!r.pipelineQueryReady(o)){if(this.flags&oP.AllowSkippingIfPipelineNotReady)return!1;r.pipelineForceReady(o)}e.setPipeline(o),e.setVertexInput(this.renderPipelineDescriptor.inputLayout,this.vertexBuffers,this.indexBuffer);for(var a=0;a<this.bindingDescriptors[0].uniformBufferBindings.length;a++)this.bindingDescriptors[0].uniformBufferBindings[a].buffer=kO(this.uniformBuffer.buffer);this.renderPipelineDescriptor.program.gl_program&&this.uniforms.forEach((function(t){var e={};t.forEach((function(t){var n=t.name,r=t.value;e[n]=r})),n.renderPipelineDescriptor.program.setUniformsLegacy(e)}));var s=t.createBindings(i(i({},this.bindingDescriptors[0]),{pipeline:o}));return e.setBindings(0,s,this.dynamicUniformBufferByteOffsets),this.flags&oP.Indexed?e.drawIndexed(this.drawCount,this.drawInstanceCount,this.drawStart,0,0):e.draw(this.drawCount,this.drawInstanceCount,this.drawStart,0),!0},t}();function pP(t,e){return t.sortKey-e.sortKey}!function(t){t[t.Forwards=0]="Forwards",t[t.Backwards=1]="Backwards"}(dP||(dP={}));var gP=function(){function t(t,e){void 0===t&&(t=pP),void 0===e&&(e=dP.Forwards),this.renderInsts=[],this.usePostSort=!1,this.compareFunction=t,this.executionOrder=e}return t.prototype.checkUsePostSort=function(){this.usePostSort=null!==this.compareFunction&&this.renderInsts.length>=500},t.prototype.insertSorted=function(t){var e,n,r,i;null===this.compareFunction||this.usePostSort?this.renderInsts.push(t):(e=this.renderInsts,n=t,r=this.compareFunction,i=function(t,e,n){for(var r=0,i=t.length;r<i;){var o=r+(i-r>>>1);n(e,t[o])<0?i=o:r=o+1}return r}(e,n,r),e.splice(i,0,n)),this.checkUsePostSort()},t.prototype.submitRenderInst=function(t){t.flags|=oP.Draw,this.insertSorted(t)},t.prototype.ensureSorted=function(){this.usePostSort&&(0!==this.renderInsts.length&&this.renderInsts.sort(this.compareFunction),this.usePostSort=!1)},t.prototype.drawOnPassRendererNoReset=function(t,e){if(this.ensureSorted(),this.executionOrder===dP.Forwards)for(var n=0;n<this.renderInsts.length;n++)this.renderInsts[n].drawOnPass(t,e);else for(n=this.renderInsts.length-1;n>=0;n--)this.renderInsts[n].drawOnPass(t,e)},t.prototype.reset=function(){this.renderInsts.length=0},t.prototype.drawOnPassRenderer=function(t,e){this.drawOnPassRendererNoReset(t,e),this.reset()},t}(),mP=function(){function t(){this.pool=[],this.allocCount=0}return t.prototype.allocRenderInstIndex=function(){return this.allocCount++,this.allocCount>this.pool.length&&this.pool.push(new hP),this.allocCount-1},t.prototype.popRenderInst=function(){this.allocCount--},t.prototype.reset=function(){for(var t=0;t<this.pool.length;t++)this.pool[t].reset();this.allocCount=0},t.prototype.destroy=function(){this.pool.length=0,this.allocCount=0},t}(),vP=function(){function t(t){this.renderCache=t,this.instPool=new mP,this.templatePool=new mP,this.simpleRenderInstList=new gP,this.currentRenderInstList=this.simpleRenderInstList}return t.prototype.newRenderInst=function(){var t=this.templatePool.allocCount-1,e=this.instPool.allocRenderInstIndex(),n=this.instPool.pool[e];return n.debug=null,t>=0&&n.setFromTemplate(this.templatePool.pool[t]),n},t.prototype.submitRenderInst=function(t,e){void 0===e&&(e=this.currentRenderInstList),e.submitRenderInst(t)},t.prototype.setCurrentRenderInstList=function(t){IO(null===this.simpleRenderInstList),this.currentRenderInstList=t},t.prototype.pushTemplateRenderInst=function(){var t=this.templatePool.allocCount-1,e=this.templatePool.allocRenderInstIndex(),n=this.templatePool.pool[e];return t>=0&&n.setFromTemplate(this.templatePool.pool[t]),n.flags|=oP.Template,n},t.prototype.popTemplateRenderInst=function(){this.templatePool.popRenderInst()},t.prototype.getTemplateRenderInst=function(){var t=this.templatePool.allocCount-1;return this.templatePool.pool[t]},t.prototype.resetRenderInsts=function(){this.instPool.reset(),null!==this.simpleRenderInstList&&this.simpleRenderInstList.reset(),IO(0===this.templatePool.allocCount)},t.prototype.destroy=function(){this.instPool.destroy(),this.renderCache.destroy()},t.prototype.disableSimpleMode=function(){this.simpleRenderInstList=null},t.prototype.drawOnPassRenderer=function(t){kO(this.simpleRenderInstList).drawOnPassRenderer(this.renderCache,t)},t.prototype.drawOnPassRendererNoReset=function(t){kO(this.simpleRenderInstList).drawOnPassRendererNoReset(this.renderCache,t)},t}(),yP=function(){function t(t){this.parameters=t}return t.prototype.getDevice=function(){return this.device},t.prototype.setDevice=function(t){this.device=t,this.renderCache=new rP(t),this.renderGraph=new uP(this.device),this.renderInstManager=new vP(this.renderCache),this.uniformBuffer=new BR(this.device)},t.prototype.pushTemplateRenderInst=function(){var t=this.renderInstManager.pushTemplateRenderInst();return t.setUniformBuffer(this.uniformBuffer),t},t.prototype.prepareToRender=function(){this.uniformBuffer.prepareToRender()},t.prototype.destroy=function(){this.uniformBuffer&&this.uniformBuffer.destroy(),this.renderInstManager&&this.renderInstManager.destroy(),this.renderCache&&this.renderCache.destroy(),this.renderGraph&&this.renderGraph.destroy()},t.prototype.getCache=function(){return this.renderCache},t.prototype.getDefines=function(){var t,e,n;return{USE_TONEMAPPING:(null===(t=this.parameters)||void 0===t?void 0:t.toneMapping)&&(null===(e=this.parameters)||void 0===e?void 0:e.toneMapping)!==eP.NONE,toneMapping:null===(n=this.parameters)||void 0===n?void 0:n.toneMapping}},t}(),_P=function(){function t(t){this.pixelFormat=t,this.width=0,this.height=0,this.sampleCount=0,this.colorClearColor="load",this.depthClearValue="load",this.stencilClearValue="load"}return t.prototype.setDimensions=function(t,e,n){this.width=t,this.height=e,this.sampleCount=n},t.prototype.copyDimensions=function(t){this.width=t.width,this.height=t.height,this.sampleCount=t.sampleCount},t}();function bP(t){return{colorClearColor:t,depthClearValue:1,stencilClearValue:0}}bP(DO(.88,.88,.88,1));var EP,xP=bP(UO);function MP(t,e){var n=function(t){return t.antialiasingMode===EP.MSAAx4?4:1}(e);t.setDimensions(e.backbufferWidth,e.backbufferHeight,n)}function SP(t,e,n){var r=function(t){if(t===nP.Color0)return SO.U8_RGBA_RT;if(t===nP.DepthStencil)return SO.D24_S8;throw new Error("whoops")}(t),i=new _P(r);return MP(i,e),null!==n&&(i.colorClearColor=n.colorClearColor,i.depthClearValue=n.depthClearValue,i.stencilClearValue=n.stencilClearValue),i}!function(t){t[t.None=0]="None",t[t.FXAA=1]="FXAA",t[t.MSAAx4=2]="MSAAx4"}(EP||(EP={}));var AP,TP=function(){function t(){this.texture=null,this.sampler=null,this.width=0,this.height=0,this.lodBias=0}return t.prototype.reset=function(){this.texture=null,this.sampler=null,this.width=0,this.height=0,this.lodBias=0},t.prototype.copy=function(t){this.texture=t.texture,this.sampler=t.sampler,this.width=t.width,this.height=t.height,this.lodBias=t.lodBias},t}(),OP=function(t){function e(n){void 0===n&&(n={});var r=n.style,a=o(n,["style"]);return t.call(this,i({type:e.tag,style:i({intensity:Math.PI},r)},a))||this}return r(e,t),e.tag="light",e}(Es);!function(t){t[t.NONE=0]="NONE",t[t.EXP=1]="EXP",t[t.EXP2=2]="EXP2",t[t.LINEAR=3]="LINEAR"}(AP||(AP={}));var RP,PP=function(t){function e(n){void 0===n&&(n={});var r=n.style,a=o(n,["style"]);return t.call(this,i({type:e.tag,style:i({type:AP.NONE,fill:"black",start:1,end:1e3,density:0},r)},a))||this}return r(e,t),e.tag="fog",e}(Es);function CP(t,e,n,r){void 0===r&&(r=uO.STATIC);var i=t.createBuffer({viewOrSize:n.byteLength,usage:e,hint:r});return i.setSubData(0,new Uint8Array(n)),i}!function(t){t.CHANGED="changed"}(RP||(RP={}));var wP,NP,IP=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this)||this;return r.device=e,r.props=n,r.drawMode=cO.TRIANGLES,r.vertexBuffers=[],r.vertices=[],r.inputLayoutDescriptor={vertexBufferDescriptors:[],vertexAttributeDescriptors:[],indexBufferFormat:null,program:null},r.vertexCount=0,r.instancedCount=0,r.indexStart=0,r.primitiveStart=0,r.dirty=!0,r.meshes=[],r}return r(e,t),e.prototype.validate=function(t){return!0},e.prototype.build=function(t){},e.prototype.computeBoundingBox=function(){return new mr},e.prototype.setIndexBuffer=function(t){return this.indexBuffer&&this.indexBuffer.destroy(),this.indexBuffer=CP(this.device,lO.INDEX,new Uint32Array(ArrayBuffer.isView(t)?t.buffer:t).buffer),this.indices=t,this.inputLayoutDescriptor.indexBufferFormat=SO.U32_R,this},e.prototype.setVertexBuffer=function(t){var e=this,n=t.bufferIndex,r=t.byteStride,i=t.stepMode,o=t.attributes,a=t.data;this.inputLayoutDescriptor.vertexBufferDescriptors[n]={byteStride:r,stepMode:i},this.vertices[n]=a,o.forEach((function(t){var r=t.format,i=t.bufferByteOffset,o=t.location,a=t.divisor;t.byteStride;var s=e.inputLayoutDescriptor.vertexAttributeDescriptors.find((function(t){return t.bufferIndex===n&&t.location===o}));s?(s.format=r,s.bufferByteOffset=i,s.divisor=a):e.inputLayoutDescriptor.vertexAttributeDescriptors.push({format:r,bufferIndex:n,bufferByteOffset:i,location:o,divisor:a})})),this.vertexBuffers[n]&&this.vertexBuffers[n].destroy();var s=CP(this.device,lO.VERTEX,a.buffer,uO.DYNAMIC);return this.vertexBuffers[n]=s,this},e.prototype.getVertexBuffer=function(t){return this.vertexBuffers[t]},e.prototype.updateVertexBuffer=function(t,e,n,r){var i=this.inputLayoutDescriptor.vertexBufferDescriptors[t].byteStride,o=this.inputLayoutDescriptor.vertexAttributeDescriptors.find((function(t){return t.location===e}));if(o){var a=n*i;this.getVertexBuffer(t).setSubData(o.bufferByteOffset+a,r)}this.emit(RP.CHANGED)},e.prototype.updateIndices=function(t,e){return void 0===e&&(e=0),this.indexBuffer&&this.indexBuffer.setSubData(e,new Uint8Array(ArrayBuffer.isView(t)?t:new Uint32Array(t))),this},e.prototype.destroy=function(){this.vertexBuffers.forEach((function(t){t&&t.destroy()})),this.indexBuffer&&this.indexBuffer.destroy(),this.inputLayoutDescriptor.vertexAttributeDescriptors=[],this.inputLayoutDescriptor.vertexBufferDescriptors=[],this.indexBuffer=void 0,this.vertexBuffers=[],this.indices=void 0,this.vertices=[],this.vertexCount=0,this.instancedCount=0},e}(p),kP="#define GLSLIFY 1\nlayout(location = 0) in vec2 a_Position;\n\nout vec2 v_TexCoord;\n\nvoid main() {\n v_TexCoord = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n\n #ifdef VIEWPORT_ORIGIN_TL\n v_TexCoord.y = 1.0 - v_TexCoord.y;\n #endif\n}",LP=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.features={},e.both="\nlayout(std140) uniform ub_Params {\n vec4 u_Misc[1];\n};\n#define u_InvResolution (u_Misc[0].xy)\n",e.vert=kP,e.frag="#define GLSLIFY 1\nuniform sampler2D u_Texture;\nin vec2 v_TexCoord;\n\nout vec4 outputColor;\n\nfloat MonochromeNTSC(vec3 t_Color) {\n // NTSC primaries.\n return dot(t_Color.rgb, vec3(0.299, 0.587, 0.114));\n}\n\nvec4 FXAA(PD_SAMPLER_2D(t_Texture), in vec2 t_PixelCenter, in vec2 t_InvResolution) {\n // FXAA v2, based on implementations:\n // http://www.geeks3d.com/20110405/fxaa-fast-approximate-anti-aliasing-demo-glsl-opengl-test-radeon-geforce/\n // https://github.com/mitsuhiko/webgl-meincraft\n\n float lumaMM = MonochromeNTSC(texture(PU_SAMPLER_2D(t_Texture), t_PixelCenter.xy).rgb);\n\n #if 1\n vec2 t_PixelTopLeft = t_PixelCenter.xy - t_InvResolution.xy * 0.5;\n float lumaNW = MonochromeNTSC(texture(PU_SAMPLER_2D(t_Texture), t_PixelTopLeft.xy) .rgb);\n float lumaNE = MonochromeNTSC(texture(PU_SAMPLER_2D(t_Texture), t_PixelTopLeft.xy + vec2(1.0, 0.0)).rgb);\n float lumaSW = MonochromeNTSC(texture(PU_SAMPLER_2D(t_Texture), t_PixelTopLeft.xy + vec2(0.0, 1.0)).rgb);\n float lumaSE = MonochromeNTSC(texture(PU_SAMPLER_2D(t_Texture), t_PixelTopLeft.xy + vec2(1.0, 1.0)).rgb);\n #else\n // We're at the pixel center -- pixel edges are 0.5 units away.\n // NOTE(jstpierre): mitsuhiko's port seems to get this wrong?\n vec2 t_PixelSize = t_InvResolution.xy * 0.5;\n\n float lumaNW = MonochromeNTSC(texture(PU_SAMPLER_2D(t_Texture), t_PixelCenter.xy + t_PixelSize * vec2(-1.0, -1.0)).rgb);\n float lumaNE = MonochromeNTSC(texture(PU_SAMPLER_2D(t_Texture), t_PixelCenter.xy + t_PixelSize * vec2( 1.0, -1.0)).rgb);\n float lumaSW = MonochromeNTSC(texture(PU_SAMPLER_2D(t_Texture), t_PixelCenter.xy + t_PixelSize * vec2(-1.0, 1.0)).rgb);\n float lumaSE = MonochromeNTSC(texture(PU_SAMPLER_2D(t_Texture), t_PixelCenter.xy + t_PixelSize * vec2( 1.0, 1.0)).rgb);\n #endif\n\n vec2 dir; \n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n const float FXAA_REDUCE_MIN = 1.0/128.0;\n const float FXAA_REDUCE_MUL = 1.0/8.0;\n const float FXAA_SPAN_MAX = 8.0;\n\n float dirReduce = max(\n (lumaNW + lumaNE + lumaSW + lumaSE) * (0.25 * FXAA_REDUCE_MUL),\n FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0/(min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX), max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX), dir * rcpDirMin)) * u_InvResolution.xy;\n\n float lumaMin = min(lumaMM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaMM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n vec4 rgbA = (1.0/2.0) * (\n texture(PU_SAMPLER_2D(t_Texture), t_PixelCenter.xy + dir * (1.0/3.0 - 0.5)) +\n texture(PU_SAMPLER_2D(t_Texture), t_PixelCenter.xy + dir * (2.0/3.0 - 0.5)));\n vec4 rgbB = rgbA * (1.0/2.0) + (1.0/4.0) * (\n texture(PU_SAMPLER_2D(t_Texture), t_PixelCenter.xy + dir * (0.0/3.0 - 0.5)) +\n texture(PU_SAMPLER_2D(t_Texture), t_PixelCenter.xy + dir * (3.0/3.0 - 0.5)));\n float lumaB = MonochromeNTSC(rgbB.rgb);\n\n vec4 rgbOutput = ((lumaB < lumaMin) || (lumaB > lumaMax)) ? rgbA : rgbB;\n return rgbOutput;\n}\n\nvoid main() {\n outputColor = FXAA(PP_SAMPLER_2D(u_Texture), v_TexCoord.xy, u_InvResolution.xy);\n}",e}return r(e,t),e}(DR),DP=VO(1,(function(){return new TP}));var BP;!function(t){t.PROJECTION_MATRIX="u_ProjectionMatrix",t.VIEW_MATRIX="u_ViewMatrix",t.CAMERA_POSITION="u_CameraPosition",t.DEVICE_PIXEL_RATIO="u_DevicePixelRatio",t.VIEWPORT="u_Viewport",t.IS_ORTHO="u_IsOrtho",t.IS_PICKING="u_IsPicking"}(BP||(BP={}));var FP,UP=function(){function t(t,e,n,r,i){this.renderHelper=t,this.lightPool=e,this.texturePool=n,this.batchManager=r,this.options=i,this.renderLists={world:new gP,picking:new gP}}return t.prototype.getDevice=function(){return this.device},t.prototype.getSwapChain=function(){return this.swapChain},t.prototype.getRenderLists=function(){return this.renderLists},t.prototype.apply=function(e){var n=this;this.context=e;var r=e.renderingService,o=e.renderingContext.root.ownerDocument.defaultView,a=function(t){var e=t.target;e.nodeName!==OP.tag?e.nodeName!==PP.tag?(e.renderable3D||(e.renderable3D=new TO),n.batchManager.add(e)):n.lightPool.addFog(e):n.lightPool.addLight(e)},l=function(t){var e,r,i=t.target;if(i.nodeName!==OP.tag)if(i.nodeName!==PP.tag){if(i.nodeName===Yn.MESH){var o;if(null===(e=i.style.geometry)||void 0===e?void 0:e.meshes)(o=i.style.geometry.meshes.indexOf(i))>-1&&i.style.geometry.meshes.splice(o,1);if(null===(r=i.style.material)||void 0===r?void 0:r.meshes)(o=i.style.material.meshes.indexOf(i))>-1&&i.style.material.meshes.splice(o,1)}n.swapChain&&n.batchManager.remove(i),delete i.renderable3D}else n.lightPool.removeFog(i);else n.lightPool.removeLight(i)},u=function(t){if(n.swapChain){var e=t.target,r=t.attrName,i=t.newValue;"zIndex"===r?e.parentNode.forEach((function(t){n.batchManager.changeRenderOrder(t,t.sortable.renderOrder)})):n.batchManager.updateAttribute(e,r,i)}},f=function(t){if(n.swapChain){var e=t.target;n.batchManager.updateAttribute(e,"modelMatrix",null)}};r.hooks.initAsync.tapPromise(t.tag,(function(){return s(n,void 0,void 0,(function(){var t,n,r,s,d,h=this;return c(this,(function(c){switch(c.label){case 0:return o.addEventListener(Xa.MOUNTED,a),o.addEventListener(Xa.UNMOUNTED,l),o.addEventListener(Xa.ATTR_MODIFIED,u),o.addEventListener(Xa.BOUNDS_CHANGED,f),this.context.config.renderer.getConfig().enableDirtyRectangleRendering=!1,t=this.context.contextService.getDomElement(),d=this.context.config,n=d.width,r=d.height,this.context.contextService.resize(n,r),s=this,[4,this.context.deviceContribution.createSwapChain(t)];case 1:return s.swapChain=c.sent(),this.device=this.swapChain.getDevice(),this.renderHelper.setDevice(this.device),this.renderHelper.renderInstManager.disableSimpleMode(),this.swapChain.configureSwapChain(t.width,t.height),o.addEventListener(ps.RESIZE,(function(){h.swapChain.configureSwapChain(t.width,t.height)})),this.batchManager.attach(i({device:this.device},e)),[2]}}))}))})),r.hooks.destroy.tap(t.tag,(function(){n.renderHelper.destroy(),n.batchManager.destroy(),n.texturePool.destroy(),o.removeEventListener(Xa.MOUNTED,a),o.removeEventListener(Xa.UNMOUNTED,l),o.removeEventListener(Xa.ATTR_MODIFIED,u),o.removeEventListener(Xa.BOUNDS_CHANGED,f),n.device.destroy(),n.device.checkForLeaks()})),r.hooks.beginFrame.tap(t.tag,(function(){var t,e,r=n.swapChain.getCanvas(),i=n.renderHelper.renderInstManager;if(n.builder=n.renderHelper.renderGraph.newGraphBuilder(),"transparent"===n.context.config.background)e=BO;else{var o=Ri(n.context.config.background);e=n.context.config.background?DO(Number(o.r)/255*Number(o.alpha),Number(o.g)/255*Number(o.alpha),Number(o.b)/255*Number(o.alpha),Number(o.alpha)):FO}var a={backbufferWidth:r.width,backbufferHeight:r.height,antialiasingMode:EP.None},s=SP(nP.Color0,a,bP(e)),c=SP(nP.DepthStencil,a,xP),l=n.builder.createRenderTargetID(s,"Main Color"),u=n.builder.createRenderTargetID(c,"Main Depth");n.builder.pushPass((function(t){t.setDebugName("Main Render Pass"),t.attachRenderTargetID(nP.Color0,l),t.attachRenderTargetID(nP.DepthStencil,u),t.exec((function(t){n.renderLists.world.drawOnPassRenderer(i.renderCache,t)}))})),(null===(t=n.options)||void 0===t?void 0:t.enableFXAA)&&function(t,e,n,r){t.pushPass((function(i){i.setDebugName("FXAA"),i.attachRenderTargetID(nP.Color0,r);var o=t.resolveRenderTarget(r);i.attachResolveTexture(o);var a=e.renderInstManager.newRenderInst();a.setUniformBuffer(e.uniformBuffer),a.setAllowSkippingIfPipelineNotReady(!1),a.setMegaStateFlags(JO),a.setBindingLayouts([{numUniformBuffers:1,numSamplers:1}]),a.drawPrimitives(3);var s=a.allocateUniformBuffer(0,4);fP(a.mapUniformBufferF32(0),s,1/n.backbufferWidth,1/n.backbufferHeight);var c=new LP,l=e.renderCache.createProgramSimple(c);a.setProgram(l),wP||((wP=new IP(e.getDevice())).setVertexBuffer({bufferIndex:0,byteStride:8,stepMode:fO.VERTEX,attributes:[{format:SO.F32_RG,bufferByteOffset:0,location:0}],data:new Float32Array([1,3,-3,-1,1,-1])}),wP.vertexCount=3,NP=e.getCache().createInputLayout(wP.inputLayoutDescriptor)),i.exec((function(t,n){DP[0].texture=n.getResolveTextureForID(o),a.setSamplerBindingsFromTextureMappings(DP),a.setVertexInput(NP,wP.vertexBuffers.map((function(t){return{buffer:t,byteOffset:0}})),null),a.drawOnPass(e.renderCache,t)}))}))}(n.builder,n.renderHelper,a,l),n.builder.resolveRenderTargetToExternalTexture(l,n.swapChain.getOnscreenTexture())})),r.hooks.endFrame.tap(t.tag,(function(){var t,e,r=n.renderHelper.renderInstManager,i=n.renderHelper.pushTemplateRenderInst();i.setBindingLayouts([{numUniformBuffers:2,numSamplers:0}]),i.setMegaStateFlags(tR({depthWrite:!0,blendConstant:BO},{rgbBlendMode:iO.ADD,alphaBlendMode:iO.ADD,rgbBlendSrcFactor:rO.SRC_ALPHA,alphaBlendSrcFactor:rO.ONE,rgbBlendDstFactor:rO.ONE_MINUS_SRC_ALPHA,alphaBlendDstFactor:rO.ONE_MINUS_SRC_ALPHA}));var o=(t=n.context.config).width,a=t.height,s=n.context.camera;if(i.setUniforms(0,[{name:BP.PROJECTION_MATRIX,value:s.getPerspective()},{name:BP.VIEW_MATRIX,value:s.getViewTransform()},{name:BP.CAMERA_POSITION,value:s.getPosition()},{name:BP.DEVICE_PIXEL_RATIO,value:n.context.contextService.getDPR()},{name:BP.VIEWPORT,value:[o,a]},{name:BP.IS_ORTHO,value:s.isOrtho()?1:0},{name:BP.IS_PICKING,value:0}]),n.batchManager.render(n.renderLists.world),r.popTemplateRenderInst(),n.renderHelper.prepareToRender(),n.renderHelper.renderGraph.execute(),r.resetRenderInsts(),n.enableCapture&&n.resolveCapturePromise){var c=(e=n.captureOptions).type,l=e.encoderOptions,u=n.context.contextService.getDomElement().toDataURL(c,l);n.resolveCapturePromise(u),n.enableCapture=!1,n.captureOptions=void 0,n.resolveCapturePromise=void 0}}))},t.prototype.loadTexture=function(t,e,n){return this.texturePool.getOrCreateTexture(this.device,t,e,(function(t){n&&n(t)}))},t.prototype.toDataURL=function(t){return s(this,void 0,void 0,(function(){var e=this;return c(this,(function(n){return this.enableCapture=!0,this.captureOptions=t,this.capturePromise=new Promise((function(t){e.resolveCapturePromise=function(e){t(e)}})),[2,this.capturePromise]}))}))},t.tag="RenderGraph",t}(),jP=function(){function t(t,e,n,r){this.renderHelper=t,this.renderGraphPlugin=e,this.pickingIdGenerator=n,this.batchManager=r}return t.prototype.apply=function(e){var n=this;this.context=e;var r=e.renderingService,i=e.renderingContext.root.ownerDocument.defaultView,o=function(t){var e=t.target;e.renderable3D||(e.renderable3D=new TO);var r=e.renderable3D,i=n.pickingIdGenerator.getId(e);r.pickingId=i,r.encodedPickingColor=n.pickingIdGenerator.encodePickingColor(i)},a=function(t){var e=t.target.renderable3D;e&&n.pickingIdGenerator.deleteById(e.pickingId)};r.hooks.init.tap(t.tag,(function(){i.addEventListener(Xa.MOUNTED,o),i.addEventListener(Xa.UNMOUNTED,a)})),r.hooks.destroy.tap(t.tag,(function(){i.removeEventListener(Xa.MOUNTED,o),i.removeEventListener(Xa.UNMOUNTED,a),n.pickingIdGenerator.reset()})),r.hooks.pickSync.tap(t.tag,(function(t){return n.pick(t)})),r.hooks.pick.tapPromise(t.tag,(function(t){return s(n,void 0,void 0,(function(){return c(this,(function(e){return[2,this.pick(t)]}))}))}))},t.prototype.pick=function(t){var e=t.topmost,n=t.position,r=n.viewportX,i=n.viewportY,o=this.context.contextService.getDPR(),a=this.context.config.width*o,s=this.context.config.height*o,c=r*o,l=i*o;if(!this.renderHelper.renderGraph||c>a||c<0||l>s||l<0)return t.picked=[],t;var u=this.pickByRectangleInDepth(new Mr(Se(Math.round(c),0,a-1),Se(Math.round(l),0,s-1),1,1),e?1:100);return t.picked=u,t},t.prototype.pickByRectangleInDepth=function(t,e){void 0===e&&(e=100);var n=null,r=1,i=[];do{if(!(n=this.pickByRectangle(t,n)))break;r++,i.push(n)}while(n&&r<=e);return e>1&&this.restorePickingColor(i),i},t.prototype.restorePickingColor=function(t){var e=this;t.forEach((function(t){e.batchManager.updateAttribute(t,"pointerEvents",!0,!0)}))},t.prototype.pickByRectangle=function(t,e){var n,r,o=this,a=this.renderGraphPlugin.getDevice(),s=this.renderGraphPlugin.getRenderLists(),c=this.renderHelper.renderInstManager,l=this.renderHelper.renderGraph.newGraphBuilder(),u=BO,f=this.context.camera,d=t.x,h=t.y,p=t.width,g=t.height,m={backbufferWidth:p,backbufferHeight:g,antialiasingMode:EP.None},v=SP(nP.Color0,m,bP(u)),y=l.createRenderTargetID(v,"Picking Color"),_=SP(nP.DepthStencil,m,xP),b=l.createRenderTargetID(_,"Picking Depth"),E=i({},f.getView());this.renderHelper.renderGraph.renderTargetDeadPool.forEach((function(t){t.age=-1})),l.pushPass((function(t){t.setDebugName("Picking Pass"),t.attachRenderTargetID(nP.Color0,y),t.attachRenderTargetID(nP.DepthStencil,b),t.exec((function(t){s.picking.drawOnPassRenderer(c.renderCache,t)})),t.post((function(t){var e=t.getRenderTargetTexture(nP.Color0),n=a.createReadback();E&&E.enabled?f.setViewOffset(E.fullWidth,E.fullHeight,E.offsetX,E.offsetY,E.width,E.height):f.clearViewOffset(),f.setEnableUpdate(!0);var i=n.readTextureSync(e,0,0,p,g,new Uint8Array(p*g*4)),s=-1;if(!i||0===i[0]&&0===i[1]&&0===i[2]||(s=o.pickingIdGenerator.decodePickingColor(i)),s>-1){var c=o.pickingIdGenerator.getById(s);c&&c.isVisible()&&c.isInteractive()&&(r=c)}n.destroy()}))}));var x=this.renderHelper.pushTemplateRenderInst();x.setBindingLayouts([{numUniformBuffers:2,numSamplers:0}]),x.setMegaStateFlags(tR({depthWrite:!0},{rgbBlendMode:iO.ADD,rgbBlendSrcFactor:rO.ONE,rgbBlendDstFactor:rO.ZERO,alphaBlendMode:iO.ADD,alphaBlendSrcFactor:rO.ONE,alphaBlendDstFactor:rO.ZERO}));var M=(n=this.context.config).width,S=n.height,A=this.context.contextService.getDPR();return f.setEnableUpdate(!1),f.setViewOffset(M*A,S*A,d,h,p,g),x.setUniforms(0,[{name:BP.PROJECTION_MATRIX,value:f.getPerspective()},{name:BP.VIEW_MATRIX,value:f.getViewTransform()},{name:BP.CAMERA_POSITION,value:f.getPosition()},{name:BP.DEVICE_PIXEL_RATIO,value:this.context.contextService.getDPR()},{name:BP.VIEWPORT,value:[M,S]},{name:BP.IS_ORTHO,value:f.isOrtho()?1:0},{name:BP.IS_PICKING,value:1}]),e&&this.batchManager.updateAttribute(e,"pointerEvents",!1,!0),this.batchManager.render(s.picking,!0),c.popTemplateRenderInst(),this.renderHelper.prepareToRender(),this.renderHelper.renderGraph.execute(),c.resetRenderInsts(),r},t.tag="WebGLPicker",t}(),GP=.005,WP=function(){function t(){this.clipPathMeshCreated=!1}return t.prototype.beforeUploadUBO=function(t,e){},t.prototype.beforeInitMesh=function(t){},t.prototype.afterInitMesh=function(t){},t}();!function(t){t.CHANGED="changed"}(FP||(FP={}));var zP=function(t){function e(e,n){var r=t.call(this)||this;r.props={},r.meshes=[],r.defines={},r.uniforms={},r.uboBuffer=[],r.textures={},r.samplers=[],r.programDirty=!0,r.textureDirty=!0,r.geometryDirty=!0;var o=qO(ZO),a=o.cullMode,s=o.depthCompare,c=o.depthWrite,l=o.stencilCompare,u=o.stencilWrite,f=o.stencilPassOp,d=o.frontFace,h=o.polygonOffset,p=o.attachmentsState;return r.device=e,r.props=i({cullMode:a,depthTest:!0,depthCompare:s,depthWrite:c,stencilCompare:l,stencilWrite:u,stencilPassOp:f,frontFace:d,polygonOffset:h,attachmentsState:p,dithering:!1,wireframe:!1,wireframeColor:"black",wireframeLineWidth:1,vertexShader:"",fragmentShader:""},n),r.compile(),r}return r(e,t),Object.defineProperty(e.prototype,"cullMode",{get:function(){return this.props.cullMode},set:function(t){this.props.cullMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frontFace",{get:function(){return this.props.frontFace},set:function(t){this.props.frontFace=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendConstant",{get:function(){return this.props.blendConstant},set:function(t){this.props.blendConstant=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendEquation",{get:function(){return this.props.blendEquation},set:function(t){this.props.blendEquation=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendEquationAlpha",{get:function(){return this.props.blendEquationAlpha},set:function(t){this.props.blendEquationAlpha=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendSrc",{get:function(){return this.props.blendSrc},set:function(t){this.props.blendSrc=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendDst",{get:function(){return this.props.blendDst},set:function(t){this.props.blendDst=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendSrcAlpha",{get:function(){return this.props.blendSrcAlpha},set:function(t){this.props.blendSrcAlpha=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendDstAlpha",{get:function(){return this.props.blendDstAlpha},set:function(t){this.props.blendDstAlpha=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthCompare",{get:function(){return this.props.depthCompare},set:function(t){this.props.depthCompare=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthTest",{get:function(){return this.props.depthTest},set:function(t){this.props.depthTest=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthWrite",{get:function(){return this.props.depthWrite},set:function(t){this.props.depthWrite=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilCompare",{get:function(){return this.props.stencilCompare},set:function(t){this.props.stencilCompare=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilWrite",{get:function(){return this.props.stencilWrite},set:function(t){this.props.stencilWrite=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilPassOp",{get:function(){return this.props.stencilPassOp},set:function(t){this.props.stencilPassOp=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stencilRef",{get:function(){return this.props.stencilRef},set:function(t){this.props.stencilRef=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"polygonOffset",{get:function(){return this.props.polygonOffset},set:function(t){this.props.polygonOffset=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dithering",{get:function(){return this.props.dithering},set:function(t){this.props.dithering=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wireframe",{get:function(){return this.props.wireframe},set:function(t){this.props.wireframe!==t&&(this.geometryDirty=!0,this.programDirty=!0,this.props.wireframe=t,this.dispatchMutationEvent()),this.defines.USE_WIREFRAME=!!t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wireframeColor",{get:function(){return this.props.wireframeColor},set:function(t){this.props.wireframeColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wireframeLineWidth",{get:function(){return this.props.wireframeLineWidth},set:function(t){this.props.wireframeLineWidth=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"vertexShader",{get:function(){return this.props.vertexShader},set:function(t){this.props.vertexShader!==t&&(this.programDirty=!0,this.props.vertexShader=t,this.compile())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fragmentShader",{get:function(){return this.props.fragmentShader},set:function(t){this.props.fragmentShader!==t&&(this.programDirty=!0,this.props.fragmentShader=t,this.compile())},enumerable:!1,configurable:!0}),e.prototype.compile=function(){var t=this;this.props.fragmentShader.replace(/^\s*uniform\s*sampler2D\s*(.*)\s*;$/gm,(function(e,n){return t.samplers.push(n),""})),this.uniformNames=function(t){var e=[],n=[];return t.replace(/\s*struct\s*(.*)\s*{((?:\s*.*\s*)*?)};/g,(function(t,e,r){var i=[];return r.trim().split("\n").forEach((function(t){var e=u(t.trim().split(/\s+/),2),n=e[0],r=e[1];i.push({type:n.trim(),name:r.replace(";","").trim()})})),n.push({type:e.trim(),uniforms:i}),""})),t.replace(/\s*uniform\s*.*\s*{((?:\s*.*\s*)*?)};/g,(function(t,r){return r.trim().split("\n").forEach((function(t){var r=t.trim().split(" "),i=r[0]||"",o=r[1]||"",a=o.indexOf("[")>-1;if(o=o.replace(";","").replace("[","").trim(),!i.startsWith("#")){if(i){var s=n.find((function(t){return i===t.type}));if(s)if(a)for(var c=function(t){s.uniforms.forEach((function(n){e.push("".concat(o,"[").concat(t,"].").concat(n.name))}))},l=0;l<5;l++)c(l);else s.uniforms.forEach((function(t){e.push("".concat(o,".").concat(t.name))}))}o&&e.push(o)}})),""})),e}(this.props.fragmentShader)},e.prototype.setUniforms=function(t){var e=this,n=!1;Object.keys(t).forEach((function(r){var i,o=t[r],a=e.textures[r];a&&a!==o&&(e.textureDirty=!0),(i=o)&&i.type?(e.textures[r]=o,e.textureDirty=!0,o.on(dO.LOADED,(function(){e.dispatchMutationEvent()}))):(e.uniforms[r]=o,n=!0),he(t[r])&&(delete e.textures[r],delete e.uniforms[r])})),n&&this.dispatchMutationEvent()},e.prototype.dispatchMutationEvent=function(){this.emit(FP.CHANGED)},e}(p),VP=function(t){function e(e,n){var r=t.call(this,e,i({},n))||this;return r.defines=i(i({},r.defines),{USE_UV:!1,USE_MAP:!1,USE_WIREFRAME:!1,USE_FOG:!1,USE_LIGHT:!1}),r}return r(e,t),e}(zP);function HP(t){var e={};return Object.keys(t).forEach((function(n){"number"==typeof t[n]&&(e[n]=t[n])})),e}var XP=function(t){return Object.fromEntries(Object.entries(t).filter((function(t){var e=u(t,2);return e[0],void 0!==e[1]})))};function YP(t,e){return 256*(t=Se(Math.floor(t),0,255))+(e=Se(Math.floor(e),0,255))}var $P,qP,KP=1,ZP="FillTextureMapping";!function(t){t[t.MODEL_MATRIX=0]="MODEL_MATRIX",t[t.PACKED_COLOR=1]="PACKED_COLOR",t[t.PACKED_STYLE=2]="PACKED_STYLE",t[t.PICKING_COLOR=3]="PICKING_COLOR",t[t.POSITION=4]="POSITION",t[t.NORMAL=5]="NORMAL",t[t.UV=6]="UV",t[t.BARYCENTRIC=7]="BARYCENTRIC",t[t.MAX=8]="MAX"}($P||($P={})),function(t){t[t.MODEL_MATRIX0=0]="MODEL_MATRIX0",t[t.MODEL_MATRIX1=1]="MODEL_MATRIX1",t[t.MODEL_MATRIX2=2]="MODEL_MATRIX2",t[t.MODEL_MATRIX3=3]="MODEL_MATRIX3",t[t.PACKED_COLOR=4]="PACKED_COLOR",t[t.PACKED_STYLE1=5]="PACKED_STYLE1",t[t.PACKED_STYLE2=6]="PACKED_STYLE2",t[t.PICKING_COLOR=7]="PICKING_COLOR",t[t.POSITION=8]="POSITION",t[t.NORMAL=9]="NORMAL",t[t.UV=10]="UV",t[t.BARYCENTRIC=11]="BARYCENTRIC",t[t.MAX=12]="MAX"}(qP||(qP={}));var QP,JP,tC=function(){function t(t,e,n,r,i,o,a){void 0===o&&(o=-1),this.renderHelper=t,this.texturePool=e,this.lightPool=n,this.drawcallCtors=i,this.index=o,this.context=a,this.id=KP++,this.gradientAttributeName="fill",this.objects=[],this.program=new DR,this.geometryDirty=!0,this.materialDirty=!0,this.textureMappings=[],this.divisor=1,this.mergeAnchorIntoModelMatrix=!1,this.checkNodeName=!0,this.maxInstances=1/0,this.inited=!1}return Object.defineProperty(t.prototype,"instance",{get:function(){return this.objects[0]},enumerable:!1,configurable:!0}),t.prototype.init=function(){this.inited||(this.renderer.beforeInitMesh(this),this.material=new VP(this.context.device),this.material.defines=i(i({},HP(qP)),this.material.defines),this.geometry=new IP(this.context.device),this.geometry.meshes=this.objects,this.material.meshes=this.objects,this.observeGeometryChanged(),this.observeMaterialChanged(),this.inited=!0,this.renderer.afterInitMesh(this))},t.prototype.observeGeometryChanged=function(){var t=this;this.geometry.on(RP.CHANGED,(function(){t.geometry.meshes.forEach((function(t){t.renderable.dirty=!0})),t.context.renderingService.dirtify()}))},t.prototype.observeMaterialChanged=function(){var t=this;this.material.on(FP.CHANGED,(function(){t.material.meshes.forEach((function(t){t.renderable.dirty=!0})),t.context.renderingService.dirtify()}))},t.prototype.shouldMergeColor=function(t,e,n){var r=t.parsedStyle[n],i=e.parsedStyle[n];return!(!Oi(r)||!Oi(i))||(!(!Ti(r)||!Ti(i)||r.image!==i.image)||!(!Array.isArray(r)||!Array.isArray(i)||t.style[n]!==e.style[n]))},t.prototype.shouldMerge=function(t,e){return!this.instance||(!this.checkNodeName||this.instance.nodeName===t.nodeName)&&(!t.parsedStyle.clipPath&&!(!this.shouldMergeColor(this.instance,t,"fill")||!this.shouldMergeColor(this.instance,t,"stroke")))},t.prototype.createGeometry=function(t){var e=this,n=_(),r=_(),i=[],o=[],a=[],s=[],c=this.divisor;t.forEach((function(t){var c,l=t.parsedStyle,d=l.fill,h=l.stroke,p=l.opacity,g=l.fillOpacity,m=l.strokeOpacity,v=l.lineWidth,y=l.anchor,_=l.visibility,b=l.increasedLineWidthForHitTesting,x=[0,0,0,0];Oi(d)&&(x=[Number(d.r),Number(d.g),Number(d.b),255*Number(d.alpha)]);var M=[0,0,0,0];Oi(h)&&(M=[Number(h.r),Number(h.g),Number(h.b),255*Number(h.alpha)]),$(r,e.context.camera.getViewTransform(),n);var S=t.isInteractive()&&(null===(c=t.renderable3D)||void 0===c?void 0:c.encodedPickingColor)||[0,0,0];if(e.mergeAnchorIntoModelMatrix){var A=t.parsedStyle.anchor,T=0,O=0,R=0,P=t.getGeometryBounds();if(P){var C=P.halfExtents;T=-C[0]*A[0]*2,O=-C[1]*A[1]*2,R=-C[2]*(A[2]||0)*2}$(n,t.getWorldTransform(),I(n,tt(T,O,R)))}else E(n,t.getWorldTransform());i.push.apply(i,f([],u(n),!1)),o.push(YP(x[0],x[1]),YP(x[2],x[3]),YP(M[0],M[1]),YP(M[2],M[3])),a.push(p,g,m,v,"visible"===_?1:0,y[0],y[1],b||0),s.push.apply(s,f(f([],u(S),!1),[t.sortable.renderOrder*GP],!1))})),this.geometry.instancedCount=t.length,this.geometry.setVertexBuffer({bufferIndex:$P.MODEL_MATRIX,byteStride:64,stepMode:fO.INSTANCE,attributes:[{format:SO.F32_RGBA,bufferByteOffset:0,location:qP.MODEL_MATRIX0,divisor:c},{format:SO.F32_RGBA,bufferByteOffset:16,location:qP.MODEL_MATRIX1,divisor:c},{format:SO.F32_RGBA,bufferByteOffset:32,location:qP.MODEL_MATRIX2,divisor:c},{format:SO.F32_RGBA,bufferByteOffset:48,location:qP.MODEL_MATRIX3,divisor:c}],data:new Float32Array(i)}),this.geometry.setVertexBuffer({bufferIndex:$P.PACKED_COLOR,byteStride:16,stepMode:fO.INSTANCE,attributes:[{format:SO.F32_RGBA,bufferByteOffset:0,location:qP.PACKED_COLOR,divisor:c}],data:new Float32Array(o)}),this.geometry.setVertexBuffer({bufferIndex:$P.PACKED_STYLE,byteStride:32,stepMode:fO.INSTANCE,attributes:[{format:SO.F32_RGBA,bufferByteOffset:0,location:qP.PACKED_STYLE1,divisor:c},{format:SO.F32_RGBA,bufferByteOffset:16,location:qP.PACKED_STYLE2,divisor:c}],data:new Float32Array(a)}),this.geometry.setVertexBuffer({bufferIndex:$P.PICKING_COLOR,byteStride:16,stepMode:fO.INSTANCE,attributes:[{format:SO.F32_RGBA,bufferByteOffset:0,location:qP.PICKING_COLOR,divisor:c}],data:new Float32Array(s)})},t.prototype.destroy=function(){this.geometry&&this.geometry.destroy()},t.prototype.applyRenderInst=function(t,e){var n=this,r=!!this.lightPool.getFog();this.clipPathTarget||this.clipPath?this.clipPathTarget?(this.material.stencilWrite=!0,this.material.depthWrite=!1,this.material.stencilCompare=tO.ALWAYS,this.material.stencilPassOp=mO.REPLACE):(this.material.stencilWrite=!1,this.material.depthWrite=!0,this.material.stencilCompare=tO.EQUAL,this.material.stencilPassOp=mO.KEEP):this.material.stencilWrite=!1,(this.materialDirty||this.material.programDirty)&&this.createMaterial(e);var o,a,s,c,l=i({},this.material.defines);if(this.material.defines.USE_FOG=r,this.material.defines=i(i(i({},this.lightPool.getDefines()),this.material.defines),this.renderHelper.getDefines()),this.material.textureDirty){this.textureMappings=[];var u=this.createFillGradientTextureMapping(e);u&&this.textureMappings.push(u),Object.keys(this.material.textures).sort((function(t,e){return n.material.samplers.indexOf(t)-n.material.samplers.indexOf(e)})).forEach((function(t){var e=new TP;e.name=t,e.texture=n.material.textures[t],n.context.device.setResourceName(e.texture,"Material Texture "+t),e.sampler=n.renderHelper.getCache().createSampler({wrapS:oO.CLAMP,wrapT:oO.CLAMP,minFilter:aO.POINT,magFilter:aO.BILINEAR,mipFilter:sO.LINEAR,minLOD:0,maxLOD:0}),n.textureMappings.push(e)})),this.textureMappings.length?(this.material.defines.USE_UV=!0,this.material.defines.USE_MAP=!0):(this.material.defines.USE_UV=!1,this.material.defines.USE_MAP=!1),this.material.textureDirty=!1}((o=l,a=this.material.defines,s=Object.keys(o),c=Object.keys(a),!(s.length===c.length&&s.every((function(t){return o[t]===a[t]}))))||this.material.programDirty||this.materialDirty)&&(this.material.defines=i(i({},this.material.defines),HP(qP)),Object.keys(this.material.defines).forEach((function(t){var e=n.material.defines[t];"boolean"==typeof e?n.program.setDefineBool(t,e):n.program.setDefineString(t,"".concat(e))})),this.program.vert=this.material.vertexShader,this.program.frag=this.material.fragmentShader,this.material.programDirty=!1,this.materialDirty=!1),this.material.geometryDirty&&(this.geometryDirty=!0,this.material.geometryDirty=!1),(this.geometryDirty||this.geometry.dirty)&&(this.geometry&&this.geometry.destroy(),this.createGeometry(e),this.material.wireframe&&this.generateWireframe(this.geometry),this.geometryDirty=!1,this.geometry.dirty=!1);var f,d=this.renderHelper.getCache().createProgramSimple(this.program),h=this.renderHelper.getCache().createInputLayout(i(i({},this.geometry.inputLayoutDescriptor),{program:d})),p=!!this.geometry.indexBuffer;t.renderPipelineDescriptor.topology=this.geometry.drawMode,t.setProgram(d),t.setVertexInput(h,this.geometry.vertexBuffers.map((function(t){return{buffer:t,byteOffset:0}})),p?{buffer:this.geometry.indexBuffer,byteOffset:0}:null),this.renderer.beforeUploadUBO(t,this),this.uploadUBO(t),p?t.drawIndexesInstanced(this.geometry.vertexCount,this.geometry.instancedCount,this.geometry.indexStart):t.drawPrimitives(this.geometry.vertexCount,this.geometry.primitiveStart),t.sortKey=(f=iP.OPAQUE,function(t,e){return(16777215&t|(255&e)<<24)>>>0}(function(t,e){return t>>>31&1?t:(4278190335&t|(65535&e)<<8)>>>0}(0,e[0].sortable.renderOrder),f))},t.prototype.updateBatchedAttribute=function(t,e,n,r){var i=this;if("fill"===n||"stroke"===n){var o=[];t.forEach((function(t){var e=t.parsedStyle,n=e.fill,r=e.stroke,i=[0,0,0,0];Oi(n)&&(i=[Number(n.r),Number(n.g),Number(n.b),255*Number(n.alpha)]);var a=[0,0,0,0];Oi(r)&&(a=[Number(r.r),Number(r.g),Number(r.b),255*Number(r.alpha)]),o.push(YP(i[0],i[1]),YP(i[2],i[3]),YP(a[0],a[1]),YP(a[2],a[3]))})),this.geometry.updateVertexBuffer($P.PACKED_COLOR,qP.PACKED_COLOR,e,new Uint8Array(new Float32Array(o).buffer));var a=this.instance.parsedStyle.fill,s=this.textureMappings.findIndex((function(t){return t.name===ZP}));if(Oi(a))s>=0&&(this.textureMappings.splice(s,-1),this.material.textureDirty=!0);else{var c=this.createFillGradientTextureMapping([this.instance]);s>=0&&this.textureMappings.splice(s,1,c),this.material.textureDirty=!0}}else if(["opacity","fillOpacity","strokeOpacity","lineWidth","visibility","anchor","increasedLineWidthForHitTesting"].indexOf(n)>-1){var l=[];t.forEach((function(t){var e=t.parsedStyle,n=e.opacity,r=e.fillOpacity,i=e.strokeOpacity,o=e.lineWidth,a=e.visibility,s=e.anchor,c=e.increasedLineWidthForHitTesting;l.push(n,r,i,o,"visible"===a?1:0,s[0],s[1],c||0)})),this.geometry.updateVertexBuffer($P.PACKED_STYLE,qP.PACKED_STYLE1,e,new Uint8Array(new Float32Array(l).buffer))}else if("modelMatrix"===n){var d=[],h=_();t.forEach((function(t){if(i.mergeAnchorIntoModelMatrix){var e=t.parsedStyle.anchor,n=0,r=0,o=0,a=t.getGeometryBounds();if(a){var s=a.halfExtents;n=-s[0]*e[0]*2,r=-s[1]*e[1]*2,o=-s[2]*(e[2]||0)*2}$(h,t.getWorldTransform(),I(h,tt(n,r,o)))}else E(h,t.getWorldTransform());d.push.apply(d,f([],u(h),!1))})),this.geometry.updateVertexBuffer($P.MODEL_MATRIX,qP.MODEL_MATRIX0,e,new Uint8Array(new Float32Array(d).buffer))}else if("pointerEvents"===n){var p=[];t.forEach((function(t){var e,n=r&&t.isInteractive()&&(null===(e=t.renderable3D)||void 0===e?void 0:e.encodedPickingColor)||[0,0,0];p.push.apply(p,f(f([],u(n),!1),[t.sortable.renderOrder*GP],!1))})),this.geometry.updateVertexBuffer($P.PICKING_COLOR,qP.PICKING_COLOR,e,new Uint8Array(new Float32Array(p).buffer))}},t.prototype.updateAttribute=function(t,e,n,r){"clipPath"===n&&this.clipPath&&(this.geometryDirty=!0)},t.prototype.changeRenderOrder=function(t,e){var n,r=this.objects.indexOf(t),i=t.isInteractive()&&(null===(n=t.renderable3D)||void 0===n?void 0:n.encodedPickingColor)||[0,0,0];this.geometry.updateVertexBuffer($P.PICKING_COLOR,qP.PICKING_COLOR,r,new Uint8Array(new Float32Array(f(f([],u(i),!1),[e*GP],!1)).buffer))},t.prototype.generateWireframe=function(t){for(var e=t.indices,n=t.indices.length,r=t.vertices.map((function(t){return t.slice()})),i=$P.PICKING_COLOR;i<t.vertexBuffers.length;i++){var o=t.inputLayoutDescriptor.vertexBufferDescriptors[i].byteStride;t.vertices[i]=new Float32Array(o/4*n)}var a=0,s=new Uint32Array(n);for(i=0;i<n;i++){for(var c=e[i],l=1;l<t.vertices.length;l++)for(var u=(o=t.inputLayoutDescriptor.vertexBufferDescriptors[l].byteStride)/4,f=0;f<u;f++)t.vertices[l][a*u+f]=r[l][c*u+f];s[i]=a,a++}var d=function(e){var n=t.inputLayoutDescriptor.vertexBufferDescriptors[e],r=n.stepMode,i=n.byteStride,o=t.inputLayoutDescriptor.vertexAttributeDescriptors.find((function(t){return t.bufferIndex===e}));if(o){var a=o.location,s=o.bufferIndex,c=o.bufferByteOffset,l=o.format,u=o.divisor;t.setVertexBuffer({bufferIndex:s,byteStride:i,stepMode:r,attributes:[{format:l,bufferByteOffset:c,location:a,divisor:u}],data:t.vertices[e]})}};for(i=$P.PICKING_COLOR+1;i<t.vertexBuffers.length;i++)d(i);var h=new Float32Array(3*n);for(i=0;i<n;)for(l=0;l<3;l++){h[3*(c=s[i++])+l]=1}t.setVertexBuffer({bufferIndex:$P.BARYCENTRIC,byteStride:12,stepMode:fO.VERTEX,attributes:[{format:SO.F32_RGB,bufferByteOffset:0,location:Number(qP.BARYCENTRIC)}],data:h}),t.setIndexBuffer(s)},t.prototype.beforeUploadUBO=function(t,e){},t.prototype.uploadUBO=function(t){var e,n=this,r=this.material,o=this.lightPool.getAllLights(),a=this.lightPool.getFog(),s=!!a,c=null!==(e=r.defines.USE_LIGHT)&&void 0!==e?e:!!o.length,l=r.defines.USE_WIREFRAME,u=[];if(l){var f=Ri(r.wireframeColor);u.push({name:"u_WireframeLineColor",value:[Number(f.r)/255,Number(f.g)/255,Number(f.b)/255]}),u.push({name:"u_WireframeLineWidth",value:r.wireframeLineWidth})}if(s&&this.uploadFog(u,a),this.uploadMaterial(u,r),c){var d={};o.forEach((function(t){d[t.define]||(d[t.define]=-1),d[t.define]++,t.uploadUBO(u,d[t.define])}))}u.sort((function(t,e){return n.material.uniformNames.indexOf(t.name)-n.material.uniformNames.indexOf(e.name)})),t.setUniforms(1,u);var h=r.depthCompare,p=r.depthWrite,g=r.stencilCompare,m=r.stencilWrite,v=r.stencilPassOp,y=r.stencilRef,_=r.cullMode,b=r.frontFace,E=r.polygonOffset,x=r.blendConstant,M=r.blendEquation,S=r.blendEquationAlpha,A=r.blendSrc,T=r.blendDst,O=r.blendSrcAlpha,R=r.blendDstAlpha,P=XP({blendConstant:x,depthCompare:h,depthWrite:p,stencilCompare:g,stencilWrite:m,stencilPassOp:v,stencilRef:y,cullMode:_,frontFace:b,polygonOffset:E}),C=t.getMegaStateFlags().attachmentsState[0];t.setMegaStateFlags(i({attachmentsState:[{channelWriteMask:this.material.stencilWrite?gO.NONE:gO.ALL,rgbBlendState:i(i({},C.rgbBlendState),XP({blendMode:M,blendSrcFactor:A,blendDstFactor:T})),alphaBlendState:i(i({},C.alphaBlendState),XP({blendMode:S,blendSrcFactor:O,blendDstFactor:R}))}]},P)),t.setBindingLayouts([{numUniformBuffers:1,numSamplers:this.textureMappings.length,samplerEntries:this.samplerEntries}]),t.setSamplerBindingsFromTextureMappings(this.textureMappings)},t.prototype.uploadFog=function(t,e){var n=e.parsedStyle,r=n.type,i=n.fill,o=n.start,a=n.end,s=n.density;if(Oi(i)){var c=[Number(i.r)/255,Number(i.g)/255,Number(i.b)/255,Number(i.alpha)];t.push({name:"u_FogInfos",value:[r,o,a,s]}),t.push({name:"u_FogColor",value:c})}},t.prototype.uploadMaterial=function(t,e){var n=Object.keys(e.uniforms).map((function(t){return{name:t,value:e.uniforms[t]}}));t.push.apply(t,f([],u(n),!1))},t.prototype.createFillGradientTextureMapping=function(t){var e,n=this,r=t[0],i=r.parsedStyle[this.gradientAttributeName];if(i&&(Ti(i)||Array.isArray(i))){Array.isArray(i)?(this.program.setDefineBool("USE_PATTERN",!1),this.texturePool.getOrCreateGradient({gradients:i,width:128,height:128,instance:r})):Ti(i)&&(this.program.setDefineBool("USE_PATTERN",!0),this.texturePool.getOrCreatePattern(i,r,(function(){t.forEach((function(t){t.renderable.dirty=!0})),n.material.textureDirty=!0}))),e=this.texturePool.getOrCreateCanvas();var o=this.texturePool.getOrCreateTexture(this.context.device,e,wO(SO.U8_RGBA_NORM,1,1,1));if(o){var a=new TP;return a.name=ZP,a.texture=o,a.texture.on("loaded",(function(){t.forEach((function(t){t.renderable.dirty=!0})),n.material.textureDirty=!0})),this.context.device.setResourceName(a.texture,"Fill Texture"+this.id),a.sampler=this.renderHelper.getCache().createSampler({wrapS:oO.CLAMP,wrapT:oO.CLAMP,minFilter:aO.POINT,magFilter:aO.BILINEAR,mipFilter:sO.LINEAR,minLOD:0,maxLOD:0}),a}}return null},t}();!function(t){t[t.PACKED_STYLE=5]="PACKED_STYLE"}(QP||(QP={})),function(t){t[t.PACKED_STYLE3=12]="PACKED_STYLE3",t[t.SIZE=13]="SIZE"}(JP||(JP={}));var eC=[Yn.CIRCLE,Yn.ELLIPSE,Yn.RECT],nC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.shouldMerge=function(e,n){return!!t.prototype.shouldMerge.call(this,e,n)},e.prototype.createMaterial=function(t){this.material.vertexShader="#define GLSLIFY 1\nlayout(std140) uniform ub_SceneParams {\n mat4 u_ProjectionMatrix;\n mat4 u_ViewMatrix;\n vec3 u_CameraPosition;\n float u_DevicePixelRatio;\n vec2 u_Viewport;\n float u_IsOrtho;\n float u_IsPicking;\n};\n\nlayout(location = MODEL_MATRIX0) in vec4 a_ModelMatrix0;\nlayout(location = MODEL_MATRIX1) in vec4 a_ModelMatrix1;\nlayout(location = MODEL_MATRIX2) in vec4 a_ModelMatrix2;\nlayout(location = MODEL_MATRIX3) in vec4 a_ModelMatrix3;\nlayout(location = PACKED_COLOR) in vec4 a_PackedColor;\nlayout(location = PACKED_STYLE1) in vec4 a_StylePacked1;\nlayout(location = PACKED_STYLE2) in vec4 a_StylePacked2;\nlayout(location = PICKING_COLOR) in vec4 a_PickingColor;\n\nout vec4 v_PickingResult;\nout vec4 v_Color;\nout vec4 v_StrokeColor;\nout vec4 v_StylePacked1;\nout vec4 v_StylePacked2;\n\n#define COLOR_SCALE 1. / 255.\nvoid setPickingColor(vec3 pickingColor) {\n v_PickingResult.rgb = pickingColor * COLOR_SCALE;\n}\n\nvec2 unpack_float(const float packedValue) {\n int packedIntValue = int(packedValue);\n int v0 = packedIntValue / 256;\n return vec2(v0, packedIntValue - v0 * 256);\n}\nvec4 decode_color(const vec2 encodedColor) {\n return vec4(\n unpack_float(encodedColor[0]) / 255.0,\n unpack_float(encodedColor[1]) / 255.0\n );\n}\nvec4 project(vec4 pos, mat4 pm, mat4 vm, mat4 mm) {\n return pm * vm * mm * pos;\n}\n\nbool isPerspectiveMatrix(mat4 m) {\n return m[2][3] == -1.0;\n}\n\nvec4 billboard(vec2 offset, float rotation, bool isSizeAttenuation, mat4 pm, mat4 vm, mat4 mm) {\n vec4 mvPosition = vm * mm * vec4(0.0, 0.0, 0.0, 1.0);\n vec2 scale;\n scale.x = length(vec3(mm[0][0], mm[0][1], mm[0][2]));\n scale.y = length(vec3(mm[1][0], mm[1][1], mm[1][2]));\n\n if (isSizeAttenuation) {\n bool isPerspective = isPerspectiveMatrix(pm);\n if (isPerspective) {\n scale *= -mvPosition.z / 250.0;\n }\n }\n\n vec2 alignedPosition = offset * scale;\n vec2 rotatedPosition;\n rotatedPosition.x = cos(rotation) * alignedPosition.x - sin(rotation) * alignedPosition.y;\n rotatedPosition.y = sin(rotation) * alignedPosition.x + cos(rotation) * alignedPosition.y;\n\n mvPosition.xy += rotatedPosition;\n return pm * mvPosition;\n}\n\nlayout(location = POSITION) in vec2 a_Extrude;\n// shape, radius, omitStroke, isBillboard\nlayout(location = PACKED_STYLE3) in vec4 a_StylePacked3;\nlayout(location = SIZE) in vec2 a_Size;\n#ifdef USE_UV\n layout(location = UV) in vec2 a_Uv;\n out vec2 v_Uv;\n#endif\n\nout vec2 v_Data;\nout vec2 v_Radius;\nout vec4 v_StylePacked3;\n\nvoid main() {\n vec4 a_Color = decode_color(a_PackedColor.xy);\nvec4 a_StrokeColor = decode_color(a_PackedColor.zw);\n\nmat4 u_ModelMatrix = mat4(a_ModelMatrix0, a_ModelMatrix1, a_ModelMatrix2, a_ModelMatrix3);\nvec4 u_StrokeColor = a_StrokeColor;\nfloat u_Opacity = a_StylePacked1.x;\nfloat u_FillOpacity = a_StylePacked1.y;\nfloat u_StrokeOpacity = a_StylePacked1.z;\nfloat u_StrokeWidth = a_StylePacked1.w;\nfloat u_ZIndex = a_PickingColor.w;\nvec2 u_Anchor = a_StylePacked2.yz;\nfloat u_IncreasedLineWidthForHitTesting = a_StylePacked2.w;\n\nsetPickingColor(a_PickingColor.xyz);\n\nv_Color = a_Color;\nv_StrokeColor = a_StrokeColor;\nv_StylePacked1 = a_StylePacked1;\nv_StylePacked2 = a_StylePacked2;\n\n// #ifdef CLIPSPACE_NEAR_ZERO\n// gl_Position.z = (gl_Position.z + gl_Position.w) * 0.5;\n// #endif\n #ifdef USE_UV\n v_Uv = a_Uv;\n #ifdef VIEWPORT_ORIGIN_TL\n v_Uv.y = 1.0 - v_Uv.y;\n #endif\n#endif\n\n float strokeWidth;\n if (u_IsPicking > 0.5) {\n strokeWidth = u_IncreasedLineWidthForHitTesting + u_StrokeWidth;\n } else {\n strokeWidth = u_StrokeWidth;\n }\n\n bool omitStroke = a_StylePacked3.z == 1.0;\n vec2 radius = a_Size + vec2(omitStroke ? 0.0 : strokeWidth / 2.0);\n vec2 offset = (a_Extrude + vec2(1.0) - 2.0 * u_Anchor.xy) * a_Size + a_Extrude * vec2(omitStroke ? 0.0 : strokeWidth / 2.0);\n\n bool isBillboard = a_StylePacked3.w > 0.5;\n if (isBillboard) {\n float rotation = 0.0;\n bool isSizeAttenuation = false;\n gl_Position = billboard(offset, rotation, isSizeAttenuation, u_ProjectionMatrix, u_ViewMatrix, u_ModelMatrix);\n } else {\n gl_Position = project(vec4(offset, u_ZIndex, 1.0), u_ProjectionMatrix, u_ViewMatrix, u_ModelMatrix);\n }\n \n v_Radius = radius;\n v_Data = vec2(a_Extrude * radius / radius.y);\n v_StylePacked3 = a_StylePacked3;\n}",this.material.fragmentShader="#define GLSLIFY 1\nlayout(std140) uniform ub_SceneParams {\n mat4 u_ProjectionMatrix;\n mat4 u_ViewMatrix;\n vec3 u_CameraPosition;\n float u_DevicePixelRatio;\n vec2 u_Viewport;\n float u_IsOrtho;\n float u_IsPicking;\n};\n\nin vec4 v_PickingResult;\nin vec4 v_Color;\nin vec4 v_StrokeColor;\nin vec4 v_StylePacked1;\nin vec4 v_StylePacked2;\n#ifdef USE_UV\n in vec2 v_Uv;\n#endif\n#ifdef USE_MAP\n uniform sampler2D u_Map;\n#endif\n\nin vec2 v_Data;\nin vec2 v_Radius;\nin vec4 v_StylePacked3;\n\nout vec4 outputColor;\n\n/**\n * 2D signed distance field functions\n * @see http://www.iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm\n */\n\nfloat sdCircle(vec2 p, float r) {\n return length(p) - r;\n}\n\n// @see http://www.iquilezles.org/www/articles/ellipsoids/ellipsoids.htm\nfloat sdEllipsoidApproximated(vec2 p, vec2 r) {\n float k0 = length(p / r);\n float k1 = length(p / (r * r));\n return k0 * (k0 - 1.0) / k1;\n}\n\n// @see https://www.shadertoy.com/view/4llXD7\nfloat sdRoundedBox(vec2 p, vec2 b, float r) {\n p = abs(p) - b + r;\n return length(max(p, 0.0)) + min(max(p.x, p.y), 0.0) - r;\n}\n\nvoid main() {\n int shape = int(floor(v_StylePacked3.x + 0.5));\n float epsilon = 0.000001;\n\n vec4 u_Color = v_Color;\nvec4 u_StrokeColor = v_StrokeColor;\nfloat u_Opacity = v_StylePacked1.x;\nfloat u_FillOpacity = v_StylePacked1.y;\nfloat u_StrokeOpacity = v_StylePacked1.z;\nfloat u_StrokeWidth = v_StylePacked1.w;\nfloat u_Visible = v_StylePacked2.x;\nvec3 u_PickingColor = v_PickingResult.xyz;\n\nif (u_Visible < 0.5) {\n discard;\n}\n #ifdef USE_MAP\n #ifdef USE_PATTERN\n vec4 texelColor = texture(SAMPLER_2D(u_Map), v_Uv);\n u_Color = texelColor;\n #else\n vec4 texelColor = texture(SAMPLER_2D(u_Map), v_Uv);\n u_Color = texelColor;\n #endif\n#endif\n\n bool omitStroke = v_StylePacked3.z == 1.0;\n\n vec2 r = (v_Radius - (omitStroke ? 0.0 : u_StrokeWidth)) / v_Radius.y;\n float wh = v_Radius.x / v_Radius.y;\n\n float dist = length(v_Data);\n float antialiased_blur = -fwidth(dist);\n\n float outer_df;\n float inner_df;\n // 'circle', 'ellipse', 'rect'\n if (shape == 0) {\n outer_df = sdCircle(v_Data, 1.0);\n inner_df = sdCircle(v_Data, r.x);\n } else if (shape == 1) {\n outer_df = sdEllipsoidApproximated(v_Data, vec2(wh, 1.0));\n inner_df = sdEllipsoidApproximated(v_Data, r);\n } else if (shape == 2) {\n bool useRadius = v_StylePacked3.y > epsilon;\n outer_df = sdRoundedBox(v_Data, vec2(wh, 1.0), useRadius ? (v_StylePacked3.y + u_StrokeWidth / 2.0) / v_Radius.y : 0.0);\n inner_df = sdRoundedBox(v_Data, r, useRadius ? (v_StylePacked3.y - u_StrokeWidth / 2.0) / v_Radius.y : 0.0);\n }\n\n float opacity_t = smoothstep(0.0, antialiased_blur, outer_df);\n\n float color_t = u_StrokeWidth < 0.01 ? 0.0 : smoothstep(\n antialiased_blur,\n 0.0,\n inner_df\n );\n\n vec4 diffuseColor;\n vec4 strokeColor;\n if (u_IsPicking > 0.5) {\n diffuseColor = vec4(u_PickingColor, 1.0);\n strokeColor = vec4(u_PickingColor, 1.0);\n } else {\n diffuseColor = u_Color;\n strokeColor = (u_StrokeColor == vec4(0) || omitStroke) ? vec4(0.0) : u_StrokeColor;\n }\n\n outputColor = mix(vec4(diffuseColor.rgb, diffuseColor.a * u_FillOpacity), strokeColor * u_StrokeOpacity, color_t);\n outputColor.a = outputColor.a * u_Opacity * opacity_t;\n\n if (outputColor.a < epsilon)\n discard;\n\n if (u_IsPicking > 0.5) {\n if (u_PickingColor.x == 0.0 && u_PickingColor.y == 0.0 && u_PickingColor.z == 0.0) {\n discard;\n }\n }\n}",this.material.defines=i(i({},this.material.defines),HP(JP))},e.prototype.createGeometry=function(e){var n=this;t.prototype.createGeometry.call(this,e);var r=[];e.forEach((function(t,e){var i=t,o=i.parsedStyle.radius,a=n.shouldOmitStroke(i.parsedStyle),s=n.getSize(t.parsedStyle,i.nodeName);r.push.apply(r,f(f([],u(s),!1),[eC.indexOf(i.nodeName),o&&o[0]||0,a?1:0,i.parsedStyle.isBillboard?1:0],!1))})),this.geometry.setIndexBuffer(new Uint32Array([0,2,1,0,3,2])),this.geometry.vertexCount=6,this.geometry.setVertexBuffer({bufferIndex:$P.POSITION,byteStride:16,stepMode:fO.VERTEX,attributes:[{format:SO.F32_RG,bufferByteOffset:0,location:qP.POSITION},{format:SO.F32_RG,bufferByteOffset:8,location:qP.UV}],data:new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1])}),this.geometry.setVertexBuffer({bufferIndex:QP.PACKED_STYLE,byteStride:24,stepMode:fO.INSTANCE,attributes:[{format:SO.F32_RG,bufferByteOffset:0,location:JP.SIZE,divisor:1},{format:SO.F32_RGBA,bufferByteOffset:8,location:JP.PACKED_STYLE3,divisor:1}],data:new Float32Array(r)})},e.prototype.updateAttribute=function(e,n,r,i){var o=this;if(t.prototype.updateAttribute.call(this,e,n,r,i),this.updateBatchedAttribute(e,n,r,i),"r"===r||"rx"===r||"ry"===r||"width"===r||"height"===r||"lineWidth"===r||"stroke"===r||"lineDash"===r||"strokeOpacity"===r||"radius"===r||"isBillboard"===r){var a=[];e.forEach((function(t){var e=t,n=o.shouldOmitStroke(e.parsedStyle),r=u(o.getSize(t.parsedStyle,t.nodeName),2),i=[r[0],r[1]];a.push.apply(a,f(f([],u(i),!1),[eC.indexOf(t.nodeName),t.parsedStyle.radius&&t.parsedStyle.radius[0]||0,n?1:0,e.parsedStyle.isBillboard?1:0],!1))})),this.geometry.updateVertexBuffer(QP.PACKED_STYLE,JP.SIZE,n,new Uint8Array(new Float32Array(a).buffer))}},e.prototype.getSize=function(t,e){var n=[0,0];if(e===Yn.CIRCLE){var r=t.r;n=[r,r]}else if(e===Yn.ELLIPSE){var i=t;n=[i.rx,i.ry]}else if(e===Yn.RECT){var o=t;n=[o.width/2,o.height/2]}return n},e.prototype.shouldOmitStroke=function(t){var e=t.lineDash,n=t.stroke,r=t.strokeOpacity,i=n&&!n.isNone,o=e&&e.length&&e.every((function(t){return 0!==t}));return!i||i&&(o||r<1)},e}(tC),rC=10,iC=8,oC=100;function aC(t,e,n,r,i,o){for(var a=i[i.length-3],s=i[i.length-3],c=null!=o?o:Se(function(t,e,n,r,i,o){return zn(t,e,n,r,i,o,3)}(a,s,t,e,n,r)/rC,iC,oC),l=0,u=0,f=1;f<=c;++f){var d=f/c;l=a+(t-a)*d,u=s+(e-s)*d,i.push(l+(t+(n-t)*d-l)*d,u+(e+(r-e)*d-u)*d,0)}}function sC(t,e,n,r,i,o,a,s){var c=a[a.length-3],l=a[a.length-2];a.length-=3;var u=null!=s?s:Se(function(t,e,n,r,i,o,a,s){return Bn(t,e,n,r,i,o,a,s,3)}(c,l,t,e,n,r,i,o)/rC,iC,oC),f=0,d=0,h=0,p=0,g=0;a.push(c,l,0);for(var m=1,v=0;m<=u;++m)h=(d=(f=1-(v=m/u))*f)*f,g=(p=v*v)*v,a.push(h*c+3*d*v*t+3*f*p*n+g*i,h*l+3*d*v*e+3*f*p*r+g*o,0)}var cC,lC,uC=1e20,fC=function(){function t(t,e){var n=t.fontSize,r=void 0===n?24:n,i=t.buffer,o=void 0===i?3:i,a=t.radius,s=void 0===a?8:a,c=t.cutoff,l=void 0===c?.25:c,u=t.fontFamily,f=void 0===u?"sans-serif":u,d=t.fontWeight,h=void 0===d?"normal":d,p=t.fontStyle,g=void 0===p?"normal":p,m=t.canvas;this.buffer=o,this.cutoff=l,this.radius=s;var v=this.size=r+4*o,y=e.offscreenCanvasCreator.getOrCreateCanvas(m);y.width=v,y.height=v;var _=e.offscreenCanvasCreator.getOrCreateContext(m,{willReadFrequently:!0});this.ctx=_,_.font="".concat(g," ").concat(h," ").concat(r,"px ").concat(f),_.textBaseline="alphabetic",_.textAlign="left",_.fillStyle="black",this.gridOuter=new Float64Array(v*v),this.gridInner=new Float64Array(v*v),this.f=new Float64Array(v),this.z=new Float64Array(v+1),this.v=new Uint16Array(v)}return t.prototype.draw=function(t){var e=this.ctx.measureText(t),n=e.width,r=e.actualBoundingBoxAscent,i=e.actualBoundingBoxDescent,o=e.actualBoundingBoxLeft,a=e.actualBoundingBoxRight,s=Math.ceil(r),c=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(a-o))),l=Math.min(this.size-this.buffer,s+Math.ceil(i)),u=c+2*this.buffer,f=l+2*this.buffer,d=Math.max(u*f,0),h=new Uint8ClampedArray(d),p={data:h,width:u,height:f,glyphWidth:c,glyphHeight:l,glyphTop:s,glyphLeft:0,glyphAdvance:n};if(0===c||0===l)return p;var g=this,m=g.ctx,v=g.buffer,y=g.gridInner,_=g.gridOuter;m.clearRect(v,v,c,l),m.fillText(t,v,v+s);var b=m.getImageData(v,v,c,l);_.fill(uC,0,d),y.fill(0,0,d);for(var E=0;E<l;E++)for(var x=0;x<c;x++){var M=b.data[4*(E*c+x)+3]/255;if(0!==M){var S=(E+v)*u+x+v;if(1===M)_[S]=0,y[S]=uC;else{var A=.5-M;_[S]=A>0?A*A:0,y[S]=A<0?A*A:0}}}dC(_,0,0,u,f,u,this.f,this.v,this.z),dC(y,v,v,c,l,u,this.f,this.v,this.z);for(var T=0;T<d;T++){A=Math.sqrt(_[T])-Math.sqrt(y[T]);h[T]=Math.round(255-255*(A/this.radius+this.cutoff))}return p},t}();function dC(t,e,n,r,i,o,a,s,c){for(var l=e;l<e+r;l++)hC(t,n*o+l,o,i,a,s,c);for(var u=n;u<n+i;u++)hC(t,u*o+e,1,r,a,s,c)}function hC(t,e,n,r,i,o,a){o[0]=0,a[0]=-uC,a[1]=uC,i[0]=t[e];for(var s=1,c=0,l=0;s<r;s++){i[s]=t[e+s*n];var u=s*s;do{var f=o[c];l=(i[s]-i[f]+u-f*f)/(s-f)/2}while(l<=a[c]&&--c>-1);o[++c]=s,a[c]=l,a[c+1]=uC}for(s=0,c=0;s<r;s++){for(;a[c+1]<s;)c++;var d=s-(f=o[c]);t[e+s*n]=i[f]+d*d}}!function(t){t[t.PACKED=5]="PACKED",t[t.VERTEX_NUM=6]="VERTEX_NUM",t[t.TRAVEL=7]="TRAVEL",t[t.DASH=8]="DASH"}(cC||(cC={})),function(t){t[t.PREV=8]="PREV",t[t.POINT1=9]="POINT1",t[t.POINT2=10]="POINT2",t[t.NEXT=11]="NEXT",t[t.VERTEX_JOINT=12]="VERTEX_JOINT",t[t.VERTEX_NUM=13]="VERTEX_NUM",t[t.TRAVEL=14]="TRAVEL",t[t.DASH=15]="DASH"}(lC||(lC={}));var pC,gC=function(t){function e(e,n,r,i,o,a,s){var c=t.call(this,e,n,r,i,o,a,s)||this;return c.renderHelper=e,c.texturePool=n,c.lightPool=r,c.mergeAnchorIntoModelMatrix=!0,c.segmentNum=-1,c.segmentNum=c.calcSegmentNum(i),c.gradientAttributeName="stroke",c}return r(e,t),e.calcSubpathNum=function(t){return t.nodeName===Yn.PATH?t.parsedStyle.path.absolutePath.filter((function(t){return"M"===t[0]})).length:1},e.prototype.calcSegmentNum=function(t){return yC(t,!1,12,this.calcSubpathIndex(t)).instancedCount},e.prototype.calcSubpathIndex=function(t){if(t.nodeName===Yn.PATH){var e=this.drawcallCtors.filter((function(t){return t===xC})).length;return this.index-e}return 0},e.prototype.shouldMerge=function(e,n){if(!t.prototype.shouldMerge.call(this,e,n))return!1;if(this.index!==n)return!1;var r=this.calcSegmentNum(e);return this.segmentNum===r},e.prototype.createMaterial=function(t){this.material.vertexShader="#define GLSLIFY 1\nlayout(std140) uniform ub_SceneParams {\n mat4 u_ProjectionMatrix;\n mat4 u_ViewMatrix;\n vec3 u_CameraPosition;\n float u_DevicePixelRatio;\n vec2 u_Viewport;\n float u_IsOrtho;\n float u_IsPicking;\n};\n\nlayout(location = MODEL_MATRIX0) in vec4 a_ModelMatrix0;\nlayout(location = MODEL_MATRIX1) in vec4 a_ModelMatrix1;\nlayout(location = MODEL_MATRIX2) in vec4 a_ModelMatrix2;\nlayout(location = MODEL_MATRIX3) in vec4 a_ModelMatrix3;\nlayout(location = PACKED_COLOR) in vec4 a_PackedColor;\nlayout(location = PACKED_STYLE1) in vec4 a_StylePacked1;\nlayout(location = PACKED_STYLE2) in vec4 a_StylePacked2;\nlayout(location = PICKING_COLOR) in vec4 a_PickingColor;\n\nout vec4 v_PickingResult;\nout vec4 v_Color;\nout vec4 v_StrokeColor;\nout vec4 v_StylePacked1;\nout vec4 v_StylePacked2;\n\n#define COLOR_SCALE 1. / 255.\nvoid setPickingColor(vec3 pickingColor) {\n v_PickingResult.rgb = pickingColor * COLOR_SCALE;\n}\n\nvec2 unpack_float(const float packedValue) {\n int packedIntValue = int(packedValue);\n int v0 = packedIntValue / 256;\n return vec2(v0, packedIntValue - v0 * 256);\n}\nvec4 decode_color(const vec2 encodedColor) {\n return vec4(\n unpack_float(encodedColor[0]) / 255.0,\n unpack_float(encodedColor[1]) / 255.0\n );\n}\nvec4 project(vec4 pos, mat4 pm, mat4 vm, mat4 mm) {\n return pm * vm * mm * pos;\n}\n\nlayout(location = PREV) in vec3 a_Prev;\nlayout(location = POINT1) in vec3 a_Point1;\nlayout(location = POINT2) in vec3 a_Point2;\nlayout(location = NEXT) in vec3 a_Next;\nlayout(location = VERTEX_JOINT) in float a_VertexJoint;\nlayout(location = VERTEX_NUM) in float a_VertexNum;\nlayout(location = TRAVEL) in float a_Travel;\n#ifdef USE_UV\n layout(location = UV) in vec2 a_Uv;\n out vec2 v_Uv;\n#endif\nlayout(location = DASH) in vec4 a_Dash;\nout vec4 v_Dash;\n\nconst float FILL = 1.0;\nconst float BEVEL = 4.0;\nconst float MITER = 8.0;\nconst float ROUND = 12.0;\nconst float JOINT_CAP_BUTT = 16.0;\nconst float JOINT_CAP_SQUARE = 18.0;\nconst float JOINT_CAP_ROUND = 20.0;\nconst float FILL_EXPAND = 24.0;\nconst float CAP_BUTT = 1.0;\nconst float CAP_SQUARE = 2.0;\nconst float CAP_ROUND = 3.0;\nconst float CAP_BUTT2 = 4.0;\n\nconst float u_Expand = 1.0;\nconst float u_MiterLimit = 5.0;\nconst float u_ScaleMode = 1.0;\nconst float u_Alignment = 0.5;\n\nout vec4 v_Distance;\nout vec4 v_Arc;\nout float v_Type;\nout float v_Travel;\nout float v_ScalingFactor;\n\nvec2 doBisect(\n vec2 norm, float len, vec2 norm2, float len2, float dy, float inner\n) {\n vec2 bisect = (norm + norm2) / 2.0;\n bisect /= dot(norm, bisect);\n vec2 shift = dy * bisect;\n if (inner > 0.5) {\n if (len < len2) {\n if (abs(dy * (bisect.x * norm.y - bisect.y * norm.x)) > len) {\n return dy * norm;\n }\n } else {\n if (abs(dy * (bisect.x * norm2.y - bisect.y * norm2.x)) > len2) {\n return dy * norm;\n }\n }\n }\n return dy * bisect;\n}\n\nvec2 project2ScreenSpace(vec3 pos, mat4 u_ModelMatrix) {\n vec4 clip = project(vec4(pos, 1.0), u_ProjectionMatrix, u_ViewMatrix, u_ModelMatrix);\n return u_Viewport * (0.5 * clip.xy / clip.w + 0.5);\n}\n\nvoid main() {\n vec4 a_Color = decode_color(a_PackedColor.xy);\nvec4 a_StrokeColor = decode_color(a_PackedColor.zw);\n\nmat4 u_ModelMatrix = mat4(a_ModelMatrix0, a_ModelMatrix1, a_ModelMatrix2, a_ModelMatrix3);\nvec4 u_StrokeColor = a_StrokeColor;\nfloat u_Opacity = a_StylePacked1.x;\nfloat u_FillOpacity = a_StylePacked1.y;\nfloat u_StrokeOpacity = a_StylePacked1.z;\nfloat u_StrokeWidth = a_StylePacked1.w;\nfloat u_ZIndex = a_PickingColor.w;\nvec2 u_Anchor = a_StylePacked2.yz;\nfloat u_IncreasedLineWidthForHitTesting = a_StylePacked2.w;\n\nsetPickingColor(a_PickingColor.xyz);\n\nv_Color = a_Color;\nv_StrokeColor = a_StrokeColor;\nv_StylePacked1 = a_StylePacked1;\nv_StylePacked2 = a_StylePacked2;\n\n// #ifdef CLIPSPACE_NEAR_ZERO\n// gl_Position.z = (gl_Position.z + gl_Position.w) * 0.5;\n// #endif\n #ifdef USE_UV\n v_Uv = a_Uv;\n #ifdef VIEWPORT_ORIGIN_TL\n v_Uv.y = 1.0 - v_Uv.y;\n #endif\n#endif\n\n v_Dash = a_Dash;\n\n vec2 pointA;\n vec2 pointB;\n vec4 clip0;\n vec4 clip1;\n\n float isBillboard = a_Dash.w;\n if (isBillboard > 0.5) {\n // clip space\n clip0 = project(vec4(a_Point1, 1.0), u_ProjectionMatrix, u_ViewMatrix, u_ModelMatrix);\n clip1 = project(vec4(a_Point2, 1.0), u_ProjectionMatrix, u_ViewMatrix, u_ModelMatrix);\n // screen space\n pointA = project2ScreenSpace(a_Point1, u_ModelMatrix);\n pointB = project2ScreenSpace(a_Point2, u_ModelMatrix);\n } else {\n pointA = (u_ModelMatrix * vec4(a_Point1, 1.0)).xy;\n pointB = (u_ModelMatrix * vec4(a_Point2, 1.0)).xy;\n }\n\n vec2 xBasis = pointB - pointA;\n float len = length(xBasis);\n vec2 forward = xBasis / len;\n vec2 norm = vec2(forward.y, -forward.x);\n\n float type = a_VertexJoint;\n\n float lineWidth;\n if (u_IsPicking > 0.5) {\n lineWidth = u_IncreasedLineWidthForHitTesting + u_StrokeWidth;\n } else {\n lineWidth = u_StrokeWidth;\n }\n\n if (u_ScaleMode > 2.5) {\n lineWidth *= length(u_ModelMatrix * vec4(1.0, 0.0, 0.0, 0.0));\n } else if (u_ScaleMode > 1.5) {\n lineWidth *= length(u_ModelMatrix * vec4(0.0, 1.0, 0.0, 0.0));\n } else if (u_ScaleMode > 0.5) {\n vec2 avgDiag = (u_ModelMatrix * vec4(1.0, 1.0, 0.0, 0.0)).xy;\n lineWidth *= sqrt(dot(avgDiag, avgDiag) * 0.5);\n }\n float capType = floor(type / 32.0);\n type -= capType * 32.0;\n v_Arc = vec4(0.0);\n lineWidth *= 0.5;\n float lineAlignment = 2.0 * u_Alignment - 1.0;\n\n vec2 pos;\n\n if (capType == CAP_ROUND) {\n if (a_VertexNum < 3.5) {\n gl_Position = vec4(0.0, 0.0, 0.0, 1.0);\n return;\n }\n type = JOINT_CAP_ROUND;\n capType = 0.0;\n }\n\n if (type >= BEVEL) {\n float dy = lineWidth + u_Expand;\n float inner = 0.0;\n if (a_VertexNum >= 1.5) {\n dy = -dy;\n inner = 1.0;\n }\n\n vec2 base, next, xBasis2, bisect;\n float flag = 0.0;\n float sign2 = 1.0;\n if (a_VertexNum < 0.5 || a_VertexNum > 2.5 && a_VertexNum < 3.5) {\n if (isBillboard > 0.5) {\n next = project2ScreenSpace(a_Prev, u_ModelMatrix);\n } else {\n next = (u_ModelMatrix * vec4(a_Prev, 1.0)).xy;\n } \n\n base = pointA;\n flag = type - floor(type / 2.0) * 2.0;\n sign2 = -1.0;\n } else {\n if (isBillboard > 0.5) {\n next = project2ScreenSpace(a_Next, u_ModelMatrix);\n } else {\n next = (u_ModelMatrix * vec4(a_Next, 1.0)).xy;\n }\n \n base = pointB;\n if (type >= MITER && type < MITER + 3.5) {\n flag = step(MITER + 1.5, type);\n // check miter limit here?\n }\n }\n xBasis2 = next - base;\n float len2 = length(xBasis2);\n vec2 norm2 = vec2(xBasis2.y, -xBasis2.x) / len2;\n float D = norm.x * norm2.y - norm.y * norm2.x;\n if (D < 0.0) {\n inner = 1.0 - inner;\n }\n norm2 *= sign2;\n\n if (abs(lineAlignment) > 0.01) {\n float shift = lineWidth * lineAlignment;\n pointA += norm * shift;\n pointB += norm * shift;\n if (abs(D) < 0.01) {\n base += norm * shift;\n } else {\n base += doBisect(norm, len, norm2, len2, shift, 0.0);\n }\n }\n\n float collinear = step(0.0, dot(norm, norm2));\n v_Type = 0.0;\n float dy2 = -1000.0;\n float dy3 = -1000.0;\n if (abs(D) < 0.01 && collinear < 0.5) {\n if (type >= ROUND && type < ROUND + 1.5) {\n type = JOINT_CAP_ROUND;\n }\n // TODO: BUTT here too\n }\n\n if (a_VertexNum < 3.5) {\n if (abs(D) < 0.01) {\n pos = dy * norm;\n } else {\n if (flag < 0.5 && inner < 0.5) {\n pos = dy * norm;\n } else {\n pos = doBisect(norm, len, norm2, len2, dy, inner);\n }\n }\n if (capType >= CAP_BUTT && capType < CAP_ROUND) {\n float extra = step(CAP_SQUARE, capType) * lineWidth;\n vec2 back = -forward;\n if (a_VertexNum < 0.5 || a_VertexNum > 2.5) {\n pos += back * (u_Expand + extra);\n dy2 = u_Expand;\n } else {\n dy2 = dot(pos + base - pointA, back) - extra;\n }\n }\n if (type >= JOINT_CAP_BUTT && type < JOINT_CAP_SQUARE + 0.5) {\n float extra = step(JOINT_CAP_SQUARE, type) * lineWidth;\n if (a_VertexNum < 0.5 || a_VertexNum > 2.5) {\n dy3 = dot(pos + base - pointB, forward) - extra;\n } else {\n pos += forward * (u_Expand + extra);\n dy3 = u_Expand;\n if (capType >= CAP_BUTT) {\n dy2 -= u_Expand + extra;\n }\n }\n }\n } else if (type >= JOINT_CAP_ROUND && type < JOINT_CAP_ROUND + 1.5) {\n if (inner > 0.5) {\n dy = -dy;\n inner = 0.0;\n }\n vec2 d2 = abs(dy) * forward;\n if (a_VertexNum < 4.5) {\n dy = -dy;\n pos = dy * norm;\n } else if (a_VertexNum < 5.5) {\n pos = dy * norm;\n } else if (a_VertexNum < 6.5) {\n pos = dy * norm + d2;\n v_Arc.x = abs(dy);\n } else {\n dy = -dy;\n pos = dy * norm + d2;\n v_Arc.x = abs(dy);\n }\n dy2 = 0.0;\n v_Arc.y = dy;\n v_Arc.z = 0.0;\n v_Arc.w = lineWidth;\n v_Type = 3.0;\n } else if (abs(D) < 0.01) {\n pos = dy * norm;\n } else {\n if (type >= ROUND && type < ROUND + 1.5) {\n if (inner > 0.5) {\n dy = -dy;\n inner = 0.0;\n }\n if (a_VertexNum < 4.5) {\n pos = doBisect(norm, len, norm2, len2, -dy, 1.0);\n } else if (a_VertexNum < 5.5) {\n pos = dy * norm;\n } else if (a_VertexNum > 7.5) {\n pos = dy * norm2;\n } else {\n pos = doBisect(norm, len, norm2, len2, dy, 0.0);\n float d2 = abs(dy);\n if (length(pos) > abs(dy) * 1.5) {\n if (a_VertexNum < 6.5) {\n pos.x = dy * norm.x - d2 * norm.y;\n pos.y = dy * norm.y + d2 * norm.x;\n } else {\n pos.x = dy * norm2.x + d2 * norm2.y;\n pos.y = dy * norm2.y - d2 * norm2.x;\n }\n }\n }\n vec2 norm3 = normalize(norm + norm2);\n float sign = step(0.0, dy) * 2.0 - 1.0;\n v_Arc.x = sign * dot(pos, norm3);\n v_Arc.y = pos.x * norm3.y - pos.y * norm3.x;\n v_Arc.z = dot(norm, norm3) * lineWidth;\n v_Arc.w = lineWidth;\n dy = -sign * dot(pos, norm);\n dy2 = -sign * dot(pos, norm2);\n dy3 = v_Arc.z - v_Arc.x;\n v_Type = 3.0;\n } else {\n float hit = 0.0;\n if (type >= BEVEL && type < BEVEL + 1.5) {\n if (dot(norm, norm2) > 0.0) {\n type = MITER;\n }\n }\n if (type >= MITER && type < MITER + 3.5) {\n if (inner > 0.5) {\n dy = -dy;\n inner = 0.0;\n }\n float sign = step(0.0, dy) * 2.0 - 1.0;\n pos = doBisect(norm, len, norm2, len2, dy, 0.0);\n if (length(pos) > abs(dy) * u_MiterLimit) {\n type = BEVEL;\n } else {\n if (a_VertexNum < 4.5) {\n dy = -dy;\n pos = doBisect(norm, len, norm2, len2, dy, 1.0);\n } else if (a_VertexNum < 5.5) {\n pos = dy * norm;\n } else if (a_VertexNum > 6.5) {\n pos = dy * norm2;\n }\n v_Type = 1.0;\n dy = -sign * dot(pos, norm);\n dy2 = -sign * dot(pos, norm2);\n hit = 1.0;\n }\n }\n if (type >= BEVEL && type < BEVEL + 1.5) {\n if (inner > 0.5) {\n dy = -dy;\n inner = 0.0;\n }\n float d2 = abs(dy);\n vec2 pos3 = vec2(dy * norm.x - d2 * norm.y, dy * norm.y + d2 * norm.x);\n vec2 pos4 = vec2(dy * norm2.x + d2 * norm2.y, dy * norm2.y - d2 * norm2.x);\n if (a_VertexNum < 4.5) {\n pos = doBisect(norm, len, norm2, len2, -dy, 1.0);\n } else if (a_VertexNum < 5.5) {\n pos = dy * norm;\n } else if (a_VertexNum > 7.5) {\n pos = dy * norm2;\n } else {\n if (a_VertexNum < 6.5) {\n pos = pos3;\n } else {\n pos = pos4;\n }\n }\n vec2 norm3 = normalize(norm + norm2);\n float sign = step(0.0, dy) * 2.0 - 1.0;\n dy = -sign * dot(pos, norm);\n dy2 = -sign * dot(pos, norm2);\n dy3 = (-sign * dot(pos, norm3)) + lineWidth;\n v_Type = 4.0;\n hit = 1.0;\n }\n if (hit < 0.5) {\n gl_Position = vec4(0.0, 0.0, 0.0, 1.0);\n return;\n }\n }\n }\n pos += base;\n v_Distance = vec4(dy, dy2, dy3, lineWidth) * u_DevicePixelRatio;\n v_Arc = v_Arc * u_DevicePixelRatio;\n v_Travel = a_Travel + dot(pos - pointA, vec2(-norm.y, norm.x));\n }\n\n v_ScalingFactor = sqrt(u_ModelMatrix[0][0] * u_ModelMatrix[0][0] + u_ModelMatrix[0][1] * u_ModelMatrix[0][1] + u_ModelMatrix[0][2] * u_ModelMatrix[0][2]);\n\n if (isBillboard > 0.5) {\n vec4 clip = mix(clip0, clip1, 0.5);\n gl_Position = vec4(clip.w * (2.0 * pos / u_Viewport - 1.0), clip.z, clip.w);\n } else {\n gl_Position = u_ProjectionMatrix * u_ViewMatrix * vec4(pos, u_ZIndex, 1.0);\n }\n}",this.material.fragmentShader="#define GLSLIFY 1\nlayout(std140) uniform ub_SceneParams {\n mat4 u_ProjectionMatrix;\n mat4 u_ViewMatrix;\n vec3 u_CameraPosition;\n float u_DevicePixelRatio;\n vec2 u_Viewport;\n float u_IsOrtho;\n float u_IsPicking;\n};\n\nin vec4 v_PickingResult;\nin vec4 v_Color;\nin vec4 v_StrokeColor;\nin vec4 v_StylePacked1;\nin vec4 v_StylePacked2;\n#ifdef USE_UV\n in vec2 v_Uv;\n#endif\n#ifdef USE_MAP\n uniform sampler2D u_Map;\n#endif\n\nin vec4 v_Dash;\n\nin vec4 v_Distance;\nin vec4 v_Arc;\nin float v_Type;\nin float v_Travel;\nin float v_ScalingFactor;\n\nout vec4 outputColor;\n\nvoid main(){\n vec4 u_Color = v_Color;\nvec4 u_StrokeColor = v_StrokeColor;\nfloat u_Opacity = v_StylePacked1.x;\nfloat u_FillOpacity = v_StylePacked1.y;\nfloat u_StrokeOpacity = v_StylePacked1.z;\nfloat u_StrokeWidth = v_StylePacked1.w;\nfloat u_Visible = v_StylePacked2.x;\nvec3 u_PickingColor = v_PickingResult.xyz;\n\nif (u_Visible < 0.5) {\n discard;\n}\n #ifdef USE_MAP\n #ifdef USE_PATTERN\n vec4 texelColor = texture(SAMPLER_2D(u_Map), v_Uv);\n u_Color = texelColor;\n #else\n vec4 texelColor = texture(SAMPLER_2D(u_Map), v_Uv);\n u_Color = texelColor;\n #endif\n#endif\n\n float alpha = 1.0;\n float lineWidth = v_Distance.w;\n if (v_Type < 0.5) {\n float left = max(v_Distance.x - 0.5, -v_Distance.w);\n float right = min(v_Distance.x + 0.5, v_Distance.w);\n float near = v_Distance.y - 0.5;\n float far = min(v_Distance.y + 0.5, 0.0);\n float top = v_Distance.z - 0.5;\n float bottom = min(v_Distance.z + 0.5, 0.0);\n alpha = max(right - left, 0.0) * max(bottom - top, 0.0) * max(far - near, 0.0);\n } else if (v_Type < 1.5) {\n float a1 = clamp(v_Distance.x + 0.5 - lineWidth, 0.0, 1.0);\n float a2 = clamp(v_Distance.x + 0.5 + lineWidth, 0.0, 1.0);\n float b1 = clamp(v_Distance.y + 0.5 - lineWidth, 0.0, 1.0);\n float b2 = clamp(v_Distance.y + 0.5 + lineWidth, 0.0, 1.0);\n alpha = a2 * b2 - a1 * b1;\n } else if (v_Type < 2.5) {\n alpha *= max(min(v_Distance.x + 0.5, 1.0), 0.0);\n alpha *= max(min(v_Distance.y + 0.5, 1.0), 0.0);\n alpha *= max(min(v_Distance.z + 0.5, 1.0), 0.0);\n } else if (v_Type < 3.5) {\n float a1 = clamp(v_Distance.x + 0.5 - lineWidth, 0.0, 1.0);\n float a2 = clamp(v_Distance.x + 0.5 + lineWidth, 0.0, 1.0);\n float b1 = clamp(v_Distance.y + 0.5 - lineWidth, 0.0, 1.0);\n float b2 = clamp(v_Distance.y + 0.5 + lineWidth, 0.0, 1.0);\n float alpha_miter = a2 * b2 - a1 * b1;\n float alpha_plane = max(min(v_Distance.z + 0.5, 1.0), 0.0);\n float d = length(v_Arc.xy);\n float circle_hor = max(min(v_Arc.w, d + 0.5) - max(-v_Arc.w, d - 0.5), 0.0);\n float circle_vert = min(v_Arc.w * 2.0, 1.0);\n float alpha_circle = circle_hor * circle_vert;\n alpha = min(alpha_miter, max(alpha_circle, alpha_plane));\n } else {\n float a1 = clamp(v_Distance.x + 0.5 - lineWidth, 0.0, 1.0);\n float a2 = clamp(v_Distance.x + 0.5 + lineWidth, 0.0, 1.0);\n float b1 = clamp(v_Distance.y + 0.5 - lineWidth, 0.0, 1.0);\n float b2 = clamp(v_Distance.y + 0.5 + lineWidth, 0.0, 1.0);\n alpha = a2 * b2 - a1 * b1;\n alpha *= max(min(v_Distance.z + 0.5, 1.0), 0.0);\n }\n\n float u_Dash = v_Dash.x;\n float u_Gap = v_Dash.y;\n float u_DashOffset = v_Dash.z;\n if (u_Dash + u_Gap > 1.0) {\n float travel = mod(v_Travel + u_Gap * v_ScalingFactor * 0.5 + u_DashOffset, u_Dash * v_ScalingFactor + u_Gap * v_ScalingFactor) - (u_Gap * v_ScalingFactor * 0.5);\n float left = max(travel - 0.5, -0.5);\n float right = min(travel + 0.5, u_Gap * v_ScalingFactor + 0.5);\n alpha *= max(0.0, right - left);\n }\n\n if (u_IsPicking > 0.5) {\n vec3 pickingColor = u_PickingColor;\n if (pickingColor.x == 0.0 && pickingColor.y == 0.0 && pickingColor.z == 0.0) {\n discard;\n }\n outputColor = vec4(pickingColor, 1.0);\n } else {\n outputColor = u_StrokeColor;\n #ifdef USE_MAP\n outputColor = u_Color;\n #endif\n\n outputColor.a *= alpha * u_Opacity * u_StrokeOpacity;\n }\n}",this.material.defines=i(i({},this.material.defines),HP(lC))},e.prototype.createGeometry=function(e){var n=this,r=[],i=[],o=[],a=[],s=0,c=0;e.forEach((function(t){var e=yC(t,!1,12,n.calcSubpathIndex(t)),l=e.pointsBuffer,d=e.travelBuffer,h=e.instancedCount,p=t.parsedStyle,g=p.lineDash,m=p.lineDashOffset,v=p.isBillboard;a.push(g&&g[0]||0,g&&g[1]||0,m||0,v?1:0),s+=h;for(var y=0;y<l.length-12;y+=4)i.push(l[y],l[y+1],l[y+2],l[y+3],l[y+4],l[y+5],l[y+6],l[y+7],l[y+8],l[y+9],l[y+10],l[y+11],l[y+12],l[y+13],l[y+14],l[y+15]);o.push.apply(o,f([],u(d),!1)),r.push(0+c,2+c,1+c,0+c,3+c,2+c,4+c,6+c,5+c,4+c,7+c,6+c,4+c,7+c,8+c),c+=9})),i.length&&(this.geometry.setVertexBuffer({bufferIndex:cC.PACKED,byteStride:64,stepMode:fO.INSTANCE,attributes:[{format:SO.F32_RGB,bufferByteOffset:0,location:lC.PREV,divisor:1},{format:SO.F32_RGB,bufferByteOffset:16,location:lC.POINT1,divisor:1},{format:SO.F32_R,bufferByteOffset:28,location:lC.VERTEX_JOINT,divisor:1},{format:SO.F32_RGB,bufferByteOffset:32,location:lC.POINT2,divisor:1},{format:SO.F32_RGB,bufferByteOffset:48,location:lC.NEXT,divisor:1}],data:new Float32Array(i)}),this.geometry.setVertexBuffer({bufferIndex:cC.VERTEX_NUM,byteStride:4,stepMode:fO.INSTANCE,attributes:[{format:SO.F32_R,bufferByteOffset:0,byteStride:4,location:lC.VERTEX_NUM,divisor:0}],data:new Float32Array([0,1,2,3,4,5,6,7,8])}),this.geometry.setVertexBuffer({bufferIndex:cC.TRAVEL,byteStride:4,stepMode:fO.INSTANCE,attributes:[{format:SO.F32_R,bufferByteOffset:0,byteStride:4,location:lC.TRAVEL,divisor:1}],data:new Float32Array(o)}),this.divisor=s/e.length,this.geometry.setVertexBuffer({bufferIndex:cC.DASH,byteStride:16,stepMode:fO.INSTANCE,attributes:[{format:SO.F32_RGBA,bufferByteOffset:0,location:lC.DASH,divisor:this.divisor}],data:new Float32Array(a)}),t.prototype.createGeometry.call(this,e),this.geometry.vertexCount=15,this.geometry.instancedCount=s,this.geometry.setIndexBuffer(new Uint32Array(r)))},e.prototype.updateAttribute=function(e,n,r,i){var o=this;if(t.prototype.updateAttribute.call(this,e,n,r,i),this.updateBatchedAttribute(e,n,r,i),"r"===r||"rx"===r||"ry"===r||"width"===r||"height"===r||"radius"===r||"x1"===r||"y1"===r||"x2"===r||"y2"===r||"points"===r||"path"===r||"lineJoin"===r||"lineCap"===r||"markerStartOffset"===r||"markerEndOffset"===r||"markerStart"===r||"markerEnd"===r){var a=[],s=[],c=0;e.forEach((function(t){var e=yC(t,!1,12,o.calcSubpathIndex(t)),n=e.pointsBuffer,r=e.travelBuffer,i=e.instancedCount;c=i;for(var l=0;l<n.length-12;l+=4)a.push(n[l],n[l+1],n[l+2],n[l+3],n[l+4],n[l+5],n[l+6],n[l+7],n[l+8],n[l+9],n[l+10],n[l+11],n[l+12],n[l+13],n[l+14],n[l+15]);s.push.apply(s,f([],u(r),!1))})),this.geometry.updateVertexBuffer(cC.PACKED,lC.PREV,n*c,new Uint8Array(new Float32Array(a).buffer)),this.geometry.updateVertexBuffer(cC.TRAVEL,lC.TRAVEL,n,new Uint8Array(new Float32Array(s).buffer))}else if("lineDashOffset"===r||"lineDash"===r||"isBillboard"===r){var l=[];e.forEach((function(t){var e=t.parsedStyle,n=e.lineDash,r=e.lineDashOffset,i=e.isBillboard;l.push(n&&n[0]||0,n&&n[1]||0,r||0,i?1:0)})),this.geometry.updateVertexBuffer(cC.DASH,cC.DASH,n,new Uint8Array(new Float32Array(l).buffer))}},e}(tC);!function(t){t[t.NONE=0]="NONE",t[t.FILL=1]="FILL",t[t.JOINT_BEVEL=4]="JOINT_BEVEL",t[t.JOINT_MITER=8]="JOINT_MITER",t[t.JOINT_ROUND=12]="JOINT_ROUND",t[t.JOINT_CAP_BUTT=16]="JOINT_CAP_BUTT",t[t.JOINT_CAP_SQUARE=18]="JOINT_CAP_SQUARE",t[t.JOINT_CAP_ROUND=20]="JOINT_CAP_ROUND",t[t.FILL_EXPAND=24]="FILL_EXPAND",t[t.CAP_BUTT=32]="CAP_BUTT",t[t.CAP_SQUARE=64]="CAP_SQUARE",t[t.CAP_ROUND=96]="CAP_ROUND",t[t.CAP_BUTT2=128]="CAP_BUTT2"}(pC||(pC={}));var mC=3,vC=4;function yC(t,e,n,r){var i;void 0===e&&(e=!1),void 0===r&&(r=0);var o=t.parsedStyle,a=o.lineCap,s=o.lineJoin,c=t.parsedStyle,l=c.defX,d=c.defY,h=t.parsedStyle,p=h.markerStart,g=h.markerEnd,m=h.markerStartOffset,v=h.markerEndOffset,y=[],b=[];if(t.nodeName===Yn.POLYLINE||t.nodeName===Yn.POLYGON){var E=t.parsedStyle.points.points,x=E.length,M=0,A=0,T=0,O=0,R=0,P=void 0,C=void 0;if(p&&hs(p)&&m&&(P=E[1][0]-E[0][0],C=E[1][1]-E[0][1],R=Math.atan2(C,P),M=Math.cos(R)*(m||0),A=Math.sin(R)*(m||0)),g&&hs(g)&&v&&(P=E[x-2][0]-E[x-1][0],C=E[x-2][1]-E[x-1][1],R=Math.atan2(C,P),T=Math.cos(R)*(v||0),O=Math.sin(R)*(v||0)),y[0]=E.reduce((function(t,e,n){var r=0,i=0;return 0===n?(r=M,i=A):n===x-1&&(r=T,i=O),t.push(e[0]-l+r,e[1]-d+i,e[2]||0),t}),[]),t.nodeName===Yn.POLYGON){if(e)return b=AO(y[0],[],3),{pointsBuffer:y[0],travelBuffer:[],triangles:b,instancedCount:Math.round(y[0].length/mC)};y[0].push(y[0][0],y[0][1],y[0][2]||0),(i=y[0]).push.apply(i,f([],u(_C(y[0][0],y[0][1],y[0][2]||0,y[0][3],y[0][4],y[0][5]||0)),!1))}}else if(t.nodeName===Yn.PATH||t.nodeName===Yn.CIRCLE||t.nodeName===Yn.ELLIPSE||t.nodeName===Yn.RECT){var w=void 0;if(t.nodeName!==Yn.PATH){if(w=so(io(t,S(_()))),l=w.rect.x,d=w.rect.y,t.nodeName===Yn.RECT){var N=t.parsedStyle,I=N.width,k=N.height;I<0&&(l+=w.rect.width),k<0&&(d+=w.rect.height)}}else w=t.parsedStyle.path;var L=w.absolutePath,D=w.segments,B=0,F=0,U=0,j=0;R=0,P=void 0,C=void 0;if(p&&hs(p)&&m){var G=u(p.parentNode.getStartTangent(),2),W=G[0],z=G[1];P=W[0]-z[0],C=W[1]-z[1],R=Math.atan2(C,P),B=Math.cos(R)*(m||0),F=Math.sin(R)*(m||0)}if(g&&hs(g)&&v){var V=u(g.parentNode.getEndTangent(),2);W=V[0],z=V[1];P=W[0]-z[0],C=W[1]-z[1],R=Math.atan2(C,P),U=Math.cos(R)*(v||0),j=Math.sin(R)*(v||0)}var H=-1,X=-1;if(L.forEach((function(e,r){var i,o=u(e),a=o[0],s=o.slice(1),c=L[r+1],h=0===r&&(0!==B||0!==F),p=(r===L.length-1||c&&("M"===c[0]||"Z"===c[0]))&&0!==U&&0!==j;if("M"===a)X++,y[X]=[],H=y[X].length,h?y[X].push(s[0]-l+B,s[1]-d+F,0,s[0]-l,s[1]-d,0):y[X].push(s[0]-l,s[1]-d,0);else if("L"===a)p?y[X].push(s[0]-l+U,s[1]-d+j,0):y[X].push(s[0]-l,s[1]-d,0);else if("Q"===a)aC(s[0]-l,s[1]-d,s[2]-l,s[3]-d,y[X],n),p&&y[X].push(s[2]-l+U,s[3]-d+j,0);else if("A"===a){for(var g=u(D[r].prePoint,2),m=Xt(g[0],g[1],s[0],s[1],s[2],s[3],s[4],s[5],s[6],void 0),v=0;v<m.length;v+=6)sC(m[v]-l,m[v+1]-d,m[v+2]-l,m[v+3]-d,m[v+4]-l,m[v+5]-d,y[X],n);p&&y[X].push(s[5]-l+U,s[6]-d+j,0)}else if("C"===a)sC(s[0]-l,s[1]-d,s[2]-l,s[3]-d,s[4]-l,s[5]-d,y[X],n),p&&y[X].push(s[4]-l+U,s[5]-d+j,0);else if("Z"===a&&(t.nodeName===Yn.PATH||t.nodeName===Yn.RECT)){var _=1e-4;(Math.abs(y[X][y[X].length-2]-y[X][H])>_||Math.abs(y[X][y[X].length-1]-y[X][H+1])>_)&&y[X].push(y[X][H],y[X][H+1],0),(i=y[X]).push.apply(i,f([],u(_C(y[X][H],y[X][H+1],y[X][H+2],y[X][H+3],y[X][H+4],y[X][H+5])),!1))}})),e)return{pointsBuffer:J=y[r],travelBuffer:[],triangles:b=AO(J,[],3),instancedCount:Math.round(J.length/mC)}}var Y=function(t){var e;switch(t){case"bevel":e=pC.JOINT_BEVEL;break;case"round":e=pC.JOINT_ROUND;break;default:e=pC.JOINT_MITER}return e}(s),$=function(t){var e;switch(t){case"square":e=pC.CAP_SQUARE;break;case"round":e=pC.CAP_ROUND;break;default:e=pC.CAP_BUTT}return e}(a),q=$;$===pC.CAP_ROUND&&(q=pC.JOINT_CAP_ROUND),$===pC.CAP_BUTT&&(q=pC.JOINT_CAP_BUTT),$===pC.CAP_SQUARE&&(q=pC.JOINT_CAP_SQUARE);for(var K=y[r],Z=(Math.round(0/mC)+2)*vC,Q=0,J=[],tt=[],et=0;et<K.length;et+=mC)et>1&&(Q+=Math.sqrt(Math.pow(K[et]-K[et-mC],2)+Math.pow(K[et+1]-K[et+1-mC],2)+Math.pow(K[et+2]-K[et+2-mC],2))),tt.push(Q),J[Z++]=K[et],J[Z++]=K[et+1],J[Z++]=K[et+2]||0,J[Z]=Y,0==et&&$!==pC.CAP_ROUND&&(J[Z]+=$),et+2*mC>=K.length?J[Z]+=q-Y:et+mC>=K.length&&(J[Z]=0),Z++;return J[Z++]=K[K.length-6],J[Z++]=K[K.length-5],J[Z++]=K[K.length-4]||0,J[Z++]=0,J[0]=K[0],J[1]=K[1],J[2]=K[2]||0,J[3]=0,J[4]=K[3],J[5]=K[4],J[6]=K[5]||0,J[7]=$===pC.CAP_ROUND?$:0,{pointsBuffer:J,travelBuffer:tt,triangles:b,instancedCount:Math.round(K.length/mC)}}function _C(t,e,n,r,i,o){void 0===r&&(r=t),void 0===i&&(i=e),void 0===o&&(o=n);var a=[r-t,i-e,o-n],s=.01;return[t+a[0]*s,e+a[1]*s,n+a[2]*s]}var bC,EC,xC=function(t){function e(e,n,r,i,o,a,s){var c=t.call(this,e,n,r,i,o,a,s)||this;return c.renderHelper=e,c.texturePool=n,c.lightPool=r,c.mergeAnchorIntoModelMatrix=!0,c.trianglesHash=[[],[]],c.trianglesHash=c.calcSegmentNum(i),c}return r(e,t),e.prototype.calcSegmentNum=function(t){var e=yC(t,!0,12,this.calcSubpathIndex(t));return[e.triangles,e.pointsBuffer]},e.prototype.calcSubpathIndex=function(t){return t.nodeName===Yn.PATH?this.index:0},e.prototype.compareTrianglesHash=function(t){var e=u(this.trianglesHash,2),n=e[0],r=e[1],i=u(t,2),o=i[0],a=i[1];return n.length===o.length&&r.length===a.length&&(!n.some((function(t,e){return t!==o[e]}))&&!r.some((function(t,e){return t!==a[e]})))},e.prototype.shouldMerge=function(e,n){if(!t.prototype.shouldMerge.call(this,e,n))return!1;if(this.index!==n)return!1;var r=this.calcSegmentNum(e);return this.compareTrianglesHash(r)},e.prototype.createGeometry=function(e){var n=this,r=[],i=[],o=[],a=0;e.forEach((function(t,e){var s=yC(t,!0,12,n.calcSubpathIndex(t)),c=s.triangles,l=s.pointsBuffer;if(c.length){var d=t.getGeometryBounds().halfExtents,h=[];l.forEach((function(t,e){e%3!=2&&h.push(t/d[e%3]/2)})),a+=i.length/3,i.push.apply(i,f([],u(l),!1)),o.push.apply(o,f([],u(h),!1)),r.push.apply(r,f([],u(c.map((function(t){return t+a}))),!1))}})),i.length&&(t.prototype.createGeometry.call(this,e),this.geometry.setVertexBuffer({bufferIndex:$P.POSITION,byteStride:12,stepMode:fO.VERTEX,attributes:[{format:SO.F32_RGB,bufferByteOffset:0,location:qP.POSITION}],data:new Float32Array(i)}),this.geometry.setVertexBuffer({bufferIndex:$P.UV,byteStride:8,stepMode:fO.VERTEX,attributes:[{format:SO.F32_RG,bufferByteOffset:0,location:qP.UV}],data:new Float32Array(o)}),this.geometry.vertexCount=r.length/e.length,this.geometry.setIndexBuffer(new Uint32Array(r)))},e.prototype.createMaterial=function(t){this.material.vertexShader="#define GLSLIFY 1\nlayout(std140) uniform ub_SceneParams {\n mat4 u_ProjectionMatrix;\n mat4 u_ViewMatrix;\n vec3 u_CameraPosition;\n float u_DevicePixelRatio;\n vec2 u_Viewport;\n float u_IsOrtho;\n float u_IsPicking;\n};\n\nlayout(location = MODEL_MATRIX0) in vec4 a_ModelMatrix0;\nlayout(location = MODEL_MATRIX1) in vec4 a_ModelMatrix1;\nlayout(location = MODEL_MATRIX2) in vec4 a_ModelMatrix2;\nlayout(location = MODEL_MATRIX3) in vec4 a_ModelMatrix3;\nlayout(location = PACKED_COLOR) in vec4 a_PackedColor;\nlayout(location = PACKED_STYLE1) in vec4 a_StylePacked1;\nlayout(location = PACKED_STYLE2) in vec4 a_StylePacked2;\nlayout(location = PICKING_COLOR) in vec4 a_PickingColor;\n\nout vec4 v_PickingResult;\nout vec4 v_Color;\nout vec4 v_StrokeColor;\nout vec4 v_StylePacked1;\nout vec4 v_StylePacked2;\n\n#define COLOR_SCALE 1. / 255.\nvoid setPickingColor(vec3 pickingColor) {\n v_PickingResult.rgb = pickingColor * COLOR_SCALE;\n}\n\nvec2 unpack_float(const float packedValue) {\n int packedIntValue = int(packedValue);\n int v0 = packedIntValue / 256;\n return vec2(v0, packedIntValue - v0 * 256);\n}\nvec4 decode_color(const vec2 encodedColor) {\n return vec4(\n unpack_float(encodedColor[0]) / 255.0,\n unpack_float(encodedColor[1]) / 255.0\n );\n}\nvec4 project(vec4 pos, mat4 pm, mat4 vm, mat4 mm) {\n return pm * vm * mm * pos;\n}\n\nlayout(location = POSITION) in vec3 a_Position;\n#ifdef USE_UV\n layout(location = UV) in vec2 a_Uv;\n out vec2 v_Uv;\n#endif\n\nvoid main() {\n vec4 a_Color = decode_color(a_PackedColor.xy);\nvec4 a_StrokeColor = decode_color(a_PackedColor.zw);\n\nmat4 u_ModelMatrix = mat4(a_ModelMatrix0, a_ModelMatrix1, a_ModelMatrix2, a_ModelMatrix3);\nvec4 u_StrokeColor = a_StrokeColor;\nfloat u_Opacity = a_StylePacked1.x;\nfloat u_FillOpacity = a_StylePacked1.y;\nfloat u_StrokeOpacity = a_StylePacked1.z;\nfloat u_StrokeWidth = a_StylePacked1.w;\nfloat u_ZIndex = a_PickingColor.w;\nvec2 u_Anchor = a_StylePacked2.yz;\nfloat u_IncreasedLineWidthForHitTesting = a_StylePacked2.w;\n\nsetPickingColor(a_PickingColor.xyz);\n\nv_Color = a_Color;\nv_StrokeColor = a_StrokeColor;\nv_StylePacked1 = a_StylePacked1;\nv_StylePacked2 = a_StylePacked2;\n\n// #ifdef CLIPSPACE_NEAR_ZERO\n// gl_Position.z = (gl_Position.z + gl_Position.w) * 0.5;\n// #endif\n #ifdef USE_UV\n v_Uv = a_Uv;\n #ifdef VIEWPORT_ORIGIN_TL\n v_Uv.y = 1.0 - v_Uv.y;\n #endif\n#endif\n\n gl_Position = project(vec4(a_Position.xy, u_ZIndex, 1.0), u_ProjectionMatrix, u_ViewMatrix, u_ModelMatrix);\n}",this.material.fragmentShader="#define GLSLIFY 1\nlayout(std140) uniform ub_SceneParams {\n mat4 u_ProjectionMatrix;\n mat4 u_ViewMatrix;\n vec3 u_CameraPosition;\n float u_DevicePixelRatio;\n vec2 u_Viewport;\n float u_IsOrtho;\n float u_IsPicking;\n};\n\nin vec4 v_PickingResult;\nin vec4 v_Color;\nin vec4 v_StrokeColor;\nin vec4 v_StylePacked1;\nin vec4 v_StylePacked2;\n#ifdef USE_UV\n in vec2 v_Uv;\n#endif\n#ifdef USE_MAP\n uniform sampler2D u_Map;\n#endif\n\nout vec4 outputColor;\n\nvoid main(){\n vec4 u_Color = v_Color;\nvec4 u_StrokeColor = v_StrokeColor;\nfloat u_Opacity = v_StylePacked1.x;\nfloat u_FillOpacity = v_StylePacked1.y;\nfloat u_StrokeOpacity = v_StylePacked1.z;\nfloat u_StrokeWidth = v_StylePacked1.w;\nfloat u_Visible = v_StylePacked2.x;\nvec3 u_PickingColor = v_PickingResult.xyz;\n\nif (u_Visible < 0.5) {\n discard;\n}\n #ifdef USE_MAP\n #ifdef USE_PATTERN\n vec4 texelColor = texture(SAMPLER_2D(u_Map), v_Uv);\n u_Color = texelColor;\n #else\n vec4 texelColor = texture(SAMPLER_2D(u_Map), v_Uv);\n u_Color = texelColor;\n #endif\n#endif\n\n if (u_IsPicking > 0.5) {\n if (u_PickingColor.x == 0.0 && u_PickingColor.y == 0.0 && u_PickingColor.z == 0.0) {\n discard;\n }\n outputColor = vec4(u_PickingColor, 1.0);\n } else {\n outputColor = u_Color;\n\n outputColor.a = outputColor.a * u_Opacity * u_FillOpacity;\n }\n}",this.material.defines=i(i({},this.material.defines),{INSTANCED:!0})},e.prototype.updateAttribute=function(e,n,r,i){t.prototype.updateAttribute.call(this,e,n,r,i),this.updateBatchedAttribute(e,n,r,i)},e}(tC),MC=[0,-.5,0,0,0,1,-.5,1,1,0,1,.5,1,1,1,0,.5,0,0,1];!function(t){t[t.POINT=5]="POINT",t[t.CAP=6]="CAP",t[t.DASH=7]="DASH"}(bC||(bC={})),function(t){t[t.POSITION=8]="POSITION",t[t.UV=10]="UV",t[t.POINTA=9]="POINTA",t[t.POINTB=11]="POINTB",t[t.CAP=12]="CAP",t[t.DASH=13]="DASH"}(EC||(EC={}));var SC,AC,TC={butt:1,round:2,square:3},OC=function(t){function e(e,n,r,i,o,a,s){var c=t.call(this,e,n,r,i,o,a,s)||this;return c.renderHelper=e,c.texturePool=n,c.lightPool=r,c.gradientAttributeName="stroke",c}return r(e,t),e.isLine=function(t,e){if(t.nodeName===Yn.PATH){for(var n=t.parsedStyle.path.absolutePath,r=0,i=0,o=0;o<n.length;o++){if("M"===n[o][0]){if(r===e){i=o;break}r++}}if("M"===n[i][0]&&"L"===n[i+1][0]&&(void 0===n[i+2]||"M"===n[i+2][0]))return!0}else if(t.nodeName===Yn.POLYLINE){var a=t.parsedStyle.points.points,s=(a[1][0]-a[1][1])/(a[0][0]-a[0][1]);for(o=1;o<a.length-1;o++)if((a[o+1][0]-a[o+1][1])/(a[o][0]-a[o][1])!==s)return!1;return!0}return!1},e.prototype.shouldMerge=function(e,n){return!!t.prototype.shouldMerge.call(this,e,n)},e.prototype.createMaterial=function(t){this.material.vertexShader="#define GLSLIFY 1\nlayout(std140) uniform ub_SceneParams {\n mat4 u_ProjectionMatrix;\n mat4 u_ViewMatrix;\n vec3 u_CameraPosition;\n float u_DevicePixelRatio;\n vec2 u_Viewport;\n float u_IsOrtho;\n float u_IsPicking;\n};\n\nlayout(location = MODEL_MATRIX0) in vec4 a_ModelMatrix0;\nlayout(location = MODEL_MATRIX1) in vec4 a_ModelMatrix1;\nlayout(location = MODEL_MATRIX2) in vec4 a_ModelMatrix2;\nlayout(location = MODEL_MATRIX3) in vec4 a_ModelMatrix3;\nlayout(location = PACKED_COLOR) in vec4 a_PackedColor;\nlayout(location = PACKED_STYLE1) in vec4 a_StylePacked1;\nlayout(location = PACKED_STYLE2) in vec4 a_StylePacked2;\nlayout(location = PICKING_COLOR) in vec4 a_PickingColor;\n\nout vec4 v_PickingResult;\nout vec4 v_Color;\nout vec4 v_StrokeColor;\nout vec4 v_StylePacked1;\nout vec4 v_StylePacked2;\n\n#define COLOR_SCALE 1. / 255.\nvoid setPickingColor(vec3 pickingColor) {\n v_PickingResult.rgb = pickingColor * COLOR_SCALE;\n}\n\nvec2 unpack_float(const float packedValue) {\n int packedIntValue = int(packedValue);\n int v0 = packedIntValue / 256;\n return vec2(v0, packedIntValue - v0 * 256);\n}\nvec4 decode_color(const vec2 encodedColor) {\n return vec4(\n unpack_float(encodedColor[0]) / 255.0,\n unpack_float(encodedColor[1]) / 255.0\n );\n}\nvec4 project(vec4 pos, mat4 pm, mat4 vm, mat4 mm) {\n return pm * vm * mm * pos;\n}\n\nlayout(location = POSITION) in vec3 a_Position;\nlayout(location = POINTA) in vec3 a_PointA;\nlayout(location = POINTB) in vec3 a_PointB;\nlayout(location = CAP) in float a_Cap;\n#ifdef USE_UV\n layout(location = UV) in vec2 a_Uv;\n out vec2 v_Uv;\n#endif\nlayout(location = DASH) in vec4 a_Dash;\n\nout vec4 v_Dash;\nout vec2 v_Distance;\n\nbool isPerspectiveMatrix(mat4 m) {\n return m[ 2 ][ 3 ] == - 1.0;\n}\n\nvoid main() {\n vec4 a_Color = decode_color(a_PackedColor.xy);\nvec4 a_StrokeColor = decode_color(a_PackedColor.zw);\n\nmat4 u_ModelMatrix = mat4(a_ModelMatrix0, a_ModelMatrix1, a_ModelMatrix2, a_ModelMatrix3);\nvec4 u_StrokeColor = a_StrokeColor;\nfloat u_Opacity = a_StylePacked1.x;\nfloat u_FillOpacity = a_StylePacked1.y;\nfloat u_StrokeOpacity = a_StylePacked1.z;\nfloat u_StrokeWidth = a_StylePacked1.w;\nfloat u_ZIndex = a_PickingColor.w;\nvec2 u_Anchor = a_StylePacked2.yz;\nfloat u_IncreasedLineWidthForHitTesting = a_StylePacked2.w;\n\nsetPickingColor(a_PickingColor.xyz);\n\nv_Color = a_Color;\nv_StrokeColor = a_StrokeColor;\nv_StylePacked1 = a_StylePacked1;\nv_StylePacked2 = a_StylePacked2;\n\n// #ifdef CLIPSPACE_NEAR_ZERO\n// gl_Position.z = (gl_Position.z + gl_Position.w) * 0.5;\n// #endif\n #ifdef USE_UV\n v_Uv = a_Uv;\n #ifdef VIEWPORT_ORIGIN_TL\n v_Uv.y = 1.0 - v_Uv.y;\n #endif\n#endif\n\n float strokeWidth;\n if (u_IsPicking > 0.5) {\n strokeWidth = u_IncreasedLineWidthForHitTesting + u_StrokeWidth;\n } else {\n strokeWidth = u_StrokeWidth;\n }\n float clampedStrokeWidth = max(strokeWidth, 1.0);\n\n float isBillboard = a_Dash.w;\n if (isBillboard > 0.5) {\n // clip space\n vec4 clip0 = project(vec4(a_PointA, 1.0), u_ProjectionMatrix, u_ViewMatrix, u_ModelMatrix);\n vec4 clip1 = project(vec4(a_PointB, 1.0), u_ProjectionMatrix, u_ViewMatrix, u_ModelMatrix);\n // screen space\n vec2 screen0 = u_Viewport * (0.5 * clip0.xy / clip0.w + 0.5);\n vec2 screen1 = u_Viewport * (0.5 * clip1.xy / clip1.w + 0.5);\n vec2 xBasis = normalize(screen1 - screen0);\n vec2 yBasis = vec2(-xBasis.y, xBasis.x);\n vec2 pt0 = screen0 + clampedStrokeWidth * (a_Position.x * xBasis + a_Position.y * yBasis);\n vec2 pt1 = screen1 + clampedStrokeWidth * (a_Position.x * xBasis + a_Position.y * yBasis);\n vec2 pt = mix(pt0, pt1, a_Position.z);\n vec4 clip = mix(clip0, clip1, a_Position.z);\n gl_Position = vec4(clip.w * (2.0 * pt / u_Viewport - 1.0), clip.z, clip.w);\n } else {\n vec2 xBasis = a_PointB.xy - a_PointA.xy;\n vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));\n\n vec2 point = a_PointA.xy + xBasis * a_Position.x + yBasis * clampedStrokeWidth * a_Position.y;\n point = point - u_Anchor.xy * abs(xBasis);\n\n // round & square\n if (a_Cap > 1.0) {\n point += sign(a_Position.x - 0.5) * normalize(xBasis) * vec2(clampedStrokeWidth / 2.0);\n }\n gl_Position = project(vec4(point, u_ZIndex, 1.0), u_ProjectionMatrix, u_ViewMatrix, u_ModelMatrix);\n }\n\n float antialiasblur = 1.0 / strokeWidth;\n v_Distance = vec2(a_Position.y * 2.0, antialiasblur);\n v_Dash = vec4(a_Position.x, a_Dash.xyz);\n}",this.material.fragmentShader="#define GLSLIFY 1\nlayout(std140) uniform ub_SceneParams {\n mat4 u_ProjectionMatrix;\n mat4 u_ViewMatrix;\n vec3 u_CameraPosition;\n float u_DevicePixelRatio;\n vec2 u_Viewport;\n float u_IsOrtho;\n float u_IsPicking;\n};\n\nin vec4 v_PickingResult;\nin vec4 v_Color;\nin vec4 v_StrokeColor;\nin vec4 v_StylePacked1;\nin vec4 v_StylePacked2;\n#ifdef USE_UV\n in vec2 v_Uv;\n#endif\n#ifdef USE_MAP\n uniform sampler2D u_Map;\n#endif\n\nin vec4 v_Dash;\nin vec2 v_Distance;\n\nout vec4 outputColor;\n\nvoid main() {\n vec4 u_Color = v_Color;\nvec4 u_StrokeColor = v_StrokeColor;\nfloat u_Opacity = v_StylePacked1.x;\nfloat u_FillOpacity = v_StylePacked1.y;\nfloat u_StrokeOpacity = v_StylePacked1.z;\nfloat u_StrokeWidth = v_StylePacked1.w;\nfloat u_Visible = v_StylePacked2.x;\nvec3 u_PickingColor = v_PickingResult.xyz;\n\nif (u_Visible < 0.5) {\n discard;\n}\n #ifdef USE_MAP\n #ifdef USE_PATTERN\n vec4 texelColor = texture(SAMPLER_2D(u_Map), v_Uv);\n u_Color = texelColor;\n #else\n vec4 texelColor = texture(SAMPLER_2D(u_Map), v_Uv);\n u_Color = texelColor;\n #endif\n#endif\n\n if (u_IsPicking > 0.5) {\n if (u_PickingColor.x == 0.0 && u_PickingColor.y == 0.0 && u_PickingColor.z == 0.0) {\n discard;\n }\n outputColor = vec4(u_PickingColor, 1.0);\n } else {\n outputColor = u_StrokeColor;\n #ifdef USE_MAP\n outputColor = u_Color;\n #endif\n\n float blur;\n if (v_Distance.y < 1.0) {\n blur = smoothstep(0.0, v_Distance.y, 1.0 - abs(v_Distance.x));\n } else {\n blur = 1.0 / v_Distance.y;\n }\n float u_dash_offset = v_Dash.y;\n float u_dash_array = v_Dash.z;\n float u_dash_ratio = v_Dash.w;\n\n outputColor.a = outputColor.a\n * blur\n * u_Opacity * u_StrokeOpacity\n * (u_dash_array < 1.0 ? (ceil((u_dash_array * u_dash_ratio) - mod(v_Dash.x + u_dash_offset, u_dash_array))) : 1.0);\n }\n}",this.material.defines=i(i({},this.material.defines),HP(EC))},e.prototype.calcSubpathIndex=function(t){if(t.nodeName===Yn.PATH){var e=this.drawcallCtors.filter((function(t){return t===xC})).length;return this.index-e}return 0},e.prototype.createGeometry=function(e){var n=this;t.prototype.createGeometry.call(this,e);var r=[],i=[],o=[],a=[],s=0;e.forEach((function(t){var e,c;if(t.nodeName===Yn.LINE)e=t.parsedStyle,c=t.getTotalLength();else if(t.nodeName===Yn.POLYLINE){var l=t.parsedStyle,u=l.points.points,f=l.defX,d=l.defY,h=l.lineCap,p=l.lineDash,g=l.lineDashOffset,m=l.markerStart,v=l.markerEnd,y=l.markerStartOffset,_=l.markerEndOffset,b=l.isBillboard;e={x1:u[0][0],y1:u[0][1],x2:u[u.length-1][0],y2:u[u.length-1][1],z1:0,z2:0,defX:f,defY:d,lineCap:h,lineDash:p,lineDashOffset:g,isBillboard:b,markerStart:m,markerEnd:v,markerStartOffset:y,markerEndOffset:_},c=t.getTotalLength()}else if(t.nodeName===Yn.PATH){for(var E=t.parsedStyle,x=E.path.absolutePath,M=E.defX,S=E.defY,A=E.lineCap,T=(p=E.lineDash,g=E.lineDashOffset,m=E.markerStart,v=E.markerEnd,y=E.markerStartOffset,_=E.markerEndOffset,E.isBillboard),O=0,R=0,P=n.calcSubpathIndex(t),C=0;C<x.length;C++){if("M"===x[C][0]){if(O===P){R=C;break}O++}}e={x1:x[R][1],y1:x[R][2],x2:x[R+1][1],y2:x[R+1][2],z1:0,z2:0,defX:M,defY:S,lineCap:A,lineDash:p,lineDashOffset:g,isBillboard:T,markerStart:m,markerEnd:v,markerStartOffset:y,markerEndOffset:_},c=t.getTotalLength()}var w=e.x1,N=e.y1,I=e.x2,k=e.y2,L=e.z1,D=e.z2,B=e.defX,F=e.defY,U=e.lineCap,j=e.isBillboard,G=n.calcOffset(e),W=G.startOffsetX,z=G.startOffsetY,V=G.endOffsetX,H=G.endOffsetY,X=n.calcDash(e,c),Y=X.dashOffset,$=X.dashSegmentPercent,q=X.dashRatioInEachSegment;i.push(TC[U]),o.push(Y,$,q,j?1:0),r.push(w-B+W,N-F+z,L,I-B+V,k-F+H,D),a.push(0+s,2+s,1+s,0+s,3+s,2+s),s+=4})),this.geometry.setIndexBuffer(new Uint32Array(a)),this.geometry.vertexCount=6,this.geometry.setVertexBuffer({bufferIndex:$P.POSITION,byteStride:20,stepMode:fO.INSTANCE,attributes:[{format:SO.F32_RGB,bufferByteOffset:0,location:EC.POSITION,divisor:0},{format:SO.F32_RG,bufferByteOffset:12,location:EC.UV,divisor:0}],data:new Float32Array(MC)}),this.geometry.setVertexBuffer({bufferIndex:bC.POINT,byteStride:24,stepMode:fO.INSTANCE,attributes:[{format:SO.F32_RGB,bufferByteOffset:0,location:EC.POINTA,divisor:1},{format:SO.F32_RGB,bufferByteOffset:12,location:EC.POINTB,divisor:1}],data:new Float32Array(r)}),this.geometry.setVertexBuffer({bufferIndex:bC.CAP,byteStride:4,stepMode:fO.INSTANCE,attributes:[{format:SO.F32_R,bufferByteOffset:0,location:EC.CAP,divisor:1}],data:new Float32Array(i)}),this.geometry.setVertexBuffer({bufferIndex:bC.DASH,byteStride:16,stepMode:fO.INSTANCE,attributes:[{format:SO.F32_RGBA,bufferByteOffset:0,location:EC.DASH,divisor:1}],data:new Float32Array(o)})},e.prototype.updateAttribute=function(e,n,r,i){var o=this;if(t.prototype.updateAttribute.call(this,e,n,r,i),this.updateBatchedAttribute(e,n,r,i),"x1"===r||"y1"===r||"x2"===r||"y2"===r||"z1"===r||"z2"===r||"markerStartOffset"===r||"markerEndOffset"===r||"markerStart"===r||"markerEnd"===r||"points"===r||"path"===r){var a=[];e.forEach((function(t){var e;if(t.nodeName===Yn.LINE)e=t.parsedStyle;else if(t.nodeName===Yn.POLYLINE){var n=t.parsedStyle,r=n.points.points,i=n.defX,s=n.defY,c=n.lineCap,l=n.markerStart,u=n.markerEnd,f=n.markerStartOffset,d=n.markerEndOffset,h=n.isBillboard;e={x1:r[0][0],y1:r[0][1],x2:r[r.length-1][0],y2:r[r.length-1][1],z1:0,z2:0,defX:i,defY:s,lineCap:c,isBillboard:h,markerStart:l,markerEnd:u,markerStartOffset:f,markerEndOffset:d}}else if(t.nodeName===Yn.PATH){var p=t.parsedStyle,g=p.path.absolutePath,m=p.defX,v=p.defY;c=p.lineCap,l=p.markerStart,u=p.markerEnd,f=p.markerStartOffset,d=p.markerEndOffset,h=p.isBillboard;e={x1:g[0][1],y1:g[0][2],x2:g[1][1],y2:g[1][2],z1:0,z2:0,defX:m,defY:v,lineCap:c,isBillboard:h,markerStart:l,markerEnd:u,markerStartOffset:f,markerEndOffset:d}}var y=e.x1,_=e.y1,b=e.x2,E=e.y2,x=e.z1,M=e.z2,S=e.defX,A=e.defY,T=o.calcOffset(e),O=T.startOffsetX,R=T.startOffsetY,P=T.endOffsetX,C=T.endOffsetY;a.push(y-S+O,_-A+R,x,b-S+P,E-A+C,M)})),this.geometry.updateVertexBuffer(bC.POINT,EC.POINTA,n,new Uint8Array(new Float32Array(a).buffer))}else if("lineDashOffset"===r||"lineDash"===r||"isBillboard"===r){var s=[];e.forEach((function(t){var e=t.getTotalLength(),n=o.calcDash(t.parsedStyle,e),r=n.dashOffset,i=n.dashSegmentPercent,a=n.dashRatioInEachSegment;s.push(r,i,a,t.parsedStyle.isBillboard?1:0)})),this.geometry.updateVertexBuffer(bC.DASH,EC.DASH,n,new Uint8Array(new Float32Array(s).buffer))}else if("lineCap"===r){var c=[];e.forEach((function(t){var e=t.parsedStyle.lineCap;c.push(TC[e])})),this.geometry.updateVertexBuffer(bC.CAP,EC.CAP,n,new Uint8Array(new Float32Array(c).buffer))}},e.prototype.calcOffset=function(t){var e,n,r=t.x1,i=t.y1,o=t.x2,a=t.y2,s=t.markerStart,c=t.markerEnd,l=t.markerStartOffset,u=t.markerEndOffset,f=0,d=0,h=0,p=0,g=0;return s&&hs(s)&&l&&(e=o-r,n=a-i,g=Math.atan2(n,e),f=Math.cos(g)*(l||0),d=Math.sin(g)*(l||0)),c&&hs(c)&&u&&(e=r-o,n=i-a,g=Math.atan2(n,e),h=Math.cos(g)*(u||0),p=Math.sin(g)*(u||0)),{startOffsetX:f,startOffsetY:d,endOffsetX:h,endOffsetY:p}},e.prototype.calcDash=function(t,e){var n=t.lineDash,r=t.lineDashOffset,i=0,o=1,a=0;if(n&&n.length){i=(r||0)/e;var s=n.reduce((function(t,e){return t+e}),0);0===s?(o=1,a=0):(o=s/e,a=n[1]/s)}return{dashOffset:i,dashSegmentPercent:o,dashRatioInEachSegment:a}},e}(tC);!function(t){t[t.PACKED_STYLE=5]="PACKED_STYLE"}(SC||(SC={})),function(t){t[t.PACKED_STYLE3=12]="PACKED_STYLE3"}(AC||(AC={}));var RC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.shouldMerge=function(e,n){return!!t.prototype.shouldMerge.call(this,e,n)&&this.instance.parsedStyle.img===e.parsedStyle.img},e.prototype.createMaterial=function(t){var e=t[0].parsedStyle.img;this.material.defines=i(i({},this.material.defines),HP(AC)),this.material.vertexShader="#define GLSLIFY 1\nlayout(std140) uniform ub_SceneParams {\n mat4 u_ProjectionMatrix;\n mat4 u_ViewMatrix;\n vec3 u_CameraPosition;\n float u_DevicePixelRatio;\n vec2 u_Viewport;\n float u_IsOrtho;\n float u_IsPicking;\n};\nlayout(location = MODEL_MATRIX0) in vec4 a_ModelMatrix0;\nlayout(location = MODEL_MATRIX1) in vec4 a_ModelMatrix1;\nlayout(location = MODEL_MATRIX2) in vec4 a_ModelMatrix2;\nlayout(location = MODEL_MATRIX3) in vec4 a_ModelMatrix3;\nlayout(location = PACKED_COLOR) in vec4 a_PackedColor;\nlayout(location = PACKED_STYLE1) in vec4 a_StylePacked1;\nlayout(location = PACKED_STYLE2) in vec4 a_StylePacked2;\nlayout(location = PICKING_COLOR) in vec4 a_PickingColor;\n\nout vec4 v_PickingResult;\nout vec4 v_Color;\nout vec4 v_StrokeColor;\nout vec4 v_StylePacked1;\nout vec4 v_StylePacked2;\n\n#define COLOR_SCALE 1. / 255.\nvoid setPickingColor(vec3 pickingColor) {\n v_PickingResult.rgb = pickingColor * COLOR_SCALE;\n}\n\nvec2 unpack_float(const float packedValue) {\n int packedIntValue = int(packedValue);\n int v0 = packedIntValue / 256;\n return vec2(v0, packedIntValue - v0 * 256);\n}\nvec4 decode_color(const vec2 encodedColor) {\n return vec4(\n unpack_float(encodedColor[0]) / 255.0,\n unpack_float(encodedColor[1]) / 255.0\n );\n}\nvec4 project(vec4 pos, mat4 pm, mat4 vm, mat4 mm) {\n return pm * vm * mm * pos;\n}\n\nbool isPerspectiveMatrix(mat4 m) {\n return m[2][3] == -1.0;\n}\n\nvec4 billboard(vec2 offset, float rotation, bool isSizeAttenuation, mat4 pm, mat4 vm, mat4 mm) {\n vec4 mvPosition = vm * mm * vec4(0.0, 0.0, 0.0, 1.0);\n vec2 scale;\n scale.x = length(vec3(mm[0][0], mm[0][1], mm[0][2]));\n scale.y = length(vec3(mm[1][0], mm[1][1], mm[1][2]));\n\n if (isSizeAttenuation) {\n bool isPerspective = isPerspectiveMatrix(pm);\n if (isPerspective) {\n scale *= -mvPosition.z / 250.0;\n }\n }\n\n vec2 alignedPosition = offset * scale;\n vec2 rotatedPosition;\n rotatedPosition.x = cos(rotation) * alignedPosition.x - sin(rotation) * alignedPosition.y;\n rotatedPosition.y = sin(rotation) * alignedPosition.x + cos(rotation) * alignedPosition.y;\n\n mvPosition.xy += rotatedPosition;\n return pm * mvPosition;\n}\n\nlayout(location = POSITION) in vec2 a_Size;\nlayout(location = PACKED_STYLE3) in vec4 a_StylePacked3;\n\n#ifdef USE_UV\n layout(location = UV) in vec2 a_Uv;\n out vec2 v_Uv;\n#endif\n\nvoid main() {\n vec4 a_Color = decode_color(a_PackedColor.xy);\nvec4 a_StrokeColor = decode_color(a_PackedColor.zw);\n\nmat4 u_ModelMatrix = mat4(a_ModelMatrix0, a_ModelMatrix1, a_ModelMatrix2, a_ModelMatrix3);\nvec4 u_StrokeColor = a_StrokeColor;\nfloat u_Opacity = a_StylePacked1.x;\nfloat u_FillOpacity = a_StylePacked1.y;\nfloat u_StrokeOpacity = a_StylePacked1.z;\nfloat u_StrokeWidth = a_StylePacked1.w;\nfloat u_ZIndex = a_PickingColor.w;\nvec2 u_Anchor = a_StylePacked2.yz;\nfloat u_IncreasedLineWidthForHitTesting = a_StylePacked2.w;\n\nsetPickingColor(a_PickingColor.xyz);\n\nv_Color = a_Color;\nv_StrokeColor = a_StrokeColor;\nv_StylePacked1 = a_StylePacked1;\nv_StylePacked2 = a_StylePacked2;\n\n// #ifdef CLIPSPACE_NEAR_ZERO\n// gl_Position.z = (gl_Position.z + gl_Position.w) * 0.5;\n// #endif\n\n vec2 offset = (a_Uv - u_Anchor.xy) * a_Size;\n\n bool isBillboard = a_StylePacked3.x > 0.5;\n if (isBillboard) {\n float rotation = a_StylePacked3.y;\n bool isSizeAttenuation = a_StylePacked3.z > 0.5;\n gl_Position = billboard(offset, rotation, isSizeAttenuation, u_ProjectionMatrix, u_ViewMatrix, u_ModelMatrix);\n } else {\n gl_Position = project(vec4(offset, u_ZIndex, 1.0), u_ProjectionMatrix, u_ViewMatrix, u_ModelMatrix);\n }\n\n #ifdef USE_UV\n v_Uv = a_Uv;\n #ifdef VIEWPORT_ORIGIN_TL\n v_Uv.y = 1.0 - v_Uv.y;\n #endif\n#endif\n\n}",this.material.fragmentShader="#define GLSLIFY 1\nlayout(std140) uniform ub_SceneParams {\n mat4 u_ProjectionMatrix;\n mat4 u_ViewMatrix;\n vec3 u_CameraPosition;\n float u_DevicePixelRatio;\n vec2 u_Viewport;\n float u_IsOrtho;\n float u_IsPicking;\n};\n\nin vec4 v_PickingResult;\nin vec4 v_Color;\nin vec4 v_StrokeColor;\nin vec4 v_StylePacked1;\nin vec4 v_StylePacked2;\n#ifdef USE_UV\n in vec2 v_Uv;\n#endif\n#ifdef USE_MAP\n uniform sampler2D u_Map;\n#endif\n\nout vec4 outputColor;\n\nvoid main() {\n vec4 u_Color = v_Color;\nvec4 u_StrokeColor = v_StrokeColor;\nfloat u_Opacity = v_StylePacked1.x;\nfloat u_FillOpacity = v_StylePacked1.y;\nfloat u_StrokeOpacity = v_StylePacked1.z;\nfloat u_StrokeWidth = v_StylePacked1.w;\nfloat u_Visible = v_StylePacked2.x;\nvec3 u_PickingColor = v_PickingResult.xyz;\n\nif (u_Visible < 0.5) {\n discard;\n}\n #ifdef USE_MAP\n #ifdef USE_PATTERN\n vec4 texelColor = texture(SAMPLER_2D(u_Map), v_Uv);\n u_Color = texelColor;\n #else\n vec4 texelColor = texture(SAMPLER_2D(u_Map), v_Uv);\n u_Color = texelColor;\n #endif\n#endif\n\n if (u_IsPicking > 0.5) {\n if (u_PickingColor.x == 0.0 && u_PickingColor.y == 0.0 && u_PickingColor.z == 0.0) {\n discard;\n }\n\n // TODO: pointer-events: non-transparent-pixel\n // if (u_Color.x == 0.0 && u_Color.y == 0.0 && u_Color.z == 0.0) {\n // discard;\n // }\n outputColor = vec4(u_PickingColor, 1.0);\n } else {\n outputColor = u_Color;\n outputColor.a = outputColor.a * u_Opacity;\n }\n}";var n=this.texturePool.getOrCreateTexture(this.context.device,e);this.material.setUniforms({u_Map:n})},e.prototype.createGeometry=function(e){t.prototype.createGeometry.call(this,e);var n=[],r=[];e.forEach((function(t,e){var i=t.parsedStyle,o=i.width,a=i.height,s=i.isBillboard,c=i.billboardRotation,l=i.isSizeAttenuation;n.push(o,a),r.push(s?1:0,null!=c?c:0,l?1:0,0)})),this.geometry.setIndexBuffer(new Uint32Array([0,2,1,0,3,2])),this.geometry.vertexCount=6,this.geometry.setVertexBuffer({bufferIndex:$P.POSITION,byteStride:8,stepMode:fO.INSTANCE,attributes:[{format:SO.F32_RG,bufferByteOffset:0,location:qP.POSITION}],data:new Float32Array(n)}),this.geometry.setVertexBuffer({bufferIndex:SC.PACKED_STYLE,byteStride:16,stepMode:fO.INSTANCE,attributes:[{format:SO.F32_RGBA,bufferByteOffset:0,location:AC.PACKED_STYLE3,divisor:1}],data:new Float32Array(r)}),this.geometry.setVertexBuffer({bufferIndex:$P.UV,byteStride:8,stepMode:fO.VERTEX,attributes:[{format:SO.F32_RG,bufferByteOffset:0,location:qP.UV}],data:new Float32Array([0,0,1,0,1,1,0,1])})},e.prototype.updateAttribute=function(e,n,r,i){if(t.prototype.updateAttribute.call(this,e,n,r,i),this.updateBatchedAttribute(e,n,r,i),"width"===r||"height"===r||"z"===r){var o=[];e.forEach((function(t){var e=t.parsedStyle,n=e.width,r=e.height;o.push(n,r)})),this.geometry.updateVertexBuffer($P.POSITION,qP.POSITION,n,new Uint8Array(new Float32Array(o).buffer))}else if("isBillboard"===r||"billboardRotation"===r||"isSizeAttenuation"===r){var a=[];e.forEach((function(t){var e=t.parsedStyle,n=e.isBillboard,r=e.billboardRotation,i=e.isSizeAttenuation;a.push(n?1:0,null!=r?r:0,i?1:0,0)})),this.geometry.updateVertexBuffer(SC.PACKED_STYLE,AC.PACKED_STYLE3,n,new Uint8Array(new Float32Array(a).buffer))}else if("img"===r){var s=this.texturePool.getOrCreateTexture(this.context.device,i);this.material.setUniforms({u_Map:s})}},e}(tC);function PC(t,e,n,r){var i=e.width,o=e.height;if(r){if(r.length!==i*o*n)throw new RangeError("mismatched image size")}else r=new Uint8Array(i*o*n);return t.width=i,t.height=o,t.data=r,t}function CC(t,e,n,r,i,o){if(0===i.width||0===i.height)return e;if(i.width>t.width||i.height>t.height||n.x>t.width-i.width||n.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||r.x>e.width-i.width||r.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,c=0;c<i.height;c++)for(var l=((n.y+c)*t.width+n.x)*o,u=((r.y+c)*e.width+r.x)*o,f=0;f<i.width*o;f++)s[u+f]=a[l+f];return e}var wC=function(){function t(t,e){PC(this,t,1,e)}return t.prototype.resize=function(t){!function(t,e,n){var r=e.width,i=e.height;if(r!==t.width||i!==t.height){var o=PC({},{width:r,height:i},n);CC(t,o,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,r),height:Math.min(t.height,i)},n),t.width=r,t.height=i,t.data=o.data}}(this,t,1)},t.prototype.clone=function(){return new t({width:this.width,height:this.height},new Uint8Array(this.data))},t.copy=function(t,e,n,r,i){CC(t,e,n,r,i,1)},t}();var NC=function(t){var e={},n=[];for(var r in t){var i=t[r],o=e[r]={};for(var a in i)if((h=i[+a])&&0!==h.bitmap.width&&0!==h.bitmap.height){var s={x:0,y:0,w:h.bitmap.width+2,h:h.bitmap.height+2};n.push(s),o[a]={rect:s,metrics:h.metrics}}}var c=function(t){var e,n,r,i,o=0,a=0;try{for(var s=l(t),c=s.next();!c.done;c=s.next())o+=(g=c.value).w*g.h,a=Math.max(a,g.w)}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}t.sort((function(t,e){return e.h-t.h}));var u=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(o/.95)),a),h:1/0}],f=0,d=0;try{for(var h=l(t),p=h.next();!p.done;p=h.next())for(var g=p.value,m=u.length-1;m>=0;m--){var v=u[m];if(!(g.w>v.w||g.h>v.h)){if(g.x=v.x,g.y=v.y,d=Math.max(d,g.y+g.h),f=Math.max(f,g.x+g.w),g.w===v.w&&g.h===v.h){var y=u.pop();m<u.length&&(u[m]=y)}else g.h===v.h?(v.x+=g.w,v.w-=g.w):g.w===v.w?(v.y+=g.h,v.h-=g.h):(u.push({x:v.x+g.w,y:v.y,w:v.w-g.w,h:g.h}),v.y+=g.h,v.h-=g.h);break}}}catch(t){r={error:t}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}return{w:f,h:d,fill:o/(f*d)||0}}(n),u=c.w,f=c.h,d=new wC({width:u||1,height:f||1});for(var r in t)for(var a in i=t[r]){var h;(h=i[+a])&&0!==h.bitmap.width&&0!==h.bitmap.height&&(s=e[r][a].rect,wC.copy(h.bitmap,d,{x:0,y:0},{x:s.x+1,y:s.y+1},h.bitmap))}this.image=d,this.positions=e};var IC,kC,LC,DC=function(){function t(t){this.runtime=t,this.sdfGeneratorCache={},this.textMetricsCache={},this.glyphMap={}}return t.prototype.getMap=function(){return this.glyphMap},t.prototype.getAtlas=function(){return this.glyphAtlas},t.prototype.getAtlasTexture=function(){return this.glyphAtlasTexture},t.prototype.layout=function(t,e,n,r,i,o,a){var s=this,c=[],l=o,u=a,f="right"===r||"end"===r?1:"left"===r||"start"===r?0:.5;return t.forEach((function(t){var r=c.length;Array.from(t).forEach((function(t){var n=s.glyphMap[e],r=t.charCodeAt(0),o=n&&n[r];o&&(c.push({glyph:r,x:l,y:u,scale:1,fontStack:e}),l+=o.metrics.advance+i)}));for(var o=l-i,a=r;a<c.length;a++)c[a].x=c[a].x-f*o;l=0,u+=n})),c},t.prototype.generateAtlas=function(t,e,n,r,o,a,s){var c=this;void 0===e&&(e=""),void 0===o&&(o="");var l=[];this.glyphMap[e]||(l=function(){for(var t=[],e=32;e<128;e++)t.push(String.fromCharCode(e));return t}());var u=Object.keys(this.glyphMap[e]||{});if(Array.from(new Set(a.split(""))).forEach((function(t){-1===u.indexOf(t.charCodeAt(0).toString())&&l.push(t)})),l.length){var f=l.map((function(i){return c.generateSDF(t,e,n,r,o,i)})).reduce((function(t,e){return t[e.id]=e,t}),{});this.glyphMap[e]=i(i({},this.glyphMap[e]),f),this.glyphAtlas=new NC(this.glyphMap);var d=this.glyphAtlas.image,h=d.width,p=d.height,g=d.data;this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.glyphAtlasTexture=s.createTexture(i(i({},wO(SO.ALPHA,h,p,1)),{pixelStore:{unpackFlipY:!1,unpackAlignment:1},immutable:!1})),this.glyphAtlasTexture.setImageData([g])}},t.prototype.generateSDF=function(t,e,n,r,i,o){void 0===e&&(e="");var a=o.charCodeAt(0),s=this.sdfGeneratorCache[e];s||(s=this.sdfGeneratorCache[e]=new fC({canvas:t,fontSize:24,fontFamily:n,fontWeight:r,fontStyle:i,buffer:3,radius:8,cutoff:.25},this.runtime)),this.textMetricsCache[e]||(this.textMetricsCache[e]={}),this.textMetricsCache[e][o]||(this.textMetricsCache[e][o]=s.ctx.measureText(o).width);var c=s.draw(o),l=c.data,u=c.width,f=c.height,d=c.glyphWidth,h=c.glyphHeight,p=c.glyphLeft,g=c.glyphTop,m=c.glyphAdvance;return{id:a,bitmap:new wC({width:u,height:f},l),metrics:{width:d,height:h,left:p,top:g-24+3,advance:m}}},t}();!function(t){t[t.INSTANCED=5]="INSTANCED",t[t.TEX=6]="TEX"}(IC||(IC={})),function(t){t[t.TEX=12]="TEX",t[t.OFFSET=13]="OFFSET"}(kC||(kC={})),function(t){t.SDF_MAP="u_SDFMap",t.SDF_MAP_SIZE="u_SDFMapSize",t.FONT_SIZE="u_FontSize",t.GAMMA_SCALE="u_GammaScale",t.STROKE_BLUR="u_StrokeBlur",t.HAS_STROKE="u_HasStroke"}(LC||(LC={}));var BC=function(t){function e(e,n,r,i,o,a,s){var c=t.call(this,e,n,r,i,o,a,s)||this;return c.renderHelper=e,c.texturePool=n,c.lightPool=r,c.packedBufferObjectMap=new WeakMap,c.tmpMat4=_(),c.fontHash=c.calcFontHash(i),c.glyphManager=new DC(c.context),c}return r(e,t),e.prototype.calcFontHash=function(t){return t.parsedStyle.metrics.font+["fontSize","fontFamily","fontWeight","textBaseline","letterSpacing"].reduce((function(e,n){return e+t.parsedStyle[n]}),"")},e.prototype.shouldMerge=function(e,n){return!!t.prototype.shouldMerge.call(this,e,n)&&(this.index===n&&this.fontHash===this.calcFontHash(e))},e.prototype.createGeometry=function(t){var e=this,n=this.instance.parsedStyle,r=n.textBaseline,i=n.fontSize,o=n.letterSpacing,a=24/i,s=[],c=[],l=[],d=0;t.forEach((function(t){var n=t.parsedStyle,i=n.metrics,h=n.dx,p=n.dy,g=i.font,m=i.lines,v=i.height,y=i.lineHeight,_=h||0,b=p||0,E=0;"middle"===r?E=-v/2:"bottom"===r?E=-v:"top"===r||"hanging"===r?E=0:"alphabetic"===r?(E=.25*y-v,e.context.enableCSSParsing||(E=-v)):"ideographic"===r&&(E=-v);var x=e.glyphManager.getAtlas(),M=e.buildTextBuffers({object:t,lines:m,fontStack:g,lineHeight:a*y,offsetX:a*_,offsetY:a*(E+b),letterSpacing:a*o,glyphAtlas:x,indicesOffset:d}),S=M.indicesOffset,A=M.indexBuffer,T=M.charUVOffsetBuffer,O=M.charPackedBuffer;d=S;var R=l.length;l.push.apply(l,f([],u(O),!1));var P=l.length;e.packedBufferObjectMap.set(t,[R,P]),c.push.apply(c,f([],u(T),!1)),s.push.apply(s,f([],u(A),!1))})),this.geometry.vertexCount=s.length,this.geometry.setIndexBuffer(new Uint32Array(s)),this.geometry.setVertexBuffer({bufferIndex:IC.INSTANCED,byteStride:128,stepMode:fO.VERTEX,attributes:[{format:SO.F32_RGBA,bufferByteOffset:0,location:qP.MODEL_MATRIX0},{format:SO.F32_RGBA,bufferByteOffset:16,location:qP.MODEL_MATRIX1},{format:SO.F32_RGBA,bufferByteOffset:32,location:qP.MODEL_MATRIX2},{format:SO.F32_RGBA,bufferByteOffset:48,location:qP.MODEL_MATRIX3},{format:SO.F32_RGBA,bufferByteOffset:64,location:qP.PACKED_COLOR},{format:SO.F32_RGBA,bufferByteOffset:80,location:qP.PACKED_STYLE1},{format:SO.F32_RGBA,bufferByteOffset:96,location:qP.PACKED_STYLE2},{format:SO.F32_RGBA,bufferByteOffset:112,location:qP.PICKING_COLOR}],data:new Float32Array(l)}),this.geometry.setVertexBuffer({bufferIndex:IC.TEX,byteStride:16,stepMode:fO.VERTEX,attributes:[{format:SO.F32_RG,bufferByteOffset:0,location:kC.TEX},{format:SO.F32_RG,bufferByteOffset:8,location:kC.OFFSET}],data:new Float32Array(c)})},e.prototype.createMaterial=function(t){var e;this.material.vertexShader="#define GLSLIFY 1\nlayout(std140) uniform ub_SceneParams {\n mat4 u_ProjectionMatrix;\n mat4 u_ViewMatrix;\n vec3 u_CameraPosition;\n float u_DevicePixelRatio;\n vec2 u_Viewport;\n float u_IsOrtho;\n float u_IsPicking;\n};\nlayout(location = MODEL_MATRIX0) in vec4 a_ModelMatrix0;\nlayout(location = MODEL_MATRIX1) in vec4 a_ModelMatrix1;\nlayout(location = MODEL_MATRIX2) in vec4 a_ModelMatrix2;\nlayout(location = MODEL_MATRIX3) in vec4 a_ModelMatrix3;\nlayout(location = PACKED_COLOR) in vec4 a_PackedColor;\nlayout(location = PACKED_STYLE1) in vec4 a_StylePacked1;\nlayout(location = PACKED_STYLE2) in vec4 a_StylePacked2;\nlayout(location = PICKING_COLOR) in vec4 a_PickingColor;\n\nout vec4 v_PickingResult;\nout vec4 v_Color;\nout vec4 v_StrokeColor;\nout vec4 v_StylePacked1;\nout vec4 v_StylePacked2;\n\n#define COLOR_SCALE 1. / 255.\nvoid setPickingColor(vec3 pickingColor) {\n v_PickingResult.rgb = pickingColor * COLOR_SCALE;\n}\n\nvec2 unpack_float(const float packedValue) {\n int packedIntValue = int(packedValue);\n int v0 = packedIntValue / 256;\n return vec2(v0, packedIntValue - v0 * 256);\n}\nvec4 decode_color(const vec2 encodedColor) {\n return vec4(\n unpack_float(encodedColor[0]) / 255.0,\n unpack_float(encodedColor[1]) / 255.0\n );\n}\n\nlayout(std140) uniform ub_ObjectParams {\n vec2 u_SDFMapSize;\n float u_FontSize;\n float u_GammaScale;\n float u_StrokeBlur;\n float u_HasStroke;\n};\nvec4 project(vec4 pos, mat4 pm, mat4 vm, mat4 mm) {\n return pm * vm * mm * pos;\n}\n\nbool isPerspectiveMatrix(mat4 m) {\n return m[2][3] == -1.0;\n}\n\nvec4 billboard(vec2 offset, float rotation, bool isSizeAttenuation, mat4 pm, mat4 vm, mat4 mm) {\n vec4 mvPosition = vm * mm * vec4(0.0, 0.0, 0.0, 1.0);\n vec2 scale;\n scale.x = length(vec3(mm[0][0], mm[0][1], mm[0][2]));\n scale.y = length(vec3(mm[1][0], mm[1][1], mm[1][2]));\n\n if (isSizeAttenuation) {\n bool isPerspective = isPerspectiveMatrix(pm);\n if (isPerspective) {\n scale *= -mvPosition.z / 250.0;\n }\n }\n\n vec2 alignedPosition = offset * scale;\n vec2 rotatedPosition;\n rotatedPosition.x = cos(rotation) * alignedPosition.x - sin(rotation) * alignedPosition.y;\n rotatedPosition.y = sin(rotation) * alignedPosition.x + cos(rotation) * alignedPosition.y;\n\n mvPosition.xy += rotatedPosition;\n return pm * mvPosition;\n}\n\nlayout(location = TEX) in vec2 a_Tex;\nlayout(location = OFFSET) in vec2 a_Offset;\n\nout vec2 v_Uv;\n\nvoid main() {\n vec4 a_Color = decode_color(a_PackedColor.xy);\nvec4 a_StrokeColor = decode_color(a_PackedColor.zw);\n\nmat4 u_ModelMatrix = mat4(a_ModelMatrix0, a_ModelMatrix1, a_ModelMatrix2, a_ModelMatrix3);\nvec4 u_StrokeColor = a_StrokeColor;\nfloat u_Opacity = a_StylePacked1.x;\nfloat u_FillOpacity = a_StylePacked1.y;\nfloat u_StrokeOpacity = a_StylePacked1.z;\nfloat u_StrokeWidth = a_StylePacked1.w;\nfloat u_ZIndex = a_PickingColor.w;\nvec2 u_Anchor = a_StylePacked2.yz;\nfloat u_IncreasedLineWidthForHitTesting = a_StylePacked2.w;\n\nsetPickingColor(a_PickingColor.xyz);\n\nv_Color = a_Color;\nv_StrokeColor = a_StrokeColor;\nv_StylePacked1 = a_StylePacked1;\nv_StylePacked2 = a_StylePacked2;\n\n// #ifdef CLIPSPACE_NEAR_ZERO\n// gl_Position.z = (gl_Position.z + gl_Position.w) * 0.5;\n// #endif\n\n v_Uv = a_Tex / u_SDFMapSize;\n float fontScale = u_FontSize / 24.;\n\n vec2 bufferOffset = vec2(0.7, 2.0);\n vec2 offset = a_Offset * fontScale + bufferOffset;\n\n bool isBillboard = a_StylePacked2.y > 0.5;\n if (isBillboard) {\n float rotation = a_StylePacked2.w;\n bool isSizeAttenuation = a_StylePacked2.z > 0.5;\n gl_Position = billboard(offset, rotation, isSizeAttenuation, u_ProjectionMatrix, u_ViewMatrix, u_ModelMatrix);\n } else {\n gl_Position = project(vec4((a_Offset) * fontScale + bufferOffset, u_ZIndex, 1.0), u_ProjectionMatrix, u_ViewMatrix, u_ModelMatrix);\n }\n}",this.material.fragmentShader="#define GLSLIFY 1\nlayout(std140) uniform ub_SceneParams {\n mat4 u_ProjectionMatrix;\n mat4 u_ViewMatrix;\n vec3 u_CameraPosition;\n float u_DevicePixelRatio;\n vec2 u_Viewport;\n float u_IsOrtho;\n float u_IsPicking;\n};\nin vec4 v_PickingResult;\nin vec4 v_Color;\nin vec4 v_StrokeColor;\nin vec4 v_StylePacked1;\nin vec4 v_StylePacked2;\nlayout(std140) uniform ub_ObjectParams {\n vec2 u_SDFMapSize;\n float u_FontSize;\n float u_GammaScale;\n float u_StrokeBlur;\n float u_HasStroke;\n};\n#ifdef USE_UV\n in vec2 v_Uv;\n#endif\n\nuniform sampler2D u_SDFMap;\n\n#define SDF_PX 8.0\n\nout vec4 outputColor;\n\nvoid main() {\n vec4 u_Color = v_Color;\nvec4 u_StrokeColor = v_StrokeColor;\nfloat u_Opacity = v_StylePacked1.x;\nfloat u_FillOpacity = v_StylePacked1.y;\nfloat u_StrokeOpacity = v_StylePacked1.z;\nfloat u_StrokeWidth = v_StylePacked1.w;\nfloat u_Visible = v_StylePacked2.x;\nvec3 u_PickingColor = v_PickingResult.xyz;\n\nif (u_Visible < 0.5) {\n discard;\n}\n\n float dist = texture(SAMPLER_2D(u_SDFMap), v_Uv).a;\n\n float fontScale = u_FontSize / 24.0;\n lowp vec4 color = u_Color;\n lowp float buff = (256.0 - 64.0) / 256.0;\n float opacity = u_FillOpacity;\n if (u_HasStroke > 0.5 && u_StrokeWidth > 0.0) {\n color = u_StrokeColor;\n buff = (6.0 - u_StrokeWidth / fontScale / 2.0) / SDF_PX;\n opacity = u_StrokeOpacity;\n }\n\n highp float gamma_scaled = fwidth(dist);\n highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);\n\n opacity *= alpha * u_Opacity;\n\n if (u_IsPicking > 0.5) {\n if (u_PickingColor.x == 0.0 && u_PickingColor.y == 0.0 && u_PickingColor.z == 0.0) {\n discard;\n }\n outputColor = vec4(u_PickingColor, 1.0);\n } else {\n\n if (opacity < 0.001) {\n discard;\n }\n\n outputColor = color;\n outputColor.a *= opacity;\n }\n}",this.material.cullMode=nO.BACK,this.material.defines=i(i({},this.material.defines),HP(kC));var n=this.instance.parsedStyle,r=n.fontSize,o=n.fontFamily,a=void 0===o?"":o,s=n.fontWeight,c=void 0===s?"":s,l=n.fontStyle,u=n.metrics.font,f=t.map((function(t){return t.parsedStyle.text})).join("");this.glyphManager.generateAtlas(this.texturePool.context.config.offscreenCanvas,u,a,c.toString(),l,f,this.context.device);var d=this.glyphManager.getAtlasTexture(),h=this.glyphManager.getAtlas();this.context.device.setResourceName(d,"TextSDF Texture");var p=h.image,g=p.width,m=p.height;this.material.setUniforms(((e={})[LC.SDF_MAP]=d,e[LC.SDF_MAP_SIZE]=[g,m],e[LC.FONT_SIZE]=r,e[LC.GAMMA_SCALE]=1,e[LC.STROKE_BLUR]=.2,e[LC.HAS_STROKE]=this.index,e))},e.prototype.changeRenderOrder=function(t,e){for(var n=this.geometry.vertices[IC.INSTANCED],r=this.geometry.inputLayoutDescriptor.vertexBufferDescriptors[IC.INSTANCED].byteStride/4,i=u(this.packedBufferObjectMap.get(t),2),o=i[0],a=i[1],s=n.slice(o,a),c=0;c<a-o;c+=r)s[c+r-1]=e*GP;this.geometry.updateVertexBuffer(IC.INSTANCED,qP.MODEL_MATRIX0,o/r,new Uint8Array(s.buffer))},e.prototype.updateAttribute=function(t,e,n,r){var i=this;if("text"===n||"fontFamily"===n||"fontSize"===n||"fontWeight"===n||"fontStyle"===n||"fontVariant"===n||"textBaseline"===n||"letterSpacing"===n||"wordWrapWidth"===n||"lineHeight"===n||"wordWrap"===n||"textAlign"===n||"dx"===n||"dy"===n)this.material.programDirty=!0,this.material.geometryDirty=!0,this.material.textureDirty=!0;else if("modelMatrix"===n||"fill"===n||"fillOpacity"===n||"stroke"===n||"strokeOpacity"===n||"opacity"===n||"lineWidth"===n||"visibility"===n||"pointerEvents"===n||"isBillboard"===n||"billboardRotation"===n||"isSizeAttenuation"===n){var o=this.geometry.vertices[IC.INSTANCED],a=this.geometry.inputLayoutDescriptor.vertexBufferDescriptors[IC.INSTANCED].byteStride/4;t.forEach((function(t){var e,n=t.parsedStyle,r=n.fill,s=n.stroke,c=n.opacity,l=n.fillOpacity,f=n.strokeOpacity,d=n.lineWidth,h=n.visibility,p=n.isBillboard,g=n.billboardRotation,m=n.isSizeAttenuation,v=[0,0,0,0];Oi(r)&&(v=[Number(r.r),Number(r.g),Number(r.b),255*Number(r.alpha)]);var y=[0,0,0,0];Oi(s)&&(y=[Number(s.r),Number(s.g),Number(s.b),255*Number(s.alpha)]);for(var _=t.isInteractive()&&(null===(e=t.renderable3D)||void 0===e?void 0:e.encodedPickingColor)||[0,0,0],b=E(i.tmpMat4,t.getWorldTransform()),x=u(i.packedBufferObjectMap.get(t),2),M=x[0],S=x[1],A=o.slice(M,S),T=0;T<S-M;T+=a)A[T+0]=b[0],A[T+1]=b[1],A[T+2]=b[2],A[T+3]=b[3],A[T+4]=b[4],A[T+5]=b[5],A[T+6]=b[6],A[T+7]=b[7],A[T+8]=b[8],A[T+9]=b[9],A[T+10]=b[10],A[T+11]=b[11],A[T+12]=b[12],A[T+13]=b[13],A[T+14]=b[14],A[T+15]=b[15],A[T+16]=YP(v[0],v[1]),A[T+17]=YP(v[2],v[3]),A[T+18]=YP(y[0],y[1]),A[T+19]=YP(y[2],y[3]),A[T+20]=c,A[T+21]=l,A[T+22]=f,A[T+23]=d,A[T+24]="visible"===h?1:0,A[T+25]=p?1:0,A[T+26]=m?1:0,A[T+27]=null!=g?g:0,A[T+28]=_[0],A[T+29]=_[1],A[T+30]=_[2];i.geometry.updateVertexBuffer(IC.INSTANCED,qP.MODEL_MATRIX0,M/a,new Uint8Array(A.buffer))}))}},e.prototype.buildTextBuffers=function(t){var e,n=t.object,r=t.lines,i=t.fontStack,o=t.lineHeight,a=t.letterSpacing,s=t.offsetX,c=t.offsetY,l=t.glyphAtlas,d=t.indicesOffset,h=n.parsedStyle,p=h.textAlign,g=h.fill,m=h.stroke,v=h.opacity,y=h.fillOpacity,_=h.strokeOpacity,b=h.lineWidth,x=h.visibility,M=h.isBillboard,S=h.billboardRotation,A=h.isSizeAttenuation,T=[0,0,0,0];Oi(g)&&(T=[Number(g.r),Number(g.g),Number(g.b),255*Number(g.alpha)]);var O=[0,0,0,0];Oi(m)&&(O=[Number(m.r),Number(m.g),Number(m.b),255*Number(m.alpha)]);var R=n.isInteractive()&&(null===(e=n.renderable3D)||void 0===e?void 0:e.encodedPickingColor)||[0,0,0],P=E(this.tmpMat4,n.getWorldTransform()),C=[],w=[],N=[],I=d,k=function(t,e){for(var n=[],r=0;r<t.length;r++){var i=t[r],o=e[i.fontStack],a=o&&o[i.glyph];if(a){var s=a.rect;if(s){var c=a.metrics.advance*i.scale/2,l=[i.x+c,i.y],u=(a.metrics.left-4)*i.scale-c+l[0],f=(-a.metrics.top-4)*i.scale+l[1],d=u+s.w*i.scale,h=f+s.h*i.scale,p={x:u,y:f},g={x:d,y:f},m={x:u,y:h},v={x:d,y:h};n.push({tl:p,tr:g,bl:m,br:v,tex:s,glyphOffset:[0,0]})}}}return n}(this.glyphManager.layout(r,i,o,p,a,s,c),l.positions);return k.forEach((function(t){var e=[];e.push.apply(e,f([],u(P),!1));var r=f(f(f(f([],u(e),!1),[YP(T[0],T[1]),YP(T[2],T[3]),YP(O[0],O[1]),YP(O[2],O[3]),v,y,_,b,"visible"===x?1:0,M?1:0,A?1:0,null!=S?S:0],!1),u(R),!1),[n.sortable.renderOrder*GP],!1);C.push.apply(C,f(f(f(f([],u(r),!1),u(r),!1),u(r),!1),u(r),!1)),w.push(t.tex.x,t.tex.y,t.tl.x,t.tl.y),w.push(t.tex.x+t.tex.w,t.tex.y,t.tr.x,t.tr.y),w.push(t.tex.x+t.tex.w,t.tex.y+t.tex.h,t.br.x,t.br.y),w.push(t.tex.x,t.tex.y+t.tex.h,t.bl.x,t.bl.y),N.push(0+I,2+I,1+I),N.push(2+I,0+I,3+I),I+=4})),{indexBuffer:N,charUVOffsetBuffer:w,charPackedBuffer:C,indicesOffset:I}},e}(tC),FC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.shouldMerge=function(e,n){return!!t.prototype.shouldMerge.call(this,e,n)&&(this.instance.nodeName!==Yn.MESH||this.instance.parsedStyle.material===e.parsedStyle.material&&this.instance.parsedStyle.geometry===e.parsedStyle.geometry)},e.prototype.updateAttribute=function(e,n,r,i){t.prototype.updateAttribute.call(this,e,n,r,i),this.updateBatchedAttribute(e,n,r,i)},e.prototype.createMaterial=function(t){var e=this.instance.parsedStyle.material;this.material=e,this.observeMaterialChanged()},e.prototype.createGeometry=function(e){var n=this.instance.parsedStyle.geometry;this.geometry=n,t.prototype.createGeometry.call(this,e),this.geometry.build(e),this.observeGeometryChanged()},e}(tC),UC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.getDrawcallCtors=function(t){var e=[];return t.parsedStyle.fill.isNone||e.push(nC),this.needDrawStrokeSeparately(t)&&e.push(gC),e},e.prototype.needDrawStrokeSeparately=function(t){var e=t.parsedStyle,n=e.fill,r=e.stroke,i=e.lineDash,o=e.lineWidth,a=e.strokeOpacity,s=n&&!n.isNone,c=r&&!r.isNone,l=i&&i.length&&i.every((function(t){return 0!==t}));return!s||c&&o>0&&(a<1||l)},e}(WP),jC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.getDrawcallCtors=function(t){var e=t.parsedStyle,n=e.fill,r=e.stroke,i=e.opacity,o=e.strokeOpacity,a=e.lineWidth,s=r&&!r.isNone,c=gC.calcSubpathNum(t),l=[];if(t.nodeName!==Yn.POLYLINE&&!n.isNone)for(var u=0;u<c;u++)l.push(xC);for(u=0;u<c;u++){if(0!==o&&0!==i&&0!==a&&s)OC.isLine(t,u)?l.push(OC):l.push(gC)}return l},e}(WP);!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}r(e,t),e.prototype.getDrawcallCtors=function(){return[]}}(WP);var GC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.getDrawcallCtors=function(){return[RC]},e}(WP),WC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.getDrawcallCtors=function(t){var e=[],n=t.parsedStyle,r=n.stroke,i=n.lineWidth;return!(!r||r.isNone||!i)&&e.push(BC),e.push(BC),e},e.prototype.beforeUploadUBO=function(t,e){var n,r=e.instance.renderable3D.drawcalls.length;e.material.setUniforms(((n={})[LC.HAS_STROKE]=1===r?0:1-e.index,n))},e}(WP),zC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.getDrawcallCtors=function(){return[OC]},e}(WP),VC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.getDrawcallCtors=function(){return[FC]},e}(WP),HC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.getDrawcallCtors=function(t){var e=[],n=t.parsedStyle,r=n.fill,i=n.radius,o=i&&i.length&&i.some((function(t){return t!==i[0]}));return r.isNone||o||e.push(nC),o&&e.push(xC),(o||this.needDrawStrokeSeparately(t))&&e.push(gC),e},e.prototype.needDrawStrokeSeparately=function(t){var e=t.parsedStyle,n=e.fill,r=e.stroke,i=e.lineDash,o=e.lineWidth,a=e.strokeOpacity,s=n&&!n.isNone,c=r&&!r.isNone,l=i&&i.length&&i.every((function(t){return 0!==t}));return!s||c&&o>0&&(a<1||l)},e}(WP),XC=1,YC=function(){function t(t,e,n,r){this.renderHelper=t,this.rendererFactory=e,this.texturePool=n,this.lightPool=r,this.drawcalls=[],this.pendingUpdatePatches={},this.stencilRefCache={}}return t.prototype.destroy=function(){this.drawcalls.forEach((function(t){t.destroy()})),this.drawcalls=[],this.pendingUpdatePatches={}},t.prototype.render=function(t,e){var n=this;void 0===e&&(e=!1),e||this.updatePendingPatches(),this.drawcalls.forEach((function(r){r.init();var i=r.objects;r.clipPathTarget&&(i=[r.clipPath]);var o=n.renderHelper.renderInstManager.newRenderInst();o.setAllowSkippingIfPipelineNotReady(!1),r.applyRenderInst(o,i),n.renderHelper.renderInstManager.submitRenderInst(o,t),e||r.objects.forEach((function(t){t.renderable.dirty=!1}))}))},t.prototype.attach=function(t){this.context=t},t.prototype.add=function(t){var e=this,n=t.renderable3D;if(n&&!n.drawcalls.length){var r=this.rendererFactory[t.nodeName];r&&r.getDrawcallCtors(t).forEach((function(i,o,a){var s=e.drawcalls.find((function(e){return i===e.constructor&&e.index===o&&e.objects.length<e.maxInstances&&e.shouldMerge(t,o)}));s&&s.key===t.parsedStyle.batchKey||((s=new i(e.renderHelper,e.texturePool,e.lightPool,t,a,o,e.context)).renderer=r,e.drawcalls.push(s),t.parsedStyle.batchKey&&(s.key=t.parsedStyle.batchKey)),s&&(s.objects.push(t),n.drawcalls[o]=s,s.geometryDirty=!0)}))}},t.prototype.remove=function(t){var e=this,n=t.renderable3D;n&&(n.drawcalls.forEach((function(n){if(n){var r=n.objects.indexOf(t);if(r>-1&&(n.objects.splice(r,1),n.geometryDirty=!0),0===n.objects.length)e.drawcalls.splice(e.drawcalls.indexOf(n),1).forEach((function(t){t.destroy()}))}})),n.drawcalls=[])},t.prototype.updateAttribute=function(t,e,n,r){var i=this;void 0===r&&(r=!1);var o=t.renderable3D,a=this.rendererFactory[t.nodeName];if(a){var s=a.getDrawcallCtors(t);if(s.forEach((function(s,c,l){var u=o.drawcalls.find((function(t){return t&&t.index===c&&t.constructor===s}));if(u||((u=o.drawcalls[c])&&(u.objects.splice(u.objects.indexOf(t),1),u.geometryDirty=!0,0===u.objects.length&&i.drawcalls.splice(i.drawcalls.indexOf(u),1),o.drawcalls[o.drawcalls.indexOf(u)]=void 0),(u=i.drawcalls.find((function(e){return s===e.constructor&&e.index===c&&e.objects.length<e.maxInstances&&e.shouldMerge(t,c)})))?u.geometryDirty=!0:((u=new s(i.renderHelper,i.texturePool,i.lightPool,t,l,c,i.context)).renderer=a,u.init(),i.drawcalls.push(u)),u.objects.push(t),o.drawcalls[c]=u),u.inited&&!u.geometryDirty)if(u.shouldMerge(t,c)){var f=u.objects.indexOf(t);if(r)t.parsedStyle[e]=n,u.updateAttribute([t],f,e,n);else{var d=u.id+e;i.pendingUpdatePatches[d]||(i.pendingUpdatePatches[d]={instance:u,objectIndices:[],name:e,value:n}),-1===i.pendingUpdatePatches[d].objectIndices.indexOf(f)&&i.pendingUpdatePatches[d].objectIndices.push(f)}}else i.remove(t),i.add(t);else i.remove(t),i.add(t)})),o.drawcalls.length>s.length)for(var c=o.drawcalls.length-1;c>=s.length;c--){var l=o.drawcalls[c];l.objects.splice(l.objects.indexOf(t),1),l.geometryDirty=!0,0===l.objects.length&&this.drawcalls.splice(this.drawcalls.indexOf(l),1),o.drawcalls.pop()}}},t.prototype.changeRenderOrder=function(t,e){var n=t.renderable3D;n&&n.drawcalls.length&&n.drawcalls.forEach((function(n){n&&n.inited&&!n.geometryDirty&&n.inited&&n.changeRenderOrder(t,e)}))},t.prototype.getStencilRef=function(t){return this.stencilRefCache[t.entity]||(this.stencilRefCache[t.entity]=XC++),this.stencilRefCache[t.entity]},t.prototype.updatePendingPatches=function(){var t=this;Object.keys(this.pendingUpdatePatches).forEach((function(e){var n=t.pendingUpdatePatches[e],r=n.instance,i=n.objectIndices,o=n.name,a=n.value;i.sort((function(t,e){return t-e}));var s=[];i.forEach((function(t){var e=s[s.length-1];e&&t===e[e.length-1]+1?e.push(t):s.push([t])})),s.forEach((function(t){r.updateAttribute(r.objects.slice(t[0],t[0]+t.length),t[0],o,a)}))})),this.pendingUpdatePatches={}},t}(),$C=function(){function t(t,e){this.context=t,this.runtime=e,this.textureCache={}}return t.prototype.getOrCreateTexture=function(t,e,n,r){var o,a=this,s="string"==typeof e?e:e.src||"";if(s&&this.textureCache[s])(o=this.textureCache[s]).emit(dO.LOADED);else if(o=t.createTexture(i({pixelFormat:SO.U8_RGBA_NORM,width:1,height:1,depth:1,numLevels:1,dimension:hO.TEXTURE_2D,usage:pO.SAMPLED,pixelStore:{unpackFlipY:!1},immutable:!1},n)),s&&(this.textureCache[s]=o),Me(e)){var c,l=this.context.config.createImage;l?c=l(e):ea&&(c=new window.Image),c&&(c.onload=function(){var t=function(t){a.textureCache[s].setImageData([t]),a.textureCache[s].emit(dO.LOADED),a.context.renderingService.dirtify(),r&&r(a.textureCache[s])};a.runtime.globalThis.createImageBitmap?a.runtime.globalThis.createImageBitmap(c).then((function(e){return t(e)})).catch((function(){t(c)})):t(c)},c.onerror=function(){},c.crossOrigin="Anonymous",c.src=e)}else o.setImageData([e]),o.emit(dO.LOADED),this.context.renderingService.dirtify();return o},t.prototype.getOrCreateCanvas=function(){return this.runtime.offscreenCanvasCreator.getOrCreateCanvas(this.context.config.offscreenCanvas)},t.prototype.getOrCreateGradient=function(t){var e=t.instance,n=t.gradients,r=e.getGeometryBounds().halfExtents,o=2*r[0]||1,a=2*r[1]||1,s=this.context.config.offscreenCanvas,c=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(s),l=this.runtime.offscreenCanvasCreator.getOrCreateContext(s);c.width=o,c.height=a;var u=this.context.imagePool;n.forEach((function(t){var e=u.getOrCreateGradient(i(i({type:t.type},t.value),{width:o,height:a}),l);l.fillStyle=e,l.fillRect(0,0,o,a)}))},t.prototype.getOrCreatePattern=function(t,e,n){var r,i=t.image,o=t.repetition,a=t.transform,s=e.getGeometryBounds().halfExtents,c=2*s[0]||1,l=2*s[1]||1,u=this.context.config.offscreenCanvas,f=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(u),d=this.runtime.offscreenCanvasCreator.getOrCreateContext(u);f.width=c,f.height=l;var h=(r=Me(i)?this.context.imagePool.getImageSync(i,n):i)&&d.createPattern(r,o);if(a){var p=Wo(mo(a),new Es({}));h.setTransform({a:p[0],b:p[1],c:p[4],d:p[5],e:p[12],f:p[13]})}d.fillStyle=h,d.fillRect(0,0,c,l)},t.prototype.destroy=function(){for(var t in this.textureCache)this.textureCache[t].destroy();this.textureCache={}},t}();!function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.vert=kP,e.frag="#define GLSLIFY 1\nuniform sampler2D u_Texture;\nin vec2 v_TexCoord;\n\nout vec4 outputColor;\n\nvoid main() {\n outputColor = texture(SAMPLER_2D(u_Texture), v_TexCoord);\n}",e.features={},e}r(e,t)}(DR),function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.options=e,n.name="device-renderer",n.parameters={toneMapping:eP.NONE,toneMappingExposure:1},n}r(e,t),e.prototype.init=function(t){var e;t.geometryUpdaterFactory[Yn.MESH]=new PO;var n=new yP(this.parameters),r=new OO,i=new $C(this.context,t),o=new CO,a=new UC,s=new jC,c=((e={})[Yn.CIRCLE]=a,e[Yn.ELLIPSE]=a,e[Yn.POLYLINE]=s,e[Yn.PATH]=s,e[Yn.POLYGON]=s,e[Yn.RECT]=new HC,e[Yn.IMAGE]=new GC,e[Yn.LINE]=new zC,e[Yn.TEXT]=new WC,e[Yn.MESH]=new VC,e[Yn.GROUP]=void 0,e[Yn.HTML]=void 0,e),l=new YC(n,c,i,r),u=new UP(n,r,i,l,this.options);this.addRenderingPlugin(u),this.addRenderingPlugin(new jP(n,u,o,l))},e.prototype.destroy=function(t){delete t.geometryUpdaterFactory[Yn.MESH]},e.prototype.getRenderGraphPlugin=function(){return this.plugins[0]},e.prototype.getDevice=function(){return this.getRenderGraphPlugin().getDevice()},e.prototype.loadTexture=function(t,e,n){return this.getRenderGraphPlugin().loadTexture(t,e,n)},e.prototype.toDataURL=function(t){return this.getRenderGraphPlugin().toDataURL(t)},e.prototype.setParameters=function(t){this.parameters=i(i({},this.parameters),t)}}(Kn);var qC=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,e,n)||this;return r.flipYMatrix=k(_(),tt(1,-1,1)),r.topology=r.createTopology(),r}return r(e,t),e.prototype.applyMa4Position=function(t,e){for(var n=mt(),r=0;r<e.byteLength/4;r+=3)n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=1,vt(n,n,t),e[r]=n[0],e[r+1]=n[1],e[r+2]=n[2];this.updateVertexBuffer($P.POSITION,qP.POSITION,0,new Uint8Array(e.buffer))},e.prototype.applyMa4Normal=function(t,e){var n=mt(),r=E(_(),t);T(r,r),A(r,r);for(var i=0;i<e.byteLength/4;i+=3)n[0]=e[i],n[1]=e[i+1],n[2]=e[i+2],n[3]=1,vt(n,n,r),e[i]=n[0],e[i+1]=n[1],e[i+2]=n[2];this.updateVertexBuffer($P.NORMAL,qP.NORMAL,0,new Uint8Array(e.buffer))},e.prototype.rebuildPosition=function(){this.topology=this.createTopology();var t=Float32Array.from(this.topology.positions);this.applyMa4Position(this.flipYMatrix,t),this.dirty=!0},e.prototype.applyMat4=function(t){this.applyMa4Position(t,this.vertices[$P.POSITION]),this.applyMa4Normal(t,this.vertices[$P.NORMAL])},e.prototype.computeBoundingBox=function(){for(var t=this.topology.positions,e=-1/0,n=-1/0,r=-1/0,i=1/0,o=1/0,a=1/0,s=0;s<t.length;s+=3){var c=t[s],l=t[s+1],u=t[s+2];e=Math.max(e,c),n=Math.max(n,l),r=Math.max(r,u),i=Math.min(i,c),o=Math.min(o,l),a=Math.min(a,u)}var f=new mr;return f.setMinMax([i,o,a],[e,n,r]),f},e.prototype.build=function(){var t=this.topology,e=t.indices,n=t.positions,r=t.normals,i=t.uvs;this.setIndexBuffer(new Uint32Array(e)),this.vertexCount=e.length,this.setVertexBuffer({bufferIndex:$P.POSITION,byteStride:12,stepMode:fO.VERTEX,attributes:[{format:SO.F32_RGB,bufferByteOffset:0,location:qP.POSITION}],data:Float32Array.from(n)}),this.setVertexBuffer({bufferIndex:$P.NORMAL,byteStride:12,stepMode:fO.VERTEX,attributes:[{format:SO.F32_RGB,bufferByteOffset:0,location:qP.NORMAL}],data:Float32Array.from(r)}),this.setVertexBuffer({bufferIndex:$P.UV,byteStride:8,stepMode:fO.VERTEX,attributes:[{format:SO.F32_RG,bufferByteOffset:0,location:qP.UV}],data:Float32Array.from(i)}),this.applyMat4(this.flipYMatrix),this.dirty=!0},e}(IP),KC=4/64,ZC=.875;function QC(t,e,n,r,i,o){var a,s,c,l,u,f,d,h,p,g,m,v,y,_,b,E,x,M,S,A=Z(),T=Z(),O=Z(),R=[],P=[],C=[],w=[],N=[];if(n>0)for(a=0;a<=r;a++)for(s=0;s<=i;s++){g=s/i*2*Math.PI-Math.PI,lt(A,p=tt((v=Math.sin(g))*t,-n/2,(m=Math.cos(g))*t),h=tt(v*e,n/2,m*e),a/r),at(T,ht(T,h,p)),at(O,ct(O,tt(m,0,-v),T)),R.push(A[0],A[1],A[2]),P.push(O[0],O[1],O[2]),f=s/i,d=a/r,C.push(f,1-d);var I=d;d=f,f=I,f=(f/=3)*ZC+KC,d=d*ZC+KC,w.push(f,1-d),a<r&&s<i&&(b=a*(i+1)+s,E=a*(i+1)+(s+1),x=(a+1)*(i+1)+s,M=(a+1)*(i+1)+(s+1),N.push(b,E,x),N.push(E,M,x))}if(o){var k=void 0,L=void 0,D=Math.floor(i/2),B=i,F=n/2;for(k=0;k<=D;k++)for(g=k*Math.PI*.5/D,v=Math.sin(g),m=Math.cos(g),L=0;L<=B;L++)y=2*L*Math.PI/B-Math.PI/2,_=Math.sin(y),c=Math.cos(y)*v,l=m,u=_*v,f=1-L/B,d=1-k/D,R.push(c*e,l*e+F,u*e),P.push(c,l,u),C.push(f,1-d),f=(f/=3)*ZC+KC,d=(d/=3)*ZC+KC,f+=1/3,w.push(f,1-d);for(S=(r+1)*(i+1),k=0;k<D;++k)for(L=0;L<B;++L)E=(b=k*(B+1)+L)+B+1,N.push(S+b+1,S+E,S+b),N.push(S+b+1,S+E+1,S+E);for(k=0;k<=D;k++)for(g=.5*Math.PI+k*Math.PI*.5/D,v=Math.sin(g),m=Math.cos(g),L=0;L<=B;L++)y=2*L*Math.PI/B-Math.PI/2,_=Math.sin(y),c=Math.cos(y)*v,l=m,u=_*v,f=1-L/B,d=1-k/D,R.push(c*e,l*e-F,u*e),P.push(c,l,u),C.push(f,1-d),f=(f/=3)*ZC+KC,d=(d/=3)*ZC+KC,f+=2/3,w.push(f,1-d);for(S=(r+1)*(i+1)+(B+1)*(D+1),k=0;k<D;++k)for(L=0;L<B;++L)E=(b=k*(B+1)+L)+B+1,N.push(S+b+1,S+E,S+b),N.push(S+b+1,S+E+1,S+E)}else{if(S=(r+1)*(i+1),t>0)for(a=0;a<i;a++)g=a/i*2*Math.PI,l=-n/2,f=1-((c=Math.sin(g))+1)/2,d=((u=Math.cos(g))+1)/2,R.push(c*t,l,u*t),P.push(0,-1,0),C.push(f,1-d),f=(f/=3)*ZC+KC,d=(d/=3)*ZC+KC,f+=1/3,w.push(f,1-d),a>1&&N.push(S,S+a,S+a-1);if(S+=i,e>0)for(a=0;a<i;a++)g=a/i*2*Math.PI,l=n/2,f=1-((c=Math.sin(g))+1)/2,d=((u=Math.cos(g))+1)/2,R.push(c*e,l,u*e),P.push(0,1,0),C.push(f,1-d),f=(f/=3)*ZC+KC,d=(d/=3)*ZC+KC,f+=2/3,w.push(f,1-d),a>1&&N.push(S,S+a-1,S+a)}return{positions:R,normals:P,uvs:C,uvs1:w,indices:N}}var JC=function(t){function e(e,n){return void 0===n&&(n={}),t.call(this,e,i({width:1,height:1,depth:1,widthSegments:1,heightSegments:1,depthSegments:1},n))||this}return r(e,t),Object.defineProperty(e.prototype,"width",{get:function(){return this.props.width},set:function(t){this.props.width!==t&&(this.props.width=t,this.rebuildPosition())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.props.height},set:function(t){this.props.height!==t&&(this.props.height=t,this.rebuildPosition())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depth",{get:function(){return this.props.depth},set:function(t){this.props.depth!==t&&(this.props.depth=t,this.rebuildPosition())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"widthSegments",{get:function(){return this.props.widthSegments},set:function(t){this.props.widthSegments!==t&&(this.props.widthSegments=t,this.build())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"heightSegments",{get:function(){return this.props.heightSegments},set:function(t){this.props.heightSegments!==t&&(this.props.heightSegments=t,this.build())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthSegments",{get:function(){return this.props.depthSegments},set:function(t){this.props.depthSegments!==t&&(this.props.depthSegments=t,this.build())},enumerable:!1,configurable:!0}),e.prototype.createTopology=function(){var t=this.props,e=t.widthSegments,n=void 0===e?1:e,r=t.heightSegments,i=void 0===r?1:r,o=t.depthSegments,a=void 0===o?1:o,s=t.height,c=void 0===s?1:s,l=t.width,u=void 0===l?1:l,f=t.depth,d=n,h=i,p=a,g=u/2,m=c/2,v=(void 0===f?1:f)/2,y=[tt(-g,-m,v),tt(g,-m,v),tt(g,m,v),tt(-g,m,v),tt(g,-m,-v),tt(-g,-m,-v),tt(-g,m,-v),tt(g,m,-v)],_=[[0,1,3],[4,5,7],[3,2,6],[1,0,4],[1,4,2],[5,0,6]],b=[[0,0,1],[0,0,-1],[0,1,0],[0,-1,0],[1,0,0],[-1,0,0]],E=1,x=2,M=3,S=4,A=5,T=[],O=[],R=[],P=[],C=[],w=0,N=function(t,e,n){var r,i,o,a;for(o=0;o<=e;o++)for(a=0;a<=n;a++){var s=Z(),c=Z(),l=Z(),u=Z();lt(s,y[_[t][0]],y[_[t][1]],o/e),lt(c,y[_[t][0]],y[_[t][2]],a/n),ht(l,c,y[_[t][0]]),rt(u,s,l),r=o/e,i=a/n,T.push(u[0],u[1],u[2]),O.push(b[t][0],b[t][1],b[t][2]),R.push(r,1-i),r=(r/=3)*ZC+KC,i=(i/=3)*ZC+KC,r+=t%3/3,i+=Math.floor(t/3)/3,P.push(r,1-i),o<e&&a<n&&(C.push(w+n+1,w+1,w),C.push(w+n+1,w+n+2,w+1)),w++}};return N(0,d,h),N(E,d,h),N(x,d,p),N(M,d,p),N(S,p,h),N(A,p,h),{indices:C,positions:T,normals:O,uvs:R,uv1s:P}},e}(qC),tw=function(t){function e(e,n){return void 0===n&&(n={}),t.call(this,e,i({radius:.5,latitudeBands:16,longitudeBands:16},n))||this}return r(e,t),Object.defineProperty(e.prototype,"radius",{get:function(){return this.props.radius},set:function(t){this.props.radius!==t&&(this.props.radius=t,this.build())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"latitudeBands",{get:function(){return this.props.latitudeBands},set:function(t){this.props.latitudeBands!==t&&(this.props.latitudeBands=t,this.build())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"longitudeBands",{get:function(){return this.props.longitudeBands},set:function(t){this.props.longitudeBands!==t&&(this.props.longitudeBands=t,this.build())},enumerable:!1,configurable:!0}),e.prototype.createTopology=function(){var t,e,n,r,i,o,a,s,c,l,u,f,d,h,p=this.props,g=p.radius,m=void 0===g?.5:g,v=p.latitudeBands,y=void 0===v?16:v,_=p.longitudeBands,b=void 0===_?16:_,E=[],x=[],M=[],S=[];for(e=0;e<=y;e++)for(n=e*Math.PI/y,r=Math.sin(n),i=Math.cos(n),t=0;t<=b;t++)o=2*t*Math.PI/b-Math.PI/2,a=Math.sin(o),l=Math.cos(o)*r,u=i,f=a*r,d=1-t/b,h=1-e/y,E.push(l*m,u*m,f*m),x.push(l,u,f),M.push(d,1-h);for(e=0;e<y;++e)for(t=0;t<b;++t)c=(s=e*(b+1)+t)+b+1,S.push(s+1,c,s),S.push(s+1,c+1,c);return{indices:S,positions:E,normals:x,uvs:M,uv1s:M}},e}(qC);!function(t){function e(e,n){return void 0===n&&(n={}),t.call(this,e,i({tubeRadius:.2,ringRadius:.3,segments:30,sides:20},n))||this}r(e,t),Object.defineProperty(e.prototype,"tubeRadius",{get:function(){return this.props.tubeRadius},set:function(t){this.props.tubeRadius!==t&&(this.props.tubeRadius=t,this.build())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ringRadius",{get:function(){return this.props.ringRadius},set:function(t){this.props.ringRadius!==t&&(this.props.ringRadius=t,this.build())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"segments",{get:function(){return this.props.segments},set:function(t){this.props.segments!==t&&(this.props.segments=t,this.build())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sides",{get:function(){return this.props.sides},set:function(t){this.props.sides!==t&&(this.props.sides=t,this.build())},enumerable:!1,configurable:!0}),e.prototype.createTopology=function(){var t,e,n,r,i,o,a,s,c,l,u=this.props,f=u.tubeRadius,d=void 0===f?.2:f,h=u.ringRadius,p=void 0===h?.3:h,g=u.segments,m=void 0===g?30:g,v=u.sides,y=void 0===v?20:v,_=d,b=p,E=[],x=[],M=[],S=[];for(c=0;c<=y;c++)for(l=0;l<=m;l++)if(t=Math.cos(2*Math.PI*l/m)*(b+_*Math.cos(2*Math.PI*c/y)),e=Math.sin(2*Math.PI*c/y)*_,n=Math.sin(2*Math.PI*l/m)*(b+_*Math.cos(2*Math.PI*c/y)),r=Math.cos(2*Math.PI*l/m)*Math.cos(2*Math.PI*c/y),i=Math.sin(2*Math.PI*c/y),o=Math.sin(2*Math.PI*l/m)*Math.cos(2*Math.PI*c/y),a=c/y,s=1-l/m,E.push(t,e,n),x.push(r,i,o),M.push(a,1-s),c<y&&l<m){var A=c*(m+1)+l,T=(c+1)*(m+1)+l,O=c*(m+1)+(l+1),R=(c+1)*(m+1)+(l+1);S.push(A,T,O),S.push(T,R,O)}return{indices:S,positions:E,normals:x,uvs:M,uv1s:M}}}(qC),function(t){function e(e,n){return void 0===n&&(n={}),t.call(this,e,i({width:1,depth:1,widthSegments:5,depthSegments:5},n))||this}r(e,t),Object.defineProperty(e.prototype,"width",{get:function(){return this.props.width},set:function(t){this.props.width!==t&&(this.props.width=t,this.rebuildPosition())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depth",{get:function(){return this.props.depth},set:function(t){this.props.depth!==t&&(this.props.depth=t,this.rebuildPosition())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"widthSegments",{get:function(){return this.props.widthSegments},set:function(t){this.props.widthSegments!==t&&(this.props.widthSegments=t,this.build())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depthSegments",{get:function(){return this.props.depthSegments},set:function(t){this.props.depthSegments!==t&&(this.props.depthSegments=t,this.build())},enumerable:!1,configurable:!0}),e.prototype.createTopology=function(){var t,e,n,r,i,o,a=[],s=[],c=[],l=[],u=this.props,f=u.widthSegments,d=void 0===f?5:f,h=u.depthSegments,p=void 0===h?5:h,g=u.width,m=void 0===g?1:g,v=u.depth,y=m/2,_=(void 0===v?1:v)/2,b=d,E=p,x=0;for(t=0;t<=b;t++)for(e=0;e<=E;e++)n=2*y*t/b-y,0,r=-(2*_*e/E-_),i=t/b,o=e/E,a.push(n,0,r),s.push(0,1,0),c.push(i,1-o),t<b&&e<E&&(l.push(x+E+1,x+1,x),l.push(x+E+1,x+E+2,x+1)),x++;return{indices:l,positions:a,normals:s,uvs:c,uv1s:c}}}(qC),function(t){function e(e,n){return void 0===n&&(n={}),t.call(this,e,i({radius:.5,height:1,heightSegments:5,capSegments:20},n))||this}r(e,t),Object.defineProperty(e.prototype,"radius",{get:function(){return this.props.radius},set:function(t){this.props.radius!==t&&(this.props.radius=t,this.rebuildPosition())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.props.height},set:function(t){this.props.height!==t&&(this.props.height=t,this.rebuildPosition())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"heightSegments",{get:function(){return this.props.heightSegments},set:function(t){this.props.heightSegments!==t&&(this.props.heightSegments=t,this.build())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"capSegments",{get:function(){return this.props.capSegments},set:function(t){this.props.capSegments!==t&&(this.props.capSegments=t,this.build())},enumerable:!1,configurable:!0}),e.prototype.createTopology=function(){var t=this.props,e=t.radius,n=QC(e,e,t.height,t.heightSegments,t.capSegments,!1);return{indices:n.indices,positions:n.positions,normals:n.normals,uvs:n.uvs,uv1s:n.uvs1}}}(qC),function(t){function e(e,n){return void 0===n&&(n={}),t.call(this,e,i({baseRadius:.5,peakRadius:0,height:1,heightSegments:5,capSegments:18},n))||this}r(e,t),Object.defineProperty(e.prototype,"baseRadius",{get:function(){return this.props.baseRadius},set:function(t){this.props.baseRadius!==t&&(this.props.baseRadius=t,this.rebuildPosition())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"peakRadius",{get:function(){return this.props.peakRadius},set:function(t){this.props.peakRadius!==t&&(this.props.peakRadius=t,this.rebuildPosition())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.props.height},set:function(t){this.props.height!==t&&(this.props.height=t,this.rebuildPosition())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"heightSegments",{get:function(){return this.props.heightSegments},set:function(t){this.props.heightSegments!==t&&(this.props.heightSegments=t,this.build())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"capSegments",{get:function(){return this.props.capSegments},set:function(t){this.props.capSegments!==t&&(this.props.capSegments=t,this.build())},enumerable:!1,configurable:!0}),e.prototype.createTopology=function(){var t=this.props,e=QC(t.baseRadius,t.peakRadius,t.height,t.heightSegments,t.capSegments,!1);return{indices:e.indices,positions:e.positions,normals:e.normals,uvs:e.uvs,uv1s:e.uvs1}}}(qC),function(t){function e(e,n){return void 0===n&&(n={}),t.call(this,e,i({radius:.5,height:1,heightSegments:1,sides:20},n))||this}r(e,t),Object.defineProperty(e.prototype,"radius",{get:function(){return this.props.radius},set:function(t){this.props.radius!==t&&(this.props.radius=t,this.rebuildPosition())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.props.height},set:function(t){this.props.height!==t&&(this.props.height=t,this.rebuildPosition())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"heightSegments",{get:function(){return this.props.heightSegments},set:function(t){this.props.heightSegments!==t&&(this.props.heightSegments=t,this.build())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sides",{get:function(){return this.props.sides},set:function(t){this.props.sides!==t&&(this.props.sides=t,this.build())},enumerable:!1,configurable:!0}),e.prototype.createTopology=function(){var t=this.props,e=t.radius,n=QC(e,e,t.height-2*e,t.heightSegments,t.sides,!0);return{indices:n.indices,positions:n.positions,normals:n.normals,uvs:n.uvs,uv1s:n.uvs1}}}(qC),function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,a=o(e,["style"]);return(n=t.call(this,i({style:i({fill:"black"},r)},a))||this).define="NUM_AMBIENT_LIGHTS",n.order=-1,n}r(e,t),e.prototype.uploadUBO=function(t,e){var n=this.parsedStyle.fill;if(Oi(n)){var r=[Number(n.r)/255,Number(n.g)/255,Number(n.b)/255];t.push({name:"u_AmbientLightColor",value:r})}}}(OP),function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,a=o(e,["style"]);return(n=t.call(this,i({style:i({direction:tt(0,-1,0)},r)},a))||this).define="NUM_DIR_LIGHTS",n.order=10,n}r(e,t),e.prototype.getUniformWordCount=function(){return 8},e.prototype.uploadUBO=function(t,e){var n=this.parsedStyle,r=n.fill,i=n.direction,o=n.intensity;if(Oi(r)){var a=[Number(r.r)/255,Number(r.g)/255,Number(r.b)/255];t.push({name:"directionalLights[".concat(e,"].direction"),value:i}),t.push({name:"directionalLights[".concat(e,"].intensity"),value:o}),t.push({name:"directionalLights[".concat(e,"].color"),value:a})}}}(OP);var ew;!function(t){t.MAP="u_Map",t.PLACE_HOLDER="u_Placeholder"}(ew||(ew={}));var nw,rw=function(t){function e(e,n){var r,o=t.call(this,e,i({vertexShader:"#define GLSLIFY 1\nlayout(std140) uniform ub_SceneParams {\n mat4 u_ProjectionMatrix;\n mat4 u_ViewMatrix;\n vec3 u_CameraPosition;\n float u_DevicePixelRatio;\n vec2 u_Viewport;\n float u_IsOrtho;\n float u_IsPicking;\n};\nlayout(std140) uniform ub_MaterialParams {\n #ifdef USE_WIREFRAME\n vec3 u_WireframeLineColor;\n float u_WireframeLineWidth;\n #endif\n\n #ifdef USE_FOG\n vec4 u_FogInfos;\n vec3 u_FogColor;\n #endif\n\n vec4 u_Placeholder;\n};\n\nlayout(location = MODEL_MATRIX0) in vec4 a_ModelMatrix0;\nlayout(location = MODEL_MATRIX1) in vec4 a_ModelMatrix1;\nlayout(location = MODEL_MATRIX2) in vec4 a_ModelMatrix2;\nlayout(location = MODEL_MATRIX3) in vec4 a_ModelMatrix3;\nlayout(location = PACKED_COLOR) in vec4 a_PackedColor;\nlayout(location = PACKED_STYLE1) in vec4 a_StylePacked1;\nlayout(location = PACKED_STYLE2) in vec4 a_StylePacked2;\nlayout(location = PICKING_COLOR) in vec4 a_PickingColor;\n\nout vec4 v_PickingResult;\nout vec4 v_Color;\nout vec4 v_StrokeColor;\nout vec4 v_StylePacked1;\nout vec4 v_StylePacked2;\n\n#define COLOR_SCALE 1. / 255.\nvoid setPickingColor(vec3 pickingColor) {\n v_PickingResult.rgb = pickingColor * COLOR_SCALE;\n}\n\nvec2 unpack_float(const float packedValue) {\n int packedIntValue = int(packedValue);\n int v0 = packedIntValue / 256;\n return vec2(v0, packedIntValue - v0 * 256);\n}\nvec4 decode_color(const vec2 encodedColor) {\n return vec4(\n unpack_float(encodedColor[0]) / 255.0,\n unpack_float(encodedColor[1]) / 255.0\n );\n}\nvec4 project(vec4 pos, mat4 pm, mat4 vm, mat4 mm) {\n return pm * vm * mm * pos;\n}\n\nlayout(location = POSITION) in vec3 a_Position;\n\n#ifdef USE_UV\n layout(location = UV) in vec2 a_Uv;\n out vec2 v_Uv;\n#endif\n\n#ifdef USE_WIREFRAME\n layout(location = BARYCENTRIC) in vec3 a_Barycentric;\n out vec3 v_Barycentric;\n#endif\n\nvoid main() {\n vec4 a_Color = decode_color(a_PackedColor.xy);\nvec4 a_StrokeColor = decode_color(a_PackedColor.zw);\n\nmat4 u_ModelMatrix = mat4(a_ModelMatrix0, a_ModelMatrix1, a_ModelMatrix2, a_ModelMatrix3);\nvec4 u_StrokeColor = a_StrokeColor;\nfloat u_Opacity = a_StylePacked1.x;\nfloat u_FillOpacity = a_StylePacked1.y;\nfloat u_StrokeOpacity = a_StylePacked1.z;\nfloat u_StrokeWidth = a_StylePacked1.w;\nfloat u_ZIndex = a_PickingColor.w;\nvec2 u_Anchor = a_StylePacked2.yz;\nfloat u_IncreasedLineWidthForHitTesting = a_StylePacked2.w;\n\nsetPickingColor(a_PickingColor.xyz);\n\nv_Color = a_Color;\nv_StrokeColor = a_StrokeColor;\nv_StylePacked1 = a_StylePacked1;\nv_StylePacked2 = a_StylePacked2;\n\n// #ifdef CLIPSPACE_NEAR_ZERO\n// gl_Position.z = (gl_Position.z + gl_Position.w) * 0.5;\n// #endif\n\n gl_Position = project(vec4(a_Position, 1.0), u_ProjectionMatrix, u_ViewMatrix, u_ModelMatrix);\n\n #ifdef USE_UV\n v_Uv = a_Uv;\n #ifdef VIEWPORT_ORIGIN_TL\n v_Uv.y = 1.0 - v_Uv.y;\n #endif\n#endif\n\n #ifdef USE_WIREFRAME\n v_Barycentric = a_Barycentric;\n#endif\n\n}",fragmentShader:"#define GLSLIFY 1\n#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n\n#ifndef saturate\n #define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\n\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\n\n// expects values in the range of [0,1]x[0,1], returns values in the [0,1] range.\n// do not collapse into a single function per: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\nhighp float rand( const in vec2 uv ) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\n return fract( sin( sn ) * c );\n}\n\nmat3 transposeMat3(mat3 inMatrix) {\n vec3 i0 = inMatrix[0];\n vec3 i1 = inMatrix[1];\n vec3 i2 = inMatrix[2];\n\n mat3 outMatrix = mat3(\n vec3(i0.x, i1.x, i2.x),\n vec3(i0.y, i1.y, i2.y),\n vec3(i0.z, i1.z, i2.z)\n );\n\n return outMatrix;\n}\n\n// https://github.com/glslify/glsl-inverse/blob/master/index.glsl\nmat3 inverseMat3(mat3 inMatrix) {\n float a00 = inMatrix[0][0], a01 = inMatrix[0][1], a02 = inMatrix[0][2];\n float a10 = inMatrix[1][0], a11 = inMatrix[1][1], a12 = inMatrix[1][2];\n float a20 = inMatrix[2][0], a21 = inMatrix[2][1], a22 = inMatrix[2][2];\n\n float b01 = a22 * a11 - a12 * a21;\n float b11 = -a22 * a10 + a12 * a20;\n float b21 = a21 * a10 - a11 * a20;\n\n float det = a00 * b01 + a01 * b11 + a02 * b21;\n\n return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\n b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\n b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\n}\n\nstruct DirectionalLight {\n vec3 direction;\n float intensity;\n vec3 color;\n};\n\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\n\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\n\nstruct GeometricContext {\n vec3 position;\n vec3 normal;\n vec3 viewDir;\n};\nlayout(std140) uniform ub_SceneParams {\n mat4 u_ProjectionMatrix;\n mat4 u_ViewMatrix;\n vec3 u_CameraPosition;\n float u_DevicePixelRatio;\n vec2 u_Viewport;\n float u_IsOrtho;\n float u_IsPicking;\n};\nlayout(std140) uniform ub_MaterialParams {\n #ifdef USE_WIREFRAME\n vec3 u_WireframeLineColor;\n float u_WireframeLineWidth;\n #endif\n\n #ifdef USE_FOG\n vec4 u_FogInfos;\n vec3 u_FogColor;\n #endif\n\n vec4 u_Placeholder;\n};\n\nin vec4 v_PickingResult;\nin vec4 v_Color;\nin vec4 v_StrokeColor;\nin vec4 v_StylePacked1;\nin vec4 v_StylePacked2;\n#ifdef USE_UV\n in vec2 v_Uv;\n#endif\n#ifdef USE_MAP\n uniform sampler2D u_Map;\n#endif\n#ifdef USE_WIREFRAME\n in vec3 v_Barycentric;\n\n float edgeFactor() {\n vec3 d = fwidth(v_Barycentric);\n vec3 a3 = smoothstep(vec3(0.0), d * u_WireframeLineWidth, v_Barycentric);\n return min(min(a3.x, a3.y), a3.z);\n }\n#endif\n\n#ifdef USE_FOG\n #define FOGMODE_NONE 0.\n #define FOGMODE_EXP 1.\n #define FOGMODE_EXP2 2.\n #define FOGMODE_LINEAR 3.\n\n // in float v_FogDepth;\n\n float dBlendModeFogFactor = 1.0;\n\n vec3 addFog(vec3 color) {\n float depth = gl_FragCoord.z / gl_FragCoord.w;\n // float depth = v_FogDepth;\n float fogFactor;\n float fogStart = u_FogInfos.y;\n float fogEnd = u_FogInfos.z;\n float fogDensity = u_FogInfos.w;\n\n if (u_FogInfos.x == FOGMODE_NONE) {\n fogFactor = 1.0;\n } else if (u_FogInfos.x == FOGMODE_EXP) {\n fogFactor = exp(-depth * fogDensity);\n } else if (u_FogInfos.x == FOGMODE_EXP2) {\n fogFactor = exp(-depth * depth * fogDensity * fogDensity);\n } else if (u_FogInfos.x == FOGMODE_LINEAR) {\n fogFactor = (fogEnd - depth) / (fogEnd - fogStart);\n }\n\n fogFactor = clamp(fogFactor, 0.0, 1.0);\n return mix(u_FogColor * dBlendModeFogFactor, color, fogFactor);\n }\n#endif\n\nout vec4 outputColor;\n\nvoid main() {\n vec4 u_Color = v_Color;\nvec4 u_StrokeColor = v_StrokeColor;\nfloat u_Opacity = v_StylePacked1.x;\nfloat u_FillOpacity = v_StylePacked1.y;\nfloat u_StrokeOpacity = v_StylePacked1.z;\nfloat u_StrokeWidth = v_StylePacked1.w;\nfloat u_Visible = v_StylePacked2.x;\nvec3 u_PickingColor = v_PickingResult.xyz;\n\nif (u_Visible < 0.5) {\n discard;\n}\n #ifdef USE_MAP\n #ifdef USE_PATTERN\n vec4 texelColor = texture(SAMPLER_2D(u_Map), v_Uv);\n u_Color = texelColor;\n #else\n vec4 texelColor = texture(SAMPLER_2D(u_Map), v_Uv);\n u_Color = texelColor;\n #endif\n#endif\n\n if (u_IsPicking > 0.5) {\n if (u_PickingColor.x == 0.0 && u_PickingColor.y == 0.0 && u_PickingColor.z == 0.0) {\n discard;\n }\n outputColor = vec4(u_PickingColor, 1.0);\n } else {\n outputColor = u_Color;\n outputColor.a = outputColor.a * u_Opacity;\n vec4 diffuseColor = outputColor;\n\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n reflectedLight.indirectDiffuse += vec3( 1.0 );\n reflectedLight.indirectDiffuse *= outputColor.rgb;\n\n vec3 outgoingLight = reflectedLight.indirectDiffuse;\n \n outputColor = vec4(outgoingLight, diffuseColor.a);\n\n #ifdef USE_WIREFRAME\n vec3 color = mix(outputColor.xyz, u_WireframeLineColor, (1.0 - edgeFactor()));\n outputColor.xyz = color;\n#endif\n #ifdef USE_FOG\n outputColor.rgb = addFog(outputColor.rgb);\n#endif\n }\n}",cullMode:nO.BACK},n))||this;o.defines=i(i({},o.defines),{USE_UV:!0,USE_MAP:!1,USE_WIREFRAME:!1,USE_FOG:!1,USE_LIGHT:!1});var a=n||{},s=a.map,c=a.wireframe;return s&&(o.map=s),o.wireframe=c,o.setUniforms(((r={})[ew.PLACE_HOLDER]=[0,0,0,0],r)),o}return r(e,t),Object.defineProperty(e.prototype,"map",{get:function(){return this.props.map},set:function(t){var e;this.props.map!==t&&(this.props.map=t,this.programDirty=!0),this.setUniforms(((e={})[ew.MAP]=t,e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"aoMap",{get:function(){return this.props.aoMap},set:function(t){this.props.aoMap=t},enumerable:!1,configurable:!0}),e}(zP);!function(t){t.EMISSIVE="u_Emissive",t.SHININESS="u_Shininess",t.SPECULAR="u_Specular",t.BUMP_SCALE="u_BumpScale",t.SPECULAR_MAP="u_SpecularMap",t.BUMP_MAP="u_BumpMap"}(nw||(nw={})),function(t){function e(e,n){var r,o=t.call(this,e,i({vertexShader:"#define GLSLIFY 1\n#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n\n#ifndef saturate\n #define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\n\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\n\n// expects values in the range of [0,1]x[0,1], returns values in the [0,1] range.\n// do not collapse into a single function per: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\nhighp float rand( const in vec2 uv ) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\n return fract( sin( sn ) * c );\n}\n\nmat3 transposeMat3(mat3 inMatrix) {\n vec3 i0 = inMatrix[0];\n vec3 i1 = inMatrix[1];\n vec3 i2 = inMatrix[2];\n\n mat3 outMatrix = mat3(\n vec3(i0.x, i1.x, i2.x),\n vec3(i0.y, i1.y, i2.y),\n vec3(i0.z, i1.z, i2.z)\n );\n\n return outMatrix;\n}\n\n// https://github.com/glslify/glsl-inverse/blob/master/index.glsl\nmat3 inverseMat3(mat3 inMatrix) {\n float a00 = inMatrix[0][0], a01 = inMatrix[0][1], a02 = inMatrix[0][2];\n float a10 = inMatrix[1][0], a11 = inMatrix[1][1], a12 = inMatrix[1][2];\n float a20 = inMatrix[2][0], a21 = inMatrix[2][1], a22 = inMatrix[2][2];\n\n float b01 = a22 * a11 - a12 * a21;\n float b11 = -a22 * a10 + a12 * a20;\n float b21 = a21 * a10 - a11 * a20;\n\n float det = a00 * b01 + a01 * b11 + a02 * b21;\n\n return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\n b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\n b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\n}\n\nstruct DirectionalLight {\n vec3 direction;\n float intensity;\n vec3 color;\n};\n\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\n\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\n\nstruct GeometricContext {\n vec3 position;\n vec3 normal;\n vec3 viewDir;\n};\nlayout(std140) uniform ub_SceneParams {\n mat4 u_ProjectionMatrix;\n mat4 u_ViewMatrix;\n vec3 u_CameraPosition;\n float u_DevicePixelRatio;\n vec2 u_Viewport;\n float u_IsOrtho;\n float u_IsPicking;\n};\nlayout(std140) uniform ub_MaterialParams {\n #ifdef USE_WIREFRAME\n vec3 u_WireframeLineColor;\n float u_WireframeLineWidth;\n #endif\n\n #ifdef USE_FOG\n vec4 u_FogInfos;\n vec3 u_FogColor;\n #endif\n\n vec3 u_Emissive;\n float u_Shininess;\n vec3 u_Specular;\n\n #ifdef USE_LIGHT\n #ifdef USE_BUMPMAP\n float u_BumpScale;\n #endif\n\n #ifdef NUM_AMBIENT_LIGHTS\n vec3 u_AmbientLightColor;\n #endif\n\n #ifdef NUM_DIR_LIGHTS\n DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n #endif\n #endif\n};\n\nlayout(location = MODEL_MATRIX0) in vec4 a_ModelMatrix0;\nlayout(location = MODEL_MATRIX1) in vec4 a_ModelMatrix1;\nlayout(location = MODEL_MATRIX2) in vec4 a_ModelMatrix2;\nlayout(location = MODEL_MATRIX3) in vec4 a_ModelMatrix3;\nlayout(location = PACKED_COLOR) in vec4 a_PackedColor;\nlayout(location = PACKED_STYLE1) in vec4 a_StylePacked1;\nlayout(location = PACKED_STYLE2) in vec4 a_StylePacked2;\nlayout(location = PICKING_COLOR) in vec4 a_PickingColor;\n\nout vec4 v_PickingResult;\nout vec4 v_Color;\nout vec4 v_StrokeColor;\nout vec4 v_StylePacked1;\nout vec4 v_StylePacked2;\n\n#define COLOR_SCALE 1. / 255.\nvoid setPickingColor(vec3 pickingColor) {\n v_PickingResult.rgb = pickingColor * COLOR_SCALE;\n}\n\nvec2 unpack_float(const float packedValue) {\n int packedIntValue = int(packedValue);\n int v0 = packedIntValue / 256;\n return vec2(v0, packedIntValue - v0 * 256);\n}\nvec4 decode_color(const vec2 encodedColor) {\n return vec4(\n unpack_float(encodedColor[0]) / 255.0,\n unpack_float(encodedColor[1]) / 255.0\n );\n}\nvec4 project(vec4 pos, mat4 pm, mat4 vm, mat4 mm) {\n return pm * vm * mm * pos;\n}\n\nlayout(location = POSITION) in vec3 a_Position;\nlayout(location = NORMAL) in vec3 a_Normal;\n\n#ifdef USE_UV\n layout(location = UV) in vec2 a_Uv;\n out vec2 v_Uv;\n#endif\n\n#ifdef USE_WIREFRAME\n layout(location = BARYCENTRIC) in vec3 a_Barycentric;\n out vec3 v_Barycentric;\n#endif\n\nout vec3 v_ViewPosition;\nout vec3 v_Normal;\n\nvoid main() {\n vec4 a_Color = decode_color(a_PackedColor.xy);\nvec4 a_StrokeColor = decode_color(a_PackedColor.zw);\n\nmat4 u_ModelMatrix = mat4(a_ModelMatrix0, a_ModelMatrix1, a_ModelMatrix2, a_ModelMatrix3);\nvec4 u_StrokeColor = a_StrokeColor;\nfloat u_Opacity = a_StylePacked1.x;\nfloat u_FillOpacity = a_StylePacked1.y;\nfloat u_StrokeOpacity = a_StylePacked1.z;\nfloat u_StrokeWidth = a_StylePacked1.w;\nfloat u_ZIndex = a_PickingColor.w;\nvec2 u_Anchor = a_StylePacked2.yz;\nfloat u_IncreasedLineWidthForHitTesting = a_StylePacked2.w;\n\nsetPickingColor(a_PickingColor.xyz);\n\nv_Color = a_Color;\nv_StrokeColor = a_StrokeColor;\nv_StylePacked1 = a_StylePacked1;\nv_StylePacked2 = a_StylePacked2;\n\n// #ifdef CLIPSPACE_NEAR_ZERO\n// gl_Position.z = (gl_Position.z + gl_Position.w) * 0.5;\n// #endif\n\n vec4 position = vec4(a_Position, 1.0);\n\n gl_Position = project(position, u_ProjectionMatrix, u_ViewMatrix, u_ModelMatrix);\n\n vec4 mvPosition = u_ViewMatrix * u_ModelMatrix * position;\n v_ViewPosition = - mvPosition.xyz;\n\n // v_ViewPosition = vec3(mvPosition) / mvPosition.w;\n\n mat3 normalWorld = mat3(transposeMat3(inverseMat3(mat3(u_ViewMatrix * u_ModelMatrix))));\n v_Normal = normalize(normalWorld * a_Normal);\n\n #ifdef USE_UV\n v_Uv = a_Uv;\n #ifdef VIEWPORT_ORIGIN_TL\n v_Uv.y = 1.0 - v_Uv.y;\n #endif\n#endif\n\n #ifdef USE_WIREFRAME\n v_Barycentric = a_Barycentric;\n#endif\n\n}",fragmentShader:"#define GLSLIFY 1\n#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n\n#ifndef saturate\n #define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\n\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\n\n// expects values in the range of [0,1]x[0,1], returns values in the [0,1] range.\n// do not collapse into a single function per: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\nhighp float rand( const in vec2 uv ) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\n return fract( sin( sn ) * c );\n}\n\nmat3 transposeMat3(mat3 inMatrix) {\n vec3 i0 = inMatrix[0];\n vec3 i1 = inMatrix[1];\n vec3 i2 = inMatrix[2];\n\n mat3 outMatrix = mat3(\n vec3(i0.x, i1.x, i2.x),\n vec3(i0.y, i1.y, i2.y),\n vec3(i0.z, i1.z, i2.z)\n );\n\n return outMatrix;\n}\n\n// https://github.com/glslify/glsl-inverse/blob/master/index.glsl\nmat3 inverseMat3(mat3 inMatrix) {\n float a00 = inMatrix[0][0], a01 = inMatrix[0][1], a02 = inMatrix[0][2];\n float a10 = inMatrix[1][0], a11 = inMatrix[1][1], a12 = inMatrix[1][2];\n float a20 = inMatrix[2][0], a21 = inMatrix[2][1], a22 = inMatrix[2][2];\n\n float b01 = a22 * a11 - a12 * a21;\n float b11 = -a22 * a10 + a12 * a20;\n float b21 = a21 * a10 - a11 * a20;\n\n float det = a00 * b01 + a01 * b11 + a02 * b21;\n\n return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\n b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\n b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\n}\n\nstruct DirectionalLight {\n vec3 direction;\n float intensity;\n vec3 color;\n};\n\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\n\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\n\nstruct GeometricContext {\n vec3 position;\n vec3 normal;\n vec3 viewDir;\n};\nlayout(std140) uniform ub_SceneParams {\n mat4 u_ProjectionMatrix;\n mat4 u_ViewMatrix;\n vec3 u_CameraPosition;\n float u_DevicePixelRatio;\n vec2 u_Viewport;\n float u_IsOrtho;\n float u_IsPicking;\n};\nlayout(std140) uniform ub_MaterialParams {\n #ifdef USE_WIREFRAME\n vec3 u_WireframeLineColor;\n float u_WireframeLineWidth;\n #endif\n\n #ifdef USE_FOG\n vec4 u_FogInfos;\n vec3 u_FogColor;\n #endif\n\n vec3 u_Emissive;\n float u_Shininess;\n vec3 u_Specular;\n\n #ifdef USE_LIGHT\n #ifdef USE_BUMPMAP\n float u_BumpScale;\n #endif\n\n #ifdef NUM_AMBIENT_LIGHTS\n vec3 u_AmbientLightColor;\n #endif\n\n #ifdef NUM_DIR_LIGHTS\n DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n #endif\n #endif\n};\n\nin vec4 v_PickingResult;\nin vec4 v_Color;\nin vec4 v_StrokeColor;\nin vec4 v_StylePacked1;\nin vec4 v_StylePacked2;\n#ifdef USE_UV\n in vec2 v_Uv;\n#endif\n#ifdef USE_MAP\n uniform sampler2D u_Map;\n#endif\n#if defined(USE_BUMPMAP) && defined(USE_LIGHT)\n uniform sampler2D u_BumpMap;\n\n // Bump Mapping Unparametrized Surfaces on the GPU by Morten S. Mikkelsen\n // http://api.unrealengine.com/attachments/Engine/Rendering/LightingAndShadows/BumpMappingWithoutTangentSpace/mm_sfgrad_bump.pdf\n\n // Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\n\n vec2 dHdxy_fwd() {\n vec2 dSTdx = dFdx( v_Uv );\n vec2 dSTdy = dFdy( v_Uv );\n\n float Hll = u_BumpScale * texture(SAMPLER_2D(u_BumpMap), v_Uv ).x;\n float dBx = u_BumpScale * texture(SAMPLER_2D(u_BumpMap), v_Uv + dSTdx ).x - Hll;\n float dBy = u_BumpScale * texture(SAMPLER_2D(u_BumpMap), v_Uv + dSTdy ).x - Hll;\n\n return vec2( dBx, dBy );\n }\n\n vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\n // Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\n\n vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n vec3 vN = surf_norm;\t\t// normalized\n\n vec3 R1 = cross( vSigmaY, vN );\n vec3 R2 = cross( vN, vSigmaX );\n\n float fDet = dot( vSigmaX, R1 ) * faceDirection;\n\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n return normalize( abs( fDet ) * surf_norm - vGrad );\n }\n#endif\n#ifdef USE_SPECULARMAP\n uniform sampler2D u_SpecularMap;\n#endif\nvec3 BRDF_Lambert(const in vec3 diffuseColor) {\n return RECIPROCAL_PI * diffuseColor;\n}\n\nvec3 F_Schlick(\n const in vec3 f0,\n const in float f90,\n const in float dotVH\n) {\n // Original approximation by Christophe Schlick '94\n // float fresnel = pow( 1.0 - dotVH, 5.0 );\n\n // Optimized variant (presented by Epic at SIGGRAPH '13)\n // https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\n\nfloat G_BlinnPhong_Implicit( /* const in float dotNL, const in float dotNV */ ) {\n // geometry term is (n dot l)(n dot v) / 4(n dot l)(n dot v)\n return 0.25;\n}\n\nfloat D_BlinnPhong(\n const in float shininess,\n const in float dotNH\n) {\n return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\n\nvec3 BRDF_BlinnPhong(\n const in vec3 lightDir,\n const in vec3 viewDir,\n const in vec3 normal,\n const in vec3 specularColor,\n const in float shininess\n) {\n vec3 halfDir = normalize( lightDir + viewDir );\n\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n\n vec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\n float G = G_BlinnPhong_Implicit( /* dotNL, dotNV */ );\n\n float D = D_BlinnPhong( shininess, dotNH );\n\n return F * ( G * D );\n}\n\n#ifdef USE_WIREFRAME\n in vec3 v_Barycentric;\n\n float edgeFactor() {\n vec3 d = fwidth(v_Barycentric);\n vec3 a3 = smoothstep(vec3(0.0), d * u_WireframeLineWidth, v_Barycentric);\n return min(min(a3.x, a3.y), a3.z);\n }\n#endif\n\n#ifdef USE_FOG\n #define FOGMODE_NONE 0.\n #define FOGMODE_EXP 1.\n #define FOGMODE_EXP2 2.\n #define FOGMODE_LINEAR 3.\n\n // in float v_FogDepth;\n\n float dBlendModeFogFactor = 1.0;\n\n vec3 addFog(vec3 color) {\n float depth = gl_FragCoord.z / gl_FragCoord.w;\n // float depth = v_FogDepth;\n float fogFactor;\n float fogStart = u_FogInfos.y;\n float fogEnd = u_FogInfos.z;\n float fogDensity = u_FogInfos.w;\n\n if (u_FogInfos.x == FOGMODE_NONE) {\n fogFactor = 1.0;\n } else if (u_FogInfos.x == FOGMODE_EXP) {\n fogFactor = exp(-depth * fogDensity);\n } else if (u_FogInfos.x == FOGMODE_EXP2) {\n fogFactor = exp(-depth * depth * fogDensity * fogDensity);\n } else if (u_FogInfos.x == FOGMODE_LINEAR) {\n fogFactor = (fogEnd - depth) / (fogEnd - fogStart);\n }\n\n fogFactor = clamp(fogFactor, 0.0, 1.0);\n return mix(u_FogColor * dBlendModeFogFactor, color, fogFactor);\n }\n#endif\n\n#ifdef USE_LIGHT\n void getDirectionalLightInfo(\n const in DirectionalLight directionalLight, \n const in GeometricContext geometry,\n out IncidentLight light\n ) {\n light.color = directionalLight.color * directionalLight.intensity;\n light.direction = normalize(directionalLight.direction);\n light.visible = true;\n }\n\n vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n vec3 irradiance = ambientLightColor;\n return irradiance;\n }\n#endif\nstruct BlinnPhongMaterial {\n vec3 diffuseColor;\n vec3 specularColor;\n float specularShininess;\n float specularStrength;\n};\n\nvoid RE_Direct_BlinnPhong(\n const in IncidentLight directLight,\n const in GeometricContext geometry,\n const in BlinnPhongMaterial material,\n inout ReflectedLight reflectedLight\n) {\n float dotNL = saturate(dot(geometry.normal, directLight.direction));\n vec3 irradiance = dotNL * directLight.color;\n\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\n reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\n\nvoid RE_IndirectDiffuse_BlinnPhong(\n const in vec3 irradiance,\n const in GeometricContext geometry,\n const in BlinnPhongMaterial material,\n inout ReflectedLight reflectedLight\n) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n\n#define RE_Direct RE_Direct_BlinnPhong\n#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong\n\nin vec3 v_ViewPosition;\nin vec3 v_Normal;\n\nout vec4 outputColor;\n\nvoid main() {\n vec4 u_Color = v_Color;\nvec4 u_StrokeColor = v_StrokeColor;\nfloat u_Opacity = v_StylePacked1.x;\nfloat u_FillOpacity = v_StylePacked1.y;\nfloat u_StrokeOpacity = v_StylePacked1.z;\nfloat u_StrokeWidth = v_StylePacked1.w;\nfloat u_Visible = v_StylePacked2.x;\nvec3 u_PickingColor = v_PickingResult.xyz;\n\nif (u_Visible < 0.5) {\n discard;\n}\n\n // diffusemap\n #ifdef USE_MAP\n #ifdef USE_PATTERN\n vec4 texelColor = texture(SAMPLER_2D(u_Map), v_Uv);\n u_Color = texelColor;\n #else\n vec4 texelColor = texture(SAMPLER_2D(u_Map), v_Uv);\n u_Color = texelColor;\n #endif\n#endif\n // specularmap\n float specularStrength = 1.0;\n\n#ifdef USE_SPECULARMAP\n vec4 texelSpecular = texture(SAMPLER_2D(u_SpecularMap), v_Uv);\n specularStrength = texelSpecular.r;\n#endif\n // bumpmap & normalmap\n float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\nvec3 normal = normalize(v_Normal);\n#ifdef USE_DOUBLESIDE\n normal = normal * faceDirection;\n#endif\n\n// #ifdef USE_TANGENT\n// vec3 tangent = normalize( vTangent );\n// vec3 bitangent = normalize( vBitangent );\n\n// #ifdef DOUBLE_SIDED\n// tangent = tangent * faceDirection;\n// bitangent = bitangent * faceDirection;\n// #endif\n\n// #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\n// mat3 vTBN = mat3( tangent, bitangent, normal );\n\n// #endif\n// #endif\n #ifdef OBJECTSPACE_NORMALMAP\n // normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; // overrides both flatShading and attribute normals\n\n // #ifdef FLIP_SIDED\n // normal = - normal;\n // #endif\n\n // #ifdef DOUBLE_SIDED\n // normal = normal * faceDirection;\n // #endif\n\n // normal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n // vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n // mapN.xy *= normalScale;\n\n // #ifdef USE_TANGENT\n // normal = normalize( vTBN * mapN );\n // #else\n // normal = perturbNormal2Arb( - v_ViewPosition, normal, mapN, faceDirection );\n // #endif\n\n#elif defined(USE_BUMPMAP) && defined(USE_LIGHT)\n normal = perturbNormalArb( - v_ViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif\n\n if (u_IsPicking > 0.5) {\n if (u_PickingColor.x == 0.0 && u_PickingColor.y == 0.0 && u_PickingColor.z == 0.0) {\n discard;\n }\n outputColor = vec4(u_PickingColor, 1.0);\n } else {\n outputColor = u_Color;\n outputColor.a = outputColor.a * u_Opacity;\n\n vec4 diffuseColor = outputColor;\n ReflectedLight reflectedLight = ReflectedLight(vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ));\n vec3 totalEmissiveRadiance = u_Emissive;\n\n // calculate lighting accumulation\n BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = u_Specular;\nmaterial.specularShininess = u_Shininess;\nmaterial.specularStrength = specularStrength;\n GeometricContext geometry;\ngeometry.position = - v_ViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = u_IsOrtho == 1.0 ? vec3(0, 0, 1) : normalize(v_ViewPosition);\n\nIncidentLight directLight;\n#if defined( NUM_DIR_LIGHTS ) && ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n directionalLight = directionalLights[ i ];\n\n getDirectionalLightInfo( directionalLight, geometry, directLight );\n\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n\n RE_Direct( directLight, geometry, material, reflectedLight );\n }\n #pragma unroll_loop_end\n\n#endif\n\n#if defined( RE_IndirectDiffuse )\n vec3 iblIrradiance = vec3(0.0);\n vec3 ambient = vec3(0.0);\n #ifdef NUM_AMBIENT_LIGHTS\n ambient = u_AmbientLightColor;\n #endif\n vec3 irradiance = getAmbientLightIrradiance(ambient);\n\n // irradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n // #if ( NUM_HEMI_LIGHTS > 0 )\n // #pragma unroll_loop_start\n // for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n // irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n // }\n // #pragma unroll_loop_end\n // #endif\n#endif\n\n#if defined( RE_IndirectSpecular )\n vec3 radiance = vec3( 0.0 );\n vec3 clearcoatRadiance = vec3( 0.0 );\n#endif\n\n #if defined( RE_IndirectDiffuse )\n RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n\n#if defined( RE_IndirectSpecular )\n RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif\n\n vec3 outgoingLight = reflectedLight.directDiffuse +\n reflectedLight.indirectDiffuse + \n reflectedLight.directSpecular + \n reflectedLight.indirectSpecular + \n totalEmissiveRadiance;\n\n outputColor = vec4(outgoingLight, diffuseColor.a);\n\n #ifdef USE_WIREFRAME\n vec3 color = mix(outputColor.xyz, u_WireframeLineColor, (1.0 - edgeFactor()));\n outputColor.xyz = color;\n#endif\n #ifdef USE_FOG\n outputColor.rgb = addFog(outputColor.rgb);\n#endif\n }\n}",emissive:"black",shininess:30,specular:"#111111",bumpScale:1,doubleSide:!1},n))||this,a=o,s=a.specularMap,c=a.bumpMap,l=a.doubleSide,u=a.emissive,f=a.shininess,d=a.specular,h=Ri(u),p=Ri(d);return o.setUniforms(((r={u_Placeholder:null})[nw.EMISSIVE]=[Number(h.r)/255,Number(h.g)/255,Number(h.b)/255],r[nw.SHININESS]=f,r[nw.SPECULAR]=[Number(p.r)/255,Number(p.g)/255,Number(p.b)/255],r)),s&&(o.specularMap=s),c&&(o.bumpMap=c),o.doubleSide=l,o.defines=i(i({},o.defines),{USE_LIGHT:!0}),o}r(e,t),Object.defineProperty(e.prototype,"emissive",{get:function(){return this.props.emissive},set:function(t){var e;this.props.emissive=t;var n=Ri(t);this.setUniforms(((e={})[nw.EMISSIVE]=[Number(n.r)/255,Number(n.g)/255,Number(n.b)/255],e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shininess",{get:function(){return this.props.shininess},set:function(t){var e;this.props.shininess=t,this.setUniforms(((e={})[nw.SHININESS]=t,e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specular",{get:function(){return this.props.specular},set:function(t){var e;this.props.specular=t;var n=Ri(t);this.setUniforms(((e={})[nw.SPECULAR]=[Number(n.r)/255,Number(n.g)/255,Number(n.b)/255],e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularMap",{get:function(){return this.props.specularMap},set:function(t){var e;this.props.map!==t&&(this.props.specularMap=t,this.programDirty=!0),this.defines.USE_SPECULARMAP=!!t,this.setUniforms(((e={})[nw.SPECULAR_MAP]=t,e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bumpMap",{get:function(){return this.props.bumpMap},set:function(t){var e;this.props.map!==t&&(this.props.bumpMap=t,this.programDirty=!0),this.defines.USE_BUMPMAP=!!t,this.setUniforms(((e={})[nw.BUMP_MAP]=t,e[nw.BUMP_SCALE]=this.bumpScale,e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bumpScale",{get:function(){return this.props.bumpScale},set:function(t){var e;this.props.bumpScale=t,this.setUniforms(((e={})[nw.BUMP_SCALE]=t,e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"doubleSide",{get:function(){return this.props.doubleSide},set:function(t){this.props.doubleSide=t,this.defines.USE_DOUBLESIDE=t},enumerable:!1,configurable:!0})}(rw);var iw;!function(t){t.EMISSIVE="u_Emissive",t.BUMP_SCALE="u_BumpScale",t.BUMP_MAP="u_BumpMap"}(iw||(iw={}));var ow,aw=function(t){function e(e,n){var r,o=t.call(this,e,i({vertexShader:"#define GLSLIFY 1\n#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n\n#ifndef saturate\n #define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\n\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\n\n// expects values in the range of [0,1]x[0,1], returns values in the [0,1] range.\n// do not collapse into a single function per: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\nhighp float rand( const in vec2 uv ) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\n return fract( sin( sn ) * c );\n}\n\nmat3 transposeMat3(mat3 inMatrix) {\n vec3 i0 = inMatrix[0];\n vec3 i1 = inMatrix[1];\n vec3 i2 = inMatrix[2];\n\n mat3 outMatrix = mat3(\n vec3(i0.x, i1.x, i2.x),\n vec3(i0.y, i1.y, i2.y),\n vec3(i0.z, i1.z, i2.z)\n );\n\n return outMatrix;\n}\n\n// https://github.com/glslify/glsl-inverse/blob/master/index.glsl\nmat3 inverseMat3(mat3 inMatrix) {\n float a00 = inMatrix[0][0], a01 = inMatrix[0][1], a02 = inMatrix[0][2];\n float a10 = inMatrix[1][0], a11 = inMatrix[1][1], a12 = inMatrix[1][2];\n float a20 = inMatrix[2][0], a21 = inMatrix[2][1], a22 = inMatrix[2][2];\n\n float b01 = a22 * a11 - a12 * a21;\n float b11 = -a22 * a10 + a12 * a20;\n float b21 = a21 * a10 - a11 * a20;\n\n float det = a00 * b01 + a01 * b11 + a02 * b21;\n\n return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\n b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\n b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\n}\n\nstruct DirectionalLight {\n vec3 direction;\n float intensity;\n vec3 color;\n};\n\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\n\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\n\nstruct GeometricContext {\n vec3 position;\n vec3 normal;\n vec3 viewDir;\n};\nlayout(std140) uniform ub_SceneParams {\n mat4 u_ProjectionMatrix;\n mat4 u_ViewMatrix;\n vec3 u_CameraPosition;\n float u_DevicePixelRatio;\n vec2 u_Viewport;\n float u_IsOrtho;\n float u_IsPicking;\n};\nlayout(std140) uniform ub_MaterialParams {\n #ifdef USE_WIREFRAME\n vec3 u_WireframeLineColor;\n float u_WireframeLineWidth;\n #endif\n\n #ifdef USE_FOG\n vec4 u_FogInfos;\n vec3 u_FogColor;\n #endif\n\n vec3 u_Emissive;\n\n #ifdef USE_LIGHT\n #ifdef USE_BUMPMAP\n float u_BumpScale;\n #endif\n\n #ifdef NUM_AMBIENT_LIGHTS\n vec3 u_AmbientLightColor;\n #endif\n\n #ifdef NUM_DIR_LIGHTS\n DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n #endif\n #endif\n};\n\nlayout(location = MODEL_MATRIX0) in vec4 a_ModelMatrix0;\nlayout(location = MODEL_MATRIX1) in vec4 a_ModelMatrix1;\nlayout(location = MODEL_MATRIX2) in vec4 a_ModelMatrix2;\nlayout(location = MODEL_MATRIX3) in vec4 a_ModelMatrix3;\nlayout(location = PACKED_COLOR) in vec4 a_PackedColor;\nlayout(location = PACKED_STYLE1) in vec4 a_StylePacked1;\nlayout(location = PACKED_STYLE2) in vec4 a_StylePacked2;\nlayout(location = PICKING_COLOR) in vec4 a_PickingColor;\n\nout vec4 v_PickingResult;\nout vec4 v_Color;\nout vec4 v_StrokeColor;\nout vec4 v_StylePacked1;\nout vec4 v_StylePacked2;\n\n#define COLOR_SCALE 1. / 255.\nvoid setPickingColor(vec3 pickingColor) {\n v_PickingResult.rgb = pickingColor * COLOR_SCALE;\n}\n\nvec2 unpack_float(const float packedValue) {\n int packedIntValue = int(packedValue);\n int v0 = packedIntValue / 256;\n return vec2(v0, packedIntValue - v0 * 256);\n}\nvec4 decode_color(const vec2 encodedColor) {\n return vec4(\n unpack_float(encodedColor[0]) / 255.0,\n unpack_float(encodedColor[1]) / 255.0\n );\n}\nvec4 project(vec4 pos, mat4 pm, mat4 vm, mat4 mm) {\n return pm * vm * mm * pos;\n}\n\nlayout(location = POSITION) in vec3 a_Position;\nlayout(location = NORMAL) in vec3 a_Normal;\n\n#ifdef USE_UV\n layout(location = UV) in vec2 a_Uv;\n out vec2 v_Uv;\n#endif\n\n#ifdef USE_WIREFRAME\n layout(location = BARYCENTRIC) in vec3 a_Barycentric;\n out vec3 v_Barycentric;\n#endif\n\nout vec3 v_ViewPosition;\nout vec3 v_Normal;\n\nvoid main() {\n vec4 a_Color = decode_color(a_PackedColor.xy);\nvec4 a_StrokeColor = decode_color(a_PackedColor.zw);\n\nmat4 u_ModelMatrix = mat4(a_ModelMatrix0, a_ModelMatrix1, a_ModelMatrix2, a_ModelMatrix3);\nvec4 u_StrokeColor = a_StrokeColor;\nfloat u_Opacity = a_StylePacked1.x;\nfloat u_FillOpacity = a_StylePacked1.y;\nfloat u_StrokeOpacity = a_StylePacked1.z;\nfloat u_StrokeWidth = a_StylePacked1.w;\nfloat u_ZIndex = a_PickingColor.w;\nvec2 u_Anchor = a_StylePacked2.yz;\nfloat u_IncreasedLineWidthForHitTesting = a_StylePacked2.w;\n\nsetPickingColor(a_PickingColor.xyz);\n\nv_Color = a_Color;\nv_StrokeColor = a_StrokeColor;\nv_StylePacked1 = a_StylePacked1;\nv_StylePacked2 = a_StylePacked2;\n\n// #ifdef CLIPSPACE_NEAR_ZERO\n// gl_Position.z = (gl_Position.z + gl_Position.w) * 0.5;\n// #endif\n\n vec4 position = vec4(a_Position, 1.0);\n\n gl_Position = project(position, u_ProjectionMatrix, u_ViewMatrix, u_ModelMatrix);\n\n vec4 mvPosition = u_ViewMatrix * u_ModelMatrix * position;\n v_ViewPosition = - mvPosition.xyz;\n\n // v_ViewPosition = vec3(mvPosition) / mvPosition.w;\n\n mat3 normalWorld = mat3(transposeMat3(inverseMat3(mat3(u_ViewMatrix * u_ModelMatrix))));\n v_Normal = normalize(normalWorld * a_Normal);\n\n #ifdef USE_UV\n v_Uv = a_Uv;\n #ifdef VIEWPORT_ORIGIN_TL\n v_Uv.y = 1.0 - v_Uv.y;\n #endif\n#endif\n\n #ifdef USE_WIREFRAME\n v_Barycentric = a_Barycentric;\n#endif\n\n}",fragmentShader:"#define GLSLIFY 1\n#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n\n#ifndef saturate\n #define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\n\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\n\n// expects values in the range of [0,1]x[0,1], returns values in the [0,1] range.\n// do not collapse into a single function per: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\nhighp float rand( const in vec2 uv ) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\n return fract( sin( sn ) * c );\n}\n\nmat3 transposeMat3(mat3 inMatrix) {\n vec3 i0 = inMatrix[0];\n vec3 i1 = inMatrix[1];\n vec3 i2 = inMatrix[2];\n\n mat3 outMatrix = mat3(\n vec3(i0.x, i1.x, i2.x),\n vec3(i0.y, i1.y, i2.y),\n vec3(i0.z, i1.z, i2.z)\n );\n\n return outMatrix;\n}\n\n// https://github.com/glslify/glsl-inverse/blob/master/index.glsl\nmat3 inverseMat3(mat3 inMatrix) {\n float a00 = inMatrix[0][0], a01 = inMatrix[0][1], a02 = inMatrix[0][2];\n float a10 = inMatrix[1][0], a11 = inMatrix[1][1], a12 = inMatrix[1][2];\n float a20 = inMatrix[2][0], a21 = inMatrix[2][1], a22 = inMatrix[2][2];\n\n float b01 = a22 * a11 - a12 * a21;\n float b11 = -a22 * a10 + a12 * a20;\n float b21 = a21 * a10 - a11 * a20;\n\n float det = a00 * b01 + a01 * b11 + a02 * b21;\n\n return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\n b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\n b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\n}\n\nstruct DirectionalLight {\n vec3 direction;\n float intensity;\n vec3 color;\n};\n\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\n\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\n\nstruct GeometricContext {\n vec3 position;\n vec3 normal;\n vec3 viewDir;\n};\nlayout(std140) uniform ub_SceneParams {\n mat4 u_ProjectionMatrix;\n mat4 u_ViewMatrix;\n vec3 u_CameraPosition;\n float u_DevicePixelRatio;\n vec2 u_Viewport;\n float u_IsOrtho;\n float u_IsPicking;\n};\nlayout(std140) uniform ub_MaterialParams {\n #ifdef USE_WIREFRAME\n vec3 u_WireframeLineColor;\n float u_WireframeLineWidth;\n #endif\n\n #ifdef USE_FOG\n vec4 u_FogInfos;\n vec3 u_FogColor;\n #endif\n\n vec3 u_Emissive;\n\n #ifdef USE_LIGHT\n #ifdef USE_BUMPMAP\n float u_BumpScale;\n #endif\n\n #ifdef NUM_AMBIENT_LIGHTS\n vec3 u_AmbientLightColor;\n #endif\n\n #ifdef NUM_DIR_LIGHTS\n DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n #endif\n #endif\n};\n\nin vec4 v_PickingResult;\nin vec4 v_Color;\nin vec4 v_StrokeColor;\nin vec4 v_StylePacked1;\nin vec4 v_StylePacked2;\n#ifdef USE_UV\n in vec2 v_Uv;\n#endif\n#ifdef USE_MAP\n uniform sampler2D u_Map;\n#endif\n#if defined(USE_BUMPMAP) && defined(USE_LIGHT)\n uniform sampler2D u_BumpMap;\n\n // Bump Mapping Unparametrized Surfaces on the GPU by Morten S. Mikkelsen\n // http://api.unrealengine.com/attachments/Engine/Rendering/LightingAndShadows/BumpMappingWithoutTangentSpace/mm_sfgrad_bump.pdf\n\n // Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\n\n vec2 dHdxy_fwd() {\n vec2 dSTdx = dFdx( v_Uv );\n vec2 dSTdy = dFdy( v_Uv );\n\n float Hll = u_BumpScale * texture(SAMPLER_2D(u_BumpMap), v_Uv ).x;\n float dBx = u_BumpScale * texture(SAMPLER_2D(u_BumpMap), v_Uv + dSTdx ).x - Hll;\n float dBy = u_BumpScale * texture(SAMPLER_2D(u_BumpMap), v_Uv + dSTdy ).x - Hll;\n\n return vec2( dBx, dBy );\n }\n\n vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\n // Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\n\n vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n vec3 vN = surf_norm;\t\t// normalized\n\n vec3 R1 = cross( vSigmaY, vN );\n vec3 R2 = cross( vN, vSigmaX );\n\n float fDet = dot( vSigmaX, R1 ) * faceDirection;\n\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n return normalize( abs( fDet ) * surf_norm - vGrad );\n }\n#endif\n#ifdef USE_SPECULARMAP\n uniform sampler2D u_SpecularMap;\n#endif\nvec3 BRDF_Lambert(const in vec3 diffuseColor) {\n return RECIPROCAL_PI * diffuseColor;\n}\n\nvec3 F_Schlick(\n const in vec3 f0,\n const in float f90,\n const in float dotVH\n) {\n // Original approximation by Christophe Schlick '94\n // float fresnel = pow( 1.0 - dotVH, 5.0 );\n\n // Optimized variant (presented by Epic at SIGGRAPH '13)\n // https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\n\nfloat G_BlinnPhong_Implicit( /* const in float dotNL, const in float dotNV */ ) {\n // geometry term is (n dot l)(n dot v) / 4(n dot l)(n dot v)\n return 0.25;\n}\n\nfloat D_BlinnPhong(\n const in float shininess,\n const in float dotNH\n) {\n return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\n\nvec3 BRDF_BlinnPhong(\n const in vec3 lightDir,\n const in vec3 viewDir,\n const in vec3 normal,\n const in vec3 specularColor,\n const in float shininess\n) {\n vec3 halfDir = normalize( lightDir + viewDir );\n\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n\n vec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\n float G = G_BlinnPhong_Implicit( /* dotNL, dotNV */ );\n\n float D = D_BlinnPhong( shininess, dotNH );\n\n return F * ( G * D );\n}\n\n#ifdef USE_WIREFRAME\n in vec3 v_Barycentric;\n\n float edgeFactor() {\n vec3 d = fwidth(v_Barycentric);\n vec3 a3 = smoothstep(vec3(0.0), d * u_WireframeLineWidth, v_Barycentric);\n return min(min(a3.x, a3.y), a3.z);\n }\n#endif\n\n#ifdef USE_FOG\n #define FOGMODE_NONE 0.\n #define FOGMODE_EXP 1.\n #define FOGMODE_EXP2 2.\n #define FOGMODE_LINEAR 3.\n\n // in float v_FogDepth;\n\n float dBlendModeFogFactor = 1.0;\n\n vec3 addFog(vec3 color) {\n float depth = gl_FragCoord.z / gl_FragCoord.w;\n // float depth = v_FogDepth;\n float fogFactor;\n float fogStart = u_FogInfos.y;\n float fogEnd = u_FogInfos.z;\n float fogDensity = u_FogInfos.w;\n\n if (u_FogInfos.x == FOGMODE_NONE) {\n fogFactor = 1.0;\n } else if (u_FogInfos.x == FOGMODE_EXP) {\n fogFactor = exp(-depth * fogDensity);\n } else if (u_FogInfos.x == FOGMODE_EXP2) {\n fogFactor = exp(-depth * depth * fogDensity * fogDensity);\n } else if (u_FogInfos.x == FOGMODE_LINEAR) {\n fogFactor = (fogEnd - depth) / (fogEnd - fogStart);\n }\n\n fogFactor = clamp(fogFactor, 0.0, 1.0);\n return mix(u_FogColor * dBlendModeFogFactor, color, fogFactor);\n }\n#endif\n\n#ifdef USE_LIGHT\n void getDirectionalLightInfo(\n const in DirectionalLight directionalLight, \n const in GeometricContext geometry,\n out IncidentLight light\n ) {\n light.color = directionalLight.color * directionalLight.intensity;\n light.direction = normalize(directionalLight.direction);\n light.visible = true;\n }\n\n vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n vec3 irradiance = ambientLightColor;\n return irradiance;\n }\n#endif\nstruct LambertMaterial {\n vec3 diffuseColor;\n float specularStrength;\n};\n\nvoid RE_Direct_Lambert(\n const in IncidentLight directLight,\n const in GeometricContext geometry,\n const in LambertMaterial material,\n inout ReflectedLight reflectedLight\n) {\n float dotNL = saturate(dot(geometry.normal, directLight.direction));\n vec3 irradiance = dotNL * directLight.color;\n\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert(material.diffuseColor);\n}\n\nvoid RE_IndirectDiffuse_Lambert(\n const in vec3 irradiance,\n const in GeometricContext geometry,\n const in LambertMaterial material,\n inout ReflectedLight reflectedLight\n) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert(material.diffuseColor);\n}\n\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert\n\nin vec3 v_ViewPosition;\nin vec3 v_Normal;\n\nout vec4 outputColor;\n\nvoid main() {\n vec4 u_Color = v_Color;\nvec4 u_StrokeColor = v_StrokeColor;\nfloat u_Opacity = v_StylePacked1.x;\nfloat u_FillOpacity = v_StylePacked1.y;\nfloat u_StrokeOpacity = v_StylePacked1.z;\nfloat u_StrokeWidth = v_StylePacked1.w;\nfloat u_Visible = v_StylePacked2.x;\nvec3 u_PickingColor = v_PickingResult.xyz;\n\nif (u_Visible < 0.5) {\n discard;\n}\n\n // diffusemap\n #ifdef USE_MAP\n #ifdef USE_PATTERN\n vec4 texelColor = texture(SAMPLER_2D(u_Map), v_Uv);\n u_Color = texelColor;\n #else\n vec4 texelColor = texture(SAMPLER_2D(u_Map), v_Uv);\n u_Color = texelColor;\n #endif\n#endif\n // specularmap\n float specularStrength = 1.0;\n\n#ifdef USE_SPECULARMAP\n vec4 texelSpecular = texture(SAMPLER_2D(u_SpecularMap), v_Uv);\n specularStrength = texelSpecular.r;\n#endif\n // bumpmap & normalmap\n float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\nvec3 normal = normalize(v_Normal);\n#ifdef USE_DOUBLESIDE\n normal = normal * faceDirection;\n#endif\n\n// #ifdef USE_TANGENT\n// vec3 tangent = normalize( vTangent );\n// vec3 bitangent = normalize( vBitangent );\n\n// #ifdef DOUBLE_SIDED\n// tangent = tangent * faceDirection;\n// bitangent = bitangent * faceDirection;\n// #endif\n\n// #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\n// mat3 vTBN = mat3( tangent, bitangent, normal );\n\n// #endif\n// #endif\n #ifdef OBJECTSPACE_NORMALMAP\n // normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; // overrides both flatShading and attribute normals\n\n // #ifdef FLIP_SIDED\n // normal = - normal;\n // #endif\n\n // #ifdef DOUBLE_SIDED\n // normal = normal * faceDirection;\n // #endif\n\n // normal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n // vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n // mapN.xy *= normalScale;\n\n // #ifdef USE_TANGENT\n // normal = normalize( vTBN * mapN );\n // #else\n // normal = perturbNormal2Arb( - v_ViewPosition, normal, mapN, faceDirection );\n // #endif\n\n#elif defined(USE_BUMPMAP) && defined(USE_LIGHT)\n normal = perturbNormalArb( - v_ViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif\n\n if (u_IsPicking > 0.5) {\n if (u_PickingColor.x == 0.0 && u_PickingColor.y == 0.0 && u_PickingColor.z == 0.0) {\n discard;\n }\n outputColor = vec4(u_PickingColor, 1.0);\n } else {\n outputColor = u_Color;\n outputColor.a = outputColor.a * u_Opacity;\n\n vec4 diffuseColor = outputColor;\n ReflectedLight reflectedLight = ReflectedLight(vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ));\n vec3 totalEmissiveRadiance = u_Emissive;\n\n // calculate lighting accumulation\n LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;\n GeometricContext geometry;\ngeometry.position = - v_ViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = u_IsOrtho == 1.0 ? vec3(0, 0, 1) : normalize(v_ViewPosition);\n\nIncidentLight directLight;\n#if defined( NUM_DIR_LIGHTS ) && ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n directionalLight = directionalLights[ i ];\n\n getDirectionalLightInfo( directionalLight, geometry, directLight );\n\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n\n RE_Direct( directLight, geometry, material, reflectedLight );\n }\n #pragma unroll_loop_end\n\n#endif\n\n#if defined( RE_IndirectDiffuse )\n vec3 iblIrradiance = vec3(0.0);\n vec3 ambient = vec3(0.0);\n #ifdef NUM_AMBIENT_LIGHTS\n ambient = u_AmbientLightColor;\n #endif\n vec3 irradiance = getAmbientLightIrradiance(ambient);\n\n // irradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n // #if ( NUM_HEMI_LIGHTS > 0 )\n // #pragma unroll_loop_start\n // for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n // irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n // }\n // #pragma unroll_loop_end\n // #endif\n#endif\n\n#if defined( RE_IndirectSpecular )\n vec3 radiance = vec3( 0.0 );\n vec3 clearcoatRadiance = vec3( 0.0 );\n#endif\n\n #if defined( RE_IndirectDiffuse )\n RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n\n#if defined( RE_IndirectSpecular )\n RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif\n\n vec3 outgoingLight = reflectedLight.directDiffuse +\n reflectedLight.indirectDiffuse + \n totalEmissiveRadiance;\n\n outputColor = vec4(outgoingLight, diffuseColor.a);\n\n #ifdef USE_WIREFRAME\n vec3 color = mix(outputColor.xyz, u_WireframeLineColor, (1.0 - edgeFactor()));\n outputColor.xyz = color;\n#endif\n #ifdef USE_FOG\n outputColor.rgb = addFog(outputColor.rgb);\n#endif\n }\n}",emissive:"black",bumpScale:1,doubleSide:!1},n))||this,a=o,s=a.bumpMap,c=a.doubleSide,l=a.emissive,u=Ri(l);return o.setUniforms(((r={u_Placeholder:null})[iw.EMISSIVE]=[Number(u.r)/255,Number(u.g)/255,Number(u.b)/255],r)),s&&(o.bumpMap=s),o.doubleSide=c,o.defines=i(i({},o.defines),{USE_LIGHT:!0}),o}return r(e,t),Object.defineProperty(e.prototype,"emissive",{get:function(){return this.props.emissive},set:function(t){var e;this.props.emissive=t;var n=Ri(t);this.setUniforms(((e={})[iw.EMISSIVE]=[Number(n.r)/255,Number(n.g)/255,Number(n.b)/255],e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bumpMap",{get:function(){return this.props.bumpMap},set:function(t){var e;this.props.map!==t&&(this.props.bumpMap=t,this.programDirty=!0),this.defines.USE_BUMPMAP=!!t,this.setUniforms(((e={})[iw.BUMP_MAP]=t,e[iw.BUMP_SCALE]=this.bumpScale,e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bumpScale",{get:function(){return this.props.bumpScale},set:function(t){var e;this.props.bumpScale=t,this.setUniforms(((e={})[iw.BUMP_SCALE]=t,e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"doubleSide",{get:function(){return this.props.doubleSide},set:function(t){this.props.doubleSide=t,this.defines.USE_DOUBLESIDE=t},enumerable:!1,configurable:!0}),e}(rw);!function(t){t.MAP="u_Map",t.PLACE_HOLDER="u_Placeholder",t.SIZE="u_Size"}(ow||(ow={})),function(t){function e(e,n){var r,o=t.call(this,e,i({vertexShader:"#define GLSLIFY 1\nlayout(std140) uniform ub_SceneParams {\n mat4 u_ProjectionMatrix;\n mat4 u_ViewMatrix;\n vec3 u_CameraPosition;\n float u_DevicePixelRatio;\n vec2 u_Viewport;\n float u_IsOrtho;\n float u_IsPicking;\n};\nlayout(std140) uniform ub_MaterialParams {\n #ifdef USE_WIREFRAME\n vec3 u_WireframeLineColor;\n float u_WireframeLineWidth;\n #endif\n\n #ifdef USE_FOG\n vec4 u_FogInfos;\n vec3 u_FogColor;\n #endif\n\n float u_Size;\n vec4 u_Placeholder;\n};\n\nlayout(location = MODEL_MATRIX0) in vec4 a_ModelMatrix0;\nlayout(location = MODEL_MATRIX1) in vec4 a_ModelMatrix1;\nlayout(location = MODEL_MATRIX2) in vec4 a_ModelMatrix2;\nlayout(location = MODEL_MATRIX3) in vec4 a_ModelMatrix3;\nlayout(location = PACKED_COLOR) in vec4 a_PackedColor;\nlayout(location = PACKED_STYLE1) in vec4 a_StylePacked1;\nlayout(location = PACKED_STYLE2) in vec4 a_StylePacked2;\nlayout(location = PICKING_COLOR) in vec4 a_PickingColor;\n\nout vec4 v_PickingResult;\nout vec4 v_Color;\nout vec4 v_StrokeColor;\nout vec4 v_StylePacked1;\nout vec4 v_StylePacked2;\n\n#define COLOR_SCALE 1. / 255.\nvoid setPickingColor(vec3 pickingColor) {\n v_PickingResult.rgb = pickingColor * COLOR_SCALE;\n}\n\nvec2 unpack_float(const float packedValue) {\n int packedIntValue = int(packedValue);\n int v0 = packedIntValue / 256;\n return vec2(v0, packedIntValue - v0 * 256);\n}\nvec4 decode_color(const vec2 encodedColor) {\n return vec4(\n unpack_float(encodedColor[0]) / 255.0,\n unpack_float(encodedColor[1]) / 255.0\n );\n}\nvec4 project(vec4 pos, mat4 pm, mat4 vm, mat4 mm) {\n return pm * vm * mm * pos;\n}\n\nlayout(location = POSITION) in vec3 a_Position;\n\n#ifdef USE_UV\n layout(location = UV) in vec2 a_Uv;\n out vec2 v_Uv;\n#endif\n\n#ifdef USE_WIREFRAME\n layout(location = BARYCENTRIC) in vec3 a_Barycentric;\n out vec3 v_Barycentric;\n#endif\n\nvoid main() {\n vec4 a_Color = decode_color(a_PackedColor.xy);\nvec4 a_StrokeColor = decode_color(a_PackedColor.zw);\n\nmat4 u_ModelMatrix = mat4(a_ModelMatrix0, a_ModelMatrix1, a_ModelMatrix2, a_ModelMatrix3);\nvec4 u_StrokeColor = a_StrokeColor;\nfloat u_Opacity = a_StylePacked1.x;\nfloat u_FillOpacity = a_StylePacked1.y;\nfloat u_StrokeOpacity = a_StylePacked1.z;\nfloat u_StrokeWidth = a_StylePacked1.w;\nfloat u_ZIndex = a_PickingColor.w;\nvec2 u_Anchor = a_StylePacked2.yz;\nfloat u_IncreasedLineWidthForHitTesting = a_StylePacked2.w;\n\nsetPickingColor(a_PickingColor.xyz);\n\nv_Color = a_Color;\nv_StrokeColor = a_StrokeColor;\nv_StylePacked1 = a_StylePacked1;\nv_StylePacked2 = a_StylePacked2;\n\n// #ifdef CLIPSPACE_NEAR_ZERO\n// gl_Position.z = (gl_Position.z + gl_Position.w) * 0.5;\n// #endif\n\n gl_PointSize = u_Size;\n gl_Position = project(vec4(a_Position, 1.0), u_ProjectionMatrix, u_ViewMatrix, u_ModelMatrix);\n\n #ifdef USE_UV\n v_Uv = a_Uv;\n #ifdef VIEWPORT_ORIGIN_TL\n v_Uv.y = 1.0 - v_Uv.y;\n #endif\n#endif\n\n #ifdef USE_WIREFRAME\n v_Barycentric = a_Barycentric;\n#endif\n\n}",fragmentShader:"#define GLSLIFY 1\n#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n\n#ifndef saturate\n #define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\n\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\n\n// expects values in the range of [0,1]x[0,1], returns values in the [0,1] range.\n// do not collapse into a single function per: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\nhighp float rand( const in vec2 uv ) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\n return fract( sin( sn ) * c );\n}\n\nmat3 transposeMat3(mat3 inMatrix) {\n vec3 i0 = inMatrix[0];\n vec3 i1 = inMatrix[1];\n vec3 i2 = inMatrix[2];\n\n mat3 outMatrix = mat3(\n vec3(i0.x, i1.x, i2.x),\n vec3(i0.y, i1.y, i2.y),\n vec3(i0.z, i1.z, i2.z)\n );\n\n return outMatrix;\n}\n\n// https://github.com/glslify/glsl-inverse/blob/master/index.glsl\nmat3 inverseMat3(mat3 inMatrix) {\n float a00 = inMatrix[0][0], a01 = inMatrix[0][1], a02 = inMatrix[0][2];\n float a10 = inMatrix[1][0], a11 = inMatrix[1][1], a12 = inMatrix[1][2];\n float a20 = inMatrix[2][0], a21 = inMatrix[2][1], a22 = inMatrix[2][2];\n\n float b01 = a22 * a11 - a12 * a21;\n float b11 = -a22 * a10 + a12 * a20;\n float b21 = a21 * a10 - a11 * a20;\n\n float det = a00 * b01 + a01 * b11 + a02 * b21;\n\n return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\n b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\n b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\n}\n\nstruct DirectionalLight {\n vec3 direction;\n float intensity;\n vec3 color;\n};\n\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\n\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\n\nstruct GeometricContext {\n vec3 position;\n vec3 normal;\n vec3 viewDir;\n};\nlayout(std140) uniform ub_SceneParams {\n mat4 u_ProjectionMatrix;\n mat4 u_ViewMatrix;\n vec3 u_CameraPosition;\n float u_DevicePixelRatio;\n vec2 u_Viewport;\n float u_IsOrtho;\n float u_IsPicking;\n};\nlayout(std140) uniform ub_MaterialParams {\n #ifdef USE_WIREFRAME\n vec3 u_WireframeLineColor;\n float u_WireframeLineWidth;\n #endif\n\n #ifdef USE_FOG\n vec4 u_FogInfos;\n vec3 u_FogColor;\n #endif\n\n float u_Size;\n vec4 u_Placeholder;\n};\n\nin vec4 v_PickingResult;\nin vec4 v_Color;\nin vec4 v_StrokeColor;\nin vec4 v_StylePacked1;\nin vec4 v_StylePacked2;\n#ifdef USE_MAP\n uniform sampler2D u_Map;\n#endif\n#ifdef USE_FOG\n #define FOGMODE_NONE 0.\n #define FOGMODE_EXP 1.\n #define FOGMODE_EXP2 2.\n #define FOGMODE_LINEAR 3.\n\n // in float v_FogDepth;\n\n float dBlendModeFogFactor = 1.0;\n\n vec3 addFog(vec3 color) {\n float depth = gl_FragCoord.z / gl_FragCoord.w;\n // float depth = v_FogDepth;\n float fogFactor;\n float fogStart = u_FogInfos.y;\n float fogEnd = u_FogInfos.z;\n float fogDensity = u_FogInfos.w;\n\n if (u_FogInfos.x == FOGMODE_NONE) {\n fogFactor = 1.0;\n } else if (u_FogInfos.x == FOGMODE_EXP) {\n fogFactor = exp(-depth * fogDensity);\n } else if (u_FogInfos.x == FOGMODE_EXP2) {\n fogFactor = exp(-depth * depth * fogDensity * fogDensity);\n } else if (u_FogInfos.x == FOGMODE_LINEAR) {\n fogFactor = (fogEnd - depth) / (fogEnd - fogStart);\n }\n\n fogFactor = clamp(fogFactor, 0.0, 1.0);\n return mix(u_FogColor * dBlendModeFogFactor, color, fogFactor);\n }\n#endif\n\nout vec4 outputColor;\n\nvoid main() {\n vec4 u_Color = v_Color;\nvec4 u_StrokeColor = v_StrokeColor;\nfloat u_Opacity = v_StylePacked1.x;\nfloat u_FillOpacity = v_StylePacked1.y;\nfloat u_StrokeOpacity = v_StylePacked1.z;\nfloat u_StrokeWidth = v_StylePacked1.w;\nfloat u_Visible = v_StylePacked2.x;\nvec3 u_PickingColor = v_PickingResult.xyz;\n\nif (u_Visible < 0.5) {\n discard;\n}\n #ifdef USE_MAP\n vec2 uv = vec2(gl_PointCoord.x, 1.0 - gl_PointCoord.y);\n\tvec4 mapTexel = texture(SAMPLER_2D(u_Map), uv);\n u_Color *= mapTexel;\n#endif\n\n if (u_IsPicking > 0.5) {\n if (u_PickingColor.x == 0.0 && u_PickingColor.y == 0.0 && u_PickingColor.z == 0.0) {\n discard;\n }\n outputColor = vec4(u_PickingColor, 1.0);\n } else {\n outputColor = u_Color;\n outputColor.a = outputColor.a * u_Opacity;\n vec4 diffuseColor = outputColor;\n\n vec3 outgoingLight = diffuseColor.rgb;\n \n outputColor = vec4(outgoingLight, diffuseColor.a);\n\n #ifdef USE_FOG\n outputColor.rgb = addFog(outputColor.rgb);\n#endif\n }\n}",cullMode:nO.BACK},n))||this;o.defines=i(i({},o.defines),{USE_UV:!0,USE_MAP:!1,USE_WIREFRAME:!1,USE_FOG:!1,USE_LIGHT:!1});var a=n||{},s=a.map,c=a.size;return s&&(o.map=s),o.setUniforms(((r={})[ow.PLACE_HOLDER]=[0,0,0,0],r[ow.SIZE]=c||1,r)),o}r(e,t),Object.defineProperty(e.prototype,"map",{get:function(){return this.props.map},set:function(t){var e;this.props.map!==t&&(this.props.map=t,this.programDirty=!0),this.setUniforms(((e={})[ow.MAP]=t,e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.props.size},set:function(t){var e;this.props.size=t,this.setUniforms(((e={})[ow.SIZE]=t,e))},enumerable:!1,configurable:!0})}(zP),function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="3d",e}r(e,t),e.prototype.init=function(){},e.prototype.destroy=function(){}}(Kn);const sw=(t,e)=>{const n=o(t,[]);if(!e.sphereGeometry){const t=e.canvas.getConfig().renderer.getPlugin("device-renderer").getDevice();e.sphereGeometry=new tw(t,{radius:5,latitudeBands:32,longitudeBands:32}),e.sphereMaterial=new aw(t)}return(r,i,o)=>{const{color:a}=o,{color:s=a,transform:c,opacity:l}=i,[u,f,d]=Ib(r),h=i.size||n.r||o.r,p=new RO({style:{x:u,y:f,z:d,geometry:e.sphereGeometry,material:e.sphereMaterial}});p.setOrigin(0,0,0);const g=h/5;return p.scale(g),gf(p).call(Tb,o).style("fill",s).style("transform",c).style(wb(t),l).call(Tb,n).node()}};sw.props={defaultMarker:"sphere"};const cw=(t,e)=>{const n=o(t,[]);if(!e.cubeGeometry){const t=e.canvas.getConfig().renderer.getPlugin("device-renderer").getDevice();e.cubeGeometry=new JC(t,{width:10,height:10,depth:10}),e.cubeMaterial=new aw(t)}return(r,i,o)=>{const{color:a}=o,{color:s=a,transform:c,opacity:l}=i,[u,f,d]=Ib(r),h=i.size||n.r||o.r,p=new RO({style:{x:u,y:f,z:d,geometry:e.cubeGeometry,material:e.cubeMaterial}});p.setOrigin(0,0,0);const g=h/5;return p.scale(g),gf(p).call(Tb,o).style("fill",s).style("transform",c).style(wb(t),l).call(Tb,n).node()}};cw.props={defaultMarker:"cube"};const lw=(t,e)=>{const n=o(t,[]);if(!e.cubeGeometry){const t=e.canvas.getConfig().renderer.getPlugin("device-renderer").getDevice();e.cubeGeometry=new JC(t,{width:1,height:1,depth:1}),e.cubeMaterial=new aw(t)}return(r,i,o)=>{const a=r,{color:s}=o,{color:c=s,transform:l,opacity:u}=i,[f,d,h]=Ib(a),p=Math.abs(a[1][0]-a[0][0]),g=Math.abs(a[1][1]-a[0][1]),m=Math.abs(a[1][2]-a[0][2]),v=new RO({style:{x:f,y:d,z:h,geometry:e.cubeGeometry,material:e.cubeMaterial}});v.setOrigin(0,0,0),v.scale([p,g,m]);return gf(v).call(Tb,o).style("fill",c).style("transform",l).style(wb(t),u).call(Tb,n).node()}};lw.props={defaultMarker:"cube"};const uw=(t,e)=>{const{arrow:n=!0,arrowSize:r="40%"}=t,i=o(t,["arrow","arrowSize"]),{document:a}=e;return(t,e,s)=>{const{defaultColor:c}=s,l=o(s,["defaultColor"]),{color:u=c,transform:f}=e,[d,h]=t,p=iA();if(p.moveTo(...d),p.lineTo(...h),n){const[t,e]=function(t,e,n){const{arrowSize:r}=n,i="string"==typeof r?+parseFloat(r)/100*bb(t,e):r,o=Math.PI/6,a=Math.atan2(e[1]-t[1],e[0]-t[0]),s=Math.PI/2-a-o,c=a-o;return[[e[0]-i*Math.sin(s),e[1]-i*Math.cos(s)],[e[0]-i*Math.cos(c),e[1]-i*Math.sin(c)]]}(d,h,{arrowSize:r});p.moveTo(...h),p.lineTo(...t),p.moveTo(...h),p.lineTo(...e)}return gf(a.createElement("path",{})).call(Tb,l).style("d",p.toString()).style("stroke",u).style("transform",f).call(Tb,i).node()}};uw.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};function fw(t,e,n,r){const[[i,o],[a,s]]=e,[c,l]=function(t){const{min:[e,n],max:[r,i]}=t.getLocalBounds();let o=0,a=0;return e>0&&(o=e),r<0&&(o=r),n>0&&(a=n),i<0&&(a=i),[o,a]}(t);if(i===a&&o===s)return yA()([[0,0],[c,l]]);const u=[[i-a,o-s]].concat(n.length?n:[[0,0]]),f=[r[0]-a,r[1]-s],[d,h]=u;if(((t,e,n)=>{const r=bb(t,e),i=bb(e,n),o=bb(n,t);return(Math.pow(r,2)+Math.pow(i,2)-Math.pow(o,2))/(2*r*i)})(f,d,h)>0){const e=(()=>{const{min:e,max:n}=t.getLocalBounds(),r=d[0]+(d[1]-f[1])*(d[1]-0)/(d[0]-f[0]);return n[0]<f[0]?Math.min(n[0],r):Math.max(e[0],r)})();u.splice(1,1,[e,0])}return yA()(u)}const dw=$A((t=>{const e=t.attributes,{className:n,class:r,transform:i,rotate:a,labelTransform:s,labelTransformOrigin:c,x:l,y:u,x0:f=l,y0:d=u,text:h,background:p,connector:g,startMarker:m,endMarker:v,coordCenter:y,innerHTML:_}=e,b=o(e,["className","class","transform","rotate","labelTransform","labelTransformOrigin","x","y","x0","y0","text","background","connector","startMarker","endMarker","coordCenter","innerHTML"]);if([l,u,f,d].some((t=>!Ae(t))))return void t.children.forEach((t=>t.remove()));const E=cf(b,"background"),{padding:x}=E,M=o(E,["padding"]),S=cf(b,"connector"),{points:A=[]}=S,T=o(S,["points"]),O=[[+f,+d],[+l,+u]];let R;R=_?gf(t).maybeAppend("html","html",n).style("zIndex",0).style("innerHTML",_).call(Tb,Object.assign({transform:s,transformOrigin:c},b)).node():gf(t).maybeAppend("text","text").style("zIndex",0).style("text",h).call(Tb,Object.assign({textBaseline:"middle",transform:s,transformOrigin:c},b)).node();const P=gf(t).maybeAppend("background","rect").style("zIndex",-1).call(Tb,function(t,e=[]){const[n=0,r=0,i=n,o=r]=e,a=t.parentNode,s=a.getEulerAngles();a.setEulerAngles(0);const{min:c,halfExtents:l}=t.getLocalBounds(),[u,f]=c,[d,h]=l;return a.setEulerAngles(s),{x:u-o,y:f-n,width:2*d+o+r,height:2*h+n+i}}(R,x)).call(Tb,p?M:{}).node(),C=fw(P,O,A,y),w=m&&new Um({id:"startMarker",style:Object.assign({x:0,y:0},cf(b,"startMarker"))}),N=v&&new Um({id:"endMarker",style:Object.assign({x:0,y:0},cf(b,"endMarker"))});gf(t).maybeAppend("connector","path").style("zIndex",0).style("path",C).style("markerStart",w).style("markerEnd",N).call(Tb,g?T:{})})),hw=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const{color:o,text:a="",fontSize:s,rotate:c=0,transform:l=""}=r,u={text:String(a),stroke:o,fill:o,fontSize:s},[[f,d]]=e;return gf(new dw).style("x",f).style("y",d).call(Tb,i).style("transform",`${l}rotate(${+c})`).style("coordCenter",n.getCenter()).call(Tb,u).call(Tb,t).node()}};hw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const pw=$A((t=>{const e=o(t.attributes,["class","x","y"]),n=cf(e,"marker"),{size:r=24}=n,i=()=>function(t){const e=t/Math.sqrt(2),n=t*Math.sqrt(2),[r,i]=[-e,e-n],[o,a]=[0,0],[s,c]=[e,e-n];return[["M",r,i],["A",t,t,0,1,1,s,c],["L",o,a],["Z"]]}(r/2),a=gf(t).maybeAppend("marker",(()=>new Um({}))).call((t=>t.node().update(Object.assign({symbol:i},n)))).node(),[s,c]=function(t){const{min:e,max:n}=t.getLocalBounds();return[.5*(e[0]+n[0]),.5*(e[1]+n[1])]}(a);gf(t).maybeAppend("text","text").style("x",s).style("y",c).call(Tb,e)})),gw=(t,e)=>{const n=o(t,[]);return(t,e,r)=>{const{color:i}=r,a=o(r,["color"]),{color:s=i,text:c=""}=e,l={text:String(c),stroke:s,fill:s},[[u,f]]=t;return gf(new pw).call(Tb,a).style("x",u).style("y",f).call(Tb,l).call(Tb,n).node()}};gw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const mw=$A((t=>{const{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes,o=t.ownerDocument;gf(t).maybeAppend("connect-path",(()=>o.createElement("path",{}))).style("d",n).call(Tb,i),gf(t).maybeAppend("area-path",(()=>o.createElement("path",{}))).style("d",e).call(Tb,r)})),vw=(t,e)=>{const{curve:n,gradient:r=!1,defined:i=(t=>!Number.isNaN(t)&&null!=t),connect:a=!1}=t,s=o(t,["curve","gradient","defined","connect"]),{coordinate:c,document:l}=e;return(t,e,o)=>{const{color:u}=o,{color:f=u,seriesColor:d,seriesX:h,seriesY:p}=e,g=Nb(c,e),m=r&&d?Rb(d,h,p,r):f,v=Object.assign(Object.assign(Object.assign(Object.assign({},o),{stroke:m,fill:m}),g&&{transform:g}),s),[y,_]=function(t,e){const n=[],r=[],i=[];let o=!1,a=null;const s=t.length/2;for(let c=0;c<s;c++){const l=t[c],u=t[c+s];if([...l,...u].some((t=>!e(t))))o=!0;else{if(n.push(l),r.push(u),o&&a){o=!1;const[t,e]=a;i.push([t,l,e,u])}a=[l,u]}}return[n.concat(r),i]}(t,i),b=cf(v,"connect"),E=!!_.length,x=t=>gf(l.createElement("path",{})).style("d",t||"").call(Tb,v).node();if(t_(c)){const e=t=>{const e=c.getCenter(),r=t.slice(0,t.length/2),o=t.slice(t.length/2);return function(){var t=_A().curve(bA),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return MA(n())},delete t.lineX0,t.lineEndAngle=function(){return MA(r())},delete t.lineX1,t.lineInnerRadius=function(){return MA(i())},delete t.lineY0,t.lineOuterRadius=function(){return MA(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(xA(t)):e()._curve},t}().angle(((t,n)=>xb(yb(r[n],e)))).outerRadius(((t,n)=>bb(r[n],e))).innerRadius(((t,n)=>bb(o[n],e))).defined(((t,e)=>[...r[e],...o[e]].every(i))).curve(n)(o)};return!E||a&&!Object.keys(b).length?x(e(y)):E&&!a?x(e(t)):gf(new mw).style("areaStyle",v).style("connectStyle",Object.assign(Object.assign({},b),s)).style("areaPath",e(t)).style("connectPath",_.map(e).join("")).node()}{const e=t=>{const e=t.slice(0,t.length/2),r=t.slice(t.length/2);return Jy(c)?_A().y(((t,n)=>e[n][1])).x1(((t,n)=>e[n][0])).x0(((t,e)=>r[e][0])).defined(((t,n)=>[...e[n],...r[n]].every(i))).curve(n)(e):_A().x(((t,n)=>e[n][0])).y1(((t,n)=>e[n][1])).y0(((t,e)=>r[e][1])).defined(((t,n)=>[...e[n],...r[n]].every(i))).curve(n)(e)};return!E||a&&!Object.keys(b).length?x(e(y)):E&&!a?x(e(t)):gf(new mw).style("areaStyle",v).style("connectStyle",Object.assign(Object.assign({},b),s)).style("areaPath",e(t)).style("connectPath",_.map(e).join("")).node()}}};vw.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const yw=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=t_(n)?kA:gA;return vw(Object.assign({curve:i},t),e)(...r)}};yw.props=Object.assign(Object.assign({},vw.props),{defaultMarker:"square"});const _w=(t,e)=>{const{alpha:n=.5}=t,r=o(t,["alpha"]),{coordinate:i}=e;return(...t)=>{const o=t_(i)?NA:CA;return vw(Object.assign({curve:o.alpha(n)},r),e)(...t)}};_w.props=Object.assign(Object.assign({},vw.props),{defaultMarker:"smooth"});const bw=(t,e)=>(...n)=>vw(Object.assign({curve:DA},t),e)(...n);bw.props=Object.assign(Object.assign({},vw.props),{defaultMarker:"hvh"});const Ew=(t,e)=>(...n)=>vw(Object.assign({curve:BA},t),e)(...n);Ew.props=Object.assign(Object.assign({},vw.props),{defaultMarker:"vh"});const xw=(t,e)=>(...n)=>vw(Object.assign({curve:FA},t),e)(...n);xw.props=Object.assign(Object.assign({},vw.props),{defaultMarker:"hv"});const Mw=(t,e)=>{const{arrow:n=!1}=t;return(...r)=>uw(Object.assign(Object.assign({},t),{arrow:n}),e)(...r)};Mw.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Sw=(t,e)=>{const n=o(t,[]),{document:r}=e;return(t,e,i)=>{const{color:a}=i,s=o(i,["color"]),{color:c=a,transform:l}=e,[u,f]=t,d=iA();return d.moveTo(u[0],u[1]),d.bezierCurveTo(u[0]/2+f[0]/2,u[1],u[0]/2+f[0]/2,f[1],f[0],f[1]),gf(r.createElement("path",{})).call(Tb,s).style("d",d.toString()).style("stroke",c).style("transform",l).call(Tb,n).node()}};function Aw(t,e,n,r){const i=iA();if(t_(n)){const o=n.getCenter(),a=bb(t,o),s=(bb(e,o)-a)*r+a;return i.moveTo(t[0],t[1]),Ob(i,t,e,o,s),i.lineTo(e[0],e[1]),i}return Jy(n)?(i.moveTo(t[0],t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,e[1]),i.lineTo(e[0],e[1]),i):(i.moveTo(t[0],t[1]),i.lineTo(t[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],e[1]),i)}Sw.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Tw=(t,e)=>{const{cornerRatio:n=1/3}=t,r=o(t,["cornerRatio"]),{coordinate:i,document:a}=e;return(t,e,s)=>{const{defaultColor:c}=s,l=o(s,["defaultColor"]),{color:u=c,transform:f}=e,[d,h]=t,p=Aw(d,h,i,n);return gf(a.createElement("path",{})).call(Tb,l).style("d",p.toString()).style("stroke",u).style("transform",f).call(Tb,r).node()}};Tw.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Ow=(t,e)=>{const n=o(t,[]),{coordinate:r,document:i}=e;return(t,e,a)=>{const{color:s}=a,c=o(a,["color"]),{color:l=s,transform:u}=e,[f,d]=t,h=iA();if(h.moveTo(f[0],f[1]),t_(r)){const t=r.getCenter();h.quadraticCurveTo(t[0],t[1],d[0],d[1])}else{Ob(h,f,d,Ab(f,d),bb(f,d)/2)}return gf(i.createElement("path",{})).call(Tb,c).style("d",h.toString()).style("stroke",l).style("transform",u).call(Tb,n).node()}};function Rw(t,e){return t.parent===e.parent?1:2}function Pw(t,e){return t+e.x}function Cw(t,e){return Math.max(t,e.y)}function ww(){var t=Rw,e=1,n=1,r=!1;function i(i){var o,a=0;i.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce(Pw,0)/t.length}(n),e.y=function(t){return 1+t.reduce(Cw,0)}(n)):(e.x=o?a+=t(e,o):0,e.y=0,o=e)}));var s=function(t){for(var e;e=t.children;)t=e[0];return t}(i),c=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),l=s.x-t(s,c)/2,u=c.x+t(c,s)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*e,t.y=(i.y-t.y)*n}:function(t){t.x=(t.x-l)/(u-l)*e,t.y=(1-(i.y?t.y/i.y:1))*n})}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}function Nw(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function Iw(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=Lw)):void 0===e&&(e=kw);for(var n,r,i,o,a,s=new Fw(t),c=[s];n=c.pop();)if((i=e(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)c.push(r=i[o]=new Fw(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Bw)}function kw(t){return t.children}function Lw(t){return Array.isArray(t)?t[1]:null}function Dw(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Bw(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function Fw(t){this.data=t,this.depth=this.height=0,this.parent=null}function Uw(t){return null==t?null:jw(t)}function jw(t){if("function"!=typeof t)throw new Error;return t}function Gw(){return 0}function Ww(t){return function(){return t}}Ow.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},Fw.prototype=Iw.prototype={constructor:Fw,count:function(){return this.eachAfter(Nw)},each:function(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this},eachAfter:function(t,e){for(var n,r,i,o=this,a=[o],s=[],c=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)t.call(e,o,++c,this);return this},eachBefore:function(t,e){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(t.call(e,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return Iw(this).eachBefore(Dw)},[Symbol.iterator]:function*(){var t,e,n,r,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(yield i,e=i.children)for(n=0,r=e.length;n<r;++n)o.push(e[n])}while(o.length)}};const zw=1664525,Vw=1013904223,Hw=4294967296;function Xw(t,e){var n,r;if(qw(e,t))return[e];for(n=0;n<t.length;++n)if(Yw(e,t[n])&&qw(Zw(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(Yw(Zw(t[n],t[r]),e)&&Yw(Zw(t[n],e),t[r])&&Yw(Zw(t[r],e),t[n])&&qw(Qw(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}function Yw(t,e){var n=t.r-e.r,r=e.x-t.x,i=e.y-t.y;return n<0||n*n<r*r+i*i}function $w(t,e){var n=t.r-e.r+1e-9*Math.max(t.r,e.r,1),r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function qw(t,e){for(var n=0;n<e.length;++n)if(!$w(t,e[n]))return!1;return!0}function Kw(t){switch(t.length){case 1:return function(t){return{x:t.x,y:t.y,r:t.r}}(t[0]);case 2:return Zw(t[0],t[1]);case 3:return Qw(t[0],t[1],t[2])}}function Zw(t,e){var n=t.x,r=t.y,i=t.r,o=e.x,a=e.y,s=e.r,c=o-n,l=a-r,u=s-i,f=Math.sqrt(c*c+l*l);return{x:(n+o+c/f*u)/2,y:(r+a+l/f*u)/2,r:(f+i+s)/2}}function Qw(t,e,n){var r=t.x,i=t.y,o=t.r,a=e.x,s=e.y,c=e.r,l=n.x,u=n.y,f=n.r,d=r-a,h=r-l,p=i-s,g=i-u,m=c-o,v=f-o,y=r*r+i*i-o*o,_=y-a*a-s*s+c*c,b=y-l*l-u*u+f*f,E=h*p-d*g,x=(p*b-g*_)/(2*E)-r,M=(g*m-p*v)/E,S=(h*_-d*b)/(2*E)-i,A=(d*v-h*m)/E,T=M*M+A*A-1,O=2*(o+x*M+S*A),R=x*x+S*S-o*o,P=-(Math.abs(T)>1e-6?(O+Math.sqrt(O*O-4*T*R))/(2*T):R/O);return{x:r+x+M*P,y:i+S+A*P,r:P}}function Jw(t,e,n){var r,i,o,a,s=t.x-e.x,c=t.y-e.y,l=s*s+c*c;l?(i=e.r+n.r,i*=i,a=t.r+n.r,i>(a*=a)?(r=(l+a-i)/(2*l),o=Math.sqrt(Math.max(0,a/l-r*r)),n.x=t.x-r*s-o*c,n.y=t.y-r*c+o*s):(r=(l+i-a)/(2*l),o=Math.sqrt(Math.max(0,i/l-r*r)),n.x=e.x+r*s-o*c,n.y=e.y+r*c+o*s)):(n.x=e.x+n.r,n.y=e.y)}function tN(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function eN(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function nN(t){this._=t,this.next=null,this.previous=null}function rN(t,e){if(!(o=(t=function(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}(t)).length))return 0;var n,r,i,o,a,s,c,l,u,f,d;if((n=t[0]).x=0,n.y=0,!(o>1))return n.r;if(r=t[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;Jw(r,n,i=t[2]),n=new nN(n),r=new nN(r),i=new nN(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(c=3;c<o;++c){Jw(n._,r._,i=t[c]),i=new nN(i),l=r.next,u=n.previous,f=r._.r,d=n._.r;do{if(f<=d){if(tN(l._,i._)){r=l,n.next=r,r.previous=n,--c;continue t}f+=l._.r,l=l.next}else{if(tN(u._,i._)){(n=u).next=r,r.previous=n,--c;continue t}d+=u._.r,u=u.previous}}while(l!==u.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=eN(n);(i=i.next)!==r;)(s=eN(i))<a&&(n=i,a=s);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=function(t,e){for(var n,r,i=0,o=(t=function(t,e){let n,r,i=t.length;for(;i;)r=e()*i--|0,n=t[i],t[i]=t[r],t[r]=n;return t}(Array.from(t),e)).length,a=[];i<o;)n=t[i],r&&$w(r,n)?++i:(r=Kw(a=Xw(a,n)),i=0);return r}(n,e),c=0;c<o;++c)(n=t[c]).x-=i.x,n.y-=i.y;return i.r}function iN(t){return Math.sqrt(t.value)}function oN(){var t=null,e=1,n=1,r=Gw;function i(i){const o=function(){let t=1;return()=>(t=(zw*t+Vw)%Hw)/Hw}();return i.x=e/2,i.y=n/2,t?i.eachBefore(aN(t)).eachAfter(sN(r,.5,o)).eachBefore(cN(1)):i.eachBefore(aN(iN)).eachAfter(sN(Gw,1,o)).eachAfter(sN(r,i.r/Math.min(e,n),o)).eachBefore(cN(Math.min(e,n)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=Uw(e),i):t},i.size=function(t){return arguments.length?(e=+t[0],n=+t[1],i):[e,n]},i.padding=function(t){return arguments.length?(r="function"==typeof t?t:Ww(+t),i):r},i}function aN(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function sN(t,e,n){return function(r){if(i=r.children){var i,o,a,s=i.length,c=t(r)*e||0;if(c)for(o=0;o<s;++o)i[o].r+=c;if(a=rN(i,n),c)for(o=0;o<s;++o)i[o].r-=c;r.r=a+c}}}function cN(t){return function(e){var n=e.parent;e.r*=t,n&&(e.x=n.x+t*e.x,e.y=n.y+t*e.y)}}function lN(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 uN(t,e,n,r,i){for(var o,a=t.children,s=-1,c=a.length,l=t.value&&(r-e)/t.value;++s<c;)(o=a[s]).y0=n,o.y1=i,o.x0=e,o.x1=e+=o.value*l}var fN={depth:-1},dN={},hN={};function pN(t){return t.id}function gN(t){return t.parentId}function mN(){var t,e=pN,n=gN;function r(r){var i,o,a,s,c,l,u,f,d=Array.from(r),h=e,p=n,g=new Map;if(null!=t){const e=d.map(((e,n)=>function(t){t=`${t}`;let e=t.length;yN(t,e-1)&&!yN(t,e-2)&&(t=t.slice(0,-1));return"/"===t[0]?t:`/${t}`}(t(e,n,r)))),n=e.map(vN),i=new Set(e).add("");for(const t of n)i.has(t)||(i.add(t),e.push(t),n.push(vN(t)),d.push(hN));h=(t,n)=>e[n],p=(t,e)=>n[e]}for(a=0,i=d.length;a<i;++a)o=d[a],l=d[a]=new Fw(o),null!=(u=h(o,a,r))&&(u+="")&&(f=l.id=u,g.set(f,g.has(f)?dN:l)),null!=(u=p(o,a,r))&&(u+="")&&(l.parent=u);for(a=0;a<i;++a)if(u=(l=d[a]).parent){if(!(c=g.get(u)))throw new Error("missing: "+u);if(c===dN)throw new Error("ambiguous: "+u);c.children?c.children.push(l):c.children=[l],l.parent=c}else{if(s)throw new Error("multiple roots");s=l}if(!s)throw new Error("no root");if(null!=t){for(;s.data===hN&&1===s.children.length;)s=s.children[0],--i;for(let t=d.length-1;t>=0&&(l=d[t]).data===hN;--t)l.data=null}if(s.parent=fN,s.eachBefore((function(t){t.depth=t.parent.depth+1,--i})).eachBefore(Bw),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(t){return arguments.length?(e=Uw(t),r):e},r.parentId=function(t){return arguments.length?(n=Uw(t),r):n},r.path=function(e){return arguments.length?(t=Uw(e),r):t},r}function vN(t){let e=t.length;if(e<2)return"";for(;--e>1&&!yN(t,e););return t.slice(0,e)}function yN(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(0==(1&n))return!0}return!1}function _N(t,e){return t.parent===e.parent?1:2}function bN(t){var e=t.children;return e?e[0]:t.t}function EN(t){var e=t.children;return e?e[e.length-1]:t.t}function xN(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 MN(t,e,n){return t.a.parent===e.parent?t.a:n}function SN(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function AN(){var t=_N,e=1,n=1,r=null;function i(i){var c=function(t){for(var e,n,r,i,o,a=new SN(t,0),s=[a];e=s.pop();)if(r=e._.children)for(e.children=new Array(o=r.length),i=o-1;i>=0;--i)s.push(n=e.children[i]=new SN(r[i],i)),n.parent=e;return(a.parent=new SN(null,0)).children=[a],a}(i);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(a),r)i.eachBefore(s);else{var l=i,u=i,f=i;i.eachBefore((function(t){t.x<l.x&&(l=t),t.x>u.x&&(u=t),t.depth>f.depth&&(f=t)}));var d=l===u?1:t(l,u)/2,h=d-l.x,p=e/(u.x+d+h),g=n/(f.depth||1);i.eachBefore((function(t){t.x=(t.x+h)*p,t.y=t.depth*g}))}return i}function o(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;)(e=i[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,o=e,a=e,s=n,c=o.parent.children[0],l=o.m,u=a.m,f=s.m,d=c.m;s=EN(s),o=bN(o),s&&o;)c=bN(c),(a=EN(a)).a=e,(i=s.z+f-o.z-l+t(s._,o._))>0&&(xN(MN(s,e,r),e,i),l+=i,u+=i),f+=s.m,l+=o.m,d+=c.m,u+=a.m;s&&!EN(a)&&(a.t=s,a.m+=f-u),o&&!bN(c)&&(c.t=o,c.m+=l-d,r=e)}return r}(e,i,e.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}function TN(t,e,n,r,i){for(var o,a=t.children,s=-1,c=a.length,l=t.value&&(i-n)/t.value;++s<c;)(o=a[s]).x0=e,o.x1=r,o.y0=n,o.y1=n+=o.value*l}SN.prototype=Object.create(Fw.prototype);var ON=(1+Math.sqrt(5))/2;function RN(t,e,n,r,i,o){for(var a,s,c,l,u,f,d,h,p,g,m,v=[],y=e.children,_=0,b=0,E=y.length,x=e.value;_<E;){c=i-n,l=o-r;do{u=y[b++].value}while(!u&&b<E);for(f=d=u,m=u*u*(g=Math.max(l/c,c/l)/(x*t)),p=Math.max(d/m,m/f);b<E;++b){if(u+=s=y[b].value,s<f&&(f=s),s>d&&(d=s),m=u*u*g,(h=Math.max(d/m,m/f))>p){u-=s;break}p=h}v.push(a={value:u,dice:c<l,children:y.slice(_,b)}),a.dice?uN(a,n,r,i,x?r+=l*u/x:o):TN(a,n,r,x?n+=c*u/x:i,o),x-=u,_=b}return v}var PN=function t(e){function n(t,n,r,i,o){RN(e,t,n,r,i,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(ON);function CN(t,e,n,r,i){var o,a,s=t.children,c=s.length,l=new Array(c+1);for(l[0]=a=o=0;o<c;++o)l[o+1]=a+=s[o].value;!function t(e,n,r,i,o,a,c){if(e>=n-1){var u=s[e];return u.x0=i,u.y0=o,u.x1=a,void(u.y1=c)}var f=l[e],d=r/2+f,h=e+1,p=n-1;for(;h<p;){var g=h+p>>>1;l[g]<d?h=g+1:p=g}d-l[h-1]<l[h]-d&&e+1<h&&--h;var m=l[h]-f,v=r-m;if(a-i>c-o){var y=r?(i*v+a*m)/r:a;t(e,h,m,i,o,y,c),t(h,n,v,y,o,a,c)}else{var _=r?(o*v+c*m)/r:c;t(e,h,m,i,o,a,_),t(h,n,v,i,_,a,c)}}(0,c,t.value,e,n,r,i)}function wN(t,e,n,r,i){(1&t.depth?TN:uN)(t,e,n,r,i)}var NN=function t(e){function n(t,n,r,i,o){if((a=t._squarify)&&a.ratio===e)for(var a,s,c,l,u,f=-1,d=a.length,h=t.value;++f<d;){for(c=(s=a[f]).children,l=s.value=0,u=c.length;l<u;++l)s.value+=c[l].value;s.dice?uN(s,n,r,i,h?r+=(o-r)*s.value/h:o):TN(s,n,r,h?n+=(i-n)*s.value/h:i,o),h-=s.value}else t._squarify=a=RN(e,t,n,r,i,o),a.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(ON);function IN(t,e){if(null!==t)return{type:"column",value:t,field:e}}function kN(t,e){const n=IN(t,e);return Object.assign(Object.assign({},n),{inferred:!0})}function LN(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function DN(t,e){const n=IN(t,e);return Object.assign(Object.assign({},n),{constant:!1})}function BN(t,e){const n=[];for(const r of t)n[r]=e;return n}function FN(t,e){const n=t[e];if(!n)return[null,null];const{value:r,field:i=null}=n;return[r,i]}function UN(t,...e){for(const n of e){if("string"!=typeof n)return[n,null];{const[e,r]=FN(t,n);if(null!==e)return[e,r]}}return[null,null]}function jN(t){return!(t instanceof Date)&&"object"==typeof t}const GN=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;return void 0!==r?[t,e]:[t,We({},e,{encode:{y1:kN(BN(t,0))}})]};function WN(t,e,n){const{encode:r}=n;if(null===t)return[e];const i=function(t){return Array.isArray(t)?t:[t]}(t).map((t=>{var e;return[t,null===(e=FN(r,t))||void 0===e?void 0:e[0]]})).filter((([,t])=>af(t)));return Array.from(Mu(e,(t=>i.map((([,e])=>e[t])).join("-"))).values())}function zN(t){return Array.isArray(t)?function(t){return(e,n,r)=>(n,r)=>t.reduce(((t,i)=>0!==t?t:au(e[n][i],e[r][i])),0)}(t):"function"==typeof t?function(t){return(e,n,r)=>KN((n=>t(e[n])))}(t):"series"===t?XN:"value"===t?YN:"sum"===t?$N:"maxIndex"===t?qN:()=>null}function VN(t,e){for(const n of t)n.sort(e)}function HN(t,e){return(null==e?void 0:e.domain)||Array.from(new Set(t))}function XN(t,e,n){return KN((t=>n[t]))}function YN(t,e,n){return KN((t=>e[t]))}function $N(t,e,n){const r=Nf(t),i=Array.from(Mu(r,(t=>n[+t])).entries()),o=new Map(i.map((([t,n])=>[t,n.reduce(((t,n)=>t+ +e[n]))])));return KN((t=>o.get(n[t])))}function qN(t,e,n){const r=Nf(t),i=Array.from(Mu(r,(t=>n[+t])).entries()),o=new Map(i.map((([t,n])=>[t,Gu(n,(t=>e[t]))])));return KN((t=>o.get(n[t])))}function KN(t){return(e,n)=>au(t(e),t(n))}GN.props={};const ZN=(t={})=>{const{groupBy:e="x",orderBy:n=null,reverse:r=!1,y:i="y",y1:o="y1",series:a=!0}=t;return(t,s)=>{const{data:c,encode:l,style:u={}}=s,[f,d]=FN(l,"y"),[h,p]=FN(l,"y1"),[g]=a?UN(l,"series","color"):FN(l,"color"),m=WN(e,t,s),v=zN(n)(c,f,g);v&&VN(m,v);const y=new Array(t.length),_=new Array(t.length),b=new Array(t.length),E=[],x=[];for(const t of m){r&&t.reverse();const e=h?+h[t[0]]:0,n=[],i=[];for(const r of t){const t=b[r]=+f[r]-e;t<0?i.push(r):t>=0&&n.push(r)}const o=n.length>0?n:i,a=i.length>0?i:n;let s=n.length-1,c=0;for(;s>0&&0===f[o[s]];)s--;for(;c<a.length-1&&0===f[a[c]];)c++;E.push(o[s]),x.push(a[c]);let l=e;for(const t of i.reverse()){const e=b[t];l=y[t]=(_[t]=l)+e}let u=e;for(const t of n){const e=b[t];e>0?u=y[t]=(_[t]=u)+e:y[t]=_[t]=u}}const M=new Set(E),S=new Set(x),A="y"===i?y:_,T="y"===o?y:_;return[t,We({},s,{encode:{y0:kN(f,d),y:IN(A,d),y1:IN(T,p)},style:Object.assign({first:(t,e)=>M.has(e),last:(t,e)=>S.has(e)},u)})]}};ZN.props={};const QN=(t={})=>{const{channel:e="x"}=t;return(t,n)=>{const{encode:r}=n,{tooltip:i}=n;if(hf(i))return[t,n];const{title:o}=i;if(void 0!==o)return[t,n];const a=Object.keys(r).filter((t=>t.startsWith(e))).filter((t=>!r[t].inferred)).map((t=>FN(r,t))).filter((([t])=>t)).map((t=>t[0]));if(0===a.length)return[t,n];const s=[];for(const e of t)s[e]={value:a.map((t=>t[e])).join(", ")};return[t,We({},n,{tooltip:{title:s}})]}};QN.props={};const JN=()=>(t,e)=>{const{encode:n}=e,{x:r}=n;return void 0!==r?[t,e]:[t,We({},e,{encode:{x:kN(BN(t,0))},scale:{x:{guide:null}}})]};JN.props={};const tI=()=>(t,e)=>{const{encode:n}=e,{y:r}=n;return void 0!==r?[t,e]:[t,We({},e,{encode:{y:kN(BN(t,0))},scale:{y:{guide:null}}})]};tI.props={};const eI=()=>(t,e)=>{const{encode:n}=e,{z:r}=n;return void 0!==r?[t,e]:[t,We({},e,{encode:{z:kN(BN(t,0))},scale:{z:{guide:null}}})]};eI.props={};const nI=()=>(t,e)=>{const{encode:n}=e,{size:r}=n;return void 0!==r?[t,e]:[t,We({},e,{encode:{size:LN(BN(t,3))}})]};nI.props={};const rI=()=>(t,e)=>{const{encode:n}=e,{key:r}=n,i=o(n,["key"]);if(void 0!==r)return[t,e];const a=Object.values(i).map((({value:t})=>t)),s=t.map((t=>a.filter(Array.isArray).map((e=>e[t])).join("-")));return[t,We({},e,{encode:{key:IN(s)}})]};rI.props={};const iI=()=>(t,e)=>{const{encode:n}=e,{series:r,color:i}=n;if(void 0!==r||void 0===i)return[t,e];const[o,a]=FN(n,"color");return[t,We({},e,{encode:{series:IN(o,a)}})]};iI.props={};const oI=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(jN)?[t,e]:[t,We({},e,{encode:{y:IN(n)}})]};oI.props={};const aI=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(jN)?[t,e]:[t,We({},e,{encode:{x:IN(n)}})]};aI.props={};const sI=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;if(r)return[t,e];const[i]=FN(n,"y");return[t,We({},e,{encode:{y1:IN([...i])}})]};sI.props={};const cI=()=>(t,e)=>{const{encode:n}=e,{x1:r}=n;if(r)return[t,e];const[i]=FN(n,"x");return[t,We({},e,{encode:{x1:IN([...i])}})]};cI.props={};const lI=t=>{const{channel:e}=t;return(t,n)=>{const{encode:r,tooltip:i}=n;if(hf(i))return[t,n];const{items:o=[]}=i;if(!o||o.length>0)return[t,n];const a=(Array.isArray(e)?e:[e]).flatMap((t=>Object.keys(r).filter((e=>e.startsWith(t))).map((t=>{const{field:e,value:n,inferred:i=!1,aggregate:o}=r[t];return i?null:o&&n?{channel:t}:e?{field:e}:n?{channel:t}:null})).filter((t=>null!==t))));return[t,We({},n,{tooltip:{items:a}})]}};lI.props={};const uI=()=>(t,e)=>[t,We({scale:{x:{padding:0},y:{padding:0}}},e)];uI.props={};const fI=()=>(t,e)=>{const{data:n,style:r={}}=e,i=o(e,["data","style"]),{x:a,y:s}=r,c=o(r,["x","y"]);if(null==a||null==s)return[t,e];const l=s||0;return[[0],We({},i,{data:[0],cartesian:!0,encode:{x:IN([a||0]),y:IN([l])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:c})]};fI.props={};const dI=()=>(t,e)=>{const{style:n={}}=e;return[t,We({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter((([,t])=>"function"==typeof t)).map((([t,e])=>[t,()=>e]))))})]};dI.props={};const hI=()=>(t,e)=>{const{data:n}=e;if(!Array.isArray(n)||n.some(jN))return[t,e];const r=Array.isArray(n[0])?n:[n],i=r.map((t=>t[0])),o=r.map((t=>t[1]));return[t,We({},e,{encode:{x:IN(i),y:IN(o)}})]};hI.props={};const pI=()=>(t,e)=>{const{style:n={},encode:r}=e,{series:i}=r,{gradient:o}=n;return!o||i?[t,e]:[t,We({},e,{encode:{series:LN(BN(t,void 0))}})]};pI.props={};const gI=(t={})=>{const{groupBy:e="x",reverse:n=!1,orderBy:r,padding:i}=t;return o(t,["groupBy","reverse","orderBy","padding"]),(t,o)=>{const{data:a,encode:s,scale:c}=o,{series:l}=c,[u]=FN(s,"y"),[f]=UN(s,"series","color"),d=HN(f,l),h=WN(e,t,o),p=zN(r)(a,u,f);p&&VN(h,p);const g=new Array(t.length);for(const t of h){n&&t.reverse();for(let e=0;e<t.length;e++)g[t[e]]=d[e]}return[t,We({},o,{scale:{series:{domain:d,paddingInner:i}},encode:{series:IN(g)}})]}};gI.props={};const mI=t=>{const{groupBy:e=["x"],reducer:n=((t,e)=>e[t[0]]),orderBy:r=null,reverse:i=!1,duration:o}=t;return(t,a)=>{const{encode:s}=a,c=(Array.isArray(e)?e:[e]).map((t=>[t,FN(s,t)[0]]));if(0===c.length)return[t,a];let l=[t];for(const[,t]of c){const e=[];for(const n of l){const r=Array.from(Mu(n,(e=>t[e])).values());e.push(...r)}l=e}if(r){const[t]=FN(s,r);t&&l.sort(((e,r)=>n(e,t)-n(r,t))),i&&l.reverse()}const u=(o||3e3)/l.length,[f]=o?[BN(t,u)]:UN(s,"enterDuration",BN(t,u)),[d]=UN(s,"enterDelay",BN(t,0)),h=new Array(t.length);for(let t=0,e=0;t<l.length;t++){const n=l[t],r=ju(n,(t=>+f[t]));for(const t of n)h[t]=+d[t]+e;e+=r}return[t,We({},a,{encode:{enterDuration:LN(f),enterDelay:LN(h)}})]}};mI.props={};const vI=(t={})=>{const{groupBy:e="x",basis:n="max"}=t;return(t,r)=>{const{encode:i,tooltip:a}=r,s=o(i,["x"]),c=Object.entries(s).filter((([t])=>t.startsWith("y"))).map((([t])=>[t,FN(i,t)[0]])),[,l]=c.find((([t])=>"y"===t)),u=c.map((([e])=>[e,new Array(t.length)])),f=WN(e,t,r),d=function(t){return"function"==typeof t?t:{min:(t,e)=>Wu(t,(t=>e[+t])),max:(t,e)=>ju(t,(t=>e[+t])),first:(t,e)=>e[t[0]],last:(t,e)=>e[t[t.length-1]],mean:(t,e)=>$u(t,(t=>e[+t])),median:(t,e)=>qu(t,(t=>e[+t])),sum:(t,e)=>Ju(t,(t=>e[+t])),deviation:(t,e)=>mu(t,(t=>e[+t]))}[t]||ju}(n);for(const t of f){const e=d(t,l);for(const n of t)for(let t=0;t<c.length;t++){const[,r]=c[t],[,i]=u[t];i[n]=+r[n]/e}}const h=hf(a)||(null==a?void 0:a.items)&&0!==(null==a?void 0:a.items.length);return[t,We({},r,Object.assign({encode:Object.fromEntries(u.map((([t,e])=>[t,IN(e,FN(i,t)[1])])))},!h&&i.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};function yI(t,e,n){if(null===t)return[-.5,.5];const r=HN(t,e),i=new Bh({domain:r,range:[0,1],padding:n}).getBandWidth();return[-i/2,i/2]}function _I(t,e,n){return e*(1-t)+n*t}vI.props={};const bI=(t={})=>{const{padding:e=0,paddingX:n=e,paddingY:r=e,random:i=Math.random}=t;return(t,e)=>{const{encode:o,scale:a}=e,{x:s,y:c}=a,[l]=FN(o,"x"),[u]=FN(o,"y"),f=yI(l,s,n),d=yI(u,c,r),h=t.map((()=>_I(i(),...d))),p=t.map((()=>_I(i(),...f)));return[t,We({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:IN(h),dx:IN(p)}})]}};bI.props={};const EI=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(t,r)=>{const{encode:i,scale:o}=r,{x:a}=o,[s]=FN(i,"x"),c=yI(s,a,e),l=t.map((()=>_I(n(),...c)));return[t,We({scale:{x:{padding:.5}}},r,{encode:{dx:IN(l)}})]}};EI.props={};const xI=(t={})=>{const{groupBy:e="x"}=t;return(t,n)=>{const{encode:r}=n,i=o(r,["x"]),a=Object.entries(i).filter((([t])=>t.startsWith("y"))).map((([t])=>[t,FN(r,t)[0]])),s=a.map((([e])=>[e,new Array(t.length)])),c=WN(e,t,n),l=new Array(c.length);for(let t=0;t<c.length;t++){const e=c[t].flatMap((t=>a.map((([,e])=>+e[t])))),[n,r]=vu(e);l[t]=(n+r)/2}const u=Math.max(...l);for(let t=0;t<c.length;t++){const e=u-l[t],n=c[t];for(const t of n)for(let n=0;n<a.length;n++){const[,r]=a[n],[,i]=s[n];i[t]=+r[t]+e}}return[t,We({},n,{encode:Object.fromEntries(s.map((([t,e])=>[t,IN(e,FN(r,t)[1])])))})]}};xI.props={};const MI=(t={})=>{const{groupBy:e="x",series:n=!0}=t;return(t,r)=>{const{encode:i}=r,[o]=FN(i,"y"),[a,s]=FN(i,"y1");n?UN(i,"series","color"):FN(i,"color");const c=WN(e,t,r),l=new Array(t.length);for(const t of c){const e=t.map((t=>+o[t]));for(let n=0;n<t.length;n++){const r=t[n],i=Math.max(...e.filter(((t,e)=>e!==n)));l[r]=o[r]>i?i:o[r]}}return[t,We({},r,{encode:{y1:IN(l,s)}})]}};function SI(t,e){return[t[0]]}function AI(t,e){return[t[t.length-1]]}function TI(t,e){return[t[Gu(t,(t=>e[t]))]]}function OI(t,e){return[t[zu(t,(t=>e[t]))]]}MI.props={};const RI=(t={})=>{const{groupBy:e="series",channel:n,selector:r}=t;return(t,i)=>{const{encode:o}=i,a=WN(e,t,i),[s]=FN(o,n),c=function(t){return"function"==typeof t?t:{first:SI,last:AI,max:TI,min:OI}[t]||SI}(r);return[a.flatMap((t=>c(t,s))),i]}};RI.props={};const PI=(t={})=>{const{selector:e}=t,n=o(t,["selector"]);return RI(Object.assign({channel:"x",selector:e},n))};PI.props={};const CI=(t={})=>{const{selector:e}=t,n=o(t,["selector"]);return RI(Object.assign({channel:"y",selector:e},n))};function wI(t){return e=>null===e?t:`${t} of ${e}`}function NI(){return[(t,e)=>$u(t,(t=>+e[t])),wI("mean")]}function II(){return[(t,e)=>qu(t,(t=>+e[t])),wI("median")]}function kI(){return[(t,e)=>ju(t,(t=>+e[t])),wI("max")]}function LI(){return[(t,e)=>Wu(t,(t=>+e[t])),wI("min")]}function DI(){return[(t,e)=>t.length,wI("count")]}function BI(){return[(t,e)=>Ju(t,(t=>+e[t])),wI("sum")]}function FI(){return[(t,e)=>e[t[0]],wI("first")]}function UI(){return[(t,e)=>e[t[t.length-1]],wI("last")]}CI.props={};const jI=(t={})=>{const{groupBy:e}=t,n=o(t,["groupBy"]);return(t,r)=>{const{data:i,encode:o}=r,a=e(t,r);if(!a)return[t,r];const s=Object.entries(n).map((([t,e])=>{const[n,r]=function(t){if("function"==typeof t)return[t,null];const e={mean:NI,max:kI,count:DI,first:FI,last:UI,sum:BI,min:LI,median:II}[t];if(!e)throw new Error(`Unknown reducer: ${t}.`);return e()}(e),[s,c]=FN(o,t),l=((t,e)=>{if(t)return t;const{from:n}=e;if(!n)return t;const[,r]=FN(o,n);return r})(c,e),u=a.map((t=>n(t,null!=s?s:i)));return[t,Object.assign(Object.assign({},DN(u,(null==r?void 0:r(l))||l)),{aggregate:!0})]})),c=Object.keys(o).map((t=>{const[e,n]=FN(o,t),r=a.map((t=>e[t[0]]));return[t,IN(r,n)]})),l=a.map((t=>i[t[0]]));return[Nf(a),We({},r,{data:l,encode:Object.fromEntries([...c,...s])})]}};jI.props={};const GI=(t={})=>{const{channels:e=["x","y"]}=t,n=o(t,["channels"]);return jI(Object.assign(Object.assign({},n),{groupBy:(t,n)=>WN(e,t,n)}))};GI.props={};const WI=(t={})=>GI(Object.assign(Object.assign({},t),{channels:["x","color","series"]}));WI.props={};const zI=(t={})=>GI(Object.assign(Object.assign({},t),{channels:["y","color","series"]}));zI.props={};const VI=(t={})=>GI(Object.assign(Object.assign({},t),{channels:["color"]}));function HI(t,e,n){var r;const{reverse:i,slice:a,channel:s}=n,c=o(n,["reverse","slice","channel"]),{encode:l,scale:u={}}=e,f=null===(r=u[s])||void 0===r?void 0:r.domain,[d]=FN(l,s),h=function(t,e,n){const{by:r=t,reducer:i="max"}=e,[o]=FN(n,r);if("function"==typeof i)return t=>i(t,o);if("max"===i)return t=>ju(t,(t=>+o[t]));if("min"===i)return t=>Wu(t,(t=>+o[t]));if("sum"===i)return t=>Ju(t,(t=>+o[t]));if("median"===i)return t=>qu(t,(t=>+o[t]));if("mean"===i)return t=>$u(t,(t=>+o[t]));if("first"===i)return t=>o[t[0]];if("last"===i)return t=>o[t[t.length-1]];throw new Error(`Unknown reducer: ${i}`)}(s,c,l),p=function(t,e,n){if(!Array.isArray(n))return t;const r=new Set(n);return t.filter((t=>r.has(e[t])))}(t,d,f),g=function(t,e,n){return(2!==e.length?Ru(Au(t,e,n),(([t,e],[n,r])=>au(e,r)||au(t,n))):Ru(Mu(t,n),(([t,n],[r,i])=>e(n,i)||au(t,r)))).map((([t])=>t))}(p,h,(t=>d[t]));i&&g.reverse();const m="number"==typeof a?[0,a]:a,v=a?g.slice(...m):g;return[t,We(e,{scale:{[s]:{domain:v}}})]}VI.props={};const XI=(t={})=>{const{reverse:e=!1,slice:n,channel:r,ordinal:i=!0}=t,a=o(t,["reverse","slice","channel","ordinal"]);return(t,o)=>i?HI(t,o,Object.assign({reverse:e,slice:n,channel:r},a)):function(t,e,n){const{reverse:r,channel:i}=n,{encode:o}=e,[a]=FN(o,i),s=Ru(t,(t=>a[t]));return r&&s.reverse(),[s,e]}(t,o,Object.assign({reverse:e,slice:n,channel:r},a))};XI.props={};const YI=(t={})=>XI(Object.assign(Object.assign({},t),{channel:"x"}));YI.props={};const $I=(t={})=>XI(Object.assign(Object.assign({},t),{channel:"color"}));$I.props={};const qI=(t={})=>XI(Object.assign(Object.assign({},t),{channel:"y"}));qI.props={};const KI=(t={})=>{const{field:e,channel:n="y",reducer:r="sum"}=t;return(t,i)=>{const{data:o,encode:a}=i,[s]=FN(a,"x"),c=e?function(t,e){return"string"==typeof e?t.map((t=>t[e])):t.map(e)}(o,e):FN(a,n)[0],l=function(t,e){if("function"==typeof t)return n=>t(n,e);if("sum"===t)return t=>Ju(t,(t=>+e[t]));throw new Error(`Unknown reducer: ${t}`)}(r,c),u=Tu(t,l,(t=>s[t])).map((t=>t[1]));return[t,We({},i,{scale:{x:{flex:u}}})]}};function ZI(t,e,n){const r=t.length;if(0===r)return[];const{innerWidth:i,innerHeight:o}=n,a=o/i;let s=Math.ceil(Math.sqrt(e/a)),c=i/s,l=Math.ceil(e/s),u=l*c;for(;u>o;)s+=1,c=i/s,l=Math.ceil(e/s),u=l*c;const f=o-l*c,d=l<=1?0:f/(l-1),[h,p]=l<=1?[(i-r*c)/(r-1),(o-c)/2]:[0,0];return t.map(((t,e)=>{const[n,r,i,o]=Sb(t),a=e%s,u=Math.floor(e/s);return`translate(${a*c-n+h*a}, ${(l-u-1)*c+f-r-d*u-p}) scale(${c/i}, ${c/o})`}))}KI.props={};const QI=()=>(t,e)=>[t,We({},e,{modifier:ZI,axis:!1})];QI.props={};const JI="thresholds";function tk(t){const[e,n]=vu(t);return Math.min(200,function(t,e,n){const r=gu(t),i=mu(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}(t,e,n))}const ek=(t={})=>{const{groupChannels:e=["color"],binChannels:n=["x","y"]}=t,r=o(t,["groupChannels","binChannels"]),i={};return jI(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(r).filter((([t])=>!t.startsWith(JI))))),Object.fromEntries(n.flatMap((t=>{const e=([e])=>+i[t].get(e).split(",")[1];return e.from=t,[[t,([e])=>+i[t].get(e).split(",")[0]],[`${t}1`,e]]})))),{groupBy:(t,o)=>{const{encode:a}=o,s=n.map((t=>{const[e]=FN(a,t);return e})),c=cf(r,JI),l=t.filter((t=>s.every((e=>af(e[t]))))),u=[...e.map((t=>{const[e]=FN(a,t);return e})).filter(af).map((t=>e=>t[e])),...n.map(((t,e)=>{const n=s[e],r=c[t]||tk(n),o=Uu().thresholds(r).value((t=>+n[t]))(l),a=new Map(o.flatMap((t=>{const{x0:e,x1:n}=t,r=`${e},${n}`;return t.map((t=>[t,r]))})));return i[t]=a,t=>a.get(t)}))];return Array.from(Mu(l,(t=>u.map((e=>e(t))).join("-"))).values())}}))};ek.props={};const nk=(t={})=>{const{thresholds:e}=t;return ek(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))};function rk(t,e,n,r){const i=t.length;if(r>=i||0===r)return t;const o=n=>1*e[t[n]],a=e=>1*n[t[e]],s=[],c=(i-2)/(r-2);let l,u,f,d=0;s.push(d);for(let t=0;t<r-2;t++){let e=0,n=0,r=Math.floor((t+1)*c)+1,h=Math.floor((t+2)*c)+1;h=Math.min(h,i);const p=h-r;for(;r<h;r++)e+=o(r),n+=a(r);e/=p,n/=p;let g=Math.floor((t+0)*c)+1;const m=Math.floor((t+1)*c)+1,v=[o(d),a(d)];for(l=u=-1;g<m;g++)u=.5*Math.abs((v[0]-e)*(o(g)-v[1])-(v[0]-a(g))*(n-v[0])),u>l&&(l=u,f=g);s.push(f),d=f}return s.push(i-1),s.map((e=>t[e]))}nk.props={};const ik=(t={})=>{const{strategy:e="median",thresholds:n=2e3,groupBy:r=["series","color"]}=t,i=function(t){if("function"==typeof t)return t;if("lttb"===t)return rk;const e={first:t=>[t[0]],last:t=>[t[t.length-1]],min:(t,e,n)=>[t[zu(t,(t=>n[t]))]],max:(t,e,n)=>[t[Gu(t,(t=>n[t]))]],median:(t,e,n)=>[t[Ku(t,(t=>n[t]))]]},n=e[t]||e.median;return(t,e,r,i)=>{const o=function(t,e){const n=t.length,r=[];let i=0;for(;i<n;)r.push(t.slice(i,i+=e));return r}(t,Math.max(1,Math.floor(t.length/i)));return o.flatMap((t=>n(t,e,r)))}}(e);return(t,e)=>{const{encode:o}=e,a=WN(r,t,e),[s]=FN(o,"x"),[c]=FN(o,"y");return[a.flatMap((t=>i(t,s,c,n))),e]}};ik.props={};const ok=(t={})=>(e,n)=>{const{encode:r,data:i}=n,o=Object.entries(t).map((([t,e])=>{const[n]=FN(r,t);if(!n)return null;const[i,o=!0]=function(t){return"object"==typeof t?[t.value,t.ordinal]:[t,!0]}(e);if("function"==typeof i)return t=>i(n[t]);if(o){const t=Array.isArray(i)?i:[i];return 0===t.length?null:e=>t.includes(n[e])}{const[t,e]=i;return r=>n[r]>=t&&n[r]<=e}})).filter(af);if(0===o.length)return[e,n];const a=e.filter((t=>o.every((e=>e(t))))),s=a.map(((t,e)=>e)),c=Object.entries(r).map((([t,e])=>[t,Object.assign(Object.assign({},e),{value:s.map((t=>e.value[a[t]]))})]));return[s,We({},n,{encode:Object.fromEntries(c),data:a.map((t=>i[t]))})]};function ak(t={}){const{shapes:e}=t;return[{name:"color"},{name:"opacity"},{name:"shape",range:e},{name:"enterType"},{name:"enterDelay",scaleKey:"enter"},{name:"enterDuration",scaleKey:"enter"},{name:"enterEasing"},{name:"key",scale:"identity"},{name:"groupKey",scale:"identity"},{name:"label",scale:"identity"}]}function sk(t={}){return[...ak(t),{name:"title",scale:"identity"}]}function ck(){return[{type:QN,channel:"color"},{type:lI,channel:["x","y","z"]}]}function lk(){return[{type:QN,channel:"color"},{type:lI,channel:["x","y"]}]}function uk(){return[{type:QN,channel:"x"},{type:lI,channel:["y"]}]}function fk(t={}){return ak(t)}function dk(){return[{type:rI}]}function hk(t,e){return t.getBandWidth(t.invert(e))}function pk(t,e,n={}){const{x:r,y:i,series:o}=e,{x:a,y:s,series:c}=t,{style:{bandOffset:l=(c?0:.5),bandOffsetX:u=l,bandOffsetY:f=l}={}}=n,d=!!(null==a?void 0:a.getBandWidth),h=!!(null==s?void 0:s.getBandWidth),p=!!(null==c?void 0:c.getBandWidth);return d||h?(t,e)=>{const n=d?hk(a,r[e]):0,l=h?hk(s,i[e]):0,g=p&&o?(hk(c,o[e])/2+ +o[e])*n:0,[m,v]=t;return[m+u*n+g,v+f*l]}:t=>t}function gk(t){return parseFloat(t)/100}function mk(t,e,n,r){const{x:i,y:o}=n,{innerWidth:a,innerHeight:s}=r.getOptions(),c=Array.from(t,(t=>{const e=i[t],n=o[t];return[["string"==typeof e?gk(e)*a:+e,"string"==typeof n?gk(n)*s:+n]]}));return[t,c]}function vk(t){return"function"==typeof t?t:e=>e[t]}function yk(t,e){return Array.from(t,vk(e))}function _k(t,e){const{source:n=(t=>t.source),target:r=(t=>t.target),value:i=(t=>t.value)}=e,{links:o,nodes:a}=t,s=yk(o,n),c=yk(o,r),l=yk(o,i);return{links:o.map(((t,e)=>({target:c[e],source:s[e],value:l[e]}))),nodes:a||Array.from(new Set([...s,...c]),(t=>({key:t})))}}ok.props={};const bk=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,a)=>{const{color:s}=a,c=o(a,["color"]),{color:l=s,src:u="",size:f=32,transform:d=""}=i;let{width:h=f,height:p=f}=t;const[[g,m]]=e,[v,y]=n.getSize();h="string"==typeof h?gk(h)*v:h,p="string"==typeof p?gk(p)*y:p;const _=g-Number(h)/2,b=m-Number(p)/2;return gf(r.createElement("image",{})).call(Tb,c).style("x",_).style("y",b).style("img",u).style("stroke",l).style("transform",d).call(Tb,t).style("width",h).style("height",p).node()}};function Ek(t,e){const n=iA();if(t_(e)){const r=e.getCenter(),i=[...t,t[0]],o=i.map((t=>bb(t,r)));return i.forEach(((e,i)=>{if(0===i)return void n.moveTo(e[0],e[1]);const a=o[i],s=t[i-1],c=o[i-1];void 0!==c&&Math.abs(a-c)<1e-10?Ob(n,s,e,r,a):n.lineTo(e[0],e[1])})),n.closePath(),n}return function(t,e){return e.forEach(((e,n)=>0===n?t.moveTo(e[0],e[1]):t.lineTo(e[0],e[1]))),t.closePath(),t}(n,t)}bk.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const xk=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,a)=>{const{color:s}=a,c=o(a,["color"]),{color:l=s,transform:u}=i,f=Ek(e,n);return gf(r.createElement("path",{})).call(Tb,c).style("d",f.toString()).style("stroke",l).style("fill",l).style("transform",u).call(Tb,t).node()}};function Mk(t,e){const[n,r,i,o]=t,a=iA();if(t_(e)){const t=e.getCenter(),s=bb(t,n);return a.moveTo(n[0],n[1]),a.quadraticCurveTo(t[0],t[1],i[0],i[1]),Ob(a,i,o,t,s),a.quadraticCurveTo(t[0],t[1],r[0],r[1]),Ob(a,r,n,t,s),a.closePath(),a}return a.moveTo(n[0],n[1]),a.bezierCurveTo(n[0]/2+i[0]/2,n[1],n[0]/2+i[0]/2,i[1],i[0],i[1]),a.lineTo(o[0],o[1]),a.bezierCurveTo(o[0]/2+r[0]/2,o[1],o[0]/2+r[0]/2,r[1],r[0],r[1]),a.lineTo(n[0],n[1]),a.closePath(),a}xk.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Sk=(t,e)=>{const n=o(t,[]),{coordinate:r,document:i}=e;return(t,e,a)=>{const{color:s}=a,c=o(a,["color"]),{color:l=s,transform:u}=e,f=Mk(t,r);return gf(i.createElement("path",{})).call(Tb,c).style("d",f.toString()).style("fill",l||s).style("stroke",l||s).style("transform",u).call(Tb,n).node()}};function Ak(t,e){const n=iA();if(t_(e)){const r=e.getCenter(),[i,o]=r,a=Eb(yb(t[0],r)),s=Eb(yb(t[1],r)),c=bb(r,t[2]),l=bb(r,t[3]),u=bb(r,t[8]),f=bb(r,t[10]),d=bb(r,t[11]);n.moveTo(...t[0]),n.arc(i,o,c,a,s),n.arc(i,o,c,s,a,!0),n.moveTo(...t[2]),n.lineTo(...t[3]),n.moveTo(...t[4]),n.arc(i,o,l,a,s),n.lineTo(...t[6]),n.arc(i,o,f,s,a,!0),n.closePath(),n.moveTo(...t[8]),n.arc(i,o,u,a,s),n.arc(i,o,u,s,a,!0),n.moveTo(...t[10]),n.lineTo(...t[11]),n.moveTo(...t[12]),n.arc(i,o,d,a,s),n.arc(i,o,d,s,a,!0)}else n.moveTo(...t[0]),n.lineTo(...t[1]),n.moveTo(...t[2]),n.lineTo(...t[3]),n.moveTo(...t[4]),n.lineTo(...t[5]),n.lineTo(...t[6]),n.lineTo(...t[7]),n.closePath(),n.moveTo(...t[8]),n.lineTo(...t[9]),n.moveTo(...t[10]),n.lineTo(...t[11]),n.moveTo(...t[12]),n.lineTo(...t[13]);return n}Sk.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Tk=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,a)=>{const{color:s,transform:c}=i,{color:l,fill:u=l,stroke:f=l}=a,d=o(a,["color","fill","stroke"]),h=Ak(e,n);return gf(r.createElement("path",{})).call(Tb,d).style("d",h.toString()).style("stroke",f).style("fill",s||u).style("transform",c).call(Tb,t).node()}};function Ok(t,e,n=4){const r=iA();if(!t_(e))return r.moveTo(...t[2]),r.lineTo(...t[3]),r.lineTo(t[3][0]-n,t[3][1]),r.lineTo(t[10][0]-n,t[10][1]),r.lineTo(t[10][0]+n,t[10][1]),r.lineTo(t[3][0]+n,t[3][1]),r.lineTo(...t[3]),r.closePath(),r.moveTo(...t[10]),r.lineTo(...t[11]),r.moveTo(t[3][0]+n/2,t[8][1]),r.arc(t[3][0],t[8][1],n/2,0,2*Math.PI),r.closePath(),r;const i=e.getCenter(),[o,a]=i,s=bb(i,t[3]),c=bb(i,t[8]),l=bb(i,t[10]),u=Eb(yb(t[2],i)),f=Math.asin(n/c),d=u-f,h=u+f;r.moveTo(...t[2]),r.lineTo(...t[3]),r.moveTo(Math.cos(d)*s+o,Math.sin(d)*s+a),r.arc(o,a,s,d,h),r.lineTo(Math.cos(h)*l+o,Math.sin(h)*l+a),r.arc(o,a,l,h,d,!0),r.lineTo(Math.cos(d)*s+o,Math.sin(d)*s+a),r.closePath(),r.moveTo(...t[10]),r.lineTo(...t[11]);const p=(d+h)/2;return r.moveTo(Math.cos(p)*(c+n/2)+o,Math.sin(p)*(c+n/2)+a),r.arc(Math.cos(p)*c+o,Math.sin(p)*c+a,n/2,p,2*Math.PI+p),r.closePath(),r}Tk.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Rk=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,a)=>{const{color:s,transform:c}=i,{color:l,fill:u=l,stroke:f=l}=a,d=o(a,["color","fill","stroke"]),h=Ok(e,n,4);return gf(r.createElement("path",{})).call(Tb,d).style("d",h.toString()).style("stroke",f).style("fill",s||u).style("transform",c).call(Tb,t).node()}};Rk.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Pk=(t,e)=>{const{arrow:n,arrowSize:r=4}=t,i=o(t,["arrow","arrowSize"]),{coordinate:a,document:s}=e;return(t,e,c)=>{const{color:l,lineWidth:u}=c,f=o(c,["color","lineWidth"]),{color:d=l,size:h=u}=e,p=n?function(t,e,n){return t.createElement("path",{style:Object.assign({path:`M ${e},${e} L -${e},0 L ${e},-${e} L 0,0 Z`,anchor:"0.5 0.5",transformOrigin:"center"},n)})}(s,r,Object.assign({fill:i.stroke||d,stroke:i.stroke||d},cf(i,"arrow"))):null,g=function(t,e){if(!t_(e))return yA().x((t=>t[0])).y((t=>t[1]))(t);const n=e.getCenter();return dA()({startAngle:0,endAngle:2*Math.PI,outerRadius:bb(t[0],n),innerRadius:bb(t[1],n)})}(t,a),m=function(t,e){if(!t_(t))return e;const[n,r]=t.getCenter();return`translate(${n}, ${r}) ${e||""}`}(a,e.transform);return gf(s.createElement("path",{})).call(Tb,f).style("d",g).style("stroke",d).style("lineWidth",h).style("transform",m).style("markerEnd",p).call(Tb,i).node()}};function Ck(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}Pk.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const wk=(t,e)=>{const{offset:n=0,offset1:r=n,offset2:i=n,connectLength1:a,endMarker:s=!0}=t,c=o(t,["offset","offset1","offset2","connectLength1","endMarker"]),{coordinate:l}=e;return(t,e,n)=>{const{color:u,connectLength1:f}=n,d=o(n,["color","connectLength1"]),{color:h,transform:p}=e,g=function(t,e,n,r,i=0){const[[o,a],[s,c]]=e;if(Jy(t)){const t=o+n,e=t+i;return[[t,a],[e,a],[e,c],[s+r,c]]}const l=a-n,u=l-i;return[[o,l],[o,u],[s,u],[s,c-r]]}(l,t,r,i,null!=a?a:f),m=cf(Object.assign(Object.assign({},c),n),"endMarker");return gf(new Cs).call(Tb,d).style("path",function(t){return yA().x((t=>t[0])).y((t=>t[1]))(t)}(g)).style("stroke",h||u).style("transform",p).style("markerEnd",s?new Um({className:"marker",style:Object.assign(Object.assign({},m),{symbol:Ck})}):null).call(Tb,c).node()}};function Nk(t){return t.replace(/-(\w)/g,(function(t,e){return e.toUpperCase()}))}function Ik(t,e,n,r){const{bounds:i}=n,[[o,a],[s,c]]=i,l=s-o,u=c-a,f=t=>{const{x:e,y:r}=t,i=ff(n.x,l),s=ff(n.y,u);return Object.assign(Object.assign({},t),{x:(i||e)+o,y:(s||r)+a})};return f("left"===t?{x:0,y:u/2,textAnchor:"start",textBaseline:"middle"}:"right"===t?{x:l,y:u/2,textAnchor:"end",textBaseline:"middle"}:"top"===t?{x:l/2,y:0,textAnchor:"center",textBaseline:"top"}:"bottom"===t?{x:l/2,y:u,textAnchor:"center",textBaseline:"bottom"}:"top-left"===t?{x:0,y:0,textAnchor:"start",textBaseline:"top"}:"top-right"===t?{x:l,y:0,textAnchor:"end",textBaseline:"top"}:"bottom-left"===t?{x:0,y:u,textAnchor:"start",textBaseline:"bottom"}:"bottom-right"===t?{x:l,y:u,textAnchor:"end",textBaseline:"bottom"}:{x:l/2,y:u/2,textAnchor:"center",textBaseline:"middle"})}function kk(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s}=n,c=r.getCenter(),l=Cb(r,e,[i,o]),{innerRadius:u,outerRadius:f,startAngle:d,endAngle:h}=l,p="inside"===t?(d+h)/2:h,g=Dk(p,a,s),m=(()=>{const[n,r]=e,i=u+.5*(f-u),[o,a]="inside"===t?Lk(c,p,i):Ab(n,r);return{x:o,y:a}})();return Object.assign(Object.assign({},m),{textAlign:"inside"===t?"center":"start",textBaseline:"middle",rotate:g})}function Lk(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function Dk(t,e,n){if(!e)return 0;const r=n?0:Math.sin(t)<0?90:-90;return t/Math.PI*180+r}function Bk(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s,radius:c=.5,offset:l=0}=n,u=Cb(r,e,[i,o]),{startAngle:f,endAngle:d}=u,h=r.getCenter(),p=(f+d)/2,g={textAlign:"center",textBaseline:"middle",rotate:Dk(p,a,s)},{innerRadius:m,outerRadius:v}=u,y=m+(v-m)*c+l,[_,b]=Lk(h,p,y);return Object.assign({x:_,y:b},g)}function Fk(t){return void 0===t?null:t}function Uk(t,e,n,r){const{bounds:i}=n,[o]=i;return{x:Fk(o[0]),y:Fk(o[1])}}function jk(t,e,n,r){const{bounds:i}=n;if(1===i.length)return Uk(0,0,n);return(e_(r)?kk:o_(r)?Bk:Ik)(t,e,n,r)}function Gk(t,e,n){const r=Cb(n,t,[e.y,e.y1]),{innerRadius:i,outerRadius:o}=r;return i+(o-i)}function Wk(t,e,n){const r=Cb(n,t,[e.y,e.y1]),{startAngle:i,endAngle:o}=r;return(i+o)/2}function zk(t,e,n,r){const{autoRotate:i,rotateToAlignArc:o,offset:a=0,connector:s=!0,connectorLength:c=a,connectorLength2:l=0,connectorDistance:u=0}=n,f=r.getCenter(),d=Wk(e,n,r),h=Math.sin(d)>0?1:-1,p=Dk(d,i,o),g={textAlign:h>0||e_(r)?"start":"end",textBaseline:"middle",rotate:p},m=Gk(e,n,r),v=m+(s?c:a),[[y,_],[b,E],[x,M]]=function(t,e,n,r,i){const[o,a]=Lk(t,e,n),[s,c]=Lk(t,e,r);return[[o,a],[s,c],[s+(Math.sin(e)>0?1:-1)*i,c]]}(f,d,m,v,s?l:0),S=s?+u*h:0,A=x+S,T={connector:s,connectorPoints:[[b-A,E-M],[x-A,M-M]]};return Object.assign(Object.assign({x0:y,y0:_,x:x+S,y:M},g),T)}wk.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var Vk=Object.freeze({__proto__:null,area:function(t,e,n,r){const i=e.length/2,o=e.slice(0,i),a=e.slice(i);let s=Gu(o,((t,e)=>Math.abs(t[1]-a[e][1])));s=Math.max(Math.min(s,i-2),1);const c=t=>[o[t][0],(o[t][1]+a[t][1])/2],l=c(s),u=c(s-1),f=Eb(yb(c(s+1),u))/Math.PI*180;return{x:l[0],y:l[1],transform:`rotate(${f})`,textAlign:"center",textBaseline:"middle"}},bottom:jk,bottomLeft:jk,bottomRight:jk,inside:jk,left:jk,outside:function(t,e,n,r){const{bounds:i}=n;return 1===i.length?Uk(0,0,n):(e_(r)?kk:o_(r)?zk:Ik)(t,e,n,r)},right:jk,spider:function(t,e,n,r){if(!o_(r))return{};const{connectorLength:i,connectorLength2:a,connectorDistance:s}=n,c=o(zk(0,e,n,r),[]),l=r.getCenter(),u=Gk(e,n,r),f=Wk(e,n,r),d=u+i+a,h=Math.sin(f)>0?1:-1,p=l[0]+(d+ +s)*h,{x:g}=c,m=p-g;return c.x+=m,c.connectorPoints[0][0]-=m,c},surround:function(t,e,n,r){if(!o_(r))return{};const{connectorLength:i,connectorLength2:a,connectorDistance:s}=n,c=o(zk(0,e,n,r),[]),{x0:l,y0:u}=c,f=r.getCenter(),d=function(t){if(o_(t)){const[e,n]=t.getSize(),r=t.getOptions().transformations.find((t=>"polar"===t[0]));if(r)return Math.max(e,n)/2*r[4]}return 0}(r),h=d+i,p=xb([l-f[0],u-f[1]]),g=Math.sin(p)>0?1:-1,[m,v]=Lk(f,p,h);return c.x=m+(a+s)*g,c.y=v,c},top:jk,topLeft:jk,topRight:jk});function Hk(t,e,n,r,i){const{position:o}=e,{render:a}=i,s=function(t,e){return void 0!==t?t:o_(e)?"inside":Jy(e)?"right":"top"}(o,n),c=r[a?"htmlLabel":"inside"===s?"innerLabel":"label"],l=Object.assign({},c,e),u=Vk[Nk(s)];if(!u)throw new Error(`Unknown position: ${s}`);return Object.assign(Object.assign({},c),u(s,t,l,n,i))}const Xk=(t,e)=>{const{coordinate:n,theme:r}=e,{render:i}=t;return(e,a)=>{const{text:s,x:c,y:l,transform:u="",transformOrigin:f,className:d=""}=a,h=o(a,["text","x","y","transform","transformOrigin","className"]),p=Hk(e,a,n,r,t),{rotate:g=0,transform:m=""}=p,v=o(p,["rotate","transform"]);return gf(new dw).call(Tb,v).style("text",`${s}`).style("className",`${d} g2-label`).style("innerHTML",i?i(s,a.datum,a.index):void 0).style("labelTransform",`${m} rotate(${+g}) ${u}`.trim()).style("labelTransformOrigin",f).style("coordCenter",n.getCenter()).call(Tb,h).node()}};Xk.props={defaultMarker:"point"};const Yk=(t,e)=>{const{arrow:n,colorAttribute:r}=t,i=o(t,["arrow","colorAttribute"]),{coordinate:a,document:s}=e;return(t,e,n)=>{const{color:c,stroke:l}=n,u=o(n,["color","stroke"]),{d:f,color:d=c}=e,[h,p]=a.getSize();return gf(s.createElement("path",{})).call(Tb,u).style("d","function"==typeof f?f({width:h,height:p}):f).style(r,d).call(Tb,i).node()}};Yk.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const $k=(t,e)=>Yk(Object.assign({colorAttribute:"fill"},t),e);$k.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const qk=(t,e)=>Yk(Object.assign({fill:"none",colorAttribute:"stroke"},t),e);qk.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Kk=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{transform:a}=r,{color:s}=i,c=o(i,["color"]),{color:l=s}=r,[u,...f]=e,d=iA();return d.moveTo(...u),f.forEach((([t,e])=>{d.lineTo(t,e)})),d.closePath(),gf(n.createElement("path",{})).call(Tb,c).style("d",d.toString()).style("stroke",l||s).style("fill",l||s).style("fillOpacity",.4).style("transform",a).call(Tb,t).node()}};function Zk(t){var e,n,r,i=t||1;function o(t,o){++e>i&&(r=n,a(1),++e),n[t]=o}function a(t){e=0,n=Object.create(null),t||(r=Object.create(null))}return a(),{clear:a,has:function(t){return void 0!==n[t]||void 0!==r[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=r[t])?(o(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:o(t,e)}}}function Qk(t,e,n){const r=t?t():document.createElement("canvas");return r.width=e,r.height=n,r}Kk.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},Zk(3);const Jk=function(t,e=((...t)=>`${t[0]}`),n=16){const r=Zk(n);return(...n)=>{const i=e(...n);let o=r.get(i);return r.has(i)?r.get(i):(o=t(...n),r.set(i,o),o)}}(((t,e,n)=>{const r=Qk(n,2*t,2*t),i=r.getContext("2d"),o=t,a=t;if(1===e)i.beginPath(),i.arc(o,a,t,0,2*Math.PI,!1),i.fillStyle="rgba(0,0,0,1)",i.fill();else{const n=i.createRadialGradient(o,a,t*e,o,a,t);n.addColorStop(0,"rgba(0,0,0,1)"),n.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=n,i.fillRect(0,0,2*t,2*t)}return r}),(t=>`${t}`));function tL(t,e,n,r,i,o,a){const s=Object.assign({blur:.85,minOpacity:0,opacity:.6,maxOpacity:1,gradient:[[.25,"rgb(0,0,255)"],[.55,"rgb(0,255,0)"],[.85,"yellow"],[1,"rgb(255,0,0)"]]},o);s.minOpacity*=255,s.opacity*=255,s.maxOpacity*=255;const c=Qk(a,t,e).getContext("2d"),l=function(t,e){const n=Qk(e,256,1).getContext("2d"),r=n.createLinearGradient(0,0,256,1);return function(t){return"string"==typeof t?t.split(" ").map((t=>{const[e,n]=t.split(":");return[+e,n]})):t}(t).forEach((([t,e])=>{r.addColorStop(t,e)})),n.fillStyle=r,n.fillRect(0,0,256,1),n.getImageData(0,0,256,1).data}(s.gradient,a);c.clearRect(0,0,t,e),function(t,e,n,r,i,o){const{blur:a}=i;let s=r.length;for(;s--;){const{x:i,y:c,value:l,radius:u}=r[s],f=Math.min(l,n),d=i-u,h=c-u,p=Jk(u,1-a,o),g=(f-e)/(n-e);t.globalAlpha=Math.max(g,.001),t.drawImage(p,d,h)}}(c,n,r,i,s,a);const u=function(t,e,n,r,i){const{minOpacity:o,opacity:a,maxOpacity:s,useGradientOpacity:c}=i,l=e,u=n,f=t.getImageData(0,0,l,u),d=f.data,h=d.length;for(let t=3;t<h;t+=4){const e=d[t],n=4*e;if(!n)continue;const i=a||Math.max(0,Math.min(s,Math.max(o,e)));d[t-3]=r[n],d[t-2]=r[n+1],d[t-1]=r[n+2],d[t]=c?r[n+3]:i}return f}(c,t,e,l,s),f=Qk(a,t,e).getContext("2d");return f.putImageData(u,0,0),f}const eL=(t,e)=>{const{gradient:n,opacity:r,maxOpacity:i,minOpacity:a,blur:s,useGradientOpacity:c}=t,l=o(t,["gradient","opacity","maxOpacity","minOpacity","blur","useGradientOpacity"]),{coordinate:u,createCanvas:f,document:d}=e;return(t,e,o)=>{const{transform:h}=e,[p,g]=u.getSize(),m=t.map((t=>({x:t[0],y:t[1],value:t[2],radius:t[3]}))),v=Wu(t,(t=>t[2])),y=ju(t,(t=>t[2])),_=p&&g?tL(p,g,v,y,m,(b={gradient:n,opacity:r,minOpacity:a,maxOpacity:i,blur:s,useGradientOpacity:c},E=t=>void 0===t,Object.keys(b).reduce(((t,e)=>{const n=b[e];return E(n,e)||(t[e]=n),t}),{})),f):{canvas:null};var b,E;return gf(d.createElement("image",{})).call(Tb,o).style("x",0).style("y",0).style("width",p).style("height",g).style("src",_.canvas).style("transform",h).call(Tb,l).node()}};eL.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const nL=(t,e)=>{const{render:n}=t,r=o(t,["render"]);return t=>{const[[i,o]]=t;return n(Object.assign(Object.assign({},r),{x:i,y:o}),e)}};nL.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};function rL(t,e,n){return t+(e-t)*n}function iL(t,e,n,r){return 0===e?[[t+.5*n/Math.PI/2,r/2],[t+.5*n/Math.PI,r],[t+n/4,r]]:1===e?[[t+.5*n/Math.PI/2*(Math.PI-2),r],[t+.5*n/Math.PI/2*(Math.PI-1),r/2],[t+n/4,0]]:2===e?[[t+.5*n/Math.PI/2,-r/2],[t+.5*n/Math.PI,-r],[t+n/4,-r]]:[[t+.5*n/Math.PI/2*(Math.PI-2),-r],[t+.5*n/Math.PI/2*(Math.PI-1),-r/2],[t+n/4,0]]}function oL(t,e,n,r,i,o,a){const s=4*Math.ceil(2*t/n*4),c=[];let l=r;for(;l<2*-Math.PI;)l+=2*Math.PI;for(;l>0;)l-=2*Math.PI;l=l/Math.PI/2*n;const u=o-t+l-2*t;c.push(["M",u,e]);let f=0;for(let t=0;t<s;++t){const r=iL(t*n/4,t%4,n,i);c.push(["C",r[0][0]+u,-r[0][1]+e,r[1][0]+u,-r[1][1]+e,r[2][0]+u,-r[2][1]+e]),t===s-1&&(f=r[2][0])}return c.push(["L",f+u,a+t]),c.push(["L",u,a+t]),c.push(["Z"]),c}const aL={pin:function(t,e,n){const r=4*n/3,i=Math.max(r,2*n),o=r/2,a=t,s=o+e-i/2,c=Math.asin(o/(.85*(i-o))),l=Math.sin(c)*o,u=Math.cos(c)*o,f=a-u,d=s+l,h=t,p=s+o/Math.sin(c);return`\n M ${f} ${d}\n A ${o} ${o} 0 1 1 ${f+2*u} ${d}\n Q ${h} ${p} ${t} ${e+i/2}\n Q ${h} ${p} ${f} ${d}\n Z \n `},rect:function(t,e,n){const r=.618*n;return`\n M ${t-r} ${e-n}\n L ${t+r} ${e-n}\n L ${t+r} ${e+n}\n L ${t-r} ${e+n}\n Z\n `},circle:function(t,e,n){return`\n M ${t} ${e-n} \n a ${n} ${n} 0 1 0 0 ${2*n}\n a ${n} ${n} 0 1 0 0 ${2*-n}\n Z\n `},diamond:function(t,e,n){return`\n M ${t} ${e-n}\n L ${t+n} ${e}\n L ${t} ${e+n}\n L ${t-n} ${e}\n Z\n `},triangle:function(t,e,n){return`\n M ${t} ${e-n}\n L ${t+n} ${e+n}\n L ${t-n} ${e+n}\n Z\n `}},sL=(t,e)=>{if(!e)return;const{coordinate:n}=e,{liquidOptions:r,styleOptions:i}=t,{liquidShape:a,percent:s}=r,{background:c,outline:l={},wave:u={}}=i,f=o(i,["background","outline","wave"]),{border:d=2,distance:h=0}=l,p=o(l,["border","distance"]),{length:g=192,count:m=3}=u;return(t,r,i)=>{const{document:o}=e.canvas,{color:l,fillOpacity:u}=i,v=Object.assign(Object.assign({fill:l},i),f),y=o.createElement("g",{}),[_,b]=n.getCenter(),E=n.getSize(),x=Math.min(...E)/2,M=de(a)?a:((t="circle")=>aL[t]||aL.circle)(a),S=M(_,b,x,...E);if(Object.keys(c).length){const t=o.createElement("path",{style:Object.assign({path:S,fill:"#fff"},c)});y.appendChild(t)}if(s>0){const t=o.createElement("path",{style:{path:S}});y.appendChild(t),y.style.clipPath=t,function(t,e,n,r,i,o,a,s,c,l,u){const{fill:f,fillOpacity:d,opacity:h}=i;for(let i=0;i<r;i++){const p=r<=1?1:i/(r-1),g=oL(s,a+s*n,c,0,s/40,t,e),m=u.createElement("path",{style:{path:g,fill:f,opacity:rL(.2,.9,p)*Number(h||d)}});o.appendChild(m);try{if(!1===l)return;const t=[{transform:"translate(0, 0)"},{transform:`translate(${2*c}px, 0)`}];m.animate(t,{duration:2*rL(2500,5e3,p),iterations:1/0})}catch(t){console.warn("off-screen group animate error!")}}}(_,b,1-s,m,v,y,t.getBBox().y,2*x,g,!0,o)}const A=o.createElement("path",{style:{path:S,fill:"transparent",lineWidth:d+2*h,stroke:"#fff"}}),T=o.createElement("path",{style:Object.assign(Object.assign(Object.assign({path:S,stroke:l,strokeOpacity:u,lineWidth:d},v),p),{fill:"transparent"})});return y.appendChild(A),y.appendChild(T),y}};function cL(t,e){const{__data__:n}=t,{markKey:r,index:i,seriesIndex:o}=n,{markState:a}=e,s=Array.from(a.keys()).find((t=>t.key===r));if(s)return o?o.map((t=>s.data[t])):s.data[i]}function lL(t,e){if(e(t))return t;let n=t.parent;for(;n&&!e(n);)n=n.parent;return n}function uL(t,e,n,r=(t=>!0)){return i=>{if(!r(i))return;n.emit(`plot:${t}`,i);const{target:o}=i;if(!o)return;const{className:a}=o;if("plot"===a)return;const s=lL(o,(t=>"element"===t.className));const c=function(t){return lL(t,(t=>"component"===t.className))}(o),l=s||c;if(!l)return;const{className:u,markType:f}=l;if("element"===u){const r=Object.assign(Object.assign({},i),{nativeEvent:!0,data:{data:cL(l,e)}});n.emit(`element:${t}`,r),n.emit(`${f}:${t}`,r)}else{const e=Object.assign(Object.assign({},i),{nativeEvent:!0});n.emit(`component:${t}`,e),n.emit(`${a}:${t}`,e)}}}function fL(){return(t,e,n)=>{const{container:r,view:i}=t,o=uL(vf.CLICK,i,n,(t=>1===t.detail)),a=uL(vf.DBLCLICK,i,n,(t=>2===t.detail)),s=uL(vf.POINTER_TAP,i,n),c=uL(vf.POINTER_DOWN,i,n),l=uL(vf.POINTER_UP,i,n),u=uL(vf.POINTER_OVER,i,n),f=uL(vf.POINTER_OUT,i,n),d=uL(vf.POINTER_MOVE,i,n),h=uL(vf.POINTER_ENTER,i,n),p=uL(vf.POINTER_LEAVE,i,n),g=uL(vf.POINTER_UPOUTSIDE,i,n),m=uL(vf.DRAG_START,i,n),v=uL(vf.DRAG,i,n),y=uL(vf.DRAG_END,i,n),_=uL(vf.DRAG_ENTER,i,n),b=uL(vf.DRAG_LEAVE,i,n),E=uL(vf.DRAG_OVER,i,n),x=uL(vf.DROP,i,n);return r.addEventListener("click",o),r.addEventListener("click",a),r.addEventListener("pointertap",s),r.addEventListener("pointerdown",c),r.addEventListener("pointerup",l),r.addEventListener("pointerover",u),r.addEventListener("pointerout",f),r.addEventListener("pointermove",d),r.addEventListener("pointerenter",h),r.addEventListener("pointerleave",p),r.addEventListener("pointerupoutside",g),r.addEventListener("dragstart",m),r.addEventListener("drag",v),r.addEventListener("dragend",y),r.addEventListener("dragenter",_),r.addEventListener("dragleave",b),r.addEventListener("dragover",E),r.addEventListener("drop",x),()=>{r.removeEventListener("click",o),r.removeEventListener("click",a),r.removeEventListener("pointertap",s),r.removeEventListener("pointerdown",c),r.removeEventListener("pointerup",l),r.removeEventListener("pointerover",u),r.removeEventListener("pointerout",f),r.removeEventListener("pointermove",d),r.removeEventListener("pointerenter",h),r.removeEventListener("pointerleave",p),r.removeEventListener("pointerupoutside",g),r.removeEventListener("dragstart",m),r.removeEventListener("drag",v),r.removeEventListener("dragend",y),r.removeEventListener("dragenter",_),r.removeEventListener("dragleave",b),r.removeEventListener("dragover",E),r.removeEventListener("drop",x)}}}function dL(t,e){const n=Object.assign(Object.assign({},{"component.axisRadar":w_,"component.axisLinear":A_,"component.axisArc":T_,"component.legendContinuousBlock":gb,"component.legendContinuousBlockSize":vb,"component.legendContinuousSize":mb,"interaction.event":fL,"composition.mark":nE,"composition.view":eE,"shape.label.label":Xk}),e),r=e=>{if("string"!=typeof e)return e;const r=`${t}.${e}`;return n[r]||rf(`Unknown Component: ${r}`)};return[(t,e)=>{const{type:n}=t,i=o(t,["type"]);return r(n)(i,e)},r]}function hL(t){const{canvas:e,group:n}=t;return n?n.ownerDocument:e.document}function pL(t,e){const{coordinate:n={}}=t,r=o(t,["coordinate"]),{type:i,transform:a=[]}=n,s=o(n,["type","transform"]);if(!i)return Object.assign(Object.assign({},r),{coordinates:a});const[,c]=dL("coordinate",e),{transform:l=!1}=c(i).props||{};if(l)throw new Error(`Unknown coordinate: ${i}.`);return Object.assign(Object.assign({},r),{coordinates:[Object.assign({type:i},s),...a]})}function gL(t,e){return t.filter((t=>t.type===e))}function mL(t){return gL(t,"polar").length>0}function vL(t){return gL(t,"transpose").length%2==1}function yL(t){return gL(t,"theta").length>0}function _L(t){return gL(t,"radial").length>0}function bL(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}sL.props={};var EL=bL("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),xL=bL("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),ML=bL("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),SL=bL("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),AL=bL("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),TL=bL("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),OL=bL("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),RL=bL("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),PL=bL("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),CL=bL("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function wL(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function NL(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function IL(){}var kL=.7,LL=1/kL,DL="\\s*([+-]?\\d+)\\s*",BL="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",FL="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",UL=/^#([0-9a-f]{3,8})$/,jL=new RegExp(`^rgb\\(${DL},${DL},${DL}\\)$`),GL=new RegExp(`^rgb\\(${FL},${FL},${FL}\\)$`),WL=new RegExp(`^rgba\\(${DL},${DL},${DL},${BL}\\)$`),zL=new RegExp(`^rgba\\(${FL},${FL},${FL},${BL}\\)$`),VL=new RegExp(`^hsl\\(${BL},${FL},${FL}\\)$`),HL=new RegExp(`^hsla\\(${BL},${FL},${FL},${BL}\\)$`),XL={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function YL(){return this.rgb().formatHex()}function $L(){return this.rgb().formatRgb()}function qL(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=UL.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?KL(e):3===n?new tD(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?ZL(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?ZL(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=jL.exec(t))?new tD(e[1],e[2],e[3],1):(e=GL.exec(t))?new tD(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=WL.exec(t))?ZL(e[1],e[2],e[3],e[4]):(e=zL.exec(t))?ZL(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=VL.exec(t))?aD(e[1],e[2]/100,e[3]/100,1):(e=HL.exec(t))?aD(e[1],e[2]/100,e[3]/100,e[4]):XL.hasOwnProperty(t)?KL(XL[t]):"transparent"===t?new tD(NaN,NaN,NaN,0):null}function KL(t){return new tD(t>>16&255,t>>8&255,255&t,1)}function ZL(t,e,n,r){return r<=0&&(t=e=n=NaN),new tD(t,e,n,r)}function QL(t){return t instanceof IL||(t=qL(t)),t?new tD((t=t.rgb()).r,t.g,t.b,t.opacity):new tD}function JL(t,e,n,r){return 1===arguments.length?QL(t):new tD(t,e,n,null==r?1:r)}function tD(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function eD(){return`#${oD(this.r)}${oD(this.g)}${oD(this.b)}`}function nD(){const t=rD(this.opacity);return`${1===t?"rgb(":"rgba("}${iD(this.r)}, ${iD(this.g)}, ${iD(this.b)}${1===t?")":`, ${t})`}`}function rD(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function iD(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function oD(t){return((t=iD(t))<16?"0":"")+t.toString(16)}function aD(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new cD(t,e,n,r)}function sD(t){if(t instanceof cD)return new cD(t.h,t.s,t.l,t.opacity);if(t instanceof IL||(t=qL(t)),!t)return new cD;if(t instanceof cD)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,c=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=c<.5?o+i:2-o-i,a*=60):s=c>0&&c<1?0:a,new cD(a,s,c,t.opacity)}function cD(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function lD(t){return(t=(t||0)%360)<0?t+360:t}function uD(t){return Math.max(0,Math.min(1,t||0))}function fD(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}wL(IL,qL,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:YL,formatHex:YL,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return sD(this).formatHsl()},formatRgb:$L,toString:$L}),wL(tD,JL,NL(IL,{brighter(t){return t=null==t?LL:Math.pow(LL,t),new tD(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?kL:Math.pow(kL,t),new tD(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new tD(iD(this.r),iD(this.g),iD(this.b),rD(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:eD,formatHex:eD,formatHex8:function(){return`#${oD(this.r)}${oD(this.g)}${oD(this.b)}${oD(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:nD,toString:nD})),wL(cD,(function(t,e,n,r){return 1===arguments.length?sD(t):new cD(t,e,n,null==r?1:r)}),NL(IL,{brighter(t){return t=null==t?LL:Math.pow(LL,t),new cD(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?kL:Math.pow(kL,t),new cD(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new tD(fD(t>=240?t-240:t+120,i,r),fD(t,i,r),fD(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new cD(lD(this.h),uD(this.s),uD(this.l),rD(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=rD(this.opacity);return`${1===t?"hsl(":"hsla("}${lD(this.h)}, ${100*uD(this.s)}%, ${100*uD(this.l)}%${1===t?")":`, ${t})`}`}}));const dD=Math.PI/180,hD=180/Math.PI;var pD=-.14861,gD=1.78277,mD=-.29227,vD=-.90649,yD=1.97294,_D=yD*vD,bD=yD*gD,ED=gD*mD-vD*pD;function xD(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof MD)return new MD(t.h,t.s,t.l,t.opacity);t instanceof tD||(t=QL(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(ED*r+_D*e-bD*n)/(ED+_D-bD),o=r-i,a=(yD*(n-i)-mD*o)/vD,s=Math.sqrt(a*a+o*o)/(yD*i*(1-i)),c=s?Math.atan2(a,o)*hD-120:NaN;return new MD(c<0?c+360:c,s,i,t.opacity)}(t):new MD(t,e,n,null==r?1:r)}function MD(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}wL(MD,xD,NL(IL,{brighter(t){return t=null==t?LL:Math.pow(LL,t),new MD(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?kL:Math.pow(kL,t),new MD(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*dD,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new tD(255*(e+n*(pD*r+gD*i)),255*(e+n*(mD*r+vD*i)),255*(e+n*(yD*r)),this.opacity)}}));var SD=t=>()=>t;function AD(t,e){return function(n){return t+n*e}}function TD(t){return 1==(t=+t)?OD:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):SD(isNaN(e)?n:e)}}function OD(t,e){var n=e-t;return n?AD(t,n):SD(isNaN(t)?e:t)}!function t(e){var n=TD(e);function r(t,e){var r=n((t=JL(t)).r,(e=JL(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=OD(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);var RD,PD=(RD=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return function(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}((n-r/e)*e,a,i,o,s)}},function(t){var e,n,r=t.length,i=new Array(r),o=new Array(r),a=new Array(r);for(e=0;e<r;++e)n=JL(t[e]),i[e]=n.r||0,o[e]=n.g||0,a[e]=n.b||0;return i=RD(i),o=RD(o),a=RD(a),n.opacity=1,function(t){return n.r=i(t),n.g=o(t),n.b=a(t),n+""}});function CD(t){return function e(n){function r(e,r){var i=t((e=xD(e)).h,(r=xD(r)).h),o=OD(e.s,r.s),a=OD(e.l,r.l),s=OD(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=o(t),e.l=a(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}CD((function(t,e){var n=e-t;return n?AD(t,n>180||n<-180?n-360*Math.round(n/360):n):SD(isNaN(t)?e:t)}));var wD=CD(OD),ND=t=>PD(t[t.length-1]),ID=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(bL),kD=ND(ID),LD=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(bL),DD=ND(LD),BD=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(bL),FD=ND(BD),UD=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(bL),jD=ND(UD),GD=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(bL),WD=ND(GD),zD=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(bL),VD=ND(zD),HD=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(bL),XD=ND(HD),YD=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(bL),$D=ND(YD),qD=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(bL),KD=ND(qD),ZD=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(bL),QD=ND(ZD),JD=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(bL),tB=ND(JD),eB=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(bL),nB=ND(eB),rB=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(bL),iB=ND(rB),oB=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(bL),aB=ND(oB),sB=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(bL),cB=ND(sB),lB=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(bL),uB=ND(lB),fB=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(bL),dB=ND(fB),hB=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(bL),pB=ND(hB),gB=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(bL),mB=ND(gB),vB=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(bL),yB=ND(vB),_B=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(bL),bB=ND(_B),EB=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(bL),xB=ND(EB),MB=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(bL),SB=ND(MB),AB=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(bL),TB=ND(AB),OB=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(bL),RB=ND(OB),PB=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(bL),CB=ND(PB),wB=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(bL),NB=ND(wB);var IB=wD(xD(300,.5,0),xD(-240,.5,1)),kB=wD(xD(-100,.75,.35),xD(80,1.5,.8)),LB=wD(xD(260,.75,.35),xD(80,1.5,.8)),DB=xD();var BB=JL(),FB=Math.PI/3,UB=2*Math.PI/3;function jB(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var GB=jB(bL("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),WB=jB(bL("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),zB=jB(bL("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),VB=jB(bL("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),HB=Object.freeze({__proto__:null,schemeCategory10:EL,schemeAccent:xL,schemeDark2:ML,schemePaired:SL,schemePastel1:AL,schemePastel2:TL,schemeSet1:OL,schemeSet2:RL,schemeSet3:PL,schemeTableau10:CL,interpolateBrBG:kD,schemeBrBG:ID,interpolatePRGn:DD,schemePRGn:LD,interpolatePiYG:FD,schemePiYG:BD,interpolatePuOr:jD,schemePuOr:UD,interpolateRdBu:WD,schemeRdBu:GD,interpolateRdGy:VD,schemeRdGy:zD,interpolateRdYlBu:XD,schemeRdYlBu:HD,interpolateRdYlGn:$D,schemeRdYlGn:YD,interpolateSpectral:KD,schemeSpectral:qD,interpolateBuGn:QD,schemeBuGn:ZD,interpolateBuPu:tB,schemeBuPu:JD,interpolateGnBu:nB,schemeGnBu:eB,interpolateOrRd:iB,schemeOrRd:rB,interpolatePuBuGn:aB,schemePuBuGn:oB,interpolatePuBu:cB,schemePuBu:sB,interpolatePuRd:uB,schemePuRd:lB,interpolateRdPu:dB,schemeRdPu:fB,interpolateYlGnBu:pB,schemeYlGnBu:hB,interpolateYlGn:mB,schemeYlGn:gB,interpolateYlOrBr:yB,schemeYlOrBr:vB,interpolateYlOrRd:bB,schemeYlOrRd:_B,interpolateBlues:xB,schemeBlues:EB,interpolateGreens:SB,schemeGreens:MB,interpolateGreys:TB,schemeGreys:AB,interpolatePurples:RB,schemePurples:OB,interpolateReds:CB,schemeReds:PB,interpolateOranges:NB,schemeOranges:wB,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:IB,interpolateRainbow:function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return DB.h=360*t-100,DB.s=1.5-1.5*e,DB.l=.8-.9*e,DB+""},interpolateWarm:kB,interpolateCool:LB,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,BB.r=255*(e=Math.sin(t))*e,BB.g=255*(e=Math.sin(t+FB))*e,BB.b=255*(e=Math.sin(t+UB))*e,BB+""},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:GB,interpolateMagma:WB,interpolateInferno:zB,interpolatePlasma:VB});function XB(t,e,n,r,i,o){const{guide:a={}}=n,s=function(t,e,n){const{type:r,domain:i,range:o,quantitative:a,ordinal:s}=n;if(void 0!==r)return r;if(function(t){return lF(t,df)}(e))return"identity";if("string"==typeof o)return"linear";if((i||o||[]).length>2)return rF(t,s);if(void 0!==i)return sF([i])?rF(t,s):cF(e)?"time":iF(t,o,a);return sF(e)?rF(t,s):cF(e)?"time":iF(t,o,a)}(t,e,n);if("string"!=typeof s)return n;const c=function(t,e,n,r){const{domain:i}=r;if(void 0!==i)return i;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":case"quantize":case"threshold":return oF(function(t,e){const{zero:n=!1}=e;let r=1/0,i=-1/0;for(const e of t)for(const t of e)af(t)&&(r=Math.min(r,+t),i=Math.max(i,+t));return r===1/0?[]:n?[Math.min(0,r),i]:[r,i]}(n,r),r);case"band":case"ordinal":case"point":return aF(n);case"quantile":return function(t){return aF(t).sort()}(n);case"sequential":return oF(function(t){let e=1/0,n=-1/0;for(const r of t)for(const t of r)af(t)&&(e=Math.min(e,+t),n=Math.max(n,+t));return e===1/0?[]:[e<0?-n:e,n]}(n),r);default:return[]}}(s,0,e,n),l=function(t,e,n){const{ratio:r}=n;if(null==r)return e;if(JB({type:t}))return function(t,e,n){const r=t.map(Number),i=new ep({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 tF({type:t})?function(t,e){const n=Math.round(t.length*e);return t.slice(0,n)}(e,r):e}(s,c,n);return Object.assign(Object.assign(Object.assign({},n),function(t,e,n,r,i){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return function(t,e){const{interpolate:n=Sh,nice:r=!1,tickCount:i=5}=e;return Object.assign(Object.assign({},e),{interpolate:n,nice:r,tickCount:i})}(0,r);case"band":case"point":return function(t,e,n,r){if(void 0!==r.padding||void 0!==r.paddingInner||void 0!==r.paddingOuter)return Object.assign(Object.assign({},r),{unknown:NaN});const i=function(t,e,n){return"enterDelay"===e||"enterDuration"===e||"size"===e?0:"band"===t?yL(n)?0:.1:"point"===t?.5:0}(t,e,n),{paddingInner:o=i,paddingOuter:a=i}=r;return Object.assign(Object.assign({},r),{paddingInner:o,paddingOuter:a,padding:i,unknown:NaN})}(t,e,i,r);case"sequential":return function(t){const{palette:e="ylGnBu",offset:n}=t,r=Ie(e),i=HB[`interpolate${r}`];if(!i)throw new Error(`Unknown palette: ${r}`);return{interpolator:n?t=>i(n(t)):i}}(r);default:return r}}(s,t,0,n,r)),{domain:l,range:eF(s,t,e,n,l,i,o),expectedDomain:c,guide:a,name:t,type:s})}function YB(t,e){const n={};for(const r of t){const{values:t,name:i}=r,o=e[i];for(const e of t){const{name:t,value:r}=e;n[t]=r.map((t=>o.map(t)))}}return n}function $B(t,e){const n=Object.keys(t);for(const r of Object.values(e)){const{name:e,key:i}=r.getOptions();if("string"==typeof i)i in t||(t[i]=r);else if(e in t){const i=n.filter((t=>t.startsWith(e))).map((t=>+(t.replace(e,"")||0))),o=ju(i)+1,a=`${e}${o}`;t[a]=r,r.getOptions().key=a}else t[e]=r}return t}function qB(t,e){const[n]=dL("scale",e),{relations:r}=t,[i]=function(t){if(!t||!Array.isArray(t))return[tf,tf];let e,n;return[r=>{var i;e=r.map.bind(r),n=null===(i=r.invert)||void 0===i?void 0:i.bind(r);const o=t.filter((([t])=>"function"==typeof t)),a=t.filter((([t])=>"function"!=typeof t)),s=new Map(a);if(r.map=t=>{for(const[e,n]of o)if(e(t))return n;return s.has(t)?s.get(t):e(t)},!n)return r;const c=new Map(a.map((([t,e])=>[e,t]))),l=new Map(o.map((([t,e])=>[e,t])));return r.invert=t=>l.has(t)?t:c.has(t)?c.get(t):n(t),r},t=>(null!==e&&(t.map=e),null!==n&&(t.invert=n),t)]}(r);return i(n(t))}function KB(t){const e=t.flatMap((t=>Array.from(t.values()))).flatMap((t=>t.channels.map((t=>t.scale))));QB(e,"x"),QB(e,"y")}function ZB(t){const{channels:e=[],type:n,scale:r={}}=t,i=["shape","color","opacity","size"];return 0!==e.length?e:"axisX"===n?["x"]:"axisY"===n?["y"]:"legends"===n?Object.keys(r).filter((t=>i.includes(t))):[]}function QB(t,e){const n=t.filter((({name:t,facet:n=!0})=>n&&t===e)),r=n.flatMap((t=>t.domain)),i=n.every(JB)?vu(r):n.every(tF)?Array.from(new Set(r)):null;if(null!==i)for(const t of n)t.domain=i}function JB(t){const{type:e}=t;if("string"!=typeof e)return!1;return["linear","log","pow","time"].includes(e)}function tF(t){const{type:e}=t;if("string"!=typeof e)return!1;return["band","point","ordinal"].includes(e)}function eF(t,e,n,r,i,o,a){const{range:s}=r;if("string"==typeof s)return function(t){return t.split("-")}(s);if(void 0!==s)return s;const{rangeMin:c,rangeMax:l}=r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":{const t=nF(n,r,i,o,a),[s,u]=function(t,e){return"enterDelay"===t?[0,1e3]:"enterDuration"==t?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:"color"===t?[If(e),kf(e)]:"opacity"===t?[0,1]:"size"===t?[1,10]:[0,1]}(e,t);return[c||s,l||u]}case"band":case"point":return[c||("size"===e?5:0),l||("size"===e?10:1)];case"ordinal":return nF(n,r,i,o,a);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}function nF(t,e,n,r,i){const[o]=dL("palette",i),{category10:a,category20:s}=r,c=function(t){return Array.from(new Set(t))}(t.flat()).length<=a.length?a:s,{palette:l=c,offset:u}=e;if(Array.isArray(l))return l;try{return o({type:l})}catch(t){const e=function(t,e,n=(t=>t)){if(!t)return null;const r=Ie(t),i=HB[`scheme${r}`],o=HB[`interpolate${r}`];if(!i&&!o)return null;if(i){if(!i.some(Array.isArray))return i;const t=i[e.length];if(t)return t}return e.map(((t,r)=>o(n(r/e.length))))}(l,n,u);if(e)return e;throw new Error(`Unknown Component: ${l} `)}}function rF(t,e){return e||(function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")}(t)?"point":"ordinal")}function iF(t,e,n){return n||("color"!==t||e?"linear":"sequential")}function oF(t,e){if(0===t.length)return t;const{domainMin:n,domainMax:r}=e,[i,o]=t;return[null!=n?n:i,null!=r?r:o]}function aF(t){return Array.from(new Set(t.flat()))}function sF(t){return lF(t,(t=>{const e=typeof t;return"string"===e||"boolean"===e}))}function cF(t){return lF(t,(t=>t instanceof Date))}function lF(t,e){for(const n of t)if(n.some(e))return!0;return!1}const uF={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},fF={threshold:"threshold",quantize:"quantize",quantile:"quantile"},dF={ordinal:"ordinal",band:"band",point:"point"},hF={constant:"constant"};function pF(t,e,n){const{coordinates:r=[],title:i}=e,[,o]=dL("component",n),a=t.filter((({guide:t})=>null!==t)),s=[],c=function(t,e,n){const[,r]=dL("component",n),{coordinates:i}=t;function o(t,e,n,o){const a=function(t,e,n=[]){return"x"===t?vL(n)?`${e}Y`:`${e}X`:"y"===t?vL(n)?`${e}X`:`${e}Y`:null}(e,t,i);if(!o||!a)return;const{props:s}=r(a),{defaultPosition:c,defaultSize:l,defaultOrder:u,defaultCrossPadding:[f]}=s;return Object.assign(Object.assign({position:c,defaultSize:l,order:u,type:a,crossPadding:f},o),{scales:[n]})}return e.filter((t=>t.slider||t.scrollbar)).flatMap((t=>{const{slider:e,scrollbar:n,name:r}=t;return[o("slider",r,t,e),o("scrollbar",r,t,n)]})).filter((t=>!!t))}(e,t,n);if(s.push(...c),i){const{props:t}=o("title"),{defaultPosition:e,defaultOrientation:n,defaultOrder:r,defaultSize:a,defaultCrossPadding:c}=t,l="string"==typeof i?{title:i}:i;s.push(Object.assign({type:"title",position:e,orientation:n,order:r,crossPadding:c[0],defaultSize:a},l))}const l=function(t,e){const n=t.filter((t=>function(t){if(!t||!t.type)return!1;if("function"==typeof t.type)return!0;const{type:e,domain:n,range:r,interpolator:i}=t,o=n&&n.length>0,a=r&&r.length>0;return!!(["linear","sqrt","log","time","pow","threshold","quantize","quantile","ordinal","band","point"].includes(e)&&o&&a)||!(!["sequential"].includes(e)||!o||!a&&!i)||!(!["constant","identity"].includes(e)||!a)}(t)));return[...vF(n),..._F(n,e)]}(a,r);return l.forEach((([t,e])=>{const{props:n}=o(t),{defaultPosition:i,defaultPlane:c="xy",defaultOrientation:l,defaultSize:u,defaultOrder:f,defaultLength:d,defaultPadding:h=[0,0],defaultCrossPadding:p=[0,0]}=n,g=We({},...e),{guide:m,field:v}=g,y=Array.isArray(m)?m:[m];for(const n of y){const[o,g]=xF(t,i,l,n,e,a,r);if(!o&&!g)continue;const m="left"===o||"right"===o,y=m?h[1]:h[0],_=m?p[1]:p[0],{size:b,order:E=f,length:x=d,padding:M=y,crossPadding:S=_}=n;s.push(Object.assign(Object.assign({title:v},n),{defaultSize:u,length:x,position:o,plane:c,orientation:g,padding:M,order:E,crossPadding:S,size:b,type:t,scales:e}))}})),s}function gF(t,e,n,r,i){const[a]=dL("component",r),{scaleInstances:s,scale:c,bbox:l}=t,u={bbox:l,library:r};return a(o(t,["scaleInstances","scale","bbox"]))({coordinate:e,library:r,markState:i,scales:s,theme:n,value:u,scale:c})}function mF(t,e){const n=["left","right","bottom","top"],r=Su(t,(({type:t,position:e,group:r})=>n.includes(e)?void 0===r?t.startsWith("legend")?`legend-${e}`:Symbol("independent"):"independent"===r?Symbol("independent"):r:Symbol("independent")));return r.flatMap((([,t])=>{if(1===t.length)return t[0];if(void 0!==e){const n=t.filter((t=>void 0!==t.length)).map((t=>t.length)),r=Ju(n);if(r>e)return t.forEach((t=>t.group=Symbol("independent"))),t;const i=(e-r)/(t.length-n.length);t.forEach((t=>{void 0===t.length&&(t.length=i)}))}const n=ju(t,(t=>t.size)),r=ju(t,(t=>t.order)),i=ju(t,(t=>t.crossPadding));return{type:"group",size:n,order:r,position:t[0].position,children:t,crossPadding:i}}))}function vF(t,e){const n=["shape","size","color","opacity"],r=t.filter((({type:t,name:e})=>"string"==typeof t&&n.includes(e)&&!((t,e)=>"constant"===t&&"size"===e)(t,e))),i=r.filter((({type:t})=>"constant"===t)),o=Su(r.filter((({type:t})=>"constant"!==t)),(t=>t.field?t.field:Symbol("independent"))).map((([t,e])=>[t,[...e,...i]])).filter((([,t])=>t.some((t=>"constant"!==t.type)))),a=new Map(o);if(0===a.size)return[];const s=t=>t.sort((([t],[e])=>t.localeCompare(e))),c=Array.from(a).map((([,t])=>{const e=function(t){if(1===t.length)return[t];const e=[];for(let n=1;n<=t.length;n++)e.push(...Df(t,n));return e}(t).sort(((t,e)=>e.length-t.length)),n=e.map((t=>({combination:t,option:t.map((t=>[t.name,yF(t)]))})));for(const{option:t,combination:e}of n)if(!t.every((t=>"constant"===t[1]))&&t.every((t=>"discrete"===t[1]||"constant"===t[1])))return["legendCategory",e];for(const[t,e]of $f)for(const{option:r,combination:i}of n)if(e.some((t=>Ve(s(t),s(r)))))return[t,i];return null})).filter(af);return c}function yF(t){const{type:e}=t;return"string"!=typeof e?null:e in uF?"continuous":e in dF?"discrete":e in fF?"distribution":e in hF?"constant":null}function _F(t,e){return t.map((t=>{const{name:n}=t;if(function(t){return gL(t,"helix").length>0}(e)||yL(e))return null;if(vL(e)&&(mL(e)||_L(e)))return null;if(n.startsWith("x"))return mL(e)?["axisArc",[t]]:_L(e)?["axisLinear",[t]]:[vL(e)?"axisY":"axisX",[t]];if(n.startsWith("y"))return mL(e)?["axisLinear",[t]]:_L(e)?["axisArc",[t]]:[vL(e)?"axisX":"axisY",[t]];if(n.startsWith("z"))return["axisZ",[t]];if(n.startsWith("position")){if(function(t){return gL(t,"radar").length>0}(e))return["axisRadar",[t]];if(!mL(e))return["axisY",[t]]}return null})).filter(af)}function bF(t){const e=gL(t,"polar");if(e.length){const t=e[e.length-1],{startAngle:n,endAngle:r}=Uf(t);return[n,r]}const n=gL(t,"radial");if(n.length){const t=n[n.length-1],{startAngle:e,endAngle:r}=zf(t);return[e,r]}return[-Math.PI/2,Math.PI/2*3]}function EF(t,e,n,r,i){const{name:o}=n[0];if("axisRadar"===t){const t=r.filter((t=>t.name.startsWith("position"))),e=function(t){const e=/position(\d*)/g.exec(t);return e?+e[1]:null}(o);if(o===t.slice(-1)[0].name||null===e)return[null,null];const[n,a]=bF(i);return["center",(a-n)/(t.length-1)*e+n]}if("axisY"===t&&function(t){return gL(t,"parallel").length>0}(i))return vL(i)?["center","horizontal"]:["center","vertical"];if("axisLinear"===t){const[t]=bF(i);return["center",t]}return"axisArc"===t?"inner"===e[0]?["inner",null]:["outer",null]:mL(i)||_L(i)?["center",null]:"axisX"===t&&function(t){return gL(t,"reflect").length>0}(i)||"axisX"===t&&function(t){return gL(t,"reflectY").length>0}(i)?["top",null]:e}function xF(t,e,n,r,i,o,a){const[s]=bF(a),c=[r.position||e,null!=s?s:n];return"string"==typeof t&&t.startsWith("axis")?EF(t,c,i,o,a):"string"==typeof t&&t.startsWith("legend")&&mL(a)&&"center"===r.position?["center","vertical"]:c}function MF(t,e,n,r,i,o){const{type:a}=t;if(!["left","right","bottom","top"].includes(r))return;if("string"!=typeof a)return;const s=a;return(s.startsWith("axis")?RF:s.startsWith("group")?SF:s.startsWith("legendContinuous")?PF:"legendCategory"===s?CF:s.startsWith("slider")?OF:"title"===s?TF:s.startsWith("scrollbar")?AF:()=>{})(t,e,n,r,i,o)}function SF(t,e,n,r,i,o){const{children:a}=t,s=ju(a,(t=>t.crossPadding));a.forEach((t=>t.crossPadding=s)),a.forEach((t=>MF(t,e,n,r,i,o)));const c=ju(a,(t=>t.size));t.size=c,a.forEach((t=>t.size=c))}function AF(t,e,n,r,i,o){const{trackSize:a=6}=We({},i.scrollbar,t);t.size=a}function TF(t,e,n,r,i,a){const s=We({},i.title,t),{title:c,subtitle:l,spacing:u=0}=s,f=o(s,["title","subtitle","spacing"]);if(c){const e=DF(c,cf(f,"title"));t.size=e.height}if(l){const e=DF(l,cf(f,"subtitle"));t.size+=u+e.height}}function OF(t,e,n,r,i,o){const{trackSize:a,handleIconSize:s}=(()=>{const{slider:e}=i;return We({},e,t)})(),c=Math.max(a,2.4*s);t.size=c}function RF(t,e,n,r,i,a){t.transform=t.transform||[{type:"hide"}];const s="left"===r||"right"===r,c=kF(t,r,i),{tickLength:l=0,labelSpacing:u=0,titleSpacing:f=0}=c,d=o(c,["tickLength","labelSpacing","titleSpacing"]),h=wF(t,a),p=NF(d,h),g=l+u;if(p&&p.length){const r=ju(p,(t=>t.width)),i=ju(p,(t=>t.height));if(s)t.size=r+g;else{const{tickFilter:o,labelTransform:a}=t;!function(t,e,n,r,i){const o=Ju(e,(t=>t.width));if(o>n)return!0;const a=t.clone();a.update({range:[0,n]});const s=LF(t,i),c=s.map((t=>a.map(t)+function(t,e){if(!t.getBandWidth)return 0;const n=t.getBandWidth(e)/2;return n}(a,t))),l=s.map(((t,e)=>e)),u=-r[0],f=n+r[1],d=(t,e)=>{const{width:n}=e;return[t-n/2,t+n/2]};for(let t=0;t<l.length;t++){const n=c[t],[r,i]=d(n,e[t]);if(r<u||i>f)return!0;const o=c[t+1];if(o){const[n]=d(o,e[t+1]);if(i>n)return!0}}return!1}(h,p,e,n,o)||a?t.size=i+g:(t.labelTransform="rotate(90)",t.size=r+g)}}else t.size=l;const m=IF(d);m&&(t.size+=s?f+m.width:f+m.height)}function PF(t,e,n,r,i,a){const s=(()=>{const{legendContinuous:e}=i;return We({},e,t)})(),{labelSpacing:c=0,titleSpacing:l=0}=s,u=o(s,["labelSpacing","titleSpacing"]),f="left"===r||"right"===r,d=cf(u,"ribbon"),{size:h}=d,p=cf(u,"handleIcon"),{size:g}=p,m=Math.max(h,2.4*g);t.size=m;const v=NF(u,wF(t,a));if(v){const e=f?"width":"height",n=ju(v,(t=>t[e]));t.size+=n+c}const y=IF(u);y&&(f?t.size=Math.max(t.size,y.width):t.size+=l+y.height)}function CF(t,e,n,r,i,a){const s=(()=>{const{legendCategory:e}=i,{title:n}=t,[r,o]=Array.isArray(n)?[n,void 0]:[void 0,n];return We({title:r},e,Object.assign(Object.assign({},t),{title:o}))})(),{itemSpacing:c,itemMarkerSize:l,titleSpacing:u,rowPadding:f,colPadding:d,maxCols:h=1/0,maxRows:p=1/0}=s,g=o(s,["itemSpacing","itemMarkerSize","titleSpacing","rowPadding","colPadding","maxCols","maxRows"]),{cols:m,length:v}=t,y=t=>Math.min(t,p),_=t=>Math.min(t,h),b="left"===r||"right"===r,E=void 0===v?e+(b?0:n[0]+n[1]):v,x=IF(g),M=NF(g,wF(t,a),"itemLabel"),S=Math.max(M[0].height,l)+f,A=(t,e=0)=>l+t+c[0]+e;b?(()=>{let e=-1/0,n=0,r=1,i=0,o=-1/0,a=-1/0;const s=x?x.height:0,c=E-s;for(const{width:t}of M){const s=A(t);e=Math.max(e,s),n+S>c?(r++,o=Math.max(o,i),a=Math.max(a,n),i=1,n=S):(n+=S,i++)}r<=1&&(o=i,a=n),t.size=e*_(r),t.length=a+s,We(t,{cols:_(r),gridRow:o})})():"number"==typeof m?(()=>{const e=Math.ceil(M.length/m),n=ju(M,(t=>A(t.width)))*m;t.size=S*y(e)-f,t.length=Math.min(n,E)})():(()=>{let e=1,n=0,r=-1/0;for(const{width:t}of M){const i=A(t,d);n+i>E?(r=Math.max(r,n),n=i,e++):n+=i}1===e&&(r=n),t.size=S*y(e)-f,t.length=r})(),x&&(b?t.size=Math.max(t.size,x.width):t.size+=u+x.height)}function wF(t,e){const[n]=dL("scale",e),{scales:r,tickCount:i,tickMethod:o}=t,a=r.find((t=>"constant"!==t.type&&"identity"!==t.type));return void 0!==i&&(a.tickCount=i),void 0!==o&&(a.tickMethod=o),n(a)}function NF(t,e,n="label"){const{labelFormatter:r,tickFilter:i,label:a=!0}=t,s=o(t,["labelFormatter","tickFilter","label"]);if(!a)return null;const c=function(t,e,n){const r=LF(t,n),i=r.map((t=>{return"number"==typeof t?(e=t,Math.abs(e)<1e-15?e:parseFloat(e.toFixed(15))):t;var e})),o=e?"string"==typeof e?Of(e):e:t.getFormatter?t.getFormatter():t=>`${t}`;return i.map(o)}(e,r,i),l=cf(s,n),u=c.map(((t,e)=>Object.fromEntries(Object.entries(l).map((([n,r])=>[n,"function"==typeof r?r(t,e):r]))))),f=c.map(((t,e)=>DF(t,u[e]))),d=u.some((t=>t.transform));if(!d){const e=c.map(((t,e)=>e));t.indexBBox=new Map(e.map((t=>[t,[c[t],f[t]]])))}return f}function IF(t){const{title:e}=t,n=o(t,["title"]);if((t=>!1===t||null===t)(e)||void 0===e)return null;const r=cf(n,"title"),{direction:i,transform:a}=r,s=Array.isArray(e)?e.join(","):e;if("string"!=typeof s)return null;return DF(s,Object.assign(Object.assign({},r),{transform:a||("vertical"===i?"rotate(-90)":"")}))}function kF(t,e,n){const{title:r}=t,[i,o]=Array.isArray(r)?[r,void 0]:[void 0,r],{axis:a,[`axis${nf(e)}`]:s}=n;return We({title:i},a,s,Object.assign(Object.assign({},t),{title:o}))}function LF(t,e){const n=t.getTicks?t.getTicks():t.getOptions().domain;return e?n.filter(e):n}function DF(t,e){const n=function(t){return t instanceof Es?t:new ks({style:{text:`${t}`}})}(t),r=o(e,["filter"]);n.attr(Object.assign(Object.assign({},r),{visibility:"none"}));return n.getBBox()}function BF(t,e,n,r){var i,o;const{width:a,height:s,depth:c,x:l=0,y:u=0,z:f=0,inset:d=(null!==(i=n.inset)&&void 0!==i?i:0),insetLeft:h=d,insetTop:p=d,insetBottom:g=d,insetRight:m=d,margin:v=(null!==(o=n.margin)&&void 0!==o?o:0),marginLeft:y=v,marginBottom:_=v,marginTop:b=v,marginRight:E=v,padding:x=n.padding,paddingBottom:M=x,paddingLeft:S=x,paddingRight:A=x,paddingTop:T=x}=function(t,e,n,r){const{coordinates:i}=e;if(!mL(i)&&!_L(i))return e;const o=t.filter((t=>"string"==typeof t.type&&t.type.startsWith("axis")));if(0===o.length)return e;const a=o.map((t=>kF(t,"axisArc"===t.type?"arc":"linear",n))),s=ju(a,(t=>{var e;return null!==(e=t.labelSpacing)&&void 0!==e?e:0})),c=o.flatMap(((t,e)=>NF(a[e],wF(t,r)))).filter(af),l=ju(c,(t=>t.height))+s,u=o.flatMap(((t,e)=>IF(a[e]))).filter((t=>null!==t)),f=0===u.length?0:ju(u,(t=>t.height)),{inset:d=l,insetLeft:h=d,insetBottom:p=d,insetTop:g=d+f,insetRight:m=d}=e;return Object.assign(Object.assign({},e),{insetLeft:h,insetBottom:p,insetTop:g,insetRight:m})}(t,e,n,r),O=(t,n,r,i,o)=>{const{marks:a}=e;if(0===a.length)return[i,o];if(t-i-o-.25*t>0)return[i,o];const s=.75*t;return["auto"===n?s*i/(i+o):i,"auto"===r?s*o/(i+o):o]},R=t=>"auto"===t?20:null!=t?t:20,P=R(T),C=R(M),w=FF(t,s-P-C,[P+b,C+_],["left","right"],e,n,r),{paddingLeft:N,paddingRight:I}=w,k=a-y-E,[L,D]=O(k,S,A,N,I),B=k-L-D,F=FF(t,B,[L+y,D+E],["bottom","top"],e,n,r),{paddingTop:U,paddingBottom:j}=F,G=s-_-b,[W,z]=O(G,M,T,j,U);return{width:a,height:s,depth:c,insetLeft:h,insetTop:p,insetBottom:g,insetRight:m,innerWidth:B,innerHeight:G-W-z,paddingLeft:L,paddingRight:D,paddingTop:z,paddingBottom:W,marginLeft:y,marginBottom:_,marginTop:b,marginRight:E,x:l,y:u,z:f}}function FF(t,e,n,r,i,o,a){const s=Mu(t,(t=>t.position)),{padding:c=o.padding,paddingLeft:l=c,paddingRight:u=c,paddingBottom:f=c,paddingTop:d=c}=i,h={paddingBottom:f,paddingLeft:l,paddingTop:d,paddingRight:u};for(const t of r){const r=`padding${nf(Nk(t))}`;nf(Nk(t));const i=s.get(t)||[],c=h[r],l=t=>{void 0===t.size&&(t.size=t.defaultSize)},u=t=>{"group"===t.type?(t.children.forEach(l),t.size=ju(t.children,(t=>t.size))):t.size=t.defaultSize},f=r=>{r.size||("auto"!==c?u(r):(MF(r,e,n,t,o,a),l(r)))},d="bottom"===t||"top"===t,p=Wu(i,(t=>t.order)),g=i.filter((t=>t.type.startsWith("axis")&&t.order==p));if(g.length&&(g[0].crossPadding=0),"number"==typeof c)i.forEach(l);else if(0===i.length)h[r]=0;else{const t=mF(i,d?e+n[0]+n[1]:e);t.forEach(f);const o=t.reduce(((t,{size:e,crossPadding:n=12})=>t+e+n),0);h[r]=o}}return h}function UF({width:t,height:e,paddingLeft:n,paddingRight:r,paddingTop:i,paddingBottom:o,marginLeft:a,marginTop:s,marginBottom:c,marginRight:l,innerHeight:u,innerWidth:f,insetBottom:d,insetLeft:h,insetRight:p,insetTop:g}){const m=n+a,v=i+s,y=r+l,_=o+c,b=t-a-l,E=[m+h,v+g,f-h-p,u-g-d,"center",null,null];return{top:[m,0,f,v,"vertical",!0,au,a,b],right:[t-y,v,y,u,"horizontal",!1,au],bottom:[m,e-_,f,_,"vertical",!1,au,a,b],left:[0,v,m,u,"horizontal",!0,au],"top-left":[m,0,f,v,"vertical",!0,au],"top-right":[m,0,f,v,"vertical",!0,au],"bottom-left":[m,e-_,f,_,"vertical",!1,au],"bottom-right":[m,e-_,f,_,"vertical",!1,au],center:E,inner:E,outer:E}}function jF(t,e,n,r){const[i,o]=Lf(t,(t=>!("string"!=typeof t.type||!t.type.startsWith("axis"))));!function(t,e,n,r){"center"===r?function(t){return r_(t)&&t_(t)}(e)?function(t,e,n,r){const[i,o,a,s]=n;for(const e of t)e.bbox={x:i,y:o,width:a,height:s},e.radar={index:t.indexOf(e),count:t.length}}(t,0,n):t_(e)?function(t,e,n){const[r,i,o,a]=n;for(const e of t)e.bbox={x:r,y:i,width:o,height:a}}(t,0,n):r_(e)&&function(t,e,n,r){"horizontal"===r?function(t,e,n){const[r,i,o]=n,a=new Array(t.length).fill(0),s=e.map(a),c=s.filter(((t,e)=>e%2==1)).map((t=>t+i));for(let e=0;e<t.length;e++){const n=t[e],i=c[e],a=c[e+1]-i;n.bbox={x:r,y:i,width:o,height:a}}}(t,e,n):"vertical"===r&&function(t,e,n){const[r,i,,o]=n,a=new Array(t.length).fill(0),s=e.map(a),c=s.filter(((t,e)=>e%2==0)).map((t=>t+r));for(let e=0;e<t.length;e++){const n=t[e],r=c[e],a=c[e+1]-r;n.bbox={x:r,y:i,width:a,height:o}}}(t,e,n)}(t,e,n,t[0].orientation):"inner"===r?function(t,e,n){const[r,i,,o]=n,[a,s]=e.getCenter(),[c]=a_(e),l=c*(o/2),u=a-l,f=s-l;for(let e=0;e<t.length;e++){t[e].bbox={x:r+u,y:i+f,width:2*l,height:2*l}}}(t,e,n):"outer"===r&&function(t,e,n){const[r,i,o,a]=n;for(const e of t)e.bbox={x:r,y:i,width:o,height:a}}(t,0,n)}(i,e,n,r),function(t,e,n){if(0===t.length)return;const[r,i,o,a]=n,[s]=a_(e),c=a/2*s/Math.sqrt(2),l=r+o/2,u=i+a/2;for(let e=0;e<t.length;e++){t[e].bbox={x:l-c,y:u-c,width:2*c,height:2*c}}}(o,e,n)}function GF(t,e,n){const[r,i,o,a,s,c,l,u,f]=n,[d,h,p,g,m,v,y,_]="vertical"===s?["y",i,"x",r,"height",a,"width",o]:["x",r,"y",i,"width",o,"height",a];t.sort(((t,e)=>null==l?void 0:l(t.order,e.order)));const b=t=>"title"===t||"group"===t||t.startsWith("legend"),E=(t,e,n)=>void 0===n?e:b(t)?n:e,x=(t,e,n)=>void 0===n?e:b(t)?n:e;for(let e=0,n=c?h+v:h;e<t.length;e++){const r=t[e],{crossPadding:i=0,type:o}=r,{size:a}=r;r.bbox={[d]:c?n-a-i:n+i,[p]:x(o,g,u),[m]:a,[y]:E(o,_,f)},n+=(a+i)*(c?-1:1)}const M=t.filter((t=>"group"===t.type));for(const t of M){const{bbox:e,children:n}=t,r=e[y],i=r/n.length,o=n.reduce(((t,e)=>{var n;const r=null===(n=e.layout)||void 0===n?void 0:n.justifyContent;return r||t}),"flex-start"),a=n.map(((t,e)=>{const{length:r=i,padding:o=0}=t;return r+(e===n.length-1?0:o)})),s=r-Ju(a),c="flex-start"===o?0:"center"===o?s/2:s;for(let t=0,r=e[p]+c;t<n.length;t++){const i=n[t],{padding:s=0}=i,c=t===n.length-1?0:s;i.bbox={[m]:e[m],[d]:e[d],[p]:r,[y]:a[t]-c},We(i,{layout:{justifyContent:o}}),r+=a[t]}}}function WF(t,e,n){const{encode:r={},scale:i={},transform:a=[]}=e,s=o(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},s),{encode:r,scale:i,transform:a})]}function zF(t,e,n){return s(this,void 0,void 0,(function*(){const{library:t}=n,{data:r}=e,[i]=dL("data",t),a=function(t){if(Ae(t))return{type:"inline",value:t};if(!t)return{type:"inline",value:null};if(Array.isArray(t))return{type:"inline",value:t};const{type:e="inline"}=t,n=o(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}(r),{transform:c=[]}=a,l=[o(a,["transform"]),...c].map(i),u=yield function(t){return t.reduce(((t,e)=>n=>s(this,void 0,void 0,(function*(){const r=yield t(n);return e(r)}))),tf)}(l)(r),f=!r||Array.isArray(r)||Array.isArray(u)?u:{value:u};return[Array.isArray(u)?Nf(u):[],Object.assign(Object.assign({},e),{data:f})]}))}function VF(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i={};for(const[t,e]of Object.entries(r))if(Array.isArray(e))for(let n=0;n<e.length;n++){i[`${t}${0===n?"":n}`]=e[n]}else i[t]=e;return[t,Object.assign(Object.assign({},e),{encode:i})]}function HF(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const o=wf(r,(t=>{if(function(t){if("object"!=typeof t||t instanceof Date||null===t)return!1;const{type:e}=t;return af(e)}(t))return t;const e=function(t,e){return"function"==typeof e?"transform":"string"==typeof e&&function(t,e){return!!Array.isArray(t)&&t.some((t=>void 0!==t[e]))}(t,e)?"field":"constant"}(i,t);return{type:e,value:t}}));return[t,Object.assign(Object.assign({},e),{encode:o})]}function XF(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i=wf(r,((t,e)=>{const{type:n}=t;return"constant"!==n||function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||"enterDelay"===t||"enterDuration"===t||"updateDelay"===t||"updateDuration"===t||"exitDelay"===t||"exitDuration"===t}(e)?t:Object.assign(Object.assign({},t),{constant:!0})}));return[t,Object.assign(Object.assign({},e),{encode:i})]}function YF(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const{library:o}=n,a=function(t){const[e]=dL("encode",t);return(t,n)=>void 0===n||void 0===t?null:Object.assign(Object.assign({},n),{type:"column",value:e(n)(t),field:tU(n)})}(o),s=wf(r,(t=>a(i,t)));return[t,Object.assign(Object.assign({},e),{encode:s})]}function $F(t,e,n){const{tooltip:r={}}=e;return hf(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:df(r)&&NS(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function qF(t,e,n){const{data:r,encode:i,tooltip:a={}}=e;if(hf(a))return[t,e];const s=e=>{if(!e)return e;if("string"==typeof e)return t.map((t=>({name:e,value:r[t][e]})));if(df(e)){const{field:n,channel:o,color:a,name:s=n,valueFormatter:c=(t=>t)}=e,l="string"==typeof c?Of(c):c,u=o&&i[o],f=u&&i[o].field,d=s||f||o,h=[];for(const e of t){const t=n?r[e][n]:u?i[o].value[e]:null;h[e]={name:d,color:a,value:l(t)}}return h}if("function"==typeof e){const n=[];for(const o of t){const t=e(r[o],o,r,i);df(t)?n[o]=t:n[o]={value:t}}return n}return e},{title:c,items:l=[]}=a,u=o(a,["title","items"]),f=Object.assign({title:s(c),items:Array.isArray(l)?l.map(s):[]},u);return[t,Object.assign(Object.assign({},e),{tooltip:f})]}function KF(t,e,n){const{encode:r}=e,i=o(e,["encode"]);if(!r)return[t,e];const a=Object.entries(r),s=a.filter((([,t])=>{const{value:e}=t;return Array.isArray(e[0])})).flatMap((([e,n])=>{const r=[[e,new Array(t.length).fill(void 0)]],{value:i}=n,a=o(n,["value"]);for(let n=0;n<i.length;n++){const o=i[n];if(Array.isArray(o))for(let i=0;i<o.length;i++){const a=r[i]||[`${e}${i}`,new Array(t).fill(void 0)];a[1][n]=o[i],r[i]=a}}return r.map((([t,e])=>[t,Object.assign({type:"column",value:e},a)]))})),c=Object.fromEntries([...a,...s]);return[t,Object.assign(Object.assign({},i),{encode:c})]}function ZF(t,e,n){const{axis:r={},legend:i={},slider:o={},scrollbar:a={}}=e,s=(t,e)=>{if("boolean"==typeof t)return t?{}:null;const n=t[e];return void 0===n||n?n:null},c="object"==typeof r?Array.from(new Set(["x","y",...Object.keys(r)])):["x","y"];return We(e,{scale:Object.assign(Object.assign({},Object.fromEntries(c.map((t=>{const e=s(a,t);return[t,Object.assign({guide:s(r,t),slider:s(o,t),scrollbar:e},e&&{ratio:void 0===e.ratio?.5:e.ratio})]})))),{color:{guide:s(i,"color")},size:{guide:s(i,"size")},shape:{guide:s(i,"shape")},opacity:{guide:s(i,"opacity")}})}),[t,e]}function QF(t,e,n){const{animate:r}=e;return r||void 0===r||We(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}function JF(t,e,n){return s(this,void 0,void 0,(function*(){const r={library:n},[i,a]=yield function(t,e,n){return s(this,void 0,void 0,(function*(){const{library:r}=n,[i]=dL("transform",r),{preInference:o=[],postInference:a=[]}=e,{transform:s=[]}=t,c=[WF,zF,VF,HF,XF,YF,KF,QF,ZF,$F,...o.map(i),...s.map(i),...a.map(i),qF];let l=[],u=t;for(const t of c)[l,u]=yield t(l,u,n);return[l,u]}))}(t,e,r),{encode:c,scale:l,data:u,tooltip:f}=a;if(!1===Array.isArray(u))return null;const{channels:d}=e,h=Tu(Object.entries(c).filter((([,t])=>af(t))),(t=>t.map((([t,e])=>Object.assign({name:t},e)))),(([t])=>{var e;const n=null===(e=/([^\d]+)\d*$/.exec(t))||void 0===e?void 0:e[1],r=d.find((t=>t.name===n));return(null==r?void 0:r.independent)?t:n})),p=d.filter((t=>{const{name:e,required:n}=t;if(h.find((([t])=>t===e)))return!0;if(n)throw new Error(`Missing encoding for channel: ${e}.`);return!1})).flatMap((t=>{const{name:e,scale:n,scaleKey:r,range:i,quantitative:a,ordinal:s}=t;return h.filter((([t])=>t.startsWith(e))).map((([t,e],c)=>{const u=e.some((t=>t.visual)),f=e.some((t=>t.constant)),d=l[t]||{},{independent:h=!1,key:p=r||t,type:g=(f?"constant":u?"identity":n)}=d,m=o(d,["independent","key","type"]),v="constant"===g,y=v?void 0:i;return{name:t,values:e,scaleKey:h||v?Symbol("independent"):p,scale:Object.assign(Object.assign({type:g,range:y},m),{quantitative:a,ordinal:s})}}))}));return[a,Object.assign(Object.assign({},e),{index:i,channels:p,tooltip:f})]}))}function tU(t){const{type:e,value:n}=t;return"field"===e&&"string"==typeof n?n:null}function eU(t,e,n,r){var i,o;return s(this,void 0,void 0,(function*(){const[a]=dL("composition",n),[c]=dL("interaction",n),l=new Set(Object.keys(n).map((t=>{var e;return null===(e=/mark\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(af)),u=new Set(Object.keys(n).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(af)),f=t=>{const{type:e}=t;if("function"==typeof e){const{props:t={}}=e,{composite:n=!0}=t;if(n)return"mark"}return"string"!=typeof e?e:l.has(e)||u.has(e)?"mark":e},d=t=>"mark"===f(t),h=t=>"standardView"===f(t),p=t=>{const{type:e}=t;return"string"==typeof e&&!!u.has(e)},g=t=>{if(h(t))return[t];const e=f(t);return a({type:e,static:p(t)})(t)},m=[],v=new Map,y=new Map,_=[t],b=[];for(;_.length;){const t=_.shift();if(h(t)){const e=y.get(t),[r,i]=e?aU(e,t,n):yield rU(t,n);v.set(r,t),m.push(r);const o=i.flatMap(g).map((t=>pL(t,n)));if(_.push(...o),o.every(h)){const t=yield Promise.all(o.map((t=>iU(t,n))));KB(t);for(let e=0;e<o.length;e++){const n=o[e],r=t[e];y.set(n,r)}}}else{const e=g(d(t)?t:yield EU(t,n));Array.isArray(e)?_.push(...e):"function"==typeof e&&b.push(e())}}r.emitter.emit(vf.BEFORE_PAINT);const E=new Map,x=new Map,M=[];e.selectAll(AU(il)).data(m,(t=>t.key)).join((t=>t.append("g").attr("className",il).attr("id",(t=>t.key)).call(nU).each((function(t,e,i){sU(t,gf(i),M,n,r),E.set(t,i)}))),(t=>t.call(nU).each((function(t,e,i){sU(t,gf(i),M,n,r),x.set(t,i)}))),(t=>t.each((function(t,e,n){const r=n.nameInteraction.values();for(const t of r)t.destroy()})).remove()));const S=t=>Array.from(t.entries()).map((([t,e])=>{const i=new Map,o=function(t,e,n){return r=>s(this,void 0,void 0,(function*(){const i=[],[o,a]=yield rU(r,e);sU(o,t,i,e,n),function(t,e,n,r,i){var o;const[a]=dL("interaction",r),s=t.node(),c=s.nameInteraction,l=bU(e).find((([t])=>"tooltip"===t)),u=c.get("tooltip");if(!u)return;if(null===(o=u.destroy)||void 0===o||o.call(u),!l[1])return;const f=oU(n,"tooltip",l[1],a),d={options:e,view:n,container:t.node(),update:t=>Promise.resolve(t)},h=f(d,[],i.emitter);c.set("tooltip",h)}(t,r,o,e,n);for(const r of a)eU(r,t,e,n);return{options:r,view:o}}))}(gf(e),n,r),a=v.get(t);return{view:t,container:e,options:a,setState:(t,e=(t=>t))=>i.set(t,e),update:()=>s(this,void 0,void 0,(function*(){const t=ef(Array.from(i.values()))(a);return yield o(t)}))}})),A=S(E);for(const t of A){const{options:e}=t,n=new Map;t.container.nameInteraction=n;for(const i of bU(e)){const[e,o]=i;if(o){const i=oU(t.view,e,o,c)(t,A,r.emitter);n.set(e,{destroy:i})}}}const T=S(x);for(const t of T){const{options:e,container:n}=t,o=n.nameInteraction;for(const n of bU(e)){const[e,a]=n,s=o.get(e);if(s&&(null===(i=s.destroy)||void 0===i||i.call(s)),a){const n=oU(t.view,e,a,c)(t,T,r.emitter);o.set(e,{destroy:n})}}}const{width:O,height:R}=t,P=[];for(const t of b){const i=new Promise((i=>s(this,void 0,void 0,(function*(){for(const i of t){const t=Object.assign({width:O,height:R},i);yield eU(t,e,n,r)}i()}))));P.push(i)}r.views=m,null===(o=r.animations)||void 0===o||o.forEach((t=>null==t?void 0:t.cancel())),r.animations=M,r.emitter.emit(vf.AFTER_PAINT);const C=M.filter(af).map(mU).map((t=>t.finished));return Promise.all([...C,...P])}))}function nU(t){t.style("transform",(t=>`translate(${t.layout.x}, ${t.layout.y})`))}function rU(t,e){return s(this,void 0,void 0,(function*(){const n=yield function(t,e){return s(this,void 0,void 0,(function*(){const[n,r]=dL("mark",e),i=new Set(Object.keys(e).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(af)),{marks:o}=t,a=[],s=[],c=[...o],{width:l,height:u}=function(t){const{height:e,width:n,padding:r=0,paddingLeft:i=r,paddingRight:o=r,paddingTop:a=r,paddingBottom:s=r,margin:c=16,marginLeft:l=c,marginRight:u=c,marginTop:f=c,marginBottom:d=c,inset:h=0,insetLeft:p=h,insetRight:g=h,insetTop:m=h,insetBottom:v=h}=t,y=t=>"auto"===t?20:t;return{width:n-y(i)-y(o)-l-u-p-g,height:e-y(a)-y(s)-f-d-m-v}}(t),f={options:t,width:l,height:u};for(;c.length;){const[t]=c.splice(0,1),o=yield EU(t,e),{type:l=rf("G2Mark type is required."),key:u}=o;if(i.has(l))s.push(o);else{const{props:t={}}=r(l),{composite:e=!0}=t;if(e){const{data:t}=o,e=Object.assign(Object.assign({},o),{data:t?Array.isArray(t)?t:t.value:t}),r=yield n(e,f),i=Array.isArray(r)?r:[r];c.unshift(...i.map(((t,e)=>Object.assign(Object.assign({},t),{key:`${u}-${e}`}))))}else a.push(o)}}return Object.assign(Object.assign({},t),{marks:a,components:s})}))}(t,e),r=function(t){const{coordinate:e={},interaction:n={},style:r={},marks:i}=t,a=o(t,["coordinate","interaction","style","marks"]),s=i.map((t=>t.coordinate||{})),c=i.map((t=>t.interaction||{})),l=i.map((t=>t.viewStyle||{})),u=[...s,e].reduceRight(((t,e)=>We(t,e)),{}),f=[n,...c].reduce(((t,e)=>We(t,e)),{}),d=[...l,r].reduce(((t,e)=>We(t,e)),{});return Object.assign(Object.assign({},a),{marks:i,coordinate:u,interaction:f,style:d})}(n);t.interaction=r.interaction,t.coordinate=r.coordinate,t.marks=[...r.marks,...r.components];const i=pL(r,e);return aU(yield iU(i,e),i,e)}))}function iU(t,e){return s(this,void 0,void 0,(function*(){const[n]=dL("theme",e),[,r]=dL("mark",e),{theme:i,marks:o,coordinates:a=[]}=t,s=n(_U(i)),c=new Map;for(const t of o){const{type:n}=t,{props:i={}}=r(n),o=yield JF(t,i,e);if(o){const[t,e]=o;c.set(t,e)}}const l=Mu(Array.from(c.values()).flatMap((t=>t.channels)),(({scaleKey:t})=>t));for(const t of l.values()){const n=t.reduce(((t,{scale:e})=>We(t,e)),{}),{scaleKey:r}=t[0],{values:i}=t[0],o=Array.from(new Set(i.map((t=>t.field)).filter(af))),c=We({guide:{title:0===o.length?void 0:o},field:o[0]},n),{name:l}=t[0],u=t.flatMap((({values:t})=>t.map((t=>t.value)))),f=Object.assign(Object.assign({},XB(l,u,c,a,s,e)),{key:r});t.forEach((t=>t.scale=f))}return c}))}function oU(t,e,n,r){const i=t.theme,o="string"==typeof e&&i[e]||{};return r(We(o,Object.assign({type:e},n)))}function aU(t,e,n){const[r]=dL("mark",n),[i]=dL("theme",n),[o]=dL("labelTransform",n),{key:a,frame:s=!1,theme:c,clip:l,style:u={},labelTransform:f=[]}=e,d=i(_U(c)),h=Array.from(t.values()),p=function(t,e){var n;const{components:r=[]}=e,i=["scale","encode","axis","legend","data","transform"],o=Array.from(new Set(t.flatMap((t=>t.channels.map((t=>t.scale)))))),a=new Map(o.map((t=>[t.name,t])));for(const t of r){const e=ZB(t);for(const r of e){const e=a.get(r),s=(null===(n=t.scale)||void 0===n?void 0:n[r])||{},{independent:c=!1}=s;if(e&&!c){const{guide:n}=e,r="boolean"==typeof n?{}:n;e.guide=We({},r,t),Object.assign(e,s)}else{const e=Object.assign(Object.assign({},s),{expectedDomain:s.domain,name:r,guide:Xe(t,i)});o.push(e)}}}return o}(h,e),g=function(t){return t.map((t=>{const e=We(t,t.style);return delete e.style,e}))}(pF(function(t,e,n){var r;for(const[e]of n.entries())if("cell"===e.type)return t.filter((t=>"shape"!==t.name));if(1!==e.length||t.some((t=>"shape"===t.name)))return t;const{defaultShape:i}=e[0];if(!["point","line","rect","hollow"].includes(i))return t;const o={point:"point",line:"hyphen",rect:"square",hollow:"hollow"},a=(null===(r=t.find((t=>"color"===t.name)))||void 0===r?void 0:r.field)||null,s={field:a,name:"shape",type:"constant",domain:[],range:[o[i]]};return[...t,s]}(Array.from(p),h,t),e,n)),m=BF(g,e,d,n),v=function(t,e,n){const[r]=dL("coordinate",n),{innerHeight:i,innerWidth:o,insetLeft:a,insetTop:s,insetRight:c,insetBottom:l}=t,{coordinates:u=[]}=e,f=(d=u).find((t=>"cartesian"===t.type||"cartesian3D"===t.type))?d:[...d,{type:"cartesian"}];var d;const h="cartesian3D"===f[0].type,p=Object.assign(Object.assign({},t),{x:a,y:s,width:o-a-c,height:i-l-s,transformations:f.flatMap(r)});return h?new Tg(p):new xg(p)}(m,e,n),y=s?We({mainLineWidth:1,mainStroke:"#000"},u):u;!function(t,e,n){const r=Mu(t,(t=>`${t.plane||"xy"}-${t.position}`)),{paddingLeft:i,paddingRight:o,paddingTop:a,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:d,innerWidth:h,insetBottom:p,insetLeft:g,insetRight:m,insetTop:v,height:y,width:_,depth:b}=n,E={xy:UF({width:_,height:y,paddingLeft:i,paddingRight:o,paddingTop:a,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:d,innerWidth:h,insetBottom:p,insetLeft:g,insetRight:m,insetTop:v}),yz:UF({width:b,height:y,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:b,innerHeight:y,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0}),xz:UF({width:_,height:b,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:_,innerHeight:b,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0})};for(const[t,n]of r.entries()){const[r,i]=t.split("-"),o=E[r][i],[a,s]=Lf(n,(t=>"string"==typeof t.type&&("center"===i||!(!t.type.startsWith("axis")||!["inner","outer"].includes(i)))));a.length&&jF(a,e,o,i),s.length&&GF(n,0,o)}}(mF(g),v,m),function(t){const e=t.find((({type:t})=>"axisZ"===t));if(e){const n=t.find((({type:t})=>"axisX"===t));n.plane="xy";const r=t.find((({type:t})=>"axisY"===t));r.plane="xy",e.plane="yz",e.origin=[n.bbox.x,n.bbox.y,0],e.eulerAngles=[0,-90,0],e.bbox.x=n.bbox.x,e.bbox.y=n.bbox.y,t.push(Object.assign(Object.assign({},n),{plane:"xz",showLabel:!1,showTitle:!1,origin:[n.bbox.x,n.bbox.y,0],eulerAngles:[-90,0,0]})),t.push(Object.assign(Object.assign({},r),{plane:"yz",showLabel:!1,showTitle:!1,origin:[r.bbox.x+r.bbox.width,r.bbox.y,0],eulerAngles:[0,-90,0]})),t.push(Object.assign(Object.assign({},e),{plane:"xz",actualPosition:"left",showLabel:!1,showTitle:!1,eulerAngles:[90,-90,0]}))}}(g);const _={};for(const t of g){const{scales:e=[]}=t,r=[];for(const t of e){const{name:e}=t,i=qB(t,n);r.push(i),$B(_,{[e]:i})}t.scaleInstances=r}const b=[];for(const[e,i]of t.entries()){const{children:t,dataDomain:o,modifier:s,key:c}=e,{index:l,channels:u,tooltip:f}=i,d=Object.fromEntries(u.map((({name:t,scale:e})=>[t,e]))),h=wf(d,(t=>qB(t,n)));$B(_,h);const p=YB(u,h),g=r(e),[y,E,x]=cU(g(l,h,p,v)),M=o||y.length,S=s?s(E,M,m):[],A=t=>{var e,n;return null===(n=null===(e=f.title)||void 0===e?void 0:e[t])||void 0===n?void 0:n.value},T=t=>f.items.map((e=>e[t])),O=y.map(((t,e)=>{const n=Object.assign({points:E[e],transform:S[e],index:t,markKey:c,viewKey:a},f&&{title:A(t),items:T(t)});for(const[r,i]of Object.entries(p))n[r]=i[t],x&&(n[`series${Ie(r)}`]=x[e].map((t=>i[t])));return x&&(n.seriesIndex=x[e]),x&&f&&(n.seriesItems=x[e].map((t=>T(t))),n.seriesTitle=x[e].map((t=>A(t)))),n}));i.data=O,i.index=y;const R=null==t?void 0:t(O,h,m);b.push(...R||[])}return[{layout:m,theme:d,coordinate:v,markState:t,key:a,clip:l,scale:_,style:y,components:g,labelTransform:ef(f.map(o))},b]}function sU(t,e,n,r,i){return s(this,void 0,void 0,(function*(){const{components:a,theme:s,layout:c,markState:l,coordinate:u,key:f,style:d,clip:h,scale:p}=t,{x:g,y:m,width:v,height:y}=c,_=o(c,["x","y","width","height"]),b=["view","plot","main","content"],E=b.map(((t,e)=>e)),x=b.map((t=>lf(Object.assign({},s.view,d),t))),M=["a","margin","padding","inset"].map((t=>cf(_,t))),S=t=>t.style("x",(t=>P[t].x)).style("y",(t=>P[t].y)).style("width",(t=>P[t].width)).style("height",(t=>P[t].height)).each((function(t,e,n){!function(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}(gf(n),x[t])}));let A=0,T=0,O=v,R=y;const P=E.map((t=>{const e=M[t],{left:n=0,top:r=0,bottom:i=0,right:o=0}=e;return A+=n,T+=r,O-=n+o,R-=r+i,{x:A,y:T,width:O,height:R}}));e.selectAll(AU(cl)).data(E.filter((t=>af(x[t]))),(t=>b[t])).join((t=>t.append("rect").attr("className",cl).style("zIndex",-2).call(S)),(t=>t.call(S)),(t=>t.remove()));const C=function(t){let e=-1/0,n=1/0;for(const[r,i]of t){const{animate:t={}}=r,{data:o}=i,{enter:a={},update:s={},exit:c={}}=t,{type:l,duration:u=300,delay:f=0}=s,{type:d,duration:h=300,delay:p=0}=a,{type:g,duration:m=300,delay:v=0}=c;for(const t of o){const{updateType:r=l,updateDuration:i=u,updateDelay:o=f,enterType:a=d,enterDuration:s=h,enterDelay:c=p,exitDuration:y=m,exitDelay:_=v,exitType:b=g}=t;(void 0===r||r)&&(e=Math.max(e,i+o),n=Math.min(n,o)),(void 0===b||b)&&(e=Math.max(e,y+_),n=Math.min(n,_)),(void 0===a||a)&&(e=Math.max(e,s+c),n=Math.min(n,c))}}return e===-1/0?null:[n,e-n]}(l),w=!!C&&{duration:C[1]};for(const[,t]of Su(a,(t=>`${t.type}-${t.position}`)))t.forEach(((t,e)=>t.index=e));const N=e.selectAll(AU(al)).data(a,(t=>`${t.type}-${t.position}-${t.index}`)).join((t=>t.append("g").style("zIndex",(({zIndex:t})=>t||-1)).attr("className",al).append((t=>gF(We({animate:w,scale:p},t),u,s,r,l)))),(t=>t.transition((function(t,e,n){const{preserve:i=!1}=t;if(i)return;const o=gF(We({animate:w,scale:p},t),u,s,r,l),{attributes:a}=o,[c]=n.childNodes;return c.update(a)})))).transitions();n.push(...N.flat().filter(af));const I=e.selectAll(AU(ol)).data([c],(()=>f)).join((t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",ol).call(xU).call(SU,Array.from(l.keys())).call(TU,h)),(t=>t.call(SU,Array.from(l.keys())).call((t=>C?function(t,e){const[n,r]=e;t.transition((function(t,e,i){const{x:o,y:a,width:s,height:c}=i.style,{paddingLeft:l,paddingTop:u,innerWidth:f,innerHeight:d,marginLeft:h,marginTop:p}=t,g=[{x:o,y:a,width:s,height:c},{x:l+h,y:u+p,width:f,height:d}];return i.animate(g,{delay:n,duration:r,fill:"both"})}))}(t,C):xU(t))).call(TU,h))).transitions();n.push(...I.flat());for(const[o,a]of l.entries()){const{data:s}=a,{key:c,class:l,type:u}=o,f=e.select(`#${c}`),d=dU(o,a,t,r,i),h=gU(o,a,t,r),p=vU(o,a,t,r),g=yU(o,a,t,r),m=uU(e,f,l,"element"),v=f.selectAll(AU(rl)).selectFacetAll(m).data(s,(t=>t.key),(t=>t.groupKey)).join((t=>t.append(d).attr("className",rl).attr("markType",u).transition((function(t,e,n){return h(t,[n])}))),(t=>t.call((t=>{const e=t.parent(),n=sf((t=>{const[e,n]=t.getBounds().min;return[e,n]}));t.transition((function(t,r,i){fU(i,e,n);const o=d(t,r),a=p(t,[i],[o]);return null!==a||(i.nodeName===o.nodeName&&"g"!==o.nodeName?of(i,o):(i.parentNode.replaceChild(o,i),o.className=rl,o.markType=u,o.__data__=i.__data__)),a})).attr("markType",u).attr("className",rl)}))),(t=>t.each((function(t,e,n){n.__removed__=!0})).transition((function(t,e,n){return g(t,[n])})).remove()),(t=>t.append(d).attr("className",rl).attr("markType",u).transition((function(t,e,n){const{__fromElements__:r}=n,i=p(t,r,[n]);return new mf(r,null,n.parentNode).transition(i).remove(),i}))),(t=>t.transition((function(t,e,n){const r=new mf([],n.__toData__,n.parentNode).append(d).attr("className",rl).attr("markType",u).nodes();return p(t,[n],r)})).remove())).transitions();n.push(...v.flat())}!function(t,e,n,r,i){const[a]=dL("labelTransform",r),{markState:s,labelTransform:c}=t,l=e.select(AU(nl)).node(),u=new Map,f=new Map,d=Array.from(s.entries()).flatMap((([n,a])=>{const{labels:s=[],key:c}=n,l=function(t,e,n,r,i){const[a]=dL("shape",r),{data:s}=t,{data:c,defaultLabelShape:l}=e,u=c.map((t=>t.points)),{theme:f,coordinate:d}=n,h=Object.assign(Object.assign({},i),{document:hL(i),theme:f,coordinate:d});return t=>{const{index:e,points:n}=t,r=s[e],{formatter:i=(t=>`${t}`),transform:c,style:d,render:p}=t,g=o(t,["formatter","transform","style","render"]),m=wf(Object.assign(Object.assign({},g),d),(t=>lU(t,r,e,s))),{shape:v=l,text:y}=m,_=o(m,["shape","text"]),b="string"==typeof i?Of(i):i,E=Object.assign(Object.assign({},_),{text:b(y,r,e,s),datum:r}),x=Object.assign({type:`label.${v}`,render:p},_);return a(x,h)(n,E,hU(f,"label",v,"label"),u)}}(n,a,t,r,i),d=e.select(`#${c}`).selectAll(AU(rl)).nodes().filter((t=>!t.__removed__));return s.flatMap(((t,e)=>{const n=o(t,["transform"]);return d.flatMap((r=>{const i=function(t,e,n){const{seriesIndex:r,seriesKey:i,points:o,key:a,index:s}=n.__data__,c=function(t){const e=t.cloneNode(),n=t.getAnimations();e.style.visibility="hidden",n.forEach((t=>{const n=t.effect.getKeyframes();e.attr(n[n.length-1])})),t.parentNode.appendChild(e);const r=e.getLocalBounds();e.destroy();const{min:i,max:o}=r;return[i,o]}(n);if(!r)return[Object.assign(Object.assign({},t),{key:`${a}-${e}`,bounds:c,index:s,points:o,dependentElement:n})];const l=function(t){const{selector:e}=t;if(!e)return null;if("function"==typeof e)return e;if("first"===e)return t=>[t[0]];if("last"===e)return t=>[t[t.length-1]];throw new Error(`Unknown selector: ${e}`)}(t),u=r.map(((r,a)=>Object.assign(Object.assign({},t),{key:`${i[a]}-${e}`,bounds:[o[a]],index:r,points:o,dependentElement:n})));return l?l(u):u}(n,e,r);return i.forEach((e=>{u.set(e,l),f.set(e,t)})),i}))}))})),h=gf(l).selectAll(AU(sl)).data(d,(t=>t.key)).join((t=>t.append((t=>u.get(t)(t))).attr("className",sl)),(t=>t.each((function(t,e,n){of(n,u.get(t)(t))}))),(t=>t.remove())).nodes(),p=Mu(h,(t=>f.get(t.__data__))),{coordinate:g}=t;for(const[t,e]of p){const{transform:n=[]}=t;ef(n.map(a))(e,g)}c&&c(h,g)}(t,e,0,r,i)}))}function cU([t,e,n]){if(n)return[t,e,n];const r=[],i=[];for(let n=0;n<t.length;n++){const o=t[n],a=e[n];a.every((([t,e])=>af(t)&&af(e)))&&(r.push(o),i.push(a))}return[r,i]}function lU(t,e,n,r){return"function"==typeof t?t(e,n,r):"string"!=typeof t?t:void 0!==e[t]?e[t]:t}function uU(t,e,n,r){return t.node().parentElement.findAll((t=>void 0!==t.style.facet&&t.style.facet===n&&t!==e.node())).flatMap((t=>t.getElementsByClassName(r)))}function fU(t,e,n){if(!t.__facet__)return;const r=t.parentNode.parentNode,i=e.parentNode,[o,a]=n(r),[s,c]=n(i);!function(t,e){const{transform:n}=t.style,r=(t=>"none"===t||void 0===t)(n)?"":n;t.style.transform=`${r} ${e}`.trimStart()}(t,`translate(${o-s}, ${a-c})`),e.append(t)}function dU(t,e,n,r,i){const[a]=dL("shape",r),{data:s}=t,{defaultShape:c,data:l,shape:u}=e,f=l.map((t=>t.points)),{theme:d,coordinate:h}=n,{type:p,style:g={}}=t,m=Object.assign(Object.assign({},i),{document:hL(i),coordinate:h,theme:d});return e=>{const{shape:n=c}=g,{shape:r=n,points:i,seriesIndex:l,index:h}=e,v=o(e,["shape","points","seriesIndex","index"]),y=Object.assign(Object.assign({},v),{index:h}),_=l?l.map((t=>s[t])):s[h],b=l||h,E=wf(g,(t=>lU(t,_,b,s)));return(u[r]?u[r](E,m):a(Object.assign(Object.assign({},E),{type:MU(t,r)}),m))(i,y,hU(d,p,r,c),f)}}function hU(t,e,n,r){if("string"!=typeof e)return;const{color:i}=t,o=t[e]||{},a=o[n]||o[r];return Object.assign({color:i},a)}function pU(t,e,n,r,i){var o,a;const[,s]=dL("shape",i),[c]=dL("animation",i),{defaultShape:l,shape:u}=n,{theme:f,coordinate:d}=r,h=`default${Ie(t)}Animation`,{[h]:p}=(null===(o=u[l])||void 0===o?void 0:o.props)||s(MU(e,l)).props,{[t]:g={}}=f,m=(null===(a=e.animate)||void 0===a?void 0:a[t])||{},v={coordinate:d};return(e,n,r)=>{const{[`${t}Type`]:i,[`${t}Delay`]:o,[`${t}Duration`]:a,[`${t}Easing`]:s}=e,l=Object.assign({type:i||p},m);if(!l.type)return null;const u=c(l,v)(n,r,We(g,{delay:o,duration:a,easing:s}));return Array.isArray(u)?u:[u]}}function gU(t,e,n,r){return pU("enter",t,e,n,r)}function mU(t){return t.finished.then((()=>{t.cancel()})),t}function vU(t,e,n,r){return pU("update",t,e,n,r)}function yU(t,e,n,r){return pU("exit",t,e,n,r)}function _U(t={}){if("string"==typeof t)return{type:t};const{type:e="light"}=t,n=o(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}function bU(t){const{interaction:e={}}=t;return Object.entries(We({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},e))}function EU(t,e){return s(this,void 0,void 0,(function*(){const n={library:e},{data:r}=t,i=o(t,["data"]);if(null==r)return t;const[,{data:a}]=yield zF(0,{data:r},n);return Object.assign({data:a},i)}))}function xU(t){t.style("x",(t=>t.paddingLeft+t.marginLeft)).style("y",(t=>t.paddingTop+t.marginTop)).style("width",(t=>t.innerWidth)).style("height",(t=>t.innerHeight))}function MU(t,e){const{type:n}=t;return"string"==typeof e?`${n}.${e}`:e}function SU(t,e){const n=t=>void 0!==t.class?`${t.class}`:"";if(0===t.nodes().length)return;t.selectAll(AU(el)).data(e,(t=>t.key)).join((t=>t.append("g").attr("className",el).attr("id",(t=>t.key)).style("facet",n).style("fill","transparent").style("zIndex",(t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}))),(t=>t.style("facet",n).style("fill","transparent").style("zIndex",(t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}))),(t=>t.remove()));t.select(AU(nl)).node()||t.append("g").attr("className",nl).style("zIndex",0)}function AU(...t){return t.map((t=>`.${t}`)).join("")}function TU(t,e){t.node()&&t.style("clipPath",(t=>{if(!e)return null;const{paddingTop:n,paddingLeft:r,marginLeft:i,marginTop:o,innerWidth:a,innerHeight:s}=t;return new Is({style:{x:r+i,y:n+o,width:a,height:s}})}))}function OU(t){const e=We({},t),n=new Map([[e,null]]),r=new Map([[null,-1]]),i=[e];for(;i.length;){const t=i.shift();if(void 0===t.key){const e=n.get(t),i=r.get(t),o=null===e?"0":`${e.key}-${i}`;t.key=o}const{children:e=[]}=t;if(Array.isArray(e))for(let o=0;o<e.length;o++){const a=We({},e[o]);e[o]=a,n.set(a,t),r.set(a,o),i.push(a)}}return e}function RU(t,e){const n=new nu;return n.registerPlugin(new iu),new $s({width:t,height:e,container:document.createElement("div"),renderer:n})}function PU(t,e={},n=(()=>{}),r=(t=>{throw t})){const{width:i=640,height:o=480,depth:a=0}=t,s=OU(t),{canvas:c=RU(i,o),emitter:l=new ou,library:u}=e;e.canvas=c,e.emitter=l;const{width:f,height:d}=c.getConfig();f===i&&d===o||c.resize(i,o),l.emit(vf.BEFORE_RENDER);const h=gf(c.document.documentElement);return c.ready.then((()=>eU(Object.assign(Object.assign({},s),{width:i,height:o,depth:a}),h,u,e))).then((()=>{if(a){const[t,e]=c.document.documentElement.getPosition();c.document.documentElement.setPosition(t,e,-a/2)}c.requestAnimationFrame((()=>{l.emit(vf.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),"string"==typeof(p=c.getConfig().container)?document.getElementById(p):p;var p}function CU(t,e={},n=!1){const{canvas:r,emitter:i}=e;r&&(!function(t){const e=t.getRoot().querySelectorAll(`.${il}`);null==e||e.forEach((t=>{const{nameInteraction:e=new Map}=t;(null==e?void 0:e.size)>0&&Array.from(null==e?void 0:e.values()).forEach((t=>{null==t||t.destroy()}))}))}(r),n?r.destroy():r.destroyChildren()),i.off()}const wU=({value:t})=>e=>e.map((()=>t));wU.props={};const NU=({value:t})=>e=>e.map(t);NU.props={};const IU=({value:t})=>e=>e.map((e=>e[t]));IU.props={};const kU=({value:t})=>()=>t;function LU(t,e){return t.getBandWidth(t.invert(e))}kU.props={};const DU={rect:WA,hollow:zA,funnel:HA,pyramid:YA},BU=()=>(t,e,n,r)=>{const{x:i,y:o,y1:a,series:s,size:c}=n,l=e.x,u=e.series,[f]=r.getSize(),d=c?c.map((t=>+t/f)):null,h=c?(t,e,n)=>{const r=t+e/2,i=d[n];return[r-i/2,r+i/2]}:(t,e,n)=>[t,t+e],p=Array.from(t,(t=>{const e=LU(l,i[t]),n=e*(u?LU(u,null==s?void 0:s[t]):1),c=(+(null==s?void 0:s[t])||0)*e,f=+i[t]+c,[d,p]=h(f,n,t),g=+o[t],m=+a[t];return[[d,g],[p,g],[p,m],[d,m]].map((t=>r.map(t)))}));return[t,p]};BU.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:DU,channels:[...sk({shapes:Object.keys(DU)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...dk(),{type:GN},{type:JN}],postInference:[...uk()],interaction:{shareTooltip:!0}};const FU={rect:WA,hollow:zA},UU=()=>(t,e,n,r)=>{const{x:i,x1:o,y:a,y1:s}=n,c=Array.from(t,(t=>[[+i[t],+a[t]],[+o[t],+a[t]],[+o[t],+s[t]],[+i[t],+s[t]]].map((t=>r.map(t)))));return[t,c]};UU.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:FU,channels:[...sk({shapes:Object.keys(FU)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...dk(),{type:GN}],postInference:[...uk()],interaction:{shareTooltip:!0}};const jU={line:ZA,smooth:QA,hv:JA,vh:tT,hvh:eT,trail:rT},GU=(t,e,n,r)=>{var i,o;const{series:a,x:s,y:c}=n,{x:l,y:u}=e;if(void 0===s||void 0===c)throw new Error("Missing encode for x or y channel.");const f=a?Array.from(Mu(t,(t=>a[t])).values()):[t],d=f.map((t=>t[0])).filter((t=>void 0!==t)),h=((null===(i=null==l?void 0:l.getBandWidth)||void 0===i?void 0:i.call(l))||0)/2,p=((null===(o=null==u?void 0:u.getBandWidth)||void 0===o?void 0:o.call(u))||0)/2,g=Array.from(f,(t=>t.map((t=>r.map([+s[t]+h,+c[t]+p])))));return[d,g,f]},WU=(t,e,n,r)=>{const i=Object.entries(n).filter((([t])=>t.startsWith("position"))).map((([,t])=>t));if(0===i.length)throw new Error("Missing encode for position channel.");return[t,Array.from(t,(t=>{const e=i.map((e=>+e[t])),n=r.map(e),o=[];for(let t=0;t<n.length;t+=2)o.push([n[t],n[t+1]]);return o}))]},zU=()=>(t,e,n,r)=>(r_(r)?WU:GU)(t,e,n,r);zU.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:jU,channels:[...sk({shapes:Object.keys(jU)}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...dk(),{type:pI},{type:iI}],postInference:[...uk(),{type:QN,channel:"color"},{type:lI,channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const VU={line:iT},HU=(t,e,n,r)=>{var i,o,a;const{series:s,x:c,y:l,z:u}=n,{x:f,y:d,z:h}=e;if(void 0===c||void 0===l||void 0===u)throw new Error("Missing encode for x, y or z channel.");const p=s?Array.from(Mu(t,(t=>s[t])).values()):[t],g=p.map((t=>t[0])).filter((t=>void 0!==t)),m=((null===(i=null==f?void 0:f.getBandWidth)||void 0===i?void 0:i.call(f))||0)/2,v=((null===(o=null==d?void 0:d.getBandWidth)||void 0===o?void 0:o.call(d))||0)/2,y=((null===(a=null==h?void 0:h.getBandWidth)||void 0===a?void 0:a.call(h))||0)/2,_=Array.from(p,(t=>t.map((t=>r.map([(+c[t]||0)+m,(+l[t]||0)+v,(+u[t]||0)+y])))));return[g,_,p]},XU=()=>(t,e,n,r)=>HU(t,e,n,r);XU.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:VU,channels:[...sk({shapes:Object.keys(VU)}),{name:"x"},{name:"y"},{name:"z"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"identity"}],preInference:[...dk(),{type:iI}],postInference:[...ck()],interaction:{shareTooltip:!1,seriesTooltip:!1,crosshairs:!1}};const YU={hollow:lT,hollowDiamond:sT,hollowHexagon:cT,hollowSquare:uT,hollowTriangleDown:dT,hollowTriangle:fT,hollowBowtie:aT,point:bT,plus:_T,diamond:gT,square:ET,triangle:MT,hexagon:mT,cross:pT,bowtie:hT,hyphen:vT,line:yT,tick:xT,triangleDown:ST},$U=t=>(e,n,r,i)=>{const{x:o,y:a,x1:s,y1:c,size:l,dx:u,dy:f}=r,[d,h]=i.getSize(),p=pk(n,r,t),g=t=>{const e=+((null==u?void 0:u[t])||0),n=+((null==f?void 0:f[t])||0);return[(s?(+o[t]+ +s[t])/2:+o[t])+e,(c?(+a[t]+ +c[t])/2:+a[t])+n]},m=l?Array.from(e,(t=>{const[e,n]=g(t),r=+l[t],o=r/d,a=r/h,s=[e-o,n-a],c=[e+o,n+a];return[i.map(p(s,t)),i.map(p(c,t))]})):Array.from(e,(t=>[i.map(p(g(t),t))]));return[e,m]};$U.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,shape:YU,channels:[...sk({shapes:Object.keys(YU)}),{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:[...dk(),{type:JN},{type:tI}],postInference:[{type:nI},...lk()]};const qU=t=>(t,e,n,r)=>{const{x:i,y:o,z:a,size:s,dx:c,dy:l,dz:u}=n,[f,d,h]=r.getSize(),p=t=>{const e=+((null==c?void 0:c[t])||0),n=+((null==l?void 0:l[t])||0),r=+((null==u?void 0:u[t])||0);return[+i[t]+e,+o[t]+n,+a[t]+r]},g=s?Array.from(t,(t=>{const[e,n,i]=p(t),o=+s[t],a=o/f,c=o/d,l=o/h,u=[e-a,n-c,i-l],g=[e+a,n+c,i+l];return[r.map([...u,i]),r.map([...g,i])]})):Array.from(t,(t=>{const[e,n,i]=p(t);return[r.map([e,n,i])]}));return[t,g]},KU={sphere:sw,cube:cw};qU.props={defaultShape:"cube",defaultLabelShape:"label",composite:!1,shape:KU,channels:[...sk({shapes:Object.keys(KU)}),{name:"x",required:!0},{name:"y",required:!0},{name:"z",required:!0},{name:"series",scale:"band"},{name:"size",quantitative:"sqrt"},{name:"dx",scale:"identity"},{name:"dy",scale:"identity"},{name:"dz",scale:"identity"}],preInference:[...dk(),{type:JN},{type:tI},{type:eI}],postInference:[{type:nI},...ck()]};const ZU=t=>(t,e,n,r)=>{const{x:i,y:o,y1:a,z:s,size:c,dx:l,dy:u,dz:f}=n,d=e.x,h=e.x;r.getSize();const p=(t,e,n)=>[t,t+e],g=Array.from(t,(t=>{const e=QU(d,i[t]),n=QU(h,s[t]),c=+i[t],l=+s[t],[u,f]=p(c,e),[g,m]=p(l,n),v=[u,+o[t],g],y=[f,+a[t],m];return[r.map([...v]),r.map([...y])]}));return[t,g]};function QU(t,e){return t.getBandWidth(t.invert(e))}const JU={cube:lw};ZU.props={defaultShape:"cube",defaultLabelShape:"label",composite:!1,shape:JU,channels:[...sk({shapes:Object.keys(JU)}),{name:"x",scale:"band",required:!0},{name:"z",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...dk(),{type:JN},{type:GN},{type:eI}],postInference:[{type:nI},...ck()]};const tj={text:hw,badge:gw},ej=t=>{const{cartesian:e=!1}=t;return e?mk:(e,n,r,i)=>{const{x:o,y:a}=r,s=pk(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};ej.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,shape:tj,channels:[...sk({shapes:Object.keys(tj)}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize"},{name:"rotate"}],preInference:[...dk(),{type:hI},{type:fI}],postInference:[...lk()]};const nj={cell:WA,hollow:zA},rj=()=>(t,e,n,r)=>{const{x:i,y:o}=n,a=e.x,s=e.y,c=Array.from(t,(t=>{const e=a.getBandWidth(a.invert(+i[t])),n=s.getBandWidth(s.invert(+o[t])),c=+i[t],l=+o[t];return[[c,l],[c+e,l],[c+e,l+n],[c,l+n]].map((t=>r.map(t)))}));return[t,c]};rj.props={defaultShape:"cell",defaultLabelShape:"label",shape:nj,composite:!1,channels:[...sk({shapes:Object.keys(nj)}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...dk(),{type:JN},{type:tI},{type:uI}],postInference:[...lk()]};const ij={area:yw,smooth:_w,hvh:bw,vh:Ew,hv:xw},oj=()=>(t,e,n,r)=>{var i,o;const{x:a,y:s,y1:c,series:l}=n,{x:u,y:f}=e,d=l?Array.from(Mu(t,(t=>l[t])).values()):[t],h=d.map((t=>t[0])).filter((t=>void 0!==t)),p=((null===(i=null==u?void 0:u.getBandWidth)||void 0===i?void 0:i.call(u))||0)/2,g=((null===(o=null==f?void 0:f.getBandWidth)||void 0===o?void 0:o.call(f))||0)/2;return[h,Array.from(d,(t=>{const e=t.length,n=new Array(2*e);for(let i=0;i<t.length;i++){const o=t[i];n[i]=r.map([+a[o]+p,+s[o]+g]),n[e+i]=r.map([+a[o]+p,+c[o]+g])}return n})),d]};oj.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,shape:ij,channels:[...sk({shapes:Object.keys(ij)}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...dk(),{type:iI},{type:GN},{type:uI}],postInference:[...uk()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const aj={link:Mw,arc:Ow,smooth:Sw,vhv:Tw},sj=t=>(e,n,r,i)=>{const{x:o,y:a,x1:s=o,y1:c=a}=r,l=pk(n,r,t),u=e.map((t=>[i.map(l([+o[t],+a[t]],t)),i.map(l([+s[t],+c[t]],t))]));return[e,u]};sj.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,shape:aj,channels:[...sk({shapes:Object.keys(aj)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...dk(),{type:sI},{type:cI}],postInference:[...lk()]};const cj={image:bk},lj=t=>{const{cartesian:e}=t;return e?mk:(e,n,r,i)=>{const{x:o,y:a}=r,s=pk(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};lj.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,shape:cj,channels:[...sk({shapes:Object.keys(cj)}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...dk(),{type:hI},{type:fI}],postInference:[...lk()]};const uj={polygon:xk,ribbon:Sk},fj=()=>(t,e,n,r)=>{const i=Object.entries(n).filter((([t])=>t.startsWith("x"))).map((([,t])=>t)),o=Object.entries(n).filter((([t])=>t.startsWith("y"))).map((([,t])=>t)),a=t.map((t=>{const e=[];for(let n=0;n<i.length;n++){const a=i[n][t];if(void 0===a)break;const s=o[n][t];e.push(r.map([+a,+s]))}return e}));return[t,a]};fj.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,shape:uj,channels:[...sk({shapes:Object.keys(uj)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...dk()],postInference:[...lk()]};const dj={box:Tk,violin:Rk},hj=()=>(t,e,n,r)=>{const{x:i,y:o,y1:a,y2:s,y3:c,y4:l,series:u}=n,f=e.x,d=e.series,h=Array.from(t,(t=>{const e=f.getBandWidth(f.invert(+i[t])),n=e*(d?d.getBandWidth(d.invert(+(null==u?void 0:u[t]))):1),h=(+(null==u?void 0:u[t])||0)*e,p=+i[t]+h+n/2,[g,m,v,y,_]=[+o[t],+a[t],+s[t],+c[t],+l[t]];return[[p-n/2,_],[p+n/2,_],[p,_],[p,y],[p-n/2,y],[p+n/2,y],[p+n/2,m],[p-n/2,m],[p-n/2,v],[p+n/2,v],[p,m],[p,g],[p-n/2,g],[p+n/2,g]].map((t=>r.map(t)))}));return[t,h]};hj.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,shape:dj,channels:[...sk({shapes:Object.keys(dj)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...dk(),{type:JN}],postInference:[...uk()],interaction:{shareTooltip:!0}};const pj={vector:uw},gj=()=>(t,e,n,r)=>{const{x:i,y:o,size:a,rotate:s}=n,[c,l]=r.getSize(),u=t.map((t=>{const e=+s[t]/180*Math.PI,n=+a[t],u=n/l,f=n/c*Math.cos(e),d=-u*Math.sin(e);return[r.map([+i[t]-f/2,+o[t]-d/2]),r.map([+i[t]+f/2,+o[t]+d/2])]}));return[t,u]};gj.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,shape:pj,channels:[...sk({shapes:Object.keys(pj)}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...dk()],postInference:[...lk()]};const mj={line:Pk},vj=t=>(e,n,r,i)=>{const{y:o}=r,a=pk(n,r,We({style:{bandOffset:0}},t)),s=Array.from(e,(t=>[[0,o[t]],[1,o[t]]].map((e=>i.map(a(e,t))))));return[e,s]};vj.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:mj,channels:[...fk({shapes:Object.keys(mj)}),{name:"y",required:!0}],preInference:[...dk(),{type:oI}],postInference:[]};const yj={line:Pk},_j=t=>(e,n,r,i)=>{const{x:o}=r,a=pk(n,r,We({style:{bandOffset:0}},t)),s=Array.from(e,(t=>[[o[t],1],[o[t],0]].map((e=>i.map(a(e,t))))));return[e,s]};_j.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:yj,channels:[...fk({shapes:Object.keys(yj)}),{name:"x",required:!0}],preInference:[...dk(),{type:aI}],postInference:[]};const bj={connector:wk},Ej=(...t)=>sj(...t);function xj(t,e,n,r){if(e)return()=>[0,1];const{[t]:i,[`${t}1`]:o}=n;return t=>{var e;const n=(null===(e=r.getBandWidth)||void 0===e?void 0:e.call(r,r.invert(+o[t])))||0;return[i[t],o[t]+n]}}function Mj(t={}){const{extendX:e=!1,extendY:n=!1}=t;return(t,r,i,o)=>{const a=xj("x",e,i,r.x),s=xj("y",n,i,r.y),c=Array.from(t,(t=>{const[e,n]=a(t),[r,i]=s(t);return[[e,r],[n,r],[n,i],[e,i]].map((t=>o.map(t)))}));return[t,c]}}Ej.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,shape:bj,channels:[...fk({shapes:Object.keys(bj)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...dk()],postInference:[]};const Sj={range:WA},Aj=()=>Mj();Aj.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:Sj,channels:[...fk({shapes:Object.keys(Sj)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...dk()],postInference:[]};const Tj={range:WA},Oj=()=>Mj({extendY:!0});Oj.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:Tj,channels:[...fk({shapes:Object.keys(Tj)}),{name:"x",required:!0}],preInference:[...dk()],postInference:[]};const Rj={range:WA},Pj=()=>Mj({extendX:!0});function Cj(t){return t.target.depth}function wj(t,e){return t.sourceLinks.length?t.depth:e-1}function Nj(t){return function(){return t}}function Ij(t,e){return Lj(t.source,e.source)||t.index-e.index}function kj(t,e){return Lj(t.target,e.target)||t.index-e.index}function Lj(t,e){return t.y0-e.y0}function Dj(t){return t.value}function Bj(t){return t.index}function Fj(t){return t.nodes}function Uj(t){return t.links}function jj(t,e){const n=t.get(e);if(!n)throw new Error("missing: "+e);return n}function Gj({nodes:t}){for(const e of t){let t=e.y0,n=t;for(const n of e.sourceLinks)n.y0=t+n.width/2,t+=n.width;for(const t of e.targetLinks)t.y1=n+t.width/2,n+=t.width}}function Wj(){let t,e,n,r,i=0,o=0,a=1,s=1,c=24,l=8,u=Bj,f=wj,d=Fj,h=Uj,p=6;function g(g){const y={nodes:d(g),links:h(g)};return function({nodes:t,links:e}){t.forEach(((t,e)=>{t.index=e,t.sourceLinks=[],t.targetLinks=[]}));const n=new Map(t.map((t=>[u(t),t])));if(e.forEach(((t,e)=>{t.index=e;let{source:r,target:i}=t;"object"!=typeof r&&(r=t.source=jj(n,r)),"object"!=typeof i&&(i=t.target=jj(n,i)),r.sourceLinks.push(t),i.targetLinks.push(t)})),null!=r)for(const{sourceLinks:e,targetLinks:n}of t)e.sort(r),n.sort(r)}(y),function({nodes:t}){for(const e of t)e.value=void 0===e.fixedValue?Math.max(Ju(e.sourceLinks,Dj),Ju(e.targetLinks,Dj)):e.fixedValue}(y),function({nodes:t}){const n=t.length;let r=new Set(t),i=new Set,o=0;for(;r.size;){if(r.forEach((t=>{t.depth=o;for(const{target:e}of t.sourceLinks)i.add(e)})),++o>n)throw new Error("circular link");r=i,i=new Set}if(e){const n=Math.max(ju(t,(t=>t.depth))+1,0);let r;for(let i=0;i<t.length;i++)r=t[i],r.depth=e.call(null,r,n)}}(y),function({nodes:t}){const e=t.length;let n=new Set(t),r=new Set,i=0;for(;n.size;){if(n.forEach((t=>{t.height=i;for(const{source:e}of t.targetLinks)r.add(e)})),++i>e)throw new Error("circular link");n=r,r=new Set}}(y),function(e){const r=function({nodes:t}){const e=Math.max(ju(t,(t=>t.depth))+1,0),r=(a-i-c)/(e-1),o=new Array(e).fill(0).map((()=>[]));for(const n of t){const t=Math.max(0,Math.min(e-1,Math.floor(f.call(null,n,e))));n.layer=t,n.x0=i+t*r,n.x1=n.x0+c,o[t]?o[t].push(n):o[t]=[n]}if(n)for(const t of o)t.sort(n);return o}(e);t=Math.min(l,(s-o)/(ju(r,(t=>t.length))-1)),function(e){const n=Wu(e,(e=>(s-o-(e.length-1)*t)/Ju(e,Dj)));for(const r of e){let e=o;for(const i of r){i.y0=e,i.y1=e+i.value*n,e=i.y1+t;for(const t of i.sourceLinks)t.width=t.value*n}e=(s-e+t)/(r.length+1);for(let t=0;t<r.length;++t){const n=r[t];n.y0+=e*(t+1),n.y1+=e*(t+1)}x(r)}}(r);for(let t=0;t<p;++t){const e=Math.pow(.99,t),n=Math.max(1-e,(t+1)/p);v(r,e,n),m(r,e,n)}}(y),Gj(y),y}function m(t,e,r){for(let i=1,o=t.length;i<o;++i){const o=t[i];for(const t of o){let n=0,r=0;for(const{source:e,value:i}of t.targetLinks){const o=i*(t.layer-e.layer);n+=M(e,t)*o,r+=o}if(!(r>0))continue;const i=(n/r-t.y0)*e;t.y0+=i,t.y1+=i,E(t)}void 0===n&&o.sort(Lj),o.length&&y(o,r)}}function v(t,e,r){for(let i=t.length-2;i>=0;--i){const o=t[i];for(const t of o){let n=0,r=0;for(const{target:e,value:i}of t.sourceLinks){const o=i*(e.layer-t.layer);n+=S(t,e)*o,r+=o}if(!(r>0))continue;const i=(n/r-t.y0)*e;t.y0+=i,t.y1+=i,E(t)}void 0===n&&o.sort(Lj),o.length&&y(o,r)}}function y(e,n){const r=e.length>>1,i=e[r];b(e,i.y0-t,r-1,n),_(e,i.y1+t,r+1,n),b(e,s,e.length-1,n),_(e,o,0,n)}function _(e,n,r,i){for(;r<e.length;++r){const o=e[r],a=(n-o.y0)*i;a>1e-6&&(o.y0+=a,o.y1+=a),n=o.y1+t}}function b(e,n,r,i){for(;r>=0;--r){const o=e[r],a=(o.y1-n)*i;a>1e-6&&(o.y0-=a,o.y1-=a),n=o.y0-t}}function E({sourceLinks:t,targetLinks:e}){if(void 0===r){for(const{source:{sourceLinks:t}}of e)t.sort(kj);for(const{target:{targetLinks:e}}of t)e.sort(Ij)}}function x(t){if(void 0===r)for(const{sourceLinks:e,targetLinks:n}of t)e.sort(kj),n.sort(Ij)}function M(e,n){let r=e.y0-(e.sourceLinks.length-1)*t/2;for(const{target:i,width:o}of e.sourceLinks){if(i===n)break;r+=o+t}for(const{source:t,width:i}of n.targetLinks){if(t===e)break;r-=i}return r}function S(e,n){let r=n.y0-(n.targetLinks.length-1)*t/2;for(const{source:i,width:o}of n.targetLinks){if(i===e)break;r+=o+t}for(const{target:t,width:i}of e.sourceLinks){if(t===n)break;r-=i}return r}return g.update=function(t){return Gj(t),t},g.nodeId=function(t){return arguments.length?(u="function"==typeof t?t:Nj(t),g):u},g.nodeAlign=function(t){return arguments.length?(f="function"==typeof t?t:Nj(t),g):f},g.nodeDepth=function(t){return arguments.length?(e=t,g):e},g.nodeSort=function(t){return arguments.length?(n=t,g):n},g.nodeWidth=function(t){return arguments.length?(c=+t,g):c},g.nodePadding=function(e){return arguments.length?(l=t=+e,g):l},g.nodes=function(t){return arguments.length?(d="function"==typeof t?t:Nj(t),g):d},g.links=function(t){return arguments.length?(h="function"==typeof t?t:Nj(t),g):h},g.linkSort=function(t){return arguments.length?(r=t,g):r},g.size=function(t){return arguments.length?(i=o=0,a=+t[0],s=+t[1],g):[a-i,s-o]},g.extent=function(t){return arguments.length?(i=+t[0][0],a=+t[1][0],o=+t[0][1],s=+t[1][1],g):[[i,o],[a,s]]},g.iterations=function(t){return arguments.length?(p=+t,g):p},g}Pj.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:Rj,channels:[...fk({shapes:Object.keys(Rj)}),{name:"y",required:!0}],preInference:[...dk()],postInference:[]};const zj={nodeAlign:"justify",nodeWidth:.008,nodePadding:.03,nodes:t=>t.nodes,links:t=>t.links,nodeSort:void 0,linkSort:void 0,iterations:6},Vj={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?Wu(t.sourceLinks,Cj)-1:0},justify:wj};const Hj=t=>e=>{const{nodeId:n,nodeSort:r,nodeAlign:i,nodeWidth:o,nodePadding:a,nodeDepth:s,nodes:c,links:l,linkSort:u,iterations:f}=Object.assign({},zj,t),d=Wj().nodeSort(r).linkSort(u).links(l).nodes(c).nodeWidth(o).nodePadding(a).nodeDepth(s).nodeAlign(function(t){const e=typeof t;return"string"===e?Vj[t]||wj:"function"===e?t:wj}(i)).iterations(f).extent([[0,0],[1,1]]);"function"==typeof n&&d.nodeId(n);const h=d(e),{nodes:p,links:g}=h,m=p.map((t=>{const{x0:e,x1:n,y0:r,y1:i}=t;return Object.assign(Object.assign({},t),{x:[e,n,n,e],y:[r,r,i,i]})})),v=g.map((t=>{const{source:e,target:n}=t,r=e.x1,i=n.x0,o=t.width/2;return Object.assign(Object.assign({},t),{x:[r,r,i,i],y:[t.y0+o,t.y0-o,t.y1+o,t.y1-o]})}));return{nodes:m,links:v}};Hj.props={};const Xj={nodeId:t=>t.key,nodeWidth:.02,nodePadding:.02},Yj={type:"polygon",axis:!1,legend:!1,encode:{shape:"polygon",x:"x",y:"y"},scale:{x:{type:"identity"},y:{type:"identity"}},style:{stroke:"#000"}},$j={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{fillOpacity:.5,stroke:void 0}},qj={textAlign:t=>t.x[0]<.5?"start":"end",position:t=>t.x[0]<.5?"right":"left",fontSize:10},Kj=t=>{const{data:e,encode:n={},scale:r,style:i={},layout:a={},nodeLabels:s=[],linkLabels:c=[],animate:l={},tooltip:u={}}=t,{links:f,nodes:d}=_k(e,n),h=cf(n,"node"),p=cf(n,"link"),{key:g=(t=>t.key),color:m=g}=h,{links:v,nodes:y}=Hj(Object.assign(Object.assign(Object.assign({},Xj),{nodeId:vk(g)}),a))({links:f,nodes:d}),_=cf(i,"label"),{text:b=g,spacing:E=5}=_,x=o(_,["text","spacing"]),M=vk(g),S=CS(u,"node",{title:M,items:[{field:"value"}]},!0),A=CS(u,"link",{title:"",items:[t=>({name:"source",value:M(t.source)}),t=>({name:"target",value:M(t.target)})]});return[We({},Yj,{data:y,encode:Object.assign(Object.assign({},h),{color:m}),scale:r,style:cf(i,"node"),labels:[Object.assign(Object.assign(Object.assign({},qj),{text:b,dx:t=>t.x[0]<.5?E:-E}),x),...s],tooltip:S,animate:IS(l,"node"),axis:!1}),We({},$j,{data:v,encode:p,labels:c,style:Object.assign({fill:p.color?void 0:"#aaa",strokeWidth:0},cf(i,"link")),tooltip:A,animate:IS(l,"link")})]};Kj.props={};const Zj={path:$k,hollow:qk},Qj=t=>(t,e,n,r)=>[t,t.map((()=>[[0,0]]))];function Jj(t,e,n){const{value:r}=n,i=function(t,e){const n={treemapBinary:CN,treemapDice:uN,treemapSlice:TN,treemapSliceDice:wN,treemapSquarify:PN,treemapResquarify:NN},r="treemapSquarify"===t?n[t].ratio(e):n[t];if(!r)throw new TypeError("Invalid tile method!");return r}(e.tile,e.ratio),o=function(t,e){return Array.isArray(t)?"function"==typeof e?mN().path(e)(t):mN()(t):Iw(t)}(t,e.path);return r?o.sum((t=>e.ignoreParentValue&&t.children?0:vk(r)(t))).sort(e.sort):o.count(),function(){var t=PN,e=!1,n=1,r=1,i=[0],o=Gw,a=Gw,s=Gw,c=Gw,l=Gw;function u(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(lN),t}function f(e){var n=i[e.depth],r=e.x0+n,u=e.y0+n,f=e.x1-n,d=e.y1-n;f<r&&(r=f=(r+f)/2),d<u&&(u=d=(u+d)/2),e.x0=r,e.y0=u,e.x1=f,e.y1=d,e.children&&(n=i[e.depth+1]=o(e)/2,r+=l(e)-n,u+=a(e)-n,(f-=s(e)-n)<r&&(r=f=(r+f)/2),(d-=c(e)-n)<u&&(u=d=(u+d)/2),t(e,r,u,f,d))}return u.round=function(t){return arguments.length?(e=!!t,u):e},u.size=function(t){return arguments.length?(n=+t[0],r=+t[1],u):[n,r]},u.tile=function(e){return arguments.length?(t=jw(e),u):t},u.padding=function(t){return arguments.length?u.paddingInner(t).paddingOuter(t):u.paddingInner()},u.paddingInner=function(t){return arguments.length?(o="function"==typeof t?t:Ww(+t),u):o},u.paddingOuter=function(t){return arguments.length?u.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):u.paddingTop()},u.paddingTop=function(t){return arguments.length?(a="function"==typeof t?t:Ww(+t),u):a},u.paddingRight=function(t){return arguments.length?(s="function"==typeof t?t:Ww(+t),u):s},u.paddingBottom=function(t){return arguments.length?(c="function"==typeof t?t:Ww(+t),u):c},u.paddingLeft=function(t){return arguments.length?(l="function"==typeof t?t:Ww(+t),u):l},u}().tile(i).size(e.size).round(e.round).paddingInner(e.paddingInner).paddingOuter(e.paddingOuter).paddingTop(e.paddingTop).paddingRight(e.paddingRight).paddingBottom(e.paddingBottom).paddingLeft(e.paddingLeft)(o),o.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)}Qj.props={defaultShape:"path",defaultLabelShape:"label",shape:Zj,composite:!1,channels:[...sk({shapes:Object.keys(Zj)}),{name:"d",scale:"identity"}],preInference:[...dk()],postInference:[]};const tG={fontSize:10,text:t=>t.data.name,position:"inside",fill:"#000",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>t.x1-t.x0},eG={title:t=>t.data.name,items:[{field:"value"}]},nG=(t,e)=>{const{width:n,height:r}=e,{data:i,encode:a={},scale:s,style:c={},layout:l={},labels:u=[],tooltip:f={}}=t,d=o(t,["data","encode","scale","style","layout","labels","tooltip"]),h=Jj(i,We({},((t,e)=>({tile:"treemapSquarify",ratio:.5*(1+Math.sqrt(5)),size:[t,e],round:!1,ignoreParentValue:!0,padding:0,paddingInner:0,paddingOuter:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,sort:(t,e)=>e.value-t.value,layer:0}))(n,r),l),a),p=cf(c,"label");return We({},((t,e)=>({type:"rect",axis:!1,encode:{x:"x",y:"y",color:t=>t.data.parent.name},scale:{x:{domain:[0,t],range:[0,1]},y:{domain:[0,e],range:[0,1]}},style:{stroke:"#fff"}}))(n,r),Object.assign(Object.assign({data:h,encode:a,scale:s,style:c,labels:[Object.assign(Object.assign({},tG),p),...u]},d),{tooltip:wS(f,eG),axis:!1}))};nG.props={};const rG={text:"",position:"inside",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>2*t.r},iG={title:t=>t.data.name,items:[{field:"value"}]},oG=(t,e)=>{const{width:n,height:r}=e,{data:i,encode:a={},scale:s={},style:c={},layout:l={},labels:u=[],tooltip:f={}}=t,d=o(t,["data","encode","scale","style","layout","labels","tooltip"]),h=((t,e,n)=>({type:"point",axis:!1,legend:!1,scale:{x:{domain:[0,t]},y:{domain:[0,e]},size:{type:"identity"}},encode:{x:"x",y:"y",size:"r",shape:"point"},style:{fill:n.color?void 0:t=>0===t.height?"#ddd":"#fff",stroke:n.color?void 0:t=>0===t.height?"":"#000"}}))(n,r,a),p=((t,e,n)=>{const{value:r}=n,i=me(t)?mN().path(e.path)(t):Iw(t);return r?i.sum((t=>vk(r)(t))).sort(e.sort):i.count(),oN().size(e.size).padding(e.padding)(i),i.descendants()})(i,We({},((t,e)=>({size:[t,e],padding:0,sort:(t,e)=>e.value-t.value}))(n,r),l),We({},h.encode,a)),g=cf(c,"label");return We({},h,Object.assign(Object.assign({data:p,encode:a,scale:s,style:c,labels:[Object.assign(Object.assign({},rG),g),...u]},d),{tooltip:wS(f,iG),axis:!1}))};function aG(t,e){return Wu(t,(t=>e[t]))}function sG(t,e){return ju(t,(t=>e[t]))}function cG(t,e){const n=2.5*lG(t,e)-1.5*fG(t,e);return Wu(t,(t=>e[t]>=n?e[t]:NaN))}function lG(t,e){return Xu(t,.25,(t=>e[t]))}function uG(t,e){return Xu(t,.5,(t=>e[t]))}function fG(t,e){return Xu(t,.75,(t=>e[t]))}function dG(t,e){const n=2.5*fG(t,e)-1.5*lG(t,e);return ju(t,(t=>e[t]<=n?e[t]:NaN))}function hG(){return(t,e)=>{const{encode:n}=e,{y:r,x:i}=n,{value:o}=r,{value:a}=i,s=Array.from(Mu(t,(t=>a[+t])).values()).flatMap((t=>{const e=cG(t,o),n=dG(t,o);return t.filter((t=>o[t]<e||o[t]>n))}));return[s,e]}}oG.props={};const pG=t=>{const{data:e,encode:n,style:r={},tooltip:i={},transform:a,animate:s}=t,c=o(t,["data","encode","style","tooltip","transform","animate"]),{point:l=!0}=r,u=o(r,["point"]),{y:f}=n,d={y:f,y1:f,y2:f,y3:f,y4:f},h={y1:lG,y2:uG,y3:fG},p=CS(i,"box",{items:[{channel:"y",name:"min"},{channel:"y1",name:"q1"},{channel:"y2",name:"q2"},{channel:"y3",name:"q3"},{channel:"y4",name:"max"}]},!0),g=CS(i,"point",{title:{channel:"x"},items:[{name:"outlier",channel:"y"}]});if(!l)return Object.assign({type:"box",data:e,transform:[Object.assign(Object.assign({type:"groupX",y:aG},h),{y4:sG})],encode:Object.assign(Object.assign({},n),d),style:u,tooltip:p},c);const m=cf(u,"box"),v=cf(u,"point");return[Object.assign({type:"box",data:e,transform:[Object.assign(Object.assign({type:"groupX",y:cG},h),{y4:dG})],encode:Object.assign(Object.assign({},n),d),style:m,tooltip:p,animate:IS(s,"box")},c),{type:"point",data:e,transform:[{type:hG}],encode:n,style:Object.assign({},v),tooltip:g,animate:IS(s,"point")}]};pG.props={};const gG={shape:nL},mG=t=>{const{cartesian:e}=t;return e?mk:(e,n,r,i)=>{const{x:o,y:a}=r,s=pk(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};function vG(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,s,c,l,u,f,d,h=t._root,p={data:r},g=t._x0,m=t._y0,v=t._x1,y=t._y1;if(!h)return t._root=p,t;for(;h.length;)if((l=e>=(o=(g+v)/2))?g=o:v=o,(u=n>=(a=(m+y)/2))?m=a:y=a,i=h,!(h=h[f=u<<1|l]))return i[f]=p,t;if(s=+t._x.call(null,h.data),c=+t._y.call(null,h.data),e===s&&n===c)return p.next=h,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(l=e>=(o=(g+v)/2))?g=o:v=o,(u=n>=(a=(m+y)/2))?m=a:y=a}while((f=u<<1|l)==(d=(c>=a)<<1|s>=o));return i[d]=h,i[f]=p,t}function yG(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function _G(t){return t[0]}function bG(t){return t[1]}function EG(t,e,n){var r=new xG(null==e?_G:e,null==n?bG:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function xG(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function MG(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}mG.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,shape:gG,channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...dk(),{type:hI},{type:fI},{type:dI}]};var SG=EG.prototype=xG.prototype;function AG(t){return function(){return t}}function TG(t){return 1e-6*(t()-.5)}function OG(t){return t.index}function RG(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}SG.copy=function(){var t,e,n=new xG(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=MG(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=MG(e));return n},SG.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return vG(this.cover(e,n),e,n,t)},SG.addAll=function(t){var e,n,r,i,o=t.length,a=new Array(o),s=new Array(o),c=1/0,l=1/0,u=-1/0,f=-1/0;for(n=0;n<o;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(a[n]=r,s[n]=i,r<c&&(c=r),r>u&&(u=r),i<l&&(l=i),i>f&&(f=i));if(c>u||l>f)return this;for(this.cover(c,l).cover(u,f),n=0;n<o;++n)vG(this,a[n],s[n],t[n]);return this},SG.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a,s,c=i-n||1,l=this._root;n>t||t>=i||r>e||e>=o;)switch(s=(e<r)<<1|t<n,(a=new Array(4))[s]=l,l=a,c*=2,s){case 0:i=n+c,o=r+c;break;case 1:n=i-c,o=r+c;break;case 2:i=n+c,r=o-c;break;case 3:n=i-c,r=o-c}this._root&&this._root.length&&(this._root=l)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},SG.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},SG.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]]},SG.find=function(t,e,n){var r,i,o,a,s,c,l,u=this._x0,f=this._y0,d=this._x1,h=this._y1,p=[],g=this._root;for(g&&p.push(new yG(g,u,f,d,h)),null==n?n=1/0:(u=t-n,f=e-n,d=t+n,h=e+n,n*=n);c=p.pop();)if(!(!(g=c.node)||(i=c.x0)>d||(o=c.y0)>h||(a=c.x1)<u||(s=c.y1)<f))if(g.length){var m=(i+a)/2,v=(o+s)/2;p.push(new yG(g[3],m,v,a,s),new yG(g[2],i,v,m,s),new yG(g[1],m,o,a,v),new yG(g[0],i,o,m,v)),(l=(e>=v)<<1|t>=m)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=c)}else{var y=t-+this._x.call(null,g.data),_=e-+this._y.call(null,g.data),b=y*y+_*_;if(b<n){var E=Math.sqrt(n=b);u=t-E,f=e-E,d=t+E,h=e+E,r=g.data}}return r},SG.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,i,o,a,s,c,l,u,f,d,h=this._root,p=this._x0,g=this._y0,m=this._x1,v=this._y1;if(!h)return this;if(h.length)for(;;){if((l=o>=(s=(p+m)/2))?p=s:m=s,(u=a>=(c=(g+v)/2))?g=c:v=c,e=h,!(h=h[f=u<<1|l]))return this;if(!h.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,d=f)}for(;h.data!==t;)if(r=h,!(h=h.next))return this;return(i=h.next)&&delete h.next,r?(i?r.next=i:delete r.next,this):e?(i?e[f]=i:delete e[f],(h=e[0]||e[1]||e[2]||e[3])&&h===(e[3]||e[2]||e[1]||e[0])&&!h.length&&(n?n[d]=h:this._root=h),this):(this._root=i,this)},SG.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},SG.root=function(){return this._root},SG.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},SG.visit=function(t){var e,n,r,i,o,a,s=[],c=this._root;for(c&&s.push(new yG(c,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(c=e.node,r=e.x0,i=e.y0,o=e.x1,a=e.y1)&&c.length){var l=(r+o)/2,u=(i+a)/2;(n=c[3])&&s.push(new yG(n,l,u,o,a)),(n=c[2])&&s.push(new yG(n,r,u,l,a)),(n=c[1])&&s.push(new yG(n,l,i,o,u)),(n=c[0])&&s.push(new yG(n,r,i,l,u))}return this},SG.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new yG(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,s=e.y0,c=e.x1,l=e.y1,u=(a+c)/2,f=(s+l)/2;(o=i[0])&&n.push(new yG(o,a,s,u,f)),(o=i[1])&&n.push(new yG(o,u,s,c,f)),(o=i[2])&&n.push(new yG(o,a,f,u,l)),(o=i[3])&&n.push(new yG(o,u,f,c,l))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},SG.x=function(t){return arguments.length?(this._x=t,this):this._x},SG.y=function(t){return arguments.length?(this._y=t,this):this._y};var PG={value:()=>{}};function CG(){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 wG(r)}function wG(t){this._=t}function NG(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function IG(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=PG,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}wG.prototype=CG.prototype={constructor:wG,on:function(t,e){var n,r,i=this._,o=(r=i,(t+"").trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<s;)if(n=(t=o[a]).type)i[n]=IG(i[n],t.name,e);else if(null==e)for(n in i)i[n]=IG(i[n],t.name,null);return this}for(;++a<s;)if((n=(t=o[a]).type)&&(n=NG(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new wG(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};var kG,LG,DG=0,BG=0,FG=0,UG=1e3,jG=0,GG=0,WG=0,zG="object"==typeof performance&&performance.now?performance:Date,VG="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function HG(){return GG||(VG(XG),GG=zG.now()+WG)}function XG(){GG=0}function YG(){this._call=this._time=this._next=null}function $G(t,e,n){var r=new YG;return r.restart(t,e,n),r}function qG(){GG=(jG=zG.now())+WG,DG=BG=0;try{!function(){HG(),++DG;for(var t,e=kG;e;)(t=GG-e._time)>=0&&e._call.call(void 0,t),e=e._next;--DG}()}finally{DG=0,function(){var t,e,n=kG,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:kG=e);LG=t,ZG(r)}(),GG=0}}function KG(){var t=zG.now(),e=t-jG;e>UG&&(WG-=e,jG=t)}function ZG(t){DG||(BG&&(BG=clearTimeout(BG)),t-GG>24?(t<1/0&&(BG=setTimeout(qG,t-zG.now()-WG)),FG&&(FG=clearInterval(FG))):(FG||(jG=zG.now(),FG=setInterval(KG,UG)),DG=1,VG(qG)))}YG.prototype=$G.prototype={constructor:YG,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?HG():+n)+(null==e?0:+e),this._next||LG===this||(LG?LG._next=this:kG=this,LG=this),this._call=t,this._time=n,ZG()},stop:function(){this._call&&(this._call=null,this._time=1/0,ZG())}};const QG=1664525,JG=1013904223,tW=4294967296;function eW(t){return t.x}function nW(t){return t.y}var rW=10,iW=Math.PI*(3-Math.sqrt(5));function oW(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,c=$G(f),l=CG("tick","end"),u=function(){let t=1;return()=>(t=(QG*t+JG)%tW)/tW}();function f(){d(),l.call("tick",e),n<r&&(c.stop(),l.call("end",e))}function d(r){var c,l,u=t.length;void 0===r&&(r=1);for(var f=0;f<r;++f)for(n+=(o-n)*i,s.forEach((function(t){t(n)})),c=0;c<u;++c)null==(l=t[c]).fx?l.x+=l.vx*=a:(l.x=l.fx,l.vx=0),null==l.fy?l.y+=l.vy*=a:(l.y=l.fy,l.vy=0);return e}function h(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=rW*Math.sqrt(.5+n),o=n*iW;e.x=i*Math.cos(o),e.y=i*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function p(e){return e.initialize&&e.initialize(t,u),e}return null==t&&(t=[]),h(),e={tick:d,restart:function(){return c.restart(f),e},stop:function(){return c.stop(),e},nodes:function(n){return arguments.length?(t=n,h(),s.forEach(p),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(o=+t,e):o},velocityDecay:function(t){return arguments.length?(a=1-t,e):1-a},randomSource:function(t){return arguments.length?(u=t,s.forEach(p),e):u},force:function(t,n){return arguments.length>1?(null==n?s.delete(t):s.set(t,p(n)),e):s.get(t)},find:function(e,n,r){var i,o,a,s,c,l=0,u=t.length;for(null==r?r=1/0:r*=r,l=0;l<u;++l)(a=(i=e-(s=t[l]).x)*i+(o=n-s.y)*o)<r&&(c=s,r=a);return c},on:function(t,n){return arguments.length>1?(l.on(t,n),e):l.on(t)}}}const aW={joint:!0},sW={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}},cW={type:"point",axis:!1,legend:!1,encode:{x:"x",y:"y",size:5,color:"group",shape:"point"},style:{stroke:"#fff"}},lW={text:""};function uW(t,e,n){const{nodes:r,links:i}=t,{joint:o,nodeStrength:a,linkStrength:s}=e,{nodeKey:c=(t=>t.id),linkKey:l=(t=>t.id)}=n,u=function(){var t,e,n,r,i,o=AG(-30),a=1,s=1/0,c=.81;function l(n){var i,o=t.length,a=EG(t,eW,nW).visitAfter(f);for(r=n,i=0;i<o;++i)e=t[i],a.visit(d)}function u(){if(t){var e,n,r=t.length;for(i=new Array(r),e=0;e<r;++e)n=t[e],i[n.index]=+o(n,e,t)}}function f(t){var e,n,r,o,a,s=0,c=0;if(t.length){for(r=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(s+=e.value,c+=n,r+=n*e.x,o+=n*e.y);t.x=r/c,t.y=o/c}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=i[e.data.index]}while(e=e.next)}t.value=s}function d(t,o,l,u){if(!t.value)return!0;var f=t.x-e.x,d=t.y-e.y,h=u-o,p=f*f+d*d;if(h*h/c<p)return p<s&&(0===f&&(p+=(f=TG(n))*f),0===d&&(p+=(d=TG(n))*d),p<a&&(p=Math.sqrt(a*p)),e.vx+=f*t.value*r/p,e.vy+=d*t.value*r/p),!0;if(!(t.length||p>=s)){(t.data!==e||t.next)&&(0===f&&(p+=(f=TG(n))*f),0===d&&(p+=(d=TG(n))*d),p<a&&(p=Math.sqrt(a*p)));do{t.data!==e&&(h=i[t.data.index]*r/p,e.vx+=f*h,e.vy+=d*h)}while(t=t.next)}}return l.initialize=function(e,r){t=e,n=r,u()},l.strength=function(t){return arguments.length?(o="function"==typeof t?t:AG(+t),u(),l):o},l.distanceMin=function(t){return arguments.length?(a=t*t,l):Math.sqrt(a)},l.distanceMax=function(t){return arguments.length?(s=t*t,l):Math.sqrt(s)},l.theta=function(t){return arguments.length?(c=t*t,l):Math.sqrt(c)},l}(),f=function(t){var e,n,r,i,o,a,s=OG,c=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},l=AG(30),u=1;function f(r){for(var i=0,s=t.length;i<u;++i)for(var c,l,f,d,h,p,g,m=0;m<s;++m)l=(c=t[m]).source,d=(f=c.target).x+f.vx-l.x-l.vx||TG(a),h=f.y+f.vy-l.y-l.vy||TG(a),d*=p=((p=Math.sqrt(d*d+h*h))-n[m])/p*r*e[m],h*=p,f.vx-=d*(g=o[m]),f.vy-=h*g,l.vx+=d*(g=1-g),l.vy+=h*g}function d(){if(r){var a,c,l=r.length,u=t.length,f=new Map(r.map(((t,e)=>[s(t,e,r),t])));for(a=0,i=new Array(l);a<u;++a)(c=t[a]).index=a,"object"!=typeof c.source&&(c.source=RG(f,c.source)),"object"!=typeof c.target&&(c.target=RG(f,c.target)),i[c.source.index]=(i[c.source.index]||0)+1,i[c.target.index]=(i[c.target.index]||0)+1;for(a=0,o=new Array(u);a<u;++a)c=t[a],o[a]=i[c.source.index]/(i[c.source.index]+i[c.target.index]);e=new Array(u),h(),n=new Array(u),p()}}function h(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+c(t[n],n,t)}function p(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+l(t[e],e,t)}return null==t&&(t=[]),f.initialize=function(t,e){r=t,a=e,d()},f.links=function(e){return arguments.length?(t=e,d(),f):t},f.id=function(t){return arguments.length?(s=t,f):s},f.iterations=function(t){return arguments.length?(u=+t,f):u},f.strength=function(t){return arguments.length?(c="function"==typeof t?t:AG(+t),h(),f):c},f.distance=function(t){return arguments.length?(l="function"==typeof t?t:AG(+t),p(),f):l},f}(i).id(vk(l));"function"==typeof a&&u.strength(a),"function"==typeof s&&f.strength(s);const d=oW(r).force("link",f).force("charge",u);o?d.force("center",function(t,e){var n,r=1;function i(){var i,o,a=n.length,s=0,c=0;for(i=0;i<a;++i)s+=(o=n[i]).x,c+=o.y;for(s=(s/a-t)*r,c=(c/a-e)*r,i=0;i<a;++i)(o=n[i]).x-=s,o.y-=c}return null==t&&(t=0),null==e&&(e=0),i.initialize=function(t){n=t},i.x=function(e){return arguments.length?(t=+e,i):t},i.y=function(t){return arguments.length?(e=+t,i):e},i.strength=function(t){return arguments.length?(r=+t,i):r},i}()):d.force("x",function(t){var e,n,r,i=AG(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vx+=(r[o]-i.x)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=AG(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:AG(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"==typeof e?e:AG(+e),a(),o):t},o}()).force("y",function(t){var e,n,r,i=AG(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vy+=(r[o]-i.y)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=AG(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:AG(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"==typeof e?e:AG(+e),a(),o):t},o}()),d.stop();const h=Math.ceil(Math.log(d.alphaMin())/Math.log(1-d.alphaDecay()));for(let t=0;t<h;t++)d.tick();return{nodesData:r,linksData:i}}const fW=t=>{const{data:e,encode:n={},scale:r,style:i={},layout:a={},nodeLabels:s=[],linkLabels:c=[],animate:l={},tooltip:u={}}=t,{nodeKey:f=(t=>t.id),linkKey:d=(t=>t.id)}=n,h=o(n,["nodeKey","linkKey"]),p=Object.assign({nodeKey:f,linkKey:d},h),g=cf(p,"node"),m=cf(p,"link"),{links:v,nodes:y}=_k(e,p),{nodesData:_,linksData:b}=uW({links:v,nodes:y},We({},aW,a),p),E=CS(u,"link",{items:[t=>({name:"source",value:vk(d)(t.source)}),t=>({name:"target",value:vk(d)(t.target)})]}),x=CS(u,"node",{items:[t=>({name:"key",value:vk(f)(t)})]},!0);return[We({},sW,{data:b,encode:m,labels:c,style:cf(i,"link"),tooltip:E,animate:IS(l,"link")}),We({},cW,{data:_,encode:Object.assign({},g),scale:r,style:cf(i,"node"),tooltip:x,labels:[Object.assign(Object.assign({},lW),cf(i,"label")),...s],animate:IS(l,"link")})]};fW.props={};const dW=t=>e=>n=>{const{field:r="value",nodeSize:i,separation:o,sortBy:a,as:s=["x","y"]}=e,[c,l]=s,u=Iw(n,(t=>t.children)).sum((t=>t[r])).sort(a),f=t();f.size([1,1]),i&&f.nodeSize(i),o&&f.separation(o),f(u);const d=[];u.each((t=>{t[c]=t.x,t[l]=t.y,t.name=t.data.name,d.push(t)}));const h=u.links();return h.forEach((t=>{t[c]=[t.source[c],t.target[c]],t[l]=[t.source[l],t.target[l]]})),{nodes:d,edges:h}},hW=t=>dW(ww)(t);hW.props={};const pW=t=>dW(AN)(t);pW.props={};const gW={sortBy:(t,e)=>e.value-t.value},mW={axis:!1,legend:!1,type:"point",encode:{x:"x",y:"y",size:2,shape:"point"}},vW={type:"link",encode:{x:"x",y:"y",shape:"smooth"}},yW={text:"",fontSize:10},_W=t=>{const{data:e,encode:n={},scale:r={},style:i={},layout:o={},nodeLabels:a=[],linkLabels:s=[],animate:c={},tooltip:l={}}=t,u=null==n?void 0:n.value,{nodes:f,edges:d}=pW(Object.assign(Object.assign(Object.assign({},gW),o),{field:u}))(e),h=CS(l,"node",{title:"name",items:["value"]},!0),p=CS(l,"link",{title:"",items:[t=>({name:"source",value:t.source.name}),t=>({name:"target",value:t.target.name})]});return[We({},vW,{data:d,encode:cf(n,"link"),scale:cf(r,"link"),labels:s,style:Object.assign({stroke:"#999"},cf(i,"link")),tooltip:p,animate:IS(c,"link")}),We({},mW,{data:f,scale:cf(r,"node"),encode:cf(n,"node"),labels:[Object.assign(Object.assign({},yW),cf(i,"label")),...a],style:Object.assign({},cf(i,"node")),tooltip:h,animate:IS(c,"node")})]};_W.props={};var bW={},EW={};function xW(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function MW(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function SW(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function AW(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":function(t){return t<0?"-"+SW(-t,6):t>9999?"+"+SW(t,6):SW(t,4)}(t.getUTCFullYear())+"-"+SW(t.getUTCMonth()+1,2)+"-"+SW(t.getUTCDate(),2)+(i?"T"+SW(e,2)+":"+SW(n,2)+":"+SW(r,2)+"."+SW(i,3)+"Z":r?"T"+SW(e,2)+":"+SW(n,2)+":"+SW(r,2)+"Z":n||e?"T"+SW(e,2)+":"+SW(n,2)+"Z":"")}function TW(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],o=t.length,a=0,s=0,c=o<=0,l=!1;function u(){if(c)return EW;if(l)return l=!1,bW;var e,r,i=a;if(34===t.charCodeAt(i)){for(;a++<o&&34!==t.charCodeAt(a)||34===t.charCodeAt(++a););return(e=a)>=o?c=!0:10===(r=t.charCodeAt(a++))?l=!0:13===r&&(l=!0,10===t.charCodeAt(a)&&++a),t.slice(i+1,e-1).replace(/""/g,'"')}for(;a<o;){if(10===(r=t.charCodeAt(e=a++)))l=!0;else if(13===r)l=!0,10===t.charCodeAt(a)&&++a;else if(r!==n)continue;return t.slice(i,e)}return c=!0,t.slice(i,o)}for(10===t.charCodeAt(o-1)&&--o,13===t.charCodeAt(o-1)&&--o;(r=u())!==EW;){for(var f=[];r!==bW&&r!==EW;)f.push(r),r=u();e&&null==(f=e(f,s++))||i.push(f)}return i}function i(e,n){return e.map((function(e){return n.map((function(t){return a(e[t])})).join(t)}))}function o(e){return e.map(a).join(t)}function a(t){return null==t?"":t instanceof Date?AW(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,o=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=xW(t);return function(r,i){return e(n(r),i,t)}}(t,e):xW(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=MW(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=MW(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}function OW(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;RW&&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 RW=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),PW=t=>{const{value:e,format:n=e.split(".").pop(),delimiter:r=",",autoType:i=!0}=t;return()=>s(void 0,void 0,void 0,(function*(){const t=yield fetch(e);if("csv"===n){const e=yield t.text();return TW(r).parse(e,i?OW:tf)}if("json"===n)return yield t.json();throw new Error(`Unknown format: ${n}.`)}))};PW.props={};const CW=t=>{const{fields:e,key:n="key",value:r="value"}=t;return t=>{return(i=e)&&0!==Object.keys(i).length?t.flatMap((t=>e.map((e=>Object.assign(Object.assign({},t),{[n]:e,[r]:t[e]}))))):t;var i}};function wW(t){return null!=t&&!Number.isNaN(t)}CW.props={};const NW=t=>{const{callback:e=wW}=t;return t=>t.filter(e)};NW.props={};const IW=t=>{const{callback:e}=t;return t=>Array.isArray(t)?[...t].sort(e):t};IW.props={};const kW=t=>{const{fields:e}=t;return t=>t.map((t=>function(t,e=[]){return e.reduce(((e,n)=>(n in t&&(e[n]=t[n]),e)),{})}(t,e)))};kW.props={};const LW=t=>e=>{if(!t||(n=t,0===Object.keys(n).length))return e;var n;return e.map((e=>Object.entries(e).reduce(((e,[n,r])=>(e[t[n]||n]=r,e)),{})))};LW.props={};const DW=t=>{const{fields:e=[]}=t,n=(r=!0,e.map((t=>{if(Array.isArray(t)){const[e,n=r]=t;return[e,n]}return[t,r]})));var r;return t=>[...t].sort(((t,e)=>n.reduce(((n,[r,i=!0])=>0!==n?n:i?t[r]<e[r]?-1:+(t[r]!==e[r]):t[r]>e[r]?-1:+(t[r]!==e[r])),0)))};DW.props={};const BW=t=>{const{value:e}=t;return()=>e};BW.props={};const FW=t=>{const{callback:e=tf}=t;return t=>e(t)};FW.props={};const UW=t=>{const{callback:e=tf}=t;return t=>Array.isArray(t)?t.map(e):t};UW.props={};var jW=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 GW={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 WW(t){const{y:e,thickness:n,weight:r,marginRatio:i,id:o,source:a,target:s,sourceWeight:c,targetWeight:l,sortBy:u}=Object.assign(Object.assign({},GW),t);return function(t){const f=t.nodes.map((t=>Object.assign({},t))),d=t.edges.map((t=>Object.assign({},t)));return function(t,e){e.forEach((t=>{t.source=a(t),t.target=s(t),t.sourceWeight=c(t),t.targetWeight=l(t)}));const n=Mu(e,(t=>t.source)),r=Mu(e,(t=>t.target));t.forEach((t=>{t.id=o(t);const e=n.has(t.id)?n.get(t.id):[],i=r.has(t.id)?r.get(t.id):[];t.frequency=e.length+i.length,t.value=Ju(e,(t=>t.sourceWeight))+Ju(i,(t=>t.targetWeight))}))}(f,d),function(t,e){const n="function"==typeof u?u:jW[u];n&&t.sort(n)}(f),function(t,o){const a=t.length;if(!a)throw rf("Invalid nodes: it's empty!");if(!r){const n=1/a;return t.forEach(((t,r)=>{t.x=(r+.5)*n,t.y=e})),{nodes:t,edges:o}}const s=i/(2*a),c=t.reduce(((t,e)=>t+e.value),0);t.reduce(((t,r)=>{r.weight=r.value/c,r.width=r.weight*(1-i),r.height=n;const o=s+t,a=o+r.width,l=e-n/2,u=l+n;return r.x=[o,a,a,o],r.y=[l,l,u,u],t+r.width+2*s}),0)}(f,d),function(t,n){const i=new Map(t.map((t=>[t.id,t])));if(!r)return n.forEach((t=>{const e=a(t),n=s(t),r=i.get(e),o=i.get(n);r&&o&&(t.x=[r.x,o.x],t.y=[r.y,o.y])})),{nodes:t,edges:n};n.forEach((t=>{t.x=[0,0,0,0],t.y=[e,e,e,e]}));const o=Mu(n,(t=>t.source)),c=Mu(n,(t=>t.target));t.forEach((t=>{const{edges:e,width:n,x:r,y:i,value:a,id:s}=t,l=o.get(s)||[],u=c.get(s)||[];let f=0;l.map((e=>{const r=e.sourceWeight/a*n;e.x[0]=t.x[0]+f,e.x[1]=t.x[0]+f+r,f+=r})),u.forEach((e=>{const r=e.targetWeight/a*n;e.x[3]=t.x[0]+f,e.x[2]=t.x[0]+f+r,f+=r}))}))}(f,d),{nodes:f,edges:d}}}const zW=t=>e=>WW(t)(e);zW.props={};const VW=Math.PI/180,HW=64,XW=2048;function YW(t){return t.text}function $W(){return"serif"}function qW(){return"normal"}function KW(t){return t.value}function ZW(){return 90*~~(2*Math.random())}function QW(){return 1}function JW(){}function tz(t,e,n,r){if(e.sprite)return;const i=t.context,o=t.ratio;i.clearRect(0,0,(HW<<5)/o,XW/o);let a=0,s=0,c=0;const l=n.length;for(--r;++r<l;){e=n[r],i.save(),i.font=e.style+" "+e.weight+" "+~~((e.size+1)/o)+"px "+e.font;let t=i.measureText(e.text+"m").width*o,l=e.size<<1;if(e.rotate){const n=Math.sin(e.rotate*VW),r=Math.cos(e.rotate*VW),i=t*r,o=t*n,a=l*r,s=l*n;t=Math.max(Math.abs(i+s),Math.abs(i-s))+31>>5<<5,l=~~Math.max(Math.abs(o+a),Math.abs(o-a))}else t=t+31>>5<<5;if(l>c&&(c=l),a+t>=HW<<5&&(a=0,s+=c,c=0),s+l>=XW)break;i.translate((a+(t>>1))/o,(s+(l>>1))/o),e.rotate&&i.rotate(e.rotate*VW),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=t,e.height=l,e.xoff=a,e.yoff=s,e.x1=t>>1,e.y1=l>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,a+=t}const u=i.getImageData(0,0,(HW<<5)/o,XW/o).data,f=[];for(;--r>=0;){if(!(e=n[r]).hasText)continue;const t=e.width,i=t>>5;let o=e.y1-e.y0;for(let t=0;t<o*i;t++)f[t]=0;if(a=e.xoff,null==a)return;s=e.yoff;let c=0,l=-1;for(let n=0;n<o;n++){for(let e=0;e<t;e++){const t=i*n+(e>>5),r=u[(s+n)*(HW<<5)+(a+e)<<2]?1<<31-e%32:0;f[t]|=r,c|=r}c?l=n:(e.y0++,o--,n--,s++)}e.y1=e.y0+l,e.sprite=f.slice(0,(e.y1-e.y0)*i)}}function ez(t,e,n){n>>=5;const r=t.sprite,i=t.width>>5,o=t.x-(i<<4),a=127&o,s=32-a,c=t.y1-t.y0;let l,u=(t.y+t.y0)*n+(o>>5);for(let t=0;t<c;t++){l=0;for(let n=0;n<=i;n++)if((l<<s|(n<i?(l=r[t*i+n])>>>a:0))&e[u+n])return!0;u+=n}return!1}function nz(t,e){const n=t[0],r=t[1];e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}function rz(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}function iz(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function oz(t){const e=[];let n=-1;for(;++n<t;)e[n]=0;return e}function az(){return document.createElement("canvas")}function sz(t){return"function"==typeof t?t:function(){return t}}const cz={archimedean:iz,rectangular:function(t){const e=4*t[0]/t[1];let n=0,r=0;return function(t){const i=t<0?-1:1;switch(Math.sqrt(1+4*i*t)-i&3){case 0:n+=e;break;case 1:r+=4;break;case 2:n-=e;break;default:r-=4}return[n,r]}}};function lz(){let t=[256,256],e=YW,n=$W,r=KW,i=qW,o=ZW,a=QW,s=iz,c=Math.random,l=JW,u=[],f=null,d=1/0;const h=qW,p=az,g={};function m(e,n,r){const i=n.x,o=n.y,a=Math.sqrt(t[0]*t[0]+t[1]*t[1]),l=s(t),u=c()<.5?1:-1;let f,d,h,p=-u;for(;(f=l(p+=u))&&(d=~~f[0],h=~~f[1],!(Math.min(Math.abs(d),Math.abs(h))>=a));)if(n.x=i+d,n.y=o+h,!(n.x+n.x0<0||n.y+n.y0<0||n.x+n.x1>t[0]||n.y+n.y1>t[1])&&(!r||!ez(n,e,t[0]))&&(!r||rz(n,r))){const r=n.sprite,i=n.width>>5,o=t[0]>>5,a=n.x-(i<<4),s=127&a,c=32-s,l=n.y1-n.y0;let u,f=(n.y+n.y0)*o+(a>>5);for(let t=0;t<l;t++){u=0;for(let n=0;n<=i;n++)e[f+n]|=u<<c|(n<i?(u=r[t*i+n])>>>s:0);f+=o}return delete n.sprite,!0}return!1}return g.start=function(){const[s,v]=t,y=function(t){t.width=t.height=1;const e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=(HW<<5)/e,t.height=XW/e;const n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:e}}(p()),_=g.board?g.board:oz((t[0]>>5)*t[1]),b=u.length,E=[],x=u.map((function(t,s,c){return t.text=e.call(this,t,s,c),t.font=n.call(this,t,s,c),t.style=h.call(this,t,s,c),t.weight=i.call(this,t,s,c),t.rotate=o.call(this,t,s,c),t.size=~~r.call(this,t,s,c),t.padding=a.call(this,t,s,c),t})).sort((function(t,e){return e.size-t.size}));let M=-1,S=g.board?[{x:0,y:0},{x:s,y:v}]:void 0;function A(){const e=Date.now();for(;Date.now()-e<d&&++M<b;){const e=x[M];e.x=s*(c()+.5)>>1,e.y=v*(c()+.5)>>1,tz(y,e,x,M),e.hasText&&m(_,e,S)&&(l.call(null,"word",{cloud:g,word:e}),E.push(e),S?g.hasImage||nz(S,e):S=[{x:e.x+e.x0,y:e.y+e.y0},{x:e.x+e.x1,y:e.y+e.y1}],e.x-=t[0]>>1,e.y-=t[1]>>1)}g._tags=E,g._bounds=S,M>=b&&(g.stop(),l.call(null,"end",{cloud:g,words:E,bounds:S}))}return f&&clearInterval(f),f=setInterval(A,0),A(),g},g.stop=function(){return f&&(clearInterval(f),f=null),g},g.createMask=e=>{const n=document.createElement("canvas"),[r,i]=t;if(!r||!i)return;const o=r>>5,a=oz((r>>5)*i);n.width=r,n.height=i;const s=n.getContext("2d");s.drawImage(e,0,0,e.width,e.height,0,0,r,i);const c=s.getImageData(0,0,r,i).data;for(let t=0;t<i;t++)for(let e=0;e<r;e++){const n=o*t+(e>>5),i=t*r+e<<2,s=c[i]>=250&&c[i+1]>=250&&c[i+2]>=250?1<<31-e%32:0;a[n]|=s}g.board=a,g.hasImage=!0},g.timeInterval=function(t){d=null==t?1/0:t},g.words=function(t){u=t},g.size=function(e=[]){t=[+e[0],+e[1]]},g.text=function(t){e=sz(t)},g.font=function(t){n=sz(t)},g.fontWeight=function(t){i=sz(t)},g.rotate=function(t){o=sz(t)},g.spiral=function(t){s=cz[t]||t},g.fontSize=function(t){r=sz(t)},g.padding=function(t){a=sz(t)},g.random=function(t){c=sz(t)},g.on=function(t){l=sz(t)},g}const uz={size:[500,500],fontSize:[14,28]};function fz(t){return new Promise(((e,n)=>{if(t instanceof HTMLImageElement)e(t);else{if("string"==typeof t){const r=new Image;return r.crossOrigin="anonymous",r.src=t,r.onload=()=>e(r),void(r.onerror=()=>{console.error(`'image ${t} load failed !!!'`),n()})}n()}}))}const dz=t=>e=>s(void 0,void 0,void 0,(function*(){const n=Object.assign({},uz,t),r=lz();var i,a;yield(i=r,a=n,{set(t,e,n){if(void 0===a[t])return this;const r=e?e.call(null,a[t]):a[t];return n?n.call(null,r):"function"==typeof i[t]?i[t](r):i[t]=r,this},setAsync(t,e,n){return s(this,void 0,void 0,(function*(){if(void 0===a[t])return this;const r=e?yield e.call(null,a[t]):a[t];return n?n.call(null,r):"function"==typeof i[t]?i[t](r):i[t]=r,this}))}}).set("fontSize",(t=>{const n=e.map((t=>t.value));return function(t,e){if("function"==typeof t)return t;if(Array.isArray(t)){const[n,r]=t;if(!e)return()=>(r+n)/2;const[i,o]=e;return o===i?()=>(r+n)/2:({value:t})=>(r-n)/(o-i)*(t-i)+n}return()=>t}(t,[Wu(n),ju(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",fz,r.createMask),r.words([...e]);const c=r.start(),[l,u]=n.size,f=[{x:0,y:0},{x:l,y:u}],{_bounds:d=f,_tags:h,hasImage:p}=c,g=h.map((t=>{var{x:e,y:n}=t,r=o(t,["x","y"]);return Object.assign(Object.assign({},r),{x:e+l/2,y:n+u/2})})),[{x:m,y:v},{x:y,y:_}]=d,b={text:"",value:0,opacity:0,fontSize:0};return g.push(Object.assign(Object.assign({},b),{x:p?0:m,y:p?0:v}),Object.assign(Object.assign({},b),{x:p?l:y,y:p?u:_})),g}));function hz(t){return"string"==typeof t?e=>e[t]:t}dz.props={};const pz=t=>{const{join:e,on:n,select:r=[],as:i=r,unknown:o=NaN}=t,[a,s]=n,c=hz(s),l=hz(a),u=Au(e,(([t])=>t),(t=>c(t)));return t=>t.map((t=>{const e=u.get(l(t));return Object.assign(Object.assign({},t),r.reduce(((t,n,r)=>(t[i[r]]=e?e[n]:o,t)),{}))}))};pz.props={};const gz=t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)};gz.props={};var mz={exports:{}},vz={exports:{}};!function(t){var e=t.exports;t.exports.isNumber=function(t){return"number"==typeof t},t.exports.findMin=function(t){if(0===t.length)return 1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.min(e,t[n]);return e},t.exports.findMax=function(t){if(0===t.length)return-1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.max(e,t[n]);return e},t.exports.findMinMulti=function(t){for(var n=e.findMin(t[0]),r=1;r<t.length;r++)n=Math.min(n,e.findMin(t[r]));return n},t.exports.findMaxMulti=function(t){for(var n=e.findMax(t[0]),r=1;r<t.length;r++)n=Math.max(n,e.findMax(t[r]));return n},t.exports.inside=function(t,e,n){return t<=n&&n<=e}}(vz),function(t){var e=Math.log(2),n=t.exports,r=vz.exports;function i(t){return 1-Math.abs(t)}t.exports.getUnifiedMinMax=function(t,e){return n.getUnifiedMinMaxMulti([t],e)},t.exports.getUnifiedMinMaxMulti=function(t,e){e=e||{};var n=!1,i=!1,o=r.isNumber(e.width)?e.width:2,a=r.isNumber(e.size)?e.size:50,s=r.isNumber(e.min)?e.min:(n=!0,r.findMinMulti(t)),c=r.isNumber(e.max)?e.max:(i=!0,r.findMaxMulti(t)),l=(c-s)/(a-1);return n&&(s-=2*o*l),i&&(c+=2*o*l),{min:s,max:c}},t.exports.create=function(t,e){if(e=e||{},!t||0===t.length)return[];var o=r.isNumber(e.size)?e.size:50,a=r.isNumber(e.width)?e.width:2,s=n.getUnifiedMinMax(t,{size:o,width:a,min:e.min,max:e.max}),c=s.min,l=s.max-c,u=l/(o-1);if(0===l)return[{x:c,y:1}];for(var f=[],d=0;d<o;d++)f.push({x:c+d*u,y:0});var h=function(t,e){for(var n={},r=0,i=-e;i<=e;i++)r+=t(i/e),n[i]=r;return n}(i,a),p=h[a],g=h[a-1]-h[a-2],m=0;t.forEach((function(t){var e=function(t){return Math.floor((t-c)/u)}(t);if(!(e+a<0||e-a>=f.length)){var n=Math.max(e-a,0),i=e,o=Math.min(e+a,f.length-1),s=n-(e-a),l=e+a-o,d=h[-a-1+s]||0,v=h[-a-1+l]||0,y=p/(p-d-v);s>0&&(m+=y*(s-1)*g);var _=Math.max(0,e-a+1);r.inside(0,f.length-1,_)&&(f[_].y+=1*y*g),r.inside(0,f.length-1,i+1)&&(f[i+1].y-=2*y*g),r.inside(0,f.length-1,o+1)&&(f[o+1].y+=1*y*g)}}));var v=m,y=0,_=0;return f.forEach((function(t){y+=t.y,v+=y,t.y=v,_+=v})),_>0&&f.forEach((function(t){t.y/=_})),f},t.exports.getExpectedValueFromPdf=function(t){if(t&&0!==t.length){var e=0;return t.forEach((function(t){e+=t.x*t.y})),e}},t.exports.getXWithLeftTailArea=function(t,e){if(t&&0!==t.length){for(var n=0,r=0,i=0;i<t.length&&(r=i,!((n+=t[i].y)>=e));i++);return t[r].x}},t.exports.getPerplexity=function(t){if(t&&0!==t.length){var n=0;return t.forEach((function(t){var e=Math.log(t.y);isFinite(e)&&(n+=t.y*e)})),n=-n/e,Math.pow(2,n)}}}(mz);var yz=mz.exports;const _z=t=>{const{field:e,groupBy:n,as:r=["y","size"],min:i,max:o,size:a=10,width:s}=t,[c,l]=r;return t=>{const r=Array.from(Mu(t,(t=>n.map((e=>t[e])).join("-"))).values());return r.map((t=>{const n=yz.create(t.map((t=>t[e])),{min:i,max:o,size:a,width:s}),r=n.map((t=>t.x)),u=n.map((t=>t.y));return Object.assign(Object.assign({},t[0]),{[c]:r,[l]:u})}))}};_z.props={};var bz={exports:{}};!function(t,e){!function(t){function e(t,e,n,r){var i=(r=r||{}).maxIterations||100,o=r.tolerance||1e-10,a=t(e),s=t(n),c=n-e;if(a*s>0)throw"Initial bisect points must have opposite signs";if(0===a)return e;if(0===s)return n;for(var l=0;l<i;++l){var u=e+(c/=2),f=t(u);if(f*a>=0&&(e=u),Math.abs(c)<o||0===f)return u}return e+c}function n(t){for(var e=new Array(t),n=0;n<t;++n)e[n]=0;return e}function r(t,e){return n(t).map((function(){return n(e)}))}function i(t,e){for(var n=0,r=0;r<t.length;++r)n+=t[r]*e[r];return n}function o(t){return Math.sqrt(i(t,t))}function a(t,e,n){for(var r=0;r<e.length;++r)t[r]=e[r]*n}function s(t,e,n,r,i){for(var o=0;o<t.length;++o)t[o]=e*n[o]+r*i[o]}function c(t,e,n){var r,i=(n=n||{}).maxIterations||200*e.length,o=n.nonZeroDelta||1.05,a=n.zeroDelta||.001,c=n.minErrorDelta||1e-6,l=n.minErrorDelta||1e-5,u=void 0!==n.rho?n.rho:1,f=void 0!==n.chi?n.chi:2,d=void 0!==n.psi?n.psi:-.5,h=void 0!==n.sigma?n.sigma:.5,p=e.length,g=new Array(p+1);g[0]=e,g[0].fx=t(e),g[0].id=0;for(var m=0;m<p;++m){var v=e.slice();v[m]=v[m]?v[m]*o:a,g[m+1]=v,g[m+1].fx=t(v),g[m+1].id=m+1}function y(t){for(var e=0;e<t.length;e++)g[p][e]=t[e];g[p].fx=t.fx}for(var _=function(t,e){return t.fx-e.fx},b=e.slice(),E=e.slice(),x=e.slice(),M=e.slice(),S=0;S<i;++S){if(g.sort(_),n.history){var A=g.map((function(t){var e=t.slice();return e.fx=t.fx,e.id=t.id,e}));A.sort((function(t,e){return t.id-e.id})),n.history.push({x:g[0].slice(),fx:g[0].fx,simplex:A})}for(r=0,m=0;m<p;++m)r=Math.max(r,Math.abs(g[0][m]-g[1][m]));if(Math.abs(g[0].fx-g[p].fx)<c&&r<l)break;for(m=0;m<p;++m){b[m]=0;for(var T=0;T<p;++T)b[m]+=g[T][m];b[m]/=p}var O=g[p];if(s(E,1+u,b,-u,O),E.fx=t(E),E.fx<g[0].fx)s(M,1+f,b,-f,O),M.fx=t(M),M.fx<E.fx?y(M):y(E);else if(E.fx>=g[p-1].fx){var R=!1;if(E.fx>O.fx?(s(x,1+d,b,-d,O),x.fx=t(x),x.fx<O.fx?y(x):R=!0):(s(x,1-d*u,b,d*u,O),x.fx=t(x),x.fx<E.fx?y(x):R=!0),R){if(h>=1)break;for(m=1;m<g.length;++m)s(g[m],1-h,g[0],h,g[m]),g[m].fx=t(g[m])}}else y(E)}return g.sort(_),{fx:g[0].fx,x:g[0]}}function l(t,e,n,r,o,a,c){var l=n.fx,u=i(n.fxprime,e),f=l,d=l,h=u,p=0;function g(d,p,g){for(var m=0;m<16;++m)if(o=(d+p)/2,s(r.x,1,n.x,o,e),f=r.fx=t(r.x,r.fxprime),h=i(r.fxprime,e),f>l+a*o*u||f>=g)p=o;else{if(Math.abs(h)<=-c*u)return o;h*(p-d)>=0&&(p=d),d=o,g=f}return 0}o=o||1,a=a||1e-6,c=c||.1;for(var m=0;m<10;++m){if(s(r.x,1,n.x,o,e),f=r.fx=t(r.x,r.fxprime),h=i(r.fxprime,e),f>l+a*o*u||m&&f>=d)return g(p,o,d);if(Math.abs(h)<=-c*u)return o;if(h>=0)return g(o,p,f);d=f,p=o,o*=2}return o}function u(t,e,n){var r,c,u,f={x:e.slice(),fx:0,fxprime:e.slice()},d={x:e.slice(),fx:0,fxprime:e.slice()},h=e.slice(),p=1;u=(n=n||{}).maxIterations||20*e.length,f.fx=t(f.x,f.fxprime),a(r=f.fxprime.slice(),f.fxprime,-1);for(var g=0;g<u;++g){if(p=l(t,r,f,d,p),n.history&&n.history.push({x:f.x.slice(),fx:f.fx,fxprime:f.fxprime.slice(),alpha:p}),p){s(h,1,d.fxprime,-1,f.fxprime);var m=i(f.fxprime,f.fxprime);s(r,Math.max(0,i(h,d.fxprime)/m),r,-1,d.fxprime),c=f,f=d,d=c}else a(r,f.fxprime,-1);if(o(f.fxprime)<=1e-5)break}return n.history&&n.history.push({x:f.x.slice(),fx:f.fx,fxprime:f.fxprime.slice(),alpha:p}),f}function f(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()},c=0;c<r&&(a.fx=t(a.x,a.fxprime),n.history&&n.history.push({x:a.x.slice(),fx:a.fx,fxprime:a.fxprime.slice()}),s(a.x,1,a.x,-i,a.fxprime),!(o(a.fxprime)<=1e-5));++c);return a}function d(t,e,n){n=n||{};var r,i={x:e.slice(),fx:0,fxprime:e.slice()},s={x:e.slice(),fx:0,fxprime:e.slice()},c=n.maxIterations||100*e.length,u=n.learnRate||1,f=e.slice(),d=n.c1||.001,h=n.c2||.1,p=[];if(n.history){var g=t;t=function(t,e){return p.push(t.slice()),g(t,e)}}i.fx=t(i.x,i.fxprime);for(var m=0;m<c&&(a(f,i.fxprime,-1),u=l(t,f,i,s,u,d,h),n.history&&(n.history.push({x:i.x.slice(),fx:i.fx,fxprime:i.fxprime.slice(),functionCalls:p,learnRate:u,alpha:u}),p=[]),r=i,i=s,s=r,!(0===u||o(i.fxprime)<1e-5));++m);return i}t.bisect=e,t.nelderMead=c,t.conjugateGradient=u,t.gradientDescent=f,t.gradientDescentLineSearch=d,t.zeros=n,t.zerosM=r,t.norm2=o,t.weightedSum=s,t.scale=a}(e)}(0,bz.exports);const Ez=1e-10;function xz(t,e){const n=function(t){const e=[];for(let n=0;n<t.length;++n)for(let r=n+1;r<t.length;++r){const i=Tz(t[n],t[r]);for(let t=0;t<i.length;++t){const o=i[t];o.parentIndex=[n,r],e.push(o)}}return e}(t),r=n.filter((function(e){return function(t,e){for(let n=0;n<e.length;++n)if(Sz(t,e[n])>e[n].radius+Ez)return!1;return!0}(e,t)}));let i,o=0,a=0;const s=[];if(r.length>1){const e=function(t){const e={x:0,y:0};for(let n=0;n<t.length;++n)e.x+=t[n].x,e.y+=t[n].y;return e.x/=t.length,e.y/=t.length,e}(r);for(i=0;i<r.length;++i){const t=r[i];t.angle=Math.atan2(t.x-e.x,t.y-e.y)}r.sort((function(t,e){return e.angle-t.angle}));let n=r[r.length-1];for(i=0;i<r.length;++i){const e=r[i];a+=(n.x+e.x)*(e.y-n.y);const c={x:(e.x+n.x)/2,y:(e.y+n.y)/2};let l=null;for(let r=0;r<e.parentIndex.length;++r)if(n.parentIndex.indexOf(e.parentIndex[r])>-1){const i=t[e.parentIndex[r]],o=Math.atan2(e.x-i.x,e.y-i.y),a=Math.atan2(n.x-i.x,n.y-i.y);let s=a-o;s<0&&(s+=2*Math.PI);const u=a-s/2;let f=Sz(c,{x:i.x+i.radius*Math.sin(u),y:i.y+i.radius*Math.cos(u)});f>2*i.radius&&(f=2*i.radius),(null===l||l.width>f)&&(l={circle:i,width:f,p1:e,p2:n})}null!==l&&(s.push(l),o+=Mz(l.circle.radius,l.width),n=e)}}else{let e=t[0];for(i=1;i<t.length;++i)t[i].radius<e.radius&&(e=t[i]);let n=!1;for(i=0;i<t.length;++i)if(Sz(t[i],e)>Math.abs(e.radius-t[i].radius)){n=!0;break}n?o=a=0:(o=e.radius*e.radius*Math.PI,s.push({circle:e,p1:{x:e.x,y:e.y+e.radius},p2:{x:e.x-Ez,y:e.y+e.radius},width:2*e.radius}))}return a/=2,e&&(e.area=o+a,e.arcArea=o,e.polygonArea=a,e.arcs=s,e.innerPoints=r,e.intersectionPoints=n),o+a}function Mz(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function Sz(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function Az(t,e,n){if(n>=t+e)return 0;if(n<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const r=e-(n*n-t*t+e*e)/(2*n);return Mz(t,t-(n*n-e*e+t*t)/(2*n))+Mz(e,r)}function Tz(t,e){const n=Sz(t,e),r=t.radius,i=e.radius;if(n>=r+i||n<=Math.abs(r-i))return[];const o=(r*r-i*i+n*n)/(2*n),a=Math.sqrt(r*r-o*o),s=t.x+o*(e.x-t.x)/n,c=t.y+o*(e.y-t.y)/n,l=-(e.y-t.y)*(a/n),u=-(e.x-t.x)*(a/n);return[{x:s+l,y:c-u},{x:s-l,y:c+u}]}const Oz=1e-10;function Rz(t,e,n){return Math.min(t,e)*Math.min(t,e)*Math.PI<=n+Oz?Math.abs(t-e):bz.exports.bisect((function(r){return Az(t,e,r)-n}),0,t+e)}function Pz(t,e){let n=function(t,e){const n=e&&e.lossFunction?e.lossFunction:Cz,r={},i={};let o;for(let e=0;e<t.length;++e){const n=t[e];1==n.sets.length&&(o=n.sets[0],r[o]={x:1e10,y:1e10,rowid:Object.keys(r).length,size:n.size,radius:Math.sqrt(n.size/Math.PI)},i[o]=[])}t=t.filter((function(t){return 2==t.sets.length}));for(let e=0;e<t.length;++e){const n=t[e];let o=n.hasOwnProperty("weight")?n.weight:1;const a=n.sets[0],s=n.sets[1];n.size+Oz>=Math.min(r[a].size,r[s].size)&&(o=0),i[a].push({set:s,size:n.size,weight:o}),i[s].push({set:a,size:n.size,weight:o})}const a=[];for(o in i)if(i.hasOwnProperty(o)){let t=0;for(let e=0;e<i[o].length;++e)t+=i[o][e].size*i[o][e].weight;a.push({set:o,size:t})}function s(t,e){return e.size-t.size}a.sort(s);const c={};function l(t){return t.set in c}function u(t,e){r[e].x=t.x,r[e].y=t.y,c[e]=!0}u({x:0,y:0},a[0].set);for(let e=1;e<a.length;++e){const c=a[e].set,f=i[c].filter(l);if(o=r[c],f.sort(s),0===f.length)throw"ERROR: missing pairwise overlap information";const d=[];for(let t=0;t<f.length;++t){const e=r[f[t].set],n=Rz(o.radius,e.radius,f[t].size);d.push({x:e.x+n,y:e.y}),d.push({x:e.x-n,y:e.y}),d.push({y:e.y+n,x:e.x}),d.push({y:e.y-n,x:e.x});for(let i=t+1;i<f.length;++i){const t=r[f[i].set],a=Rz(o.radius,t.radius,f[i].size),s=Tz({x:e.x,y:e.y,radius:n},{x:t.x,y:t.y,radius:a});for(let t=0;t<s.length;++t)d.push(s[t])}}let h=1e50,p=d[0];for(let e=0;e<d.length;++e){r[c].x=d[e].x,r[c].y=d[e].y;const i=n(r,t);i<h&&(h=i,p=d[e])}u(p,c)}return r}(t,e);const r=e.lossFunction||Cz;if(t.length>=8){const i=function(t,e){e=e||{};const n=e.restarts||10,r=[],i={};let o;for(o=0;o<t.length;++o){const e=t[o];1==e.sets.length&&(i[e.sets[0]]=r.length,r.push(e))}const a=function(t,e,n){const r=bz.exports.zerosM(e.length,e.length),i=bz.exports.zerosM(e.length,e.length);return t.filter((function(t){return 2==t.sets.length})).map((function(t){const o=n[t.sets[0]],a=n[t.sets[1]],s=Rz(Math.sqrt(e[o].size/Math.PI),Math.sqrt(e[a].size/Math.PI),t.size);r[o][a]=r[a][o]=s;let c=0;t.size+1e-10>=Math.min(e[o].size,e[a].size)?c=1:t.size<=1e-10&&(c=-1),i[o][a]=i[a][o]=c})),{distances:r,constraints:i}}(t,r,i);let s=a.distances;const c=a.constraints,l=bz.exports.norm2(s.map(bz.exports.norm2))/s.length;s=s.map((function(t){return t.map((function(t){return t/l}))}));const u=function(t,e){return function(t,e,n,r){let i,o=0;for(i=0;i<e.length;++i)e[i]=0;for(i=0;i<n.length;++i){const a=t[2*i],s=t[2*i+1];for(let c=i+1;c<n.length;++c){const l=t[2*c],u=t[2*c+1],f=n[i][c],d=r[i][c],h=(l-a)*(l-a)+(u-s)*(u-s),p=Math.sqrt(h),g=h-f*f;d>0&&p<=f||d<0&&p>=f||(o+=2*g*g,e[2*i]+=4*g*(a-l),e[2*i+1]+=4*g*(s-u),e[2*c]+=4*g*(l-a),e[2*c+1]+=4*g*(u-s))}}return o}(t,e,s,c)};let f,d;for(o=0;o<n;++o){const t=bz.exports.zeros(2*s.length).map(Math.random);d=bz.exports.conjugateGradient(u,t,e),(!f||d.fx<f.fx)&&(f=d)}const h=f.x,p={};for(o=0;o<r.length;++o){const t=r[o];p[t.sets[0]]={x:h[2*o]*l,y:h[2*o+1]*l,radius:Math.sqrt(t.size/Math.PI)}}if(e.history)for(o=0;o<e.history.length;++o)bz.exports.scale(e.history[o].x,l);return p}(t,e);r(i,t)+1e-8<r(n,t)&&(n=i)}return n}function Cz(t,e){let n=0;for(let r=0;r<e.length;++r){const i=e[r];let o;if(1==i.sets.length)continue;if(2==i.sets.length){const e=t[i.sets[0]],n=t[i.sets[1]];o=Az(e.radius,n.radius,Sz(e,n))}else o=xz(i.sets.map((function(e){return t[e]})));n+=(i.hasOwnProperty("weight")?i.weight:1)*(o-i.size)*(o-i.size)}return n}function wz(t,e,n,r){const i=[],o=[];for(const e in t)t.hasOwnProperty(e)&&(o.push(e),i.push(t[e]));e-=2*r,n-=2*r;const a=function(t){const e=function(e){const n=Math.max.apply(null,t.map((function(t){return t[e]+t.radius}))),r=Math.min.apply(null,t.map((function(t){return t[e]-t.radius})));return{max:n,min:r}};return{xRange:e("x"),yRange:e("y")}}(i),s=a.xRange,c=a.yRange;if(s.max==s.min||c.max==c.min)return console.log("not scaling solution: zero size detected"),t;const l=e/(s.max-s.min),u=n/(c.max-c.min),f=Math.min(u,l),d=(e-(s.max-s.min)*f)/2,h=(n-(c.max-c.min)*f)/2,p={};for(let t=0;t<i.length;++t){const e=i[t];p[o[t]]={radius:f*e.radius,x:r+d+(e.x-s.min)*f,y:r+h+(e.y-c.min)*f}}return p}const Nz=t=>{const{sets:e="sets",size:n="size",as:r=["key","path"],padding:i=0}=t,[o,a]=r;return t=>{const r=t.map((t=>Object.assign(Object.assign({},t),{sets:t[e],size:t[n],[o]:t.sets.join("&")})));r.sort(((t,e)=>t.sets.length-e.sets.length));const s=function(t,e){(e=e||{}).maxIterations=e.maxIterations||500;const n=e.initialLayout||Pz,r=e.lossFunction||Cz;t=function(t){t=t.slice();const e=[],n={};let r,i,o,a;for(r=0;r<t.length;++r){const i=t[r];1==i.sets.length?e.push(i.sets[0]):2==i.sets.length&&(o=i.sets[0],a=i.sets[1],n[[o,a]]=!0,n[[a,o]]=!0)}for(e.sort(((t,e)=>t>e?1:-1)),r=0;r<e.length;++r)for(o=e[r],i=r+1;i<e.length;++i)a=e[i],[o,a]in n||t.push({sets:[o,a],size:0});return t}(t);const i=n(t,e),o=[],a=[];let s;for(s in i)i.hasOwnProperty(s)&&(o.push(i[s].x),o.push(i[s].y),a.push(s));const c=bz.exports.nelderMead((function(e){const n={};for(let t=0;t<a.length;++t){const r=a[t];n[r]={x:e[2*t],y:e[2*t+1],radius:i[r].radius}}return r(n,t)}),o,e),l=c.x;for(let t=0;t<a.length;++t)s=a[t],i[s].x=l[2*t],i[s].y=l[2*t+1];return i}(r);let c;return r.map((t=>{const n=t[e];return Object.assign(Object.assign({},t),{[a]:({width:t,height:e})=>{c=c||wz(s,t,e,i);const r=n.map((t=>c[t]));let o=function(t){const e={};xz(t,e);const n=e.arcs;if(0===n.length)return"M 0 0";if(1==n.length){const t=n[0].circle;return function(t,e,n){const r=[],i=t-n,o=e;return r.push("M",i,o),r.push("A",n,n,0,1,0,i+2*n,o),r.push("A",n,n,0,1,0,i,o),r.join(" ")}(t.x,t.y,t.radius)}{const t=["\nM",n[0].p2.x,n[0].p2.y];for(let e=0;e<n.length;++e){const r=n[e],i=r.circle.radius,o=r.width>i;t.push("\nA",i,i,0,o?1:0,1,r.p1.x,r.p1.y)}return t.join(" ")}}(r);return/[zZ]$/.test(o)||(o+=" Z"),o}})}))}};Nz.props={};const Iz=()=>t=>(console.log("G2 data section:",t),t);Iz.props={};const kz=(t,e)=>s(void 0,void 0,void 0,(function*(){const{width:n,height:r}=e,{data:i,encode:a={},scale:s,style:c={},layout:l={}}=t,u=o(t,["data","encode","scale","style","layout"]),f=function(t,e){const{text:n="text",value:r="value"}=e;return t.map((t=>Object.assign(Object.assign({},t),{text:t[n],value:t[r]})))}(i,a),d=yield dz(Object.assign(Object.assign({},((t,e)=>({size:[t,e]}))(n,r)),l))(f);return We({},((t,e)=>({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"}}))(n,r),Object.assign(Object.assign({data:d,encode:a,scale:s,style:c},u),{axis:!1}))}));kz.props={};const Lz={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"]}}},Dz={style:{shape:(t,e)=>{const{shape:n,radius:r}=t,i=o(t,["shape","radius"]),a=cf(i,"pointer"),s=cf(i,"pin"),{shape:c}=a,l=o(a,["shape"]),{shape:u}=s,f=o(s,["shape"]),{coordinate:d,theme:h}=e;return(t,e)=>{const n=t.map((t=>d.invert(t))),[o,a,s]=function(t,e){const{transformations:n}=t.getOptions(),[,...r]=n.find((t=>t[0]===e));return r}(d,"polar"),p=d.clone(),{color:g}=e,m=Vf({startAngle:o,endAngle:a,innerRadius:s,outerRadius:r});m.push(["cartesian"]),p.update({transformations:m});const v=n.map((t=>p.map(t))),[y,_]=Ib(v),[b,E]=d.getCenter(),x=Object.assign(Object.assign({x1:y,y1:_,x2:b,y2:E,stroke:g},l),i),M=Object.assign(Object.assign({cx:b,cy:E,stroke:g},f),i),S=gf(new Ts);return hf(c)||("function"==typeof c?S.append((()=>c(v,e,p,h))):S.append("line").call(Tb,x).node()),hf(u)||("function"==typeof u?S.append((()=>u(v,e,p,h))):S.append("circle").call(Tb,M).node()),S.node()}},lineWidth:4,pointerLineCap:"round",pinR:10,pinFill:"#fff",radius:.6}},Bz={type:"text",style:{x:"50%",y:"60%",textAlign:"center",textBaseline:"middle",fontSize:20,fontWeight:800,fill:"#888"}};function Fz(t,e){const{name:n="score",target:r,total:i,percent:o,thresholds:a=[]}=function(t){if(Ae(t)){const e=Math.max(0,Math.min(t,1));return{percent:e,target:e,total:1}}return t}(t),s=o||r,c=o?1:i,l=Object.assign({y:{domain:[0,c]}},e);return a.length?{targetData:[{x:n,y:s,color:"target"}],totalData:a.map(((t,e)=>({x:n,y:e>=1?t-a[e-1]:t,color:e}))),target:s,total:c,scale:l}:{targetData:[{x:n,y:s,color:"target"}],totalData:[{x:n,y:s,color:"target"},{x:n,y:c-s,color:"total"}],target:s,total:c,scale:l}}function Uz(t,{target:e,total:n}){const{content:r}=t;return r?r(e,n):e.toString()}const jz=t=>{const{data:e={},scale:n={},style:r={},animate:i={},transform:a=[]}=t,s=o(t,["data","scale","style","animate","transform"]),{targetData:c,totalData:l,target:u,total:f,scale:d}=Fz(e,n),h=cf(r,"text"),p=(g=r,m=["pointer","pin"],Object.fromEntries(Object.entries(g).filter((([t])=>m.find((e=>t.startsWith(e)))))));var g,m;return[We({},Lz,Object.assign({type:"interval",transform:[{type:"stackY"}],data:l,scale:d,style:cf(r,"arc"),animate:"object"==typeof i?cf(i,"arc"):i},s)),We({},Lz,Dz,Object.assign({type:"point",data:c,scale:d,style:p,animate:"object"==typeof i?cf(i,"indicator"):i},s)),We({},Bz,{style:Object.assign({text:Uz(h,{target:u,total:f})},h),animate:"object"==typeof i?cf(i,"text"):i})]};jz.props={};const Gz={density:Kk},Wz=()=>(t,e,n,r)=>{const{x:i,series:o}=n,a=Object.entries(n).filter((([t])=>t.startsWith("y"))).map((([,t])=>t)),s=Object.entries(n).filter((([t])=>t.startsWith("size"))).map((([,t])=>t));if(void 0===i||void 0===a||void 0===s)throw new Error("Missing encode for x or y or size channel.");const c=e.x,l=e.series,u=Array.from(t,(e=>{const n=c.getBandWidth(c.invert(+i[e])),u=n*(l?l.getBandWidth(l.invert(+(null==o?void 0:o[e]))):1),f=(+(null==o?void 0:o[e])||0)*n,d=+i[e]+f+u/2;return[...a.map(((n,r)=>[d+ +s[r][e]/t.length,+a[r][e]])),...a.map(((n,r)=>[d-+s[r][e]/t.length,+a[r][e]])).reverse()].map((t=>r.map(t)))}));return[t,u]};Wz.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,shape:Gz,channels:[...sk({shapes:Object.keys(Gz)}),{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:[...dk(),{type:GN},{type:JN}],postInference:[...uk()],interaction:{shareTooltip:!0}};const zz={heatmap:eL},Vz=t=>(t,e,n,r)=>{const{x:i,y:o,size:a,color:s}=n;return[[0],[Array.from(t,(t=>{const e=a?+a[t]:40;return[...r.map([+i[t],+o[t]]),s[t],e]}))]]};Vz.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,shape:zz,channels:[...sk({shapes:Object.keys(zz)}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...dk(),{type:JN},{type:tI}],postInference:[...lk()]};const Hz={axis:{x:!1,y:!1},legend:!1,tooltip:!1,encode:{x:"type",y:"percent"},scale:{y:{domain:[0,1]}},style:{shape:sL},animate:{enter:{type:"fadeIn"}}},Xz={type:"text",style:{x:"50%",y:"50%",textAlign:"center",textBaseline:"middle",fontSize:20,fontWeight:800,fill:"#888"},animate:{enter:{type:"fadeIn"}}},Yz=t=>{const{data:e={},style:n={},animate:r}=t,i=o(t,["data","style","animate"]),a=Math.max(0,Ae(e)?e:null==e?void 0:e.percent),s=[{percent:a,type:"liquid"}],c=cf(n,"text"),l=cf(n,"outline"),u=cf(n,"wave"),f=cf(n,"background");return[We({},Hz,Object.assign({type:"interval",data:s,style:{liquidOptions:{percent:a,liquidShape:null==n?void 0:n.shape},styleOptions:Object.assign(Object.assign({},n),{outline:l,wave:u,background:f})},animate:r},i)),We({},Xz,{style:Object.assign({text:100*a+" %"},c),animate:r})]};Yz.props={};const $z=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"];$z.props={};const qz=()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"];qz.props={};const Kz=t=>new Bh(t);Kz.props={};const Zz=t=>new ep(t);Zz.props={};const Qz=t=>new kh(t);Qz.props={};const Jz=t=>new Kh(t);Jz.props={};const tV=t=>new np(t);tV.props={};const eV=t=>new Ap(t);eV.props={};const nV=t=>new cp(t);nV.props={};const rV=t=>new ip(t);rV.props={};const iV=t=>new ap(t);iV.props={};const oV=t=>new fp(t);oV.props={};const aV=t=>new lp(t);aV.props={};const sV=t=>new op(t);sV.props={};const cV=t=>new Rp(t);cV.props={};const lV=t=>new Uh(t);function uV({colorDefault:t,colorBlack:e,colorWhite:n,colorStroke:r,colorBackground:i,padding1:o,padding2:a,padding3:s,alpha90:c,alpha65:l,alpha45:u,alpha25:f,alpha10:d,category10:h,category20:p,sizeDefault:g=1,padding:m="auto",margin:v=16}){return{padding:m,margin:v,size:g,color:t,category10:h,category20:p,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},view:{viewFill:i,plotFill:"transparent",mainFill:"transparent",contentFill:"transparent"},line:{line:{fill:"",strokeOpacity:1,lineWidth:1}},point:{point:{r:3,fillOpacity:.95,lineWidth:0},hollow:{r:3,strokeOpacity:.95,lineWidth:1},plus:{r:3,strokeOpacity:.95,lineWidth:3},diamond:{r:3,strokeOpacity:.95,lineWidth:1}},interval:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},area:{area:{fillOpacity:.85,lineWidth:0}},polygon:{polygon:{fillOpacity:.95}},cell:{cell:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},rect:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},link:{link:{fill:"",strokeOpacity:1}},vector:{vector:{fillOpacity:1}},box:{box:{fillOpacity:.95,stroke:e,lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:12,strokeWidth:0,connectorStroke:r,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:r,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,strokeWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:r,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:r,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:r,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:r,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:r,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:r,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:r,endMarkerFillOpacity:.95}},axis:{arrow:!1,gridLineDash:[3,4],gridLineWidth:.5,gridStroke:e,gridStrokeOpacity:d,labelAlign:"horizontal",labelFill:e,labelOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing:o,line:!1,lineLineWidth:.5,lineStroke:e,lineStrokeOpacity:u,tickLength:4,tickLineWidth:1,tickStroke:e,tickOpacity:u,titleFill:e,titleOpacity:c,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,titleTransformOrigin:"center",lineArrowOffset:6,lineArrowSize:6},axisTop:{gridDirection:"positive",labelDirection:"negative",tickDirection:"negative",titlePosition:"top",labelAutoRotate:!1,titleSpacing:12,labelSpacing:4,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",labelAutoRotate:!1,tickDirection:"positive",titlePosition:"bottom",titleSpacing:12,labelSpacing:4,titleTextBaseline:"bottom"},axisLeft:{gridDirection:"positive",labelAutoRotate:!1,labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"left",titleSpacing:12,titleTextBaseline:"middle",titleDirection:"vertical",titleTransformOrigin:"center"},axisRight:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"right",labelAutoRotate:!1,titleSpacing:12,titleTextBaseline:"top",titleDirection:"vertical",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleSpacing:0},axisArc:{title:!1,titlePosition:"inner",line:!1,tick:!0,labelSpacing:4},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:e,itemLabelFillOpacity:c,itemLabelFontSize:12,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[o,o],itemValueFill:e,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"normal",navButtonFill:e,navButtonFillOpacity:.65,navPageNumFill:e,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!1,titleFill:e,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:e,tickStrokeOpacity:.25,rowPadding:o,colPadding:a,maxRows:3,maxCols:3},legendContinuous:{handleHeight:12,handleLabelFill:e,handleLabelFillOpacity:u,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:e,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:e,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:e,labelFillOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing:3,tick:!0,tickLength:12,ribbonSize:12,ribbonFill:"#aaa",handle:!0,handleLabel:!1,handleShape:"slider",handleIconSize:12/1.8,indicator:!1,titleFontSize:12,titleSpacing:4,titleFontWeight:"normal",titleFillOpacity:c,tickStroke:e,tickStrokeOpacity:u},label:{fill:e,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:e,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:n,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},htmlLabel:{fontSize:12,opacity:.65,color:e,fontWeight:"normal"},slider:{trackSize:16,trackFill:r,trackFillOpacity:1,selectionFill:t,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:e,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:e,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{padding:[0,0,0,0],trackSize:6,isRound:!0,slidable:!0,scrollable:!0,trackFill:"#e5e5e5",trackFillOpacity:0,thumbFill:"#000",thumbFillOpacity:.15,thumbHighlightedFillOpacity:.2},title:{spacing:8,titleFill:e,titleFillOpacity:c,titleFontSize:16,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:e,subtitleFillOpacity:l,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}}}lV.props={};const fV=uV({colorBlack:"#1D2129",colorWhite:"#fff",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"transparent",category10:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F"],category20:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F","#AABA01","#BC7CFC","#237CBC","#2DE379","#CE8032","#FF7AF4","#545FD3","#AFE410","#D8C608","#FFA1E0"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.1}),dV=t=>We({},fV,t);dV.props={};const hV=t=>We({},dV(),{category10:"category10",category20:"category20"},t);hV.props={};const pV=uV({colorBlack:"#fff",colorWhite:"#000",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"#141414",category10:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F"],category20:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F","#AABA01","#BC7CFC","#237CBC","#2DE379","#CE8032","#FF7AF4","#545FD3","#AFE410","#D8C608","#FFA1E0"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.25}),gV=t=>We({},pV,{tooltip:{crosshairsStroke:"#fff",crosshairsLineWidth:1,crosshairsStrokeOpacity:.25,css:{".g2-tooltip":{background:"#1f1f1f",opacity:.95},".g2-tooltip-title":{color:"#A6A6A6"},".g2-tooltip-list-item-name-label":{color:"#A6A6A6"},".g2-tooltip-list-item-value":{color:"#A6A6A6"}}}},t),mV=t=>Object.assign({},gV(),{category10:"category10",category20:"category20"},t);mV.props={};const vV=uV({colorBlack:"#000",colorWhite:"#fff",colorStroke:"#888",colorDefault:"#4e79a7",colorBackground:"transparent",category10:"tableau10",category20:"tableau10",padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.1}),yV=t=>We({},vV,{text:{text:{fontSize:10}},axis:{gridLineDash:[0,0],gridLineWidth:1,gridStroke:"#ddd",gridStrokeOpacity:1,labelOpacity:1,labelStrokeOpacity:1,labelFontSize:10,line:!0,lineLineWidth:1,lineStroke:"#888",lineStrokeOpacity:1,tickLength:5,tickStrokeOpacity:1,titleOpacity:1,titleStrokeOpacity:1,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold"},axisLeft:{gridFilter:(t,e)=>0!==e},axisRight:{gridFilter:(t,e)=>0!==e},legendCategory:{itemLabelFillOpacity:1,itemLabelFontSize:10,itemValueFillOpacity:1,itemValueFontSize:10,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold"},legendContinuous:{handleLabelFontSize:10,labelFillOpacity:.45,labelFontSize:10},label:{fontSize:10},innerLabel:{fontSize:10},htmlLabel:{fontSize:10},slider:{handleLabelFontSize:10,trackFillOpacity:.05}},t);yV.props={};const _V=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{height:a}=o.getBoundingClientRect(),{transform:s="",fillOpacity:c=1,strokeOpacity:l=1,opacity:u=1}=o.style,[f,d]=Jy(n)?[[0,a],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],h=[{transform:`${s} ${d}`.trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${s} ${d}`.trimStart(),fillOpacity:c,strokeOpacity:l,opacity:u,offset:.01},{transform:`${s} scale(1, 1)`.trimStart(),fillOpacity:c,strokeOpacity:l,opacity:u}];o.setOrigin(f);const p=o.animate(h,Object.assign(Object.assign({},i),t));return p.finished.then((()=>o.setOrigin(0,0))),p}},bV=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{height:a}=o.getBoundingClientRect(),{transform:s="",fillOpacity:c=1,strokeOpacity:l=1,opacity:u=1}=o.style,[f,d]=Jy(n)?[[0,a],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],h=[{transform:`${s} scale(1, 1)`.trimStart()},{transform:`${s} ${d}`.trimStart(),fillOpacity:c,strokeOpacity:l,opacity:u,offset:.99},{transform:`${s} ${d}`.trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}];o.setOrigin(f);const p=o.animate(h,Object.assign(Object.assign({},i),t));return p.finished.then((()=>o.setOrigin(0,0))),p}},EV=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{height:a}=o.getBoundingClientRect(),{transform:s="",fillOpacity:c=1,strokeOpacity:l=1,opacity:u=1}=o.style,[f,d]=Jy(n)?[[0,0],"scale(0.0001, 1)"]:[[0,a],"scale(1, 0.0001)"],h=[{transform:`${s} ${d}`.trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${s} ${d}`.trimStart(),fillOpacity:c,strokeOpacity:l,opacity:u,offset:.01},{transform:`${s} scale(1, 1)`.trimStart(),fillOpacity:c,strokeOpacity:l,opacity:u}];o.setOrigin(f);const p=o.animate(h,Object.assign(Object.assign({},i),t));return p.finished.then((()=>o.setOrigin(0,0))),p}},xV=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{height:a}=o.getBoundingClientRect(),{transform:s="",fillOpacity:c=1,strokeOpacity:l=1,opacity:u=1}=o.style,[f,d]=Jy(n)?[[0,0],"scale(0.0001, 1)"]:[[0,a],"scale(1, 0.0001)"],h=[{transform:`${s} scale(1, 1)`.trimStart()},{transform:`${s} ${d}`.trimStart(),fillOpacity:c,strokeOpacity:l,opacity:u,offset:.99},{transform:`${s} ${d}`.trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}];o.setOrigin(f);const p=o.animate(h,Object.assign(Object.assign({},i),t));return p.finished.then((()=>o.setOrigin(0,0))),p}},MV=t=>(e,n,r)=>{const[i]=e,{fillOpacity:o=1,strokeOpacity:a=1,opacity:s=1}=i.style,c=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:o,strokeOpacity:a,opacity:s}];return i.animate(c,Object.assign(Object.assign({},r),t))};MV.props={};const SV=t=>(e,n,r)=>{const[i]=e,{fillOpacity:o=1,strokeOpacity:a=1,opacity:s=1}=i.style,c=[{fillOpacity:o,strokeOpacity:a,opacity:s},{fillOpacity:0,strokeOpacity:0,opacity:0}];return i.animate(c,Object.assign(Object.assign({},r),t))};function AV(t,e){const n={};for(const r of e){const e=t.style[r];e&&(n[r]=e)}return n}SV.props={};const TV=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function OV(t){const{min:e,max:n}=t.getLocalBounds(),[r,i]=e,[o,a]=n;return[r,i,o-r,a-i]}function RV(t){const[e,n,r,i]=t;return`\n M ${e} ${n}\n L ${e+r} ${n}\n L ${e+r} ${n+i}\n L ${e} ${n+i}\n Z\n `}function PV(t,e){const[n,r,i,o]=OV(t),a=o/i,s=Math.ceil(Math.sqrt(e/a)),c=[],l=o/Math.ceil(e/s);let u=0,f=e;for(;f>0;){const t=Math.min(f,s),e=i/t;for(let i=0;i<t;i++){const t=n+i*e,o=r+u*l;c.push(RV([t,o,e,l]))}f-=t,u+=1}return c}function CV(t,e){t.__data__=e.__data__,t.className=e.className,t.markType=e.markType,e.parentNode.replaceChild(t,e)}function wV(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function NV(t){const e=io(t);if(e&&!function(t){return!wV(t,"m")||!wV(t,"M")}(e))return e}function IV(t,e,n,r){const{nodeName:i}=e,{nodeName:o}=n,a=NV(e),s=NV(n);if(i===o&&"path"!==i||(void 0===a||void 0===s))return function(t,e,n){const[r,i,o,a]=OV(t),{transform:s}=t.style,{transform:c}=e.style;CV(e,t);const[l,u,f,d]=OV(e),h=r-l,p=i-u,g=o/f,m=a/d,v=[Object.assign({transform:`${s?s+" ":""}translate(${h}, ${p}) scale(${g}, ${m})`},AV(t,TV)),Object.assign({transform:(c?c+" ":"")+"translate(0, 0) scale(1, 1)"},AV(e,TV))];return e.animate(v,n)}(e,n,r);const c=function(t,e){const{nodeName:n}=t;if("path"===n)return t;const r=new Cs({style:Object.assign(Object.assign({},AV(t,TV)),{d:e})});return CV(r,t),r}(t,a),l=[Object.assign({path:a},AV(e,TV)),Object.assign({path:s},AV(n,TV))],u=c.animate(l,r);return u.onfinish=()=>{c.style.transform="none",of(c,n)},c.style.transform="none",u}const kV=t=>(e,n,r)=>{const i=function(t="pack"){return"function"==typeof t?t:PV}(t.split),o=Object.assign(Object.assign({},r),t),{length:a}=e,{length:s}=n;if(1===a&&1===s||a>1&&s>1){const[t]=e,[r]=n;return IV(t,t,r,o)}if(1===a&&s>1){const[t]=e;return function(t,e,n,r){t.style.visibility="hidden";const i=r(t,e.length);return e.map(((e,r)=>IV(e,new Cs({style:Object.assign({path:i[r]},AV(t,TV))}),e,n)))}(t,n,o,i)}if(a>1&&1===s){const[t]=n;return function(t,e,n,r){const i=r(e,t.length),{fillOpacity:o=1,strokeOpacity:a=1,opacity:s=1}=e.style,c=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:0,strokeOpacity:0,opacity:0,offset:.99},{fillOpacity:o,strokeOpacity:a,opacity:s}],l=e.animate(c,n),u=t.map(((t,r)=>IV(t,t,new Cs({style:{path:i[r],fill:e.style.fill}}),n)));return[...u,l]}(e,t,o,i)}return null};kV.props={};const LV=(t,e)=>{const n=1e-4;xs({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:pi.NUMBER});const{coordinate:r}=e;return(i,o,a)=>{const[s]=i;if(!t_(r))return _V(t,e)(i,o,a);const c=r.getCenter(),{__data__:l,style:u}=s,{radius:f=0,inset:d=0,fillOpacity:h=1,strokeOpacity:p=1,opacity:g=1}=u,{points:m,y:v,y1:y}=l,_=dA().cornerRadius(f).padAngle(d*Math.PI/180),b=Cb(r,m,[v,y]),{startAngle:E,endAngle:x}=b,M=new Cs({}),S=t=>{M.attr({d:_(t),transform:`translate(${c[0]}, ${c[1]})`});const e=io(M);return M.style.transform="",e},A=[{waveInArcAngle:E+n,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:E+n,fillOpacity:h,strokeOpacity:p,opacity:g,offset:.01},{waveInArcAngle:x,fillOpacity:h,strokeOpacity:p,opacity:g}],T=s.animate(A,Object.assign(Object.assign({},a),t));return T.onframe=function(){s.style.path=S(Object.assign(Object.assign({},b),{endAngle:Number(s.style.waveInArcAngle)}))},T.onfinish=function(){s.style.path=S(Object.assign(Object.assign({},b),{endAngle:x}))},T}};LV.props={};const DV=t=>(e,n,r)=>{const[i]=e,{transform:o="",fillOpacity:a=1,strokeOpacity:s=1,opacity:c=1}=i.style,l=[{transform:`${o} scale(0.0001)`.trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${o} scale(0.0001)`.trimStart(),fillOpacity:a,strokeOpacity:s,opacity:c,offset:.01},{transform:`${o} scale(1)`.trimStart(),fillOpacity:a,strokeOpacity:s,opacity:c}],{width:u,height:f}=i.getBoundingClientRect();i.setOrigin([u/2,f/2]);const d=i.animate(l,Object.assign(Object.assign({},r),t));return d.finished.then((()=>i.setOrigin(0,0))),d},BV=t=>(e,n,r)=>{const[i]=e,{transform:o="",fillOpacity:a=1,strokeOpacity:s=1,opacity:c=1}=i.style,l=[{transform:`${o} scale(1)`.trimStart()},{transform:`${o} scale(0.0001)`.trimStart(),fillOpacity:a,strokeOpacity:s,opacity:c,offset:.99},{transform:`${o} scale(0.0001)`.trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],{width:u,height:f}=i.getBoundingClientRect();i.setOrigin([u/2,f/2]);const d=i.animate(l,Object.assign(Object.assign({},r),t));return d.finished.then((()=>i.setOrigin(0,0))),d},FV=t=>(e,n,r)=>{var i,o;const[a]=e,s=(null===(o=(i=a).getTotalLength)||void 0===o?void 0:o.call(i))||0,c=[{lineDash:[0,s]},{lineDash:[s,0]}];return a.animate(c,Object.assign(Object.assign({},r),t))};FV.props={};const UV=(t,e)=>(n,r,i)=>{const[o]=n,{height:a,width:s}=o.getBoundingClientRect(),c=new Cs({style:{path:`M0,0L${s},0L${s},${a}L0,${a}Z`}});o.appendChild(c),o.style.clipPath=c;const l=_V(t,e)([c],r,i);return l.finished.then((()=>{c.remove(),o.style.clipPath=null})),l};UV.props={};const jV=(t,e)=>(n,r,i)=>{const[o]=n,{height:a,width:s}=o.getBoundingClientRect(),c=new Cs({style:{path:`M0,0L${s},0L${s},${a}L0,${a}Z`}});o.appendChild(c),o.style.clipPath=c;const l=EV(t,e)([c],r,i);return l.finished.then((()=>{c.remove(),o.style.clipPath=null})),l};jV.props={};const GV={visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1};function WV(t,e){var n;return null!==(n=t.style[e])&&void 0!==n?n:GV[e]}function zV(t,e,n,r){t.style[e]=n,r&&t.children.forEach((t=>zV(t,e,n,r)))}function VV(t){zV(t,"visibility","hidden",!0)}function HV(t){zV(t,"visibility","visible",!0)}function XV(t){return gf(t).selectAll(`.${rl}`).nodes().filter((t=>!t.__removed__))}function YV(t,e){return $V(t,e).flatMap((({container:t})=>XV(t)))}function $V(t,e){return e.filter((e=>e!==t&&e.options.parentKey===t.options.key))}function qV(t){return gf(t).select(`.${ol}`).node()}function KV(t,e){const{offsetX:n,offsetY:r}=e,i=t.getRenderBounds(),{min:[o,a],max:[s,c]}=i;return n<o||n>s||(r<a||r>c)?null:[n-o,r-a]}function ZV(t,e){const{offsetX:n,offsetY:r}=e,[i,o,a,s]=function(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,o]}=e;return[n,r,i,o]}(t);return[Math.min(a,Math.max(i,n))-i,Math.min(s,Math.max(o,r))-o]}function QV(t){return t=>t.__data__.color}function JV(t){const{x:e}=t.scale;return t=>{const{x:n}=t.__data__;return e.invert(n)}}function tH(t){const e=Array.isArray(t)?t:[t],n=new Map(e.flatMap((t=>Array.from(t.markState.keys()).map((e=>[nH(t.key,e.key),e.data])))));return t=>{const{index:e,markKey:r,viewKey:i}=t.__data__;return n.get(nH(i,r))[e]}}function eH(t,e=((t,e)=>t),n=((t,e,n)=>t.setAttribute(e,n))){const r="__states__",i="__ordinal__",o=o=>{const{[r]:a=[],[i]:s={}}=o,c=a.reduce(((e,n)=>Object.assign(Object.assign({},e),t[n])),s);if(0!==Object.keys(c).length){for(const[t,r]of Object.entries(c)){const i=WV(o,t),a=e(r,o);n(o,t,a),t in s||(s[t]=i)}o[i]=s}},a=t=>{t[r]||(t[r]=[])};return{setState:(t,...e)=>{a(t),t[r]=[...e],o(t)},removeState:(t,...e)=>{a(t);for(const n of e){const e=t[r].indexOf(n);-1!==e&&t[r].splice(e,1)}o(t)},hasState:(t,e)=>(a(t),-1!==t[r].indexOf(e))}}function nH(t,e){return`${t},${e}`}function rH(t,e){const n=(Array.isArray(t)?t:[t]).flatMap((t=>t.marks.map((e=>[nH(t.key,e.key),e.state])))),r={};for(const t of e){const[e,i]=Array.isArray(t)?t:[t,{}];r[e]=n.reduce(((t,n)=>{const[r,o={}]=n,a=void 0===(s=o[e])||"object"==typeof s&&0===Object.keys(s).length?i:o[e];var s;for(const[e,n]of Object.entries(a)){const i=t[e],o=(t,e,o,a)=>{const s=nH(a.__data__.viewKey,a.__data__.markKey);return r!==s?null==i?void 0:i(t,e,o,a):"function"!=typeof n?n:n(t,e,o,a)};t[e]=o}return t}),{})}return r}function iH(t,e){const n=new Map(t.map(((t,e)=>[t,e]))),r=e?t.map(e):t;return(t,i)=>{if("function"!=typeof t)return t;const o=n.get(i);return t(e?e(i):i,o,r,i)}}function oH(t){var{link:e=!1,valueof:n=((t,e)=>t),coordinate:r}=t,i=o(t,["link","valueof","coordinate"]);if(!e)return[()=>{},()=>{}];const a=t=>t.__data__.points,s=(t,e)=>{const[,n,r]=t,[i,,,o]=e;return[n,i,o,r]};return[t=>{var e;if(t.length<=1)return;const r=Ru(t,((t,e)=>{const{x:n}=t.__data__,{x:r}=e.__data__;return n-r}));for(let t=1;t<r.length;t++){const c=iA(),l=r[t-1],u=r[t],[f,d,h,p]=s(a(l),a(u));c.moveTo(...f),c.lineTo(...d),c.lineTo(...h),c.lineTo(...p),c.closePath();const g=wf(i,(t=>n(t,l))),{fill:m=l.getAttribute("fill")}=g,v=o(g,["fill"]),y=new Cs({className:"element-link",style:Object.assign({d:c.toString(),fill:m,zIndex:-2},v)});null===(e=l.link)||void 0===e||e.remove(),l.parentNode.appendChild(y),l.link=y}},t=>{var e;null===(e=t.link)||void 0===e||e.remove(),t.link=null}]}function aH(t,e,n){const r=e=>{const{transform:n}=t.style;return n?`${n} ${e}`:e};if(t_(n)){const{points:i}=t.__data__,[o,a]=Jy(n)?Pb(i):i,s=n.getCenter(),c=yb(o,s),l=yb(a,s),u=Eb(c)+Mb(c,l)/2;return r(`translate(${e*Math.cos(u)}, ${e*Math.sin(u)})`)}return Jy(n)?r(`translate(${e}, 0)`):r(`translate(0, ${-e})`)}function sH(t){var{document:e,background:n,scale:r,coordinate:i,valueof:a}=t,s=o(t,["document","background","scale","coordinate","valueof"]);const c="element-background";if(!n)return[()=>{},()=>{}];const l=(t,e,n)=>{const r=t.invert(e),i=e+t.getBandWidth(r)/2,o=t.getStep(r)/2,a=o*n;return[i-o+a,i+o-a]},u=(t,n)=>{const{padding:o}=n,[a,s]=((t,e)=>{const{x:n}=r;if(!Fb(n))return[0,1];const{__data__:i}=t,{x:o}=i,[a,s]=l(n,o,e);return[a,s]})(t,o),[c,u]=((t,e)=>{const{y:n}=r;if(!Fb(n))return[0,1];const{__data__:i}=t,{y:o}=i,[a,s]=l(n,o,e);return[a,s]})(t,o),f=[[a,c],[s,c],[s,u],[a,u]].map((t=>i.map(t))),{__data__:d}=t,{y:h,y1:p}=d;return jA(e,f,{y:h,y1:p},i,n)},f=(t,e)=>{const{transform:n="scale(1.2, 1.2)",transformOrigin:r="center center",stroke:i=""}=e,a=o(e,["transform","transformOrigin","stroke"]),s=Object.assign({transform:n,transformOrigin:r,stroke:i},a),c=t.cloneNode(!0);for(const[t,e]of Object.entries(s))c.style[t]=e;return c};return[t=>{t.background&&t.background.remove();const e=wf(s,(e=>a(e,t))),{fill:n="#CCD6EC",fillOpacity:i=.3,zIndex:l=-2,padding:d=.001,strokeWidth:h=0}=e,p=o(e,["fill","fillOpacity","zIndex","padding","strokeWidth"]),g=Object.assign(Object.assign({},p),{fill:n,fillOpacity:i,zIndex:l,padding:d,strokeWidth:h}),m=(()=>{const{x:t,y:e}=r;return[t,e].some(Fb)})()?u:f,v=m(t,g);v.className=c,t.parentNode.appendChild(v),t.background=v},t=>{var e;null===(e=t.background)||void 0===e||e.remove(),t.background=null},t=>t.className===c]}function cH(t,e){const n=t.getRootNode().defaultView.getContextService().getDomElement();(null==n?void 0:n.style)&&(t.cursor=n.style.cursor,n.style.cursor=e)}function lH(t){cH(t,t.cursor)}function uH(t,e,n){return t.find((t=>Object.entries(e).every((([e,r])=>n(t)[e]===r))))}function fH(t,{elements:e,datum:n,groupKey:r=(t=>t),link:i=!1,background:o=!1,delay:a=60,scale:s,coordinate:c,emitter:l,state:u={}}){var f;const d=e(t),h=new Set(d),p=Mu(d,r),g=iH(d,n),[m,v]=oH(Object.assign({elements:d,valueof:g,link:i,coordinate:c},cf(u.active,"link"))),[y,_,b]=sH(Object.assign({document:t.ownerDocument,scale:s,coordinate:c,background:o,valueof:g},cf(u.active,"background"))),E=We(u,{active:Object.assign({},(null===(f=u.active)||void 0===f?void 0:f.offset)&&{transform:(...t)=>{const e=u.active.offset(...t),[,n]=t;return aH(d[n],e,c)}})}),{setState:x,removeState:M,hasState:S}=eH(E,g);let A;const T=t=>{const{target:e,nativeEvent:i=!0}=t;if(!h.has(e))return;A&&clearTimeout(A);const o=r(e),a=p.get(o),s=new Set(a);for(const t of d)s.has(t)?S(t,"active")||x(t,"active"):(x(t,"inactive"),v(t)),t!==e&&_(t);y(e),m(a),i&&l.emit("element:highlight",{nativeEvent:i,data:{data:n(e),group:a.map(n)}})},O=(t=!0)=>{for(const t of d)M(t,"active","inactive"),_(t),v(t);t&&l.emit("element:unhighlight",{nativeEvent:t})},R=t=>{const{target:e}=t;o&&!b(e)||(o||h.has(e))&&(a>0?(A&&clearTimeout(A),A=setTimeout((()=>{O(),A=null}),a)):O())},P=()=>{O()};t.addEventListener("pointerover",T),t.addEventListener("pointerout",R),t.addEventListener("pointerleave",P);const C=t=>{const{nativeEvent:e}=t;e||O(!1)},w=t=>{const{nativeEvent:e}=t;if(e)return;const{data:r}=t.data,i=uH(d,r,n);i&&T({target:i,nativeEvent:!1})};return l.on("element:highlight",w),l.on("element:unhighlight",C),()=>{t.removeEventListener("pointerover",T),t.removeEventListener("pointerout",R),t.removeEventListener("pointerleave",P),l.off("element:highlight",w),l.off("element:unhighlight",C);for(const t of d)_(t),v(t)}}function dH(t){var{delay:e,createGroup:n,background:r=!1,link:i=!1}=t,a=o(t,["delay","createGroup","background","link"]);return(t,o,s)=>{const{container:c,view:l,options:u}=t,{scale:f,coordinate:d}=l;return fH(qV(c),Object.assign({elements:XV,datum:tH(l),groupKey:n?n(l):void 0,coordinate:d,scale:f,state:rH(u,[["active",r?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:r,link:i,delay:e,emitter:s},a))}}function hH(t){return dH(Object.assign(Object.assign({},t),{createGroup:JV}))}function pH(t){return dH(Object.assign(Object.assign({},t),{createGroup:QV}))}function gH(t,{elements:e,datum:n,groupKey:r=(t=>t),link:i=!1,single:o=!1,coordinate:a,background:s=!1,scale:c,emitter:l,state:u={}}){var f;const d=e(t),h=new Set(d),p=Mu(d,r),g=iH(d,n),[m,v]=oH(Object.assign({link:i,elements:d,valueof:g,coordinate:a},cf(u.selected,"link"))),[y,_]=sH(Object.assign({document:t.ownerDocument,background:s,coordinate:a,scale:c,valueof:g},cf(u.selected,"background"))),b=We(u,{selected:Object.assign({},(null===(f=u.selected)||void 0===f?void 0:f.offset)&&{transform:(...t)=>{const e=u.selected.offset(...t),[,n]=t;return aH(d[n],e,a)}})}),{setState:E,removeState:x,hasState:M}=eH(b,g),S=(t=!0)=>{for(const t of d)x(t,"selected","unselected"),v(t),_(t);t&&l.emit("element:unselect",{nativeEvent:!0})},A=t=>{const{target:e,nativeEvent:a=!0}=t;return h.has(e)?o?((t,e,i=!0)=>{if(M(e,"selected"))S();else{const o=r(e),a=p.get(o),s=new Set(a);for(const t of d)s.has(t)?E(t,"selected"):(E(t,"unselected"),v(t)),t!==e&&_(t);if(m(a),y(e),!i)return;l.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:i,data:{data:[n(e),...a.map(n)]}}))}})(t,e,a):((t,e,o=!0)=>{const a=r(e),s=p.get(a),c=new Set(s);if(M(e,"selected")){if(!d.some((t=>!c.has(t)&&M(t,"selected"))))return S();for(const t of s)E(t,"unselected"),v(t),_(t)}else{const t=s.some((t=>M(t,"selected")));for(const t of d)c.has(t)?E(t,"selected"):M(t,"selected")||E(t,"unselected");!t&&i&&m(s),y(e)}o&&l.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:o,data:{data:d.filter((t=>M(t,"selected"))).map(n)}}))})(t,e,a):S()};t.addEventListener("click",A);const T=t=>{const{nativeEvent:e,data:r}=t;if(e)return;const i=o?r.data.slice(0,1):r.data;for(const t of i){const e=uH(d,t,n);A({target:e,nativeEvent:!1})}},O=()=>{S(!1)};return l.on("element:select",T),l.on("element:unselect",O),()=>{for(const t of d)v(t);t.removeEventListener("click",A),l.off("element:select",T),l.off("element:unselect",O)}}function mH(t){var{createGroup:e,background:n=!1,link:r=!1}=t,i=o(t,["createGroup","background","link"]);return(t,o,a)=>{const{container:s,view:c,options:l}=t,{coordinate:u,scale:f}=c;return gH(qV(s),Object.assign({elements:XV,datum:tH(c),groupKey:e?e(c):void 0,coordinate:u,scale:f,state:rH(l,[["selected",n?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:n,link:r,emitter:a},i))}}function vH(t){return mH(Object.assign(Object.assign({},t),{createGroup:JV}))}function yH(t){return mH(Object.assign(Object.assign({},t),{createGroup:QV}))}function _H(t){var{wait:e=20,leading:n,trailing:r=!1,labelFormatter:i=(t=>`${t}`)}=t,a=o(t,["wait","leading","trailing","labelFormatter"]);return t=>{const{view:o,container:c,update:l,setState:u}=t,{markState:f,scale:d,coordinate:h}=o,p=function(t,e,n){const[r]=Array.from(t.entries()).filter((([t])=>t.type===e)).map((([t])=>{const{encode:e}=t;return Object.fromEntries(n.map((t=>{const n=e[t];return[t,n?n.value:void 0]})))}));return r}(f,"line",["x","y","series"]);if(!p)return;const{y:g,x:m,series:v=[]}=p,y=g.map(((t,e)=>e)),_=Ru(y.map((t=>m[t]))),b=qV(c),E=c.getElementsByClassName(rl),x=Mu(c.getElementsByClassName(sl),(t=>t.__data__.key.split("-")[0])),M=new Ps({style:Object.assign({x1:0,y1:0,x2:0,y2:b.getAttribute("height"),stroke:"black",lineWidth:1},cf(a,"rule"))}),S=new ks({style:Object.assign({x:0,y:b.getAttribute("height"),text:"",fontSize:10},cf(a,"label"))});M.append(S),b.appendChild(M);const A=(t,e,n)=>{const[r]=t.invert(n),i=e.invert(r);return _[pu(_,i)]},T=(t,e)=>{M.setAttribute("x1",t[0]),M.setAttribute("x2",t[0]),S.setAttribute("text",i(e))};let O;const R=Ye((t=>{const e=KV(b,t);e&&(t=>{const{scale:e,coordinate:n}=O,{x:r,y:i}=e,o=A(n,r,t);T(t,o);for(const t of E){const{seriesIndex:e,key:r}=t.__data__,a=e[cu((t=>m[+t])).center(e,o)],s=[0,i.map(1)],c=[0,i.map(g[a]/g[e[0]])],[,l]=n.map(s),[,u]=n.map(c),f=l-u;t.setAttribute("transform",`translate(0, ${f})`);const d=x.get(r)||[];for(const t of d)t.setAttribute("dy",f)}})(e)}),e,{leading:n,trailing:r});return(t=>{s(this,void 0,void 0,(function*(){const{x:e}=d,n=A(h,e,t);T(t,n),u("chartIndex",(t=>{const e=We({},t),r=e.marks.find((t=>"line"===t.type)),i=ju(Au(y,(t=>ju(t,(t=>+g[t]))/Wu(t,(t=>+g[t]))),(t=>v[t])).values());We(r,{scale:{y:{domain:[1/i,i]}}});const o=function(t){const{transform:e=[]}=t,n=e.find((t=>"normalizeY"===t.type));if(n)return n;const r={type:"normalizeY"};return e.push(r),t.transform=e,r}(r);o.groupBy="color",o.basis=(t,e)=>e[t[cu((t=>m[+t])).center(t,n)]];for(const t of e.marks)t.animate=!1;return e}));const r=yield l();O=r.view}))})([0,0]),b.addEventListener("pointerenter",R),b.addEventListener("pointermove",R),b.addEventListener("pointerleave",R),()=>{M.remove(),b.removeEventListener("pointerenter",R),b.removeEventListener("pointermove",R),b.removeEventListener("pointerleave",R)}}}function bH({wait:t=30,leading:e,trailing:n=!1}){return r=>{const{options:i,update:o,setState:a,container:s}=r,c=qV(s),l=Ye((t=>{const e=KV(c,t);if(!e)return a("fisheye"),void o();a("fisheye",(t=>{const n=We({},t,{interaction:{tooltip:{preserve:!0}}});for(const t of n.marks)t.animate=!1;const[r,i]=e,o=function(t){const{coordinate:e={}}=t,{transform:n=[]}=e,r=n.find((t=>"fisheye"===t.type));if(r)return r;const i={type:"fisheye"};return n.push(i),e.transform=n,t.coordinate=e,i}(n);return o.focusX=r,o.focusY=i,o.visual=!0,n})),o()}),t,{leading:e,trailing:n});return c.addEventListener("pointerenter",l),c.addEventListener("pointermove",l),c.addEventListener("pointerleave",l),()=>{c.removeEventListener("pointerenter",l),c.removeEventListener("pointermove",l),c.removeEventListener("pointerleave",l)}}}function EH(t,e,n,r,i,o,a,s={}){const c=new Zy({className:"tooltip",style:{x:e,y:n,container:a,data:[],bounding:o,position:r,enterable:i,title:"",offset:[10,10],template:{prefixCls:"g2-"},style:We({".g2-tooltip":{},".g2-tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}},s)}});return t.appendChild(c.HTMLTooltipElement),c}function xH({root:t,data:e,x:n,y:r,render:i,event:o,single:a,position:s="right-bottom",enterable:c=!1,css:l,mount:u,bounding:f}){const d=t.getRootNode().defaultView.getConfig().container,h=function(t,e){return e?"string"==typeof e?document.querySelector(e):e:t.getRootNode().defaultView.getConfig().container}(t,u),p=a?d:t,g=f||function(t){const e=t.getBounds(),{min:[n,r],max:[i,o]}=e;return{x:n,y:r,width:i-n,height:o-r}}(t),m=function(t,e){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return{x:n.x-r.x,y:n.y-r.y}}(d,h),{tooltipElement:v=EH(h,n,r,s,c,g,m,l)}=p,{items:y,title:_=""}=e;v.update(Object.assign({x:n,y:r,data:y,title:_,position:s,enterable:c},void 0!==i&&{content:i(o,{items:y,title:_})})),p.tooltipElement=v}function MH({root:t,single:e,emitter:n,nativeEvent:r=!0}){r&&n.emit("tooltip:hide",{nativeEvent:r});const i=t.getRootNode().defaultView.getConfig().container,o=e?i:t,{tooltipElement:a}=o;a&&a.hide()}function SH({root:t,single:e}){const n=t.getRootNode().defaultView.getConfig().container,r=e?n:t;if(!r)return;const{tooltipElement:i}=r;i&&(i.destroy(),r.tooltipElement=void 0)}function AH(t){const{value:e}=t;return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function TH(t){const e=t.getAttribute("fill"),n=t.getAttribute("stroke"),{__data__:r}=t,{color:i=(e&&"transparent"!==e?e:n)}=r;return i}function OH(t,e=(t=>t)){const n=new Map(t.map((t=>[e(t),t])));return Array.from(n.values())}function RH(t,e,n,r=t.map((t=>t.__data__)),i={}){const a=t=>t instanceof Date?+t:t,s=OH(r.map((t=>t.title)),a).filter(af),c=r.flatMap(((r,a)=>{const s=t[a],{items:c=[],title:l}=r,u=c.filter(af),f=void 0!==n?n:c.length<=1;return u.map((t=>{var{color:n=TH(s)||i.color,name:a}=t,c=o(t,["color","name"]);const u=function(t,e){const{color:n,series:r,facet:i=!1}=t,{color:o,series:a}=e,s=t=>t&&t.invert&&!(t instanceof Bh)&&!(t instanceof Uh);if(s(r))return r.clone().invert(a);if(a&&r instanceof Bh&&r.invert(a)!==o&&!i)return r.invert(a);if(s(n)){const t=n.invert(o);return Array.isArray(t)?null:t}return null}(e,r),d=f?u||a:a||u;return Object.assign(Object.assign({},c),{color:n,name:d||l})}))})).map(AH);return Object.assign(Object.assign({},s.length>0&&{title:s.join(",")}),{items:OH(c,(t=>`(${a(t.name)}, ${a(t.value)}, ${a(t.color)})`))})}function PH(t,e,n){var{plotWidth:r,plotHeight:i,mainWidth:a,mainHeight:s,startX:c,startY:l,transposed:u,polar:f,insetLeft:d,insetTop:h}=n,p=o(n,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const g=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},p),m=e.map((t=>t[1])),v=e.map((t=>t[0])),y=$u(m),_=$u(v),[b,E,x,M]=(()=>{if(f){const t=Math.min(a,s)/2,e=c+d+a/2,n=l+h+s/2,r=Eb(yb([_,y],[e,n]));return[e,e+t*Math.cos(r),n,n+t*Math.sin(r)]}return u?[c,c+r,y+l,y+l]:[_+c,_+c,l,l+i]})();if(v.length>0){const e=t.ruleY||(()=>{const e=new Ps({style:Object.assign({x1:b,x2:E,y1:x,y2:M},g)});return t.appendChild(e),e})();e.style.x1=b,e.style.x2=E,e.style.y1=x,e.style.y2=M,t.ruleY=e}}function CH(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function wH(t){t.markers&&(t.markers.forEach((t=>t.remove())),t.markers=[])}function NH(t,e){return Array.from(t.values()).some((t=>{var n;return null===(n=t.interaction)||void 0===n?void 0:n[e]}))}function IH(t,e){return void 0===t?e:t}function kH(t){const{title:e,items:n}=t;return 0===n.length&&void 0===e}function LH(t,e){var{elements:n,sort:r,filter:i,scale:a,coordinate:s,crosshairs:c,render:l,groupName:u,emitter:f,wait:d=50,leading:h=!0,trailing:p=!1,startX:g=0,startY:m=0,body:v=!0,single:y=!0,position:_,enterable:b,mount:E,bounding:x,theme:M,disableNative:S=!1,marker:A=!0,preserve:T=!1,style:O={},css:R={}}=e,P=o(e,["elements","sort","filter","scale","coordinate","crosshairs","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","theme","disableNative","marker","preserve","style","css"]);const C=n(t),w=Jy(s),N=t_(s),I=We(O,P),{innerWidth:k,innerHeight:L,width:D,height:B,insetLeft:F,insetTop:U}=s.getOptions(),j=[],G=[];for(const t of C){const{__data__:e}=t,{seriesX:n,title:r,items:i}=e;n?j.push(t):(r||i)&&G.push(t)}const W=!!(w?a.y:a.x).getBandWidth&&G.length>0;j.sort(((t,e)=>{const n=w?0:1,r=t=>t.getBounds().min[n];return w?r(e)-r(t):r(t)-r(e)}));const z=t=>{const e=w?1:0,{min:n,max:r}=t.getLocalBounds();return Ru([n[e],r[e]])};G.sort(((t,e)=>{const[n,r]=z(t),[i,o]=z(e),a=(n+r)/2,s=(i+o)/2;return w?s-a:a-s}));const V=new Map(j.map((t=>{const{__data__:e}=t,{seriesX:n}=e;return[t,[Ru(n.map(((t,e)=>e)),(t=>n[+t])),n]]}))),{x:H}=a,X=(null==H?void 0:H.getBandWidth)?H.getBandWidth()/2:0,Y=t=>{const[e]=s.invert(t);return e-X},$=(t,e,n)=>{const r=Y(t),[i,o]=Ru([n[0],n[n.length-1]]);if(!W&&(r<i||r>o))return null;const a=cu((t=>n[+t])).center;return e[a(e,r)]},q=(t,e)=>{const{__data__:n}=t;return Object.fromEntries(Object.entries(n).filter((([t])=>t.startsWith("series")&&"series"!==t)).map((([t,n])=>{const r=n[e];return[Ne(t.replace("series","")),r]})))},K=Ye((e=>{const n=KV(t,e);if(!n)return;const o=t.getRenderBounds(),d=o.min[0],h=o.min[1],p=[n[0]-g,n[1]-m];if(!p)return;const S=((t,e)=>{const n=t[w?1:0],r=e.filter((t=>{const[e,r]=z(t);return n>=e&&n<=r}));if(!W||r.length>0)return r;const i=cu((t=>{const[e,n]=z(t);return(e+n)/2})).center;return[e[i(e,n)]].filter(af)})(p,G),T=[],O=[];for(const t of j){const[e,n]=V.get(t),r=$(p,e,n);if(null!==r){T.push(t);const e=q(t,r),{x:n,y:i}=e,o=s.map([(n||0)+X,i||0]);O.push([Object.assign(Object.assign({},e),{element:t}),o])}}const P=Array.from(new Set(O.map((t=>t[0].x)))),C=P[zu(P,(t=>Math.abs(t-Y(p))))],H=O.filter((t=>t[0].x===C)),K=[...H.map((t=>t[0])),...S.map((t=>t.__data__))],Q=[...T,...S],J=RH(Q,a,u,K,M);if(r&&J.items.sort(((t,e)=>r(t)-r(e))),i&&(J.items=J.items.filter(i)),0===Q.length||kH(J))Z();else{if(v&&xH({root:t,data:J,x:n[0]+d,y:n[1]+h,render:l,event:e,single:y,position:_,enterable:b,mount:E,bounding:x,css:R}),c){const e=H.map((t=>t[1])),n=cf(I,"crosshairs");PH(t,e,Object.assign(Object.assign({},n),{plotWidth:k,plotHeight:L,mainWidth:D,mainHeight:B,insetLeft:F,insetTop:U,startX:g,startY:m,transposed:w,polar:N}))}if(A){const e=cf(I,"marker");!function(t,{data:e,style:n,theme:r}){t.markers&&t.markers.forEach((t=>t.remove()));const i=e.filter((t=>{const[{x:e,y:n}]=t;return af(e)&&af(n)})).map((t=>{const[{color:e,element:i},o]=t,a=e||i.style.fill||i.style.stroke||r.color;return new Ms({style:Object.assign({cx:o[0],cy:o[1],fill:a,r:4,stroke:"#fff",strokeWidth:2},n)})}));for(const e of i)t.appendChild(e);t.markers=i}(t,{data:H,style:e,theme:M})}f.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:{data:{x:Ub(a.x,Y(p),!0)}}}))}}),d,{leading:h,trailing:p}),Z=()=>{MH({root:t,single:y,emitter:f}),c&&CH(t),A&&wH(t)},Q=()=>{SH({root:t,single:y}),c&&CH(t),A&&wH(t)},J=({nativeEvent:e,data:n})=>{if(e)return;const{x:r}=n.data,{x:i}=a,o=i.map(r),[c,l]=s.map([o,.5]),{min:[u,f]}=t.getRenderBounds();K({offsetX:c+u,offsetY:l+f})},tt=()=>{MH({root:t,single:y,emitter:f,nativeEvent:!1})},et=()=>{it(),Q()},nt=()=>{rt()},rt=()=>{S||(t.addEventListener("pointerenter",K),t.addEventListener("pointermove",K),t.addEventListener("pointerleave",Z))},it=()=>{S||(t.removeEventListener("pointerenter",K),t.removeEventListener("pointermove",K),t.removeEventListener("pointerleave",Z))};return rt(),f.on("tooltip:show",J),f.on("tooltip:hide",tt),f.on("tooltip:disable",et),f.on("tooltip:enable",nt),()=>{it(),f.off("tooltip:show",J),f.off("tooltip:hide",tt),f.off("tooltip:disable",et),f.off("tooltip:enable",nt),T?MH({root:t,single:y,emitter:f,nativeEvent:!1}):Q()}}function DH(t,{elements:e,scale:n,render:r,groupName:i,sort:a,filter:s,emitter:c,wait:l=50,leading:u=!0,trailing:f=!1,groupKey:d=(t=>t),single:h=!0,position:p,enterable:g,datum:m,view:v,mount:y,bounding:_,theme:b,shared:E=!1,body:x=!0,disableNative:M=!1,preserve:S=!1,css:A={}}){const T=e(t),O=new Set(T),R=Mu(T,d),P=Ye((e=>{const{target:l}=e;if(!O.has(l))return void MH({root:t,single:h,emitter:c});const u=d(l),f=R.get(u),m=1!==f.length||E?RH(f,n,i,void 0,b):function(t){const{__data__:e}=t,{title:n,items:r=[]}=e,i=r.filter(af).map((e=>{var{color:n=TH(t)}=e,r=o(e,["color"]);return Object.assign(Object.assign({},r),{color:n})})).map(AH);return Object.assign(Object.assign({},n&&{title:n}),{items:i})}(f[0]);if(a&&m.items.sort(((t,e)=>a(t)-a(e))),s&&(m.items=m.items.filter(s)),kH(m))return void MH({root:t,single:h,emitter:c});const{offsetX:M,offsetY:S}=e;x&&xH({root:t,data:m,x:M,y:S,render:r,event:e,single:h,position:p,enterable:g,mount:y,bounding:_,css:A}),c.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:{data:cL(l,v)}}))}),l,{leading:u,trailing:f}),C=e=>{const{target:n}=e;O.has(n)&&MH({root:t,single:h,emitter:c})},w=()=>{M||(t.addEventListener("pointerover",P),t.addEventListener("pointermove",P),t.addEventListener("pointerout",C))},N=()=>{M||(t.removeEventListener("pointerover",P),t.removeEventListener("pointermove",P),t.removeEventListener("pointerout",C)),SH({root:t,single:h})},I=({nativeEvent:t,data:e})=>{if(t)return;const n=uH(T,e.data,m);if(!n)return;const r=n.getBBox(),{x:i,y:o,width:a,height:s}=r;P({target:n,offsetX:i+a/2,offsetY:o+s/2})},k=({nativeEvent:e}={})=>{e||MH({root:t,single:h,emitter:c,nativeEvent:!1})};return c.on("tooltip:show",I),c.on("tooltip:hide",k),c.on("tooltip:enable",(()=>{w()})),c.on("tooltip:disable",(()=>{N(),SH({root:t,single:h})})),w(),()=>{N(),c.off("tooltip:show",I),c.off("tooltip:hide",k),S?MH({root:t,single:h,emitter:c,nativeEvent:!1}):SH({root:t,single:h})}}function BH(t){const{shared:e,crosshairs:n,series:r,name:i,item:a=(()=>({})),facet:s=!1}=t,c=o(t,["shared","crosshairs","series","name","item","facet"]);return(t,i,o)=>{const{container:l,view:u}=t,{scale:f,markState:d,coordinate:h,theme:p}=u,g=NH(d,"seriesTooltip"),m=NH(d,"crosshairs"),v=qV(l),y=IH(r,g);if(y&&function(t){return Array.from(t.values()).some((t=>{var e;return(null===(e=t.interaction)||void 0===e?void 0:e.seriesTooltip)&&t.tooltip}))}(d)&&!s)return LH(v,Object.assign(Object.assign({},c),{theme:p,elements:XV,scale:f,coordinate:h,crosshairs:IH(n,m),item:a,emitter:o}));if(y&&s){const e=i.filter((e=>e!==t&&e.options.parentKey===t.options.key)),r=YV(t,i),s=e[0].view.scale,l=v.getBounds(),u=l.min[0],f=l.min[1];return Object.assign(s,{facet:!0}),LH(v.parentNode.parentNode,Object.assign(Object.assign({},c),{theme:p,elements:()=>r,scale:s,coordinate:h,crosshairs:IH(n,m),item:a,startX:u,startY:f,emitter:o}))}return DH(v,Object.assign(Object.assign({},c),{datum:tH(u),elements:XV,scale:f,coordinate:h,groupKey:e?JV(u):void 0,item:a,emitter:o,view:u,theme:p,shared:e}))}}const FH="legend-category",UH="legend-continuous",jH="items-item",GH="legend-category-item-marker",WH="legend-category-item-label";function zH(t){return t.getElementsByClassName(GH)[0]}function VH(t){return t.getElementsByClassName(WH)[0]}function HH(t){return t.getElementsByClassName(jH)}function XH(t){return t.getElementsByClassName(FH)}function YH(t){return t.getElementsByClassName(UH)}function $H(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function qH(t,{legend:e,channel:n,value:r,ordinal:i,channels:o,allChannels:a,facet:c=!1}){return s(this,void 0,void 0,(function*(){const{view:s,update:l,setState:u}=t;u(e,(t=>{const{marks:e}=t,l=e.map((t=>{if("legends"===t.type)return t;const{transform:e=[]}=t,l=e.findIndex((({type:t})=>t.startsWith("group")||t.startsWith("bin"))),u=[...e];u.splice(l+1,0,{type:"filter",[n]:{value:r,ordinal:i}});const f=Object.fromEntries(o.map((t=>[t,{domain:s.scale[t].getOptions().domain}])));return We({},t,Object.assign(Object.assign({transform:u,scale:f},!i&&{animate:!1}),{legend:!c&&Object.fromEntries(a.map((t=>[t,{preserve:!0}])))}))}));return Object.assign(Object.assign({},t),{marks:l})})),yield l()}))}function KH(t,e){for(const n of t)qH(n,Object.assign(Object.assign({},e),{facet:!0}))}function ZH(){return(t,e,n)=>{const{container:r}=t,i=e.filter((e=>e!==t)),o=i.length>0,a=t=>$H(t).scales.map((t=>t.name)),c=[...XH(r),...YH(r)],l=c.flatMap(a),u=Ye(o?KH:qH,50,{trailing:!0}),f=c.map((e=>{const{name:c,domain:f}=$H(e).scales[0],d={legend:e,channel:c,channels:a(e),allChannels:l};return e.className===FH?function(t,{legends:e,marker:n,label:r,datum:i,filter:o,emitter:a,channel:c,state:l={}}){const u=new Map,f=new Map,d=new Map,{unselected:h={markerStroke:"#aaa",markerFill:"#aaa",labelFill:"#aaa"}}=l,p={unselected:cf(h,"marker")},g={unselected:cf(h,"label")},{setState:m,removeState:v}=eH(p,void 0),{setState:y,removeState:_}=eH(g,void 0),b=Array.from(e(t));let E=b.map(i);const x=()=>{for(const t of b){const e=i(t),o=n(t),a=r(t);E.includes(e)?(v(o,"unselected"),_(a,"unselected")):(m(o,"unselected"),y(a,"unselected"))}};for(const e of b){const n=()=>{cH(t,"pointer")},r=()=>{lH(t)},l=t=>s(this,void 0,void 0,(function*(){const n=i(e),r=E.indexOf(n);-1===r?E.push(n):E.splice(r,1),0===E.length&&E.push(...b.map(i)),yield o(E),x();const{nativeEvent:s=!0}=t;s&&(E.length===b.length?a.emit("legend:reset",{nativeEvent:s}):a.emit("legend:filter",Object.assign(Object.assign({},t),{nativeEvent:s,data:{channel:c,values:E}})))}));e.addEventListener("click",l),e.addEventListener("pointerenter",n),e.addEventListener("pointerout",r),u.set(e,l),f.set(e,n),d.set(e,r)}const M=t=>s(this,void 0,void 0,(function*(){const{nativeEvent:e}=t;if(e)return;const{data:n}=t,{channel:r,values:i}=n;r===c&&(E=i,yield o(E),x())})),S=t=>s(this,void 0,void 0,(function*(){const{nativeEvent:e}=t;e||(E=b.map(i),yield o(E),x())}));return a.on("legend:filter",M),a.on("legend:reset",S),()=>{for(const t of b)t.removeEventListener("click",u.get(t)),t.removeEventListener("pointerenter",f.get(t)),t.removeEventListener("pointerout",d.get(t)),a.off("legend:filter",M),a.off("legend:reset",S)}}(r,{legends:HH,marker:zH,label:VH,datum:t=>{const{__data__:e}=t,{index:n}=e;return f[n]},filter:e=>{const n=Object.assign(Object.assign({},d),{value:e,ordinal:!0});u(o?i:t,n)},state:e.attributes.state,channel:c,emitter:n}):function(t,{legend:e,filter:n,emitter:r,channel:i}){const o=({detail:{value:t}})=>{n(t),r.emit({nativeEvent:!0,data:{channel:i,values:t}})};return e.addEventListener("valuechange",o),()=>{e.removeEventListener("valuechange",o)}}(0,{legend:e,filter:e=>{const n=Object.assign(Object.assign({},d),{value:e,ordinal:!1});u(o?i:t,n)},emitter:n,channel:c})}));return()=>{f.forEach((t=>t()))}}}function QH(){return(t,e,n)=>{const{container:r,view:i,options:o}=t,a=XH(r),s=XV(r),c=t=>$H(t).scales[0].name,l=t=>{const{scale:{[t]:e}}=i;return e},u=rH(o,["active","inactive"]),f=iH(s,tH(i)),d=[];for(const t of a){const e=e=>{const{data:n}=t.attributes,{__data__:r}=e,{index:i}=r;return n[i].label},r=c(t),i=HH(t),o=l(r),a=Mu(s,(t=>o.invert(t.__data__[r]))),{state:h={}}=t.attributes,{inactive:p={}}=h,{setState:g,removeState:m}=eH(u,f),v={inactive:cf(p,"marker")},y={inactive:cf(p,"label")},{setState:_,removeState:b}=eH(v),{setState:E,removeState:x}=eH(y),M=t=>{for(const e of i){const n=zH(e),r=VH(e);e===t||null===t?(b(n,"inactive"),x(r,"inactive")):(_(n,"inactive"),E(r,"inactive"))}},S=(t,i)=>{const o=e(i),c=new Set(a.get(o));for(const t of s)c.has(t)?g(t,"active"):g(t,"inactive");M(i);const{nativeEvent:l=!0}=t;l&&n.emit("legend:highlight",Object.assign(Object.assign({},t),{nativeEvent:l,data:{channel:r,value:o}}))},A=new Map;for(const t of i){const e=e=>{S(e,t)};t.addEventListener("pointerover",e),A.set(t,e)}const T=t=>{for(const t of s)m(t,"inactive","active");M(null);const{nativeEvent:e=!0}=t;e&&n.emit("legend:unhighlight",{nativeEvent:e})},O=t=>{const{nativeEvent:n,data:o}=t;if(n)return;const{channel:a,value:s}=o;if(a!==r)return;const c=i.find((t=>e(t)===s));c&&S({nativeEvent:!1},c)},R=t=>{const{nativeEvent:e}=t;e||T({nativeEvent:!1})};t.addEventListener("pointerleave",T),n.on("legend:highlight",O),n.on("legend:unhighlight",R);const P=()=>{t.removeEventListener(T),n.off("legend:highlight",O),n.off("legend:unhighlight",R);for(const[t,e]of A)t.removeEventListener(e)};d.push(P)}return()=>d.forEach((t=>t()))}}function JH(t,e){const[n,r,i,o]=t,[a,s,c,l]=e;return!(a>i||c<n||s>o||l<r)}function tX(t){const{width:e,height:n}=t.getBBox();return[0,0,e,n]}function eX(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}const nX=$A((t=>{const e=t.attributes,{x:n,y:r,width:i,height:a,class:s,renders:c={},handleSize:l=10,document:u}=e,f=o(e,["x","y","width","height","class","renders","handleSize","document"]);if(!u||void 0===i||void 0===a||void 0===n||void 0===r)return;const d=l/2,h=(t,e,n)=>{t.handle||(t.handle=n.createElement("rect"),t.append(t.handle));const{handle:r}=t;return r.attr(e),r},p=cf(uf(f,"handleNW","handleNE"),"handleN"),{render:g=h}=p,m=o(p,["render"]),v=cf(f,"handleE"),{render:y=h}=v,_=o(v,["render"]),b=cf(uf(f,"handleSE","handleSW"),"handleS"),{render:E=h}=b,x=o(b,["render"]),M=cf(f,"handleW"),{render:S=h}=M,A=o(M,["render"]),T=cf(f,"handleNW"),{render:O=h}=T,R=o(T,["render"]),P=cf(f,"handleNE"),{render:C=h}=P,w=o(P,["render"]),N=cf(f,"handleSE"),{render:I=h}=N,k=o(N,["render"]),L=cf(f,"handleSW"),{render:D=h}=L,B=o(L,["render"]),F=t=>()=>{const e=$A((e=>((t,e)=>{const{id:n}=t,r=o(t.attributes,["x","y"]),i=e(t,Object.assign({x:0,y:0},r),u);i.id=n,i.style.draggable=!0})(e,t)));return new e({})},U=gf(t).attr("className",s).style("x",n).style("y",r).style("draggable",!0);U.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(eX,Object.assign({width:i,height:a},uf(f,"handle"))),U.maybeAppend("handle-n",F(g)).style("x",d).style("y",-d).style("width",i-l).style("height",l).style("fill","transparent").call(eX,m),U.maybeAppend("handle-e",F(y)).style("x",i-d).style("y",d).style("width",l).style("height",a-l).style("fill","transparent").call(eX,_),U.maybeAppend("handle-s",F(E)).style("x",d).style("y",a-d).style("width",i-l).style("height",l).style("fill","transparent").call(eX,x),U.maybeAppend("handle-w",F(S)).style("x",-d).style("y",d).style("width",l).style("height",a-l).style("fill","transparent").call(eX,A),U.maybeAppend("handle-nw",F(O)).style("x",-d).style("y",-d).style("width",l).style("height",l).style("fill","transparent").call(eX,R),U.maybeAppend("handle-ne",F(C)).style("x",i-d).style("y",-d).style("width",l).style("height",l).style("fill","transparent").call(eX,w),U.maybeAppend("handle-se",F(I)).style("x",i-d).style("y",a-d).style("width",l).style("height",l).style("fill","transparent").call(eX,k),U.maybeAppend("handle-sw",F(D)).style("x",-d).style("y",a-d).style("width",l).style("height",l).style("fill","transparent").call(eX,B)}));function rX(t,e){var{brushed:n=(()=>{}),brushended:r=(()=>{}),brushcreated:i=(()=>{}),brushstarted:a=(()=>{}),brushupdated:s=(()=>{}),extent:c=tX(t),brushRegion:l=((t,e,n,r,i)=>[t,e,n,r]),reverse:u=!1,fill:f="#777",fillOpacity:d="0.3",stroke:h="#fff",selectedHandles:p=["handle-n","handle-e","handle-s","handle-w","handle-nw","handle-ne","handle-se","handle-sw"]}=e,g=o(e,["brushed","brushended","brushcreated","brushstarted","brushupdated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let m=null,v=null,y=null,_=null,b=null,E=!1;const[x,M,S,A]=c;cH(t,"crosshair"),t.style.draggable=!0;const T=(t,e,n)=>{if(a(n),_&&_.remove(),b&&b.remove(),m=[t,e],u)return O();R()},O=()=>{b=new Cs({style:Object.assign(Object.assign({},g),{fill:f,fillOpacity:d,stroke:h,pointerEvents:"none"})}),_=new nX({style:{x:0,y:0,width:0,height:0,draggable:!0,document:t.ownerDocument},className:"mask"}),t.appendChild(b),t.appendChild(_)},R=()=>{_=new nX({style:Object.assign(Object.assign({document:t.ownerDocument,x:0,y:0},g),{fill:f,fillOpacity:d,stroke:h,draggable:!0}),className:"mask"}),t.appendChild(_)},P=(t=!0)=>{_&&_.remove(),b&&b.remove(),m=null,v=null,y=null,E=!1,_=null,b=null,r(t)},C=(t,e,r=!0)=>{const[i,o,a,s]=function(t,e,n,r,i){const[o,a,s,c]=i;return[Math.max(o,Math.min(t,n)),Math.max(a,Math.min(e,r)),Math.min(s,Math.max(t,n)),Math.min(c,Math.max(e,r))]}(t[0],t[1],e[0],e[1],c),[f,d,h,p]=l(i,o,a,s,c);return u?N(f,d,h,p):w(f,d,h,p),n(f,d,h,p,r),[f,d,h,p]},w=(t,e,n,r)=>{_.style.x=t,_.style.y=e,_.style.width=n-t,_.style.height=r-e},N=(t,e,n,r)=>{b.style.d=`\n M${x},${M}L${S},${M}L${S},${A}L${x},${A}Z\n M${t},${e}L${t},${r}L${n},${r}L${n},${e}Z\n `,_.style.x=t,_.style.y=e,_.style.width=n-t,_.style.height=r-e},I={"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"}},k=t=>D(t)||L(t),L=t=>{const{id:e}=t;return-1!==p.indexOf(e)&&new Set(Object.keys(I)).has(e)},D=t=>t===_.getElementById("selection"),B=e=>{const{target:n}=e,[r,i]=ZV(t,e);if(!_||!k(n))return T(r,i,e),void(E=!0);k(n)&&(y=[r,i])},F=e=>{const{target:n}=e,r=ZV(t,e);if(!m)return;if(!y)return C(m,r);if(D(n))return(t=>{const e=(t,e,n,r,i)=>t+e<r?r-e:t+n>i?i-n:t,n=t[0]-y[0],r=t[1]-y[1],i=e(n,m[0],v[0],x,S),o=e(r,m[1],v[1],M,A),a=[m[0]+i,m[1]+o],s=[v[0]+i,v[1]+o];C(a,s)})(r);const[i,o]=[r[0]-y[0],r[1]-y[1]],{id:a}=n;if(I[a]){const[t,e,n,r]=I[a].vector;return C([m[0]+i*t,m[1]+o*e],[v[0]+i*n,v[1]+o*r])}},U=e=>{if(y){y=null;const{x:t,y:n,width:r,height:i}=_.style;return m=[t,n],v=[t+r,n+i],void s(t,n,t+r,n+i,e)}v=ZV(t,e);const[n,r,o,a]=C(m,v);E=!1,i(n,r,o,a,e)},j=t=>{const{target:e}=t;_&&!k(e)&&P()},G=e=>{const{target:n}=e;_&&k(n)&&!E?D(n)?cH(t,"move"):L(n)&&cH(t,I[n.id].cursor):cH(t,"crosshair")},W=()=>{cH(t,"default")};return t.addEventListener("dragstart",B),t.addEventListener("drag",F),t.addEventListener("dragend",U),t.addEventListener("click",j),t.addEventListener("pointermove",G),t.addEventListener("pointerleave",W),{mask:_,move(t,e,n,r,i=!0){_||T(t,e,{}),m=[t,e],v=[n,r],C([t,e],[n,r],i)},remove(t=!0){_&&P(t)},destroy(){_&&P(!1),cH(t,"default"),t.removeEventListener("dragstart",B),t.removeEventListener("drag",F),t.removeEventListener("dragend",U),t.removeEventListener("click",j),t.removeEventListener("pointermove",G),t.removeEventListener("pointerleave",W)}}}function iX(t,e,n){return e.filter((e=>{if(e===t)return!1;const{interaction:r={}}=e.options;return Object.values(r).find((t=>t.brushKey===n))}))}function oX(t,e,n){return iX(t,e,n).map((t=>t.options))}function aX(t,e){var{elements:n,selectedHandles:r,siblings:i=(t=>[]),datum:a,brushRegion:s,extent:c,reverse:l,scale:u,coordinate:f,series:d=!1,key:h=(t=>t),bboxOf:p=(t=>{const{x:e,y:n,width:r,height:i}=t.style;return{x:e,y:n,width:r,height:i}}),state:g={},emitter:m}=e,v=o(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const y=n(t),_=i(t),b=_.flatMap(n),E=iH(y,a),x=cf(v,"mask"),{setState:M,removeState:S}=eH(g,E),A=new Map,{width:T,height:O,x:R=0,y:P=0}=p(t),C=c||[0,0,T,O],w=()=>{for(const t of[...y,...b])S(t,"active","inactive")},N=(t,e,n,r)=>{var i;for(const t of _)null===(i=t.brush)||void 0===i||i.remove();const o=new Set;for(const i of y){const{min:a,max:s}=i.getLocalBounds(),[c,l]=a,[u,f]=s;JH([c,l,u,f],[t,e,n,r])?(M(i,"active"),o.add(h(i))):M(i,"inactive")}for(const t of b)o.has(h(t))?M(t,"active"):M(t,"inactive")},I=()=>{for(const t of y)S(t,"inactive");for(const t of A.values())t.remove();A.clear()},k=(t,e,n,r)=>{const i=t=>{const e=t.cloneNode();return e.__data__=t.__data__,t.parentNode.appendChild(e),A.set(t,e),e};for(const o of y){const a=A.get(o)||i(o);a.style.clipPath=new Is({style:{x:t+R,y:e+P,width:n-t,height:r-e}}),M(o,"inactive"),M(a,"active")}},L=rX(t,Object.assign(Object.assign({},x),{extent:C,brushRegion:s,reverse:l,selectedHandles:r,brushended:t=>{const e=d?I:w;t&&m.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{const o=Gb(t,e,n,r,u,f);i&&m.emit("brush:highlight",{nativeEvent:!0,data:{selection:o}});(d?k:N)(t,e,n,r)},brushcreated:(t,e,n,r,i)=>{const o=Gb(t,e,n,r,u,f);m.emit("brush:end",Object.assign(Object.assign({},i),{nativeEvent:!0,data:{selection:o}}))},brushupdated:(t,e,n,r,i)=>{const o=Gb(t,e,n,r,u,f);m.emit("brush:end",Object.assign(Object.assign({},i),{nativeEvent:!0,data:{selection:o}}))},brushstarted:t=>{m.emit("brush:start",t)}})),D=({nativeEvent:t,data:e})=>{if(t)return;const{selection:n}=e,[r,i,o,a]=function(t,e,n){const{x:r,y:i}=e,[o,a]=t,s=Wb(o,r),c=Wb(a,i),l=[s[0],c[0]],u=[s[1],c[1]],[f,d]=n.map(l),[h,p]=n.map(u);return[f,d,h,p]}(n,u,f);L.move(r,i,o,a,!1)};m.on("brush:highlight",D);const B=({nativeEvent:t}={})=>{t||L.remove(!1)};m.on("brush:remove",B);const F=L.destroy.bind(L);return L.destroy=()=>{m.off("brush:highlight",D),m.off("brush:remove",B),F()},L}function sX(t){var{facet:e,brushKey:n}=t,r=o(t,["facet","brushKey"]);return(t,i,o)=>{const{container:a,view:s,options:c}=t,l=qV(a),u={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",reverse:!1},f=["active",["inactive",{opacity:.5}]],{scale:d,coordinate:h}=s;if(e){const e=l.getBounds(),n=e.min[0],a=e.min[1],s=e.max[0],c=e.max[1];return aX(l.parentNode.parentNode,Object.assign(Object.assign({elements:()=>YV(t,i),datum:tH($V(t,i).map((t=>t.view))),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[n,a,s,c],state:rH($V(t,i).map((t=>t.options)),f),emitter:o,scale:d,coordinate:h,selectedHandles:void 0},u),r))}const p=aX(l,Object.assign(Object.assign({elements:XV,key:t=>t.__data__.key,siblings:()=>function(t,e,n){return iX(t,e,n).map((t=>qV(t.container)))}(t,i,n),datum:tH([s,...iX(t,i,n).map((t=>t.view))]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:rH([c,...oX(t,i,n)],f),emitter:o,scale:d,coordinate:h,selectedHandles:void 0},u),r));return l.brush=p,()=>p.destroy()}}function cX(t,e,n,r,i){const[,o,,a]=i;return[t,o,n,a]}function lX(t){return sX(Object.assign(Object.assign({},t),{brushRegion:cX,selectedHandles:["handle-e","handle-w"]}))}function uX(t,e,n,r,i){const[o,,a]=i;return[o,e,a,r]}function fX(t){return sX(Object.assign(Object.assign({},t),{brushRegion:uX,selectedHandles:["handle-n","handle-s"]}))}const dX="axis",hX="axis-line",pX="axis-main-group",gX="axis-hot-area";function mX(t){return t.getElementsByClassName(dX)}function vX(t){return t.getElementsByClassName(hX)[0]}function yX(t){return function(t){return t.getElementsByClassName(pX)[0]}(t).getLocalBounds()}function _X(t,e){var{cross:n,offsetX:r,offsetY:i}=e,a=o(e,["cross","offsetX","offsetY"]);const s=yX(t),c=vX(t),[l]=c.getLocalBounds().min,[u,f]=s.min,[d,h]=s.max,p=2*(d-u);return{brushRegion:uX,hotZone:new Is({className:gX,style:Object.assign({x:n?u:l-p/2,width:n?p/2:p,y:f,height:h-f},a)}),extent:n?(t,e,n,r)=>[-1/0,e,1/0,r]:(t,e,n,i)=>[Math.floor(u-r),e,Math.ceil(d-r),i]}}function bX(t,e){var{offsetY:n,offsetX:r,cross:i=!1}=e,a=o(e,["offsetY","offsetX","cross"]);const s=yX(t),c=vX(t),[,l]=c.getLocalBounds().min,[u,f]=s.min,[d,h]=s.max,p=h-f;return{brushRegion:cX,hotZone:new Is({className:gX,style:Object.assign({x:u,width:d-u,y:i?f:l-p,height:i?p:2*p},a)}),extent:i?(t,e,n,r)=>[t,-1/0,n,1/0]:(t,e,r,i)=>[t,Math.floor(f-n),r,Math.ceil(h-n)]}}function EX(t){return(e,n,r)=>{const{container:i,view:a,options:s}=e,c=qV(i),{x:l,y:u}=c.getBBox(),{coordinate:f}=a;return function(t,e){var{axes:n,elements:r,points:i,horizontal:a,datum:s,offsetY:c,offsetX:l,reverse:u=!1,state:f={},emitter:d,coordinate:h}=e,p=o(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const g=r(t),m=n(t),v=iH(g,s),{setState:y,removeState:_}=eH(f,v),b=new Map,E=cf(p,"mask"),x=t=>Array.from(b.values()).every((([e,n,r,i])=>t.some((([t,o])=>t>=e&&t<=r&&o>=n&&o<=i)))),M=m.map((t=>t.attributes.scale)),S=t=>t.length>2?[t[0],t[t.length-1]]:t,A=new Map,T=()=>{A.clear();for(let t=0;t<m.length;t++){const e=M[t],{domain:n}=e.getOptions();A.set(t,S(n))}};T();const O=(t,e)=>{const n=[];for(const t of g){const e=i(t);x(e)?(y(t,"active"),n.push(t)):y(t,"inactive")}A.set(t,P(n,t)),e&&d.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!C)return Array.from(A.values());const t=[];for(const[e,n]of A){const r=M[e],{name:i}=r.getOptions();"x"===i?t[0]=n:t[1]=n}return t})()}})},R=t=>{for(const t of g)_(t,"active","inactive");T(),t&&d.emit("brushAxis:remove",{nativeEvent:!0})},P=(t,e)=>{const n=M[e],{name:r}=n.getOptions(),i=t.map((t=>{const e=t.__data__;return n.invert(e[r])}));return S(jb(n,i))},C=m.some(a)&&m.some((t=>!a(t))),w=[];for(let t=0;t<m.length;t++){const e=m[t],n=a(e)?bX:_X,{hotZone:r,brushRegion:i,extent:o}=n(e,{offsetY:c,offsetX:l,cross:C,zIndex:999,fill:"transparent"});e.parentNode.appendChild(r);const s=rX(r,Object.assign(Object.assign({},E),{reverse:u,brushRegion:i,brushended(n){b.delete(e),0===Array.from(b.entries()).length?R(n):O(t,n)},brushed(n,r,i,a,s){b.set(e,o(n,r,i,a)),O(t,s)}}));w.push(s)}const N=(t={})=>{const{nativeEvent:e}=t;e||w.forEach((t=>t.remove(!1)))},I=(t,e,n)=>{const[r,i]=t,o=k(r,e,n),s=k(i,e,n)+(t=>t.getStep?t.getStep():0)(e);return a(n)?[o,-1/0,s,1/0]:[-1/0,o,1/0,s]},k=(t,e,n)=>{const{height:r,width:i}=h.getOptions(),o=e.clone();return a(n)?o.update({range:[0,i]}):o.update({range:[r,0]}),o.map(t)},L=t=>{const{nativeEvent:e}=t;if(e)return;const{selection:n}=t.data;for(let t=0;t<w.length;t++){const e=n[t],r=w[t],i=m[t];if(e){const n=M[t];r.move(...I(e,n,i),!1)}else r.remove(!1)}};return d.on("brushAxis:remove",N),d.on("brushAxis:highlight",L),()=>{w.forEach((t=>t.destroy())),d.off("brushAxis:remove",N),d.off("brushAxis:highlight",L)}}(i,Object.assign({elements:XV,axes:mX,offsetY:u,offsetX:l,points:t=>t.__data__.points,horizontal:t=>{const{startPos:[e,n],endPos:[r,i]}=t.attributes;return e!==r&&n===i},datum:tH(a),state:rH(s,["active",["inactive",{opacity:.5}]]),coordinate:f,emitter:r},t))}}function xX(t){var{hideX:e=!0,hideY:n=!0}=t,r=o(t,["hideX","hideY"]);return(t,i,a)=>{const{container:c,view:l,options:u,update:f,setState:d}=t,h=qV(c);let p=!1,g=!1,m=l;const{scale:v,coordinate:y}=l;return function(t,e){var{filter:n,reset:r,brushRegion:i,extent:a,reverse:s,emitter:c,scale:l,coordinate:u,selection:f,series:d=!1}=e;const h=cf(o(e,["filter","reset","brushRegion","extent","reverse","emitter","scale","coordinate","selection","series"]),"mask"),{width:p,height:g}=t.getBBox(),m=a||[0,0,p,g],v=function(t=300){let e=null;return n=>{const{timeStamp:r}=n;return null!==e&&r-e<t?(e=r,!0):(e=r,!1)}}(),y=rX(t,Object.assign(Object.assign({},h),{extent:m,brushRegion:i,reverse:s,brushcreated:function(t,e,r,i,o){o.nativeEvent=!0,n(f(t,e,r,i),o),y.remove()}}));function _(t){v(t)&&(t.nativeEvent=!0,r(t))}t.addEventListener("click",_);const b=({nativeEvent:t,data:e})=>{if(t)return;const{selection:r}=e;n(r,{nativeEvent:!1})};return c.on("brush:filter",b),()=>{y.destroy(),c.off("brush:filter",b),t.removeEventListener("click",_)}}(h,Object.assign(Object.assign({brushRegion:(t,e,n,r)=>[t,e,n,r],selection:(t,e,n,r)=>{const{scale:i,coordinate:o}=m;return Gb(t,e,n,r,i,o)},filter:(t,r)=>s(this,void 0,void 0,(function*(){if(g)return;g=!0;const[i,o]=t;d("brushFilter",(t=>{const{marks:r}=t,a=r.map((t=>We({axis:Object.assign(Object.assign({},e&&{x:{transform:[{type:"hide"}]}}),n&&{y:{transform:[{type:"hide"}]}})},t,{scale:{x:{domain:i,nice:!1},y:{domain:o,nice:!1}}})));return Object.assign(Object.assign({},u),{marks:a,clip:!0})})),a.emit("brush:filter",Object.assign(Object.assign({},r),{data:{selection:[i,o]}}));const s=yield f();m=s.view,g=!1,p=!0})),reset:t=>{if(g||!p)return;const{scale:e}=l,{x:n,y:r}=e,i=n.getOptions().domain,o=r.getOptions().domain;a.emit("brush:filter",Object.assign(Object.assign({},t),{data:{selection:[i,o]}})),p=!1,m=l,d("brushFilter"),f()},extent:void 0,emitter:a,scale:v,coordinate:y},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),r))}}function MX(t){return xX(Object.assign(Object.assign({hideX:!0},t),{brushRegion:cX}))}function SX(t){return xX(Object.assign(Object.assign({hideY:!0},t),{brushRegion:uX}))}const AX="slider";function TX(t,e,n,r=!1){const{marks:i}=t,o=i.map((t=>{var i,o;return We({axis:{x:{transform:[{type:"hide"}]},y:{transform:[{type:"hide"}]}}},t,{scale:e,[n]:Object.assign(Object.assign({},(null===(i=t[n])||void 0===i?void 0:i.x)&&{x:Object.assign({preserve:!0},r&&{ratio:null})}),(null===(o=t[n])||void 0===o?void 0:o.y)&&{y:Object.assign({preserve:!0},r&&{ratio:null})}),animate:!1})}));return Object.assign(Object.assign({},t),{marks:o,clip:!0,animate:!1})}function OX(t,e,n){const[r,i]=t,o=n?t=>1-t:t=>t;return jb(e,[Ub(e,o(r),!0),Ub(e,o(i),!1)])}function RX(t){return[t[0],t[t.length-1]]}function PX({channelDomain:t,className:e=AX,prefix:n="slider",setValue:r=((t,e)=>t.setValues(e)),hasState:i=!1,wait:o=50,leading:a=!0,trailing:c=!1}){return(l,u,f)=>{const{container:d,view:h,update:p,setState:g}=l,m=d.getElementsByClassName(e);if(!m.length)return()=>{};let v=!1;const{scale:y,coordinate:_,layout:b}=h,{paddingLeft:E,paddingTop:x,paddingBottom:M,paddingRight:S}=b,{x:A,y:T}=y,O=Jy(_),R=t=>{const e="vertical"===t?"y":"x",n="vertical"===t?"x":"y";return O?[n,e]:[e,n]},P=new Map,C=new Set;t||(t={x:A.getOptions().domain,y:T.getOptions().domain});for(const e of m){const{orientation:l}=e.attributes,[u,d]=R(l),h=`${n}${Ie(u)}:filter`,m="x"===u,{ratio:_}=A.getOptions(),{ratio:b}=T.getOptions(),w=e=>{if(e.data){const{selection:n}=e.data,[r=RX(t.x),i=RX(t.y)]=n;return m?[jb(A,r,_),jb(T,i,b)]:[jb(T,i,b),jb(A,r,_)]}const{value:n}=e.detail;return[OX(n,y[u],O&&"horizontal"===l),t[d]]},N=Ye((r=>s(this,void 0,void 0,(function*(){if(v)return;v=!0;const{nativeEvent:o=!0}=r,[a,s]=w(r);if(t[u]=a,t[d]=s,o){const t=m?a:s,e=m?s:a;f.emit(h,Object.assign(Object.assign({},r),{nativeEvent:o,data:{selection:[RX(t),RX(e)]}}))}g(e,(t=>Object.assign(Object.assign({},TX(t,{[u]:{domain:a,nice:!1},[d]:{domain:s,nice:!1}},n,i)),{paddingLeft:E,paddingTop:x,paddingBottom:M,paddingRight:S}))),yield p(),v=!1}))),o,{leading:a,trailing:c}),I=t=>{const{nativeEvent:n}=t;if(n)return;const{data:i}=t,{selection:o}=i,[a,s]=o;e.dispatchEvent(new Ga("valuechange",{data:i,nativeEvent:!1}));const c=m?Wb(a,A):Wb(s,T);r(e,c)};f.on(h,I),e.addEventListener("valuechange",N),P.set(e,N),C.add([h,I])}return()=>{for(const[t,e]of P)t.removeEventListener("valuechange",e);for(const[t,e]of C)f.off(t,e)}}}const CX="g2-scrollbar";function wX(t={}){return(e,n,r)=>{const{view:i,container:o}=e;if(!o.getElementsByClassName(CX).length)return()=>{};const{scale:a}=i,{x:s,y:c}=a,l={x:s.getOptions().domain,y:c.getOptions().domain};s.update({domain:s.getOptions().expectedDomain}),c.update({domain:c.getOptions().expectedDomain});const u=PX(Object.assign(Object.assign({},t),{channelDomain:l,className:CX,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0])}));return u(e,n,r)}}function NX(t,e,n){return`<${t} style="${Object.entries(n).map((([t,e])=>{return`${n=t,n.replace(/([A-Z])/g,"-$1").toLowerCase()}:${e}`;var n})).join(";")}">${e}</${t}>`}const IX={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 kX(t){return"text"===t.nodeName&&!!t.isOverflowing()}function LX(t){var{offsetX:e=8,offsetY:n=8}=t,r=o(t,["offsetX","offsetY"]);return t=>{const{container:i}=t,[o,a]=i.getBounds().min,s=cf(r,"tip"),c=new Set,l=t=>{const{target:r}=t;if(!kX(r))return void t.stopPropagation();const{offsetX:l,offsetY:u}=t,f=l+e-o,d=u+n-a;if(r.tip)return r.tip.style.x=f,void(r.tip.style.y=d);const{text:h}=r.style,p=new Os({className:"poptip",style:{innerHTML:NX("div",h,Object.assign(Object.assign({},IX),s)),x:f,y:d}});i.appendChild(p),r.tip=p,c.add(p)},u=t=>{const{target:e}=t;kX(e)?e.tip&&(e.tip.remove(),e.tip=null,c.delete(e.tip)):t.stopPropagation()};return i.addEventListener("pointerover",l),i.addEventListener("pointerout",u),()=>{i.removeEventListener("pointerover",l),i.removeEventListener("pointerout",u),c.forEach((t=>t.remove()))}}}function DX(t){const{min:e,max:n}=t;return[[e[0],e[1]],[n[0],n[1]]]}function BX(t,e){const[n,r]=t,[i,o]=e;return n>=i[0]&&n<=o[0]&&r>=i[1]&&r<=o[1]}const FX=t=>{const{priority:e}=t;return t=>{const n=[];return e&&t.sort(e),t.forEach((t=>{HV(t);const e=t.getLocalBounds(),r=n.some((t=>function(t,e){const[n,r]=t,[i,o]=e;return n[0]<o[0]&&r[0]>i[0]&&n[1]<o[1]&&r[1]>i[1]}(DX(e),DX(t.getLocalBounds()))));r?VV(t):n.push(t)})),t}};function UX([t,e],[n,r]){return r>t&&e>n}function jX(){const t=new Map;return[e=>t.get(e),(e,n)=>t.set(e,n)]}function GX(t){const e=t.cloneNode(!0),n=e.getElementById("connector");n&&e.removeChild(n);const{min:r,max:i}=e.getRenderBounds();return e.destroy(),{min:r,max:i}}const WX=t=>{const{maxIterations:e=10,maxError:n=.1,padding:r=1}=t;return t=>{const i=t.length;if(i<=1)return t;const[o,a]=jX(),[s,c]=jX(),[l,u]=jX(),[f,d]=jX();for(const e of t){const{min:t,max:n}=GX(e),[r,i]=t,[o,s]=n;a(e,i),c(e,i),u(e,s-i),d(e,[r,o])}for(let o=0;o<e;o++){t.sort(((t,e)=>au(s(t),s(e))));let e=0;for(let n=0;n<i-1;n++){const i=t[n];let o,a=n+1;for(;(o=t[a])&&!UX(f(i),f(o));)a+=1;if(o){const t=s(i),n=l(i),a=s(o),u=a-(t+n);if(u<r){const n=(r-u)/2;e=Math.max(e,n),c(i,t-n),c(o,a+n)}}}if(e<n)break}for(const e of t)e.style.y+=s(e)-o(e);return t}};function zX(t){let e=t/255;return e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),e}function VX(t,e,n){return.2126*zX(t)+.7152*zX(e)+.0722*zX(n)}function HX(t,e){const{r:n,g:r,b:i}=t,{r:o,g:a,b:s}=e,c=VX(n,r,i),l=VX(o,a,s);return(Math.max(c,l)+.05)/(Math.min(c,l)+.05)}function XX(t,e){const n=Gu(e,(e=>HX(t,function(t){return"object"==typeof t?t:Ri(t)}(e))));return e[n]}const YX=t=>{const{threshold:e=4.5,palette:n=["#000","#fff"]}=t;return t=>(t.forEach((t=>{const r=t.attr("dependentElement").parsedStyle.fill;HX(t.parsedStyle.fill,r)<e&&t.attr("fill",XX(r,n))})),t)},$X=()=>t=>(t.forEach((t=>{HV(t);const e=t.attr("bounds"),n=function(t,e){const[n,r]=t;return!(BX(n,e)&&BX(r,e))}(DX(t.getLocalBounds()),e);n&&VV(t)})),t);function qX(){return{"data.fetch":PW,"data.inline":BW,"data.sortBy":DW,"data.sort":IW,"data.filter":NW,"data.pick":kW,"data.rename":LW,"data.fold":CW,"data.slice":gz,"data.custom":FW,"data.map":UW,"data.join":pz,"data.kde":_z,"data.log":Iz,"transform.stackY":ZN,"transform.binX":nk,"transform.bin":ek,"transform.dodgeX":gI,"transform.jitter":bI,"transform.jitterX":EI,"transform.symmetryY":xI,"transform.diffY":MI,"transform.stackEnter":mI,"transform.normalizeY":vI,"transform.select":RI,"transform.selectX":PI,"transform.selectY":CI,"transform.groupX":WI,"transform.groupY":zI,"transform.groupColor":VI,"transform.group":GI,"transform.sortX":YI,"transform.sortY":qI,"transform.sortColor":$I,"transform.flexX":KI,"transform.pack":QI,"transform.sample":ik,"transform.filter":ok,"coordinate.cartesian":Bf,"coordinate.polar":jf,"coordinate.transpose":Gf,"coordinate.theta":Wf,"coordinate.parallel":Hf,"coordinate.fisheye":Xf,"coordinate.radial":Vf,"coordinate.radar":Yf,"encode.constant":wU,"encode.field":IU,"encode.transform":NU,"encode.column":kU,"mark.interval":BU,"mark.rect":UU,"mark.line":zU,"mark.point":$U,"mark.text":ej,"mark.cell":rj,"mark.area":oj,"mark.link":sj,"mark.image":lj,"mark.polygon":fj,"mark.box":hj,"mark.vector":gj,"mark.lineX":_j,"mark.lineY":vj,"mark.connector":Ej,"mark.range":Aj,"mark.rangeX":Oj,"mark.rangeY":Pj,"mark.path":Qj,"mark.shape":mG,"mark.density":Wz,"mark.heatmap":Vz,"palette.category10":$z,"palette.category20":qz,"scale.linear":Zz,"scale.ordinal":Qz,"scale.band":Kz,"scale.identity":Jz,"scale.point":tV,"scale.time":eV,"scale.log":nV,"scale.pow":rV,"scale.sqrt":sV,"scale.threshold":iV,"scale.quantile":oV,"scale.quantize":aV,"scale.sequential":cV,"scale.constant":lV,"theme.classic":hV,"theme.classicDark":mV,"theme.academy":yV,"theme.light":dV,"theme.dark":gV,"component.axisX":O_,"component.axisY":R_,"component.legendCategory":lb,"component.legendContinuous":pb,"component.legends":qb,"component.title":Bb,"component.sliderX":Vb,"component.sliderY":Hb,"component.scrollbarX":Yb,"component.scrollbarY":$b,"animation.scaleInX":_V,"animation.scaleOutX":bV,"animation.scaleInY":EV,"animation.scaleOutY":xV,"animation.waveIn":LV,"animation.fadeIn":MV,"animation.fadeOut":SV,"animation.zoomIn":DV,"animation.zoomOut":BV,"animation.pathIn":FV,"animation.morphing":kV,"animation.growInX":UV,"animation.growInY":jV,"interaction.elementHighlight":dH,"interaction.elementHighlightByX":hH,"interaction.elementHighlightByColor":pH,"interaction.elementSelect":mH,"interaction.elementSelectByX":vH,"interaction.elementSelectByColor":yH,"interaction.fisheye":bH,"interaction.chartIndex":_H,"interaction.tooltip":BH,"interaction.legendFilter":ZH,"interaction.legendHighlight":QH,"interaction.brushHighlight":sX,"interaction.brushXHighlight":lX,"interaction.brushYHighlight":fX,"interaction.brushAxisHighlight":EX,"interaction.brushFilter":xX,"interaction.brushXFilter":MX,"interaction.brushYFilter":SX,"interaction.sliderFilter":PX,"interaction.scrollbarFilter":wX,"interaction.poptip":LX,"composition.spaceLayer":Jb,"composition.spaceFlex":tE,"composition.facetRect":mE,"composition.repeatMatrix":xE,"composition.facetCircle":RE,"composition.timingKeyframe":CE,"labelTransform.overlapHide":FX,"labelTransform.overlapDodgeY":WX,"labelTransform.overflowHide":$X,"labelTransform.contrastReverse":YX}}function KX(){return{"composition.geoView":FS,"composition.geoPath":wE}}function ZX(){return{"data.arc":zW,"data.cluster":hW,"mark.forceGraph":fW,"mark.tree":_W,"mark.pack":oG,"mark.sankey":Kj,"mark.treemap":nG}}function QX(){return{"data.venn":Nz,"mark.boxplot":pG,"mark.gauge":jz,"mark.wordCloud":kz,"mark.liquid":Yz}}function JX(){return Object.assign(Object.assign(Object.assign(Object.assign({},KX()),ZX()),QX()),qX())}function tY(t,e){return class extends t{constructor(t){super(Object.assign(Object.assign({},t),{lib:e}))}}}const eY=JX();const nY=t=>t?parseInt(t):0;function rY(t,e){const n=[t];for(;n.length;){const t=n.shift();e&&e(t);const r=t.children||[];for(const t of r)n.push(t)}}class iY{constructor(t={},e){this.parentNode=null,this.children=[],this.index=0,this.type=e,this.value=t}map(t=(t=>t)){const e=t(this.value);return this.value=e,this}attr(t,e){return 1===arguments.length?this.value[t]:this.map((n=>(n[t]=e,n)))}append(t){const e=new t({});return e.children=[],this.push(e),e}push(t){return t.parentNode=this,t.index=this.children.length,this.children.push(t),this}remove(){const t=this.parentNode;if(t){const{children:e}=t,n=e.findIndex((t=>t===this));e.splice(n,1)}return this}getNodeByKey(t){let e=null;return rY(this,(n=>{t===n.attr("key")&&(e=n)})),e}getNodesByType(t){const e=[];return rY(this,(n=>{t===n.type&&e.push(n)})),e}getNodeByType(t){let e=null;return rY(this,(n=>{e||t===n.type&&(e=n)})),e}call(t,...e){return t(this.map(),...e),this}getRoot(){let t=this;for(;t&&t.parentNode;)t=t.parentNode;return t}}const oY=["width","height","depth","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title"],aY="__remove__",sY="__callback__";function cY(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function lY(t,e){const{autoFit:n}=t;if(n)return function(t){const e=getComputedStyle(t),n=t.clientWidth||nY(e.width),r=t.clientHeight||nY(e.height);return{width:n-(nY(e.paddingLeft)+nY(e.paddingRight)),height:r-(nY(e.paddingTop)+nY(e.paddingBottom)),depth:n}}(e);const{width:r=640,height:i=480,depth:o=0}=t;return{width:r,height:i,depth:o}}function uY(t){const e=function(t){if(null!==t.type)return t;const e=t.children[t.children.length-1];for(const n of oY)e.attr(n,t.attr(n));return e}(t),n=[e],r=new Map;for(r.set(e,cY(e));n.length;){const t=n.pop(),e=r.get(t),{children:i=[]}=t;for(const t of i)if(t.type===sY)e.children=t.value;else{const i=cY(t),{children:o=[]}=e;o.push(i),n.push(t),r.set(t,i),e.children=o}}return r.get(e)}function fY(t,e,n,r){const{type:i}=t,{type:o=n||i}=e;if("view"===o)return e;if(!function(t,e){return"function"==typeof t||new Set(Object.keys(e)).has(t)}(o,r))return e;const a={type:"view"},s=Object.assign({},e);for(const t of oY)void 0!==s[t]&&(a[t]=s[t],delete s[t]);return Object.assign(Object.assign({},a),{children:[s]})}function dY(t,e,n){if("function"==typeof t){const e=new iY;return e.value=t,e.type=sY,e}const{type:r,children:i}=t,a=o(t,["type","children"]),s=function(t,e,n){if("function"==typeof t)return e.mark;const r=Object.assign(Object.assign({},e),n)[t];if(!r)throw new Error(`Unknown mark: ${t}.`);return r}(r,e,n),c=new s;return c.value=a,c.type=r,c}function hY(t,e){const{type:n,children:r}=e,i=o(e,["type","children"]);t.type===n||void 0===n?pf(t.value,i):"string"==typeof n&&(t.type=n,t.value=i)}function pY(t,e,n,r){if(!t)return;const i=[[t,e]];for(;i.length;){const[t,e]=i.shift(),o=dY(e,n,r);Array.isArray(t.children)&&t.push(o);const{children:a}=e;if(Array.isArray(a))for(const t of a)i.push([o,t]);else"function"==typeof a&&i.push([o,a])}}function gY(t,e,{key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function mY(t,e,{key:n=e}){t.prototype[e]=function(t){if(0===arguments.length)return this.attr(n);if(Array.isArray(t))return this.attr(n,t);const e=[...this.attr(n)||[],t];return this.attr(n,e)}}function vY(t,e,{key:n=e}){t.prototype[e]=function(t,e){if(0===arguments.length)return this.attr(n);if(1===arguments.length&&"string"!=typeof t)return this.attr(n,t);const r=this.attr(n)||{};return r[t]=1===arguments.length||e,this.attr(n,r)}}function yY(t,e,n){t.prototype[e]=function(t){if(0===arguments.length)return this.attr(e);if(Array.isArray(t))return this.attr(e,{items:t});if(df(t)&&(void 0!==t.title||void 0!==t.items))return this.attr(e,t);if(null===t||!1===t)return this.attr(e,t);const n=this.attr(e)||{},{items:r=[]}=n;return r.push(t),n.items=r,this.attr(e,n)}}function _Y(t,e,{ctor:n}){t.prototype[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}function bY(t,e,{ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}function EY(t){return e=>{for(const[n,r]of Object.entries(t)){const{type:t}=r;"value"===t?gY(e,n,r):"array"===t?mY(e,n,r):"object"===t?vY(e,n,r):"node"===t?_Y(e,n,r):"container"===t?bY(e,n,r):"mix"===t&&yY(e,n)}return e}}function xY(t){return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,{type:"node",ctor:e}])))}const MY={encode:{type:"object"},scale:{type:"object"},data:{type:"value"},transform:{type:"array"},style:{type:"object"},animate:{type:"object"},coordinate:{type:"object"},interaction:{type:"object"},label:{type:"array",key:"labels"},axis:{type:"object"},legend:{type:"object"},slider:{type:"object"},scrollbar:{type:"object"},state:{type:"object"},layout:{type:"object"},theme:{type:"object"},title:{type:"value"}},SY=Object.assign(Object.assign({},MY),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),AY=Object.assign(Object.assign({},MY),{labelTransform:{type:"array"}});let TY=class extends iY{changeData(t){var e;const n=this.getRoot();if(n)return this.attr("data",t),(null===(e=this.children)||void 0===e?void 0:e.length)&&this.children.forEach((e=>{e.attr("data",t)})),null==n?void 0:n.render()}getView(){const t=this.getRoot(),{views:e}=t.getContext();if(null==e?void 0:e.length)return e.find((t=>t.key===this._key))}getScale(){var t;return null===(t=this.getView())||void 0===t?void 0:t.scale}getScaleByChannel(t){const e=this.getScale();if(e)return e[t]}getCoordinate(){var t;return null===(t=this.getView())||void 0===t?void 0:t.coordinate}getTheme(){var t;return null===(t=this.getView())||void 0===t?void 0:t.theme}getGroup(){const t=this._key;if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}show(){const t=this.getGroup();t&&!t.isVisible()&&HV(t)}hide(){const t=this.getGroup();t&&t.isVisible()&&VV(t)}};TY=a([EY(AY)],TY);let OY=class extends iY{changeData(t){const e=this.getRoot();if(e)return this.attr("data",t),null==e?void 0:e.render()}getMark(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(!e)return;const{markState:n}=e,r=Array.from(n.keys()).find((t=>t.key===this.attr("key")));return n.get(r)}getScale(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(e)return null==e?void 0:e.scale}getScaleByChannel(t){var e,n;const r=null===(e=this.getRoot())||void 0===e?void 0:e.getView();if(r)return null===(n=null==r?void 0:r.scale)||void 0===n?void 0:n[t]}getGroup(){const t=this.attr("key");if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}};OY=a([EY(SY)],OY);const RY="G2_CHART_KEY";class PY extends TY{constructor(t){const{container:e,canvas:n,renderer:r,plugins:i,lib:a}=t;super(o(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=Fe((()=>{this.forceFit()}),300),this._renderer=r||new nu,this._plugins=i||[],this._container=function(t){if(void 0===t){const t=document.createElement("div");return t[aY]=!0,t}if("string"==typeof t)return document.getElementById(t);return t}(e),this._emitter=new ou,this._context={library:a,emitter:this._emitter,canvas:n},this._create()}render(){if(this._rendering)return this._addToTrailing();this._context.canvas||this._createCanvas(),this._context.canvas.getConfig().supportsCSSTransform=!0,this._bindAutoFit(),this._rendering=!0;const t=new Promise(((t,e)=>PU(this._computedOptions(),this._context,this._createResolve(t),this._createReject(e)))),[e,n,r]=function(){let t,e;return[new Promise(((n,r)=>{e=n,t=r})),e,t]}();return t.then(n).catch(r).then((()=>this._renderTrailing())),e}options(t){if(0===arguments.length)return uY(this);const{type:e}=t;return e&&(this._previousDefinedType=e),function(t,e,n,r,i){const o=[[null,t,fY(t,e,n,r)]];for(;o.length;){const[t,e,n]=o.shift();if(e)if(n){hY(e,n);const{children:t}=n,{children:r}=e;if(Array.isArray(t)&&Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;i<n;i++){const n=t[i],a=r[i];o.push([e,a,n])}}else"function"==typeof t&&o.push([e,null,t])}else e.remove();else pY(t,n,r,i)}}(this,t,this._previousDefinedType,this._marks,this._compositions),this}getContainer(){return this._container}getContext(){return this._context}on(t,e,n){return this._emitter.on(t,e,n),this}once(t,e){return this._emitter.once(t,e),this}emit(t,...e){return this._emitter.emit(t,...e),this}off(t,e){return this._emitter.off(t,e),this}clear(){this.options();this.emit(vf.BEFORE_CLEAR),this._reset(),CU(0,this._context,!1),this.emit(vf.AFTER_CLEAR)}destroy(){this.options();this.emit(vf.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),CU(0,this._context,!0),this._container[aY]&&function(t){const e=t.parentNode;e&&e.removeChild(t)}(this._container),this.emit(vf.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;const{width:t,height:e}=lY(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(vf.BEFORE_CHANGE_SIZE);const n=this.render();return n.then((()=>{this.emit(vf.AFTER_CHANGE_SIZE)})),n}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(vf.BEFORE_CHANGE_SIZE),this.attr("width",t),this.attr("height",e);const n=this.render();return n.then((()=>{this.emit(vf.AFTER_CHANGE_SIZE)})),n}_create(){const{library:t}=this._context,e=["mark.mark",...Object.keys(t).filter((t=>t.startsWith("mark.")||"component.axisX"===t||"component.axisY"===t||"component.legends"===t))];this._marks={};for(const t of e){const e=t.split(".").pop();class n extends OY{constructor(){super({},e)}}this._marks[e]=n,this[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}const n=["composition.view",...Object.keys(t).filter((t=>t.startsWith("composition.")&&"composition.mark"!==t))];this._compositions=Object.fromEntries(n.map((t=>{const e=t.split(".").pop();let n=class extends TY{constructor(){super({},e)}};return n=a([EY(xY(this._marks))],n),[e,n]})));for(const t of Object.values(this._compositions))EY(xY(this._compositions))(t);for(const t of n){const e=t.split(".").pop();this[e]=function(){const t=this._compositions[e];return this.type=null,this.append(t)}}}_reset(){const t=["theme","type","width","height","autoFit"];this.type="view",this.value=Object.fromEntries(Object.entries(this.value).filter((([e])=>e.startsWith("margin")||e.startsWith("padding")||e.startsWith("inset")||t.includes(e)))),this.children=[]}_renderTrailing(){this._trailing&&(this._trailing=!1,this.render().then((()=>{const t=this._trailingResolve.bind(this);this._trailingResolve=null,t(this)})).catch((t=>{const e=this._trailingReject.bind(this);this._trailingReject=null,e(t)})))}_createResolve(t){return()=>{this._rendering=!1,t(this)}}_createReject(t){return e=>{this._rendering=!1,t(e)}}_computedOptions(){const t=this.options(),{key:e=RY}=t,{width:n,height:r,depth:i}=lY(t,this._container);return this._width=n,this._height=r,this._key=e,Object.assign(Object.assign({key:this._key},t),{width:n,height:r,depth:i})}_createCanvas(){const{width:t,height:e}=lY(this.options(),this._container);this._plugins.push(new iu),this._plugins.forEach((t=>this._renderer.registerPlugin(t))),this._context.canvas=new $s({container:this._container,width:t,height:e,renderer:this._renderer})}_addToTrailing(){var t;null===(t=this._trailingResolve)||void 0===t||t.call(this,this),this._trailing=!0;return new Promise(((t,e)=>{this._trailingResolve=t,this._trailingReject=e}))}_bindAutoFit(){const t=this.options(),{autoFit:e}=t;this._hasBindAutoFit?e||this._unbindAutoFit():e&&(this._hasBindAutoFit=!0,window.addEventListener("resize",this._onResize))}_unbindAutoFit(){this._hasBindAutoFit&&(this._hasBindAutoFit=!1,window.removeEventListener("resize",this._onResize))}}const CY=tY(PY,eY);os.enableCSSParsing=!1,t.AREA_CLASS_NAME=cl,t.Area=oj,t.Box=hj,t.Boxplot=pG,t.COMPONENT_CLASS_NAME=al,t.Cell=rj,t.Chart=CY,t.ChartEvent=vf,t.Connector=Ej,t.Density=Wz,t.ELEMENT_CLASS_NAME=rl,t.ForceGraph=fW,t.Gauge=jz,t.Heatmap=Vz,t.Image=lj,t.Interval=BU,t.Interval3D=ZU,t.LABEL_CLASS_NAME=sl,t.LABEL_LAYER_CLASS_NAME=nl,t.Line=zU,t.Line3D=XU,t.LineX=_j,t.LineY=vj,t.Link=sj,t.Liquid=Yz,t.MAIN_LAYER_CLASS_NAME=el,t.MASK_CLASS_NAME="mask",t.PLOT_CLASS_NAME=ol,t.Pack=oG,t.Path=Qj,t.Point=$U,t.Point3D=qU,t.Polygon=fj,t.Range=Aj,t.RangeX=Oj,t.RangeY=Pj,t.Rect=UU,t.Runtime=PY,t.Sankey=Kj,t.Shape=mG,t.Text=ej,t.Tree=_W,t.Treemap=nG,t.VIEW_CLASS_NAME=il,t.Vector=gj,t.WordCloud=kz,t.corelib=qX,t.extend=tY,t.geolib=KX,t.graphlib=ZX,t.litelib=function(){return{"data.inline":BW,"coordinate.cartesian":Bf,"encode.constant":wU,"encode.field":IU,"encode.transform":NU,"encode.column":kU,"mark.interval":BU,"shape.label.label":Xk,"palette.category10":$z,"palette.category20":qz,"scale.linear":Zz,"scale.ordinal":Qz,"scale.band":Kz,"scale.identity":Jz,"scale.point":tV,"scale.time":eV,"scale.log":nV,"scale.pow":rV,"scale.sqrt":sV,"scale.threshold":iV,"scale.quantile":oV,"scale.quantize":aV,"scale.sequential":cV,"scale.constant":lV,"theme.classic":hV,"component.axisX":O_,"component.axisY":R_,"component.axisRadar":w_,"component.axisLinear":A_,"component.axisArc":T_,"component.legendCategory":lb,"component.legendContinuous":pb,"component.legendContinuousBlock":gb,"component.legendContinuousBlockSize":vb,"component.legendContinuousSize":mb,"component.legends":qb,"component.title":Bb,"component.sliderX":Vb,"component.sliderY":Hb,"component.scrollbarX":Yb,"component.scrollbarY":$b,"animation.scaleInX":_V,"animation.scaleOutX":bV,"animation.scaleInY":EV,"animation.scaleOutY":xV,"animation.waveIn":LV,"animation.fadeIn":MV,"animation.fadeOut":SV,"animation.morphing":kV,"interaction.tooltip":BH,"interaction.legendFilter":ZH,"interaction.legendHighlight":QH,"interaction.sliderFilter":PX,"interaction.scrollbarFilter":wX,"interaction.poptip":LX,"interaction.event":fL,"composition.mark":nE,"composition.view":eE}},t.plotlib=QX,t.register=function(t,e){Object.assign(eY,{[t]:e})},t.render=PU,t.renderToMountedElement=function(t,e={},n=(()=>{}),r=(t=>{throw t})){const{width:i=640,height:o=480}=t,a=OU(t),{group:s=new Ts,emitter:c=new ou,library:l}=e;(null==s?void 0:s.parentElement)||rf("renderToMountedElement can't render chart to unmounted group.");const u=gf(s);return e.group=s,e.emitter=c,c.emit(vf.BEFORE_RENDER),eU(Object.assign(Object.assign({},a),{width:i,height:o}),u,l,e).then((()=>{s.ownerDocument.defaultView.requestAnimationFrame((()=>{c.emit(vf.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),s},t.stdlib=JX,t.threedlib=function(){return{"coordinate.cartesian3D":Ff,"component.axisZ":P_,"mark.point3D":qU,"mark.line3D":XU,"mark.interval3D":ZU}},Object.defineProperty(t,"__esModule",{value:!0})}));
|