!(function(){var ir=Math.pow;(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[258],{58967:function(je,In,tt){"use strict";tt.d(In,{Z:function(){return Ght}});var Et={};tt.r(Et),tt.d(Et,{add:function(){return f6},adjoint:function(){return JD},clone:function(){return T_},copy:function(){return is},create:function(){return cn},determinant:function(){return C_},equals:function(){return v6},exactEquals:function(){return p6},frob:function(){return u6},fromQuat:function(){return q0},fromQuat2:function(){return n6},fromRotation:function(){return j_},fromRotationTranslation:function(){return D_},fromRotationTranslationScale:function(){return r6},fromRotationTranslationScaleOrigin:function(){return Nl},fromScaling:function(){return ss},fromTranslation:function(){return os},fromValues:function(){return QD},fromXRotation:function(){return R_},fromYRotation:function(){return I_},fromZRotation:function(){return X0},frustum:function(){return i6},getRotation:function(){return Uf},getScaling:function(){return cc},getTranslation:function(){return Vf},identity:function(){return as},invert:function(){return fa},lookAt:function(){return W_},mul:function(){return H_},multiply:function(){return Rr},multiplyScalar:function(){return d6},multiplyScalarAndAdd:function(){return h6},ortho:function(){return z_},orthoNO:function(){return B_},orthoZO:function(){return G_},perspective:function(){return a6},perspectiveFromFieldOfView:function(){return s6},perspectiveNO:function(){return F_},perspectiveZO:function(){return o6},rotate:function(){return t6},rotateX:function(){return L_},rotateY:function(){return N_},rotateZ:function(){return e6},scale:function(){return $f},set:function(){return U0},str:function(){return l6},sub:function(){return g6},subtract:function(){return Y_},targetTo:function(){return c6},translate:function(){return sc},transpose:function(){return k_}});var lt={};tt.r(lt),tt.d(lt,{area:function(){return N$},bottom:function(){return $a},bottomLeft:function(){return $a},bottomRight:function(){return $a},inside:function(){return $a},left:function(){return $a},outside:function(){return I$},right:function(){return $a},spider:function(){return F$},surround:function(){return z$},top:function(){return $a},topLeft:function(){return $a},topRight:function(){return $a}});var te={};tt.r(te),tt.d(te,{interpolateBlues:function(){return fU},interpolateBrBG:function(){return HV},interpolateBuGn:function(){return JV},interpolateBuPu:function(){return tU},interpolateCividis:function(){return yU},interpolateCool:function(){return wU},interpolateCubehelixDefault:function(){return xU},interpolateGnBu:function(){return eU},interpolateGreens:function(){return dU},interpolateGreys:function(){return hU},interpolateInferno:function(){return CU},interpolateMagma:function(){return kU},interpolateOrRd:function(){return nU},interpolateOranges:function(){return gU},interpolatePRGn:function(){return $V},interpolatePiYG:function(){return VV},interpolatePlasma:function(){return LU},interpolatePuBu:function(){return iU},interpolatePuBuGn:function(){return rU},interpolatePuOr:function(){return UV},interpolatePuRd:function(){return aU},interpolatePurples:function(){return pU},interpolateRainbow:function(){return SU},interpolateRdBu:function(){return XV},interpolateRdGy:function(){return qV},interpolateRdPu:function(){return oU},interpolateRdYlBu:function(){return ZV},interpolateRdYlGn:function(){return KV},interpolateReds:function(){return vU},interpolateSinebow:function(){return AU},interpolateSpectral:function(){return QV},interpolateTurbo:function(){return PU},interpolateViridis:function(){return TU},interpolateWarm:function(){return OU},interpolateYlGn:function(){return cU},interpolateYlGnBu:function(){return sU},interpolateYlOrBr:function(){return lU},interpolateYlOrRd:function(){return uU},schemeAccent:function(){return PV},schemeBlues:function(){return bM},schemeBrBG:function(){return QS},schemeBuGn:function(){return sM},schemeBuPu:function(){return cM},schemeCategory10:function(){return AV},schemeDark2:function(){return TV},schemeGnBu:function(){return lM},schemeGreens:function(){return _M},schemeGreys:function(){return xM},schemeObservable10:function(){return kV},schemeOrRd:function(){return uM},schemeOranges:function(){return SM},schemePRGn:function(){return JS},schemePaired:function(){return CV},schemePastel1:function(){return LV},schemePastel2:function(){return NV},schemePiYG:function(){return tM},schemePuBu:function(){return dM},schemePuBuGn:function(){return fM},schemePuOr:function(){return eM},schemePuRd:function(){return hM},schemePurples:function(){return OM},schemeRdBu:function(){return nM},schemeRdGy:function(){return rM},schemeRdPu:function(){return pM},schemeRdYlBu:function(){return iM},schemeRdYlGn:function(){return aM},schemeReds:function(){return wM},schemeSet1:function(){return jV},schemeSet2:function(){return RV},schemeSet3:function(){return IV},schemeSpectral:function(){return oM},schemeTableau10:function(){return DV},schemeYlGn:function(){return gM},schemeYlGnBu:function(){return vM},schemeYlOrBr:function(){return yM},schemeYlOrRd:function(){return mM}});var _e={};tt.r(_e),tt.d(_e,{geoAlbers:function(){return z5},geoAlbersUsa:function(){return xit},geoAzimuthalEqualArea:function(){return Oit},geoAzimuthalEqualAreaRaw:function(){return P1},geoAzimuthalEquidistant:function(){return wit},geoAzimuthalEquidistantRaw:function(){return T1},geoConicConformal:function(){return Mit},geoConicConformalRaw:function(){return Y5},geoConicEqualArea:function(){return Fp},geoConicEqualAreaRaw:function(){return B5},geoConicEquidistant:function(){return Ait},geoConicEquidistantRaw:function(){return H5},geoEqualEarth:function(){return Tit},geoEqualEarthRaw:function(){return k1},geoEquirectangular:function(){return Eit},geoEquirectangularRaw:function(){return df},geoGnomonic:function(){return kit},geoGnomonicRaw:function(){return C1},geoIdentity:function(){return Cit},geoMercator:function(){return Sit},geoMercatorRaw:function(){return ff},geoNaturalEarth1:function(){return Lit},geoNaturalEarth1Raw:function(){return L1},geoOrthographic:function(){return Nit},geoOrthographicRaw:function(){return N1},geoProjection:function(){return Ca},geoProjectionMutator:function(){return E1},geoStereographic:function(){return jit},geoStereographicRaw:function(){return j1},geoTransverseMercator:function(){return Rit},geoTransverseMercatorRaw:function(){return R1}});var zt={};tt.r(zt),tt.d(zt,{frequency:function(){return Rot},id:function(){return Iot},name:function(){return Dot},weight:function(){return jot}});var bt=tt(67294),_t=tt(73935),Pt=tt.t(_t,2),K=function(){return K=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&a[a.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]=18&&(rt=kt.createRoot)}catch(t){}function Gt(t){var e=kt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;e&&typeof e=="object"&&(e.usingClientEntryPoint=t)}var oe="__rc_react_root__";function We(t,e){Gt(!0);var n=e[oe]||rt(e);Gt(!1),n.render(t),e[oe]=n}function ke(t,e){ut(t,e)}function Ie(t,e){}function Ue(t,e){if(rt){We(t,e);return}ke(t,e)}function we(t){return Nt(this,void 0,void 0,function(){return St(this,function(e){return[2,Promise.resolve().then(function(){var n;(n=t[oe])===null||n===void 0||n.unmount(),delete t[oe]})]})})}function Je(t){ot(t)}function Xe(t){}function Zt(t){return Nt(this,void 0,void 0,function(){return St(this,function(e){return rt!==void 0?[2,we(t)]:(Je(t),[2])})})}var Ut=new Map;Ut.set("tooltip",document.createElement("div"));var ar=function(t,e){e===void 0&&(e=!1);var n=null;if(e)n=Ut.get("tooltip");else if(n=document.createElement("div"),t!=null&&t.key){var r=Ut.get(t.key);r?n=r:Ut.set(t.key,n)}return Ue(t,n),n},_r=function(t){var e=t.attachShadow({mode:"open"}),n=document.createElement("div"),r=document.createElement("style");r.innerHTML=`.loading { display: inline-block; position: relative; width: 80px; height: 80px; } .loading div { position: absolute; top: 33px; width: 13px; height: 13px; border-radius: 50%; background: #ccc; animation-timing-function: cubic-bezier(0, 1, 1, 0); } .loading div:nth-child(1) { left: 8px; animation: loading1 0.6s infinite; } .loading div:nth-child(2) { left: 8px; animation: loading2 0.6s infinite; } .loading div:nth-child(3) { left: 32px; animation: loading2 0.6s infinite; } .loading div:nth-child(4) { left: 56px; animation: loading3 0.6s infinite; } @keyframes loading1 { 0% { transform: scale(0); } 100% { transform: scale(1); } } @keyframes loading3 { 0% { transform: scale(1); } 100% { transform: scale(0); } } @keyframes loading2 { 0% { transform: translate(0, 0); } 100% { transform: translate(24px, 0); } } `,n.classList.add("loading"),n.innerHTML="
",e.appendChild(r),e.appendChild(n)},Tr=function(t){var e=t.loadingTemplate,n=t.theme,r=n===void 0?"light":n,i=bt.useRef(null);bt.useEffect(function(){!e&&i.current&&_r(i.current)},[]);var a=function(){return e||bt.createElement("div",{ref:i})};return bt.createElement("div",{className:"charts-loading-container",style:{position:"absolute",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",left:0,top:0,zIndex:99,backgroundColor:r==="dark"?"rgb(20, 20, 20)":"rgb(255, 255, 255)"}},a())},hr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qn=function(t){hr(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={hasError:!1},n.renderError=function(r){var i=n.props.errorTemplate;switch(r){default:return typeof i=="function"?i(r):i||bt.createElement("h5",null,"\u7EC4\u4EF6\u51FA\u9519\u4E86\uFF0C\u8BF7\u6838\u67E5\u540E\u91CD\u8BD5\uFF1A ",r.message)}},n}return e.getDerivedStateFromError=function(n){return{hasError:!0,error:n}},e.getDerivedStateFromProps=function(n,r){return r.children!==n.children?{children:n.children,hasError:!1,error:void 0}:null},e.prototype.render=function(){return this.state.hasError?this.renderError(this.state.error):bt.createElement(bt.Fragment,null,this.props.children)},e}(bt.Component),pr=typeof global=="object"&&global&&global.Object===Object&&global,ei=pr,mi=typeof self=="object"&&self&&self.Object===Object&&self,Ei=ei||mi||Function("return this")(),Hn=Ei,vr=Hn.Symbol,Jn=vr,lr=Object.prototype,tn=lr.hasOwnProperty,Ai=lr.toString,Pi=Jn?Jn.toStringTag:void 0;function yl(t){var e=tn.call(t,Pi),n=t[Pi];try{t[Pi]=void 0;var r=!0}catch(a){}var i=Ai.call(t);return r&&(e?t[Pi]=n:delete t[Pi]),i}var Yo=yl,Xs=Object.prototype,Xi=Xs.toString;function ml(t){return Xi.call(t)}var bl=ml,qs="[object Null]",_l="[object Undefined]",eo=Jn?Jn.toStringTag:void 0;function Zs(t){return t==null?t===void 0?_l:qs:eo&&eo in Object(t)?Yo(t):bl(t)}var xr=Zs;function Ks(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var mn=Ks,Qs="[object AsyncFunction]",Ho="[object Function]",ee="[object GeneratorFunction]",ft="[object Proxy]";function ve(t){if(!mn(t))return!1;var e=xr(t);return e==Ho||e==ee||e==Qs||e==ft}var Wt=ve,Pe=function(t){var e=/react|\.jsx|children:\[\(|return\s+[A-Za-z0-9].createElement\((?!['"][g|circle|ellipse|image|rect|line|polyline|polygon|text|path|html|mesh]['"])([^\)])*,/i;return e.test(t)},Pn=Array.isArray,Xt=Pn;function he(){this.__data__=[],this.size=0}var Ye=he;function jn(t,e){return t===e||t!==t&&e!==e}var bn=jn;function Ce(t,e){for(var n=t.length;n--;)if(bn(t[n][0],e))return n;return-1}var ue=Ce,kr=Array.prototype,Cr=kr.splice;function aa(t){var e=this.__data__,n=ue(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():Cr.call(e,n,1),--this.size,!0}var Ti=aa;function or(t){var e=this.__data__,n=ue(e,t);return n<0?void 0:e[n][1]}var ki=or;function oa(t){return ue(this.__data__,t)>-1}var Or=oa;function ni(t,e){var n=this.__data__,r=ue(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var Hr=ni;function Ci(t){var e=-1,n=t==null?0:t.length;for(this.clear();++es))return!1;var l=a.get(t),u=a.get(e);if(l&&u)return l==e&&u==t;var f=-1,d=!0,h=n&rj?new Mb:void 0;for(a.set(t,e),a.set(e,t);++f-1&&t%1==0&&t-1&&t%1==0&&t<=Xj}var x0=qj,Zj="[object Arguments]",Kj="[object Array]",Qj="[object Boolean]",Jj="[object Date]",tR="[object Error]",eR="[object Function]",nR="[object Map]",rR="[object Number]",iR="[object Object]",aR="[object RegExp]",oR="[object Set]",sR="[object String]",cR="[object WeakMap]",lR="[object ArrayBuffer]",uR="[object DataView]",fR="[object Float32Array]",dR="[object Float64Array]",hR="[object Int8Array]",pR="[object Int16Array]",vR="[object Int32Array]",gR="[object Uint8Array]",yR="[object Uint8ClampedArray]",mR="[object Uint16Array]",bR="[object Uint32Array]",Tn={};Tn[fR]=Tn[dR]=Tn[hR]=Tn[pR]=Tn[vR]=Tn[gR]=Tn[yR]=Tn[mR]=Tn[bR]=!0,Tn[Zj]=Tn[Kj]=Tn[lR]=Tn[Qj]=Tn[uR]=Tn[Jj]=Tn[tR]=Tn[eR]=Tn[nR]=Tn[rR]=Tn[iR]=Tn[aR]=Tn[oR]=Tn[sR]=Tn[cR]=!1;function _R(t){return ii(t)&&x0(t.length)&&!!Tn[xr(t)]}var xR=_R;function OR(t){return function(e){return t(e)}}var O0=OR,Db=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ml=Db&&typeof module=="object"&&module&&!module.nodeType&&module,wR=Ml&&Ml.exports===Db,w0=wR&&ei.process,SR=function(){try{var t=Ml&&Ml.require&&Ml.require("util").types;return t||w0&&w0.binding&&w0.binding("util")}catch(e){}}(),nc=SR,Fb=nc&&nc.isTypedArray,MR=Fb?O0(Fb):xR,S0=MR,ER=Object.prototype,AR=ER.hasOwnProperty;function PR(t,e){var n=Xt(t),r=!n&&wl(t),i=!n&&!r&&Sl(t),a=!n&&!r&&!i&&S0(t),o=n||r||i||a,s=o?Nj(t.length,String):[],c=s.length;for(var l in t)(e||AR.call(t,l))&&!(o&&(l=="length"||i&&(l=="offset"||l=="parent")||a&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||jf(l,c)))&&s.push(l);return s}var Bb=PR,TR=Object.prototype;function kR(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||TR;return t===n}var Rf=kR;function CR(t,e){return function(n){return t(e(n))}}var zb=CR,LR=zb(Object.keys,Object),NR=LR,jR=Object.prototype,RR=jR.hasOwnProperty;function IR(t){if(!Rf(t))return NR(t);var e=[];for(var n in Object(t))RR.call(t,n)&&n!="constructor"&&e.push(n);return e}var DR=IR;function FR(t){return t!=null&&x0(t.length)&&!Wt(t)}var ao=FR;function BR(t){return ao(t)?Bb(t):DR(t)}var Qo=BR;function zR(t){return Tb(t,Qo,_0)}var M0=zR,GR=1,WR=Object.prototype,YR=WR.hasOwnProperty;function HR(t,e,n,r,i,a){var o=n&GR,s=M0(t),c=s.length,l=M0(e),u=l.length;if(c!=u&&!o)return!1;for(var f=c;f--;){var d=s[f];if(!(o?d in e:YR.call(e,d)))return!1}var h=a.get(t),p=a.get(e);if(h&&p)return h==e&&p==t;var v=!0;a.set(t,e),a.set(e,t);for(var g=o;++f=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a}function kD(t,e){return function(n,r){e(n,r,t)}}function Vht(t,e,n,r,i,a){function o(y){if(y!==void 0&&typeof y!="function")throw new TypeError("Function expected");return y}for(var s=r.kind,c=s==="getter"?"get":s==="setter"?"set":"value",l=!e&&t?r.static?t:t.prototype:null,u=e||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),f,d=!1,h=n.length-1;h>=0;h--){var p={};for(var v in r)p[v]=v==="access"?{}:r[v];for(var v in r.access)p.access[v]=r.access[v];p.addInitializer=function(y){if(d)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(y||null))};var g=(0,n[h])(s==="accessor"?{get:u.get,set:u.set}:u[c],p);if(s==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(f=o(g.get))&&(u.get=f),(f=o(g.set))&&(u.set=f),(f=o(g.init))&&i.unshift(f)}else(f=o(g))&&(s==="field"?i.unshift(f):u[c]=f)}l&&Object.defineProperty(l,r.name,u),d=!0}function Uht(t,e,n){for(var r=arguments.length>2,i=0;i0&&a[a.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]=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 D(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function ND(){for(var t=[],e=0;e1||s(d,h)})})}function s(d,h){try{c(r[d](h))}catch(p){f(a[0][3],p)}}function c(d){d.value instanceof Cl?Promise.resolve(d.value.v).then(l,u):f(a[0][2],d)}function l(d){s("next",d)}function u(d){s("throw",d)}function f(d,h){d(h),a.shift(),a.length&&s(a[0][0],a[0][1])}}function RD(t){var e,n;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,a){e[i]=t[i]?function(o){return(n=!n)?{value:Cl(t[i](o)),done:!1}:a?a(o):o}:a}}function ID(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof jr=="function"?jr(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=t[a]&&function(o){return new Promise(function(s,c){o=t[a](o),i(s,c,o.done,o.value)})}}function i(a,o,s,c){Promise.resolve(c).then(function(l){a({value:l,done:s})},o)}}function DD(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var FD=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function BD(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&Y0(e,t,n);return FD(e,t),e}function zD(t){return t&&t.__esModule?t:{default:t}}function Yf(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)}function GD(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n}function WD(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function YD(t,e,n){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose]}if(typeof r!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:r,async:n})}else n&&t.stack.push({async:!0});return e}var HD=typeof SuppressedError=="function"?SuppressedError:function(t,e,n){var r=new Error(n);return r.name="SuppressedError",r.error=t,r.suppressed=e,r};function $D(t){function e(r){t.error=t.hasError?new HD(r,t.error,"An error was suppressed during disposal."):r,t.hasError=!0}function n(){for(;t.stack.length;){var r=t.stack.pop();try{var i=r.dispose&&r.dispose.call(r.value);if(r.async)return Promise.resolve(i).then(n,function(a){return e(a),n()})}catch(a){e(a)}}if(t.hasError)throw t.error}return n()}var Zht={__extends:It,__assign:Q,__rest:On,__decorate:TD,__param:kD,__metadata:CD,__awaiter:es,__generator:ns,__createBinding:Y0,__exportStar:LD,__values:jr,__read:D,__spread:ND,__spreadArrays:M_,__spreadArray:dt,__await:Cl,__asyncGenerator:jD,__asyncDelegator:RD,__asyncValues:ID,__makeTemplateObject:DD,__importStar:BD,__importDefault:zD,__classPrivateFieldGet:Yf,__classPrivateFieldSet:GD,__classPrivateFieldIn:WD,__addDisposableResource:YD,__disposeResources:$D},VD=tt(26729),H0=VD,en=1e-6,Dn=typeof Float32Array!="undefined"?Float32Array:Array,Kht=Math.random;function Qht(t){Dn=t}var UD=Math.PI/180;function Jht(t){return t*UD}function tpt(t,e){return Math.abs(t-e)<=en*Math.max(1,Math.abs(t),Math.abs(e))}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});function Se(){var t=new Dn(3);return Dn!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function ja(t){var e=new Dn(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Ra(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function De(t,e,n){var r=new Dn(3);return r[0]=t,r[1]=e,r[2]=n,r}function ai(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Ki(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function oc(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function E_(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function XD(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function ept(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function npt(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function rpt(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function ipt(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}function apt(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}function opt(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function $0(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function spt(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}function qD(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)}function cpt(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}function lpt(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r}function upt(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function fpt(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function rs(t,e){var n=e[0],r=e[1],i=e[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function Qi(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Hf(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[0],s=n[1],c=n[2];return t[0]=i*c-a*s,t[1]=a*o-r*c,t[2]=r*s-i*o,t}function V0(t,e,n,r){var i=e[0],a=e[1],o=e[2];return t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=o+r*(n[2]-o),t}function dpt(t,e,n,r,i,a){var o=a*a,s=o*(2*a-3)+1,c=o*(a-2)+a,l=o*(a-1),u=o*(3-2*a);return t[0]=e[0]*s+n[0]*c+r[0]*l+i[0]*u,t[1]=e[1]*s+n[1]*c+r[1]*l+i[1]*u,t[2]=e[2]*s+n[2]*c+r[2]*l+i[2]*u,t}function hpt(t,e,n,r,i,a){var o=1-a,s=o*o,c=a*a,l=s*o,u=3*a*s,f=3*c*o,d=c*a;return t[0]=e[0]*l+n[0]*u+r[0]*f+i[0]*d,t[1]=e[1]*l+n[1]*u+r[1]*f+i[1]*d,t[2]=e[2]*l+n[2]*u+r[2]*f+i[2]*d,t}function ppt(t,e){e=e||1;var n=glMatrix.RANDOM()*2*Math.PI,r=glMatrix.RANDOM()*2-1,i=Math.sqrt(1-r*r)*e;return t[0]=Math.cos(n)*i,t[1]=Math.sin(n)*i,t[2]=r*e,t}function fr(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[3]*r+n[7]*i+n[11]*a+n[15];return o=o||1,t[0]=(n[0]*r+n[4]*i+n[8]*a+n[12])/o,t[1]=(n[1]*r+n[5]*i+n[9]*a+n[13])/o,t[2]=(n[2]*r+n[6]*i+n[10]*a+n[14])/o,t}function ZD(t,e,n){var r=e[0],i=e[1],a=e[2];return t[0]=r*n[0]+i*n[3]+a*n[6],t[1]=r*n[1]+i*n[4]+a*n[7],t[2]=r*n[2]+i*n[5]+a*n[8],t}function KD(t,e,n){var r=n[0],i=n[1],a=n[2],o=n[3],s=e[0],c=e[1],l=e[2],u=i*l-a*c,f=a*s-r*l,d=r*c-i*s,h=i*d-a*f,p=a*u-r*d,v=r*f-i*u,g=o*2;return u*=g,f*=g,d*=g,h*=2,p*=2,v*=2,t[0]=s+u+h,t[1]=c+f+p,t[2]=l+d+v,t}function vpt(t,e,n,r){var i=[],a=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],a[0]=i[0],a[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),a[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t}function gpt(t,e,n,r){var i=[],a=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],a[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),a[1]=i[1],a[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t}function ypt(t,e,n,r){var i=[],a=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],a[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),a[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),a[2]=i[2],t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t}function mpt(t,e){var n=t[0],r=t[1],i=t[2],a=e[0],o=e[1],s=e[2],c=Math.sqrt(n*n+r*r+i*i),l=Math.sqrt(a*a+o*o+s*s),u=c*l,f=u&&Qi(t,e)/u;return Math.acos(Math.min(Math.max(f,-1),1))}function bpt(t){return t[0]=0,t[1]=0,t[2]=0,t}function _pt(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function xpt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Ll(t,e){var n=t[0],r=t[1],i=t[2],a=e[0],o=e[1],s=e[2];return Math.abs(n-a)<=en*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-o)<=en*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=en*Math.max(1,Math.abs(i),Math.abs(s))}var Opt=null,wpt=null,Spt=null,A_=qD,Mpt=null,P_=Ra,Ept=null,Apt=function(){var t=Se();return function(e,n,r,i,a,o){var s,c;for(n||(n=3),r||(r=0),i?c=Math.min(i*n+r,e.length):c=e.length,s=r;s0?(n[0]=(s*o+u*r+c*a-l*i)*2/f,n[1]=(c*o+u*i+l*r-s*a)*2/f,n[2]=(l*o+u*a+s*i-c*r)*2/f):(n[0]=(s*o+u*r+c*a-l*i)*2,n[1]=(c*o+u*i+l*r-s*a)*2,n[2]=(l*o+u*a+s*i-c*r)*2),D_(t,e,n),t}function Vf(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function cc(t,e){var n=e[0],r=e[1],i=e[2],a=e[4],o=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(a,o,s),t[2]=Math.hypot(c,l,u),t}function Uf(t,e){var n=new Dn(3);cc(n,e);var r=1/n[0],i=1/n[1],a=1/n[2],o=e[0]*r,s=e[1]*i,c=e[2]*a,l=e[4]*r,u=e[5]*i,f=e[6]*a,d=e[8]*r,h=e[9]*i,p=e[10]*a,v=o+u+p,g=0;return v>0?(g=Math.sqrt(v+1)*2,t[3]=.25*g,t[0]=(f-h)/g,t[1]=(d-c)/g,t[2]=(s-l)/g):o>u&&o>p?(g=Math.sqrt(1+o-u-p)*2,t[3]=(f-h)/g,t[0]=.25*g,t[1]=(s+l)/g,t[2]=(d+c)/g):u>p?(g=Math.sqrt(1+u-o-p)*2,t[3]=(d-c)/g,t[0]=(s+l)/g,t[1]=.25*g,t[2]=(f+h)/g):(g=Math.sqrt(1+p-o-u)*2,t[3]=(s-l)/g,t[0]=(d+c)/g,t[1]=(f+h)/g,t[2]=.25*g),t}function r6(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=e[3],c=i+i,l=a+a,u=o+o,f=i*c,d=i*l,h=i*u,p=a*l,v=a*u,g=o*u,y=s*c,m=s*l,b=s*u,_=r[0],x=r[1],O=r[2];return t[0]=(1-(p+g))*_,t[1]=(d+b)*_,t[2]=(h-m)*_,t[3]=0,t[4]=(d-b)*x,t[5]=(1-(f+g))*x,t[6]=(v+y)*x,t[7]=0,t[8]=(h+m)*O,t[9]=(v-y)*O,t[10]=(1-(f+p))*O,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function Nl(t,e,n,r,i){var a=e[0],o=e[1],s=e[2],c=e[3],l=a+a,u=o+o,f=s+s,d=a*l,h=a*u,p=a*f,v=o*u,g=o*f,y=s*f,m=c*l,b=c*u,_=c*f,x=r[0],O=r[1],w=r[2],S=i[0],M=i[1],E=i[2],A=(1-(v+y))*x,C=(h+_)*x,P=(p-b)*x,T=(h-_)*O,k=(1-(d+y))*O,N=(g+m)*O,F=(p+b)*w,R=(g-m)*w,I=(1-(d+v))*w;return t[0]=A,t[1]=C,t[2]=P,t[3]=0,t[4]=T,t[5]=k,t[6]=N,t[7]=0,t[8]=F,t[9]=R,t[10]=I,t[11]=0,t[12]=n[0]+S-(A*S+T*M+F*E),t[13]=n[1]+M-(C*S+k*M+R*E),t[14]=n[2]+E-(P*S+N*M+I*E),t[15]=1,t}function q0(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n+n,s=r+r,c=i+i,l=n*o,u=r*o,f=r*s,d=i*o,h=i*s,p=i*c,v=a*o,g=a*s,y=a*c;return t[0]=1-f-p,t[1]=u+y,t[2]=d-g,t[3]=0,t[4]=u-y,t[5]=1-l-p,t[6]=h+v,t[7]=0,t[8]=d+g,t[9]=h-v,t[10]=1-l-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function i6(t,e,n,r,i,a,o){var s=1/(n-e),c=1/(i-r),l=1/(a-o);return t[0]=a*2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a*2*c,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*c,t[10]=(o+a)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*l,t[15]=0,t}function F_(t,e,n,r,i){var a=1/Math.tan(e/2),o;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,i!=null&&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 a6=F_;function o6(t,e,n,r,i){var a=1/Math.tan(e/2),o;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,i!=null&&i!==1/0?(o=1/(r-i),t[10]=i*o,t[14]=i*r*o):(t[10]=-1,t[14]=-r),t}function s6(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),c=2/(o+s),l=2/(i+a);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]=-((o-s)*c*.5),t[9]=(i-a)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t}function B_(t,e,n,r,i,a,o){var s=1/(e-n),c=1/(r-i),l=1/(a-o);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]=(o+a)*l,t[15]=1,t}var z_=B_;function G_(t,e,n,r,i,a,o){var s=1/(e-n),c=1/(r-i),l=1/(a-o);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]=a*l,t[15]=1,t}function W_(t,e,n,r){var i,a,o,s,c,l,u,f,d,h,p=e[0],v=e[1],g=e[2],y=r[0],m=r[1],b=r[2],_=n[0],x=n[1],O=n[2];return Math.abs(p-_)0&&(h=1/Math.sqrt(h),u*=h,f*=h,d*=h);var p=c*d-l*f,v=l*u-s*d,g=s*f-c*u;return h=p*p+v*v+g*g,h>0&&(h=1/Math.sqrt(h),p*=h,v*=h,g*=h),t[0]=p,t[1]=v,t[2]=g,t[3]=0,t[4]=f*g-d*v,t[5]=d*p-u*g,t[6]=u*v-f*p,t[7]=0,t[8]=u,t[9]=f,t[10]=d,t[11]=0,t[12]=i,t[13]=a,t[14]=o,t[15]=1,t}function l6(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function u6(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function f6(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t}function 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}function d6(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t}function h6(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t}function p6(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function v6(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=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],v=t[13],g=t[14],y=t[15],m=e[0],b=e[1],_=e[2],x=e[3],O=e[4],w=e[5],S=e[6],M=e[7],E=e[8],A=e[9],C=e[10],P=e[11],T=e[12],k=e[13],N=e[14],F=e[15];return Math.abs(n-m)<=en*Math.max(1,Math.abs(n),Math.abs(m))&&Math.abs(r-b)<=en*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-_)<=en*Math.max(1,Math.abs(i),Math.abs(_))&&Math.abs(a-x)<=en*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(o-O)<=en*Math.max(1,Math.abs(o),Math.abs(O))&&Math.abs(s-w)<=en*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(c-S)<=en*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(l-M)<=en*Math.max(1,Math.abs(l),Math.abs(M))&&Math.abs(u-E)<=en*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(f-A)<=en*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(d-C)<=en*Math.max(1,Math.abs(d),Math.abs(C))&&Math.abs(h-P)<=en*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(p-T)<=en*Math.max(1,Math.abs(p),Math.abs(T))&&Math.abs(v-k)<=en*Math.max(1,Math.abs(v),Math.abs(k))&&Math.abs(g-N)<=en*Math.max(1,Math.abs(g),Math.abs(N))&&Math.abs(y-F)<=en*Math.max(1,Math.abs(y),Math.abs(F))}var H_=Rr,g6=Y_;function $_(){var t=new Dn(9);return Dn!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function y6(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}function Ppt(t){var e=new glMatrix.ARRAY_TYPE(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}function Tpt(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}function m6(t,e,n,r,i,a,o,s,c){var l=new Dn(9);return l[0]=t,l[1]=e,l[2]=n,l[3]=r,l[4]=i,l[5]=a,l[6]=o,l[7]=s,l[8]=c,l}function kpt(t,e,n,r,i,a,o,s,c,l){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l,t}function Cpt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Lpt(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function Npt(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=u*o-s*l,d=-u*a+s*c,h=l*a-o*c,p=n*f+r*d+i*h;return p?(p=1/p,t[0]=f*p,t[1]=(-u*r+i*l)*p,t[2]=(s*r-i*o)*p,t[3]=d*p,t[4]=(u*n-i*c)*p,t[5]=(-s*n+i*a)*p,t[6]=h*p,t[7]=(-l*n+r*c)*p,t[8]=(o*n-r*a)*p,t):null}function jpt(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=e[8];return t[0]=o*u-s*l,t[1]=i*l-r*u,t[2]=r*s-i*o,t[3]=s*c-a*u,t[4]=n*u-i*c,t[5]=i*a-n*s,t[6]=a*l-o*c,t[7]=r*c-n*l,t[8]=n*o-r*a,t}function Rpt(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8];return e*(l*a-o*c)+n*(-l*i+o*s)+r*(c*i-a*s)}function Ipt(t,e,n){var r=e[0],i=e[1],a=e[2],o=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],v=n[3],g=n[4],y=n[5],m=n[6],b=n[7],_=n[8];return t[0]=d*r+h*o+p*l,t[1]=d*i+h*s+p*u,t[2]=d*a+h*c+p*f,t[3]=v*r+g*o+y*l,t[4]=v*i+g*s+y*u,t[5]=v*a+g*c+y*f,t[6]=m*r+b*o+_*l,t[7]=m*i+b*s+_*u,t[8]=m*a+b*c+_*f,t}function Dpt(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],d=n[0],h=n[1];return t[0]=r,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=c,t[6]=d*r+h*o+l,t[7]=d*i+h*s+u,t[8]=d*a+h*c+f,t}function Fpt(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],d=Math.sin(n),h=Math.cos(n);return t[0]=h*r+d*o,t[1]=h*i+d*s,t[2]=h*a+d*c,t[3]=h*o-d*r,t[4]=h*s-d*i,t[5]=h*c-d*a,t[6]=l,t[7]=u,t[8]=f,t}function Bpt(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function zpt(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function Gpt(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}function Wpt(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Ypt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function Hpt(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n+n,s=r+r,c=i+i,l=n*o,u=r*o,f=r*s,d=i*o,h=i*s,p=i*c,v=a*o,g=a*s,y=a*c;return t[0]=1-f-p,t[3]=u-y,t[6]=d+g,t[1]=u+y,t[4]=1-l-p,t[7]=h-v,t[2]=d-g,t[5]=h+v,t[8]=1-l-f,t}function $pt(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=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],v=e[13],g=e[14],y=e[15],m=n*s-r*o,b=n*c-i*o,_=n*l-a*o,x=r*c-i*s,O=r*l-a*s,w=i*l-a*c,S=u*v-f*p,M=u*g-d*p,E=u*y-h*p,A=f*g-d*v,C=f*y-h*v,P=d*y-h*g,T=m*P-b*C+_*A+x*E-O*M+w*S;return T?(T=1/T,t[0]=(s*P-c*C+l*A)*T,t[1]=(c*E-o*P-l*M)*T,t[2]=(o*C-s*E+l*S)*T,t[3]=(i*C-r*P-a*A)*T,t[4]=(n*P-i*E+a*M)*T,t[5]=(r*E-n*C-a*S)*T,t[6]=(v*w-g*O+y*x)*T,t[7]=(g*_-p*w-y*b)*T,t[8]=(p*O-v*_+y*m)*T,t):null}function Vpt(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function Upt(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function Xpt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function qpt(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}function Zpt(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}function Kpt(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}function Qpt(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}function Jpt(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]}function t0t(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],f=e[0],d=e[1],h=e[2],p=e[3],v=e[4],g=e[5],y=e[6],m=e[7],b=e[8];return Math.abs(n-f)<=glMatrix.EPSILON*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(r-d)<=glMatrix.EPSILON*Math.max(1,Math.abs(r),Math.abs(d))&&Math.abs(i-h)<=glMatrix.EPSILON*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-p)<=glMatrix.EPSILON*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(o-v)<=glMatrix.EPSILON*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(s-g)<=glMatrix.EPSILON*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(c-y)<=glMatrix.EPSILON*Math.max(1,Math.abs(c),Math.abs(y))&&Math.abs(l-m)<=glMatrix.EPSILON*Math.max(1,Math.abs(l),Math.abs(m))&&Math.abs(u-b)<=glMatrix.EPSILON*Math.max(1,Math.abs(u),Math.abs(b))}var e0t=null,n0t=null;function lc(){var t=new Dn(4);return Dn!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function b6(t){var e=new Dn(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function _6(t,e,n,r){var i=new Dn(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function x6(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function O6(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function w6(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}function r0t(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}function i0t(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}function a0t(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}function o0t(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}function s0t(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}function c0t(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[3]=Math.min(e[3],n[3]),t}function l0t(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[3]=Math.max(e[3],n[3]),t}function u0t(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}function S6(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}function f0t(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}function d0t(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.hypot(n,r,i,a)}function h0t(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return n*n+r*r+i*i+a*a}function M6(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.hypot(e,n,r,i)}function E6(t){var e=t[0],n=t[1],r=t[2],i=t[3];return e*e+n*n+r*r+i*i}function p0t(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}function v0t(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}function A6(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n*n+r*r+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),t[0]=n*o,t[1]=r*o,t[2]=i*o,t[3]=a*o,t}function P6(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function g0t(t,e,n,r){var i=n[0]*r[1]-n[1]*r[0],a=n[0]*r[2]-n[2]*r[0],o=n[0]*r[3]-n[3]*r[0],s=n[1]*r[2]-n[2]*r[1],c=n[1]*r[3]-n[3]*r[1],l=n[2]*r[3]-n[3]*r[2],u=e[0],f=e[1],d=e[2],h=e[3];return t[0]=f*l-d*c+h*s,t[1]=-(u*l)+d*o-h*a,t[2]=u*c-f*o+h*i,t[3]=-(u*s)+f*a-d*i,t}function T6(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=o+r*(n[2]-o),t[3]=s+r*(n[3]-s),t}function y0t(t,e){e=e||1;var n,r,i,a,o,s;do n=glMatrix.RANDOM()*2-1,r=glMatrix.RANDOM()*2-1,o=n*n+r*r;while(o>=1);do i=glMatrix.RANDOM()*2-1,a=glMatrix.RANDOM()*2-1,s=i*i+a*a;while(s>=1);var c=Math.sqrt((1-o)/s);return t[0]=e*n,t[1]=e*r,t[2]=e*i*c,t[3]=e*a*c,t}function jl(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*o,t[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*o,t[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*o,t[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*o,t}function m0t(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[0],s=n[1],c=n[2],l=n[3],u=l*r+s*a-c*i,f=l*i+c*r-o*a,d=l*a+o*i-s*r,h=-o*r-s*i-c*a;return t[0]=u*l+h*-o+f*-c-d*-s,t[1]=f*l+h*-s+d*-o-u*-c,t[2]=d*l+h*-c+u*-s-f*-o,t[3]=e[3],t}function b0t(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function _0t(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function k6(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function C6(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=e[0],s=e[1],c=e[2],l=e[3];return Math.abs(n-o)<=en*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-s)<=en*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-c)<=en*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(a-l)<=en*Math.max(1,Math.abs(a),Math.abs(l))}var x0t=null,O0t=null,w0t=null,S0t=null,M0t=null,E0t=null,A0t=null,P0t=function(){var t=lc();return function(e,n,r,i,a,o){var s,c;for(n||(n=4),r||(r=0),i?c=Math.min(i*n+r,e.length):c=e.length,s=r;sglMatrix.EPSILON?(t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r):(t[0]=1,t[1]=0,t[2]=0),n}function C0t(t,e){var n=I6(t,e);return Math.acos(2*n*n-1)}function so(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=n[0],c=n[1],l=n[2],u=n[3];return t[0]=r*u+o*s+i*l-a*c,t[1]=i*u+o*c+a*s-r*l,t[2]=a*u+o*l+r*c-i*s,t[3]=o*u-r*s-i*c-a*l,t}function L0t(t,e,n){n*=.5;var r=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(n),c=Math.cos(n);return t[0]=r*c+o*s,t[1]=i*c+a*s,t[2]=a*c-i*s,t[3]=o*c-r*s,t}function N0t(t,e,n){n*=.5;var r=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(n),c=Math.cos(n);return t[0]=r*c-a*s,t[1]=i*c+o*s,t[2]=a*c+r*s,t[3]=o*c-i*s,t}function j0t(t,e,n){n*=.5;var r=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(n),c=Math.cos(n);return t[0]=r*c+i*s,t[1]=i*c-r*s,t[2]=a*c+o*s,t[3]=o*c-a*s,t}function R0t(t,e){var n=e[0],r=e[1],i=e[2];return t[0]=n,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),t}function L6(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=Math.sqrt(n*n+r*r+i*i),s=Math.exp(a),c=o>0?s*Math.sin(o)/o:0;return t[0]=n*c,t[1]=r*c,t[2]=i*c,t[3]=s*Math.cos(o),t}function N6(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=Math.sqrt(n*n+r*r+i*i),s=o>0?Math.atan2(o,a)/o:0;return t[0]=n*s,t[1]=r*s,t[2]=i*s,t[3]=.5*Math.log(n*n+r*r+i*i+a*a),t}function I0t(t,e,n){return N6(t,e),R6(t,t,n),L6(t,t),t}function Z0(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=e[3],c=n[0],l=n[1],u=n[2],f=n[3],d,h,p,v,g;return h=i*c+a*l+o*u+s*f,h<0&&(h=-h,c=-c,l=-l,u=-u,f=-f),1-h>en?(d=Math.acos(h),p=Math.sin(d),v=Math.sin((1-r)*d)/p,g=Math.sin(r*d)/p):(v=1-r,g=r),t[0]=v*i+g*c,t[1]=v*a+g*l,t[2]=v*o+g*u,t[3]=v*s+g*f,t}function D0t(t){var e=glMatrix.RANDOM(),n=glMatrix.RANDOM(),r=glMatrix.RANDOM(),i=Math.sqrt(1-e),a=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*n),t[1]=i*Math.cos(2*Math.PI*n),t[2]=a*Math.sin(2*Math.PI*r),t[3]=a*Math.cos(2*Math.PI*r),t}function K0(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n*n+r*r+i*i+a*a,s=o?1/o:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=a*s,t}function F0t(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function j6(t,e){var n=e[0]+e[4]+e[8],r;if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[i*3+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[i*3+i]-e[a*3+a]-e[o*3+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[a*3+o]-e[o*3+a])*r,t[a]=(e[a*3+i]+e[i*3+a])*r,t[o]=(e[o*3+i]+e[i*3+o])*r}return t}function Xf(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var a=Math.sin(e),o=Math.cos(e),s=Math.sin(n),c=Math.cos(n),l=Math.sin(r),u=Math.cos(r);return t[0]=a*c*u-o*s*l,t[1]=o*s*u+a*c*l,t[2]=o*c*l-a*s*u,t[3]=o*c*u+a*s*l,t}function B0t(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var z0t=b6,Q0=_6,qf=x6,G0t=O6,W0t=w6,V_=so,R6=S6,I6=P6,Y0t=T6,H0t=M6,$0t=null,V0t=E6,U0t=null,Zf=A6,X0t=k6,q0t=C6,Z0t=function(){var t=Se(),e=De(1,0,0),n=De(0,1,0);return function(r,i,a){var o=Qi(i,a);return o<-.999999?(Hf(t,e,i),P_(t)<1e-6&&Hf(t,n,i),rs(t,t),oo(r,t,Math.PI),r):o>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(Hf(t,i,a),r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=1+o,Zf(r,r))}}(),K0t=function(){var t=tr(),e=tr();return function(n,r,i,a,o,s){return Z0(t,r,o,s),Z0(e,i,a,s),Z0(n,t,e,2*s*(1-s)),n}}(),Q0t=function(){var t=$_();return function(e,n,r,i){return t[0]=r[0],t[3]=r[1],t[6]=r[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-n[0],t[5]=-n[1],t[8]=-n[2],Zf(e,j6(e,t))}}();function D6(){var t=new Dn(2);return Dn!=Float32Array&&(t[0]=0,t[1]=0),t}function J0t(t){var e=new glMatrix.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e}function F6(t,e){var n=new Dn(2);return n[0]=t,n[1]=e,n}function B6(t,e){return t[0]=e[0],t[1]=e[1],t}function tvt(t,e,n){return t[0]=e,t[1]=n,t}function evt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function nvt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function rvt(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function ivt(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function avt(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function ovt(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function svt(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function cvt(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}function lvt(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function uvt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function fvt(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}function dvt(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.hypot(n,r)}function hvt(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function pvt(t){var e=t[0],n=t[1];return Math.hypot(e,n)}function vvt(t){var e=t[0],n=t[1];return e*e+n*n}function gvt(t,e){return t[0]=-e[0],t[1]=-e[1],t}function yvt(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function z6(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function G6(t,e){return t[0]*e[0]+t[1]*e[1]}function mvt(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}function bvt(t,e,n,r){var i=e[0],a=e[1];return t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t}function _vt(t,e){e=e||1;var n=glMatrix.RANDOM()*2*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}function xvt(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t}function Ovt(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}function wvt(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}function Svt(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}function Mvt(t,e,n,r){var i=e[0]-n[0],a=e[1]-n[1],o=Math.sin(r),s=Math.cos(r);return t[0]=i*s-a*o+n[0],t[1]=i*o+a*s+n[1],t}function Evt(t,e){var n=t[0],r=t[1],i=e[0],a=e[1],o=Math.sqrt(n*n+r*r)*Math.sqrt(i*i+a*a),s=o&&(n*i+r*a)/o;return Math.acos(Math.min(Math.max(s,-1),1))}function Avt(t){return t[0]=0,t[1]=0,t}function Pvt(t){return"vec2("+t[0]+", "+t[1]+")"}function W6(t,e){return t[0]===e[0]&&t[1]===e[1]}function Tvt(t,e){var n=t[0],r=t[1],i=e[0],a=e[1];return Math.abs(n-i)<=glMatrix.EPSILON*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(r-a)<=glMatrix.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))}var kvt=null,Cvt=null,Lvt=null,Nvt=null,jvt=null,Rvt=null,Ivt=null,Dvt=function(){var t=D6();return function(e,n,r,i,a,o){var s,c;for(n||(n=2),r||(r=0),i?c=Math.min(i*n+r,e.length):c=e.length,s=r;sn?n:t},Fn=U6,Il={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function U_(t){return Array.isArray(t)&&t.every(function(e){var n=e[0].toLowerCase();return Il[n]===e.length-1&&"achlmqstvz".includes(n)})}function X_(t){return U_(t)&&t.every(function(e){var n=e[0];return n===n.toUpperCase()})}function q_(t){return X_(t)&&t.every(function(e){var n=e[0];return"ACLMQZ".includes(n)})}var Z_={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function K_(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=Il[n]&&(n==="m"&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e=e==="m"?"l":"L"):t.segments.push([e].concat(r.splice(0,Il[n]))),!!Il[n]););}function X6(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);if(r===48){t.param=0,t.index+=1;return}if(r===49){t.param=1,t.index+=1;return}t.err='[path-util]: invalid Arc flag "'+n[e]+'", expecting 0 or 1 at index '+e}function q6(t){return t>=48&&t<=57||t===43||t===45||t===46}function uc(t){return t>=48&&t<=57}function Z6(t){var e=t.max,n=t.pathValue,r=t.index,i=r,a=!1,o=!1,s=!1,c=!1,l;if(i>=e){t.err="[path-util]: Invalid path value at index "+i+', "pathValue" is missing param';return}if(l=n.charCodeAt(i),(l===43||l===45)&&(i+=1,l=n.charCodeAt(i)),!uc(l)&&l!==46){t.err="[path-util]: Invalid path value at index "+i+', "'+n[i]+'" is not a number';return}if(l!==46){if(a=l===48,i+=1,l=n.charCodeAt(i),a&&i=5760&&e.includes(t)}function Kf(t){for(var e=t.pathValue,n=t.max;t.index0;o-=1){if(J6(i)&&(o===3||o===4)?X6(t):Z6(t),t.err.length)return;t.data.push(t.param),Kf(t),t.index=t.max||!q6(n.charCodeAt(t.index)))break}K_(t)}var e8=function(){function t(e){this.pathValue=e,this.segments=[],this.max=e.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}return t}();function n8(t){if(U_(t))return[].concat(t);var e=new e8(t);for(Kf(e);e.index=a)o={x:n,y:r};else{var s=co([t,e],[n,r],i/a),c=s[0],l=s[1];o={x:c,y:l}}return{length:a,point:o,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function Q_(t,e){var n=t.x,r=t.y,i=e.x,a=e.y,o=n*i+r*a,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(a,2))),c=n*a-r*i<0?-1:1,l=c*Math.acos(o/s);return l}function a8(t,e,n,r,i,a,o,s,c,l){var u=Math.abs,f=Math.sin,d=Math.cos,h=Math.sqrt,p=Math.PI,v=u(n),g=u(r),y=(i%360+360)%360,m=y*(p/180);if(t===s&&e===c)return{x:t,y:e};if(v===0||g===0)return J0(t,e,s,c,l).point;var b=(t-s)/2,_=(e-c)/2,x={x:d(m)*b+f(m)*_,y:-f(m)*b+d(m)*_},O=Math.pow(x.x,2)/Math.pow(v,2)+Math.pow(x.y,2)/Math.pow(g,2);O>1&&(v*=h(O),g*=h(O));var w=Math.pow(v,2)*Math.pow(g,2)-Math.pow(v,2)*Math.pow(x.y,2)-Math.pow(g,2)*Math.pow(x.x,2),S=Math.pow(v,2)*Math.pow(x.y,2)+Math.pow(g,2)*Math.pow(x.x,2),M=w/S;M=M<0?0:M;var E=(a!==o?1:-1)*h(M),A={x:E*(v*x.y/g),y:E*(-(g*x.x)/v)},C={x:d(m)*A.x-f(m)*A.y+(t+s)/2,y:f(m)*A.x+d(m)*A.y+(e+c)/2},P={x:(x.x-A.x)/v,y:(x.y-A.y)/g},T=Q_({x:1,y:0},P),k={x:(-x.x-A.x)/v,y:(-x.y-A.y)/g},N=Q_(P,k);!o&&N>0?N-=2*p:o&&N<0&&(N+=2*p),N%=2*p;var F=T+N*l,R=v*d(F),I=g*f(F),z={x:d(m)*R-f(m)*I+C.x,y:f(m)*R+d(m)*I+C.y};return z}function o8(t,e,n,r,i,a,o,s,c,l,u){var f,d=u.bbox,h=d===void 0?!0:d,p=u.length,v=p===void 0?!0:p,g=u.sampleSize,y=g===void 0?30:g,m=typeof l=="number",b=t,_=e,x=0,O=[b,_,x],w=[b,_],S=0,M={x:0,y:0},E=[{x:b,y:_}];m&&l<=0&&(M={x:b,y:_});for(var A=0;A<=y;A+=1){if(S=A/y,f=a8(t,e,n,r,i,a,o,s,c,S),b=f.x,_=f.y,h&&E.push({x:b,y:_}),v&&(x+=oi(w,[b,_])),w=[b,_],m&&x>=l&&l>O[2]){var C=(x-l)/(x-O[2]);M={x:w[0]*(1-C)+O[0]*C,y:w[1]*(1-C)+O[1]*C}}O=[b,_,x]}return m&&l>=x&&(M={x:s,y:c}),{length:x,point:M,min:{x:Math.min.apply(null,E.map(function(P){return P.x})),y:Math.min.apply(null,E.map(function(P){return P.y}))},max:{x:Math.max.apply(null,E.map(function(P){return P.x})),y:Math.max.apply(null,E.map(function(P){return P.y}))}}}function s8(t,e,n,r,i,a,o,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)*o,y:Math.pow(l,3)*e+3*Math.pow(l,2)*c*r+3*l*Math.pow(c,2)*a+Math.pow(c,3)*s}}function J_(t,e,n,r,i,a,o,s,c,l){var u,f=l.bbox,d=f===void 0?!0:f,h=l.length,p=h===void 0?!0:h,v=l.sampleSize,g=v===void 0?10:v,y=typeof c=="number",m=t,b=e,_=0,x=[m,b,_],O=[m,b],w=0,S={x:0,y:0},M=[{x:m,y:b}];y&&c<=0&&(S={x:m,y:b});for(var E=0;E<=g;E+=1){if(w=E/g,u=s8(t,e,n,r,i,a,o,s,w),m=u.x,b=u.y,d&&M.push({x:m,y:b}),p&&(_+=oi(O,[m,b])),O=[m,b],y&&_>=c&&c>x[2]){var A=(_-c)/(_-x[2]);S={x:O[0]*(1-A)+x[0]*A,y:O[1]*(1-A)+x[1]*A}}x=[m,b,_]}return y&&c>=_&&(S={x:o,y:s}),{length:_,point:S,min:{x:Math.min.apply(null,M.map(function(C){return C.x})),y:Math.min.apply(null,M.map(function(C){return C.y}))},max:{x:Math.max.apply(null,M.map(function(C){return C.x})),y:Math.max.apply(null,M.map(function(C){return C.y}))}}}function c8(t,e,n,r,i,a,o){var s=1-o;return{x:Math.pow(s,2)*t+2*s*o*n+Math.pow(o,2)*i,y:Math.pow(s,2)*e+2*s*o*r+Math.pow(o,2)*a}}function l8(t,e,n,r,i,a,o,s){var c,l=s.bbox,u=l===void 0?!0:l,f=s.length,d=f===void 0?!0:f,h=s.sampleSize,p=h===void 0?10:h,v=typeof o=="number",g=t,y=e,m=0,b=[g,y,m],_=[g,y],x=0,O={x:0,y:0},w=[{x:g,y}];v&&o<=0&&(O={x:g,y});for(var S=0;S<=p;S+=1){if(x=S/p,c=c8(t,e,n,r,i,a,x),g=c.x,y=c.y,u&&w.push({x:g,y}),d&&(m+=oi(_,[g,y])),_=[g,y],v&&m>=o&&o>b[2]){var M=(m-o)/(m-b[2]);O={x:_[0]*(1-M)+b[0]*M,y:_[1]*(1-M)+b[1]*M}}b=[g,y,m]}return v&&o>=m&&(O={x:i,y:a}),{length:m,point:O,min:{x:Math.min.apply(null,w.map(function(E){return E.x})),y:Math.min.apply(null,w.map(function(E){return E.y}))},max:{x:Math.max.apply(null,w.map(function(E){return E.x})),y:Math.max.apply(null,w.map(function(E){return E.y}))}}}function tx(t,e,n){for(var r,i,a,o,s,c,l=Qf(t),u=typeof e=="number",f,d=[],h,p=0,v=0,g=0,y=0,m,b=[],_=[],x=0,O={x:0,y:0},w=O,S=O,M=O,E=0,A=0,C=l.length;A=e&&(M=S),_.push(w),b.push(O),E+=x,c=h!=="Z"?m.slice(-2):[g,y],p=c[0],v=c[1];return u&&e>=E&&(M={x:p,y:v}),{length:E,point:M,min:{x:Math.min.apply(null,b.map(function(P){return P.x})),y:Math.min.apply(null,b.map(function(P){return P.y}))},max:{x:Math.max.apply(null,_.map(function(P){return P.x})),y:Math.max.apply(null,_.map(function(P){return P.y}))}}}function u8(t,e){return tx(t,void 0,Q(Q({},e),{bbox:!1,length:!0})).length}var sr=function(t){return Array.isArray?Array.isArray(t):Rl(t,"Array")},Jf=function(t){if(sr(t))return t.reduce(function(e,n){return Math.min(e,n)},t[0])},td=function(t){if(sr(t))return t.reduce(function(e,n){return Math.max(e,n)},t[0])},f8=1e-5;function Dl(t,e,n){return n===void 0&&(n=f8),Math.abs(t-e)7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}function p8(t){return q_(t)&&t.every(function(e){var n=e[0];return"MC".includes(n)})}function ed(t,e,n){var r=t*Math.cos(n)-e*Math.sin(n),i=t*Math.sin(n)+e*Math.cos(n);return{x:r,y:i}}function tv(t,e,n,r,i,a,o,s,c,l){var u=t,f=e,d=n,h=r,p=s,v=c,g=Math.PI*120/180,y=Math.PI/180*(+i||0),m=[],b,_,x,O,w;if(l)_=l[0],x=l[1],O=l[2],w=l[3];else{b=ed(u,f,-y),u=b.x,f=b.y,b=ed(p,v,-y),p=b.x,v=b.y;var S=(u-p)/2,M=(f-v)/2,E=S*S/(d*d)+M*M/(h*h);E>1&&(E=Math.sqrt(E),d*=E,h*=E);var A=d*d,C=h*h,P=(a===o?-1:1)*Math.sqrt(Math.abs((A*C-A*M*M-C*S*S)/(A*M*M+C*S*S)));O=P*d*M/h+(u+p)/2,w=P*-h*S/d+(f+v)/2,_=Math.asin(((f-w)/h*Math.pow(10,9)>>0)/Math.pow(10,9)),x=Math.asin(((v-w)/h*Math.pow(10,9)>>0)/Math.pow(10,9)),_=ux&&(_-=Math.PI*2),!o&&x>_&&(x-=Math.PI*2)}var T=x-_;if(Math.abs(T)>g){var k=x,N=p,F=v;x=_+g*(o&&x>_?1:-1),p=O+d*Math.cos(x),v=w+h*Math.sin(x),m=tv(p,v,d,h,i,0,o,N,F,[x,k,O,w])}T=x-_;var R=Math.cos(_),I=Math.sin(_),z=Math.cos(x),W=Math.sin(x),V=Math.tan(T/4),$=4/3*d*V,J=4/3*h*V,ct=[u,f],pt=[u+$*I,f-J*R],it=[p+$*W,v-J*z],nt=[p,v];if(pt[0]=2*ct[0]-pt[0],pt[1]=2*ct[1]-pt[1],l)return pt.concat(it,nt,m);m=pt.concat(it,nt,m);for(var xt=[],yt=0,Rt=m.length;yt=d[y],h[y]-=p?1:0,p?m.ss:[m.s]}).flat()});return v[0].length===v[1].length?v:ix(v[0],v[1],f)}function m8(t,e,n,r,i,a,o,s){return 3*((s-e)*(n+i)-(o-t)*(r+a)+r*(t-i)-n*(e-a)+s*(i+t/3)-o*(a+e/3))/20}function b8(t){var e=0,n=0,r=0;return ev(t).map(function(i){var a;switch(i[0]){case"M":return e=i[1],n=i[2],0;default:var o=i.slice(1),s=o[0],c=o[1],l=o[2],u=o[3],f=o[4],d=o[5];return r=m8(e,n,s,c,l,u,f,d),a=i.slice(-2),e=a[0],n=a[1],r}}).reduce(function(i,a){return i+a},0)}function ax(t){return b8(t)>=0}function _8(t){var e=t.slice(1).map(function(n,r,i){return r?i[r-1].slice(-2).concat(n.slice(1)):t[0].slice(1).concat(n.slice(1))}).map(function(n){return n.map(function(r,i){return n[n.length-i-2*(1-i%2)]})}).reverse();return[["M"].concat(e[0].slice(0,2))].concat(e.map(function(n){return["C"].concat(n.slice(2))}))}function x8(t){return t.map(function(e){return Array.isArray(e)?[].concat(e):e})}function O8(t){var e=t.length,n=e-1;return t.map(function(r,i){return t.map(function(a,o){var s=i+o,c;return o===0||t[s]&&t[s][0]==="M"?(c=t[s],["M"].concat(c.slice(-2))):(s>=e&&(s-=n),t[s])})})}function w8(t,e){var n=t.length-1,r=[],i=0,a=0,o=O8(t);return o.forEach(function(s,c){t.slice(1).forEach(function(l,u){a+=oi(t[(c+u)%n].slice(-2),e[u%n].slice(-2))}),r[c]=a,a=0}),i=r.indexOf(Math.min.apply(null,r)),o[i]}var S8=function(t){return t===void 0},pn=S8,M8=function(t){return Rl(t,"Boolean")},ox=M8,cs=function(t){var e=typeof t;return t!==null&&e==="object"||e==="function"};function E8(t,e,n){return tx(t,e,Q(Q({},n),{bbox:!1,length:!0})).point}function nd(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function nv(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function fc(){}var ls=.7,dc=1/ls,hc="\\s*([+-]?\\d+)\\s*",Fl="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",da="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",A8=/^#([0-9a-f]{3,8})$/,P8=new RegExp("^rgb\\("+[hc,hc,hc]+"\\)$"),T8=new RegExp("^rgb\\("+[da,da,da]+"\\)$"),k8=new RegExp("^rgba\\("+[hc,hc,hc,Fl]+"\\)$"),C8=new RegExp("^rgba\\("+[da,da,da,Fl]+"\\)$"),L8=new RegExp("^hsl\\("+[Fl,da,da]+"\\)$"),N8=new RegExp("^hsla\\("+[Fl,da,da,Fl]+"\\)$"),sx={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};nd(fc,rd,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:cx,formatHex:cx,formatHsl:j8,formatRgb:lx,toString:lx});function cx(){return this.rgb().formatHex()}function j8(){return vx(this).formatHsl()}function lx(){return this.rgb().formatRgb()}function rd(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=A8.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?ux(e):n===3?new Ur(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?id(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?id(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=P8.exec(t))?new Ur(e[1],e[2],e[3],1):(e=T8.exec(t))?new Ur(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=k8.exec(t))?id(e[1],e[2],e[3],e[4]):(e=C8.exec(t))?id(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=L8.exec(t))?px(e[1],e[2]/100,e[3]/100,1):(e=N8.exec(t))?px(e[1],e[2]/100,e[3]/100,e[4]):sx.hasOwnProperty(t)?ux(sx[t]):t==="transparent"?new Ur(NaN,NaN,NaN,0):null}function ux(t){return new Ur(t>>16&255,t>>8&255,t&255,1)}function id(t,e,n,r){return r<=0&&(t=e=n=NaN),new Ur(t,e,n,r)}function fx(t){return t instanceof fc||(t=rd(t)),t?(t=t.rgb(),new Ur(t.r,t.g,t.b,t.opacity)):new Ur}function Bl(t,e,n,r){return arguments.length===1?fx(t):new Ur(t,e,n,r==null?1:r)}function Ur(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}nd(Ur,Bl,nv(fc,{brighter:function(t){return t=t==null?dc:Math.pow(dc,t),new Ur(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=t==null?ls:Math.pow(ls,t),new Ur(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:dx,formatHex:dx,formatRgb:hx,toString:hx}));function dx(){return"#"+rv(this.r)+rv(this.g)+rv(this.b)}function hx(){var t=this.opacity;return t=isNaN(t)?1:Math.max(0,Math.min(1,t)),(t===1?"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))+(t===1?")":", "+t+")")}function rv(t){return t=Math.max(0,Math.min(255,Math.round(t)||0)),(t<16?"0":"")+t.toString(16)}function px(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new ha(t,e,n,r)}function vx(t){if(t instanceof ha)return new ha(t.h,t.s,t.l,t.opacity);if(t instanceof fc||(t=rd(t)),!t)return new ha;if(t instanceof ha)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(e===a?o=(n-r)/s+(n0&&c<1?0:o,new ha(o,s,c,t.opacity)}function R8(t,e,n,r){return arguments.length===1?vx(t):new ha(t,e,n,r==null?1:r)}function ha(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}nd(ha,R8,nv(fc,{brighter:function(t){return t=t==null?dc:Math.pow(dc,t),new ha(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=t==null?ls:Math.pow(ls,t),new ha(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+(this.h<0)*360,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 Ur(iv(t>=240?t-240:t+120,i,r),iv(t,i,r),iv(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 t=isNaN(t)?1:Math.max(0,Math.min(1,t)),(t===1?"hsl(":"hsla(")+(this.h||0)+", "+(this.s||0)*100+"%, "+(this.l||0)*100+"%"+(t===1?")":", "+t+")")}}));function iv(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}function Ir(t,e,n,r){var i=t-n,a=e-r;return Math.sqrt(i*i+a*a)}function ad(t,e){var n=Math.min.apply(Math,dt([],D(t),!1)),r=Math.min.apply(Math,dt([],D(e),!1)),i=Math.max.apply(Math,dt([],D(t),!1)),a=Math.max.apply(Math,dt([],D(e),!1));return{x:n,y:r,width:i-n,height:a-r}}function gx(t){return(t+Math.PI*2)%(Math.PI*2)}function yx(t,e){var n=Math.abs(t);return e>0?n:n*-1}function I8(t,e,n,r,i,a){var o=n,s=r;if(o===0||s===0)return{x:t,y:e};for(var c=i-t,l=a-e,u=Math.abs(c),f=Math.abs(l),d=o*o,h=s*s,p=Math.PI/4,v=0,g=0,y=0;y<4;y++){v=o*Math.cos(p),g=s*Math.sin(p);var m=(d-h)*Math.pow(Math.cos(p),3)/o,b=(h-d)*Math.pow(Math.sin(p),3)/s,_=v-m,x=g-b,O=u-m,w=f-b,S=Math.hypot(x,_),M=Math.hypot(w,O),E=S*Math.asin((_*w-x*O)/(S*M)),A=E/Math.sqrt(d+h-v*v-g*g);p+=A,p=Math.min(Math.PI/2,Math.max(0,p))}return{x:t+yx(v,c),y:e+yx(g,l)}}function D8(t,e,n,r,i,a,o,s){return-1*n*Math.cos(i)*Math.sin(s)-r*Math.sin(i)*Math.cos(s)}function F8(t,e,n,r,i,a,o,s){return-1*n*Math.sin(i)*Math.sin(s)+r*Math.cos(i)*Math.cos(s)}function B8(t,e,n){return Math.atan(-e/t*Math.tan(n))}function z8(t,e,n){return Math.atan(e/(t*Math.tan(n)))}function G8(t,e,n,r,i,a){return n*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+t}function W8(t,e,n,r,i,a){return n*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+e}function Y8(t,e,n,r){var i=Math.atan2(r*t,n*e);return(i+Math.PI*2)%(Math.PI*2)}function mx(t,e,n){return{x:t*Math.cos(n),y:e*Math.sin(n)}}function bx(t,e,n){var r=Math.cos(n),i=Math.sin(n);return[t*r-e*i,t*i+e*r]}function H8(t,e,n,r,i,a,o){for(var s=B8(n,r,i),c=1/0,l=-1/0,u=[a,o],f=-Math.PI*2;f<=Math.PI*2;f+=Math.PI){var d=s+f;al&&(l=h)}for(var p=z8(n,r,i),v=1/0,g=-1/0,y=[a,o],f=-Math.PI*2;f<=Math.PI*2;f+=Math.PI){var m=p+f;ag&&(g=b)}return{x:c,y:v,width:l-c,height:g-v}}function Fvt(t,e,n,r,i,a,o,s,c){var l=bx(s-t,c-e,-i),u=__read(l,2),f=u[0],d=u[1],h=I8(0,0,n,r,f,d),p=Y8(n,r,h.x,h.y);po&&(h=mx(n,r,o));var v=bx(h.x,h.y,i);return{x:v[0]+t,y:v[1]+e}}function Bvt(t,e,n,r,i,a,o,s){var c=(o-a)*s+a,l=D8(t,e,n,r,i,a,o,c),u=F8(t,e,n,r,i,a,o,c);return gx(Math.atan2(u,l))}var $8=1e-4;function _x(t,e,n,r,i,a){var o=-1,s=1/0,c=[n,r],l=20;a&&a>200&&(l=a/10);for(var u=1/l,f=u/10,d=0;d<=l;d++){var h=d*u,p=[i.apply(void 0,dt([],D(t.concat([h])),!1)),i.apply(void 0,dt([],D(e.concat([h])),!1))],v=Ir(c[0],c[1],p[0],p[1]);v=0&&vs?Ir(n,r,i,a):Ox(t,e,n,r,i,a)}function Ox(t,e,n,r,i,a){var o=[n-t,r-e];if(W6(o,[0,0]))return Math.sqrt((i-t)*(i-t)+(a-e)*(a-e));var s=[-o[1],o[0]];z6(s,s);var c=[i-t,a-e];return Math.abs(G6(c,s))}function Gvt(t,e,n,r){return Math.atan2(r-e,n-t)}function us(t,e,n,r,i){var a=1-i;return a*a*a*t+3*e*i*a*a+3*n*i*i*a+r*i*i*i}function wx(t,e,n,r,i){var a=1-i;return 3*(a*a*(e-t)+2*a*i*(n-e)+i*i*(r-n))}function Sx(t,e,n,r){var i=-3*t+9*e-9*n+3*r,a=6*t-12*e+6*n,o=3*e-3*t,s=[],c,l,u;if(Dl(i,0))Dl(a,0)||(c=-o/a,c>=0&&c<=1&&s.push(c));else{var f=a*a-4*i*o;Dl(f,0)?s.push(-a/(2*i)):f>0&&(u=Math.sqrt(f),c=(-a+u)/(2*i),l=(-a-u)/(2*i),c>=0&&c<=1&&s.push(c),l>=0&&l<=1&&s.push(l))}return s}function X8(t,e,n,r,i,a,o,s,c){var l=us(t,n,i,o,c),u=us(e,r,a,s,c),f=pa(t,e,n,r,c),d=pa(n,r,i,a,c),h=pa(i,a,o,s,c),p=pa(f.x,f.y,d.x,d.y,c),v=pa(d.x,d.y,h.x,h.y,c);return[[t,e,f.x,f.y,p.x,p.y,l,u],[l,u,v.x,v.y,h.x,h.y,o,s]]}function av(t,e,n,r,i,a,o,s,c){if(c===0)return V8([t,n,i,o],[e,r,a,s]);var l=X8(t,e,n,r,i,a,o,s,.5),u=__spreadArray(__spreadArray([],__read(l[0]),!1),[c-1],!1),f=__spreadArray(__spreadArray([],__read(l[1]),!1),[c-1],!1);return av.apply(void 0,__spreadArray([],__read(u),!1))+av.apply(void 0,__spreadArray([],__read(f),!1))}function q8(t,e,n,r,i,a,o,s){for(var c=[t,o],l=[e,s],u=Sx(t,n,i,o),f=Sx(e,r,a,s),d=0;d1||e<0||t.length<2)return null;var n=Ex(t),r=n.segments,i=n.totalLength;if(i===0)return{x:t[0][0],y:t[0][1]};for(var a=0,o=null,s=0;s=a&&e<=a+f){var d=(e-a)/f;o=pa(l[0],l[1],u[0],u[1],d);break}a+=f}return o}function Tx(t,e){if(e>1||e<0||t.length<2)return 0;for(var n=Ex(t),r=n.segments,i=n.totalLength,a=0,o=0,s=0;s=a&&e<=a+f){o=Math.atan2(u[1]-l[1],u[0]-l[0]);break}a+=f}return o}function kx(t,e,n){for(var r=1/0,i=0;i=0?[i]:[]}function J8(t,e,n,r,i,a,o){var s=zl(t,n,i,o),c=zl(e,r,a,o),l=pa(t,e,n,r,o),u=pa(n,r,i,a,o);return[[t,e,l.x,l.y,s,c],[s,c,u.x,u.y,i,a]]}function ov(t,e,n,r,i,a,o){if(o===0)return(Ir(t,e,n,r)+Ir(n,r,i,a)+Ir(t,e,i,a))/2;var s=J8(t,e,n,r,i,a,.5),c=s[0],l=s[1];return c.push(o-1),l.push(o-1),ov.apply(void 0,__spreadArray([],__read(c),!1))+ov.apply(void 0,__spreadArray([],__read(l),!1))}function tF(t,e,n,r,i,a){var o=Cx(t,n,i)[0],s=Cx(e,r,a)[0],c=[t,i],l=[e,a];return o!==void 0&&c.push(zl(t,n,i,o)),s!==void 0&&l.push(zl(e,r,a,s)),ad(c,l)}function Jvt(t,e,n,r,i,a){return ov(t,e,n,r,i,a,3)}function eF(t,e,n,r,i,a,o,s){return _x([t,n,i],[e,r,a],o,s,zl)}function nF(t,e,n,r,i,a,o,s){var c=eF(t,e,n,r,i,a,o,s);return Ir(c.x,c.y,o,s)}var rF=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof tt.g!="undefined"?tt.g:typeof self!="undefined"?self:{},Lx={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(rF,function(){function n(x,O,w,S,M){r(x,O,w||0,S||x.length-1,M||a)}function r(x,O,w,S,M){for(;S>w;){if(S-w>600){var E=S-w+1,A=O-w+1,C=Math.log(E),P=.5*Math.exp(2*C/3),T=.5*Math.sqrt(C*P*(E-P)/E)*(A-E/2<0?-1:1),k=Math.max(w,Math.floor(O-A*P/E+T)),N=Math.min(S,Math.floor(O+(E-A)*P/E+T));r(x,O,k,N,M)}var F=x[O],R=w,I=S;for(i(x,w,O),M(x[S],F)>0&&i(x,w,S);R0;)I--}M(x[w],F)===0?i(x,w,I):(I++,i(x,I,S)),I<=O&&(w=I+1),O<=I&&(S=I-1)}}function i(x,O,w){var S=x[O];x[O]=x[w],x[w]=S}function a(x,O){return xO?1:0}var o=function(O){O===void 0&&(O=9),this._maxEntries=Math.max(4,O),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()};o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(O){var w=this.data,S=[];if(!m(O,w))return S;for(var M=this.toBBox,E=[];w;){for(var A=0;A=0&&E[w].children.length>this._maxEntries;)this._split(E,w),w--;this._adjustParentBBoxes(M,E,w)},o.prototype._split=function(O,w){var S=O[w],M=S.children.length,E=this._minEntries;this._chooseSplitAxis(S,E,M);var A=this._chooseSplitIndex(S,E,M),C=b(S.children.splice(A,S.children.length-A));C.height=S.height,C.leaf=S.leaf,c(S,this.toBBox),c(C,this.toBBox),w?O[w-1].children.push(C):this._splitRoot(S,C)},o.prototype._splitRoot=function(O,w){this.data=b([O,w]),this.data.height=O.height+1,this.data.leaf=!1,c(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(O,w,S){for(var M,E=1/0,A=1/0,C=w;C<=S-w;C++){var P=l(O,0,C,this.toBBox),T=l(O,C,S,this.toBBox),k=g(P,T),N=h(P)+h(T);k=w;N--){var F=O.children[N];u(C,O.leaf?E(F):F),P+=p(C)}return P},o.prototype._adjustParentBBoxes=function(O,w,S){for(var M=S;M>=0;M--)u(w[M],O)},o.prototype._condense=function(O){for(var w=O.length-1,S=void 0;w>=0;w--)O[w].children.length===0?w>0?(S=O[w-1].children,S.splice(S.indexOf(O[w]),1)):this.clear():c(O[w],this.toBBox)};function s(x,O,w){if(!w)return O.indexOf(x);for(var S=0;S=x.minX&&O.maxY>=x.minY}function b(x){return{children:x,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function _(x,O,w,S,M){for(var E=[O,w];E.length;)if(w=E.pop(),O=E.pop(),!(w-O<=S)){var A=O+Math.ceil((w-O)/S/2)*S;n(x,A,O,w,M),E.push(O,A,A,w)}}return o})})(Lx);var iF=Lx.exports,st;(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"})(st||(st={}));var pc;(function(t){t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE"})(pc||(pc={}));var lo=function(){function t(){this.plugins=[]}return t.prototype.addRenderingPlugin=function(e){this.plugins.push(e),this.context.renderingPlugins.push(e)},t.prototype.removeAllRenderingPlugins=function(){var e=this;this.plugins.forEach(function(n){var r=e.context.renderingPlugins.indexOf(n);r>=0&&e.context.renderingPlugins.splice(r,1)})},t}(),aF=function(){function t(e){this.clipSpaceNearZ=pc.NEGATIVE_ONE,this.plugins=[],this.config=Q({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0},e)}return t.prototype.registerPlugin=function(e){var n=this.plugins.findIndex(function(r){return r===e});n===-1&&this.plugins.push(e)},t.prototype.unregisterPlugin=function(e){var n=this.plugins.findIndex(function(r){return r===e});n>-1&&this.plugins.splice(n,1)},t.prototype.getPlugins=function(){return this.plugins},t.prototype.getPlugin=function(e){return this.plugins.find(function(n){return n.name===e})},t.prototype.getConfig=function(){return this.config},t.prototype.setConfig=function(e){Object.assign(this.config,e)},t}();function vc(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function sv(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function sd(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Nx(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function oF(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}function sF(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}function gc(t){return t===void 0?0:t>360||t<-360?t%360:t}function Xr(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=0),Array.isArray(t)&&t.length===3?ja(t):$n(t)?De(t,e,n):De(t[0],t[1]||e,t[2]||n)}function rn(t){return t*(Math.PI/180)}function Li(t){return t*(180/Math.PI)}function tgt(t){return t=t%400,t<0&&(t+=400),t/400*360}function egt(t){return t/360}function cF(t){return 360*t}function lF(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n*n,s=r*r,c=i*i,l=a*a,u=o+s+c+l,f=n*a-r*i;return f>.499995*u?(t[0]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):f<-.499995*u?(t[0]=-Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-a*r)),t[1]=Math.atan2(2*(n*a+r*i),1-2*(c+l)),t[2]=Math.atan2(2*(n*r+i*a),1-2*(s+c))),t}function uF(t,e){var n,r,i=Math.PI*.5,a=D(cc(Se(),e),3),o=a[0],s=a[1],c=a[2],l=Math.asin(-e[2]/o);return l-i?(n=Math.atan2(e[6]/s,e[10]/c),r=Math.atan2(e[1]/o,e[0]/o)):(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}function cv(t,e){return e.length===16?uF(t,e):lF(t,e)}function fF(t,e,n,r,i){var a=Math.cos(t),o=Math.sin(t);return m6(r*a,i*o,0,-r*o,i*a,0,e,n,1)}function dF(t,e,n,r,i,a,o,s){s===void 0&&(s=!1);var c=2*a/(n-e),l=2*a/(r-i),u=(n+e)/(n-e),f=(r+i)/(r-i),d,h;return s?(d=-o/(o-a),h=-o*a/(o-a)):(d=-(o+a)/(o-a),h=-2*o*a/(o-a)),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]=u,t[9]=f,t[10]=d,t[11]=-1,t[12]=0,t[13]=0,t[14]=h,t[15]=0,t}function jx(t){var e=t[0],n=t[1],r=t[3],i=t[4],a=Math.sqrt(e*e+n*n),o=Math.sqrt(r*r+i*i),s=e*i-n*r;s<0&&(ece[1][2]&&(a[0]=-a[0]),ce[0][2]>ce[2][0]&&(a[1]=-a[1]),ce[1][0]>ce[0][1]&&(a[2]=-a[2]),!0}function pF(t,e){var n=e[15];if(n===0)return!1;for(var r=1/n,i=0;i<16;i++)t[i]=e[i]*r;return!0}function vF(t,e){t[0][0]=e[0],t[0][1]=e[1],t[0][2]=e[2],t[1][0]=e[4],t[1][1]=e[5],t[1][2]=e[6],t[2][0]=e[8],t[2][1]=e[9],t[2][2]=e[10]}function lv(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 Vn=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(e){return!e||e.halfExtents[0]===0&&e.halfExtents[1]===0&&e.halfExtents[2]===0},t.prototype.update=function(e,n){vc(this.center,e),vc(this.halfExtents,n),sv(this.min,this.center,this.halfExtents),sd(this.max,this.center,this.halfExtents)},t.prototype.setMinMax=function(e,n){sd(this.center,n,e),Nx(this.center,this.center,.5),sv(this.halfExtents,n,e),Nx(this.halfExtents,this.halfExtents,.5),vc(this.min,e),vc(this.max,n)},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());return}var n=this.center,r=n[0],i=n[1],a=n[2],o=this.halfExtents,s=o[0],c=o[1],l=o[2],u=r-s,f=r+s,d=i-c,h=i+c,p=a-l,v=a+l,g=e.center,y=g[0],m=g[1],b=g[2],_=e.halfExtents,x=_[0],O=_[1],w=_[2],S=y-x,M=y+x,E=m-O,A=m+O,C=b-w,P=b+w;Sf&&(f=M),Eh&&(h=A),Cv&&(v=P),n[0]=(u+f)*.5,n[1]=(d+h)*.5,n[2]=(p+v)*.5,o[0]=(f-u)*.5,o[1]=(h-d)*.5,o[2]=(v-p)*.5,this.min[0]=u,this.min[1]=d,this.min[2]=p,this.max[0]=f,this.max[1]=h,this.max[2]=v}},t.prototype.setFromTransformedAABB=function(e,n){var r=this.center,i=this.halfExtents,a=e.center,o=e.halfExtents,s=n[0],c=n[4],l=n[8],u=n[1],f=n[5],d=n[9],h=n[2],p=n[6],v=n[10],g=Math.abs(s),y=Math.abs(c),m=Math.abs(l),b=Math.abs(u),_=Math.abs(f),x=Math.abs(d),O=Math.abs(h),w=Math.abs(p),S=Math.abs(v);r[0]=n[12]+s*a[0]+c*a[1]+l*a[2],r[1]=n[13]+u*a[0]+f*a[1]+d*a[2],r[2]=n[14]+h*a[0]+p*a[1]+v*a[2],i[0]=g*o[0]+y*o[1]+m*o[2],i[1]=b*o[0]+_*o[1]+x*o[2],i[2]=O*o[0]+w*o[1]+S*o[2],sv(this.min,r,i),sd(this.max,r,i)},t.prototype.intersects=function(e){var n=this.getMax(),r=this.getMin(),i=e.getMax(),a=e.getMin();return r[0]<=i[0]&&n[0]>=a[0]&&r[1]<=i[1]&&n[1]>=a[1]&&r[2]<=i[2]&&n[2]>=a[2]},t.prototype.intersection=function(e){if(!this.intersects(e))return null;var n=new t,r=oF([0,0,0],this.getMin(),e.getMin()),i=sF([0,0,0],this.getMax(),e.getMax());return n.setMinMax(r,i),n},t.prototype.getNegativeFarPoint=function(e){return e.pnVertexFlag===273?vc([0,0,0],this.min):e.pnVertexFlag===272?[this.min[0],this.min[1],this.max[2]]:e.pnVertexFlag===257?[this.min[0],this.max[1],this.min[2]]:e.pnVertexFlag===256?[this.min[0],this.max[1],this.max[2]]:e.pnVertexFlag===17?[this.max[0],this.min[1],this.min[2]]:e.pnVertexFlag===16?[this.max[0],this.min[1],this.max[2]]:e.pnVertexFlag===1?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]},t.prototype.getPositiveFarPoint=function(e){return e.pnVertexFlag===273?vc([0,0,0],this.max):e.pnVertexFlag===272?[this.max[0],this.max[1],this.min[2]]:e.pnVertexFlag===257?[this.max[0],this.min[1],this.max[2]]:e.pnVertexFlag===256?[this.max[0],this.min[1],this.min[2]]:e.pnVertexFlag===17?[this.min[0],this.max[1],this.max[2]]:e.pnVertexFlag===16?[this.min[0],this.max[1],this.min[2]]:e.pnVertexFlag===1?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]},t}(),gF=function(){function t(e,n){this.distance=e||0,this.normal=n||De(0,1,0),this.updatePNVertexFlag()}return t.prototype.updatePNVertexFlag=function(){this.pnVertexFlag=(+(this.normal[0]>=0)<<8)+(+(this.normal[1]>=0)<<4)+ +(this.normal[2]>=0)},t.prototype.distanceToPoint=function(e){return Qi(e,this.normal)-this.distance},t.prototype.normalize=function(){var e=1/P_(this.normal);$0(this.normal,this.normal,e),this.distance*=e},t.prototype.intersectsLine=function(e,n,r){var i=this.distanceToPoint(e),a=this.distanceToPoint(n),o=i/(i-a),s=o>=0&&o<=1;return s&&r&&V0(r,e,n,o),s},t}(),uo;(function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"})(uo||(uo={}));var yF=function(){function t(e){if(this.planes=[],e)this.planes=e;else for(var n=0;n<6;n++)this.planes.push(new gF)}return t.prototype.extractFromVPMatrix=function(e){var n=D(e,16),r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=n[7],f=n[8],d=n[9],h=n[10],p=n[11],v=n[12],g=n[13],y=n[14],m=n[15];Ki(this.planes[0].normal,o-r,u-s,p-f),this.planes[0].distance=m-v,Ki(this.planes[1].normal,o+r,u+s,p+f),this.planes[1].distance=m+v,Ki(this.planes[2].normal,o+i,u+c,p+d),this.planes[2].distance=m+g,Ki(this.planes[3].normal,o-i,u-c,p-d),this.planes[3].distance=m-g,Ki(this.planes[4].normal,o-a,u-l,p-h),this.planes[4].distance=m-y,Ki(this.planes[5].normal,o+a,u+l,p+h),this.planes[5].distance=m+y,this.planes.forEach(function(b){b.normalize(),b.updatePNVertexFlag()})},t}(),Sr=function(){function t(e,n){e===void 0&&(e=0),n===void 0&&(n=0),this.x=0,this.y=0,this.x=e,this.y=n}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(e){this.x=e.x,this.y=e.y},t}(),fs=function(){function t(e,n,r,i){this.x=e,this.y=n,this.width=r,this.height=i,this.left=e,this.right=e+r,this.top=n,this.bottom=n+i}return t.prototype.toJSON=function(){},t}(),an="Method not implemented.",yc="Use document.documentElement instead.",mF="Cannot append a destroyed element.",qe;(function(t){t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING"})(qe||(qe={}));var Wl;(function(t){t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC"})(Wl||(Wl={}));var si;(function(t){t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE"})(si||(si={}));var Ix={UPDATED:"updated"},Dx=2e-4,Fx=function(){function t(){this.clipSpaceNearZ=pc.NEGATIVE_ONE,this.eventEmitter=new H0,this.matrix=cn(),this.right=De(1,0,0),this.up=De(0,1,0),this.forward=De(0,0,1),this.position=De(0,0,1),this.focalPoint=De(0,0,0),this.distanceVector=De(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=cn(),this.projectionMatrixInverse=cn(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=qe.EXPLORING,this.trackingMode=Wl.DEFAULT,this.projectionMode=si.PERSPECTIVE,this.frustum=new yF,this.orthoMatrix=cn()}return t.prototype.isOrtho=function(){return this.projectionMode===si.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(e){this.enableUpdate=e},t.prototype.setType=function(e,n){return this.type=e,this.type===qe.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===qe.TRACKING&&n!==void 0&&this.setTrackingMode(n),this},t.prototype.setProjectionMode=function(e){return this.projectionMode=e,this},t.prototype.setTrackingMode=function(e){if(this.type!==qe.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=e,this},t.prototype.setWorldRotation=function(e){return this.rotateWorld=e,this._getAngles(),this},t.prototype.getViewTransform=function(){return fa(cn(),this.matrix)},t.prototype.getWorldTransform=function(){return this.matrix},t.prototype.jitterProjectionMatrix=function(e,n){var r=os(cn(),[e,n,0]);this.jitteredProjectionMatrix=Rr(cn(),r,this.projectionMatrix)},t.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},t.prototype.setMatrix=function(e){return this.matrix=e,this._update(),this},t.prototype.setProjectionMatrix=function(e){this.projectionMatrix=e},t.prototype.setFov=function(e){return this.setPerspective(this.near,this.far,e,this.aspect),this},t.prototype.setAspect=function(e){return this.setPerspective(this.near,this.far,this.fov,e),this},t.prototype.setNear=function(e){return this.projectionMode===si.PERSPECTIVE?this.setPerspective(e,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,e,this.far),this},t.prototype.setFar=function(e){return this.projectionMode===si.PERSPECTIVE?this.setPerspective(this.near,e,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,e),this},t.prototype.setViewOffset=function(e,n,r,i,a,o){return this.aspect=e/n,this.view===void 0&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=a,this.view.height=o,this.projectionMode===si.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 this.view!==void 0&&(this.view.enabled=!1),this.projectionMode===si.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(e){return this.zoom=e,this.projectionMode===si.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===si.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},t.prototype.setZoomByViewportPoint=function(e,n){var r=this.canvas.viewport2Canvas({x:n[0],y:n[1]}),i=r.x,a=r.y,o=this.roll;this.rotate(0,0,-o),this.setPosition(i,a),this.setFocalPoint(i,a),this.setZoom(e),this.rotate(0,0,o);var s=this.canvas.viewport2Canvas({x:n[0],y:n[1]}),c=s.x,l=s.y,u=De(c-i,l-a,0),f=Qi(u,this.right)/Ra(this.right),d=Qi(u,this.up)/Ra(this.up);return this.pan(-f,-d),this},t.prototype.setPerspective=function(e,n,r,i){var a;this.projectionMode=si.PERSPECTIVE,this.fov=r,this.near=e,this.far=n,this.aspect=i;var o=this.near*Math.tan(rn(.5*this.fov))/this.zoom,s=2*o,c=this.aspect*s,l=-.5*c;if(!((a=this.view)===null||a===void 0)&&a.enabled){var u=this.view.fullWidth,f=this.view.fullHeight;l+=this.view.offsetX*c/u,o-=this.view.offsetY*s/f,c*=this.view.width/u,s*=this.view.height/f}return dF(this.projectionMatrix,l,l+c,o,o-s,e,this.far,this.clipSpaceNearZ===pc.ZERO),$f(this.projectionMatrix,this.projectionMatrix,De(1,-1,1)),fa(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},t.prototype.setOrthographic=function(e,n,r,i,a,o){var s;this.projectionMode=si.ORTHOGRAPHIC,this.rright=n,this.left=e,this.top=r,this.bottom=i,this.near=a,this.far=o;var c=(this.rright-this.left)/(2*this.zoom),l=(this.top-this.bottom)/(2*this.zoom),u=(this.rright+this.left)/2,f=(this.top+this.bottom)/2,d=u-c,h=u+c,p=f+l,v=f-l;if(!((s=this.view)===null||s===void 0)&&s.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,y=(this.top-this.bottom)/this.view.fullHeight/this.zoom;d+=g*this.view.offsetX,h=d+g*this.view.width,p-=y*this.view.offsetY,v=p-y*this.view.height}return this.clipSpaceNearZ===pc.NEGATIVE_ONE?z_(this.projectionMatrix,d,h,v,p,a,o):G_(this.projectionMatrix,d,h,v,p,a,o),$f(this.projectionMatrix,this.projectionMatrix,De(1,-1,1)),fa(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},t.prototype.setPosition=function(e,n,r){n===void 0&&(n=this.position[1]),r===void 0&&(r=this.position[2]);var i=Xr(e,n,r);return this._setPosition(i),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},t.prototype.setFocalPoint=function(e,n,r){n===void 0&&(n=this.focalPoint[1]),r===void 0&&(r=this.focalPoint[2]);var i=De(0,1,0);if(this.focalPoint=Xr(e,n,r),this.trackingMode===Wl.CINEMATIC){var a=E_(Se(),this.focalPoint,this.position);e=a[0],n=a[1],r=a[2];var o=Ra(a),s=Li(Math.asin(n/o)),c=90+Li(Math.atan2(r,e)),l=cn();N_(l,l,rn(c)),L_(l,l,rn(s)),i=fr(Se(),[0,1,0],l)}return fa(this.matrix,W_(cn(),this.position,this.focalPoint,i)),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(e){if(this.distance===e||e<0)return this;this.distance=e,this.distance=Mt.kEms&&e=fo.kUnitType&&this.getType()<=fo.kClampType},t}(),SF=function(t){It(e,t);function e(n){var r=t.call(this)||this;return r.colorSpace=n,r}return e.prototype.getType=function(){return fo.kColorType},e.prototype.to=function(n){return this},e}(cd),ga;(function(t){t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient"})(ga||(ga={}));var ld=function(t){It(e,t);function e(n,r){var i=t.call(this)||this;return i.type=n,i.value=r,i}return e.prototype.clone=function(){return new e(this.type,this.value)},e.prototype.buildCSSText=function(n,r,i){return i},e.prototype.getType=function(){return fo.kColorType},e}(cd),ci=function(t){It(e,t);function e(n){var r=t.call(this)||this;return r.value=n,r}return e.prototype.clone=function(){return new e(this.value)},e.prototype.getType=function(){return fo.kKeywordType},e.prototype.buildCSSText=function(n,r,i){return i+this.value},e}(cd),MF=Mr(function(t){return t===void 0&&(t=""),t.replace(/-([a-z])/g,function(e){return e[1].toUpperCase()})}),Gx=function(t){return t.split("").map(function(e,n){return e.toUpperCase()===e?"".concat(n!==0?"-":"").concat(e.toLowerCase()):e}).join("")};function EF(t){if(!t)throw new Error}function mc(t){return typeof t=="function"}function AF(t){return typeof t=="symbol"}var ngt=function(t){return Object.fromEntries(Object.entries(t).filter(function(e){var n=__read(e,2),r=n[1];return r!==void 0}))},PF={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},hv=Mr(function(t){var e=MF(t),n=PF[e];return e=(n==null?void 0:n.alias)||e,e}),TF=function(t,e){e===void 0&&(e="");var n="";return Number.isFinite(t)?(EF(Number.isNaN(t)),n="NaN"):t>0?n="infinity":n="-infinity",n+=e},pv=function(t){return wF(OF(t))},on=function(t){It(e,t);function e(n,r){r===void 0&&(r=Mt.kNumber);var i=t.call(this)||this,a;return typeof r=="string"?a=xF(r):a=r,i.unit=a,i.value=n,i}return e.prototype.clone=function(){return new e(this.value,this.unit)},e.prototype.equals=function(n){var r=n;return this.value===r.value&&this.unit===r.unit},e.prototype.getType=function(){return fo.kUnitType},e.prototype.convertTo=function(n){if(this.unit===n)return new e(this.value,this.unit);var r=pv(this.unit);if(r!==pv(n)||r===Mt.kUnknown)return null;var i=zx(this.unit)/zx(n);return new e(this.value*i,n)},e.prototype.buildCSSText=function(n,r,i){var a;switch(this.unit){case Mt.kUnknown:break;case Mt.kInteger:a=Number(this.value).toFixed(0);break;case Mt.kNumber:case Mt.kPercentage:case Mt.kEms:case Mt.kRems:case Mt.kPixels:case Mt.kDegrees:case Mt.kRadians:case Mt.kGradians:case Mt.kMilliseconds:case Mt.kSeconds:case Mt.kTurns:{var o=-999999,s=999999,c=this.value,l=dv(this.unit);if(cs){var u=dv(this.unit);!Number.isFinite(c)||Number.isNaN(c)?a=TF(c,u):a=c+(u||"")}else a="".concat(c).concat(l)}}return i+=a,i},e}(cd),Un=new on(0,"px");new on(1,"px");var Ni=new on(0,"deg"),vv=function(t){It(e,t);function e(n,r,i,a,o){a===void 0&&(a=1),o===void 0&&(o=!1);var s=t.call(this,"rgb")||this;return s.r=n,s.g=r,s.b=i,s.alpha=a,s.isNone=o,s}return e.prototype.clone=function(){return new e(this.r,this.g,this.b,this.alpha)},e.prototype.buildCSSText=function(n,r,i){return i+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")},e}(SF),wn=new ci("unset"),kF=new ci("initial"),CF=new ci("inherit"),gv={"":wn,unset:wn,initial:kF,inherit:CF},yv=function(t){return gv[t]||(gv[t]=new ci(t)),gv[t]},ud=new vv(0,0,0,0,!0),Wx=new vv(0,0,0,0),LF=Mr(function(t,e,n,r){return new vv(t,e,n,r)},function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")}),ln=function(t,e){return e===void 0&&(e=Mt.kNumber),new on(t,e)};new on(50,"%");var mv;(function(t){t[t.Standard=0]="Standard"})(mv||(mv={}));var bc;(function(t){t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"})(bc||(bc={}));var Yx={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new fs(0,0,0,0)},Tt;(function(t){t.COORDINATE="",t.COLOR="",t.PAINT="",t.NUMBER="",t.ANGLE="",t.OPACITY_VALUE="",t.SHADOW_BLUR="",t.LENGTH="",t.PERCENTAGE="",t.LENGTH_PERCENTAGE=" | ",t.LENGTH_PERCENTAGE_12="[ | ]{1,2}",t.LENGTH_PERCENTAGE_14="[ | ]{1,4}",t.LIST_OF_POINTS="",t.PATH="",t.FILTER="",t.Z_INDEX="",t.OFFSET_DISTANCE="",t.DEFINED_PATH="",t.MARKER="",t.TRANSFORM="",t.TRANSFORM_ORIGIN="",t.TEXT="",t.TEXT_TRANSFORM=""})(Tt||(Tt={}));function NF(t){var e=t.type,n=t.value;return e==="hex"?"#".concat(n):e==="literal"?n:e==="rgb"?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}var jF=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(F){throw new Error(e+": "+F)}function r(){var F=i();return e.length>0&&n("Invalid input not EOF"),F}function i(){return b(a)}function a(){return o("linear-gradient",t.linearGradient,c)||o("repeating-linear-gradient",t.repeatingLinearGradient,c)||o("radial-gradient",t.radialGradient,f)||o("repeating-radial-gradient",t.repeatingRadialGradient,f)||o("conic-gradient",t.conicGradient,f)}function o(F,R,I){return s(R,function(z){var W=I();return W&&(k(t.comma)||n("Missing comma before color stops")),{type:F,orientation:W,colorStops:b(_)}})}function s(F,R){var I=k(F);if(I){k(t.startCall)||n("Missing (");var z=R(I);return k(t.endCall)||n("Missing )"),z}}function c(){return l()||u()}function l(){return T("directional",t.sideOrCorner,1)}function u(){return T("angular",t.angleValue,1)}function f(){var F,R=d(),I;return R&&(F=[],F.push(R),I=e,k(t.comma)&&(R=d(),R?F.push(R):e=I)),F}function d(){var F=h()||p();if(F)F.at=g();else{var R=v();if(R){F=R;var I=g();I&&(F.at=I)}else{var z=y();z&&(F={type:"default-radial",at:z})}}return F}function h(){var F=T("shape",/^(circle)/i,0);return F&&(F.style=P()||v()),F}function p(){var F=T("shape",/^(ellipse)/i,0);return F&&(F.style=A()||v()),F}function v(){return T("extent-keyword",t.extentKeywords,1)}function g(){if(T("position",/^at/,0)){var F=y();return F||n("Missing positioning value"),F}}function y(){var F=m();if(F.x||F.y)return{type:"position",value:F}}function m(){return{x:A(),y:A()}}function b(F){var R=F(),I=[];if(R)for(I.push(R);k(t.comma);)R=F(),R?I.push(R):n("One extra comma");return I}function _(){var F=x();return F||n("Expected color definition"),F.length=A(),F}function x(){return w()||M()||S()||O()}function O(){return T("literal",t.literalColor,0)}function w(){return T("hex",t.hexColor,1)}function S(){return s(t.rgbColor,function(){return{type:"rgb",value:b(E)}})}function M(){return s(t.rgbaColor,function(){return{type:"rgba",value:b(E)}})}function E(){return k(t.number)[1]}function A(){return T("%",t.percentageValue,1)||C()||P()}function C(){return T("position-keyword",t.positionKeywords,1)}function P(){return T("px",t.pixelValue,1)||T("em",t.emValue,1)}function T(F,R,I){var z=k(R);if(z)return{type:F,value:z[I]}}function k(F){var R=/^[\n\r\t\s]+/.exec(e);R&&N(R[0].length);var I=F.exec(e);return I&&N(I[0].length),I}function N(F){e=e.substring(F)}return function(F){return e=F,r()}}();function RF(t,e,n,r){var i=rn(r.value),a=0,o=0,s=a+e/2,c=o+n/2,l=Math.abs(e*Math.cos(i))+Math.abs(n*Math.sin(i)),u=t[0]+s-Math.cos(i)*l/2,f=t[1]+c-Math.sin(i)*l/2,d=t[0]+s+Math.cos(i)*l/2,h=t[1]+c+Math.sin(i)*l/2;return{x1:u,y1:f,x2:d,y2:h}}function IF(t,e,n,r,i,a){var o=r.value,s=i.value;r.unit===Mt.kPercentage&&(o=r.value/100*e),i.unit===Mt.kPercentage&&(s=i.value/100*n);var c=Math.max(oi([0,0],[o,s]),oi([0,n],[o,s]),oi([e,n],[o,s]),oi([e,0],[o,s]));return a&&(a instanceof on?c=a.value:a instanceof ci&&(a.value==="closest-side"?c=Math.min(o,e-o,s,n-s):a.value==="farthest-side"?c=Math.max(o,e-o,s,n-s):a.value==="closest-corner"&&(c=Math.min(oi([0,0],[o,s]),oi([0,n],[o,s]),oi([e,n],[o,s]),oi([e,0],[o,s]))))),{x:o+t[0],y:s+t[1],r:c}}var DF=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,FF=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,BF=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Hx=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function zF(t){var e,n,r,i=t.length;t[i-1].length=(e=t[i-1].length)!==null&&e!==void 0?e:{type:"%",value:"100"},i>1&&(t[0].length=(n=t[0].length)!==null&&n!==void 0?n:{type:"%",value:"0"});for(var a=0,o=Number(t[0].length.value),s=1;s-1||t.indexOf("radial")>-1){var n=jF(t);return n.map(function(s){var c=s.type,l=s.orientation,u=s.colorStops;zF(u);var f=u.map(function(b){return{offset:ln(Number(b.length.value),"%"),color:NF(b)}});if(c==="linear-gradient")return new ld(ga.LinearGradient,{angle:l?WF(l):Ni,steps:f});if(c==="radial-gradient"&&(l||(l=[{type:"shape",value:"circle"}]),l[0].type==="shape"&&l[0].value==="circle")){var d=YF(l[0].at),h=d.cx,p=d.cy,v=void 0;if(l[0].style){var g=l[0].style,y=g.type,m=g.value;y==="extent-keyword"?v=yv(m):v=ln(m,y)}return new ld(ga.RadialGradient,{cx:h,cy:p,size:v,steps:f})}})}var r=t[0];if(t[1]==="("||t[2]==="("){if(r==="l"){var i=DF.exec(t);if(i){var a=((e=i[2].match(Hx))===null||e===void 0?void 0:e.map(function(s){return s.split(":")}))||[];return[new ld(ga.LinearGradient,{angle:ln(parseFloat(i[1]),"deg"),steps:a.map(function(s){var c=D(s,2),l=c[0],u=c[1];return{offset:ln(Number(l)*100,"%"),color:u}})})]}}else if(r==="r"){var o=$F(t);if(o)if(kn(o))t=o;else return[new ld(ga.RadialGradient,o)]}else if(r==="p")return VF(t)}});function $F(t){var e,n=FF.exec(t);if(n){var r=((e=n[4].match(Hx))===null||e===void 0?void 0:e.map(function(i){return i.split(":")}))||[];return{cx:ln(50,"%"),cy:ln(50,"%"),steps:r.map(function(i){var a=D(i,2),o=a[0],s=a[1];return{offset:ln(Number(o)*100,"%"),color:s}})}}return null}function VF(t){var e=BF.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;case"n":n="no-repeat";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}function rgt(t){return!!t.type&&!!t.value}function Yl(t){return t&&!!t.image}function fd(t){return t&&!ie(t.r)&&!ie(t.g)&&!ie(t.b)}var Ia=Mr(function(t){if(Yl(t))return Q({repetition:"repeat"},t);if(ie(t)&&(t=""),t==="transparent")return Wx;if(t==="currentColor")t="black";else if(t==="none")return ud;var e=HF(t);if(e)return e;var n=rd(t),r=[0,0,0,0];return n!==null&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),LF.apply(void 0,dt([],D(r),!1))});function UF(t,e){if(!(!fd(t)||!fd(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(n){var r=n.slice();if(r[3])for(var i=0;i<3;i++)r[i]=Math.round(Fn(r[i],0,255));return r[3]=Fn(r[3],0,1),"rgba(".concat(r.join(","),")")}]}function Hl(t,e){if(ie(e))return ln(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return ln(Number(e),"px");if("deg".search(t)>=0)return ln(Number(e),"deg")}var n=[];e=e.replace(t,function(i){return n.push(i),"U"+i});var r="U("+t.source+")";return n.map(function(i){return ln(Number(e.replace(new RegExp("U"+i,"g"),"").replace(new RegExp(r,"g"),"*0")),i)})[0]}var $x=function(t){return Hl(new RegExp("px","g"),t)},XF=Mr($x),qF=function(t){return Hl(new RegExp("%","g"),t)};Mr(qF);var $l=function(t){return $n(t)||isFinite(Number(t))?ln(Number(t)||0,"px"):Hl(new RegExp("px|%|em|rem","g"),t)},_c=Mr($l),bv=function(t){return Hl(new RegExp("deg|rad|grad|turn","g"),t)},Vx=Mr(bv);function ZF(t,e,n,r,i){i===void 0&&(i=0);var a="",o=t.value||0,s=e.value||0,c=pv(t.unit),l=t.convertTo(c),u=e.convertTo(c);return l&&u?(o=l.value,s=u.value,a=dv(t.unit)):(on.isLength(t.unit)||on.isLength(e.unit))&&(o=xi(t,i,n),s=xi(e,i,n),a="px"),[o,s,function(f){return r&&(f=Math.max(f,0)),f+a}]}function li(t){var e=0;return t.unit===Mt.kDegrees?e=t.value:t.unit===Mt.kRadians?e=Li(Number(t.value)):t.unit===Mt.kTurns&&(e=cF(Number(t.value))),e}function Ux(t,e){var n;return Array.isArray(t)?n=t.map(function(r){return Number(r)}):kn(t)?n=t.split(" ").map(function(r){return Number(r)}):$n(t)&&(n=[t]),e===2?n.length===1?[n[0],n[0]]:[n[0],n[1]]:n.length===1?[n[0],n[0],n[0],n[0]]:n.length===2?[n[0],n[1],n[0],n[1]]:n.length===3?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]}function Xx(t){return kn(t)?t.split(" ").map(function(e){return _c(e)}):t.map(function(e){return _c(e.toString())})}function xi(t,e,n,r){if(r===void 0&&(r=!1),t.unit===Mt.kPixels)return Number(t.value);if(t.unit===Mt.kPercentage&&n){var i=n.nodeName===st.GROUP?n.getLocalBounds():n.getGeometryBounds();return(r?i.min[e]:0)+t.value/100*i.halfExtents[e]*2}return 0}var KF=function(t){return Hl(/deg|rad|grad|turn|px|%/g,t)},QF=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function qx(t){if(t===void 0&&(t=""),t=t.toLowerCase().trim(),t==="none")return[];for(var e=/\s*([\w-]+)\(([^)]*)\)/g,n=[],r,i=0;r=e.exec(t);){if(r.index!==i)return[];if(i=r.index+r[0].length,QF.indexOf(r[1])>-1&&n.push({name:r[1],params:r[2].split(" ").map(function(a){return KF(a)||Ia(a)})}),e.lastIndex===t.length)return n}return[]}function Zx(t){return t.toString()}var xc=function(t){return typeof t=="number"?ln(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?ln(Number(t)):ln(0)},ds=Mr(xc);Mr(function(t){return kn(t)?t.split(" ").map(ds):t.map(ds)});function _v(t,e){return[t,e,Zx]}function xv(t,e){return function(n,r){return[n,r,function(i){return Zx(Fn(i,t,e))}]}}function Kx(t,e){if(t.length===e.length)return[t,e,function(n){return n}]}function Ov(t){return t.parsedStyle.d.totalLength===0&&(t.parsedStyle.d.totalLength=u8(t.parsedStyle.d.absolutePath)),t.parsedStyle.d.totalLength}function JF(t){return t.parsedStyle.points.totalLength===0&&(t.parsedStyle.points.totalLength=Q8(t.parsedStyle.points.points)),t.parsedStyle.points.totalLength}function t9(t){for(var e=0;e0&&n.push(r),{polygons:e,polylines:n}}function dd(t,e){return t[0]===e[0]&&t[1]===e[1]}function r9(t,e){for(var n=[],r=[],i=[],a=0;aMath.PI/2?Math.PI-l:l,u=u>Math.PI/2?Math.PI-u:u;var f={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};return f}function Qx(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}var Jx=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))),i=t.x*e.y-t.y*e.x<0?-1:1,a=i*Math.acos(n/r);return a},t2=function(t,e,n,r,i,a,o,s){e=Math.abs(e),n=Math.abs(n),r=ex(r,360);var c=rn(r);if(t.x===o.x&&t.y===o.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(e===0||n===0)return{x:0,y:0,ellipticalArcAngle:0};var l=(t.x-o.x)/2,u=(t.y-o.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),p=Math.pow(e,2)*Math.pow(f.y,2)+Math.pow(n,2)*Math.pow(f.x,2),v=h/p;v=v<0?0:v;var g=(i!==a?1:-1)*Math.sqrt(v),y={x:g*(e*f.y/n),y:g*(-(n*f.x)/e)},m={x:Math.cos(c)*y.x-Math.sin(c)*y.y+(t.x+o.x)/2,y:Math.sin(c)*y.x+Math.cos(c)*y.y+(t.y+o.y)/2},b={x:(f.x-y.x)/e,y:(f.y-y.y)/n},_=Jx({x:1,y:0},b),x={x:(-f.x-y.x)/e,y:(-f.y-y.y)/n},O=Jx(b,x);!a&&O>0?O-=2*Math.PI:a&&O<0&&(O+=2*Math.PI),O%=2*Math.PI;var w=_+O*s,S=e*Math.cos(w),M=n*Math.sin(w),E={x:Math.cos(c)*S-Math.sin(c)*M+m.x,y:Math.sin(c)*S+Math.cos(c)*M+m.y,ellipticalArcStartAngle:_,ellipticalArcEndAngle:_+O,ellipticalArcAngle:w,ellipticalArcCenter:m,resultantRx:e,resultantRy:n};return E};function i9(t){for(var e=[],n=null,r=null,i=null,a=0,o=t.length,s=0;s1&&(n*=Math.sqrt(h),r*=Math.sqrt(h));var p=n*n*(d*d)+r*r*(f*f),v=p?Math.sqrt((n*n*(r*r)-p)/p):1;a===o&&(v*=-1),isNaN(v)&&(v=0);var g=r?v*n*d/r:0,y=n?v*-r*f/n:0,m=(s+l)/2+Math.cos(i)*g-Math.sin(i)*y,b=(c+u)/2+Math.sin(i)*g+Math.cos(i)*y,_=[(f-g)/n,(d-y)/r],x=[(-1*f-g)/n,(-1*d-y)/r],O=n2([1,0],_),w=n2(_,x);return wv(_,x)<=-1&&(w=Math.PI),wv(_,x)>=1&&(w=0),o===0&&w>0&&(w=w-2*Math.PI),o===1&&w<0&&(w=w+2*Math.PI),{cx:m,cy:b,rx:dd(t,[l,u])?0:n,ry:dd(t,[l,u])?0:r,startAngle:O,endAngle:O+w,xRotation:i,arcFlag:a,sweepFlag:o}}function o9(t,e,n){return t.reduce(function(r,i){var a="";if(i[0]==="M"||i[0]==="L"){var o=De(i[1],i[2],0);n&&fr(o,o,n),a="".concat(i[0]).concat(o[0],",").concat(o[1])}else if(i[0]==="Z")a=i[0];else if(i[0]==="C"){var s=De(i[1],i[2],0),c=De(i[3],i[4],0),l=De(i[5],i[6],0);n&&(fr(s,s,n),fr(c,c,n),fr(l,l,n)),a="".concat(i[0]).concat(s[0],",").concat(s[1],",").concat(c[0],",").concat(c[1],",").concat(l[0],",").concat(l[1])}else if(i[0]==="A"){var u=De(i[6],i[7],0);n&&fr(u,u,n),a="".concat(i[0]).concat(i[1],",").concat(i[2],",").concat(i[3],",").concat(i[4],",").concat(i[5],",").concat(u[0],",").concat(u[1])}else if(i[0]==="Q"){var s=De(i[1],i[2],0),c=De(i[3],i[4],0);n&&(fr(s,s,n),fr(c,c,n)),a="".concat(i[0]).concat(i[1],",").concat(i[2],",").concat(i[3],",").concat(i[4],"}")}return r+=a},"")}function s9(t,e,n,r){return[["M",t,e],["L",n,r]]}function r2(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,a=t*i,o=e*i,s=n-t,c=n+t,l=r-e,u=r+e;return[["M",s,r],["C",s,r-o,n-a,l,n,l],["C",n+a,l,c,r-o,c,r],["C",c,r+o,n+a,u,n,u],["C",n-a,u,s,r+o,s,r],["Z"]]}function c9(t,e){var n=t.map(function(r,i){return[i===0?"M":"L",r[0],r[1]]});return e&&n.push(["Z"]),n}function l9(t,e,n,r,i){if(i){var a=D(i,4),o=a[0],s=a[1],c=a[2],l=a[3],u=t>0?1:-1,f=e>0?1:-1,d=u+f!==0?1:0;return[["M",u*o+n,r],["L",t-u*s+n,r],s?["A",s,s,0,0,d,t+n,f*s+r]:null,["L",t+n,e-f*c+r],c?["A",c,c,0,0,d,t+n-u*c,e+r]:null,["L",n+u*l,e+r],l?["A",l,l,0,0,d,n,e+r-f*l]:null,["L",n,f*o+r],o?["A",o,o,0,0,d,u*o+n,r]:null,["Z"]].filter(function(h){return h})}return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}function i2(t,e){e===void 0&&(e=t.getLocalTransform());var n=[];switch(t.nodeName){case st.LINE:var r=t.parsedStyle,i=r.x1,a=i===void 0?0:i,o=r.y1,s=o===void 0?0:o,c=r.x2,l=c===void 0?0:c,u=r.y2,f=u===void 0?0:u;n=s9(a,s,l,f);break;case st.CIRCLE:{var d=t.parsedStyle,h=d.r,p=h===void 0?0:h,v=d.cx,g=v===void 0?0:v,y=d.cy,m=y===void 0?0:y;n=r2(p,p,g,m);break}case st.ELLIPSE:{var b=t.parsedStyle,_=b.rx,x=_===void 0?0:_,O=b.ry,w=O===void 0?0:O,S=b.cx,g=S===void 0?0:S,M=b.cy,m=M===void 0?0:M;n=r2(x,w,g,m);break}case st.POLYLINE:case st.POLYGON:var E=t.parsedStyle.points;n=c9(E.points,t.nodeName===st.POLYGON);break;case st.RECT:var A=t.parsedStyle,C=A.width,P=C===void 0?0:C,T=A.height,k=T===void 0?0:T,N=A.x,F=N===void 0?0:N,R=A.y,I=R===void 0?0:R,z=A.radius,W=z&&z.some(function($){return $!==0});n=l9(P,k,F,I,W&&z.map(function($){return Fn($,0,Math.min(Math.abs(P)/2,Math.abs(k)/2))}));break;case st.PATH:var V=t.parsedStyle.d.absolutePath;n=dt([],D(V),!1);break}if(n.length)return o9(n,t,e)}function igt(t,e,n,r,i){e===void 0&&(e=0),n===void 0&&(n=0),r===void 0&&(r=0),i===void 0&&(i=0);var a=t.map(function(o,s){var c=o[0],l=t[s+1],u=s===0&&(e!==0||n!==0),f=(s===t.length-1||l&&(l[0]==="M"||l[0]==="Z"))&&r!==0&&i!==0;switch(c){case"M":return u?"M ".concat(o[1]+e,",").concat(o[2]+n," L ").concat(o[1],",").concat(o[2]):"M ".concat(o[1],",").concat(o[2]);case"L":return"L ".concat(o[1]+(f?r:0),",").concat(o[2]+(f?i:0));case"Q":return"Q ".concat(o[1]," ").concat(o[2],",").concat(o[3]," ").concat(o[4])+(f?" L ".concat(o[3]+r,",").concat(o[4]+i):"");case"C":return"C ".concat(o[1]," ").concat(o[2],",").concat(o[3]," ").concat(o[4],",").concat(o[5]," ").concat(o[6])+(f?" L ".concat(o[5]+r,",").concat(o[6]+i):"");case"A":return"A ".concat(o[1]," ").concat(o[2]," ").concat(o[3]," ").concat(o[4]," ").concat(o[5]," ").concat(o[6]," ").concat(o[7])+(f?" L ".concat(o[6]+r,",").concat(o[7]+i):"");case"Z":return"Z"}}).join(" ");return~a.indexOf("NaN")?"":a}var a2=function(t){if(t===""||Array.isArray(t)&&t.length===0)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=Qf(t)}catch(d){e=Qf(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}t9(e);var n=e9(e),r=n9(e),i=r.polygons,a=r.polylines,o=i9(e),s=r9(o,0),c=s.x,l=s.y,u=s.width,f=s.height;return{absolutePath:e,hasArc:n,segments:o,polygons:i,polylines:a,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}}},u9=Mr(a2);function Sv(t){return kn(t)?u9(t):a2(t)}function f9(t,e,n){var r=t.curve,i=e.curve;(!r||r.length===0)&&(r=ev(t.absolutePath,!1),t.curve=r),(!i||i.length===0)&&(i=ev(e.absolutePath,!1),e.curve=i);var a=[r,i];r.length!==i.length&&(a=ix(r,i));var o=ax(a[0])!==ax(a[1])?_8(a[0]):x8(a[0]);return[o,w8(a[1],o),function(s){return s}]}function o2(t,e){var n;return kn(t)?n=t.split(" ").map(function(r){var i=D(r.split(","),2),a=i[0],o=i[1];return[Number(a),Number(o)]}):n=t,{points:n,totalLength:0,segments:[]}}function d9(t,e){return[t.points,e.points,function(n){return n}]}var Bn=null;function ui(t){return function(e){var n=0;return t.map(function(r){return r===Bn?e[n++]:r})}}function hs(t){return t}var vd={matrix:["NNNNNN",[Bn,Bn,0,0,Bn,Bn,0,0,0,0,1,0,Bn,Bn,0,1],hs],matrix3d:["NNNNNNNNNNNNNNNN",hs],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",ui([Bn,Bn,new on(1)]),hs],scalex:["N",ui([Bn,new on(1),new on(1)]),ui([Bn,new on(1)])],scaley:["N",ui([new on(1),Bn,new on(1)]),ui([new on(1),Bn])],scalez:["N",ui([new on(1),new on(1),Bn])],scale3d:["NNN",hs],skew:["Aa",null,hs],skewx:["A",null,ui([Bn,Ni])],skewy:["A",null,ui([Ni,Bn])],translate:["Tt",ui([Bn,Bn,Un]),hs],translatex:["T",ui([Bn,Un,Un]),ui([Bn,Un])],translatey:["T",ui([Un,Bn,Un]),ui([Un,Bn])],translatez:["L",ui([Un,Un,Bn])],translate3d:["TTL",hs]};function Mv(t){if(t=(t||"none").toLowerCase().trim(),t==="none")return[];for(var e=/\s*(\w+)\(([^)]*)\)/g,n=[],r,i=0;r=e.exec(t);){if(r.index!==i)return[];i=r.index+r[0].length;var a=r[1],o=vd[a];if(!o)return[];var s=r[2].split(","),c=o[0];if(c.length"].calculator(null,null,{value:n.textTransform},e,null),pn(n.clipPath)||this.runtime.CSSPropertySyntaxFactory[""].calculator("clipPath",o,n.clipPath,e,this.runtime),n.offsetPath&&this.runtime.CSSPropertySyntaxFactory[""].calculator("offsetPath",s,n.offsetPath,e,this.runtime),n.transform&&(e.parsedStyle.transform=Mv(n.transform)),n.transformOrigin&&(e.parsedStyle.transformOrigin=l2(n.transformOrigin)),n.markerStart&&(e.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[""].calculator(null,n.markerStart,n.markerStart,null,null)),n.markerEnd&&(e.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[""].calculator(null,n.markerEnd,n.markerEnd,null,null)),n.markerMid&&(e.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[""].calculator("",n.markerMid,n.markerMid,null,null)),ie(n.zIndex)||this.runtime.CSSPropertySyntaxFactory[""].postProcessor(e,a),ie(n.offsetDistance)||this.runtime.CSSPropertySyntaxFactory[""].postProcessor(e,a),n.transform&&this.runtime.CSSPropertySyntaxFactory[""].postProcessor(e,a),n.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[""].postProcessor(e,a),c&&(e.geometry.dirty=!0,e.renderable.boundsDirty=!0,e.renderable.renderBoundsDirty=!0,r.forceUpdateGeometry||this.runtime.sceneGraphService.dirtifyToRoot(e))}},t.prototype.parseProperty=function(e,n,r,i){var a=ho[e],o=n;if((n===""||ie(n))&&(n="unset"),n==="unset"||n==="initial"||n==="inherit")o=yv(n);else if(a){var s=a.k,c=a.syntax,l=c&&this.getPropertySyntax(c);s&&s.indexOf(n)>-1?o=yv(n):l&&(!i&&l.parserUnmemoize?o=l.parserUnmemoize(n,r):l.parser&&(o=l.parser(n,r)))}return o},t.prototype.computeProperty=function(e,n,r,i){var a=ho[e],o=r.id==="g-root",s=n;if(a){var c=a.syntax,l=a.inh,u=a.d;if(n instanceof ci){var f=n.value;if(f==="unset"&&(l&&!o?f="inherit":f="initial"),f==="initial")ie(u)||(n=this.parseProperty(e,mc(u)?u(r.nodeName):u,r,i));else if(f==="inherit"){var d=this.tryToResolveProperty(r,e,{inherited:!0});if(ie(d)){this.addUnresolveProperty(r,e);return}else return d}}var h=c&&this.getPropertySyntax(c);if(h&&h.calculator){var p=r.parsedStyle[e];s=h.calculator(e,p,n,r,this.runtime)}else n instanceof ci?s=n.value:s=n}return s},t.prototype.postProcessProperty=function(e,n,r){var i=ho[e];if(i&&i.syntax){var a=i.syntax&&this.getPropertySyntax(i.syntax),o=a;o&&o.postProcessor&&o.postProcessor(n,r)}},t.prototype.addUnresolveProperty=function(e,n){var r=Oc.get(e);r||(Oc.set(e,[]),r=Oc.get(e)),r.indexOf(n)===-1&&r.push(n)},t.prototype.tryToResolveProperty=function(e,n,r){r===void 0&&(r={});var i=r.inherited;if(i&&e.parentElement&&w9(e.parentElement,n)){var a=e.parentElement.parsedStyle[n];return a==="unset"||a==="initial"||a==="inherit"?void 0:a}},t.prototype.recalc=function(e){var n=Oc.get(e);if(n&&n.length){var r={};n.forEach(function(i){r[i]=e.attributes[i]}),this.processProperties(e,r),Oc.delete(e)}},t.prototype.updateGeometry=function(e){var n=e.nodeName,r=this.runtime.geometryUpdaterFactory[n];if(r){var i=e.geometry;i.contentBounds||(i.contentBounds=new Vn),i.renderBounds||(i.renderBounds=new Vn);var a=e.parsedStyle,o=r.update(a,e),s=o.cx,c=s===void 0?0:s,l=o.cy,u=l===void 0?0:l,f=o.cz,d=f===void 0?0:f,h=o.hwidth,p=h===void 0?0:h,v=o.hheight,g=v===void 0?0:v,y=o.hdepth,m=y===void 0?0:y,b=[Math.abs(p),Math.abs(g),m],_=a,x=_.stroke,O=_.lineWidth,w=O===void 0?1:O,S=_.increasedLineWidthForHitTesting,M=S===void 0?0:S,E=_.shadowType,A=E===void 0?"outer":E,C=_.shadowColor,P=_.filter,T=P===void 0?[]:P,k=_.transformOrigin,N=[c,u,d];i.contentBounds.update(N,b);var F=n===st.POLYLINE||n===st.POLYGON||n===st.PATH?Math.SQRT2:.5,R=x&&!x.isNone;if(R){var I=((w||0)+(M||0))*F;b[0]+=I,b[1]+=I}if(i.renderBounds.update(N,b),C&&A&&A!=="inner"){var z=i.renderBounds,W=z.min,V=z.max,$=a,J=$.shadowBlur,ct=$.shadowOffsetX,pt=$.shadowOffsetY,it=J||0,nt=ct||0,xt=pt||0,yt=W[0]-it+nt,Rt=V[0]+it+nt,Yt=W[1]-it+xt,Qt=V[1]+it+xt;W[0]=Math.min(W[0],yt),V[0]=Math.max(V[0],Rt),W[1]=Math.min(W[1],Yt),V[1]=Math.max(V[1],Qt),i.renderBounds.setMinMax(W,V)}T.forEach(function(ye){var yn=ye.name,Zn=ye.params;if(yn==="blur"){var yi=Zn[0].value;i.renderBounds.update(i.renderBounds.center,sd(i.renderBounds.halfExtents,i.renderBounds.halfExtents,[yi,yi,0]))}else if(yn==="drop-shadow"){var Kn=Zn[0].value,br=Zn[1].value,ae=Zn[2].value,me=i.renderBounds,fe=me.min,ne=me.max,Fe=fe[0]-ae+Kn,Ne=ne[0]+ae+Kn,Ae=fe[1]-ae+br,dn=ne[1]+ae+br;fe[0]=Math.min(fe[0],Fe),ne[0]=Math.max(ne[0],Ne),fe[1]=Math.min(fe[1],Ae),ne[1]=Math.max(ne[1],dn),i.renderBounds.setMinMax(fe,ne)}}),e.geometry.dirty=!1;var Jt=p<0,pe=g<0,Ge=(Jt?-1:1)*(k?xi(k[0],0,e,!0):0),le=(pe?-1:1)*(k?xi(k[1],1,e,!0):0);(Ge||le)&&e.setOrigin(Ge,le)}},t.prototype.updateSizeAttenuation=function(e,n){e.style.isSizeAttenuation?(e.style.rawLineWidth||(e.style.rawLineWidth=e.style.lineWidth),e.style.lineWidth=(e.style.rawLineWidth||1)/n,e.nodeName===st.CIRCLE&&(e.style.rawR||(e.style.rawR=e.style.r),e.style.r=(e.style.rawR||1)/n)):(e.style.rawLineWidth&&(e.style.lineWidth=e.style.rawLineWidth,delete e.style.rawLineWidth),e.nodeName===st.CIRCLE&&e.style.rawR&&(e.style.r=e.style.rawR,delete e.style.rawR))},t.prototype.isPropertyInheritable=function(e){var n=ho[e];return n?n.inh:!1},t}(),M9=function(){function t(){this.parser=Vx,this.parserUnmemoize=bv,this.parserWithCSSDisabled=null,this.mixer=_v}return t.prototype.calculator=function(e,n,r,i){return li(r)},t}(),E9=function(){function t(){}return t.prototype.calculator=function(e,n,r,i,a){return r instanceof ci&&(r=null),a.sceneGraphService.updateDisplayObjectDependency(e,n,r,i),e==="clipPath"&&i.forEach(function(o){o.childNodes.length===0&&a.sceneGraphService.dirtifyToRoot(o)}),r},t}(),A9=function(){function t(){this.parser=Ia,this.parserWithCSSDisabled=Ia,this.mixer=UF}return t.prototype.calculator=function(e,n,r,i){return r instanceof ci?r.value==="none"?ud:Wx:r},t}(),P9=function(){function t(){this.parser=qx}return t.prototype.calculator=function(e,n,r){return r instanceof ci?[]:r},t}();function f2(t){var e=t.parsedStyle.fontSize;return ie(e)?null:e}var kv=function(){function t(){this.parser=_c,this.parserUnmemoize=$l,this.parserWithCSSDisabled=null,this.mixer=_v}return t.prototype.calculator=function(e,n,r,i,a){var o;if($n(r))return r;if(on.isRelativeUnit(r.unit)){var s=a.styleValueRegistry;if(r.unit===Mt.kPercentage)return 0;if(r.unit===Mt.kEms){if(i.parentNode){var c=f2(i.parentNode);if(c)return c*=r.value,c;s.addUnresolveProperty(i,e)}else s.addUnresolveProperty(i,e);return 0}else if(r.unit===Mt.kRems){if(!((o=i==null?void 0:i.ownerDocument)===null||o===void 0)&&o.documentElement){var c=f2(i.ownerDocument.documentElement);if(c)return c*=r.value,c;s.addUnresolveProperty(i,e)}else s.addUnresolveProperty(i,e);return 0}}else return r.value},t}(),T9=function(){function t(){this.mixer=Kx}return t.prototype.parser=function(e){var n=Xx($n(e)?[e]:e),r;return n.length===1?r=[n[0],n[0]]:r=[n[0],n[1]],r},t.prototype.calculator=function(e,n,r){return r.map(function(i){return i.value})},t}(),k9=function(){function t(){this.mixer=Kx}return t.prototype.parser=function(e){var n=Xx($n(e)?[e]:e),r;return n.length===1?r=[n[0],n[0],n[0],n[0]]:n.length===2?r=[n[0],n[1],n[0],n[1]]:n.length===3?r=[n[0],n[1],n[2],n[1]]:r=[n[0],n[1],n[2],n[3]],r},t.prototype.calculator=function(e,n,r){return r.map(function(i){return i.value})},t}(),C9=function(){function t(){}return t.prototype.calculator=function(e,n,r,i){r instanceof ci&&(r=null);var a=r==null?void 0:r.cloneNode(!0);return a&&(a.style.isMarker=!0),a},t}(),L9=function(){function t(){this.mixer=_v,this.parser=ds,this.parserUnmemoize=xc,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(e,n,r){return r.value},t}(),N9=function(){function t(){this.parser=ds,this.parserUnmemoize=xc,this.parserWithCSSDisabled=null,this.mixer=xv(0,1)}return t.prototype.calculator=function(e,n,r){return r.value},t.prototype.postProcessor=function(e){var n=e.parsedStyle,r=n.offsetPath,i=n.offsetDistance;if(r){var a=r.nodeName;if(a===st.LINE||a===st.PATH||a===st.POLYLINE){var o=r.getPoint(i);o&&e.setLocalPosition(o.x,o.y)}}},t}(),j9=function(){function t(){this.parser=ds,this.parserUnmemoize=xc,this.parserWithCSSDisabled=null,this.mixer=xv(0,1)}return t.prototype.calculator=function(e,n,r){return r.value},t}(),R9=function(){function t(){this.parser=Sv,this.parserWithCSSDisabled=Sv,this.mixer=f9}return t.prototype.calculator=function(e,n,r){return r instanceof ci&&r.value==="unset"?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new fs(0,0,0,0)}:r},t}(),I9=function(){function t(){this.parser=o2,this.mixer=d9}return t}(),D9=function(t){It(e,t);function e(){var n=t.apply(this,dt([],D(arguments),!1))||this;return n.mixer=xv(0,1/0),n}return e}(kv),F9=function(){function t(){}return t.prototype.calculator=function(e,n,r,i){return r instanceof ci?r.value==="unset"?"":r.value:"".concat(r)},t.prototype.postProcessor=function(e){e.nodeValue="".concat(e.parsedStyle.text)||""},t}(),B9=function(){function t(){}return t.prototype.calculator=function(e,n,r,i){var a=i.getAttribute("text");if(a){var o=a;r.value==="capitalize"?o=a.charAt(0).toUpperCase()+a.slice(1):r.value==="lowercase"?o=a.toLowerCase():r.value==="uppercase"&&(o=a.toUpperCase()),i.parsedStyle.text=o}return r.value},t}(),Cv={},z9=0;function G9(t,e){if(t){var n=typeof t=="string"?t:t.id||z9++;Cv[n]&&Cv[n].destroy(),Cv[n]=e}}var Vl=typeof window!="undefined"&&typeof window.document!="undefined";function W9(t){return!!t.getAttribute}function Y9(t,e){for(var n=0,r=t.length;n>>1;d2(t[i],e)<0?n=i+1:r=i}return n}function d2(t,e){var n=Number(t.parsedStyle.zIndex||0),r=Number(e.parsedStyle.zIndex||0);if(n===r){var i=t.parentNode;if(i){var a=i.childNodes||[];return a.indexOf(t)-a.indexOf(e)}}return n-r}function h2(t){var e,n=t;do{var r=(e=n.parsedStyle)===null||e===void 0?void 0:e.clipPath;if(r)return n;n=n.parentElement}while(n!==null);return null}var p2="px";function H9(t,e,n){Vl&&t.style&&(t.style.width=e+p2,t.style.height=n+p2)}function v2(t,e){if(Vl)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}function $9(t){var e=v2(t,"width");return e==="auto"?t.offsetWidth:parseFloat(e)}function V9(t){var e=v2(t,"height");return e==="auto"?t.offsetHeight:parseFloat(e)}var U9=1,X9={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Lv=typeof performance=="object"&&performance.now?performance:Date;function ps(t,e,n){t===void 0&&(t="auto");var r=!1,i=!1,a=!!e&&!e.isNone,o=!!n&&!n.isNone;return t==="visiblepainted"||t==="painted"||t==="auto"?(r=a,i=o):t==="visiblefill"||t==="fill"?r=!0:t==="visiblestroke"||t==="stroke"?i=!0:(t==="visible"||t==="all")&&(r=!0,i=!0),[r,i]}var q9=1,Z9=function(){return q9++},ya=typeof self=="object"&&self.self==self?self:typeof tt.g=="object"&&tt.g.global==tt.g?tt.g:{},K9=Date.now(),Q9=function(){return ya.performance&&typeof ya.performance.now=="function"?ya.performance.now():Date.now()-K9},Ul={},g2=Date.now(),J9=function(t){if(typeof t!="function")throw new TypeError(t+" is not a function");var e=Date.now(),n=e-g2,r=n>16?0:16-n,i=Z9();return Ul[i]=t,Object.keys(Ul).length>1||setTimeout(function(){g2=e;var a=Ul;Ul={},Object.keys(a).forEach(function(o){return a[o](Q9())})},r),i},tB=function(t){delete Ul[t]},eB=["","webkit","moz","ms","o"],y2=function(t){return typeof t!="string"?J9:t===""?ya.requestAnimationFrame:ya[t+"RequestAnimationFrame"]},nB=function(t){return typeof t!="string"?tB:t===""?ya.cancelAnimationFrame:ya[t+"CancelAnimationFrame"]||ya[t+"CancelRequestAnimationFrame"]},rB=function(t,e){for(var n=0;t[n]!==void 0;){if(e(t[n]))return t[n];n=n+1}},m2=rB(eB,function(t){return!!y2(t)}),Nv=y2(m2),b2=nB(m2);ya.requestAnimationFrame=Nv,ya.cancelAnimationFrame=b2;var iB=function(){function t(){this.callbacks=[]}return t.prototype.getCallbacksNum=function(){return this.callbacks.length},t.prototype.tapPromise=function(e,n){this.callbacks.push(n)},t.prototype.promise=function(){for(var e=[],n=0;n=0;h--){var p=d[h].trim();!sB.test(p)&&oB.indexOf(p)<0&&(p='"'.concat(p,'"')),d[h]=p}return"".concat(o," ").concat(c," ").concat(u," ").concat(f," ").concat(d.join(","))}function Rv(t,e,n){return as(t),t[4]=Math.tan(e),t[1]=Math.tan(n),t}var Xl=1e-5,lB=cn(),er=cn();function _2(t,e){if(t.length){var n=as(lB);t.forEach(function(r){var i=r.t,a=r.d;if(i==="scale"){var o=(a==null?void 0:a.map(function(y){return Math.max(y.value,Xl)}))||[1,1];ss(er,[o[0],o[1],1])}else if(i==="scalex"){var o=(a==null?void 0:a.map(function(m){return Math.max(m.value,Xl)}))||[1];ss(er,[o[0],1,1])}else if(i==="scaley"){var o=(a==null?void 0:a.map(function(m){return Math.max(m.value,Xl)}))||[1];ss(er,[1,o[0],1])}else if(i==="scalez"){var o=(a==null?void 0:a.map(function(m){return Math.max(m.value,Xl)}))||[1];ss(er,[1,1,o[0]])}else if(i==="scale3d"){var o=(a==null?void 0:a.map(function(m){return Math.max(m.value,Xl)}))||[1,1,1];ss(er,[o[0],o[1],o[2]])}else if(i==="translate"){var s=a||[Un,Un];os(er,[s[0].value,s[1].value,0])}else if(i==="translatex"){var s=a||[Un];os(er,[s[0].value,0,0])}else if(i==="translatey"){var s=a||[Un];os(er,[0,s[0].value,0])}else if(i==="translatez"){var s=a||[Un];os(er,[0,0,s[0].value])}else if(i==="translate3d"){var s=a||[Un,Un,Un];os(er,[s[0].value,s[1].value,s[2].value])}else if(i==="rotate"){var c=a||[Ni];X0(er,rn(li(c[0])))}else if(i==="rotatex"){var c=a||[Ni];R_(er,rn(li(c[0])))}else if(i==="rotatey"){var c=a||[Ni];I_(er,rn(li(c[0])))}else if(i==="rotatez"){var c=a||[Ni];X0(er,rn(li(c[0])))}else if(i==="rotate3d"){var c=a||[Un,Un,Un,Ni];j_(er,rn(li(c[3])),[c[0].value,c[1].value,c[2].value])}else if(i==="skew"){var l=(a==null?void 0:a.map(function(y){return y.value}))||[0,0];Rv(er,rn(l[0]),rn(l[1]))}else if(i==="skewx"){var l=(a==null?void 0:a.map(function(m){return m.value}))||[0];Rv(er,rn(l[0]),0)}else if(i==="skewy"){var l=(a==null?void 0:a.map(function(m){return m.value}))||[0];Rv(er,0,rn(l[0]))}else if(i==="matrix"){var u=D(a.map(function(y){return y.value}),6),f=u[0],d=u[1],h=u[2],p=u[3],v=u[4],g=u[5];U0(er,f,d,0,0,h,p,0,0,0,0,1,0,v,g,0,1)}else i==="matrix3d"&&U0.apply(Et,dt([er],D(a.map(function(y){return y.value})),!1));H_(n,n,er)}),e.setLocalTransform(n)}else e.resetLocalTransform();return e.getLocalTransform()}var uB=function(){function t(){this.parser=Mv,this.parserUnmemoize=s2,this.parserWithCSSDisabled=s2,this.mixer=x9}return t.prototype.calculator=function(e,n,r,i){return r instanceof ci?[]:r},t.prototype.postProcessor=function(e){var n=e.parsedStyle.transform;_2(n,e)},t}(),fB=function(){function t(){this.parser=l2,this.parserUnmemoize=O9}return t.prototype.postProcessor=function(e){var n=e.parsedStyle.transformOrigin;n[0].unit===Mt.kPixels&&n[1].unit===Mt.kPixels?e.setOrigin(n[0].value,n[1].value):e.getGeometryBounds()},t}(),dB=function(){function t(){this.parser=ds,this.parserUnmemoize=xc}return t.prototype.calculator=function(e,n,r,i){return r.value},t.prototype.postProcessor=function(e){if(e.parentNode){var n=e.parentNode,r=n.renderable,i=n.sortable;r&&(r.dirty=!0),i&&(i.dirty=!0,i.dirtyReason=bc.Z_INDEX_CHANGED)}},t}(),hB=function(){function t(){}return t.prototype.update=function(e,n){var r=e.cx,i=r===void 0?0:r,a=e.cy,o=a===void 0?0:a,s=e.r,c=s===void 0?0:s;return{cx:i,cy:o,hwidth:c,hheight:c}},t}(),pB=function(){function t(){}return t.prototype.update=function(e,n){var r=e.cx,i=r===void 0?0:r,a=e.cy,o=a===void 0?0:a,s=e.rx,c=s===void 0?0:s,l=e.ry,u=l===void 0?0:l;return{cx:i,cy:o,hwidth:c,hheight:u}},t}(),vB=function(){function t(){}return t.prototype.update=function(e){var n=e.x1,r=e.y1,i=e.x2,a=e.y2,o=Math.min(n,i),s=Math.max(n,i),c=Math.min(r,a),l=Math.max(r,a),u=s-o,f=l-c,d=u/2,h=f/2;return{cx:o+d,cy:c+h,hwidth:d,hheight:h}},t}(),gB=function(){function t(){}return t.prototype.update=function(e){var n=e.d,r=n.rect,i=r.x,a=r.y,o=r.width,s=r.height,c=o/2,l=s/2;return{cx:i+c,cy:a+l,hwidth:c,hheight:l}},t}(),yB=function(){function t(){}return t.prototype.update=function(e){if(e.points&&sr(e.points.points)){var n=e.points.points,r=Math.min.apply(Math,dt([],D(n.map(function(f){return f[0]})),!1)),i=Math.max.apply(Math,dt([],D(n.map(function(f){return f[0]})),!1)),a=Math.min.apply(Math,dt([],D(n.map(function(f){return f[1]})),!1)),o=Math.max.apply(Math,dt([],D(n.map(function(f){return f[1]})),!1)),s=i-r,c=o-a,l=s/2,u=c/2;return{cx:r+l,cy:a+u,hwidth:l,hheight:u}}return{cx:0,cy:0,hwidth:0,hheight:0}},t}(),mB=function(){function t(){}return t.prototype.update=function(e,n){var r=e.x,i=r===void 0?0:r,a=e.y,o=a===void 0?0:a,s=e.src,c=e.width,l=c===void 0?0:c,u=e.height,f=u===void 0?0:u,d=l,h=f;return s&&!kn(s)&&(d||(d=s.width,e.width=d),h||(h=s.height,e.height=h)),{cx:i+d/2,cy:o+h/2,hwidth:d/2,hheight:h/2}},t}(),bB=function(){function t(e){this.globalRuntime=e}return t.prototype.isReadyToMeasure=function(e,n){var r=e.text,i=e.textAlign,a=e.textBaseline,o=e.fontSize,s=e.fontStyle,c=e.fontWeight,l=e.fontVariant,u=e.lineWidth;return et.enableCSSParsing?r&&o&&s&&c&&l&&i&&a&&!ie(u):r},t.prototype.update=function(e,n){var r,i,a=e.text,o=e.textAlign,s=o===void 0?"start":o,c=e.lineWidth,l=c===void 0?1:c,u=e.textBaseline,f=u===void 0?"alphabetic":u,d=e.dx,h=d===void 0?0:d,p=e.dy,v=p===void 0?0:p,g=e.x,y=g===void 0?0:g,m=e.y,b=m===void 0?0:m;if(!this.isReadyToMeasure(e,n))return e.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var _=(((i=(r=n==null?void 0:n.ownerDocument)===null||r===void 0?void 0:r.defaultView)===null||i===void 0?void 0:i.getConfig())||{}).offscreenCanvas,x=this.globalRuntime.textService.measureText(a,e,_);e.metrics=x;var O=x.width,w=x.height,S=x.lineHeight,M=x.fontProperties,E=O/2,A=w/2,C=y+E;s==="center"||s==="middle"?C+=l/2-E:(s==="right"||s==="end")&&(C+=l-E*2);var P=b-A;return f==="middle"?P+=A:f==="top"||f==="hanging"?P+=A*2:f==="alphabetic"?P+=this.globalRuntime.enableCSSParsing?S-M.ascent:0:(f==="bottom"||f==="ideographic")&&(P+=0),h&&(C+=h),v&&(P+=v),{cx:C,cy:P,hwidth:E,hheight:A}},t}(),_B=function(){function t(){}return t.prototype.update=function(e,n){return{cx:0,cy:0,hwidth:0,hheight:0}},t}();function xB(t){return!!t.type}var yd=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 Sr,this.page=new Sr,this.canvas=new Sr,this.viewport=new Sr,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(an)},t}(),x2=function(t){It(e,t);function e(){var n=t.apply(this,dt([],D(arguments),!1))||this;return n.client=new Sr,n.movement=new Sr,n.offset=new Sr,n.global=new Sr,n.screen=new Sr,n}return 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(n){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(n)},e.prototype.initMouseEvent=function(){throw new Error(an)},e}(yd),Iv=function(t){It(e,t);function e(){var n=t.apply(this,dt([],D(arguments),!1))||this;return n.width=0,n.height=0,n.isPrimary=!1,n}return e.prototype.getCoalescedEvents=function(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]},e.prototype.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},e.prototype.clone=function(){return this.manager.clonePointerEvent(this)},e}(x2),Dv=function(t){It(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(x2),sn=function(t){It(e,t);function e(n,r){var i=t.call(this,null)||this;return i.type=n,i.detail=r,Object.assign(i,r),i}return e}(yd),O2=":",w2=function(){function t(){this.emitter=new H0}return t.prototype.on=function(e,n,r){return this.addEventListener(e,n,r),this},t.prototype.addEventListener=function(e,n,r){var i=ox(r)&&r||cs(r)&&r.capture,a=cs(r)&&r.once,o=mc(n)?void 0:n,s=!1,c="";if(e.indexOf(O2)>-1){var l=D(e.split(O2),2),u=l[0],f=l[1];e=f,c=u,s=!0}if(e=i?"".concat(e,"capture"):e,n=mc(n)?n:n.handleEvent,s){var d=n;n=function(){for(var h,p=[],v=0;v0},e.prototype.isDefaultNamespace=function(n){throw new Error(an)},e.prototype.lookupNamespaceURI=function(n){throw new Error(an)},e.prototype.lookupPrefix=function(n){throw new Error(an)},e.prototype.normalize=function(){throw new Error(an)},e.prototype.isEqualNode=function(n){return this===n},e.prototype.isSameNode=function(n){return this.isEqualNode(n)},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(n){var r;if(n===this)return 0;for(var i=n,a=this,o=[i],s=[a];(r=i.parentNode)!==null&&r!==void 0?r:a.parentNode;)i=i.parentNode?(o.push(i.parentNode),i.parentNode):i,a=a.parentNode?(s.push(a.parentNode),a.parentNode):a;if(i!==a)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var c=o.length>s.length?o:s,l=c===o?s:o;if(c[c.length-l.length]===l[0])return c===o?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var u=c.length-l.length,f=l.length-1;f>=0;f--){var d=l[f],h=c[u+f];if(h!==d){var p=d.parentNode.childNodes;return p.indexOf(d)0&&r;)r=r.parentNode,n--;return r},e.prototype.forEach=function(n,r){r===void 0&&(r=!1),n(this)||(r?this.childNodes.slice():this.childNodes).forEach(function(i){i.forEach(n)})},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}(w2),OB=2048,wB=function(){function t(e,n){var r=this;this.globalRuntime=e,this.context=n,this.emitter=new H0,this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=cn(),this.tmpVec3=Se(),this.onPointerDown=function(i){var a=r.createPointerEvent(i);if(r.dispatchEvent(a,"pointerdown"),a.pointerType==="touch")r.dispatchEvent(a,"touchstart");else if(a.pointerType==="mouse"||a.pointerType==="pen"){var o=a.button===2;r.dispatchEvent(a,o?"rightdown":"mousedown")}var s=r.trackingData(i.pointerId);s.pressTargetsByButton[i.button]=a.composedPath(),r.freeEvent(a)},this.onPointerUp=function(i){var a,o=Lv.now(),s=r.createPointerEvent(i,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);if(r.dispatchEvent(s,"pointerup"),s.pointerType==="touch")r.dispatchEvent(s,"touchend");else if(s.pointerType==="mouse"||s.pointerType==="pen"){var c=s.button===2;r.dispatchEvent(s,c?"rightup":"mouseup")}var l=r.trackingData(i.pointerId),u=r.findMountedTarget(l.pressTargetsByButton[i.button]),f=u;if(u&&!s.composedPath().includes(u)){for(var d=u;d&&!s.composedPath().includes(d);){if(s.currentTarget=d,r.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch")r.notifyTarget(s,"touchendoutside");else if(s.pointerType==="mouse"||s.pointerType==="pen"){var c=s.button===2;r.notifyTarget(s,c?"rightupoutside":"mouseupoutside")}gr.isNode(d)&&(d=d.parentNode)}delete l.pressTargetsByButton[i.button],f=d}if(f){var h=r.clonePointerEvent(s,"click");h.target=f,h.path=[],l.clicksByButton[i.button]||(l.clicksByButton[i.button]={clickCount:0,target:h.target,timeStamp:o});var p=l.clicksByButton[i.button];p.target===h.target&&o-p.timeStamp<200?++p.clickCount:p.clickCount=1,p.target=h.target,p.timeStamp=o,h.detail=p.clickCount,!((a=s.detail)===null||a===void 0)&&a.preventClick||(!r.context.config.useNativeClickEvent&&(h.pointerType==="mouse"||h.pointerType==="touch")&&r.dispatchEvent(h,"click"),r.dispatchEvent(h,"pointertap")),r.freeEvent(h)}r.freeEvent(s)},this.onPointerMove=function(i){var a=r.createPointerEvent(i,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0),o=a.pointerType==="mouse"||a.pointerType==="pen",s=r.trackingData(i.pointerId),c=r.findMountedTarget(s.overTargets);if(s.overTargets&&c!==a.target){var l=i.type==="mousemove"?"mouseout":"pointerout",u=r.createPointerEvent(i,l,c||void 0);if(r.dispatchEvent(u,"pointerout"),o&&r.dispatchEvent(u,"mouseout"),!a.composedPath().includes(c)){var f=r.createPointerEvent(i,"pointerleave",c||void 0);for(f.eventPhase=f.AT_TARGET;f.target&&!a.composedPath().includes(f.target);)f.currentTarget=f.target,r.notifyTarget(f),o&&r.notifyTarget(f,"mouseleave"),gr.isNode(f.target)&&(f.target=f.target.parentNode);r.freeEvent(f)}r.freeEvent(u)}if(c!==a.target){var d=i.type==="mousemove"?"mouseover":"pointerover",h=r.clonePointerEvent(a,d);r.dispatchEvent(h,"pointerover"),o&&r.dispatchEvent(h,"mouseover");for(var p=c&&gr.isNode(c)&&c.parentNode;p&&p!==(gr.isNode(r.rootTarget)&&r.rootTarget.parentNode)&&p!==a.target;)p=p.parentNode;var v=!p||p===(gr.isNode(r.rootTarget)&&r.rootTarget.parentNode);if(v){var g=r.clonePointerEvent(a,"pointerenter");for(g.eventPhase=g.AT_TARGET;g.target&&g.target!==c&&g.target!==(gr.isNode(r.rootTarget)&&r.rootTarget.parentNode);)g.currentTarget=g.target,r.notifyTarget(g),o&&r.notifyTarget(g,"mouseenter"),gr.isNode(g.target)&&(g.target=g.target.parentNode);r.freeEvent(g)}r.freeEvent(h)}r.dispatchEvent(a,"pointermove"),a.pointerType==="touch"&&r.dispatchEvent(a,"touchmove"),o&&(r.dispatchEvent(a,"mousemove"),r.cursor=r.getCursor(a.target)),s.overTargets=a.composedPath(),r.freeEvent(a)},this.onPointerOut=function(i){var a=r.trackingData(i.pointerId);if(a.overTargets){var o=i.pointerType==="mouse"||i.pointerType==="pen",s=r.findMountedTarget(a.overTargets),c=r.createPointerEvent(i,"pointerout",s||void 0);r.dispatchEvent(c),o&&r.dispatchEvent(c,"mouseout");var l=r.createPointerEvent(i,"pointerleave",s||void 0);for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==(gr.isNode(r.rootTarget)&&r.rootTarget.parentNode);)l.currentTarget=l.target,r.notifyTarget(l),o&&r.notifyTarget(l,"mouseleave"),gr.isNode(l.target)&&(l.target=l.target.parentNode);a.overTargets=null,r.freeEvent(c),r.freeEvent(l)}r.cursor=null},this.onPointerOver=function(i){var a=r.trackingData(i.pointerId),o=r.createPointerEvent(i),s=o.pointerType==="mouse"||o.pointerType==="pen";r.dispatchEvent(o,"pointerover"),s&&r.dispatchEvent(o,"mouseover"),o.pointerType==="mouse"&&(r.cursor=r.getCursor(o.target));var c=r.clonePointerEvent(o,"pointerenter");for(c.eventPhase=c.AT_TARGET;c.target&&c.target!==(gr.isNode(r.rootTarget)&&r.rootTarget.parentNode);)c.currentTarget=c.target,r.notifyTarget(c),s&&r.notifyTarget(c,"mouseenter"),gr.isNode(c.target)&&(c.target=c.target.parentNode);a.overTargets=o.composedPath(),r.freeEvent(o),r.freeEvent(c)},this.onPointerUpOutside=function(i){var a=r.trackingData(i.pointerId),o=r.findMountedTarget(a.pressTargetsByButton[i.button]),s=r.createPointerEvent(i);if(o){for(var c=o;c;)s.currentTarget=c,r.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch"||(s.pointerType==="mouse"||s.pointerType==="pen")&&r.notifyTarget(s,s.button===2?"rightupoutside":"mouseupoutside"),gr.isNode(c)&&(c=c.parentNode);delete a.pressTargetsByButton[i.button]}r.freeEvent(s)},this.onWheel=function(i){var a=r.createWheelEvent(i);r.dispatchEvent(a),r.freeEvent(a)},this.onClick=function(i){if(r.context.config.useNativeClickEvent){var a=r.createPointerEvent(i);r.dispatchEvent(a),r.freeEvent(a)}},this.onPointerCancel=function(i){var a=r.createPointerEvent(i,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);r.dispatchEvent(a),r.freeEvent(a)}}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.getScale=function(){var e=this.context.contextService.getBoundingClientRect(),n=1,r=1,i=this.context.contextService.getDomElement();if(i&&e){var a=i.offsetWidth,o=i.offsetHeight;a&&o&&(n=e.width/a,r=e.height/o)}return{scaleX:n,scaleY:r,bbox:e}},t.prototype.client2Viewport=function(e){var n=this.getScale(),r=n.scaleX,i=n.scaleY,a=n.bbox;return new Sr((e.x-((a==null?void 0:a.left)||0))/r,(e.y-((a==null?void 0:a.top)||0))/i)},t.prototype.viewport2Client=function(e){var n=this.getScale(),r=n.scaleX,i=n.scaleY,a=n.bbox;return new Sr((e.x+((a==null?void 0:a.left)||0))*r,(e.y+((a==null?void 0:a.top)||0))*i)},t.prototype.viewport2Canvas=function(e){var n=e.x,r=e.y,i=this.rootTarget.defaultView,a=i.getCamera(),o=this.context.config,s=o.width,c=o.height,l=a.getPerspectiveInverse(),u=a.getWorldTransform(),f=Rr(this.tmpMatrix,u,l),d=Ki(this.tmpVec3,n/s*2-1,(1-r/c)*2-1,0);return fr(d,d,f),new Sr(d[0],d[1])},t.prototype.canvas2Viewport=function(e){var n=this.rootTarget.defaultView,r=n.getCamera(),i=r.getPerspective(),a=r.getViewTransform(),o=Rr(this.tmpMatrix,i,a),s=Ki(this.tmpVec3,e.x,e.y,0);fr(this.tmpVec3,this.tmpVec3,o);var c=this.context.config,l=c.width,u=c.height;return new Sr((s[0]+1)/2*l,(1-(s[1]+1)/2)*u)},t.prototype.setPickHandler=function(e){this.pickHandler=e},t.prototype.addEventMapping=function(e,n){this.mappingTable[e]||(this.mappingTable[e]=[]),this.mappingTable[e].push({fn:n,priority:0}),this.mappingTable[e].sort(function(r,i){return r.priority-i.priority})},t.prototype.mapEvent=function(e){if(this.rootTarget){var n=this.mappingTable[e.type];if(n)for(var r=0,i=n.length;r=1;i--)if(e.currentTarget=r[i],this.notifyTarget(e,n),e.propagationStopped||e.propagationImmediatelyStopped)return;if(e.eventPhase=e.AT_TARGET,e.currentTarget=e.target,this.notifyTarget(e,n),!(e.propagationStopped||e.propagationImmediatelyStopped)){var a=r.indexOf(e.currentTarget);e.eventPhase=e.BUBBLING_PHASE;for(var i=a+1;ia||r>o?null:!s&&this.pickHandler(e)||this.rootTarget||null},t.prototype.isNativeEventFromCanvas=function(e,n){var r=n==null?void 0:n.target;if(r!=null&&r.shadowRoot&&(r=n.composedPath()[0]),r){if(r===e)return!0;if(e&&e.contains)return e.contains(r)}return n!=null&&n.composedPath?n.composedPath().indexOf(e)>-1:!1},t.prototype.getExistedHTML=function(e){var n,r;if(e.nativeEvent.composedPath)try{for(var i=jr(e.nativeEvent.composedPath()),a=i.next();!a.done;a=i.next()){var o=a.value,s=this.nativeHTMLMap.get(o);if(s)return s}}catch(c){n={error:c}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return null},t.prototype.pickTarget=function(e){return this.hitTest({clientX:e.clientX,clientY:e.clientY,viewportX:e.viewportX,viewportY:e.viewportY,x:e.canvasX,y:e.canvasY})},t.prototype.createPointerEvent=function(e,n,r,i){var a=this.allocateEvent(Iv);this.copyPointerData(e,a),this.copyMouseData(e,a),this.copyData(e,a),a.nativeEvent=e.nativeEvent,a.originalEvent=e;var o=this.getExistedHTML(a),s=this.context.contextService.getDomElement();return a.target=r!=null?r:o||this.isNativeEventFromCanvas(s,a.nativeEvent)&&this.pickTarget(a)||i,typeof n=="string"&&(a.type=n),a},t.prototype.createWheelEvent=function(e){var n=this.allocateEvent(Dv);this.copyWheelData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.nativeEvent=e.nativeEvent,n.originalEvent=e;var r=this.getExistedHTML(n),i=this.context.contextService.getDomElement();return n.target=r||this.isNativeEventFromCanvas(i,n.nativeEvent)&&this.pickTarget(n),n},t.prototype.trackingData=function(e){return this.mappingState.trackingData[e]||(this.mappingState.trackingData[e]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[e]},t.prototype.cloneWheelEvent=function(e){var n=this.allocateEvent(Dv);return n.nativeEvent=e.nativeEvent,n.originalEvent=e.originalEvent,this.copyWheelData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.target=e.target,n.path=e.composedPath().slice(),n.type=e.type,n},t.prototype.clonePointerEvent=function(e,n){var r=this.allocateEvent(Iv);return r.nativeEvent=e.nativeEvent,r.originalEvent=e.originalEvent,this.copyPointerData(e,r),this.copyMouseData(e,r),this.copyData(e,r),r.target=e.target,r.path=e.composedPath().slice(),r.type=n!=null?n:r.type,r},t.prototype.copyPointerData=function(e,n){n.pointerId=e.pointerId,n.width=e.width,n.height=e.height,n.isPrimary=e.isPrimary,n.pointerType=e.pointerType,n.pressure=e.pressure,n.tangentialPressure=e.tangentialPressure,n.tiltX=e.tiltX,n.tiltY=e.tiltY,n.twist=e.twist},t.prototype.copyMouseData=function(e,n){n.altKey=e.altKey,n.button=e.button,n.buttons=e.buttons,n.ctrlKey=e.ctrlKey,n.metaKey=e.metaKey,n.shiftKey=e.shiftKey,n.client.copyFrom(e.client),n.movement.copyFrom(e.movement),n.canvas.copyFrom(e.canvas),n.screen.copyFrom(e.screen),n.global.copyFrom(e.global),n.offset.copyFrom(e.offset)},t.prototype.copyWheelData=function(e,n){n.deltaMode=e.deltaMode,n.deltaX=e.deltaX,n.deltaY=e.deltaY,n.deltaZ=e.deltaZ},t.prototype.copyData=function(e,n){n.isTrusted=e.isTrusted,n.timeStamp=Lv.now(),n.type=e.type,n.detail=e.detail,n.view=e.view,n.page.copyFrom(e.page),n.viewport.copyFrom(e.viewport)},t.prototype.allocateEvent=function(e){this.eventPool.has(e)||this.eventPool.set(e,[]);var n=this.eventPool.get(e).pop()||new e(this);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.target=null,n},t.prototype.freeEvent=function(e){if(e.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var n=e.constructor;this.eventPool.has(n)||this.eventPool.set(n,[]),this.eventPool.get(n).push(e)},t.prototype.notifyTarget=function(e,n){n=n!=null?n:e.type;var r=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?"".concat(n,"capture"):n;this.notifyListeners(e,r),e.eventPhase===e.AT_TARGET&&this.notifyListeners(e,n)},t.prototype.notifyListeners=function(e,n){var r=e.currentTarget.emitter,i=r._events[n];if(i)if("fn"in i)i.once&&r.removeListener(n,i.fn,void 0,!0),i.fn.call(e.currentTarget||i.context,e);else for(var a=0;a=0;r--){var i=e[r];if(i===this.rootTarget||gr.isNode(i)&&i.parentNode===n)n=e[r];else break}return n},t.prototype.getCursor=function(e){for(var n=e;n;){var r=W9(n)&&n.getAttribute("cursor");if(r)return r;n=gr.isNode(n)&&n.parentNode}},t}(),SB=function(){function t(){}return t.prototype.getOrCreateCanvas=function(e,n){if(this.canvas)return this.canvas;if(e||et.offscreenCanvas)this.canvas=e||et.offscreenCanvas,this.context=this.canvas.getContext("2d",Q({willReadFrequently:!0},n));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",Q({willReadFrequently:!0},n)),(!this.context||!this.context.measureText)&&(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(r){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",Q({willReadFrequently:!0},n))}return this.canvas.width=10,this.canvas.height=10,this.canvas},t.prototype.getOrCreateContext=function(e,n){return this.context?this.context:(this.getOrCreateCanvas(e,n),this.context)},t}(),po;(function(t){t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE"})(po||(po={}));var MB=function(){function t(e,n){this.globalRuntime=e,this.context=n,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new qr,initAsync:new iB,dirtycheck:new jv,cull:new jv,beginFrame:new qr,beforeRender:new qr,render:new qr,afterRender:new qr,endFrame:new qr,destroy:new qr,pick:new aB,pickSync:new jv,pointerDown:new qr,pointerUp:new qr,pointerMove:new qr,pointerOut:new qr,pointerOver:new qr,pointerWheel:new qr,pointerCancel:new qr,click:new qr}}return t.prototype.init=function(e){var n=this,r=Q(Q({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach(function(i){i.apply(r,n.globalRuntime)}),this.hooks.init.call(),this.hooks.initAsync.getCallbacksNum()===0?(this.inited=!0,e()):this.hooks.initAsync.promise().then(function(){n.inited=!0,e()})},t.prototype.getStats=function(){return this.stats},t.prototype.disableDirtyRectangleRendering=function(){var e=this.context.config.renderer,n=e.getConfig().enableDirtyRectangleRendering;return!n||this.context.renderingContext.renderReasons.has(po.CAMERA_CHANGED)},t.prototype.render=function(e,n,r){var i=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var a=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(a.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),a.renderReasons.size&&this.inited){a.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var o=a.renderReasons.size===1&&a.renderReasons.has(po.CAMERA_CHANGED),s=!e.disableRenderHooks||!(e.disableRenderHooks&&o);s&&this.renderDisplayObject(a.root,e,a),this.hooks.beginFrame.call(n),s&&a.renderListCurrentFrame.forEach(function(c){i.hooks.beforeRender.call(c),i.hooks.render.call(c),i.hooks.afterRender.call(c)}),this.hooks.endFrame.call(n),a.renderListCurrentFrame=[],a.renderReasons.clear(),r()}},t.prototype.renderDisplayObject=function(e,n,r){var i=this,a=n.renderer.getConfig(),o=a.enableDirtyCheck,s=a.enableCulling;this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(e);var c=e.renderable,l=o?c.dirty||r.dirtyRectangleRenderingDisabled?e:null:e;if(l){var u=s?this.hooks.cull.call(l,this.context.camera):l;u&&(this.stats.rendered++,r.renderListCurrentFrame.push(u))}e.renderable.dirty=!1,e.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var f=e.sortable;f.dirty&&(this.sort(e,f),f.dirty=!1,f.dirtyChildren=[],f.dirtyReason=void 0),(f.sorted||e.childNodes).forEach(function(d){i.renderDisplayObject(d,n,r)})},t.prototype.sort=function(e,n){n.sorted&&n.dirtyReason!==bc.Z_INDEX_CHANGED?n.dirtyChildren.forEach(function(r){var i=e.childNodes.indexOf(r);if(i===-1){var a=n.sorted.indexOf(r);a>=0&&n.sorted.splice(a,1)}else if(n.sorted.length===0)n.sorted.push(r);else{var o=Y9(n.sorted,r);n.sorted.splice(o,0,r)}}):n.sorted=e.childNodes.slice().sort(d2)},t.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},t.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(po.DISPLAY_OBJECT_CHANGED)},t}(),EB=/\[\s*(.*)=(.*)\s*\]/,AB=function(){function t(){}return t.prototype.selectOne=function(e,n){var r=this;if(e.startsWith("."))return n.find(function(s){return((s==null?void 0:s.classList)||[]).indexOf(r.getIdOrClassname(e))>-1});if(e.startsWith("#"))return n.find(function(s){return s.id===r.getIdOrClassname(e)});if(e.startsWith("[")){var i=this.getAttribute(e),a=i.name,o=i.value;return a?n.find(function(s){return n!==s&&(a==="name"?s.name===o:r.attributeToString(s,a)===o)}):null}else return n.find(function(s){return n!==s&&s.nodeName===e})},t.prototype.selectAll=function(e,n){var r=this;if(e.startsWith("."))return n.findAll(function(s){return n!==s&&((s==null?void 0:s.classList)||[]).indexOf(r.getIdOrClassname(e))>-1});if(e.startsWith("#"))return n.findAll(function(s){return n!==s&&s.id===r.getIdOrClassname(e)});if(e.startsWith("[")){var i=this.getAttribute(e),a=i.name,o=i.value;return a?n.findAll(function(s){return n!==s&&(a==="name"?s.name===o:r.attributeToString(s,a)===o)}):[]}else return n.findAll(function(s){return n!==s&&s.nodeName===e})},t.prototype.is=function(e,n){if(e.startsWith("."))return n.className===this.getIdOrClassname(e);if(e.startsWith("#"))return n.id===this.getIdOrClassname(e);if(e.startsWith("[")){var r=this.getAttribute(e),i=r.name,a=r.value;return i==="name"?n.name===a:this.attributeToString(n,i)===a}else return n.nodeName===e},t.prototype.getIdOrClassname=function(e){return e.substring(1)},t.prototype.getAttribute=function(e){var n=e.match(EB),r="",i="";return n&&n.length>2&&(r=n[1].replace(/"/g,""),i=n[2].replace(/"/g,"")),{name:r,value:i}},t.prototype.attributeToString=function(e,n){if(!e.getAttribute)return"";var r=e.getAttribute(n);return ie(r)?"":r.toString?r.toString():""},t}(),vo=function(t){It(e,t);function e(n,r,i,a,o,s,c,l){var u=t.call(this,null)||this;return u.relatedNode=r,u.prevValue=i,u.newValue=a,u.attrName=o,u.attrChange=s,u.prevParsedValue=c,u.newParsedValue=l,u.type=n,u}return e.ADDITION=2,e.MODIFICATION=1,e.REMOVAL=3,e}(yd),re;(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"})(re||(re={}));function S2(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}var PB=new vo(re.REPARENT,null,"","","",0,"",""),TB=function(){function t(e){var n=this;this.runtime=e,this.pendingEvents=[],this.boundsChangedEvent=new sn(re.BOUNDS_CHANGED),this.rotate=function(){var r=tr();return function(i,a,o,s,c){o===void 0&&(o=0),s===void 0&&(s=0),c===void 0&&(c=!0),typeof a=="number"&&(a=De(a,o,s));var l=i.transformable;if(i.parentNode===null||!i.parentNode.transformable)n.rotateLocal(i,a);else{var u=tr();Xf(u,a[0],a[1],a[2]);var f=n.getRotation(i),d=n.getRotation(i.parentNode);qf(r,d),K0(r,r),so(u,r,u),so(l.localRotation,u,f),Zf(l.localRotation,l.localRotation),c&&n.dirtifyLocal(i,l)}}}(),this.rotateLocal=function(){var r=tr();return function(i,a,o,s,c){o===void 0&&(o=0),s===void 0&&(s=0),c===void 0&&(c=!0),typeof a=="number"&&(a=De(a,o,s));var l=i.transformable;Xf(r,a[0],a[1],a[2]),V_(l.localRotation,l.localRotation,r),c&&n.dirtifyLocal(i,l)}}(),this.setEulerAngles=function(){var r=tr();return function(i,a,o,s,c){o===void 0&&(o=0),s===void 0&&(s=0),c===void 0&&(c=!0),typeof a=="number"&&(a=De(a,o,s));var l=i.transformable;if(i.parentNode===null||!i.parentNode.transformable)n.setLocalEulerAngles(i,a);else{Xf(l.localRotation,a[0],a[1],a[2]);var u=n.getRotation(i.parentNode);qf(r,K0(tr(),u)),V_(l.localRotation,l.localRotation,r),c&&n.dirtifyLocal(i,l)}}}(),this.translateLocal=function(){return function(r,i,a,o,s){a===void 0&&(a=0),o===void 0&&(o=0),s===void 0&&(s=!0),typeof i=="number"&&(i=De(i,a,o));var c=r.transformable;Ll(i,Se())||(KD(i,i,c.localRotation),oc(c.localPosition,c.localPosition,i),s&&n.dirtifyLocal(r,c))}}(),this.setPosition=function(){var r=cn(),i=Se();return function(a,o,s){s===void 0&&(s=!0);var c=a.transformable;if(i[0]=o[0],i[1]=o[1],i[2]=o[2]||0,!Ll(n.getPosition(a),i)){if(ai(c.position,i),a.parentNode===null||!a.parentNode.transformable)ai(c.localPosition,i);else{var l=a.parentNode.transformable;is(r,l.worldTransform),fa(r,r),fr(c.localPosition,i,r)}s&&n.dirtifyLocal(a,c)}}}(),this.setLocalPosition=function(){var r=Se();return function(i,a,o){o===void 0&&(o=!0);var s=i.transformable;r[0]=a[0],r[1]=a[1],r[2]=a[2]||0,!Ll(s.localPosition,r)&&(ai(s.localPosition,r),o&&n.dirtifyLocal(i,s))}}(),this.translate=function(){var r=Se(),i=Se(),a=Se();return function(o,s,c,l,u){c===void 0&&(c=0),l===void 0&&(l=0),u===void 0&&(u=!0),typeof s=="number"&&(s=Ki(i,s,c,l)),!Ll(s,r)&&(oc(a,n.getPosition(o),s),n.setPosition(o,a,u))}}(),this.setRotation=function(){var r=tr();return function(i,a,o,s,c,l){l===void 0&&(l=!0);var u=i.transformable;if(typeof a=="number"&&(a=Q0(a,o,s,c)),i.parentNode===null||!i.parentNode.transformable)n.setLocalRotation(i,a);else{var f=n.getRotation(i.parentNode);qf(r,f),K0(r,r),so(u.localRotation,r,a),Zf(u.localRotation,u.localRotation),l&&n.dirtifyLocal(i,u)}}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var r=cn(),i=Se(),a=Q0(0,0,0,1);return function(o){var s=o.localSkew[0]!==0||o.localSkew[1]!==0;if(s){if(Nl(o.localTransform,o.localRotation,o.localPosition,De(1,1,1),o.origin),o.localSkew[0]!==0||o.localSkew[1]!==0){var c=as(r);c[4]=Math.tan(o.localSkew[0]),c[1]=Math.tan(o.localSkew[1]),Rr(o.localTransform,o.localTransform,c)}var l=Nl(r,a,i,o.localScale,o.origin);Rr(o.localTransform,o.localTransform,l)}else Nl(o.localTransform,o.localRotation,o.localPosition,o.localScale,o.origin)}}()}return t.prototype.matches=function(e,n){return this.runtime.sceneGraphSelector.is(e,n)},t.prototype.querySelector=function(e,n){return this.runtime.sceneGraphSelector.selectOne(e,n)},t.prototype.querySelectorAll=function(e,n){return this.runtime.sceneGraphSelector.selectAll(e,n)},t.prototype.attach=function(e,n,r){var i,a=!1;e.parentNode&&(a=e.parentNode!==n,this.detach(e)),e.parentNode=n,ie(r)?e.parentNode.childNodes.push(e):e.parentNode.childNodes.splice(r,0,e);var o=n.sortable;(!((i=o==null?void 0:o.sorted)===null||i===void 0)&&i.length||e.parsedStyle.zIndex)&&(o.dirtyChildren.indexOf(e)===-1&&o.dirtyChildren.push(e),o.dirty=!0,o.dirtyReason=bc.ADDED);var s=e.transformable;s&&this.dirtifyWorld(e,s),s.frozen&&this.unfreezeParentToRoot(e),a&&e.dispatchEvent(PB)},t.prototype.detach=function(e){var n,r;if(e.parentNode){var i=e.transformable,a=e.parentNode.sortable;(!((n=a==null?void 0:a.sorted)===null||n===void 0)&&n.length||!((r=e.style)===null||r===void 0)&&r.zIndex)&&(a.dirtyChildren.indexOf(e)===-1&&a.dirtyChildren.push(e),a.dirty=!0,a.dirtyReason=bc.REMOVED);var o=e.parentNode.childNodes.indexOf(e);o>-1&&e.parentNode.childNodes.splice(o,1),i&&this.dirtifyWorld(e,i),e.parentNode=null}},t.prototype.getOrigin=function(e){return e.getGeometryBounds(),e.transformable.origin},t.prototype.setOrigin=function(e,n,r,i){r===void 0&&(r=0),i===void 0&&(i=0),typeof n=="number"&&(n=[n,r,i]);var a=e.transformable;if(!(n[0]===a.origin[0]&&n[1]===a.origin[1]&&n[2]===a.origin[2])){var o=a.origin;o[0]=n[0],o[1]=n[1],o[2]=n[2]||0,this.dirtifyLocal(e,a)}},t.prototype.setLocalEulerAngles=function(e,n,r,i,a){r===void 0&&(r=0),i===void 0&&(i=0),a===void 0&&(a=!0),typeof n=="number"&&(n=De(n,r,i));var o=e.transformable;Xf(o.localRotation,n[0],n[1],n[2]),a&&this.dirtifyLocal(e,o)},t.prototype.scaleLocal=function(e,n,r){r===void 0&&(r=!0);var i=e.transformable;XD(i.localScale,i.localScale,De(n[0],n[1],n[2]||1)),r&&this.dirtifyLocal(e,i)},t.prototype.setLocalScale=function(e,n,r){r===void 0&&(r=!0);var i=e.transformable,a=De(n[0],n[1],n[2]||i.localScale[2]);Ll(a,i.localScale)||(ai(i.localScale,a),r&&this.dirtifyLocal(e,i))},t.prototype.setLocalRotation=function(e,n,r,i,a,o){o===void 0&&(o=!0),typeof n=="number"&&(n=Q0(n,r,i,a));var s=e.transformable;qf(s.localRotation,n),o&&this.dirtifyLocal(e,s)},t.prototype.setLocalSkew=function(e,n,r){typeof n=="number"&&(n=F6(n,r));var i=e.transformable;B6(i.localSkew,n),this.dirtifyLocal(e,i)},t.prototype.dirtifyLocal=function(e,n){n.localDirtyFlag||(n.localDirtyFlag=!0,n.dirtyFlag||this.dirtifyWorld(e,n))},t.prototype.dirtifyWorld=function(e,n){n.dirtyFlag||this.unfreezeParentToRoot(e),this.dirtifyWorldInternal(e,n),this.dirtifyToRoot(e,!0)},t.prototype.triggerPendingEvents=function(){var e=this,n=new Set,r=function(i,a){i.isConnected&&!n.has(i.entity)&&(e.boundsChangedEvent.detail=a,e.boundsChangedEvent.target=i,i.isMutationObserved?i.dispatchEvent(e.boundsChangedEvent):i.ownerDocument.defaultView.dispatchEvent(e.boundsChangedEvent,!0),n.add(i.entity))};this.pendingEvents.forEach(function(i){var a=D(i,2),o=a[0],s=a[1];s.affectChildren?o.forEach(function(c){r(c,s)}):r(o,s)}),this.clearPendingEvents(),n.clear()},t.prototype.clearPendingEvents=function(){this.pendingEvents=[]},t.prototype.dirtifyToRoot=function(e,n){n===void 0&&(n=!1);var r=e;for(r.renderable&&(r.renderable.dirty=!0);r;)S2(r),r=r.parentNode;n&&e.forEach(function(i){S2(i)}),this.informDependentDisplayObjects(e),this.pendingEvents.push([e,{affectChildren:n}])},t.prototype.updateDisplayObjectDependency=function(e,n,r,i){if(n&&n!==r){var a=this.displayObjectDependencyMap.get(n);if(a&&a[e]){var o=a[e].indexOf(i);a[e].splice(o,1)}}if(r){var s=this.displayObjectDependencyMap.get(r);s||(this.displayObjectDependencyMap.set(r,{}),s=this.displayObjectDependencyMap.get(r)),s[e]||(s[e]=[]),s[e].push(i)}},t.prototype.informDependentDisplayObjects=function(e){var n=this,r=this.displayObjectDependencyMap.get(e);r&&Object.keys(r).forEach(function(i){r[i].forEach(function(a){n.dirtifyToRoot(a,!0),a.dispatchEvent(new vo(re.ATTR_MODIFIED,a,n,n,i,vo.MODIFICATION,n,n)),a.isCustomElement&&a.isConnected&&a.attributeChangedCallback&&a.attributeChangedCallback(i,n,n)})})},t.prototype.getPosition=function(e){var n=e.transformable;return Vf(n.position,this.getWorldTransform(e,n))},t.prototype.getRotation=function(e){var n=e.transformable;return Uf(n.rotation,this.getWorldTransform(e,n))},t.prototype.getScale=function(e){var n=e.transformable;return cc(n.scaling,this.getWorldTransform(e,n))},t.prototype.getWorldTransform=function(e,n){return n===void 0&&(n=e.transformable),!n.localDirtyFlag&&!n.dirtyFlag||(e.parentNode&&e.parentNode.transformable&&this.getWorldTransform(e.parentNode),this.sync(e,n)),n.worldTransform},t.prototype.getLocalPosition=function(e){return e.transformable.localPosition},t.prototype.getLocalRotation=function(e){return e.transformable.localRotation},t.prototype.getLocalScale=function(e){return e.transformable.localScale},t.prototype.getLocalSkew=function(e){return e.transformable.localSkew},t.prototype.getLocalTransform=function(e){var n=e.transformable;return n.localDirtyFlag&&(this.calcLocalTransform(n),n.localDirtyFlag=!1),n.localTransform},t.prototype.setLocalTransform=function(e,n){var r=Vf(Se(),n),i=Uf(tr(),n),a=cc(Se(),n);this.setLocalScale(e,a,!1),this.setLocalPosition(e,r,!1),this.setLocalRotation(e,i,void 0,void 0,void 0,!1),this.dirtifyLocal(e,e.transformable)},t.prototype.resetLocalTransform=function(e){this.setLocalScale(e,[1,1,1]),this.setLocalPosition(e,[0,0,0]),this.setLocalEulerAngles(e,[0,0,0]),this.setLocalSkew(e,[0,0])},t.prototype.getTransformedGeometryBounds=function(e,n,r){n===void 0&&(n=!1);var i=this.getGeometryBounds(e,n);if(Vn.isEmpty(i))return null;var a=r||new Vn;return a.setFromTransformedAABB(i,this.getWorldTransform(e)),a},t.prototype.getGeometryBounds=function(e,n){n===void 0&&(n=!1);var r=e.geometry;r.dirty&&et.styleValueRegistry.updateGeometry(e);var i=n?r.renderBounds:r.contentBounds||null;return i||new Vn},t.prototype.getBounds=function(e,n){var r=this;n===void 0&&(n=!1);var i=e.renderable;if(!i.boundsDirty&&!n&&i.bounds)return i.bounds;if(!i.renderBoundsDirty&&n&&i.renderBounds)return i.renderBounds;var a=n?i.renderBounds:i.bounds,o=this.getTransformedGeometryBounds(e,n,a),s=e.childNodes;if(s.forEach(function(u){var f=r.getBounds(u,n);f&&(o?o.add(f):(o=a||new Vn,o.update(f.center,f.halfExtents)))}),o||(o=new Vn),n){var c=h2(e);if(c){var l=c.parsedStyle.clipPath.getBounds(n);o?l&&(o=l.intersection(o)):o.update(l.center,l.halfExtents)}}return n?(i.renderBounds=o,i.renderBoundsDirty=!1):(i.bounds=o,i.boundsDirty=!1),o},t.prototype.getLocalBounds=function(e){if(e.parentNode){var n=cn();e.parentNode.transformable&&(n=fa(cn(),this.getWorldTransform(e.parentNode)));var r=this.getBounds(e);if(!Vn.isEmpty(r)){var i=new Vn;return i.setFromTransformedAABB(r,n),i}}return this.getBounds(e)},t.prototype.getBoundingClientRect=function(e){var n,r,i,a=this.getGeometryBounds(e);Vn.isEmpty(a)||(i=new Vn,i.setFromTransformedAABB(a,this.getWorldTransform(e)));var o=(r=(n=e.ownerDocument)===null||n===void 0?void 0:n.defaultView)===null||r===void 0?void 0:r.getContextService().getBoundingClientRect();if(i){var s=D(i.getMin(),2),c=s[0],l=s[1],u=D(i.getMax(),2),f=u[0],d=u[1];return new fs(c+((o==null?void 0:o.left)||0),l+((o==null?void 0:o.top)||0),f-c,d-l)}return new fs((o==null?void 0:o.left)||0,(o==null?void 0:o.top)||0,0,0)},t.prototype.dirtifyWorldInternal=function(e,n){var r=this;if(!n.dirtyFlag){n.dirtyFlag=!0,n.frozen=!1,e.childNodes.forEach(function(a){var o=a.transformable;o.dirtyFlag||r.dirtifyWorldInternal(a,o)});var i=e.renderable;i&&(i.renderBoundsDirty=!0,i.boundsDirty=!0,i.dirty=!0)}},t.prototype.syncHierarchy=function(e){var n=e.transformable;if(!n.frozen){n.frozen=!0,(n.localDirtyFlag||n.dirtyFlag)&&this.sync(e,n);for(var r=e.childNodes,i=0;ic;--h){for(var g=0;g=u){n.isOverflowing=!0;break}y=0,v[g]="";continue}if(y>0&&y+E>h){if(g+1>=u){if(n.isOverflowing=!0,_>0&&_<=h){for(var A=v[g].length,C=0,P=A,T=0;Th){P=T;break}C+=k}v[g]=(v[g]||"").slice(0,P)+p}break}if(g++,y=0,v[g]="",this.isBreakingSpace(w))continue;this.canBreakInLastChar(w)||(v=this.trimToBreakable(v),y=this.sumTextWidthByCache(v[g]||"",m)),this.shouldBreakByKinsokuShorui(w,M)&&(v=this.trimByKinsokuShorui(v),y+=b(S||""))}y+=E,v[g]=(v[g]||"")+w}return v.join(` `)},t.prototype.isBreakingSpace=function(e){return typeof e!="string"?!1:vs.BreakingSpaces.indexOf(e.charCodeAt(0))>=0},t.prototype.isNewline=function(e){return typeof e!="string"?!1:vs.Newlines.indexOf(e.charCodeAt(0))>=0},t.prototype.trimToBreakable=function(e){var n=dt([],D(e),!1),r=n[n.length-2],i=this.findBreakableIndex(r);if(i===-1||!r)return n;var a=r.slice(i,i+1),o=this.isBreakingSpace(a),s=i+1,c=i+(o?0:1);return n[n.length-1]+=r.slice(s,r.length),n[n.length-2]=r.slice(0,c),n},t.prototype.canBreakInLastChar=function(e){return!(e&&M2.test(e))},t.prototype.sumTextWidthByCache=function(e,n){return e.split("").reduce(function(r,i){if(!n[i])throw Error("cannot count the word without cache");return r+n[i]},0)},t.prototype.findBreakableIndex=function(e){for(var n=e.length-1;n>=0;n--)if(!M2.test(e[n]))return n;return-1},t.prototype.getFromCache=function(e,n,r,i){var a=r[e];if(typeof a!="number"){var o=e.length*n;a=i.measureText(e).width+o,r[e]=a}return a},t}(),et={},GB=function(){var t,e=new mB,n=new yB;return t={},t[st.CIRCLE]=new hB,t[st.ELLIPSE]=new pB,t[st.RECT]=e,t[st.IMAGE]=e,t[st.GROUP]=new _B,t[st.LINE]=new vB,t[st.TEXT]=new bB(et),t[st.POLYLINE]=n,t[st.POLYGON]=n,t[st.PATH]=new gB,t[st.HTML]=null,t[st.MESH]=null,t}(),WB=function(){var t,e=new A9,n=new kv;return t={},t[Tt.PERCENTAGE]=null,t[Tt.NUMBER]=new L9,t[Tt.ANGLE]=new M9,t[Tt.DEFINED_PATH]=new E9,t[Tt.PAINT]=e,t[Tt.COLOR]=e,t[Tt.FILTER]=new P9,t[Tt.LENGTH]=n,t[Tt.LENGTH_PERCENTAGE]=n,t[Tt.LENGTH_PERCENTAGE_12]=new T9,t[Tt.LENGTH_PERCENTAGE_14]=new k9,t[Tt.COORDINATE]=new kv,t[Tt.OFFSET_DISTANCE]=new N9,t[Tt.OPACITY_VALUE]=new j9,t[Tt.PATH]=new R9,t[Tt.LIST_OF_POINTS]=new I9,t[Tt.SHADOW_BLUR]=new D9,t[Tt.TEXT]=new F9,t[Tt.TEXT_TRANSFORM]=new B9,t[Tt.TRANSFORM]=new uB,t[Tt.TRANSFORM_ORIGIN]=new fB,t[Tt.Z_INDEX]=new dB,t[Tt.MARKER]=new C9,t}(),YB=function(){return typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof tt.g!="undefined"?tt.g:{}};et.CameraContribution=Fx,et.AnimationTimeline=null,et.EasingFunction=null,et.offscreenCanvasCreator=new SB,et.sceneGraphSelector=new AB,et.sceneGraphService=new TB(et),et.textService=new zB(et),et.geometryUpdaterFactory=GB,et.CSSPropertySyntaxFactory=WB,et.styleValueRegistry=new S9(et),et.layoutRegistry=null,et.globalThis=YB(),et.enableCSSParsing=!1,et.enableDataset=!1,et.enableStyleSyntax=!0,et.enableAttributeDashCased=!1,et.enableSizeAttenuation=!1;var E2=0;function agt(){E2=0}var A2=new vo(re.INSERTED,null,"","","",0,"",""),P2=new vo(re.REMOVED,null,"","","",0,"",""),HB=new sn(re.DESTROY),$B=function(t){It(e,t);function e(){var n=t.call(this)||this;return n.entity=E2++,n.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},n.cullable={strategy:mv.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},n.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]},n.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},n.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},n.rBushNode={aabb:void 0},n.namespaceURI="g",n.scrollLeft=0,n.scrollTop=0,n.clientTop=0,n.clientLeft=0,n.destroyed=!1,n.style={},n.computedStyle=et.enableCSSParsing?{opacity:wn,fillOpacity:wn,strokeOpacity:wn,fill:wn,stroke:wn,transform:wn,transformOrigin:wn,visibility:wn,pointerEvents:wn,lineWidth:wn,lineCap:wn,lineJoin:wn,increasedLineWidthForHitTesting:wn,fontSize:wn,fontFamily:wn,fontStyle:wn,fontWeight:wn,fontVariant:wn,textAlign:wn,textBaseline:wn,textTransform:wn,zIndex:wn,filter:wn,shadowType:wn}:null,n.parsedStyle={},n.attributes={},n}return Object.defineProperty(e.prototype,"className",{get:function(){return this.getAttribute("class")||""},set:function(n){this.setAttribute("class",n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"classList",{get:function(){return this.className.split(" ").filter(function(n){return n!==""})},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 n=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[n+1]||null}return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){if(this.parentNode){var n=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[n-1]||null}return null},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(n){throw new Error(an)},e.prototype.appendChild=function(n,r){var i;if(n.destroyed)throw new Error(mF);return et.sceneGraphService.attach(n,this,r),!((i=this.ownerDocument)===null||i===void 0)&&i.defaultView&&this.ownerDocument.defaultView.mountChildren(n),this.isMutationObserved&&(A2.relatedNode=this,n.dispatchEvent(A2)),n},e.prototype.insertBefore=function(n,r){if(!r)this.appendChild(n);else{n.parentElement&&n.parentElement.removeChild(n);var i=this.childNodes.indexOf(r);i===-1?this.appendChild(n):this.appendChild(n,i)}return n},e.prototype.replaceChild=function(n,r){var i=this.childNodes.indexOf(r);return this.removeChild(r),this.appendChild(n,i),r},e.prototype.removeChild=function(n){var r;return P2.relatedNode=this,n.dispatchEvent(P2),!((r=n.ownerDocument)===null||r===void 0)&&r.defaultView&&n.ownerDocument.defaultView.unmountChildren(n),et.sceneGraphService.detach(n),n},e.prototype.removeChildren=function(){for(var n=this.childNodes.length-1;n>=0;n--){var r=this.childNodes[n];this.removeChild(r)}},e.prototype.destroyChildren=function(){for(var n=this.childNodes.length-1;n>=0;n--){var r=this.childNodes[n];r.childNodes.length&&r.destroyChildren(),r.destroy()}},e.prototype.matches=function(n){return et.sceneGraphService.matches(n,this)},e.prototype.getElementById=function(n){return et.sceneGraphService.querySelector("#".concat(n),this)},e.prototype.getElementsByName=function(n){return et.sceneGraphService.querySelectorAll('[name="'.concat(n,'"]'),this)},e.prototype.getElementsByClassName=function(n){return et.sceneGraphService.querySelectorAll(".".concat(n),this)},e.prototype.getElementsByTagName=function(n){return et.sceneGraphService.querySelectorAll(n,this)},e.prototype.querySelector=function(n){return et.sceneGraphService.querySelector(n,this)},e.prototype.querySelectorAll=function(n){return et.sceneGraphService.querySelectorAll(n,this)},e.prototype.closest=function(n){var r=this;do{if(et.sceneGraphService.matches(n,r))return r;r=r.parentElement}while(r!==null);return null},e.prototype.find=function(n){var r=this,i=null;return this.forEach(function(a){return a!==r&&n(a)?(i=a,!0):!1}),i},e.prototype.findAll=function(n){var r=this,i=[];return this.forEach(function(a){a!==r&&n(a)&&i.push(a)}),i},e.prototype.after=function(){for(var n=this,r=[],i=0;i1){var i=n[0].currentPoint,a=n[1].currentPoint,o=n[1].startTangent;r=[],o?(r.push([i[0]-o[0],i[1]-o[1]]),r.push([i[0],i[1]])):(r.push([a[0],a[1]]),r.push([i[0],i[1]]))}return r},e.prototype.getEndTangent=function(){var n=this.parsedStyle.d.segments,r=n.length,i=[];if(r>1){var a=n[r-2].currentPoint,o=n[r-1].currentPoint,s=n[r-1].endTangent;i=[],s?(i.push([o[0]-s[0],o[1]-s[1]]),i.push([o[0],o[1]])):(i.push([a[0],a[1]]),i.push([o[0],o[1]]))}return i},e}(Dr),Zl=function(t){It(e,t);function e(n){n===void 0&&(n={});var r=this,i=n.style,a=On(n,["style"]);r=t.call(this,Q({type:st.POLYGON,style:et.enableCSSParsing?Q({points:"",miterLimit:"",isClosed:!0},i):Q({},i),initialParsedStyle:et.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},a))||this,r.markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var o=r.parsedStyle,s=o.markerStart,c=o.markerEnd,l=o.markerMid;return s&&Be(s)&&(r.markerStartAngle=s.getLocalEulerAngles(),r.appendChild(s)),l&&Be(l)&&r.placeMarkerMid(l),c&&Be(c)&&(r.markerEndAngle=c.getLocalEulerAngles(),r.appendChild(c)),r.transformMarker(!0),r.transformMarker(!1),r}return e.prototype.attributeChangedCallback=function(n,r,i,a,o){n==="points"?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):n==="markerStartOffset"||n==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):n==="markerStart"?(a&&Be(a)&&(this.markerStartAngle=0,a.remove()),o&&Be(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):n==="markerEnd"?(a&&Be(a)&&(this.markerEndAngle=0,a.remove()),o&&Be(o)&&(this.markerEndAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!1))):n==="markerMid"&&this.placeMarkerMid(o)},e.prototype.transformMarker=function(n){var r=this.parsedStyle,i=r.markerStart,a=r.markerEnd,o=r.markerStartOffset,s=r.markerEndOffset,c=r.points,l=(c||{}).points,u=n?i:a;if(!(!u||!Be(u)||!l)){var f=0,d,h,p,v,g,y;if(p=l[0][0],v=l[0][1],n)d=l[1][0]-l[0][0],h=l[1][1]-l[0][1],g=o||0,y=this.markerStartAngle;else{var m=l.length;this.parsedStyle.isClosed?(d=l[m-1][0]-l[0][0],h=l[m-1][1]-l[0][1]):(p=l[m-1][0],v=l[m-1][1],d=l[m-2][0]-l[m-1][0],h=l[m-2][1]-l[m-1][1]),g=s||0,y=this.markerEndAngle}f=Math.atan2(h,d),u.setLocalEulerAngles(f*180/Math.PI+y),u.setLocalPosition(p+Math.cos(f)*g,v+Math.sin(f)*g)}},e.prototype.placeMarkerMid=function(n){var r=this.parsedStyle.points,i=(r||{}).points;if(this.markerMidList.forEach(function(l){l.remove()}),this.markerMidList=[],n&&Be(n)&&i)for(var a=1;a<(this.parsedStyle.isClosed?i.length:i.length-1);a++){var o=i[a][0],s=i[a][1],c=a===1?n:n.cloneNode(!0);this.markerMidList.push(c),this.appendChild(c),c.setLocalPosition(o,s)}},e}(Dr),zv=function(t){It(e,t);function e(n){n===void 0&&(n={});var r=n.style,i=On(n,["style"]);return t.call(this,Q({type:st.POLYLINE,style:et.enableCSSParsing?Q({points:"",miterLimit:"",isClosed:!1},r):Q({},r),initialParsedStyle:et.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},i))||this}return e.prototype.getTotalLength=function(){return JF(this)},e.prototype.getPointAtLength=function(n,r){return r===void 0&&(r=!1),this.getPoint(n/this.getTotalLength(),r)},e.prototype.getPoint=function(n,r){r===void 0&&(r=!1);var i=this.parsedStyle.points.points;if(this.parsedStyle.points.segments.length===0){var a=[],o=0,s,c,l=this.getTotalLength();i.forEach(function(g,y){i[y+1]&&(s=[0,0],s[0]=o/l,c=xx(g[0],g[1],i[y+1][0],i[y+1][1]),o+=c,s[1]=o/l,a.push(s))}),this.parsedStyle.points.segments=a}var u=0,f=0;this.parsedStyle.points.segments.forEach(function(g,y){n>=g[0]&&n<=g[1]&&(u=(n-g[0])/(g[1]-g[0]),f=y)});var d=pa(i[f][0],i[f][1],i[f+1][0],i[f+1][1],u),h=d.x,p=d.y,v=fr(Se(),De(h,p,0),r?this.getWorldTransform():this.getLocalTransform());return new Sr(v[0],v[1])},e.prototype.getStartTangent=function(){var n=this.parsedStyle.points.points,r=[];return r.push([n[1][0],n[1][1]]),r.push([n[0][0],n[0][1]]),r},e.prototype.getEndTangent=function(){var n=this.parsedStyle.points.points,r=n.length-1,i=[];return i.push([n[r-1][0],n[r-1][1]]),i.push([n[r][0],n[r][1]]),i},e}(Zl),ys=function(t){It(e,t);function e(n){return n===void 0&&(n={}),t.call(this,Q({type:st.RECT},n))||this}return e}(Dr),fi=function(t){It(e,t);function e(n){n===void 0&&(n={});var r=n.style,i=On(n,["style"]);return t.call(this,Q({type:st.TEXT,style:et.enableCSSParsing?Q({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""},r):Q({fill:"black"},r)},i))||this}return e.prototype.getComputedTextLength=function(){var n;return this.getGeometryBounds(),((n=this.parsedStyle.metrics)===null||n===void 0?void 0:n.maxLineWidth)||0},e.prototype.getLineBoundingRects=function(){var n;return this.getGeometryBounds(),((n=this.parsedStyle.metrics)===null||n===void 0?void 0:n.lineMetrics)||[]},e.prototype.isOverflowing=function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing},e}(Dr),ZB=function(){function t(){this.registry={},this.define(st.CIRCLE,gs),this.define(st.ELLIPSE,Fv),this.define(st.RECT,ys),this.define(st.IMAGE,Bv),this.define(st.LINE,ql),this.define(st.GROUP,dr),this.define(st.PATH,Zr),this.define(st.POLYGON,Zl),this.define(st.POLYLINE,zv),this.define(st.TEXT,fi),this.define(st.HTML,bd)}return t.prototype.define=function(e,n){this.registry[e]=n},t.prototype.get=function(e){return this.registry[e]},t}(),C2={number:function(t){return new on(t)},percent:function(t){return new on(t,"%")},px:function(t){return new on(t,"px")},em:function(t){return new on(t,"em")},rem:function(t){return new on(t,"rem")},deg:function(t){return new on(t,"deg")},grad:function(t){return new on(t,"grad")},rad:function(t){return new on(t,"rad")},turn:function(t){return new on(t,"turn")},s:function(t){return new on(t,"s")},ms:function(t){return new on(t,"ms")},registerProperty:function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,a=t.syntax;et.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:a})},registerLayout:function(t,e){et.layoutRegistry.registerLayout(t,e)}},KB=function(t){It(e,t);function e(){var n=t.call(this)||this;n.defaultView=null,n.ownerDocument=null,n.nodeName="document";try{n.timeline=new et.AnimationTimeline(n)}catch(i){}var r={};return Tv.forEach(function(i){var a=i.n,o=i.inh,s=i.d;o&&s&&(r[a]=mc(s)?s(st.GROUP):s)}),n.documentElement=new dr({id:"g-root",style:r}),n.documentElement.ownerDocument=n,n.documentElement.parentNode=n,n.childNodes=[n.documentElement],n}return 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(n,r){if(n==="svg")return this.documentElement;var i=this.defaultView.customElements.get(n);i||(console.warn("Unsupported tagName: ",n),i=n==="tspan"?fi:dr);var a=new i(r);return a.ownerDocument=this,a},e.prototype.createElementNS=function(n,r,i){return this.createElement(r,i)},e.prototype.cloneNode=function(n){throw new Error(an)},e.prototype.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(n){}},e.prototype.elementsFromBBox=function(n,r,i,a){var o=this.defaultView.context.rBushRoot,s=o.search({minX:n,minY:r,maxX:i,maxY:a}),c=[];return s.forEach(function(l){var u=l.displayObject,f=u.parsedStyle.pointerEvents,d=f===void 0?"auto":f,h=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(d);(!h||h&&u.isVisible())&&!u.isCulled()&&u.isInteractive()&&c.push(u)}),c.sort(function(l,u){return u.sortable.renderOrder-l.sortable.renderOrder}),c},e.prototype.elementFromPointSync=function(n,r){var i=this.defaultView.canvas2Viewport({x:n,y:r}),a=i.x,o=i.y,s=this.defaultView.getConfig(),c=s.width,l=s.height;if(a<0||o<0||a>c||o>l)return null;var u=this.defaultView.viewport2Client({x:a,y:o}),f=u.x,d=u.y,h=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:n,y:r,viewportX:a,viewportY:o,clientX:f,clientY:d},picked:[]}).picked;return h&&h[0]||this.documentElement},e.prototype.elementFromPoint=function(n,r){return es(this,void 0,void 0,function(){var i,a,o,s,c,l,u,f,d,h;return ns(this,function(p){switch(p.label){case 0:return i=this.defaultView.canvas2Viewport({x:n,y:r}),a=i.x,o=i.y,s=this.defaultView.getConfig(),c=s.width,l=s.height,a<0||o<0||a>c||o>l?[2,null]:(u=this.defaultView.viewport2Client({x:a,y:o}),f=u.x,d=u.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:n,y:r,viewportX:a,viewportY:o,clientX:f,clientY:d},picked:[]})]);case 1:return h=p.sent().picked,[2,h&&h[0]||this.documentElement]}})})},e.prototype.elementsFromPointSync=function(n,r){var i=this.defaultView.canvas2Viewport({x:n,y:r}),a=i.x,o=i.y,s=this.defaultView.getConfig(),c=s.width,l=s.height;if(a<0||o<0||a>c||o>l)return[];var u=this.defaultView.viewport2Client({x:a,y:o}),f=u.x,d=u.y,h=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:n,y:r,viewportX:a,viewportY:o,clientX:f,clientY:d},picked:[]}).picked;return h[h.length-1]!==this.documentElement&&h.push(this.documentElement),h},e.prototype.elementsFromPoint=function(n,r){return es(this,void 0,void 0,function(){var i,a,o,s,c,l,u,f,d,h;return ns(this,function(p){switch(p.label){case 0:return i=this.defaultView.canvas2Viewport({x:n,y:r}),a=i.x,o=i.y,s=this.defaultView.getConfig(),c=s.width,l=s.height,a<0||o<0||a>c||o>l?[2,[]]:(u=this.defaultView.viewport2Client({x:a,y:o}),f=u.x,d=u.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:n,y:r,viewportX:a,viewportY:o,clientX:f,clientY:d},picked:[]})]);case 1:return h=p.sent().picked,h[h.length-1]!==this.documentElement&&h.push(this.documentElement),[2,h]}})})},e.prototype.appendChild=function(n,r){throw new Error(yc)},e.prototype.insertBefore=function(n,r){throw new Error(yc)},e.prototype.removeChild=function(n,r){throw new Error(yc)},e.prototype.replaceChild=function(n,r,i){throw new Error(yc)},e.prototype.append=function(){throw new Error(yc)},e.prototype.prepend=function(){throw new Error(yc)},e.prototype.getElementById=function(n){return this.documentElement.getElementById(n)},e.prototype.getElementsByName=function(n){return this.documentElement.getElementsByName(n)},e.prototype.getElementsByTagName=function(n){return this.documentElement.getElementsByTagName(n)},e.prototype.getElementsByClassName=function(n){return this.documentElement.getElementsByClassName(n)},e.prototype.querySelector=function(n){return this.documentElement.querySelector(n)},e.prototype.querySelectorAll=function(n){return this.documentElement.querySelectorAll(n)},e.prototype.find=function(n){return this.documentElement.find(n)},e.prototype.findAll=function(n){return this.documentElement.findAll(n)},e}(gr),QB=function(){function t(e){this.strategies=e}return t.prototype.apply=function(e){var n=e.camera,r=e.renderingService,i=e.renderingContext,a=this.strategies;r.hooks.cull.tap(t.tag,function(o){if(o){var s=o.cullable;return a.length===0?s.visible=i.unculledEntities.indexOf(o.entity)>-1:s.visible=a.every(function(c){return c.isVisible(n,o)}),!o.isCulled()&&o.isVisible()?o:(o.dispatchEvent(new sn(re.CULLED)),null)}return o}),r.hooks.afterRender.tap(t.tag,function(o){o.cullable.visibilityPlaneMask=-1})},t.tag="Culling",t}(),JB=function(){function t(){var e=this;this.autoPreventDefault=!1,this.rootPointerEvent=new Iv(null),this.rootWheelEvent=new Dv(null),this.onPointerMove=function(n){var r,i,a,o,s=(o=(a=e.context.renderingContext.root)===null||a===void 0?void 0:a.ownerDocument)===null||o===void 0?void 0:o.defaultView;if(!(s.supportsTouchEvents&&n.pointerType==="touch")){var c=e.normalizeToPointerEvent(n,s);try{for(var l=jr(c),u=l.next();!u.done;u=l.next()){var f=u.value,d=e.bootstrapEvent(e.rootPointerEvent,f,s,n);e.context.eventService.mapEvent(d)}}catch(h){r={error:h}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}e.setCursor(e.context.eventService.cursor)}},this.onClick=function(n){var r,i,a,o,s=(o=(a=e.context.renderingContext.root)===null||a===void 0?void 0:a.ownerDocument)===null||o===void 0?void 0:o.defaultView,c=e.normalizeToPointerEvent(n,s);try{for(var l=jr(c),u=l.next();!u.done;u=l.next()){var f=u.value,d=e.bootstrapEvent(e.rootPointerEvent,f,s,n);e.context.eventService.mapEvent(d)}}catch(h){r={error:h}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}e.setCursor(e.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(a){var o=n.context.renderingService.hooks.pickSync.call({position:a,picked:[],topmost:!0}).picked;return o[0]||null}),r.hooks.pointerWheel.tap(t.tag,function(a){var o=n.normalizeWheelEvent(a);n.context.eventService.mapEvent(o)}),r.hooks.pointerDown.tap(t.tag,function(a){var o,s;if(!(i.supportsTouchEvents&&a.pointerType==="touch")){var c=n.normalizeToPointerEvent(a,i);if(n.autoPreventDefault&&c[0].isNormalized){var l=a.cancelable||!("cancelable"in a);l&&a.preventDefault()}try{for(var u=jr(c),f=u.next();!f.done;f=u.next()){var d=f.value,h=n.bootstrapEvent(n.rootPointerEvent,d,i,a);n.context.eventService.mapEvent(h)}}catch(p){o={error:p}}finally{try{f&&!f.done&&(s=u.return)&&s.call(u)}finally{if(o)throw o.error}}n.setCursor(n.context.eventService.cursor)}}),r.hooks.pointerUp.tap(t.tag,function(a){var o,s;if(!(i.supportsTouchEvents&&a.pointerType==="touch")){var c=n.context.contextService.getDomElement(),l=n.context.eventService.isNativeEventFromCanvas(c,a),u=l?"":"outside",f=n.normalizeToPointerEvent(a,i);try{for(var d=jr(f),h=d.next();!h.done;h=d.next()){var p=h.value,v=n.bootstrapEvent(n.rootPointerEvent,p,i,a);v.type+=u,n.context.eventService.mapEvent(v)}}catch(g){o={error:g}}finally{try{h&&!h.done&&(s=d.return)&&s.call(d)}finally{if(o)throw o.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(a){var o,s,c=n.normalizeToPointerEvent(a,i);try{for(var l=jr(c),u=l.next();!u.done;u=l.next()){var f=u.value,d=n.bootstrapEvent(n.rootPointerEvent,f,i,a);n.context.eventService.mapEvent(d)}}catch(h){o={error:h}}finally{try{u&&!u.done&&(s=l.return)&&s.call(l)}finally{if(o)throw o.error}}n.setCursor(n.context.eventService.cursor)})},t.prototype.bootstrapEvent=function(e,n,r,i){e.view=r,e.originalEvent=null,e.nativeEvent=i,e.pointerId=n.pointerId,e.width=n.width,e.height=n.height,e.isPrimary=n.isPrimary,e.pointerType=n.pointerType,e.pressure=n.pressure,e.tangentialPressure=n.tangentialPressure,e.tiltX=n.tiltX,e.tiltY=n.tiltY,e.twist=n.twist,this.transferMouseData(e,n);var a=this.context.eventService.client2Viewport({x:n.clientX,y:n.clientY}),o=a.x,s=a.y;e.viewport.x=o,e.viewport.y=s;var c=this.context.eventService.viewport2Canvas(e.viewport),l=c.x,u=c.y;return e.canvas.x=l,e.canvas.y=u,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.isTrusted=i.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=X9[e.type]||e.type),e},t.prototype.normalizeWheelEvent=function(e){var n=this.rootWheelEvent;this.transferMouseData(n,e),n.deltaMode=e.deltaMode,n.deltaX=e.deltaX,n.deltaY=e.deltaY,n.deltaZ=e.deltaZ;var r=this.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),i=r.x,a=r.y;n.viewport.x=i,n.viewport.y=a;var o=this.context.eventService.viewport2Canvas(n.viewport),s=o.x,c=o.y;return n.canvas.x=s,n.canvas.y=c,n.global.copyFrom(n.canvas),n.offset.copyFrom(n.canvas),n.nativeEvent=e,n.type=e.type,n},t.prototype.transferMouseData=function(e,n){e.isTrusted=n.isTrusted,e.srcElement=n.srcElement,e.timeStamp=Lv.now(),e.type=n.type,e.altKey=n.altKey,e.metaKey=n.metaKey,e.shiftKey=n.shiftKey,e.ctrlKey=n.ctrlKey,e.button=n.button,e.buttons=n.buttons,e.client.x=n.clientX,e.client.y=n.clientY,e.movement.x=n.movementX,e.movement.y=n.movementY,e.page.x=n.pageX,e.page.y=n.pageY,e.screen.x=n.screenX,e.screen.y=n.screenY,e.relatedTarget=null},t.prototype.setCursor=function(e){this.context.contextService.applyCursorStyle(e||this.context.config.cursor||"default")},t.prototype.normalizeToPointerEvent=function(e,n){var r=[];if(n.isTouchEvent(e))for(var i=0;i-1,s=0,c=i.length;s=1?Math.ceil(A):1,M=s||$9(a)||a.width/A,E=c||V9(a)||a.height/A),o&&(et.offscreenCanvas=o),r.devicePixelRatio=A,r.requestAnimationFrame=p!=null?p:Nv.bind(et.globalThis),r.cancelAnimationFrame=v!=null?v:b2.bind(et.globalThis),r.supportsTouchEvents=m!=null?m:"ontouchstart"in et.globalThis,r.supportsPointerEvents=y!=null?y:!!et.globalThis.PointerEvent,r.isTouchEvent=w!=null?w:function(C){return r.supportsTouchEvents&&C instanceof et.globalThis.TouchEvent},r.isMouseEvent=S!=null?S:function(C){return!et.globalThis.MouseEvent||C instanceof et.globalThis.MouseEvent&&(!r.supportsPointerEvents||!(C instanceof et.globalThis.PointerEvent))},r.initRenderingContext({container:i,canvas:a,width:M,height:E,renderer:u,offscreenCanvas:o,devicePixelRatio:A,cursor:d||"default",background:f||"transparent",createImage:g,document:h,supportsCSSTransform:b,useNativeClickEvent:x,alwaysTriggerPointerEventOnCanvas:O}),r.initDefaultCamera(M,E,u.clipSpaceNearZ),r.initRenderer(u,!0),r}return e.prototype.initRenderingContext=function(n){this.context.config=n,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},e.prototype.initDefaultCamera=function(n,r,i){var a=this,o=new et.CameraContribution;o.clipSpaceNearZ=i,o.setType(qe.EXPLORING,Wl.DEFAULT).setPosition(n/2,r/2,L2).setFocalPoint(n/2,r/2,0).setOrthographic(n/-2,n/2,r/2,r/-2,r7,i7),o.canvas=this,o.eventEmitter.on(Ix.UPDATED,function(){a.context.renderingContext.renderReasons.add(po.CAMERA_CHANGED),et.enableSizeAttenuation&&a.getConfig().renderer.getConfig().enableSizeAttenuation&&a.updateSizeAttenuation()}),this.context.camera=o},e.prototype.updateSizeAttenuation=function(){var n=this.getCamera().getZoom();this.document.documentElement.forEach(function(r){et.styleValueRegistry.updateSizeAttenuation(r,n)})},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 n=this;return this.readyPromise||(this.readyPromise=new Promise(function(r){n.resolveReadyPromise=function(){r(n)}}),this.inited&&this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),e.prototype.destroy=function(n,r){if(n===void 0&&(n=!0),r===void 0&&(r=!1),r||this.dispatchEvent(new sn(di.BEFORE_DESTROY)),this.frameId){var i=this.getConfig().cancelAnimationFrame||cancelAnimationFrame;i(this.frameId)}var a=this.getRoot();this.unmountChildren(a),n&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),n&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),r||this.dispatchEvent(new sn(di.AFTER_DESTROY))},e.prototype.changeSize=function(n,r){this.resize(n,r)},e.prototype.resize=function(n,r){var i=this.context.config;i.width=n,i.height=r,this.getContextService().resize(n,r);var a=this.context.camera,o=a.getProjectionMode();a.setPosition(n/2,r/2,L2).setFocalPoint(n/2,r/2,0),o===si.ORTHOGRAPHIC?a.setOrthographic(n/-2,n/2,r/2,r/-2,a.getNear(),a.getFar()):a.setAspect(n/r),this.dispatchEvent(new sn(di.RESIZE,{width:n,height:r}))},e.prototype.appendChild=function(n,r){return this.document.documentElement.appendChild(n,r)},e.prototype.insertBefore=function(n,r){return this.document.documentElement.insertBefore(n,r)},e.prototype.removeChild=function(n){return this.document.documentElement.removeChild(n)},e.prototype.removeChildren=function(){this.document.documentElement.removeChildren()},e.prototype.destroyChildren=function(){this.document.documentElement.destroyChildren()},e.prototype.render=function(n){var r=this;this.dispatchEvent(a7);var i=this.getRenderingService();i.render(this.getConfig(),n,function(){r.dispatchEvent(o7)}),this.dispatchEvent(s7)},e.prototype.run=function(){var n=this,r=function(i,a){n.render(a),n.frameId=n.requestAnimationFrame(r)};r()},e.prototype.initRenderer=function(n,r){var i=this;if(r===void 0&&(r=!1),!n)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new iF,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new JB,new n7,new QB([new e7])),this.loadRendererContainerModule(n),this.context.contextService=new this.context.ContextService(Q(Q({},et),this.context)),this.context.renderingService=new MB(et,this.context),this.context.eventService=new wB(et,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(n,r,!0)):this.context.contextService.initAsync().then(function(){i.initRenderingService(n,r)})},e.prototype.initRenderingService=function(n,r,i){var a=this;r===void 0&&(r=!1),i===void 0&&(i=!1),this.context.renderingService.init(function(){a.inited=!0,r?(i?a.requestAnimationFrame(function(){a.dispatchEvent(new sn(di.READY))}):a.dispatchEvent(new sn(di.READY)),a.readyPromise&&a.resolveReadyPromise()):a.dispatchEvent(new sn(di.RENDERER_CHANGED)),r||a.getRoot().forEach(function(o){var s=o.renderable;s&&(s.renderBoundsDirty=!0,s.boundsDirty=!0,s.dirty=!0)}),a.mountChildren(a.getRoot()),n.getConfig().enableAutoRendering&&a.run()})},e.prototype.loadRendererContainerModule=function(n){var r=this,i=n.getPlugins();i.forEach(function(a){a.context=r.context,a.init(et)})},e.prototype.setRenderer=function(n){var r=this.getConfig();if(r.renderer!==n){var i=r.renderer;r.renderer=n,this.destroy(!1,!0),dt([],D(i==null?void 0:i.getPlugins()),!1).reverse().forEach(function(a){a.destroy(et)}),this.initRenderer(n)}},e.prototype.setCursor=function(n){var r=this.getConfig();r.cursor=n,this.getContextService().applyCursorStyle(n)},e.prototype.unmountChildren=function(n){var r=this;n.childNodes.forEach(function(i){r.unmountChildren(i)}),this.inited&&(n.isMutationObserved?n.dispatchEvent(Wv):(Wv.target=n,this.dispatchEvent(Wv,!0)),n!==this.document.documentElement&&(n.ownerDocument=null),n.isConnected=!1),n.isCustomElement&&n.disconnectedCallback&&n.disconnectedCallback()},e.prototype.mountChildren=function(n){var r=this;this.inited?n.isConnected||(n.ownerDocument=this.document,n.isConnected=!0,n.isMutationObserved?n.dispatchEvent(Gv):(Gv.target=n,this.dispatchEvent(Gv,!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: ",n.nodeName),n.childNodes.forEach(function(i){r.mountChildren(i)}),n.isCustomElement&&n.connectedCallback&&n.connectedCallback()},e.prototype.client2Viewport=function(n){return this.getEventService().client2Viewport(n)},e.prototype.viewport2Client=function(n){return this.getEventService().viewport2Client(n)},e.prototype.viewport2Canvas=function(n){return this.getEventService().viewport2Canvas(n)},e.prototype.canvas2Viewport=function(n){return this.getEventService().canvas2Viewport(n)},e.prototype.getPointByClient=function(n,r){return this.client2Viewport({x:n,y:r})},e.prototype.getClientByPoint=function(n,r){return this.viewport2Client({x:n,y:r})},e}(w2),c7=function(t){It(e,t);function e(){var n=t.apply(this,dt([],D(arguments),!1))||this;return n.landmarks=[],n}return e.prototype.rotate=function(n,r,i){if(this.relElevation=gc(r),this.relAzimuth=gc(n),this.relRoll=gc(i),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===qe.EXPLORING){var a=oo(tr(),[1,0,0],rn((this.rotateWorld?1:-1)*this.relElevation)),o=oo(tr(),[0,1,0],rn((this.rotateWorld?1:-1)*this.relAzimuth)),s=oo(tr(),[0,0,1],rn(this.relRoll)),c=so(tr(),o,a);c=so(tr(),c,s);var l=q0(cn(),c);sc(this.matrix,this.matrix,[0,0,-this.distance]),Rr(this.matrix,this.matrix,l),sc(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===qe.ORBITING||this.type===qe.EXPLORING?this._getPosition():this.type===qe.TRACKING&&this._getFocalPoint(),this._update(),this},e.prototype.pan=function(n,r){var i=Xr(n,r,0),a=ja(this.position);return oc(a,a,$0(Se(),this.right,i[0])),oc(a,a,$0(Se(),this.up,i[1])),this._setPosition(a),this.triggerUpdate(),this},e.prototype.dolly=function(n){var r=this.forward,i=ja(this.position),a=n*this.dollyingStep,o=this.distance+n*this.dollyingStep;return a=Math.max(Math.min(o,this.maxDistance),this.minDistance)-this.distance,i[0]+=a*r[0],i[1]+=a*r[1],i[2]+=a*r[2],this._setPosition(i),this.type===qe.ORBITING||this.type===qe.EXPLORING?this._getDistance():this.type===qe.TRACKING&&oc(this.focalPoint,i,this.distanceVector),this.triggerUpdate(),this},e.prototype.cancelLandmarkAnimation=function(){this.landmarkAnimationID!==void 0&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)},e.prototype.createLandmark=function(n,r){var i,a,o,s;r===void 0&&(r={});var c=r.position,l=c===void 0?this.position:c,u=r.focalPoint,f=u===void 0?this.focalPoint:u,d=r.roll,h=r.zoom,p=new et.CameraContribution;p.setType(this.type,void 0),p.setPosition(l[0],(i=l[1])!==null&&i!==void 0?i:this.position[1],(a=l[2])!==null&&a!==void 0?a:this.position[2]),p.setFocalPoint(f[0],(o=f[1])!==null&&o!==void 0?o:this.focalPoint[1],(s=f[2])!==null&&s!==void 0?s:this.focalPoint[2]),p.setRoll(d!=null?d:this.roll),p.setZoom(h!=null?h:this.zoom);var v={name:n,matrix:T_(p.getWorldTransform()),right:ja(p.right),up:ja(p.up),forward:ja(p.forward),position:ja(p.getPosition()),focalPoint:ja(p.getFocalPoint()),distanceVector:ja(p.getDistanceVector()),distance:p.getDistance(),dollyingStep:p.getDollyingStep(),azimuth:p.getAzimuth(),elevation:p.getElevation(),roll:p.getRoll(),relAzimuth:p.relAzimuth,relElevation:p.relElevation,relRoll:p.relRoll,zoom:p.getZoom()};return this.landmarks.push(v),v},e.prototype.gotoLandmark=function(n,r){var i=this;r===void 0&&(r={});var a=kn(n)?this.landmarks.find(function(E){return E.name===n}):n;if(a){var o=$n(r)?{duration:r}:r,s=o.easing,c=s===void 0?"linear":s,l=o.duration,u=l===void 0?100:l,f=o.easingFunction,d=f===void 0?void 0:f,h=o.onfinish,p=h===void 0?void 0:h,v=o.onframe,g=v===void 0?void 0:v,y=.01;if(u===0){this.syncFromLandmark(a),p&&p();return}this.cancelLandmarkAnimation();var m=a.position,b=a.focalPoint,_=a.zoom,x=a.roll,O=d||et.EasingFunction(c),w,S=function(){i.setFocalPoint(b),i.setPosition(m),i.setRoll(x),i.setZoom(_),i.computeMatrix(),i.triggerUpdate(),p&&p()},M=function(E){w===void 0&&(w=E);var A=E-w;if(A>u){S();return}var C=O(A/u),P=Se(),T=Se(),k=1,N=0;V0(P,i.focalPoint,b,C),V0(T,i.position,m,C),N=i.roll*(1-C)+x*C,k=i.zoom*(1-C)+_*C,i.setFocalPoint(P),i.setPosition(T),i.setRoll(N),i.setZoom(k);var F=A_(P,b)+A_(T,m);if(F<=y&&_==null&&x==null){S();return}i.computeMatrix(),i.triggerUpdate(),A0){var i=n[r-1],a=p7(i,e);if(a){n[r-1]=a;return}}else g7(this.observer);n[r]=e},t.prototype.addListeners=function(){this.addListeners_(this.target)},t.prototype.addListeners_=function(e){var n=this.options;n.attributes&&e.addEventListener(re.ATTR_MODIFIED,this,!0),n.childList&&e.addEventListener(re.INSERTED,this,!0),(n.childList||n.subtree)&&e.addEventListener(re.REMOVED,this,!0)},t.prototype.removeListeners=function(){this.removeListeners_(this.target)},t.prototype.removeListeners_=function(e){var n=this.options;n.attributes&&e.removeEventListener(re.ATTR_MODIFIED,this,!0),n.childList&&e.removeEventListener(re.INSERTED,this,!0),(n.childList||n.subtree)&&e.removeEventListener(re.REMOVED,this,!0)},t.prototype.removeTransientObservers=function(){var e=this.transientObservedNodes;this.transientObservedNodes=[],e.forEach(function(n){this.removeListeners_(n);for(var r=wc.get(n),i=0;i0&&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||this.playState==="running"||!this._finishedFlag},enumerable:!1,configurable:!0}),t.prototype.updatePromises=function(){var e=this.oldPlayState,n=this.pending?"pending":this.playState;return this.readyPromise&&n!==e&&(n==="idle"?(this.rejectReadyPromise(),this.readyPromise=void 0):e==="pending"?this.resolveReadyPromise():n==="pending"&&(this.readyPromise=void 0)),this.finishedPromise&&n!==e&&(n==="idle"?(this.rejectFinishedPromise(),this.finishedPromise=void 0):n==="finished"?this.resolveFinishedPromise():e==="finished"&&(this.finishedPromise=void 0)),this.oldPlayState=n,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),this.timeline.animations.indexOf(this)===-1&&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.currentTimePending=!0:this._idle&&(this.rewind(),this._idle=!1),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 e=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 n=new Vv(null,this,this.currentTime,null);setTimeout(function(){e.oncancel(n)})}},t.prototype.reverse=function(){this.updatePromises();var e=this.currentTime;this.playbackRate*=-1,this.play(),e!==null&&(this.currentTime=e),this.updatePromises()},t.prototype.updatePlaybackRate=function(e){this.playbackRate=e},t.prototype.targetAnimations=function(){var e,n=(e=this.effect)===null||e===void 0?void 0:e.target;return n.getAnimations()},t.prototype.markTarget=function(){var e=this.targetAnimations();e.indexOf(this)===-1&&e.push(this)},t.prototype.unmarkTarget=function(){var e=this.targetAnimations(),n=e.indexOf(this);n!==-1&&e.splice(n,1)},t.prototype.tick=function(e,n){!this._idle&&!this._paused&&(this._startTime===null?n&&(this.startTime=e-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((e-this._startTime)*this.playbackRate)),n&&(this.currentTimePending=!1,this.fireEvents(e))},t.prototype.rewind=function(){if(this.playbackRate>=0)this.currentTime=0;else if(this._totalDuration<1/0)this.currentTime=this._totalDuration;else throw new Error("Unable to rewind negative playback rate animation with infinite duration")},t.prototype.persist=function(){throw new Error(an)},t.prototype.addEventListener=function(e,n,r){throw new Error(an)},t.prototype.removeEventListener=function(e,n,r){throw new Error(an)},t.prototype.dispatchEvent=function(e){throw new Error(an)},t.prototype.commitStyles=function(){throw new Error(an)},t.prototype.ensureAlive=function(){var e,n;this.playbackRate<0&&this.currentTime===0?this._inEffect=!!(!((e=this.effect)===null||e===void 0)&&e.update(-1)):this._inEffect=!!(!((n=this.effect)===null||n===void 0)&&n.update(this.currentTime)),!this._inTimeline&&(this._inEffect||!this._finishedFlag)&&(this._inTimeline=!0,this.timeline.animations.push(this))},t.prototype.tickCurrentTime=function(e,n){e!==this._currentTime&&(this._currentTime=e,this._isFinished&&!n&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())},t.prototype.fireEvents=function(e){var n=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var r=new Vv(null,this,this.currentTime,e);setTimeout(function(){n.onfinish&&n.onfinish(r)})}this._finishedFlag=!0}}else{if(this.onframe&&this.playState==="running"){var i=new Vv(null,this,this.currentTime,e);this.onframe(i)}this._finishedFlag=!1}},t}(),b7=4,_7=.001,x7=1e-7,O7=10,Kl=11,xd=1/(Kl-1),w7=typeof Float32Array=="function",D2=function(t,e){return 1-3*e+3*t},F2=function(t,e){return 3*e-6*t},B2=function(t){return 3*t},Od=function(t,e,n){return((D2(e,n)*t+F2(e,n))*t+B2(e))*t},z2=function(t,e,n){return 3*D2(e,n)*t*t+2*F2(e,n)*t+B2(e)},S7=function(t,e,n,r,i){var a,o,s=0;do o=e+(n-e)/2,a=Od(o,r,i)-t,a>0?n=o:e=o;while(Math.abs(a)>x7&&++s=_7?M7(s,d,t,n):h===0?d:S7(s,c,c+xd,t,n)};return function(s){return s===0||s===1?s:Od(o(s),e,r)}},E7=function(t){return t=t.replace(/([A-Z])/g,function(e){return"-".concat(e.toLowerCase())}),t.charAt(0)==="-"?t.substring(1):t},wd=function(t){return Math.pow(t,2)},Sd=function(t){return Math.pow(t,3)},Md=function(t){return Math.pow(t,4)},Ed=function(t){return Math.pow(t,5)},Ad=function(t){return Math.pow(t,6)},Pd=function(t){return 1-Math.cos(t*Math.PI/2)},Td=function(t){return 1-Math.sqrt(1-t*t)},kd=function(t){return t*t*(3*t-2)},Cd=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((e*3-2)/22-t,2)},Ld=function(t,e){e===void 0&&(e=[]);var n=D(e,2),r=n[0],i=r===void 0?1:r,a=n[1],o=a===void 0?.5:a,s=Fn(Number(i),1,10),c=Fn(Number(o),.1,2);return t===0||t===1?t:-s*Math.pow(2,10*(t-1))*Math.sin((t-1-c/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/c)},Ql=function(t,e,n){e===void 0&&(e=[]);var r=D(e,4),i=r[0],a=i===void 0?1:i,o=r[1],s=o===void 0?100:o,c=r[2],l=c===void 0?10:c,u=r[3],f=u===void 0?0:u;a=Fn(a,.1,1e3),s=Fn(s,.1,1e3),l=Fn(l,.1,1e3),f=Fn(f,.1,1e3);var d=Math.sqrt(s/a),h=l/(2*Math.sqrt(s*a)),p=h<1?d*Math.sqrt(1-h*h):0,v=1,g=h<1?(h*d+-f)/p:-f+d,y=n?n*t/1e3:t;return h<1?y=Math.exp(-y*h*d)*(v*Math.cos(p*y)+g*Math.sin(p*y)):y=(v+g*y)*Math.exp(-y*d),t===0||t===1?t:1-y},Xv=function(t,e){e===void 0&&(e=[]);var n=D(e,2),r=n[0],i=r===void 0?10:r,a=n[1],o=a=="start"?Math.ceil:Math.floor;return o(Fn(t,0,1)*i)/i},G2=function(t,e){e===void 0&&(e=[]);var n=D(e,4),r=n[0],i=n[1],a=n[2],o=n[3];return Uv(r,i,a,o)(t)},Nd=Uv(.42,0,1,1),ji=function(t){return function(e,n,r){return n===void 0&&(n=[]),1-t(1-e,n,r)}},Ri=function(t){return function(e,n,r){return n===void 0&&(n=[]),e<.5?t(e*2,n,r)/2:1-t(e*-2+2,n,r)/2}},Ii=function(t){return function(e,n,r){return n===void 0&&(n=[]),e<.5?(1-t(1-e*2,n,r))/2:(t(e*2-1,n,r)+1)/2}},W2={steps:Xv,"step-start":function(t){return Xv(t,[1,"start"])},"step-end":function(t){return Xv(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":G2,ease:function(t){return G2(t,[.25,.1,.25,1])},in:Nd,out:ji(Nd),"in-out":Ri(Nd),"out-in":Ii(Nd),"in-quad":wd,"out-quad":ji(wd),"in-out-quad":Ri(wd),"out-in-quad":Ii(wd),"in-cubic":Sd,"out-cubic":ji(Sd),"in-out-cubic":Ri(Sd),"out-in-cubic":Ii(Sd),"in-quart":Md,"out-quart":ji(Md),"in-out-quart":Ri(Md),"out-in-quart":Ii(Md),"in-quint":Ed,"out-quint":ji(Ed),"in-out-quint":Ri(Ed),"out-in-quint":Ii(Ed),"in-expo":Ad,"out-expo":ji(Ad),"in-out-expo":Ri(Ad),"out-in-expo":Ii(Ad),"in-sine":Pd,"out-sine":ji(Pd),"in-out-sine":Ri(Pd),"out-in-sine":Ii(Pd),"in-circ":Td,"out-circ":ji(Td),"in-out-circ":Ri(Td),"out-in-circ":Ii(Td),"in-back":kd,"out-back":ji(kd),"in-out-back":Ri(kd),"out-in-back":Ii(kd),"in-bounce":Cd,"out-bounce":ji(Cd),"in-out-bounce":Ri(Cd),"out-in-bounce":Ii(Cd),"in-elastic":Ld,"out-elastic":ji(Ld),"in-out-elastic":Ri(Ld),"out-in-elastic":Ii(Ld),spring:Ql,"spring-in":Ql,"spring-out":ji(Ql),"spring-in-out":Ri(Ql),"spring-out-in":Ii(Ql)},A7=function(t){return E7(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()},P7=function(t){return W2[A7(t)]||W2.linear},T7=function(t){return t},k7=1,C7=.5,Y2=0;function H2(t,e){return function(n){if(n>=1)return 1;var r=1/t;return n+=e*r,n-n%r}}var jd="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",L7=new RegExp("cubic-bezier\\("+jd+","+jd+","+jd+","+jd+"\\)"),N7=/steps\(\s*(\d+)\s*\)/,j7=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function qv(t){var e=L7.exec(t);if(e)return Uv.apply(void 0,dt([],D(e.slice(1).map(Number)),!1));var n=N7.exec(t);if(n)return H2(Number(n[1]),Y2);var r=j7.exec(t);return r?H2(Number(r[1]),{start:k7,middle:C7,end:Y2}[r[2]]):P7(t)}function R7(t){return Math.abs(I7(t)/(t.playbackRate||1))}function I7(t){var e;return t.duration===0||t.iterations===0?0:(t.duration==="auto"?0:Number(t.duration))*((e=t.iterations)!==null&&e!==void 0?e:1)}var $2=0,Zv=1,Rd=2,V2=3;function D7(t,e,n){if(e===null)return $2;var r=n.endTime;return e=Math.min(n.delay+t+n.endDelay,r)?Rd:V2}function F7(t,e,n,r,i){switch(r){case Zv:return e==="backwards"||e==="both"?0:null;case V2:return n-i;case Rd:return e==="forwards"||e==="both"?t:null;case $2:return null}}function B7(t,e,n,r,i){var a=i;return t===0?e!==Zv&&(a+=n):a+=r/t,a}function z7(t,e,n,r,i,a){var o=t===1/0?e%1:t%1;return o===0&&n===Rd&&r!==0&&(i!==0||a===0)&&(o=1),o}function G7(t,e,n,r){return t===Rd&&e===1/0?1/0:n===1?Math.floor(r)-1:Math.floor(r)}function W7(t,e,n){var r=t;if(t!=="normal"&&t!=="reverse"){var i=e;t==="alternate-reverse"&&(i+=1),r="normal",i!==1/0&&i%2!==0&&(r="reverse")}return r==="normal"?n:1-n}function Y7(t,e,n){var r=D7(t,e,n),i=F7(t,n.fill,e,r,n.delay);if(i===null)return null;var a=n.duration==="auto"?0:n.duration,o=B7(a,r,n.iterations,i,n.iterationStart),s=z7(o,n.iterationStart,r,n.iterations,i,a),c=G7(r,n.iterations,s,o),l=W7(n.direction,c,s);return n.currentIteration=c,n.progress=l,n.easingFunction(l)}function H7(t,e,n){var r=$7(t,e),i=V7(r,n);return function(a,o){if(o!==null)i.filter(function(c){return o>=c.applyFrom&&o1)throw new Error("Keyframe offsets must be between 0 and 1.");l.computedOffset=f}}else if(u==="composite"&&["replace","add","accumulate","auto"].indexOf(f)===-1)throw new Error("".concat(f," compositing is not supported"));l[u]=f}return l.offset===void 0&&(l.offset=null),l.easing===void 0&&(l.easing=(e==null?void 0:e.easing)||"linear"),l.composite===void 0&&(l.composite="auto"),l}),r=!0,i=-1/0,a=0;a=0&&Number(c.offset)<=1});function s(){var c,l,u=n.length;n[u-1].computedOffset=Number((c=n[u-1].offset)!==null&&c!==void 0?c:1),u>1&&(n[0].computedOffset=Number((l=n[0].offset)!==null&&l!==void 0?l:0));for(var f=0,d=Number(n[0].computedOffset),h=1;hs?o:s,l=o>s?1:o/s,u=o>s?s/o:1;t.save(),t.scale(l,u),t.arc(r,a,c,0,Math.PI*2)}}function az(t,e){var n=e.x1,r=e.y1,i=e.x2,a=e.y2,o=e.markerStart,s=e.markerEnd,c=e.markerStartOffset,l=e.markerEndOffset,u=0,f=0,d=0,h=0,p=0,v,g;o&&Be(o)&&c&&(v=i-n,g=a-r,p=Math.atan2(g,v),u=Math.cos(p)*(c||0),f=Math.sin(p)*(c||0)),s&&Be(s)&&l&&(v=n-i,g=r-a,p=Math.atan2(g,v),d=Math.cos(p)*(l||0),h=Math.sin(p)*(l||0)),t.moveTo(n+u,r+f),t.lineTo(i+d,a+h)}function oz(t,e){var n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,a=e.markerEndOffset,o=e.d,s=o.absolutePath,c=o.segments,l=0,u=0,f=0,d=0,h=0,p,v;if(n&&Be(n)&&i){var g=D(n.parentNode.getStartTangent(),2),y=g[0],m=g[1];p=y[0]-m[0],v=y[1]-m[1],h=Math.atan2(v,p),l=Math.cos(h)*(i||0),u=Math.sin(h)*(i||0)}if(r&&Be(r)&&a){var b=D(r.parentNode.getEndTangent(),2),y=b[0],m=b[1];p=y[0]-m[0],v=y[1]-m[1],h=Math.atan2(v,p),f=Math.cos(h)*(a||0),d=Math.sin(h)*(a||0)}for(var _=0;_T?P:T,z=P>T?1:P/T,W=P>T?T/P:1;t.translate(A,C),t.rotate(F),t.scale(z,W),t.arc(0,0,I,k,N,!!(1-R)),t.scale(1/z,1/W),t.rotate(-F),t.translate(-A,-C)}M&&t.lineTo(x[6]+f,x[7]+d);break}case"Z":t.closePath();break}}}function sz(t,e){var n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,a=e.markerEndOffset,o=e.points.points,s=o.length,c=o[0][0],l=o[0][1],u=o[s-1][0],f=o[s-1][1],d=0,h=0,p=0,v=0,g=0,y,m;n&&Be(n)&&i&&(y=o[1][0]-o[0][0],m=o[1][1]-o[0][1],g=Math.atan2(m,y),d=Math.cos(g)*(i||0),h=Math.sin(g)*(i||0)),r&&Be(r)&&a&&(y=o[s-1][0]-o[0][0],m=o[s-1][1]-o[0][1],g=Math.atan2(m,y),p=Math.cos(g)*(a||0),v=Math.sin(g)*(a||0)),t.moveTo(c+(d||p),l+(h||v));for(var b=1;b0?1:-1,h=c>0?1:-1,p=d+h===0,v=D(o.map(function(_){return Fn(_,0,Math.min(Math.abs(l)/2,Math.abs(u)/2))}),4),g=v[0],y=v[1],m=v[2],b=v[3];t.moveTo(d*g+r,a),t.lineTo(l-d*y+r,a),y!==0&&t.arc(l-d*y+r,h*y+a,y,-h*Math.PI/2,d>0?0:Math.PI,p),t.lineTo(l+r,u-h*m+a),m!==0&&t.arc(l-d*m+r,u-h*m+a,m,d>0?0:Math.PI,h>0?Math.PI/2:1.5*Math.PI,p),t.lineTo(d*b+r,u+a),b!==0&&t.arc(d*b+r,u-h*b+a,b,h>0?Math.PI/2:-Math.PI/2,d>0?Math.PI:0,p),t.lineTo(r,h*g+a),g!==0&&t.arc(d*g+r,h*g+a,g,d>0?Math.PI:0,h>0?Math.PI*1.5:Math.PI/2,p)}}var uz=function(t){It(e,t);function e(){var n=t.apply(this,dt([],D(arguments),!1))||this;return n.name="canvas-path-generator",n}return e.prototype.init=function(){var n,r=(n={},n[st.CIRCLE]=rz,n[st.ELLIPSE]=iz,n[st.RECT]=lz,n[st.LINE]=az,n[st.POLYLINE]=cz,n[st.POLYGON]=sz,n[st.PATH]=oz,n[st.TEXT]=void 0,n[st.GROUP]=void 0,n[st.IMAGE]=void 0,n[st.HTML]=void 0,n[st.MESH]=void 0,n);this.context.pathGeneratorFactory=r},e.prototype.destroy=function(){delete this.context.pathGeneratorFactory},e}(lo),fz=Se(),dz=Se(),hz=Se(),pz=cn(),vz=function(){function t(){var e=this;this.isHit=function(n,r,i,a){var o=e.context.pointInPathPickerFactory[n.nodeName];if(o){var s=fa(pz,i),c=fr(dz,Ki(hz,r[0],r[1],0),s);if(o(n,new Sr(c[0],c[1]),a,e.isPointInPath,e.context,e.runtime))return!0}return!1},this.isPointInPath=function(n,r){var i=e.runtime.offscreenCanvasCreator.getOrCreateContext(e.context.config.offscreenCanvas),a=e.context.pathGeneratorFactory[n.nodeName];return a&&(i.beginPath(),a(i,n.parsedStyle),i.closePath()),i.isPointInPath(r.x,r.y)}}return t.prototype.apply=function(e,n){var r=this,i,a=e.renderingService,o=e.renderingContext;this.context=e,this.runtime=n;var s=(i=o.root)===null||i===void 0?void 0:i.ownerDocument;a.hooks.pick.tapPromise(t.tag,function(c){return es(r,void 0,void 0,function(){return ns(this,function(l){return[2,this.pick(s,c)]})})}),a.hooks.pickSync.tap(t.tag,function(c){return r.pick(s,c)})},t.prototype.pick=function(e,n){var r,i,a=n.topmost,o=n.position,s=o.x,c=o.y,l=Ki(fz,s,c,0),u=e.elementsFromBBox(l[0],l[1],l[0],l[1]),f=[];try{for(var d=jr(u),h=d.next();!h.done;h=d.next()){var p=h.value,v=p.getWorldTransform(),g=this.isHit(p,l,v,!1);if(g){var y=h2(p);if(y){var m=y.parsedStyle.clipPath,b=this.isHit(m,l,m.getWorldTransform(),!0);if(b){if(a)return n.picked=[p],n;f.push(p)}}else{if(a)return n.picked=[p],n;f.push(p)}}}}catch(_){r={error:_}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}return n.picked=f,n},t.tag="CanvasPicker",t}();function gz(t,e,n){var r=t.parsedStyle,i=r.cx,a=i===void 0?0:i,o=r.cy,s=o===void 0?0:o,c=r.r,l=r.fill,u=r.stroke,f=r.lineWidth,d=f===void 0?1:f,h=r.increasedLineWidthForHitTesting,p=h===void 0?0:h,v=r.pointerEvents,g=v===void 0?"auto":v,y=(d+p)/2,m=Ir(a,s,e.x,e.y),b=D(ps(g,l,u),2),_=b[0],x=b[1];return _&&x||n?m<=c+y:_?m<=c:x?m>=c-y&&m<=c+y:!1}function Id(t,e,n,r){return t/(n*n)+e/(r*r)}function yz(t,e,n){var r=t.parsedStyle,i=r.cx,a=i===void 0?0:i,o=r.cy,s=o===void 0?0:o,c=r.rx,l=r.ry,u=r.fill,f=r.stroke,d=r.lineWidth,h=d===void 0?1:d,p=r.increasedLineWidthForHitTesting,v=p===void 0?0:p,g=r.pointerEvents,y=g===void 0?"auto":g,m=e.x,b=e.y,_=D(ps(y,u,f),2),x=_[0],O=_[1],w=(h+v)/2,S=(m-a)*(m-a),M=(b-s)*(b-s);return x&&O||n?Id(S,M,c+w,l+w)<=1:x?Id(S,M,c,l)<=1:O?Id(S,M,c-w,l-w)>=1&&Id(S,M,c+w,l+w)<=1:!1}function ms(t,e,n,r,i,a){return i>=t&&i<=t+n&&a>=e&&a<=e+r}function mz(t,e,n,r,i,a,o){var s=i/2;return ms(t-s,e-s,n,i,a,o)||ms(t+n-s,e-s,i,r,a,o)||ms(t+s,e+r-s,n,i,a,o)||ms(t-s,e+s,i,r,a,o)}function Dd(t,e,n,r,i,a,o,s){var c=(Math.atan2(s-e,o-t)+Math.PI*2)%(Math.PI*2),l={x:t+n*Math.cos(c),y:e+n*Math.sin(c)};return Ir(l.x,l.y,o,s)<=a/2}function go(t,e,n,r,i,a,o){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 a>=s-f&&a<=c+f&&o>=l-f&&o<=u+f?Ox(t,e,n,r,a,o)<=i/2:!1}function Q2(t,e,n,r,i){var a=t.length;if(a<2)return!1;for(var o=0;o0!=Kv(s[1]-n)>0&&Kv(e-(n-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(r=!r)}return r}function tO(t,e,n){for(var r=!1,i=0;ix&&E>O,g&&(g.resetTransform?g.resetTransform():g.setTransform(1,0,0,1,0,0),r.clearFullScreen&&r.clearRect(g,0,0,m*y,b*y,i.background))});var p=function(v,g){v.isVisible()&&!v.isCulled()&&r.renderDisplayObject(v,g,r.context,r.restoreStack,n);var y=v.sortable.sorted||v.childNodes;y.forEach(function(m){p(m,g)})};o.hooks.endFrame.tap(t.tag,function(){if(s.root.childNodes.length===0){r.clearFullScreenLastFrame=!0;return}r.clearFullScreenLastFrame=!1;var v=u.getContext(),g=u.getDPR();if(ss(r.dprMatrix,[g,g,1]),Rr(r.vpMatrix,r.dprMatrix,a.getOrthoMatrix()),r.clearFullScreen)p(s.root,v);else{var y=r.safeMergeAABB.apply(r,dt([r.mergeDirtyAABBs(r.renderQueue)],D(r.removedRBushNodeAABBs.map(function(W){var V=W.minX,$=W.minY,J=W.maxX,ct=W.maxY,pt=new Vn;return pt.setMinMax([V,$,0],[J,ct,0]),pt})),!1));if(r.removedRBushNodeAABBs=[],Vn.isEmpty(y)){r.renderQueue=[];return}var m=r.convertAABB2Rect(y),b=m.x,_=m.y,x=m.width,O=m.height,w=fr(r.vec3a,[b,_,0],r.vpMatrix),S=fr(r.vec3b,[b+x,_,0],r.vpMatrix),M=fr(r.vec3c,[b,_+O,0],r.vpMatrix),E=fr(r.vec3d,[b+x,_+O,0],r.vpMatrix),A=Math.min(w[0],S[0],E[0],M[0]),C=Math.min(w[1],S[1],E[1],M[1]),P=Math.max(w[0],S[0],E[0],M[0]),T=Math.max(w[1],S[1],E[1],M[1]),k=Math.floor(A),N=Math.floor(C),F=Math.ceil(P-A),R=Math.ceil(T-C);v.save(),r.clearRect(v,k,N,F,R,i.background),v.beginPath(),v.rect(k,N,F,R),v.clip(),v.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]);var I=i.renderer.getConfig().enableDirtyRectangleRenderingDebug;I&&f.dispatchEvent(new sn(di.DIRTY_RECTANGLE,{dirtyRect:{x:k,y:N,width:F,height:R}}));var z=r.searchDirtyObjects(y);z.sort(function(W,V){return W.sortable.renderOrder-V.sortable.renderOrder}).forEach(function(W){W&&W.isVisible()&&!W.isCulled()&&r.renderDisplayObject(W,v,r.context,r.restoreStack,n)}),v.restore(),r.renderQueue.forEach(function(W){r.saveDirtyAABB(W)}),r.renderQueue=[]}r.restoreStack.forEach(function(){v.restore()}),r.restoreStack=[]}),o.hooks.render.tap(t.tag,function(v){r.clearFullScreen||r.renderQueue.push(v)})},t.prototype.clearRect=function(e,n,r,i,a,o){e.clearRect(n,r,i,a),o&&(e.fillStyle=o,e.fillRect(n,r,i,a))},t.prototype.renderDisplayObject=function(e,n,r,i,a){var o=e.nodeName,s=i[i.length-1];s&&!(e.compareDocumentPosition(s)&gr.DOCUMENT_POSITION_CONTAINS)&&(n.restore(),i.pop());var c=this.context.styleRendererFactory[o],l=this.pathGeneratorFactory[o],u=e.parsedStyle.clipPath;if(u){this.applyWorldTransform(n,u);var f=this.pathGeneratorFactory[u.nodeName];f&&(n.save(),i.push(e),n.beginPath(),f(n,u.parsedStyle),n.closePath(),n.clip())}c&&(this.applyWorldTransform(n,e),n.save(),this.applyAttributesToContext(n,e)),l&&(n.beginPath(),l(n,e.parsedStyle),e.nodeName!==st.LINE&&e.nodeName!==st.PATH&&e.nodeName!==st.POLYLINE&&n.closePath()),c&&(c.render(n,e.parsedStyle,e,r,this,a),n.restore()),e.renderable.dirty=!1},t.prototype.convertAABB2Rect=function(e){var n=e.getMin(),r=e.getMax(),i=Math.floor(n[0]),a=Math.floor(n[1]),o=Math.ceil(r[0]),s=Math.ceil(r[1]),c=o-i,l=s-a;return{x:i,y:a,width:c,height:l}},t.prototype.mergeDirtyAABBs=function(e){var n=new Vn;return e.forEach(function(r){var i=r.getRenderBounds();n.add(i);var a=r.renderable.dirtyRenderBounds;a&&n.add(a)}),n},t.prototype.searchDirtyObjects=function(e){var n=D(e.getMin(),2),r=n[0],i=n[1],a=D(e.getMax(),2),o=a[0],s=a[1],c=this.rBush.search({minX:r,minY:i,maxX:o,maxY:s});return c.map(function(l){var u=l.displayObject;return u})},t.prototype.saveDirtyAABB=function(e){var n=e.renderable;n.dirtyRenderBounds||(n.dirtyRenderBounds=new Vn);var r=e.getRenderBounds();r&&n.dirtyRenderBounds.update(r.center,r.halfExtents)},t.prototype.applyAttributesToContext=function(e,n){var r=n.parsedStyle,i=r.stroke,a=r.fill,o=r.opacity,s=r.lineDash,c=r.lineDashOffset;s&&e.setLineDash(s),ie(c)||(e.lineDashOffset=c),ie(o)||(e.globalAlpha*=o),!ie(i)&&!Array.isArray(i)&&!i.isNone&&(e.strokeStyle=n.attributes.stroke),!ie(a)&&!Array.isArray(a)&&!a.isNone&&(e.fillStyle=n.attributes.fill)},t.prototype.applyWorldTransform=function(e,n,r){r?(is(this.tmpMat4,n.getLocalTransform()),Rr(this.tmpMat4,r,this.tmpMat4),Rr(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(is(this.tmpMat4,n.getWorldTransform()),Rr(this.tmpMat4,this.vpMatrix,this.tmpMat4)),e.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 e=[],n=0;n0,A=(s==null?void 0:s.alpha)===0,C=!!(w&&w.length),P=!ie(x)&&O>0,T=r.nodeName,k=_==="inner",N=E&&P&&(T===st.PATH||T===st.LINE||T===st.POLYLINE||A||k);M&&(e.globalAlpha=u*d,N||Fd(r,e,P),this.fill(e,r,s,c,i,a,o),N||this.clearShadowAndFilter(e,C,P)),E&&(e.globalAlpha=u*v,e.lineWidth=y,ie(S)||(e.miterLimit=S),ie(m)||(e.lineCap=m),ie(b)||(e.lineJoin=b),N&&(k&&(e.globalCompositeOperation="source-atop"),Fd(r,e,!0),k&&(this.stroke(e,r,h,i,a,o),e.globalCompositeOperation="source-over",this.clearShadowAndFilter(e,C,!0))),this.stroke(e,r,h,i,a,o))},t.prototype.clearShadowAndFilter=function(e,n,r){if(r&&(e.shadowColor="transparent",e.shadowBlur=0),n){var i=e.filter;!ie(i)&&i.indexOf("drop-shadow")>-1&&(e.filter=i.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}},t.prototype.fill=function(e,n,r,i,a,o,s){var c=this;Array.isArray(r)?r.forEach(function(l){e.fillStyle=c.getColor(l,n,e),i?e.fill(i):e.fill()}):(Yl(r)&&(e.fillStyle=this.getPattern(r,n,e,a,o,s)),i?e.fill(i):e.fill())},t.prototype.stroke=function(e,n,r,i,a,o){var s=this;Array.isArray(r)?r.forEach(function(c){e.strokeStyle=s.getColor(c,n,e),e.stroke()}):(Yl(r)&&(e.strokeStyle=this.getPattern(r,n,e,i,a,o)),e.stroke())},t.prototype.getPattern=function(e,n,r,i,a,o){var s,c;if(e.image.nodeName==="rect"){var l=e.image.parsedStyle,u=l.width,f=l.height;c=i.contextService.getDPR();var d=i.config.offscreenCanvas;s=o.offscreenCanvasCreator.getOrCreateCanvas(d),s.width=u*c,s.height=f*c;var h=o.offscreenCanvasCreator.getOrCreateContext(d),p=[];e.image.forEach(function(g){a.renderDisplayObject(g,h,i,p,o)}),p.forEach(function(){h.restore()})}var v=this.imagePool.getOrCreatePatternSync(e,r,s,c,n.getGeometryBounds().min,function(){n.renderable.dirty=!0,i.renderingService.dirtify()});return v},t.prototype.getColor=function(e,n,r){var i;if(e.type===ga.LinearGradient||e.type===ga.RadialGradient){var a=n.getGeometryBounds(),o=a&&a.halfExtents[0]*2||1,s=a&&a.halfExtents[1]*2||1,c=a&&a.min||[0,0];i=this.imagePool.getOrCreateGradient(Q(Q({type:e.type},e.value),{min:c,width:o,height:s}),r)}return i},t}();function Fd(t,e,n){var r=t.parsedStyle,i=r.filter,a=r.shadowColor,o=r.shadowBlur,s=r.shadowOffsetX,c=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=a.toString(),e.shadowBlur=o||0,e.shadowOffsetX=s||0,e.shadowOffsetY=c||0)}var Cz=function(){function t(e){this.imagePool=e}return t.prototype.render=function(e,n,r){var i=n.x,a=i===void 0?0:i,o=n.y,s=o===void 0?0:o,c=n.width,l=n.height,u=n.src,f=n.shadowColor,d=n.shadowBlur,h,p=c,v=l;if(kn(u)?h=this.imagePool.getImageSync(u):(p||(p=u.width),v||(v=u.height),h=u),h){var g=!ie(f)&&d>0;Fd(r,e,g);try{e.drawImage(h,a,s,p,v)}catch(y){}}},t}(),Lz=function(){function t(){}return t.prototype.render=function(e,n,r,i,a,o){r.getBounds();var s=n,c=s.lineWidth,l=c===void 0?1:c,u=s.textAlign,f=u===void 0?"start":u,d=s.textBaseline,h=d===void 0?"alphabetic":d,p=s.lineJoin,v=p===void 0?"miter":p,g=s.miterLimit,y=g===void 0?10:g,m=s.letterSpacing,b=m===void 0?0:m,_=s.stroke,x=s.fill,O=s.fillOpacity,w=O===void 0?1:O,S=s.strokeOpacity,M=S===void 0?1:S,E=s.opacity,A=E===void 0?1:E,C=s.metrics,P=s.x,T=P===void 0?0:P,k=s.y,N=k===void 0?0:k,F=s.dx,R=s.dy,I=s.shadowColor,z=s.shadowBlur,W=C.font,V=C.lines,$=C.height,J=C.lineHeight,ct=C.lineMetrics;e.font=W,e.lineWidth=l,e.textAlign=f==="middle"?"center":f;var pt=h;!o.enableCSSParsing&&pt==="alphabetic"&&(pt="bottom"),e.lineJoin=v,ie(y)||(e.miterLimit=y);var it=N;h==="middle"?it+=-$/2-J/2:h==="bottom"||h==="alphabetic"||h==="ideographic"?it+=-$:(h==="top"||h==="hanging")&&(it+=-J);var nt=T+(F||0);it+=R||0,V.length===1&&(pt==="bottom"?(pt="middle",it-=.5*$):pt==="top"&&(pt="middle",it+=.5*$)),e.textBaseline=pt;var xt=!ie(I)&&z>0;Fd(r,e,xt);for(var yt=0;yt=1?Math.ceil(i):1,this.dpr=i,this.$canvas&&(this.$canvas.width=this.dpr*e,this.$canvas.height=this.dpr*n,H9(this.$canvas,e,n)),this.renderingContext.renderReasons.add(po.CAMERA_CHANGED)},t.prototype.applyCursorStyle=function(e){this.$container&&this.$container.style&&(this.$container.style.cursor=e)},t.prototype.toDataURL=function(e){return e===void 0&&(e={}),es(this,void 0,void 0,function(){var n,r;return ns(this,function(i){return n=e.type,r=e.encoderOptions,[2,this.context.canvas.toDataURL(n,r)]})})},t}(),Yz=function(t){It(e,t);function e(){var n=t.apply(this,dt([],D(arguments),!1))||this;return n.name="canvas-context-register",n}return e.prototype.init=function(){this.context.ContextService=Wz},e.prototype.destroy=function(){delete this.context.ContextService},e}(lo),eO=function(t){It(e,t);function e(n){var r=t.call(this,n)||this;return r.registerPlugin(new Yz),r.registerPlugin(new Gz),r.registerPlugin(new uz),r.registerPlugin(new Nz),r.registerPlugin(new Rz),r.registerPlugin(new Tz),r.registerPlugin(new Fz),r}return e}(aF),Hz=function(){function t(e){this.dragndropPluginOptions=e}return t.prototype.apply=function(e){var n=this,r=e.renderingService,i=e.renderingContext,a=i.root.ownerDocument,o=a.defaultView,s=function(c){var l=c.target,u=l===a,f=u&&n.dragndropPluginOptions.isDocumentDraggable?a:l.closest&&l.closest("[draggable=true]");if(f){var d=!1,h=c.timeStamp,p=[c.clientX,c.clientY],v=null,g=[c.clientX,c.clientY],y=function(b){return es(n,void 0,void 0,function(){var _,x,O,w,S,M;return ns(this,function(E){switch(E.label){case 0:if(!d){if(_=b.timeStamp-h,x=oi([b.clientX,b.clientY],p),_<=this.dragndropPluginOptions.dragstartTimeThreshold||x<=this.dragndropPluginOptions.dragstartDistanceThreshold)return[2];b.type="dragstart",f.dispatchEvent(b),d=!0}return b.type="drag",b.dx=b.clientX-g[0],b.dy=b.clientY-g[1],f.dispatchEvent(b),g=[b.clientX,b.clientY],u?[3,2]:(O=this.dragndropPluginOptions.overlap==="pointer"?[b.canvasX,b.canvasY]:l.getBounds().center,[4,a.elementsFromPoint(O[0],O[1])]);case 1:w=E.sent(),S=w[w.indexOf(l)+1],M=(S==null?void 0:S.closest("[droppable=true]"))||(this.dragndropPluginOptions.isDocumentDroppable?a:null),v!==M&&(v&&(b.type="dragleave",b.target=v,v.dispatchEvent(b)),M&&(b.type="dragenter",b.target=M,M.dispatchEvent(b)),v=M,v&&(b.type="dragover",b.target=v,v.dispatchEvent(b))),E.label=2;case 2:return[2]}})})};o.addEventListener("pointermove",y);var m=function(b){if(d){b.detail={preventClick:!0};var _=b.clone();v&&(_.type="drop",_.target=v,v.dispatchEvent(_)),_.type="dragend",f.dispatchEvent(_),d=!1}o.removeEventListener("pointermove",y)};l.addEventListener("pointerup",m,{once:!0}),l.addEventListener("pointerupoutside",m,{once:!0})}};r.hooks.init.tap(t.tag,function(){o.addEventListener("pointerdown",s)}),r.hooks.destroy.tap(t.tag,function(){o.removeEventListener("pointerdown",s)})},t.tag="Dragndrop",t}(),nO=function(t){It(e,t);function e(n){n===void 0&&(n={});var r=t.call(this)||this;return r.options=n,r.name="dragndrop",r}return e.prototype.init=function(){this.addRenderingPlugin(new Hz(Q({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e.prototype.setOptions=function(n){Object.assign(this.plugins[0].dragndropPluginOptions,n)},e}(lo);function $z(t,e,n){var r;return function(){var i=this,a=arguments,o=function(){r=null,n||t.apply(i,a)},s=n&&!r;clearTimeout(r),r=setTimeout(o,e),s&&t.apply(i,a)}}var rO=$z,Vz=function(t){return typeof t=="object"&&t!==null},Qv=Vz,Uz=function(t){if(!Qv(t)||!Rl(t,"Object"))return!1;if(Object.getPrototypeOf(t)===null)return!0;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},Ba=Uz,Xz=5;function qz(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(t==null)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function iO(t,e,n,r){n=n||0,r=r||Xz;for(var i in e)if(qz(e,i)){var a=e[i];a!==null&&Ba(a)?(Ba(t[i])||(t[i]={}),ni.pop().map(([a,o])=>[...i,a,o]));return t}function ggt(t,...e){return cO(Bd(t,...e),e)}function ygt(t,e,...n){return cO(eg(t,e,...n),n)}function tg(t,e,...n){return Sc(t,Jl,e,n)}function eg(t,e,...n){return Sc(t,Array.from,e,n)}function mgt(t,...e){return Sc(t,identity,lO,e)}function bgt(t,...e){return Sc(t,Array.from,lO,e)}function lO(t){if(t.length!==1)throw new Error("duplicate key");return t[0]}function Sc(t,e,n,r){return function i(a,o){if(o>=r.length)return n(a);const s=new Kz,c=r[o++];let l=-1;for(const u of a){const f=c(u,++l,a),d=s.get(f);d?d.push(u):s.set(f,[u])}for(const[u,f]of s)s.set(u,i(f,o));return e(s)}(t,0)}var uO=function(t){return ie(t)?"":t.toString()},Qz=function(t){var e=uO(t);return e.charAt(0).toLowerCase()+e.substring(1)},fO=Qz,Jz=function(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{l(r.next(u))}catch(f){o(f)}}function c(u){try{l(r.throw(u))}catch(f){o(f)}}function l(u){u.done?a(u.value):i(u.value).then(s,c)}l((r=r.apply(t,e||[])).next())})};function bs(t){return t}function ng(t){return t.reduce((e,n)=>(r,...i)=>n(e(r,...i),...i),bs)}function tG(t){return t.reduce((e,n)=>r=>Jz(this,void 0,void 0,function*(){const i=yield e(r);return n(i)}),bs)}function rg(t){return t.replace(/( |^)[a-z]/g,e=>e.toUpperCase())}function Mc(t=""){throw new Error(t)}function ig(t,e){const{attributes:n}=e,r=new Set(["id","className"]);for(const[i,a]of Object.entries(n))r.has(i)||t.attr(i,a)}function un(t){return t!=null&&!Number.isNaN(t)}function _gt(t,e){return t+(e-t)*Math.random()}function eG(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 nG(t,e){const{transform:n}=t.style,i=(a=>a==="none"||a===void 0)(n)?"":n;t.style.transform=`${i} ${e}`.trimStart()}function At(t,e){return dO(t,e)||{}}function dO(t,e){const n=Object.entries(t||{}).filter(([r])=>r.startsWith(e)).map(([r,i])=>[fO(r.replace(e,"").trim()),i]).filter(([r])=>!!r);return n.length===0?null:Object.fromEntries(n)}function xgt(t,e){return Object.fromEntries(Object.entries(t).map(([n,r])=>[`${e}${upperFirst(n)}`,r]))}function rG(t,e){return Object.fromEntries(Object.entries(t).filter(([n])=>e.find(r=>n.startsWith(r))))}function ag(t,...e){return Object.fromEntries(Object.entries(t).filter(([n])=>e.every(r=>!n.startsWith(r))))}function hO(t,e){if(t===void 0)return null;if(typeof t=="number")return t;const n=+t.replace("%","");return Number.isNaN(n)?null:n/100*e}function Ec(t){return typeof t=="object"&&!(t instanceof Date)&&t!==null&&!Array.isArray(t)}function za(t){return t===null||t===!1}function pO(t,e,n=5,r=0){if(!(r>=n)){for(const i of Object.keys(e)){const a=e[i];!Ba(a)||!Ba(t[i])?t[i]=a:pO(t[i],a,n,r+1)}return t}}function Kt(t){return new nr([t],null,t,t.ownerDocument)}class nr{constructor(e=null,n=null,r=null,i=null,a=[null,null,null,null,null],o=[],s=[]){this._elements=Array.from(e),this._data=n,this._parent=r,this._document=i,this._enter=a[0],this._update=a[1],this._exit=a[2],this._merge=a[3],this._split=a[4],this._transitions=o,this._facetElements=s}selectAll(e){const n=typeof e=="string"?this._parent.querySelectorAll(e):e;return new nr(n,null,this._elements[0],this._document)}selectFacetAll(e){const n=typeof e=="string"?this._parent.querySelectorAll(e):e;return new nr(this._elements,null,this._parent,this._document,void 0,void 0,n)}select(e){const n=typeof e=="string"?this._parent.querySelectorAll(e)[0]||null:e;return new nr([n],null,n,this._document)}append(e){const n=typeof e=="function"?e:()=>this.createElement(e),r=[];if(this._data!==null){for(let i=0;ii,r=()=>null){const i=[],a=[],o=new Set(this._elements),s=[],c=new Set,l=new Map(this._elements.map((h,p)=>[n(h.__data__,p),h])),u=new Map(this._facetElements.map((h,p)=>[n(h.__data__,p),h])),f=Cn(this._elements,h=>r(h.__data__));for(let h=0;ho,n=o=>o,r=o=>o.remove(),i=o=>o,a=o=>o.remove()){const o=e(this._enter),s=n(this._update),c=r(this._exit),l=i(this._merge),u=a(this._split);return s.merge(o).merge(c).merge(l).merge(u)}remove(){for(let e=0;ei.finished)).then(()=>{this._elements[e].remove()})}else this._elements[e].remove()}return new nr([],null,this._parent,this._document,void 0,this._transitions)}each(e){for(let n=0;nn:n;return this.each(function(i,a,o){n!==void 0&&(o[e]=r(i,a,o))})}style(e,n){const r=typeof n!="function"?()=>n:n;return this.each(function(i,a,o){n!==void 0&&(o.style[e]=r(i,a,o))})}transition(e){const n=typeof e!="function"?()=>e:e,{_transitions:r}=this;return this.each(function(i,a,o){r[a]=n(i,a,o)})}on(e,n){return this.each(function(r,i,a){a.addEventListener(e,n)}),this}call(e,...n){return e(this,...n),this}node(){return this._elements[0]}nodes(){return this._elements}transitions(){return this._transitions}parent(){return this._parent}}nr.registry={g:dr,rect:ys,circle:gs,path:Zr,text:fi,ellipse:Fv,image:Bv,line:ql,polygon:Zl,polyline:zv,html:bd};const Ze={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"};var iG=function(t){var e=uO(t);return e.charAt(0).toUpperCase()+e.substring(1)},mo=iG;function aG(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function zd(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)]}function oG(t){return t=zd(Math.abs(t)),t?t[1]:NaN}function sG(t,e){return function(n,r){for(var i=n.length,a=[],o=0,s=t[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=t[o=(o+1)%t.length];return a.reverse().join(e)}}function cG(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var lG=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function og(t){if(!(e=lG.exec(t)))throw new Error("invalid format: "+t);var e;return new sg({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]})}og.prototype=sg.prototype;function sg(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}sg.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function uG(t){t:for(var e=t.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var vO;function fG(t,e){var n=zd(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(vO=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+zd(t,Math.max(0,e+a-1))[0]}function gO(t,e){var n=zd(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")}var yO={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:aG,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)=>gO(t*100,e),r:gO,s:fG,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function mO(t){return t}var bO=Array.prototype.map,_O=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function dG(t){var e=t.grouping===void 0||t.thousands===void 0?mO:sG(bO.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?mO:cG(bO.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"\u2212":t.minus+"",c=t.nan===void 0?"NaN":t.nan+"";function l(f){f=og(f);var d=f.fill,h=f.align,p=f.sign,v=f.symbol,g=f.zero,y=f.width,m=f.comma,b=f.precision,_=f.trim,x=f.type;x==="n"?(m=!0,x="g"):yO[x]||(b===void 0&&(b=12),_=!0,x="g"),(g||d==="0"&&h==="=")&&(g=!0,d="0",h="=");var O=v==="$"?n:v==="#"&&/[boxX]/.test(x)?"0"+x.toLowerCase():"",w=v==="$"?r:/[%p]/.test(x)?o:"",S=yO[x],M=/[defgprs%]/.test(x);b=b===void 0?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function E(A){var C=O,P=w,T,k,N;if(x==="c")P=S(A)+P,A="";else{A=+A;var F=A<0||1/A<0;if(A=isNaN(A)?c:S(Math.abs(A),b),_&&(A=uG(A)),F&&+A==0&&p!=="+"&&(F=!1),C=(F?p==="("?p:s:p==="-"||p==="("?"":p)+C,P=(x==="s"?_O[8+vO/3]:"")+P+(F&&p==="("?")":""),M){for(T=-1,k=A.length;++TN||N>57){P=(N===46?i+A.slice(T+1):A.slice(T))+P,A=A.slice(0,T);break}}}m&&!g&&(A=e(A,1/0));var R=C.length+A.length+P.length,I=R>1)+C+A+P+I.slice(R);break;default:A=I+C+A+P;break}return a(A)}return E.toString=function(){return f+""},E}function u(f,d){var h=l((f=og(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(oG(d)/3)))*3,v=Math.pow(10,-p),g=_O[8+p/3];return function(y){return h(v*y)+g}}return{format:l,formatPrefix:u}}var Gd,bo,hG;pG({thousands:",",grouping:[3],currency:["$",""]});function pG(t){return Gd=dG(t),bo=Gd.format,hG=Gd.formatPrefix,Gd}function _o(t,e){return Object.entries(t).reduce((n,[r,i])=>(n[r]=e(i,r,t),n),{})}function _s(t){return t.map((e,n)=>n)}function Ogt(t){const e=t.length,n=t[0].length,r=new Array(n).fill(0).map(()=>new Array(e));for(let i=0;i{n[e(r)?0:1].push(r)}),n}function wO(t,e=t.length){if(e===1)return t.map(r=>[r]);const n=[];for(let r=0;r{n.push([t[r],...o])})}return n}function yG(t){if(t.length===1)return[t];const e=[];for(let n=1;n<=t.length;n++)e.push(...wO(t,n));return e}var mG=function(t){return t!==null&&typeof t!="function"&&isFinite(t.length)},tu=mG,cg=function(t,e){if(t===e)return!0;if(!t||!e||kn(t)||kn(e))return!1;if(tu(t)||tu(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function Sgt(t){return t*Math.PI/180}function Mgt(t){return t*180/Math.PI}function bG(t,e){return t=t%(2*Math.PI),e=e%(2*Math.PI),t<0&&(t=2*Math.PI+t),e<0&&(e=2*Math.PI+e),t>=e&&(e=e+2*Math.PI),{startAngle:t,endAngle:e}}const MO=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:Math.PI*3/2,innerRadius:0,outerRadius:1},n=Object.assign(Object.assign({},e),t);return Object.assign(Object.assign({},n),bG(n.startAngle,n.endAngle))},eu=t=>{const{startAngle:e,endAngle:n,innerRadius:r,outerRadius:i}=MO(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",e,n,r,i]]};eu.props={};const EO=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:Math.PI*3/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)},lg=t=>{const{startAngle:e,endAngle:n,innerRadius:r,outerRadius:i}=EO(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...eu({startAngle:e,endAngle:n,innerRadius:r,outerRadius:i})]};lg.props={};function Wd(t,e,n){return Math.max(e,Math.min(t,n))}function Yd(t,e=10){return typeof t!="number"||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(e))}const _G=[["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 AO=tt(17816);function Sn(t){const{transformations:e}=t.getOptions();return e.map(([r])=>r).filter(r=>r==="transpose").length%2!==0}function fn(t){const{transformations:e}=t.getOptions();return e.some(([n])=>n==="polar")}function nu(t){const{transformations:e}=t.getOptions();return e.some(([n])=>n==="reflect")&&e.some(([n])=>n.startsWith("transpose"))}function PO(t){const{transformations:e}=t.getOptions();return e.some(([n])=>n==="helix")}function ru(t){const{transformations:e}=t.getOptions();return e.some(([n])=>n==="parallel")}function TO(t){const{transformations:e}=t.getOptions();return e.some(([n])=>n==="fisheye")}function xG(t){return ru(t)&&fn(t)}function Ac(t){return PO(t)||fn(t)}function kO(t){return fn(t)&&Sn(t)}function Egt(t){return fn(t)||ru(t)||nu(t)||kO(t)}function OG(t){if(Ac(t)){const[e,n]=t.getSize(),r=t.getOptions().transformations.find(i=>i[0]==="polar");if(r)return Math.max(e,n)/2*r[4]}return 0}function Hd(t){const{transformations:e}=t.getOptions(),[,,,n,r]=e.find(i=>i[0]==="polar");return[+n,+r]}function ug(t,e=!0){const{transformations:n}=t.getOptions(),[,r,i]=n.find(a=>a[0]==="polar");return e?[+r*180/Math.PI,+i*180/Math.PI]:[r,i]}function wG(t,e){const{transformations:n}=t.getOptions(),[,...r]=n.find(i=>i[0]===e);return r}function CO(t,e){e(t),t.children&&t.children.forEach(function(n){n&&CO(n,e)})}function iu(t){$d(t,!0)}function xo(t){$d(t,!1)}function $d(t,e){var n=e?"visible":"hidden";CO(t,function(r){r.attr("visibility",n)})}function SG(t){return typeof t=="boolean"?!1:"enter"in t&&"update"in t&&"exit"in t}function LO(t){if(!t)return{enter:!1,update:!1,exit:!1};var e=["enter","update","exit"],n=Object.fromEntries(Object.entries(t).filter(function(r){var i=D(r,1),a=i[0];return!e.includes(a)}));return Object.fromEntries(e.map(function(r){return SG(t)?t[r]===!1?[r,!1]:[r,Q(Q({},t[r]),n)]:[r,n]}))}function Pc(t,e){t?t.finished.then(e):e()}function MG(t,e){t.length===0?e():Promise.all(t.map(function(n){return n==null?void 0:n.finished})).then(e)}function NO(t,e){"update"in t?t.update(e):t.attr(e)}function jO(t,e,n){if(e.length===0)return null;if(!n){var r=e.slice(-1)[0];return NO(t,{style:r}),null}return t.animate(e,n)}function EG(t,e){return!(t.nodeName!=="text"||e.nodeName!=="text"||t.attributes.text!==e.attributes.text)}function AG(t,e,n,r){if(r===void 0&&(r="destroy"),EG(t,e))return t.remove(),[null];var i=function(){r==="destroy"?t.destroy():r==="hide"&&xo(t),e.isVisible()&&iu(e)};if(!n)return i(),[null];var a=n.duration,o=a===void 0?0:a,s=n.delay,c=s===void 0?0:s,l=Math.ceil(+o/2),u=+o/4,f=D(t.getGeometryBounds().center,2),d=f[0],h=f[1],p=D(e.getGeometryBounds().center,2),v=p[0],g=p[1],y=D([(d+v)/2-d,(h+g)/2-h],2),m=y[0],b=y[1],_=t.style.opacity,x=_===void 0?1:_,O=e.style.opacity,w=O===void 0?1:O,S=t.style.transform||"",M=e.style.transform||"",E=t.animate([{opacity:x,transform:"translate(0, 0) ".concat(S)},{opacity:0,transform:"translate(".concat(m,", ").concat(b,") ").concat(S)}],Q(Q({fill:"both"},n),{duration:c+l+u})),A=e.animate([{opacity:0,transform:"translate(".concat(-m,", ").concat(-b,") ").concat(M),offset:.01},{opacity:w,transform:"translate(0, 0) ".concat(M)}],Q(Q({fill:"both"},n),{duration:l+u,delay:c+l-u}));return Pc(A,i),[E,A]}function ta(t,e,n){var r={},i={};return Object.entries(e).forEach(function(a){var o=D(a,2),s=o[0],c=o[1];if(!ie(c)){var l=t.style[s]||t.parsedStyle[s]||0;l!==c&&(r[s]=l,i[s]=c)}}),n?jO(t,[r,i],Q({fill:"both"},n)):(NO(t,i),null)}var PG=5,RO=function(t,e,n,r){n===void 0&&(n=0),r===void 0&&(r=PG),Object.entries(e).forEach(function(i){var a=D(i,2),o=a[0],s=a[1],c=t;Object.prototype.hasOwnProperty.call(e,o)&&(s?Ba(s)?(Ba(t[o])||(c[o]={}),n="A"&&n<="Z"};function Oe(t,e,n){n===void 0&&(n=!1);var r={};return Object.entries(t).forEach(function(i){var a=D(i,2),o=a[0],s=a[1];if(!(o==="className"||o==="class")){if(Vd(o,"show")&&Vd(BO(o,"show"),e)!==n)o===BG(e,"show")?r[o]=s:r[o.replace(new RegExp(pg(e)),"")]=s;else if(!Vd(o,"show")&&Vd(o,e)!==n){var c=BO(o,e);c==="filter"&&typeof s=="function"||(r[c]=s)}}}),r}function ma(t,e){return Object.entries(t).reduce(function(n,r){var i=D(r,2),a=i[0],o=i[1];return a.startsWith("show")?n["show".concat(e).concat(a.slice(4))]=o:n["".concat(e).concat(pg(a))]=o,n},{})}function Ya(t,e){e===void 0&&(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(a){var o=D(a,2),s=o[0],c=o[1];e.includes(s)||(n.indexOf(s)!==-1?i[s]=c:r[s]=c)}),[r,i]}function Bi(t,e){return Kr(t)?t.apply(void 0,dt([],D(e),!1)):t}function Ud(t,e){return t.style.opacity||(t.style.opacity=1),ta(t,{opacity:0},e)}var GG=["$el","cx","cy","d","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","billboardRotation","isSizeAttenuation","isClosed","isOverflowing","leading","letterSpacing","lineDash","lineHeight","lineWidth","markerEnd","markerEndOffset","markerMid","markerStart","markerStartOffset","maxLines","metrics","miterLimit","offsetX","offsetY","opacity","path","points","r","radius","rx","ry","shadowColor","src","stroke","strokeOpacity","text","textAlign","textBaseline","textDecorationColor","textDecorationLine","textDecorationStyle","textOverflow","textPath","textPathSide","textPathStartOffset","transform","transformOrigin","visibility","width","wordWrap","wordWrapWidth","x","x1","x2","y","y1","y2","z1","z2","zIndex"];function WG(t){return GG.includes(t)}function zO(t){var e={};for(var n in t)WG(n)&&(e[n]=t[n]);return e}var kc=Fi({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function GO(t){return t.reduce(function(e,n,r){return e.push(dt([r===0?"M":"L"],D(n),!1)),e},[])}function YG(t,e,n){var r=e.connect,i=r===void 0?"line":r,a=e.center;if(i==="line")return GO(t);if(!a)return[];var o=ou(t[0],a),s=n?0:1;return t.reduce(function(c,l,u){return u===0?c.push(dt(["M"],D(l),!1)):c.push(dt(["A",o,o,0,0,s],D(l),!1)),c},[])}function vg(t,e,n){return e.type==="surround"?YG(t,e,n):GO(t)}function HG(t,e,n){var r=n.type,i=n.connect,a=n.center,o=n.closed,s=o?[["Z"]]:[],c=D([vg(t,n),vg(e.slice().reverse(),n,!0)],2),l=c[0],u=c[1],f=D([t[0],e.slice(-1)[0]],2),d=f[0],h=f[1],p=function(m,b){return[l,m,u,b,s].flat()};if(i==="line"||r==="surround")return p([dt(["L"],D(h),!1)],[dt(["L"],D(d),!1)]);if(!a)throw new Error("Arc grid need to specified center");var v=D([ou(h,a),ou(d,a)],2),g=v[0],y=v[1];return p([dt(["A",g,g,0,0,1],D(h),!1),dt(["L"],D(h),!1)],[dt(["A",y,y,0,0,0],D(d),!1),dt(["L"],D(d),!1)])}function $G(t,e,n,r){var i=n.animate,a=n.isBillboard,o=e.map(function(s,c){return{id:s.id||"grid-line-".concat(c),d:vg(s.points,n)}});return t.selectAll(kc.line.class).data(o,function(s){return s.id}).join(function(s){return s.append("path").each(function(c,l){var u=Bi(zO(Q({d:c.d},r)),[c,l,o]);this.attr(Q({class:kc.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:a},u))})},function(s){return s.transition(function(c,l){var u=Bi(zO(Q({d:c.d},r)),[c,l,o]);return ta(this,u,i.update)})},function(s){return s.transition(function(){var c=this,l=Ud(this,i.exit);return Pc(l,function(){return c.remove()}),l})}).transitions()}function VG(t,e,n){var r=n.animate,i=n.connect,a=n.areaFill;if(e.length<2||!a||!i)return[];for(var o=Array.isArray(a)?a:[a,"transparent"],s=function(p){return o[p%o.length]},c=[],l=0;l180?1:0,S=t>e?0:1,M=!1;return M?"M".concat(n,",").concat(r,",L").concat(p,",").concat(v,",A").concat(s,",").concat(c,",0,").concat(w,",").concat(S,",").concat(y,",").concat(m,",L").concat(n,",").concat(r):"M".concat(p,",").concat(v,",A").concat(s,",").concat(c,",0,").concat(w,",").concat(S,",").concat(y,",").concat(m)}function eW(t){var e=t.attributes,n=e.startAngle,r=e.endAngle,i=e.center,a=e.radius;return dt(dt([n,r],D(i),!1),[a],!1)}function nW(t,e,n,r){var i=e.startAngle,a=e.endAngle,o=e.center,s=e.radius;return t.selectAll(nn.line.class).data([{d:XO.apply(void 0,dt(dt([i,a],D(o),!1),[s],!1))}],function(c,l){return l}).join(function(c){return c.append("path").attr("className",nn.line.name).styles(e).styles({d:function(l){return l.d}})},function(c){return c.transition(function(){var l=this,u=QG(this,eW(this),dt(dt([i,a],D(o),!1),[s],!1),r.update);if(u){var f=function(){var d=Re(l.attributes,"__keyframe_data__");l.style.d=XO.apply(void 0,dt([],D(d),!1))};u.onframe=f,u.onfinish=f}return u}).styles(e)},function(c){return c.remove()}).styles(n).transitions()}function rW(t,e){var n=e.truncRange,r=e.truncShape,i=e.lineExtension}function iW(t,e,n){n===void 0&&(n=[0,0]);var r=D([t,e,n],3),i=D(r[0],2),a=i[0],o=i[1],s=D(r[1],2),c=s[0],l=s[1],u=D(r[2],2),f=u[0],d=u[1],h=D([c-a,l-o],2),p=h[0],v=h[1],g=Math.sqrt(Math.pow(p,2)+Math.pow(v,2)),y=D([-f/g,d/g],2),m=y[0],b=y[1];return[m*p,m*v,b*p,b*v]}function qO(t){var e=D(t,2),n=D(e[0],2),r=n[0],i=n[1],a=D(e[1],2),o=a[0],s=a[1];return{x1:r,y1:i,x2:o,y2:s}}function aW(t,e,n,r){var i=e.showTrunc,a=e.startPos,o=e.endPos,s=e.truncRange,c=e.lineExtension,l=D([a,o],2),u=D(l[0],2),f=u[0],d=u[1],h=D(l[1],2),p=h[0],v=h[1],g=D(c?iW(a,o,c):new Array(4).fill(0),4),y=g[0],m=g[1],b=g[2],_=g[3],x=function(R){return t.selectAll(nn.line.class).data(R,function(I,z){return z}).join(function(I){return I.append("line").attr("className",function(z){return"".concat(nn.line.name," ").concat(z.className)}).styles(n).transition(function(z){return ta(this,qO(z.line),!1)})},function(I){return I.styles(n).transition(function(z){var W=z.line;return ta(this,qO(W),r.update)})},function(I){return I.remove()}).transitions()};if(!i||!s)return x([{line:[[f+y,d+m],[p+b,v+_]],className:nn.line.name}]);var O=D(s,2),w=O[0],S=O[1],M=p-f,E=v-d,A=D([f+M*w,d+E*w],2),C=A[0],P=A[1],T=D([f+M*S,d+E*S],2),k=T[0],N=T[1],F=x([{line:[[f+y,d+m],[C,P]],className:nn.lineFirst.name},{line:[[k,N],[p+b,v+_]],className:nn.lineSecond.name}]);return rW(t,e),F}function oW(t,e,n,r){var i=n.showArrow,a=n.showTrunc,o=n.lineArrow,s=n.lineArrowOffset,c=n.lineArrowSize,l;if(e==="arc"?l=t.select(nn.line.class):a?l=t.select(nn.lineSecond.class):l=t.select(nn.line.class),!i||!o||n.type==="arc"&&UO(n.startAngle,n.endAngle)){var u=l.node();u&&(u.style.markerEnd=void 0);return}var f=ws(o);f.attr(r),yg(f,c,!0),l.style("markerEnd",f).style("markerEndOffset",-s)}function sW(t,e,n){var r=e.type,i,a=Oe(e,"line");return r==="linear"?i=aW(t,e,WO(a,"arrow"),n):i=nW(t,e,WO(a,"arrow"),n),oW(t,r,e,a),i}function cW(t,e){return bg(t,e.gridDirection,e)}function ZO(t){var e=t.type,n=t.gridCenter;return e==="linear"?n:n||t.center}function lW(t,e){var n=e.gridLength;return t.map(function(r,i){var a=r.value,o=D(qd(a,e),2),s=o[0],c=o[1],l=D(Wa(cW(a,e),n),2),u=l[0],f=l[1];return{id:i,points:[[s,c],[s+u,c+f]]}})}function uW(t,e){var n=e.gridControlAngles,r=ZO(e);if(!r)throw new Error("grid center is not provide");if(t.length<2)throw new Error("Invalid grid data");if(!n||n.length===0)throw new Error("Invalid gridControlAngles");var i=D(r,2),a=i[0],o=i[1];return t.map(function(s,c){var l=s.value,u=D(qd(l,e),2),f=u[0],d=u[1],h=D([f-a,d-o],2),p=h[0],v=h[1],g=[];return n.forEach(function(y){var m=Tc(y),b=D([Math.cos(m),Math.sin(m)],2),_=b[0],x=b[1],O=p*_-v*x+a,w=p*x+v*_+o;g.push([O,w])}),{points:g,id:c}})}function fW(t,e,n,r){var i=Oe(n,"grid"),a=i.type,o=i.areaFill,s=ZO(n),c=mg(e,n.gridFilter),l=a==="segment"?lW(c,n):uW(c,n),u=Q(Q({},i),{center:s,areaFill:Kr(o)?c.map(function(f,d){return Bi(o,[f,d,c])}):o,animate:r,data:l});return t.selectAll(nn.grid.class).data([1]).join(function(f){return f.append(function(){return new XG({style:u})}).attr("className",nn.grid.name)},function(f){return f.transition(function(){return this.update(u)})},function(f){return f.remove()}).transitions()}function Er(t,e,n,r,i){return r===void 0&&(r=!0),i===void 0&&(i=!1),r&&t===e||i&&t===n?!0:t>e&&ti&&(r=n,o(1),++e),n[s]=c}function o(s){e=0,n=Object.create(null),s||(r=Object.create(null))}return o(),{clear:o,has:function(s){return n[s]!==void 0||r[s]!==void 0},get:function(s){var c=n[s];if(c!==void 0)return c;if((c=r[s])!==void 0)return a(s,c),c},set:function(s,c){n[s]!==void 0?n[s]=c:a(s,c)}}}var hW=function(t,e,n){if(n===void 0&&(n=128),!Kr(t))throw new TypeError("Expected a function");var r=function(){for(var i=[],a=0;a0,m=r-c,b=i-l,_=d*b-h*m;if(_<0===y)return!1;var x=p*b-v*m;return!(x<0===y||_>g===y||x>g===y)}function rw(t,e){var n=[[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]]];return n.some(function(r){return nw(e,r)})}var Lgt={lineToLine:nw,intersectBoxLine:rw,getBounds:Kd};function xW(t,e,n){var r,i,a=Kd(t,n).flat(1),o=Kd(e,n).flat(1),s=[[a[0],a[1],a[2],a[3]],[a[0],a[1],a[4],a[5]],[a[4],a[5],a[6],a[7]],[a[2],a[3],a[6],a[7]]];try{for(var c=jr(s),l=c.next();!l.done;l=c.next()){var u=l.value;if(rw(o,u))return!0}}catch(f){r={error:f}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}return!1}function OW(t,e){var n=t.type,r=t.labelDirection,i=t.crossSize;if(!i)return!1;if(n==="arc"){var a=t.center,o=t.radius,s=D(a,2),c=s[0],l=s[1],u=r==="negative"?0:i,f=-o-u,d=o+u,h=D(Ar(e),4),p=h[0],v=h[1],g=h[2],y=h[3];return new Og(c+f-y,l+f-p,c+d+v,l+d+g)}var m=D(t.startPos,2),b=m[0],_=m[1],x=D(t.endPos,2),O=x[0],w=x[1],S=D(VO(t)?[-e,0,e,0]:[0,e,0,-e],4),M=S[0],E=S[1],A=S[2],C=S[3],P=su(0,t),T=Wa(P,i),k=new Og(b,_,O,w);return k.x1+=C,k.y1+=M,k.x2+=E+T[0],k.y2+=A+T[1],k}function Qd(t,e,n){var r,i,a=e.crossPadding,o=new Set,s=null,c=OW(e,a),l=function(p){return c?_W(c,p):!0},u=function(p,v){return!p||!p.firstChild?!0:!xW(p.firstChild,v.firstChild,Ar(n))};try{for(var f=jr(t),d=f.next();!d.done;d=f.next()){var h=d.value;l(h)?!s||u(s,h)?s=h:(o.add(s),o.add(h)):o.add(h)}}catch(p){r={error:p}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}return Array.from(o)}function wg(t,e){return e===void 0&&(e={}),ie(t)?0:typeof t=="number"?t:Math.floor(pW(t,e))}function wW(t,e,n,r){if(!(t.length<=1)){var i=e.suffix,a=i===void 0?"...":i,o=e.minLength,s=e.maxLength,c=s===void 0?1/0:s,l=e.step,u=l===void 0?" ":l,f=e.margin,d=f===void 0?[0,0,0,0]:f,h=KO(r.getTextShape(t[0])),p=wg(u,h),v=o?wg(o,h):p,g=wg(c,h);(ie(g)||g===1/0)&&(g=Math.max.apply(null,t.map(function(T){return T.getBBox().width})));for(var y=t.slice(),m=D(d,4),b=m[0],_=b===void 0?0:b,x=m[1],O=x===void 0?0:x,w=m[2],S=w===void 0?_:w,M=m[3],E=M===void 0?O:M,A=function(T){if(y.forEach(function(k){r.ellipsis(r.getTextShape(k),T,a)}),y=Qd(t,n,d),y.length<1)return{value:void 0}},C=g;C>v+p;C-=p){var P=A(C);if(typeof P=="object")return P.value}}}function Ngt(t){var e=t&&t.getRenderBounds();if(!e)return{width:0,height:0};var n=e.getMax(),r=e.getMin();return{width:n[0]-r[0],height:n[1]-r[1]}}function iw(t){var e=t.getLocalBounds(),n=e.min,r=e.max,i=D([n,r],2),a=D(i[0],2),o=a[0],s=a[1],c=D(i[1],2),l=c[0],u=c[1];return{x:o,y:s,width:l-o,height:u-s,left:o,bottom:u,top:s,right:l}}function jgt(t,e){var n=select(t).append("text").node();return n.attr(__assign(__assign({},e),{visibility:"hidden"})),n}function SW(t,e){var n=D(t,2),r=n[0],i=n[1],a=D(e,2),o=a[0],s=a[1];return r!==o&&i===s}function Rgt(t,e){var n=__read(t,2),r=n[0],i=n[1],a=__read(e,2),o=a[0],s=a[1];return r===o&&i!==s}function MW(t,e){var n,r,i=e.attributes;try{for(var a=jr(Object.entries(i)),o=a.next();!o.done;o=a.next()){var s=D(o.value,2),c=s[0],l=s[1];c!=="id"&&c!=="className"&&t.attr(c,l)}}catch(u){n={error:u}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}var EW={parity:function(t,e){var n=e.seq,r=n===void 0?2:n;return t.filter(function(i,a){return a%r?(xo(i),!1):!0})}},AW=function(t){return t.filter(ew)};function PW(t,e,n,r){var i=t.length,a=e.keepHeader,o=e.keepTail;if(!(i<=1||i===2&&a&&o)){var s=EW.parity,c=function(b){return b.forEach(r.show),b},l=2,u=t.slice(),f=t.slice(),d=Math.min.apply(Math,dt([1],D(t.map(function(b){return b.getBBox().width})),!1));if(n.type==="linear"&&($O(n)||VO(n))){var h=iw(t[0]).left,p=iw(t[i-1]).right,v=Math.abs(p-h)||1;l=Math.max(Math.floor(i*d/v),l)}var g,y;for(a&&(g=u.splice(0,1)[0]),o&&(y=u.splice(-1,1)[0],u.reverse()),c(u);ls)){for(var y=h;y<=s;y++)if(g(y),p())return;l&&g(d)}}var LW=new Map([["hide",PW],["rotate",TW],["ellipsis",wW],["wrap",CW]]);function NW(t,e,n){return e.labelOverlap.length<1?!1:n==="hide"?!kG(t[0]):n==="rotate"?!t.some(function(r){var i;return!!(!((i=r.attr("transform"))===null||i===void 0)&&i.includes("rotate"))}):n==="ellipsis"||n==="wrap"?t.filter(function(r){return r.querySelector("text")}).length>1:!0}function jW(t,e,n){var r=e.labelOverlap,i=r===void 0?[]:r;i.length&&i.forEach(function(a){var o=a.type,s=LW.get(o);NW(t,e,o)&&(s==null||s(t,a,e,n))})}function RW(){for(var t=[],e=0;e=this.left&&e<=this.right&&n>=this.top&&n<=this.bottom},t}();function Igt(t){var e=t.getRenderBounds(),n=__read(e.min,2),r=n[0],i=n[1],a=__read(e.max,2),o=a[0],s=a[1],c=o-r,l=s-i;return new Mn(r,i,c,l)}var hw=Fi({text:"text"},"title");function Jd(t){return/\S+-\S+/g.test(t)?t.split("-").map(function(e){return e[0]}):t.length>2?[t[0]]:t.split("")}function VW(t,e){var n=t.attributes,r=n.position,i=n.spacing,a=n.inset,o=n.text,s=t.getBBox(),c=e.getBBox(),l=Jd(r),u=D(Ar(o?i:0),4),f=u[0],d=u[1],h=u[2],p=u[3],v=D(Ar(a),4),g=v[0],y=v[1],m=v[2],b=v[3],_=D([p+d,f+h],2),x=_[0],O=_[1],w=D([b+y,g+m],2),S=w[0],M=w[1];if(l[0]==="l")return new Mn(s.x,s.y,c.width+s.width+x+S,Math.max(c.height+M,s.height));if(l[0]==="t")return new Mn(s.x,s.y,Math.max(c.width+S,s.width),c.height+s.height+O+M);var E=D([e.attributes.width||c.width,e.attributes.height||c.height],2),A=E[0],C=E[1];return new Mn(c.x,c.y,A+s.width+x+S,C+s.height+O+M)}function UW(t,e){var n=Object.entries(e).reduce(function(r,i){var a=D(i,2),o=a[0],s=a[1],c=t.node().attr(o);return c||(r[o]=s),r},{});t.styles(n)}function XW(t){var e,n,r,i,a=t,o=a.width,s=a.height,c=a.position,l=D([+o/2,+s/2],2),u=l[0],f=l[1],d=D([+u,+f,"center","middle"],4),h=d[0],p=d[1],v=d[2],g=d[3],y=Jd(c);return y.includes("l")&&(e=D([0,"start"],2),h=e[0],v=e[1]),y.includes("r")&&(n=D([+o,"end"],2),h=n[0],v=n[1]),y.includes("t")&&(r=D([0,"top"],2),p=r[0],g=r[1]),y.includes("b")&&(i=D([+s,"bottom"],2),p=i[0],g=i[1]),{x:h,y:p,textAlign:v,textBaseline:g}}var pw=function(t){It(e,t);function e(n){return t.call(this,n,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"})||this}return e.prototype.getAvailableSpace=function(){var n=this,r=this.attributes,i=r.width,a=r.height,o=r.position,s=r.spacing,c=r.inset,l=n.querySelector(hw.text.class);if(!l)return new Mn(0,0,+i,+a);var u=l.getBBox(),f=u.width,d=u.height,h=D(Ar(s),4),p=h[0],v=h[1],g=h[2],y=h[3],m=D([0,0,+i,+a],4),b=m[0],_=m[1],x=m[2],O=m[3],w=Jd(o);if(w.includes("i"))return new Mn(b,_,x,O);w.forEach(function(N,F){var R,I,z,W;N==="t"&&(R=D(F===0?[d+g,+a-d-g]:[0,+a],2),_=R[0],O=R[1]),N==="r"&&(I=D([+i-f-y],1),x=I[0]),N==="b"&&(z=D([+a-d-p],1),O=z[0]),N==="l"&&(W=D(F===0?[f+v,+i-f-v]:[0,+i],2),b=W[0],x=W[1])});var S=D(Ar(c),4),M=S[0],E=S[1],A=S[2],C=S[3],P=D([C+E,M+A],2),T=P[0],k=P[1];return new Mn(b+C,_+M,x-T,O-k)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new Mn(0,0,0,0)},e.prototype.render=function(n,r){var i=this,a=n.width,o=n.height,s=n.position,c=n.spacing,l=On(n,["width","height","position","spacing"]),u=D(Ya(l),1),f=u[0],d=XW(n),h=d.x,p=d.y,v=d.textAlign,g=d.textBaseline;hi(!!l.text,de(r),function(y){i.title=y.maybeAppendByClassName(hw.text,"text").styles(f).call(UW,{x:h,y:p,textAlign:v,textBaseline:g}).node()})},e}(yr);function qW(t,e,n){var r=n.titlePosition,i=r===void 0?"lb":r,a=n.titleSpacing,o=Jd(i),s=t.node().getLocalBounds(),c=D(s.min,2),l=c[0],u=c[1],f=D(s.halfExtents,2),d=f[0],h=f[1],p=D(e.node().getLocalBounds().halfExtents,2),v=p[0],g=p[1],y=D([l+d,u+h],2),m=y[0],b=y[1],_=D(Ar(a),4),x=_[0],O=_[1],w=_[2],S=_[3];if(["start","end"].includes(i)&&n.type==="linear"){var M=n.startPos,E=n.endPos,A=D(i==="start"?[M,E]:[E,M],2),C=A[0],P=A[1],T=DO([-P[0]+C[0],-P[1]+C[1]]),k=D(Wa(T,x),2),N=k[0],F=k[1];return{x:C[0]+N,y:C[1]+F}}return o.includes("t")&&(b-=h+g+x),o.includes("r")&&(m+=d+v+O),o.includes("l")&&(m-=d+v+S),o.includes("b")&&(b+=h+g+w),{x:m,y:b}}function ZW(t,e,n){var r=t.getGeometryBounds().halfExtents,i=r[1]*2;if(e==="vertical"){if(n==="left")return"rotate(-90) translate(0, ".concat(i/2,")");if(n==="right")return"rotate(-90) translate(0, -".concat(i/2,")")}return""}function vw(t,e,n,r,i){var a=Oe(r,"title"),o=D(Ya(a),2),s=o[0],c=o[1],l=c.transform,u=c.transformOrigin,f=On(c,["transform","transformOrigin"]);e.styles(f);var d=l||ZW(t.node(),s.direction,s.position);t.styles(Q(Q({},s),{transformOrigin:u})),tw(t.node(),d);var h=qW(de(n._offscreen||n.querySelector(nn.mainGroup.class)),e,r),p=h.x,v=h.y,g=ta(e.node(),{transform:"translate(".concat(p,", ").concat(v,")")},i);return g}function KW(t,e,n,r){var i=n.titleText;return t.selectAll(nn.title.class).data([{title:i}].filter(function(a){return!!a.title}),function(a,o){return a.title}).join(function(a){return a.append(function(){return ws(i)}).attr("className",nn.title.name).transition(function(){return vw(de(this),t,e,n,r.enter)})},function(a){return a.transition(function(){return vw(de(this),t,e,n,r.update)})},function(a){return a.remove()}).transitions()}function gw(t,e,n,r){var i=t.showLine,a=t.showTick,o=t.showLabel,s=e.maybeAppendByClassName(nn.lineGroup,"g"),c=hi(i,s,function(h){return sW(h,t,r)})||[],l=e.maybeAppendByClassName(nn.tickGroup,"g"),u=hi(a,l,function(h){return $W(h,n,t,r)})||[],f=e.maybeAppendByClassName(nn.labelGroup,"g"),d=hi(o,f,function(h){return zW(h,n,t,r)})||[];return dt(dt(dt([],D(c),!1),D(u),!1),D(d),!1).filter(function(h){return!!h})}var Mg=function(t){It(e,t);function e(n){return t.call(this,n,dg)||this}return e.prototype.render=function(n,r,i){var a=this,o=n.titleText,s=n.data,c=n.animate,l=n.showTitle,u=n.showGrid,f=n.dataThreshold,d=n.truncRange,h=LG(s,f).filter(function(x){var O=x.value;return!(d&&O>d[0]&&O-1;)oY.call(t,a,1);return t},Jgt=null,cY=Array.prototype.splice,tyt=function(e,n){if(!isArrayLike(e))return[];for(var r=e?n.length:0,i=r-1;r--;){var a=void 0,o=n[r];(r===i||o!==a)&&(a=o,cY.call(e,o,1))}return e},eyt=null,nyt=function(t,e,n){if(!isArray(t)&&!isPlainObject(t))return t;var r=n;return each(t,function(i,a){r=e(r,i,a)}),r},ryt=null,iyt=function(t,e){var n=[];if(!isArrayLike(t))return n;for(var r=-1,i=[],a=t.length;++ra[s])return 1;if(i[s]0},Lyt=null,Nyt=function(t,e){if(isArray(t)){for(var n,r=-1/0,i=0;ir&&(n=a,r=o)}return n}},jyt=function(t,e){if(isArray(t)){for(var n,r=1/0,i=0;is&&u>s);)if(c.push(l),s-=u,o=o.substr(i),!o)return c.join("");for(;l=o.substr(0,1),u=measureTextWidth(l,n),!(u+a>s);)if(c.push(l),s-=u,o=o.substr(1),!o)return c.join("");return""+c.join("")+r},mmt=function(){function t(){this.map={}}return t.prototype.has=function(e){return this.map[e]!==void 0},t.prototype.get=function(e,n){var r=this.map[e];return r===void 0?n:r},t.prototype.set=function(e,n){this.map[e]=n},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(e){delete this.map[e]},t.prototype.size=function(){return Object.keys(this.map).length},t}(),bmt=null;class fu{constructor(e){this.options=Sw({},this.getDefaultOptions()),this.update(e)}getOptions(){return this.options}update(e={}){this.options=Sw({},this.options,e),this.rescale(e)}rescale(e){}}function nh(t,e){return e-t?n=>(n-t)/(e-t):n=>.5}function Lc(t,...e){return e.reduce((n,r)=>i=>n(r(i)),t)}function Ag(t,e,n,r,i){let a=n||0,o=r||t.length;const s=i||(c=>c);for(;ae?o=c:a=c+1}return a}var CY=tt(19818),LY=tt.n(CY);function Pg(t,e,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function NY(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100,i=t[3];if(n===0)return[r*255,r*255,r*255,i];const a=r<.5?r*(1+n):r+n-r*n,o=2*r-a,s=Pg(o,a,e+1/3),c=Pg(o,a,e),l=Pg(o,a,e-1/3);return[s*255,c*255,l*255,i]}function Tw(t){const e=LY().get(t);if(!e)return null;const{model:n,value:r}=e;return n==="rgb"?r:n==="hsl"?NY(r):null}const Nc=(t,e)=>n=>t*(1-n)+e*n,jY=(t,e)=>{const n=Tw(t),r=Tw(e);return n===null||r===null?n?()=>t:()=>e:i=>{const a=new Array(4);for(let u=0;u<4;u+=1){const f=n[u],d=r[u];a[u]=f*(1-i)+d*i}const[o,s,c,l]=a;return`rgba(${Math.round(o)}, ${Math.round(s)}, ${Math.round(c)}, ${l})`}},du=(t,e)=>typeof t=="number"&&typeof e=="number"?Nc(t,e):typeof t=="string"&&typeof e=="string"?jY(t,e):()=>t,RY=(t,e)=>{const n=Nc(t,e);return r=>Math.round(n(r))};function rh(t){return!xY(t)&&!mY(t)&&!Number.isNaN(t)}const Tg=Math.sqrt(50),kg=Math.sqrt(10),Cg=Math.sqrt(2);function ih(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),a=r/ir(10,i);return i>=0?(a>=Tg?10:a>=kg?5:a>=Cg?2:1)*ir(10,i):-ir(10,-i)/(a>=Tg?10:a>=kg?5:a>=Cg?2:1)}function kw(t,e,n){const r=Math.abs(e-t)/Math.max(0,n);let i=ir(10,Math.floor(Math.log(r)/Math.LN10));const a=r/i;return a>=Tg?i*=10:a>=kg?i*=5:a>=Cg&&(i*=2),e{const r=[t,e];let i=0,a=r.length-1,o=r[i],s=r[a],c;return s0?(o=Math.floor(o/c)*c,s=Math.ceil(s/c)*c,c=ih(o,s,n)):c<0&&(o=Math.ceil(o*c)/c,s=Math.floor(s*c)/c,c=ih(o,s,n)),c>0?(r[i]=Math.floor(o/c)*c,r[a]=Math.ceil(s/c)*c):c<0&&(r[i]=Math.ceil(o*c)/c,r[a]=Math.floor(s*c)/c),r};function IY(t,e){const n=ee?t:e;return i=>Math.min(Math.max(n,i),r)}const DY=(t,e,n)=>{const[r,i]=t,[a,o]=e;let s,c;return r{const r=Math.min(t.length,e.length)-1,i=new Array(r),a=new Array(r),o=t[0]>t[r],s=o?[...t].reverse():t,c=o?[...e].reverse():e;for(let l=0;l{const u=Ag(t,l,1,r)-1,f=i[u],d=a[u];return Lc(d,f)(l)}},Lw=(t,e,n,r)=>(Math.min(t.length,e.length)>2?FY:DY)(t,e,r?RY:n);class ah extends fu{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Nc,tickCount:5}}map(e){return rh(e)?this.output(e):this.options.unknown}invert(e){return rh(e)?this.input(e):this.options.unknown}nice(){if(!this.options.nice)return;const[e,n,r,...i]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(e,n,r,...i)}getTicks(){const{tickMethod:e}=this.options,[n,r,i,...a]=this.getTickMethodOptions();return e(n,r,i,...a)}getTickMethodOptions(){const{domain:e,tickCount:n}=this.options,r=e[0],i=e[e.length-1];return[r,i,n]}chooseNice(){return Cw}rescale(){this.nice();const[e,n]=this.chooseTransforms();this.composeOutput(e,this.chooseClamp(e)),this.composeInput(e,n,this.chooseClamp(n))}chooseClamp(e){const{clamp:n,range:r}=this.options,i=this.options.domain.map(e),a=Math.min(i.length,r.length);return n?IY(i[0],i[a-1]):Ss}composeOutput(e,n){const{domain:r,range:i,round:a,interpolate:o}=this.options,s=Lw(r.map(e),i,o,a);this.output=Lc(s,n,e)}composeInput(e,n,r){const{domain:i,range:a}=this.options,o=Lw(a,i.map(e),Nc);this.input=Lc(n,r,o)}}const Ms=(t,e,n)=>{let r,i,a=t,o=e;if(a===o&&n>0)return[a];let s=ih(a,o,n);if(s===0||!Number.isFinite(s))return[];if(s>0){a=Math.ceil(a/s),o=Math.floor(o/s),i=new Array(r=Math.ceil(o-a+1));for(let c=0;c=i&&(n=r=i):(n>i&&(n=i),r=a&&(n=r=a):(n>a&&(n=a),rr&&(r=d),h>i&&(i=h)}return new Mn(e,n,r-e,i-n)}var GY=function(t,e,n){var r=t.width,i=t.height,a=n.flexDirection,o=a===void 0?"row":a,s=n.flexWrap,c=s===void 0?"nowrap":s,l=n.justifyContent,u=l===void 0?"flex-start":l,f=n.alignContent,d=f===void 0?"flex-start":f,h=n.alignItems,p=h===void 0?"flex-start":h,v=o==="row",g=o==="row"||o==="column",y=v?g?[1,0]:[-1,0]:g?[0,1]:[0,-1],m=D([0,0],2),b=m[0],_=m[1],x=e.map(function(P){var T,k=P.width,N=P.height,F=D([b,_],2),R=F[0],I=F[1];return T=D([b+k*y[0],_+N*y[1]],2),b=T[0],_=T[1],new Mn(R,I,k,N)}),O=jw(x),w={"flex-start":0,"flex-end":v?r-O.width:i-O.height,center:v?(r-O.width)/2:(i-O.height)/2},S=x.map(function(P){var T=P.x,k=P.y,N=Mn.fromRect(P);return N.x=v?T+w[u]:T,N.y=v?k:k+w[u],N}),M=jw(S),E=function(P){var T=D(v?["height",i]:["width",r],2),k=T[0],N=T[1];switch(p){case"flex-start":return 0;case"flex-end":return N-P[k];case"center":return N/2-P[k]/2;default:return 0}},A=S.map(function(P){var T=P.x,k=P.y,N=Mn.fromRect(P);return N.x=v?T:T+E(N),N.y=v?k+E(N):k,N}),C=A.map(function(P){var T,k,N=Mn.fromRect(P);return N.x+=(T=t.x)!==null&&T!==void 0?T:0,N.y+=(k=t.y)!==null&&k!==void 0?k:0,N});return C},WY=function(t,e,n){return[]},YY=function(t,e,n){if(e.length===0)return[];var r={flex:GY,grid:WY},i=n.display in r?r[n.display]:null;return(i==null?void 0:i.call(null,t,e,n))||[]},HY=function(t){It(e,t);function e(n){var r=t.call(this,n)||this;r.layoutEvents=[re.BOUNDS_CHANGED,re.INSERTED,re.REMOVED],r.$margin=Ar(0),r.$padding=Ar(0);var i=n.style||{},a=i.margin,o=a===void 0?0:a,s=i.padding,c=s===void 0?0:s;return r.margin=o,r.padding=c,r.isMutationObserved=!0,r.bindEvents(),r}return Object.defineProperty(e.prototype,"margin",{get:function(){return this.$margin},set:function(n){this.$margin=Ar(n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return this.$padding},set:function(n){this.$padding=Ar(n)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var n=this.attributes,r=n.x,i=r===void 0?0:r,a=n.y,o=a===void 0?0:a,s=n.width,c=n.height,l=D(this.$margin,4),u=l[0],f=l[1],d=l[2],h=l[3];return new Mn(i-h,o-u,s+h+f,c+u+d)},e.prototype.appendChild=function(n,r){return n.isMutationObserved=!0,t.prototype.appendChild.call(this,n,r),n},e.prototype.getAvailableSpace=function(){var n=this.attributes,r=n.width,i=n.height,a=D(this.$padding,4),o=a[0],s=a[1],c=a[2],l=a[3],u=D(this.$margin,4),f=u[0],d=u[3];return new Mn(l+d,o+f,r-l-s,i-o-c)},e.prototype.layout=function(){if(!(!this.attributes.display||!this.isConnected)&&!this.children.some(function(o){return!o.isConnected}))try{var n=this.attributes,r=n.x,i=n.y;this.style.transform="translate(".concat(r,", ").concat(i,")");var a=YY(this.getAvailableSpace(),this.children.map(function(o){return o.getBBox()}),this.attributes);this.children.forEach(function(o,s){var c=a[s],l=c.x,u=c.y;o.style.transform="translate(".concat(l,", ").concat(u,")")})}catch(o){}},e.prototype.bindEvents=function(){var n=this;this.layoutEvents.forEach(function(r){n.addEventListener(r,function(i){i.target.isMutationObserved=!0,n.layout()})})},e.prototype.attributeChangedCallback=function(n,r,i){n==="margin"?this.margin=i:n==="padding"&&(this.padding=i),this.layout()},e}(dr),$Y=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);ir.getOptions().name===e))===null||n===void 0?void 0:n[0]}function XY(t){return t==="horizontal"||t===0}function qY(t){return t==="vertical"||t===-Math.PI/2}function Fw(t,e,n){const{bbox:r}=t,{position:i="top",size:a,length:o}=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=a||u||c,h=o||f||l,p=s?"horizontal":"vertical",[v,g]=s?[h,d]:[d,h];return{orientation:p,width:v,height:g,size:d,length:h}}function ZY(t){return t.find(e=>e.getOptions().domain.length>0).getOptions().domain}function sh(t){const e=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"],{style:n}=t,r=$Y(t,["style"]),i={};return Object.entries(r).forEach(([a,o])=>{e.includes(a)?i[`show${mo(a)}`]=o:i[a]=o}),Object.assign(Object.assign({},i),n)}var Bw=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{if(!TO(e))return i;const a=t==="bottom"?[i,1]:[0,i],o=e.map(a);if(t==="bottom"){const s=o[0];return new Fr({domain:[0,n],range:[0,1]}).map(s)}else if(t==="left"){const s=o[1];return new Fr({domain:[0,r],range:[0,1]}).map(s)}return i}}function QY(t,e,n){if(t.getTicks)return t.getTicks();if(!n)return e;const[r,i]=Ha(e,o=>+o),{tickCount:a}=t.getOptions();return n(r,i,a)}function JY(t,e){if(fn(e))return h=>h;const n=e.getOptions(),{innerWidth:r,innerHeight:i,insetTop:a,insetBottom:o,insetLeft:s,insetRight:c}=n,[l,u,f]=t==="left"||t==="right"?[a,o,i]:[s,c,r],d=new Fr({domain:[0,1],range:[l/f,1-u/f]});return h=>d.map(h)}function Ww(t,e,n,r,i,a,o,s){var c;(n!==void 0||a!==void 0)&&t.update(Object.assign(Object.assign({},n&&{tickCount:n}),a&&{tickMethod:a}));const l=QY(t,e,a),u=i?l.filter(i):l,f=y=>y instanceof Date?String(y):typeof y=="object"&&y?y:String(y),d=r||((c=t.getFormatter)===null||c===void 0?void 0:c.call(t))||f,h=JY(o,s),p=KY(o,s),v=y=>["top","bottom","center","outer"].includes(y),g=y=>["left","right"].includes(y);return fn(s)||Sn(s)?u.map((y,m,b)=>{var _,x;const O=((_=t.getBandWidth)===null||_===void 0?void 0:_.call(t,y))/2||0,w=h(t.map(y)+O);return{value:nu(s)&&o==="center"||Sn(s)&&((x=t.getTicks)===null||x===void 0?void 0:x.call(t))&&v(o)||Sn(s)&&g(o)?1-w:w,label:f(d(Yd(y),m,b)),id:String(m)}}):u.map((y,m,b)=>{var _;const x=((_=t.getBandWidth)===null||_===void 0?void 0:_.call(t,y))/2||0,O=p(h(t.map(y)+x));return{value:g(o)?1-O:O,label:f(d(Yd(y),m,b)),id:String(m)}})}function tH(t,e,n="xy"){const[r,i,a]=Gw(e);return n==="xy"?t.includes("bottom")||t.includes("top")?i:r:n==="xz"?t.includes("bottom")||t.includes("top")?a:r:t.includes("bottom")||t.includes("top")?i:a}function eH(t=[],e){if(t.length>0)return t;const{labelAutoRotate:n,labelAutoHide:r,labelAutoEllipsis:i,labelAutoWrap:a}=e,o=[],s=(c,l)=>{l&&o.push(Object.assign(Object.assign({},c),l))};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},a),o}function nH(t,e,n,r,i){const{x:a,y:o,width:s,height:c}=e,l=[a+s/2,o+c/2],u=Math.min(s,c)/2,[f,d]=ug(i),[h,p]=Gw(i),v=Math.min(h,p)/2,g={center:l,radius:u,startAngle:f,endAngle:d,gridLength:(r-n)*v};if(t==="inner"){const{insetLeft:y,insetTop:m}=i.getOptions();return Object.assign(Object.assign({},g),{center:[l[0]-y,l[1]-m],labelAlign:"perpendicular",labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"})}return Object.assign(Object.assign({},g),{labelAlign:"parallel",labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"})}function rH(t,e,n){return kO(e)||ru(e)?!1:t===void 0?!!n.getTicks:t}function iH(t){const{depth:e}=t.getOptions();return e?{tickIsBillboard:!0,lineIsBillboard:!0,labelIsBillboard:!0,titleIsBillboard:!0,gridIsBillboard:!0}:{}}function aH(t,e,n,r,i){const{x:a,y:o,width:s,height:c}=n;if(t==="bottom")return{startPos:[a,o],endPos:[a+s,o]};if(t==="left")return{startPos:[a+s,o+c],endPos:[a+s,o]};if(t==="right")return{startPos:[a,o+c],endPos:[a,o]};if(t==="top")return{startPos:[a,o+c],endPos:[a+s,o+c]};if(t==="center"){if(e==="vertical")return{startPos:[a,o],endPos:[a,o+c]};if(e==="horizontal")return{startPos:[a,o],endPos:[a+s,o]};if(typeof e=="number"){const[l,u]=r.getCenter(),[f,d]=Hd(r),[h,p]=ug(r),v=Math.min(s,c)/2,{insetLeft:g,insetTop:y}=r.getOptions(),m=f*v,b=d*v,[_,x]=[l+a-g,u+o-y],[O,w]=[Math.cos(e),Math.sin(e)],S=[_+b*O,x+b*w],M=[_+m*O,x+m*w],E=()=>{const{domain:C}=i.getOptions();return C.length},A=fn(r)&&i?E():3;return{startPos:S,endPos:M,gridClosed:Math.abs(p-h-360)<1e-6,gridCenter:[_,x],gridControlAngles:new Array(A).fill(0).map((C,P,T)=>(p-h)/A*P)}}}return{}}const oH=t=>{const{order:e,size:n,position:r,orientation:i,labelFormatter:a,tickFilter:o,tickCount:s,tickMethod:c,important:l={},style:u={},indexBBox:f,title:d,grid:h=!1}=t,p=Bw(t,["order","size","position","orientation","labelFormatter","tickFilter","tickCount","tickMethod","important","style","indexBBox","title","grid"]);return({scales:[v],value:g,coordinate:y,theme:m})=>{const{bbox:b}=g,{domain:_}=v.getOptions(),x=Ww(v,_,s,a,o,c,r,y),O=f?x.map((P,T)=>{const k=f.get(T);return!k||k[0]!==P.label?P:Object.assign(Object.assign({},P),{bbox:k[1]})}):x,[w,S]=Hd(y),M=nH(r,b,w,S,y),{axis:E,axisArc:A={}}=m,C=sh(at({},E,A,M,Object.assign(Object.assign({type:"arc",data:O,titleText:oh(d),grid:h},p),l)));return new Mg({style:Es(C,["transform"])})}};function sH(t,e,n,r,i,a){const o=n.axis,s=["top","right","bottom","left"].includes(i)?n[`axis${rg(i)}`]:n.axisLinear,c=t.getOptions().name,l=n[`axis${mo(c)}`]||{};return Object.assign({},o,s,l)}function cH(t,e,n,r,i,a){const o=sH(t,e,n,r,i,a);return i==="center"?Object.assign(Object.assign(Object.assign(Object.assign({},o),{labelDirection:r==="right"?"negative":"positive"}),r==="center"?{labelTransform:"translate(50%,0)"}:null),{tickDirection:r==="right"?"negative":"positive",labelSpacing:r==="center"?0:4,titleSpacing:qY(a)?10:0,tick:r==="center"?!1:void 0}):o}const lH=t=>{const{direction:e="left",important:n={},labelFormatter:r,order:i,orientation:a,actualPosition:o,position:s,size:c,style:l={},title:u,tickCount:f,tickFilter:d,tickMethod:h,transform:p,indexBBox:v}=t,g=Bw(t,["direction","important","labelFormatter","order","orientation","actualPosition","position","size","style","title","tickCount","tickFilter","tickMethod","transform","indexBBox"]);return({scales:y,value:m,coordinate:b,theme:_})=>{const{bbox:x}=m,[O]=y,{domain:w,xScale:S}=O.getOptions(),M=cH(O,b,_,e,s,a),E=Object.assign(Object.assign(Object.assign({},M),l),g),A=tH(o||s,b,t.plane),C=aH(s,a,x,b,S),P=iH(b),T=Ww(O,w,f,r,d,h,s,b),k=v?T.map((R,I)=>{const z=v.get(I);return!z||z[0]!==R.label?R:Object.assign(Object.assign({},R),{bbox:z[1]})}):T,N=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},E),{type:"linear",data:k,crossSize:c,titleText:oh(u),labelOverlap:eH(p,E),grid:rH(E.grid,b,O),gridLength:A,line:!0,indexBBox:v}),E.line?null:{lineOpacity:0}),C),P),n);return N.labelOverlap.find(R=>R.type==="hide")&&(N.crossSize=!1),new Mg({className:"axis",style:sh(N)})}},Yw=t=>e=>{const{labelFormatter:n,labelFilter:r=()=>!0}=e;return i=>{var a;const{scales:[o]}=i,s=((a=o.getTicks)===null||a===void 0?void 0:a.call(o))||o.getOptions().domain,c=typeof n=="string"?bo(n):n,l=(f,d,h)=>r(s[d],d,s),u=Object.assign(Object.assign({},e),{labelFormatter:c,labelFilter:l,scale:o});return t(u)(i)}},Oo=Yw(lH),Hw=Yw(oH);Oo.props={defaultPosition:"center",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]},Hw.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]};var uH=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i-Math.PI/2&&eMath.PI/2&&e(c-s)/i.count*f)})}const $w=t=>{const{important:e={}}=t,n=uH(t,["important"]);return r=>{const{theme:i,coordinate:a,scales:o}=r;return Oo(Object.assign(Object.assign(Object.assign({},n),fH(t.orientation)),{important:Object.assign(Object.assign({},dH(t,i,a,o)),e)}))(r)}};$w.props=Object.assign(Object.assign({},Oo.props),{defaultPosition:"center"});function ch(t,e){return+t.toPrecision(e)}function _mt(t){return t.toLocaleString()}function xmt(t){return t.toExponential()}function Omt(t,e){return e===void 0&&(e=0),Math.abs(t)<1e3?String(t):"".concat(ch(t/1e3,e).toLocaleString(),"K")}var wmt=function(t,e,n){return t<0&&Number.isFinite(t)?e:n},Smt=function(t,e,n){return t>0&&Number.isFinite(t)?e:n},Mmt=function(t,e){return t*e},Emt=function(t,e){return t/2+(e||0)/2};function lh(t){var e=t.canvas,n=t.touches,r=t.offsetX,i=t.offsetY;if(e){var a=e.x,o=e.y;return[a,o]}if(n){var s=n[0],c=s.clientX,l=s.clientY;return[c,l]}return r&&i?[r,i]:[0,0]}var hH={backgroundFill:"#262626",backgroundLineCap:"round",backgroundLineWidth:1,backgroundStroke:"#333",backgroundZIndex:-1,formatter:function(t){return t.toString()},labelFill:"#fff",labelFontSize:12,labelTextBaseline:"middle",padding:[2,4],position:"right",radius:0,zIndex:999},Ng=Fi({background:"background",labelGroup:"label-group",label:"label"},"indicator"),pH=function(t){It(e,t);function e(n){var r=t.call(this,n,hH)||this;return r.point=[0,0],r.group=r.appendChild(new dr({})),r.isMutationObserved=!0,r}return e.prototype.renderBackground=function(){if(this.label){var n=this.attributes,r=n.position,i=n.padding,a=D(Ar(i),4),o=a[0],s=a[1],c=a[2],l=a[3],u=this.label.node().getLocalBounds(),f=u.min,d=u.max,h=new Mn(f[0]-l,f[1]-o,d[0]+s-f[0]+l,d[1]+c-f[1]+o),p=this.getPath(r,h),v=Oe(this.attributes,"background");this.background=de(this.group).maybeAppendByClassName(Ng.background,"path").styles(Q(Q({},v),{d:p})),this.group.appendChild(this.label.node())}},e.prototype.renderLabel=function(){var n=this.attributes,r=n.formatter,i=n.labelText,a=Oe(this.attributes,"label"),o=D(Ya(a),2),s=o[0],c=o[1],l=s.text,u=On(s,["text"]);if(this.label=de(this.group).maybeAppendByClassName(Ng.labelGroup,"g").styles(c),!!i){var f=this.label.maybeAppendByClassName(Ng.label,function(){return ws(r(i))}).style("text",r(i).toString());f.selectAll("text").styles(u)}},e.prototype.adjustLayout=function(){var n=D(this.point,2),r=n[0],i=n[1],a=this.attributes,o=a.x,s=a.y;this.group.attr("transform","translate(".concat(o-r,", ").concat(s-i,")"))},e.prototype.getPath=function(n,r){var i=this.attributes.radius,a=r.x,o=r.y,s=r.width,c=r.height,l=[["M",a+i,o],["L",a+s-i,o],["A",i,i,0,0,1,a+s,o+i],["L",a+s,o+c-i],["A",i,i,0,0,1,a+s-i,o+c],["L",a+i,o+c],["A",i,i,0,0,1,a,o+c-i],["L",a,o+i],["A",i,i,0,0,1,a+i,o],["Z"]],u={top:4,right:6,bottom:0,left:2},f=u[n],d=this.createCorner([l[f].slice(-2),l[f+1].slice(-2)]);return l.splice.apply(l,dt([f+1,1],D(d),!1)),l[0][0]="M",l},e.prototype.createCorner=function(n,r){r===void 0&&(r=10);var i=.8,a=SW.apply(void 0,dt([],D(n),!1)),o=D(n,2),s=D(o[0],2),c=s[0],l=s[1],u=D(o[1],2),f=u[0],d=u[1],h=D(a?[f-c,[c,f]]:[d-l,[l,d]],2),p=h[0],v=D(h[1],2),g=v[0],y=v[1],m=p/2,b=p/Math.abs(p),_=r*b,x=_/2,O=_*Math.sqrt(3)/2*i,w=D([g,g+m-x,g+m,g+m+x,y],5),S=w[0],M=w[1],E=w[2],A=w[3],C=w[4];return a?(this.point=[E,l-O],[["L",S,l],["L",M,l],["L",E,l-O],["L",A,l],["L",C,l]]):(this.point=[c+O,E],[["L",c,S],["L",c,M],["L",c+O,E],["L",c,A],["L",c,C]])},e.prototype.applyVisibility=function(){var n=this.attributes.visibility;n==="hidden"?xo(this):iu(this)},e.prototype.bindEvents=function(){this.label.on(re.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},e}(yr),Vw={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},Uw={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},Xw={x:0,y:0,orientation:"horizontal",showLabel:!0,type:"start"},_a=Fi({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),wo=Fi({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),vH=function(t){It(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(n,r){var i=n.x,a=n.y,o=n.size,s=o===void 0?10:o,c=n.radius,l=c===void 0?s/4:c,u=n.orientation,f=On(n,["x","y","size","radius","orientation"]),d=s,h=d*2.4,p=de(r).maybeAppendByClassName(wo.iconRect,"rect").styles(Q(Q({},f),{width:d,height:h,radius:l,x:i-d/2,y:a-h/2,transformOrigin:"center"})),v=i+1/3*d-d/2,g=i+2/3*d-d/2,y=a+1/4*h-h/2,m=a+3/4*h-h/2;p.maybeAppendByClassName("".concat(wo.iconLine,"-1"),"line").styles(Q({x1:v,x2:v,y1:y,y2:m},f)),p.maybeAppendByClassName("".concat(wo.iconLine,"-2"),"line").styles(Q({x1:g,x2:g,y1:y,y2:m},f)),u==="vertical"&&(p.node().style.transform="rotate(90)")},e}(yr),qw=function(t){It(e,t);function e(n){return t.call(this,n,Xw)||this}return e.prototype.renderLabel=function(n){var r=this,i=this.attributes,a=i.x,o=i.y,s=i.showLabel,c=Oe(this.attributes,"label"),l=c.x,u=l===void 0?0:l,f=c.y,d=f===void 0?0:f,h=c.transform,p=c.transformOrigin,v=On(c,["x","y","transform","transformOrigin"]),g=D(Ya(v,[]),2),y=g[0],m=g[1],b=de(n).maybeAppendByClassName(wo.labelGroup,"g").styles(m),_=Q(Q({},Uw),y),x=_.text,O=On(_,["text"]);hi(!!s,b,function(w){r.label=w.maybeAppendByClassName(wo.label,"text").styles(Q(Q({},O),{x:a+u,y:o+d,transform:h,transformOrigin:p,text:"".concat(x)})),r.label.on("mousedown",function(S){S.stopPropagation()}),r.label.on("touchstart",function(S){S.stopPropagation()})})},e.prototype.renderIcon=function(n){var r=this.attributes,i=r.x,a=r.y,o=r.orientation,s=r.type,c=Q(Q({x:i,y:a,orientation:o},Vw),Oe(this.attributes,"icon")),l=this.attributes.iconShape,u=l===void 0?function(){return new vH({style:c})}:l,f=de(n).maybeAppendByClassName(wo.iconGroup,"g");f.selectAll(wo.icon.class).data([u]).join(function(d){return d.append(typeof u=="string"?u:function(){return u(s)}).attr("className",wo.icon.name)},function(d){return d.update(c)},function(d){return d.remove()})},e.prototype.render=function(n,r){this.renderIcon(r),this.renderLabel(r)},e}(yr),Zw=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"]]},gH=Zw,yH=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"]]},mH=function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]},bH=function(t,e,n){var r=n*Math.sin(.3333333333333333*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]},_H=function(t,e,n){var r=n*Math.sin(.3333333333333333*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]},xH=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"]]},OH=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"]]},Kw=function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},wH=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]]},SH=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]]},MH=function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]},EH=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},Qw=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},AH=Qw,PH=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]]},TH=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]]},kH=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]]},CH=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]]};function LH(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 NH=function(t,e,n){return[["M",t-n,e-n],["L",t+n,e],["L",t-n,e+n],["Z"]]};function jH(t){var e="default";if(cs(t)&&t instanceof Image)e="image";else if(Kr(t))e="symbol";else if(kn(t)){var n=new RegExp("data:(image|text)");t.match(n)?e="base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(t)?e="url":e="symbol"}return e}function RH(t){var e=jH(t);return["base64","url","image"].includes(e)?"image":t&&e==="symbol"?"path":null}var He=function(t){It(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(n,r){var i=n.x,a=i===void 0?0:i,o=n.y,s=o===void 0?0:o,c=this.getSubShapeStyle(n),l=c.symbol,u=c.size,f=u===void 0?16:u,d=On(c,["symbol","size"]),h=RH(l);hi(!!h,de(r),function(p){p.maybeAppendByClassName("marker",h).attr("className","marker ".concat(h,"-marker")).call(function(v){if(h==="image"){var g=f*2;v.styles({img:l,width:g,height:g,x:a-f,y:s-f})}else{var g=f/2,y=Kr(l)?l:e.getSymbol(l);v.styles(Q({d:y==null?void 0:y(a,s,g)},d))}})})},e.MARKER_SYMBOL_MAP=new Map,e.registerSymbol=function(n,r){e.MARKER_SYMBOL_MAP.set(n,r)},e.getSymbol=function(n){return e.MARKER_SYMBOL_MAP.get(n)},e.getSymbols=function(){return Array.from(e.MARKER_SYMBOL_MAP.keys())},e}(yr);He.registerSymbol("cross",wH),He.registerSymbol("hyphen",EH),He.registerSymbol("line",Kw),He.registerSymbol("plus",MH),He.registerSymbol("tick",SH),He.registerSymbol("circle",Zw),He.registerSymbol("point",gH),He.registerSymbol("bowtie",OH),He.registerSymbol("hexagon",xH),He.registerSymbol("square",yH),He.registerSymbol("diamond",mH),He.registerSymbol("triangle",bH),He.registerSymbol("triangle-down",_H),He.registerSymbol("line",Kw),He.registerSymbol("dot",Qw),He.registerSymbol("dash",AH),He.registerSymbol("smooth",PH),He.registerSymbol("hv",TH),He.registerSymbol("vh",kH),He.registerSymbol("hvh",CH),He.registerSymbol("vhv",LH);function IH(t,e,n){var r=Math.round((t-n)/e);return n+r*e}function DH(t,e,n){var r=1.4,i=r*n;return[["M",t-n,e-i],["L",t+n,e-i],["L",t+n,e+i],["L",t-n,e+i],["Z"]]}var Jw=1.4,tS=.4;function FH(t,e,n){var r=n,i=r*Jw,a=r/2,o=r/6,s=t+i*tS;return[["M",t,e],["L",s,e+a],["L",t+i,e+a],["L",t+i,e-a],["L",s,e-a],["Z"],["M",s,e+o],["L",t+i-2,e+o],["M",s,e-o],["L",t+i-2,e-o]]}function BH(t,e,n){var r=n,i=r*Jw,a=r/2,o=r/6,s=e+i*tS;return[["M",t,e],["L",t-a,s],["L",t-a,e+i],["L",t+a,e+i],["L",t+a,s],["Z"],["M",t-o,s],["L",t-o,e+i-2],["M",t+o,s],["L",t+o,e+i-2]]}He.registerSymbol("hiddenHandle",DH),He.registerSymbol("verticalHandle",FH),He.registerSymbol("horizontalHandle",BH);var Amt=function(t,e,n){return t===void 0&&(t="horizontal"),t==="horizontal"?e:n};function zH(t,e,n,r){var i;r===void 0&&(r=4);var a=D(t,2),o=a[0],s=a[1],c=D(e,2),l=c[0],u=c[1],f=D(n,2),d=f[0],h=f[1],p=D([l,u],2),v=p[0],g=p[1],y=g-v;return v>g&&(i=D([g,v],2),v=i[0],g=i[1]),y>s-o?[o,s]:vs?h===s&&d===v?[v,s]:[s-y,s]:[v,g]}function xa(t,e,n){return t===void 0&&(t="horizontal"),t==="horizontal"?e:n}var hu=Fi({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),eS={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},GH=function(t){It(e,t);function e(n){return t.call(this,n,eS)||this}return e.prototype.render=function(n,r){var i=de(r).maybeAppendByClassName(hu.markerGroup,"g");this.renderMarker(i);var a=de(r).maybeAppendByClassName(hu.labelGroup,"g");this.renderLabel(a)},e.prototype.renderMarker=function(n){var r=this,i=this.attributes,a=i.orientation,o=i.markerSymbol,s=o===void 0?xa(a,"horizontalHandle","verticalHandle"):o;hi(!!s,n,function(c){var l=Oe(r.attributes,"marker"),u=Q({symbol:s},l);r.marker=c.maybeAppendByClassName(hu.marker,function(){return new He({style:u})}).update(u)})},e.prototype.renderLabel=function(n){var r=this,i=this.attributes,a=i.showLabel,o=i.orientation,s=i.spacing,c=s===void 0?0:s,l=i.formatter;hi(a,n,function(u){var f,d=Oe(r.attributes,"label"),h=d.text,p=On(d,["text"]),v=((f=u.select(hu.marker.class))===null||f===void 0?void 0:f.node().getBBox())||{},g=v.width,y=g===void 0?0:g,m=v.height,b=m===void 0?0:m,_=D(xa(o,[0,b+c,"center","top"],[y+c,0,"start","middle"]),4),x=_[0],O=_[1],w=_[2],S=_[3];u.maybeAppendByClassName(hu.label,"text").styles(Q(Q({},p),{x,y:O,text:l(h).toString(),textAlign:w,textBaseline:S}))})},e}(yr),nS={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},WH=Ga({},nS,{}),YH=Ga({},nS,ma(eS,"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"}),HH=.01,Pmt=.5,Pr=Fi({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");function $H(t,e){for(var n=1;n=r&&e<=i)return[r,i]}return[e,e]}function VH(t,e,n){var r=Array.from(e),i=t.length;return new Array(i).fill(0).reduce(function(a,o,s){var c=r[s%r.length];return a+=" ".concat(t[s],":").concat(c).concat(s(r+i)/2?i:r,range:[r,i]}}var pu=Fi({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function iS(t){var e=t.orientation,n=t.size,r=t.length;return xa(e,[r,n],[n,r])}function aS(t){var e=t.type,n=D(iS(t),2),r=n[0],i=n[1];return e==="size"?[["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 UH(t){return aS(t)}function XH(t){var e=t.orientation,n=t.color,r=t.block,i=t.partition,a;if(Kr(n)){var o=20;a=new Array(o).fill(0).map(function(l,u,f){return n(u/(f.length-1))})}else a=n;var s=a.length,c=a.map(function(l){return Ia(l).toString()});return s?s===1?c[0]:r?VH(i,c,e):c.reduce(function(l,u,f){return l+=" ".concat(f/(s-1),":").concat(u)},"l(".concat(xa(e,"0","270"),")")):""}function qH(t){var e=t.orientation,n=t.range;if(!n)return[];var r=D(iS(t),2),i=r[0],a=r[1],o=D(n,2),s=o[0],c=o[1],l=xa(e,s*i,0),u=xa(e,0,s*a),f=xa(e,c*i,i),d=xa(e,a,c*a);return[["M",l,u],["L",l,d],["L",f,d],["L",f,u],["Z"]]}function ZH(t,e){var n=Oe(e,"track");t.maybeAppendByClassName(pu.track,"path").styles(Q({d:aS(e)},n))}function KH(t,e){var n=Oe(e,"selection"),r=XH(e),i=t.maybeAppendByClassName(pu.selection,"path").styles(Q({d:UH(e),fill:r},n)),a=i.maybeAppendByClassName(pu.clipPath,"path").styles({d:qH(e)}).node();i.style("clipPath",a)}var QH=function(t){It(e,t);function e(n){return t.call(this,n,{type:"color",orientation:"horizontal",size:30,range:[0,1],length:200,block:!1,partition:[],color:["#fff","#000"],trackFill:"#e5e5e5"})||this}return e.prototype.render=function(n,r){var i=de(r).maybeAppendByClassName(pu.trackGroup,"g");ZH(i,n);var a=de(r).maybeAppendByClassName(pu.selectionGroup,"g");KH(a,n)},e}(yr);function JH(t){return{min:Math.min.apply(Math,dt([],D(t.map(function(e){return e.value})),!1)),max:Math.max.apply(Math,dt([],D(t.map(function(e){return e.value})),!1))}}var t$=function(t){It(e,t);function e(n){var r=t.call(this,n,YH)||this;return r.eventToOffsetScale=new Fr({}),r.innerRibbonScale=new Fr({}),r.cacheLabelBBox=null,r.cacheHandleBBox=null,r.onHovering=function(i){var a=r.attributes,o=a.data,s=a.block;i.stopPropagation();var c=r.getValueByCanvasPoint(i);if(s){var l=rS(o.map(function(d){var h=d.value;return h}),c).range,u=r.getRealSelection(l);r.showIndicator((l[0]+l[1])/2,"".concat(u[0],"-").concat(u[1])),r.dispatchIndicated(c,l)}else{var f=r.getTickValue(c);r.showIndicator(f,"".concat(r.getRealValue(f))),r.dispatchIndicated(f)}},r.onDragStart=function(i){return function(a){a.stopPropagation(),r.attributes.slidable&&(r.target=i,r.prevValue=r.getTickValue(r.getValueByCanvasPoint(a)),document.addEventListener("mousemove",r.onDragging),document.addEventListener("touchmove",r.onDragging),document.addEventListener("mouseleave",r.onDragEnd),document.addEventListener("mouseup",r.onDragEnd),document.addEventListener("mouseup",r.onDragEnd),document.addEventListener("touchend",r.onDragEnd))}},r.onDragging=function(i){var a=r.target;r.updateMouse();var o=D(r.selection,2),s=o[0],c=o[1],l=r.getTickValue(r.getValueByCanvasPoint(i)),u=l-r.prevValue;a==="start"?s!==l&&r.updateSelection(l,c):a==="end"?c!==l&&r.updateSelection(s,l):a==="ribbon"&&u!==0&&(r.prevValue=l,r.updateSelection(u,u,!0))},r.onDragEnd=function(){r.style.cursor="pointer",document.removeEventListener("mousemove",r.onDragging),document.removeEventListener("touchmove",r.onDragging),document.removeEventListener("mouseup",r.onDragEnd),document.removeEventListener("touchend",r.onDragEnd)},r}return Object.defineProperty(e.prototype,"handleOffsetRatio",{get:function(){return this.ifHorizontal(.5,.5)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var n=this.attributes,r=n.width,i=n.height;return new Mn(0,0,r,i)},e.prototype.render=function(n,r){var i=this,a=n.showLabel;this.renderTitle(de(r));var o=this.availableSpace,s=o.x,c=o.y,l=de(r).maybeAppendByClassName(Pr.contentGroup,"g").styles({transform:"translate(".concat(s,", ").concat(c,")")}),u=l.maybeAppendByClassName(Pr.labelGroup,"g").styles({zIndex:1});hi(!!a,u,function(d){i.renderLabel(d)});var f=l.maybeAppendByClassName(Pr.ribbonGroup,"g").styles({zIndex:0});this.handlesGroup=l.maybeAppendByClassName(Pr.handlesGroup,"g").styles({zIndex:2}),this.renderHandles(),this.renderRibbon(f),this.renderIndicator(l),this.adjustLabel(),this.adjustHandles()},Object.defineProperty(e.prototype,"range",{get:function(){var n=this.attributes,r=n.data,i=n.domain;return i?{min:i[0],max:i[1]}:JH(r)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonScale",{get:function(){var n=this.range,r=n.min,i=n.max;return this.innerRibbonScale.update({domain:[r,i],range:[0,1]}),this.innerRibbonScale},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonRange",{get:function(){var n=D(this.selection,2),r=n[0],i=n[1],a=this.ribbonScale;return[a.map(r),a.map(i)]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){var n=this.range,r=n.min,i=n.max,a=this.attributes.defaultValue,o=a===void 0?[r,i]:a,s=D(o,2),c=s[0],l=s[1];return[c,l]},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(n,r){return xa(this.attributes.orientation,typeof n=="function"?n():n,typeof r=="function"?r():r)},e.prototype.renderTitle=function(n){var r=this.attributes,i=r.showTitle,a=r.titleText,o=r.width,s=r.height,c=Oe(this.attributes,"title"),l=Q(Q({},c),{width:o,height:s,text:a}),u=this;n.selectAll(Pr.title.class).data(i?[a]:[]).join(function(f){return f.append(function(){return new pw({style:l})}).attr("className",Pr.title.name).each(function(){u.title=this})},function(f){return f.update(l)},function(f){return f.each(function(){u.title=void 0}).remove()})},Object.defineProperty(e.prototype,"availableSpace",{get:function(){if(this.title)return this.title.getAvailableSpace();var n=this.attributes,r=n.width,i=n.height;return new Mn(0,0,r,i)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelFixedSpacing",{get:function(){var n=this.attributes.showTick;return n?5:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelPosition",{get:function(){var n=this.attributes,r=n.orientation,i=n.labelDirection,a={vertical:{positive:"right",negative:"left"},horizontal:{positive:"bottom",negative:"top"}};return a[r][i]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelBBox",{get:function(){var n,r=this.attributes.showLabel;if(!r)return new Mn(0,0,0,0);if(this.cacheLabelBBox)return this.cacheLabelBBox;var i=((n=this.label.querySelector(nn.labelGroup.class))===null||n===void 0?void 0:n.children.slice(-1)[0]).getBBox(),a=i.width,o=i.height;return this.cacheLabelBBox=new Mn(0,0,a,o),this.cacheLabelBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelShape",{get:function(){var n=this.attributes,r=n.showLabel,i=n.labelSpacing,a=i===void 0?0:i;if(!r)return{width:0,height:0,size:0,length:0};var o=this.labelBBox,s=o.width,c=o.height,l=this.ifHorizontal(c,s)+a+this.labelFixedSpacing,u=this.ifHorizontal(s,c);return{width:s,height:c,size:l,length:u}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonBBox",{get:function(){var n=this.attributes,r=n.showHandle,i=n.ribbonSize,a=this.availableSpace,o=a.width,s=a.height,c=this.labelShape,l=c.size,u=c.length,f=D(this.ifHorizontal([s,o],[o,s]),2),d=f[0],h=f[1],p=r?this.handleShape:{size:0,length:0},v=p.size,g=p.length,y=this.handleOffsetRatio,m=0,b=this.labelPosition;i?m=i:["bottom","right"].includes(b)?m=Math.min(d-l,(d-v)/y):d*(1-y)>v?m=Math.max(d-l,0):m=Math.max((d-l-v)/y,0);var _=Math.max(g,u),x=h-_,O=D(this.ifHorizontal([x,m],[m,x]),2),w=O[0],S=O[1],M=["top","left"].includes(b)?l:0,E=D(this.ifHorizontal([_/2,M],[M,_/2]),2),A=E[0],C=E[1];return new Mn(A,C,w,S)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonShape",{get:function(){var n=this.ribbonBBox,r=n.width,i=n.height;return this.ifHorizontal({size:i,length:r},{size:r,length:i})},enumerable:!1,configurable:!0}),e.prototype.renderRibbon=function(n){var r=this.attributes,i=r.data,a=r.type,o=r.orientation,s=r.color,c=r.block,l=Oe(this.attributes,"ribbon"),u=this.range,f=u.min,d=u.max,h=this.ribbonBBox,p=h.x,v=h.y,g=this.ribbonShape,y=g.length,m=g.size,b=Ga({transform:"translate(".concat(p,", ").concat(v,")"),length:y,size:m,type:a,orientation:o,color:s,block:c,partition:i.map(function(_){return(_.value-f)/(d-f)}),range:this.ribbonRange},l);this.ribbon=n.maybeAppendByClassName(Pr.ribbon,function(){return new QH({style:b})}).update(b)},e.prototype.getHandleClassName=function(n){return"".concat(Pr.prefix("".concat(n,"-handle")))},e.prototype.renderHandles=function(){var n=this.attributes,r=n.showHandle,i=n.orientation,a=Oe(this.attributes,"handle"),o=D(this.selection,2),s=o[0],c=o[1],l=Q(Q({},a),{orientation:i}),u=a.shape,f=u===void 0?"slider":u,d=f==="basic"?GH:qw,h=this;this.handlesGroup.selectAll(Pr.handle.class).data(r?[{value:s,type:"start"},{value:c,type:"end"}]:[],function(p){return p.type}).join(function(p){return p.append(function(){return new d({style:l})}).attr("className",function(v){var g=v.type;return"".concat(Pr.handle," ").concat(h.getHandleClassName(g))}).each(function(v){var g=v.type,y=v.value;this.update({labelText:y});var m="".concat(g,"Handle");h[m]=this,this.addEventListener("pointerdown",h.onDragStart(g))})},function(p){return p.update(l).each(function(v){var g=v.value;this.update({labelText:g})})},function(p){return p.each(function(v){var g=v.type,y="".concat(g,"Handle");h[y]=void 0}).remove()})},e.prototype.adjustHandles=function(){var n=D(this.selection,2),r=n[0],i=n[1];this.setHandlePosition("start",r),this.setHandlePosition("end",i)},Object.defineProperty(e.prototype,"handleBBox",{get:function(){if(this.cacheHandleBBox)return this.cacheHandleBBox;if(!this.attributes.showHandle)return new Mn(0,0,0,0);var n=this.startHandle.getBBox(),r=n.width,i=n.height,a=this.endHandle.getBBox(),o=a.width,s=a.height,c=D([Math.max(r,o),Math.max(i,s)],2),l=c[0],u=c[1];return this.cacheHandleBBox=new Mn(0,0,l,u),this.cacheHandleBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"handleShape",{get:function(){var n=this.handleBBox,r=n.width,i=n.height,a=D(this.ifHorizontal([i,r],[r,i]),2),o=a[0],s=a[1];return{width:r,height:i,size:o,length:s}},enumerable:!1,configurable:!0}),e.prototype.setHandlePosition=function(n,r){var i=this.attributes.handleFormatter,a=this.ribbonBBox,o=a.x,s=a.y,c=this.ribbonShape.size,l=this.getOffset(r),u=D(this.ifHorizontal([o+l,s+c*this.handleOffsetRatio],[o+c*this.handleOffsetRatio,s+l]),2),f=u[0],d=u[1],h=this.handlesGroup.select(".".concat(this.getHandleClassName(n))).node();h==null||h.update({transform:"translate(".concat(f,", ").concat(d,")"),formatter:i})},e.prototype.renderIndicator=function(n){var r=Oe(this.attributes,"indicator");this.indicator=n.maybeAppendByClassName(Pr.indicator,function(){return new pH({})}).update(r)},Object.defineProperty(e.prototype,"labelData",{get:function(){var n=this,r=this.attributes.data;return r.reduce(function(i,a,o,s){var c,l,u=(c=a==null?void 0:a.id)!==null&&c!==void 0?c:o.toString();if(i.push(Q(Q({},a),{id:u,index:o,type:"value",label:(l=a==null?void 0:a.label)!==null&&l!==void 0?l:a.value.toString(),value:n.ribbonScale.map(a.value)})),o=0&&(c=1),1-s/(o-1)-n+c}function a$(t,e,n){const r=Pw(e),i=Ew(e,t),a=1;return 1-i/(r-1)-n+a}function o$(t,e,n,r,i,a){const o=(t-1)/(a-i),s=(e-1)/(Math.max(a,r)-Math.min(n,i));return 2-Math.max(o/s,s/o)}function s$(t,e){return t>=e?2-(t-1)/(e-1):1}function c$(t,e,n,r){const i=e-t;return 1-.5*(ir(e-r,2)+ir(t-n,2))/ir(.1*i,2)}function l$(t,e,n){const r=e-t;if(n>r){const i=(n-r)/2;return 1-ir(i,2)/ir(.1*r,2)}return 1}function u$(){return 1}const jg=(t,e,n=5,r=!0,i=e$,a=[.25,.2,.5,.05])=>{const o=n<0?0:Math.round(n);if(Number.isNaN(t)||Number.isNaN(e)||typeof t!="number"||typeof e!="number"||!o)return[];if(e-t<1e-15||o===1)return[t];const s={score:-2,lmin:0,lmax:0,lstep:0};let c=1;for(;c<1/0;){for(let p=0;ps.score&&(!r||C<=t&&P>=e)&&(s.lmin=C,s.lmax=P,s.lstep=T,s.score=I)}}_+=1}y+=1}}c+=1}const l=gu(s.lmax),u=gu(s.lmin),f=gu(s.lstep),d=Math.floor(r$((l-u)/f))+1,h=new Array(d);h[0]=gu(u);for(let p=1;pa-o);const i=[];for(let a=1;a({value:e/t,label:String(e)})}function y$(t,e,n,r,i){const a=e.thresholds,o=g$(r);return Object.assign(Object.assign({},t),{color:i,data:[n,...a,r].map(o)})}function m$(t,e,n){const i=[-1/0,...e.thresholds,1/0].map((a,o)=>({value:o,label:a}));return Object.assign(Object.assign({},t),{data:i,color:n,labelFilter:(a,o)=>o>0&&op!==void 0).find(p=>!(p instanceof vu)));return Object.assign(Object.assign({},t),{domain:[d,h],data:l.getTicks().map(p=>({value:p})),color:new Array(Math.floor(o)).fill(0).map((p,v)=>{const g=(f-u)/(o-1)*v+u,y=l.map(g)||c,m=r?r.map(g):1;return y.replace(/rgb[a]*\(([\d]{1,3}) *, *([\d]{1,3}) *, *([\d]{1,3})[\S\s]*\)/,(b,_,x,O)=>`rgba(${_}, ${x}, ${O}, ${m})`)})})}function x$(t,e,n,r,i,a){const o=ba(t,"color"),s=v$(n,r,i);if(o instanceof jc){const{range:u}=o.getOptions(),[f,d]=Rg(o);return o instanceof uh||o instanceof fh?y$(s,o,f,d,u):m$(s,o,u)}const c=ba(t,"size"),l=ba(t,"opacity");return _$(s,o,c,l,e,a)}const So=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:a,size:o,title:s,style:c,crossPadding:l,padding:u}=t,f=h$(t,["labelFormatter","layout","order","orientation","position","size","title","style","crossPadding","padding"]);return({scales:d,value:h,theme:p,scale:v})=>{const{bbox:g}=h,{x:y,y:m,width:b,height:_}=g,x=Iw(a,n),{legendContinuous:O={}}=p,w=sh(Object.assign({},O,Object.assign(Object.assign({titleText:oh(s),labelAlign:"value",labelFormatter:typeof e=="string"?M=>bo(e)(M.label):e},x$(d,v,h,t,So,p)),c),f)),S=new Dw({style:Object.assign(Object.assign({x:y,y:m,width:b,height:_},x),{subOptions:w})});return S.appendChild(new t$({className:"legend-continuous",style:w})),S}};So.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[12,12]};const sS=t=>(...e)=>So(Object.assign({},{block:!0},t))(...e);sS.props=Object.assign(Object.assign({},So.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const Ig=t=>e=>{const{scales:n}=e,r=ba(n,"size");return So(Object.assign({},{type:"size",data:r.getTicks().map((i,a)=>({value:i,label:String(i)}))},t))(e)};Ig.props=Object.assign(Object.assign({},So.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const cS=t=>Ig(Object.assign({},{block:!0},t));cS.props=Object.assign(Object.assign({},So.props),{defaultPosition:"top",defaultOrientation:"horizontal"});var O$=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);ie=>{const{width:n,height:r,depth:i,paddingLeft:a,paddingRight:o,paddingTop:s,paddingBottom:c,padding:l,inset:u,insetLeft:f,insetTop:d,insetRight:h,insetBottom:p,margin:v,marginLeft:g,marginBottom:y,marginTop:m,marginRight:b,data:_,coordinate:x,theme:O,component:w,interaction:S,x:M,y:E,z:A,key:C,frame:P,labelTransform:T,parentKey:k,clip:N,viewStyle:F,title:R}=e,I=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:M,y:E,z:A,key:C,width:n,height:r,depth:i,padding:l,paddingLeft:a,paddingRight:o,paddingTop:s,inset:u,insetLeft:f,insetTop:d,insetRight:h,insetBottom:p,paddingBottom:c,theme:O,coordinate:x,component:w,interaction:S,frame:P,labelTransform:T,margin:v,marginLeft:g,marginBottom:y,marginTop:m,marginRight:b,parentKey:k,clip:N,style:F},!t&&{title:R}),{marks:[Object.assign(Object.assign(Object.assign({},I),{key:`${C}-0`,data:_}),t&&{title:R})]})]};lS.props={};var w$=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);iat({},t(e,...n),e)}function Ic(t){return(e,...n)=>at({},e,t(e,...n))}function Dg(t,e){if(!t)return e;if(Array.isArray(t))return t;const{value:n=e}=t,r=w$(t,["value"]);return Object.assign(Object.assign({},r),{value:n})}var Fg=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);it=>{const{children:e}=t,n=Fg(t,["children"]);if(!Array.isArray(e))return[];const{data:r,scale:i={},axis:a={},legend:o={},encode:s={},transform:c=[]}=n,l=Fg(n,["data","scale","axis","legend","encode","transform"]),u=e.map(f=>{var{data:d,scale:h={},axis:p={},legend:v={},encode:g={},transform:y=[]}=f,m=Fg(f,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:Dg(d,r),scale:at({},i,h),encode:at({},s,g),transform:[...c,...y],axis:p&&a?at({},a,p):!1,legend:v&&o?at({},o,v):!1},m)});return[Object.assign(Object.assign({},l),{marks:u,type:"standardView"})]};uS.props={};function zn([t,e],[n,r]){return[t-n,e-r]}function dh([t,e],[n,r]){return[t+n,e+r]}function Ln([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function zi([t,e]){return Math.atan2(e,t)}function Dc([t,e]){return zi([t,e])+Math.PI/2}function fS(t,e){const n=zi(t),r=zi(e);return nr===0?t.moveTo(n[0],n[1]):t.lineTo(n[0],n[1])),t.closePath(),t}function M$(t,e,n){const{arrowSize:r}=n,i=typeof r=="string"?+parseFloat(r)/100*Ln(t,e):r,a=Math.PI/6,o=Math.atan2(e[1]-t[1],e[0]-t[0]),s=Math.PI/2-o-a,c=[e[0]-i*Math.sin(s),e[1]-i*Math.cos(s)],l=o-a,u=[e[0]-i*Math.cos(l),e[1]-i*Math.sin(l)];return[c,u]}function yu(t,e,n,r,i){const a=zi(zn(r,e))+Math.PI,o=zi(zn(r,n))+Math.PI;return t.arc(r[0],r[1],i,a,o,o-a<0),t}function hS(t,e,n,r="y",i="between",a=!1){const o=(g,y)=>g==="y"||g===!0?y?180:90:y?90:0,s=r==="y"||r===!0?n:e,c=o(r,a),l=_s(s),[u,f]=Ha(l,g=>s[g]),d=new Fr({domain:[u,f],range:[0,100]}),h=g=>$n(s[g])&&!Number.isNaN(s[g])?d.map(s[g]):0,p={between:g=>`${t[g]} ${h(g)}%`,start:g=>g===0?`${t[g]} ${h(g)}%`:`${t[g-1]} ${h(g)}%, ${t[g]} ${h(g)}%`,end:g=>g===t.length-1?`${t[g]} ${h(g)}%`:`${t[g]} ${h(g)}%, ${t[g+1]} ${h(g)}%`},v=l.sort((g,y)=>h(g)-h(y)).map(p[i]||p.between).join(",");return`linear-gradient(${c}deg, ${v})`}function hh(t){const[e,n,r,i]=t;return[i,e,n,r]}function As(t,e,n){const[r,i,,a]=Sn(t)?hh(e):e,[o,s]=n,c=t.getCenter(),l=Dc(zn(r,c)),u=Dc(zn(i,c)),f=u===l&&o!==s?u+Math.PI*2:u;return{startAngle:l,endAngle:f-l>=0?f:Math.PI*2+f,innerRadius:Ln(a,c),outerRadius:Ln(r,c)}}function kmt(t){const e="connect";return Object.fromEntries(Object.entries(t).filter(([n])=>n.startsWith(e)).map(([n,r])=>[lowerFirst(n.replace(e,"").trim()),r]).filter(([n])=>n!==void 0))}function zg(t){const{colorAttribute:e,opacityAttribute:n=e}=t;return`${n}Opacity`}function pS(t,e){if(!fn(t))return"";const n=t.getCenter(),{transform:r}=e;return`translate(${n[0]}, ${n[1]}) ${r||""}`}function Gg(t){if(t.length===1)return t[0];const[[e,n,r=0],[i,a,o=0]]=t;return[(e+i)/2,(n+a)/2,(r+o)/2]}function vS(t){return t.replace(/-(\w)/g,function(e,n){return n.toUpperCase()})}function E$(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()}var Cmt=Array.prototype.slice;function gS(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function En(t){return function(){return t}}function yS(t){this._context=t}yS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&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);break}}};function mu(t){return new yS(t)}const Wg=Math.PI,Yg=2*Wg,Ps=1e-6,A$=Yg-Ps;function mS(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return mS;const n=ir(10,e);return function(r){this._+=r[0];for(let i=1,a=r.length;iPs)if(!(Math.abs(f*c-l*u)>Ps)||!a)this._append`L${this._x1=e},${this._y1=n}`;else{let h=r-o,p=i-s,v=c*c+l*l,g=h*h+p*p,y=Math.sqrt(v),m=Math.sqrt(d),b=a*Math.tan((Wg-Math.acos((v+d-g)/(2*y*m)))/2),_=b/m,x=b/y;Math.abs(_-1)>Ps&&this._append`L${e+_*u},${n+_*f}`,this._append`A${a},${a},0,0,${+(f*h>u*p)},${this._x1=e+x*c},${this._y1=n+x*l}`}}arc(e,n,r,i,a,o){if(e=+e,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),c=r*Math.sin(i),l=e+s,u=n+c,f=1^o,d=o?i-a:a-i;this._x1===null?this._append`M${l},${u}`:(Math.abs(this._x1-l)>Ps||Math.abs(this._y1-u)>Ps)&&this._append`L${l},${u}`,r&&(d<0&&(d=d%Yg+Yg),d>A$?this._append`A${r},${r},0,1,${f},${e-s},${n-c}A${r},${r},0,1,${f},${this._x1=l},${this._y1=u}`:d>Ps&&this._append`A${r},${r},0,${+(d>=Wg)},${f},${this._x1=e+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function Gi(){return new ph}Gi.prototype=ph.prototype;function Lmt(t=3){return new ph(+t)}function Hg(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new ph(e)}function bS(t){return t[0]}function _S(t){return t[1]}function Mo(t,e){var n=En(!0),r=null,i=mu,a=null,o=Hg(s);t=typeof t=="function"?t:t===void 0?bS:En(t),e=typeof e=="function"?e:e===void 0?_S:En(e);function s(c){var l,u=(c=gS(c)).length,f,d=!1,h;for(r==null&&(a=i(h=o())),l=0;l<=u;++l)!(l0&&(a=e),r<0&&(a=r),n>0&&(o=n),i<0&&(o=i),[a,o]}function k$(t,e=[]){const[n=0,r=0,i=n,a=r]=e,o=t.parentNode,s=o.getEulerAngles();o.setEulerAngles(0);const{min:c,halfExtents:l}=t.getLocalBounds(),[u,f]=c,[d,h]=l;return o.setEulerAngles(s),{x:u-a,y:f-n,width:d*2+a+r,height:h*2+n+i}}const C$=(t,e,n)=>{const r=Ln(t,e),i=Ln(e,n),a=Ln(n,t);return(Math.pow(r,2)+Math.pow(i,2)-Math.pow(a,2))/(2*r*i)};function L$(t,e,n,r){const[[i,a],[o,s]]=e,[c,l]=T$(t);if(i===o&&a===s)return Mo()([[0,0],[c,l]]);const u=[[i-o,a-s]].concat(n.length?n:[[0,0]]),f=[r[0]-o,r[1]-s],[d,h]=u;if(C$(f,d,h)>0){const p=(()=>{const{min:v,max:g}=t.getLocalBounds(),y=d[0]+(d[1]-f[1])*(d[1]-0)/(d[0]-f[0]);return g[0]{const e=t.attributes,{className:n,class:r,transform:i,rotate:a,labelTransform:o,labelTransformOrigin:s,x:c,y:l,x0:u=c,y0:f=l,text:d,background:h,connector:p,startMarker:v,endMarker:g,coordCenter:y,innerHTML:m}=e,b=$g(e,["className","class","transform","rotate","labelTransform","labelTransformOrigin","x","y","x0","y0","text","background","connector","startMarker","endMarker","coordCenter","innerHTML"]);if(t.style.transform=`translate(${c}, ${l})`,[c,l,u,f].some(N=>!$n(N))){t.children.forEach(N=>N.remove());return}const _=At(b,"background"),{padding:x}=_,O=$g(_,["padding"]),w=At(b,"connector"),{points:S=[]}=w,M=$g(w,["points"]),E=[[+u,+f],[+c,+l]];let A;m?A=Kt(t).maybeAppend("html","html",n).style("zIndex",0).style("innerHTML",m).call(Bt,Object.assign({transform:o,transformOrigin:s},b)).node():A=Kt(t).maybeAppend("text","text").style("zIndex",0).style("text",d).call(Bt,Object.assign({textBaseline:"middle",transform:o,transformOrigin:s},b)).node();const C=Kt(t).maybeAppend("background","rect").style("zIndex",-1).call(Bt,k$(A,x)).call(Bt,h?O:{}).node(),P=L$(C,E,S,y),T=v&&new He({id:"startMarker",style:Object.assign({x:0,y:0},At(b,"startMarker"))}),k=g&&new He({id:"endMarker",style:Object.assign({x:0,y:0},At(b,"endMarker"))});Kt(t).maybeAppend("connector","path").style("zIndex",0).style("d",P).style("markerStart",T).style("markerEnd",k).call(Bt,p?M:{})});function Bc(t,e){let n,r=-1,i=-1;if(e===void 0)for(const a of t)++i,a!=null&&(n=a)&&(n=a,r=i);else for(let a of t)(a=e(a,++i,t))!=null&&(n=a)&&(n=a,r=i);return r}function N$(t,e,n,r){const i=e.length/2,a=e.slice(0,i),o=e.slice(i);let s=Bc(a,(h,p)=>Math.abs(h[1]-o[p][1]));s=Math.max(Math.min(s,i-2),1);const c=h=>[a[h][0],(a[h][1]+o[h][1])/2],l=c(s),u=c(s-1),f=c(s+1),d=zi(zn(f,u))/Math.PI*180;return{x:l[0],y:l[1],transform:`rotate(${d})`,textAlign:"center",textBaseline:"middle"}}function OS(t,e,n,r){const{bounds:i}=n,[[a,o],[s,c]]=i,l=s-a,u=c-o,f=d=>{const{x:h,y:p}=d,v=hO(n.x,l),g=hO(n.y,u);return Object.assign(Object.assign({},d),{x:(v||h)+a,y:(g||p)+o})};return f(t==="left"?{x:0,y:u/2,textAlign:"start",textBaseline:"middle"}:t==="right"?{x:l,y:u/2,textAlign:"end",textBaseline:"middle"}:t==="top"?{x:l/2,y:0,textAlign:"center",textBaseline:"top"}:t==="bottom"?{x:l/2,y:u,textAlign:"center",textBaseline:"bottom"}:t==="top-left"?{x:0,y:0,textAlign:"start",textBaseline:"top"}:t==="top-right"?{x:l,y:0,textAlign:"end",textBaseline:"top"}:t==="bottom-left"?{x:0,y:u,textAlign:"start",textBaseline:"bottom"}:t==="bottom-right"?{x:l,y:u,textAlign:"end",textBaseline:"bottom"}:{x:l/2,y:u/2,textAlign:"center",textBaseline:"middle"})}function wS(t,e,n,r){const{y:i,y1:a,autoRotate:o,rotateToAlignArc:s}=n,c=r.getCenter(),l=As(r,e,[i,a]),{innerRadius:u,outerRadius:f,startAngle:d,endAngle:h}=l,p=t==="inside"?(d+h)/2:h,v=Vg(p,o,s),g=(()=>{const[y,m]=e,b=u+(f-u)*.5,[_,x]=t==="inside"?bu(c,p,b):dS(y,m);return{x:_,y:x}})();return Object.assign(Object.assign({},g),{textAlign:t==="inside"?"center":"start",textBaseline:"middle",rotate:v})}function bu(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function Vg(t,e,n){if(!e)return 0;const r=n?0:Math.sin(t)<0?90:-90;return t/Math.PI*180+r}function j$(t,e,n,r){const{y:i,y1:a,autoRotate:o,rotateToAlignArc:s,radius:c=.5,offset:l=0}=n,u=As(r,e,[i,a]),{startAngle:f,endAngle:d}=u,h=r.getCenter(),p=(f+d)/2,g={textAlign:"center",textBaseline:"middle",rotate:Vg(p,o,s)},{innerRadius:y,outerRadius:m}=u,_=y+(m-y)*c+l,[x,O]=bu(h,p,_);return Object.assign({x,y:O},g)}function SS(t){return t===void 0?null:t}function MS(t,e,n,r){const{bounds:i}=n,[a]=i;return{x:SS(a[0]),y:SS(a[1])}}function $a(t,e,n,r){const{bounds:i}=n;return i.length===1?MS(t,e,n,r):(nu(r)?wS:Ac(r)?j$:OS)(t,e,n,r)}function R$(t,e,n,r,i){const[a,o]=bu(t,e,n),[s,c]=bu(t,e,r),l=Math.sin(e)>0?1:-1;return[[a,o],[s,c],[s+l*i,c]]}function ES(t,e,n){const r=As(n,t,[e.y,e.y1]),{innerRadius:i,outerRadius:a}=r;return i+(a-i)}function AS(t,e,n){const r=As(n,t,[e.y,e.y1]),{startAngle:i,endAngle:a}=r;return(i+a)/2}function Ug(t,e,n,r){const{autoRotate:i,rotateToAlignArc:a,offset:o=0,connector:s=!0,connectorLength:c=o,connectorLength2:l=0,connectorDistance:u=0}=n,f=r.getCenter(),d=AS(e,n,r),h=Math.sin(d)>0?1:-1,p=Vg(d,i,a),v={textAlign:h>0||nu(r)?"start":"end",textBaseline:"middle",rotate:p},g=ES(e,n,r),y=g+(s?c:o),[[m,b],[_,x],[O,w]]=R$(f,d,g,y,s?l:0),S=s?+u*h:0,M=O+S,E=w,A={connector:s,connectorPoints:[[_-M,x-E],[O-M,w-E]]};return Object.assign(Object.assign({x0:m,y0:b,x:O+S,y:w},v),A)}function I$(t,e,n,r){const{bounds:i}=n;return i.length===1?MS(t,e,n,r):(nu(r)?wS:Ac(r)?Ug:OS)(t,e,n,r)}var D$=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i0?1:-1,h=c[0]+(f+ +o)*d,{x:p}=s,v=h-p;return s.x+=v,s.connectorPoints[0][0]-=v,s}var B$=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i0?1:-1,[v,g]=bu(u,h,d);return s.x=v+(a+o)*p,s.y=g,s}var PS=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const{coordinate:n,theme:r}=e,{render:i}=t;return(a,o)=>{const{text:s,x:c,y:l,transform:u="",transformOrigin:f,className:d=""}=o,h=PS(o,["text","x","y","transform","transformOrigin","className"]),p=W$(a,o,n,r,t),{rotate:v=0,transform:g=""}=p,y=PS(p,["rotate","transform"]);return Kt(new xS).call(Bt,y).style("text",`${s}`).style("className",`${d} g2-label`).style("innerHTML",i?i(s,o.datum,o.index):void 0).style("labelTransform",`${g} rotate(${+v}) ${u}`.trim()).style("labelTransformOrigin",f).style("coordCenter",n.getCenter()).call(Bt,h).node()}};TS.props={defaultMarker:"point"};function Gn(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function Y$(t,e){return Array.from(e,n=>t[n])}function Va(t,...e){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&n.length!==2||e.length>1){const r=Uint32Array.from(t,(i,a)=>a);return e.length>1?(e=e.map(i=>t.map(i)),r.sort((i,a)=>{for(const o of e){const s=_u(o[i],o[a]);if(s)return s}})):(n=t.map(n),r.sort((i,a)=>_u(n[i],n[a]))),Y$(t,r)}return t.sort(kS(n))}function kS(t=Gn){if(t===Gn)return _u;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function _u(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(te?1:0)}var H$=function(t,e){if(!tu(t))return t;for(var n=[],r=0;rt?1:e>=t?0:NaN}function zc(t){let e,n,r;t.length!==2?(e=Gn,n=(s,c)=>Gn(t(s),c),r=(s,c)=>t(s)-c):(e=t===Gn||t===$$?t:V$,n=t,r=t);function i(s,c,l=0,u=s.length){if(l>>1;n(s[f],c)<0?l=f+1:u=f}while(l>>1;n(s[f],c)<=0?l=f+1:u=f}while(ll&&r(s[f-1],c)>-r(s[f],c)?f-1:f}return{left:i,center:o,right:a}}function V$(){return 0}function Xg(t){return t===null?NaN:+t}function*U$(t,e){if(e===void 0)for(let n of t)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)(r=e(r,++n,t))!=null&&(r=+r)>=r&&(yield r)}}const LS=zc(Gn),X$=LS.right,q$=LS.left,Z$=zc(Xg).center;var K$=X$;function Q$(t,e,n){return Math.min(n,Math.max(e,t))}function xu(t){return!!t.getBandWidth}function Gc(t,e,n){if(!xu(t))return t.invert(e);const{adjustedRange:r}=t,{domain:i}=t.getOptions(),a=n?-1:0,o=t.getStep(),s=n?r:r.map(u=>u+o),c=q$(s,e),l=Q$(c+a,0,i.length-1);return i[l]}function Eo(t,e,n){if(!e)return t.getOptions().domain;if(!xu(t)){const c=Va(e);if(!n)return c;const[l]=c,{range:u}=t.getOptions(),[f,d]=u,h=f>d?-1:1,p=t.invert(t.map(l)+h*n);return[l,p]}const{domain:r}=t.getOptions(),i=e[0],a=r.indexOf(i);if(n){const c=a+Math.round(r.length*n);return r.slice(a,c)}const o=e[e.length-1],s=r.indexOf(o);return r.slice(a,s+1)}function vh(t,e,n,r,i,a){const{x:o,y:s}=i,c=(h,p)=>{const[v,g]=a.invert(h);return[Gc(o,v,p),Gc(s,g,p)]},l=c([t,e],!0),u=c([n,r],!1),f=Eo(o,[l[0],u[0]]),d=Eo(s,[l[1],u[1]]);return[f,d]}function gh(t,e){const[n,r]=t,i=a=>a.getStep?a.getStep():0;return[e.map(n),e.map(r)+i(e)]}function J$(t,e,n){const{x:r,y:i}=e,[a,o]=t,s=gh(a,r),c=gh(o,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]}const NS=Math.abs,Br=Math.atan2,Ts=Math.cos,tV=Math.max,qg=Math.min,Oa=Math.sin,Wc=Math.sqrt,zr=1e-12,Ou=Math.PI,yh=Ou/2,eV=2*Ou;function nV(t){return t>1?0:t<-1?Ou:Math.acos(t)}function jS(t){return t>=1?yh:t<=-1?-yh:Math.asin(t)}function rV(t){return t.innerRadius}function iV(t){return t.outerRadius}function aV(t){return t.startAngle}function oV(t){return t.endAngle}function sV(t){return t&&t.padAngle}function cV(t,e,n,r,i,a,o,s){var c=n-t,l=r-e,u=o-i,f=s-a,d=f*c-u*l;if(!(d*dT*T+k*k&&(S=E,M=A),{cx:S,cy:M,x01:-u,y01:-f,x11:S*(i/x-1),y11:M*(i/x-1)}}function bh(){var t=rV,e=iV,n=En(0),r=null,i=aV,a=oV,o=sV,s=null,c=Hg(l);function l(){var u,f,d=+t.apply(this,arguments),h=+e.apply(this,arguments),p=i.apply(this,arguments)-yh,v=a.apply(this,arguments)-yh,g=NS(v-p),y=v>p;if(s||(s=u=c()),hzr))s.moveTo(0,0);else if(g>eV-zr)s.moveTo(h*Ts(p),h*Oa(p)),s.arc(0,0,h,p,v,!y),d>zr&&(s.moveTo(d*Ts(v),d*Oa(v)),s.arc(0,0,d,v,p,y));else{var m=p,b=v,_=p,x=v,O=g,w=g,S=o.apply(this,arguments)/2,M=S>zr&&(r?+r.apply(this,arguments):Wc(d*d+h*h)),E=qg(NS(h-d)/2,+n.apply(this,arguments)),A=E,C=E,P,T;if(M>zr){var k=jS(M/d*Oa(S)),N=jS(M/h*Oa(S));(O-=k*2)>zr?(k*=y?1:-1,_+=k,x-=k):(O=0,_=x=(p+v)/2),(w-=N*2)>zr?(N*=y?1:-1,m+=N,b-=N):(w=0,m=b=(p+v)/2)}var F=h*Ts(m),R=h*Oa(m),I=d*Ts(x),z=d*Oa(x);if(E>zr){var W=h*Ts(b),V=h*Oa(b),$=d*Ts(_),J=d*Oa(_),ct;if(gzr?C>zr?(P=mh($,J,F,R,h,C,y),T=mh(W,V,I,z,h,C,y),s.moveTo(P.cx+P.x01,P.cy+P.y01),Czr)||!(O>zr)?s.lineTo(I,z):A>zr?(P=mh(I,z,W,V,d,-A,y),T=mh(F,R,$,J,d,-A,y),s.lineTo(P.cx+P.x01,P.cy+P.y01),A0?A:A+P,N=T>0?C:C+T,F=Math.abs(P),R=Math.abs(T),I=k+s,z=N+c,W=F-(s+l),V=R-(c+u),$=S?Wd(W,y,1/0):Wd(W,v,g),J=S?Wd(V,v,g):Wd(V,y,1/0),ct=S?I:I-($-W)/2,pt=S?z-(J-V)/2:z-(J-V);return Kt(t.createElement("rect",{})).style("x",ct).style("y",pt).style("width",$).style("height",J).style("radius",[h,p,d,f]).call(Bt,m).node()}const{y:b,y1:_}=n,x=r.getCenter(),O=As(r,e,[b,_]),w=bh().cornerRadius(o).padAngle(a*Math.PI/180);return Kt(t.createElement("path",{})).style("d",w(O)).style("transform",`translate(${x[0]}, ${x[1]})`).style("radius",o).style("inset",a).call(Bt,m).node()}const wu=(t,e)=>{const{colorAttribute:n,opacityAttribute:r="fill",first:i=!0,last:a=!0}=t,o=_h(t,["colorAttribute","opacityAttribute","first","last"]),{coordinate:s,document:c}=e;return(l,u,f)=>{const{color:d,radius:h=0}=f,p=_h(f,["color","radius"]),v=p.lineWidth||1,{stroke:g,radius:y=h,radiusTopLeft:m=y,radiusTopRight:b=y,radiusBottomRight:_=y,radiusBottomLeft:x=y,innerRadius:O=0,innerRadiusTopLeft:w=O,innerRadiusTopRight:S=O,innerRadiusBottomRight:M=O,innerRadiusBottomLeft:E=O,lineWidth:A=n==="stroke"||g?v:0,inset:C=0,insetLeft:P=C,insetRight:T=C,insetBottom:k=C,insetTop:N=C,minWidth:F,maxWidth:R,minHeight:I}=o,z=_h(o,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop","minWidth","maxWidth","minHeight"]),{color:W=d,opacity:V}=u,$=[i?m:w,i?b:S,a?_:M,a?x:E],J=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"];Sn(s)&&J.push(J.shift());const ct=Object.assign(Object.assign({radius:y},Object.fromEntries(J.map((pt,it)=>[pt,$[it]]))),{inset:C,insetLeft:P,insetRight:T,insetBottom:k,insetTop:N,minWidth:F,maxWidth:R,minHeight:I});return Kt(RS(c,l,u,s,ct)).call(Bt,p).style("fill","transparent").style(n,W).style(zg(t),V).style("lineWidth",A).style("stroke",g===void 0?W:g).call(Bt,z).node()}};wu.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const lV={visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1};function uV(t,e){var n;return(n=t.style[e])!==null&&n!==void 0?n:lV[e]}function Zg(t,e,n,r){t.style[e]=n,r&&t.children.forEach(i=>Zg(i,e,n,r))}function Kg(t){Zg(t,"visibility","hidden",!0)}function xh(t){Zg(t,"visibility","visible",!0)}var Su=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i!e.__removed__)}function IS(t,e){return Qg(t,e).flatMap(({container:n})=>Ao(n))}function Qg(t,e){return e.filter(n=>n!==t&&n.options.parentKey===t.options.key)}function wa(t){return Kt(t).select(`.${kl}`).node()}function DS(t){if(t.tagName==="g")return t.getRenderBounds();const e=t.getGeometryBounds(),n=new Vn;return n.setFromTransformedAABB(e,t.getWorldTransform()),n}function Jg(t,e){const{offsetX:n,offsetY:r}=e,i=DS(t),{min:[a,o],max:[s,c]}=i,l=ns,u=rc;return l||u?null:[n-a,r-o]}function ty(t,e){const{offsetX:n,offsetY:r}=e,[i,a,o,s]=fV(t);return[Math.min(o,Math.max(i,n))-i,Math.min(s,Math.max(a,r))-a]}function fV(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,a]}=e;return[n,r,i,a]}function FS(t){return e=>e.__data__.color}function ey(t){return e=>e.__data__.x}function ks(t){const e=Array.isArray(t)?t:[t],n=new Map(e.flatMap(r=>Array.from(r.markState.keys()).map(a=>[Oh(r.key,a.key),a.data])));return r=>{const{index:i,markKey:a,viewKey:o}=r.__data__;return n.get(Oh(o,a))[i]}}function Ua(t,e=(r,i)=>r,n=(r,i,a)=>r.setAttribute(i,a)){const r="__states__",i="__ordinal__",a=u=>{const{[r]:f=[],[i]:d={}}=u,h=f.reduce((p,v)=>Object.assign(Object.assign({},p),t[v]),d);if(Object.keys(h).length!==0){for(const[p,v]of Object.entries(h)){const g=uV(u,p),y=e(v,u);n(u,p,y),p in d||(d[p]=g)}u[i]=d}},o=u=>{u[r]||(u[r]=[])};return{setState:(u,...f)=>{o(u),u[r]=[...f],a(u)},removeState:(u,...f)=>{o(u);for(const d of f){const h=u[r].indexOf(d);h!==-1&&u[r].splice(h,1)}a(u)},hasState:(u,f)=>(o(u),u[r].indexOf(f)!==-1)}}function dV(t){return t===void 0?!0:typeof t!="object"?!1:Object.keys(t).length===0}function Oh(t,e){return`${t},${e}`}function Yc(t,e){const r=(Array.isArray(t)?t:[t]).flatMap(a=>a.marks.map(o=>[Oh(a.key,o.key),o.state])),i={};for(const a of e){const[o,s]=Array.isArray(a)?a:[a,{}];i[o]=r.reduce((c,l)=>{const[u,f={}]=l,d=dV(f[o])?s:f[o];for(const[h,p]of Object.entries(d)){const v=c[h],g=(y,m,b,_)=>{const x=Oh(_.__data__.viewKey,_.__data__.markKey);return u!==x?v==null?void 0:v(y,m,b,_):typeof p!="function"?p:p(y,m,b,_)};c[h]=g}return c},{})}return i}function Mu(t,e){const n=new Map(t.map((i,a)=>[i,a])),r=e?t.map(e):t;return(i,a)=>{if(typeof i!="function")return i;const o=n.get(a),s=e?e(a):a;return i(s,o,r,a)}}function BS(t){var{link:e=!1,valueof:n=(u,f)=>u,coordinate:r}=t,i=Su(t,["link","valueof","coordinate"]);const a="element-link";if(!e)return[()=>{},()=>{}];const o=u=>u.__data__.points,s=(u,f)=>{const[,d,h]=u,[p,,,v]=f;return[d,p,v,h]};return[u=>{var f;if(u.length<=1)return;const d=Va(u,(h,p)=>{const{x:v}=h.__data__,{x:g}=p.__data__;return v-g});for(let h=1;hn(M,v)),{fill:O=v.getAttribute("fill")}=x,w=Su(x,["fill"]),S=new Zr({className:a,style:Object.assign({d:p.toString(),fill:O,zIndex:-2},w)});(f=v.link)===null||f===void 0||f.remove(),v.parentNode.appendChild(S),v.link=S}},u=>{var f;(f=u.link)===null||f===void 0||f.remove(),u.link=null}]}function zS(t,e,n){const r=i=>{const{transform:a}=t.style;return a?`${a} ${i}`:i};if(fn(n)){const{points:i}=t.__data__,[a,o]=Sn(n)?hh(i):i,s=n.getCenter(),c=zn(a,s),l=zn(o,s),u=zi(c),f=fS(c,l),d=u+f/2,h=e*Math.cos(d),p=e*Math.sin(d);return r(`translate(${h}, ${p})`)}return Sn(n)?r(`translate(${e}, 0)`):r(`translate(0, ${-e})`)}function GS(t){var{document:e,background:n,scale:r,coordinate:i,valueof:a}=t,o=Su(t,["document","background","scale","coordinate","valueof"]);const s="element-background";if(!n)return[()=>{},()=>{}];const c=(y,m,b)=>{const _=y.invert(m),x=m+y.getBandWidth(_)/2,O=y.getStep(_)/2,w=O*b;return[x-O+w,x+O-w]},l=(y,m)=>{const{x:b}=r;if(!xu(b))return[0,1];const{__data__:_}=y,{x}=_,[O,w]=c(b,x,m);return[O,w]},u=(y,m)=>{const{y:b}=r;if(!xu(b))return[0,1];const{__data__:_}=y,{y:x}=_,[O,w]=c(b,x,m);return[O,w]},f=(y,m)=>{const{padding:b}=m,[_,x]=l(y,b),[O,w]=u(y,b),S=[[_,O],[x,O],[x,w],[_,w]].map(C=>i.map(C)),{__data__:M}=y,{y:E,y1:A}=M;return RS(e,S,{y:E,y1:A},i,m)},d=(y,m)=>{const{transform:b="scale(1.2, 1.2)",transformOrigin:_="center center",stroke:x=""}=m,O=Su(m,["transform","transformOrigin","stroke"]),w=Object.assign({transform:b,transformOrigin:_,stroke:x},O),S=y.cloneNode(!0);for(const[M,E]of Object.entries(w))S.style[M]=E;return S},h=()=>{const{x:y,y:m}=r;return[y,m].some(xu)};return[y=>{y.background&&y.background.remove();const m=_o(o,C=>a(C,y)),{fill:b="#CCD6EC",fillOpacity:_=.3,zIndex:x=-2,padding:O=.001,lineWidth:w=0}=m,S=Su(m,["fill","fillOpacity","zIndex","padding","lineWidth"]),M=Object.assign(Object.assign({},S),{fill:b,fillOpacity:_,zIndex:x,padding:O,lineWidth:w}),A=(h()?f:d)(y,M);A.className=s,y.parentNode.parentNode.appendChild(A),y.background=A},y=>{var m;(m=y.background)===null||m===void 0||m.remove(),y.background=null},y=>y.className===s]}function Po(t,e){const r=t.getRootNode().defaultView.getContextService().getDomElement();r!=null&&r.style&&(t.cursor=r.style.cursor,r.style.cursor=e)}function hV(t){Po(t,t.cursor)}function ny(t,e,n){return t.find(r=>Object.entries(e).every(([i,a])=>n(r)[i]===a))}function wh(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Eu(t,e=!1){const n=CS(t,r=>!!r).map((r,i)=>[i===0?"M":"L",...r]);return e&&n.push(["Z"]),n}function WS(t){return t.querySelectorAll(".element")}function pV(t,e,n=0){const r=[["M",...e[1]]],i=wh(t,e[1]),a=wh(t,e[0]);return i===0?r.push(["L",...e[3]],["A",a,a,0,n,1,...e[0]],["Z"]):r.push(["A",i,i,0,n,0,...e[2]],["L",...e[3]],["A",a,a,0,n,1,...e[0]],["Z"]),r}function Sh(t,e){if(e(t))return t;let n=t.parent;for(;n&&!e(n);)n=n.parent;return n}function YS(t,e){const{__data__:n}=t,{markKey:r,index:i,seriesIndex:a}=n,{markState:o}=e,s=Array.from(o.keys()).find(c=>c.key===r);if(s)return a?a.map(c=>s.data[c]):s.data[i]}function vV(t){return Sh(t,e=>e.className==="component")}function gV(t){return Sh(t,e=>e.className==="element")}function yV(t){return Sh(t,e=>e.className==="label")}function mr(t,e,n,r=i=>!0){return i=>{if(!r(i))return;n.emit(`plot:${t}`,i);const{target:a}=i;if(!a)return;const{className:o}=a;if(o==="plot")return;const s=gV(a),c=vV(a),l=yV(a),u=s||c||l;if(!u)return;const{className:f,markType:d}=u,h=Object.assign(Object.assign({},i),{nativeEvent:!0});f==="element"?(h.data={data:YS(u,e)},n.emit(`element:${t}`,h),n.emit(`${d}:${t}`,h)):f==="label"?(h.data={data:u.attributes.datum},n.emit(`label:${t}`,h),n.emit(`${o}:${t}`,h)):(n.emit(`component:${t}`,h),n.emit(`${o}:${t}`,h))}}function HS(){return(t,e,n)=>{const{container:r,view:i}=t,a=mr(Ze.CLICK,i,n,w=>w.detail===1),o=mr(Ze.DBLCLICK,i,n,w=>w.detail===2),s=mr(Ze.POINTER_TAP,i,n),c=mr(Ze.POINTER_DOWN,i,n),l=mr(Ze.POINTER_UP,i,n),u=mr(Ze.POINTER_OVER,i,n),f=mr(Ze.POINTER_OUT,i,n),d=mr(Ze.POINTER_MOVE,i,n),h=mr(Ze.POINTER_ENTER,i,n),p=mr(Ze.POINTER_LEAVE,i,n),v=mr(Ze.POINTER_UPOUTSIDE,i,n),g=mr(Ze.DRAG_START,i,n),y=mr(Ze.DRAG,i,n),m=mr(Ze.DRAG_END,i,n),b=mr(Ze.DRAG_ENTER,i,n),_=mr(Ze.DRAG_LEAVE,i,n),x=mr(Ze.DRAG_OVER,i,n),O=mr(Ze.DROP,i,n);return r.addEventListener("click",a),r.addEventListener("click",o),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",v),r.addEventListener("dragstart",g),r.addEventListener("drag",y),r.addEventListener("dragend",m),r.addEventListener("dragenter",b),r.addEventListener("dragleave",_),r.addEventListener("dragover",x),r.addEventListener("drop",O),()=>{r.removeEventListener("click",a),r.removeEventListener("click",o),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",v),r.removeEventListener("dragstart",g),r.removeEventListener("drag",y),r.removeEventListener("dragend",m),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",_),r.removeEventListener("dragover",x),r.removeEventListener("drop",O)}}}HS.props={reapplyWhenUpdate:!0};function mV(){return{"component.axisRadar":$w,"component.axisLinear":Oo,"component.axisArc":Hw,"component.legendContinuousBlock":sS,"component.legendContinuousBlockSize":cS,"component.legendContinuousSize":Ig,"interaction.event":HS,"composition.mark":lS,"composition.view":uS,"shape.label.label":TS}}var bV=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{if(typeof a!="string")return a;const o=`${t}.${a}`;return n[o]||Mc(`Unknown Component: ${o}`)};return[(a,o)=>{const{type:s}=a,c=bV(a,["type"]);s||Mc("Plot type is required!");const l=r(s);return l==null?void 0:l(c,o)},r]}function $S(t){const{canvas:e,group:n}=t;return(e==null?void 0:e.document)||(n==null?void 0:n.ownerDocument)||Mc("Cannot find library document")}var VS=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);in.type===e)}function Cs(t){return ea(t,"polar").length>0}function xV(t){return ea(t,"helix").length>0}function Hc(t){return ea(t,"transpose").length%2===1}function OV(t){return ea(t,"parallel").length>0}function XS(t){return ea(t,"theta").length>0}function wV(t){return ea(t,"reflect").length>0}function Au(t){return ea(t,"radial").length>0}function SV(t){return ea(t,"radar").length>0}function MV(t){return ea(t,"reflectY").length>0}function EV(t){return t.find(e=>e.type==="cartesian"||e.type==="cartesian3D")?t:[...t,{type:"cartesian"}]}function be(t){for(var e=t.length/6|0,n=new Array(e),r=0;r=1?(n=1,e-1):Math.floor(n*e),i=t[r],a=t[r+1],o=r>0?t[r-1]:2*i-a,s=r180||n<-180?n-360*Math.round(n/360):n):ry(isNaN(t)?e:t)}function WV(t){return(t=+t)==1?$c:function(e,n){return n-e?zV(e,n,t):ry(isNaN(e)?n:e)}}function $c(t,e){var n=e-t;return n?ZS(t,n):ry(isNaN(t)?e:t)}var Nmt=function t(e){var n=WV(e);function r(i,a){var o=n((i=Bl(i)).r,(a=Bl(a)).r),s=n(i.g,a.g),c=n(i.b,a.b),l=$c(i.opacity,a.opacity);return function(u){return i.r=o(u),i.g=s(u),i.b=c(u),i.opacity=l(u),i+""}}return r.gamma=t,r}(1);function KS(t){return function(e){var n=e.length,r=new Array(n),i=new Array(n),a=new Array(n),o,s;for(o=0;oYV(t[t.length-1]),QS=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(be),HV=vn(QS),JS=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(be),$V=vn(JS),tM=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(be),VV=vn(tM),eM=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(be),UV=vn(eM),nM=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(be),XV=vn(nM),rM=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(be),qV=vn(rM),iM=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(be),ZV=vn(iM),aM=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(be),KV=vn(aM),oM=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(be),QV=vn(oM),sM=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(be),JV=vn(sM),cM=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(be),tU=vn(cM),lM=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(be),eU=vn(lM),uM=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(be),nU=vn(uM),fM=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(be),rU=vn(fM),dM=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(be),iU=vn(dM),hM=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(be),aU=vn(hM),pM=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(be),oU=vn(pM),vM=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(be),sU=vn(vM),gM=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(be),cU=vn(gM),yM=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(be),lU=vn(yM),mM=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(be),uU=vn(mM),bM=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(be),fU=vn(bM),_M=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(be),dU=vn(_M),xM=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(be),hU=vn(xM),OM=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(be),pU=vn(OM),wM=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(be),vU=vn(wM),SM=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(be),gU=vn(SM);function yU(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-t*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-t*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-t*2475.67)))))))+")"}var mU=Math.PI/180,bU=180/Math.PI,MM=-.14861,iy=1.78277,ay=-.29227,Mh=-.90649,Pu=1.97294,EM=Pu*Mh,AM=Pu*iy,PM=iy*ay-Mh*MM;function _U(t){if(t instanceof Ls)return new Ls(t.h,t.s,t.l,t.opacity);t instanceof Ur||(t=fx(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(PM*r+EM*e-AM*n)/(PM+EM-AM),a=r-i,o=(Pu*(n-i)-ay*a)/Mh,s=Math.sqrt(o*o+a*a)/(Pu*i*(1-i)),c=s?Math.atan2(o,a)*bU-120:NaN;return new Ls(c<0?c+360:c,s,i,t.opacity)}function Sa(t,e,n,r){return arguments.length===1?_U(t):new Ls(t,e,n,r==null?1:r)}function Ls(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}nd(Ls,Sa,nv(fc,{brighter:function(t){return t=t==null?dc:Math.pow(dc,t),new Ls(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=t==null?ls:Math.pow(ls,t),new Ls(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*mU,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new Ur(255*(e+n*(MM*r+iy*i)),255*(e+n*(ay*r+Mh*i)),255*(e+n*(Pu*r)),this.opacity)}}));function TM(t){return function e(n){n=+n;function r(i,a){var o=t((i=Sa(i)).h,(a=Sa(a)).h),s=$c(i.s,a.s),c=$c(i.l,a.l),l=$c(i.opacity,a.opacity);return function(u){return i.h=o(u),i.s=s(u),i.l=c(Math.pow(u,n)),i.opacity=l(u),i+""}}return r.gamma=e,r}(1)}var Rmt=TM(GV),oy=TM($c),xU=oy(Sa(300,.5,0),Sa(-240,.5,1)),OU=oy(Sa(-100,.75,.35),Sa(80,1.5,.8)),wU=oy(Sa(260,.75,.35),Sa(80,1.5,.8)),Eh=Sa();function SU(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return Eh.h=360*t-100,Eh.s=1.5-1.5*e,Eh.l=.8-.9*e,Eh+""}var Ah=Bl(),MU=Math.PI/3,EU=Math.PI*2/3;function AU(t){var e;return t=(.5-t)*Math.PI,Ah.r=255*(e=Math.sin(t))*e,Ah.g=255*(e=Math.sin(t+MU))*e,Ah.b=255*(e=Math.sin(t+EU))*e,Ah+""}function PU(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-t*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+t*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-t*6838.66)))))))+")"}function Ph(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var TU=Ph(be("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),kU=Ph(be("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),CU=Ph(be("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),LU=Ph(be("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function NU(t,e,n,r,i,a){const{guide:o={}}=n,s=WU(t,e,n);if(typeof s!="string")return n;const c=YU(s,t,e,n),l=BU(s,c,n);return Object.assign(Object.assign(Object.assign({},n),$U(s,t,e,n,r)),{domain:l,range:HU(s,t,e,n,l,i,a),expectedDomain:c,guide:o,name:t,type:s})}function jU(t,e){const n={};for(const r of t){const{values:i,name:a}=r,o=e[a];for(const s of i){const{name:c,value:l}=s;n[c]=l.map(u=>o.map(u))}}return n}function RU(t,e){var n;const{components:r=[]}=e,i=["scale","encode","axis","legend","data","transform"],a=Array.from(new Set(t.flatMap(s=>s.channels.map(c=>c.scale)))),o=new Map(a.map(s=>[s.name,s]));for(const s of r){const c=FU(s);for(const l of c){const u=o.get(l),f=((n=s.scale)===null||n===void 0?void 0:n[l])||{},{independent:d=!1}=f;if(u&&!d){const{guide:h}=u,p=typeof h=="boolean"?{}:h;u.guide=at({},p,s),Object.assign(u,f)}else{const h=Object.assign(Object.assign({},f),{expectedDomain:f.domain,name:l,guide:Es(s,i)});a.push(h)}}}return a}function IU(t){if(!t||!Array.isArray(t))return[bs,bs];let e,n;return[a=>{var o;e=a.map.bind(a),n=(o=a.invert)===null||o===void 0?void 0:o.bind(a);const s=t.filter(([d])=>typeof d=="function"),c=t.filter(([d])=>typeof d!="function"),l=new Map(c);if(a.map=d=>{for(const[h,p]of s)if(h(d))return p;return l.has(d)?l.get(d):e(d)},!n)return a;const u=new Map(c.map(([d,h])=>[h,d])),f=new Map(s.map(([d,h])=>[h,d]));return a.invert=d=>f.has(d)?d:u.has(d)?u.get(d):n(d),a},a=>(e!==null&&(a.map=e),n!==null&&(a.invert=n),a)]}function kM(t,e){const n=Object.keys(t);for(const r of Object.values(e)){const{name:i}=r.getOptions();if(!(i in t))t[i]=r;else{const a=n.filter(c=>c.startsWith(i)).map(c=>+(c.replace(i,"")||0)),o=Ke(a)+1,s=`${i}${o}`;t[s]=r,r.getOptions().key=s}}return t}function CM(t,e){const[n]=An("scale",e),{relations:r}=t,[i]=IU(r),a=n(t);return i(a)}function DU(t){const e=t.flatMap(n=>Array.from(n.values())).flatMap(n=>n.channels.map(r=>r.scale));LM(e,"x"),LM(e,"y")}function FU(t){const{channels:e=[],type:n,scale:r={}}=t,i=["shape","color","opacity","size"];return e.length!==0?e:n==="axisX"?["x"]:n==="axisY"?["y"]:n==="legends"?Object.keys(r).filter(a=>i.includes(a)):[]}function LM(t,e){const n=t.filter(({name:a,facet:o=!0})=>o&&a===e),r=n.flatMap(a=>a.domain),i=n.every(NM)?Ha(r):n.every(jM)?Array.from(new Set(r)):null;if(i!==null)for(const a of n)a.domain=i}function BU(t,e,n){const{ratio:r}=n;return r==null?e:NM({type:t})?zU(e,r,t):jM({type:t})?GU(e,r):e}function zU(t,e,n){const r=t.map(Number),i=new Fr({domain:r,range:[r[0],r[0]+(r[r.length-1]-r[0])*e]});return n==="time"?t.map(a=>new Date(i.map(a))):t.map(a=>i.map(a))}function GU(t,e){const n=Math.round(t.length*e);return t.slice(0,n)}function NM(t){const{type:e}=t;return typeof e!="string"?!1:["linear","log","pow","time"].includes(e)}function jM(t){const{type:e}=t;return typeof e!="string"?!1:["band","point","ordinal"].includes(e)}function WU(t,e,n){const{type:r,domain:i,range:a,quantitative:o,ordinal:s}=n;return r!==void 0?r:rX(e)?"identity":typeof a=="string"?"linear":(i||a||[]).length>2?sy(t,s):i!==void 0?FM([i])?sy(t,s):BM(e)?"time":IM(t,a,o):FM(e)?sy(t,s):BM(e)?"time":IM(t,a,o)}function YU(t,e,n,r){const{domain:i}=r;if(i!==void 0)return i;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":case"quantize":case"threshold":return DM(QU(n,r),r);case"band":case"ordinal":case"point":return JU(n);case"quantile":return tX(n);case"sequential":return DM(eX(n),r);default:return[]}}function HU(t,e,n,r,i,a,o){const{range:s}=r;if(typeof s=="string")return VU(s);if(s!==void 0)return s;const{rangeMin:c,rangeMax:l}=r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":{const u=RM(n,r,i,a,o),[f,d]=nX(e,u);return[c!=null?c:f,l!=null?l:d]}case"band":case"point":{const u=e==="size"?5:0,f=e==="size"?10:1;return[c!=null?c:u,l!=null?l:f]}case"ordinal":return RM(n,r,i,a,o);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}function $U(t,e,n,r,i){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return qU(i,r);case"band":case"point":return ZU(t,e,i,r);case"sequential":return XU(r);default:return r}}function RM(t,e,n,r,i){const[a]=An("palette",i),{category10:o,category20:s}=r,c=gG(t.flat()).length<=o.length?o:s,{palette:l=c,offset:u}=e;if(Array.isArray(l))return l;try{return a({type:l})}catch(f){const d=UU(l,n,u);if(d)return d;throw new Error(`Unknown Component: ${l} `)}}function VU(t){return t.split("-")}function UU(t,e,n=r=>r){if(!t)return null;const r=mo(t),i=te[`scheme${r}`],a=te[`interpolate${r}`];if(!i&&!a)return null;if(i){if(!i.some(Array.isArray))return i;const o=i[e.length];if(o)return o}return e.map((o,s)=>a(n(s/e.length)))}function XU(t){const{palette:e="ylGnBu",offset:n}=t,r=mo(e),i=te[`interpolate${r}`];if(!i)throw new Error(`Unknown palette: ${r}`);return{interpolator:n?a=>i(n(a)):i}}function qU(t,e){const{interpolate:n=du,nice:r=!1,tickCount:i=5}=e;return Object.assign(Object.assign({},e),{interpolate:n,nice:r,tickCount:i})}function ZU(t,e,n,r){if(r.padding!==void 0||r.paddingInner!==void 0||r.paddingOuter!==void 0)return Object.assign(Object.assign({},r),{unknown:NaN});const i=KU(t,e,n),{paddingInner:a=i,paddingOuter:o=i}=r;return Object.assign(Object.assign({},r),{paddingInner:a,paddingOuter:o,padding:i,unknown:NaN})}function KU(t,e,n){return e==="enterDelay"||e==="enterDuration"||e==="size"?0:t==="band"?XS(n)?0:.1:t==="point"?.5:0}function sy(t,e){return e||(iX(t)?"point":"ordinal")}function IM(t,e,n){return n||(t!=="color"||e?"linear":"sequential")}function DM(t,e){if(t.length===0)return t;const{domainMin:n,domainMax:r}=e,[i,a]=t;return[n!=null?n:i,r!=null?r:a]}function QU(t,e){const{zero:n=!1}=e;let r=1/0,i=-1/0;for(const a of t)for(const o of a)un(o)&&(r=Math.min(r,+o),i=Math.max(i,+o));return r===1/0?[]:n?[Math.min(0,r),i]:[r,i]}function JU(t){return Array.from(new Set(t.flat()))}function tX(t){return t.flat().sort()}function eX(t){let e=1/0,n=-1/0;for(const r of t)for(const i of r)un(i)&&(e=Math.min(e,+i),n=Math.max(n,+i));return e===1/0?[]:[e<0?-n:e,n]}function nX(t,e){return t==="enterDelay"?[0,1e3]:t=="enterDuration"?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:t==="color"?[vG(e),xO(e)]:t==="opacity"?[0,1]:t==="size"?[1,10]:[0,1]}function FM(t){return cy(t,e=>{const n=typeof e;return n==="string"||n==="boolean"})}function BM(t){return cy(t,e=>e instanceof Date)}function rX(t){return cy(t,Ec)}function cy(t,e){for(const n of t)if(n.some(e))return!0;return!1}function iX(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")}function aX(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t==="enterDelay"||t==="enterDuration"||t==="updateDelay"||t==="updateDuration"||t==="exitDelay"||t==="exitDuration"}function oX(t){if(!t||!t.type)return!1;if(typeof t.type=="function")return!0;const{type:e,domain:n,range:r,interpolator:i}=t,a=n&&n.length>0,o=r&&r.length>0;return!!(["linear","sqrt","log","time","pow","threshold","quantize","quantile","ordinal","band","point"].includes(e)&&a&&o||["sequential"].includes(e)&&a&&(o||i)||["constant","identity"].includes(e)&&o)}const sX={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},cX={threshold:"threshold",quantize:"quantize",quantile:"quantile"},lX={ordinal:"ordinal",band:"band",point:"point"},uX={constant:"constant"};var To=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);iu!==null),s=[],c=xX(e,t,n);if(s.push(...c),i){const{props:u}=a("title"),{defaultPosition:f,defaultOrientation:d,defaultOrder:h,defaultSize:p,defaultCrossPadding:v}=u,g=typeof i=="string"?{title:i}:i;s.push(Object.assign({type:"title",position:f,orientation:d,order:h,crossPadding:v[0],defaultSize:p},g))}return gX(o,r).forEach(([u,f])=>{const{props:d}=a(u),{defaultPosition:h,defaultPlane:p="xy",defaultOrientation:v,defaultSize:g,defaultOrder:y,defaultLength:m,defaultPadding:b=[0,0],defaultCrossPadding:_=[0,0]}=d,x=at({},...f),{guide:O,field:w}=x,S=Array.isArray(O)?O:[O];for(const M of S){const[E,A]=bX(u,h,v,M,f,o,r);if(!E&&!A)continue;const C=E==="left"||E==="right",P=C?b[1]:b[0],T=C?_[1]:_[0],{size:k,order:N=y,length:F=m,padding:R=P,crossPadding:I=T}=M;s.push(Object.assign(Object.assign({title:w},M),{defaultSize:g,length:F,position:E,plane:p,orientation:A,padding:R,order:N,crossPadding:I,size:k,type:u,scales:f}))}}),s}function zM(t,e,n,r,i){const[a]=An("component",r),{scaleInstances:o,scale:s,bbox:c}=t,l=To(t,["scaleInstances","scale","bbox"]),u={bbox:c,library:r};return a(l)({coordinate:e,library:r,markState:i,scales:o,theme:n,value:u,scale:s})}function dX(t){return t.map(e=>{const n=at(e,e.style);return delete n.style,n})}function Imt(t){return t.flatMap(e=>e.type=="group"?e.children:e)}function GM(t,e){const n=["left","right","bottom","top"];return Bd(t,({type:a,position:o,group:s})=>n.includes(o)?s===void 0?a.startsWith("legend")?`legend-${o}`:Symbol("independent"):s==="independent"?Symbol("independent"):s:Symbol("independent")).flatMap(([,a])=>{if(a.length===1)return a[0];if(e!==void 0){const u=a.filter(v=>v.length!==void 0).map(v=>v.length),f=Di(u);if(f>e)return a.forEach(v=>v.group=Symbol("independent")),a;const d=e-f,h=a.length-u.length,p=d/h;a.forEach(v=>{v.length===void 0&&(v.length=p)})}const o=Ke(a,u=>u.size),s=Ke(a,u=>u.order),c=Ke(a,u=>u.crossPadding),l=a[0].position;return{type:"group",size:o,order:s,position:l,children:a,crossPadding:c}})}function hX(t,e){const n=["shape","size","color","opacity"],r=(d,h)=>d==="constant"&&h==="size",i=t.filter(({type:d,name:h})=>typeof d=="string"&&n.includes(h)&&!r(d,h)),a=i.filter(({type:d})=>d==="constant"),o=i.filter(({type:d})=>d!=="constant"),c=Bd(o,d=>d.field?d.field:Symbol("independent")).map(([d,h])=>[d,[...h,...a]]).filter(([,d])=>d.some(h=>h.type!=="constant")),l=new Map(c);if(l.size===0)return[];const u=d=>d.sort(([h],[p])=>h.localeCompare(p));return Array.from(l).map(([,d])=>{const p=yG(d).sort((v,g)=>g.length-v.length).map(v=>({combination:v,option:v.map(g=>[g.name,pX(g)])}));for(const{option:v,combination:g}of p)if(!v.every(y=>y[1]==="constant")&&v.every(y=>y[1]==="discrete"||y[1]==="constant"))return["legendCategory",g];for(const[v,g]of _G)for(const{option:y,combination:m}of p)if(g.some(b=>SO(u(b),u(y))))return[v,m];return null}).filter(un)}function pX(t){const{type:e}=t;return typeof e!="string"?null:e in sX?"continuous":e in lX?"discrete":e in cX?"distribution":e in uX?"constant":null}function vX(t,e){return t.map(n=>{const{name:r}=n;if(xV(e)||XS(e)||Hc(e)&&(Cs(e)||Au(e)))return null;if(r.startsWith("x"))return Cs(e)?["axisArc",[n]]:Au(e)?["axisLinear",[n]]:[Hc(e)?"axisY":"axisX",[n]];if(r.startsWith("y"))return Cs(e)?["axisLinear",[n]]:Au(e)?["axisArc",[n]]:[Hc(e)?"axisX":"axisY",[n]];if(r.startsWith("z"))return["axisZ",[n]];if(r.startsWith("position")){if(SV(e))return["axisRadar",[n]];if(!Cs(e))return["axisY",[n]]}return null}).filter(un)}function gX(t,e){const n=t.filter(r=>oX(r));return[...hX(n,e),...vX(n,e)]}function ly(t){const e=ea(t,"polar");if(e.length){const r=e[e.length-1],{startAngle:i,endAngle:a}=MO(r);return[i,a]}const n=ea(t,"radial");if(n.length){const r=n[n.length-1],{startAngle:i,endAngle:a}=EO(r);return[i,a]}return[-Math.PI/2,Math.PI/2*3]}function yX(t){const e=/position(\d*)/g.exec(t);return e?+e[1]:null}function mX(t,e,n,r,i){const{name:a}=n[0];if(t==="axisRadar"){const o=r.filter(f=>f.name.startsWith("position")),s=yX(a);if(a===o.slice(-1)[0].name||s===null)return[null,null];const[c,l]=ly(i);return["center",(l-c)/(o.length-1)*s+c]}if(t==="axisY"&&OV(i))return Hc(i)?["center","horizontal"]:["center","vertical"];if(t==="axisLinear"){const[o]=ly(i);return["center",o]}return t==="axisArc"?e[0]==="inner"?["inner",null]:["outer",null]:Cs(i)?["center",null]:Au(i)?["center",null]:t==="axisX"&&wV(i)||t==="axisX"&&MV(i)?["top",null]:e}function bX(t,e,n,r,i,a,o){const[s]=ly(o),c=[r.position||e,s!=null?s:n];return typeof t=="string"&&t.startsWith("axis")?mX(t,c,i,a,o):typeof t=="string"&&t.startsWith("legend")&&Cs(o)&&r.position==="center"?["center","vertical"]:c}function _X(t,e,n=[]){return t==="x"?Hc(n)?`${e}Y`:`${e}X`:t==="y"?Hc(n)?`${e}X`:`${e}Y`:null}function xX(t,e,n){const[,r]=An("component",n),{coordinates:i}=t;function a(o,s,c,l){const u=_X(s,o,i);if(!l||!u)return;const{props:f}=r(u),{defaultPosition:d,defaultSize:h,defaultOrder:p,defaultCrossPadding:[v]}=f;return Object.assign(Object.assign({position:d,defaultSize:h,order:p,type:u,crossPadding:v},l),{scales:[c]})}return e.filter(o=>o.slider||o.scrollbar).flatMap(o=>{const{slider:s,scrollbar:c,name:l}=o;return[a("slider",l,o,s),a("scrollbar",l,o,c)]}).filter(o=>!!o)}function WM(t,e,n,r,i,a){const{type:o}=t;if(!["left","right","bottom","top"].includes(r)||typeof o!="string")return;const c=o;return(()=>c.startsWith("axis")?EX:c.startsWith("group")?OX:c.startsWith("legendContinuous")?AX:c==="legendCategory"?PX:c.startsWith("slider")?MX:c==="title"?SX:c.startsWith("scrollbar")?wX:()=>{})()(t,e,n,r,i,a)}function OX(t,e,n,r,i,a){const{children:o}=t,s=Ke(o,l=>l.crossPadding);o.forEach(l=>l.crossPadding=s),o.forEach(l=>WM(l,e,n,r,i,a));const c=Ke(o,l=>l.size);t.size=c,o.forEach(l=>l.size=c)}function wX(t,e,n,r,i,a){const{trackSize:o=6}=at({},i.scrollbar,t);t.size=o}function SX(t,e,n,r,i,a){const o=at({},i.title,t),{title:s,subtitle:c,spacing:l=0}=o,u=To(o,["title","subtitle","spacing"]);if(s){const f=At(u,"title"),d=Lh(s,f);t.size=d.height}if(c){const f=At(u,"subtitle"),d=Lh(c,f);t.size+=l+d.height}}function MX(t,e,n,r,i,a){const o=()=>{const{slider:u}=i;return at({},u,t)},{trackSize:s,handleIconSize:c}=o(),l=Math.max(s,c*2.4);t.size=l}function EX(t,e,n,r,i,a){t.transform=t.transform||[{type:"hide"}];const o=r==="left"||r==="right",s=YM(t,r,i),{tickLength:c=0,labelSpacing:l=0,titleSpacing:u=0,labelAutoRotate:f}=s,d=To(s,["tickLength","labelSpacing","titleSpacing","labelAutoRotate"]),h=Th(t,a),p=kh(d,h),v=c+l;if(p&&p.length){const y=Ke(p,b=>b.width),m=Ke(p,b=>b.height);if(o)t.size=y+v;else{const{tickFilter:b,labelTransform:_}=t;CX(h,p,e,n,b)&&!_&&f!==!1&&f!==null?(t.labelTransform="rotate(90)",t.size=y+v):t.size=m+v}}else t.size=c;const g=Ch(d);g&&(o?t.size+=u+g.width:t.size+=u+g.height)}function AX(t,e,n,r,i,a){const s=(()=>{const{legendContinuous:_}=i;return at({},_,t)})(),{labelSpacing:c=0,titleSpacing:l=0}=s,u=To(s,["labelSpacing","titleSpacing"]),f=r==="left"||r==="right",d=At(u,"ribbon"),{size:h}=d,p=At(u,"handleIcon"),{size:v}=p,g=Math.max(h,v*2.4);t.size=g;const y=Th(t,a),m=kh(u,y);if(m){const _=f?"width":"height",x=Ke(m,O=>O[_]);t.size+=x+c}const b=Ch(u);b&&(f?t.size=Math.max(t.size,b.width):t.size+=l+b.height)}function PX(t,e,n,r,i,a){const s=(()=>{const{legendCategory:T}=i,{title:k}=t,[N,F]=Array.isArray(k)?[k,void 0]:[void 0,k];return at({title:N},T,Object.assign(Object.assign({},t),{title:F}))})(),{itemSpacing:c,itemMarkerSize:l,titleSpacing:u,rowPadding:f,colPadding:d,maxCols:h=1/0,maxRows:p=1/0}=s,v=To(s,["itemSpacing","itemMarkerSize","titleSpacing","rowPadding","colPadding","maxCols","maxRows"]),{cols:g,length:y}=t,m=T=>Math.min(T,p),b=T=>Math.min(T,h),_=r==="left"||r==="right",x=y===void 0?e+(_?0:n[0]+n[1]):y,O=Ch(v),w=Th(t,a),S=kh(v,w,"itemLabel"),M=Math.max(S[0].height,l)+f,E=(T,k=0)=>l+T+c[0]+k;_?(()=>{let T=-1/0,k=0,N=1,F=0,R=-1/0,I=-1/0;const z=O?O.height:0,W=x-z;for(const{width:V}of S){const $=E(V,d);T=Math.max(T,$),k+M>W?(N++,R=Math.max(R,F),I=Math.max(I,k),F=1,k=M):(k+=M,F++)}N<=1&&(R=F,I=k),t.size=T*b(N),t.length=I+z,at(t,{cols:b(N),gridRow:R})})():typeof g=="number"?(()=>{const T=Math.ceil(S.length/g),k=Ke(S,N=>E(N.width))*g;t.size=M*m(T)-f,t.length=Math.min(k,x)})():(()=>{let T=1,k=0,N=-1/0;for(const{width:F}of S){const R=E(F,d);k+R>x?(N=Math.max(N,k),k=R,T++):k+=R}T===1&&(N=k),t.size=M*m(T)-f,t.length=N})(),O&&(_?t.size=Math.max(t.size,O.width):t.size+=u+O.height)}function Th(t,e){const[n]=An("scale",e),{scales:r,tickCount:i,tickMethod:a}=t,o=r.find(s=>s.type!=="constant"&&s.type!=="identity");return i!==void 0&&(o.tickCount=i),a!==void 0&&(o.tickMethod=a),n(o)}function kh(t,e,n="label"){const{labelFormatter:r,tickFilter:i,label:a=!0}=t,o=To(t,["labelFormatter","tickFilter","label"]);if(!a)return null;const s=TX(e,r,i),c=At(o,n),l=s.map((d,h)=>Object.fromEntries(Object.entries(c).map(([p,v])=>[p,typeof v=="function"?v(d,h):v]))),u=s.map((d,h)=>{const p=l[h];return Lh(d,p)});if(!l.some(d=>d.transform)){const d=s.map((h,p)=>p);t.indexBBox=new Map(d.map(h=>[h,[s[h],u[h]]]))}return u}function Ch(t){const e=l=>l===!1||l===null,{title:n}=t,r=To(t,["title"]);if(e(n)||n===void 0)return null;const i=At(r,"title"),{direction:a,transform:o}=i,s=Array.isArray(n)?n.join(","):n;return typeof s!="string"?null:Lh(s,Object.assign(Object.assign({},i),{transform:o||(a==="vertical"?"rotate(-90)":"")}))}function YM(t,e,n){const{title:r}=t,[i,a]=Array.isArray(r)?[r,void 0]:[void 0,r],{axis:o,[`axis${rg(e)}`]:s}=n;return at({title:i},o,s,Object.assign(Object.assign({},t),{title:a}))}function HM(t,e){const n=t.getTicks?t.getTicks():t.getOptions().domain;return e?n.filter(e):n}function TX(t,e,n){const i=HM(t,n).map(o=>typeof o=="number"?Yd(o):o),a=e?typeof e=="string"?bo(e):e:t.getFormatter?t.getFormatter():o=>`${o}`;return i.map(a)}function kX(t,e){return t.getBandWidth?t.getBandWidth(e)/2:0}function CX(t,e,n,r,i){if(Di(e,h=>h.width)>n)return!0;const o=t.clone();o.update({range:[0,n]});const s=HM(t,i),c=s.map(h=>o.map(h)+kX(o,h)),l=s.map((h,p)=>p),u=-r[0],f=n+r[1],d=(h,p)=>{const{width:v}=p;return[h-v/2,h+v/2]};for(let h=0;hf)return!0;const y=c[h+1];if(y){const[m]=d(y,e[h+1]);if(g>m)return!0}}return!1}function Lh(t,e){const n=LX(t),{filter:r}=e,i=To(e,["filter"]);return n.attr(Object.assign(Object.assign({},i),{visibility:"none"})),n.getBBox()}function LX(t){return t instanceof Dr?t:new fi({style:{text:`${t}`}})}function Oi(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function NX(t){const e=t.find(({type:n})=>n==="axisZ");if(e){const n=t.find(({type:i})=>i==="axisX");n.plane="xy";const r=t.find(({type:i})=>i==="axisY");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]}))}}function jX(t,e,n,r){var i,a;const{width:o,height:s,depth:c,x:l=0,y:u=0,z:f=0,inset:d=(i=n.inset)!==null&&i!==void 0?i:0,insetLeft:h=d,insetTop:p=d,insetBottom:v=d,insetRight:g=d,margin:y=(a=n.margin)!==null&&a!==void 0?a:0,marginLeft:m=y,marginBottom:b=y,marginTop:_=y,marginRight:x=y,padding:O=n.padding,paddingBottom:w=O,paddingLeft:S=O,paddingRight:M=O,paddingTop:E=O}=IX(t,e,n,r),A=1/4,C=(yt,Rt,Yt,Qt,Jt)=>{const{marks:pe}=e;if(pe.length===0)return[Qt,Jt];if(yt-Qt-Jt-yt*A>0)return[Qt,Jt];const ye=yt*(1-A);return[Rt==="auto"?ye*Qt/(Qt+Jt):Qt,Yt==="auto"?ye*Jt/(Qt+Jt):Jt]},P=yt=>yt==="auto"?20:yt!=null?yt:20,T=P(E),k=P(w),N=$M(t,s-T-k,[T+_,k+b],["left","right"],e,n,r),{paddingLeft:F,paddingRight:R}=N,I=o-m-x,[z,W]=C(I,S,M,F,R),V=I-z-W,$=$M(t,V,[z+m,W+x],["bottom","top"],e,n,r),{paddingTop:J,paddingBottom:ct}=$,pt=s-b-_,[it,nt]=C(pt,w,E,ct,J),xt=pt-it-nt;return{width:o,height:s,depth:c,insetLeft:h,insetTop:p,insetBottom:v,insetRight:g,innerWidth:V,innerHeight:xt,paddingLeft:z,paddingRight:W,paddingTop:nt,paddingBottom:it,marginLeft:m,marginBottom:b,marginTop:_,marginRight:x,x:l,y:u,z:f}}function RX(t){const{height:e,width:n,padding:r=0,paddingLeft:i=r,paddingRight:a=r,paddingTop:o=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:v=h,insetTop:g=h,insetBottom:y=h}=t,m=x=>x==="auto"?20:x,b=n-m(i)-m(a)-l-u-p-v,_=e-m(o)-m(s)-f-d-g-y;return{width:b,height:_}}function IX(t,e,n,r){const{coordinates:i}=e;if(!Cs(i)&&!Au(i))return e;const a=t.filter(y=>typeof y.type=="string"&&y.type.startsWith("axis"));if(a.length===0)return e;const o=a.map(y=>{const m=y.type==="axisArc"?"arc":"linear";return YM(y,m,n)}),s=Ke(o,y=>{var m;return(m=y.labelSpacing)!==null&&m!==void 0?m:0}),c=a.flatMap((y,m)=>{const b=o[m],_=Th(y,r);return kh(b,_)}).filter(un),l=Ke(c,y=>y.height)+s,u=a.flatMap((y,m)=>{const b=o[m];return Ch(b)}).filter(y=>y!==null),f=u.length===0?0:Ke(u,y=>y.height),{inset:d=l,insetLeft:h=d,insetBottom:p=d,insetTop:v=d+f,insetRight:g=d}=e;return Object.assign(Object.assign({},e),{insetLeft:h,insetBottom:p,insetTop:v,insetRight:g})}function $M(t,e,n,r,i,a,o){const s=Cn(t,p=>p.position),{padding:c=a.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 p of r){const v=`padding${rg(vS(p))}`,g=s.get(p)||[],y=h[v],m=M=>{M.size===void 0&&(M.size=M.defaultSize)},b=M=>{M.type==="group"?(M.children.forEach(m),M.size=Ke(M.children,E=>E.size)):M.size=M.defaultSize},_=M=>{M.size||(y!=="auto"?b(M):(WM(M,e,n,p,a,o),m(M)))},x=M=>{M.type.startsWith("axis")&&M.labelAutoHide===void 0&&(M.labelAutoHide=!0)},O=p==="bottom"||p==="top",w=Oi(g,M=>M.order),S=g.filter(M=>M.type.startsWith("axis")&&M.order==w);if(S.length&&(S[0].crossPadding=0),typeof y=="number")g.forEach(m),g.forEach(x);else if(g.length===0)h[v]=0;else{const M=O?e+n[0]+n[1]:e,E=GM(g,M);E.forEach(_);const A=E.reduce((C,{size:P,crossPadding:T=12})=>C+P+T,0);h[v]=A}}return h}function DX(t,e,n){const r=Cn(t,O=>`${O.plane||"xy"}-${O.position}`),{paddingLeft:i,paddingRight:a,paddingTop:o,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:d,innerWidth:h,insetBottom:p,insetLeft:v,insetRight:g,insetTop:y,height:m,width:b,depth:_}=n,x={xy:uy({width:b,height:m,paddingLeft:i,paddingRight:a,paddingTop:o,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:d,innerWidth:h,insetBottom:p,insetLeft:v,insetRight:g,insetTop:y}),yz:uy({width:_,height:m,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:_,innerHeight:m,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0}),xz:uy({width:b,height:_,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:b,innerHeight:_,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0})};for(const[O,w]of r.entries()){const[S,M]=O.split("-"),E=x[S][M],[A,C]=OO(w,P=>typeof P.type!="string"?!1:!!(M==="center"||P.type.startsWith("axis")&&["inner","outer"].includes(M)));A.length&&FX(A,e,E,M),C.length&&UX(w,e,E)}}function uy({width:t,height:e,paddingLeft:n,paddingRight:r,paddingTop:i,paddingBottom:a,marginLeft:o,marginTop:s,marginBottom:c,marginRight:l,innerHeight:u,innerWidth:f,insetBottom:d,insetLeft:h,insetRight:p,insetTop:v}){const g=n+o,y=i+s,m=r+l,b=a+c,_=t-o-l,x=[g+h,y+v,f-h-p,u-v-d,"center",null,null];return{top:[g,0,f,y,"vertical",!0,Gn,o,_],right:[t-m,y,m,u,"horizontal",!1,Gn],bottom:[g,e-b,f,b,"vertical",!1,Gn,o,_],left:[0,y,g,u,"horizontal",!0,Gn],"top-left":[g,0,f,y,"vertical",!0,Gn],"top-right":[g,0,f,y,"vertical",!0,Gn],"bottom-left":[g,e-b,f,b,"vertical",!1,Gn],"bottom-right":[g,e-b,f,b,"vertical",!1,Gn],center:x,inner:x,outer:x}}function FX(t,e,n,r){const[i,a]=OO(t,o=>!!(typeof o.type=="string"&&o.type.startsWith("axis")));BX(i,e,n,r),XX(a,e,n)}function BX(t,e,n,r){r==="center"?xG(e)?VX(t,e,n,r):fn(e)?WX(t,e,n):ru(e)&&YX(t,e,n,t[0].orientation):r==="inner"?zX(t,e,n):r==="outer"&&GX(t,e,n)}function zX(t,e,n){const[r,i,,a]=n,[o,s]=e.getCenter(),[c]=Hd(e),l=a/2,u=c*l,f=o-u,d=s-u;for(let h=0;hu%2===0).map(l=>l+r);for(let l=0;lu%2===1).map(l=>l+i);for(let l=0;ll==null?void 0:l(M.order,E.order));const _=M=>M==="title"||M==="group"||M.startsWith("legend"),x=(M,E,A)=>A===void 0?E:_(M)?A:E,O=(M,E,A)=>A===void 0?E:_(M)?A:E,w=c?h+y:h;for(let M=0,E=w;MM.type==="group");for(const M of S){const{bbox:E,children:A}=M,C=E[m],P=C/A.length,T=A.reduce((I,z)=>{var W;const V=(W=z.layout)===null||W===void 0?void 0:W.justifyContent;return V||I},"flex-start"),k=A.map((I,z)=>{const{length:W=P,padding:V=0}=I;return W+(z===A.length-1?0:V)}),N=Di(k),F=C-N,R=T==="flex-start"?0:T==="center"?F/2:F;for(let I=0,z=E[p]+R;Ioq(o)?o:{type:sq(i,o),value:o});return[t,Object.assign(Object.assign({},e),{encode:a})]}function JX(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i=_o(r,(a,o)=>{const{type:s}=a;return s!=="constant"||aX(o)?a:Object.assign(Object.assign({},a),{constant:!0})});return[t,Object.assign(Object.assign({},e),{encode:i})]}function tq(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const{library:a}=n,o=dq(a),s=_o(r,c=>o(i,c));return[t,Object.assign(Object.assign({},e),{encode:s})]}function eq(t,e,n){const{tooltip:r={}}=e;return za(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:Ec(r)&&VM(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function nq(t,e,n){const{data:r,encode:i,tooltip:a={}}=e;if(za(a))return[t,e];const o=f=>{if(!f)return f;if(typeof f=="string")return t.map(d=>({name:f,value:r[d][f]}));if(Ec(f)){const{field:d,channel:h,color:p,name:v=d,valueFormatter:g=O=>O}=f,y=typeof g=="string"?bo(g):g,m=h&&i[h],b=m&&i[h].field,_=v||b||h,x=[];for(const O of t){const w=d?r[O][d]:m?i[h].value[O]:null;x[O]={name:_,color:p,value:y(w)}}return x}if(typeof f=="function"){const d=[];for(const h of t){const p=f(r[h],h,r,i);Ec(p)?d[h]=p:d[h]={value:p}}return d}return f},{title:s,items:c=[]}=a,l=Vc(a,["title","items"]),u=Object.assign({title:o(s),items:Array.isArray(c)?c.map(o):[]},l);return[t,Object.assign(Object.assign({},e),{tooltip:u})]}function rq(t,e,n){const{encode:r}=e,i=Vc(e,["encode"]);if(!r)return[t,e];const a=Object.entries(r),o=a.filter(([,c])=>{const{value:l}=c;return Array.isArray(l[0])}).flatMap(([c,l])=>{const u=[[c,new Array(t.length).fill(void 0)]],{value:f}=l,d=Vc(l,["value"]);for(let h=0;h[h,Object.assign({type:"column",value:p},d)])}),s=Object.fromEntries([...a,...o]);return[t,Object.assign(Object.assign({},i),{encode:s})]}function iq(t,e,n){const{axis:r={},legend:i={},slider:a={},scrollbar:o={}}=e,s=(l,u)=>{if(typeof l=="boolean")return l?{}:null;const f=l[u];return f===void 0||f?f:null},c=typeof r=="object"?Array.from(new Set(["x","y",...Object.keys(r)])):["x","y"];return at(e,{scale:Object.assign(Object.assign({},Object.fromEntries(c.map(l=>{const u=s(o,l);return[l,Object.assign({guide:s(r,l),slider:s(a,l),scrollbar:u},u&&{ratio:u.ratio===void 0?.5:u.ratio})]}))),{color:{guide:s(i,"color")},size:{guide:s(i,"size")},shape:{guide:s(i,"shape")},opacity:{guide:s(i,"opacity")}})}),[t,e]}function aq(t,e,n){const{animate:r}=e;return r||r===void 0?[t,e]:(at(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e])}function oq(t){if(typeof t!="object"||t instanceof Date||t===null)return!1;const{type:e}=t;return un(e)}function sq(t,e){return typeof e=="function"?"transform":typeof e=="string"&&cq(t,e)?"field":"constant"}function cq(t,e){return Array.isArray(t)?t.some(n=>n[e]!==void 0):!1}function lq(t){if($n(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=Vc(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}var XM=function(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{l(r.next(u))}catch(f){o(f)}}function c(u){try{l(r.throw(u))}catch(f){o(f)}}function l(u){u.done?a(u.value):i(u.value).then(s,c)}l((r=r.apply(t,e||[])).next())})},uq=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);iun(h)),h=>h.map(([p,v])=>Object.assign({name:p},v)),([h])=>{var p;const v=(p=/([^\d]+)\d*$/.exec(h))===null||p===void 0?void 0:p[1],g=u.find(y=>y.name===v);return g!=null&&g.independent?h:v}),d=u.filter(h=>{const{name:p,required:v}=h;if(f.find(([g])=>g===p))return!0;if(v)throw new Error(`Missing encoding for channel: ${p}.`);return!1}).flatMap(h=>{const{name:p,scale:v,scaleKey:g,range:y,quantitative:m,ordinal:b}=h;return f.filter(([x])=>x.startsWith(p)).map(([x,O],w)=>{const S=O.some(F=>F.visual),M=O.some(F=>F.constant),E=s[x]||{},{independent:A=!1,key:C=g||x,type:P=M?"constant":S?"identity":v}=E,T=uq(E,["independent","key","type"]),k=P==="constant",N=k?void 0:y;return{name:x,values:O,scaleKey:A||k?Symbol("independent"):C,scale:Object.assign(Object.assign({type:P,range:N},T),{quantitative:m,ordinal:b})}})});return[a,Object.assign(Object.assign({},e),{index:i,channels:d,tooltip:l})]})}function dq(t){const[e]=An("encode",t);return(n,r)=>r===void 0||n===void 0?null:Object.assign(Object.assign({},r),{type:"column",value:e(r)(n),field:pq(r)})}function hq(t,e,n){return XM(this,void 0,void 0,function*(){const{library:r}=n,[i]=An("transform",r),{preInference:a=[],postInference:o=[]}=e,{transform:s=[]}=t,c=[ZX,UM,KX,QX,JX,tq,rq,aq,iq,eq,...a.map(i),...s.map(i),...o.map(i),nq];let l=[],u=t;for(const f of c)[l,u]=yield f(l,u,n);return[l,u]})}function pq(t){const{type:e,value:n}=t;return e==="field"&&typeof n=="string"?n:null}var Xa=function(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{l(r.next(u))}catch(f){o(f)}}function c(u){try{l(r.throw(u))}catch(f){o(f)}}function l(u){u.done?a(u.value):i(u.value).then(s,c)}l((r=r.apply(t,e||[])).next())})},ko=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{var T;return(T=/mark\.(.*)/.exec(P))===null||T===void 0?void 0:T[1]}).filter(un)),c=new Set(Object.keys(n).map(P=>{var T;return(T=/component\.(.*)/.exec(P))===null||T===void 0?void 0:T[1]}).filter(un)),l=P=>{const{type:T}=P;if(typeof T=="function"){const{props:k={}}=T,{composite:N=!0}=k;if(N)return"mark"}return typeof T!="string"?T:s.has(T)||c.has(T)?"mark":T},u=P=>l(P)==="mark",f=P=>l(P)==="standardView",d=P=>{const{type:T}=P;return typeof T!="string"?!1:!!c.has(T)},h=P=>{if(f(P))return[P];const T=l(P);return a({type:T,static:d(P)})(P)},p=[],v=new Map,g=new Map,y=[t],m=[];for(;y.length;){const P=y.shift();if(f(P)){const T=g.get(P),[k,N]=T?QM(T,P,n):yield ZM(P,n);v.set(k,P),p.push(k);const F=N.flatMap(h).map(R=>US(R,n));if(y.push(...F),F.every(f)){const R=yield Promise.all(F.map(I=>KM(I,n)));DU(R);for(let I=0;IP.key).join(P=>P.append("g").attr("className",z0).attr("id",T=>T.key).call(qM).each(function(T,k,N){hy(T,Kt(N),x,n,r),b.set(T,N)}),P=>P.call(qM).each(function(T,k,N){hy(T,Kt(N),x,n,r),_.set(T,N)}),P=>P.each(function(T,k,N){const F=N.nameInteraction.values();for(const R of F)R.destroy()}).remove());const O=(P,T,k)=>Array.from(P.entries()).map(([N,F])=>{const R=k||new Map,I=(V,$=J=>J)=>R.set(V,$),z=v.get(N),W=gq(Kt(F),z,n,r);return{view:N,container:F,options:z,setState:I,update:(V,$)=>Xa(this,void 0,void 0,function*(){const ct=ng(Array.from(R.values()))(z);return yield W(ct,V,()=>{sr($)&&T(P,$,R)})})}}),w=(P=_,T,k)=>{var N;const F=O(P,w,k);for(const R of F){const{options:I,container:z}=R,W=z.nameInteraction;let V=jh(I);T&&(V=V.filter($=>T.includes($[0])));for(const $ of V){const[J,ct]=$,pt=W.get(J);if(pt&&((N=pt.destroy)===null||N===void 0||N.call(pt)),ct){const nt=dy(R.view,J,ct,o)(R,F,r.emitter);W.set(J,{destroy:nt})}}}},S=O(b,w);for(const P of S){const{options:T}=P,k=new Map;P.container.nameInteraction=k;for(const N of jh(T)){const[F,R]=N;if(R){const z=dy(P.view,F,R,o)(P,S,r.emitter);k.set(F,{destroy:z})}}}w();const{width:M,height:E}=t,A=[];for(const P of m){const T=new Promise(k=>Xa(this,void 0,void 0,function*(){for(const N of P){const F=Object.assign({width:M,height:E},N);yield fy(F,e,n,r)}k()}));A.push(T)}r.views=p,(i=r.animations)===null||i===void 0||i.forEach(P=>P==null?void 0:P.cancel()),r.animations=x,r.emitter.emit(Ze.AFTER_PAINT);const C=x.filter(un).map(Cq).map(P=>P.finished);return Promise.all([...C,...A])})}function qM(t){t.style("transform",e=>`translate(${e.layout.x}, ${e.layout.y})`)}function vq(t){const[,e]=An("interaction",t);return n=>{const[r,i]=n;try{return[r,e(r)]}catch(a){return[r,i.type]}}}function gq(t,e,n,r){const i=vq(n),a=c=>c[1]&&c[1].props&&c[1].props.reapplyWhenUpdate,s=jh(e).map(i).filter(a).map(c=>c[0]);return(c,l,u)=>Xa(this,void 0,void 0,function*(){const f=[],[d,h]=yield ZM(c,n);hy(d,t,f,n,r);for(const p of s.filter(v=>v!==l))yq(p,t,c,d,n,r);for(const p of h)fy(p,t,n,r);return u(),{options:c,view:d}})}function yq(t,e,n,r,i,a){var o;const[s]=An("interaction",i),l=e.node().nameInteraction,u=jh(n).find(([v])=>v===t),f=l.get(t);if(!f||((o=f.destroy)===null||o===void 0||o.call(f),!u[1]))return;const d=dy(r,t,u[1],s),h={options:n,view:r,container:e.node(),update:v=>Promise.resolve(v)},p=d(h,[],a.emitter);l.set(t,{destroy:p})}function ZM(t,e){return Xa(this,void 0,void 0,function*(){const n=yield bq(t,e),r=mq(n);t.interaction=r.interaction,t.coordinate=r.coordinate,t.marks=[...r.marks,...r.components];const i=US(r,e),a=yield KM(i,e);return QM(a,i,e)})}function mq(t){const{coordinate:e={},interaction:n={},style:r={},marks:i}=t,a=ko(t,["coordinate","interaction","style","marks"]),o=i.map(d=>d.coordinate||{}),s=i.map(d=>d.interaction||{}),c=i.map(d=>d.viewStyle||{}),l=[...o,e].reduceRight((d,h)=>at(d,h),{}),u=[n,...s].reduce((d,h)=>at(d,h),{}),f=[...c,r].reduce((d,h)=>at(d,h),{});return Object.assign(Object.assign({},a),{marks:i,coordinate:l,interaction:u,style:f})}function bq(t,e){return Xa(this,void 0,void 0,function*(){const[n,r]=An("mark",e),i=new Set(Object.keys(e).map(d=>{var h;return(h=/component\.(.*)/.exec(d))===null||h===void 0?void 0:h[1]}).filter(un)),{marks:a}=t,o=[],s=[],c=[...a],{width:l,height:u}=RX(t),f={options:t,width:l,height:u};for(;c.length;){const[d]=c.splice(0,1),h=yield nE(d,e),{type:p=Mc("G2Mark type is required."),key:v}=h;if(i.has(p))s.push(h);else{const{props:g={}}=r(p),{composite:y=!0}=g;if(!y)o.push(h);else{const{data:m}=h,b=Object.assign(Object.assign({},h),{data:m&&(Array.isArray(m)?m:m.value)}),_=yield n(b,f),x=Array.isArray(_)?_:[_];c.unshift(...x.map((O,w)=>Object.assign(Object.assign({},O),{key:`${v}-${w}`})))}}}return Object.assign(Object.assign({},t),{marks:o,components:s})})}function KM(t,e){return Xa(this,void 0,void 0,function*(){const[n]=An("theme",e),[,r]=An("mark",e),{theme:i,marks:a,coordinates:o=[]}=t,s=n(eE(i)),c=new Map;for(const u of a){const{type:f}=u,{props:d={}}=r(f),h=yield fq(u,d,e);if(h){const[p,v]=h;c.set(p,v)}}const l=Cn(Array.from(c.values()).flatMap(u=>u.channels),({scaleKey:u})=>u);for(const u of l.values()){const f=u.reduce((b,{scale:_})=>at(b,_),{}),{scaleKey:d}=u[0],{values:h}=u[0],p=Array.from(new Set(h.map(b=>b.field).filter(un))),v=at({guide:{title:p.length===0?void 0:p},field:p[0]},f),{name:g}=u[0],y=u.flatMap(({values:b})=>b.map(_=>_.value)),m=Object.assign(Object.assign({},NU(g,y,v,o,s,e)),{key:d});u.forEach(b=>b.scale=m)}return c})}function dy(t,e,n,r){const i=t.theme,a=typeof e=="string"?i[e]||{}:{};return r(at(a,Object.assign({type:e},n)))}function QM(t,e,n){const[r]=An("mark",n),[i]=An("theme",n),[a]=An("labelTransform",n),{key:o,frame:s=!1,theme:c,clip:l,style:u={},labelTransform:f=[]}=e,d=i(eE(c)),h=Array.from(t.values()),p=RU(h,e),v=dX(fX(Rq(Array.from(p),h,t),e,n)),g=jX(v,e,d,n),y=_V(g,e,n),m=s?at({mainLineWidth:1,mainStroke:"#000"},u):u;DX(GM(v),y,g),NX(v);const b={};for(const O of v){const{scales:w=[]}=O,S=[];for(const M of w){const{name:E}=M,A=CM(M,n);S.push(A),E==="y"&&A.update(Object.assign(Object.assign({},A.getOptions()),{xScale:b.x})),kM(b,{[E]:A})}O.scaleInstances=S}const _=[];for(const[O,w]of t.entries()){const{children:S,dataDomain:M,modifier:E,key:A}=O,{index:C,channels:P,tooltip:T}=w,k=Object.fromEntries(P.map(({name:nt,scale:xt})=>[nt,xt])),N=_o(k,nt=>CM(nt,n));kM(b,N);const F=jU(P,N),R=r(O),[I,z,W]=Oq(R(C,N,F,y)),V=M||I.length,$=E?E(z,V,g):[],J=nt=>{var xt,yt;return(yt=(xt=T.title)===null||xt===void 0?void 0:xt[nt])===null||yt===void 0?void 0:yt.value},ct=nt=>T.items.map(xt=>xt[nt]),pt=I.map((nt,xt)=>{const yt=Object.assign({points:z[xt],transform:$[xt],index:nt,markKey:A,viewKey:o},T&&{title:J(nt),items:ct(nt)});for(const[Rt,Yt]of Object.entries(F))yt[Rt]=Yt[nt],W&&(yt[`series${mo(Rt)}`]=W[xt].map(Qt=>Yt[Qt]));return W&&(yt.seriesIndex=W[xt]),W&&T&&(yt.seriesItems=W[xt].map(Rt=>ct(Rt)),yt.seriesTitle=W[xt].map(Rt=>J(Rt))),yt});w.data=pt,w.index=I;const it=S==null?void 0:S(pt,N,g);_.push(...it||[])}return[{layout:g,theme:d,coordinate:y,markState:t,key:o,clip:l,scale:b,style:m,components:v,labelTransform:ng(f.map(a))},_]}function hy(t,e,n,r,i){return Xa(this,void 0,void 0,function*(){const{components:a,theme:o,layout:s,markState:c,coordinate:l,key:u,style:f,clip:d,scale:h}=t,{x:p,y:v,width:g,height:y}=s,m=ko(s,["x","y","width","height"]),b=["view","plot","main","content"],_=b.map((R,I)=>I),x=["a","margin","padding","inset"],O=b.map(R=>dO(Object.assign({},o.view,f),R)),w=x.map(R=>At(m,R)),S=R=>R.style("x",I=>P[I].x).style("y",I=>P[I].y).style("width",I=>P[I].width).style("height",I=>P[I].height).each(function(I,z,W){Iq(Kt(W),O[I])});let M=0,E=0,A=g,C=y;const P=_.map(R=>{const I=w[R],{left:z=0,top:W=0,bottom:V=0,right:$=0}=I;return M+=z,E+=W,A-=z+$,C-=W+V,{x:M,y:E,width:A,height:C}});e.selectAll(Aa(O_)).data(_.filter(R=>un(O[R])),R=>b[R]).join(R=>R.append("rect").attr("className",O_).style("zIndex",-2).call(S),R=>R.call(S),R=>R.remove());const T=Eq(c),k=T?{duration:T[1]}:!1;for(const[,R]of Bd(a,I=>`${I.type}-${I.position}`))R.forEach((I,z)=>I.index=z);const N=e.selectAll(Aa(x_)).data(a,R=>`${R.type}-${R.position}-${R.index}`).join(R=>R.append("g").style("zIndex",({zIndex:I})=>I||-1).attr("className",x_).append(I=>zM(at({animate:k,scale:h},I),l,o,r,c)),R=>R.transition(function(I,z,W){const{preserve:V=!1}=I;if(V)return;const $=zM(at({animate:k,scale:h},I),l,o,r,c),{attributes:J}=$,[ct]=W.childNodes;return ct.update(J,!1)})).transitions();n.push(...N.flat().filter(un));const F=e.selectAll(Aa(kl)).data([s],()=>u).join(R=>R.append("rect").style("zIndex",0).style("fill","transparent").attr("className",kl).call(rE).call(aE,Array.from(c.keys())).call(oE,d),R=>R.call(aE,Array.from(c.keys())).call(I=>T?jq(I,T):rE(I)).call(oE,d)).transitions();n.push(...F.flat());for(const[R,I]of c.entries()){const{data:z}=I,{key:W,class:V,type:$}=R,J=e.select(`#${W}`),ct=Tq(R,I,t,r,i),pt=kq(R,I,t,r),it=Lq(R,I,t,r),nt=Nq(R,I,t,r),xt=Aq(e,J,V,"element"),yt=J.selectAll(Aa(Na)).selectFacetAll(xt).data(z,Rt=>Rt.key,Rt=>Rt.groupKey).join(Rt=>Rt.append(ct).attr("className",Na).attr("markType",$).transition(function(Yt,Qt,Jt){return pt(Yt,[Jt])}),Rt=>Rt.call(Yt=>{const Qt=Yt.parent(),Jt=eG(pe=>{const[Ge,le]=pe.getBounds().min;return[Ge,le]});Yt.transition(function(pe,Ge,le){Pq(le,Qt,Jt);const ye=ct(pe,Ge),yn=it(pe,[le],[ye]);return yn!==null||(le.nodeName===ye.nodeName&&ye.nodeName!=="g"?ig(le,ye):(le.parentNode.replaceChild(ye,le),ye.className=Na,ye.markType=$,ye.__data__=le.__data__)),yn}).attr("markType",$).attr("className",Na)}),Rt=>Rt.each(function(Yt,Qt,Jt){Jt.__removed__=!0}).transition(function(Yt,Qt,Jt){return nt(Yt,[Jt])}).remove(),Rt=>Rt.append(ct).attr("className",Na).attr("markType",$).transition(function(Yt,Qt,Jt){const{__fromElements__:pe}=Jt,Ge=it(Yt,pe,[Jt]);return new nr(pe,null,Jt.parentNode).transition(Ge).remove(),Ge}),Rt=>Rt.transition(function(Yt,Qt,Jt){const Ge=new nr([],Jt.__toData__,Jt.parentNode).append(ct).attr("className",Na).attr("markType",$).nodes();return it(Yt,[Jt],Ge)}).remove()).transitions();n.push(...yt.flat())}_q(t,e,n,r,i)})}function _q(t,e,n,r,i){const[a]=An("labelTransform",r),{markState:o,labelTransform:s}=t,c=e.select(Aa(B0)).node(),l=new Map,u=new Map,f=Array.from(o.entries()).flatMap(([g,y])=>{const{labels:m=[],key:b}=g,_=Mq(g,y,t,r,i),x=e.select(`#${b}`).selectAll(Aa(Na)).nodes().filter(O=>!O.__removed__);return m.flatMap((O,w)=>{const{transform:S=[]}=O,M=ko(O,["transform"]);return x.flatMap(E=>{const A=xq(M,w,E);return A.forEach(C=>{l.set(C,_),u.set(C,O)}),A})})}),d=Kt(c).selectAll(Aa(G0)).data(f,g=>g.key).join(g=>g.append(y=>l.get(y)(y)).attr("className",G0),g=>g.each(function(y,m,b){const x=l.get(y)(y);ig(b,x)}),g=>g.remove()).nodes(),h=Cn(d,g=>u.get(g.__data__)),{coordinate:p}=t,v={canvas:i.canvas,coordinate:p};for(const[g,y]of h){const{transform:m=[]}=g;ng(m.map(a))(y,v)}s&&s(d,v)}function xq(t,e,n){const{seriesIndex:r,seriesKey:i,points:a,key:o,index:s}=n.__data__,c=Sq(n);if(!r)return[Object.assign(Object.assign({},t),{key:`${o}-${e}`,bounds:c,index:s,points:a,dependentElement:n})];const l=wq(t),u=r.map((f,d)=>Object.assign(Object.assign({},t),{key:`${i[d]}-${e}`,bounds:[a[d]],index:f,points:a,dependentElement:n}));return l?l(u):u}function Oq([t,e,n]){if(n)return[t,e,n];const r=[],i=[];for(let a=0;aun(c)&&un(l))&&(r.push(o),i.push(s))}return[r,i]}function wq(t){const{selector:e}=t;if(!e)return null;if(typeof e=="function")return e;if(e==="first")return n=>[n[0]];if(e==="last")return n=>[n[n.length-1]];throw new Error(`Unknown selector: ${e}`)}function Sq(t){const e=t.cloneNode(),n=t.getAnimations();e.style.visibility="hidden",n.forEach(o=>{const s=o.effect.getKeyframes();e.attr(s[s.length-1])}),t.parentNode.appendChild(e);const r=e.getLocalBounds();e.destroy();const{min:i,max:a}=r;return[i,a]}function Mq(t,e,n,r,i){const[a]=An("shape",r),{data:o}=t,{data:s,defaultLabelShape:c}=e,l=s.map(h=>h.points),{theme:u,coordinate:f}=n,d=Object.assign(Object.assign({},i),{document:$S(i),theme:u,coordinate:f});return h=>{const{index:p,points:v}=h,g=o[p],{formatter:y=k=>`${k}`,transform:m,style:b,render:_}=h,x=ko(h,["formatter","transform","style","render"]),O=_o(Object.assign(Object.assign({},x),b),k=>JM(k,g,p,o)),{shape:w=c,text:S}=O,M=ko(O,["shape","text"]),E=typeof y=="string"?bo(y):y,A=Object.assign(Object.assign({},M),{text:E(S,g,p,o),datum:g}),C=Object.assign({type:`label.${w}`,render:_},M),P=a(C,d),T=tE(u,"label",w,"label");return P(v,A,T,l)}}function JM(t,e,n,r){return typeof t=="function"?t(e,n,r):typeof t!="string"?t:Ec(e)&&e[t]!==void 0?e[t]:t}function Eq(t){let e=-1/0,n=1/0;for(const[r,i]of t){const{animate:a={}}=r,{data:o}=i,{enter:s={},update:c={},exit:l={}}=a,{type:u,duration:f=300,delay:d=0}=c,{type:h,duration:p=300,delay:v=0}=s,{type:g,duration:y=300,delay:m=0}=l;for(const b of o){const{updateType:_=u,updateDuration:x=f,updateDelay:O=d,enterType:w=h,enterDuration:S=p,enterDelay:M=v,exitDuration:E=y,exitDelay:A=m,exitType:C=g}=b;(_===void 0||_)&&(e=Math.max(e,x+O),n=Math.min(n,O)),(C===void 0||C)&&(e=Math.max(e,E+A),n=Math.min(n,A)),(w===void 0||w)&&(e=Math.max(e,S+M),n=Math.min(n,M))}}return e===-1/0?null:[n,e-n]}function Aq(t,e,n,r){return t.node().parentElement.findAll(a=>a.style.facet!==void 0&&a.style.facet===n&&a!==e.node()).flatMap(a=>a.getElementsByClassName(r))}function Pq(t,e,n){if(!t.__facet__)return;const r=t.parentNode.parentNode,i=e.parentNode,[a,o]=n(r),[s,c]=n(i),l=`translate(${a-s}, ${o-c})`;nG(t,l),e.append(t)}function Tq(t,e,n,r,i){const[a]=An("shape",r),{data:o}=t,{defaultShape:s,data:c,shape:l}=e,u=c.map(g=>g.points),{theme:f,coordinate:d}=n,{type:h,style:p={}}=t,v=Object.assign(Object.assign({},i),{document:$S(i),coordinate:d,theme:f});return g=>{const{shape:y=s}=p,{shape:m=y,points:b,seriesIndex:_,index:x}=g,O=ko(g,["shape","points","seriesIndex","index"]),w=Object.assign(Object.assign({},O),{index:x}),S=_?_.map(P=>o[P]):o[x],M=_||x,E=_o(p,P=>JM(P,S,M,o)),A=l[m]?l[m](E,v):a(Object.assign(Object.assign({},E),{type:iE(t,m)}),v),C=tE(f,h,m,s);return A(b,w,C,u)}}function tE(t,e,n,r){if(typeof e!="string")return;const{color:i}=t,a=t[e]||{},o=a[n]||a[r];return Object.assign({color:i},o)}function py(t,e,n,r,i){var a,o;const[,s]=An("shape",i),[c]=An("animation",i),{defaultShape:l,shape:u}=n,{theme:f,coordinate:d}=r,p=`default${mo(t)}Animation`,{[p]:v}=((a=u[l])===null||a===void 0?void 0:a.props)||s(iE(e,l)).props,{[t]:g={}}=f,y=((o=e.animate)===null||o===void 0?void 0:o[t])||{},m={coordinate:d};return(b,_,x)=>{const{[`${t}Type`]:O,[`${t}Delay`]:w,[`${t}Duration`]:S,[`${t}Easing`]:M}=b,E=Object.assign({type:O||v},y);if(!E.type)return null;const P=c(E,m)(_,x,at(g,{delay:w,duration:S,easing:M}));return Array.isArray(P)?P:[P]}}function kq(t,e,n,r){return py("enter",t,e,n,r)}function Cq(t){return t.finished.then(()=>{t.cancel()}),t}function Lq(t,e,n,r){return py("update",t,e,n,r)}function Nq(t,e,n,r){return py("exit",t,e,n,r)}function eE(t={}){if(typeof t=="string")return{type:t};const{type:e="light"}=t,n=ko(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}function jh(t){const e={event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},{interaction:n={}}=t;return Object.entries(at(e,n)).reverse()}function nE(t,e){return Xa(this,void 0,void 0,function*(){const n={library:e},{data:r}=t,i=ko(t,["data"]);if(r==null)return t;const[,{data:a}]=yield UM([],{data:r},n);return Object.assign({data:a},i)})}function rE(t){t.style("transform",e=>`translate(${e.paddingLeft+e.marginLeft}, ${e.paddingTop+e.marginTop})`).style("width",e=>e.innerWidth).style("height",e=>e.innerHeight)}function jq(t,e){const[n,r]=e;t.transition(function(i,a,o){const{transform:s,width:c,height:l}=o.style,{paddingLeft:u,paddingTop:f,innerWidth:d,innerHeight:h,marginLeft:p,marginTop:v}=i,g=[{transform:s,width:c,height:l},{transform:`translate(${u+p}, ${f+v})`,width:d,height:h}];return o.animate(g,{delay:n,duration:r,fill:"both"})})}function iE(t,e){const{type:n}=t;return typeof e=="string"?`${n}.${e}`:e}function aE(t,e){const n=a=>a.class!==void 0?`${a.class}`:"";t.nodes().length===0||(t.selectAll(Aa(__)).data(e,a=>a.key).join(a=>a.append("g").attr("className",__).attr("id",o=>o.key).style("facet",n).style("fill","transparent").style("zIndex",o=>{var s;return(s=o.zIndex)!==null&&s!==void 0?s:0}),a=>a.style("facet",n).style("fill","transparent").style("zIndex",o=>{var s;return(s=o.zIndex)!==null&&s!==void 0?s:0}),a=>a.remove()),t.select(Aa(B0)).node())||t.append("g").attr("className",B0).style("zIndex",0)}function Aa(...t){return t.map(e=>`.${e}`).join("")}function oE(t,e){t.node()&&t.style("clipPath",n=>{if(!e)return null;const{paddingTop:r,paddingLeft:i,marginLeft:a,marginTop:o,innerWidth:s,innerHeight:c}=n;return new ys({style:{x:i+a,y:r+o,width:s,height:c}})})}function Rq(t,e,n){var r;for(const[l]of n.entries())if(l.type==="cell")return t.filter(u=>u.name!=="shape");if(e.length!==1||t.some(l=>l.name==="shape"))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"},c={field:((r=t.find(l=>l.name==="color"))===null||r===void 0?void 0:r.field)||null,name:"shape",type:"constant",domain:[],range:[o[i]]};return[...t,c]}function Iq(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}function sE(t){const e=at({},t),n=new Map([[e,null]]),r=new Map([[null,-1]]),i=[e];for(;i.length;){const a=i.shift();if(a.key===void 0){const s=n.get(a),c=r.get(a),l=s===null?"0":`${s.key}-${c}`;a.key=l}const{children:o=[]}=a;if(Array.isArray(o))for(let s=0;s{},r=i=>{throw i}){const{width:i=640,height:a=480,depth:o=0}=t,s=sE(t),{canvas:c=Dq(i,a),emitter:l=new F0,library:u}=e;e.canvas=c,e.emitter=l;const{width:f,height:d}=c.getConfig();(f!==i||d!==a)&&c.resize(i,a),l.emit(Ze.BEFORE_RENDER);const h=Kt(c.document.documentElement);return c.ready.then(()=>fy(Object.assign(Object.assign({},s),{width:i,height:a,depth:o}),h,u,e)).then(()=>{if(o){const[p,v]=c.document.documentElement.getPosition();c.document.documentElement.setPosition(p,v,-o/2)}c.requestAnimationFrame(()=>{l.emit(Ze.AFTER_RENDER),n==null||n()})}).catch(p=>{r==null||r(p)}),zq(c.getConfig().container)}function Dmt(t,e={},n=()=>{},r=i=>{throw i}){var i;const{width:a=640,height:o=480}=t,s=sE(t),{group:c=new Group,emitter:l=new EventEmitter,library:u}=e;c!=null&&c.parentElement||error("renderToMountedElement can't render chart to unmounted group.");const f=select(c);return e.group=c,e.emitter=l,e.canvas=e.canvas||((i=c==null?void 0:c.ownerDocument)===null||i===void 0?void 0:i.defaultView),l.emit(ChartEvent.BEFORE_RENDER),plot(Object.assign(Object.assign({},s),{width:a,height:o}),f,u,e).then(()=>{var d;(d=e.canvas)===null||d===void 0||d.requestAnimationFrame(()=>{l.emit(ChartEvent.AFTER_RENDER),n==null||n()})}).catch(d=>{r==null||r(d)}),c}function cE(t,e={},n=!1){const{canvas:r,emitter:i}=e;r&&(Bq(r),n?r.destroy():r.destroyChildren()),i.off()}function Bq(t){const e=t.getRoot().querySelectorAll(`.${z0}`);e==null||e.forEach(n=>{const{nameInteraction:r=new Map}=n;(r==null?void 0:r.size)>0&&Array.from(r==null?void 0:r.values()).forEach(i=>{i==null||i.destroy()})})}function zq(t){return typeof t=="string"?document.getElementById(t):t}const Uc=t=>t?parseInt(t):0;function Gq(t){const e=getComputedStyle(t),n=t.clientWidth||Uc(e.width),r=t.clientHeight||Uc(e.height),i=Uc(e.paddingLeft)+Uc(e.paddingRight),a=Uc(e.paddingTop)+Uc(e.paddingBottom);return{width:n-i,height:r-a}}function Fmt(t){const{height:e,width:n,padding:r=0,paddingLeft:i=r,paddingRight:a=r,paddingTop:o=r,paddingBottom:s=r,margin:c=0,marginLeft:l=c,marginRight:u=c,marginTop:f=c,marginBottom:d=c,inset:h=0,insetLeft:p=h,insetRight:v=h,insetTop:g=h,insetBottom:y=h}=t,m=x=>x==="auto"?20:x,b=n-m(i)-m(a)-l-u-p-v,_=e-m(o)-m(s)-f-d-g-y;return{width:b,height:_}}function vy(t,e){const n=[t];for(;n.length;){const r=n.shift();e&&e(r);const i=r.children||[];for(const a of i)n.push(a)}}class gy{constructor(e={},n){this.parentNode=null,this.children=[],this.index=0,this.type=n,this.value=e}map(e=n=>n){const n=e(this.value);return this.value=n,this}attr(e,n){return arguments.length===1?this.value[e]:this.map(r=>(r[e]=n,r))}append(e){const n=new e({});return n.children=[],this.push(n),n}push(e){return e.parentNode=this,e.index=this.children.length,this.children.push(e),this}remove(){const e=this.parentNode;if(e){const{children:n}=e,r=n.findIndex(i=>i===this);n.splice(r,1)}return this}getNodeByKey(e){let n=null;return vy(this,i=>{e===i.attr("key")&&(n=i)}),n}getNodesByType(e){const n=[];return vy(this,i=>{e===i.type&&n.push(i)}),n}getNodeByType(e){let n=null;return vy(this,r=>{n||e===r.type&&(n=r)}),n}call(e,...n){return e(this.map(),...n),this}getRoot(){let e=this;for(;e&&e.parentNode;)e=e.parentNode;return e}}var lE=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{e=r,t=i}),e,t]}function eZ(t,e,{key:n=e}){t.prototype[e]=function(r){return arguments.length===0?this.attr(n):this.attr(n,r)}}function nZ(t,e,{key:n=e}){t.prototype[e]=function(r){if(arguments.length===0)return this.attr(n);if(Array.isArray(r))return this.attr(n,r);const i=[...this.attr(n)||[],r];return this.attr(n,i)}}function rZ(t,e,{key:n=e}){t.prototype[e]=function(r,i){if(arguments.length===0)return this.attr(n);if(arguments.length===1&&typeof r!="string")return this.attr(n,r);const a=this.attr(n)||{};return a[r]=arguments.length===1?!0:i,this.attr(n,a)}}function iZ(t,e,n){t.prototype[e]=function(r){if(arguments.length===0)return this.attr(e);if(Array.isArray(r))return this.attr(e,{items:r});if(Ec(r)&&(r.title!==void 0||r.items!==void 0))return this.attr(e,r);if(r===null||r===!1)return this.attr(e,r);const i=this.attr(e)||{},{items:a=[]}=i;return a.push(r),i.items=a,this.attr(e,i)}}function aZ(t,e,{ctor:n}){t.prototype[e]=function(r){const i=this.append(n);return e==="mark"&&(i.type=r),i}}function oZ(t,e,{ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}function Rh(t){return e=>{for(const[n,r]of Object.entries(t)){const{type:i}=r;i==="value"?eZ(e,n,r):i==="array"?nZ(e,n,r):i==="object"?rZ(e,n,r):i==="node"?aZ(e,n,r):i==="container"?oZ(e,n,r):i==="mix"&&iZ(e,n,r)}return e}}function vE(t){return Object.fromEntries(Object.entries(t).map(([e,n])=>[e,{type:"node",ctor:n}]))}const gE={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"}},sZ=Object.assign(Object.assign({},gE),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),cZ=Object.assign(Object.assign({},gE),{labelTransform:{type:"array"}});var lZ=function(t,e,n,r){var i=arguments.length,a=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a};let Ih=class extends gy{changeData(e){var n;const r=this.getRoot();if(r)return this.attr("data",e),!((n=this.children)===null||n===void 0)&&n.length&&this.children.forEach(i=>{i.attr("data",e)}),r==null?void 0:r.render()}getView(){const e=this.getRoot(),{views:n}=e.getContext();if(n!=null&&n.length)return n.find(r=>r.key===this._key)}getScale(){var e;return(e=this.getView())===null||e===void 0?void 0:e.scale}getScaleByChannel(e){const n=this.getScale();if(n)return n[e]}getCoordinate(){var e;return(e=this.getView())===null||e===void 0?void 0:e.coordinate}getTheme(){var e;return(e=this.getView())===null||e===void 0?void 0:e.theme}getGroup(){const e=this._key;return e?this.getRoot().getContext().canvas.getRoot().getElementById(e):void 0}show(){const e=this.getGroup();e&&!e.isVisible()&&xh(e)}hide(){const e=this.getGroup();e&&e.isVisible()&&Kg(e)}};Ih=lZ([Rh(cZ)],Ih);var uZ=function(t,e,n,r){var i=arguments.length,a=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a};let by=class extends gy{changeData(e){const n=this.getRoot();if(n)return this.attr("data",e),n==null?void 0:n.render()}getMark(){var e;const n=(e=this.getRoot())===null||e===void 0?void 0:e.getView();if(!n)return;const{markState:r}=n,i=Array.from(r.keys()).find(a=>a.key===this.attr("key"));return r.get(i)}getScale(){var e;const n=(e=this.getRoot())===null||e===void 0?void 0:e.getView();if(n)return n==null?void 0:n.scale}getScaleByChannel(e){var n,r;const i=(n=this.getRoot())===null||n===void 0?void 0:n.getView();if(i)return(r=i==null?void 0:i.scale)===null||r===void 0?void 0:r[e]}getGroup(){const e=this.attr("key");return e?this.getRoot().getContext().canvas.getRoot().getElementById(e):void 0}};by=uZ([Rh(sZ)],by);var fZ=function(t,e,n,r){var i=arguments.length,a=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},dZ=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{this.forceFit()},300),this._renderer=i||new eO,this._plugins=a||[],this._container=Wq(n),this._emitter=new F0,this._context={library:Object.assign(Object.assign({},o),w_),emitter:this._emitter,canvas:r},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 e=new Promise((a,o)=>Fq(this._computedOptions(),this._context,this._createResolve(a),this._createReject(o))),[n,r,i]=tZ();return e.then(r).catch(i).then(()=>this._renderTrailing()),n}options(e){if(arguments.length===0)return $q(this);const{type:n}=e;return n&&(this._previousDefinedType=n),Jq(this,e,this._previousDefinedType,this._marks,this._compositions),this}getContainer(){return this._container}getContext(){return this._context}on(e,n,r){return this._emitter.on(e,n,r),this}once(e,n){return this._emitter.once(e,n),this}emit(e,...n){return this._emitter.emit(e,...n),this}off(e,n){return this._emitter.off(e,n),this}clear(){const e=this.options();this.emit(Ze.BEFORE_CLEAR),this._reset(),cE(e,this._context,!1),this.emit(Ze.AFTER_CLEAR)}destroy(){const e=this.options();this.emit(Ze.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),cE(e,this._context,!0),this._container[uE]&&Yq(this._container),this.emit(Ze.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;const{width:e,height:n}=my(this.options(),this._container);if(e===this._width&&n===this._height)return Promise.resolve(this);this.emit(Ze.BEFORE_CHANGE_SIZE);const r=this.render();return r.then(()=>{this.emit(Ze.AFTER_CHANGE_SIZE)}),r}changeSize(e,n){if(e===this._width&&n===this._height)return Promise.resolve(this);this.emit(Ze.BEFORE_CHANGE_SIZE),this.attr("width",e),this.attr("height",n);const r=this.render();return r.then(()=>{this.emit(Ze.AFTER_CHANGE_SIZE)}),r}_create(){const{library:e}=this._context,n=a=>a.startsWith("mark.")||a==="component.axisX"||a==="component.axisY"||a==="component.legends",r=["mark.mark",...Object.keys(e).filter(n)];this._marks={};for(const a of r){const o=a.split(".").pop();class s extends by{constructor(){super({},o)}}this._marks[o]=s,this[o]=function(c){const l=this.append(s);return o==="mark"&&(l.type=c),l}}const i=["composition.view",...Object.keys(e).filter(a=>a.startsWith("composition.")&&a!=="composition.mark")];this._compositions=Object.fromEntries(i.map(a=>{const o=a.split(".").pop();let s=class extends Ih{constructor(){super({},o)}};return s=fZ([Rh(vE(this._marks))],s),[o,s]}));for(const a of Object.values(this._compositions))Rh(vE(this._compositions))(a);for(const a of i){const o=a.split(".").pop();this[o]=function(){const s=this._compositions[o];return this.type=null,this.append(s)}}}_reset(){const e=["theme","type","width","height","autoFit"];this.type="view",this.value=Object.fromEntries(Object.entries(this.value).filter(([n])=>n.startsWith("margin")||n.startsWith("padding")||n.startsWith("inset")||e.includes(n))),this.children=[]}_renderTrailing(){this._trailing&&(this._trailing=!1,this.render().then(()=>{const e=this._trailingResolve.bind(this);this._trailingResolve=null,e(this)}).catch(e=>{const n=this._trailingReject.bind(this);this._trailingReject=null,n(e)}))}_createResolve(e){return()=>{this._rendering=!1,e(this)}}_createReject(e){return n=>{this._rendering=!1,e(n)}}_computedOptions(){const e=this.options(),{key:n=hZ}=e,{width:r,height:i,depth:a}=my(e,this._container);return this._width=r,this._height=i,this._key=n,Object.assign(Object.assign({key:this._key},e),{width:r,height:i,depth:a})}_createCanvas(){const{width:e,height:n}=my(this.options(),this._container);this._plugins.push(new nO),this._plugins.forEach(r=>this._renderer.registerPlugin(r)),this._context.canvas=new N2({container:this._container,width:e,height:n,renderer:this._renderer})}_addToTrailing(){var e;return(e=this._trailingResolve)===null||e===void 0||e.call(this,this),this._trailing=!0,new Promise((r,i)=>{this._trailingResolve=r,this._trailingReject=i})}_bindAutoFit(){const e=this.options(),{autoFit:n}=e;if(this._hasBindAutoFit){n||this._unbindAutoFit();return}n&&(this._hasBindAutoFit=!0,window.addEventListener("resize",this._onResize))}_unbindAutoFit(){this._hasBindAutoFit&&(this._hasBindAutoFit=!1,window.removeEventListener("resize",this._onResize))}}function vZ(t,e){class n extends t{constructor(i){super(Object.assign(Object.assign({},i),{lib:e}))}}return n}var gZ=Object.prototype.hasOwnProperty,_y=function(t,e){if(t===null||!Ba(t))return{};var n={};return Lg(e,function(r){gZ.call(t,r)&&(n[r]=t[r])}),n};function yE(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 Tu(t,e,n,r,i){for(var a=t.children,o,s=-1,c=a.length,l=t.value&&(r-e)/t.value;++s=0;)e+=n[r].value;t.value=e}function _Z(){return this.eachAfter(bZ)}var xy=tt(64599);function xZ(t,e){var n=-1,r=xy(this),i;try{for(r.s();!(i=r.n()).done;){var a=i.value;t.call(e,a,++n,this)}}catch(o){r.e(o)}finally{r.f()}return this}function OZ(t,e){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(t.call(e,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function wZ(t,e){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o=0;)n+=r[i].value;e.value=n})}function EZ(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function AZ(t){for(var e=this,n=PZ(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}function PZ(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}function TZ(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function kZ(){return Array.from(this)}function CZ(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function LZ(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}var mE=tt(15009),NZ=mE().mark(bE);function bE(){var t,e,n,r,i,a;return mE().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:t=this,n=[t];case 1:e=n.reverse(),n=[];case 2:if(!(t=e.pop())){s.next=8;break}return s.next=5,t;case 5:if(r=t.children)for(i=0,a=r.length;i=0;--s)i.push(a=o[s]=new qc(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(_E)}function jZ(){return Xc(this).eachBefore(DZ)}function RZ(t){return t.children}function IZ(t){return Array.isArray(t)?t[1]:null}function DZ(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function _E(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function qc(t){this.data=t,this.depth=this.height=0,this.parent=null}qc.prototype=Xc.prototype=mZ({constructor:qc,count:_Z,each:xZ,eachAfter:wZ,eachBefore:OZ,find:SZ,sum:MZ,sort:EZ,path:AZ,ancestors:TZ,descendants:kZ,leaves:CZ,links:LZ,copy:jZ},Symbol.iterator,bE);function Oy(t,e){for(var n in e)e.hasOwnProperty(n)&&n!=="constructor"&&e[n]!==void 0&&(t[n]=e[n])}function FZ(t,e,n,r){return e&&Oy(t,e),n&&Oy(t,n),r&&Oy(t,r),t}function wy(t){return ie(t)?0:tu(t)?t.length:Object.keys(t).length}const BZ={field:"value",size:[1,1],round:!1,padding:0,sort:(t,e)=>e.value-t.value,as:["x","y"],ignoreParentValue:!0},zZ="nodeIndex",ku="childNodeCount",GZ="nodeAncestor",Sy="Invalid field: it must be a string!";function WZ(t,e){const{field:n,fields:r}=t;if(kn(n))return n;if(sr(n))return console.warn(Sy),n[0];if(console.warn(`${Sy} will try to get fields instead.`),kn(r))return r;if(sr(r)&&r.length)return r[0];if(e)return e;throw new TypeError(Sy)}function YZ(t){const e=[];if(t&&t.each){let n,r;t.each(i=>{var a,o;i.parent!==n?(n=i.parent,r=0):r+=1;const s=CS((((a=i.ancestors)===null||a===void 0?void 0:a.call(i))||[]).map(c=>e.find(l=>l.name===c.name)||c),({depth:c})=>c>0&&c{e.push(n)});return e}function HZ(t,e){e=FZ({},BZ,e);const n=e.as;if(!sr(n)||n.length!==2)throw new TypeError('Invalid as: it must be an array with 2 strings (e.g. [ "x", "y" ])!');let r;try{r=WZ(e)}catch(c){console.warn(c)}const a=(c=>yZ().size(e.size).round(e.round).padding(e.padding)(Xc(c).sum(l=>wy(l.children)?e.ignoreParentValue?0:l[r]-Nw(l.children,(u,f)=>u+f[r],0):l[r]).sort(e.sort)))(t),o=n[0],s=n[1];return a.each(c=>{var l,u;c[o]=[c.x0,c.x1,c.x1,c.x0],c[s]=[c.y1,c.y1,c.y0,c.y0],c.name=c.name||((l=c.data)===null||l===void 0?void 0:l.name)||((u=c.data)===null||u===void 0?void 0:u.label),c.data.name=c.name,["x0","x1","y0","y1"].forEach(f=>{n.indexOf(f)===-1&&delete c[f]})}),YZ(a)}var $Z=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{var l,u,f,d;if(c.depth===0)return null;let h=c.data.name;const p=[h];let v=Object.assign({},c);for(;v.depth>1;)h=`${(l=v.parent.data)===null||l===void 0?void 0:l.name} / ${h}`,p.unshift((u=v.parent.data)===null||u===void 0?void 0:u.name),v=v.parent;const g=Object.assign(Object.assign(Object.assign({},_y(c.data,[i])),{[xE]:h,[Dh]:v.data.name}),c);r&&r!==Dh&&(g[r]=c.data[r]||((d=(f=c.parent)===null||f===void 0?void 0:f.data)===null||d===void 0?void 0:d[r])),s.push(g)}),s.map(c=>Object.assign(Object.assign({},c),{x:c.x.slice(0,2),y:[c.y[2],c.y[0]],fillOpacity:Math.pow(.85,c.depth)}))}const OE={id:Zc,encode:{x:"x",y:"y",key:xE,color:Dh,value:"value"},axis:{x:!1,y:!1},style:{[My]:Zc,stroke:"#fff",lineWidth:.5,fillOpacity:"fillOpacity",[ku]:ku,depth:"depth"},state:{active:{zIndex:2,stroke:"#000"},inactive:{zIndex:1,stroke:"#fff"}},legend:!1,interaction:{drillDown:!0},coordinate:{type:"polar",innerRadius:.2}},wE=t=>{const{encode:e,data:n=[],legend:r}=t,i=$Z(t,["encode","data","legend"]),a=Object.assign(Object.assign({},i.coordinate),{innerRadius:Math.max(Re(i,["coordinate","innerRadius"],.2),1e-5)}),o=Object.assign(Object.assign({},OE.encode),e),{value:s}=o,c=VZ({encode:o,data:n});return[at({},OE,Object.assign(Object.assign({type:"rect",data:c,encode:o,tooltip:{title:"path",items:[l=>({name:s,value:l[s]})]}},i),{coordinate:a}))]};wE.props={};var UZ=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return Lg(t,function(n,r){Kr(t)&&r==="prototype"||e.push(r)}),e},Ey=UZ,XZ=function(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{l(r.next(u))}catch(f){o(f)}}function c(u){try{l(r.throw(u))}catch(f){o(f)}}function l(u){u.done?a(u.value):i(u.value).then(s,c)}l((r=r.apply(t,e||[])).next())})};const qZ=t=>t.querySelectorAll(".element").filter(e=>Re(e,["style",My])===Zc);function ZZ(t){return Kt(t).select(`.${kl}`).node()}const KZ={rootText:"root",style:{fill:"rgba(0, 0, 0, 0.85)",fontSize:12,y:1},active:{fill:"rgba(0, 0, 0, 0.5)"}};function QZ(t={}){const{breadCrumb:e={},isFixedColor:n=!1,duration:r}=t,i=at({},KZ,e);return a=>{const{update:o,setState:s,container:c,view:l,options:u}=a,f=ZZ(c),d=u.marks.find(({id:b})=>b===Zc),{state:h}=d,p=new dr;f.appendChild(p);const v=(b,_)=>XZ(this,void 0,void 0,function*(){if(p.removeChildren(),b){const x=new fi({style:Object.assign({x:0,text:i.rootText,depth:0},i.style)});p.appendChild(x);let O="";const w=b==null?void 0:b.split(" / ");let S=i.style.y,M=p.getBBox().width;const E=f.getBBox().width,A=w.map((C,P)=>{const T=new fi({style:Object.assign(Object.assign({x:M,text:" / "},i.style),{y:S})});p.appendChild(T),M+=T.getBBox().width,O=`${O}${C} / `;const k=new fi({name:O.replace(/\s\/\s$/,""),style:Object.assign(Object.assign({text:C,x:M,depth:P+1},i.style),{y:S})});return p.appendChild(k),M+=k.getBBox().width,M>E&&(S=p.getBBox().height,M=0,T.attr({x:M,y:S}),M+=T.getBBox().width,k.attr({x:M,y:S}),M+=k.getBBox().width),k});[x,...A].forEach((C,P)=>{if(P===A.length)return;const T=Object.assign({},C.attributes);C.attr("cursor","pointer"),C.addEventListener("mouseenter",()=>{C.attr(i.active)}),C.addEventListener("mouseleave",()=>{C.attr(T)}),C.addEventListener("click",()=>{v(C.name,Re(C,["style","depth"]))})})}s("drillDown",x=>{const{marks:O}=x,w=O.map(S=>{if(S.id!==Zc&&S.type!=="rect")return S;const{data:M}=S,E=Object.fromEntries(["color"].map(C=>[C,{domain:l.scale[C].getOptions().domain}])),A=M.filter(C=>{const P=C.path;return n||(C[Dh]=P.split(" / ")[_]),b?new RegExp(`^${b}.+`).test(P):!0});return at({},S,n?{data:A,scale:E}:{data:A})});return Object.assign(Object.assign({},x),{marks:w})}),yield o()}),g=b=>{const _=b.target;if(Re(_,["style",My])!==Zc||Re(_,["markType"])!=="rect"||!Re(_,["style",ku]))return;const x=Re(_,["__data__","key"]),O=Re(_,["style","depth"]);_.style.cursor="pointer",v(x,O)};f.addEventListener("click",g);const y=Ey(Object.assign(Object.assign({},h.active),h.inactive)),m=()=>{qZ(f).forEach(_=>{const x=Re(_,["style",ku]);if(Re(_,["style","cursor"])!=="pointer"&&x){_.style.cursor="pointer";const w=_y(_.attributes,y),S=at(w,h.inactive);_.addEventListener("mouseenter",()=>{r?(_.attr("zIndex",Re(h,["active","zIndex"],2)),_.animate([Es(S,["zIndex"]),Es(h.active,["zIndex"])],{duration:r,fill:"forwards"})):_.attr(h.active)}),_.addEventListener("mouseleave",()=>{r?(_.animate([Es(h.active,["zIndex"]),Es(S,["zIndex"])],{duration:r,fill:"forwards"}),setTimeout(()=>{_.attr("zIndex",Re(S,["zIndex"],1))},r)):_.attr(S)})}})};return f.addEventListener("mousemove",m),()=>{p.remove(),f.removeEventListener("click",g),f.removeEventListener("mousemove",m)}}}et.enableCSSParsing=!1;function JZ(){return{"interaction.drillDown":QZ,"mark.sunburst":wE}}const SE=()=>[["cartesian"]];SE.props={};const Ay=()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]];Ay.props={transform:!0};const tK=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:Math.PI*3/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)},ME=t=>{const{startAngle:e,endAngle:n,innerRadius:r,outerRadius:i}=tK(t);return[...Ay(),...eu({startAngle:e,endAngle:n,innerRadius:r,outerRadius:i})]};ME.props={};const Py=()=>[["parallel",0,1,0,1]];Py.props={};const EE=({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]];EE.props={transform:!0};const AE=t=>{const{startAngle:e=-Math.PI/2,endAngle:n=Math.PI*3/2,innerRadius:r=0,outerRadius:i=1}=t;return[...Py(),...eu({startAngle:e,endAngle:n,innerRadius:r,outerRadius:i})]};AE.props={};const PE=({value:t})=>e=>e.map(()=>t);PE.props={};const TE=({value:t})=>e=>e.map(n=>n[t]);TE.props={};const kE=({value:t})=>e=>e.map(t);kE.props={};const CE=({value:t})=>()=>t;CE.props={};function gn(t,e){if(t!==null)return{type:"column",value:t,field:e}}function Fh(t,e){const n=gn(t,e);return Object.assign(Object.assign({},n),{inferred:!0})}function Bh(t,e){if(t!==null)return{type:"column",value:t,field:e,visual:!0}}function eK(t,e){const n=gn(t,e);return Object.assign(Object.assign({},n),{constant:!1})}function Co(t,e){const n=[];for(const r of t)n[r]=e;return n}function Le(t,e){const n=t[e];if(!n)return[null,null];const{value:r,field:i=null}=n;return[r,i]}function Cu(t,...e){for(const n of e)if(typeof n=="string"){const[r,i]=Le(t,n);if(r!==null)return[r,i]}else return[n,null];return[null,null]}function Lu(t){return t instanceof Date?!1:typeof t=="object"}const Nu=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;return r!==void 0?[t,e]:[t,at({},e,{encode:{y1:Fh(Co(t,0))}})]};Nu.props={};const Ns=()=>(t,e)=>{const{encode:n}=e,{x:r}=n;return r!==void 0?[t,e]:[t,at({},e,{encode:{x:Fh(Co(t,0))},scale:{x:{guide:null}}})]};Ns.props={};const js=(t,e)=>wu(Object.assign({colorAttribute:"fill"},t),e);js.props=Object.assign(Object.assign({},wu.props),{defaultMarker:"square"});const zh=(t,e)=>wu(Object.assign({colorAttribute:"stroke"},t),e);zh.props=Object.assign(Object.assign({},wu.props),{defaultMarker:"hollowSquare"});function Kc(){}function LE(t){this._context=t}LE.prototype={areaStart:Kc,areaEnd:Kc,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))}};function Ty(t){return new LE(t)}var NE=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const{adjustPoints:n=nK}=t,r=NE(t,["adjustPoints"]),{coordinate:i,document:a}=e;return(o,s,c,l)=>{const{index:u}=s,{color:f}=c,d=NE(c,["color"]),h=l[u+1],p=n(o,h,i),v=!!Sn(i),[g,y,m,b]=v?hh(p):p,{color:_=f,opacity:x}=s,O=Mo().curve(Ty)([g,y,m,b]);return Kt(a.createElement("path",{})).call(Bt,d).style("d",O).style("fill",_).style("fillOpacity",x).call(Bt,r).node()}};ky.props={defaultMarker:"square"};function rK(t,e,n){const[r,i,a,o]=t;if(Sn(n)){const l=[e?e[0][0]:(i[0]+a[0])/2,i[1]],u=[e?e[3][0]:(i[0]+a[0])/2,a[1]];return[r,l,u,o]}const s=[i[0],e?e[0][1]:(i[1]+a[1])/2],c=[a[0],e?e[3][1]:(i[1]+a[1])/2];return[r,s,c,o]}const jE=(t,e)=>ky(Object.assign({adjustPoints:rK},t),e);jE.props={defaultMarker:"square"};function ju(t){return Math.abs(t)>10?String(t):t.toString().padStart(2,"0")}function iK(t){const e=t.getFullYear(),n=ju(t.getMonth()+1),r=ju(t.getDate()),i=`${e}-${n}-${r}`,a=t.getHours(),o=t.getMinutes(),s=t.getSeconds();return a||o||s?`${i} ${ju(a)}:${ju(o)}:${ju(s)}`:i}const Gh=(t={})=>{const{channel:e="x"}=t;return(n,r)=>{const{encode:i}=r,{tooltip:a}=r;if(za(a))return[n,r];const{title:o}=a;if(o!==void 0)return[n,r];const s=Object.keys(i).filter(l=>l.startsWith(e)).filter(l=>!i[l].inferred).map(l=>Le(i,l)).filter(([l])=>l).map(l=>l[0]);if(s.length===0)return[n,r];const c=[];for(const l of n)c[l]={value:s.map(u=>u[l]instanceof Date?iK(u[l]):u[l]).join(", ")};return[n,at({},r,{tooltip:{title:c}})]}};Gh.props={};const Wh=t=>{const{channel:e}=t;return(n,r)=>{const{encode:i,tooltip:a}=r;if(za(a))return[n,r];const{items:o=[]}=a;if(!o||o.length>0)return[n,r];const c=(Array.isArray(e)?e:[e]).flatMap(l=>Object.keys(i).filter(u=>u.startsWith(l)).map(u=>{const{field:f,value:d,inferred:h=!1,aggregate:p}=i[u];return h?null:p&&d?{channel:u}:f?{field:f}:d?{channel:u}:null}).filter(u=>u!==null));return[n,at({},r,{tooltip:{items:c}})]}};Wh.props={};var aK=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i(t,e)=>{const{encode:n}=e,{key:r}=n,i=aK(n,["key"]);if(r!==void 0)return[t,e];const a=Object.values(i).map(({value:s})=>s),o=t.map(s=>a.filter(Array.isArray).map(c=>c[s]).join("-"));return[t,at({},e,{encode:{key:gn(o)}})]};RE.props={};function IE(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 Qr(t={}){return[...IE(t),{name:"title",scale:"identity"}]}function zmt(){return[{type:MaybeTitle,channel:"color"},{type:MaybeTooltip,channel:["x","y","z"]}]}function Lo(){return[{type:Gh,channel:"color"},{type:Wh,channel:["x","y"]}]}function Qc(){return[{type:Gh,channel:"x"},{type:Wh,channel:["y"]}]}function oK(){return[{type:Gh,channel:"color"},{type:Wh,channel:["position"]}]}function Jc(t={}){return IE(t)}function Xn(){return[{type:RE}]}function rr(){return[]}function Cy(t,e){return t.getBandWidth(t.invert(e))}function Rs(t,e,n={}){const{x:r,y:i,series:a}=e,{x:o,y:s,series:c}=t,{style:{bandOffset:l=c?0:.5,bandOffsetX:u=l,bandOffsetY:f=l}={}}=n,d=!!(o!=null&&o.getBandWidth),h=!!(s!=null&&s.getBandWidth),p=!!(c!=null&&c.getBandWidth);return!d&&!h?v=>v:(v,g)=>{const y=d?Cy(o,r[g]):0,m=h?Cy(s,i[g]):0,_=p&&a?(()=>(Cy(c,a[g])/2+ +a[g])*y)():0,[x,O]=v;return[x+u*y+_,O+f*m]}}function Yh(t){return parseFloat(t)/100}function Ly(t,e,n,r){const{x:i,y:a}=n,{innerWidth:o,innerHeight:s}=r.getOptions(),c=Array.from(t,l=>{const u=i[l],f=a[l],d=typeof u=="string"?Yh(u)*o:+u,h=typeof f=="string"?Yh(f)*s:+f;return[[d,h]]});return[t,c]}function Pa(t){return typeof t=="function"?t:e=>e[t]}function Ny(t,e){return Array.from(t,Pa(e))}function jy(t,e){const{source:n=u=>u.source,target:r=u=>u.target,value:i=u=>u.value}=e,{links:a,nodes:o}=t,s=Ny(a,n),c=Ny(a,r),l=Ny(a,i);return{links:a.map((u,f)=>({target:c[f],source:s[f],value:l[f]})),nodes:o||Array.from(new Set([...s,...c]),u=>({key:u}))}}function DE(t,e){return t.getBandWidth(t.invert(e))}const FE={rect:js,hollow:zh,funnel:ky,pyramid:jE},BE=()=>(t,e,n,r)=>{const{x:i,y:a,y1:o,series:s,size:c}=n,l=e.x,u=e.series,[f]=r.getSize(),d=c?c.map(v=>+v/f):null,h=c?(v,g,y)=>{const m=v+g/2,b=d[y];return[m-b/2,m+b/2]}:(v,g,y)=>[v,v+g],p=Array.from(t,v=>{const g=DE(l,i[v]),y=u?DE(u,s==null?void 0:s[v]):1,m=g*y,b=(+(s==null?void 0:s[v])||0)*g,_=+i[v]+b,[x,O]=h(_,m,v),w=+a[v],S=+o[v];return[[x,w],[O,w],[O,S],[x,S]].map(P=>r.map(P))});return[t,p]};BE.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:FE,channels:[...Qr({shapes:Object.keys(FE)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...Xn(),{type:Nu},{type:Ns}],postInference:[...rr(),...Qc()],interaction:{shareTooltip:!0}};const zE={rect:js,hollow:zh},GE=()=>(t,e,n,r)=>{const{x:i,x1:a,y:o,y1:s}=n,c=Array.from(t,l=>{const u=[+i[l],+o[l]],f=[+a[l],+o[l]],d=[+a[l],+s[l]],h=[+i[l],+s[l]];return[u,f,d,h].map(p=>r.map(p))});return[t,c]};GE.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:zE,channels:[...Qr({shapes:Object.keys(zE)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Xn(),{type:Nu}],postInference:[...rr(),...Qc()],interaction:{shareTooltip:!0}};var WE=Ry(mu);function YE(t){this._curve=t}YE.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))}};function Ry(t){function e(n){return new YE(t(n))}return e._curve=t,e}function Ru(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(n){return arguments.length?e(Ry(n)):e()._curve},t}function sK(){return Ru(Mo().curve(WE))}var HE=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const{d1:e,d2:n,style1:r,style2:i}=t.attributes,a=t.ownerDocument;Kt(t).maybeAppend("line",()=>a.createElement("path",{})).style("d",e).call(Bt,r),Kt(t).maybeAppend("line1",()=>a.createElement("path",{})).style("d",n).call(Bt,i)});function lK(t,e){const n=[],r=[];let i=!1,a=null;for(const o of t)!e(o[0])||!e(o[1])?i=!0:(n.push(o),i&&(i=!1,r.push([a,o])),a=o);return[n,r]}const Wi=(t,e)=>{const{curve:n,gradient:r=!1,gradientColor:i="between",defined:a=u=>!Number.isNaN(u)&&u!==void 0&&u!==null,connect:o=!1}=t,s=HE(t,["curve","gradient","gradientColor","defined","connect"]),{coordinate:c,document:l}=e;return(u,f,d)=>{const{color:h,lineWidth:p}=d,v=HE(d,["color","lineWidth"]),{color:g=h,size:y=p,seriesColor:m,seriesX:b,seriesY:_}=f,x=pS(c,f),O=Sn(c),w=r&&m?hS(m,b,_,r,i,O):g,S=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},v),w&&{stroke:w}),y&&{lineWidth:y}),x&&{transform:x}),s);let M;if(fn(c)){const k=c.getCenter();M=N=>sK().angle((F,R)=>Dc(zn(N[R],k))).radius((F,R)=>Ln(N[R],k)).defined(([F,R])=>a(F)&&a(R)).curve(n)(N)}else M=Mo().x(k=>k[0]).y(k=>k[1]).defined(([k,N])=>a(k)&&a(N)).curve(n);const[E,A]=lK(u,a),C=At(S,"connect"),P=!!A.length;if(!P||o&&!Object.keys(C).length)return Kt(l.createElement("path",{})).style("d",M(E)||[]).call(Bt,S).node();if(P&&!o)return Kt(l.createElement("path",{})).style("d",M(u)).call(Bt,S).node();const T=k=>k.map(M).join(",");return Kt(new cK).style("style1",Object.assign(Object.assign({},S),C)).style("style2",S).style("d1",T(A)).style("d2",M(u)).node()}};Wi.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const $E=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=fn(n)?Ty:mu;return Wi(Object.assign({curve:i},t),e)(...r)}};$E.props=Object.assign(Object.assign({},Wi.props),{defaultMarker:"line"});function Iy(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 Dy(t,e){this._context=t,this._k=(1-e)/6}Dy.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:Iy(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&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:Iy(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Gmt=function t(e){function n(r){return new Dy(r,e)}return n.tension=function(r){return t(+r)},n}(0);function Fy(t,e){this._context=t,this._k=(1-e)/6}Fy.prototype={areaStart:Kc,areaEnd:Kc,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);break}}},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:Iy(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Wmt=function t(e){function n(r){return new Fy(r,e)}return n.tension=function(r){return t(+r)},n}(0);function VE(t,e,n){var r=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>zr){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>zr){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);a=(a*l+t._x1*t._l23_2a-e*t._l12_2a)/u,o=(o*l+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(r,i,a,o,t._x2,t._y2)}function UE(t,e){this._context=t,this._alpha=e}UE.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);break}(this._line||this._line!==0&&this._point===1)&&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:VE(this,t,e);break}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 Ymt=function t(e){function n(r){return e?new UE(r,e):new Dy(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function XE(t,e){this._context=t,this._alpha=e}XE.prototype={areaStart:Kc,areaEnd:Kc,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);break}}},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:VE(this,t,e);break}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 qE=function t(e){function n(r){return e?new XE(r,e):new Fy(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function ZE(t){return t<0?-1:1}function KE(t,e,n){var r=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(r||i<0&&-0),o=(n-t._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(ZE(a)+ZE(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function QE(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function By(t,e,n){var r=t._x0,i=t._y0,a=t._x1,o=t._y1,s=(a-r)/3;t._context.bezierCurveTo(r+s,i+s*e,a-s,o-s*n,a,o)}function Hh(t){this._context=t}Hh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:By(this,this._t0,QE(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,By(this,QE(this,n=KE(this,t,e)),n);break;default:By(this,this._t0,n=KE(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function JE(t){this._context=new tA(t)}(JE.prototype=Object.create(Hh.prototype)).point=function(t,e){Hh.prototype.point.call(this,e,t)};function tA(t){this._context=t}tA.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,a){this._context.bezierCurveTo(e,t,r,n,a,i)}};function eA(t){return new Hh(t)}function nA(t){return new JE(t)}var uK=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const n=uK(t,[]),{coordinate:r}=e;return(...i)=>{const a=fn(r)?qE:Sn(r)?nA:eA;return Wi(Object.assign({curve:a},n),e)(...i)}};rA.props=Object.assign(Object.assign({},Wi.props),{defaultMarker:"smooth"});function $h(t,e){this._context=t,this._t=e}$h.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0=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)}break}}this._x=t,this._y=e}};function iA(t){return new $h(t,.5)}function aA(t){return new $h(t,0)}function oA(t){return new $h(t,1)}const sA=(t,e)=>Wi(Object.assign({curve:oA},t),e);sA.props=Object.assign(Object.assign({},Wi.props),{defaultMarker:"hv"});const cA=(t,e)=>Wi(Object.assign({curve:aA},t),e);cA.props=Object.assign(Object.assign({},Wi.props),{defaultMarker:"vh"});const lA=(t,e)=>Wi(Object.assign({curve:iA},t),e);lA.props=Object.assign(Object.assign({},Wi.props),{defaultMarker:"hvh"});var fK=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const{document:n}=e;return(r,i,a)=>{const{seriesSize:o,color:s}=i,{color:c}=a,l=fK(a,["color"]),u=Gi();for(let f=0;f(t,e)=>{const{style:n={},encode:r}=e,{series:i}=r,{gradient:a}=n;return!a||i?[t,e]:[t,at({},e,{encode:{series:Bh(Co(t,void 0))}})]};fA.props={};const zy=()=>(t,e)=>{const{encode:n}=e,{series:r,color:i}=n;if(r!==void 0||i===void 0)return[t,e];const[a,o]=Le(n,"color");return[t,at({},e,{encode:{series:gn(a,o)}})]};zy.props={};const dA={line:$E,smooth:rA,hv:sA,vh:cA,hvh:lA,trail:uA},hK=(t,e,n,r)=>{var i,a;const{series:o,x:s,y:c}=n,{x:l,y:u}=e;if(s===void 0||c===void 0)throw new Error("Missing encode for x or y channel.");const f=o?Array.from(Cn(t,g=>o[g]).values()):[t],d=f.map(g=>g[0]).filter(g=>g!==void 0),h=(((i=l==null?void 0:l.getBandWidth)===null||i===void 0?void 0:i.call(l))||0)/2,p=(((a=u==null?void 0:u.getBandWidth)===null||a===void 0?void 0:a.call(u))||0)/2,v=Array.from(f,g=>g.map(y=>r.map([+s[y]+h,+c[y]+p])));return[d,v,f]},pK=(t,e,n,r)=>{const i=Object.entries(n).filter(([o])=>o.startsWith("position")).map(([,o])=>o);if(i.length===0)throw new Error("Missing encode for position channel.");const a=Array.from(t,o=>{const s=i.map(u=>+u[o]),c=r.map(s),l=[];for(let u=0;u(t,e,n,r)=>(ru(r)?pK:hK)(t,e,n,r);hA.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:dA,channels:[...Qr({shapes:Object.keys(dA)}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...Xn(),{type:fA},{type:zy}],postInference:[...rr(),...Qc(),...oK()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};var vK=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]];Gy.style=["fill"];const pA=Gy.bind(void 0);pA.style=["stroke","lineWidth"];const Vh=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]];Vh.style=["fill"];const vA=Vh.bind(void 0);vA.style=["fill"];const gA=Vh.bind(void 0);gA.style=["stroke","lineWidth"];const Wy=(t,e,n)=>{const r=n*.618;return[["M",t-r,e],["L",t,e-n],["L",t+r,e],["L",t,e+n],["Z"]]};Wy.style=["fill"];const yA=Wy.bind(void 0);yA.style=["stroke","lineWidth"];const Yy=(t,e,n)=>{const r=n*Math.sin(.3333333333333333*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]};Yy.style=["fill"];const mA=Yy.bind(void 0);mA.style=["stroke","lineWidth"];const Hy=(t,e,n)=>{const r=n*Math.sin(.3333333333333333*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]};Hy.style=["fill"];const bA=Hy.bind(void 0);bA.style=["stroke","lineWidth"];const $y=(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"]]};$y.style=["fill"];const _A=$y.bind(void 0);_A.style=["stroke","lineWidth"];const Vy=(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"]]};Vy.style=["fill"];const xA=Vy.bind(void 0);xA.style=["stroke","lineWidth"];const OA=(t,e,n)=>[["M",t,e+n],["L",t,e-n]];OA.style=["stroke","lineWidth"];const wA=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]];wA.style=["stroke","lineWidth"];const SA=(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]];SA.style=["stroke","lineWidth"];const MA=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]];MA.style=["stroke","lineWidth"];const EA=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];EA.style=["stroke","lineWidth"];const Uy=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];Uy.style=["stroke","lineWidth"];const AA=Uy.bind(void 0);AA.style=["stroke","lineWidth"];const PA=(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]];PA.style=["stroke","lineWidth"];const TA=(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]];TA.style=["stroke","lineWidth"];const kA=(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]];kA.style=["stroke","lineWidth"];const CA=(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]];CA.style=["stroke","lineWidth"];const LA=(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]];LA.style=["stroke","lineWidth"];const tl=new Map([["bowtie",Vy],["cross",wA],["dash",AA],["diamond",Wy],["dot",Uy],["hexagon",$y],["hollowBowtie",xA],["hollowDiamond",yA],["hollowHexagon",_A],["hollowPoint",pA],["hollowSquare",gA],["hollowTriangle",mA],["hollowTriangleDown",bA],["hv",TA],["hvh",CA],["hyphen",EA],["line",OA],["plus",MA],["point",Gy],["rect",vA],["smooth",PA],["square",Vh],["tick",SA],["triangleDown",Hy],["triangle",Yy],["vh",kA],["vhv",LA]]);function gK(t,e){var{d:n,fill:r,lineWidth:i,path:a,stroke:o,color:s}=e,c=vK(e,["d","fill","lineWidth","path","stroke","color"]);const l=tl.get(t)||tl.get("point");return(...u)=>new Zr({style:Object.assign(Object.assign({},c),{d:l(...u),stroke:l.style.includes("stroke")?s||o:"",fill:l.style.includes("fill")?s||r:"",lineWidth:l.style.includes("lineWidth")?i||i||2:0})})}function Hmt(t,e){tl.set(t,e)}function $mt(t){tl.delete(t)}var yK=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const{colorAttribute:n,symbol:r,mode:i="auto"}=t,a=yK(t,["colorAttribute","symbol","mode"]),o=tl.get(r)||tl.get("point"),{coordinate:s,document:c}=e;return(l,u,f)=>{const{lineWidth:d,color:h}=f,p=a.stroke?d||1:d,{color:v=h,transform:g,opacity:y}=u,[m,b]=Gg(l),x=NA(i,l,u,s)||a.r||f.r;return Kt(c.createElement("path",{})).call(Bt,f).style("fill","transparent").style("d",o(m,b,x)).style("lineWidth",p).style("transform",g).style("transformOrigin",`${m-x} ${b-x}`).style("stroke",v).style(zg(t),y).style(n,v).call(Bt,a).node()}};Ee.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const jA=(t,e)=>Ee(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e);jA.props=Object.assign({defaultMarker:"hollowPoint"},Ee.props);const RA=(t,e)=>Ee(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e);RA.props=Object.assign({defaultMarker:"hollowDiamond"},Ee.props);const IA=(t,e)=>Ee(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e);IA.props=Object.assign({defaultMarker:"hollowHexagon"},Ee.props);const DA=(t,e)=>Ee(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e);DA.props=Object.assign({defaultMarker:"hollowSquare"},Ee.props);const FA=(t,e)=>Ee(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e);FA.props=Object.assign({defaultMarker:"hollowTriangleDown"},Ee.props);const BA=(t,e)=>Ee(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e);BA.props=Object.assign({defaultMarker:"hollowTriangle"},Ee.props);const zA=(t,e)=>Ee(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e);zA.props=Object.assign({defaultMarker:"hollowBowtie"},Ee.props);var mK=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const{colorAttribute:n,mode:r="auto"}=t,i=mK(t,["colorAttribute","mode"]),{coordinate:a,document:o}=e;return(s,c,l)=>{const{lineWidth:u,color:f}=l,d=i.stroke?u||1:u,{color:h=f,transform:p,opacity:v}=c,[g,y]=Gg(s),b=NA(r,s,c,a)||i.r||l.r;return Kt(o.createElement("circle",{})).call(Bt,l).style("fill","transparent").style("cx",g).style("cy",y).style("r",b).style("lineWidth",d).style("transform",p).style("transformOrigin",`${g} ${y}`).style("stroke",h).style(zg(t),v).style(n,h).call(Bt,i).node()}},Xy=(t,e)=>GA(Object.assign({colorAttribute:"fill"},t),e);Xy.props={defaultMarker:"circle",defaultEnterAnimation:"fadeIn",defaultExitAnimation:"fadeOut"};const WA=(t,e)=>GA(Object.assign({colorAttribute:"stroke"},t),e);WA.props=Object.assign({defaultMarker:"hollowPoint"},Xy.props);const YA=(t,e)=>Ee(Object.assign({colorAttribute:"fill",symbol:"point"},t),e);YA.props=Object.assign({defaultMarker:"point"},Ee.props);const HA=(t,e)=>Ee(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e);HA.props=Object.assign({defaultMarker:"plus"},Ee.props);const $A=(t,e)=>Ee(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e);$A.props=Object.assign({defaultMarker:"diamond"},Ee.props);const VA=(t,e)=>Ee(Object.assign({colorAttribute:"fill",symbol:"square"},t),e);VA.props=Object.assign({defaultMarker:"square"},Ee.props);const UA=(t,e)=>Ee(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e);UA.props=Object.assign({defaultMarker:"triangle"},Ee.props);const XA=(t,e)=>Ee(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e);XA.props=Object.assign({defaultMarker:"hexagon"},Ee.props);const qA=(t,e)=>Ee(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e);qA.props=Object.assign({defaultMarker:"cross"},Ee.props);const ZA=(t,e)=>Ee(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e);ZA.props=Object.assign({defaultMarker:"bowtie"},Ee.props);const KA=(t,e)=>Ee(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e);KA.props=Object.assign({defaultMarker:"hyphen"},Ee.props);const QA=(t,e)=>Ee(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e);QA.props=Object.assign({defaultMarker:"line"},Ee.props);const JA=(t,e)=>Ee(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e);JA.props=Object.assign({defaultMarker:"tick"},Ee.props);const tP=(t,e)=>Ee(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e);tP.props=Object.assign({defaultMarker:"triangleDown"},Ee.props);const Uh=()=>(t,e)=>{const{encode:n}=e,{y:r}=n;return r!==void 0?[t,e]:[t,at({},e,{encode:{y:Fh(Co(t,0))},scale:{y:{guide:null}}})]};Uh.props={};const eP=()=>(t,e)=>{const{encode:n}=e,{size:r}=n;return r!==void 0?[t,e]:[t,at({},e,{encode:{size:Bh(Co(t,3))}})]};eP.props={};const nP={hollow:jA,hollowDiamond:RA,hollowHexagon:IA,hollowSquare:DA,hollowTriangleDown:FA,hollowTriangle:BA,hollowBowtie:zA,hollowCircle:WA,point:YA,plus:HA,diamond:$A,square:VA,triangle:UA,hexagon:XA,cross:qA,bowtie:ZA,hyphen:KA,line:QA,tick:JA,triangleDown:tP,circle:Xy},rP=t=>(e,n,r,i)=>{const{x:a,y:o,x1:s,y1:c,size:l,dx:u,dy:f}=r,[d,h]=i.getSize(),p=Rs(n,r,t),v=y=>{const m=+((u==null?void 0:u[y])||0),b=+((f==null?void 0:f[y])||0),_=s?(+a[y]+ +s[y])/2:+a[y],x=c?(+o[y]+ +c[y])/2:+o[y],O=_+m,w=x+b;return[O,w]},g=l?Array.from(e,y=>{const[m,b]=v(y),_=+l[y],x=_/d,O=_/h,w=[m-x,b-O],S=[m+x,b+O];return[i.map(p(w,y)),i.map(p(S,y))]}):Array.from(e,y=>[i.map(p(v(y),y))]);return[e,g]};rP.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,shape:nP,channels:[...Qr({shapes:Object.keys(nP)}),{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:[...Xn(),{type:Ns},{type:Uh}],postInference:[...rr(),{type:eP},...Lo()]};const iP=(t,e)=>{const{coordinate:n}=e;return(r,i,a)=>{const{color:o,text:s="",fontSize:c,rotate:l=0,transform:u=""}=i,f={text:String(s),stroke:o,fill:o,fontSize:c},[[d,h]]=r;return Kt(new xS).style("x",d).style("y",h).call(Bt,a).style("transform",`${u}rotate(${+l})`).style("coordCenter",n.getCenter()).call(Bt,f).call(Bt,t).node()}};iP.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var qy=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const e=t.attributes,{class:n,x:r,y:i,transform:a}=e,o=qy(e,["class","x","y","transform"]),s=At(o,"marker"),{size:c=24}=s,l=()=>bK(c/2),u=Kt(t).maybeAppend("marker",()=>new He({})).call(h=>h.node().update(Object.assign({symbol:l},s))).node(),[f,d]=_K(u);Kt(t).maybeAppend("text","text").style("x",f).style("y",d).call(Bt,o)}),aP=(t,e)=>{const n=qy(t,[]);return(r,i,a)=>{const{color:o}=a,s=qy(a,["color"]),{color:c=o,text:l=""}=i,u={text:String(l),stroke:c,fill:c},[[f,d]]=r;return Kt(new xK).call(Bt,s).style("transform",`translate(${f},${d})`).call(Bt,u).call(Bt,n).node()}};aP.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const oP=(t,e)=>{const{coordinate:n}=e;return(r,i,a)=>{const{color:o,text:s="",fontSize:c,rotate:l=0,transform:u=""}=i,f={text:String(s),stroke:o,fill:o,fontSize:c,textAlign:"center",textBaseline:"middle"},[[d,h]]=r;return Kt(new fi).style("x",d).style("y",h).call(Bt,a).style("transformOrigin","center center").style("transform",`${u}rotate(${l}deg)`).style("coordCenter",n.getCenter()).call(Bt,f).call(Bt,t).node()}};oP.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Xh=()=>(t,e)=>{const{data:n}=e;if(!Array.isArray(n)||n.some(Lu))return[t,e];const r=Array.isArray(n[0])?n:[n],i=r.map(o=>o[0]),a=r.map(o=>o[1]);return[t,at({},e,{encode:{x:gn(i),y:gn(a)}})]};Xh.props={};var sP=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i(t,e)=>{const{data:n,style:r={}}=e,i=sP(e,["data","style"]),{x:a,y:o}=r,s=sP(r,["x","y"]);if(a==null||o==null)return[t,e];const c=a||0,l=o||0;return[[0],at({},i,{data:[0],cartesian:!0,encode:{x:gn([c]),y:gn([l])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:s})]};qh.props={};const cP={text:iP,badge:aP,tag:oP},lP=t=>{const{cartesian:e=!1}=t;return e?Ly:(n,r,i,a)=>{const{x:o,y:s}=i,c=Rs(r,i,t),l=Array.from(n,u=>{const f=[+o[u],+s[u]];return[a.map(c(f,u))]});return[n,l]}};lP.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,shape:cP,channels:[...Qr({shapes:Object.keys(cP)}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize",scale:"identity"},{name:"rotate",scale:"identity"}],preInference:[...Xn(),{type:Xh},{type:qh}],postInference:[...rr(),...Lo()]};const Zy=()=>(t,e)=>[t,at({scale:{x:{padding:0},y:{padding:0}}},e)];Zy.props={};const uP={cell:js,hollow:zh},fP=()=>(t,e,n,r)=>{const{x:i,y:a}=n,o=e.x,s=e.y,c=Array.from(t,l=>{const u=o.getBandWidth(o.invert(+i[l])),f=s.getBandWidth(s.invert(+a[l])),d=+i[l],h=+a[l],p=[d,h],v=[d+u,h],g=[d+u,h+f],y=[d,h+f];return[p,v,g,y].map(m=>r.map(m))});return[t,c]};fP.props={defaultShape:"cell",defaultLabelShape:"label",shape:uP,composite:!1,channels:[...Qr({shapes:Object.keys(uP)}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...Xn(),{type:Ns},{type:Uh},{type:Zy}],postInference:[...rr(),...Lo()]};function Ky(t,e,n){var r=null,i=En(!0),a=null,o=mu,s=null,c=Hg(l);t=typeof t=="function"?t:t===void 0?bS:En(+t),e=typeof e=="function"?e:En(e===void 0?0:+e),n=typeof n=="function"?n:n===void 0?_S:En(+n);function l(f){var d,h,p,v=(f=gS(f)).length,g,y=!1,m,b=new Array(v),_=new Array(v);for(a==null&&(s=o(m=c())),d=0;d<=v;++d){if(!(d=h;--p)s.point(b[p],_[p]);s.lineEnd(),s.areaEnd()}y&&(b[d]=+t(g,d,f),_[d]=+e(g,d,f),s.point(r?+r(g,d,f):b[d],n?+n(g,d,f):_[d]))}if(m)return s=null,m+""||null}function u(){return Mo().defined(i).curve(o).context(a)}return l.x=function(f){return arguments.length?(t=typeof f=="function"?f:En(+f),r=null,l):t},l.x0=function(f){return arguments.length?(t=typeof f=="function"?f:En(+f),l):t},l.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:En(+f),l):r},l.y=function(f){return arguments.length?(e=typeof f=="function"?f:En(+f),n=null,l):e},l.y0=function(f){return arguments.length?(e=typeof f=="function"?f:En(+f),l):e},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:En(+f),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(f){return arguments.length?(i=typeof f=="function"?f:En(!!f),l):i},l.curve=function(f){return arguments.length?(o=f,a!=null&&(s=o(a)),l):o},l.context=function(f){return arguments.length?(f==null?a=s=null:s=o(a=f),l):a},l}function OK(){var t=Ky().curve(WE),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,a=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 Ru(n())},delete t.lineX0,t.lineEndAngle=function(){return Ru(r())},delete t.lineX1,t.lineInnerRadius=function(){return Ru(i())},delete t.lineY0,t.lineOuterRadius=function(){return Ru(a())},delete t.lineY1,t.curve=function(o){return arguments.length?e(Ry(o)):e()._curve},t}var wK=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i!e(f)))a=!0;else{if(n.push(l),r.push(u),a&&o){a=!1;const[f,d]=o;i.push([f,l,d,u])}o=[l,u]}}return[n.concat(r),i]}const dP=Fc(t=>{const{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes,a=t.ownerDocument;Kt(t).maybeAppend("connect-path",()=>a.createElement("path",{})).style("d",n).call(Bt,i),Kt(t).maybeAppend("area-path",()=>a.createElement("path",{})).style("d",e).call(Bt,r)}),na=(t,e)=>{const{curve:n,gradient:r=!1,defined:i=l=>!Number.isNaN(l)&&l!==void 0&&l!==null,connect:a=!1}=t,o=wK(t,["curve","gradient","defined","connect"]),{coordinate:s,document:c}=e;return(l,u,f)=>{const{color:d}=f,{color:h=d,seriesColor:p,seriesX:v,seriesY:g}=u,y=Sn(s),m=pS(s,u),b=r&&p?hS(p,v,g,r,void 0,y):h,_=Object.assign(Object.assign(Object.assign(Object.assign({},f),{stroke:b,fill:b}),m&&{transform:m}),o),[x,O]=SK(l,i),w=At(_,"connect"),S=!!O.length,M=E=>Kt(c.createElement("path",{})).style("d",E||"").call(Bt,_).node();if(fn(s)){const E=A=>{const C=s.getCenter(),P=A.slice(0,A.length/2),T=A.slice(A.length/2);return OK().angle((k,N)=>Dc(zn(P[N],C))).outerRadius((k,N)=>Ln(P[N],C)).innerRadius((k,N)=>Ln(T[N],C)).defined((k,N)=>[...P[N],...T[N]].every(i)).curve(n)(T)};return!S||a&&!Object.keys(w).length?M(E(x)):S&&!a?M(E(l)):Kt(new dP).style("areaStyle",_).style("connectStyle",Object.assign(Object.assign({},w),o)).style("areaPath",E(l)).style("connectPath",O.map(E).join("")).node()}else{const E=A=>{const C=A.slice(0,A.length/2),P=A.slice(A.length/2);return y?Ky().y((T,k)=>C[k][1]).x1((T,k)=>C[k][0]).x0((T,k)=>P[k][0]).defined((T,k)=>[...C[k],...P[k]].every(i)).curve(n)(C):Ky().x((T,k)=>C[k][0]).y1((T,k)=>C[k][1]).y0((T,k)=>P[k][1]).defined((T,k)=>[...C[k],...P[k]].every(i)).curve(n)(C)};return!S||a&&!Object.keys(w).length?M(E(x)):S&&!a?M(E(l)):Kt(new dP).style("areaStyle",_).style("connectStyle",Object.assign(Object.assign({},w),o)).style("areaPath",E(l)).style("connectPath",O.map(E).join("")).node()}}};na.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const hP=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=fn(n)?Ty:mu;return na(Object.assign({curve:i},t),e)(...r)}};hP.props=Object.assign(Object.assign({},na.props),{defaultMarker:"square"});var MK=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const n=MK(t,[]),{coordinate:r}=e;return(...i)=>{const a=fn(r)?qE:Sn(r)?nA:eA;return na(Object.assign({curve:a},n),e)(...i)}};pP.props=Object.assign(Object.assign({},na.props),{defaultMarker:"smooth"});const vP=(t,e)=>(...n)=>na(Object.assign({curve:iA},t),e)(...n);vP.props=Object.assign(Object.assign({},na.props),{defaultMarker:"hvh"});const gP=(t,e)=>(...n)=>na(Object.assign({curve:aA},t),e)(...n);gP.props=Object.assign(Object.assign({},na.props),{defaultMarker:"vh"});const yP=(t,e)=>(...n)=>na(Object.assign({curve:oA},t),e)(...n);yP.props=Object.assign(Object.assign({},na.props),{defaultMarker:"hv"});const mP={area:hP,smooth:pP,hvh:vP,vh:gP,hv:yP},bP=()=>(t,e,n,r)=>{var i,a;const{x:o,y:s,y1:c,series:l}=n,{x:u,y:f}=e,d=l?Array.from(Cn(t,y=>l[y]).values()):[t],h=d.map(y=>y[0]).filter(y=>y!==void 0),p=(((i=u==null?void 0:u.getBandWidth)===null||i===void 0?void 0:i.call(u))||0)/2,v=(((a=f==null?void 0:f.getBandWidth)===null||a===void 0?void 0:a.call(f))||0)/2,g=Array.from(d,y=>{const m=y.length,b=new Array(m*2);for(let _=0;_(t,e)=>{const{encode:n}=e,{y1:r}=n;if(r)return[t,e];const[i]=Le(n,"y");return[t,at({},e,{encode:{y1:gn([...i])}})]};_P.props={};const xP=()=>(t,e)=>{const{encode:n}=e,{x1:r}=n;if(r)return[t,e];const[i]=Le(n,"x");return[t,at({},e,{encode:{x1:gn([...i])}})]};xP.props={};var OP=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const{arrow:n=!0,arrowSize:r="40%"}=t,i=OP(t,["arrow","arrowSize"]),{document:a}=e;return(o,s,c)=>{const{defaultColor:l}=c,u=OP(c,["defaultColor"]),{color:f=l,transform:d}=s,[h,p]=o,v=Gi();if(v.moveTo(...h),v.lineTo(...p),n){const[g,y]=M$(h,p,{arrowSize:r});v.moveTo(...p),v.lineTo(...g),v.moveTo(...p),v.lineTo(...y)}return Kt(a.createElement("path",{})).call(Bt,u).style("d",v.toString()).style("stroke",f).style("transform",d).call(Bt,i).node()}};Qy.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const wP=(t,e)=>{const{arrow:n=!1}=t;return(...r)=>Qy(Object.assign(Object.assign({},t),{arrow:n}),e)(...r)};wP.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var SP=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const n=SP(t,[]),{coordinate:r,document:i}=e;return(a,o,s)=>{const{color:c}=s,l=SP(s,["color"]),{color:u=c,transform:f}=o,[d,h]=a,p=Gi();if(p.moveTo(d[0],d[1]),fn(r)){const v=r.getCenter();p.quadraticCurveTo(v[0],v[1],h[0],h[1])}else{const v=dS(d,h),g=Ln(d,h)/2;yu(p,d,h,v,g)}return Kt(i.createElement("path",{})).call(Bt,l).style("d",p.toString()).style("stroke",u).style("transform",f).call(Bt,n).node()}};MP.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var EP=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const n=EP(t,[]),{document:r}=e;return(i,a,o)=>{const{color:s}=o,c=EP(o,["color"]),{color:l=s,transform:u}=a,[f,d]=i,h=Gi();return h.moveTo(f[0],f[1]),h.bezierCurveTo(f[0]/2+d[0]/2,f[1],f[0]/2+d[0]/2,d[1],d[0],d[1]),Kt(r.createElement("path",{})).call(Bt,c).style("d",h.toString()).style("stroke",l).style("transform",u).call(Bt,n).node()}};AP.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var PP=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const{cornerRatio:n=1/3}=t,r=PP(t,["cornerRatio"]),{coordinate:i,document:a}=e;return(o,s,c)=>{const{defaultColor:l}=c,u=PP(c,["defaultColor"]),{color:f=l,transform:d}=s,[h,p]=o,v=EK(h,p,i,n);return Kt(a.createElement("path",{})).call(Bt,u).style("d",v.toString()).style("stroke",f).style("transform",d).call(Bt,r).node()}};TP.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const kP={link:wP,arc:MP,smooth:AP,vhv:TP},Jy=t=>(e,n,r,i)=>{const{x:a,y:o,x1:s=a,y1:c=o}=r,l=Rs(n,r,t),u=e.map(f=>[i.map(l([+a[f],+o[f]],f)),i.map(l([+s[f],+c[f]],f))]);return[e,u]};Jy.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,shape:kP,channels:[...Qr({shapes:Object.keys(kP)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Xn(),{type:_P},{type:xP}],postInference:[...rr(),...Lo()]};var AK=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const{coordinate:n,document:r}=e;return(i,a,o)=>{const{color:s}=o,c=AK(o,["color"]),{color:l=s,src:u="",size:f=32,transform:d=""}=a;let{width:h=f,height:p=f}=t;const[[v,g]]=i,[y,m]=n.getSize();h=typeof h=="string"?Yh(h)*y:h,p=typeof p=="string"?Yh(p)*m:p;const b=v-Number(h)/2,_=g-Number(p)/2;return Kt(r.createElement("image",{})).call(Bt,c).style("x",b).style("y",_).style("src",u).style("stroke",l).style("transform",d).call(Bt,t).style("width",h).style("height",p).node()}};CP.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const LP={image:CP},NP=t=>{const{cartesian:e}=t;return e?Ly:(n,r,i,a)=>{const{x:o,y:s}=i,c=Rs(r,i,t),l=Array.from(n,u=>{const f=[+o[u],+s[u]];return[a.map(c(f,u))]});return[n,l]}};NP.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,shape:LP,channels:[...Qr({shapes:Object.keys(LP)}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...Xn(),{type:Xh},{type:qh}],postInference:[...rr(),...Lo()]};var PK=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);iLn(o,r));return i.forEach((o,s)=>{if(s===0){n.moveTo(o[0],o[1]);return}const c=a[s],l=t[s-1],u=a[s-1];u!==void 0&&Math.abs(c-u)<1e-10?yu(n,l,o,r,c):n.lineTo(o[0],o[1])}),n.closePath(),n}return S$(n,t)}const jP=(t,e)=>{const{coordinate:n,document:r}=e;return(i,a,o)=>{const{color:s}=o,c=PK(o,["color"]),{color:l=s,transform:u}=a,f=TK(i,n);return Kt(r.createElement("path",{})).call(Bt,c).style("d",f.toString()).style("stroke",l).style("fill",l).style("transform",u).call(Bt,t).node()}};jP.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var RP=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const n=RP(t,[]),{coordinate:r,document:i}=e;return(a,o,s)=>{const{color:c}=s,l=RP(s,["color"]),{color:u=c,transform:f}=o,d=kK(a,r);return Kt(i.createElement("path",{})).call(Bt,l).style("d",d.toString()).style("fill",u||c).style("stroke",u||c).style("transform",f).call(Bt,n).node()}};IP.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const DP={polygon:jP,ribbon:IP},FP=()=>(t,e,n,r)=>{const i=Object.entries(n).filter(([s])=>s.startsWith("x")).map(([,s])=>s),a=Object.entries(n).filter(([s])=>s.startsWith("y")).map(([,s])=>s),o=t.map(s=>{const c=[];for(let l=0;l{const{coordinate:n,document:r}=e;return(i,a,o)=>{const{color:s,transform:c}=a,{color:l,fill:u=l,stroke:f=l}=o,d=CK(o,["color","fill","stroke"]),h=LK(i,n);return Kt(r.createElement("path",{})).call(Bt,d).style("d",h.toString()).style("stroke",f).style("fill",s||u).style("transform",c).call(Bt,t).node()}};BP.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var NK=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const{coordinate:n,document:r}=e;return(i,a,o)=>{const{color:s,transform:c}=a,l=4,{color:u,fill:f=u,stroke:d=u}=o,h=NK(o,["color","fill","stroke"]),p=jK(i,n,l);return Kt(r.createElement("path",{})).call(Bt,h).style("d",p.toString()).style("stroke",d).style("fill",s||f).style("transform",c).call(Bt,t).node()}};zP.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const GP={box:BP,violin:zP},WP=()=>(t,e,n,r)=>{const{x:i,y:a,y1:o,y2:s,y3:c,y4:l,series:u}=n,f=e.x,d=e.series,h=Array.from(t,p=>{const v=f.getBandWidth(f.invert(+i[p])),g=d?d.getBandWidth(d.invert(+(u==null?void 0:u[p]))):1,y=v*g,m=(+(u==null?void 0:u[p])||0)*v,b=+i[p]+m+y/2,[_,x,O,w,S]=[+a[p],+o[p],+s[p],+c[p],+l[p]];return[[b-y/2,S],[b+y/2,S],[b,S],[b,w],[b-y/2,w],[b+y/2,w],[b+y/2,x],[b-y/2,x],[b-y/2,O],[b+y/2,O],[b,x],[b,_],[b-y/2,_],[b+y/2,_]].map(E=>r.map(E))});return[t,h]};WP.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,shape:GP,channels:[...Qr({shapes:Object.keys(GP)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...Xn(),{type:Ns}],postInference:[...rr(),...Qc()],interaction:{shareTooltip:!0}};const YP={vector:Qy},HP=()=>(t,e,n,r)=>{const{x:i,y:a,size:o,rotate:s}=n,[c,l]=r.getSize(),u=t.map(f=>{const d=+s[f]/180*Math.PI,h=+o[f],p=h/c,v=h/l,g=p*Math.cos(d),y=-v*Math.sin(d);return[r.map([+i[f]-g/2,+a[f]-y/2]),r.map([+i[f]+g/2,+a[f]+y/2])]});return[t,u]};HP.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,shape:YP,channels:[...Qr({shapes:Object.keys(YP)}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...Xn()],postInference:[...rr(),...Lo()]};var $P=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);ir[0]).y(r=>r[1])(t);const n=e.getCenter();return bh()({startAngle:0,endAngle:Math.PI*2,outerRadius:Ln(t[0],n),innerRadius:Ln(t[1],n)})}function DK(t,e){if(!fn(t))return e;const[n,r]=t.getCenter();return`translate(${n}, ${r}) ${e||""}`}const tm=(t,e)=>{const{arrow:n,arrowSize:r=4}=t,i=$P(t,["arrow","arrowSize"]),{coordinate:a,document:o}=e;return(s,c,l)=>{const{color:u,lineWidth:f}=l,d=$P(l,["color","lineWidth"]),{color:h=u,size:p=f}=c,v=n?RK(o,r,Object.assign({fill:i.stroke||h,stroke:i.stroke||h},At(i,"arrow"))):null,g=IK(s,a),y=DK(a,c.transform);return Kt(o.createElement("path",{})).call(Bt,d).style("d",g).style("stroke",h).style("lineWidth",p).style("transform",y).style("markerEnd",v).call(Bt,i).node()}};tm.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const VP=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(Lu)?[t,e]:[t,at({},e,{encode:{x:gn(n)}})]};VP.props={};const UP={line:tm},XP=t=>(e,n,r,i)=>{const{x:a}=r,o=Rs(n,r,at({style:{bandOffset:0}},t)),s=Array.from(e,c=>{const l=[a[c],1],u=[a[c],0];return[l,u].map(f=>i.map(o(f,c)))});return[e,s]};XP.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:UP,channels:[...Jc({shapes:Object.keys(UP)}),{name:"x",required:!0}],preInference:[...Xn(),{type:VP}],postInference:[...rr()]};const qP=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(Lu)?[t,e]:[t,at({},e,{encode:{y:gn(n)}})]};qP.props={};const ZP={line:tm},KP=t=>(e,n,r,i)=>{const{y:a}=r,o=Rs(n,r,at({style:{bandOffset:0}},t)),s=Array.from(e,c=>{const l=[0,a[c]],u=[1,a[c]];return[l,u].map(f=>i.map(o(f,c)))});return[e,s]};KP.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:ZP,channels:[...Jc({shapes:Object.keys(ZP)}),{name:"y",required:!0}],preInference:[...Xn(),{type:qP}],postInference:[...rr()]};var QP=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);ie[0]).y(e=>e[1])(t)}function zK(t,e,n,r,i=0){const[[a,o],[s,c]]=e;if(Sn(t)){const d=a+n,h=s+r,p=d+i;return[[d,o],[p,o],[p,c],[h,c]]}const l=o-n,u=c-r,f=l-i;return[[a,l],[a,f],[s,f],[s,u]]}const JP=(t,e)=>{const{offset:n=0,offset1:r=n,offset2:i=n,connectLength1:a,endMarker:o=!0}=t,s=QP(t,["offset","offset1","offset2","connectLength1","endMarker"]),{coordinate:c}=e;return(l,u,f)=>{const{color:d,connectLength1:h}=f,p=QP(f,["color","connectLength1"]),{color:v,transform:g}=u,y=zK(c,l,r,i,a!=null?a:h),m=At(Object.assign(Object.assign({},s),f),"endMarker");return Kt(new Zr).call(Bt,p).style("d",BK(y)).style("stroke",v||d).style("transform",g).style("markerEnd",o?new He({className:"marker",style:Object.assign(Object.assign({},m),{symbol:FK})}):null).call(Bt,s).node()}};JP.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const tT={connector:JP},eT=(...t)=>Jy(...t);eT.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,shape:tT,channels:[...Jc({shapes:Object.keys(tT)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Xn()],postInference:[...rr()]};function nT(t,e,n,r){if(e)return()=>[0,1];const{[t]:i,[`${t}1`]:a}=n;return o=>{var s;const c=((s=r.getBandWidth)===null||s===void 0?void 0:s.call(r,r.invert(+a[o])))||0;return[i[o],a[o]+c]}}function em(t={}){const{extendX:e=!1,extendY:n=!1}=t;return(r,i,a,o)=>{const s=nT("x",e,a,i.x),c=nT("y",n,a,i.y),l=Array.from(r,u=>{const[f,d]=s(u),[h,p]=c(u);return[[f,h],[d,h],[d,p],[f,p]].map(b=>o.map(b))});return[r,l]}}const rT={range:js},iT=()=>em();iT.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:rT,channels:[...Jc({shapes:Object.keys(rT)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Xn()],postInference:[...rr()]};const aT=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(Lu))){const r=(i,a)=>Array.isArray(i[0])?i.map(o=>o[a]):[i[a]];return[t,at({},e,{encode:{x:gn(r(n,0)),x1:gn(r(n,1))}})]}return[t,e]};aT.props={};const oT={range:js},sT=()=>em({extendY:!0});sT.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:oT,channels:[...Jc({shapes:Object.keys(oT)}),{name:"x",required:!0}],preInference:[...Xn(),{type:aT}],postInference:[...rr()]};const cT=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(Lu))){const r=(i,a)=>Array.isArray(i[0])?i.map(o=>o[a]):[i[a]];return[t,at({},e,{encode:{y:gn(r(n,0)),y1:gn(r(n,1))}})]}return[t,e]};cT.props={};const lT={range:js},uT=()=>em({extendX:!0});uT.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:lT,channels:[...Jc({shapes:Object.keys(lT)}),{name:"y",required:!0}],preInference:[...Xn(),{type:cT}],postInference:[...rr()]};var fT=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const{arrow:n,colorAttribute:r}=t,i=fT(t,["arrow","colorAttribute"]),{coordinate:a,document:o}=e;return(s,c,l)=>{const{color:u,stroke:f}=l,d=fT(l,["color","stroke"]),{d:h,color:p=u}=c,[v,g]=a.getSize();return Kt(o.createElement("path",{})).call(Bt,d).style("d",typeof h=="function"?h({width:v,height:g}):h).style(r,p).call(Bt,i).node()}};nm.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const dT=(t,e)=>nm(Object.assign({colorAttribute:"fill"},t),e);dT.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const hT=(t,e)=>nm(Object.assign({fill:"none",colorAttribute:"stroke"},t),e);hT.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const pT={path:dT,hollow:hT},vT=t=>(e,n,r,i)=>[e,e.map(()=>[[0,0]])];vT.props={defaultShape:"path",defaultLabelShape:"label",shape:pT,composite:!1,channels:[...Qr({shapes:Object.keys(pT)}),{name:"d",scale:"identity"}],preInference:[...Xn()],postInference:[...rr()]};var GK=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const{render:n}=t,r=GK(t,["render"]);return i=>{const[[a,o]]=i;return n(Object.assign(Object.assign({},r),{x:a,y:o}),e)}};gT.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const yT=()=>(t,e)=>{const{style:n={}}=e;return[t,at({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter(([,r])=>typeof r=="function").map(([r,i])=>[r,()=>i])))})]};yT.props={};const WK={shape:gT},mT=t=>{const{cartesian:e}=t;return e?Ly:(n,r,i,a)=>{const{x:o,y:s}=i,c=Rs(r,i,t),l=Array.from(n,u=>{const f=[+o[u],+s[u]];return[a.map(c(f,u))]});return[n,l]}};mT.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,shape:WK,channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Xn(),{type:Xh},{type:qh},{type:yT}]};var YK=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const{document:n}=e;return(r,i,a)=>{const{transform:o}=i,{color:s}=a,c=YK(a,["color"]),{color:l=s}=i,[u,...f]=r,d=Gi();return d.moveTo(...u),f.forEach(([h,p])=>{d.lineTo(h,p)}),d.closePath(),Kt(n.createElement("path",{})).call(Bt,c).style("d",d.toString()).style("stroke",l||s).style("fill",l||s).style("fillOpacity",.4).style("transform",o).call(Bt,t).node()}};bT.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const _T={density:bT},xT=()=>(t,e,n,r)=>{const{x:i,series:a}=n,o=Object.entries(n).filter(([f])=>f.startsWith("y")).map(([,f])=>f),s=Object.entries(n).filter(([f])=>f.startsWith("size")).map(([,f])=>f);if(i===void 0||o===void 0||s===void 0)throw new Error("Missing encode for x or y or size channel.");const c=e.x,l=e.series,u=Array.from(t,f=>{const d=c.getBandWidth(c.invert(+i[f])),h=l?l.getBandWidth(l.invert(+(a==null?void 0:a[f]))):1,p=d*h,v=(+(a==null?void 0:a[f])||0)*d,g=+i[f]+v+p/2;return[...o.map((m,b)=>[g+ +s[b][f]/t.length,+o[b][f]]),...o.map((m,b)=>[g-+s[b][f]/t.length,+o[b][f]]).reverse()].map(m=>r.map(m))});return[t,u]};xT.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,shape:_T,channels:[...Qr({shapes:Object.keys(_T)}),{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:[...Xn(),{type:Nu},{type:Ns}],postInference:[...rr(),...Qc()],interaction:{shareTooltip:!0}};function OT(t){var e,n,r,i=t||1;function a(s,c){++e>i&&(r=n,o(1),++e),n[s]=c}function o(s){e=0,n=Object.create(null),s||(r=Object.create(null))}return o(),{clear:o,has:function(s){return n[s]!==void 0||r[s]!==void 0},get:function(s){var c=n[s];if(c!==void 0)return c;if((c=r[s])!==void 0)return a(s,c),c},set:function(s,c){n[s]!==void 0?n[s]=c:a(s,c)}}}const Vmt=OT(3);function HK(t,e=(...r)=>`${r[0]}`,n=16){const r=OT(n);return(...i)=>{const a=e(...i);let o=r.get(a);return r.has(a)?r.get(a):(o=t(...i),r.set(a,o),o)}}function $K(t){return typeof t=="string"?t.split(" ").map(e=>{const[n,r]=e.split(":");return[+n,r]}):t}function Zh(t,e,n){const r=t?t():document.createElement("canvas");return r.width=e,r.height=n,r}const VK=HK((t,e,n)=>{const r=Zh(n,t*2,t*2),i=r.getContext("2d"),a=t,o=t;if(e===1)i.beginPath(),i.arc(a,o,t,0,2*Math.PI,!1),i.fillStyle="rgba(0,0,0,1)",i.fill();else{const s=i.createRadialGradient(a,o,t*e,a,o,t);s.addColorStop(0,"rgba(0,0,0,1)"),s.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=s,i.fillRect(0,0,2*t,2*t)}return r},t=>`${t}`);function UK(t,e){const r=Zh(e,256,1).getContext("2d"),i=r.createLinearGradient(0,0,256,1);return $K(t).forEach(([a,o])=>{i.addColorStop(a,o)}),r.fillStyle=i,r.fillRect(0,0,256,1),r.getImageData(0,0,256,1).data}function XK(t,e,n,r,i,a){const{blur:o}=i;let s=r.length;for(;s--;){const{x:c,y:l,value:u,radius:f}=r[s],d=Math.min(u,n),h=c-f,p=l-f,v=VK(f,1-o,a),g=(d-e)/(n-e);t.globalAlpha=Math.max(g,.001),t.drawImage(v,h,p)}return t}function qK(t,e,n,r,i){const{minOpacity:a,opacity:o,maxOpacity:s,useGradientOpacity:c}=i,l=0,u=0,f=e,d=n,h=t.getImageData(l,u,f,d),p=h.data,v=p.length;for(let g=3;g{const i=t[r];return e(i,r)||(n[r]=i),n},{})}const wT=(t,e)=>{const{gradient:n,opacity:r,maxOpacity:i,minOpacity:a,blur:o,useGradientOpacity:s}=t,c=KK(t,["gradient","opacity","maxOpacity","minOpacity","blur","useGradientOpacity"]),{coordinate:l,createCanvas:u,document:f}=e;return(d,h,p)=>{const{transform:v}=h,[g,y]=l.getSize(),m=d.map(w=>({x:w[0],y:w[1],value:w[2],radius:w[3]})),b=Oi(d,w=>w[2]),_=Ke(d,w=>w[2]),O=g&&y?ZK(g,y,b,_,m,QK({gradient:n,opacity:r,minOpacity:a,maxOpacity:i,blur:o,useGradientOpacity:s},w=>w===void 0),u):{canvas:null};return Kt(f.createElement("image",{})).call(Bt,p).style("x",0).style("y",0).style("width",g).style("height",y).style("src",O.canvas).style("transform",v).call(Bt,c).node()}};wT.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const ST={heatmap:wT},MT=t=>(e,n,r,i)=>{const{x:a,y:o,size:s,color:c}=r,l=Array.from(e,u=>{const f=s?+s[u]:40;return[...i.map([+a[u],+o[u]]),c[u],f]});return[[0],[l]]};MT.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,shape:ST,channels:[...Qr({shapes:Object.keys(ST)}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...Xn(),{type:Ns},{type:Uh}],postInference:[...rr(),...Lo()]};var JK=function(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{l(r.next(u))}catch(f){o(f)}}function c(u){try{l(r.throw(u))}catch(f){o(f)}}function l(u){u.done?a(u.value):i(u.value).then(s,c)}l((r=r.apply(t,e||[])).next())})},tQ=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);iObject.assign(Object.assign({},i),{text:i[n],value:i[r]}))}const nQ=()=>({axis:!1,type:"text",encode:{x:"x",y:"y",text:"text",rotate:"rotate",fontSize:"size",shape:"tag"},scale:{x:{range:[0,1]},y:{range:[0,1]}},style:{fontFamily:t=>t.fontFamily}}),rm=(t,e)=>JK(void 0,void 0,void 0,function*(){const{width:n,height:r}=e,{data:i,encode:a={},scale:o,style:s={},layout:c={}}=t,l=tQ(t,["data","encode","scale","style","layout"]),u=eQ(i,a);return at({},nQ(),Object.assign(Object.assign({data:{value:u,transform:[Object.assign({type:"wordCloud",size:[n,r]},c)]},encode:a,scale:o,style:s},l),{axis:!1}))});rm.props={};const ET=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"];ET.props={};const AT=()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"];AT.props={};const PT=t=>new Fr(t);PT.props={};const Kh=Symbol("defaultUnknown");function TT(t,e,n){for(let r=0;r`${e}`:typeof t=="object"?e=>JSON.stringify(e):e=>e}class Qh extends fu{getDefaultOptions(){return{domain:[],range:[],unknown:Kh}}constructor(e){super(e)}map(e){return this.domainIndexMap.size===0&&TT(this.domainIndexMap,this.getDomain(),this.domainKey),kT({value:this.domainKey(e),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(e){return this.rangeIndexMap.size===0&&TT(this.rangeIndexMap,this.getRange(),this.rangeKey),kT({value:this.rangeKey(e),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(e){const[n]=this.options.domain,[r]=this.options.range;if(this.domainKey=CT(n),this.rangeKey=CT(r),!this.rangeIndexMap){this.rangeIndexMap=new Map,this.domainIndexMap=new Map;return}(!e||e.range)&&this.rangeIndexMap.clear(),(!e||e.domain||e.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new Qh(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:e,compare:n}=this.options;return this.sortedDomain=n?[...e].sort(n):e,this.sortedDomain}}const LT=t=>new Qh(t);LT.props={};function NT({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function rQ({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function iQ({map:t,initKey:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function aQ(t){return typeof t=="object"?t.valueOf():t}class jT extends Map{constructor(e){if(super(),this.map=new Map,this.initKey=aQ,e!==null)for(const[n,r]of e)this.set(n,r)}get(e){return super.get(NT({map:this.map,initKey:this.initKey},e))}has(e){return super.has(NT({map:this.map,initKey:this.initKey},e))}set(e,n){return super.set(rQ({map:this.map,initKey:this.initKey},e),n)}delete(e){return super.delete(iQ({map:this.map,initKey:this.initKey},e))}}function oQ(t){const e=Math.min(...t);return t.map(n=>n/e)}function sQ(t,e){const n=t.length,r=e-n;return r>0?[...t,...new Array(r).fill(1)]:r<0?t.slice(0,e):t}function cQ(t){return Math.round(t*1e12)/1e12}function lQ(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:a,round:o,align:s}=t,c=e.length,l=sQ(a,c),[u,f]=n,d=f-u,h=2/c*r+1-1/c*i,p=d/h,v=p*i/c,g=p-c*v,y=oQ(l),m=y.reduce((C,P)=>C+P),b=g/m,_=new jT(e.map((C,P)=>{const T=y[P]*b;return[C,o?Math.floor(T):T]})),x=new jT(e.map((C,P)=>{const k=y[P]*b+v;return[C,o?Math.floor(k):k]})),O=Array.from(x.values()).reduce((C,P)=>C+P),S=(d-(O-O/c*i))*s,M=u+S;let E=o?Math.round(M):M;const A=new Array(c);for(let C=0;Cd+b*u);return{valueStep:u,valueBandWidth:f,adjustedRange:y}}class No extends Qh{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:Kh,flex:[]}}constructor(e){super(e)}clone(){return new No(this.options)}getStep(e){return this.valueStep===void 0?1:typeof this.valueStep=="number"?this.valueStep:e===void 0?Array.from(this.valueStep.values())[0]:this.valueStep.get(e)}getBandWidth(e){return this.valueBandWidth===void 0?1:typeof this.valueBandWidth=="number"?this.valueBandWidth:e===void 0?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(e)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:e,paddingInner:n}=this.options;return e>0?e:n}getPaddingOuter(){const{padding:e,paddingOuter:n}=this.options;return e>0?e:n}rescale(){super.rescale();const{align:e,domain:n,range:r,round:i,flex:a}=this.options,{adjustedRange:o,valueBandWidth:s,valueStep:c}=uQ({align:e,range:r,round:i,flex:a,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:n});this.valueStep=c,this.valueBandWidth=s,this.adjustedRange=o}}const RT=t=>new No(t);RT.props={};class Jh extends fu{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:jg}}map(e){return rh(e)?e:this.options.unknown}invert(e){return this.map(e)}clone(){return new Jh(this.options)}getTicks(){const{domain:e,tickCount:n,tickMethod:r}=this.options,[i,a]=e;return!Cc(i)||!Cc(a)?[]:r(i,a,n)}}const IT=t=>new Jh(t);IT.props={};class im extends No{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:Kh,paddingInner:1,paddingOuter:0}}constructor(e){super(e)}getPaddingInner(){return 1}clone(){return new im(this.options)}update(e){super.update(e)}getPaddingOuter(){return this.options.padding}}const DT=t=>new im(t);DT.props={};var FT=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,jo="\\d\\d?",Ro="\\d\\d",fQ="\\d{3}",dQ="\\d{4}",Iu="[^\\s]+",BT=/\[([^]*?)\]/gm;function zT(t,e){for(var n=[],r=0,i=t.length;r-1?i:null}};function Is(t){for(var e=[],n=1;n3?0:(t-t%10!==10?1:0)*t%10]}},tp=Is({},HT),vQ=function(t){return tp=Is(tp,t)},$T=function(t){return t.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},pi=function(t,e){for(e===void 0&&(e=2),t=String(t);t.length0?"-":"+")+pi(Math.floor(Math.abs(e)/60)*100+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+pi(Math.floor(Math.abs(e)/60),2)+":"+pi(Math.abs(e)%60,2)}},VT=function(t){return+t-1},UT=[null,jo],XT=[null,Iu],qT=["isPm",Iu,function(t,e){var n=t.toLowerCase();return n===e.amPm[0]?0:n===e.amPm[1]?1:null}],ZT=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(t){var e=(t+"").match(/([+-]|\d\d)/gi);if(e){var n=+e[1]*60+parseInt(e[2],10);return e[0]==="+"?n:-n}return 0}],yQ={D:["day",jo],DD:["day",Ro],Do:["day",jo+Iu,function(t){return parseInt(t,10)}],M:["month",jo,VT],MM:["month",Ro,VT],YY:["year",Ro,function(t){var e=new Date,n=+(""+e.getFullYear()).substr(0,2);return+(""+(+t>68?n-1:n)+t)}],h:["hour",jo,void 0,"isPm"],hh:["hour",Ro,void 0,"isPm"],H:["hour",jo],HH:["hour",Ro],m:["minute",jo],mm:["minute",Ro],s:["second",jo],ss:["second",Ro],YYYY:["year",dQ],S:["millisecond","\\d",function(t){return+t*100}],SS:["millisecond",Ro,function(t){return+t*10}],SSS:["millisecond",fQ],d:UT,dd:UT,ddd:XT,dddd:XT,MMM:["month",Iu,GT("monthNamesShort")],MMMM:["month",Iu,GT("monthNames")],a:qT,A:qT,ZZ:ZT,Z:ZT},ep={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"},mQ=function(t){return Is(ep,t)},KT=function(t,e,n){if(e===void 0&&(e=ep.default),n===void 0&&(n={}),typeof t=="number"&&(t=new Date(t)),Object.prototype.toString.call(t)!=="[object Date]"||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");e=ep[e]||e;var r=[];e=e.replace(BT,function(a,o){return r.push(o),"@@@"});var i=Is(Is({},tp),n);return e=e.replace(FT,function(a){return gQ[a](t,i)}),e.replace(/@@@/g,function(){return r.shift()})};function bQ(t,e,n){if(n===void 0&&(n={}),typeof e!="string")throw new Error("Invalid format in fecha parse");if(e=ep[e]||e,t.length>1e3)return null;var r=new Date,i={year:r.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},a=[],o=[],s=e.replace(BT,function(_,x){return o.push($T(x)),"@@@"}),c={},l={};s=$T(s).replace(FT,function(_){var x=yQ[_],O=x[0],w=x[1],S=x[3];if(c[O])throw new Error("Invalid format. "+O+" specified twice in format");return c[O]=!0,S&&(l[S]=!0),a.push(x),"("+w+")"}),Object.keys(l).forEach(function(_){if(!c[_])throw new Error("Invalid format. "+_+" is required in specified format")}),s=s.replace(/@@@/g,function(){return o.shift()});var u=t.match(new RegExp(s,"i"));if(!u)return null;for(var f=Is(Is({},tp),n),d=1;d11||i.month<0||i.day>31||i.day<1||i.hour>23||i.hour<0||i.minute>59||i.minute<0||i.second>59||i.second<0)return null;return y}var Umt={format:KT,parse:bQ,defaultI18n:HT,setGlobalDateI18n:vQ,setGlobalDateMasks:mQ},Xmt=null;const Du=1e3,Fu=Du*60,Bu=Fu*60,Ds=Bu*24,zu=Ds*7,QT=Ds*30,JT=Ds*365;function Gr(t,e,n,r){const i=(l,u)=>{const f=h=>r(h)%u===0;let d=u;for(;d&&!f(l);)n(l,-1),d-=1;return l},a=(l,u)=>{u&&i(l,u),e(l)},o=(l,u)=>{const f=new Date(+l);return a(f,u),f},s=(l,u)=>{const f=new Date(+l-1);return a(f,u),n(f,u),a(f),f};return{ceil:s,floor:o,range:(l,u,f,d)=>{const h=[],p=Math.floor(f),v=d?s(l,f):s(l);for(let g=v;gt,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),xQ=Gr(Du,t=>{t.setMilliseconds(0)},(t,e=1)=>{t.setTime(+t+Du*e)},t=>t.getSeconds()),OQ=Gr(Fu,t=>{t.setSeconds(0,0)},(t,e=1)=>{t.setTime(+t+Fu*e)},t=>t.getMinutes()),wQ=Gr(Bu,t=>{t.setMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+Bu*e)},t=>t.getHours()),SQ=Gr(Ds,t=>{t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Ds*e)},t=>t.getDate()-1),tk=Gr(QT,t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e=1)=>{const n=t.getMonth();t.setMonth(n+e)},t=>t.getMonth()),MQ=Gr(zu,t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)},(t,e=1)=>{t.setDate(t.getDate()+7*e)},t=>{const e=tk.floor(t),n=new Date(+t);return Math.floor((+n-+e)/zu)}),EQ=Gr(JT,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()),ek={millisecond:_Q,second:xQ,minute:OQ,hour:wQ,day:SQ,week:MQ,month:tk,year:EQ},AQ=Gr(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),PQ=Gr(Du,t=>{t.setUTCMilliseconds(0)},(t,e=1)=>{t.setTime(+t+Du*e)},t=>t.getUTCSeconds()),TQ=Gr(Fu,t=>{t.setUTCSeconds(0,0)},(t,e=1)=>{t.setTime(+t+Fu*e)},t=>t.getUTCMinutes()),kQ=Gr(Bu,t=>{t.setUTCMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+Bu*e)},t=>t.getUTCHours()),CQ=Gr(Ds,t=>{t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Ds*e)},t=>t.getUTCDate()-1),nk=Gr(QT,t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e=1)=>{const n=t.getUTCMonth();t.setUTCMonth(n+e)},t=>t.getUTCMonth()),LQ=Gr(zu,t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+zu*e)},t=>{const e=nk.floor(t),n=new Date(+t);return Math.floor((+n-+e)/zu)}),NQ=Gr(JT,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()),rk={millisecond:AQ,second:PQ,minute:TQ,hour:kQ,day:CQ,week:LQ,month:nk,year:NQ};function jQ(t){const e=t?rk:ek,{year:n,month:r,week:i,day:a,hour:o,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],[o,1],[o,3],[o,6],[o,12],[a,1],[a,2],[i,1],[r,1],[r,3],[n,1]],year:n,millisecond:l}}function ik(t,e,n,r,i){const a=+t,o=+e,{tickIntervals:s,year:c,millisecond:l}=jQ(i),u=([g,y])=>g.duration*y,f=r?(o-a)/r:n||5,d=r||(o-a)/f,h=s.length,p=Ag(s,d,0,h,u);let v;if(p===h){const g=kw(a/c.duration,o/c.duration,f);v=[c,g]}else if(p){const g=d/u(s[p-1]){const a=t>e,o=a?e:t,s=a?t:e,[c,l]=ik(o,s,n,r,i),u=c.range(o,new Date(+s+1),l,!0);return a?u.reverse():u},IQ=(t,e,n,r,i)=>{const a=t>e,o=a?e:t,s=a?t:e,[c,l]=ik(o,s,n,r,i),u=[c.floor(o,l),c.ceil(s,l)];return a?u.reverse():u};function DQ(t,e){const{second:n,minute:r,hour:i,day:a,week:o,month:s,year:c}=e;return n.floor(t)+r,r=>new Date(r)]}chooseNice(){return IQ}getTickMethodOptions(){const{domain:e,tickCount:n,tickInterval:r,utc:i}=this.options,a=e[0],o=e[e.length-1];return[a,o,n,r,i]}getFormatter(){const{mask:e,utc:n}=this.options,r=n?rk:ek,i=n?FQ:Ss;return a=>KT(i(a),e||DQ(a,r))}clone(){return new am(this.options)}}const ak=t=>new am(t);ak.props={};const ok=t=>e=>-t(-e),om=(t,e)=>{const n=Math.log(t),r=t===Math.E?Math.log:t===10?Math.log10:t===2?Math.log2:i=>Math.log(i)/n;return e?ok(r):r},sm=(t,e)=>{const n=t===Math.E?Math.exp:r=>ir(t,r);return e?ok(n):n},BQ=(t,e,n,r=10)=>{const i=t<0,a=sm(r,i),o=om(r,i),s=e=1;p-=1){const v=h*p;if(v>l)break;v>=c&&d.push(v)}}else for(;u<=f;u+=1){const h=a(u);for(let p=1;pl)break;v>=c&&d.push(v)}}d.length*2{const i=t<0,a=om(r,i),o=sm(r,i),s=t>e,c=s?e:t,l=s?t:e,u=[o(Math.floor(a(c))),o(Math.ceil(a(l)))];return s?u.reverse():u};class cm extends ah{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:du,tickMethod:BQ,tickCount:5}}chooseNice(){return zQ}getTickMethodOptions(){const{domain:e,tickCount:n,base:r}=this.options,i=e[0],a=e[e.length-1];return[i,a,n,r]}chooseTransforms(){const{base:e,domain:n}=this.options,r=n[0]<0;return[om(e,r),sm(e,r)]}clone(){return new cm(this.options)}}const sk=t=>new cm(t);sk.props={};const GQ=t=>e=>e<0?-ir(-e,t):ir(e,t),WQ=t=>e=>e<0?-ir(-e,1/t):ir(e,1/t),YQ=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class np extends ah{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:du,tickMethod:Ms,tickCount:5}}constructor(e){super(e)}chooseTransforms(){const{exponent:e}=this.options;if(e===1)return[Ss,Ss];const n=e===.5?YQ:GQ(e),r=WQ(e);return[n,r]}clone(){return new np(this.options)}}const ck=t=>new np(t);ck.props={};class lm extends np{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:du,tickMethod:Ms,tickCount:5,exponent:.5}}constructor(e){super(e)}update(e){super.update(e)}clone(){return new lm(this.options)}}const lk=t=>new lm(t);lk.props={};const uk=t=>new jc(t);uk.props={};const fk=t=>new fh(t);fk.props={};const dk=t=>new uh(t);dk.props={};const HQ=t=>e=>{const n=t(e);return Cc(n)?Math.round(n):n};function $Q(t,e){return n=>{n.prototype.rescale=function(){this.initRange(),this.nice();const[r]=this.chooseTransforms();this.composeOutput(r,this.chooseClamp(r))},n.prototype.initRange=function(){const{interpolator:r}=this.options;this.options.range=t(r)},n.prototype.composeOutput=function(r,i){const{domain:a,interpolator:o,round:s}=this.getOptions(),c=e(a.map(r)),l=s?HQ(o):o;this.output=Lc(l,c,i,r)},n.prototype.invert=void 0}}var VQ=function(t,e,n,r){var i=arguments.length,a=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},um;function UQ(t){return[t(0),t(1)]}const XQ=t=>{const[e,n]=t;return Lc(Nc(0,1),nh(e,n))};let fm=um=class extends Fr{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:Ss,tickMethod:Ms,tickCount:5}}constructor(e){super(e)}clone(){return new um(this.options)}};fm=um=VQ([$Q(UQ,XQ)],fm);const hk=t=>new fm(t);hk.props={};const pk=t=>new vu(t);pk.props={};function dm({colorDefault:t,colorBlack:e,colorWhite:n,colorStroke:r,colorBackground:i,padding1:a,padding2:o,padding3:s,alpha90:c,alpha65:l,alpha45:u,alpha25:f,alpha10:d,category10:h,category20:p,sizeDefault:v=1,padding:g="auto",margin:y=16}){return{padding:g,margin:y,size:v,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,lineCap:"round"}},point:{point:{r:3,fillOpacity:.95,lineWidth:0},hollow:{r:3,strokeOpacity:.95,lineWidth:1},plus:{r:3,strokeOpacity:.95,lineWidth:3},diamond:{r:3,strokeOpacity:.95,lineWidth:1}},interval:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},area:{area:{fillOpacity:.85,lineWidth:0}},polygon:{polygon:{fillOpacity:.95}},cell:{cell:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},rect:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},link:{link:{fill:"",strokeOpacity:1}},vector:{vector:{fillOpacity:1}},box:{box:{fillOpacity:.95,stroke:e,lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:12,lineWidth:0,connectorStroke:r,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:r,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,lineWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:r,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:r,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:r,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:r,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:r,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:r,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:r,endMarkerFillOpacity:.95}},axis:{arrow:!1,gridLineDash:[3,4],gridLineWidth:.5,gridStroke:e,gridStrokeOpacity:d,labelAlign:"horizontal",labelFill:e,labelOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing:a,line:!1,lineLineWidth:.5,lineStroke:e,lineStrokeOpacity:u,tickLength:4,tickLineWidth:1,tickStroke:e,tickOpacity:u,titleFill:e,titleOpacity:c,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,titleTransformOrigin:"center",lineArrowOffset:6,lineArrowSize:6},axisTop:{gridDirection:"positive",labelDirection:"negative",tickDirection:"negative",titlePosition:"top",titleSpacing:12,labelSpacing:4,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",tickDirection:"positive",titlePosition:"bottom",titleSpacing:12,labelSpacing:4,titleTextBaseline:"bottom",titleTransform:"translate(0, 8)"},axisLeft:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"left",titleSpacing:12,titleTextBaseline:"middle",titleDirection:"vertical",titleTransform:"rotate(-90) translate(0, -8)",titleTransformOrigin:"center"},axisRight:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"right",titleSpacing:12,titleTextBaseline:"top",titleDirection:"vertical",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleSpacing:0},axisArc:{title:!1,titlePosition:"inner",line:!1,tick:!0,labelSpacing:4},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:e,itemLabelFillOpacity:c,itemLabelFontSize:12,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[a,a],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:a,colPadding:o,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"}}}const qQ=dm({colorBlack:"#1D2129",colorWhite:"#ffffff",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"transparent",category10:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F"],category20:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F","#AABA01","#BC7CFC","#237CBC","#2DE379","#CE8032","#FF7AF4","#545FD3","#AFE410","#D8C608","#FFA1E0"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.1}),hm=t=>at({},qQ,t);hm.props={};const vk=t=>at({},hm(),{category10:"category10",category20:"category20"},t);vk.props={};const ZQ=dm({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}),gk=t=>at({},ZQ,{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),yk=t=>Object.assign({},gk(),{category10:"category10",category20:"category20"},t);yk.props={};const KQ=dm({colorBlack:"#000",colorWhite:"#fff",colorStroke:"#888",colorDefault:"#4e79a7",colorBackground:"transparent",category10:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],category20:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.1}),mk=t=>at({},KQ,{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:(e,n)=>n!==0},axisRight:{gridFilter:(e,n)=>n!==0},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);mk.props={};const bk=t=>(...e)=>{const n=Oo(Object.assign({},{crossPadding:50},t))(...e);return zw(n,t),n};bk.props=Object.assign(Object.assign({},Oo.props),{defaultPosition:"bottom"});function Qmt(){}const _k=t=>(...e)=>{const n=Oo(Object.assign({},{crossPadding:10},t))(...e);return zw(n,t),n};_k.props=Object.assign(Object.assign({},Oo.props),{defaultPosition:"left"});var pm=function(){},QQ=function(t,e,n){var r=t,i=kn(e)?e.split("."):e;return i.forEach(function(a,o){o1?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageShape",{get:function(){var n=this.pageViews,r=D(tJ(n.map(function(f){var d=f.getBBox(),h=d.width,p=d.height;return[h,p]})).map(function(f){return Math.max.apply(Math,dt([],D(f),!1))}),2),i=r[0],a=r[1],o=this.attributes,s=o.pageWidth,c=s===void 0?i:s,l=o.pageHeight,u=l===void 0?a:l;return{pageWidth:c,pageHeight:u}},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 n=t.prototype.getBBox.call(this),r=n.x,i=n.y,a=this.controllerShape,o=this.pageShape,s=o.pageWidth,c=o.pageHeight;return new Mn(r,i,s+a.width,c)},e.prototype.goTo=function(n){var r=this,i=this.attributes.animate,a=this,o=a.currPage,s=a.playState,c=a.playWindow,l=a.pageViews;if(s!=="idle"||n<0||l.length<=0||n>=l.length)return null;l[o].setLocalPosition(0,0),this.prepareFollowingPage(n);var u=D(this.getFollowingPageDiff(n),2),f=u[0],d=u[1];this.playState="running";var h=jO(c,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-f,", ").concat(-d,")")}],i);return Pc(h,function(){r.innerCurrPage=n,r.playState="idle",r.setVisiblePages([n]),r.updatePageInfo()}),h},e.prototype.prev=function(){var n=this.attributes.loop,r=this.pageViews.length,i=this.currPage;if(!n&&i<=0)return null;var a=n?(i-1+r)%r:Fn(i-1,0,r);return this.goTo(a)},e.prototype.next=function(){var n=this.attributes.loop,r=this.pageViews.length,i=this.currPage;if(!n&&i>=r-1)return null;var a=n?(i+1)%r:Fn(i+1,0,r);return this.goTo(a)},e.prototype.renderClipPath=function(n){var r=this.pageShape,i=r.pageWidth,a=r.pageHeight;if(!i||!a){this.contentGroup.style.clipPath=void 0;return}this.clipPath=n.maybeAppendByClassName(Yi.clipPath,"rect").styles({width:i,height:a}),this.contentGroup.attr("clipPath",this.clipPath.node())},e.prototype.setVisiblePages=function(n){this.playWindow.children.forEach(function(r,i){n.includes(i)?iu(r):xo(r)})},e.prototype.adjustControllerLayout=function(){var n=this,r=n.prevBtnGroup,i=n.nextBtnGroup,a=n.pageInfoGroup,o=this.attributes,s=o.orientation,c=o.controllerPadding,l=a.getBBox(),u=l.width,f=l.height,d=D(s==="horizontal"?[-180,0]:[-90,90],2),h=d[0],p=d[1];r.setLocalEulerAngles(h),i.setLocalEulerAngles(p);var v=r.getBBox(),g=v.width,y=v.height,m=i.getBBox(),b=m.width,_=m.height,x=Math.max(g,u,b),O=s==="horizontal"?{offset:[[0,0],[g/2+c,0],[g+u+c*2,0]],textAlign:"start"}:{offset:[[x/2,-y-c],[x/2,0],[x/2,_+c]],textAlign:"center"},w=D(O.offset,3),S=D(w[0],2),M=S[0],E=S[1],A=D(w[1],2),C=A[0],P=A[1],T=D(w[2],2),k=T[0],N=T[1],F=O.textAlign,R=a.querySelector("text");R&&(R.style.textAlign=F),r.setLocalPosition(M,E),a.setLocalPosition(C,P),i.setLocalPosition(k,N)},e.prototype.updatePageInfo=function(){var n,r=this,i=r.currPage,a=r.pageViews,o=r.attributes.formatter;a.length<2||((n=this.pageInfoGroup.querySelector(Yi.pageInfo.class))===null||n===void 0||n.attr("text",o(i+1,a.length)),this.adjustControllerLayout())},e.prototype.getFollowingPageDiff=function(n){var r=this.currPage;if(r===n)return[0,0];var i=this.attributes.orientation,a=this.pageShape,o=a.pageWidth,s=a.pageHeight,c=n=2,l=n.maybeAppendByClassName(Yi.controller,"g");if($d(l.node(),c),!!c){var u=Oe(this.attributes,"button"),f=Oe(this.attributes,"pageNum"),d=D(Ya(u),2),h=d[0],p=d[1],v=h.size,g=On(h,["size"]),y=!l.select(Yi.prevBtnGroup.class).node(),m=l.maybeAppendByClassName(Yi.prevBtnGroup,"g").styles(p);this.prevBtnGroup=m.node();var b=m.maybeAppendByClassName(Yi.prevBtn,"path"),_=l.maybeAppendByClassName(Yi.nextBtnGroup,"g").styles(p);this.nextBtnGroup=_.node();var x=_.maybeAppendByClassName(Yi.nextBtn,"path");[b,x].forEach(function(w){w.styles(Q(Q({},g),{transformOrigin:"center"})),yg(w.node(),v,!0)});var O=l.maybeAppendByClassName(Yi.pageInfoGroup,"g");this.pageInfoGroup=O.node(),O.maybeAppendByClassName(Yi.pageInfo,"text").styles(f),this.updatePageInfo(),l.node().setLocalPosition(o+i,s/2),y&&(this.prevBtnGroup.addEventListener("click",function(){r.prev()}),this.nextBtnGroup.addEventListener("click",function(){r.next()}))}},e.prototype.render=function(n,r){var i=n.x,a=i===void 0?0:i,o=n.y,s=o===void 0?0:o;this.attr("transform","translate(".concat(a,", ").concat(s,")"));var c=de(r);this.renderClipPath(c),this.renderController(c),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},e.prototype.bindEvents=function(){var n=this,r=rO(function(){return n.render(n.attributes,n)},50);this.playWindow.addEventListener(re.INSERTED,r),this.playWindow.addEventListener(re.REMOVED,r)},e}(yr),wi=Fi({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");function nJ(t){var e=t.querySelector(wi.marker.class);return e?e.style:{}}var rJ=function(t){It(e,t);function e(n){return t.call(this,n,{span:[1,1],marker:function(){return new gs({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}return Object.defineProperty(e.prototype,"showValue",{get:function(){var n=this.attributes.valueText;return n?typeof n=="string"||typeof n=="number"?n!=="":typeof n=="function"?!0:n.attr("text")!=="":!1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"actualSpace",{get:function(){var n=this.labelGroup,r=this.valueGroup,i=this.attributes.markerSize,a=n.node().getBBox(),o=a.width,s=a.height,c=r.node().getBBox(),l=c.width,u=c.height;return{markerWidth:i,labelWidth:o,valueWidth:l,height:Math.max(i,s,u)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"span",{get:function(){var n=this.attributes.span;if(!n)return[1,1];var r=D(Ar(n),2),i=r[0],a=r[1],o=this.showValue?a:0,s=i+o;return[i/s,o/s]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var n,r=this.attributes,i=r.markerSize,a=r.width,o=this.actualSpace,s=o.markerWidth,c=o.height,l=this.actualSpace,u=l.labelWidth,f=l.valueWidth,d=D(this.spacing,2),h=d[0],p=d[1];if(a){var v=a-i-h-p,g=D(this.span,2),y=g[0],m=g[1];n=D([y*v,m*v],2),u=n[0],f=n[1]}var b=s+u+f+h+p;return{width:b,height:c,markerWidth:s,labelWidth:u,valueWidth:f}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){var n=this.attributes.spacing;if(!n)return[0,0];var r=D(Ar(n),2),i=r[0],a=r[1];return this.showValue?[i,a]:[i,0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layout",{get:function(){var n=this.shape,r=n.markerWidth,i=n.labelWidth,a=n.valueWidth,o=n.width,s=n.height,c=D(this.spacing,2),l=c[0],u=c[1];return{height:s,width:o,markerWidth:r,labelWidth:i,valueWidth:a,position:[r/2,r+l,r+i+l+u]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleSize",{get:function(){var n=nJ(this.markerGroup.node()),r=this.attributes,i=r.markerSize,a=r.markerStrokeWidth,o=a===void 0?n.strokeWidth:a,s=r.markerLineWidth,c=s===void 0?n.lineWidth:s,l=r.markerStroke,u=l===void 0?n.stroke:l,f=+(o||c||(u?1:0))*Math.sqrt(2),d=this.markerGroup.node().getBBox(),h=d.width,p=d.height;return(1-f/Math.max(h,p))*i},enumerable:!1,configurable:!0}),e.prototype.renderMarker=function(n){var r=this,i=this.attributes.marker,a=Oe(this.attributes,"marker");this.markerGroup=n.maybeAppendByClassName(wi.markerGroup,"g").style("zIndex",0),hi(!!i,this.markerGroup,function(){var o,s=r.markerGroup.node(),c=(o=s.childNodes)===null||o===void 0?void 0:o[0],l=typeof i=="string"?new He({style:{symbol:i},className:wi.marker.name}):i();c?l.nodeName===c.nodeName?c instanceof He?c.update(Q(Q({},a),{symbol:i})):(MW(c,l),de(c).styles(a)):(c.remove(),de(l).attr("className",wi.marker.name).styles(a),s.appendChild(l)):(l instanceof He||de(l).attr("className",wi.marker.name).styles(a),s.appendChild(l)),r.markerGroup.node().scale(1/r.markerGroup.node().getScale()[0]);var u=yg(r.markerGroup.node(),r.scaleSize,!0);r.markerGroup.node().style._transform="scale(".concat(u,")")})},e.prototype.renderLabel=function(n){var r=Oe(this.attributes,"label"),i=r.text,a=On(r,["text"]);this.labelGroup=n.maybeAppendByClassName(wi.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(wi.label,function(){return ws(i)}).styles(a)},e.prototype.renderValue=function(n){var r=this,i=Oe(this.attributes,"value"),a=i.text,o=On(i,["text"]);this.valueGroup=n.maybeAppendByClassName(wi.valueGroup,"g").style("zIndex",0),hi(this.showValue,this.valueGroup,function(){r.valueGroup.maybeAppendByClassName(wi.value,function(){return ws(a)}).styles(o)})},e.prototype.renderBackground=function(n){var r=this.shape,i=r.width,a=r.height,o=Oe(this.attributes,"background");this.background=n.maybeAppendByClassName(wi.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(wi.background,"rect").styles(Q({width:i,height:a},o))},e.prototype.adjustLayout=function(){var n=this.layout,r=n.labelWidth,i=n.valueWidth,a=n.height,o=D(n.position,3),s=o[0],c=o[1],l=o[2],u=a/2;this.markerGroup.styles({transform:"translate(".concat(s,", ").concat(u,")").concat(this.markerGroup.node().style._transform)}),this.labelGroup.styles({transform:"translate(".concat(c,", ").concat(u,")")}),xg(this.labelGroup.select(wi.label.class).node(),Math.ceil(r)),this.showValue&&(this.valueGroup.styles({transform:"translate(".concat(l,", ").concat(u,")")}),xg(this.valueGroup.select(wi.value.class).node(),Math.ceil(i)))},e.prototype.render=function(n,r){var i=de(r),a=n.x,o=a===void 0?0:a,s=n.y,c=s===void 0?0:s;i.styles({transform:"translate(".concat(o,", ").concat(c,")")}),this.renderMarker(i),this.renderLabel(i),this.renderValue(i),this.renderBackground(i),this.adjustLayout()},e}(yr),Fs=Fi({page:"item-page",navigator:"navigator",item:"item"},"items"),xk=function(t,e,n){return n===void 0&&(n=!0),t?e(t):n},iJ=function(t){It(e,t);function e(n){var r=t.call(this,n,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:pm,mouseenter:pm,mouseleave:pm})||this;return r.navigatorShape=[0,0],r}return Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"grid",{get:function(){var n=this.attributes,r=n.gridRow,i=n.gridCol,a=n.data;if(!r&&!i)throw new Error("gridRow and gridCol can not be set null at the same time");return r&&i?[r,i]:r?[r,a.length]:[a.length,i]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderData",{get:function(){var n=this.attributes,r=n.data,i=n.layout,a=Oe(this.attributes,"item"),o=r.map(function(s,c){var l=s.id,u=l===void 0?c:l,f=s.label,d=s.value;return{id:"".concat(u),index:c,style:Q({layout:i,labelText:f,valueText:d},Object.fromEntries(Object.entries(a).map(function(h){var p=D(h,2),v=p[0],g=p[1];return[v,Bi(g,[s,c,r])]})))}});return o},enumerable:!1,configurable:!0}),e.prototype.getGridLayout=function(){var n=this,r=this.attributes,i=r.orientation,a=r.width,o=r.rowPadding,s=r.colPadding,c=D(this.navigatorShape,1),l=c[0],u=D(this.grid,2),f=u[0],d=u[1],h=d*f,p=0;return this.pageViews.children.map(function(v,g){var y,m,b=Math.floor(g/h),_=g%h,x=n.ifHorizontal(d,f),O=[Math.floor(_/x),_%x];i==="vertical"&&O.reverse();var w=D(O,2),S=w[0],M=w[1],E=(a-l-(d-1)*s)/d,A=v.getBBox().height,C=D([0,0],2),P=C[0],T=C[1];return i==="horizontal"?(y=D([p,S*(A+o)],2),P=y[0],T=y[1],p=M===d-1?0:p+E+s):(m=D([M*(E+s),p],2),P=m[0],T=m[1],p=S===f-1?0:p+A+o),{page:b,index:g,row:S,col:M,pageIndex:_,width:E,height:A,x:P,y:T}})},e.prototype.getFlexLayout=function(){var n=this.attributes,r=n.width,i=n.height,a=n.rowPadding,o=n.colPadding,s=D(this.navigatorShape,1),c=s[0],l=D(this.grid,2),u=l[0],f=l[1],d=D([r-c,i],2),h=d[0],p=d[1],v=D([0,0,0,0,0,0,0,0],8),g=v[0],y=v[1],m=v[2],b=v[3],_=v[4],x=v[5],O=v[6],w=v[7];return this.pageViews.children.map(function(S,M){var E,A,C,P,T=S.getBBox(),k=T.width,N=T.height,F=O===0?0:o,R=O+F+k;if(R<=h&&xk(_,function(z){return z0?(this.navigatorShape=[55,0],n.call(this)):r},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(n,r){var i=this.attributes.orientation;return xa(i,n,r)},e.prototype.flattenPage=function(n){n.querySelectorAll(Fs.item.class).forEach(function(r){n.appendChild(r)}),n.querySelectorAll(Fs.page.class).forEach(function(r){var i=n.removeChild(r);i.destroy()})},e.prototype.renderItems=function(n){var r=this.attributes,i=r.click,a=r.mouseenter,o=r.mouseleave;this.flattenPage(n);var s=this.dispatchCustomEvent.bind(this);de(n).selectAll(Fs.item.class).data(this.renderData,function(c){return c.id}).join(function(c){return c.append(function(l){var u=l.style;return new rJ({style:u})}).attr("className",Fs.item.name).on("click",function(){i==null||i(this),s("itemClick",{item:this})}).on("pointerenter",function(){a==null||a(this),s("itemMouseenter",{item:this})}).on("pointerleave",function(){o==null||o(this),s("itemMouseleave",{item:this})})},function(c){return c.each(function(l){var u=l.style;this.update(u)})},function(c){return c.remove()})},e.prototype.relayoutNavigator=function(){var n,r=this.attributes,i=r.layout,a=r.width,o=((n=this.pageViews.children[0])===null||n===void 0?void 0:n.getBBox().height)||0,s=D(this.navigatorShape,2),c=s[0],l=s[1];this.navigator.update(i==="grid"?{pageWidth:a-c,pageHeight:o-l}:{})},e.prototype.adjustLayout=function(){var n=this,r=Object.entries(JQ(this.itemsLayout,"page")).map(function(a){var o=D(a,2),s=o[0],c=o[1];return{page:s,layouts:c}}),i=dt([],D(this.navigator.getContainer().children),!1);r.forEach(function(a){var o=a.layouts,s=n.pageViews.appendChild(new dr({className:Fs.page.name}));o.forEach(function(c){var l=c.x,u=c.y,f=c.index,d=c.width,h=c.height,p=i[f];s.appendChild(p),QQ(p,"__layout__",c),p.update({x:l,y:u,width:d,height:h})})}),this.relayoutNavigator()},e.prototype.renderNavigator=function(n){var r=this.attributes.orientation,i=Oe(this.attributes,"nav"),a=Ga({orientation:r},i),o=this;return n.selectAll(Fs.navigator.class).data(["nav"]).join(function(s){return s.append(function(){return new eJ({style:a})}).attr("className",Fs.navigator.name).each(function(){o.navigator=this})},function(s){return s.each(function(){this.update(a)})},function(s){return s.remove()}),this.navigator},e.prototype.getBBox=function(){return this.navigator.getBBox()},e.prototype.render=function(n,r){var i=this.attributes.data;if(!(!i||i.length===0)){var a=this.renderNavigator(de(r));this.renderItems(a.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(n,r){var i=new sn(n,{detail:r});this.dispatchEvent(i)},e}(yr),aJ=function(t){It(e,t);function e(n){return t.call(this,n,WH)||this}return e.prototype.renderTitle=function(n,r,i){var a=this.attributes,o=a.showTitle,s=a.titleText,c=Oe(this.attributes,"title"),l=D(Ya(c),2),u=l[0],f=l[1];this.titleGroup=n.maybeAppendByClassName(Pr.titleGroup,"g").styles(f);var d=Q(Q({width:r,height:i},u),{text:o?s:""});this.title=this.titleGroup.maybeAppendByClassName(Pr.title,function(){return new pw({style:d})}).update(d)},e.prototype.renderItems=function(n,r){var i=r.x,a=r.y,o=r.width,s=r.height,c=Oe(this.attributes,"title",!0),l=D(Ya(c),2),u=l[0],f=l[1],d=Q(Q({},u),{width:o,height:s,x:0,y:0});this.itemsGroup=n.maybeAppendByClassName(Pr.itemsGroup,"g").styles(Q(Q({},f),{transform:"translate(".concat(i,", ").concat(a,")")}));var h=this;this.itemsGroup.selectAll(Pr.items.class).data(["items"]).join(function(p){return p.append(function(){return new iJ({style:d})}).attr("className",Pr.items.name).each(function(){h.items=de(this)})},function(p){return p.update(d)},function(p){return p.remove()})},e.prototype.adjustLayout=function(){var n=this.attributes.showTitle;if(n){var r=this.title.node().getAvailableSpace(),i=r.x,a=r.y;this.itemsGroup.node().style.transform="translate(".concat(i,", ").concat(a,")")}},Object.defineProperty(e.prototype,"availableSpace",{get:function(){var n=this.attributes,r=n.showTitle,i=n.width,a=n.height;return r?this.title.node().getAvailableSpace():new Mn(0,0,i,a)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var n,r,i=(n=this.title)===null||n===void 0?void 0:n.node(),a=(r=this.items)===null||r===void 0?void 0:r.node();return!i||!a?t.prototype.getBBox.call(this):VW(i,a)},e.prototype.render=function(n,r){var i=this.attributes,a=i.width,o=i.height,s=i.x,c=s===void 0?0:s,l=i.y,u=l===void 0?0:l,f=de(r);r.style.transform="translate(".concat(c,", ").concat(u,")"),this.renderTitle(f,a,o),this.renderItems(f,this.availableSpace),this.adjustLayout()},e}(yr);function Gu(t){if(tu(t)){var e=t;return e[e.length-1]}}var oJ=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i0?r==null?void 0:r.getOptions().domain:c.data).map((d,h)=>{var p;return i?i.map(d||"point"):((p=s==null?void 0:s.style)===null||p===void 0?void 0:p.shape)||c.defaultShape||"point"});typeof l=="string"&&a.push([l,f])}if(a.length===0)return["point",["point"]];if(a.length===1||!n)return a[0];const{range:o}=n.getOptions();return a.map(([s,c])=>{let l=0;for(let u=0;uc[0]-s[0])[0][1]}function cJ(t,e){const{scales:n,library:r,markState:i}=e,[a,o]=sJ(n,i),{itemMarker:s,itemMarkerSize:c}=t,l=(d,h)=>{var p,v,g;const y=((g=(v=(p=r[`mark.${a}`])===null||p===void 0?void 0:p.props)===null||v===void 0?void 0:v.shape[d])===null||g===void 0?void 0:g.props.defaultMarker)||Gu(d.split(".")),m=typeof c=="function"?c(h):c;return()=>gK(y,{color:h.color})(0,0,m)},u=d=>`${o[d]}`;return ba(n,"shape")&&!s?(d,h)=>l(u(h),d):typeof s=="function"?(d,h)=>{const p=s(d.id,h);return typeof p=="string"?l(p,d):p}:(d,h)=>l(s||u(h),d)}function lJ(t){const e=ba(t,"opacity");if(e){const{range:n}=e.getOptions();return(r,i)=>n[i]}}function uJ(t,e){const n=ba(t,"size");return n instanceof Jh?n.map(NaN)*2:e}function fJ(t,e){const{labelFormatter:n=d=>`${d}`}=t,{scales:r,theme:i}=e,a=i.legendCategory.itemMarkerSize,o=uJ(r,a),s={itemMarker:cJ(Object.assign(Object.assign({},t),{itemMarkerSize:o}),e),itemMarkerSize:o,itemMarkerOpacity:lJ(r)},c=typeof n=="string"?bo(n):n,l=ba(r,"color"),u=ZY(r),f=l?d=>l.map(d):()=>e.theme.color;return Object.assign(Object.assign({},s),{data:u.map(d=>({id:d,label:c(d),color:f(d)}))})}function dJ(t,e,n){const{position:r}=e;if(r==="center"){const{bbox:o}=t,{width:s,height:c}=o;return{width:s,height:c}}const{width:i,height:a}=Fw(t,e,n);return{width:i,height:a}}const vm=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:a,size:o,title:s,cols:c,itemMarker:l}=t,u=oJ(t,["labelFormatter","layout","order","orientation","position","size","title","cols","itemMarker"]),{gridRow:f}=u;return d=>{const{value:h,theme:p}=d,{bbox:v}=h,{width:g,height:y}=dJ(h,t,vm),m=Iw(a,n),b=Object.assign(Object.assign(Object.assign(Object.assign({orientation:["right","left","center"].includes(a)?"vertical":"horizontal",width:g,height:y,layout:c!==void 0?"grid":"flex"},c!==void 0&&{gridCol:c}),f!==void 0&&{gridRow:f}),{titleText:oh(s)}),fJ(t,d)),{legendCategory:_={}}=p,x=sh(Object.assign({},_,b,u)),O=new UY({style:Object.assign(Object.assign({x:v.x,y:v.y,width:v.width,height:v.height},m),{subOptions:x})});return O.appendChild(new aJ({className:"legend-category",style:x})),O}};vm.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const Ok=t=>()=>new dr;Ok.props={};var hJ=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{if(!i)return p.node().remove();p.node().attr(Object.assign(Object.assign(Object.assign({},wk(0,h.max[1]+a,n,o)),{fontSize:12,textBaseline:"top",text:i}),f))})}}),Sk=t=>({value:e,theme:n})=>{const{x:r,y:i,width:a,height:o}=e.bbox;return new pJ({style:at({},n.title,Object.assign({x:r,y:i,width:a,height:o},t))})};Sk.props={defaultPosition:"top",defaultOrder:2,defaultSize:36,defaultCrossPadding:[20,20],defaultPadding:[12,12]};var gm=function(t){if(typeof t!="object"||t===null)return t;var e;if(sr(t)){e=[];for(var n=0,r=t.length;no&&(n=D([o,s],2),s=n[0],o=n[1]),t.map(function(c){var l=c.map(function(u,f){return[r.map(f),Fn(i.map(u),s,o)]});return l})}function Wu(t,e){e===void 0&&(e=!1);var n=e?t.length-1:0,r=t.map(function(i,a){return dt([a===n?"M":"L"],D(i),!1)});return e?r.reverse():r}function rp(t,e){if(e===void 0&&(e=!1),t.length<=2)return Wu(t);for(var n=[],r=t.length,i=0;i=0;i-=1){var a=t[i],o=Wu(a),s=void 0;if(i===0)s=mm(o,e,n);else{var c=t[i-1],l=Wu(c,!0);l[0][0]="L",s=dt(dt(dt([],D(o),!1),D(l),!1),[["Z"]],!1)}r.push(s)}return r}function OJ(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var a=t[i],o=rp(a),s=void 0;if(i===0)s=mm(o,e,n);else{var c=t[i-1],l=rp(c,!0),u=a[0];l[0][0]="L",s=dt(dt(dt([],D(o),!1),D(l),!1),[dt(["M"],D(u),!1),["Z"]],!1)}r.push(s)}return r}var wJ=function(t,e){if(sr(t)){for(var n,r=1/0,i=0;ir&&(n=a,r=o)}return n}};function Mk(t){return t.length===0?[0,0]:[Jf(wJ(t,function(e){return Jf(e)||0})),td(SJ(t,function(e){return td(e)||0}))]}function Ek(t){for(var e=ym(t),n=e[0].length,r=D([Array(n).fill(0),Array(n).fill(0)],2),i=r[0],a=r[1],o=0;o=0?(s[c]+=i[c],i[c]=s[c]):(s[c]+=a[c],a[c]=s[c]);return e}var MJ=function(t){It(e,t);function e(n){return t.call(this,n,{type:"line",x:0,y:0,width:200,height:20,isStack:!1,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff",scale:1,spacing:0})||this}return Object.defineProperty(e.prototype,"rawData",{get:function(){var n=this.attributes.data;if(!n||(n==null?void 0:n.length)===0)return[[]];var r=ym(n);return $n(r[0])?[r]:r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?Ek(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 n=this.scales.y,r=D(n.getOptions().domain||[0,0],2),i=r[0],a=r[1];return a<0?n.map(a):n.map(i<0?0:i)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"containerShape",{get:function(){var n=this.attributes,r=n.width,i=n.height;return{width:r,height:i}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linesStyle",{get:function(){var n=this,r=this.attributes,i=r.type,a=r.isStack,o=r.smooth;if(i!=="line")throw new Error("linesStyle can only be used in line type");var s=Oe(this.attributes,"area"),c=Oe(this.attributes,"line"),l=this.containerShape.width,u=this.data;if(u[0].length===0)return{lines:[],areas:[]};var f=this.scales,d=f.x,h=f.y,p=bJ(u,{type:"line",x:d,y:h}),v=[];if(s){var g=this.baseline;a?v=o?OJ(p,l,g):xJ(p,l,g):v=_J(p,o,l,g)}return{lines:p.map(function(y,m){return Q({stroke:n.getColor(m),d:o?rp(y):Wu(y)},c)}),areas:v.map(function(y,m){return Q({d:y,fill:n.getColor(m)},s)})}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columnsStyle",{get:function(){var n=this,r=Oe(this.attributes,"column"),i=this.attributes,a=i.isStack,o=i.type,s=i.scale;if(o!=="column")throw new Error("columnsStyle can only be used in column type");var c=this.containerShape.height,l=this.rawData;if(!l)return{columns:[]};a&&(l=Ek(l));var u=this.createScales(l),f=u.x,d=u.y,h=D(Mk(l),2),p=h[0],v=h[1],g=new Fr({domain:[0,v-(p>0?0:p)],range:[0,c*s]}),y=f.getBandWidth(),m=this.rawData;return{columns:l.map(function(b,_){return b.map(function(x,O){var w=y/l.length,S=function(){return{x:f.map(O)+w*_,y:x>=0?d.map(x):d.map(0),width:w,height:g.map(Math.abs(x))}},M=function(){return{x:f.map(O),y:d.map(x),width:y,height:g.map(m[_][O])}};return Q(Q({fill:n.getColor(_)},r),a?M():S())})})}},enumerable:!1,configurable:!0}),e.prototype.render=function(n,r){IG(r,".container","rect").attr("className","container").node();var i=n.type,a=n.x,o=n.y,s="spark".concat(i),c=Q({x:a,y:o},i==="line"?this.linesStyle:this.columnsStyle);de(r).selectAll(".spark").data([i]).join(function(l){return l.append(function(u){return u==="line"?new gJ({className:s,style:c}):new vJ({className:s,style:c})}).attr("className","spark ".concat(s))},function(l){return l.update(c)},function(l){return l.remove()})},e.prototype.getColor=function(n){var r=this.attributes.color;return sr(r)?r[n%r.length]:Kr(r)?r.call(null,n):r},e.prototype.createScales=function(n){var r,i,a=this.attributes,o=a.type,s=a.scale,c=a.range,l=c===void 0?[]:c,u=a.spacing,f=this.containerShape,d=f.width,h=f.height,p=D(Mk(n),2),v=p[0],g=p[1],y=new Fr({domain:[(r=l[0])!==null&&r!==void 0?r:v,(i=l[1])!==null&&i!==void 0?i:g],range:[h,h*(1-s)]});return o==="line"?{type:o,x:new Fr({domain:[0,n[0].length-1],range:[0,d]}),y}:{type:o,x:new No({domain:n[0].map(function(m,b){return b}),range:[0,d],paddingInner:u,paddingOuter:u/2,align:.5}),y}},e.tag="sparkline",e}(yr),Ak=function(t){It(e,t);function e(n){var r=t.call(this,n,Q(Q(Q({x:0,y:0,animate:{duration:100,fill:"both"},brushable:!0,formatter:function(i){return i.toString()},handleSpacing:2,orientation:"horizontal",padding:0,autoFitLabel:!0,scrollable:!0,selectionFill:"#5B8FF9",selectionFillOpacity:.45,selectionZIndex:2,showHandle:!0,showLabel:!0,slidable:!0,trackFill:"#416180",trackLength:200,trackOpacity:.05,trackSize:20,trackZIndex:-1,values:[0,1],type:"range",selectionType:"select",handleIconOffset:0},ma(Xw,"handle")),ma(Vw,"handleIcon")),ma(Uw,"handleLabel")))||this;return r.range=[0,1],r.onDragStart=function(i){return function(a){a.stopPropagation(),r.target=i,r.prevPos=r.getOrientVal(lh(a));var o=r.availableSpace,s=o.x,c=o.y,l=r.getBBox(),u=l.x,f=l.y;r.selectionStartPos=r.getRatio(r.prevPos-r.getOrientVal([s,c])-r.getOrientVal([+u,+f])),r.selectionWidth=0,document.addEventListener("pointermove",r.onDragging),document.addEventListener("pointerup",r.onDragEnd)}},r.onDragging=function(i){var a=r.attributes,o=a.slidable,s=a.brushable,c=a.type;i.stopPropagation();var l=r.getOrientVal(lh(i)),u=l-r.prevPos;if(u){var f=r.getRatio(u);switch(r.target){case"start":o&&r.setValuesOffset(f);break;case"end":o&&r.setValuesOffset(0,f);break;case"selection":o&&r.setValuesOffset(f,f);break;case"track":if(!s)return;r.selectionWidth+=f,c==="range"?r.innerSetValues([r.selectionStartPos,r.selectionStartPos+r.selectionWidth].sort(),!0):r.innerSetValues([0,r.selectionStartPos+r.selectionWidth],!0);break;default:break}r.prevPos=l}},r.onDragEnd=function(){document.removeEventListener("pointermove",r.onDragging),document.removeEventListener("pointermove",r.onDragging),document.removeEventListener("pointerup",r.onDragEnd),r.target="",r.updateHandlesPosition(!1)},r.onValueChange=function(i){var a=r.attributes,o=a.onChange,s=a.type,c=s==="range"?i:i[1],l=s==="range"?r.getValues():r.getValues()[1],u=new sn("valuechange",{detail:{oldValue:c,value:l}});r.dispatchEvent(u),o==null||o(l)},r.selectionStartPos=0,r.selectionWidth=0,r.prevPos=0,r.target="",r}return Object.defineProperty(e.prototype,"values",{get:function(){return this.attributes.values},set:function(n){this.attributes.values=this.clampValues(n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sparklineStyle",{get:function(){var n=this.attributes.orientation;if(n!=="horizontal")return null;var r=Oe(this.attributes,"sparkline");return Q(Q({zIndex:0},this.availableSpace),r)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var n=this.attributes,r=n.trackLength,i=n.trackSize,a=D(this.getOrientVal([[r,i],[i,r]]),2),o=a[0],s=a[1];return{width:o,height:s}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var n=this.attributes,r=n.x,i=n.y,a=n.padding,o=D(Ar(a),4),s=o[0],c=o[1],l=o[2],u=o[3],f=this.shape,d=f.width,h=f.height;return{x:u,y:s,width:d-(u+c),height:h-(s+l)}},enumerable:!1,configurable:!0}),e.prototype.getValues=function(){return this.values},e.prototype.setValues=function(n,r){n===void 0&&(n=[0,0]),r===void 0&&(r=!1),this.attributes.values=n;var i=r===!1?!1:this.attributes.animate;this.updateSelectionArea(i),this.updateHandlesPosition(i)},e.prototype.updateSelectionArea=function(n){var r=this.calcSelectionArea();this.foregroundGroup.selectAll(_a.selection.class).each(function(i,a){ta(this,r[a],n)})},e.prototype.updateHandlesPosition=function(n){this.attributes.showHandle&&(this.startHandle&&ta(this.startHandle,this.getHandleStyle("start"),n),this.endHandle&&ta(this.endHandle,this.getHandleStyle("end"),n))},e.prototype.innerSetValues=function(n,r){n===void 0&&(n=[0,0]),r===void 0&&(r=!1);var i=this.values,a=this.clampValues(n);this.attributes.values=a,this.setValues(a),r&&this.onValueChange(i)},e.prototype.renderTrack=function(n){var r=this.attributes,i=r.x,a=r.y,o=Oe(this.attributes,"track");this.trackShape=de(n).maybeAppendByClassName(_a.track,"rect").styles(Q(Q({x:i,y:a},this.shape),o))},e.prototype.renderBrushArea=function(n){var r=this.attributes,i=r.x,a=r.y,o=r.brushable;this.brushArea=de(n).maybeAppendByClassName(_a.brushArea,"rect").styles(Q({x:i,y:a,fill:"transparent",cursor:o?"crosshair":"default"},this.shape))},e.prototype.renderSparkline=function(n){var r=this,i=this.attributes,a=i.x,o=i.y,s=i.orientation,c=de(n).maybeAppendByClassName(_a.sparklineGroup,"g");hi(s==="horizontal",c,function(l){var u=Q(Q({},r.sparklineStyle),{x:a,y:o});l.maybeAppendByClassName(_a.sparkline,function(){return new MJ({style:u})}).update(u)})},e.prototype.renderHandles=function(){var n=this,r,i=this.attributes,a=i.showHandle,o=i.type,s=o==="range"?["start","end"]:["end"],c=a?s:[],l=this;(r=this.foregroundGroup)===null||r===void 0||r.selectAll(_a.handle.class).data(c.map(function(u){return{type:u}}),function(u){return u.type}).join(function(u){return u.append(function(f){var d=f.type;return new qw({style:n.getHandleStyle(d)})}).each(function(f){var d=f.type;this.attr("class","".concat(_a.handle.name," ").concat(d,"-handle"));var h="".concat(d,"Handle");l[h]=this,this.addEventListener("pointerdown",l.onDragStart(d))})},function(u){return u.each(function(f){var d=f.type;this.update(l.getHandleStyle(d))})},function(u){return u.each(function(f){var d=f.type,h="".concat(d,"Handle");l[h]=void 0}).remove()})},e.prototype.renderSelection=function(n){var r=this.attributes,i=r.x,a=r.y,o=r.type,s=r.selectionType;this.foregroundGroup=de(n).maybeAppendByClassName(_a.foreground,"g");var c=Oe(this.attributes,"selection"),l=function(f){return f.style("visibility",function(d){return d.show?"visible":"hidden"}).style("cursor",function(d){return s==="select"?"grab":s==="invert"?"crosshair":"default"}).styles(Q(Q({},c),{transform:"translate(".concat(i,", ").concat(a,")")}))},u=this;this.foregroundGroup.selectAll(_a.selection.class).data(o==="value"?[]:this.calcSelectionArea().map(function(f,d){return{style:Q({},f),index:d,show:s==="select"?d===1:d!==1}}),function(f){return f.index}).join(function(f){return f.append("rect").attr("className",_a.selection.name).call(l).each(function(d,h){var p=this;h===1?(u.selectionShape=de(this),this.on("pointerdown",function(v){p.attr("cursor","grabbing"),u.onDragStart("selection")(v)}),u.dispatchCustomEvent(this,"pointerenter","selectionMouseenter"),u.dispatchCustomEvent(this,"pointerleave","selectionMouseleave"),u.dispatchCustomEvent(this,"click","selectionClick"),this.addEventListener("pointerdown",function(){p.attr("cursor","grabbing")}),this.addEventListener("pointerup",function(){p.attr("cursor","pointer")}),this.addEventListener("pointerover",function(){p.attr("cursor","pointer")})):this.on("pointerdown",u.onDragStart("track"))})},function(f){return f.call(l)},function(f){return f.remove()}),this.updateSelectionArea(!1),this.renderHandles()},e.prototype.render=function(n,r){this.renderTrack(r),this.renderSparkline(r),this.renderBrushArea(r),this.renderSelection(r)},e.prototype.clampValues=function(n,r){var i;r===void 0&&(r=4);var a=D(this.range,2),o=a[0],s=a[1],c=D(this.getValues().map(function(g){return ch(g,r)}),2),l=c[0],u=c[1],f=Array.isArray(n)?n:[l,n!=null?n:u],d=D((f||[l,u]).map(function(g){return ch(g,r)}),2),h=d[0],p=d[1];if(this.attributes.type==="value")return[0,Fn(p,o,s)];h>p&&(i=D([p,h],2),h=i[0],p=i[1]);var v=p-h;return v>s-o?[o,s]:hs?u===s&&l===h?[h,s]:[s-v,s]:[h,p]},e.prototype.calcSelectionArea=function(n){var r=D(this.clampValues(n),2),i=r[0],a=r[1],o=this.availableSpace,s=o.x,c=o.y,l=o.width,u=o.height;return this.getOrientVal([[{y:c,height:u,x:s,width:i*l},{y:c,height:u,x:i*l+s,width:(a-i)*l},{y:c,height:u,x:a*l,width:(1-a)*l}],[{x:s,width:l,y:c,height:i*u},{x:s,width:l,y:i*u+c,height:(a-i)*u},{x:s,width:l,y:a*u,height:(1-a)*u}]])},e.prototype.calcHandlePosition=function(n){var r=this.attributes.handleIconOffset,i=this.availableSpace,a=i.x,o=i.y,s=i.width,c=i.height,l=D(this.clampValues(),2),u=l[0],f=l[1],d=n==="start"?-r:r,h=(n==="start"?u:f)*this.getOrientVal([s,c])+d;return{x:a+this.getOrientVal([h,s/2]),y:o+this.getOrientVal([c/2,h])}},e.prototype.inferTextStyle=function(n){var r=this.attributes.orientation;return r==="horizontal"?{}:n==="start"?{transformOrigin:"left center",transform:"rotate(90)",textAlign:"start"}:n==="end"?{transformOrigin:"right center",transform:"rotate(90)",textAlign:"end"}:{}},e.prototype.calcHandleText=function(n){var r,i=this.attributes,a=i.type,o=i.orientation,s=i.formatter,c=i.autoFitLabel,l=Oe(this.attributes,"handle"),u=Oe(l,"label"),f=l.spacing,d=this.getHandleSize(),h=this.clampValues(),p=n==="start"?h[0]:h[1],v=s(p),g=new fg({style:Q(Q(Q({},u),this.inferTextStyle(n)),{text:v})}),y=g.getBBox(),m=y.width,b=y.height;if(g.destroy(),!c){if(a==="value")return{text:v,x:0,y:-b-f};var _=f+d+(o==="horizontal"?m/2:0);return r={text:v},r[o==="horizontal"?"x":"y"]=n==="start"?-_:_,r}var x=0,O=0,w=this.availableSpace,S=w.width,M=w.height,E=this.calcSelectionArea()[1],A=E.x,C=E.y,P=E.width,T=E.height,k=f+d;if(o==="horizontal"){var N=k+m/2;if(n==="start"){var F=A-k-m;x=F>0?-N:N}else{var R=S-A-P-k>m;x=R?N:-N}}else{var I=k,z=b+k;n==="start"?O=C-d>b?-z:I:O=M-(C+T)-d>b?z:-I}return{x,y:O,text:v}},e.prototype.getHandleLabelStyle=function(n){var r=Oe(this.attributes,"handleLabel");return Q(Q(Q({},r),this.calcHandleText(n)),this.inferTextStyle(n))},e.prototype.getHandleIconStyle=function(){var n=this.attributes.handleIconShape,r=Oe(this.attributes,"handleIcon"),i=this.getOrientVal(["ew-resize","ns-resize"]),a=this.getHandleSize();return Q({cursor:i,shape:n,size:a},r)},e.prototype.getHandleStyle=function(n){var r=this.attributes,i=r.x,a=r.y,o=r.showLabel,s=r.showLabelOnInteraction,c=r.orientation,l=this.calcHandlePosition(n),u=l.x,f=l.y,d=this.calcHandleText(n),h=o;return!o&&s&&(this.target?h=!0:h=!1),Q(Q(Q({},ma(this.getHandleIconStyle(),"icon")),ma(Q(Q({},this.getHandleLabelStyle(n)),d),"label")),{transform:"translate(".concat(u+i,", ").concat(f+a,")"),orientation:c,showLabel:h,type:n,zIndex:3})},e.prototype.getHandleSize=function(){var n=this.attributes,r=n.handleIconSize,i=n.width,a=n.height;return r||Math.floor((this.getOrientVal([+a,+i])+4)/2.4)},e.prototype.getOrientVal=function(n){var r=D(n,2),i=r[0],a=r[1],o=this.attributes.orientation;return o==="horizontal"?i:a},e.prototype.setValuesOffset=function(n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=this.attributes.type,o=D(this.getValues(),2),s=o[0],c=o[1],l=a==="range"?n:0,u=[s+l,c+r].sort();i?this.setValues(u):this.innerSetValues(u,!0)},e.prototype.getRatio=function(n){var r=this.availableSpace,i=r.width,a=r.height;return n/this.getOrientVal([i,a])},e.prototype.dispatchCustomEvent=function(n,r,i){var a=this;n.on(r,function(o){o.stopPropagation(),a.dispatchEvent(new sn(i,{detail:o}))})},e.prototype.bindEvents=function(){this.addEventListener("wheel",this.onScroll);var n=this.brushArea;this.dispatchCustomEvent(n,"click","trackClick"),this.dispatchCustomEvent(n,"pointerenter","trackMouseenter"),this.dispatchCustomEvent(n,"pointerleave","trackMouseleave"),n.on("pointerdown",this.onDragStart("track"))},e.prototype.onScroll=function(n){var r=this.attributes.scrollable;if(r){var i=n.deltaX,a=n.deltaY,o=a||i,s=this.getRatio(o);this.setValuesOffset(s,s,!0)}},e.tag="slider",e}(yr),EJ=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const{orientation:e,labelFormatter:n,size:r,style:i={},position:a}=t,o=EJ(t,["orientation","labelFormatter","size","style","position"]);return s=>{var c;const{scales:[l],value:u,theme:f,coordinate:d}=s,{bbox:h}=u,{width:p,height:v}=h,{slider:g={}}=f,y=((c=l.getFormatter)===null||c===void 0?void 0:c.call(l))||(S=>S+""),m=typeof n=="string"?bo(n):n,b=e==="horizontal",_=Sn(d)&&b,{trackSize:x=g.trackSize}=i,[O,w]=AJ(h,a,x);return new Ak({className:"slider",style:Object.assign({},g,Object.assign(Object.assign({x:O,y:w,trackLength:b?p:v,orientation:e,formatter:S=>{const M=m||y,E=_?1-S:S,A=Gc(l,E,!0);return M(A)},sparklineData:TJ(t,s)},i),o))})}};function PJ(t,e){const[n]=Array.from(t.entries()).filter(([i])=>i.type==="line"||i.type==="area").map(([i])=>{const{encode:a,slider:o}=i;if(o!=null&&o.x&&Object.keys(o.x).length===0){const s=c=>{const l=a[c];return[c,l?l.value:void 0]};return Object.fromEntries(e.map(s))}});if(!(n!=null&&n.series))return n==null?void 0:n.y;const r=n.series.reduce((i,a,o)=>(i[a]=i[a]||[],i[a].push(n.y[o]),i),{});return Object.values(r)}function TJ(t,e){const{markState:n}=e;return sr(t.sparklineData)?t.sparklineData:PJ(n,["y","series"])}Yu.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const Pk=t=>Yu(Object.assign(Object.assign({},t),{orientation:"horizontal"}));Pk.props=Object.assign(Object.assign({},Yu.props),{defaultPosition:"bottom"});const Tk=t=>Yu(Object.assign(Object.assign({},t),{orientation:"vertical"}));Tk.props=Object.assign(Object.assign({},Yu.props),{defaultPosition:"left"});var kJ=function(t){It(e,t);function e(n){var r=t.call(this,n,{x:0,y:0,isRound:!0,orientation:"vertical",padding:[2,2,2,2],scrollable:!0,slidable:!0,thumbCursor:"default",trackSize:10,value:0})||this;return r.range=[0,1],r.onValueChange=function(i){var a=r.attributes.value;if(i!==a){var o={detail:{oldValue:i,value:a}};r.dispatchEvent(new sn("scroll",o)),r.dispatchEvent(new sn("valuechange",o))}},r.onTrackClick=function(i){var a=r.attributes.slidable;if(a){var o=D(r.getLocalPosition(),2),s=o[0],c=o[1],l=D(r.padding,4),u=l[0],f=l[3],d=r.getOrientVal([s+f,c+u]),h=r.getOrientVal(lh(i)),p=(h-d)/r.trackLength;r.setValue(p,!0)}},r.onThumbMouseenter=function(i){r.dispatchEvent(new sn("thumbMouseenter",{detail:i.detail}))},r.onTrackMouseenter=function(i){r.dispatchEvent(new sn("trackMouseenter",{detail:i.detail}))},r.onThumbMouseleave=function(i){r.dispatchEvent(new sn("thumbMouseleave",{detail:i.detail}))},r.onTrackMouseleave=function(i){r.dispatchEvent(new sn("trackMouseleave",{detail:i.detail}))},r}return Object.defineProperty(e.prototype,"padding",{get:function(){var n=this.attributes.padding;return Ar(n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){var n=this.attributes.value,r=D(this.range,2),i=r[0],a=r[1];return Fn(n,i,a)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackLength",{get:function(){var n=this.attributes,r=n.viewportLength,i=n.trackLength,a=i===void 0?r:i;return a},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var n=this.attributes.trackSize,r=this.trackLength,i=D(this.padding,4),a=i[0],o=i[1],s=i[2],c=i[3],l=D(this.getOrientVal([[r,n],[n,r]]),2),u=l[0],f=l[1];return{x:c,y:a,width:+u-(c+o),height:+f-(a+s)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackRadius",{get:function(){var n=this.attributes,r=n.isRound,i=n.trackSize;return r?i/2:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbRadius",{get:function(){var n=this.attributes,r=n.isRound,i=n.thumbRadius;if(!r)return 0;var a=this.availableSpace,o=a.width,s=a.height;return i||this.getOrientVal([s,o])/2},enumerable:!1,configurable:!0}),e.prototype.getValues=function(n){n===void 0&&(n=this.value);var r=this.attributes,i=r.viewportLength,a=r.contentLength,o=i/a,s=D(this.range,2),c=s[0],l=s[1],u=n*(l-c-o);return[u,u+o]},e.prototype.getValue=function(){return this.value},e.prototype.renderSlider=function(n){var r=this.attributes,i=r.x,a=r.y,o=r.orientation,s=r.trackSize,c=r.padding,l=r.slidable,u=Oe(this.attributes,"track"),f=Oe(this.attributes,"thumb"),d=Q(Q({x:i,y:a,brushable:!1,orientation:o,padding:c,selectionRadius:this.thumbRadius,showHandle:!1,slidable:l,trackLength:this.trackLength,trackRadius:this.trackRadius,trackSize:s,values:this.getValues()},ma(u,"track")),ma(f,"selection"));this.slider=de(n).maybeAppendByClassName("scrollbar",function(){return new Ak({style:d})}).update(d).node()},e.prototype.render=function(n,r){this.renderSlider(r)},e.prototype.setValue=function(n,r){r===void 0&&(r=!1);var i=this.attributes.value,a=D(this.range,2),o=a[0],s=a[1];this.slider.setValues(this.getValues(Fn(n,o,s)),r),this.onValueChange(i)},e.prototype.bindEvents=function(){var n=this;this.slider.addEventListener("trackClick",function(r){r.stopPropagation(),n.onTrackClick(r.detail)}),this.onHover()},e.prototype.getOrientVal=function(n){var r=this.attributes.orientation;return r==="horizontal"?n[0]:n[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}(yr),CJ=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const{orientation:e,labelFormatter:n,style:r}=t,i=CJ(t,["orientation","labelFormatter","style"]);return({scales:[a],value:o,theme:s})=>{const{bbox:c}=o,{x:l,y:u,width:f,height:d}=c,{scrollbar:h={}}=s,{ratio:p,range:v}=a.getOptions(),g=e==="horizontal"?f:d,y=g/p,[m,b]=v,_=b>m?0:1;return new kJ({className:"g2-scrollbar",style:Object.assign({},h,Object.assign(Object.assign(Object.assign(Object.assign({},r),{x:l,y:u,trackLength:g,value:_}),i),{orientation:e,contentLength:y,viewportLength:g}))})}};Hu.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const kk=t=>Hu(Object.assign(Object.assign({},t),{orientation:"horizontal"}));kk.props=Object.assign(Object.assign({},Hu.props),{defaultPosition:"bottom"});const Ck=t=>Hu(Object.assign(Object.assign({},t),{orientation:"vertical"}));Ck.props=Object.assign(Object.assign({},Hu.props),{defaultPosition:"left"});const bm=(t,e)=>{const{coordinate:r}=e;return(i,a,o)=>{const[s]=i,{transform:c="",fillOpacity:l=1,strokeOpacity:u=1,opacity:f=1}=s.style,[d,h]=Sn(r)?["left bottom",`scale(1, ${1e-4})`]:["left top",`scale(${1e-4}, 1)`],p=[{transform:`${c} ${h}`.trimStart(),transformOrigin:d,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${c} ${h}`.trimStart(),transformOrigin:d,fillOpacity:l,strokeOpacity:u,opacity:f,offset:.01},{transform:`${c} scale(1, 1)`.trimStart(),transformOrigin:d,fillOpacity:l,strokeOpacity:u,opacity:f}];return s.animate(p,Object.assign(Object.assign({},o),t))}},LJ=(t,e)=>{const{coordinate:r}=e;return(i,a,o)=>{const[s]=i,{transform:c="",fillOpacity:l=1,strokeOpacity:u=1,opacity:f=1}=s.style,[d,h]=Sn(r)?["left bottom",`scale(1, ${1e-4})`]:["left top",`scale(${1e-4}, 1)`],p=[{transform:`${c} scale(1, 1)`.trimStart(),transformOrigin:d},{transform:`${c} ${h}`.trimStart(),transformOrigin:d,fillOpacity:l,strokeOpacity:u,opacity:f,offset:.99},{transform:`${c} ${h}`.trimStart(),transformOrigin:d,fillOpacity:0,strokeOpacity:0,opacity:0}];return s.animate(p,Object.assign(Object.assign({},o),t))}},Lk=(t,e)=>{const{coordinate:r}=e;return C2.registerProperty({name:"scaleInYRadius",inherits:!1,initialValue:"",interpolable:!0,syntax:Tt.NUMBER}),(i,a,o)=>{const[s]=i,c=u=>{const{__data__:f,style:d}=u,{radius:h=0,inset:p=0,fillOpacity:v=1,strokeOpacity:g=1,opacity:y=1}=d,{points:m,y:b,y1:_}=f,x=As(r,m,[b,_]),{innerRadius:O,outerRadius:w}=x,S=bh().cornerRadius(h).padAngle(p*Math.PI/180),M=new Zr({}),E=P=>(M.attr({d:S(P)}),i2(M)),A=[{scaleInYRadius:O+1e-4,fillOpacity:0,strokeOpacity:0,opacity:0},{scaleInYRadius:O+1e-4,fillOpacity:v,strokeOpacity:g,opacity:y,offset:.01},{scaleInYRadius:w,fillOpacity:v,strokeOpacity:g,opacity:y}],C=u.animate(A,Object.assign(Object.assign({},o),t));return C.onframe=function(){u.style.d=E(Object.assign(Object.assign({},x),{outerRadius:Number(u.style.scaleInYRadius)}))},C.onfinish=function(){u.style.d=E(Object.assign(Object.assign({},x),{outerRadius:w}))},C},l=u=>{const{style:f}=u,{transform:d="",fillOpacity:h=1,strokeOpacity:p=1,opacity:v=1}=f,[g,y]=Sn(r)?["left top",`scale(${1e-4}, 1)`]:["left bottom",`scale(1, ${1e-4})`],m=[{transform:`${d} ${y}`.trimStart(),transformOrigin:g,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${d} ${y}`.trimStart(),transformOrigin:g,fillOpacity:h,strokeOpacity:p,opacity:v,offset:.01},{transform:`${d} scale(1, 1)`.trimStart(),transformOrigin:g,fillOpacity:h,strokeOpacity:p,opacity:v}];return u.animate(m,Object.assign(Object.assign({},o),t))};return fn(r)?c(s):l(s)}},NJ=(t,e)=>{const{coordinate:r}=e;return(i,a,o)=>{const[s]=i,{transform:c="",fillOpacity:l=1,strokeOpacity:u=1,opacity:f=1}=s.style,[d,h]=Sn(r)?["left top",`scale(${1e-4}, 1)`]:["left bottom",`scale(1, ${1e-4})`],p=[{transform:`${c} scale(1, 1)`.trimStart(),transformOrigin:d},{transform:`${c} ${h}`.trimStart(),transformOrigin:d,fillOpacity:l,strokeOpacity:u,opacity:f,offset:.99},{transform:`${c} ${h}`.trimStart(),transformOrigin:d,fillOpacity:0,strokeOpacity:0,opacity:0}];return s.animate(p,Object.assign(Object.assign({},o),t))}},Nk=(t,e)=>{C2.registerProperty({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:Tt.NUMBER});const{coordinate:r}=e;return(i,a,o)=>{const[s]=i;if(!fn(r))return bm(t,e)(i,a,o);const{__data__:c,style:l}=s,{radius:u=0,inset:f=0,fillOpacity:d=1,strokeOpacity:h=1,opacity:p=1}=l,{points:v,y:g,y1:y}=c,m=bh().cornerRadius(u).padAngle(f*Math.PI/180),b=As(r,v,[g,y]),{startAngle:_,endAngle:x}=b,O=[{waveInArcAngle:_+1e-4,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:_+1e-4,fillOpacity:d,strokeOpacity:h,opacity:p,offset:.01},{waveInArcAngle:x,fillOpacity:d,strokeOpacity:h,opacity:p}],w=s.animate(O,Object.assign(Object.assign({},o),t));return w.onframe=function(){s.style.d=m(Object.assign(Object.assign({},b),{endAngle:Number(s.style.waveInArcAngle)}))},w.onfinish=function(){s.style.d=m(Object.assign(Object.assign({},b),{endAngle:x}))},w}};Nk.props={};const jk=t=>(e,n,r)=>{const[i]=e,{fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=i.style,c=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:a,strokeOpacity:o,opacity:s}];return i.animate(c,Object.assign(Object.assign({},r),t))};jk.props={};const Rk=t=>(e,n,r)=>{const[i]=e,{fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=i.style,c=[{fillOpacity:a,strokeOpacity:o,opacity:s},{fillOpacity:0,strokeOpacity:0,opacity:0}];return i.animate(c,Object.assign(Object.assign({},r),t))};Rk.props={};const jJ=t=>(n,r,i)=>{const[a]=n,{transform:o="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=a.style,u="center center",f=[{transform:`${o} scale(${1e-4})`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${o} scale(${1e-4})`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.01},{transform:`${o} scale(1)`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l}];return a.animate(f,Object.assign(Object.assign({},i),t))},RJ=t=>(n,r,i)=>{const[a]=n,{transform:o="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=a.style,u="center center",f=[{transform:`${o} scale(1)`.trimStart(),transformOrigin:u},{transform:`${o} scale(${1e-4})`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.99},{transform:`${o} scale(${1e-4})`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0}];return a.animate(f,Object.assign(Object.assign({},i),t))},Ik=t=>(e,n,r)=>{var i,a;const[o]=e,s=((a=(i=o).getTotalLength)===null||a===void 0?void 0:a.call(i))||0,c=[{lineDash:[0,s]},{lineDash:[s,0]}];return o.animate(c,Object.assign(Object.assign({},r),t))};Ik.props={};const IJ={opacity:1,strokeOpacity:1,fillOpacity:1,lineWidth:0,x:0,y:0,cx:0,cy:0,r:0,rx:0,ry:0,width:0,height:0},DJ={[st.CIRCLE]:["cx","cy","r"],[st.ELLIPSE]:["cx","cy","rx","ry"],[st.RECT]:["x","y","width","height"],[st.IMAGE]:["x","y","width","height"],[st.LINE]:["x1","y1","x2","y2"],[st.POLYLINE]:["points"],[st.POLYGON]:["points"]};function el(t,e,n=!1){const r={};for(const i of e){const a=t.style[i];a?r[i]=a:n&&(r[i]=IJ[i])}return r}const $u=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function _m(t){const{min:e,max:n}=t.getLocalBounds(),[r,i]=e,[a,o]=n,s=o-i,c=a-r;return[r,i,c,s]}function FJ(t){const[e,n,r,i]=t;return` M ${e} ${n} L ${e+r} ${n} L ${e+r} ${n+i} L ${e} ${n+i} Z `}function BJ(t,e){const[n,r,i,a]=_m(t),o=a/i,s=Math.ceil(Math.sqrt(e/o)),c=Math.ceil(e/s),l=[],u=a/c;let f=0,d=e;for(;d>0;){const h=Math.min(d,s),p=i/h;for(let v=0;v{const h=u.style.d;ig(u,n),u.style.d=h,u.style.transform="none"},u.style.transform="none",d}return null}function HJ(t,e,n,r){t.style.visibility="hidden";const i=r(t,e.length);return e.map((a,o)=>{const s=new Zr({style:Object.assign({d:i[o]},el(t,$u))});return xm(a,s,a,n)})}function $J(t,e,n,r){const i=r(e,t.length),{fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=e.style,c=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:0,strokeOpacity:0,opacity:0,offset:.99},{fillOpacity:a,strokeOpacity:o,opacity:s}],l=e.animate(c,n);return[...t.map((f,d)=>{const h=new Zr({style:{d:i[d],fill:e.style.fill}});return xm(f,f,h,n)}),l]}const zk=t=>(e,n,r)=>{const i=zJ(t.split),a=Object.assign(Object.assign({},r),t),{length:o}=e,{length:s}=n;if(o===1&&s===1||o>1&&s>1){const[c]=e,[l]=n;return xm(c,c,l,a)}if(o===1&&s>1){const[c]=e;return HJ(c,n,a,i)}if(o>1&&s===1){const[c]=n;return $J(e,c,a,i)}return null};zk.props={};const Gk=(t,e)=>(n,r,i)=>{const[a]=n,{min:[o,s],halfExtents:c}=a.getLocalBounds(),l=c[0]*2,u=c[1]*2,f=new Zr({style:{d:`M${o},${s}L${o+l},${s}L${o+l},${s+u}L${o},${s+u}Z`}});return a.appendChild(f),a.style.clipPath=f,bm(t,e)([f],r,i)};Gk.props={};const Wk=(t,e)=>(n,r,i)=>{const[a]=n,{min:[o,s],halfExtents:c}=a.getLocalBounds(),l=c[0]*2,u=c[1]*2,f=new Zr({style:{d:`M${o},${s}L${o+l},${s}L${o+l},${s+u}L${o},${s+u}Z`}});return a.appendChild(f),a.style.clipPath=f,Lk(t,e)([f],r,i)};Wk.props={};var VJ=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);if,link:i=!1,background:a=!1,delay:o=60,scale:s,coordinate:c,emitter:l,state:u={}}){var f;const d=e(t),h=new Set(d),p=Cn(d,r),v=Mu(d,n),[g,y]=BS(Object.assign({elements:d,valueof:v,link:i,coordinate:c},At(u.active,"link"))),[m,b,_]=GS(Object.assign({document:t.ownerDocument,scale:s,coordinate:c,background:a,valueof:v},At(u.active,"background"))),x=at(u,{active:Object.assign({},((f=u.active)===null||f===void 0?void 0:f.offset)&&{transform:(...F)=>{const R=u.active.offset(...F),[,I]=F;return zS(d[I],R,c)}})}),{setState:O,removeState:w,hasState:S}=Ua(x,v);let M;const E=F=>{const{target:R,nativeEvent:I=!0}=F;if(!h.has(R))return;M&&clearTimeout(M);const z=r(R),W=p.get(z),V=new Set(W);for(const $ of d)V.has($)?S($,"active")||O($,"active"):(O($,"inactive"),y($)),$!==R&&b($);m(R),g(W),I&&l.emit("element:highlight",{nativeEvent:I,data:{data:n(R),group:W.map(n)}})},A=()=>{M&&clearTimeout(M),M=setTimeout(()=>{C(),M=null},o)},C=(F=!0)=>{for(const R of d)w(R,"active","inactive"),b(R),y(R);F&&l.emit("element:unhighlight",{nativeEvent:F})},P=F=>{const{target:R}=F;a&&!_(R)||!a&&!h.has(R)||(o>0?A():C())},T=()=>{C()};t.addEventListener("pointerover",E),t.addEventListener("pointerout",P),t.addEventListener("pointerleave",T);const k=F=>{const{nativeEvent:R}=F;R||C(!1)},N=F=>{const{nativeEvent:R}=F;if(R)return;const{data:I}=F.data,z=ny(d,I,n);z&&E({target:z,nativeEvent:!1})};return l.on("element:highlight",N),l.on("element:unhighlight",k),()=>{t.removeEventListener("pointerover",E),t.removeEventListener("pointerout",P),t.removeEventListener("pointerleave",T),l.off("element:highlight",N),l.off("element:unhighlight",k);for(const F of d)b(F),y(F)}}function ip(t){var{delay:e,createGroup:n,background:r=!1,link:i=!1}=t,a=VJ(t,["delay","createGroup","background","link"]);return(o,s,c)=>{const{container:l,view:u,options:f}=o,{scale:d,coordinate:h}=u,p=wa(l);return UJ(p,Object.assign({elements:Ao,datum:ks(u),groupKey:n?n(u):void 0,coordinate:h,scale:d,state:Yc(f,[["active",r?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:r,link:i,delay:e,emitter:c},a))}}ip.props={reapplyWhenUpdate:!0};function Yk(t){return ip(Object.assign(Object.assign({},t),{createGroup:ey}))}Yk.props={reapplyWhenUpdate:!0};function Hk(t){return ip(Object.assign(Object.assign({},t),{createGroup:FS}))}Hk.props={reapplyWhenUpdate:!0};var XJ=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);if,link:i=!1,single:a=!1,coordinate:o,background:s=!1,scale:c,emitter:l,state:u={}}){var f;const d=e(t),h=new Set(d),p=Cn(d,r),v=Mu(d,n),[g,y]=BS(Object.assign({link:i,elements:d,valueof:v,coordinate:o},At(u.selected,"link"))),[m,b]=GS(Object.assign({document:t.ownerDocument,background:s,coordinate:o,scale:c,valueof:v},At(u.selected,"background"))),_=at(u,{selected:Object.assign({},((f=u.selected)===null||f===void 0?void 0:f.offset)&&{transform:(...T)=>{const k=u.selected.offset(...T),[,N]=T;return zS(d[N],k,o)}})}),{setState:x,removeState:O,hasState:w}=Ua(_,v),S=(T=!0)=>{for(const k of d)O(k,"selected","unselected"),y(k),b(k);T&&l.emit("element:unselect",{nativeEvent:!0})},M=(T,k,N=!0)=>{if(w(k,"selected"))S();else{const F=r(k),R=p.get(F),I=new Set(R);for(const z of d)I.has(z)?x(z,"selected"):(x(z,"unselected"),y(z)),z!==k&&b(z);if(g(R),m(k),!N)return;l.emit("element:select",Object.assign(Object.assign({},T),{nativeEvent:N,data:{data:[n(k),...R.map(n)]}}))}},E=(T,k,N=!0)=>{const F=r(k),R=p.get(F),I=new Set(R);if(w(k,"selected")){if(!d.some(W=>!I.has(W)&&w(W,"selected")))return S();for(const W of R)x(W,"unselected"),y(W),b(W)}else{const z=R.some(W=>w(W,"selected"));for(const W of d)I.has(W)?x(W,"selected"):w(W,"selected")||x(W,"unselected");!z&&i&&g(R),m(k)}N&&l.emit("element:select",Object.assign(Object.assign({},T),{nativeEvent:N,data:{data:d.filter(z=>w(z,"selected")).map(n)}}))},A=T=>{const{target:k,nativeEvent:N=!0}=T;return h.has(k)?a?M(T,k,N):E(T,k,N):S()};t.addEventListener("click",A);const C=T=>{const{nativeEvent:k,data:N}=T;if(k)return;const F=a?N.data.slice(0,1):N.data;for(const R of F){const I=ny(d,R,n);A({target:I,nativeEvent:!1})}},P=()=>{S(!1)};return l.on("element:select",C),l.on("element:unselect",P),()=>{for(const T of d)y(T);t.removeEventListener("click",A),l.off("element:select",C),l.off("element:unselect",P)}}function ap(t){var{createGroup:e,background:n=!1,link:r=!1}=t,i=XJ(t,["createGroup","background","link"]);return(a,o,s)=>{const{container:c,view:l,options:u}=a,{coordinate:f,scale:d}=l,h=wa(c);return qJ(h,Object.assign({elements:Ao,datum:ks(l),groupKey:e?e(l):void 0,coordinate:f,scale:d,state:Yc(u,[["selected",n?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:n,link:r,emitter:s},i))}}ap.props={reapplyWhenUpdate:!0};function $k(t){return ap(Object.assign(Object.assign({},t),{createGroup:ey}))}$k.props={reapplyWhenUpdate:!0};function Vk(t){return ap(Object.assign(Object.assign({},t),{createGroup:FS}))}Vk.props={reapplyWhenUpdate:!0};var Bs=function(t,e,n){var r,i,a,o,s=0;n||(n={});var c=function(){s=n.leading===!1?0:Date.now(),r=null,o=t.apply(i,a),r||(i=a=null)},l=function(){var u=Date.now();!s&&n.leading===!1&&(s=u);var f=e-(u-s);return i=this,a=arguments,f<=0||f>e?(r&&(clearTimeout(r),r=null),s=u,o=t.apply(i,a),r||(i=a=null)):!r&&n.trailing!==!1&&(r=setTimeout(c,f)),o};return l.cancel=function(){clearTimeout(r),s=0,r=i=a=null},l};function ZJ(t){const{coordinate:e={}}=t,{transform:n=[]}=e,r=n.find(a=>a.type==="fisheye");if(r)return r;const i={type:"fisheye"};return n.push(i),e.transform=n,t.coordinate=e,i}function KJ({wait:t=30,leading:e,trailing:n=!1}){return r=>{const{options:i,update:a,setState:o,container:s}=r,c=wa(s),l=Bs(u=>{const f=Jg(c,u);if(!f){o("fisheye"),a();return}o("fisheye",d=>{const h=at({},d,{interaction:{tooltip:{preserve:!0}}});for(const y of h.marks)y.animate=!1;const[p,v]=f,g=ZJ(h);return g.focusX=p,g.focusY=v,g.visual=!0,h}),a()},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)}}}var QJ=function(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{l(r.next(u))}catch(f){o(f)}}function c(u){try{l(r.throw(u))}catch(f){o(f)}}function l(u){u.done?a(u.value):i(u.value).then(s,c)}l((r=r.apply(t,e||[])).next())})},JJ=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);ii.type==="normalizeY");if(n)return n;const r={type:"normalizeY"};return e.push(r),t.transform=e,r}function ett(t,e,n){const[r]=Array.from(t.entries()).filter(([i])=>i.type===e).map(([i])=>{const{encode:a}=i,o=s=>{const c=a[s];return[s,c?c.value:void 0]};return Object.fromEntries(n.map(o))});return r}function Uk(t){var{wait:e=20,leading:n,trailing:r=!1,labelFormatter:i=o=>`${o}`}=t,a=JJ(t,["wait","leading","trailing","labelFormatter"]);return o=>{const{view:s,container:c,update:l,setState:u}=o,{markState:f,scale:d,coordinate:h}=s,p=ett(f,"line",["x","y","series"]);if(!p)return;const{y:v,x:g,series:y=[]}=p,m=v.map((F,R)=>R),b=Va(m.map(F=>g[F])),_=wa(c),x=c.getElementsByClassName(Na),O=c.getElementsByClassName(G0),S=Cn(O,F=>F.__data__.key.split("-")[0]),M=new ql({style:Object.assign({x1:0,y1:0,x2:0,y2:_.getAttribute("height"),stroke:"black",lineWidth:1},At(a,"rule"))}),E=new fi({style:Object.assign({x:0,y:_.getAttribute("height"),text:"",fontSize:10},At(a,"label"))});M.append(E),_.appendChild(M);const A=(F,R,I)=>{const[z]=F.invert(I),W=R.invert(z);return b[Z$(b,W)]},C=(F,R)=>{M.setAttribute("x1",F[0]),M.setAttribute("x2",F[0]),E.setAttribute("text",i(R))};let P;const T=F=>QJ(this,void 0,void 0,function*(){const{x:R}=d,I=A(h,R,F);C(F,I),u("chartIndex",W=>{const V=at({},W),$=V.marks.find(nt=>nt.type==="line"),ct=Ke(tg(m,nt=>Ke(nt,xt=>+v[xt])/Oi(nt,xt=>+v[xt]),nt=>y[nt]).values()),pt=[1/ct,ct];at($,{scale:{y:{domain:pt}}});const it=ttt($);it.groupBy="color",it.basis=(nt,xt)=>{const yt=nt[zc(Rt=>g[+Rt]).center(nt,I)];return xt[yt]};for(const nt of V.marks)nt.animate=!1;return V}),P=(yield l("chartIndex")).view}),k=F=>{const{scale:R,coordinate:I}=P,{x:z,y:W}=R,V=A(I,z,F);C(F,V);for(const $ of x){const{seriesIndex:J,key:ct}=$.__data__,pt=J[zc(Qt=>g[+Qt]).center(J,V)],it=[0,W.map(1)],nt=[0,W.map(v[pt]/v[J[0]])],[,xt]=I.map(it),[,yt]=I.map(nt),Rt=xt-yt;$.setAttribute("transform",`translate(0, ${Rt})`);const Yt=S.get(ct)||[];for(const Qt of Yt)Qt.setAttribute("dy",Rt)}},N=Bs(F=>{const R=Jg(_,F);R&&k(R)},e,{leading:n,trailing:r});return T([0,0]),_.addEventListener("pointerenter",N),_.addEventListener("pointermove",N),_.addEventListener("pointerleave",N),()=>{M.remove(),_.removeEventListener("pointerenter",N),_.removeEventListener("pointermove",N),_.removeEventListener("pointerleave",N)}}}Uk.props={reapplyWhenUpdate:!0};function Vu(t,e){let n=0,r=0;if(e===void 0)for(let i of t)i!=null&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let a of t)(a=e(a,++i,t))!=null&&(a=+a)>=a&&(++n,r+=a)}if(n)return r/n}function op(t,e){let n,r=-1,i=-1;if(e===void 0)for(const a of t)++i,a!=null&&(n>a||n===void 0&&a>=a)&&(n=a,r=i);else for(let a of t)(a=e(a,++i,t))!=null&&(n>a||n===void 0&&a>=a)&&(n=a,r=i);return r}function Xk(t){var e=document.createElement("div");e.innerHTML=t;var n=e.childNodes[0];return n&&e.contains(n)&&e.removeChild(n),n}function ntt(t,e){return!t||!e?t:t.replace(/\\?\{([^{}]+)\}/g,function(n,r){return n.charAt(0)==="\\"?n.slice(1):e[r]===void 0?"":e[r]})}var rtt=ntt;function Om(t){return t===void 0&&(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 qk={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function itt(t){var e;t===void 0&&(t="");var n=Om(t);return e={},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)]=Q({flex:1},qk),e[".".concat(n.VALUE)]=Q({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},qk),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 att=function(t){It(e,t);function e(n){var r=this,i,a,o=(a=(i=n.style)===null||i===void 0?void 0:i.template)===null||a===void 0?void 0:a.prefixCls,s=Om(o);return r=t.call(this,n,{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:'
'),title:'
'),item:'
  • {name} {value}
  • `)},style:itt(o)})||this,r.timestamp=-1,r.prevCustomContentKey=r.attributes.contentKey,r.initShape(),r.render(r.attributes,r),r}return Object.defineProperty(e.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.element},Object.defineProperty(e.prototype,"elementSize",{get:function(){var n=this.element.offsetWidth,r=this.element.offsetHeight;return{width:n,height:r}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HTMLTooltipItemsElements",{get:function(){var n=this.attributes,r=n.data,i=n.template;return r.map(function(a,o){var s=a.name,c=s===void 0?"":s,l=a.color,u=l===void 0?"black":l,f=a.index,d=On(a,["name","color","index"]),h=Q({name:c,color:u,index:f!=null?f:o},d);return Xk(rtt(i.item,h))})},enumerable:!1,configurable:!0}),e.prototype.render=function(n,r){this.renderHTMLTooltipElement(),this.updatePosition()},e.prototype.destroy=function(){var n;(n=this.element)===null||n===void 0||n.remove(),t.prototype.destroy.call(this)},e.prototype.show=function(n,r){var i=this;if(n!==void 0&&r!==void 0){var a=this.element.style.visibility==="hidden",o=function(){i.attributes.x=n!=null?n:i.attributes.x,i.attributes.y=r!=null?r:i.attributes.y,i.updatePosition()};a?this.closeTransition(o):o()}this.element.style.visibility="visible"},e.prototype.hide=function(n,r){n===void 0&&(n=0),r===void 0&&(r=0);var i=this.attributes.enterable;i&&this.isCursorEntered(n,r)||(this.element.style.visibility="hidden")},e.prototype.initShape=function(){var n=this.attributes.template;this.element=Xk(n.container),this.id&&this.element.setAttribute("id",this.id)},e.prototype.renderCustomContent=function(){if(!(this.prevCustomContentKey!==void 0&&this.prevCustomContentKey===this.attributes.contentKey)){this.prevCustomContentKey=this.attributes.contentKey;var n=this.attributes.content;n&&(typeof n=="string"?this.element.innerHTML=n:this.element.replaceChildren(n))}},e.prototype.renderHTMLTooltipElement=function(){var n,r,i=this.attributes,a=i.template,o=i.title,s=i.enterable,c=i.style,l=i.content,u=Om(a.prefixCls),f=this.element;if(this.element.style.pointerEvents=s?"auto":"none",l)this.renderCustomContent();else{o?(f.innerHTML=a.title,f.getElementsByClassName(u.TITLE)[0].innerHTML=o):(r=(n=f.getElementsByClassName(u.TITLE))===null||n===void 0?void 0:n[0])===null||r===void 0||r.remove();var d=this.HTMLTooltipItemsElements,h=document.createElement("ul");h.className=u.LIST,h.replaceChildren.apply(h,dt([],D(d),!1));var p=this.element.querySelector(".".concat(u.LIST));p?p.replaceWith(h):f.appendChild(h)}zG(f,c)},e.prototype.getRelativeOffsetFromCursor=function(n){var r=this.attributes,i=r.position,a=r.offset,o=n||i,s=o.split("-"),c={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},l=this.elementSize,u=l.width,f=l.height,d=[-u/2,-f/2];return s.forEach(function(h){var p=D(d,2),v=p[0],g=p[1],y=D(c[h],2),m=y[0],b=y[1];d=[v+(u/2+a[0])*m,g+(f/2+a[1])*b]}),d},e.prototype.setOffsetPosition=function(n){var r=D(n,2),i=r[0],a=r[1],o=this.attributes,s=o.x,c=s===void 0?0:s,l=o.y,u=l===void 0?0:l,f=o.container,d=f.x,h=f.y;this.element.style.left="".concat(+c+d+i,"px"),this.element.style.top="".concat(+u+h+a,"px")},e.prototype.updatePosition=function(){var n=this.attributes.showDelay,r=n===void 0?60:n,i=Date.now();this.timestamp>0&&i-this.timestampm+_,top:gb+x},w=[];u.split("-").forEach(function(M){O[M]?w.push(y[M]):w.push(M)});var S=w.join("-");return this.getRelativeOffsetFromCursor(S)},e.prototype.isCursorEntered=function(n,r){if(this.element){var i=this.element.getBoundingClientRect(),a=i.x,o=i.y,s=i.width,c=i.height;return new Mn(a,o,s,c).isPointIn(n,r)}return!1},e.prototype.closeTransition=function(n){var r=this,i=this.element.style.transition;this.element.style.transition="none",n(),setTimeout(function(){r.element.style.transition=i},10)},e.tag="tooltip",e}(yr),Uu=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{var{color:o=Qk(t)}=a,s=Uu(a,["color"]);return Object.assign(Object.assign({},s),{color:o})}).map(Kk);return Object.assign(Object.assign({},n&&{title:n}),{items:i})}function utt(t,e){const{color:n,series:r,facet:i=!1}=t,{color:a,series:o}=e,s=c=>c&&c.invert&&!(c instanceof No)&&!(c instanceof vu);if(s(r))return r.clone().invert(o);if(o&&r instanceof No&&r.invert(o)!==a&&!i)return r.invert(o);if(s(n)){const c=n.invert(a);return Array.isArray(c)?null:c}return null}function Qk(t){const e=t.getAttribute("fill"),n=t.getAttribute("stroke"),{__data__:r}=t,{color:i=e&&e!=="transparent"?e:n}=r;return i}function Jk(t,e=n=>n){const n=new Map(t.map(r=>[e(r),r]));return Array.from(n.values())}function tC(t,e,n,r=t.map(a=>a.__data__),i={}){const a=c=>c instanceof Date?+c:c,o=Jk(r.map(c=>c.title),a).filter(un),s=r.flatMap((c,l)=>{const u=t[l],{items:f=[],title:d}=c,h=f.filter(un),p=n!==void 0?n:f.length<=1;return h.map(v=>{var{color:g=Qk(u)||i.color,name:y}=v,m=Uu(v,["color","name"]);const b=utt(e,c),_=p?b||y:y||b;return Object.assign(Object.assign({},m),{color:g,name:_||d})})}).map(Kk);return Object.assign(Object.assign({},o.length>0&&{title:o.join(",")}),{items:Jk(s,c=>`(${a(c.name)}, ${a(c.value)}, ${a(c.color)})`)})}function ftt(t,e,n){var{plotWidth:r,plotHeight:i,mainWidth:a,mainHeight:o,startX:s,startY:c,transposed:l,polar:u,insetLeft:f,insetTop:d}=n,h=Uu(n,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const p=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},h),v=e.map(M=>M[1]),g=e.map(M=>M[0]),y=Vu(v),m=Vu(g),b=()=>{if(u){const M=Math.min(a,o)/2,E=s+f+a/2,A=c+d+o/2,C=zi(zn([m,y],[E,A])),P=E+M*Math.cos(C),T=A+M*Math.sin(C);return[E,P,A,T]}return l?[s,s+r,y+c,y+c]:[m+s,m+s,c,c+i]},[_,x,O,w]=b(),S=()=>{const M=new ql({style:Object.assign({x1:_,x2:x,y1:O,y2:w},p)});return t.appendChild(M),M};if(g.length>0){const M=t.ruleY||S();M.style.x1=_,M.style.x2=x,M.style.y1=O,M.style.y2=w,t.ruleY=M}}function eC(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function dtt(t,{data:e,style:n,theme:r}){t.markers&&t.markers.forEach(a=>a.remove());const i=e.filter(a=>{const[{x:o,y:s}]=a;return un(o)&&un(s)}).map(a=>{const[{color:o,element:s},c]=a,l=o||s.style.fill||s.style.stroke||r.color;return new gs({style:Object.assign({cx:c[0],cy:c[1],fill:l,r:4,stroke:"#fff",lineWidth:2},n)})});for(const a of i)t.appendChild(a);t.markers=i}function nC(t){t.markers&&(t.markers.forEach(e=>e.remove()),t.markers=[])}function rC(t,e){return Array.from(t.values()).some(n=>{var r;return(r=n.interaction)===null||r===void 0?void 0:r[e]})}function Sm(t,e){return t===void 0?e:t}function iC(t){const{title:e,items:n}=t;return n.length===0&&e===void 0}function htt(t){return Array.from(t.values()).some(e=>{var n;return((n=e.interaction)===null||n===void 0?void 0:n.seriesTooltip)&&e.tooltip})}function ptt(t){return Sh(t,e=>e.classList?e.classList.includes("element"):!1)}function aC(t,e){var{elements:n,sort:r,filter:i,scale:a,coordinate:o,crosshairs:s,render:c,groupName:l,emitter:u,wait:f=50,leading:d=!0,trailing:h=!1,startX:p=0,startY:v=0,body:g=!0,single:y=!0,position:m,enterable:b,mount:_,bounding:x,theme:O,disableNative:w=!1,marker:S=!0,preserve:M=!1,style:E={},css:A={}}=e,C=Uu(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 P=n(t),T=Sn(o),k=fn(o),N=at(E,C),{innerWidth:F,innerHeight:R,width:I,height:z,insetLeft:W,insetTop:V}=o.getOptions(),$=[],J=[];for(const ae of P){const{__data__:me}=ae,{seriesX:fe,title:ne,items:Fe}=me;fe?$.push(ae):(ne||Fe)&&J.push(ae)}const pt=!!(T?a.y:a.x).getBandWidth&&J.length>0;$.sort((ae,me)=>{const fe=T?0:1,ne=Fe=>Fe.getBounds().min[fe];return T?ne(me)-ne(ae):ne(ae)-ne(me)});const it=ae=>{const me=T?1:0,{min:fe,max:ne}=ae.getLocalBounds();return Va([fe[me],ne[me]])};J.sort((ae,me)=>{const[fe,ne]=it(ae),[Fe,Ne]=it(me),Ae=(fe+ne)/2,dn=(Fe+Ne)/2;return T?dn-Ae:Ae-dn});const nt=new Map($.map(ae=>{const{__data__:me}=ae,{seriesX:fe}=me,ne=fe.map((Ne,Ae)=>Ae),Fe=Va(ne,Ne=>fe[+Ne]);return[ae,[Fe,fe]]})),{x:xt}=a,yt=xt!=null&&xt.getBandWidth?xt.getBandWidth()/2:0,Rt=ae=>{const[me]=o.invert(ae);return me-yt},Yt=(ae,me,fe)=>{const ne=Rt(ae),Fe=fe.filter(un),[Ne,Ae]=Va([Fe[0],Fe[Fe.length-1]]),dn=Ne===Ae;if(!pt&&(neAe)&&!dn)return null;const Nn=zc(to=>fe[+to]).center,Yr=Nn(me,ne);return me[Yr]},Qt=(ae,me)=>{const ne=ae[T?1:0],Fe=me.filter(dn=>{const[Nn,Yr]=it(dn);return ne>=Nn&&ne<=Yr});if(!pt||Fe.length>0)return Fe;const Ne=zc(dn=>{const[Nn,Yr]=it(dn);return(Nn+Yr)/2}).center,Ae=Ne(me,ne);return[me[Ae]].filter(un)},Jt=(ae,me)=>{const{__data__:fe}=ae;return Object.fromEntries(Object.entries(fe).filter(([ne])=>ne.startsWith("series")&&ne!=="series").map(([ne,Fe])=>{const Ne=Fe[me];return[fO(ne.replace("series","")),Ne]}))},pe=Bs(ae=>{const me=Jg(t,ae);if(!me)return;const fe=DS(t),ne=fe.min[0],Fe=fe.min[1],Ne=[me[0]-p,me[1]-v];if(!Ne)return;const Ae=Qt(Ne,J),dn=[],Nn=[];for(const cr of $){const[Pf,Sb]=nt.get(cr),IN=Yt(Ne,Pf,Sb);if(IN!==null){dn.push(cr);const DN=Jt(cr,IN),{x:Wht,y:Yht}=DN,Hht=o.map([(Wht||0)+yt,Yht||0]);Nn.push([Object.assign(Object.assign({},DN),{element:cr}),Hht])}}const Yr=Array.from(new Set(Nn.map(cr=>cr[0].x))),to=Yr[op(Yr,cr=>Math.abs(cr-Rt(Ne)))],Vs=Nn.filter(cr=>cr[0].x===to),l0=[...Vs.map(cr=>cr[0]),...Ae.map(cr=>cr.__data__)],u0=[...dn,...Ae],Us=tC(u0,a,l,l0,O);if(r&&Us.items.sort((cr,Pf)=>r(cr)-r(Pf)),i&&(Us.items=Us.items.filter(i)),u0.length===0||iC(Us)){Ge(ae);return}if(g&&Zk({root:t,data:Us,x:me[0]+ne,y:me[1]+Fe,render:c,event:ae,single:y,position:m,enterable:b,mount:_,bounding:x,css:A}),s){const cr=Vs.map(Sb=>Sb[1]),Pf=At(N,"crosshairs");ftt(t,cr,Object.assign(Object.assign({},Pf),{plotWidth:F,plotHeight:R,mainWidth:I,mainHeight:z,insetLeft:W,insetTop:V,startX:p,startY:v,transposed:T,polar:k}))}if(S){const cr=At(N,"marker");dtt(t,{data:Vs,style:cr,theme:O})}u.emit("tooltip:show",Object.assign(Object.assign({},ae),{nativeEvent:!0,data:{data:{x:Gc(a.x,Rt(Ne),!0)}}}))},f,{leading:d,trailing:h}),Ge=ae=>{Io({root:t,single:y,emitter:u,event:ae}),s&&eC(t),S&&nC(t)},le=()=>{wm({root:t,single:y}),s&&eC(t),S&&nC(t)},ye=({nativeEvent:ae,data:me})=>{if(ae)return;const{x:fe}=me.data,{x:ne}=a,Fe=ne.map(fe),[Ne,Ae]=o.map([Fe,.5]),{min:[dn,Nn]}=t.getRenderBounds();pe({offsetX:Ne+dn,offsetY:Ae+Nn})},yn=()=>{Io({root:t,single:y,emitter:u,nativeEvent:!1})},Zn=()=>{br(),le()},yi=()=>{Kn()},Kn=()=>{w||(t.addEventListener("pointerenter",pe),t.addEventListener("pointermove",pe),t.addEventListener("pointerleave",Ge))},br=()=>{w||(t.removeEventListener("pointerenter",pe),t.removeEventListener("pointermove",pe),t.removeEventListener("pointerleave",Ge))};return Kn(),u.on("tooltip:show",ye),u.on("tooltip:hide",yn),u.on("tooltip:disable",Zn),u.on("tooltip:enable",yi),()=>{br(),u.off("tooltip:show",ye),u.off("tooltip:hide",yn),u.off("tooltip:disable",Zn),u.off("tooltip:enable",yi),M?Io({root:t,single:y,emitter:u,nativeEvent:!1}):le()}}function vtt(t,{elements:e,scale:n,render:r,groupName:i,sort:a,filter:o,emitter:s,wait:c=50,leading:l=!0,trailing:u=!1,groupKey:f=M=>M,single:d=!0,position:h,enterable:p,datum:v,view:g,mount:y,bounding:m,theme:b,shared:_=!1,body:x=!0,disableNative:O=!1,preserve:w=!1,css:S={}}){const M=e(t),E=Cn(M,f),A=Bs(I=>{const{target:z}=I,W=ptt(z);if(!W){Io({root:t,single:d,emitter:s,event:I});return}const V=f(W),$=E.get(V);if(!$)return;const J=$.length===1&&!_?ltt($[0]):tC($,n,i,void 0,b);if(a&&J.items.sort((it,nt)=>a(it)-a(nt)),o&&(J.items=J.items.filter(o)),iC(J)){Io({root:t,single:d,emitter:s,event:I});return}const{offsetX:ct,offsetY:pt}=I;x&&Zk({root:t,data:J,x:ct,y:pt,render:r,event:I,single:d,position:h,enterable:p,mount:y,bounding:m,css:S}),s.emit("tooltip:show",Object.assign(Object.assign({},I),{nativeEvent:!0,data:{data:YS(W,g)}}))},c,{leading:l,trailing:u}),C=I=>{Io({root:t,single:d,emitter:s,event:I})},P=()=>{O||(t.addEventListener("pointermove",A),t.addEventListener("pointerleave",C))},T=()=>{O||(t.removeEventListener("pointermove",A),t.removeEventListener("pointerleave",C))},k=({nativeEvent:I,data:z})=>{if(I)return;const W=ny(M,z.data,v);if(!W)return;const V=W.getBBox(),{x:$,y:J,width:ct,height:pt}=V;A({target:W,offsetX:$+ct/2,offsetY:J+pt/2})},N=({nativeEvent:I}={})=>{I||Io({root:t,single:d,emitter:s,nativeEvent:!1})},F=()=>{T(),wm({root:t,single:d})},R=()=>{P()};return s.on("tooltip:show",k),s.on("tooltip:hide",N),s.on("tooltip:enable",R),s.on("tooltip:disable",F),P(),()=>{T(),s.off("tooltip:show",k),s.off("tooltip:hide",N),w?Io({root:t,single:d,emitter:s,nativeEvent:!1}):wm({root:t,single:d})}}function oC(t){const{shared:e,crosshairs:n,series:r,name:i,item:a=()=>({}),facet:o=!1}=t,s=Uu(t,["shared","crosshairs","series","name","item","facet"]);return(c,l,u)=>{const{container:f,view:d}=c,{scale:h,markState:p,coordinate:v,theme:g}=d,y=rC(p,"seriesTooltip"),m=rC(p,"crosshairs"),b=wa(f),_=Sm(r,y);if(_&&htt(p)&&!o)return aC(b,Object.assign(Object.assign({},s),{theme:g,elements:Ao,scale:h,coordinate:v,crosshairs:Sm(n,m),item:a,emitter:u}));if(_&&o){const x=l.filter(A=>A!==c&&A.options.parentKey===c.options.key),O=IS(c,l),w=x[0].view.scale,S=b.getBounds(),M=S.min[0],E=S.min[1];return Object.assign(w,{facet:!0}),aC(b.parentNode.parentNode,Object.assign(Object.assign({},s),{theme:g,elements:()=>O,scale:w,coordinate:v,crosshairs:Sm(n,m),item:a,startX:M,startY:E,emitter:u}))}return vtt(b,Object.assign(Object.assign({},s),{datum:ks(d),elements:Ao,scale:h,coordinate:v,groupKey:e?ey(d):void 0,item:a,emitter:u,view:d,theme:g,shared:e}))}}oC.props={reapplyWhenUpdate:!0};var cp=function(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{l(r.next(u))}catch(f){o(f)}}function c(u){try{l(r.throw(u))}catch(f){o(f)}}function l(u){u.done?a(u.value):i(u.value).then(s,c)}l((r=r.apply(t,e||[])).next())})};const sC="legend-category",gtt="legend-continuous",ytt="items-item",mtt="legend-category-item-marker",btt="legend-category-item-label";function cC(t){return t.getElementsByClassName(mtt)[0]}function lC(t){return t.getElementsByClassName(btt)[0]}function uC(t){return t.getElementsByClassName(ytt)}function Mm(t){return t.getElementsByClassName(sC)}function fC(t){return t.getElementsByClassName(gtt)}function _tt(t,e){[...Mm(t),...fC(t)].forEach(r=>{e(r,i=>i)})}function Em(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function Jmt(t){let e=t;for(;e&&!e.attr("class").startsWith("legend");)e=e.children[0];return e.attributes}function xtt(t,{legends:e,marker:n,label:r,datum:i,filter:a,emitter:o,channel:s,state:c={}}){const l=new Map,u=new Map,f=new Map,{unselected:d={markerStroke:"#aaa",markerFill:"#aaa",labelFill:"#aaa"}}=c,h={unselected:At(d,"marker")},p={unselected:At(d,"label")},{setState:v,removeState:g}=Ua(h,void 0),{setState:y,removeState:m}=Ua(p,void 0),b=Array.from(e(t));let _=b.map(i);const x=()=>{for(const S of b){const M=i(S),E=n(S),A=r(S);_.includes(M)?(g(E,"unselected"),m(A,"unselected")):(v(E,"unselected"),y(A,"unselected"))}};for(const S of b){const M=()=>{Po(t,"pointer")},E=()=>{hV(t)},A=C=>cp(this,void 0,void 0,function*(){const P=i(S),T=_.indexOf(P);T===-1?_.push(P):_.splice(T,1),_.length===0&&_.push(...b.map(i)),yield a(_),x();const{nativeEvent:k=!0}=C;k&&(_.length===b.length?o.emit("legend:reset",{nativeEvent:k}):o.emit("legend:filter",Object.assign(Object.assign({},C),{nativeEvent:k,data:{channel:s,values:_}})))});S.addEventListener("click",A),S.addEventListener("pointerenter",M),S.addEventListener("pointerout",E),l.set(S,A),u.set(S,M),f.set(S,E)}const O=S=>cp(this,void 0,void 0,function*(){const{nativeEvent:M}=S;if(M)return;const{data:E}=S,{channel:A,values:C}=E;A===s&&(_=C,yield a(_),x())}),w=S=>cp(this,void 0,void 0,function*(){const{nativeEvent:M}=S;M||(_=b.map(i),yield a(_),x())});return o.on("legend:filter",O),o.on("legend:reset",w),()=>{for(const S of b)S.removeEventListener("click",l.get(S)),S.removeEventListener("pointerenter",u.get(S)),S.removeEventListener("pointerout",f.get(S)),o.off("legend:filter",O),o.off("legend:reset",w)}}function Ott(t,{legend:e,filter:n,emitter:r,channel:i}){const a=({detail:{value:o}})=>{n(o),r.emit({nativeEvent:!0,data:{channel:i,values:o}})};return e.addEventListener("valuechange",a),()=>{e.removeEventListener("valuechange",a)}}function dC(t,{legend:e,channel:n,value:r,ordinal:i,channels:a,allChannels:o,facet:s=!1}){return cp(this,void 0,void 0,function*(){const{view:c,update:l,setState:u}=t;u(e,f=>{const{marks:d}=f,h=d.map(p=>{if(p.type==="legends")return p;const{transform:v=[]}=p,g=v.findIndex(({type:b})=>b.startsWith("group")||b.startsWith("bin")),y=[...v];y.splice(g+1,0,{type:"filter",[n]:{value:r,ordinal:i}});const m=Object.fromEntries(a.map(b=>[b,{domain:c.scale[b].getOptions().domain}]));return at({},p,Object.assign(Object.assign({transform:y,scale:m},!i&&{animate:!1}),{legend:s?!1:Object.fromEntries(o.map(b=>[b,{preserve:!0}]))}))});return Object.assign(Object.assign({},f),{marks:h})}),yield l()})}function wtt(t,e){for(const n of t)dC(n,Object.assign(Object.assign({},e),{facet:!0}))}function Stt(){return(t,e,n)=>{const{container:r}=t,i=e.filter(f=>f!==t),a=i.length>0,o=f=>Em(f).scales.map(d=>d.name),s=[...Mm(r),...fC(r)],c=s.flatMap(o),l=a?Bs(wtt,50,{trailing:!0}):Bs(dC,50,{trailing:!0}),u=s.map(f=>{const{name:d,domain:h}=Em(f).scales[0],p=o(f),v={legend:f,channel:d,channels:p,allChannels:c};return f.className===sC?xtt(r,{legends:uC,marker:cC,label:lC,datum:g=>{const{__data__:y}=g,{index:m}=y;return h[m]},filter:g=>{const y=Object.assign(Object.assign({},v),{value:g,ordinal:!0});l(a?i:t,y)},state:f.attributes.state,channel:d,emitter:n}):Ott(r,{legend:f,filter:g=>{const y=Object.assign(Object.assign({},v),{value:g,ordinal:!1});l(a?i:t,y)},emitter:n,channel:d})});return()=>{u.forEach(f=>f())}}}function Mtt(){return(t,e,n)=>{const{container:r,view:i,options:a}=t,o=Mm(r),s=Ao(r),c=h=>Em(h).scales[0].name,l=h=>{const{scale:{[h]:p}}=i;return p},u=Yc(a,["active","inactive"]),f=Mu(s,ks(i)),d=[];for(const h of o){const p=z=>{const{data:W}=h.attributes,{__data__:V}=z,{index:$}=V;return W[$].label},v=c(h),g=uC(h),y=l(v),m=Cn(s,z=>y.invert(z.__data__[v])),{state:b={}}=h.attributes,{inactive:_={}}=b,{setState:x,removeState:O}=Ua(u,f),w={inactive:At(_,"marker")},S={inactive:At(_,"label")},{setState:M,removeState:E}=Ua(w),{setState:A,removeState:C}=Ua(S),P=z=>{for(const W of g){const V=cC(W),$=lC(W);W===z||z===null?(E(V,"inactive"),C($,"inactive")):(M(V,"inactive"),A($,"inactive"))}},T=(z,W)=>{const V=p(W),$=new Set(m.get(V));for(const ct of s)$.has(ct)?x(ct,"active"):x(ct,"inactive");P(W);const{nativeEvent:J=!0}=z;J&&n.emit("legend:highlight",Object.assign(Object.assign({},z),{nativeEvent:J,data:{channel:v,value:V}}))},k=new Map;for(const z of g){const W=V=>{T(V,z)};z.addEventListener("pointerover",W),k.set(z,W)}const N=z=>{for(const V of s)O(V,"inactive","active");P(null);const{nativeEvent:W=!0}=z;W&&n.emit("legend:unhighlight",{nativeEvent:W})},F=z=>{const{nativeEvent:W,data:V}=z;if(W)return;const{channel:$,value:J}=V;if($!==v)return;const ct=g.find(pt=>p(pt)===J);ct&&T({nativeEvent:!1},ct)},R=z=>{const{nativeEvent:W}=z;W||N({nativeEvent:!1})};h.addEventListener("pointerleave",N),n.on("legend:highlight",F),n.on("legend:unhighlight",R);const I=()=>{h.removeEventListener(N),n.off("legend:highlight",F),n.off("legend:unhighlight",R);for(const[z,W]of k)z.removeEventListener(W)};d.push(I)}return()=>d.forEach(h=>h())}}var Hi=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);ii||ca||l{const e=t.attributes,{x:n,y:r,width:i,height:a,class:o,renders:s={},handleSize:c=10,document:l}=e,u=Hi(e,["x","y","width","height","class","renders","handleSize","document"]);if(!l||i===void 0||a===void 0||n===void 0||r===void 0)return;const f=c/2,d=(J,ct,pt)=>{J.handle||(J.handle=pt.createElement("rect"),J.append(J.handle));const{handle:it}=J;return it.attr(ct),it},h=At(ag(u,"handleNW","handleNE"),"handleN"),{render:p=d}=h,v=Hi(h,["render"]),g=At(u,"handleE"),{render:y=d}=g,m=Hi(g,["render"]),b=At(ag(u,"handleSE","handleSW"),"handleS"),{render:_=d}=b,x=Hi(b,["render"]),O=At(u,"handleW"),{render:w=d}=O,S=Hi(O,["render"]),M=At(u,"handleNW"),{render:E=d}=M,A=Hi(M,["render"]),C=At(u,"handleNE"),{render:P=d}=C,T=Hi(C,["render"]),k=At(u,"handleSE"),{render:N=d}=k,F=Hi(k,["render"]),R=At(u,"handleSW"),{render:I=d}=R,z=Hi(R,["render"]),W=(J,ct)=>{const{id:pt}=J,it=ct(J,J.attributes,l);it.id=pt,it.style.draggable=!0},V=J=>()=>{const ct=Fc(pt=>W(pt,J));return new ct({})},$=Kt(t).attr("className",o).style("transform",`translate(${n}, ${r})`).style("draggable",!0);$.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(qa,Object.assign(Object.assign({width:i,height:a},ag(u,"handle")),{transform:void 0})),$.maybeAppend("handle-n",V(p)).style("x",f).style("y",-f).style("width",i-c).style("height",c).style("fill","transparent").call(qa,v),$.maybeAppend("handle-e",V(y)).style("x",i-f).style("y",f).style("width",c).style("height",a-c).style("fill","transparent").call(qa,m),$.maybeAppend("handle-s",V(_)).style("x",f).style("y",a-f).style("width",i-c).style("height",c).style("fill","transparent").call(qa,x),$.maybeAppend("handle-w",V(w)).style("x",-f).style("y",f).style("width",c).style("height",a-c).style("fill","transparent").call(qa,S),$.maybeAppend("handle-nw",V(E)).style("x",-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(qa,A),$.maybeAppend("handle-ne",V(P)).style("x",i-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(qa,T),$.maybeAppend("handle-se",V(N)).style("x",i-f).style("y",a-f).style("width",c).style("height",c).style("fill","transparent").call(qa,F),$.maybeAppend("handle-sw",V(I)).style("x",-f).style("y",a-f).style("width",c).style("height",c).style("fill","transparent").call(qa,z)});function Am(t,e){var{brushed:n=()=>{},brushended:r=()=>{},brushcreated:i=()=>{},brushstarted:a=()=>{},brushupdated:o=()=>{},extent:s=Ptt(t),brushRegion:c=(it,nt,xt,yt,Rt)=>[it,nt,xt,yt],reverse:l=!1,fill:u="#777",fillOpacity:f="0.3",stroke:d="#fff",selectedHandles:h=["handle-n","handle-e","handle-s","handle-w","handle-nw","handle-ne","handle-se","handle-sw"]}=e,p=Hi(e,["brushed","brushended","brushcreated","brushstarted","brushupdated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let v=null,g=null,y=null,m=null,b=null,_=!1;const[x,O,w,S]=s;Po(t,"crosshair"),t.style.draggable=!0;const M=(it,nt,xt)=>{if(a(xt),m&&m.remove(),b&&b.remove(),v=[it,nt],l)return E();A()},E=()=>{b=new Zr({style:Object.assign(Object.assign({},p),{fill:u,fillOpacity:f,stroke:d,pointerEvents:"none"})}),m=new hC({style:{x:0,y:0,width:0,height:0,draggable:!0,document:t.ownerDocument},className:"mask"}),t.appendChild(b),t.appendChild(m)},A=()=>{m=new hC({style:Object.assign(Object.assign({document:t.ownerDocument,x:0,y:0},p),{fill:u,fillOpacity:f,stroke:d,draggable:!0}),className:"mask"}),t.appendChild(m)},C=(it=!0)=>{m&&m.remove(),b&&b.remove(),v=null,g=null,y=null,_=!1,m=null,b=null,r(it)},P=(it,nt,xt=!0)=>{const[yt,Rt,Yt,Qt]=Att(it[0],it[1],nt[0],nt[1],s),[Jt,pe,Ge,le]=c(yt,Rt,Yt,Qt,s);return l?k(Jt,pe,Ge,le):T(Jt,pe,Ge,le),n(Jt,pe,Ge,le,xt),[Jt,pe,Ge,le]},T=(it,nt,xt,yt)=>{m.style.x=it,m.style.y=nt,m.style.width=xt-it,m.style.height=yt-nt},k=(it,nt,xt,yt)=>{b.style.d=` M${x},${O}L${w},${O}L${w},${S}L${x},${S}Z M${it},${nt}L${it},${yt}L${xt},${yt}L${xt},${nt}Z `,m.style.x=it,m.style.y=nt,m.style.width=xt-it,m.style.height=yt-nt},N=it=>{const nt=(pe,Ge,le,ye,yn)=>pe+Geyn?yn-le:pe,xt=it[0]-y[0],yt=it[1]-y[1],Rt=nt(xt,v[0],g[0],x,w),Yt=nt(yt,v[1],g[1],O,S),Qt=[v[0]+Rt,v[1]+Yt],Jt=[g[0]+Rt,g[1]+Yt];P(Qt,Jt)},F={"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"}},R=it=>z(it)||I(it),I=it=>{const{id:nt}=it;return h.indexOf(nt)===-1?!1:new Set(Object.keys(F)).has(nt)},z=it=>it===m.getElementById("selection"),W=it=>{const{target:nt}=it,[xt,yt]=ty(t,it);if(!m||!R(nt)){M(xt,yt,it),_=!0;return}R(nt)&&(y=[xt,yt])},V=it=>{const{target:nt}=it,xt=ty(t,it);if(!v)return;if(!y)return P(v,xt);if(z(nt))return N(xt);const[yt,Rt]=[xt[0]-y[0],xt[1]-y[1]],{id:Yt}=nt;if(F[Yt]){const[Qt,Jt,pe,Ge]=F[Yt].vector;return P([v[0]+yt*Qt,v[1]+Rt*Jt],[g[0]+yt*pe,g[1]+Rt*Ge])}},$=it=>{if(y){y=null;const{x:Yt,y:Qt,width:Jt,height:pe}=m.style;v=[Yt,Qt],g=[Yt+Jt,Qt+pe],o(Yt,Qt,Yt+Jt,Qt+pe,it);return}g=ty(t,it);const[nt,xt,yt,Rt]=P(v,g);_=!1,i(nt,xt,yt,Rt,it)},J=it=>{const{target:nt}=it;m&&!R(nt)&&C()},ct=it=>{const{target:nt}=it;!m||!R(nt)||_?Po(t,"crosshair"):z(nt)?Po(t,"move"):I(nt)&&Po(t,F[nt.id].cursor)},pt=()=>{Po(t,"default")};return t.addEventListener("dragstart",W),t.addEventListener("drag",V),t.addEventListener("dragend",$),t.addEventListener("click",J),t.addEventListener("pointermove",ct),t.addEventListener("pointerleave",pt),{mask:m,move(it,nt,xt,yt,Rt=!0){m||M(it,nt,{}),v=[it,nt],g=[xt,yt],P([it,nt],[xt,yt],Rt)},remove(it=!0){m&&C(it)},destroy(){m&&C(!1),Po(t,"default"),t.removeEventListener("dragstart",W),t.removeEventListener("drag",V),t.removeEventListener("dragend",$),t.removeEventListener("click",J),t.removeEventListener("pointermove",ct),t.removeEventListener("pointerleave",pt)}}}function Pm(t,e,n){return e.filter(r=>{if(r===t)return!1;const{interaction:i={}}=r.options;return Object.values(i).find(a=>a.brushKey===n)})}function Ttt(t,e,n){return Pm(t,e,n).map(r=>wa(r.container))}function ktt(t,e,n){return Pm(t,e,n).map(r=>r.options)}function pC(t,e){var{elements:n,selectedHandles:r,siblings:i=V=>[],datum:a,brushRegion:o,extent:s,reverse:c,scale:l,coordinate:u,series:f=!1,key:d=V=>V,bboxOf:h=V=>{const{x:$,y:J,width:ct,height:pt}=V.style;return{x:$,y:J,width:ct,height:pt}},state:p={},emitter:v}=e,g=Hi(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const y=n(t),m=i(t),b=m.flatMap(n),_=Mu(y,a),x=At(g,"mask"),{setState:O,removeState:w}=Ua(p,_),S=new Map,{width:M,height:E,x:A=0,y:C=0}=h(t),P=s||[0,0,M,E],T=()=>{for(const V of[...y,...b])w(V,"active","inactive")},k=(V,$,J,ct)=>{var pt;for(const nt of m)(pt=nt.brush)===null||pt===void 0||pt.remove();const it=new Set;for(const nt of y){const{min:xt,max:yt}=nt.getLocalBounds(),[Rt,Yt]=xt,[Qt,Jt]=yt;Ett([Rt,Yt,Qt,Jt],[V,$,J,ct])?(O(nt,"active"),it.add(d(nt))):O(nt,"inactive")}for(const nt of b)it.has(d(nt))?O(nt,"active"):O(nt,"inactive")},N=()=>{for(const V of y)w(V,"inactive");for(const V of S.values())V.remove();S.clear()},F=(V,$,J,ct)=>{const pt=nt=>{const xt=nt.cloneNode();return xt.__data__=nt.__data__,nt.parentNode.appendChild(xt),S.set(nt,xt),xt},it=new ys({style:{x:V+A,y:$+C,width:J-V,height:ct-$}});t.appendChild(it);for(const nt of y){const xt=S.get(nt)||pt(nt);xt.style.clipPath=it,O(nt,"inactive"),O(xt,"active")}},R=Am(t,Object.assign(Object.assign({},x),{extent:P,brushRegion:o,reverse:c,selectedHandles:r,brushended:V=>{const $=f?N:T;V&&v.emit("brush:remove",{nativeEvent:!0}),$()},brushed:(V,$,J,ct,pt)=>{const it=vh(V,$,J,ct,l,u);pt&&v.emit("brush:highlight",{nativeEvent:!0,data:{selection:it}}),(f?F:k)(V,$,J,ct)},brushcreated:(V,$,J,ct,pt)=>{const it=vh(V,$,J,ct,l,u);v.emit("brush:end",Object.assign(Object.assign({},pt),{nativeEvent:!0,data:{selection:it}}))},brushupdated:(V,$,J,ct,pt)=>{const it=vh(V,$,J,ct,l,u);v.emit("brush:end",Object.assign(Object.assign({},pt),{nativeEvent:!0,data:{selection:it}}))},brushstarted:V=>{v.emit("brush:start",V)}})),I=({nativeEvent:V,data:$})=>{if(V)return;const{selection:J}=$,[ct,pt,it,nt]=J$(J,l,u);R.move(ct,pt,it,nt,!1)};v.on("brush:highlight",I);const z=({nativeEvent:V}={})=>{V||R.remove(!1)};v.on("brush:remove",z);const W=R.destroy.bind(R);return R.destroy=()=>{v.off("brush:highlight",I),v.off("brush:remove",z),W()},R}function Tm(t){var{facet:e,brushKey:n}=t,r=Hi(t,["facet","brushKey"]);return(i,a,o)=>{const{container:s,view:c,options:l}=i,u=wa(s),f={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",reverse:!1},d=["active",["inactive",{opacity:.5}]],{scale:h,coordinate:p}=c;if(e){const g=u.getBounds(),y=g.min[0],m=g.min[1],b=g.max[0],_=g.max[1];return pC(u.parentNode.parentNode,Object.assign(Object.assign({elements:()=>IS(i,a),datum:ks(Qg(i,a).map(x=>x.view)),brushRegion:(x,O,w,S)=>[x,O,w,S],extent:[y,m,b,_],state:Yc(Qg(i,a).map(x=>x.options),d),emitter:o,scale:h,coordinate:p,selectedHandles:void 0},f),r))}const v=pC(u,Object.assign(Object.assign({elements:Ao,key:g=>g.__data__.key,siblings:()=>Ttt(i,a,n),datum:ks([c,...Pm(i,a,n).map(g=>g.view)]),brushRegion:(g,y,m,b)=>[g,y,m,b],extent:void 0,state:Yc([l,...ktt(i,a,n)],d),emitter:o,scale:h,coordinate:p,selectedHandles:void 0},f),r));return u.brush=v,()=>v.destroy()}}function km(t,e,n,r,i){const[,a,,o]=i;return[t,a,n,o]}function Ctt(t){return Tm(Object.assign(Object.assign({},t),{brushRegion:km,selectedHandles:["handle-e","handle-w"]}))}function Cm(t,e,n,r,i){const[a,,o]=i;return[a,e,o,r]}function Ltt(t){return Tm(Object.assign(Object.assign({},t),{brushRegion:Cm,selectedHandles:["handle-n","handle-s"]}))}var Lm=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i[-1/0,v,1/0,y]:(p,v,g,y)=>[Math.floor(l-r),v,Math.ceil(f-r),y]}}function Btt(t,e){var{offsetY:n,offsetX:r,cross:i=!1}=e,a=Lm(e,["offsetY","offsetX","cross"]);const o=yC(t),s=gC(t),[,c]=s.getLocalBounds().min,[l,u]=o.min,[f,d]=o.max,h=d-u;return{brushRegion:km,hotZone:new ys({className:vC,style:Object.assign({width:f-l,height:i?h:h*2,transform:`translate(${l}, ${i?u:c-h})`},a)}),extent:i?(p,v,g,y)=>[p,-1/0,g,1/0]:(p,v,g,y)=>[p,Math.floor(u-n),g,Math.ceil(d-n)]}}function ztt(t,e){var{axes:n,elements:r,points:i,horizontal:a,datum:o,offsetY:s,offsetX:c,reverse:l=!1,state:u={},emitter:f,coordinate:d}=e,h=Lm(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const p=r(t),v=n(t),g=Mu(p,o),{setState:y,removeState:m}=Ua(u,g),b=new Map,_=At(h,"mask"),x=I=>Array.from(b.values()).every(([z,W,V,$])=>I.some(([J,ct])=>J>=z&&J<=V&&ct>=W&&ct<=$)),O=v.map(I=>I.attributes.scale),w=I=>I.length>2?[I[0],I[I.length-1]]:I,S=new Map,M=()=>{S.clear();for(let I=0;I{const W=[];for(const $ of p){const J=i($);x(J)?(y($,"active"),W.push($)):y($,"inactive")}if(S.set(I,C(W,I)),!z)return;const V=()=>{if(!P)return Array.from(S.values());const $=[];for(const[J,ct]of S){const pt=O[J],{name:it}=pt.getOptions();it==="x"?$[0]=ct:$[1]=ct}return $};f.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:V()}})},A=I=>{for(const z of p)m(z,"active","inactive");M(),I&&f.emit("brushAxis:remove",{nativeEvent:!0})},C=(I,z)=>{const W=O[z],{name:V}=W.getOptions(),$=I.map(J=>{const ct=J.__data__;return W.invert(ct[V])});return w(Eo(W,$))},P=v.some(a)&&v.some(I=>!a(I)),T=[];for(let I=0;I{const{nativeEvent:z}=I;z||T.forEach(W=>W.remove(!1))},N=(I,z,W)=>{const[V,$]=I,J=it=>it.getStep?it.getStep():0,ct=F(V,z,W),pt=F($,z,W)+J(z);return a(W)?[ct,-1/0,pt,1/0]:[-1/0,ct,1/0,pt]},F=(I,z,W)=>{const{height:V,width:$}=d.getOptions(),J=z.clone();return a(W)?J.update({range:[0,$]}):J.update({range:[V,0]}),J.map(I)},R=I=>{const{nativeEvent:z}=I;if(z)return;const{selection:W}=I.data;for(let V=0;V{T.forEach(I=>I.destroy()),f.off("brushAxis:remove",k),f.off("brushAxis:highlight",R)}}function Gtt(t){return(e,n,r)=>{const{container:i,view:a,options:o}=e,s=wa(i),{x:c,y:l}=s.getBBox(),{coordinate:u}=a;return ztt(i,Object.assign({elements:Ao,axes:Itt,offsetY:l,offsetX:c,points:f=>f.__data__.points,horizontal:f=>{const{startPos:[d,h],endPos:[p,v]}=f.attributes;return d!==p&&h===v},datum:ks(a),state:Yc(o,["active",["inactive",{opacity:.5}]]),coordinate:u,emitter:r},t))}}var Wtt=function(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{l(r.next(u))}catch(f){o(f)}}function c(u){try{l(r.throw(u))}catch(f){o(f)}}function l(u){u.done?a(u.value):i(u.value).then(s,c)}l((r=r.apply(t,e||[])).next())})},mC=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const{timeStamp:r}=n;return e!==null&&r-e{if(O)return;const{selection:S}=w;n(S,{nativeEvent:!1})};return s.on("brush:filter",x),()=>{m.destroy(),s.off("brush:filter",x),t.removeEventListener("click",_)}}function Nm(t){var{hideX:e=!0,hideY:n=!0}=t,r=mC(t,["hideX","hideY"]);return(i,a,o)=>{const{container:s,view:c,options:l,update:u,setState:f}=i,d=wa(s),h={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1};let p=!1,v=!1,g=c;const{scale:y,coordinate:m}=c;return Htt(d,Object.assign(Object.assign({brushRegion:(b,_,x,O)=>[b,_,x,O],selection:(b,_,x,O)=>{const{scale:w,coordinate:S}=g;return vh(b,_,x,O,w,S)},filter:(b,_)=>Wtt(this,void 0,void 0,function*(){if(v)return;v=!0;const[x,O]=b;f("brushFilter",S=>{const{marks:M}=S,E=M.map(A=>at({axis:Object.assign(Object.assign({},e&&{x:{transform:[{type:"hide"}]}}),n&&{y:{transform:[{type:"hide"}]}})},A,{scale:{x:{domain:x,nice:!1},y:{domain:O,nice:!1}}}));return Object.assign(Object.assign({},l),{marks:E,clip:!0})}),o.emit("brush:filter",Object.assign(Object.assign({},_),{data:{selection:[x,O]}})),g=(yield u()).view,v=!1,p=!0}),reset:b=>{if(v||!p)return;const{scale:_}=c,{x,y:O}=_,w=x.getOptions().domain,S=O.getOptions().domain;o.emit("brush:filter",Object.assign(Object.assign({},b),{data:{selection:[w,S]}})),p=!1,g=c,f("brushFilter"),u()},extent:void 0,emitter:o,scale:y,coordinate:m},h),r))}}function $tt(t){return Nm(Object.assign(Object.assign({hideX:!0},t),{brushRegion:km}))}function Vtt(t){return Nm(Object.assign(Object.assign({hideY:!0},t),{brushRegion:Cm}))}var Utt=function(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{l(r.next(u))}catch(f){o(f)}}function c(u){try{l(r.throw(u))}catch(f){o(f)}}function l(u){u.done?a(u.value):i(u.value).then(s,c)}l((r=r.apply(t,e||[])).next())})};const Xtt="slider";function qtt(t,e,n,r=!1,i="x",a="y"){const{marks:o}=t,s=o.map(c=>{var l,u;return at({axis:{x:{transform:[{type:"hide"}]},y:{transform:[{type:"hide"}]}}},c,{scale:e,[n]:Object.assign(Object.assign({},((l=c[n])===null||l===void 0?void 0:l[i])&&{[i]:Object.assign({preserve:!0},r&&{ratio:null})}),((u=c[n])===null||u===void 0?void 0:u[a])&&{[a]:{preserve:!0}}),animate:!1})});return Object.assign(Object.assign({},t),{marks:s,clip:!0,animate:!1})}function Ztt(t,e,n){const[r,i]=t,a=n?c=>1-c:c=>c,o=Gc(e,a(r),!0),s=Gc(e,a(i),!1);return Eo(e,[o,s])}function lp(t){return[t[0],t[t.length-1]]}function bC({initDomain:t={},className:e=Xtt,prefix:n="slider",setValue:r=(l,u)=>l.setValues(u),hasState:i=!1,wait:a=50,leading:o=!0,trailing:s=!1,getInitValues:c=l=>{var u;const f=(u=l==null?void 0:l.attributes)===null||u===void 0?void 0:u.values;if(f[0]!==0||f[1]!==1)return f}}){return(l,u,f)=>{const{container:d,view:h,update:p,setState:v}=l,g=d.getElementsByClassName(e);if(!g.length)return()=>{};let y=!1;const{scale:m,coordinate:b,layout:_}=h,{paddingLeft:x,paddingTop:O,paddingBottom:w,paddingRight:S}=_,{x:M,y:E}=m,A=Sn(b),C=N=>{const F=N==="vertical"?"y":"x",R=N==="vertical"?"x":"y";return A?[R,F]:[F,R]},P=new Map,T=new Set,k={x:t.x||M.getOptions().domain,y:t.y||E.getOptions().domain};for(const N of g){const{orientation:F}=N.attributes,[R,I]=C(F),z=`${n}${mo(R)}:filter`,W=R==="x",{ratio:V}=M.getOptions(),{ratio:$}=E.getOptions(),J=nt=>{if(nt.data){const{selection:Qt}=nt.data,[Jt=lp(k.x),pe=lp(k.y)]=Qt;return W?[Eo(M,Jt,V),Eo(E,pe,$)]:[Eo(E,pe,$),Eo(M,Jt,V)]}const{value:xt}=nt.detail,yt=m[R],Rt=Ztt(xt,yt,A&&F==="horizontal"),Yt=k[I];return[Rt,Yt]},ct=Bs(nt=>Utt(this,void 0,void 0,function*(){const{initValue:xt=!1}=nt;if(y&&!xt)return;y=!0;const{nativeEvent:yt=!0}=nt,[Rt,Yt]=J(nt);if(k[R]=Rt,k[I]=Yt,yt){const Qt=W?Rt:Yt,Jt=W?Yt:Rt;f.emit(z,Object.assign(Object.assign({},nt),{nativeEvent:yt,data:{selection:[lp(Qt),lp(Jt)]}}))}v(N,Qt=>Object.assign(Object.assign({},qtt(Qt,{[R]:{domain:Rt,nice:!1}},n,i,R,I)),{paddingLeft:x,paddingTop:O,paddingBottom:w,paddingRight:S})),yield p(),y=!1}),a,{leading:o,trailing:s}),pt=nt=>{const{nativeEvent:xt}=nt;if(xt)return;const{data:yt}=nt,{selection:Rt}=yt,[Yt,Qt]=Rt;N.dispatchEvent(new sn("valuechange",{data:yt,nativeEvent:!1}));const Jt=W?gh(Yt,M):gh(Qt,E);r(N,Jt)};f.on(z,pt),N.addEventListener("valuechange",ct),P.set(N,ct),T.add([z,pt]);const it=c(N);it&&N.dispatchEvent(new sn("valuechange",{detail:{value:it},nativeEvent:!1,initValue:!0}))}return p(),()=>{for(const[N,F]of P)N.removeEventListener("valuechange",F);for(const[N,F]of T)f.off(N,F)}}}const _C="g2-scrollbar";function Ktt(t={}){return(e,n,r)=>{const{view:i,container:a}=e;if(!a.getElementsByClassName(_C).length)return()=>{};const{scale:s}=i,{x:c,y:l}=s,u={x:[...c.getOptions().domain],y:[...l.getOptions().domain]};return c.update({domain:c.getOptions().expectedDomain}),l.update({domain:l.getOptions().expectedDomain}),bC(Object.assign(Object.assign({},t),{initDomain:u,className:_C,prefix:"scrollbar",hasState:!0,setValue:(d,h)=>d.setValue(h[0]),getInitValues:d=>{const h=d.slider.attributes.values;if(h[0]!==0)return h}}))(e,n,r)}}var Qtt=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i${e}`}const tet={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 xC(t){return t.nodeName!=="text"?!1:!!t.isOverflowing()}function OC(t){var{offsetX:e=8,offsetY:n=8}=t,r=Qtt(t,["offsetX","offsetY"]);return i=>{const{container:a}=i,[o,s]=a.getBounds().min,c=At(r,"tip"),l=new Set,u=d=>{const{target:h}=d;if(!xC(h)){d.stopPropagation();return}const{offsetX:p,offsetY:v}=d,g=p+e-o,y=v+n-s;if(h.tip){h.tip.style.x=g,h.tip.style.y=y;return}const{text:m}=h.style,b=new bd({className:"poptip",style:{innerHTML:Jtt("div",m,Object.assign(Object.assign({},tet),c)),x:g,y}});a.appendChild(b),h.tip=b,l.add(b)},f=d=>{const{target:h}=d;if(!xC(h)){d.stopPropagation();return}h.tip&&(h.tip.remove(),h.tip=null,l.delete(h.tip))};return a.addEventListener("pointerover",u),a.addEventListener("pointerout",f),()=>{a.removeEventListener("pointerover",u),a.removeEventListener("pointerout",f),l.forEach(d=>d.remove())}}}OC.props={reapplyWhenUpdate:!0};function eet(t,e){var n=Ey(e),r=n.length;if(ie(t))return!r;for(var i=0;i=0&&(h=a[w],h.data===jm);--w)h.data=null}if(f.parent=iet,f.eachBefore(function(S){S.depth=S.parent.depth+1,--c}).eachBefore(_E),f.parent=null,c>0)throw new Error("cycle");return f}return r.id=function(i){return arguments.length?(t=up(i),r):t},r.parentId=function(i){return arguments.length?(e=up(i),r):e},r.path=function(i){return arguments.length?(n=up(i),r):n},r}function set(t){t="".concat(t);var e=t.length;return Im(t,e-1)&&!Im(t,e-2)&&(t=t.slice(0,-1)),t[0]==="/"?t:"/".concat(t)}function MC(t){var e=t.length;if(e<2)return"";for(;--e>1&&!Im(t,e););return t.slice(0,e)}function Im(t,e){if(t[e]==="/"){for(var n=0;e>0&&t[--e]==="\\";)++n;if(!(n&1))return!0}return!1}function cet(t,e,n,r,i){var a=t.children,o,s=a.length,c,l=new Array(s+1);for(l[0]=c=o=0;o=d-1){var m=a[f];m.x0=p,m.y0=v,m.x1=g,m.y1=y;return}for(var b=l[f],_=h/2+b,x=f+1,O=d-1;x>>1;l[w]<_?x=w+1:O=w}_-l[x-1]y-v){var E=h?(p*M+g*S)/h:g;u(f,x,S,p,v,E,y),u(x,d,M,E,v,g,y)}else{var A=h?(v*M+y*S)/h:y;u(f,x,S,p,v,g,A),u(x,d,M,p,A,g,y)}}}function fp(t,e,n,r,i){for(var a=t.children,o,s=-1,c=a.length,l=t.value&&(i-n)/t.value;++sm&&(m=l),O=g*g*x,b=Math.max(m/O,O/y),b>_){g-=l;break}_=b}o.push(c={value:g,dice:h1?r:1)},n}(EC),fet=function t(e){function n(r,i,a,o,s){if((c=r._squarify)&&c.ratio===e)for(var c,l,u,f,d=-1,h,p=c.length,v=r.value;++d1?r:1)},n}(EC);function zs(){return 0}function rl(t){return function(){return t}}function det(){var t=PC,e=!1,n=1,r=1,i=[0],a=zs,o=zs,s=zs,c=zs,l=zs;function u(d){return d.x0=d.y0=0,d.x1=n,d.y1=r,d.eachBefore(f),i=[0],e&&d.eachBefore(yE),d}function f(d){var h=i[d.depth],p=d.x0+h,v=d.y0+h,g=d.x1-h,y=d.y1-h;g{n.id=`${t.id}/${n.data.name}`,n.path=[...e,n.data.name],TC(n,n.path)})}function kC(t){const e=Re(t,["data","name"]);e.replaceAll&&(t.path=e.replaceAll(".","/").split("/")),t.children&&t.children.forEach(n=>{kC(n)})}function pet(t,e){const n={treemapBinary:cet,treemapDice:Tu,treemapSlice:fp,treemapSliceDice:uet,treemapSquarify:PC,treemapResquarify:fet},r=t==="treemapSquarify"?n[t].ratio(e):n[t];if(!r)throw new TypeError("Invalid tile method!");return r}function CC(t,e,n){const{value:r}=n,i=pet(e.tile,e.ratio),a=het(t,e.path);sr(t)?kC(a):TC(a),r?a.sum(c=>e.ignoreParentValue&&c.children?0:Pa(r)(c)).sort(e.sort):a.count(),det().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)(a);const o=a.descendants().map(c=>Object.assign(c,{id:c.id.replace(/^\//,""),x:[c.x0,c.x1],y:[c.y0,c.y1]}));return[o.filter(typeof e.layer=="function"?e.layer:c=>c.height===e.layer),o]}var vet=function(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{l(r.next(u))}catch(f){o(f)}}function c(u){try{l(r.throw(u))}catch(f){o(f)}}function l(u){u.done?a(u.value):i(u.value).then(s,c)}l((r=r.apply(t,e||[])).next())})},get=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const{update:c,setState:l,container:u,options:f}=s,d=yet(u),h=f.marks[0],{state:p}=h,v=new dr;d.appendChild(v);const g=(_,x)=>vet(this,void 0,void 0,function*(){if(v.removeChildren(),x){let O="",w=a.y,S=0;const M=[],E=d.getBBox().width,A=_.map((C,P)=>{O=`${O}${C}/`,M.push(C);const T=new fi({name:O.replace(/\/$/,""),style:Object.assign(Object.assign({text:C,x:S,path:[...M],depth:P},a),{y:w})});v.appendChild(T),S+=T.getBBox().width;const k=new fi({style:Object.assign(Object.assign({x:S,text:" / "},a),{y:w})});return v.appendChild(k),S+=k.getBBox().width,S>E&&(w=v.getBBox().height+a.y,S=0,T.attr({x:S,y:w}),S+=T.getBBox().width,k.attr({x:S,y:w}),S+=k.getBBox().width),P===wy(_)-1&&k.remove(),T});A.forEach((C,P)=>{if(P===wy(A)-1)return;const T=Object.assign({},C.attributes);C.attr("cursor","pointer"),C.addEventListener("mouseenter",()=>{C.attr(o)}),C.addEventListener("mouseleave",()=>{C.attr(T)}),C.addEventListener("click",()=>{g(Re(C,["style","path"]),Re(C,["style","depth"]))})})}_tt(u,l),l("treemapDrillDown",O=>{const{marks:w}=O,S=_.join("/"),M=w.map(E=>{if(E.type!=="rect")return E;let A=e;if(x){const P=e.filter(R=>{const I=Re(R,["id"]);return I&&(I.match(`${S}/`)||S.match(I))}).map(R=>({value:R.height===0?Re(R,["value"]):void 0,name:Re(R,["id"])})),{paddingLeft:T,paddingBottom:k,paddingRight:N}=n,F=Object.assign(Object.assign({},n),{paddingTop:(n.paddingTop||v.getBBox().height+10)/(x+1),paddingLeft:T/(x+1),paddingBottom:k/(x+1),paddingRight:N/(x+1),path:R=>R.name,layer:R=>R.depth===x+1});A=CC(P,F,{value:"value"})[0]}else A=e.filter(P=>P.depth===1);const C=[];return A.forEach(({path:P})=>{C.push(Gu(P))}),at({},E,{data:A,scale:{color:{domain:C}}})});return Object.assign(Object.assign({},O),{marks:M})}),yield c(void 0,["legendFilter"])}),y=_=>{const x=_.target;if(Re(x,["markType"])!=="rect")return;const O=Re(x,["__data__","key"]),w=nl(e,S=>S.id===O);Re(w,"height")&&g(Re(w,"path"),Re(w,"depth"))};d.addEventListener("click",y);const m=Ey(Object.assign(Object.assign({},p.active),p.inactive)),b=()=>{WS(d).forEach(x=>{const O=Re(x,["style","cursor"]),w=nl(e,S=>S.id===Re(x,["__data__","key"]));if(O!=="pointer"&&(w!=null&&w.height)){x.style.cursor="pointer";const S=_y(x.attributes,m);x.addEventListener("mouseenter",()=>{x.attr(p.active)}),x.addEventListener("mouseleave",()=>{x.attr(at(S,p.inactive))})}})};return b(),d.addEventListener("mousemove",b),()=>{v.remove(),d.removeEventListener("click",y),d.removeEventListener("mousemove",b)}}}var Dm=function(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{l(r.next(u))}catch(f){o(f)}}function c(u){try{l(r.throw(u))}catch(f){o(f)}}function l(u){u.done?a(u.value):i(u.value).then(s,c)}l((r=r.apply(t,e||[])).next())})},_et=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const e=t.target,{markType:n}=e;n==="line"&&(e.attr("_lineWidth",e.attr("lineWidth")||1),e.attr("lineWidth",e.attr("_lineWidth")+3)),n==="interval"&&(e.attr("_opacity",e.attr("opacity")||1),e.attr("opacity",.7*e.attr("_opacity")))},NC=t=>{const e=t.target,{markType:n}=e;n==="line"&&e.attr("lineWidth",e.attr("_lineWidth")),n==="interval"&&e.attr("opacity",e.attr("_opacity"))},Oet=(t,e,n)=>e.map(r=>["x","color"].reduce((a,o)=>{const s=n[o];return s&&r[s]!==t[s]?!1:a},!0)?Object.assign(Object.assign({},r),t):r),wet=t=>{const e=Re(t,["__data__","y"]),r=Re(t,["__data__","y1"])-e,{__data__:{data:i,encode:a,transform:o},childNodes:s}=t.parentNode,c=nl(o,({type:f})=>f==="normalizeY"),l=Re(a,["y","field"]),u=i[s.indexOf(t)][l];return(f,d=!1)=>c||d?f/(1-f)/(r/(1-r))*u:f},Met=(t,e)=>{const n=Re(t,["__data__","seriesItems",e,"0","value"]),r=Re(t,["__data__","seriesIndex",e]),{__data__:{data:i,encode:a,transform:o}}=t.parentNode,s=nl(o,({type:u})=>u==="normalizeY"),c=Re(a,["y","field"]),l=i[r][c];return u=>s?n===1?u:u/(1-u)/(n/(1-n))*l:u},jC=(t,e,n)=>{t.forEach((r,i)=>{r.attr("stroke",e[1]===i?n.activeStroke:n.stroke)})},RC=(t,e,n,r)=>{const i=new Zr({style:n}),a=new fi({style:r});return e.appendChild(a),t.appendChild(i),[i,a]},IC=(t,e)=>{if(!Re(t,["options","range","indexOf"]))return;const r=t.options.range.indexOf(e);return t.sortedDomain[r]},Bm=(t,e,n)=>{const r=wh(t,e),a=wh(t,n)/r,o=t[0]+(e[0]-t[0])*a,s=t[1]+(e[1]-t[1])*a;return[o,s]};function Eet(t={}){const{selection:e=[],precision:n=2}=t,r=_et(t,["selection","precision"]),i=Object.assign(Object.assign({},xet),r||{}),a=At(i,"path"),o=At(i,"label"),s=At(i,"point");return(c,l,u)=>{const{update:f,setState:d,container:h,view:p,options:{marks:v,coordinate:g}}=c,y=wa(h);let m=WS(y),b,_=e;const{transform:x=[],type:O}=g,w=!!nl(x,({type:R})=>R==="transpose"),S=O==="polar",M=O==="theta",E=!!nl(m,({markType:R})=>R==="area");E&&(m=m.filter(({markType:R})=>R==="area"));const A=new dr({style:{zIndex:2}});y.appendChild(A);const C=()=>{u.emit("element-point:select",{nativeEvent:!0,data:{selection:_}})},P=(R,I)=>{u.emit("element-point:moved",{nativeEvent:!0,data:{changeData:R,data:I}})},T=R=>{const I=R.target;_=[I.parentNode.childNodes.indexOf(I)],C(),N(I)},k=R=>{const{data:{selection:I},nativeEvent:z}=R;if(z)return;_=I;const W=Re(m,[_==null?void 0:_[0]]);W&&N(W)},N=R=>{const{attributes:I,markType:z,__data__:W}=R,{stroke:V}=I,{points:$,seriesTitle:J,color:ct,title:pt,seriesX:it,y1:nt}=W;if(w&&z!=="interval")return;const{scale:xt,coordinate:yt}=(b==null?void 0:b.view)||p,{color:Rt,y:Yt,x:Qt}=xt,Jt=yt.getCenter();A.removeChildren();let pe;const Ge=(le,ye,yn,Zn)=>Dm(this,void 0,void 0,function*(){return d("elementPointMove",yi=>{var Kn;const br=(((Kn=b==null?void 0:b.options)===null||Kn===void 0?void 0:Kn.marks)||v).map(ae=>{if(!Zn.includes(ae.type))return ae;const{data:me,encode:fe}=ae,Fe=Object.keys(fe).reduce((Ae,dn)=>{const Nn=fe[dn];return dn==="x"&&(Ae[Nn]=le),dn==="y"&&(Ae[Nn]=ye),dn==="color"&&(Ae[Nn]=yn),Ae},{}),Ne=Oet(Fe,me,fe);return P(Fe,Ne),at({},ae,{data:Ne,animate:!1})});return Object.assign(Object.assign({},yi),{marks:br})}),yield f("elementPointMove")});if(["line","area"].includes(z))$.forEach((le,ye)=>{const yn=Qt.invert(it[ye]);if(!yn)return;const Zn=new gs({name:Fm,style:Object.assign({cx:le[0],cy:le[1],fill:V},s)}),yi=Met(R,ye);Zn.addEventListener("mousedown",Kn=>{const br=yt.output([it[ye],0]),ae=J==null?void 0:J.length;h.attr("cursor","move"),_[1]!==ye&&(_[1]=ye,C()),jC(A.childNodes,_,s);const[me,fe]=RC(A,Zn,a,o),ne=Ne=>{const Ae=le[1]+Ne.clientY-pe[1];if(E)if(S){const dn=le[0]+Ne.clientX-pe[0],[Nn,Yr]=Bm(Jt,br,[dn,Ae]),[,to]=yt.output([1,Yt.output(0)]),[,Vs]=yt.invert([Nn,to-($[ye+ae][1]-Yr)]),l0=(ye+1)%ae,u0=(ye-1+ae)%ae,Us=Eu([$[u0],[Nn,Yr],J[l0]&&$[l0]]);fe.attr("text",yi(Yt.invert(Vs)).toFixed(n)),me.attr("d",Us),Zn.attr("cx",Nn),Zn.attr("cy",Yr)}else{const[,dn]=yt.output([1,Yt.output(0)]),[,Nn]=yt.invert([le[0],dn-($[ye+ae][1]-Ae)]),Yr=Eu([$[ye-1],[le[0],Ae],J[ye+1]&&$[ye+1]]);fe.attr("text",yi(Yt.invert(Nn)).toFixed(n)),me.attr("d",Yr),Zn.attr("cy",Ae)}else{const[,dn]=yt.invert([le[0],Ae]),Nn=Eu([$[ye-1],[le[0],Ae],$[ye+1]]);fe.attr("text",Yt.invert(dn).toFixed(n)),me.attr("d",Nn),Zn.attr("cy",Ae)}};pe=[Kn.clientX,Kn.clientY],window.addEventListener("mousemove",ne);const Fe=()=>Dm(this,void 0,void 0,function*(){if(h.attr("cursor","default"),window.removeEventListener("mousemove",ne),h.removeEventListener("mouseup",Fe),pn(fe.attr("text")))return;const Ne=Number(fe.attr("text")),Ae=IC(Rt,ct);b=yield Ge(yn,Ne,Ae,["line","area"]),fe.remove(),me.remove(),N(R)});h.addEventListener("mouseup",Fe)}),A.appendChild(Zn)}),jC(A.childNodes,_,s);else if(z==="interval"){let le=[($[0][0]+$[1][0])/2,$[0][1]];w?le=[$[0][0],($[0][1]+$[1][1])/2]:M&&(le=$[0]);const ye=wet(R),yn=new gs({name:Fm,style:Object.assign(Object.assign({cx:le[0],cy:le[1],fill:V},s),{stroke:s.activeStroke})});yn.addEventListener("mousedown",Zn=>{h.attr("cursor","move");const yi=IC(Rt,ct),[Kn,br]=RC(A,yn,a,o),ae=fe=>{if(w){const ne=le[0]+fe.clientX-pe[0],[Fe]=yt.output([Yt.output(0),Yt.output(0)]),[,Ne]=yt.invert([Fe+(ne-$[2][0]),le[1]]),Ae=Eu([[ne,$[0][1]],[ne,$[1][1]],$[2],$[3]],!0);br.attr("text",ye(Yt.invert(Ne)).toFixed(n)),Kn.attr("d",Ae),yn.attr("cx",ne)}else if(M){const ne=le[1]+fe.clientY-pe[1],Fe=le[0]+fe.clientX-pe[0],[Ne,Ae]=Bm(Jt,[Fe,ne],le),[dn,Nn]=Bm(Jt,[Fe,ne],$[1]),Yr=yt.invert([Ne,Ae])[1],to=nt-Yr;if(to<0)return;const Vs=pV(Jt,[[Ne,Ae],[dn,Nn],$[2],$[3]],to>.5?1:0);br.attr("text",ye(to,!0).toFixed(n)),Kn.attr("d",Vs),yn.attr("cx",Ne),yn.attr("cy",Ae)}else{const ne=le[1]+fe.clientY-pe[1],[,Fe]=yt.output([1,Yt.output(0)]),[,Ne]=yt.invert([le[0],Fe-($[2][1]-ne)]),Ae=Eu([[$[0][0],ne],[$[1][0],ne],$[2],$[3]],!0);br.attr("text",ye(Yt.invert(Ne)).toFixed(n)),Kn.attr("d",Ae),yn.attr("cy",ne)}};pe=[Zn.clientX,Zn.clientY],window.addEventListener("mousemove",ae);const me=()=>Dm(this,void 0,void 0,function*(){if(h.attr("cursor","default"),h.removeEventListener("mouseup",me),window.removeEventListener("mousemove",ae),pn(br.attr("text")))return;const fe=Number(br.attr("text"));b=yield Ge(pt,fe,yi,[z]),br.remove(),Kn.remove(),N(R)});h.addEventListener("mouseup",me)}),A.appendChild(yn)}};m.forEach((R,I)=>{_[0]===I&&N(R),R.addEventListener("click",T),R.addEventListener("mouseenter",LC),R.addEventListener("mouseleave",NC)});const F=R=>{const I=R==null?void 0:R.target;(!I||I.name!==Fm&&!m.includes(I))&&(_=[],C(),A.removeChildren())};return u.on("element-point:select",k),u.on("element-point:unselect",F),h.addEventListener("mousedown",F),()=>{A.remove(),u.off("element-point:select",k),u.off("element-point:unselect",F),h.removeEventListener("mousedown",F),m.forEach(R=>{R.removeEventListener("click",T),R.removeEventListener("mouseenter",LC),R.removeEventListener("mouseleave",NC)})}}}var Aet=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);it=>{const{children:e}=t;if(!Array.isArray(e))return[];const{x:n=0,y:r=0,width:i,height:a,data:o}=t;return e.map(s=>{var{data:c,x:l,y:u,width:f,height:d}=s,h=Aet(s,["data","x","y","width","height"]);return Object.assign(Object.assign({},h),{data:Dg(c,o),x:l!=null?l:n,y:u!=null?u:r,width:f!=null?f:i,height:d!=null?d:a})})};DC.props={};var Pet=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);it=>{const{children:e}=t;if(!Array.isArray(e))return[];const{direction:n="row",ratio:r=e.map(()=>1),padding:i=0,data:a}=t,[o,s,c,l]=n==="col"?["y","height","width","x"]:["x","width","height","y"],u=r.reduce((v,g)=>v+g),f=t[s]-i*(e.length-1),d=r.map(v=>f*(v/u)),h=[];let p=t[o]||0;for(let v=0;v{const{encode:e,data:n,scale:r,shareSize:i=!1}=t,{x:a,y:o}=e,s=(c,l)=>{var u;if(c===void 0||!i)return{};const f=Cn(n,p=>p[c]),d=((u=r==null?void 0:r[l])===null||u===void 0?void 0:u.domain)||Array.from(f.keys()),h=d.map(p=>f.has(p)?f.get(p).length:1);return{domain:d,flex:h}};return{scale:{x:Object.assign(Object.assign({paddingOuter:0,paddingInner:.1,guide:a===void 0?null:{position:"top"}},a===void 0&&{paddingInner:0}),s(a,"x")),y:Object.assign(Object.assign({range:[0,1],paddingOuter:0,paddingInner:.1,guide:o===void 0?null:{position:"right"}},o===void 0&&{paddingInner:0}),s(o,"y"))}}}),zm=Rc(t=>{const{data:e,scale:n}=t,r=[t];let i,a,o;for(;r.length;){const f=r.shift(),{children:d,encode:h={},scale:p={},legend:v={}}=f,{color:g}=h,{color:y}=p,{color:m}=v;g!==void 0&&(i=g),y!==void 0&&(a=y),m!==void 0&&(o=m),Array.isArray(d)&&r.push(...d)}const s=()=>{var f;const d=(f=n==null?void 0:n.color)===null||f===void 0?void 0:f.domain;if(d!==void 0)return[d];if(i===void 0)return[void 0];const h=typeof i=="function"?i:v=>v[i],p=e.map(h);return p.some(v=>typeof v=="number")?[Ha(p)]:[Array.from(new Set(p)),"ordinal"]},c=typeof i=="string"?i:"",[l,u]=s();return{encode:{color:i},scale:{color:at({},a,{domain:l,type:u})},legend:{color:at({title:c},o)}}}),Gm=Rc(()=>({animate:{enterType:"fadeIn"}})),Wm=Ic(()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}})),Ym=Ic(()=>({type:"cell"})),BC=Ic(t=>{const{data:e}=t;return{data:{type:"inline",value:e,transform:[{type:"custom",callback:()=>{const{data:r,encode:i}=t,{x:a,y:o}=i,s=a?Array.from(new Set(r.map(u=>u[a]))):[],c=o?Array.from(new Set(r.map(u=>u[o]))):[];return(()=>{if(s.length&&c.length){const u=[];for(const f of s)for(const d of c)u.push({[a]:f,[o]:d});return u}if(s.length)return s.map(u=>({[a]:u}));if(c.length)return c.map(u=>({[o]:u}))})()}}]}}}),zC=Ic((t,e=Cet,n=Let,r=Net,i={})=>{const{data:a,encode:o,children:s,scale:c,x:l=0,y:u=0,shareData:f=!1,key:d}=t,{value:h}=a,{x:p,y:v}=o,{color:g}=c,{domain:y}=g;return{children:(b,_,x)=>{const{x:O,y:w}=_,{paddingLeft:S,paddingTop:M,marginLeft:E,marginTop:A}=x,{domain:C}=O.getOptions(),{domain:P}=w.getOptions(),T=_s(b),k=b.map(e),N=b.map(({x:V,y:$})=>[O.invert(V),w.invert($)]),R=N.map(([V,$])=>J=>{const{[p]:ct,[v]:pt}=J;return(p!==void 0?ct===V:!0)&&(v!==void 0?pt===$:!0)}).map(V=>h.filter(V)),I=f?Ke(R,V=>V.length):void 0,z=N.map(([V,$])=>({columnField:p,columnIndex:C.indexOf(V),columnValue:V,columnValuesLength:C.length,rowField:v,rowIndex:P.indexOf($),rowValue:$,rowValuesLength:P.length})),W=z.map(V=>Array.isArray(s)?s:[s(V)].flat(1));return T.flatMap(V=>{const[$,J,ct,pt]=k[V],it=z[V],nt=R[V];return W[V].map(yt=>{var Rt,Yt,{scale:Qt,key:Jt,facet:pe=!0,axis:Ge={},legend:le={}}=yt,ye=Tet(yt,["scale","key","facet","axis","legend"]);const yn=((Rt=Qt==null?void 0:Qt.y)===null||Rt===void 0?void 0:Rt.guide)||Ge.y,Zn=((Yt=Qt==null?void 0:Qt.x)===null||Yt===void 0?void 0:Yt.guide)||Ge.x,yi={x:{tickCount:p?5:void 0},y:{tickCount:v?5:void 0}},Kn=pe?nt:nt.length===0?[]:h,br={color:{domain:y}},ae={x:GC(Zn,n)(it,Kn),y:GC(yn,r)(it,Kn)};return Object.assign(Object.assign({key:`${Jt}-${V}`,data:Kn,margin:0,x:$+S+l+E,y:J+M+u+A,parentKey:d,width:ct,height:pt,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!Kn.length,dataDomain:I,scale:at(yi,Qt,br),axis:at({},Ge,ae),legend:!1},ye),i)})})}}});function Cet(t){const{points:e}=t;return Bg(e)}function dp(t,e){return e.length?at({title:!1,tick:null,label:null},t):at({title:!1,tick:null,label:null,grid:null},t)}function Let(t){return(e,n)=>{const{rowIndex:r,rowValuesLength:i,columnIndex:a,columnValuesLength:o}=e;if(r!==i-1)return dp(t,n);const s=a!==o-1?!1:void 0,c=n.length?void 0:null;return at({title:s,grid:c},t)}}function Net(t){return(e,n)=>{const{rowIndex:r,columnIndex:i}=e;if(i!==0)return dp(t,n);const a=r!==0?!1:void 0,o=n.length?void 0:null;return at({title:a,grid:o},t)}}function GC(t,e){return typeof t=="function"?t:t===null||t===!1?()=>null:e(t)}const WC=()=>t=>[Xu.of(t).call(Ym).call(zm).call(Gm).call(ket).call(Wm).call(BC).call(zC).value()];WC.props={};var Hm=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}})),Ret=Ic(t=>{const{data:e,children:n,x:r=0,y:i=0,key:a}=t;return{children:(s,c,l)=>{const{x:u,y:f}=c,{paddingLeft:d,paddingTop:h,marginLeft:p,marginTop:v}=l,{domain:g}=u.getOptions(),{domain:y}=f.getOptions(),m=_s(s),b=s.map(({points:w})=>Bg(w)),_=s.map(({x:w,y:S})=>[u.invert(w),f.invert(S)]),x=_.map(([w,S])=>({columnField:w,columnIndex:g.indexOf(w),columnValue:w,columnValuesLength:g.length,rowField:S,rowIndex:y.indexOf(S),rowValue:S,rowValuesLength:y.length})),O=x.map(w=>Array.isArray(n)?n:[n(w)].flat(1));return m.flatMap(w=>{const[S,M,E,A]=b[w],[C,P]=_[w],T=x[w];return O[w].map(N=>{var F,R;const{scale:I,key:z,encode:W,axis:V,interaction:$}=N,J=Hm(N,["scale","key","encode","axis","interaction"]),ct=(F=I==null?void 0:I.y)===null||F===void 0?void 0:F.guide,pt=(R=I==null?void 0:I.x)===null||R===void 0?void 0:R.guide,it={x:{facet:!1},y:{facet:!1}},nt={x:Det(pt)(T,e),y:Fet(ct)(T,e)},xt={x:{tickCount:5},y:{tickCount:5}};return Object.assign({data:e,parentKey:a,key:`${z}-${w}`,x:S+d+r+p,y:M+h+i+v,width:E,height:A,margin:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:at(it,I),axis:at(xt,V,nt),legend:!1,encode:at({},W,{x:C,y:P}),interaction:at({},$,{legendFilter:!1})},J)})})}}}),Iet=Ic(t=>{const{encode:e}=t,n=Hm(t,["encode"]),{position:r=[],x:i=r,y:a=[...r].reverse()}=e,o=Hm(e,["position","x","y"]),s=[];for(const c of[i].flat(1))for(const l of[a].flat(1))s.push({$x:c,$y:l});return Object.assign(Object.assign({},n),{data:s,encode:Object.assign(Object.assign({},o),{x:"$x",y:"$y"}),scale:Object.assign(Object.assign({},[i].flat(1).length===1&&{x:{paddingInner:0}}),[a].flat(1).length===1&&{y:{paddingInner:0}})})});function Det(t){return typeof t=="function"?t:t===null?()=>null:(e,n)=>{const{rowIndex:r,rowValuesLength:i}=e;if(r!==i-1)return dp(t,n)}}function Fet(t){return typeof t=="function"?t:t===null?()=>null:(e,n)=>{const{columnIndex:r}=e;if(r!==0)return dp(t,n)}}const Bet=()=>t=>[Xu.of(t).call(Ym).call(zm).call(Ret).call(Iet).call(Gm).call(Wm).call(jet).value()];var zet=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}})),Wet=Rc(t=>({coordinate:{type:"polar"}})),Yet=t=>{const{encode:e}=t,n=zet(t,["encode"]),{position:r}=e;return Object.assign(Object.assign({},n),{encode:{x:r}})};function YC(t){return e=>null}function Het(t){const{points:e}=t,[n,r,i,a]=e,o=Ln(n,a),s=zn(n,a),c=zn(r,i),l=fS(s,c),u=1/Math.sin(l/2),f=o/(1+u),d=f*Math.sqrt(2),[h,p]=i,g=Dc(s)+l/2,y=f*u,m=h+y*Math.sin(g),b=p-y*Math.cos(g);return[m-d/2,b-d/2,d,d]}const $et=()=>t=>[Xu.of(t).call(Ym).call(Yet).call(zm).call(Wet).call(BC).call(zC,Het,YC,YC,{frame:!1}).call(Gm).call(Wm).call(Get).value()];function Vet(t,e,n){const i=n,a=[0,i],o=[-i+1,-0+1];if(t==="normal")return a;if(t==="reverse")return o;if(t==="alternate")return e%2===0?a:o;if(t==="reverse-alternate")return e%2===0?o:a}function Uet(t,e,n){const r=[t];for(;r.length;){const i=r.pop();i.animate=at({enter:{duration:e},update:{duration:e,easing:n,type:"morphing",fill:"both"},exit:{type:"fadeOut",duration:e}},i.animate||{});const{children:a}=i;Array.isArray(a)&&r.push(...a)}return t}const HC=()=>t=>{const{children:e=[],duration:n=1e3,iterationCount:r=1,direction:i="normal",easing:a="ease-in-out-sine"}=t,o=e.length;if(!Array.isArray(e)||o===0)return[];const{key:s}=e[0],c=e.map(l=>Object.assign(Object.assign({},l),{key:s})).map(l=>Uet(l,n,a));return function*(){let l=0,u;for(;r==="infinite"||l{var s;return[o,(s=Le(r,o))===null||s===void 0?void 0:s[0]]}).filter(([,o])=>un(o)),a=o=>i.map(([,s])=>s[o]).join("-");return Array.from(Cn(e,a).values())}function $C(t){return Array.isArray(t)?Ket(t):typeof t=="function"?Zet(t):t==="series"?qet:t==="value"?Qet:t==="sum"?Jet:t==="maxIndex"?tnt:()=>null}function VC(t,e){for(const n of t)n.sort(e)}function UC(t,e){return(e==null?void 0:e.domain)||Array.from(new Set(t))}function Xet(t){return Array.isArray(t)?t:[t]}function qet(t,e,n){return qu(r=>n[r])}function Zet(t){return(e,n,r)=>qu(i=>t(e[i]))}function Ket(t){return(e,n,r)=>(i,a)=>t.reduce((o,s)=>o!==0?o:Gn(e[i][s],e[a][s]),0)}function Qet(t,e,n){return qu(r=>e[r])}function Jet(t,e,n){const r=_s(t),i=Array.from(Cn(r,o=>n[+o]).entries()),a=new Map(i.map(([o,s])=>[o,s.reduce((c,l)=>c+ +e[l])]));return qu(o=>a.get(n[o]))}function tnt(t,e,n){const r=_s(t),i=Array.from(Cn(r,o=>n[+o]).entries()),a=new Map(i.map(([o,s])=>[o,Bc(s,c=>e[c])]));return qu(o=>a.get(n[o]))}function qu(t){return(e,n)=>Gn(t(e),t(n))}const XC=(t={})=>{const{groupBy:e="x",orderBy:n=null,reverse:r=!1,y:i="y",y1:a="y1",series:o=!0}=t;return(s,c)=>{const{data:l,encode:u,style:f={}}=c,[d,h]=Le(u,"y"),[p,v]=Le(u,"y1"),[g]=o?Cu(u,"series","color"):Le(u,"color"),y=Do(e,s,c),b=$C(n)(l,d,g);b&&VC(y,b);const _=new Array(s.length),x=new Array(s.length),O=new Array(s.length),w=[],S=[];for(const P of y){r&&P.reverse();const T=p?+p[P[0]]:0,k=[],N=[];for(const $ of P){const J=O[$]=+d[$]-T;J<0?N.push($):J>=0&&k.push($)}const F=k.length>0?k:N,R=N.length>0?N:k;let I=k.length-1,z=0;for(;I>0&&d[F[I]]===0;)I--;for(;z0?V=_[$]=(x[$]=V)+J:_[$]=x[$]=V}}const M=new Set(w),E=new Set(S),A=i==="y"?_:x,C=a==="y"?_:x;return[s,at({},c,{encode:{y0:Fh(d,h),y:gn(A,h),y1:gn(C,v)},style:Object.assign({first:(P,T)=>M.has(T),last:(P,T)=>E.has(T)},f)})]}};XC.props={};function qC(t,e){let n=0;if(e===void 0)for(let r of t)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(i=+i)>=i&&++n}return n}function ent(t,e){let n=0,r,i=0,a=0;if(e===void 0)for(let o of t)o!=null&&(o=+o)>=o&&(r=o-i,i+=r/++n,a+=r*(o-i));else{let o=-1;for(let s of t)(s=e(s,++o,t))!=null&&(s=+s)>=s&&(r=s-i,i+=r/++n,a+=r*(s-i))}if(n>1)return a/(n-1)}function ZC(t,e){const n=ent(t,e);return n&&Math.sqrt(n)}function nnt(t,e,n){const r=qC(t),i=ZC(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}var KC=Array.prototype,rnt=KC.slice,t1t=KC.map;function $m(t){return()=>t}const int=Math.sqrt(50),ant=Math.sqrt(10),ont=Math.sqrt(2);function hp(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=int?10:a>=ant?5:a>=ont?2:1;let s,c,l;return i<0?(l=Math.pow(10,-i)/o,s=Math.round(t*l),c=Math.round(e*l),s/le&&--c,l=-l):(l=Math.pow(10,i)*o,s=Math.round(t/l),c=Math.round(e/l),s*le&&--c),c0))return[];if(t===e)return[t];const r=e=i))return[];const s=a-i+1,c=new Array(s);if(r)if(o<0)for(let l=0;l0?(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}}function lnt(t){return Math.max(1,Math.ceil(Math.log(qC(t))/Math.LN2)+1)}function unt(){var t=Jl,e=Ha,n=lnt;function r(i){Array.isArray(i)||(i=Array.from(i));var a,o=i.length,s,c,l=new Array(o);for(a=0;a=d)if(b>=d&&e===Ha){const x=Zu(f,d,_);isFinite(x)&&(x>0?d=(Math.floor(d/x)+1)*x:x<0&&(d=(Math.ceil(d*-x)+1)/-x))}else h.pop()}for(var p=h.length,v=0,g=p;h[v]<=f;)++v;for(;h[g-1]>d;)--g;(v||g0?h[a-1]:f,m.x1=a0)for(a=0;an;){if(r-n>600){const c=r-n+1,l=e-n+1,u=Math.log(c),f=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*f*(c-f)/c)*(l-c/2<0?-1:1),h=Math.max(n,Math.floor(e-l*f/c+d)),p=Math.min(r,Math.floor(e+(c-l)*f/c+d));Vm(t,e,h,p,i)}const a=t[e];let o=n,s=r;for(Ku(t,n,e),i(t[r],a)>0&&Ku(t,n,r);o0;)--s}i(t[n],a)===0?Ku(t,n,s):(++s,Ku(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function Ku(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function fnt(t,e=Gn){let n,r=!1;if(e.length===1){let i;for(const a of t){const o=e(a);(r?Gn(o,i)>0:Gn(o,o)===0)&&(n=a,i=o,r=!0)}}else for(const i of t)(r?e(i,n)>0:e(i,i)===0)&&(n=i,r=!0);return n}function pp(t,e,n){if(t=Float64Array.from(U$(t,n)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return Oi(t);if(e>=1)return Ke(t);var r,i=(r-1)*e,a=Math.floor(i),o=Ke(Vm(t,a).subarray(0,a+1)),s=Oi(t.subarray(a+1));return o+(s-o)*(i-a)}}function n1t(t,e,n=number){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,a=Math.floor(i),o=+n(t[a],a,t),s=+n(t[a+1],a+1,t);return o+(s-o)*(i-a)}}function dnt(t,e,n=Xg){if(!isNaN(e=+e)){if(r=Float64Array.from(t,(s,c)=>Xg(n(t[c],c,t))),e<=0)return op(r);if(e>=1)return Bc(r);var r,i=Uint32Array.from(t,(s,c)=>c),a=r.length-1,o=Math.floor(a*e);return Vm(i,o,0,a,(s,c)=>_u(r[s],r[c])),o=fnt(i.subarray(0,o+1),s=>r[s]),o>=0?o:-1}}function Um(t,e){return pp(t,.5,e)}function hnt(t,e){return dnt(t,.5,e)}var pnt=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);ie===null?t:`${t} of ${e}`}function vnt(t){if(typeof t=="function")return[t,null];const n={mean:gnt,max:mnt,count:_nt,first:Ont,last:wnt,sum:xnt,min:bnt,median:ynt}[t];if(!n)throw new Error(`Unknown reducer: ${t}.`);return n()}function gnt(){const t=(n,r)=>Vu(n,i=>+r[i]),e=Fo("mean");return[t,e]}function ynt(){const t=(n,r)=>Um(n,i=>+r[i]),e=Fo("median");return[t,e]}function mnt(){const t=(n,r)=>Ke(n,i=>+r[i]),e=Fo("max");return[t,e]}function bnt(){const t=(n,r)=>Oi(n,i=>+r[i]),e=Fo("min");return[t,e]}function _nt(){const t=(n,r)=>n.length,e=Fo("count");return[t,e]}function xnt(){const t=(n,r)=>Di(n,i=>+r[i]),e=Fo("sum");return[t,e]}function Ont(){const t=(n,r)=>r[n[0]],e=Fo("first");return[t,e]}function wnt(){const t=(n,r)=>r[n[n.length-1]],e=Fo("last");return[t,e]}const Xm=(t={})=>{const{groupBy:e}=t,n=pnt(t,["groupBy"]);return(r,i)=>{const{data:a,encode:o}=i,s=e(r,i);if(!s)return[r,i];const c=(h,p)=>{if(h)return h;const{from:v}=p;if(!v)return h;const[,g]=Le(o,v);return g},l=Object.entries(n).map(([h,p])=>{const[v,g]=vnt(p),[y,m]=Le(o,h),b=c(m,p),_=s.map(x=>v(x,y!=null?y:a));return[h,Object.assign(Object.assign({},eK(_,(g==null?void 0:g(b))||b)),{aggregate:!0})]}),u=Object.keys(o).map(h=>{const[p,v]=Le(o,h),g=s.map(y=>p[y[0]]);return[h,gn(g,v)]}),f=s.map(h=>a[h[0]]);return[_s(s),at({},i,{data:f,encode:Object.fromEntries([...u,...l])})]}};Xm.props={};var Snt=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const{groupChannels:e=["color"],binChannels:n=["x","y"]}=t,r=Snt(t,["groupChannels","binChannels"]),i={},a=(o,s)=>{const{encode:c}=s,l=n.map(p=>{const[v]=Le(c,p);return v}),u=At(r,QC),f=o.filter(p=>l.every(v=>un(v[p]))),d=[...e.map(p=>{const[v]=Le(c,p);return v}).filter(un).map(p=>v=>p[v]),...n.map((p,v)=>{const g=l[v],y=u[p]||Mnt(g),m=unt().thresholds(y).value(_=>+g[_])(f),b=new Map(m.flatMap(_=>{const{x0:x,x1:O}=_,w=`${x},${O}`;return _.map(S=>[S,w])}));return i[p]=b,_=>b.get(_)})],h=p=>d.map(v=>v(p)).join("-");return Array.from(Cn(f,h).values())};return Xm(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(r).filter(([o])=>!o.startsWith(QC)))),Object.fromEntries(n.flatMap(o=>{const s=([l])=>+i[o].get(l).split(",")[0],c=([l])=>+i[o].get(l).split(",")[1];return c.from=o,[[o,s],[`${o}1`,c]]}))),{groupBy:a}))};qm.props={};const JC=(t={})=>{const{thresholds:e}=t;return qm(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))};JC.props={};var Ent=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const{groupBy:e="x",reverse:n=!1,orderBy:r,padding:i}=t,a=Ent(t,["groupBy","reverse","orderBy","padding"]);return(o,s)=>{const{data:c,encode:l,scale:u}=s,{series:f}=u,[d]=Le(l,"y"),[h]=Cu(l,"series","color"),p=UC(h,f),v=Do(e,o,s),y=$C(r)(c,d,h);y&&VC(v,y);const m=new Array(o.length);for(const b of v){n&&b.reverse();for(let _=0;_{const{padding:e=0,paddingX:n=e,paddingY:r=e,random:i=Math.random}=t;return(a,o)=>{const{encode:s,scale:c}=o,{x:l,y:u}=c,[f]=Le(s,"x"),[d]=Le(s,"y"),h=vp(f,l,n),p=vp(d,u,r),v=a.map(()=>gp(i(),...p)),g=a.map(()=>gp(i(),...h));return[a,at({scale:{x:{padding:.5},y:{padding:.5}}},o,{encode:{dy:gn(v),dx:gn(g)}})]}};e3.props={};const n3=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(r,i)=>{const{encode:a,scale:o}=i,{x:s}=o,[c]=Le(a,"x"),l=vp(c,s,e),u=r.map(()=>gp(n(),...l));return[r,at({scale:{x:{padding:.5}}},i,{encode:{dx:gn(u)}})]}};n3.props={};const r3=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(r,i)=>{const{encode:a,scale:o}=i,{y:s}=o,[c]=Le(a,"y"),l=vp(c,s,e),u=r.map(()=>gp(n(),...l));return[r,at({scale:{y:{padding:.5}}},i,{encode:{dy:gn(u)}})]}};r3.props={};var Ant=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const{groupBy:e="x"}=t;return(n,r)=>{const{encode:i}=r,{x:a}=i,o=Ant(i,["x"]),s=Object.entries(o).filter(([d])=>d.startsWith("y")).map(([d])=>[d,Le(i,d)[0]]),c=s.map(([d])=>[d,new Array(n.length)]),l=Do(e,n,r),u=new Array(l.length);for(let d=0;ds.map(([,m])=>+m[y])),[v,g]=Ha(p);u[d]=(v+g)/2}const f=Math.max(...u);for(let d=0;d[d,gn(h,Le(i,d)[1])]))})]}};i3.props={};const a3=(t={})=>{const{groupBy:e="x",series:n=!0}=t;return(r,i)=>{const{encode:a}=i,[o]=Le(a,"y"),[s,c]=Le(a,"y1"),[l]=n?Cu(a,"series","color"):Le(a,"color"),u=Do(e,r,i),f=new Array(r.length);for(const d of u){const h=d.map(p=>+o[p]);for(let p=0;pm!==p));f[v]=o[v]>g?g:o[v]}}return[r,at({},i,{encode:{y1:gn(f,c)}})]}};a3.props={};const o3=t=>{const{groupBy:e=["x"],reducer:n=(o,s)=>s[o[0]],orderBy:r=null,reverse:i=!1,duration:a}=t;return(o,s)=>{const{encode:c}=s,u=(Array.isArray(e)?e:[e]).map(g=>[g,Le(c,g)[0]]);if(u.length===0)return[o,s];let f=[o];for(const[,g]of u){const y=[];for(const m of f){const b=Array.from(Cn(m,_=>g[_]).values());y.push(...b)}f=y}if(r){const[g]=Le(c,r);g&&f.sort((y,m)=>n(y,g)-n(m,g)),i&&f.reverse()}const d=(a||3e3)/f.length,[h]=a?[Co(o,d)]:Cu(c,"enterDuration",Co(o,d)),[p]=Cu(c,"enterDelay",Co(o,0)),v=new Array(o.length);for(let g=0,y=0;g+h[_]);for(const _ of m)v[_]=+p[_]+y;y+=b}return[o,at({},s,{encode:{enterDuration:Bh(h),enterDelay:Bh(v)}})]}};o3.props={};var Pnt=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);iOi(n,i=>r[+i]),max:(n,r)=>Ke(n,i=>r[+i]),first:(n,r)=>r[n[0]],last:(n,r)=>r[n[n.length-1]],mean:(n,r)=>Vu(n,i=>r[+i]),median:(n,r)=>Um(n,i=>r[+i]),sum:(n,r)=>Di(n,i=>r[+i]),deviation:(n,r)=>ZC(n,i=>r[+i])}[t]||Ke}const s3=(t={})=>{const{groupBy:e="x",basis:n="max"}=t;return(r,i)=>{const{encode:a,tooltip:o}=i,{x:s}=a,c=Pnt(a,["x"]),l=Object.entries(c).filter(([v])=>v.startsWith("y")).map(([v])=>[v,Le(a,v)[0]]),[,u]=l.find(([v])=>v==="y"),f=l.map(([v])=>[v,new Array(r.length)]),d=Do(e,r,i),h=Tnt(n);for(const v of d){const g=h(v,u);for(const y of v)for(let m=0;m[v,gn(g,Le(a,v)[1])]))},!p&&a.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};s3.props={};function c3(t,e){return[t[0]]}function knt(t,e){const n=t.length-1;return[t[n]]}function Cnt(t,e){const n=Bc(t,r=>e[r]);return[t[n]]}function Lnt(t,e){const n=op(t,r=>e[r]);return[t[n]]}function Nnt(t){return typeof t=="function"?t:{first:c3,last:knt,max:Cnt,min:Lnt}[t]||c3}const yp=(t={})=>{const{groupBy:e="series",channel:n,selector:r}=t;return(i,a)=>{const{encode:o}=a,s=Do(e,i,a),[c]=Le(o,n),l=Nnt(r);return[s.flatMap(u=>l(u,c)),a]}};yp.props={};var jnt=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const{selector:e}=t,n=jnt(t,["selector"]);return yp(Object.assign({channel:"x",selector:e},n))};l3.props={};var Rnt=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const{selector:e}=t,n=Rnt(t,["selector"]);return yp(Object.assign({channel:"y",selector:e},n))};u3.props={};var Int=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const{channels:e=["x","y"]}=t,n=Int(t,["channels"]),r=(i,a)=>Do(e,i,a);return Xm(Object.assign(Object.assign({},n),{groupBy:r}))};Qu.props={};const f3=(t={})=>Qu(Object.assign(Object.assign({},t),{channels:["x","color","series"]}));f3.props={};const d3=(t={})=>Qu(Object.assign(Object.assign({},t),{channels:["y","color","series"]}));d3.props={};const h3=(t={})=>Qu(Object.assign(Object.assign({},t),{channels:["color"]}));h3.props={};function Dnt(t,e,n){return(e.length!==2?Va(tg(t,e,n),([r,i],[a,o])=>Gn(i,o)||Gn(r,a)):Va(Cn(t,n),([r,i],[a,o])=>e(i,o)||Gn(r,a))).map(([r])=>r)}var p3=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);ii(o,a);if(i==="max")return o=>Ke(o,s=>+a[s]);if(i==="min")return o=>Oi(o,s=>+a[s]);if(i==="sum")return o=>Di(o,s=>+a[s]);if(i==="median")return o=>Um(o,s=>+a[s]);if(i==="mean")return o=>Vu(o,s=>+a[s]);if(i==="first")return o=>a[o[0]];if(i==="last")return o=>a[o[o.length-1]];throw new Error(`Unknown reducer: ${i}`)}function Bnt(t,e,n){const{reverse:r,channel:i}=n,{encode:a}=e,[o]=Le(a,i),s=Va(t,c=>o[c]);return r&&s.reverse(),[s,e]}function znt(t,e,n){if(!Array.isArray(n))return t;const r=new Set(n);return t.filter(i=>r.has(e[i]))}function Gnt(t,e,n){var r;const{reverse:i,slice:a,channel:o}=n,s=p3(n,["reverse","slice","channel"]),{encode:c,scale:l={}}=e,u=(r=l[o])===null||r===void 0?void 0:r.domain,[f]=Le(c,o),d=Fnt(o,s,c),h=znt(t,f,u),p=Dnt(h,d,y=>f[y]);i&&p.reverse();const v=typeof a=="number"?[0,a]:a,g=a?p.slice(...v):p;return[t,at(e,{scale:{[o]:{domain:g}}})]}const mp=(t={})=>{const{reverse:e=!1,slice:n,channel:r,ordinal:i=!0}=t,a=p3(t,["reverse","slice","channel","ordinal"]);return(o,s)=>i?Gnt(o,s,Object.assign({reverse:e,slice:n,channel:r},a)):Bnt(o,s,Object.assign({reverse:e,slice:n,channel:r},a))};mp.props={};const v3=(t={})=>mp(Object.assign(Object.assign({},t),{channel:"x"}));v3.props={};const g3=(t={})=>mp(Object.assign(Object.assign({},t),{channel:"y"}));g3.props={};const y3=(t={})=>mp(Object.assign(Object.assign({},t),{channel:"color"}));y3.props={};function Wnt(t,e){return typeof e=="string"?t.map(n=>n[e]):t.map(e)}function Ynt(t,e){if(typeof t=="function")return n=>t(n,e);if(t==="sum")return n=>Di(n,r=>+e[r]);throw new Error(`Unknown reducer: ${t}`)}const m3=(t={})=>{const{field:e,channel:n="y",reducer:r="sum"}=t;return(i,a)=>{const{data:o,encode:s}=a,[c]=Le(s,"x"),l=e?Wnt(o,e):Le(s,n)[0],u=Ynt(r,l),f=eg(i,u,d=>c[d]).map(d=>d[1]);return[i,at({},a,{scale:{x:{flex:f}}})]}};m3.props={};function Hnt(t){const{padding:e=0,direction:n="col"}=t;return(r,i,a)=>{const o=r.length;if(o===0)return[];const{innerWidth:s,innerHeight:c}=a,l=c/s;let u=Math.ceil(Math.sqrt(i/l)),f=s/u,d=Math.ceil(i/u),h=d*f;for(;h>c;)u=u+1,f=s/u,d=Math.ceil(i/u),h=d*f;const p=c-d*f,v=d<=1?0:p/(d-1),[g,y]=d<=1?[(s-o*f)/(o-1),(c-f)/2]:[0,0];return r.map((m,b)=>{const[_,x,O,w]=Bg(m),S=n==="col"?b%u:Math.floor(b/d),M=n==="col"?Math.floor(b/u):b%d,E=S*f,A=(d-M-1)*f+p,C=(f-e)/O,P=(f-e)/w,T=E-_+g*S+1/2*e,k=A-x-v*M-y+1/2*e;return`translate(${T}, ${k}) scale(${C}, ${P})`})}}const b3=t=>(e,n)=>[e,at({},n,{modifier:Hnt(t),axis:!1})];b3.props={};function $nt(t,e,n,r){const i=t.length;if(r>=i||r===0)return t;const a=h=>e[t[h]]*1,o=h=>n[t[h]]*1,s=[],c=(i-2)/(r-2);let l=0,u,f,d;s.push(l);for(let h=0;hu&&(u=f,d=b);s.push(d),l=d}return s.push(i-1),s.map(h=>t[h])}function Vnt(t){if(typeof t=="function")return t;if(t==="lttb")return $nt;const e={first:r=>[r[0]],last:r=>[r[r.length-1]],min:(r,i,a)=>[r[op(r,o=>a[o])]],max:(r,i,a)=>[r[Bc(r,o=>a[o])]],median:(r,i,a)=>[r[hnt(r,o=>a[o])]]},n=e[t]||e.median;return(r,i,a,o)=>{const s=Math.max(1,Math.floor(r.length/o));return Unt(r,s).flatMap(l=>n(l,i,a))}}function Unt(t,e){const n=t.length,r=[];let i=0;for(;i{const{strategy:e="median",thresholds:n=2e3,groupBy:r=["series","color"]}=t,i=Vnt(e);return(a,o)=>{const{encode:s}=o,c=Do(r,a,o),[l]=Le(s,"x"),[u]=Le(s,"y");return[c.flatMap(f=>i(f,l,u,n)),o]}};_3.props={};function Xnt(t){return typeof t=="object"?[t.value,t.ordinal]:[t,!0]}const x3=(t={})=>(e,n)=>{const{encode:r,data:i}=n,a=Object.entries(t).map(([u,f])=>{const[d]=Le(r,u);if(!d)return null;const[h,p=!0]=Xnt(f);if(typeof h=="function")return v=>h(d[v]);if(p){const v=Array.isArray(h)?h:[h];return v.length===0?null:g=>v.includes(d[g])}else{const[v,g]=h;return y=>d[y]>=v&&d[y]<=g}}).filter(un);if(a.length===0)return[e,n];const o=u=>a.every(f=>f(u)),s=e.filter(o),c=s.map((u,f)=>f),l=Object.entries(r).map(([u,f])=>[u,Object.assign(Object.assign({},f),{value:c.map(d=>f.value[s[d]]).filter(d=>d!==void 0)})]);return[c,at({},n,{encode:Object.fromEntries(l),data:s.map(u=>i[u])})]};x3.props={};var O3={},Zm={},Km=34,Ju=10,Qm=13;function w3(t){return new Function("d","return {"+t.map(function(e,n){return JSON.stringify(e)+": d["+n+'] || ""'}).join(",")+"}")}function qnt(t,e){var n=w3(t);return function(r,i){return e(n(r),i,t)}}function S3(t){var e=Object.create(null),n=[];return t.forEach(function(r){for(var i in r)i in e||n.push(e[i]=i)}),n}function vi(t,e){var n=t+"",r=n.length;return r9999?"+"+vi(t,6):vi(t,4)}function Knt(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":Znt(t.getUTCFullYear(),4)+"-"+vi(t.getUTCMonth()+1,2)+"-"+vi(t.getUTCDate(),2)+(i?"T"+vi(e,2)+":"+vi(n,2)+":"+vi(r,2)+"."+vi(i,3)+"Z":r?"T"+vi(e,2)+":"+vi(n,2)+":"+vi(r,2)+"Z":n||e?"T"+vi(e,2)+":"+vi(n,2)+"Z":"")}function Qnt(t){var e=new RegExp('["'+t+` \r]`),n=t.charCodeAt(0);function r(f,d){var h,p,v=i(f,function(g,y){if(h)return h(g,y-1);p=g,h=d?qnt(g,d):w3(g)});return v.columns=p||[],v}function i(f,d){var h=[],p=f.length,v=0,g=0,y,m=p<=0,b=!1;f.charCodeAt(p-1)===Ju&&--p,f.charCodeAt(p-1)===Qm&&--p;function _(){if(m)return Zm;if(b)return b=!1,O3;var O,w=v,S;if(f.charCodeAt(w)===Km){for(;v++=p?m=!0:(S=f.charCodeAt(v++))===Ju?b=!0:S===Qm&&(b=!0,f.charCodeAt(v)===Ju&&++v),f.slice(w+1,O-1).replace(/""/g,'"')}for(;v{const{value:e,format:n=e.split(".").pop(),delimiter:r=",",autoType:i=!0}=t;return()=>ert(void 0,void 0,void 0,function*(){const a=yield fetch(e);if(n==="csv"){const o=yield a.text();return Qnt(r).parse(o,i?Jnt:bs)}else if(n==="json")return yield a.json();throw new Error(`Unknown format: ${n}.`)})};M3.props={};const E3=t=>{const{value:e}=t;return()=>e};E3.props={};function nrt(t,e){return t.map(n=>{if(Array.isArray(n)){const[r,i=e]=n;return[r,i]}return[n,e]})}const A3=t=>{const{fields:e=[]}=t,n=nrt(e,!0);return r=>{const i=(a,o)=>n.reduce((s,[c,l=!0])=>s!==0?s:l?a[c]o[c]?-1:+(a[c]!==o[c]),0);return[...r].sort(i)}};A3.props={};function r1t(t){return t!=null&&!Number.isNaN(t)}const P3=t=>{const{callback:e}=t;return n=>Array.isArray(n)?[...n].sort(e):n};P3.props={};function rrt(t){return t!=null&&!Number.isNaN(t)}const T3=t=>{const{callback:e=rrt}=t;return n=>n.filter(e)};T3.props={};function irt(t,e=[]){return e.reduce((n,r)=>(r in t&&(n[r]=t[r]),n),{})}const k3=t=>{const{fields:e}=t;return n=>n.map(r=>irt(r,e))};k3.props={};function art(t){return Object.keys(t).length===0}const C3=t=>e=>{if(!t||art(t))return e;const n=r=>Object.entries(r).reduce((i,[a,o])=>(i[t[a]||a]=o,i),{});return e.map(n)};C3.props={};function ort(t){return!t||Object.keys(t).length===0}const L3=t=>{const{fields:e,key:n="key",value:r="value"}=t;return i=>ort(e)?i:i.flatMap(a=>e.map(o=>Object.assign(Object.assign({},a),{[n]:o,[r]:a[o]})))};L3.props={};const N3=t=>{const{start:e,end:n}=t;return r=>r.slice(e,n)};N3.props={};const j3=t=>{const{callback:e=bs}=t;return n=>e(n)};j3.props={};const R3=t=>{const{callback:e=bs}=t;return n=>Array.isArray(n)?n.map(e):n};R3.props={};function I3(t){return typeof t=="string"?e=>e[t]:t}const D3=t=>{const{join:e,on:n,select:r=[],as:i=r,unknown:a=NaN}=t,[o,s]=n,c=I3(s),l=I3(o),u=tg(e,([f])=>f,f=>c(f));return f=>f.map(d=>{const h=u.get(l(d));return Object.assign(Object.assign({},d),r.reduce((p,v,g)=>(p[i[g]]=h?h[v]:a,p),{}))})};D3.props={};var srt=tt(53843),crt=tt.n(srt);function i1t(t){return t!=null&&!Number.isNaN(t)}const F3=t=>{const{field:e,groupBy:n,as:r=["y","size"],min:i,max:a,size:o=10,width:s}=t,[c,l]=r;return u=>Array.from(Cn(u,d=>n.map(h=>d[h]).join("-")).values()).map(d=>{const h=crt().create(d.map(g=>g[e]),{min:i,max:a,size:o,width:s}),p=h.map(g=>g.x),v=h.map(g=>g.y);return Object.assign(Object.assign({},d[0]),{[c]:p,[l]:v})})};F3.props={};const B3=()=>t=>(console.log("G2 data section:",t),t);B3.props={};var lrt=function(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{l(r.next(u))}catch(f){o(f)}}function c(u){try{l(r.throw(u))}catch(f){o(f)}}function l(u){u.done?a(u.value):i(u.value).then(s,c)}l((r=r.apply(t,e||[])).next())})};function urt(t,e){return{set(n,r,i){if(e[n]===void 0)return this;const a=r?r.call(null,e[n]):e[n];return i?i.call(null,a):typeof t[n]=="function"?t[n](a):t[n]=a,this},setAsync(n,r,i){return lrt(this,void 0,void 0,function*(){if(e[n]===void 0)return this;const a=r?yield r.call(null,e[n]):e[n];return i?i.call(null,a):typeof t[n]=="function"?t[n](a):t[n]=a,this})}}}const Jm=Math.PI/180,tf=64,bp=2048;function frt(t){return t.text}function drt(){return"serif"}function z3(){return"normal"}function hrt(t){return t.value}function prt(){return~~(Math.random()*2)*90}function vrt(){return 1}function grt(){}function yrt(t,e,n,r){if(e.sprite)return;const i=t.context,a=t.ratio;i.clearRect(0,0,(tf<<5)/a,bp/a);let o=0,s=0,c=0;const l=n.length;for(--r;++r>5<<5,h=~~Math.max(Math.abs(y+m),Math.abs(y-m))}else d=d+31>>5<<5;if(h>c&&(c=h),o+d>=tf<<5&&(o=0,s+=c,c=0),s+h>=bp)break;i.translate((o+(d>>1))/a,(s+(h>>1))/a),e.rotate&&i.rotate(e.rotate*Jm),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=d,e.height=h,e.xoff=o,e.yoff=s,e.x1=d>>1,e.y1=h>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,o+=d}const u=i.getImageData(0,0,(tf<<5)/a,bp/a).data,f=[];for(;--r>=0;){if(e=n[r],!e.hasText)continue;const d=e.width,h=d>>5;let p=e.y1-e.y0;for(let y=0;y>5),_=u[(s+y)*(tf<<5)+(o+m)<<2]?1<<31-m%32:0;f[b]|=_,v|=_}v?g=y:(e.y0++,p--,y--,s++)}e.y1=e.y0+g,e.sprite=f.slice(0,(e.y1-e.y0)*h)}}function mrt(t,e,n){n>>=5;const r=t.sprite,i=t.width>>5,a=t.x-(i<<4),o=a&127,s=32-o,c=t.y1-t.y0;let l=(t.y+t.y0)*n+(a>>5),u;for(let f=0;f>>o:0))&e[l+d])return!0;l+=n}return!1}function brt(t,e){const n=t[0],r=t[1];e.x+e.x0r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}function _rt(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0e[0].y&&t.y+t.y0>5)*t[1]),O=u.length,w=[],S=u.map(function(C,P,T){return C.text=e.call(this,C,P,T),C.font=n.call(this,C,P,T),C.style=h.call(this,C,P,T),C.weight=i.call(this,C,P,T),C.rotate=a.call(this,C,P,T),C.size=~~r.call(this,C,P,T),C.padding=o.call(this,C,P,T),C}).sort(function(C,P){return P.size-C.size});let M=-1,E=v.board?[{x:0,y:0},{x:m,y:b}]:void 0;f&&clearInterval(f),f=setInterval(A,0),A();function A(){const C=Date.now();for(;Date.now()-C>1,P.y=b*(c()+.5)>>1,yrt(_,P,S,M),P.hasText&&y(x,P,E)&&(l.call(null,"word",{cloud:v,word:P}),w.push(P),E?v.hasImage||brt(E,P):E=[{x:P.x+P.x0,y:P.y+P.y0},{x:P.x+P.x1,y:P.y+P.y1}],P.x-=t[0]>>1,P.y-=t[1]>>1)}v._tags=w,v._bounds=E,M>=O&&(v.stop(),l.call(null,"end",{cloud:v,words:w,bounds:E}))}return v},v.stop=function(){return f&&(clearInterval(f),f=null),v};function g(m){m.width=m.height=1;const b=Math.sqrt(m.getContext("2d").getImageData(0,0,1,1).data.length>>2);m.width=(tf<<5)/b,m.height=bp/b;const _=m.getContext("2d");return _.fillStyle=_.strokeStyle="red",_.textAlign="center",_.textBaseline="middle",{context:_,ratio:b}}function y(m,b,_){const x=b.x,O=b.y,w=Math.sqrt(t[0]*t[0]+t[1]*t[1]),S=s(t),M=c()<.5?1:-1;let E,A=-M,C,P;for(;(E=S(A+=M))&&(C=~~E[0],P=~~E[1],!(Math.min(Math.abs(C),Math.abs(P))>=w));)if(b.x=x+C,b.y=O+P,!(b.x+b.x0<0||b.y+b.y0<0||b.x+b.x1>t[0]||b.y+b.y1>t[1])&&(!_||!mrt(b,m,t[0]))&&(!_||_rt(b,_))){const T=b.sprite,k=b.width>>5,N=t[0]>>5,F=b.x-(k<<4),R=F&127,I=32-R,z=b.y1-b.y0;let W,V=(b.y+b.y0)*N+(F>>5);for(let $=0;$>>R:0);V+=N}return delete b.sprite,!0}return!1}return v.createMask=m=>{const b=document.createElement("canvas"),[_,x]=t;if(!_||!x)return;const O=_>>5,w=W3((_>>5)*x);b.width=_,b.height=x;const S=b.getContext("2d");S.drawImage(m,0,0,m.width,m.height,0,0,_,x);const M=S.getImageData(0,0,_,x).data;for(let E=0;E>5),P=E*_+A<<2,k=M[P]>=250&&M[P+1]>=250&&M[P+2]>=250?1<<31-A%32:0;w[C]|=k}v.board=w,v.hasImage=!0},v.timeInterval=function(m){d=m==null?1/0:m},v.words=function(m){u=m},v.size=function(m=[]){t=[+m[0],+m[1]]},v.text=function(m){e=Bo(m)},v.font=function(m){n=Bo(m)},v.fontWeight=function(m){i=Bo(m)},v.rotate=function(m){a=Bo(m)},v.spiral=function(m){s=wrt[m]||m},v.fontSize=function(m){r=Bo(m)},v.padding=function(m){o=Bo(m)},v.random=function(m){c=Bo(m)},v.on=function(m){l=Bo(m)},v}var Mrt=function(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{l(r.next(u))}catch(f){o(f)}}function c(u){try{l(r.throw(u))}catch(f){o(f)}}function l(u){u.done?a(u.value):i(u.value).then(s,c)}l((r=r.apply(t,e||[])).next())})},Ert=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{if(t instanceof HTMLImageElement){e(t);return}if(typeof t=="string"){const r=new Image;r.crossOrigin="anonymous",r.src=t,r.onload=()=>e(r),r.onerror=()=>{console.error(`'image ${t} load failed !!!'`),n()};return}n()})}function Trt(t,e){if(typeof t=="function")return t;if(Array.isArray(t)){const[n,r]=t;if(!e)return()=>(r+n)/2;const[i,a]=e;return a===i?()=>(r+n)/2:({value:o})=>(r-n)/(a-i)*(o-i)+n}return()=>t}const Y3=t=>e=>Mrt(void 0,void 0,void 0,function*(){const n=Object.assign({},Art,t),r=Srt();yield urt(r,n).set("fontSize",y=>{const m=e.map(b=>b.value);return Trt(y,[Oi(m),Ke(m)])}).set("font").set("fontStyle").set("fontWeight").set("padding").set("rotate").set("size").set("spiral").set("timeInterval").set("random").set("text").set("on").setAsync("imageMask",Prt,r.createMask),r.words([...e]);const i=r.start(),[a,o]=n.size,s=[{x:0,y:0},{x:a,y:o}],{_bounds:c=s,_tags:l,hasImage:u}=i,f=l.map(y=>{var{x:m,y:b,font:_}=y,x=Ert(y,["x","y","font"]);return Object.assign(Object.assign({},x),{x:m+a/2,y:b+o/2,fontFamily:_})}),[{x:d,y:h},{x:p,y:v}]=c,g={text:"",value:0,opacity:0,fontSize:0};return f.push(Object.assign(Object.assign({},g),{x:u?0:d,y:u?0:h}),Object.assign(Object.assign({},g),{x:u?a:p,y:u?o:v})),f});Y3.props={};function t1(t){const{min:e,max:n}=t;return[[e[0],e[1]],[n[0],n[1]]]}function H3(t,e){const[n,r]=t,[i,a]=e;return n>=i[0]&&n<=a[0]&&r>=i[1]&&r<=a[1]}function krt(t,e){const[n,r]=t;return!(H3(n,e)&&H3(r,e))}function Crt(t,e){const[n,r]=t,[i,a]=e;return n[0]i[0]&&n[1]i[1]}const Lrt=t=>{const{priority:e}=t;return n=>{const r=[];return e&&n.sort(e),n.forEach(i=>{xh(i);const a=i.getLocalBounds();r.some(s=>Crt(t1(a),t1(s.getLocalBounds())))?Kg(i):r.push(i)}),n}};function Nrt([t,e],[n,r]){return r>t&&e>n}function _p(){const t=new Map;return[r=>t.get(r),(r,i)=>t.set(r,i)]}function jrt(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 Rrt=t=>{const{maxIterations:e=10,maxError:n=.1,padding:r=1}=t;return i=>{const a=i.length;if(a<=1)return i;const[o,s]=_p(),[c,l]=_p(),[u,f]=_p(),[d,h]=_p();for(const p of i){const{min:v,max:g}=jrt(p),[y,m]=v,[b,_]=g;s(p,m),l(p,m),f(p,_-m),h(p,[y,b])}for(let p=0;pGn(c(g),c(y)));let v=0;for(let g=0;gt=>(t.forEach(e=>{xh(e);const n=e.attr("bounds"),r=e.getLocalBounds();krt(t1(r),n)&&Kg(e)}),t);function Drt(t){return typeof t=="object"?t:Ia(t)}function e1(t){let e=t/255;return e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),e}function $3(t,e,n){return .2126*e1(t)+.7152*e1(e)+.0722*e1(n)}function V3(t,e){const{r:n,g:r,b:i}=t,{r:a,g:o,b:s}=e,c=$3(n,r,i),l=$3(a,o,s);return(Math.max(c,l)+.05)/(Math.min(c,l)+.05)}function Frt(t,e){const n=Bc(e,r=>V3(t,Drt(r)));return e[n]}const Brt=t=>{const{threshold:e=4.5,palette:n=["#000","#fff"]}=t;return r=>(r.forEach(i=>{const a=i.attr("dependentElement").parsedStyle.fill,o=i.parsedStyle.fill;V3(o,a){const[[n,r],[i,a]]=e,[[o,s],[c,l]]=t;let u=0,f=0;return oi&&(u=i-c),sa&&(f=a-l),[u,f]},Grt=()=>(t,{canvas:e})=>{const{width:n,height:r}=e.getConfig();return t.forEach(i=>{xh(i);const{max:a,min:o}=i.getRenderBounds(),[s,c]=a,[l,u]=o,f=zrt([[l,u],[s,c]],[[0,0],[n,r]]);i.style.x+=f[0],i.style.y+=f[1]}),t};function Wrt(){return{"data.fetch":M3,"data.inline":E3,"data.sortBy":A3,"data.sort":P3,"data.filter":T3,"data.pick":k3,"data.rename":C3,"data.fold":L3,"data.slice":N3,"data.custom":j3,"data.map":R3,"data.join":D3,"data.kde":F3,"data.log":B3,"data.wordCloud":Y3,"transform.stackY":XC,"transform.binX":JC,"transform.bin":qm,"transform.dodgeX":t3,"transform.jitter":e3,"transform.jitterX":n3,"transform.jitterY":r3,"transform.symmetryY":i3,"transform.diffY":a3,"transform.stackEnter":o3,"transform.normalizeY":s3,"transform.select":yp,"transform.selectX":l3,"transform.selectY":u3,"transform.groupX":f3,"transform.groupY":d3,"transform.groupColor":h3,"transform.group":Qu,"transform.sortX":v3,"transform.sortY":g3,"transform.sortColor":y3,"transform.flexX":m3,"transform.pack":b3,"transform.sample":_3,"transform.filter":x3,"coordinate.cartesian":SE,"coordinate.polar":eu,"coordinate.transpose":Ay,"coordinate.theta":ME,"coordinate.parallel":Py,"coordinate.fisheye":EE,"coordinate.radial":lg,"coordinate.radar":AE,"encode.constant":PE,"encode.field":TE,"encode.transform":kE,"encode.column":CE,"mark.interval":BE,"mark.rect":GE,"mark.line":hA,"mark.point":rP,"mark.text":lP,"mark.cell":fP,"mark.area":bP,"mark.link":Jy,"mark.image":NP,"mark.polygon":FP,"mark.box":WP,"mark.vector":HP,"mark.lineX":XP,"mark.lineY":KP,"mark.connector":eT,"mark.range":iT,"mark.rangeX":sT,"mark.rangeY":uT,"mark.path":vT,"mark.shape":mT,"mark.density":xT,"mark.heatmap":MT,"mark.wordCloud":rm,"palette.category10":ET,"palette.category20":AT,"scale.linear":PT,"scale.ordinal":LT,"scale.band":RT,"scale.identity":IT,"scale.point":DT,"scale.time":ak,"scale.log":sk,"scale.pow":ck,"scale.sqrt":lk,"scale.threshold":uk,"scale.quantile":fk,"scale.quantize":dk,"scale.sequential":hk,"scale.constant":pk,"theme.classic":vk,"theme.classicDark":yk,"theme.academy":mk,"theme.light":hm,"theme.dark":gk,"component.axisX":bk,"component.axisY":_k,"component.legendCategory":vm,"component.legendContinuous":So,"component.legends":Ok,"component.title":Sk,"component.sliderX":Pk,"component.sliderY":Tk,"component.scrollbarX":kk,"component.scrollbarY":Ck,"animation.scaleInX":bm,"animation.scaleOutX":LJ,"animation.scaleInY":Lk,"animation.scaleOutY":NJ,"animation.waveIn":Nk,"animation.fadeIn":jk,"animation.fadeOut":Rk,"animation.zoomIn":jJ,"animation.zoomOut":RJ,"animation.pathIn":Ik,"animation.morphing":zk,"animation.growInX":Gk,"animation.growInY":Wk,"interaction.elementHighlight":ip,"interaction.elementHighlightByX":Yk,"interaction.elementHighlightByColor":Hk,"interaction.elementSelect":ap,"interaction.elementSelectByX":$k,"interaction.elementSelectByColor":Vk,"interaction.fisheye":KJ,"interaction.chartIndex":Uk,"interaction.tooltip":oC,"interaction.legendFilter":Stt,"interaction.legendHighlight":Mtt,"interaction.brushHighlight":Tm,"interaction.brushXHighlight":Ctt,"interaction.brushYHighlight":Ltt,"interaction.brushAxisHighlight":Gtt,"interaction.brushFilter":Nm,"interaction.brushXFilter":$tt,"interaction.brushYFilter":Vtt,"interaction.sliderFilter":bC,"interaction.scrollbarFilter":Ktt,"interaction.poptip":OC,"interaction.treemapDrillDown":bet,"interaction.elementPointMove":Eet,"composition.spaceLayer":DC,"composition.spaceFlex":FC,"composition.facetRect":WC,"composition.repeatMatrix":Bet,"composition.facetCircle":$et,"composition.timingKeyframe":HC,"labelTransform.overlapHide":Lrt,"labelTransform.overlapDodgeY":Rrt,"labelTransform.overflowHide":Irt,"labelTransform.contrastReverse":Brt,"labelTransform.exceedAdjust":Grt}}var ef=t=>t;function xp(t,e){t&&X3.hasOwnProperty(t.type)&&X3[t.type](t,e)}var U3={Feature:function(t,e){xp(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r0){for(o=e[--n];n>0&&(r=o,i=e[--n],o=r+i,a=i-(o-r),!a););n>0&&(a<0&&e[n-1]<0||a>0&&e[n-1]>0)&&(i=a*2,r=o+i,i==r-o&&(o=r))}return o}}function a1t(t,e){const n=new Za;if(e===void 0)for(let r of t)(r=+r)&&n.add(r);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&n.add(i)}return+n}function o1t(t,e){const n=new Za;let r=-1;return Float64Array.from(t,e===void 0?i=>n.add(+i||0):i=>n.add(+e(i,++r,t)||0))}var se=1e-6,Z3=1e-12,Te=Math.PI,qn=Te/2,K3=Te/4,Si=Te*2,Wr=180/Te,Wn=Te/180,$e=Math.abs,al=Math.atan,Ka=Math.atan2,Me=Math.cos,Op=Math.ceil,Q3=Math.exp,s1t=Math.floor,c1t=Math.hypot,wp=Math.log,r1=Math.pow,ge=Math.sin,$i=Math.sign||function(t){return t>0?1:t<0?-1:0},gi=Math.sqrt,i1=Math.tan;function J3(t){return t>1?0:t<-1?Te:Math.acos(t)}function Vi(t){return t>1?qn:t<-1?-qn:Math.asin(t)}function l1t(t){return(t=ge(t/2))*t}function Ui(){}var a1=new Za,o1=new Za,t5,e5,s1,c1,zo={point:Ui,lineStart:Ui,lineEnd:Ui,polygonStart:function(){zo.lineStart=Yrt,zo.lineEnd=$rt},polygonEnd:function(){zo.lineStart=zo.lineEnd=zo.point=Ui,a1.add($e(o1)),o1=new Za},result:function(){var t=a1/2;return a1=new Za,t}};function Yrt(){zo.point=Hrt}function Hrt(t,e){zo.point=n5,t5=s1=t,e5=c1=e}function n5(t,e){o1.add(c1*t-s1*e),s1=t,c1=e}function $rt(){n5(t5,e5)}var r5=zo,ol=1/0,Sp=ol,nf=-ol,Mp=nf,Vrt={point:Urt,lineStart:Ui,lineEnd:Ui,polygonStart:Ui,polygonEnd:Ui,result:function(){var t=[[ol,Sp],[nf,Mp]];return nf=Mp=-(Sp=ol=1/0),t}};function Urt(t,e){tnf&&(nf=t),eMp&&(Mp=e)}var Ep=Vrt,l1=0,u1=0,rf=0,Ap=0,Pp=0,sl=0,f1=0,d1=0,af=0,i5,a5,Ta,ka,ra={point:Gs,lineStart:o5,lineEnd:s5,polygonStart:function(){ra.lineStart=Zrt,ra.lineEnd=Krt},polygonEnd:function(){ra.point=Gs,ra.lineStart=o5,ra.lineEnd=s5},result:function(){var t=af?[f1/af,d1/af]:sl?[Ap/sl,Pp/sl]:rf?[l1/rf,u1/rf]:[NaN,NaN];return l1=u1=rf=Ap=Pp=sl=f1=d1=af=0,t}};function Gs(t,e){l1+=t,u1+=e,++rf}function o5(){ra.point=Xrt}function Xrt(t,e){ra.point=qrt,Gs(Ta=t,ka=e)}function qrt(t,e){var n=t-Ta,r=e-ka,i=gi(n*n+r*r);Ap+=i*(Ta+t)/2,Pp+=i*(ka+e)/2,sl+=i,Gs(Ta=t,ka=e)}function s5(){ra.point=Gs}function Zrt(){ra.point=Qrt}function Krt(){c5(i5,a5)}function Qrt(t,e){ra.point=c5,Gs(i5=Ta=t,a5=ka=e)}function c5(t,e){var n=t-Ta,r=e-ka,i=gi(n*n+r*r);Ap+=i*(Ta+t)/2,Pp+=i*(ka+e)/2,sl+=i,i=ka*t-Ta*e,f1+=i*(Ta+t),d1+=i*(ka+e),af+=i*3,Gs(Ta=t,ka=e)}var l5=ra;function u5(t){this._context=t}u5.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(){this._line===0&&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,Si);break}}},result:Ui};var h1=new Za,p1,f5,d5,of,sf,Tp={point:Ui,lineStart:function(){Tp.point=Jrt},lineEnd:function(){p1&&h5(f5,d5),Tp.point=Ui},polygonStart:function(){p1=!0},polygonEnd:function(){p1=null},result:function(){var t=+h1;return h1=new Za,t}};function Jrt(t,e){Tp.point=h5,f5=of=t,d5=sf=e}function h5(t,e){of-=t,sf-=e,h1.add(gi(of*of+sf*sf)),of=t,sf=e}var p5=Tp;let v5,kp,g5,y5;class m5{constructor(e){this._append=e==null?b5:tit(e),this._radius=4.5,this._=""}pointRadius(e){return this._radius=+e,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(e,n){switch(this._point){case 0:{this._append`M${e},${n}`,this._point=1;break}case 1:{this._append`L${e},${n}`;break}default:{if(this._append`M${e},${n}`,this._radius!==g5||this._append!==kp){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,g5=r,kp=this._append,y5=this._,this._=i}this._+=y5;break}}}result(){const e=this._;return this._="",e.length?e:null}}function b5(t){let e=1;this._+=t[0];for(const n=t.length;e=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return b5;if(e!==v5){const n=ir(10,e);v5=e,kp=function(i){let a=1;this._+=i[0];for(const o=i.length;a=0))throw new RangeError(`invalid digits: ${s}`);n=c}return e===null&&(a=new m5(n)),o},o.projection(t).digits(n).context(e)}function cl(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=Math.max(0,Math.ceil((e-t)/n))|0,a=new Array(i);++rse}).map(d)).concat(cl(Op(a/l)*l,i,l).filter(function(b){return $e(b%f)>se}).map(h))}return y.lines=function(){return m().map(function(b){return{type:"LineString",coordinates:b}})},y.outline=function(){return{type:"Polygon",coordinates:[p(r).concat(v(o).slice(1),p(n).reverse().slice(1),v(s).reverse().slice(1))]}},y.extent=function(b){return arguments.length?y.extentMajor(b).extentMinor(b):y.extentMinor()},y.extentMajor=function(b){return arguments.length?(r=+b[0][0],n=+b[1][0],s=+b[0][1],o=+b[1][1],r>n&&(b=r,r=n,n=b),s>o&&(b=s,s=o,o=b),y.precision(g)):[[r,s],[n,o]]},y.extentMinor=function(b){return arguments.length?(e=+b[0][0],t=+b[1][0],a=+b[0][1],i=+b[1][1],e>t&&(b=e,e=t,t=b),a>i&&(b=a,a=i,i=b),y.precision(g)):[[e,a],[t,i]]},y.step=function(b){return arguments.length?y.stepMajor(b).stepMinor(b):y.stepMinor()},y.stepMajor=function(b){return arguments.length?(u=+b[0],f=+b[1],y):[u,f]},y.stepMinor=function(b){return arguments.length?(c=+b[0],l=+b[1],y):[c,l]},y.precision=function(b){return arguments.length?(g=+b,d=x5(a,i,90),h=O5(e,t,g),p=x5(s,o,90),v=O5(r,n,g),y):g},y.extentMajor([[-180,-90+se],[180,90-se]]).extentMinor([[-180,-80-se],[180,80+se]])}function nit(){return eit()()}function w5(){var t=[],e;return{point:function(n,r,i){e.push([n,r,i])},lineStart:function(){t.push(e=[])},lineEnd:Ui,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function Cp(t,e){return $e(t[0]-e[0])=0;--s)i.point((f=u[s])[0],f[1]);else r(d.x,d.p.x,-1,i);d=d.p}d=d.o,u=d.z,h=!h}while(!d.v);i.lineEnd()}}}function M5(t){if(e=t.length){for(var e,n=0,r=t[0],i;++n=0?1:-1,E=M*S,A=E>Te,C=g*O;if(c.add(Ka(C*M*ge(E),y*w+C*Me(E))),o+=A?S+M*Si:S,A^p>=n^_>=n){var P=jp(ll(h),ll(b));y1(P);var T=jp(a,P);y1(T);var k=(A^S>=0?-1:1)*Vi(T[2]);(r>k||r===k&&(P[0]||P[1]))&&(s+=A^S>=0?1:-1)}}return(o<-se||o0){for(c||(i.polygonStart(),c=!0),i.lineStart(),O=0;O1&&_&2&&x.push(x.pop().concat(x.shift())),u.push(x.filter(ait))}}return d}}function ait(t){return t.length>1}function oit(t,e){return((t=t.x)[0]<0?t[1]-qn-se:qn-t[1])-((e=e.x)[0]<0?e[1]-qn-se:qn-e[1])}var P5=A5(function(){return!0},sit,lit,[-Te,-qn]);function sit(t){var e=NaN,n=NaN,r=NaN,i;return{lineStart:function(){t.lineStart(),i=1},point:function(a,o){var s=a>0?Te:-Te,c=$e(a-e);$e(c-Te)0?qn:-qn),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),i=0):r!==s&&c>=Te&&($e(e-r)se?al((ge(e)*(a=Me(r))*ge(n)-ge(r)*(i=Me(e))*ge(t))/(i*a*o)):(e+r)/2}function lit(t,e,n,r){var i;if(t==null)i=n*qn,r.point(-Te,i),r.point(0,i),r.point(Te,i),r.point(Te,0),r.point(Te,-i),r.point(0,-i),r.point(-Te,-i),r.point(-Te,0),r.point(-Te,i);else if($e(t[0]-e[0])>se){var a=t[0]0?ia)&&(i+=r*Si));for(var l,u=i;r>0?u>a:u0,i=$e(e)>se;function a(u,f,d,h){T5(h,t,n,d,u,f)}function o(u,f){return Me(u)*Me(f)>e}function s(u){var f,d,h,p,v;return{lineStart:function(){p=h=!1,v=1},point:function(g,y){var m=[g,y],b,_=o(g,y),x=r?_?0:l(g,y):_?l(g+(g<0?Te:-Te),y):0;if(!f&&(p=h=_)&&u.lineStart(),_!==h&&(b=c(f,m),(!b||Cp(f,b)||Cp(m,b))&&(m[2]=1)),_!==h)v=0,_?(u.lineStart(),b=c(m,f),u.point(b[0],b[1])):(b=c(f,m),u.point(b[0],b[1],2),u.lineEnd()),f=b;else if(i&&f&&r^_){var O;!(x&d)&&(O=c(m,f,!0))&&(v=0,r?(u.lineStart(),u.point(O[0][0],O[0][1]),u.point(O[1][0],O[1][1]),u.lineEnd()):(u.point(O[1][0],O[1][1]),u.lineEnd(),u.lineStart(),u.point(O[0][0],O[0][1],3)))}_&&(!f||!Cp(f,m))&&u.point(m[0],m[1]),f=m,h=_,d=x},lineEnd:function(){h&&u.lineEnd(),f=null},clean:function(){return v|(p&&h)<<1}}}function c(u,f,d){var h=ll(u),p=ll(f),v=[1,0,0],g=jp(h,p),y=Np(g,g),m=g[0],b=y-m*m;if(!b)return!d&&u;var _=e*y/b,x=-e*m/b,O=jp(v,g),w=Rp(v,_),S=Rp(g,x);g1(w,S);var M=O,E=Np(w,M),A=Np(M,M),C=E*E-A*(Np(w,w)-1);if(!(C<0)){var P=gi(C),T=Rp(M,(-E-P)/A);if(g1(T,w),T=v1(T),!d)return T;var k=u[0],N=f[0],F=u[1],R=f[1],I;N0^T[1]<($e(T[0]-k)Te^(k<=T[0]&&T[0]<=N)){var $=Rp(M,(-E+P)/A);return g1($,w),[T,v1($)]}}}function l(u,f){var d=r?t:Te-t,h=0;return u<-d?h|=1:u>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return A5(o,s,a,r?[0,-t]:[-Te,t-Te])}function fit(t,e,n,r,i,a){var o=t[0],s=t[1],c=e[0],l=e[1],u=0,f=1,d=c-o,h=l-s,p;if(p=n-o,!(!d&&p>0)){if(p/=d,d<0){if(p0){if(p>f)return;p>u&&(u=p)}if(p=i-o,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>u&&(u=p)}else if(d>0){if(p0)){if(p/=h,h<0){if(p0){if(p>f)return;p>u&&(u=p)}if(p=a-s,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>u&&(u=p)}else if(h>0){if(p0&&(t[0]=o+u*d,t[1]=s+u*h),f<1&&(e[0]=o+f*d,e[1]=s+f*h),!0}}}}}var cf=1e9,Ip=-cf;function C5(t,e,n,r){function i(l,u){return t<=l&&l<=n&&e<=u&&u<=r}function a(l,u,f,d){var h=0,p=0;if(l==null||(h=o(l,f))!==(p=o(u,f))||c(l,u)<0^f>0)do d.point(h===0||h===3?t:n,h>1?r:e);while((h=(h+f+4)%4)!==p);else d.point(u[0],u[1])}function o(l,u){return $e(l[0]-t)0?0:3:$e(l[0]-n)0?2:1:$e(l[1]-e)0?1:0:u>0?3:2}function s(l,u){return c(l.x,u.x)}function c(l,u){var f=o(l,1),d=o(u,1);return f!==d?f-d:f===0?u[1]-l[1]:f===1?l[0]-u[0]:f===2?l[1]-u[1]:u[0]-l[0]}return function(l){var u=l,f=w5(),d,h,p,v,g,y,m,b,_,x,O,w={point:S,lineStart:C,lineEnd:P,polygonStart:E,polygonEnd:A};function S(k,N){i(k,N)&&u.point(k,N)}function M(){for(var k=0,N=0,F=h.length;Nr&&(J-V)*(r-$)>(ct-$)*(t-V)&&++k:ct<=r&&(J-V)*(r-$)<(ct-$)*(t-V)&&--k;return k}function E(){u=f,d=[],h=[],O=!0}function A(){var k=M(),N=O&&k,F=(d=E5(d)).length;(N||F)&&(l.polygonStart(),N&&(l.lineStart(),a(null,null,1,l),l.lineEnd()),F&&S5(d,s,k,a,l),l.polygonEnd()),u=l,d=h=p=null}function C(){w.point=T,h&&h.push(p=[]),x=!0,_=!1,m=b=NaN}function P(){d&&(T(v,g),y&&_&&f.rejoin(),d.push(f.result())),w.point=S,_&&u.lineEnd()}function T(k,N){var F=i(k,N);if(h&&p.push([k,N]),x)v=k,g=N,y=F,x=!1,F&&(u.lineStart(),u.point(k,N));else if(F&&_)u.point(k,N);else{var R=[m=Math.max(Ip,Math.min(cf,m)),b=Math.max(Ip,Math.min(cf,b))],I=[k=Math.max(Ip,Math.min(cf,k)),N=Math.max(Ip,Math.min(cf,N))];fit(R,I,t,e,n,r)?(_||(u.lineStart(),u.point(R[0],R[1])),u.point(I[0],I[1]),F||u.lineEnd(),O=!1):F&&(u.lineStart(),u.point(k,N),O=!1)}m=k,b=N,_=F}return w}}function b1(t,e){function n(r,i){return r=t(r,i),e(r[0],r[1])}return t.invert&&e.invert&&(n.invert=function(r,i){return r=e.invert(r,i),r&&t.invert(r[0],r[1])}),n}function _1(t,e){return $e(t)>Te&&(t-=Math.round(t/Si)*Si),[t,e]}_1.invert=_1;function L5(t,e,n){return(t%=Si)?e||n?b1(j5(t),R5(e,n)):j5(t):e||n?R5(e,n):_1}function N5(t){return function(e,n){return e+=t,$e(e)>Te&&(e-=Math.round(e/Si)*Si),[e,n]}}function j5(t){var e=N5(t);return e.invert=N5(-t),e}function R5(t,e){var n=Me(t),r=ge(t),i=Me(e),a=ge(e);function o(s,c){var l=Me(c),u=Me(s)*l,f=ge(s)*l,d=ge(c),h=d*n+u*r;return[Ka(f*i-h*a,u*n-d*r),Vi(h*i+f*a)]}return o.invert=function(s,c){var l=Me(c),u=Me(s)*l,f=ge(s)*l,d=ge(c),h=d*i-f*a;return[Ka(f*i+d*a,u*n+h*r),Vi(h*n-u*r)]},o}function dit(t){t=L5(t[0]*Wn,t[1]*Wn,t.length>2?t[2]*Wn:0);function e(n){return n=t(n[0]*Wn,n[1]*Wn),n[0]*=Wr,n[1]*=Wr,n}return e.invert=function(n){return n=t.invert(n[0]*Wn,n[1]*Wn),n[0]*=Wr,n[1]*=Wr,n},e}function f1t(t){return{stream:lf(t)}}function lf(t){return function(e){var n=new x1;for(var r in t)n[r]=t[r];return n.stream=e,n}}function x1(){}x1.prototype={constructor:x1,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()}};function O1(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),r!=null&&t.clipExtent(null),il(n,t.stream(Ep)),e(Ep.result()),r!=null&&t.clipExtent(r),t}function Dp(t,e,n){return O1(t,function(r){var i=e[1][0]-e[0][0],a=e[1][1]-e[0][1],o=Math.min(i/(r[1][0]-r[0][0]),a/(r[1][1]-r[0][1])),s=+e[0][0]+(i-o*(r[1][0]+r[0][0]))/2,c=+e[0][1]+(a-o*(r[1][1]+r[0][1]))/2;t.scale(150*o).translate([s,c])},n)}function w1(t,e,n){return Dp(t,[[0,0],e],n)}function S1(t,e,n){return O1(t,function(r){var i=+e,a=i/(r[1][0]-r[0][0]),o=(i-a*(r[1][0]+r[0][0]))/2,s=-a*r[0][1];t.scale(150*a).translate([o,s])},n)}function M1(t,e,n){return O1(t,function(r){var i=+e,a=i/(r[1][1]-r[0][1]),o=-a*r[0][0],s=(i-a*(r[1][1]+r[0][1]))/2;t.scale(150*a).translate([o,s])},n)}var I5=16,hit=Me(30*Wn);function D5(t,e){return+e?vit(t,e):pit(t)}function pit(t){return lf({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function vit(t,e){function n(r,i,a,o,s,c,l,u,f,d,h,p,v,g){var y=l-r,m=u-i,b=y*y+m*m;if(b>4*e&&v--){var _=o+d,x=s+h,O=c+p,w=gi(_*_+x*x+O*O),S=Vi(O/=w),M=$e($e(O)-1)e||$e((y*P+m*T)/b-.5)>.3||o*d+s*h+c*p2?k[2]%360*Wn:0,P()):[s*Wr,c*Wr,l*Wr]},A.angle=function(k){return arguments.length?(f=k%360*Wn,P()):f*Wr},A.reflectX=function(k){return arguments.length?(d=k?-1:1,P()):d<0},A.reflectY=function(k){return arguments.length?(h=k?-1:1,P()):h<0},A.precision=function(k){return arguments.length?(O=D5(w,x=k*k),T()):gi(x)},A.fitExtent=function(k,N){return Dp(A,k,N)},A.fitSize=function(k,N){return w1(A,k,N)},A.fitWidth=function(k,N){return S1(A,k,N)},A.fitHeight=function(k,N){return M1(A,k,N)};function P(){var k=F5(n,0,0,d,h,f).apply(null,e(a,o)),N=F5(n,r-k[0],i-k[1],d,h,f);return u=L5(s,c,l),w=b1(e,N),S=b1(u,w),O=D5(w,x),T()}function T(){return M=E=null,A}return function(){return e=t.apply(this,arguments),A.invert=e.invert&&C,P()}}function A1(t){var e=0,n=Te/3,r=E1(t),i=r(e,n);return i.parallels=function(a){return arguments.length?r(e=a[0]*Wn,n=a[1]*Wn):[e*Wr,n*Wr]},i}function bit(t){var e=Me(t);function n(r,i){return[r*e,ge(i)/e]}return n.invert=function(r,i){return[r/e,Vi(i*e)]},n}function B5(t,e){var n=ge(t),r=(n+ge(e))/2;if($e(r)=.12&&g<.234&&v>=-.425&&v<-.214?i:g>=.166&&g<.234&&v>=-.214&&v<-.115?o:n).invert(d)},u.stream=function(d){return t&&e===d?t:t=_it([n.stream(e=d),i.stream(d),o.stream(d)])},u.precision=function(d){return arguments.length?(n.precision(d),i.precision(d),o.precision(d),f()):n.precision()},u.scale=function(d){return arguments.length?(n.scale(d),i.scale(d*.35),o.scale(d),u.translate(n.translate())):n.scale()},u.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),p=+d[0],v=+d[1];return r=n.translate(d).clipExtent([[p-.455*h,v-.238*h],[p+.455*h,v+.238*h]]).stream(l),a=i.translate([p-.307*h,v+.201*h]).clipExtent([[p-.425*h+se,v+.12*h+se],[p-.214*h-se,v+.234*h-se]]).stream(l),s=o.translate([p-.205*h,v+.212*h]).clipExtent([[p-.214*h+se,v+.166*h+se],[p-.115*h-se,v+.234*h-se]]).stream(l),f()},u.fitExtent=function(d,h){return Dp(u,d,h)},u.fitSize=function(d,h){return w1(u,d,h)},u.fitWidth=function(d,h){return S1(u,d,h)},u.fitHeight=function(d,h){return M1(u,d,h)};function f(){return t=e=null,u}return u.scale(1070)}function G5(t){return function(e,n){var r=Me(e),i=Me(n),a=t(r*i);return a===1/0?[2,0]:[a*i*ge(e),a*ge(n)]}}function uf(t){return function(e,n){var r=gi(e*e+n*n),i=t(r),a=ge(i),o=Me(i);return[Ka(e*a,r*o),Vi(r&&n*a/r)]}}var P1=G5(function(t){return gi(2/(1+t))});P1.invert=uf(function(t){return 2*Vi(t/2)});function Oit(){return Ca(P1).scale(124.75).clipAngle(180-.001)}var T1=G5(function(t){return(t=J3(t))&&t/ge(t)});T1.invert=uf(function(t){return t});function wit(){return Ca(T1).scale(79.4188).clipAngle(180-.001)}function ff(t,e){return[t,wp(i1((qn+e)/2))]}ff.invert=function(t,e){return[t,2*al(Q3(e))-qn]};function Sit(){return W5(ff).scale(961/Si)}function W5(t){var e=Ca(t),n=e.center,r=e.scale,i=e.translate,a=e.clipExtent,o=null,s,c,l;e.scale=function(f){return arguments.length?(r(f),u()):r()},e.translate=function(f){return arguments.length?(i(f),u()):i()},e.center=function(f){return arguments.length?(n(f),u()):n()},e.clipExtent=function(f){return arguments.length?(f==null?o=s=c=l=null:(o=+f[0][0],s=+f[0][1],c=+f[1][0],l=+f[1][1]),u()):o==null?null:[[o,s],[c,l]]};function u(){var f=Te*r(),d=e(dit(e.rotate()).invert([0,0]));return a(o==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:t===ff?[[Math.max(d[0]-f,o),s],[Math.min(d[0]+f,c),l]]:[[o,Math.max(d[1]-f,s)],[c,Math.min(d[1]+f,l)]])}return u()}function Bp(t){return i1((qn+t)/2)}function Y5(t,e){var n=Me(t),r=t===e?ge(t):wp(n/Me(e))/wp(Bp(e)/Bp(t)),i=n*r1(Bp(t),r)/r;if(!r)return ff;function a(o,s){i>0?s<-qn+se&&(s=-qn+se):s>qn-se&&(s=qn-se);var c=i/r1(Bp(s),r);return[c*ge(r*o),i-c*Me(r*o)]}return a.invert=function(o,s){var c=i-s,l=$i(r)*gi(o*o+c*c),u=Ka(o,$e(c))*$i(c);return c*r<0&&(u-=Te*$i(o)*$i(c)),[u/r,2*al(r1(i/l,1/r))-qn]},a}function Mit(){return A1(Y5).scale(109.5).parallels([30,30])}function df(t,e){return[t,e]}df.invert=df;function Eit(){return Ca(df).scale(152.63)}function H5(t,e){var n=Me(t),r=t===e?ge(t):(n-Me(e))/(e-t),i=n/r+t;if($e(r)se&&--r>0);return[t/(.8707+(a=n*n)*(-.131979+a*(-.013791+a*a*a*(.003971-.001529*a)))),n]};function Lit(){return Ca(L1).scale(175.295)}function N1(t,e){return[Me(e)*ge(t),ge(e)]}N1.invert=uf(Vi);function Nit(){return Ca(N1).scale(249.5).clipAngle(90+se)}function j1(t,e){var n=Me(e),r=1+Me(t)*n;return[n*ge(t)/r,ge(e)/r]}j1.invert=uf(function(t){return 2*al(t)});function jit(){return Ca(j1).scale(250).clipAngle(142)}function R1(t,e){return[wp(i1((qn+e)/2)),-t]}R1.invert=function(t,e){return[-e,2*al(Q3(t))-qn]};function Rit(){var t=W5(R1),e=t.center,n=t.rotate;return t.center=function(r){return arguments.length?e([-r[1],r[0]]):(r=e(),[r[1],-r[0]])},t.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}var Iit=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);iBit(e).features)}}function Bit(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];if(!n)return null;if(n==="geometry")return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]};if(n==="feature")return{type:"FeatureCollection",features:[t]};if(n==="featureCollection")return t}function zit(t,e){var n;for(const[r,i]of Object.entries(e))(n=t[r])===null||n===void 0||n.call(t,i)}function Git(t,e,n,r){const i=()=>{const s=e.filter($5);return s.find(l=>l.sphere)?{type:"Sphere"}:Fit(s.filter(l=>!l.sphere).flatMap(l=>l.data.value))},{outline:a=i()}=r,{size:o="fitExtent"}=r;if(o==="fitExtent")return Wit(t,a,n);if(o==="fitWidth")return Yit(t,a,n)}function Wit(t,e,n){const{x:r,y:i,width:a,height:o}=n;t.fitExtent([[r,i],[a,o]],e)}function Yit(t,e,n){const{width:r,height:i}=n,[[a,o],[s,c]]=_5(t.fitWidth(r,e)).bounds(e),l=Math.ceil(c-o),u=Math.min(Math.ceil(s-a),l),f=t.scale()*(u-1)/u,[d,h]=t.translate(),p=h+(i-l)/2;t.scale(f).translate([d,p]).precision(.2)}function Hit(t){const{data:e}=t;if(Array.isArray(e))return Object.assign(Object.assign({},t),{data:{value:e}});const{type:n}=e;return n==="graticule10"?Object.assign(Object.assign({},t),{data:{value:[nit()]}}):n==="sphere"?Object.assign(Object.assign({},t),{sphere:!0,data:{value:[{type:"Sphere"}]}}):t}function $5(t){return t.type==="geoPath"}const V5=()=>t=>{const{children:e,coordinate:n={}}=t;if(!Array.isArray(e))return[];const{type:r="equalEarth"}=n,i=Iit(n,["type"]),a=Dit(r),o=e.map(Hit);let s;function c(){return[["custom",(f,d,h,p)=>{const v=a();Git(v,o,{x:f,y:d,width:h,height:p},i),zit(v,i),s=_5(v);const y=new Fr({domain:[f,f+h]}),m=new Fr({domain:[d,d+p]}),b=x=>{const O=v(x);if(!O)return[null,null];const[w,S]=O;return[y.map(w),m.map(S)]},_=x=>{if(!x)return null;const[O,w]=x,S=[y.invert(O),m.invert(w)];return v.invert(S)};return{transform:x=>b(x),untransform:x=>_(x)}}]]}function l(f){const{style:d,tooltip:h={}}=f;return Object.assign(Object.assign({},f),{type:"path",tooltip:Nh(h,{title:"id",items:[{channel:"color"}]}),style:Object.assign(Object.assign({},d),{d:p=>s(p)||[]})})}const u=f=>$5(f)?l(f):f;return[Object.assign(Object.assign({},t),{type:"view",scale:{x:{type:"identity"},y:{type:"identity"}},axis:!1,coordinate:{type:c},children:o.flatMap(u)})]};V5.props={};var $it=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);it=>{const{type:e,data:n,scale:r,encode:i,style:a,animate:o,key:s,state:c}=t,l=$it(t,["type","data","scale","encode","style","animate","key","state"]);return[Object.assign(Object.assign({type:"geoView"},l),{children:[{type:"geoPath",key:`${s}-0`,data:{value:n},scale:r,encode:i,style:a,animate:o,state:c}]})]};U5.props={};function Vit(){return{"composition.geoView":V5,"composition.geoPath":U5}}function Uit(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return X5(this.cover(e,n),e,n,t)}function X5(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,a=t._root,o={data:r},s=t._x0,c=t._y0,l=t._x1,u=t._y1,f,d,h,p,v,g,y,m;if(!a)return t._root=o,t;for(;a.length;)if((v=e>=(f=(s+l)/2))?s=f:l=f,(g=n>=(d=(c+u)/2))?c=d:u=d,i=a,!(a=a[y=g<<1|v]))return i[y]=o,t;if(h=+t._x.call(null,a.data),p=+t._y.call(null,a.data),e===h&&n===p)return o.next=a,i?i[y]=o:t._root=o,t;do i=i?i[y]=new Array(4):t._root=new Array(4),(v=e>=(f=(s+l)/2))?s=f:l=f,(g=n>=(d=(c+u)/2))?c=d:u=d;while((y=g<<1|v)===(m=(p>=d)<<1|h>=f));return i[m]=a,i[y]=o,t}function Xit(t){var e,n,r=t.length,i,a,o=new Array(r),s=new Array(r),c=1/0,l=1/0,u=-1/0,f=-1/0;for(n=0;nu&&(u=i),af&&(f=a));if(c>u||l>f)return this;for(this.cover(c,l).cover(u,f),n=0;nt||t>=i||r>e||e>=a;)switch(l=(eu||(s=p.y0)>f||(c=p.x1)=y)<<1|t>=g)&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-v],d[d.length-1-v]=p)}else{var m=t-+this._x.call(null,h.data),b=e-+this._y.call(null,h.data),_=m*m+b*b;if(_=(d=(o+c)/2))?o=d:c=d,(v=f>=(h=(s+l)/2))?s=h:l=h,e=n,!(n=n[g=v<<1|p]))return this;if(!n.length)break;(e[g+1&3]||e[g+2&3]||e[g+3&3])&&(r=e,y=g)}for(;n.data!==t;)if(i=n,!(n=n.next))return this;return(a=n.next)&&delete n.next,i?(a?i.next=a:delete i.next,this):e?(a?e[g]=a:delete e[g],(n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length&&(r?r[y]=n:this._root=n),this):(this._root=a,this)}function tat(t){for(var e=0,n=t.length;e=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Gp.prototype=K5.prototype={constructor:Gp,on:function(e,n){var r=this._,i=uat(e+"",r),a,o=-1,s=i.length;if(arguments.length<2){for(;++o0)for(var r=new Array(a),i=0,a,o;i=0&&t._call.call(void 0,e),t=t._next;--fl}function rL(){Ws=(Yp=_f.now())+Hp,fl=yf=0;try{pat()}finally{fl=0,gat(),Ws=0}}function vat(){var t=_f.now(),e=t-Yp;e>J5&&(Hp-=e,Yp=t)}function gat(){for(var t,e=Wp,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Wp=n);bf=t,F1(r)}function F1(t){if(!fl){yf&&(yf=clearTimeout(yf));var e=t-Ws;e>24?(t<1/0&&(yf=setTimeout(rL,t-_f.now()-Hp)),mf&&(mf=clearInterval(mf))):(mf||(Yp=_f.now(),mf=setInterval(vat,J5)),fl=1,tL(rL))}}const yat=1664525,mat=1013904223,iL=4294967296;function bat(){let t=1;return()=>(t=(yat*t+mat)%iL)/iL}function _at(t){return t.x}function xat(t){return t.y}var Oat=10,wat=Math.PI*(3-Math.sqrt(5));function Sat(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),a=0,o=.6,s=new Map,c=nL(f),l=dat("tick","end"),u=bat();t==null&&(t=[]);function f(){d(),l.call("tick",e),n1?(g==null?s.delete(v):s.set(v,p(g)),e):s.get(v)},find:function(v,g,y){var m=0,b=t.length,_,x,O,w,S;for(y==null?y=1/0:y*=y,m=0;m1?(l.on(v,g),e):l.on(v)}}}function Mat(){var t,e,n,r,i=Mi(-30),a,o=1,s=1/0,c=.81;function l(h){var p,v=t.length,g=q5(t,_at,xat).visitAfter(f);for(r=h,p=0;p=s)return;(h.data!==e||h.next)&&(y===0&&(y=ul(n),_+=y*y),m===0&&(m=ul(n),_+=m*m),_[e(x,O,o),x])),_;for(g=0,s=new Array(y);gt.source.x,t=>t.target.x],y:[t=>t.source.y,t=>t.target.y]},style:{stroke:"#999",strokeOpacity:.6}},jat={type:"point",axis:!1,legend:!1,encode:{x:"x",y:"y",size:5,color:"group",shape:"point"},style:{stroke:"#fff"}},Rat={text:""};function Iat(t,e,n){const{nodes:r,links:i}=t,{joint:a,nodeStrength:o,linkStrength:s}=e,{nodeKey:c=p=>p.id,linkKey:l=p=>p.id}=n,u=Mat(),f=Aat(i).id(Pa(l));typeof o=="function"&&u.strength(o),typeof s=="function"&&f.strength(s);const d=Sat(r).force("link",f).force("charge",u);a?d.force("center",Pat()):d.force("x",Tat()).force("y",kat()),d.stop();const h=Math.ceil(Math.log(d.alphaMin())/Math.log(1-d.alphaDecay()));for(let p=0;p{const{data:e,encode:n={},scale:r,style:i={},layout:a={},nodeLabels:o=[],linkLabels:s=[],animate:c={},tooltip:l={}}=t,{nodeKey:u=O=>O.id,linkKey:f=O=>O.id}=n,d=Cat(n,["nodeKey","linkKey"]),h=Object.assign({nodeKey:u,linkKey:f},d),p=At(h,"node"),v=At(h,"link"),{links:g,nodes:y}=jy(e,h),{nodesData:m,linksData:b}=Iat({links:g,nodes:y},at({},Lat,a),h),_=Ma(l,"link",{items:[O=>({name:"source",value:Pa(f)(O.source)}),O=>({name:"target",value:Pa(f)(O.target)})]}),x=Ma(l,"node",{items:[O=>({name:"key",value:Pa(u)(O)})]},!0);return[at({},Nat,{data:b,encode:v,labels:s,style:At(i,"link"),tooltip:_,animate:Ea(c,"link")}),at({},jat,{data:m,encode:Object.assign({},p),scale:r,style:At(i,"node"),tooltip:x,labels:[Object.assign(Object.assign({},Rat),At(i,"label")),...o],animate:Ea(c,"link")})]};oL.props={};function Dat(t,e){return t.parent===e.parent?1:2}function B1(t){var e=t.children;return e?e[0]:t.t}function z1(t){var e=t.children;return e?e[e.length-1]:t.t}function Fat(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 Bat(t){for(var e=0,n=0,r=t.children,i=r.length,a;--i>=0;)a=r[i],a.z+=e,a.m+=e,e+=a.s+(n+=a.c)}function zat(t,e,n){return t.a.parent===e.parent?t.a:n}function $p(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}$p.prototype=Object.create(qc.prototype);function Gat(t){for(var e=new $p(t,0),n,r=[e],i,a,o,s;n=r.pop();)if(a=n._.children)for(n.children=new Array(s=a.length),o=s-1;o>=0;--o)r.push(i=n.children[o]=new $p(a[o],o)),i.parent=n;return(e.parent=new $p(null,0)).children=[e],e}function Wat(){var t=Dat,e=1,n=1,r=null;function i(l){var u=Gat(l);if(u.eachAfter(a),u.parent.m=-u.z,u.eachBefore(o),r)l.eachBefore(c);else{var f=l,d=l,h=l;l.eachBefore(function(m){m.xd.x&&(d=m),m.depth>h.depth&&(h=m)});var p=f===d?1:t(f,d)/2,v=p-f.x,g=e/(d.x+p+v),y=n/(h.depth||1);l.eachBefore(function(m){m.x=(m.x+v)*g,m.y=m.depth*y})}return l}function a(l){var u=l.children,f=l.parent.children,d=l.i?f[l.i-1]:null;if(u){Bat(l);var h=(u[0].z+u[u.length-1].z)/2;d?(l.z=d.z+t(l._,d._),l.m=l.z-h):l.z=h}else d&&(l.z=d.z+t(l._,d._));l.parent.A=s(l,d,l.parent.A||f[0])}function o(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function s(l,u,f){if(u){for(var d=l,h=l,p=u,v=d.parent.children[0],g=d.m,y=h.m,m=p.m,b=v.m,_;p=z1(p),d=B1(d),p&&d;)v=B1(v),h=z1(h),h.a=l,_=p.z+m-d.z-g+t(p._,d._),_>0&&(Fat(zat(p,l,f),l,_),g+=_,y+=_),m+=p.m,g+=d.m,b+=v.m,y+=h.m;p&&!z1(h)&&(h.t=p,h.m+=m-y),d&&!B1(v)&&(v.t=d,v.m+=g-b,f=l)}return f}function c(l){l.x*=e,l.y=l.depth*n}return i.separation=function(l){return arguments.length?(t=l,i):t},i.size=function(l){return arguments.length?(r=!1,e=+l[0],n=+l[1],i):r?null:[e,n]},i.nodeSize=function(l){return arguments.length?(r=!0,e=+l[0],n=+l[1],i):r?[e,n]:null},i}function Yat(t,e){return t.parent===e.parent?1:2}function Hat(t){return t.reduce($at,0)/t.length}function $at(t,e){return t+e.x}function Vat(t){return 1+t.reduce(Uat,0)}function Uat(t,e){return Math.max(t,e.y)}function Xat(t){for(var e;e=t.children;)t=e[0];return t}function qat(t){for(var e;e=t.children;)t=e[e.length-1];return t}function Zat(){var t=Yat,e=1,n=1,r=!1;function i(a){var o,s=0;a.eachAfter(function(d){var h=d.children;h?(d.x=Hat(h),d.y=Vat(h)):(d.x=o?s+=t(d,o):0,d.y=0,o=d)});var c=Xat(a),l=qat(a),u=c.x-t(c,l)/2,f=l.x+t(l,c)/2;return a.eachAfter(r?function(d){d.x=(d.x-a.x)*e,d.y=(a.y-d.y)*n}:function(d){d.x=(d.x-u)/(f-u)*e,d.y=(1-(a.y?d.y/a.y:1))*n})}return i.separation=function(a){return arguments.length?(t=a,i):t},i.size=function(a){return arguments.length?(r=!1,e=+a[0],n=+a[1],i):r?null:[e,n]},i.nodeSize=function(a){return arguments.length?(r=!0,e=+a[0],n=+a[1],i):r?[e,n]:null},i}const sL=t=>e=>n=>{const{field:r="value",nodeSize:i,separation:a,sortBy:o,as:s=["x","y"]}=e,[c,l]=s,u=Xc(n,p=>p.children).sum(p=>p[r]).sort(o),f=t();f.size([1,1]),i&&f.nodeSize(i),a&&f.separation(a),f(u);const d=[];u.each(p=>{p[c]=p.x,p[l]=p.y,p.name=p.data.name,d.push(p)});const h=u.links();return h.forEach(p=>{p[c]=[p.source[c],p.target[c]],p[l]=[p.source[l],p.target[l]]}),{nodes:d,edges:h}},cL=t=>sL(Zat)(t);cL.props={};const lL=t=>sL(Wat)(t);lL.props={};const Kat={sortBy:(t,e)=>e.value-t.value},Qat={axis:!1,legend:!1,type:"point",encode:{x:"x",y:"y",size:2,shape:"point"}},Jat={type:"link",encode:{x:"x",y:"y",shape:"smooth"}},tot={text:"",fontSize:10},uL=t=>{const{data:e,encode:n={},scale:r={},style:i={},layout:a={},nodeLabels:o=[],linkLabels:s=[],animate:c={},tooltip:l={}}=t,u=n==null?void 0:n.value,{nodes:f,edges:d}=lL(Object.assign(Object.assign(Object.assign({},Kat),a),{field:u}))(e),h=Ma(l,"node",{title:"name",items:["value"]},!0),p=Ma(l,"link",{title:"",items:[v=>({name:"source",value:v.source.name}),v=>({name:"target",value:v.target.name})]});return[at({},Jat,{data:d,encode:At(n,"link"),scale:At(r,"link"),labels:s,style:Object.assign({stroke:"#999"},At(i,"link")),tooltip:p,animate:Ea(c,"link")}),at({},Qat,{data:f,scale:At(r,"node"),encode:At(n,"node"),labels:[Object.assign(Object.assign({},tot),At(i,"label")),...o],style:Object.assign({},At(i,"node")),tooltip:h,animate:Ea(c,"node")})]};uL.props={};var eot=1664525,not=1013904223,fL=4294967296;function rot(){var t=1;return function(){return(t=(eot*t+not)%fL)/fL}}var iot=tt(52677);function aot(t){return iot(t)==="object"&&"length"in t?t:Array.from(t)}function oot(t,e){for(var n=t.length,r,i;n;)i=e()*n--|0,r=t[n],t[n]=t[i],t[i]=r;return t}function d1t(t){return dL(t,lcg())}function dL(t,e){for(var n=0,r=(t=oot(Array.from(t),e)).length,i=[],a,o;n0&&n*n>r*r+i*i}function G1(t,e){for(var n=0;n1e-6?(A+Math.sqrt(A*A-4*E*C))/(2*E):C/A);return{x:r+O+w*P,y:i+S+M*P,r:P}}function vL(t,e,n){var r=t.x-e.x,i,a,o=t.y-e.y,s,c,l=r*r+o*o;l?(a=e.r+n.r,a*=a,c=t.r+n.r,c*=c,a>c?(i=(l+c-a)/(2*l),s=Math.sqrt(Math.max(0,c/l-i*i)),n.x=t.x-i*r-s*o,n.y=t.y-i*o+s*r):(i=(l+a-c)/(2*l),s=Math.sqrt(Math.max(0,a/l-i*i)),n.x=e.x+i*r-s*o,n.y=e.y+i*o+s*r)):(n.x=e.x+n.r,n.y=e.y)}function gL(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 yL(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,a=(e.y*n.r+n.y*e.r)/r;return i*i+a*a}function Up(t){this._=t,this.next=null,this.previous=null}function mL(t,e){if(!(a=(t=aot(t)).length))return 0;var n,r,i,a,o,s,c,l,u,f,d;if(n=t[0],n.x=0,n.y=0,!(a>1))return n.r;if(r=t[1],n.x=-r.r,r.x=n.r,r.y=0,!(a>2))return n.r+r.r;vL(r,n,i=t[2]),n=new Up(n),r=new Up(r),i=new Up(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(c=3;c({size:[t,e],padding:0,sort:(n,r)=>r.value-n.value}),pot=(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:r=>r.height===0?"#ddd":"#fff",stroke:n.color?void 0:r=>r.height===0?"":"#000"}}),vot={text:"",position:"inside",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>t.r*2},got={title:t=>t.data.name,items:[{field:"value"}]},yot=(t,e,n)=>{const{value:r}=n,i=sr(t)?Rm().path(e.path)(t):Xc(t);return r?i.sum(a=>Pa(r)(a)).sort(e.sort):i.count(),fot().size(e.size).padding(e.padding)(i),i.descendants()},xL=(t,e)=>{const{width:n,height:r}=e,{data:i,encode:a={},scale:o={},style:s={},layout:c={},labels:l=[],tooltip:u={}}=t,f=dot(t,["data","encode","scale","style","layout","labels","tooltip"]),d=pot(n,r,a),h=yot(i,at({},hot(n,r),c),at({},d.encode,a)),p=At(s,"label");return at({},d,Object.assign(Object.assign({data:h,encode:a,scale:o,style:s,labels:[Object.assign(Object.assign({},vot),p),...l]},f),{tooltip:Nh(u,got),axis:!1}))};xL.props={};function mot(t){return t.target.depth}function bot(t){return t.depth}function _ot(t,e){return e-1-t.height}function Xp(t,e){return t.sourceLinks.length?t.depth:e-1}function xot(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?Oi(t.sourceLinks,mot)-1:0}function qp(t){return function(){return t}}function OL(t,e){return Zp(t.source,e.source)||t.index-e.index}function wL(t,e){return Zp(t.target,e.target)||t.index-e.index}function Zp(t,e){return t.y0-e.y0}function Y1(t){return t.value}function Oot(t){return t.index}function wot(t){return t.nodes}function Sot(t){return t.links}function SL(t,e){const n=t.get(e);if(!n)throw new Error("missing: "+e);return n}function ML({nodes:t}){for(const e of t){let n=e.y0,r=n;for(const i of e.sourceLinks)i.y0=n+i.width/2,n+=i.width;for(const i of e.targetLinks)i.y1=r+i.width/2,r+=i.width}}function Mot(){let t=0,e=0,n=1,r=1,i=24,a=8,o,s=Oot,c=Xp,l,u,f,d=wot,h=Sot,p=6;function v(N){const F={nodes:d(N),links:h(N)};return g(F),y(F),m(F),b(F),O(F),ML(F),F}v.update=function(N){return ML(N),N},v.nodeId=function(N){return arguments.length?(s=typeof N=="function"?N:qp(N),v):s},v.nodeAlign=function(N){return arguments.length?(c=typeof N=="function"?N:qp(N),v):c},v.nodeDepth=function(N){return arguments.length?(l=N,v):l},v.nodeSort=function(N){return arguments.length?(u=N,v):u},v.nodeWidth=function(N){return arguments.length?(i=+N,v):i},v.nodePadding=function(N){return arguments.length?(a=o=+N,v):a},v.nodes=function(N){return arguments.length?(d=typeof N=="function"?N:qp(N),v):d},v.links=function(N){return arguments.length?(h=typeof N=="function"?N:qp(N),v):h},v.linkSort=function(N){return arguments.length?(f=N,v):f},v.size=function(N){return arguments.length?(t=e=0,n=+N[0],r=+N[1],v):[n-t,r-e]},v.extent=function(N){return arguments.length?(t=+N[0][0],n=+N[1][0],e=+N[0][1],r=+N[1][1],v):[[t,e],[n,r]]},v.iterations=function(N){return arguments.length?(p=+N,v):p};function g({nodes:N,links:F}){N.forEach((I,z)=>{I.index=z,I.sourceLinks=[],I.targetLinks=[]});const R=new Map(N.map(I=>[s(I),I]));if(F.forEach((I,z)=>{I.index=z;let{source:W,target:V}=I;typeof W!="object"&&(W=I.source=SL(R,W)),typeof V!="object"&&(V=I.target=SL(R,V)),W.sourceLinks.push(I),V.targetLinks.push(I)}),f!=null)for(const{sourceLinks:I,targetLinks:z}of N)I.sort(f),z.sort(f)}function y({nodes:N}){for(const F of N)F.value=F.fixedValue===void 0?Math.max(Di(F.sourceLinks,Y1),Di(F.targetLinks,Y1)):F.fixedValue}function m({nodes:N}){const F=N.length;let R=new Set(N),I=new Set,z=0;for(;R.size;){if(R.forEach(W=>{W.depth=z;for(const{target:V}of W.sourceLinks)I.add(V)}),++z>F)throw new Error("circular link");R=I,I=new Set}if(l){const W=Math.max(Ke(N,$=>$.depth)+1,0);let V;for(let $=0;${W.height=z;for(const{source:V}of W.targetLinks)I.add(V)}),++z>F)throw new Error("circular link");R=I,I=new Set}}function _({nodes:N}){const F=Math.max(Ke(N,z=>z.depth)+1,0),R=(n-t-i)/(F-1),I=new Array(F).fill(0).map(()=>[]);for(const z of N){const W=Math.max(0,Math.min(F-1,Math.floor(c.call(null,z,F))));z.layer=W,z.x0=t+W*R,z.x1=z.x0+i,I[W]?I[W].push(z):I[W]=[z]}if(u)for(const z of I)z.sort(u);return I}function x(N){const F=Oi(N,R=>(r-e-(R.length-1)*o)/Di(R,Y1));for(const R of N){let I=e;for(const z of R){z.y0=I,z.y1=I+z.value*F,I=z.y1+o;for(const W of z.sourceLinks)W.width=W.value*F}I=(r-I+o)/(R.length+1);for(let z=0;zR.length)-1)),x(F);for(let R=0;R0))continue;const ct=($/J-V.y0)*F;V.y0+=ct,V.y1+=ct,C(V)}u===void 0&&W.sort(Zp),W.length&&M(W,R)}}function S(N,F,R){for(let I=N.length,z=I-2;z>=0;--z){const W=N[z];for(const V of W){let $=0,J=0;for(const{target:pt,value:it}of V.sourceLinks){const nt=it*(pt.layer-V.layer);$+=k(V,pt)*nt,J+=nt}if(!(J>0))continue;const ct=($/J-V.y0)*F;V.y0+=ct,V.y1+=ct,C(V)}u===void 0&&W.sort(Zp),W.length&&M(W,R)}}function M(N,F){const R=N.length>>1,I=N[R];A(N,I.y0-o,R-1,F),E(N,I.y1+o,R+1,F),A(N,r,N.length-1,F),E(N,e,0,F)}function E(N,F,R,I){for(;R1e-6&&(z.y0+=W,z.y1+=W),F=z.y1+o}}function A(N,F,R,I){for(;R>=0;--R){const z=N[R],W=(z.y1-F)*I;W>1e-6&&(z.y0-=W,z.y1-=W),F=z.y0-o}}function C({sourceLinks:N,targetLinks:F}){if(f===void 0){for(const{source:{sourceLinks:R}}of F)R.sort(wL);for(const{target:{targetLinks:R}}of N)R.sort(OL)}}function P(N){if(f===void 0)for(const{sourceLinks:F,targetLinks:R}of N)F.sort(wL),R.sort(OL)}function T(N,F){let R=N.y0-(N.sourceLinks.length-1)*o/2;for(const{target:I,width:z}of N.sourceLinks){if(I===F)break;R+=z+o}for(const{source:I,width:z}of F.targetLinks){if(I===N)break;R-=z}return R}function k(N,F){let R=F.y0-(F.targetLinks.length-1)*o/2;for(const{source:I,width:z}of F.targetLinks){if(I===N)break;R+=z+o}for(const{target:I,width:z}of N.sourceLinks){if(I===F)break;R-=z}return R}return v}const Eot={nodeAlign:"justify",nodeWidth:.008,nodePadding:.03,nodes:t=>t.nodes,links:t=>t.links,nodeSort:void 0,linkSort:void 0,iterations:6},Aot={left:bot,right:_ot,center:xot,justify:Xp};function Pot(t){const e=typeof t;return e==="string"?Aot[t]||Xp:e==="function"?t:Xp}const EL=t=>e=>{const{nodeId:n,nodeSort:r,nodeAlign:i,nodeWidth:a,nodePadding:o,nodeDepth:s,nodes:c,links:l,linkSort:u,iterations:f}=Object.assign({},Eot,t),d=Mot().nodeSort(r).linkSort(u).links(l).nodes(c).nodeWidth(a).nodePadding(o).nodeDepth(s).nodeAlign(Pot(i)).iterations(f).extent([[0,0],[1,1]]);typeof n=="function"&&d.nodeId(n);const h=d(e),{nodes:p,links:v}=h,g=p.map(m=>{const{x0:b,x1:_,y0:x,y1:O}=m;return Object.assign(Object.assign({},m),{x:[b,_,_,b],y:[x,x,O,O]})}),y=v.map(m=>{const{source:b,target:_}=m,x=b.x1,O=_.x0,w=m.width/2;return Object.assign(Object.assign({},m),{x:[x,x,O,O],y:[m.y0+w,m.y0-w,m.y1+w,m.y1-w]})});return{nodes:g,links:y}};EL.props={};var Tot=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);it.key,nodeWidth:.02,nodePadding:.02},Cot={type:"polygon",axis:!1,legend:!1,encode:{shape:"polygon",x:"x",y:"y"},scale:{x:{type:"identity"},y:{type:"identity"}},style:{stroke:"#000"}},Lot={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{fillOpacity:.5,stroke:void 0}},Not={textAlign:t=>t.x[0]<.5?"start":"end",position:t=>t.x[0]<.5?"right":"left",fontSize:10},AL=t=>{const{data:e,encode:n={},scale:r,style:i={},layout:a={},nodeLabels:o=[],linkLabels:s=[],animate:c={},tooltip:l={}}=t,{links:u,nodes:f}=jy(e,n),d=At(n,"node"),h=At(n,"link"),{key:p=M=>M.key,color:v=p}=d,{links:g,nodes:y}=EL(Object.assign(Object.assign(Object.assign({},kot),{nodeId:Pa(p)}),a))({links:u,nodes:f}),m=At(i,"label"),{text:b=p,spacing:_=5}=m,x=Tot(m,["text","spacing"]),O=Pa(p),w=Ma(l,"node",{title:O,items:[{field:"value"}]},!0),S=Ma(l,"link",{title:"",items:[M=>({name:"source",value:O(M.source)}),M=>({name:"target",value:O(M.target)})]});return[at({},Cot,{data:y,encode:Object.assign(Object.assign({},d),{color:v}),scale:r,style:At(i,"node"),labels:[Object.assign(Object.assign(Object.assign({},Not),{text:b,dx:M=>M.x[0]<.5?_:-_}),x),...o],tooltip:w,animate:Ea(c,"node"),axis:!1}),at({},Lot,{data:g,encode:h,labels:s,style:Object.assign({fill:h.color?void 0:"#aaa",lineWidth:0},At(i,"link")),tooltip:S,animate:Ea(c,"link")})]};AL.props={};function jot(t,e){return e.value-t.value}function Rot(t,e){return e.frequency-t.frequency}function Iot(t,e){return`${t.id}`.localeCompare(`${e.id}`)}function Dot(t,e){return`${t.name}`.localeCompare(`${e.name}`)}const Fot={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 Bot(t){const{y:e,thickness:n,weight:r,marginRatio:i,id:a,source:o,target:s,sourceWeight:c,targetWeight:l,sortBy:u}=Object.assign(Object.assign({},Fot),t);function f(g){const y=g.nodes.map(b=>Object.assign({},b)),m=g.edges.map(b=>Object.assign({},b));return d(y,m),h(y,m),p(y,m),v(y,m),{nodes:y,edges:m}}function d(g,y){y.forEach(_=>{_.source=o(_),_.target=s(_),_.sourceWeight=c(_),_.targetWeight=l(_)});const m=Cn(y,_=>_.source),b=Cn(y,_=>_.target);return g.forEach(_=>{_.id=a(_);const x=m.has(_.id)?m.get(_.id):[],O=b.has(_.id)?b.get(_.id):[];_.frequency=x.length+O.length,_.value=Di(x,w=>w.sourceWeight)+Di(O,w=>w.targetWeight)}),{nodes:g,edges:y}}function h(g,y){const m=typeof u=="function"?u:zt[u];m&&g.sort(m)}function p(g,y){const m=g.length;if(!m)throw Mc("Invalid nodes: it's empty!");if(!r){const x=1/m;return g.forEach((O,w)=>{O.x=(w+.5)*x,O.y=e}),{nodes:g,edges:y}}const b=i/(2*m),_=g.reduce((x,O)=>x+=O.value,0);return g.reduce((x,O)=>{O.weight=O.value/_,O.width=O.weight*(1-i),O.height=n;const w=b+x,S=w+O.width,M=e-n/2,E=M+n;return O.x=[w,S,S,w],O.y=[M,M,E,E],x+O.width+2*b},0),{nodes:g,edges:y}}function v(g,y){const m=new Map(g.map(x=>[x.id,x]));if(!r)return y.forEach(x=>{const O=o(x),w=s(x),S=m.get(O),M=m.get(w);S&&M&&(x.x=[S.x,M.x],x.y=[S.y,M.y])}),{nodes:g,edges:y};y.forEach(x=>{x.x=[0,0,0,0],x.y=[e,e,e,e]});const b=Cn(y,x=>x.source),_=Cn(y,x=>x.target);g.forEach(x=>{const{edges:O,width:w,x:S,y:M,value:E,id:A}=x,C=b.get(A)||[],P=_.get(A)||[];let T=0;C.map(k=>{const N=k.sourceWeight/E*w;k.x[0]=S[0]+T,k.x[1]=S[0]+T+N,T+=N}),P.forEach(k=>{const N=k.targetWeight/E*w;k.x[3]=S[0]+T,k.x[2]=S[0]+T+N,T+=N})})}return f}const H1=t=>e=>Bot(t)(e);H1.props={};var PL=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);it.key,source:t=>t.source,target:t=>t.target,sourceWeight:t=>t.value||1,targetWeight:t=>t.value||1,sortBy:null},zot={type:"polygon",axis:!1,legend:!1,encode:{shape:"polygon",x:"x",y:"y"},scale:{x:{type:"identity"},y:{type:"identity"}},style:{opacity:1,fillOpacity:1,lineWidth:1}},Got={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{opacity:.5,lineWidth:1}},Wot={position:"outside",fontSize:10},TL=(t,e)=>{const{data:n,encode:r={},scale:i,style:a={},layout:o={},nodeLabels:s=[],linkLabels:c=[],animate:l={},tooltip:u={}}=t,{nodes:f,links:d}=jy(n,r),h=At(r,"node"),p=At(r,"link"),{key:v=k=>k.key,color:g=v}=h,{linkEncodeColor:y=k=>k.source}=p,{nodeWidthRatio:m=$1.thickness,nodePaddingRatio:b=$1.marginRatio}=o,_=PL(o,["nodeWidthRatio","nodePaddingRatio"]),{nodes:x,edges:O}=H1(Object.assign(Object.assign(Object.assign(Object.assign({},$1),{id:Pa(v),thickness:m,marginRatio:b}),_),{weight:!0}))({nodes:f,edges:d}),w=At(a,"label"),{text:S=v}=w,M=PL(w,["text"]),E=Ma(u,"node",{title:"",items:[k=>({name:k.key,value:k.value})]},!0),A=Ma(u,"link",{title:"",items:[k=>({name:`${k.source} -> ${k.target}`,value:k.value})]}),{height:C,width:P}=e,T=Math.min(C,P);return[at({},Got,{data:O,encode:Object.assign(Object.assign({},p),{color:y}),labels:c,style:Object.assign({fill:y?void 0:"#aaa"},At(a,"link")),tooltip:A,animate:Ea(l,"link")}),at({},zot,{data:x,encode:Object.assign(Object.assign({},h),{color:g}),scale:i,style:At(a,"node"),coordinate:{type:"polar",outerRadius:(T-20)/T,startAngle:-Math.PI*2,endAngle:0},labels:[Object.assign(Object.assign(Object.assign({},Wot),{text:S}),M),...s],tooltip:E,animate:Ea(l,"node"),axis:!1})]};TL.props={};var Yot=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i({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:(n,r)=>r.value-n.value,layer:0}),$ot=(t,e)=>({type:"rect",axis:!1,encode:{x:"x",y:"y",key:"id",color:n=>n.path[1]},scale:{x:{domain:[0,t],range:[0,1]},y:{domain:[0,e],range:[0,1]}},style:{stroke:"#fff"},state:{active:{opacity:.6},inactive:{opacity:1}}}),Vot={fontSize:10,text:t=>Gu(t.path),position:"inside",fill:"#000",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>t.x1-t.x0},Uot={title:t=>{var e,n;return(n=(e=t.path)===null||e===void 0?void 0:e.join)===null||n===void 0?void 0:n.call(e,".")},items:[{field:"value"}]},Xot={title:t=>Gu(t.path),items:[{field:"value"}]},kL=(t,e)=>{const{width:n,height:r,options:i}=e,{data:a,encode:o={},scale:s,style:c={},layout:l={},labels:u=[],tooltip:f={}}=t,d=Yot(t,["data","encode","scale","style","layout","labels","tooltip"]),h=Re(i,["interaction","treemapDrillDown"]),p=at({},Hot(n,r),l,{layer:h?m=>m.depth===1:l.layer}),[v,g]=CC(a,p,o),y=At(c,"label");return at({},$ot(n,r),Object.assign(Object.assign({data:v,scale:s,style:c,labels:[Object.assign(Object.assign({},Vot),y),...u]},d),{encode:o,tooltip:Nh(f,Uot),axis:!1}),h?{interaction:Object.assign(Object.assign({},d.interaction),{treemapDrillDown:h?Object.assign(Object.assign({},h),{originData:g,layout:p}):void 0}),encode:Object.assign({color:m=>Gu(m.path)},o),tooltip:Nh(f,Xot)}:{})};kL.props={};function qot(){return{"data.arc":H1,"data.cluster":cL,"mark.forceGraph":oL,"mark.tree":uL,"mark.pack":xL,"mark.sankey":AL,"mark.chord":TL,"mark.treemap":kL}}var CL=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);ie[n])}function Kot(t,e){return Ke(t,n=>e[n])}function LL(t,e){const n=V1(t,e)*2.5-U1(t,e)*1.5;return Oi(t,r=>e[r]>=n?e[r]:NaN)}function V1(t,e){return pp(t,.25,n=>e[n])}function Qot(t,e){return pp(t,.5,n=>e[n])}function U1(t,e){return pp(t,.75,n=>e[n])}function NL(t,e){const n=U1(t,e)*2.5-V1(t,e)*1.5;return Ke(t,r=>e[r]<=n?e[r]:NaN)}function Jot(){return(t,e)=>{const{encode:n}=e,{y:r,x:i}=n,{value:a}=r,{value:o}=i;return[Array.from(Cn(t,l=>o[+l]).values()).flatMap(l=>{const u=LL(l,a),f=NL(l,a);return l.filter(d=>a[d]f)}),e]}}const jL=t=>{const{data:e,encode:n,style:r={},tooltip:i={},transform:a,animate:o}=t,s=CL(t,["data","encode","style","tooltip","transform","animate"]),{point:c=!0}=r,l=CL(r,["point"]),{y:u}=n,f={y:u,y1:u,y2:u,y3:u,y4:u},d={y1:V1,y2:Qot,y3:U1},h=Ma(i,"box",{items:[{channel:"y",name:"min"},{channel:"y1",name:"q1"},{channel:"y2",name:"q2"},{channel:"y3",name:"q3"},{channel:"y4",name:"max"}]},!0),p=Ma(i,"point",{title:{channel:"x"},items:[{name:"outlier",channel:"y"}]});if(!c)return Object.assign({type:"box",data:e,transform:[Object.assign(Object.assign({type:"groupX",y:Zot},d),{y4:Kot})],encode:Object.assign(Object.assign({},n),f),style:l,tooltip:h},s);const v=At(l,"box"),g=At(l,"point");return[Object.assign({type:"box",data:e,transform:[Object.assign(Object.assign({type:"groupX",y:LL},d),{y4:NL})],encode:Object.assign(Object.assign({},n),f),style:v,tooltip:h,animate:Ea(o,"box")},s),{type:"point",data:e,transform:[{type:Jot}],encode:n,style:Object.assign({},g),tooltip:p,animate:Ea(o,"point")}]};jL.props={};const RL=(t,e)=>Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))/2,tst=(t,e)=>{if(!e)return;const{coordinate:n}=e;if(!(n!=null&&n.getCenter))return;const r=n.getCenter();return(i,a,o)=>{const{document:s}=e.canvas,{color:c,index:l}=a,u=s.createElement("g",{}),f=RL(i[0],i[1]),d=RL(i[0],r)*2,h=s.createElement("path",{style:Object.assign(Object.assign(Object.assign({d:[["M",...i[0]],["A",f,f,0,1,0,...i[1]],["A",d+f*2,d+f*2,0,0,0,...i[2]],["A",f,f,0,1,l===0?0:1,...i[3]],["A",d,d,0,0,1,...i[0]],["Z"]]},o),Es(t,["shape","last","first"])),{fill:c||o.color})});return u.appendChild(h),u}};var Kp=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const{shape:n,radius:r}=t,i=Kp(t,["shape","radius"]),a=At(i,"pointer"),o=At(i,"pin"),{shape:s}=a,c=Kp(a,["shape"]),{shape:l}=o,u=Kp(o,["shape"]),{coordinate:f,theme:d}=e;return(h,p)=>{const v=h.map(T=>f.invert(T)),[g,y,m]=wG(f,"polar"),b=f.clone(),{color:_}=p,x=lg({startAngle:g,endAngle:y,innerRadius:m,outerRadius:r});x.push(["cartesian"]),b.update({transformations:x});const O=v.map(T=>b.map(T)),[w,S]=Gg(O),[M,E]=f.getCenter(),A=Object.assign(Object.assign({x1:w,y1:S,x2:M,y2:E,stroke:_},c),i),C=Object.assign(Object.assign({cx:M,cy:E,stroke:_},u),i),P=Kt(new dr);return za(s)||(typeof s=="function"?P.append(()=>s(O,p,b,d)):P.append("line").call(Bt,A).node()),za(l)||(typeof l=="function"?P.append(()=>l(O,p,b,d)):P.append("circle").call(Bt,C).node()),P.node()}},IL={coordinate:{type:"radial",innerRadius:.9,outerRadius:1,startAngle:-11/10*Math.PI,endAngle:1/10*Math.PI},axis:{x:!1},legend:!1,tooltip:!1,encode:{x:"x",y:"y",color:"color"},scale:{color:{range:["#30BF78","#D0D0D0"]}}},nst={style:{shape:est,lineWidth:4,pointerLineCap:"round",pinR:10,pinFill:"#fff",radius:.6}},rst={type:"text",style:{x:"50%",y:"60%",textAlign:"center",textBaseline:"middle",fontSize:20,fontWeight:800,fill:"#888"}};function ist(t){if($n(t)){const e=Math.max(0,Math.min(t,1));return{percent:e,target:e,total:1}}return t}function ast(t,e){const{name:n="score",target:r,total:i,percent:a,thresholds:o=[]}=ist(t),s=a||r,c=a?1:i,l=Object.assign({y:{domain:[0,c]}},e);return o.length?{targetData:[{x:n,y:s,color:"target"}],totalData:o.map((u,f)=>({x:n,y:f>=1?u-o[f-1]:u,color:f})),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 ost(t,{target:e,total:n}){const{content:r}=t;return r?r(e,n):e.toString()}const DL=t=>{const{data:e={},scale:n={},style:r={},animate:i={},transform:a=[]}=t,o=Kp(t,["data","scale","style","animate","transform"]),{targetData:s,totalData:c,target:l,total:u,scale:f}=ast(e,n),d=At(r,"text"),h=rG(r,["pointer","pin"]),p=At(r,"arc"),v=p.shape;return[at({},IL,Object.assign({type:"interval",transform:[{type:"stackY"}],data:c,scale:f,style:v==="round"?Object.assign(Object.assign({},p),{shape:tst}):p,animate:typeof i=="object"?At(i,"arc"):i},o)),at({},IL,nst,Object.assign({type:"point",data:s,scale:f,style:h,animate:typeof i=="object"?At(i,"indicator"):i},o)),at({},rst,{style:Object.assign({text:ost(d,{target:l,total:u})},d),animate:typeof i=="object"?At(i,"text"):i})]};DL.props={};const FL=5e3;function BL(t,e,n){return t+(e-t)*n}function sst(t,e,n,r){return e===0?[[t+1/2*n/Math.PI/2,r/2],[t+1/2*n/Math.PI,r],[t+n/4,r]]:e===1?[[t+1/2*n/Math.PI/2*(Math.PI-2),r],[t+1/2*n/Math.PI/2*(Math.PI-1),r/2],[t+n/4,0]]:e===2?[[t+1/2*n/Math.PI/2,-r/2],[t+1/2*n/Math.PI,-r],[t+n/4,-r]]:[[t+1/2*n/Math.PI/2*(Math.PI-2),-r],[t+1/2*n/Math.PI/2*(Math.PI-1),-r/2],[t+n/4,0]]}function cst(t,e,n,r,i,a,o){const s=Math.ceil(2*t/n*4)*4,c=[];let l=r;for(;l<-Math.PI*2;)l+=Math.PI*2;for(;l>0;)l-=Math.PI*2;l=l/Math.PI/2*n;const u=a-t+l-t*2;c.push(["M",u,e]);let f=0;for(let d=0;dzL[t]||zL.circle,WL=(t,e)=>{if(!e)return;const{coordinate:n}=e,{liquidOptions:r,styleOptions:i}=t,{liquidShape:a,percent:o}=r,{background:s,outline:c={},wave:l={}}=i,u=GL(i,["background","outline","wave"]),{border:f=2,distance:d=0}=c,h=GL(c,["border","distance"]),{length:p=192,count:v=3}=l;return(g,y,m)=>{const{document:b}=e.canvas,{color:_,fillOpacity:x}=m,O=Object.assign(Object.assign({fill:_},m),u),w=b.createElement("g",{}),[S,M]=n.getCenter(),E=n.getSize(),A=Math.min(...E)/2,P=(Kr(a)?a:vst(a))(S,M,A,...E);if(Object.keys(s).length){const N=b.createElement("path",{style:Object.assign({d:P,fill:"#fff"},s)});w.appendChild(N)}if(o>0){const N=b.createElement("path",{style:{d:P}});w.appendChild(N),w.style.clipPath=N,lst(S,M,1-o,v,O,w,N.getBBox().y,A*2,p,!0,b)}const T=b.createElement("path",{style:{d:P,fill:"transparent",lineWidth:f+2*d,stroke:"#fff"}}),k=b.createElement("path",{style:Object.assign(Object.assign(Object.assign({d:P,stroke:_,strokeOpacity:x,lineWidth:f},O),h),{fill:"transparent"})});return w.appendChild(T),w.appendChild(k),w}};WL.props={};var gst=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i{const{data:e={},style:n={},animate:r}=t,i=gst(t,["data","style","animate"]),a=Math.max(0,$n(e)?e:e==null?void 0:e.percent),o=[{percent:a,type:"liquid"}],s=Object.assign(Object.assign({},At(n,"text")),At(n,"content")),c=At(n,"outline"),l=At(n,"wave"),u=At(n,"background");return[at({},yst,Object.assign({type:"interval",data:o,style:{liquidOptions:{percent:a,liquidShape:n==null?void 0:n.shape},styleOptions:Object.assign(Object.assign({},n),{outline:c,wave:l,background:u})},animate:r},i)),at({},mst,{style:Object.assign({text:`${Yd(a*100)} %`},s),animate:r})]};YL.props={};var Qa=tt(69916);const HL=1e-10;function $L(t,e){const n=_st(t),r=n.filter(function(c){return bst(c,t)});let i=0,a=0,o;const s=[];if(r.length>1){const c=xst(r);for(o=0;o-1){const p=t[u.parentIndex[h]],v=Math.atan2(u.x-p.x,u.y-p.y),g=Math.atan2(l.x-p.x,l.y-p.y);let y=g-v;y<0&&(y+=2*Math.PI);const m=g-y/2;let b=Of(f,{x:p.x+p.radius*Math.sin(m),y:p.y+p.radius*Math.cos(m)});b>p.radius*2&&(b=p.radius*2),(d===null||d.width>b)&&(d={circle:p,width:b,p1:u,p2:l})}d!==null&&(s.push(d),i+=X1(d.circle.radius,d.width),l=u)}}else{let c=t[0];for(o=1;oMath.abs(c.radius-t[o].radius)){l=!0;break}l?i=a=0:(i=c.radius*c.radius*Math.PI,s.push({circle:c,p1:{x:c.x,y:c.y+c.radius},p2:{x:c.x-HL,y:c.y+c.radius},width:c.radius*2}))}return a/=2,e&&(e.area=i+a,e.arcArea=i,e.polygonArea=a,e.arcs=s,e.innerPoints=r,e.intersectionPoints=n),i+a}function bst(t,e){for(let n=0;ne[n].radius+HL)return!1;return!0}function _st(t){const e=[];for(let n=0;n=t+e)return 0;if(n<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const r=t-(n*n-e*e+t*t)/(2*n),i=e-(n*n-t*t+e*e)/(2*n);return X1(t,r)+X1(e,i)}function UL(t,e){const n=Of(t,e),r=t.radius,i=e.radius;if(n>=r+i||n<=Math.abs(r-i))return[];const a=(r*r-i*i+n*n)/(2*n),o=Math.sqrt(r*r-a*a),s=t.x+a*(e.x-t.x)/n,c=t.y+a*(e.y-t.y)/n,l=-(e.y-t.y)*(o/n),u=-(e.x-t.x)*(o/n);return[{x:s+l,y:c-u},{x:s-l,y:c+u}]}function xst(t){const e={x:0,y:0};for(let n=0;ns>c?1:-1),r=0;r=Math.min(e[o].size,e[s].size)?f=1:a.size<=1e-10&&(f=-1),i[o][s]=i[s][o]=f}),{distances:r,constraints:i}}function Mst(t,e,n,r){let i=0,a;for(a=0;a0&&p<=f||d<0&&p>=f||(i+=2*v*v,e[2*a]+=4*v*(o-l),e[2*a+1]+=4*v*(s-u),e[2*c]+=4*v*(l-o),e[2*c+1]+=4*v*(u-s))}}return i}function Est(t,e){let n=Pst(t,e);const r=e.lossFunction||Z1;if(t.length>=8){const i=Ast(t,e),a=r(i,t),o=r(n,t);a+1e-8=Math.min(r[p].size,r[v].size)&&(h=0),i[p].push({set:v,size:d.size,weight:h}),i[v].push({set:p,size:d.size,weight:h})}const o=[];for(a in i)if(i.hasOwnProperty(a)){let f=0;for(let d=0;d0){const i=t[0].x,a=t[0].y;for(r=0;r1){const i=Math.atan2(t[1].x,t[1].y)-e;let a,o;const s=Math.cos(i),c=Math.sin(i);for(r=0;r2){let i=Math.atan2(t[2].x,t[2].y)-e;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const a=t[1].y/(1e-10+t[1].x);for(r=0;ro;r.push(` A`,o,o,0,s?1:0,1,a.p1.x,a.p1.y)}return r.join(" ")}}const qL=t=>{const{sets:e="sets",size:n="size",as:r=["key","path"],padding:i=0}=t,[a,o]=r;return s=>{const c=s.map(f=>Object.assign(Object.assign({},f),{sets:f[e],size:f[n],[a]:f.sets.join("&")}));c.sort((f,d)=>f.sets.length-d.sets.length);const l=Ost(c);let u;return c.map(f=>{const d=f[e],h=({width:p,height:v})=>{u=u||Cst(l,p,v,i);const g=d.map(m=>u[m]);let y=Nst(g);return/[zZ]$/.test(y)||(y+=" Z"),y};return Object.assign(Object.assign({},f),{[o]:h})})}};qL.props={};function jst(){return{"data.venn":qL,"mark.boxplot":jL,"mark.gauge":DL,"mark.wordCloud":rm,"mark.liquid":YL}}function Rst(){return Object.assign(Object.assign(Object.assign(Object.assign({},Vit()),qot()),jst()),Wrt())}var Qp=function(){return Qp=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0){if(++e>=_ct)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var Sct=wct,Mct=Sct(bct),rN=Mct;function Ect(t,e){return rN(nN(t,e,ob),t+"")}var Act=Ect;function Pct(t,e,n){if(!mn(n))return!1;var r=typeof e;return(r=="number"?ao(n)&&jf(e,n.length):r=="string"&&e in n)?bn(n[e],t):!1}var Tct=Pct;function kct(t){return Act(function(e,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,o&&Tct(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++r0){var w=x.x,S=x.y,M=x.height,E=x.width,A=x.data,C=x.key,P=hn(A,u),T=g/2;if(n){var k=w+E/2,N=S;h.push({points:[[k+T,N-d+_],[k+T,N-m-_],[k,N-_],[k-T,N-m-_],[k-T,N-d+_]],center:[k,N-d/2-_],width:d,value:[f,P],key:C})}else{var k=w,N=S+M/2;h.push({points:[[w-d+_,N-T],[w-m-_,N-T],[k-_,N],[w-m-_,N+T],[w-d+_,N+T]],center:[k-d/2-_,N],width:d,value:[f,P],key:C})}f=P}}),h},e.prototype.render=function(){this.setDirection(),this.drawConversionTag()},e.prototype.setDirection=function(){var n=this.chart.getCoordinate(),r=hn(n,"options.transformations"),i="horizontal";r.forEach(function(a){a.includes("transpose")&&(i="vertical")}),this.direction=i},e.prototype.drawConversionTag=function(){var n=this,r=this.getConversionTagLayout(),i=this.attributes,a=i.style,o=i.text,s=o.style,c=o.formatter;r.forEach(function(l){var u=l.points,f=l.center,d=l.value,h=l.key,p=d[0],v=d[1],g=f[0],y=f[1],m=new $st({style:n0({points:u,fill:"#eee"},a),id:"polygon-".concat(h)}),b=new KL({style:n0({x:g,y,text:Wt(c)?c(p,v):(v/p*100).toFixed(2)+"%"},s),id:"text-".concat(h)});n.appendChild(m),n.appendChild(b)})},e.prototype.update=function(){var n=this,r=this.getConversionTagLayout();r.forEach(function(i){var a=i.points,o=i.center,s=i.key,c=o[0],l=o[1],u=n.getElementById("polygon-".concat(s)),f=n.getElementById("text-".concat(s));u.setAttribute("points",a),f.setAttribute("x",c),f.setAttribute("y",l)})},e.tag="ConversionTag",e}(oN),Dct=1,Fct=2;function Bct(t,e,n,r){var i=n.length,a=i,o=!r;if(t==null)return!a;for(t=Object(t);i--;){var s=n[i];if(o&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i-1}var ylt=glt;function mlt(t,e,n){for(var r=-1,i=t==null?0:t.length;++r=Slt){var l=e?null:wlt(t);if(l)return y0(l);o=!1,i=Eb,c=new Mb}else c=e?[]:s;t:for(;++r0&&n(s)?e>1?mN(s,e-1,n,r,i):b0(i,s):r||(i[i.length]=s)}return i}var tut=mN;function eut(t){var e=t==null?0:t.length;return e?tut(t,1):[]}var nut=eut;function rut(t){return rN(nN(t,void 0,nut),t+"")}var ub=rut,iut=ub(function(t,e){return t==null?{}:Klt(t,e)}),bN=iut,aut=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),dl=function(){return dl=Object.assign||function(t){for(var e,n=1,r=arguments.length;ni?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var a=Array(i);++r1),a}),ts(t,r_(t),n),r&&(n=p_(n,Gut|Wut|Yut,zut));for(var i=e.length;i--;)Fut(n,e[i]);return n}),hb=Hut;function $ut(t){return t===void 0}var Vut=$ut;function Uut(t,e,n){return t==null?t:gN(t,e,n)}var qt=Uut,MN=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,a;r1&&qt(r,"children",[{type:"interval"}]);var i=r.scale,a=r.markBackground,o=r.data,s=r.children,c=r.yField,l=hn(i,"y.domain",[]);if(a&&l.length&&Xt(o)){var u="domainMax",f=o.map(function(d){var h;return hl(hl({originData:hl({},d)},hb(d,c)),(h={},h[u]=l[l.length-1],h))});s.unshift(hl({type:"interval",data:f,yField:u,tooltip:!1,style:{fill:"#eee"},label:!1},a))}return n};return Ve(e,Yn,Qe)(t)}var Jut=function(){var t=function(e,n){return function(r){var i=e.fill,a=i===void 0?"#2888FF":i,o=e.stroke,s=e.fillOpacity,c=s===void 0?1:s,l=e.strokeOpacity,u=l===void 0?.2:l,f=e.pitch,d=f===void 0?8:f,h=r[0],p=r[1],v=r[2],g=r[3],y=(p[1]-h[1])/2,m=n.document,b=m.createElement("g",{}),_=m.createElement("polygon",{style:{points:[h,[h[0]-d,h[1]+y],[v[0]-d,h[1]+y],g],fill:a,fillOpacity:c,stroke:o,strokeOpacity:u,inset:30}}),x=m.createElement("polygon",{style:{points:[[h[0]-d,h[1]+y],p,v,[v[0]-d,h[1]+y]],fill:a,fillOpacity:c,stroke:o,strokeOpacity:u}}),O=m.createElement("polygon",{style:{points:[h,[h[0]-d,h[1]+y],p,[h[0]+d,h[1]+y]],fill:a,fillOpacity:c-.2}});return b.appendChild(_),b.appendChild(x),b.appendChild(O),b}};S_("shape.interval.bar25D",t)},tft=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Jut();var eft=function(t){tft(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="Bar",n}return e.getDefaultOptions=function(){return{type:"view",coordinate:{transform:[{type:"transpose"}]},children:[{type:"interval"}],scale:{y:{nice:!0}},axis:{y:{title:!1},x:{title:!1}},interaction:{tooltip:{shared:!0},elementHighlightByColor:{background:!0}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return EN},e}(ze),nft=function(){var t=function(e,n){return function(r){var i=e.fill,a=i===void 0?"#2888FF":i,o=e.stroke,s=e.fillOpacity,c=s===void 0?1:s,l=e.strokeOpacity,u=l===void 0?.2:l,f=e.pitch,d=f===void 0?8:f,h=r[1][0]-r[0][0],p=h/2+r[0][0],v=n.document,g=v.createElement("g",{}),y=v.createElement("polygon",{style:{points:[[r[0][0],r[0][1]],[p,r[1][1]+d],[p,r[3][1]+d],[r[3][0],r[3][1]]],fill:a,fillOpacity:c,stroke:o,strokeOpacity:u,inset:30}}),m=v.createElement("polygon",{style:{points:[[p,r[1][1]+d],[r[1][0],r[1][1]],[r[2][0],r[2][1]],[p,r[2][1]+d]],fill:a,fillOpacity:c,stroke:o,strokeOpacity:u}}),b=v.createElement("polygon",{style:{points:[[r[0][0],r[0][1]],[p,r[1][1]-d],[r[1][0],r[1][1]],[p,r[1][1]+d]],fill:a,fillOpacity:c-.2}});return g.appendChild(m),g.appendChild(y),g.appendChild(b),g}};S_("shape.interval.column25D",t)},rft=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();nft();var ift=function(t){rft(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="column",n}return e.getDefaultOptions=function(){return{type:"view",scale:{y:{nice:!0}},interaction:{tooltip:{shared:!0},elementHighlightByColor:{background:!0}},axis:{y:{title:!1},x:{title:!1}},children:[{type:"interval"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return EN},e}(ze);function aft(t){var e=function(r){var i=r.options,a=i.children,o=a===void 0?[]:a,s=i.legend;return s&&o.forEach(function(c){if(!hn(c,"colorField")){var l=hn(c,"yField");qt(c,"colorField",function(){return l})}}),r},n=function(r){var i=r.options,a=i.annotations,o=a===void 0?[]:a,s=i.children,c=s===void 0?[]:s,l=i.scale,u=!1;return hn(l,"y.key")||c.forEach(function(f,d){if(!hn(f,"scale.y.key")){var h="child".concat(d,"Scale");qt(f,"scale.y.key",h);var p=f.annotations,v=p===void 0?[]:p;v.length>0&&(qt(f,"scale.y.independent",!1),v.forEach(function(g){qt(g,"scale.y.key",h)})),!u&&o.length>0&&hn(f,"scale.y.independent")===void 0&&(u=!0,qt(f,"scale.y.independent",!1),o.forEach(function(g){qt(g,"scale.y.key",h)}))}}),r};return Ve(e,n,Yn,Qe)(t)}var oft=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),AN=function(t){oft(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="DualAxes",n}return e.getDefaultOptions=function(){return{type:"view",axis:{y:{title:!1,tick:!1},x:{title:!1}},scale:{y:{independent:!0,nice:!0}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return aft},e}(ze);function sft(t){var e=function(a){var o=a.options,s=o.xField,c=o.colorField;return c||qt(o,"colorField",s),a},n=function(a){var o=a.options,s=o.compareField,c=o.transform,l=o.isTransposed,u=l===void 0?!0:l,f=o.coordinate;return c||(s?qt(o,"transform",[]):qt(o,"transform",[{type:"symmetryY"}])),!f&&u&&qt(o,"coordinate",{transform:[{type:"transpose"}]}),a},r=function(a){var o=a.options,s=o.compareField,c=o.seriesField,l=o.data,u=o.children,f=o.yField,d=o.isTransposed,h=d===void 0?!0:d;if(s||c){var p=Object.values(hN(l,function(v){return v[s||c]}));u[0].data=p[0],u.push({type:"interval",data:p[1],yField:function(v){return-v[f]}}),delete o.compareField,delete o.data}return c&&(qt(o,"type","spaceFlex"),qt(o,"ratio",[1,1]),qt(o,"direction",h?"row":"col"),delete o.seriesField),a},i=function(a){var o=a.options,s=o.tooltip,c=o.xField,l=o.yField;return s||qt(o,"tooltip",{title:!1,items:[function(u){return{name:u[c],value:u[l]}}]}),a};return Ve(e,n,r,i,Yn,Qe)(t)}var cft=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),lft=function(t){cft(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="column",n}return e.getDefaultOptions=function(){return{type:"view",scale:{x:{padding:0}},animate:{enter:{type:"fadeIn"}},axis:!1,shapeField:"funnel",label:{position:"inside",transform:[{type:"contrastReverse"}]},children:[{type:"interval"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return sft},e}(ze);function uft(t){return Ve(Yn,Qe)(t)}var fft=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),dft=function(t){fft(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="line",n}return e.getDefaultOptions=function(){return{type:"view",scale:{y:{nice:!0}},interaction:{tooltip:{shared:!0}},axis:{y:{title:!1},x:{title:!1}},children:[{type:"line"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return uft},e}(ze);function Ef(t){switch(typeof t){case"function":return t;case"string":return function(e){return hn(e,[t])};default:return function(){return t}}}var Wo=function(){return Wo=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&(d.x1=f[s],d.x2=d[s],d.y1=f[vl]),d},[]),u.shift(),c.push({type:"link",xField:["x1","x2"],yField:"y1",zIndex:-1,data:u,style:bb({stroke:"#697474"},l),label:!1,tooltip:!1}),r};return Ve(e,n,Yn,Qe)(t)}var Jft=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),tdt=function(t){Jft(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="waterfall",n}return e.getDefaultOptions=function(){return{type:"view",legend:null,tooltip:{field:mb,valueFormatter:"~s",name:"value"},axis:{y:{title:null,labelFormatter:"~s"},x:{title:null}},children:[{type:"interval",interaction:{elementHighlightByColor:{background:!0}}}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return Qft},e}(ze),edt="[object Number]";function ndt(t){return typeof t=="number"||ii(t)&&xr(t)==edt}var gl=ndt,rdt=Object.prototype,idt=rdt.hasOwnProperty,adt=iN(function(t,e){if(Rf(e)||ao(e)){ts(e,Qo(e),t);return}for(var n in e)idt.call(e,n)&&Bf(t,n,e[n])}),PN=adt,odt=/\s/;function sdt(t){for(var e=t.length;e--&&odt.test(t.charAt(e)););return e}var cdt=sdt,ldt=/^\s+/;function udt(t){return t&&t.slice(0,cdt(t)+1).replace(ldt,"")}var fdt=udt,TN=0/0,ddt=/^[-+]0x[0-9a-f]+$/i,hdt=/^0b[01]+$/i,pdt=/^0o[0-7]+$/i,vdt=parseInt;function gdt(t){if(typeof t=="number")return t;if(Tl(t))return TN;if(mn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=mn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=fdt(t);var n=hdt.test(t);return n||pdt.test(t)?vdt(t.slice(2),n?2:8):ddt.test(t)?TN:+t}var kN=gdt,CN=1/0,ydt=17976931348623157e292;function mdt(t){if(!t)return t===0?t:0;if(t=kN(t),t===CN||t===-CN){var e=t<0?-1:1;return e*ydt}return t===t?t:0}var bdt=mdt;function _dt(t){var e=bdt(t),n=e%1;return e===e?n?e-n:e:0}var LN=_dt,xdt=Hn.isFinite,Odt=Math.min;function wdt(t){var e=Math[t];return function(n,r){if(n=kN(n),r=r==null?0:Odt(LN(r),292),r&&xdt(n)){var i=(I0(n)+"e").split("e"),a=e(i[0]+"e"+(+i[1]+r));return i=(I0(a)+"e").split("e"),+(i[0]+"e"+(+i[1]-r))}return e(n)}}var Sdt=wdt,Mdt=Sdt("ceil"),Edt=Mdt,Adt=0/0;function Pdt(t){return typeof t=="number"?t:Tl(t)?Adt:+t}var NN=Pdt;function Tdt(t,e){return function(n,r){var i;if(n===void 0&&r===void 0)return e;if(n!==void 0&&(i=n),r!==void 0){if(i===void 0)return r;typeof n=="string"||typeof r=="string"?(n=R0(n),r=R0(r)):(n=NN(n),r=NN(r)),i=t(n,r)}return i}}var kdt=Tdt,Cdt=kdt(function(t,e){return t/e},1),Ldt=Cdt;function Ndt(t){var e=function(n){var r=n.options,i=r.data,a=r.binNumber,o=r.binWidth,s=r.children,c=r.channel,l=c===void 0?"count":c,u=hn(s,"[0].transform[0]",{});return gl(o)?(PN(u,{thresholds:Edt(Ldt(i.length,o)),y:l}),n):(gl(a)&&PN(u,{thresholds:a,y:l}),n)};return Ve(e,Yn,Qe)(t)}var jdt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rdt=function(t){jdt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="Histogram",n}return e.getDefaultOptions=function(){return{type:"view",autoFit:!0,axis:{y:{title:!1},x:{title:!1}},children:[{type:"rect",transform:[{type:"binX",y:"count"}],interaction:{elementHighlightByColor:{background:!0}}}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return Ndt},e}(ze);function Idt(t){var e=function(r){var i=r.options,a=i.tooltip,o=a===void 0?{}:a,s=i.colorField,c=i.sizeField;return o&&!o.field&&(o.field=s||c),r},n=function(r){var i=r.options,a=i.mark,o=i.children;return a&&(o[0].type=a),r};return Ve(e,n,Yn,Qe)(t)}var Ddt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Fdt=function(t){Ddt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="heatmap",n}return e.getDefaultOptions=function(){return{type:"view",legend:null,tooltip:{valueFormatter:"~s"},axis:{y:{title:null,grid:!0},x:{title:null,grid:!0}},children:[{type:"point",interaction:{elementHighlightByColor:{background:!0}}}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return Idt},e}(ze);function Bdt(t){var e=function(n){var r=n.options.boxType,i=r===void 0?"box":r;return n.options.children[0].type=i,n};return Ve(e,Yn,Qe)(t)}var zdt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gdt=function(t){zdt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="box",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"box"}],axis:{y:{title:!1},x:{title:!1}},tooltip:{items:[{name:"min",channel:"y"},{name:"q1",channel:"y1"},{name:"q2",channel:"y2"},{name:"q3",channel:"y3"},{name:"max",channel:"y4"}]}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return Bdt},e}(ze);function Wdt(t){var e=function(n){var r=n.options,i=r.data,a=[{type:"custom",callback:function(s){return{links:s}}}];if(Xt(i))i.length>0?qt(r,"data",{value:i,transform:a}):delete r.children;else if(hn(i,"type")==="fetch"&&hn(i,"value")){var o=hn(i,"transform");Xt(o)?qt(i,"transform",o.concat(a)):qt(i,"transform",a)}return n};return Ve(e,Yn,Qe)(t)}var Ydt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Hdt=function(t){Ydt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="sankey",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"sankey"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return Wdt},e}(ze);function $dt(t){var e=t.options.layout,n=e===void 0?"horizontal":e;return t.options.coordinate.transform=n!=="horizontal"?void 0:[{type:"transpose"}],t}function Vdt(t){$dt(t);var e=t.options.layout,n=e===void 0?"horizontal":e;return t.options.children.forEach(function(r){var i;!((i=r==null?void 0:r.coordinate)===null||i===void 0)&&i.transform&&(r.coordinate.transform=n!=="horizontal"?void 0:[{type:"transpose"}])}),t}function Udt(t){return t==null}var Xdt=Udt,qdt="[object String]";function Zdt(t){return typeof t=="string"||!Xt(t)&&ii(t)&&xr(t)==qdt}var jN=Zdt;function Kdt(t,e){return Gf(e,function(n){return t[n]})}var Qdt=Kdt;function Jdt(t){return t==null?[]:Qdt(t,Qo(t))}var tht=Jdt,eht=Math.max;function nht(t,e,n,r){t=ao(t)?t:tht(t),n=n&&!r?LN(n):0;var i=t.length;return n<0&&(n=eht(i+n,0)),jN(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&uN(t,e,n)>-1}var rht=nht,ia=function(){return ia=Object.assign||function(t){for(var e,n=1,r=arguments.length;n{const{value:ft,formatter:ve,precision:Wt,decimalSeparator:Pe,groupSeparator:Pn="",prefixCls:Xt}=ee;let he;if(typeof ve=="function")he=ve(ft);else{const Ye=String(ft),jn=Ye.match(/^(-?)(\d*)(\.(\d+))?$/);if(!jn||Ye==="-")he=Ye;else{const bn=jn[1];let Ce=jn[2]||"0",ue=jn[4]||"";Ce=Ce.replace(/\B(?=(\d{3})+(?!\d))/g,Pn),typeof Wt=="number"&&(ue=ue.padEnd(Wt,"0").slice(0,Wt>0?Wt:0)),ue&&(ue=`${Pe}${ue}`),he=[_t.createElement("span",{key:"int",className:`${Xt}-content-value-int`},bn,Ce),ue&&_t.createElement("span",{key:"decimal",className:`${Xt}-content-value-decimal`},ue)]}}return _t.createElement("span",{className:`${Xt}-content-value`},he)},Tr=tt(14747),hr=tt(91945),Qn=tt(45503);const pr=ee=>{const{componentCls:ft,marginXXS:ve,padding:Wt,colorTextDescription:Pe,titleFontSize:Pn,colorTextHeading:Xt,contentFontSize:he,fontFamily:Ye}=ee;return{[`${ft}`]:Object.assign(Object.assign({},(0,Tr.Wf)(ee)),{[`${ft}-title`]:{marginBottom:ve,color:Pe,fontSize:Pn},[`${ft}-skeleton`]:{paddingTop:Wt},[`${ft}-content`]:{color:Xt,fontSize:he,fontFamily:Ye,[`${ft}-content-value`]:{display:"inline-block",direction:"ltr"},[`${ft}-content-prefix, ${ft}-content-suffix`]:{display:"inline-block"},[`${ft}-content-prefix`]:{marginInlineEnd:ve},[`${ft}-content-suffix`]:{marginInlineStart:ve}}})}},ei=ee=>{const{fontSizeHeading3:ft,fontSize:ve}=ee;return{titleFontSize:ve,contentFontSize:ft}};var mi=(0,hr.I$)("Statistic",ee=>{const ft=(0,Qn.TS)(ee,{});return[pr(ft)]},ei),Ei=function(ee,ft){var ve={};for(var Wt in ee)Object.prototype.hasOwnProperty.call(ee,Wt)&&ft.indexOf(Wt)<0&&(ve[Wt]=ee[Wt]);if(ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Pe=0,Wt=Object.getOwnPropertySymbols(ee);Pe{const{prefixCls:ft,className:ve,rootClassName:Wt,style:Pe,valueStyle:Pn,value:Xt=0,title:he,valueRender:Ye,prefix:jn,suffix:bn,loading:Ce=!1,formatter:ue,precision:kr,decimalSeparator:Cr=".",groupSeparator:aa=",",onMouseEnter:Ti,onMouseLeave:or}=ee,ki=Ei(ee,["prefixCls","className","rootClassName","style","valueStyle","value","title","valueRender","prefix","suffix","loading","formatter","precision","decimalSeparator","groupSeparator","onMouseEnter","onMouseLeave"]),{getPrefixCls:oa,direction:Or,statistic:ni}=_t.useContext(Zt.E_),Hr=oa("statistic",ft),[Ci,sa,$o]=mi(Hr),no=_t.createElement(_r,{decimalSeparator:Cr,groupSeparator:aa,prefixCls:Hr,formatter:ue,precision:kr,value:Xt}),ro=bt()(Hr,{[`${Hr}-rtl`]:Or==="rtl"},ni==null?void 0:ni.className,ve,Wt,sa,$o),ca=(0,Xe.Z)(ki,{aria:!0,data:!0});return Ci(_t.createElement("div",Object.assign({},ca,{className:ro,style:Object.assign(Object.assign({},ni==null?void 0:ni.style),Pe),onMouseEnter:Ti,onMouseLeave:or}),he&&_t.createElement("div",{className:`${Hr}-title`},he),_t.createElement(Ut.Z,{paragraph:!1,loading:Ce,className:`${Hr}-skeleton`},_t.createElement("div",{style:Pn,className:`${Hr}-content`},jn&&_t.createElement("span",{className:`${Hr}-content-prefix`},jn),Ye?Ye(no):no,bn&&_t.createElement("span",{className:`${Hr}-content-suffix`},bn)))))};const Jn=[["Y",1e3*60*60*24*365],["M",1e3*60*60*24*30],["D",1e3*60*60*24],["H",1e3*60*60],["m",1e3*60],["s",1e3],["S",1]];function lr(ee,ft){let ve=ee;const Wt=/\[[^\]]*]/g,Pe=(ft.match(Wt)||[]).map(Ye=>Ye.slice(1,-1)),Pn=ft.replace(Wt,"[]"),Xt=Jn.reduce((Ye,jn)=>{let[bn,Ce]=jn;if(Ye.includes(bn)){const ue=Math.floor(ve/Ce);return ve-=ue*Ce,Ye.replace(new RegExp(`${bn}+`,"g"),kr=>{const Cr=kr.length;return ue.toString().padStart(Cr,"0")})}return Ye},Pn);let he=0;return Xt.replace(Wt,()=>{const Ye=Pe[he];return he+=1,Ye})}function tn(ee,ft){const{format:ve=""}=ft,Wt=new Date(ee).getTime(),Pe=Date.now(),Pn=Math.max(Wt-Pe,0);return lr(Pn,ve)}var Ai=function(ee,ft){var ve={};for(var Wt in ee)Object.prototype.hasOwnProperty.call(ee,Wt)&&ft.indexOf(Wt)<0&&(ve[Wt]=ee[Wt]);if(ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Pe=0,Wt=Object.getOwnPropertySymbols(ee);Pe{const{value:ft,format:ve="HH:mm:ss",onChange:Wt,onFinish:Pe}=ee,Pn=Ai(ee,["value","format","onChange","onFinish"]),Xt=(0,we.Z)(),he=_t.useRef(null),Ye=()=>{Pe==null||Pe(),he.current&&(clearInterval(he.current),he.current=null)},jn=()=>{const ue=yl(ft);ue>=Date.now()&&(he.current=setInterval(()=>{Xt(),Wt==null||Wt(ue-Date.now()),ue(jn(),()=>{he.current&&(clearInterval(he.current),he.current=null)}),[ft]);const bn=(ue,kr)=>tn(ue,Object.assign(Object.assign({},kr),{format:ve})),Ce=ue=>(0,Je.Tm)(ue,{title:void 0});return _t.createElement(vr,Object.assign({},Pn,{value:ft,valueRender:Ce,formatter:bn}))};var Xs=_t.memo(Yo);vr.Countdown=Xs;var Xi=vr,ml=function(ft){return(0,Et.Z)({},ft.componentCls,(0,Et.Z)((0,Et.Z)((0,Et.Z)((0,Et.Z)((0,Et.Z)({display:"flex",fontSize:ft.fontSize,"& + &":{marginBlockStart:4},"&-tip":{marginInlineStart:4},"&-wrapper":(0,Et.Z)({display:"flex",width:"100%"},"".concat(ft.componentCls,"-status"),{width:"14px"}),"&-icon":{marginInlineEnd:16},"&-trend-icon":{width:0,height:0,borderInlineEnd:"3.5px solid transparent",borderBlockEnd:"9px solid #000",borderInlineStart:"3.5px solid transparent","&-up":{transform:"rotate(0deg)"},"&-down":{transform:"rotate(180deg)"}},"&-content":(0,Et.Z)({width:"100%"},"".concat(ft.antCls,"-statistic-content"),{"&-value-int":{fontSize:ft.fontSizeHeading3}}),"&-description":{width:"100%"}},"".concat(ft.antCls,"-statistic-title"),{color:ft.colorText}),"&-trend-up",(0,Et.Z)({},"".concat(ft.antCls,"-statistic-content"),(0,Et.Z)({color:"#f5222d"},"".concat(ft.componentCls,"-trend-icon"),{borderBlockEndColor:"#f5222d"}))),"&-trend-down",(0,Et.Z)({},"".concat(ft.antCls,"-statistic-content"),(0,Et.Z)({color:"#389e0d"},"".concat(ft.componentCls,"-trend-icon"),{borderBlockEndColor:"#52c41a"}))),"& &-layout-horizontal",(0,Et.Z)((0,Et.Z)((0,Et.Z)({display:"flex",justifyContent:"space-between"},"".concat(ft.antCls,"-statistic-title"),{marginBlockEnd:0}),"".concat(ft.antCls,"-statistic-content-value"),{fontWeight:500}),"".concat(ft.antCls,"-statistic-title,").concat(ft.antCls,"-statistic-content,").concat(ft.antCls,"-statistic-content-suffix,").concat(ft.antCls,"-statistic-content-prefix,").concat(ft.antCls,"-statistic-content-value-decimal"),{fontSize:ft.fontSize})),"& &-layout-inline",(0,Et.Z)((0,Et.Z)((0,Et.Z)({display:"inline-flex",color:ft.colorTextSecondary},"".concat(ft.antCls,"-statistic-title"),{marginInlineEnd:"6px",marginBlockEnd:0}),"".concat(ft.antCls,"-statistic-content"),{color:ft.colorTextSecondary}),"".concat(ft.antCls,"-statistic-title,").concat(ft.antCls,"-statistic-content,").concat(ft.antCls,"-statistic-content-suffix,").concat(ft.antCls,"-statistic-content-prefix,").concat(ft.antCls,"-statistic-content-value-decimal"),{fontSize:ft.fontSizeSM})))};function bl(ee){return(0,Nt.Xj)("Statistic",function(ft){var ve=(0,lt.Z)((0,lt.Z)({},ft),{},{componentCls:".".concat(ee)});return[ml(ve)]})}var qs=["className","layout","style","description","children","title","tip","status","trend","prefix","icon"],_l=function(ft){var ve=ft.className,Wt=ft.layout,Pe=Wt===void 0?"inline":Wt,Pn=ft.style,Xt=ft.description,he=ft.children,Ye=ft.title,jn=ft.tip,bn=ft.status,Ce=ft.trend,ue=ft.prefix,kr=ft.icon,Cr=(0,te.Z)(ft,qs),aa=(0,_t.useContext)(_e.ZP.ConfigContext),Ti=aa.getPrefixCls,or=Ti("pro-card-statistic"),ki=bl(or),oa=ki.wrapSSR,Or=ki.hashId,ni=bt()(or,ve,Or),Hr=bt()("".concat(or,"-status"),Or),Ci=bt()("".concat(or,"-icon"),Or),sa=bt()("".concat(or,"-wrapper"),Or),$o=bt()("".concat(or,"-content"),Or),no=bt()(Or,(0,Et.Z)((0,Et.Z)({},"".concat(or,"-layout-").concat(Pe),Pe),"".concat(or,"-trend-").concat(Ce),Ce)),ro=jn&&(0,vt.jsx)(Ie.Z,{title:jn,children:(0,vt.jsx)(ke,{className:"".concat(or,"-tip ").concat(Or).trim()})}),ca=bt()("".concat(or,"-trend-icon"),Or,(0,Et.Z)({},"".concat(or,"-trend-icon-").concat(Ce),Ce)),Vo=Ce&&(0,vt.jsx)("div",{className:ca}),xl=bn&&(0,vt.jsx)("div",{className:Hr,children:(0,vt.jsx)(Ue.Z,{status:bn,text:null})}),Ol=kr&&(0,vt.jsx)("div",{className:Ci,children:kr});return oa((0,vt.jsxs)("div",{className:ni,style:Pn,children:[Ol,(0,vt.jsxs)("div",{className:sa,children:[xl,(0,vt.jsxs)("div",{className:$o,children:[(0,vt.jsx)(Xi,(0,lt.Z)({title:(Ye||ro)&&(0,vt.jsxs)(vt.Fragment,{children:[Ye,ro]}),prefix:(Vo||ue)&&(0,vt.jsxs)(vt.Fragment,{children:[Vo,ue]}),className:no},Cr)),Xt&&(0,vt.jsx)("div",{className:"".concat(or,"-description ").concat(Or).trim(),children:Xt})]})]})]}))},eo=_l,Zs=function(ft){return(0,Et.Z)({},ft.componentCls,{"&-chart":{display:"flex",flexDirection:"column",marginBlockStart:8,marginBlockEnd:8,"&-left":{marginBlockStart:0,marginInlineEnd:"16px"},"&-right":{marginBlockStart:0,marginInlineStart:"16px"}},"&-content":{display:"flex",flexDirection:"column","&-horizontal":(0,Et.Z)({flexDirection:"row"},"".concat(ft.componentCls,"-chart"),{alignItems:"center",alignSelf:"flex-start"})},"&-footer":{marginBlockStart:8,paddingBlockStart:"16px",borderBlockStart:"rgba(0, 0, 0, 0.08) solid ".concat(ft.colorBorder)}})};function xr(ee){return(0,Nt.Xj)("StatisticCard",function(ft){var ve=(0,lt.Z)((0,lt.Z)({},ft),{},{componentCls:".".concat(ee)});return[Zs(ve)]})}var Ks=["children","statistic","className","chart","chartPlacement","footer"],mn=function(ft){var ve=ft.children,Wt=ft.statistic,Pe=ft.className,Pn=ft.chart,Xt=ft.chartPlacement,he=ft.footer,Ye=(0,te.Z)(ft,Ks),jn=(0,_t.useContext)(_e.ZP.ConfigContext),bn=jn.getPrefixCls,Ce=bn("pro-statistic-card"),ue=xr(Ce),kr=ue.wrapSSR,Cr=ue.hashId,aa=bt()(Ce,Pe,Cr),Ti=Wt&&(0,vt.jsx)(eo,(0,lt.Z)({layout:"vertical"},Wt)),or=bt()("".concat(Ce,"-chart"),Cr,(0,Et.Z)((0,Et.Z)({},"".concat(Ce,"-chart-left"),Xt==="left"&&Pn&&Wt),"".concat(Ce,"-chart-right"),Xt==="right"&&Pn&&Wt)),ki=Pn&&(0,vt.jsx)("div",{className:or,children:Pn}),oa=bt()("".concat(Ce,"-content "),Cr,(0,Et.Z)({},"".concat(Ce,"-content-horizontal"),Xt==="left"||Xt==="right")),Or=(ki||Ti)&&(Xt==="left"?(0,vt.jsxs)("div",{className:oa,children:[ki,Ti]}):(0,vt.jsxs)("div",{className:oa,children:[Ti,ki]})),ni=he&&(0,vt.jsx)("div",{className:"".concat(Ce,"-footer ").concat(Cr).trim(),children:he});return kr((0,vt.jsxs)(Pt.Z,(0,lt.Z)((0,lt.Z)({className:aa},Ye),{},{children:[Or,ve,ni]})))},Qs=function(ft){return(0,vt.jsx)(mn,(0,lt.Z)({bodyStyle:{padding:0}},ft))};mn.Statistic=eo,mn.Divider=K.Z,mn.Operation=ot,mn.isProCard=!0,mn.Group=Qs;var Ho=mn},34540:function(je,In,tt){"use strict";var Et=tt(1413),lt=tt(91),te=tt(86190),_e=tt(67294),zt=tt(66758),bt=tt(59141),_t=tt(85893),Pt=["fieldProps","proFieldProps"],K="dateRange",Nt=_e.forwardRef(function(St,kt){var vt=St.fieldProps,ut=St.proFieldProps,ot=(0,lt.Z)(St,Pt),rt=(0,_e.useContext)(zt.Z);return(0,_t.jsx)(bt.Z,(0,Et.Z)({ref:kt,fieldProps:(0,Et.Z)({getPopupContainer:rt.getPopupContainer},vt),valueType:K,proFieldProps:ut,filedConfig:{valueType:K,customLightMode:!0,lightFilterLabelFormatter:function(Gt){return(0,te.c)(Gt,(vt==null?void 0:vt.format)||"YYYY-MM-DD")}}},ot))});In.Z=Nt},64317:function(je,In,tt){"use strict";var Et=tt(1413),lt=tt(91),te=tt(22270),_e=tt(67294),zt=tt(66758),bt=tt(59141),_t=tt(85893),Pt=["fieldProps","children","params","proFieldProps","mode","valueEnum","request","showSearch","options"],K=["fieldProps","children","params","proFieldProps","mode","valueEnum","request","options"],Nt=function(rt,ht){var Gt=rt.fieldProps,oe=rt.children,We=rt.params,ke=rt.proFieldProps,Ie=rt.mode,Ue=rt.valueEnum,we=rt.request,Je=rt.showSearch,Xe=rt.options,Zt=(0,lt.Z)(rt,Pt),Ut=(0,_e.useContext)(zt.Z);return(0,_t.jsx)(bt.Z,(0,Et.Z)((0,Et.Z)({valueEnum:(0,te.h)(Ue),request:we,params:We,valueType:"select",filedConfig:{customLightMode:!0},fieldProps:(0,Et.Z)({options:Xe,mode:Ie,showSearch:Je,getPopupContainer:Ut.getPopupContainer},Gt),ref:ht,proFieldProps:ke},Zt),{},{children:oe}))},St=_e.forwardRef(function(ot,rt){var ht=ot.fieldProps,Gt=ot.children,oe=ot.params,We=ot.proFieldProps,ke=ot.mode,Ie=ot.valueEnum,Ue=ot.request,we=ot.options,Je=(0,lt.Z)(ot,K),Xe=(0,Et.Z)({options:we,mode:ke||"multiple",labelInValue:!0,showSearch:!0,suffixIcon:null,autoClearSearchValue:!0,optionLabelProp:"label"},ht),Zt=(0,_e.useContext)(zt.Z);return(0,_t.jsx)(bt.Z,(0,Et.Z)((0,Et.Z)({valueEnum:(0,te.h)(Ie),request:Ue,params:oe,valueType:"select",filedConfig:{customLightMode:!0},fieldProps:(0,Et.Z)({getPopupContainer:Zt.getPopupContainer},Xe),ref:rt,proFieldProps:We},Je),{},{children:Gt}))}),kt=_e.forwardRef(Nt),vt=St,ut=kt;ut.SearchSelect=vt,ut.displayName="ProFormComponent",In.Z=ut},17816:function(je,In){(function(tt,Et){Et(In)})(this,function(tt){"use strict";function Et(L){var j=typeof Symbol=="function"&&Symbol.iterator,B=j&&L[j],G=0;if(B)return B.call(L);if(L&&typeof L.length=="number")return{next:function(){return{value:(L=L&&G>=L.length?void 0:L)&&L[G++],done:!L}}};throw new TypeError(j?"Object is not iterable.":"Symbol.iterator is not defined.")}function lt(L,j){var B=typeof Symbol=="function"&&L[Symbol.iterator];if(!B)return L;var G,U,X=B.call(L),Y=[];try{for(;(j===void 0||0U=>B(G(U)),L)}function Je(L,j){return j-L?B=>(B-L)/(j-L):B=>.5}const Xe=Math.sqrt(50),Zt=Math.sqrt(10),Ut=Math.sqrt(2);function ar(L,j,B){return j=(j-L)/Math.max(0,B),L=Math.floor(Math.log(j)/Math.LN10),B=j/ir(10,L),0<=L?(B>=Xe?10:B>=Zt?5:B>=Ut?2:1)*ir(10,L):-ir(10,-L)/(B>=Xe?10:B>=Zt?5:B>=Ut?2:1)}const _r=(L,j,B=5)=>{L=[L,j];let G=0,U=L.length-1,X=L[G],Y=L[U],H;return Y{B.prototype.rescale=function(){this.initRange(),this.nice();var[G]=this.chooseTransforms();this.composeOutput(G,this.chooseClamp(G))},B.prototype.initRange=function(){var G=this.options.interpolator;this.options.range=L(G)},B.prototype.composeOutput=function(G,U){var X,{domain:H,interpolator:Y,round:q}=this.getOptions(),H=j(H.map(G)),q=q?(X=Y,Z=>(Z=X(Z),K(Z)?Math.round(Z):Z)):Y;this.output=we(q,H,U,G)},B.prototype.invert=void 0}}var Qn,ue={exports:{}},Ce={exports:{}},pr=function(L){return!(!L||typeof L=="string")&&(L instanceof Array||Array.isArray(L)||0<=L.length&&(L.splice instanceof Function||Object.getOwnPropertyDescriptor(L,L.length-1)&&L.constructor.name!=="String"))},ei=Array.prototype.concat,mi=Array.prototype.slice,Ei=Ce.exports=function(L){for(var j=[],B=0,G=L.length;BB=>L*(1-B)+j*B,ml=(L,j)=>{if(typeof L=="number"&&typeof j=="number")return Xi(L,j);if(typeof L!="string"||typeof j!="string")return()=>L;{var B=L,G=j;const U=Xs(B),X=Xs(G);return U===null||X===null?U?()=>B:()=>G:Y=>{var H=new Array(4);for(let jt=0;jt<4;jt+=1){var q=U[jt],Z=X[jt];H[jt]=q*(1-Y)+Z*Y}var[Ot,wt,Ft,mt]=H;return`rgba(${Math.round(Ot)}, ${Math.round(wt)}, ${Math.round(Ft)}, ${mt})`}}},bl=(L,j)=>{const B=Xi(L,j);return G=>Math.round(B(G))};function qs({map:L,initKey:j},B){return j=j(B),L.has(j)?L.get(j):B}function _l(L){return typeof L=="object"?L.valueOf():L}class eo extends Map{constructor(j){if(super(),this.map=new Map,this.initKey=_l,j!==null)for(var[B,G]of j)this.set(B,G)}get(j){return super.get(qs({map:this.map,initKey:this.initKey},j))}has(j){return super.has(qs({map:this.map,initKey:this.initKey},j))}set(j,B){return super.set(([{map:j,initKey:G},U]=[{map:this.map,initKey:this.initKey},j],G=G(U),j.has(G)?j.get(G):(j.set(G,U),U)),B);var G,U}delete(j){return super.delete(([{map:j,initKey:B},G]=[{map:this.map,initKey:this.initKey},j],B=B(G),j.has(B)&&(G=j.get(B),j.delete(B)),G));var B,G}}class Zs{constructor(j){this.options=kt({},this.getDefaultOptions()),this.update(j)}getOptions(){return this.options}update(j={}){this.options=kt({},this.options,j),this.rescale(j)}rescale(j){}}const xr=Symbol("defaultUnknown");function Ks(L,j,B){for(let G=0;G""+j:typeof L=="object"?j=>JSON.stringify(j):j=>j}class Ho extends Zs{getDefaultOptions(){return{domain:[],range:[],unknown:xr}}constructor(j){super(j)}map(j){return this.domainIndexMap.size===0&&Ks(this.domainIndexMap,this.getDomain(),this.domainKey),mn({value:this.domainKey(j),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(j){return this.rangeIndexMap.size===0&&Ks(this.rangeIndexMap,this.getRange(),this.rangeKey),mn({value:this.rangeKey(j),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(j){var[B]=this.options.domain,[G]=this.options.range;this.domainKey=Qs(B),this.rangeKey=Qs(G),this.rangeIndexMap?(j&&!j.range||this.rangeIndexMap.clear(),j&&!j.domain&&!j.compare||(this.domainIndexMap.clear(),this.sortedDomain=void 0)):(this.rangeIndexMap=new Map,this.domainIndexMap=new Map)}clone(){return new Ho(this.options)}getRange(){return this.options.range}getDomain(){var j,B;return this.sortedDomain||({domain:j,compare:B}=this.options,this.sortedDomain=B?[...j].sort(B):j),this.sortedDomain}}function ee(gt){const{domain:j,range:B,paddingOuter:G,paddingInner:U,flex:X,round:Y,align:H}=gt;var q=j.length,mt=0<(mt=(gt=q)-(Z=X).length)?[...Z,...new Array(mt).fill(1)]:mt<0?Z.slice(0,gt):Z,[gt,Z]=B,Z=Z-gt,Ct=Z/(2/q*G+1-1/q*U);const Ot=Ct*U/q;Ct-=q*Ot;const wt=function(Lt){const Ht=Math.min(...Lt);return Lt.map(xe=>xe/Ht)}(mt),Ft=Ct/wt.reduce((Lt,Ht)=>Lt+Ht);var mt=new eo(j.map((Lt,Ht)=>(Ht=wt[Ht]*Ft,[Lt,Y?Math.floor(Ht):Ht]))),jt=new eo(j.map((Lt,Ht)=>(Ht=wt[Ht]*Ft+Ot,[Lt,Y?Math.floor(Ht):Ht]))),Ct=Array.from(jt.values()).reduce((Lt,Ht)=>Lt+Ht),gt=gt+(Z-(Ct-Ct/q*U))*H;let $t=Y?Math.round(gt):gt;var Dt=new Array(q);for(let Lt=0;LtCt+$t*mt),{valueStep:mt,valueBandWidth:jt,adjustedRange:Z}}({align:G,range:U,round:X,flex:B,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:j});this.valueStep=X,this.valueBandWidth=U,this.adjustedRange=G}}const ve=(L,j,B)=>{let G,U,X=L,Y=j;if(X===Y&&0{var[G,U]=G,[X,Y]=X;let H,q;return we(q=G{const G=Math.min(L.length,j.length)-1,U=new Array(G),X=new Array(G);var Y=L[0]>L[G],H=Y?[...L].reverse():L,q=Y?[...j].reverse():j;for(let Z=0;Z{var Ot=function(Ft,mt,jt,Ct,gt){let $t=jt||0,Dt=Ct||Ft.length;for(var Vt=gt||(Ht=>Ht);$tmt?Dt=Lt:$t=Lt+1}return $t}(L,Z,1,G)-1,wt=U[Ot];return we(X[Ot],wt)(Z)}},Pn=(L,j,B,G)=>(2Math.min(Math.max(X,H),Y)}return vt}composeOutput(j,B){var{domain:Y,range:G,round:U,interpolate:X}=this.options,Y=Pn(Y.map(j),G,X,U);this.output=we(Y,B,j)}composeInput(j,B,G){var{domain:U,range:X}=this.options,X=Pn(X,U.map(j),Xi);this.input=we(B,G,X)}}class he extends Xt{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:ml,tickMethod:ve,tickCount:5}}chooseTransforms(){return[vt,vt]}clone(){return new he(this.options)}}class Ye extends ft{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:xr,paddingInner:1,paddingOuter:0}}constructor(j){super(j)}getPaddingInner(){return 1}clone(){return new Ye(this.options)}update(j){super.update(j)}getPaddingOuter(){return this.options.padding}}function jn(L,j){for(var B=[],G=0,U=L.length;G{var[j,B]=j;return we(Xi(0,1),Je(j,B))})],aa);let Ti=Cr=class extends he{getDefaultOptions(){return{domain:[0,.5,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:vt,tickMethod:ve,tickCount:5}}constructor(L){super(L)}clone(){return new Cr(this.options)}};Ti=Cr=function(L,j,B,G){var U,X=arguments.length,Y=X<3?j:G===null?G=Object.getOwnPropertyDescriptor(j,B):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(L,j,B,G);else for(var H=L.length-1;0<=H;H--)(U=L[H])&&(Y=(X<3?U(Y):3{const[j,B,G]=L,U=we(Xi(0,.5),Je(j,B)),X=we(Xi(.5,1),Je(B,G));return Y=>(j>G?Y=4&&K[3]!==1&&(Nt=", "+K[3]),"hwb("+K[0]+", "+K[1]+"%, "+K[2]+"%"+Nt+")"},bt.to.keyword=function(K){return _e[K.slice(0,3)]};function _t(K,Nt,St){return Math.min(Math.max(Nt,K),St)}function Pt(K){var Nt=Math.round(K).toString(16).toUpperCase();return Nt.length<2?"0"+Nt:Nt}},26729:function(je){"use strict";var In=Object.prototype.hasOwnProperty,tt="~";function Et(){}Object.create&&(Et.prototype=Object.create(null),new Et().__proto__||(tt=!1));function lt(bt,_t,Pt){this.fn=bt,this.context=_t,this.once=Pt||!1}function te(bt,_t,Pt,K,Nt){if(typeof Pt!="function")throw new TypeError("The listener must be a function");var St=new lt(Pt,K||bt,Nt),kt=tt?tt+_t:_t;return bt._events[kt]?bt._events[kt].fn?bt._events[kt]=[bt._events[kt],St]:bt._events[kt].push(St):(bt._events[kt]=St,bt._eventsCount++),bt}function _e(bt,_t){--bt._eventsCount===0?bt._events=new Et:delete bt._events[_t]}function zt(){this._events=new Et,this._eventsCount=0}zt.prototype.eventNames=function(){var _t=[],Pt,K;if(this._eventsCount===0)return _t;for(K in Pt=this._events)In.call(Pt,K)&&_t.push(tt?K.slice(1):K);return Object.getOwnPropertySymbols?_t.concat(Object.getOwnPropertySymbols(Pt)):_t},zt.prototype.listeners=function(_t){var Pt=tt?tt+_t:_t,K=this._events[Pt];if(!K)return[];if(K.fn)return[K.fn];for(var Nt=0,St=K.length,kt=new Array(St);Nt0)throw"Initial bisect points must have opposite signs";if(oe===0)return ut;if(We===0)return ot;for(var Ie=0;Ie=0&&(ut=Ue),Math.abs(ke)=Zt[Xe-1].fx){var Jn=!1;if(Qn.fx>vr.fx?(_t(pr,1+Ue,hr,-Ue,vr),pr.fx=vt(pr),pr.fx=1)break;for(Ut=1;UtWe+Gt*ht*ke||Ie>=_r)ar=ht;else{if(Math.abs(we)<=-oe*ke)return ht;we*(ar-Ut)>=0&&(ar=Ut),Ut=ht,_r=Ie}return 0}for(var Zt=0;Zt<10;++Zt){if(_t(rt.x,1,ot.x,ht,ut),Ie=rt.fx=vt(rt.x,rt.fxprime),we=_e(rt.fxprime,ut),Ie>We+Gt*ht*ke||Zt&&Ie>=Ue)return Xe(Je,ht,Ue);if(Math.abs(we)<=-oe*ke)return ht;if(we>=0)return Xe(ht,Je,Ie);Ue=Ie,Je=ht,ht*=2}return ht}function Nt(vt,ut,ot){var rt={x:ut.slice(),fx:0,fxprime:ut.slice()},ht={x:ut.slice(),fx:0,fxprime:ut.slice()},Gt=ut.slice(),oe,We,ke=1,Ie;ot=ot||{},Ie=ot.maxIterations||ut.length*20,rt.fx=vt(rt.x,rt.fxprime),oe=rt.fxprime.slice(),bt(oe,rt.fxprime,-1);for(var Ue=0;Ue=ht.length)){var ar=Math.max(Ut-St,0),_r=Ut,Tr=Math.min(Ut+St,ht.length-1),hr=ar-(Ut-St),Qn=Ut+St-Tr,pr=We[-St-1+hr]||0,ei=We[-St-1+Qn]||0,mi=ke/(ke-pr-ei);hr>0&&(Ue+=mi*(hr-1)*Ie);var Ei=Math.max(0,Ut-St+1);zt.inside(0,ht.length-1,Ei)&&(ht[Ei].y+=mi*1*Ie),zt.inside(0,ht.length-1,_r+1)&&(ht[_r+1].y-=mi*2*Ie),zt.inside(0,ht.length-1,Tr+1)&&(ht[Tr+1].y+=mi*1*Ie)}});var we=Ue,Je=0,Xe=0;return ht.forEach(function(Zt){Je+=Zt.y,we+=Je,Zt.y=we,Xe+=we}),Xe>0&&ht.forEach(function(Zt){Zt.y/=Xe}),ht};function _t(Pt,K){for(var Nt={},St=0,kt=-K;kt<=K;kt++)St+=Pt(kt/K),Nt[kt]=St;return Nt}je.exports.getExpectedValueFromPdf=function(Pt){if(!(!Pt||Pt.length===0)){var K=0;return Pt.forEach(function(Nt){K+=Nt.x*Nt.y}),K}},je.exports.getXWithLeftTailArea=function(Pt,K){if(!(!Pt||Pt.length===0)){for(var Nt=0,St=0,kt=0;kt=K));kt++);return Pt[St].x}},je.exports.getPerplexity=function(Pt){if(!(!Pt||Pt.length===0)){var K=0;return Pt.forEach(function(Nt){var St=Math.log(Nt.y);isFinite(St)&&(K+=Nt.y*St)}),K=-K/te,Math.pow(2,K)}}},86851:function(je,In,tt){"use strict";var Et=tt(89594),lt=Array.prototype.concat,te=Array.prototype.slice,_e=je.exports=function(bt){for(var _t=[],Pt=0,K=bt.length;Pt=0&&(tt.splice instanceof Function||Object.getOwnPropertyDescriptor(tt,tt.length-1)&&tt.constructor.name!=="String")}},64599:function(je,In,tt){var Et=tt(96263);function lt(te,_e){var zt=typeof Symbol!="undefined"&&te[Symbol.iterator]||te["@@iterator"];if(!zt){if(Array.isArray(te)||(zt=Et(te))||_e&&te&&typeof te.length=="number"){zt&&(te=zt);var bt=0,_t=function(){};return{s:_t,n:function(){return bt>=te.length?{done:!0}:{done:!1,value:te[bt++]}},e:function(kt){throw kt},f:_t}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Pt=!0,K=!1,Nt;return{s:function(){zt=zt.call(te)},n:function(){var kt=zt.next();return Pt=kt.done,kt},e:function(kt){K=!0,Nt=kt},f:function(){try{!Pt&&zt.return!=null&&zt.return()}finally{if(K)throw Nt}}}}je.exports=lt,je.exports.__esModule=!0,je.exports.default=je.exports}}]); }());