f&&(f=M),Eh&&(h=A),Nv&&(v=k),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),x=Math.abs(f),_=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]+x*o[1]+_*o[2],i[2]=O*o[0]+w*o[1]+S*o[2],tv(this.min,r,i),Qf(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=i9([0,0,0],this.getMin(),e.getMin()),i=a9([0,0,0],this.getMax(),e.getMax());return n.setMinMax(r,i),n},t.prototype.getNegativeFarPoint=function(e){return e.pnVertexFlag===273?rc([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?rc([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}(),p9=function(){function t(e,n){this.distance=e||0,this.normal=n||Pe(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 ji(e,this.normal)-this.distance},t.prototype.normalize=function(){var e=1/yx(this.normal);F0(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&&z0(r,e,n,o),s},t}(),eo;(function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"})(eo||(eo={}));var v9=function(){function t(e){if(this.planes=[],e)this.planes=e;else for(var n=0;n<6;n++)this.planes.push(new p9)}return t.prototype.extractFromVPMatrix=function(e){var n=I(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];Ii(this.planes[0].normal,o-r,u-s,p-f),this.planes[0].distance=m-v,Ii(this.planes[1].normal,o+r,u+s,p+f),this.planes[1].distance=m+v,Ii(this.planes[2].normal,o+i,u+c,p+d),this.planes[2].distance=m+g,Ii(this.planes[3].normal,o-i,u-c,p-d),this.planes[3].distance=m-g,Ii(this.planes[4].normal,o-a,u-l,p-h),this.planes[4].distance=m-y,Ii(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}(),rr=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}(),ts=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}(),Qe="Method not implemented.",ac="Use document.documentElement instead.",g9="Cannot append a destroyed element.",We;(function(t){t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING"})(We||(We={}));var kl;(function(t){t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC"})(kl||(kl={}));var Wr;(function(t){t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE"})(Wr||(Wr={}));var w_={UPDATED:"updated"},S_=2e-4,M_=function(){function t(){this.clipSpaceNearZ=nc.NEGATIVE_ONE,this.eventEmitter=new B0,this.matrix=on(),this.right=Pe(1,0,0),this.up=Pe(0,1,0),this.forward=Pe(0,0,1),this.position=Pe(0,0,1),this.focalPoint=Pe(0,0,0),this.distanceVector=Pe(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=on(),this.projectionMatrixInverse=on(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=We.EXPLORING,this.trackingMode=kl.DEFAULT,this.projectionMode=Wr.PERSPECTIVE,this.frustum=new v9,this.orthoMatrix=on()}return t.prototype.isOrtho=function(){return this.projectionMode===Wr.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===We.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===We.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!==We.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 qi(on(),this.matrix)},t.prototype.getWorldTransform=function(){return this.matrix},t.prototype.jitterProjectionMatrix=function(e,n){var r=wx(on(),[e,n,0]);this.jitteredProjectionMatrix=br(on(),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.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===Wr.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===Wr.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===Wr.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===Wr.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===Wr.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===Wr.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=Pe(c-i,l-a,0),f=ji(u,this.right)/Oa(this.right),d=ji(u,this.up)/Oa(this.up);return this.pan(-f,-d),this},t.prototype.setPerspective=function(e,n,r,i){var a;this.projectionMode=Wr.PERSPECTIVE,this.fov=r,this.near=e,this.far=n,this.aspect=i;var o=this.near*Math.tan(Mn(.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 u9(this.projectionMatrix,l,l+c,o,o-s,e,this.far,this.clipSpaceNearZ===nc.ZERO),jf(this.projectionMatrix,this.projectionMatrix,Pe(1,-1,1)),qi(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},t.prototype.setOrthographic=function(e,n,r,i,a,o){var s;this.projectionMode=Wr.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===nc.NEGATIVE_ONE?Px(this.projectionMatrix,d,h,v,p,a,o):Tx(this.projectionMatrix,d,h,v,p,a,o),jf(this.projectionMatrix,this.projectionMatrix,Pe(1,-1,1)),qi(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=Cr(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=Pe(0,1,0);if(this.focalPoint=Cr(e,n,r),this.trackingMode===kl.CINEMATIC){var a=vx(ve(),this.focalPoint,this.position);e=a[0],n=a[1],r=a[2];var o=Oa(a),s=pi(Math.asin(n/o)),c=90+pi(Math.atan2(r,e)),l=on();Ox(l,l,Mn(c)),_x(l,l,Mn(s)),i=tr(ve(),[0,1,0],l)}return qi(this.matrix,kx(on(),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=St.kEms&&e=no.kUnitType&&this.getType()<=no.kClampType},t}(),O9=function(t){Bt(e,t);function e(n){var r=t.call(this)||this;return r.colorSpace=n,r}return e.prototype.getType=function(){return no.kColorType},e.prototype.to=function(n){return this},e}(Jf),ta;(function(t){t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient"})(ta||(ta={}));var td=function(t){Bt(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 no.kColorType},e}(Jf),Hr=function(t){Bt(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 no.kKeywordType},e.prototype.buildCSSText=function(n,r,i){return i+this.value},e}(Jf),w9=_r(function(t){return t===void 0&&(t=""),t.replace(/-([a-z])/g,function(e){return e[1].toUpperCase()})}),P_=function(t){return t.split("").map(function(e,n){return e.toUpperCase()===e?"".concat(n!==0?"-":"").concat(e.toLowerCase()):e}).join("")};function S9(t){if(!t)throw new Error}function oc(t){return typeof t=="function"}function M9(t){return typeof t=="symbol"}var Dvt=function(t){return Object.fromEntries(Object.entries(t).filter(function(e){var n=__read(e,2),r=n[1];return r!==void 0}))},E9={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},ov=_r(function(t){var e=w9(t),n=E9[e];return e=(n==null?void 0:n.alias)||e,e}),A9=function(t,e){e===void 0&&(e="");var n="";return Number.isFinite(t)?(S9(Number.isNaN(t)),n="NaN"):t>0?n="infinity":n="-infinity",n+=e},sv=function(t){return _9(x9(t))},Je=function(t){Bt(e,t);function e(n,r){r===void 0&&(r=St.kNumber);var i=t.call(this)||this,a;return typeof r=="string"?a=b9(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 no.kUnitType},e.prototype.convertTo=function(n){if(this.unit===n)return new e(this.value,this.unit);var r=sv(this.unit);if(r!==sv(n)||r===St.kUnknown)return null;var i=A_(this.unit)/A_(n);return new e(this.value*i,n)},e.prototype.buildCSSText=function(n,r,i){var a;switch(this.unit){case St.kUnknown:break;case St.kInteger:a=Number(this.value).toFixed(0);break;case St.kNumber:case St.kPercentage:case St.kEms:case St.kRems:case St.kPixels:case St.kDegrees:case St.kRadians:case St.kGradians:case St.kMilliseconds:case St.kSeconds:case St.kTurns:{var o=-999999,s=999999,c=this.value,l=av(this.unit);if(cs){var u=av(this.unit);!Number.isFinite(c)||Number.isNaN(c)?a=A9(c,u):a=c+(u||"")}else a="".concat(c).concat(l)}}return i+=a,i},e}(Jf),ir=new Je(0,"px");new Je(1,"px");var wa=new Je(0,"deg"),cv=function(t){Bt(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}(O9),sn=new Hr("unset"),P9=new Hr("initial"),T9=new Hr("inherit"),lv={"":sn,unset:sn,initial:P9,inherit:T9},uv=function(t){return lv[t]||(lv[t]=new Hr(t)),lv[t]},fv=new cv(0,0,0,0,!0),T_=new cv(0,0,0,0),k9=_r(function(t,e,n,r){return new cv(t,e,n,r)},function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")}),En=function(t,e){return e===void 0&&(e=St.kNumber),new Je(t,e)},ed=new Je(50,"%"),dv;(function(t){t[t.Standard=0]="Standard"})(dv||(dv={}));var sc;(function(t){t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"})(sc||(sc={}));var k_={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new ts(0,0,0,0)},At;(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=""})(At||(At={}));function C9(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 L9=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(j){throw new Error(e+": "+j)}function r(){var j=i();return e.length>0&&n("Invalid input not EOF"),j}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(j,D,B){return s(D,function(z){var W=B();return W&&(T(t.comma)||n("Missing comma before color stops")),{type:j,orientation:W,colorStops:b(x)}})}function s(j,D){var B=T(j);if(B){T(t.startCall)||n("Missing (");var z=D(B);return T(t.endCall)||n("Missing )"),z}}function c(){return l()||u()}function l(){return P("directional",t.sideOrCorner,1)}function u(){return P("angular",t.angleValue,1)}function f(){var j,D=d(),B;return D&&(j=[],j.push(D),B=e,T(t.comma)&&(D=d(),D?j.push(D):e=B)),j}function d(){var j=h()||p();if(j)j.at=g();else{var D=v();if(D){j=D;var B=g();B&&(j.at=B)}else{var z=y();z&&(j={type:"default-radial",at:z})}}return j}function h(){var j=P("shape",/^(circle)/i,0);return j&&(j.style=k()||v()),j}function p(){var j=P("shape",/^(ellipse)/i,0);return j&&(j.style=A()||v()),j}function v(){return P("extent-keyword",t.extentKeywords,1)}function g(){if(P("position",/^at/,0)){var j=y();return j||n("Missing positioning value"),j}}function y(){var j=m();if(j.x||j.y)return{type:"position",value:j}}function m(){return{x:A(),y:A()}}function b(j){var D=j(),B=[];if(D)for(B.push(D);T(t.comma);)D=j(),D?B.push(D):n("One extra comma");return B}function x(){var j=_();return j||n("Expected color definition"),j.length=A(),j}function _(){return w()||M()||S()||O()}function O(){return P("literal",t.literalColor,0)}function w(){return P("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 T(t.number)[1]}function A(){return P("%",t.percentageValue,1)||N()||k()}function N(){return P("position-keyword",t.positionKeywords,1)}function k(){return P("px",t.pixelValue,1)||P("em",t.emValue,1)}function P(j,D,B){var z=T(D);if(z)return{type:j,value:z[B]}}function T(j){var D=/^[\n\r\t\s]+/.exec(e);D&&L(D[0].length);var B=j.exec(e);return B&&L(B[0].length),B}function L(j){e=e.substring(j)}return function(j){return e=j,r()}}();function N9(t,e,n){var r=Mn(n.value),i=0,a=0,o=i+t/2,s=a+e/2,c=Math.abs(t*Math.cos(r))+Math.abs(e*Math.sin(r)),l=o-Math.cos(r)*c/2,u=s-Math.sin(r)*c/2,f=o+Math.cos(r)*c/2,d=s+Math.sin(r)*c/2;return{x1:l,y1:u,x2:f,y2:d}}function R9(t,e,n,r,i){var a=n.value,o=r.value;n.unit===St.kPercentage&&(a=n.value/100*t),r.unit===St.kPercentage&&(o=r.value/100*e);var s=Math.max(Gr([0,0],[a,o]),Gr([0,e],[a,o]),Gr([t,e],[a,o]),Gr([t,0],[a,o]));return i&&(i instanceof Je?s=i.value:i instanceof Hr&&(i.value==="closest-side"?s=Math.min(a,t-a,o,e-o):i.value==="farthest-side"?s=Math.max(a,t-a,o,e-o):i.value==="closest-corner"&&(s=Math.min(Gr([0,0],[a,o]),Gr([0,e],[a,o]),Gr([t,e],[a,o]),Gr([t,0],[a,o]))))),{x:a,y:o,r:s}}var I9=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,j9=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,D9=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,C_=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function B9(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=L9(t);return n.map(function(s){var c=s.type,l=s.orientation,u=s.colorStops;B9(u);var f=u.map(function(b){return{offset:En(Number(b.length.value),"%"),color:C9(b)}});if(c==="linear-gradient")return new td(ta.LinearGradient,{angle:l?z9(l):wa,steps:f});if(c==="radial-gradient"&&(l||(l=[{type:"shape",value:"circle"}]),l[0].type==="shape"&&l[0].value==="circle")){var d=G9(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=uv(m):v=En(m,y)}return new td(ta.RadialGradient,{cx:h,cy:p,size:v,steps:f})}})}var r=t[0];if(t[1]==="("||t[2]==="("){if(r==="l"){var i=I9.exec(t);if(i){var a=((e=i[2].match(C_))===null||e===void 0?void 0:e.map(function(s){return s.split(":")}))||[];return[new td(ta.LinearGradient,{angle:En(parseFloat(i[1]),"deg"),steps:a.map(function(s){var c=I(s,2),l=c[0],u=c[1];return{offset:En(Number(l)*100,"%"),color:u}})})]}}else if(r==="r"){var o=H9(t);if(o)if(wn(o))t=o;else return[new td(ta.RadialGradient,o)]}else if(r==="p")return Y9(t)}});function H9(t){var e,n=j9.exec(t);if(n){var r=((e=n[4].match(C_))===null||e===void 0?void 0:e.map(function(i){return i.split(":")}))||[];return{cx:En(50,"%"),cy:En(50,"%"),steps:r.map(function(i){var a=I(i,2),o=a[0],s=a[1];return{offset:En(Number(o)*100,"%"),color:s}})}}return null}function Y9(t){var e=D9.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 Bvt(t){return!!t.type&&!!t.value}function Cl(t){return t&&!!t.image}function nd(t){return t&&!jt(t.r)&&!jt(t.g)&&!jt(t.b)}var Sa=_r(function(t){if(Cl(t))return Q({repetition:"repeat"},t);if(jt(t)&&(t=""),t==="transparent")return T_;t==="currentColor"&&(t="black");var e=W9(t);if(e)return e;var n=Uf(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),k9.apply(void 0,lt([],I(r),!1))});function $9(t,e){if(!(!nd(t)||!nd(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(kn(r[i],0,255));return r[3]=kn(r[3],0,1),"rgba(".concat(r.join(","),")")}]}function Ll(t,e){if(jt(e))return En(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return En(Number(e),"px");if("deg".search(t)>=0)return En(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 En(Number(e.replace(new RegExp("U"+i,"g"),"").replace(new RegExp(r,"g"),"*0")),i)})[0]}var V9=_r(function(t){return Ll(new RegExp("px","g"),t)});_r(function(t){return Ll(new RegExp("%","g"),t)});var cc=function(t){return $n(t)||isFinite(Number(t))?En(Number(t)||0,"px"):Ll(new RegExp("px|%|em|rem","g"),t)},L_=_r(function(t){return Ll(new RegExp("deg|rad|grad|turn","g"),t)});function X9(t,e,n,r,i){i===void 0&&(i=0);var a="",o=t.value||0,s=e.value||0,c=sv(t.unit),l=t.convertTo(c),u=e.convertTo(c);return l&&u?(o=l.value,s=u.value,a=av(t.unit)):(Je.isLength(t.unit)||Je.isLength(e.unit))&&(o=ii(t,i,n),s=ii(e,i,n),a="px"),[o,s,function(f){return r&&(f=Math.max(f,0)),f+a}]}function ri(t){var e=0;return t.unit===St.kDegrees?e=t.value:t.unit===St.kRadians?e=pi(Number(t.value)):t.unit===St.kTurns&&(e=o9(Number(t.value))),e}function hv(t,e){var n;return Array.isArray(t)?n=t.map(function(r){return Number(r)}):wn(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 N_(t){return wn(t)?t.split(" ").map(function(e){return cc(e)}):t.map(function(e){return cc(e.toString())})}function ii(t,e,n){if(t.value===0)return 0;if(t.unit===St.kPixels)return Number(t.value);if(t.unit===St.kPercentage&&n){var r=n.nodeName===tt.GROUP?n.getLocalBounds():n.geometry.contentBounds;return t.value/100*r.halfExtents[e]*2}return 0}var U9=function(t){return Ll(/deg|rad|grad|turn|px|%/g,t)},q9=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function R_(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,q9.indexOf(r[1])>-1&&n.push({name:r[1],params:r[2].split(" ").map(function(a){return U9(a)||Sa(a)})}),e.lastIndex===t.length)return n}return[]}function I_(t){return t.toString()}var es=_r(function(t){return typeof t=="number"?En(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?En(Number(t)):En(0)});_r(function(t){return wn(t)?t.split(" ").map(es):t.map(es)});function pv(t,e){return[t,e,I_]}function vv(t,e){return function(n,r){return[n,r,function(i){return I_(kn(i,t,e))}]}}function j_(t,e){if(t.length===e.length)return[t,e,function(n){return n}]}function gv(t){return t.parsedStyle.path.totalLength===0&&(t.parsedStyle.path.totalLength=oD(t.parsedStyle.path.absolutePath)),t.parsedStyle.path.totalLength}function K9(t){for(var e=0;e0&&n.push(r),{polygons:e,polylines:n}}function rd(t,e){return t[0]===e[0]&&t[1]===e[1]}function J9(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 D_(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}var B_=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},F_=function(t,e,n,r,i,a,o,s){e=Math.abs(e),n=Math.abs(n),r=Wx(r,360);var c=Mn(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},x=B_({x:1,y:0},b),_={x:(-f.x-y.x)/e,y:(-f.y-y.y)/n},O=B_(b,_);!a&&O>0?O-=2*Math.PI:a&&O<0&&(O+=2*Math.PI),O%=2*Math.PI;var w=x+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:x,ellipticalArcEndAngle:x+O,ellipticalArcAngle:w,ellipticalArcCenter:m,resultantRx:e,resultantRy:n};return E};function t7(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,x=[(f-g)/n,(d-y)/r],_=[(-1*f-g)/n,(-1*d-y)/r],O=G_([1,0],x),w=G_(x,_);return yv(x,_)<=-1&&(w=Math.PI),yv(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:rd(t,[l,u])?0:n,ry:rd(t,[l,u])?0:r,startAngle:O,endAngle:O+w,xRotation:i,arcFlag:a,sweepFlag:o}}function n7(t,e,n){var r=e.parsedStyle,i=r.defX,a=i===void 0?0:i,o=r.defY,s=o===void 0?0:o;return t.reduce(function(c,l){var u="";if(l[0]==="M"||l[0]==="L"){var f=Pe(l[1]-a,l[2]-s,0);n&&tr(f,f,n),u="".concat(l[0]).concat(f[0],",").concat(f[1])}else if(l[0]==="Z")u=l[0];else if(l[0]==="C"){var d=Pe(l[1]-a,l[2]-s,0),h=Pe(l[3]-a,l[4]-s,0),p=Pe(l[5]-a,l[6]-s,0);n&&(tr(d,d,n),tr(h,h,n),tr(p,p,n)),u="".concat(l[0]).concat(d[0],",").concat(d[1],",").concat(h[0],",").concat(h[1],",").concat(p[0],",").concat(p[1])}else if(l[0]==="A"){var v=Pe(l[6]-a,l[7]-s,0);n&&tr(v,v,n),u="".concat(l[0]).concat(l[1],",").concat(l[2],",").concat(l[3],",").concat(l[4],",").concat(l[5],",").concat(v[0],",").concat(v[1])}else if(l[0]==="Q"){var d=Pe(l[1]-a,l[2]-s,0),h=Pe(l[3]-a,l[4]-s,0);n&&(tr(d,d,n),tr(h,h,n)),u="".concat(l[0]).concat(l[1],",").concat(l[2],",").concat(l[3],",").concat(l[4],"}")}return c+=u},"")}function r7(t,e,n,r){return[["M",t,e],["L",n,r]]}function W_(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 i7(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 a7(t,e,n,r,i){if(i){var a=I(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 mv(t,e){e===void 0&&(e=t.getLocalTransform());var n=[];switch(t.nodeName){case tt.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=r7(a,s,l,f);break;case tt.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=W_(p,p,g,m);break}case tt.ELLIPSE:{var b=t.parsedStyle,x=b.rx,_=x===void 0?0:x,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=W_(_,w,g,m);break}case tt.POLYLINE:case tt.POLYGON:var E=t.parsedStyle.points;n=i7(E.points,t.nodeName===tt.POLYGON);break;case tt.RECT:var A=t.parsedStyle,N=A.width,k=N===void 0?0:N,P=A.height,T=P===void 0?0:P,L=A.x,j=L===void 0?0:L,D=A.y,B=D===void 0?0:D,z=A.radius,W=z&&z.some(function(X){return X!==0});n=a7(k,T,j,B,W&&z.map(function(X){return kn(X,0,Math.min(Math.abs(k)/2,Math.abs(T)/2))}));break;case tt.PATH:var $=t.parsedStyle.path.absolutePath;n=lt([],I($),!1);break}if(n.length)return n7(n,t,e)}function Fvt(t,e,n,r,i,a,o){r===void 0&&(r=0),i===void 0&&(i=0),a===void 0&&(a=0),o===void 0&&(o=0);var s=t.map(function(c,l){var u=c[0],f=t[l+1],d=l===0&&(r!==0||i!==0),h=(l===t.length-1||f&&(f[0]==="M"||f[0]==="Z"))&&a!==0&&o!==0;switch(u){case"M":return d?"M ".concat(c[1]-e+r,",").concat(c[2]-n+i," L ").concat(c[1]-e,",").concat(c[2]-n):"M ".concat(c[1]-e,",").concat(c[2]-n);case"L":return"L ".concat(c[1]-e+(h?a:0),",").concat(c[2]-n+(h?o:0));case"Q":return"Q ".concat(c[1]-e," ").concat(c[2]-n,",").concat(c[3]-e," ").concat(c[4]-n)+(h?" L ".concat(c[3]-e+a,",").concat(c[4]-n+o):"");case"C":return"C ".concat(c[1]-e," ").concat(c[2]-n,",").concat(c[3]-e," ").concat(c[4]-n,",").concat(c[5]-e," ").concat(c[6]-n)+(h?" L ".concat(c[5]-e+a,",").concat(c[6]-n+o):"");case"A":return"A ".concat(c[1]," ").concat(c[2]," ").concat(c[3]," ").concat(c[4]," ").concat(c[5]," ").concat(c[6]-e," ").concat(c[7]-n)+(h?" L ".concat(c[6]-e+a,",").concat(c[7]-n+o):"");case"Z":return"Z"}}).join(" ");return~s.indexOf("NaN")?"":s}var H_=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=Hf(t)}catch(d){e=Hf(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}K9(e);var n=Z9(e),r=Q9(e),i=r.polygons,a=r.polylines,o=t7(e),s=J9(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}}},o7=_r(H_);function bv(t){return wn(t)?o7(t):H_(t)}function s7(t,e,n){var r=t.curve,i=e.curve;(!r||r.length===0)&&(r=U0(t.absolutePath,!1),t.curve=r),(!i||i.length===0)&&(i=U0(e.absolutePath,!1),e.curve=i);var a=[r,i];r.length!==i.length&&(a=$x(r,i));var o=Vx(a[0])!==Vx(a[1])?gD(a[0]):yD(a[0]);return[o,bD(a[1],o),function(s){return s}]}function Y_(t,e){var n;wn(t)?n=t.split(" ").map(function(u){var f=I(u.split(","),2),d=f[0],h=f[1];return[Number(d),Number(h)]}):n=t;var r=[],i=0,a,o,s=KD(n);n.forEach(function(u,f){n[f+1]&&(a=[0,0],a[0]=i/s,o=c_(u[0],u[1],n[f+1][0],n[f+1][1]),i+=o,a[1]=i/s,r.push(a))});var c=Math.min.apply(Math,lt([],I(n.map(function(u){return u[0]})),!1)),l=Math.min.apply(Math,lt([],I(n.map(function(u){return u[1]})),!1));return e&&(e.parsedStyle.defX=c,e.parsedStyle.defY=l),{points:n,totalLength:s,segments:r}}function c7(t,e){return[t.points,e.points,function(n){return n}]}var Cn=null;function Yr(t){return function(e){var n=0;return t.map(function(r){return r===Cn?e[n++]:r})}}function ns(t){return t}var xv={matrix:["NNNNNN",[Cn,Cn,0,0,Cn,Cn,0,0,0,0,1,0,Cn,Cn,0,1],ns],matrix3d:["NNNNNNNNNNNNNNNN",ns],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Yr([Cn,Cn,new Je(1)]),ns],scalex:["N",Yr([Cn,new Je(1),new Je(1)]),Yr([Cn,new Je(1)])],scaley:["N",Yr([new Je(1),Cn,new Je(1)]),Yr([new Je(1),Cn])],scalez:["N",Yr([new Je(1),new Je(1),Cn])],scale3d:["NNN",ns],skew:["Aa",null,ns],skewx:["A",null,Yr([Cn,wa])],skewy:["A",null,Yr([wa,Cn])],translate:["Tt",Yr([Cn,Cn,ir]),ns],translatex:["T",Yr([Cn,ir,ir]),Yr([Cn,ir])],translatey:["T",Yr([ir,Cn,ir]),Yr([ir,Cn])],translatez:["L",Yr([ir,ir,Cn])],translate3d:["TTL",ns]};function od(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=xv[a];if(!o)return[];var s=r[2].split(","),c=o[0];if(c.length"].calculator(null,null,{value:n.textTransform},e,null),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.anchor&&(e.parsedStyle.anchor=hv(n.anchor,2)),n.transform&&(e.parsedStyle.transform=od(n.transform)),n.transformOrigin&&(e.parsedStyle.transformOrigin=V_(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)),((e.nodeName===tt.CIRCLE||e.nodeName===tt.ELLIPSE)&&(!jt(n.cx)||!jt(n.cy))||(e.nodeName===tt.RECT||e.nodeName===tt.IMAGE||e.nodeName===tt.GROUP||e.nodeName===tt.HTML||e.nodeName===tt.TEXT||e.nodeName===tt.MESH)&&(!jt(n.x)||!jt(n.y)||!jt(n.z))||e.nodeName===tt.LINE&&(!jt(n.x1)||!jt(n.y1)||!jt(n.z1)||!jt(n.x2)||!jt(n.y2)||!jt(n.z2)))&&this.runtime.CSSPropertySyntaxFactory[""].postProcessor(e,a),jt(n.zIndex)||this.runtime.CSSPropertySyntaxFactory[""].postProcessor(e,a),n.path&&this.runtime.CSSPropertySyntaxFactory[""].postProcessor(e,a),n.points&&this.runtime.CSSPropertySyntaxFactory[""].postProcessor(e,a),jt(n.offsetDistance)||this.runtime.CSSPropertySyntaxFactory[""].postProcessor(e,a),n.transform&&this.runtime.CSSPropertySyntaxFactory[""].postProcessor(e,a),c&&this.updateGeometry(e);return}var u=r.skipUpdateAttribute,f=r.skipParse,d=r.forceUpdateGeometry,h=r.usedAttributes,p=d,v=Object.keys(n);v.forEach(function(g){var y;u||(e.attributes[g]=n[g]),!p&&(!((y=ro[g])===null||y===void 0)&&y.l)&&(p=!0)}),f||v.forEach(function(g){e.computedStyle[g]=i.parseProperty(g,e.attributes[g],e)}),h!=null&&h.length&&(v=Array.from(new Set(v.concat(h)))),v.forEach(function(g){g in e.computedStyle&&(e.parsedStyle[g]=i.computeProperty(g,e.computedStyle[g],e))}),p&&this.updateGeometry(e),v.forEach(function(g){g in e.parsedStyle&&i.postProcessProperty(g,e,v)}),this.runtime.enableCSSParsing&&e.children.length&&v.forEach(function(g){g in e.parsedStyle&&i.isPropertyInheritable(g)&&e.children.forEach(function(y){y.internalSetAttribute(g,null,{skipUpdateAttribute:!0,skipParse:!0})})})},t.prototype.parseProperty=function(e,n,r){var i=ro[e],a=n;if((n===""||jt(n))&&(n="unset"),n==="unset"||n==="initial"||n==="inherit")a=uv(n);else if(i){var o=i.k,s=i.syntax,c=s&&this.getPropertySyntax(s);o&&o.indexOf(n)>-1?a=uv(n):c&&c.parser&&(a=c.parser(n,r))}return a},t.prototype.computeProperty=function(e,n,r){var i=ro[e],a=r.id==="g-root",o=n;if(i){var s=i.syntax,c=i.inh,l=i.d;if(n instanceof Hr){var u=n.value;if(u==="unset"&&(c&&!a?u="inherit":u="initial"),u==="initial")jt(l)||(n=this.parseProperty(e,oc(l)?l(r.nodeName):l,r));else if(u==="inherit"){var f=this.tryToResolveProperty(r,e,{inherited:!0});if(jt(f)){this.addUnresolveProperty(r,e);return}else return f}}var d=s&&this.getPropertySyntax(s);if(d&&d.calculator){var h=r.parsedStyle[e];o=d.calculator(e,h,n,r,this.runtime)}else n instanceof Hr?o=n.value:o=n}return o},t.prototype.postProcessProperty=function(e,n,r){var i=ro[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=lc.get(e);r||(lc.set(e,[]),r=lc.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&&m7(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=lc.get(e);if(n&&n.length){var r={};n.forEach(function(i){r[i]=e.attributes[i]}),this.processProperties(e,r),lc.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 Kn),i.renderBounds||(i.renderBounds=new Kn);var a=e.parsedStyle,o=r.update(a,e),s=o.width,c=o.height,l=o.depth,u=l===void 0?0:l,f=o.offsetX,d=f===void 0?0:f,h=o.offsetY,p=h===void 0?0:h,v=o.offsetZ,g=v===void 0?0:v,y=[Math.abs(s)/2,Math.abs(c)/2,u/2],m=a,b=m.stroke,x=m.lineWidth,_=m.increasedLineWidthForHitTesting,O=m.shadowType,w=m.shadowColor,S=m.filter,M=S===void 0?[]:S,E=m.transformOrigin,A=a.anchor;n===tt.TEXT?delete a.anchor:n===tt.MESH&&(a.anchor[2]=.5);var N=[(1-(A&&A[0]||0)*2)*s/2+d,(1-(A&&A[1]||0)*2)*c/2+p,(1-(A&&A[2]||0)*2)*y[2]+g];i.contentBounds.update(N,y);var k=n===tt.POLYLINE||n===tt.POLYGON||n===tt.PATH?Math.SQRT2:.5,P=b&&!b.isNone;if(P){var T=((x||0)+(_||0))*k;y[0]+=T,y[1]+=T}if(i.renderBounds.update(N,y),w&&O&&O!=="inner"){var L=i.renderBounds,j=L.min,D=L.max,B=a,z=B.shadowBlur,W=B.shadowOffsetX,$=B.shadowOffsetY,X=z||0,et=W||0,ut=$||0,gt=j[0]-X+et,it=D[0]+X+et,at=j[1]-X+ut,Tt=D[1]+X+ut;j[0]=Math.min(j[0],gt),D[0]=Math.max(D[0],it),j[1]=Math.min(j[1],at),D[1]=Math.max(D[1],Tt),i.renderBounds.setMinMax(j,D)}M.forEach(function(ue){var Te=ue.name,Fe=ue.params;if(Te==="blur"){var yn=Fe[0].value;i.renderBounds.update(i.renderBounds.center,Qf(i.renderBounds.halfExtents,i.renderBounds.halfExtents,[yn,yn,0]))}else if(Te==="drop-shadow"){var Gn=Fe[0].value,Zr=Fe[1].value,Ya=Fe[2].value,Is=i.renderBounds,Dr=Is.min,Ti=Is.max,Ce=Dr[0]-Ya+Gn,ze=Ti[0]+Ya+Gn,An=Dr[1]-Ya+Zr,Ve=Ti[1]+Ya+Zr;Dr[0]=Math.min(Dr[0],Ce),Ti[0]=Math.max(Ti[0],ze),Dr[1]=Math.min(Dr[1],An),Ti[1]=Math.max(Ti[1],Ve),i.renderBounds.setMinMax(Dr,Ti)}}),A=a.anchor;var kt=s<0,Ht=c<0,se=(kt?-1:1)*(E?ii(E[0],0,e):0),re=(Ht?-1:1)*(E?ii(E[1],1,e):0);se=se-(kt?-1:1)*(A&&A[0]||0)*i.contentBounds.halfExtents[0]*2,re=re-(Ht?-1:1)*(A&&A[1]||0)*i.contentBounds.halfExtents[1]*2,e.setOrigin(se,re),this.runtime.sceneGraphService.dirtifyToRoot(e)}},t.prototype.isPropertyInheritable=function(e){var n=ro[e];return n?n.inh:!1},t}(),x7=function(){function t(){this.parser=L_,this.parserWithCSSDisabled=null,this.mixer=pv}return t.prototype.calculator=function(e,n,r,i){return ri(r)},t}(),_7=function(){function t(){}return t.prototype.calculator=function(e,n,r,i,a){return r instanceof Hr&&(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}(),O7=function(){function t(){this.parser=Sa,this.parserWithCSSDisabled=Sa,this.mixer=$9}return t.prototype.calculator=function(e,n,r,i){return r instanceof Hr?r.value==="none"?fv:T_:r},t}(),w7=function(){function t(){this.parser=R_}return t.prototype.calculator=function(e,n,r){return r instanceof Hr?[]:r},t}();function q_(t){var e=t.parsedStyle.fontSize;return jt(e)?null:e}var Mv=function(){function t(){this.parser=cc,this.parserWithCSSDisabled=null,this.mixer=pv}return t.prototype.calculator=function(e,n,r,i,a){var o;if($n(r))return r;if(Je.isRelativeUnit(r.unit)){var s=a.styleValueRegistry;if(r.unit===St.kPercentage)return 0;if(r.unit===St.kEms){if(i.parentNode){var c=q_(i.parentNode);if(c)return c*=r.value,c;s.addUnresolveProperty(i,e)}else s.addUnresolveProperty(i,e);return 0}else if(r.unit===St.kRems){if(!((o=i==null?void 0:i.ownerDocument)===null||o===void 0)&&o.documentElement){var c=q_(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}(),S7=function(){function t(){this.mixer=j_}return t.prototype.parser=function(e){var n=N_($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}(),M7=function(){function t(){this.mixer=j_}return t.prototype.parser=function(e){var n=N_($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}(),Nl=on();function Ev(t,e){var n=e.parsedStyle.defX||0,r=e.parsedStyle.defY||0;return e.resetLocalTransform(),e.setLocalPosition(n,r),t.forEach(function(i){var a=i.t,o=i.d;if(a==="scale"){var s=(o==null?void 0:o.map(function(m){return m.value}))||[1,1];e.scaleLocal(s[0],s[1],1)}else if(a==="scalex"){var s=(o==null?void 0:o.map(function(b){return b.value}))||[1];e.scaleLocal(s[0],1,1)}else if(a==="scaley"){var s=(o==null?void 0:o.map(function(b){return b.value}))||[1];e.scaleLocal(1,s[0],1)}else if(a==="scalez"){var s=(o==null?void 0:o.map(function(b){return b.value}))||[1];e.scaleLocal(1,1,s[0])}else if(a==="scale3d"){var s=(o==null?void 0:o.map(function(b){return b.value}))||[1,1,1];e.scaleLocal(s[0],s[1],s[2])}else if(a==="translate"){var c=o||[ir,ir];e.translateLocal(c[0].value,c[1].value,0)}else if(a==="translatex"){var c=o||[ir];e.translateLocal(c[0].value,0,0)}else if(a==="translatey"){var c=o||[ir];e.translateLocal(0,c[0].value,0)}else if(a==="translatez"){var c=o||[ir];e.translateLocal(0,0,c[0].value)}else if(a==="translate3d"){var c=o||[ir,ir,ir];e.translateLocal(c[0].value,c[1].value,c[2].value)}else if(a==="rotate"){var l=o||[wa];e.rotateLocal(0,0,ri(l[0]))}else if(a==="rotatex"){var l=o||[wa];e.rotateLocal(ri(l[0]),0,0)}else if(a==="rotatey"){var l=o||[wa];e.rotateLocal(0,ri(l[0]),0)}else if(a==="rotatez"){var l=o||[wa];e.rotateLocal(0,0,ri(l[0]))}else if(a!=="rotate3d")if(a==="skew"){var u=(o==null?void 0:o.map(function(m){return m.value}))||[0,0];e.setLocalSkew(Mn(u[0]),Mn(u[1]))}else if(a==="skewx"){var u=(o==null?void 0:o.map(function(b){return b.value}))||[0];e.setLocalSkew(Mn(u[0]),e.getLocalSkew()[1])}else if(a==="skewy"){var u=(o==null?void 0:o.map(function(b){return b.value}))||[0];e.setLocalSkew(e.getLocalSkew()[0],Mn(u[0]))}else if(a==="matrix"){var f=I(o.map(function(m){return m.value}),6),d=f[0],h=f[1],p=f[2],v=f[3],g=f[4],y=f[5];e.setLocalTransform(G0(Nl,d,h,0,0,p,v,0,0,0,0,1,0,g+n,y+r,0,1))}else a==="matrix3d"&&(G0.apply(bt,lt([Nl],I(o.map(function(m){return m.value})),!1)),Nl[12]+=n,Nl[13]+=r,e.setLocalTransform(Nl))}),e.getLocalTransform()}var E7=function(t){Bt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.postProcessor=function(n,r){var i,a,o;switch(n.nodeName){case tt.CIRCLE:case tt.ELLIPSE:var s=n.parsedStyle,c=s.cx,l=s.cy,u=s.cz;jt(c)||(i=c),jt(l)||(a=l),jt(u)||(o=u);break;case tt.LINE:var f=n.parsedStyle,d=f.x1,h=f.x2,p=f.y1,v=f.y2,g=Math.min(d,h),y=Math.min(p,v);i=g,a=y,o=0;break;case tt.RECT:case tt.IMAGE:case tt.GROUP:case tt.HTML:case tt.TEXT:case tt.MESH:jt(n.parsedStyle.x)||(i=n.parsedStyle.x),jt(n.parsedStyle.y)||(a=n.parsedStyle.y),jt(n.parsedStyle.z)||(o=n.parsedStyle.z);break}n.nodeName!==tt.PATH&&n.nodeName!==tt.POLYLINE&&n.nodeName!==tt.POLYGON&&(n.parsedStyle.defX=i||0,n.parsedStyle.defY=a||0);var m=!jt(i)||!jt(a)||!jt(o);if(m&&r.indexOf("transform")===-1){var b=n.parsedStyle.transform;if(b&&b.length)Ev(b,n);else{var x=I(n.getLocalPosition(),3),_=x[0],O=x[1],w=x[2];n.setLocalPosition(jt(i)?_:i,jt(a)?O:a,jt(o)?w:o)}}},e}(Mv),A7=function(){function t(){}return t.prototype.calculator=function(e,n,r,i){r instanceof Hr&&(r=null);var a=r==null?void 0:r.cloneNode(!0);return a&&(a.style.isMarker=!0),a},t}(),P7=function(){function t(){this.mixer=pv,this.parser=es,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(e,n,r){return r.value},t}(),T7=function(){function t(){this.parser=es,this.parserWithCSSDisabled=null,this.mixer=vv(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===tt.LINE||a===tt.PATH||a===tt.POLYLINE){var o=r.getPoint(i);o&&(e.parsedStyle.defX=o.x,e.parsedStyle.defY=o.y,e.setLocalPosition(o.x,o.y))}}},t}(),k7=function(){function t(){this.parser=es,this.parserWithCSSDisabled=null,this.mixer=vv(0,1)}return t.prototype.calculator=function(e,n,r){return r.value},t}(),C7=function(){function t(){this.parser=bv,this.parserWithCSSDisabled=bv,this.mixer=s7}return t.prototype.calculator=function(e,n,r){return r instanceof Hr&&r.value==="unset"?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new ts(0,0,0,0)}:r},t.prototype.postProcessor=function(e,n){if(e.parsedStyle.defX=e.parsedStyle.path.rect.x,e.parsedStyle.defY=e.parsedStyle.path.rect.y,e.nodeName===tt.PATH&&n.indexOf("transform")===-1){var r=e.parsedStyle,i=r.defX,a=i===void 0?0:i,o=r.defY,s=o===void 0?0:o;e.setLocalPosition(a,s)}},t}(),L7=function(){function t(){this.parser=Y_,this.mixer=c7}return t.prototype.postProcessor=function(e,n){if((e.nodeName===tt.POLYGON||e.nodeName===tt.POLYLINE)&&n.indexOf("transform")===-1){var r=e.parsedStyle,i=r.defX,a=r.defY;e.setLocalPosition(i,a)}},t}(),N7=function(t){Bt(e,t);function e(){var n=t.apply(this,lt([],I(arguments),!1))||this;return n.mixer=vv(0,1/0),n}return e}(Mv),R7=function(){function t(){}return t.prototype.calculator=function(e,n,r,i){return r instanceof Hr?r.value==="unset"?"":r.value:"".concat(r)},t.prototype.postProcessor=function(e){e.nodeValue="".concat(e.parsedStyle.text)||""},t}(),I7=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}(),Av={},j7=0;function D7(t,e){if(t){var n=typeof t=="string"?t:t.id||j7++;Av[n]&&Av[n].destroy(),Av[n]=e}}var Rl=typeof window!="undefined"&&typeof window.document!="undefined";function B7(t){return!!t.getAttribute}function F7(t,e){for(var n=0,r=t.length;n>>1;K_(t[i],e)<0?n=i+1:r=i}return n}function K_(t,e){var n=Number(t.parsedStyle.zIndex),r=Number(e.parsedStyle.zIndex);if(n===r){var i=t.parentNode;if(i){var a=i.childNodes||[];return a.indexOf(t)-a.indexOf(e)}}return n-r}function Z_(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 Q_="px";function z7(t,e,n){Rl&&t.style&&(t.style.width=e+Q_,t.style.height=n+Q_)}function J_(t,e){if(Rl)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}function G7(t){var e=J_(t,"width");return e==="auto"?t.offsetWidth:parseFloat(e)}function W7(t){var e=J_(t,"height");return e==="auto"?t.offsetHeight:parseFloat(e)}var H7=1,Y7={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Pv=typeof performance=="object"&&performance.now?performance:Date;function rs(t,e,n){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 $7=1,V7=function(){return $7++},ea=typeof self=="object"&&self.self==self?self:typeof rt.g=="object"&&rt.g.global==rt.g?rt.g:{},X7=Date.now(),U7=function(){return ea.performance&&typeof ea.performance.now=="function"?ea.performance.now():Date.now()-X7},Il={},t2=Date.now(),q7=function(t){if(typeof t!="function")throw new TypeError(t+" is not a function");var e=Date.now(),n=e-t2,r=n>16?0:16-n,i=V7();return Il[i]=t,Object.keys(Il).length>1||setTimeout(function(){t2=e;var a=Il;Il={},Object.keys(a).forEach(function(o){return a[o](U7())})},r),i},K7=function(t){delete Il[t]},Z7=["","webkit","moz","ms","o"],e2=function(t){return typeof t!="string"?q7:t===""?ea.requestAnimationFrame:ea[t+"RequestAnimationFrame"]},Q7=function(t){return typeof t!="string"?K7:t===""?ea.cancelAnimationFrame:ea[t+"CancelAnimationFrame"]||ea[t+"CancelRequestAnimationFrame"]},J7=function(t,e){for(var n=0;t[n]!==void 0;){if(e(t[n]))return t[n];n=n+1}},n2=J7(Z7,function(t){return!!e2(t)}),r2=e2(n2),i2=Q7(n2);ea.requestAnimationFrame=r2,ea.cancelAnimationFrame=i2;var tB=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;c--){var l=s[c].trim();!rB.test(l)&&nB.indexOf(l)<0&&(l='"'.concat(l,'"')),s[c]=l}return"".concat(r," ").concat(i," ").concat(a," ").concat(o," ").concat(s.join(","))}var aB=function(){function t(){this.parser=od,this.parserWithCSSDisabled=od,this.mixer=y7}return t.prototype.calculator=function(e,n,r,i){return r instanceof Hr?[]:r},t.prototype.postProcessor=function(e){var n=e.parsedStyle.transform;Ev(n,e)},t}(),oB=function(){function t(){this.parser=V_}return t}(),sB=function(){function t(){this.parser=es}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=sc.Z_INDEX_CHANGED)}},t}(),cB=function(){function t(){}return t.prototype.update=function(e,n){var r=e.r,i=r*2,a=r*2;return{width:i,height:a}},t}(),lB=function(){function t(){}return t.prototype.update=function(e,n){var r=e.rx,i=e.ry,a=r*2,o=i*2;return{width:a,height:o}},t}(),uB=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;return{width:u,height:f}},t}(),fB=function(){function t(){}return t.prototype.update=function(e){var n=e.path,r=n.rect,i=r.width,a=r.height;return{width:i,height:a}},t}(),dB=function(){function t(){}return t.prototype.update=function(e){if(e.points&&fr(e.points.points)){var n=e.points.points,r=Math.min.apply(Math,lt([],I(n.map(function(l){return l[0]})),!1)),i=Math.max.apply(Math,lt([],I(n.map(function(l){return l[0]})),!1)),a=Math.min.apply(Math,lt([],I(n.map(function(l){return l[1]})),!1)),o=Math.max.apply(Math,lt([],I(n.map(function(l){return l[1]})),!1)),s=i-r,c=o-a;return{width:s,height:c}}return{width:0,height:0}},t}(),hB=function(){function t(){}return t.prototype.update=function(e,n){var r=e.img,i=e.width,a=i===void 0?0:i,o=e.height,s=o===void 0?0:o,c=a,l=s;return r&&!wn(r)&&(c||(c=r.width,e.width=c),l||(l=r.height,e.height=l)),{width:c,height:l}},t}(),pB=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 r&&o&&s&&c&&l&&i&&a&&!jt(u)},t.prototype.update=function(e,n){var r,i,a=e.text,o=e.textAlign,s=e.lineWidth,c=e.textBaseline,l=e.dx,u=e.dy;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:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0};var f=(((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,d=this.globalRuntime.textService.measureText(a,e,f);e.metrics=d;var h=d.width,p=d.height,v=d.lineHeight,g=d.fontProperties,y=[h/2,p/2,0],m=[0,1],b=0;o==="center"||o==="middle"?(b=s/2,m=[.5,1]):(o==="right"||o==="end")&&(b=s,m=[1,1]);var x=0;return c==="middle"?x=y[1]:c==="top"||c==="hanging"?x=y[1]*2:c==="alphabetic"?x=this.globalRuntime.enableCSSParsing?v-g.ascent:0:(c==="bottom"||c==="ideographic")&&(x=0),l&&(b+=l),u&&(x+=u),e.anchor=[m[0],m[1],0],{width:y[0]*2,height:y[1]*2,offsetX:b,offsetY:x}},t}();function vB(t){return!!t.type}var sd=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 rr,this.page=new rr,this.canvas=new rr,this.viewport=new rr,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(Qe)},t}(),a2=function(t){Bt(e,t);function e(){var n=t.apply(this,lt([],I(arguments),!1))||this;return n.client=new rr,n.movement=new rr,n.offset=new rr,n.global=new rr,n.screen=new rr,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(Qe)},e}(sd),kv=function(t){Bt(e,t);function e(){var n=t.apply(this,lt([],I(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}(a2),Cv=function(t){Bt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(a2),nn=function(t){Bt(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}(sd),o2=":",s2=function(){function t(){this.emitter=new B0}return t.prototype.on=function(e,n,r){return this.addEventListener(e,n,r),this},t.prototype.addEventListener=function(e,n,r){var i=Xx(r)&&r||Qo(r)&&r.capture,a=Qo(r)&&r.once,o=oc(n)?void 0:n,s=!1,c="";if(e.indexOf(o2)>-1){var l=I(e.split(o2),2),u=l[0],f=l[1];e=f,c=u,s=!0}if(e=i?"".concat(e,"capture"):e,n=oc(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(Qe)},e.prototype.lookupNamespaceURI=function(n){throw new Error(Qe)},e.prototype.lookupPrefix=function(n){throw new Error(Qe)},e.prototype.normalize=function(){throw new Error(Qe)},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}(s2),gB=2048,yB=function(){function t(e,n){var r=this;this.globalRuntime=e,this.context=n,this.emitter=new B0,this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=on(),this.tmpVec3=ve(),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=Pv.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")}ar.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"),ar.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&&ar.isNode(c)&&c.parentNode;p&&p!==(ar.isNode(r.rootTarget)&&r.rootTarget.parentNode)&&p!==a.target;)p=p.parentNode;var v=!p||p===(ar.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!==(ar.isNode(r.rootTarget)&&r.rootTarget.parentNode);)g.currentTarget=g.target,r.notifyTarget(g),o&&r.notifyTarget(g,"mouseenter"),ar.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!==(ar.isNode(r.rootTarget)&&r.rootTarget.parentNode);)l.currentTarget=l.target,r.notifyTarget(l),o&&r.notifyTarget(l,"mouseleave"),ar.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!==(ar.isNode(r.rootTarget)&&r.rootTarget.parentNode);)c.currentTarget=c.target,r.notifyTarget(c),s&&r.notifyTarget(c,"mouseenter"),ar.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"),ar.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.client2Viewport=function(e){var n=this.context.contextService.getBoundingClientRect();return new rr(e.x-((n==null?void 0:n.left)||0),e.y-((n==null?void 0:n.top)||0))},t.prototype.viewport2Client=function(e){var n=this.context.contextService.getBoundingClientRect();return new rr(e.x+((n==null?void 0:n.left)||0),e.y+((n==null?void 0:n.top)||0))},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=br(this.tmpMatrix,u,l),d=Ii(this.tmpVec3,n/s*2-1,(1-r/c)*2-1,0);return tr(d,d,f),new rr(d[0],d[1])},t.prototype.canvas2Viewport=function(e){var n=this.rootTarget.defaultView,r=n.getCamera(),i=r.getPerspective(),a=r.getViewTransform(),o=br(this.tmpMatrix,i,a),s=Ii(this.tmpVec3,e.x,e.y,0);tr(this.tmpVec3,this.tmpVec3,o);var c=this.context.config,l=c.width,u=c.height;return new rr((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){var n,r=this.context.contextService.getDomElement(),i=(n=e.nativeEvent)===null||n===void 0?void 0:n.target;if(i){if(i===r)return!0;if(r&&r.contains)return r.contains(i)}return e.nativeEvent.composedPath?e.nativeEvent.composedPath().indexOf(r)>-1:!1},t.prototype.getExistedHTML=function(e){var n,r;if(e.nativeEvent.composedPath)try{for(var i=mr(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(kv);this.copyPointerData(e,a),this.copyMouseData(e,a),this.copyData(e,a),a.nativeEvent=e.nativeEvent,a.originalEvent=e;var o=this.getExistedHTML(a);return a.target=r!=null?r:o||this.isNativeEventFromCanvas(a)&&this.pickTarget(a)||i,typeof n=="string"&&(a.type=n),a},t.prototype.createWheelEvent=function(e){var n=this.allocateEvent(Cv);this.copyWheelData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.nativeEvent=e.nativeEvent,n.originalEvent=e;var r=this.getExistedHTML(n);return n.target=r||this.isNativeEventFromCanvas(n)&&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(Cv);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(kv);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=Pv.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||ar.isNode(i)&&i.parentNode===n)n=e[r];else break}return n},t.prototype.getCursor=function(e){for(var n=e;n;){var r=B7(n)&&n.getAttribute("cursor");if(r)return r;n=ar.isNode(n)&&n.parentNode}},t}(),mB=function(){function t(){}return t.prototype.getOrCreateCanvas=function(e,n){if(this.canvas)return this.canvas;if(e||nt.offscreenCanvas)this.canvas=e||nt.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}(),io;(function(t){t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE"})(io||(io={}));var bB=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 Lr,initAsync:new tB,dirtycheck:new Tv,cull:new Tv,beginFrame:new Lr,beforeRender:new Lr,render:new Lr,afterRender:new Lr,endFrame:new Lr,destroy:new Lr,pick:new eB,pickSync:new Tv,pointerDown:new Lr,pointerUp:new Lr,pointerMove:new Lr,pointerOut:new Lr,pointerOver:new Lr,pointerWheel:new Lr,pointerCancel:new Lr,click:new Lr}}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(io.CAMERA_CHANGED)},t.prototype.render=function(e,n){var r=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var i=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(i.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),i.renderReasons.size&&this.inited){i.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var a=i.renderReasons.size===1&&i.renderReasons.has(io.CAMERA_CHANGED),o=!e.disableRenderHooks||!(e.disableRenderHooks&&a);o&&this.renderDisplayObject(i.root,e,i),this.hooks.beginFrame.call(),o&&i.renderListCurrentFrame.forEach(function(s){r.hooks.beforeRender.call(s),r.hooks.render.call(s),r.hooks.afterRender.call(s)}),this.hooks.endFrame.call(),i.renderListCurrentFrame=[],i.renderReasons.clear(),n()}},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!==sc.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=F7(n.sorted,r);n.sorted.splice(o,0,r)}}):n.sorted=e.childNodes.slice().sort(K_)},t.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},t.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(io.DISPLAY_OBJECT_CHANGED)},t}(),xB=/\[\s*(.*)=(.*)\s*\]/,_B=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(xB),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 jt(r)?"":r.toString?r.toString():""},t}(),ao=function(t){Bt(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}(sd),Qt;(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"})(Qt||(Qt={}));function c2(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}var OB=new ao(Qt.REPARENT,null,"","","",0,"",""),wB=function(){function t(e){var n=this;this.runtime=e,this.pendingEvents=[],this.boundsChangedEvent=new nn(Qt.BOUNDS_CHANGED),this.rotate=function(){var r=Yn();return function(i,a,o,s){o===void 0&&(o=0),s===void 0&&(s=0),typeof a=="number"&&(a=Pe(a,o,s));var c=i.transformable;if(i.parentNode===null||!i.parentNode.transformable)n.rotateLocal(i,a);else{var l=Yn();Ff(l,a[0],a[1],a[2]);var u=n.getRotation(i),f=n.getRotation(i.parentNode);zf(r,f),Y0(r,r),Qa(l,r,l),Qa(c.localRotation,l,u),Gf(c.localRotation,c.localRotation),n.dirtifyLocal(i,c)}}}(),this.rotateLocal=function(){var r=Yn();return function(i,a,o,s){o===void 0&&(o=0),s===void 0&&(s=0),typeof a=="number"&&(a=Pe(a,o,s));var c=i.transformable;Ff(r,a[0],a[1],a[2]),Nx(c.localRotation,c.localRotation,r),n.dirtifyLocal(i,c)}}(),this.setEulerAngles=function(){var r=Yn();return function(i,a,o,s){o===void 0&&(o=0),s===void 0&&(s=0),typeof a=="number"&&(a=Pe(a,o,s));var c=i.transformable;if(i.parentNode===null||!i.parentNode.transformable)n.setLocalEulerAngles(i,a);else{Ff(c.localRotation,a[0],a[1],a[2]);var l=n.getRotation(i.parentNode);zf(r,Y0(Yn(),l)),Nx(c.localRotation,c.localRotation,r),n.dirtifyLocal(i,c)}}}(),this.translateLocal=function(){return function(r,i,a,o){a===void 0&&(a=0),o===void 0&&(o=0),typeof i=="number"&&(i=Pe(i,a,o));var s=r.transformable;ml(i,ve())||(W6(i,i,s.localRotation),Zs(s.localPosition,s.localPosition,i),n.dirtifyLocal(r,s))}}(),this.setPosition=function(){var r=on(),i=ve();return function(a,o){var s=a.transformable;if(i[0]=o[0],i[1]=o[1],i[2]=o[2]||0,!ml(n.getPosition(a),i)){if(zr(s.position,i),a.parentNode===null||!a.parentNode.transformable)zr(s.localPosition,i);else{var c=a.parentNode.transformable;Zo(r,c.worldTransform),qi(r,r),tr(s.localPosition,i,r)}n.dirtifyLocal(a,s)}}}(),this.setLocalPosition=function(){var r=ve();return function(i,a){var o=i.transformable;r[0]=a[0],r[1]=a[1],r[2]=a[2]||0,!ml(o.localPosition,r)&&(zr(o.localPosition,r),n.dirtifyLocal(i,o))}}(),this.translate=function(){var r=ve(),i=ve(),a=ve();return function(o,s,c,l){c===void 0&&(c=0),l===void 0&&(l=0),typeof s=="number"&&(s=Ii(i,s,c,l)),!ml(s,r)&&(Zs(a,n.getPosition(o),s),n.setPosition(o,a))}}(),this.setRotation=function(){var r=Yn();return function(i,a,o,s,c){var l=i.transformable;if(typeof a=="number"&&(a=$0(a,o,s,c)),i.parentNode===null||!i.parentNode.transformable)n.setLocalRotation(i,a);else{var u=n.getRotation(i.parentNode);zf(r,u),Y0(r,r),Qa(l.localRotation,r,a),Gf(l.localRotation,l.localRotation),n.dirtifyLocal(i,l)}}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var r=on(),i=ve(),a=$0(0,0,0,1);return function(o){var s=o.localSkew[0]!==0||o.localSkew[1]!==0;if(s){if(xl(o.localTransform,o.localRotation,o.localPosition,Pe(1,1,1),o.origin),o.localSkew[0]!==0||o.localSkew[1]!==0){var c=bl(r);c[4]=Math.tan(o.localSkew[0]),c[1]=Math.tan(o.localSkew[1]),br(o.localTransform,o.localTransform,c)}var l=xl(r,a,i,o.localScale,o.origin);br(o.localTransform,o.localTransform,l)}else xl(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,o=!1;e.parentNode&&(o=e.parentNode!==n,this.detach(e)),e.parentNode=n,jt(r)?e.parentNode.childNodes.push(e):e.parentNode.childNodes.splice(r,0,e);var s=n.sortable;(!((i=s==null?void 0:s.sorted)===null||i===void 0)&&i.length||!((a=e.style)===null||a===void 0)&&a.zIndex)&&(s.dirtyChildren.indexOf(e)===-1&&s.dirtyChildren.push(e),s.dirty=!0,s.dirtyReason=sc.ADDED);var c=e.transformable;c&&this.dirtifyWorld(e,c),c.frozen&&this.unfreezeParentToRoot(e),o&&e.dispatchEvent(OB)},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=sc.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.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){r===void 0&&(r=0),i===void 0&&(i=0),typeof n=="number"&&(n=Pe(n,r,i));var a=e.transformable;Ff(a.localRotation,n[0],n[1],n[2]),this.dirtifyLocal(e,a)},t.prototype.scaleLocal=function(e,n){var r=e.transformable;F6(r.localScale,r.localScale,Pe(n[0],n[1],n[2]||1)),this.dirtifyLocal(e,r)},t.prototype.setLocalScale=function(e,n){var r=e.transformable,i=Pe(n[0],n[1],n[2]||r.localScale[2]);ml(i,r.localScale)||(zr(r.localScale,i),this.dirtifyLocal(e,r))},t.prototype.setLocalRotation=function(e,n,r,i,a){typeof n=="number"&&(n=$0(n,r,i,a));var o=e.transformable;zf(o.localRotation,n),this.dirtifyLocal(e,o)},t.prototype.setLocalSkew=function(e,n,r){typeof n=="number"&&(n=R8(n,r));var i=e.transformable;I8(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=I(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;)c2(r),r=r.parentNode;n&&e.forEach(function(i){c2(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 ao(Qt.ATTR_MODIFIED,a,n,n,i,ao.MODIFICATION,n,n)),a.isCustomElement&&a.isConnected&&a.attributeChangedCallback&&a.attributeChangedCallback(i,n,n)})})},t.prototype.getPosition=function(e){var n=e.transformable;return Df(n.position,this.getWorldTransform(e,n))},t.prototype.getRotation=function(e){var n=e.transformable;return Bf(n.rotation,this.getWorldTransform(e,n))},t.prototype.getScale=function(e){var n=e.transformable;return Qs(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=Df(ve(),n),i=Bf(Yn(),n),a=Qs(ve(),n);this.setLocalScale(e,a),this.setLocalPosition(e,r),this.setLocalRotation(e,i)},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(Kn.isEmpty(i))return null;var a=r||new Kn;return a.setFromTransformedAABB(i,this.getWorldTransform(e)),a},t.prototype.getGeometryBounds=function(e,n){n===void 0&&(n=!1);var r=e.geometry,i=n?r.renderBounds:r.contentBounds||null;return i||new Kn},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 Kn,o.update(f.center,f.halfExtents)))}),n){var c=Z_(e);if(c){var l=c.parsedStyle.clipPath.getBounds(n);o?l&&(o=l.intersection(o)):o=l}}return o||(o=new Kn),o&&(n?i.renderBounds=o:i.bounds=o),n?i.renderBoundsDirty=!1:i.boundsDirty=!1,o},t.prototype.getLocalBounds=function(e){if(e.parentNode){var n=on();e.parentNode.transformable&&(n=qi(on(),this.getWorldTransform(e.parentNode)));var r=this.getBounds(e);if(!Kn.isEmpty(r)){var i=new Kn;return i.setFromTransformedAABB(r,n),i}}return this.getBounds(e)},t.prototype.getBoundingClientRect=function(e){var n,r,i,a=this.getGeometryBounds(e);Kn.isEmpty(a)||(i=new Kn,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=I(i.getMin(),2),c=s[0],l=s[1],u=I(i.getMax(),2),f=u[0],d=u[1];return new ts(c+((o==null?void 0:o.left)||0),l+((o==null?void 0:o.top)||0),f-c,d-l)}return new ts((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=l){n.isOverflowing=!0;break}g=0,p[v]="";continue}if(g>0&&g+M>d){if(v+1>=l){if(n.isOverflowing=!0,b>0&&b<=d){for(var E=p[v].length,A=0,N=E,k=0;kd){N=k;break}A+=P}p[v]=(p[v]||"").slice(0,N)+h}break}if(v++,g=0,p[v]="",this.isBreakingSpace(O))continue;this.canBreakInLastChar(O)||(p=this.trimToBreakable(p),g=this.sumTextWidthByCache(p[v]||"",y)),this.shouldBreakByKinsokuShorui(O,S)&&(p=this.trimByKinsokuShorui(p),g+=m(w||""))}g+=M,p[v]=(p[v]||"")+O}return p.join(`
+`)},t.prototype.isBreakingSpace=function(e){return typeof e!="string"?!1:is.BreakingSpaces.indexOf(e.charCodeAt(0))>=0},t.prototype.isNewline=function(e){return typeof e!="string"?!1:is.Newlines.indexOf(e.charCodeAt(0))>=0},t.prototype.trimToBreakable=function(e){var n=lt([],I(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&&l2.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(!l2.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}(),nt={},IB=function(){var t,e=new hB,n=new dB;return t={},t[tt.CIRCLE]=new cB,t[tt.ELLIPSE]=new lB,t[tt.RECT]=e,t[tt.IMAGE]=e,t[tt.GROUP]=e,t[tt.LINE]=new uB,t[tt.TEXT]=new pB(nt),t[tt.POLYLINE]=n,t[tt.POLYGON]=n,t[tt.PATH]=new fB,t[tt.HTML]=null,t[tt.MESH]=null,t}(),jB=function(){var t,e=new O7,n=new Mv;return t={},t[At.PERCENTAGE]=null,t[At.NUMBER]=new P7,t[At.ANGLE]=new x7,t[At.DEFINED_PATH]=new _7,t[At.PAINT]=e,t[At.COLOR]=e,t[At.FILTER]=new w7,t[At.LENGTH]=n,t[At.LENGTH_PERCENTAGE]=n,t[At.LENGTH_PERCENTAGE_12]=new S7,t[At.LENGTH_PERCENTAGE_14]=new M7,t[At.COORDINATE]=new E7,t[At.OFFSET_DISTANCE]=new T7,t[At.OPACITY_VALUE]=new k7,t[At.PATH]=new C7,t[At.LIST_OF_POINTS]=new L7,t[At.SHADOW_BLUR]=new N7,t[At.TEXT]=new R7,t[At.TEXT_TRANSFORM]=new I7,t[At.TRANSFORM]=new aB,t[At.TRANSFORM_ORIGIN]=new oB,t[At.Z_INDEX]=new sB,t[At.MARKER]=new A7,t}(),DB=function(){return typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof rt.g!="undefined"?rt.g:{}};nt.CameraContribution=M_,nt.AnimationTimeline=null,nt.EasingFunction=null,nt.offscreenCanvasCreator=new mB,nt.sceneGraphSelector=new _B,nt.sceneGraphService=new wB(nt),nt.textService=new RB(nt),nt.geometryUpdaterFactory=IB,nt.CSSPropertySyntaxFactory=jB,nt.styleValueRegistry=new b7(nt),nt.layoutRegistry=null,nt.globalThis=DB(),nt.enableCSSParsing=!0,nt.enableDataset=!1,nt.enableStyleSyntax=!0;var u2=0;function zvt(){u2=0}var f2=new ao(Qt.INSERTED,null,"","","",0,"",""),d2=new ao(Qt.REMOVED,null,"","","",0,"",""),BB=new nn(Qt.DESTROY),FB=function(t){Bt(e,t);function e(){var n=t.apply(this,lt([],I(arguments),!1))||this;return n.entity=u2++,n.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},n.cullable={strategy:dv.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},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=nt.enableCSSParsing?{anchor:sn,opacity:sn,fillOpacity:sn,strokeOpacity:sn,fill:sn,stroke:sn,transform:sn,transformOrigin:sn,visibility:sn,pointerEvents:sn,lineWidth:sn,lineCap:sn,lineJoin:sn,increasedLineWidthForHitTesting:sn,fontSize:sn,fontFamily:sn,fontStyle:sn,fontWeight:sn,fontVariant:sn,textAlign:sn,textBaseline:sn,textTransform:sn,zIndex:sn,filter:sn,shadowType:sn}: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(Qe)},e.prototype.appendChild=function(n,r){var i;if(n.destroyed)throw new Error(g9);return nt.sceneGraphService.attach(n,this,r),!((i=this.ownerDocument)===null||i===void 0)&&i.defaultView&&this.ownerDocument.defaultView.mountChildren(n),f2.relatedNode=this,n.dispatchEvent(f2),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 d2.relatedNode=this,n.dispatchEvent(d2),!((r=n.ownerDocument)===null||r===void 0)&&r.defaultView&&n.ownerDocument.defaultView.unmountChildren(n),nt.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 nt.sceneGraphService.matches(n,this)},e.prototype.getElementById=function(n){return nt.sceneGraphService.querySelector("#".concat(n),this)},e.prototype.getElementsByName=function(n){return nt.sceneGraphService.querySelectorAll('[name="'.concat(n,'"]'),this)},e.prototype.getElementsByClassName=function(n){return nt.sceneGraphService.querySelectorAll(".".concat(n),this)},e.prototype.getElementsByTagName=function(n){return nt.sceneGraphService.querySelectorAll(n,this)},e.prototype.querySelector=function(n){return nt.sceneGraphService.querySelector(n,this)},e.prototype.querySelectorAll=function(n){return nt.sceneGraphService.querySelectorAll(n,this)},e.prototype.closest=function(n){var r=this;do{if(nt.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.path.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}(Or),Bl=function(t){Bt(e,t);function e(n){n===void 0&&(n={});var r=this,i=n.style,a=Ue(n,["style"]);r=t.call(this,Q({type:tt.POLYGON,style:nt.enableCSSParsing?Q({points:"",miterLimit:"",isClosed:!0},i):Q({},i),initialParsedStyle:nt.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&&ke(s)&&(r.markerStartAngle=s.getLocalEulerAngles(),r.appendChild(s)),l&&ke(l)&&r.placeMarkerMid(l),c&&ke(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&&ke(a)&&(this.markerStartAngle=0,a.remove()),o&&ke(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):n==="markerEnd"?(a&&ke(a)&&(this.markerEndAngle=0,a.remove()),o&&ke(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=r.defX,u=r.defY,f=(c||{}).points,d=n?i:a;if(!(!d||!ke(d)||!f)){var h=0,p,v,g,y,m,b;if(g=f[0][0]-l,y=f[0][1]-u,n)p=f[1][0]-f[0][0],v=f[1][1]-f[0][1],m=o||0,b=this.markerStartAngle;else{var x=f.length;this.parsedStyle.isClosed?(p=f[x-1][0]-f[0][0],v=f[x-1][1]-f[0][1]):(g=f[x-1][0]-l,y=f[x-1][1]-u,p=f[x-2][0]-f[x-1][0],v=f[x-2][1]-f[x-1][1]),m=s||0,b=this.markerEndAngle}h=Math.atan2(v,p),d.setLocalEulerAngles(h*180/Math.PI+b),d.setLocalPosition(g+Math.cos(h)*m,y+Math.sin(h)*m)}},e.prototype.placeMarkerMid=function(n){var r=this.parsedStyle,i=r.points,a=r.defX,o=r.defY,s=(i||{}).points;if(this.markerMidList.forEach(function(d){d.remove()}),this.markerMidList=[],n&&ke(n)&&s)for(var c=1;c<(this.parsedStyle.isClosed?s.length:s.length-1);c++){var l=s[c][0]-a,u=s[c][1]-o,f=c===1?n:n.cloneNode(!0);this.markerMidList.push(f),this.appendChild(f),f.setLocalPosition(l,u)}},e}(Or),Rv=function(t){Bt(e,t);function e(n){n===void 0&&(n={});var r=n.style,i=Ue(n,["style"]);return t.call(this,Q({type:tt.POLYLINE,style:nt.enableCSSParsing?Q({points:"",miterLimit:"",isClosed:!1},r):Q({},r),initialParsedStyle:nt.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},i))||this}return e.prototype.getTotalLength=function(){return this.parsedStyle.points.totalLength},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,a=i.defX,o=i.defY,s=i.points,c=s.points,l=s.segments,u=0,f=0;l.forEach(function(g,y){n>=g[0]&&n<=g[1]&&(u=(n-g[0])/(g[1]-g[0]),f=y)});var d=Qi(c[f][0],c[f][1],c[f+1][0],c[f+1][1],u),h=d.x,p=d.y,v=tr(ve(),Pe(h-a,p-o,0),r?this.getWorldTransform():this.getLocalTransform());return new rr(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}(Bl),as=function(t){Bt(e,t);function e(n){n===void 0&&(n={});var r=n.style,i=Ue(n,["style"]);return t.call(this,Q({type:tt.RECT,style:nt.enableCSSParsing?Q({x:"",y:"",width:"",height:"",radius:""},r):Q({},r)},i))||this}return e}(Or),na=function(t){Bt(e,t);function e(n){n===void 0&&(n={});var r=n.style,i=Ue(n,["style"]);return t.call(this,Q({type:tt.TEXT,style:nt.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),initialParsedStyle:nt.enableCSSParsing?{}:{x:0,y:0,fontSize:16,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",lineHeight:0,letterSpacing:0,textBaseline:"alphabetic",textAlign:"start",wordWrap:!1,wordWrapWidth:0,leading:0,dx:0,dy:0}},i))||this}return e.prototype.getComputedTextLength=function(){var n;return((n=this.parsedStyle.metrics)===null||n===void 0?void 0:n.maxLineWidth)||0},e.prototype.getLineBoundingRects=function(){var n;return((n=this.parsedStyle.metrics)===null||n===void 0?void 0:n.lineMetrics)||[]},e.prototype.isOverflowing=function(){return!!this.parsedStyle.isOverflowing},e}(Or),YB=function(){function t(){this.registry={},this.define(tt.CIRCLE,jl),this.define(tt.ELLIPSE,Lv),this.define(tt.RECT,as),this.define(tt.IMAGE,Nv),this.define(tt.LINE,Dl),this.define(tt.GROUP,dr),this.define(tt.PATH,Nr),this.define(tt.POLYGON,Bl),this.define(tt.POLYLINE,Rv),this.define(tt.TEXT,na),this.define(tt.HTML,ld)}return t.prototype.define=function(e,n){this.registry[e]=n},t.prototype.get=function(e){return this.registry[e]},t}(),$B=function(t){Bt(e,t);function e(){var n=t.call(this)||this;n.defaultView=null,n.ownerDocument=null,n.nodeName="document";try{n.timeline=new nt.AnimationTimeline(n)}catch(i){}var r={};return Sv.forEach(function(i){var a=i.n,o=i.inh,s=i.d;o&&s&&(r[a]=oc(s)?s(tt.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"?na: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(Qe)},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=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(f);(!d||d&&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 Uo(this,void 0,void 0,function(){var i,a,o,s,c,l,u,f,d,h;return qo(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 Uo(this,void 0,void 0,function(){var i,a,o,s,c,l,u,f,d,h;return qo(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(ac)},e.prototype.insertBefore=function(n,r){throw new Error(ac)},e.prototype.removeChild=function(n,r){throw new Error(ac)},e.prototype.replaceChild=function(n,r,i){throw new Error(ac)},e.prototype.append=function(){throw new Error(ac)},e.prototype.prepend=function(){throw new Error(ac)},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}(ar),VB=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 nn(Qt.CULLED)),null)}return o}),r.hooks.afterRender.tap(t.tag,function(o){o.cullable.visibilityPlaneMask=-1})},t.tag="Culling",t}(),XB=function(){function t(){var e=this;this.autoPreventDefault=!1,this.rootPointerEvent=new kv(null),this.rootWheelEvent=new Cv(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=mr(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=mr(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=mr(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="outside";try{l=c&&a.target&&a.target!==c&&c.contains&&!c.contains(a.target)?"outside":""}catch(v){}var u=n.normalizeToPointerEvent(a,i);try{for(var f=mr(u),d=f.next();!d.done;d=f.next()){var h=d.value,p=n.bootstrapEvent(n.rootPointerEvent,h,i,a);p.type+=l,n.context.eventService.mapEvent(p)}}catch(v){o={error:v}}finally{try{d&&!d.done&&(s=f.return)&&s.call(f)}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=mr(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.getViewportXY=function(e){var n,r,i=e.offsetX,a=e.offsetY,o=e.clientX,s=e.clientY;if(this.context.config.supportsCSSTransform&&!jt(i)&&!jt(a))n=i,r=a;else{var c=this.context.eventService.client2Viewport(new rr(o,s));n=c.x,r=c.y}return{x:n,y:r}},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.getViewportXY(n),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=Y7[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.getViewportXY(e),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=Pv.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||G7(a)||a.width/A,E=c||W7(a)||a.height/A),o&&(nt.offscreenCanvas=o),r.devicePixelRatio=A,r.requestAnimationFrame=p!=null?p:r2.bind(nt.globalThis),r.cancelAnimationFrame=v!=null?v:i2.bind(nt.globalThis),r.supportsTouchEvents=m!=null?m:"ontouchstart"in nt.globalThis,r.supportsPointerEvents=y!=null?y:!!nt.globalThis.PointerEvent,r.isTouchEvent=w!=null?w:function(N){return r.supportsTouchEvents&&N instanceof nt.globalThis.TouchEvent},r.isMouseEvent=S!=null?S:function(N){return!nt.globalThis.MouseEvent||N instanceof nt.globalThis.MouseEvent&&(!r.supportsPointerEvents||!(N instanceof nt.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:_,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 nt.CameraContribution;o.clipSpaceNearZ=i,o.setType(We.EXPLORING,kl.DEFAULT).setPosition(n/2,r/2,g2).setFocalPoint(n/2,r/2,0).setOrthographic(n/-2,n/2,r/2,r/-2,ZB,QB),o.canvas=this,o.eventEmitter.on(w_.UPDATED,function(){a.context.renderingContext.renderReasons.add(io.CAMERA_CHANGED)}),this.context.camera=o},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 nn($r.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 nn($r.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,g2).setFocalPoint(n/2,r/2,0),o===Wr.ORTHOGRAPHIC?a.setOrthographic(n/-2,n/2,r/2,r/-2,a.getNear(),a.getFar()):a.setAspect(n/r),this.dispatchEvent(new nn($r.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(){var n=this;this.dispatchEvent(JB);var r=this.getRenderingService();r.render(this.getConfig(),function(){n.dispatchEvent(tF)}),this.dispatchEvent(eF)},e.prototype.run=function(){var n=this,r=function(){n.render(),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 n9,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new XB,new KB,new VB([new qB])),this.loadRendererContainerModule(n),this.context.contextService=new this.context.ContextService(Q(Q({},nt),this.context)),this.context.renderingService=new bB(nt,this.context),this.context.eventService=new yB(nt,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 nn($r.READY))}):a.dispatchEvent(new nn($r.READY)),a.readyPromise&&a.resolveReadyPromise()):a.dispatchEvent(new nn($r.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(nt)})},e.prototype.setRenderer=function(n){var r=this.getConfig();if(r.renderer!==n){var i=r.renderer;r.renderer=n,this.destroy(!1,!0),lt([],I(i==null?void 0:i.getPlugins()),!1).reverse().forEach(function(a){a.destroy(nt)}),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(jv):(jv.target=n,this.dispatchEvent(jv,!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(Iv):(Iv.target=n,this.dispatchEvent(Iv,!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}(s2),nF=function(t){Bt(e,t);function e(){var n=t.apply(this,lt([],I(arguments),!1))||this;return n.landmarks=[],n}return e.prototype.rotate=function(n,r,i){if(this.relElevation=ic(r),this.relAzimuth=ic(n),this.relRoll=ic(i),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===We.EXPLORING){var a=Za(Yn(),[1,0,0],Mn((this.rotateWorld?1:-1)*this.relElevation)),o=Za(Yn(),[0,1,0],Mn((this.rotateWorld?1:-1)*this.relAzimuth)),s=Za(Yn(),[0,0,1],Mn(this.relRoll)),c=Qa(Yn(),o,a);c=Qa(Yn(),c,s);var l=W0(on(),c);Ka(this.matrix,this.matrix,[0,0,-this.distance]),br(this.matrix,this.matrix,l),Ka(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===We.ORBITING||this.type===We.EXPLORING?this._getPosition():this.type===We.TRACKING&&this._getFocalPoint(),this._update(),this},e.prototype.pan=function(n,r){var i=Cr(n,r,0),a=_a(this.position);return Zs(a,a,F0(ve(),this.right,i[0])),Zs(a,a,F0(ve(),this.up,i[1])),this._setPosition(a),this.triggerUpdate(),this},e.prototype.dolly=function(n){var r=this.forward,i=_a(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===We.ORBITING||this.type===We.EXPLORING?this._getDistance():this.type===We.TRACKING&&Zs(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 nt.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:mx(p.getWorldTransform()),right:_a(p.right),up:_a(p.up),forward:_a(p.forward),position:_a(p.getPosition()),focalPoint:_a(p.getFocalPoint()),distanceVector:_a(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=wn(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,x=a.zoom,_=a.roll,O=d||nt.EasingFunction(c),w,S=function(){i.setFocalPoint(b),i.setPosition(m),i.setRoll(_),i.setZoom(x),i.computeMatrix(),i.triggerUpdate(),p&&p()},M=function(E){w===void 0&&(w=E);var A=E-w;if(A>u){S();return}var N=O(A/u),k=ve(),P=ve(),T=1,L=0;z0(k,i.focalPoint,b,N),z0(P,i.position,m,N),L=i.roll*(1-N)+_*N,T=i.zoom*(1-N)+x*N,i.setFocalPoint(k),i.setPosition(P),i.setRoll(L),i.setZoom(T);var j=gx(k,b)+gx(P,m);if(j<=y&&x==null&&_==null){S();return}i.computeMatrix(),i.triggerUpdate(),A0){var i=n[r-1],a=cF(i,e);if(a){n[r-1]=a;return}}else uF(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(Qt.ATTR_MODIFIED,this,!0),n.childList&&e.addEventListener(Qt.INSERTED,this,!0),(n.childList||n.subtree)&&e.addEventListener(Qt.REMOVED,this,!0)},t.prototype.removeListeners=function(){this.removeListeners_(this.target)},t.prototype.removeListeners_=function(e){var n=this.options;n.attributes&&e.removeEventListener(Qt.ATTR_MODIFIED,this,!0),n.childList&&e.removeEventListener(Qt.INSERTED,this,!0),(n.childList||n.subtree)&&e.removeEventListener(Qt.REMOVED,this,!0)},t.prototype.removeTransientObservers=function(){var e=this.transientObservedNodes;this.transientObservedNodes=[],e.forEach(function(n){this.removeListeners_(n);for(var r=uc.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 zv(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(Qe)},t.prototype.addEventListener=function(e,n,r){throw new Error(Qe)},t.prototype.removeEventListener=function(e,n,r){throw new Error(Qe)},t.prototype.dispatchEvent=function(e){throw new Error(Qe)},t.prototype.commitStyles=function(){throw new Error(Qe)},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 zv(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 zv(null,this,this.currentTime,e);this.onframe(i)}this._finishedFlag=!1}},t}(),hF=4,pF=.001,vF=1e-7,gF=10,Fl=11,fd=1/(Fl-1),yF=typeof Float32Array=="function",_2=function(t,e){return 1-3*e+3*t},O2=function(t,e){return 3*e-6*t},w2=function(t){return 3*t},dd=function(t,e,n){return((_2(e,n)*t+O2(e,n))*t+w2(e))*t},S2=function(t,e,n){return 3*_2(e,n)*t*t+2*O2(e,n)*t+w2(e)},mF=function(t,e,n,r,i){var a,o,s=0;do o=e+(n-e)/2,a=dd(o,r,i)-t,a>0?n=o:e=o;while(Math.abs(a)>vF&&++s=pF?bF(s,d,t,n):h===0?d:mF(s,c,c+fd,t,n)};return function(s){return s===0||s===1?s:dd(o(s),e,r)}},xF=function(t){return t=t.replace(/([A-Z])/g,function(e){return"-".concat(e.toLowerCase())}),t.charAt(0)==="-"?t.substring(1):t},hd=function(t){return Math.pow(t,2)},pd=function(t){return Math.pow(t,3)},vd=function(t){return Math.pow(t,4)},gd=function(t){return Math.pow(t,5)},yd=function(t){return Math.pow(t,6)},md=function(t){return 1-Math.cos(t*Math.PI/2)},bd=function(t){return 1-Math.sqrt(1-t*t)},xd=function(t){return t*t*(3*t-2)},_d=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)},Od=function(t,e){e===void 0&&(e=[]);var n=I(e,2),r=n[0],i=r===void 0?1:r,a=n[1],o=a===void 0?.5:a,s=kn(Number(i),1,10),c=kn(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)},zl=function(t,e,n){e===void 0&&(e=[]);var r=I(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=kn(a,.1,1e3),s=kn(s,.1,1e3),l=kn(l,.1,1e3),f=kn(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},Wv=function(t,e){e===void 0&&(e=[]);var n=I(e,2),r=n[0],i=r===void 0?10:r,a=n[1],o=a=="start"?Math.ceil:Math.floor;return o(kn(t,0,1)*i)/i},M2=function(t,e){e===void 0&&(e=[]);var n=I(e,4),r=n[0],i=n[1],a=n[2],o=n[3];return Gv(r,i,a,o)(t)},wd=Gv(.42,0,1,1),vi=function(t){return function(e,n,r){return n===void 0&&(n=[]),1-t(1-e,n,r)}},gi=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}},yi=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}},E2={steps:Wv,"step-start":function(t){return Wv(t,[1,"start"])},"step-end":function(t){return Wv(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":M2,ease:function(t){return M2(t,[.25,.1,.25,1])},in:wd,out:vi(wd),"in-out":gi(wd),"out-in":yi(wd),"in-quad":hd,"out-quad":vi(hd),"in-out-quad":gi(hd),"out-in-quad":yi(hd),"in-cubic":pd,"out-cubic":vi(pd),"in-out-cubic":gi(pd),"out-in-cubic":yi(pd),"in-quart":vd,"out-quart":vi(vd),"in-out-quart":gi(vd),"out-in-quart":yi(vd),"in-quint":gd,"out-quint":vi(gd),"in-out-quint":gi(gd),"out-in-quint":yi(gd),"in-expo":yd,"out-expo":vi(yd),"in-out-expo":gi(yd),"out-in-expo":yi(yd),"in-sine":md,"out-sine":vi(md),"in-out-sine":gi(md),"out-in-sine":yi(md),"in-circ":bd,"out-circ":vi(bd),"in-out-circ":gi(bd),"out-in-circ":yi(bd),"in-back":xd,"out-back":vi(xd),"in-out-back":gi(xd),"out-in-back":yi(xd),"in-bounce":_d,"out-bounce":vi(_d),"in-out-bounce":gi(_d),"out-in-bounce":yi(_d),"in-elastic":Od,"out-elastic":vi(Od),"in-out-elastic":gi(Od),"out-in-elastic":yi(Od),spring:zl,"spring-in":zl,"spring-out":vi(zl),"spring-in-out":gi(zl),"spring-out-in":yi(zl)},_F=function(t){return xF(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()},OF=function(t){return E2[_F(t)]||E2.linear},wF=function(t){return t},SF=1,MF=.5,A2=0;function P2(t,e){return function(n){if(n>=1)return 1;var r=1/t;return n+=e*r,n-n%r}}var Sd="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",EF=new RegExp("cubic-bezier\\("+Sd+","+Sd+","+Sd+","+Sd+"\\)"),AF=/steps\(\s*(\d+)\s*\)/,PF=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Hv(t){var e=EF.exec(t);if(e)return Gv.apply(void 0,lt([],I(e.slice(1).map(Number)),!1));var n=AF.exec(t);if(n)return P2(Number(n[1]),A2);var r=PF.exec(t);return r?P2(Number(r[1]),{start:SF,middle:MF,end:A2}[r[2]]):OF(t)}function TF(t){return Math.abs(kF(t)/(t.playbackRate||1))}function kF(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 T2=0,Yv=1,Md=2,k2=3;function CF(t,e,n){if(e===null)return T2;var r=n.endTime;return e=Math.min(n.delay+t+n.endDelay,r)?Md:k2}function LF(t,e,n,r,i){switch(r){case Yv:return e==="backwards"||e==="both"?0:null;case k2:return n-i;case Md:return e==="forwards"||e==="both"?t:null;case T2:return null}}function NF(t,e,n,r,i){var a=i;return t===0?e!==Yv&&(a+=n):a+=r/t,a}function RF(t,e,n,r,i,a){var o=t===1/0?e%1:t%1;return o===0&&n===Md&&r!==0&&(i!==0||a===0)&&(o=1),o}function IF(t,e,n,r){return t===Md&&e===1/0?1/0:n===1?Math.floor(r)-1:Math.floor(r)}function jF(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 DF(t,e,n){var r=CF(t,e,n),i=LF(t,n.fill,e,r,n.delay);if(i===null)return null;var a=n.duration==="auto"?0:n.duration,o=NF(a,r,n.iterations,i,n.iterationStart),s=RF(o,n.iterationStart,r,n.iterations,i,a),c=IF(r,n.iterations,s,o),l=jF(n.direction,c,s);return n.currentIteration=c,n.progress=l,n.easingFunction(l)}function BF(t,e,n){var r=FF(t,e),i=zF(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;ha?i:a,s=i>a?1:i/a,c=i>a?a/i:1;t.save(),t.scale(s,c),t.arc(o,o,o,0,Math.PI*2)}}function JF(t,e){var n=e.x1,r=e.y1,i=e.x2,a=e.y2,o=e.defX,s=o===void 0?0:o,c=e.defY,l=c===void 0?0:c,u=e.markerStart,f=e.markerEnd,d=e.markerStartOffset,h=e.markerEndOffset,p=0,v=0,g=0,y=0,m=0,b,x;u&&ke(u)&&d&&(b=i-n,x=a-r,m=Math.atan2(x,b),p=Math.cos(m)*(d||0),v=Math.sin(m)*(d||0)),f&&ke(f)&&h&&(b=n-i,x=r-a,m=Math.atan2(x,b),g=Math.cos(m)*(h||0),y=Math.sin(m)*(h||0)),t.moveTo(n-s+p,r-l+v),t.lineTo(i-s+g,a-l+y)}function tz(t,e){var n=e.defX,r=n===void 0?0:n,i=e.defY,a=i===void 0?0:i,o=e.markerStart,s=e.markerEnd,c=e.markerStartOffset,l=e.markerEndOffset,u=e.path,f=u.absolutePath,d=u.segments,h=0,p=0,v=0,g=0,y=0,m,b;if(o&&ke(o)&&c){var x=I(o.parentNode.getStartTangent(),2),_=x[0],O=x[1];m=_[0]-O[0],b=_[1]-O[1],y=Math.atan2(b,m),h=Math.cos(y)*(c||0),p=Math.sin(y)*(c||0)}if(s&&ke(s)&&l){var w=I(s.parentNode.getEndTangent(),2),_=w[0],O=w[1];m=_[0]-O[0],b=_[1]-O[1],y=Math.atan2(b,m),v=Math.cos(y)*(l||0),g=Math.sin(y)*(l||0)}for(var S=0;SD?j:D,et=j>D?1:j/D,ut=j>D?D/j:1;t.translate(T-r,L-a),t.rotate(W),t.scale(et,ut),t.arc(0,0,X,B,z,!!(1-$)),t.scale(1/et,1/ut),t.rotate(-W),t.translate(-(T-r),-(L-a))}k&&t.lineTo(M[6]-r+v,M[7]-a+g);break}case"Z":t.closePath();break}}}function ez(t,e){var n=e.defX,r=n===void 0?0:n,i=e.defY,a=i===void 0?0:i,o=e.markerStart,s=e.markerEnd,c=e.markerStartOffset,l=e.markerEndOffset,u=e.points.points,f=u.length,d=u[0][0]-r,h=u[0][1]-a,p=u[f-1][0]-r,v=u[f-1][1]-a,g=0,y=0,m=0,b=0,x=0,_,O;o&&ke(o)&&c&&(_=u[1][0]-u[0][0],O=u[1][1]-u[0][1],x=Math.atan2(O,_),g=Math.cos(x)*(c||0),y=Math.sin(x)*(c||0)),s&&ke(s)&&l&&(_=u[f-1][0]-u[0][0],O=u[f-1][1]-u[0][1],x=Math.atan2(O,_),m=Math.cos(x)*(l||0),b=Math.sin(x)*(l||0)),t.moveTo(d+(g||m),h+(y||b));for(var w=1;w0?1:-1,l=i>0?1:-1,u=c+l===0,f=I(n.map(function(g){return kn(g,0,Math.min(Math.abs(a)/2,Math.abs(o)/2))}),4),d=f[0],h=f[1],p=f[2],v=f[3];t.moveTo(c*d,0),t.lineTo(a-c*h,0),h!==0&&t.arc(a-c*h,l*h,h,-l*Math.PI/2,c>0?0:Math.PI,u),t.lineTo(a,o-l*p),p!==0&&t.arc(a-c*p,o-l*p,p,c>0?0:Math.PI,l>0?Math.PI/2:1.5*Math.PI,u),t.lineTo(c*v,o),v!==0&&t.arc(c*v,o-l*v,v,l>0?Math.PI/2:-Math.PI/2,c>0?Math.PI:0,u),t.lineTo(0,l*d),d!==0&&t.arc(c*d,l*d,d,c>0?Math.PI:0,l>0?Math.PI*1.5:Math.PI/2,u)}}var iz=function(t){Bt(e,t);function e(){var n=t.apply(this,lt([],I(arguments),!1))||this;return n.name="canvas-path-generator",n}return e.prototype.init=function(){var n,r=(n={},n[tt.CIRCLE]=ZF,n[tt.ELLIPSE]=QF,n[tt.RECT]=rz,n[tt.LINE]=JF,n[tt.POLYLINE]=nz,n[tt.POLYGON]=ez,n[tt.PATH]=tz,n[tt.TEXT]=void 0,n[tt.GROUP]=void 0,n[tt.IMAGE]=void 0,n[tt.HTML]=void 0,n[tt.MESH]=void 0,n);this.context.pathGeneratorFactory=r},e.prototype.destroy=function(){delete this.context.pathGeneratorFactory},e}(to),az=ve(),oz=ve(),sz=ve(),cz=on(),lz=function(){function t(){var e=this;this.isHit=function(n,r,i,a){var o=e.context.pointInPathPickerFactory[n.nodeName];if(o){var s=qi(cz,i),c=tr(oz,Ii(sz,r[0],r[1],0),s),l=n.getGeometryBounds().halfExtents,u=n.parsedStyle.anchor;if(c[0]+=(u&&u[0]||0)*l[0]*2,c[1]+=(u&&u[1]||0)*l[1]*2,o(n,new rr(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 Uo(r,void 0,void 0,function(){return qo(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=Ii(az,s,c,0),u=e.elementsFromBBox(l[0],l[1],l[0],l[1]),f=[];try{for(var d=mr(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=Z_(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(x){r={error:x}}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 uz(t,e,n){var r=t.parsedStyle,i=r.r,a=r.fill,o=r.stroke,s=r.lineWidth,c=r.increasedLineWidthForHitTesting,l=r.pointerEvents,u=((s||0)+(c||0))/2,f=xr(i,i,e.x,e.y),d=I(rs(l,a,o),2),h=d[0],p=d[1];return h&&p||n?f<=i+u:h?f<=i:p?f>=i-u&&f<=i+u:!1}function Ad(t,e,n,r){return t/(n*n)+e/(r*r)}function fz(t,e,n){var r=t.parsedStyle,i=r.rx,a=r.ry,o=r.fill,s=r.stroke,c=r.lineWidth,l=r.increasedLineWidthForHitTesting,u=r.pointerEvents,f=e.x,d=e.y,h=I(rs(u,o,s),2),p=h[0],v=h[1],g=((c||0)+(l||0))/2,y=(f-i)*(f-i),m=(d-a)*(d-a);return p&&v||n?Ad(y,m,i+g,a+g)<=1:p?Ad(y,m,i,a)<=1:v?Ad(y,m,i-g,a-g)>=1&&Ad(y,m,i+g,a+g)<=1:!1}function os(t,e,n,r,i,a){return i>=t&&i<=t+n&&a>=e&&a<=e+r}function dz(t,e,n,r,i,a,o){var s=i/2;return os(t-s,e-s,n,i,a,o)||os(t+n-s,e-s,i,r,a,o)||os(t+s,e+r-s,n,i,a,o)||os(t-s,e+s,i,r,a,o)}function Pd(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 xr(l.x,l.y,o,s)<=a/2}function oo(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?l_(t,e,n,r,a,o)<=i/2:!1}function G2(t,e,n,r,i){var a=t.length;if(a<2)return!1;for(var o=0;o0!=Uv(s[1]-n)>0&&Uv(e-(n-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(r=!r)}return r}function H2(t,e,n){for(var r=!1,i=0;ix&&M>_,v&&(v.resetTransform?v.resetTransform():v.setTransform(1,0,0,1,0,0),r.clearFullScreen&&r.clearRect(v,0,0,y*g,m*g,i.background))});var p=function(v,g){v.isVisible()&&!v.isCulled()&&(r.renderDisplayObject(v,g,r.context,r.restoreStack,n),r.saveDirtyAABB(v));var y=v.sortable.sorted||v.childNodes;y.forEach(function(m){p(m,g)})};o.hooks.endFrame.tap(t.tag,function(){var v=u.getContext(),g=u.getDPR();if(Sx(r.dprMatrix,[g,g,1]),br(r.vpMatrix,r.dprMatrix,a.getOrthoMatrix()),r.clearFullScreen)p(s.root,v);else{var y=r.safeMergeAABB.apply(r,lt([r.mergeDirtyAABBs(r.renderQueue)],I(r.removedRBushNodeAABBs.map(function(W){var $=W.minX,X=W.minY,et=W.maxX,ut=W.maxY,gt=new Kn;return gt.setMinMax([$,X,0],[et,ut,0]),gt})),!1));if(r.removedRBushNodeAABBs=[],Kn.isEmpty(y)){r.renderQueue=[];return}var m=r.convertAABB2Rect(y),b=m.x,x=m.y,_=m.width,O=m.height,w=tr(r.vec3a,[b,x,0],r.vpMatrix),S=tr(r.vec3b,[b+_,x,0],r.vpMatrix),M=tr(r.vec3c,[b,x+O,0],r.vpMatrix),E=tr(r.vec3d,[b+_,x+O,0],r.vpMatrix),A=Math.min(w[0],S[0],E[0],M[0]),N=Math.min(w[1],S[1],E[1],M[1]),k=Math.max(w[0],S[0],E[0],M[0]),P=Math.max(w[1],S[1],E[1],M[1]),T=Math.floor(A),L=Math.floor(N),j=Math.ceil(k-A),D=Math.ceil(P-N);v.save(),r.clearRect(v,T,L,j,D,i.background),v.beginPath(),v.rect(T,L,j,D),v.clip(),v.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]);var B=i.renderer.getConfig().enableDirtyRectangleRenderingDebug;B&&f.dispatchEvent(new nn($r.DIRTY_RECTANGLE,{dirtyRect:{x:T,y:L,width:j,height:D}}));var z=r.searchDirtyObjects(y);z.sort(function(W,$){return W.sortable.renderOrder-$.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)&ar.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!==tt.LINE&&e.nodeName!==tt.PATH&&e.nodeName!==tt.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 Kn;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=I(e.getMin(),2),r=n[0],i=n[1],a=I(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 Kn);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),jt(c)||(e.lineDashOffset=c),jt(o)||(e.globalAlpha*=o),!jt(i)&&!Array.isArray(i)&&!i.isNone&&(e.strokeStyle=n.attributes.stroke),!jt(a)&&!Array.isArray(a)&&!a.isNone&&(e.fillStyle=n.attributes.fill)},t.prototype.applyWorldTransform=function(e,n,r){var i=0,a=0,o=(n.parsedStyle||{}).anchor,s=o&&o[0]||0,c=o&&o[1]||0;if(s!==0||c!==0){var l=n.geometry.contentBounds,u=l&&l.halfExtents[0]*2||0,f=l&&l.halfExtents[1]*2||0;i=-(s*u),a=-(c*f)}r?(Zo(this.tmpMat4,n.getLocalTransform()),this.vec3a[0]=i,this.vec3a[1]=a,this.vec3a[2]=0,Ka(this.tmpMat4,this.tmpMat4,this.vec3a),br(this.tmpMat4,r,this.tmpMat4),br(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(Zo(this.tmpMat4,n.getWorldTransform()),this.vec3a[0]=i,this.vec3a[1]=a,this.vec3a[2]=0,Ka(this.tmpMat4,this.tmpMat4,this.vec3a),br(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,w=s.alpha===0,S=!!(b&&b.length),M=!jt(y)&&m>0,E=r.nodeName,A=g==="inner",N=O&&M&&(E===tt.PATH||E===tt.LINE||E===tt.POLYLINE||w||A);_&&(e.globalAlpha=l*u,N||Td(r,e,M),this.fill(e,r,s,c,i,a,o),N||this.clearShadowAndFilter(e,S,M)),O&&(e.globalAlpha=l*d,e.lineWidth=h,jt(x)||(e.miterLimit=x),jt(p)||(e.lineCap=p),jt(v)||(e.lineJoin=v),N&&(A&&(e.globalCompositeOperation="source-atop"),Td(r,e,!0),A&&(this.stroke(e,r,f,i,a,o),e.globalCompositeOperation="source-over",this.clearShadowAndFilter(e,S,!0))),this.stroke(e,r,f,i,a,o))},t.prototype.clearShadowAndFilter=function(e,n,r){if(r&&(e.shadowColor="transparent",e.shadowBlur=0),n){var i=e.filter;!jt(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()}):(Cl(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()}):(Cl(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,function(){n.renderable.dirty=!0,i.renderingService.dirtify()});return v},t.prototype.getColor=function(e,n,r){var i;if(e.type===ta.LinearGradient||e.type===ta.RadialGradient){var a=n.getGeometryBounds(),o=a&&a.halfExtents[0]*2||1,s=a&&a.halfExtents[1]*2||1;i=this.imagePool.getOrCreateGradient(Q(Q({type:e.type},e.value),{width:o,height:s}),r)}return i},t}();function Td(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 Mz=function(){function t(e){this.imagePool=e}return t.prototype.render=function(e,n,r){var i=n.width,a=n.height,o=n.img,s=n.shadowColor,c=n.shadowBlur,l,u=i,f=a;if(wn(o)?l=this.imagePool.getImageSync(o):(u||(u=o.width),f||(f=o.height),l=o),l){var d=!jt(s)&&c>0;Td(r,e,d);try{e.drawImage(l,0,0,u,f)}catch(h){}}},t}(),Ez=function(){function t(){}return t.prototype.render=function(e,n,r,i,a,o){var s=n,c=s.lineWidth,l=s.textAlign,u=s.textBaseline,f=s.lineJoin,d=s.miterLimit,h=s.letterSpacing,p=s.stroke,v=s.fill,g=s.fillOpacity,y=s.strokeOpacity,m=s.opacity,b=s.metrics,x=s.dx,_=s.dy,O=s.shadowColor,w=s.shadowBlur,S=b.font,M=b.lines,E=b.height,A=b.lineHeight,N=b.lineMetrics;e.font=S,e.lineWidth=c,e.textAlign=l==="middle"?"center":l;var k=u;!o.enableCSSParsing&&k==="alphabetic"&&(k="bottom"),e.lineJoin=f,jt(d)||(e.miterLimit=d);var P=0;u==="middle"?P=-E/2-A/2:u==="bottom"||u==="alphabetic"||u==="ideographic"?P=-E:(u==="top"||u==="hanging")&&(P=-A);var T=x||0;P+=_||0,M.length===1&&(k==="bottom"?(k="middle",P-=.5*E):k==="top"&&(k="middle",P+=.5*E)),e.textBaseline=k;var L=!jt(O)&&w>0;Td(r,e,L);for(var j=0;j=1?Math.ceil(i):1,this.dpr=i,this.$canvas&&(this.$canvas.width=this.dpr*e,this.$canvas.height=this.dpr*n,z7(this.$canvas,e,n)),this.renderingContext.renderReasons.add(io.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={}),Uo(this,void 0,void 0,function(){var n,r;return qo(this,function(i){return n=e.type,r=e.encoderOptions,[2,this.context.canvas.toDataURL(n,r)]})})},t}(),Dz=function(t){Bt(e,t);function e(){var n=t.apply(this,lt([],I(arguments),!1))||this;return n.name="canvas-context-register",n}return e.prototype.init=function(){this.context.ContextService=jz},e.prototype.destroy=function(){delete this.context.ContextService},e}(to),Y2=function(t){Bt(e,t);function e(n){var r=t.call(this,n)||this;return r.registerPlugin(new Dz),r.registerPlugin(new Iz),r.registerPlugin(new iz),r.registerPlugin(new Az),r.registerPlugin(new Tz),r.registerPlugin(new wz),r.registerPlugin(new Lz),r}return e}(r9),Bz=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 Uo(n,void 0,void 0,function(){var x,_,O,w,S,M;return qo(this,function(E){switch(E.label){case 0:if(!d){if(x=b.timeStamp-h,_=Gr([b.clientX,b.clientY],p),x<=this.dragndropPluginOptions.dragstartTimeThreshold||_<=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 x=b.clone();v&&(x.type="drop",x.target=v,v.dispatchEvent(x)),x.type="dragend",f.dispatchEvent(x),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}(),$2=function(t){Bt(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 Bz(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}(to);function Fz(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 V2=Fz,zz=function(t){return typeof t=="object"&&t!==null},qv=zz,Gz=function(t){if(!qv(t)||!Ol(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},co=Gz,Wz=5;function Hz(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 X2(t,e,n,r){n=n||0,r=r||Wz;for(var i in e)if(Hz(e,i)){var a=e[i];a!==null&&co(a)?(co(t[i])||(t[i]={}),ni.pop().map(([a,o])=>[...i,a,o]));return t}function Qvt(t,...e){return Z2(kd(t,...e),e)}function Jvt(t,e,...n){return Z2(Qv(t,e,...n),n)}function Zv(t,e,...n){return fc(t,Gl,e,n)}function Qv(t,e,...n){return fc(t,Array.from,e,n)}function tgt(t,...e){return fc(t,identity,Q2,e)}function egt(t,...e){return fc(t,Array.from,Q2,e)}function Q2(t){if(t.length!==1)throw new Error("duplicate key");return t[0]}function fc(t,e,n,r){return function i(a,o){if(o>=r.length)return n(a);const s=new $z,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 J2=function(t){return jt(t)?"":t.toString()},Vz=function(t){var e=J2(t);return e.charAt(0).toLowerCase()+e.substring(1)},tO=Vz,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())})};function ss(t){return t}function Jv(t){return t.reduce((e,n)=>(r,...i)=>n(e(r,...i),...i),ss)}function Uz(t){return t.reduce((e,n)=>r=>Xz(this,void 0,void 0,function*(){const i=yield e(r);return n(i)}),ss)}function tg(t){return t.replace(/( |^)[a-z]/g,e=>e.toUpperCase())}function dc(t=""){throw new Error(t)}function eg(t,e){const{attributes:n}=e,r=new Set(["id","className"]);for(const[i,a]of Object.entries(n))r.has(i)||(i==="transform"&&t.attr(i,""),t.attr(i,a))}function rn(t){return t!=null&&!Number.isNaN(t)}function ngt(t,e){return t+(e-t)*Math.random()}function qz(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 Kz(t,e){const{transform:n}=t.style,i=(a=>a==="none"||a===void 0)(n)?"":n;t.style.transform=`${i} ${e}`.trimStart()}function Pt(t,e){return eO(t,e)||{}}function eO(t,e){const n=Object.entries(t||{}).filter(([r])=>r.startsWith(e)).map(([r,i])=>[tO(r.replace(e,"").trim()),i]).filter(([r])=>!!r);return n.length===0?null:Object.fromEntries(n)}function rgt(t,e){return Object.fromEntries(Object.entries(t).map(([n,r])=>[`${e}${upperFirst(n)}`,r]))}function Zz(t,e){return Object.fromEntries(Object.entries(t).filter(([n])=>e.find(r=>n.startsWith(r))))}function ng(t,...e){return Object.fromEntries(Object.entries(t).filter(([n])=>e.every(r=>!n.startsWith(r))))}function nO(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 Wl(t){return typeof t=="object"&&!(t instanceof Date)&&t!==null&&!Array.isArray(t)}function Pa(t){return t===null||t===!1}function rO(t,e,n=5,r=0){if(!(r>=n)){for(const i of Object.keys(e)){const a=e[i];!co(a)||!co(t[i])?t[i]=a:rO(t[i],a,n,r+1)}return t}}function te(t){return new Vn([t],null,t,t.ownerDocument)}class Vn{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 Vn(n,null,this._elements[0],this._document)}selectFacetAll(e){const n=typeof e=="string"?this._parent.querySelectorAll(e):e;return new Vn(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 Vn([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=xn(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 Vn([],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}}Vn.registry={g:dr,rect:as,circle:jl,path:Nr,text:na,ellipse:Lv,image:Nv,line:Dl,polygon:Bl,polyline:Rv,html:ld};const He={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 Qz=function(t){var e=J2(t);return e.charAt(0).toUpperCase()+e.substring(1)},lo=Qz;function Jz(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Cd(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 tG(t){return t=Cd(Math.abs(t)),t?t[1]:NaN}function eG(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 nG(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var rG=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function rg(t){if(!(e=rG.exec(t)))throw new Error("invalid format: "+t);var e;return new ig({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]})}rg.prototype=ig.prototype;function ig(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+""}ig.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 iG(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 iO;function aG(t,e){var n=Cd(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(iO=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")+Cd(t,Math.max(0,e+a-1))[0]}function aO(t,e){var n=Cd(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 oO={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Jz,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)=>aO(t*100,e),r:aO,s:aG,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function sO(t){return t}var cO=Array.prototype.map,lO=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function oG(t){var e=t.grouping===void 0||t.thousands===void 0?sO:eG(cO.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?sO:nG(cO.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=rg(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,x=f.trim,_=f.type;_==="n"?(m=!0,_="g"):oO[_]||(b===void 0&&(b=12),x=!0,_="g"),(g||d==="0"&&h==="=")&&(g=!0,d="0",h="=");var O=v==="$"?n:v==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",w=v==="$"?r:/[%p]/.test(_)?o:"",S=oO[_],M=/[defgprs%]/.test(_);b=b===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function E(A){var N=O,k=w,P,T,L;if(_==="c")k=S(A)+k,A="";else{A=+A;var j=A<0||1/A<0;if(A=isNaN(A)?c:S(Math.abs(A),b),x&&(A=iG(A)),j&&+A==0&&p!=="+"&&(j=!1),N=(j?p==="("?p:s:p==="-"||p==="("?"":p)+N,k=(_==="s"?lO[8+iO/3]:"")+k+(j&&p==="("?")":""),M){for(P=-1,T=A.length;++PL||L>57){k=(L===46?i+A.slice(P+1):A.slice(P))+k,A=A.slice(0,P);break}}}m&&!g&&(A=e(A,1/0));var D=N.length+A.length+k.length,B=D>1)+N+A+k+B.slice(D);break;default:A=B+N+A+k;break}return a(A)}return E.toString=function(){return f+""},E}function u(f,d){var h=l((f=rg(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(tG(d)/3)))*3,v=Math.pow(10,-p),g=lO[8+p/3];return function(y){return h(v*y)+g}}return{format:l,formatPrefix:u}}var Ld,uo,sG;cG({thousands:",",grouping:[3],currency:["$",""]});function cG(t){return Ld=oG(t),uo=Ld.format,sG=Ld.formatPrefix,Ld}function fo(t,e){return Object.entries(t).reduce((n,[r,i])=>(n[r]=e(i,r,t),n),{})}function cs(t){return t.map((e,n)=>n)}function igt(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 dO(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 fG(t){if(t.length===1)return[t];const e=[];for(let n=1;n<=t.length;n++)e.push(...dO(t,n));return e}var dG=function(t){return t!==null&&typeof t!="function"&&isFinite(t.length)},Hl=dG,ag=function(t,e){if(t===e)return!0;if(!t||!e||wn(t)||wn(e))return!1;if(Hl(t)||Hl(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}const pO=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:Math.PI*3/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)},Yl=t=>{const{startAngle:e,endAngle:n,innerRadius:r,outerRadius:i}=pO(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",e,n,r,i]]};Yl.props={};const vO=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:Math.PI*3/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)},og=t=>{const{startAngle:e,endAngle:n,innerRadius:r,outerRadius:i}=vO(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...Yl({startAngle:e,endAngle:n,innerRadius:r,outerRadius:i})]};og.props={};function Nd(t,e,n){return Math.max(e,Math.min(t,n))}function Rd(t,e=10){return typeof t!="number"||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(e))}const hG=[["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 gO=rt(16290);function hn(t){const{transformations:e}=t.getOptions();return e.map(([r])=>r).filter(r=>r==="transpose").length%2!==0}function cn(t){const{transformations:e}=t.getOptions();return e.some(([n])=>n==="polar")}function $l(t){const{transformations:e}=t.getOptions();return e.some(([n])=>n==="reflect")&&e.some(([n])=>n.startsWith("transpose"))}function yO(t){const{transformations:e}=t.getOptions();return e.some(([n])=>n==="helix")}function Vl(t){const{transformations:e}=t.getOptions();return e.some(([n])=>n==="parallel")}function mO(t){const{transformations:e}=t.getOptions();return e.some(([n])=>n==="fisheye")}function pG(t){return Vl(t)&&cn(t)}function hc(t){return yO(t)||cn(t)}function bO(t){return cn(t)&&hn(t)}function ogt(t){return cn(t)||Vl(t)||$l(t)||bO(t)}function vG(t){if(hc(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 Id(t){const{transformations:e}=t.getOptions(),[,,,n,r]=e.find(i=>i[0]==="polar");return[+n,+r]}function sg(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 gG(t,e){const{transformations:n}=t.getOptions(),[,...r]=n.find(i=>i[0]===e);return r}function xO(t,e){e(t),t.children&&t.children.forEach(function(n){n&&xO(n,e)})}function Xl(t){jd(t,!0)}function ho(t){jd(t,!1)}function jd(t,e){var n=e?"visible":"hidden";xO(t,function(r){r.attr("visibility",n)})}function yG(t){return typeof t=="boolean"?!1:"enter"in t&&"update"in t&&"exit"in t}function _O(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=I(r,1),a=i[0];return!e.includes(a)}));return Object.fromEntries(e.map(function(r){return yG(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 OO(t,e){"update"in t?t.update(e):t.attr(e)}function wO(t,e,n){if(e.length===0)return null;if(!n){var r=e.slice(-1)[0];return OO(t,{style:r}),null}return t.animate(e,n)}function bG(t,e){return!(t.nodeName!=="text"||e.nodeName!=="text"||t.attributes.text!==e.attributes.text)}function xG(t,e,n,r){if(r===void 0&&(r="destroy"),bG(t,e))return t.remove(),[null];var i=function(){r==="destroy"?t.destroy():r==="hide"&&ho(t),e.isVisible()&&Xl(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=function(A){if(A.nodeName==="circle"){var N=I(A.getLocalPosition(),2),k=N[0],P=N[1],T=A.attr("r");return[k-T,P-T]}return A.getLocalPosition()},d=I(f(t),2),h=d[0],p=d[1],v=I(f(e),2),g=v[0],y=v[1],m=I([(h+g)/2-h,(p+y)/2-p],2),b=m[0],x=m[1],_=t.style.opacity,O=_===void 0?1:_,w=e.style.opacity,S=w===void 0?1:w,M=t.animate([{opacity:O,transform:"translate(0, 0)"},{opacity:0,transform:"translate(".concat(b,", ").concat(x,")")}],Q(Q({fill:"both"},n),{duration:c+l+u})),E=e.animate([{opacity:0,transform:"translate(".concat(-b,", ").concat(-x,")"),offset:.01},{opacity:S,transform:"translate(0, 0)"}],Q(Q({fill:"both"},n),{duration:l+u,delay:c+l-u}));return pc(E,i),[M,E]}function Bi(t,e,n){var r={},i={};return Object.entries(e).forEach(function(a){var o=I(a,2),s=o[0],c=o[1];if(!jt(c)){var l=t.style[s]||t.parsedStyle[s]||0;l!==c&&(r[s]=l,i[s]=c)}}),n?wO(t,[r,i],Q({fill:"both"},n)):(OO(t,i),null)}var _G=5,SO=function(t,e,n,r){n===void 0&&(n=0),r===void 0&&(r=_G),Object.entries(e).forEach(function(i){var a=I(i,2),o=a[0],s=a[1],c=t;Object.prototype.hasOwnProperty.call(e,o)&&(s?co(s)?(co(t[o])||(c[o]={}),n="A"&&n<="Z"};function de(t,e,n){n===void 0&&(n=!1);var r={};return Object.entries(t).forEach(function(i){var a=I(i,2),o=a[0],s=a[1];if(!(o==="className"||o==="class")){if(Dd(o,"show")&&Dd(PO(o,"show"),e)!==n)o===LG(e,"show")?r[o]=s:r[o.replace(new RegExp(fg(e)),"")]=s;else if(!Dd(o,"show")&&Dd(o,e)!==n){var c=PO(o,e);c==="filter"&&typeof s=="function"||(r[c]=s)}}}),r}function ra(t,e){return Object.entries(t).reduce(function(n,r){var i=I(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(fg(a))]=o,n},{})}function Ca(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=I(a,2),s=o[0],c=o[1];e.includes(s)||(n.indexOf(s)!==-1?i[s]=c:r[s]=c)}),[r,i]}function xi(t,e){return Xr(t)?t.apply(void 0,lt([],I(e),!1)):t}function Bd(t,e){return t.style.opacity||(t.style.opacity=1),Bi(t,{opacity:0},e)}var RG=["$el","anchor","cx","cy","d","defX","defY","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","billboardRotation","isSizeAttenuation","isClosed","isOverflowing","leading","letterSpacing","lineDash","lineHeight","lineWidth","markerEnd","markerEndOffset","markerMid","markerStart","markerStartOffset","maxLines","metrics","miterLimit","offsetX","offsetY","opacity","path","points","r","radius","rx","ry","shadowColor","src","stroke","strokeOpacity","text","textAlign","textBaseline","textDecorationColor","textDecorationLine","textDecorationStyle","textOverflow","textPath","textPathSide","textPathStartOffset","transform","transformOrigin","visibility","width","wordWrap","wordWrapWidth","x","x1","x2","y","y1","y2","z1","z2","zIndex"];function IG(t){return RG.includes(t)}function TO(t){var e={};for(var n in t)IG(n)&&(e[n]=t[n]);return e}var gc=bi({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function kO(t){return t.reduce(function(e,n,r){return e.push(lt([r===0?"M":"L"],I(n),!1)),e},[])}function jG(t,e,n){var r=e.connect,i=r===void 0?"line":r,a=e.center;if(i==="line")return kO(t);if(!a)return[];var o=ql(t[0],a),s=n?0:1;return t.reduce(function(c,l,u){return u===0?c.push(lt(["M"],I(l),!1)):c.push(lt(["A",o,o,0,0,s],I(l),!1)),c},[])}function dg(t,e,n){return e.type==="surround"?jG(t,e,n):kO(t)}function DG(t,e,n){var r=n.type,i=n.connect,a=n.center,o=n.closed,s=o?[["Z"]]:[],c=I([dg(t,n),dg(e.slice().reverse(),n,!0)],2),l=c[0],u=c[1],f=I([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([lt(["L"],I(h),!1)],[lt(["L"],I(d),!1)]);if(!a)throw new Error("Arc grid need to specified center");var v=I([ql(h,a),ql(d,a)],2),g=v[0],y=v[1];return p([lt(["A",g,g,0,0,1],I(h),!1),lt(["L"],I(h),!1)],[lt(["A",y,y,0,0,0],I(d),!1),lt(["L"],I(d),!1)])}function BG(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),path:dg(s.points,n)}});return t.selectAll(gc.line.class).data(o,function(s){return s.id}).join(function(s){return s.append("path").each(function(c,l){var u=xi(TO(Q({path:c.path},r)),[c,l,o]);this.attr(Q({class:gc.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:a},u))})},function(s){return s.transition(function(c,l){var u=xi(TO(Q({path:c.path},r)),[c,l,o]);return Bi(this,u,i.update)})},function(s){return s.transition(function(){var c=this,l=Bd(this,i.exit);return pc(l,function(){return c.remove()}),l})}).transitions()}function FG(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 UG(t){var e=t.attributes,n=e.startAngle,r=e.endAngle,i=e.center,a=e.radius;return lt(lt([n,r],I(i),!1),[a],!1)}function qG(t,e,n,r){var i=e.startAngle,a=e.endAngle,o=e.center,s=e.radius;return t.selectAll(Ke.line.class).data([{path:DO.apply(void 0,lt(lt([i,a],I(o),!1),[s],!1))}],function(c,l){return l}).join(function(c){return c.append("path").attr("className",Ke.line.name).styles(e).styles({path:function(l){return l.path}})},function(c){return c.transition(function(){var l=this,u=$G(this,UG(this),lt(lt([i,a],I(o),!1),[s],!1),r.update);if(u){var f=function(){var d=_i(l.attributes,"__keyframe_data__");l.style.path=DO.apply(void 0,lt([],I(d),!1))};u.onframe=f,u.onfinish=f}return u}).styles(e)},function(c){return c.remove()}).styles(n).transitions()}function KG(t,e){var n=e.truncRange,r=e.truncShape,i=e.lineExtension}function ZG(t,e,n){n===void 0&&(n=[0,0]);var r=I([t,e,n],3),i=I(r[0],2),a=i[0],o=i[1],s=I(r[1],2),c=s[0],l=s[1],u=I(r[2],2),f=u[0],d=u[1],h=I([c-a,l-o],2),p=h[0],v=h[1],g=Math.sqrt(Math.pow(p,2)+Math.pow(v,2)),y=I([-f/g,d/g],2),m=y[0],b=y[1];return[m*p,m*v,b*p,b*v]}function BO(t){var e=I(t,2),n=I(e[0],2),r=n[0],i=n[1],a=I(e[1],2),o=a[0],s=a[1];return{x1:r,y1:i,x2:o,y2:s}}function QG(t,e,n,r){var i=e.showTrunc,a=e.startPos,o=e.endPos,s=e.truncRange,c=e.lineExtension,l=I([a,o],2),u=I(l[0],2),f=u[0],d=u[1],h=I(l[1],2),p=h[0],v=h[1],g=I(c?ZG(a,o,c):new Array(4).fill(0),4),y=g[0],m=g[1],b=g[2],x=g[3],_=function(D){return t.selectAll(Ke.line.class).data(D,function(B,z){return z}).join(function(B){return B.append("line").attr("className",function(z){return"".concat(Ke.line.name," ").concat(z.className)}).styles(n).transition(function(z){return Bi(this,BO(z.line),!1)})},function(B){return B.styles(n).transition(function(z){var W=z.line;return Bi(this,BO(W),r.update)})},function(B){return B.remove()}).transitions()};if(!i||!s)return _([{line:[[f+y,d+m],[p+b,v+x]],className:Ke.line.name}]);var O=I(s,2),w=O[0],S=O[1],M=p-f,E=v-d,A=I([f+M*w,d+E*w],2),N=A[0],k=A[1],P=I([f+M*S,d+E*S],2),T=P[0],L=P[1],j=_([{line:[[f+y,d+m],[N,k]],className:Ke.lineFirst.name},{line:[[T,L],[p+b,v+x]],className:Ke.lineSecond.name}]);return KG(t,e),j}function JG(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(Ke.line.class):a?l=t.select(Ke.lineSecond.class):l=t.select(Ke.line.class),!i||!o||n.type==="arc"&&jO(n.startAngle,n.endAngle)){var u=l.node();u&&(u.style.markerEnd=void 0);return}var f=fs(o);f.attr(r),pg(f,c,!0),l.style("markerEnd",f).style("markerEndOffset",-s)}function tW(t,e,n){var r=e.type,i,a=de(e,"line");return r==="linear"?i=QG(t,e,CO(a,"arrow"),n):i=qG(t,e,CO(a,"arrow"),n),JG(t,r,e,a),i}function eW(t,e){return gg(t,e.gridDirection,e)}function FO(t){var e=t.type,n=t.gridCenter;return e==="linear"?n:n||t.center}function nW(t,e){var n=e.gridLength;return t.map(function(r,i){var a=r.value,o=I(zd(a,e),2),s=o[0],c=o[1],l=I(ka(eW(a,e),n),2),u=l[0],f=l[1];return{id:i,points:[[s,c],[s+u,c+f]]}})}function rW(t,e){var n=e.gridControlAngles,r=FO(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=I(r,2),a=i[0],o=i[1];return t.map(function(s,c){var l=s.value,u=I(zd(l,e),2),f=u[0],d=u[1],h=I([f-a,d-o],2),p=h[0],v=h[1],g=[];return n.forEach(function(y){var m=vc(y),b=I([Math.cos(m),Math.sin(m)],2),x=b[0],_=b[1],O=p*x-v*_+a,w=p*_+v*x+o;g.push([O,w])}),{points:g,id:c}})}function iW(t,e,n,r){var i=de(n,"grid"),a=i.type,o=i.areaFill,s=FO(n),c=vg(e,n.gridFilter),l=a==="segment"?nW(c,n):rW(c,n),u=Q(Q({},i),{center:s,areaFill:Xr(o)?c.map(function(f,d){return xi(o,[f,d,c])}):o,animate:r,data:l});return t.selectAll(Ke.grid.class).data([1]).join(function(f){return f.append(function(){return new GG({style:u})}).attr("className",Ke.grid.name)},function(f){return f.transition(function(){return this.update(u)})},function(f){return f.remove()}).transitions()}function hr(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 aW=function(t,e,n){if(n===void 0&&(n=128),!Xr(t))throw new TypeError("Expected a function");var r=function(){for(var i=[],a=0;a0,m=r-c,b=i-l,x=d*b-h*m;if(x<0===y)return!1;var _=p*b-v*m;return!(_<0===y||x>g===y||_>g===y)}function $O(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 YO(e,r)})}var dgt={lineToLine:YO,intersectBoxLine:$O,getBounds:Hd};function hW(t,e,n){var r,i,a=Hd(t,n).flat(1),o=Hd(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=mr(s),l=c.next();!l.done;l=c.next()){var u=l.value;if($O(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 pW(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=I(a,2),c=s[0],l=s[1],u=r==="negative"?0:i,f=-o-u,d=o+u,h=I(pr(e),4),p=h[0],v=h[1],g=h[2],y=h[3];return new xg(c+f-y,l+f-p,c+d+v,l+d+g)}var m=I(t.startPos,2),b=m[0],x=m[1],_=I(t.endPos,2),O=_[0],w=_[1],S=I(IO(t)?[-e,0,e,0]:[0,e,0,-e],4),M=S[0],E=S[1],A=S[2],N=S[3],k=Kl(0,t),P=ka(k,i),T=new xg(b,x,O,w);return T.x1+=N,T.y1+=M,T.x2+=E+P[0],T.y2+=A+P[1],T}function Yd(t,e,n){var r,i,a=e.crossPadding,o=new Set,s=null,c=pW(e,a),l=function(p){return c?dW(c,p):!0},u=function(p,v){return p?!hW(p,v,pr(n)):!0};try{for(var f=mr(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 Og(t,e){return e===void 0&&(e={}),jt(t)?0:typeof t=="number"?t:Math.floor(oW(t,e))}function vW(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=zO(r.getTextShape(t[0])),p=Og(u,h),v=o?Og(o,h):p,g=Og(c,h);(jt(g)||g===1/0)&&(g=Math.max.apply(null,t.map(function(P){return _g(P).width})));for(var y=t.slice(),m=I(d,4),b=m[0],x=b===void 0?0:b,_=m[1],O=_===void 0?0:_,w=m[2],S=w===void 0?x:w,M=m[3],E=M===void 0?O:M,A=function(P){if(y.forEach(function(T){r.ellipsis(r.getTextShape(T),P,a)}),y=Yd(t,n,d),y.length<1)return{value:void 0}},N=g;N>v+p;N-=p){var k=A(N);if(typeof k=="object")return k.value}}}function hgt(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 VO(t){var e=t.getLocalBounds(),n=e.min,r=e.max,i=I([n,r],2),a=I(i[0],2),o=a[0],s=a[1],c=I(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 pgt(t,e){var n=select(t).append("text").node();return n.attr(__assign(__assign({},e),{visibility:"hidden"})),n}function gW(t,e){var n=I(t,2),r=n[0],i=n[1],a=I(e,2),o=a[0],s=a[1];return r!==o&&i===s}function vgt(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 yW(t,e){var n,r,i=e.attributes;try{for(var a=mr(Object.entries(i)),o=a.next();!o.done;o=a.next()){var s=I(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 mW={parity:function(t,e){var n=e.seq,r=n===void 0?2:n;return t.filter(function(i,a){return a%r?(ho(i),!1):!0})}},bW=function(t){return t.filter(HO)};function xW(t,e,n,r){var i=t.length,a=e.keepHeader,o=e.keepTail;if(!(i<=1||i===2&&a&&o)){var s=mW.parity,c=function(b){return b.forEach(r.show),b},l=2,u=t.slice(),f=t.slice(),d=Math.min.apply(Math,lt([1],I(t.map(function(b){return _g(b).width})),!1));if(n.type==="linear"&&(RO(n)||IO(n))){var h=VO(t[0]).left,p=VO(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 SW=new Map([["hide",xW],["rotate",_W],["ellipsis",vW],["wrap",wW]]);function MW(t,e,n){return e.labelOverlap.length<1?!1:n==="hide"?!wG(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 EW(t,e,n){var r=e.labelOverlap,i=r===void 0?[]:r;i.length&&i.forEach(function(a){var o=a.type,s=SW.get(o);MW(t,e,o)&&(s==null||s(t,a,e,n))})}function AW(){for(var t=[],e=0;e=this.left&&e<=this.right&&n>=this.top&&n<=this.bottom},t}();function ggt(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 pn(r,i,c,l)}var ew=bi({text:"text"},"title");function $d(t){return/\S+-\S+/g.test(t)?t.split("-").map(function(e){return e[0]}):t.length>2?[t[0]]:t.split("")}function BW(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=$d(r),u=I(pr(o?i:0),4),f=u[0],d=u[1],h=u[2],p=u[3],v=I(pr(a),4),g=v[0],y=v[1],m=v[2],b=v[3],x=I([p+d,f+h],2),_=x[0],O=x[1],w=I([b+y,g+m],2),S=w[0],M=w[1];if(l[0]==="l")return new pn(s.x,s.y,c.width+s.width+_+S,Math.max(c.height+M,s.height));if(l[0]==="t")return new pn(s.x,s.y,Math.max(c.width+S,s.width),c.height+s.height+O+M);var E=I([e.attributes.width||c.width,e.attributes.height||c.height],2),A=E[0],N=E[1];return new pn(c.x,c.y,A+s.width+_+S,N+s.height+O+M)}function FW(t,e){var n=Object.entries(e).reduce(function(r,i){var a=I(i,2),o=a[0],s=a[1],c=t.node().attr(o);return c||(r[o]=s),r},{});t.styles(n)}function zW(t){var e,n,r,i,a=t,o=a.width,s=a.height,c=a.position,l=I([+o/2,+s/2],2),u=l[0],f=l[1],d=I([+u,+f,"center","middle"],4),h=d[0],p=d[1],v=d[2],g=d[3],y=$d(c);return y.includes("l")&&(e=I([0,"start"],2),h=e[0],v=e[1]),y.includes("r")&&(n=I([+o,"end"],2),h=n[0],v=n[1]),y.includes("t")&&(r=I([0,"top"],2),p=r[0],g=r[1]),y.includes("b")&&(i=I([+s,"bottom"],2),p=i[0],g=i[1]),{x:h,y:p,textAlign:v,textBaseline:g}}var nw=function(t){Bt(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(ew.text.class);if(!l)return new pn(0,0,+i,+a);var u=l.getBBox(),f=u.width,d=u.height,h=I(pr(s),4),p=h[0],v=h[1],g=h[2],y=h[3],m=I([0,0,+i,+a],4),b=m[0],x=m[1],_=m[2],O=m[3],w=$d(o);if(w.includes("i"))return new pn(b,x,_,O);w.forEach(function(L,j){var D,B,z,W;L==="t"&&(D=I(j===0?[d+g,+a-d-g]:[0,+a],2),x=D[0],O=D[1]),L==="r"&&(B=I([+i-f-y],1),_=B[0]),L==="b"&&(z=I([+a-d-p],1),O=z[0]),L==="l"&&(W=I(j===0?[f+v,+i-f-v]:[0,+i],2),b=W[0],_=W[1])});var S=I(pr(c),4),M=S[0],E=S[1],A=S[2],N=S[3],k=I([N+E,M+A],2),P=k[0],T=k[1];return new pn(b+N,x+M,_-P,O-T)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new pn(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=Ue(n,["width","height","position","spacing"]),u=I(Ca(l),1),f=u[0],d=zW(n),h=d.x,p=d.y,v=d.textAlign,g=d.textBaseline;Vr(!!l.text,ce(r),function(y){i.title=y.maybeAppendByClassName(ew.text,"text").styles(f).call(FW,{x:h,y:p,textAlign:v,textBaseline:g}).node()})},e}(or);function GW(t,e,n){var r=n.titlePosition,i=r===void 0?"lb":r,a=n.titleSpacing,o=$d(i),s=t.node().getLocalBounds(),c=I(s.min,2),l=c[0],u=c[1],f=I(s.halfExtents,2),d=f[0],h=f[1],p=I(e.node().getLocalBounds().halfExtents,2),v=p[0],g=p[1],y=I([l+d,u+h],2),m=y[0],b=y[1],x=I(pr(a),4),_=x[0],O=x[1],w=x[2],S=x[3];if(["start","end"].includes(i)&&n.type==="linear"){var M=n.startPos,E=n.endPos,A=I(i==="start"?[M,E]:[E,M],2),N=A[0],k=A[1],P=EO([-k[0]+N[0],-k[1]+N[1]]),T=I(ka(P,_),2),L=T[0],j=T[1];return{x:N[0]+L,y:N[1]+j}}return o.includes("t")&&(b-=h+g+_),o.includes("r")&&(m+=d+v+O),o.includes("l")&&(m-=d+v*2+S),o.includes("b")&&(b+=h+g*2+w),{x:m,y:b}}function WW(t,e,n){var r=t.cloneNode(!0);r.style.transform="scale(1, 1)",r.style.transform="none";var i=r.getBBox().height;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 rw(t,e,n,r,i){var a=de(r,"title"),o=I(Ca(a),2),s=o[0],c=o[1],l=c.transform,u=Ue(c,["transform"]);t.styles(s),e.styles(u);var f=l||WW(t.node(),s.direction,s.position);Wd(t.node(),f);var d=GW(ce(n._offscreen||n.querySelector(Ke.mainGroup.class)),e,r),h=d.x,p=d.y,v=Bi(e.node(),{x:h,y:p},i);return Wd(t.node(),f),v}function HW(t,e,n,r){var i=n.titleText;return t.selectAll(Ke.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 fs(i)}).attr("className",Ke.title.name).transition(function(){return rw(ce(this),t,e,n,r.enter)})},function(a){return a.transition(function(){return rw(ce(this),t,e,n,r.update)})},function(a){return a.remove()}).transitions()}function iw(t,e,n,r){var i=t.showLine,a=t.showTick,o=t.showLabel,s=e.maybeAppendByClassName(Ke.lineGroup,"g"),c=Vr(i,s,function(h){return tW(h,t,r)})||[],l=e.maybeAppendByClassName(Ke.tickGroup,"g"),u=Vr(a,l,function(h){return DW(h,n,t,r)})||[],f=e.maybeAppendByClassName(Ke.labelGroup,"g"),d=Vr(o,f,function(h){return LW(h,n,t,r)})||[];return lt(lt(lt([],I(c),!1),I(u),!1),I(d),!1).filter(function(h){return!!h})}var Sg=function(t){Bt(e,t);function e(n){return t.call(this,n,lg)||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=MG(s,f).filter(function(_){var O=_.value;return!(d&&O>d[0]&&O-1;)QW.call(t,a,1);return t},Ngt=null,tH=Array.prototype.splice,Rgt=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,tH.call(e,o,1))}return e},Igt=null,jgt=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},Dgt=null,Bgt=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},dyt=null,hyt=function(t,e){if(isArray(t)){for(var n,r=-1/0,i=0;ir&&(n=a,r=o)}return n}},pyt=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},Qyt=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}(),Jyt=null;class tu{constructor(e){this.options=dw({},this.getDefaultOptions()),this.update(e)}getOptions(){return this.options}update(e={}){this.options=dw({},this.options,e),this.rescale(e)}rescale(e){}}function Ud(t,e){return e-t?n=>(n-t)/(e-t):n=>.5}function mc(t,...e){return e.reduce((n,r)=>i=>n(r(i)),t)}function Eg(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 wH=rt(2489),SH=rt.n(wH);function Ag(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 MH(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=Ag(o,a,e+1/3),c=Ag(o,a,e),l=Ag(o,a,e-1/3);return[s*255,c*255,l*255,i]}function yw(t){const e=SH().get(t);if(!e)return null;const{model:n,value:r}=e;return n==="rgb"?r:n==="hsl"?MH(r):null}const bc=(t,e)=>n=>t*(1-n)+e*n,EH=(t,e)=>{const n=yw(t),r=yw(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})`}},eu=(t,e)=>typeof t=="number"&&typeof e=="number"?bc(t,e):typeof t=="string"&&typeof e=="string"?EH(t,e):()=>t,AH=(t,e)=>{const n=bc(t,e);return r=>Math.round(n(r))};function qd(t){return!hH(t)&&!uH(t)&&!Number.isNaN(t)}const Pg=Math.sqrt(50),Tg=Math.sqrt(10),kg=Math.sqrt(2);function Kd(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),a=r/Un(10,i);return i>=0?(a>=Pg?10:a>=Tg?5:a>=kg?2:1)*Un(10,i):-Un(10,-i)/(a>=Pg?10:a>=Tg?5:a>=kg?2:1)}function mw(t,e,n){const r=Math.abs(e-t)/Math.max(0,n);let i=Un(10,Math.floor(Math.log(r)/Math.LN10));const a=r/i;return a>=Pg?i*=10:a>=Tg?i*=5:a>=kg&&(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=Kd(o,s,n)):c<0&&(o=Math.ceil(o*c)/c,s=Math.floor(s*c)/c,c=Kd(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 PH(t,e){const n=ee?t:e;return i=>Math.min(Math.max(n,i),r)}const TH=(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=Eg(t,l,1,r)-1,f=i[u],d=a[u];return mc(d,f)(l)}},xw=(t,e,n,r)=>(Math.min(t.length,e.length)>2?kH:TH)(t,e,r?AH:n);class Zd extends tu{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:bc,tickCount:5}}map(e){return qd(e)?this.output(e):this.options.unknown}invert(e){return qd(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 bw}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?PH(i[0],i[a-1]):ds}composeOutput(e,n){const{domain:r,range:i,round:a,interpolate:o}=this.options,s=xw(r.map(e),i,o,a);this.output=mc(s,n,e)}composeInput(e,n,r){const{domain:i,range:a}=this.options,o=xw(a,i.map(e),bc);this.input=mc(n,r,o)}}const hs=(t,e,n)=>{let r,i,a=t,o=e;if(a===o&&n>0)return[a];let s=Kd(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 pn(e,n,r-e,i-n)}var NH=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=I([0,0],2),b=m[0],x=m[1],_=e.map(function(k){var P,T=k.width,L=k.height,j=I([b,x],2),D=j[0],B=j[1];return P=I([b+T*y[0],x+L*y[1]],2),b=P[0],x=P[1],new pn(D,B,T,L)}),O=ww(_),w={"flex-start":0,"flex-end":v?r-O.width:i-O.height,center:v?(r-O.width)/2:(i-O.height)/2},S=_.map(function(k){var P=k.x,T=k.y,L=pn.fromRect(k);return L.x=v?P+w[u]:P,L.y=v?T:T+w[u],L}),M=ww(S),E=function(k){var P=I(v?["height",i]:["width",r],2),T=P[0],L=P[1];switch(p){case"flex-start":return 0;case"flex-end":return L-k[T];case"center":return L/2-k[T]/2;default:return 0}},A=S.map(function(k){var P=k.x,T=k.y,L=pn.fromRect(k);return L.x=v?P:P+E(L),L.y=v?T+E(L):T,L}),N=A.map(function(k){var P,T,L=pn.fromRect(k);return L.x+=(P=t.x)!==null&&P!==void 0?P:0,L.y+=(T=t.y)!==null&&T!==void 0?T:0,L});return N},RH=function(t,e,n){return[]},IH=function(t,e,n){if(e.length===0)return[];var r={flex:NH,grid:RH},i=n.display in r?r[n.display]:null;return(i==null?void 0:i.call(null,t,e,n))||[]},jH=function(t){Bt(e,t);function e(n){var r=t.call(this,n)||this;r.layoutEvents=[Qt.BOUNDS_CHANGED,Qt.INSERTED,Qt.REMOVED],r.$margin=pr(0),r.$padding=pr(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=pr(n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return this.$padding},set:function(n){this.$padding=pr(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=I(this.$margin,4),u=l[0],f=l[1],d=l[2],h=l[3];return new pn(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=I(this.$padding,4),o=a[0],s=a[1],c=a[2],l=a[3],u=I(this.$margin,4),f=u[0],d=u[3];return new pn(l+d,o+f,r-l-s,i-o-c)},e.prototype.layout=function(){if(!(!this.attributes.display||!this.isConnected)&&!this.children.some(function(r){return!r.isConnected}))try{var n=IH(this.getAvailableSpace(),this.children.map(function(r){return r.getBBox()}),this.attributes);this.children.forEach(function(r,i){var a=n[i],o=a.x,s=a.y;r.attr({x:o,y:s})})}catch(r){}},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),DH=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 zH(t){return t==="horizontal"||t===0}function GH(t){return t==="vertical"||t===-Math.PI/2}function Aw(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 WH(t){return t.find(e=>e.getOptions().domain.length>0).getOptions().domain}function Jd(t){const e=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"],{style:n}=t,r=DH(t,["style"]),i={};return Object.entries(r).forEach(([a,o])=>{e.includes(a)?i[`show${lo(a)}`]=o:i[a]=o}),Object.assign(Object.assign({},i),n)}var Pw=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(!mO(e))return i;const a=t==="bottom"?[i,1]:[0,i],o=e.map(a);if(t==="bottom"){const s=o[0];return new wr({domain:[0,n],range:[0,1]}).map(s)}else if(t==="left"){const s=o[1];return new wr({domain:[0,r],range:[0,1]}).map(s)}return i}}function YH(t,e,n){if(t.getTicks)return t.getTicks();if(!n)return e;const[r,i]=La(e,o=>+o),{tickCount:a}=t.getOptions();return n(r,i,a)}function $H(t,e){if(cn(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 wr({domain:[0,1],range:[l/f,1-u/f]});return h=>d.map(h)}function Cw(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=YH(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=$H(o,s),p=HH(o,s),v=y=>["top","bottom","center","outer"].includes(y),g=y=>["left","right"].includes(y);return cn(s)||hn(s)?u.map((y,m,b)=>{var x,_;const O=((x=t.getBandWidth)===null||x===void 0?void 0:x.call(t,y))/2||0,w=h(t.map(y)+O);return{value:$l(s)&&o==="center"||hn(s)&&((_=t.getTicks)===null||_===void 0?void 0:_.call(t))&&v(o)||hn(s)&&g(o)?1-w:w,label:f(d(Rd(y),m,b)),id:String(m)}}):u.map((y,m,b)=>{var x;const _=((x=t.getBandWidth)===null||x===void 0?void 0:x.call(t,y))/2||0,O=p(h(t.map(y)+_));return{value:g(o)?1-O:O,label:f(d(Rd(y),m,b)),id:String(m)}})}function VH(t,e,n="xy"){const[r,i,a]=kw(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 XH(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 UH(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]=sg(i),[h,p]=kw(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 qH(t,e,n){return bO(e)||Vl(e)?!1:t===void 0?!!n.getTicks:t}function KH(t){const{depth:e}=t.getOptions();return e?{tickIsBillboard:!0,lineIsBillboard:!0,labelIsBillboard:!0,titleIsBillboard:!0,gridIsBillboard:!0}:{}}function ZH(t,e,n,r){const{x:i,y:a,width:o,height:s}=n;if(t==="bottom")return{startPos:[i,a],endPos:[i+o,a]};if(t==="left")return{startPos:[i+o,a+s],endPos:[i+o,a]};if(t==="right")return{startPos:[i,a+s],endPos:[i,a]};if(t==="top")return{startPos:[i,a+s],endPos:[i+o,a+s]};if(t==="center"){if(e==="vertical")return{startPos:[i,a],endPos:[i,a+s]};if(e==="horizontal")return{startPos:[i,a],endPos:[i+o,a]};if(typeof e=="number"){const[c,l]=r.getCenter(),[u,f]=Id(r),[d,h]=sg(r),p=Math.min(o,s)/2,{insetLeft:v,insetTop:g}=r.getOptions(),y=u*p,m=f*p,[b,x]=[c+i-v,l+a-g],[_,O]=[Math.cos(e),Math.sin(e)],w=[b+m*_,x+m*O],S=[b+y*_,x+y*O];return{startPos:w,endPos:S,gridClosed:h-d===360,gridCenter:[b,x],gridControlAngles:new Array(3).fill(0).map((M,E,A)=>(h-d)/(A.length-1)*E)}}}return{}}const QH=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=Pw(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:x}=v.getOptions(),_=Cw(v,x,s,a,o,c,r,y),O=f?_.map((k,P)=>{const T=f.get(P);return!T||T[0]!==k.label?k:Object.assign(Object.assign({},k),{bbox:T[1]})}):_,[w,S]=Id(y),M=UH(r,b,w,S,y),{axis:E,axisArc:A={}}=m,N=Jd(ot({},E,A,M,Object.assign(Object.assign({type:"arc",data:O,titleText:Qd(d),grid:h},p),l)));return new Sg({style:Ow(N,["transform"])})}};function JH(t,e,n,r,i,a){const o=n.axis,s=["top","right","bottom","left"].includes(i)?n[`axis${tg(i)}`]:n.axisLinear,c=t.getOptions().name,l=n[`axis${lo(c)}`]||{};return Object.assign({},o,s,l)}function tY(t,e,n,r,i,a){const o=JH(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:GH(a)?10:0,tick:r==="center"?!1:void 0}):o}const eY=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=Pw(t,["direction","important","labelFormatter","order","orientation","actualPosition","position","size","style","title","tickCount","tickFilter","tickMethod","transform","indexBBox"]);return({scales:[y],value:m,coordinate:b,theme:x})=>{const{bbox:_}=m,{domain:O}=y.getOptions(),w=tY(y,b,x,e,s,a),S=Object.assign(Object.assign(Object.assign({},w),l),g),M=VH(o||s,b,t.plane),E=ZH(s,a,_,b),A=KH(b),N=Cw(y,O,f,r,d,h,s,b),k=v?N.map((L,j)=>{const D=v.get(j);return!D||D[0]!==L.label?L:Object.assign(Object.assign({},L),{bbox:D[1]})}):N,P=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},S),{type:"linear",data:k,crossSize:c,titleText:Qd(u),labelOverlap:XH(p,S),grid:qH(S.grid,b,y),gridLength:M,line:!0,indexBBox:v}),S.line?null:{lineOpacity:0}),E),A),n);return P.labelOverlap.find(L=>L.type==="hide")&&(P.crossSize=!1),new Sg({className:"axis",style:Jd(P)})}},Lw=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"?uo(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)}},po=Lw(eY),Nw=Lw(QH);po.props={defaultPosition:"center",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]},Nw.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]};var nY=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 Rw=t=>{const{important:e={}}=t,n=nY(t,["important"]);return r=>{const{theme:i,coordinate:a,scales:o}=r;return po(Object.assign(Object.assign(Object.assign({},n),rY(t.orientation)),{important:Object.assign(Object.assign({},iY(t,i,a,o)),e)}))(r)}};Rw.props=Object.assign(Object.assign({},po.props),{defaultPosition:"center"});function th(t,e){return+t.toPrecision(e)}function tmt(t){return t.toLocaleString()}function emt(t){return t.toExponential()}function nmt(t,e){return e===void 0&&(e=0),Math.abs(t)<1e3?String(t):"".concat(th(t/1e3,e).toLocaleString(),"K")}var rmt=function(t,e,n){return t<0&&Number.isFinite(t)?e:n},imt=function(t,e,n){return t>0&&Number.isFinite(t)?e:n},amt=function(t,e){return t*e},omt=function(t,e){return t/2+(e||0)/2};function eh(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 aY={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},Lg=bi({background:"background",labelGroup:"label-group",label:"label"},"indicator"),oY=function(t){Bt(e,t);function e(n){var r=t.call(this,n,aY)||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=I(pr(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 pn(f[0]-l,f[1]-o,d[0]+s-f[0]+l,d[1]+c-f[1]+o),p=this.getPath(r,h),v=de(this.attributes,"background");this.background=ce(this.group).maybeAppendByClassName(Lg.background,"path").styles(Q(Q({},v),{path:p})),this.group.appendChild(this.label.node())}},e.prototype.renderLabel=function(){var n=this.attributes,r=n.formatter,i=n.labelText,a=de(this.attributes,"label"),o=I(Ca(a),2),s=o[0],c=o[1],l=s.text,u=Ue(s,["text"]);if(this.label=ce(this.group).maybeAppendByClassName(Lg.labelGroup,"g").styles(c),!!i){var f=this.label.maybeAppendByClassName(Lg.label,function(){return fs(r(i))}).style("text",r(i).toString());f.selectAll("text").styles(u)}},e.prototype.adjustLayout=function(){var n=I(this.point,2),r=n[0],i=n[1];this.group.attr("x",-r).attr("y",-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,lt([f+1,1],I(d),!1)),l[0][0]="M",l},e.prototype.createCorner=function(n,r){r===void 0&&(r=10);var i=.8,a=gW.apply(void 0,lt([],I(n),!1)),o=I(n,2),s=I(o[0],2),c=s[0],l=s[1],u=I(o[1],2),f=u[0],d=u[1],h=I(a?[f-c,[c,f]]:[d-l,[l,d]],2),p=h[0],v=I(h[1],2),g=v[0],y=v[1],m=p/2,b=p/Math.abs(p),x=r*b,_=x/2,O=x*Math.sqrt(3)/2*i,w=I([g,g+m-_,g+m,g+m+_,y],5),S=w[0],M=w[1],E=w[2],A=w[3],N=w[4];return a?(this.point=[E,l-O],[["L",S,l],["L",M,l],["L",E,l-O],["L",A,l],["L",N,l]]):(this.point=[c+O,E],[["L",c,S],["L",c,M],["L",c+O,E],["L",c,A],["L",c,N]])},e.prototype.applyVisibility=function(){var n=this.attributes.visibility;n==="hidden"?ho(this):Xl(this)},e.prototype.bindEvents=function(){this.label.on(Qt.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},e}(or),Iw={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},jw={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},Dw={orientation:"horizontal",showLabel:!0,type:"start"},aa=bi({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),vo=bi({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),sY=function(t){Bt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(n,r){var i=n.size,a=i===void 0?10:i,o=n.radius,s=o===void 0?a/4:o,c=n.orientation,l=Ue(n,["size","radius","orientation"]),u=a,f=u*2.4,d=ce(r).maybeAppendByClassName(vo.iconRect,"rect").styles(Q(Q({},l),{width:u,height:f,radius:s,x:-u/2,y:-f/2})),h=1/3*u,p=2/3*u,v=1/4*f,g=3/4*f;d.maybeAppendByClassName("".concat(vo.iconLine,"-1"),"line").styles(Q({x1:h,x2:h,y1:v,y2:g},l)),d.maybeAppendByClassName("".concat(vo.iconLine,"-2"),"line").styles(Q({x1:p,x2:p,y1:v,y2:g},l)),d.node().setOrigin(u/2,f/2),c==="vertical"?r.setLocalEulerAngles(90):r.setLocalEulerAngles(0)},e}(or),Bw=function(t){Bt(e,t);function e(n){return t.call(this,n,Dw)||this}return e.prototype.renderLabel=function(n){var r=this,i=this.attributes.showLabel,a=de(this.attributes,"label"),o=a.transform,s=Ue(a,["transform"]),c=I(Ca(s,[]),2),l=c[0],u=c[1],f=ce(n).maybeAppendByClassName(vo.labelGroup,"g").styles(u),d=Q(Q({},jw),l),h=d.text,p=Ue(d,["text"]);Vr(!!i,f,function(v){r.label=v.maybeAppendByClassName(vo.label,"text").styles(Q(Q({},p),{transform:o,text:"".concat(h)})),r.label.on("mousedown",function(g){g.stopPropagation()}),r.label.on("touchstart",function(g){g.stopPropagation()})})},e.prototype.renderIcon=function(n){var r=this.attributes,i=r.orientation,a=r.type,o=Q(Q({orientation:i},Iw),de(this.attributes,"icon")),s=this.attributes.iconShape,c=s===void 0?function(){return new sY({style:o})}:s,l=ce(n).maybeAppendByClassName(vo.iconGroup,"g");l.selectAll(vo.icon.class).data([c]).join(function(u){return u.append(typeof c=="string"?c:function(){return c(a)}).attr("className",vo.icon.name)},function(u){return u.update(o)},function(u){return u.remove()})},e.prototype.render=function(n,r){this.renderIcon(r),this.renderLabel(r)},e}(or),Fw=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"]]},cY=Fw,lY=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"]]},uY=function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]},fY=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"]]},dY=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"]]},hY=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"]]},pY=function(t,e,n){var r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]},zw=function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},vY=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]]},gY=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]]},yY=function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]},mY=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},Gw=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},bY=Gw,xY=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]]},_Y=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]]},OY=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]]},wY=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 SY(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 MY=function(t,e,n){return[["M",t-n,e-n],["L",t+n,e],["L",t-n,e+n],["Z"]]};function EY(t){var e="default";if(Qo(t)&&t instanceof Image)e="image";else if(Xr(t))e="symbol";else if(wn(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 AY(t){var e=EY(t);return["base64","url","image"].includes(e)?"image":t&&e==="symbol"?"path":null}var tn=function(t){Bt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(n,r){var i=n.symbol,a=n.size,o=a===void 0?16:a,s=Ue(n,["symbol","size"]),c=AY(i);Vr(!!c,ce(r),function(l){l.maybeAppendByClassName("marker",c).attr("className","marker ".concat(c,"-marker")).call(function(u){if(c==="image"){var f=o*2;u.styles({img:i,width:f,height:f,x:-o,y:-o})}else{var f=o/2,d=Xr(i)?i:e.getSymbol(i);u.styles(Q({path:d==null?void 0:d(0,0,f)},s))}})})},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}(or);tn.registerSymbol("cross",vY),tn.registerSymbol("hyphen",mY),tn.registerSymbol("line",zw),tn.registerSymbol("plus",yY),tn.registerSymbol("tick",gY),tn.registerSymbol("circle",Fw),tn.registerSymbol("point",cY),tn.registerSymbol("bowtie",pY),tn.registerSymbol("hexagon",hY),tn.registerSymbol("square",lY),tn.registerSymbol("diamond",uY),tn.registerSymbol("triangle",fY),tn.registerSymbol("triangle-down",dY),tn.registerSymbol("line",zw),tn.registerSymbol("dot",Gw),tn.registerSymbol("dash",bY),tn.registerSymbol("smooth",xY),tn.registerSymbol("hv",_Y),tn.registerSymbol("vh",OY),tn.registerSymbol("hvh",wY),tn.registerSymbol("vhv",SY);function PY(t,e,n){var r=Math.round((t-n)/e);return n+r*e}function TY(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 Ww=1.4,Hw=.4;function kY(t,e,n){var r=n,i=r*Ww,a=r/2,o=r/6,s=t+i*Hw;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 CY(t,e,n){var r=n,i=r*Ww,a=r/2,o=r/6,s=e+i*Hw;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]]}tn.registerSymbol("hiddenHandle",TY),tn.registerSymbol("verticalHandle",kY),tn.registerSymbol("horizontalHandle",CY);var smt=function(t,e,n){return t===void 0&&(t="horizontal"),t==="horizontal"?e:n};function LY(t,e,n,r){var i;r===void 0&&(r=4);var a=I(t,2),o=a[0],s=a[1],c=I(e,2),l=c[0],u=c[1],f=I(n,2),d=f[0],h=f[1],p=I([l,u],2),v=p[0],g=p[1],y=g-v;return v>g&&(i=I([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 oa(t,e,n){return t===void 0&&(t="horizontal"),t==="horizontal"?e:n}var nu=bi({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),Yw={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},NY=function(t){Bt(e,t);function e(n){return t.call(this,n,Yw)||this}return e.prototype.render=function(n,r){var i=ce(r).maybeAppendByClassName(nu.markerGroup,"g");this.renderMarker(i);var a=ce(r).maybeAppendByClassName(nu.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?oa(a,"horizontalHandle","verticalHandle"):o;Vr(!!s,n,function(c){var l=de(r.attributes,"marker"),u=Q({symbol:s},l);r.marker=c.maybeAppendByClassName(nu.marker,function(){return new tn({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;Vr(a,n,function(u){var f,d=de(r.attributes,"label"),h=d.text,p=Ue(d,["text"]),v=((f=u.select(nu.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,x=I(oa(o,[0,b+c,"center","top"],[y+c,0,"start","middle"]),4),_=x[0],O=x[1],w=x[2],S=x[3];u.maybeAppendByClassName(nu.label,"text").styles(Q(Q({},p),{x:_,y:O,text:l(h).toString(),textAlign:w,textBaseline:S}))})},e}(or),$w={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},RY=Ta({},$w,{}),IY=Ta({},$w,ra(Yw,"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"}),jY=.01,cmt=.5,sr=bi({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 DY(t,e){for(var n=1;n=r&&e<=i)return[r,i]}return[e,e]}function BY(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 ru=bi({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function Xw(t){var e=t.orientation,n=t.size,r=t.length;return oa(e,[r,n],[n,r])}function Uw(t){var e=t.type,n=I(Xw(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 FY(t){return Uw(t)}function zY(t){var e=t.orientation,n=t.color,r=t.block,i=t.partition,a;if(Xr(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 Sa(l).toString()});return s?s===1?c[0]:r?BY(i,c,e):c.reduce(function(l,u,f){return l+=" ".concat(f/(s-1),":").concat(u)},"l(".concat(oa(e,"0","270"),")")):""}function GY(t){var e=t.orientation,n=t.range;if(!n)return[];var r=I(Xw(t),2),i=r[0],a=r[1],o=I(n,2),s=o[0],c=o[1],l=oa(e,s*i,0),u=oa(e,0,s*a),f=oa(e,c*i,i),d=oa(e,a,c*a);return[["M",l,u],["L",l,d],["L",f,d],["L",f,u],["Z"]]}function WY(t,e){var n=de(e,"track");t.maybeAppendByClassName(ru.track,"path").styles(Q({path:Uw(e)},n))}function HY(t,e){var n=de(e,"selection"),r=zY(e),i=t.maybeAppendByClassName(ru.selection,"path").styles(Q({path:FY(e),fill:r},n)),a=i.maybeAppendByClassName(ru.clipPath,"path").styles({path:GY(e)}).node();i.style("clip-path",a)}var YY=function(t){Bt(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=ce(r).maybeAppendByClassName(ru.trackGroup,"g");WY(i,n);var a=ce(r).maybeAppendByClassName(ru.selectionGroup,"g");HY(a,n)},e}(or);function $Y(t){return{min:Math.min.apply(Math,lt([],I(t.map(function(e){return e.value})),!1)),max:Math.max.apply(Math,lt([],I(t.map(function(e){return e.value})),!1))}}var VY=function(t){Bt(e,t);function e(n){var r=t.call(this,n,IY)||this;return r.eventToOffsetScale=new wr({}),r.innerRibbonScale=new wr({}),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=Vw(o.map(function(f){var d=f.value;return d}),c).range;r.showIndicator((l[0]+l[1])/2,"".concat(l[0],"-").concat(l[1])),r.dispatchIndicated(c,l)}else{var u=r.getTickValue(c);r.showIndicator(u),r.dispatchIndicated(u)}},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=I(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 pn(0,0,r,i)},e.prototype.render=function(n,r){var i=this,a=n.showLabel;this.renderTitle(ce(r));var o=this.availableSpace,s=o.x,c=o.y,l=ce(r).maybeAppendByClassName(sr.contentGroup,"g").styles({x:s,y:c}),u=l.maybeAppendByClassName(sr.labelGroup,"g").styles({zIndex:1});Vr(!!a,u,function(d){i.renderLabel(d)});var f=l.maybeAppendByClassName(sr.ribbonGroup,"g").styles({zIndex:0});this.handlesGroup=l.maybeAppendByClassName(sr.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]}:$Y(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=I(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=I(o,2),c=s[0],l=s[1];return[c,l]},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(n,r){return oa(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=de(this.attributes,"title"),l=Q(Q({},c),{width:o,height:s,text:a}),u=this;n.selectAll(sr.title.class).data(i?[a]:[]).join(function(f){return f.append(function(){return new nw({style:l})}).attr("className",sr.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 pn(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 pn(0,0,0,0);if(this.cacheLabelBBox)return this.cacheLabelBBox;var i=((n=this.label.querySelector(Ke.labelGroup.class))===null||n===void 0?void 0:n.children.slice(-1)[0]).getBBox(),a=i.width,o=i.height;return this.cacheLabelBBox=new pn(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=I(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 x=Math.max(g,u),_=h-x,O=I(this.ifHorizontal([_,m],[m,_]),2),w=O[0],S=O[1],M=["top","left"].includes(b)?l:0,E=I(this.ifHorizontal([x/2,M],[M,x/2]),2),A=E[0],N=E[1];return new pn(A,N,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=de(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=Ta({x:p,y:v,length:y,size:m,type:a,orientation:o,color:s,block:c,partition:i.map(function(x){return(x.value-f)/(d-f)}),range:this.ribbonRange},l);this.ribbon=n.maybeAppendByClassName(sr.ribbon,function(){return new YY({style:b})}).update(b)},e.prototype.getHandleClassName=function(n){return"".concat(sr.prefix("".concat(n,"-handle")))},e.prototype.renderHandles=function(){var n=this.attributes,r=n.showHandle,i=n.orientation,a=de(this.attributes,"handle"),o=I(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"?NY:Bw,h=this;this.handlesGroup.selectAll(sr.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(sr.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=I(this.selection,2),r=n[0],i=n[1];this.setHandlePosition("start",r),this.setHandlePosition("end",i)},e.prototype.adjustTitle=function(){var n=this.attributes,r=n.titlePosition,i=n.orientation,a=I(this.getElementsByClassName(sr.title.name),1),o=a[0],s=this.handlesGroup.select(".".concat(this.getHandleClassName("start"))).node();if(!(!o||!s)&&!(r!=="top-left"||i!=="horizontal")){var c=I(s.getLocalBounds().min,1),l=c[0],u=I(o.getLocalBounds().min,1),f=u[0],d=l-f;o.style.x=+(this.style.x||0)+d}},Object.defineProperty(e.prototype,"handleBBox",{get:function(){if(this.cacheHandleBBox)return this.cacheHandleBBox;if(!this.attributes.showHandle)return new pn(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=I([Math.max(r,o),Math.max(i,s)],2),l=c[0],u=c[1];return this.cacheHandleBBox=new pn(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=I(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=I(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({x:f,y:d,formatter:i})},e.prototype.renderIndicator=function(n){var r=de(this.attributes,"indicator");this.indicator=n.maybeAppendByClassName(sr.indicator,function(){return new oY({})}).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 ZY(t,e,n){const r=gw(e),i=pw(e,t),a=1;return 1-i/(r-1)-n+a}function QY(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 JY(t,e){return t>=e?2-(t-1)/(e-1):1}function t$(t,e,n,r){const i=e-t;return 1-.5*(Un(e-r,2)+Un(t-n,2))/Un(.1*i,2)}function e$(t,e,n){const r=e-t;if(n>r){const i=(n-r)/2;return 1-Un(i,2)/Un(.1*r,2)}return 1}function n$(){return 1}const Ng=(t,e,n=5,r=!0,i=XY,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||N<=t&&k>=e)&&(s.lmin=N,s.lmax=k,s.lstep=P,s.score=B)}}x+=1}y+=1}}c+=1}const l=au(s.lmax),u=au(s.lmin),f=au(s.lstep),d=Math.floor(qY((l-u)/f))+1,h=new Array(d);h[0]=au(u);for(let p=1;pa-o);const i=[];for(let a=1;a({value:e/t,label:String(e)})}function l$(t,e,n,r,i){const a=e.thresholds,o=c$(r);return Object.assign(Object.assign({},t),{color:i,data:[n,...a,r].map(o)})}function u$(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 iu)));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 h$(t,e,n,r,i,a){const o=ia(t,"color"),s=s$(n,r,i);if(o instanceof xc){const{range:u}=o.getOptions(),[f,d]=Rg(o);return o instanceof nh||o instanceof rh?l$(s,o,f,d,u):u$(s,o,u)}const c=ia(t,"size"),l=ia(t,"opacity");return d$(s,o,c,l,e,a)}const go=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:a,size:o,title:s,style:c,crossPadding:l,padding:u}=t,f=a$(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:x}=g,_=Mw(a,n),{legendContinuous:O={}}=p,w=Jd(Object.assign({},O,Object.assign(Object.assign({titleText:Qd(s),labelAlign:"value",labelFormatter:typeof e=="string"?M=>uo(e)(M.label):e},h$(d,v,h,t,go,p)),c),f)),S=new Ew({style:Object.assign(Object.assign({x:y,y:m,width:b,height:x},_),{subOptions:w})});return S.appendChild(new VY({className:"legend-continuous",style:w})),S}};go.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[12,12]};const Kw=t=>(...e)=>go(Object.assign({},{block:!0},t))(...e);Kw.props=Object.assign(Object.assign({},go.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const Ig=t=>e=>{const{scales:n}=e,r=ia(n,"size");return go(Object.assign({},{type:"size",data:r.getTicks().map((i,a)=>({value:i,label:String(i)}))},t))(e)};Ig.props=Object.assign(Object.assign({},go.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const Zw=t=>Ig(Object.assign({},{block:!0},t));Zw.props=Object.assign(Object.assign({},go.props),{defaultPosition:"top",defaultOrientation:"horizontal"});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);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:x,coordinate:_,theme:O,component:w,interaction:S,x:M,y:E,z:A,key:N,frame:k,labelTransform:P,parentKey:T,clip:L,viewStyle:j,title:D}=e,B=p$(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:N,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:_,component:w,interaction:S,frame:k,labelTransform:P,margin:v,marginLeft:g,marginBottom:y,marginTop:m,marginRight:b,parentKey:T,clip:L,style:j},!t&&{title:D}),{marks:[Object.assign(Object.assign(Object.assign({},B),{key:`${N}-0`,data:x}),t&&{title:D})]})]};Qw.props={};var v$=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);iot({},t(e,...n),e)}function Oc(t){return(e,...n)=>ot({},e,t(e,...n))}function jg(t,e){if(!t)return e;if(Array.isArray(t))return t;const{value:n=e}=t,r=v$(t,["value"]);return Object.assign(Object.assign({},r),{value:n})}var Dg=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=Dg(t,["children"]);if(!Array.isArray(e))return[];const{data:r,scale:i={},axis:a={},legend:o={},encode:s={},transform:c=[]}=n,l=Dg(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=Dg(f,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:jg(d,r),scale:ot({},i,h),encode:ot({},s,g),transform:[...c,...y],axis:p&&a?ot({},a,p):!1,legend:v&&o?ot({},o,v):!1},m)});return[Object.assign(Object.assign({},l),{marks:u,type:"standardView"})]};Jw.props={};function Ln([t,e],[n,r]){return[t-n,e-r]}function ih([t,e],[n,r]){return[t+n,e+r]}function _n([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function Oi([t,e]){return Math.atan2(e,t)}function wc([t,e]){return Oi([t,e])+Math.PI/2}function tS(t,e){const n=Oi(t),r=Oi(e);return nr===0?t.moveTo(n[0],n[1]):t.lineTo(n[0],n[1])),t.closePath(),t}function y$(t,e,n){const{arrowSize:r}=n,i=typeof r=="string"?+parseFloat(r)/100*_n(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 ou(t,e,n,r,i){const a=Oi(Ln(r,e))+Math.PI,o=Oi(Ln(r,n))+Math.PI;return t.arc(r[0],r[1],i,a,o,o-a<0),t}function nS(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=cs(s),[u,f]=La(l,g=>s[g]),d=new wr({domain:[u,f],range:[0,100]}),h=g=>d.map(s[g]),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 ah(t){const[e,n,r,i]=t;return[i,e,n,r]}function ps(t,e,n){const[r,i,,a]=hn(t)?ah(e):e,[o,s]=n,c=t.getCenter(),l=wc(Ln(r,c)),u=wc(Ln(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:_n(a,c),outerRadius:_n(r,c)}}function umt(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 rS(t){const{colorAttribute:e,opacityAttribute:n=e}=t;return`${n}Opacity`}function iS(t,e){if(!cn(t))return"";const n=t.getCenter(),{transform:r}=e;return`translate(${n[0]}, ${n[1]}) ${r||""}`}function aS(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 oS(t){return t.replace(/-(\w)/g,function(e,n){return n.toUpperCase()})}function m$(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()}var fmt=Array.prototype.slice;function sS(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function vn(t){return function(){return t}}function cS(t){this._context=t}cS.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 su(t){return new cS(t)}const Fg=Math.PI,zg=2*Fg,vs=1e-6,b$=zg-vs;function lS(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return lS;const n=Un(10,e);return function(r){this._+=r[0];for(let i=1,a=r.length;ivs)if(!(Math.abs(f*c-l*u)>vs)||!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((Fg-Math.acos((v+d-g)/(2*y*m)))/2),x=b/m,_=b/y;Math.abs(x-1)>vs&&this._append`L${e+x*u},${n+x*f}`,this._append`A${a},${a},0,0,${+(f*h>u*p)},${this._x1=e+_*c},${this._y1=n+_*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)>vs||Math.abs(this._y1-u)>vs)&&this._append`L${l},${u}`,r&&(d<0&&(d=d%zg+zg),d>b$?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>vs&&this._append`A${r},${r},0,${+(d>=Fg)},${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 wi(){return new oh}wi.prototype=oh.prototype;function dmt(t=3){return new oh(+t)}function Gg(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 oh(e)}function uS(t){return t[0]}function fS(t){return t[1]}function yo(t,e){var n=vn(!0),r=null,i=su,a=null,o=Gg(s);t=typeof t=="function"?t:t===void 0?uS:vn(t),e=typeof e=="function"?e:e===void 0?fS:vn(e);function s(c){var l,u=(c=sS(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 O$(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 w$=(t,e,n)=>{const r=_n(t,e),i=_n(e,n),a=_n(n,t);return(Math.pow(r,2)+Math.pow(i,2)-Math.pow(a,2))/(2*r*i)};function S$(t,e,n,r){const[[i,a],[o,s]]=e,[c,l]=_$(t);if(i===o&&a===s)return yo()([[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(w$(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=Wg(e,["className","class","transform","rotate","labelTransform","labelTransformOrigin","x","y","x0","y0","text","background","connector","startMarker","endMarker","coordCenter","innerHTML"]);if([c,l,u,f].some(L=>!$n(L))){t.children.forEach(L=>L.remove());return}const x=Pt(b,"background"),{padding:_}=x,O=Wg(x,["padding"]),w=Pt(b,"connector"),{points:S=[]}=w,M=Wg(w,["points"]),E=[[+u,+f],[+c,+l]];let A;m?A=te(t).maybeAppend("html","html",n).style("zIndex",0).style("innerHTML",m).call(Xt,Object.assign({transform:o,transformOrigin:s},b)).node():A=te(t).maybeAppend("text","text").style("zIndex",0).style("text",d).call(Xt,Object.assign({textBaseline:"middle",transform:o,transformOrigin:s},b)).node();const N=te(t).maybeAppend("background","rect").style("zIndex",-1).call(Xt,O$(A,_)).call(Xt,h?O:{}).node(),k=S$(N,E,S,y),P=v&&new tn({id:"startMarker",style:Object.assign({x:0,y:0},Pt(b,"startMarker"))}),T=g&&new tn({id:"endMarker",style:Object.assign({x:0,y:0},Pt(b,"endMarker"))});te(t).maybeAppend("connector","path").style("zIndex",0).style("path",k).style("markerStart",P).style("markerEnd",T).call(Xt,p?M:{})});function Mc(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 M$(t,e,n,r){const i=e.length/2,a=e.slice(0,i),o=e.slice(i);let s=Mc(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=Oi(Ln(f,u))/Math.PI*180;return{x:l[0],y:l[1],transform:`rotate(${d})`,textAlign:"center",textBaseline:"middle"}}function hS(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=nO(n.x,l),g=nO(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,textAnchor:"start",textBaseline:"middle"}:t==="right"?{x:l,y:u/2,textAnchor:"end",textBaseline:"middle"}:t==="top"?{x:l/2,y:0,textAnchor:"center",textBaseline:"top"}:t==="bottom"?{x:l/2,y:u,textAnchor:"center",textBaseline:"bottom"}:t==="top-left"?{x:0,y:0,textAnchor:"start",textBaseline:"top"}:t==="top-right"?{x:l,y:0,textAnchor:"end",textBaseline:"top"}:t==="bottom-left"?{x:0,y:u,textAnchor:"start",textBaseline:"bottom"}:t==="bottom-right"?{x:l,y:u,textAnchor:"end",textBaseline:"bottom"}:{x:l/2,y:u/2,textAnchor:"center",textBaseline:"middle"})}function pS(t,e,n,r){const{y:i,y1:a,autoRotate:o,rotateToAlignArc:s}=n,c=r.getCenter(),l=ps(r,e,[i,a]),{innerRadius:u,outerRadius:f,startAngle:d,endAngle:h}=l,p=t==="inside"?(d+h)/2:h,v=Hg(p,o,s),g=(()=>{const[y,m]=e,b=u+(f-u)*.5,[x,_]=t==="inside"?cu(c,p,b):eS(y,m);return{x,y:_}})();return Object.assign(Object.assign({},g),{textAlign:t==="inside"?"center":"start",textBaseline:"middle",rotate:v})}function cu(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function Hg(t,e,n){if(!e)return 0;const r=n?0:Math.sin(t)<0?90:-90;return t/Math.PI*180+r}function E$(t,e,n,r){const{y:i,y1:a,autoRotate:o,rotateToAlignArc:s,radius:c=.5,offset:l=0}=n,u=ps(r,e,[i,a]),{startAngle:f,endAngle:d}=u,h=r.getCenter(),p=(f+d)/2,g={textAlign:"center",textBaseline:"middle",rotate:Hg(p,o,s)},{innerRadius:y,outerRadius:m}=u,x=y+(m-y)*c+l,[_,O]=cu(h,p,x);return Object.assign({x:_,y:O},g)}function vS(t){return t===void 0?null:t}function gS(t,e,n,r){const{bounds:i}=n,[a]=i;return{x:vS(a[0]),y:vS(a[1])}}function Na(t,e,n,r){const{bounds:i}=n;return i.length===1?gS(t,e,n,r):($l(r)?pS:hc(r)?E$:hS)(t,e,n,r)}function A$(t,e,n,r,i){const[a,o]=cu(t,e,n),[s,c]=cu(t,e,r),l=Math.sin(e)>0?1:-1;return[[a,o],[s,c],[s+l*i,c]]}function yS(t,e,n){const r=ps(n,t,[e.y,e.y1]),{innerRadius:i,outerRadius:a}=r;return i+(a-i)}function mS(t,e,n){const r=ps(n,t,[e.y,e.y1]),{startAngle:i,endAngle:a}=r;return(i+a)/2}function Yg(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=mS(e,n,r),h=Math.sin(d)>0?1:-1,p=Hg(d,i,a),v={textAlign:h>0||$l(r)?"start":"end",textBaseline:"middle",rotate:p},g=yS(e,n,r),y=g+(s?c:o),[[m,b],[x,_],[O,w]]=A$(f,d,g,y,s?l:0),S=s?+u*h:0,M=O+S,E=w,A={connector:s,connectorPoints:[[x-M,_-E],[O-M,w-E]]};return Object.assign(Object.assign({x0:m,y0:b,x:O+S,y:w},v),A)}function P$(t,e,n,r){const{bounds:i}=n;return i.length===1?gS(t,e,n,r):($l(r)?pS:hc(r)?Yg:hS)(t,e,n,r)}var T$=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 C$=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]=cu(u,h,d);return s.x=v+(a+o)*p,s.y=g,s}var bS=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=bS(o,["text","x","y","transform","transformOrigin","className"]),p=R$(a,o,n,r,t),{rotate:v=0,transform:g=""}=p,y=bS(p,["rotate","transform"]);return te(new dS).call(Xt,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(Xt,h).node()}};xS.props={defaultMarker:"point"};function _S(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 OS(t,e){if(e(t))return t;let n=t.parent;for(;n&&!e(n);)n=n.parent;return n}function I$(t){return OS(t,e=>e.className==="component")}function j$(t){return OS(t,e=>e.className==="element")}function cr(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=j$(a),c=I$(a),l=s||c;if(!l)return;const{className:u,markType:f}=l;if(u==="element"){const d=Object.assign(Object.assign({},i),{nativeEvent:!0,data:{data:_S(l,e)}});n.emit(`element:${t}`,d),n.emit(`${f}:${t}`,d)}else{const d=Object.assign(Object.assign({},i),{nativeEvent:!0});n.emit(`component:${t}`,d),n.emit(`${o}:${t}`,d)}}}function wS(){return(t,e,n)=>{const{container:r,view:i}=t,a=cr(He.CLICK,i,n,w=>w.detail===1),o=cr(He.DBLCLICK,i,n,w=>w.detail===2),s=cr(He.POINTER_TAP,i,n),c=cr(He.POINTER_DOWN,i,n),l=cr(He.POINTER_UP,i,n),u=cr(He.POINTER_OVER,i,n),f=cr(He.POINTER_OUT,i,n),d=cr(He.POINTER_MOVE,i,n),h=cr(He.POINTER_ENTER,i,n),p=cr(He.POINTER_LEAVE,i,n),v=cr(He.POINTER_UPOUTSIDE,i,n),g=cr(He.DRAG_START,i,n),y=cr(He.DRAG,i,n),m=cr(He.DRAG_END,i,n),b=cr(He.DRAG_ENTER,i,n),x=cr(He.DRAG_LEAVE,i,n),_=cr(He.DRAG_OVER,i,n),O=cr(He.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",x),r.addEventListener("dragover",_),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",x),r.removeEventListener("dragover",_),r.removeEventListener("drop",O)}}}wS.props={reapplyWhenUpdate:!0};function D$(){return{"component.axisRadar":Rw,"component.axisLinear":po,"component.axisArc":Nw,"component.legendContinuousBlock":Kw,"component.legendContinuousBlockSize":Zw,"component.legendContinuousSize":Ig,"interaction.event":wS,"composition.mark":Qw,"composition.view":Jw,"shape.label.label":xS}}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);i{if(typeof a!="string")return a;const o=`${t}.${a}`;return n[o]||dc(`Unknown Component: ${o}`)};return[(a,o)=>{const{type:s}=a,c=B$(a,["type"]);s||dc("Plot type is required!");const l=r(s);return l==null?void 0:l(c,o)},r]}function SS(t){const{canvas:e,group:n}=t;return(e==null?void 0:e.document)||(n==null?void 0:n.ownerDocument)||dc("Cannot find library document")}var MS=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 gs(t){return Fi(t,"polar").length>0}function z$(t){return Fi(t,"helix").length>0}function Ec(t){return Fi(t,"transpose").length%2===1}function G$(t){return Fi(t,"parallel").length>0}function AS(t){return Fi(t,"theta").length>0}function W$(t){return Fi(t,"reflect").length>0}function lu(t){return Fi(t,"radial").length>0}function H$(t){return Fi(t,"radar").length>0}function Y$(t){return Fi(t,"reflectY").length>0}function $$(t){return t.find(e=>e.type==="cartesian"||e.type==="cartesian3D")?t:[...t,{type:"cartesian"}]}function he(t){for(var e=t.length/6|0,n=new Array(e),r=0;r>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?ch(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?ch(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=rV.exec(t))?new Sr(e[1],e[2],e[3],1):(e=iV.exec(t))?new Sr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=aV.exec(t))?ch(e[1],e[2],e[3],e[4]):(e=oV.exec(t))?ch(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=sV.exec(t))?IS(e[1],e[2]/100,e[3]/100,1):(e=cV.exec(t))?IS(e[1],e[2]/100,e[3]/100,e[4]):PS.hasOwnProperty(t)?CS(PS[t]):t==="transparent"?new Sr(NaN,NaN,NaN,0):null}function CS(t){return new Sr(t>>16&255,t>>8&255,t&255,1)}function ch(t,e,n,r){return r<=0&&(t=e=n=NaN),new Sr(t,e,n,r)}function LS(t){return t instanceof Ac||(t=Vg(t)),t?(t=t.rgb(),new Sr(t.r,t.g,t.b,t.opacity)):new Sr}function fu(t,e,n,r){return arguments.length===1?LS(t):new Sr(t,e,n,r==null?1:r)}function Sr(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}sh(Sr,fu,$g(Ac,{brighter:function(e){return e=e==null?Pc:Math.pow(Pc,e),new Sr(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=e==null?ys:Math.pow(ys,e),new Sr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},clamp:function(){return new Sr(ms(this.r),ms(this.g),ms(this.b),lh(this.opacity))},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:NS,formatHex:NS,formatHex8:fV,formatRgb:RS,toString:RS}));function NS(){return"#".concat(bs(this.r)).concat(bs(this.g)).concat(bs(this.b))}function fV(){return"#".concat(bs(this.r)).concat(bs(this.g)).concat(bs(this.b)).concat(bs((isNaN(this.opacity)?1:this.opacity)*255))}function RS(){var t=lh(this.opacity);return"".concat(t===1?"rgb(":"rgba(").concat(ms(this.r),", ").concat(ms(this.g),", ").concat(ms(this.b)).concat(t===1?")":", ".concat(t,")"))}function lh(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ms(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function bs(t){return t=ms(t),(t<16?"0":"")+t.toString(16)}function IS(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new zi(t,e,n,r)}function jS(t){if(t instanceof zi)return new zi(t.h,t.s,t.l,t.opacity);if(t instanceof Ac||(t=Vg(t)),!t)return new zi;if(t instanceof zi)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 zi(o,s,c,t.opacity)}function dV(t,e,n,r){return arguments.length===1?jS(t):new zi(t,e,n,r==null?1:r)}function zi(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}sh(zi,dV,$g(Ac,{brighter:function(e){return e=e==null?Pc:Math.pow(Pc,e),new zi(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=e==null?ys:Math.pow(ys,e),new zi(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*n,a=2*r-i;return new Sr(Xg(e>=240?e-240:e+120,a,i),Xg(e,a,i),Xg(e<120?e+240:e-120,a,i),this.opacity)},clamp:function(){return new zi(DS(this.h),uh(this.s),uh(this.l),lh(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 e=lh(this.opacity);return"".concat(e===1?"hsl(":"hsla(").concat(DS(this.h),", ").concat(uh(this.s)*100,"%, ").concat(uh(this.l)*100,"%").concat(e===1?")":", ".concat(e,")"))}}));function DS(t){return t=(t||0)%360,t<0?t+360:t}function uh(t){return Math.max(0,Math.min(1,t||0))}function Xg(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 BS(t,e,n,r,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*n+(1+3*t+3*a-3*o)*r+o*i)/6}function hV(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],a=t[r+1],o=r>0?t[r-1]:2*i-a,s=r180||n<-180?n-360*Math.round(n/360):n):Ug(isNaN(t)?e:t)}function yV(t){return(t=+t)==1?kc:function(e,n){return n-e?vV(e,n,t):Ug(isNaN(e)?n:e)}}function kc(t,e){var n=e-t;return n?FS(t,n):Ug(isNaN(t)?e:t)}var hmt=function t(e){var n=yV(e);function r(i,a){var o=n((i=fu(i)).r,(a=fu(a)).r),s=n(i.g,a.g),c=n(i.b,a.b),l=kc(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 zS(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;omV(t[t.length-1]),GS=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(he),bV=ln(GS),WS=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(he),xV=ln(WS),HS=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(he),_V=ln(HS),YS=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(he),OV=ln(YS),$S=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(he),wV=ln($S),VS=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(he),SV=ln(VS),XS=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(he),MV=ln(XS),US=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(he),EV=ln(US),qS=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(he),AV=ln(qS),KS=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(he),PV=ln(KS),ZS=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(he),TV=ln(ZS),QS=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(he),kV=ln(QS),JS=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(he),CV=ln(JS),tM=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(he),LV=ln(tM),eM=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(he),NV=ln(eM),nM=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(he),RV=ln(nM),rM=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(he),IV=ln(rM),iM=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(he),jV=ln(iM),aM=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(he),DV=ln(aM),oM=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(he),BV=ln(oM),sM=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(he),FV=ln(sM),cM=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(he),zV=ln(cM),lM=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(he),GV=ln(lM),uM=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(he),WV=ln(uM),fM=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(he),HV=ln(fM),dM=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(he),YV=ln(dM),hM=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(he),$V=ln(hM);function VV(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 XV=Math.PI/180,UV=180/Math.PI,pM=-.14861,qg=1.78277,Kg=-.29227,fh=-.90649,du=1.97294,vM=du*fh,gM=du*qg,yM=qg*Kg-fh*pM;function qV(t){if(t instanceof xs)return new xs(t.h,t.s,t.l,t.opacity);t instanceof Sr||(t=LS(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(yM*r+vM*e-gM*n)/(yM+vM-gM),a=r-i,o=(du*(n-i)-Kg*a)/fh,s=Math.sqrt(o*o+a*a)/(du*i*(1-i)),c=s?Math.atan2(o,a)*UV-120:NaN;return new xs(c<0?c+360:c,s,i,t.opacity)}function ca(t,e,n,r){return arguments.length===1?qV(t):new xs(t,e,n,r==null?1:r)}function xs(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}sh(xs,ca,$g(Ac,{brighter:function(e){return e=e==null?Pc:Math.pow(Pc,e),new xs(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=e==null?ys:Math.pow(ys,e),new xs(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=isNaN(this.h)?0:(this.h+120)*XV,n=+this.l,r=isNaN(this.s)?0:this.s*n*(1-n),i=Math.cos(e),a=Math.sin(e);return new Sr(255*(n+r*(pM*i+qg*a)),255*(n+r*(Kg*i+fh*a)),255*(n+r*(du*i)),this.opacity)}}));function mM(t){return function e(n){n=+n;function r(i,a){var o=t((i=ca(i)).h,(a=ca(a)).h),s=kc(i.s,a.s),c=kc(i.l,a.l),l=kc(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 vmt=mM(gV),Zg=mM(kc),KV=Zg(ca(300,.5,0),ca(-240,.5,1)),ZV=Zg(ca(-100,.75,.35),ca(80,1.5,.8)),QV=Zg(ca(260,.75,.35),ca(80,1.5,.8)),dh=ca();function JV(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return dh.h=360*t-100,dh.s=1.5-1.5*e,dh.l=.8-.9*e,dh+""}var hh=fu(),tX=Math.PI/3,eX=Math.PI*2/3;function nX(t){var e;return t=(.5-t)*Math.PI,hh.r=255*(e=Math.sin(t))*e,hh.g=255*(e=Math.sin(t+tX))*e,hh.b=255*(e=Math.sin(t+eX))*e,hh+""}function rX(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 iX=ph(he("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),aX=ph(he("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),oX=ph(he("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),sX=ph(he("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function cX(t,e,n,r,i,a){const{guide:o={}}=n,s=yX(t,e,n);if(typeof s!="string")return n;const c=mX(s,t,e,n),l=pX(s,c,n);return Object.assign(Object.assign(Object.assign({},n),xX(s,t,e,n,r)),{domain:l,range:bX(s,t,e,n,l,i,a),expectedDomain:c,guide:o,name:t,type:s})}function lX(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 uX(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=hX(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=ot({},p,s),Object.assign(u,f)}else{const h=Object.assign(Object.assign({},f),{expectedDomain:f.domain,name:l,guide:Ow(s,i)});a.push(h)}}}return a}function fX(t){if(!t||!Array.isArray(t))return[ss,ss];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 bM(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=Ye(a)+1,s=`${i}${o}`;t[s]=r,r.getOptions().key=s}}return t}function xM(t,e){const[n]=gn("scale",e),{relations:r}=t,[i]=fX(r),a=n(t);return i(a)}function dX(t){const e=t.flatMap(n=>Array.from(n.values())).flatMap(n=>n.channels.map(r=>r.scale));_M(e,"x"),_M(e,"y")}function hX(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 _M(t,e){const n=t.filter(({name:a,facet:o=!0})=>o&&a===e),r=n.flatMap(a=>a.domain),i=n.every(OM)?La(r):n.every(wM)?Array.from(new Set(r)):null;if(i!==null)for(const a of n)a.domain=i}function pX(t,e,n){const{ratio:r}=n;return r==null?e:OM({type:t})?vX(e,r,t):wM({type:t})?gX(e,r):e}function vX(t,e,n){const r=t.map(Number),i=new wr({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 gX(t,e){const n=Math.round(t.length*e);return t.slice(0,n)}function OM(t){const{type:e}=t;return typeof e!="string"?!1:["linear","log","pow","time"].includes(e)}function wM(t){const{type:e}=t;return typeof e!="string"?!1:["band","point","ordinal"].includes(e)}function yX(t,e,n){const{type:r,domain:i,range:a,quantitative:o,ordinal:s}=n;return r!==void 0?r:CX(e)?"identity":typeof a=="string"?"linear":(i||a||[]).length>2?Qg(t,s):i!==void 0?PM([i])?Qg(t,s):TM(e)?"time":MM(t,a,o):PM(e)?Qg(t,s):TM(e)?"time":MM(t,a,o)}function mX(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 EM(AX(n,r),r);case"band":case"ordinal":case"point":return AM(n);case"quantile":return PX(n);case"sequential":return EM(TX(n),r);default:return[]}}function bX(t,e,n,r,i,a,o){const{range:s}=r;if(typeof s=="string")return _X(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=SM(n,r,i,a,o),[f,d]=kX(e,u);return[c||f,l||d]}case"band":case"point":return[c||(e==="size"?5:0),l||(e==="size"?10:1)];case"ordinal":return SM(n,r,i,a,o);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}function xX(t,e,n,r,i){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return SX(i,r);case"band":case"point":return MX(t,e,i,r);case"sequential":return wX(r);default:return r}}function SM(t,e,n,r,i){const[a]=gn("palette",i),{category10:o,category20:s}=r,c=uG(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=OX(l,n,u);if(d)return d;throw new Error(`Unknown Component: ${l} `)}}function _X(t){return t.split("-")}function OX(t,e,n=r=>r){if(!t)return null;const r=lo(t),i=Jt[`scheme${r}`],a=Jt[`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 wX(t){const{palette:e="ylGnBu",offset:n}=t,r=lo(e),i=Jt[`interpolate${r}`];if(!i)throw new Error(`Unknown palette: ${r}`);return{interpolator:n?a=>i(n(a)):i}}function SX(t,e){const{interpolate:n=eu,nice:r=!1,tickCount:i=5}=e;return Object.assign(Object.assign({},e),{interpolate:n,nice:r,tickCount:i})}function MX(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=EX(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 EX(t,e,n){return e==="enterDelay"||e==="enterDuration"||e==="size"?0:t==="band"?AS(n)?0:.1:t==="point"?.5:0}function Qg(t,e){return e||(LX(t)?"point":"ordinal")}function MM(t,e,n){return n||(t!=="color"||e?"linear":"sequential")}function EM(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 AX(t,e){const{zero:n=!1}=e;let r=1/0,i=-1/0;for(const a of t)for(const o of a)rn(o)&&(r=Math.min(r,+o),i=Math.max(i,+o));return r===1/0?[]:n?[Math.min(0,r),i]:[r,i]}function AM(t){return Array.from(new Set(t.flat()))}function PX(t){return AM(t).sort()}function TX(t){let e=1/0,n=-1/0;for(const r of t)for(const i of r)rn(i)&&(e=Math.min(e,+i),n=Math.max(n,+i));return e===1/0?[]:[e<0?-n:e,n]}function kX(t,e){return t==="enterDelay"?[0,1e3]:t=="enterDuration"?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:t==="color"?[lG(e),uO(e)]:t==="opacity"?[0,1]:t==="size"?[1,10]:[0,1]}function PM(t){return Jg(t,e=>{const n=typeof e;return n==="string"||n==="boolean"})}function TM(t){return Jg(t,e=>e instanceof Date)}function CX(t){return Jg(t,Wl)}function Jg(t,e){for(const n of t)if(n.some(e))return!0;return!1}function LX(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")}function NX(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t==="enterDelay"||t==="enterDuration"||t==="updateDelay"||t==="updateDuration"||t==="exitDelay"||t==="exitDuration"}function RX(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 IX={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},jX={threshold:"threshold",quantize:"quantize",quantile:"quantile"},DX={ordinal:"ordinal",band:"band",point:"point"},BX={constant:"constant"};var mo=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=qX(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 YX(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:x=[0,0]}=d,_=ot({},...f),{guide:O,field:w}=_,S=Array.isArray(O)?O:[O];for(const M of S){const[E,A]=XX(u,h,v,M,f,o,r);if(!E&&!A)continue;const N=E==="left"||E==="right",k=N?b[1]:b[0],P=N?x[1]:x[0],{size:T,order:L=y,length:j=m,padding:D=k,crossPadding:B=P}=M;s.push(Object.assign(Object.assign({title:w},M),{defaultSize:g,length:j,position:E,plane:p,orientation:A,padding:D,order:L,crossPadding:B,size:T,type:u,scales:f}))}}),s}function kM(t,e,n,r,i){const[a]=gn("component",r),{scaleInstances:o,scale:s,bbox:c}=t,l=mo(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 zX(t){return t.map(e=>{const n=ot(e,e.style);return delete n.style,n})}function gmt(t){return t.flatMap(e=>e.type=="group"?e.children:e)}function CM(t,e){const n=["left","right","bottom","top"];return kd(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=mi(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=Ye(a,u=>u.size),s=Ye(a,u=>u.order),c=Ye(a,u=>u.crossPadding),l=a[0].position;return{type:"group",size:o,order:s,position:l,children:a,crossPadding:c}})}function GX(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=kd(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=fG(d).sort((v,g)=>g.length-v.length).map(v=>({combination:v,option:v.map(g=>[g.name,WX(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 hG)for(const{option:y,combination:m}of p)if(g.some(b=>hO(u(b),u(y))))return[v,m];return null}).filter(rn)}function WX(t){const{type:e}=t;return typeof e!="string"?null:e in IX?"continuous":e in DX?"discrete":e in jX?"distribution":e in BX?"constant":null}function HX(t,e){return t.map(n=>{const{name:r}=n;if(z$(e)||AS(e)||Ec(e)&&(gs(e)||lu(e)))return null;if(r.startsWith("x"))return gs(e)?["axisArc",[n]]:lu(e)?["axisLinear",[n]]:[Ec(e)?"axisY":"axisX",[n]];if(r.startsWith("y"))return gs(e)?["axisLinear",[n]]:lu(e)?["axisArc",[n]]:[Ec(e)?"axisX":"axisY",[n]];if(r.startsWith("z"))return["axisZ",[n]];if(r.startsWith("position")){if(H$(e))return["axisRadar",[n]];if(!gs(e))return["axisY",[n]]}return null}).filter(rn)}function YX(t,e){const n=t.filter(r=>RX(r));return[...GX(n,e),...HX(n,e)]}function ty(t){const e=Fi(t,"polar");if(e.length){const r=e[e.length-1],{startAngle:i,endAngle:a}=pO(r);return[i,a]}const n=Fi(t,"radial");if(n.length){const r=n[n.length-1],{startAngle:i,endAngle:a}=vO(r);return[i,a]}return[-Math.PI/2,Math.PI/2*3]}function $X(t){const e=/position(\d*)/g.exec(t);return e?+e[1]:null}function VX(t,e,n,r,i){const{name:a}=n[0];if(t==="axisRadar"){const o=r.filter(f=>f.name.startsWith("position")),s=$X(a);if(a===o.slice(-1)[0].name||s===null)return[null,null];const[c,l]=ty(i);return["center",(l-c)/(o.length-1)*s+c]}if(t==="axisY"&&G$(i))return Ec(i)?["center","horizontal"]:["center","vertical"];if(t==="axisLinear"){const[o]=ty(i);return["center",o]}return t==="axisArc"?e[0]==="inner"?["inner",null]:["outer",null]:gs(i)?["center",null]:lu(i)?["center",null]:t==="axisX"&&W$(i)||t==="axisX"&&Y$(i)?["top",null]:e}function XX(t,e,n,r,i,a,o){const[s]=ty(o),c=[r.position||e,s!=null?s:n];return typeof t=="string"&&t.startsWith("axis")?VX(t,c,i,a,o):typeof t=="string"&&t.startsWith("legend")&&gs(o)&&r.position==="center"?["center","vertical"]:c}function UX(t,e,n=[]){return t==="x"?Ec(n)?`${e}Y`:`${e}X`:t==="y"?Ec(n)?`${e}X`:`${e}Y`:null}function qX(t,e,n){const[,r]=gn("component",n),{coordinates:i}=t;function a(o,s,c,l){const u=UX(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 LM(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")?tU:c.startsWith("group")?KX:c.startsWith("legendContinuous")?eU:c==="legendCategory"?nU:c.startsWith("slider")?JX:c==="title"?QX:c.startsWith("scrollbar")?ZX:()=>{})()(t,e,n,r,i,a)}function KX(t,e,n,r,i,a){const{children:o}=t,s=Ye(o,l=>l.crossPadding);o.forEach(l=>l.crossPadding=s),o.forEach(l=>LM(l,e,n,r,i,a));const c=Ye(o,l=>l.size);t.size=c,o.forEach(l=>l.size=c)}function ZX(t,e,n,r,i,a){const{trackSize:o=6}=ot({},i.scrollbar,t);t.size=o}function QX(t,e,n,r,i,a){const o=ot({},i.title,t),{title:s,subtitle:c,spacing:l=0}=o,u=mo(o,["title","subtitle","spacing"]);if(s){const f=Pt(u,"title"),d=mh(s,f);t.size=d.height}if(c){const f=Pt(u,"subtitle"),d=mh(c,f);t.size+=l+d.height}}function JX(t,e,n,r,i,a){const o=()=>{const{slider:u}=i;return ot({},u,t)},{trackSize:s,handleIconSize:c}=o(),l=Math.max(s,c*2.4);t.size=l}function tU(t,e,n,r,i,a){t.transform=t.transform||[{type:"hide"}];const o=r==="left"||r==="right",s=NM(t,r,i),{tickLength:c=0,labelSpacing:l=0,titleSpacing:u=0,labelAutoRotate:f}=s,d=mo(s,["tickLength","labelSpacing","titleSpacing","labelAutoRotate"]),h=vh(t,a),p=gh(d,h),v=c+l;if(p&&p.length){const y=Ye(p,b=>b.width),m=Ye(p,b=>b.height);if(o)t.size=y+v;else{const{tickFilter:b,labelTransform:x}=t;aU(h,p,e,n,b)&&!x&&f!==!1&&f!==null?(t.labelTransform="rotate(90)",t.size=y+v):t.size=m+v}}else t.size=c;const g=yh(d);g&&(o?t.size+=u+g.width:t.size+=u+g.height)}function eU(t,e,n,r,i,a){const s=(()=>{const{legendContinuous:x}=i;return ot({},x,t)})(),{labelSpacing:c=0,titleSpacing:l=0}=s,u=mo(s,["labelSpacing","titleSpacing"]),f=r==="left"||r==="right",d=Pt(u,"ribbon"),{size:h}=d,p=Pt(u,"handleIcon"),{size:v}=p,g=Math.max(h,v*2.4);t.size=g;const y=vh(t,a),m=gh(u,y);if(m){const x=f?"width":"height",_=Ye(m,O=>O[x]);t.size+=_+c}const b=yh(u);b&&(f?t.size=Math.max(t.size,b.width):t.size+=l+b.height)}function nU(t,e,n,r,i,a){const s=(()=>{const{legendCategory:P}=i,{title:T}=t,[L,j]=Array.isArray(T)?[T,void 0]:[void 0,T];return ot({title:L},P,Object.assign(Object.assign({},t),{title:j}))})(),{itemSpacing:c,itemMarkerSize:l,titleSpacing:u,rowPadding:f,colPadding:d,maxCols:h=1/0,maxRows:p=1/0}=s,v=mo(s,["itemSpacing","itemMarkerSize","titleSpacing","rowPadding","colPadding","maxCols","maxRows"]),{cols:g,length:y}=t,m=P=>Math.min(P,p),b=P=>Math.min(P,h),x=r==="left"||r==="right",_=y===void 0?e+(x?0:n[0]+n[1]):y,O=yh(v),w=vh(t,a),S=gh(v,w,"itemLabel"),M=Math.max(S[0].height,l)+f,E=(P,T=0)=>l+P+c[0]+T;x?(()=>{let P=-1/0,T=0,L=1,j=0,D=-1/0,B=-1/0;const z=O?O.height:0,W=_-z;for(const{width:$}of S){const X=E($,d);P=Math.max(P,X),T+M>W?(L++,D=Math.max(D,j),B=Math.max(B,T),j=1,T=M):(T+=M,j++)}L<=1&&(D=j,B=T),t.size=P*b(L),t.length=B+z,ot(t,{cols:b(L),gridRow:D})})():typeof g=="number"?(()=>{const P=Math.ceil(S.length/g),T=Ye(S,L=>E(L.width))*g;t.size=M*m(P)-f,t.length=Math.min(T,_)})():(()=>{let P=1,T=0,L=-1/0;for(const{width:j}of S){const D=E(j,d);T+D>_?(L=Math.max(L,T),T=D,P++):T+=D}P===1&&(L=T),t.size=M*m(P)-f,t.length=L})(),O&&(x?t.size=Math.max(t.size,O.width):t.size+=u+O.height)}function vh(t,e){const[n]=gn("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 gh(t,e,n="label"){const{labelFormatter:r,tickFilter:i,label:a=!0}=t,o=mo(t,["labelFormatter","tickFilter","label"]);if(!a)return null;const s=rU(e,r,i),c=Pt(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 mh(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 yh(t){const e=l=>l===!1||l===null,{title:n}=t,r=mo(t,["title"]);if(e(n)||n===void 0)return null;const i=Pt(r,"title"),{direction:a,transform:o}=i,s=Array.isArray(n)?n.join(","):n;return typeof s!="string"?null:mh(s,Object.assign(Object.assign({},i),{transform:o||(a==="vertical"?"rotate(-90)":"")}))}function NM(t,e,n){const{title:r}=t,[i,a]=Array.isArray(r)?[r,void 0]:[void 0,r],{axis:o,[`axis${tg(e)}`]:s}=n;return ot({title:i},o,s,Object.assign(Object.assign({},t),{title:a}))}function RM(t,e){const n=t.getTicks?t.getTicks():t.getOptions().domain;return e?n.filter(e):n}function rU(t,e,n){const i=RM(t,n).map(o=>typeof o=="number"?Rd(o):o),a=e?typeof e=="string"?uo(e):e:t.getFormatter?t.getFormatter():o=>`${o}`;return i.map(a)}function iU(t,e){return t.getBandWidth?t.getBandWidth(e)/2:0}function aU(t,e,n,r,i){if(mi(e,h=>h.width)>n)return!0;const o=t.clone();o.update({range:[0,n]});const s=RM(t,i),c=s.map(h=>o.map(h)+iU(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 mh(t,e){const n=oU(t),{filter:r}=e,i=mo(e,["filter"]);return n.attr(Object.assign(Object.assign({},i),{visibility:"none"})),n.getBBox()}function oU(t){return t instanceof Or?t:new na({style:{text:`${t}`}})}function ai(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 Nn(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function sU(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 cU(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:x=y,marginRight:_=y,padding:O=n.padding,paddingBottom:w=O,paddingLeft:S=O,paddingRight:M=O,paddingTop:E=O}=uU(t,e,n,r),A=1/4,N=(kt,Ht,se,re,ue)=>{const{marks:Te}=e;if(Te.length===0)return[re,ue];if(kt-re-ue-kt*A>0)return[re,ue];const Gn=kt*(1-A);return[Ht==="auto"?Gn*re/(re+ue):re,se==="auto"?Gn*ue/(re+ue):ue]},k=kt=>kt==="auto"?20:kt!=null?kt:20,P=k(E),T=k(w),L=IM(t,s-P-T,[P+x,T+b],["left","right"],e,n,r),{paddingLeft:j,paddingRight:D}=L,B=o-m-_,[z,W]=N(B,S,M,j,D),$=B-z-W,X=IM(t,$,[z+m,W+_],["bottom","top"],e,n,r),{paddingTop:et,paddingBottom:ut}=X,gt=s-b-x,[it,at]=N(gt,w,E,ut,et),Tt=gt-it-at;return{width:o,height:s,depth:c,insetLeft:h,insetTop:p,insetBottom:v,insetRight:g,innerWidth:$,innerHeight:Tt,paddingLeft:z,paddingRight:W,paddingTop:at,paddingBottom:it,marginLeft:m,marginBottom:b,marginTop:x,marginRight:_,x:l,y:u,z:f}}function lU(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=_=>_==="auto"?20:_,b=n-m(i)-m(a)-l-u-p-v,x=e-m(o)-m(s)-f-d-g-y;return{width:b,height:x}}function uU(t,e,n,r){const{coordinates:i}=e;if(!gs(i)&&!lu(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 NM(y,m,n)}),s=Ye(o,y=>{var m;return(m=y.labelSpacing)!==null&&m!==void 0?m:0}),c=a.flatMap((y,m)=>{const b=o[m],x=vh(y,r);return gh(b,x)}).filter(rn),l=Ye(c,y=>y.height)+s,u=a.flatMap((y,m)=>{const b=o[m];return yh(b)}).filter(y=>y!==null),f=u.length===0?0:Ye(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 IM(t,e,n,r,i,a,o){const s=xn(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${tg(oS(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=Ye(M.children,E=>E.size)):M.size=M.defaultSize},x=M=>{M.size||(y!=="auto"?b(M):(LM(M,e,n,p,a,o),m(M)))},_=M=>{M.type.startsWith("axis")&&M.labelAutoHide===void 0&&(M.labelAutoHide=!0)},O=p==="bottom"||p==="top",w=ai(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(_);else if(g.length===0)h[v]=0;else{const M=O?e+n[0]+n[1]:e,E=CM(g,M);E.forEach(x);const A=E.reduce((N,{size:k,crossPadding:P=12})=>N+k+P,0);h[v]=A}}return h}function fU(t,e,n){const r=xn(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:x}=n,_={xy:ey({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:ey({width:x,height:m,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:x,innerHeight:m,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0}),xz:ey({width:b,height:x,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:b,innerHeight:x,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0})};for(const[O,w]of r.entries()){const[S,M]=O.split("-"),E=_[S][M],[A,N]=fO(w,k=>typeof k.type!="string"?!1:!!(M==="center"||k.type.startsWith("axis")&&["inner","outer"].includes(M)));A.length&&dU(A,e,E,M),N.length&&_U(w,e,E)}}function ey({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,x=t-o-l,_=[g+h,y+v,f-h-p,u-v-d,"center",null,null];return{top:[g,0,f,y,"vertical",!0,Nn,o,x],right:[t-m,y,m,u,"horizontal",!1,Nn],bottom:[g,e-b,f,b,"vertical",!1,Nn,o,x],left:[0,y,g,u,"horizontal",!0,Nn],"top-left":[g,0,f,y,"vertical",!0,Nn],"top-right":[g,0,f,y,"vertical",!0,Nn],"bottom-left":[g,e-b,f,b,"vertical",!1,Nn],"bottom-right":[g,e-b,f,b,"vertical",!1,Nn],center:_,inner:_,outer:_}}function dU(t,e,n,r){const[i,a]=fO(t,o=>!!(typeof o.type=="string"&&o.type.startsWith("axis")));hU(i,e,n,r),OU(a,e,n)}function hU(t,e,n,r){r==="center"?pG(e)?xU(t,e,n,r):cn(e)?gU(t,e,n):Vl(e)&&yU(t,e,n,t[0].orientation):r==="inner"?pU(t,e,n):r==="outer"&&vU(t,e,n)}function pU(t,e,n){const[r,i,,a]=n,[o,s]=e.getCenter(),[c]=Id(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 x=M=>M==="title"||M==="group"||M.startsWith("legend"),_=(M,E,A)=>A===void 0?E:x(M)?A:E,O=(M,E,A)=>A===void 0?E:x(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,N=E[m],k=N/A.length,P=A.reduce((B,z)=>{var W;const $=(W=z.layout)===null||W===void 0?void 0:W.justifyContent;return $||B},"flex-start"),T=A.map((B,z)=>{const{length:W=k,padding:$=0}=B;return W+(z===A.length-1?0:$)}),L=mi(T),j=N-L,D=P==="flex-start"?0:P==="center"?j/2:j;for(let B=0,z=E[p]+D;BRU(o)?o:{type:IU(i,o),value:o});return[t,Object.assign(Object.assign({},e),{encode:a})]}function AU(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i=fo(r,(a,o)=>{const{type:s}=a;return s!=="constant"||NX(o)?a:Object.assign(Object.assign({},a),{constant:!0})});return[t,Object.assign(Object.assign({},e),{encode:i})]}function PU(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const{library:a}=n,o=zU(a),s=fo(r,c=>o(i,c));return[t,Object.assign(Object.assign({},e),{encode:s})]}function TU(t,e,n){const{tooltip:r={}}=e;return Pa(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:Wl(r)&&jM(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function kU(t,e,n){const{data:r,encode:i,tooltip:a={}}=e;if(Pa(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(Wl(f)){const{field:d,channel:h,color:p,name:v=d,valueFormatter:g=O=>O}=f,y=typeof g=="string"?uo(g):g,m=h&&i[h],b=m&&i[h].field,x=v||b||h,_=[];for(const O of t){const w=d?r[O][d]:m?i[h].value[O]:null;_[O]={name:x,color:p,value:y(w)}}return _}if(typeof f=="function"){const d=[];for(const h of t){const p=f(r[h],h,r,i);Wl(p)?d[h]=p:d[h]={value:p}}return d}return f},{title:s,items:c=[]}=a,l=Cc(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 CU(t,e,n){const{encode:r}=e,i=Cc(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=Cc(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 LU(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 ot(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 NU(t,e,n){const{animate:r}=e;return r||r===void 0?[t,e]:(ot(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e])}function RU(t){if(typeof t!="object"||t instanceof Date||t===null)return!1;const{type:e}=t;return rn(e)}function IU(t,e){return typeof e=="function"?"transform":typeof e=="string"&&jU(t,e)?"field":"constant"}function jU(t,e){return Array.isArray(t)?t.some(n=>n[e]!==void 0):!1}function DU(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=Cc(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}var BM=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())})},BU=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);irn(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(([_])=>_.startsWith(p)).map(([_,O],w)=>{const S=O.some(j=>j.visual),M=O.some(j=>j.constant),E=s[_]||{},{independent:A=!1,key:N=g||_,type:k=M?"constant":S?"identity":v}=E,P=BU(E,["independent","key","type"]),T=k==="constant",L=T?void 0:y;return{name:_,values:O,scaleKey:A||T?Symbol("independent"):N,scale:Object.assign(Object.assign({type:k,range:L},P),{quantitative:m,ordinal:b})}})});return[a,Object.assign(Object.assign({},e),{index:i,channels:d,tooltip:l})]})}function zU(t){const[e]=gn("encode",t);return(n,r)=>r===void 0||n===void 0?null:Object.assign(Object.assign({},r),{type:"column",value:e(r)(n),field:WU(r)})}function GU(t,e,n){return BM(this,void 0,void 0,function*(){const{library:r}=n,[i]=gn("transform",r),{preInference:a=[],postInference:o=[]}=e,{transform:s=[]}=t,c=[SU,DM,MU,EU,AU,PU,CU,NU,LU,TU,...a.map(i),...s.map(i),...o.map(i),kU];let l=[],u=t;for(const f of c)[l,u]=yield f(l,u,n);return[l,u]})}function WU(t){const{type:e,value:n}=t;return e==="field"&&typeof n=="string"?n:null}var Ra=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())})},bo=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(rn)),l=new Set(Object.keys(n).map(P=>{var T;return(T=/component\.(.*)/.exec(P))===null||T===void 0?void 0:T[1]}).filter(rn)),u=P=>{const{type:T}=P;if(typeof T=="function"){const{props:L={}}=T,{composite:j=!0}=L;if(j)return"mark"}return typeof T!="string"?T:c.has(T)||l.has(T)?"mark":T},f=P=>u(P)==="mark",d=P=>u(P)==="standardView",h=P=>{const{type:T}=P;return typeof T!="string"?!1:!!l.has(T)},p=P=>{if(d(P))return[P];const T=u(P);return o({type:T,static:h(P)})(P)},v=[],g=new Map,y=new Map,m=[t],b=[];for(;m.length;){const P=m.shift();if(d(P)){const T=y.get(P),[L,j]=T?WM(T,P,n):yield zM(P,n);g.set(L,P),v.push(L);const D=j.flatMap(p).map(B=>ES(B,n));if(m.push(...D),D.every(d)){const B=yield Promise.all(D.map(z=>GM(z,n)));dX(B);for(let z=0;zP.key).join(P=>P.append("g").attr("className",Vv).attr("id",T=>T.key).call(FM).each(function(T,L,j){ay(T,te(j),O,n,r),x.set(T,j)}),P=>P.call(FM).each(function(T,L,j){ay(T,te(j),O,n,r),_.set(T,j)}),P=>P.each(function(T,L,j){const D=j.nameInteraction.values();for(const B of D)B.destroy()}).remove());const w=P=>Array.from(P.entries()).map(([T,L])=>{const j=new Map,D=(W,$=X=>X)=>j.set(W,$),B=g.get(T),z=YU(te(L),B,n,r);return{view:T,container:L,options:B,setState:D,update:W=>Ra(this,void 0,void 0,function*(){const X=Jv(Array.from(j.values()))(B);return yield z(X,W)})}}),S=w(x);for(const P of S){const{options:T}=P,L=new Map;P.container.nameInteraction=L;for(const j of bh(T)){const[D,B]=j;if(B){const W=iy(P.view,D,B,s)(P,S,r.emitter);L.set(D,{destroy:W})}}}const M=w(_);for(const P of M){const{options:T,container:L}=P,j=L.nameInteraction;for(const D of bh(T)){const[B,z]=D,W=j.get(B);if(W&&((i=W.destroy)===null||i===void 0||i.call(W)),z){const X=iy(P.view,B,z,s)(P,M,r.emitter);j.set(B,{destroy:X})}}}const{width:E,height:A}=t,N=[];for(const P of b){const T=new Promise(L=>Ra(this,void 0,void 0,function*(){for(const j of P){const D=Object.assign({width:E,height:A},j);yield ry(D,e,n,r)}L()}));N.push(T)}r.views=v,(a=r.animations)===null||a===void 0||a.forEach(P=>P==null?void 0:P.cancel()),r.animations=O,r.emitter.emit(He.AFTER_PAINT);const k=O.filter(rn).map(aq).map(P=>P.finished);return Promise.all([...k,...N])})}function FM(t){t.style("transform",e=>`translate(${e.layout.x}, ${e.layout.y})`)}function HU(t){const[,e]=gn("interaction",t);return n=>{const[r,i]=n;try{return[r,e(r)]}catch(a){return[r,i.type]}}}function YU(t,e,n,r){const i=HU(n),a=c=>c[1]&&c[1].props&&c[1].props.reapplyWhenUpdate,s=bh(e).map(i).filter(a).map(c=>c[0]);return(c,l)=>Ra(this,void 0,void 0,function*(){const u=[],[f,d]=yield zM(c,n);ay(f,t,u,n,r);for(const h of s.filter(p=>p!==l))$U(h,t,c,f,n,r);for(const h of d)ry(h,t,n,r);return{options:c,view:f}})}function $U(t,e,n,r,i,a){var o;const[s]=gn("interaction",i),l=e.node().nameInteraction,u=bh(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=iy(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 Ra(this,void 0,void 0,function*(){const n=yield XU(t,e),r=VU(n);t.interaction=r.interaction,t.coordinate=r.coordinate,t.marks=[...r.marks,...r.components];const i=ES(r,e),a=yield GM(i,e);return WM(a,i,e)})}function VU(t){const{coordinate:e={},interaction:n={},style:r={},marks:i}=t,a=bo(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)=>ot(d,h),{}),u=[n,...s].reduce((d,h)=>ot(d,h),{}),f=[...c,r].reduce((d,h)=>ot(d,h),{});return Object.assign(Object.assign({},a),{marks:i,coordinate:l,interaction:u,style:f})}function XU(t,e){return Ra(this,void 0,void 0,function*(){const[n,r]=gn("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(rn)),{marks:a}=t,o=[],s=[],c=[...a],{width:l,height:u}=lU(t),f={options:t,width:l,height:u};for(;c.length;){const[d]=c.splice(0,1),h=yield VM(d,e),{type:p=dc("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)}),x=yield n(b,f),_=Array.isArray(x)?x:[x];c.unshift(..._.map((O,w)=>Object.assign(Object.assign({},O),{key:`${v}-${w}`})))}}}return Object.assign(Object.assign({},t),{marks:o,components:s})})}function GM(t,e){return Ra(this,void 0,void 0,function*(){const[n]=gn("theme",e),[,r]=gn("mark",e),{theme:i,marks:a,coordinates:o=[]}=t,s=n($M(i)),c=new Map;for(const u of a){const{type:f}=u,{props:d={}}=r(f),h=yield FU(u,d,e);if(h){const[p,v]=h;c.set(p,v)}}const l=xn(Array.from(c.values()).flatMap(u=>u.channels),({scaleKey:u})=>u);for(const u of l.values()){const f=u.reduce((b,{scale:x})=>ot(b,x),{}),{scaleKey:d}=u[0],{values:h}=u[0],p=Array.from(new Set(h.map(b=>b.field).filter(rn))),v=ot({guide:{title:p.length===0?void 0:p},field:p[0]},f),{name:g}=u[0],y=u.flatMap(({values:b})=>b.map(x=>x.value)),m=Object.assign(Object.assign({},cX(g,y,v,o,s,e)),{key:d});u.forEach(b=>b.scale=m)}return c})}function iy(t,e,n,r){const i=t.theme,a=typeof e=="string"?i[e]||{}:{};return r(ot(a,Object.assign({type:e},n)))}function WM(t,e,n){const[r]=gn("mark",n),[i]=gn("theme",n),[a]=gn("labelTransform",n),{key:o,frame:s=!1,theme:c,clip:l,style:u={},labelTransform:f=[]}=e,d=i($M(c)),h=Array.from(t.values()),p=uX(h,e),v=zX(FX(lq(Array.from(p),h,t),e,n)),g=cU(v,e,d,n),y=F$(g,e,n),m=s?ot({mainLineWidth:1,mainStroke:"#000"},u):u;fU(CM(v),y,g),sU(v);const b={};for(const O of v){const{scales:w=[]}=O,S=[];for(const M of w){const{name:E}=M,A=xM(M,n);S.push(A),bM(b,{[E]:A})}O.scaleInstances=S}const x=[];for(const[O,w]of t.entries()){const{children:S,dataDomain:M,modifier:E,key:A}=O,{index:N,channels:k,tooltip:P}=w,T=Object.fromEntries(k.map(({name:at,scale:Tt})=>[at,Tt])),L=fo(T,at=>xM(at,n));bM(b,L);const j=lX(k,L),D=r(O),[B,z,W]=KU(D(N,L,j,y)),$=M||B.length,X=E?E(z,$,g):[],et=at=>{var Tt,kt;return(kt=(Tt=P.title)===null||Tt===void 0?void 0:Tt[at])===null||kt===void 0?void 0:kt.value},ut=at=>P.items.map(Tt=>Tt[at]),gt=B.map((at,Tt)=>{const kt=Object.assign({points:z[Tt],transform:X[Tt],index:at,markKey:A,viewKey:o},P&&{title:et(at),items:ut(at)});for(const[Ht,se]of Object.entries(j))kt[Ht]=se[at],W&&(kt[`series${lo(Ht)}`]=W[Tt].map(re=>se[re]));return W&&(kt.seriesIndex=W[Tt]),W&&P&&(kt.seriesItems=W[Tt].map(Ht=>ut(Ht)),kt.seriesTitle=W[Tt].map(Ht=>et(Ht))),kt});w.data=gt,w.index=B;const it=S==null?void 0:S(gt,L,g);x.push(...it||[])}return[{layout:g,theme:d,coordinate:y,markState:t,key:o,clip:l,scale:b,style:m,components:v,labelTransform:Jv(f.map(a))},x]}function ay(t,e,n,r,i){return Ra(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=bo(s,["x","y","width","height"]),b=["view","plot","main","content"],x=b.map((D,B)=>B),_=["a","margin","padding","inset"],O=b.map(D=>eO(Object.assign({},o.view,f),D)),w=_.map(D=>Pt(m,D)),S=D=>D.style("x",B=>k[B].x).style("y",B=>k[B].y).style("width",B=>k[B].width).style("height",B=>k[B].height).each(function(B,z,W){uq(te(W),O[B])});let M=0,E=0,A=g,N=y;const k=x.map(D=>{const B=w[D],{left:z=0,top:W=0,bottom:$=0,right:X=0}=B;return M+=z,E+=W,A-=z+X,N-=W+$,{x:M,y:E,width:A,height:N}});e.selectAll(fa(B2)).data(x.filter(D=>rn(O[D])),D=>b[D]).join(D=>D.append("rect").attr("className",B2).style("zIndex",-2).call(S),D=>D.call(S),D=>D.remove());const P=tq(c),T=P?{duration:P[1]}:!1;for(const[,D]of kd(a,B=>`${B.type}-${B.position}`))D.forEach((B,z)=>B.index=z);const L=e.selectAll(fa(D2)).data(a,D=>`${D.type}-${D.position}-${D.index}`).join(D=>D.append("g").style("zIndex",({zIndex:B})=>B||-1).attr("className",D2).append(B=>kM(ot({animate:T,scale:h},B),l,o,r,c)),D=>D.transition(function(B,z,W){const{preserve:$=!1}=B;if($)return;const X=kM(ot({animate:T,scale:h},B),l,o,r,c),{attributes:et}=X,[ut]=W.childNodes;return ut.update(et,!1)})).transitions();n.push(...L.flat().filter(rn));const j=e.selectAll(fa(Ed)).data([s],()=>u).join(D=>D.append("rect").style("zIndex",0).style("fill","transparent").attr("className",Ed).call(XM).call(qM,Array.from(c.keys())).call(KM,d),D=>D.call(qM,Array.from(c.keys())).call(B=>P?cq(B,P):XM(B)).call(KM,d)).transitions();n.push(...j.flat());for(const[D,B]of c.entries()){const{data:z}=B,{key:W,class:$,type:X}=D,et=e.select(`#${W}`),ut=rq(D,B,t,r,i),gt=iq(D,B,t,r),it=oq(D,B,t,r),at=sq(D,B,t,r),Tt=eq(e,et,$,"element"),kt=et.selectAll(fa(Aa)).selectFacetAll(Tt).data(z,Ht=>Ht.key,Ht=>Ht.groupKey).join(Ht=>Ht.append(ut).attr("className",Aa).attr("markType",X).transition(function(se,re,ue){return gt(se,[ue])}),Ht=>Ht.call(se=>{const re=se.parent(),ue=qz(Te=>{const[Fe,yn]=Te.getBounds().min;return[Fe,yn]});se.transition(function(Te,Fe,yn){nq(yn,re,ue);const Gn=ut(Te,Fe),Zr=it(Te,[yn],[Gn]);return Zr!==null||(yn.nodeName===Gn.nodeName&&Gn.nodeName!=="g"?eg(yn,Gn):(yn.parentNode.replaceChild(Gn,yn),Gn.className=Aa,Gn.markType=X,Gn.__data__=yn.__data__)),Zr}).attr("markType",X).attr("className",Aa)}),Ht=>Ht.each(function(se,re,ue){ue.__removed__=!0}).transition(function(se,re,ue){return at(se,[ue])}).remove(),Ht=>Ht.append(ut).attr("className",Aa).attr("markType",X).transition(function(se,re,ue){const{__fromElements__:Te}=ue,Fe=it(se,Te,[ue]);return new Vn(Te,null,ue.parentNode).transition(Fe).remove(),Fe}),Ht=>Ht.transition(function(se,re,ue){const Fe=new Vn([],ue.__toData__,ue.parentNode).append(ut).attr("className",Aa).attr("markType",X).nodes();return it(se,[ue],Fe)}).remove()).transitions();n.push(...kt.flat())}UU(t,e,n,r,i)})}function UU(t,e,n,r,i){const[a]=gn("labelTransform",r),{markState:o,labelTransform:s}=t,c=e.select(fa($v)).node(),l=new Map,u=new Map,f=Array.from(o.entries()).flatMap(([v,g])=>{const{labels:y=[],key:m}=v,b=JU(v,g,t,r,i),x=e.select(`#${m}`).selectAll(fa(Aa)).nodes().filter(_=>!_.__removed__);return y.flatMap((_,O)=>{const{transform:w=[]}=_,S=bo(_,["transform"]);return x.flatMap(M=>{const E=qU(S,O,M);return E.forEach(A=>{l.set(A,b),u.set(A,_)}),E})})}),d=te(c).selectAll(fa(Xv)).data(f,v=>v.key).join(v=>v.append(g=>l.get(g)(g)).attr("className",Xv),v=>v.each(function(g,y,m){const x=l.get(g)(g);eg(m,x)}),v=>v.remove()).nodes(),h=xn(d,v=>u.get(v.__data__)),{coordinate:p}=t;for(const[v,g]of h){const{transform:y=[]}=v;Jv(y.map(a))(g,p)}s&&s(d,p)}function qU(t,e,n){const{seriesIndex:r,seriesKey:i,points:a,key:o,index:s}=n.__data__,c=QU(n);if(!r)return[Object.assign(Object.assign({},t),{key:`${o}-${e}`,bounds:c,index:s,points:a,dependentElement:n})];const l=ZU(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 KU([t,e,n]){if(n)return[t,e,n];const r=[],i=[];for(let a=0;arn(c)&&rn(l))&&(r.push(o),i.push(s))}return[r,i]}function ZU(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 QU(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 JU(t,e,n,r,i){const[a]=gn("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:SS(i),theme:u,coordinate:f});return h=>{const{index:p,points:v}=h,g=o[p],{formatter:y=T=>`${T}`,transform:m,style:b,render:x}=h,_=bo(h,["formatter","transform","style","render"]),O=fo(Object.assign(Object.assign({},_),b),T=>HM(T,g,p,o)),{shape:w=c,text:S}=O,M=bo(O,["shape","text"]),E=typeof y=="string"?uo(y):y,A=Object.assign(Object.assign({},M),{text:E(S,g,p,o),datum:g}),N=Object.assign({type:`label.${w}`,render:x},M),k=a(N,d),P=YM(u,"label",w,"label");return k(v,A,P,l)}}function HM(t,e,n,r){return typeof t=="function"?t(e,n,r):typeof t!="string"?t:e[t]!==void 0?e[t]:t}function tq(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:x=u,updateDuration:_=f,updateDelay:O=d,enterType:w=h,enterDuration:S=p,enterDelay:M=v,exitDuration:E=y,exitDelay:A=m,exitType:N=g}=b;(x===void 0||x)&&(e=Math.max(e,_+O),n=Math.min(n,O)),(N===void 0||N)&&(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 eq(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 nq(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})`;Kz(t,l),e.append(t)}function rq(t,e,n,r,i){const[a]=gn("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:SS(i),coordinate:d,theme:f});return g=>{const{shape:y=s}=p,{shape:m=y,points:b,seriesIndex:x,index:_}=g,O=bo(g,["shape","points","seriesIndex","index"]),w=Object.assign(Object.assign({},O),{index:_}),S=x?x.map(k=>o[k]):o[_],M=x||_,E=fo(p,k=>HM(k,S,M,o)),A=l[m]?l[m](E,v):a(Object.assign(Object.assign({},E),{type:UM(t,m)}),v),N=YM(f,h,m,s);return A(b,w,N,u)}}function YM(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 oy(t,e,n,r,i){var a,o;const[,s]=gn("shape",i),[c]=gn("animation",i),{defaultShape:l,shape:u}=n,{theme:f,coordinate:d}=r,p=`default${lo(t)}Animation`,{[p]:v}=((a=u[l])===null||a===void 0?void 0:a.props)||s(UM(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 k=c(E,m)(x,_,ot(g,{delay:w,duration:S,easing:M}));return Array.isArray(k)?k:[k]}}function iq(t,e,n,r){return oy("enter",t,e,n,r)}function aq(t){return t.finished.then(()=>{t.cancel()}),t}function oq(t,e,n,r){return oy("update",t,e,n,r)}function sq(t,e,n,r){return oy("exit",t,e,n,r)}function $M(t={}){if(typeof t=="string")return{type:t};const{type:e="light"}=t,n=bo(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}function bh(t){const e={event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},{interaction:n={}}=t;return Object.entries(ot(e,n)).reverse()}function VM(t,e){return Ra(this,void 0,void 0,function*(){const n={library:e},{data:r}=t,i=bo(t,["data"]);if(r==null)return t;const[,{data:a}]=yield DM([],{data:r},n);return Object.assign({data:a},i)})}function XM(t){t.style("x",e=>e.paddingLeft+e.marginLeft).style("y",e=>e.paddingTop+e.marginTop).style("width",e=>e.innerWidth).style("height",e=>e.innerHeight)}function cq(t,e){const[n,r]=e;t.transition(function(i,a,o){const{x:s,y:c,width:l,height:u}=o.style,{paddingLeft:f,paddingTop:d,innerWidth:h,innerHeight:p,marginLeft:v,marginTop:g}=i,y=[{x:s,y:c,width:l,height:u},{x:f+v,y:d+g,width:h,height:p}];return o.animate(y,{delay:n,duration:r,fill:"both"})})}function UM(t,e){const{type:n}=t;return typeof e=="string"?`${n}.${e}`:e}function qM(t,e){const n=a=>a.class!==void 0?`${a.class}`:"";t.nodes().length===0||(t.selectAll(fa(j2)).data(e,a=>a.key).join(a=>a.append("g").attr("className",j2).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(fa($v)).node())||t.append("g").attr("className",$v).style("zIndex",0)}function fa(...t){return t.map(e=>`.${e}`).join("")}function KM(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 as({style:{x:i+a,y:r+o,width:s,height:c}})})}function lq(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 uq(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}function ZM(t){const e=ot({},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=ZM(t),{canvas:c=fq(i,a),emitter:l=new I0,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(He.BEFORE_RENDER);const h=te(c.document.documentElement);return c.ready.then(()=>ry(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(He.AFTER_RENDER),n==null||n()})}).catch(p=>{r==null||r(p)}),pq(c.getConfig().container)}function ymt(t,e={},n=()=>{},r=i=>{throw i}){var i;const{width:a=640,height:o=480}=t,s=ZM(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 QM(t,e={},n=!1){const{canvas:r,emitter:i}=e;r&&(hq(r),n?r.destroy():r.destroyChildren()),i.off()}function hq(t){const e=t.getRoot().querySelectorAll(`.${Vv}`);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 pq(t){return typeof t=="string"?document.getElementById(t):t}const Lc=t=>t?parseInt(t):0;function vq(t){const e=getComputedStyle(t),n=t.clientWidth||Lc(e.width),r=t.clientHeight||Lc(e.height),i=Lc(e.paddingLeft)+Lc(e.paddingRight),a=Lc(e.paddingTop)+Lc(e.paddingBottom);return{width:n-i,height:r-a}}function mmt(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=_=>_==="auto"?20:_,b=n-m(i)-m(a)-l-u-p-v,x=e-m(o)-m(s)-f-d-g-y;return{width:b,height:x}}function sy(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 cy{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 sy(this,i=>{e===i.attr("key")&&(n=i)}),n}getNodesByType(e){const n=[];return sy(this,i=>{e===i.type&&n.push(i)}),n}getNodeByType(e){let n=null;return sy(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 JM=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]}const Pq={visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1};function Tq(t,e){var n;return(n=t.style[e])!==null&&n!==void 0?n:Pq[e]}function uy(t,e,n,r){t.style[e]=n,r&&t.children.forEach(i=>uy(i,e,n,r))}function fy(t){uy(t,"visibility","hidden",!0)}function dy(t){uy(t,"visibility","visible",!0)}function kq(t,e,{key:n=e}){t.prototype[e]=function(r){return arguments.length===0?this.attr(n):this.attr(n,r)}}function Cq(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 Lq(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 Nq(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(Wl(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 Rq(t,e,{ctor:n}){t.prototype[e]=function(r){const i=this.append(n);return e==="mark"&&(i.type=r),i}}function Iq(t,e,{ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}function xh(t){return e=>{for(const[n,r]of Object.entries(t)){const{type:i}=r;i==="value"?kq(e,n,r):i==="array"?Cq(e,n,r):i==="object"?Lq(e,n,r):i==="node"?Rq(e,n,r):i==="container"?Iq(e,n,r):i==="mix"&&Nq(e,n,r)}return e}}function oE(t){return Object.fromEntries(Object.entries(t).map(([e,n])=>[e,{type:"node",ctor:n}]))}const sE={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"}},jq=Object.assign(Object.assign({},sE),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),Dq=Object.assign(Object.assign({},sE),{labelTransform:{type:"array"}});var Bq=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 _h=class extends cy{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()&&dy(e)}hide(){const e=this.getGroup();e&&e.isVisible()&&fy(e)}};_h=Bq([xh(Dq)],_h);var Fq=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 hy=class extends cy{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}};hy=Fq([xh(jq)],hy);var zq=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},Gq=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 Y2,this._plugins=a||[],this._container=gq(n),this._emitter=new I0,this._context={library:Object.assign(Object.assign({},o),F2),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)=>dq(this._computedOptions(),this._context,this._createResolve(a),this._createReject(o))),[n,r,i]=Aq();return e.then(r).catch(i).then(()=>this._renderTrailing()),n}options(e){if(arguments.length===0)return bq(this);const{type:n}=e;return n&&(this._previousDefinedType=n),Eq(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(He.BEFORE_CLEAR),this._reset(),QM(e,this._context,!1),this.emit(He.AFTER_CLEAR)}destroy(){const e=this.options();this.emit(He.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),QM(e,this._context,!0),this._container[eE]&&yq(this._container),this.emit(He.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;const{width:e,height:n}=ly(this.options(),this._container);if(e===this._width&&n===this._height)return Promise.resolve(this);this.emit(He.BEFORE_CHANGE_SIZE);const r=this.render();return r.then(()=>{this.emit(He.AFTER_CHANGE_SIZE)}),r}changeSize(e,n){if(e===this._width&&n===this._height)return Promise.resolve(this);this.emit(He.BEFORE_CHANGE_SIZE),this.attr("width",e),this.attr("height",n);const r=this.render();return r.then(()=>{this.emit(He.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 hy{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 _h{constructor(){super({},o)}};return s=zq([xh(oE(this._marks))],s),[o,s]}));for(const a of Object.values(this._compositions))xh(oE(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=Wq}=e,{width:r,height:i,depth:a}=ly(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}=ly(this.options(),this._container);this._plugins.push(new $2),this._plugins.forEach(r=>this._renderer.registerPlugin(r)),this._context.canvas=new y2({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 Yq(t,e){class n extends t{constructor(i){super(Object.assign(Object.assign({},i),{lib:e}))}}return n}nt.enableCSSParsing=!1;var $q=Object.prototype.hasOwnProperty,cE=function(t,e){if(t===null||!co(t))return{};var n={};return Cg(e,function(r){$q.call(t,r)&&(n[r]=t[r])}),n};function lE(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 hu(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 qq(){return this.eachAfter(Uq)}var py=rt(335);function Kq(t,e){var n=-1,r=py(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 Zq(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 Qq(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 eK(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function nK(t){for(var e=this,n=rK(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 rK(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 iK(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function aK(){return Array.from(this)}function oK(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function sK(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}var uE=rt(90228),cK=uE().mark(fE);function fE(){var t,e,n,r,i,a;return uE().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 Rc(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(dE)}function lK(){return Nc(this).eachBefore(dK)}function uK(t){return t.children}function fK(t){return Array.isArray(t)?t[1]:null}function dK(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function dE(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function Rc(t){this.data=t,this.depth=this.height=0,this.parent=null}Rc.prototype=Nc.prototype=Xq({constructor:Rc,count:qq,each:Kq,eachAfter:Qq,eachBefore:Zq,find:Jq,sum:tK,sort:eK,path:nK,ancestors:iK,descendants:aK,leaves:oK,links:sK,copy:lK},Symbol.iterator,fE);var hK=function(t,e){if(!Hl(t))return t;for(var n=[],r=0;re.value-t.value,as:["x","y"],ignoreParentValue:!0},mK="nodeIndex",pu="childNodeCount",bK="nodeAncestor",gy="Invalid field: it must be a string!";function xK(t,e){const{field:n,fields:r}=t;if(wn(n))return n;if(fr(n))return console.warn(gy),n[0];if(console.warn(`${gy} will try to get fields instead.`),wn(r))return r;if(fr(r)&&r.length)return r[0];if(e)return e;throw new TypeError(gy)}function _K(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=pK((((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 OK(t,e){e=vK({},yK,e);const n=e.as;if(!fr(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=xK(e)}catch(c){console.warn(c)}const a=(c=>Vq().size(e.size).round(e.round).padding(e.padding)(Nc(c).sum(l=>gK(l.children)?e.ignoreParentValue?0:l[r]-_w(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]})}),_K(a)}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{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({},cE(c.data,[i])),{[hE]:h,[Oh]:v.data.name}),c);r&&r!==Oh&&(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 pE={id:Ic,encode:{x:"x",y:"y",key:hE,color:Oh,value:"value"},axis:{x:!1,y:!1},style:{[yy]:Ic,stroke:"#fff",lineWidth:.5,fillOpacity:"fillOpacity",[pu]:pu,depth:"depth"},state:{active:{zIndex:2,stroke:"#000"},inactive:{zIndex:1,stroke:"#fff"}},legend:!1,interaction:{drillDown:!0},coordinate:{type:"polar",innerRadius:.2}},vE=t=>{const{encode:e,data:n=[],legend:r}=t,i=wK(t,["encode","data","legend"]),a=Object.assign(Object.assign({},i.coordinate),{innerRadius:Math.max(_i(i,["coordinate","innerRadius"],.2),1e-5)}),o=Object.assign(Object.assign({},pE.encode),e),{value:s}=o,c=SK({encode:o,data:n});return[ot({},pE,Object.assign(Object.assign({type:"rect",data:c,encode:o,tooltip:{title:"path",items:[l=>({name:s,value:l[s]})]}},i),{coordinate:a}))]};vE.props={};var MK=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return Cg(t,function(n,r){Xr(t)&&r==="prototype"||e.push(r)}),e},EK=MK,AK=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 PK=t=>t.querySelectorAll(".element").filter(e=>_i(e,["style",yy])===Ic);function TK(t){return te(t).select(`.${Ed}`).node()}const kK={rootText:"root",style:{fill:"rgba(0, 0, 0, 0.85)",fontSize:12,y:1},active:{fill:"rgba(0, 0, 0, 0.5)"}};function CK(t={}){const{breadCrumb:e={},fixedColor:n=!0}=t,r=ot({},kK,e);return i=>{const{update:a,setState:o,container:s,view:c,options:l}=i,u=TK(s),f=l.marks.find(({id:m})=>m===Ic),{state:d}=f,h=new dr;u.appendChild(h);const p=(m,b)=>AK(this,void 0,void 0,function*(){if(h.removeChildren(),m){const x=new na({style:Object.assign({x:0,text:r.rootText,depth:0},r.style)});h.appendChild(x);let _="";const O=m==null?void 0:m.split(" / ");let w=r.style.y,S=h.getBBox().width;const M=u.getBBox().width,E=O.map((A,N)=>{const k=new na({style:Object.assign(Object.assign({x:S,text:" / "},r.style),{y:w})});h.appendChild(k),S+=k.getBBox().width,_=`${_}${A} / `;const P=new na({name:_.replace(/\s\/\s$/,""),style:Object.assign(Object.assign({text:A,x:S,depth:N+1},r.style),{y:w})});return h.appendChild(P),S+=P.getBBox().width,S>M&&(w=h.getBBox().height,S=0,k.attr({x:S,y:w}),S+=k.getBBox().width,P.attr({x:S,y:w}),S+=P.getBBox().width),P});[x,...E].forEach((A,N)=>{if(N===E.length)return;const k=Object.assign({},A.attributes);A.attr("cursor","pointer"),A.addEventListener("mouseenter",()=>{A.attr(r.active)}),A.addEventListener("mouseleave",()=>{A.attr(k)}),A.addEventListener("click",()=>{p(A.name,_i(A,["style","depth"]))})})}o("drillDown",x=>{const{marks:_}=x,O=_.map(w=>{if(w.id!==Ic&&w.type!=="rect")return w;const{data:S}=w,M=Object.fromEntries(["color"].map(A=>[A,{domain:c.scale[A].getOptions().domain}])),E=S.filter(A=>{const N=A.path;return n&&(A[Oh]=N.split(" / ")[b]),m?new RegExp(`^${m}.+`).test(N):!0});return ot({},w,n?{data:E}:{data:E,scale:M})});return Object.assign(Object.assign({},x),{marks:O})}),yield a()}),v=m=>{const b=m.target;if(_i(b,["style",yy])!==Ic||_i(b,["markType"])!=="rect"||!_i(b,["style",pu]))return;const x=_i(b,["__data__","key"]),_=_i(b,["style","depth"]);b.style.cursor="pointer",p(x,_)};u.addEventListener("click",v);const g=EK(Object.assign(Object.assign({},d.active),d.inactive)),y=()=>{PK(u).forEach(b=>{const x=_i(b,["style",pu]);if(_i(b,["style","cursor"])!=="pointer"&&x){b.style.cursor="pointer";const O=cE(b.attributes,g);b.addEventListener("mouseenter",()=>{b.attr(d.active)}),b.addEventListener("mouseleave",()=>{b.attr(ot(O,d.inactive))})}})};return u.addEventListener("mousemove",y),()=>{h.remove(),u.removeEventListener("click",v),u.removeEventListener("mousemove",y)}}}nt.enableCSSParsing=!1;function LK(){return{"interaction.drillDown":CK,"mark.sunburst":vE}}const gE=()=>[["cartesian"]];gE.props={};const my=()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]];my.props={transform:!0};const NK=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:Math.PI*3/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)},yE=t=>{const{startAngle:e,endAngle:n,innerRadius:r,outerRadius:i}=NK(t);return[...my(),...Yl({startAngle:e,endAngle:n,innerRadius:r,outerRadius:i})]};yE.props={};const by=()=>[["parallel",0,1,0,1]];by.props={};const mE=({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]];mE.props={transform:!0};const bE=t=>{const{startAngle:e=-Math.PI/2,endAngle:n=Math.PI*3/2,innerRadius:r=0,outerRadius:i=1}=t;return[...by(),...Yl({startAngle:e,endAngle:n,innerRadius:r,outerRadius:i})]};bE.props={};const xE=({value:t})=>e=>e.map(()=>t);xE.props={};const _E=({value:t})=>e=>e.map(n=>n[t]);_E.props={};const OE=({value:t})=>e=>e.map(t);OE.props={};const wE=({value:t})=>()=>t;wE.props={};function un(t,e){if(t!==null)return{type:"column",value:t,field:e}}function wh(t,e){const n=un(t,e);return Object.assign(Object.assign({},n),{inferred:!0})}function Sh(t,e){if(t!==null)return{type:"column",value:t,field:e,visual:!0}}function RK(t,e){const n=un(t,e);return Object.assign(Object.assign({},n),{constant:!1})}function xo(t,e){const n=[];for(const r of t)n[r]=e;return n}function Se(t,e){const n=t[e];if(!n)return[null,null];const{value:r,field:i=null}=n;return[r,i]}function vu(t,...e){for(const n of e)if(typeof n=="string"){const[r,i]=Se(t,n);if(r!==null)return[r,i]}else return[n,null];return[null,null]}function gu(t){return t instanceof Date?!1:typeof t=="object"}const yu=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;return r!==void 0?[t,e]:[t,ot({},e,{encode:{y1:wh(xo(t,0))}})]};yu.props={};const _s=()=>(t,e)=>{const{encode:n}=e,{x:r}=n;return r!==void 0?[t,e]:[t,ot({},e,{encode:{x:wh(xo(t,0))},scale:{x:{guide:null}}})]};_s.props={};const SE=Math.abs,Mr=Math.atan2,Os=Math.cos,IK=Math.max,xy=Math.min,da=Math.sin,jc=Math.sqrt,Er=1e-12,mu=Math.PI,Mh=mu/2,jK=2*mu;function DK(t){return t>1?0:t<-1?mu:Math.acos(t)}function ME(t){return t>=1?Mh:t<=-1?-Mh:Math.asin(t)}function BK(t){return t.innerRadius}function FK(t){return t.outerRadius}function zK(t){return t.startAngle}function GK(t){return t.endAngle}function WK(t){return t&&t.padAngle}function HK(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*dP*P+T*T&&(S=E,M=A),{cx:S,cy:M,x01:-u,y01:-f,x11:S*(i/_-1),y11:M*(i/_-1)}}function Ah(){var t=BK,e=FK,n=vn(0),r=null,i=zK,a=GK,o=WK,s=null,c=Gg(l);function l(){var u,f,d=+t.apply(this,arguments),h=+e.apply(this,arguments),p=i.apply(this,arguments)-Mh,v=a.apply(this,arguments)-Mh,g=SE(v-p),y=v>p;if(s||(s=u=c()),hEr))s.moveTo(0,0);else if(g>jK-Er)s.moveTo(h*Os(p),h*da(p)),s.arc(0,0,h,p,v,!y),d>Er&&(s.moveTo(d*Os(v),d*da(v)),s.arc(0,0,d,v,p,y));else{var m=p,b=v,x=p,_=v,O=g,w=g,S=o.apply(this,arguments)/2,M=S>Er&&(r?+r.apply(this,arguments):jc(d*d+h*h)),E=xy(SE(h-d)/2,+n.apply(this,arguments)),A=E,N=E,k,P;if(M>Er){var T=ME(M/d*da(S)),L=ME(M/h*da(S));(O-=T*2)>Er?(T*=y?1:-1,x+=T,_-=T):(O=0,x=_=(p+v)/2),(w-=L*2)>Er?(L*=y?1:-1,m+=L,b-=L):(w=0,m=b=(p+v)/2)}var j=h*Os(m),D=h*da(m),B=d*Os(_),z=d*da(_);if(E>Er){var W=h*Os(b),$=h*da(b),X=d*Os(x),et=d*da(x),ut;if(gEr?N>Er?(k=Eh(X,et,j,D,h,N,y),P=Eh(W,$,B,z,h,N,y),s.moveTo(k.cx+k.x01,k.cy+k.y01),NEr)||!(O>Er)?s.lineTo(B,z):A>Er?(k=Eh(B,z,W,$,d,-A,y),P=Eh(j,D,X,et,d,-A,y),s.lineTo(k.cx+k.x01,k.cy+k.y01),A0?A:A+k,L=P>0?N:N+P,j=Math.abs(k),D=Math.abs(P),B=T+s,z=L+c,W=j-(s+l),$=D-(c+u),X=S?Nd(W,y,1/0):Nd(W,v,g),et=S?Nd($,v,g):Nd($,y,1/0),ut=S?B:B-(X-W)/2,gt=S?z-(et-$)/2:z-(et-$);return te(t.createElement("rect",{})).style("x",ut).style("y",gt).style("width",X).style("height",et).style("radius",[h,p,d,f]).call(Xt,m).node()}const{y:b,y1:x}=n,_=r.getCenter(),O=ps(r,e,[b,x]),w=Ah().cornerRadius(o).padAngle(a*Math.PI/180);return te(t.createElement("path",{})).style("path",w(O)).style("transform",`translate(${_[0]}, ${_[1]})`).style("radius",o).style("inset",a).call(Xt,m).node()}const bu=(t,e)=>{const{colorAttribute:n,opacityAttribute:r="fill",first:i=!0,last:a=!0}=t,o=Ph(t,["colorAttribute","opacityAttribute","first","last"]),{coordinate:s,document:c}=e;return(l,u,f)=>{const{color:d,radius:h=0}=f,p=Ph(f,["color","radius"]),v=p.lineWidth||1,{stroke:g,radius:y=h,radiusTopLeft:m=y,radiusTopRight:b=y,radiusBottomRight:x=y,radiusBottomLeft:_=y,innerRadius:O=0,innerRadiusTopLeft:w=O,innerRadiusTopRight:S=O,innerRadiusBottomRight:M=O,innerRadiusBottomLeft:E=O,lineWidth:A=n==="stroke"||g?v:0,inset:N=0,insetLeft:k=N,insetRight:P=N,insetBottom:T=N,insetTop:L=N,minWidth:j,maxWidth:D,minHeight:B}=o,z=Ph(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:$}=u,X=[i?m:w,i?b:S,a?x:M,a?_:E],et=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"];hn(s)&&et.push(et.shift());const ut=Object.assign(Object.assign({radius:y},Object.fromEntries(et.map((gt,it)=>[gt,X[it]]))),{inset:N,insetLeft:k,insetRight:P,insetBottom:T,insetTop:L,minWidth:j,maxWidth:D,minHeight:B});return te(EE(c,l,u,s,ut)).call(Xt,p).style("fill","transparent").style(n,W).style(rS(t),$).style("lineWidth",A).style("stroke",g===void 0?W:g).call(Xt,z).node()}};bu.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const ws=(t,e)=>bu(Object.assign({colorAttribute:"fill"},t),e);ws.props=Object.assign(Object.assign({},bu.props),{defaultMarker:"square"});const Th=(t,e)=>bu(Object.assign({colorAttribute:"stroke"},t),e);Th.props=Object.assign(Object.assign({},bu.props),{defaultMarker:"hollowSquare"});function Dc(){}function AE(t){this._context=t}AE.prototype={areaStart:Dc,areaEnd:Dc,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 _y(t){return new AE(t)}var PE=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=YK}=t,r=PE(t,["adjustPoints"]),{coordinate:i,document:a}=e;return(o,s,c,l)=>{const{index:u}=s,{color:f}=c,d=PE(c,["color"]),h=l[u+1],p=n(o,h,i),v=!!hn(i),[g,y,m,b]=v?ah(p):p,{color:x=f,opacity:_}=s,O=yo().curve(_y)([g,y,m,b]);return te(a.createElement("path",{})).call(Xt,d).style("path",O).style("fill",x).style("fillOpacity",_).call(Xt,r).node()}};Oy.props={defaultMarker:"square"};function $K(t,e,n){const[r,i,a,o]=t;if(hn(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 TE=(t,e)=>Oy(Object.assign({adjustPoints:$K},t),e);TE.props={defaultMarker:"square"};function kh(t){return t==null?null:kE(t)}function kE(t){if(typeof t!="function")throw new Error;return t}var VK={depth:-1},CE={},wy={};function XK(t){return t.id}function UK(t){return t.parentId}function Sy(){var t=XK,e=UK,n;function r(i){var a=Array.from(i),o=t,s=e,c,l,u,f,d,h,p,v,g=new Map;if(n!=null){var y=a.map(function(S,M){return qK(n(S,M,i))}),m=y.map(LE),b=new Set(y).add(""),x=py(m),_;try{for(x.s();!(_=x.n()).done;){var O=_.value;b.has(O)||(b.add(O),y.push(O),m.push(LE(O)),a.push(wy))}}catch(S){x.e(S)}finally{x.f()}o=function(M,E){return y[E]},s=function(M,E){return m[E]}}for(u=0,c=a.length;u=0&&(h=a[w],h.data===wy);--w)h.data=null}if(f.parent=VK,f.eachBefore(function(S){S.depth=S.parent.depth+1,--c}).eachBefore(dE),f.parent=null,c>0)throw new Error("cycle");return f}return r.id=function(i){return arguments.length?(t=kh(i),r):t},r.parentId=function(i){return arguments.length?(e=kh(i),r):e},r.path=function(i){return arguments.length?(n=kh(i),r):n},r}function qK(t){t="".concat(t);var e=t.length;return My(t,e-1)&&!My(t,e-2)&&(t=t.slice(0,-1)),t[0]==="/"?t:"/".concat(t)}function LE(t){var e=t.length;if(e<2)return"";for(;--e>1&&!My(t,e););return t.slice(0,e)}function My(t,e){if(t[e]==="/"){for(var n=0;e>0&&t[--e]==="\\";)++n;if(!(n&1))return!0}return!1}function xu(t){return Math.abs(t)>10?String(t):t.toString().padStart(2,"0")}function KK(t){const e=t.getFullYear(),n=xu(t.getMonth()+1),r=xu(t.getDate()),i=`${e}-${n}-${r}`,a=t.getHours(),o=t.getMinutes(),s=t.getSeconds();return a||o||s?`${i} ${xu(a)}:${xu(o)}:${xu(s)}`:i}const Ch=(t={})=>{const{channel:e="x"}=t;return(n,r)=>{const{encode:i}=r,{tooltip:a}=r;if(Pa(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=>Se(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?KK(u[l]):u[l]).join(", ")};return[n,ot({},r,{tooltip:{title:c}})]}};Ch.props={};const Lh=t=>{const{channel:e}=t;return(n,r)=>{const{encode:i,tooltip:a}=r;if(Pa(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,ot({},r,{tooltip:{items:c}})]}};Lh.props={};var ZK=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=ZK(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,ot({},e,{encode:{key:un(o)}})]};NE.props={};function RE(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 Rr(t={}){return[...RE(t),{name:"title",scale:"identity"}]}function xmt(){return[{type:MaybeTitle,channel:"color"},{type:MaybeTooltip,channel:["x","y","z"]}]}function _o(){return[{type:Ch,channel:"color"},{type:Lh,channel:["x","y"]}]}function Bc(){return[{type:Ch,channel:"x"},{type:Lh,channel:["y"]}]}function QK(){return[{type:Ch,channel:"color"},{type:Lh,channel:["position"]}]}function Fc(t={}){return RE(t)}function Fn(){return[{type:NE}]}function Xn(){return[]}function Ey(t,e){return t.getBandWidth(t.invert(e))}function Ss(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?Ey(o,r[g]):0,m=h?Ey(s,i[g]):0,x=p&&a?(()=>(Ey(c,a[g])/2+ +a[g])*y)():0,[_,O]=v;return[_+u*y+x,O+f*m]}}function Nh(t){return parseFloat(t)/100}function Ay(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"?Nh(u)*o:+u,h=typeof f=="string"?Nh(f)*s:+f;return[[d,h]]});return[t,c]}function ha(t){return typeof t=="function"?t:e=>e[t]}function Py(t,e){return Array.from(t,ha(e))}function Ty(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=Py(a,n),c=Py(a,r),l=Py(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 JK(t,e){return Array.isArray(t)?typeof e=="function"?Sy().path(e)(t):Sy()(t):Nc(t)}function IE(t,e){return t.getBandWidth(t.invert(e))}const jE={rect:ws,hollow:Th,funnel:Oy,pyramid:TE},DE=()=>(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=IE(l,i[v]),y=u?IE(u,s==null?void 0:s[v]):1,m=g*y,b=(+(s==null?void 0:s[v])||0)*g,x=+i[v]+b,[_,O]=h(x,m,v),w=+a[v],S=+o[v];return[[_,w],[O,w],[O,S],[_,S]].map(k=>r.map(k))});return[t,p]};DE.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:jE,channels:[...Rr({shapes:Object.keys(jE)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...Fn(),{type:yu},{type:_s}],postInference:[...Xn(),...Bc()],interaction:{shareTooltip:!0}};const BE={rect:ws,hollow:Th},FE=()=>(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]};FE.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:BE,channels:[...Rr({shapes:Object.keys(BE)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Fn(),{type:yu}],postInference:[...Xn(),...Bc()],interaction:{shareTooltip:!0}};var zE=ky(su);function GE(t){this._curve=t}GE.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 ky(t){function e(n){return new GE(t(n))}return e._curve=t,e}function _u(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(ky(n)):e()._curve},t}function tZ(){return _u(yo().curve(zE))}var WE=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;te(t).maybeAppend("line",()=>a.createElement("path",{})).style("d",e).call(Xt,r),te(t).maybeAppend("line1",()=>a.createElement("path",{})).style("d",n).call(Xt,i)});function nZ(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 Si=(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=WE(t,["curve","gradient","gradientColor","defined","connect"]),{coordinate:c,document:l}=e;return(u,f,d)=>{const{color:h,lineWidth:p}=d,v=WE(d,["color","lineWidth"]),{color:g=h,size:y=p,seriesColor:m,seriesX:b,seriesY:x}=f,_=iS(c,f),O=hn(c),w=r&&m?nS(m,b,x,r,i,O):g,S=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},v),w&&{stroke:w}),y&&{lineWidth:y}),_&&{transform:_}),s);let M;if(cn(c)){const T=c.getCenter();M=L=>tZ().angle((j,D)=>wc(Ln(L[D],T))).radius((j,D)=>_n(L[D],T)).defined(([j,D])=>a(j)&&a(D)).curve(n)(L)}else M=yo().x(T=>T[0]).y(T=>T[1]).defined(([T,L])=>a(T)&&a(L)).curve(n);const[E,A]=nZ(u,a),N=Pt(S,"connect"),k=!!A.length;if(!k||o&&!Object.keys(N).length)return te(l.createElement("path",{})).style("d",M(E)||[]).call(Xt,S).node();if(k&&!o)return te(l.createElement("path",{})).style("d",M(u)).call(Xt,S).node();const P=T=>T.map(M).join(",");return te(new eZ).style("style1",Object.assign(Object.assign({},S),N)).style("style2",S).style("d1",P(A)).style("d2",M(u)).node()}};Si.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const HE=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=cn(n)?_y:su;return Si(Object.assign({curve:i},t),e)(...r)}};HE.props=Object.assign(Object.assign({},Si.props),{defaultMarker:"line"});function Cy(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 Ly(t,e){this._context=t,this._k=(1-e)/6}Ly.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:Cy(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:Cy(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 _mt=function t(e){function n(r){return new Ly(r,e)}return n.tension=function(r){return t(+r)},n}(0);function Ny(t,e){this._context=t,this._k=(1-e)/6}Ny.prototype={areaStart:Dc,areaEnd:Dc,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:Cy(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 Omt=function t(e){function n(r){return new Ny(r,e)}return n.tension=function(r){return t(+r)},n}(0);function YE(t,e,n){var r=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>Er){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>Er){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 $E(t,e){this._context=t,this._alpha=e}$E.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:YE(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 wmt=function t(e){function n(r){return e?new $E(r,e):new Ly(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function VE(t,e){this._context=t,this._alpha=e}VE.prototype={areaStart:Dc,areaEnd:Dc,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:YE(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 XE=function t(e){function n(r){return e?new VE(r,e):new Ny(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function UE(t){return t<0?-1:1}function qE(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(UE(a)+UE(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function KE(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Ry(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 Rh(t){this._context=t}Rh.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:Ry(this,this._t0,KE(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,Ry(this,KE(this,n=qE(this,t,e)),n);break;default:Ry(this,this._t0,n=qE(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function ZE(t){this._context=new QE(t)}(ZE.prototype=Object.create(Rh.prototype)).point=function(t,e){Rh.prototype.point.call(this,e,t)};function QE(t){this._context=t}QE.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 JE(t){return new Rh(t)}function tA(t){return new ZE(t)}var rZ=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=rZ(t,[]),{coordinate:r}=e;return(...i)=>{const a=cn(r)?XE:hn(r)?tA:JE;return Si(Object.assign({curve:a},n),e)(...i)}};eA.props=Object.assign(Object.assign({},Si.props),{defaultMarker:"smooth"});function Ih(t,e){this._context=t,this._t=e}Ih.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 nA(t){return new Ih(t,.5)}function rA(t){return new Ih(t,0)}function iA(t){return new Ih(t,1)}const aA=(t,e)=>Si(Object.assign({curve:iA},t),e);aA.props=Object.assign(Object.assign({},Si.props),{defaultMarker:"hv"});const oA=(t,e)=>Si(Object.assign({curve:rA},t),e);oA.props=Object.assign(Object.assign({},Si.props),{defaultMarker:"vh"});const sA=(t,e)=>Si(Object.assign({curve:nA},t),e);sA.props=Object.assign(Object.assign({},Si.props),{defaultMarker:"hvh"});var iZ=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=iZ(a,["color"]),u=wi();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,ot({},e,{encode:{series:Sh(xo(t,void 0))}})]};lA.props={};const Iy=()=>(t,e)=>{const{encode:n}=e,{series:r,color:i}=n;if(r!==void 0||i===void 0)return[t,e];const[a,o]=Se(n,"color");return[t,ot({},e,{encode:{series:un(a,o)}})]};Iy.props={};const uA={line:HE,smooth:eA,hv:aA,vh:oA,hvh:sA,trail:cA},oZ=(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(xn(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]},sZ=(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)=>(Vl(r)?sZ:oZ)(t,e,n,r);fA.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:uA,channels:[...Rr({shapes:Object.keys(uA)}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...Fn(),{type:lA},{type:Iy}],postInference:[...Xn(),...Bc(),...QK()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};var cZ=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"]];jy.style=["fill"];const dA=jy.bind(void 0);dA.style=["stroke","lineWidth"];const jh=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]];jh.style=["fill"];const hA=jh.bind(void 0);hA.style=["fill"];const pA=jh.bind(void 0);pA.style=["stroke","lineWidth"];const Dy=(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"]]};Dy.style=["fill"];const vA=Dy.bind(void 0);vA.style=["stroke","lineWidth"];const By=(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"]]};By.style=["fill"];const gA=By.bind(void 0);gA.style=["stroke","lineWidth"];const Fy=(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"]]};Fy.style=["fill"];const yA=Fy.bind(void 0);yA.style=["stroke","lineWidth"];const zy=(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"]]};zy.style=["fill"];const mA=zy.bind(void 0);mA.style=["stroke","lineWidth"];const Gy=(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"]]};Gy.style=["fill"];const bA=Gy.bind(void 0);bA.style=["stroke","lineWidth"];const xA=(t,e,n)=>[["M",t,e+n],["L",t,e-n]];xA.style=["stroke","lineWidth"];const _A=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]];_A.style=["stroke","lineWidth"];const OA=(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]];OA.style=["stroke","lineWidth"];const wA=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]];wA.style=["stroke","lineWidth"];const SA=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];SA.style=["stroke","lineWidth"];const Wy=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];Wy.style=["stroke","lineWidth"];const MA=Wy.bind(void 0);MA.style=["stroke","lineWidth"];const EA=(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]];EA.style=["stroke","lineWidth"];const AA=(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]];AA.style=["stroke","lineWidth"];const PA=(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]];PA.style=["stroke","lineWidth"];const TA=(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]];TA.style=["stroke","lineWidth"];const kA=(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]];kA.style=["stroke","lineWidth"];const zc=new Map([["bowtie",Gy],["cross",_A],["dash",MA],["diamond",Dy],["dot",Wy],["hexagon",zy],["hollowBowtie",bA],["hollowDiamond",vA],["hollowHexagon",mA],["hollowPoint",dA],["hollowSquare",pA],["hollowTriangle",gA],["hollowTriangleDown",yA],["hv",AA],["hvh",TA],["hyphen",SA],["line",xA],["plus",wA],["point",jy],["rect",hA],["smooth",EA],["square",jh],["tick",OA],["triangleDown",Fy],["triangle",By],["vh",PA],["vhv",kA]]);function lZ(t,e){var{d:n,fill:r,strokeWidth:i,path:a,stroke:o,lineWidth:s,color:c}=e,l=cZ(e,["d","fill","strokeWidth","path","stroke","lineWidth","color"]);const u=zc.get(t)||zc.get("point");return(...f)=>new Nr({style:Object.assign(Object.assign({},l),{path:u(...f),stroke:u.style.includes("stroke")?c||o:"",fill:u.style.includes("fill")?c||r:"",lineWidth:u.style.includes("lineWidth")?s||s||2:0})})}function Smt(t,e){zc.set(t,e)}function Mmt(t){zc.delete(t)}var uZ=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=uZ(t,["colorAttribute","symbol","mode"]),o=zc.get(r)||zc.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]=aS(l),_=fZ(i,l,u,s)||a.r||f.r;return te(c.createElement("path",{})).call(Xt,f).style("fill","transparent").style("d",o(m,b,_)).style("lineWidth",p).style("transform",g).style("stroke",v).style(rS(t),y).style(n,v).call(Xt,a).node()}};me.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const CA=(t,e)=>me(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e);CA.props=Object.assign({defaultMarker:"hollowPoint"},me.props);const LA=(t,e)=>me(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e);LA.props=Object.assign({defaultMarker:"hollowDiamond"},me.props);const NA=(t,e)=>me(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e);NA.props=Object.assign({defaultMarker:"hollowHexagon"},me.props);const RA=(t,e)=>me(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e);RA.props=Object.assign({defaultMarker:"hollowSquare"},me.props);const IA=(t,e)=>me(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e);IA.props=Object.assign({defaultMarker:"hollowTriangleDown"},me.props);const jA=(t,e)=>me(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e);jA.props=Object.assign({defaultMarker:"hollowTriangle"},me.props);const DA=(t,e)=>me(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e);DA.props=Object.assign({defaultMarker:"hollowBowtie"},me.props);const BA=(t,e)=>me(Object.assign({colorAttribute:"fill",symbol:"point"},t),e);BA.props=Object.assign({defaultMarker:"point"},me.props);const FA=(t,e)=>me(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e);FA.props=Object.assign({defaultMarker:"plus"},me.props);const zA=(t,e)=>me(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e);zA.props=Object.assign({defaultMarker:"diamond"},me.props);const GA=(t,e)=>me(Object.assign({colorAttribute:"fill",symbol:"square"},t),e);GA.props=Object.assign({defaultMarker:"square"},me.props);const WA=(t,e)=>me(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e);WA.props=Object.assign({defaultMarker:"triangle"},me.props);const HA=(t,e)=>me(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e);HA.props=Object.assign({defaultMarker:"hexagon"},me.props);const YA=(t,e)=>me(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e);YA.props=Object.assign({defaultMarker:"cross"},me.props);const $A=(t,e)=>me(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e);$A.props=Object.assign({defaultMarker:"bowtie"},me.props);const VA=(t,e)=>me(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e);VA.props=Object.assign({defaultMarker:"hyphen"},me.props);const XA=(t,e)=>me(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e);XA.props=Object.assign({defaultMarker:"line"},me.props);const UA=(t,e)=>me(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e);UA.props=Object.assign({defaultMarker:"tick"},me.props);const qA=(t,e)=>me(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e);qA.props=Object.assign({defaultMarker:"triangleDown"},me.props);const Dh=()=>(t,e)=>{const{encode:n}=e,{y:r}=n;return r!==void 0?[t,e]:[t,ot({},e,{encode:{y:wh(xo(t,0))},scale:{y:{guide:null}}})]};Dh.props={};const KA=()=>(t,e)=>{const{encode:n}=e,{size:r}=n;return r!==void 0?[t,e]:[t,ot({},e,{encode:{size:Sh(xo(t,3))}})]};KA.props={};const ZA={hollow:CA,hollowDiamond:LA,hollowHexagon:NA,hollowSquare:RA,hollowTriangleDown:IA,hollowTriangle:jA,hollowBowtie:DA,point:BA,plus:FA,diamond:zA,square:GA,triangle:WA,hexagon:HA,cross:YA,bowtie:$A,hyphen:VA,line:XA,tick:UA,triangleDown:qA},QA=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=Ss(n,r,t),v=y=>{const m=+((u==null?void 0:u[y])||0),b=+((f==null?void 0:f[y])||0),x=s?(+a[y]+ +s[y])/2:+a[y],_=c?(+o[y]+ +c[y])/2:+o[y],O=x+m,w=_+b;return[O,w]},g=l?Array.from(e,y=>{const[m,b]=v(y),x=+l[y],_=x/d,O=x/h,w=[m-_,b-O],S=[m+_,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]};QA.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,shape:ZA,channels:[...Rr({shapes:Object.keys(ZA)}),{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:[...Fn(),{type:_s},{type:Dh}],postInference:[...Xn(),{type:KA},..._o()]};const JA=(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 te(new dS).style("x",d).style("y",h).call(Xt,a).style("transform",`${u}rotate(${+l})`).style("coordCenter",n.getCenter()).call(Xt,f).call(Xt,t).node()}};JA.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var Hy=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}=e,a=Hy(e,["class","x","y"]),o=Pt(a,"marker"),{size:s=24}=o,c=()=>dZ(s/2),l=te(t).maybeAppend("marker",()=>new tn({})).call(d=>d.node().update(Object.assign({symbol:c},o))).node(),[u,f]=hZ(l);te(t).maybeAppend("text","text").style("x",u).style("y",f).call(Xt,a)}),tP=(t,e)=>{const n=Hy(t,[]);return(r,i,a)=>{const{color:o}=a,s=Hy(a,["color"]),{color:c=o,text:l=""}=i,u={text:String(l),stroke:c,fill:c},[[f,d]]=r;return te(new pZ).call(Xt,s).style("x",f).style("y",d).call(Xt,u).call(Xt,n).node()}};tP.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Bh=()=>(t,e)=>{const{data:n}=e;if(!Array.isArray(n)||n.some(gu))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,ot({},e,{encode:{x:un(i),y:un(a)}})]};Bh.props={};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(t,e)=>{const{data:n,style:r={}}=e,i=eP(e,["data","style"]),{x:a,y:o}=r,s=eP(r,["x","y"]);if(a==null||o==null)return[t,e];const c=a||0,l=o||0;return[[0],ot({},i,{data:[0],cartesian:!0,encode:{x:un([c]),y:un([l])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:s})]};Fh.props={};const nP={text:JA,badge:tP},rP=t=>{const{cartesian:e=!1}=t;return e?Ay:(n,r,i,a)=>{const{x:o,y:s}=i,c=Ss(r,i,t),l=Array.from(n,u=>{const f=[+o[u],+s[u]];return[a.map(c(f,u))]});return[n,l]}};rP.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,shape:nP,channels:[...Rr({shapes:Object.keys(nP)}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize"},{name:"rotate"}],preInference:[...Fn(),{type:Bh},{type:Fh}],postInference:[...Xn(),..._o()]};const Yy=()=>(t,e)=>[t,ot({scale:{x:{padding:0},y:{padding:0}}},e)];Yy.props={};const iP={cell:ws,hollow:Th},aP=()=>(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]};aP.props={defaultShape:"cell",defaultLabelShape:"label",shape:iP,composite:!1,channels:[...Rr({shapes:Object.keys(iP)}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...Fn(),{type:_s},{type:Dh},{type:Yy}],postInference:[...Xn(),..._o()]};function $y(t,e,n){var r=null,i=vn(!0),a=null,o=su,s=null,c=Gg(l);t=typeof t=="function"?t:t===void 0?uS:vn(+t),e=typeof e=="function"?e:vn(e===void 0?0:+e),n=typeof n=="function"?n:n===void 0?fS:vn(+n);function l(f){var d,h,p,v=(f=sS(f)).length,g,y=!1,m,b=new Array(v),x=new Array(v);for(a==null&&(s=o(m=c())),d=0;d<=v;++d){if(!(d=h;--p)s.point(b[p],x[p]);s.lineEnd(),s.areaEnd()}y&&(b[d]=+t(g,d,f),x[d]=+e(g,d,f),s.point(r?+r(g,d,f):b[d],n?+n(g,d,f):x[d]))}if(m)return s=null,m+""||null}function u(){return yo().defined(i).curve(o).context(a)}return l.x=function(f){return arguments.length?(t=typeof f=="function"?f:vn(+f),r=null,l):t},l.x0=function(f){return arguments.length?(t=typeof f=="function"?f:vn(+f),l):t},l.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:vn(+f),l):r},l.y=function(f){return arguments.length?(e=typeof f=="function"?f:vn(+f),n=null,l):e},l.y0=function(f){return arguments.length?(e=typeof f=="function"?f:vn(+f),l):e},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:vn(+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:vn(!!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 vZ(){var t=$y().curve(zE),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 _u(n())},delete t.lineX0,t.lineEndAngle=function(){return _u(r())},delete t.lineX1,t.lineInnerRadius=function(){return _u(i())},delete t.lineY0,t.lineOuterRadius=function(){return _u(a())},delete t.lineY1,t.curve=function(o){return arguments.length?e(ky(o)):e()._curve},t}var gZ=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 oP=Sc(t=>{const{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes,a=t.ownerDocument;te(t).maybeAppend("connect-path",()=>a.createElement("path",{})).style("d",n).call(Xt,i),te(t).maybeAppend("area-path",()=>a.createElement("path",{})).style("d",e).call(Xt,r)}),Gi=(t,e)=>{const{curve:n,gradient:r=!1,defined:i=l=>!Number.isNaN(l)&&l!==void 0&&l!==null,connect:a=!1}=t,o=gZ(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=hn(s),m=iS(s,u),b=r&&p?nS(p,v,g,r,void 0,y):h,x=Object.assign(Object.assign(Object.assign(Object.assign({},f),{stroke:b,fill:b}),m&&{transform:m}),o),[_,O]=yZ(l,i),w=Pt(x,"connect"),S=!!O.length,M=E=>te(c.createElement("path",{})).style("d",E||"").call(Xt,x).node();if(cn(s)){const E=A=>{const N=s.getCenter(),k=A.slice(0,A.length/2),P=A.slice(A.length/2);return vZ().angle((T,L)=>wc(Ln(k[L],N))).outerRadius((T,L)=>_n(k[L],N)).innerRadius((T,L)=>_n(P[L],N)).defined((T,L)=>[...k[L],...P[L]].every(i)).curve(n)(P)};return!S||a&&!Object.keys(w).length?M(E(_)):S&&!a?M(E(l)):te(new oP).style("areaStyle",x).style("connectStyle",Object.assign(Object.assign({},w),o)).style("areaPath",E(l)).style("connectPath",O.map(E).join("")).node()}else{const E=A=>{const N=A.slice(0,A.length/2),k=A.slice(A.length/2);return y?$y().y((P,T)=>N[T][1]).x1((P,T)=>N[T][0]).x0((P,T)=>k[T][0]).defined((P,T)=>[...N[T],...k[T]].every(i)).curve(n)(N):$y().x((P,T)=>N[T][0]).y1((P,T)=>N[T][1]).y0((P,T)=>k[T][1]).defined((P,T)=>[...N[T],...k[T]].every(i)).curve(n)(N)};return!S||a&&!Object.keys(w).length?M(E(_)):S&&!a?M(E(l)):te(new oP).style("areaStyle",x).style("connectStyle",Object.assign(Object.assign({},w),o)).style("areaPath",E(l)).style("connectPath",O.map(E).join("")).node()}}};Gi.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const sP=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=cn(n)?_y:su;return Gi(Object.assign({curve:i},t),e)(...r)}};sP.props=Object.assign(Object.assign({},Gi.props),{defaultMarker:"square"});var mZ=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=mZ(t,[]),{coordinate:r}=e;return(...i)=>{const a=cn(r)?XE:hn(r)?tA:JE;return Gi(Object.assign({curve:a},n),e)(...i)}};cP.props=Object.assign(Object.assign({},Gi.props),{defaultMarker:"smooth"});const lP=(t,e)=>(...n)=>Gi(Object.assign({curve:nA},t),e)(...n);lP.props=Object.assign(Object.assign({},Gi.props),{defaultMarker:"hvh"});const uP=(t,e)=>(...n)=>Gi(Object.assign({curve:rA},t),e)(...n);uP.props=Object.assign(Object.assign({},Gi.props),{defaultMarker:"vh"});const fP=(t,e)=>(...n)=>Gi(Object.assign({curve:iA},t),e)(...n);fP.props=Object.assign(Object.assign({},Gi.props),{defaultMarker:"hv"});const dP={area:sP,smooth:cP,hvh:lP,vh:uP,hv:fP},hP=()=>(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(xn(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 x=0;x(t,e)=>{const{encode:n}=e,{y1:r}=n;if(r)return[t,e];const[i]=Se(n,"y");return[t,ot({},e,{encode:{y1:un([...i])}})]};pP.props={};const vP=()=>(t,e)=>{const{encode:n}=e,{x1:r}=n;if(r)return[t,e];const[i]=Se(n,"x");return[t,ot({},e,{encode:{x1:un([...i])}})]};vP.props={};var gP=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=gP(t,["arrow","arrowSize"]),{document:a}=e;return(o,s,c)=>{const{defaultColor:l}=c,u=gP(c,["defaultColor"]),{color:f=l,transform:d}=s,[h,p]=o,v=wi();if(v.moveTo(...h),v.lineTo(...p),n){const[g,y]=y$(h,p,{arrowSize:r});v.moveTo(...p),v.lineTo(...g),v.moveTo(...p),v.lineTo(...y)}return te(a.createElement("path",{})).call(Xt,u).style("d",v.toString()).style("stroke",f).style("transform",d).call(Xt,i).node()}};Vy.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const yP=(t,e)=>{const{arrow:n=!1}=t;return(...r)=>Vy(Object.assign(Object.assign({},t),{arrow:n}),e)(...r)};yP.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var mP=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=mP(t,[]),{coordinate:r,document:i}=e;return(a,o,s)=>{const{color:c}=s,l=mP(s,["color"]),{color:u=c,transform:f}=o,[d,h]=a,p=wi();if(p.moveTo(d[0],d[1]),cn(r)){const v=r.getCenter();p.quadraticCurveTo(v[0],v[1],h[0],h[1])}else{const v=eS(d,h),g=_n(d,h)/2;ou(p,d,h,v,g)}return te(i.createElement("path",{})).call(Xt,l).style("d",p.toString()).style("stroke",u).style("transform",f).call(Xt,n).node()}};bP.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var xP=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=xP(t,[]),{document:r}=e;return(i,a,o)=>{const{color:s}=o,c=xP(o,["color"]),{color:l=s,transform:u}=a,[f,d]=i,h=wi();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]),te(r.createElement("path",{})).call(Xt,c).style("d",h.toString()).style("stroke",l).style("transform",u).call(Xt,n).node()}};_P.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};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{cornerRatio:n=1/3}=t,r=OP(t,["cornerRatio"]),{coordinate:i,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=bZ(h,p,i,n);return te(a.createElement("path",{})).call(Xt,u).style("d",v.toString()).style("stroke",f).style("transform",d).call(Xt,r).node()}};wP.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const SP={link:yP,arc:bP,smooth:_P,vhv:wP},Xy=t=>(e,n,r,i)=>{const{x:a,y:o,x1:s=a,y1:c=o}=r,l=Ss(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]};Xy.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,shape:SP,channels:[...Rr({shapes:Object.keys(SP)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Fn(),{type:pP},{type:vP}],postInference:[...Xn(),..._o()]};var xZ=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=xZ(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"?Nh(h)*y:h,p=typeof p=="string"?Nh(p)*m:p;const b=v-Number(h)/2,x=g-Number(p)/2;return te(r.createElement("image",{})).call(Xt,c).style("x",b).style("y",x).style("img",u).style("stroke",l).style("transform",d).call(Xt,t).style("width",h).style("height",p).node()}};MP.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const EP={image:MP},AP=t=>{const{cartesian:e}=t;return e?Ay:(n,r,i,a)=>{const{x:o,y:s}=i,c=Ss(r,i,t),l=Array.from(n,u=>{const f=[+o[u],+s[u]];return[a.map(c(f,u))]});return[n,l]}};AP.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,shape:EP,channels:[...Rr({shapes:Object.keys(EP)}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...Fn(),{type:Bh},{type:Fh}],postInference:[...Xn(),..._o()]};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_n(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?ou(n,l,o,r,c):n.lineTo(o[0],o[1])}),n.closePath(),n}return g$(n,t)}const PP=(t,e)=>{const{coordinate:n,document:r}=e;return(i,a,o)=>{const{color:s}=o,c=_Z(o,["color"]),{color:l=s,transform:u}=a,f=OZ(i,n);return te(r.createElement("path",{})).call(Xt,c).style("d",f.toString()).style("stroke",l).style("fill",l).style("transform",u).call(Xt,t).node()}};PP.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var TP=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=TP(t,[]),{coordinate:r,document:i}=e;return(a,o,s)=>{const{color:c}=s,l=TP(s,["color"]),{color:u=c,transform:f}=o,d=wZ(a,r);return te(i.createElement("path",{})).call(Xt,l).style("d",d.toString()).style("fill",u||c).style("stroke",u||c).style("transform",f).call(Xt,n).node()}};kP.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const CP={polygon:PP,ribbon:kP},LP=()=>(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=SZ(o,["color","fill","stroke"]),h=MZ(i,n);return te(r.createElement("path",{})).call(Xt,d).style("d",h.toString()).style("stroke",f).style("fill",s||u).style("transform",c).call(Xt,t).node()}};NP.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var EZ=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=EZ(o,["color","fill","stroke"]),p=AZ(i,n,l);return te(r.createElement("path",{})).call(Xt,h).style("d",p.toString()).style("stroke",d).style("fill",s||f).style("transform",c).call(Xt,t).node()}};RP.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const IP={box:NP,violin:RP},jP=()=>(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,_],[b-y/2,_],[b-y/2,O],[b+y/2,O],[b,_],[b,x],[b-y/2,x],[b+y/2,x]].map(E=>r.map(E))});return[t,h]};jP.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,shape:IP,channels:[...Rr({shapes:Object.keys(IP)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...Fn(),{type:_s}],postInference:[...Xn(),...Bc()],interaction:{shareTooltip:!0}};const DP={vector:Vy},BP=()=>(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]};BP.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,shape:DP,channels:[...Rr({shapes:Object.keys(DP)}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...Fn()],postInference:[...Xn(),..._o()]};var FP=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 Ah()({startAngle:0,endAngle:Math.PI*2,outerRadius:_n(t[0],n),innerRadius:_n(t[1],n)})}function kZ(t,e){if(!cn(t))return e;const[n,r]=t.getCenter();return`translate(${n}, ${r}) ${e||""}`}const Uy=(t,e)=>{const{arrow:n,arrowSize:r=4}=t,i=FP(t,["arrow","arrowSize"]),{coordinate:a,document:o}=e;return(s,c,l)=>{const{color:u,lineWidth:f}=l,d=FP(l,["color","lineWidth"]),{color:h=u,size:p=f}=c,v=n?PZ(o,r,Object.assign({fill:i.stroke||h,stroke:i.stroke||h},Pt(i,"arrow"))):null,g=TZ(s,a),y=kZ(a,c.transform);return te(o.createElement("path",{})).call(Xt,d).style("d",g).style("stroke",h).style("lineWidth",p).style("transform",y).style("markerEnd",v).call(Xt,i).node()}};Uy.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const zP=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(gu)?[t,e]:[t,ot({},e,{encode:{x:un(n)}})]};zP.props={};const GP={line:Uy},WP=t=>(e,n,r,i)=>{const{x:a}=r,o=Ss(n,r,ot({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]};WP.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:GP,channels:[...Fc({shapes:Object.keys(GP)}),{name:"x",required:!0}],preInference:[...Fn(),{type:zP}],postInference:[...Xn()]};const HP=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(gu)?[t,e]:[t,ot({},e,{encode:{y:un(n)}})]};HP.props={};const YP={line:Uy},$P=t=>(e,n,r,i)=>{const{y:a}=r,o=Ss(n,r,ot({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]};$P.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:YP,channels:[...Fc({shapes:Object.keys(YP)}),{name:"y",required:!0}],preInference:[...Fn(),{type:HP}],postInference:[...Xn()]};var VP=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 NZ(t,e,n,r,i=0){const[[a,o],[s,c]]=e;if(hn(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 XP=(t,e)=>{const{offset:n=0,offset1:r=n,offset2:i=n,connectLength1:a,endMarker:o=!0}=t,s=VP(t,["offset","offset1","offset2","connectLength1","endMarker"]),{coordinate:c}=e;return(l,u,f)=>{const{color:d,connectLength1:h}=f,p=VP(f,["color","connectLength1"]),{color:v,transform:g}=u,y=NZ(c,l,r,i,a!=null?a:h),m=Pt(Object.assign(Object.assign({},s),f),"endMarker");return te(new Nr).call(Xt,p).style("path",LZ(y)).style("stroke",v||d).style("transform",g).style("markerEnd",o?new tn({className:"marker",style:Object.assign(Object.assign({},m),{symbol:CZ})}):null).call(Xt,s).node()}};XP.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const UP={connector:XP},qP=(...t)=>Xy(...t);qP.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,shape:UP,channels:[...Fc({shapes:Object.keys(UP)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Fn()],postInference:[...Xn()]};function KP(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 qy(t={}){const{extendX:e=!1,extendY:n=!1}=t;return(r,i,a,o)=>{const s=KP("x",e,a,i.x),c=KP("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 ZP={range:ws},QP=()=>qy();QP.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:ZP,channels:[...Fc({shapes:Object.keys(ZP)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Fn()],postInference:[...Xn()]};const JP=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(gu))){const r=(i,a)=>Array.isArray(i[0])?i.map(o=>o[a]):[i[a]];return[t,ot({},e,{encode:{x:un(r(n,0)),x1:un(r(n,1))}})]}return[t,e]};JP.props={};const tT={range:ws},eT=()=>qy({extendY:!0});eT.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:tT,channels:[...Fc({shapes:Object.keys(tT)}),{name:"x",required:!0}],preInference:[...Fn(),{type:JP}],postInference:[...Xn()]};const nT=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(gu))){const r=(i,a)=>Array.isArray(i[0])?i.map(o=>o[a]):[i[a]];return[t,ot({},e,{encode:{y:un(r(n,0)),y1:un(r(n,1))}})]}return[t,e]};nT.props={};const rT={range:ws},iT=()=>qy({extendX:!0});iT.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:rT,channels:[...Fc({shapes:Object.keys(rT)}),{name:"y",required:!0}],preInference:[...Fn(),{type:nT}],postInference:[...Xn()]};var aT=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=aT(t,["arrow","colorAttribute"]),{coordinate:a,document:o}=e;return(s,c,l)=>{const{color:u,stroke:f}=l,d=aT(l,["color","stroke"]),{d:h,color:p=u}=c,[v,g]=a.getSize();return te(o.createElement("path",{})).call(Xt,d).style("d",typeof h=="function"?h({width:v,height:g}):h).style(r,p).call(Xt,i).node()}};Ky.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const oT=(t,e)=>Ky(Object.assign({colorAttribute:"fill"},t),e);oT.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const sT=(t,e)=>Ky(Object.assign({fill:"none",colorAttribute:"stroke"},t),e);sT.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const cT={path:oT,hollow:sT},lT=t=>(e,n,r,i)=>[e,e.map(()=>[[0,0]])];lT.props={defaultShape:"path",defaultLabelShape:"label",shape:cT,composite:!1,channels:[...Rr({shapes:Object.keys(cT)}),{name:"d",scale:"identity"}],preInference:[...Fn()],postInference:[...Xn()]};var RZ=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=RZ(t,["render"]);return i=>{const[[a,o]]=i;return n(Object.assign(Object.assign({},r),{x:a,y:o}),e)}};uT.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const fT=()=>(t,e)=>{const{style:n={}}=e;return[t,ot({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter(([,r])=>typeof r=="function").map(([r,i])=>[r,()=>i])))})]};fT.props={};const IZ={shape:uT},dT=t=>{const{cartesian:e}=t;return e?Ay:(n,r,i,a)=>{const{x:o,y:s}=i,c=Ss(r,i,t),l=Array.from(n,u=>{const f=[+o[u],+s[u]];return[a.map(c(f,u))]});return[n,l]}};dT.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,shape:IZ,channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Fn(),{type:Bh},{type:Fh},{type:fT}]};var jZ=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=jZ(a,["color"]),{color:l=s}=i,[u,...f]=r,d=wi();return d.moveTo(...u),f.forEach(([h,p])=>{d.lineTo(h,p)}),d.closePath(),te(n.createElement("path",{})).call(Xt,c).style("d",d.toString()).style("stroke",l||s).style("fill",l||s).style("fillOpacity",.4).style("transform",o).call(Xt,t).node()}};hT.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const pT={density:hT},vT=()=>(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]};vT.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,shape:pT,channels:[...Rr({shapes:Object.keys(pT)}),{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:[...Fn(),{type:yu},{type:_s}],postInference:[...Xn(),...Bc()],interaction:{shareTooltip:!0}};const Emt=yg(3);function DZ(t,e=(...r)=>`${r[0]}`,n=16){const r=yg(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 BZ(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 FZ=DZ((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 zZ(t,e){const r=zh(e,256,1).getContext("2d"),i=r.createLinearGradient(0,0,256,1);return BZ(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 GZ(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=FZ(f,1-o,a),g=(d-e)/(n-e);t.globalAlpha=Math.max(g,.001),t.drawImage(v,h,p)}return t}function WZ(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 gT=(t,e)=>{const{gradient:n,opacity:r,maxOpacity:i,minOpacity:a,blur:o,useGradientOpacity:s}=t,c=YZ(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=ai(d,w=>w[2]),x=Ye(d,w=>w[2]),O=g&&y?HZ(g,y,b,x,m,$Z({gradient:n,opacity:r,minOpacity:a,maxOpacity:i,blur:o,useGradientOpacity:s},w=>w===void 0),u):{canvas:null};return te(f.createElement("image",{})).call(Xt,p).style("x",0).style("y",0).style("width",g).style("height",y).style("src",O.canvas).style("transform",v).call(Xt,c).node()}};gT.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const yT={heatmap:gT},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:yT,channels:[...Rr({shapes:Object.keys(yT)}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...Fn(),{type:_s},{type:Dh}],postInference:[...Xn(),..._o()]};const bT=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"];bT.props={};const xT=()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"];xT.props={};const _T=t=>new wr(t);_T.props={};const Gh=Symbol("defaultUnknown");function OT(t,e,n){for(let r=0;r`${e}`:typeof t=="object"?e=>JSON.stringify(e):e=>e}class Wh extends tu{getDefaultOptions(){return{domain:[],range:[],unknown:Gh}}constructor(e){super(e)}map(e){return this.domainIndexMap.size===0&&OT(this.domainIndexMap,this.getDomain(),this.domainKey),wT({value:this.domainKey(e),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(e){return this.rangeIndexMap.size===0&&OT(this.rangeIndexMap,this.getRange(),this.rangeKey),wT({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=ST(n),this.rangeKey=ST(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 Wh(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 MT=t=>new Wh(t);MT.props={};function ET({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function VZ({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function XZ({map:t,initKey:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function UZ(t){return typeof t=="object"?t.valueOf():t}class AT extends Map{constructor(e){if(super(),this.map=new Map,this.initKey=UZ,e!==null)for(const[n,r]of e)this.set(n,r)}get(e){return super.get(ET({map:this.map,initKey:this.initKey},e))}has(e){return super.has(ET({map:this.map,initKey:this.initKey},e))}set(e,n){return super.set(VZ({map:this.map,initKey:this.initKey},e),n)}delete(e){return super.delete(XZ({map:this.map,initKey:this.initKey},e))}}function qZ(t){const e=Math.min(...t);return t.map(n=>n/e)}function KZ(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 ZZ(t){return Math.round(t*1e12)/1e12}function QZ(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:a,round:o,align:s}=t,c=e.length,l=KZ(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=qZ(l),m=y.reduce((N,k)=>N+k),b=g/m,x=new AT(e.map((N,k)=>{const P=y[k]*b;return[N,o?Math.floor(P):P]})),_=new AT(e.map((N,k)=>{const T=y[k]*b+v;return[N,o?Math.floor(T):T]})),O=Array.from(_.values()).reduce((N,k)=>N+k),S=(d-(O-O/c*i))*s,M=u+S;let E=o?Math.round(M):M;const A=new Array(c);for(let N=0;Nd+b*u);return{valueStep:u,valueBandWidth:f,adjustedRange:y}}class Oo extends Wh{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:Gh,flex:[]}}constructor(e){super(e)}clone(){return new Oo(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}=JZ({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 PT=t=>new Oo(t);PT.props={};class Hh extends tu{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:Ng}}map(e){return qd(e)?e:this.options.unknown}invert(e){return this.map(e)}clone(){return new Hh(this.options)}getTicks(){const{domain:e,tickCount:n,tickMethod:r}=this.options,[i,a]=e;return!yc(i)||!yc(a)?[]:r(i,a,n)}}const TT=t=>new Hh(t);TT.props={};class Zy extends Oo{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:Gh,paddingInner:1,paddingOuter:0}}constructor(e){super(e)}getPaddingInner(){return 1}clone(){return new Zy(this.options)}update(e){super.update(e)}getPaddingOuter(){return this.options.padding}}const kT=t=>new Zy(t);kT.props={};var CT=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,wo="\\d\\d?",So="\\d\\d",tQ="\\d{3}",eQ="\\d{4}",Ou="[^\\s]+",LT=/\[([^]*?)\]/gm;function NT(t,e){for(var n=[],r=0,i=t.length;r-1?i:null}};function Ms(t){for(var e=[],n=1;n3?0:(t-t%10!==10?1:0)*t%10]}},Yh=Ms({},DT),iQ=function(t){return Yh=Ms(Yh,t)},BT=function(t){return t.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},Ur=function(t,e){for(e===void 0&&(e=2),t=String(t);t.length0?"-":"+")+Ur(Math.floor(Math.abs(e)/60)*100+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+Ur(Math.floor(Math.abs(e)/60),2)+":"+Ur(Math.abs(e)%60,2)}},FT=function(t){return+t-1},zT=[null,wo],GT=[null,Ou],WT=["isPm",Ou,function(t,e){var n=t.toLowerCase();return n===e.amPm[0]?0:n===e.amPm[1]?1:null}],HT=["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}],oQ={D:["day",wo],DD:["day",So],Do:["day",wo+Ou,function(t){return parseInt(t,10)}],M:["month",wo,FT],MM:["month",So,FT],YY:["year",So,function(t){var e=new Date,n=+(""+e.getFullYear()).substr(0,2);return+(""+(+t>68?n-1:n)+t)}],h:["hour",wo,void 0,"isPm"],hh:["hour",So,void 0,"isPm"],H:["hour",wo],HH:["hour",So],m:["minute",wo],mm:["minute",So],s:["second",wo],ss:["second",So],YYYY:["year",eQ],S:["millisecond","\\d",function(t){return+t*100}],SS:["millisecond",So,function(t){return+t*10}],SSS:["millisecond",tQ],d:zT,dd:zT,ddd:GT,dddd:GT,MMM:["month",Ou,RT("monthNamesShort")],MMMM:["month",Ou,RT("monthNames")],a:WT,A:WT,ZZ:HT,Z:HT},$h={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"},sQ=function(t){return Ms($h,t)},YT=function(t,e,n){if(e===void 0&&(e=$h.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=$h[e]||e;var r=[];e=e.replace(LT,function(a,o){return r.push(o),"@@@"});var i=Ms(Ms({},Yh),n);return e=e.replace(CT,function(a){return aQ[a](t,i)}),e.replace(/@@@/g,function(){return r.shift()})};function cQ(t,e,n){if(n===void 0&&(n={}),typeof e!="string")throw new Error("Invalid format in fecha parse");if(e=$h[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(LT,function(x,_){return o.push(BT(_)),"@@@"}),c={},l={};s=BT(s).replace(CT,function(x){var _=oQ[x],O=_[0],w=_[1],S=_[3];if(c[O])throw new Error("Invalid format. "+O+" specified twice in format");return c[O]=!0,S&&(l[S]=!0),a.push(_),"("+w+")"}),Object.keys(l).forEach(function(x){if(!c[x])throw new Error("Invalid format. "+x+" 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=Ms(Ms({},Yh),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 Amt={format:YT,parse:cQ,defaultI18n:DT,setGlobalDateI18n:iQ,setGlobalDateMasks:sQ},Pmt=null;const wu=1e3,Su=wu*60,Mu=Su*60,Es=Mu*24,Eu=Es*7,$T=Es*30,VT=Es*365;function Ar(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()),uQ=Ar(wu,t=>{t.setMilliseconds(0)},(t,e=1)=>{t.setTime(+t+wu*e)},t=>t.getSeconds()),fQ=Ar(Su,t=>{t.setSeconds(0,0)},(t,e=1)=>{t.setTime(+t+Su*e)},t=>t.getMinutes()),dQ=Ar(Mu,t=>{t.setMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+Mu*e)},t=>t.getHours()),hQ=Ar(Es,t=>{t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Es*e)},t=>t.getDate()-1),XT=Ar($T,t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e=1)=>{const n=t.getMonth();t.setMonth(n+e)},t=>t.getMonth()),pQ=Ar(Eu,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=XT.floor(t),n=new Date(+t);return Math.floor((+n-+e)/Eu)}),vQ=Ar(VT,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()),UT={millisecond:lQ,second:uQ,minute:fQ,hour:dQ,day:hQ,week:pQ,month:XT,year:vQ},gQ=Ar(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),yQ=Ar(wu,t=>{t.setUTCMilliseconds(0)},(t,e=1)=>{t.setTime(+t+wu*e)},t=>t.getUTCSeconds()),mQ=Ar(Su,t=>{t.setUTCSeconds(0,0)},(t,e=1)=>{t.setTime(+t+Su*e)},t=>t.getUTCMinutes()),bQ=Ar(Mu,t=>{t.setUTCMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+Mu*e)},t=>t.getUTCHours()),xQ=Ar(Es,t=>{t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Es*e)},t=>t.getUTCDate()-1),qT=Ar($T,t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e=1)=>{const n=t.getUTCMonth();t.setUTCMonth(n+e)},t=>t.getUTCMonth()),_Q=Ar(Eu,t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Eu*e)},t=>{const e=qT.floor(t),n=new Date(+t);return Math.floor((+n-+e)/Eu)}),OQ=Ar(VT,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()),KT={millisecond:gQ,second:yQ,minute:mQ,hour:bQ,day:xQ,week:_Q,month:qT,year:OQ};function wQ(t){const e=t?KT:UT,{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 ZT(t,e,n,r,i){const a=+t,o=+e,{tickIntervals:s,year:c,millisecond:l}=wQ(i),u=([g,y])=>g.duration*y,f=r?(o-a)/r:n||5,d=r||(o-a)/f,h=s.length,p=Eg(s,d,0,h,u);let v;if(p===h){const g=mw(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]=ZT(o,s,n,r,i),u=c.range(o,new Date(+s+1),l,!0);return a?u.reverse():u},MQ=(t,e,n,r,i)=>{const a=t>e,o=a?e:t,s=a?t:e,[c,l]=ZT(o,s,n,r,i),u=[c.floor(o,l),c.ceil(s,l)];return a?u.reverse():u};function EQ(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 MQ}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?KT:UT,i=n?AQ:ds;return a=>YT(i(a),e||EQ(a,r))}clone(){return new Qy(this.options)}}const QT=t=>new Qy(t);QT.props={};const JT=t=>e=>-t(-e),Jy=(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?JT(r):r},tm=(t,e)=>{const n=t===Math.E?Math.exp:r=>Un(t,r);return e?JT(n):n},PQ=(t,e,n,r=10)=>{const i=t<0,a=tm(r,i),o=Jy(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=Jy(r,i),o=tm(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 em extends Zd{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:eu,tickMethod:PQ,tickCount:5}}chooseNice(){return TQ}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[Jy(e,r),tm(e,r)]}clone(){return new em(this.options)}}const tk=t=>new em(t);tk.props={};const kQ=t=>e=>e<0?-Un(-e,t):Un(e,t),CQ=t=>e=>e<0?-Un(-e,1/t):Un(e,1/t),LQ=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class Vh extends Zd{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:eu,tickMethod:hs,tickCount:5}}constructor(e){super(e)}chooseTransforms(){const{exponent:e}=this.options;if(e===1)return[ds,ds];const n=e===.5?LQ:kQ(e),r=CQ(e);return[n,r]}clone(){return new Vh(this.options)}}const ek=t=>new Vh(t);ek.props={};class nm extends Vh{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:eu,tickMethod:hs,tickCount:5,exponent:.5}}constructor(e){super(e)}update(e){super.update(e)}clone(){return new nm(this.options)}}const nk=t=>new nm(t);nk.props={};const rk=t=>new xc(t);rk.props={};const ik=t=>new rh(t);ik.props={};const ak=t=>new nh(t);ak.props={};const NQ=t=>e=>{const n=t(e);return yc(n)?Math.round(n):n};function RQ(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?NQ(o):o;this.output=mc(l,c,i,r)},n.prototype.invert=void 0}}var IQ=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},rm;function jQ(t){return[t(0),t(1)]}const DQ=t=>{const[e,n]=t;return mc(bc(0,1),Ud(e,n))};let im=rm=class extends wr{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:ds,tickMethod:hs,tickCount:5}}constructor(e){super(e)}clone(){return new rm(this.options)}};im=rm=IQ([RQ(jQ,DQ)],im);const ok=t=>new im(t);ok.props={};const sk=t=>new iu(t);sk.props={};function am({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,strokeWidth:0,connectorStroke:r,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:r,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,strokeWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:r,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:r,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:r,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:r,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:r,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:r,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:r,endMarkerFillOpacity:.95}},axis:{arrow:!1,gridLineDash:[3,4],gridLineWidth:.5,gridStroke:e,gridStrokeOpacity:d,labelAlign:"horizontal",labelFill:e,labelOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing: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"},axisLeft:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"left",titleSpacing:12,titleTextBaseline:"middle",titleDirection:"vertical",titleTransformOrigin:"center"},axisRight:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"right",titleSpacing:12,titleTextBaseline:"top",titleDirection:"vertical",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleSpacing:0},axisArc:{title:!1,titlePosition:"inner",line:!1,tick:!0,labelSpacing:4},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:e,itemLabelFillOpacity:c,itemLabelFontSize:12,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[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 BQ=am({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}),om=t=>ot({},BQ,t);om.props={};const ck=t=>ot({},om(),{category10:"category10",category20:"category20"},t);ck.props={};const FQ=am({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}),lk=t=>ot({},FQ,{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),uk=t=>Object.assign({},lk(),{category10:"category10",category20:"category20"},t);uk.props={};const zQ=am({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}),fk=t=>ot({},zQ,{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);fk.props={};const dk=t=>(...e)=>{const n=po(Object.assign({},{crossPadding:50},t))(...e);return Tw(n,t),n};dk.props=Object.assign(Object.assign({},po.props),{defaultPosition:"bottom"});function Lmt(){}const hk=t=>(...e)=>{const n=po(Object.assign({},{crossPadding:10},t))(...e);return Tw(n,t),n};hk.props=Object.assign(Object.assign({},po.props),{defaultPosition:"left"});var sm=function(){},GQ=function(t,e,n){var r=t,i=wn(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=I(HQ(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,lt([],I(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 pn(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=I(this.getFollowingPageDiff(n),2),f=u[0],d=u[1];this.playState="running";var h=wO(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:kn(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:kn(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(Mi.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)?Xl(r):ho(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=I(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,x=m.height,_=Math.max(g,u,b),O=s==="horizontal"?{offset:[[0,0],[g/2+c,0],[g+u+c*2,0]],textAlign:"start"}:{offset:[[_/2,-y-c],[_/2,0],[_/2,x+c]],textAlign:"center"},w=I(O.offset,3),S=I(w[0],2),M=S[0],E=S[1],A=I(w[1],2),N=A[0],k=A[1],P=I(w[2],2),T=P[0],L=P[1],j=O.textAlign,D=a.querySelector("text");D&&(D.style.textAlign=j),r.setLocalPosition(M,E),a.setLocalPosition(N,k),i.setLocalPosition(T,L)},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(Mi.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(Mi.controller,"g");if(jd(l.node(),c),!!c){var u=de(this.attributes,"button"),f=de(this.attributes,"pageNum"),d=I(Ca(u),2),h=d[0],p=d[1],v=h.size,g=Ue(h,["size"]),y=!l.select(Mi.prevBtnGroup.class).node(),m=l.maybeAppendByClassName(Mi.prevBtnGroup,"g").styles(p);this.prevBtnGroup=m.node();var b=m.maybeAppendByClassName(Mi.prevBtn,"path"),x=l.maybeAppendByClassName(Mi.nextBtnGroup,"g").styles(p);this.nextBtnGroup=x.node();var _=x.maybeAppendByClassName(Mi.nextBtn,"path");[b,_].forEach(function(w){w.styles(Q(Q({},g),{transformOrigin:"center"})),pg(w.node(),v,!0)});var O=l.maybeAppendByClassName(Mi.pageInfoGroup,"g");this.pageInfoGroup=O.node(),O.maybeAppendByClassName(Mi.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=ce(r);this.renderClipPath(i),this.renderController(i),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},e.prototype.bindEvents=function(){var n=this,r=V2(function(){return n.render(n.attributes,n)},50);this.playWindow.addEventListener(Qt.INSERTED,r),this.playWindow.addEventListener(Qt.REMOVED,r)},e}(or),oi=bi({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 $Q(t){var e=t.querySelector(oi.marker.class);return e?e.style:{}}var VQ=function(t){Bt(e,t);function e(n){return t.call(this,n,{span:[1,1],marker:function(){return new jl({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=I(pr(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=I(this.spacing,2),h=d[0],p=d[1];if(a){var v=a-i-h-p,g=I(this.span,2),y=g[0],m=g[1];n=I([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=I(pr(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=I(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=$Q(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=de(this.attributes,"marker");this.markerGroup=n.maybeAppendByClassName(oi.markerGroup,"g").style("zIndex",0),Vr(!!i,this.markerGroup,function(){var o=r.markerGroup.node(),s=o.getElementsByClassName(oi.marker.name)[0],c=i();s?c.nodeName===s.nodeName?(yW(s,c),ce(s).styles(a)):(s.remove(),ce(c).attr("className",oi.marker.name).styles(a),o.appendChild(c)):(ce(c).attr("className",oi.marker.name).styles(a),o.appendChild(c)),r.markerGroup.node().scale(1/r.markerGroup.node().getScale()[0]),pg(r.markerGroup.node(),r.scaleSize,!0)})},e.prototype.renderLabel=function(n){var r=de(this.attributes,"label"),i=r.text,a=Ue(r,["text"]);this.labelGroup=n.maybeAppendByClassName(oi.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(oi.label,function(){return fs(i)}).styles(a)},e.prototype.renderValue=function(n){var r=this,i=de(this.attributes,"value"),a=i.text,o=Ue(i,["text"]);this.valueGroup=n.maybeAppendByClassName(oi.valueGroup,"g").style("zIndex",0),Vr(this.showValue,this.valueGroup,function(){r.valueGroup.maybeAppendByClassName(oi.value,function(){return fs(a)}).styles(o)})},e.prototype.renderBackground=function(n){var r=this.shape,i=r.width,a=r.height,o=de(this.attributes,"background");this.background=n.maybeAppendByClassName(oi.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(oi.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=I(n.position,3),s=o[0],c=o[1],l=o[2],u=a/2;this.markerGroup.styles({x:s,y:u}),this.labelGroup.styles({x:c,y:u}),bg(this.labelGroup.select(oi.label.class).node(),Math.ceil(r)),this.showValue&&(this.valueGroup.styles({x:l,y:u}),bg(this.valueGroup.select(oi.value.class).node(),Math.ceil(i)))},e.prototype.render=function(n,r){var i=ce(r);this.renderMarker(i),this.renderLabel(i),this.renderValue(i),this.renderBackground(i),this.adjustLayout()},e}(or),As=bi({page:"item-page",navigator:"navigator",item:"item"},"items"),pk=function(t,e,n){return n===void 0&&(n=!0),t?e(t):n},XQ=function(t){Bt(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:sm,mouseenter:sm,mouseleave:sm})||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=de(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=I(h,2),v=p[0],g=p[1];return[v,xi(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=I(this.navigatorShape,1),l=c[0],u=I(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),x=g%h,_=n.ifHorizontal(d,f),O=[Math.floor(x/_),x%_];i==="vertical"&&O.reverse();var w=I(O,2),S=w[0],M=w[1],E=(a-l-(d-1)*s)/d,A=v.getBBox().height,N=I([0,0],2),k=N[0],P=N[1];return i==="horizontal"?(y=I([p,S*(A+o)],2),k=y[0],P=y[1],p=M===d-1?0:p+E+s):(m=I([M*(E+s),p],2),k=m[0],P=m[1],p=S===f-1?0:p+A+o),{page:b,index:g,row:S,col:M,pageIndex:x,width:E,height:A,x:k,y:P}})},e.prototype.getFlexLayout=function(){var n=this.attributes,r=n.width,i=n.height,a=n.rowPadding,o=n.colPadding,s=I(this.navigatorShape,1),c=s[0],l=I(this.grid,2),u=l[0],f=l[1],d=I([r-c,i],2),h=d[0],p=d[1],v=I([0,0,0,0,0,0,0,0],8),g=v[0],y=v[1],m=v[2],b=v[3],x=v[4],_=v[5],O=v[6],w=v[7];return this.pageViews.children.map(function(S,M){var E,A,N,k,P=S.getBBox(),T=P.width,L=P.height,j=O===0?0:o,D=O+j+T;if(D<=h&&pk(x,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 oa(i,n,r)},e.prototype.flattenPage=function(n){n.querySelectorAll(As.item.class).forEach(function(r){n.appendChild(r)}),n.querySelectorAll(As.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);ce(n).selectAll(As.item.class).data(this.renderData,function(c){return c.id}).join(function(c){return c.append(function(l){var u=l.style;return new VQ({style:u})}).attr("className",As.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=I(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(WQ(this.itemsLayout,"page")).map(function(a){var o=I(a,2),s=o[0],c=o[1];return{page:s,layouts:c}}),i=lt([],I(this.navigator.getContainer().children),!1);r.forEach(function(a){var o=a.layouts,s=n.pageViews.appendChild(new dr({className:As.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),GQ(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=de(this.attributes,"nav"),a=Ta({orientation:r},i),o=this;return n.selectAll(As.navigator.class).data(["nav"]).join(function(s){return s.append(function(){return new YQ({style:a})}).attr("className",As.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(ce(r));this.renderItems(a.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(n,r){var i=new nn(n,{detail:r});this.dispatchEvent(i)},e}(or),UQ=function(t){Bt(e,t);function e(n){return t.call(this,n,RY)||this}return e.prototype.renderTitle=function(n,r,i){var a=this.attributes,o=a.showTitle,s=a.titleText,c=de(this.attributes,"title"),l=I(Ca(c),2),u=l[0],f=l[1];this.titleGroup=n.maybeAppendByClassName(sr.titleGroup,"g").styles(f);var d=Q(Q({width:r,height:i},u),{text:o?s:""});this.title=this.titleGroup.maybeAppendByClassName(sr.title,function(){return new nw({style:d})}).update(d)},e.prototype.renderItems=function(n,r){var i=r.x,a=r.y,o=r.width,s=r.height,c=de(this.attributes,"title",!0),l=I(Ca(c),2),u=l[0],f=l[1],d=Q(Q({},u),{width:o,height:s,x:0,y:0});this.itemsGroup=n.maybeAppendByClassName(sr.itemsGroup,"g").styles(Q({x:i,y:a},f));var h=this;this.itemsGroup.selectAll(sr.items.class).data(["items"]).join(function(p){return p.append(function(){return new XQ({style:d})}).attr("className",sr.items.name).each(function(){h.items=ce(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().setLocalPosition(i,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 pn(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):BW(i,a)},e.prototype.render=function(n,r){var i=n.width,a=n.height,o=ce(r);this.renderTitle(o,i,a),this.renderItems(o,this.availableSpace),this.adjustLayout()},e}(or);function qQ(t){if(Hl(t)){var e=t;return e[e.length-1]}}var KQ=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 QQ(t,e){const{scales:n,library:r,markState:i}=e,[a,o]=ZQ(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)||qQ(d.split(".")),m=typeof c=="function"?c(h):c;return()=>lZ(y,{color:h.color})(0,0,m)},u=d=>`${o[d]}`;return ia(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 JQ(t){const e=ia(t,"opacity");if(e){const{range:n}=e.getOptions();return(r,i)=>n[i]}}function tJ(t,e){const n=ia(t,"size");return n instanceof Hh?n.map(NaN)*2:e}function eJ(t,e){const{labelFormatter:n=d=>`${d}`}=t,{scales:r,theme:i}=e,a=i.legendCategory.itemMarkerSize,o=tJ(r,a),s={itemMarker:QQ(Object.assign(Object.assign({},t),{itemMarkerSize:o}),e),itemMarkerSize:o,itemMarkerOpacity:JQ(r)},c=typeof n=="string"?uo(n):n,l=ia(r,"color"),u=WH(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 nJ(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}=Aw(t,e,n);return{width:i,height:a}}const cm=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:a,size:o,title:s,cols:c,itemMarker:l}=t,u=KQ(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}=nJ(h,t,cm),m=Mw(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:Qd(s)}),eJ(t,d)),{legendCategory:x={}}=p,_=Jd(Object.assign({},x,b,u)),O=new FH({style:Object.assign(Object.assign({x:v.x,y:v.y,width:v.width,height:v.height},m),{subOptions:_})});return O.appendChild(new UQ({className:"legend-category",style:_})),O}};cm.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const vk=t=>()=>new dr;vk.props={};var rJ=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