ag-charts-community
Version:
Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue
2 lines • 989 kB
JavaScript
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(t,e)=>{for(var i in e)__defProp(t,i,{get:e[i],enumerable:!0})},__copyProps=(t,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of __getOwnPropNames(e))!__hasOwnProp.call(t,n)&&n!==i&&__defProp(t,n,{get:()=>e[n],enumerable:!(s=__getOwnPropDesc(e,n))||s.enumerable});return t},__toCommonJS=t=>__copyProps(__defProp({},"__esModule",{value:!0}),t),__decorateClass=(t,e,i,s)=>{for(var n=s>1?void 0:s?__getOwnPropDesc(e,i):e,r=t.length-1,o;r>=0;r--)(o=t[r])&&(n=(s?o(e,i,n):o(n))||n);return s&&n&&__defProp(e,i,n),n},main_exports={};__export(main_exports,{AG_CHARTS_LOCALE_EN_US:()=>AG_CHARTS_LOCALE_EN_US,AgCharts:()=>AgCharts,AgChartsCommunityModule:()=>AgChartsCommunityModule,AgErrorBarSupportedSeriesTypes:()=>AgErrorBarSupportedSeriesTypes,AgTooltipAnchorToType:()=>AgTooltipAnchorToType,AgTooltipPlacementType:()=>AgTooltipPlacementType,AgTooltipPositionType:()=>AgTooltipPositionType,VERSION:()=>VERSION,_ModuleSupport:()=>module_support_exports,_Scene:()=>integrated_charts_scene_exports,_Theme:()=>integrated_charts_theme_exports,_Util:()=>integrated_charts_util_exports,_Widget:()=>exports_exports,setupCommunityModules:()=>registerInbuiltModules,time:()=>time_exports}),module.exports=__toCommonJS(main_exports);var import_ag_charts_core140=require("ag-charts-core"),import_ag_charts_core93=require("ag-charts-core"),BaseModuleInstance=class{constructor(){this.destroyFns=[]}destroy(){for(const t of this.destroyFns)t()}},ModuleRegistry=class{constructor(){this.modules=[],this.dependencies=new Map,this.modulesByOptionKey=new Map}register(...t){for(const e of t){this.registerDependencies(e);const i=this.modules.find(s=>e.type===s.type&&("optionsKey"in e&&"optionsKey"in s?e.optionsKey===s.optionsKey:!0)&&e.identifier===s.identifier);if(i){if(e.packageType==="enterprise"&&i.packageType==="community"){const s=this.modules.indexOf(i);this.modules.splice(s,1,e),"optionsKey"in e&&this.modulesByOptionKey.set(e.optionsKey,e)}}else this.modules.push(e),"optionsKey"in e&&this.modulesByOptionKey.set(e.optionsKey,e)}}hasEnterpriseModules(){return this.modules.some(t=>t.packageType==="enterprise")}*byType(...t){const e=new Set,i=this.modules.filter(r=>t.includes(r.type)),s=r=>{const o=this.dependencies.get(r);return o?.flatMap(s).concat(o)??[]},n=[];for(const r of i){const o="optionsKey"in r?r.optionsKey:r.contextKey;if(!e.has(o)){for(const a of s(o)){if(e.has(a))continue;const l=this.modulesByOptionKey.get(a);if(!l){n.push(a);continue}t.includes(l.type)&&(yield l,e.add(a))}yield r,e.add(o)}}if(n.length>0)throw new Error(`Could not resolve module dependencies: ${n}`)}registerDependencies(t){if(t.dependencies==null||t.dependencies.length===0)return;const e="optionsKey"in t?t.optionsKey:t.contextKey;this.dependencies.set(e,t.dependencies)}},moduleRegistry=new ModuleRegistry,import_ag_charts_core=require("ag-charts-core"),BBoxValues={containsPoint,isEmpty,normalize};function containsPoint(t,e,i){return e>=t.x&&e<=t.x+t.width&&i>=t.y&&i<=t.y+t.height}function isEmpty(t){return t==null||t.height===0||t.width===0||isNaN(t.height)||isNaN(t.width)}function normalize(t){let{x:e,y:i,width:s,height:n}=t;return(s==null||s>0)&&(n==null||n>0)?t:(e!=null&&s!=null&&s<0&&(s=-s,e=e-s),i!=null&&n!=null&&n<0&&(n=-n,i=i-n),{x:e,y:i,width:s,height:n})}var interpolate=Symbol("interpolate"),isInterpolating=t=>t[interpolate]!=null;function nearestSquared(t,e,i,s=1/0){const n={nearest:void 0,distanceSquared:s};for(const r of i){const o=r.distanceSquared(t,e);if(o===0)return{nearest:r,distanceSquared:0};o<n.distanceSquared&&(n.nearest=r,n.distanceSquared=o)}return n}function nearestSquaredInContainer(t,e,i,s=1/0){const{x:n=t,y:r=e}=i.transformPoint?.(t,e)??{},o={nearest:void 0,distanceSquared:s};for(const a of i.children){const{nearest:l,distanceSquared:c}=a.nearestSquared(n,r,o.distanceSquared);if(c===0)return{nearest:l,distanceSquared:c};c<o.distanceSquared&&(o.nearest=l,o.distanceSquared=c)}return o}var _BBox=class bt{constructor(e,i,s,n){this.x=e,this.y=i,this.width=s,this.height=n}static fromDOMRect({x:e,y:i,width:s,height:n}){return new bt(e,i,s,n)}static merge(e){let i=1/0,s=1/0,n=-1/0,r=-1/0;for(const o of e)o.x<i&&(i=o.x),o.y<s&&(s=o.y),o.x+o.width>n&&(n=o.x+o.width),o.y+o.height>r&&(r=o.y+o.height);return new bt(i,s,n-i,r-s)}static nearestBox(e,i,s){return nearestSquared(e,i,s)}toDOMRect(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.y,left:this.x,right:this.x+this.width,bottom:this.y+this.height,toJSON(){return{}}}}clone(){const{x:e,y:i,width:s,height:n}=this;return new bt(e,i,s,n)}equals(e){return this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height}containsPoint(e,i){return BBoxValues.containsPoint(this,e,i)}intersection(e){if(!this.collidesBBox(e))return;const i=(0,import_ag_charts_core.clamp)(e.x,this.x,e.x+e.width),s=(0,import_ag_charts_core.clamp)(e.y,this.y,e.y+e.height),n=(0,import_ag_charts_core.clamp)(e.x,this.x+this.width,e.x+e.width),r=(0,import_ag_charts_core.clamp)(e.y,this.y+this.height,e.y+e.height);return new bt(i,s,n-i,r-s)}collidesBBox(e){return this.x<e.x+e.width&&this.x+this.width>e.x&&this.y<e.y+e.height&&this.y+this.height>e.y}computeCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)&&Number.isFinite(this.width)&&Number.isFinite(this.height)}distanceSquared(e,i){if(this.containsPoint(e,i))return 0;const s=e-(0,import_ag_charts_core.clamp)(this.x,e,this.x+this.width),n=i-(0,import_ag_charts_core.clamp)(this.y,i,this.y+this.height);return s*s+n*n}shrink(e,i){if(typeof e=="number")this.applyMargin(e,i);else for(const s of Object.keys(e)){const n=e[s];typeof n=="number"&&this.applyMargin(n,s)}return this.width<0&&(this.width=0),this.height<0&&(this.height=0),this}grow(e,i){if(typeof e=="number")this.applyMargin(-e,i);else for(const s of Object.keys(e)){const n=e[s];typeof n=="number"&&this.applyMargin(-n,s)}return this}applyMargin(e,i){switch(i){case"top":this.y+=e;case"bottom":this.height-=e;break;case"left":this.x+=e;case"right":this.width-=e;break;case"vertical":this.y+=e,this.height-=e*2;break;case"horizontal":this.x+=e,this.width-=e*2;break;case void 0:this.x+=e,this.y+=e,this.width-=e*2,this.height-=e*2;break}}translate(e,i){return this.x+=e,this.y+=i,this}[interpolate](e,i){return new bt(this.x*(1-i)+e.x*i,this.y*(1-i)+e.y*i,this.width*(1-i)+e.width*i,this.height*(1-i)+e.height*i)}};_BBox.zero=Object.freeze(new _BBox(0,0,0,0)),_BBox.NaN=Object.freeze(new _BBox(NaN,NaN,NaN,NaN));var BBox=_BBox,import_ag_charts_core20=require("ag-charts-core"),import_ag_charts_core2=require("ag-charts-core"),LONG_TIME_PERIOD_THRESHOLD=2e3,timeOfLastLog=Date.now(),logTimeGap=()=>{const t=Date.now()-timeOfLastLog;if(t>LONG_TIME_PERIOD_THRESHOLD){const e=(Math.floor(t/100)/10).toFixed(1);import_ag_charts_core2.Logger.log(`**** ${e}s since last log message ****`)}timeOfLastLog=Date.now()},Debug={create(...t){return Object.assign((...i)=>{Debug.check(...t)&&(typeof i[0]=="function"&&(i=(0,import_ag_charts_core2.toArray)(i[0]())),logTimeGap(),import_ag_charts_core2.Logger.log(...i))},{check:()=>Debug.check(...t),group:(i,s)=>Debug.check(...t)?import_ag_charts_core2.Logger.logGroup(i,s):s()})},check(...t){return t.length===0&&t.push(!0),(0,import_ag_charts_core2.toArray)((0,import_ag_charts_core2.getWindow)("agChartsDebug")).some(i=>t.includes(i))},inDevelopmentMode(t){if(Debug.check("dev"))return t()}};function clearContext({context:t,pixelRatio:e,width:i,height:s}){t.save(),t.resetTransform(),t.clearRect(0,0,Math.ceil(i*e),Math.ceil(s*e)),t.restore()}function debugContext(t){if(Debug.check("canvas")){const e=t.save.bind(t),i=t.restore.bind(t);let s=0;Object.assign(t,{save(){e(),s++},restore(){if(s===0)throw new Error("AG Charts - Unable to restore() past depth 0");i(),s--},verifyDepthZero(){if(s!==0)throw new Error(`AG Charts - Save/restore depth is non-zero: ${s}`)}})}}function canvasDimensions(t,e,i){return[Math.floor(t*i),Math.floor(e*i)]}var HdpiOffscreenCanvas=class{constructor(t){const{width:e,height:i,pixelRatio:s,willReadFrequently:n=!1}=t;this.width=e,this.height=i,this.pixelRatio=s;const[r,o]=canvasDimensions(e,i,s);this.canvas=new OffscreenCanvas(r,o),this.context=this.canvas.getContext("2d",{willReadFrequently:n}),this.context.setTransform(s,0,0,s,0,0),debugContext(this.context)}drawImage(t,e=0,i=0){return t.drawImage(this.canvas,e,i)}transferToImageBitmap(){return this.canvas.transferToImageBitmap()}resize(t,e,i){if(!(t>0&&e>0))return;const{canvas:s,context:n}=this;if(t!==this.width||e!==this.height||i!==this.pixelRatio){const[r,o]=canvasDimensions(t,e,i);s.width=r,s.height=o}n.setTransform(i,0,0,i,0,0),this.width=t,this.height=e,this.pixelRatio=i}clear(){clearContext(this)}destroy(){this.canvas.width=0,this.canvas.height=0,this.context.clearRect(0,0,0,0),this.canvas=null,this.context=null,Object.freeze(this)}},import_ag_charts_core3=require("ag-charts-core"),ID_MAP=new Map;function resetIds(){ID_MAP.clear()}function createId(t){const e=t.constructor,i=Object.hasOwn(e,"className")?e.className:e.name;if(!i)throw new Error(`The ${e} is missing the 'className' property.`);const s=(ID_MAP.get(i)??0)+1;return ID_MAP.set(i,s),`${i}-${s}`}function generateUUID(){return crypto.randomUUID?.()??generateUUIDv4()}function generateUUIDv4(){const t=new Uint8Array(16);crypto.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let e="";for(let i=0;i<t.length;i++)(i===4||i===6||i===8||i===10)&&(e+="-"),e+=t[i].toString(16).padStart(2,"0");return e}function SceneChangeDetection(t){return function(e,i){const s=`__${i}`;e[i]||prepareGetSet(e,i,s,t)}}function prepareGetSet(t,e,i,s){const{type:n="normal",changeCb:r,convertor:o,checkDirtyOnAssignment:a=!1}=s??{},l={type:n,changeCb:r,checkDirtyOnAssignment:a,convertor:o};let c;switch(n){case"normal":c=buildNormalSetter(i,l);break;case"transform":c=buildTransformSetter(i);break;case"path":c=buildPathSetter(i);break}c=buildCheckDirtyChain(i,buildChangeCallbackChain(buildConvertorChain(c,l),l),l),Object.defineProperty(t,e,{set:c,get:function(){return this[i]},enumerable:!0,configurable:!0})}function buildConvertorChain(t,e){const{convertor:i}=e;return i?function(s){t.call(this,i(s))}:t}var NO_CHANGE=Symbol("no-change");function buildChangeCallbackChain(t,e){const{changeCb:i}=e;return i?function(s){const n=t.call(this,s);return n!==NO_CHANGE&&i.call(this,this),n}:t}function buildCheckDirtyChain(t,e,i){const{checkDirtyOnAssignment:s}=i;return s?function(n){const r=e.call(this,n);return n?._dirty===!0&&this.markDirty(t),r}:e}function buildNormalSetter(t,e){const{changeCb:i}=e;return function(s){const n=this[t];return s!==n?(this[t]=s,this.markDirty(t),i?.(this),s):NO_CHANGE}}function buildTransformSetter(t){return function(e){const i=this[t];return e!==i?(this[t]=e,this.markDirtyTransform(),e):NO_CHANGE}}function buildPathSetter(t){return function(e){const i=this[t];return e!==i?(this[t]=e,this._dirtyPath||(this._dirtyPath=!0,this.markDirty(t)),e):NO_CHANGE}}var PointerEvents=(t=>(t[t.All=0]="All",t[t.None=1]="None",t))(PointerEvents||{}),_Node=class Nt{constructor(e){this.serialNumber=Nt._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=createId(this),this.pointerEvents=0,this._dirty=!0,this.dirtyZIndex=!1,this.isContainerNode=!1,this.visible=!0,this.zIndex=0,this.name=e?.name,this.tag=e?.tag??NaN,this.zIndex=e?.zIndex??0,(e?.debugDirty??Nt._debugEnabled)&&(this._debugDirtyProperties=new Map([["__first__",[]]]))}static toSVG(e,i,s){const n=e?.toSVG();if(n==null||!n.elements.length&&!n.defs?.length)return;const r=(0,import_ag_charts_core3.createSvgElement)("svg");if(r.setAttribute("width",String(i)),r.setAttribute("height",String(s)),r.setAttribute("viewBox",`0 0 ${i} ${s}`),n.defs?.length){const o=(0,import_ag_charts_core3.createSvgElement)("defs");o.append(...n.defs),r.append(o)}return r.append(...n.elements),r.outerHTML}static*extractBBoxes(e,i){for(const s of e)if(!i||s.visible&&!s.transitionOut){const n=s.getBBox();n&&(yield n)}}get datum(){return this._datum}set datum(e){this._datum!==e&&(this._previousDatum=this._datum,this._datum=e)}get previousDatum(){return this._previousDatum}get layerManager(){return this._layerManager}get dirty(){return this._dirty}closestDatum(){for(const{datum:e}of this.traverseUp(!0))if(e!=null)return e}preRender(e,i=1){this.childNodeCounts.groups=0,this.childNodeCounts.nonGroups=1,this.childNodeCounts.complexity=i,this.childNodeCounts.thisComplexity=i;for(const s of this.children()){const n=s.preRender(e);this.childNodeCounts.groups+=n.groups,this.childNodeCounts.nonGroups+=n.nonGroups,this.childNodeCounts.complexity+=n.complexity}return this.childNodeCounts}render(e){const{stats:i}=e;if(this._dirty=!1,this.debugDirtyProperties(),e.debugNodeSearch){const s=this.name??this.id;e.debugNodeSearch.some(n=>typeof n=="string"?n===s:n.test(s))&&(e.debugNodes[this.name??this.id]=this)}i&&(i.nodesRendered++,i.opsPerformed+=this.childNodeCounts.thisComplexity)}_setLayerManager(e){this._layerManager=e,this._debug=e?.debug;for(const i of this.children())i._setLayerManager(e)}sortChildren(e){if(this.dirtyZIndex=!1,!this.childNodes)return;const i=[...this.childNodes].sort(e);this.childNodes.clear();for(const s of i)this.childNodes.add(s)}*traverseUp(e){let i=this;for(e&&(yield i);i=i.parentNode;)yield i}*children(){if(this.childNodes)for(const e of this.childNodes)yield e}*descendants(){for(const e of this.children())yield e,yield*e.descendants()}isLeaf(){return!this.childNodes?.size}isRoot(){return!this.parentNode}append(e){this.childNodes??(this.childNodes=new Set);for(const i of(0,import_ag_charts_core3.toIterable)(e))i.parentNode?.removeChild(i),this.childNodes.add(i),i.parentNode=this,i._setLayerManager(this.layerManager);this.invalidateCachedBBox(),this.dirtyZIndex=!0,this.markDirty()}appendChild(e){return this.append(e),e}removeChild(e){if(!this.childNodes?.delete(e))throw new Error(`AG Charts - internal error, unknown child node ${e.name??e.id} in $${this.name??this.id}`);delete e.parentNode,e._setLayerManager(),this.invalidateCachedBBox(),this.dirtyZIndex=!0,this.markDirty()}remove(){this.parentNode?.removeChild(this)}clear(){for(const e of this.children())delete e.parentNode,e._setLayerManager();this.childNodes?.clear(),this.invalidateCachedBBox()}destroy(){this.parentNode?.removeChild(this)}setProperties(e,i){if(i)for(const s of i)this[s]=e[s];else Object.assign(this,e);return this}containsPoint(e,i){return!1}pickNode(e,i){if(!(!this.visible||this.pointerEvents===1||!this.containsPoint(e,i))){if(this.childNodes!=null&&this.childNodes.size!==0){const s=[...this.children()];for(let n=s.length-1;n>=0;n--){const r=s[n].pickNode(e,i);if(r)return r}}else if(!this.isContainerNode)return this}}pickNodes(e,i,s=[]){if(!this.visible||this.pointerEvents===1||!this.containsPoint(e,i))return s;this.isContainerNode||s.push(this);for(const n of this.children())n.pickNodes(e,i,s);return s}invalidateCachedBBox(){this.cachedBBox!=null&&(this.cachedBBox=void 0,this.parentNode?.invalidateCachedBBox())}getBBox(){return this.cachedBBox==null&&(this.cachedBBox=Object.freeze(this.computeBBox())),this.cachedBBox}computeBBox(){}markDirty(e){const{_dirty:i}=this;e!=null&&this._debugDirtyProperties&&this.markDebugProperties(e),!(this.cachedBBox==null&&i)&&(this.invalidateCachedBBox(),this._dirty=!0,this.parentNode&&this.parentNode.markDirty())}markClean(){if(this._dirty){this._dirty=!1,this.debugDirtyProperties();for(const e of this.children())e.markClean()}}markDebugProperties(e){const i=this._debugDirtyProperties?.get(e)??[],s=new Error().stack?.split(`
`).filter(n=>n!=="Error"&&!n.includes(".markDebugProperties")&&!n.includes(".markDirty")&&!n.includes("Object.assign ")&&!n.includes(`${this.constructor.name}.`))??"unknown";i.push(s[0].replace(" at ","").trim()),this._debugDirtyProperties?.set(e,i)}debugDirtyProperties(){this._debugDirtyProperties!=null&&(this._debugDirtyProperties.has("__first__")||this._debugDirtyProperties.forEach((e,i)=>{e.length>1&&(console.groupCollapsed(`Property changed multiple times before render: ${this.constructor.name}.${i} (${e.length}x)`),e.forEach(s=>console.log(s)),console.groupEnd())}),this._debugDirtyProperties.clear())}onZIndexChange(){const{parentNode:e}=this;e&&(e.dirtyZIndex=!0)}toSVG(){}};_Node._nextSerialNumber=0,_Node._debugEnabled=!1,__decorateClass([SceneChangeDetection()],_Node.prototype,"visible",2),__decorateClass([SceneChangeDetection({changeCb:t=>t.onZIndexChange()})],_Node.prototype,"zIndex",2);var Node=_Node,import_ag_charts_core17=require("ag-charts-core"),import_ag_charts_core4=require("ag-charts-core"),BREAK_TRANSFORM_CHAIN=Symbol("BREAK"),CONFIG_KEY="__decorator_config";function addFakeTransformToInstanceProperty(t,e){initialiseConfig(t,e).optional=!0}function initialiseConfig(t,e){Object.getOwnPropertyDescriptor(t,CONFIG_KEY)==null&&Object.defineProperty(t,CONFIG_KEY,{value:{}});const i=t[CONFIG_KEY],s=e.toString();if(typeof i[s]<"u")return i[s];const n=new WeakMap;i[s]={setters:[],getters:[],observers:[],valuesMap:n};const r=Object.getOwnPropertyDescriptor(t,e),o=r?.set,a=r?.get;return Object.defineProperty(t,e,{set:function(h){const{setters:u,observers:d}=i[s];let p;u.some(g=>g.length>2)&&(p=a?a.call(this):n.get(this));for(const g of u)if(h=g(this,e,h,p),h===BREAK_TRANSFORM_CHAIN)return;o?o.call(this,h):n.set(this,h);for(const g of d)g(this,h,p)},get:function(){let h=a?a.call(this):n.get(this);for(const u of i[s].getters)if(h=u(this,e,h),h===BREAK_TRANSFORM_CHAIN)return;return h},enumerable:!0,configurable:!1}),i[s]}function addTransformToInstanceProperty(t,e,i){return(s,n)=>{const r=initialiseConfig(s,n);r.setters.push(t),e&&r.getters.unshift(e),i&&Object.assign(r,i)}}function addObserverToInstanceProperty(t){return(e,i)=>{initialiseConfig(e,i).observers.push(t)}}function isDecoratedObject(t){return typeof t<"u"&&CONFIG_KEY in t}function listDecoratedProperties(t){const e=new Set;for(;isDecoratedObject(t);)e.add(t?.[CONFIG_KEY]),t=Object.getPrototypeOf(t);return Array.from(e).flatMap(i=>Object.keys(i))}function extractDecoratedProperties(t){return listDecoratedProperties(t).reduce((e,i)=>(e[i]=t[i]??null,e),{})}function extractDecoratedPropertyMetadata(t,e){const i=e.toString();for(;isDecoratedObject(t);){const s=t[CONFIG_KEY];if(Object.hasOwn(s,i))return s[i];t=Object.getPrototypeOf(t)}}function objectsEqual(t,e){return Array.isArray(t)?!Array.isArray(e)||t.length!==e.length?!1:t.every((i,s)=>objectsEqual(i,e[s])):(0,import_ag_charts_core4.isPlainObject)(t)?(0,import_ag_charts_core4.isPlainObject)(e)?objectsEqualWith(t,e,objectsEqual):!1:t===e}function objectsEqualWith(t,e,i){for(const s of Object.keys(e))if(!(s in t))return!1;for(const s of Object.keys(t))if(!(s in e)||!i(t[s],e[s]))return!1;return!0}function mergeDefaults(...t){const e={};for(const i of t){if(!(0,import_ag_charts_core4.isObject)(i))continue;const s=isDecoratedObject(i)?listDecoratedProperties(i):Object.keys(i);for(const n of s)(0,import_ag_charts_core4.isPlainObject)(e[n])&&(0,import_ag_charts_core4.isPlainObject)(i[n])?e[n]=mergeDefaults(e[n],i[n]):e[n]??(e[n]=i[n])}return e}function merge(...t){const e={};for(const i of t){if(!(0,import_ag_charts_core4.isObject)(i))continue;const s=isDecoratedObject(i)?listDecoratedProperties(i):Object.keys(i);for(const n of s)(0,import_ag_charts_core4.isPlainObject)(e[n])&&(0,import_ag_charts_core4.isPlainObject)(i[n])?e[n]=merge(e[n],i[n]):n in e||(e[n]??(e[n]=i[n]))}return e}function mergeArrayDefaults(t,...e){return e&&(0,import_ag_charts_core4.isArray)(t)?t.map(i=>mergeDefaults(i,...e)):t}function mapValues(t,e){const i={};for(const[s,n]of(0,import_ag_charts_core4.entries)(t))i[s]=e(n,s,t);return i}function without(t,e){const i={...t};for(const s of e)delete i[s];return i}function getPath(t,e){return((0,import_ag_charts_core4.isArray)(e)?e:e.split(".")).reduce((s,n)=>s[n],t)}var SKIP_JS_BUILTINS=new Set(["__proto__","constructor","prototype"]);function setPath(t,e,i){const s=(0,import_ag_charts_core4.isArray)(e)?e.slice():e.split("."),n=s.pop();if(s.some(o=>SKIP_JS_BUILTINS.has(o)))return;const r=s.reduce((o,a)=>o[a],t);return r[n]=i,r[n]}function partialAssign(t,e,i){if(i===void 0)return e;for(const s of t){const n=i[s];n!==void 0&&(e[s]=n)}return e}function deepFreeze(t){return t==null||typeof t!="object"||!(0,import_ag_charts_core4.isPlainObject)(t)||(Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{const i=t[e];i!==null&&(typeof i=="object"||typeof i=="function")&&!Object.isFrozen(i)&&deepFreeze(i)})),t}var import_ag_charts_core8=require("ag-charts-core"),twoPi=Math.PI*2,halfPi=Math.PI/2;function normalizeAngle360(t){return t%=twoPi,t+=twoPi,t%=twoPi,t}function normalizeAngle360Inclusive(t){return t%=twoPi,t+=twoPi,t!==twoPi&&(t%=twoPi),t}function normalizeAngle180(t){return t%=twoPi,t<-Math.PI?t+=twoPi:t>=Math.PI&&(t-=twoPi),t}function isBetweenAngles(t,e,i){const s=normalizeAngle360(t),n=normalizeAngle360(e),r=normalizeAngle360(i);return n<r?n<=s&&s<=r:n>r?n<=s||s<=r:!0}function toRadians(t){return t/180*Math.PI}function toDegrees(t){return t/Math.PI*180}function angleBetween(t,e){return t=normalizeAngle360(t),e=normalizeAngle360(e),e-t+(t>e?twoPi:0)}function getAngleRatioRadians(t){const e=normalizeAngle360(t);return e<=halfPi?e/halfPi:e<=Math.PI?(Math.PI-e)/halfPi:e<=1.5*Math.PI?(e-Math.PI)/halfPi:(twoPi-e)/halfPi}var import_ag_charts_core7=require("ag-charts-core"),import_ag_charts_core6=require("ag-charts-core"),import_ag_charts_core5=require("ag-charts-core"),lerp=(t,e,i)=>t*(1-i)+e*i,srgbToLinear=t=>{const e=t<0?-1:1,i=Math.abs(t);return i<=.04045?t/12.92:e*((i+.055)/1.055)**2.4},srgbFromLinear=t=>{const e=t<0?-1:1,i=Math.abs(t);return i>.0031308?e*(1.055*i**(1/2.4)-.055):12.92*t},_Color=class q{constructor(e,i,s,n=1){this.r=(0,import_ag_charts_core5.clamp)(0,e||0,1),this.g=(0,import_ag_charts_core5.clamp)(0,i||0,1),this.b=(0,import_ag_charts_core5.clamp)(0,s||0,1),this.a=(0,import_ag_charts_core5.clamp)(0,n||0,1)}static validColorString(e){return e.indexOf("#")>=0?!!q.parseHex(e):e.indexOf("rgb")>=0?!!q.stringToRgba(e):q.nameToHex.has(e.toLowerCase())}static fromString(e){if(e.indexOf("#")>=0)return q.fromHexString(e);const i=q.nameToHex.get(e.toLowerCase());if(i)return q.fromHexString(i);if(e.indexOf("rgb")>=0)return q.fromRgbaString(e);throw new Error(`Invalid color string: '${e}'`)}static parseHex(e){e=e.replace(/ /g,"").slice(1);let i;switch(e.length){case 6:case 8:i=[];for(let s=0;s<e.length;s+=2)i.push(parseInt(`${e[s]}${e[s+1]}`,16));break;case 3:case 4:i=e.split("").map(s=>parseInt(s,16)).map(s=>s+s*16);break}if(i?.length>=3&&i.every(s=>s>=0))return i.length===3&&i.push(255),i}static fromHexString(e){const i=q.parseHex(e);if(i){const[s,n,r,o]=i;return new q(s/255,n/255,r/255,o/255)}throw new Error(`Malformed hexadecimal color string: '${e}'`)}static stringToRgba(e){let i=-1,s=-1;for(let a=0;a<e.length;a++){const l=e[a];if(i===-1&&l==="(")i=a;else if(l===")"){s=a;break}}if(i===-1||s===-1)return;const r=e.substring(i+1,s).split(","),o=[];for(let a=0;a<r.length;a++){const l=r[a];let c=parseFloat(l);if(!Number.isFinite(c))return;l.indexOf("%")>=0?(c=(0,import_ag_charts_core5.clamp)(0,c,100),c/=100):a===3?c=(0,import_ag_charts_core5.clamp)(0,c,1):(c=(0,import_ag_charts_core5.clamp)(0,c,255),c/=255),o.push(c)}return o}static fromRgbaString(e){const i=q.stringToRgba(e);if(i){if(i.length===3)return new q(i[0],i[1],i[2]);if(i.length===4)return new q(i[0],i[1],i[2],i[3])}throw new Error(`Malformed rgb/rgba color string: '${e}'`)}static fromArray(e){if(e.length===4)return new q(e[0],e[1],e[2],e[3]);if(e.length===3)return new q(e[0],e[1],e[2]);throw new Error("The given array should contain 3 or 4 color components (numbers).")}static fromHSB(e,i,s,n=1){const r=q.HSBtoRGB(e,i,s);return new q(r[0],r[1],r[2],n)}static fromHSL(e,i,s,n=1){const r=q.HSLtoRGB(e,i,s);return new q(r[0],r[1],r[2],n)}static fromOKLCH(e,i,s,n=1){const r=q.OKLCHtoRGB(e,i,s);return new q(r[0],r[1],r[2],n)}static padHex(e){return e.length===1?"0"+e:e}toHexString(){let e="#"+q.padHex(Math.round(this.r*255).toString(16))+q.padHex(Math.round(this.g*255).toString(16))+q.padHex(Math.round(this.b*255).toString(16));return this.a<1&&(e+=q.padHex(Math.round(this.a*255).toString(16))),e}toRgbaString(e=3){const i=[Math.round(this.r*255),Math.round(this.g*255),Math.round(this.b*255)],s=Math.pow(10,e);return this.a!==1?(i.push(Math.round(this.a*s)/s),`rgba(${i.join(", ")})`):`rgb(${i.join(", ")})`}toString(){return this.a===1?this.toHexString():this.toRgbaString()}toHSB(){return q.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(e,i,s){const n=srgbToLinear(e),r=srgbToLinear(i),o=srgbToLinear(s),a=Math.cbrt(.4122214708*n+.5363325363*r+.0514459929*o),l=Math.cbrt(.2119034982*n+.6806995451*r+.1073969566*o),c=Math.cbrt(.0883024619*n+.2817188376*r+.6299787005*o),h=.2104542553*a+.793617785*l-.0040720468*c,u=1.9779984951*a-2.428592205*l+.4505937099*c,d=.0259040371*a+.7827717662*l-.808675766*c,p=Math.atan2(d,u)*180/Math.PI,g=h,m=Math.hypot(u,d),y=p>=0?p:p+360;return[g,m,y]}static OKLCHtoRGB(e,i,s){const n=e,r=i*Math.cos(s*Math.PI/180),o=i*Math.sin(s*Math.PI/180),a=(n+.3963377774*r+.2158037573*o)**3,l=(n-.1055613458*r-.0638541728*o)**3,c=(n-.0894841775*r-1.291485548*o)**3,h=4.0767416621*a-3.3077115913*l+.2309699292*c,u=-1.2684380046*a+2.6097574011*l-.3413193965*c,d=-.0041960863*a-.7034186147*l+1.707614701*c,p=srgbFromLinear(h),g=srgbFromLinear(u),m=srgbFromLinear(d);return[p,g,m]}static RGBtoHSL(e,i,s){const n=Math.min(e,i,s),r=Math.max(e,i,s),o=(r+n)/2;let a,l;if(r===n)a=0,l=0;else{const c=r-n;l=o>.5?c/(2-r-n):c/(r+n),r===e?a=(i-s)/c+(i<s?6:0):r===i?a=(s-e)/c+2:a=(e-i)/c+4,a*=360/6}return[a,l,o]}static HSLtoRGB(e,i,s){if(e=(e%360+360)%360,i===0)return[s,s,s];const n=s<.5?s*(1+i):s+i-s*i,r=2*s-n;function o(h){return h<0&&(h+=1),h>1&&(h-=1),h<1/6?r+(n-r)*6*h:h<1/2?n:h<2/3?r+(n-r)*(2/3-h)*6:r}const a=o(e/360+1/3),l=o(e/360),c=o(e/360-1/3);return[a,l,c]}static RGBtoHSB(e,i,s){const n=Math.min(e,i,s),r=Math.max(e,i,s),o=r===0?0:(r-n)/r;let a=0;if(n!==r){const l=r-n,c=(r-e)/l,h=(r-i)/l,u=(r-s)/l;e===r?a=u-h:i===r?a=2+c-u:a=4+h-c,a/=6,a<0&&(a=a+1)}return[a*360,o,r]}static HSBtoRGB(e,i,s){e=(e%360+360)%360/360;let n=0,r=0,o=0;if(i===0)n=r=o=s;else{const a=(e-Math.floor(e))*6,l=a-Math.floor(a),c=s*(1-i),h=s*(1-i*l),u=s*(1-i*(1-l));switch(a>>0){case 0:n=s,r=u,o=c;break;case 1:n=h,r=s,o=c;break;case 2:n=c,r=s,o=u;break;case 3:n=c,r=h,o=s;break;case 4:n=u,r=c,o=s;break;case 5:n=s,r=c,o=h;break}}return[n,r,o]}static mix(e,i,s){return new q(lerp(e.r,i.r,s),lerp(e.g,i.g,s),lerp(e.b,i.b,s),lerp(e.a,i.a,s))}static lighten(e,i){const s=q.RGBtoOKLCH(e.r,e.g,e.b);return q.fromOKLCH((0,import_ag_charts_core5.clamp)(0,s[0]+i,1),s[1],s[2])}static darken(e,i){const s=q.RGBtoOKLCH(e.r,e.g,e.b);return q.fromOKLCH((0,import_ag_charts_core5.clamp)(0,s[0]-i,1),s[1],s[2])}static interpolate(e,i){const s=1/(e.length-1),n=e.map(r=>q.RGBtoOKLCH(r.r,r.g,r.b));return Array.from({length:i},(r,o)=>{const a=o/(i-1),l=e.length<=2?0:Math.min(Math.floor(a*(e.length-1)),e.length-2),c=(a-l*s)/s,h=n[l],u=n[l+1];return q.fromOKLCH(lerp(h[0],u[0],c),lerp(h[1],u[1],c),lerp(h[2],u[2],c))})}};_Color.nameToHex=new Map([["aliceblue","#F0F8FF"],["antiquewhite","#FAEBD7"],["aqua","#00FFFF"],["aquamarine","#7FFFD4"],["azure","#F0FFFF"],["beige","#F5F5DC"],["bisque","#FFE4C4"],["black","#000000"],["blanchedalmond","#FFEBCD"],["blue","#0000FF"],["blueviolet","#8A2BE2"],["brown","#A52A2A"],["burlywood","#DEB887"],["cadetblue","#5F9EA0"],["chartreuse","#7FFF00"],["chocolate","#D2691E"],["coral","#FF7F50"],["cornflowerblue","#6495ED"],["cornsilk","#FFF8DC"],["crimson","#DC143C"],["cyan","#00FFFF"],["darkblue","#00008B"],["darkcyan","#008B8B"],["darkgoldenrod","#B8860B"],["darkgray","#A9A9A9"],["darkgreen","#006400"],["darkgrey","#A9A9A9"],["darkkhaki","#BDB76B"],["darkmagenta","#8B008B"],["darkolivegreen","#556B2F"],["darkorange","#FF8C00"],["darkorchid","#9932CC"],["darkred","#8B0000"],["darksalmon","#E9967A"],["darkseagreen","#8FBC8F"],["darkslateblue","#483D8B"],["darkslategray","#2F4F4F"],["darkslategrey","#2F4F4F"],["darkturquoise","#00CED1"],["darkviolet","#9400D3"],["deeppink","#FF1493"],["deepskyblue","#00BFFF"],["dimgray","#696969"],["dimgrey","#696969"],["dodgerblue","#1E90FF"],["firebrick","#B22222"],["floralwhite","#FFFAF0"],["forestgreen","#228B22"],["fuchsia","#FF00FF"],["gainsboro","#DCDCDC"],["ghostwhite","#F8F8FF"],["gold","#FFD700"],["goldenrod","#DAA520"],["gray","#808080"],["green","#008000"],["greenyellow","#ADFF2F"],["grey","#808080"],["honeydew","#F0FFF0"],["hotpink","#FF69B4"],["indianred","#CD5C5C"],["indigo","#4B0082"],["ivory","#FFFFF0"],["khaki","#F0E68C"],["lavender","#E6E6FA"],["lavenderblush","#FFF0F5"],["lawngreen","#7CFC00"],["lemonchiffon","#FFFACD"],["lightblue","#ADD8E6"],["lightcoral","#F08080"],["lightcyan","#E0FFFF"],["lightgoldenrodyellow","#FAFAD2"],["lightgray","#D3D3D3"],["lightgreen","#90EE90"],["lightgrey","#D3D3D3"],["lightpink","#FFB6C1"],["lightsalmon","#FFA07A"],["lightseagreen","#20B2AA"],["lightskyblue","#87CEFA"],["lightslategray","#778899"],["lightslategrey","#778899"],["lightsteelblue","#B0C4DE"],["lightyellow","#FFFFE0"],["lime","#00FF00"],["limegreen","#32CD32"],["linen","#FAF0E6"],["magenta","#FF00FF"],["maroon","#800000"],["mediumaquamarine","#66CDAA"],["mediumblue","#0000CD"],["mediumorchid","#BA55D3"],["mediumpurple","#9370DB"],["mediumseagreen","#3CB371"],["mediumslateblue","#7B68EE"],["mediumspringgreen","#00FA9A"],["mediumturquoise","#48D1CC"],["mediumvioletred","#C71585"],["midnightblue","#191970"],["mintcream","#F5FFFA"],["mistyrose","#FFE4E1"],["moccasin","#FFE4B5"],["navajowhite","#FFDEAD"],["navy","#000080"],["oldlace","#FDF5E6"],["olive","#808000"],["olivedrab","#6B8E23"],["orange","#FFA500"],["orangered","#FF4500"],["orchid","#DA70D6"],["palegoldenrod","#EEE8AA"],["palegreen","#98FB98"],["paleturquoise","#AFEEEE"],["palevioletred","#DB7093"],["papayawhip","#FFEFD5"],["peachpuff","#FFDAB9"],["peru","#CD853F"],["pink","#FFC0CB"],["plum","#DDA0DD"],["powderblue","#B0E0E6"],["purple","#800080"],["rebeccapurple","#663399"],["red","#FF0000"],["rosybrown","#BC8F8F"],["royalblue","#4169E1"],["saddlebrown","#8B4513"],["salmon","#FA8072"],["sandybrown","#F4A460"],["seagreen","#2E8B57"],["seashell","#FFF5EE"],["sienna","#A0522D"],["silver","#C0C0C0"],["skyblue","#87CEEB"],["slateblue","#6A5ACD"],["slategray","#708090"],["slategrey","#708090"],["snow","#FFFAFA"],["springgreen","#00FF7F"],["steelblue","#4682B4"],["tan","#D2B48C"],["teal","#008080"],["thistle","#D8BFD8"],["tomato","#FF6347"],["transparent","#00000000"],["turquoise","#40E0D0"],["violet","#EE82EE"],["wheat","#F5DEB3"],["white","#FFFFFF"],["whitesmoke","#F5F5F5"],["yellow","#FFFF00"],["yellowgreen","#9ACD32"]]);var Color=_Color,AbstractScale=class{ticks(t,e,i){}niceDomain(t,e=this.domain){return e}tickFormatter(t){}datumFormatter(t){}get bandwidth(){}get step(){}get inset(){}},Invalidating=(t,e)=>{const i=Symbol(String(e));t[i]=void 0,Object.defineProperty(t,e,{get(){return this[i]},set(s){this[i]!==s&&(this[i]=s,this.invalid=!0)},enumerable:!0,configurable:!1})},convertColorStringToOklcha=t=>{const e=Color.fromString(t),[i,s,n]=Color.RGBtoOKLCH(e.r,e.g,e.b);return{l:i,c:s,h:n,a:e.a}},delta=1e-6,isAchromatic=t=>t.c<delta||t.l<delta||t.l>1-delta,interpolateOklch=(t,e,i)=>{i=(0,import_ag_charts_core6.clamp)(0,i,1);let s;if(isAchromatic(t))s=e.h;else if(isAchromatic(e))s=t.h;else{const a=t.h;let l=e.h;const c=e.h-t.h;c>180?l-=360:c<-180&&(l+=360),s=a*(1-i)+l*i}const n=t.c*(1-i)+e.c*i,r=t.l*(1-i)+e.l*i,o=t.a*(1-i)+e.a*i;return Color.fromOKLCH(r,n,s,o)},ColorScale=class extends AbstractScale{constructor(){super(...arguments),this.type="color",this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.parsedRange=this.range.map(convertColorStringToOklcha)}update(){const{domain:t,range:e}=this;t.length<2&&(import_ag_charts_core6.Logger.warnOnce("`colorDomain` should have at least 2 values."),t.length===0?t.push(0,1):t.length===1&&t.push(t[0]+1));for(let i=1;i<t.length;i++){const s=t[i-1],n=t[i];if(s>=n){import_ag_charts_core6.Logger.warnOnce("`colorDomain` values should be supplied in ascending order."),t.sort((r,o)=>r-o);break}}if(e.length<t.length)for(let i=e.length;i<t.length;i++)e.push(e.length>0?e[0]:"black");this.parsedRange=this.range.map(convertColorStringToOklcha)}normalizeDomains(...t){return{domain:t.flat(),animatable:!0}}toDomain(){}convert(t){this.refresh();const{domain:e,range:i,parsedRange:s}=this,n=e[0],r=e.at(-1),o=i[0],a=i[i.length-1];if(t<=n)return o;if(t>=r)return a;let l,c;if(e.length===2){const d=(t-n)/(r-n),p=1/(i.length-1);l=i.length<=2?0:Math.min(Math.floor(d*(i.length-1)),i.length-2),c=(d-l*p)/p}else{for(l=0;l<e.length-2&&!(t<e[l+1]);l++);const d=e[l],p=e[l+1];c=(t-d)/(p-d)}const h=s[l],u=s[l+1];return interpolateOklch(h,u,c).toRgbaString()}invert(){}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&import_ag_charts_core6.Logger.warnOnce("Expected update to not invalidate scale"))}};__decorateClass([Invalidating],ColorScale.prototype,"domain",2),__decorateClass([Invalidating],ColorScale.prototype,"range",2);var Gradient=class{constructor(t,e=[],i){this.colorSpace=t,this.stops=e,this.bbox=i,this._cache=void 0}createGradient(t,e,i){const s=this.bbox??e;if(isNaN(s.x)||isNaN(s.y))return;if(this._cache!=null&&this._cache.ctx===t&&this._cache.bbox.equals(s))return this._cache.gradient;const{stops:n,colorSpace:r}=this;if(n.length===0)return;if(n.length===1)return n[0].color;let o=this.createCanvasGradient(t,s,i);if(o==null)return;const a=r==="oklch",l=.05;let c=n[0];o.addColorStop(c.stop,c.color);for(let h=1;h<n.length;h+=1){const u=n[h];if(a){const d=new ColorScale;d.domain=[c.stop,u.stop],d.range=[c.color,u.color];for(let p=c.stop+l;p<u.stop;p+=l)o.addColorStop(p,d.convert(p))}o.addColorStop(u.stop,u.color),c=u}return"createPattern"in o&&(o=o.createPattern()),this._cache={ctx:t,bbox:s,gradient:o},o}toSvg(t){const e=this.bbox??t,i=this.createSvgGradient(e);return this.stops.forEach(({stop:s,color:n})=>{const r=(0,import_ag_charts_core7.createSvgElement)("stop");r.setAttribute("offset",`${s}`),r.setAttribute("stop-color",`${n}`),i.appendChild(r)}),i}},ConicGradient=class extends Gradient{constructor(t,e,i=0,s){super(t,e,s),this.angle=i}createCanvasGradient(t,e,i){const{angle:n}=this,r=normalizeAngle360(toRadians(n+-90)),o=i?.centerX??e.x+e.width*.5,a=i?.centerY??e.y+e.height*.5;return t.createConicGradient(r,o,a)}createSvgGradient(t){return(0,import_ag_charts_core8.createSvgElement)("linearGradient")}},import_ag_charts_core9=require("ag-charts-core"),LinearGradient=class extends Gradient{constructor(t,e,i=0,s){super(t,e,s),this.angle=i}getGradientPoints(t){const{angle:i}=this,s=normalizeAngle360(toRadians(i+90)),n=Math.cos(s),r=Math.sin(s),o=t.width,a=t.height,l=t.x+o*.5,c=t.y+a*.5,h=Math.sqrt(a*a+o*o)/2,u=Math.atan2(a,o);let d;s<Math.PI/2?d=s:s<Math.PI?d=Math.PI-s:s<1.5*Math.PI?d=s-Math.PI:d=2*Math.PI-s;const p=h*Math.abs(Math.cos(d-u));return{x0:l+n*p,y0:c+r*p,x1:l-n*p,y1:c-r*p}}createCanvasGradient(t,e){const{x0:i,y0:s,x1:n,y1:r}=this.getGradientPoints(e);return t.createLinearGradient(i,s,n,r)}createSvgGradient(t){const{x0:e,y0:i,x1:s,y1:n}=this.getGradientPoints(t),r=(0,import_ag_charts_core9.createSvgElement)("linearGradient");return r.setAttribute("x1",String(e)),r.setAttribute("y1",String(i)),r.setAttribute("x2",String(s)),r.setAttribute("y2",String(n)),r.setAttribute("gradientUnits","userSpaceOnUse"),r}},import_ag_charts_core10=require("ag-charts-core"),RadialGradient=class extends Gradient{constructor(t,e,i){super(t,e,i)}createCanvasGradient(t,e,i){const s=i?.centerX??e.x+e.width*.5,n=i?.centerY??e.y+e.height*.5,r=i?.innerRadius??0,o=i?.outerRadius??Math.hypot(e.width*.5,e.height*.5)/Math.SQRT2;return t.createRadialGradient(s,n,r,s,n,o)}createSvgGradient(t){const e=t.x+t.width*.5,i=t.y+t.height*.5,s=(0,import_ag_charts_core10.createSvgElement)("radialGradient");return s.setAttribute("cx",String(e)),s.setAttribute("cy",String(i)),s.setAttribute("r",String(Math.hypot(t.width*.5,t.height*.5)/Math.SQRT2)),s.setAttribute("gradientUnits","userSpaceOnUse"),s}},import_ag_charts_core13=require("ag-charts-core"),import_ag_charts_core11=require("ag-charts-core"),BaseProperties=class{handleUnknownProperties(t,e){}set(t){const{className:e=this.constructor.name}=this.constructor;if(typeof t!="object")return import_ag_charts_core11.Logger.warn(`unable to set ${e} - expecting a properties object`),this;const i=new Set(Object.keys(t));for(const s of listDecoratedProperties(this))if(i.has(s)){const n=t[s],r=this;if(isProperties(r[s]))if(r[s]instanceof PropertiesArray){const o=r[s].reset(n);o!=null?r[s]=o:import_ag_charts_core11.Logger.warn(`unable to set [${s}] - expecting a properties array`)}else r[s].set(n);else(0,import_ag_charts_core11.isPlainObject)(n)?r[s]=merge(n,r[s]??{}):r[s]=n;i.delete(s)}this.handleUnknownProperties(i,t);for(const s of i)import_ag_charts_core11.Logger.warn(`unable to set [${s}] in ${e} - property is unknown`);return this}isValid(t){return listDecoratedProperties(this).every(e=>{const i=extractDecoratedPropertyMetadata(this,e);if(i==null)return!0;const s=i.optional===!0||typeof this[e]<"u";return s||import_ag_charts_core11.Logger.warnOnce(`${t??""}[${e}] is required.`),s})}toJson(){return listDecoratedProperties(this).reduce((t,e)=>{const i=this[e];return t[e]=isProperties(i)?i.toJson():i,t},{})}},PropertiesArray=class Rt extends Array{constructor(e,...i){super(i.length);const n=(r=>!!r?.prototype?.constructor?.name)(e)?r=>new e().set(r):e;Object.defineProperty(this,"itemFactory",{value:n,enumerable:!1,configurable:!1}),this.set(i)}set(e){if((0,import_ag_charts_core11.isArray)(e)){this.length=e.length;for(let i=0;i<e.length;i++)this[i]=this.itemFactory(e[i])}return this}reset(e){if(Array.isArray(e))return new Rt(this.itemFactory,...e)}toJson(){return this.map(e=>e?.toJson?.()??e)}};function isProperties(t){return t instanceof BaseProperties||t instanceof PropertiesArray}var import_ag_charts_core12=require("ag-charts-core");function Validate(t,e={}){const{optional:i=!1}=e;return addTransformToInstanceProperty((s,n,r)=>{const o={...e,target:s,property:n};if(i&&typeof r>"u"||t(r,o))return isProperties(s[n])&&!isProperties(r)?(s[n].set(r),s[n]):r;const a=(0,import_ag_charts_core12.stringifyValue)(r,50),l=String(n).replace(/^_*/,""),c=s.constructor.className??s.constructor.name.replace(/Properties$/,""),h=t.message?`; expecting ${getPredicateMessage(t,o)}`:"";return import_ag_charts_core12.Logger.warn(`Property [${l}] of [${c}] cannot be set to [${a}]${h}, ignoring.`),BREAK_TRANSFORM_CHAIN},void 0,{optional:i})}var TestEnv=!1,TempValidate=TestEnv?(t,e={})=>{const{optional:i=!1}=e;return addTransformToInstanceProperty((s,n,r)=>{const o={...e,target:s,property:n};if(i&&typeof r>"u"||t(r,o)){if(isProperties(s[n])&&!isProperties(r))return s[n].set(r),s[n]}else{const a=(0,import_ag_charts_core12.stringifyValue)(r,50),l=String(n).replace(/^_*/,""),c=s.constructor.className??s.constructor.name.replace(/Properties$/,""),h=t.message?`; expecting ${getPredicateMessage(t,o)}`:"";import_ag_charts_core12.Logger.warn(`TempValidation!!! Property [${l}] of [${c}] cannot be set to [${a}]${h}, ignoring.`)}return r},void 0,{optional:i})}:()=>addFakeTransformToInstanceProperty,AND=(...t)=>{const e=[];return predicateWithMessage((i,s)=>(e.length=0,t.every(n=>{const r=n(i,s);return r||e.push(getPredicateMessage(n,s)),r})),()=>e.filter(Boolean).join(" AND "))},OR=(...t)=>predicateWithMessage((e,i)=>t.some(s=>s(e,i)),e=>t.map(getPredicateMessageMapper(e)).filter(Boolean).join(" OR ")),OBJECT=attachObjectRestrictions(predicateWithMessage((t,e)=>isProperties(t)||(0,import_ag_charts_core12.isObject)(t)&&isProperties(e.target[e.property]),"a properties object")),PLAIN_OBJECT=attachObjectRestrictions(predicateWithMessage(t=>(0,import_ag_charts_core12.isObject)(t),"an object")),BOOLEAN=predicateWithMessage(import_ag_charts_core12.isBoolean,"a boolean"),FUNCTION=predicateWithMessage(import_ag_charts_core12.isFunction,"a function"),STRING=predicateWithMessage(import_ag_charts_core12.isString,"a string"),NUMBER=attachNumberRestrictions(predicateWithMessage(import_ag_charts_core12.isFiniteNumber,"a number")),REAL_NUMBER=predicateWithMessage(t=>(0,import_ag_charts_core12.isNumber)(t)&&!isNaN(t),"a real number"),NAN=predicateWithMessage(t=>(0,import_ag_charts_core12.isNumber)(t)&&isNaN(t),"NaN"),POSITIVE_NUMBER=NUMBER.restrict({min:0}),RATIO=NUMBER.restrict({min:0,max:1}),NUMBER_OR_NAN=OR(NUMBER,NAN),ARRAY=attachArrayRestrictions(predicateWithMessage(import_ag_charts_core12.isArray,"an array")),ARRAY_OF=(t,e)=>predicateWithMessage((i,s)=>(0,import_ag_charts_core12.isArray)(i)&&i.every(n=>t(n,s)),i=>{const s=getPredicateMessage(ARRAY,i)??"";return typeof e=="function"?`${s} of ${e(i)}`:e?`${s} of ${e}`:s}),isComparable=t=>(0,import_ag_charts_core12.isFiniteNumber)(t)||(0,import_ag_charts_core12.isValidDate)(t),LESS_THAN=t=>predicateWithMessage((e,i)=>!isComparable(e)||!isComparable(i.target[t])||e<i.target[t],`to be less than ${t}`),GREATER_THAN=t=>predicateWithMessage((e,i)=>!isComparable(e)||!isComparable(i.target[t])||e>i.target[t],`to be greater than ${t}`),DATE=predicateWithMessage(import_ag_charts_core12.isValidDate,"Date object"),DATE_OR_DATETIME_MS=OR(DATE,POSITIVE_NUMBER),colorMessage="A color string can be in one of the following formats to be valid: #rgb, #rrggbb, rgb(r, g, b), rgba(r, g, b, a) or a CSS color name such as 'white', 'orange', 'cyan', etc",COLOR_STRING=predicateWithMessage(import_ag_charts_core12.isColor,`color string. ${colorMessage}`),COLOR_GRADIENT=attachObjectRestrictions(predicateWithMessage(t=>(0,import_ag_charts_core12.isObject)(t)&&t.type==="gradient","a color gradient object")),COLOR_PATTERN=attachObjectRestrictions(predicateWithMessage(t=>(0,import_ag_charts_core12.isObject)(t)&&t.type==="pattern","a color pattern object")),COLOR_STRING_ARRAY=predicateWithMessage(ARRAY_OF(COLOR_STRING),`color strings. ${colorMessage}`),BOOLEAN_ARRAY=ARRAY_OF(BOOLEAN,"boolean values"),NUMBER_ARRAY=ARRAY_OF(NUMBER,"numbers"),STRING_ARRAY=ARRAY_OF(STRING,"strings"),DATE_ARRAY=predicateWithMessage(ARRAY_OF(DATE),"Date objects"),OBJECT_ARRAY=predicateWithMessage(ARRAY_OF(OBJECT),"objects"),LINE_CAP=UNION(["butt","round","square"],"a line cap"),LINE_JOIN=UNION(["round","bevel","miter"],"a line join"),LINE_STYLE=UNION(["solid","dashed","dotted"],"a line style"),LINE_DASH=predicateWithMessage(ARRAY_OF(POSITIVE_NUMBER),"numbers specifying the length in pixels of alternating dashes and gaps, for example, [6, 3] means dashes with a length of 6 pixels with gaps between of 3 pixels."),POSITION=UNION(["top","right","bottom","left"],"a position"),FONT_STYLE=UNION(["normal","italic","oblique"],"a font style"),FONT_WEIGHT=OR(UNION(["normal","bold","bolder","lighter"],"a font weight"),NUMBER.restrict({min:1,max:1e3})),TEXT_WRAP=UNION(["never","always","hyphenate","on-space"],"a text wrap strategy"),TEXT_ALIGN=UNION(["left","center","right"],"a text align"),VERTICAL_ALIGN=UNION(["top","middle","bottom"],"a vertical align"),OVERFLOW_STRATEGY=UNION(["ellipsis","hide"],"an overflow strategy"),DIRECTION=UNION(["horizontal","vertical"],"a direction"),PLACEMENT=UNION(["inside","outside"],"a placement"),INTERACTION_RANGE=OR(UNION(["exact","nearest"],"interaction range"),NUMBER),LABEL_PLACEMENT=UNION(["top","bottom","left","right"]);function UNION(t,e="a"){return predicateWithMessage((i,s)=>{const n=t.find(r=>{const o=typeof r=="string"?r:r.value;return i===o});if(n==null)return!1;if(typeof n!="string"&&(n.deprecated===!0||n.deprecatedTo!=null)){const r=[`Property [%s] with value '${n.value}' is deprecated.`];n.deprecatedTo&&r.push(`Use ${n.deprecatedTo} instead.`),import_ag_charts_core12.Logger.warnOnce(r.join(" "),s.property)}return!0},`${e} keyword such as ${joinUnionOptions(t)}`)}var MIN_SPACING=OR(AND(NUMBER.restrict({min:1}),LESS_THAN("maxSpacing")),NAN),MAX_SPACING=OR(AND(NUMBER.restrict({min:1}),GREATER_THAN("minSpacing")),NAN);function predicateWithMessage(t,e){return t.message=e,t}function joinUnionOptions(t){const e=t.filter(s=>typeof s=="string"||s.undocumented!==!0).map(s=>`'${typeof s=="string"?s:s.value}'`);if(e.length===1)return e[0];const i=e.pop();return`${e.join(", ")} or ${i}`}function getPredicateMessage(t,e){return(0,import_ag_charts_core12.isFunction)(t.message)?t.message(e):t.message}function getPredicateMessageMapper(t){return e=>getPredicateMessage(e,t)}function attachArrayRestrictions(t){return Object.assign(t,{restrict({length:e,minLength:i}={}){let s="an array";return(0,import_ag_charts_core12.isNumber)(i)&&i>0?s="a non-empty array":(0,import_ag_charts_core12.isNumber)(e)&&(s=`an array of length ${e}`),predicateWithMessage(n=>(0,import_ag_charts_core12.isArray)(n)&&((0,import_ag_charts_core12.isNumber)(e)?n.length===e:!0)&&((0,import_ag_charts_core12.isNumber)(i)?n.length>=i:!0),s)}})}function attachNumberRestrictions(t){return Object.assign(t,{restrict({min:e,max:i}={}){const s=["a number"],n=(0,import_ag_charts_core12.isNumber)(e),r=(0,import_ag_charts_core12.isNumber)(i);return n&&r?s.push(`between ${e} and ${i} inclusive`):n?s.push(`greater than or equal to ${e}`):r&&s.push(`less than or equal to ${i}`),predicateWithMessage(o=>(0,import_ag_charts_core12.isFiniteNumber)(o)&&(n?o>=e:!0)&&(r?o<=i:!0),s.join(" "))}})}function attachObjectRestrictions(t){return Object.assign(t,{restrict(e){return predicateWithMessage(i=>i instanceof e,i=>getPredicateMessage(t,i)??`an instance of ${e.name}`)}})}var StopProperties=class extends BaseProperties{constructor(){super(...arguments),this.color="black"}};__decorateClass([TempValidate(NUMBER,{optional:!0})],StopProperties.prototype,"stop",2),__decorateClass([TempValidate(COLOR_STRING,{optional:!0})],StopProperties.prototype,"color",2);function stopsAreAscending(t){let e;for(const i of t)if(i?.stop!=null){if(e!=null&&i.stop<e)return!1;e=i.stop}return!0}function discreteColorStops(t){return t.flatMap((e,i)=>{const{stop:s}=e,n=t.at(i+1)?.color;return n!=null?[e,{stop:s,color:n}]:[e]})}function getDefaultColorStops(t,e){const i=e==="discrete"?1:0,s=t.map((n,r,{length:o})=>({stop:(r+i)/(o-1+i),color:n}));return e==="discrete"?discreteColorStops(s):s}function getColorStops(t,e,i,s="continuous"){const n=t.map(g=>typeof g=="string"?{color:g}:g);if(n.length===0)return getDefaultColorStops(e,s);if(!stopsAreAscending(n))return import_ag_charts_core13.Logger.warnOnce("[fills] must have the stops defined in ascending order"),[];const r=Math.min(...i),o=Math.max(...i),a=s==="discrete",l=new Float64Array(n.length);let c=0,h=-1;for(let g=0;g<n.length;g+=1){const m=n[g];if(g>=h){h=n.length-1;for(let f=g+1;f<n.length;f+=1)if(n[f]?.stop!=null){h=f;break}}let y=m?.stop;if(y==null){const f=n[c]?.stop,b=n[h]?.stop,v=f??r,x=b??o,S=a&&f==null?1:0;y=v+(x-v)*(g-c+S)/(h-c+S)}else c=g;l[g]=Math.max(0,Math.min(1,(y-r)/(o-r)))}let u=n.find(g=>g.color!=null)?.color,d;const p=n.map((g,m)=>{let y=g?.color;const f=l[m];return y!=null?u=y:u!=null?y=u:(d==null&&(d=new ColorScale,d.domain=[0,1],d.range=e),y=d.convert(f)),{stop:f,color:y}});return s==="discrete"?discreteColorStops(p):p}var import_ag_charts_core15=require("ag-charts-core"),import_ag_charts_core14=require("ag-charts-core");function pointsDistanceSquared(t,e,i,s){const n=t-i,r=e-s;return n*n+r*r}function lineDistanceSquared(t,e,i,s,n,r,o){if(i===n&&s===r)return Math.min(o,pointsDistanceSquared(t,e,i,s));const a=n-i,l=r-s,c=Math.max(0,Math.min(1,((t-i)*a+(e-s)*l)/(a*a+l*l))),h=i+c*a,u=s+c*l;return Math.min(o,pointsDistanceSquared(t,e,h,u))}function arcDistanceSquared(t,e,i,s,n,r,o,a,l){a&&([o,r]=[r,o]);const c=Math.atan2(e-s,t-i);if(!isBetweenAngles(c,r,o)){const u=i+Math.cos(r)*n,d=s+Math.sin(r)*n,p=i+Math.cos(r)*n,g=s+Math.sin(r)*n;return Math.min(l,pointsDistanceSquared(t,e,u,d),pointsDistanceSquared(t,e,p,g))}const h=n-Math.sqrt(pointsDistanceSquared(t,e,i,s));return Math.min(l,h*h)}function linearRoot(t,e){const i=-e/t;return t!==0&&i>=0&&i<=1?[i]:[]}function quadraticRoots(t,e,i){if(t===0)return linearRoot(e,i);const s=e*e-4*t*i,n=[];if(s===0){const r=-e/(2*t);r>=0&&r<=1&&n.push(r)}else if(s>0){const r=Math.sqrt(s),o=(-e-r)/(2*t),a=(-e+r)/(2*t);o>=0&&o<=1&&n.push(o),a>=0&&a<=1&&n.push(a)}return n}function cubicRoots(t,e,i,s){if(t===0)return quadraticRoots(e,i,s);const n=e/t,r=i/t,o=s/t,a=(3*r-n*n)/9,l=(9*n*r-27*o-2*n*n*n)/54,c=a*a*a+l*l,h=1/3,u=[];if(c>=0){const d=Math.sqrt(c),p=Math.sign(l+d)*Math.pow(Math.abs(l+d),h),g=Math.sign(l-d)*Math.pow(Math.abs(l-d),h),m=Math.abs(Math.sqrt(3)*(p-g)/2),y=-h*n+(p+g);if(y>=0&&y<=1&&u.push(y),m===0){const f=-h*n-(p+g)/2;f>=0&&f<=1&&u.push(f)}}else{const d=Math.acos(l/Math.sqrt(-a*a*a)),p=h*n,g=2*Math.sqrt(-a),m=g*Math.cos(h*d)-p,y=g*Math.cos(h*(d+2*Math.PI))-p,f=g*Math.cos(h*(d+4*Math.PI))-p;m>=0&&m<=1&&u.push(m),y>=0&&y<=1&&u.push(y),f>=0&&f<=1&&u.push(f)}return u}function segmentIntersection(t,e,i,s,n,r,o,a){const l=(i-t)*(a-r)-(s-e)*(o-n);if(l===0)return 0;const c=((o-n)*(e-r)-(t-n)*(a-r))/l,h=((i-t)*(e-r)-(s-e)*(t-n))/l;return c>=0&&c<=1&&h>=0&&h<=1?1:0}function cubicSegmentIntersections(t,e,i,s,n,r,o,a,l,c,h,u){let d=0;const p=c-u,g=h-l,m=l*(u-c)-c*(h-l),y=bezierCoefficients(t,i,n,o),f=bezierCoefficients(e,s,r,a),b=p*y[0]+g*f[0],v=p*y[1]+g*f[1],x=p*y[2]+g*f[2],S=p*y[3]+g*f[3]+m,A=cubicRoots(b,v,x,S);for(const I of A){const D=I*I,L=I*D,N=y[0]*L+y[1]*D+y[2]*I+y[3],T=f[0]*L+f[1]*D+f[2]*I+f[3];let w;l===h?w=(T-c)/(u-c):w=(N-l)/(h-l),w>=0&&w<=1&&d++}return d}function bezierCoefficients(t,e,i,s){return[-t+3*e-3*i+s,3*t-6*e+3*i,-3*t+3*e,t]}function arcIntersections(t,e,i,s,n,r,o,a,l,c){if(isNaN(t)||isNaN(e))return 0;r&&([n,s]=[s,n]);const h=(c-a)/(l-o),u=a-h*o,d=Math.pow(h,2)+1,p=2*(h*(u-e)-t),g=Math.pow(t,2)+Math.p