ag-charts-enterprise
Version:
Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue
1 lines • 442 kB
JavaScript
var PS=Object.defineProperty,ES=Object.getOwnPropertyDescriptor,h=(e,t,i,o)=>{for(var s=o>1?void 0:o?ES(t,i):t,a=e.length-1,n;a>=0;a--)(n=e[a])&&(s=(o?n(t,i,s):n(s))||s);return o&&s&&PS(t,i,s),s};import{_ModuleSupport as wS}from"ag-charts-community";import{_ModuleSupport as _S}from"ag-charts-community";import{arrayOfDefs as Qs,boolean as Tp,callback as Ip,constant as Qo,date as BS,fontOptionsDef as Mp,number as Et,or as GS,positiveNumber as Lp,ratio as wt,required as es,string as cr,union as ea}from"ag-charts-core";import{_ModuleSupport as FS}from"ag-charts-community";import{isNumberEqual as Cp}from"ag-charts-core";function pr(e,t,i){const o=(a,n,r,l)=>{let c=e[0];for(let p=a;r>0?p<=n:p>n;p+=r){const d=e[p];if(l(c,d))return!0;c=d}return!1},s=Math.floor(e.length/2);return o(t,s,t,i)?!0:o(e.length-t,s,-t,i)}import{_ModuleSupport as VS}from"ag-charts-community";var{OR:WS,POSITIVE_NUMBER:KS,NAN:zS,AxisInterval:$S,TempValidate:HS}=VS,hr=class extends $S{};h([HS(WS(KS,zS))],hr.prototype,"minSpacing",2);import{_ModuleSupport as dr}from"ag-charts-community";import{countFractionDigits as YS,isNumberEqual as vo}from"ag-charts-core";import{_ModuleSupport as Pp}from"ag-charts-community";import{isArray as XS,isNumberEqual as Ep}from"ag-charts-core";import{_ModuleSupport as US}from"ag-charts-community";var{BaseProperties:wp,ChartAxisDirection:qS,ARRAY:jS,BOOLEAN:ur,COLOR_STRING:fr,FONT_STYLE:JS,FONT_WEIGHT:ZS,LINE_DASH:QS,NUMBER:_p,OBJECT:eb,POSITIVE_NUMBER:tb,RATIO:Bp,STRING:Gp,UNION:Fp,AND:ib,COLOR_STRING_ARRAY:ob,TempValidate:Re,MATCHING_CROSSLINE_TYPE:Vp,createId:sb,Group:gr}=US,_t=class extends wp{constructor(){super(...arguments),this.fontSize=14,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)"}};h([Re(ur,{optional:!0})],_t.prototype,"enabled",2),h([Re(Gp,{optional:!0})],_t.prototype,"text",2),h([Re(JS,{optional:!0})],_t.prototype,"fontStyle",2),h([Re(ZS,{optional:!0})],_t.prototype,"fontWeight",2),h([Re(tb)],_t.prototype,"fontSize",2),h([Re(Gp)],_t.prototype,"fontFamily",2),h([Re(_p)],_t.prototype,"padding",2),h([Re(fr,{optional:!0})],_t.prototype,"color",2),h([Re(ur,{optional:!0})],_t.prototype,"parallel",2);var et=class extends wp{constructor(){super(...arguments),this.id=sb(this),this.defaultColorRange=[],this.shape="polygon",this.label=new _t,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.direction=qS.X,this.axisInnerRadius=0,this.axisOuterRadius=0,this.lineGroup=new gr({name:this.id}),this.rangeGroup=new gr({name:this.id}),this.labelGroup=new gr({name:this.id}),this._isRange=void 0}assignCrossLineGroup(e,t){e!==this._isRange&&(e?this.rangeGroup.appendChild(t):this.lineGroup.appendChild(t)),this._isRange=e}setSectorNodeProps(e){e.fill=this.fill,e.fillOpacity=this.fillOpacity??1,e.stroke=this.stroke,e.strokeOpacity=this.strokeOpacity??1,e.strokeWidth=this.strokeWidth??1,e.lineDash=this.lineDash}setLabelNodeProps(e,t,i,o,s){const{label:a}=this;e.x=t,e.y=i,e.text=a.text,e.textAlign="center",e.textBaseline=o,e.rotation=s,e.rotationCenterX=t,e.rotationCenterY=i,e.fill=a.color,e.fontFamily=a.fontFamily,e.fontSize=a.fontSize,e.fontStyle=a.fontStyle,e.visible=!0}};h([Re(ur,{optional:!0})],et.prototype,"enabled",2),h([Re(Fp(["range","line"],"a crossLine type"))],et.prototype,"type",2),h([Re(ib(Vp("range"),jS.restrict({length:2})),{optional:!0})],et.prototype,"range",2),h([Re(Vp("value"),{optional:!0})],et.prototype,"value",2),h([Re(ob)],et.prototype,"defaultColorRange",2),h([Re(fr,{optional:!0})],et.prototype,"fill",2),h([Re(Bp,{optional:!0})],et.prototype,"fillOpacity",2),h([Re(fr,{optional:!0})],et.prototype,"stroke",2),h([Re(_p,{optional:!0})],et.prototype,"strokeWidth",2),h([Re(Bp,{optional:!0})],et.prototype,"strokeOpacity",2),h([Re(QS,{optional:!0})],et.prototype,"lineDash",2),h([Re(Fp(["polygon","circle"],"a shape"))],et.prototype,"shape",2),h([Re(eb)],et.prototype,"label",2);var{ChartAxisDirection:ab,getCrossLineValue:Wp,validateCrossLineValue:nb,normalizeAngle360:yr,Group:rb,Path:Kp,Sector:lb,RotatableText:cb,ContinuousScale:pb}=Pp,mr=class extends et{constructor(){super(),this.direction=ab.X,this.polygonNode=new Kp,this.sectorNode=new lb,this.lineNode=new Kp,this.crossLineRange=new rb,this.labelNode=new cb,this.ticks=[],this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.crossLineRange.append(this.lineNode),this.labelGroup.append(this.labelNode)}visibilityCheck(){if(!pb.is(this.scale))return!0;const[e,t]=this.scale.domain,i=Wp(this);if(XS(i)){const[o,s]=i;return o>=e&&o<=t&&s>=o&&s<=t}else return i>=e&&i<=t}update(e){const{scale:t}=this;if(!t||!this.isValid()||!nb(Wp(this),t)||!this.visibilityCheck()){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updateLineNode(e),this.updatePolygonNode(e),this.updateSectorNode(e),this.updateLabelNode(e)}updateLineNode(e){const{scale:t,type:i,value:o,lineNode:s}=this;if(!e||i!=="line"||!t){s.visible=!1;return}const a=t.convert(o);if(isNaN(a)){s.visible=!1;return}const{axisInnerRadius:n,axisOuterRadius:r}=this;s.visible=!0,s.stroke=this.stroke,s.strokeOpacity=this.strokeOpacity??1,s.strokeWidth=this.strokeWidth??1,s.fill=void 0,s.lineDash=this.lineDash;const l=r*Math.cos(a),c=r*Math.sin(a),p=n*Math.cos(a),d=n*Math.sin(a);s.path.clear(!0),s.path.moveTo(p,d),s.path.lineTo(l,c),this.assignCrossLineGroup(!1,this.crossLineRange)}updatePolygonNode(e){const{polygonNode:t,range:i,scale:o,shape:s,type:a,ticks:n}=this;if(!e||a!=="range"||s!=="polygon"||!o||!i){t.visible=!1;return}const{axisInnerRadius:r,axisOuterRadius:l}=this,c=n.indexOf(i[0]),p=n.indexOf(i[1]),u=(c<=p?n.slice(c,p+1):n.slice(c).concat(n.slice(0,p+1))).map(y=>o.convert(y));t.visible=!0,this.setSectorNodeProps(t);const{path:f}=t;f.clear(!0),u.forEach((y,g)=>{const m=l*Math.cos(y),S=l*Math.sin(y);g===0?f.moveTo(m,S):f.lineTo(m,S)}),r===0?f.lineTo(0,0):u.slice().reverse().forEach(y=>{const g=r*Math.cos(y),m=r*Math.sin(y);f.lineTo(g,m)}),t.path.closePath(),this.assignCrossLineGroup(!0,this.crossLineRange)}updateSectorNode(e){const{sectorNode:t,range:i,scale:o,shape:s,type:a}=this;if(!e||a!=="range"||s!=="circle"||!o||!i){t.visible=!1;return}const{axisInnerRadius:n,axisOuterRadius:r}=this,l=i.map(d=>o.convert(d)),c=o.step??0,p=o instanceof Pp.BandScale?c/2:0;t.visible=!0,this.setSectorNodeProps(t),t.centerX=0,t.centerY=0,t.innerRadius=n,t.outerRadius=r,t.startAngle=l[0]-p,t.endAngle=l[1]+p,this.assignCrossLineGroup(!0,this.crossLineRange)}updateLabelNode(e){const{label:t,labelNode:i,range:o,scale:s,type:a,ticks:n}=this;if(!e||t.enabled===!1||!t.text||!s||a==="range"&&!o){i.visible=!1;return}i.visible=!0;const{axisInnerRadius:r,axisOuterRadius:l}=this;let c,p,d,u;if(a==="line"){const f=yr(s.convert(this.value)),y=1.5*Math.PI,g=Ep(f,y)||f>y||f<Math.PI/2,m=(r+l)/2*Math.cos(f),S=(r+l)/2*Math.sin(f);c=m+t.padding*Math.cos(f+Math.PI/2),p=S+t.padding*Math.sin(f+Math.PI/2),u=g?"top":"bottom",d=g?f:f-Math.PI}else{const[f,y]=o.map(D=>yr(s.convert(D)));let g=(f+y)/2;f>y&&(g-=Math.PI),g=yr(g);const m=(Ep(g,0)||g>0)&&g<Math.PI;let S;this.shape==="circle"||n.length<3?S=l-t.padding:S=l*Math.cos(Math.PI/n.length)-t.padding,c=S*Math.cos(g),p=S*Math.sin(g),u=m?"bottom":"top",d=m?g-Math.PI/2:g+Math.PI/2}this.setLabelNodeProps(i,c,p,u,d)}};mr.className="AngleCrossLine";var{ChartAxisDirection:hb,NUMBER:zp,UNION:db,ProxyOnWrite:ub,TextWrapper:fb,TextUtils:gb,TempValidate:Sr,toRadians:ta,normalizeAngle360:Oo,normalizeAngle360Inclusive:yb,Path:mb,RotatableText:Sb,Transformable:bb,BBox:Db}=dr,br=class extends dr.AxisLabel{constructor(){super(...arguments),this.orientation="fixed"}};h([Sr(db(["fixed","parallel","perpendicular"],"a label orientation"))],br.prototype,"orientation",2);var ts=class extends dr.PolarAxis{constructor(e,t){super(e,t),this.startAngle=0,this.endAngle=void 0,this.labelData=[],this.tickData=[],this.radiusLine=this.axisGroup.appendChild(new mb),this.includeInvisibleDomains=!0}get direction(){return hb.X}createLabel(){return new br}calculateTickLayout(e){const{nice:t,scale:i}=this,o={nice:t,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0},s=t?i.niceDomain(o,e):e,a=this.generateAngleTicks(s);this.tickData=a;const n=a.map(l=>l.value),r=n.reduce((l,c)=>Math.max(typeof c=="number"?YS(c):0,l),0);return{niceDomain:s,primaryTickCount:void 0,tickDomain:s,ticks:n,fractionDigits:r,bbox:this.getBBox()}}update(){super.update(),this.updateRadiusLine()}normalizedAngles(){const e=Oo(-Math.PI/2+ta(this.startAngle)),t=this.endAngle!=null?yb(ta(this.endAngle)-ta(this.startAngle)):2*Math.PI,i=e+t;return[e,i]}computeRange(){this.range=this.normalizedAngles()}updateSelections(){const e=this.tickData;this.gridLineGroupSelection.update(this.gridLength&&this.gridLine.enabled?e:[]),this.tickLineGroupSelection.update(this.tick.enabled?e:[]),this.tickLabelGroupSelection.update(this.label.enabled?e:[]),this.gridLineGroupSelection.cleanup(),this.tickLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup()}updatePosition(){const{translation:e,axisGroup:t,gridGroup:i,crossLineRangeGroup:o,crossLineLineGroup:s,crossLineLabelGroup:a}=this,n=Math.floor(e.x),r=Math.floor(e.y);t.translationX=n,t.translationY=r,i.translationX=n,i.translationY=r,o.translationX=n,o.translationY=r,s.translationX=n,s.translationY=r,a.translationX=n,a.translationY=r}updateRadiusLine(){const e=this.radiusLine,{path:t}=e;t.clear(!0);const{points:i,closePath:o}=this.getAxisLinePoints();i.forEach(({x:s,y:a,moveTo:n,arc:r,radius:l=0,startAngle:c=0,endAngle:p=0})=>{r?t.arc(s,a,l,c,p):n?t.moveTo(s,a):t.lineTo(s,a)}),o&&t.closePath(),e.visible=this.line.enabled,e.stroke=this.line.stroke,e.strokeWidth=this.line.width,e.fill=void 0}getAxisLinePoints(){const{scale:e,shape:t,gridLength:i}=this,[o,s]=this.range,a=vo(s-o,2*Math.PI),n=[];if(t==="circle")a?n.push({x:i,y:0,moveTo:!0},{x:0,y:0,radius:i,startAngle:0,endAngle:2*Math.PI,arc:!0,moveTo:!1}):n.push({x:i*Math.cos(o),y:i*Math.sin(o),moveTo:!0},{x:0,y:0,radius:i,startAngle:Oo(o),endAngle:Oo(s),arc:!0,moveTo:!1});else if(t==="polygon"){const r=e.ticks({nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.map(l=>e.convert(l));r&&r.length>2&&r.forEach((l,c)=>{const p=i*Math.cos(l),d=i*Math.sin(l),u=c===0;n.push({x:p,y:d,moveTo:u})})}return{points:n,closePath:a}}updateGridLines(){const{scale:e,gridLength:t,gridLine:{style:i,width:o},innerRadiusRatio:s}=this;if(!(i&&t>0))return;const a=t*s,n=i.length;this.gridLineGroupSelection.each((r,l,c)=>{const{value:p}=l,{stroke:d,lineDash:u}=i[c%n],f=e.convert(p);r.x1=a*Math.cos(f),r.y1=a*Math.sin(f),r.x2=t*Math.cos(f),r.y2=t*Math.sin(f),r.stroke=d,r.strokeWidth=o,r.lineDash=u,r.fill=void 0}),this.gridLineGroupSelection.cleanup()}updateLabels(){const{label:e,tickLabelGroupSelection:t}=this;t.each((i,o,s)=>{const a=this.labelData[s];if(!a||a.hidden){i.visible=!1;return}i.text=a.text,i.setFont(e),i.fill=e.color,i.x=a.x,i.y=a.y,i.textAlign=a.textAlign,i.textBaseline=a.textBaseline,i.visible=!0,a.rotation?(i.rotation=a.rotation,i.rotationCenterX=a.x,i.rotationCenterY=a.y):i.rotation=0})}updateTickLines(){const{scale:e,gridLength:t,tick:i,tickLineGroupSelection:o}=this;o.each((s,a)=>{const{value:n}=a,r=e.convert(n),l=Math.cos(r),c=Math.sin(r);s.x1=t*l,s.y1=t*c,s.x2=(t+i.size)*l,s.y2=(t+i.size)*c,s.stroke=i.stroke,s.strokeWidth=i.width})}createLabelNodeData(e,t,i){const{label:o,gridLength:s,scale:a,tick:n}=this;if(!o.enabled)return[];const r=new Sb,l=i.x-this.translation.x,c=i.x+i.width-this.translation.x,p=e.map((d,u)=>{const{value:f}=d,y=s+o.spacing+n.size,g=a.convert(f),m=Math.cos(g),S=Math.sin(g),D=y*m,b=y*S,{textAlign:v,textBaseline:R}=this.getLabelAlign(g),T=u===e.length-1&&f!==e[0]&&vo(Oo(g),Oo(a.convert(e[0]))),O=this.getLabelRotation(g);let x=this.formatTick(f,u,a.domain);r.text=x,r.x=D,r.y=b,r.setFont(o),r.textAlign=v,r.textBaseline=R,r.rotation=O,O&&(r.rotationCenterX=D,r.rotationCenterY=b);let A=O?bb.toCanvas(r):r.getBBox();if(A&&t.hideWhenNecessary&&!O){const k=l-A.x,I=A.x+A.width-c,N=1;if(k>N||I>N){const L=A.width-Math.max(k,I);x=fb.wrapText(x,{maxWidth:L,font:o,textWrap:"never"}),x===gb.EllipsisChar&&(x=""),r.text=x,A=r.getBBox()}}return{text:x,x:D,y:b,textAlign:v,textBaseline:R,hidden:x===""||d.hidden||T,rotation:O,box:A}});return o.avoidCollisions&&this.avoidLabelCollisions(p),p}computeLabelsBBox(e,t){this.labelData=this.createLabelNodeData(this.tickData,e,t);const i=this.labelData.map(({box:o})=>o).filter(o=>o!=null);return!this.label.enabled||i.length===0?null:Db.merge(i)}getLabelOrientation(){const{label:e}=this;return e instanceof br?e.orientation:"fixed"}getLabelRotation(e){let t=ta(this.label.rotation??0);e=Oo(e);const i=this.getLabelOrientation();return i==="parallel"?(t+=e,e>=0&&e<Math.PI?t-=Math.PI/2:t+=Math.PI/2):i==="perpendicular"&&(t+=e,e>=Math.PI/2&&e<1.5*Math.PI&&(t+=Math.PI)),t}getLabelAlign(e){const t=Math.cos(e),i=Math.sin(e);let o,s;const a=this.getLabelOrientation(),n=vo(t,0),r=vo(i,0),l=vo(t,1),c=vo(i,-1),p=t>0&&!n,d=i>0&&!r;return a==="parallel"?(o="center",s=l&&r||d?"top":"bottom"):a==="perpendicular"?(o=c||p?"left":"right",s="middle"):(o="right",n?o="center":p&&(o="left"),s="bottom",r?s="middle":d&&(s="top")),{textAlign:o,textBaseline:s}}updateCrossLines(){const{shape:e,gridLength:t,innerRadiusRatio:i}=this;this.crossLines.forEach(o=>{o instanceof mr&&(o.ticks=this.tickData.map(s=>s.value),o.shape=e,o.axisOuterRadius=t,o.axisInnerRadius=t*i)}),super.updateCrossLines()}};ts.CrossLineConstructor=mr,h([ub("rotation"),Sr(zp)],ts.prototype,"startAngle",2),h([Sr(zp,{optional:!0})],ts.prototype,"endAngle",2);var{RATIO:$p,OBJECT:xb,TempValidate:Dr,CategoryScale:vb}=FS,Wi=class extends ts{constructor(e){super(e,new vb),this.groupPaddingInner=0,this.paddingInner=0,this.interval=new hr}generateAngleTicks(){const{scale:e,gridLength:t}=this,{values:i,minSpacing:o}=this.interval,s=i??e.ticks({nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})??[];if(s.length<2||o==null)return s.map(c=>({value:c,visible:!0}));const a=s[0],n=e.convert(a),r=t*Math.cos(n),l=t*Math.sin(n);for(let c=1;c<s.length-1;c++){const p=s[c],d=e.convert(p);if(d-n>Math.PI)break;const u=t*Math.cos(d),f=t*Math.sin(d);if(Math.sqrt((u-r)**2+(f-l)**2)>o){const g=new Set([a]);return pr(s,c,(m,S)=>{g.add(S)}),s.map(m=>{const S=g.has(m);return{value:m,visible:S}})}}return[{value:a,visible:!0}]}avoidLabelCollisions(e){const{minSpacing:t}=this.label;if(e.length<3)return;const i=(l,c)=>{if(l.hidden||c.hidden)return!1;if(t==null)return l.box.collidesBBox(c.box);const p=l.box.clone().grow(t/2),d=c.box.clone().grow(t/2);return p.collidesBBox(d)},o=e[0],s=e.at(-1),a=new Set([o]),n=Cp(o.x,s.x)&&Cp(o.y,s.y),r=Math.floor(e.length/2);for(let l=1;l<=r;l++){const c=n?e.slice(0,-1):e;if(!pr(c,l,i)){pr(c,l,(d,u)=>{a.add(u)});break}}e.forEach(l=>{a.has(l)||(l.hidden=!0,l.box=void 0)})}};Wi.className="AngleCategoryAxis",Wi.type="angle-category",h([Dr($p)],Wi.prototype,"groupPaddingInner",2),h([Dr($p)],Wi.prototype,"paddingInner",2),h([Dr(xb)],Wi.prototype,"interval",2);import{_ModuleSupport as Ob}from"ag-charts-community";import{isNumberEqual as Hp}from"ag-charts-core";import{_ModuleSupport as kb}from"ag-charts-community";import{isNumberEqual as Rb}from"ag-charts-core";var{range:Yp,isDenseInterval:Nb,LinearScale:xr}=kb,Xp=class Ap extends xr{constructor(){super(...arguments),this.arcLength=0}static getNiceStepAndTickCount(t,i){const[o,s]=i;let a=xr.getTickStep(o,s,t);const n=isNaN(t.maxTickCount)?1/0:t.maxTickCount,r=Math.abs(s-o)/a;let l=Math.pow(2,Math.ceil(Math.log(r)/Math.log(2)));return l>n&&(l/=2,a*=2),{count:l,step:a}}ticks(t,i=this.domain){const{arcLength:o}=this;if(!i||i.length<2||i.some(c=>!isFinite(c))||o<=0)return[];const{nice:s,interval:a}=t,[n,r]=i;if(a){const c=Math.abs(a),p=this.getPixelRange();if(!Nb((r-n)/c,p))return Yp(n,r,c)}let l;if(s&&this.hasNiceRange()){const c=super.niceDomain(t,i);l=Ap.getNiceStepAndTickCount(t,c).step}else l=xr.getTickStep(n,r,t);return Yp(n,r,l)}hasNiceRange(){const t=this.range.slice().sort((o,s)=>o-s);return[Math.PI,2*Math.PI].some(o=>Rb(o,t[1]-t[0]))}niceDomain(t,i=this.domain){const o=super.niceDomain(t,i);if(!this.hasNiceRange())return o;const s=o[0]>o[1],a=s?o[1]:o[0],{step:n,count:r}=Ap.getNiceStepAndTickCount(t,o),l=1/n,c=n>=1?Math.ceil(a/n+r)*n:Math.ceil((a+r*n)*l)/l;return s?[c,a]:[a,c]}getPixelRange(){return this.arcLength}},{AND:Up,GREATER_THAN:Ab,LESS_THAN:Tb,NUMBER_OR_NAN:qp,OBJECT:Ib,TempValidate:vr,angleBetween:Mb,normalisedExtentWithMetadata:Lb,findMinMax:Cb}=Ob,ko=class extends ts{constructor(e){super(e,new Xp),this.shape="circle",this.interval=new hr}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:o,clipped:s}=Lb(e,t,i);return{domain:o,clipped:s}}updateScale(){super.updateScale(),this.scale.arcLength=this.getRangeArcLength()}getRangeArcLength(){const{range:e}=this,t=Math.min(...e),i=Math.max(...e),o=Mb(t,i)||2*Math.PI,s=this.gridLength;return o*s}generateAngleTicks(e){const{scale:t,range:i,nice:o}=this,{values:s,step:a,minSpacing:n,maxSpacing:r}=this.interval;let l;if(s==null){const{arcLength:c}=t,p=r?Math.floor(c/r):1,d=n?Math.floor(c/n):1/0,u=Math.floor(4/Math.PI*Math.abs(i[0]-i[1])),f=Math.max(p,Math.min(d,u)),y={nice:o,interval:a,tickCount:f,minTickCount:p,maxTickCount:d};l=t.ticks(y,e)}else{const[c,p]=Cb(e.map(Number));l=s.filter(d=>d>=c&&d<=p).sort((d,u)=>d-u)}return l.map(c=>({value:c,visible:!0}))}avoidLabelCollisions(e){const{minSpacing:t}=this.label,i=(a,n)=>{if(a.hidden||n.hidden)return!1;if(t==null)return a.box.collidesBBox(n.box);const r=a.box.clone().grow(t/2),l=n.box.clone().grow(t/2);return r.collidesBBox(l)},o=e[0],s=e.at(-1);o!==s&&Hp(o.x,s.x)&&Hp(o.y,s.y)&&(s.hidden=!0);for(let a=1;a<e.length;a*=2){let n=!1;for(let r=a;r<e.length;r+=a){const l=e[r],c=e[r-a];if(i(c,l)){n=!0;break}}if(!n){e.forEach((r,l)=>{l%a>0&&(r.hidden=!0,r.box=void 0)});return}}e.forEach((a,n)=>{n>0&&(a.hidden=!0,a.box=void 0)})}};ko.className="AngleNumberAxis",ko.type="angle-number",h([vr(Up(qp,Tb("max")),{optional:!0})],ko.prototype,"min",2),h([vr(Up(qp,Ab("min")),{optional:!0})],ko.prototype,"max",2),h([vr(Ib)],ko.prototype,"interval",2);import{_ModuleSupport as jp}from"ag-charts-community";var{OrdinalTimeScale:Pb}=jp,Or=class extends jp.CategoryAxis{constructor(e){super(e,new Pb)}};Or.className="OrdinalTimeAxis",Or.type="ordinal-time";import{_ModuleSupport as Eb}from"ag-charts-community";import{_ModuleSupport as ia}from"ag-charts-community";import{isNumberEqual as wb}from"ag-charts-core";import{_ModuleSupport as Jp}from"ag-charts-community";import{clamp as Zp,isNumberEqual as _b}from"ag-charts-core";var{ChartAxisDirection:Bb,TempValidate:Gb,NUMBER:Fb,getCrossLineValue:Vb,validateCrossLineValue:Wb,normalizeAngle360:Kb,toRadians:zb,Group:$b,Path:Hb,Sector:Yb,RotatableText:Xb}=Jp,Qp=class extends _t{constructor(){super(...arguments),this.positionAngle=void 0}};h([Gb(Fb,{optional:!0})],Qp.prototype,"positionAngle",2);var kr=class extends et{constructor(){super(),this.direction=Bb.Y,this.label=new Qp,this.polygonNode=new Hb,this.sectorNode=new Yb,this.crossLineRange=new $b,this.labelNode=new Xb,this.outerRadius=0,this.innerRadius=0,this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.labelGroup.append(this.labelNode)}update(e){const{scale:t}=this;if(!t||!this.isValid()||!Wb(Vb(this),t)){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.updateRadii();const{innerRadius:i,outerRadius:o}=this;e&&(e=i>=this.axisInnerRadius&&o<=this.axisOuterRadius),this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updatePolygonNode(e),this.updateSectorNode(e),this.updateLabelNode(e),this.assignCrossLineGroup(this.type==="range",this.crossLineRange)}updateRadii(){const{range:e,scale:t,type:i,axisInnerRadius:o,axisOuterRadius:s}=this;if(!t)return{innerRadius:0,outerRadius:0};const a=l=>s+o-l;let n,r;if(i==="line")n=a(t.convert(this.value)),r=n;else{const l=Math.abs(t?.bandwidth??0),c=e.map(p=>t.convert(p));n=a(Math.max(...c)),r=a(Math.min(...c))+l}this.outerRadius=n,this.innerRadius=r}drawPolygon(e,t,i){t.forEach((o,s)=>{const a=e*Math.cos(o),n=e*Math.sin(o);s===0?i.path.moveTo(a,n):i.path.lineTo(a,n)}),i.path.closePath()}updatePolygonNode(e){const{gridAngles:t,polygonNode:i,scale:o,shape:s,type:a,innerRadius:n,outerRadius:r}=this;if(!e||s!=="polygon"||!o||!t){i.visible=!1;return}i.visible=!0;const l=this.getPadding();i.path.clear(!0),this.drawPolygon(r-l,t,i);const c=t.slice().reverse(),p=a==="line"?r-l:n+l;this.drawPolygon(p,c,i),this.setSectorNodeProps(i)}updateSectorNode(e){const{axisInnerRadius:t,axisOuterRadius:i,scale:o,sectorNode:s,shape:a,innerRadius:n,outerRadius:r}=this;if(!e||a!=="circle"||!o){s.visible=!1;return}s.visible=!0,s.startAngle=0,s.endAngle=2*Math.PI;const l=this.getPadding(),c=Zp(t,n+l,i),p=Zp(t,r-l,i);s.innerRadius=Math.min(c,p),s.outerRadius=Math.max(c,p),this.setSectorNodeProps(s)}updateLabelNode(e){const{innerRadius:t,label:i,labelNode:o,scale:s,shape:a,type:n}=this;if(!e||i.enabled===!1||!i.text||!s){o.visible=!1;return}const r=Kb(zb((i.positionAngle??0)-90)),l=(_b(r,0)||r>0)&&r<Math.PI,c=l?r-Math.PI/2:r+Math.PI/2;let p;const d=this.gridAngles??[];n==="line"?p=t+i.padding:a==="circle"||d.length<3?p=t-i.padding:p=t*Math.cos(Math.PI/d.length)-i.padding;const u=p*Math.cos(r),f=p*Math.sin(r);let y;n==="line"?y=l?"top":"bottom":y=l?"bottom":"top",this.setLabelNodeProps(o,u,f,y,c)}getPadding(){const{scale:e}=this;if(!e)return 0;const t=Math.abs(e.bandwidth??0),i=Math.abs(e.step??0);return e instanceof Jp.BandScale?(i-t)/2:0}};kr.className="RadiusCrossLine";var{ChartAxisDirection:Ub,ZIndexMap:qb,NUMBER:eh,BOOLEAN:jb,TempValidate:Rr,normalizeAngle360:th,toRadians:Jb,Caption:Zb,Group:Qb,Path:eD,Line:tD,Selection:iD,AxisTickGenerator:oD,AxisGroupZIndexMap:sD}=ia,Nr=class extends ia.AxisLabel{constructor(){super(...arguments),this.autoRotateAngle=335}};h([Rr(jb,{optional:!0})],Nr.prototype,"autoRotate",2),h([Rr(eh)],Nr.prototype,"autoRotateAngle",2);var oa=class extends ia.PolarAxis{constructor(e,t){super(e,t),this.positionAngle=0,this.tickGenerator=new oD(this),this.generatedTicks=void 0,this.lineNode=this.axisGroup.appendChild(new tD({name:`${this.id}-Axis-line`,zIndex:sD.AxisLine})),this.gridPathGroup=this.gridGroup.appendChild(new Qb({name:`${this.id}-gridPaths`,zIndex:qb.AXIS_GRID})),this.gridPathSelection=iD.select(this.gridPathGroup,eD),this.axisGroup.appendChild(this.title.caption.node),this.destroyFns.push(this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}get direction(){return Ub.Y}getAxisTransform(){const e=this.scale.range[0],{translation:t,positionAngle:i,innerRadiusRatio:o}=this,s=e*o,a=Jb(i);return{translationX:t.x,translationY:t.y-e-s,rotation:a,rotationCenterX:0,rotationCenterY:e+s}}update(){super.update(),this.updateTitle();const{enabled:e,stroke:t,width:i}=this.line;this.lineNode.setProperties({stroke:t,strokeWidth:e?i:0,x1:0,y1:this.range[0],x2:0,y2:this.range[1]})}calculateTickLayout(e,t,i,o){const{parallelFlipRotation:s,regularFlipRotation:a}=this.calculateRotations(),n=[0,1],r=this.label.getSideFlag(),l=r*(this.getTickSize()+this.label.spacing+this.seriesAreaPadding),c=this.tickGenerator.generateTicks({domain:e,niceMode:t,visibleRange:n,primaryTickCount:o,parallelFlipRotation:s,regularFlipRotation:a,labelX:l,sideFlag:r}),{tickData:p,primaryTickCount:d=o}=c,{ticks:u,rawTicks:f,tickDomain:y,fractionDigits:g,niceDomain:m=e}=p,S=u.map(D=>this.getTickLabelProps(D,c));return this.generatedTicks={ticks:u,labels:S},{ticks:f,tickDomain:y,niceDomain:m,primaryTickCount:d,fractionDigits:g}}updateSelections(){const{generatedTicks:e}=this;if(!e)return;const{ticks:t,labels:i}=e;this.gridLineGroupSelection.update(this.gridLength?t:[]),this.tickLineGroupSelection.update(t),this.tickLabelGroupSelection.update(i),this.gridPathSelection.update(this.gridLine.enabled?this.prepareGridPathTickData(t):[]),this.gridLineGroupSelection.cleanup(),this.tickLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup(),this.gridPathSelection.cleanup()}updateLabels(){if(!this.label.enabled)return;const e=ia.resetAxisLabelSelectionFn();this.tickLabelGroupSelection.each((t,i)=>{t.fill=i.fill,t.fontFamily=i.fontFamily,t.fontSize=i.fontSize,t.fontStyle=i.fontStyle,t.fontWeight=i.fontWeight,t.text=i.text,t.textBaseline=i.textBaseline,t.textAlign=i.textAlign??"center",t.setProperties(e(t,i))})}updateGridLines(){super.updateGridLines();const{gridLine:{style:e,width:t},shape:i,generatedTicks:o}=this;if(!e||!o)return;const s=e.length,a=(u,f)=>{const{stroke:y,lineDash:g}=e[f%s];u.stroke=y,u.strokeWidth=t,u.lineDash=g,u.fill=void 0},[n,r]=this.gridRange??[0,2*Math.PI],l=wb(r-n,2*Math.PI),d=i==="circle"?(u,f)=>{const{path:y}=u;y.clear(!0);const g=this.getTickRadius(f);l?(y.moveTo(g,0),y.arc(0,0,g,0,2*Math.PI)):(y.moveTo(g*Math.cos(n),g*Math.sin(n)),y.arc(0,0,g,th(n),th(r))),l&&y.closePath()}:(u,f)=>{const{path:y}=u,g=this.gridAngles;if(y.clear(!0),!g||g.length<3)return;const m=this.getTickRadius(f);g.forEach((S,D)=>{const b=m*Math.cos(S),v=m*Math.sin(S);D===0?y.moveTo(b,v):y.lineTo(b,v),g.forEach((R,T)=>{const O=m*Math.cos(R),x=m*Math.sin(R);T===0?y.moveTo(O,x):y.lineTo(O,x)}),y.closePath()}),y.closePath()};this.gridPathSelection.each((u,f,y)=>{a(u,y),d(u,f)})}updateTitle(){const e=r=>r.defaultValue,{title:t,range:i,moduleCtx:{callbackCache:o}}=this,{formatter:s=e}=this.title;t.caption.enabled=t.enabled,t.caption.fontFamily=t.fontFamily,t.caption.fontSize=t.fontSize,t.caption.fontStyle=t.fontStyle,t.caption.fontWeight=t.fontWeight,t.caption.color=t.color,t.caption.wrapping=t.wrapping;let a=!1;const n=t.caption.node;t.enabled&&(a=!0,n.rotation=Math.PI/2,n.x=Math.floor((i[0]+i[1])/2),n.y=-Zb.SMALL_PADDING,n.textAlign="center",n.textBaseline="bottom",n.text=o.call(this,s,this.getTitleFormatterParams(this.scale.domain))),n.visible=a}updateCrossLines(){this.crossLines.forEach(e=>{if(e instanceof kr){const{shape:t,gridAngles:i,range:o,innerRadiusRatio:s}=this,a=o[0];e.shape=t,e.gridAngles=i,e.axisOuterRadius=a,e.axisInnerRadius=a*s}}),super.updateCrossLines()}createLabel(){return new Nr}getTickLabelProps(e,t){const{label:i}=this,{combinedRotation:o,textBaseline:s,textAlign:a}=t,n=this.scale.range,r=e.tickLabel,c=i.getSideFlag()*(this.getTickSize()+i.spacing+this.seriesAreaPadding),p=r!==""&&r!=null;return{...this.getLabelStyles({value:e.tickLabel}),tickId:e.tickId,rotation:o,rotationCenterX:c,translationY:e.translationY,text:r,textAlign:a,textBaseline:s,visible:p,x:c,y:0,range:n}}};oa.CrossLineConstructor=kr,h([Rr(eh)],oa.prototype,"positionAngle",2);var{RATIO:Ar,ProxyPropertyOnWrite:ih,TempValidate:Tr,CategoryScale:oh}=Eb,Ki=class extends oa{constructor(e){super(e,new oh),this.shape="circle",this.groupPaddingInner=0,this.paddingInner=0,this.paddingOuter=0}normaliseDataDomain(e){return{domain:e,clipped:!1}}prepareGridPathTickData(e){return e.slice().reverse()}getTickRadius(e){const{scale:t,innerRadiusRatio:i}=this,o=t.range[0],s=o*i;if(oh.is(t)){const a=t.domain,n=a.length-1-a.indexOf(e.tick);return n===0?s:t.inset+t.step*(n-.5)+t.bandwidth/2}else{const a=(o-s)/t.domain.length;return o-e.translationY+s-a/2}}};Ki.className="RadiusCategoryAxis",Ki.type="radius-category",h([Tr(Ar)],Ki.prototype,"groupPaddingInner",2),h([ih("scale","paddingInner"),Tr(Ar)],Ki.prototype,"paddingInner",2),h([ih("scale","paddingOuter"),Tr(Ar)],Ki.prototype,"paddingOuter",2);import{_ModuleSupport as aD}from"ag-charts-community";var{AND:sh,GREATER_THAN:nD,LESS_THAN:rD,NUMBER_OR_NAN:ah,TempValidate:nh,normalisedExtentWithMetadata:lD,LinearScale:cD}=aD,is=class extends oa{constructor(e){super(e,new cD),this.shape="polygon"}prepareGridPathTickData(e){const{scale:t}=this,i=t.domain[1];return e.filter(({tick:o})=>o!==i).sort((o,s)=>s.tick-o.tick)}getTickRadius(e){const{scale:t}=this,i=t.range[0],o=i*this.innerRadiusRatio;return i-e.translationY+o}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:o,clipped:s}=lD(e,t,i);return{domain:o,clipped:s}}};is.className="RadiusNumberAxis",is.type="radius-number",h([nh(sh(ah,rD("max")),{optional:!0})],is.prototype,"min",2),h([nh(sh(ah,nD("min")),{optional:!0})],is.prototype,"max",2);var{cartesianAxisLabelOptionsDefs:pD,cartesianAxisOptionsDefs:hD,cartesianAxisCrosshairOptions:dD,continuousAxisOptions:Ir,commonAxisLabelOptionsDefs:sa,commonAxisOptionsDefs:aa,commonCrossLineOptionsDefs:na,commonCrossLineLabelOptionsDefs:rh,numberFormatValidator:lh}=_S,uD={...hD,type:es(Qo("ordinal-time")),paddingInner:wt,paddingOuter:wt,groupPaddingInner:wt,label:{...pD,format:cr},interval:Ir(GS(Et,BS),!0).interval,crosshair:dD(!0)},fD={...aa,...Ir(Et),type:es(Qo("angle-number")),crossLines:Qs(na),startAngle:Et,endAngle:Et,label:{...sa,orientation:ea("fixed","parallel","perpendicular"),format:lh}},gD={innerRadiusRatio:wt},yD={...aa,...gD,type:es(Qo("angle-category")),shape:ea("polygon","circle"),crossLines:Qs(na),startAngle:Et,endAngle:Et,paddingInner:wt,groupPaddingInner:wt,label:{...sa,orientation:ea("fixed","parallel","perpendicular")}},mD={...aa,...Ir(Et),type:es(Qo("radius-number")),shape:ea("polygon","circle"),positionAngle:Et,innerRadiusRatio:wt,crossLines:Qs({...na,label:{...rh,positionAngle:Et}},"cross-line options"),title:{enabled:Tp,text:cr,spacing:Lp,formatter:Ip,...Mp},label:{...sa,format:lh}},SD={...aa,type:es(Qo("radius-category")),positionAngle:Et,innerRadiusRatio:wt,paddingInner:wt,paddingOuter:wt,groupPaddingInner:wt,label:sa,crossLines:Qs({...na,label:{...rh,positionAngle:Et}},"cross-line options"),title:{enabled:Tp,text:cr,spacing:Lp,formatter:Ip,...Mp}},ch={type:"axis",name:"ordinal-time",chartType:"cartesian",enterprise:!0,options:uD,create:e=>new Or(e)},ph={type:"axis",name:"angle-number",chartType:"polar",enterprise:!0,options:fD,create:e=>new ko(e)},hh={type:"axis",name:"angle-category",chartType:"polar",enterprise:!0,options:yD,create:e=>new Wi(e)},dh={type:"axis",name:"radius-number",chartType:"polar",enterprise:!0,options:mD,create:e=>new is(e)},uh={type:"axis",name:"radius-category",chartType:"polar",enterprise:!0,options:SD,create:e=>new Ki(e)};import{_ModuleSupport as bD}from"ag-charts-community";import{_ModuleSupport as DD}from"ag-charts-community";var{Chart:xD,TempValidate:vD,ARRAY:OD}=DD;function kD(e){return e.type==="sankey"||e.type==="chord"}var ra=class extends xD{getChartType(){return"flow-proportion"}async updateData(){await super.updateData();const e=this.getOptions();this.nodes!==e.nodes&&(this.nodes=e.nodes);const{nodes:t}=this;this.series.forEach(i=>{kD(i)&&i.setChartNodes(t)})}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:o}=e;o.shrink(this.seriesArea.padding.toJson());const s=o.clone();this.seriesRect=s,this.animationRect=s,t.visible=this.series.some(a=>a.visible);for(const a of[t,i])a.translationX=Math.floor(s.x),a.translationY=Math.floor(s.y);this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:t.visible,rect:s,paddedRect:s}})}};ra.className="FlowProportionChart",ra.type="flow-proportion",h([vD(OD,{optional:!0})],ra.prototype,"nodes",2);var{isAgFlowProportionChartOptions:RD,flowProportionChartOptionsDefs:ND}=bD,fh={type:"chart",name:"flow-proportion",enterprise:!0,options:ND,detect:RD,create(e,t){return new ra(e,t)}};import{_ModuleSupport as AD}from"ag-charts-community";import{_ModuleSupport as TD}from"ag-charts-community";var{Chart:ID}=TD,Mr=class extends ID{getChartType(){return"gauge"}performLayout(e){const{seriesRoot:t,annotationRoot:i,series:o,seriesArea:s}=this,{layoutBox:a}=e,n=a.clone();a.shrink(s.padding.toJson()),this.seriesRect=n.clone().translate(n.x-a.x,n.y-a.y),this.animationRect=a,t.visible=o.some(r=>r.visible);for(const r of[t,i])r.translationX=Math.floor(a.x),r.translationY=Math.floor(a.y);this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:t.visible,rect:n,paddedRect:a}})}getAriaLabel(){const e=[],t=this.getCaptionText();t.length!==0&&e.push(t);for(const o of this.series)e.push(o.getCaptionText());const i=e.join(". ");return this.ctx.localeManager.t("ariaAnnounceGaugeChart",{caption:i})}};Mr.className="GaugeChart",Mr.type="gauge";var{isAgGaugeChartOptions:MD,gaugeChartOptionsDefs:LD}=AD,gh={type:"chart",name:"gauge",enterprise:!0,options:LD,detect:MD,create(e,t){return new Mr(e,t)}};import{_ModuleSupport as CD}from"ag-charts-community";import{_ModuleSupport as PD}from"ag-charts-community";var{Chart:ED}=PD,Lr=class extends ED{getChartType(){return"hierarchy"}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:o}=e;o.shrink(this.seriesArea.padding.toJson());const s=o.clone();this.seriesRect=s,this.animationRect=s;for(const a of[t,i])a.translationX=Math.floor(s.x),a.translationY=Math.floor(s.y);t.visible=this.series[0].visible,t.setClipRect(s.clone()),this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:s,paddedRect:s}})}getAriaLabel(){const e=this.getCaptionText();return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:e})}};Lr.className="HierarchyChart",Lr.type="hierarchy";var{isAgHierarchyChartOptions:wD,hierarchyChartOptionsDefs:_D}=CD,yh={type:"chart",name:"hierarchy",enterprise:!0,options:_D,detect:wD,create(e,t){return new Lr(e,t)}};import{_ModuleSupport as BD}from"ag-charts-community";import{_ModuleSupport as GD}from"ag-charts-community";var{Chart:FD}=GD,Cr=class extends FD{getChartType(){return"standalone"}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:o}=e;o.shrink(this.seriesArea.padding.toJson());const s=o.clone();this.seriesRect=s,this.animationRect=s;for(const a of[t,i])a.translationX=Math.floor(o.x),a.translationY=Math.floor(o.y);t.visible=this.series[0].visible,this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:s,paddedRect:o}})}getAriaLabel(){const e=this.getCaptionText();return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:e})}};Cr.className="StandaloneChart",Cr.type="standalone";var{isAgStandaloneChartOptions:VD,standaloneChartOptionsDefs:WD}=BD,mh={type:"chart",name:"standalone",enterprise:!0,options:WD,detect:VD,create(e,t){return new Cr(e,t)}};import{_ModuleSupport as KD}from"ag-charts-community";import{_ModuleSupport as zD}from"ag-charts-community";import{_ModuleSupport as $D}from"ag-charts-community";import{isFiniteNumber as HD}from"ag-charts-core";function Sh(e){return Array.isArray(e)&&e.length>=2&&e.every(HD)}function la(e){return Array.isArray(e)&&e.length>=2&&e.every(Sh)}var bh=.001;function YD(e){return Math.abs(e[0][0]-e[e.length-1][0])<bh&&Math.abs(e[0][1]-e[e.length-1][1])<bh}function Dh(e){return Array.isArray(e)&&e.every(la)&&e.every(YD)}function xh(e){if(e===null)return!0;if(typeof e!="object"||e.type==null)return!1;const{type:t,coordinates:i}=e;switch(t){case"GeometryCollection":return Array.isArray(e.geometries)&&e.geometries.every(xh);case"MultiPolygon":return Array.isArray(i)&&i.every(Dh);case"Polygon":return Dh(i);case"MultiLineString":return Array.isArray(i)&&i.every(la);case"LineString":return la(i);case"MultiPoint":return la(i);case"Point":return Sh(i)}}function XD(e){return e!==null&&typeof e=="object"&&e.type==="Feature"&&xh(e.geometry)}function UD(e){return e!==null&&typeof e=="object"&&e.type==="FeatureCollection"&&Array.isArray(e.features)&&e.features.every(XD)}var Ro=$D.predicateWithMessage(UD,"a GeoJSON object"),{Chart:qD,MercatorScale:vh,NumberAxis:Oh,TempValidate:jD}=zD;function kh(e){return e.type==="map-shape"||e.type==="map-line"||e.type==="map-marker"||e.type==="map-shape-background"||e.type==="map-line-background"}var ca=class extends qD{constructor(e,t){super(e,t),this.xAxis=new Oh(this.getModuleContext()),this.xAxis.position="bottom",this.yAxis=new Oh(this.getModuleContext()),this.yAxis.position="left",this.ctx.zoomManager.updateAxes([this.xAxis,this.yAxis])}getChartType(){return"topology"}async updateData(){await super.updateData();const e=this.getOptions();this.topology!==e.topology&&(this.topology=e.topology);const{topology:t}=this;this.series.forEach(i=>{kh(i)&&i.setChartTopology(t)})}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:o}=e;o.shrink(this.seriesArea.padding.toJson());const s=o.clone();this.seriesRect=s,this.animationRect=s;const a=this.series.filter(kh),n=a.reduce((c,p)=>{if(!p.visible)return c;const d=p.topologyBounds;return d==null?c:c==null?d:(c.merge(d),c)},void 0);let r;if(n!=null){const{lon0:c,lat0:p,lon1:d,lat1:u}=n,f=[[c,p],[d,u]],y=vh.bounds(f),{width:g,height:m}=s,S=Math.min(g/y.width,m/y.height),D=y.width*S,b=y.height*S,v=(g-D)/2,R=(m-b)/2,T=v,O=R,x=v+D,A=R+b,k=this.ctx.zoomManager.getAxisZoom(this.xAxis.id),I=this.ctx.zoomManager.getAxisZoom(this.yAxis.id),N=(x-T)/(k.max-k.min),L=T-N*k.min,M=(A-O)/(1-I.min-(1-I.max)),E=O-M*(1-I.max);r=new vh(f,[[L,E],[L+N,E+M]])}a.forEach(c=>{c.scale=r});const l=this.series.some(c=>c.visible);t.visible=l;for(const c of[t,i])c.translationX=Math.floor(s.x),c.translationY=Math.floor(s.y),c.setClipRect(s.clone());this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:l,rect:s,paddedRect:s}})}};ca.className="TopologyChart",ca.type="topology",h([jD(Ro,{optional:!0})],ca.prototype,"topology",2);var{isAgTopologyChartOptions:JD,topologyChartOptionsDefs:ZD}=KD,Rh={type:"chart",name:"topology",enterprise:!0,options:ZD,detect:JD,create(e,t){return new ca(e,t)}};import{_ModuleSupport as QD}from"ag-charts-community";import{array as ex,arrayOf as pa,arrayOfDefs as Nh,boolean as Y,callback as tx,color as Ah,constant as Th,fillOptionsDef as nt,fontOptionsDef as Bt,lineDashOptionsDef as Pr,number as vi,optionsDefs as ha,or as Oi,positiveNumber as os,ratio as da,required as ix,string as ut,strokeOptionsDef as Ne,typeUnion as ox,union as Gt}from"ag-charts-core";var{toolbarButtonOptionsDefs:ua}=QD,ss={enabled:Y,axesButtons:{enabled:Y,axes:Gt("x","y","xy")},toolbar:{enabled:Y,padding:os,buttons:Nh({...ua,value:Gt("line-menu","fibonacci-menu","text-menu","shape-menu","measurer-menu","line","horizontal-line","vertical-line","parallel-channel","disjoint-channel","fibonacci-retracement","fibonacci-retracement-trend-based","text","comment","callout","note","clear")},"annotation toolbar buttons array")},optionsToolbar:{enabled:Y,buttons:pa(Oi(ha({...ua,value:Gt("line-stroke-width","line-style-type","line-color","fill-color","text-color","text-size","delete","settings")}),ha({...ua,value:Gt("lock"),checkedOverrides:ua})))}};ss.data=ex,ss.xKey=ut,ss.volumeKey=ut,ss.snap=Y;var as=ha({__type:ix(Th("date")),value:Oi(ut,vi)},"a serializable date object"),Ih=Oi(ut,vi,as),Er=Oi(Ih,ha({value:Ih,groupPercentage:vi})),Mh={enabled:Y,cornerRadius:os,formatter:tx,...Bt,...nt,...Ne,...Pr},ki={label:ut,position:Gt("top","center","bottom"),alignment:Gt("left","center","right"),...Bt},Lh={label:ut,position:Gt("top","inside","bottom"),alignment:Gt("left","center","right"),...Bt},qe={...nt,...Ne,...Pr},ue={x:Er,y:vi},Ft={lineStyle:Gt("solid","dashed","dotted"),...Pr},Ch={visible:Y,extendStart:Y,extendEnd:Y,locked:Y,text:ki,handle:qe,label:Bt,showFill:Y,isMultiColor:Y,strokes:pa(Ah),rangeStroke:Ah,bands:Gt(4,6,10),...Ne,...Ft},sx=ox({line:{visible:Y,extendStart:Y,extendEnd:Y,locked:Y,text:ki,handle:qe,start:ue,end:ue,...Ne,...Ft},"horizontal-line":{visible:Y,locked:Y,value:Er,axisLabel:Mh,text:ki,handle:qe,...Ne,...Ft},"vertical-line":{visible:Y,locked:Y,value:Er,axisLabel:Mh,text:ki,handle:qe,...Ne,...Ft},"disjoint-channel":{visible:Y,extendStart:Y,extendEnd:Y,locked:Y,startHeight:os,endHeight:os,text:Lh,handle:qe,start:ue,end:ue,background:nt,...Ne,...Ft},"parallel-channel":{visible:Y,extendStart:Y,extendEnd:Y,locked:Y,height:os,text:Lh,handle:qe,start:ue,end:ue,background:nt,middle:{visible:Y,...Ne,...Ft},...Ne,...Ft},"fibonacci-retracement":{reverse:Y,start:ue,end:ue,...Ch},"fibonacci-retracement-trend-based":{reverse:Y,start:ue,end:ue,endRetracement:ue,...Ch},callout:{visible:Y,locked:Y,text:ut,handle:qe,start:ue,end:ue,...Bt,...nt,...Ne},comment:{visible:Y,locked:Y,text:ut,handle:qe,...ue,...Bt,...nt},note:{visible:Y,locked:Y,text:ut,handle:qe,background:{...nt,...Ne},...ue,...Bt,...nt,...Ne},text:{visible:Y,locked:Y,text:ut,handle:qe,...ue,...Bt,...nt},arrow:{visible:Y,extendStart:Y,extendEnd:Y,locked:Y,text:ki,handle:qe,start:ue,end:ue,...Ne,...Ft},"arrow-up":{visible:Y,locked:Y,handle:qe,...ue,...nt},"arrow-down":{visible:Y,locked:Y,handle:qe,...ue,...nt},"date-range":{visible:Y,extendAbove:Y,extendBelow:Y,locked:Y,text:ki,handle:qe,start:ue,end:ue,statistics:{divider:Ne,...Bt,...nt,...Ne},...Ne,...Ft},"price-range":{visible:Y,extendLeft:Y,extendRight:Y,locked:Y,text:ki,handle:qe,start:ue,end:ue,statistics:{divider:Ne,...Bt,...nt,...Ne},...Ne,...Ft},"date-price-range":{visible:Y,locked:Y,text:ki,handle:qe,start:ue,end:ue,statistics:{divider:Ne,...Bt,...nt,...Ne},...Ne,...Ft}}),ax={chartType:Gt("candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"),annotations:pa(sx),legend:Nh({visible:Y,seriesId:ut,itemId:ut,legendItemName:ut},"legend state array"),zoom:{rangeX:{start:Oi(vi,as),end:Oi(vi,as)},rangeY:{start:Oi(vi,as),end:Oi(vi,as)},ratioX:{start:da,end:da},ratioY:{start:da,end:da},autoScaledAxes:pa(Th("y"))}};import{_ModuleSupport as nx}from"ag-charts-community";import{array as rx,arrayOf as lx,boolean as ns,callback as cx,color as fa,fontOptionsDef as px,number as Ph,positiveNumber as xt,ratio as hx,typeUnion as dx}from"ag-charts-core";import{_ModuleSupport as ux}from"ag-charts-community";import{_ModuleSupport as wr}from"ag-charts-community";function fx(e){return{from:e?{scalingX:1,scalingY:0}:{scalingX:0,scalingY:1},to:{scalingX:1,scalingY:1}}}function gx(e){return(t,i)=>e?{scalingCenterY:i.scaledValues.medianValue}:{scalingCenterX:i.scaledValues.medianValue}}import{_ModuleSupport as Eh}from"ag-charts-community";import{Logger as yx}from"ag-charts-core";var{ScalableGroup:mx,Rect:rs,Line:ls,BBox:Sx,Selection:wh,applyShapeFillBBox:bx}=Eh,Dx=class extends mx{constructor(){super(),this.append([new rs({tag:0}),new rs({tag:2}),new rs({tag:1}),new ls({tag:3}),new ls({tag:3}),new ls({tag:4}),new ls({tag:4})])}updateDatumStyles(e,t,i,o,s){const{bandwidth:a,scaledValues:{xValue:n,medianValue:r}}=e;let{minValue:l,q1Value:c,q3Value:p,maxValue:d}=e.scaledValues;(i&&!o||!i&&o)&&([d,p,c,l]=[l,c,p,d]);const u=(_,F,V,W)=>i?{y:_,x:F,width:W,height:V}:{x:_,y:F,width:V,height:W},f=(_,F,V)=>i?{y1:_,y2:F,x:V}:{x1:_,x2:F,y:V},y=(_,F,V)=>i?{x1:F,x2:V,y:_}:{x:_,y1:F,y2:V},g=(_,F,V,W)=>({x:_,y:F,width:V,height:W}=u(_,F,V,W),new Sx(_,F,V,W)),{fill:m,fillOpacity:S,stroke:D,strokeWidth:b,strokeOpacity:v,lineDash:R,lineDashOffset:T,cornerRadius:O,cap:x,whisker:A}=t,k=wh.select(this,rs),[I]=k.selectByTag(0),[N]=k.selectByTag(2),[L]=k.selectByTag(1),M=k.selectByTag(3),E=k.selectByTag(4);A.strokeWidth>a&&(A.strokeWidth=a);const C=u(c,n,p-c,a);N.setProperties(C),I.setProperties(C),I.setProperties({cornerRadius:O});const w=Math.max(Math.round(r-b/2),c+b),G=Math.min(Math.round(r+b/2),p-b);L.setProperties(C),L.setProperties({visible:w<G,cornerRadius:O,clipBBox:g(w,n+b,G-w,Math.max(0,a-b*2))});const P=Math.floor(n+a*(1-x.lengthRatio)/2),B=Math.ceil(n+a*(1+x.lengthRatio)/2);E[0].setProperties(y(l,P,B)),E[1].setProperties(y(d,P,B)),M[0].setProperties(f(Math.round(l+A.strokeWidth/2),c,Math.floor(n+a/2))),M[1].setProperties(f(p,Math.round(d-A.strokeWidth/2),Math.floor(n+a/2))),bx(I,m,s),I.setProperties({fill:m,fillOpacity:S,strokeWidth:b*2,strokeOpacity:0}),L.setProperties({fill:D,fillOpacity:v,strokeWidth:0});for(const _ of[...M,...E])_.setProperties(A);N.setProperties({stroke:D,strokeWidth:b,strokeOpacity:v,lineDash:R,lineDashOffset:T,cornerRadius:O,fillOpacity:0})}distanceSquared(e,t){const i=wh.selectByClass(this,rs,ls);return Eh.nearestSquared(e,t,i).distanceSquared}get midPoint(){const e=this.datum;return e.midPoint===void 0?(yx.error("BoxPlotGroup.datum.midPoint is undefined"),{x:NaN,y:NaN}):e.midPoint}};import{_ModuleSupport as xx}from"ag-charts-community";var{BaseProperties:_h,FillGradientDefaults:vx,FillPatternDefaults:Ox,AbstractBarSeriesProperties:kx,SeriesTooltip:Rx,TempValidate:ne,COLOR_STRING:_r,FUNCTION:Nx,LINE_DASH:Bh,OBJECT:cs,POSITIVE_NUMBER:ps,RATIO:ga,STRING:ft,mergeDefaults:Ax,COLOR_GRADIENT:Tx,COLOR_PATTERN:Ix,OR:Mx}=xx,Gh=class extends _h{constructor(){super(...arguments),this.lengthRatio=.5}};h([ne(ga)],Gh.prototype,"lengthRatio",2);var No=class extends _h{};h([ne(_r,{optional:!0})],No.prototype,"stroke",2),h([ne(ps)],No.prototype,"strokeWidth",2),h([ne(ga)],No.prototype,"strokeOpacity",2),h([ne(Bh,{optional:!0})],No.prototype,"lineDash",2),h([ne(ps)],No.prototype,"lineDashOffset",2);var he=class extends kx{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new vx,this.fillPatternDefaults=new Ox,this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.cap=new Gh,this.whisker=new No,this.tooltip=new Rx}toJson(){const{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:o,lineDashOffset:s}=this,a=super.toJson();return a.whisker=Ax(a.whisker,{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:o,lineDashOffset:s}),a}};h([ne(ft)],he.prototype,"xKey",2),h([ne(ft)],he.prototype,"minKey",2),h([ne(ft)],he.prototype,"q1Key",2),h([ne(ft)],he.prototype,"medianKey",2),h([ne(ft)],he.prototype,"q3Key",2),h([ne(ft)],he.prototype,"maxKey",2),h([ne(ft,{optional:!0})],he.prototype,"xName",2),h([ne(ft,{optional:!0})],he.prototype,"yName",2),h([ne(ft,{optional:!0})],he.prototype,"minName",2),h([ne(ft,{optional:!0})],he.prototype,"q1Name",2),h([ne(ft,{optional:!0})],he.prototype,"medianName",2),h([ne(ft,{optional:!0})],he.prototype,"q3Name",2),h([ne(ft,{optional:!0})],he.prototype,"maxName",2),h([ne(Mx(Tx,Ix,_r))],he.prototype,"fill",2),h([ne(cs)],he.prototype,"fillGradientDefaults",2),h([ne(cs)],he.prototype,"fillPatternDefaults",2),h([ne(ga)],he.prototype,"fillOpacity",2),h([ne(_r)],he.prototype,"stroke",2),h([ne(ps)],he.prototype,"strokeWidth",2),h([ne(ga)],he.prototype,"strokeOpacity",2),h([ne(Bh)],he.prototype,"lineDash",2),h([ne(ps)],he.prototype,"lineDashOffset",2),h([ne(ps)],he.prototype,"cornerRadius",2),h([ne(Nx,{optional:!0})],he.prototype,"itemStyler",2),h([ne(cs)],he.prototype,"cap",2),h([ne(cs)],he.prototype,"whisker",2),h([ne(cs)],he.prototype,"tooltip",2);var{extractDecoratedProperties:Fh,fixNumericExtent:Lx,keyProperty:Cx,mergeDefaults:Br,SeriesNodePickMode:Vh,SMALLEST_KEY_INTERVAL:Px,valueProperty:hs,diff:Ex,animationValidation:wx,computeBarFocusBounds:_x,createDatumId:Wh,ContinuousScale:Bx,ChartAxisDirection:Kh,motion:zh,isGradientFill:Gx,getShapeStyle:ds}=wr,Fx=class extends wr.SeriesNodeEvent{constructor(e,t,i,o){super(e,t,i,o),this.xKey=o.properties.xKey,this.minKey=o.properties.minKey,this.q1Key=o.properties.q1Key,this.medianKey=o.properties.medianKey,this.q3Key=o.properties.q3Key,this.maxKey=o.properties.maxKey}},ya=class extends wr.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[Vh.NEAREST_NODE,Vh.EXACT_SHAPE_MATCH],directionKeys:{x:["xKey"],y:["medianKey","q1Key","q3Key","minKey","maxKey"]},directionNames:{x:["xName"],y:["medianName","q1Name","q3Name","minName","maxName"]},categoryKey:"xValue",pathsPerSeries:[],hasHighlightedLabels:!0}),this.properties=new he,this.NodeEvent=Fx}async processData(e){if(!this.properties.isValid()||!this.visible)return;const{xKey:t,minKey:i,q1Key:o,medianKey:s,q3Key:a,maxKey:n}=this.properties,r=!this.ctx.animationManager.isSkipped(),l=this.getCategoryAxis()?.scale,c=this.getValueAxis()?.scale,{isContinuousX:p,xScaleType:d,yScaleType:u}=this.getScaleInformation({xScale:l,yScale:c}),f=[];r&&this.processedData&&f.push(Ex(this.id,this.processedData)),r&&f.push(wx());const{processedData:y}=await this.requestDataModel(e,this.data,{props:[Cx(t,d,{id:"xValue"}),hs(i,u,{id:"minValue"}),hs(o,u,{id:"q1Value"}),hs(s,u,{id:"medianValue"}),hs(a,u,{id:"q3Value"}),hs(n,u,{id:"maxValue"}),...p?[Px]:[],...f]});this.smallestDataInterval=y.reduced?.smallestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!(t&&i))return[];if(e!==this.getBarDirection()){const{index:s,def:a}=i.resolveProcessedDataDefById(this,"xValue"),n=t.domain.keys[s];return a.type==="key"&&a.valueType==="category"?n:this.padBandExtent(n)}const o=this.domainForClippedRange(Kh.Y,["minValue","maxValue"],"xValue",!0);return Lx(o)}getSeriesRange(e,t){return this.domainForVisibleRange(Kh.Y,["maxValue","minValue"],"xValue",t,!0)}createNodeData(){const{visible:e,dataModel:t,processedData:i}=this,o=this.getCategoryAxis(),s=this.getValueAxis();if(!(t&&i&&o&&s))return;const{xKey:a,fill:n,fillOpacity:r,stroke:l,strokeWidth:c,strokeOpacity:p,lineDash:d,lineDashOffset:u,cap:f,whisker:y}=this.properties,g=[],m=t.resolveKeysById(this,"xValue",i),S=t.resolveColumnById(this,"minValue",i),D=t.resolveColumnById(this,"q1Value",i),b=t.resolveColumnById(this,"medianValue",i),v=t.resolveColumnById(this,"q3Value",i),R=t.resolveColumnById(this,"maxValue",i),{barWidth:T,groupIndex:O}=this.updateGroupScale(o),x=Bx.is(o.scale)?T*-.5:0,{groupScale:A}=this,k=this.isVertical(),I={itemId:a,nodeData:g,labelData:[],scales:this.calculateScaling(),visible:this.visible};return e&&(i.dataSources.get(this.id)??[]).forEach((L,M)=>{const E=m[M];if(E==null)return;const C=S[M],w=D[M],G=b[M],P=v[M],B=R[M];if([C,w,G,P,B].some(Z=>typeof Z!="number")||C>w||w>G||G>P||P>B)return;const _={xValue:Math.round(o.scale.convert(E)),minValue:Math.round(s.scale.convert(C)),q1Value:Math.round(s.scale.convert(w)),medianValue:Math.round(s.scale.convert(G)),q3Value:Math.round(s.scale.convert(P)),maxValue:Math.round(s.scale.convert(B))};_.xValue+=Math.round(A.convert(String(O)))+x;const F=Math.round(T),V=Math.abs(_.q3Value-_.q1Value),W=_.xValue+F/2,K=Math.min(_.q3Value,_.q1Value)+V/2,$={x:k?W:K,y:k?K:W};let U;k?U={x:$.x-F/2,y:_.minValue,width:F,height:_.maxValue-_.minValue}:U={x:_.minValue,y:$.y-F/2,width:_.ma