var ag=Object.defineProperty,sk=Object.getOwnPropertyDescriptor,nk=(t,e)=>{for(var i in e)ag(t,i,{get:e[i],enumerable:!0})},d=(t,e,i,o)=>{for(var s=o>1?void 0:o?sk(e,i):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(s=(o?a(e,i,s):a(s))||s);return o&&s&&ag(e,i,s),s};import{AgCharts as lr,VERSION as ak,_Scene as rk,_Theme as lk,_Util as ck,setupCommunityModules as hk}from"ag-charts-community";var dk=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility=this.md5("hello")!="5d41402abc4b2a76b9719d911017c592"}md5cycle(t,e){let i=t[0],o=t[1],s=t[2],n=t[3];i=this.ff(i,o,s,n,e[0],7,-680876936),n=this.ff(n,i,o,s,e[1],12,-389564586),s=this.ff(s,n,i,o,e[2],17,606105819),o=this.ff(o,s,n,i,e[3],22,-1044525330),i=this.ff(i,o,s,n,e[4],7,-176418897),n=this.ff(n,i,o,s,e[5],12,1200080426),s=this.ff(s,n,i,o,e[6],17,-1473231341),o=this.ff(o,s,n,i,e[7],22,-45705983),i=this.ff(i,o,s,n,e[8],7,1770035416),n=this.ff(n,i,o,s,e[9],12,-1958414417),s=this.ff(s,n,i,o,e[10],17,-42063),o=this.ff(o,s,n,i,e[11],22,-1990404162),i=this.ff(i,o,s,n,e[12],7,1804603682),n=this.ff(n,i,o,s,e[13],12,-40341101),s=this.ff(s,n,i,o,e[14],17,-1502002290),o=this.ff(o,s,n,i,e[15],22,1236535329),i=this.gg(i,o,s,n,e[1],5,-165796510),n=this.gg(n,i,o,s,e[6],9,-1069501632),s=this.gg(s,n,i,o,e[11],14,643717713),o=this.gg(o,s,n,i,e[0],20,-373897302),i=this.gg(i,o,s,n,e[5],5,-701558691),n=this.gg(n,i,o,s,e[10],9,38016083),s=this.gg(s,n,i,o,e[15],14,-660478335),o=this.gg(o,s,n,i,e[4],20,-405537848),i=this.gg(i,o,s,n,e[9],5,568446438),n=this.gg(n,i,o,s,e[14],9,-1019803690),s=this.gg(s,n,i,o,e[3],14,-187363961),o=this.gg(o,s,n,i,e[8],20,1163531501),i=this.gg(i,o,s,n,e[13],5,-1444681467),n=this.gg(n,i,o,s,e[2],9,-51403784),s=this.gg(s,n,i,o,e[7],14,1735328473),o=this.gg(o,s,n,i,e[12],20,-1926607734),i=this.hh(i,o,s,n,e[5],4,-378558),n=this.hh(n,i,o,s,e[8],11,-2022574463),s=this.hh(s,n,i,o,e[11],16,1839030562),o=this.hh(o,s,n,i,e[14],23,-35309556),i=this.hh(i,o,s,n,e[1],4,-1530992060),n=this.hh(n,i,o,s,e[4],11,1272893353),s=this.hh(s,n,i,o,e[7],16,-155497632),o=this.hh(o,s,n,i,e[10],23,-1094730640),i=this.hh(i,o,s,n,e[13],4,681279174),n=this.hh(n,i,o,s,e[0],11,-358537222),s=this.hh(s,n,i,o,e[3],16,-722521979),o=this.hh(o,s,n,i,e[6],23,76029189),i=this.hh(i,o,s,n,e[9],4,-640364487),n=this.hh(n,i,o,s,e[12],11,-421815835),s=this.hh(s,n,i,o,e[15],16,530742520),o=this.hh(o,s,n,i,e[2],23,-995338651),i=this.ii(i,o,s,n,e[0],6,-198630844),n=this.ii(n,i,o,s,e[7],10,1126891415),s=this.ii(s,n,i,o,e[14],15,-1416354905),o=this.ii(o,s,n,i,e[5],21,-57434055),i=this.ii(i,o,s,n,e[12],6,1700485571),n=this.ii(n,i,o,s,e[3],10,-1894986606),s=this.ii(s,n,i,o,e[10],15,-1051523),o=this.ii(o,s,n,i,e[1],21,-2054922799),i=this.ii(i,o,s,n,e[8],6,1873313359),n=this.ii(n,i,o,s,e[15],10,-30611744),s=this.ii(s,n,i,o,e[6],15,-1560198380),o=this.ii(o,s,n,i,e[13],21,1309151649),i=this.ii(i,o,s,n,e[4],6,-145523070),n=this.ii(n,i,o,s,e[11],10,-1120210379),s=this.ii(s,n,i,o,e[2],15,718787259),o=this.ii(o,s,n,i,e[9],21,-343485551),t[0]=this.add32(i,t[0]),t[1]=this.add32(o,t[1]),t[2]=this.add32(s,t[2]),t[3]=this.add32(n,t[3])}cmn(t,e,i,o,s,n){return e=this.add32(this.add32(e,t),this.add32(o,n)),this.add32(e<>>32-s,i)}ff(t,e,i,o,s,n,a){return this.cmn(e&i|~e&o,t,e,s,n,a)}gg(t,e,i,o,s,n,a){return this.cmn(e&o|i&~o,t,e,s,n,a)}hh(t,e,i,o,s,n,a){return this.cmn(e^i^o,t,e,s,n,a)}ii(t,e,i,o,s,n,a){return this.cmn(i^(e|~o),t,e,s,n,a)}md51(t){const e=t.length,i=[1732584193,-271733879,-1732584194,271733878];let o;for(o=64;o<=t.length;o+=64)this.md5cycle(i,this.md5blk(t.substring(o-64,o)));t=t.substring(o-64);const s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(o=0;o>2]|=t.charCodeAt(o)<<(o%4<<3);if(s[o>>2]|=128<<(o%4<<3),o>55)for(this.md5cycle(i,s),o=0;o<16;o++)s[o]=0;return s[14]=e*8,this.md5cycle(i,s),i}md5blk(t){const e=[];for(let i=0;i<64;i+=4)e[i>>2]=t.charCodeAt(i)+(t.charCodeAt(i+1)<<8)+(t.charCodeAt(i+2)<<16)+(t.charCodeAt(i+3)<<24);return e}rhex(t){const e="0123456789abcdef".split("");let i="",o=0;for(;o<4;o++)i+=e[t>>o*8+4&15]+e[t>>o*8&15];return i}hex(t){for(let e=0;e>16)+(e>>16)+(i>>16)<<16|i&65535}};function Vc(t){return t==null||t.length===0}var cr={"01":"GRID","02":"CHARTS","0102":"BOTH"},rg="https://www.ag-grid.com/charts/licensing/",Fc=class Kt{constructor(e){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=e,this.md5=new dk,this.md5.init()}validateLicense(){const e=this.getLicenseDetails(Kt.licenseKey,Kt.gridContext),i=`AG ${e.currentLicenseType==="BOTH"?"Grid and ":""}Charts Enterprise`;let o="";if(e.suppliedLicenseType==="BOTH"?o="AG Grid and AG Charts Enterprise":e.suppliedLicenseType==="GRID"?o="AG Grid Enterprise":e.suppliedLicenseType!==void 0&&(o="AG Charts Enterprise"),e.missing)(!this.isWebsiteUrl()||this.isForceWatermark())&&this.outputMissingLicenseKey(i);else if(e.expired){const s=Kt.getChartsReleaseDate(),n=Kt.formatDate(s);this.outputExpiredKey(e.expiry,n,o)}else e.valid?e.isTrial&&e.trialExpired&&this.outputExpiredTrialKey(e.expiry,i,o):this.outputInvalidLicenseKey(!!e.incorrectLicenseType,i,o)}static extractExpiry(e){const i=e.substring(e.lastIndexOf("_")+1,e.length);return new Date(parseInt(Kt.decode(i),10))}static extractLicenseComponents(e){let i=e.replace(/[\u200B-\u200D\uFEFF]/g,"");if(i=i.replace(/\r?\n|\r/g,""),e.length<=32)return{md5:null,license:e,version:null,isTrial:null};const o=i.length-32,s=i.substring(o),n=i.substring(0,o),[a,r,l]=Kt.extractBracketedInformation(i);return{md5:s,license:n,version:a,isTrial:r,type:l}}getLicenseDetails(e,i=!1){const o="CHARTS";if(Vc(e))return{licenseKey:e,valid:!1,missing:!0,currentLicenseType:o};const s=Kt.getChartsReleaseDate(),{md5:n,license:a,version:r,isTrial:l,type:c}=Kt.extractLicenseComponents(e);let h=n===this.md5.md5(a)&&e.indexOf("For_Trialing_ag-Grid_Only")===-1,p,u,g=null,y=!1,f;function m(){p=gg,r){case"legacy":case"2":{h=!1;break}case"3":Vc(c)?h=!1:(f=c,c!==cr["02"]&&c!==cr["0102"]?(h=!1,y=!0):l&&m())}return h?{licenseKey:e,valid:h,expiry:Kt.formatDate(g),expired:u,version:r,isTrial:l,trialExpired:p,invalidLicenseTypeForCombo:i?f!=="BOTH":void 0,incorrectLicenseType:y,currentLicenseType:o,suppliedLicenseType:f}:{licenseKey:e,valid:h,incorrectLicenseType:y,currentLicenseType:o,suppliedLicenseType:f}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isWebsiteUrl()&&!Vc(this.watermarkMessage)}getWatermarkMessage(){return this.watermarkMessage??""}getHostname(){if(!this.document)return"localhost";const e=this.document.defaultView??window;if(!e)return"localhost";const i=e.location,{hostname:o=""}=i;return o}isForceWatermark(){if(!this.document)return!1;const e=this.document?.defaultView??typeof window<"u"?window:void 0;if(!e)return!1;const{pathname:i}=e.location;return i?i.indexOf("forceWatermark")!==-1:!1}isWebsiteUrl(){const e=this.getHostname();return/^((?:[\w-]+\.)?ag-grid\.com)$/.exec(e)!==null}isLocalhost(){const e=this.getHostname();return/^(?:127\.0\.0\.1|localhost)$/.exec(e)!==null}static formatDate(e){const i=["January","February","March","April","May","June","July","August","September","October","November","December"],o=e.getDate(),s=e.getMonth(),n=e.getFullYear();return o+" "+i[s]+" "+n}static getChartsReleaseDate(){return new Date(parseInt(Kt.decode(Kt.RELEASE_INFORMATION),10))}static decode(e){const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let o="",s,n,a,r,l,c,h,p=0;const u=e.replace(/[^A-Za-z0-9+/=]/g,"");for(;p>4,n=(l&15)<<4|c>>2,a=(c&3)<<6|h,o=o+String.fromCharCode(s),c!=64&&(o=o+String.fromCharCode(n)),h!=64&&(o=o+String.fromCharCode(a));return o=Kt.utf8_decode(o),o}static utf8_decode(e){e=e.replace(/rn/g,"n");let i="";for(let o=0;o127&&s<2048?(i+=String.fromCharCode(s>>6|192),i+=String.fromCharCode(s&63|128)):(i+=String.fromCharCode(s>>12|224),i+=String.fromCharCode(s>>6&63|128),i+=String.fromCharCode(s&63|128))}return i}static setGridContext(e=!1){Kt.gridContext=e}static setLicenseKey(e){Kt.licenseKey=e}static extractBracketedInformation(e){if(!e.includes("["))return["legacy",!1,void 0];const i=e.match(/\[(.*?)\]/g).map(r=>r.replace("[","").replace("]",""));if(!i||i.length===0)return["legacy",!1,void 0];const o=i.filter(r=>r==="TRIAL").length===1,s=i.filter(r=>r.startsWith("v"))[0],n=s?s.replace("v",""):"legacy",a=cr[i.filter(r=>cr[r])[0]];return[n,o,a]}centerPadAndOutput(e){const i=this.totalMessageLength-e.length;console.error(e.padStart(i/2+e.length,"*").padEnd(this.totalMessageLength,"*"))}padAndOutput(e,i="*",o=""){console.error(e.padEnd(this.totalMessageLength-o.length,i)+o)}outputInvalidLicenseKey(e,i,o){Kt.gridContext||(e?(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Incompatible License Key "),this.padAndOutput(`* Your license key is for ${o} only and does not cover you for ${i}.`," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${rg}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")):(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Invalid License Key "),this.padAndOutput("* Your license key is not valid."," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${rg}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""))),this.watermarkMessage="Invalid License"}outputExpiredTrialKey(e,i,o){Kt.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Trial Period Expired. "),this.padAndOutput(`* Your trial only license for ${o} expired on ${e}.`," ","*"),this.padAndOutput("* Please email info@ag-grid.com to purchase a license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="Trial Period Expired"}outputMissingLicenseKey(e){Kt.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${e} License `),this.centerPadAndOutput(" License Key Not Found "),this.padAndOutput(`* All ${e} features are unlocked for trial.`," ","*"),this.padAndOutput("* If you want to hide the watermark please email info@ag-grid.com for a trial license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="For Trial Use Only"}outputExpiredKey(e,i,o){Kt.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${o} License `),this.centerPadAndOutput(" Incompatible Software Version "),this.padAndOutput(`* Your license key works with versions of ${o} released before ${e}.`," ","*"),this.padAndOutput(`* The version you are trying to use was released on ${i}.`," ","*"),this.padAndOutput("* Please contact info@ag-grid.com to renew your license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="License Expired"}};Fc.RELEASE_INFORMATION="MTc0MDAzOTI3Mjg4Mg==",Fc.gridContext=!1;var Xs=Fc;import{_ModuleSupport as $s}from"ag-charts-community";import{_ModuleSupport as pk}from"ag-charts-community";function Gc(t,e,i){const o=(n,a,r,l)=>{let c=t[0];for(let h=n;r>0?h<=a:h>a;h+=r){const p=t[h];if(l(c,p))return!0;c=p}return!1},s=Math.floor(t.length/2);return o(e,s,e,i)?!0:o(t.length-e,s,-e,i)}import{_ModuleSupport as uk}from"ag-charts-community";var{OR:gk,POSITIVE_NUMBER:yk,NAN:fk,AxisInterval:mk,Validate:xk}=uk,Wc=class extends mk{constructor(){super(...arguments),this.minSpacing=NaN}};d([xk(gk(yk,fk))],Wc.prototype,"minSpacing",2);import{_ModuleSupport as Hc}from"ag-charts-community";import{_ModuleSupport as lg}from"ag-charts-community";import{_ModuleSupport as Sk}from"ag-charts-community";var{BaseProperties:cg,ChartAxisDirection:bk,ARRAY:vk,BOOLEAN:Kc,COLOR_STRING:Uc,FONT_STYLE:Mk,FONT_WEIGHT:kk,LINE_DASH:Ak,NUMBER:hg,OBJECT:Ik,POSITIVE_NUMBER:Dk,RATIO:dg,STRING:pg,UNION:ug,AND:Tk,Validate:Lt,MATCHING_CROSSLINE_TYPE:gg,createId:Ck,Group:Yc}=Sk,ai=class extends cg{constructor(){super(...arguments),this.fontSize=14,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)"}};d([Lt(Kc,{optional:!0})],ai.prototype,"enabled",2),d([Lt(pg,{optional:!0})],ai.prototype,"text",2),d([Lt(Mk,{optional:!0})],ai.prototype,"fontStyle",2),d([Lt(kk,{optional:!0})],ai.prototype,"fontWeight",2),d([Lt(Dk)],ai.prototype,"fontSize",2),d([Lt(pg)],ai.prototype,"fontFamily",2),d([Lt(hg)],ai.prototype,"padding",2),d([Lt(Uc,{optional:!0})],ai.prototype,"color",2),d([Lt(Kc,{optional:!0})],ai.prototype,"parallel",2);var Ie=class extends cg{constructor(){super(...arguments),this.id=Ck(this),this.shape="polygon",this.label=new ai,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.direction=bk.X,this.axisInnerRadius=0,this.axisOuterRadius=0,this.lineGroup=new Yc({name:this.id}),this.rangeGroup=new Yc({name:this.id}),this.labelGroup=new Yc({name:this.id}),this._isRange=void 0}assignCrossLineGroup(t,e){t!==this._isRange&&(t?this.rangeGroup.appendChild(e):this.lineGroup.appendChild(e)),this._isRange=t}setSectorNodeProps(t){t.fill=this.fill,t.fillOpacity=this.fillOpacity??1,t.stroke=this.stroke,t.strokeOpacity=this.strokeOpacity??1,t.strokeWidth=this.strokeWidth??1,t.lineDash=this.lineDash}setLabelNodeProps(t,e,i,o,s){const{label:n}=this;t.x=e,t.y=i,t.text=n.text,t.textAlign="center",t.textBaseline=o,t.rotation=s,t.rotationCenterX=e,t.rotationCenterY=i,t.fill=n.color,t.fontFamily=n.fontFamily,t.fontSize=n.fontSize,t.fontStyle=n.fontStyle,t.visible=!0}};d([Lt(Kc,{optional:!0})],Ie.prototype,"enabled",2),d([Lt(ug(["range","line"],"a crossLine type"),{optional:!0})],Ie.prototype,"type",2),d([Lt(Tk(gg("range"),vk.restrict({length:2})),{optional:!0})],Ie.prototype,"range",2),d([Lt(gg("value"),{optional:!0})],Ie.prototype,"value",2),d([Lt(Uc,{optional:!0})],Ie.prototype,"fill",2),d([Lt(dg,{optional:!0})],Ie.prototype,"fillOpacity",2),d([Lt(Uc,{optional:!0})],Ie.prototype,"stroke",2),d([Lt(hg,{optional:!0})],Ie.prototype,"strokeWidth",2),d([Lt(dg,{optional:!0})],Ie.prototype,"strokeOpacity",2),d([Lt(Ak,{optional:!0})],Ie.prototype,"lineDash",2),d([Lt(ug(["polygon","circle"],"a shape"))],Ie.prototype,"shape",2),d([Lt(Ik)],Ie.prototype,"label",2);var{ChartAxisDirection:Nk,validateCrossLineValues:Ok,normalizeAngle360:jc,isNumberEqual:yg,Group:Lk,Path:fg,Sector:Rk,RotatableText:Ek,ContinuousScale:wk,BandScale:Pk}=lg,Xc=class extends Ie{constructor(){super(),this.direction=Nk.X,this.polygonNode=new fg,this.sectorNode=new Rk,this.lineNode=new fg,this.crossLineRange=new Lk,this.labelNode=new Ek,this.ticks=[],this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.crossLineRange.append(this.lineNode),this.labelGroup.append(this.labelNode)}update(t){const{scale:e,shape:i,type:o,value:s,range:n}=this;if(!e||!o||!Ok(o,s,n,e,()=>{if(!wk.is(e))return!0;const[r,l]=n??[s,void 0],{domain:c}=e;return r>=c[0]&&r<=c[1]&&(o==="line"||l>=r&&l<=c[1])})){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.rangeGroup.visible=t,this.lineGroup.visible=t,this.labelGroup.visible=t,o==="line"&&i==="circle"&&Pk.is(e)&&(this.type="range",this.range=[s,s]),this.updateLineNode(t),this.updatePolygonNode(t),this.updateSectorNode(t),this.updateLabelNode(t)}updateLineNode(t){const{scale:e,type:i,value:o,lineNode:s}=this;if(!t||i!=="line"||!e){s.visible=!1;return}const n=e.convert(o);if(isNaN(n)){s.visible=!1;return}const{axisInnerRadius:a,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(n),c=r*Math.sin(n),h=a*Math.cos(n),p=a*Math.sin(n);s.path.clear(!0),s.path.moveTo(h,p),s.path.lineTo(l,c),this.assignCrossLineGroup(!1,this.crossLineRange)}updatePolygonNode(t){const{polygonNode:e,range:i,scale:o,shape:s,type:n,ticks:a}=this;if(!t||n!=="range"||s!=="polygon"||!o||!i){e.visible=!1;return}const{axisInnerRadius:r,axisOuterRadius:l}=this,c=a.indexOf(i[0]),h=a.indexOf(i[1]),u=(c<=h?a.slice(c,h+1):a.slice(c).concat(a.slice(0,h+1))).map(y=>o.convert(y));e.visible=!0,this.setSectorNodeProps(e);const{path:g}=e;g.clear(!0),u.forEach((y,f)=>{const m=l*Math.cos(y),x=l*Math.sin(y);f===0?g.moveTo(m,x):g.lineTo(m,x)}),r===0?g.lineTo(0,0):u.slice().reverse().forEach(y=>{const f=r*Math.cos(y),m=r*Math.sin(y);g.lineTo(f,m)}),e.path.closePath(),this.assignCrossLineGroup(!0,this.crossLineRange)}updateSectorNode(t){const{sectorNode:e,range:i,scale:o,shape:s,type:n}=this;if(!t||n!=="range"||s!=="circle"||!o||!i){e.visible=!1;return}const{axisInnerRadius:a,axisOuterRadius:r}=this,l=i.map(p=>o.convert(p)),c=o.step??0,h=o instanceof lg.BandScale?c/2:0;e.visible=!0,this.setSectorNodeProps(e),e.centerX=0,e.centerY=0,e.innerRadius=a,e.outerRadius=r,e.startAngle=l[0]-h,e.endAngle=l[1]+h,this.assignCrossLineGroup(!0,this.crossLineRange)}updateLabelNode(t){const{label:e,labelNode:i,range:o,scale:s,type:n,ticks:a}=this;if(!t||e.enabled===!1||!e.text||!s||n==="range"&&!o){i.visible=!1;return}i.visible=!0;const{axisInnerRadius:r,axisOuterRadius:l}=this;let c,h,p,u;if(n==="line"){const g=jc(s.convert(this.value)),y=1.5*Math.PI,f=yg(g,y)||g>y||gjc(s.convert(v)));let f=(g+y)/2;g>y&&(f-=Math.PI),f=jc(f);const m=(yg(f,0)||f>0)&&fr.value);return{niceDomain:s,primaryTickCount:void 0,tickDomain:s,ticks:a,fractionDigits:0,bbox:this.getBBox()}}update(){super.update(),this.updateRadiusLine()}normalizedAngles(){const t=Qs(-Math.PI/2+hr(this.startAngle)),e=this.endAngle!=null?Gk(hr(this.endAngle)-hr(this.startAngle)):2*Math.PI,i=t+e;return[t,i]}computeRange(){this.range=this.normalizedAngles()}updateSelections(){const t=this.tickData;this.gridLineGroupSelection.update(this.gridLength&&this.gridLine.enabled?t:[]),this.tickLineGroupSelection.update(this.tick.enabled?t:[]),this.tickLabelGroupSelection.update(this.label.enabled?t:[]),this.gridLineGroupSelection.cleanup(),this.tickLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup()}updatePosition(){const{translation:t,axisGroup:e,gridGroup:i,crossLineRangeGroup:o,crossLineLineGroup:s,crossLineLabelGroup:n}=this,a=Math.floor(t.x),r=Math.floor(t.y);e.translationX=a,e.translationY=r,i.translationX=a,i.translationY=r,o.translationX=a,o.translationY=r,s.translationX=a,s.translationY=r,n.translationX=a,n.translationY=r}updateRadiusLine(){const t=this.radiusLine,{path:e}=t;e.clear(!0);const{points:i,closePath:o}=this.getAxisLinePoints();i.forEach(({x:s,y:n,moveTo:a,arc:r,radius:l=0,startAngle:c=0,endAngle:h=0})=>{r?e.arc(s,n,l,c,h):a?e.moveTo(s,n):e.lineTo(s,n)}),o&&e.closePath(),t.visible=this.line.enabled,t.stroke=this.line.stroke,t.strokeWidth=this.line.width,t.fill=void 0}getAxisLinePoints(){const{scale:t,shape:e,gridLength:i}=this,[o,s]=this.range,n=Zs(s-o,2*Math.PI),a=[];if(e==="circle")n?a.push({x:i,y:0,moveTo:!0},{x:0,y:0,radius:i,startAngle:0,endAngle:2*Math.PI,arc:!0,moveTo:!1}):a.push({x:i*Math.cos(o),y:i*Math.sin(o),moveTo:!0},{x:0,y:0,radius:i,startAngle:Qs(o),endAngle:Qs(s),arc:!0,moveTo:!1});else if(e==="polygon"){const r=t.ticks({nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.map(l=>t.convert(l));r&&r.length>2&&r.forEach((l,c)=>{const h=i*Math.cos(l),p=i*Math.sin(l),u=c===0;a.push({x:h,y:p,moveTo:u})})}return{points:a,closePath:n}}updateGridLines(){const{scale:t,gridLength:e,gridLine:{style:i,width:o},innerRadiusRatio:s}=this;if(!(i&&e>0))return;const n=e*s,a=i.length;this.gridLineGroupSelection.each((r,l,c)=>{const{value:h}=l,{stroke:p,lineDash:u}=i[c%a],g=t.convert(h);r.x1=n*Math.cos(g),r.y1=n*Math.sin(g),r.x2=e*Math.cos(g),r.y2=e*Math.sin(g),r.stroke=p,r.strokeWidth=o,r.lineDash=u,r.fill=void 0}),this.gridLineGroupSelection.cleanup()}updateLabels(){const{label:t,tickLabelGroupSelection:e}=this;e.each((i,o,s)=>{const n=this.labelData[s];if(!n||n.hidden){i.visible=!1;return}i.text=n.text,i.setFont(t),i.fill=t.color,i.x=n.x,i.y=n.y,i.textAlign=n.textAlign,i.textBaseline=n.textBaseline,i.visible=!0,n.rotation?(i.rotation=n.rotation,i.rotationCenterX=n.x,i.rotationCenterY=n.y):i.rotation=0})}updateTickLines(){const{scale:t,gridLength:e,tick:i,tickLineGroupSelection:o}=this;o.each((s,n)=>{const{value:a}=n,r=t.convert(a),l=Math.cos(r),c=Math.sin(r);s.x1=e*l,s.y1=e*c,s.x2=(e+i.size)*l,s.y2=(e+i.size)*c,s.stroke=i.stroke,s.strokeWidth=i.width})}createLabelNodeData(t,e,i){const{label:o,gridLength:s,scale:n,tick:a}=this;if(!o.enabled)return[];const r=new Hk,l=i.x-this.translation.x,c=i.x+i.width-this.translation.x,h=t.map((p,u)=>{const{value:g}=p,y=s+o.spacing+a.size,f=n.convert(g),m=Math.cos(f),x=Math.sin(f),v=y*m,S=y*x,{textAlign:b,textBaseline:k}=this.getLabelAlign(f),I=u===t.length-1&&g!==t[0]&&Zs(Qs(f),Qs(n.convert(t[0]))),M=this.getLabelRotation(f);let A=String(g);if(o.formatter){const{callbackCache:N}=this.moduleCtx;A=N.call(o.formatter,{value:g,index:u})??""}r.text=A,r.x=v,r.y=S,r.setFont(o),r.textAlign=b,r.textBaseline=k,r.rotation=M,M&&(r.rotationCenterX=v,r.rotationCenterY=S);let T=M?Kk.toCanvas(r):r.getBBox();if(T&&e.hideWhenNecessary&&!M){const N=l-T.x,L=T.x+T.width-c,D=1;if(N>D||L>D){const C=T.width-Math.max(N,L);A=Vk.wrapText(A,{maxWidth:C,font:o,textWrap:"never"}),A===Fk.EllipsisChar&&(A=""),r.text=A,T=r.getBBox()}}return{text:A,x:v,y:S,textAlign:b,textBaseline:k,hidden:A===""||p.hidden||I,rotation:M,box:T}});return o.avoidCollisions&&this.avoidLabelCollisions(h),h}computeLabelsBBox(t,e){this.labelData=this.createLabelNodeData(this.tickData,t,e);const i=this.labelData.map(({box:o})=>o).filter(o=>o!=null);return!this.label.enabled||i.length===0?null:Uk.merge(i)}getLabelOrientation(){const{label:t}=this;return t instanceof Zc?t.orientation:"fixed"}getLabelRotation(t){let e=hr(this.label.rotation??0);t=Qs(t);const i=this.getLabelOrientation();return i==="parallel"?(e+=t,t>=0&&t=Math.PI/2&&t<1.5*Math.PI&&(e+=Math.PI)),e}getLabelAlign(t){const e=Math.cos(t),i=Math.sin(t);let o,s;const n=this.getLabelOrientation(),a=Zs(e,0),r=Zs(i,0),l=Zs(e,1),c=Zs(i,-1),h=e>0&&!a,p=i>0&&!r;return n==="parallel"?(o="center",s=l&&r||p?"top":"bottom"):n==="perpendicular"?(o=c||h?"left":"right",s="middle"):(o="right",a?o="center":h&&(o="left"),s="bottom",r?s="middle":p&&(s="top")),{textAlign:o,textBaseline:s}}updateCrossLines(){const{shape:t,gridLength:e,innerRadiusRatio:i}=this;this.crossLines.forEach(o=>{o instanceof Xc&&(o.ticks=this.tickData.map(s=>s.value),o.shape=t,o.axisOuterRadius=e,o.axisInnerRadius=e*i)}),super.updateCrossLines()}};Xn.CrossLineConstructor=Xc,d([zk("rotation"),$c(mg)],Xn.prototype,"startAngle",2),d([$c(mg,{optional:!0})],Xn.prototype,"endAngle",2);var{RATIO:xg,OBJECT:Yk,Validate:Qc,isNumberEqual:Sg,CategoryScale:jk}=pk,es=class extends Xn{constructor(t){super(t,new jk),this.groupPaddingInner=0,this.paddingInner=0,this.interval=new Wc}generateAngleTicks(){const{scale:t,gridLength:e}=this,{values:i,minSpacing:o}=this.interval,s=i??t.ticks({nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})??[];if(s.length<2||isNaN(o))return s.map(c=>({value:c,visible:!0}));const n=s[0],a=t.convert(n),r=e*Math.cos(a),l=e*Math.sin(a);for(let c=1;cMath.PI)break;const u=e*Math.cos(p),g=e*Math.sin(p);if(Math.sqrt((u-r)**2+(g-l)**2)>o){const f=new Set([n]);return Gc(s,c,(m,x)=>{f.add(x)}),s.map(m=>{const x=f.has(m);return{value:m,visible:x}})}}return[{value:n,visible:!0}]}avoidLabelCollisions(t){let{minSpacing:e}=this.label;if(Number.isFinite(e)||(e=0),t.length<3)return;const i=(l,c)=>{if(l.hidden||c.hidden)return!1;const h=l.box.clone().grow(e/2),p=c.box.clone().grow(e/2);return h.collidesBBox(p)},o=t[0],s=t.at(-1),n=new Set([o]),a=Sg(o.x,s.x)&&Sg(o.y,s.y),r=Math.floor(t.length/2);for(let l=1;l<=r;l++){const c=a?t.slice(0,-1):t;if(!Gc(c,l,i)){Gc(c,l,(p,u)=>{n.add(u)});break}}t.forEach(l=>{n.has(l)||(l.hidden=!0,l.box=void 0)})}};es.className="AngleCategoryAxis",es.type="angle-category",d([Qc(xg)],es.prototype,"groupPaddingInner",2),d([Qc(xg)],es.prototype,"paddingInner",2),d([Qc(Yk)],es.prototype,"interval",2);var Xk={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"angle-category",moduleFactory:t=>new es(t)};import{_ModuleSupport as $k}from"ag-charts-community";import{_ModuleSupport as Zk}from"ag-charts-community";var{range:bg,isDenseInterval:Qk,isNumberEqual:qk,LinearScale:qc}=Zk,Jk=class sg extends qc{constructor(){super(...arguments),this.arcLength=0}static getNiceStepAndTickCount(e,i){const[o,s]=i;let n=qc.getTickStep(o,s,e);const a=isNaN(e.maxTickCount)?1/0:e.maxTickCount,r=Math.abs(s-o)/n;let l=Math.pow(2,Math.ceil(Math.log(r)/Math.log(2)));return l>a&&(l/=2,n*=2),{count:l,step:n}}ticks(e,i=this.domain){const{arcLength:o}=this;if(!i||i.length<2||i.some(c=>!isFinite(c))||o<=0)return[];const{nice:s,interval:n}=e,[a,r]=i;if(n){const c=Math.abs(n),h=this.getPixelRange();if(!Qk((r-a)/c,h))return bg(a,r,c)}let l;if(s&&this.hasNiceRange()){const c=super.niceDomain(e,i);l=sg.getNiceStepAndTickCount(e,c).step}else l=qc.getTickStep(a,r,e);return bg(a,r,l)}hasNiceRange(){const e=this.range.slice().sort((o,s)=>o-s);return[Math.PI,2*Math.PI].some(o=>qk(o,e[1]-e[0]))}niceDomain(e,i=this.domain){const o=super.niceDomain(e,i);if(!this.hasNiceRange())return o;const s=o[0]>o[1],n=s?o[1]:o[0],{step:a,count:r}=sg.getNiceStepAndTickCount(e,o),l=1/a,c=a>=1?Math.ceil(n/a+r)*a:Math.ceil((n+r*a)*l)/l;return s?[c,n]:[n,c]}getPixelRange(){return this.arcLength}},{AND:vg,Default:Mg,GREATER_THAN:tA,LESS_THAN:eA,NUMBER_OR_NAN:kg,OBJECT:iA,Validate:Jc,angleBetween:oA,isNumberEqual:Ag,normalisedExtentWithMetadata:sA,findMinMax:nA}=$k,qs=class extends Xn{constructor(t){super(t,new Jk),this.shape="circle",this.min=NaN,this.max=NaN,this.interval=new Wc}normaliseDataDomain(t){const{min:e,max:i}=this,{extent:o,clipped:s}=sA(t,e,i);return{domain:o,clipped:s}}updateScale(){super.updateScale(),this.scale.arcLength=this.getRangeArcLength()}getRangeArcLength(){const{range:t}=this,e=Math.min(...t),i=Math.max(...t),o=oA(e,i)||2*Math.PI,s=this.gridLength;return o*s}generateAngleTicks(t){const{scale:e,range:i,nice:o}=this,{values:s,step:n,minSpacing:a,maxSpacing:r}=this.interval;let l;if(s==null){const{arcLength:c}=e,h=r?Math.floor(c/r):1,p=a?Math.floor(c/a):1/0,u=Math.floor(4/Math.PI*Math.abs(i[0]-i[1])),g=Math.max(h,Math.min(p,u)),y={nice:o,interval:n,tickCount:g,minTickCount:h,maxTickCount:p};l=e.ticks(y,t)}else{const[c,h]=nA(t.map(Number));l=s.filter(p=>p>=c&&p<=h).sort((p,u)=>p-u)}return l.map(c=>({value:c,visible:!0}))}avoidLabelCollisions(t){let{minSpacing:e}=this.label;Number.isFinite(e)||(e=0);const i=(n,a)=>{if(n.hidden||a.hidden)return!1;const r=n.box.clone().grow(e/2),l=a.box.clone().grow(e/2);return r.collidesBBox(l)},o=t[0],s=t.at(-1);o!==s&&Ag(o.x,s.x)&&Ag(o.y,s.y)&&(s.hidden=!0);for(let n=1;n{l%n>0&&(r.hidden=!0,r.box=void 0)});return}}t.forEach((n,a)=>{a>0&&(n.hidden=!0,n.box=void 0)})}};qs.className="AngleNumberAxis",qs.type="angle-number",d([Jc(vg(kg,eA("max"))),Mg(NaN)],qs.prototype,"min",2),d([Jc(vg(kg,tA("min"))),Mg(NaN)],qs.prototype,"max",2),d([Jc(iA)],qs.prototype,"interval",2);var aA={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"angle-number",moduleFactory:t=>new qs(t)};import{_ModuleSupport as Ig}from"ag-charts-community";var{OrdinalTimeScale:rA}=Ig,th=class extends Ig.CategoryAxis{constructor(t){super(t,new rA)}};th.className="OrdinalTimeAxis",th.type="ordinal-time";var lA={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"ordinal-time",moduleFactory:t=>new th(t)};import{_ModuleSupport as cA}from"ag-charts-community";import{_ModuleSupport as dr}from"ag-charts-community";import{_ModuleSupport as eh}from"ag-charts-community";var{ChartAxisDirection:hA,Validate:dA,NUMBER:pA,validateCrossLineValues:uA,clamp:Dg,normalizeAngle360:gA,toRadians:yA,isNumberEqual:fA,Group:mA,Path:xA,Sector:SA,RotatableText:bA}=eh,Tg=class extends ai{constructor(){super(...arguments),this.positionAngle=void 0}};d([dA(pA,{optional:!0})],Tg.prototype,"positionAngle",2);var ih=class extends Ie{constructor(){super(),this.direction=hA.Y,this.label=new Tg,this.polygonNode=new xA,this.sectorNode=new SA,this.crossLineRange=new mA,this.labelNode=new bA,this.outerRadius=0,this.innerRadius=0,this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.labelGroup.append(this.labelNode)}update(t){const{scale:e,type:i,value:o,range:s}=this;if(!e||!i||!uA(i,o,s,e)){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}i==="line"&&e instanceof eh.BandScale&&(this.type="range",this.range=[o,o]),this.updateRadii();const{innerRadius:n,outerRadius:a}=this;t&&(t=n>=this.axisInnerRadius&&a<=this.axisOuterRadius),this.rangeGroup.visible=t,this.lineGroup.visible=t,this.labelGroup.visible=t,this.updatePolygonNode(t),this.updateSectorNode(t),this.updateLabelNode(t),this.assignCrossLineGroup(this.type==="range",this.crossLineRange)}updateRadii(){const{range:t,scale:e,type:i,axisInnerRadius:o,axisOuterRadius:s}=this;if(!e)return{innerRadius:0,outerRadius:0};const n=l=>s+o-l;let a,r;if(i==="line")a=n(e.convert(this.value)),r=a;else{const l=Math.abs(e?.bandwidth??0),c=t.map(h=>e.convert(h));a=n(Math.max(...c)),r=n(Math.min(...c))+l}this.outerRadius=a,this.innerRadius=r}drawPolygon(t,e,i){e.forEach((o,s)=>{const n=t*Math.cos(o),a=t*Math.sin(o);s===0?i.path.moveTo(n,a):i.path.lineTo(n,a)}),i.path.closePath()}updatePolygonNode(t){const{gridAngles:e,polygonNode:i,scale:o,shape:s,type:n,innerRadius:a,outerRadius:r}=this;if(!t||s!=="polygon"||!o||!e){i.visible=!1;return}i.visible=!0;const l=this.getPadding();i.path.clear(!0),this.drawPolygon(r-l,e,i);const c=e.slice().reverse(),h=n==="line"?r-l:a+l;this.drawPolygon(h,c,i),this.setSectorNodeProps(i)}updateSectorNode(t){const{axisInnerRadius:e,axisOuterRadius:i,scale:o,sectorNode:s,shape:n,innerRadius:a,outerRadius:r}=this;if(!t||n!=="circle"||!o){s.visible=!1;return}s.visible=!0,s.startAngle=0,s.endAngle=2*Math.PI;const l=this.getPadding(),c=Dg(e,a+l,i),h=Dg(e,r-l,i);s.innerRadius=Math.min(c,h),s.outerRadius=Math.max(c,h),this.setSectorNodeProps(s)}updateLabelNode(t){const{innerRadius:e,label:i,labelNode:o,scale:s,shape:n,type:a}=this;if(!t||i.enabled===!1||!i.text||!s){o.visible=!1;return}const r=gA(yA((i.positionAngle??0)-90)),l=(fA(r,0)||r>0)&&rthis.getTickLabelProps(v,c));return this.generatedTicks={ticks:u,labels:x},{ticks:g,tickDomain:y,niceDomain:m,primaryTickCount:p,fractionDigits:f,bbox:void 0}}updateSelections(){const{generatedTicks:t}=this;if(!t)return;const{ticks:e,labels:i}=t;this.gridLineGroupSelection.update(this.gridLength?e:[]),this.tickLineGroupSelection.update(e),this.tickLabelGroupSelection.update(i),this.gridPathSelection.update(this.gridLine.enabled?this.prepareGridPathTickData(e):[]),this.gridLineGroupSelection.cleanup(),this.tickLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup(),this.gridPathSelection.cleanup()}updateLabels(){if(!this.label.enabled)return;const t=dr.resetAxisLabelSelectionFn();this.tickLabelGroupSelection.each((e,i)=>{e.fill=i.fill,e.fontFamily=i.fontFamily,e.fontSize=i.fontSize,e.fontStyle=i.fontStyle,e.fontWeight=i.fontWeight,e.text=i.text,e.textBaseline=i.textBaseline,e.textAlign=i.textAlign??"center",e.setProperties(t(e,i))})}updateGridLines(){super.updateGridLines();const{gridLine:{style:t,width:e},shape:i,generatedTicks:o}=this;if(!t||!o)return;const s=t.length,n=(u,g)=>{const{stroke:y,lineDash:f}=t[g%s];u.stroke=y,u.strokeWidth=e,u.lineDash=f,u.fill=void 0},[a,r]=this.gridRange??[0,2*Math.PI],l=IA(r-a,2*Math.PI),p=i==="circle"?(u,g)=>{const{path:y}=u;y.clear(!0);const f=this.getTickRadius(g);l?(y.moveTo(f,0),y.arc(0,0,f,0,2*Math.PI)):(y.moveTo(f*Math.cos(a),f*Math.sin(a)),y.arc(0,0,f,Ng(a),Ng(r))),l&&y.closePath()}:(u,g)=>{const{path:y}=u,f=this.gridAngles;if(y.clear(!0),!f||f.length<3)return;const m=this.getTickRadius(g);f.forEach((x,v)=>{const S=m*Math.cos(x),b=m*Math.sin(x);v===0?y.moveTo(S,b):y.lineTo(S,b),f.forEach((k,I)=>{const M=m*Math.cos(k),A=m*Math.sin(k);I===0?y.moveTo(M,A):y.lineTo(M,A)}),y.closePath()}),y.closePath()};this.gridPathSelection.each((u,g,y)=>{n(u,y),p(u,g)})}updateTitle(){const t=r=>r.defaultValue,{title:e,range:i,moduleCtx:{callbackCache:o}}=this,{formatter:s=t}=this.title;e.caption.enabled=e.enabled,e.caption.fontFamily=e.fontFamily,e.caption.fontSize=e.fontSize,e.caption.fontStyle=e.fontStyle,e.caption.fontWeight=e.fontWeight,e.caption.color=e.color,e.caption.wrapping=e.wrapping;let n=!1;const a=e.caption.node;e.enabled&&(n=!0,a.rotation=Math.PI/2,a.x=Math.floor((i[0]+i[1])/2),a.y=-TA.SMALL_PADDING,a.textAlign="center",a.textBaseline="bottom",a.text=o.call(s,this.getTitleFormatterParams())),a.visible=n}updateCrossLines(){this.crossLines.forEach(t=>{if(t instanceof ih){const{shape:e,gridAngles:i,range:o,innerRadiusRatio:s}=this,n=o[0];t.shape=e,t.gridAngles=i,t.axisOuterRadius=n,t.axisInnerRadius=n*s}}),super.updateCrossLines()}createLabel(){return new sh}getTickLabelProps(t,e){const{label:i}=this,{combinedRotation:o,textBaseline:s,textAlign:n}=e,a=this.scale.range,r=t.tickLabel,c=i.getSideFlag()*(this.getTickSize()+i.spacing+this.seriesAreaPadding),h=r!==""&&r!=null;return{...this.getLabelStyles({value:t.tickLabel}),tickId:t.tickId,rotation:o,rotationCenterX:c,translationY:t.translationY,text:r,textAlign:n,textBaseline:s,visible:h,x:c,y:0,range:a}}};pr.CrossLineConstructor=ih,d([oh(Cg),MA(0)],pr.prototype,"positionAngle",2);var{RATIO:nh,ProxyPropertyOnWrite:Og,Validate:ah,CategoryScale:Lg}=cA,is=class extends pr{constructor(t){super(t,new Lg),this.shape="circle",this.groupPaddingInner=0,this.paddingInner=0,this.paddingOuter=0}normaliseDataDomain(t){return{domain:t,clipped:!1}}prepareGridPathTickData(t){return t.slice().reverse()}getTickRadius(t){const{scale:e,innerRadiusRatio:i}=this,o=e.range[0],s=o*i;if(Lg.is(e)){const n=e.domain,a=n.length-1-n.indexOf(t.tick);return a===0?s:e.inset+e.step*(a-.5)+e.bandwidth/2}else{const n=(o-s)/e.domain.length;return o-t.translationY+s-n/2}}};is.className="RadiusCategoryAxis",is.type="radius-category",d([ah(nh)],is.prototype,"groupPaddingInner",2),d([Og("scale","paddingInner"),ah(nh)],is.prototype,"paddingInner",2),d([Og("scale","paddingOuter"),ah(nh)],is.prototype,"paddingOuter",2);var wA={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radius-category",moduleFactory:t=>new is(t)};import{_ModuleSupport as PA}from"ag-charts-community";var{AND:Rg,Default:Eg,GREATER_THAN:_A,LESS_THAN:BA,NUMBER_OR_NAN:wg,Validate:Pg,normalisedExtentWithMetadata:zA,LinearScale:VA}=PA,$n=class extends pr{constructor(t){super(t,new VA),this.shape="polygon",this.min=NaN,this.max=NaN}prepareGridPathTickData(t){const{scale:e}=this,i=e.domain[1];return t.filter(({tick:o})=>o!==i).sort((o,s)=>s.tick-o.tick)}getTickRadius(t){const{scale:e}=this,i=e.range[0],o=i*this.innerRadiusRatio;return i-t.translationY+o}normaliseDataDomain(t){const{min:e,max:i}=this,{extent:o,clipped:s}=zA(t,e,i);return{domain:o,clipped:s}}};$n.className="RadiusNumberAxis",$n.type="radius-number",d([Pg(Rg(wg,BA("max"))),Eg(NaN)],$n.prototype,"min",2),d([Pg(Rg(wg,_A("min"))),Eg(NaN)],$n.prototype,"max",2);var FA={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radius-number",moduleFactory:t=>new $n(t)};import{_ModuleSupport as GA}from"ag-charts-community";import{_ModuleSupport as WA}from"ag-charts-community";var{Chart:HA}=WA;function KA(t){return t.type==="sankey"||t.type==="chord"}var rh=class extends HA{getChartType(){return"flow-proportion"}async updateData(){await super.updateData();const{nodes:t}=this.getOptions();this.series.forEach(e=>{KA(e)&&e.setChartNodes(t)})}performLayout(t){const{seriesRoot:e,annotationRoot:i}=this,{layoutBox:o}=t;o.shrink(this.seriesArea.padding.toJson());const s=o.clone();this.seriesRect=s,this.animationRect=s,e.visible=this.series.some(n=>n.visible);for(const n of[e,i])n.translationX=Math.floor(s.x),n.translationY=Math.floor(s.y);this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:e.visible,rect:s,paddedRect:s}})}};rh.className="FlowProportionChart",rh.type="flow-proportion";var{isAgFlowProportionChartOptions:UA}=GA,YA={type:"chart",name:"flow-proportion",detect:UA,create(t,e){return new rh(t,e)}};import{_ModuleSupport as jA}from"ag-charts-community";import{_ModuleSupport as XA}from"ag-charts-community";var lt={};nk(lt,{error:()=>Bg,errorOnce:()=>qA,log:()=>$A,logGroup:()=>tI,reset:()=>JA,table:()=>ZA,warn:()=>_g,warnOnce:()=>QA});var Zn=new Set;function $A(...t){console.log(...t)}function _g(t,...e){console.warn(`AG Charts - ${t}`,...e)}function Bg(t,...e){typeof t=="object"?console.error("AG Charts error",t,...e):console.error(`AG Charts - ${t}`,...e)}function ZA(...t){console.table(...t)}function QA(t,...e){const i=`Logger.warn: ${t}`;Zn.has(i)||(_g(t,...e),Zn.add(i))}function qA(t,...e){const i=`Logger.error: ${t}`;Zn.has(i)||(Bg(t,...e),Zn.add(i))}function JA(){Zn.clear()}function tI(t,e){console.groupCollapsed(t);try{return e()}finally{console.groupEnd()}}function eI(t){return Array.from(new Set(t))}function zg(t,e,i){if(t>e)return;let o;for(;e>=t;){const s=Math.floor((e+t)/2),n=i(s);n==null?e=s-1:(o=n,t=s+1)}return o}function iI(t,e=0,i){const{leading:o=!1,trailing:s=!0,maxWait:n=1/0}=i??{};let a,r;if(nr=null,e),t(...c);return}let h=e;if(n!==1/0&&r){const p=Date.now()-r;e>n-p&&(h=n-p)}clearTimeout(a),r??(r=Date.now()),a=setTimeout(()=>{r=null,s&&t(...c)},h)}return Object.assign(l,{cancel(){clearTimeout(a),r=null}})}function*oI(...t){for(const e of t)yield*e}function ee(t){return t!=null}function sI(t){return Array.isArray(t)}function Qn(t){return t instanceof Date}function lh(t){return Qn(t)&&!isNaN(Number(t))}function Rt(t){return typeof t=="object"&&t!==null&&!sI(t)}function nI(t){return typeof t=="string"}function Et(t){return typeof t=="number"}function vo(t){return Number.isFinite(t)}var{CartesianAxis:Vg,Chart:aI,ChartAxisDirection:qn,LinearScale:rI,PolarAxis:lI,isBetweenAngles:ur,normalizeAngle360Inclusive:cI,sectorBox:hI}=XA;function dI(t){return t.type==="radial-gauge"}function pI(t){return t.type==="linear-gauge"}var ch=class extends aI{getChartType(){return"gauge"}updateRadialGauge(t,e){const i=this.axes.find(T=>T.direction===qn.X);if(!(i instanceof lI))return;i.computeRange();const o=t.x,s=o+t.width,n=t.y,a=n+t.height,[r,l]=i.range,h=cI(l-r)>Math.PI,p=h||ur(1.5*Math.PI,r,l),u=h||ur(0*Math.PI,r,l),g=h||ur(.5*Math.PI,r,l),y=h||ur(1*Math.PI,r,l);let f;y&&!u?f="right":!y&&u?f="left":f="center";let m;p&&!g?m="bottom":!p&&g?m="top":m="middle";const x=hI({startAngle:r,endAngle:l,innerRadius:0,outerRadius:.5}),v=-(x.x+x.width/2)*2,S=-(x.y+x.height/2)*2,{minimumRadius:b=0,maximumRadius:k}=e,I=Math.max(.5*Math.min(t.width/x.width,t.height/x.height),0);let M=Math.min(k??1/0,Math.max(I,b??0));const A=8;for(let T=0;T0)M=Math.max(M-O,b);else break}i.translation.x=t.x+t.width/2+v*M,i.translation.y=t.y+t.height/2+S*M,e.centerX=t.width/2+v*M,e.centerY=t.height/2+S*M,e.radius=M,e.textAlign=f,e.verticalAlign=m,(M===0||M>I)&<.warnOnce("There was insufficient space to display the Radial Gauge.")}updateLinearGauge(t,e){const i=this.axes.find(x=>x.direction===qn.X),o=this.axes.find(x=>x.direction===qn.Y);if(!(i instanceof Vg)||!(o instanceof Vg))return t;const{horizontal:s,thickness:n}=e;let a=0,r=0;const l=new rI,c=s?i:o;l.domain=[0,100],l.range=c.range;const h=l.ticks({nice:c.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0});s?a=e.computeInset(qn.X,h):r=e.computeInset(qn.Y,h);const p=t.width-Math.abs(a),u=t.height-Math.abs(r),{width:g,height:y}=s?{width:Math.max(p,0),height:Math.max(Math.min(u,n),0)}:{width:Math.max(Math.min(p,n),0),height:Math.max(u,0)},f=t.x+(p-g)/2+Math.max(a,0),m=t.y+(u-y)/2-Math.min(r,0);i.range=[0,g],i.gridLength=g,i.calculateLayout(),i.translation.x=f,i.translation.y=m+(i.position==="bottom"?n:0),o.range=[0,y],o.gridLength=y,o.calculateLayout(),o.translation.x=f+(o.position==="right"?n:0),o.translation.y=m,e.originX=f-t.x,e.originY=m-t.y,(g===0||y===0)&<.warnOnce("There was insufficient space to display the Linear Gauge.")}performLayout(t){const{seriesRoot:e,annotationRoot:i,series:o,seriesArea:s}=this,{layoutBox:n}=t,a=n.clone();n.shrink(s.padding.toJson());const r=this.series[0];dI(r)?this.updateRadialGauge(n,r):pI(r)&&this.updateLinearGauge(n,r),this.axes.forEach(l=>l.update()),this.seriesRect=a.clone().translate(a.x-n.x,a.y-n.y),this.animationRect=n,e.visible=o.some(l=>l.visible);for(const l of[e,i])l.translationX=Math.floor(n.x),l.translationY=Math.floor(n.y);this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:e.visible,rect:a,paddedRect:n}})}getAriaLabel(){const t=[],e=this.getCaptionText();e.length!==0&&t.push(e);for(const o of this.series)t.push(o.getCaptionText());const i=t.join(". ");return this.ctx.localeManager.t("ariaAnnounceGaugeChart",{caption:i})}};ch.className="GaugeChart",ch.type="gauge";var{isAgGaugeChartOptions:uI}=jA,gI={type:"chart",name:"gauge",detect:uI,create(t,e){return new ch(t,e)}};import{_ModuleSupport as yI}from"ag-charts-community";import{_ModuleSupport as fI}from"ag-charts-community";var{Chart:mI}=fI,hh=class extends mI{getChartType(){return"hierarchy"}performLayout(t){const{seriesRoot:e,annotationRoot:i}=this,{layoutBox:o}=t;o.shrink(this.seriesArea.padding.toJson());const s=o.clone();this.seriesRect=s,this.animationRect=s;for(const n of[e,i])n.translationX=Math.floor(s.x),n.translationY=Math.floor(s.y);e.visible=this.series[0].visible,e.setClipRect(s.clone()),this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:!0,rect:s,paddedRect:s}})}getAriaLabel(){const t=this.getCaptionText();return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:t})}};hh.className="HierarchyChart",hh.type="hierarchy";var{isAgHierarchyChartOptions:xI}=yI,SI={type:"chart",name:"hierarchy",detect:xI,create(t,e){return new hh(t,e)}};import{_ModuleSupport as bI}from"ag-charts-community";import{_ModuleSupport as vI}from"ag-charts-community";var{Chart:MI}=vI,dh=class extends MI{getChartType(){return"standalone"}performLayout(t){const{seriesRoot:e,annotationRoot:i}=this,{layoutBox:o}=t;o.shrink(this.seriesArea.padding.toJson());const s=o.clone();this.seriesRect=s,this.animationRect=s;for(const n of[e,i])n.translationX=Math.floor(o.x),n.translationY=Math.floor(o.y);e.visible=this.series[0].visible,this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:!0,rect:s,paddedRect:o}})}getAriaLabel(){const t=this.getCaptionText();return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:t})}};dh.className="StandaloneChart",dh.type="standalone";var{isAgStandaloneChartOptions:kI}=bI,AI={type:"chart",name:"standalone",detect:kI,create(t,e){return new dh(t,e)}};import{_ModuleSupport as II}from"ag-charts-community";import{_ModuleSupport as DI}from"ag-charts-community";var{Chart:TI,MercatorScale:Fg,NumberAxis:Gg}=DI;function Wg(t){return t.type==="map-shape"||t.type==="map-line"||t.type==="map-marker"||t.type==="map-shape-background"||t.type==="map-line-background"}var ph=class extends TI{constructor(t,e){super(t,e),this.xAxis=new Gg(this.getModuleContext()),this.xAxis.position="bottom",this.yAxis=new Gg(this.getModuleContext()),this.yAxis.position="left",this.ctx.zoomManager.updateAxes([this.xAxis,this.yAxis])}getChartType(){return"topology"}async updateData(){await super.updateData();const{topology:t}=this.getOptions();this.series.forEach(e=>{Wg(e)&&e.setChartTopology(t)})}performLayout(t){const{seriesRoot:e,annotationRoot:i}=this,{layoutBox:o}=t;o.shrink(this.seriesArea.padding.toJson());const s=o.clone();this.seriesRect=s,this.animationRect=s;const n=this.series.filter(Wg),a=n.reduce((c,h)=>{if(!h.visible)return c;const p=h.topologyBounds;return p==null?c:c==null?p:(c.merge(p),c)},void 0);let r;if(a!=null){const{lon0:c,lat0:h,lon1:p,lat1:u}=a,g=[[c,h],[p,u]],y=Fg.bounds(g),{width:f,height:m}=s,x=Math.min(f/y.width,m/y.height),v=y.width*x,S=y.height*x,b=(f-v)/2,k=(m-S)/2,I=b,M=k,A=b+v,T=k+S,N=this.ctx.zoomManager.getAxisZoom(this.xAxis.id),L=this.ctx.zoomManager.getAxisZoom(this.yAxis.id),D=(A-I)/(N.max-N.min),C=I-D*N.min,O=(T-M)/(1-L.min-(1-L.max)),w=M-O*(1-L.max);r=new Fg(g,[[C,w],[C+D,w+O]])}n.forEach(c=>{c.scale=r});const l=this.series.some(c=>c.visible);e.visible=l;for(const c of[e,i])c.translationX=Math.floor(s.x),c.translationY=Math.floor(s.y),c.setClipRect(s.clone());this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:l,rect:s,paddedRect:s}})}};ph.className="TopologyChart",ph.type="topology";var{isAgTopologyChartOptions:CI}=II,NI={type:"chart",name:"topology",detect:CI,create(t,e){return new ph(t,e)}};import{_ModuleSupport as Hg}from"ag-charts-community";var{BOOLEAN:OI,POSITIVE_NUMBER:LI,ObserveChanges:Kg,Validate:Ug}=Hg,uh=class extends Hg.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!0,t.animationManager.skip(!1)}};d([Kg((t,e)=>{t.ctx.animationManager.skip(!e)}),Ug(OI)],uh.prototype,"enabled",2),d([Kg((t,e)=>{t.ctx.animationManager.defaultDuration=e}),Ug(LI,{optional:!0})],uh.prototype,"duration",2);var RI={type:"root",optionsKey:"animation",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new uh(t),themeTemplate:{animation:{enabled:!0}}};import{_ModuleSupport as gr}from"ag-charts-community";import{_ModuleSupport as yr}from"ag-charts-community";var EI='
',{focusCursorAtEnd:wI}=yr,Yg="text-input",jg="canvas-overlay",PI=class extends yr.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1,this.element=t.domManager.addChild(jg,Yg),this.element.classList.add("ag-charts-text-input"),this.destroyFns.push(()=>t.domManager.removeChild(jg,Yg))}setKeyDownHandler(t){this.element.addEventListener("keydown",t),this.destroyFns.push(()=>this.element.removeEventListener("keydown",t))}show(t){this.element.innerHTML=EI;const e=this.element.firstElementChild;yr.setAttribute(e,"data-preventdefault",!1),e.isContentEditable||(e.contentEditable="true"),e.setAttribute("placeholder",this.ctx.localeManager.t(t.placeholderText??"inputTextareaPlaceholder")),t.styles?.placeholderColor&&e.style.setProperty("--placeholder-text-color",t.styles?.placeholderColor),e.innerText=t.text??"",e.style.color=t.styles?.color??"inherit",e.style.fontFamily=t.styles?.fontFamily??"inherit",e.style.fontSize=t.styles?.fontSize?`${t.styles.fontSize}px`:"inherit",e.style.fontStyle=t.styles?.fontStyle??"inherit",e.style.fontWeight=typeof t.styles?.fontWeight=="number"?`${t.styles.fontWeight}`:t.styles?.fontWeight??"inherit",wI(e),e.addEventListener("input",()=>{this.updatePosition(),t.onChange?.(this.getValue(),this.getBBox())}),e.addEventListener("click",i=>{i.stopPropagation()}),t.layout&&(this.layout=t.layout,this.updatePosition()),t.onChange?.(this.getValue(),this.getBBox()),this.visible=!0}hide(){this.element.innerHTML="",this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1}isVisible(){return this.visible}updateColor(t){this.element.firstElementChild&&(this.element.firstElementChild.style.color=t)}updateFontSize(t){if(this.element.firstElementChild)return this.element.firstElementChild.style.fontSize=`${t}px`,this.updatePosition(),this.getBBox()}getValue(){if(this.element.firstElementChild)return this.element.firstElementChild.innerText.trim()}updatePosition(){const{element:t}=this,e=t.firstElementChild;if(!e)return;const i=this.ctx.domManager.getBoundingClientRect(),{width:o,getTextInputCoords:s,getTextPosition:n,alignment:a,textAlign:r}=this.layout;t.style.setProperty("width",o?`${o}px`:"unset");const l=e.getBoundingClientRect(),c=s(l.height);let h=c.x;a==="center"?h-=(o??l.width)/2:a==="right"&&(h-=o??l.width);const p=n();let u=c.y;p==="center"?u-=l.height/2:p==="bottom"&&(u-=l.height),t.style.setProperty("top",`${u}px`),t.style.setProperty("left",`${h}px`),t.style.setProperty("max-width",`${i.width-h}px`),t.style.setProperty("text-align",a),e.style.setProperty("text-align",r)}getBBox(){const{left:t,top:e,width:i,height:o}=this.element.getBoundingClientRect();return new yr.BBox(t,e,i,o)}};import{_ModuleSupport as _I}from"ag-charts-community";var{BOOLEAN:BI,BaseProperties:zI,Validate:Xg,UNION:VI}=_I,FI=VI(["x","y","xy"],"an axis type"),gh=class extends zI{constructor(){super(...arguments),this.enabled=!1,this.axes="y"}};d([Xg(BI)],gh.prototype,"enabled",2),d([Xg(FI,{optional:!0})],gh.prototype,"axes",2);import{_ModuleSupport as GI}from"ag-charts-community";var yh=(t=>(t.Line="line",t.HorizontalLine="horizontal-line",t.VerticalLine="vertical-line",t.DisjointChannel="disjoint-channel",t.ParallelChannel="parallel-channel",t.FibonacciRetracement="fibonacci-retracement",t.FibonacciRetracementTrendBased="fibonacci-retracement-trend-based",t.Callout="callout",t.Comment="comment",t.Note="note",t.Text="text",t.Arrow="arrow",t.ArrowUp="arrow-up",t.ArrowDown="arrow-down",t.DateRange="date-range",t.PriceRange="price-range",t.DatePriceRange="date-price-range",t.QuickDatePriceRange="quick-date-price-range",t))(yh||{}),WI=Object.values(yh);function HI(t){for(const e of WI)if(e===t)return e}import{_ModuleSupport as KI}from"ag-charts-community";import{_ModuleSupport as UI}from"ag-charts-community";var{BOOLEAN:Jn,COLOR_STRING:fh,DATE:ta,FONT_STYLE:YI,FONT_WEIGHT:jI,FUNCTION:XI,LINE_DASH:$I,LINE_STYLE:ZI,NUMBER:os,OBJECT:ea,OR:ia,POSITIVE_NUMBER:mh,RATIO:$g,STRING:Mo,TEXT_ALIGN:QI,UNION:fr,BaseProperties:ko,Validate:et,predicateWithMessage:qI,generateUUID:JI}=UI,tD=["value","groupPercentage"],oa=qI(t=>Rt(t)&&Object.keys(t).every(e=>tD.includes(e)),"objects with grouping value properties such as 'value' or 'groupPercentage'"),sa=class extends ko{};d([et(ia(Mo,os,ta,oa))],sa.prototype,"x",2),d([et(ia(Mo,os,ta,oa))],sa.prototype,"y",2);var eD=class extends he(Yi(Jg(ko))){},xh=class extends he(Yi(Ii(vh(as(ko))))){constructor(){super(...arguments),this.cornerRadius=2}};d([et(Jn)],xh.prototype,"enabled",2),d([et(mh)],xh.prototype,"cornerRadius",2);var iD=class extends Ii(ko){},oD=class extends he(Yi(Ii(ko))){},ss=class extends as(ko){constructor(){super(...arguments),this.label="",this.position="top",this.alignment="left"}};d([et(Mo)],ss.prototype,"label",2),d([et(fr(["top","center","bottom"]),{optional:!0})],ss.prototype,"position",2),d([et(fr(["left","center","right"]),{optional:!0})],ss.prototype,"alignment",2);var sD=class extends as(ko){},na=class extends as(ko){constructor(){super(...arguments),this.label=""}};d([et(Mo)],na.prototype,"label",2),d([et(fr(["top","inside","bottom"]),{optional:!0})],na.prototype,"position",2),d([et(fr(["left","center","right"]),{optional:!0})],na.prototype,"alignment",2);function ns(t){class e extends aD(Jg(t)){constructor(){super(...arguments),this.id=JI()}isValidWithContext(o,s){return super.isValid(s)}}return e}function Sh(t){class e extends t{constructor(){super(...arguments),this.start=new sa,this.end=new sa}}return d([et(ea)],e.prototype,"start",2),d([et(ea)],e.prototype,"end",2),e}function Zg(t){class e extends t{}return d([et(ia(Mo,os,ta,oa))],e.prototype,"x",2),d([et(ia(Mo,os,ta,oa))],e.prototype,"y",2),e}function Qg(t){class e extends t{}return d([et(ia(Mo,os,ta,oa))],e.prototype,"value",2),e}function bh(t){class e extends t{constructor(){super(...arguments),this.background=new iD}}return d([et(ea,{optional:!0})],e.prototype,"background",2),e}function Ao(t){class e extends t{constructor(){super(...arguments),this.handle=new oD}}return d([et(ea,{optional:!0})],e.prototype,"handle",2),e}function qg(t){class e extends t{constructor(){super(...arguments),this.axisLabel=new xh}}return d([et(ea,{optional:!0})],e.prototype,"axisLabel",2),e}function vh(t){class e extends t{constructor(){super(...arguments),this.padding=void 0,this.textAlign="center",this.formatter=void 0}}return d([et(mh,{optional:!0})],e.prototype,"padding",2),d([et(QI,{optional:!0})],e.prototype,"textAlign",2),d([et(XI,{optional:!0})],e.prototype,"formatter",2),e}function nD(t){class e extends t{}return e}function Mh(t){class e extends t{}return d([et(Jn,{optional:!0})],e.prototype,"extendStart",2),d([et(Jn,{optional:!0})],e.prototype,"extendEnd",2),e}function aD(t){class e extends t{}return d([et(Jn,{optional:!0})],e.prototype,"locked",2),e}function kh(t){class e extends t{setLocaleManager(o){this.localeManager??(this.localeManager=o)}}return e}function Jg(t){class e extends t{}return d([et(Jn,{optional:!0})],e.prototype,"visible",2),e}function Ii(t){class e extends t{}return d([et(fh,{optional:!0})],e.prototype,"fill",2),d([et($g,{optional:!0})],e.prototype,"fillOpacity",2),e}function he(t){class e extends t{}return d([et(fh,{optional:!0})],e.prototype,"stroke",2),d([et($g,{optional:!0})],e.prototype,"strokeOpacity",2),d([et(os,{optional:!0})],e.prototype,"strokeWidth",2),e}function Yi(t){class e extends t{constructor(){super(...arguments),this.lineCap=void 0,this.computedLineDash=void 0}}return d([et($I,{optional:!0})],e.prototype,"lineDash",2),d([et(os,{optional:!0})],e.prototype,"lineDashOffset",2),d([et(ZI,{optional:!0})],e.prototype,"lineStyle",2),e}function as(t){class e extends t{constructor(){super(...arguments),this.fontSize=12,this.fontFamily="Verdana, sans-serif"}}return d([et(YI,{optional:!0})],e.prototype,"fontStyle",2),d([et(jI,{optional:!0})],e.prototype,"fontWeight",2),d([et(mh)],e.prototype,"fontSize",2),d([et(Mo)],e.prototype,"fontFamily",2),d([et(fh,{optional:!0})],e.prototype,"color",2),e}import{_ModuleSupport as rD}from"ag-charts-community";import{_ModuleSupport as lD}from"ag-charts-community";function ft(t){return Et(t)||nI(t)||Qn(t)?{value:t,groupPercentage:0}:t??{value:void 0,groupPercentage:0}}var{clampArray:cD}=lD;function ri(t,e){if(t.start==null||t.end==null)return;const i=vt(t.start,e),o=vt(t.end,e);if(!(i==null||o==null))return{x1:i.x,y1:i.y,x2:o.x,y2:o.y}}function vt(t,e){const i=Io(t.x,e.xAxis),o=Io(t.y,e.yAxis);return{x:i,y:o}}function Io(t,e){if(t==null)return 0;const{value:i,groupPercentage:o}=ft(t),{scale:s,snapToGroup:n}=e,a=s.bandwidth===0?s.step??0:s.bandwidth??0,r=n?a/2:a*o;return s.convert(i)+r}function mt(t,e){const i=aa(t.x,e.xAxis),o=aa(t.y,e.yAxis);return{x:i,y:o}}function aa(t,e){const{scale:i}=e;if(e.continuous&&i.step==null)return e.scaleInvert(t);const o=e.scaleInvertNearest(t),s=i.bandwidth===0?i.step:i.bandwidth??0,n=i.convert(o),a=n+s,r=cD(t,i.range),l=n===a?0:(r-n)/(a-n);return{value:o,groupPercentage:l}}import{_ModuleSupport as hD}from"ag-charts-community";var{BaseProperties:dD}=hD,Ah=class extends ns(Sh(Ao(dD))){constructor(){super(...arguments),this.snapToAngle=45}isValidWithContext(t,e){return super.isValid(e)}getDefaultColor(t){}getDefaultOpacity(t){}},{STRING:pD,Validate:uD}=rD,ty=class extends kh(vh(as(Ah))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}isValidWithContext(t,e){return super.isValid(e)}getDefaultColor(t){return this.color}getDefaultOpacity(t){}getPlaceholderColor(){}getPadding(){const{padding:t=0}=this;return{top:t,right:t,bottom:t,left:t}}getText(){const t=this.text.length==0;let e=this.text;return t&&(e=this.placeholderText??"",this.localeManager&&(e=this.localeManager.t(e))),{text:e,isPlaceholder:t}}getTextInputCoords(t,e){return vt(this.end,t)}getTextPosition(){return this.position}};d([uD(pD)],ty.prototype,"text",2);var{STRING:gD,Validate:yD,Color:ey}=KI,fD={top:6,right:12,bottom:9,left:12},li=class extends Ii(he(ty)){constructor(){super(...arguments),this.type="callout",this.position="bottom",this.alignment="left"}static is(t){return Rt(t)&&t.type==="callout"}getDefaultColor(t){switch(t){case"fill-color":return this.fill;case"line-color":return this.stroke;case"text-color":default:return this.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;case"text-color":default:return}}getPlaceholderColor(){const{r:t,g:e,b:i}=ey.fromString(this.color??"#888888");return new ey(t,e,i,.66).toString()}getPadding(){const{padding:t}=this;return t==null?{...fD}:{top:t,right:t,bottom:t,left:t}}getTextInputCoords(t,e){const i=super.getTextInputCoords(t,e),o=this.getPadding(),s=o.left??0,n=o.bottom??0;return{x:i.x+s,y:i.y-n}}};d([yD(gD)],li.prototype,"type",2);import{_ModuleSupport as mD}from"ag-charts-community";import{_ModuleSupport as xD}from"ag-charts-community";var{STRING:SD,BaseProperties:bD,Validate:vD}=xD,mr=class extends ns(Zg(Ao(vh(as(bD))))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}isValidWithContext(t,e){return super.isValid(e)}getDefaultColor(t){return this.color}getDefaultOpacity(t){}getPlaceholderColor(){}getPadding(){const{padding:t=0}=this;return{top:t,right:t,bottom:t,left:t}}getText(){const t=this.text.length==0;return{text:t?this.placeholderText??"":this.text,isPlaceholder:t}}getTextInputCoords(t,e){return vt(this,t)}getTextPosition(){return this.position}};d([vD(SD)],mr.prototype,"text",2);var{STRING:MD,Validate:kD,Color:iy}=mD,xr={top:8,right:14,bottom:8,left:14},Di=class extends Ii(he(mr)){constructor(){super(...arguments),this.type="comment",this.position="bottom",this.alignment="left"}static is(t){return Rt(t)&&t.type==="comment"}getDefaultColor(t){switch(t){case"fill-color":return this.fill;case"line-color":return this.stroke;case"text-color":default:return this.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;case"text-color":default:return}}getPlaceholderColor(){const{r:t,g:e,b:i}=iy.fromString(this.color??"#888888");return new iy(t,e,i,.66).toString()}getPadding(){const{padding:t,fontSize:e}=this;return t==null?{top:Math.max(e*.4,xr.top),bottom:Math.max(e*.4,xr.bottom),left:Math.max(e*.8,xr.left),right:Math.max(e*.8,xr.right)}:{top:t,right:t,bottom:t,left:t}}getTextInputCoords(t,e){const i=super.getTextInputCoords(t,e),o=this.getPadding();return{x:i.x+o.left,y:i.y-o.bottom}}};d([kD(MD)],Di.prototype,"type",2);import{_ModuleSupport as AD}from"ag-charts-community";import{_ModuleSupport as ID}from"ag-charts-community";var{Vec2:rs}=ID;function ra(t,e){return t?"dashed":e??"solid"}function oy(t,e){switch(e){case"solid":return[];case"dashed":return[t*4,t*2];case"dotted":return[0,t*2]}}function Js(t,e,i,o){const s=ra(t,i);return e??t??oy(o??1,s)}function tn(t,e,i){const o=ra(e,i);return t??o==="dotted"?"round":void 0}function DD(t,e){const[i,o]=rs.from(t),s=e.height,n=rs.gradient(o,i,s),a=rs.intercept(o,n,s),r=[{x:i.x,y:s??0},{x:i.x,y:s==null?e.height:s-e.height}];if(n===1/0)return r;let l=[rs.intersectAtY(n,a,0,s),rs.intersectAtY(n,a,e.height,s),rs.intersectAtX(n,a,0,s),rs.intersectAtX(n,a,e.width,s)];return l=l.filter(c=>c.x>=e.x&&c.x<=e.width&&c.y>=e.y&&c.y<=e.height).sort((c,h)=>c.x===h.x?0:c.x{},this.text=new ss}getDefaultColor(t){switch(t){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return Js(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return tn(this.lineCap,this.lineDash,this.lineStyle)}};d([De(en,{optional:!0})],on.prototype,"statistics",2),d([De(en,{optional:!0})],on.prototype,"text",2);function Ch(t){class e extends t{constructor(){super(...arguments),this.hasDateRange=!0}}return e}function Nh(t){class e extends t{constructor(){super(...arguments),this.hasPriceRange=!0}}return e}var je=class extends Ch(on){constructor(){super(...arguments),this.type="date-range",this.direction="horizontal"}static is(t){return Rt(t)&&t.type==="date-range"}};d([De(br)],je.prototype,"type",2),d([De(Sr,{optional:!0})],je.prototype,"extendAbove",2),d([De(Sr,{optional:!0})],je.prototype,"extendBelow",2);var Xe=class extends Nh(on){constructor(){super(...arguments),this.type="price-range",this.direction="vertical"}static is(t){return Rt(t)&&t.type==="price-range"}};d([De(br)],Xe.prototype,"type",2),d([De(Sr,{optional:!0})],Xe.prototype,"extendLeft",2),d([De(Sr,{optional:!0})],Xe.prototype,"extendRight",2);var ji=class extends Ch(Nh(on)){constructor(){super(...arguments),this.type="date-price-range",this.direction="both"}static is(t){return Rt(t)&&t.type==="date-price-range"}};d([De(br)],ji.prototype,"type",2);var Pe=class extends Ch(Nh(on)){constructor(){super(...arguments),this.type="quick-date-price-range",this.up=new Th,this.down=new Th,this.direction="both"}static is(t){return Rt(t)&&t.type==="quick-date-price-range"}};d([De(br)],Pe.prototype,"type",2),d([De(en,{optional:!0})],Pe.prototype,"up",2),d([De(en,{optional:!0})],Pe.prototype,"down",2);import{_ModuleSupport as CD}from"ag-charts-community";import{_ModuleSupport as ND}from"ag-charts-community";var{TextWrapper:OD,CachedTextMeasurerPool:LD,BBox:RD}=ND,vr=1.38;function sy(t){return{font:{fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight},textAlign:t.textAlign,textBaseline:t.position=="center"?"middle":t.position,lineHeight:vr,avoidOrphans:!1,textWrap:"always"}}function Mr(t,e,i){return i?OD.wrapText(e,{...sy(t),maxWidth:i}):e}function ED(t,e){const i=sy(t),{lineMetrics:o,width:s}=LD.measureLines(e,i),n=o.length*(t.fontSize??14)*vr;return{width:s,height:n}}function Oh(t,e,i,o){let s=o?.width??0,n=o?.height??0;if(!o){const a=t.width!=null?Mr(t,e,t.width):e;({width:s,height:n}=ED(t,a))}return new RD(i.x,i.y,s,n)}function ny(t,e,i,o,{x:s,y:n}){const{visible:a=!0,fontFamily:r,fontSize:l=14,fontStyle:c,fontWeight:h,textAlign:p}=o,u=l*vr,g=o.position=="center"?"middle":o.position,y=i?o.getPlaceholderColor():o.color;t.setProperties({x:s,y:n,visible:a,text:e,fill:y,fontFamily:r,fontSize:l,fontStyle:c,fontWeight:h,textAlign:p,lineHeight:u,textBaseline:g})}var{OBJECT:wD,STRING:PD,BaseProperties:_D,Validate:ay,clamp:BD}=CD,zD=10,VD=11,ry=20,FD=22,GD=10,ly=ry+GD,cy=34,WD=class extends Ii(he(_D)){},Te=class extends Ii(he(mr)){constructor(){super(...arguments),this.type="note",this.background=new WD,this.position="bottom",this.alignment="center",this.width=200}static is(t){return Rt(t)&&t.type==="note"}getDefaultColor(t){switch(t){case"line-color":return this.fill;case"text-color":return this.color}}getDefaultOpacity(t){switch(t){case"line-color":return this.fillOpacity;case"text-color":return}}getPadding(){const t=this.padding??zD;return{top:t,right:t,bottom:t,left:t}}getTextInputCoords(t,e){const{width:i,text:o}=this,s=super.getTextInputCoords(t,e),n=this.getPadding().top,a=Oh(this,o,s);a.x=BD(i/2,a.x,t.seriesRect.width-i/2);const r=a.y-ly-n*2,l=a.y+VD+n*2,c=Math.max(a.height,e);return r-c-cy<0?(a.y=l,this.position="top"):(a.y=r+n,this.position="bottom"),{x:a.x,y:a.y}}};d([ay(PD)],Te.prototype,"type",2),d([ay(wD,{optional:!0})],Te.prototype,"background",2);import{_ModuleSupport as HD}from"ag-charts-community";var{BaseProperties:KD}=HD,UD=class extends ns(Zg(Ao(KD))){isValidWithContext(t,e){return super.isValid(e)}getDefaultColor(t){}getDefaultOpacity(t){}},Lh=class tk extends Ii(UD){constructor(){super(...arguments),this.size=32}static is(e){return e instanceof tk}getDefaultColor(e){return e==="fill-color"?this.fill:void 0}getDefaultOpacity(e){return e==="fill-color"?this.fillOpacity:void 0}};import{_ModuleSupport as YD}from"ag-charts-community";import"ag-charts-community";function la(t,e,i,o){let s=!0;return s&&(s=ci(t,e.start,i,o&&`${o}[start] `)),s&&(s=ci(t,e.end,i,o&&`${o}[end] `)),s}function hy(t,e,i){const o=e.direction==="horizontal"?t.yAxis:t.xAxis,s=Rh(e.value,o);if(!s&&i){const{value:n}=ft(e.value);lt.warnOnce(`${i}is outside the axis domain, ignoring. - value: [${n}]]`)}return s}function ci(t,e,i,o){if(e.x==null||e.y==null)return o&<.warnOnce(`${o}requires both an [x] and [y] property, ignoring.`),!1;const s=i?.x===!1?!0:Rh(e.x,t.xAxis),n=i?.y===!1?!0:Rh(e.y,t.yAxis);if(!s||!n){let a="x & y domains";if(s&&(a="y domain"),n&&(a="x domain"),o){const{value:r}=ft(e.x),{value:l}=ft(e.y);lt.warnOnce(`${o}is outside the ${a}, ignoring. - x: [${r}], y: ${l}]`)}return!1}return!0}function Rh(t,e){const{domain:i}=e.scale,{value:o}=ft(t);return i&&o!=null&&e.continuous?o>=i[0]&&o<=i.at(-1):!0}function jD(t){return t?.x!=null&&t?.y!=null}var{OBJECT:dy,STRING:py,BaseProperties:uy,Validate:kr}=YD,de=class extends ns(Qg(Ao(qg(he(Yi(uy)))))){constructor(){super(...arguments),this.direction="horizontal",this.type="horizontal-line",this.text=new ss}static is(t){return Rt(t)&&t.type==="horizontal-line"}isValidWithContext(t,e){return super.isValid(e)&&hy(t,this,e)}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return Js(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return tn(this.lineCap,this.lineDash,this.lineStyle)}};d([kr(py)],de.prototype,"type",2),d([kr(dy,{optional:!0})],de.prototype,"text",2);var Ti=class extends ns(Qg(Ao(qg(he(Yi(uy)))))){constructor(){super(...arguments),this.direction="vertical",this.type="vertical-line",this.text=new ss}static is(t){return Rt(t)&&t.type==="vertical-line"}isValidWithContext(t,e){return super.isValid(e)&&hy(t,this,e)}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return Js(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return tn(this.lineCap,this.lineDash,this.lineStyle)}};d([kr(py)],Ti.prototype,"type",2),d([kr(dy,{optional:!0})],Ti.prototype,"text",2);import{_ModuleSupport as XD}from"ag-charts-community";var{NUMBER:gy,OBJECT:$D,STRING:ZD,BaseProperties:QD,Validate:Ar}=XD,$e=class extends ns(bh(Sh(Ao(Mh(he(Yi(QD))))))){constructor(){super(...arguments),this.type="disjoint-channel",this.text=new na,this.snapToAngle=45}static is(t){return Rt(t)&&t.type==="disjoint-channel"}get bottom(){const t={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return typeof t.start.y=="number"&&typeof t.end.y=="number"?(t.start.y-=this.startHeight,t.end.y-=this.endHeight):lt.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),t}isValidWithContext(t,e){return super.isValid(e)&&la(t,this,{y:!1},e)&&la(t,this.bottom,{y:!1},e)}getDefaultColor(t){switch(t){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return Js(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return tn(this.lineCap,this.lineDash,this.lineStyle)}};d([Ar(ZD)],$e.prototype,"type",2),d([Ar(gy)],$e.prototype,"startHeight",2),d([Ar(gy)],$e.prototype,"endHeight",2),d([Ar($D,{optional:!0})],$e.prototype,"text",2);import{_ModuleSupport as qD}from"ag-charts-community";import{_ModuleSupport as JD}from"ag-charts-community";import{_ModuleSupport as t0}from"ag-charts-community";var{OBJECT:e0,STRING:yy,Validate:Eh}=t0,Ir=class extends kh(nD(Mh(he(Yi(Ah))))){constructor(){super(...arguments),this.text=new ss}isValidWithContext(t,e){return super.isValid(e)&&la(t,this,void 0,e)}getDefaultColor(t){switch(t){case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return Js(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return tn(this.lineCap,this.lineDash,this.lineStyle)}};d([Eh(e0,{optional:!0})],Ir.prototype,"text",2);var Xi=class extends Ir{constructor(){super(...arguments),this.type="arrow",this.endCap="arrow"}static is(t){return Rt(t)&&t.type==="arrow"}};d([Eh(yy)],Xi.prototype,"type",2);var $i=class extends Ir{constructor(){super(...arguments),this.type="line"}static is(t){return Rt(t)&&t.type==="line"}};d([Eh(yy)],$i.prototype,"type",2);var{OBJECT:i0,BOOLEAN:wh,COLOR_STRING:o0,COLOR_STRING_ARRAY:s0,Validate:ls,predicateWithMessage:n0}=JD,a0=[10,6,4],r0=n0(t=>vo(t)&&a0.includes(t),"Number of fibonacci ranges, 10, 6 or 4"),Zi=class extends Ir{constructor(){super(...arguments),this.label=new sD,this.reverse=!1,this.showFill=!0,this.isMultiColor=!0,this.strokes=[],this.bands=10}getDefaultColor(t){switch(t){case"line-color":return this.rangeStroke??this.stroke;case"text-color":return this.text.color}}};d([ls(i0,{optional:!0})],Zi.prototype,"label",2),d([ls(wh,{optional:!0})],Zi.prototype,"reverse",2),d([ls(wh,{optional:!0})],Zi.prototype,"showFill",2),d([ls(wh,{optional:!0})],Zi.prototype,"isMultiColor",2),d([ls(s0,{optional:!0})],Zi.prototype,"strokes",2),d([ls(o0,{optional:!0})],Zi.prototype,"rangeStroke",2),d([ls(r0,{optional:!0})],Zi.prototype,"bands",2);var{STRING:l0,OBJECT:c0,Validate:fy}=qD,Ci=class extends Zi{constructor(){super(...arguments),this.type="fibonacci-retracement-trend-based",this.endRetracement=new sa}static is(t){return Rt(t)&&t.type==="fibonacci-retracement-trend-based"}};d([fy(l0)],Ci.prototype,"type",2),d([fy(c0)],Ci.prototype,"endRetracement",2);import{_ModuleSupport as h0}from"ag-charts-community";var{STRING:d0,Validate:p0}=h0,Qi=class extends Zi{constructor(){super(...arguments),this.type="fibonacci-retracement"}static is(t){return Rt(t)&&t.type==="fibonacci-retracement"}};d([p0(d0)],Qi.prototype,"type",2);import{_ModuleSupport as u0}from"ag-charts-community";var{NUMBER:g0,STRING:y0,OBJECT:my,BaseProperties:f0,Validate:Dr}=u0,Ze=class extends ns(bh(Sh(Ao(Mh(he(Yi(f0))))))){constructor(){super(...arguments),this.type="parallel-channel",this.middle=new eD,this.text=new na,this.snapToAngle=45}static is(t){return Rt(t)&&t.type==="parallel-channel"}get bottom(){const t={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return typeof t.start.y=="number"&&typeof t.end.y=="number"?(t.start.y-=this.height,t.end.y-=this.height):lt.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),t}isValidWithContext(t,e){return super.isValid(e)&&la(t,this,{y:!1},e)&&la(t,this.bottom,{y:!1},e)}getDefaultColor(t){switch(t){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return Js(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return tn(this.lineCap,this.lineDash,this.lineStyle)}};d([Dr(y0)],Ze.prototype,"type",2),d([Dr(g0)],Ze.prototype,"height",2),d([Dr(my,{optional:!0})],Ze.prototype,"middle",2),d([Dr(my,{optional:!0})],Ze.prototype,"text",2);import{_ModuleSupport as m0}from"ag-charts-community";var{STRING:x0,Validate:S0}=m0,qi=class extends mr{constructor(){super(...arguments),this.type="text",this.position="bottom"}static is(t){return Rt(t)&&t.type==="text"}};d([S0(x0)],qi.prototype,"type",2);function Do(t){return Pe.is(t)}function Tr(t){return $i.is(t)||de.is(t)||Ti.is(t)||Xi.is(t)||xy(t)}function Ji(t){return $e.is(t)||Ze.is(t)}function xy(t){return Qi.is(t)||Ci.is(t)}function Ni(t){return li.is(t)||Di.is(t)||Te.is(t)||qi.is(t)}function ca(t){return je.is(t)||Xe.is(t)||ji.is(t)||Pe.is(t)}function Ph(t){return Ni(t)&&!Te.is(t)}function To(t){return Tr(t)||Ji(t)||ca(t)&&!Pe.is(t)}function b0(t){return Tr(t)||Ji(t)||ca(t)||li.is(t)||Te.is(t)}function v0(t){return Te.is(t)}function M0(t){return Ji(t)||ca(t)||li.is(t)||Di.is(t)||Lh.is(t)}function k0(t){return Ni(t)&&!Te.is(t)}function sn(t){return(Tr(t)||Ji(t)||ca(t))&&!Do(t)&&Rt(t.text)}function A0(t,e){"fontSize"in t&&(t.fontSize=e),sn(t)&&(t.text.fontSize=e)}function Sy(t,e){const i=e?.strokeWidth??t.strokeWidth??1,o=e?.type??t.lineStyle,s=o??ra(t.lineDash,o),n=oy(i,s);t.strokeWidth=i,t.computedLineDash=n,t.lineStyle=s,t.lineCap=s==="dotted"?"round":void 0}function Cr(t,e,i,o,s,n){switch(e){case"fill-color":{"fill"in t&&(t.fill=o),"fillOpacity"in t&&(t.fillOpacity=s),"background"in t&&(t.background.fill=o,t.background.fillOpacity=s);break}case"line-color":{"axisLabel"in t&&(t.axisLabel.fill=o,t.axisLabel.fillOpacity=s,t.axisLabel.stroke=o,t.axisLabel.strokeOpacity=s),"fill"in t&&"fillOpacity"in t&&v0(t)?(t.fill=o,t.fillOpacity=s):("strokeOpacity"in t&&(t.strokeOpacity=s),"isMultiColor"in t&&"rangeStroke"in t?(t.isMultiColor=n,t.rangeStroke=o):"stroke"in t&&(t.stroke=o));break}case"text-color":{"color"in t&&(t.color=i),sn(t)&&(t.text.color=o);break}}}var{deepClone:Qe}=GI,I0=class{constructor(){this.mementoOriginatorKey="annotation-defaults",this.colors=new Map(Object.values(yh).map(t=>[t,new Map([["line-color",void 0],["fill-color",void 0],["text-color",void 0]])])),this.fontSizes=new Map([["callout",void 0],["comment",void 0],["text",void 0],["arrow",void 0],["line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineStyles=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextAlignments=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextPositions=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.fibonacciOptions=new Map([["fibonacci-retracement",{bands:void 0,reverse:void 0,showFill:void 0}],["fibonacci-retracement-trend-based",{bands:void 0,reverse:void 0,showFill:void 0}]])}createMemento(){return{colors:Qe(this.colors),fontSizes:Qe(this.fontSizes),lineStyles:Qe(this.lineStyles),lineTextAlignments:Qe(this.lineTextAlignments),lineTextPositions:Qe(this.lineTextPositions),fibonacciOptions:Qe(this.fibonacciOptions)}}guardMemento(t){return!0}restoreMemento(t,e,i){this.colors=Qe(i.colors),this.fontSizes=Qe(i.fontSizes),this.lineStyles=Qe(i.lineStyles),this.lineTextAlignments=Qe(i.lineTextAlignments),this.lineTextPositions=Qe(i.lineTextPositions),this.fibonacciOptions=Qe(i.fibonacciOptions)}setDefaultColor(t,e,i,o,s,n){this.colors.get(t)?.set(e,[i,o,s,n])}setDefaultFontSize(t,e){this.fontSizes.set(t,e)}setDefaultLineStyleType(t,e){const i=this.lineStyles.get(t);i?i.type=e:this.lineStyles.set(t,{type:e})}setDefaultLineStyleWidth(t,e){const i=this.lineStyles.get(t);i?i.strokeWidth=e:this.lineStyles.set(t,{strokeWidth:e})}setDefaultLineTextAlignment(t,e){this.lineTextAlignments.set(t,e)}setDefaultLineTextPosition(t,e){this.lineTextPositions.set(t,e)}setDefaultFibonacciOptions(t,e,i){if(t!="fibonacci-retracement"&&t!="fibonacci-retracement-trend-based")return;const o=this.fibonacciOptions.get(t);o[e]=i,this.fibonacciOptions.set(t,o)}applyDefaults(t){for(const[e,i]of this.colors)if(t.type===e)for(const[o,[s,n,a,r]=[]]of i)s&&n&&a!=null&&r!=null&&Cr(t,o,s,n,a,r);for(const[e,i]of this.fontSizes)t.type!==e||i==null||A0(t,i);for(const[e,i]of this.lineStyles)t.type!==e||i==null||Sy(t,i);for(const[e,i]of this.lineTextPositions)t.type!==e||i==null||(t.text.position=i);for(const[e,i]of this.lineTextAlignments)t.type!==e||i==null||(t.text.alignment=i);for(const[e,i]of this.fibonacciOptions)t.type!==e||i==null||Object.entries(i).forEach(([o,s])=>{s!=null&&t.set({[o]:s})})}};import{_ModuleSupport as by}from"ag-charts-community";import{_ModuleSupport as vy}from"ag-charts-community";var D0='
',{Color:_h,clamp:Nr,createElement:T0}=vy,My=t=>{try{const e=_h.fromString(t),[i,o,s]=e.toHSB();return[i,o,s,e.a]}catch{return}},ky=class extends vy.AnchoredPopover{constructor(t,e){super(t,"color-picker",e),this.hasChanged=!1,this.hideFns.push(()=>{this.hasChanged&&this.onChangeHide?.()})}show(t){this.hasChanged=!1,this.onChangeHide=t.onChangeHide;const{element:e,initialFocus:i}=this.createColorPicker(t),o=this.showWithChildren([e],{initialFocus:i,...t});o.classList.add("ag-charts-color-picker"),o.setAttribute("role","dialog")}createColorPicker(t){let e=t.isMultiColor??!1,[i,o,s,n]=My(t.color??"#f00")??[0,1,.5,1];n=t.opacity??n;const a=T0("div","ag-charts-color-picker__content");a.innerHTML=D0,a.ariaLabel=this.ctx.localeManager.t("ariaLabelColorPicker");const r=a.querySelector(".ag-charts-color-picker__palette"),l=a.querySelector(".ag-charts-color-picker__hue-input"),c=a.querySelector(".ag-charts-color-picker__multi-color-button"),h=a.querySelector(".ag-charts-color-picker__alpha-input"),p=a.querySelector(".ag-charts-color-picker__color-input"),u=a.querySelector(".ag-charts-color-picker__color-label");c.classList.toggle("ag-charts-color-picker__multi-color-button--hidden",!t.hasMultiColorOption);const g=(x=!0)=>{const S=_h.fromHSB(i,o,s,n).toHexString();if(a.style.setProperty("--h",`${i}`),a.style.setProperty("--s",`${o}`),a.style.setProperty("--v",`${s}`),a.style.setProperty("--a",`${n}`),a.style.setProperty("--color",S.slice(0,7)),a.style.setProperty("--color-a",S),l.value=`${i}`,h.value=`${n}`,h.classList.toggle("ag-charts-color-picker__alpha-input--opaque",n===1),c.classList.toggle("ag-charts-color-picker__multi-color-button--active",e),u.classList.toggle("ag-charts-color-picker__color-label--multi-color",e),document.activeElement!==p&&(p.value=e?"Multi Colour":S.toUpperCase()),x||t.color==null){const b=_h.fromHSB(i,o,s,1).toHexString();t.onChange?.(S,b,n,e)}x&&(this.hasChanged=!0)};g(!1);const y=x=>x.preventDefault(),f=x=>x.stopPropagation(),m=x=>{x.preventDefault();const v=x.currentTarget;v.focus();const S=v.getBoundingClientRect(),b=({pageX:I,pageY:M})=>{e=!1,o=Math.min(Math.max((I-S.left)/S.width,0),1),s=1-Math.min(Math.max((M-S.top)/S.height,0),1),g()},k=()=>{window.removeEventListener("pointermove",b)};b(x),window.addEventListener("pointermove",b),window.addEventListener("pointerup",k,{once:!0})};return a.addEventListener("mousedown",f),a.addEventListener("touchstart",f),a.addEventListener("touchmove",f),a.addEventListener("keydown",x=>{switch(x.stopPropagation(),x.key){case"Enter":case"Escape":this.hide();break;default:return}x.preventDefault()}),r.addEventListener("pointerdown",m),r.addEventListener("touchstart",y,{passive:!1}),r.addEventListener("touchmove",y,{passive:!1}),r.addEventListener("keydown",x=>{if(x.key==="ArrowLeft")o=Nr(0,o-.01,1);else if(x.key==="ArrowRight")o=Nr(0,o+.01,1);else if(x.key==="ArrowUp")s=Nr(0,s+.01,1);else if(x.key==="ArrowDown")s=Nr(0,s-.01,1);else return;x.preventDefault(),g()}),c.addEventListener("click",()=>{e=!e,g()}),l.addEventListener("input",x=>{e=!1,i=x.currentTarget.valueAsNumber??0,g()}),h.addEventListener("input",x=>{e=!1,n=x.currentTarget.valueAsNumber??0,g()}),p.addEventListener("input",x=>{e=!1;const v=My(x.currentTarget.value);v!=null&&([i,o,s,n]=v,g())}),p.addEventListener("blur",()=>g()),p.addEventListener("keydown",x=>{x.key==="Enter"&&(x.currentTarget.blur(),g())}),{element:a,initialFocus:r}}};import{_ModuleSupport as Ay}from"ag-charts-community";function Iy(t){return!(t instanceof Ay.LogScale)&&!(t instanceof Ay.BandScale)}var C0=[{label:"toolbarAnnotationsTrendLine",icon:"trend-line-drawing",value:"line"},{label:"toolbarAnnotationsHorizontalLine",icon:"horizontal-line-drawing",value:"horizontal-line"},{label:"toolbarAnnotationsVerticalLine",icon:"vertical-line-drawing",value:"vertical-line"},{label:"toolbarAnnotationsParallelChannel",icon:"parallel-channel-drawing",value:"parallel-channel",visible:Iy},{label:"toolbarAnnotationsDisjointChannel",icon:"disjoint-channel-drawing",value:"disjoint-channel",visible:Iy}],N0=[{label:"toolbarAnnotationsFibonacciRetracement",icon:"fibonacci-retracement-drawing",value:"fibonacci-retracement"},{label:"toolbarAnnotationsFibonacciRetracementTrendBased",icon:"fibonacci-retracement-trend-based-drawing",value:"fibonacci-retracement-trend-based"}],O0=[{label:"Fibonacci - Extended",value:10},{label:"Fibonacci - 6 Band",value:6},{label:"Fibonacci - 4 Band",value:4}],L0=[{label:"toolbarAnnotationsText",icon:"text-annotation",value:"text"},{label:"toolbarAnnotationsComment",icon:"comment-annotation",value:"comment"},{label:"toolbarAnnotationsCallout",icon:"callout-annotation",value:"callout"},{label:"toolbarAnnotationsNote",icon:"note-annotation",value:"note"}],R0=[{label:"toolbarAnnotationsArrow",icon:"arrow-drawing",value:"arrow"},{label:"toolbarAnnotationsArrowUp",icon:"arrow-up-drawing",value:"arrow-up"},{label:"toolbarAnnotationsArrowDown",icon:"arrow-down-drawing",value:"arrow-down"}],E0=[{label:"toolbarAnnotationsQuickDatePriceRange",icon:"measurer-drawing",value:"quick-date-price-range"},{label:"toolbarAnnotationsDateRange",icon:"date-range-drawing",value:"date-range"},{label:"toolbarAnnotationsPriceRange",icon:"price-range-drawing",value:"price-range"},{label:"toolbarAnnotationsDatePriceRange",icon:"date-price-range-drawing",value:"date-price-range"}],Dy=[{strokeWidth:1,label:"1",value:1},{strokeWidth:2,label:"2",value:2},{strokeWidth:3,label:"3",value:3},{strokeWidth:4,label:"4",value:4},{strokeWidth:8,label:"8",value:8}],ha=[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],Ty=[{label:"10",value:10},{label:"12",value:12},{label:"14",value:14},{label:"16",value:16},{label:"18",value:18},{label:"22",value:22},{label:"28",value:28},{label:"36",value:36},{label:"46",value:46}],{ARRAY:w0,BOOLEAN:P0,NUMBER:_0,OBJECT:B0,STRING:z0,UNION:V0,Color:Cy,FloatingToolbar:F0,Listeners:G0,Menu:Bh,PropertiesArray:W0,ToolbarButtonProperties:Ny,ToolbarButtonWidget:H0,Validate:cs}=by,nn=class extends Ny{constructor(){super(...arguments),this.checkedOverrides=new Ny}};d([cs(V0(["line-stroke-width","line-style-type","line-color","fill-color","text-color","text-size","delete","settings","lock"]))],nn.prototype,"value",2),d([cs(B0,{optional:!0})],nn.prototype,"checkedOverrides",2),d([cs(z0,{optional:!0})],nn.prototype,"color",2),d([cs(_0,{optional:!0})],nn.prototype,"strokeWidth",2),d([cs(Boolean,{optional:!0})],nn.prototype,"isMultiColor",2);var K0=class extends H0{update(t){super.update(t),t.value==="line-stroke-width"&&this.updateLineStrokeWidth(t),(t.value==="fill-color"||t.value==="line-color"||t.value==="text-color")&&this.updateFillColor(t)}updateFillColor(t){const e=this.getElement();e.classList.add("ag-charts-annotations__color-picker-button"),e.classList.toggle("ag-charts-annotations__color-picker-button--multi-color",t.isMultiColor),e.style.setProperty("--color",t.color??null)}updateLineStrokeWidth(t){const e=this.getElement();e.classList.add("ag-charts-annotations__stroke-width-button"),e.style.setProperty("--stroke-width",`${t.strokeWidth}px`)}},U0=class extends F0{createButtonWidget(){return new K0(this.localeManager)}},zh=class extends by.BaseProperties{constructor(t,e){super(),this.ctx=t,this.getActiveDatum=e,this.enabled=!0,this.buttons=new W0(nn),this.destroyFns=[],this.events=new G0,this.visibleButtons=[],this.toolbar=new U0(this.ctx,"annotation-options"),this.colorPicker=new ky(this.ctx),this.textSizeMenu=new Bh(this.ctx,"text-size"),this.lineStyleTypeMenu=new Bh(this.ctx,"annotations-line-style-type"),this.lineStrokeWidthMenu=new Bh(this.ctx,"annotations-line-stroke-width"),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.toolbar.addToolbarListener("toolbar-moved",this.onToolbarMoved.bind(this)),t.widgets.seriesWidget.addListener("drag-start",this.onDragStart.bind(this)),t.widgets.seriesWidget.addListener("drag-end",this.onDragEnd.bind(this)),()=>this.colorPicker.destroy())}onDragStart(){this.toolbar.ignorePointerEvents()}onDragEnd(){this.toolbar.capturePointerEvents()}destroy(){for(const t of this.destroyFns)t()}addListener(t,e){return this.events.addListener(t,e)}show(){this.enabled&&this.toolbar.show()}hide(){this.toolbar.hide()}updateButtons(t){if(!this.enabled)return;const e={"line-style-type":To(t),"line-stroke-width":To(t),"line-color":b0(t),"text-color":k0(t),"fill-color":M0(t),"text-size":Ph(t),settings:sn(t),lock:!0,delete:!0};this.visibleButtons=this.buttons.filter(i=>e[i.value]),this.toolbar.clearButtons(),this.toolbar.updateButtons(this.visibleButtons),this.refreshButtons(t)}setAnchorScene(t){this.toolbar.hasBeenDragged()||this.toolbar.setAnchor(t.getAnchor())}hideOverlays(){this.toolbar.clearActiveButton(),this.colorPicker.hide({lastFocus:null}),this.textSizeMenu.hide(),this.lineStyleTypeMenu.hide(),this.lineStrokeWidthMenu.hide(),this.dispatch("hid-overlays")}clearActiveButton(){this.toolbar.clearActiveButton()}updateColors(t){this.updateColorPickerColor("line-color",t.getDefaultColor("line-color"),t.getDefaultOpacity("line-color"),"isMultiColor"in t&&t?.isMultiColor),this.updateColorPickerColor("fill-color",t.getDefaultColor("fill-color"),t.getDefaultOpacity("fill-color"),"isMultiColor"in t&&t?.isMultiColor),this.updateColorPickerColor("text-color",t.getDefaultColor("text-color"),t.getDefaultOpacity("text-color"),"isMultiColor"in t&&t?.isMultiColor)}updateColorPickerColor(t,e,i,o){if(e!=null&&i!=null){const{r:s,g:n,b:a}=Cy.fromString(e);e=Cy.fromArray([s,n,a,i]).toHexString()}this.updateButtonByValue(t,{color:e,isMultiColor:o})}updateFontSize(t){this.updateButtonByValue("text-size",{label:t!=null?String(t):void 0})}updateLineStyleType(t){this.updateButtonByValue("line-style-type",{icon:t.icon})}updateStrokeWidth(t){this.updateButtonByValue("line-stroke-width",{label:t.label,strokeWidth:t.value})}dispatch(t,e){this.events.dispatch(t,e)}onButtonPress({event:t,button:e}){const i=this.getActiveDatum();if(i)switch(this.hideOverlays(),e.value){case"line-style-type":{const o=To(i)?ra(i.lineDash,i.lineStyle):void 0;this.lineStyleTypeMenu.show({items:ha,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStyle"),value:o,sourceEvent:t.sourceEvent,onPress:s=>this.onLineStyleTypeMenuPress(s,i),class:"ag-charts-annotations__line-style-type-menu"});break}case"line-stroke-width":{const o=To(i)?i.strokeWidth:void 0;this.lineStrokeWidthMenu.show({items:Dy,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStrokeWidth"),value:o,sourceEvent:t.sourceEvent,onPress:s=>this.onLineStrokeWidthMenuPress(s,i),class:"ag-charts-annotations__line-stroke-width-menu"});break}case"line-color":case"fill-color":case"text-color":{this.toolbar.toggleActiveButtonByIndex(e.index),this.colorPicker.show({color:i?.getDefaultColor(e.value),opacity:i?.getDefaultOpacity(e.value),sourceEvent:t.sourceEvent,hasMultiColorOption:"isMultiColor"in i,isMultiColor:"isMultiColor"in i&&i?.isMultiColor,onChange:i!=null?this.onColorPickerChange.bind(this,e.value,i):void 0,onChangeHide:(o=>{this.dispatch("saved-color",{type:i.type,colorPickerType:e.value,color:i.getDefaultColor(o)})}).bind(this,e.value)});break}case"text-size":{const o=Ni(i)?i.fontSize:void 0;this.textSizeMenu.show({items:Ty,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsTextSize"),value:o,sourceEvent:t.sourceEvent,onPress:s=>this.onTextSizeMenuPress(s,i),class:"ag-charts-annotations__text-size-menu"});break}case"delete":{this.dispatch("pressed-delete");break}case"lock":{i.locked=!i.locked,this.refreshButtons(i),this.dispatch("pressed-lock");break}case"settings":{this.toolbar.toggleActiveButtonByIndex(e.index),this.dispatch("pressed-settings",t);break}}}onToolbarMoved(t){const{buttonBounds:e,popoverBounds:i}=t,o={x:i.x,y:i.y+i.height+4},s={y:i.y-4};this.colorPicker.setAnchor(o,s);for(const[n,a]of e.entries()){const r=this.visibleButtons.at(n);if(!r)continue;const l={x:a.x,y:a.y+a.height-1},c={y:a.y};switch(r.value){case"line-stroke-width":this.lineStrokeWidthMenu.setAnchor(l,c);break;case"line-style-type":this.lineStyleTypeMenu.setAnchor(l,c);break;case"text-size":this.textSizeMenu.setAnchor(l,c);break}}}onColorPickerChange(t,e,i,o,s,n){this.dispatch("updated-color",{type:e.type,colorPickerType:t,colorOpacity:i,color:o,opacity:s,isMultiColor:n}),this.updateColorPickerColor(t,i,s,n)}onTextSizeMenuPress(t,e){if(!Ph(e))return;const i=t.value;this.dispatch("updated-font-size",{type:e.type,fontSize:i}),this.textSizeMenu.hide(),this.updateFontSize(i)}onLineStyleTypeMenuPress(t,e){if(!To(e))return;const i=t.value;this.dispatch("updated-line-style",{type:e.type,lineStyleType:i}),this.lineStyleTypeMenu.hide(),this.updateLineStyleType(t)}onLineStrokeWidthMenuPress(t,e){if(!To(e))return;const i=t.value;this.dispatch("updated-line-width",{type:e.type,strokeWidth:i}),this.lineStrokeWidthMenu.hide(),this.updateStrokeWidth(t)}refreshButtons(t){const e=t.locked??!1;for(const[i,o]of this.visibleButtons.entries())o&&(o.value==="lock"?(this.toolbar.toggleSwitchCheckedByIndex(i,e),this.updateButtonByIndex(i,e?o.checkedOverrides.toJson():o.toJson())):this.toolbar.toggleButtonEnabledByIndex(i,!e));Ph(t)&&this.updateFontSize(t.fontSize),this.updateColors(t),this.updateLineStyles(t)}updateLineStyles(t){if(!To(t))return;const e=t.strokeWidth??1,i=ra(t.lineDash,t.lineStyle);this.updateStrokeWidth({strokeWidth:e,value:e,label:String(e)}),this.updateLineStyleType(ha.find(o=>o.value===i)??ha[0])}updateButtonByValue(t,e){const i=this.visibleButtons.findIndex(o=>o.value===t);i!==-1&&this.updateButtonByIndex(i,e)}updateButtonByIndex(t,e){const i=this.visibleButtons.at(t);i&&this.toolbar.updateButtonByIndex(t,{...i.toJson(),...e,value:e.value??i.value})}};d([cs(P0)],zh.prototype,"enabled",2),d([cs(w0)],zh.prototype,"buttons",2);import{_ModuleSupport as Y0}from"ag-charts-community";var{StateMachine:Oy,StateMachineProperty:Vh,Vec2:Ly,Debug:j0}=Y0,wt=class extends Oy{constructor(t){const e=({context:i})=>{this.node?.drag(this.datum,this.offset,i,this.snapping),t.update()};super("idle",{idle:{dragStart:{target:"dragging",action:({offset:i,context:o})=>{this.hasMoved=!1,this.dragStart=i,this.offset=i,this.node?.dragStart(this.datum,i,o)}}},dragging:{keyDown:e,keyUp:e,drag:({offset:i,context:o})=>{this.hasMoved=Ly.lengthSquared(Ly.sub(i,this.dragStart))>0,this.offset=i,this.node?.drag(this.datum,i,o,this.snapping),t.update()},dragEnd:{target:Oy.parent,action:()=>{this.node?.stopDragging(),this.hasMoved&&t.recordAction("Move annotation"),t.update()}}}}),this.debug=j0.create(!0,"annotations"),this.hasMoved=!1,this.snapping=!1}};d([Vh()],wt.prototype,"snapping",2),d([Vh()],wt.prototype,"datum",2),d([Vh()],wt.prototype,"node",2);import{_ModuleSupport as X0}from"ag-charts-community";var{STRING:$0,Validate:Z0}=X0,Co=class extends Lh{constructor(){super(...arguments),this.type="arrow-down"}static is(t){return Rt(t)&&t.type==="arrow-down"}};d([Z0($0)],Co.prototype,"type",2);import{_ModuleSupport as Ry}from"ag-charts-community";import{_ModuleSupport as Ey}from"ag-charts-community";import{_ModuleSupport as Or}from"ag-charts-community";import{_ModuleSupport as hs}from"ag-charts-community";var wy=class ek extends hs.Group{constructor(){super(...arguments),this.active=!1,this.locked=!1,this.visible=!1,this.zIndex=1}drag(e){const{handle:i,locked:o}=this;return o?{point:{x:i.x,y:i.y},offset:{x:0,y:0}}:{point:e,offset:{x:e.x-i.x,y:e.y-i.y}}}toggleActive(e){this.active=e,e||(this.handle.strokeWidth=ek.INACTIVE_STROKE_WIDTH)}toggleHovered(e){this.glow.visible=!this.locked&&e,this.glow.dirtyPath=!0}toggleDragging(e){this.locked||(this.handle.visible=!e,this.glow.visible=this.glow.visible&&!e,this.handle.dirtyPath=!0,this.glow.dirtyPath=!0)}toggleLocked(e){this.locked=e}getCursor(){}containsPoint(e,i){return this.handle.containsPoint(e,i)}};wy.INACTIVE_STROKE_WIDTH=2;var No=wy,Fh=class ik extends No{constructor(){super(),this.handle=new hs.Marker({shape:"circle"}),this.glow=new hs.Marker({shape:"circle"}),this.append([this.handle]),this.handle.size=ik.HANDLE_SIZE,this.handle.strokeWidth=No.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2}update(e){this.handle.setProperties({...e,strokeWidth:No.INACTIVE_STROKE_WIDTH})}drag(e){return{point:e,offset:{x:0,y:0}}}};Fh.HANDLE_SIZE=7,Fh.GLOW_SIZE=9;var Oo=Fh,Lr=class we extends No{constructor(){super(),this.handle=new hs.Rect,this.glow=new hs.Rect,this.gradient="horizontal",this.append([this.glow,this.handle]),this.handle.cornerRadius=we.CORNER_RADIUS,this.handle.width=we.HANDLE_SIZE,this.handle.height=we.HANDLE_SIZE,this.handle.strokeWidth=No.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.cornerRadius=we.CORNER_RADIUS,this.glow.width=we.GLOW_SIZE,this.glow.height=we.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(e){if(super.toggleLocked(e),e){const i=(we.HANDLE_SIZE-Oo.HANDLE_SIZE)/2;this.handle.cornerRadius=1,this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.x+=i,this.handle.y+=i,this.handle.width=Oo.HANDLE_SIZE,this.handle.height=Oo.HANDLE_SIZE,this.glow.width=Oo.GLOW_SIZE,this.glow.height=Oo.GLOW_SIZE}else this.handle.cornerRadius=we.CORNER_RADIUS,this.handle.width=we.HANDLE_SIZE,this.handle.height=we.HANDLE_SIZE,this.glow.width=we.GLOW_SIZE,this.glow.height=we.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles)}update(e){if(this.cachedStyles={...e},this.active||delete e.strokeWidth,this.locked){delete e.fill,delete e.strokeWidth;const i=(we.HANDLE_SIZE-Oo.HANDLE_SIZE)/2;e.x-=i,e.y-=i,this.cachedStyles.x-=i,this.cachedStyles.y-=i}this.handle.setProperties(e),this.glow.setProperties({...e,x:(e.x??this.glow.x)-2,y:(e.y??this.glow.y)-2,strokeWidth:0,fill:e.stroke})}drag(e){return this.locked?{point:e,offset:{x:0,y:0}}:this.gradient==="vertical"?{point:{x:e.x,y:this.handle.y},offset:{x:e.x-this.handle.x,y:0}}:{point:{x:this.handle.x,y:e.y},offset:{x:0,y:e.y-this.handle.y}}}getCursor(){if(!this.locked)return this.gradient==="vertical"?"col-resize":"row-resize"}};Lr.HANDLE_SIZE=12,Lr.GLOW_SIZE=16,Lr.CORNER_RADIUS=4;var an=Lr,Gh=class nr extends No{constructor(){super(),this.handle=new hs.Marker({shape:"circle"}),this.glow=new hs.Marker({shape:"circle"}),this.append([this.glow,this.handle]),this.handle.size=nr.HANDLE_SIZE,this.handle.strokeWidth=No.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.size=nr.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(e){super.toggleLocked(e),e?(this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.size=Oo.HANDLE_SIZE,this.glow.size=Oo.GLOW_SIZE):(this.handle.size=nr.HANDLE_SIZE,this.glow.size=nr.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles))}update(e){this.cachedStyles={...e},this.active||delete e.strokeWidth,this.locked&&(delete e.fill,delete e.strokeWidth),this.handle.setProperties(e),this.glow.setProperties({...e,strokeWidth:0,fill:e.stroke})}getCursor(){return"pointer"}};Gh.HANDLE_SIZE=11,Gh.GLOW_SIZE=17;var Mt=Gh,{ZIndexMap:Q0}=Or,Zt=class extends Or.Group{constructor(){super(...arguments),this.name="AnnotationScene",this.zIndex=Q0.CHART_ANNOTATION}static isCheck(t,e){return Rt(t)&&Object.hasOwn(t,"type")&&t.type===e}toggleHovered(t){this.toggleHandles(t)}*nonHandleChildren(){for(const t of this.children())t instanceof No||(yield t)}computeBBoxWithoutHandles(){return Or.Transformable.toCanvas(this,Or.Group.computeChildrenBBox(this.nonHandleChildren()))}updateNode(t,e,i){if(!i&&e){this.removeChild(e);return}return i&&e==null&&(e=new t,this.appendChild(e)),e}};import{_ModuleSupport as q0}from"ag-charts-community";import{_ModuleSupport as J0}from"ag-charts-community";var{Vec2:Py,toRadians:tT}=J0;function da(t,e,i=!1,o,s=1){if(!i)return mt(t,e);const n=o?vt(o,e):Py.origin();return mt(pa(t,n,s),e)}function pa({x:t,y:e},i,o,s=1){const{x:n,y:a}=i,r=Math.sqrt(Math.pow(t-n,2)+Math.pow(e-a,2)),l=Math.atan2(e-a,t-n),c=tT(o),h=Math.round(l/c)*c;return{x:n+r*Math.cos(h),y:a+r*Math.sin(h)*s}}function Rr(t,e){const i={};return Object.entries(t).forEach(([o,s])=>{i[o]=vt(s,e)}),i}function Wh(t,e,i){const o=[],s={};Object.entries(t).forEach(([h,p])=>{const u=Py.add(p,e);o.push(u),s[h]=mt(u,i)});const{xAxis:n,yAxis:a}=i,r=(h,p,u)=>p>=h&&p<=u,l=o.every(h=>r(n.bounds.x,h.x,n.bounds.x+n.bounds.width)),c=o.every(h=>r(a.bounds.y,h.y,a.bounds.y+a.bounds.height));return{vectors:s,translateX:l,translateY:c}}var{Vec2:Hh}=q0,_y=class extends Zt{constructor(){super(...arguments),this.handle=new Mt,this.anchor={x:0,y:0,position:"above"}}update(t,e){const i=vt(t,e);this.updateHandle(t,i),this.anchor=this.updateAnchor(t,i,e)}dragStart(t,e,i){this.dragState={offset:e,...Rr({handle:t},i)}}drag(t,e,i){const{dragState:o}=this;if(t.locked||!o)return;const s=Hh.add(o.handle,Hh.sub(e,o.offset)),n=mt(s,i);ci(i,n)&&(t.x=n.x,t.y=n.y)}translate(t,e,i){const o=Hh.add(vt(t,i),e),s=mt(o,i);ci(i,s)&&(t.x=s.x,t.y=s.y)}toggleHandles(t){this.handle.visible=!!t,this.handle.toggleHovered(this.activeHandle==="handle")}toggleActive(t){this.toggleHandles(t),this.handle.toggleActive(t)}stopDragging(){this.handle.toggleDragging(!1)}copy(t,e,i){const o=vt(t,i),s=mt({x:o.x-30,y:o.y-30},i);return e.x=s.x,e.y=s.y,e}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(t,e){const{handle:i}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="handle",!0):!1}getNodeAtCoords(t,e){if(this.handle.containsPoint(t,e))return"handle"}updateHandle(t,e,i){const{x:o,y:s}=this.getHandleCoords(t,e,i),n=this.getHandleStyles(t);this.handle.update({...n,x:o,y:s}),this.handle.toggleLocked(t.locked??!1)}updateAnchor(t,e,i){const o=this.getHandleCoords(t,e);return{x:o.x+i.seriesRect.x,y:o.y+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(t,e,i){return{x:e.x,y:e.y}}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}}},By=class extends _y{constructor(){super(),this.append([this.handle])}update(t,e){super.update(t,e);const i=vt(t,e);this.updateShape(t,i)}updateShape(t,e){this.updateShapeStyles(t),this.updateShapePath(t,e)}updateShapeStyles(t){const{shape:e}=this;e.fill=t.fill,e.fillOpacity=t.fillOpacity??1}updateShapePath(t,e){const{shape:i}=this;i.x=e.x,i.y=e.y,i.size=t.size}containsPoint(t,e){return super.containsPoint(t,e)||this.shape.containsPoint(t,e)}getNodeAtCoords(t,e){return this.shape.containsPoint(t,e)?"shape":super.getNodeAtCoords(t,e)}},zy=[[.5,0],[1,.5],[.75,.5],[.75,1],[.25,1],[.25,.5],[0,.5]];function Vy(t){Ey.drawMarkerUnitPolygon(t,zy)}Vy.anchor={x:.5,y:0};var Er=class extends By{constructor(){super(),this.type="arrow-up",this.shape=new Ey.Marker({shape:Vy}),this.append([this.shape])}static is(t){return Zt.isCheck(t,"arrow-up")}getHandleCoords(t,e){const i=Mt.HANDLE_SIZE/2,o=super.getHandleCoords(t,e);return o.y-=i,o}},eT=zy.map(([t,e])=>[t,1-e]);function Fy(t){Ry.drawMarkerUnitPolygon(t,eT)}Fy.anchor={x:.5,y:1};var wr=class extends By{constructor(){super(),this.type="arrow-down",this.shape=new Ry.Marker({shape:Fy}),this.append([this.shape])}static is(t){return Zt.isCheck(t,"arrow-down")}updateAnchor(t,e,i){const o=super.updateAnchor(t,e,i);return o.y-=t.size,o}getHandleCoords(t,e){const i=Mt.HANDLE_SIZE/2,o=super.getHandleCoords(t,e);return o.y+=i,o}};import{_ModuleSupport as iT}from"ag-charts-community";var{StateMachine:Pr,StateMachineProperty:oT,Debug:sT}=iT,Kh=class extends Pr{constructor(t){const e=({point:o})=>{const s=this.createDatum();s.set({x:o.x,y:o.y}),t.create(s)},i=()=>{this.node?.toggleActive(!0),t.showAnnotationOptions(),t.update()};super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},cancel:Pr.parent,reset:Pr.parent},"waiting-first-render":{render:{target:Pr.parent,action:i}}}),this.debug=sT.create(!0,"annotations")}};d([oT()],Kh.prototype,"node",2);var nT=class extends Kh{createDatum(){return new Co}},Gy={type:"arrow-down",datum:Co,scene:wr,isDatum:Co.is,translate:(t,e,i,o)=>{Co.is(e)&&wr.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(Co.is(e)&&Co.is(i)&&wr.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{Co.is(e)&&wr.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new nT({...t,create:e("arrow-down")}),dragState:t=>new wt(t)};import{_ModuleSupport as aT}from"ag-charts-community";var{STRING:rT,Validate:lT}=aT,Lo=class extends Lh{constructor(){super(...arguments),this.type="arrow-up"}static is(t){return Rt(t)&&t.type==="arrow-up"}};d([lT(rT)],Lo.prototype,"type",2);var cT=class extends Kh{createDatum(){return new Lo}},Wy={type:"arrow-up",datum:Lo,scene:Er,isDatum:Lo.is,translate:(t,e,i,o)=>{Lo.is(e)&&Er.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(Lo.is(e)&&Lo.is(i)&&Er.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{Lo.is(e)&&Er.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new cT({...t,create:e("arrow-up")}),dragState:t=>new wt(t)};import{_ModuleSupport as hT}from"ag-charts-community";import{_ModuleSupport as Hy}from"ag-charts-community";import{_ModuleSupport as dT}from"ag-charts-community";import{_ModuleSupport as pT}from"ag-charts-community";var{Vec2:uT,Vec4:Ky}=pT,Uy=class extends Zt{extendLine({x1:t,y1:e,x2:i,y2:o},s,n){const a={x1:t,y1:e,x2:i,y2:o};if(!s.extendStart&&!s.extendEnd)return a;const[r,l]=DD(a,n.yAxis.bounds),c=a.x2=a.y2,p=a.x2===a.x1;return s.extendEnd&&(p?a.y2=h?l.y:r.y:(a.x2=c?r.x:l.x,a.y2=c?r.y:l.y)),s.extendStart&&(p?a.y1=h?r.y:l.y:(a.x1=c?l.x:r.x,a.y1=c?l.y:r.y)),a}dragStart(t,e,i){this.dragState={offset:e,...Rr({start:t.start,end:t.end},i)}}drag(t,e,i,o){t.locked||(this.activeHandle?this.dragHandle(t,e,i,o):this.dragAll(t,e,i))}dragAll(t,e,i){const{dragState:o}=this;o&&this.translatePoints(t,o.start,o.end,uT.sub(e,o.offset),i)}translatePoints(t,e,i,o,s){const{vectors:n,translateX:a,translateY:r}=Wh({start:e,end:i},o,s);a&&(t.start.x=n.start?.x,t.end.x=n.end?.x),(this.ignoreYBounds||r)&&(t.start.y=n.start?.y,t.end.y=n.end?.y)}translate(t,e,i){this.translatePoints(t,vt(t.start,i),vt(t.end,i),e,i)}copy(t,e,i){const o=ri(t,i);if(!o)return;const s=this.computeBBoxWithoutHandles(),n={x:-s.width/2,y:-s.height/2};return this.translatePoints(e,Ky.start(o),Ky.end(o),n,i),e}},{Vec4:Yy}=dT,Uh=class extends Uy{constructor(){super(...arguments),this.start=new Mt,this.end=new Mt,this.anchor={x:0,y:0,position:"above"}}update(t,e){const i=ri(t,e);i!=null&&(this.updateHandles(t,i),this.updateAnchor(t,i,e))}toggleHandles(t){if(typeof t=="boolean")this.start.visible=t,this.end.visible=t;else for(const[e,i]of Object.entries(t))this[e].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end")}toggleActive(t){this.toggleHandles(t),this.start.toggleActive(t),this.end.toggleActive(t)}dragHandle(t,e,i,o){const{activeHandle:s,dragState:n}=this;if(!s||!n)return;this[s].toggleDragging(!0);const a=o?this.snapToAngle(t,e,i):mt(this[s].drag(e).point,i);!a||!ci(i,a)||(t[s].x=a.x,t[s].y=a.y)}snapToAngle(t,e,i){const{activeHandle:o}=this,n=["start","end"].find(r=>r!==o);if(!o||!n)return;this[o].toggleDragging(!0);const a=vt(t[n],i);return mt(pa(e,a,t.snapToAngle),i)}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(t,e){const{start:i,end:o}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="start",!0):o.containsPoint(t,e)?(this.activeHandle="end",!0):!1}getNodeAtCoords(t,e){if(this.start.containsPoint(t,e)||this.end.containsPoint(t,e))return"handle"}updateHandles(t,e,i){this.start.update({...this.getHandleStyles(t,"start"),...this.getHandleCoords(t,e,"start")}),this.end.update({...this.getHandleStyles(t,"end"),...this.getHandleCoords(t,e,"end",i)}),this.start.toggleLocked(t.locked??!1),this.end.toggleLocked(t.locked??!1)}updateAnchor(t,e,i,o){this.anchor={x:e.x1+i.seriesRect.x,y:e.y1+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(t,e,i,o){return i==="start"?Yy.start(e):Yy.end(e)}getHandleStyles(t,e){return{fill:t.handle.fill,stroke:t.handle.stroke,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}}},{Vec2:jy,Vec4:Xy}=Hy,gT=class extends Uh{constructor(){super(...arguments),this.label=new Hy.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(t){this.textInputBBox=t,this.markDirty()}update(t,e){const i=ri(t,e);if(i==null)return;const o=this.getTextBBox(t,i);this.updateLabel(t,o,i),this.updateHandles(t,i,o),this.updateShape(t,o,i),this.updateAnchor(t,i,e,o)}dragHandle(t,e,i,o){const{activeHandle:s,dragState:n}=this;if(!s||!n)return;this[s].toggleDragging(!0);const a=jy.add(n.end,jy.sub(e,n.offset)),r=o?this.snapToAngle(t,a,i):mt(a,i);!r||!ci(i,r)||(t[s].x=r.x,t[s].y=r.y)}containsPoint(t,e){const{label:i}=this;return super.containsPoint(t,e)||i.containsPoint(t,e)}getNodeAtCoords(t,e){return this.label.containsPoint(t,e)?"text":super.getNodeAtCoords(t,e)}getTextBBox(t,e){const{text:i}=t.getText();return Oh(t,i,Xy.end(e),this.textInputBBox)}updateLabel(t,e,i){const{text:o,isPlaceholder:s}=t.getText();ny(this.label,o,s,t,this.getLabelCoords(t,e,i))}updateShape(t,e,i){}getLabelCoords(t,e,i){return Xy.end(i)}getHandleStyles(t,e){return{...super.getHandleStyles(t,e),stroke:t.handle.stroke??t.color}}},{drawCorner:yT,Path:fT}=hT,_r=class extends gT{constructor(){super(),this.type="callout",this.shape=new fT,this.append([this.shape,this.label,this.start,this.end])}static is(t){return Zt.isCheck(t,"callout")}drag(t,e,i,o){t.locked||(this.activeHandle==="end"?this.dragHandle(t,e,i,o):this.dragAll(t,e,i))}getLabelCoords(t,e,i){const o=t.getPadding(),{bodyBounds:s={x:0,y:0,width:0,height:0}}=this.getDimensions(t,e,i)??{};return{x:s.x+o.left,y:s.y-o.bottom}}getHandleStyles(t,e){return e==="start"?{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}:{fill:void 0,strokeWidth:0}}updateAnchor(t,e,i,o){const{bodyBounds:s}=this.getDimensions(t,o,e)??{},n=s??o;this.anchor={x:n.x+i.seriesRect.x,y:n.y+i.seriesRect.y-n.height,position:this.anchor.position}}updateShape(t,e,i){const{shape:o}=this;o.fill=t.fill,o.fillOpacity=t.fillOpacity??1,o.stroke=t.stroke,o.strokeWidth=t.strokeWidth??1,o.strokeOpacity=t.strokeOpacity??1;const{tailPoint:s,bodyBounds:n}=this.getDimensions(t,e,i)??{};!s||!n||this.updatePath(s,n)}updatePath(t,e){const{x:i,y:o}=t,{x:s,y:n,width:a,height:r}=e,l=n-r,c=s+a,h=this.calculateCalloutPlacement({x:i,y:o},e),p=8,u=[{coordinates:{x0:s,x1:s+p,y0:l+p,y1:l,cx:h==="topLeft"?i:s+p,cy:h==="topLeft"?o:l+p},type:h==="topLeft"?"calloutCorner":"corner"},{coordinates:{x0:s+p,x1:c-p,y0:l,y1:l,cx:i,cy:o},type:h==="top"?"calloutSide":"side"},{coordinates:{x0:c-p,x1:c,y0:l,y1:l+p,cx:h==="topRight"?i:c-p,cy:h==="topRight"?o:l+p},type:h==="topRight"?"calloutCorner":"corner"},{coordinates:{x0:c,x1:c,y0:l+p,y1:n-p,cx:i,cy:o},type:h==="right"?"calloutSide":"side"},{coordinates:{x0:c,x1:c-p,y0:n-p,y1:n,cx:h==="bottomRight"?i:c-p,cy:h==="bottomRight"?o:n-p},type:h==="bottomRight"?"calloutCorner":"corner"},{coordinates:{x0:c-p,x1:s+p,y0:n,y1:n,cx:i,cy:o},type:h==="bottom"?"calloutSide":"side"},{coordinates:{x0:s+p,x1:s,y0:n,y1:n-p,cx:h==="bottomLeft"?i:s+p,cy:h==="bottomLeft"?o:n-p},type:h==="bottomLeft"?"calloutCorner":"corner"},{coordinates:{x0:s,x1:s,y0:n-p,y1:l+p,cx:i,cy:o},type:h==="left"?"calloutSide":"side"}],{path:g}=this.shape;g.clear(),g.moveTo(s,l+p),u.forEach(({coordinates:y,type:f})=>{this.drawPath(g,y,p,f)}),g.closePath()}drawPath(t,{x0:e,y0:i,x1:o,y1:s,cx:n,cy:a},r,l){switch(l){case"calloutCorner":{t.lineTo(n,a),t.lineTo(o,s);break}case"corner":{yT(t,{x0:e,x1:o,y0:i,y1:s,cx:n,cy:a},r,!1);break}case"calloutSide":{if(e!==o){const h=e>o?-1:1,p=Math.min(e,o)+Math.abs(o-e)/2;t.lineTo(p-6*h,i),t.lineTo(n,a),t.lineTo(p+6*h,i),t.lineTo(o,s)}else{const h=i>s?-1:1,p=Math.min(i,s)+Math.abs(i-s)/2;t.lineTo(e,p-6*h),t.lineTo(n,a),t.lineTo(e,p+6*h),t.lineTo(o,s)}break}case"side":default:{t.lineTo(o,s);break}}}calculateCalloutPlacement(t,e){const i=e.x+e.width,o=e.y-e.height;let s,n;return t.x>i?s="right":t.xe.y?n="bottom":t.y{const g=this.createDatum();g.set({start:u,end:u,visible:!0}),t.create(g)},i=()=>{const{node:u}=this;u?.toggleActive(!0),u?.toggleHandles({start:!0})},o=()=>{t.showTextInput(),this.datum&&(this.datum.visible=!1)},s=()=>{t.hideTextInput(),this.datum&&(this.datum.visible=!0),t.deselect()},n=u=>{this.node?.setTextInputBBox(u),t.update()},a=({point:u})=>{const{datum:g,node:y}=this;g?.set({end:u}),y?.toggleActive(!0),y?.toggleHandles({end:!1}),t.update()},r=()=>{t.showAnnotationOptions(),this.node?.toggleHandles({end:!0})},l=({colorPickerType:u,colorOpacity:g,color:y,opacity:f,isMultiColor:m})=>{const{datum:x}=this;x&&(u==="text-color"&&t.updateTextInputColor(y),Cr(x,u,g,y,f,m),t.update())},c=u=>{const{datum:g,node:y}=this;!g||!y||!Ni(g)||(g.fontSize=u,t.updateTextInputFontSize(u),t.update())},h=()=>{t.delete()},p=({textInputValue:u,bbox:g})=>{const{datum:y}=this;if(g!=null&&u!=null&&u.length>0){if(!Ni(y))return;const f=Mr(y,u,g.width);y?.set({text:f}),t.update(),t.recordAction(`Create ${y?.type} annotation`)}else t.delete()};super("start",{start:{click:{target:"waiting-first-render",action:e},dragStart:{target:"waiting-first-render",action:e},cancel:hi.parent,reset:hi.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:a,drag:a,click:{target:"edit",action:r},dragEnd:{target:"edit",action:r},reset:{target:hi.parent,action:h},cancel:{target:hi.parent,action:h}},edit:{onEnter:o,updateTextInputBBox:n,color:l,fontSize:c,textInput:[{guard:Yh,target:hi.parent,action:h},{guard:jh,target:hi.parent,action:p}],click:{target:hi.parent,action:p},dragStart:{target:hi.parent,action:p},resize:{target:hi.parent,action:p},onExit:s,cancel:{target:hi.parent,action:h}}}),this.debug=xT.create(!0,"annotations")}};d([$y()],Xh.prototype,"datum",2),d([$y()],Xh.prototype,"node",2);var ST=class extends Xh{createDatum(){return new li}},Zy={type:"callout",datum:li,scene:_r,isDatum:li.is,translate:(t,e,i,o)=>{if(li.is(e)&&_r.is(t))return t.translate(e,i,o)},copy:(t,e,i,o)=>{if(li.is(e)&&li.is(i)&&_r.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{li.is(e)&&_r.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new ST({...t,create:e("callout")}),dragState:t=>new wt(t)};import{_ModuleSupport as Qy}from"ag-charts-community";import{_ModuleSupport as bT}from"ag-charts-community";var $h=class extends _y{constructor(){super(...arguments),this.label=new bT.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(t){this.textInputBBox=t,this.markDirty()}update(t,e){const i=vt(t,e),o=this.getTextBBox(t,i,e);this.updateLabel(t,o),this.updateHandle(t,i,o),this.updateShape(t,o),this.anchor=this.updateAnchor(t,o,e)}copy(t,e,i){const o=vt(t,i),s=this.getTextBBox(t,o,i),n=t.getPadding(),a=n.left+n.right,r=n.top+n.bottom,l=(s.width+a)/2,c=s.height+r,h=mt({x:o.x-l,y:o.y-c},i);return e.x=h.x,e.y=h.y,e}containsPoint(t,e){const{label:i}=this;return super.containsPoint(t,e)||i.visible&&i.containsPoint(t,e)}getNodeAtCoords(t,e){return this.label.visible&&this.label.containsPoint(t,e)?"text":super.getNodeAtCoords(t,e)}getTextBBox(t,e,i){const{text:o}=t.getText();return Oh(t,o,{x:e.x,y:e.y},this.textInputBBox)}updateLabel(t,e){const{text:i,isPlaceholder:o}=t.getText();ny(this.label,i,o,t,this.getLabelCoords(t,e))}updateShape(t,e){}updateAnchor(t,e,i){return{x:e.x+i.seriesRect.x,y:e.y+i.seriesRect.y-e.height,position:this.anchor.position}}getLabelCoords(t,e){return e}getHandleCoords(t,e,i){return i}getHandleStyles(t){const e=super.getHandleStyles(t);return e.stroke=t.handle.stroke??t.color,e}},{drawCorner:Zh}=Qy,Br=class extends $h{constructor(){super(),this.type="comment",this.shape=new Qy.Path,this.append([this.shape,this.label,this.handle])}static is(t){return Zt.isCheck(t,"comment")}updateShape(t,e){const{shape:i}=this;i.fill=t.fill,i.fillOpacity=t.fillOpacity??1,i.stroke=t.stroke??"transparent",i.strokeWidth=t.strokeWidth??1,i.strokeOpacity=t.strokeOpacity??1,this.updatePath(t,e)}getLabelCoords(t,e){const i=t.getPadding();return{x:e.x+i.left,y:e.y-i.bottom}}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke??t.fill,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}}updateAnchor(t,e,i){const o=super.updateAnchor(t,e,i),s=t.getPadding();return o.y-=s.bottom+s.top,o}updatePath(t,e){const i=t.getPadding(),{x:o,y:s}=e;let{width:n,height:a}=e;const{fontSize:r}=t,l=i.left+i.right,c=i.top+i.bottom;n=n+l,a=Math.max(a+c,r+c);const h=s-a,p=o+n,u=(r*vr+c)/2,{path:g}=this.shape;g.clear(),g.moveTo(o,s),g.lineTo(o,h+u),Zh(g,{x0:o,x1:o+u,y0:h+u,y1:h,cx:o+u,cy:h+u},u,!1),g.lineTo(p-u,h),Zh(g,{x0:p-u,x1:p,y0:h,y1:h+u,cx:p-u,cy:h+u},u,!1),g.lineTo(p,s-u),Zh(g,{x0:p,x1:p-u,y0:s-u,y1:s,cx:p-u,cy:s-u},u,!1),g.closePath()}containsPoint(t,e){return super.containsPoint(t,e)||this.shape.containsPoint(t,e)}};import{_ModuleSupport as vT}from"ag-charts-community";var{StateMachine:to,StateMachineProperty:qy,Debug:MT}=vT,ua=class extends to{constructor(t){const e=({point:h})=>{const p=this.createDatum();p.set({x:h.x,y:h.y}),t.create(p)},i=()=>{this.node?.toggleActive(!0),t.showAnnotationOptions(),t.update()},o=()=>{t.showTextInput(),this.datum&&(this.datum.visible=!1)},s=()=>{t.hideTextInput(),this.datum&&(this.datum.visible=!0),t.deselect()},n=h=>{this.node?.setTextInputBBox(h),t.update()},a=({colorPickerType:h,colorOpacity:p,color:u,opacity:g,isMultiColor:y})=>{this.datum&&(h==="text-color"&&t.updateTextInputColor(u),Cr(this.datum,h,p,u,g,y),t.update())},r=h=>{const{datum:p,node:u}=this;!p||!u||!Ni(p)||(p.fontSize=h,t.updateTextInputFontSize(h),t.update())},l=()=>{t.delete()},c=({textInputValue:h,bbox:p})=>{if(p!=null&&h!=null&&h.length>0){const{datum:u}=this;if(!Ni(u))return;const g=Mr(u,h,p.width);u?.set({text:g}),t.update(),t.recordAction(`Create ${u?.type} annotation`)}else t.delete()};super("start",{start:{click:{target:"waiting-first-render",action:e},dragStart:{target:"waiting-first-render",action:e},cancel:to.parent,reset:to.parent},"waiting-first-render":{render:{target:"edit",action:i}},edit:{onEnter:o,updateTextInputBBox:n,color:a,fontSize:r,textInput:[{guard:Yh,target:to.parent,action:l},{guard:jh,target:to.parent,action:c}],click:{target:to.parent,action:c},dragStart:{target:to.parent,action:c},resize:{target:to.parent,action:c},onExit:s,cancel:{target:to.parent,action:l}}}),this.debug=MT.create(!0,"annotations")}};d([qy()],ua.prototype,"datum",2),d([qy()],ua.prototype,"node",2);var kT=class extends ua{createDatum(){return new Di}},Jy={type:"comment",datum:Di,scene:Br,isDatum:Di.is,translate:(t,e,i,o)=>{Di.is(e)&&Br.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(Di.is(e)&&Di.is(i)&&Br.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{Di.is(e)&&Br.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new kT({...t,create:e("comment")}),dragState:t=>new wt(t)};import{_ModuleSupport as AT}from"ag-charts-community";import{_ModuleSupport as zr}from"ag-charts-community";var{calculateLabelTranslation:IT,ChartAxisDirection:DT}=zr,tf=class extends zr.Group{constructor(){super({name:"AnnotationAxisLabelGroup"}),this.label=new zr.Text({zIndex:1}),this.rect=new zr.Rect;const{label:t}=this;t.fontSize=12,t.fontFamily="Verdana, sans-serif",t.fill="black",t.textBaseline="middle",t.textAlign="center",this.append([this.rect,this.label])}update(t){this.updateLabel(t),this.updateRect(t),this.updatePosition(t)}updateLabel({value:t,styles:e,context:i}){const{fontWeight:o,fontSize:s,fontStyle:n,fontFamily:a,textAlign:r,color:l="white",formatter:c}=e,h=c?c({value:t}):i.scaleValueFormatter()(t);this.label.setProperties({fontWeight:o,fontSize:s,fontStyle:n,fontFamily:a,textAlign:r,fill:l,text:h})}updateRect({styles:t}){const{rect:e}=this,{cornerRadius:i,fill:o,fillOpacity:s,stroke:n,strokeOpacity:a}=t;e.setProperties({cornerRadius:i,fill:o,fillOpacity:s,stroke:n,strokeOpacity:a})}updatePosition({x:t,y:e,context:i,styles:{padding:o}}){const{label:s,rect:n}=this,a=s.getBBox()?.clone(),r=o??8,l=o??5;a.grow(r,"horizontal"),a.grow(l,"vertical");const c=i.direction===DT.X?Math.round(l/2):r,{xTranslation:h,yTranslation:p}=IT({yDirection:!0,padding:i.labelPadding-c,position:i.position??"left",bbox:a}),u=t+h,g=e+p;s.x=u,s.y=g,n.y=g-Math.round(a.height/2),n.x=u-Math.round(a.width/2),n.height=a.height,n.width=a.width}};tf.className="AxisLabel";import{_ModuleSupport as Vr}from"ag-charts-community";var{Vec2:Oi}=Vr,Ce=class extends Vr.Line{constructor(){super(...arguments),this.growCollisionBox=9,this.clipMask=new Map}setProperties(t,e){return super.setProperties(t,e),this.updateCollisionBBox(),this}updateCollisionBBox(){const{growCollisionBox:t,strokeWidth:e,x1:i,y1:o,x2:s,y2:n}=this;let a=e+t;a%2===0&&(a+=1);const r=Oi.from(i,o-Math.floor(a/2)),l=Oi.from(s,n),c=Oi.distance(r,l);this.collisionBBox=new Vr.BBox(r.x,r.y,c,a)}isPointInPath(t,e){const{collisionBBox:i,x1:o,y1:s,x2:n,y2:a}=this;if(!i)return!1;const r=Oi.from(o,s),l=Oi.from(n,a),c=Oi.sub(Oi.from(t,e),r),h=Oi.sub(l,r),p=Oi.rotate(c,Oi.angle(c,h),r);return i.containsPoint(p.x,p.y)??!1}render(t){this.applyClipMask(t.ctx),super.render(t),this.closeClipMask(t.ctx)}setClipMask(t,e){const i=this.clipMask.get(t);Vr.jsonDiff(i,e)!=null&&this.markDirty(),e?this.clipMask.set(t,e):this.clipMask.delete(t)}applyClipMask(t){const{clipMask:e}=this;e.size!==0&&this.clipMask.forEach(i=>{const{x:o,y:s,radius:n}=i;t.save(),t.beginPath(),t.rect(0,0,t.canvas.width,t.canvas.height),t.ellipse(o,s,n,n,0,Math.PI*2,0,!0),t.clip()})}closeClipMask(t){this.clipMask.size!==0&&t.restore()}};import{_ModuleSupport as TT}from"ag-charts-community";var ds=class extends TT.TransformableText{constructor(){super(...arguments),this.growCollisionBox={top:4,right:4,bottom:4,left:4}}isPointInPath(t,e){const i=this.fromParentPoint(t,e),o=this.computeBBoxWithoutTransforms();return o?o.grow(this.growCollisionBox).containsPoint(i.x,i.y):!1}};import{_ModuleSupport as CT}from"ag-charts-community";var{Vec2:pe}=CT;function rn(t,e,i,o,s,n,a){if(!n||!s||!o){e.setClipMask(t);return}const{alignment:r,position:l}=o,c=of(i,o.fontSize,a),{point:h,textBaseline:p}=sf(c,l,r);nf(s,n,o,h,c.angle,p);const{x:u,y:g,width:y,height:f}=s.getBBox(),m=pe.length(pe.from(y,f)),x={x:u+y/2,y:g+f/2,radius:m/2+pe.length(c.offset)};return l==="center"?e.setClipMask(t,x):e.setClipMask(t),{clipMask:x,numbers:c}}function ef(t,e,i,o,s,n,a){if(!a||!n)return;const{alignment:r,position:l}=o,[c,h]=e.y1<=i.y1?[e,i]:[i,e];let p=c;l==="bottom"?p=h:l==="inside"&&(p={x1:(c.x1+h.x1)/2,y1:(c.y1+h.y1)/2,x2:(c.x2+h.x2)/2,y2:(c.y2+h.y2)/2});const u=of(p,o.fontSize,s),{point:g,textBaseline:y}=sf(u,l==="inside"?"center":l,r,t);nf(n,a,o,g,u.angle,y)}function of(t,e,i){let[o,s]=pe.from(t);o.x>s.x&&([o,s]=[s,o]);const n=pe.normalized(pe.sub(s,o)),a=pe.angle(n),r=pe.multiply(n,Mt.HANDLE_SIZE/2+(e??14)/2),l=pe.multiply(n,(i??2)/2+(e??14)/3);return{left:o,right:s,normal:n,angle:a,inset:r,offset:l}}function sf({left:t,right:e,normal:i,angle:o,inset:s,offset:n},a,r,l){let c;r==="right"?c=pe.sub(e,s):r==="center"?c=pe.add(t,pe.multiply(i,pe.distance(t,e)/2)):c=pe.add(t,s);let h="bottom";return a==="bottom"?(c=pe.rotate(n,o+Math.PI/2,c),h="top"):a==="center"&&!l?h="middle":c=pe.rotate(n,o-Math.PI/2,c),{point:c,textBaseline:h}}function nf(t,e,i,o,s,n){t.setProperties({text:e,x:o.x,y:o.y,rotation:s,rotationCenterX:o.x,rotationCenterY:o.y,fill:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,fontWeight:i.fontWeight,textAlign:i.alignment,textBaseline:n})}var{ChartAxisDirection:NT,Vec2:ln,Vec4:Qh}=AT,Ro=class extends Zt{constructor(){super(),this.type="cross-line",this.line=new Ce,this.middle=new an,this.isHorizontal=!1,this.append([this.line,this.middle])}static is(t){return Zt.isCheck(t,"cross-line")}update(t,e){const{seriesRect:i}=e;this.seriesRect=i,this.isHorizontal=de.is(t);const o=this.isHorizontal?e.yAxis:e.xAxis,s=this.convertCrossLine(t,o);if(s==null){this.visible=!1;return}this.visible=t.visible??!0,this.visible&&(this.updateLine(t,s),this.updateHandle(t,s),this.updateText(t,s),this.updateAxisLabel(t,o,s))}updateLine(t,e){const{line:i}=this,{lineDashOffset:o,stroke:s,strokeWidth:n,strokeOpacity:a}=t,{x1:r,y1:l,x2:c,y2:h}=e;i.setProperties({x1:r,y1:l,x2:c,y2:h,lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:o,stroke:s,strokeWidth:n,strokeOpacity:a,fillOpacity:0})}updateHandle(t,e){const{middle:i}=this,{locked:o,stroke:s,strokeWidth:n,strokeOpacity:a}=t,r={fill:t.handle.fill,stroke:t.handle.stroke??s,strokeOpacity:t.handle.strokeOpacity??a,strokeWidth:t.handle.strokeWidth??n},l=ln.sub(Qh.center(e),ln.from(i.handle.width/2,i.handle.height/2));i.gradient=this.isHorizontal?"horizontal":"vertical",i.update({...r,...l}),i.toggleLocked(o??!1)}updateText(t,e){this.text=this.updateNode(ds,this.text,!!t.text.label),rn(this.line.id,this.line,e,t.text,this.text,t.text.label,t.strokeWidth)}createAxisLabel(t){const e=new tf;return t.attachLabel(e),e}updateAxisLabel(t,e,i){this.axisLabel||(this.axisLabel=this.createAxisLabel(e));const{axisLabel:o,seriesRect:s}=this,{direction:n,position:a}=e;if(t.axisLabel.enabled){o.visible=this.visible;const r=a==="left"||a==="top"?Qh.start(i):Qh.end(i),l=n===NT.X?r.x:r.y;if(!e.inRange(l)){o.visible=!1;return}const{value:c}=ft(t.value);o.update({...ln.add(r,ln.required(s)),value:c,styles:t.axisLabel,context:e})}else o.visible=!1}setAxisLabelOpacity(t){this.axisLabel&&(this.axisLabel.opacity=t)}setAxisLabelVisible(t){this.axisLabel&&(this.axisLabel.visible=t)}toggleHandles(t){this.middle.visible=t,this.middle.toggleHovered(this.activeHandle==="middle")}destroy(){super.destroy(),this.axisLabel?.destroy()}toggleActive(t){this.toggleHandles(t),this.middle.toggleActive(t)}dragStart(t,e,i){const o=de.is(t)?{x:e.x,y:Io(t.value,i.yAxis)}:{x:Io(t.value,i.xAxis),y:e.y};this.dragState={offset:e,middle:o}}drag(t,e,i){const{activeHandle:o,dragState:s}=this;if(t.locked)return;let n;if(o)this[o].toggleDragging(!0),n=this[o].drag(e).point;else if(s)n=ln.add(s.middle,ln.sub(e,s.offset));else return;const a=mt(n,i),r=de.is(t);t.set({value:r?a.y:a.x})}translate(t,{x:e,y:i},o){if(t.locked)return;const{axisContext:s,translation:n}=de.is(t)?{axisContext:o.yAxis,translation:i}:{axisContext:o.xAxis,translation:e},a=Io(t.value,s)+n,r=aa(a,s);isNaN(r)||t.set({value:r})}stopDragging(){this.middle.toggleDragging(!1)}copy(t,e,i){const o=de.is(t),s=this.isHorizontal?i.yAxis:i.xAxis,n=this.convertCrossLine(t,s);if(!n)return;const a=o?-30:0,r=o?0:-30,l=mt({x:n.x1+r,y:n.y1+a},i);return e.set({value:o?l.y:l.x}),e}getCursor(){return this.activeHandle==null?"pointer":this[this.activeHandle].getCursor()}containsPoint(t,e){const{middle:i,line:o,text:s}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="middle",!0):o.isPointInPath(t,e)||!!s?.containsPoint(t,e)}getNodeAtCoords(t,e){if(this.text?.containsPoint(t,e))return"text";if(this.line.isPointInPath(t,e))return"line";if(this.middle.containsPoint(t,e))return"handle"}getAnchor(){const t=this.computeBBoxWithoutHandles();return this.isHorizontal?{x:t.x+t.width/2,y:t.y}:{x:t.x+t.width,y:t.y+t.height/2,position:"right"}}convertCrossLine(t,e){if(t.value==null)return;let i=0,o=0,s,n;const{bounds:a}=e,r=Io(t.value,e);return de.is(t)?(s=a.width,o=r,n=r):(i=r,s=r,n=a.height),{x1:i,y1:o,x2:s,y2:n}}};import{_ModuleSupport as OT}from"ag-charts-community";var{StateMachine:Fr,StateMachineProperty:LT,Debug:RT}=OT,qh=class extends Fr{constructor(t,e){const i=({point:s})=>{const n=t==="horizontal",a=n?new de:new Ti;a.set({value:n?s.y:s.x}),e.create(a),e.recordAction(`Create ${n?"horizontal-line":"vertical-line"} annotation`)},o=()=>{this.node?.toggleActive(!0),e.showAnnotationOptions(),e.update()};super("start",{start:{click:{target:"waiting-first-render",action:i},drag:{target:"waiting-first-render",action:i},reset:Fr.parent,cancel:Fr.parent},"waiting-first-render":{render:{target:Fr.parent,action:o}}}),this.debug=RT.create(!0,"annotations")}};d([LT()],qh.prototype,"node",2);var af={type:"horizontal-line",datum:de,scene:Ro,isDatum:de.is,translate:(t,e,i,o)=>{de.is(e)&&Ro.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(de.is(e)&&de.is(i)&&Ro.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{de.is(e)&&Ro.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new qh("horizontal",{...t,create:e("horizontal-line")}),dragState:t=>new wt(t)},rf={type:"vertical-line",datum:Ti,scene:Ro,isDatum:Ti.is,translate:(t,e,i,o)=>{Ti.is(e)&&Ro.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(Ti.is(e)&&Ti.is(i)&&Ro.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{Ti.is(e)&&Ro.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new qh("vertical",{...t,create:e("vertical-line")}),dragState:t=>new wt(t)};import{_ModuleSupport as ET}from"ag-charts-community";import{_ModuleSupport as lf}from"ag-charts-community";import{_ModuleSupport as wT}from"ag-charts-community";var{Vec4:PT}=wT,cf=class{static updateBackground(t,e,i,o){const{background:s}=this,{seriesRect:n}=o;s.path.clear(!0);const a=PT.from(0,0,n.width,n.height),r=this.getBackgroundPoints(t,e,i,a);for(let c=0;cmt(u,i),l=t.toJson(),c=t.snapToAngle,{value:h}=ft(t.end.y),{value:p}=ft(t.start.y);switch(s){case"topLeft":case"bottomLeft":{const u=s==="topLeft"?1:-1,g=o?this.snapToAngle(e,i,"topLeft","topRight",c,u):r({x:n.topLeft.handle.x+a.x,y:n.topLeft.handle.y+a.y*u}),y=o?this.snapToAngle(e,i,"bottomLeft","bottomRight",c,-u):r({x:n.bottomLeft.handle.x+a.x,y:n.bottomLeft.handle.y+a.y*-u});if(g?.y==null||y?.y==null||p==null||!Et(p))return;const f=t.startHeight+(g.y-p)*2;t.start.x=g.x,t.start.y=g.y,t.startHeight=f;break}case"topRight":{const u=o?this.snapToAngle(e,i,"topRight","topLeft",c):r({x:n.topRight.handle.x+a.x,y:n.topRight.handle.y+a.y});if(u?.y==null||h==null||!Et(h))return;const g=t.endHeight+(u.y-h)*2;t.end.x=u.x,t.end.y=u.y,t.endHeight=g;break}case"bottomRight":{const u=r({x:n.bottomLeft.handle.x+a.x,y:n.bottomLeft.handle.y+a.y}),g=r({x:n.bottomRight.handle.x+a.x,y:n.bottomRight.handle.y+a.y});if(!u||!g||t.start.y==null||h==null||!Et(h))return;const y=h-g.y,f=t.startHeight-(t.endHeight-y);t.startHeight=f,t.endHeight=y}}t.isValidWithContext(i)||t.set(l)}updateLines(t,e,i){const{topLine:o,bottomLine:s}=this,{lineDashOffset:n,stroke:a,strokeOpacity:r,strokeWidth:l}=t,c={lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:n,stroke:a,strokeOpacity:r,strokeWidth:l};o.setProperties({...e,...c}),s.setProperties({...i,...c})}updateHandles(t,e,i){const{handles:{topLeft:o,topRight:s,bottomLeft:n,bottomRight:a}}=this,r={fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth};o.update({...r,...Gr.start(e)}),s.update({...r,...Gr.end(e)}),n.update({...r,...Gr.start(i)}),a.update({...r,...Eo.sub(Gr.end(i),Eo.from(a.handle.width/2,a.handle.height/2))})}updateText(t,e,i){this.text=this.updateNode(ds,this.text,!!t.text.label),ef(!1,e,i,t.text,t.strokeWidth,this.text,t.text.label)}getBackgroundPoints(t,e,i,o){const s=e.x1>e.x2,n=e.y1>e.y2,a=n?o.y2:o.y1,r=n?o.y1:o.y2,l=Eo.from(e);return t.extendEnd&&e.y2===r&&l.push(Eo.from(s?o.x1:o.x2,n?o.y1:o.y2)),t.extendEnd&&i.y2===a&&l.push(Eo.from(s?o.x1:o.x2,n?o.y2:o.y1)),l.push(...Eo.from(i).reverse()),t.extendStart&&i.y1===r&&l.push(Eo.from(s?o.x2:o.x1,n?o.y1:o.y2)),t.extendStart&&e.y1===a&&l.push(Eo.from(s?o.x2:o.x1,n?o.y2:o.y1)),l}};import{_ModuleSupport as _T}from"ag-charts-community";var{StateMachine:wo,StateMachineProperty:Jh,Debug:BT}=_T,Hr=class extends wo{constructor(t){const e=({point:l})=>{const c=new $e;c.set({start:l,end:l,startHeight:0,endHeight:0}),t.create(c)},i=()=>{const{node:l}=this;l?.toggleActive(!0),l?.toggleHandles({topLeft:!0,topRight:!1,bottomLeft:!1,bottomRight:!1})},o=({offset:l,context:c})=>{const{datum:h,snapping:p}=this;h&&(h.set({end:da(l,c,p,h.start,h.snapToAngle)}),t.update())},s=()=>{this.node?.toggleHandles({topRight:!0}),t.update()},n=({point:l})=>{const{datum:c,node:h}=this,{value:p}=ft(c?.end.y),{value:u}=ft(c?.start.y),{y:g}=l;if(c==null||!Et(u)||!Et(p)||!Et(g))return;const y=p-(g??0),f=(u-p)*2+y,m={x:c?.start.x,y:u-f},x={x:c?.end.x,y:l.y};h?.toggleHandles({bottomLeft:!0,bottomRight:!0}),!(!t.validatePoint(m)||!t.validatePoint(x))&&(c.set({startHeight:f,endHeight:y}),t.update())},a=({point:l})=>{const{datum:c,node:h}=this,{value:p}=ft(c?.end.y),{value:u}=ft(c?.start.y),{y:g}=l;if(c==null||!Et(u)||!Et(p)||!Et(g))return;const y=p-(g??0),f=(u-p)*2+y,m={x:c.start.x,y:u-y},x={x:c.end.x,y:l.y};h?.toggleHandles(!0),!(!t.validatePoint(m)||!t.validatePoint(x))&&(c.set({startHeight:f,endHeight:y}),t.recordAction("Create disjoint-channel annotation"),t.showAnnotationOptions(),t.update())},r=()=>t.delete();super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},reset:wo.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:o,drag:o,click:{target:"height",action:s},dragEnd:{target:"height",action:s},reset:{target:wo.parent,action:r},cancel:{target:wo.parent,action:r}},height:{hover:n,click:{target:wo.parent,action:a},drag:{target:wo.parent,action:a},reset:{target:wo.parent,action:r},cancel:{target:wo.parent,action:r}}}),this.debug=BT.create(!0,"annotations"),this.snapping=!1}};d([Jh()],Hr.prototype,"datum",2),d([Jh()],Hr.prototype,"node",2),d([Jh()],Hr.prototype,"snapping",2);var df={type:"disjoint-channel",datum:$e,scene:Wr,isDatum:$e.is,translate:(t,e,i,o)=>{$e.is(e)&&Wr.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if($e.is(e)&&$e.is(i)&&Wr.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{$e.is(e)&&Wr.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new Hr({...t,create:e("disjoint-channel")}),dragState:t=>new wt(t)};import{_ModuleSupport as zT}from"ag-charts-community";import{_ModuleSupport as eo}from"ag-charts-community";var td=[0,23.6,38.2,50,61.8,78.6,100],VT=[161.8,261.8,361.8,423.6],FT=[...td,...VT],GT={10:FT,6:td,4:td.filter(t=>t!==78.6&&t!==23.6)},WT=10;function HT(t,e){const{x2:i,y1:o,y2:s}=t,n=o-s;return e==null?{x1:i,x2:i,y1:s-n,y2:s}:{x1:e.x1,x2:e.x2,y1:e.y2-n,y2:e.y2}}function pf({x1:t,y1:e,x2:i,y2:o},s,n,a,r=10){const l=e-o,c=n?-1:1;let h=a;const p=[];return GT[r].forEach((u,g)=>{const y=a+l*(u/100)*c,f=s.yAxis.scaleInvert(y);p.push({id:g,x1:t,x2:i,y1:h,y2:y,tag:u==100?0:1,label:{x1:Math.min(t,i)-WT,x2:i,y1:y,y2:y,text:`${(u/100).toFixed(3)} (${f.toFixed(2)})`}}),h=y}),p}var{Vec2:KT,Vec4:uf}=eo,gf=class extends Zt{constructor(){super(),this.trendLine=new Ce,this.rangeFillsGroup=new eo.Group({name:`${this.id}-range-fills`}),this.rangeFillsGroupSelection=eo.Selection.select(this.rangeFillsGroup,eo.Range),this.rangeStrokesGroup=new eo.Group({name:`${this.id}-range-strokes`}),this.rangeStrokesGroupSelection=eo.Selection.select(this.rangeStrokesGroup,Ce),this.labelsGroup=new eo.Group({name:`${this.id}-ranges-labels`}),this.labelsGroupSelection=eo.Selection.select(this.labelsGroup,ds),this.anchor={x:0,y:0,position:"above"},this.append([this.trendLine,this.rangeFillsGroup,this.rangeStrokesGroup,this.labelsGroup])}update(t,e){let i=ri(t,e);if(i==null){this.visible=!1;return}if(i=uf.round(i),this.visible=t.visible??!0,!this.visible)return;this.updateLine(t,i,this.trendLine),this.updateHandles(t,i),this.updateAnchor(t,i,e);const{reverse:o}=t,s=this.extendLine(i,t,e),n=o?s.y1:s.y2,a=o?s.y2:s.y1,r=pf(s,e,t.reverse,n,t.bands);this.updateRanges(t,r,e);const l={...s,y1:a,y2:a};this.updateText(t,l)}extendLine({x1:t,y1:e,x2:i,y2:o},s,n){const a={x1:t,y1:e,x2:i,y2:o};if(!s.extendStart&&!s.extendEnd)return a;const{x:r,width:l}=n.xAxis.bounds;return s.extendEnd&&(a[t>i?"x1":"x2"]=r+l),s.extendStart&&(a[t>i?"x2":"x1"]=r),a}updateLine(t,e,i){if(!e||!i)return;const{lineDashOffset:o,strokeWidth:s,strokeOpacity:n,stroke:a}=t;i.setProperties({...e,lineCap:t.getLineCap(),lineDash:[3,4],lineDashOffset:o,strokeWidth:s,strokeOpacity:n,fillOpacity:0,stroke:a})}updateRangeStrokes(t){const{lineDashOffset:e,strokeWidth:i,strokeOpacity:o,strokes:s,rangeStroke:n,isMultiColor:a}=t;this.rangeStrokesGroupSelection.each((r,{x1:l,x2:c,y2:h,tag:p},u)=>{const g=h,y=a?s[u%s.length]:n;r.setProperties({x1:l,x2:c,y1:g,y2:g,stroke:y,strokeOpacity:o,strokeWidth:i,lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:e,tag:p})})}updateRanges(t,e,i){const o=s=>s.id;this.rangeFillsGroupSelection.update(e,void 0,o),this.rangeStrokesGroupSelection.update(e,void 0,o),this.labelsGroupSelection.update(e,void 0,o),this.updateRangeFills(t),this.updateRangeStrokes(t),this.updateRangeLabels(t,i)}updateRangeFills(t){const{lineDashOffset:e,strokeWidth:i,strokeOpacity:o,strokes:s,rangeStroke:n,showFill:a,isMultiColor:r}=t;this.rangeFillsGroupSelection.each((l,{x1:c,x2:h,y1:p,y2:u},g)=>{const y=r?s[g%s.length]:n;if(!a){l.visible=!1;return}l.setProperties({x1:c,x2:h,y1:p,y2:u,startLine:!1,endLine:!1,isRange:!0,stroke:y,strokeOpacity:o,fill:y,fillOpacity:(o??1)*.15,strokeWidth:i,lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:e,visible:!0})})}updateRangeLabels(t,{xAxis:e}){const{rangeStrokesGroupSelection:i}=this,{strokes:o,strokeWidth:s,rangeStroke:n,isMultiColor:a,label:{fontFamily:r,fontSize:l,fontStyle:c,fontWeight:h,color:p}}=t,u={fontFamily:r,fontSize:l,fontStyle:c,fontWeight:h},g=this.checkWithinBounds(e,u,this.labelsGroupSelection.at(0));this.labelsGroupSelection.each((y,f,m)=>{const x=p??(a?o[m%o.length]:n),v=i.at(m);if(!v)return;const{text:S,...b}=f.label;if(g)y.setProperties({...u,text:S,x:b.x1,y:b.y1,textBaseline:"middle",textAlign:"end",fill:x}),rn(y.id,v,b);else{const k={...u,label:S,position:"center",alignment:"left",color:x};rn(y.id,v,b,k,y,S,s)}})}checkWithinBounds(t,e,i){if(!i)return!1;const{text:o,...s}=i.datum.label;i.setProperties({...e,text:o,x:s.x1,y:s.y1,textBaseline:"middle",textAlign:"end"});const{x:n}=i.getBBox();return n>=t.bounds.x&&n<=t.bounds.x+t.bounds.width}updateText(t,e){const i=this.rangeStrokesGroupSelection.selectByTag(0)[0];if(!i)return;const{text:o,strokeWidth:s}=t;this.text=this.updateNode(ds,this.text,!!o.label),rn(i.id,i,e,o,this.text,o.label,s)}updateAnchor(t,e,i,o){const s=uf.topCenter(e);KT.apply(this.anchor,eo.Transformable.toCanvasPoint(this.trendLine,s.x,s.y))}containsPoint(t,e){const{trendLine:i,rangeStrokesGroupSelection:o,text:s}=this;let n=!1;return o.each(a=>n||(n=a.isPointInPath(t,e))),n||i.isPointInPath(t,e)||!!s?.containsPoint(t,e)}getNodeAtCoords(t,e){if(this.text?.containsPoint(t,e))return"text";if(this.trendLine.isPointInPath(t,e))return"line"}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth}}drag(t,e,i,o){t.locked||(this.activeHandle?this.dragHandle(t,e,i,o):this.dragAll(t,e,i))}getAnchor(){return this.anchor}getCursor(){return"pointer"}},{Vec2:UT,Vec4:ps}=zT,Kr=class extends gf{constructor(){super(),this.type="fibonacci-retracement-trend-based",this.endRetracementLine=new Ce,this.start=new Mt,this.end=new Mt,this.endRetracement=new Mt,this.append([this.endRetracementLine,this.start,this.end,this.endRetracement])}static is(t){return Zt.isCheck(t,"fibonacci-retracement-trend-based")}update(t,e){let{coords1:i,coords2:o}=this.getCoords(t,e);if(i==null||o==null){this.visible=!1;return}if(i=ps.round(i),o=ps.round(o),this.visible=t.visible??!0,!this.visible)return;(t.endRetracement.x==null||t.endRetracement.y==null)&&(o=void 0),this.updateLine(t,i,this.trendLine),this.updateLine(t,o,this.endRetracementLine),this.updateHandles(t,i,o),this.updateAnchor(t,o??i,e);const{reverse:s,bands:n}=t,a=HT(i,o),r=this.extendLine(a,t,e),l=r.y2,c=r.y1,h=o?pf(r,e,s,l,n):[];this.updateRanges(t,h,e);const p={...r,y1:c,y2:c};this.updateText(t,p)}containsPoint(t,e){const{start:i,end:o,endRetracement:s,endRetracementLine:n}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="start",!0):o.containsPoint(t,e)?(this.activeHandle="end",!0):s.containsPoint(t,e)?(this.activeHandle="endRetracement",!0):n.isPointInPath(t,e)||super.containsPoint(t,e)}getNodeAtCoords(t,e){return this.start.containsPoint(t,e)||this.end.containsPoint(t,e)||this.endRetracement.containsPoint(t,e)?"handle":this.endRetracementLine.isPointInPath(t,e)?"line":super.getNodeAtCoords(t,e)}dragStart(t,e,i){this.dragState={offset:e,...Rr({start:t.start,end:t.end,endRetracement:t.endRetracement},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1),this.endRetracement.toggleDragging(!1)}dragAll(t,e,i){const{dragState:o}=this;o&&this.translatePoints({datum:t,start:o.start,end:o.end,endRetracement:o.endRetracement,translation:UT.sub(e,o.offset),context:i})}dragHandle(t,e,i,o){const{activeHandle:s,dragState:n}=this;if(!s||!n)return;this[s].toggleDragging(!0);const a=o?this.snapToAngle(t,e,i):mt(this[s].drag(e).point,i);!a||!ci(i,a)||(t[s].x=a.x,t[s].y=a.y)}snapToAngle(t,e,i){const{activeHandle:o}=this,s=["start","end","endRetracement"];if(!o)return;const n=(s.indexOf(o)+1)%s.length,a=s[n];this[o].toggleDragging(!0);const r=vt(t[a],i);return mt(pa(e,r,t.snapToAngle),i)}translatePoints({datum:t,start:e,end:i,endRetracement:o,translation:s,context:n}){const{vectors:a,translateX:r,translateY:l}=Wh({start:e,end:i,endRetracement:o},s,n);r&&(t.start.x=a.start?.x,t.end.x=a.end?.x,t.endRetracement.x=a.endRetracement?.x),(this.ignoreYBounds||l)&&(t.start.y=a.start?.y,t.end.y=a.end?.y,t.endRetracement.y=a.endRetracement?.y)}translate(t,e,i){this.translatePoints({datum:t,start:vt(t.start,i),end:vt(t.end,i),endRetracement:vt(t.endRetracement,i),translation:e,context:i})}copy(t,e,i){const{coords1:o,coords2:s}=this.getCoords(t,i);if(!o||!s)return;const n=this.computeBBoxWithoutHandles();return this.translatePoints({datum:e,start:ps.start(o),end:ps.end(o),endRetracement:ps.end(s),translation:{x:-n.width/2,y:-n.height/2},context:i}),e}getCoords(t,e){return{coords1:ri(t,e),coords2:ri({start:t.end,end:t.endRetracement},e)}}toggleHandles(t){if(typeof t=="boolean")this.start.visible=t,this.end.visible=t,this.endRetracement.visible=t;else for(const[e,i]of Object.entries(t))this[e].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end"),this.endRetracement.toggleHovered(this.activeHandle==="endRetracement")}toggleActive(t){this.toggleHandles(t),this.start.toggleActive(t),this.end.toggleActive(t),this.endRetracement.toggleActive(t)}updateHandles(t,e,i,o){this.start.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"start")}),this.end.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"end",o)}),i&&this.endRetracement.update({...this.getHandleStyles(t),...this.getHandleCoords(t,i,"endRetracement",o)}),this.start.toggleLocked(t.locked??!1),this.end.toggleLocked(t.locked??!1),this.endRetracement.toggleLocked(t.locked??!1)}getHandleCoords(t,e,i,o){return i==="start"?ps.start(e):ps.end(e)}};import{_ModuleSupport as YT}from"ag-charts-community";var{StateMachine:Po,StateMachineProperty:ed,Debug:jT}=YT,Ur=class extends Po{constructor(t){const e=({point:c})=>{const h=this.createDatum();h.set({start:c,end:c}),t.create(h)},i=()=>{const{node:c}=this;c?.toggleActive(!0),c?.toggleHandles({start:!0,end:!1,endRetracement:!1})},o=({offset:c,context:h})=>{const{datum:p,snapping:u}=this;p&&(p.set({end:da(c,h,u,p.start,p.snapToAngle)}),t.update())},s=()=>{const{datum:c}=this;c&&(c.endRetracement.x=c.end.x,c.endRetracement.y=c.end.y,this.node?.toggleHandles({end:!0}),t.update())},n=({offset:c,context:h})=>{const{datum:p,snapping:u}=this;p&&(p.set({endRetracement:da(c,h,u,p.end,p.snapToAngle)}),t.update())},a=()=>{this.node?.toggleHandles({endRetracement:!0}),t.update()},r=()=>t.delete(),l=()=>{t.showAnnotationOptions(),t.recordAction(`Create ${this.datum?.type} annotation`)};super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},reset:Po.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:o,click:{target:"endRetracement",action:s},drag:o,dragEnd:{target:"endRetracement",action:s},reset:{target:Po.parent,action:r},cancel:{target:Po.parent,action:r},onExit:l},endRetracement:{hover:n,click:{target:Po.parent,action:a},drag:{target:Po.parent,action:a},reset:{target:Po.parent,action:r},cancel:{target:Po.parent,action:r}}}),this.debug=jT.create(!0,"annotations"),this.snapping=!1}createDatum(){return new Ci}};d([ed()],Ur.prototype,"datum",2),d([ed()],Ur.prototype,"node",2),d([ed()],Ur.prototype,"snapping",2);var yf={type:"fibonacci-retracement-trend-based",datum:Ci,scene:Kr,isDatum:Ci.is,translate:(t,e,i,o)=>{Ci.is(e)&&Kr.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(Ci.is(e)&&Ci.is(i)&&Kr.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{Ci.is(e)&&Kr.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new Ur({...t,create:e("fibonacci-retracement-trend-based")}),dragState:t=>new wt(t)};import{_ModuleSupport as XT}from"ag-charts-community";var{Vec2:$T,Vec4:ff}=XT,Yr=class extends gf{constructor(){super(),this.type="fibonacci-retracement",this.start=new Mt,this.end=new Mt,this.append([this.start,this.end])}static is(t){return Zt.isCheck(t,"fibonacci-retracement")}containsPoint(t,e){const{start:i,end:o}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="start",!0):o.containsPoint(t,e)?(this.activeHandle="end",!0):super.containsPoint(t,e)}getNodeAtCoords(t,e){return this.start.containsPoint(t,e)||this.end.containsPoint(t,e)?"handle":super.getNodeAtCoords(t,e)}dragStart(t,e,i){this.dragState={offset:e,...Rr({start:t.start,end:t.end},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}dragAll(t,e,i){const{dragState:o}=this;o&&this.translatePoints({datum:t,start:o.start,end:o.end,translation:$T.sub(e,o.offset),context:i})}dragHandle(t,e,i,o){const{activeHandle:s,dragState:n}=this;if(!s||!n)return;this[s].toggleDragging(!0);const a=o?this.snapToAngle(t,e,i):mt(this[s].drag(e).point,i);!a||!ci(i,a)||(t[s].x=a.x,t[s].y=a.y)}snapToAngle(t,e,i){const{activeHandle:o}=this,n=["start","end"].find(r=>r!==o);if(!o||!n)return;this[o].toggleDragging(!0);const a=vt(t[n],i);return mt(pa(e,a,t.snapToAngle),i)}translatePoints({datum:t,start:e,end:i,translation:o,context:s}){const{vectors:n,translateX:a,translateY:r}=Wh({start:e,end:i},o,s);a&&(t.start.x=n.start?.x,t.end.x=n.end?.x),(this.ignoreYBounds||r)&&(t.start.y=n.start?.y,t.end.y=n.end?.y)}translate(t,e,i){this.translatePoints({datum:t,start:vt(t.start,i),end:vt(t.end,i),translation:e,context:i})}copy(t,e,i){const o=ri(t,i);if(!o)return;const s=this.computeBBoxWithoutHandles();return this.translatePoints({datum:e,start:{x:o.x1,y:o.y1},end:{x:o.x2,y:o.y2},translation:{x:-s.width/2,y:-s.height/2},context:i}),e}toggleHandles(t){if(typeof t=="boolean")this.start.visible=t,this.end.visible=t;else for(const[e,i]of Object.entries(t))this[e].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end")}toggleActive(t){this.toggleHandles(t),this.start.toggleActive(t),this.end.toggleActive(t)}updateHandles(t,e,i,o){this.start.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"start")}),this.end.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"end",o)}),this.start.toggleLocked(t.locked??!1),this.end.toggleLocked(t.locked??!1)}getHandleCoords(t,e,i,o){return i==="start"?ff.start(e):ff.end(e)}};import{_ModuleSupport as ZT}from"ag-charts-community";var{StateMachine:cn,StateMachineProperty:id,Debug:QT}=ZT,hn=class extends cn{constructor(t){const e=({point:r})=>{const l=this.createDatum();l.set({start:r,end:r}),t.create(l)},i=()=>{const{node:r}=this;r?.toggleActive(!0),r?.toggleHandles({start:!0,end:!1})},o=({offset:r,context:l})=>{const{datum:c,snapping:h}=this;c&&(c.set({end:da(r,l,h,c.start,c.snapToAngle)}),t.update())},s=()=>{this.node?.toggleHandles({end:!0}),t.update()},n=()=>t.delete(),a=()=>{t.showAnnotationOptions(),t.recordAction(`Create ${this.datum?.type} annotation`)};super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},reset:cn.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:o,click:{target:cn.parent,action:s},drag:o,dragEnd:{target:cn.parent,action:s},reset:{target:cn.parent,action:n},cancel:{target:cn.parent,action:n},onExit:a}}),this.debug=QT.create(!0,"annotations"),this.snapping=!1}};d([id()],hn.prototype,"datum",2),d([id()],hn.prototype,"node",2),d([id()],hn.prototype,"snapping",2);var qT=class extends hn{createDatum(){return new Xi}},JT=class extends hn{createDatum(){return new $i}},t2=class extends hn{createDatum(){return new Qi}},mf={type:"fibonacci-retracement",datum:Qi,scene:Yr,isDatum:Qi.is,translate:(t,e,i,o)=>{Qi.is(e)&&Yr.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(Qi.is(e)&&Qi.is(i)&&Yr.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{Qi.is(e)&&Yr.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new t2({...t,create:e("fibonacci-retracement")}),dragState:t=>new wt(t)};import{_ModuleSupport as xf}from"ag-charts-community";import{_ModuleSupport as od}from"ag-charts-community";var{Vec2:ga}=od,e2=class extends od.Group{},jr=class extends e2{constructor(){super(),this.type="arrow",this.path=new od.Path,this.armLength=6,this.append([this.path])}update(t){const{path:e}=this,{x:i,y:o,angle:s,...n}=t,a=ga.from(i,o),r=3*Math.PI/4,l=this.armLength+(t.strokeWidth??0)*2,c=ga.rotate(ga.from(0,l),s+r,a),h=ga.rotate(ga.from(l,0),s-r,a);e.setProperties(n),e.fillOpacity=0,e.path.clear(),e.path.moveTo(c.x,c.y),e.path.lineTo(a.x,a.y),e.path.lineTo(h.x,h.y)}},{Vec2:di,Vec4:Sf}=xf,_o=class extends Uh{constructor(){super(),this.type="line",this.line=new Ce,this.append([this.line,this.start,this.end])}static is(t){return Zt.isCheck(t,"line")}update(t,e){let i=ri(t,e);if(i==null){this.visible=!1;return}i=Sf.round(i),this.visible=t.visible??!0,this.visible&&(this.updateLine(t,i,e),this.updateHandles(t,i),this.updateText(t,i),this.updateCaps(t,i),this.updateAnchor(t,i,e))}updateLine(t,e,i){const{line:o}=this,{lineDashOffset:s,stroke:n,strokeWidth:a,strokeOpacity:r}=t,l=this.extendLine(e,t,i);o.setProperties({...l,lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:s,stroke:n,strokeWidth:a,strokeOpacity:r,fillOpacity:0})}updateText(t,e){this.text=this.updateNode(ds,this.text,!!t.text.label),rn(this.line.id,this.line,e,t.text,this.text,t.text.label,t.strokeWidth)}updateCaps(t,e){if(!t.startCap&&this.startCap&&(this.removeChild(this.startCap),this.startCap=void 0),!t.endCap&&this.endCap&&(this.removeChild(this.endCap),this.endCap=void 0),!t.startCap&&!t.endCap)return;const{stroke:i,strokeWidth:o,strokeOpacity:s}=t,[n,a]=di.from(e),r=di.angle(di.sub(a,n));t.startCap&&(this.startCap&&this.startCap.type!==t.startCap&&(this.removeChild(this.startCap),this.startCap=void 0),this.startCap==null&&(this.startCap=new jr,this.append([this.startCap])),this.startCap.update({x:n.x,y:n.y,angle:r-Math.PI,stroke:i,strokeWidth:o,strokeOpacity:s})),t.endCap&&(this.endCap&&this.endCap.type!==t.endCap&&(this.removeChild(this.endCap),this.endCap=void 0),this.endCap==null&&(this.endCap=new jr,this.append([this.endCap])),this.endCap.update({x:a.x,y:a.y,angle:r,stroke:i,strokeWidth:o,strokeOpacity:s}))}updateAnchor(t,e,i,o){const s=Sf.topCenter(e);di.apply(this.anchor,xf.Transformable.toCanvasPoint(this.line,s.x,s.y))}containsPoint(t,e){const{line:i,text:o}=this;return super.containsPoint(t,e)||i.isPointInPath(t,e)||!!o?.containsPoint(t,e)}getNodeAtCoords(t,e){return this.text?.containsPoint(t,e)?"text":this.line.isPointInPath(t,e)?"line":super.getNodeAtCoords(t,e)}getHandleCoords(t,e,i,o){const{startCap:s,endCap:n}=this;let[a,r]=di.from(e);const l=di.angle(di.sub(r,a));return s&&(a=di.rotate(di.from(0,-Mt.HANDLE_SIZE/2),l,a)),n&&(r=di.rotate(di.from(0,Mt.HANDLE_SIZE/2),l,r)),i==="start"?a:r}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth}}},bf={type:"line",datum:$i,scene:_o,isDatum:$i.is,translate:(t,e,i,o)=>{$i.is(e)&&_o.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if($i.is(e)&&$i.is(i)&&_o.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{$i.is(e)&&_o.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new JT({...t,create:e("line")}),dragState:t=>new wt(t)},vf={type:"arrow",datum:Xi,scene:_o,isDatum:Xi.is,translate:(t,e,i,o)=>{Xi.is(e)&&_o.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(Xi.is(e)&&Xi.is(i)&&_o.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{Xi.is(e)&&_o.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new qT({...t,create:e("arrow")}),dragState:t=>new wt(t)};import{_ModuleSupport as sd}from"ag-charts-community";import{_ModuleSupport as _e}from"ag-charts-community";import{_ModuleSupport as Mf}from"ag-charts-community";function kf(t,e=0,i=0){let o=e;for(const s of t)if(Array.isArray(s)){for(const n of s)Af(n,o);o+=Mf.Group.computeChildrenBBox(s).width+i}else Af(s,o),o+=s.getBBox().width+i}function i2(t,e=0,i=0){let o=e;for(const s of t)if(Array.isArray(s)){for(const n of s)If(n,o);o+=Mf.Group.computeChildrenBBox(s).height+i}else If(s,o),o+=s.getBBox().height+i}function Af(t,e){"x1"in t?(t.x2=e+(t.x2-t.x1),t.x1=e):t.x=e}function If(t,e){"y1"in t?(t.y2=e+(t.y2-t.y1),t.y1=e):t.y=e}function Df(t,e){"x1"in t?(t.x1+=e,t.x2+=e):t.x+=e}function Tf(t,e){"y1"in t?(t.y1+=e,t.y2+=e):t.y+=e}var{Vec4:nd}=_e,Cf=class extends _e.Group{constructor(){super(),this.name="MeasurerStatisticsScene",this.background=new _e.Rect,this.dateRangeBarsText=new _e.Text,this.dateRangeDivider=new _e.Line,this.dateRangeValueText=new _e.Text,this.priceRangeValueText=new _e.Text,this.priceRangeDivider=new _e.Line,this.priceRangePercentageText=new _e.Text,this.volumeText=new _e.Text,this.volumeFormatter=new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2}),this.append([this.background,this.dateRangeBarsText,this.dateRangeDivider,this.dateRangeValueText,this.priceRangeValueText,this.priceRangeDivider,this.priceRangePercentageText,this.volumeText])}update(t,e,i,o,s,n,a){this.verticalDirection=n;const r=this.updateStatistics(t,e,i,a),l=_e.Group.computeChildrenBBox(r.flat()),c=10;l.grow(c),this.updateBackground(t,l,c),this.reposition(r,c,s),this.checkVisibility(t,s,o)}checkVisibility(t,e,i){const o=nd.from(new _e.BBox(0,0,e.seriesRect.width,e.seriesRect.height));nd.collides(i,o)?this.visible=t.visible??!0:this.visible=!1}updateStatistics(t,e,i,o){const{dateRangeBarsText:s,dateRangeDivider:n,dateRangeValueText:a,priceRangeValueText:r,priceRangeDivider:l,priceRangePercentageText:c,volumeText:h}=this,p=8,u=6,g=t.statistics.fontSize+3,y=-2,f=this.getTextStyles(t),m={...this.getDividerStyles(t),x1:0,y1:0,x2:0,y2:g},x=[s,n,a],v=[r,l,c],S=[];return e.priceRange&&(r.setProperties({...f,text:this.formatPriceRangeValue(e.priceRange.value,o)}),l.setProperties(m),c.setProperties({...f,text:this.formatPriceRangePercentage(e.priceRange.percentage,o)}),kf(v,i.x,p),S.push(v)),e.dateRange&&(s.setProperties({...f,text:this.formatDateRangeBars(e.dateRange.bars,o)}),n.setProperties(m),a.setProperties({...f,text:this.formatDateRangeValue(e.dateRange.value)}),kf(x,i.x,p),S.push(x)),e.volume!=null?(h.setProperties({...f,x:i.x,text:this.formatVolume(e.volume,o),visible:!0}),S.push(h)):h.visible=!1,i2(S,i.y,u),l.y1+=y,l.y2+=y,n.y1+=y,n.y2+=y,S}updateBackground(t,e,i){const o=this.getBackgroundStyles(t);this.background.setProperties({...o,...e,x:e.x-e.width/2+i,y:e.y})}reposition(t,e,i){const{width:o,height:s}=i.seriesRect,n=nd.from(this.background.getBBox());let a=0;n.x1<0&&(a=-n.x1),n.x2>o&&(a=o-n.x2);const r=Math.min(e,s-n.y2);for(const l of t)if(Array.isArray(l)){const c=_e.Group.computeChildrenBBox(l).width;for(const h of l)Df(h,a-c/2),Tf(h,r)}else Df(l,a-l.getBBox().width/2),Tf(l,r);this.background.x+=a,this.background.y+=r}getTextStyles(t){return{fill:t.statistics.color,fontFamily:t.statistics.fontFamily,fontSize:t.statistics.fontSize,fontStyle:t.statistics.fontStyle,fontWeight:t.statistics.fontWeight,textBaseline:"top"}}getDividerStyles(t){return{stroke:t.statistics.divider.stroke,strokeOpacity:t.statistics.divider.strokeOpacity,strokeWidth:t.statistics.divider.strokeWidth}}getBackgroundStyles(t){return{fill:t.statistics.fill,stroke:t.statistics.stroke,strokeOpacity:t.statistics.strokeOpacity,strokeWidth:t.statistics.strokeWidth,cornerRadius:4}}formatDateRangeBars(t,e){return e?.t("measurerDateRangeBars",{value:t})??`${t}`}formatDateRangeValue(t){const e=[],i=t>=0?"":"-";t=Math.abs(t);const o=1e3*60,s=o*60,n=s*24,a=Math.floor(t/o),r=Math.floor(t/s),l=Math.floor(t/n),c=r%(n/s),h=a%(s/o);return l>=1&&e.push(`${l}d`),r>=1&&(t=o.x-h.x&&(l={x:o.x,y:r.clipMask.y,radius:this.text.getBBox().height/2+Li.length(h)})}this.verticalLine.setClipMask(a,l)}updateCaps(t,e){const{horizontalEndCap:i,verticalEndCap:o}=this,{direction:s}=t,{x1:n,y1:a,x2:r,y2:l}=e,c=Li.round(us.center(e)),{stroke:h,strokeWidth:p,strokeOpacity:u}=this.getLineStyles(t),g={stroke:h,strokeWidth:p,strokeOpacity:u};if(s!=="vertical"){const y=n<=r?0:Math.PI;let f=r;s==="horizontal"&&(f+=n<=r?-2:2),i.update({...g,x:f,y:c.y,angle:y})}if(s!=="horizontal"){const y=a<=l?Math.PI/2:Math.PI/-2;let f=l;s==="vertical"&&(f+=a<=l?-2:2),o.update({...g,x:c.x,y:f,angle:y})}}updateBoundingLines(t,e){const{verticalStartLine:i,verticalEndLine:o,horizontalStartLine:s,horizontalEndLine:n}=this,{direction:a}=t,{x1:r,y1:l,x2:c,y2:h}=e,p=this.getLineStyles(t);a==="horizontal"&&(i.setProperties({...p,x1:r,y1:l,x2:r,y2:h}),o.setProperties({...p,x1:c,y1:l,x2:c,y2:h})),a==="vertical"&&(s.setProperties({...p,x1:r,y1:l,x2:c,y2:l}),n.setProperties({...p,x1:r,y1:h,x2:c,y2:h}))}updateStatistics(t,e,i){const o=Li.add(us.bottomCenter(e),Li.from(0,10)),s={volume:this.getVolume(t)};t.hasPriceRange&&(s.priceRange={percentage:this.getPriceRangePercentage(t),value:this.getPriceRangeValue(t)}),t.hasDateRange&&(s.dateRange={bars:this.getDateRangeBars(e,i),value:this.getDateRangeValue(t)}),this.statistics.update(t,s,o,e,i,this.verticalDirection,t.localeManager)}updateAnchor(t,e,i,o){const s=us.topCenter(e);Li.apply(this.anchor,sd.Transformable.toCanvasPoint(this.horizontalLine,s.x,s.y))}getBackgroundPoints(t,e,i,o){const[s,n]=Li.from(e),[a,r]=Li.from(i);return[s,n,r,a]}getLineStyles(t){const{lineDashOffset:e,stroke:i,strokeWidth:o,strokeOpacity:s}=t;return{lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:e,stroke:i,strokeWidth:o,strokeOpacity:s,fillOpacity:0}}getBackgroundStyles(t){const{background:e}=t;return{fill:e.fill,fillOpacity:e.fillOpacity}}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth}}containsPoint(t,e){const{horizontalLine:i,text:o,verticalLine:s,horizontalStartLine:n,horizontalEndLine:a,verticalStartLine:r,verticalEndLine:l}=this;return super.containsPoint(t,e)||i.isPointInPath(t,e)||s.isPointInPath(t,e)||n.visible&&n.isPointInPath(t,e)||a.visible&&a.isPointInPath(t,e)||r.visible&&r.isPointInPath(t,e)||l.visible&&l.isPointInPath(t,e)||!!o?.containsPoint(t,e)}getNodeAtCoords(t,e){return this.text?.containsPoint(t,e)?"text":this.start.containsPoint(t,e)||this.end.containsPoint(t,e)?"handle":"line"}getDateRangeBars(t,e){const{step:i}=e.xAxis.scale,o=t.x1<=t.x2?1:-1;return i?Math.round(us.width(t)/i)*o:0}getDateRangeValue(t){const{value:e}=ft(t.start.x),{value:i}=ft(t.end.x);if(!Qn(e)||!Qn(i))throw new Error("Can not create a date range measurement of non-date x-axis.");return i.getTime()-e.getTime()}getPriceRangePercentage(t){if(t.start.y==null||t.end.y==null)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const{value:e}=ft(t.end.y),{value:i}=ft(t.start.y);if(!Et(e)||!Et(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return(e-i)/i}getPriceRangeValue(t){if(t.start.y==null||t.end.y==null)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const{value:e}=ft(t.end.y),{value:i}=ft(t.start.y);if(!Et(e)||!Et(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return e-i}getVolume(t){return t.getVolume(t.start.x,t.end.x)}},Xr=class extends Be{constructor(){super(...arguments),this.type="quick-measurer"}static is(t){return Zt.isCheck(t,"quick-measurer")}createStatisticsScene(){return new o2}getDirectionStyles(t){return this.verticalDirection==="down"?t.down:t.up}getLineStyles(t){const e=this.getDirectionStyles(t);return{...super.getLineStyles(t),stroke:e.stroke,strokeWidth:e.strokeWidth,strokeOpacity:e.strokeOpacity}}getBackgroundStyles(t){const e=this.getDirectionStyles(t);return{fill:e.fill,fillOpacity:e.fillOpacity}}getHandleStyles(t){const e=this.getDirectionStyles(t);return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}};import{_ModuleSupport as s2}from"ag-charts-community";var{StateMachine:dn,StateMachineProperty:Nf,Debug:n2}=s2,pn=class extends dn{constructor(t){const e=({point:a})=>{const r=this.createDatum();r.set({start:a,end:a}),t.create(r)},i=({point:a})=>{const{datum:r,node:l}=this;r?.set({end:a}),l?.toggleActive(!0),l?.toggleHandles({end:!1}),t.update()},o=()=>{this.node?.toggleHandles({end:!0})},s=()=>t.delete(),n=()=>{t.showAnnotationOptions(),!Do(this.datum)&&t.recordAction(`Create ${this.node?.type} annotation`)};super("start",{start:{reset:dn.parent,click:{target:"end",action:e},drag:{target:"end",action:e}},end:{hover:i,drag:i,click:{target:dn.parent,action:o},dragEnd:{target:dn.parent,action:o},reset:{target:dn.parent,action:s},cancel:{target:dn.parent,action:s},onExit:n}}),this.debug=n2.create(!0,"annotations")}};d([Nf()],pn.prototype,"datum",2),d([Nf()],pn.prototype,"node",2);var a2=class extends pn{createDatum(){return new je}},r2=class extends pn{createDatum(){return new Xe}},l2=class extends pn{createDatum(){return new ji}},c2=class extends pn{createDatum(){return new Pe}},Of={type:"date-range",datum:je,scene:Be,isDatum:je.is,translate:(t,e,i,o)=>{je.is(e)&&Be.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(je.is(e)&&je.is(i)&&Be.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{je.is(e)&&Be.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new a2({...t,create:e("date-range")}),dragState:t=>new wt(t)},Lf={type:"price-range",datum:Xe,scene:Be,isDatum:Xe.is,translate:(t,e,i,o)=>{Xe.is(e)&&Be.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(Xe.is(e)&&Xe.is(i)&&Be.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{Xe.is(e)&&Be.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new r2({...t,create:e("date-range")}),dragState:t=>new wt(t)},Rf={type:"date-price-range",datum:ji,scene:Be,isDatum:ji.is,translate:(t,e,i,o)=>{ji.is(e)&&Be.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(ji.is(e)&&ji.is(i)&&Be.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{ji.is(e)&&Be.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new l2({...t,create:e("date-range")}),dragState:t=>new wt(t)},Ef={type:"quick-date-price-range",datum:Pe,scene:Xr,isDatum:Pe.is,translate:(t,e,i,o)=>{Pe.is(e)&&Xr.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(Pe.is(e)&&Pe.is(i)&&Xr.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{Pe.is(e)&&Xr.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new c2({...t,create:e("quick-date-price-range")}),dragState:t=>new wt(t)};import{_ModuleSupport as ya}from"ag-charts-community";var{ZIndexMap:wf,TextWrapper:h2,clamp:d2}=ya,$r=class extends $h{constructor(){super(),this.type="note",this.shape=new ya.Rect,this.iconBackground=new ya.SvgPath("M22 1.83333C22 0.820811 21.1792 0 20.1667 0H1.83333C0.820811 0 0 0.82081 0 1.83333V13.9868C0 14.9994 0.820811 15.8202 1.83333 15.8202L5.88971 15.8202C6.44575 15.8202 6.97175 16.0725 7.31971 16.5062L9.57006 19.3112C10.304 20.2259 11.6962 20.2259 12.4301 19.3112L14.6804 16.5062C15.0284 16.0725 15.5544 15.8202 16.1104 15.8202L20.1667 15.8202C21.1792 15.8202 22 14.9994 22 13.9868V1.83333Z"),this.iconLines=new ya.SvgPath("M17.1114 5.75C17.1114 6.16421 16.7756 6.5 16.3614 6.5H5.63916C5.22495 6.5 4.88916 6.16421 4.88916 5.75V5.75C4.88916 5.33579 5.22495 5 5.63916 5H16.3614C16.7756 5 17.1114 5.33579 17.1114 5.75V5.75ZM17.1114 9.25C17.1114 9.66421 16.7756 10 16.3614 10H5.63916C5.22495 10 4.88916 9.66421 4.88916 9.25V9.25C4.88916 8.83579 5.22495 8.5 5.63916 8.5H16.3614C16.7756 8.5 17.1114 8.83579 17.1114 9.25V9.25Z"),this.active=!1,this.shape.visible=!1,this.label.visible=!1,this.iconBackground.fillShadow=new ya.DropShadow,this.append([this.shape,this.label,this.iconBackground,this.iconLines,this.handle])}static is(t){return Zt.isCheck(t,"note")}update(t,e){this.updateIcon(t,e),super.update(t,e)}getTextBBox(t,e,i){const o=super.getTextBBox(t,e,i);o.x-=t.width/2,o.x=d2(0,o.x,i.seriesRect.width-t.width);const s=t.getPadding().top,n=o.y-ly-s*2,a=o.y+Mt.HANDLE_SIZE+s*2;return n-o.height-cy<0?(o.y=a,t.position="top"):(o.y=n+s,t.position="bottom"),o}updateLabel(t,e){const i=t.visible===!1?!1:this.label.visible;super.updateLabel(t,e),this.label.visible=i,this.label.text=h2.wrapText(t.text,{font:{fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight},avoidOrphans:!1,textAlign:t.textAlign,textBaseline:"hanging",textWrap:"always",maxWidth:200})}updateShape(t,e){const{shape:i}=this;i.fill=t.background.fill,i.fillOpacity=t.background.fillOpacity??1,i.stroke=t.background.stroke,i.strokeOpacity=t.background.strokeOpacity??1,i.strokeWidth=t.background.strokeWidth??1,i.cornerRadius=4;const o=t.getPadding().top,s=t.position==="top";i.x=e.x-o,i.width=t.width+o*2,i.height=e.height+o*2,i.y=e.y+(s?0:-e.height)-o}updateIcon(t,e){const{active:i,iconBackground:o,iconLines:s}=this,{x:n,y:a}=vt(t,e);o.x=n-FD/2,o.y=a-ry,s.x=o.x,s.y=o.y,o.fill=t.fill,o.fillOpacity=t.fillOpacity??1,o.stroke=t.stroke,o.strokeOpacity=t.strokeOpacity??1,o.strokeWidth=t.strokeWidth??1,s.fill=t.stroke,i?o.fillShadow.color=t.fill??"rgba(0, 0, 0, 0.22)":o.fillShadow.color="rgba(0, 0, 0, 0.22)"}updateAnchor(t,e,i){const o=t.getPadding().top,s=t.position==="top",n=s?1:-1;return{x:e.x+i.seriesRect.x+t.width/2,y:e.y+i.seriesRect.y+n*(e.height+o),position:s?"below":"above"}}getLabelCoords(t,e){const i=t.position==="top",o=t.getPadding().top;return{x:e.x,y:e.y+(i?o/2:0)}}getHandleCoords(t,e,i){return{x:e.x,y:e.y+Mt.HANDLE_SIZE/2+4}}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.fill,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}}toggleHovered(t){super.toggleHovered(t),this.label.visible=t,this.shape.visible=t,this.zIndex=t?wf.CHART_ANNOTATION_FOCUSED:wf.CHART_ANNOTATION}toggleActive(t){super.toggleActive(t),this.label.visible=t,this.shape.visible=t,this.active=t}containsPoint(t,e){return this.shape.visible&&this.shape.containsPoint(t,e)||this.iconBackground.containsPoint(t,e)?!0:super.containsPoint(t,e)}},p2=class extends ua{createDatum(){return new Te}},Pf={type:"note",datum:Te,scene:$r,isDatum:Te.is,translate:(t,e,i,o)=>{Te.is(e)&&$r.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(Te.is(e)&&Te.is(i)&&$r.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{Te.is(e)&&$r.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new p2({...t,create:e("note")}),dragState:t=>new wt(t)};import{_ModuleSupport as u2}from"ag-charts-community";var{Vec2:Ri,Vec4:un}=u2,Zr=class extends hf{constructor(){super(),this.type="parallel-channel",this.ignoreYBounds=!0,this.handles={topLeft:new Mt,topMiddle:new an,topRight:new Mt,bottomLeft:new Mt,bottomMiddle:new an,bottomRight:new Mt},this.middleLine=new Ce,this.append([this.background,this.topLine,this.middleLine,this.bottomLine,...Object.values(this.handles)])}static is(t){return Zt.isCheck(t,"parallel-channel")}dragHandle(t,e,i,o){const{activeHandle:s,handles:n}=this;if(s==null)return;const{offset:a}=n[s].drag(e);n[s].toggleDragging(!0);const r=t.toJson();let l=[],c=[];switch(s){case"topLeft":case"bottomLeft":l=["topLeft","bottomLeft"],c=["topRight","bottomRight"];break;case"topMiddle":l=["topLeft","topRight"],a.y-=an.HANDLE_SIZE/2;break;case"topRight":case"bottomRight":l=["topRight","bottomRight"],c=["topLeft","bottomLeft"];break;case"bottomMiddle":l=["bottomLeft","bottomRight"],a.y-=an.HANDLE_SIZE/2;break}const h=t.snapToAngle,p=l.map((g,y)=>o&&c[y]?this.snapToAngle(e,i,g,c[y],h):mt(Ri.add(n[g].handle,a),i)).filter(jD);if(p.some(g=>!ci(i,g,{y:!1})))return;const{value:u}=ft(t.start.y);if((s==="topMiddle"||s==="bottomMiddle")&&u!=null&&Et(u)){const g=mt(Ri.add(n.topLeft.handle,a),i);s==="topMiddle"?t.height+=g.y-u:t.height-=g.y-u}for(const[g,y]of p.entries())switch(l[g]){case"topLeft":t.start.x=y.x,t.start.y=y.y;break;case"topRight":t.end.x=y.x,t.end.y=y.y;break}t.isValidWithContext(i)||t.set(r)}containsPoint(t,e){return super.containsPoint(t,e)||this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(t,e)}getNodeAtCoords(t,e){return this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(t,e)?"line":super.getNodeAtCoords(t,e)}updateLines(t,e,i,o,s,n){const{topLine:a,middleLine:r,bottomLine:l}=this,{lineDashOffset:c,stroke:h,strokeOpacity:p,strokeWidth:u}=t,g=t.getLineDash(),y={lineCap:t.getLineCap(),lineDash:g,lineDashOffset:c,stroke:h,strokeOpacity:p,strokeWidth:u};a.setProperties({...e,...y}),l.setProperties({...i,...y});const f=this.extendLine({x1:s.x1,y1:n.y1+(s.y1-n.y1)/2,x2:s.x2,y2:n.y2+(s.y2-n.y2)/2},t,o);r.setProperties({...f,lineDash:t.middle.lineDash??g,lineDashOffset:t.middle.lineDashOffset??c,stroke:t.middle.stroke??h,strokeOpacity:t.middle.strokeOpacity??p,strokeWidth:t.middle.strokeWidth??u,visible:t.middle.visible??!0})}updateHandles(t,e,i){const{handles:{topLeft:o,topMiddle:s,topRight:n,bottomLeft:a,bottomMiddle:r,bottomRight:l}}=this,c={fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth};o.update({...c,...un.start(e)}),n.update({...c,...un.end(e)}),a.update({...c,...un.start(i)}),l.update({...c,...un.end(i)}),s.update({...c,...Ri.sub(un.center(e),Ri.from(s.handle.width/2,s.handle.height/2))}),r.update({...c,...Ri.sub(un.center(i),Ri.from(r.handle.width/2,r.handle.height/2))})}updateText(t,e,i){this.text=this.updateNode(ds,this.text,!!t.text.label),ef(!0,e,i,t.text,t.strokeWidth,this.text,t.text.label)}getBackgroundPoints(t,e,i,o){const s=e.x1>e.x2,n=e.y1>e.y2,a=e.x1!==i.x1&&e.y1!==i.y1,r=e.x2!==i.x2&&e.y2!==i.y2,l=Ri.from(e);return t.extendEnd&&r&&l.push(Ri.from(s?o.x1:o.x2,n?o.y1:o.y2)),l.push(...Ri.from(i).reverse()),t.extendStart&&a&&l.push(Ri.from(s?o.x2:o.x1,n?o.y2:o.y1)),l}};import{_ModuleSupport as g2}from"ag-charts-community";var{StateMachine:Bo,StateMachineProperty:ad,Debug:y2}=g2,Qr=class extends Bo{constructor(t){const e=({point:l})=>{const c=new Ze;c.set({start:l,end:l,height:0}),t.create(c)},i=()=>{const{node:l}=this;l?.toggleActive(!0),l?.toggleHandles({topLeft:!0,topMiddle:!1,topRight:!1,bottomLeft:!1,bottomMiddle:!1,bottomRight:!1})},o=({offset:l,context:c})=>{const{datum:h,snapping:p}=this;h&&(h.set({end:da(l,c,p,h.start,h.snapToAngle)}),t.update())},s=()=>{this.node?.toggleHandles({topRight:!0}),t.update()},n=({point:l})=>{const{datum:c,node:h}=this,{value:p}=ft(c?.end.y),{value:u}=ft(c?.start.y),{y:g}=l;if(c==null||!Et(u)||!Et(p)||!Et(g))return;const y=p-(g??0),f=u-y;h?.toggleHandles({bottomLeft:!0,bottomRight:!0}),!(!t.validatePoint({x:c.start.x,y:f})||!t.validatePoint({x:c.end.x,y:l.y}))&&(c.set({height:y}),t.update())},a=({point:l})=>{const{datum:c,node:h}=this,{value:p}=ft(c?.end.y),{value:u}=ft(c?.start.y),{y:g}=l;if(c==null||!Et(u)||!Et(p)||!Et(g))return;const y=p-(g??0),f=u-y;h?.toggleHandles(!0),!(!t.validatePoint({x:c.start.x,y:f})||!t.validatePoint({x:c.end.x,y:l.y}))&&(c.set({height:y}),t.recordAction("Create parallel-channel annotation"),t.showAnnotationOptions(),t.update())},r=()=>t.delete();super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},reset:Bo.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:o,drag:o,click:{target:"height",action:s},dragEnd:{target:"height",action:s},reset:{target:Bo.parent,action:r},cancel:{target:Bo.parent,action:r}},height:{hover:n,click:{target:Bo.parent,action:a},drag:{target:Bo.parent,action:a},reset:{target:Bo.parent,action:r},cancel:{target:Bo.parent,action:r}}}),this.debug=y2.create(!0,"annotations"),this.snapping=!1}};d([ad()],Qr.prototype,"datum",2),d([ad()],Qr.prototype,"node",2),d([ad()],Qr.prototype,"snapping",2);var _f={type:"parallel-channel",datum:Ze,scene:Zr,isDatum:Ze.is,translate:(t,e,i,o)=>{Ze.is(e)&&Zr.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(Ze.is(e)&&Ze.is(i)&&Zr.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{Ze.is(e)&&Zr.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new Qr({...t,create:e("parallel-channel")}),dragState:t=>new wt(t)},qr=class extends $h{constructor(){super(),this.type="text",this.append([this.label,this.handle])}static is(t){return Zt.isCheck(t,"text")}getHandleCoords(t,e){const i=Mt.HANDLE_SIZE/2;return{x:e.x+i,y:e.y+2+i}}},f2=class extends ua{createDatum(){return new qi}},Bf={type:"text",datum:qi,scene:qr,isDatum:qi.is,translate:(t,e,i,o)=>{qi.is(e)&&qr.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(qi.is(e)&&qi.is(i)&&qr.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{qi.is(e)&&qr.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new f2({...t,create:e("text")}),dragState:t=>new wt(t)},ze={[bf.type]:bf,[af.type]:af,[rf.type]:rf,[_f.type]:_f,[df.type]:df,[mf.type]:mf,[yf.type]:yf,[Zy.type]:Zy,[Jy.type]:Jy,[Pf.type]:Pf,[Bf.type]:Bf,[vf.type]:vf,[Wy.type]:Wy,[Gy.type]:Gy,[Of.type]:Of,[Lf.type]:Lf,[Rf.type]:Rf,[Ef.type]:Ef};function gs(t){for(const{isDatum:e}of Object.values(ze))if(e(t))return t}import{_ModuleSupport as m2}from"ag-charts-community";var{ActionOnSet:x2,ParallelStateMachine:S2,StateMachine:rd,StateMachineProperty:Ei,Debug:b2}=m2,Jr=class extends S2{constructor(t){super(new v2(e=>{this.snapping=e}),new M2(()=>{this.node=this.active==null?void 0:t.node(this.active)}),new zo(t,e=>{this.active=e,this.datum=this.active==null?void 0:t.datum(this.active),this.node=this.active==null?void 0:t.node(this.active)})),this.snapping=!1}getActive(){return this.active}isActive(t){return t===this.active}};d([Ei()],Jr.prototype,"snapping",2),d([Ei()],Jr.prototype,"datum",2),d([Ei()],Jr.prototype,"node",2);var v2=class extends rd{constructor(t){super("idle",{idle:{hover:({shiftKey:e})=>t(e),keyDown:({shiftKey:e})=>t(e),keyUp:({shiftKey:e})=>t(e),click:({shiftKey:e})=>t(e),drag:({shiftKey:e})=>t(e)},dragging:{},"text-input":{}})}},M2=class extends rd{constructor(t){super("idle",{idle:{onEnter:t,render:t},dragging:{onEnter:t,render:t},"text-input":{render:t}})}},zo=class extends rd{constructor(t,e){const i=S=>b=>{t.create(S,b),this.active=t.selectLast()},o=()=>{this.active!=null&&t.delete(this.active),this.active=void 0,t.select()},s={createDatum:i},n={...t,delete:o,showTextInput:()=>{this.active!=null&&t.showTextInput(this.active)},deselect:()=>{const S=this.active;this.active=void 0,this.hovered=void 0,t.select(this.active,S)},showAnnotationOptions:()=>{this.active!=null&&t.showAnnotationOptions(this.active)}},a=Object.fromEntries(Object.entries(ze).map(([S,b])=>[S,b.createState(n,s)])),r=Object.fromEntries(Object.entries(ze).map(([S,b])=>[S,b.dragState(t,s)])),l=({colorPickerType:S,colorOpacity:b,color:k,opacity:I,isMultiColor:M})=>{this.datum&&(S==="text-color"&&t.updateTextInputColor(k),Cr(this.datum,S,b,k,I,M),t.update())},c=S=>{const{datum:b,node:k}=this;!b||!k||(Ni(b)?(b.fontSize=S,t.updateTextInputFontSize(S)):sn(b)&&(b.text.fontSize=S),t.update())},h=S=>{const{datum:b,node:k}=this;!b||!k||!To(b)||(Sy(b,S),t.update())},p=S=>{const{node:b}=this;!b||!("setTextInputBBox"in b)||(b.setTextInputBBox(S),t.update())},u=({textInputValue:S,bbox:b})=>{const{datum:k}=this;if(b!=null&&S!=null&&S.length>0){if(!Ni(k))return;const I=Mr(k,S,b.width);k.set({text:I}),t.update(),t.recordAction(`Change ${k.type} annotation text`)}else t.delete(this.active),t.recordAction(`Delete ${k?.type} annotation`)},g=()=>{t.updateTextInputBBox(void 0)},y=()=>this.active!=null,f=()=>this.copied!=null,m=()=>{const{active:S,datum:b}=this;return S==null||!b?!1:sn(b)&&!b.locked},x=()=>this.active!=null&&!Do(this.datum),v=()=>this.hovered!=null;super("idle",{idle:{onEnter:()=>{t.select(this.active,this.active),this.hoverCoords&&(this.hovered=t.hoverAtCoords(this.hoverCoords,this.active,this.hovered))},hover:({offset:S})=>{this.hovered=t.hoverAtCoords(S,this.active,this.hovered),this.hoverCoords=S},translate:{guard:y,action:({translation:S})=>{t.startInteracting(),t.translate(this.active,S),t.update()}},translateEnd:{guard:y,action:()=>{t.stopInteracting()}},copy:{guard:x,action:()=>{this.copied=t.copy(this.active)}},cut:{guard:x,action:()=>{this.copied=t.copy(this.active),o()}},paste:{guard:f,action:()=>{t.paste(this.copied)}},selectLast:()=>{const S=this.active;this.active=t.selectLast(),t.select(this.active,S)},click:[{guard:()=>{const{active:S,hovered:b,datum:k}=this;return S==null||b!==S||!k?!1:Ni(k)&&!k.locked},target:"text-input"},{action:()=>{const S=this.active;this.active=this.hovered,t.select(this.active,S)}}],dblclick:{guard:m,action:({offset:S})=>{const b=t.getNodeAtCoords(S,this.active)==="text"?"text":"line";t.showAnnotationSettings(this.active,void 0,b)}},dragStart:[{guard:v,target:"dragging",action:()=>{const S=this.active;this.active=this.hovered,t.select(this.active,S),t.startInteracting()}},{action:()=>{const S=this.active;this.active=this.hovered,t.select(this.active,S)}}],color:{guard:y,action:l},fontSize:{guard:y,action:c},lineProps:{guard:y,action:S=>{const b=gs(this.datum);b?.set(S),t.update(),t.recordAction(`Change ${b?.type} ${Object.entries(S).map(([k,I])=>`${k} to ${I}`).join(", ")}`)}},lineStyle:{guard:y,action:h},lineText:{guard:y,action:S=>{const b=gs(this.datum);sn(b)&&(Ji(b)&&S.position==="center"&&(S.position="inside"),b.text.set(S),t.update())}},updateTextInputBBox:{guard:y,action:p},toolbarPressSettings:{guard:m,action:S=>{t.showAnnotationSettings(this.active,S)}},reset:()=>{this.active!=null&&this.node?.toggleActive(!1),this.hovered=void 0,this.active=void 0,t.select(this.active,this.active),t.resetToIdle()},delete:()=>{this.active!=null&&(t.delete(this.active),!Do(this.datum)&&t.recordAction(`Delete ${this.datum?.type} annotation`))},deleteAll:()=>{t.deleteAll()},...a},dragging:{onEnter:(S,b)=>{if(this.active==null)return;const k=t.getAnnotationType(this.active);k&&(this.transitionRoot(k),this.transitionRoot("dragStart",b))},...r},"text-input":{onEnter:()=>{if(this.active==null)return;const S=gs(this.datum);!S||!("getTextInputCoords"in S)||(t.startInteracting(),t.showTextInput(this.active),S.visible=!1,t.update())},updateTextInputBBox:{guard:y,action:p},resize:{target:"idle",action:u},click:{target:"idle",action:u},drag:{target:"idle",action:u},textInput:[{guard:Yh,target:"idle",action:g},{guard:jh,target:"idle",action:u}],color:{guard:y,action:l},fontSize:{guard:y,action:c},cancel:{target:"idle",action:g},onExit:()=>{t.stopInteracting(),t.hideTextInput();const S=this.active;if(this.active=this.hovered=void 0,t.select(this.active,S),S==null)return;const b=t.datum(S),k=t.node(S);!b||!k||(b.visible=!0)}}}),this.setActive=e,this.debug=b2.create(!0,"annotations"),this.snapping=!1}};d([x2({changeValue(t){this.setActive(t)}}),Ei()],zo.prototype,"active",2),d([Ei()],zo.prototype,"hovered",2),d([Ei()],zo.prototype,"hoverCoords",2),d([Ei()],zo.prototype,"copied",2),d([Ei()],zo.prototype,"snapping",2),d([Ei()],zo.prototype,"datum",2),d([Ei()],zo.prototype,"node",2);import{_ModuleSupport as ld}from"ag-charts-community";var{ARRAY:k2,BOOLEAN:A2,UNION:I2,POSITIVE_NUMBER:D2,ActionOnSet:T2,LayoutElement:C2,Menu:N2,PropertiesArray:O2,ToolbarButtonProperties:L2,Validate:tl,ChartAxisDirection:R2}=ld,zf=class extends L2{};d([tl(I2(["line-menu","fibonacci-menu","text-menu","shape-menu","measurer-menu","clear"]))],zf.prototype,"value",2);var el=class extends ld.BaseProperties{constructor(t){super(),this.ctx=t,this.enabled=!0,this.padding=20,this.buttons=new O2(zf),this.events=new ld.Listeners,this.annotationMenu=new N2(this.ctx,"annotations"),this.destroyFns=[],this.toolbar=t.sharedToolbar.getSharedToolbar("annotations");const e=this.onKeyDown.bind(this);this.toolbar.addListener("keydown",e),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onToolbarButtonPress.bind(this)),t.layoutManager.registerElement(C2.ToolbarLeft,this.onLayoutStart.bind(this)),()=>{this.toolbar.removeListener("keydown",e),this.toolbar.destroy()})}destroy(){for(const t of this.destroyFns)t()}addListener(t,e){return this.events.addListener(t,e)}toggleVisibility(t){this.toolbar.setHidden(!t)}toggleClearButtonEnabled(t){const e=this.buttons.findIndex(i=>i.value==="clear");this.toolbar.toggleButtonEnabledByIndex(e,t)}resetButtonIcons(){for(const[t,e]of this.buttons.entries())switch(e.value){case"line-menu":this.updateButtonByIndex(t,{icon:"trend-line-drawing",value:"line-menu"});break;case"fibonacci-menu":this.updateButtonByIndex(t,{icon:"fibonacci-retracement-drawing",value:"fibonacci-menu"});break;case"text-menu":this.updateButtonByIndex(t,{icon:"text-annotation",value:"text-menu"});break;case"shape-menu":this.updateButtonByIndex(t,{icon:"arrow-drawing",value:"shape-menu"});break;case"measurer-menu":this.updateButtonByIndex(t,{icon:"measurer-drawing",value:"measurer-menu"});break}}hideOverlays(){this.annotationMenu.hide()}clearActiveButton(){this.toolbar.clearActiveButton()}dispatch(t,e){this.events.dispatch(t,e)}onLayoutStart(t){this.enabled&&(this.toolbar.updateButtons(this.buttons),this.toolbar.layout(t.layoutBox,this.padding))}refreshButtonsEnabled(t){for(const[e,i]of this.buttons.entries())i&&this.toolbar.toggleButtonEnabledByIndex(e,t)}onToolbarButtonPress({event:t,button:e,buttonBounds:i}){const o=this.ctx.axisManager.getAxisContext(R2.Y)[0].scale;switch(e.value){case"clear":this.dispatch("pressed-clear");break;case"line-menu":this.onToolbarButtonPressShowMenu(t,i,e.value,"toolbarAnnotationsLineAnnotations",C0.filter(s=>s.visible?s.visible(o):!0));break;case"fibonacci-menu":this.onToolbarButtonPressShowMenu(t,i,e.value,"toolbarAnnotationsFibonacciAnnotations",N0);break;case"text-menu":this.onToolbarButtonPressShowMenu(t,i,e.value,"toolbarAnnotationsTextAnnotations",L0);break;case"shape-menu":this.onToolbarButtonPressShowMenu(t,i,e.value,"toolbarAnnotationsShapeAnnotations",R0);break;case"measurer-menu":this.onToolbarButtonPressShowMenu(t,i,e.value,"toolbarAnnotationsMeasurerAnnotations",E0);break}}onToolbarButtonPressShowMenu(t,e,i,o,s){this.dispatch("pressed-show-menu");const n=this.buttons.findIndex(a=>a.value===i);this.toolbar.toggleActiveButtonByIndex(n),this.annotationMenu.setAnchor({x:e.x+e.width+6,y:e.y}),this.annotationMenu.show({items:s,ariaLabel:this.ctx.localeManager.t(o),class:"ag-charts-annotations__toolbar-menu",sourceEvent:t.sourceEvent,onPress:this.onButtonPressMenuCreateAnnotation.bind(this,i)})}onButtonPressMenuCreateAnnotation(t,e){const i=this.buttons.findIndex(o=>o.value===t);this.updateButtonByIndex(i,{icon:e.icon}),this.dispatch("pressed-create-annotation",{annotation:e.value}),this.annotationMenu.hide()}onKeyDown({sourceEvent:t}){t.key==="Escape"&&this.dispatch("cancel-create-annotation")}updateButtonByIndex(t,e){const i=this.buttons.at(t);i&&(i.set({...i.toJson(),...e,value:e.value??i.value}),this.toolbar.updateButtonByIndex(t,{...i.toJson()}))}};d([tl(A2),T2({changeValue(t){this.toolbar?.setHidden(!t)}})],el.prototype,"enabled",2),d([tl(D2)],el.prototype,"padding",2),d([tl(k2)],el.prototype,"buttons",2);import{_ModuleSupport as E2,_Widget as w2}from"ag-charts-community";var{BaseModuleInstance:P2,InteractionState:fa,Validate:_2,BOOLEAN:B2,ChartAxisDirection:z2,getIconClassNames:V2}=E2,ma="ag-charts-annotations__axis-button",Vf=class extends P2{constructor(t,e,i,o){super(),this.ctx=t,this.axisCtx=e,this.onButtonClick=i,this.seriesRect=o,this.enabled=!0,this.snap=!1,this.padding=0,this.button=this.setup(),this.toggleVisibility(!1),this.updateButtonElement(),this.snap=!!e.scale.bandwidth,t.domManager.addEventListener("focusin",({target:s})=>{const n=s instanceof HTMLElement?s:void 0;!(n&&t.domManager.contains(n,"series-area"))&&n!==this.button.getElement()&&this.hide()}),this.destroyFns.push(t.widgets.seriesWidget.addListener("drag-move",s=>this.onMouseDrag(s)),t.widgets.seriesWidget.addListener("mousemove",s=>this.onMouseMove(s)),t.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseLeave()),t.widgets.seriesDragInterpreter.addListener("click",s=>this.onClick(s)),t.chartEventManager.addListener("series-focus-change",()=>this.onKeyPress()),t.zoomManager.addListener("zoom-pan-start",()=>this.hide()),t.zoomManager.addListener("zoom-change",()=>this.hide()),()=>this.destroyElements(),()=>this.button.destroy())}update(t,e){this.seriesRect=t,this.padding=e}setup(){const t=new w2.ButtonWidget;return t.addClass(ma),t.setTabIndex(-1),t.setAriaLabel(this.ctx.localeManager.t("ariaLabelAddHorizontalLine")),this.ctx.widgets.seriesWidget.getElement().appendChild(t.getElement()),t}destroyElements(){this.ctx.domManager.removeChild("canvas-overlay",ma)}onMouseMove(t){this.ctx.interactionManager.isState(fa.Clickable)&&this.show(t)}onMouseDrag(t){this.ctx.interactionManager.isState(fa.AnnotationsMoveable)&&this.show(t)}onMouseLeave(){this.ctx.interactionManager.isState(fa.Clickable)&&this.hide()}onClick(t){this.ctx.interactionManager.isState(fa.Clickable)&&t.device==="touch"&&this.show(t)}show(t){const{sourceEvent:e,currentX:i,currentY:o}=t;if(!(this.enabled&&this.ctx.widgets.seriesWidget.getElement().contains(e.target))){this.hide();return}this.toggleVisibility(!0);const s=this.getButtonCoordinates({x:i,y:o});this.coords={x:s.x+this.button.clientWidth/2,y:s.y+this.button.clientHeight/2},this.updatePosition(s)}hide(){this.toggleVisibility(!1)}onKeyPress(){this.snap&&this.ctx.interactionManager.isState(fa.Default)||this.hide()}getButtonCoordinates({x:t,y:e}){const{axisCtx:{direction:i,position:o},seriesRect:s,snap:n,axisCtx:a,padding:r}=this,{clientWidth:l,clientHeight:c}=this.button,[h,p]=[0,s.height],[u,g]=[0,s.width];if(n&&(t=Io(aa(t-s.x,a),a)+s.x,e=Io(aa(e-s.y,a),a)+s.y),i===z2.X){const f=c-Math.max(0,r-5);t=t-l/2,e=o==="top"?h-c+f:p-f}else{const f=l-Math.max(0,r-9);t=o==="left"?u-l+f:g-f,e=e-c/2}return{x:t,y:e}}toggleVisibility(t){const{button:e}=this;if(e==null)return;const i=this.enabled&&t;this.toggleClass("-hidden",!i)}toggleClass(t,e){this.button.toggleClass(`${ma}-${t}`,e)}updatePosition({x:t,y:e}){this.button.getElement().style.transform=`translate(${Math.round(t)}px, ${Math.round(e)}px)`}updateButtonElement(){const{button:t}=this;t.addListener("click",()=>this.onButtonClick(this.coords)),t.addListener("touchend",()=>this.onButtonClick(this.coords)),t.addListener("drag-start",()=>{}),t.setInnerHTML(``)}};d([_2(B2)],Vf.prototype,"enabled",2);import{_ModuleSupport as F2}from"ag-charts-community";import{_ModuleSupport as G2}from"ag-charts-community";var{Color:Ff,DraggablePopover:W2,NativeWidget:cd,Vec2:Ft,createButton:il,createCheckbox:H2,createElementId:Gf,createSelect:K2,createTextArea:U2,initRovingTabIndex:Wf,getIconClassNames:Y2,mapValues:hd,setAttribute:j2,setAttributes:dd,createElement:io,getWindow:X2}=G2,Hf=class ng extends W2{constructor(e,i){super(e,i),this.dragHandleDraggingClass="ag-charts-dialog__drag-handle--dragging",this.colorPicker=new ky(this.ctx,{detached:!0}),this.destroyFns.push(e.layoutManager.addListener("layout:complete",this.onLayoutComplete.bind(this)))}showWithChildren(e,i){const o=super.showWithChildren(e,i);return o.classList.add("ag-charts-dialog"),o.setAttribute("role","dialog"),o.addEventListener("mousedown",s=>{s.target.classList?.contains("ag-charts-dialog__color-picker-button")||this.colorPicker.hide()}),o.addEventListener("keydown",this.onKeyDown.bind(this)),X2().requestAnimationFrame(()=>this.reposition()),this.colorPicker.attachTo(this),o}updatePosition(e){super.updatePosition(e);const{anchor:i,fallbackAnchor:o}=this.getColorPickerAnchors()??{};i&&this.colorPicker.setAnchor(i,o)}createTabs(e,i,o){const s=io("div","ag-charts-dialog__tabs"),n=hd(o,()=>Gf("ag-charts-dialog__tab")),a=hd(o,()=>Gf("ag-charts-dialog__tab-panel"));for(const[g,y]of Object.entries(o))dd(y.panel,{id:a[g],role:"tabpanel","aria-labelledby":n[g]});const r=g=>{for(const[y,f]of Object.entries(o))f.panel.classList.toggle("ag-charts-dialog__tab-panel--active",y===g),h[y].classList.toggle("ag-charts-dialog__tab-button--active",y===g),j2(h[y],"aria-selected",y===g),y===g&&f.onShow?.()},l=new cd(io("div","ag-charts-dialog__header"));l.addListener("drag-start",g=>{const{sourceEvent:y}=g;y.target instanceof Element&&y.target.classList.contains("ag-charts-dialog__header")&&this.onDragStart(g)}),l.addListener("drag-move",g=>this.onDragMove(g)),l.addListener("drag-end",()=>this.onDragEnd());const c=new Z2;this.setDragHandle(c);const h=hd(o,(g,y)=>il({label:this.ctx.localeManager.t(g.label),onPress:()=>r(y)},{id:n[y],class:"ag-charts-dialog__tab-button",role:"tab","aria-controls":a[y]})),p=io("div","ag-charts-dialog__tab-list");dd(p,{role:"tablist","aria-label":this.ctx.localeManager.t(e)}),p.append(...Object.values(h));const u=this.createHeaderCloseButton();return l.getElement().append(c.getElement(),p,u),s.append(l.getElement(),...Object.values(o).map(g=>g.panel)),r(i),Wf({orientation:"horizontal",buttons:Object.values(h)}),{tabs:s,initialFocus:h[i]}}createTabPanel(){return io("div","ag-charts-dialog__tab-panel")}createInputGroupLine(){return io("div","ag-charts-dialog__input-group-line")}createRadioGroup({label:e,options:i,value:o,onChange:s}){const n=this.createInputGroup(e);dd(n,{role:"radiogroup",tabindex:-1,"aria-label":this.ctx.localeManager.t(e)});const a="ag-charts-dialog__button--active",r=[];for(const l of i){const{icon:c,altText:h}=l,p=this.ctx.localeManager.t(h),u=il({icon:c,altText:p,onPress:()=>{for(const g of Array.from(n.children))g.classList.remove(a),g.ariaChecked="false";u.classList.add(a),u.ariaChecked="true",s(l.value)}},{"aria-checked":l.value===o,class:"ag-charts-dialog__button",role:"radio",title:p});l.value===o&&u.classList.add(a),n.appendChild(u),r.push(u)}return Wf({orientation:"horizontal",buttons:r}),n}createSelect({altText:e,label:i,options:o,value:s,onChange:n}){const a=this.createInputGroup(i),r=this.ctx.localeManager.t(e),l=K2({value:s,options:o,onChange:n},{class:"ag-charts-dialog__select","aria-label":r,title:r});return a.append(l),a}createTextArea({placeholder:e,value:i,onChange:o}){const s=e?this.ctx.localeManager.t(e):void 0;return U2({value:i,onChange:o},{placeholder:s})}createCheckbox({label:e,checked:i,onChange:o}){const s=`ag-charts__${e}`,n=this.createInputGroup(e,{for:s}),a=H2({checked:i,onChange:o},{class:"ag-charts-dialog__checkbox",role:"switch",id:s});return n.append(a),n}createColorPicker({color:e,opacity:i,label:o,altText:s,onChange:n,onChangeHide:a,isMultiColor:r,hasMultiColorOption:l}){const c=this.createInputGroup(o),h=this.ctx.localeManager.t(s),p=il({label:h,onPress:u=>{const{anchor:g,fallbackAnchor:y}=this.getColorPickerAnchors(p)??{};this.colorPicker.show({anchor:g,fallbackAnchor:y,color:e,opacity:i,isMultiColor:r,hasMultiColorOption:l,sourceEvent:u,onChange:(f,m,x,v)=>{p.style.setProperty("--color",f),p.classList.toggle("ag-charts-dialog__color-picker-button--multi-color",v),n(f,m,x,v)},onChangeHide:a})}},{"aria-label":h,tabindex:0,class:"ag-charts-dialog__color-picker-button",title:h});if(r)p.classList.toggle("ag-charts-dialog__color-picker-button--multi-color");else if(e){const u=Ff.fromString(e),g=new Ff(u.r,u.g,u.b,i);p.style.setProperty("--color",g.toHexString())}return c.append(p),this.hideFns.push(()=>{this.colorPicker.hide()}),c}createHeaderCloseButton(){return il({icon:"close",altText:this.ctx.localeManager.t("iconAltTextClose"),onPress:()=>this.hide()},{class:"ag-charts-dialog__close-button"})}createInputGroup(e,i){const o=io("div","ag-charts-dialog__input-group"),s=io("label","ag-charts-dialog__input-group-label");return s.innerText=this.ctx.localeManager.t(e),i?.for&&s.setAttribute("for",i.for),o.appendChild(s),o}onLayoutComplete(e){this.seriesRect=e.series.paddedRect,this.reposition()}onKeyDown(e){e.altKey||e.ctrlKey||e.metaKey||e.isComposing||e.key!=="Escape"||this.hide()}reposition(){const{seriesRect:e,ctx:i}=this,o=i.domManager.getBoundingClientRect(),s=this.getPopoverElement();if(!e||!s)return;const n=Ft.from(0,e.y),a=Ft.from(o.width,e.height),r=Ft.from(s),l=Ft.from(.5,1);let c;if(e.width>1e3){const h=Ft.sub(Ft.add(n,Ft.multiply(a,l)),Ft.multiply(r,l));c=Ft.sub(h,Ft.from(0,ng.offset))}else{const h=Ft.sub(Ft.add(n,a),r);c=Ft.sub(h,ng.offset)}this.updatePosition(c)}getColorPickerAnchors(e){if(e&&(this.colorPickerAnchorElement=e),!this.colorPickerAnchorElement)return;const i=this.colorPickerAnchorElement.getBoundingClientRect(),o=this.ctx.domManager.getBoundingClientRect(),s=Ft.sub(Ft.from(i.x,i.y),Ft.from(o.left,o.top)),n=Ft.add(s,Ft.from(0,i.height+5)),a=Ft.sub(s,Ft.from(0,5));return{anchor:n,fallbackAnchor:a}}};Hf.offset=60;var $2=Hf,Z2=class extends cd{constructor(){super(io("div","ag-charts-dialog__drag-handle"));const t=new cd(io("span",Y2("drag-handle")));t.setAriaHidden(!0),this.addChild(t)}},{Listeners:Q2,focusCursorAtEnd:q2}=F2,J2=class extends $2{constructor(t){super(t,"settings"),this.events=new Q2,this.hideFns.push(()=>this.events.dispatch("hidden"))}addListener(t,e){return this.events.addListener(t,e)}show(t,e){const i=this.createLinearLineTab(t,e),o=this.createLinearTextTab(t,e);let s="dialogHeaderLine";Ji(t)?s="dialogHeaderChannel":xy(t)?s="dialogHeaderFibonacciRange":t.type==="date-range"?s="dialogHeaderDateRange":t.type==="price-range"?s="dialogHeaderPriceRange":t.type==="date-price-range"&&(s="dialogHeaderDatePriceRange");const{tabs:n,initialFocus:a}=this.createTabs("ariaLabelSettingsTabBar",e.initialSelectedTab,{line:{label:s,panel:i},text:{label:"dialogHeaderText",panel:o.panel,onShow:o.onShow}});e.initialFocus=a,this.showWithChildren([n],e).classList.add("ag-charts-dialog--annotation-settings")}createLinearLineTab(t,e){const i=this.createTabPanel(),o=this.createInputGroupLine(),s=this.createInputGroupLine(),n="isMultiColor"in t,a=this.createColorPickerInput("line-color",t.getDefaultColor("line-color"),t.getDefaultOpacity("line-color"),n?t.isMultiColor:!1,n,e.onChangeLineColor,e.onChangeHideLineColor),r=this.createStrokeWidthSelect(t.strokeWidth??2,e.onChangeLineStyleWidth),l=this.createLineStyleRadioGroup(t.lineStyle??"solid",e.onChangeLineStyleType);if(o.append(a),"background"in t){const c=this.createColorPickerInput("fill-color",t.getDefaultColor("fill-color"),t.getDefaultOpacity("fill-color"),!1,!1,e.onChangeFillColor,e.onChangeHideFillColor);o.append(c),s.append(r)}else"showFill"in t?(o.append(this.createCheckbox({label:"dialogInputShowFill",checked:t.showFill??!0,onChange:c=>e.onChangeLine({showFill:c})})),s.append(r)):o.append(r);return s.append(l),i.append(o,s),"bands"in t&&i.append(this.createFibonacciRatioSelect(t.bands??10,c=>e.onChangeLine({bands:c}))),"extendStart"in t&&"extendEnd"in t&&i.append(this.createCheckbox({label:Ji(t)?"dialogInputExtendChannelStart":"dialogInputExtendLineStart",checked:t.extendStart??!1,onChange:c=>e.onChangeLine({extendStart:c})}),this.createCheckbox({label:Ji(t)?"dialogInputExtendChannelEnd":"dialogInputExtendLineEnd",checked:t.extendEnd??!1,onChange:c=>e.onChangeLine({extendEnd:c})})),"extendAbove"in t&&"extendBelow"in t&&i.append(this.createCheckbox({label:"dialogInputExtendAbove",checked:t.extendAbove??!1,onChange:c=>e.onChangeLine({extendAbove:c})}),this.createCheckbox({label:"dialogInputExtendBelow",checked:t.extendBelow??!1,onChange:c=>e.onChangeLine({extendBelow:c})})),"extendLeft"in t&&"extendRight"in t&&i.append(this.createCheckbox({label:"dialogInputExtendLeft",checked:t.extendLeft??!1,onChange:c=>e.onChangeLine({extendLeft:c})}),this.createCheckbox({label:"dialogInputExtendRight",checked:t.extendRight??!1,onChange:c=>e.onChangeLine({extendRight:c})})),"reverse"in t&&"showFill"in t&&i.append(this.createCheckbox({label:"dialogInputReverse",checked:t.reverse??!1,onChange:c=>e.onChangeLine({reverse:c})})),i}createLinearTextTab(t,e){const i=this.createTabPanel(),o=this.createTextArea({placeholder:"inputTextareaPlaceholder",value:t.text.label,onChange:h=>e.onChangeText({label:h})}),s=this.createFontSizeSelect(t.text.fontSize,e.onChangeTextFontSize),n=this.createColorPickerInput("text-color",t.text.color,1,!1,!1,e.onChangeTextColor,e.onChangeHideTextColor),a=t.text.position==="inside"?"center":t.text.position,r=this.createPositionRadioGroup(a??"top",h=>e.onChangeText({position:h})),l=this.createAlignmentRadioGroup(t.text.alignment??"center",h=>e.onChangeText({alignment:h})),c=this.createInputGroupLine();return c.append(s,n,r,l),i.append(o,c),{panel:i,onShow:()=>q2(o)}}createColorPickerInput(t,e,i,o,s,n,a){const r=t==="fill-color"?"dialogInputFillColorPicker":"dialogInputColorPicker",l=t==="fill-color"?"dialogInputFillColorPickerAltText":"dialogInputColorPickerAltText";return this.createColorPicker({label:r,altText:l,color:e,opacity:i,isMultiColor:o,hasMultiColorOption:s,onChange:n,onChangeHide:a})}createStrokeWidthSelect(t,e){return this.createSelect({label:"dialogInputStrokeWidth",altText:"dialogInputStrokeWidthAltText",options:Dy.map(({label:i,value:o})=>({label:i,value:`${o}`})),value:String(t),onChange:i=>e(Number(i))})}createFibonacciRatioSelect(t,e){return this.createSelect({label:"dialogInputFibonacciBands",altText:"dialogInputFibonacciBandsAltText",options:O0.map(({label:i,value:o})=>({label:i,value:`${o}`})),value:String(t),onChange:i=>e(Number(i))})}createLineStyleRadioGroup(t,e){return this.createRadioGroup({label:"dialogInputLineStyle",options:[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],value:t,onChange:e})}createFontSizeSelect(t,e){return this.createSelect({label:"dialogInputFontSize",altText:"dialogInputFontSizeAltText",options:Ty.map(({label:i,value:o})=>({label:i,value:String(o)})),value:String(t),onChange:i=>e(Number(i))})}createPositionRadioGroup(t,e){return this.createRadioGroup({label:"dialogInputPosition",options:[{icon:"position-top",altText:"iconAltTextPositionTop",value:"top"},{icon:"position-center",altText:"iconAltTextPositionCenter",value:"center"},{icon:"position-bottom",altText:"iconAltTextPositionBottom",value:"bottom"}],value:t,onChange:e})}createAlignmentRadioGroup(t,e){return this.createRadioGroup({label:"dialogInputAlign",options:[{icon:"align-left",altText:"iconAltTextAlignLeft",value:"left"},{icon:"align-center",altText:"iconAltTextAlignCenter",value:"center"},{icon:"align-right",altText:"iconAltTextAlignRight",value:"right"}],value:t,onChange:e})}};function pd(t){return t.gridPadding+t.seriesAreaPadding+t.tickSize+t.label.spacing}function tC(t,e,i){for(const{update:o}of Object.values(ze))o(t,e,i)}var{BOOLEAN:Kf,OBJECT:ud,ChartUpdateType:eC,InteractionState:Ne,ObserveChanges:iC,PropertiesArray:oC,Validate:xa,ChartAxisDirection:sC,Vec2:ys,keyProperty:nC,valueProperty:aC,Selection:rC,BBox:lC}=gr,gn=class ok extends gr.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!0,this.toolbar=new el(this.ctx),this.optionsToolbar=new zh(this.ctx,()=>{const i=this.state.getActive();if(i!=null)return gs(this.annotationData.at(i))}),this.axesButtons=new gh,this.snap=!1,this.data=void 0,this.xKey=void 0,this.volumeKey=void 0,this.annotationData=new oC(ok.createAnnotationDatum),this.defaults=new I0,this.container=new gr.Group({name:"static-annotations"}),this.annotations=new rC(this.container,this.createAnnotationScene.bind(this)),this.settingsDialog=new J2(this.ctx),this.textInput=new PI(this.ctx),this.restoreAnnotations=!0,this.postUpdateFns=[],this.state=this.setupStateMachine(),this.setupListeners(),this.setupDOM(),this.ctx.historyManager.addMementoOriginator(e.annotationManager),this.ctx.historyManager.addMementoOriginator(this.defaults),this.textInput.setKeyDownHandler(this.onTextInput.bind(this))}setupStateMachine(){const{ctx:e}=this;return new Jr({resetToIdle:()=>{e.domManager.updateCursor("annotations"),this.popAnnotationState(Ne.Annotations),this.hideOverlays(),this.optionsToolbar.hide(),this.deleteEphemeralAnnotations(),this.update()},hoverAtCoords:(i,o,s)=>{let n;return this.annotations.each((a,r,l)=>{const c=a.containsPoint(i.x,i.y);c&&(n??(n=l)),a.toggleHovered(c||o===l)}),n!=null?e.tooltipManager.suppressTooltip("annotations"):this.isAnnotationState()||e.tooltipManager.unsuppressTooltip("annotations"),this.ctx.domManager.updateCursor("annotations",n==null?void 0:this.annotations.at(n)?.getCursor()),n!==s&&this.update(),n},getNodeAtCoords:(i,o)=>{const s=this.annotations.at(o);if(s)return s.getNodeAtCoords(i.x,i.y)},translate:(i,o)=>{const s=this.annotations.at(i),n=gs(this.annotationData.at(i));if(!(!s||!n))return this.translateNode(s,n,o)},copy:i=>{const o=this.annotations.at(i),s=gs(this.annotationData.at(i));if(!(!o||!s))return this.createAnnotationDatumCopy(o,s)},paste:i=>{this.createAnnotation(i.type,i,!1),this.postUpdateFns.push(()=>{this.state.transitionAsync("selectLast"),this.state.transitionAsync("copy")})},select:(i,o)=>{const{annotations:s,optionsToolbar:n,toolbar:a}=this;this.hideOverlays(),a.clearActiveButton(),a.resetButtonIcons();const r=i!=null?s.at(i):null,l=o!=null?s.at(o):null;l===r&&r!=null||(l?.toggleActive(!1),n.hide(),r?(this.pushAnnotationState(Ne.AnnotationsSelected),r.toggleActive(!0),n.updateButtons(this.annotationData.at(i)),this.postUpdateFns.push(()=>{n.show(),n.setAnchorScene(r)})):(this.popAnnotationState(Ne.AnnotationsSelected),this.popAnnotationState(Ne.Annotations)),this.deleteEphemeralAnnotations(),this.update())},selectLast:()=>(this.pushAnnotationState(Ne.AnnotationsSelected),this.annotationData.length-1),startInteracting:()=>{this.pushAnnotationState(Ne.Annotations)},stopInteracting:()=>{this.popAnnotationState(Ne.Annotations)},create:(i,o)=>{this.createAnnotation(i,o)},delete:i=>{this.annotationData.splice(i,1)},deleteAll:()=>{this.annotationData.splice(0,this.annotationData.length)},validatePoint:i=>{const o=this.getAnnotationContext();return o?ci(o,i):!0},getAnnotationType:i=>HI(this.annotationData[i].type),datum:i=>this.annotationData.at(i),node:i=>this.annotations.at(i),recordAction:i=>{this.recordActionAfterNextUpdate(i)},update:()=>{this.postUpdateFns.push(()=>{const i=this.state.getActive(),o=i!=null?this.annotations.at(i):null;o!=null&&this.optionsToolbar.setAnchorScene(o)}),this.update()},showTextInput:i=>{const o=gs(this.annotationData.at(i));if(!this.annotations.at(i)||!o||!("getTextInputCoords"in o)||!("getTextPosition"in o))return;const n={color:o.color,fontFamily:o.fontFamily,fontSize:o.fontSize,fontStyle:o.fontStyle,fontWeight:o.fontWeight,placeholderColor:o.getPlaceholderColor()},a=this.getAnnotationContext(),r=c=>ys.add(o.getTextInputCoords(a,c),ys.required(this.seriesRect)),l=()=>o.getTextPosition();this.textInput.show({styles:n,layout:{getTextInputCoords:r,getTextPosition:l,alignment:o.alignment,textAlign:o.textAlign,width:o.width},text:o.text,placeholderText:o.placeholderText,onChange:(c,h)=>{this.state.transition("updateTextInputBBox",h)}}),this.ctx.domManager.updateCursor("annotations")},hideTextInput:()=>{this.textInput.hide()},updateTextInputColor:i=>{this.textInput.updateColor(i)},updateTextInputFontSize:i=>{const o=this.textInput.updateFontSize(i);this.state.transition("updateTextInputBBox",o)},updateTextInputBBox:i=>{this.state.transition("updateTextInputBBox",i)},showAnnotationOptions:i=>{const o=this.annotations.at(i);!o||Do(this.annotationData.at(i))||(this.optionsToolbar.updateButtons(this.annotationData.at(i)),this.optionsToolbar.show(),this.optionsToolbar.setAnchorScene(o))},showAnnotationSettings:(i,o,s="line")=>{const n=this.annotationData.at(i);if(!Tr(n)&&!Ji(n)&&!ca(n)||Do(n))return;const a=c=>(h,p,u,g)=>{this.setColorAndDefault(n.type,c,h,p,u,g),this.optionsToolbar.updateColorPickerColor(c,p,u,g)},r=c=>()=>{this.recordActionAfterNextUpdate(`Change ${n.type} ${c} to ${n.getDefaultColor(c)}`,["annotations","defaults"]),this.update()},l={initialSelectedTab:s,ariaLabel:this.ctx.localeManager.t("ariaLabelAnnotationSettingsDialog"),sourceEvent:o,onChangeLine:c=>{this.state.transition("lineProps",c),c.bands!=null&&this.defaults.setDefaultFibonacciOptions(n.type,"bands",c.bands),c.reverse!=null&&this.defaults.setDefaultFibonacciOptions(n.type,"reverse",c.reverse),c.showFill!=null&&this.defaults.setDefaultFibonacciOptions(n.type,"showFill",c.showFill)},onChangeText:c=>{this.state.transition("lineText",c),c.alignment&&this.defaults.setDefaultLineTextAlignment(n.type,c.alignment),c.position&&this.defaults.setDefaultLineTextPosition(n.type,c.position),this.recordActionAfterNextUpdate(`Change ${n.type} text ${Object.entries(c).map(([h,p])=>`${h} to ${p}`).join(", ")}`)},onChangeFillColor:a("fill-color"),onChangeHideFillColor:r("fill-color"),onChangeLineColor:a("line-color"),onChangeHideLineColor:r("line-color"),onChangeLineStyleType:c=>{this.setLineStyleTypeAndDefault(n.type,c),this.optionsToolbar.updateLineStyleType(ha.find(h=>h.value===c)??ha[0])},onChangeLineStyleWidth:c=>{this.setLineStyleWidthAndDefault(n.type,c),this.optionsToolbar.updateStrokeWidth({strokeWidth:c,value:c,label:String(c)})},onChangeTextColor:a("text-color"),onChangeHideTextColor:r("text-color"),onChangeTextFontSize:c=>{this.setFontSizeAndDefault(n.type,c)}};this.settingsDialog.show(n,l)}})}setupListeners(){const{ctx:e,optionsToolbar:i,settingsDialog:o,toolbar:s}=this,{seriesWidget:n,seriesDragInterpreter:a,chartWidget:r}=e.widgets;this.destroyFns.push(a.addListener("click",this.hoverTouchPreHandler.bind(this)),a.addListener("drag-start",this.hoverTouchPreHandler.bind(this)),a.addListener("drag-move",this.dragMoveTouchPreHandler.bind(this)),a.addListener("mousemove",this.onHover.bind(this)),a.addListener("click",this.onClick.bind(this)),a.addListener("dblclick",this.onDoubleClick.bind(this)),a.addListener("drag-start",this.onDragStart.bind(this)),a.addListener("drag-move",this.onDrag.bind(this)),a.addListener("drag-end",this.onDragEnd.bind(this)),n.addListener("keydown",this.onKeyDown.bind(this)),n.addListener("keyup",this.onKeyUp.bind(this)),r.addListener("click",this.onCancel.bind(this)),e.annotationManager.addListener("restore-annotations",this.onRestoreAnnotations.bind(this)),e.layoutManager.addListener("layout:complete",this.onLayoutComplete.bind(this)),e.updateService.addListener("pre-scene-render",this.onPreRender.bind(this)),e.zoomManager.addListener("zoom-change",()=>this.onResize()),e.domManager.addListener("resize",()=>this.onResize()),s.addListener("cancel-create-annotation",()=>{this.cancel(),this.reset(),this.update()}),s.addListener("pressed-create-annotation",({annotation:l})=>{this.cancel(),this.pushAnnotationState(Ne.Annotations),this.state.transition(l),this.update()}),s.addListener("pressed-clear",()=>{this.clear(),this.recordActionAfterNextUpdate("Clear all")}),s.addListener("pressed-show-menu",()=>{this.cancel(),this.reset()}),s.addListener("pressed-unrelated",()=>{this.reset()}),i.addListener("pressed-delete",()=>{this.cancel(),this.delete(),this.reset()}),i.addListener("pressed-settings",({sourceEvent:l})=>{this.state.transition("toolbarPressSettings",l)}),i.addListener("pressed-lock",()=>{this.update()}),i.addListener("hid-overlays",()=>{this.settingsDialog.hide()}),i.addListener("saved-color",({type:l,colorPickerType:c,color:h})=>{this.recordActionAfterNextUpdate(`Change ${l} ${c} to ${h}`,["annotations","defaults"])}),i.addListener("updated-color",({type:l,colorPickerType:c,colorOpacity:h,color:p,opacity:u,isMultiColor:g})=>{this.setColorAndDefault(l,c,h,p,u,g)}),i.addListener("updated-font-size",({type:l,fontSize:c})=>{this.setFontSizeAndDefault(l,c)}),i.addListener("updated-line-style",({type:l,lineStyleType:c})=>{this.setLineStyleTypeAndDefault(l,c)}),i.addListener("updated-line-width",({type:l,strokeWidth:c})=>{this.setLineStyleWidthAndDefault(l,c)}),o.addListener("hidden",()=>{this.optionsToolbar.clearActiveButton()}))}setupDOM(){const{ctx:e,toolbar:i}=this;this.destroyFns.push(e.annotationManager.attachNode(this.container),()=>e.domManager.removeStyles(ma),()=>i.destroy())}async processData(e){if(!this.enabled||this.data==null||this.xKey==null||this.volumeKey==null)return;const i=[nC(this.xKey,void 0,{id:"date"}),aC(this.volumeKey,"number",{id:"volume"})],{dataModel:o,processedData:s}=await e.request("annotations",this.data,{props:i});this.dataModel=o,this.processedData=s}createAnnotationScene(e){if(e.type in ze)return new ze[e.type].scene;throw new Error(`AG Charts - Cannot create annotation scene of type [${e.type}], expected one of [${Object.keys(ze)}], ignoring.`)}static createAnnotationDatum(e){if(e.type in ze)return new ze[e.type].datum().set(e);throw new Error(`AG Charts - Cannot create annotation datum of unknown type [${e.type}], expected one of [${Object.keys(ze)}], ignoring.`)}createAnnotation(e,i,o=!0){if(this.annotationData.push(i),o){const s=this.ctx.annotationManager.getAnnotationTypeStyles(e);s&&i.set(s),this.defaults.applyDefaults(i)}this.injectDatumDependencies(i),this.update()}injectDatumDependencies(e){"setLocaleManager"in e&&e.setLocaleManager(this.ctx.localeManager),"getVolume"in e&&(e.getVolume=this.getDatumRangeVolume.bind(this))}getDatumRangeVolume(e,i){const{dataModel:o,processedData:s}=this;let n=ft(e).value,a=ft(i).value;if(!lh(n)||!lh(a)||!o||!s||this.volumeKey==null)return;n>a&&([n,a]=[a,n]);const r=o.resolveKeysById({id:"annotations"},"date",s),l=o.resolveColumnById({id:"annotations"},"volume",s);let c=0;for(let h=0;h=n&&p<=a&&(c+=l[h])}return c}translateNode(e,i,o){const s=this.getAnnotationConfig(i),n=this.getAnnotationContext();n&&s.translate(e,i,o,n)}createAnnotationDatumCopy(e,i){const o=this.getAnnotationConfig(i),s=new o.datum;s.set(i.toJson());const n=this.getAnnotationContext();if(n)return o.copy(e,i,s,n)}getAnnotationConfig(e){if(e.type in ze)return ze[e.type];throw new Error(`AG Charts - Cannot get annotation config of unknown type [${e.type}], expected one of [${Object.keys(ze)}], ignoring.`)}onRestoreAnnotations(e){this.enabled&&(this.clear(),this.annotationData.set(e.annotations),this.restoreAnnotations=!0,this.update())}onLayoutComplete(e){const i=e.series.paddedRect;this.seriesRect=i,this.container.setClipRect(i);for(const o of e.axes??[])o.direction===gr.ChartAxisDirection.X?this.xAxis=this.getAxis(o,i,this.xAxis?.button):this.yAxis=this.getAxis(o,i,this.yAxis?.button);this.showAnnotations()?this.animateAnnotations({from:0,to:1,phase:"trailing"}):this.animateAnnotations({from:1,to:0,phase:"remove"})}showAnnotations(){if(!this.yAxis||!this.xAxis)return!1;const e=this.ctx.chartService.series.some(s=>s.hasData),o=this.yAxis.context.seriesIds().some(s=>this.ctx.chartService.series.find(a=>a.id===s)?.visible);return e&&o}animateAnnotations({from:e,to:i,phase:o}){const{annotations:s}=this;this.ctx.animationManager?.animate({from:e,to:i,id:"chart-annotations",phase:o,groupId:"opacity",onUpdate(n){s.each(a=>{a.opacity=n,"setAxisLabelOpacity"in a&&a.setAxisLabelOpacity(n)})},onStop(){s.each(n=>{n.opacity=i,"setAxisLabelOpacity"in n&&n.setAxisLabelOpacity(i)})}})}onPreRender(){this.updateAnnotations(),this.state.transition("render")}getAxis(e,i,o){const s=this.ctx.axisManager.getAxisContext(e.direction)[0],{position:n="bottom",direction:a}=s,r=e.gridPadding+e.seriesAreaPadding,l=new lC(0,0,i.width,i.height).grow(r,n),c=s.direction===sC.X?"vertical":"horizontal",{axesButtons:h,snap:p}=this;if(this.enabled&&h.enabled&&(h.axes==="xy"||h.axes===a)){o??(o=new Vf(this.ctx,{...s,snapToGroup:p},y=>this.onAxisButtonClick(y,c),i));const g=pd(e);o.update(i,g)}else o?.destroy(),o=void 0;return{layout:e,context:s,bounds:l,button:o}}recordActionAfterNextUpdate(e,i=["annotations"]){const{defaults:o,ctx:{annotationManager:s,historyManager:n}}=this,a=i.map(r=>r==="defaults"?o:s);this.postUpdateFns.push(()=>{n.record(e,...a)})}setColorAndDefault(e,i,o,s,n,a){this.state.transition("color",{colorPickerType:i,colorOpacity:o,color:s,opacity:n,isMultiColor:a}),this.defaults.setDefaultColor(e,i,o,s,n,a)}setFontSizeAndDefault(e,i){this.state.transition("fontSize",i),this.defaults.setDefaultFontSize(e,i),this.recordActionAfterNextUpdate(`Change ${e} font size to ${i}`,["annotations","defaults"])}setLineStyleTypeAndDefault(e,i){this.state.transition("lineStyle",{type:i}),this.defaults.setDefaultLineStyleType(e,i),this.recordActionAfterNextUpdate(`Change ${e} line style to ${i}`,["annotations","defaults"])}setLineStyleWidthAndDefault(e,i){this.state.transition("lineStyle",{strokeWidth:i}),this.defaults.setDefaultLineStyleWidth(e,i),this.recordActionAfterNextUpdate(`Change ${e} stroke width to ${i}`,["annotations","defaults"])}updateAnnotations(){const{annotationData:e,annotations:i,seriesRect:o,ctx:{annotationManager:s}}=this,n=this.getAnnotationContext();if(!o||!n)return;s.updateData(e.toJson().filter(l=>!Do(l)));const a=this.showAnnotations();this.toolbar.refreshButtonsEnabled(a),this.toolbar.toggleClearButtonEnabled(e.length>0&&a);const r=this.restoreAnnotations;i.update(e??[],void 0,l=>l.id).each((l,c)=>{if(!a||!this.validateDatum(c,r)){l.visible=!1,"setAxisLabelVisible"in l&&l.setAxisLabelVisible(!1);return}"setAxisLabelVisible"in l&&l.setAxisLabelVisible(!0),this.injectDatumDependencies(c),tC(l,c,n)}),this.postUpdateFns.forEach(l=>l()),this.postUpdateFns=[],this.restoreAnnotations=!1}validateDatum(e,i){const o=this.getAnnotationContext(),s=i?`Annotation [${e.type}] `:void 0;return o?e.isValidWithContext(o,s):!0}getAnnotationContext(){const{seriesRect:e,xAxis:i,yAxis:o,snap:s}=this;if(e&&i&&o)return{seriesRect:e,xAxis:{...i.context,bounds:i.bounds,labelPadding:pd(i.layout),snapToGroup:s},yAxis:{...o.context,bounds:o.bounds,labelPadding:pd(i.layout),snapToGroup:s}}}onHover(e){const{state:i}=this,o=this.getAnnotationContext();if(!o)return;const s=e.sourceEvent.shiftKey,n=ys.from(e),a=mt(n,o);i.transition("hover",{offset:n,point:a,shiftKey:s,context:o})}onClick(e){const{state:i}=this,o=this.getAnnotationContext();if(!o)return;const s=e.sourceEvent.shiftKey,n=mt(ys.from(e),o),a=this.textInput.getValue(),r=this.textInput.getBBox();i.transition("click",{point:n,shiftKey:s,textInputValue:a,bbox:r})}onDoubleClick(e){const{state:i}=this;if(!this.getAnnotationContext())return;const s=ys.from(e);i.transition("dblclick",{offset:s})}onAxisButtonClick(e,i){this.cancel(),this.reset();const o=this.getAnnotationContext();if(!this.annotationData||!o)return;const{state:s}=this;this.pushAnnotationState(Ne.Annotations);const n=i==="horizontal";if(s.transition(n?"horizontal-line":"vertical-line"),this.optionsToolbar.hide(),!e)return;const a=mt(e,o);ci(o,a)&&(s.transition("click",{point:a,shiftKey:!1}),this.update())}onResize(){const e=this.textInput.getValue(),i=this.textInput.getBBox();this.state.transition("resize",{textInputValue:e,bbox:i})}hoverTouchPreHandler(e){e.device==="touch"&&this.onHover(e)}dragMoveTouchPreHandler(e){e.device==="touch"&&this.ctx.interactionManager.isState(Ne.AnnotationsSelected)&&e.sourceEvent.preventDefault()}onDragStart(e){if(!this.ctx.interactionManager.isState(Ne.AnnotationsDraggable))return;const i=this.getAnnotationContext();if(!i)return;const o=ys.from(e),s=mt(o,i),n=this.textInput.getValue(),a=this.textInput.getBBox();this.state.transition("dragStart",{context:i,offset:o,point:s,textInputValue:n,bbox:a})}onDrag(e){if(!this.ctx.interactionManager.isState(Ne.AnnotationsDraggable))return;const i=this.getAnnotationContext();if(!i)return;const o=ys.from(e),s=mt(o,i),n=e.sourceEvent.shiftKey,a=this.textInput.getValue(),r=this.textInput.getBBox();this.state.transition("drag",{context:i,offset:o,point:s,shiftKey:n,textInputValue:a,bbox:r})}onDragEnd(){this.state.transition("dragEnd")}onCancel(e){const{sourceEvent:i}=e??{};i?.currentTarget===i?.target&&(this.cancel(),this.reset())}onDelete(){this.textInput.isVisible()||(this.cancel(),this.delete(),this.reset(),this.update())}onTextInput(e){const{state:i}=this,o=this.getAnnotationContext();if(!o)return;const{key:s,shiftKey:n}=e,a=this.textInput.getValue(),r=this.textInput.getBBox();i.transition("textInput",{key:s,shiftKey:n,textInputValue:a,bbox:r,context:o})}onKeyDown(e){const{state:i}=this,o=this.getAnnotationContext();if(!o)return;const{sourceEvent:s}=e,{shiftKey:n,ctrlKey:a,metaKey:r}=s,l=a||r,c=a||n;this.state.transition("keyDown",{shiftKey:n,context:o});const h={x:0,y:0},p=Math.max(o?.xAxis.scale.bandwidth??0,c?10:1),u=Math.max(o?.yAxis.scale.bandwidth??0,c?10:1);switch(s.key){case"ArrowDown":h.y=u;break;case"ArrowUp":h.y=-u;break;case"ArrowLeft":h.x=-p;break;case"ArrowRight":h.x=p;break;case"Escape":this.onCancel();return;case"Backspace":case"Delete":this.onDelete();return}if((h.x||h.y)&&(i.transition("translate",{translation:h}),s.stopPropagation(),s.preventDefault()),!!l)switch(s.key){case"c":i.transition("copy");return;case"x":i.transition("cut"),this.recordActionAfterNextUpdate("Cut annotation");return;case"v":i.transition("paste"),this.recordActionAfterNextUpdate("Paste annotation");return}}onKeyUp(e){const{shiftKey:i}=e.sourceEvent,o=this.getAnnotationContext();o&&(this.state.transition("keyUp",{shiftKey:i,context:o}),this.state.transition("translateEnd"))}clear(){this.cancel(),this.deleteAll(),this.reset()}reset(){this.state.transition("reset")}cancel(){this.state.transition("cancel")}delete(){this.state.transition("delete")}deleteAll(){this.state.transition("deleteAll")}deleteEphemeralAnnotations(){for(const[e,i]of this.annotationData.entries())Do(i)&&this.annotationData.splice(e,1)}hideOverlays(){this.settingsDialog.hide(),this.toolbar.hideOverlays(),this.optionsToolbar.hideOverlays()}pushAnnotationState(e){this.ctx.interactionManager.pushState(e),this.ctx.tooltipManager.suppressTooltip("annotations")}popAnnotationState(e){this.ctx.interactionManager.popState(e),this.ctx.tooltipManager.unsuppressTooltip("annotations")}isAnnotationState(){return this.ctx.interactionManager.isState(Ne.Annotations)||this.ctx.interactionManager.isState(Ne.AnnotationsSelected)}update(e=eC.PRE_SCENE_RENDER){this.ctx.updateService.update(e)}};d([iC((t,e,i)=>{const{ctx:{annotationManager:o,stateManager:s}}=t;e!==i&&(t.toolbar?.toggleVisibility(!!e),i===!1&&e===!0?s.restoreState(o):e===!1&&t.clear())}),xa(Kf)],gn.prototype,"enabled",2),d([xa(ud)],gn.prototype,"toolbar",2),d([xa(ud)],gn.prototype,"optionsToolbar",2),d([xa(ud)],gn.prototype,"axesButtons",2),d([xa(Kf)],gn.prototype,"snap",2);var cC=gn;import{_ModuleSupport as hC}from"ag-charts-community";var{FONT_SIZE_RATIO:dC,ThemeSymbols:Yt}=hC,qe={stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:2},ie={fill:Yt.DEFAULT_ANNOTATION_HANDLE_FILL,strokeOpacity:1,strokeWidth:2},fs={color:{$ref:"backgroundColor"},fontSize:{$rem:[dC.LARGE]},fontFamily:{$ref:"fontFamily"}},Uf={...fs,enabled:!0,fill:{$ref:"foregroundColor"},fontSize:{$ref:"fontSize"}},ol={...fs,textAlign:"left"},ms={...fs,position:"top",alignment:"center",color:{$ref:"textColor"}},Yf={...fs,position:"top",alignment:"center",color:{$ref:"textColor"}},gd={...fs,fontSize:{$ref:"fontSize"},color:Yt.DEFAULT_ANNOTATION_STATISTICS_COLOR,fill:Yt.DEFAULT_ANNOTATION_STATISTICS_FILL,stroke:Yt.DEFAULT_ANNOTATION_STATISTICS_STROKE,strokeWidth:1,divider:{stroke:Yt.DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE,strokeWidth:1,strokeOpacity:.5}},yd={...qe,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...ie},text:{...ms},statistics:{...gd}},pC={buttons:[{icon:"text-annotation",tooltip:"toolbarAnnotationsTextAnnotations",value:"text-menu"},{icon:"trend-line-drawing",tooltip:"toolbarAnnotationsLineAnnotations",value:"line-menu"},{icon:"arrow-drawing",tooltip:"toolbarAnnotationsShapeAnnotations",value:"shape-menu"},{icon:"delete",tooltip:"toolbarAnnotationsClearAll",value:"clear"}],padding:{$ref:"padding"}},uC={buttons:[{icon:"text-annotation",tooltip:"toolbarAnnotationsTextColor",value:"text-color"},{icon:"line-color",tooltip:"toolbarAnnotationsLineColor",value:"line-color"},{icon:"fill-color",tooltip:"toolbarAnnotationsFillColor",value:"fill-color"},{tooltip:"toolbarAnnotationsTextSize",value:"text-size"},{tooltip:"toolbarAnnotationsLineStrokeWidth",value:"line-stroke-width"},{icon:"line-style-solid",tooltip:"toolbarAnnotationsLineStyle",value:"line-style-type"},{icon:"settings",tooltip:"toolbarAnnotationsSettings",value:"settings"},{icon:"unlocked",tooltip:"toolbarAnnotationsLock",ariaLabel:"toolbarAnnotationsLock",checkedOverrides:{icon:"locked",tooltip:"toolbarAnnotationsUnlock"},value:"lock"},{icon:"delete",tooltip:"toolbarAnnotationsDelete",value:"delete"}]},gC={enabled:!1,line:{...qe,handle:{...ie},text:{...ms}},"horizontal-line":{...qe,handle:{...ie},axisLabel:{...Uf},text:{...ms}},"vertical-line":{...qe,handle:{...ie},axisLabel:{...Uf},text:{...ms}},"disjoint-channel":{...qe,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...ie},text:{...Yf}},"parallel-channel":{...qe,middle:{lineDash:[6,5],strokeWidth:1},background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...ie},text:{...Yf}},"fibonacci-retracement":{...qe,strokes:Yt.DEFAULT_FIBONACCI_STROKES,rangeStroke:{$ref:"foregroundColor"},handle:{...ie},text:{...ms,position:"center"},label:{...fs,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},"fibonacci-retracement-trend-based":{...qe,strokes:Yt.DEFAULT_FIBONACCI_STROKES,rangeStroke:{$ref:"foregroundColor"},handle:{...ie},text:{...ms,position:"center"},label:{...fs,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},callout:{...qe,...ol,color:{$ref:"textColor"},handle:{...ie},fill:{$ref:"foregroundColor"},fillOpacity:.075},comment:{...ol,fontWeight:700,handle:{...ie},fill:{$ref:"foregroundColor"}},note:{...ol,color:Yt.DEFAULT_TEXTBOX_COLOR,fill:Yt.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,stroke:{$ref:"backgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...ie},background:{fill:Yt.DEFAULT_TEXTBOX_FILL,stroke:Yt.DEFAULT_TEXTBOX_STROKE,strokeWidth:1}},text:{...ol,color:{$ref:"textColor"},handle:{...ie}},arrow:{...qe,handle:{...ie},text:{...ms}},"arrow-up":{fill:Yt.PALETTE_UP_FILL,handle:{...ie,stroke:{$ref:"foregroundColor"}}},"arrow-down":{fill:Yt.PALETTE_DOWN_FILL,handle:{...ie,stroke:{$ref:"foregroundColor"}}},"date-range":{...yd},"price-range":{...yd},"date-price-range":{...yd},"quick-date-price-range":{up:{...qe,fill:Yt.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,fillOpacity:.2,handle:{...ie},statistics:{...gd,color:"#fff",fill:Yt.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...qe,stroke:Yt.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE,fill:Yt.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,fillOpacity:.2,handle:{...ie,stroke:Yt.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE},statistics:{...gd,color:"#fff",fill:Yt.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{},toolbar:pC,optionsToolbar:uC},yC={type:"root",optionsKey:"annotations",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new cC(t),themeTemplate:{annotations:gC}};import{_ModuleSupport as fd}from"ag-charts-community";import{_ModuleSupport as jf}from"ag-charts-community";var{BaseProperties:fC,ObserveChanges:mC,ProxyProperty:xC,Validate:xs,NUMBER:sl,POSITIVE_NUMBER:Xf,RATIO:SC,calculatePlacement:bC,createElement:vC}=jf,wi=class extends fC{constructor(){super(),this.opacity=1,this.loadedSynchronously=!0,this.containerWidth=0,this.containerHeight=0,this.onLoad=void 0,this.onImageLoad=()=>{this.loadedSynchronously||(this.node.visible=!1,this.performLayout(this.containerWidth,this.containerHeight),this.onLoad?.())},this.imageElement=vC("img"),this.imageElement.onload=this.onImageLoad,this.node=new jf.Image(this.imageElement)}get complete(){return this.imageElement.width>0&&this.imageElement.height>0}performLayout(t,e){this.containerWidth=t,this.containerHeight=e;const i={width:t,height:e},o=bC(this.imageElement.width,this.imageElement.height,i,this);return this.node.setProperties(this.complete?{visible:!0,opacity:this.opacity,...o}:{visible:!1}),o}};d([xs(sl,{optional:!0})],wi.prototype,"top",2),d([xs(sl,{optional:!0})],wi.prototype,"right",2),d([xs(sl,{optional:!0})],wi.prototype,"bottom",2),d([xs(sl,{optional:!0})],wi.prototype,"left",2),d([xs(Xf,{optional:!0})],wi.prototype,"width",2),d([xs(Xf,{optional:!0})],wi.prototype,"height",2),d([xs(SC)],wi.prototype,"opacity",2),d([xC("imageElement.src"),mC(t=>t.loadedSynchronously=t.complete)],wi.prototype,"url",2);var{ActionOnSet:MC,OBJECT:kC,Validate:AC}=fd,$f=class extends fd.Background{constructor(){super(...arguments),this.image=new wi}onLayoutComplete(t){if(super.onLayoutComplete(t),this.image){const{width:e,height:i}=t.chart;this.image.performLayout(e,i)}}onImageLoad(){this.ctx.updateService.update(fd.ChartUpdateType.SCENE_RENDER)}};d([AC(kC,{optional:!0}),MC({newValue(t){this.node.appendChild(t.node),t.onLoad=()=>this.onImageLoad()},oldValue(t){this.node.removeChild(t.node),t.onLoad=void 0}})],$f.prototype,"image",2);var IC={type:"root",optionsKey:"background",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new $f(t)};import"ag-charts-community";import{_ModuleSupport as Zf}from"ag-charts-community";var{BOOLEAN:DC,ActionOnSet:TC,LayoutElement:CC,Menu:NC,Validate:OC}=Zf,md=[{label:"toolbarSeriesTypeOHLC",icon:"ohlc-series",value:"ohlc"},{label:"toolbarSeriesTypeCandles",icon:"candlestick-series",value:"candlestick"},{label:"toolbarSeriesTypeHollowCandles",icon:"hollow-candlestick-series",value:"hollow-candlestick"},{label:"toolbarSeriesTypeLine",icon:"line-series",value:"line"},{label:"toolbarSeriesTypeStepLine",icon:"step-line-series",value:"step-line"},{label:"toolbarSeriesTypeHLC",icon:"hlc-series",value:"hlc"},{label:"toolbarSeriesTypeHighLow",icon:"high-low-series",value:"high-low"}],Qf=class extends Zf.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!1,this.menu=new NC(this.ctx,"chart-toolbar"),this.toolbar=t.sharedToolbar.getSharedToolbar("chartToolbar"),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPressed.bind(this)),t.layoutManager.registerElement(CC.ToolbarLeft,this.onLayoutStart.bind(this)),()=>this.toolbar.destroy())}onLayoutStart(t){this.enabled&&(this.updateButton(),this.toolbar.layout(t.layoutBox))}onButtonPressed({event:t,buttonBounds:e}){this.menu.setAnchor({x:e.x+e.width+6,y:e.y}),this.menu.show({items:md,menuItemRole:"menuitemradio",ariaLabel:this.ctx.localeManager.t("toolbarSeriesTypeDropdown"),class:"ag-charts-chart-toolbar__menu",value:this.getChartType(),sourceEvent:t.sourceEvent,onPress:i=>{this.setChartType(i.value),this.hidePopover()},onHide:()=>{this.toolbar.clearActiveButton()}}),this.toolbar.toggleActiveButtonByIndex(0)}updateButton(){const t=this.getChartType(),e=md.find(i=>i.value===t)?.icon;e!=null&&this.toolbar.updateButtons([{icon:e,tooltip:"toolbarSeriesTypeDropdown"}])}hidePopover(){this.toolbar.clearActiveButton(),this.menu.hide()}setChartType(t){const e={chartType:t};this.ctx.chartService.publicApi?.updateDelta(e).catch(i=>lt.error(i))}getChartType(){const t=this.ctx.chartService.publicApi?.getOptions()?.chartType;return t==null||!md.some(e=>e.value===t)?"candlestick":t}};d([OC(DC),TC({changeValue(t){this.toolbar?.setHidden(!t)}})],Qf.prototype,"enabled",2);var LC={type:"root",optionsKey:"chartToolbar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new Qf(t)};import{_ModuleSupport as RC}from"ag-charts-community";import{_ModuleSupport as yn}from"ag-charts-community";var nl="ag-charts-context-menu",al="ag-charts-dark-context-menu",{BOOLEAN:qf,Validate:Jf,initMenuKeyNav:EC,makeAccessibleClickListener:wC,ContextMenuRegistry:Sa,createElement:xd}=yn,Sd="context-menu";function PC(t,e){const{children:i}=t??{};if(!i)return[];const o=[];for(const s of Array.from(i))s instanceof e&&o.push(s);return o}var bd=class extends yn.BaseModuleInstance{constructor(t){if(super(),this.ctx=t,this.enabled=!0,this.darkTheme=!1,this.extraActions=[],this.extraNodeActions=[],this.extraSeriesAreaActions=[],this.extraLegendItemActions=[],this.pickedNode=void 0,this.showEvent=void 0,this.x=0,this.y=0,this.interactionManager=t.interactionManager,this.registry=t.contextMenuRegistry,this.groups={default:[],extra:[],extraSeriesArea:[],extraNode:[],extraLegendItem:[]},this.element=t.domManager.addChild("canvas-overlay",Sd),this.element.classList.add(nl),this.element.addEventListener("contextmenu",e=>e.preventDefault()),this.destroyFns.push(()=>this.element.parentNode?.removeChild(this.element)),this.doClose(),this.destroyFns.push(t.domManager.addListener("hidden",()=>this.hide())),typeof MutationObserver<"u"){const e=new MutationObserver(()=>{this.menuElement&&this.element.contains(this.menuElement)&&this.reposition()});e.observe(this.element,{childList:!0}),this.mutationObserver=e,this.destroyFns.push(()=>e.disconnect())}this.destroyFns.push(this.registry.registerDefaultAction({id:"download",type:"all",label:"contextMenuDownload",action:()=>{const e=t.chartService.title;let i="image";e?.enabled&&e?.text!==void 0&&(i=e.text.replace(/\.+/,"")),this.ctx.chartService.publicApi?.download({fileName:i}).catch(o=>{lt.error("Unable to download chart",o)})}})),this.destroyFns.push(this.registry.addListener(e=>this.onContext(e)))}onContext(t){if(!this.enabled)return;t.sourceEvent.preventDefault(),this.showEvent=t.sourceEvent,this.x=t.x,this.y=t.y,this.groups.default=this.registry.filterActions(t.type);for(const r of this.groups.default)r.id==null||r.toggleEnabledOnShow==null||(r.toggleEnabledOnShow(t)?this.registry.enableAction(r.id):this.registry.disableAction(r.id));this.pickedNode=void 0,this.pickedLegendItem=void 0,this.groups.extra=this.extraActions.map(({label:r,action:l})=>({type:"all",label:r,action:l})),this.groups.extraSeriesArea=[],this.groups.extraNode=[],Sa.check("series-area",t)&&(this.pickedNode=t.context.pickedNode,this.groups.extraSeriesArea=this.extraSeriesAreaActions.map(({label:r,action:l})=>({type:"series-area",label:r,action:l})),this.pickedNode&&(this.groups.extraNode=this.extraNodeActions.map(({label:r,action:l})=>({type:"node",label:r,action:l})))),this.groups.extraLegendItem=[],Sa.check("legend",t)&&(this.pickedLegendItem=t.context.legendItem,this.pickedLegendItem&&(this.groups.extraLegendItem=this.extraLegendItemActions.map(({label:r,action:l})=>({type:"legend",label:r,action:l}))));const{default:e,extra:i,extraSeriesArea:o,extraNode:s,extraLegendItem:n}=this.groups;[e,i,o,s,n].reduce((r,l)=>l.length+r,0)!==0&&this.show(t.sourceEvent)}show(t){this.interactionManager.pushState(yn.InteractionState.ContextMenu),this.element.classList.toggle(al,this.darkTheme);const e=this.renderMenu();this.menuCloser?.close(),this.menuElement?this.element.replaceChild(e,this.menuElement):this.element.appendChild(e),this.menuElement=e,this.element.style.display="block";const i=t.pointerType==="touch"?!1:void 0,o=PC(e,HTMLButtonElement);this.menuCloser=EC({menu:e,buttons:o,orientation:"vertical",sourceEvent:t,overrideFocusVisible:i,autoCloseOnBlur:!0,closeCallback:()=>this.doClose()}),t.pointerType==="touch"&&this.ctx.chartService.overrideFocusVisible(!1)}hide(){this.menuCloser?.close()}doClose(){this.interactionManager.popState(yn.InteractionState.ContextMenu),this.menuElement&&(this.element.removeChild(this.menuElement),this.menuElement=void 0,this.menuCloser=void 0),this.element.style.display="none"}renderMenu(){const t=xd("div");return t.classList.add(`${nl}__menu`),t.classList.toggle(al,this.darkTheme),t.role="menu",this.appendMenuGroup(t,this.groups.default,!1),this.appendMenuGroup(t,this.groups.extra),this.appendMenuGroup(t,this.groups.extraSeriesArea),this.pickedNode&&this.appendMenuGroup(t,this.groups.extraNode),this.pickedLegendItem&&this.appendMenuGroup(t,this.groups.extraLegendItem),t}appendMenuGroup(t,e,i=!0){e.length!==0&&(i&&t.appendChild(this.createDividerElement()),e.forEach(o=>{const s=this.renderItem(o);s&&t.appendChild(s)}))}renderItem(t){if(t&&typeof t=="object"&&t.constructor===Object)return this.createActionElement(t)}createDividerElement(){const t=xd("div");return t.classList.add(`${nl}__divider`),t.classList.toggle(al,this.darkTheme),t.role="separator",t}createActionElement({id:t,label:e,type:i,action:o}){const s=!!(t&&this.registry.isDisabled(t));return this.createButtonElement(i,e,o,s)}createButtonOnClick(t,e){return Sa.checkCallback("legend",t,e)?i=>{if(this.pickedLegendItem){const{seriesId:o,itemId:s}=this.pickedLegendItem;e({type:"contextmenu",seriesId:o,itemId:s,event:i}),this.hide()}}:Sa.checkCallback("series-area",t,e)?()=>{e({type:"seriesContextMenuAction",event:this.showEvent}),this.hide()}:Sa.checkCallback("node",t,e)?()=>{const{pickedNode:i,showEvent:o}=this,s=i?.series.createNodeContextMenuActionEvent(o,i);s?e(s):lt.error("series node not found"),this.hide()}:()=>{e({type:"contextMenuEvent",event:this.showEvent}),this.hide()}}createButtonElement(t,e,i,o){const s=xd("button");return s.classList.add(`${nl}__item`),s.classList.toggle(al,this.darkTheme),s.ariaDisabled=o.toString(),s.textContent=this.ctx.localeManager.t(e),s.role="menuitem",s.onclick=wC(s,this.createButtonOnClick(t,i)),s.addEventListener("mouseover",()=>s.focus({preventScroll:!0})),s}reposition(){let{x:t,y:e}=this;this.element.style.top="unset",this.element.style.bottom="unset";const i=this.ctx.domManager.getBoundingClientRect(),{offsetWidth:o,offsetHeight:s}=this.element;t=yn.clamp(0,t,i.width-o),e=yn.clamp(0,e,i.height-s),this.element.style.left=`${t}px`,this.element.style.top=`calc(${e}px - 0.5em)`}destroy(){super.destroy(),this.mutationObserver?.disconnect(),this.ctx.domManager.removeStyles(Sd),this.ctx.domManager.removeChild("canvas-overlay",Sd)}};d([Jf(qf)],bd.prototype,"enabled",2),d([Jf(qf)],bd.prototype,"darkTheme",2);var _C={type:"root",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],optionsKey:"contextMenu",moduleFactory:t=>new bd(t),themeTemplate:{contextMenu:{enabled:!0,darkTheme:RC.ThemeSymbols.IS_DARK_THEME}}};import"ag-charts-community";import{_ModuleSupport as fn}from"ag-charts-community";import{_ModuleSupport as vd}from"ag-charts-community";var{BaseProperties:BC,BOOLEAN:tm,FUNCTION:em,NUMBER:rl,STRING:im,Validate:Pi,createId:zC,setAttribute:VC}=vd,FC="ag-charts-crosshair-label",mn=class extends vd.ChangeDetectableProperties{constructor(){super(...arguments),this.enabled=!0,this.xOffset=0,this.yOffset=0,this.format=void 0,this.renderer=void 0}};d([Pi(tm)],mn.prototype,"enabled",2),d([Pi(rl)],mn.prototype,"xOffset",2),d([Pi(rl)],mn.prototype,"yOffset",2),d([Pi(im,{optional:!0})],mn.prototype,"format",2),d([Pi(em,{optional:!0})],mn.prototype,"renderer",2);var xn=class extends BC{constructor(t,e,i){super(),this.domManager=t,this.id=zC(this),this.enabled=!0,this.xOffset=0,this.yOffset=0,this.renderer=void 0,this.element=t.addChild("canvas-overlay",`crosshair-label-${this.id}`),this.element.classList.add(FC),VC(this.element,"aria-hidden",!0),this.element.setAttribute("data-key",e),this.element.setAttribute("data-axis-id",i)}show(t){const{element:e}=this,i=t.x+this.xOffset,o=t.y+this.yOffset;e.style.top=`${Math.round(o)}px`,e.style.left=`${Math.round(i)}px`,this.toggle(!0)}setLabelHtml(t){t!==void 0&&(this.element.innerHTML=t)}getBBox(){const{element:t}=this;return new vd.BBox(t.clientLeft,t.clientTop,t.clientWidth,t.clientHeight)}toggle(t){this.element.classList.toggle("ag-charts-crosshair-label--hidden",!t)}destroy(){this.domManager.removeChild("canvas-overlay",`crosshair-label-${this.id}`)}toLabelHtml(t,e){if(typeof t=="string")return t;e=e??{};const{text:i=e.text??"",color:o=e.color,backgroundColor:s=e.backgroundColor,opacity:n=e.opacity??1}=t;return`
${i}
`}};d([Pi(tm)],xn.prototype,"enabled",2),d([Pi(rl)],xn.prototype,"xOffset",2),d([Pi(rl)],xn.prototype,"yOffset",2),d([Pi(im,{optional:!0})],xn.prototype,"format",2),d([Pi(em,{optional:!0})],xn.prototype,"renderer",2);var{Group:GC,TranslatableGroup:WC,Line:om,BBox:sm,createId:HC,POSITIVE_NUMBER:nm,RATIO:KC,BOOLEAN:am,COLOR_STRING:UC,LINE_DASH:YC,OBJECT:jC,InteractionState:ll,Validate:Vo,ZIndexMap:rm,formatNumber:XC,isInteger:$C,ChartAxisDirection:lm}=fn,oo=class extends fn.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.id=HC(this),this.enabled=!1,this.stroke="rgb(195, 195, 195)",this.lineDash=[6,3],this.lineDashOffset=0,this.strokeWidth=1,this.strokeOpacity=1,this.snap=!0,this.label=new mn,this.seriesRect=new sm(0,0,0,0),this.bounds=new sm(0,0,0,0),this.crosshairGroup=new WC({name:"crosshairs",zIndex:rm.SERIES_CROSSHAIR}),this.lineGroup=this.crosshairGroup.appendChild(new GC({name:`${this.id}-crosshair-lines`,zIndex:rm.SERIES_CROSSHAIR})),this.lineGroupSelection=fn.Selection.select(this.lineGroup,om,!1),this.activeHighlight=void 0,this.axisCtx=t.parent,this.labels={},this.hideCrosshairs(),t.domManager.addEventListener("focusin",({target:e})=>{const i=e instanceof HTMLElement&&t.domManager.contains(e,"series-area");this.crosshairGroup.visible&&!i&&(this.hideCrosshairs(),this.ctx.updateService.update(fn.ChartUpdateType.PERFORM_LAYOUT))}),this.destroyFns.push(t.scene.attachNode(this.crosshairGroup),t.widgets.seriesWidget.addListener("mousemove",e=>this.onMouseHoverLike(e)),t.widgets.seriesWidget.addListener("drag-move",e=>this.onMouseHoverLike(e)),t.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseOut()),t.widgets.seriesDragInterpreter.addListener("click",e=>this.onClick(e)),t.chartEventManager.addListener("series-focus-change",()=>this.onKeyPress()),t.zoomManager.addListener("zoom-pan-start",()=>this.onMouseOut()),t.zoomManager.addListener("zoom-change",()=>this.onMouseOut()),t.highlightManager.addListener("highlight-change",e=>this.onHighlightChange(e)),t.layoutManager.addListener("layout:complete",e=>this.layout(e)),()=>Object.entries(this.labels).forEach(([e,i])=>i.destroy()))}layout({series:{rect:t,visible:e},axes:i}){if(!e||!i||!this.enabled)return;this.seriesRect=t;const{position:o="left",axisId:s}=this.axisCtx,n=i.find(c=>c.id===s);if(!n)return;this.axisLayout=n,this.bounds=t.clone().grow(n.gridPadding+n.seriesAreaPadding,o);const{crosshairGroup:a,bounds:r}=this;a.translationX=Math.round(r.x),a.translationY=Math.round(r.y);const l=["pointer",...this.axisCtx.seriesKeyProperties()];this.updateSelections(l),this.updateLines(),this.updateLabels(l)}updateSelections(t){this.lineGroupSelection.update(t,e=>e.append(new om),e=>e)}updateLabels(t){const{labels:e,ctx:i}=this;for(const o of t)this.label.enabled&&(e[o]??(e[o]=new xn(i.domManager,o,this.axisCtx.axisId))),e[o]&&this.updateLabel(e[o]);this.labelFormatter=this.axisCtx.scaleValueFormatter(this.label.format)}updateLabel(t){const{enabled:e,xOffset:i,yOffset:o,format:s,renderer:n}=this.label;t.enabled=e,t.xOffset=i,t.yOffset=o,t.format=s,t.renderer=n}updateLines(){const{lineGroupSelection:t,bounds:e,stroke:i,strokeWidth:o,strokeOpacity:s,lineDash:n,lineDashOffset:a,axisLayout:r}=this;if(!r)return;const l=this.isVertical();t.each(c=>{c.stroke=i,c.strokeWidth=o,c.strokeOpacity=s,c.lineDash=n,c.lineDashOffset=a,c.y1=0,c.y2=l?e.height:0,c.x1=0,c.x2=l?0:e.width})}isVertical(){return this.axisCtx.direction===lm.X}isHover(t){return t.type==="mousemove"||t.type==="click"||t.device==="touch"&&this.ctx.chartService.touch.dragAction==="hover"}formatValue(t){const{labelFormatter:e,axisLayout:i,ctx:{callbackCache:o}}=this;if(e){const s=o.call(e,t);if(s!=null)return s}if(typeof t=="number"){const s=(i?.label.fractionDigits??0)+($C(t)?0:1);return XC(t,s)}return String(t??"")}onClick(t){t.device==="touch"&&this.onMouseHoverLike(t)}onMouseHoverLike(t){if(!this.enabled||this.snap)return;const e=this.isHover(t)?ll.Clickable:ll.AnnotationsMoveable;this.ctx.interactionManager.isState(e)&&(this.updatePositions(this.getData(t)),this.crosshairGroup.visible=!0,this.ctx.updateService.update(fn.ChartUpdateType.SCENE_RENDER))}onMouseOut(){this.ctx.interactionManager.isState(ll.Clickable)&&(this.hideCrosshairs(),this.ctx.updateService.update(fn.ChartUpdateType.SCENE_RENDER))}onKeyPress(){this.enabled&&!this.snap&&this.ctx.interactionManager.isState(ll.Default)&&this.hideCrosshairs()}onHighlightChange(t){if(!this.enabled)return;const{crosshairGroup:e,axisCtx:i}=this,{datum:o,series:s}=t.currentHighlight??{},n=o&&(s?.axes.x?.id===i.axisId||s?.axes.y?.id===i.axisId);if(this.activeHighlight=n?t.currentHighlight:void 0,!this.activeHighlight)this.hideCrosshairs();else if(this.snap){const a=this.getActiveHighlightData(this.activeHighlight);this.updatePositions(a),e.visible=!0}}isInRange(t){return this.axisCtx.inRange(t)}updatePositions(t){const{seriesRect:e,lineGroupSelection:i}=this;i.each((o,s)=>{const n=t[s];if(!n){o.visible=!1,this.hideLabel(s);return}o.visible=!0;const{value:a,position:r}=n;let l=0,c=0;this.isVertical()?(l=r,o.x=Math.round(l)):(c=r,o.y=Math.round(c)),this.label.enabled?this.showLabel(l+e.x,c+e.y,a,s):this.hideLabel(s)})}getData(t){const{axisCtx:e}=this,i="pointer",{datum:o,xKey:s="",yKey:n=""}=this.activeHighlight??{},{currentX:a,currentY:r}=t,l=this.isVertical(),c=l?a:r;let h=o?.[l?s:n]??"";return e.continuous&&(h=e.scaleInvert(c)),{[i]:{position:c,value:h}}}getActiveHighlightData(t){const{axisCtx:e}=this,{datum:i,series:o,xKey:s="",aggregatedValue:n,cumulativeValue:a,midPoint:r}=t,l=o.getKeyProperties(e.direction),c=(e.scale.bandwidth??0)/2,h=o.axes[e.direction]?.id===e.axisId,p=l.indexOf("yKey")>-1&&h,u=l.indexOf("xKey")>-1&&h,g=n??a;if(p&&g!==void 0){const f=e.scale.convert(g)+c;return this.isInRange(f)?{yKey:{value:g,position:f}}:{}}if(u){const f=(this.isVertical()?r?.x:r?.y)??0,m=e.continuous?e.scaleInvert(f):i[s];return this.isInRange(f)?{xKey:{value:m,position:f}}:{}}const y={};return l.forEach(f=>{const m=o.properties[f],x=i[m],v=e.scale.convert(x)+c;this.isInRange(v)&&(y[f]={value:x,position:v})}),y}getLabelHtml(t,e){const i=this.axisLayout?.label?.fractionDigits??0,o={text:this.formatValue(t)};return this.label.renderer?e.toLabelHtml(this.label.renderer({value:t,fractionDigits:i}),o):e.toLabelHtml(o)}showLabel(t,e,i,o){if(!this.axisLayout)return;const{bounds:s}=this,n=this.labels[o],a=this.getLabelHtml(i,n);n.setLabelHtml(a);const{width:r,height:l}=n.getBBox(),c=this.axisCtx.position;let h=this.axisLayout.label.spacing+this.axisLayout.tickSize;this.axisCtx.direction===lm.X?(h-=4,n.show({x:t-r/2,y:c==="bottom"?s.y+s.height+h:s.y-l-h})):(h-=8,n.show({x:c==="right"?s.x+s.width+h:s.x-r-h,y:e-l/2}))}hideCrosshairs(){this.crosshairGroup.visible=!1;for(const t of Object.keys(this.labels))this.hideLabel(t)}hideLabel(t){this.labels[t]?.toggle(!1)}};d([Vo(am)],oo.prototype,"enabled",2),d([Vo(UC,{optional:!0})],oo.prototype,"stroke",2),d([Vo(YC,{optional:!0})],oo.prototype,"lineDash",2),d([Vo(nm)],oo.prototype,"lineDashOffset",2),d([Vo(nm)],oo.prototype,"strokeWidth",2),d([Vo(KC)],oo.prototype,"strokeOpacity",2),d([Vo(am)],oo.prototype,"snap",2),d([Vo(jC)],oo.prototype,"label",2);var ZC={type:"axis-option",optionsKey:"crosshair",packageType:"enterprise",chartTypes:["cartesian"],axisTypes:["category","ordinal-time","number","log","time"],moduleFactory:t=>new oo(t),themeTemplate:{crosshair:{snap:!0,stroke:{$ref:"subtleTextColor"},strokeWidth:1,strokeOpacity:1,lineDash:[5,6],lineDashOffset:0,label:{enabled:!0}}}};import{_ModuleSupport as cm}from"ag-charts-community";var{BOOLEAN:QC,FUNCTION:qC,ActionOnSet:ba,Validate:hm}=cm,Sn=class extends cm.BaseModuleInstance{constructor(t){super(),this.enabled=!1,this.getData=()=>Promise.resolve(),this.dataService=t.dataService}updateCallback(t,e){this.dataService&&(t&&e!=null?this.dataService.updateCallback(e):this.dataService.clearCallback())}};d([ba({newValue(t){this.updateCallback(t,this.getData)}}),hm(QC)],Sn.prototype,"enabled",2),d([ba({newValue(t){this.updateCallback(this.enabled,t)}}),hm(qC)],Sn.prototype,"getData",2),d([ba({newValue(t){this.dataService.requestThrottle=t}})],Sn.prototype,"requestThrottle",2),d([ba({newValue(t){this.dataService.dispatchThrottle=t}})],Sn.prototype,"updateThrottle",2),d([ba({newValue(t){this.dataService.dispatchOnlyLatest=!t}})],Sn.prototype,"updateDuringInteraction",2);var JC={type:"root",optionsKey:"dataSource",packageType:"enterprise",chartTypes:["cartesian","hierarchy","polar","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new Sn(t),themeTemplate:{dataSource:{enabled:!1}}};import{AgErrorBarSupportedSeriesTypes as tN}from"ag-charts-community";import{AgErrorBarSupportedSeriesTypes as dm,_ModuleSupport as Md}from"ag-charts-community";import{_ModuleSupport as va}from"ag-charts-community";var{nearestSquaredInContainer:eN,partialAssign:iN,mergeDefaults:pm,BBox:so}=va,oN=class{constructor(t){this.components=t,this.union=so.merge(t)}containsPoint(t,e){if(!this.union.containsPoint(t,e))return!1;for(const i of this.components)if(i.containsPoint(t,e))return!0;return!1}},sN=class extends va.Group{constructor(){super(),this.capLength=NaN,this._datum=void 0,this.whiskerPath=new va.Path,this.capsPath=new va.Path,this.bboxes=new oN([]),this.append([this.whiskerPath,this.capsPath])}get datum(){return this._datum}set datum(t){this._datum=t}calculateCapLength(t,e){const{lengthRatio:i=1,length:o}=t,{lengthRatioMultiplier:s,lengthMax:n}=e,a=o??i*s;return Math.min(a,n)}getItemStylerParams(t,e,i){const{datum:o}=this;if(o==null||t.itemStyler==null)return;const{xLowerKey:s,xUpperKey:n,yLowerKey:a,yUpperKey:r}=t;return{...e,datum:o.datum,seriesId:o.datum.seriesId,xKey:o.xKey,yKey:o.yKey,xLowerKey:s,xUpperKey:n,yLowerKey:a,yUpperKey:r,highlighted:i}}formatStyles(t,e,i){let{cap:o,...s}=t;const n=this.getItemStylerParams(e,t,i);if(n!=null&&e.itemStyler!=null){const a=e.itemStyler(n);s=pm(a,s),o=pm(a?.cap,a,o)}return{whiskerStyle:s,capsStyle:o}}applyStyling(t,e){iN(["visible","stroke","strokeWidth","strokeOpacity","lineDash","lineDashOffset"],t,e)}update(t,e,i){if(this.datum===void 0)return;const{whiskerStyle:o,capsStyle:s}=this.formatStyles(t,e,i),{xBar:n,yBar:a,capDefaults:r}=this.datum,l=this.whiskerPath;this.applyStyling(l,o),l.path.clear(!0),a!==void 0&&(l.path.moveTo(a.lowerPoint.x,a.lowerPoint.y),l.path.lineTo(a.upperPoint.x,a.upperPoint.y)),n!==void 0&&(l.path.moveTo(n.lowerPoint.x,n.lowerPoint.y),l.path.lineTo(n.upperPoint.x,n.upperPoint.y)),l.path.closePath(),this.capLength=this.calculateCapLength(s??{},r);const c=this.capLength/2,h=this.capsPath;this.applyStyling(h,s),h.path.clear(!0),a!==void 0&&(h.path.moveTo(a.lowerPoint.x-c,a.lowerPoint.y),h.path.lineTo(a.lowerPoint.x+c,a.lowerPoint.y),h.path.moveTo(a.upperPoint.x-c,a.upperPoint.y),h.path.lineTo(a.upperPoint.x+c,a.upperPoint.y)),n!==void 0&&(h.path.moveTo(n.lowerPoint.x,n.lowerPoint.y-c),h.path.lineTo(n.lowerPoint.x,n.lowerPoint.y+c),h.path.moveTo(n.upperPoint.x,n.upperPoint.y-c),h.path.lineTo(n.upperPoint.x,n.upperPoint.y+c)),h.path.closePath()}updateBBoxes(){const{capLength:t,whiskerPath:e,capsPath:i}=this,{yBar:o,xBar:s}=this.datum??{},n=t/2,a=[];if(o!==void 0){const r=o.lowerPoint.y-o.upperPoint.y;a.push(new so(o.lowerPoint.x,o.upperPoint.y,e.strokeWidth,r),new so(o.lowerPoint.x-n,o.lowerPoint.y,t,i.strokeWidth),new so(o.upperPoint.x-n,o.upperPoint.y,t,i.strokeWidth))}if(s!==void 0){const r=s.upperPoint.x-s.lowerPoint.x;a.push(new so(s.lowerPoint.x,s.upperPoint.y,r,e.strokeWidth),new so(s.lowerPoint.x,s.lowerPoint.y-n,i.strokeWidth,t),new so(s.upperPoint.x,s.upperPoint.y-n,i.strokeWidth,t))}this.bboxes.components=a,this.bboxes.union=so.merge(a)}containsPoint(t,e){return this.bboxes.containsPoint(t,e)}pickNode(t,e){return this.containsPoint(t,e)?this:void 0}nearestSquared(t,e,i){const{bboxes:o}=this;if(o.union.distanceSquared(t,e)>i)return{nearest:void 0,distanceSquared:1/0};const{distanceSquared:s}=so.nearestBox(t,e,o.components);return{nearest:this,distanceSquared:s}}},nN=class extends va.Group{nearestSquared(t,e){const{nearest:i,distanceSquared:o}=eN(t,e,{children:this.children()});if(i!==void 0&&!isNaN(o))return{datum:i.datum,distanceSquared:o}}};import{_ModuleSupport as aN}from"ag-charts-community";var{BaseProperties:um,Validate:St,BOOLEAN:gm,COLOR_STRING:ym,FUNCTION:rN,LINE_DASH:fm,NUMBER:lN,OBJECT:cN,POSITIVE_NUMBER:cl,RATIO:kd,STRING:Fo}=aN,no=class extends um{};d([St(gm,{optional:!0})],no.prototype,"visible",2),d([St(ym,{optional:!0})],no.prototype,"stroke",2),d([St(cl,{optional:!0})],no.prototype,"strokeWidth",2),d([St(kd,{optional:!0})],no.prototype,"strokeOpacity",2),d([St(fm,{optional:!0})],no.prototype,"lineDash",2),d([St(cl,{optional:!0})],no.prototype,"lineDashOffset",2),d([St(lN,{optional:!0})],no.prototype,"length",2),d([St(kd,{optional:!0})],no.prototype,"lengthRatio",2);var oe=class extends um{constructor(){super(...arguments),this.visible=!0,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.cap=new no}};d([St(Fo,{optional:!0})],oe.prototype,"yLowerKey",2),d([St(Fo,{optional:!0})],oe.prototype,"yLowerName",2),d([St(Fo,{optional:!0})],oe.prototype,"yUpperKey",2),d([St(Fo,{optional:!0})],oe.prototype,"yUpperName",2),d([St(Fo,{optional:!0})],oe.prototype,"xLowerKey",2),d([St(Fo,{optional:!0})],oe.prototype,"xLowerName",2),d([St(Fo,{optional:!0})],oe.prototype,"xUpperKey",2),d([St(Fo,{optional:!0})],oe.prototype,"xUpperName",2),d([St(gm,{optional:!0})],oe.prototype,"visible",2),d([St(ym,{optional:!0})],oe.prototype,"stroke",2),d([St(cl,{optional:!0})],oe.prototype,"strokeWidth",2),d([St(kd,{optional:!0})],oe.prototype,"strokeOpacity",2),d([St(fm,{optional:!0})],oe.prototype,"lineDash",2),d([St(cl,{optional:!0})],oe.prototype,"lineDashOffset",2),d([St(rN,{optional:!0})],oe.prototype,"itemStyler",2),d([St(cN)],oe.prototype,"cap",2);var{fixNumericExtent:hN,groupAccumulativeValueProperty:dN,mergeDefaults:pN,valueProperty:hl,ChartAxisDirection:Ad}=Md;function uN(t){for(const e of dm)if(e===t.series.type)return t.series;throw new Error(`AG Charts - unsupported series type '${t.series.type}', error bars supported series types: ${dm.join(", ")}`)}var gN=class ar extends Md.BaseModuleInstance{constructor(e){super(),this.properties=new oe;const i=uN(e),{annotationGroup:o,annotationSelections:s}=i;this.cartesianSeries=i,this.groupNode=new nN({name:`${o.id}-errorBars`}),o.appendChild(this.groupNode),this.selection=Md.Selection.select(this.groupNode,()=>this.errorBarFactory()),s.add(this.selection),i.addEventListener("seriesVisibilityChange",n=>this.onToggleSeriesItem(n)),this.destroyFns.push(i.addListener("data-processed",n=>this.onDataProcessed(n)),i.addListener("data-update",n=>this.onDataUpdate(n)),e.highlightManager.addListener("highlight-change",n=>this.onHighlightChange(n)),()=>o.removeChild(this.groupNode),()=>s.delete(this.selection))}hasErrorBars(){const{xLowerKey:e,xUpperKey:i,yLowerKey:o,yUpperKey:s}=this.properties;return ee(e)&&ee(i)||ee(o)&&ee(s)}isStacked(){const e=this.cartesianSeries.seriesGrouping?.stackCount;return e==null?!1:e>0}getUnstackPropertyDefinition(e){const i=[],{xLowerKey:o,xUpperKey:s,yLowerKey:n,yUpperKey:a,xErrorsID:r,yErrorsID:l}=this.getMaybeFlippedKeys(),{xScaleType:c,yScaleType:h}=e;return n!=null&&a!=null&&i.push(hl(n,h,{id:`${l}-lower`}),hl(a,h,{id:`${l}-upper`})),o!=null&&s!=null&&i.push(hl(o,c,{id:`${r}-lower`}),hl(s,c,{id:`${r}-upper`})),i}getStackPropertyDefinition(e){const i=[],{cartesianSeries:o}=this,{xLowerKey:s,xUpperKey:n,yLowerKey:a,yUpperKey:r,xErrorsID:l,yErrorsID:c}=this.getMaybeFlippedKeys(),{xScaleType:h,yScaleType:p}=e,u=o.seriesGrouping?.groupIndex??o.id,g={invalidValue:null,missingValue:0,separateNegative:!0,...o.visible?{}:{forceValue:0}},y=(m,x,v,S)=>dN(m,"normal","current",{id:`${x}-${v}`,groupId:`errorGroup-${u}-${v}`,...g},S),f=(m,x,v,S)=>{i.push(...y(m,v,"lower",S),...y(x,v,"upper",S))};return a!=null&&r!=null&&f(a,r,c,p),s!=null&&n!=null&&f(s,n,l,h),i}getPropertyDefinitions(e){return this.isStacked()?this.getStackPropertyDefinition(e):this.getUnstackPropertyDefinition(e)}onDataProcessed(e){this.dataModel=e.dataModel,this.processedData=e.processedData}getDomain(e){const{xLowerKey:i,xUpperKey:o,xErrorsID:s,yLowerKey:n,yUpperKey:a,yErrorsID:r}=this.getMaybeFlippedKeys();if(e===Ad.X?ee(i)&&ee(o):ee(n)&&ee(a)){const{dataModel:c,processedData:h,cartesianSeries:p}=this;if(c!=null&&h!=null){const u={x:s,y:r}[e],g=c.getDomain(p,`${u}-lower`,"value",h),y=c.getDomain(p,`${u}-upper`,"value",h),f=[Math.min(...g,...y),Math.max(...g,...y)];return hN(f)}}return[]}onDataUpdate(e){this.dataModel=e.dataModel,this.processedData=e.processedData,ee(e.dataModel)&&ee(e.processedData)&&(this.createNodeData(),this.update())}getNodeData(){return this.hasErrorBars()?this.cartesianSeries.contextNodeData?.nodeData:void 0}createNodeData(){const e=this.getNodeData(),i=this.cartesianSeries.axes[Ad.X]?.scale,o=this.cartesianSeries.axes[Ad.Y]?.scale;if(!(!i||!o||!e))for(let s=0;sthis.updateNode(i,o,s)))}updateNode(e,i,o){e.datum=i,e.update(this.getDefaultStyle(),this.properties,!1),e.updateBBoxes()}pickNodeExact(e){const{x:i,y:o}=e,s=this.groupNode.pickNode(i,o);if(s!=null)return{datum:s.datum,distanceSquared:0}}pickNodeNearest(e){return this.groupNode.nearestSquared(e.x,e.y)}pickNodeMainAxisFirst(e){return this.groupNode.nearestSquared(e.x,e.y)}getTooltipParams(){const{xLowerKey:e,xUpperKey:i,yLowerKey:o,yUpperKey:s,xLowerName:n=e,xUpperName:a=i,yLowerName:r=o,yUpperName:l=s}=this.properties;return{xLowerKey:e,xLowerName:n,xUpperKey:i,xUpperName:a,yLowerKey:o,yLowerName:r,yUpperKey:s,yUpperName:l}}onToggleSeriesItem(e){this.groupNode.visible=e.visible}makeStyle(e){return{visible:e.visible,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeOpacity:e.strokeOpacity,cap:pN(this.properties.cap,e)}}getDefaultStyle(){return this.makeStyle(this.getWhiskerProperties())}getHighlightStyle(){return this.makeStyle(this.getWhiskerProperties())}restyleHighlightChange(e,i,o){const s=this.getNodeData();if(s!=null){for(let n=0;nnew gN(t),themeTemplate:yN};import{_ModuleSupport as dl}from"ag-charts-community";var{ZIndexMap:mN,ActionOnSet:xN,Validate:Id,ProxyPropertyOnWrite:mm,OBJECT:SN,RATIO:bN,COLOR_STRING:vN}=dl,pl=class extends dl.Background{constructor(){super(...arguments),this.image=new wi,this.fill="transparent",this.fillOpacity=void 0}createNode(){return new dl.Group({name:"foreground",zIndex:mN.FOREGROUND})}onLayoutComplete(t){super.onLayoutComplete(t);const{width:e,height:i}=t.chart;let o={x:0,y:0,width:e,height:i};this.image&&(o=this.image.performLayout(e,i)),this.text&&this.updateTextNode(o)}onImageLoad(){this.ctx.updateService.update(dl.ChartUpdateType.SCENE_RENDER)}updateTextNode(t){const{textNode:e}=this;e.fontWeight="bold",e.fontFamily="Impact, sans-serif",e.fontSize=19,e.opacity=.7,e.fill="#9b9b9b",e.textBaseline="top";const i=this.textNode.getBBox(),o=10;e.x=t.x+t.width/2-i.width/2,e.y=t.y+t.height+o}};d([Id(SN,{optional:!0}),xN({newValue(t){this.node.appendChild(t.node),t.onLoad=()=>this.onImageLoad()},oldValue(t){this.node.removeChild(t.node),t.onLoad=void 0}})],pl.prototype,"image",2),d([Id(vN,{optional:!0}),mm("rectNode","fill")],pl.prototype,"fill",2),d([Id(bN,{optional:!0}),mm("rectNode","fillOpacity")],pl.prototype,"fillOpacity",2);var MN={type:"root",optionsKey:"foreground",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new pl(t)};import{_ModuleSupport as kN}from"ag-charts-community";import{_ModuleSupport as Dd}from"ag-charts-community";import{_ModuleSupport as xm}from"ag-charts-community";import{_ModuleSupport as AN}from"ag-charts-community";var{TranslatableGroup:IN,ScenePathChangeDetection:Sm}=AN,Td=class extends IN{constructor(){super(...arguments),this.inset=0,this.cornerRadius=0}applyClip(t,e){const{cornerRadius:i,inset:o}=this,{x:s,y:n,width:a,height:r}=e;t.beginPath(),t.roundRect(s+o,n+o,a-2*o,r-2*o,i),t.clip()}};d([Sm()],Td.prototype,"inset",2),d([Sm()],Td.prototype,"cornerRadius",2);var{Validate:Cd,BOOLEAN:DN,POSITIVE_NUMBER:bm,ZIndexMap:Ss,ActionOnSet:vm,CategoryAxis:TN,TextUtils:CN,Padding:NN,Group:bs,BBox:Mm,ProxyProperty:km}=xm,Nd=class{constructor(){this.top=0,this.bottom=0}};d([Cd(bm)],Nd.prototype,"top",2),d([Cd(bm)],Nd.prototype,"bottom",2);var bn=class extends xm.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!1,this.padding=new Nd,this.root=new bs({name:"root"}),this.seriesRoot=this.root.appendChild(new Td({name:"Series-root",zIndex:Ss.SERIES_LAYER,renderToOffscreenCanvas:!0})),this.axisGridGroup=this.root.appendChild(new bs({name:"Axes-Grids",zIndex:Ss.AXIS_GRID})),this.axisGroup=this.root.appendChild(new bs({name:"Axes-Grids",zIndex:Ss.AXIS_GRID})),this.axisLabelGroup=this.root.appendChild(new bs({name:"Axes-Labels",zIndex:Ss.SERIES_LABEL})),this.axisCrosslineRangeGroup=this.root.appendChild(new bs({name:"Axes-Crosslines-Range",zIndex:Ss.SERIES_CROSSLINE_RANGE})),this.axisCrosslineLineGroup=this.root.appendChild(new bs({name:"Axes-Crosslines-Line",zIndex:Ss.SERIES_CROSSLINE_LINE})),this.axisCrosslineLabelGroup=this.root.appendChild(new bs({name:"Axes-Crosslines-Label",zIndex:Ss.SERIES_LABEL})),this.data=[],this._destroyed=!1,this.miniChartAnimationPhase="initial",this.axes=[],this.series=[]}destroy(){this._destroyed||(this.destroySeries(this.series),this.axes.forEach(t=>t.destroy()),this.axes=[],this._destroyed=!0)}onSeriesChange(t,e){const i=e?.filter(o=>!t.includes(o))??[];this.destroySeries(i);for(const o of t){if(e?.includes(o))continue;o.attachSeries(this.seriesRoot,this.seriesRoot,void 0);const s=this;o.chart={get mode(){return"standalone"},get isMiniChart(){return!0},get seriesRect(){return s.seriesRect}},o.resetAnimation(this.miniChartAnimationPhase==="initial"?"initial":"disabled")}}destroySeries(t){t?.forEach(e=>{e.destroy(),e.detachSeries(this.seriesRoot,this.seriesRoot,void 0),e.chart=void 0})}assignSeriesToAxes(){this.axes.forEach(t=>{t.boundSeries=this.series.filter(e=>e.axes[t.direction]===t)})}assignAxesToSeries(){const t={};this.axes.forEach(e=>{const i=e.direction;(t[i]??(t[i]=[])).push(e)}),this.series.forEach(e=>{e.directions.forEach(i=>{const o=t[i];if(!o){lt.warnOnce(`no available axis for direction [${i}]; check series and axes configuration.`);return}const s=e.getKeys(i),n=this.findMatchingAxis(o,s);if(!n){lt.warnOnce(`no matching axis for direction [${i}] and keys [${s}]; check series and axes configuration.`);return}e.axes[i]=n})})}findMatchingAxis(t,e){for(const i of t){if(!i.keys.length)return i;if(e){for(const o of e)if(i.keys.includes(o))return i}}}updateData(t){this.series.forEach(e=>e.setChartData(t)),this.miniChartAnimationPhase==="initial"&&this.ctx.animationManager.onBatchStop(()=>{this.miniChartAnimationPhase="ready",this.series.forEach(e=>e.resetAnimation("disabled"))})}async processData(t){this.series.some(e=>e.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes()),await Promise.all(this.series.map(e=>(e.resetDatumCallbackCache(),e.processData(t))));for(const e of this.axes)e.processData()}computeAxisPadding(){const t=new NN;return this.enabled&&this.axes.forEach(({position:e,thickness:i,line:o,label:s})=>{if(e==null)return;let n;i?n=i:n=(o.enabled?o.width:0)+(s.enabled?CN.getLineHeight(s.fontSize??0)+s.spacing:0),t[e]=Math.ceil(n)}),t}async layout(t,e){const{padding:i}=this,o=this.seriesRect!=null,s=new Mm(0,0,t,e-(i.top+i.bottom));this.seriesRect=s,this.seriesRoot.translationY=i.top,this.seriesRoot.setClipRectCanvasSpace(new Mm(0,-i.top,t,e)),this.axes.forEach(n=>{const{position:a="left"}=n;switch(a){case"top":case"bottom":n.range=[0,s.width],n.gridLength=s.height;break;case"right":case"left":{const r=n instanceof TN;n.range=r?[0,s.height]:[s.height,0],n.gridLength=s.width;break}}n.gridPadding=0,n.translation.x=0,n.translation.y=0,a==="right"?n.translation.x=t:a==="bottom"&&(n.translation.y=e),o||n.resetAnimation("initial"),n.calculateLayout(),n.update()}),await Promise.all(this.series.map(n=>n.update({seriesRect:s})))}};d([Cd(DN)],bn.prototype,"enabled",2),d([km(["seriesRoot","inset"])],bn.prototype,"inset",2),d([km(["seriesRoot","cornerRadius"])],bn.prototype,"cornerRadius",2),d([vm({changeValue(t,e=[]){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const o of e)t.includes(o)||(o.detachAxis(i),o.destroy());for(const o of t)e?.includes(o)||o.attachAxis(i)}})],bn.prototype,"axes",2),d([vm({changeValue(t,e){this.onSeriesChange(t,e)}})],bn.prototype,"series",2);import{_ModuleSupport as ON}from"ag-charts-community";var{clamp:LN,SliderWidget:Am}=ON,RN=class{constructor(t,e){this.ctx=t,this.sliderHandlers=e,this._min=0,this._max=1,this.minRange=.001,this.dragStartX=0,this.ctx=t,this.toolbar=t.proxyInteractionService.createProxyContainer({type:"toolbar",domManagerId:"navigator-toolbar",classList:["ag-charts-proxy-navigator-toolbar"],orientation:"vertical",ariaLabel:{id:"ariaLabelNavigator"}}),this.sliders=[t.proxyInteractionService.createProxyElement({type:"slider",domIndex:1,ariaLabel:{id:"ariaLabelNavigatorMinimum"},parent:this.toolbar,cursor:"ew-resize"}),t.proxyInteractionService.createProxyElement({type:"slider",domIndex:-1/0,ariaLabel:{id:"ariaLabelNavigatorRange"},parent:this.toolbar,cursor:"grab"}),t.proxyInteractionService.createProxyElement({type:"slider",domIndex:2,ariaLabel:{id:"ariaLabelNavigatorMaximum"},parent:this.toolbar,cursor:"ew-resize"})];for(const[i,o]of["min","pan","max"].entries()){const s=this.sliders[i];s.step=Am.STEP_HUNDRETH,s.keyboardStep=Am.STEP_ONE,s.orientation="horizontal",s.setPreventsDefault(!1),s.addListener("drag-start",n=>this.onDragStart(i,n,o)),s.addListener("drag-move",n=>this.onDrag(s,n,o)),s.addListener("drag-end",()=>this.updateSliderRatios()),s.addListener("contextmenu",n=>this.onContextMenu(s,n))}this.sliders[0].addListener("change",()=>this.onMinSliderChange()),this.sliders[1].addListener("change",()=>this.onPanSliderChange()),this.sliders[2].addListener("change",()=>this.onMaxSliderChange()),this.updateSliderRatios(),this.updateVisibility(!1)}destroy(){this.toolbar.destroy()}updateVisibility(t){this.toolbar.setHidden(!t)}updateZoom(){const{_min:t,_max:e}=this;if(!(t==null||e==null))return this.ctx.zoomManager.updateZoom("navigator",{x:{min:t,max:e}})}updateBounds(t){this.toolbar.setBounds(t)}updateSliderBounds(t,e){this.sliders[t].setBounds(e)}updateMinMax(t,e){this._min=t,this._max=e,this.updateSliderRatios()}updateSliderRatios(){const{_min:t,_max:e}=this,i=this.ctx.localeManager.t("ariaValuePanRange",{min:t,max:e});this.sliders[0].setValueRatio(t),this.sliders[1].setValueRatio(t,{ariaValueText:i}),this.sliders[2].setValueRatio(e)}toCanvasOffsets(t){return{offsetX:this.dragStartX+t.originDeltaX}}moveToFront(t){if(t===1)return;const e=this.sliders[t],i=this.sliders[2-t];this.toolbar.moveChild(i,e.domIndex-1)}onDragStart(t,e,i){const o=this.sliders[t],s=this.toolbar.cssLeft(),n=o.cssLeft();this.dragStartX=s+n+e.offsetX,this.moveToFront(t),e.device==="touch"&&e.sourceEvent.preventDefault(),this.sliderHandlers.onDragStart(i,this.toCanvasOffsets(e))}onDrag(t,e,i){e.device==="touch"&&e.sourceEvent.preventDefault(),this.sliderHandlers.onDrag(i,this.toCanvasOffsets(e))}onContextMenu(t,{sourceEvent:e,offsetX:i,offsetY:o}){const{x:s,y:n}=this.toolbar.getBounds(),{x:a,y:r}=t.getBounds(),l=i+s+a,c=o+n+r;this.ctx.contextMenuRegistry.dispatchContext("all",{sourceEvent:e,canvasX:l,canvasY:c},{})}onPanSliderChange(){const t=this.sliders[1].getValueRatio(),e=this._max-this._min;this._min=LN(0,t,1-e),this._max=this._min+e,this.updateZoom()}onMinSliderChange(){this._min=this.sliders[0].clampValueRatio(0,this._max-this.minRange),this.updateZoom()}onMaxSliderChange(){this._max=this.sliders[2].clampValueRatio(this._min+this.minRange,1),this.updateZoom()}};import{_ModuleSupport as Im}from"ag-charts-community";var{Validate:ul,ScenePathChangeDetection:gl,POSITIVE_NUMBER:Od,BOOLEAN:EN,BBox:wN,ExtendedPath2D:PN}=Im,Go=class extends Im.Path{constructor(){super(...arguments),this.zIndex=3,this.centerX=0,this.centerY=0,this.width=8,this.height=16,this.cornerRadius=4,this.grip=!0,this.gripPath=new PN}setCenter(t,e){this.dirtyPath=!0,(this.centerX!==t||this.centerY!==e)&&(this.centerX=t,this.centerY=e,this.markDirty())}static align(t,e,i,o,s,n,a,r,l){const c=t.align(i+s*a)+l,h=c+t.align(i+s*a,s*(r-a))-2*l,p=t.align(o+n/2);t.setCenter(c,p),e.setCenter(h,p)}computeBBox(){const{centerX:t,centerY:e,width:i,height:o}=this,s=t-i/2,n=e-o/2;return new wN(s,n,i,o)}isPointInPath(t,e){return this.getBBox().containsPoint(t,e)}updatePath(){const{centerX:t,centerY:e,path:i,gripPath:o,strokeWidth:s,cornerRadius:n,grip:a}=this,r=s/2,l=this.layerManager?.canvas?.pixelRatio??1;i.clear(),o.clear();const c=Math.floor(this.width/2*l)/l,h=Math.floor(this.height/2*l)/l;i.roundRect(t-c+r,e-h+r,2*(c-r),2*(h-r),n);const p=3;if(a)for(let u=-.5;u<=.5;u+=1)for(let g=-1;g<=1;g+=1)o.arc(t+u*p,e+g*p,1,0,2*Math.PI),o.closePath()}renderFill(t,e){const{stroke:i}=this;super.renderFill(t,e),t.fillStyle=typeof i=="string"?i:"black",t.fill(this.gripPath.getPath2D())}};Go.className="RangeHandle",d([ul(Od),gl()],Go.prototype,"width",2),d([ul(Od),gl()],Go.prototype,"height",2),d([ul(Od),gl()],Go.prototype,"cornerRadius",2),d([ul(EN),gl()],Go.prototype,"grip",2);import{_ModuleSupport as _N}from"ag-charts-community";var{Path:BN,BBox:Ma,ExtendedPath2D:zN,clippedRoundRect:Ld,POSITIVE_NUMBER:VN,Validate:FN,ScenePathChangeDetection:GN}=_N,Rd=class extends BN{constructor(){super(...arguments),this.cornerRadius=4,this.zIndex=2,this.x=0,this.y=0,this.width=200,this.height=30,this.min=0,this.max=1,this.visiblePath=new zN}layout(t,e,i,o,s,n){s=isNaN(s)?this.min:s,n=isNaN(n)?this.max:n,(t!==this.x||e!==this.y||i!==this.width||this.height!==o||s!==this.min||n!==this.max)&&(this.x=t,this.y=e,this.width=i,this.height=o,this.min=s,this.max=n,this.dirtyPath=!0,this.markDirty())}computeBBox(){const{x:t,y:e,width:i,height:o}=this;return new Ma(t,e,i,o)}computeVisibleRangeBBox(){const{x:t,y:e,width:i,height:o,min:s,max:n}=this,a=t+i*s,r=t+i*n;return new Ma(a,e,r-a,o)}updatePath(){const{path:t,visiblePath:e,x:i,y:o,width:s,height:n,min:a,max:r,strokeWidth:l,cornerRadius:c}=this,h=l/2;t.clear(),e.clear();const p=this.align(i)+h,u=this.align(o)+h,g=this.align(i,s)-2*h,y=this.align(o,n)-2*h,f=this.align(i+s*a)+h,m=f+this.align(i+s*a,s*(r-a))-2*h,x={topLeft:c,topRight:c,bottomRight:c,bottomLeft:c};Ld(t,p,u,g,y,x,new Ma(p,u,f-p,y)),Ld(t,p,u,g,y,x,new Ma(m,u,g+p-m,y)),m-f>1&&Ld(e,p,u,g,y,x,new Ma(f,u,m-f,y))}renderStroke(t,e){super.renderStroke(t,e),super.renderStroke(t,this.visiblePath.getPath2D())}};Rd.className="RangeMask",d([FN(VN),GN()],Rd.prototype,"cornerRadius",2);import{_ModuleSupport as yl}from"ag-charts-community";var WN=class extends yl.Group{constructor(t){super({name:"rangeSelectorGroup",zIndex:yl.ZIndexMap.NAVIGATOR}),this.x=0,this.y=0,this.width=200,this.height=30,this.lOffset=0,this.rOffset=0,this.background=this.appendChild(new yl.TranslatableGroup({name:"navigator-background",zIndex:1})),this.append(t)}layout(t,e,i,o,s,n){this.x=t,this.y=e,this.width=i,this.height=o,this.lOffset=s,this.rOffset=n,this.background.translationX=t,this.background.translationY=e,this.markDirty()}updateBackground(t,e){t!=null&&this.background.removeChild(t),e!=null&&this.background.appendChild(e),this.markDirty()}computeBBox(){const{x:t,y:e,width:i,height:o,lOffset:s,rOffset:n}=this;return new yl.BBox(t-s,e,i+(s+n),o)}},{clamp:Ed,BaseModuleInstance:HN,ObserveChanges:wd,Validate:fl,BOOLEAN:KN,POSITIVE_NUMBER:Pd}=Dd,vn=class extends HN{constructor(t){super(),this.ctx=t,this.enabled=!1,this.mask=new Rd,this.minHandle=new Go,this.maxHandle=new Go,this.maskVisibleRange={id:"navigator-mask-visible-range",getBBox:()=>this.mask.computeVisibleRangeBBox(),toCanvasBBox:()=>this.mask.computeVisibleRangeBBox(),fromCanvasPoint:(e,i)=>({x:e,y:i})},this.height=30,this.cornerRadius=0,this.spacing=10,this.x=0,this.y=0,this.width=0,this.rangeSelector=new WN([this.mask,this.minHandle,this.maxHandle]),this.destroyFns.push(t.scene.attachNode(this.rangeSelector),this.ctx.localeManager.addListener("locale-changed",()=>this.updateZoom()),this.ctx.layoutManager.registerElement(Dd.LayoutElement.Navigator,e=>this.onLayoutStart(e)),this.ctx.layoutManager.addListener("layout:complete",e=>this.onLayoutComplete(e)),t.zoomManager.addListener("zoom-change",e=>this.onZoomChange(e))),this.domProxy=new RN(t,this),this.updateGroupVisibility(),this.miniChart=new bn(t)}updateBackground(t,e){this.rangeSelector?.updateBackground(t,e)}updateGroupVisibility(){const{enabled:t}=this;this.rangeSelector==null||t===this.rangeSelector.visible||(this.rangeSelector.visible=t,this.domProxy.updateVisibility(t),t?this.updateZoom():this.ctx.zoomManager.updateZoom("navigator"))}onLayoutStart(t){if(this.enabled){const{layoutBox:e}=t,i=this.height+this.spacing;e.shrink(i,"bottom"),this.y=e.y+e.height+this.spacing}else this.y=0;if(this.enabled&&this.miniChart){const{top:e,bottom:i}=this.miniChart.computeAxisPadding();t.layoutBox.shrink(e+i,"bottom"),this.y-=i,this.miniChart.inset=this.mask.strokeWidth/2,this.miniChart.cornerRadius=this.mask.cornerRadius}}onLayoutComplete(t){const{x:e,width:i}=t.series.rect,{y:o,height:s}=this;if(this.domProxy.updateVisibility(this.enabled),this.enabled){const{_min:n,_max:a}=this.domProxy;this.layoutNodes(e,o,i,s,n,a),this.domProxy.updateBounds({x:e,y:o,width:i,height:s})}this.x=e,this.width=i,this.miniChart?.layout(i,s).catch(n=>lt.error(n))}canDrag(){return this.enabled&&this.ctx.interactionManager.isState(Dd.InteractionState.ZoomDraggable)}onDragStart(t,{offsetX:e}){this.canDrag()&&(t==="pan"&&(this.panStart=(e-this.x)/this.width-this.domProxy._min),this.ctx.zoomManager.fireZoomPanStartEvent("navigator"))}onDrag(t,{offsetX:e}){if(!this.canDrag())return;const{panStart:i,x:o,width:s}=this,{minRange:n}=this.domProxy;let{_min:a,_max:r}=this.domProxy;const l=(e-o)/s;if(t==="min")a=Ed(0,l,r-n);else if(t==="max")r=Ed(a+n,l,1);else if(t==="pan"&&i!=null){const c=r-a;a=Ed(0,l-i,1-c),r=a+c}this.domProxy._min=a,this.domProxy._max=r,this.updateZoom()}onZoomChange(t){const{x:e}=t;if(!e)return;const{x:i,y:o,width:s,height:n}=this,{min:a,max:r}=e;this.domProxy.updateMinMax(a,r),this.layoutNodes(i,o,s,n,a,r)}layoutNodes(t,e,i,o,s,n){const{rangeSelector:a,mask:r,minHandle:l,maxHandle:c}=this;r.layout(t,e,i,o,s,n),a.layout(t,e,i,o,l.width/2,c.width/2),Go.align(l,c,t,e,i,o,s,n,r.strokeWidth/2),s+(n-s)/2<.5?(l.zIndex=3,c.zIndex=4):(l.zIndex=4,c.zIndex=3),[l,this.maskVisibleRange,c].forEach((h,p)=>{const u=h.getBBox(),g={x:u.x-t,y:u.y-e,height:u.height,width:u.width};this.domProxy.updateSliderBounds(p,g)})}updateZoom(){this.enabled&&this.domProxy.updateZoom()}updateData(t){return this.miniChart?.updateData(t)}async processData(t){if(this.miniChart)return this.miniChart?.processData(t)}};d([wd((t,e,i)=>{t.updateBackground(i?.root,e?.root)})],vn.prototype,"miniChart",2),d([fl(KN),wd((t,e)=>{t.ctx.zoomManager.setNavigatorEnabled(!!e),t.updateGroupVisibility()})],vn.prototype,"enabled",2),d([fl(Pd)],vn.prototype,"height",2),d([fl(Pd),wd((t,e)=>{t.mask.cornerRadius=e})],vn.prototype,"cornerRadius",2),d([fl(Pd)],vn.prototype,"spacing",2);var UN={type:"root",optionsKey:"navigator",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new vn(t),removable:!1,themeTemplate:{navigator:{enabled:!1,height:18,cornerRadius:4,mask:{fill:{$ref:"foregroundColor"},fillOpacity:.1,stroke:{$ref:"borderColor"},strokeWidth:1},minHandle:{fill:{$ref:"backgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},maxHandle:{fill:{$ref:"backgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},miniChart:{enabled:!1,label:{color:{$ref:"textColor"},fontSize:{$rem:[kN.FONT_SIZE_RATIO.SMALLER]},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:5},padding:{top:0,bottom:0}}}}};import{_ModuleSupport as Dm}from"ag-charts-community";import{_ModuleSupport as YN}from"ag-charts-community";var{AND:jN,ARRAY:Tm,FUNCTION:XN,NUMBER:$N,OR:ZN,ToolbarButtonProperties:QN,Validate:qN}=YN,Cm=class extends QN{};d([qN(ZN($N,jN(Tm,Tm.restrict({length:2})),XN))],Cm.prototype,"value",2);var{BOOLEAN:JN,OBJECT:tO,ChartAxisDirection:_d,LayoutElement:eO,PropertiesArray:iO,Toolbar:oO,Validate:Nm}=Dm,Bd=class extends Dm.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!1,this.buttons=new iO(Cm),this.verticalSpacing=10,this.container=t.domManager.addChild("canvas-overlay","range-buttons"),this.container.role="presentation",this.toolbar=new oO(this.ctx.localeManager),this.toolbar.addClass("ag-charts-range-buttons"),this.container.append(this.toolbar.getElement()),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),t.layoutManager.registerElement(eO.ToolbarBottom,this.onLayoutStart.bind(this)),t.zoomManager.addListener("zoom-change",this.onZoomChanged.bind(this)),this.teardown.bind(this))}teardown(){this.container.removeChild(this.toolbar.getElement()),this.toolbar.destroy()}onLayoutStart(t){const{buttons:e,ctx:i,enabled:o,toolbar:s,verticalSpacing:n}=this,{layoutBox:a}=t;if(!o||!i.zoomManager.isZoomEnabled()){s.setHidden(!0);return}s.setHidden(!1),s.updateButtons(e);const r=s.getBounds().height;s.setBounds({x:a.x,y:a.y+a.height-r,width:a.width,height:r}),a.shrink({bottom:r+n})}onZoomChanged(){this.toolbar.clearActiveButton()}onButtonPress({button:{index:t}}){const{zoomManager:e}=this.ctx,i=this.buttons.at(t);if(!i)return;const{value:o}=i;typeof o=="number"?e.extendToEnd("zoom-buttons",_d.X,o):Array.isArray(o)?e.updateWith("zoom-buttons",_d.X,()=>o):typeof o=="function"&&e.updateWith("zoom-buttons",_d.X,o),this.toolbar.toggleActiveButtonByIndex(t)}};d([Nm(JN)],Bd.prototype,"enabled",2),d([Nm(tO)],Bd.prototype,"buttons",2);var Om=1e3*60*60*24,zd=Om*30,sO=Om*365,nO={type:"root",optionsKey:"ranges",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new Bd(t),themeTemplate:{ranges:{enabled:!1,buttons:[{label:"toolbarRange1Month",ariaLabel:"toolbarRange1MonthAria",value:zd},{label:"toolbarRange3Months",ariaLabel:"toolbarRange3MonthsAria",value:3*zd},{label:"toolbarRange6Months",ariaLabel:"toolbarRange6MonthsAria",value:6*zd},{label:"toolbarRangeYearToDate",ariaLabel:"toolbarRangeYearToDateAria",value:(t,e)=>[new Date(`${new Date(e).getFullYear()}-01-01`).getTime(),e]},{label:"toolbarRange1Year",ariaLabel:"toolbarRange1YearAria",value:sO},{label:"toolbarRangeAll",ariaLabel:"toolbarRangeAllAria",value:(t,e)=>[t,e]}]}}};import"ag-charts-community";import{_ModuleSupport as Lm}from"ag-charts-community";var Rm=class rr extends Lm.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.activeSections=new Set,this.sectionButtons={annotations:[],chartToolbar:[]},this.container=this.ctx.domManager.addChild("canvas-overlay","shared-toolbar"),this.container.role="presentation"}getSharedToolbar(e){return this.sharedToolbar||this.createSharedToolbar(),this.toolbarWithSection(e)}createSharedToolbar(){this.sharedToolbar=new Lm.Toolbar(this.ctx.localeManager,"vertical"),this.sharedToolbar.addClass("ag-charts-shared-toolbar"),this.container.append(this.sharedToolbar.getElement()),this.destroyFns.push(()=>{this.sharedToolbar&&(this.container.removeChild(this.sharedToolbar.getElement()),this.sharedToolbar.destroy(),this.sharedToolbar=void 0)})}toolbarWithSection(e){const i=this.sharedToolbar,o={layout:(s,n)=>{if(this.firstLayoutSection!=null&&this.firstLayoutSection!==e&&this.activeSections.has(this.firstLayoutSection))return;this.firstLayoutSection=e;const a=i.getBounds().width;i.setBounds({x:s.x,y:s.y,width:a}),s.shrink({left:a+i.horizontalSpacing+(n??0)})},addToolbarListener:(s,n)=>i.addToolbarListener(s,a=>{const r=this.getSectionIndex(e,a.button.index);if(r<0)return;const l={...a,button:this.sectionButtons[e][r]};n(l)}),updateButtons:s=>{this.sectionButtons[e]=s;const n=rr.SECTION_ORDER.flatMap(a=>this.sectionButtons[a]);i.updateButtons(n)},updateButtonByIndex:(s,n)=>{i.updateButtonByIndex(this.getIndex(e,s),n)},toggleActiveButtonByIndex:s=>{i.toggleActiveButtonByIndex(this.getIndex(e,s))},toggleButtonEnabledByIndex:(s,n)=>{i.toggleButtonEnabledByIndex(this.getIndex(e,s),n)},setHidden:s=>{s?this.activeSections.delete(e):this.activeSections.add(e);let n=0;for(const a of rr.SECTION_ORDER){if(a!==e){n+=this.sectionButtons[a].length;continue}for(const r of this.sectionButtons[e].keys())i.setButtonHiddenByIndex(n+r,s)}},destroy:()=>{o.setHidden(!0),this.activeSections.size===0&&this.destroy()},clearActiveButton:i.clearActiveButton.bind(i),addListener:i.addListener.bind(i),removeListener:i.removeListener.bind(i)};return o.setHidden(!1),o}getIndex(e,i){let o=0;for(const s of rr.SECTION_ORDER){if(s===e)return o+i;o+=this.sectionButtons[s].length}return-1}getSectionIndex(e,i){let o=0;for(const s of rr.SECTION_ORDER){if(s===e)return i>=o+this.sectionButtons[e].length?-1:i-o;o+=this.sectionButtons[s].length}return-1}};Rm.SECTION_ORDER=["chartToolbar","annotations"];var aO=Rm,rO={type:"context",contextKey:"sharedToolbar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new aO(t)};import{_ModuleSupport as ml}from"ag-charts-community";import{_ModuleSupport as Vd}from"ag-charts-community";var{CachedTextMeasurerPool:ka,ZIndexMap:lO,LayoutElement:cO,Validate:ve,BaseProperties:hO,OBJECT:Mn,BOOLEAN:dO,STRING:kn,COLOR_STRING:pO,RATIO:uO,valueProperty:gO,TextUtils:yO,Group:fO,Label:Aa,Rect:mO,Text:Qt}=Vd,Em={ohlc:62,candlestick:62,"hollow-candlestick":62,line:96,"step-line":96,hlc:184,"high-low":800},xO={up:"positive",down:"negative"},SO={hlc:"altNeutral"},Fd=class extends hO{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1}};d([ve(pO)],Fd.prototype,"fill",2),d([ve(uO)],Fd.prototype,"fillOpacity",2);var Oe=class extends Vd.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!1,this.openKey=void 0,this.highKey=void 0,this.lowKey=void 0,this.closeKey=void 0,this.volumeKey=void 0,this.title=new Aa,this.positive=new Aa,this.negative=new Aa,this.neutral=new Aa,this.altNeutral=new Aa,this.background=new Fd,this.layoutStyle="block",this.id="status-bar",this.data=void 0,this.layer=new fO({name:"StatusBar",zIndex:lO.STATUS_BAR}),this.labelGroup=this.layer.appendChild(new Vd.TranslatableGroup),this.backgroundNode=this.labelGroup.appendChild(new mO),this.labels=[{label:"O",configuration:2,title:this.labelGroup.appendChild(new Qt),value:this.labelGroup.appendChild(new Qt),id:"openValue",key:"openKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:16,title:this.labelGroup.appendChild(new Qt),value:this.labelGroup.appendChild(new Qt),id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:256,title:this.labelGroup.appendChild(new Qt),value:this.labelGroup.appendChild(new Qt),style:"neutral",id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:8,title:this.labelGroup.appendChild(new Qt),value:this.labelGroup.appendChild(new Qt),id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:512,title:this.labelGroup.appendChild(new Qt),value:this.labelGroup.appendChild(new Qt),style:"neutral",id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:4,title:this.labelGroup.appendChild(new Qt),value:this.labelGroup.appendChild(new Qt),id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:128,title:this.labelGroup.appendChild(new Qt),value:this.labelGroup.appendChild(new Qt),id:"closeValue",key:"closeKey",style:"neutral",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"",configuration:64,title:this.labelGroup.appendChild(new Qt),value:this.labelGroup.appendChild(new Qt),style:"neutral",id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})},{label:"Vol",configuration:32,title:this.labelGroup.appendChild(new Qt),value:this.labelGroup.appendChild(new Qt),id:"volumeValue",key:"volumeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})}],this.highlightManager=t.highlightManager,this.labelGroup.visible=!1,this.destroyFns.push(t.scene.attachNode(this.layer),t.layoutManager.registerElement(cO.Overlay,e=>this.startPerformLayout(e)),t.layoutManager.addListener("layout:complete",e=>this.onLayoutComplete(e)),t.highlightManager.addListener("highlight-change",()=>this.updateHighlight()))}async processData(t){if(!this.enabled||this.data==null)return;const e=[];for(const s of this.labels){const{id:n,key:a}=s,r=this[a];r==null?s.domain=void 0:e.push(gO(r,"number",{id:n}))}if(e.length===0)return;const{processedData:i,dataModel:o}=await t.request(this.id,this.data,{props:e});for(const s of this.labels){const{id:n,key:a}=s;this[a]!=null&&(s.domain=o.getDomain(this,n,"value",i))}}startPerformLayout(t){if(this.labelGroup.translationX=0,this.labelGroup.translationY=0,!this.enabled)return;const{layoutBox:e}=t,i=4,o=12,s=0,n=8;this.labelGroup.translationY=e.y+s;const a=Math.max(this.title.fontSize,this.positive.fontSize,this.negative.fontSize),r=yO.getLineHeight(a),l=Em[this.getChartType()]??0;let c=0,h,p="alphabetic";if(this.layoutStyle==="block")e.shrink(s+r+n,"top"),h=a+(r-a)/2;else{const{title:u}=this.ctx.chartService;if(p="top",h=s+u.padding,u.enabled){const g=u.node.getBBox();c=g.x+g.width+o}else c=u.padding}for(const{label:u,configuration:g,title:y,value:f,domain:m,formatter:x}of this.labels){if(m==null||!(l&g)){y.visible=!1,f.visible=!1;continue}const v=Math.max(ka.measureText(x.format(m[0]),{font:this.positive.getFont(),textBaseline:p,textAlign:"left"}).width,ka.measureText(x.format(m[1]),{font:this.positive.getFont(),textBaseline:p,textAlign:"left"}).width,ka.measureText(x.format(m[0]),{font:this.negative.getFont(),textBaseline:p,textAlign:"left"}).width,ka.measureText(x.format(m[1]),{font:this.negative.getFont(),textBaseline:p,textAlign:"left"}).width);y.visible=!0,f.visible=!0;const S=ka.measureText(u,{font:this.title.getFont(),textBaseline:p,textAlign:"left"});y.setFont(this.title),y.fill=this.title.color,y.text=u,y.textBaseline=p,y.y=h,y.x=c,c+=S.width+i,f.textBaseline=p,f.y=h,f.x=c,c+=v+o}this.backgroundNode.x=0,this.backgroundNode.y=0,this.backgroundNode.width=c-o,this.backgroundNode.height=r+s+n,this.backgroundNode.fill=this.background.fill,this.backgroundNode.fillOpacity=this.background.fillOpacity}onLayoutComplete(t){this.labelGroup.translationX=t.series.rect.x,this.updateHighlight()}updateHighlight(){if(!this.enabled)return;const t=this.highlightManager.getActiveHighlight(),e=t?.datum??this.data?.at(-1);if(e==null){this.labelGroup.visible=!1;return}this.labelGroup.visible=!0;const i=t?.itemId;let o=i!=null?xO[i]:void 0;o==null&&this.openKey!=null&&this.closeKey!=null&&(e[this.openKey]new Oe(t),themeTemplate:{statusBar:{enabled:!1,layoutStyle:ml.ThemeSymbols.DEFAULT_CAPTION_LAYOUT_STYLE,title:{color:{$ref:"textColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},positive:{color:ml.ThemeSymbols.PALETTE_UP_STROKE,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},negative:{color:ml.ThemeSymbols.PALETTE_DOWN_STROKE,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},neutral:{color:ml.ThemeSymbols.PALETTE_NEUTRAL_STROKE,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},background:{fill:{$ref:"backgroundColor"},fillOpacity:.5},altNeutral:{color:"gray"}}}};import{_ModuleSupport as vO}from"ag-charts-community";var{BOOLEAN:Gd,STRING:MO,UNION:kO,BaseProperties:AO,CartesianAxis:wm,ChartUpdateType:Pm,ObserveChanges:Ia,TooltipManager:IO,Validate:Da}=vO,vs=class extends AO{constructor(t){super(),this.moduleContext=t,this.enabled=!1,this.axes="x",this.nodeInteraction=!0,this.zoom=!0}updateSiblings(t){const{syncManager:e}=this.moduleContext;for(const i of e.getGroupSiblings(t??this.groupId))this.updateChart(i)}updateChart(t,e=Pm.UPDATE_DATA){t.ctx.updateService.update(e,{skipSync:!0})}enabledZoomSync(){const{syncManager:t,zoomManager:e}=this.moduleContext;this.disableZoomSync=e.addListener("zoom-change",()=>{for(const i of t.getGroupSiblings(this.groupId))i.modulesManager.getModule("sync")?.zoom&&i.ctx.zoomManager.updateZoom("sync",this.mergeZoom(i))})}enabledNodeInteractionSync(){const{highlightManager:t,syncManager:e}=this.moduleContext;this.disableNodeInteractionSync=t.addListener("highlight-change",i=>{for(const o of e.getGroupSiblings(this.groupId))if(o.modulesManager.getModule("sync")?.nodeInteraction){if(!i.currentHighlight?.datum){o.ctx.highlightManager.updateHighlight(o.id),o.ctx.tooltipManager.removeTooltip(o.id);continue}for(const s of o.axes){const n=this.axes==="xy"?"x":this.axes;if(!wm.is(s)||s.direction!==n)continue;const a=o.series.map(r=>{const l=r.getKeys(s.direction);if(s.keys.length&&!s.keys.some(y=>l.includes(y)))return;const{nodeData:c}=r.contextNodeData;if(!c?.length)return;const h=c[0][`${s.direction}Key`];let p=i.currentHighlight.datum[h];const u=Qn(p);u&&(p=p.getTime());const g=c.find(y=>{const f=y.datum[h];return u?f.getTime()===p:f===p});return g?{series:r,nodeDatum:g}:null}).filter(ee);if(a.length<2&&a[0]?.nodeDatum!==o.ctx.highlightManager.getActiveHighlight()){const{series:r,nodeDatum:l}=a[0]??{};if(o.ctx.highlightManager.updateHighlight(o.id,l),l){const c=l.midPoint?.x??l.point?.x??0,h=l.midPoint?.y??l.point?.y??0,p=IO.makeTooltipMeta({type:"pointermove",canvasX:c,canvasY:h},r,l);delete p.lastPointerEvent,o.ctx.tooltipManager.updateTooltip(o.id,p,r.getTooltipContent(l))}else o.ctx.tooltipManager.removeTooltip(o.id);this.updateChart(o,Pm.SERIES_UPDATE)}}}})}getSyncedDomain(t){if(!wm.is(t)||this.axes!=="xy"&&this.axes!==t.direction)return;const{syncManager:e}=this.moduleContext,i=e.getGroup(this.groupId),[{axes:o}]=i,{direction:s,min:n,max:a,nice:r,reverse:l}=t;for(const c of o)if(s===c.direction&&(r!==c.nice||l!==c.reverse||n!==c.min&&(vo(n)||vo(c.min))||a!==c.max&&(vo(a)||vo(c.max)))){lt.warnOnce("To allow synchronization, ensure that all charts have matching min, max, nice, and reverse properties on the synchronized axes."),this.enabled=!1;return}return eI(i.flatMap(c=>c.series).filter(c=>{if(c.visible){const h=c.getKeys(t.direction);return t.keys.length?t.keys.some(p=>h.includes(p)):!0}}).flatMap(c=>c.getDomain(t.direction)))}mergeZoom(t){const{zoomManager:e}=this.moduleContext;if(this.axes==="xy")return e.getZoom();const i=t.ctx.zoomManager.getZoom()??{};return i[this.axes]=e.getZoom()?.[this.axes],i}onEnabledChange(){const{syncManager:t}=this.moduleContext;this.enabled?t.subscribe(this.groupId):t.unsubscribe(this.groupId),this.updateSiblings(),this.onNodeInteractionChange(),this.onZoomChange()}onGroupIdChange(t,e){if(!this.enabled||t===e)return;const{syncManager:i}=this.moduleContext;i.unsubscribe(e),i.subscribe(t),this.updateSiblings(e),this.updateSiblings(t)}onAxesChange(){if(!this.enabled)return;const{syncManager:t}=this.moduleContext;this.updateChart(t.getChart())}onNodeInteractionChange(){this.enabled&&this.nodeInteraction?this.enabledNodeInteractionSync():this.disableNodeInteractionSync?.()}onZoomChange(){this.enabled&&this.zoom?this.enabledZoomSync():this.disableZoomSync?.()}destroy(){const{syncManager:t}=this.moduleContext;t.unsubscribe(this.groupId),this.updateSiblings(),this.disableZoomSync?.()}};vs.className="Sync",d([Da(Gd),Ia(t=>t.onEnabledChange())],vs.prototype,"enabled",2),d([Da(MO,{optional:!0}),Ia((t,e,i)=>t.onGroupIdChange(e,i))],vs.prototype,"groupId",2),d([Da(kO(["x","y","xy"],"an axis")),Ia(t=>t.onAxesChange())],vs.prototype,"axes",2),d([Da(Gd),Ia(t=>t.onNodeInteractionChange())],vs.prototype,"nodeInteraction",2),d([Da(Gd),Ia(t=>t.onZoomChange())],vs.prototype,"zoom",2);var DO={type:"root",optionsKey:"sync",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new vs(t),themeTemplate:{sync:{enabled:!1}}};import{_ModuleSupport as Ms}from"ag-charts-community";import{_ModuleSupport as Wd}from"ag-charts-community";var{COLOR_STRING:TO,RATIO:CO,Validate:_m}=Wd,Bm="#2196f3",NO="#8a8a8a",xl=class extends Wd.Rect{constructor(){super(...arguments),this.fill=Bm,this.fillOpacity=.2,this.zIndex=Wd.ZIndexMap.ZOOM_SELECTION}updateValid(){this.fill=Bm}updateInvalid(){this.fill=NO}};xl.className="ZoomRect",d([_m(TO)],xl.prototype,"fill",2),d([_m(CO)],xl.prototype,"fillOpacity",2);import{_ModuleSupport as Hd}from"ag-charts-community";import{_ModuleSupport as OO}from"ag-charts-community";var{UNION:LO,clamp:RO,isNumberEqual:zm,round:tK}=OO,pt={min:0,max:1},Vm="end",Fm="middle",Sl=LO(["pointer","start","middle","end"],"an anchor point"),bl=(t,e=pt.min,i=pt.max)=>RO(e,t,i);function Kd(){return{x:{...pt},y:{...pt}}}function se(t){return t.x.max-t.x.min}function Je(t){return t.y.max-t.y.min}function Gm(t,e,i=1e-10){return zm(t.min,e.min,i)&&zm(t.max,e.max,i)}function Ta(t,e,i){return Gm(t.x,e.x,i)&&Gm(t.y,e.y,i)}function ue(t){return{x:{min:t?.x?.min??pt.min,max:t?.x?.max??pt.max},y:{min:t?.y?.min??pt.min,max:t?.y?.max??pt.max}}}function ao(t,e,i){if(!t)return{x:0,y:0};const o=bl(e-t.x,0,t.x+t.width),s=bl(i-t.y,0,t.y+t.height),n=1/t.width*o,a=1-1/t.height*s;return{x:bl(n),y:bl(a)}}function ks(t,e,i){return{x:{min:t.x.min+e,max:t.x.max+e},y:{min:t.y.min+i,max:t.y.max+i}}}function Wm(t,e,i){return{x:{min:t.x.min,max:t.x.min+se(t)*e},y:{min:t.y.min,max:t.y.min+Je(t)*i}}}function Hm(t,e,i){const o=se(t),s=Je(t),n=t.x.min+o/2,a=t.y.min+s/2;return{x:{min:n-o*e/2,max:n+o*e/2},y:{min:a-s*i/2,max:a+s*i/2}}}function pi(t,e,i,o){const{min:s,max:n}=e,a=s+(n-s)/2,r=t.max-t.min;switch(i){case"start":return{min:s,max:e.min+r};case"end":return{min:e.max-r,max:n};case"middle":return{min:a-r/2,max:a+r/2};case"pointer":return EO(t,e,o??a);default:return{min:s,max:n}}}function EO(t,e,i){const o=t.max-t.min,s=e.max-e.min,n=i*(1-(s-o)),a=i-n,r=t.min+a,l=t.max+a;return{min:r,max:l}}function wO(t,e,i){return{x:{min:t.x.min*e,max:t.x.max*e},y:{min:t.y.min*i,max:t.y.max*i}}}function ti(t){return{x:vl(t.x),y:vl(t.y)}}function vl(t){const e=t.max-t.min;let i=t.max>pt.max?pt.max-e:t.min,o=t.min{const n=this.getRect();if(!n)return!0;const a=ao(n,s.x,s.y);return this.iterateFindNextZoomAtPoint(a)!=null}}),o=e.registerDefaultAction({id:BO,type:"series-area",label:"contextMenuPanToCursor",action:this.onPanToHere.bind(this),toggleEnabledOnShow:()=>!Ta(ue(this.zoomManager.getZoom()),Kd())});return()=>{i(),o()}}computeOrigin(t){const e=this.getRect(),{enabled:i}=this.getModuleProperties();if(!i||!e||!t?.target||!(t instanceof MouseEvent))return;const o={x:0,y:0,width:e.width,height:e.height};return ao(o,t.offsetX,t.offsetY)}onZoomToHere({event:t}){const e=this.computeOrigin(t);if(!e)return;const i=this.iterateFindNextZoomAtPoint(e);i!=null&&this.updateZoom(i)}onPanToHere({event:t}){const e=this.computeOrigin(t);if(!e)return;const i=ue(this.zoomManager.getZoom()),o=se(i),s=Je(i),n=e.x*o,a=e.y*s,r=(pt.max-pt.min)/2;let l={x:{min:e.x-r,max:e.x+r},y:{min:e.y-r,max:e.y+r}};l=Hm(l,o,s),l=ks(l,i.x.min-e.x+n,i.y.min-e.y+a),this.updateZoom(ti(l))}iterateFindNextZoomAtPoint(t){const{scrollingStep:e}=this.getModuleProperties();for(let i=e;i<=1-e;i+=e){const o=this.getNextZoomAtPoint(t,i);if(this.isZoomValid(o))return o}}getNextZoomAtPoint(t,e){const{isScalingX:i,isScalingY:o}=this.getModuleProperties(),s=ue(this.zoomManager.getZoom()),n=t.x*se(s),a=t.y*Je(s),r=pt.max-pt.min,l=r/2;let c={x:{min:t.x-l,max:t.x+l},y:{min:t.y-l,max:t.y+l}};return c=Hm(c,i?se(s)*e:r,o?Je(s)*e:r),c=ks(c,s.x.min-t.x+n,s.y.min-t.y+a),ti(c)}};import{_ModuleSupport as Ud}from"ag-charts-community";var{BBoxValues:VO}=Ud,FO=class{constructor(t){this.axesHandlers=t,this.axes=[]}initAxis(t,e,i,o){const{X:s,Y:n}=Ud.ChartAxisDirection,a={[s]:"ew-resize",[n]:"ns-resize"}[o],r="afterend",l=t.proxyInteractionService.createProxyElement({type:"region",domManagerId:e,where:r});return l.setCursor(a),l.addListener("drag-start",c=>{c.device==="touch"&&c.sourceEvent.preventDefault(),i.onDragStart(e,o)}),l.addListener("drag-move",c=>i.onDrag(c)),l.addListener("drag-end",i.onDragEnd),l.addListener("dblclick",()=>i.onDoubleClick(e,o)),{axisId:e,div:l}}destroy(){this.axes.forEach(t=>t.div.destroy())}update(t,e){if(this.axes.forEach(r=>r.div.setHidden(!t)),!t)return;const{X:i,Y:o}=Ud.ChartAxisDirection,s=[...e.axisManager.getAxisContext(i),...e.axisManager.getAxisContext(o)],{removed:n,added:a}=this.diffAxisIds(s);n.length>0&&(this.axes=this.axes.filter(r=>n.includes(r.axisId)?(r.div.destroy(),!1):!0));for(const r of a){const{axisId:l,direction:c}=r;this.axes.push(this.initAxis(e,l,this.axesHandlers,c))}for(const r of this.axes){const c=s.filter(h=>h.axisId===r.axisId)[0].getCanvasBounds();r.div.setHidden(VO.isEmpty(c)),c!==void 0&&r.div.setBounds(c)}}diffAxisIds(t){const e=this.axes.map(n=>n.axisId),i=t.map(n=>n.axisId),o=e.filter(n=>!i.includes(n)),s=t.filter(n=>!e.includes(n.axisId));return{removed:o,added:s}}};import{_ModuleSupport as GO}from"ag-charts-community";var Km=16,WO={off:1,short:.01,long:.002},HO=class{constructor(){this.deceleration=1,this.zoomCoordsHistoryIndex=0,this.coordsHistory=[]}get decelerationValue(){const{deceleration:t}=this;return Math.max(typeof t=="number"?t:WO[t]??1,1e-4)}addListener(t,e){return this.onUpdate=e,()=>{this.onUpdate=void 0}}stopInteractions(){this.inertiaHandle!=null&&(cancelAnimationFrame(this.inertiaHandle),this.inertiaHandle=void 0)}update(t){this.updateCoords(t.currentX,t.currentY);const{x1:e=0,y1:i=0,x2:o=0,y2:s=0}=this.coords??{};this.onUpdate?.({type:"update",deltaX:e-o,deltaY:i-s})}start(){this.coordsMonitorTimeout=setInterval(this.recordCurrentZoomCoords.bind(this),16)}stop(){const{coordsHistory:t}=this;let e=0,i=0,o=0;if(t.length>0){const s=this.zoomCoordsHistoryIndex%Km;let n=s-1;n<0&&(n=t.length-1);let a=s;a>=t.length&&(a=0);const r=t[n],l=t[a];e=r.x-l.x,i=r.y-l.y,o=r.t-l.t}if(this.coords=void 0,clearInterval(this.coordsMonitorTimeout),this.coordsMonitorTimeout=void 0,this.zoomCoordsHistoryIndex=0,this.coordsHistory.length=0,o>0&&this.decelerationValue<1){const s=e/o,n=i/o,a=Math.hypot(s,n),r=Math.atan2(n,s),l=performance.now();this.inertiaHandle=GO.getWindow().requestAnimationFrame(c=>{this.animateInertia(c,c,l,a,r)})}}recordCurrentZoomCoords(){const{coords:t,coordsHistory:e,zoomCoordsHistoryIndex:i}=this;if(!t)return;const{x2:o,y2:s}=t,n=Date.now();e[i%Km]={x:o,y:s,t:n},this.zoomCoordsHistoryIndex+=1}animateInertia(t,e,i,o,s){const n=1-this.decelerationValue,a=-o/Math.log(n),r=o*(n**(e-i)-1)/Math.log(n),l=o*(n**(t-i)-1)/Math.log(n);this.onUpdate?.({type:"update",deltaX:-Math.cos(s)*(l-r),deltaY:-Math.sin(s)*(l-r)}),!(l>=a-1)&&(this.inertiaHandle=requestAnimationFrame(c=>{this.animateInertia(c,t,i,o,s)}))}updateCoords(t,e){this.coords?this.coords={x1:this.coords.x2,y1:this.coords.y2,x2:t,y2:e}:this.coords={x1:t,y1:e,x2:t,y2:e}}translateZooms(t,e,i,o){const s=ao(t,t.x+Math.abs(i),t.y+t.height-Math.abs(o)),n=Math.sign(i)*s.x,a=-Math.sign(o)*s.y,r={};for(const[l,{direction:c,zoom:h}]of Object.entries(e)){if(h&&h.min===pt.min&&h.max===pt.max)continue;let p=ue({[c]:h});p=ti(ks(p,n*se(p),a*Je(p))),r[l]={direction:c,zoom:p[c]}}return r}};import{_ModuleSupport as KO}from"ag-charts-community";var UO=200,YO=class{update(t,e,i,o){const s=t.deltaX*e*UO;return this.translateZooms(i,o,s)}translateZooms(t,e,i){const o={},s=ao(t,t.x+Math.abs(i),0),n=i<0?-s.x:s.x;for(const[a,{direction:r,zoom:l}]of Object.entries(e)){if(r!==KO.ChartAxisDirection.X)continue;let c=ue({x:l});c=ti(ks(c,n*se(c),0)),o[a]={direction:r,zoom:c.x}}return o}};import{_ModuleSupport as Um}from"ag-charts-community";var jO=class{updateAxes(t,e,i,o){const s=t.sourceEvent,n={},{anchorPointX:a,anchorPointY:r,isScalingX:l,isScalingY:c,scrollingStep:h}=e,p=ao(i,s.offsetX??s.clientX,s.offsetY??s.clientY);for(const[u,{direction:g,zoom:y}]of Object.entries(o)){if(y==null)continue;let f={...y};const m=h*t.deltaY*(y.max-y.min);if(g===Um.ChartAxisDirection.X&&l)f.max+=m,f=pi(f,y,a,p.x);else if(g===Um.ChartAxisDirection.Y&&c)f.max+=m,f=pi(f,y,r,p.y);else continue;n[u]={direction:g,zoom:vl(f)}}return n}update(t,e,i,o){const{anchorPointX:s,anchorPointY:n,isScalingX:a,isScalingY:r,scrollingStep:l}=e,c=t.offsetX+i.x,h=t.offsetY+i.y,p=ao(i,c,h),u=t.deltaY;let g=ue(o);return g.x.max+=a?l*u*se(o):0,g.y.max+=r?l*u*Je(o):0,a&&(g.x=pi(g.x,o.x,s,p.x)),r&&(g.y=pi(g.y,o.y,n,p.y)),g=ti(g),g}updateDelta(t,e,i){const{anchorPointX:o,anchorPointY:s,isScalingX:n,isScalingY:a,scrollingStep:r}=e;let l=ue(i);return l.x.max+=n?r*-t*se(i):0,l.y.max+=a?r*-t*Je(i):0,n&&(l.x=pi(l.x,i.x,o)),a&&(l.y=pi(l.y,i.y,s)),l=ti(l),l}},XO=class{constructor(t,e,i){this.rect=t,this.getZoom=e,this.isZoomValid=i,this.rect.visible=!1}update(t,e,i){const o=t.currentX+(i?.x??0),s=t.currentY+(i?.y??0);this.rect.visible=!0,this.updateCoords(o,s,e,i),this.updateRect(i)}stop(t,e,i){let o=ue();if(!t||!e)return o;this.coords&&(o=this.createZoomFromCoords(e,i));const s=e.width/t.width,n=e.height/t.height;return o=ti(wO(o,s,n)),this.reset(),o}reset(){this.coords=void 0,this.rect.visible=!1}didUpdate(){return this.rect.visible&&this.rect.width>0&&this.rect.height>0}updateCoords(t,e,i,o){if(!this.coords){this.coords={x1:t,y1:e,x2:t,y2:e};return}const{coords:s}=this;if(s.x2=t,s.y2=e,!o)return;const{isScalingX:n,isScalingY:a,keepAspectRatio:r}=i,l=this.getNormalisedDimensions();if(r&&n&&a){const c=o.width/o.height;s.y2r&&spt.min;break;case"pan-end":o=t.x.maxpt.min;break;case"pan-right":o=t.x.maxy.identifier=0),this.previous.a1=NaN,this.previous.a2=NaN,this.previous.b1=NaN,this.previous.b2=NaN;for(const y of[0,1]){const f=o[y].clientX,m=n+r-o[y].clientY;this.touchStart.origins[y].identifier=o[y].identifier,this.touchStart.origins[y].normalX=Ml(this.initialZoom.x,f,s,a),this.touchStart.origins[y].normalY=Ml(this.initialZoom.y,m,n,r)}const[l,c]=o,[h,p]=this.touchStart.origins,u=Xm(l.clientX,l.radiusX,c.clientX,c.radiusX);return Xm(l.clientY,l.radiusY,c.clientY,c.radiusY)&&(h.normalY=p.normalY=(h.normalY+p.normalY)/2),u&&(h.normalX=p.normalX=(h.normalX+p.normalX)/2),!0}update(t,e){t.sourceEvent.preventDefault();const i=Array.from(t.sourceEvent.targetTouches),{x:o,y:s,width:n,height:a}=e.getBoundingClientRect(),{origins:r}=this.touchStart,l=[0,1].map(x=>i.find(v=>v.identifier===r[x].identifier)),c=r[0].normalX,h=r[1].normalX,p=l[0].clientX,u=l[1].clientX,g=r[0].normalY,y=r[1].normalY,f=s+a-l[0].clientY,m=s+a-l[1].clientY;return this.twitchTolerantZoomPan4(c,h,p,u,g,y,f,m,o,s,n,a)}end(t){const e=Array.from(t.sourceEvent.targetTouches).map(i=>i.identifier);return!e.includes(this.touchStart.origins[0].identifier)||!e.includes(this.touchStart.origins[1].identifier)}twitchTolerantZoomPan4(t,e,i,o,s,n,a,r,l,c,h,p){const{initialZoom:u,previous:g}=this,y=$m(t,e,i,o,g,"a1","a2",l,h,u.x),f=$m(s,n,a,r,g,"b1","b2",c,p,u.y);return{x:y,y:f}}};function $m(t,e,i,o,s,n,a,r,l,c){if(t!=e){const h=s[n],p=s[a];return Math.abs(i-h)+Math.abs(o-p)<=1?(i=h,o=p):(s[n]=i,s[a]=o),aL(t,e,i,o,r,l)}else{const h=Ml(c,i,r,l),p=Ml(c,o,r,l),u=(h+p)/2,g=(t-u)/Is;return{min:c.min+g,max:c.max+g}}}var{BOOLEAN:_i,NUMBER:Zm,POSITIVE_NUMBER:lL,RATIO:jd,UNION:Xd,OBJECT:Qm,OR:cL,ActionOnSet:kl,ChartAxisDirection:Ca,ChartUpdateType:qm,Deprecated:Jm,Validate:Dt,InteractionState:Al,ProxyProperty:hL,round:dL}=Ms,Il=t=>dL(t,10),tx="zoom-cursor",$d="zoom-tooltip",Zd=class extends Ms.BaseProperties{constructor(t){super(),this.onChange=t,this.enabled=!1,this.padding=0}};d([Dt(_i),kl({changeValue(t){this.onChange({enabled:t,padding:this.padding})}})],Zd.prototype,"enabled",2),d([Dt(jd),kl({changeValue(t){this.onChange({enabled:this.enabled,padding:t})}})],Zd.prototype,"padding",2);var Pt=class extends Ms.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!1,this.enableAxisDragging=!0,this.enableDoubleClickToReset=!0,this.enablePanning=!0,this.enableScrolling=!0,this.enableSelecting=!1,this.enableTwoFingerZoom=!0,this.panKey="alt",this.axes="x",this.scrollingStep=(pt.max-pt.min)/10,this.keepAspectRatio=!1,this.minVisibleItems=2,this.anchorPointX=Vm,this.anchorPointY=Fm,this.autoScaling=new Zd(i=>{this.ctx.zoomManager.setAutoScaleYAxis(i.enabled,i.padding)}),this.buttons=new An(this.ctx,this.getModuleProperties.bind(this),this.getResetZoom.bind(this),this.updateZoom.bind(this),this.updateAxisZoom.bind(this),this.resetZoom.bind(this),this.isZoomValid.bind(this)),this.axisDragger=new PO,this.panner=new HO,this.scroller=new jO,this.scrollPanner=new YO,this.twoFingers=new rL,this.deceleration="short",this.dragState=0,this.isState=i=>this.ctx.interactionManager.isState(i),this.destroyContextMenuActions=void 0,this.isFirstWheelEvent=!0,this.debouncedWheelReset=iI(()=>{this.isFirstWheelEvent=!0},100);const e=new xl;this.selector=new XO(e,this.getZoom.bind(this),this.isZoomValid.bind(this)),this.contextMenu=new zO(t.contextMenuRegistry,t.zoomManager,this.getModuleProperties.bind(this),()=>this.paddedRect,this.updateZoom.bind(this),this.isZoomValid.bind(this)),this.domProxy=new FO({onDragStart:(i,o)=>this.onAxisDragStart(i,o),onDrag:i=>{this.onDragMove({...i,currentX:i.offsetX,currentY:i.offsetY})},onDragEnd:()=>this.onDragEnd(),onDoubleClick:(i,o)=>{this.hoveredAxis={id:i,direction:o},this.onDoubleClick(),this.hoveredAxis=void 0}}),this.destroyFns.push(t.scene.attachNode(e),t.chartEventManager.addListener("series-keynav-zoom",i=>this.onNavZoom(i)),t.widgets.seriesDragInterpreter.addListener("dblclick",i=>this.onDoubleClick(i)),t.widgets.seriesDragInterpreter.addListener("drag-move",i=>this.onDragMove(i)),t.widgets.seriesDragInterpreter.addListener("drag-start",i=>this.onDragStart(i)),t.widgets.seriesDragInterpreter.addListener("drag-end",()=>this.onDragEnd()),t.widgets.seriesWidget.addListener("wheel",i=>this.onWheel(i)),t.widgets.seriesWidget.addListener("touchstart",(i,o)=>this.onTouchStart(i,o)),t.widgets.seriesWidget.addListener("touchmove",(i,o)=>this.onTouchMove(i,o)),t.widgets.seriesWidget.addListener("touchend",i=>this.onTouchEnd(i)),t.widgets.seriesWidget.addListener("touchcancel",i=>this.onTouchEnd(i)),t.updateService.addListener("process-data",i=>this.onProcessData(i)),t.layoutManager.addListener("layout:complete",i=>this.onLayoutComplete(i)),t.zoomManager.addListener("zoom-change",i=>this.onZoomChange(i)),t.zoomManager.addListener("zoom-pan-start",i=>this.onZoomPanStart(i)),this.panner.addListener("update",i=>this.onPanUpdate(i)),()=>this.teardown())}teardown(){this.ctx.zoomManager.setZoomModuleEnabled(!1),this.buttons.destroy(),this.destroyContextMenuActions?.()}onEnabledChange(t){this.ctx.zoomManager.setZoomModuleEnabled(t),this.contextMenu&&(this.destroyContextMenuActions?.(),this.destroyContextMenuActions=this.contextMenu.registerActions(t))}isIgnoredTouch(t){if(t?.device!=="touch")return!1;if(this.ctx.chartService.touch.dragAction!=="drag")return!0;if(this.enableSelecting)return!1;if(!this.enablePanning)return!0;const{x:e,y:i}=this.getZoom();return e.min===0&&e.max===1&&i.min===0&&i.max===1}onDoubleClick(t){const{enabled:e,enableDoubleClickToReset:i,hoveredAxis:o,ctx:{zoomManager:s}}=this;!e||!i||!this.isState(Al.ZoomClickable)||(o?s.resetAxisZoom("zoom",o.id):t?.preventZoomDblClick||this.resetZoom())}onDragStart(t){const{enabled:e,enableAxisDragging:i,enablePanning:o,enableSelecting:s,hoveredAxis:n,ctx:{domManager:a,zoomManager:r}}=this;if(!e||!this.hoveredAxis&&(!this.isState(Al.ZoomDraggable)||this.dragState!==0||this.isIgnoredTouch(t)))return;this.panner.stopInteractions();let l=0;if(i&&n)l=1;else if(t!=null){const c=this.isPanningKeyPressed(t.sourceEvent);o&&(!s||c)?(a.updateCursor(tx,"grabbing"),l=2,this.panner.start()):s&&!c&&(l=3)}(this.dragState=l)!==0&&r.fireZoomPanStartEvent("zoom")}onDragMove(t){const{anchorPointX:e,anchorPointY:i,axisDragger:o,dragState:s,enabled:n,paddedRect:a,panner:r,selector:l,seriesRect:c,shouldFlipXY:h,hoveredAxis:p,ctx:{interactionManager:u,tooltipManager:g,updateService:y,zoomManager:f}}=this;if(!n||!a||!c||!p&&(!this.isState(Al.ZoomDraggable)||this.isIgnoredTouch(t)))return;u.pushState(Ms.InteractionState.ZoomDrag),t.device==="touch"&&t.sourceEvent.preventDefault();const m=this.getZoom();switch(s){case 1:{if(!p)break;const{id:x,direction:v}=p;let S=v===Ca.X?e:i;h&&(S=v===Ca.X?i:e);const b=f.getAxisZoom(x),k=o.update(t,v,S,c,m,b);f.setAxisManuallyAdjusted("zoom",x),this.updateAxisZoom(x,v,k);break}case 2:r.update(t);break;case 3:l.update(t,this.getModuleProperties(),a);break;case 0:return}g.updateTooltip($d),y.update(qm.PERFORM_LAYOUT,{skipAnimations:!0})}onDragEnd(){const{axisDragger:t,dragState:e,enabled:i,panner:o,selector:s,ctx:{domManager:n,interactionManager:a,tooltipManager:r}}=this;if(a.popState(Ms.InteractionState.ZoomDrag),!(!i||e===0)){switch(e){case 1:this.hoveredAxis=void 0,t.stop();break;case 2:o.stop();break;case 3:{if(!s.didUpdate())break;const l=this.getZoom(),c=s.stop(this.seriesRect,this.paddedRect,l);this.updateZoom(c);break}}this.dragState=0,n.updateCursor(tx),r.removeTooltip($d)}}onNavZoom(t){const{enabled:e,enableScrolling:i,scroller:o}=this;!this.ctx.interactionManager.isState(Ms.InteractionState.Default)||!e||!i||(t.widgetEvent.sourceEvent.preventDefault(),this.updateZoom(o.updateDelta(t.delta,this.getModuleProperties(),this.getZoom())))}onWheel(t){const{enabled:e,enablePanning:i,enableScrolling:o,paddedRect:s}=this;if(!e||!o||!s||!this.isState(Al.ZoomWheelable))return;const{deltaX:n,deltaY:a}=t.sourceEvent,r=n!=null&&a!=null&&Math.abs(n)>Math.abs(a);i&&r?this.onWheelPanning(t):this.onWheelScrolling(t)}onWheelPanning(t){const{scrollingStep:e,scrollPanner:i,seriesRect:o,ctx:{zoomManager:s}}=this;if(!o)return;t.sourceEvent.preventDefault();const n=i.update(t,e,o,s.getAxisZooms());for(const[a,{direction:r,zoom:l}]of Object.entries(n))this.updateAxisZoom(a,r,l)}onWheelScrolling(t){const{enableAxisDragging:e,enableIndependentAxes:i,hoveredAxis:o,scroller:s,seriesRect:n,ctx:{zoomManager:a}}=this;if(!n)return;const r=this.getZoom();let l=t.deltaY>0&&this.isMaxZoom(r);const c=e&&o!=null;let h=this.isScalingX(),p=this.isScalingY();c&&(h=o.direction===Ms.ChartAxisDirection.X,p=!h);const u=this.getModuleProperties({isScalingX:h,isScalingY:p});let g=!0;if(i===!0){const y=s.updateAxes(t,u,n,a.getAxisZooms());for(const[f,{direction:m,zoom:x}]of Object.entries(y))c&&o.id!==f||g&&(g=this.updateAxisZoom(f,m,x))}else{const y=s.update(t,u,n,this.getZoom());g=this.updateUnifiedZoom(y)}l||(l=t.deltaY<0&&!g),(!this.isFirstWheelEvent||!l)&&t.sourceEvent.preventDefault(),this.isFirstWheelEvent=!1,this.debouncedWheelReset()}onAxisDragStart(t,e){this.hoveredAxis={id:t,direction:e},this.onDragStart(void 0)}onTouchStart(t,e){!this.enableTwoFingerZoom||this.dragState!==0||this.twoFingers.start(t,e,this.getZoom())&&(this.dragState=4)}onTouchMove(t,e){if(!this.enableTwoFingerZoom||this.dragState!==4)return;const i=this.twoFingers.update(t,e);this.updateZoom(ti(i))}onTouchEnd(t){!this.enableTwoFingerZoom||this.dragState!==4||(t.sourceEvent.preventDefault(),this.twoFingers.end(t)&&(this.dragState=0))}onProcessData(t){this.shouldFlipXY=t.series.shouldFlipXY}onLayoutComplete(t){this.domProxy.update(this.enableAxisDragging,this.ctx);const{enabled:e}=this;if(!e)return;const{series:{rect:i,paddedRect:o}}=t;this.seriesRect=i,this.paddedRect=o}onZoomChange(t){t.callerId!=="zoom"&&this.panner.stopInteractions();const e=this.getZoom();this.buttons.toggleVisibleZoomed(this.isMaxZoom(e))}onZoomPanStart(t){t.callerId==="zoom"&&this.panner.stopInteractions()}onPanUpdate(t){const{panner:e,seriesRect:i,ctx:{tooltipManager:o,zoomManager:s}}=this;if(!i)return;const n=e.translateZooms(i,s.getAxisZooms(),t.deltaX,t.deltaY);for(const[a,{direction:r,zoom:l}]of Object.entries(n))this.updateAxisZoom(a,r,l);o.updateTooltip($d)}isPanningKeyPressed(t){switch(this.panKey){case"alt":return t.altKey;case"ctrl":return t.ctrlKey;case"shift":return t.shiftKey;case"meta":return t.metaKey}}isScalingX(){return this.axes==="xy"?!0:this.shouldFlipXY?this.axes==="y":this.axes==="x"}isScalingY(){return this.axes==="xy"?!0:this.shouldFlipXY?this.axes==="x":this.axes==="y"}getAnchorPointX(){return this.shouldFlipXY?this.anchorPointY:this.anchorPointX}getAnchorPointY(){return this.shouldFlipXY?this.anchorPointX:this.anchorPointY}isMaxZoom(t){return Ta(t,Kd())}isZoomValid(t){const{minVisibleItems:e,minVisibleItemsX:i,minVisibleItemsY:o,ctx:{zoomManager:s}}=this;if(e===0)return!0;const n=this.getZoom(),a=Il(se(t))=l||n.isVisibleItemsCountAtLeast(c,h??i)}resetZoom(){this.ctx.zoomManager.resetZoom("zoom")}updateZoom(t){this.enableIndependentAxes?this.updatePrimaryAxisZooms(t):this.updateUnifiedZoom(t)}updateUnifiedZoom(t){return this.isZoomValid(t)?(this.ctx.zoomManager.updateZoom("zoom",t),!0):(this.ctx.updateService.update(qm.SCENE_RENDER,{skipAnimations:!0}),!1)}updatePrimaryAxisZooms(t){this.updatePrimaryAxisZoom(t,Ca.X),this.updatePrimaryAxisZoom(t,Ca.Y)}updatePrimaryAxisZoom(t,e){const i=this.ctx.zoomManager.getPrimaryAxisId(e);i!=null&&this.updateAxisZoom(i,e,t[e])}updateAxisZoom(t,e,i){const{enableIndependentAxes:o,ctx:{zoomManager:s}}=this;if(!i)return!1;const n=this.getZoom();return o!==!0?(n[e]=i,this.updateUnifiedZoom(n)):this.isAxisZoomValid(e,i)?(s.updateAxisZoom("zoom",t,i),!0):!1}getZoom(){return ue(this.ctx.zoomManager.getZoom())}getResetZoom(){return ue(this.ctx.zoomManager.getRestoredZoom())}getModuleProperties(t){return{anchorPointX:t?.anchorPointX??this.getAnchorPointX(),anchorPointY:t?.anchorPointY??this.getAnchorPointY(),enabled:t?.enabled??this.enabled,independentAxes:t?.independentAxes??this.enableIndependentAxes===!0,isScalingX:t?.isScalingX??this.isScalingX(),isScalingY:t?.isScalingY??this.isScalingY(),keepAspectRatio:t?.keepAspectRatio??this.keepAspectRatio,scrollingStep:t?.scrollingStep??this.scrollingStep}}};d([kl({newValue(t){this.onEnabledChange(t)}}),Dt(_i)],Pt.prototype,"enabled",2),d([Dt(_i)],Pt.prototype,"enableAxisDragging",2),d([Dt(_i)],Pt.prototype,"enableDoubleClickToReset",2),d([kl({changeValue(t){this.ctx.zoomManager.setIndependentAxes(!!t)}}),Dt(_i,{optional:!0})],Pt.prototype,"enableIndependentAxes",2),d([Dt(_i)],Pt.prototype,"enablePanning",2),d([Dt(_i)],Pt.prototype,"enableScrolling",2),d([Dt(_i)],Pt.prototype,"enableSelecting",2),d([Dt(_i)],Pt.prototype,"enableTwoFingerZoom",2),d([Dt(Xd(["alt","ctrl","meta","shift"],"a pan key"))],Pt.prototype,"panKey",2),d([Dt(Xd(["x","y","xy"],"an axis"))],Pt.prototype,"axes",2),d([Dt(jd)],Pt.prototype,"scrollingStep",2),d([Dt(_i)],Pt.prototype,"keepAspectRatio",2),d([Dt(lL)],Pt.prototype,"minVisibleItems",2),d([Jm("Use [minVisibleItems] instead."),Dt(Zm.restrict({min:1}))],Pt.prototype,"minVisibleItemsX",2),d([Jm("Use [minVisibleItems] instead."),Dt(Zm.restrict({min:1}))],Pt.prototype,"minVisibleItemsY",2),d([Dt(Sl)],Pt.prototype,"anchorPointX",2),d([Dt(Sl)],Pt.prototype,"anchorPointY",2),d([Dt(Qm)],Pt.prototype,"autoScaling",2),d([Dt(Qm)],Pt.prototype,"buttons",2),d([hL("panner.deceleration"),Dt(cL(jd,Xd(["off","short","long"],"a deceleration")))],Pt.prototype,"deceleration",2);var pL={enabled:!0,visible:"hover",buttons:[{icon:"zoom-out",tooltip:"toolbarZoomZoomOut",value:"zoom-out",section:"scale"},{icon:"zoom-in",tooltip:"toolbarZoomZoomIn",value:"zoom-in",section:"scale"},{icon:"pan-left",tooltip:"toolbarZoomPanLeft",value:"pan-left",section:"pan"},{icon:"pan-right",tooltip:"toolbarZoomPanRight",value:"pan-right",section:"pan"},{icon:"reset",tooltip:"toolbarZoomReset",value:"reset",section:"reset"}]},uL={type:"root",optionsKey:"zoom",packageType:"enterprise",chartTypes:["cartesian","topology"],moduleFactory:t=>new Pt(t),themeTemplate:{zoom:{anchorPointX:"end",anchorPointY:"middle",axes:"x",buttons:pL,enabled:!1,enableAxisDragging:!0,enableDoubleClickToReset:!0,enablePanning:!0,enableScrolling:!0,enableSelecting:!1,enableTwoFingerZoom:!0,deceleration:"short",minVisibleItems:2,panKey:"alt",scrollingStep:.1,autoScaling:{enabled:!1,padding:.05}}}};import"ag-charts-community";import{_ModuleSupport as gL}from"ag-charts-community";var{BOOLEAN:ex,OBJECT:yL,POSITION:fL,POSITIVE_NUMBER:Qd,BaseProperties:mL,AxisTicks:xL,ZIndexMap:SL,ProxyProperty:qd,Validate:Ds,LayoutElement:bL,createId:vL,Group:ML,Rect:kL,Marker:AL,TranslatableGroup:IL,LinearGradient:DL}=gL,Jd=class extends mL{constructor(){super(...arguments),this.thickness=16,this.preferredLength=100}};d([Ds(Qd)],Jd.prototype,"thickness",2),d([Ds(Qd)],Jd.prototype,"preferredLength",2);var Dl=class{constructor(t){this.axisTicks=t}};d([qd("axisTicks.label")],Dl.prototype,"label",2),d([qd("axisTicks.interval")],Dl.prototype,"interval",2),d([qd("axisTicks.padding")],Dl.prototype,"padding",2);var Ts=class{constructor(t){this.ctx=t,this.id=vL(this),this.legendGroup=new IL({name:"legend",zIndex:SL.LEGEND}),this.gradientRect=new kL,this.arrow=new AL({shape:"triangle"}),this.ticksGroup=new ML({name:"legend-axis-group"}),this.destroyFns=[],this.enabled=!1,this.position="bottom",this.reverseOrder=!1,this.gradient=new Jd,this.spacing=20,this.data=[],this.highlightManager=t.highlightManager,this.axisTicks=new xL,this.axisTicks.attachAxis(this.ticksGroup),this.scale=new Dl(this.axisTicks),this.legendGroup.append([this.gradientRect,this.arrow,this.ticksGroup]),this.destroyFns.push(t.highlightManager.addListener("highlight-change",()=>this.onChartHoverChange()),t.layoutManager.registerElement(bL.Legend,e=>this.onStartLayout(e)),()=>this.legendGroup.remove())}isVertical(){return this.position==="right"||this.position==="left"}destroy(){this.destroyFns.forEach(t=>t())}attachLegend(t){t.appendChild(this.legendGroup)}onStartLayout(t){const[e]=this.data;if(!this.enabled||!e?.enabled){this.legendGroup.visible=!1;return}const{colorRange:i}=this.normalizeColorArrays(e);this.updateGradientRect(t.layoutBox,i);const o=this.updateAxis(e),{left:s,top:n}=this.getMeasurements(t.layoutBox,o);this.updateArrow(),this.legendGroup.visible=!0,this.legendGroup.translationX=s,this.legendGroup.translationY=n}normalizeColorArrays(t){let e=t.colorDomain.slice();const i=t.colorRange.slice();if(e.length===i.length)return{colorDomain:e,colorRange:i};e.length>i.length&&i.splice(e.length);const[o,s]=e,n=i.length;return e=i.map((a,r)=>r===0?o:r===n-1?s:o+(s-o)*r/(n-1)),{colorDomain:e,colorRange:i}}updateGradientRect(t,e){const{gradientRect:i}=this,{preferredLength:o,thickness:s}=this.gradient;let n;this.isVertical()?(n=0,i.width=s,i.height=Math.min(t.height,o)):(n=90,i.width=Math.min(t.width,o),i.height=s),i.fill=new DL("oklch",e.map((a,r)=>({offset:r/(e.length-1),color:a})),n)}updateAxis(t){const{axisTicks:e}=this,i=this.isVertical(),o=this.reverseOrder!==i;return e.position=this.position,e.translationX=i?this.gradient.thickness:0,e.translationY=i?0:this.gradient.thickness,e.scale.domain=o?t.colorDomain.slice().reverse():t.colorDomain,e.scale.range=i?[0,this.gradientRect.height]:[0,this.gradientRect.width],e.calculateLayout()}updateArrow(){const t=this.highlightManager.getActiveHighlight(),{arrow:e}=this;if(t?.colorValue==null){e.visible=!1;return}const{scale:i,label:o}=this.axisTicks,s=o.fontSize??0,n=i.convert(t.colorValue);let{x:a,y:r}=this.gradientRect,l=Math.PI;this.isVertical()?(a-=s/2,r+=n,l/=2):(a+=n,r-=s/2),e.visible=!0,e.fill=o.color,e.rotation=l,e.size=s,e.translationX=a,e.translationY=r}getMeasurements(t,e){let{x:i,y:o}=t,{width:s,height:n}=this.gradientRect;switch(this.isVertical()?s+=e.width+5:n+=e.height+5,this.position){case"left":o+=t.height/2-n/2,t.shrink(s+this.spacing,"left");break;case"right":i+=t.width-s,o+=t.height/2-n/2,t.shrink(s+this.spacing,"right");break;case"top":i+=t.width/2-s/2,t.shrink(n+this.spacing,"top");break;case"bottom":i+=t.width/2-s/2,o+=t.height-n,t.shrink(n+this.spacing,"bottom")}return{top:o,left:i}}onChartHoverChange(){this.enabled&&this.updateArrow()}};Ts.className="GradientLegend",d([Ds(ex)],Ts.prototype,"enabled",2),d([Ds(fL)],Ts.prototype,"position",2),d([Ds(ex)],Ts.prototype,"reverseOrder",2),d([Ds(yL)],Ts.prototype,"gradient",2),d([Ds(Qd)],Ts.prototype,"spacing",2);var TL={type:"legend",optionsKey:"gradientLegend",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],identifier:"gradient",moduleFactory:t=>new Ts(t),themeTemplate:{enabled:!1,position:"bottom",spacing:20,scale:{padding:13,label:{color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"}},interval:{minSpacing:15}},gradient:{preferredLength:100,thickness:16},reverseOrder:!1},removable:"standalone-only"};import{_ModuleSupport as CL}from"ag-charts-community";function NL(t,e){const i=t.addChild("canvas-overlay","watermark"),o=CL.createElement("span");o.innerText=e,i.addEventListener("animationend",()=>{t.removeChild("canvas-overlay","watermark"),t.removeStyles("watermark")}),i.classList.add("ag-watermark"),i.appendChild(o)}import{_ModuleSupport as OL}from"ag-charts-community";import{_ModuleSupport as ix}from"ag-charts-community";import"ag-charts-community";import{_ModuleSupport as LL}from"ag-charts-community";var{findMinMax:RL}=LL,ne=0,Me=1,Le=2,Re=3,Ve=4;function Na(t,e=1){let i=Math.ceil(Math.log2(t.length/e))-1;return i=Math.min(Math.max(i,0),16),2**i|0}function Oa(t){return RL(t.map(e=>Number(e)))}function Tl(t,e,i){return(t.valueOf()-e)/(i-e)}function Cl(t,e){return Math.min(Math.floor(t*e),e-1)*Ve|0}function La(t,e,i,o,s,n){const a=new Int32Array(n*Ve).fill(-1),r=new Float64Array(n*Ve).fill(NaN);for(let l=0;lr[f+Me])&&(a[f+Me]=l,r[f+Me]=u),(m||yr[f+Re])&&(a[f+Re]=l,r[f+Re]=g)}return{indexData:a,valueData:r}}function Ra(t,e,i,{inPlace:o=!1}={}){const s=i/2|0,n=o?t:new Int32Array(s*Ve),a=o?e:new Float64Array(s*Ve);for(let r=0;re[h+Me]?c:h;n[l+Me]=t[g+Me],a[l+Me]=e[g+Me];const y=p||e[c+Le]e[h+Re]?c:h;n[l+Re]=t[f+Re],a[l+Re]=e[f+Re]}return{maxRange:s,indexData:n,valueData:a}}var ox={xMin:ne,xMax:Me,yMin:Le,yMax:Re,span:Ve},EL=1e3,wL=5;function sx(t,e){return Array.from({length:t},(i,o)=>{const s=o*Ve,n=e[s+ne],a=e[s+Me];return(n+a)/2|0})}function PL(t,e,i){if(t.length64;)({indexData:a,valueData:r,maxRange:n}=Ra(a,r,n)),l=sx(n,a),c.push({maxRange:n,indexData:a,indices:l,indexes:ox});return c.reverse(),c}var{ChartAxisDirection:_L,ContinuousScale:BL,OrdinalTimeScale:zL}=ix,VL=class extends ix.BarSeries{aggregateData(t,e){if(e?.type!=="ungrouped")return;const i=this.axes[_L.X];if(i==null||!(BL.is(i.scale)||zL.is(i.scale)))return;const o=t.resolveKeysById(this,"xValue",e),s=t.resolveColumnById(this,"yValue-raw",e),{index:n}=t.resolveProcessedDataDefById(this,"xValue"),a=e.domain.keys[n];return PL(o,s,a)}},{BarSeriesModule:FL}=OL,GL={...FL,type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"bar",moduleFactory:t=>new VL(t)};import{_ModuleSupport as WL}from"ag-charts-community";import{_ModuleSupport as tp}from"ag-charts-community";function HL(t){return{from:t?{scalingX:1,scalingY:0}:{scalingX:0,scalingY:1},to:{scalingX:1,scalingY:1}}}function KL(t){return(e,i)=>t?{scalingCenterY:i.scaledValues.medianValue}:{scalingCenterX:i.scaledValues.medianValue}}import{_ModuleSupport as nx}from"ag-charts-community";var{ScalableGroup:UL,Rect:In,Line:Ea,BBox:YL,Selection:ax}=nx,jL=class extends UL{constructor(){super(),this.append([new In({tag:0}),new In({tag:0}),new In({tag:2}),new In({tag:1}),new Ea({tag:3}),new Ea({tag:3}),new Ea({tag:4}),new Ea({tag:4})])}updateDatumStyles(t,e,i,o){const{bandwidth:s,scaledValues:{xValue:n,medianValue:a}}=t;let{minValue:r,q1Value:l,q3Value:c,maxValue:h}=t.scaledValues;(i&&!o||!i&&o)&&([h,c,l,r]=[r,l,c,h]);const p=(R,E,V,F)=>i?{y:R,x:E,width:F,height:V}:{x:R,y:E,width:V,height:F},u=(R,E,V)=>i?{y1:R,y2:E,x:V}:{x1:R,x2:E,y:V},g=(R,E,V)=>i?{x1:E,x2:V,y:R}:{x:R,y1:E,y2:V},y=(R,E,V,F)=>({x:R,y:E,width:V,height:F}=p(R,E,V,F),new YL(R,E,V,F)),{fill:f,fillOpacity:m,stroke:x,strokeWidth:v,strokeOpacity:S,lineDash:b,lineDashOffset:k,cornerRadius:I,cap:M,whisker:A}=e,T=ax.select(this,In),N=T.selectByTag(0),[L]=T.selectByTag(2),[D]=T.selectByTag(1),C=T.selectByTag(3),O=T.selectByTag(4);A.strokeWidth>s&&(A.strokeWidth=s);const w=p(l,n,c-l,s);L.setProperties(w),N[0].setProperties(w),N[0].setProperties({cornerRadius:I,clipBBox:y(l,n,Math.round(a-l+v/2),s)}),N[1].setProperties(w),N[1].setProperties({cornerRadius:I,clipBBox:y(Math.round(a-v/2),n,Math.floor(c-a+v/2),s)});const P=Math.max(Math.round(a-v/2),l+v),B=Math.min(Math.round(a+v/2),c-v);D.setProperties(w),D.setProperties({visible:P{const w=m[O];if(w==null)return;const P=x[O],B=v[O],z=S[O],_=b[O],R=k[O];if([P,B,z,_,R].some(Z=>typeof Z!="number")||P>B||B>z||z>_||_>R)return;const E={xValue:Math.round(o.scale.convert(w)),minValue:Math.round(s.scale.convert(P)),q1Value:Math.round(s.scale.convert(B)),medianValue:Math.round(s.scale.convert(z)),q3Value:Math.round(s.scale.convert(_)),maxValue:Math.round(s.scale.convert(R))};E.xValue+=Math.round(T.convert(String(M)))+A;const V=Math.round(I),F=Math.abs(E.q3Value-E.q1Value),G=E.xValue+V/2,W=Math.min(E.q3Value,E.q1Value)+F/2,K={x:N?G:W,y:N?W:G};let j;N?j={x:K.x-V/2,y:E.minValue,width:V,height:E.maxValue-E.minValue}:j={x:E.minValue,y:K.y-V/2,width:E.maxValue-E.minValue,height:V},f.push({series:this,itemId:w,datum:C,datumIndex:O,xKey:n,bandwidth:V,scaledValues:E,cap:g,whisker:y,fill:a,fillOpacity:r,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:p,lineDashOffset:u,midPoint:K,focusRect:j})}),L}legendItemSymbol(){const{fill:t,fillOpacity:e,stroke:i,strokeWidth:o,strokeOpacity:s,lineDash:n,lineDashOffset:a}=this.properties;return{marker:{fill:t,fillOpacity:e,stroke:i,strokeOpacity:s,strokeWidth:o,lineDash:n,lineDashOffset:a}}}getLegendData(t){const{id:e,ctx:{legendManager:i},visible:o}=this,{xKey:s,yName:n,showInLegend:a,legendItemName:r}=this.properties;return!s||t!=="category"?[]:[{legendType:"category",id:e,itemId:e,seriesId:e,enabled:o&&i.getItemEnabled({seriesId:e,itemId:e}),label:{text:r??n??e},symbol:this.legendItemSymbol(),legendItemName:r,hideInLegend:!a}]}getTooltipContent(t){const{id:e,dataModel:i,processedData:o,properties:s}=this,{xKey:n,xName:a,yName:r,medianKey:l,medianName:c,q1Key:h,q1Name:p,q3Key:u,q3Name:g,minKey:y,minName:f,maxKey:m,maxName:x,legendItemName:v,tooltip:S}=s,b=this.getCategoryAxis(),k=this.getValueAxis();if(!i||!o||!b||!k)return;const{datumIndex:I}=t,M=o.dataSources.get(this.id)?.[I],A=i.resolveKeysById(this,"xValue",o)[I],T=i.resolveColumnById(this,"minValue",o)[I],N=i.resolveColumnById(this,"q1Value",o)[I],L=i.resolveColumnById(this,"medianValue",o)[I],D=i.resolveColumnById(this,"q3Value",o)[I],C=i.resolveColumnById(this,"maxValue",o)[I];if(A==null)return;const O=this.getItemBaseStyle(!1);return Object.assign(O,this.getItemStyleOverrides(String(I),M,O,!1)),S.formatTooltip({heading:b.formatDatum(A),title:v??r,symbol:this.legendItemSymbol(),data:[{label:f,fallbackLabel:y,value:k.formatDatum(T)},{label:p,fallbackLabel:h,value:k.formatDatum(N)},{label:c,fallbackLabel:l,value:k.formatDatum(L)},{label:g,fallbackLabel:u,value:k.formatDatum(D)},{label:x,fallbackLabel:m,value:k.formatDatum(C)}]},{seriesId:e,datum:M,title:r,xKey:n,xName:a,yName:r,medianKey:l,medianName:c,q1Key:h,q1Name:p,q3Key:u,q3Name:g,minKey:y,minName:f,maxKey:m,maxName:x,...O})}animateEmptyUpdateReady({datumSelection:t}){const e=this.isVertical(),{from:i,to:o}=HL(e);gx.resetMotion([t],KL(e)),gx.staticFromToMotion(this.id,"datums",this.ctx.animationManager,[t],i,o,{phase:"initial"})}isLabelEnabled(){return!1}updateDatumSelection(t){const e=t.nodeData??[];return t.datumSelection.update(e)}getItemBaseStyle(t){const{properties:e}=this,{cornerRadius:i,cap:o,whisker:s}=e,n=t?e.highlightStyle.item:void 0,a=this.getStrokeWidth(e.strokeWidth);return{fill:n?.fill??e.fill,fillOpacity:n?.fillOpacity??e.fillOpacity,stroke:n?.stroke??e.stroke,strokeWidth:n?.strokeWidth??a,strokeOpacity:n?.strokeOpacity??e.strokeOpacity,lineDash:n?.lineDash??e.lineDash??[],lineDashOffset:n?.lineDashOffset??e.lineDashOffset,cornerRadius:i,cap:o,whisker:s}}getItemStyleOverrides(t,e,i,o){const{id:s,properties:n}=this,{xKey:a,minKey:r,q1Key:l,medianKey:c,q3Key:h,maxKey:p,itemStyler:u}=n;if(u!=null)return this.cachedDatumCallback(px(t,o?"highlight":"node"),()=>u({seriesId:s,datum:e,xKey:a,minKey:r,q1Key:l,medianKey:c,q3Key:h,maxKey:p,highlighted:o,...i}))}updateDatumNodes({datumSelection:t,isHighlight:e}){const i=this.isVertical(),o=this.getValueAxis()?.isReversed();t.each((s,n)=>{let a=this.getFormattedStyles(n,e?"highlight":"node");e&&(a=ip(this.properties.highlightStyle.item,a));const{stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:p}=a;a.whisker=ip(a.whisker,{stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:p}),s.updateDatumStyles(n,a,i,o)})}updateLabelNodes(){}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e)}nodeFactory(){return new jL}getFormattedStyles(t,e){const{id:i,properties:o}=this,{xKey:s,minKey:n,q1Key:a,medianKey:r,q3Key:l,maxKey:c,itemStyler:h,backgroundFill:p,cornerRadius:u}=o,{datum:g,stroke:y,strokeWidth:f,strokeOpacity:m,lineDash:x,lineDashOffset:v,cap:S,whisker:b}=t;let k,I;if(!0)k=t.fill,I=o.fillOpacity;else{try{k=op.mix(op.fromString(p),op.fromString(t.fill),o.fillOpacity).toString()}catch{k=t.fill}I=void 0}const A={fill:k,fillOpacity:I,stroke:y,strokeWidth:f,strokeOpacity:m,lineDash:x,lineDashOffset:v,cornerRadius:u,cap:hx(S),whisker:hx(b)};if(h){const T=this.cachedDatumCallback(px(g.index,e),()=>h({datum:g,seriesId:i,highlighted:e==="highlight",...A,xKey:s,minKey:n,q1Key:a,medianKey:r,q3Key:l,maxKey:c}));if(T)return ip(T,A)}return A}computeFocusBounds({datumIndex:t}){return sR(this,this.contextNodeData?.nodeData[t].focusRect)}};sp.className="BoxPlotSeries",sp.type="box-plot";import{_ModuleSupport as rR}from"ag-charts-community";var{CARTESIAN_AXIS_TYPE:yx}=rR.ThemeConstants,lR={series:{direction:"vertical",strokeWidth:2},axes:{[yx.NUMBER]:{crosshair:{snap:!1}},[yx.CATEGORY]:{groupPaddingInner:.2,crosshair:{enabled:!1,snap:!1}}}},{Color:np,swapAxisCondition:cR,ThemeSymbols:{DEFAULT_BACKGROUND_COLOUR:hR},ThemeConstants:{CARTESIAN_AXIS_TYPE:fx,CARTESIAN_POSITION:mx}}=WL,dR={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"box-plot",moduleFactory:t=>new sp(t),tooltipDefaults:{range:"exact"},defaultAxes:cR([{type:fx.NUMBER,position:mx.LEFT},{type:fx.CATEGORY,position:mx.BOTTOM}],t=>t?.direction==="horizontal"),themeTemplate:lR,groupable:!0,paletteFactory:({takeColors:t,themeTemplateParameters:e})=>{const i=e.get(hR),o=(Array.isArray(i)?i[0]:i)??"white",{fills:[s],strokes:[n]}=t(1);let a;try{a=np.mix(np.fromString(o),np.fromString(s),.3).toString()}catch{a=s}return{fill:a,stroke:n,backgroundFill:o}}};import{_ModuleSupport as pR}from"ag-charts-community";import{_ModuleSupport as ap}from"ag-charts-community";import{_ModuleSupport as rp}from"ag-charts-community";var uR=1e3,xx=ne,gR=Re,yR=Le,Sx=Me;function fR(t,e,i,o){if(t.length64;)({indexData:r,valueData:l,maxRange:a}=Ra(r,l,a)),c.push({maxRange:a,indexData:r});return c.reverse(),c}var{fixNumericExtent:mR,keyProperty:xR,createDatumId:bx,SeriesNodePickMode:vx,ChartAxisDirection:lp,SMALLEST_KEY_INTERVAL:SR,valueProperty:Ll,diff:bR,animationValidation:vR,computeBarFocusBounds:MR,visibleRangeIndices:Mx,ContinuousScale:kR,OrdinalTimeScale:AR,BandScale:IR}=rp,DR=class extends rp.SeriesNodeEvent{constructor(t,e,i,o){super(t,e,i,o),this.xKey=o.properties.xKey,this.openKey=o.properties.openKey,this.closeKey=o.properties.closeKey,this.highKey=o.properties.highKey,this.lowKey=o.properties.lowKey}},kx=class extends rp.AbstractBarSeries{constructor(t){super({moduleCtx:t,pickModes:[vx.AXIS_ALIGNED,vx.EXACT_SHAPE_MATCH],directionKeys:{x:["xKey"],y:["lowKey","highKey","openKey","closeKey"]},directionNames:{x:["xName"],y:["lowName","highName","openName","closeName"]},pathsPerSeries:[]}),this.NodeEvent=DR,this.dataAggregationFilters=void 0}async processData(t){if(!this.properties.isValid()||!this.visible)return;const{xKey:e,openKey:i,closeKey:o,highKey:s,lowKey:n}=this.properties,a=!this.ctx.animationManager.isSkipped(),r=this.getCategoryAxis()?.scale,l=this.getValueAxis()?.scale,{isContinuousX:c,xScaleType:h,yScaleType:p}=this.getScaleInformation({xScale:r,yScale:l}),u=[];a&&(this.processedData&&u.push(bR(this.id,this.processedData)),u.push(vR())),i&&u.push(Ll(i,p,{id:"openValue",invalidValue:void 0,missingValue:void 0}));const{dataModel:g,processedData:y}=await this.requestDataModel(t,this.data,{props:[xR(e,h,{id:"xValue"}),Ll(o,p,{id:"closeValue"}),Ll(s,p,{id:"highValue"}),Ll(n,p,{id:"lowValue"}),...c?[SR]:[],...u]});this.smallestDataInterval=y.reduced?.smallestKeyInterval,this.dataAggregationFilters=this.aggregateData(g,y),this.animationState.transition("updateData")}aggregateData(t,e){const i=this.axes[lp.X];if(i==null||!(kR.is(i.scale)||AR.is(i.scale)))return;const o=t.resolveKeysById(this,"xValue",e),s=t.resolveColumnById(this,"highValue",e),n=t.resolveColumnById(this,"lowValue",e),{index:a}=t.resolveProcessedDataDefById(this,"xValue"),r=e.domain.keys[a];return fR(o,s,n,r)}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!(e&&i))return[];if(t!==this.getBarDirection()){const{index:s,def:n}=i.resolveProcessedDataDefById(this,"xValue"),a=e.domain.keys[s];return n.type==="key"&&n.valueType==="category"?a:this.padBandExtent(a)}const o=this.domainForClippedRange(lp.Y,["highValue","lowValue"],"xValue",!0);return mR(o)}getSeriesRange(t,e){return this.domainForVisibleRange(lp.Y,["highValue","lowValue"],"xValue",e,!0)}getVisibleItems(t,e,i){return this.countVisibleItems("xValue",["highValue","lowValue"],t,e,i)}createNodeData(){const{visible:t,dataModel:e,processedData:i}=this,o=this.getCategoryAxis(),s=this.getValueAxis();if(!(e&&i&&o&&s))return;const n=[],{xKey:a,highKey:r,lowKey:l}=this.properties,c=i.dataSources.get(this.id)??[],h=e.resolveKeysById(this,"xValue",i),p=e.resolveColumnById(this,"openValue",i),u=e.resolveColumnById(this,"closeValue",i),g=e.resolveColumnById(this,"highValue",i),y=e.resolveColumnById(this,"lowValue",i),{groupScale:f}=this,{barWidth:m,groupIndex:x}=this.updateGroupScale(o),v=f.convert(String(x)),S=m>=1?m:f.rawBandwidth,b=IR.is(o.scale),k={itemId:a,nodeData:n,labelData:[],scales:this.calculateScaling(),visible:this.visible};if(!t)return k;const I=(O,w,P,B,z,_,R,E)=>{const V=c[O],F=b?R/2:0,G=o.scale.convert(w)+v+F,W=s.scale.convert(P),K=s.scale.convert(B),j=s.scale.convert(z),Z=s.scale.convert(_),J=B>P,tt=J?"up":"down",Q=Math.min(j,Z),U=Math.max(j,Z)-Q,q={x:G,y:Q+U/2};n.push({series:this,itemId:tt,datum:V,datumIndex:O,xKey:a,xValue:w,openValue:P,closeValue:B,highValue:z,lowValue:_,midPoint:q,aggregatedValue:B,isRising:J,centerX:G,width:R,y:Q,height:U,yOpen:W,yClose:K,crisp:E})},{dataAggregationFilters:M}=this,A=o.scale,[T,N]=A.range,L=N-T,D=O=>A.convert(h[O])+v,C=M?.find(O=>O.maxRange>L);if(C==null){let[O,w]=Mx(c.length,o.range,P=>{const B=D(P);return[B,B+S]});i.input.count<1e3&&(O=0,w=i.input.count);for(let P=O;P=z&&R>=_;if(!V){lt.warnOnce(`invalid low value for key [${l}] in data element, low value cannot be higher than datum open or close values`);continue}if(!F){lt.warnOnce(`invalid high value for key [${r}] in data element, high value cannot be lower than datum open or close values.`);continue}I(P,B,z,_,R,E,S,!0)}}else{const{maxRange:O,indexData:w}=C,[P,B]=Mx(O,o.range,z=>{const _=z*Ve,R=w[_+xx],E=w[_+Sx];if(R!==-1)return[D(R),D(E)+S]});for(let z=P;zr({seriesId:n,datum:e,itemId:i,xKey:l,openKey:c,closeKey:h,highKey:p,lowKey:u,highlighted:s,...o}))}getTooltipContent(t){const{id:e,dataModel:i,processedData:o,properties:s}=this,{xKey:n,xName:a,yName:r,openKey:l,openName:c,highKey:h,highName:p,lowKey:u,lowName:g,closeKey:y,closeName:f,legendItemName:m,tooltip:x}=s,v=this.getCategoryAxis(),S=this.getValueAxis();if(!i||!o||!v||!S)return;const{datumIndex:b}=t,k=o.dataSources.get(this.id)?.[b],I=i.resolveKeysById(this,"xValue",o)[b],M=i.resolveColumnById(this,"openValue",o)[b],A=i.resolveColumnById(this,"highValue",o)[b],T=i.resolveColumnById(this,"lowValue",o)[b],N=i.resolveColumnById(this,"closeValue",o)[b];if(I==null)return;const L=N>=M?"up":"down",D=this.properties.item[L],C=this.getItemBaseStyle(L,!1);return Object.assign(C,this.getItemStyleOverrides(String(b),k,L,C,!1)),x.formatTooltip({heading:v.formatDatum(I),title:m,symbol:{marker:{fill:D.fill??D.stroke,fillOpacity:D.fillOpacity??D.strokeOpacity??1,stroke:D.stroke,strokeWidth:D.strokeWidth??1,strokeOpacity:D.strokeOpacity??1,lineDash:D.lineDash??[0],lineDashOffset:D.lineDashOffset??0}},data:[{label:c,fallbackLabel:l,value:S.formatDatum(M)},{label:p,fallbackLabel:h,value:S.formatDatum(A)},{label:g,fallbackLabel:u,value:S.formatDatum(T)},{label:f,fallbackLabel:y,value:S.formatDatum(N)}]},{seriesId:e,datum:k,title:r,itemId:L,xKey:n,xName:a,yName:r,openKey:l,openName:c,highKey:h,highName:p,lowKey:u,lowName:g,closeKey:y,closeName:f,...C})}getDatumId(t){return bx(t.xValue)}computeFocusBounds(t){const e=this.getNodeData()?.at(t.datumIndex);if(e==null)return;const{centerX:i,y:o,width:s,height:n}=e,a={x:i-s/2,y:o,width:s,height:n};return MR(this,a)}};import{_ModuleSupport as TR}from"ag-charts-community";import{_ModuleSupport as CR}from"ag-charts-community";var{Path:NR,ScenePathChangeDetection:Wo,BBox:OR}=CR,Bi=class extends NR{constructor(){super(...arguments),this.centerX=0,this.y=0,this.width=0,this.height=0,this.yOpen=0,this.yClose=0,this.crisp=!1,this.strokeAlignment=0}computeBBox(){const{centerX:t,y:e,width:i,height:o}=this;return new OR(t-i/2,e,i,o)}isPointInPath(t,e){return this.getBBox().containsPoint(t,e)}distanceSquared(t,e){return this.getBBox().distanceSquared(t,e)}get midPoint(){return{x:this.centerX,y:this.y+this.height/2}}alignedCoordinates(){const{y:t,width:e,height:i,crisp:o,strokeAlignment:s}=this;let{centerX:n,yOpen:a,yClose:r}=this,l=n-e/2,c=n+e/2,h=t,p=t+i;if(o&&e>1){n=this.align(n),a=this.align(a),r=this.align(r);const g=this.align(e/2);l=n-g,c=n+g,h=this.align(t),p=h+this.align(h,i)}const u=(h+p)/2;return n+=s,l+=s,c+=s,h-=s,p+=s,a+=a1&&(t.moveTo(i,a),t.lineTo(e,a),t.moveTo(e,r),t.lineTo(o,r))}},{ScenePathChangeDetection:_a,ExtendedPath2D:RR}=TR,Tn=class extends Bi{constructor(){super(...arguments),this.wickPath=new RR,this.wickStroke=void 0,this.wickStrokeWidth=void 0,this.wickStrokeOpacity=void 0}updatePath(){const{path:t,stroke:e,strokeWidth:i,strokeOpacity:o,lineDash:s,lineDashOffset:n,wickStroke:a,wickStrokeWidth:r,wickStrokeOpacity:l,wickLineDash:c,wickLineDashOffset:h,strokeAlignment:p}=this,{centerX:u,x0:g,x1:y,y0:f,y1:m,yOpen:x,yClose:v}=this.alignedCoordinates();this.path.clear(),this.wickPath.clear();const b=a!=null&&a!==e||r!=null&&r!==i||l!=null&&l!==o||c!=null&&c!==s||h!=null&&h!==n?this.wickPath:t;if(Math.abs(y-g)<=3){b.moveTo(u,f),b.lineTo(u,m);return}const k=Math.min(x,v),I=Math.max(x,v);b.moveTo(u,f),b.lineTo(u,k+i/2),b.moveTo(u,m),b.lineTo(u,I-i/2);const M=p+i/2,A=I-k-2*M;if(A>0)t.rect(g+M,k+M,y-g-2*M,A);else{const T=(k+I)/2;t.moveTo(g,T),t.lineTo(y,T)}}drawPath(t){super.drawPath(t);const{wickPath:e}=this;if(e.isEmpty())return;const{stroke:i,strokeWidth:o,strokeOpacity:s,lineDash:n,lineDashOffset:a,wickStroke:r=i,wickStrokeWidth:l=o,wickStrokeOpacity:c=s,wickLineDash:h=n,wickLineDashOffset:p=a}=this;l!==0&&(t.globalAlpha*=c,typeof r=="string"&&(t.strokeStyle=r),t.lineWidth=l,h!=null&&t.setLineDash(h),t.lineDashOffset=p,t.stroke(e.getPath2D()))}};d([_a()],Tn.prototype,"wickStroke",2),d([_a()],Tn.prototype,"wickStrokeWidth",2),d([_a()],Tn.prototype,"wickStrokeOpacity",2),d([_a()],Tn.prototype,"wickLineDash",2),d([_a()],Tn.prototype,"wickLineDashOffset",2);import{_ModuleSupport as ER}from"ag-charts-community";import{_ModuleSupport as wR}from"ag-charts-community";var{BaseProperties:Ax,Validate:_t,AbstractBarSeriesProperties:PR,SeriesTooltip:_R,STRING:ui,COLOR_STRING:BR,FUNCTION:zR,LINE_DASH:VR,OBJECT:Rl,POSITIVE_NUMBER:Ix,RATIO:FR}=wR,Cs=class extends Ax{constructor(){super(...arguments),this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};d([_t(BR)],Cs.prototype,"stroke",2),d([_t(Ix)],Cs.prototype,"strokeWidth",2),d([_t(FR)],Cs.prototype,"strokeOpacity",2),d([_t(VR)],Cs.prototype,"lineDash",2),d([_t(Ix)],Cs.prototype,"lineDashOffset",2);var cp=class extends Ax{constructor(){super(...arguments),this.up=new Cs,this.down=new Cs}};d([_t(Rl)],cp.prototype,"up",2),d([_t(Rl)],cp.prototype,"down",2);var Ge=class extends PR{};d([_t(ui)],Ge.prototype,"xKey",2),d([_t(ui)],Ge.prototype,"openKey",2),d([_t(ui)],Ge.prototype,"closeKey",2),d([_t(ui)],Ge.prototype,"highKey",2),d([_t(ui)],Ge.prototype,"lowKey",2),d([_t(ui,{optional:!0})],Ge.prototype,"xName",2),d([_t(ui,{optional:!0})],Ge.prototype,"yName",2),d([_t(ui,{optional:!0})],Ge.prototype,"openName",2),d([_t(ui,{optional:!0})],Ge.prototype,"closeName",2),d([_t(ui,{optional:!0})],Ge.prototype,"highName",2),d([_t(ui,{optional:!0})],Ge.prototype,"lowName",2);var El=class extends Ge{constructor(){super(...arguments),this.tooltip=new _R,this.item=new cp}};d([_t(Rl)],El.prototype,"tooltip",2),d([_t(Rl)],El.prototype,"item",2),d([_t(zR,{optional:!0})],El.prototype,"itemStyler",2);var{BaseProperties:hp,SeriesTooltip:GR,Validate:jt,COLOR_STRING:dp,FUNCTION:WR,LINE_DASH:Dx,OBJECT:Ba,POSITIVE_NUMBER:za,RATIO:pp}=ER,Cn=class extends hp{};d([jt(dp,{optional:!0})],Cn.prototype,"stroke",2),d([jt(za)],Cn.prototype,"strokeWidth",2),d([jt(pp)],Cn.prototype,"strokeOpacity",2),d([jt(Dx,{optional:!0})],Cn.prototype,"lineDash",2),d([jt(za)],Cn.prototype,"lineDashOffset",2);var gi=class extends hp{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.wick=new Cn}};d([jt(dp,{optional:!0})],gi.prototype,"fill",2),d([jt(pp)],gi.prototype,"fillOpacity",2),d([jt(dp)],gi.prototype,"stroke",2),d([jt(za)],gi.prototype,"strokeWidth",2),d([jt(pp)],gi.prototype,"strokeOpacity",2),d([jt(Dx)],gi.prototype,"lineDash",2),d([jt(za)],gi.prototype,"lineDashOffset",2),d([jt(za)],gi.prototype,"cornerRadius",2),d([jt(Ba)],gi.prototype,"wick",2);var up=class extends hp{constructor(){super(...arguments),this.up=new gi,this.down=new gi}};d([jt(Ba)],up.prototype,"up",2),d([jt(Ba)],up.prototype,"down",2);var wl=class extends Ge{constructor(){super(...arguments),this.item=new up,this.tooltip=new GR}};d([jt(Ba)],wl.prototype,"item",2),d([jt(Ba)],wl.prototype,"tooltip",2),d([jt(WR,{optional:!0})],wl.prototype,"itemStyler",2);var{createDatumId:HR}=ap,gp=class extends kx{constructor(){super(...arguments),this.properties=new wl}nodeFactory(){return new Tn}updateDatumNodes({datumSelection:t,isHighlight:e}){const{id:i,properties:o}=this,{xKey:s,highKey:n,lowKey:a,openKey:r,closeKey:l,item:c,itemStyler:h}=o,{up:p,down:u}=c,{fill:g,fillOpacity:y,stroke:f,strokeWidth:m,strokeOpacity:x,lineDash:v,lineDashOffset:S}=p,{stroke:b,strokeWidth:k,strokeOpacity:I,lineDash:M,lineDashOffset:A}=p.wick,{fill:T,fillOpacity:N,stroke:L,strokeWidth:D,strokeOpacity:C,lineDash:O,lineDashOffset:w}=u,{stroke:P,strokeWidth:B,strokeOpacity:z,lineDash:_,lineDashOffset:R}=u.wick,E=e?o.highlightStyle.item:void 0;t.each((V,F)=>{const{isRising:G,centerX:W,width:K,y:j,height:Z,yOpen:J,yClose:tt,crisp:Q}=F;let U;if(h!=null){const{fill:it,fillOpacity:X,stroke:Ot,strokeWidth:It,strokeOpacity:at,lineDash:rt,lineDashOffset:gt}=G?p:u;U=this.cachedDatumCallback(HR(this.getDatumId(F),e?"highlight":"node"),()=>h({seriesId:i,itemId:F.itemId,xKey:s,highKey:n,lowKey:a,openKey:r,closeKey:l,datum:F.datum,fill:it,fillOpacity:X,strokeOpacity:at,stroke:Ot,strokeWidth:It,lineDash:rt,lineDashOffset:gt,highlighted:e}))}V.centerX=W,V.width=K,V.y=j,V.height=Z,V.yOpen=J,V.yClose=tt,V.crisp=Q,V.fill=E?.fill??U?.fill??(G?g:T),V.fillOpacity=E?.fillOpacity??U?.fillOpacity??(G?y:N),V.stroke=E?.stroke??U?.stroke??(G?f:L),V.strokeWidth=E?.strokeWidth??U?.strokeWidth??(G?m:D),V.strokeOpacity=E?.strokeOpacity??U?.strokeOpacity??(G?x:C),V.lineDash=E?.lineDash??U?.lineDash??(G?v:O),V.lineDashOffset=E?.lineDashOffset??U?.lineDashOffset??(G?S:w);const q=U?.wick;V.wickStroke=E?.stroke??q?.stroke??(G?b:P),V.wickStrokeWidth=E?.strokeWidth??q?.strokeWidth??(G?k:B),V.wickStrokeOpacity=E?.strokeOpacity??q?.strokeOpacity??(G?I:z),V.wickLineDash=E?.lineDash??q?.lineDash??(G?M:_),V.wickLineDashOffset=E?.lineDashOffset??q?.lineDashOffset??(G?A:R),V.strokeAlignment=(U?.strokeWidth??(G?m:D))/2})}legendItemSymbol(){const{up:t,down:e}=this.properties.item,i=new ap.LinearGradient("rgb",[{color:t.fill,offset:0},{color:t.fill,offset:.5},{color:e.fill,offset:.5}],90),o=new ap.LinearGradient("rgb",[{color:t.stroke,offset:0},{color:t.stroke,offset:.5},{color:e.stroke,offset:.5}],90);return{marker:{fill:i,fillOpacity:t.fillOpacity,stroke:o,strokeWidth:t.strokeWidth??1,strokeOpacity:t.strokeOpacity??1,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset}}}getLegendData(t){const{id:e,data:i,visible:o,ctx:{legendManager:s}}=this,{xKey:n,yName:a,showInLegend:r,legendItemName:l}=this.properties;return!i?.length||!n||t!=="category"?[]:[{legendType:"category",id:e,itemId:e,seriesId:e,enabled:o&&s.getItemEnabled({seriesId:e,itemId:e}),label:{text:l??a??e},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!r}]}};gp.className="CandleStickSeries",gp.type="candlestick";import{_ModuleSupport as KR}from"ag-charts-community";var{CARTESIAN_AXIS_TYPE:Tx}=KR.ThemeConstants,UR={series:{highlightStyle:{item:{strokeWidth:3}}},animation:{enabled:!1},axes:{[Tx.NUMBER]:{crosshair:{snap:!1}},[Tx.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},{CARTESIAN_AXIS_TYPE:Cx,CARTESIAN_POSITION:Nx}=pR.ThemeConstants,YR={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"candlestick",moduleFactory:t=>new gp(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:Cx.NUMBER,position:Nx.LEFT},{type:Cx.ORDINAL_TIME,position:Nx.BOTTOM}],themeTemplate:UR,groupable:!1,paletteFactory:({takeColors:t,colorsCount:e,userPalette:i,palette:o})=>{if(i==="user-indexed"){const{fills:s,strokes:n}=t(e);return{item:{up:{fill:"transparent",stroke:n[0]},down:{fill:s[0],stroke:n[0]}}}}return{item:{up:o.up,down:o.down}}}};import"ag-charts-community";import{_ModuleSupport as jR}from"ag-charts-community";import{_ModuleSupport as Ox}from"ag-charts-community";function Lx(t,e,i){i||(e=XR(e));const o=new Map;for(const n of t)o.set(n.id,{datum:n,linksBefore:[],linksAfter:[],maxPathLengthBefore:-1,maxPathLengthAfter:-1});let s=0;return o.forEach((n,a)=>{s=Math.max(s,yp(o,e,n,a,-1,[])+yp(o,e,n,a,1,[])+1)}),{links:e,nodeGraph:o,maxPathLength:s}}function Rx(t,e,i,o){const s=o.indexOf(e);if(s!==-1){for(let a=s;a!e.has(i))}function yp(t,e,i,o,s,n){if(n.includes(o))return 1/0;let a=s===-1?i.maxPathLengthBefore:i.maxPathLengthAfter;if(a===-1){a=0;const r=s===-1?i.linksBefore:i.linksAfter;for(const l of e){const{fromNode:c,toNode:h}=l,p=s===-1?h.id:c.id,u=s===-1?c.id:h.id,g=o===p?t.get(u):void 0;g!=null&&(r.push({node:g,link:l}),n?.push(o),a=Math.max(a,yp(t,e,g,u,s,n)+1),n?.pop())}s===-1?i.maxPathLengthBefore=a:i.maxPathLengthAfter=a}return a}var{Series:$R,DataController:ZR,Validate:QR,ARRAY:qR,keyProperty:JR,valueProperty:Pl,Selection:Ns,Group:Nn,TransformableText:tE}=Ox,eE=class extends Ox.SeriesNodeEvent{constructor(t,e,i,o){super(t,e,i,o);const{datumIndex:s}=i,n=o.contextNodeData?.nodeData.find(a=>a.datumIndex.type===s.type&&a.datumIndex.index===s.index);this.size=n?.size,this.label=n?.type===1?n?.label:void 0}},fp=class extends $R{constructor(){super(...arguments),this.NodeEvent=eE,this._chartNodes=void 0,this.nodeCount=0,this.linkCount=0,this.linksDataModel=void 0,this.linksProcessedData=void 0,this.nodesDataModel=void 0,this.nodesProcessedData=void 0,this.processedNodes=new Map,this.linkGroup=this.contentGroup.appendChild(new Nn({name:"linkGroup"})),this.nodeGroup=this.contentGroup.appendChild(new Nn({name:"nodeGroup"})),this.focusLinkGroup=this.highlightNode.appendChild(new Nn({name:"linkGroup"})),this.focusNodeGroup=this.highlightNode.appendChild(new Nn({name:"nodeGroup"})),this.highlightLinkGroup=this.highlightNode.appendChild(new Nn({name:"linkGroup"})),this.highlightNodeGroup=this.highlightNode.appendChild(new Nn({name:"nodeGroup"})),this.labelSelection=Ns.select(this.labelGroup,tE),this.linkSelection=Ns.select(this.linkGroup,()=>this.linkFactory()),this.nodeSelection=Ns.select(this.nodeGroup,()=>this.nodeFactory()),this.focusLinkSelection=Ns.select(this.focusLinkGroup,()=>this.linkFactory()),this.focusNodeSelection=Ns.select(this.focusNodeGroup,()=>this.nodeFactory()),this.highlightLinkSelection=Ns.select(this.highlightLinkGroup,()=>this.linkFactory()),this.highlightNodeSelection=Ns.select(this.highlightNodeGroup,()=>this.nodeFactory())}get nodes(){return this.properties.nodes??this._chartNodes}setChartNodes(t){this._chartNodes=t,this.nodes===t&&(this.nodeDataRefresh=!0)}async processData(t){const{data:e,nodes:i}=this;if(e==null||!this.properties.isValid())return;const{fromKey:o,toKey:s,sizeKey:n,idKey:a,labelKey:r}=this.properties,l=new ZR("standalone",t.suppressFieldDotNotation),c=i!=null?l.request(this.id,i,{props:[JR(a,void 0,{id:"idValue",includeProperty:!1}),...r!=null?[Pl(r,void 0,{id:"labelValue",includeProperty:!1})]:[]],groupByKeys:!0}):null,h=t.request(this.id,e,{props:[Pl(o,void 0,{id:"fromValue",includeProperty:!1}),Pl(s,void 0,{id:"toValue",includeProperty:!1}),...n!=null?[Pl(n,void 0,{id:"sizeValue",includeProperty:!1,missingValue:0})]:[]],groupByKeys:!1});i!=null&&l.execute();const[p,u]=await Promise.all([c,h]);this.nodesDataModel=p?.dataModel,this.nodesProcessedData=p?.processedData,this.linksDataModel=u?.dataModel,this.linksProcessedData=u?.processedData;const g=new Map;if(p==null){const y=u.dataModel.resolveColumnById(this,"fromValue",u.processedData),f=u.dataModel.resolveColumnById(this,"toValue",u.processedData),m=x=>{const v=g.size;return{series:this,itemId:void 0,datum:{},datumIndex:{type:1,index:v},type:1,index:v,linksBefore:[],linksAfter:[],id:x,size:0,label:x}};u.processedData.dataSources.get(this.id)?.forEach((x,v)=>{const S=y[v],b=f[v];S==null||b==null||(g.has(S)||g.set(S,m(S)),g.has(b)||g.set(b,m(b)))})}else{const y=p.dataModel.resolveColumnById(this,"idValue",p.processedData),f=r!=null?p.dataModel.resolveColumnById(this,"labelValue",p.processedData):void 0;p.processedData.dataSources.get(this.id)?.forEach((m,x)=>{const v=y[x],S=f?.[x];g.set(v,{series:this,itemId:void 0,datum:m,datumIndex:{type:1,index:x},type:1,index:x,linksBefore:[],linksAfter:[],id:v,size:0,label:S})})}this.processedNodes=g}getNodeGraph(t,e,{includeCircularReferences:i}){const{linksDataModel:o,linksProcessedData:s}=this;if(o==null||s==null){const{links:y,nodeGraph:f,maxPathLength:m}=Lx(new Map().values(),[],i);return this.nodeCount=0,this.linkCount=0,{nodeGraph:f,links:y,maxPathLength:m}}const{sizeKey:n}=this.properties,a=o.resolveColumnById(this,"fromValue",s),r=o.resolveColumnById(this,"toValue",s),l=n!=null?o.resolveColumnById(this,"sizeValue",s):void 0,c=new Map;this.processedNodes.forEach(y=>{const f=t(y);c.set(y.id,f)});const h=[];s.dataSources.get(this.id)?.forEach((y,f)=>{const m=a[f],x=r[f],v=l!=null?l[f]:1,S=c.get(m),b=c.get(x);if(v<=0||S==null||b==null)return;const k=e({series:this,itemId:void 0,datum:y,datumIndex:{type:0,index:f},type:0,index:f,fromNode:S,toNode:b,size:v});h.push(k)});const{links:p,nodeGraph:u,maxPathLength:g}=Lx(c.values(),h,i);return u.forEach(y=>{y.datum.linksBefore=y.linksBefore.map(f=>f.link),y.datum.linksAfter=y.linksAfter.map(f=>f.link)}),this.nodeCount=u.size,this.linkCount=p.length,{nodeGraph:u,links:p,maxPathLength:g}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(t){const{seriesRect:e}=t,i={seriesRectWidth:e?.width??0,seriesRectHeight:e?.height??0};(this._nodeDataDependencies==null||this._nodeDataDependencies.seriesRectWidth!==i.seriesRectWidth||this._nodeDataDependencies.seriesRectHeight!==i.seriesRectHeight)&&(this._nodeDataDependencies=i),this.updateSelections();const o=this.contextNodeData?.nodeData??[],s=this.contextNodeData?.labelData??[];let n=this.ctx.highlightManager?.getActiveHighlight();if(n?.series===this&&n.type==null){const{itemId:h}=n;n=h!=null?o.find(p=>p.type===1&&p.id===h):void 0}else n?.series!==this&&(n=void 0);this.contentGroup.visible=this.visible,this.contentGroup.opacity=n!=null?this.properties.highlightStyle.series.dimOpacity??1:1,this.labelSelection=this.updateLabelSelection({labelData:s,labelSelection:this.labelSelection}),this.updateLabelNodes({labelSelection:this.labelSelection}),this.linkSelection=this.updateLinkSelection({nodeData:o.filter(h=>h.type===0),datumSelection:this.linkSelection}),this.updateLinkNodes({datumSelection:this.linkSelection,isHighlight:!1}),this.nodeSelection=this.updateNodeSelection({nodeData:o.filter(h=>h.type===1),datumSelection:this.nodeSelection}),this.updateNodeNodes({datumSelection:this.nodeSelection,isHighlight:!1});let a,r,l,c;n?.type===1?(a=o.filter(h=>h.type===0&&(h.toNode===n||h.fromNode===n)),r=a.map(h=>h.fromNode===n?h.toNode:h.fromNode),r.push(n),l=[],c=[n]):n?.type===0?(a=[n],r=[n.fromNode,n.toNode],l=[n],c=[]):(a=[],r=[],l=[],c=[]),this.focusLinkSelection=this.updateLinkSelection({nodeData:a,datumSelection:this.focusLinkSelection}),this.updateLinkNodes({datumSelection:this.focusLinkSelection,isHighlight:!1}),this.focusNodeSelection=this.updateNodeSelection({nodeData:r,datumSelection:this.focusNodeSelection}),this.updateNodeNodes({datumSelection:this.focusNodeSelection,isHighlight:!1}),this.highlightLinkSelection=this.updateLinkSelection({nodeData:l,datumSelection:this.highlightLinkSelection}),this.updateLinkNodes({datumSelection:this.highlightLinkSelection,isHighlight:!0}),this.highlightNodeSelection=this.updateNodeSelection({nodeData:c,datumSelection:this.highlightNodeSelection}),this.updateNodeNodes({datumSelection:this.highlightNodeSelection,isHighlight:!0})}resetAnimation(t){}getSeriesDomain(t){return[]}getSeriesRange(t,e){return[NaN,NaN]}legendItemSymbol(t,e,i={}){const{fills:o,strokes:s}=this.properties,{fill:n=o[e%o.length],fillOpacity:a=1,stroke:r=s[e%s.length],strokeWidth:l=0,strokeOpacity:c=1,lineDash:h=[0],lineDashOffset:p=0}=i;return{marker:{fill:n,fillOpacity:a,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:p}}}getLegendData(t){if(t!=="category")return[];const{showInLegend:e}=this.properties;return Array.from(this.processedNodes.values(),({id:i,label:o},s)=>({legendType:"category",id:this.id,itemId:i,seriesId:this.id,enabled:!0,label:{text:o??i},symbol:this.legendItemSymbol(1,s),hideInLegend:!e,isFixed:!0}))}pickNodeClosestDatum({x:t,y:e}){let i=1/0,o;return this.linkSelection.each((s,n)=>{const a=s.containsPoint(t,e)?0:1/0;a{const a=s.distanceSquared(t,e);ah.datum),c=r.indexOf(o)+e;if(c>=0&&c0)s=r[r.length-1];else{const h=Array.from(this.nodeSelection,p=>p.datum);s=h[h.length-1]}}else if(o?.type===1){const r=Array.from(this.nodeSelection,h=>h.datum),c=r.indexOf(o)+e;c>=0&&cp.datum)[0]}if(s==null)return;const n=s.type===1?Array.from(this.nodeSelection).find(r=>r.datum===s):Array.from(this.linkSelection).find(r=>r.datum===s);if(n==null)return;const a=this.computeFocusBounds(n.node);if(a!=null)return{datum:n.datum,datumIndex:this.contextNodeData?.nodeData.indexOf(n.datum)??0,otherIndex:0,bounds:a,clipFocusBox:!0}}};d([QR(qR,{optional:!0,property:"nodes"})],fp.prototype,"_chartNodes",2);import{_ModuleSupport as iE}from"ag-charts-community";var{BBox:oE,Path:sE,ScenePathChangeDetection:Ho}=iE;function _l({radius:t,startAngle:e,endAngle:i,tension:o}){const s=t*Math.cos(e),n=t*Math.sin(e),a=t*Math.cos(i),r=t*Math.sin(i),l=s*o,c=n*o,h=a*o,p=r*o;return{x:[s,l,h,a],y:[n,c,p,r]}}var ro=class extends sE{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.radius=0,this.startAngle1=0,this.endAngle1=0,this.startAngle2=0,this.endAngle2=0,this.tension=1}computeBBox(){const{centerX:t,centerY:e,radius:i,startAngle1:o,endAngle1:s,startAngle2:n,endAngle2:a,tension:r}=this,l=_l({radius:i,startAngle:o,endAngle:a,tension:r}),c=_l({radius:i,startAngle:n,endAngle:s,tension:r}),h=Math.min(...l.x,...c.x),p=Math.max(...l.x,...c.x)-h,u=Math.min(...l.y,...c.y),g=Math.max(...l.y,...c.y)-u;return new oE(t+h,e+u,p,g)}tensionedCurveTo(t,e,i,o,s,n,a,r){const{path:l,tension:c}=this,h=1-c;l.cubicCurveTo((i-t)*h+t,(o-e)*h+e,(s-a)*h+a,(n-r)*h+r,a,r)}updatePath(){const{path:t,centerX:e,centerY:i,radius:o}=this;let{startAngle1:s,endAngle1:n,startAngle2:a,endAngle2:r}=this;s>a&&([s,a]=[a,s],[n,r]=[r,n]),t.clear();const l=e+o*Math.cos(s),c=i+o*Math.sin(s);t.moveTo(l,c),this.tensionedCurveTo(l,c,e,i,e,i,e+o*Math.cos(r),i+o*Math.sin(r)),t.arc(e,i,o,r,a,!0),this.tensionedCurveTo(e+o*Math.cos(a),i+o*Math.sin(a),e,i,e,i,e+o*Math.cos(n),i+o*Math.sin(n)),t.arc(e,i,o,n,s,!0),t.closePath()}};d([Ho()],ro.prototype,"centerX",2),d([Ho()],ro.prototype,"centerY",2),d([Ho()],ro.prototype,"radius",2),d([Ho()],ro.prototype,"startAngle1",2),d([Ho()],ro.prototype,"endAngle1",2),d([Ho()],ro.prototype,"startAngle2",2),d([Ho()],ro.prototype,"endAngle2",2),d([Ho()],ro.prototype,"tension",2);import{_ModuleSupport as nE}from"ag-charts-community";var{BaseProperties:Ex,SeriesTooltip:aE,SeriesProperties:rE,ARRAY:lE,COLOR_STRING:Bl,COLOR_STRING_ARRAY:wx,FUNCTION:Px,LINE_DASH:_x,OBJECT:zl,POSITIVE_NUMBER:Ko,RATIO:Va,STRING:Uo,Validate:ot,Label:cE}=nE,mp=class extends cE{constructor(){super(...arguments),this.spacing=1,this.maxWidth=1}};d([ot(Ko)],mp.prototype,"spacing",2),d([ot(Ko)],mp.prototype,"maxWidth",2);var zi=class extends Ex{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0,this.tension=0}};d([ot(Bl,{optional:!0})],zi.prototype,"fill",2),d([ot(Va)],zi.prototype,"fillOpacity",2),d([ot(Bl,{optional:!0})],zi.prototype,"stroke",2),d([ot(Va)],zi.prototype,"strokeOpacity",2),d([ot(Ko)],zi.prototype,"strokeWidth",2),d([ot(_x)],zi.prototype,"lineDash",2),d([ot(Ko)],zi.prototype,"lineDashOffset",2),d([ot(Va)],zi.prototype,"tension",2),d([ot(Px,{optional:!0})],zi.prototype,"itemStyler",2);var yi=class extends Ex{constructor(){super(...arguments),this.spacing=1,this.width=1,this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};d([ot(Ko)],yi.prototype,"spacing",2),d([ot(Ko)],yi.prototype,"width",2),d([ot(Bl,{optional:!0})],yi.prototype,"fill",2),d([ot(Va)],yi.prototype,"fillOpacity",2),d([ot(Bl,{optional:!0})],yi.prototype,"stroke",2),d([ot(Va)],yi.prototype,"strokeOpacity",2),d([ot(Ko)],yi.prototype,"strokeWidth",2),d([ot(_x)],yi.prototype,"lineDash",2),d([ot(Ko)],yi.prototype,"lineDashOffset",2),d([ot(Px,{optional:!0})],yi.prototype,"itemStyler",2);var ge=class extends rE{constructor(){super(...arguments),this.idKey="",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.sizeKey=void 0,this.sizeName=void 0,this.nodes=void 0,this.fills=[],this.strokes=[],this.label=new mp,this.link=new zi,this.node=new yi,this.tooltip=new aE}};d([ot(Uo)],ge.prototype,"fromKey",2),d([ot(Uo)],ge.prototype,"toKey",2),d([ot(Uo)],ge.prototype,"idKey",2),d([ot(Uo,{optional:!0})],ge.prototype,"idName",2),d([ot(Uo,{optional:!0})],ge.prototype,"labelKey",2),d([ot(Uo,{optional:!0})],ge.prototype,"labelName",2),d([ot(Uo,{optional:!0})],ge.prototype,"sizeKey",2),d([ot(Uo,{optional:!0})],ge.prototype,"sizeName",2),d([ot(lE,{optional:!0})],ge.prototype,"nodes",2),d([ot(wx)],ge.prototype,"fills",2),d([ot(wx)],ge.prototype,"strokes",2),d([ot(zl)],ge.prototype,"label",2),d([ot(zl)],ge.prototype,"link",2),d([ot(zl)],ge.prototype,"node",2),d([ot(zl)],ge.prototype,"tooltip",2);var{SeriesNodePickMode:Bx,CachedTextMeasurerPool:hE,TextWrapper:dE,TextUtils:pE,createDatumId:Vl,angleBetween:Fl,normalizeAngle360:uE,isBetweenAngles:zx,Sector:gE,evaluateBezier:Gl,applyShapeStyle:yE}=jR,Wl=t=>t.startAngle+Fl(t.startAngle,t.endAngle)/2,xp=class extends fp{constructor(t){super({moduleCtx:t,pickModes:[Bx.NEAREST_NODE,Bx.EXACT_SHAPE_MATCH]}),this.properties=new ge}isLabelEnabled(){return(this.properties.labelKey!=null||this.nodes==null)&&this.properties.label.enabled}linkFactory(){return new ro}nodeFactory(){return new gE}createNodeData(){const{id:t,_nodeDataDependencies:{seriesRectWidth:e,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0}}=this,{fromKey:o,toKey:s,sizeKey:n,label:{spacing:a,maxWidth:r,fontSize:l},node:{width:c,spacing:h}}=this.properties,p=e/2,u=i/2;let g=[];const{nodeGraph:y,links:f}=this.getNodeGraph(C=>({...C,centerX:p,centerY:u,innerRadius:NaN,outerRadius:NaN,startAngle:NaN,endAngle:NaN}),C=>({...C,centerX:p,centerY:u,radius:NaN,startAngle1:NaN,endAngle1:NaN,startAngle2:NaN,endAngle2:NaN}),{includeCircularReferences:!0});let m=0;y.forEach(({datum:C,linksBefore:O,linksAfter:w},P)=>{const B=O.reduce((z,{link:_})=>z+_.size,0)+w.reduce((z,{link:_})=>z+_.size,0);if(B===0)y.delete(P);else{C.size=B,m+=C.size;const z=this.getLabelText(this.properties.label,{datum:C.datum,value:C.label,fromKey:o,toKey:s,sizeKey:n,size:C.size});C.label=String(z)}});let x=0;if(this.isLabelEnabled()){const C=this.properties.label.getFont();let O=0;y.forEach(({datum:w})=>{const{id:P,label:B}=w;if(B==null)return;const z=dE.wrapText(B,{maxWidth:r,font:this.properties.label,textWrap:"never"}),{width:_}=hE.measureText(z,{font:C,textAlign:"left",textBaseline:"middle"});O=Math.max(_,O),g.push({id:P,text:z,centerX:p,centerY:u,angle:NaN,radius:NaN})}),x=O+a}const v=y.size;let S=Math.min(e,i)/2-c-x,b=h/S;if(x!==0&&(v*b>=1.5*Math.PI||S<=0)&&(g=[],S=Math.min(e,i)/2-c,b=h/S),v*b>=2*Math.PI||S<=0){lt.warnOnce("There was insufficient space to display the Chord Series.");return}const k=S,I=S+c,M=Math.max((2*Math.PI-v*b)/m,0);let A=0;y.forEach(({datum:C})=>{C.innerRadius=k,C.outerRadius=I,C.startAngle=A,C.endAngle=A+C.size*M,A=C.endAngle+b;const O=(C.innerRadius+C.outerRadius)/2,w=Wl(C);C.midPoint={x:C.centerX+O*Math.cos(w),y:C.centerY+O*Math.sin(w)}});const T=[];y.forEach(({datum:C,linksBefore:O,linksAfter:w})=>{const P=Wl(C),B=[...O.map(_=>({link:_.link,distance:Fl(Wl(_.node.datum),P),after:!1})),...w.map(_=>({link:_.link,distance:Fl(Wl(_.node.datum),P),after:!0}))];let z=C.startAngle;B.toSorted((_,R)=>_.distance-R.distance).forEach(({link:_,after:R})=>{const E=_.size*M;R?(_.startAngle1=z,_.endAngle1=z+E):(_.startAngle2=z,_.endAngle2=z+E),z+=_.size*M}),T.push(C)});const{tension:N}=this.properties.link;f.forEach(C=>{C.radius=S;const O=_l({radius:S,startAngle:C.startAngle1,endAngle:C.endAngle2,tension:N}),w=_l({radius:S,startAngle:C.startAngle2,endAngle:C.endAngle1,tension:N}),P=Gl(...O.x,.5),B=Gl(...O.y,.5),z=Gl(...w.x,.5),_=Gl(...w.y,.5);C.midPoint={x:C.centerX+(P+z)/2,y:C.centerY+(B+_)/2},T.push(C)}),g.forEach(C=>{const O=y.get(C.id)?.datum;O!=null&&(C.radius=I+a,C.angle=uE(O.startAngle+Fl(O.startAngle,O.endAngle)/2))}),g.sort((C,O)=>C.angle-O.angle);let L=1/0,D=-1/0;return g=g.filter(C=>{const O=pE.getLineHeight(l),w=Math.atan2(O/2,C.radius),P=C.angle-w,B=C.angle+w;return zx(L,P,B)||zx(D,P,B)?!1:(L=Math.min(P,L),D=Math.max(B,D),!0)}),{itemId:t,nodeData:T,labelData:g}}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e)}updateLabelNodes(t){const{labelSelection:e}=t,{color:i,fontStyle:o,fontWeight:s,fontSize:n,fontFamily:a}=this.properties.label;e.each((r,{text:l,centerX:c,centerY:h,radius:p,angle:u})=>{r.visible=!0,r.translationX=c+p*Math.cos(u),r.translationY=h+p*Math.sin(u),r.text=l,r.fill=i,r.fontStyle=o,r.fontWeight=s,r.fontSize=n,r.fontFamily=a,r.textBaseline="middle",Math.cos(u)>=0?(r.textAlign="left",r.rotation=u):(r.textAlign="right",r.rotation=u-Math.PI)})}updateNodeSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>Vl([e.type,e.id]))}getBaseNodeStyle(t){const{properties:e}=this,{fill:i,fillOpacity:o,stroke:s,strokeOpacity:n,lineDash:a,lineDashOffset:r}=e.node,l=t?e.highlightStyle.item:void 0;return{fill:l?.fill??i,fillOpacity:l?.fillOpacity??o,stroke:l?.stroke??s,strokeOpacity:l?.strokeOpacity??n,strokeWidth:l?.strokeWidth??this.getStrokeWidth(e.node.strokeWidth),lineDash:l?.lineDash??a,lineDashOffset:l?.lineDashOffset??r}}getNodeStyleOverrides(t,e,i,o,s,n,a){const{id:r,properties:l}=this,{fills:c,strokes:h}=l,{itemStyler:p}=l.node,u=n.fill??c[i%c.length],g=n.stroke??h[i%h.length],y={};if(a||(y.fill=u,y.stroke=g),p!=null){const f=this.cachedDatumCallback(Vl(t,a?"highlight":"node"),()=>{const{fillOpacity:m=1,strokeOpacity:x=1,strokeWidth:v=0,lineDash:S=[],lineDashOffset:b=0}=n;return p({seriesId:r,datum:e,highlighted:a,label:s,size:o,fill:u,fillOpacity:m,stroke:g,strokeOpacity:x,strokeWidth:v,lineDash:S,lineDashOffset:b})});Object.assign(y,f)}return y}updateNodeNodes(t){const{datumSelection:e,isHighlight:i}=t,o=this.getBaseNodeStyle(i);e.each((s,n)=>{const{datumIndex:a,size:r,label:l}=n,c=this.getNodeStyleOverrides(String(a),n,a.index,r,l,o,i);s.centerX=n.centerX,s.centerY=n.centerY,s.innerRadius=n.innerRadius,s.outerRadius=n.outerRadius,s.startAngle=n.startAngle,s.endAngle=n.endAngle,s.fill=c.fill??o?.fill,s.fillOpacity=c.fillOpacity??o?.fillOpacity,s.stroke=c.stroke??o?.stroke,s.strokeOpacity=c.strokeOpacity??o?.strokeOpacity,s.strokeWidth=c.strokeWidth??o?.strokeWidth,s.lineDash=c.lineDash??o?.lineDash,s.lineDashOffset=c.lineDashOffset??o?.lineDashOffset,s.inset=s.strokeWidth/2})}updateLinkSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>Vl([e.type,e.index,e.fromNode.id,e.toNode.id]))}getBaseLinkStyle(t){const{properties:e}=this,{fill:i,fillOpacity:o,stroke:s,strokeOpacity:n,lineDash:a,lineDashOffset:r,tension:l}=e.link,c=t?e.highlightStyle.item:void 0;return{fill:c?.fill??i,fillOpacity:c?.fillOpacity??o,stroke:c?.stroke??s,strokeOpacity:c?.strokeOpacity??n,strokeWidth:c?.strokeWidth??this.getStrokeWidth(e.link.strokeWidth),lineDash:c?.lineDash??a,lineDashOffset:c?.lineDashOffset??r,tension:l}}getLinkStyleOverrides(t,e,i,o,s){const{id:n,properties:a}=this,{fills:r,strokes:l}=a,{itemStyler:c}=a.link,h=o.fill??r[i%r.length],p=o.stroke??l[i%l.length],u={};if(s||(u.fill=h,u.stroke=p),c!=null){const g=this.cachedDatumCallback(Vl(t,s?"highlight":"node"),()=>{const{fillOpacity:y=1,strokeOpacity:f=1,strokeWidth:m=0,lineDash:x=[],lineDashOffset:v=0,tension:S}=o;return c({seriesId:n,datum:e,highlighted:s,tension:S,fill:h,fillOpacity:y,stroke:p,strokeOpacity:f,strokeWidth:m,lineDash:x,lineDashOffset:v})});Object.assign(u,g)}return u}updateLinkNodes(t){const{datumSelection:e,isHighlight:i}=t,o=this.getBaseLinkStyle(i);e.each((s,n)=>{const{datumIndex:a}=n,r=n.fromNode.datumIndex,l=this.getLinkStyleOverrides(String(a),n,r.index,o,i);s.centerX=n.centerX,s.centerY=n.centerY,s.radius=n.radius,s.startAngle1=n.startAngle1,s.endAngle1=n.endAngle1,s.startAngle2=n.startAngle2,s.endAngle2=n.endAngle2,yE(s,o,l),s.tension=l?.tension??o.tension})}getTooltipContent(t){const{id:e,linksProcessedData:i,nodesProcessedData:o,properties:s}=this,{fromKey:n,toKey:a,sizeKey:r,sizeName:l,tooltip:c}=s,{datumIndex:h}=t,p=t.type===0?t.fromNode.index:t.index,u=t.type===0?`${t.fromNode.label} - ${t.toNode.label}`:t.label,g=h.type===0?i?.dataSources.get(this.id)?.[h.index]:o?.dataSources.get(this.id)?.[h.index],y=t.size;let f;if(t.type===0){const m=t.fromNode.datumIndex,x=this.getBaseLinkStyle(!1);Object.assign(x,this.getLinkStyleOverrides(String(h),g,m.index,x,!1)),f=x}else{const m=t.label,x=this.getBaseNodeStyle(!1);Object.assign(x,this.getNodeStyleOverrides(String(h),g,h.index,y,m,x,!1)),f=x}return c.formatTooltip({title:u,symbol:this.legendItemSymbol(t.type,p,f),data:r!=null?[{label:l,fallbackLabel:r,value:String(y)}]:[]},{seriesId:e,datum:g,title:u,fromKey:n,toKey:a,sizeKey:r,sizeName:l,size:y,...f})}computeFocusBounds(t){return t}};xp.className="ChordSeries",xp.type="chord";var fE={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["flow-proportion"],solo:!0,identifier:"chord",tooltipDefaults:{range:"exact"},moduleFactory:t=>new xp(t),themeTemplate:{series:{highlightStyle:{series:{dimOpacity:.2}},label:{fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:5,maxWidth:100},node:{spacing:8,width:10,strokeWidth:0},link:{fillOpacity:.5,strokeWidth:0,tension:.4}},legend:{enabled:!1,toggleSeries:!1}},paletteFactory({takeColors:t,colorsCount:e}){const{fills:i,strokes:o}=t(e);return{fills:i,strokes:o}}};import{_ModuleSupport as mE}from"ag-charts-community";import{_ModuleSupport as xE}from"ag-charts-community";var{ThemeConstants:{CARTESIAN_AXIS_TYPE:On,CARTESIAN_POSITION:Ln},ThemeSymbols:{DEFAULT_SHADOW_COLOUR:SE}}=xE;function Vx(t){const{placement:e,...i}=t?.stageLabel??{};return t?.direction!=="horizontal"?[{type:On.CATEGORY,position:e==="after"?Ln.RIGHT:Ln.LEFT,label:i},{type:On.NUMBER,position:Ln.BOTTOM}]:[{type:On.NUMBER,position:Ln.LEFT},{type:On.CATEGORY,position:e==="before"?Ln.TOP:Ln.BOTTOM,label:i}]}var bE={series:{direction:"vertical",strokeWidth:0,spacingRatio:.25,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}},dropOff:{enabled:!0,fillOpacity:.2,strokeWidth:0},shadow:{enabled:!1,color:SE,xOffset:3,yOffset:3,blur:5}},axes:{[On.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1,formatter(t){return Math.abs(t.value).toFixed(t.fractionDigits??0)}}},[On.CATEGORY]:{line:{enabled:!1}}}};import{_ModuleSupport as vE}from"ag-charts-community";import{_ModuleSupport as Sp}from"ag-charts-community";import{_ModuleSupport as ME}from"ag-charts-community";var{lineDistanceSquared:Hl,BBox:kE,Path:AE,ScenePathChangeDetection:Yo}=ME,Fx=1e-6;function Gx([t,e],[i,o]){return Math.abs(t-i)<=Fx&&Math.abs(e-o)<=Fx}var Vi=class extends AE{constructor(){super(...arguments),this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y3=0}get midPoint(){const{x0:t,y0:e,x1:i,y1:o,x2:s,y2:n,x3:a,y3:r}=this;return{x:(t+i+s+a)/4,y:(e+o+n+r)/4}}distanceSquared(t,e){if(this.containsPoint(t,e))return 0;const{x0:i,y0:o,x1:s,y1:n,x2:a,y2:r,x3:l,y3:c}=this;return Math.min(Hl(t,e,i,o,s,n,1/0),Hl(t,e,s,n,a,r,1/0),Hl(t,e,a,r,l,c,1/0),Hl(t,e,l,c,i,o,1/0))}computeBBox(){const{x0:t,y0:e,x1:i,y1:o,x2:s,y2:n,x3:a,y3:r}=this,l=Math.min(t,i,s,a),c=Math.max(t,i,s,a)-l,h=Math.min(e,o,n,r),p=Math.max(e,o,n,r)-h;return new kE(l,h,c,p)}updatePath(){const{path:t,x0:e,y0:i,x1:o,y1:s,x2:n,y2:a,x3:r,y3:l}=this,c=[[e,i],[o,s],[n,a],[r,l]];t.clear();let h,p;c.forEach(u=>{if(h!=null&&Gx(h,u)||p!=null&&Gx(p,u))return;const[g,y]=u;h==null?t.moveTo(g,y):t.lineTo(g,y),h??(h=u),p=u}),t.closePath()}};d([Yo()],Vi.prototype,"x0",2),d([Yo()],Vi.prototype,"y0",2),d([Yo()],Vi.prototype,"x1",2),d([Yo()],Vi.prototype,"y1",2),d([Yo()],Vi.prototype,"x2",2),d([Yo()],Vi.prototype,"y2",2),d([Yo()],Vi.prototype,"x3",2),d([Yo()],Vi.prototype,"y3",2);import{_ModuleSupport as IE}from"ag-charts-community";var{NODE_UPDATE_STATE_TO_PHASE_MAPPING:DE}=IE;function Wx(t,e,i,o){const{x0:s,y0:n,x1:a,y1:r,x2:l,y2:c,x3:h,y3:p,opacity:u}=t;return i?{x0:(s+h)/2,y0:(n+p)/2,x1:(a+l)/2,y1:(r+c)/2,x2:(a+l)/2,y2:(r+c)/2,x3:(s+h)/2,y3:(n+p)/2,opacity:u}:{x0:(s+a)/2,y0:(n+r)/2,x1:(s+a)/2,y1:(n+r)/2,x2:(l+h)/2,y2:(c+p)/2,x3:(l+h)/2,y3:(c+p)/2,opacity:u}}function TE(t,e){const i=n=>n==null;return{fromFn:(n,a,r)=>{r==="updated"&&i(a)?r="removed":r==="updated"&&i(n.previousDatum)&&(r="added");let l;r==="added"&&n.previousDatum==null&&e==="fade"?l={...Fa(n,a),opacity:0}:r==="unknown"||r==="added"?l=Wx(a,n.previousDatum,t,e):l={x0:n.x0,y0:n.y0,x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,x3:n.x3,y3:n.y3,opacity:n.opacity};const c=DE[r];return{...l,phase:c}},toFn:(n,a,r)=>{let l;return r==="removed"&&n.datum==null&&e==="fade"?l={...Fa(n,a),opacity:0}:r==="removed"||i(a)?l=Wx(a,n.previousDatum,t,e):l=Fa(n,a),l}}}function Fa(t,e){const{x0:i,y0:o,x1:s,y1:n,x2:a,y2:r,x3:l,y3:c,opacity:h}=e;return{x0:i,y0:o,x1:s,y1:n,x2:a,y2:r,x3:l,y3:c,opacity:h}}var{SeriesNodePickMode:Hx,SeriesZIndexMap:Kx,valueProperty:CE,keyProperty:NE,ChartAxisDirection:Ux,updateLabelNode:OE,SMALLEST_KEY_INTERVAL:LE,LARGEST_KEY_INTERVAL:RE,diff:EE,fixNumericExtent:wE,seriesLabelFadeInAnimation:Yx,resetMotion:PE,resetLabelFn:_E,animationValidation:BE,computeBarFocusBounds:zE,ContinuousScale:VE,Group:FE,Selection:GE,PointerEvents:jx,motion:WE,checkCrisp:HE,createDatumId:KE}=Sp,UE=class extends Sp.SeriesNodeEvent{constructor(t,e,i,o){super(t,e,i,o),this.xKey=o.properties.stageKey,this.yKey=o.properties.valueKey}},Xx=class extends Sp.AbstractBarSeries{constructor({moduleCtx:t,animationResetFns:e}){super({moduleCtx:t,pickModes:[Hx.AXIS_ALIGNED,Hx.EXACT_SHAPE_MATCH],hasHighlightedLabels:!0,directionKeys:{x:["stageKey"],y:["valueKey"]},directionNames:{x:[],y:[]},datumSelectionGarbageCollection:!1,animationResetFns:{datum:e.datum,label:_E}}),this.NodeEvent=UE,this.connectorNodeGroup=this.contentGroup.appendChild(new FE({name:`${this.id}-series-connectorNodes`,zIndex:Kx.BACKGROUND})),this.connectorSelection=GE.select(this.connectorNodeGroup,()=>this.connectionFactory()),this.connectorNodeGroup.pointerEvents=jx.None}get pickModeAxis(){return"main-category"}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.connectorNodeGroup.zIndex=[Kx.BACKGROUND,t],!0):!1}isVertical(){return!super.isVertical()}connectionFactory(){return new Vi}async processData(t){if(!this.properties.isValid())return;const{stageKey:e,valueKey:i}=this.properties,{visible:o,id:s}=this,n=(y,f,m)=>o&&this.ctx.legendManager.getItemEnabled({seriesId:s,itemId:m}),a=this.getCategoryAxis()?.scale,r=this.getValueAxis()?.scale,{isContinuousX:l,xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:a,yScale:r}),p=[];this.ctx.animationManager.isSkipped()||(this.processedData&&p.push(EE(this.id,this.processedData)),p.push(BE()));const u=this.visible?{}:{forceValue:0},{processedData:g}=await this.requestDataModel(t,this.data,{props:[NE(e,c,{id:"xValue"}),CE(i,h,{id:"yValue",...u,validation:n,invalidValue:0}),...l?[LE,RE]:[],...p],groupByKeys:!1});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.largestDataInterval=g.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(t){const{processedData:e,dataModel:i,id:o,ctx:{legendManager:s}}=this;if(!e||!i)return[];const{keys:[n]}=e.domain;if(t===this.getCategoryDirection()){const a=i.resolveProcessedDataDefById(this,"xValue");return a?.def.type==="key"&&a?.def.valueType==="category"?this.hasData?n.filter((r,l)=>s.getItemEnabled({seriesId:o,itemId:l})):[]:this.padBandExtent(n)}else{const a=this.domainForClippedRange(Ux.Y,["yValue"],"xValue",!0),r=Math.max(...a),l=[-r,r];return wE(l)}}getSeriesRange(t,e){return[NaN,NaN]}createNodeData(){const{hasData:t,data:e,dataModel:i,groupScale:o,processedData:s,id:n,ctx:{legendManager:a}}=this,r=this.getCategoryAxis(),l=this.getValueAxis();if(!(t&&e&&r&&l&&i&&s?.type==="ungrouped"))return;const c=r.scale,h=l.scale,p=this.getBarDirection()===Ux.X,{stageKey:u,valueKey:g}=this.properties,{strokeWidth:y}=this.barStyle(),f=`${g}`,m={itemId:f,nodeData:[],labelData:[],connectorData:[],scales:this.calculateScaling(),visible:this.visible},x=this.visible;if(!x)return m;const v=i.resolveKeysById(this,"xValue",s),S=i.resolveColumnById(this,"yValue",s),{barWidth:b,groupIndex:k}=this.updateGroupScale(r),I=VE.is(c)?b*-.5:0,M=HE(r?.scale,r?.visibleRange,this.smallestDataInterval,this.largestDataInterval);let A;return(s.dataSources.get(this.id)??[]).forEach((N,L)=>{const D=x&&a.getItemEnabled({seriesId:n,itemId:L}),C=v[L];if(C==null)return;const O=Math.round(c.convert(C))+o.convert(String(k))+I,w=S[L],P=Math.round(h.convert(-w)),B=Math.round(h.convert(w)),z=Math.max(y,Math.abs(B-P)),_={x:p?Math.min(B,P):O,y:p?O:Math.min(B,P),width:p?z:b,height:p?b:z},R={x:_.x+_.width/2,y:_.y+_.height/2},E=this.createLabelData({datumIndex:L,rect:_,barAlongX:p,yDatum:w,datum:N,visible:D}),V={index:L,series:this,itemId:f,datum:N,datumIndex:L,xValue:C,yValue:w,xKey:u,yKey:g,x:_.x,y:_.y,width:_.width,height:_.height,midPoint:R,strokeWidth:y,crisp:M,label:E,visible:D};if(m.nodeData.push(V),E!=null&&m.labelData.push(E),A!=null){const F=A.rect,G=A.nodeDatum,W=A.datumIndex;p?m.connectorData.push({datum:G,datumIndex:W,x0:F.x,y0:F.y+F.height,x1:F.x+F.width,y1:F.y+F.height,x2:_.x+_.width,y2:_.y,x3:_.x,y3:_.y,opacity:1}):m.connectorData.push({datum:G,datumIndex:W,x0:F.x+F.width,y0:F.y,x1:_.x,y1:_.y,x2:_.x,y2:_.y+_.height,x3:F.x+F.width,y3:F.y+F.height,opacity:1})}D&&(A={itemId:f,rect:_,nodeDatum:V,datumIndex:L})}),m}updateNodes(t,e,i){super.updateNodes(t,e,i);const{connectorSelection:o}=this,s=this.contextNodeData?.connectorData??[];this.connectorSelection=this.updateConnectorSelection({connectorSelection:o,connectorData:s}),this.updateConnectorNodes({connectorSelection:o})}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,o=e??[];return i.update(o,void 0,s=>this.getDatumId(s))}updateConnectorSelection(t){const{connectorData:e,connectorSelection:i}=t;return i.update(this.connectorEnabled()?e:[],void 0,o=>this.getDatumId(o.datum))}updateConnectorNodes(t){const{fills:e,strokes:i}=this.properties,{fill:o,fillOpacity:s,stroke:n,strokeOpacity:a,strokeWidth:r,lineDash:l,lineDashOffset:c}=this.connectorStyle();t.connectorSelection.each((h,p)=>{const{datumIndex:u}=p;h.setProperties(Fa(h,p)),h.fill=o??e[u%e.length],h.fillOpacity=s,h.stroke=n??i[u%i.length],h.strokeOpacity=a,h.strokeWidth=r,h.lineDash=l,h.lineDashOffset=c})}getHighlightLabelData(t,e){const i=t.filter(o=>o.datum===e.datum);return i.length>0?i:void 0}updateLabelSelection(t){const e=this.properties.label.enabled?t.labelData:[];return t.labelSelection.update(e,i=>{i.pointerEvents=jx.None})}updateLabelNodes(t){t.labelSelection.each((e,i)=>{OE(e,this.properties.label,i)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:o,properties:s}=this,{stageKey:n,valueKey:a,tooltip:r}=s,l=this.getCategoryAxis(),c=this.getValueAxis();if(!i||!o||!l||!c)return;const{datumIndex:h}=t,p=o.dataSources.get(this.id)?.[h],u=i.resolveKeysById(this,"xValue",o)[h],g=i.resolveColumnById(this,"yValue",o)[h];if(u!=null)return r.formatTooltip({symbol:this.legendItemSymbol(h),data:[{label:l.formatDatum(u),value:c.formatDatum(g)}]},{seriesId:e,datum:p,title:n,stageKey:n,valueKey:a,...this.tooltipStyle(p,h)})}resetAllAnimation(t){super.resetAllAnimation(t),PE([this.connectorSelection],Fa)}animateEmptyUpdateReady({labelSelection:t}){const{connectorSelection:e}=this,i=this.isVertical(),s=TE(i,"normal");WE.fromToMotion(this.id,"connectors",this.ctx.animationManager,[e],s),Yx(this,"labels",this.ctx.animationManager,t)}animateWaitingUpdateReady(t){const{labelSelection:e}=t;this.ctx.animationManager.stopByAnimationGroupId(this.id),Yx(this,"labels",this.ctx.animationManager,e)}getDatumId(t){return KE(t.xValue)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){return zE(this,this.contextNodeData?.nodeData[t])}legendItemSymbol(t){const{strokeWidth:e,fillOpacity:i,strokeOpacity:o,lineDash:s,lineDashOffset:n}=this.barStyle(),{fills:a,strokes:r}=this.properties,l=a[t%a.length]??"black",c=r[t%r.length]??"black";return{marker:{fill:l,fillOpacity:i,stroke:c,strokeWidth:e,strokeOpacity:o,lineDash:s,lineDashOffset:n}}}getLegendData(t){const{id:e,processedData:i,dataModel:o,ctx:{legendManager:s},visible:n}=this;if(!o||!i||t!=="category"||!this.properties.isValid())return[];const{showInLegend:a}=this.properties,r=o.resolveKeysById(this,"xValue",i);return(i.dataSources.get(this.id)??[]).map((l,c)=>{const h=r[c];if(h!=null)return{legendType:"category",id:e,datum:l,itemId:c,seriesId:e,enabled:n&&s.getItemEnabled({seriesId:e,itemId:c}),label:{text:String(h)},symbol:this.legendItemSymbol(c),skipAnimations:!0,hideInLegend:!a}}).filter(l=>l!=null)}};import{_ModuleSupport as YE}from"ag-charts-community";var{Label:jE,AbstractBarSeriesProperties:XE,SeriesTooltip:$E,AxisLabel:ZE,Validate:ke,UNION:$x,COLOR_STRING_ARRAY:Zx,LINE_DASH:QE,OBJECT:bp,POSITIVE_NUMBER:vp,RATIO:Qx,STRING:qx}=YE,Mp=class extends jE{constructor(){super(...arguments),this.spacing=0}};d([ke($x(["before","middle","after"],"a placement"))],Mp.prototype,"placement",2),d([ke(vp)],Mp.prototype,"spacing",2);var Jx=class extends ZE{};d([ke($x(["before","after"],"a placement"))],Jx.prototype,"placement",2);var We=class extends XE{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new Mp,this.stageLabel=new Jx,this.tooltip=new $E}};d([ke(qx)],We.prototype,"stageKey",2),d([ke(qx)],We.prototype,"valueKey",2),d([ke(Zx)],We.prototype,"fills",2),d([ke(Qx)],We.prototype,"fillOpacity",2),d([ke(Zx)],We.prototype,"strokes",2),d([ke(vp)],We.prototype,"strokeWidth",2),d([ke(Qx)],We.prototype,"strokeOpacity",2),d([ke(QE)],We.prototype,"lineDash",2),d([ke(vp)],We.prototype,"lineDashOffset",2),d([ke(bp)],We.prototype,"label",2),d([ke(bp)],We.prototype,"stageLabel",2),d([ke(bp)],We.prototype,"tooltip",2);function tS(t,{x:e,y:i,width:o,height:s,opacity:n}){return{x1:e,y1:i,x2:e+o,y2:i+s,opacity:n}}var{formatValue:qE,Line:JE}=vE,kp=class extends Xx{constructor(t){super({moduleCtx:t,animationResetFns:{datum:tS}}),this.properties=new We}get hasData(){const{id:t,ctx:{legendManager:e}}=this,i=this.data?.reduce((o,s,n)=>o+(e.getItemEnabled({seriesId:t,itemId:n})?1:0),0);return i!=null&&i>1}getBandScalePadding(){return{inner:1,outer:0}}connectorEnabled(){return!0}barStyle(){return{fillOpacity:1,strokeOpacity:1,strokeWidth:0,lineDash:[],lineDashOffset:0}}connectorStyle(){const{fillOpacity:t,strokeOpacity:e,strokeWidth:i,lineDash:o,lineDashOffset:s}=this.properties;return{fillOpacity:t,strokeOpacity:e,strokeWidth:i,lineDash:o,lineDashOffset:s}}nodeFactory(){return new JE}createLabelData({datumIndex:t,rect:e,barAlongX:i,yDatum:o,datum:s,visible:n}){const{stageKey:a,valueKey:r,label:l}=this.properties,{spacing:c,placement:h}=l;let p,u,g,y;if(i)switch(p=e.x+e.width/2,g="center",h){case"before":u=e.y-c,y="bottom";break;case"after":u=e.y+e.height+c,y="top";break;default:u=e.y+e.height/2,y="middle"}else switch(u=e.y+e.height/2,y="middle",h){case"before":p=e.x-c,g="right";break;case"after":p=e.x+e.width+c,g="left";break;default:p=e.x+e.width/2,g="center"}return{x:p,y:u,textAlign:g,textBaseline:y,text:this.getLabelText(l,{itemId:r,value:o,datum:s,stageKey:a,valueKey:r},f=>qE(f,0)),itemId:r,datum:s,datumIndex:t,series:this,visible:n}}updateDatumNodes(t){const e=t.isHighlight?this.properties.highlightStyle.item:void 0;t.datumSelection.each((i,o)=>{i.setProperties(tS(i,o)),i.stroke=e?.stroke,i.strokeWidth=e?.strokeWidth??0,i.strokeOpacity=e?.strokeOpacity??1,i.lineDash=e?.lineDash,i.lineDashOffset=e?.lineDashOffset??0})}tooltipStyle(t,e){const{fills:i,strokes:o}=this.properties,s=i[e%i.length]??"black",n=o[e%o.length]??"black",{fillOpacity:a,strokeOpacity:r,strokeWidth:l,lineDash:c,lineDashOffset:h}=this.barStyle();return{fill:s,fillOpacity:a,stroke:n,strokeOpacity:r,strokeWidth:l,lineDash:c,lineDashOffset:h}}};kp.className="ConeFunnelSeries",kp.type="cone-funnel";import{_ModuleSupport as tw}from"ag-charts-community";var{ThemeConstants:{CARTESIAN_AXIS_TYPE:eS}}=tw,ew={series:{direction:"vertical",strokeWidth:0,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},placement:"before",spacing:4}},seriesArea:{padding:{top:20,bottom:20}},axes:{[eS.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1,formatter(t){return Math.abs(t.value).toFixed(t.fractionDigits??0)}}},[eS.CATEGORY]:{line:{enabled:!1}}}},iw={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"cone-funnel",moduleFactory:t=>new kp(t),solo:!0,tooltipDefaults:{range:"nearest"},defaultAxes:Vx,themeTemplate:ew,paletteFactory:({userPalette:t,themeTemplateParameters:e,takeColors:i,colorsCount:o})=>{const{fills:s}=i(o),n=e.get(mE.ThemeSymbols.DEFAULT_FUNNEL_SERIES_COLOR_RANGE),a=t==="inbuilt"?n:[s[0],s[1]];return{fills:a,strokes:a.slice(0)}}};import{_ModuleSupport as ow}from"ag-charts-community";import{_ModuleSupport as sw}from"ag-charts-community";var{Label:nw,DropShadow:aw,AbstractBarSeriesProperties:rw,BaseProperties:lw,SeriesTooltip:cw,AxisLabel:hw,Validate:xt,UNION:dw,BOOLEAN:pw,COLOR_STRING_ARRAY:iS,COLOR_STRING:oS,FUNCTION:uw,LINE_DASH:sS,OBJECT:Ga,POSITIVE_NUMBER:Kl,RATIO:Wa,STRING:nS}=sw,gw=class extends nw{},aS=class extends hw{};d([xt(dw(["before","after"],"a placement"))],aS.prototype,"placement",2);var lo=class extends lw{constructor(){super(...arguments),this.enabled=!0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};d([xt(pw)],lo.prototype,"enabled",2),d([xt(oS,{optional:!0})],lo.prototype,"fill",2),d([xt(Wa)],lo.prototype,"fillOpacity",2),d([xt(oS,{optional:!0})],lo.prototype,"stroke",2),d([xt(Kl)],lo.prototype,"strokeWidth",2),d([xt(Wa)],lo.prototype,"strokeOpacity",2),d([xt(sS)],lo.prototype,"lineDash",2),d([xt(Kl)],lo.prototype,"lineDashOffset",2);var ae=class extends rw{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.spacingRatio=0,this.dropOff=new lo,this.shadow=new aw().set({enabled:!1}),this.label=new gw,this.stageLabel=new aS,this.tooltip=new cw}};d([xt(nS)],ae.prototype,"stageKey",2),d([xt(nS)],ae.prototype,"valueKey",2),d([xt(iS)],ae.prototype,"fills",2),d([xt(Wa)],ae.prototype,"fillOpacity",2),d([xt(iS)],ae.prototype,"strokes",2),d([xt(Kl)],ae.prototype,"strokeWidth",2),d([xt(Wa)],ae.prototype,"strokeOpacity",2),d([xt(sS)],ae.prototype,"lineDash",2),d([xt(Kl)],ae.prototype,"lineDashOffset",2),d([xt(Wa)],ae.prototype,"spacingRatio",2),d([xt(uw,{optional:!0})],ae.prototype,"itemStyler",2),d([xt(Ga)],ae.prototype,"dropOff",2),d([xt(Ga)],ae.prototype,"shadow",2),d([xt(Ga)],ae.prototype,"label",2),d([xt(Ga)],ae.prototype,"stageLabel",2),d([xt(Ga)],ae.prototype,"tooltip",2);var{ChartAxisDirection:yw,resetBarSelectionsFn:fw,prepareBarAnimationFunctions:rS,midpointStartingBarPosition:lS,createDatumId:mw,formatValue:xw,Rect:Sw,motion:cS,applyShapeStyle:bw}=ow,Ap=class extends Xx{constructor(t){super({moduleCtx:t,animationResetFns:{datum:fw}}),this.properties=new ae}getBandScalePadding(){return{inner:this.properties.spacingRatio,outer:0}}connectorEnabled(){return this.properties.dropOff.enabled}barStyle(){const{fillOpacity:t,strokeOpacity:e,strokeWidth:i,lineDash:o,lineDashOffset:s}=this.properties;return{fillOpacity:t,strokeOpacity:e,strokeWidth:i,lineDash:o,lineDashOffset:s}}connectorStyle(){const{fill:t,fillOpacity:e,stroke:i,strokeOpacity:o,strokeWidth:s,lineDash:n,lineDashOffset:a}=this.properties.dropOff;return{fill:t,fillOpacity:e,stroke:i,strokeOpacity:o,strokeWidth:s,lineDash:n,lineDashOffset:a}}nodeFactory(){return new Sw}createLabelData({datumIndex:t,rect:e,yDatum:i,datum:o,visible:s}){const{valueKey:n,stageKey:a,label:r}=this.properties;return{x:e.x+e.width/2,y:e.y+e.height/2,textAlign:"center",textBaseline:"middle",text:this.getLabelText(r,{itemId:a,value:i,datum:o,valueKey:n,stageKey:a},l=>xw(l,0)),itemId:a,datum:o,datumIndex:t,series:this,visible:s}}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return{fill:i?.fill,fillOpacity:i?.fillOpacity??e.fillOpacity,stroke:i?.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity,lineDash:i?.lineDash??e.lineDash,lineDashOffset:i?.lineDashOffset??e.lineDashOffset}}getItemStyleOverrides(t,e,i,o,s){const{id:n,properties:a}=this,{stageKey:r,valueKey:l,fills:c,strokes:h,itemStyler:p}=a,u=o.fill??c[i%c.length]??"black",g=o.stroke??h[i%h.length]??"black",y={};if(s||(y.fill=u,y.stroke=g),p!=null){const f=this.cachedDatumCallback(mw(t,s?"highlight":"node"),()=>{const{fillOpacity:m,strokeOpacity:x,strokeWidth:v,lineDash:S,lineDashOffset:b}=o;return p({seriesId:n,datum:e,highlighted:s,stageKey:r,valueKey:l,fill:u,fillOpacity:m,stroke:g,strokeOpacity:x,strokeWidth:v,lineDash:S,lineDashOffset:b})});Object.assign(y,f)}return y}updateDatumNodes(t){const{shadow:e}=this.properties,{datumSelection:i,isHighlight:o}=t,s=this.getCategoryDirection()===yw.X,n=this.getItemBaseStyle(o);i.each((a,r)=>{const{datumIndex:l}=r,c=this.getItemStyleOverrides(String(r.datumIndex),r.datum,l,n,o);bw(a,n,c),a.visible=s?r.width>0:r.height>0,a.crisp=r.crisp,a.fillShadow=e})}tooltipStyle(t,e){const i=this.getItemBaseStyle(!1);return Object.assign(i,this.getItemStyleOverrides(String(e),t,e,i,!1)),i}animateEmptyUpdateReady(t){super.animateEmptyUpdateReady(t);const{datumSelection:e}=t,i=this.isVertical(),s=rS(lS(i,"normal"));cS.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],s)}animateWaitingUpdateReady(t){super.animateWaitingUpdateReady(t);const{datumSelection:e}=t,{processedData:i}=this,o=i?.reduced?.diff?.[this.id],s=rS(lS(this.isVertical(),"fade"));cS.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],s,(n,a)=>a.xValue,o)}};Ap.className="FunnelSeries",Ap.type="funnel";var vw={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"funnel",moduleFactory:t=>new Ap(t),solo:!0,tooltipDefaults:{range:"exact"},defaultAxes:Vx,themeTemplate:bE,paletteFactory:({takeColors:t})=>{const{fills:e,strokes:i}=t(1);return{fills:e,strokes:i}}};import{_ModuleSupport as Mw}from"ag-charts-community";import{_ModuleSupport as Ip}from"ag-charts-community";import{_ModuleSupport as kw}from"ag-charts-community";var{CachedTextMeasurerPool:hS,TextUtils:dS,TextWrapper:Ul}=kw;function Aw(t,e){const{fontSize:i,minimumFontSize:o=i}=t,{fontSize:s,minimumFontSize:n=s}=e,a=i-o,r=s-n;let l=t.fontSize,c=e.fontSize;const h=[{labelFontSize:i,secondaryLabelFontSize:s}];for(;l>o||c>n;){const p=a>0?(l-o)/a:-1,u=r>0?(c-n)/r:-1;p>u?l--:c--,h.push({labelFontSize:l,secondaryLabelFontSize:c})}return h.reverse(),h}function Rn(t,e){return t.lineHeight!=null&&t.fontSize!=null?t.lineHeight*e/t.fontSize:dS.getLineHeight(e)}function pS(t,e,i,o,{padding:s},n){const{spacing:a=0}=e,r=2*s,l=2*s+a,c=(e.minimumFontSize??e.fontSize)+(o.minimumFontSize??o.fontSize);if(c>n(c+l,!1).height-l)return;const h=Aw(e,o),p={fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight},u={fontFamily:o.fontFamily,fontSize:o.fontSize,fontStyle:o.fontStyle,fontWeight:o.fontWeight};let g,y;return zg(0,h.length-1,f=>{const{labelFontSize:m,secondaryLabelFontSize:x}=h[f],v=f===0,S=Rn(e,m),b=Rn(o,x),k=n(S+b+l,v),I=k.width-r,M=k.height-l;if(S+b>M||((g==null||g.fontSize!==m)&&(p.fontSize=m,g=gS(e,t,I,M,p,e.wrapping,v?e.overflowStrategy:"hide")),g==null||g.width>I||g.height>M)||((y==null||y.fontSize!==x)&&(u.fontSize=x,y=gS(o,i,I,M,u,o.wrapping,v?o.overflowStrategy:"hide")),y==null))return;const A=g.height+y.height;if(!(y.width>I||A>M))return{width:Math.max(g.width,y.width),height:A+a,meta:k.meta,label:g,secondaryLabel:y}})}function Ha(t,e,{padding:i},o){const s=2*i,n=Math.min(e.minimumFontSize??e.fontSize,e.fontSize),a={fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight};return zg(n,e.fontSize,r=>{const l=Rn(e,r),c=r===n,h=o(l+s,c),p=h.width-s,u=h.height-s;if(l>u)return;a.fontSize=r;const g=Ul.wrapLines(t,{maxWidth:p,maxHeight:u,font:a,textWrap:e.wrapping,overflow:(c?e.overflowStrategy:void 0)??"hide"});if(!g.length)return;const y=Iw(g,{lineHeight:l,font:a,maxWidth:p,maxHeight:u});if(y)return[{fontSize:r,lineHeight:l,...y},h.meta]})}function uS(t){return t?.minimumFontSize!=null&&t?.fontSize!=null&&t?.minimumFontSize>t?.fontSize}function Dp(t,e,i,o,s,n){const a=e.enabled?t:void 0,r=o.enabled?i:void 0;(uS(e)||uS(o))&<.warnOnce("minimumFontSize should be set to a value less than or equal to the font size");let l;a!=null&&r!=null&&(l=pS(a,e,r,o,s,n));let c;if(l==null&&a!=null&&(c=Ha(a,e,s,n)),c!=null){const[p,u]=c;l={width:p.width,height:p.height,meta:u,label:p,secondaryLabel:void 0}}let h;if(l==null&&a==null&&r!=null&&(h=Ha(r,o,s,n)),h!=null){const[p,u]=h;l={width:p.width,height:p.height,meta:u,label:void 0,secondaryLabel:p}}return l}function gS(t,e,i,o,s,n,a){const r=Ul.wrapLines(e,{maxWidth:i,maxHeight:o,font:s,textWrap:n,overflow:a});if(!r.length)return;const l=Rn(t,s.fontSize),{width:c}=hS.measureLines(r,{font:s});return{width:c,lineHeight:l,text:r.join(` `),height:r.length*l,fontSize:s.fontSize}}function Iw(t,{font:e,lineHeight:i=dS.defaultLineHeight,maxWidth:o,maxHeight:s=1/0}){let n=i*t.length;for(;n>s;){if(t.length===1)return;t.pop(),t[t.length-1]=Ul.appendEllipsis(t.at(-1)),n=i*t.length}const a=hS.measureLines(t,{font:e});let r,l;if(a.width>o){const c=[];l=0;for(const h of a.lineMetrics){if(h.width>o){if(!c.length)return;break}c.push(h.text),l=Math.max(l,h.width)}r=Ul.appendEllipsis(c.join(` `))}else r=t.join(` `),l=a.width;return{text:r,width:l,height:n}}import{_ModuleSupport as Dw}from"ag-charts-community";import{_ModuleSupport as yS}from"ag-charts-community";var{Validate:Ka,NUMBER:Tw,POSITIVE_NUMBER:fS,TEXT_WRAP:Cw,OVERFLOW_STRATEGY:Nw}=yS,En=class extends yS.Label{constructor(){super(...arguments),this.wrapping="on-space",this.overflowStrategy="ellipsis"}};d([Ka(Cw)],En.prototype,"wrapping",2),d([Ka(Nw)],En.prototype,"overflowStrategy",2),d([Ka(fS,{optional:!0})],En.prototype,"lineHeight",2),d([Ka(fS,{optional:!0})],En.prototype,"minimumFontSize",2);var Fi=class extends En{constructor(){super(...arguments),this.spacing=0}};d([Ka(Tw)],Fi.prototype,"spacing",2);var Ua=class extends En{},{CartesianSeriesProperties:Ow,SeriesTooltip:Lw,Validate:re,AND:Rw,ARRAY:Ew,COLOR_STRING:ww,COLOR_STRING_ARRAY:Pw,FUNCTION:_w,OBJECT:mS,POSITIVE_NUMBER:xS,RATIO:Bw,STRING:Os,TEXT_ALIGN:zw,VERTICAL_ALIGN:Vw}=Dw,qt=class extends Ow{constructor(){super(...arguments),this.colorRange=["black","black"],this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.textAlign="center",this.verticalAlign="middle",this.itemPadding=0,this.label=new Fi,this.tooltip=new Lw}};d([re(Os,{optional:!0})],qt.prototype,"title",2),d([re(Os)],qt.prototype,"xKey",2),d([re(Os)],qt.prototype,"yKey",2),d([re(Os,{optional:!0})],qt.prototype,"colorKey",2),d([re(Os,{optional:!0})],qt.prototype,"xName",2),d([re(Os,{optional:!0})],qt.prototype,"yName",2),d([re(Os,{optional:!0})],qt.prototype,"colorName",2),d([re(Rw(Pw,Ew.restrict({minLength:1})))],qt.prototype,"colorRange",2),d([re(ww,{optional:!0})],qt.prototype,"stroke",2),d([re(Bw)],qt.prototype,"strokeOpacity",2),d([re(xS,{optional:!0})],qt.prototype,"strokeWidth",2),d([re(zw)],qt.prototype,"textAlign",2),d([re(Vw)],qt.prototype,"verticalAlign",2),d([re(xS)],qt.prototype,"itemPadding",2),d([re(_w,{optional:!0})],qt.prototype,"itemStyler",2),d([re(mS)],qt.prototype,"label",2),d([re(mS)],qt.prototype,"tooltip",2);var{SeriesNodePickMode:SS,computeBarFocusBounds:Fw,getMissCount:Gw,valueProperty:Tp,ChartAxisDirection:ei,DEFAULT_CARTESIAN_DIRECTION_KEYS:Ww,DEFAULT_CARTESIAN_DIRECTION_NAMES:Hw,createDatumId:Kw,ColorScale:Uw,Rect:Yw,PointerEvents:jw,applyShapeStyle:Xw}=Ip,$w=class extends Ip.CartesianSeriesNodeEvent{constructor(t,e,i,o){super(t,e,i,o),this.colorKey=o.properties.colorKey}},Zw={left:-.5,center:0,right:-.5},Qw={top:-.5,middle:0,bottom:-.5},Cp=class extends Ip.CartesianSeries{constructor(t){super({moduleCtx:t,directionKeys:Ww,directionNames:Hw,pickModes:[SS.NEAREST_NODE,SS.EXACT_SHAPE_MATCH],pathsPerSeries:[],hasMarkers:!1,hasHighlightedLabels:!0}),this.properties=new qt,this.NodeEvent=$w,this.colorScale=new Uw}async processData(t){const e=this.axes[ei.X],i=this.axes[ei.Y];if(!e||!i||!this.properties.isValid()||!this.data?.length)return;const{xKey:o,yKey:s,colorRange:n,colorKey:a}=this.properties,r=this.axes[ei.X]?.scale,l=this.axes[ei.Y]?.scale,{xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:r,yScale:l}),p=this.colorScale.type,{dataModel:u,processedData:g}=await this.requestDataModel(t,this.data,{props:[Tp(o,c,{id:"xValue"}),Tp(s,h,{id:"yValue"}),...a?[Tp(a,p,{id:"colorValue"})]:[]]});if(this.isColorScaleValid()){const y=u.resolveProcessedDataIndexById(this,"colorValue");this.colorScale.domain=g.domain.values[y],this.colorScale.range=n,this.colorScale.update()}}isColorScaleValid(){const{colorKey:t}=this.properties;if(!t)return!1;const{dataModel:e,processedData:i}=this;if(!e||!i)return!1;const o=e.resolveProcessedDataIndexById(this,"colorValue"),s=i.input.count,n=Gw(this,i.defs.values[o].missing);return!(s===0||s===n)}xCoordinateRange(t,e){const i=this.axes[ei.X].scale,o=e*(i.bandwidth??0)/2,s=i.convert(t)+o,n=e*(i.bandwidth??10);return[s,s+n]}yCoordinateRange(t,e){const i=this.axes[ei.Y].scale,o=e*(i.bandwidth??0)/2,s=i.convert(t[0])+o,n=e*(i.bandwidth??10);return[s,s+n]}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;return!e||!i?[]:t===ei.X?e.getDomain(this,"xValue","value",i):e.getDomain(this,"yValue","value",i)}getSeriesRange(t,e){return[NaN,NaN]}createNodeData(){const{data:t,visible:e,axes:i,dataModel:o,processedData:s}=this,n=i[ei.X],a=i[ei.Y];if(!(t&&o&&s&&e&&n&&a))return;if(n.type!=="category"||a.type!=="category"){lt.warnOnce(`Heatmap series expected axes to have "category" type, but received "${n.type}" and "${a.type}" instead.`);return}const{xKey:r,xName:l,yKey:c,yName:h,colorKey:p,colorName:u,textAlign:g,verticalAlign:y,itemPadding:f,label:m}=this.properties,x=o.resolveColumnById(this,"xValue",s),v=o.resolveColumnById(this,"yValue",s),S=p?o.resolveColumnById(this,"colorValue",s):void 0,b=n.scale,k=a.scale,I=(b.bandwidth??0)/2,M=(k.bandwidth??0)/2,A=[],T=[],N=b.bandwidth??10,L=k.bandwidth??10,D=(N-2*f)*Zw[g],C=(L-2*f)*Qw[y],O=()=>({width:N,height:L,meta:null});return(s.dataSources.get(this.id)??[]).forEach((P,B)=>{const z=x[B],_=v[B],R=b.convert(z)+I,E=k.convert(_)+M,V=S?.[B],F=V==null?void 0:this.getLabelText(m,{value:V,datum:P,colorKey:p,colorName:u,xKey:r,yKey:c,xName:l,yName:h}),G=Dp(F,this.properties.label,void 0,this.properties.label,{padding:f},O),W={x:R,y:E,size:0};if(A.push({series:this,itemId:c,datumIndex:B,yKey:c,xKey:r,xValue:z,yValue:_,colorValue:V,datum:P,point:W,width:N,height:L,midPoint:{x:R,y:E},missing:V==null}),G?.label!=null){const{text:K,fontSize:j,lineHeight:Z,height:J}=G.label,{fontStyle:tt,fontFamily:Q,fontWeight:U,color:q}=this.properties.label,it=W.x+D*(N-2*f),X=W.y+C*(L-2*f)-(G.height-J)*.5;T.push({series:this,itemId:c,datum:P,datumIndex:B,text:K,fontSize:j,lineHeight:Z,fontStyle:tt,fontFamily:Q,fontWeight:U,color:q,textAlign:g,verticalAlign:y,x:it,y:X})}}),{itemId:this.properties.yKey??this.id,nodeData:A,labelData:T,scales:this.calculateScaling(),visible:this.visible}}nodeFactory(){return new Yw}update(t){return this.ctx.animationManager.skipCurrentBatch(),super.update(t)}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,o=e??[];return i.update(o)}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return{fill:i?.fill,fillOpacity:i?.fillOpacity??1,stroke:i?.stroke??e.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity}}getItemStyleOverrides(t,e,i,o,s){const{id:n,properties:a}=this,{xKey:r,yKey:l,colorRange:c,itemStyler:h}=a,p=this.isColorScaleValid()&&i!=null?this.colorScale.convert(i):c[0];let u=o.fill==null?{fill:p}:void 0;if(h!=null){u??(u={});const g=this.cachedDatumCallback(Kw(t,s?"highlight":"node"),()=>h({seriesId:n,datum:e,xKey:r,yKey:l,highlighted:s,fill:p,...o}));Object.assign(u,g)}return u}updateDatumNodes(t){const{isHighlight:e}=t,i=this.axes[ei.X],[o,s]=i?.visibleRange??[],a=!(o!==0||s!==1),r=this.getItemBaseStyle(e);t.datumSelection.each((l,c)=>{const{datumIndex:h,colorValue:p,datum:u,point:g,width:y,height:f}=c,m=this.getItemStyleOverrides(String(h),u,p,r,e);l.crisp=a,l.x=Math.floor(g.x-y/2),l.y=Math.floor(g.y-f/2),l.width=Math.ceil(y),l.height=Math.ceil(f),Xw(l,r,m)})}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t,{enabled:o}=this.properties.label,s=o?e:[];return i.update(s)}updateLabelNodes(t){t.labelSelection.each((e,i)=>{e.text=i.text,e.fontSize=i.fontSize,e.lineHeight=i.lineHeight,e.fontStyle=i.fontStyle,e.fontFamily=i.fontFamily,e.fontWeight=i.fontWeight,e.fill=i.color,e.textAlign=i.textAlign,e.textBaseline=i.verticalAlign,e.x=i.x,e.y=i.y,e.pointerEvents=jw.None})}getTooltipContent(t){const{id:e,dataModel:i,processedData:o,axes:s,properties:n,colorScale:a}=this,{xKey:r,xName:l,yKey:c,yName:h,colorKey:p,colorName:u,colorRange:g,title:y,legendItemName:f,tooltip:m}=n,x=s[ei.X],v=s[ei.Y];if(!i||!o||!x||!v)return;const{datumIndex:S}=t,b=o.dataSources.get(this.id)?.[S],k=i.resolveColumnById(this,"xValue",o)[S],I=i.resolveColumnById(this,"yValue",o)[S],M=p!=null&&this.isColorScaleValid()?i.resolveColumnById(this,"colorValue",o)[S]:void 0;if(k==null)return;const A=[];let T;M==null?T=g[0]:(T=a.convert(M),A.push({label:u,fallbackLabel:p,value:String(M)})),A.push({label:l,fallbackLabel:r,value:x.formatDatum(k)},{label:h,fallbackLabel:c,value:v.formatDatum(I)});const N=T!=null?{marker:{shape:"square",fill:T,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}}:void 0,L=this.getItemBaseStyle(!1);return Object.assign(L,this.getItemStyleOverrides(String(S),b,M,L,!1)),m.formatTooltip({title:y??f,symbol:N,data:A},{seriesId:e,datum:b,title:y,xKey:r,xName:l,yKey:c,yName:h,colorKey:p,colorName:u,...L})}getLegendData(t){return t!=="gradient"||!this.properties.isValid()||!this.isColorScaleValid()||!this.dataModel?[]:[{legendType:"gradient",enabled:this.visible,seriesId:this.id,colorName:this.properties.colorName,colorDomain:this.processedData.domain.values[this.dataModel.resolveProcessedDataIndexById(this,"colorValue")],colorRange:this.properties.colorRange}]}isLabelEnabled(){return this.properties.label.enabled&&!!this.properties.colorKey}getBandScalePadding(){return{inner:0,outer:0}}computeFocusBounds({datumIndex:t}){const e=this.contextNodeData?.nodeData[t];if(e===void 0)return;const{width:i,height:o,midPoint:s}=e,n={x:s.x-i/2,y:s.y-o/2,width:i,height:o};return Fw(this,n)}};Cp.className="HeatmapSeries",Cp.type="heatmap";import"ag-charts-community";var qw={series:{label:{enabled:!1,color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},wrapping:"on-space",overflowStrategy:"ellipsis"},itemPadding:3},gradientLegend:{enabled:!0}},{ThemeSymbols:{DEFAULT_DIVERGING_SERIES_COLOR_RANGE:Jw,DEFAULT_BACKGROUND_COLOUR:t1},ThemeConstants:{CARTESIAN_AXIS_TYPE:bS,CARTESIAN_POSITION:vS}}=Mw,e1={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"heatmap",moduleFactory:t=>new Cp(t),tooltipDefaults:{range:"exact"},defaultAxes:[{type:bS.CATEGORY,position:vS.LEFT},{type:bS.CATEGORY,position:vS.BOTTOM}],themeTemplate:qw,paletteFactory:({takeColors:t,colorsCount:e,userPalette:i,themeTemplateParameters:o})=>{const s=o.get(Jw),n=o.get(t1),a=(Array.isArray(n)?n[0]:n)??"white",{fills:r,strokes:l}=t(e);return{stroke:i==="inbuilt"?a:l[0],colorRange:i==="inbuilt"?s:[r[0],r[1]]}}};import{_ModuleSupport as i1}from"ag-charts-community";import{_ModuleSupport as MS}from"ag-charts-community";import"ag-charts-community";var o1=1e3,kS=10;function AS(t,e,i,o,s,n){const a=t[n];if(a==null)return!1;const r=Tl(a,e,i),l=Cl(r,s);return n===o[l+ne]||n===o[l+Me]||n===o[l+Le]||n===o[l+Re]}function s1(t,e,i){if(t.lengthkS&&n>64;)({maxRange:n}=Ra(a,r,n,{inPlace:!0})),l=l.filter(AS.bind(null,t,o,s,a,n)),c.push({maxRange:n,indices:l});return c.reverse(),c}var{ChartAxisDirection:n1,ContinuousScale:a1,OrdinalTimeScale:r1}=MS,l1=class extends MS.LineSeries{aggregateData(t,e){const i=this.axes[n1.X];if(i==null||!(a1.is(i.scale)||r1.is(i.scale)))return;const o=t.resolveColumnById(this,"xValue",e),s=t.resolveColumnById(this,"yValueRaw",e),n=t.getDomain(this,"xValue","value",e);return s1(o,s,n)}},{LineSeriesModule:c1}=i1,h1={...c1,type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"line",moduleFactory:t=>new l1(t)};import{_ModuleSupport as d1}from"ag-charts-community";import{_ModuleSupport as p1}from"ag-charts-community";var{ColorScale:u1}=p1;function IS(t){if(t==null)return[];const e=new u1;e.domain=[0,1],e.range=t;const i=5;return Array.from({length:5},(o,s)=>e.convert(s/(i-1)))}import{_ModuleSupport as wn}from"ag-charts-community";var DS=class{*[Symbol.iterator](){const{node:t,datum:e}=this;t&&e&&(yield{node:t,datum:e})}nodes(){return this.node?[this.node]:[]}update(t,e,i,o){const s=t.nodes();if(s.length===0)this.node?.remove(),this.node=void 0;else{this.node===void 0&&(this.node=new i,this.node.fillOpacity=0,this.node.strokeOpacity=0,e.appendChild(this.node));const n=s[0],a=s.toReversed().find(r=>r.datum.datum.value>r.datum.datum.segmentStart)??s[s.length-1];this.node.datum=this.datum=n.datum,o(this.node,n,a)}}},TS={fromFn:()=>({opacity:0,phase:"initial"}),toFn:()=>({opacity:1})};function CS(t,e){if(t==null)return"";if(e==null)return String(t);const[i,o]=e.scale.domain,s=i!==0?Math.ceil(Math.log10(Math.abs(i))):0,n=o!==0?Math.ceil(Math.log10(Math.abs(o))):0,a=Math.max(2-Math.max(s,n),0);return t.toFixed(a)}function Ya(t,e,i){if(e.text!=null)return e.text;const o=i??e.value,s=e?.formatter?.({seriesId:t.id,datum:void 0,value:o});if(s!=null)return String(s)}import"ag-charts-community";function NS({path:t,x:e,y:i,size:o}){t.moveTo(e,i-o/2),t.lineTo(e,i+o/2)}import{_ModuleSupport as g1}from"ag-charts-community";var{clamp:OS}=g1;function LS(t,e){const i=oI(t.datumUnion.nodes(),t.targetSelection.nodes());return t.pickNodeNearestDistantObject(e,i)}function RS(t,e){const i=[{data:t.contextNodeData?.nodeData,selection:t.datumUnion},{data:t.contextNodeData?.targetData,selection:t.targetSelection}].filter(l=>l.data&&l.data.length>0),o=OS(0,e.otherIndex+e.otherIndexDelta,i.length-1);if(i.length===0)return;const{data:s,selection:n}=i[o];if(s==null||s.length===0)return;const a=OS(0,e.datumIndex,s.length-1),r=s[a];for(const l of n)if(l.datum===r)return{bounds:l.node,clipFocusBox:!0,datum:r,datumIndex:a,otherIndex:o}}import{_ModuleSupport as y1}from"ag-charts-community";var{MARKER_SHAPE:f1,UNION:Np,OR:m1}=y1,Yl=Np(["continuous","discrete"],"a fill mode"),ES=m1(f1,Np(["line"],"a marker shape")),wS=Np(["container","item"],"a corner mode");function PS(t){let e,i;return typeof t.value=="number"&&(e=t.value),typeof t.text=="string"&&(i=t.text),{value:e,text:i}}import{_ModuleSupport as Op}from"ag-charts-community";import{_ModuleSupport as x1}from"ag-charts-community";var{BaseProperties:_S,Validate:Pn,OBJECT:S1,BOOLEAN:b1,NUMBER:Lp,NUMBER_ARRAY:v1}=x1,jl=class extends _S{getSegments(t,e){const{values:i,step:o,count:s}=this,n=Math.min(...t.domain),a=Math.max(...t.domain);let r;if(i!=null){const l=i.filter(c=>c>n&&cc-h);r=[n,...l,a]}else if(o!=null){const l=[];for(let c=n;ch/l*(a-n)+n)}else{const l=t.ticks({nice:!0,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.filter(c=>c>n&&ce&&(lt.warnOnce("the configured segmentation results in more than 1 item per pixel, ignoring. Supply a segmentation configuration that results in larger segments or omit this configuration"),r=void 0),r??(r=[n,a]),r}};d([Pn(v1,{optional:!0})],jl.prototype,"values",2),d([Pn(Lp,{optional:!0})],jl.prototype,"step",2),d([Pn(Lp,{optional:!0})],jl.prototype,"count",2);var ja=class extends _S{constructor(){super(...arguments),this.enabled=!1,this.interval=new jl,this.spacing=0}};d([Pn(b1)],ja.prototype,"enabled",2),d([Pn(S1)],ja.prototype,"interval",2),d([Pn(Lp)],ja.prototype,"spacing",2);var{BaseProperties:Rp,SeriesTooltip:M1,SeriesProperties:k1,PropertiesArray:Ep,Validate:Y,BOOLEAN:BS,COLOR_STRING:Ls,COLOR_STRING_ARRAY:A1,FUNCTION:I1,LINE_DASH:wp,NUMBER:_n,OBJECT_ARRAY:Pp,OBJECT:Rs,POSITIVE_NUMBER:Gi,RATIO:Es,STRING:zS,UNION:_p,Label:D1}=Op,T1=_p(["before","after","middle"],"a placement"),C1=_p(["inside-start","outside-start","inside-end","outside-end","inside-center","bar-inside","bar-inside-end","bar-outside-end","bar-end"],"an placement"),N1=_p(["horizontal","vertical"],"an orientation"),VS=class extends D1{};d([Y(_n,{optional:!0})],VS.prototype,"spacing",2);var le=class extends Rp{constructor(){super(...arguments),this.value=0,this.label=new VS}};d([Y(zS,{optional:!0})],le.prototype,"text",2),d([Y(_n)],le.prototype,"value",2),d([Y(ES,{optional:!0})],le.prototype,"shape",2),d([Y(T1,{optional:!0})],le.prototype,"placement",2),d([Y(_n,{optional:!0})],le.prototype,"spacing",2),d([Y(Gi,{optional:!0})],le.prototype,"size",2),d([Y(_n,{optional:!0})],le.prototype,"rotation",2),d([Y(Ls,{optional:!0})],le.prototype,"fill",2),d([Y(Es,{optional:!0})],le.prototype,"fillOpacity",2),d([Y(Ls,{optional:!0})],le.prototype,"stroke",2),d([Y(Gi,{optional:!0})],le.prototype,"strokeWidth",2),d([Y(Es,{optional:!0})],le.prototype,"strokeOpacity",2),d([Y(wp,{optional:!0})],le.prototype,"lineDash",2),d([Y(Gi,{optional:!0})],le.prototype,"lineDashOffset",2),d([Y(Rs)],le.prototype,"label",2);var He=class extends Rp{constructor(){super(...arguments),this.enabled=!0,this.thicknessRatio=1,this.fills=new Ep(Op.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};d([Y(BS)],He.prototype,"enabled",2),d([Y(Gi,{optional:!0})],He.prototype,"thickness",2),d([Y(Es)],He.prototype,"thicknessRatio",2),d([Y(Pp)],He.prototype,"fills",2),d([Y(Yl)],He.prototype,"fillMode",2),d([Y(Ls,{optional:!0})],He.prototype,"fill",2),d([Y(Es)],He.prototype,"fillOpacity",2),d([Y(Ls)],He.prototype,"stroke",2),d([Y(Gi)],He.prototype,"strokeWidth",2),d([Y(Es)],He.prototype,"strokeOpacity",2),d([Y(wp)],He.prototype,"lineDash",2),d([Y(Gi)],He.prototype,"lineDashOffset",2);var fi=class extends Rp{constructor(){super(...arguments),this.fills=new Ep(Op.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.defaultFill="black"}};d([Y(Pp)],fi.prototype,"fills",2),d([Y(Yl)],fi.prototype,"fillMode",2),d([Y(Ls,{optional:!0})],fi.prototype,"fill",2),d([Y(Es)],fi.prototype,"fillOpacity",2),d([Y(Ls)],fi.prototype,"stroke",2),d([Y(Gi)],fi.prototype,"strokeWidth",2),d([Y(Es)],fi.prototype,"strokeOpacity",2),d([Y(wp)],fi.prototype,"lineDash",2),d([Y(Gi)],fi.prototype,"lineDashOffset",2),d([Y(Ls)],fi.prototype,"defaultFill",2);var Xl=class extends Fi{constructor(){super(...arguments),this.placement="inside-center",this.avoidCollisions=!0}};d([Y(zS,{optional:!0})],Xl.prototype,"text",2),d([Y(C1)],Xl.prototype,"placement",2),d([Y(BS)],Xl.prototype,"avoidCollisions",2);var ye=class extends k1{constructor(){super(...arguments),this.value=0,this.segmentation=new ja,this.defaultColorRange=[],this.targets=new Ep(le),this.defaultTarget=new le,this.direction="vertical",this.thickness=1,this.cornerRadius=0,this.cornerMode="container",this.margin=0,this.scale=new fi,this.bar=new He,this.label=new Xl,this.tooltip=new M1}};d([Y(_n)],ye.prototype,"value",2),d([Y(Rs)],ye.prototype,"segmentation",2),d([Y(A1)],ye.prototype,"defaultColorRange",2),d([Y(Pp)],ye.prototype,"targets",2),d([Y(Rs)],ye.prototype,"defaultTarget",2),d([Y(N1)],ye.prototype,"direction",2),d([Y(Gi)],ye.prototype,"thickness",2),d([Y(Gi)],ye.prototype,"cornerRadius",2),d([Y(wS)],ye.prototype,"cornerMode",2),d([Y(_n)],ye.prototype,"margin",2),d([Y(Rs)],ye.prototype,"scale",2),d([Y(Rs)],ye.prototype,"bar",2),d([Y(I1,{optional:!0})],ye.prototype,"itemStyler",2),d([Y(Rs)],ye.prototype,"label",2),d([Y(Rs)],ye.prototype,"tooltip",2);import{_ModuleSupport as O1}from"ag-charts-community";var{CachedTextMeasurerPool:L1,BBox:R1}=O1;function Bp(t){const{x0:e,y0:i,x1:o,y1:s,horizontalInset:n,verticalInset:a}=t,r=Math.min(e,o)+n,l=Math.min(i,s)+a,c=Math.max(Math.abs(o-e)-2*n,0),h=Math.max(Math.abs(s-i)-2*a,0);return{x:r,y:l,width:c,height:h}}function E1(t,e){if(e==null)return!0;const i=Bp(t),o=1e-6,s=i.x+o,n=i.y+o,a=i.x+i.width-o,r=i.y+i.height-o,l=e.x,c=e.x+e.width,h=e.y,p=e.y+e.height;return Math.max(s,l)<=Math.min(a,c)&&Math.max(n,h)<=Math.min(r,p)}function zp(t){const{clipX0:e,clipX1:i,clipY0:o,clipY1:s}=t;return e!=null&&i!=null||o!=null&&s!=null}function w1(t){if(!zp(t))return;const{x0:e,y0:i,x1:o,y1:s}=t,{x:n,y:a,width:r,height:l}=Bp(t);let{clipX0:c,clipX1:h,clipY0:p,clipY1:u}=t;(c==null||h==null)&&(c=e,h=o),(p==null||u==null)&&(p=i,u=s);const g=Math.min(c,h),y=Math.min(p,u),f=Math.abs(h-c),m=Math.abs(u-p);return c=Math.max(n,g),p=Math.max(a,y),h=Math.min(n+r,g+f),u=Math.min(a+l,y+m),new R1(Math.min(c,h),Math.min(p,u),Math.abs(h-c),Math.abs(u-p))}function FS(t,e){const i=t?"initial":"update";return{node:{fromFn(s,n){const a=s.previousDatum;let{x0:r,y0:l,x1:c,y1:h,clipX0:p,clipY0:u,clipX1:g,clipY1:y}=a??n;const{horizontalInset:f,verticalInset:m}=n,x=a!=null&&zp(a),v=zp(n);return x&&v||(!x&&v?({x0:r,y0:l,x1:c,y1:h,clipX0:p,clipY0:u,clipX1:g,clipY1:y}=n,t&&(e?g=n.clipX0:y=n.clipY0)):x&&!v?({x0:r,y0:l,x1:c,y1:h}=n,p=void 0,u=void 0,g=void 0,y=void 0):t&&(e?c=r:h=l)),{x0:r,y0:l,x1:c,y1:h,clipX0:p,clipY0:u,clipX1:g,clipY1:y,horizontalInset:f,verticalInset:m,phase:i}},toFn(s,n){const{x0:a,y0:r,x1:l,y1:c,clipX0:h,clipY0:p,clipX1:u,clipY1:g,horizontalInset:y,verticalInset:f}=n;return{x0:a,y0:r,x1:l,y1:c,clipX0:h,clipY0:p,clipX1:u,clipY1:g,horizontalInset:y,verticalInset:f}},applyFn(s,n){s.setProperties($l(s,n))}}}}function $l(t,e){const{x:i,y:o,width:s,height:n}=Bp(e),a=w1(e),r=E1(e,a);return{x:i,y:o,width:s,height:n,clipBBox:a,visible:r}}var P1={Before:"right",Center:"center",After:"left"},_1={Before:"top",Center:"middle",After:"bottom"},B1={Before:-1,Center:-.5,After:0},z1={Before:0,Center:-.5,After:-1};function V1(t,e,i,o,s){const{scale:n,bar:a}=o,{padding:r,horizontal:l}=i;e.each((c,h)=>{const p=Ya(t,h,s?.label),u=()=>({width:n.width,height:n.height,meta:null});let g;const y=h.avoidCollisions&&h.placement!=="outside-start"&&h.placement!=="outside-end";if(p==null)return;if(y)g=Ha(p,h,{padding:r},u)?.[0];else{const C={fontSize:h.fontSize,fontStyle:h.fontStyle,fontWeight:h.fontWeight,fontFamily:h.fontFamily,lineHeight:h.lineHeight},{width:O,height:w}=L1.measureText(p,{font:C});g={text:p,fontSize:h.fontSize,lineHeight:Rn(h,h.fontSize),width:O,height:w}}if(g==null){c.visible=!1;return}const f=l?n.x:n.y+n.height,m=l?n.x+n.width:n.y,x=l?a.x:a.y+a.height,v=l?a.x+a.width:a.y,S=h.spacing*(l?1:-1);let b,k,I,M;switch(h.placement){case"outside-start":b=-1/0,k=1/0,I=f-S,M="Before";break;case"outside-end":b=-1/0,k=1/0,I=m+S,M="After";break;case"inside-start":b=f,k=v,I=f+S,M="After";break;case"inside-end":b=v,k=m,I=m-S,M="Before";break;case"inside-center":b=f,k=m,I=(f+m)/2,M="Center";break;case"bar-inside":b=x,k=v,I=(x+v)/2,M="Center";break;case"bar-inside-end":b=x,k=v,I=v-S,M="Before";break;case"bar-outside-end":b=v,k=m,I=v+S,M="After";break;case"bar-end":b=-1/0,k=1/0,I=v,M="Center";break}const A=l?I:n.x+n.width/2,T=l?n.y+n.height/2:I;let N,L;l?(N=A+B1[M]*g.width,L=N+g.width):(N=T+z1[M]*g.height,L=N+g.height);const D=Math.min(N,L)>=Math.min(b,k)&&Math.max(N,L)<=Math.max(b,k);if(h.avoidCollisions&&!D){c.visible=!1;return}c.visible=!0,c.text=g.text,c.fontSize=g.fontSize,c.lineHeight=g.lineHeight,c.textAlign=l?P1[M]:"center",c.textBaseline=l?"middle":_1[M],c.x=A,c.y=T})}var{fromToMotion:Vp,resetMotion:F1,SeriesNodePickMode:GS,StateMachine:G1,createDatumId:WS,ChartAxisDirection:mi,CachedTextMeasurerPool:W1,toRadians:H1,BBox:Xa,Group:Bn,PointerEvents:K1,Selection:zn,Rect:U1,Text:HS,LinearGradient:Y1,Marker:j1,easing:X1,getColorStops:$1}=wn,Z1={before:180,middle:0,after:0},Q1={before:90,middle:0,after:-90},Fp=class extends wn.Series{constructor(t){super({moduleCtx:t,useLabelLayer:!0,pickModes:[GS.EXACT_SHAPE_MATCH,GS.NEAREST_NODE]}),this.canHaveAxes=!0,this.properties=new ye,this.originX=0,this.originY=0,this.scaleGroup=this.contentGroup.appendChild(new Bn({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new Bn({name:"itemGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new Bn({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new Bn({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new Bn({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new Bn({name:"itemTargetLabelGroup"})),this.scaleSelection=zn.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=zn.select(this.itemGroup,()=>this.nodeFactory()),this.targetSelection=zn.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=zn.select(this.itemTargetLabelGroup,HS),this.labelSelection=zn.select(this.itemLabelGroup,HS),this.highlightTargetSelection=zn.select(this.highlightTargetGroup,()=>this.markerFactory()),this.datumUnion=new DS,this.animationState=new G1("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.animateReadyResize(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateWaitingUpdateReady()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty"},reset:"empty",skip:"ready"}}),this.scaleGroup.pointerEvents=K1.None}get horizontal(){return this.properties.direction==="horizontal"}get thickness(){return this.properties.thickness}computeInset(t,e){const{label:i}=this.properties;let o;switch(i.placement){case"outside-start":o=1;break;case"outside-end":o=-1;break;default:return 0}const s=i.text?.split(` `);let n;if(t===mi.Y)n=Rn(i,i.fontSize)*(s?.length??1);else{const a=i.getFont();n=(s??e.map(l=>Ya(this,this.labelDatum(i,l))??"")).reduce((l,c)=>{const{width:h}=W1.measureText(c,{font:a});return Math.max(l,h)},0)}return o*(i.spacing+n)}get hasData(){return!0}nodeFactory(){const t=new U1;return t.crisp=!0,t}markerFactory(){return new j1}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(t){const{axes:e,horizontal:i}=this,o=i?e[mi.X]:e[mi.Y];return CS(t,o)}createLinearGradient(t,e){const{properties:i,originX:o,originY:s,horizontal:n,axes:a}=this,{thickness:r,defaultColorRange:l}=i,c=n?a[mi.X]:a[mi.Y],{domain:h,range:p}=c.scale,u=p[1]-p[0],g=$1(t,l,h,e);return new Y1("oklch",g,n?90:0,new Xa(o,s,n?u:r,n?r:u))}getTargets(){const{properties:t}=this,e=t.defaultTarget;return Array.from(t.targets).map(i=>{const{text:o=e.text,value:s=e.value??0,shape:n=e.shape??"triangle",rotation:a=e.rotation??0,strokeWidth:r=e.strokeWidth??0,placement:l=e.placement??"middle",spacing:c=e.spacing??0,size:h=e.size??0,fill:p=e.fill??"black",fillOpacity:u=e.fillOpacity??1,stroke:g=e.stroke??"black",strokeOpacity:y=e.strokeOpacity??1,lineDash:f=e.lineDash??[0],lineDashOffset:m=e.lineDashOffset??0}=i,{enabled:x=e.label.enabled,color:v=e.label.color??"black",fontStyle:S=e.label.fontStyle??"normal",fontWeight:b=e.label.fontWeight??"normal",fontSize:k=e.label.fontSize,fontFamily:I=e.label.fontFamily,spacing:M=e.label.spacing??0}=i.label;return{text:o,value:s,shape:n,placement:l,spacing:c,size:h,rotation:a,fill:p,fillOpacity:u,stroke:g,strokeWidth:r,strokeOpacity:y,lineDash:f,lineDashOffset:m,label:{enabled:x,color:v,fontStyle:S,fontWeight:b,fontSize:k,fontFamily:I,spacing:M}}})}getTargetPoint(t){const e=this.axes[mi.X],i=this.axes[mi.Y];if(e==null||i==null)return{x:0,y:0};const{properties:o,originX:s,originY:n,horizontal:a}=this,{thickness:r}=o,{value:l,placement:c,spacing:h,size:p}=t,u=a?e:i,g=u.scale.convert(l)-u.scale.range[0];let y;switch(c){case"before":y=-(h+p/2);break;case"after":y=r+h+p/2;break;default:y=r/2;break}return{x:s+e.range[0]+(a?g:y),y:n+i.range[0]+(a?y:g)}}getTargetLabel(t){const{size:e,placement:i,label:o}=t,{spacing:s,color:n,fontStyle:a,fontWeight:r,fontSize:l,fontFamily:c}=o,h=void 0,p=e/2+s;let u,g,y=0,f=0;return this.horizontal?(u="center",i==="after"?(g="top",f=p):(g="bottom",f=-p)):(g="middle",i==="before"?(u="right",y=-p):(u="left",y=p)),{offsetX:y,offsetY:f,fill:n,textAlign:u,textBaseline:g,fontStyle:a,fontWeight:r,fontSize:l,fontFamily:c,lineHeight:h}}labelDatum(t,e){const{placement:i,avoidCollisions:o,spacing:s,text:n,color:a,fontSize:r,minimumFontSize:l,fontStyle:c,fontWeight:h,fontFamily:p,lineHeight:u,wrapping:g,overflowStrategy:y,formatter:f=m=>this.formatLabel(m.value)}=t;return{placement:i,avoidCollisions:o,spacing:s,text:n,value:e,fill:a,fontSize:r,minimumFontSize:l,fontStyle:c,fontWeight:h,fontFamily:p,lineHeight:u,wrapping:g,overflowStrategy:y,formatter:f}}createNodeData(){const{id:t,properties:e,originX:i,originY:o,horizontal:s}=this;if(!e.isValid())return;const{value:n,segmentation:a,thickness:r,cornerRadius:l,cornerMode:c,bar:h,scale:p,label:u}=e,g=this.getTargets(),y=this.axes[mi.X],f=this.axes[mi.Y];if(y==null||f==null)return;const m=s?y:f,x=y.scale,v=f.scale,S=m.scale;let{domain:b}=m.scale;m.isReversed()&&(b=b.slice().reverse());const k=[],I=[],M=[],A=[],[T,N]=S.range,L=Math.abs(N-T);let[D,C]=y.range;y.isReversed()&&([C,D]=[D,C]);let[O,w]=f.range;f.isReversed()&&([w,O]=[O,w]);const P=s?x.convert(n):C,B=s?w:v.convert(n),z=a.enabled?a.spacing/2:0,_=s?z:0,R=s?0:z,E=Math.min(h.thickness??Math.round(h.thicknessRatio*r),r),V=-(r-E)/2,F=s?0:V,G=s?V:0,W=c==="item",K=Math.ceil(L);let j=a.enabled?a.interval.getSegments(S,K):void 0;const Z=h.fill??this.createLinearGradient(h.fills,h.fillMode),J=p.fill??(h.enabled&&p.fills.length===0?p.defaultFill:void 0)??this.createLinearGradient(p.fills,p.fillMode);if(j==null&&W){const Q=Math.min(...b),U=Math.max(...b),q={value:n,segmentStart:Q,segmentEnd:U};if(h.enabled){const rt=Math.min(l,E/2,L/2)*(m.isReversed()?-1:1),gt=s?rt:0,yt=s?0:rt;k.push({series:this,itemId:"value",datum:q,datumIndex:{type:0},type:0,x0:i+D-gt-F,y0:o+O-yt-G,x1:i+P+gt+F,y1:o+B+yt+G,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,fill:Z,horizontalInset:_,verticalInset:R})}const X=Math.min(l,r/2,L/2)*(m.isReversed()?-1:1),Ot=s?X:0,It=s?0:X;A.push({series:this,itemId:"scale",datum:q,datumIndex:{type:0},type:0,x0:i+D-Ot,y0:o+O-It,x1:i+C+Ot,y1:o+w+It,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,fill:J,horizontalInset:_,verticalInset:R})}else{j??(j=b);const Q=i+D-F,U=o+O-G,q=i+P+F,it=o+B+G;for(let X=0;XWS(t.nodeData.length,e.itemId))}updateDatumNodes(t){const{datumSelection:e}=t,{ctx:i,properties:o}=this,{bar:s}=o,{fillOpacity:n,stroke:a,strokeOpacity:r,lineDash:l,lineDashOffset:c}=s,h=this.getStrokeWidth(s.strokeWidth),p=i.animationManager.isSkipped();e.each((u,g)=>{const{topLeftCornerRadius:y,topRightCornerRadius:f,bottomRightCornerRadius:m,bottomLeftCornerRadius:x,fill:v}=g;u.fill=v,u.fillOpacity=n,u.stroke=a,u.strokeOpacity=r,u.strokeWidth=h,u.lineDash=l,u.lineDashOffset=c,u.topLeftCornerRadius=y,u.topRightCornerRadius=f,u.bottomRightCornerRadius=m,u.bottomLeftCornerRadius=x,u.pointerEvents=this.properties.bar.enabled?wn.PointerEvents.All:wn.PointerEvents.None,(p||u.previousDatum==null)&&u.setProperties($l(u,g))}),this.datumUnion.update(e,this.itemGroup,wn.Rect,(u,g,y)=>{u.pointerEvents=wn.PointerEvents.None,u.clipBBox??(u.clipBBox=new Xa(NaN,NaN,NaN,NaN)),u.x=g.x,u.y=g.y,u.clipBBox.x=g.clipBBox?.x??g.x,u.clipBBox.y=g.clipBBox?.y??g.y,this.properties.direction==="horizontal"?(u.height=u.clipBBox.height=y.height,u.width=y===g?y.width:y.x+y.width,u.clipBBox.width=u.width-(y.width-(y.clipBBox?.width??y.width)),u.topLeftCornerRadius=g.topLeftCornerRadius,u.bottomLeftCornerRadius=g.bottomLeftCornerRadius,u.topRightCornerRadius=y.topRightCornerRadius,u.bottomRightCornerRadius=y.bottomRightCornerRadius):(u.width=u.clipBBox.width=y.width,u.height=y===g?y.height:y.x+y.height,u.clipBBox.height=u.height-(y.height-(y.clipBBox?.height??y.height)),u.topLeftCornerRadius=g.topLeftCornerRadius,u.topRightCornerRadius=g.topRightCornerRadius,u.bottomLeftCornerRadius=y.bottomLeftCornerRadius,u.bottomRightCornerRadius=y.bottomRightCornerRadius)})}updateScaleSelection(t){return t.scaleSelection.update(t.scaleData,void 0,e=>WS(t.scaleData.length,e.itemId))}updateScaleNodes(t){const{scaleSelection:e}=t,{scale:i}=this.properties,{fillOpacity:o,stroke:s,strokeOpacity:n,strokeWidth:a,lineDash:r,lineDashOffset:l}=i;e.each((c,h)=>{const{topLeftCornerRadius:p,topRightCornerRadius:u,bottomRightCornerRadius:g,bottomLeftCornerRadius:y,fill:f}=h;c.fill=f,c.fillOpacity=o,c.stroke=s,c.strokeOpacity=n,c.strokeWidth=a,c.lineDash=r,c.lineDashOffset=l,c.topLeftCornerRadius=p,c.topRightCornerRadius=u,c.bottomRightCornerRadius=g,c.bottomLeftCornerRadius=y,c.setProperties($l(c,h))})}updateTargetSelection(t){return t.targetSelection.update(t.targetData,void 0,e=>e.itemId)}updateTargetNodes(t){const{targetSelection:e,isHighlight:i}=t,o=i?this.properties.highlightStyle.item:void 0;e.each((s,n)=>{const{x:a,y:r,shape:l,size:c,rotation:h,fill:p,fillOpacity:u,stroke:g,strokeOpacity:y,strokeWidth:f,lineDash:m,lineDashOffset:x}=n;s.size=c,s.shape=l==="line"?NS:l,s.fill=o?.fill??p,s.fillOpacity=o?.fillOpacity??u,s.stroke=o?.stroke??g,s.strokeOpacity=o?.strokeOpacity??y,s.strokeWidth=o?.strokeWidth??f,s.lineDash=o?.lineDash??m,s.lineDashOffset=o?.lineDashOffset??x,s.translationX=a,s.translationY=r,s.rotation=h})}updateTargetLabelSelection(t){return t.targetLabelSelection.update(t.targetData)}updateTargetLabelNodes(t){const{targetLabelSelection:e}=t;e.each((i,o)=>{const{x:s,y:n,text:a}=o,{offsetX:r,offsetY:l,fill:c,fontStyle:h,fontWeight:p,fontSize:u,fontFamily:g,textAlign:y,textBaseline:f}=o.label;i.visible=!0,i.x=s+r,i.y=n+l,i.text=a,i.fill=c,i.fontStyle=h,i.fontWeight=p,i.fontSize=u,i.fontFamily=g,i.textAlign=y,i.textBaseline=f})}updateLabelSelection(t){return t.labelSelection.update(t.labelData,void 0,e=>"primary")}updateLabelNodes(t){const{labelSelection:e}=t,i=this.ctx.animationManager.isSkipped();e.each((o,s)=>{o.fill=s.fill,o.fontStyle=s.fontStyle,o.fontWeight=s.fontWeight,o.fontFamily=s.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}labelsHaveExplicitText(){for(const{datum:t}of this.labelSelection)if(t.text==null)return!1;return!0}formatLabelText(t){const{labelSelection:e,horizontal:i,axes:o}=this,s=o[mi.X],n=o[mi.Y];if(s==null||n==null)return;const[a,r]=s.range,[l,c]=n.range,h=this.originX+Math.min(a,r),p=this.originY+Math.min(l,c),u=Math.abs(r-a),g=Math.abs(c-l),y=t?.label??this.properties.value;let f;if(i){const v=s.scale.convert(y);f=new Xa(h,p,v-h,g)}else{const v=n.scale.convert(y);f=new Xa(h,v,u,g-v)}const m={scale:new Xa(h,p,u,g),bar:f},{margin:x}=this.properties;V1(this,e,{padding:x,horizontal:i},m,t)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),F1([this.datumSelection],$l),this.formatLabelText()}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}animateLabelText(t={}){const{animationManager:e}=this.ctx;let i=0,o=0;if(this.labelSelection.each((s,n)=>{s.opacity=1,i=s.previousDatum?.value??t.from??n.value,o=n.value}),!this.labelsHaveExplicitText())if(i===o)this.formatLabelText({label:o});else{const s=`${this.id}_labels`;e.animate({id:s,groupId:"label",from:{label:i},to:{label:o},phase:t.phase??"update",ease:X1.easeOut,onUpdate:n=>this.formatLabelText(n)})}}animateEmptyUpdateReady(){const{animationManager:t}=this.ctx,{node:e}=FS(!0,this.horizontal);Vp(this.id,"node",t,[this.datumSelection],e,(i,o)=>o.itemId),Vp(this.id,"label",t,[this.labelSelection],TS,()=>"primary"),this.animateLabelText({from:0,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:t}=this.ctx,{node:e}=FS(!1,this.horizontal);Vp(this.id,"node",t,[this.datumSelection],e,(i,o)=>o.itemId),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}getSeriesDomain(){return[0,1]}getSeriesRange(t,e){return[NaN,NaN]}getLegendData(){return[]}getTooltipContent(t){const{id:e,properties:i}=this,{tooltip:o}=i;if(!i.isValid())return;const{value:s=i.value,text:n=i.label.text}=PS(t);return o.formatTooltip({data:[{label:n,fallbackLabel:"Value",value:this.formatLabel(s)}]},{seriesId:e,title:void 0,datum:void 0,value:s})}pickNodeClosestDatum(t){return LS(this,t)}pickFocus(t){return RS(this,t)}getCaptionText(){return this.formatLabel(this.properties.value)}};Fp.className="LinearGaugeSeries",Fp.type="linear-gauge";var{ThemeSymbols:{DEFAULT_HIERARCHY_FILLS:q1,DEFAULT_GAUGE_SERIES_COLOR_RANGE:J1},ThemeConstants:{CARTESIAN_AXIS_TYPE:Gp}}=d1,tP={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["gauge"],identifier:"linear-gauge",moduleFactory:t=>new Fp(t),tooltipDefaults:{range:10},defaultAxes:[{type:Gp.NUMBER,line:{enabled:!1}},{type:Gp.NUMBER,line:{enabled:!1}}],themeTemplate:{minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{thickness:50,bar:{strokeWidth:0},segmentation:{enabled:!1,interval:{},spacing:1},defaultTarget:{fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},size:10,shape:"triangle",placement:"after",spacing:5,label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:5}},label:{enabled:!1,placement:"inside-start",fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[2]},minimumFontSize:12,spacing:18,color:{$ref:"backgroundColor"}},margin:4},axes:{[Gp.NUMBER]:{line:{enabled:!1},gridLine:{enabled:!1}}}},paletteFactory(t){const{takeColors:e,colorsCount:i,userPalette:o,themeTemplateParameters:s}=t,{fills:n}=e(i),a=s.get(J1),r=s.get(q1),l=o==="inbuilt"?a:[n[0],n[1]];return{scale:{defaultFill:r?.[1],stroke:r?.[2]},defaultColorRange:IS(l)}}};import{_ModuleSupport as eP}from"ag-charts-community";var $a={zoom:{axes:"xy",anchorPointX:"pointer",anchorPointY:"pointer",buttons:{anchorPointX:"middle",anchorPointY:"middle"}},legend:{enabled:!1},gradientLegend:{enabled:!1},tooltip:{range:"exact"}};import{_ModuleSupport as iP}from"ag-charts-community";import{_ModuleSupport as oP}from"ag-charts-community";var sP=1e-9;function KS(t,e,i,o){const[s,n]=t,[a,r]=e,l=a-s,c=r-n,h=l*l+c*c;let p,u;if(Math.abs(h)e){const h=(e-s)/l,p=[i+(a-i)*h,o+(r-o)*h],u=Math.atan2(r-o,a-i);return{point:p,angle:u}}s=c,i=a,o=r}}import{_ModuleSupport as nP}from"ag-charts-community";var{LonLatBBox:aP}=nP;function Za(t,e,i,o,s){return t==null?t=new aP(e,i,o,s):(t.lon0=Math.min(t.lon0,e),t.lat0=Math.min(t.lat0,i),t.lon1=Math.max(t.lon1,o),t.lat1=Math.max(t.lat1,s)),t}function ws(t,e){return t.forEach(i=>{const[o,s]=i;e=Za(e,o,s,o,s)}),e}function rP(t){if(t.length===0)return;let e=0,i=0,o=0,[s,n]=t[t.length-1];for(const[a,r]of t){const l=s*r-a*n;o+=l,e+=(s+a)*l,i+=(n+r)*l,s=a,n=r}return o*=3,[e/o,i/o]}function Ql(t,e,i){let o=!1,s=1/0;for(const n of t){let a=n[n.length-1],[r,l]=a;for(const c of n){const[h,p]=c;p>i!=l>i&&e<(r-h)*(i-p)/(l-p)+h&&(o=!o),s=Math.min(s,KS(a,c,e,i)),a=c,r=h,l=p}}return(o?-1:1)*Math.sqrt(s)}var{Path:lP,ExtendedPath2D:cP,BBox:hP,ScenePathChangeDetection:YS}=oP,Vn=class extends lP{constructor(){super(...arguments),this.projectedGeometry=void 0,this.renderMode=3,this.strokePath=new cP}computeBBox(){return(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1),this.bbox?.clone()}updatePath(){const{projectedGeometry:t}=this;this.strokePath.clear(),this.path.clear(),this.bbox=t!=null?this.drawGeometry(t,void 0):void 0}drawPath(t){super.drawPath(t),this.renderStroke(t,this.strokePath.getPath2D())}containsPoint(t,e){const{projectedGeometry:i}=this;return i==null||!this.getBBox().containsPoint(t,e)?!1:this.geometryDistance(i,t,e)<=0}distanceSquared(t,e){const{projectedGeometry:i}=this;if(i==null)return 1/0;const o=this.geometryDistance(i,t,e);return o>0?o*o:0}geometryDistance(t,e,i){const{renderMode:o,strokeWidth:s}=this,n=(o&1)!==0,a=(o&2)!==0,r=Math.max(s/2,1)+1;switch(t.type){case"GeometryCollection":return t.geometries.reduce((l,c)=>Math.min(l,this.geometryDistance(c,e,i)),1/0);case"MultiPolygon":return n?t.coordinates.reduce((l,c)=>Math.min(l,Math.max(Ql(c,e,i),0)),1/0):1/0;case"Polygon":return n?Math.max(Ql(t.coordinates,e,i),0):1/0;case"MultiLineString":return a?t.coordinates.reduce((l,c)=>Math.min(l,Math.max(US(c,e,i)-r,0)),1/0):1/0;case"LineString":return a?Math.max(US(t.coordinates,e,i)-r,0):1/0;case"MultiPoint":case"Point":default:return 1/0}}drawGeometry(t,e){const{renderMode:i,path:o,strokePath:s}=this,n=(i&1)!==0,a=(i&2)!==0;switch(t.type){case"GeometryCollection":t.geometries.forEach(r=>{e=this.drawGeometry(r,e)});break;case"MultiPolygon":n&&t.coordinates.forEach(r=>{e=this.drawPolygon(o,r,e)});break;case"Polygon":n&&(e=this.drawPolygon(o,t.coordinates,e));break;case"LineString":a&&(e=this.drawLineString(s,t.coordinates,e,!1));break;case"MultiLineString":a&&t.coordinates.forEach(r=>{e=this.drawLineString(s,r,e,!1)});break;case"Point":case"MultiPoint":break}return e}drawPolygon(t,e,i){if(e.length<1)return i;i=this.drawLineString(t,e[0],i,!0);for(let o=1;o{e=Fn(i,e)});break;case"MultiPolygon":t.coordinates.forEach(i=>{i.length>0&&(e=ws(i[0],e))});break;case"Polygon":t.coordinates.length>0&&(e=ws(t.coordinates[0],e));break;case"MultiLineString":t.coordinates.forEach(i=>{e=ws(i,e)});break;case"LineString":e=ws(t.coordinates,e);break;case"MultiPoint":t.coordinates.forEach(i=>{const[o,s]=i;e=Za(e,o,s,o,s)});break;case"Point":{const[i,o]=t.coordinates;e=Za(e,i,o,i,o);break}}return e}function ql(t){switch(t.type){case"GeometryCollection":{let e,i;return t.geometries.forEach(o=>{const s=ql(o);if(s==null)return;const n=ws(s[0],void 0);if(n==null)return;const a=Math.abs(n.lat1-n.lat0)*Math.abs(n.lon1-n.lon0);(e==null||a>e)&&(e=a,i=s)}),i}case"MultiPolygon":{let e,i;return t.coordinates.forEach(o=>{const s=ws(o[0],void 0);if(s==null)return;const n=Math.abs(s.lat1-s.lat0)*Math.abs(s.lon1-s.lon0);(e==null||n>e)&&(e=n,i=o)}),i}case"Polygon":return t.coordinates;case"MultiLineString":case"LineString":case"MultiPoint":case"Point":return}}function Jl(t){switch(t.type){case"GeometryCollection":{let e,i;return t.geometries.forEach(o=>{const s=Jl(o);if(s==null)return;const n=Wp(s);n!=null&&(e==null||n>e)&&(e=n,i=s)}),i}case"MultiLineString":{let e=0,i;return t.coordinates.forEach(o=>{const s=Wp(o);s>e&&(e=s,i=o)}),i}case"LineString":return t.coordinates;case"MultiPolygon":case"Polygon":case"MultiPoint":case"Point":return}}function Hp(t,e){if(t==null)return!1;switch(t.type){case"GeometryCollection":return t.geometries.some(i=>Hp(i,e));case"MultiPolygon":case"Polygon":return(e&1)!==0;case"MultiLineString":case"LineString":return(e&2)!==0;case"MultiPoint":case"Point":return(e&4)!==0}}function jo(t,e){switch(t.type){case"GeometryCollection":return{type:"GeometryCollection",geometries:t.geometries.map(i=>jo(i,e))};case"Polygon":return{type:"Polygon",coordinates:Kp(t.coordinates,e)};case"MultiPolygon":return{type:"MultiPolygon",coordinates:dP(t.coordinates,e)};case"MultiLineString":return{type:"MultiLineString",coordinates:Kp(t.coordinates,e)};case"LineString":return{type:"LineString",coordinates:Up(t.coordinates,e)};case"MultiPoint":return{type:"MultiPoint",coordinates:Up(t.coordinates,e)};case"Point":return{type:"Point",coordinates:e.convert(t.coordinates)}}}function dP(t,e){return t.map(i=>Kp(i,e))}function Kp(t,e){return t.map(i=>Up(i,e))}function Up(t,e){return t.map(i=>e.convert(i))}import{_ModuleSupport as jS}from"ag-charts-community";var d5=class extends jS.SeriesProperties{},Qa=class extends jS.DataModelSeries{addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager.addListener("legend-item-click",t=>{this.onLegendItemClick(t)}),this.ctx.chartEventManager.addListener("legend-item-double-click",t=>{this.onLegendItemDoubleClick(t)}))}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(t,e){return[NaN,NaN]}};import{_ModuleSupport as pP}from"ag-charts-community";function XS(t){return Array.isArray(t)&&t.length>=2&&t.every(vo)}function tc(t){return Array.isArray(t)&&t.length>=2&&t.every(XS)}var $S=.001;function uP(t){return Math.abs(t[0][0]-t[t.length-1][0])<$S&&Math.abs(t[0][1]-t[t.length-1][1])<$S}function ZS(t){return Array.isArray(t)&&t.every(tc)&&t.every(uP)}function QS(t){if(t===null)return!0;if(typeof t!="object"||t.type==null)return!1;const{type:e,coordinates:i}=t;switch(e){case"GeometryCollection":return Array.isArray(t.geometries)&&t.geometries.every(QS);case"MultiPolygon":return Array.isArray(i)&&i.every(ZS);case"Polygon":return ZS(i);case"MultiLineString":return Array.isArray(i)&&i.every(tc);case"LineString":return tc(i);case"MultiPoint":return tc(i);case"Point":return XS(i)}}function gP(t){return t!==null&&typeof t=="object"&&t.type==="Feature"&&QS(t.geometry)}function yP(t){return t!==null&&typeof t=="object"&&t.type==="FeatureCollection"&&Array.isArray(t.features)&&t.features.every(gP)}var Wi=pP.predicateWithMessage(yP,"a GeoJSON object");import{_ModuleSupport as fP}from"ag-charts-community";var{COLOR_STRING:mP,LINE_DASH:xP,OBJECT:SP,POSITIVE_NUMBER:qS,RATIO:bP,Validate:Ps,SeriesProperties:vP,SeriesTooltip:MP}=fP,Xo=class extends vP{constructor(){super(...arguments),this.topology=void 0,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.tooltip=new MP}};d([Ps(Wi,{optional:!0})],Xo.prototype,"topology",2),d([Ps(mP)],Xo.prototype,"stroke",2),d([Ps(bP)],Xo.prototype,"strokeOpacity",2),d([Ps(qS)],Xo.prototype,"strokeWidth",2),d([Ps(xP)],Xo.prototype,"lineDash",2),d([Ps(qS)],Xo.prototype,"lineDashOffset",2),d([Ps(SP)],Xo.prototype,"tooltip",2);var{createDatumId:kP,SeriesNodePickMode:AP,Validate:IP,Group:DP,Selection:TP,PointerEvents:CP}=iP,ec=class extends Qa{constructor(t){super({moduleCtx:t,useLabelLayer:!0,pickModes:[AP.EXACT_SHAPE_MATCH]}),this.properties=new Xo,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new DP({name:"itemGroup"})),this.datumSelection=TP.select(this.itemGroup,()=>this.nodeFactory())}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.contentGroup.zIndex=[0,t,0],this.highlightGroup.zIndex=[0,t,1],!0):!1}nodeFactory(){const t=new Vn;return t.renderMode=2,t.lineJoin="round",t.lineCap="round",t.pointerEvents=CP.None,t}processData(){const{topology:t}=this;this.topologyBounds=t?.features.reduce((e,i)=>{const o=i.geometry;return o==null?e:Fn(o,e)},void 0),t==null&<.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:t,topology:e,scale:i}=this;if(e==null)return;const o=[],s=[];return e.features.forEach((n,a)=>{const{geometry:r}=n,l=r!=null&&i!=null?jo(r,i):void 0;l!=null&&o.push({series:this,itemId:a,datum:n,datumIndex:0,index:a,projectedGeometry:l})}),{itemId:t,nodeData:o,labelData:s}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:t}=this;this.updateSelections(),this.contentGroup.visible=this.visible;const{nodeData:e=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:e,datumSelection:t}),this.updateDatumNodes({datumSelection:t})}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>kP(e.index))}updateDatumNodes(t){const{properties:e}=this,{datumSelection:i}=t,{stroke:o,strokeOpacity:s,lineDash:n,lineDashOffset:a}=e,r=this.getStrokeWidth(e.strokeWidth);i.each((l,c)=>{const{projectedGeometry:h}=c;if(h==null){l.visible=!1,l.projectedGeometry=void 0;return}l.visible=!0,l.projectedGeometry=h,l.stroke=o,l.strokeWidth=r,l.strokeOpacity=s,l.lineDash=n,l.lineDashOffset=a})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(t){}computeFocusBounds(t){}};ec.className="MapLineBackgroundSeries",ec.type="map-line-background",d([IP(Wi,{optional:!0,property:"topology"})],ec.prototype,"_chartTopology",2);var{DEFAULT_HIERARCHY_STROKES:NP}=eP.ThemeSymbols,OP={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-line-background",moduleFactory:t=>new ec(t),tooltipDefaults:{range:"exact"},themeTemplate:{...$a,series:{strokeWidth:1,lineDash:[0],lineDashOffset:0}},paletteFactory:({themeTemplateParameters:t})=>({stroke:t.get(NP)?.[1]})};import{_ModuleSupport as JS}from"ag-charts-community";import{_ModuleSupport as tb}from"ag-charts-community";function LP(){return{fromFn:(i,o,s)=>s==="removed"?{scalingX:1,scalingY:1}:i.previousDatum==null?{scalingX:0,scalingY:0}:{scalingX:i.scalingX,scalingY:i.scalingY},toFn:(i,o,s)=>s==="removed"?{scalingX:0,scalingY:0}:{scalingX:1,scalingY:1}}}function eb(t,e){const i=t.contextNodeData?.nodeData[e.datumIndex];if(i!==void 0){for(const o of t.datumSelection.nodes())if(o.datum===i)return o}}import{_ModuleSupport as RP}from"ag-charts-community";var{AND:EP,ARRAY:wP,COLOR_STRING:PP,COLOR_STRING_ARRAY:_P,FUNCTION:BP,LINE_DASH:zP,NUMBER_ARRAY:VP,OBJECT:ib,POSITIVE_NUMBER:Yp,RATIO:FP,STRING:xi,Validate:kt,SeriesProperties:GP,SeriesTooltip:WP,Label:HP}=RP,bt=class extends GP{constructor(){super(...arguments),this.topology=void 0,this.idKey="",this.topologyIdKey="name",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.maxStrokeWidth=void 0,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.label=new HP,this.tooltip=new WP}};d([kt(Wi,{optional:!0})],bt.prototype,"topology",2),d([kt(xi,{optional:!0})],bt.prototype,"title",2),d([kt(xi,{optional:!0})],bt.prototype,"legendItemName",2),d([kt(xi)],bt.prototype,"idKey",2),d([kt(xi)],bt.prototype,"topologyIdKey",2),d([kt(xi,{optional:!0})],bt.prototype,"idName",2),d([kt(xi,{optional:!0})],bt.prototype,"labelKey",2),d([kt(xi,{optional:!0})],bt.prototype,"labelName",2),d([kt(xi,{optional:!0})],bt.prototype,"sizeKey",2),d([kt(xi,{optional:!0})],bt.prototype,"sizeName",2),d([kt(xi,{optional:!0})],bt.prototype,"colorKey",2),d([kt(xi,{optional:!0})],bt.prototype,"colorName",2),d([kt(VP,{optional:!0})],bt.prototype,"sizeDomain",2),d([kt(EP(_P,wP.restrict({minLength:1})),{optional:!0})],bt.prototype,"colorRange",2),d([kt(Yp,{optional:!0})],bt.prototype,"maxStrokeWidth",2),d([kt(PP)],bt.prototype,"stroke",2),d([kt(FP)],bt.prototype,"strokeOpacity",2),d([kt(Yp)],bt.prototype,"strokeWidth",2),d([kt(zP)],bt.prototype,"lineDash",2),d([kt(Yp)],bt.prototype,"lineDashOffset",2),d([kt(BP,{optional:!0})],bt.prototype,"itemStyler",2),d([kt(ib)],bt.prototype,"label",2),d([kt(ib)],bt.prototype,"tooltip",2);var{getMissCount:KP,createDatumId:ob,SeriesNodePickMode:sb,valueProperty:qa,CachedTextMeasurerPool:UP,Validate:YP,ColorScale:jP,LinearScale:XP,Selection:jp,Text:$P,Transformable:ZP}=tb,ic=class extends Qa{constructor(t){super({moduleCtx:t,useLabelLayer:!0,pickModes:[sb.EXACT_SHAPE_MATCH,sb.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new bt,this._chartTopology=void 0,this.colorScale=new jP,this.sizeScale=new XP,this.datumSelection=jp.select(this.contentGroup,()=>this.nodeFactory()),this.labelSelection=jp.select(this.labelGroup,$P),this.highlightDatumSelection=jp.select(this.highlightNode,()=>this.nodeFactory()),this._previousDatumMidPoint=void 0}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){return super.hasData&&this.topology!=null}renderToOffscreenCanvas(){return!0}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.contentGroup.zIndex=[1,t],this.highlightGroup.zIndex=[2,t],!0):!1}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}nodeFactory(){const t=new Vn;return t.renderMode=2,t.lineJoin="round",t.lineCap="round",t}async processData(t){if(this.data==null||!this.properties.isValid())return;const{data:e,topology:i,sizeScale:o,colorScale:s}=this,{topologyIdKey:n,idKey:a,sizeKey:r,colorKey:l,labelKey:c,sizeDomain:h,colorRange:p}=this.properties,u=new Map;i?.features.forEach(S=>{const b=S.properties?.[n];b==null||!Hp(S.geometry,2)||u.set(b,S)});const g=this.sizeScale.type,y=this.colorScale.type,f=this.scale?.type,{dataModel:m,processedData:x}=await this.requestDataModel(t,e,{props:[qa(a,f,{id:"idValue",includeProperty:!1}),qa(a,f,{id:"featureValue",includeProperty:!1,processor:()=>S=>u.get(S)}),...c!=null?[qa(c,"band",{id:"labelValue"})]:[],...r!=null?[qa(r,g,{id:"sizeValue"})]:[],...l!=null?[qa(l,y,{id:"colorValue"})]:[]]}),v=m.resolveColumnById(this,"featureValue",x);if(this.topologyBounds=v.reduce((S,b)=>{const k=b?.geometry;return k==null?S:Fn(k,S)},void 0),r!=null){const S=m.resolveProcessedDataIndexById(this,"sizeValue"),b=x.domain.values[S]??[];o.domain=h??b}if(p!=null&&this.isColorScaleValid()){const S=m.resolveProcessedDataIndexById(this,"colorValue");s.domain=x.domain.values[S],s.range=p,s.update()}i==null&<.warnOnce("no topology was provided for [MapLineSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:t}=this.properties;if(!t)return!1;const{dataModel:e,processedData:i}=this;if(!e||!i)return!1;const o=e.resolveProcessedDataIndexById(this,"colorValue"),s=i.input.count,n=KP(this,i.defs.values[o].missing);return!(s===0||s===n)}getLabelDatum(t,e,i,o){if(e==null||i==null)return;const s=Jl(i);if(s==null)return;const{idKey:n,idName:a,sizeKey:r,sizeName:l,colorKey:c,colorName:h,labelKey:p,labelName:u,label:g}=this.properties,y=this.getLabelText(g,{value:e,datum:t,idKey:n,idName:a,sizeKey:r,sizeName:l,colorKey:c,colorName:h,labelKey:p,labelName:u});if(y==null)return;const f=UP.measureText(String(y),{font:o}),m=Zl(s);if(m==null)return;const[x,v]=m.point,{width:S,height:b}=f;return{point:{x,y:v,size:0},label:{width:S,height:b,text:y},anchor:void 0,placement:void 0}}createNodeData(){const{id:t,dataModel:e,processedData:i,sizeScale:o,properties:s,scale:n}=this,{idKey:a,sizeKey:r,colorKey:l,labelKey:c,label:h}=s;if(e==null||i==null)return;const p=e.resolveColumnById(this,"idValue",i),u=e.resolveColumnById(this,"featureValue",i),g=c!=null?e.resolveColumnById(this,"labelValue",i):void 0,y=r!=null?e.resolveColumnById(this,"sizeValue",i):void 0,f=l!=null?e.resolveColumnById(this,"colorValue",i):void 0,m=s.maxStrokeWidth??s.strokeWidth;o.range=[Math.min(s.strokeWidth,m),m];const x=h.getFont(),v=new Map;i.dataSources.get(this.id)?.forEach((A,T)=>{const N=p[T],L=u[T]?.geometry??void 0,D=L!=null&&n!=null?jo(L,n):void 0;N!=null&&D!=null&&v.set(N,D)});const S=[],b=[],k=[];(i.dataSources.get(this.id)??[]).forEach((A,T)=>{const N=p[T],L=f?.[T],D=y?.[T],C=g?.[T],O=v.get(N);O==null&&k.push(N);const w=this.getLabelDatum(A,C,O,x);w!=null&&b.push(w),S.push({series:this,itemId:a,datum:A,datumIndex:T,idValue:N,labelValue:C,colorValue:L,sizeValue:D,projectedGeometry:O})});const M=10;if(k.length>M){const A=k.length-M;k.length=M,k.push(`(+${A} more)`)}return k.length>0&<.warnOnce("some data items do not have matches in the provided topology",k),{itemId:t,nodeData:S,labelData:b}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:t,highlightDatumSelection:e}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let i=this.ctx.highlightManager?.getActiveHighlight();i!=null&&(i.series!==this||i.datum==null)&&(i=void 0);const o=this.contextNodeData?.nodeData??[];this.datumSelection=this.updateDatumSelection({nodeData:o,datumSelection:t}),this.updateDatumNodes({datumSelection:t,isHighlight:!1}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:i!=null?[i]:[],datumSelection:e}),this.updateDatumNodes({datumSelection:e,isHighlight:!0})}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>ob(e.idValue))}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return{stroke:i?.stroke??e.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity,lineDash:i?.lineDash??e.lineDash,lineDashOffset:i?.lineDashOffset??e.lineDashOffset}}getItemStyleOverrides(t,e,i,o,s,n){const{id:a,properties:r,colorScale:l,sizeScale:c}=this,{colorRange:h,itemStyler:p}=r;let u;if(!n&&i!=null&&(u??(u={}),u.stroke=this.isColorScaleValid()?l.convert(i):h?.[0]??r.stroke),o!=null&&(u??(u={}),u.strokeWidth=c.convert(o,!0)),p!=null){const g=this.cachedDatumCallback(ob(t,n?"highlight":"node"),()=>p({seriesId:a,datum:e,highlighted:n,...s,...u}));u??(u={}),Object.assign(u,g)}return u}updateDatumNodes(t){const{datumSelection:e,isHighlight:i}=t,o=this.getItemBaseStyle(i);e.each((s,n)=>{const{datum:a,datumIndex:r,colorValue:l,sizeValue:c,projectedGeometry:h}=n;if(h==null){s.visible=!1,s.projectedGeometry=void 0;return}const p=this.getItemStyleOverrides(String(r),a,l,c,o,i);s.visible=!0,s.projectedGeometry=h,s.stroke=p?.stroke??o.stroke,s.strokeWidth=p?.strokeWidth??o.strokeWidth,s.strokeOpacity=p?.strokeOpacity??o.strokeOpacity,s.lineDash=p?.lineDash??o.lineDash,s.lineDashOffset=p?.lineDashOffset??o.lineDashOffset})}updatePlacedLabelData(t){this.labelSelection=this.labelSelection.update(t,e=>{e.pointerEvents=tb.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(t){const{labelSelection:e}=t,{color:i,fontStyle:o,fontWeight:s,fontSize:n,fontFamily:a}=this.properties.label;e.each((r,{x:l,y:c,width:h,height:p,text:u})=>{r.visible=!0,r.x=l+h/2,r.y=c+p/2,r.text=u,r.fill=i,r.fontStyle=o,r.fontWeight=s,r.fontSize=n,r.fontFamily=a,r.textAlign="center",r.textBaseline="middle"})}resetAnimation(){}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum({x:t,y:e}){let i=1/0,o;return this.datumSelection.each((s,n)=>{const a=s.distanceSquared(t,e);anew ic(t),tooltipDefaults:{range:"exact"},themeTemplate:{...$a,series:{strokeWidth:1,maxStrokeWidth:3,lineDash:[0],lineDashOffset:0,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}}},paletteFactory:t=>{const{takeColors:e,colorsCount:i,userPalette:o,themeTemplateParameters:s}=t,{fill:n}=JS.singleSeriesPaletteFactory(t),a=s.get(QP),{fills:r}=e(i);return{colorRange:o==="inbuilt"?a:[r[0],r[1]],stroke:n}}};import{_ModuleSupport as nb}from"ag-charts-community";import{_ModuleSupport as ab}from"ag-charts-community";var JP=(t,e,i)=>{let o=t,s=o;for(const n of e)if(o==null||i(o.value,n)>0)o={value:n,next:o},s=o;else{for(s=s;s.next!=null&&i(s.next.value,n)<=0;)s=s.next;s.next={value:n,next:s.next}}return o};function rb(t,e,i){const o=ws(t[0],void 0);if(o==null)return;const s=(o.lon0+o.lon1)/2,n=(o.lat0+o.lat1)/2,a=Math.abs(o.lon1-o.lon0),r=Math.abs(o.lat1-o.lat0),l=rP(t[0]),[c,h]=l,p=-Ql(t,c,h);let u;const g=(k,I)=>{const A=Math.max(I-p,0);return k-.5*A},y=(k,I,M)=>{const{distance:A,maxDistance:T}=i(t,k,I,M),N=Math.hypot(c-k,h-I),L=Math.min(Math.max(c,k-M/2),k+M/2),D=Math.min(Math.max(h,I-M/2),I+M/2),C=Math.hypot(c-L,h-D),O=g(A,N),w=g(T,C);return{distance:A,maxDistance:T,value:O,maxValue:w,x:k,y:I,stride:M}},f=(k,I,M,A)=>{const T=y(I,M,A);T.maxDistance>=0&&k.push(T)},m=Math.min(a,r)/2;let x={value:y(s,n,m),next:null};for(;x!=null;){const k=x.value,{distance:I,value:M,maxValue:A,x:T,y:N,stride:L}=k;if(x=x.next,I>0&&(u==null||M>u.value)&&(u=k),u!=null&&A-u.value<=e)continue;const D=L/2,C=[];f(C,T-D,N-D,D),f(C,T+D,N-D,D),f(C,T-D,N+D,D),f(C,T+D,N+D,D),C.sort(lb),x=JP(x,C,lb)}if(u==null)return;const{distance:v,x:S,y:b}=u;return{x:S,y:b,distance:v}}var lb=(t,e)=>e.maxValue-t.maxValue;function Xp(t,e){const i=rb(t,e,(n,a,r,l)=>{const c=-Ql(n,a,r),h=c+l*Math.SQRT2;return{distance:c,maxDistance:h}});if(i==null)return;const{x:o,y:s}=i;return[o,s]}function cb(t,e){let i;switch(t.type){case"GeometryCollection":return t.geometries.flatMap(o=>cb(o,e));case"MultiPoint":return t.coordinates;case"Point":return[t.coordinates];case"MultiPolygon":{const o=ql(t);i=o!=null?Xp(o,e):void 0;break}case"Polygon":{const o=t.coordinates;i=o!=null?Xp(o,e):void 0;break}case"MultiLineString":{const o=Jl(t);i=o!=null?Zl(o)?.point:void 0;break}case"LineString":{const o=t.coordinates;i=Zl(o)?.point;break}}return i!=null?[i]:[]}import{_ModuleSupport as t_}from"ag-charts-community";var{AND:e_,ARRAY:i_,COLOR_STRING:hb,COLOR_STRING_ARRAY:o_,FUNCTION:s_,NUMBER_ARRAY:n_,OBJECT:db,POSITIVE_NUMBER:oc,RATIO:pb,STRING:fe,MARKER_SHAPE:a_,LINE_DASH:r_,Validate:ht,SeriesProperties:l_,SeriesTooltip:c_,Label:h_}=t_,ub=class extends h_{constructor(){super(...arguments),this.placement="bottom"}};d([ht(fe)],ub.prototype,"placement",2);var dt=class extends l_{constructor(){super(...arguments),this.topology=void 0,this.idKey=void 0,this.topologyIdKey="name",this.idName=void 0,this.latitudeKey=void 0,this.latitudeName=void 0,this.longitudeKey=void 0,this.longitudeName=void 0,this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.shape="circle",this.size=6,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new ub,this.tooltip=new c_}isValid(){const t=super.isValid(),e=this.idKey!=null,i=this.latitudeKey!=null&&this.longitudeKey!=null;return!e&&!i?(lt.warnOnce("Either both [topology] and [idKey] or both [latitudeKey] and [longitudeKey] must be set to render a map marker series."),!1):t}};d([ht(Wi,{optional:!0})],dt.prototype,"topology",2),d([ht(fe,{optional:!0})],dt.prototype,"title",2),d([ht(fe,{optional:!0})],dt.prototype,"legendItemName",2),d([ht(fe,{optional:!0})],dt.prototype,"idKey",2),d([ht(fe)],dt.prototype,"topologyIdKey",2),d([ht(fe,{optional:!0})],dt.prototype,"idName",2),d([ht(fe,{optional:!0})],dt.prototype,"latitudeKey",2),d([ht(fe,{optional:!0})],dt.prototype,"latitudeName",2),d([ht(fe,{optional:!0})],dt.prototype,"longitudeKey",2),d([ht(fe,{optional:!0})],dt.prototype,"longitudeName",2),d([ht(fe,{optional:!0})],dt.prototype,"labelKey",2),d([ht(fe,{optional:!0})],dt.prototype,"labelName",2),d([ht(fe,{optional:!0})],dt.prototype,"sizeKey",2),d([ht(fe,{optional:!0})],dt.prototype,"sizeName",2),d([ht(fe,{optional:!0})],dt.prototype,"colorKey",2),d([ht(fe,{optional:!0})],dt.prototype,"colorName",2),d([ht(e_(o_,i_.restrict({minLength:1})),{optional:!0})],dt.prototype,"colorRange",2),d([ht(a_)],dt.prototype,"shape",2),d([ht(oc)],dt.prototype,"size",2),d([ht(oc,{optional:!0})],dt.prototype,"maxSize",2),d([ht(n_,{optional:!0})],dt.prototype,"sizeDomain",2),d([ht(hb)],dt.prototype,"fill",2),d([ht(pb)],dt.prototype,"fillOpacity",2),d([ht(hb)],dt.prototype,"stroke",2),d([ht(oc)],dt.prototype,"strokeWidth",2),d([ht(pb)],dt.prototype,"strokeOpacity",2),d([ht(r_)],dt.prototype,"lineDash",2),d([ht(oc)],dt.prototype,"lineDashOffset",2),d([ht(s_,{optional:!0})],dt.prototype,"itemStyler",2),d([ht(db)],dt.prototype,"label",2),d([ht(db)],dt.prototype,"tooltip",2);var{CachedTextMeasurerPool:d_,Validate:p_,fromToMotion:u_,StateMachine:g_,getMissCount:y_,createDatumId:gb,SeriesNodePickMode:yb,valueProperty:_s,computeMarkerFocusBounds:f_,ColorScale:m_,LinearScale:x_,Group:S_,Selection:$p,Text:b_,Marker:Zp,applyShapeStyle:v_}=ab,sc=class extends Qa{constructor(t){super({moduleCtx:t,useLabelLayer:!0,pickModes:[yb.EXACT_SHAPE_MATCH,yb.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new dt,this._chartTopology=void 0,this.colorScale=new m_,this.sizeScale=new x_,this.markerGroup=this.contentGroup.appendChild(new S_({name:"markerGroup"})),this.labelSelection=$p.select(this.labelGroup,b_,!1),this.markerSelection=$p.select(this.markerGroup,Zp,!1),this.highlightMarkerSelection=$p.select(this.highlightNode,Zp),this.animationState=new g_("empty",{empty:{update:{target:"ready",action:()=>this.animateMarkers()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.resetAllAnimation(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateMarkers()},resize:{target:"ready",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){const t=this.properties.latitudeKey!=null&&this.properties.longitudeKey!=null;return super.hasData&&(this.topology!=null||t)}renderToOffscreenCanvas(){return!0}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.contentGroup.zIndex=[3,t],this.highlightGroup.zIndex=[4,t],!0):!1}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}async processData(t){if(this.data==null||!this.properties.isValid())return;const{data:e,topology:i,sizeScale:o,colorScale:s}=this,{topologyIdKey:n,idKey:a,latitudeKey:r,longitudeKey:l,sizeKey:c,colorKey:h,labelKey:p,sizeDomain:u,colorRange:g}=this.properties,y=new Map;i?.features.forEach(A=>{const T=A.properties?.[n];T!=null&&y.set(T,A)});const f=this.sizeScale.type,m=this.colorScale.type,x=this.scale?.type,v=r!=null&&l!=null,{dataModel:S,processedData:b}=await this.requestDataModel(t,e,{props:[...a!=null?[_s(a,x,{id:"idValue",includeProperty:!1}),_s(a,x,{id:"featureValue",includeProperty:!1,processor:()=>A=>y.get(A)})]:[],...v?[_s(r,x,{id:"latValue"}),_s(l,x,{id:"lonValue"})]:[],...p?[_s(p,"band",{id:"labelValue"})]:[],...c?[_s(c,f,{id:"sizeValue"})]:[],...h?[_s(h,m,{id:"colorValue"})]:[]]}),k=a!=null?S.resolveColumnById(this,"featureValue",b):void 0,I=v?S.resolveColumnById(this,"latValue",b):void 0,M=v?S.resolveColumnById(this,"lonValue",b):void 0;if(this.topologyBounds=b.dataSources.get(this.id)?.reduce((A,T,N)=>{const D=k?.[N]?.geometry;if(D!=null&&(A=Fn(D,A)),I!=null&&M!=null){const C=M[N],O=I[N];A=Za(A,C,O,C,O)}return A},void 0),c!=null){const A=S.resolveProcessedDataIndexById(this,"sizeValue"),T=b.domain.values[A]??[];o.domain=u??T}if(g!=null&&this.isColorScaleValid()){const A=S.resolveProcessedDataIndexById(this,"colorValue");s.domain=b.domain.values[A],s.range=g,s.update()}this.animationState.transition("updateData")}isColorScaleValid(){const{colorKey:t}=this.properties;if(!t)return!1;const{dataModel:e,processedData:i}=this;if(!e||!i)return!1;const o=e.resolveProcessedDataIndexById(this,"colorValue"),s=i.input.count,n=y_(this,i.defs.values[o].missing);return!(s===0||s===n)}getLabelDatum(t,e,i,o,s,n){if(e==null)return;const{idKey:a,idName:r,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:p,sizeKey:u,sizeName:g,colorKey:y,colorName:f,labelKey:m,labelName:x,label:v,shape:S}=this.properties,{placement:b}=v,k=this.getLabelText(v,{value:e,datum:t,idKey:a,idName:r,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:p,sizeKey:u,sizeName:g,colorKey:y,colorName:f,labelKey:m,labelName:x});if(k==null)return;const{width:I,height:M}=d_.measureText(String(k),{font:n}),A=Zp.anchor(S);return{point:{x:i,y:o,size:s},label:{width:I,height:M,text:k},anchor:A,placement:b}}createNodeData(){const{id:t,dataModel:e,processedData:i,sizeScale:o,properties:s,scale:n}=this,{idKey:a,latitudeKey:r,longitudeKey:l,sizeKey:c,colorKey:h,labelKey:p,label:u}=s;if(e==null||i==null||n==null)return;const g=r!=null&&l!=null,y=a!=null?e.resolveColumnById(this,"idValue",i):void 0,f=a!=null?e.resolveColumnById(this,"featureValue",i):void 0,m=g?e.resolveColumnById(this,"latValue",i):void 0,x=g?e.resolveColumnById(this,"lonValue",i):void 0,v=p!=null?e.resolveColumnById(this,"labelValue",i):void 0,S=c!=null?e.resolveColumnById(this,"sizeValue",i):void 0,b=h!=null?e.resolveColumnById(this,"colorValue",i):void 0,k=s.maxSize??s.size;o.range=[Math.min(s.size,k),k];const I=u.getFont();let M;y!=null&&f!=null&&(M=new Map,i.dataSources.get(this.id)?.forEach((C,O)=>{const w=y[O],P=f[O]?.geometry??void 0,B=P!=null&&n!=null?jo(P,n):void 0;w!=null&&B!=null&&M.set(w,B)}));const A=[],T=[],N=[];(i.dataSources.get(this.id)??[]).forEach((C,O)=>{const w=y?.[O],P=x?.[O],B=m?.[O],z=b?.[O],_=S?.[O],R=v?.[O],E=_!=null?o.convert(_,!0):s.size,V=w!=null?M?.get(w):void 0;if(w!=null&&jo==null&&N.push(w),P!=null&&B!=null){const[F,G]=n.convert([P,B]),W=this.getLabelDatum(C,R,F,G,E,I);W&&T.push(W),A.push({series:this,itemId:r,datum:C,datumIndex:O,index:-1,idValue:w,lonValue:P,latValue:B,labelValue:R,sizeValue:_,colorValue:z,point:{x:F,y:G,size:E},midPoint:{x:F,y:G}})}else V!=null&&cb(V,1).forEach(([F,G],W)=>{const K=this.getLabelDatum(C,R,F,G,E,I);K&&T.push(K),A.push({series:this,itemId:r,datum:C,datumIndex:O,index:W,idValue:w,lonValue:P,latValue:B,labelValue:R,sizeValue:_,colorValue:z,point:{x:F,y:G,size:E},midPoint:{x:F,y:G}})})});const D=10;if(N.length>D){const C=N.length-D;N.length=D,N.push(`(+${C} more)`)}return N.length>0&<.warnOnce("some data items do not have matches in the provided topology",N),{itemId:t,nodeData:A,labelData:T}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}checkScaleChange(){return this.previousScale===this.scale?!1:(this.previousScale=this.scale,!0)}update({seriesRect:t}){const e=this.checkResize(t),i=this.checkScaleChange(),{markerSelection:o,highlightMarkerSelection:s}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let n=this.ctx.highlightManager?.getActiveHighlight();n!=null&&(n.series!==this||n.datum==null)&&(n=void 0);const a=this.contextNodeData?.nodeData??[];this.markerSelection=this.updateMarkerSelection({markerData:a,markerSelection:o}),this.updateMarkerNodes({markerSelection:o,isHighlight:!1,highlightedDatum:n}),this.highlightMarkerSelection=this.updateMarkerSelection({markerData:n!=null?[n]:[],markerSelection:s}),this.updateMarkerNodes({markerSelection:s,isHighlight:!0,highlightedDatum:n}),(i||e)&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePlacedLabelData(t){this.labelSelection=this.labelSelection.update(t,e=>{e.pointerEvents=ab.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(t){const{labelSelection:e}=t,{color:i,fontStyle:o,fontWeight:s,fontSize:n,fontFamily:a}=this.properties.label;e.each((r,{x:l,y:c,width:h,height:p,text:u})=>{r.visible=!0,r.x=l+h/2,r.y=c+p/2,r.text=u,r.fill=i,r.fontStyle=o,r.fontWeight=s,r.fontSize=n,r.fontFamily=a,r.textAlign="center",r.textBaseline="middle"})}updateMarkerSelection(t){const{markerData:e,markerSelection:i}=t;return i.update(e,void 0,o=>gb([o.index,o.idValue,o.lonValue,o.latValue]))}getMarkerItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return{shape:e.shape,size:e.size,fill:i?.fill??e.fill,fillOpacity:i?.fillOpacity??e.fillOpacity,stroke:i?.stroke??e.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity,lineDash:i?.lineDash??e.lineDash,lineDashOffset:i?.lineDashOffset??e.lineDashOffset}}getMarkerItemStyleOverrides(t,e,i,o,s,n){const{id:a,properties:r,colorScale:l,sizeScale:c}=this,{colorRange:h,itemStyler:p}=r;let u;if(!n&&i!=null&&(u??(u={}),u.fill=this.isColorScaleValid()?l.convert(i):h?.[0]??r.fill),o!=null&&(u??(u={}),u.size=c.convert(o,!0)),p!=null){const g=this.cachedDatumCallback(gb(t,n?"highlight":"node"),()=>p({seriesId:a,datum:e,highlighted:n,...s,...u}));u??(u={}),Object.assign(u,g)}return u}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i,highlightedDatum:o}=t,s=this.getMarkerItemBaseStyle(i);e.each((n,a)=>{const{datumIndex:r,datum:l,point:c,colorValue:h,sizeValue:p}=a,u=this.getMarkerItemStyleOverrides(String(r),l,h,p,s,i);n.shape=u?.shape??s.shape,n.size=u?.size??s.size,v_(n,s,u),n.translationX=c.x,n.translationY=c.y,n.zIndex=!i&&o!=null&&l===o.datum?1:0})}isProcessedDataAnimatable(){return!0}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.ctx.animationManager.skipCurrentBatch(),this.labelSelection.cleanup(),this.markerSelection.cleanup(),this.highlightMarkerSelection.cleanup()}animateMarkers(){const{animationManager:t}=this.ctx,e=LP();u_(this.id,"markers",t,[this.markerSelection,this.highlightMarkerSelection],e)}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum(t){const{x:e,y:i}=t;let o=1/0,s;return this.contextNodeData?.nodeData.forEach(n=>{const{x:a,y:r,size:l}=n.point,c=Math.max(Math.abs(a-e)-l,0),h=Math.max(Math.abs(r-i)-l,0),p=c*c+h*h;p=0?"N":"S"}, ${Math.abs(D).toFixed(4)}\xB0 ${D>=0?"W":"E"}`}const N=this.getMarkerItemBaseStyle(!1);return Object.assign(N,this.getMarkerItemStyleOverrides(String(b),b,M,I,N,!1)),S.formatTooltip({heading:T,title:x??v,symbol:this.legendItemSymbol(b),data:A},{seriesId:e,datum:k,title:x,idKey:n,idName:a,latitudeKey:r,latitudeName:l,longitudeKey:c,longitudeName:h,colorKey:p,colorName:u,sizeKey:g,sizeName:y,labelKey:f,labelName:m,...N})}getFormattedMarkerStyle(t){const{datumIndex:e,colorValue:i,sizeValue:o}=t,s=this.getMarkerItemBaseStyle(!1);return Object.assign(s,this.getMarkerItemStyleOverrides(String(e),e,i,o,s,!1)),{size:s.size}}computeFocusBounds(t){return f_(this,t)}};sc.className="MapMarkerSeries",sc.type="map-marker",d([p_(Wi,{optional:!0,property:"topology"})],sc.prototype,"_chartTopology",2);var{DEFAULT_DIVERGING_SERIES_COLOR_RANGE:M_}=nb.ThemeSymbols,k_={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-marker",moduleFactory:t=>new sc(t),tooltipDefaults:{range:"exact"},themeTemplate:{...$a,series:{shape:"circle",maxSize:30,fillOpacity:.5,label:{color:{$ref:"textColor"}}}},paletteFactory:t=>{const{takeColors:e,colorsCount:i,userPalette:o,themeTemplateParameters:s}=t,{fill:n,stroke:a}=nb.singleSeriesPaletteFactory(t),r=s.get(M_),{fills:l}=e(i);return{fill:n,stroke:a,colorRange:o==="inbuilt"?r:[l[0],l[1]]}}};import{_ModuleSupport as A_}from"ag-charts-community";import{_ModuleSupport as I_}from"ag-charts-community";import{_ModuleSupport as D_}from"ag-charts-community";var{COLOR_STRING:fb,LINE_DASH:T_,OBJECT:C_,POSITIVE_NUMBER:mb,RATIO:xb,Validate:co,SeriesProperties:N_,SeriesTooltip:O_}=D_,Hi=class extends N_{constructor(){super(...arguments),this.topology=void 0,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.tooltip=new O_}};d([co(Wi,{optional:!0})],Hi.prototype,"topology",2),d([co(fb)],Hi.prototype,"fill",2),d([co(xb)],Hi.prototype,"fillOpacity",2),d([co(fb)],Hi.prototype,"stroke",2),d([co(xb)],Hi.prototype,"strokeOpacity",2),d([co(mb)],Hi.prototype,"strokeWidth",2),d([co(T_)],Hi.prototype,"lineDash",2),d([co(mb)],Hi.prototype,"lineDashOffset",2),d([co(C_)],Hi.prototype,"tooltip",2);var{createDatumId:L_,SeriesNodePickMode:R_,Validate:E_,Selection:w_,Group:P_,PointerEvents:__}=I_,nc=class extends Qa{constructor(t){super({moduleCtx:t,useLabelLayer:!0,pickModes:[R_.EXACT_SHAPE_MATCH]}),this.properties=new Hi,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new P_({name:"itemGroup"})),this.datumSelection=w_.select(this.itemGroup,()=>this.nodeFactory())}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}getNodeData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.contentGroup.zIndex=[0,t,0],this.highlightGroup.zIndex=[0,t,1],!0):!1}nodeFactory(){const t=new Vn;return t.renderMode=1,t.lineJoin="round",t.pointerEvents=__.None,t}processData(){const{topology:t}=this;this.topologyBounds=t?.features.reduce((e,i)=>{const o=i.geometry;return o==null?e:Fn(o,e)},void 0),t==null&<.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:t,topology:e,scale:i}=this;if(e==null)return;const o=[],s=[];return e.features.forEach((n,a)=>{const{geometry:r}=n,l=r!=null&&i!=null?jo(r,i):void 0;l!=null&&o.push({series:this,itemId:a,datum:n,datumIndex:0,index:a,projectedGeometry:l})}),{itemId:t,nodeData:o,labelData:s}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:t}=this;this.updateSelections(),this.contentGroup.visible=this.visible;const{nodeData:e=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:e,datumSelection:t}),this.updateDatumNodes({datumSelection:t})}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>L_(e.index))}updateDatumNodes(t){const{properties:e}=this,{datumSelection:i}=t,{fill:o,fillOpacity:s,stroke:n,strokeOpacity:a,lineDash:r,lineDashOffset:l}=e,c=this.getStrokeWidth(e.strokeWidth);i.each((h,p)=>{const{projectedGeometry:u}=p;if(u==null){h.visible=!1,h.projectedGeometry=void 0;return}h.visible=!0,h.projectedGeometry=u,h.fill=o,h.fillOpacity=s,h.stroke=n,h.strokeWidth=c,h.strokeOpacity=a,h.lineDash=r,h.lineDashOffset=l})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(t){}pickFocus(){}computeFocusBounds(t){}};nc.className="MapShapeBackgroundSeries",nc.type="map-shape-background",d([E_(Wi,{optional:!0,property:"topology"})],nc.prototype,"_chartTopology",2);var{DEFAULT_HIERARCHY_FILLS:B_}=A_.ThemeSymbols,z_={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-shape-background",moduleFactory:t=>new nc(t),tooltipDefaults:{range:"exact"},themeTemplate:{...$a,series:{stroke:{$ref:"backgroundColor"},strokeWidth:1}},paletteFactory:({themeTemplateParameters:t})=>({fill:t.get(B_)?.[1]})};import{_ModuleSupport as Sb}from"ag-charts-community";import{_ModuleSupport as bb}from"ag-charts-community";function V_(t,{aspectRatio:e,precision:i}){const o=rb(t,i,(l,c,h,p)=>{const u=G_(l,c,h,e),g=u+2*p*e,y=u*Math.SQRT2,f=g*Math.SQRT2;return{distance:y,maxDistance:f}});if(o==null)return;const{x:s,y:n,distance:a}=o,r=a/Math.SQRT2;return{x:s,y:n,maxWidth:r}}function F_(t,e,i,o,s){const[n,a]=t,[r,l]=e,c=1/s,h=r-n,p=l-a,[u,g]=a<=l?t:e,[y,f]=n<=r?t:e,[m,x]=a<=l?e:t,[v,S]=n<=r?e:t;let b=1/0;if(h!==0){const N=p/h;for(let L=0;L<=1;L+=1){const D=L===0?c:-c,C=(N*n-a-D*i+o)/(N-D);if(C>=y&&C<=v){const O=Math.abs(i-C)*2;b=Math.min(b,O)}}}else for(let N=0;N<=1;N+=1){const D=(N===0?c:-c)*(n-i)+o;if(D>=g&&D<=x){const O=Math.abs(o-D)*2*s;b=Math.min(b,O)}}const k=s,I=Math.abs((u-i)/(g-o)),M=Math.abs((m-i)/(x-o));if(xo&&Ii&&Ai!=c>i&&e<(l-p)*(i-u)/(c-u)+p&&(s=!s);const g=F_(r,h,e,i,o);n=Math.min(n,g),r=h,l=p,c=u}}return(s?1:-1)*n}function ac(t,e,i){i>=e&&(t.maxX=Math.min(t.maxX,i-e)),i<=e&&(t.minX=Math.max(t.minX,i-e))}function W_(t,e,i,o,s,n){const a=s-n/2,r=s+n/2,[l,c]=e,[h,p]=i,u=h-l,g=p-c,[y,f]=l<=h?e:i,[m,x]=l<=h?i:e;if(u!==0){const v=g/u;for(let S=0;S<=1;S+=1){const k=((S===0?a:r)-c)/v+l;k>=y&&k<=m&&ac(t,o,k)}}else Math.max(a,Math.min(c,p))<=Math.min(r,Math.max(c,p))&&ac(t,o,l);return m=a&&x<=r?ac(t,o,m):y>o&&f>=a&&f<=r&&ac(t,o,y),t}function H_(t,e,i,o){const s={minX:-1/0,maxX:1/0};for(const r of t){let l=r[r.length-1];for(const c of r)W_(s,l,c,e,i,o),l=c}const{minX:n,maxX:a}=s;return Number.isFinite(n)&&Number.isFinite(a)?{x:e+(n+a)/2,width:a-n}:{x:e,width:0}}import{_ModuleSupport as K_}from"ag-charts-community";var{AND:U_,ARRAY:Y_,COLOR_STRING:vb,COLOR_STRING_ARRAY:j_,FUNCTION:X_,LINE_DASH:$_,OBJECT:Mb,POSITIVE_NUMBER:Qp,RATIO:kb,STRING:ho,Validate:Tt,SeriesProperties:Z_,SeriesTooltip:Q_}=K_,At=class extends Z_{constructor(){super(...arguments),this.topology=void 0,this.idKey="",this.idName=void 0,this.topologyIdKey="name",this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.padding=0,this.label=new Ua,this.tooltip=new Q_}};d([Tt(Wi,{optional:!0})],At.prototype,"topology",2),d([Tt(ho,{optional:!0})],At.prototype,"title",2),d([Tt(ho,{optional:!0})],At.prototype,"legendItemName",2),d([Tt(ho)],At.prototype,"idKey",2),d([Tt(ho,{optional:!0})],At.prototype,"idName",2),d([Tt(ho)],At.prototype,"topologyIdKey",2),d([Tt(ho,{optional:!0})],At.prototype,"labelKey",2),d([Tt(ho,{optional:!0})],At.prototype,"labelName",2),d([Tt(ho,{optional:!0})],At.prototype,"colorKey",2),d([Tt(ho,{optional:!0})],At.prototype,"colorName",2),d([Tt(U_(j_,Y_.restrict({minLength:1})),{optional:!0})],At.prototype,"colorRange",2),d([Tt(vb)],At.prototype,"fill",2),d([Tt(kb)],At.prototype,"fillOpacity",2),d([Tt(vb)],At.prototype,"stroke",2),d([Tt(kb)],At.prototype,"strokeOpacity",2),d([Tt(Qp)],At.prototype,"strokeWidth",2),d([Tt($_)],At.prototype,"lineDash",2),d([Tt(Qp)],At.prototype,"lineDashOffset",2),d([Tt(Qp)],At.prototype,"padding",2),d([Tt(X_,{optional:!0})],At.prototype,"itemStyler",2),d([Tt(Mb)],At.prototype,"label",2),d([Tt(Mb)],At.prototype,"tooltip",2);var{getMissCount:q_,createDatumId:Ab,SeriesNodePickMode:Ib,valueProperty:rc,Validate:J_,CachedTextMeasurerPool:tB,TextUtils:Db,ColorScale:eB,Group:Tb,Selection:qp,Text:iB,PointerEvents:oB,applyShapeStyle:sB}=bb,Cb=bb.MercatorScale.fixedScale(),lc=class extends Qa{constructor(t){super({moduleCtx:t,useLabelLayer:!0,pickModes:[Ib.EXACT_SHAPE_MATCH,Ib.NEAREST_NODE]}),this.properties=new At,this._chartTopology=void 0,this.colorScale=new eB,this.itemGroup=this.contentGroup.appendChild(new Tb({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new Tb({name:"itemLabelGroup"})),this.datumSelection=qp.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=qp.select(this.itemLabelGroup,iB),this.highlightDatumSelection=qp.select(this.highlightNode,()=>this.nodeFactory()),this.previousLabelLayouts=void 0,this._previousDatumMidPoint=void 0,this.itemLabelGroup.pointerEvents=oB.None}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){return super.hasData&&this.topology!=null}renderToOffscreenCanvas(){return!0}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.contentGroup.zIndex=[1,t],this.highlightGroup.zIndex=[2,t],!0):!1}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}nodeFactory(){const t=new Vn;return t.renderMode=1,t.lineJoin="round",t}async processData(t){if(this.data==null||!this.properties.isValid())return;const{data:e,topology:i,colorScale:o}=this,{topologyIdKey:s,idKey:n,colorKey:a,labelKey:r,colorRange:l}=this.properties,c=new Map;i?.features.forEach(f=>{const m=f.properties?.[s];m==null||!Hp(f.geometry,1)||c.set(m,f)});const h=this.colorScale.type,p=this.scale?.type,{dataModel:u,processedData:g}=await this.requestDataModel(t,e,{props:[rc(n,p,{id:"idValue",includeProperty:!1}),rc(n,p,{id:"featureValue",includeProperty:!1,processor:()=>f=>c.get(f)}),...r?[rc(r,"band",{id:"labelValue"})]:[],...a?[rc(a,h,{id:"colorValue"})]:[]]}),y=u.resolveColumnById(this,"featureValue",g);if(this.topologyBounds=y.reduce((f,m)=>{const x=m?.geometry;return x==null?f:Fn(x,f)},void 0),l!=null&&this.isColorScaleValid()){const f=u.resolveProcessedDataIndexById(this,"colorValue");o.domain=g.domain.values[f],o.range=l,o.update()}i==null&<.warnOnce("no topology was provided for [MapShapeSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:t}=this.properties;if(!t)return!1;const{dataModel:e,processedData:i}=this;if(!e||!i)return!1;const o=e.resolveProcessedDataIndexById(this,"colorValue"),s=i.input.count,n=q_(this,i.defs.values[o].missing);return!(s===0||s===n)}getLabelLayout(t,e,i,o,s){if(e==null||o==null)return;const{idKey:n,idName:a,colorKey:r,colorName:l,labelKey:c,labelName:h,padding:p,label:u}=this.properties,g=this.getLabelText(u,{value:e,datum:t,idKey:n,idName:a,colorKey:r,colorName:l,labelKey:c,labelName:h});if(g==null)return;const y=tB.measureText(String(g),{font:i}),f=g.split(` `).length,m=(y.width+2*p)/(f*Db.getLineHeight(u.fontSize)+2*p);if(s?.geometry===o&&s?.labelText===g&&s?.aspectRatio===m)return s;const x=jo(o,Cb),v=ql(x);if(v==null)return;const S=V_(v,{aspectRatio:m,precision:.001});if(S==null)return;const{x:b,y:k,maxWidth:I}=S;return{geometry:o,labelText:g,aspectRatio:m,x:b,y:k,maxWidth:I,fixedPolygon:v}}getLabelDatum(t,e){const{scale:i}=this;if(i==null)return;const{padding:o,label:s}=this.properties,{labelText:n,aspectRatio:a,x:r,y:l,maxWidth:c,fixedPolygon:h}=t,p={width:Math.ceil(c*e),height:Math.ceil(c*e/a),meta:r},u=Ha(n,s,{padding:o},(b,k)=>{if(!k)return p;const I=H_(h,r,l,b/e);return{width:I.width*e,height:b,meta:I.x}});if(u==null)return;const[{text:g,fontSize:y,lineHeight:f,width:m},x]=u;if(g===Db.EllipsisChar)return;const v=m{const A=p[M],T=y?.[M],N=g?.[M],L=u[M]?.geometry??void 0;L==null&&S.push(A);const D=this.getLabelLayout(I,N,f,L,n?.get(A));D!=null&&m.set(A,D);const C=D!=null&&s!=null?this.getLabelDatum(D,h):void 0;C!=null&&v.push(C);const O=L!=null&&s!=null?jo(L,s):void 0;x.push({series:this,itemId:a,datum:I,datumIndex:M,idValue:A,colorValue:T,labelValue:N,projectedGeometry:O})});const k=10;if(S.length>k){const I=S.length-k;S.length=k,S.push(`(+${I} more)`)}return S.length>0&<.warnOnce("some data items do not have matches in the provided topology",S),{itemId:t,nodeData:x,labelData:v}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:t,labelSelection:e,highlightDatumSelection:i}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let o=this.ctx.highlightManager?.getActiveHighlight();o!=null&&(o.series!==this||o.datum==null)&&(o=void 0);const s=this.contextNodeData?.nodeData??[],n=this.contextNodeData?.labelData??[];this.datumSelection=this.updateDatumSelection({nodeData:s,datumSelection:t}),this.updateDatumNodes({datumSelection:t,isHighlight:!1}),this.labelSelection=this.updateLabelSelection({labelData:n,labelSelection:e}),this.updateLabelNodes({labelSelection:e}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:o!=null?[o]:[],datumSelection:i}),this.updateDatumNodes({datumSelection:i,isHighlight:!0})}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>Ab(e.idValue))}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return{fill:i?.fill??e.fill,fillOpacity:i?.fillOpacity??e.fillOpacity,stroke:i?.stroke??e.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity,lineDash:i?.lineDash??e.lineDash,lineDashOffset:i?.lineDashOffset??e.lineDashOffset}}getItemStyleOverrides(t,e,i,o,s){const{id:n,properties:a,colorScale:r}=this,{colorRange:l,itemStyler:c}=a;let h;if(!s&&i!=null&&(h??(h={}),h.fill=this.isColorScaleValid()?r.convert(i):l?.[0]??a.fill),c!=null){const p=this.cachedDatumCallback(Ab(t,s?"highlight":"node"),()=>c({seriesId:n,datum:e,highlighted:s,...o,...h}));h??(h={}),Object.assign(h,p)}return h}updateDatumNodes(t){const{datumSelection:e,isHighlight:i}=t,o=this.getItemBaseStyle(i);e.each((s,n)=>{const{datum:a,datumIndex:r,colorValue:l,projectedGeometry:c}=n;if(c==null){s.visible=!1,s.projectedGeometry=void 0;return}const h=this.getItemStyleOverrides(String(r),a,l,o,i);s.visible=!0,s.projectedGeometry=c,sB(s,o,h)})}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e)}updateLabelNodes(t){const{labelSelection:e}=t,{color:i,fontStyle:o,fontWeight:s,fontFamily:n}=this.properties.label;e.each((a,{x:r,y:l,text:c,fontSize:h,lineHeight:p})=>{a.visible=!0,a.x=r,a.y=l,a.text=c,a.fill=i,a.fontStyle=o,a.fontWeight=s,a.fontSize=h,a.lineHeight=p,a.fontFamily=n,a.textAlign="center",a.textBaseline="middle"})}resetAnimation(){}pickNodeClosestDatum({x:t,y:e}){let i=1/0,o;return this.datumSelection.each((s,n)=>{const a=s.distanceSquared(t,e);anew lc(t),tooltipDefaults:{range:"exact"},themeTemplate:{...$a,series:{fillOpacity:1,strokeWidth:1,lineDash:[0],lineDashOffset:0,padding:2,label:{color:{$ref:"backgroundColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:"bold",overflowStrategy:"hide"}}},paletteFactory:t=>{const{takeColors:e,colorsCount:i,userPalette:o,themeTemplateParameters:s}=t,{fill:n}=Sb.singleSeriesPaletteFactory(t),a=s.get(nB),{fills:r}=e(i);return{fill:n,stroke:s.get(aB),colorRange:o==="inbuilt"?a:[r[0],r[1]]}}};import{_ModuleSupport as lB}from"ag-charts-community";import{_ModuleSupport as cB}from"ag-charts-community";import{_ModuleSupport as Jp}from"ag-charts-community";var{ChartAxisDirection:po,PolarAxis:hB,diff:dB,fixNumericExtent:pB,groupAccumulativeValueProperty:Nb,keyProperty:uB,normaliseGroupTo:gB,resetLabelFn:yB,seriesLabelFadeInAnimation:fB,seriesLabelFadeOutAnimation:mB,valueProperty:xB,animationValidation:SB,createDatumId:Ob,SeriesNodePickMode:Lb,normalizeAngle360:Rb,CategoryScale:bB,motion:Eb,applyShapeStyle:vB}=Jp,MB=class extends Jp.SeriesNodeEvent{constructor(t,e,i,o){super(t,e,i,o),this.angleKey=o.properties.angleKey,this.radiusKey=o.properties.radiusKey}},wb=class extends Jp.PolarSeries{constructor(t,{animationResetFns:e}){super({moduleCtx:t,useLabelLayer:!0,canHaveAxes:!0,pickModes:[Lb.NEAREST_NODE,Lb.EXACT_SHAPE_MATCH],animationResetFns:{...e,label:yB}}),this.NodeEvent=MB,this.groupScale=new bB,this.circleCache={r:0,cx:0,cy:0}}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];if(t===po.X)return e.getDomain(this,"angleValue","key",i);{const o=e.getDomain(this,"radiusValue-end","value",i),s=Number.isFinite(o[1]-o[0])?[o[0]>0?0:o[0],o[1]<0?0:o[1]]:[];return pB(s)}}async processData(t){const{visible:e}=this,{angleKey:i,radiusKey:o,normalizedTo:s}=this.properties,n=!this.ctx.animationManager.isSkipped();if(!this.properties.isValid())return;const a=this.getStackId(),r=`${a}-trailing`,l=[];ee(s)&&l.push(gB([a,r],Math.abs(s))),n&&this.processedData&&l.push(dB(this.id,this.processedData)),n&&l.push(SB());const c=e||!n?{}:{forceValue:0},h=this.axes[po.Y]?.scale.type,p=this.axes[po.X]?.scale.type;await this.requestDataModel(t,this.data,{props:[uB(i,p,{id:"angleValue"}),xB(o,h,{id:"radiusValue-raw",invalidValue:null,...c}),...Nb(o,"normal","current",{id:"radiusValue-end",rangeId:"radiusValue-range",invalidValue:null,groupId:a,separateNegative:!0,...c},h),...Nb(o,"trailing","current",{id:"radiusValue-start",invalidValue:null,groupId:r,separateNegative:!0,...c},h),...l],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const t=this.radius,e=this.centerX,i=this.centerY,o=this.circleCache;return t!==o.r||e!==o.cx||i!==o.cy?(this.circleCache={r:t,cx:e,cy:i},!0):!1}isRadiusAxisReversed(){return this.axes[po.Y]?.isReversed()}maybeRefreshNodeData(){if(!this.didCircleChange()&&!this.nodeDataRefresh)return;const{nodeData:e=[]}=this.createNodeData()??{};this.nodeData=e,this.nodeDataRefresh=!1}getAxisInnerRadius(){const t=this.axes[po.Y];return t instanceof hB?this.radius*t.innerRadiusRatio:0}createNodeData(){const{processedData:t,dataModel:e,groupScale:i}=this;if(!e||!t||t.type!=="grouped"||!this.properties.isValid())return;const o=this.axes[po.X],s=this.axes[po.Y],n=o?.scale,a=s?.scale;if(!n||!a)return;const r=e.resolveKeysById(this,"angleValue",t),l=e.resolveColumnById(this,"radiusValue-start",t),c=e.resolveColumnById(this,"radiusValue-end",t),h=e.resolveColumnById(this,"radiusValue-raw",t),p=e.resolveProcessedDataIndexById(this,"radiusValue-range");let u=0,g=0;o instanceof es&&(u=o.groupPaddingInner,g=o.paddingInner);const f=(n.bandwidth??0)*(1-g),{index:m,visibleGroupCount:x}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);i.domain=Array.from({length:x}).map((P,B)=>String(B)),i.range=[-f/2,f/2],i.paddingInner=x>1?u:0;const v=this.isRadiusAxisReversed(),S=v?this.radius:this.getAxisInnerRadius(),b=v?this.getAxisInnerRadius():this.radius,k=b+S,{angleKey:I,radiusKey:M,angleName:A,radiusName:T,label:N}=this.properties,L=(P,B,z,_)=>{const R=this.getLabelText(N,{value:B,datum:P,angleKey:I,radiusKey:M,angleName:A,radiusName:T});if(R)return{x:z,y:_,text:R,textAlign:"center",textBaseline:"middle"}},D=[],C={itemId:M,nodeData:D,labelData:D};if(!this.visible)return C;const{dataSources:O}=t,w=O.get(this.id)??[];for(const{datumIndex:P,group:B}of e.forEachGroupDatum(this,t)){const z=w[P],_=r[P];if(_==null)return;const R=h[P],E=R>=0&&!Object.is(R,-0),V=l[P],F=c[P],G=B.aggregation[p][E?1:0]??0,W=E===v;if(V===void 0||F===void 0)return;let K,j;if(w.length===1)K=-.5*Math.PI,j=1.5*Math.PI;else{const at=n.convert(_);K=Rb(at+i.convert(String(m))),j=Rb(K+i.bandwidth)}const Z=K+i.bandwidth/2,J=k-a.convert(V),tt=k-a.convert(F),Q=(J+tt)/2,U=k-a.convert(0),q=k-a.convert(G),it=Math.cos(Z)*Q,X=Math.sin(Z)*Q,Ot=this.properties.label.enabled?L(z,R,it,X):void 0,It=this.getColumnWidth(K,j);D.push({series:this,datum:z,datumIndex:P,point:{x:it,y:X,size:0},midPoint:{x:it,y:X},label:Ot,angleValue:_,radiusValue:R,negative:W,innerRadius:J,outerRadius:tt,stackInnerRadius:U,stackOuterRadius:q,startAngle:K,endAngle:j,axisInnerRadius:S,axisOuterRadius:b,columnWidth:It,index:P})}return{itemId:M,nodeData:D,labelData:D}}getColumnWidth(t,e){return NaN}update({seriesRect:t}){const e=this.checkResize(t);this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updateSectorSelection(this.itemSelection,!1),this.updateSectorSelection(this.highlightSelection,!0),this.updateLabels(),e&&this.animationState.transition("resize"),this.animationState.transition("update")}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return{fill:i?.fill??e.fill,fillOpacity:i?.fillOpacity??e.fillOpacity,stroke:i?.stroke??e.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity,lineDash:i?.lineDash??e.lineDash,lineDashOffset:i?.lineDashOffset??e.lineDashOffset,cornerRadius:e.cornerRadius}}getItemStyleOverrides(t,e,i,o){const{id:s,properties:n}=this,{angleKey:a,radiusKey:r,itemStyler:l}=n;if(l!=null)return this.cachedDatumCallback(Ob(t,o?"highlight":"node"),()=>l({seriesId:s,datum:e,highlighted:o,angleKey:a,radiusKey:r,...i}))}updateSectorSelection(t,e){let i=[];if(e){const s=this.ctx.highlightManager?.getActiveHighlight();s?.datum&&s.series===this&&i.push(s)}else i=this.nodeData;const o=this.getItemBaseStyle(e);t.update(i,void 0,s=>this.getDatumId(s)).each((s,n)=>{const{datum:a,datumIndex:r}=n,l=this.getItemStyleOverrides(String(r),a,o,e);this.updateItemPath(s,n,e),vB(s,o,l),s.cornerRadius=l?.cornerRadius??o.cornerRadius,s.lineJoin="round"})}updateLabels(){const{label:t}=this.properties;this.labelSelection.update(this.nodeData).each((e,i)=>{t.enabled&&i.label?(e.x=i.label.x,e.y=i.label.y,e.fill=t.color,e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.text=i.label.text,e.textAlign=i.label.textAlign,e.textBaseline=i.label.textBaseline,e.visible=!0):e.visible=!1})}animateEmptyUpdateReady(){const{labelSelection:t}=this,e=this.getColumnTransitionFunctions();Eb.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],e),fB(this,"labels",this.ctx.animationManager,t)}animateClearingUpdateEmpty(){const{itemSelection:t}=this,{animationManager:e}=this.ctx,i=this.getColumnTransitionFunctions();Eb.fromToMotion(this.id,"datums",e,[t],i),mB(this,"labels",e,this.labelSelection)}getTooltipContent(t){const{id:e,dataModel:i,processedData:o,axes:s,properties:n}=this,{angleKey:a,angleName:r,radiusKey:l,radiusName:c,tooltip:h}=n,p=s[po.X],u=s[po.Y];if(!i||!o||!p||!u)return;const{datumIndex:g}=t,y=o.dataSources.get(this.id)?.[g],f=i.resolveKeysById(this,"angleValue",o)[g],m=i.resolveColumnById(this,"radiusValue-raw",o)[g];if(f==null)return;const x=this.getItemBaseStyle(!1);return Object.assign(x,this.getItemStyleOverrides(String(g),g,x,!1)),h.formatTooltip({heading:p.formatDatum(f),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:u.formatDatum(m)}]},{seriesId:e,datum:y,title:r,angleKey:a,angleName:r,radiusKey:l,radiusName:c,...x})}pickNodeClosestDatum(t){return this.pickNodeNearestDistantObject(t,this.itemSelection.nodes())}legendItemSymbol(){const{fill:t,stroke:e,fillOpacity:i,strokeOpacity:o,strokeWidth:s,lineDash:n,lineDashOffset:a}=this.properties;return{marker:{fill:t??"rgba(0, 0, 0, 0)",stroke:e??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:o,strokeWidth:s,lineDash:n,lineDashOffset:a}}}getLegendData(t){if(!this.properties.isValid()||t!=="category")return[];const{id:e,visible:i}=this,{radiusKey:o,radiusName:s,showInLegend:n}=this.properties;return[{legendType:"category",id:e,itemId:o,seriesId:e,enabled:i,label:{text:s??o},symbol:this.legendItemSymbol(),hideInLegend:!n}]}getDatumId(t){return Ob(t.angleValue)}computeLabelsBBox(){return null}};import{_ModuleSupport as kB}from"ag-charts-community";var{SeriesProperties:AB,SeriesTooltip:IB,Validate:Jt,COLOR_STRING:Pb,NUMBER:_b,FUNCTION:DB,LINE_DASH:TB,OBJECT:Bb,POSITIVE_NUMBER:tu,RATIO:zb,STRING:Ja,Label:CB}=kB,Gt=class extends AB{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.label=new CB,this.tooltip=new IB}};d([Jt(Ja)],Gt.prototype,"angleKey",2),d([Jt(Ja,{optional:!0})],Gt.prototype,"angleName",2),d([Jt(Ja)],Gt.prototype,"radiusKey",2),d([Jt(Ja,{optional:!0})],Gt.prototype,"radiusName",2),d([Jt(Pb)],Gt.prototype,"fill",2),d([Jt(zb)],Gt.prototype,"fillOpacity",2),d([Jt(Pb)],Gt.prototype,"stroke",2),d([Jt(tu)],Gt.prototype,"strokeWidth",2),d([Jt(zb)],Gt.prototype,"strokeOpacity",2),d([Jt(TB)],Gt.prototype,"lineDash",2),d([Jt(tu)],Gt.prototype,"lineDashOffset",2),d([Jt(tu)],Gt.prototype,"cornerRadius",2),d([Jt(DB,{optional:!0})],Gt.prototype,"itemStyler",2),d([Jt(_b)],Gt.prototype,"rotation",2),d([Jt(Ja,{optional:!0})],Gt.prototype,"stackGroup",2),d([Jt(_b,{optional:!0})],Gt.prototype,"normalizedTo",2),d([Jt(Bb)],Gt.prototype,"label",2),d([Jt(Bb)],Gt.prototype,"tooltip",2);import{_ModuleSupport as NB}from"ag-charts-community";import{_ModuleSupport as OB}from"ag-charts-community";var{motion:LB}=OB;function Vb(){const t={startAngle:new Map,endAngle:new Map},e=["startAngle","endAngle"],i=(a,r,l)=>{e.forEach(c=>{const h=t[c];let p=(l==="removed"||l==="updated"?a:r)[c],u=(l==="removed"?a:r)[c];isNaN(u)&&(u=a.previousDatum?.[c]??NaN);const g=p-u;Math.abs(g)>Math.PI&&(p-=Math.sign(g)*2*Math.PI),h.set(r,{from:p,to:u})})},o=(a,r)=>({startAngle:t.startAngle.get(a)[r],endAngle:t.endAngle.get(a)[r]});return{calculate:i,from:a=>o(a,"from"),to:a=>o(a,"to")}}function Fb(t,e,i){if(i==="updated"){if(t.previousDatum==null||isNaN(t.previousDatum.startAngle)||isNaN(t.previousDatum.endAngle))return"added";if(isNaN(e.startAngle)||isNaN(e.endAngle))return"removed"}return i==="added"&&t.previousDatum!=null?"updated":i}function RB(t){const e=Vb();return{toFn:(s,n,a)=>{const{startAngle:r,endAngle:l}=e.to(n);let c,h,p,u,g;return a==="removed"?(c=s.innerRadius,h=s.innerRadius,p=s.columnWidth,u=s.axisInnerRadius,g=s.axisOuterRadius):(c=isNaN(n.innerRadius)?t:n.innerRadius,h=isNaN(n.outerRadius)?t:n.outerRadius,p=isNaN(n.columnWidth)?s.columnWidth:n.columnWidth,u=n.axisInnerRadius,g=n.axisOuterRadius),{innerRadius:c,outerRadius:h,columnWidth:p,axisInnerRadius:u,axisOuterRadius:g,startAngle:r,endAngle:l}},fromFn:(s,n,a)=>{a=Fb(s,n,a),e.calculate(s,n,a);const{startAngle:r,endAngle:l}=e.from(n);let c,h,p,u,g;a==="removed"||a==="updated"?(c=s.innerRadius,h=s.outerRadius,p=s.columnWidth,u=s.axisInnerRadius,g=s.axisOuterRadius):(c=t,h=t,p=n.columnWidth,u=n.axisInnerRadius,g=n.axisOuterRadius);const y=LB.NODE_UPDATE_STATE_TO_PHASE_MAPPING[a];return{innerRadius:c,outerRadius:h,columnWidth:p,axisInnerRadius:u,axisOuterRadius:g,startAngle:r,endAngle:l,phase:y}}}}function EB(t,{innerRadius:e,outerRadius:i,columnWidth:o,axisInnerRadius:s,axisOuterRadius:n,startAngle:a,endAngle:r}){return{innerRadius:e,outerRadius:i,columnWidth:o,axisInnerRadius:s,axisOuterRadius:n,startAngle:a,endAngle:r}}var{SectorBox:cc,motion:wB}=NB;function eu(t){const{negative:e,innerRadius:i,outerRadius:o,stackInnerRadius:s,stackOuterRadius:n}=t;return{innerRadius:e?n:s,outerRadius:e?s:n,clipInnerRadius:e?o:i,clipOuterRadius:e?i:o}}function PB(t){const e=Vb();return{toFn:(s,n,a)=>{const{startAngle:r,endAngle:l}=e.to(n);let c,h,p;if(a==="removed")c=t,h=t,p=new cc(r,l,c,h);else{let u,g;({innerRadius:c,outerRadius:h,clipInnerRadius:u,clipOuterRadius:g}=eu(n)),isNaN(c)&&(c=t),isNaN(h)&&(h=t),isNaN(u)&&(u=t),isNaN(g)&&(g=t),p=new cc(r,l,u,g)}return{innerRadius:c,outerRadius:h,startAngle:r,endAngle:l,clipSector:p}},fromFn:(s,n,a)=>{a=Fb(s,n,a),e.calculate(s,n,a);const{startAngle:r,endAngle:l}=e.from(n);let c,h,p;a==="removed"||a==="updated"?(c=s.innerRadius,h=s.outerRadius,p=s.clipSector):(c=t,h=t),p??(p=new cc(r,l,c,h));const u=wB.NODE_UPDATE_STATE_TO_PHASE_MAPPING[a];return{innerRadius:c,outerRadius:h,startAngle:r,endAngle:l,clipSector:p,phase:u}}}}function _B(t,e){const{startAngle:i,endAngle:o}=e,{innerRadius:s,outerRadius:n,clipInnerRadius:a,clipOuterRadius:r}=eu(e),l=new cc(i,o,a,r);return{innerRadius:s,outerRadius:n,startAngle:i,endAngle:o,clipSector:l}}var{Sector:BB,SectorBox:zB,PolarZIndexMap:iu}=cB,ou=class extends wb{constructor(t){super(t,{animationResetFns:{item:_B}}),this.properties=new Gt}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.contentGroup.zIndex=[0,iu.FOREGROUND,t],this.highlightGroup.zIndex=[0,iu.HIGHLIGHT,t],this.labelGroup.zIndex=[0,iu.LABEL,t],!0):!1}getStackId(){return`nightingale-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new BB}updateItemPath(t,e,i){const{negative:o}=e;if(t.centerX=0,t.centerY=0,t.startOuterCornerRadius=o?0:this.properties.cornerRadius,t.endOuterCornerRadius=o?0:this.properties.cornerRadius,t.startInnerCornerRadius=o?this.properties.cornerRadius:0,t.endInnerCornerRadius=o?this.properties.cornerRadius:0,i){const{startAngle:s,endAngle:n}=e,{innerRadius:a,outerRadius:r,clipInnerRadius:l,clipOuterRadius:c}=eu(e);t.innerRadius=a,t.outerRadius=r,t.startAngle=s,t.endAngle=n,t.clipSector=new zB(s,n,l,c)}}getColumnTransitionFunctions(){const t=this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius();return PB(t)}};ou.className="NightingaleSeries",ou.type="nightingale";import{_ModuleSupport as VB}from"ag-charts-community";var{ThemeConstants:{POLAR_AXIS_TYPE:Gb,POLAR_AXIS_SHAPE:Wb}}=VB,FB={series:{strokeWidth:1,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}},axes:{[Gb.ANGLE_CATEGORY]:{shape:Wb.CIRCLE,groupPaddingInner:0,paddingInner:0,label:{spacing:10}},[Gb.RADIUS_NUMBER]:{shape:Wb.CIRCLE}}},{ThemeSymbols:{DEFAULT_POLAR_SERIES_STROKE:GB},ThemeConstants:{POLAR_AXIS_TYPE:Hb}}=lB,WB={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"nightingale",moduleFactory:t=>new ou(t),tooltipDefaults:{range:"exact"},defaultAxes:[{type:Hb.ANGLE_CATEGORY},{type:Hb.RADIUS_NUMBER}],themeTemplate:FB,paletteFactory({takeColors:t,userPalette:e}){const{fills:[i],strokes:[o]}=t(1);return{fill:i,stroke:e!=="inbuilt"?o:GB}},stackable:!0,groupable:!0,stackedByDefault:!0};import{_ModuleSupport as HB}from"ag-charts-community";import{_ModuleSupport as Kb}from"ag-charts-community";var{createDatumId:KB}=Kb,su=class extends kx{constructor(){super(...arguments),this.properties=new El}nodeFactory(){return new LR}updateDatumNodes({datumSelection:t,isHighlight:e}){const{id:i,properties:o}=this,{xKey:s,highKey:n,lowKey:a,openKey:r,closeKey:l,item:c,itemStyler:h}=o,{up:p,down:u}=c,{stroke:g,strokeWidth:y,strokeOpacity:f,lineDash:m,lineDashOffset:x}=p,{stroke:v,strokeWidth:S,strokeOpacity:b,lineDash:k,lineDashOffset:I}=u,M=e?o.highlightStyle.item:void 0;t.each((A,T)=>{const{isRising:N,centerX:L,width:D,y:C,height:O,yOpen:w,yClose:P,crisp:B}=T;let z;if(h!=null){const{stroke:_,strokeWidth:R,strokeOpacity:E,lineDash:V,lineDashOffset:F}=N?p:u;z=this.cachedDatumCallback(KB(this.getDatumId(T),e?"highlight":"node"),()=>h({seriesId:i,itemId:T.itemId,xKey:s,highKey:n,lowKey:a,openKey:r,closeKey:l,datum:T.datum,strokeOpacity:E,stroke:_,strokeWidth:R,lineDash:V,lineDashOffset:F,highlighted:e}))}A.centerX=L,A.width=D,A.y=C,A.height=O,A.yOpen=w,A.yClose=P,A.crisp=B,A.stroke=M?.stroke??z?.stroke??(N?g:v),A.strokeWidth=M?.strokeWidth??z?.strokeWidth??(N?y:S),A.strokeOpacity=M?.strokeOpacity??z?.strokeOpacity??(N?f:b),A.lineDash=M?.lineDash??z?.lineDash??(N?m:k),A.lineDashOffset=M?.lineDashOffset??z?.lineDashOffset??(N?x:I),A.strokeAlignment=(z?.strokeWidth??(N?y:S))/2})}getLegendData(t){const{id:e,data:i,ctx:{legendManager:o},visible:s}=this,{xKey:n,yName:a,item:{up:r,down:l},showInLegend:c,legendItemName:h}=this.properties;if(!i?.length||!n||t!=="category")return[];const p=new Kb.LinearGradient("rgb",[{color:r.stroke,offset:0},{color:r.stroke,offset:.5},{color:l.stroke,offset:.5}],90);return[{legendType:"category",id:e,itemId:e,seriesId:e,enabled:s&&o.getItemEnabled({seriesId:e,itemId:e}),label:{text:h??a??e},symbol:{marker:{fill:p,fillOpacity:r.strokeOpacity,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}},legendItemName:h,hideInLegend:!c}]}};su.className="ohlc",su.type="ohlc";var{CARTESIAN_AXIS_TYPE:hc,CARTESIAN_POSITION:Ub}=HB.ThemeConstants,UB={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"ohlc",moduleFactory:t=>new su(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:hc.NUMBER,position:Ub.LEFT},{type:hc.ORDINAL_TIME,position:Ub.BOTTOM}],themeTemplate:{animation:{enabled:!1},axes:{[hc.NUMBER]:{crosshair:{snap:!1}},[hc.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},groupable:!1,paletteFactory:({takeColors:t,colorsCount:e,userPalette:i,palette:o})=>{if(i==="user-indexed"){const[s]=t(e).strokes;return{item:{up:{stroke:s},down:{stroke:s}}}}return{item:{up:{stroke:o.up.stroke},down:{stroke:o.down.stroke}}}}};import"ag-charts-community";import{_ModuleSupport as Yb}from"ag-charts-community";import{_ModuleSupport as YB}from"ag-charts-community";var{SeriesProperties:jB,SeriesTooltip:XB,Validate:Wt,UNION:$B,COLOR_STRING_ARRAY:jb,FUNCTION:ZB,DIRECTION:QB,BOOLEAN:qB,LINE_DASH:JB,OBJECT:dc,NUMBER:tz,POSITIVE_NUMBER:pc,RATIO:Xb,STRING:$b,Label:Zb,DropShadow:ez}=YB,iz=class extends Zb{},nu=class extends Zb{constructor(){super(...arguments),this.spacing=0}};d([Wt(tz)],nu.prototype,"spacing",2),d([Wt($B(["before","after"],"a placement"))],nu.prototype,"placement",2);var Xt=class extends jB{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.direction="vertical",this.reverse=void 0,this.spacing=0,this.aspectRatio=void 0,this.shadow=new ez().set({enabled:!1}),this.label=new iz,this.stageLabel=new nu,this.tooltip=new XB}};d([Wt($b)],Xt.prototype,"stageKey",2),d([Wt($b)],Xt.prototype,"valueKey",2),d([Wt(jb)],Xt.prototype,"fills",2),d([Wt(Xb)],Xt.prototype,"fillOpacity",2),d([Wt(jb)],Xt.prototype,"strokes",2),d([Wt(pc)],Xt.prototype,"strokeWidth",2),d([Wt(Xb)],Xt.prototype,"strokeOpacity",2),d([Wt(JB)],Xt.prototype,"lineDash",2),d([Wt(pc)],Xt.prototype,"lineDashOffset",2),d([Wt(QB)],Xt.prototype,"direction",2),d([Wt(qB,{optional:!0})],Xt.prototype,"reverse",2),d([Wt(pc)],Xt.prototype,"spacing",2),d([Wt(pc,{optional:!0})],Xt.prototype,"aspectRatio",2),d([Wt(ZB,{optional:!0})],Xt.prototype,"itemStyler",2),d([Wt(dc)],Xt.prototype,"shadow",2),d([Wt(dc)],Xt.prototype,"label",2),d([Wt(dc)],Xt.prototype,"stageLabel",2),d([Wt(dc)],Xt.prototype,"tooltip",2);var{valueProperty:Qb,SeriesNodePickMode:qb,CachedTextMeasurerPool:oz,TextUtils:sz,createDatumId:nz,BBox:au,Group:ru,Selection:uc,Text:Jb,PointerEvents:tv,applyShapeStyle:az}=Yb,lu=class extends Yb.DataModelSeries{constructor(t){super({moduleCtx:t,pickModes:[qb.EXACT_SHAPE_MATCH,qb.NEAREST_NODE]}),this.properties=new Xt,this.itemGroup=this.contentGroup.appendChild(new ru({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new ru({name:"itemLabelGroup"})),this.stageLabelGroup=this.contentGroup.appendChild(new ru({name:"stageLabelGroup"})),this.datumSelection=uc.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=uc.select(this.itemLabelGroup,Jb),this.stageLabelSelection=uc.select(this.stageLabelGroup,Jb),this.highlightDatumSelection=uc.select(this.highlightNode,()=>this.nodeFactory()),this.itemLabelGroup.pointerEvents=tv.None,this.stageLabelGroup.pointerEvents=tv.None}addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager?.addListener("legend-item-click",t=>this.onLegendItemClick(t)))}nodeFactory(){return new Vi}getNodeData(){return this.contextNodeData?.nodeData}async processData(t){if(this.data==null||!this.properties.isValid())return;const{id:e,visible:i,ctx:{legendManager:o}}=this,{stageKey:s,valueKey:n}=this.properties,a="band",r="number",l=(h,p,u)=>i&&o.getItemEnabled({seriesId:e,itemId:u}),c=this.visible?{}:{forceValue:0};await this.requestDataModel(t,this.data,{props:[Qb(s,a,{id:"xValue"}),Qb(n,r,{id:"yValue",...c,validation:l,invalidValue:0})]})}createNodeData(){const{id:t,dataModel:e,processedData:i,properties:o,visible:s,ctx:{legendManager:n}}=this,{stageKey:a,valueKey:r,direction:l,reverse:c=l==="horizontal",spacing:h,aspectRatio:p,label:u,stageLabel:g}=o;if(e==null||i==null)return;const y=l==="horizontal",f=e.resolveColumnById(this,"xValue",i),m=e.resolveColumnById(this,"yValue",i),x=oz.getMeasurer({font:g.getFont()});let v,S;y?(v="center",S=g.placement==="before"?"bottom":"top"):(v=g.placement==="after"?"left":"right",S="middle");const b=g.enabled?[]:void 0;let k=0,I=0,M=0;const A=i.dataSources.get(this.id)??[];A.forEach((R,E)=>{const V=f[E],F=m[E],G=s&&n.getItemEnabled({seriesId:t,itemId:E});if(M+=F,b==null)return;const W=this.getLabelText(this.properties.stageLabel,{datum:R,value:V,stageKey:a,valueKey:r}),{width:K}=x.measureText(W),j=W.split(` `).length*sz.getLineHeight(u.fontSize);k=Math.max(k,K),I=Math.max(I,j),b.push({x:NaN,y:NaN,text:W,textAlign:v,textBaseline:S,visible:G})});const T=this._nodeDataDependencies?.seriesRectWidth??0,N=this._nodeDataDependencies?.seriesRectHeight??0,L=h*(i.input.count-1);let D;if(y){const R=I+g.spacing;D=new au(0,g.placement==="before"?R:0,T,N-R)}else{const R=k+g.spacing;D=new au(g.placement==="after"?0:R,0,T-R,N)}if(p!=null&&p!==0){const R=l==="horizontal"?1/p:p,E=Math.min(D.width,D.height*R),V=E/R;D=new au(D.x+(D.width-E)/2,D.y+(D.height-V)/2,E,V)}let C,O;y?O=g.placement==="before"?D.y-g.spacing:D.y+D.height+g.spacing:C=g.placement==="after"?D.x+D.width+g.spacing:D.x-g.spacing;const w=D.width-(y?L:0),P=D.height-(y?0:L);if(w<0||P<0)return;const B=[],z=[];let _=0;return A.forEach((R,E)=>{const V=f[E],F=m[E],G=s&&n.getItemEnabled({seriesId:t,itemId:E}),W=_+F,K=(_+W)/(2*M),j=(W-_)/M,Z=y?w*K+h*E:w*.5,J=y?P*.5:P*K+h*E,tt=D.x+Z,Q=D.y+J;if(b!=null){const at=b[E];at.x=C??tt,at.y=O??Q}let U,q,it,X;if(y){const at=w*j;U=at,it=at;const rt=(Z+at/2)*(P/D.width),gt=(Z-at/2)*(P/D.width);q=c?D.height-rt:rt,X=c?D.height-gt:gt}else{const at=P*j;q=at,X=at;const rt=(J-at/2)*(w/D.height),gt=(J+at/2)*(w/D.height);U=c?D.width-rt:rt,it=c?D.width-gt:gt}const Ot=this.getLabelText(u,{datum:R,value:F,stageKey:a,valueKey:r}),It={x:tt,y:Q,text:Ot,textAlign:"center",textBaseline:"middle",visible:G};z.push(It),B.push({series:this,itemId:r,datum:R,datumIndex:E,index:E,xValue:V,yValue:F,x:tt,y:Q,top:U,right:q,bottom:it,left:X,label:It,enabled:G,midPoint:{x:tt,y:Q}}),_=W}),{itemId:t,nodeData:B,labelData:z,stageLabelData:b}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update({seriesRect:t}){this.checkResize(t);const{datumSelection:e,labelSelection:i,stageLabelSelection:o,highlightDatumSelection:s}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let n=this.ctx.highlightManager?.getActiveHighlight();n!=null&&(n.series!==this||n.datum==null)&&(n=void 0);const a=this.contextNodeData?.nodeData??[],r=this.contextNodeData?.labelData??[],l=this.contextNodeData?.stageLabelData??[];this.datumSelection=this.updateDatumSelection({nodeData:a,datumSelection:e}),this.updateDatumNodes({datumSelection:e,isHighlight:!1}),this.labelSelection=this.updateLabelSelection({labelData:r,labelSelection:i}),this.updateLabelNodes({labelSelection:i,labelProperties:this.properties.label}),this.stageLabelSelection=this.updateStageLabelSelection({stageLabelData:l,stageLabelSelection:o}),this.updateLabelNodes({labelSelection:o,labelProperties:this.properties.stageLabel}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:n!=null?[n]:[],datumSelection:s}),this.updateDatumNodes({datumSelection:s,isHighlight:!0})}updateDatumSelection(t){return t.datumSelection.update(t.nodeData)}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return{fill:i?.fill,fillOpacity:i?.fillOpacity??e.fillOpacity,stroke:i?.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity,lineDash:i?.lineDash??e.lineDash,lineDashOffset:i?.lineDashOffset??e.lineDashOffset}}getItemStyleOverrides(t,e,i,o,s){const{id:n,properties:a}=this,{fills:r,strokes:l,stageKey:c,valueKey:h,itemStyler:p}=a,u=o.fill??r[i%r.length],g=o.stroke??l[i%l.length],y={};if(s||(y.fill=u,y.stroke=g),p!=null){const f=this.cachedDatumCallback(nz(t,s?"highlight":"node"),()=>p({seriesId:n,datum:e,stageKey:c,valueKey:h,highlighted:s,fill:u,stroke:g,...o}));Object.assign(y,f)}return y}updateDatumNodes(t){const{datumSelection:e,isHighlight:i}=t,{properties:o}=this,{shadow:s}=o,n=this.getItemBaseStyle(i);e.each((a,r)=>{const{datumIndex:l,datum:c,x:h,y:p,top:u,right:g,bottom:y,left:f}=r,m=this.getItemStyleOverrides(String(l),c,l,n,i);a.x0=h-u/2,a.x1=h+u/2,a.x2=h+y/2,a.x3=h-y/2,a.y0=p-f/2,a.y1=p-g/2,a.y2=p+g/2,a.y3=p+f/2,az(a,n,m),a.fillShadow=s})}updateLabelSelection(t){return t.labelSelection.update(this.properties.label.enabled?t.labelData:[])}updateStageLabelSelection(t){return t.stageLabelSelection.update(t.stageLabelData)}updateLabelNodes(t){const{labelSelection:e,labelProperties:i}=t,{color:o,fontSize:s,fontStyle:n,fontWeight:a,fontFamily:r}=i;e.each((l,{visible:c,x:h,y:p,text:u,textAlign:g,textBaseline:y})=>{l.visible=c,l.x=h,l.y=p,l.text=u,l.fill=o,l.fontStyle=n,l.fontWeight=a,l.fontSize=s,l.fontFamily=r,l.textAlign=g,l.textBaseline=y})}resetAnimation(t){}computeFocusBounds(t){const e=this.getNodeData()?.[t.datumIndex];if(e!==void 0){for(const i of this.datumSelection)if(i.datum===e)return i.node}}getTooltipContent(t){const{id:e,dataModel:i,processedData:o,properties:s}=this,{stageKey:n,valueKey:a,tooltip:r}=s;if(!i||!o)return;const{datumIndex:l}=t,c=o.dataSources.get(this.id)?.[l],h=i.resolveColumnById(this,"xValue",o)[l],p=i.resolveColumnById(this,"yValue",o)[l];if(h==null)return;const u=this.getLabelText(this.properties.stageLabel,{datum:o.dataSources.get(this.id)?.[l],value:p,stageKey:n,valueKey:a}),g=this.getItemBaseStyle(!1);return Object.assign(g,this.getItemStyleOverrides(String(l),l,l,g,!1)),r.formatTooltip({symbol:this.legendItemSymbol(l),data:[{label:String(h),value:u}]},{seriesId:e,datum:c,title:void 0,stageKey:n,valueKey:a,...g})}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(t,e){return[NaN,NaN]}pickNodeClosestDatum({x:t,y:e}){let i=1/0,o;return this.datumSelection.each((s,n)=>{const a=s.distanceSquared(t,e);a{const u=l[p];r.push({legendType:"category",id:o,itemId:p,seriesId:o,enabled:n&&s.getItemEnabled({seriesId:o,itemId:p}),label:{text:u},symbol:this.legendItemSymbol(p),hideInLegend:!a})}),r}};lu.className="PyramidSeries",lu.type="pyramid";import{_ModuleSupport as rz}from"ag-charts-community";var{ThemeSymbols:{DEFAULT_SHADOW_COLOUR:lz}}=rz,cz={series:{direction:"vertical",strokeWidth:0,spacing:2,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}},stageLabel:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:12},shadow:{enabled:!1,color:lz,xOffset:3,yOffset:3,blur:5}}},hz={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],identifier:"pyramid",moduleFactory:t=>new lu(t),solo:!0,tooltipDefaults:{range:"exact"},themeTemplate:cz,paletteFactory:({takeColors:t,colorsCount:e})=>{const{fills:i,strokes:o}=t(e);return{fills:i,strokes:o}}};import{_ModuleSupport as dz}from"ag-charts-community";import{_ModuleSupport as cu}from"ag-charts-community";var{ThemeConstants:{POLAR_AXIS_TYPE:pz}}=cu,ev={series:{label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},marker:{enabled:!0,fillOpacity:1,shape:"circle",size:6,strokeOpacity:1,strokeWidth:0}},axes:{[pz.ANGLE_CATEGORY]:{label:{spacing:10}}}},uz=cu.mergeDefaults({series:{strokeWidth:2}},ev),gz=cu.mergeDefaults({series:{fillOpacity:.8,strokeWidth:2,marker:{enabled:!1}}},ev);import{_ModuleSupport as iv}from"ag-charts-community";import{_ModuleSupport as Gn}from"ag-charts-community";import{_ModuleSupport as yz}from"ag-charts-community";var{Label:fz,SeriesMarker:mz,SeriesProperties:xz,SeriesTooltip:Sz,Validate:Ee,BOOLEAN:bz,COLOR_STRING:vz,NUMBER:Mz,LINE_DASH:kz,OBJECT:hu,POSITIVE_NUMBER:ov,RATIO:Az,STRING:gc}=yz,me=class extends xz{constructor(){super(...arguments),this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.rotation=0,this.marker=new mz,this.label=new fz,this.tooltip=new Sz,this.connectMissingData=!1}};d([Ee(gc)],me.prototype,"angleKey",2),d([Ee(gc)],me.prototype,"radiusKey",2),d([Ee(gc,{optional:!0})],me.prototype,"angleName",2),d([Ee(gc,{optional:!0})],me.prototype,"radiusName",2),d([Ee(vz)],me.prototype,"stroke",2),d([Ee(ov)],me.prototype,"strokeWidth",2),d([Ee(Az)],me.prototype,"strokeOpacity",2),d([Ee(kz)],me.prototype,"lineDash",2),d([Ee(ov)],me.prototype,"lineDashOffset",2),d([Ee(Mz)],me.prototype,"rotation",2),d([Ee(hu)],me.prototype,"marker",2),d([Ee(hu)],me.prototype,"label",2),d([Ee(hu)],me.prototype,"tooltip",2),d([Ee(bz)],me.prototype,"connectMissingData",2);var{ChartAxisDirection:Si,PolarAxis:Iz,SeriesNodePickMode:sv,valueProperty:nv,fixNumericExtent:Dz,seriesLabelFadeInAnimation:Tz,markerFadeInAnimation:Cz,resetMarkerFn:Nz,animationValidation:Oz,computeMarkerFocusBounds:Lz,extent:Rz,isNumberEqual:av,createDatumId:Ez,BBox:wz,Group:Pz,Path:_z,PointerEvents:Bz,Selection:rv,Text:zz,Marker:Vz,applyShapeStyle:Fz}=Gn,Gz=class extends Gn.SeriesNodeEvent{constructor(t,e,i,o){super(t,e,i,o),this.angleKey=o.properties.angleKey,this.radiusKey=o.properties.radiusKey}},du=class extends Gn.PolarSeries{constructor(t){super({moduleCtx:t,useLabelLayer:!0,pickModes:[sv.NEAREST_NODE,sv.EXACT_SHAPE_MATCH],canHaveAxes:!0,animationResetFns:{item:Nz}}),this.clipFocusBox=!1,this.properties=new me,this.NodeEvent=Gz,this.lineGroup=this.contentGroup.appendChild(new Pz({name:"radar-line",zIndex:Gn.SeriesZIndexMap.ANY_CONTENT})),this.lineSelection=rv.select(this.lineGroup,_z),this.resetInvalidToZero=!1,this.circleCache={r:0,cx:0,cy:0}}nodeFactory(){return new Vz}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.lineGroup.zIndex=[Gn.SeriesZIndexMap.ANY_CONTENT,t,Gn.SeriesContentZIndexMap.FOREGROUND,1],!0):!1}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];if(t===Si.X)return e.getDomain(this,"angleValue","value",i);{const o=e.getDomain(this,"radiusValue","value",i),s=Rz(o.length===0?o:[0].concat(o));return Dz(s)}}async processData(t){if(!this.properties.isValid())return;const{angleKey:e,radiusKey:i}=this.properties,o=[];this.ctx.animationManager.isSkipped()||o.push(Oz());const s=this.axes[Si.Y]?.scale.type,n=this.axes[Si.X]?.scale.type;await this.requestDataModel(t,this.data,{props:[nv(e,n,{id:"angleValue"}),nv(i,s,{id:"radiusValue",invalidValue:void 0}),...o]}),this.animationState.transition("updateData")}didCircleChange(){const t=this.radius,e=this.centerX,i=this.centerY,o=this.circleCache;return t===o.r&&e===o.cx&&i===o.cy?!1:(this.circleCache={r:t,cx:e,cy:i},!0)}getAxisInnerRadius(){const t=this.axes[Si.Y];return t instanceof Iz?this.radius*t.innerRadiusRatio:0}maybeRefreshNodeData(){if(!this.didCircleChange()&&!this.nodeDataRefresh)return;const{nodeData:e=[]}=this.createNodeData()??{};this.nodeData=e,this.nodeDataRefresh=!1}createNodeData(){const{processedData:t,dataModel:e}=this;if(!t||!e||!this.properties.isValid())return;const{angleKey:i,radiusKey:o,angleName:s,radiusName:n,marker:a,label:r}=this.properties,l=this.axes[Si.X]?.scale,c=this.axes[Si.Y]?.scale;if(!l||!c)return;const h=e.resolveColumnById(this,"angleValue",t),p=e.resolveColumnById(this,"radiusValue",t),u=this.getAxisInnerRadius(),y=(t.dataSources.get(this.id)??[]).map((f,m)=>{const x=h[m],v=p[m],S=l.convert(x),b=this.radius+u-c.convert(v),k=Math.cos(S),I=Math.sin(S),M=k*b,A=I*b;let T;if(r.enabled){const N=this.getLabelText(r,{value:v,datum:f,angleKey:i,radiusKey:o,angleName:s,radiusName:n});if(N){let L="right";av(k,0)?L="center":k>0&&(L="left");let D="bottom";av(I,0)?D="middle":I>0&&(D="top"),T={x:M+k*a.size,y:A+I*a.size,text:N,textAlign:L,textBaseline:D}}}return{series:this,datum:f,datumIndex:m,index:m,point:{x:M,y:A,size:a.size},midPoint:{x:M,y:A},label:T,angleValue:x,radiusValue:v,missing:!vo(S)||!vo(b)}});return{itemId:o,nodeData:y,labelData:y}}update({seriesRect:t}){const e=this.checkResize(t),i=!this.ctx.animationManager.isSkipped(),{series:o}=this.ctx.highlightManager?.getActiveHighlight()??{};this.highlightGroup.visible=(i||this.visible)&&o===this,this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updatePathSelections(),this.updateMarkerSelection(),this.updateMarkers(this.itemSelection,!1),this.updateMarkers(this.highlightSelection,!0),this.updateLabels(),e&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePathSelections(){const t=this.visible?[!0]:[];this.lineSelection.update(t)}updateMarkerSelection(){this.properties.marker.isDirty()&&(this.itemSelection.clear(),this.itemSelection.cleanup(),this.itemSelection=rv.select(this.itemGroup,()=>this.nodeFactory(),!1)),this.itemSelection.update(this.properties.marker.enabled?this.nodeData:[])}getMarkerFill(t){return t?.fill??this.properties.marker.fill}getMarkerItemBaseStyle(t){const{properties:e}=this,{marker:i}=e,o=t?e.highlightStyle.item:void 0;return{shape:i.shape,size:i.size,fill:o?.fill??i.fill,fillOpacity:o?.fillOpacity??i.fillOpacity,stroke:o?.stroke??i.stroke,strokeWidth:o?.strokeWidth??this.getStrokeWidth(i.strokeWidth),strokeOpacity:o?.strokeOpacity??i.strokeOpacity,lineDash:o?.lineDash??i.lineDash,lineDashOffset:o?.lineDashOffset??i.lineDashOffset}}getMarkerItemStyleOverrides(t,e,i,o){const{id:s,properties:n}=this,{angleKey:a,radiusKey:r,marker:l}=n,{itemStyler:c}=l;if(c!=null)return this.cachedDatumCallback(Ez(t,o?"highlight":"node"),()=>c({seriesId:s,datum:e,angleKey:a,radiusKey:r,highlighted:o,...i}))}updateMarkers(t,e){const{visible:i}=this,{marker:o}=this.properties;let s=[];if(i&&o.shape&&o.enabled)if(e){const a=this.ctx.highlightManager?.getActiveHighlight();a?.datum&&(s=[a])}else s=this.nodeData;const n=this.getMarkerItemBaseStyle(e);t.update(s).each((a,r)=>{const{datum:l,datumIndex:c,point:h}=r,p=this.getMarkerItemStyleOverrides(String(c),l,n,e);Fz(a,n,p),a.shape=p?.shape??n.shape,a.size=p?.size??n.size;const{x:u,y:g}=h;a.x=u,a.y=g,a.visible=i&&a.size>0&&!isNaN(u)&&!isNaN(g)})}updateLabels(){const{label:t}=this.properties;this.labelSelection.update(this.nodeData).each((e,i)=>{t.enabled&&i.label?(e.x=i.label.x,e.y=i.label.y,e.fill=t.color,e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.text=i.label.text,e.textAlign=i.label.textAlign,e.textBaseline=i.label.textBaseline,e.visible=!0):e.visible=!1})}getTooltipContent(t){const{id:e,dataModel:i,processedData:o,axes:s,properties:n}=this,{angleKey:a,angleName:r,radiusKey:l,radiusName:c,tooltip:h}=n,p=s[Si.X],u=s[Si.Y];if(!i||!o||!p||!u)return;const{datumIndex:g}=t,y=o.dataSources.get(this.id)?.[g],f=i.resolveColumnById(this,"angleValue",o)[g],m=i.resolveColumnById(this,"radiusValue",o)[g];if(f==null)return;const x=this.getMarkerItemBaseStyle(!1);return Object.assign(x,this.getMarkerItemStyleOverrides(String(g),g,x,!1)),h.formatTooltip({heading:p.formatDatum(f),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:u.formatDatum(m)}]},{seriesId:e,datum:y,title:r,angleKey:a,radiusKey:l,angleName:r,radiusName:c,...x})}legendItemSymbol(){const{stroke:t,strokeWidth:e,strokeOpacity:i,lineDash:o,marker:s}=this.properties;return{marker:{shape:s.shape,fill:this.getMarkerFill()??s.stroke??t??"rgba(0, 0, 0, 0)",stroke:s.stroke??t??"rgba(0, 0, 0, 0)",fillOpacity:s.fillOpacity,strokeOpacity:s.strokeOpacity,strokeWidth:s.strokeWidth,lineDash:s.lineDash,lineDashOffset:s.lineDashOffset,enabled:s.enabled||e<=0},line:{stroke:t,strokeOpacity:i,strokeWidth:e,lineDash:o}}}getLegendData(t){if(!this.properties.isValid()||t!=="category")return[];const{id:e,ctx:{legendManager:i},visible:o}=this,{radiusKey:s,radiusName:n,showInLegend:a}=this.properties;return[{legendType:"category",id:e,itemId:s,seriesId:e,enabled:o&&i.getItemEnabled({seriesId:e,itemId:s}),label:{text:n??s},symbol:this.legendItemSymbol(),hideInLegend:!a}]}pickNodeClosestDatum(t){const{nodeData:e,centerX:i,centerY:o}=this,{x:s,y:n}=t,a=this.radius;if(Math.sqrt((s-i)**2+(n-o)**2)>a+this.properties.marker.size)return;let l=1/0,c;for(const h of e){const{point:{x:p=NaN,y:u=NaN}={}}=h;if(isNaN(p)||isNaN(u))continue;const g=Math.sqrt((t.x-p-i)**2+(t.y-u-o)**2);g{if(!t.enabled||!o.label)return;i.text=o.label.text,i.x=o.label.x,i.y=o.label.y,i.setFont(t),i.setAlign(o.label);const s=i.getBBox();e.push(s)}),e.length===0?null:wz.merge(e)}getLineNode(){return this.lineSelection?.at(0)}beforePathAnimation(){const t=this.getLineNode();t&&(t.fill=void 0,t.lineJoin="round",t.lineCap="round",t.pointerEvents=Bz.None,t.stroke=this.properties.stroke,t.strokeWidth=this.getStrokeWidth(this.properties.strokeWidth),t.strokeOpacity=this.properties.strokeOpacity,t.lineDash=this.properties.lineDash,t.lineDashOffset=this.properties.lineDashOffset)}getLinePoints(){const{nodeData:t,resetInvalidToZero:e}=this,{connectMissingData:i}=this.properties;if(t.length===0)return[];const o=this.axes[Si.Y],n=this.axes[Si.X]?.isReversed(),r=o?.isReversed()&&!n?[...t].reverse():t,l=[];let c=!1,h;return r.forEach((p,u)=>{let{x:g,y}=p.point;const f=isNaN(g)||isNaN(y);f||(h??(h=p)),f&&!i&&(g=0,y=0);const m=u===0||!e&&!i&&(f||c);l.push({x:g,y,moveTo:m}),c=f}),h!==void 0&&l.push({x:h.point.x,y:h.point.y,moveTo:!1}),l}animateSinglePath(t,e,i){const{path:o}=t;o.clear(!0);const s=this.getAxisInnerRadius(),n=this.axes[Si.Y],r=n?.isReversed()?this.radius+s-n?.scale.convert(0):s;e.forEach(l=>{const{x:c,y:h,arc:p,radius:u=0,startAngle:g=0,endAngle:y=0,moveTo:f}=l,m=Math.atan2(h,c),x=r*Math.cos(m),v=r*Math.sin(m),S=i,b=x*(1-S)+c*S,k=v*(1-S)+h*S;p?o.arc(c,h,u,g,y):f?o.moveTo(b,k):o.lineTo(b,k)}),t.checkPathDirty()}animatePaths(t){const e=this.getLinePoints(),i=this.getLineNode();i&&this.animateSinglePath(i,e,t)}animateEmptyUpdateReady(){const{itemSelection:t,labelSelection:e}=this,{animationManager:i}=this.ctx;this.beforePathAnimation(),i.animate({id:`${this.id}_'path`,groupId:this.id,from:0,to:1,phase:"initial",collapsable:!1,onUpdate:o=>this.animatePaths(o),onStop:()=>this.animatePaths(1)}),Cz(this,i,"added",t),Tz(this,"labels",i,e)}animateWaitingUpdateReady(t){super.animateWaitingUpdateReady(t),this.resetPaths()}animateReadyResize(t){super.animateReadyResize(t),this.resetPaths()}resetPaths(){const t=this.getLineNode();if(t){const{path:e}=t,i=this.getLinePoints();t.fill=void 0,t.stroke=this.properties.stroke,t.strokeWidth=this.getStrokeWidth(this.properties.strokeWidth),t.strokeOpacity=this.properties.strokeOpacity,t.lineDash=this.properties.lineDash,t.lineDashOffset=this.properties.lineDashOffset,e.clear(!0);for(const{x:o,y:s,moveTo:n}of i)n?e.moveTo(o,s):e.lineTo(o,s);t.checkPathDirty()}}getFormattedMarkerStyle(t){const{angleKey:e,radiusKey:i}=this.properties;return this.getMarkerStyle(this.properties.marker,{datum:t,angleKey:e,radiusKey:i,highlighted:!0})}computeFocusBounds(t){return Lz(this,t)}};du.className="RadarSeries";import{_ModuleSupport as Wz}from"ag-charts-community";var{RATIO:Hz,COLOR_STRING:Kz,Validate:lv}=Wz,pu=class extends me{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1}};d([lv(Kz)],pu.prototype,"fill",2),d([lv(Hz)],pu.prototype,"fillOpacity",2);var{Group:Uz,Path:Yz,PointerEvents:jz,Selection:Xz,ChartAxisDirection:cv}=iv,uu=class extends du{constructor(t){super(t),this.properties=new pu,this.resetInvalidToZero=!0;const e=new Uz;this.contentGroup.append(e),this.areaSelection=Xz.select(e,Yz)}updatePathSelections(){const t=this.visible?[!0]:[];this.areaSelection.update(t),super.updatePathSelections()}getAreaNode(){return this.areaSelection.at(0)}getMarkerFill(t){return t?.fill??this.properties.marker.fill??this.properties.fill}beforePathAnimation(){super.beforePathAnimation();const t=this.getAreaNode();t.fill=this.properties.fill,t.fillOpacity=this.properties.fillOpacity,t.pointerEvents=jz.None,t.stroke=void 0}animatePaths(t){super.animatePaths(t),this.animateSinglePath(this.getAreaNode(),this.getAreaPoints(),t)}getAreaPoints(){const t=this.getLinePoints(),e=a=>{const r=this.axes[a];return r instanceof iv.PolarAxis?r:void 0},i=e(cv.Y),o=e(cv.X);if(!i?.isReversed())return t;const n=o?.getAxisLinePoints()?.points??[];return t.concat(...n)}resetPaths(){super.resetPaths();const t=this.getAreaNode();if(t){const{path:e}=t,i=this.getAreaPoints();t.fill=this.properties.fill,t.fillOpacity=this.properties.fillOpacity,t.stroke=void 0,t.lineDash=this.properties.lineDash,t.lineDashOffset=this.properties.lineDashOffset,t.lineJoin=t.lineCap="round",e.clear(!0),i.forEach(({x:o,y:s,moveTo:n,arc:a,radius:r=0,startAngle:l=0,endAngle:c=0})=>{a?e.arc(o,s,r,l,c):n?e.moveTo(o,s):e.lineTo(o,s)}),e.closePath(),t.checkPathDirty()}}};uu.className="RadarAreaSeries",uu.type="radar-area";var{markerPaletteFactory:$z,ThemeConstants:{POLAR_AXIS_TYPE:hv}}=dz,Zz={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radar-area",moduleFactory:t=>new uu(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:hv.ANGLE_CATEGORY},{type:hv.RADIUS_NUMBER}],themeTemplate:gz,paletteFactory:t=>{const{marker:e}=$z(t);return{stroke:e.stroke,fill:e.fill,marker:e}}};import{_ModuleSupport as Qz}from"ag-charts-community";var gu=class extends du{updatePathSelections(){this.lineSelection.update(this.visible?[!0]:[])}};gu.className="RadarLineSeries",gu.type="radar-line";var{POLAR_AXIS_TYPE:dv}=Qz.ThemeConstants,qz={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radar-line",moduleFactory:t=>new gu(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:dv.ANGLE_CATEGORY},{type:dv.RADIUS_NUMBER}],themeTemplate:uz,paletteFactory:({takeColors:t})=>{const{fills:[e],strokes:[i]}=t(1);return{stroke:e,marker:{fill:e,stroke:i}}}};import{_ModuleSupport as Jz}from"ag-charts-community";import{_ModuleSupport as yu}from"ag-charts-community";import{_ModuleSupport as tV}from"ag-charts-community";var{SeriesProperties:eV,SeriesTooltip:iV,Validate:te,COLOR_STRING:pv,NUMBER:uv,FUNCTION:oV,LINE_DASH:sV,OBJECT:gv,POSITIVE_NUMBER:fu,RATIO:yv,STRING:tr,Label:nV}=tV,$t=class extends eV{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.label=new nV,this.tooltip=new iV}};d([te(tr)],$t.prototype,"angleKey",2),d([te(tr)],$t.prototype,"radiusKey",2),d([te(tr,{optional:!0})],$t.prototype,"angleName",2),d([te(tr,{optional:!0})],$t.prototype,"radiusName",2),d([te(pv)],$t.prototype,"fill",2),d([te(yv)],$t.prototype,"fillOpacity",2),d([te(pv)],$t.prototype,"stroke",2),d([te(fu)],$t.prototype,"strokeWidth",2),d([te(yv)],$t.prototype,"strokeOpacity",2),d([te(sV)],$t.prototype,"lineDash",2),d([te(fu)],$t.prototype,"lineDashOffset",2),d([te(fu)],$t.prototype,"cornerRadius",2),d([te(oV,{optional:!0})],$t.prototype,"itemStyler",2),d([te(uv)],$t.prototype,"rotation",2),d([te(tr,{optional:!0})],$t.prototype,"stackGroup",2),d([te(uv,{optional:!0})],$t.prototype,"normalizedTo",2),d([te(gv)],$t.prototype,"label",2),d([te(gv)],$t.prototype,"tooltip",2);import{_ModuleSupport as aV}from"ag-charts-community";var{SectorBox:fv,motion:rV}=aV;function lV(t,e,i){if(i==="updated"){if(t.previousDatum==null||isNaN(t.previousDatum.innerRadius)||isNaN(t.previousDatum.outerRadius))return"added";if(isNaN(e.innerRadius)||isNaN(e.outerRadius))return"removed"}return i==="added"&&t.previousDatum!=null?"updated":i}function mv(t){return{toFn:(o,s,n)=>{let a,r,l,c,h;return n==="removed"?(a=t,r=t,l=s.innerRadius,c=s.outerRadius,h=new fv(a,r,l,c)):(a=s.startAngle,r=s.endAngle,l=isNaN(s.innerRadius)?o.innerRadius:s.innerRadius,c=isNaN(s.outerRadius)?o.outerRadius:s.outerRadius,h=s.clipSector),{startAngle:a,endAngle:r,innerRadius:l,outerRadius:c,clipSector:h}},fromFn:(o,s,n)=>{n=lV(o,s,n);let a,r,l,c,h;n==="removed"||n==="updated"?(a=o.startAngle,r=o.endAngle,l=o.innerRadius,c=o.outerRadius,h=o.clipSector):(a=t,r=t,l=s.innerRadius,c=s.outerRadius),h??(h=new fv(a,r,l,c));const p=rV.NODE_UPDATE_STATE_TO_PHASE_MAPPING[n];return{startAngle:a,endAngle:r,innerRadius:l,outerRadius:c,clipSector:h,phase:p}}}}function cV(t,e){return{centerX:0,centerY:0,innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle,clipSector:e.clipSector}}var{ChartAxisDirection:uo,PolarAxis:hV,diff:dV,groupAccumulativeValueProperty:xv,keyProperty:pV,normaliseGroupTo:uV,valueProperty:gV,fixNumericExtent:yV,resetLabelFn:fV,seriesLabelFadeInAnimation:mV,seriesLabelFadeOutAnimation:xV,animationValidation:SV,angleBetween:bV,createDatumId:Sv,CategoryScale:vV,Sector:MV,SectorBox:kV,motion:bv,applyShapeStyle:AV}=yu,IV=class extends yu.SeriesNodeEvent{constructor(t,e,i,o){super(t,e,i,o),this.angleKey=o.properties.angleKey,this.radiusKey=o.properties.radiusKey}},mu=class extends yu.PolarSeries{constructor(t){super({moduleCtx:t,useLabelLayer:!0,canHaveAxes:!0,animationResetFns:{item:cV,label:fV}}),this.properties=new $t,this.NodeEvent=IV,this.groupScale=new vV,this.circleCache={r:0,cx:0,cy:0}}nodeFactory(){return new MV}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];if(t===uo.X){const o=e.getDomain(this,"angleValue-end","value",i),s=[o[0]>0?0:o[0],o[1]<0?0:o[1]];return yV(s)}else return e.getDomain(this,"radiusValue","key",i)}async processData(t){const{visible:e}=this,{angleKey:i,radiusKey:o,normalizedTo:s}=this.properties,n=!this.ctx.animationManager.isSkipped();if(!this.properties.isValid())return;const a=this.getStackId(),r=`${a}-trailing`,l=[];ee(s)&&l.push(uV([a,r],Math.abs(s))),n&&(this.processedData&&l.push(dV(this.id,this.processedData)),l.push(SV()));const c=e||!n?{}:{forceValue:0},h=this.axes[uo.Y]?.scale.type,p=this.axes[uo.X]?.scale.type;await this.requestDataModel(t,this.data,{props:[pV(o,h,{id:"radiusValue"}),gV(i,p,{id:"angleValue-raw",invalidValue:null,...c}),...xv(i,"normal","current",{id:"angleValue-end",rangeId:"angleValue-range",invalidValue:null,groupId:a,separateNegative:!0,...c},p),...xv(i,"trailing","current",{id:"angleValue-start",invalidValue:null,groupId:r,separateNegative:!0,...c},p),...l],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const t=this.radius,e=this.centerX,i=this.centerY,o=this.circleCache;return t===o.r&&e===o.cx&&i===o.cy?!1:(this.circleCache={r:t,cx:e,cy:i},!0)}maybeRefreshNodeData(){if(!this.didCircleChange()&&!this.nodeDataRefresh)return;const{nodeData:e=[]}=this.createNodeData()??{};this.nodeData=e,this.nodeDataRefresh=!1}getAxisInnerRadius(){const t=this.axes[uo.Y];return t instanceof hV?this.radius*t.innerRadiusRatio:0}createNodeData(){const{processedData:t,dataModel:e}=this;if(!e||!t||t.type!=="grouped"||!this.properties.isValid())return;const i=this.axes[uo.X],o=this.axes[uo.Y],s=i?.scale,n=o?.scale;if(!s||!n)return;const a=e.resolveKeysById(this,"radiusValue",t),r=e.resolveColumnById(this,"angleValue-start",t),l=e.resolveColumnById(this,"angleValue-end",t),c=e.resolveColumnById(this,"angleValue-raw",t),h=e.resolveProcessedDataIndexById(this,"angleValue-range");let p=0;o instanceof is&&(p=o.groupPaddingInner);const{groupScale:u}=this,{index:g,visibleGroupCount:y}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);u.domain=Array.from({length:y}).map((w,P)=>String(P)),u.range=[0,Math.abs(n.bandwidth??0)],u.paddingInner=y>1?p:0;const f=u.bandwidth>=1?u.bandwidth:u.rawBandwidth,m=i.isReversed(),x=o.isReversed(),v=x?this.radius:this.getAxisInnerRadius(),b=(x?this.getAxisInnerRadius():this.radius)+v,{angleKey:k,radiusKey:I,angleName:M,radiusName:A,label:T}=this.properties,N=(w,P,B,z)=>{const _=this.getLabelText(T,{value:P,datum:w,angleKey:k,radiusKey:I,angleName:M,radiusName:A});if(_)return{x:B,y:z,text:_,textAlign:"center",textBaseline:"middle"}},L=[],D={itemId:I,nodeData:L,labelData:L};if(!this.visible)return D;const{dataSources:C}=t,O=C.get(this.id)??[];for(const{datumIndex:w,group:P}of e.forEachGroupDatum(this,t)){const B=O[w],z=a[w];if(z==null)return;const _=c[w],R=r[w],E=l[w],V=_>=0&&!Object.is(_,-0),F=P.aggregation[h][V?1:0],G=V===m;let W=s.convert(R,!0),K=s.convert(E,!0),j=s.convert(0,!0),Z=s.convert(F,!0);G&&([j,Z]=[Z,j],[W,K]=[K,W]);const tt=b-n.convert(z)+u.convert(String(g)),Q=tt+f,U=(tt+Q)/2,q=W+bV(W,K)/2,it=Math.cos(q)*U,X=Math.sin(q)*U,Ot=this.properties.label.enabled?N(B,_,it,X):void 0,It=new kV(W,K,tt,Q);L.push({series:this,datum:B,datumIndex:w,point:{x:it,y:X,size:0},midPoint:{x:it,y:X},label:Ot,angleValue:_,radiusValue:z,innerRadius:tt,outerRadius:Q,startAngle:j,endAngle:Z,clipSector:It,reversed:G,index:w})}return D}update({seriesRect:t}){const e=this.checkResize(t);this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updateSectorSelection(this.itemSelection,!1),this.updateSectorSelection(this.highlightSelection,!0),this.updateLabels(),e&&this.animationState.transition("resize"),this.animationState.transition("update")}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return{fill:i?.fill??e.fill,fillOpacity:i?.fillOpacity??e.fillOpacity,stroke:i?.stroke??e.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity,lineDash:i?.lineDash??e.lineDash,lineDashOffset:i?.lineDashOffset??e.lineDashOffset,cornerRadius:e.cornerRadius}}getItemStyleOverrides(t,e,i,o){const{id:s,properties:n}=this,{angleKey:a,radiusKey:r,itemStyler:l}=n;if(l!=null)return this.cachedDatumCallback(Sv(t,o?"highlight":"node"),()=>l({seriesId:s,datum:e,highlighted:o,angleKey:a,radiusKey:r,...i}))}updateSectorSelection(t,e){let i=[];if(e){const s=this.ctx.highlightManager?.getActiveHighlight();s?.datum&&s.series===this&&i.push(s)}else i=this.nodeData;const o=this.getItemBaseStyle(e);t.update(i,void 0,s=>this.getDatumId(s)).each((s,n)=>{const{datum:a,datumIndex:r}=n,l=this.getItemStyleOverrides(String(r),a,o,e),c=l?.cornerRadius??o.cornerRadius;AV(s,o,l),s.lineJoin="round",s.inset=s.stroke!=null?s.strokeWidth/2:0,s.startInnerCornerRadius=a.reversed?c:0,s.startOuterCornerRadius=a.reversed?c:0,s.endInnerCornerRadius=a.reversed?0:c,s.endOuterCornerRadius=a.reversed?0:c,e&&(s.startAngle=n.startAngle,s.endAngle=n.endAngle,s.clipSector=n.clipSector,s.innerRadius=n.innerRadius,s.outerRadius=n.outerRadius)})}updateLabels(){const{label:t}=this.properties;this.labelSelection.update(this.nodeData).each((e,i)=>{t.enabled&&i.label?(e.x=i.label.x,e.y=i.label.y,e.fill=t.color,e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.text=i.label.text,e.textAlign=i.label.textAlign,e.textBaseline=i.label.textBaseline,e.visible=!0):e.visible=!1})}getBarTransitionFunctions(){const t=this.axes[uo.X]?.scale;let e=0;if(!t)return mv(e);const i=Math.min(t.domain[0],t.domain[1]),o=Math.max(t.domain[0],t.domain[1]);return i<=0&&o>=0&&(e=t.convert(0)),mv(e)}animateEmptyUpdateReady(){const{labelSelection:t}=this,e=this.getBarTransitionFunctions();bv.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],e),mV(this,"labels",this.ctx.animationManager,t)}animateClearingUpdateEmpty(){const{itemSelection:t}=this,{animationManager:e}=this.ctx,i=this.getBarTransitionFunctions();bv.fromToMotion(this.id,"datums",e,[t],i),xV(this,"labels",e,this.labelSelection)}getTooltipContent(t){const{id:e,dataModel:i,processedData:o,axes:s,properties:n}=this,{angleKey:a,angleName:r,radiusKey:l,radiusName:c,tooltip:h}=n,p=s[uo.X],u=s[uo.Y];if(!i||!o||!p||!u)return;const{datumIndex:g}=t,y=o.dataSources.get(this.id)?.[g],f=i.resolveKeysById(this,"radiusValue",o)[g],m=i.resolveColumnById(this,"angleValue-raw",o)[g];if(f==null)return;const x=this.getItemBaseStyle(!1);return Object.assign(x,this.getItemStyleOverrides(String(g),g,x,!1)),h.formatTooltip({heading:u.formatDatum(f),symbol:this.legendItemSymbol(),data:[{label:r,fallbackLabel:a,value:p.formatDatum(m)}]},{seriesId:e,datum:y,title:r,angleKey:a,angleName:r,radiusKey:l,radiusName:c,...x})}pickNodeClosestDatum(t){return this.pickNodeNearestDistantObject(t,this.itemSelection.nodes())}legendItemSymbol(){const{fill:t,stroke:e,fillOpacity:i,strokeOpacity:o,strokeWidth:s,lineDash:n,lineDashOffset:a}=this.properties;return{marker:{fill:t??"rgba(0, 0, 0, 0)",stroke:e??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:o,strokeWidth:s,lineDash:n,lineDashOffset:a}}}getLegendData(t){if(!this.properties.isValid()||t!=="category")return[];const{id:e,visible:i}=this,{angleKey:o,angleName:s,showInLegend:n}=this.properties;return[{legendType:"category",id:e,itemId:o,seriesId:e,enabled:i,label:{text:s??o},symbol:this.legendItemSymbol(),hideInLegend:!n}]}getDatumId(t){return Sv(t.radiusValue)}computeLabelsBBox(){return null}getStackId(){return`radialBar-stack-${this.seriesGrouping?.groupIndex??this.id}-xValues`}};mu.className="RadialBarSeries",mu.type="radial-bar";import{_ModuleSupport as DV}from"ag-charts-community";var{ThemeConstants:{POLAR_AXIS_TYPE:TV}}=DV,CV={series:{strokeWidth:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}}},axes:{[TV.RADIUS_CATEGORY]:{innerRadiusRatio:.2,groupPaddingInner:.2,paddingInner:.2,paddingOuter:.1}}},{POLAR_AXIS_TYPE:vv}=Jz.ThemeConstants,NV={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radial-bar",moduleFactory:t=>new mu(t),tooltipDefaults:{range:"exact"},defaultAxes:[{type:vv.ANGLE_NUMBER},{type:vv.RADIUS_CATEGORY}],themeTemplate:CV,paletteFactory:({takeColors:t})=>{const{fills:[e],strokes:[i]}=t(1);return{fill:e,stroke:i}},stackable:!0,groupable:!0};import{_ModuleSupport as OV}from"ag-charts-community";import{_ModuleSupport as LV}from"ag-charts-community";import{_ModuleSupport as RV}from"ag-charts-community";var{Validate:Mv,RATIO:kv}=RV,xu=class extends Gt{};d([Mv(kv,{optional:!0})],xu.prototype,"columnWidthRatio",2),d([Mv(kv,{optional:!0})],xu.prototype,"maxColumnWidthRatio",2);var{ChartAxisDirection:EV,PolarAxis:wV,RadialColumnShape:PV,getRadialColumnWidth:_V}=LV,Su=class extends wb{constructor(t){super(t,{animationResetFns:{item:EB}}),this.properties=new xu}getStackId(){return`radarColumn-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new PV}getColumnTransitionFunctions(){const t=this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius();return RB(t)}isRadiusAxisCircle(){const t=this.axes[EV.Y];return t instanceof wV?t.shape==="circle":!1}updateItemPath(t,e,i){t.isBeveled=this.isRadiusAxisCircle(),t.isRadiusAxisReversed=this.isRadiusAxisReversed(),i&&(t.innerRadius=e.innerRadius,t.outerRadius=e.outerRadius,t.startAngle=e.startAngle,t.endAngle=e.endAngle,t.columnWidth=e.columnWidth,t.axisInnerRadius=e.axisInnerRadius,t.axisOuterRadius=e.axisOuterRadius)}getColumnWidth(t,e){const{columnWidthRatio:i=.5,maxColumnWidthRatio:o=.5}=this.properties;return _V(t,e,this.radius,i,o)}};Su.className="RadialColumnSeries",Su.type="radial-column";import{_ModuleSupport as BV}from"ag-charts-community";var{ThemeConstants:{POLAR_AXIS_TYPE:Av,POLAR_AXIS_SHAPE:Iv}}=BV,zV={series:{columnWidthRatio:.5,maxColumnWidthRatio:.5,strokeWidth:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}},axes:{[Av.ANGLE_CATEGORY]:{shape:Iv.CIRCLE,groupPaddingInner:0,paddingInner:0,label:{spacing:10}},[Av.RADIUS_NUMBER]:{shape:Iv.CIRCLE,innerRadiusRatio:.5}}},{POLAR_AXIS_TYPE:Dv}=OV.ThemeConstants,VV={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radial-column",moduleFactory:t=>new Su(t),tooltipDefaults:{range:"exact"},defaultAxes:[{type:Dv.ANGLE_CATEGORY},{type:Dv.RADIUS_NUMBER}],themeTemplate:zV,paletteFactory:({takeColors:t})=>{const{fills:[e],strokes:[i]}=t(1);return{fill:e,stroke:i}},stackable:!0,groupable:!0};import{_ModuleSupport as FV}from"ag-charts-community";import{_ModuleSupport as Wn}from"ag-charts-community";import{_ModuleSupport as GV}from"ag-charts-community";var{SvgPath:WV,Rotatable:HV,Translatable:KV,Scalable:UV}=GV,bu=class extends HV(UV(KV(WV))){constructor(){super(...arguments),this.scalingCenterX=.5,this.scalingCenterY=.5,this.rotationCenterX=.5,this.rotationCenterY=.5}};bu.defaultPathData="M0.50245 0.53745C0.481767 0.53745 0.465 0.520683 0.465 0.5C0.465 0.479317 0.481767 0.46255 0.50245 0.46255L1 0.500012L0.50245 0.53745Z";import{_ModuleSupport as vu}from"ag-charts-community";var{BaseProperties:yc,SeriesTooltip:YV,SeriesProperties:jV,PropertiesArray:Mu,Validate:H,BOOLEAN:Tv,COLOR_STRING:go,COLOR_STRING_ARRAY:XV,FUNCTION:$V,LINE_DASH:fc,NUMBER:Bs,OBJECT_ARRAY:ku,OBJECT:yo,POSITIVE_NUMBER:ii,RATIO:bi,STRING:Au,UNION:ZV,Label:QV}=vu,qV=ZV(["inside","outside","middle"],"a placement"),Cv=class extends QV{};d([H(Bs,{optional:!0})],Cv.prototype,"spacing",2);var ce=class extends yc{constructor(){super(...arguments),this.label=new Cv}};d([H(Au,{optional:!0})],ce.prototype,"text",2),d([H(Bs,{optional:!0})],ce.prototype,"value",2),d([H(ES,{optional:!0})],ce.prototype,"shape",2),d([H(qV,{optional:!0})],ce.prototype,"placement",2),d([H(Bs,{optional:!0})],ce.prototype,"spacing",2),d([H(ii,{optional:!0})],ce.prototype,"size",2),d([H(Bs,{optional:!0})],ce.prototype,"rotation",2),d([H(go,{optional:!0})],ce.prototype,"fill",2),d([H(bi,{optional:!0})],ce.prototype,"fillOpacity",2),d([H(go,{optional:!0})],ce.prototype,"stroke",2),d([H(ii,{optional:!0})],ce.prototype,"strokeWidth",2),d([H(bi,{optional:!0})],ce.prototype,"strokeOpacity",2),d([H(fc,{optional:!0})],ce.prototype,"lineDash",2),d([H(ii,{optional:!0})],ce.prototype,"lineDashOffset",2),d([H(yo)],ce.prototype,"label",2);var vi=class extends yc{constructor(){super(...arguments),this.enabled=!0,this.fills=new Mu(vu.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};d([H(Tv)],vi.prototype,"enabled",2),d([H(ku)],vi.prototype,"fills",2),d([H(Yl)],vi.prototype,"fillMode",2),d([H(go,{optional:!0})],vi.prototype,"fill",2),d([H(bi)],vi.prototype,"fillOpacity",2),d([H(go,{optional:!0})],vi.prototype,"stroke",2),d([H(ii,{optional:!0})],vi.prototype,"strokeWidth",2),d([H(bi)],vi.prototype,"strokeOpacity",2),d([H(fc)],vi.prototype,"lineDash",2),d([H(ii)],vi.prototype,"lineDashOffset",2);var Mi=class extends yc{constructor(){super(...arguments),this.fills=new Mu(vu.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.defaultFill="black"}};d([H(ku)],Mi.prototype,"fills",2),d([H(Yl)],Mi.prototype,"fillMode",2),d([H(go,{optional:!0})],Mi.prototype,"fill",2),d([H(bi)],Mi.prototype,"fillOpacity",2),d([H(go)],Mi.prototype,"stroke",2),d([H(ii)],Mi.prototype,"strokeWidth",2),d([H(bi)],Mi.prototype,"strokeOpacity",2),d([H(fc)],Mi.prototype,"lineDash",2),d([H(ii)],Mi.prototype,"lineDashOffset",2),d([H(go)],Mi.prototype,"defaultFill",2);var ki=class extends yc{constructor(){super(...arguments),this.enabled=!0,this.spacing=0,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};d([H(Tv)],ki.prototype,"enabled",2),d([H(bi,{optional:!0})],ki.prototype,"radiusRatio",2),d([H(Bs)],ki.prototype,"spacing",2),d([H(go)],ki.prototype,"fill",2),d([H(bi)],ki.prototype,"fillOpacity",2),d([H(go)],ki.prototype,"stroke",2),d([H(ii)],ki.prototype,"strokeWidth",2),d([H(bi)],ki.prototype,"strokeOpacity",2),d([H(fc)],ki.prototype,"lineDash",2),d([H(ii)],ki.prototype,"lineDashOffset",2);var Nv=class extends Fi{};d([H(Au,{optional:!0})],Nv.prototype,"text",2);var Ov=class extends Ua{};d([H(Au,{optional:!0})],Ov.prototype,"text",2);var Ht=class extends jV{constructor(){super(...arguments),this.segmentation=new ja,this.defaultColorRange=[],this.targets=new Mu(ce),this.defaultTarget=new ce,this.outerRadiusRatio=1,this.innerRadiusRatio=1,this.cornerRadius=0,this.cornerMode="container",this.spacing=0,this.scale=new Mi,this.bar=new vi,this.needle=new ki,this.label=new Nv,this.secondaryLabel=new Ov,this.tooltip=new YV}isValid(t){if(!super.isValid(t))return!1;const{outerRadius:e,innerRadius:i}=this;return e==null!=(i==null)?(lt.warnOnce("Either [innerRadius] and [outerRadius] must both be set, or neither can be set."),!1):!0}};d([H(Bs)],Ht.prototype,"value",2),d([H(yo)],Ht.prototype,"segmentation",2),d([H(XV)],Ht.prototype,"defaultColorRange",2),d([H(ku)],Ht.prototype,"targets",2),d([H(yo)],Ht.prototype,"defaultTarget",2),d([H(bi)],Ht.prototype,"outerRadiusRatio",2),d([H(bi)],Ht.prototype,"innerRadiusRatio",2),d([H(ii,{optional:!0})],Ht.prototype,"outerRadius",2),d([H(ii,{optional:!0})],Ht.prototype,"innerRadius",2),d([H(ii)],Ht.prototype,"cornerRadius",2),d([H(wS)],Ht.prototype,"cornerMode",2),d([H(Bs)],Ht.prototype,"spacing",2),d([H(yo)],Ht.prototype,"scale",2),d([H(yo)],Ht.prototype,"bar",2),d([H(yo)],Ht.prototype,"needle",2),d([H($V,{optional:!0})],Ht.prototype,"itemStyler",2),d([H(yo)],Ht.prototype,"label",2),d([H(yo)],Ht.prototype,"secondaryLabel",2),d([H(yo)],Ht.prototype,"tooltip",2);import{_ModuleSupport as JV}from"ag-charts-community";var{SectorBox:Iu}=JV;function tF(t){const{startAngle:e,endAngle:i,clipStartAngle:o,clipEndAngle:s,innerRadius:n,outerRadius:a}=t;if(!(o==null||s==null))return new Iu(Math.max(o,e),Math.min(s,i),n,a)}function Lv(t,e,i){return Math.max(t,i.startAngle)<=Math.min(e,i.endAngle)}function Du(t){return t.clipStartAngle!=null&&t.clipEndAngle!=null}function Tu(t,e){const{clipStartAngle:i,clipEndAngle:o,innerRadius:s,outerRadius:n}=t;return new Iu(i,e?i:o,s,n)}function Rv(t,e){const i=t?"initial":"update";return{node:{fromFn(n,a){const r=n.previousDatum;let{startAngle:l,endAngle:c}=r??a;const h=r!=null&&Du(r)?Tu(r,t):void 0,p=Du(a)?Tu(a,t):void 0;let u;return h!=null&&p!=null?u=h:h==null&&p!=null?(u=p,l=a.startAngle,c=a.endAngle):h!=null&&p==null?(u=void 0,l=a.startAngle,c=a.endAngle):t&&(c=l),{startAngle:l,endAngle:c,clipSector:u,phase:i}},toFn(n,a){const{startAngle:r,endAngle:l}=a;let c;return Du(a)&&(c=Tu(a,!1)),{startAngle:r,endAngle:l,clipSector:c}},applyFn(n,a){const{startAngle:r,endAngle:l}=a;let{clipSector:c}=a;c!=null&&(c=new Iu(Math.max(r,c.startAngle),Math.min(l,c.endAngle),c.innerRadius,c.outerRadius));const h=c==null||Lv(r,l,c);n.startAngle=r,n.endAngle=l,n.clipSector=c,n.visible=h}},needle:{fromFn(n){let{angle:a}=n.previousDatum??n.datum;return t&&(a=e),{rotation:a,phase:i}},toFn(n,a){const{angle:r}=a;return{rotation:r}}}}}function Cu(t,e){const{startAngle:i,endAngle:o}=e,s=tF(e),n=s==null||Lv(i,o,s);return{startAngle:i,endAngle:o,clipSector:s,visible:n}}function Ev(t,e){const{angle:i}=e;return{rotation:i}}var eF={top:0,middle:.5,bottom:1};function iF(t,e,i,o,s){const{padding:n,textAlign:a,verticalAlign:r}=i;let l,c;if(e.each((b,k)=>{k.label==="primary"?l=k:k.label==="secondary"&&(c=k)}),l==null)return;const h=Ya(t,l,s?.label);if(h==null)return;const p=c!=null?Ya(t,c,s?.secondaryLabel):void 0,u={padding:n},g=a==="center"?2:1,y=r==="middle"?2:1,f=b=>({width:Math.sqrt(Math.max(o**2-(b/y)**2,0))*g,height:Math.min(b,y*o),meta:null});let m,x,v;if(c!=null&&p!=null){const b=pS(h,l,p,c,u,f);m=b?.label,x=b?.secondaryLabel,v=b?.height??0}else{const b=Ha(h,l,u,f);m=b?.[0],x=void 0,v=b?.[0].height??0}const S=v*eF[r];e.each((b,k)=>{let I;if(k.label==="primary"?I=m:k.label==="secondary"&&(I=x),I==null){b.visible=!1;return}b.visible=!0,b.text=I.text,b.fontSize=I.fontSize,b.lineHeight=I.lineHeight,b.textAlign=a,b.textBaseline="middle";const M=k.label==="primary"?I.height/2:v-I.height/2;b.y=k.centerY+M-S,b.x=k.centerX})}var{fromToMotion:er,resetMotion:wv,SeriesNodePickMode:Pv,StateMachine:oF,createDatumId:Nu,ChartAxisDirection:$o,normalizeAngle360:_v,normalizeAngle360Inclusive:Bv,toDegrees:sF,toRadians:nF,BBox:aF,Group:zs,PointerEvents:rF,Selection:Vs,Sector:lF,SectorBox:cF,Text:zv,ConicGradient:hF,Marker:dF,getColorStops:pF}=Wn,uF={inside:90,middle:0,outside:-90},gF=[{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"},{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"}],yF=[{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"},{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"}],Ou=class extends Wn.Series{constructor(t){super({moduleCtx:t,useLabelLayer:!0,pickModes:[Pv.EXACT_SHAPE_MATCH,Pv.NEAREST_NODE]}),this.canHaveAxes=!0,this.properties=new Ht,this.centerX=0,this.centerY=0,this.radius=0,this.textAlign="center",this.verticalAlign="middle",this.scaleGroup=this.contentGroup.appendChild(new zs({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new zs({name:"itemGroup"})),this.itemNeedleGroup=this.contentGroup.appendChild(new zs({name:"itemNeedleGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new zs({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new zs({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new zs({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new zs({name:"itemTargetLabelGroup"})),this.scaleSelection=Vs.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=Vs.select(this.itemGroup,()=>this.nodeFactory()),this.needleSelection=Vs.select(this.itemNeedleGroup,bu),this.targetSelection=Vs.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=Vs.select(this.itemTargetLabelGroup,zv),this.labelSelection=Vs.select(this.itemLabelGroup,zv),this.highlightTargetSelection=Vs.select(this.highlightTargetGroup,()=>this.markerFactory()),this.datumUnion=new DS,this.animationState=new oF("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.animateReadyResize(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateWaitingUpdateReady()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty"},reset:"empty",skip:"ready"}}),this.scaleGroup.pointerEvents=rF.None}get maximumRadius(){return this.properties.outerRadius}get minimumRadius(){return this.properties.outerRadius}get hasData(){return this.properties.value!=null}nodeFactory(){return new lF}markerFactory(){const t=new dF;return t.size=1,t}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(t){return CS(t,this.axes[$o.X])}createConicGradient(t,e){const{centerX:i,centerY:o,radius:s}=this,{domain:n,range:a}=this.axes[$o.X].scale,[r,l]=a,{defaultColorRange:c}=this.properties,h=_v((r+l)/2+Math.PI),p=Bv(l-r),u=pF(t,c,n,e).map(({color:g,offset:y})=>(y=Math.min(Math.max(y,0),1),y=(r+p*y-h)/(2*Math.PI),y=(y%1+1)%1,{offset:y,color:g}));return new hF("oklch",u,sF(h)-90,new aF(i-s,o-s,2*s,2*s))}getTargets(){const{properties:t}=this,e=t.defaultTarget;return Array.from(t.targets).map(i=>{const{text:o=e.text,value:s=e.value??0,shape:n=e.shape??"triangle",rotation:a=e.rotation??0,strokeWidth:r=e.strokeWidth??0,placement:l=e.placement??"middle",spacing:c=e.spacing??0,size:h=e.size??0,fill:p=e.fill??"black",fillOpacity:u=e.fillOpacity??1,stroke:g=e.stroke??"black",strokeOpacity:y=e.strokeOpacity??1,lineDash:f=e.lineDash??[0],lineDashOffset:m=e.lineDashOffset??0}=i,{enabled:x=e.label.enabled,color:v=e.label.color??"black",fontStyle:S=e.label.fontStyle??"normal",fontWeight:b=e.label.fontWeight??"normal",fontSize:k=e.label.fontSize,fontFamily:I=e.label.fontFamily,spacing:M=e.label.spacing??0}=i.label;return{text:o,value:s,shape:n,placement:l,spacing:c,size:h,rotation:a,fill:p,fillOpacity:u,stroke:g,strokeWidth:r,strokeOpacity:y,lineDash:f,lineDashOffset:m,label:{enabled:x,color:v,fontStyle:S,fontWeight:b,fontSize:k,fontFamily:I,spacing:M}}})}getTargetRadius(t){const{radius:e,properties:i}=this,{innerRadiusRatio:o,outerRadiusRatio:s}=i,{placement:n,spacing:a,size:r}=t,l=e*s,c=e*o;switch(n){case"inside":return Math.max(c-a-r/2,0);case"outside":return l+a+r/2;default:return(c+l)/2}}getTargetLabel(t){const i=this.axes[$o.X].scale,{value:o,size:s,placement:n,label:a}=t,{spacing:r,color:l,fontStyle:c,fontWeight:h,fontSize:p,fontFamily:u}=a,g=void 0,y=i.convert(o),f=_v(y)/(Math.PI/2)|0,m=s/2+r;let x,v,S,b;switch(n){case"outside":({textAlign:x,textBaseline:v}=gF[f]),S=m*Math.cos(y),b=m*Math.sin(y);break;case"inside":({textAlign:x,textBaseline:v}=yF[f]),S=-m*Math.cos(y),b=-m*Math.sin(y);break;default:x="center",v="bottom",S=0,b=-m;break}return{offsetX:S,offsetY:b,fill:l,textAlign:x,textBaseline:v,fontStyle:c,fontWeight:h,fontSize:p,fontFamily:u,lineHeight:g}}createNodeData(){const{id:t,properties:e,radius:i,centerX:o,centerY:s}=this;if(!e.isValid())return;const n=this.axes[$o.X];if(n==null)return;const{value:a,innerRadiusRatio:r,outerRadiusRatio:l,segmentation:c,cornerRadius:h,cornerMode:p,needle:u,bar:g,scale:y,label:f,secondaryLabel:m}=e,{outerRadius:x=i*l,innerRadius:v=i*r}=e,S=this.getTargets(),{domain:b}=n.scale,k=[],I=[],M=[],A=[],T=[],[N,L]=n.range,D=n.scale,C=p==="item",O=D.convert(b[0]),w=D.convert(a),P=Math.ceil(Bv(w-O)*i);let B=c.enabled?c.interval.getSegments(n.scale,P):void 0;const z=g.enabled?g.fill??this.createConicGradient(g.fills,g.fillMode):"rgba(0,0,0,0)",_=y.fill??(g.enabled&&y.fills.length===0?y.defaultFill:void 0)??this.createConicGradient(y.fills,y.fillMode);if(B==null&&C){const[R,E]=b,V={value:a,segmentStart:R,segmentEnd:E},G=Math.min(h,(x-v)/2)/((v+x)/2);k.push({series:this,itemId:"value",datum:V,datumIndex:{type:0},type:0,centerX:o,centerY:s,outerRadius:x,innerRadius:v,startAngle:O-G,endAngle:w+G,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:h,endCornerRadius:h,fill:z}),T.push({series:this,itemId:"scale",datum:V,datumIndex:{type:0},type:0,centerX:o,centerY:s,outerRadius:x,innerRadius:v,startAngle:N-G,endAngle:L+G,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:h,endCornerRadius:h,fill:_})}else{B??(B=b);for(let R=0;Rthis.formatLabel(J.value)}=f;A.push({label:"primary",centerX:o,centerY:s,text:R,value:a,fill:E,fontSize:V,minimumFontSize:F,fontStyle:G,fontWeight:W,fontFamily:K,lineHeight:j,formatter:Z})}if(!u.enabled&&m.enabled){const{text:R,color:E,fontSize:V,minimumFontSize:F,fontStyle:G,fontWeight:W,fontFamily:K,lineHeight:j,formatter:Z}=m;A.push({label:"secondary",centerX:o,centerY:s,text:R,value:a,fill:E,fontSize:V,minimumFontSize:F,fontStyle:G,fontWeight:W,fontFamily:K,lineHeight:j,formatter:Z})}if(u.enabled){let R=u.radiusRatio!=null?i*u.radiusRatio:v;R=Math.max(R-u.spacing,0);const E=D.convert(a);M.push({centerX:o,centerY:s,radius:R,angle:E,series:this})}for(let R=0;RMath.max(...b))continue;const q=this.getTargetRadius(E),it=D.convert(V),X=nF(E.rotation+uF[E.placement]);I.push({series:this,itemId:`target-${R}`,midPoint:{x:q*Math.cos(it)+o,y:q*Math.sin(it)+s},datum:{value:V},datumIndex:{type:1,index:R},type:1,value:V,text:F,centerX:o,centerY:s,shape:W,radius:q,angle:it,rotation:X,size:G,fill:K,fillOpacity:j,stroke:Z,strokeOpacity:tt,strokeWidth:J,lineDash:Q,lineDashOffset:U,label:this.getTargetLabel(E)})}return{itemId:t,nodeData:k,needleData:M,targetData:I,labelData:A,scaleData:T}}updateSelections(t){(this.nodeDataRefresh||t)&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}highlightDatum(t){if(t!=null&&t.series===this&&t.type===1)return t}update({seriesRect:t}){const{datumSelection:e,labelSelection:i,needleSelection:o,targetSelection:s,targetLabelSelection:n,scaleSelection:a,highlightTargetSelection:r}=this,l=this.checkResize(t);this.updateSelections(l),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();const c=this.contextNodeData?.nodeData??[],h=this.contextNodeData?.labelData??[],p=this.contextNodeData?.needleData??[],u=this.contextNodeData?.targetData??[],g=this.contextNodeData?.scaleData??[],y=this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());this.scaleSelection=this.updateScaleSelection({scaleData:g,scaleSelection:a}),this.updateScaleNodes({scaleSelection:a}),this.needleSelection=this.updateNeedleSelection({needleData:p,needleSelection:o}),this.updateNeedleNodes({needleSelection:o}),this.targetSelection=this.updateTargetSelection({targetData:u,targetSelection:s}),this.updateTargetNodes({targetSelection:s,isHighlight:!1}),this.targetLabelSelection=this.updateTargetLabelSelection({targetData:u,targetLabelSelection:n}),this.updateTargetLabelNodes({targetLabelSelection:n}),this.datumSelection=this.updateDatumSelection({nodeData:c,datumSelection:e}),this.updateDatumNodes({datumSelection:e}),this.labelSelection=this.updateLabelSelection({labelData:h,labelSelection:i}),this.updateLabelNodes({labelSelection:i}),this.highlightTargetSelection=this.updateTargetSelection({targetData:y!=null?[y]:[],targetSelection:r}),this.updateTargetNodes({targetSelection:r,isHighlight:!0}),l&&this.animationState.transition("resize"),this.animationState.transition("update")}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>Nu(t.nodeData.length,e.itemId))}updateDatumNodes(t){const{datumSelection:e}=t,{ctx:i,properties:o}=this,{bar:s,segmentation:n}=o,a=n.spacing??0,{fillOpacity:r,stroke:l,strokeOpacity:c,lineDash:h,lineDashOffset:p}=s,u=this.getStrokeWidth(s.strokeWidth),g=i.animationManager.isSkipped();e.each((y,f)=>{const{centerX:m,centerY:x,innerRadius:v,outerRadius:S,startCornerRadius:b,endCornerRadius:k,fill:I}=f;y.centerX=m,y.centerY=x,y.innerRadius=v,y.outerRadius=S,y.pointerEvents=this.properties.bar.enabled?Wn.PointerEvents.All:Wn.PointerEvents.None,y.fill=I,y.fillOpacity=r,y.stroke=l,y.strokeOpacity=c,y.strokeWidth=u,y.lineDash=h,y.lineDashOffset=p,y.startOuterCornerRadius=b,y.startInnerCornerRadius=b,y.endOuterCornerRadius=k,y.endInnerCornerRadius=k,y.radialEdgeInset=(a+y.strokeWidth)/2,y.concentricEdgeInset=y.strokeWidth/2,(g||y.previousDatum==null)&&y.setProperties(Cu(y,f))}),this.datumUnion.update(e,this.itemGroup,Wn.Sector,(y,f,m)=>{y.clipSector??(y.clipSector=new cF(NaN,NaN,NaN,NaN)),y.centerX=f.centerX,y.centerY=f.centerY,y.outerRadius=y.clipSector.outerRadius=f.outerRadius,y.innerRadius=y.clipSector.innerRadius=f.innerRadius,y.startAngle=y.clipSector.startAngle=f.startAngle,y.startInnerCornerRadius=f.startInnerCornerRadius,y.startOuterCornerRadius=f.startOuterCornerRadius,y.endAngle=m.endAngle,y.clipSector.endAngle=m.clipSector?.endAngle??m.endAngle,y.endInnerCornerRadius=m.endInnerCornerRadius,y.endOuterCornerRadius=m.endOuterCornerRadius,y.pointerEvents=Wn.PointerEvents.None})}updateScaleSelection(t){return t.scaleSelection.update(t.scaleData,void 0,e=>Nu(t.scaleData.length,e.itemId))}updateScaleNodes(t){const{scaleSelection:e}=t,{scale:i,segmentation:o}=this.properties,s=o.spacing??0,{fillOpacity:n,stroke:a,strokeOpacity:r,strokeWidth:l,lineDash:c,lineDashOffset:h}=i;e.each((p,u)=>{const{centerX:g,centerY:y,innerRadius:f,outerRadius:m,startCornerRadius:x,endCornerRadius:v,fill:S}=u;p.centerX=g,p.centerY=y,p.innerRadius=f,p.outerRadius=m,p.fill=S,p.fillOpacity=n,p.stroke=a,p.strokeOpacity=r,p.strokeWidth=l,p.lineDash=c,p.lineDashOffset=h,p.startOuterCornerRadius=x,p.startInnerCornerRadius=x,p.endOuterCornerRadius=v,p.endInnerCornerRadius=v,p.radialEdgeInset=(s+p.strokeWidth)/2,p.concentricEdgeInset=p.strokeWidth/2,p.setProperties(Cu(p,u))})}updateNeedleSelection(t){return t.needleSelection.update(t.needleData,void 0,()=>Nu([]))}updateNeedleNodes(t){const{needleSelection:e}=t,{fill:i,fillOpacity:o,stroke:s,strokeOpacity:n,strokeWidth:a,lineDash:r,lineDashOffset:l}=this.properties.needle,c=this.ctx.animationManager.isSkipped();e.each((h,p)=>{const{centerX:u,centerY:g,radius:y}=p,f=y*2;h.d=bu.defaultPathData,h.fill=i,h.fillOpacity=o,h.stroke=s,h.strokeOpacity=n,h.strokeWidth=a/f,h.lineDash=r.map(m=>m/f),h.lineDashOffset=l/f,h.translationX=u,h.translationY=g,h.scalingX=f,h.scalingY=f,c&&h.setProperties(Ev(h,p))})}updateTargetSelection(t){return t.targetSelection.update(t.targetData,void 0,e=>e.itemId)}updateTargetNodes(t){const{targetSelection:e,isHighlight:i}=t,o=i?this.properties.highlightStyle.item:void 0;e.each((s,n)=>{const{centerX:a,centerY:r,angle:l,radius:c,shape:h,size:p,rotation:u,fill:g,fillOpacity:y,stroke:f,strokeOpacity:m,strokeWidth:x,lineDash:v,lineDashOffset:S}=n;s.shape=h==="line"?NS:h,s.size=p,s.fill=o?.fill??g,s.fillOpacity=o?.fillOpacity??y,s.stroke=o?.stroke??f,s.strokeOpacity=o?.strokeOpacity??m,s.strokeWidth=o?.strokeWidth??x,s.lineDash=o?.lineDash??v,s.lineDashOffset=o?.lineDashOffset??S,s.translationX=a+c*Math.cos(l),s.translationY=r+c*Math.sin(l),s.rotation=l+u})}updateTargetLabelSelection(t){return t.targetLabelSelection.update(t.targetData,void 0,e=>e.itemId)}updateTargetLabelNodes(t){const{targetLabelSelection:e}=t;e.each((i,o)=>{const{centerX:s,centerY:n,radius:a,angle:r,text:l}=o,{offsetX:c,offsetY:h,fill:p,fontStyle:u,fontWeight:g,fontSize:y,fontFamily:f,textAlign:m,textBaseline:x}=o.label;if(l==null){i.visible=!1;return}i.visible=!0,i.x=s+a*Math.cos(r)+c,i.y=n+a*Math.sin(r)+h,i.text=l,i.fill=p,i.fontStyle=u,i.fontWeight=g,i.fontSize=y,i.fontFamily=f,i.textAlign=m,i.textBaseline=x})}updateLabelSelection(t){return t.labelSelection.update(t.labelData,void 0,e=>e.label)}updateLabelNodes(t){const{labelSelection:e}=t,i=this.ctx.animationManager.isSkipped();e.each((o,s)=>{o.fill=s.fill,o.fontStyle=s.fontStyle,o.fontWeight=s.fontWeight,o.fontFamily=s.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}labelsHaveExplicitText(){for(const{datum:t}of this.labelSelection)if(t.text==null)return!1;return!0}formatLabelText(t){if(this.axes[$o.X]==null)return;const{labelSelection:i,radius:o,textAlign:s,verticalAlign:n}=this,{spacing:a,innerRadiusRatio:r}=this.properties;iF(this,i,{padding:a,textAlign:s,verticalAlign:n},o*r,t)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),wv([this.datumSelection],Cu),wv([this.needleSelection],Ev),this.formatLabelText()}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}animateLabelText(t={}){const{animationManager:e}=this.ctx;let i,o,s,n;if(this.labelSelection.each((a,r)=>{a.opacity=1,r.label==="primary"?(i=a.previousDatum?.value??t.from??r.value,o=r.value):r.label==="secondary"&&(s=a.previousDatum?.value??t.from??r.value,n=r.value)}),!this.labelsHaveExplicitText())if(o==null||n==null)this.formatLabelText();else if(i===o&&s===n)this.formatLabelText({label:o,secondaryLabel:n});else{const a=`${this.id}_labels`;e.animate({id:a,groupId:"label",from:{label:i,secondaryLabel:s},to:{label:o,secondaryLabel:n},phase:t.phase??"update",onUpdate:r=>this.formatLabelText(r)})}}animateEmptyUpdateReady(){const{animationManager:t}=this.ctx,{node:e,needle:i}=Rv(!0,this.axes[$o.X]?.range[0]??0);er(this.id,"node",t,[this.datumSelection],e,(o,s)=>s.itemId),er(this.id,"needle",t,[this.needleSelection],i,()=>"needle"),er(this.id,"label",t,[this.labelSelection],TS,(o,s)=>s.label),this.animateLabelText({from:this.axes[$o.X]?.scale.domain[0]??0,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:t}=this.ctx,{node:e,needle:i}=Rv(!1,this.axes[$o.X]?.range[0]??0);er(this.id,"node",t,[this.datumSelection],e,(o,s)=>s.itemId),er(this.id,"needle",t,[this.needleSelection],i,()=>"needle"),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(t,e){return[NaN,NaN]}getLegendData(){return[]}getTooltipContent(t){const{id:e,properties:i}=this,{tooltip:o}=i;if(!i.isValid())return;const{value:s=i.value,text:n=i.label.text}=PS(t);return o.formatTooltip({data:[{label:n,fallbackLabel:"Value",value:this.formatLabel(s)}]},{seriesId:e,title:void 0,datum:void 0,value:s})}pickNodeClosestDatum(t){return LS(this,t)}pickFocus(t){return RS(this,t)}getCaptionText(){const{value:t}=this.properties,e=[];return e.push(this.formatLabel(t)),this.labelSelection.each((i,o)=>{const s=Ya(this,o);s!=null&&e.push(s)}),e.join(". ")}};Ou.className="RadialGaugeSeries",Ou.type="radial-gauge";var{FONT_SIZE_RATIO:fF,ThemeSymbols:{DEFAULT_HIERARCHY_FILLS:mF,DEFAULT_GAUGE_SERIES_COLOR_RANGE:xF},ThemeConstants:{POLAR_AXIS_TYPE:Lu}}=FV,SF={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["gauge"],identifier:"radial-gauge",moduleFactory:t=>new Ou(t),tooltipDefaults:{range:10},defaultAxes:[{type:Lu.ANGLE_NUMBER,line:{enabled:!1}},{type:Lu.RADIUS_NUMBER,line:{enabled:!1}}],themeTemplate:{minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{outerRadiusRatio:1,innerRadiusRatio:.8,bar:{strokeWidth:0},segmentation:{enabled:!1,interval:{},spacing:2},defaultTarget:{fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},size:10,shape:"triangle",placement:"outside",spacing:5,label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:5}},needle:{enabled:!1,fill:{$ref:"foregroundColor"},spacing:10},label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:56,minimumFontSize:18/56,fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}},secondaryLabel:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[fF.LARGE]},minimumFontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"}}},axes:{[Lu.ANGLE_NUMBER]:{startAngle:270,endAngle:450,nice:!1,line:{enabled:!1}}}},paletteFactory(t){const{takeColors:e,colorsCount:i,userPalette:o,themeTemplateParameters:s}=t,{fills:n}=e(i),a=s.get(xF),r=s.get(mF),l=o==="inbuilt"?a:[n[0],n[1]];return{scale:{defaultFill:r?.[1],stroke:r?.[2]},defaultColorRange:IS(l)}}};import{_ModuleSupport as bF}from"ag-charts-community";import{_ModuleSupport as mc}from"ag-charts-community";var vF=1e3;function Vv(t,e,i,o,s,n){const a=t[n];if(a==null)return!1;const r=Tl(a,e,i),l=Cl(r,s);return n===o[l+Re]}function Fv(t,e,i,o,s,n){const a=t[n];if(a==null)return!1;const r=Tl(a,e,i),l=Cl(r,s);return n===o[l+Le]}function MF(t,e,i,o){if(t.length64;)({maxRange:a}=Ra(r,l,a,{inPlace:!0})),c=c.filter(Vv.bind(null,t,s,n,r,a)),h=h.filter(Fv.bind(null,t,s,n,r,a)),p.push({maxRange:a,topIndices:c,bottomIndices:h});return p.reverse(),p}import{_ModuleSupport as kF}from"ag-charts-community";var{CartesianSeriesProperties:AF,InterpolationProperties:IF,SeriesMarker:DF,SeriesTooltip:TF,Validate:Ct,BOOLEAN:CF,COLOR_STRING:Gv,LINE_DASH:NF,OBJECT:ir,PLACEMENT:OF,POSITIVE_NUMBER:Ru,RATIO:Wv,STRING:Fs,DropShadow:LF,Label:RF}=kF,Eu=class extends RF{constructor(){super(...arguments),this.placement="outside",this.padding=6}};d([Ct(OF)],Eu.prototype,"placement",2),d([Ct(Ru)],Eu.prototype,"padding",2);var Bt=class extends AF{constructor(){super(...arguments),this.fill="#99CCFF",this.fillOpacity=1,this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new IF,this.shadow=new LF().set({enabled:!1}),this.marker=new DF,this.label=new Eu,this.tooltip=new TF,this.connectMissingData=!1}};d([Ct(Fs)],Bt.prototype,"xKey",2),d([Ct(Fs)],Bt.prototype,"yLowKey",2),d([Ct(Fs)],Bt.prototype,"yHighKey",2),d([Ct(Fs,{optional:!0})],Bt.prototype,"xName",2),d([Ct(Fs,{optional:!0})],Bt.prototype,"yName",2),d([Ct(Fs,{optional:!0})],Bt.prototype,"yLowName",2),d([Ct(Fs,{optional:!0})],Bt.prototype,"yHighName",2),d([Ct(Gv)],Bt.prototype,"fill",2),d([Ct(Wv)],Bt.prototype,"fillOpacity",2),d([Ct(Gv)],Bt.prototype,"stroke",2),d([Ct(Ru)],Bt.prototype,"strokeWidth",2),d([Ct(Wv)],Bt.prototype,"strokeOpacity",2),d([Ct(NF)],Bt.prototype,"lineDash",2),d([Ct(Ru)],Bt.prototype,"lineDashOffset",2),d([Ct(ir)],Bt.prototype,"interpolation",2),d([Ct(ir)],Bt.prototype,"shadow",2),d([Ct(ir)],Bt.prototype,"marker",2),d([Ct(ir)],Bt.prototype,"label",2),d([Ct(ir)],Bt.prototype,"tooltip",2),d([Ct(CF)],Bt.prototype,"connectMissingData",2);import{_ModuleSupport as EF}from"ag-charts-community";var{CollapseMode:xc,isScaleValid:Hv,pairUpSpans:Sc,prepareAreaFillAnimationFns:wF,plotInterpolatedLinePathStroke:Hn,prepareLinePathPropertyAnimation:PF,areScalingEqual:Kv}=EF;function _F(t,e,i,o){const s=(l,c)=>{Hn(l,c,e.removed),Hn(l,c,i.removed)},n=(l,c)=>{Hn(l,c,e.moved),Hn(l,c,i.moved)},a=(l,c)=>{Hn(l,c,e.added),Hn(l,c,i.added)},r=PF(t,o);return{status:t,path:{addPhaseFn:a,updatePhaseFn:n,removePhaseFn:s},pathProperties:r}}function BF(t,e,i){const o=t.scales.x?.type==="category",s=e.scales.x?.type==="category";if(o!==s||!Hv(t.scales.x)||!Hv(e.scales.x))return;let n="updated";e.visible&&!t.visible?n="removed":!e.visible&&t.visible&&(n="added");const a=Sc({scales:t.scales,data:t.fillData.spans},{scales:e.scales,data:e.fillData.spans},xc.Split);if(a==null)return;const r=Sc({scales:t.scales,data:t.fillData.phantomSpans},{scales:e.scales,data:e.fillData.phantomSpans},xc.Split);if(r==null)return;const l=Sc({scales:t.scales,data:t.highStrokeData.spans},{scales:e.scales,data:e.highStrokeData.spans},xc.Split);if(l==null)return;const c=Sc({scales:t.scales,data:t.lowStrokeData.spans},{scales:e.scales,data:e.lowStrokeData.spans},xc.Split);if(c==null)return;const h="fade",p=wF(n,a,r,h),u=_F(n,l,c,h),g=(i?.changed??!0)||!Kv(t.scales.x,e.scales.x)||!Kv(t.scales.y,e.scales.y)||n!=="updated";return{status:n,fill:p,stroke:u,hasMotion:g}}var{valueProperty:Uv,keyProperty:zF,ChartAxisDirection:xe,mergeDefaults:VF,updateLabelNode:FF,fixNumericExtent:Yv,buildResetPathFn:GF,resetLabelFn:WF,resetMarkerFn:HF,resetMarkerPositionFn:jv,pathSwipeInAnimation:KF,resetMotion:UF,markerSwipeScaleInAnimation:YF,seriesLabelFadeInAnimation:wu,animationValidation:jF,diff:XF,updateClipPath:Xv,computeMarkerFocusBounds:$v,plotAreaPathFill:$F,plotLinePathStroke:Zv,interpolatePoints:Qv,pathFadeInAnimation:qv,markerFadeInAnimation:Jv,fromToMotion:tM,pathMotion:eM,extent:ZF,createDatumId:QF,PointerEvents:Pu,Group:qF,BBox:JF,ContinuousScale:tG,OrdinalTimeScale:eG,findMinMax:iG}=mc,oG=class extends mc.SeriesNodeEvent{constructor(t,e,i,o){super(t,e,i,o),this.xKey=o.properties.xKey,this.yLowKey=o.properties.yLowKey,this.yHighKey=o.properties.yHighKey}},_u=class extends mc.CartesianSeries{constructor(t){super({moduleCtx:t,hasMarkers:!0,pathsPerSeries:["fill","stroke"],pickModes:[mc.SeriesNodePickMode.AXIS_ALIGNED],directionKeys:{[xe.X]:["xKey"],[xe.Y]:["yLowKey","yHighKey"]},directionNames:{[xe.X]:["xName"],[xe.Y]:["yLowName","yHighName","yName"]},animationResetFns:{path:GF({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:WF,marker:(e,i)=>({...HF(e),...jv(e,i)})}}),this.properties=new Bt,this.NodeEvent=oG,this.dataAggregationFilters=void 0}async processData(t){if(!this.properties.isValid())return;const{xKey:e,yLowKey:i,yHighKey:o}=this.properties,s=this.axes[xe.X]?.scale,n=this.axes[xe.Y]?.scale,{xScaleType:a,yScaleType:r}=this.getScaleInformation({xScale:s,yScale:n}),l=[],c=!this.ctx.animationManager.isSkipped();!this.ctx.animationManager.isSkipped()&&this.processedData&&l.push(XF(this.id,this.processedData)),c&&l.push(jF());const{dataModel:h,processedData:p}=await this.requestDataModel(t,this.data,{props:[zF(e,a,{id:"xValue"}),Uv(i,r,{id:"yLowValue"}),Uv(o,r,{id:"yHighValue"}),...l]});this.dataAggregationFilters=this.aggregateData(h,p),this.animationState.transition("updateData")}aggregateData(t,e){const i=this.axes[xe.X];if(i==null||!(tG.is(i.scale)||eG.is(i.scale)))return;const o=t.resolveKeysById(this,"xValue",e),s=t.resolveColumnById(this,"yHighValue",e),n=t.resolveColumnById(this,"yLowValue",e),{index:a}=t.resolveProcessedDataDefById(this,"xValue"),r=e.domain.keys[a];return MF(o,s,n,r)}xCoordinateRange(t){const e=this.axes[xe.X].scale.convert(t);return[e,e]}yCoordinateRange(t){const e=this.axes[xe.Y].scale.convert(t[0]);return[e,e]}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!(e&&i))return[];const{domain:{keys:[o]}}=e;if(t===xe.X){const s=i.resolveProcessedDataDefById(this,"xValue");return s?.def.type==="key"&&s.def.valueType==="category"?o:Yv(ZF(o))}else{const s=this.domainForClippedRange(xe.Y,["yHighValue","yLowValue"],"xValue",!0),n=iG(s);return Yv(n)}}getSeriesRange(t,e){return this.domainForVisibleRange(xe.Y,["yHighValue","yLowValue"],"xValue",e,!0)}createNodeData(){const{data:t,dataModel:e,processedData:i,axes:o}=this,s=o[xe.X],n=o[xe.Y];if(!(t&&s&&n&&e&&i))return;const a=s.scale,r=n.scale,{xKey:l,yLowKey:c,yHighKey:h,connectMissingData:p,marker:u,interpolation:g}=this.properties,y=i.dataSources.get(this.id)??[],f=(a.bandwidth??0)/2,m=e.resolveKeysById(this,"xValue",i),x=e.resolveColumnById(this,"yHighValue",i),v=e.resolveColumnById(this,"yLowValue",i),S=R=>a.convert(m[R])+f,b=[],k=[],I=[],M=(R,E,V)=>{const F=y[R],G=m[R];if(G==null)return;const W=I[I.length-1];if(Number.isFinite(E)&&Number.isFinite(V)){const K=(q,it,X)=>{k.push({index:R,series:this,itemId:q,datum:F,datumIndex:R,midPoint:{x:Z,y:X},yHighValue:E,yLowValue:V,xValue:G,xKey:l,yLowKey:c,yHighKey:h,point:{x:Z,y:X,size:Q},enabled:!0});const Ot=this.createLabelData({datumIndex:R,point:{x:Z,y:X},value:it,yLowValue:V,yHighValue:E,itemId:q,inverted:j,datum:F,series:this});b.push(Ot)},j=V>E,Z=S(R),J=r.convert(E),tt=r.convert(V),{size:Q}=u;K("high",E,J),K("low",V,tt);const U={high:{point:{x:Z,y:J},xDatum:G,yDatum:E},low:{point:{x:Z,y:tt},xDatum:G,yDatum:V}};Array.isArray(W)?W.push(U):W!=null?(W.skip+=1,I.push([U])):I.push([U])}else p||(Array.isArray(W)||W==null?I.push({skip:0}):W.skip+=1)},{dataAggregationFilters:A}=this,[T,N]=a.range,L=N-T,D=A?.find(R=>R.maxRange>L),C=D?.topIndices,O=D?.bottomIndices;let[w,P]=this.visibleRange("xValue",s.range,C);w=Math.max(w-1,0),P=Math.min(P+1,C?.length??m.length),i.input.count<1e3&&(w=0,P=i.input.count);for(let R=w;R{if(!Array.isArray(R))return[];const E=R.map(V=>V.high);return Qv(E,g)}),z=I.flatMap(R=>{if(!Array.isArray(R))return[];const E=R.map(V=>V.low);return Qv(E,g)});return{itemId:`${c}-${h}`,labelData:b,nodeData:k,fillData:{itemId:"high",spans:B,phantomSpans:z},highStrokeData:{itemId:"high",spans:B},lowStrokeData:{itemId:"low",spans:z},scales:this.calculateScaling(),visible:this.visible}}createLabelData({datumIndex:t,point:e,value:i,itemId:o,inverted:s,datum:n,series:a}){const{xKey:r,yLowKey:l,yHighKey:c,xName:h,yName:p,yLowName:u,yHighName:g,label:y}=this.properties,{placement:f,padding:m=10}=y;let x=o;s&&(x=o==="low"?"high":"low");const v=f==="outside"&&x==="high"||f==="inside"&&x==="low"?-1:1;return{x:e.x,y:e.y+m*v,series:a,itemId:o,datum:n,datumIndex:t,text:this.getLabelText(y,{value:i,datum:n,itemId:o,xKey:r,yLowKey:l,yHighKey:c,xName:h,yLowName:u,yHighName:g,yName:p}),textAlign:"center",textBaseline:v===-1?"bottom":"top"}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(t){const{opacity:e,visible:i,animationEnabled:o}=t,[s,n]=t.paths,a=this.getStrokeWidth(this.properties.strokeWidth);n.setProperties({fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:Pu.None,stroke:this.properties.stroke,strokeWidth:a,strokeOpacity:this.properties.strokeOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,opacity:e,visible:i||o}),s.setProperties({stroke:void 0,lineJoin:"round",pointerEvents:Pu.None,fill:this.properties.fill,fillOpacity:this.properties.fillOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,strokeOpacity:this.properties.strokeOpacity,fillShadow:this.properties.shadow,strokeWidth:a,opacity:e,visible:i||o}),Xv(this,n),Xv(this,s)}updatePaths(t){this.updateAreaPaths(t.paths,t.contextData)}updateAreaPaths(t,e){for(const i of t)i.visible=e.visible;if(e.visible)this.updateFillPath(t,e),this.updateStrokePath(t,e);else for(const i of t)i.path.clear(),i.markDirty()}updateFillPath(t,e){const[i]=t;i.path.clear(),$F(i,e.fillData),i.markDirty()}updateStrokePath(t,e){const[,i]=t;i.path.clear(),Zv(i,e.highStrokeData.spans),Zv(i,e.lowStrokeData.spans),i.markDirty()}updateMarkerSelection(t){const{nodeData:e,markerSelection:i}=t;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(this.properties.marker.enabled?e:[])}getMarkerItemBaseStyle(t){const{properties:e}=this,{marker:i}=e,o=t?e.highlightStyle.item:void 0;return{shape:i.shape,size:i.size,fill:o?.fill??i.fill,fillOpacity:o?.fillOpacity??i.fillOpacity,stroke:o?.stroke??i.stroke,strokeWidth:o?.strokeWidth??this.getStrokeWidth(i.strokeWidth),strokeOpacity:o?.strokeOpacity??i.strokeOpacity,lineDash:o?.lineDash??i.lineDash,lineDashOffset:o?.lineDashOffset??i.lineDashOffset}}getMarkerItemStyleOverrides(t,e,i,o){const{id:s,properties:n}=this,{xKey:a,yHighKey:r,yLowKey:l,marker:c}=n,{itemStyler:h}=c;if(h!=null)return this.cachedDatumCallback(QF(t,o?"highlight":"node"),()=>h({seriesId:s,datum:e,xKey:a,yHighKey:r,yLowKey:l,highlighted:o,...i}))}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i}=t,{xKey:o,yLowKey:s,yHighKey:n,marker:a,fill:r,stroke:l,strokeWidth:c,fillOpacity:h,strokeOpacity:p}=this.properties,u=VF(i&&this.properties.highlightStyle.item,a.getStyle(),{fill:r,fillOpacity:h,stroke:l,strokeWidth:c,strokeOpacity:p});e.each((g,y)=>{this.updateMarkerStyle(g,a,{datum:y,highlighted:i,xKey:o,yHighKey:n,yLowKey:s},u)}),i||this.properties.marker.markClean()}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e,o=>{o.pointerEvents=Pu.None})}updateLabelNodes(t){t.labelSelection.each((e,i)=>{FF(e,this.properties.label,i)})}getHighlightLabelData(t,e){const i=t.filter(o=>o.datum===e.datum);return i.length>0?i:void 0}getHighlightData(t,e){const i=t.filter(o=>o.datum===e.datum);return i.length>0?i:void 0}getTooltipContent(t){const{id:e,dataModel:i,processedData:o,axes:s,properties:n}=this,{xName:a,yName:r,yLowKey:l,yLowName:c,xKey:h,yHighKey:p,yHighName:u,tooltip:g}=n,y=s[xe.X],f=s[xe.Y];if(!i||!o||!y||!f)return;const{datumIndex:m}=t,x=o.dataSources.get(this.id)?.[m],v=i.resolveKeysById(this,"xValue",o)[m],S=i.resolveColumnById(this,"yHighValue",o)[m],b=i.resolveColumnById(this,"yLowValue",o)[m];if(v==null)return;const k=this.getMarkerItemBaseStyle(!1);Object.assign(k,this.getMarkerItemStyleOverrides(String(m),m,k,!1));const I=`${f.formatDatum(b)} - ${f.formatDatum(S)}`;return g.formatTooltip({heading:y.formatDatum(v),symbol:this.legendItemSymbol(),data:[{label:r,fallbackLabel:`${c??l} - ${u??p}`,value:I}]},{seriesId:e,datum:x,title:r,itemId:t.itemId,xName:a,yName:r,yLowKey:l,yLowName:c,xKey:h,yHighKey:p,yHighName:u,...k})}legendItemSymbol(){const{fill:t,stroke:e,strokeWidth:i,strokeOpacity:o,lineDash:s,marker:n}=this.properties;return{marker:{shape:n.shape,fill:n.fill??t,stroke:n.stroke??e,fillOpacity:n.fillOpacity,strokeOpacity:n.strokeOpacity,strokeWidth:n.strokeWidth,lineDash:n.lineDash,lineDashOffset:n.lineDashOffset},line:{stroke:e,strokeOpacity:o,strokeWidth:i,lineDash:s}}}getLegendData(t){if(t!=="category")return[];const{id:e,visible:i}=this,{yLowKey:o,yHighKey:s,yName:n,yLowName:a,yHighName:r,showInLegend:l}=this.properties,c=n??`${a??o} - ${r??s}`,h=`${o}-${s}`;return[{legendType:"category",id:e,itemId:h,seriesId:e,enabled:i,label:{text:`${c}`},symbol:this.legendItemSymbol(),hideInLegend:!l}]}isLabelEnabled(){return this.properties.label.enabled}onDataChange(){}nodeFactory(){return new qF}animateEmptyUpdateReady(t){const{markerSelection:e,labelSelection:i,contextData:o,paths:s}=t,{animationManager:n}=this.ctx;this.updateAreaPaths(s,o),KF(this,n,...s),UF([e],jv),YF(this,n,e),wu(this,"labels",n,i)}animateReadyResize(t){const{contextData:e,paths:i}=t;this.updateAreaPaths(i,e),super.animateReadyResize(t)}animateWaitingUpdateReady(t){const{animationManager:e}=this.ctx,{markerSelection:i,labelSelection:o,contextData:s,paths:n,previousContextData:a}=t,[r,l]=n;if(r==null&&l==null)return;this.resetMarkerAnimation(t),this.resetLabelAnimation(t);const c=()=>{this.resetPathAnimation(t),this.updateAreaPaths(n,s)},h=()=>{e.skipCurrentBatch(),c()};if(s==null||a==null){c(),Jv(this,e,"added",i),qv(this,"fill_path_properties",e,"add",r),qv(this,"stroke_path_properties",e,"add",l),wu(this,"labels",e,o);return}const p=BF(s,a,this.processedData?.reduced?.diff?.[this.id]);if(p===void 0){h();return}else if(p.status==="no-op")return;tM(this.id,"fill_path_properties",e,[r],p.fill.pathProperties),tM(this.id,"stroke_path_properties",e,[l],p.stroke.pathProperties),p.status==="added"?this.updateAreaPaths(n,s):p.status==="removed"?this.updateAreaPaths(n,a):(eM(this.id,"fill_path_update",e,[r],p.fill.path),eM(this.id,"stroke_path_update",e,[l],p.stroke.path)),p.hasMotion&&(Jv(this,e,void 0,i),wu(this,"labels",e,o)),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(n,s)})}getFormattedMarkerStyle(t){const{xKey:e,yLowKey:i,yHighKey:o}=this.properties;return this.getMarkerStyle(this.properties.marker,{datum:t,xKey:e,yLowKey:i,yHighKey:o,highlighted:!0})}computeFocusBounds(t){const e=$v(this,t),i=$v(this,{...t,datumIndex:t.datumIndex+1});if(e&&i)return JF.merge([e,i])}computeFocusDatumIndex(t,e){const i={...t,datumIndex:t.datumIndex+t.datumIndexDelta,datumIndexDelta:t.datumIndexDelta*2};return super.computeFocusDatumIndex(i,e)}};_u.className="RangeAreaSeries",_u.type="range-area";import{_ModuleSupport as sG}from"ag-charts-community";var nG={series:{fillOpacity:.7,nodeClickRange:"nearest",marker:{enabled:!1,size:6,strokeWidth:2},label:{enabled:!1,placement:"outside",padding:10,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},interpolation:{type:"linear",tension:1,position:"end"}},axes:{[sG.ThemeConstants.CARTESIAN_AXIS_TYPE.NUMBER]:{crosshair:{enabled:!0}}}},{markerPaletteFactory:aG,ThemeConstants:{CARTESIAN_AXIS_TYPE:iM,CARTESIAN_POSITION:oM}}=bF,rG={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"range-area",moduleFactory:t=>new _u(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:iM.NUMBER,position:oM.LEFT},{type:iM.CATEGORY,position:oM.BOTTOM}],themeTemplate:nG,paletteFactory:t=>{const{marker:e}=aG(t);return{fill:e.fill,stroke:e.stroke,marker:e}}};import{_ModuleSupport as sM}from"ag-charts-community";import{_ModuleSupport as Bu}from"ag-charts-community";var lG=1e3,cG=5;function hG(t,e,i,o){if(t.length64;)({indexData:r,valueData:l,maxRange:a}=Ra(r,l,a)),c.push({maxRange:a,indexData:r});return c.reverse(),c}import{_ModuleSupport as dG}from"ag-charts-community";var{AbstractBarSeriesProperties:pG,SeriesTooltip:uG,Validate:Nt,COLOR_STRING:nM,FUNCTION:gG,LINE_DASH:yG,OBJECT:zu,PLACEMENT:fG,POSITIVE_NUMBER:bc,RATIO:aM,STRING:Gs,BOOLEAN:mG,DropShadow:xG,Label:SG}=dG,Vu=class extends SG{constructor(){super(...arguments),this.placement="inside",this.padding=6}};d([Nt(fG)],Vu.prototype,"placement",2),d([Nt(bc)],Vu.prototype,"padding",2);var zt=class extends pG{constructor(){super(...arguments),this.fill="#99CCFF",this.fillOpacity=1,this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.shadow=new xG().set({enabled:!1}),this.label=new Vu,this.tooltip=new uG,this.fastDataProcessing=!1}};d([Nt(Gs)],zt.prototype,"xKey",2),d([Nt(Gs)],zt.prototype,"yLowKey",2),d([Nt(Gs)],zt.prototype,"yHighKey",2),d([Nt(Gs,{optional:!0})],zt.prototype,"xName",2),d([Nt(Gs,{optional:!0})],zt.prototype,"yName",2),d([Nt(Gs,{optional:!0})],zt.prototype,"yLowName",2),d([Nt(Gs,{optional:!0})],zt.prototype,"yHighName",2),d([Nt(nM)],zt.prototype,"fill",2),d([Nt(aM)],zt.prototype,"fillOpacity",2),d([Nt(nM)],zt.prototype,"stroke",2),d([Nt(bc)],zt.prototype,"strokeWidth",2),d([Nt(aM)],zt.prototype,"strokeOpacity",2),d([Nt(yG)],zt.prototype,"lineDash",2),d([Nt(bc)],zt.prototype,"lineDashOffset",2),d([Nt(bc)],zt.prototype,"cornerRadius",2),d([Nt(gG,{optional:!0})],zt.prototype,"itemStyler",2),d([Nt(zu)],zt.prototype,"shadow",2),d([Nt(zu)],zt.prototype,"label",2),d([Nt(zu)],zt.prototype,"tooltip",2),d([Nt(mG)],zt.prototype,"fastDataProcessing",2);var{SeriesNodePickMode:rM,valueProperty:lM,keyProperty:bG,ChartAxisDirection:or,checkCrisp:vG,updateLabelNode:MG,SMALLEST_KEY_INTERVAL:kG,LARGEST_KEY_INTERVAL:AG,diff:IG,prepareBarAnimationFunctions:cM,midpointStartingBarPosition:hM,resetBarSelectionsFn:DG,fixNumericExtent:TG,seriesLabelFadeInAnimation:dM,resetLabelFn:CG,animationValidation:NG,computeBarFocusBounds:OG,visibleRangeIndices:pM,createDatumId:LG,ContinuousScale:uM,OrdinalTimeScale:RG,Rect:EG,PointerEvents:wG,motion:gM,applyShapeStyle:PG,findMinMax:_G}=Bu,BG=class extends Bu.SeriesNodeEvent{constructor(t,e,i,o){super(t,e,i,o),this.xKey=o.properties.xKey,this.yLowKey=o.properties.yLowKey,this.yHighKey=o.properties.yHighKey}},Fu=class extends Bu.AbstractBarSeries{constructor(t){super({moduleCtx:t,pickModes:[rM.AXIS_ALIGNED,rM.EXACT_SHAPE_MATCH],hasHighlightedLabels:!0,directionKeys:{x:["xKey"],y:["yLowKey","yHighKey"]},directionNames:{x:["xName"],y:["yLowName","yHighName","yName"]},datumSelectionGarbageCollection:!1,animationResetFns:{datum:DG,label:CG}}),this.properties=new zt,this.dataAggregationFilters=void 0,this.NodeEvent=BG}async processData(t){if(!this.properties.isValid())return;const{xKey:e,yLowKey:i,yHighKey:o,fastDataProcessing:s}=this.properties,n=!s,a=this.getCategoryAxis()?.scale,r=this.getValueAxis()?.scale,{isContinuousX:l,xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:a,yScale:r}),p=[];this.ctx.animationManager.isSkipped()||(this.processedData&&p.push(IG(this.id,this.processedData)),p.push(NG()));const u=this.visible?{}:{forceValue:0},{dataModel:g,processedData:y}=await this.requestDataModel(t,this.data,{props:[bG(e,c,{id:"xValue"}),lM(i,h,{id:"yLowValue",invalidValue:null,...u}),lM(o,h,{id:"yHighValue",invalidValue:null,...u}),...l?[kG,AG]:[],...p],groupByKeys:n});this.smallestDataInterval=y.reduced?.smallestKeyInterval,this.largestDataInterval=y.reduced?.largestKeyInterval,this.dataAggregationFilters=this.aggregateData(g,y),this.animationState.transition("updateData")}aggregateData(t,e){if(e.type!=="grouped")return;const i=this.axes[or.X];if(i==null||!(uM.is(i.scale)||RG.is(i.scale)))return;const o=t.resolveKeysById(this,"xValue",e),s=t.resolveColumnById(this,"yHighValue",e),n=t.resolveColumnById(this,"yLowValue",e),{index:a}=t.resolveProcessedDataDefById(this,"xValue"),r=e.domain.keys[a];return hG(o,s,n,r)}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!e||!i)return[];const{keys:[o]}=e.domain;if(t===this.getCategoryDirection()){const s=i.resolveProcessedDataDefById(this,"xValue");return s?.def.type==="key"&&s?.def.valueType==="category"?o:this.padBandExtent(o)}else{const s=this.domainForClippedRange(or.Y,["yHighValue","yLowValue"],"xValue",!0),n=_G(s);return TG(n)}}getSeriesRange(t,e){return this.domainForVisibleRange(or.Y,["yHighValue","yLowValue"],"xValue",e,!0)}createNodeData(){const{data:t,dataModel:e,groupScale:i,processedData:o,visible:s}=this,n=this.getCategoryAxis(),a=this.getValueAxis();if(!(t&&n&&a&&e&&o?.dataSources))return;const r=n.scale,l=a.scale,c=this.getBarDirection()===or.X,{xKey:h,yLowKey:p,yHighKey:u,strokeWidth:g}=this.properties,y=`${p}-${u}`,f={itemId:y,nodeData:[],labelData:[],scales:this.calculateScaling(),visible:this.visible};if(!s)return f;const m=o.dataSources.get(this.id)??[],x=e.resolveKeysById(this,"xValue",o),v=e.resolveColumnById(this,"yLowValue",o),S=e.resolveColumnById(this,"yHighValue",o),{barWidth:b,groupIndex:k}=this.updateGroupScale(n),I=uM.is(r)?b*-.5:0,M=i.convert(String(k)),A=vG(n?.scale,n?.visibleRange,this.smallestDataInterval,this.largestDataInterval),T=P=>Math.round(r.convert(x[P]))+M+I,N=(P,B,z,_,R,E,V)=>{const F=m[P],G=x[P];if(G==null)return;const W=v[P],K=S[P];if(!Number.isFinite(W?.valueOf())||!Number.isFinite(K?.valueOf()))return;const[j,Z]=WP.maxRange>O);if(w!=null){const{maxRange:P,indexData:B}=w,[z,_]=pM(P,n.range,R=>{const E=R*Ve,V=B[E+ne],F=B[E+Me];if(V===-1)return;const G=(V+F)/2|0;return[T(G),T(F)+b]});for(let R=z;R<_;R+=1){const E=R*Ve,V=B[E+ne],F=B[E+Me],G=B[E+Le],W=B[E+Re];if(V===-1)continue;const K=(V+F)/2|0;if(x[K]==null)continue;const Z=T(K),J=Math.abs(T(V)-T(F))+b,tt=v[G],Q=S[W];N(K,0,Z,J,tt,Q,!1)}}else if(o.type==="ungrouped"){let[P,B]=pM(m.length,n.range,z=>[T(z),b]);o.input.count<1e3&&(P=0,B=o.input.count);for(let z=P;zthis.getDatumId(s))}getItemBaseStyle(t){const{properties:e}=this,{cornerRadius:i}=e,o=t?e.highlightStyle.item:void 0;return{fill:o?.fill??e.fill,fillOpacity:o?.fillOpacity??e.fillOpacity,stroke:o?.stroke??e.stroke,strokeWidth:o?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:o?.strokeOpacity??e.strokeOpacity,lineDash:o?.lineDash??e.lineDash??[],lineDashOffset:o?.lineDashOffset??e.lineDashOffset,cornerRadius:i}}getItemStyleOverrides(t,e,i,o){const{id:s,properties:n}=this,{xKey:a,yHighKey:r,yLowKey:l,itemStyler:c}=n;if(c!=null)return this.cachedDatumCallback(LG(t,o?"highlight":"node"),()=>c({seriesId:s,datum:e,xKey:a,yHighKey:r,yLowKey:l,highlighted:o,...i}))}updateDatumNodes(t){const{datumSelection:e,isHighlight:i}=t,o=this.getCategoryDirection()===or.X,s=this.getItemBaseStyle(i);e.each((n,a)=>{const r=this.getItemStyleOverrides(String(a.datumIndex),a.datum,s,i);PG(n,s,r),n.cornerRadius=r?.cornerRadius??s.cornerRadius,n.visible=o?a.width>0:a.height>0,n.crisp=a.crisp})}getHighlightLabelData(t,e){const i=t.filter(o=>o.datum===e.datum);return i.length>0?i:void 0}updateLabelSelection(t){const e=this.properties.label.enabled?t.labelData:[];return t.labelSelection.update(e,i=>{i.pointerEvents=wG.None})}updateLabelNodes(t){t.labelSelection.each((e,i)=>{MG(e,this.properties.label,i)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:o,properties:s}=this,{xKey:n,xName:a,yName:r,yLowKey:l,yHighKey:c,yLowName:h,yHighName:p,tooltip:u}=s,g=this.getCategoryAxis(),y=this.getValueAxis();if(!i||!o||!g||!y)return;const{datumIndex:f}=t,m=o.dataSources.get(this.id)?.[f],x=i.resolveKeysById(this,"xValue",o)[f],v=i.resolveColumnById(this,"yHighValue",o)[f],S=i.resolveColumnById(this,"yLowValue",o)[f];if(x==null)return;const b=this.getItemBaseStyle(!1);Object.assign(b,this.getItemStyleOverrides(String(f),m,b,!1));const k=`${y.formatDatum(S)} - ${y.formatDatum(v)}`;return u.formatTooltip({heading:g.formatDatum(x),symbol:this.legendItemSymbol(),data:[{label:r,fallbackLabel:`${h??l} - ${p??c}`,value:k}]},{seriesId:e,datum:m,title:r,xKey:n,xName:a,yName:r,yLowKey:l,yHighKey:c,yLowName:h,yHighName:p,...b})}legendItemSymbol(){const{fill:t,stroke:e,strokeWidth:i,fillOpacity:o,strokeOpacity:s,lineDash:n,lineDashOffset:a}=this.properties;return{marker:{fill:t,stroke:e,fillOpacity:o,strokeOpacity:s,strokeWidth:i,lineDash:n,lineDashOffset:a}}}getLegendData(t){if(t!=="category")return[];const{id:e,visible:i}=this,{yName:o,yLowName:s,yHighName:n,yLowKey:a,yHighKey:r,showInLegend:l}=this.properties,c=o??`${s??a} - ${n??r}`,h=`${a}-${r}`;return[{legendType:"category",id:e,itemId:h,seriesId:e,enabled:i,label:{text:`${c}`},symbol:this.legendItemSymbol(),hideInLegend:!l}]}animateEmptyUpdateReady({datumSelection:t,labelSelection:e}){const i=cM(hM(this.isVertical(),"normal"));gM.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],i),dM(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(t){const{datumSelection:e,labelSelection:i}=t,{processedData:o}=this,s=o?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const n=cM(hM(this.isVertical(),"fade"));gM.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],n,(a,r)=>this.getDatumId(r),s),dM(this,"labels",this.ctx.animationManager,i)}getDatumId(t){return`${t.xValue}-${t.valueIndex}`}isLabelEnabled(){return this.properties.label.enabled}onDataChange(){}computeFocusBounds({datumIndex:t}){return OG(this,this.contextNodeData?.nodeData[t])}};Fu.className="RangeBarSeries",Fu.type="range-bar";import{_ModuleSupport as zG}from"ag-charts-community";var VG={series:{direction:"vertical",strokeWidth:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"},placement:"inside"}},axes:{[zG.ThemeConstants.CARTESIAN_AXIS_TYPE.NUMBER]:{crosshair:{enabled:!0}}}},{CARTESIAN_AXIS_TYPE:yM,CARTESIAN_POSITION:fM}=sM.ThemeConstants,FG={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"range-bar",moduleFactory:t=>new Fu(t),tooltipDefaults:{range:"exact"},defaultAxes:sM.swapAxisCondition([{type:yM.NUMBER,position:fM.LEFT},{type:yM.CATEGORY,position:fM.BOTTOM}],t=>t?.direction==="horizontal"),themeTemplate:VG,paletteFactory:({takeColors:t})=>{const{fills:[e],strokes:[i]}=t(1);return{fill:e,stroke:i}},groupable:!0};import"ag-charts-community";import{_ModuleSupport as GG}from"ag-charts-community";function mM(t){t.nodes.sort((e,i)=>Math.round((e.datum.y-i.datum.y)*100)/100||-(e.datum.size-i.datum.size))}function WG({nodes:t,size:e},{seriesRectHeight:i,nodeSpacing:o,sizeScale:s}){const n=i*e*s;let a=(i-(n+o*(t.length-1)))/2;t.forEach(({datum:r})=>{const l=i*r.size*s;r.y=a,r.height=l,a+=l+o})}function HG(t,e){const{nodes:i}=t,{seriesRectHeight:o,nodeSpacing:s}=e;mM(t);let n=0,a=0;for(const{datum:c}of i){const h=Math.max(a-c.y,0);c.y+=h,n+=h,a=c.y+c.height+s}if(a-s0;let l=o;for(let c=i.length-1;c>=0;c-=1){const{datum:h}=i[c],p=h.y+h.height,u=Math.min(l-p,0);h.y+=u,n+=u,l=h.y-s}return!0}function Gu(t,e,i,o,s,n,a,r){const l=(i-t)/(o-e),c=(a-s)/(r-n),h=((n-e)*(l*c)+t*c-s*l)/(c-l);return tt&&hMath.max(i,a)}function xM(t,e){let i=!1;const o=t.nodes.filter(n=>e(n).length===1);let s=!0;for(let n=0;s&&ni.linksBefore)||e,e=xM(t,i=>i.linksAfter)||e,e}function UG(t){if(t.length===0)return;let e=0,i=0;for(const{node:{datum:o}}of t)e+=o.y*o.size,i+=o.size;return e/i}function SM(t,e,i,o){return t.nodes.forEach(({datum:s,linksBefore:n,linksAfter:a})=>{const r=o===1?n:a,l=o===1?a:n,c=UG(r);if(c!=null){const h=l.length!==0?i:1;s.y=s.y+(c-s.y)*h}}),HG(t,e)}function bM(t,e,i){let o=!1;for(const s of t)o=SM(s,e,i,1)||o;return o}function YG(t,e,i){let o=!1;for(let s=t.length-1;s>=0;s-=1)o=SM(t[s],e,i,-1)||o;return o}function vM(t){let e=!1;for(let i=t.length-1;i>=0;i-=1)e=KG(t[i])||e;return e}function jG(t,e){t.forEach(o=>{WG(o,e)});let i=!1;for(let o=0;o<6;o+=1){const s=bM(t,e,1);i=YG(t,e,.5);const n=vM(t);if(!s&&!i&&!n)break}i&&(bM(t,e,1),vM(t))}import{_ModuleSupport as XG}from"ag-charts-community";var{BBox:$G,Path:ZG,ScenePathChangeDetection:Kn,splitBezier:QG}=XG;function vc(t,e,i,o,s,n,a,r,l,c){let h,p;if(s!==i&&l!==a){const I=-(o-e)/(s-i),M=-(r-n)/(l-a);h=(a-i+I*e-M*n)/(I-M),p=I*(h-e)+i}else if(s===i&&l!==a)h=e,p=-(r-n)/(l-a)*(h-r)+l;else if(s!==i&&l===a)h=r,p=-(o-e)/(s-i)*(h-e)+i;else throw new Error("Offsetting flat bezier curve");const u=Math.hypot(i-p,e-h),g=(u+c)/u,y=Math.hypot(l-p,r-h),f=(y+c)/y,m=h+(o-h)*g,x=p+(s-p)*g,v=h+(n-h)*f,S=p+(a-p)*f,b=h+(r-h)*f,k=p+(l-p)*f;t.cubicCurveTo(m,x,v,S,b,k)}var Ws=class extends ZG{constructor(){super(...arguments),this.x1=0,this.x2=0,this.y1=0,this.y2=0,this.height=0,this.inset=0}computeBBox(){const t=Math.min(this.x1,this.x2),e=Math.max(this.x1,this.x2)-t,i=Math.min(this.y1,this.y2),o=Math.max(this.y1,this.y2)-i+this.height;return new $G(t,i,e,o)}updatePath(){const{path:t,inset:e}=this;t.clear();const i=this.x1+e,o=this.x2-e,s=this.y1+e,n=this.y2+e,a=this.height-2*e;if(a<0||i>o)return;const r=i,l=s+a/2,c=(i+o)/2,h=s+a/2,p=(i+o)/2,u=n+a/2,g=o,y=n+a/2;if(t.moveTo(r,l-a/2),Math.abs(this.y2-this.y1)<1||this.x2-this.x1s?1:-1)*a/2;vc(t,f[0].x,f[0].y,f[1].x,f[1].y,f[2].x,f[2].y,f[3].x,f[3].y,x),vc(t,m[0].x,m[0].y,m[1].x,m[1].y,m[2].x,m[2].y,m[3].x,m[3].y,-x),t.lineTo(g,y+a/2),vc(t,m[3].x,m[3].y,m[2].x,m[2].y,m[1].x,m[1].y,m[0].x,m[0].y,x),vc(t,f[3].x,f[3].y,f[2].x,f[2].y,f[1].x,f[1].y,f[0].x,f[0].y,-x)}t.closePath()}};d([Kn()],Ws.prototype,"x1",2),d([Kn()],Ws.prototype,"x2",2),d([Kn()],Ws.prototype,"y1",2),d([Kn()],Ws.prototype,"y2",2),d([Kn()],Ws.prototype,"height",2),d([Kn()],Ws.prototype,"inset",2);import{_ModuleSupport as qG}from"ag-charts-community";var{BaseProperties:MM,SeriesTooltip:JG,SeriesProperties:tW,ARRAY:eW,COLOR_STRING:Mc,COLOR_STRING_ARRAY:kM,FUNCTION:AM,LINE_DASH:IM,OBJECT:kc,POSITIVE_NUMBER:Hs,RATIO:Ac,STRING:Zo,UNION:iW,Validate:nt,Label:oW}=qG,sW=iW(["left","right","center","justify"],"a justification value"),DM=class extends oW{constructor(){super(...arguments),this.spacing=1}};d([nt(Hs)],DM.prototype,"spacing",2);var fo=class extends MM{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};d([nt(Mc,{optional:!0})],fo.prototype,"fill",2),d([nt(Ac)],fo.prototype,"fillOpacity",2),d([nt(Mc,{optional:!0})],fo.prototype,"stroke",2),d([nt(Ac)],fo.prototype,"strokeOpacity",2),d([nt(Hs)],fo.prototype,"strokeWidth",2),d([nt(IM)],fo.prototype,"lineDash",2),d([nt(Hs)],fo.prototype,"lineDashOffset",2),d([nt(AM,{optional:!0})],fo.prototype,"itemStyler",2);var oi=class extends MM{constructor(){super(...arguments),this.spacing=1,this.width=1,this.alignment="justify",this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};d([nt(Hs)],oi.prototype,"spacing",2),d([nt(Hs)],oi.prototype,"width",2),d([nt(sW)],oi.prototype,"alignment",2),d([nt(Mc,{optional:!0})],oi.prototype,"fill",2),d([nt(Ac)],oi.prototype,"fillOpacity",2),d([nt(Mc,{optional:!0})],oi.prototype,"stroke",2),d([nt(Ac)],oi.prototype,"strokeOpacity",2),d([nt(Hs)],oi.prototype,"strokeWidth",2),d([nt(IM)],oi.prototype,"lineDash",2),d([nt(Hs)],oi.prototype,"lineDashOffset",2),d([nt(AM,{optional:!0})],oi.prototype,"itemStyler",2);var Se=class extends tW{constructor(){super(...arguments),this.nodes=void 0,this.idKey="",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.sizeKey=void 0,this.sizeName=void 0,this.fills=[],this.strokes=[],this.label=new DM,this.link=new fo,this.node=new oi,this.tooltip=new JG}};d([nt(eW,{optional:!0})],Se.prototype,"nodes",2),d([nt(Zo)],Se.prototype,"fromKey",2),d([nt(Zo)],Se.prototype,"toKey",2),d([nt(Zo)],Se.prototype,"idKey",2),d([nt(Zo,{optional:!0})],Se.prototype,"idName",2),d([nt(Zo,{optional:!0})],Se.prototype,"labelKey",2),d([nt(Zo,{optional:!0})],Se.prototype,"labelName",2),d([nt(Zo,{optional:!0})],Se.prototype,"sizeKey",2),d([nt(Zo,{optional:!0})],Se.prototype,"sizeName",2),d([nt(kM)],Se.prototype,"fills",2),d([nt(kM)],Se.prototype,"strokes",2),d([nt(kc)],Se.prototype,"label",2),d([nt(kc)],Se.prototype,"link",2),d([nt(kc)],Se.prototype,"node",2),d([nt(kc)],Se.prototype,"tooltip",2);var{Transformable:nW,applyShapeStyle:TM,SeriesNodePickMode:CM,CachedTextMeasurerPool:aW,TextWrapper:NM,TextUtils:OM,createDatumId:Ic,Rect:LM,BBox:rW}=GG,Wu=class extends fp{constructor(t){super({moduleCtx:t,pickModes:[CM.NEAREST_NODE,CM.EXACT_SHAPE_MATCH]}),this.properties=new Se}isLabelEnabled(){return(this.properties.labelKey!=null||this.nodes==null)&&this.properties.label.enabled}linkFactory(){return new Ws}nodeFactory(){return new LM}createNodeData(){const{id:t,_nodeDataDependencies:{seriesRectWidth:e,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0}}=this,{fromKey:o,toKey:s,sizeKey:n,label:{spacing:a},node:{spacing:r,width:l,alignment:c}}=this.properties,{nodeGraph:h,links:p,maxPathLength:u}=this.getNodeGraph(M=>({...M,x:NaN,y:NaN,width:l,height:NaN}),M=>({...M,x1:NaN,x2:NaN,y1:NaN,y2:NaN,height:NaN}),{includeCircularReferences:!1}),g=h,y=this.isLabelEnabled()?(e-l)*(1-u/(u+1)):0,f=(e-l-2*y)/(u-1),m=[];for(let M=0;M{const{datum:A,linksBefore:T,linksAfter:N,maxPathLengthBefore:L,maxPathLengthAfter:D}=M,C=Math.max(T.reduce((P,{link:B})=>P+B.size,0),N.reduce((P,{link:B})=>P+B.size,0));if(T.length===0&&N.length===0||C===0){M.columnIndex=-1;return}let O;switch(c){case"left":O=m[L];break;case"right":O=m[u-1-D];break;case"center":{if(T.length!==0)O=m[L];else if(N.length!==0){const P=N.reduce((B,z)=>Math.min(B,z.node.maxPathLengthBefore),u)-1;O=m[P]}else O=m[0];break}case"justify":{O=N.length===0?m[u-1]:m[L];break}}A.x=O.x,A.size=C;const w=this.getLabelText(this.properties.label,{datum:A.datum,value:A.label,fromKey:o,toKey:s,sizeKey:n,size:C});A.label=String(w),O.nodes.push(M),O.size+=C,M.columnIndex=O.index}),g.forEach(M=>{let A=1/0,T=0;M.linksAfter.forEach(N=>{const L=N.node,{columnIndex:D}=L;D{const N=(1-(T.length-1)*(r/i))/A;return Math.min(M,N)},1/0);for(let M=m.length-1;M>=0;M-=1)m[M].nodes.sort((T,N)=>T.closestColumnIndex-N.closestColumnIndex||T.maxSizeOfClosestNodesAfter-N.maxSizeOfClosestNodesAfter||T.datum.size-N.datum.size);jG(m,{seriesRectHeight:i,nodeSpacing:r,sizeScale:x});let v=!1;if(g.forEach(({datum:M,linksBefore:A,linksAfter:T})=>{v||(v=M.height<0);const N=M.y+M.height,L=O=>O.sort((w,P)=>{const B=w.node.datum,z=P.node.datum,_=B.y+B.height,R=z.y+z.height,E=Math.atan2(B.y-M.y,Math.abs(B.x-M.x))-Math.atan2(z.y-M.y,Math.abs(z.x-M.x)),V=Math.atan2(_-N,Math.abs(B.x-M.x))-Math.atan2(R-N,Math.abs(z.x-M.x));return E+V});let D=M.y;L(A).forEach(({link:O})=>{O.y2=D,D+=O.size*i*x});let C=M.y;L(T).forEach(({link:O})=>{O.y1=C,C+=O.size*i*x})}),v){lt.warnOnce("There was insufficient space to display the Sankey Series. Reduce the node spacing, or provide a larger container.");return}const S=[],b=[],{fontSize:k}=this.properties.label,I=this.properties.label.getFont();return m.forEach((M,A)=>{const T=A===0,N=A===m.length-1;let L=-1/0;M.nodes.sort((D,C)=>D.datum.y-C.datum.y),M.nodes.forEach(({datum:D})=>{if(D.midPoint={x:D.x+D.width/2,y:D.y+D.height/2},S.push(D),D.label==null)return;const C=T?D.x-a:D.x+D.width+a,O=D.y+D.height/2;let w;if(!T&&!N){const _=O-OM.getLineHeight(k),R=O+OM.getLineHeight(k);let E=e;g.forEach(({datum:F})=>{F.x>D.x&&Math.max(F.y,_)<=Math.min(F.y+F.height,R)&&(E=Math.min(E,F.x-a))});const V=E-D.x-2*a;w=NM.wrapText(D.label,{maxWidth:V,maxHeight:D.height,font:this.properties.label,textWrap:"never",overflow:"hide"})}if(w==null||w===""){const _=T||N?a:a*2;w=NM.wrapText(D.label,{maxWidth:f-_,maxHeight:D.height,font:this.properties.label,textWrap:"never"})}if(w==="")return;const{height:P}=aW.measureText(w,{font:I,textAlign:"left",textBaseline:"middle"}),B=O-P/2,z=O+P/2;B>=L&&(b.push({x:C,y:O,leading:T,text:w}),L=z)})}),p.forEach(M=>{const{fromNode:A,toNode:T,size:N}=M;M.height=i*N*x,M.x1=A.x+l,M.x2=T.x,M.midPoint={x:(M.x1+M.x2)/2,y:(M.y1+M.y2)/2+M.height/2},S.push(M)}),{itemId:t,nodeData:S,labelData:b}}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e)}updateLabelNodes(t){const{labelSelection:e}=t,{color:i,fontStyle:o,fontWeight:s,fontSize:n,fontFamily:a}=this.properties.label;e.each((r,{x:l,y:c,leading:h,text:p})=>{r.visible=!0,r.x=l,r.y=c,r.text=p,r.fill=i,r.fontStyle=o,r.fontWeight=s,r.fontSize=n,r.fontFamily=a,r.textAlign=h?"right":"left",r.textBaseline="middle"})}updateNodeSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>Ic([e.type,e.id]))}getBaseNodeStyle(t){const{properties:e}=this,{fill:i,fillOpacity:o,stroke:s,strokeOpacity:n,lineDash:a,lineDashOffset:r}=e.node,l=t?e.highlightStyle.item:void 0;return{fill:l?.fill??i,fillOpacity:l?.fillOpacity??o,stroke:l?.stroke??s,strokeOpacity:l?.strokeOpacity??n,strokeWidth:l?.strokeWidth??this.getStrokeWidth(e.node.strokeWidth),lineDash:l?.lineDash??a,lineDashOffset:l?.lineDashOffset??r}}getNodeStyleOverrides(t,e,i,o,s,n,a){const{id:r,properties:l}=this,{fills:c,strokes:h}=l,{itemStyler:p}=l.node,u=n.fill??c[i%c.length],g=n.stroke??h[i%h.length],y={};if(a||(y.fill=u,y.stroke=g),p!=null){const f=this.cachedDatumCallback(Ic(t,a?"highlight":"node"),()=>{const{fillOpacity:m=1,strokeOpacity:x=1,strokeWidth:v=0,lineDash:S=[],lineDashOffset:b=0}=n;return p({seriesId:r,datum:e,highlighted:a,label:s,size:o,fill:u,fillOpacity:m,stroke:g,strokeOpacity:x,strokeWidth:v,lineDash:S,lineDashOffset:b})});Object.assign(y,f)}return y}updateNodeNodes(t){const{datumSelection:e,isHighlight:i}=t,o=this.getBaseNodeStyle(i);e.each((s,n)=>{const{datumIndex:a,size:r,label:l}=n,c=this.getNodeStyleOverrides(String(a),n,a.index,r,l,o,i);s.x=n.x,s.y=n.y,s.width=Math.max(n.width,0),s.height=Math.max(n.height,0),TM(s,o,c)})}updateLinkSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>Ic([e.type,e.index,e.fromNode.id,e.toNode.id]))}getBaseLinkStyle(t){const{properties:e}=this,{fill:i,fillOpacity:o,stroke:s,strokeOpacity:n,lineDash:a,lineDashOffset:r}=e.link,l=t?e.highlightStyle.item:void 0;return{fill:l?.fill??i,fillOpacity:l?.fillOpacity??o,stroke:l?.stroke??s,strokeOpacity:l?.strokeOpacity??n,strokeWidth:l?.strokeWidth??this.getStrokeWidth(e.link.strokeWidth),lineDash:l?.lineDash??a,lineDashOffset:l?.lineDashOffset??r}}getLinkStyleOverrides(t,e,i,o,s){const{id:n,properties:a}=this,{fills:r,strokes:l}=a,{itemStyler:c}=a.link,h=o.fill??r[i%r.length],p=o.stroke??l[i%l.length],u={};if(s||(u.fill=h,u.stroke=p),c!=null){const g=this.cachedDatumCallback(Ic(t,s?"highlight":"node"),()=>{const{fillOpacity:y=1,strokeOpacity:f=1,strokeWidth:m=0,lineDash:x=[],lineDashOffset:v=0}=o;return c({seriesId:n,datum:e,highlighted:s,fill:h,fillOpacity:y,stroke:p,strokeOpacity:f,strokeWidth:m,lineDash:x,lineDashOffset:v})});Object.assign(u,g)}return u}updateLinkNodes(t){const{datumSelection:e,isHighlight:i}=t,o=this.getBaseLinkStyle(i);e.each((s,n)=>{const{datumIndex:a}=n,r=n.fromNode.datumIndex,l=this.getLinkStyleOverrides(String(a),n,r.index,o,i);s.x1=n.x1,s.y1=n.y1,s.x2=n.x2,s.y2=n.y2,s.height=n.height,TM(s,o,l),s.inset=s.strokeWidth/2})}getTooltipContent(t){const{id:e,linksProcessedData:i,nodesProcessedData:o,properties:s}=this,{fromKey:n,toKey:a,sizeKey:r,sizeName:l,tooltip:c}=s,{datumIndex:h}=t,p=t.type===0?t.fromNode.index:t.index,u=t.type===0?`${t.fromNode.label} - ${t.toNode.label}`:t.label,g=h.type===0?i?.dataSources.get(this.id)?.[h.index]:o?.dataSources.get(this.id)?.[h.index],y=t.size;let f;if(t.type===0){const m=t.fromNode.datumIndex,x=this.getBaseLinkStyle(!1);Object.assign(x,this.getLinkStyleOverrides(String(h),g,m.index,x,!1)),f=x}else{const m=t.label,x=this.getBaseNodeStyle(!1);Object.assign(x,this.getNodeStyleOverrides(String(h),g,h.index,y,m,x,!1)),f=x}return c.formatTooltip({title:u,symbol:this.legendItemSymbol(t.type,p,f),data:r!=null?[{label:l,fallbackLabel:r,value:String(y)}]:[]},{seriesId:e,datum:g,title:u,fromKey:n,toKey:a,sizeKey:r,sizeName:l,size:y,...f})}computeFocusBounds(t){if(t instanceof LM){const{x:e,y:i,width:o,height:s}=t,n=new rW(e,i,o,s);return nW.toCanvas(this.contentGroup,n)}return t}};Wu.className="SankeySeries",Wu.type="sankey";var lW={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["flow-proportion"],solo:!0,identifier:"sankey",moduleFactory:t=>new Wu(t),tooltipDefaults:{range:"exact"},themeTemplate:{seriesArea:{padding:{top:10,bottom:10}},series:{highlightStyle:{series:{dimOpacity:.2}},label:{fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:10},node:{spacing:20,width:10,strokeWidth:0},link:{fillOpacity:.5,strokeWidth:0}},legend:{enabled:!1,toggleSeries:!1}},paletteFactory({takeColors:t,colorsCount:e}){return t(e)}};import{_ModuleSupport as cW}from"ag-charts-community";import{_ModuleSupport as Hu}from"ag-charts-community";import{_ModuleSupport as hW}from"ag-charts-community";var{HierarchySeriesProperties:dW,HighlightStyle:pW,SeriesTooltip:uW,Validate:Vt,COLOR_STRING:gW,FUNCTION:yW,NUMBER:RM,OBJECT:Un,POSITIVE_NUMBER:Ku,RATIO:Dc,STRING:Tc}=hW,Qo=class extends pW{constructor(){super(...arguments),this.label=new Fi,this.secondaryLabel=new Fi}};d([Vt(Tc,{optional:!0})],Qo.prototype,"fill",2),d([Vt(Dc,{optional:!0})],Qo.prototype,"fillOpacity",2),d([Vt(gW,{optional:!0})],Qo.prototype,"stroke",2),d([Vt(Ku,{optional:!0})],Qo.prototype,"strokeWidth",2),d([Vt(Dc,{optional:!0})],Qo.prototype,"strokeOpacity",2),d([Vt(Un)],Qo.prototype,"label",2),d([Vt(Un)],Qo.prototype,"secondaryLabel",2);var Ae=class extends dW{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=0,this.strokeOpacity=1,this.cornerRadius=0,this.highlightStyle=new Qo,this.label=new Fi,this.secondaryLabel=new Ua,this.tooltip=new uW}};d([Vt(Tc,{optional:!0})],Ae.prototype,"sizeName",2),d([Vt(Tc,{optional:!0})],Ae.prototype,"labelKey",2),d([Vt(Tc,{optional:!0})],Ae.prototype,"secondaryLabelKey",2),d([Vt(Dc)],Ae.prototype,"fillOpacity",2),d([Vt(Ku)],Ae.prototype,"strokeWidth",2),d([Vt(Dc)],Ae.prototype,"strokeOpacity",2),d([Vt(Ku)],Ae.prototype,"cornerRadius",2),d([Vt(RM,{optional:!0})],Ae.prototype,"sectorSpacing",2),d([Vt(RM,{optional:!0})],Ae.prototype,"padding",2),d([Vt(yW,{optional:!0})],Ae.prototype,"itemStyler",2),d([Vt(Un)],Ae.prototype,"highlightStyle",2),d([Vt(Un)],Ae.prototype,"label",2),d([Vt(Un)],Ae.prototype,"secondaryLabel",2),d([Vt(Un)],Ae.prototype,"tooltip",2);var{fromToMotion:fW,normalizeAngle360:mW,createDatumId:xW,Sector:Uu,Group:Cc,ScalableGroup:SW,Selection:Yu,TransformableText:ju,applyShapeStyle:bW}=Hu,vW=class extends Hu.HierarchyNode{constructor(){super(...arguments),this.label=void 0,this.secondaryLabel=void 0,this.contentHeight=0,this.bbox=void 0,this.startAngle=0,this.endAngle=0}};function EM(t,e=0,i=2*Math.PI/t.sumSize){for(const o of t.children){const s=e+o.sumSize*i;o.startAngle=e,o.endAngle=s,EM(o,e,i),e=s}}var Xu=class extends Hu.HierarchySeries{constructor(){super(...arguments),this.NodeClass=vW,this.properties=new Ae,this.scalingGroup=this.contentGroup.appendChild(new SW),this.sectorGroup=this.scalingGroup.appendChild(new Cc),this.sectorLabelGroup=this.scalingGroup.appendChild(new Cc),this.highlightSectorGroup=this.scalingGroup.appendChild(new Cc),this.datumSelection=Yu.select(this.sectorGroup,Uu),this.labelSelection=Yu.select(this.sectorLabelGroup,Cc),this.highlightSelection=Yu.select(this.highlightSectorGroup,Uu)}processData(){super.processData(),EM(this.rootNode)}updateSelections(){const t=this.ctx.highlightManager?.getActiveHighlight();if(this.highlightSelection.update(t!=null?[t]:[],void 0,n=>this.getDatumId(n)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{chart:e}=this;if(e==null||e.seriesRect==null)return;const o=Array.from(this.rootNode),s=n=>{n.append([new ju({tag:0}),new ju({tag:1})])};this.datumSelection.update(o,void 0,n=>this.getDatumId(n)),this.labelSelection.update(o,s,n=>this.getDatumId(n))}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle:void 0;return{fill:i?.fill,fillOpacity:i?.fillOpacity??e.fillOpacity,stroke:i?.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity}}getItemStyleOverrides(t,e,i,o,s,n){const{id:a,properties:r,colorScale:l}=this,{fills:c,strokes:h,itemStyler:p}=r,u=t[0],g=s.fill??c[u%c.length],y=s.stroke??h[u%h.length],f={};if(n||(f.fill=o!=null?l.convert(o):g,f.stroke=y),p!=null){const m=this.cachedDatumCallback(xW(t.join(":"),n?"highlight":"node"),()=>p({seriesId:a,datum:e,depth:i,highlighted:n,fill:g,stroke:y,...s}));Object.assign(f,m)}return f}updateNodes(){const{chart:t,data:e,maxDepth:i}=this;if(t==null||e==null)return;const{width:o,height:s}=t.seriesRect,{sectorSpacing:n=0,padding:a=0,cornerRadius:r,childrenKey:l,colorKey:c,colorName:h,labelKey:p,secondaryLabelKey:u,sizeKey:g,sizeName:y}=this.properties;this.contentGroup.translationX=o/2,this.contentGroup.translationY=s/2;const f=n*.5,x=Math.min(o,s)/2/(i+1),v=-Math.PI/2;this.rootNode?.walk(A=>{const{startAngle:T,endAngle:N}=A;if(A.depth!=null){const L=(T+N)/2+v,D=(A.depth+.5)*x;A.midPoint.x=Math.cos(L)*D,A.midPoint.y=Math.sin(L)*D}}),this.rootNode?.walk(A=>{const{datum:T,depth:N,startAngle:L,endAngle:D,parent:C,sumSize:O}=A;A.label=void 0,A.secondaryLabel=void 0,A.contentHeight=0;let w;if(T!=null&&N!=null&&p!=null){const rt=T[p];w=this.getLabelText(this.properties.label,{depth:N,datum:T,childrenKey:l,colorKey:c,colorName:h,labelKey:p,secondaryLabelKey:u,sizeKey:g,sizeName:y,value:rt})}w===""&&(w=void 0);let P;if(T!=null&&N!=null&&u!=null){const rt=T[u];P=this.getLabelText(this.properties.secondaryLabel,{depth:N,datum:T,childrenKey:l,colorKey:c,colorName:h,labelKey:p,secondaryLabelKey:u,sizeKey:g,sizeName:y,value:rt})}if(P===""&&(P=void 0),N==null)return;const B=N*x+f,z=(N+1)*x-f,_=B>f?f/B:f,R=z>f?f/z:f,E=L+_,F=D+_-E,G=L+R,K=D+R-G,j=rt=>{if(N===0&&C?.sumSize===O)return{width:2*Math.sqrt(z**2-(rt*.5)**2),height:rt,meta:0};const yt=rt,Ut=2*Math.sqrt(z**2-(B+yt)**2),Ui=F=bo?{width:Ue,height:yt,meta:1}:{width:bo,height:Ye,meta:2}},Z=Dp(w,this.properties.label,P,this.properties.secondaryLabel,{padding:a},j);if(Z==null)return;const{width:J,height:tt,meta:Q,label:U,secondaryLabel:q}=Z,it=v+(L+D)/2,X=Math.sin(it)>=0,Ot=Math.cos(it)>=0,It=(X?3:12)&(Ot?6:9);let at;switch(Q){case 0:at=0;break;case 1:{const gt=z-(x-tt)*.58,yt=Math.sqrt((z-a)**2-(J/2)**2);at=Math.min(gt,yt);break}case 2:if(N===0){const rt=tt/(2*Math.tan(F*.5))+J*.5,gt=Math.sqrt(z**2-(tt*.5)**2)-J*.5;at=(rt+gt)*.5}else at=(B+z)*.5;break}if(U!=null){const{fontStyle:rt="normal",fontFamily:gt,fontWeight:yt="normal",color:Ut="black"}=this.properties.label;A.label={...U,fontStyle:rt,fontFamily:gt,fontWeight:yt,color:Ut,labelPlacement:Q,circleQuarter:It,radius:at,theta:it}}if(q!=null){const{fontStyle:rt="normal",fontFamily:gt,fontWeight:yt="normal",color:Ut="black"}=this.properties.secondaryLabel;A.secondaryLabel={...q,fontStyle:rt,fontFamily:gt,fontWeight:yt,color:Ut,labelPlacement:Q,circleQuarter:It,radius:at,theta:it}}A.contentHeight=Z.height});const S=(A,T,N,L)=>{const{datum:D,datumIndex:C,depth:O,colorValue:w,startAngle:P,endAngle:B}=A;if(O==null){T.visible=!1;return}T.visible=!0;const z=this.getItemStyleOverrides(C,D,O,w,N,L),_=z.strokeWidth??N.strokeWidth;bW(T,N,z),T.centerX=0,T.centerY=0,T.innerRadius=O*x,T.outerRadius=(O+1)*x,T.startAngle=P+v,T.endAngle=B+v,T.inset=f+_*.5,T.cornerRadius=r},b=this.getItemBaseStyle(!1);this.datumSelection.each((A,T)=>{S(T,A,b,!1)});const k=this.getItemBaseStyle(!0);this.highlightSelection.each((A,T)=>{S(T,A,k,!0)});const I=(A,T,N,L)=>{const{depth:D,contentHeight:C}=A,O=N===0,w=O?A.label:A.secondaryLabel;if(D==null||w==null){T.visible=!1;return}const{labelPlacement:P,circleQuarter:B,radius:z,theta:_}=w;let R;switch(L&&(R=(O?this.properties.highlightStyle.label:this.properties.highlightStyle.secondaryLabel).color),T.text=w.text,T.fontSize=w.fontSize,T.lineHeight=w.lineHeight,T.fontStyle=w.fontStyle,T.fontFamily=w.fontFamily,T.fontWeight=w.fontWeight,T.fill=R??w.color,P){case 0:T.textAlign="center",T.textBaseline="top",T.translationX=0,T.translationY=(O?0:C-w.height)-C*.5,T.rotation=0;break;case 1:{const E=(B&3)!==0,V=O===!E?z:z-(C-w.height);T.textAlign="center",T.textBaseline=E?"bottom":"top",T.translationX=Math.cos(_)*V,T.translationY=Math.sin(_)*V,T.rotation=E?_-Math.PI*.5:_+Math.PI*.5;break}case 2:{const E=(B&6)!==0,V=O===!E?(C-w.height)*.5:(w.height-C)*.5;T.textAlign="center",T.textBaseline="middle",T.translationX=Math.cos(_)*z+Math.cos(_+Math.PI/2)*V,T.translationY=Math.sin(_)*z+Math.sin(_+Math.PI/2)*V,T.rotation=E?_:_+Math.PI;break}}T.visible=!0},M=this.ctx.highlightManager?.getActiveHighlight();this.labelSelection.selectByClass(ju).forEach(A=>{I(A.datum,A,A.tag,A.datum===M)})}getTooltipContent(t){const{id:e,properties:i}=this,{labelKey:o,secondaryLabelKey:s,childrenKey:n,sizeKey:a,sizeName:r,colorKey:l,colorName:c,tooltip:h}=i,{datum:p,datumIndex:u,depth:g}=t;if(p==null||g==null)return;const y=[],f=a!=null?p[a]:void 0;f!=null&&y.push({label:r,fallbackLabel:a,value:f});const m=l!=null?p[l]:void 0;m!=null&&y.push({label:c,fallbackLabel:l,value:m});const x=this.getItemBaseStyle(!1);Object.assign(x,this.getItemStyleOverrides(u,p,g,m,x,!1));const v=x.fill;return h.formatTooltip({title:o!=null?p[o]:void 0,symbol:{marker:{shape:"square",fill:v,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}},data:y},{seriesId:e,datum:p,title:void 0,depth:g,labelKey:o,secondaryLabelKey:s,childrenKey:n,sizeKey:a,sizeName:r,colorKey:l,colorName:c,...x})}createNodeData(){}pickNodeClosestDatum(t){return this.pickNodeNearestDistantObject(t,this.datumSelection.selectByClass(Uu))}animateEmptyUpdateReady(){fW(this.id,"nodes",this.ctx.animationManager,[this.scalingGroup],{toFn(){return{scalingX:1,scalingY:1}},fromFn(){return{scalingX:0,scalingY:0}}})}computeFocusBounds(t){return t}};Xu.className="SunburstSeries",Xu.type="sunburst";var{FONT_SIZE_RATIO:wM,ThemeSymbols:{DEFAULT_DIVERGING_SERIES_COLOR_RANGE:MW}}=cW,kW={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["hierarchy"],identifier:"sunburst",moduleFactory:t=>new Xu(t),tooltipDefaults:{range:"exact"},solo:!0,themeTemplate:{series:{label:{fontFamily:{$ref:"fontFamily"},fontSize:{$rem:[wM.LARGE]},minimumFontSize:{$round:[{$mul:[{$ref:"fontSize"},9/12]}]},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"},overflowStrategy:"ellipsis",wrapping:"never",spacing:2},secondaryLabel:{fontFamily:{$ref:"fontFamily"},fontSize:{$rem:[wM.SMALLEST]},minimumFontSize:{$round:[{$mul:[{$ref:"fontSize"},7/12]}]},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"},overflowStrategy:"ellipsis",wrapping:"never"},sectorSpacing:2,padding:3,highlightStyle:{label:{color:{$ref:"backgroundColor"}},secondaryLabel:{color:{$ref:"backgroundColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2}},gradientLegend:{enabled:!0}},paletteFactory:({takeColors:t,colorsCount:e,themeTemplateParameters:i})=>{const{fills:o,strokes:s}=t(e),n=i.get(MW);return{fills:o,strokes:s,colorRange:n}}};import{_ModuleSupport as AW}from"ag-charts-community";import{_ModuleSupport as Nc}from"ag-charts-community";import{_ModuleSupport as IW}from"ag-charts-community";var{BaseProperties:Oc,HierarchySeriesProperties:DW,HighlightStyle:TW,SeriesTooltip:CW,Validate:$,BOOLEAN:NW,COLOR_STRING:Lc,FUNCTION:OW,NUMBER:LW,OBJECT:si,POSITIVE_NUMBER:Ki,RATIO:qo,STRING:Ks,STRING_ARRAY:PM,TEXT_ALIGN:_M,VERTICAL_ALIGN:RW,Label:EW}=IW,BM=class extends EW{constructor(){super(...arguments),this.spacing=0}};d([$(LW)],BM.prototype,"spacing",2);var ni=class extends Oc{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.cornerRadius=0,this.textAlign="center",this.gap=0,this.padding=0,this.interactive=!0,this.label=new BM}};d([$(Ks,{optional:!0})],ni.prototype,"fill",2),d([$(qo)],ni.prototype,"fillOpacity",2),d([$(Lc,{optional:!0})],ni.prototype,"stroke",2),d([$(Ki)],ni.prototype,"strokeWidth",2),d([$(qo)],ni.prototype,"strokeOpacity",2),d([$(Ki)],ni.prototype,"cornerRadius",2),d([$(_M)],ni.prototype,"textAlign",2),d([$(Ki)],ni.prototype,"gap",2),d([$(Ki)],ni.prototype,"padding",2),d([$(NW)],ni.prototype,"interactive",2),d([$(si)],ni.prototype,"label",2);var Ke=class extends Oc{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.cornerRadius=0,this.textAlign="center",this.verticalAlign="middle",this.gap=0,this.padding=0,this.label=new Fi,this.secondaryLabel=new Ua}};d([$(Ks,{optional:!0})],Ke.prototype,"fill",2),d([$(qo)],Ke.prototype,"fillOpacity",2),d([$(Lc,{optional:!0})],Ke.prototype,"stroke",2),d([$(Ki,{optional:!0})],Ke.prototype,"strokeWidth",2),d([$(qo)],Ke.prototype,"strokeOpacity",2),d([$(Ki)],Ke.prototype,"cornerRadius",2),d([$(_M)],Ke.prototype,"textAlign",2),d([$(RW)],Ke.prototype,"verticalAlign",2),d([$(Ki)],Ke.prototype,"gap",2),d([$(Ki)],Ke.prototype,"padding",2),d([$(si)],Ke.prototype,"label",2),d([$(si)],Ke.prototype,"secondaryLabel",2);var Us=class extends Oc{constructor(){super(...arguments),this.label=new Fi}};d([$(Ks,{optional:!0})],Us.prototype,"fill",2),d([$(qo,{optional:!0})],Us.prototype,"fillOpacity",2),d([$(Lc,{optional:!0})],Us.prototype,"stroke",2),d([$(Ki,{optional:!0})],Us.prototype,"strokeWidth",2),d([$(qo,{optional:!0})],Us.prototype,"strokeOpacity",2),d([$(si)],Us.prototype,"label",2);var Jo=class extends Oc{constructor(){super(...arguments),this.label=new Fi,this.secondaryLabel=new Ua}};d([$(Ks,{optional:!0})],Jo.prototype,"fill",2),d([$(qo,{optional:!0})],Jo.prototype,"fillOpacity",2),d([$(Lc,{optional:!0})],Jo.prototype,"stroke",2),d([$(Ki,{optional:!0})],Jo.prototype,"strokeWidth",2),d([$(qo,{optional:!0})],Jo.prototype,"strokeOpacity",2),d([$(si)],Jo.prototype,"label",2),d([$(si)],Jo.prototype,"secondaryLabel",2);var $u=class extends TW{constructor(){super(...arguments),this.group=new Us,this.tile=new Jo}};d([$(si)],$u.prototype,"group",2),d([$(si)],$u.prototype,"tile",2);var Ai=class extends DW{constructor(){super(...arguments),this.highlightStyle=new $u,this.tooltip=new CW,this.group=new ni,this.tile=new Ke,this.undocumentedGroupFills=[],this.undocumentedGroupStrokes=[]}};d([$(Ks,{optional:!0})],Ai.prototype,"sizeName",2),d([$(Ks,{optional:!0})],Ai.prototype,"labelKey",2),d([$(Ks,{optional:!0})],Ai.prototype,"secondaryLabelKey",2),d([$(OW,{optional:!0})],Ai.prototype,"itemStyler",2),d([$(si)],Ai.prototype,"highlightStyle",2),d([$(si)],Ai.prototype,"tooltip",2),d([$(si)],Ai.prototype,"group",2),d([$(si)],Ai.prototype,"tile",2),d([$(PM)],Ai.prototype,"undocumentedGroupFills",2),d([$(PM)],Ai.prototype,"undocumentedGroupStrokes",2);var{TextUtils:wW,TextWrapper:PW,isNumberEqual:_W,createDatumId:zM,Rect:VM,Group:FM,BBox:Rc,Selection:Zu,Text:Ec,Transformable:BW,applyShapeStyle:zW}=Nc,VW=class extends Nc.HierarchyNode{constructor(){super(...arguments),this.labelValue=void 0,this.secondaryLabelValue=void 0,this.label=void 0,this.secondaryLabel=void 0,this.bbox=void 0,this.padding=void 0}},GM=new Ec;function FW(t,e){const{fontStyle:i,fontWeight:o,fontSize:s,fontFamily:n}=e;GM.setProperties({text:t,fontStyle:i,fontWeight:o,fontSize:s,fontFamily:n,textAlign:"left",textBaseline:"top"});const{width:a,height:r}=GM.getBBox();return{width:a,height:r}}function ts(t){return t.children.length>0?t.sumSize-t.sizeValue:t.sizeValue}var WM={left:0,center:.5,right:1},GW={top:0,middle:.5,bottom:1},IU=class extends Nc.Group{distanceSquared(t,e){return this.getBBox().distanceSquared(t,e)}},Qu=class extends Nc.HierarchySeries{constructor(){super(...arguments),this.NodeClass=VW,this.properties=new Ai,this.rectGroup=this.contentGroup.appendChild(new FM),this.datumSelection=Zu.select(this.rectGroup,VM),this.labelSelection=Zu.select(this.labelGroup,FM),this.highlightSelection=Zu.select(this.rectGroup,VM)}groupTitleHeight(t,e){const{labelValue:i}=t,{label:o}=this.properties.group,s=3;if(i!=null){if(o.fontSize>e.width/s||o.fontSize>e.height/s)return;{const{height:n}=FW(i,o);return Math.max(n,o.fontSize)}}}getNodePadding(t,e){if(t.parent==null)return{top:0,right:0,bottom:0,left:0};if(t.children.length===0){const{padding:a}=this.properties.tile;return{top:a,right:a,bottom:a,left:a}}const{label:{spacing:i},padding:o}=this.properties.group,s=this.groupTitleHeight(t,e),n=s!=null?s+i:0;return{top:o+n,right:o,bottom:o,left:o}}sortChildren({children:t}){const e=Array.from(t,(o,s)=>s).filter(o=>ts(t[o])>0).sort((o,s)=>ts(t[s])-ts(t[o]));return{sortedChildrenIndices:e,childAt:o=>{const s=e[o];return t[s]}}}squarify(t,e){const{datum:i,children:o}=t;if(e.width<=0||e.height<=0){t.bbox=void 0,t.padding=void 0,t.midPoint.x=NaN,t.midPoint.y=NaN;return}const s=i!=null?this.getNodePadding(t,e):{top:0,right:0,bottom:0,left:0};t.parent==null?(t.bbox=void 0,t.padding=void 0,t.midPoint.x=NaN,t.midPoint.y=NaN):(t.bbox=e,t.padding=s,t.midPoint.x=e.x+e.width/2,t.midPoint.y=e.y);const{sortedChildrenIndices:n,childAt:a}=this.sortChildren(t),r=n.every(k=>o[k].children.length===0),l=1,c=e.width-s.left-s.right,h=e.height-s.top-s.bottom;if(c<=0||h<=0)return;const p=n.length;let u=0,g=0,y=1/0,f=n.reduce((k,I)=>k+ts(o[I]),0);const m=new Rc(e.x+s.left,e.y+s.top,c,h),x=m.clone();let v=0;for(;v({left:l.x,top:l.y,right:l.x+l.width,bottom:l.y+l.height}),n=s(t),a=s(e);["top","right","bottom","left"].forEach(l=>{_W(n[l],a[l])||e.shrink(o,l)})}createNodeData(){}getGroupBaseStyle(t){const{properties:e}=this,{group:i}=e,o=t?e.highlightStyle.group:void 0;return{fill:o?.fill??i.fill,fillOpacity:o?.fillOpacity??i.fillOpacity,stroke:o?.stroke??i.stroke,strokeWidth:o?.strokeWidth??i.strokeWidth,strokeOpacity:o?.strokeOpacity??i.strokeOpacity}}getGroupStyleOverrides(t,e,i,o,s){const{id:n,properties:a}=this,{undocumentedGroupFills:r,undocumentedGroupStrokes:l,itemStyler:c}=a,h=o.fill??r[Math.min(i??0,r.length)],p=o.stroke??l[Math.min(i??0,l.length)],u={};if(s||(u.fill=h,u.stroke=p),c!=null){const g=this.cachedDatumCallback(zM(t.join(":"),s?"highlight":"node"),()=>c({seriesId:n,datum:e,depth:i,highlighted:s,fill:h,stroke:p,...o}));Object.assign(u,g)}return u}getTileBaseStyle(t){const{properties:e}=this,{tile:i}=e,o=t?e.highlightStyle.tile:void 0;return{fill:o?.fill??i.fill,fillOpacity:o?.fillOpacity??i.fillOpacity,stroke:o?.stroke??i.stroke,strokeWidth:o?.strokeWidth??i.strokeWidth,strokeOpacity:o?.strokeOpacity??i.strokeOpacity}}getTileStyleOverrides(t,e,i,o,s,n){const{id:a,properties:r,colorScale:l}=this,{fills:c,strokes:h,itemStyler:p}=r,u=t[0],g=s.fill??c[u%c.length],y=s.stroke??h[u%h.length],f={};if(n||(f.fill=o!=null?l.convert(o):g,f.stroke=y),p!=null){const m=this.cachedDatumCallback(zM(t.join(":"),n?"highlight":"node"),()=>p({seriesId:a,datum:e,depth:i,highlighted:n,fill:g,stroke:y,...s}));Object.assign(f,m)}return f}updateSelections(){let t=this.ctx.highlightManager?.getActiveHighlight();if(t!=null&&!this.properties.group.interactive&&t.children.length!==0&&(t=void 0),this.highlightSelection.update(t!=null?[t]:[],void 0,s=>this.getDatumId(s)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{seriesRect:e}=this.chart??{};if(!e)return;const i=Array.from(this.rootNode),o=s=>{s.append([new Ec({tag:0}),new Ec({tag:1})])};this.datumSelection.update(i,void 0,s=>this.getDatumId(s)),this.labelSelection.update(i,o,s=>this.getDatumId(s))}updateNodes(){const{rootNode:t,data:e}=this,{childrenKey:i,colorKey:o,colorName:s,labelKey:n,secondaryLabelKey:a,sizeKey:r,sizeName:l,highlightStyle:c,tile:h,group:p}=this.properties,{seriesRect:u}=this.chart??{};if(!u||!e)return;this.rootNode?.walk(I=>{const{datum:M,depth:A,children:T}=I,N=T.length===0,L=N?h.label:p.label;let D;if(M!=null&&A!=null&&n!=null){const O=M[n];D=this.getLabelText(L,{depth:A,datum:M,childrenKey:i,colorKey:o,colorName:s,labelKey:n,secondaryLabelKey:a,sizeKey:r,sizeName:l,value:O})}D===""&&(D=void 0);let C;if(N&&M!=null&&A!=null&&a!=null){const O=M[a];C=this.getLabelText(h.secondaryLabel,{depth:A,datum:M,childrenKey:i,colorKey:o,colorName:s,labelKey:n,secondaryLabelKey:a,sizeKey:r,sizeName:l,value:O})}C===""&&(C=void 0),I.labelValue=D,I.secondaryLabelValue=C});const{width:g,height:y}=u;this.squarify(t,new Rc(0,0,g,y)),this.rootNode?.walk(I=>{const{bbox:M,children:A,labelValue:T,secondaryLabelValue:N}=I;if(I.label=void 0,I.secondaryLabel=void 0,M!=null)if(A.length===0){const L={width:M.width,height:M.height,meta:null},D=Dp(T,this.properties.tile.label,N,this.properties.tile.secondaryLabel,{padding:h.padding},()=>L);if(D==null)return;const{height:C,label:O,secondaryLabel:w}=D,{textAlign:P,verticalAlign:B,padding:z}=h,_=WM[P]??.5,R=M.x+z+(M.width-2*z)*_,E=GW[B]??.5,V=M.y+z+C*.5+(M.height-2*z-C)*E;if(O!=null){const{fontStyle:F="normal",fontFamily:G,fontWeight:W="normal",color:K="black"}=this.properties.tile.label;I.label={text:O.text,fontSize:O.fontSize,lineHeight:O.lineHeight,fontStyle:F,fontFamily:G,fontWeight:W,color:K,textAlign:P,verticalAlign:"middle",x:R,y:V-(C-O.height)*.5}}if(w!=null){const{fontStyle:F="normal",fontFamily:G,fontWeight:W="normal",color:K="black"}=this.properties.tile.secondaryLabel;I.secondaryLabel={text:w.text,fontSize:w.fontSize,lineHeight:w.fontSize,fontStyle:F,fontFamily:G,fontWeight:W,color:K,textAlign:P,verticalAlign:"middle",x:R,y:V+(C-w.height)*.5}}}else{if(T==null)return;{const{padding:L,textAlign:D}=p,C=this.groupTitleHeight(I,M);if(C==null)return;const O=M.width-2*L,w=PW.wrapText(T,{maxWidth:M.width-2*L,font:p.label,textWrap:"never"}),P=WM[D]??.5,{fontStyle:B="normal",fontFamily:z,fontWeight:_="normal",color:R="black"}=this.properties.group.label;I.label={text:w,fontSize:p.label.fontSize,lineHeight:wW.getLineHeight(p.label.fontSize),fontStyle:B,fontFamily:z,fontWeight:_,color:R,textAlign:D,verticalAlign:"middle",x:M.x+L+O*P,y:M.y+L+C*.5}}}});const f=(I,M,A,T,N)=>{const{bbox:L}=I;if(L==null){M.visible=!1;return}const{datum:D,depth:C=-1,datumIndex:O,colorValue:w}=I,P=I.children.length===0,B=P?T:A,z=P?this.getTileStyleOverrides(O,D,C,w,B,N):this.getGroupStyleOverrides(O,D,C,B,N);M.crisp=!0,zW(M,B,z),M.cornerRadius=P?h.cornerRadius:p.cornerRadius,M.zIndex=[0,C,N?1:0];const _=I.parent?.children.every(V=>V.children.length===0),R=I.parent!=null?I.parent.bbox:void 0,E=I.parent!=null?I.parent.padding:void 0;_===!0&&R!=null&&E!=null?(M.clipBBox=L,M.x=R.x+E.left,M.y=R.y+E.top,M.width=R.width-(E.left+E.right),M.height=R.height-(E.top+E.bottom)):(M.clipBBox=void 0,M.x=L.x,M.y=L.y,M.width=L.width,M.height=L.height),M.visible=!0},m=this.getGroupBaseStyle(!1),x=this.getTileBaseStyle(!1);this.datumSelection.each((I,M)=>f(M,I,m,x,!1));const v=this.getGroupBaseStyle(!0),S=this.getTileBaseStyle(!0);this.highlightSelection.each((I,M)=>{f(M,I,v,S,!0)});const b=(I,M,A,T)=>{const N=I.children.length===0,L=A===0?I.label:I.secondaryLabel;if(L==null){M.visible=!1;return}let D;if(T){const{tile:C,group:O}=c;D=C.secondaryLabel.color,N?A===0&&(D=C.label.color):D=O.label.color}M.text=L.text,M.fontSize=L.fontSize,M.lineHeight=L.lineHeight,M.fontStyle=L.fontStyle,M.fontFamily=L.fontFamily,M.fontWeight=L.fontWeight,M.fill=D??L.color,M.textAlign=L.textAlign,M.textBaseline=L.verticalAlign,M.x=L.x,M.y=L.y,M.visible=!0,M.zIndex=1},k=this.ctx.highlightManager?.getActiveHighlight();this.labelSelection.selectByClass(Ec).forEach(I=>{b(I.datum,I,I.tag,I.datum===k)})}pickNodeClosestDatum(t){const e=this.pickNodeExactShape(t);return e!==void 0?e:this.pickNodeNearestDistantObject(t,this.datumSelection.nodes())}getTooltipContent(t){const{id:e,properties:i}=this,{labelKey:o,secondaryLabelKey:s,childrenKey:n,sizeKey:a,sizeName:r,colorKey:l,colorName:c,tooltip:h}=i,{datum:p,datumIndex:u,depth:g,children:y}=t;if(p==null||g==null)return;const f=y.length===0,m=[],x=a!=null?p[a]:void 0;x!=null&&m.push({label:r,fallbackLabel:a,value:x});const v=l!=null?p[l]:void 0;v!=null&&m.push({label:c,fallbackLabel:l,value:v});let S;f?(S=this.getTileBaseStyle(!1),Object.assign(S,this.getTileStyleOverrides(u,p,g,v,S,!1))):(S=this.getGroupBaseStyle(!1),Object.assign(S,this.getGroupStyleOverrides(u,p,g,S,!1)));const b=S.fill,k=f?{marker:{shape:"square",fill:b,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}}:void 0;return h.formatTooltip({title:o!=null?p[o]:void 0,symbol:k,data:m},{seriesId:e,datum:p,title:void 0,depth:g,labelKey:o,secondaryLabelKey:s,childrenKey:n,sizeKey:a,sizeName:r,colorKey:l,colorName:c,...S})}computeFocusBounds(t){return BW.toCanvas(this.contentGroup,t.getBBox())}};Qu.className="TreemapSeries",Qu.type="treemap";var{FONT_SIZE_RATIO:HM,ThemeSymbols:{DEFAULT_DIVERGING_SERIES_COLOR_RANGE:WW,DEFAULT_HIERARCHY_FILLS:HW,DEFAULT_HIERARCHY_STROKES:KW}}=AW,UW={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["hierarchy"],identifier:"treemap",moduleFactory:t=>new Qu(t),tooltipDefaults:{range:"exact"},solo:!0,themeTemplate:{series:{group:{label:{enabled:!0,color:{$ref:"textColor"},fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},spacing:4},fill:void 0,stroke:void 0,strokeWidth:1,padding:4,gap:2,textAlign:"left"},tile:{label:{enabled:!0,color:{$ref:"backgroundColor"},fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.5]},minimumFontSize:{$rem:[HM.SMALLER]},fontFamily:{$ref:"fontFamily"},wrapping:"on-space",overflowStrategy:"ellipsis",spacing:2},secondaryLabel:{enabled:!0,color:{$ref:"backgroundColor"},fontStyle:void 0,fontWeight:void 0,fontSize:{$ref:"fontSize"},minimumFontSize:{$rem:[HM.SMALLER]},fontFamily:{$ref:"fontFamily"},wrapping:"never",overflowStrategy:"ellipsis"},fill:void 0,stroke:void 0,strokeWidth:0,padding:3,gap:1},highlightStyle:{group:{label:{color:{$ref:"textColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2},tile:{label:{color:{$ref:"backgroundColor"}},secondaryLabel:{color:{$ref:"backgroundColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2}}},gradientLegend:{enabled:!0}},paletteFactory:({takeColors:t,colorsCount:e,themeTemplateParameters:i})=>{const{fills:o,strokes:s}=t(e),n=i.get(WW),a=i.get(HW),r=i.get(KW);return{fills:o,strokes:s,colorRange:n,undocumentedGroupFills:a,undocumentedGroupStrokes:r}}};import{_ModuleSupport as KM}from"ag-charts-community";import{_ModuleSupport as Ys}from"ag-charts-community";import{_ModuleSupport as YW}from"ag-charts-community";var{AbstractBarSeriesProperties:jW,BaseProperties:sr,PropertiesArray:XW,SeriesTooltip:$W,Validate:st,BOOLEAN:ZW,COLOR_STRING:qu,FUNCTION:UM,LINE_DASH:YM,NUMBER:QW,OBJECT:mo,OBJECT_ARRAY:qW,POSITIVE_NUMBER:Yn,RATIO:Ju,STRING:jn,UNION:jM,DropShadow:JW,Label:t4}=YW,wc=class extends sr{};d([st(jM(["subtotal","total"],"a total type"))],wc.prototype,"totalType",2),d([st(QW)],wc.prototype,"index",2),d([st(jn)],wc.prototype,"axisLabel",2);var XM=class extends sr{};d([st(UM,{optional:!0})],XM.prototype,"renderer",2);var tg=class extends t4{constructor(){super(...arguments),this.placement="outside-end",this.padding=6}};d([st(jM(["inside-center","inside-start","inside-end","outside-start","outside-end"],"a placement"))],tg.prototype,"placement",2),d([st(Yn)],tg.prototype,"padding",2);var be=class extends sr{constructor(){super(...arguments),this.fill="#c16068",this.stroke="#c16068",this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=1,this.cornerRadius=0,this.shadow=new JW().set({enabled:!1}),this.label=new tg,this.tooltip=new XM}};d([st(jn,{optional:!0})],be.prototype,"name",2),d([st(qu)],be.prototype,"fill",2),d([st(qu)],be.prototype,"stroke",2),d([st(Ju)],be.prototype,"fillOpacity",2),d([st(Ju)],be.prototype,"strokeOpacity",2),d([st(YM)],be.prototype,"lineDash",2),d([st(Yn)],be.prototype,"lineDashOffset",2),d([st(Yn)],be.prototype,"strokeWidth",2),d([st(Yn)],be.prototype,"cornerRadius",2),d([st(UM,{optional:!0})],be.prototype,"itemStyler",2),d([st(mo)],be.prototype,"shadow",2),d([st(mo)],be.prototype,"label",2),d([st(mo)],be.prototype,"tooltip",2);var js=class extends sr{constructor(){super(...arguments),this.enabled=!0,this.stroke="black",this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=2}};d([st(ZW)],js.prototype,"enabled",2),d([st(qu)],js.prototype,"stroke",2),d([st(Ju)],js.prototype,"strokeOpacity",2),d([st(YM)],js.prototype,"lineDash",2),d([st(Yn)],js.prototype,"lineDashOffset",2),d([st(Yn)],js.prototype,"strokeWidth",2);var Pc=class extends sr{constructor(){super(...arguments),this.positive=new be,this.negative=new be,this.total=new be}};d([st(mo)],Pc.prototype,"positive",2),d([st(mo)],Pc.prototype,"negative",2),d([st(mo)],Pc.prototype,"total",2);var xo=class extends jW{constructor(){super(...arguments),this.item=new Pc,this.totals=new XW(wc),this.line=new js,this.tooltip=new $W}};d([st(jn)],xo.prototype,"xKey",2),d([st(jn)],xo.prototype,"yKey",2),d([st(jn,{optional:!0})],xo.prototype,"xName",2),d([st(jn,{optional:!0})],xo.prototype,"yName",2),d([st(mo)],xo.prototype,"item",2),d([st(qW)],xo.prototype,"totals",2),d([st(mo)],xo.prototype,"line",2),d([st(mo)],xo.prototype,"tooltip",2);var{adjustLabelPlacement:e4,SeriesNodePickMode:$M,fixNumericExtent:i4,valueProperty:ZM,keyProperty:o4,accumulativeValueProperty:_c,trailingAccumulatedValueProperty:s4,ChartAxisDirection:eg,createDatumId:n4,checkCrisp:a4,updateLabelNode:r4,prepareBarAnimationFunctions:l4,collapsedStartingBarPosition:c4,resetBarSelectionsFn:h4,seriesLabelFadeInAnimation:d4,resetLabelFn:p4,animationValidation:u4,DEFAULT_CARTESIAN_DIRECTION_KEYS:g4,DEFAULT_CARTESIAN_DIRECTION_NAMES:y4,computeBarFocusBounds:f4,isContinuous:QM,Rect:m4,motion:x4,applyShapeStyle:S4}=Ys,ig=class extends Ys.AbstractBarSeries{constructor(t){super({moduleCtx:t,directionKeys:g4,directionNames:y4,pickModes:[$M.NEAREST_NODE,$M.EXACT_SHAPE_MATCH],pathsPerSeries:["connector"],hasHighlightedLabels:!0,pathsZIndexSubOrderOffset:[-1,-1],animationResetFns:{datum:h4,label:p4}}),this.properties=new xo,this.seriesItemTypes=new Set(["positive","negative","total"])}async processData(t){const{xKey:e,yKey:i,totals:o}=this.properties,{data:s=[]}=this;if(!this.properties.isValid()||!this.visible)return;const n=v=>QM(v)&&Number(v)>=0,a=v=>QM(v)&&Number(v)>=0,r=v=>v==="total"||v==="subtotal",l={missingValue:void 0,invalidValue:void 0},c=[],h=o.reduce((v,S)=>{const b=v.get(S.index);return b?b.push(S):v.set(S.index,[S]),v},new Map);s.forEach((v,S)=>{c.push(v),h.get(S)?.forEach(b=>c.push({...b.toJson(),[e]:b.axisLabel}))});const p=[];this.ctx.animationManager.isSkipped()||p.push(u4());const u=this.getCategoryAxis()?.scale,g=this.getValueAxis()?.scale,{isContinuousX:y,xScaleType:f,yScaleType:m}=this.getScaleInformation({xScale:u,yScale:g}),{processedData:x}=await this.requestDataModel(t,c,{props:[o4(e,f,{id:"xValue"}),_c(i,m,{...l,id:"yCurrent"}),_c(i,m,{...l,missingValue:0,id:"yCurrentTotal"}),_c(i,m,{...l,id:"yCurrentPositive",validation:n}),_c(i,m,{...l,id:"yCurrentNegative",validation:a}),s4(i,m,{...l,id:"yPrevious"}),ZM(i,m,{id:"yRaw"}),ZM("totalType","band",{id:"totalTypeValue",missingValue:void 0,validation:r}),...y?[Ys.SMALLEST_KEY_INTERVAL,Ys.LARGEST_KEY_INTERVAL]:[],...p]});this.smallestDataInterval=x.reduced?.smallestKeyInterval,this.largestDataInterval=x.reduced?.largestKeyInterval,this.updateSeriesItemTypes(),this.animationState.transition("updateData")}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!e||!i)return[];const{keys:[o],values:s}=e.domain;if(t===this.getCategoryDirection()){const n=i.resolveProcessedDataDefById(this,"xValue");if(n?.def.type==="key"&&n?.def.valueType==="category")return o;const a=t===eg.Y,r=this.getCategoryAxis().isReversed();return this.padBandExtent(o,r!==a)}else{const n=i.resolveProcessedDataIndexById(this,"yCurrent"),a=s[n],r=[Math.min(0,a[0]),Math.max(0,a[1])];return i4(r)}}getSeriesRange(t,e){return[NaN,NaN]}createNodeData(){const{data:t,dataModel:e,processedData:i}=this,o=this.getCategoryAxis(),s=this.getValueAxis();if(!t||!o||!s||!e||!i)return;const{line:n}=this.properties,a=o.scale,r=s.scale,l=this.getBarDirection()===eg.X,c=this.getBandwidth(o)??10,h=o.isReversed(),p=s.isReversed();if(i.type!=="ungrouped")return;const u={itemId:this.properties.yKey,nodeData:[],labelData:[],pointData:[],scales:this.calculateScaling(),visible:this.visible};if(!this.visible)return u;const g=[],y=e.resolveKeysById(this,"xValue",i),f=e.resolveColumnById(this,"yRaw",i),m=e.resolveColumnById(this,"totalTypeValue",i),x=e.resolveColumnById(this,"yCurrent",i),v=e.resolveColumnById(this,"yPrevious",i),S=e.resolveColumnById(this,"yCurrentTotal",i),b=a4(o?.scale,o?.visibleRange,this.smallestDataInterval,this.largestDataInterval);function k(O,w,P){return O||w?{cumulativeValue:S[P],trailingValue:w?M:0}:{cumulativeValue:x[P],trailingValue:v[P]}}function I(O,w,P,B,z){return O?B:w?(B??0)-(z??0):P}let M=0;const{xKey:A,yKey:T,xName:N,yName:L}=this.properties;(i.dataSources.get(this.id)??[]).forEach((O,w)=>{const P=m[w],B=this.isSubtotal(P),z=this.isTotal(P),_=z||B,R=y[w];if(R==null)return;const E=Math.round(a.convert(R)),V=f[w],{cumulativeValue:F,trailingValue:G}=k(z,B,w);_&&(M=F??0);const W=Math.round(r.convert(F)),K=Math.round(r.convert(G)),j=I(z,B,V,F,G),Z=(j??0)>=0,J=this.getSeriesItemType(Z,P),{strokeWidth:tt,label:Q}=this.getItemConfig(J),U=Z?W:K,q=Z?K:W,it=Math.max(tt,Math.abs(q-U)),X={x:l?Math.min(U,q):E,y:l?E:Math.min(U,q),width:l?it:c,height:l?c:it},Ot={x:X.x+X.width/2,y:X.y+X.height/2},It=_?W:K,at=Math.floor(n.strokeWidth)%2/2,rt=h?W:It,gt=h?It:W;let yt,Ut;l?(yt={x:rt+at,y:X.y},Ut={x:gt+at,y:X.y+X.height}):(yt={x:X.x,y:rt+at},Ut={x:X.x+X.width,y:gt+at});const Ui={x:h?Ut.x:yt.x,y:h?Ut.y:yt.y,x2:h?yt.x:Ut.x,y2:h?yt.y:Ut.y,size:0};g.push(Ui);const Ue=J==="subtotal"?"total":J,So=this.getLabelText(Q,{itemId:Ue,value:j,datum:O,xKey:A,yKey:T,xName:N,yName:L}),Ye={index:w,series:this,itemId:J,datum:O,datumIndex:w,cumulativeValue:F??0,xValue:R,yValue:j,yKey:T,xKey:A,x:X.x,y:X.y,width:X.width,height:X.height,midPoint:Ot,crisp:b,label:{text:So,...e4({isUpward:(j??-1)>=0!==p,isVertical:!l,placement:Q.placement,padding:Q.padding,rect:X})}};u.nodeData.push(Ye),u.labelData.push(Ye)});const C=this.properties.line.enabled;return x!=null&&C&&(u.pointData=g),u}updateSeriesItemTypes(){const{dataModel:t,seriesItemTypes:e,processedData:i}=this;if(!t||!i)return;e.clear();const o=t.resolveProcessedDataIndexById(this,"yCurrentPositive"),s=t.resolveProcessedDataIndexById(this,"yCurrentNegative"),n=t.resolveProcessedDataIndexById(this,"totalTypeValue"),a=i.domain.values[o]??[],r=i.domain.values[s]??[];a.length>0&&e.add("positive"),r.length>0&&e.add("negative");const l=i?.domain.values[n];l&&l.forEach(c=>{(c==="total"||c==="subtotal")&&e.add("total")})}isSubtotal(t){return t==="subtotal"}isTotal(t){return t==="total"}nodeFactory(){return new m4}getSeriesItemType(t,e){return e??(t?"positive":"negative")}getItemConfig(t){switch(t){case"positive":return this.properties.item.positive;case"negative":return this.properties.item.negative;case"subtotal":case"total":return this.properties.item.total}}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,o=e??[];return i.update(o)}getItemStyle(t,e,i,o){const{id:s,properties:n}=this,a=n.item[i==="subtotal"?"total":i],r=o?n.highlightStyle.item:void 0,{itemStyler:l}=a,{xKey:c,yKey:h}=n,p={fill:r?.fill??a.fill,fillOpacity:r?.fillOpacity??a.fillOpacity,stroke:r?.stroke??a.stroke,strokeWidth:r?.strokeWidth??a.strokeWidth,strokeOpacity:r?.strokeOpacity??a.strokeOpacity,lineDash:r?.lineDash??a.lineDash??[],lineDashOffset:r?.lineDashOffset??a.lineDashOffset,cornerRadius:a.cornerRadius};if(l!=null){const u=this.cachedDatumCallback(n4(t,o?"highlight":"node"),()=>l({seriesId:s,itemId:i,datum:e,xKey:c,yKey:h,highlighted:o,...p}));Object.assign(p,u)}return p}updateDatumNodes(t){const{datumSelection:e,isHighlight:i}=t,o=this.getCategoryDirection()===eg.X;e.each((s,n)=>{const a=n.itemId,r=this.getItemStyle(String(n.datumIndex),n.datum,a,i);S4(s,r),s.visible=o?n.width>0:n.height>0,s.crisp=n.crisp})}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;if(e.length===0)return i.update([]);const o=e.filter(s=>{const{label:n}=this.getItemConfig(s.itemId);return n.enabled});return i.update(o)}updateLabelNodes(t){t.labelSelection.each((e,i)=>{r4(e,this.getItemConfig(i.itemId).label,i.label)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:o,properties:s}=this,{xKey:n,xName:a,yKey:r,yName:l,tooltip:c}=s,h=this.getCategoryAxis(),p=this.getValueAxis();if(!i||!o||!h||!p)return;const{datumIndex:u}=t,g=o.dataSources.get(this.id)?.[u],y=i.resolveKeysById(this,"xValue",o)[u],f=i.resolveColumnById(this,"yRaw",o)[u],m=i.resolveColumnById(this,"yCurrentTotal",o),x=i.resolveColumnById(this,"totalTypeValue",o);if(y==null)return;const v=x[u],S=(f??0)>=0,b=this.getSeriesItemType(S,v);let k;if(this.isTotal(v))k=m[u];else if(this.isSubtotal(v)){k=m[u];for(let M=u-1;M>=0;M-=1)if(this.isSubtotal(x[M])){k=k-m[M];break}}else k=f;const I=this.getItemStyle(String(u),g,b,!1);return c.formatTooltip({heading:h.formatDatum(y),symbol:this.legendItemSymbol(b),data:[{label:l,fallbackLabel:r,value:p.formatDatum(k)}]},{seriesId:e,datum:g,title:l,itemId:b,xKey:n,xName:a,yKey:r,yName:l,...I})}legendItemSymbol(t){const{fill:e,stroke:i,fillOpacity:o,strokeOpacity:s,strokeWidth:n,lineDash:a,lineDashOffset:r}=this.getItemConfig(t);return{marker:{fill:e,stroke:i,fillOpacity:o,strokeOpacity:s,strokeWidth:n,lineDash:a,lineDashOffset:r}}}getLegendData(t){if(t!=="category")return[];const{id:e,seriesItemTypes:i}=this,o=[],s=a=>a.charAt(0).toUpperCase()+a.substring(1),{showInLegend:n}=this.properties;return i.forEach(a=>{const{name:r}=this.getItemConfig(a);o.push({legendType:"category",id:e,itemId:a,seriesId:e,enabled:!0,label:{text:r??s(a)},symbol:this.legendItemSymbol(a),hideInLegend:!n,isFixed:!0})}),o}toggleSeriesItem(){}animateEmptyUpdateReady({datumSelection:t,labelSelection:e,contextData:i,paths:o}){const s=l4(c4(this.isVertical(),this.axes,"normal"));x4.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],s),d4(this,"labels",this.ctx.animationManager,e);const{pointData:n}=i;if(!n)return;const[a]=o;this.isVertical()?this.animateConnectorLinesVertical(a,n):this.animateConnectorLinesHorizontal(a,n)}animateConnectorLinesHorizontal(t,e){const{path:i}=t;this.updateLineNode(t);const o=this.getValueAxis(),s=o?.isReversed(),n=s?(c,h)=>cc>h,a=o?.scale.convert(0),r=e.reduce((c,h)=>(n(h.x,c)&&(c=h.x),c),s?1/0:0),l=(c,h,p,u,g)=>(c-h)/(p-h)*(g-u)+u;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:a,to:r,ease:Ys.Motion.easeOut,collapsable:!1,onUpdate(c){i.clear(!0),e.forEach((h,p)=>{const u=l(c,a,r,a,h.x),g=l(c,a,r,a,h.x2);p!==0&&i.lineTo(u,h.y),i.moveTo(g,h.y2)}),t.checkPathDirty()}})}animateConnectorLinesVertical(t,e){const{path:i}=t;this.updateLineNode(t);const o=this.getValueAxis(),s=o?.isReversed(),n=s?(c,h)=>c>h:(c,h)=>c(n(h.y,c)&&(c=h.y),c),s?0:1/0),l=(c,h,p,u,g)=>(c-h)/(p-h)*(g-u)+u;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:a,to:r,ease:Ys.Motion.easeOut,collapsable:!1,onUpdate(c){i.clear(!0),e.forEach((h,p)=>{const u=l(c,a,r,a,h.y),g=l(c,a,r,a,h.y2);p!==0&&i.lineTo(h.x,u),i.moveTo(h.x2,g)}),t.checkPathDirty()}})}animateReadyResize(t){super.animateReadyResize(t),this.resetConnectorLinesPath(t)}updatePaths(t){this.resetConnectorLinesPath({contextData:t.contextData,paths:t.paths})}resetConnectorLinesPath({contextData:t,paths:e}){if(e.length===0)return;const[i]=e;this.updateLineNode(i);const{path:o}=i;o.clear(!0);const{pointData:s}=t;s&&(s.forEach((n,a)=>{a!==0&&o.lineTo(n.x,n.y),o.moveTo(n.x2,n.y2)}),i.checkPathDirty())}updateLineNode(t){const{stroke:e,strokeWidth:i,strokeOpacity:o,lineDash:s,lineDashOffset:n}=this.properties.line;t.setProperties({fill:void 0,stroke:e,strokeWidth:this.getStrokeWidth(i),strokeOpacity:o,lineDash:s,lineDashOffset:n,lineJoin:"round",pointerEvents:Ys.PointerEvents.None})}isLabelEnabled(){const{positive:t,negative:e,total:i}=this.properties.item;return t.label.enabled||e.label.enabled||i.label.enabled}onDataChange(){}computeFocusBounds({datumIndex:t}){return f4(this,this.contextNodeData?.nodeData[t])}};ig.className="WaterfallSeries",ig.type="waterfall";import{_ModuleSupport as b4}from"ag-charts-community";var og={strokeWidth:0,label:{enabled:!1,fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},formatter:void 0,placement:"outside-end"}},v4={series:{item:{positive:og,negative:og,total:og},line:{stroke:b4.ThemeSymbols.PALETTE_NEUTRAL_STROKE,strokeOpacity:1,lineDash:[0],lineDashOffset:0,strokeWidth:2}},legend:{enabled:!0,toggleSeries:!1}},{ThemeConstants:Bc}=KM,M4={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"waterfall",solo:!0,moduleFactory:t=>new ig(t),tooltipDefaults:{range:"exact"},defaultAxes:KM.swapAxisCondition([{type:Bc.CARTESIAN_AXIS_TYPE.NUMBER,position:Bc.CARTESIAN_POSITION.LEFT},{type:Bc.CARTESIAN_AXIS_TYPE.CATEGORY,position:Bc.CARTESIAN_POSITION.BOTTOM}],t=>t?.direction==="horizontal"),themeTemplate:v4,paletteFactory:({takeColors:t,colorsCount:e,userPalette:i,palette:o})=>{if(i==="user-indexed"){const{fills:s,strokes:n}=t(e);return{line:{stroke:o.neutral.stroke},item:{positive:{fill:s[0],stroke:n[0]},negative:{fill:s[1],stroke:n[1]},total:{fill:s[2],stroke:n[2]}}}}return{line:{stroke:o.neutral.stroke},item:{positive:{fill:o.altUp.fill,stroke:o.altUp.stroke,label:{color:{$ref:"textColor"}}},negative:{fill:o.altDown.fill,stroke:o.altDown.stroke,label:{color:{$ref:"textColor"}}},total:{fill:o.neutral.fill,stroke:o.neutral.stroke,label:{color:{$ref:"textColor"}}}}}}},k4=`.ag-watermark{position:absolute;bottom:20px;right:25px;font-weight:700;font-family:Impact,sans-serif;font-size:19px;opacity:.7;animation:1s ease-out 3s ag-watermark-fadeout;color:#9b9b9b;pointer-events:none;&:before{content:"";display:block;height:40px;width:170px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=);background-repeat:no-repeat;background-size:170px 40px}>span{padding-left:.7rem}}@keyframes ag-watermark-fadeout{0%{opacity:.5}to{opacity:0}}.ag-charts-dialog{display:flex;flex-direction:column;font-size:var(--ag-charts-chrome-font-size-large)}.ag-charts-dialog__tabs{display:flex;flex-direction:column}.ag-charts-dialog__header{border-bottom:1px solid var(--ag-charts-border-color);display:flex}.ag-charts-dialog__tab-list{display:flex;gap:calc(var(--ag-charts-spacing) * 2)}.ag-charts-dialog__drag-handle{align-items:center;color:inherit;cursor:grab;display:flex;padding:1px 6px;text-align:center}.ag-charts-dialog__drag-handle--dragging{cursor:grabbing}.ag-charts-dialog__tab-button{background:none;border:0;border-bottom:2px solid transparent;border-radius:0;color:var(--ag-charts-chrome-subtle-text-color);margin-bottom:-1px;padding:var(--input-padding) calc(var(--input-padding) / 2)}.ag-charts-dialog__tab-button:hover{background:none}.ag-charts-dialog__tab-button--active{border-color:var(--ag-charts-accent-color);color:inherit}.ag-charts-dialog__drag-handle+.ag-charts-dialog__tab-button{margin-left:calc(var(--ag-charts-spacing) * -2)}.ag-charts-button.ag-charts-dialog__close-button{background:none;border:0;margin-left:auto;padding:1px 6px}.ag-charts-dialog__close-button:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-dialog__tab-panel{display:none;flex-direction:column;gap:calc(var(--ag-charts-spacing) * 4);margin:0 calc(var(--ag-charts-spacing) * 4);padding:calc(var(--ag-charts-spacing) * 4) 0}.ag-charts-dialog__tab-panel--active{display:flex}.ag-charts-dialog__input-group-line{display:flex;gap:16px 18px;flex-wrap:wrap}.ag-charts-dialog__input-group{align-items:center;display:flex;font-size:var(--ag-charts-chrome-font-size)}.ag-charts-dialog__input-group-label{color:var(--ag-charts-chrome-subtle-text-color);margin-right:5px}.ag-charts-dialog__input-group-label[for]{cursor:pointer}.ag-charts-dialog__button{border-radius:0;margin-right:-1px}.ag-charts-dialog__button.ag-charts-dialog__button--active{background:var(--ag-charts-button-focus-background-color);border-color:var(--ag-charts-input-focus-border-color);color:var(--ag-charts-input-focus-text-color);z-index:var(--input-layer-active)}.ag-charts-dialog__button:first-child,.ag-charts-dialog__input-group-label+.ag-charts-dialog__button{border-bottom-left-radius:var(--ag-charts-input-border-radius);border-top-left-radius:var(--ag-charts-input-border-radius)}.ag-charts-dialog__button:last-child{border-bottom-right-radius:var(--ag-charts-input-border-radius);border-top-right-radius:var(--ag-charts-input-border-radius)}.ag-charts-dialog__color-picker-button{--color: #000;background:var(--color);border:none;color:transparent;height:26px;width:26px}.ag-charts-dialog__color-picker-button:hover{background:var(--color)}.ag-charts-dialog__color-picker-button--multi-color,.ag-charts-dialog__color-picker-button--multi-color:hover{background:linear-gradient(135deg,red 0%,#ff0 calc(100% * 1 / 6),#0f0 calc(100% * 2 / 6),#0ff 50%,#00f calc(100% * 4 / 6),#f0f calc(100% * 5 / 6),red 100%)}.ag-charts-color-picker{width:190px;padding:8px;--h: 0;--s: 0;--v: 0;--a: 0;--color: #000;--color-a: #000;--thumb-size: 18px;--inner-width: 172px;--track-height: 12px;--palette-height: 136px;--checker: url('data:image/svg+xml;utf8,');--multi-color: linear-gradient( 135deg, #f00 0% , #ff0 calc(100% * 1 / 6), #0f0 calc(100% * 2 / 6), #0ff 50% , #00f calc(100% * 4 / 6), #f0f calc(100% * 5 / 6), #f00 100% )}.ag-charts-color-picker__content{display:flex;flex-direction:column}.ag-charts-color-picker__palette{position:relative;width:100%;height:var(--palette-height);margin-bottom:8px;background:linear-gradient(to bottom,#0000,#000),linear-gradient(to right,#fff,#fff0) hsl(var(--h),100%,50%);border-radius:calc(var(--ag-charts-border-radius) * 1.5);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__palette:after{content:"";position:absolute;display:block;top:calc(var(--thumb-size) * -.5 + (1 - var(--v)) * 100%);left:calc(var(--thumb-size) * -.5 + var(--s) * 100%);background:var(--color);width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038}.ag-charts-color-picker__palette:focus-visible:after{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),0 0 0 2px #fff8,var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__color-row{display:flex;gap:8px;align-items:center;margin-bottom:4px;--inset: calc((var(--thumb-size) - var(--track-height)) / 2)}.ag-charts-color-picker__hue-input,.ag-charts-color-picker__alpha-input{-webkit-appearance:none;display:block;position:relative;padding:0;margin:0 calc(var(--inset) * -1);border:0;height:var(--thumb-size);width:auto;background:transparent;--inset: calc((var(--thumb-size) - var(--track-height)) / 2)}.ag-charts-color-picker__hue-input::-webkit-slider-thumb,.ag-charts-color-picker__alpha-input::-webkit-slider-thumb{-webkit-appearance:none;width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038;transform:translateZ(0)}.ag-charts-color-picker__hue-input::-webkit-slider-thumb{background:hsl(var(--h),100%,50%)}.ag-charts-color-picker__alpha-input::-webkit-slider-thumb{background:transparent}.ag-charts-color-picker__alpha-input--opaque::-webkit-slider-thumb{background:var(--color)}.ag-charts-color-picker__hue-input:focus-visible::-webkit-slider-thumb,.ag-charts-color-picker__alpha-input:focus-visible::-webkit-slider-thumb{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__hue-input:before,.ag-charts-color-picker__alpha-input:before{position:absolute;content:"";display:block;top:calc(50% - var(--track-height) / 2);left:var(--inset);right:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__multi-color-button{width:36px;margin-left:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);border:0;background:var(--multi-color);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__multi-color-button--hidden{display:none}.ag-charts-color-picker__multi-color-button--active{box-shadow:inset 0 0 0 1px #0003;outline-offset:1px;outline:2px solid #2196f3}.ag-charts-color-picker__hue-input{flex:1 0 0}.ag-charts-color-picker__hue-input:before{background:linear-gradient(to right,red,red calc((100% - var(--track-height)) * 0 / 6 + var(--track-height) / 2),#ff0 calc((100% - var(--track-height)) * 1 / 6 + var(--track-height) / 2),#0f0 calc((100% - var(--track-height)) * 2 / 6 + var(--track-height) / 2),#0ff calc((100% - var(--track-height)) * 3 / 6 + var(--track-height) / 2),#00f calc((100% - var(--track-height)) * 4 / 6 + var(--track-height) / 2),#f0f calc((100% - var(--track-height)) * 5 / 6 + var(--track-height) / 2),red calc((100% - var(--track-height)) * 6 / 6 + var(--track-height) / 2))}.ag-charts-color-picker__alpha-input{margin-bottom:7px}.ag-charts-color-picker__alpha-input:before{background:linear-gradient(to right,transparent,var(--color)),var(--checker) top left / 4px 4px}.ag-charts-color-picker__color-field{display:flex;border:var(--ag-charts-border);background:var(--ag-charts-background-color);border-radius:var(--ag-charts-border-radius);overflow:hidden}.ag-charts-color-picker__color-field:has(:focus-visible){border-color:var(--ag-charts-accent-color);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__color-label{width:16px;height:16px;margin:7px 0 7px 7px;color:transparent;background:linear-gradient(to right,var(--color-a),var(--color-a)),var(--checker) top left / 4px 4px;border-radius:calc(var(--ag-charts-border-radius) / 2);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__color-label--multi-color{background:var(--multi-color)}.ag-charts-color-picker__color-input{flex:1;min-width:0;padding:7px 7px 7px 8px;border:0;margin:0;color:inherit;background:transparent;font-variant:tabular-nums}.ag-charts-color-picker__color-input:focus-visible{border:none;outline:none}.ag-charts-annotations__line-stroke-width-menu,.ag-charts-annotations__line-style-type-menu,.ag-charts-annotations__text-size-menu{.ag-charts-menu__row:first-child{border-radius:0}}.ag-charts-annotations__text-size-menu{--item-padding: 4px 8px;border-top-left-radius:0;border-top-right-radius:0;min-width:34px;text-align:center}.ag-charts-annotations__line-stroke-width-menu{--item-padding: 6px;column-gap:6px}.ag-charts-annotations__line-style-type-menu{--item-padding: 6px;column-gap:0}.ag-charts-annotations__stroke-width-button:before{background:var(--ag-charts-foreground-color);content:"";margin-right:var(--toolbar-button-padding);height:min(var(--stroke-width),20px);width:12px}.ag-charts-annotations__stroke-width-button[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-annotations__color-picker-button{--emblem: var(--color)}.ag-charts-annotations__color-picker-button--multi-color{--emblem: linear-gradient( to right, #f00 0% , #ff0 calc(100% * 1 / 6), #0f0 calc(100% * 2 / 6), #0ff 50% , #00f calc(100% * 4 / 6), #f0f calc(100% * 5 / 6), #f00 100% )}.ag-charts-annotations__color-picker-button:after{content:"";display:block;position:absolute;bottom:3px;left:5px;right:5px;height:4px;border-radius:99px;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ag-charts-foreground-color) 10%,transparent);background:var(--emblem)}.ag-charts-annotations__color-picker-button[aria-disabled=true]:after{filter:grayscale(1);opacity:.5}.ag-charts-annotations__toolbar-menu{min-width:200px}.ag-charts-annotations__axis-button--hidden{display:none}.ag-charts-annotations__axis-button{background-color:var(--ag-charts-crosshair-label-background-color);border-radius:calc(var(--ag-charts-border-radius) / 2);border:none;box-sizing:border-box;color:var(--ag-charts-crosshair-label-text-color);cursor:pointer;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);left:0;line-height:16px;overflow:hidden;padding:0;position:absolute;top:0;user-select:none;white-space:nowrap;z-index:var(--ag-charts-layer-annotations)}.ag-charts-annotations__axis-button:hover{opacity:.8;color:var(--ag-charts-background-color)}.ag-charts-dialog--annotation-settings{min-height:233px;width:289px}.ag-charts-dialog--annotation-settings .ag-charts-textarea{height:calc(10px * 2 + var(--textarea-line-height) * 1em * 3 + 2px);overflow-y:auto;resize:vertical}.ag-charts-context-menu{background:var(--ag-charts-chrome-background-color);border:var(--ag-charts-border);border-radius:var(--ag-charts-border-radius);box-shadow:var(--ag-charts-shadow);color:var(--ag-charts-chrome-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:calc(var(--ag-charts-chrome-font-size) * (13 / 12));font-weight:var(--ag-charts-chrome-font-weight);transition:transform .1s ease;white-space:nowrap;z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-context-menu__cover{position:fixed;left:0;top:0}.ag-charts-context-menu__menu{display:flex;flex-direction:column;padding:.5em 0}.ag-charts-context-menu__menu:focus{outline:none}.ag-charts-context-menu__item{background:none;border:none;box-sizing:border-box;color:inherit;font:inherit;padding:.5em 1em;text-align:left;-webkit-appearance:none;-moz-appearance:none}.ag-charts-context-menu__item:focus,.ag-charts-context-menu__item:active{background:var(--ag-charts-focus-color)}.ag-charts-context-menu__item[data-focus-visible-override=true]:focus,.ag-charts-context-menu__item:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-context-menu__item[data-focus-visible-override=false]{outline:inherit;box-shadow:inherit;z-index:inherit}.ag-charts-context-menu__item[aria-disabled=true]{border:none;opacity:.5;text-align:left}.ag-charts-context-menu__item[aria-disabled=true]:focus{background:inherit;cursor:inherit}.ag-charts-context-menu__divider{margin:5px 0;background:#babfc7;height:1px}.ag-charts-context-menu__divider.ag-charts-dark-context-menu{background:#2196f31a}.ag-charts-crosshair-label{position:absolute;left:0;top:0;user-select:none;pointer-events:none;font-family:var(--ag-charts-font-family);font-size:var(--ag-charts-font-size);font-weight:var(--ag-charts-font-weight);overflow:hidden;white-space:nowrap;z-index:var(--ag-charts-layer-crosshair);box-sizing:border-box}.ag-charts-crosshair-label-content{padding:0 8px;border-radius:calc(var(--ag-charts-border-radius) / 2);line-height:calc(var(--ag-charts-font-size) + 8px);background-color:var(--ag-charts-crosshair-label-background-color);color:var(--ag-charts-crosshair-label-text-color)}.ag-charts-crosshair-label--hidden{visibility:hidden!important}.ag-charts-text-input{position:absolute}.ag-charts-text-input__textarea{--placeholder-text-color: var(--ag-charts-input-placeholder-text-color);display:block;height:100%;width:100%;border:0;background:none;line-height:1.38;outline:none;transform:translateY(.09em)}.ag-charts-text-input__textarea[placeholder]:empty:before{content:attr(placeholder);color:var(--placeholder-text-color);font-weight:400}.ag-charts-text-input__textarea[placeholder]:not(:empty):before{content:""}.ag-charts-chart-toolbar__menu{min-width:200px}.ag-charts-range-buttons .ag-charts-toolbar__button{padding:var(--toolbar-button-padding) calc(var(--toolbar-button-padding) * 1.5)}.ag-charts-zoom-buttons{align-items:center;display:flex;height:44px;justify-content:center;overflow:hidden;padding-bottom:10px;pointer-events:none;width:100%;.ag-charts-toolbar{--toolbar-size: 24px;--toolbar-button-padding: 1px;display:flex;font-size:var(--ag-charts-chrome-font-size);height:var(--toolbar-size);justify-content:center;opacity:1;pointer-events:auto;transition:opacity .2s ease-in-out,transform .4s ease-in-out;.ag-charts-toolbar__button--first{border-bottom-left-radius:var(--ag-charts-border-radius);border-top-left-radius:var(--ag-charts-border-radius)}.ag-charts-toolbar__button--last{border-bottom-right-radius:var(--ag-charts-border-radius);border-top-right-radius:var(--ag-charts-border-radius)}.ag-charts-toolbar__label{padding-left:var(--ag-charts-spacing);padding-right:var(--ag-charts-spacing)}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{padding-left:0}.ag-charts-toolbar__button--gap{margin-left:var(--toolbar-gap)}.ag-charts-zoom-buttons__toolbar--hidden{opacity:0;transition:opacity .4s ease-in-out,transform .4s ease-in-out}}}.ag-charts-shared-toolbar{gap:var(--toolbar-gap);.ag-charts-toolbar__button{border-radius:var(--ag-charts-border-radius);margin:0}} `;$s.ModuleRegistry.registerMany([YA,gI,SI,AI,NI]);function qM(){$s.moduleRegistry.register(Xk,aA,RI,yC,IC,GL,MN,dR,YR,fE,iw,vw,UB,LC,_C,ZC,JC,fN,tP,h1,qP,OP,k_,rB,z_,UN,bO,TL,e1,WB,lA,Zz,qz,NV,VV,wA,SF,FA,FG,rG,nO,hz,lW,rO,kW,DO,UW,M4,uL),$s.enterpriseModule.isEnterprise=!0,$s.enterpriseModule.styles=k4,$s.enterpriseModule.licenseManager=t=>new Xs(t.container?.ownerDocument??(typeof document>"u"?void 0:document)),$s.enterpriseModule.injectWatermark=NL}export*from"ag-charts-community";qM();var A4={setLicenseKey(t){Xs.setLicenseKey(t)}};function JM(){qM(),hk()}var I4={VERSION:ak,_Scene:rk,_Theme:lk,_Util:ck,create:lr.create.bind(lr),createSparkline:lr.__createSparkline.bind(lr),setup:JM,setGridContext:Xs.setGridContext.bind(Xs),setLicenseKey:Xs.setLicenseKey.bind(Xs),isEnterprise:!0};export{I4 as AgChartsEnterpriseModule,A4 as LicenseManager,JM as setupEnterpriseModules};