sryd-charts-enterprise
Version:
Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue
23 lines • 1.89 MB
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,o=t.length-1,a;o>=0;o--)(a=t[o])&&(n=(s?a(e,i,n):a(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,AgChartsEnterpriseModule:()=>AgChartsEnterpriseModule,AgErrorBarSupportedSeriesTypes:()=>AgErrorBarSupportedSeriesTypes,AgTooltipAnchorToType:()=>AgTooltipAnchorToType,AgTooltipPlacementType:()=>AgTooltipPlacementType,AgTooltipPositionType:()=>AgTooltipPositionType,LicenseManager:()=>LicenseManager2,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,setupEnterpriseModules:()=>setupEnterpriseModules2,time:()=>time_exports}),module.exports=__toCommonJS(main_exports);var __defProp2=Object.defineProperty,__export2=(t,e)=>{for(var i in e)__defProp2(t,i,{get:e[i],enumerable:!0})},logger_exports={};__export2(logger_exports,{error:()=>error,errorOnce:()=>errorOnce,log:()=>log,logGroup:()=>logGroup,reset:()=>reset,table:()=>table,warn:()=>warn,warnOnce:()=>warnOnce});var doOnceCache=new Set;function log(...t){console.log(...t)}function warn(t,...e){console.warn(`AG Charts - ${t}`,...e)}function error(t,...e){typeof t=="object"?console.error("AG Charts error",t,...e):console.error(`AG Charts - ${t}`,...e)}function table(...t){console.table(...t)}function warnOnce(t,...e){const i=`Logger.warn: ${t}`;doOnceCache.has(i)||(warn(t,...e),doOnceCache.add(i))}function errorOnce(t,...e){const i=`Logger.error: ${t}`;doOnceCache.has(i)||(error(t,...e),doOnceCache.add(i))}function reset(){doOnceCache.clear()}function logGroup(t,e){console.groupCollapsed(t);try{return e()}finally{console.groupEnd()}}var moduleRegistry_exports={};__export2(moduleRegistry_exports,{detectChartDefinition:()=>detectChartDefinition,getAxisModule:()=>getAxisModule,getSeriesModule:()=>getSeriesModule,hasModule:()=>hasModule,listModulesByType:()=>listModulesByType,register:()=>register,registerMany:()=>registerMany,reset:()=>reset2});var ModuleType=(t=>(t.Axis="axis",t.Chart="chart",t.Preset="preset",t.Plugin="plugin",t.Series="series",t))(ModuleType||{}),registeredModules=new Map;function register(t){const e=registeredModules.get(t.name);if(e&&(e.enterprise||!t.enterprise))throw new Error(`AG Charts - Module '${t.name}' already registered`);registeredModules.set(t.name,t)}function registerMany(t){for(const e of t)register(e)}function reset2(){registeredModules.clear()}function hasModule(t){return registeredModules.has(t)}function*listModulesByType(t){for(const e of registeredModules.values())e.type===t&&(yield e)}function detectChartDefinition(t){for(const e of registeredModules.values())if(isChartModule(e)&&e.detect(t))return e;throw new Error("AG Charts - Unknown chart type; Check options are correctly structured and series types are specified")}function getSeriesModule(t){const e=registeredModules.get(t);if(isSeriesModule(e))return e}function getAxisModule(t){const e=registeredModules.get(t);if(isAxisModule(e))return e}function isChartModule(t){return t?.type==="chart"}function isAxisModule(t){return t?.type==="axis"}function isSeriesModule(t){return t?.type==="series"}var EventEmitter=class{constructor(){this.events=new Map}on(t,e){return this.events.has(t)||this.events.set(t,new Set),this.events.get(t)?.add(e),()=>this.off(t,e)}off(t,e){const i=this.events.get(t);i&&(i.delete(e),i.size===0&&this.events.delete(t))}emit(t,e){this.events.get(t)?.forEach(i=>i(e))}clear(t){t?this.events.delete(t):this.events.clear()}};function joinFormatted(t,e="and",i=String,s=1/0){if(t.length===1)return i(t[0]);t=t.map(i);const n=t.pop();if(t.length>=s){const o=t.length-(s-1);return`${t.slice(0,s-1).join(", ")}, and ${o} more ${e} ${n}`}return`${t.join(", ")} ${e} ${n}`}function stringifyValue(t,e=1/0){if(typeof t=="number"){if(isNaN(t))return"NaN";if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity"}const i=JSON.stringify(t)??typeof t;return i.length>e?`${i.slice(0,e)}... (+${i.length-e} characters)`:i}function countLines(t){let e=1;for(let i=0;i<t.length;i++)t.charCodeAt(i)===10&&e++;return e}function levenshteinDistance(t,e){if(t===e)return 0;const[i,s]=t.length<e.length?[t,e]:[e,t],n=i.length,o=s.length;let a=new Array(n+1).fill(0).map((l,c)=>c),r=new Array(n+1);for(let l=1;l<=o;l++){r[0]=l;for(let c=1;c<=n;c++){const h=s[l-1]===i[c-1]?0:1;r[c]=Math.min(a[c]+1,r[c-1]+1,a[c-1]+h)}[a,r]=[r,a]}return a[n]}var verifiedGlobals={};typeof window<"u"?verifiedGlobals.window=window:typeof global<"u"&&(verifiedGlobals.window=global.window),typeof document<"u"?verifiedGlobals.document=document:typeof global<"u"&&(verifiedGlobals.document=global.document);function getDocument(t){return t?verifiedGlobals.document?.[t]:verifiedGlobals.document}function getWindow(t){return t?verifiedGlobals.window?.[t]:verifiedGlobals.window}function setDocument(t){verifiedGlobals.document=t}function setWindow(t){verifiedGlobals.window=t}function createElement(t,e,i){const s=getDocument().createElement(t);if(typeof e=="object"&&(i=e,e=void 0),e)for(const n of e.split(" "))s.classList.add(n);return i&&Object.assign(s.style,i),s}function createSvgElement(t){return getDocument().createElementNS("http://www.w3.org/2000/svg",t)}function downloadUrl(t,e){const i=getDocument("body"),s=createElement("a",{display:"none"});s.href=t,s.download=e,i.appendChild(s),s.click(),setTimeout(()=>i.removeChild(s))}function parseColor(t){const e=getWindow("Option"),{style:i}=new e;return i.color=t,i.color||null}function isDefined(t){return t!=null}function isArray(t){return Array.isArray(t)}function isBoolean(t){return typeof t=="boolean"}function isDate(t){return t instanceof Date}function isValidDate(t){return isDate(t)&&!isNaN(Number(t))}function isRegExp(t){return t instanceof RegExp}function isFunction(t){return typeof t=="function"}function isObject(t){return typeof t=="object"&&t!==null&&!isArray(t)}function isPlainObject(t){return typeof t=="object"&&t!==null&&t.constructor?.name==="Object"}function isString(t){return typeof t=="string"}function isNumber(t){return typeof t=="number"}function isFiniteNumber(t){return Number.isFinite(t)}function isHtmlElement(t){return typeof window<"u"&&t instanceof HTMLElement}function isEnumValue(t,e){return Object.values(t).includes(e)}function isSymbol(t){return typeof t=="symbol"}function isColor(t){return isString(t)&&parseColor(t)!=null}var descriptionSymbol=Symbol("description"),requiredSymbol=Symbol("required"),ValidationError=class{constructor(t,e,i,s){this.message=t,this.path=e,this.required=i,this.unknown=s}toString(){return this.message}};function validate(t,e,i=""){if(!isObject(t)){const l=validateMessage(i,t,"an object",!0);return{valid:null,errors:[new ValidationError(l,i,!0)]}}const s=[],n=new Set(Object.keys(t)),o=[],a={};function r(l){return isArray(e)?`${i}[${l}]`:i?`${i}.${l}`:l}for(const l of Object.keys(e)){const c=e[l],h=t[l],d=c[requiredSymbol];if(n.delete(l),typeof h>"u"&&(s.push(l),!d))continue;const u=r(l);if(isFunction(c)){const p={options:t,path:u};if(c(h,p))a[l]=p.result?.valid??h;else if(!p.result){const g=validateMessage(u,h,c,d);o.push(new ValidationError(g,i,d))}p.result&&o.push(...p.result.errors)}else{const p=validate(h,c,u);p.valid!=null&&(a[l]=p.valid),o.push(...p.errors)}}for(const l of n){if(typeof t[l]>"u")continue;const h=unknownMessage(l,r(l),s);o.push(new ValidationError(h,i,void 0,!0))}return{valid:a,errors:o}}function validateMessage(t,e,i,s){const n=isString(i)?i:i[descriptionSymbol],o=n?`; expecting ${n}`:"",a=t?`Option \`${t}\``:"Value";return s&&e==null?`${a} is required and has not been provided${o}, ignoring.`:`${a} cannot be set to \`${stringifyValue(e,50)}\`${o}, ignoring.`}function unknownMessage(t,e,i){const s=findSuggestion(t,i),n=s?`; Did you mean \`${s}\`? Ignoring.`:", ignoring.";return`Unknown option \`${e}\`${n}`}function findSuggestion(t,e,i=2){let s=1/0;const n=t.toLowerCase();return e.reduce((o,a)=>{const r=levenshteinDistance(n,a.toLowerCase());return s>r&&r<=i?(s=r,a):o},null)}function attachDescription(t,e){return Object.assign(isFunction(t)?(i,s)=>t(i,s):{...t},{[descriptionSymbol]:e})}function required(t){return Object.assign(isFunction(t)?(e,i)=>t(e,i):optionsDefs(t),{[requiredSymbol]:!0,[descriptionSymbol]:t[descriptionSymbol]})}var optionsDefs=(t,e="an object")=>attachDescription((i,s)=>(s.result=validate(i,t,s.path),!s.result.errors.some(n=>n.required&&n.path===s.path)),e),partialDefs=(t,e="an object")=>attachDescription((i,s)=>(s.result=validate(i,t,s.path),s.result.errors=s.result.errors.filter(n=>!n.unknown),!s.result.errors.some(n=>n.required&&n.path===s.path)),e),and=(...t)=>attachDescription((e,i)=>t.every(s=>{const n=s(e,i);return i.result&&!n&&delete i.result,n}),t.map(e=>e[descriptionSymbol]).filter(Boolean).join(" and ")),or=(...t)=>attachDescription((e,i)=>t.some(s=>{const n=s(e,i);return i.result&&!n&&delete i.result,n}),t.map(e=>e[descriptionSymbol]).filter(Boolean).join(" or ")),isComparable=t=>isFiniteNumber(t)||isValidDate(t),isValidDateValue=t=>isDate(t)||(isFiniteNumber(t)||isString(t))&&isValidDate(new Date(t)),array=attachDescription(isArray,"an array"),boolean=attachDescription(isBoolean,"a boolean"),callback=attachDescription(isFunction,"a function"),color=attachDescription(isColor,"a color string"),date=attachDescription(isValidDateValue,"a date"),defined=attachDescription(isDefined,"a defined value"),number=attachDescription(isFiniteNumber,"a number"),object=attachDescription(isObject,"an object"),string=attachDescription(isString,"a string"),arrayLength=(t,e=1/0)=>{let i;return e===1/0?i=`an array of at least ${t} items`:t===e?i=`an array of exactly ${t} items`:t===0?i=`an array of no more than ${e} items`:i=`an array of at least ${t} and no more than ${e} items`,attachDescription(s=>isArray(s)&&s.length>=t&&s.length<=e,i)},numberMin=(t,e=!0)=>attachDescription(i=>isFiniteNumber(i)&&(i>t||e&&i===t),`a number greater than ${e?"or equal to ":""}${t}`),numberRange=(t,e)=>attachDescription(i=>isFiniteNumber(i)&&i>=t&&i<=e,`a number between ${t} and ${e} inclusive`),positiveNumber=numberMin(0),positiveNumberNonZero=numberMin(0,!1),ratio=numberRange(0,1),lessThan=t=>attachDescription((e,{options:i})=>!isComparable(e)||!isComparable(i[t])||e<i[t],`the value to be less than \`${t}\``),greaterThan=t=>attachDescription((e,{options:i})=>!isComparable(e)||!isComparable(i[t])||e>i[t],`the value to be greater than \`${t}\``);function union(...t){isObject(t[0])&&(t=Object.values(t[0]));const e=joinFormatted(t,"or",i=>`'${i}'`);return attachDescription(i=>t.includes(i),`a keyword such as ${e}`)}var constant=t=>attachDescription(e=>t===e,`the value ${JSON.stringify(t)}`),instanceOf=(t,e)=>attachDescription(i=>i instanceof t,e??`an instance of ${t.name}`),arrayOf=(t,e)=>attachDescription((i,s)=>isArray(i)&&i.every(n=>{const o=t(n,s);return delete s.result,o}),e??`${t[descriptionSymbol]} array`),arrayOfDefs=(t,e="an object array")=>attachDescription((i,s)=>{if(!isArray(i))return!1;const n=[],o=[];for(let a=0;a<i.length;a++){const r=`${s.path}[${a}]`,l=validate(i[a],t,r);o.push(...l.errors),l.errors.some(c=>c.required&&c.path===r)||n.push(l.valid)}return s.result={valid:n,errors:o},!0},e),typeUnion=(t,e="an object")=>{const i=partialDefs({type:required(union(...Object.keys(t)))});return attachDescription((s,n)=>{if(i(s,n)){const o=s.type,a={type:required(constant(o)),...t[o]},r=optionsDefs(a)(s,n);if(n.result)for(const l of n.result.errors)l.message+=` (type="${o}")`;return r}return!1},e)},colorStop=optionsDefs({color,stop:ratio},""),colorStopsOrderValidator=attachDescription(t=>{let e=-1/0;for(const i of t)if(i?.stop!=null){if(i.stop<e)return!1;e=i.stop}return!0},"color stops to be defined in ascending order"),gradientColorStops=and(arrayLength(2),and(arrayOf(colorStop),colorStopsOrderValidator)),gradientBounds=union("axis","item","series"),gradientStrict=typeUnion({gradient:{gradient:union("linear","radial","conic"),bounds:gradientBounds,colorStops:required(gradientColorStops),rotation:number,reverse:boolean}},"a gradient object with color stops"),strokeOptionsDef={stroke:color,strokeWidth:positiveNumber,strokeOpacity:ratio},fillGradientDefaults=optionsDefs({type:required(constant("gradient")),gradient:required(union("linear","radial","conic")),bounds:required(gradientBounds),colorStops:required(or(gradientColorStops,and(arrayLength(2),arrayOf(color)))),rotation:required(number),reverse:required(boolean)}),fillPatternDefaults=optionsDefs({type:required(constant("pattern")),pattern:required(union("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses")),width:required(positiveNumber),height:required(positiveNumber),fill:required(color),fillOpacity:required(ratio),backgroundFill:required(color),backgroundFillOpacity:required(ratio),padding:required(positiveNumber),rotation:required(number),stroke:required(color),strokeWidth:required(positiveNumber),strokeOpacity:required(ratio)}),gradientUndocumentedOpts={gradient:union("linear","radial","conic"),bounds:gradientBounds,reverse:boolean},patternUndocumentedOpts={rotation:number,padding:positiveNumber},colorObject=typeUnion({gradient:{...gradientUndocumentedOpts,colorStops:gradientColorStops,rotation:number},pattern:{...patternUndocumentedOpts,pattern:union("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses"),width:positiveNumber,height:positiveNumber,fill:color,fillOpacity:ratio,backgroundFill:color,backgroundFillOpacity:ratio,...strokeOptionsDef}},"a color object"),colorUnion=or(color,colorObject),fillOptionsDef={fill:colorUnion,fillOpacity:ratio};fillOptionsDef.fillGradientDefaults=fillGradientDefaults,fillOptionsDef.fillPatternDefaults=fillPatternDefaults;var lineDashOptionsDef={lineDash:arrayOf(positiveNumber),lineDashOffset:number},fontOptionsDef={color,fontFamily:string,fontSize:positiveNumber,fontStyle:union("normal","italic","oblique"),fontWeight:or(positiveNumber,union("normal","bold","bolder","lighter"))};function toArray(t){return typeof t>"u"?[]:Array.isArray(t)?t:[t]}function unique(t){return Array.from(new Set(t))}function groupBy(t,e){return t.reduce((i,s)=>{const n=e(s);return i[n]??(i[n]=[]),i[n].push(s),i},{})}function arraysEqual(t,e){if(t==null||e==null||t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(Array.isArray(t[i])&&Array.isArray(e[i])){if(!arraysEqual(t[i],e[i]))return!1}else if(t[i]!==e[i])return!1;return!0}function circularSliceArray(t,e,i=0){if(t.length===0)return[];const s=[];for(let n=0;n<e;n++)s.push(t.at((n+i)%t.length));return s}function sortBasedOnArray(t,e){const i=new Map;return e.forEach((s,n)=>{i.set(s,n)}),t.sort((s,n)=>{const o=i.get(s)??1/0,a=i.get(n)??1/0;return o-a})}function findMaxIndex(t,e,i){if(t>e)return;let s;for(;e>=t;){const n=Math.floor((e+t)/2);i(n)?(s=n,t=n+1):e=n-1}return s}function findMinIndex(t,e,i){if(t>e)return;let s;for(;e>=t;){const n=Math.floor((e+t)/2);i(n)?(s=n,e=n-1):t=n+1}return s}function findMaxValue(t,e,i){if(t>e)return;let s;for(;e>=t;){const n=Math.floor((e+t)/2),o=i(n);o==null?e=n-1:(s=o,t=n+1)}return s}function findMinValue(t,e,i){if(t>e)return;let s;for(;e>=t;){const n=Math.floor((e+t)/2),o=i(n);o==null?t=n+1:(s=o,e=n-1)}return s}function diffArrays(t,e){const i=Math.max(t.length,e.length),s=new Set,n=new Set;for(let o=0;o<i;o++){const a=t[o],r=e[o];a!==r&&(n.has(r)?n.delete(r):r&&s.add(r),s.has(a)?s.delete(a):a&&n.add(a))}return{changed:s.size>0||n.size>0,added:s,removed:n}}function debounce(t,e=0,i){const{leading:s=!1,trailing:n=!0,maxWait:o=1/0}=i??{};let a,r;if(o<e)throw new Error("Value of maxWait cannot be lower than waitMs.");function l(...c){if(s&&!r){r=Date.now(),a=setTimeout(()=>r=null,e),t(...c);return}let h=e;if(o!==1/0&&r){const d=Date.now()-r;e>o-d&&(h=o-d)}clearTimeout(a),r??(r=Date.now()),a=setTimeout(()=>{r=null,n&&t(...c)},h)}return Object.assign(l,{cancel(){clearTimeout(a),r=null}})}function throttle(t,e,i){const{leading:s=!0,trailing:n=!0}=i??{};let o,a,r=!1;function l(){n&&a?(o=setTimeout(l,e),t(...a)):r=!1,a=null}function c(...h){r?a=h:(r=!0,o=setTimeout(l,e),s?t(...h):a=h)}return Object.assign(c,{cancel(){clearTimeout(o),r=!1,a=null}})}function*iterate(...t){for(const e of t)yield*e}function toIterable(t){return t!=null&&typeof t=="object"&&Symbol.iterator in t?t:[t]}function first(t){for(const e of t)return e;throw new Error("AG Charts - no first() value found")}function*entries(t){const e=[void 0,void 0];for(const i of Object.keys(t))e[0]=i,e[1]=t[i],yield e}function clamp(t,e,i){return Math.min(i,Math.max(t,e))}function inRange(t,e,i=1e-10){return t>=e[0]-i&&t<=e[1]+i}function isNumberEqual(t,e,i=1e-10){return t===e||Math.abs(t-e)<i}function isNegative(t){return Math.sign(t)===-1||Object.is(t,-0)}function isInteger(t){return t%1===0}function roundTo(t,e=2){const i=10**e;return Math.round(t*i)/i}function modulus(t,e){return Math.floor(t%e+(t<0?Math.abs(e):0))}function countFractionDigits(t){if(Math.floor(t)===t)return 0;let e=String(t),i=0;if(t<1e-6||t>=1e21){let n;[e,n]=e.split("e"),n!=null&&(i=Number(n))}const s=e.split(".")[1]?.length??0;return Math.max(s-i,0)}var formatRegEx=/^(?:(.)?([<>=^]))?([+\-( ])?([$€£¥₣₹#])?(0)?(\d+)?(,)?(?:\.(\d+))?(~)?([%a-z])?$/i,surroundedRegEx=/^((?:[^#]|#[^{])*)#{([^}]+)}(.*)$/;function isValidNumberFormat(t){if(!isString(t))return!1;const e=surroundedRegEx.exec(t);return formatRegEx.test(e?e[2]:t)}function parseNumberFormat(t){let e,i;const s=surroundedRegEx.exec(t);s&&([,e,t,i]=s);const n=formatRegEx.exec(t);if(!n)throw new Error(`The number formatter is invalid: ${t}`);const[,o,a,r,l,c,h,d,u,p,g]=n;return{fill:o,align:a,sign:r,symbol:l,zero:c,width:parseInt(h),comma:d,precision:parseInt(u),trim:!!p,type:g,prefix:e,suffix:i}}function createNumberFormatter(t){const e=typeof t=="string"?parseNumberFormat(t):t,{fill:i,align:s,sign:n="-",symbol:o,zero:a,width:r,comma:l,type:c,prefix:h="",suffix:d="",precision:u}=e;let{trim:p}=e;const g=u==null||isNaN(u);let f;if(!c)f=decimalTypes.g,p=!0;else if(c in decimalTypes&&c in integerTypes)f=g?integerTypes[c]:decimalTypes[c];else if(c in decimalTypes)f=decimalTypes[c];else if(c in integerTypes)f=integerTypes[c];else throw new Error(`The number formatter type is invalid: ${c}`);let m;return g?m=c?6:12:m=u,y=>{let x=f(y,m);return p&&(x=removeTrailingZeros(x)),l&&(x=insertSeparator(x,l)),x=addSign(y,x,n),o&&o!=="#"&&(x=`${o}${x}`),o==="#"&&c==="x"&&(x=`0x${x}`),c==="s"&&(x=`${x}${getSIPrefix(y)}`),(c==="%"||c==="p")&&(x=`${x}%`),r!=null&&!isNaN(r)&&(x=addPadding(x,r,i??a,s)),x=`${h}${x}${d}`,x}}var integerTypes={b:t=>absFloor(t).toString(2),c:t=>String.fromCharCode(t),d:t=>Math.round(Math.abs(t)).toFixed(0),o:t=>absFloor(t).toString(8),x:t=>absFloor(t).toString(16),X:t=>integerTypes.x(t).toUpperCase(),n:t=>integerTypes.d(t),"%":t=>`${absFloor(t*100).toFixed(0)}`},decimalTypes={e:(t,e)=>Math.abs(t).toExponential(e),E:(t,e)=>decimalTypes.e(t,e).toUpperCase(),f:(t,e)=>Math.abs(t).toFixed(e),F:(t,e)=>decimalTypes.f(t,e).toUpperCase(),g:(t,e)=>{if(t===0)return"0";const i=Math.abs(t),s=Math.floor(Math.log10(i));return s>=-4&&s<e?i.toFixed(e-1-s):i.toExponential(e-1)},G:(t,e)=>decimalTypes.g(t,e).toUpperCase(),n:(t,e)=>decimalTypes.g(t,e),p:(t,e)=>decimalTypes.r(t*100,e),r:(t,e)=>{if(t===0)return"0";const i=Math.abs(t),n=Math.floor(Math.log10(i))-(e-1);if(n<=0)return i.toFixed(-n);const o=10**n;return(Math.round(i/o)*o).toFixed()},s:(t,e)=>{const i=getSIPrefixPower(t);return decimalTypes.r(t/10**i,e)},"%":(t,e)=>decimalTypes.f(t*100,e)},minSIPrefix=-24,maxSIPrefix=24,siPrefixes={[minSIPrefix]:"y",[-21]:"z",[-18]:"a",[-15]:"f",[-12]:"p",[-9]:"n",[-6]:"\xB5",[-3]:"m",0:"",3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",[maxSIPrefix]:"Y"},minusSign="\u2212";function absFloor(t){return Math.floor(Math.abs(t))}function removeTrailingZeros(t){return t.replace(/\.0+$/,"").replace(/(\.[1-9])0+$/,"$1")}function insertSeparator(t,e){let i=t.indexOf(".");i<0&&(i=t.length);const s=t.substring(0,i).split(""),n=t.substring(i);for(let o=s.length-3;o>0;o-=3)s.splice(o,0,e);return`${s.join("")}${n}`}function getSIPrefix(t){return siPrefixes[getSIPrefixPower(t)]}function getSIPrefixPower(t){return clamp(minSIPrefix,t?Math.floor(Math.log10(Math.abs(t))/3)*3:0,maxSIPrefix)}function addSign(t,e,i=""){if(i==="(")return t>=0?e:`(${e})`;const s=i==="+"?"+":"";return`${t>=0?s:minusSign}${e}`}function addPadding(t,e,i=" ",s=">"){let n=t;if(s===">"||!s)n=n.padStart(e,i);else if(s==="<")n=n.padEnd(e,i);else if(s==="^"){const o=Math.max(0,e-n.length),a=Math.ceil(o/2),r=Math.floor(o/2);n=n.padStart(a+n.length,i),n=n.padEnd(r+n.length,i)}return n}var __defProp3=Object.defineProperty,__getOwnPropDesc2=Object.getOwnPropertyDescriptor,__export3=(t,e)=>{for(var i in e)__defProp3(t,i,{get:e[i],enumerable:!0})},__decorateClass2=(t,e,i,s)=>{for(var n=s>1?void 0:s?__getOwnPropDesc2(e,i):e,o=t.length-1,a;o>=0;o--)(a=t[o])&&(n=(s?a(e,i,n):a(n))||n);return s&&n&&__defProp3(e,i,n),n},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(o=>t.includes(o.type)),s=o=>{const a=this.dependencies.get(o);return a?.flatMap(s).concat(a)??[]},n=[];for(const o of i){const a="optionsKey"in o?o.optionsKey:o.contextKey;if(!e.has(a)){for(const r of s(a)){if(e.has(r))continue;const l=this.modulesByOptionKey.get(r);if(!l){n.push(r);continue}t.includes(l.type)&&(yield l,e.add(r))}yield o,e.add(a)}}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,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 o of i){const a=o.distanceSquared(t,e);if(a===0)return{nearest:o,distanceSquared:0};a<n.distanceSquared&&(n.nearest=o,n.distanceSquared=a)}return n}function nearestSquaredInContainer(t,e,i,s=1/0){const{x:n=t,y:o=e}=i.transformPoint?.(t,e)??{},a={nearest:void 0,distanceSquared:s};for(const r of i.children){const{nearest:l,distanceSquared:c}=r.nearestSquared(n,o,a.distanceSquared);if(c===0)return{nearest:l,distanceSquared:c};c<a.distanceSquared&&(a.nearest=l,a.distanceSquared=c)}return a}var _BBox=class kt{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 kt(e,i,s,n)}static merge(e){let i=1/0,s=1/0,n=-1/0,o=-1/0;for(const a of e)a.x<i&&(i=a.x),a.y<s&&(s=a.y),a.x+a.width>n&&(n=a.x+a.width),a.y+a.height>o&&(o=a.y+a.height);return new kt(i,s,n-i,o-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 kt(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=clamp(e.x,this.x,e.x+e.width),s=clamp(e.y,this.y,e.y+e.height),n=clamp(e.x,this.x+this.width,e.x+e.width),o=clamp(e.y,this.y+this.height,e.y+e.height);return new kt(i,s,n-i,o-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-clamp(this.x,e,this.x+this.width),n=i-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 kt(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,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);logger_exports.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=toArray(i[0]())),logTimeGap(),logger_exports.log(...i))},{check:()=>Debug.check(...t),group:(i,s)=>Debug.check(...t)?logger_exports.logGroup(i,s):s()})},check(...t){return t.length===0&&t.push(!0),toArray(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[o,a]=canvasDimensions(e,i,s);this.canvas=new OffscreenCanvas(o,a),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[o,a]=canvasDimensions(t,e,i);s.width=o,s.height=a}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)}},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:o,convertor:a,checkDirtyOnAssignment:r=!1}=s??{},l={type:n,changeCb:o,checkDirtyOnAssignment:r,convertor:a};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 o=e.call(this,n);return n?._dirty===!0&&this.markDirty(t),o}: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 Ft{constructor(e){this.serialNumber=Ft._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??Ft._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 o=createSvgElement("svg");if(o.setAttribute("width",String(i)),o.setAttribute("height",String(s)),o.setAttribute("viewBox",`0 0 ${i} ${s}`),n.defs?.length){const a=createSvgElement("defs");a.append(...n.defs),o.append(a)}return o.append(...n.elements),o.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 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 o=s[n].pickNode(e,i);if(o)return o}}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,__decorateClass2([SceneChangeDetection()],_Node.prototype,"visible",2),__decorateClass2([SceneChangeDetection({changeCb:t=>t.onZIndexChange()})],_Node.prototype,"zIndex",2);var Node=_Node,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 o=Object.getOwnPropertyDescriptor(t,e),a=o?.set,r=o?.get;return Object.defineProperty(t,e,{set:function(h){const{setters:d,observers:u}=i[s];let p;d.some(g=>g.length>2)&&(p=r?r.call(this):n.get(this));for(const g of d)if(h=g(this,e,h,p),h===BREAK_TRANSFORM_CHAIN)return;a?a.call(this,h):n.set(this,h);for(const g of u)g(this,h,p)},get:function(){let h=r?r.call(this):n.get(this);for(const d of i[s].getters)if(h=d(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 o=initialiseConfig(s,n);o.setters.push(t),e&&o.getters.unshift(e),i&&Object.assign(o,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])):isPlainObject(t)?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(!isObject(i))continue;const s=isDecoratedObject(i)?listDecoratedProperties(i):Object.keys(i);for(const n of s)isPlainObject(e[n])&&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(!isObject(i))continue;const s=isDecoratedObject(i)?listDecoratedProperties(i):Object.keys(i);for(const n of s)isPlainObject(e[n])&&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&&isArray(t)?t.map(i=>mergeDefaults(i,...e)):t}function mapValues(t,e){const i={};for(const[s,n]of 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(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=isArray(e)?e.slice():e.split("."),n=s.pop();if(s.some(a=>SKIP_JS_BUILTINS.has(a)))return;const o=s.reduce((a,r)=>a[r],t);return o[n]=i,o[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"||!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 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),o=normalizeAngle360(i);return n<o?n<=s&&s<=o:n>o?n<=s||s<=o:!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 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 ct{constructor(e,i,s,n=1){this.r=clamp(0,e||0,1),this.g=clamp(0,i||0,1),this.b=clamp(0,s||0,1),this.a=clamp(0,n||0,1)}static validColorString(e){return e.indexOf("#")>=0?!!ct.parseHex(e):e.indexOf("rgb")>=0?!!ct.stringToRgba(e):ct.nameToHex.has(e.toLowerCase())}static fromString(e){if(e.indexOf("#")>=0)return ct.fromHexString(e);const i=ct.nameToHex.get(e.toLowerCase());if(i)return ct.fromHexString(i);if(e.indexOf("rgb")>=0)return ct.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=ct.parseHex(e);if(i){const[s,n,o,a]=i;return new ct(s/255,n/255,o/255,a/255)}throw new Error(`Malformed hexadecimal color string: '${e}'`)}static stringToRgba(e){let i=-1,s=-1;for(let r=0;r<e.length;r++){const l=e[r];if(i===-1&&l==="(")i=r;else if(l===")"){s=r;break}}if(i===-1||s===-1)return;const o=e.substring(i+1,s).split(","),a=[];for(let r=0;r<o.length;r++){const l=o[r];let c=parseFloat(l);if(!Number.isFinite(c))return;l.indexOf("%")>=0?(c=clamp(0,c,100),c/=100):r===3?c=clamp(0,c,1):(c=clamp(0,c,255),c/=255),a.push(c)}return a}static fromRgbaString(e){const i=ct.stringToRgba(e);if(i){if(i.length===3)return new ct(i[0],i[1],i[2]);if(i.length===4)return new ct(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 ct(e[0],e[1],e[2],e[3]);if(e.length===3)return new ct(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 o=ct.HSBtoRGB(e,i,s);return new ct(o[0],o[1],o[2],n)}static fromHSL(e,i,s,n=1){const o=ct.HSLtoRGB(e,i,s);return new ct(o[0],o[1],o[2],n)}static fromOKLCH(e,i,s,n=1){const o=ct.OKLCHtoRGB(e,i,s);return new ct(o[0],o[1],o[2],n)}static padHex(e){return e.length===1?"0"+e:e}toHexString(){let e="#"+ct.padHex(Math.round(this.r*255).toString(16))+ct.padHex(Math.round(this.g*255).toString(16))+ct.padHex(Math.round(this.b*255).toString(16));return this.a<1&&(e+=ct.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 ct.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(e,i,s){const n=srgbToLinear(e),o=srgbToLinear(i),a=srgbToLinear(s),r=Math.cbrt(.4122214708*n+.5363325363*o+.0514459929*a),l=Math.cbrt(.2119034982*n+.6806995451*o+.1073969566*a),c=Math.cbrt(.0883024619*n+.2817188376*o+.6299787005*a),h=.2104542553*r+.793617785*l-.0040720468*c,d=1.9779984951*r-2.428592205*l+.4505937099*c,u=.0259040371*r+.7827717662*l-.808675766*c,p=Math.atan2(u,d)*180/Math.PI,g=h,f=Math.hypot(d,u),m=p>=0?p:p+360;return[g,f,m]}static OKLCHtoRGB(e,i,s){const n=e,o=i*Math.cos(s*Math.PI/180),a=i*Math.sin(s*Math.PI/180),r=(n+.3963377774*o+.2158037573*a)**3,l=(n-.1055613458*o-.0638541728*a)**3,c=(n-.0894841775*o-1.291485548*a)**3,h=4.0767416621*r-3.3077115913*l+.2309699292*c,d=-1.2684380046*r+2.6097574011*l-.3413193965*c,u=-.0041960863*r-.7034186147*l+1.707614701*c,p=srgbFromLinear(h),g=srgbFromLinear(d),f=srgbFromLinear(u);return[p,g,f]}static RGBtoHSL(e,i,s){const n=Math.min(e,i,s),o=Math.max(e,i,s),a=(o+n)/2;let r,l;if(o===n)r=0,l=0;else{const c=o-n;l=a>.5?c/(2-o-n):c/(o+n),o===e?r=(i-s)/c+(i<s?6:0):o===i?r=(s-e)/c+2:r=(e-i)/c+4,r*=360/6}return[r,l,a]}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,o=2*s-n;function a(h){return h<0&&(h+=1),h>1&&(h-=1),h<1/6?o+(n-o)*6*h:h<1/2?n:h<2/3?o+(n-o)*(2/3-h)*6:o}const r=a(e/360+1/3),l=a(e/360),c=a(e/360-1/3);return[r,l,c]}static RGBtoHSB(e,i,s){const n=Math.min(e,i,s),o=Math.max(e,i,s),a=o===0?0:(o-n)/o;let r=0;if(n!==o){const l=o-n,c=(o-e)/l,h=(o-i)/l,d=(o-s)/l;e===o?r=d-h:i===o?r=2+c-d:r=4+h-c,r/=6,r<0&&(r=r+1)}return[r*360,a,o]}static HSBtoRGB(e,i,s){e=(e%360+360)%360/360;let n=0,o=0,a=0;if(i===0)n=o=a=s;else{const r=(e-Math.floor(e))*6,l=r-Math.floor(r),c=s*(1-i),h=s*(1-i*l),d=s*(1-i*(1-l));switch(r>>0){case 0:n=s,o=d,a=c;break;case 1:n=h,o=s,a=c;break;case 2:n=c,o=s,a=d;break;case 3:n=c,o=h,a=s;break;case 4:n=d,o=c,a=s;break;case 5:n=s,o=c,a=h;break}}return[n,o,a]}static mix(e,i,s){return new ct(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=ct.RGBtoOKLCH(e.r,e.g,e.b);return ct.fromOKLCH(clamp(0,s[0]+i,1),s[1],s[2])}static darken(e,i){const s=ct.RGBtoOKLCH(e.r,e.g,e.b);return ct.fromOKLCH(clamp(0,s[0]-i,1),s[1],s[2])}static interpolate(e,i){const s=1/(e.length-1),n=e.map(o=>ct.RGBtoOKLCH(o.r,o.g,o.b));return Array.from({length:i},(o,a)=>{const r=a/(i-1),l=e.length<=2?0:Math.min(Math.floor(r*(e.length-1)),e.length-2),c=(r-l*s)/s,h=n[l],d=n[l+1];return ct.fromOKLCH(lerp(h[0],d[0],c),lerp(h[1],d[1],c),lerp(h[2],d[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=clamp(0,i,1);let s;if(isAchromatic(t))s=e.h;else if(isAchromatic(e))s=t.h;else{const r=t.h;let l=e.h;const c=e.h-t.h;c>180?l-=360:c<-180&&(l+=360),s=r*(1-i)+l*i}const n=t.c*(1-i)+e.c*i,o=t.l*(1-i)+e.l*i,a=t.a*(1-i)+e.a*i;return Color.fromOKLCH(o,n,s,a)},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&&(logger_exports.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){logger_exports.warnOnce("`colorDomain` values should be supplied in ascending order."),t.sort((o,a)=>o-a);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],o=e.at(-1),a=i[0],r=i[i.length-1];if(t<=n)return a;if(t>=o)return r;let l,c;if(e.length===2){const u=(t-n)/(o-n),p=1/(i.length-1);l=i.length<=2?0:Math.min(Math.floor(u*(i.length-1)),i.length-2),c=(u-l*p)/p}else{for(l=0;l<e.length-2&&!(t<e[l+1]);l++);const u=e[l],p=e[l+1];c=(t-u)/(p-u)}const h=s[l],d=s[l+1];return interpolateOklch(h,d,c).toRgbaString()}invert(){}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&logger_exports.warnOnce("Expected update to not invalidate scale"))}};__decorateClass2([Invalidating],ColorScale.prototype,"domain",2),__decorateClass2([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:o}=this;if(n.length===0)return;if(n.length===1)return n[0].color;let a=this.createCanvasGradient(t,s,i);if(a==null)return;const r=o==="oklch",l=.05;let c=n[0];a.addColorStop(c.stop,c.color);for(let h=1;h<n.length;h+=1){const d=n[h];if(r){const u=new ColorScale;u.domain=[c.stop,d.stop],u.range=[c.color,d.color];for(let p=c.stop+l;p<d.stop;p+=l)a.addColorStop(p,u.convert(p))}a.addColorStop(d.stop,d.color),c=d}return"createPattern"in a&&(a=a.createPattern()),this._cache={ctx:t,bbox:s,gradient:a},a}toSvg(t){const e=this.bbox??t,i=this.createSvgGradient(e);return this.stops.forEach(({stop:s,color:n})=>{const o=createSvgElement("stop");o.setAttribute("offset",`${s}`),o.setAttribute("stop-color",`${n}`),i.appendChild(o)}),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,o=normalizeAngle360(toRadians(n+-90)),a=i?.centerX??e.x+e.width*.5,r=i?.centerY??e.y+e.height*.5;return t.createConicGradient(o,a,r)}createSvgGradient(t){return createSvgElement("linearGradient")}},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),o=Math.sin(s),a=t.width,r=t.height,l=t.x+a*.5,c=t.y+r*.5,h=Math.sqrt(r*r+a*a)/2,d=Math.atan2(r,a);let u;s<Math.PI/2?u=s:s<Math.PI?u=Math.PI-s:s<1.5*Math.PI?u=s-Math.PI:u=2*Math.PI-s;const p=h*Math.abs(Math.cos(u-d));return{x0:l+n*p,y0:c+o*p,x1:l-n*p,y1:c-o*p}}createCanvasGradient(t,e){const{x0:i,y0:s,x1:n,y1:o}=this.getGradientPoints(e);return t.createLinearGradient(i,s,n,o)}createSvgGradient(t){const{x0:e,y0:i,x1:s,y1:n}=this.getGradientPoints(t),o=createSvgElement("linearGradient");return o.setAttribute("x1",String(e)),o.setAttribute("y1",String(i)),o.setAttribute("x2",String(s)),o.setAttribute("y2",String(n)),o.setAttribute("gradientUnits","userSpaceOnUse"),o}},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,o=i?.innerRadius??0,a=i?.outerRadius??Math.hypot(e.width*.5,e.height*.5)/Math.SQRT2;return t.createRadialGradient(s,n,o,s,n,a)}createSvgGradient(t){const e=t.x+t.width*.5,i=t.y+t.height*.5,s=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}},BaseProperties=class{handleUnknownProperties(t,e){}set(t){const{className:e=this.constructor.name}=this.constructor;if(typeof t!="object")return logger_exports.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],o=this;if(isProperties(o[s]))if(o[s]instanceof PropertiesArray){const a=o[s].reset(n);a!=null?o[s]=a:logger_exports.warn(`unable to set [${s}] - expecting a properties array`)}else o[s].set(n);else isPlainObject(n)?o[s]=merge(n,o[s]??{}):o[s]=n;i.delete(s)}this.handleUnknownProperties(i,t);for(const s of i)logger_exports.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||logger_exports.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 Ut extends Array{constructor(e,...i){super(i.length);const n=(o=>!!o?.prototype?.constructor?.name)(e)?o=>new e().set(o):e;Object.defineProperty(this,"itemFactory",{value:n,enumerable:!1,configurable:!1}),this.set(i)}set(e){if(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 Ut(this.itemFactory,...e)}toJson(){return this.map(e=>e?.toJson?.()??e)}};function isProperties(t){return t instanceof BaseProperties||t instanceof PropertiesArray}function Validate(t,e={}){const{optional:i=!1}=e;return addTransformToInstanceProperty((s,n,o)=>{const a={...e,target:s,property:n};if(i&&typeof o>"u"||t(o,a))return isProperties(s[n])&&!isProperties(o)?(s[n].set(o),s[n]):o;const r=stringifyValue(o,50),l=String(n).replace(/^_*/,""),c=s.constructor.className??s.constructor.name.replace(/Properties$/,""),h=t.message?`; expecting ${getPredicateMessage(t,a)}`:"";return logger_exports.warn(`Property [${l}] of [${c}] cannot be set to [${r}]${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,o)=>{const a={...e,target:s,property:n};if(i&&typeof o>"u"||t(o,a)){if(isProperties(s[n])&&!isProperties(o))return s[n].set(o),s[n]}else{const r=stringifyValue(o,50),l=String(n).replace(/^_*/,""),c=s.constructor.className??s.constructor.name.replace(/Properties$/,""),h=t.message?`; expecting ${getPredicateMessage(t,a)}`:"";logger_exports.warn(`TempValidation!!! Property [${l}] of [${c}] cannot be set to [${r}]${h}, ignoring.`)}return o},void 0,{optional:i})}:()=>addFakeTransformToInstanceProperty,AND=(...t)=>{const e=[];return predicateWithMessage((i,s)=>(e.length=0,t.every(n=>{const o=n(i,s);return o||e.push(getPredicateMessage(n,s)),o})),()=>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)||isObject(t)&&isProperties(e.target[e.property]),"a properties object")),PLAIN_OBJECT=attachObjectRestrictions(predicateWithMessage(t=>isObject(t),"an object")),BOOLEAN=predicateWithMessage(isBoolean,"a boolean"),FUNCTION=predicateWithMessage(isFunction,"a function"),STRING=predicateWithMessage(isString,"a string"),NUMBER=attachNumberRestrictions(predicateWithMessage(isFiniteNumber,"a number")),REAL_NUMBER=predicateWithMessage(t=>isNumber(t)&&!isNaN(t),"a real number"),NAN=predicateWithMessage(t=>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(isArray,"an array")),ARRAY_OF=(t,e)=>predicateWithMessage((i,s)=>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}),isComparable2=t=>isFiniteNumber(t)||isValidDate(t),LESS_THAN=t=>predicateWithMessage((e,i)=>!isComparable2(e)||!isComparable2(i.target[t])||e<i.target[t],`to be less than ${t}`),GREATER_THAN=t=>predicateWithMessage((e,i)=>!isComparable2(e)||!isComparable2(i.target[t])||e>i.target[t],`to be greater than ${t}`),DATE=predicateWithMessage(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(isColor,`color string. ${colorMessage}`),COLOR_GRADIENT=attachObjectRestrictions(predicateWithMessage(t=>isObject(t)&&t.type==="gradient","a color gradient object")),COLOR_PATTERN=attachObjectRestrictions(predicateWithMessage(t=>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(o=>{const a=typeof o=="string"?o:o.value;return i===a});if(n==null)return!1;if(typeof n!="string"&&(n.deprecated===!0||n.deprecatedTo!=null)){const o=[`Property [%s] with value '${n.value}' is deprecated.`];n.deprecatedTo&&o.push(`Use ${n.deprecatedTo} instead.`),logger_exports.warnOnce(o.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 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 isNumber(i)&&i>0?s="a non-empty array":isNumber(e)&&(s=`an array of length ${e}`),predicateWithMessage(n=>isArray(n)&&(isNumber(e)?n.length===e:!0)&&(isNumber(i)?n.length>=i:!0),s)}})}function attachNumberRestrictions(t){return Object.assign(t,{restrict({min:e,max:i}={}){const s=["a number"],n=isNumber(e),o=isNumber(i);return n&&o?s.push(`between ${e} and ${i} inclusive`):n?s.push(`greater than or equal to ${e}`):o&&s.push(`less than or equal to ${i}`),predicateWithMessage(a=>isFiniteNumber(a)&&(n?a>=e:!0)&&(o?a<=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"}};__decorateClass2([TempValidate(NUMBER,{optional:!0})],StopProperties.prototype,"stop",2),__decorateClass2([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,o,{length:a})=>({stop:(o+i)/(a-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 logger_exports.warnOnce("[fills] must have the stops defined in ascending order"),[];const o=Math.min(...i),a=Math.max(...i),r=s==="discrete",l=new Float64Array(n.length);let c=0,h=-1;for(let g=0;g<n.length;g+=1){const f=n[g];if(g>=h){h=n.length-1;for(let y=g+1;y<n.length;y+=1)if(n[y]?.stop!=null){h=y;break}}let m=f?.stop;if(m==null){const y=n[c]?.stop,x=n[h]?.stop,b=y??o,S=x??a,v=r&&y==null?1:0;m=b+(S-b)*(g-c+v)/(h-c+v)}else c=g;l[g]=Math.max(0,Math.min(1,(m-o)/(a-o)))}let d=n.find(g=>g.color!=null)?.color,u;const p=n.map((g,f)=>{let m=g?.color;const y=l[f];return m!=null?d=m:d!=null?m=d:(u==null&&(u=new ColorScale,u.domain=[0,1],u.range=e),m=u.convert(y)),{stop:y,color:m}});return s==="discrete"?discreteColorStops(p):p}function pointsDistanceSquared(t,e,i,s){const n=t-i,o=e-s;return n*n+o*o}function lineDistanceSquared(t,e,i,s,n,o,a){if(i===n&&s===o)return Math.min(a,pointsDistanceSquared(t,e,i,s));const r=n-i,l=o-s,c=Math.max(0,Math.min(1,((t-i)*r+(e-s)*l)/(r*r+l*l))),h=i+c*r,d=s+c*l;return Math.min(a,pointsDistanceSquared(t,e,h,d))}function arcDistanceSquared(t,e,i,s,n,o,a,r,l){r&&([a,o]=[o,a]);const c=Math.atan2(e-s,t-i);if(!isBetweenAngles(c,o,a)){const d=i+Math.cos(o)*n,u=s+Math.sin(o)*n,p=i+Math.cos(o)*n,g=s+Math.sin(o)*n;return Math.min(l,pointsDistanceSquared(t,e,d,u),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 o=-e/(2*t);o>=0&&o<=1&&n.push(o)}else if(s>0){const o=Math.sqrt(s),a=(-e-o)/(2*t),r=(-e+o)/(2*t);a>=0&&a<=1&&n.push(a),r>=0&&r<=1&&n.push(r)}return n}function cubicRoots(t,e,i,s){if(t===0)return quadraticRoots(e,i,s);const n=e/t,o=i/t,a=s/t,r=(3*o-n*n)/9,l=(9*n*o-27*a-2*n*n*n)/54,c=r*r*r+l*l,h=1/3,d=[];if(c>=0){const u=Math.sqrt(c),p=Math.sign(l+u)*Math.pow(Math.abs(l+u),h),g=Math.sign(l-u)*Math.pow(Math.abs(l-u),h),f=Math.abs(Math.sqrt(3)*(p-g)/2),m=-h*n+(p+g);if(m>=0&&m<=1&&d.push(m),f===0){const y=-h*n-(p+g)/2;y>=0&&y<=1&&d.push(y)}}else{const u=Math.acos(l/Math.sqrt(-r*r*r)),p=h*n,g=2*Math.sqrt(-r),f=g*Math.cos(h*u)-p,m=g*Math.cos(h*(u+2*Math.PI))-p,y=g*Math.cos(h*(u+4*Math.PI))-p;f>=0&&f<=1&&d.push(f),m>=0&&m<=1&&d.push(m),y>=0&&y<=1&&d.push(y)}return d}function segmentIntersection(t,e,i,s,n,o,a,r){const l=(i-t)*(r-o)-(s-e)*(a-n);if(l===0)return 0;const c=((a-n)*(e-o)-(t-n)*(r-o))/l,h=((i-t)*(e-o)-(s-e)*(t-n))/l;return c>=0&&c<=1&&h>=0&&h<=1?1:0}function cubicSegmentIntersections(t,e,i,s,n,o,a,r,l,c,h,d){let u=0;const p=c-d,g=h-l,f=l*(d-c)-c*(h-l),m=bezierCoefficients(t,i,n,a),y=bezierCoefficients(e,s,o,r),x=p*m[0]+g*y[0],b=p*m[1]+g*y[1],S=p*m[2]+g*y[2],v=p*m[3]+g*y[3]+f,I=cubicRoots(x,b,S,v);for(const A of I){const D=A*A,T=A*D,k=m[0]*T+m[1]*D+m[2]*A+m[3],w=y[0]*T+y[1]*D+y[2]*A+y[3];let L;l===h?L=(w-c)/(d-c):L=(k-l)/(h-l),L>=0&&L<=1&&u++}return u}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,o,a,r,l,c){if(isNaN(t)||isNaN(e))return 0;o&&([n,s]=[s,n]);const h=(c-r)/(l-a),d=r-h*a,u=Math.pow(h,2)+1,p=2*(h*(d-e)-t),g=Math.pow(t,2)+Math.pow(d-e,2)-Math.pow(i,2),f=Math.pow(p,2)-4*u*g;if(f<0)return 0;const m=(-p+Math.sqrt(f))/2/u,y=(-p-Math.sqrt(f))/2/u;let x=0;return[m,y].forEach(b=>{if(!(b>=Math.min(a,l)&&b<=Math.max(a,l)))return;const v=h*b+d,I=b-t,A=v-e,D=Math.atan2(A,I);isBetweenAngles(D,s,n)&&x++}),x}function evaluateBezier(t,e,i,s,n){return(1-n)**3*t+3*(1-n)**2*n*e+3*(1-n)*n**2*i+n**3*s}function solveBezier(t,e,i,s,n){if(n<=Math.min(t,s))return t<s?0:1;if(n>=Math.max(t,s))return t<s?1:0;let o=0,a=1,r=NaN;for(let l=0;l<12;l+=1)r=(o+a)/2,evaluateBezier(t,e,i,s,r)<n?o=r:a=r;return r}function splitBezier(t,e,i,s,n,o,a,r,l){const c=(1-l)*t+l*i,h=(1-l)*e+l*s,d=(1-l)*i+l*n,u=(1-l)*s+l*o,p=(1-l)*n+l*a,g=(1-l)*o+l*r,f=(1-l)*c+l*d,m=(1-l)*h+l*u,y=(1-l)*d+l*p,x=(1-l)*u+l*g,b=(1-l)*f+l*y,S=(1-l)*m+l*x;return[[{x:t,y:e},{x:c,y:h},{x:f,y:m},{x:b,y:S}],[{x:b,y:S},{x:y,y:x},{x:p,y:g},{x:a,y:r}]]}function calculateDerivativeExtrema(t,e,i,s){const n=-t+3*e-3*i+s,o=3*t-6*e+3*i,a=-3*t+3*e;if(n===0){if(o!==0){const l=-a/o;if(l>0&&l<1)return[l]}return[]}const r=o*o-4*n*a;if(r>=0){const l=Math.sqrt(r),c=(-o+l)/(2*n),h=(-o-l)/(2*n);return[c,h].filter(d=>d>0&&d<1)}return[]}function calculateDerivativeExtremaXY(t,e,i,s,n,o,a,r){const l=calculateDerivativeExtrema(t,i,n,a),c=calculateDerivativeExtrema(e,s,o,r);return[...l,...c]}var ExtendedPath2D=class{constructor(){this.path2d=new Path2D,this.previousCommands=[],this.previousParams=[],this.previousClosedPath=!1,this.commands=[],this.params=[],this.openedPath=!1,this.closedPath=!1}isEmpty(){return this.commands.length===0}isDirty(){return this.closedPath!==this.previousClosedPath||this.previousCommands.length!==this.commands.length||this.previousParams.length!==this.params.length||this.previousCommands.toString()!==this.commands.toString()||this.previousParams.toString()!==this.params.toString()}getPath2D(){return this.path2d}moveTo(t,e){this.openedPath=!0,this.path2d.moveTo(t,e),this.commands.push(0),this.params.push(t,e)}lineTo(t,e){this.openedPath?(this.path2d.lineTo(t,e),this.commands.push(1),this.params.push(t,e)):this.moveTo(t,e)}rect(t,e,i,s){this.moveTo(t,e),this.lineTo(t+i,e),this.lineTo(t+i,e+s),this.lineTo(t,e+s),this.closePath()}roundRect(t,e,i,s,n){n=Math.min(n,i/2,s/2),this.moveTo(t,e+n),this.arc(t+n,e+n,n,Math.PI,1.5*Math.PI),this.lineTo(t+n,e),this.lineTo(t+i-n,e),this.arc(t+i-n,e+n,n,1.5*Math.PI,2*Math.PI),this.lineTo(t+i,e+n),this.lineTo(t+i,e+s-n),this.arc(t+i-n,e+s-n,n,0,Math.PI/2),this.lineTo(t+i-n,e+s),this.lineTo(t+n,e+s),this.arc(t+ +n,e+s-n,n,Math.PI/2,Math.PI),this.lineTo(t,e+s-n),this.closePath()}arc(t,e,i,s,n,o){this.openedPath=!0,this.path2d.arc(t,e,i,s,n,o),this.commands.push(2),this.params.push(t,e,i,s,n,o?1:0)}cubicCurveTo(t,e,i,s,n,o){this.openedPath||this.moveTo(t,e),this.path2d.bezierCurveTo(t,e,i,s,n,o),this.commands.push(3),this.params.push(t,e,i,s,n,o)}closePath(){this.openedPath&&(this.path2d.closePath(),this.commands.push(4),this.openedPath=!1,this.closedPath=!0)}clear(t){t&&(this.previousCommands=this.commands,this.previousParams=this.params,this.previousClosedPath=this.closedPath),this.path2d=new Path2D,this.openedPath=!1,this.closedPath=!1,this.commands=[],this.params=[]}isPointInPath(t,e){const i=this.commands,s=this.params,n=i.length,o=-1e4,a=-1e4;let r=NaN,l=NaN,c=0,h=0,d=0;for(let u=0,p=0;u<n;u++)switch(i[u]){case 0:d+=segmentIntersection(r,l,c,h,o,a,t,e),c=s[p++],r=c,h=s[p++],l=h;break;case 1:d+=segmentIntersection(c,h,s[p++],s[p++],o,a,t,e),c=s[p-2],h=s[p-1];break;case 3:d+=cubicSegmentIntersections(c,h,s[p++],s[p++],s[p++],s[p++],s[p++],s[p++],o,a,t,e),c=s[p-2],h=s[p-1];break;case 2:{const g=s[p++],f=s[p++],m=s[p++],y=s[p++],x=s[p++],b=!!s[p++];if(d+=arcIntersections(g,f,m,y,x,b,o,a,t,e),!isNaN(r)){const S=g+Math.cos(y)*m,v=f+Math.sin(y)*m;d+=segmentIntersection(c,h,S,v,o,a,t,e)}c=g+Math.cos(x)*m,h=f+Math.sin(x)*m;break}case 4:d+=segmentIntersection(r,l,c,h,o,a,t,e);break}return d%2===1}distanceSquared(t,e){let i=1/0;const s=this.commands,n=this.params,o=s.length;let a=NaN,r=NaN,l=0,c=0;for(let h=0,d=0;h<o;h++)switch(s[h]){case 0:l=a=n[d++],c=r=n[d++];break;case 1:{const u=n[d++],p=n[d++];i=lineDistanceSquared(t,e,l,c,u,p,i);break}case 3:logger_exports.error("Command.Curve distanceSquare not implemented");break;case 2:{const u=n[d++],p=n[d++],g=n[d++],f=n[d++],m=n[d++],y=u+Math.cos(f)*g,x=p+Math.sin(f)*g,b=!!n[d++];i=lineDistanceSquared(t,e,l,c,y,x,i),i=arcDistanceSquared(t,e,u,p,g,f,m,b,i),l=u+Math.cos(m)*g,c=p+Math.sin(m)*g;break}case 4:i=lineDistanceSquared(t,e,l,c,a,r,i);break}return i}toSVG(t=(e,i)=>({x:e,y:i})){const e=[],{commands:i,params:s}=this,n=(a,...r)=>{e.push(a);for(let l=0;l<r.length;l+=2){const{x:c,y:h}=t(r[l],r[l+1]);e.push(c,h)}};let o=0;for(const a of i)switch(a){case 0:n("M",s[o++],s[o++]);break;case 1:n("L",s[o++],s[o++]);break;case 3:n("C",s[o++],s[o++],s[o++],s[o++],s[o++],s[o++]);break;case 2:{const r=s[o++],l=s[o++],c=s[o++],h=s[o++],d=s[o++],u=s[o++];let p=u?h-d:d-h;p<0&&(p+=Math.ceil(-p/(2*Math.PI))*2*Math.PI),u&&(p=-p);const g=Math.max(Math.ceil(Math.abs(p)/(Math.PI/2)),1),f=p/g,m=4/3*Math.tan(f/4),y=e.length===0?"M":"L";n(y,r+Math.cos(h)*c,l+Math.sin(h)*c);for(let x=0;x<g;x+=1){const b=h+f*(x+0),S=h+f*(x+1),v=c*Math.sin(b),I=c*Math.cos(b),A=c*Math.sin(S),D=c*Math.cos(S);n("C",r+I-m*v,l+v+m*I,r+D+m*A,l+A-m*D,r+D,l+A)}break}case 4:e.push("Z");break}return e.join(" ")}computeBBox(){const{commands:t,params:e}=this;let[i,s,n,o]=[1/0,1/0,-1/0,-1/0],[a,r]=[NaN,NaN],[l,c]=[NaN,NaN];const h=(u,p,g)=>{i=Math.min(p,i),s=Math.min(u,s),n=Math.max(u,n),o=Math.max(p,o),g&&([a,r]=[u,p])};let d=0;for(const u of t)switch(u){case 0:h(e[d++],e[d++],!0),[l,c]=[a,r];break;case 1:h(e[d++],e[d++],!0);break;case 3:{const p=e[d++],g=e[d++],f=e[d++],m=e[d++],y=e[d++],x=e[d++];h(y,x,!0),calculateDerivativeExtremaXY(a,r,p,g,f,m,y,x).forEach(S=>{const v=evaluateBezier(a,p,f,y,S),I=evaluateBezier(r,g,m,x,S);h(v,I)});break}case 2:{const p=e[d++],g=e[d++],f=e[d++];let m=normalizeAngle360(e[d++]),y=normalizeAngle360(e[d++]);e[d++]&&([m,y]=[y,m]);const b=(v,I)=>{const A=p+f*Math.cos(v),D=g+f*Math.sin(v);h(A,D,I)};b(m),b(y,!0);const S=[0,Math.PI/2,Math.PI,3*Math.PI/2];for(const v of S)(m<y&&m<=v&&v<=y||m>y&&(m<=v||v<=y))&&b(v);break}case 4:[a,r]=[l,c];break}return new BBox(s,i,n-s,o-i)}};function align(t,e,i){const s=Math.round(e*t)/t;return i==null?s:i===0?0:i<1?Math.ceil(i*t)/t:Math.round((i+e)*t)/t-s}function alignBefore(t,e){return Math.floor(e*t)/t}function drawPatternUnitPolygon(t,e,i){const{width:s,height:n,padding:o,strokeWidth:a}=e,r=s/2,l=n/2,c=Math.max(1,s-o-a/2),h=Math.max(1,n-o-a/2);let d=!1;for(const[u,p]of i){const g=r+(u-.5)*c,f=l+(p-.5)*h;d?t.lineTo(g,f):t.moveTo(g,f),d=!0}t.closePath()}var PATTERNS={circles(t,{width:e,strokeWidth:i,padding:s}){const n=e/2,o=Math.max(1,n-s-i/2);t.arc(n,n,o,0,Math.PI*2)},squares(t,{width:e,height:i,pixelRatio:s,padding:n,strokeWidth:o}){const a=n+o/2;t.moveTo(align(s,a),align(s,a)),t.lineTo(align(s,e-a),align(s,a)),t.lineTo(align(s,e-a),align(s,i-a)),t.lineTo(align(s,a),align(s,i-a)),t.closePath()},triangles(t,e){drawPatternUnitPolygon(t,e,[[.5,0],[1,1],[0,1]])},diamonds(t,e){drawPatternUnitPolygon(t,e,[[.5,0],[1,.5],[.5,1],[0,.5]])},stars(t,{width:e,height:i,padding:s}){const o=Math.max(1,(e-s)/2),a=o/2,r=Math.PI/2;for(let l=0;l<5*2;l++){const c=l%2===0?o:a,h=l*Math.PI/5-r,d=e/2+Math.cos(h)*c,u=i/2+Math.sin(h)*c;t.lineTo(d,u)}t.closePath()},hearts(t,{width:e,height:i,padding:s}){const n=Math.max(1,e/4-s/2),o=e/2,a=i/2+n/2;t.arc(o-n,a-n,n,toRadians(130),toRadians(330)),t.arc(o+n,a-n,n,toRadians(220),toRadians(50)),t.lineTo(o,a+n),t.closePath()},crosses(t,e){drawPatternUnitPolygon(t,e,[[.25,0],[.5,.25],[.75,0],[1,.25],[.75,.5],[1,.75],[.75,1],[.5,.75],[.25,1],[0,.75],[.25,.5],[0,.25]])},"vertical-lines"(t,{width:e,height:i,pixelRatio:s,strokeWidth:n}){const o=align(s,e/2)-n%2/2;t.moveTo(o,0),t.lineTo(o,i)},"horizontal-lines"(t,{width:e,height:i,pixelRatio:s,strokeWidth:n}){const o=align(s,i/2)-n%2/2;t.moveTo(0,o),t.lineTo(e,o)},"forward-slanted-lines"(t,{width:e,height:i,strokeWidth:s}){const n=Math.atan2(i,e),o=s*Math.cos(n),a=s*Math.sin(n);t.moveTo(-o,a),t.lineTo(o,-a),t.moveTo(-o,i+a),t.lineTo(e+o,-a),t.moveTo(e-o,i+a),t.lineTo(e+o,i-a)},"backward-slanted-lines"(t,{width:e,height:i,strokeWidth:s}){const n=Math.atan2(i,e),o=s*Math.cos(n),a=s*Math.sin(n);t.moveTo(e-o,-a),t.lineTo(e+o,a),t.moveTo(-o,-a),t.lineTo(e+o,i+a),t.moveTo(-o,i-a),t.lineTo(o,i+a)}},Pattern=class{constructor(t,e=1){this.pixelRatio=e,this._cache=void 0,this.width=Math.max(t?.width??10,1),this.height=Math.max(t?.height??10,1),this.fill=t.fill??"transparent",this.fillOpacity=t.fillOpacity??1,this.backgroundFill=t.backgroundFill??"transparent",this.backgroundFillOpacity=t.backgroundFillOpacity??1,this.stroke=t.stroke??"black",this.strokeOpacity=t.strokeOpacity??1,this.strokeWidth=t.strokeWidth??1,this.padding=t.padding??1,this.pattern=t.pattern??"forward-slanted-lines",this.rotation=t.rotation??0}getPath(){const{pattern:t,width:e,height:i,padding:s,strokeWidth:n,pixelRatio:o}=this,a=new ExtendedPath2D;return PATTERNS[t](a,{width:e,height:i,pixelRatio:o,strokeWidth:n,padding:s}),a}renderStroke(t,e){const{stroke:i,strokeWidth:s,strokeOpacity:n}=this;s&&(e.strokeStyle=i,e.lineWidth=s,e.globalAlpha=n,e.stroke(t))}renderFill(t,e){const{fill:i,fillOpacity:s}=this;e.fillStyle=i,e.globalAlpha=s,e.fill(t)}createCanvasPattern(t){const{width:e,height:i,backgroundFill:s,backgroundFillOpacity:n,pixelRatio:o,rotation:a}=this,r=new HdpiOffscreenCanvas({width:e,height:i,pixelRatio:o}),l=r.context;l.fillStyle=s,l.globalAlpha=n,l.fillRect(0,0,e,i);const c=this.getPath().getPath2D();this.renderFill(c,l),this.renderStroke(c,l);const h=t.createPattern(r.canvas,"repeat"),d=normalizeAngle360(toRadians(a)),u=1/o,p=Math.cos(d)*u,g=Math.sin(d)*u;return h?.setTransform(new DOMMatrix([p,g,-g,p,0,0])),r.destroy(),h}createPattern(t){if(this._cache!=null&&this._cache.ctx===t)return this._cache.pattern;const e=this.createCanvasPattern(t);if(e!=null)return this._cache={ctx:t,pattern:e},e}toSvg(){const{width:t,height:e,fill:i,fillOpacity:s,backgroundFill:n,backgroundFillOpacity:o,stroke:a,strokeWidth:r,strokeOpacity:l,rotation:c}=this,h=createSvgElement("pattern");h.setAttribute("viewBox",`0 0 ${t} ${e}`),h.setAttribute("width",String(t)),h.setAttribute("height",String(e)),h.setAttribute("patternUnits","userSpaceOnUse");const d=createSvgElement("rect");d.setAttribute("x","0"),d.setAttribute("y","0"),d.setAttribute("width",String(t)),d.setAttribute("height",String(e)),d.setAttribute("fill",n),d.setAttribute("fill-opacity",String(o)),h.appendChild(d);const u=createSvgElement("path");return u.setAttribute("fill",i),u.setAttribute("fill-opacity",String(s)),u.setAttribute("stroke-opacity",String(l)),u.setAttribute("stroke",a),u.setAttribute("stroke-width",String(r)),u.setAttribute("transform",`rotate(${c})`),u.setAttribute("d",this.getPath().toSVG()),h.appendChild(u),h}};function isGradientFill(t){return isObject(t)&&t.type=="gradient"}function isStringFillArray(t){return isArray(t)&&t.every(e=>typeof e=="string")}function isPatternFill(t){return t!==null&&isObject(t)&&t.type=="pattern"}function isGradientOrPatternFill(t){return isGradientFill(t)||isPatternFill(t)}var _Shape=class mt extends Node{constructor(){super(...arguments),this.fillOpacity=1,this.strokeOpacity=1,this.fill=mt.defaultStyles.fill,this.stroke=mt.defaultStyles.stroke,this.strokeWidth=mt.defaultStyles.strokeWidth,this.lineDash=mt.defaultStyles.lineDash,this.lineDashOffset=mt.defaultStyles.lineDashOffset,this.lineCap=mt.defaultStyles.lineCap,this.lineJoin=mt.defaultStyles.lineJoin,this.miterLimit=void 0,this.opacity=mt.defaultStyles.opacity,this.fillShadow=mt.defaultStyles.fillShadow}restoreOwnStyles(){const{defaultStyles:e}=this.constructor;Object.assign(this,e)}getGradient(e){if(isGradientFill(e))return this.createGradient(e)}createGradient(e){const{colorSpace:i="rgb",gradient:s="linear",colorStops:n,rotation:o=0,reverse:a=!1}=e;if(n==null)return;let r=getColorStops(n,["black"],[0,1]);switch(a&&(r=r.map(l=>({color:l.color,stop:1-l.stop})).reverse()),s){case"linear":return new LinearGradient(i,r,o);case"radial":return new RadialGradient(i,r);case"conic":return new ConicGradient(i,r,o)}}getPattern(e){if(isPatternFill(e))return this.createPattern(e)}createPattern(e){const i=this.layerManager?.canvas?.pixelRatio??1;return new Pattern(e,i)}onFillChange(){typeof this.fill=="object"&&objectsEqual(this._cachedFill??{},this.fill)||(this.fillGradient=this.getGradient(this.fill),this.fillPattern=this.getPattern(this.fill),this._cachedFill=this.fill)}onStrokeChange(){this.strokeGradient=this.getGradient(this.stroke)}align(e,i){return align(this.layerManager?.canvas?.pixelRatio??1,e,i)}preRender(e,i){return this.dirty&&(this.cachedDefaultGradientFillBBox=void 0),super.preRender(e,i)}fillStroke(e,i){this.renderFill(e,i),this.renderStroke(e,i)}renderFill(e,i){if(this.fill){const{globalAlpha:s}=e;this.applyFill(e),this.applyFillAlpha(e),this.applyShadow(e),this.executeFill(e,i),e.globalAlpha=s}e.shadowColor="rgba(0, 0, 0, 0)"}executeFill(e,i){i?e.fill(i):e.fill()}applyFill(e){const{fill:i,fillGradient:s,fillBBox:n=this.getDefaultGradientFillBBox()??this.getBBox(),fillParams:o}=this,a=n?s?.createGradient(e,n,o):void 0,r=this.fillPattern?.createPattern(e);e.fillStyle=r??a??(typeof i=="string"?i:void 0)??"black"}applyStroke(e){e.strokeStyle=this.strokeGradient?.createGradient(e,this.getBBox())??(typeof this.stroke=="string"?this.stroke:void 0)??"black"}applyFillAlpha(e){e.globalAlpha*=this.opacity*this.fillOpacity}applyShadow(e){const i=this.layerManager?.canvas.pixelRatio??1,s=this.fillShadow;s?.enabled&&(e.shadowColor=s.color,e.shadowOffsetX=s.xOffset*i,e.shadowOffsetY=s.yOffset*i,e.shadowBlur=s.blur*i)}renderStroke(e,i){if(this.stroke&&this.strokeWidth){const{globalAlpha:s}=e;this.applyStroke(e),e.globalAlpha*=this.opacity*this.strokeOpacity,e.lineWidth=this.strokeWidth,this.lineDash&&e.setLineDash(this.lineDash),this.lineDashOffset&&(e.lineDashOffset=this.lineDashOffset),this.lineCap&&(e.lineCap=this.lineCap),this.lineJoin&&(e.lineJoin=this.lineJoin),this.miterLimit!=null&&(e.miterLimit=this.miterLimit),this.executeStroke(e,i),e.globalAlpha=s}}executeStroke(e,i){i?e.stroke(i):e.stroke()}getDefaultGradientFillBBox(){return this.cachedDefaultGradientFillBBox==null&&(this.cachedDefaultGradientFillBBox=Object.freeze(this.computeDefaultGradientFillBBox())),this.cachedDefaultGradientFillBBox}computeDefaultGradientFillBBox(){}containsPoint(e,i){return this.isPointInPath(e,i)}applySvgFillAttributes(e,i){const{fill:s,fillOpacity:n}=this;if(typeof s=="string")e.setAttribute("fill",s);else if(isGradientFill(s)&&this.fillGradient){i??(i=[]);const o=this.fillGradient.toSvg(this.fillBBox??this.getBBox()),a=generateUUID();o.setAttribute("id",a),i.push(o),e.setAttribute("fill",`url(#${a})`)}else if(isPatternFill(s)&&this.fillPattern){i??(i=[]);const o=this.fillPattern.toSvg(),a=generateUUID();o.setAttribute("id",a),i.push(o),e.setAttribute("fill",`url(#${a})`)}else e.setAttribute("fill","none");return e.setAttribute("fill-opacity",String(n)),i}applySvgStrokeAttributes(e){const{stroke:i,strokeOpacity:s,strokeWidth:n,lineDash:o,lineDashOffset:a}=this;if(i!=null&&(e.setAttribute("stroke",typeof i=="string"?i:"none"),e.setAttribute("stroke-opacity",String(s)),e.setAttribute("stroke-width",String(n))),o?.some(r=>r!==0)===!0){const r=o.length%2===1?[...o,...o]:o;e.setAttribute("stroke-dasharray",r.join(" ")),e.setAttribute("stroke-dashoffset",String(a))}}};_Shape.defaultStyles={fill:"black",stroke:void 0,strokeWidth:0,lineDash:void 0,lineDashOffset:0,lineCap:void 0,lineJoin:void 0,opacity:1,fillShadow:void 0},__decorateClass2([SceneChangeDetection()],_Shape.prototype,"fillOpacity",2),__decorateClass2([SceneChangeDetection()],_Shape.prototype,"strokeOpacity",2),__decorateClass2([SceneChangeDetection({changeCb:t=>t.onFillChange()})],_Shape.prototype,"fill",2),__decorateClass2([SceneChangeDetection({changeCb:t=>t.onStrokeChange()})],_Shape.prototype,"stroke",2),__decorateClass2([SceneChangeDetection()],_Shape.prototype,"strokeWidth",2),__decorateClass2([SceneChangeDetection()],_Shape.prototype,"lineDash",2),__decorateClass2([SceneChangeDetection()],_Shape.prototype,"lineDashOffset",2),__decorateClass2([SceneChangeDetection()],_Shape.prototype,"lineCap",2),__decorateClass2([SceneChangeDetection()],_Shape.prototype,"lineJoin",2),__decorateClass2([SceneChangeDetection()],_Shape.prototype,"miterLimit",2),__decorateClass2([SceneChangeDetection({convertor:t=>clamp(0,t,1)})],_Shape.prototype,"opacity",2),__decorateClass2([SceneChangeDetection({checkDirtyOnAssignment:!0})],_Shape.prototype,"fillShadow",2),__decorateClass2([SceneChangeDetection({changeCb:t=>t.onFillChange()})],_Shape.prototype,"fillBBox",2),__decorateClass2([SceneChangeDetection({changeCb:t=>t.onFillChange()})],_Shape.prototype,"fillParams",2);var Shape=_Shape,IDENTITY_MATRIX_ELEMENTS=[1,0,0,1,0,0],Matrix=class Rt{get e(){return[...this.elements]}constructor(e=IDENTITY_MATRIX_ELEMENTS){this.elements=[...e]}setElements(e){const i=this.elements;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],this}get identity(){const e=this.elements;return isNumberEqual(e[0],1)&&isNumberEqual(e[1],0)&&isNumberEqual(e[2],0)&&isNumberEqual(e[3],1)&&isNumberEqual(e[4],0)&&isNumberEqual(e[5],0)}AxB(e,i,s){const n=e[0]*i[0]+e[2]*i[1],o=e[1]*i[0]+e[3]*i[1],a=e[0]*i[2]+e[2]*i[3],r=e[1]*i[2]+e[3]*i[3],l=e[0]*i[4]+e[2]*i[5]+e[4],c=e[1]*i[4]+e[3]*i[5]+e[5];s=s??e,s[0]=n,s[1]=o,s[2]=a,s[3]=r,s[4]=l,s[5]=c}multiplySelf(e){return this.AxB(this.elements,e.elements),this}multiply(e){const i=new Array(6);return e instanceof Rt?this.AxB(this.elements,e.elements,i):this.AxB(this.elements,[e.a,e.b,e.c,e.d,e.e,e.f],i),new Rt(i)}preMultiplySelf(e){return this.AxB(e.elements,this.elements,this.elements),this}inverse(){const e=this.elements;let i=e[0],s=e[1],n=e[2],o=e[3];const a=e[4],r=e[5],l=1/(i*o-s*n);return i*=l,s*=l,n*=l,o*=l,new Rt([o,-s,-n,i,n*r-o*a,s*a-i*r])}invertSelf(){const e=this.elements;let i=e[0],s=e[1],n=e[2],o=e[3];const a=e[4],r=e[5],l=1/(i*o-s*n);return i*=l,s*=l,n*=l,o*=l,e[0]=o,e[1]=-s,e[2]=-n,e[3]=i,e[4]=n*r-o*a,e[5]=s*a-i*r,this}transformPoint(e,i){const s=this.elements;return{x:e*s[0]+i*s[2]+s[4],y:e*s[1]+i*s[3]+s[5]}}transformBBox(e,i){const s=this.elements,n=s[0],o=s[1],a=s[2],r=s[3],l=e.width*.5,c=e.height*.5,h=e.x+l,d=e.y+c,u=Math.abs(l*n)+Math.abs(c*a),p=Math.abs(l*o)+Math.abs(c*r);return i??(i=new BBox(0,0,0,0)),i.x=h*n+d*a+s[4]-u,i.y=h*o+d*r+s[5]-p,i.width=u+u,i.height=p+p,i}toContext(e){if(this.identity)return;const i=this.elements;e.transform(i[0],i[1],i[2],i[3],i[4],i[5])}static updateTransformMatrix(e,i,s,n,o,a,r){const l=i,c=s;let h,d;l===1&&c===1?(h=0,d=0):(h=r?.scalingCenterX??0,d=r?.scalingCenterY??0);const u=n,p=Math.cos(u),g=Math.sin(u);let f,m;u===0?(f=0,m=0):(f=r?.rotationCenterX??0,m=r?.rotationCenterY??0);const y=o,x=a,b=h*(1-l)-f,S=d*(1-c)-m;return e.setElements([p*l,g*l,-g*c,p*c,p*b-g*S+f+y,g*b+p*S+m+x]),e}};function isMatrixTransform(t){return isMatrixTransformType(t.constructor)}var MATRIX_TRANSFORM_TYPE=Symbol("isMatrixTransform");function isMatrixTransformType(t){return t[MATRIX_TRANSFORM_TYPE]===!0}function MatrixTransform(t){var e,i;const s=t;if(isMatrixTransformType(t))return t;const n=Symbol("matrix_combined_transform");class o extends s{constructor(){super(...arguments),this[i]=new Matrix,this._dirtyTransform=!0}markDirtyTransform(){this._dirtyTransform=!0,super.markDirty()}updateMatrix(r){}computeTransformMatrix(){this._dirtyTransform&&(this[n].setElements(IDENTITY_MATRIX_ELEMENTS),this.updateMatrix(this[n]),this._dirtyTransform=!1)}toParent(r){return this.computeTransformMatrix(),this[n].identity?r.clone():this[n].transformBBox(r)}toParentPoint(r,l){return this.computeTransformMatrix(),this[n].identity?{x:r,y:l}:this[n].transformPoint(r,l)}fromParent(r){return this.computeTransformMatrix(),this[n].identity?r.clone():this[n].inverse().transformBBox(r)}fromParentPoint(r,l){return this.computeTransformMatrix(),this[n].identity?{x:r,y:l}:this[n].inverse().transformPoint(r,l)}computeBBox(){const r=super.computeBBox();return r&&this.toParent(r)}computeBBoxWithoutTransforms(){return super.computeBBox()}pickNode(r,l){return{x:r,y:l}=this.fromParentPoint(r,l),super.pickNode(r,l)}pickNodes(r,l,c){return{x:r,y:l}=this.fromParentPoint(r,l),super.pickNodes(r,l,c)}render(r){this.computeTransformMatrix();const{ctx:l}=r,c=this[n];let h=!1;c.identity||(l.save(),h=!0,c.toContext(l)),super.render(r),h&&l.restore()}toSVG(){this.computeTransformMatrix();const r=super.toSVG(),l=this[n];if(l.identity||r==null)return r;const c=createSvgElement("g");c.append(...r.elements);const[h,d,u,p,g,f]=l.e;return c.setAttribute("transform",`matrix(${h} ${d} ${u} ${p} ${g} ${f})`),{elements:[c],defs:r.defs}}}return e=MATRIX_TRANSFORM_TYPE,i=n,o[e]=!0,o}function Rotatable(t){var e;const i=t,s=Symbol("matrix_rotation");class n extends MatrixTransform(i){constructor(){super(...arguments),this[e]=new Matrix,this.rotationCenterX=null,this.rotationCenterY=null,this.rotation=0}updateMatrix(a){super.updateMatrix(a);const{rotation:r,rotationCenterX:l,rotationCenterY:c}=this;r!==0&&(Matrix.updateTransformMatrix(this[s],1,1,r,0,0,{rotationCenterX:l,rotationCenterY:c}),a.multiplySelf(this[s]))}}return e=s,__decorateClass2([SceneChangeDetection({type:"transform"})],n.prototype,"rotationCenterX",2),__decorateClass2([SceneChangeDetection({type:"transform"})],n.prototype,"rotationCenterY",2),__decorateClass2([SceneChangeDetection({type:"transform"})],n.prototype,"rotation",2),n}function Scalable(t){var e;const i=t,s=Symbol("matrix_scale");class n extends MatrixTransform(i){constructor(){super(...arguments),this[e]=new Matrix,this.scalingX=1,this.scalingY=1,this.scalingCenterX=null,this.scalingCenterY=null}updateMatrix(a){super.updateMatrix(a);const{scalingX:r,scalingY:l,scalingCenterX:c,scalingCenterY:h}=this;r===1&&l===1||(Matrix.updateTransformMatrix(this[s],r,l,0,0,0,{scalingCenterX:c,scalingCenterY:h}),a.multiplySelf(this[s]))}}return e=s,__decorateClass2([SceneChangeDetection({type:"transform"})],n.prototype,"scalingX",2),__decorateClass2([SceneChangeDetection({type:"transform"})],n.prototype,"scalingY",2),__decorateClass2([SceneChangeDetection({type:"transform"})],n.prototype,"scalingCenterX",2),__decorateClass2([SceneChangeDetection({type:"transform"})],n.prototype,"scalingCenterY",2),n}function Translatable(t){var e;const i=t,s=Symbol("matrix_translation");class n extends MatrixTransform(i){constructor(){super(...arguments),this[e]=new Matrix,this.translationX=0,this.translationY=0}updateMatrix(a){super.updateMatrix(a);const{translationX:r,translationY:l}=this;r===0&&l===0||(Matrix.updateTransformMatrix(this[s],1,1,0,r,l),a.multiplySelf(this[s]))}}return e=s,__decorateClass2([SceneChangeDetection({type:"transform"})],n.prototype,"translationX",2),__decorateClass2([SceneChangeDetection({type:"transform"})],n.prototype,"translationY",2),n}var Transformable=class{static fromCanvas(t,e){const i=[];for(const s of t.traverseUp())isMatrixTransform(s)&&i.unshift(s);for(const s of i)e=s.fromParent(e);return isMatrixTransform(t)&&(e=t.fromParent(e)),e}static toCanvas(t,e){e==null?e=t.getBBox():isMatrixTransform(t)&&(e=t.toParent(e));for(const i of t.traverseUp())isMatrixTransform(i)&&(e=i.toParent(e));return e}static fromCanvasPoint(t,e,i){const s=[];for(const n of t.traverseUp())isMatrixTransform(n)&&s.unshift(n);for(const n of s)({x:e,y:i}=n.fromParentPoint(e,i));return isMatrixTransform(t)&&({x:e,y:i}=t.fromParentPoint(e,i)),{x:e,y:i}}static toCanvasPoint(t,e,i){isMatrixTransform(t)&&({x:e,y:i}=t.toParentPoint(e,i));for(const s of t.traverseUp())isMatrixTransform(s)&&({x:e,y:i}=s.toParentPoint(e,i));return{x:e,y:i}}},cmp=(t,e)=>Math.sign(t-e);function compareZIndex(t,e){if(typeof t=="number"&&typeof e=="number")return cmp(t,e);const i=typeof t=="number"?[t]:t,s=typeof e=="number"?[e]:e,n=Math.min(i.length,s.length);for(let o=0;o<n;o+=1){const a=cmp(i[o],s[o]);if(a!==0)return a}return cmp(i.length,s.length)}var sharedOffscreenCanvas,_Group=class Ct extends Node{constructor(e){super(e),this.opacity=1,this.renderToOffscreenCanvas=!1,this.optimizeForInfrequentRedraws=!1,this.layer=void 0,this.image=void 0,this._lastWidth=NaN,this._lastHeight=NaN,this._lastDevicePixelRatio=NaN,this.isContainerNode=!0,this.renderToOffscreenCanvas=e?.renderToOffscreenCanvas===!0}static is(e){return e instanceof Ct}static computeChildrenBBox(e,i=!0){return BBox.merge(Node.extractBBoxes(e,i))}static compareChildren(e,i){return compareZIndex(e.zIndex,i.zIndex)||e.serialNumber-i.serialNumber}containsPoint(e,i){return!0}computeBBox(){return Ct.computeChildrenBBox(this.children())}computeSafeClippingBBox(e){const i=this.computeBBox();if(!i.isFinite())return;let s=0;const n=4;for(const u of this.descendants())u instanceof Shape&&(s=Math.max(s,u.strokeWidth));const o=Math.max(1,s/2*n),{x:a,y:r}=Transformable.toCanvasPoint(this,0,0),l=alignBefore(e,a+i.x-o)-a,c=alignBefore(e,r+i.y-o)-r,h=Math.ceil(i.x+i.width-l+o),d=Math.ceil(i.y+i.height-c+o);return new BBox(l,c,h,d)}prepareSharedCanvas(e,i,s){return sharedOffscreenCanvas==null||sharedOffscreenCanvas.pixelRatio!==s?sharedOffscreenCanvas=new HdpiOffscreenCanvas({width:e,height:i,pixelRatio:s}):sharedOffscreenCanvas.resize(e,i,s),sharedOffscreenCanvas}isDirty(e){const{width:i,height:s,devicePixelRatio:n}=e,{dirty:o,dirtyZIndex:a,layer:r}=this,l=r!=null&&(this._lastWidth!==i||this._lastHeight!==s),c=this._lastDevicePixelRatio!==n;if(this._lastWidth=i,this._lastHeight=s,this._lastDevicePixelRatio=n,o||a||l||c)return!0;for(const h of this.children())if(h.dirty)return!0;return!1}preRender(e){const i=super.preRender(e,0);return i.groups+=1,i.nonGroups-=1,this.renderToOffscreenCanvas&&!this.optimizeForInfrequentRedraws&&i.nonGroups>0&&this.getVisibility()?this.layer??(this.layer=this._layerManager?.addLayer({name:this.name})):this.layer!=null&&(this._layerManager?.removeLayer(this.layer),this.layer=void 0),i}render(e){const{layer:i,renderToOffscreenCanvas:s}=this,n={...e};if(!s){this.renderInContext(n),super.render(n);return}const{ctx:o,stats:a,devicePixelRatio:r}=e;let{image:l}=this;if(this.isDirty(e)){l?.bitmap.close(),l=void 0;const h=i?void 0:this.computeSafeClippingBBox(r),d=(u,...p)=>{const g=u.context;n.ctx=g,u.clear(),g.save(),g.setTransform(...p),g.globalAlpha=1,this.renderInContext(n),g.restore(),g.verifyDepthZero?.()};if(i)d(i,o.getTransform());else if(h){const{x:u,y:p,width:g,height:f}=h,m=this.prepareSharedCanvas(g,f,r);d(m,r,0,0,r,-u*r,-p*r),l={bitmap:m.transferToImageBitmap(),x:u,y:p,width:g,height:f}}else this.dirtyZIndex&&this.sortChildren(Ct.compareChildren);this.image=l,a&&a.layersRendered++}else this.skipRender(n),a&&a.layersSkipped++;const{globalAlpha:c}=o;if(o.globalAlpha=c*this.opacity,i)o.save(),o.resetTransform(),i.drawImage(o),o.restore();else if(l){const{bitmap:h,x:d,y:u,width:p,height:g}=l;o.drawImage(h,0,0,p*r,g*r,d,u,p,g)}o.globalAlpha=c,super.render(n)}skipRender(e){const{stats:i}=e;for(const s of this.children())s.markClean(),i&&(i.nodesSkipped+=this.childNodeCounts.groups+this.childNodeCounts.nonGroups,i.opsSkipped+=this.childNodeCounts.complexity)}applyClip(e,i){const{x:s,y:n,width:o,height:a}=i;e.beginPath(),e.rect(s,n,o,a),e.clip()}renderInContext(e){const{ctx:i,stats:s}=e;this.dirtyZIndex&&this.sortChildren(Ct.compareChildren),i.save(),i.globalAlpha*=this.opacity,this.clipRect!=null&&(this.applyClip(i,this.clipRect),e.clipBBox=Transformable.toCanvas(this,this.clipRect));for(const n of this.children()){if(!n.visible){n.markClean(),s&&(s.nodesSkipped+=n.childNodeCounts.nonGroups+n.childNodeCounts.groups,s.opsSkipped+=n.childNodeCounts.complexity);continue}i.save(),n.render(e),i.restore()}i.restore()}setClipRect(e){this.clipRect=e?Transformable.fromCanvas(this,e):void 0}setClipRectCanvasSpace(e){this.clipRect=e}_setLayerManager(e){this.layer&&(this._layerManager?.removeLayer(this.layer),this.layer=void 0),super._setLayerManager(e)}getVisibility(){for(const e of this.traverseUp(!0))if(!e.visible)return!1;return!0}toSVG(){if(!this.visible)return;const e=[],i=[];for(const s of this.children()){const n=s.toSVG();n!=null&&(i.push(...n.elements),n.defs!=null&&e.push(...n.defs))}return{elements:i,defs:e}}};_Group.className="Group",__decorateClass2([SceneChangeDetection({convertor:t=>clamp(0,t,1)})],_Group.prototype,"opacity",2);var Group=_Group,ScalableGroup=class extends Scalable(Group){},RotatableGroup=class extends Rotatable(Group){},TranslatableGroup=class extends Translatable(Group){},TransformableGroup=class extends Rotatable(Translatable(Group)){},AsyncAwaitQueue=class{constructor(){this.queue=[]}await(t=50){return new Promise(e=>{const i=()=>{clearTimeout(n),e(!0)},n=setTimeout(()=>{const o=this.queue.indexOf(i);o<0||(this.queue.splice(o,1),e(!1))},t);this.queue.push(i)})}notify(){this.queue.splice(0).forEach(t=>t())}};function pause(){return new Promise(t=>{setTimeout(t,0)})}function setElementBBox(t,e){t&&(e=BBoxValues.normalize(e),e.width==null?t.style.removeProperty("width"):t.style.width=`${e.width}px`,e.height==null?t.style.removeProperty("height"):t.style.height=`${e.height}px`,e.x==null?t.style.removeProperty("left"):t.style.left=`${e.x}px`,e.y==null?t.style.removeProperty("top"):t.style.top=`${e.y}px`)}function getElementBBox(t){const e=parseFloat(t.style.width)||t.offsetWidth,i=parseFloat(t.style.height)||t.offsetHeight,s=parseFloat(t.style.left)||t.offsetLeft,n=parseFloat(t.style.top)||t.offsetTop;return{x:s,y:n,width:e,height:i}}function focusCursorAtEnd(t){if(t.focus({preventScroll:!0}),t.lastChild?.textContent==null)return;const e=getDocument().createRange();e.setStart(t.lastChild,t.lastChild.textContent.length),e.setEnd(t.lastChild,t.lastChild.textContent.length);const i=getWindow().getSelection();i?.removeAllRanges(),i?.addRange(e)}var _id=0;function createElementId(t){return`${t??"ag-charts-element"}-${_id++}`}function isInputPending(){const t=getWindow("navigator");if("scheduling"in t){const e=t.scheduling;if("isInputPending"in e)return e.isInputPending({includeContinuous:!0})}return!1}function getIconClassNames(t){return`ag-charts-icon ag-charts-icon-${t}`}var CLASS_INSTANCE_TYPE="class-instance";function jsonDiff(t,e,i){if(isArray(e)){if(!isArray(t)||t.length!==e.length||e.some((s,n)=>jsonDiff(t[n],s,i)!=null))return e}else if(isPlainObject(e)){if(!isPlainObject(t))return e;const s={},n=new Set([...Object.keys(t),...Object.keys(e)]);for(const o of n)if(t[o]!==e[o])if(i?.has(o))s[o]=e[o];else if(typeof t[o]==typeof e[o]){const a=jsonDiff(t[o],e[o],i);a!==null&&(s[o]=a)}else s[o]=e[o];return Object.keys(s).length?s:null}else if(t!==e)return e;return null}function jsonPropertyCompare(t,e){for(const i of Object.keys(t))if(t[i]!==e?.[i])return!1;return!0}function deepClone(t,e){return isArray(t)?t.map(i=>deepClone(i,e)):isPlainObject(t)?clonePlainObject(t,e):t instanceof Map?new Map(deepClone(Array.from(t))):shallowClone(t)}function clonePlainObject(t,e){const i={};for(const s of Object.keys(t))e?.assign?.has(s)?i[s]=t[s]:e?.shallow?.has(s)?i[s]=shallowClone(t[s]):i[s]=deepClone(t[s],e);return i}function shallowClone(t){return isArray(t)?t.slice(0):isPlainObject(t)?{...t}:isDate(t)?new Date(t):isRegExp(t)?new RegExp(t.source,t.flags):t}function jsonWalk(t,e,i,s,n,o){if(isArray(t)){o=e(t,s,n,o);let a=0;for(const r of t)o=jsonWalk(r,e,i,s?.[a],n,o),a++}else if(isPlainObject(t)){o=e(t,s,n,o);for(const a of Object.keys(t)){if(i?.has(a))continue;const r=t[a];o=jsonWalk(r,e,i,s?.[a],n,o)}}return o}function jsonApply(t,e,i={}){const{path:s,matcherPath:n=s?.replace(/(\[[0-9+]+])/i,"[]"),skip:o=[]}=i;if(t==null)throw new Error(`AG Charts - target is uninitialised: ${s??"<root>"}`);if(e==null)return t;if(isProperties(t))return t.set(e);const a=t,r=classify(t);for(const l of Object.keys(e)){if(SKIP_JS_BUILTINS.has(l))continue;const c=`${n?n+".":""}${l}`;if(o.includes(c))continue;const h=e[l],d=`${s?s+".":""}${l}`,u=a.constructor,p=a[l];try{const g=classify(p),f=classify(h);if(r===CLASS_INSTANCE_TYPE&&!(l in t||l==="context")){if(h===void 0)continue;logger_exports.warn(`unable to set [${d}] in ${u?.name} - property is unknown`);continue}if(g!=null&&f!=null&&f!==g&&(g!==CLASS_INSTANCE_TYPE||f!=="object")){logger_exports.warn(`unable to set [${d}] in ${u?.name} - can't apply type of [${f}], allowed types are: [${g}]`);continue}if(isProperties(p))a[l].set(h);else if(f==="object"&&l!=="context"){if(p==null){logger_exports.warn(`unable to set [${d}] in ${u?.name} - property is unknown`);continue}jsonApply(p,h,{...i,path:d,matcherPath:c})}else a[l]=h}catch(g){logger_exports.warn(`unable to set [${d}] in [${u?.name}]; nested error is: ${g.message}`)}}return t}function classify(t){return t==null?null:isHtmlElement(t)||isDate(t)?"primitive":isArray(t)?"array":isObject(t)?isPlainObject(t)?"object":CLASS_INSTANCE_TYPE:isFunction(t)?"function":"primitive"}function jsonResolveOperations(t,e,i,s){return jsonResolveInner(t,e,s??t,{matches:new Map},i)}var operationResolvedUndefined=Symbol("operation-resolved-undefined");function jsonResolveInner(t,e,i,s,n,o=[],a={}){if(isArray(t)){jsonResolveVisitor(t,e,i,s,o,a);let r=0;for(const l of t)jsonResolveInner(l,e,i,s,n,[...o,`${r}`],a),r++}else if(isPlainObject(t)){jsonResolveVisitor(t,e,i,s,o,a);for(const r of Object.keys(t)){if(n?.has(r))continue;const l=t[r];jsonResolveInner(l,e,i,s,n,[...o,r],a)}}return a}function jsonResolveVisitor(t,e,i,s,n,o){if(isArray(t))for(let a=0;a<t.length;a++)t[a]=jsonResolveVisitorValue(t[a],e,i,s,[...n,`${a}`],o),t[a]===operationResolvedUndefined&&(t[a]=void 0);else{let a=!1;for(const r of Object.keys(t))t[r]=jsonResolveVisitorValue(t[r],e,i,s,[...n,r],o),a||(a=isKey(r,operations)),t[r]===operationResolvedUndefined&&delete t[r];if(a&&Object.keys(t).length>1)for(const r of Object.keys(t))isKey(r,operations)&&delete t[r]}}function jsonResolveVisitorValue(t,e,i,s,n,o){const a=getOperation(t);if(!a)return t;o[n.join(".")]=t;const r=resolveOperation(a.operation,a.values,e,i,n,s);return r===void 0?operationResolvedUndefined:r}function getOperation(t){if(!isPlainObject(t))return;const[e]=Object.keys(t);if(isKey(e,operations))return{operation:e,values:t[e]}}function resolveOperation(t,e,i,s,n,o){o.referencedParams??(o.referencedParams=new Set);const a=["$find","$map"];isArray(e)&&!a.includes(t)&&(e=e.map(l=>{const c=getOperation(l);return c?resolveOperation(c.operation,c.values,i,s,n,o):l}));const r=operations[t];return r(e,n,i,s,o)}function isKey(t,e){return isString(t)&&(isObject(e)||isArray(e))&&t in e}function isRatio(t){return isNumber(t)&&t>=0&&t<=1}function isGradientFill2(t){return isObject(t)&&t.type=="gradient"}function isPatternFill2(t){return t!==null&&isObject(t)&&t.type=="pattern"}function resolvePath(t,e){const i=e.split("/");let s=[...t];e.startsWith("/")&&(s=[],i.shift());let n=!1;for(const o of i){if(o==="..")s.pop(),n||s.pop();else if(o===".")s.pop();else if(o==="$index"){const a=t.findLast(r=>!isNaN(Number(r)));a!=null&&s.push(a)}else if(o==="$prevIndex"){const a=t.findLast(r=>!isNaN(Number(r)));a!=null&&s.push(`${Number(a)-1}`)}else o.length!==0&&s.push(o);n=o===".."}return s}var locationOperations={$ref:ref,$path:pathOperation,$palette:palette},logicOperations={$if:([t,e,i])=>t?e:i,$eq:([t,e])=>t===e,$not:([t])=>!t,$or:t=>isArray(t)&&t.some(Boolean),$and:t=>isArray(t)&&t.every(Boolean),$switch:()=>{},$isOperation:isOperationOperator},numericOperations={$isEven:isEven,$mul:mul,$round:round},transformOperations={$map:map,$find:find,$merge:merge2,$omit:omit,$value:valueOperation},fontOperations={$rem:rem},colorOperations={$mix:mix,$foregroundBackgroundMix:foregroundBackgroundMix,$foregroundBackgroundAccentMix:foregroundBackgroundAccentMix,$interpolate:interpolate2,$isGradient:([t])=>isGradientFill2(t),$isPattern:([t])=>isPatternFill2(t)},operations={...locationOperations,...logicOperations,...numericOperations,...transformOperations,...fontOperations,...colorOperations};function ref(t,e,i,s,n){if(!isKey(t,i)){logger_exports.warnOnce(`\`$ref\` json operation failed on [${String(t)}] at [${e.join(".")}], expecting one of [${Object.keys(i).join(", ")}].`);return}const o=getOperation(i[t]);if(o?.operation!=="$ref")return i[t];if(n.referencedParams?.has(o.values)){logger_exports.warnOnce(`\`$ref\` json operation failed on [${String(t)}] at [${e.join(".")}], circular reference detected with [${[...n.referencedParams].join(", ")}].`);return}return n.referencedParams?.add(o.values),ref(o.values,e,i,s,n)}function palette(t,e,i,s){if(!isString(t))return;const n=i.__palette;if(["fill","fillFallback","stroke","gradient","range2"].includes(t)){const a=e.findLastIndex(d=>!isNaN(Number(d)));let r=Number(e[a]);if(isNaN(r))return;const l=e.slice(0,a),c=["map-shape-background","map-line-background"],h=getPath(s,l).slice(0,r).filter(d=>c.includes(d.type)).length;switch(r-=h,t){case"fill":return circularSliceArray(n.fills,1,r)[0];case"fillFallback":return circularSliceArray(n.fillsFallback,1,r)[0];case"stroke":return circularSliceArray(n.strokes,1,r)[0];case"gradient":return circularSliceArray(n.sequentialColors,1,r)[0];case"range2":return circularSliceArray(n.fills,2,r)}return}return t==="gradients"?n.sequentialColors:getPath(n,t)}function pathOperation(t,e,i,s){let n=!1,o,a=!1,r=s;if(isArray(t))n=!0,o=t[1],a=t.length===3,r=a?t[2]:r,t=t[0];else if(!isString(t)){logger_exports.warnOnce(`\`$path\` json operation failed on [${String(t)}] at [${e.join(".")}], expecting a string.`);return}const l=resolvePath(a?[]:e,t);let c=r;for(const h of l){if(!isKey(h,c)){if(n)return o;logger_exports.warnOnce(`\`$path\` json operation failed on [${String(t)}] at [${e.join(".")}] resolved to [${l.join(".")}], could not find path in object.`);return}c=c[h]}return Object.isFrozen(c)?deepClone(c):c}function isOperationOperator(t,e,i,s){const n=isString(t)?resolvePath(e,t):e,o=n.length===0?s:getPath(s,n);return getOperation(o)!=null}function isEven([t],e){if(typeof t=="number")return t%2===0;logger_exports.warnOnce(`\`$isEven\` json operation failed on [${String(t)}] at [${e.join(".")}], expecting a number.`)}function mul([t,e],i){if(typeof t=="number"&&typeof e=="number")return t*e;logger_exports.warnOnce(`\`$mul\` json operation failed on [${String(t)}] and [${String(e)}] at [${i.join(".")}], expecting two numbers.`)}function round([t],e){if(typeof t=="number")return Math.round(t);logger_exports.warnOnce(`\`$round\` json operation failed on [${String(t)}] at [${e.join(".")}], expecting a number.`)}function map([t,e],i,s,n,o){const a=getOperation(e);if(a&&(e=resolveOperation(a.operation,a.values,s,n,i,o)),!isArray(e))return[];const r=getOperation(t);return r?(o.matches.set(i.join("."),e),e.map(()=>({[r.operation]:r.values}))):[]}function find([t,e],i,s,n,o){const a=getOperation(e);if(a&&(e=resolveOperation(a.operation,a.values,s,n,i,o)),!isArray(e))return;const r=getOperation(t);return r?e.find(l=>resolveOperation(r.operation,r.values,s,l,[],o)):t?e[0]:void 0}function merge2(t){if(isArray(t)){for(const e of t)if(!isPlainObject(e))return;return mergeDefaults(...t)}}function omit([t,e]){if(!(!isArray(t)||!isPlainObject(e)))return without(e,t)}function valueOperation(t,e,i,s,n){if(t!=="$1"&&t!=="$index")return t;const o=e.findLastIndex(l=>!isNaN(Number(l)));if(o===-1)return t;const a=Number(e[o]);if(t==="$index")return a;const r=e.slice(0,o).join(".");return n.matches.get(r)?.at(a)}function rem([t],e,i){const s="fontSize";if(isKey(s,i)&&typeof i[s]=="number"&&typeof t=="number")return Math.round(t*i[s]);logger_exports.warnOnce(`\`$rem\` json operation failed on [${String(t)}] at [${e.join(".")}], expecting a number.`)}function mix([t,e,i],s){const n=`\`$mix\` json operation failed on [${String(t)}, ${String(e)}, ${String(i)}] at [${s.join(".")}], expecting`,o=`${n} two colors and a number between 0 and 1.`;if(typeof e!="string"||!isRatio(i)){logger_exports.warnOnce(o);return}if(typeof t=="string")try{return Color.mix(Color.fromString(t),Color.fromString(e),i).toString()}catch{logger_exports.warnOnce(o);return}if(!isGradientFill2(t)){logger_exports.warnOnce(o);return}let a=t.colorStops;try{a=a?.map(r=>{let l;return typeof r.color=="string"&&(l=Color.mix(Color.fromString(r.color),Color.fromString(e),i).toString()),{...r,color:l}})}catch{logger_exports.warnOnce(`${n} a gradient, a color and a number between 0 and 1.`);return}return{...t,colorStops:a}}function foregroundBackgroundMix([t],e,i){const s="foregroundColor",n="backgroundColor";if(isKey(s,i)&&isKey(n,i)&&typeof i[s]=="string"&&typeof i[n]=="string"&&isRatio(t))return Color.mix(Color.fromString(i[s]),Color.fromString(i[n]),t).toString();logger_exports.warnOnce(`\`$foregroundBackgroundMix\` json operation failed on [${String(t)}}}] at [${e.join(".")}], expecting a number between 0 and 1.`)}function foregroundBackgroundAccentMix([t,e],i,s){const n="foregroundColor",o="backgroundColor",a="accentColor";if(isKey(n,s)&&isKey(o,s)&&isKey(a,s)&&typeof s[n]=="string"&&typeof s[o]=="string"&&typeof s[a]=="string"&&isRatio(t)&&isRatio(e))return Color.mix(Color.mix(Color.fromString(s[n]),Color.fromString(s[o]),t),Color.fromString(s[a]),e).toString();logger_exports.warnOnce(`\`$foregroundBackgroundAccentMix\` json operation failed on [${String(t)}, ${String(e)}}] at [${i.join(".")}], expecting two numbers between 0 and 1.`)}function interpolate2([t,e]){if(!(!isArray(t)||!isNumber(e)))return Color.interpolate(t.map(i=>Color.fromString(i)),e).map(i=>i.toString())}var Mutex=class{constructor(){this.available=!0,this.acquireQueue=[]}acquire(t){return new Promise(e=>{this.acquireQueue.push([t,e]),this.available&&this.dispatchNext().catch(i=>logger_exports.errorOnce(i))})}async acquireImmediately(t){return this.available?(await this.acquire(t),!0):!1}async waitForClearAcquireQueue(){return this.acquire(()=>Promise.resolve(void 0))}async dispatchNext(){this.available=!1;let[t,e]=this.acquireQueue.shift()??[];for(;t;){try{await t(),e?.()}catch(i){logger_exports.error("mutex callback error",i),e?.()}[t,e]=this.acquireQueue.shift()??[]}this.available=!0}},Observable=class{constructor(){this.eventListeners=new Map}addEventListener(t,e){if(typeof e!="function")throw new Error("AG Charts - listener must be a Function");const i=this.eventListeners.get(t);i?i.add(e):this.eventListeners.set(t,new Set([e]))}removeEventListener(t,e){const i=this.eventListeners.get(t);i!=null&&(i.delete(e),i.size===0&&this.eventListeners.delete(t))}hasEventListener(t){return this.eventListeners.has(t)}clearEventListeners(){this.eventListeners.clear()}fireEvent(t){this.eventListeners.get(t.type)?.forEach(e=>e(t))}},Padding=class extends BaseProperties{constructor(t=0,e=t,i=t,s=e){super(),this.top=t,this.right=e,this.bottom=i,this.left=s}};__decorateClass2([TempValidate(POSITIVE_NUMBER)],Padding.prototype,"top",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],Padding.prototype,"right",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],Padding.prototype,"bottom",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],Padding.prototype,"left",2);function ProxyProperty(t,e){const i=isArray(t)?t:t.split(".");if(i.length===1){const[s]=i;return addTransformToInstanceProperty((n,o,a)=>n[s]=a,n=>n[s],e)}return addTransformToInstanceProperty((s,n,o)=>setPath(s,i,o),s=>getPath(s,i),e)}function ProxyOnWrite(t){return addTransformToInstanceProperty((e,i,s)=>e[t]=s)}function ProxyPropertyOnWrite(t,e){return addTransformToInstanceProperty((i,s,n)=>i[t][e??s]=n)}function ActionOnSet(t){const{newValue:e,oldValue:i,changeValue:s}=t;return addTransformToInstanceProperty((n,o,a,r)=>(a!==r&&(r!==void 0&&i?.call(n,r),a!==void 0&&e?.call(n,a),s?.call(n,a,r)),a))}function ObserveChanges(t){return addObserverToInstanceProperty(t)}function debouncedAnimationFrame(t){return buildScheduler((e,i)=>getWindow().requestAnimationFrame(e),t)}function debouncedCallback(t){return buildScheduler((e,i=0)=>{i===0?queueMicrotask(e):setTimeout(e,i)},t)}function buildScheduler(t,e){let i=0,s=!1,n,o;const a=()=>s,r=()=>{s=!1,o?.(),o=void 0,n=void 0,i>0&&t(l)},l=()=>{const c=i;i=0,s=!0;const h=e({count:c});if(!h){r();return}h.then(r,r)};return{schedule(c){i===0&&!a()&&t(l,c),i++},async await(){if(a())for(n==null&&(n=new Promise(c=>{o=c}));a();)await n}}}function booleanParser(t){return t==="true"}function numberParser(t){return Number(t)}function stringParser(t){return t}var AttributeTypeParsers={role:stringParser,"aria-checked":booleanParser,"aria-controls":stringParser,"aria-describedby":stringParser,"aria-disabled":booleanParser,"aria-expanded":booleanParser,"aria-haspopup":booleanParser,"aria-hidden":booleanParser,"aria-label":stringParser,"aria-labelledby":stringParser,"aria-live":stringParser,"aria-orientation":stringParser,"aria-selected":booleanParser,"data-preventdefault":booleanParser,class:stringParser,id:stringParser,tabindex:numberParser,title:stringParser,placeholder:stringParser};function setAttribute(t,e,i){i==null||i===""||i===""?t?.removeAttribute(e):t?.setAttribute(e,i.toString())}function setAttributes(t,e){if(e!=null)for(const[i,s]of entries(e))i!=="class"&&setAttribute(t,i,s)}function getAttribute(t,e,i){if(!(t instanceof HTMLElement))return;const s=t.getAttribute(e);return s===null?i:AttributeTypeParsers[e]?.(s)??void 0}function setElementStyle(t,e,i){t!=null&&(i==null?t.style.removeProperty(e):t.style.setProperty(e,i.toString()))}function setElementStyles(t,e){for(const[i,s]of entries(e))setElementStyle(t,i,s)}var WIDGET_HTML_EVENTS=["blur","change","contextmenu","focus","keydown","keyup","click","dblclick","mouseenter","mousemove","mouseleave","wheel","touchstart","touchmove","touchend","touchcancel"];function allocMouseEvent(t,e,i){const{offsetX:s,offsetY:n,clientX:o,clientY:a}=e,{currentX:r,currentY:l}=WidgetEventUtil.calcCurrentXY(i,e);return{type:t,offsetX:s,offsetY:n,clientX:o,clientY:a,currentX:r,currentY:l,sourceEvent:e}}function allocTouchEvent(t,e,i){return{type:t,sourceEvent:e}}var WidgetAllocators={blur:t=>({type:"blur",sourceEvent:t}),change:t=>({type:"change",sourceEvent:t}),contextmenu:(t,e)=>allocMouseEvent("contextmenu",t,e),focus:t=>({type:"focus",sourceEvent:t}),keydown:t=>({type:"keydown",sourceEvent:t}),keyup:t=>({type:"keyup",sourceEvent:t}),click:(t,e)=>allocMouseEvent("click",t,e),dblclick:(t,e)=>allocMouseEvent("dblclick",t,e),mouseenter:(t,e)=>allocMouseEvent("mouseenter",t,e),mousemove:(t,e)=>allocMouseEvent("mousemove",t,e),mouseleave:(t,e)=>allocMouseEvent("mouseleave",t,e),wheel:t=>{const{offsetX:e,offsetY:i,clientX:s,clientY:n}=t,o=t.deltaMode===0?.01:1,a=t.deltaX*o,r=t.deltaY*o;return{type:"wheel",offsetX:e,offsetY:i,clientX:s,clientY:n,deltaX:a,deltaY:r,sourceEvent:t}},touchstart:(t,e)=>allocTouchEvent("touchstart",t,e),touchmove:(t,e)=>allocTouchEvent("touchmove",t,e),touchend:(t,e)=>allocTouchEvent("touchend",t,e),touchcancel:(t,e)=>allocTouchEvent("touchcancel",t,e)},WidgetEventUtil=class{static alloc(t,e,i){return WidgetAllocators[t](e,i)}static isHTMLEvent(t){return WIDGET_HTML_EVENTS.includes(t)}static calcCurrentXY(t,e){const i=t.getBoundingClientRect();return{currentX:e.clientX-i.x,currentY:e.clientY-i.y}}},WidgetListenerHTML=class{constructor(){this.widgetListeners={},this.sourceListeners={}}initSourceHandler(t,e){this.sourceListeners??(this.sourceListeners={}),this.sourceListeners[t]=e}lazyGetWidgetListeners(t,e){var i;if(!(t in(this.sourceListeners??{}))){const s=o=>{const a=WidgetEventUtil.alloc(t,o,e.getElement());for(const r of this.widgetListeners?.[t]??[])r(a,e)},n={};t.startsWith("touch")&&(n.passive=!1),this.initSourceHandler(t,s),e.getElement().addEventListener(t,s,n)}return this.widgetListeners??(this.widgetListeners={}),(i=this.widgetListeners)[t]??(i[t]=[]),this.widgetListeners[t]}add(t,e,i){this.lazyGetWidgetListeners(t,e).push(i)}remove(t,e,i){const s=this.lazyGetWidgetListeners(t,e),n=s.indexOf(i);n>-1&&s.splice(n,1)}destroy(t){for(const[e,i]of entries(this.sourceListeners??{}))t.getElement().removeEventListener(e,i);this.widgetListeners=void 0,this.sourceListeners=void 0}},MouseDragger=class{constructor(t,e,i,s){this.glob=t,this.self=e,this.window=getWindow(),this.mousegeneral=l=>{l.stopPropagation(),l.stopImmediatePropagation()},this.mousemove=l=>{l.stopPropagation(),l.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mousemove(l)},this.mouseup=l=>{l.button===0&&(l.stopPropagation(),l.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mouseup(l),this.destroy())};const{window:n,mousegeneral:o,mousemove:a,mouseup:r}=this;n.addEventListener("mousedown",o,{capture:!0}),n.addEventListener("mouseenter",o,{capture:!0}),n.addEventListener("mouseleave",o,{capture:!0}),n.addEventListener("mouseout",o,{capture:!0}),n.addEventListener("mouseover",o,{capture:!0}),n.addEventListener("mousemove",a,{capture:!0}),n.addEventListener("mouseup",r,{capture:!0}),e.mouseDragger=this,t.globalMouseDragCallbacks=i,t.globalMouseDragCallbacks.mousedown(s)}destroy(){const{window:t,mousegeneral:e,mousemove:i,mouseup:s}=this;t.removeEventListener("mousedown",e,{capture:!0}),t.removeEventListener("mouseenter",e,{capture:!0}),t.removeEventListener("mouseleave",e,{capture:!0}),t.removeEventListener("mouseout",e,{capture:!0}),t.removeEventListener("mouseover",e,{capture:!0}),t.removeEventListener("mousemove",i,{capture:!0}),t.removeEventListener("mouseup",s,{capture:!0}),this.glob.globalMouseDragCallbacks=void 0,this.self.mouseDragger=void 0}};function startMouseDrag(t,e,i,s){if(t.globalMouseDragCallbacks==null)return new MouseDragger(t,e,i,s)}var LONG_TAP_DURATION_MS=500,LONG_TAP_INTERRUPT_MIN_TOUCHMOVE_PXPX=100;function deltaClientSquared(t,e){const i=t.clientX-e.clientX,s=t.clientY-e.clientY;return i*i+s*s}var gIsInLongTap=!1,TouchDragger=class{constructor(t,e,i,s,n){this.glob=t,this.self=e,this.initialTouch=s,this.target=n,this.longTapInterrupted=!1,this.longtap=()=>{const{target:r,initialTouch:l}=this;if(!this.longTapInterrupted){r.dispatchEvent(new TouchEvent("touchcancel",{touches:[l],bubbles:!0})),gIsInLongTap=!0;const c=g=>{g.preventDefault()},h=g=>{gIsInLongTap=!1,g.preventDefault(),r.removeEventListener("touchmove",c),r.removeEventListener("touchend",h),r.removeEventListener("touchcancel",h)};r.addEventListener("touchmove",c,{passive:!1}),r.addEventListener("touchend",h,{passive:!1}),r.addEventListener("touchcancel",h,{passive:!1});const{clientX:d,clientY:u}=l,p=new PointerEvent("contextmenu",{bubbles:!0,cancelable:!0,view:getWindow(),clientX:d,clientY:u,pointerType:"touch"});r.dispatchEvent(p)}},this.touchmove=r=>{const{glob:l,self:c,initialTouch:h}=this,d=this.findInitialFinger(r.targetTouches);d!=null&&(this.longTapInterrupted=this.longTapInterrupted||deltaClientSquared(h,d)>LONG_TAP_INTERRUPT_MIN_TOUCHMOVE_PXPX,c.dragTouchEnabled&&d!=null&&l.globalTouchDragCallbacks?.touchmove(r,d))},this.touchend=r=>{this.longTapInterrupted=!0;const l=this.findInitialFinger(r.changedTouches,r.touches);l!=null&&this.glob.globalTouchDragCallbacks?.touchend(r,l),this.destroy()},this.longtapTimer=setTimeout(this.longtap,LONG_TAP_DURATION_MS);const{touchmove:o,touchend:a}=this;n.addEventListener("touchmove",o,{passive:!1}),n.addEventListener("touchstart",a,{passive:!1}),n.addEventListener("touchend",a,{passive:!1}),n.addEventListener("touchcancel",a,{passive:!1}),e.touchDragger=this,t.globalTouchDragCallbacks=i}destroy(){const{longtapTimer:t,touchmove:e,touchend:i}=this;clearTimeout(t),this.target.removeEventListener("touchstart",i),this.target.removeEventListener("touchmove",e),this.target.removeEventListener("touchend",i),this.target.removeEventListener("touchcancel",i),this.glob.globalTouchDragCallbacks=void 0,this.self.touchDragger=void 0}findInitialFinger(...t){const e=t.map(i=>Array.from(i)).flat();return Array.from(e).find(i=>i.identifier===this.initialTouch.identifier)}};function startOneFingerTouch(t,e,i,s,n){if(!(t.globalTouchDragCallbacks!=null||gIsInLongTap))return new TouchDragger(t,e,i,s,n)}function makeMouseDrag(t,e,i,s){const{currentX:n,currentY:o}=WidgetEventUtil.calcCurrentXY(t.getElement(),s),a=s.pageX-i.pageX,r=s.pageY-i.pageY;return{type:e,device:"mouse",offsetX:i.offsetX+a,offsetY:i.offsetY+r,clientX:s.clientX,clientY:s.clientY,currentX:n,currentY:o,originDeltaX:a,originDeltaY:r,sourceEvent:s}}function getTouchOffsets(t,{pageX:e,pageY:i}){const{x:s,y:n}=t.getElement().getBoundingClientRect();return{offsetX:e-s,offsetY:i-n}}function makeTouchDrag(t,e,i,s,n){const{currentX:o,currentY:a}=WidgetEventUtil.calcCurrentXY(t.getElement(),n),r=n.pageX-i.pageX,l=n.pageY-i.pageY;return{type:e,device:"touch",offsetX:i.offsetX+r,offsetY:i.offsetY+l,clientX:n.clientX,clientY:n.clientY,currentX:o,currentY:a,originDeltaX:r,originDeltaY:l,sourceEvent:s}}var GlobalCallbacks={},WidgetListenerInternal=class{constructor(t){this.dispatchCallback=t,this.dragTouchEnabled=!0}destroy(){this.dragTriggerRemover?.(),this.dragTriggerRemover=void 0,this.dragStartListeners=void 0,this.dragMoveListeners=void 0,this.dragEndListeners=void 0,this.mouseDragger?.destroy(),this.touchDragger?.destroy()}add(t,e,i){switch(t){case"drag-start":{this.dragStartListeners??(this.dragStartListeners=[]),this.dragStartListeners.push(i),this.registerDragTrigger(e);break}case"drag-move":{this.dragMoveListeners??(this.dragMoveListeners=[]),this.dragMoveListeners.push(i),this.registerDragTrigger(e);break}case"drag-end":{this.dragEndListeners??(this.dragEndListeners=[]),this.dragEndListeners.push(i),this.registerDragTrigger(e);break}}}remove(t,e,i){switch(t){case"drag-start":return this.removeHandler(this.dragStartListeners,i);case"drag-move":return this.removeHandler(this.dragMoveListeners,i);case"drag-end":return this.removeHandler(this.dragEndListeners,i)}}removeHandler(t,e){const i=t?.indexOf(e);i!==void 0&&t?.splice(i,1)}registerDragTrigger(t){if(this.dragTriggerRemover==null){const e=s=>this.triggerMouseDrag(t,s),i=s=>this.triggerTouchDrag(t,s);t.getElement().addEventListener("mousedown",e),t.getElement().addEventListener("touchstart",i,{passive:!1}),this.dragTriggerRemover=()=>{t.getElement().removeEventListener("mousedown",e),t.getElement().removeEventListener("touchstart",i)}}}triggerMouseDrag(t,e){e.button===0&&this.startMouseDrag(t,e)}startMouseDrag(t,e){const i={pageX:NaN,pageY:NaN,offsetX:NaN,offsetY:NaN};partialAssign(["pageX","pageY","offsetX","offsetY"],i,e);const s={mousedown:n=>{const o=makeMouseDrag(t,"drag-start",i,n);this.dispatch("drag-start",t,o)},mousemove:n=>{const o=makeMouseDrag(t,"drag-move",i,n);this.dispatch("drag-move",t,o)},mouseup:n=>{const o=makeMouseDrag(t,"drag-end",i,n);this.dispatch("drag-end",t,o),this.endDrag(t,o)}};this.mouseDragger=startMouseDrag(GlobalCallbacks,this,s,e)}endDrag(t,{sourceEvent:e,clientX:i,clientY:s}){const n=t.getElement(),o=n.getBoundingClientRect();BBoxValues.containsPoint(o,i,s)||(n.dispatchEvent(new MouseEvent("mouseleave",e)),e.target?.dispatchEvent(new MouseEvent("mouseenter",e)))}triggerTouchDrag(t,e){const i=e.targetTouches[0];e.targetTouches.length===1&&i!=null&&this.startOneFingerTouch(t,e,i)}startOneFingerTouch(t,e,i){const s={pageX:NaN,pageY:NaN,...getTouchOffsets(t,i)};partialAssign(["pageX","pageY"],s,i);const n={touchmove:(r,l)=>{const c=makeTouchDrag(t,"drag-move",s,r,l);this.dispatch("drag-move",t,c)},touchend:(r,l)=>{const c=makeTouchDrag(t,"drag-end",s,r,l);this.dispatch("drag-end",t,c)}},o=t.getElement();this.touchDragger=startOneFingerTouch(GlobalCallbacks,this,n,i,o);const a=makeTouchDrag(t,"drag-start",s,e,i);this.dispatch("drag-start",t,a)}dispatch(t,e,i){switch(t){case"drag-start":this.dragStartListeners?.forEach(s=>s(i,e));break;case"drag-move":this.dragMoveListeners?.forEach(s=>s(i,e));break;case"drag-end":this.dragEndListeners?.forEach(s=>s(i,e));break}this.dispatchCallback(t,i)}},WidgetBounds=class{constructor(t){this.elem=t}setBounds(t){setElementBBox(this.elemContainer??this.elem,t)}getBounds(){return getElementBBox(this.elemContainer??this.elem)}static setElementContainer(t,e){const i=t.getBounds();setElementBBox(e,i),setElementStyles(t.elem,{width:"100%",height:"100%"}),t.elem.remove(),t.elemContainer=e,t.elemContainer.replaceChildren(t.elem)}},Widget=class extends WidgetBounds{constructor(t){super(t),this.elem=t,this.index=NaN,this.children=[]}getElement(){return this.elem}getBoundingClientRect(){return this.elem.getBoundingClientRect()}get clientWidth(){return this.elem.clientWidth}get clientHeight(){return this.elem.clientHeight}destroy(){this.parent?.removeChild(this),this.children.forEach(t=>{t.parent=void 0,t.destroy()}),this.children.length=0,this.destructor(),this.elem.remove(),this.elemContainer?.remove(),this.internalListener?.destroy(),this.htmlListener?.destroy(this)}setHidden(t){setElementStyle(this.elem,"display",t?"none":void 0)}isHidden(){return getWindow()?.getComputedStyle?.(this.elem).display==="none"}setCursor(t){setElementStyle(this.elem,"cursor",t)}setTextContent(t){this.elem.textContent=t??null}setAriaDescribedBy(t){setAttribute(this.elem,"aria-describedby",t)}setAriaHidden(t){setAttribute(this.elem,"aria-hidden",t)}setAriaLabel(t){setAttribute(this.elem,"aria-label",t)}setInnerHTML(t){this.elem.innerHTML=t}isDisabled(){return getAttribute(this.elem,"aria-disabled",!1)}parseFloat(t){return t===""?0:parseFloat(t)}cssLeft(){return this.parseFloat(this.elem.style.left)}cssTop(){return this.parseFloat(this.elem.style.top)}cssWidth(){return this.parseFloat(this.elem.style.width)}cssHeight(){return this.parseFloat(this.elem.style.height)}focus(){this.elem.focus()}setPreventsDefault(t){setAttribute(this.elem,"data-preventdefault",t)}setTabIndex(t){setAttribute(this.elem,"tabindex",t)}addChild(t){this.addChildToDOM(t,this.getBefore(t)),this.children.push(t),t.index=this.children.length-1,t.parent=this,this.onChildAdded(t)}removeChild(t){const e=this.children.findIndex(i=>i===t);this.children.splice(e,1),this.removeChildFromDOM(t),this.onChildRemoved(t)}moveChild(t,e){t.domIndex!==e&&(t.domIndex=e,this.removeChildFromDOM(t),this.addChildToDOM(t,this.getBefore(t)))}addClass(...t){this.elem.classList.add(...t)}removeClass(...t){this.elem.classList.remove(...t)}toggleClass(t,e){this.elem.classList.toggle(t,e)}appendOrInsert(t,e){e?e.getElement().insertAdjacentElement("beforebegin",t):this.elem.appendChild(t)}addChildToDOM(t,e){this.appendOrInsert(t.getElement(),e)}removeChildFromDOM(t){this.elem.removeChild(t.getElement())}onChildAdded(t){}onChildRemoved(t){}getBefore({domIndex:t}){if(t!==void 0)return this.children.filter(e=>e.domIndex!==void 0&&e.domIndex>t).reduce((e,i)=>!e||i.domIndex<e.domIndex?i:e,void 0)}addListener(t,e){return WidgetEventUtil.isHTMLEvent(t)?(this.htmlListener??(this.htmlListener=new WidgetListenerHTML),this.htmlListener.add(t,this,e)):(this.internalListener??(this.internalListener=new WidgetListenerInternal(this.onDispatch.bind(this))),this.internalListener.add(t,this,e)),()=>this.removeListener(t,e)}removeListener(t,e){WidgetEventUtil.isHTMLEvent(t)?this.htmlListener?.remove(t,this,e):this.htmlListener!=null&&this.internalListener?.remove(t,this,e)}setDragTouchEnabled(t){this.internalListener??(this.internalListener=new WidgetListenerInternal(this.onDispatch.bind(this))),this.internalListener.dragTouchEnabled=t}onDispatch(t,e){if(!e.sourceEvent.bubbles)return;let{parent:i}=this;for(;i!=null;){const{internalListener:s}=i;if(s!=null){const n={...e,...WidgetEventUtil.calcCurrentXY(i.getElement(),e)};s.dispatch(t,i,n)}i=i.parent}}static addWindowEvent(t,e){const i=s=>{s.persisted||e()};return getWindow().addEventListener("pagehide",i),()=>getWindow().removeEventListener("pagehide",i)}};function createCanvasContext(t=0,e=0){return new OffscreenCanvas(t,e).getContext("2d")}var LRUCache=class{constructor(t=5){this.maxCacheSize=t,this.store=new Map}get(t){if(!this.store.has(t))return;const e=this.store.get(t);return this.store.delete(t),this.store.set(t,e),e}has(t){return this.store.has(t)}set(t,e){if(this.store.set(t,e),this.store.size>this.maxCacheSize){const i=this.store.keys();let s=this.store.size-this.maxCacheSize;for(;s>0;){const n=i.next();n.done||this.store.delete(n.value),s--}}return e}clear(){this.store.clear()}},CachedTextMeasurerPool=class{static measureText(t,e){return this.getMeasurer(e).measureText(t)}static measureLines(t,e){return this.getMeasurer(e).measureLines(t)}static getMeasurer(t){const e=typeof t.font=="string"?t.font:TextUtils.toFontString(t.font),i=`${e}-${t.textAlign??"start"}-${t.textBaseline??"alphabetic"}`;return this.instanceMap.get(i)??this.createFontMeasurer(e,t,i)}static createFontMeasurer(t,e,i){const s=createCanvasContext();s.font=t,s.textAlign=e.textAlign??"start",s.textBaseline=e.textBaseline??"alphabetic";const n=new CachedTextMeasurer(s,e);return this.instanceMap.set(i,n),n}};CachedTextMeasurerPool.instanceMap=new LRUCache(10);var CachedTextMeasurer=class{constructor(t,e){this.ctx=t,this.measureMap=new LRUCache(100),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline),t.font=typeof e.font=="string"?e.font:TextUtils.toFontString(e.font),this.textMeasurer=new SimpleTextMeasurer(i=>this.cachedCtxMeasureText(i),e.textBaseline??"alphabetic")}textWidth(t,e){return this.textMeasurer.textWidth(t,e)}measureText(t){return this.textMeasurer.measureText(t)}measureLines(t){return this.textMeasurer.measureLines(t)}cachedCtxMeasureText(t){if(!this.measureMap.has(t)){const e=this.ctx.measureText(t);this.measureMap.set(t,{actualBoundingBoxAscent:e.actualBoundingBoxAscent,emHeightAscent:e.emHeightAscent,emHeightDescent:e.emHeightDescent,actualBoundingBoxDescent:e.actualBoundingBoxDescent,actualBoundingBoxLeft:e.actualBoundingBoxLeft,actualBoundingBoxRight:e.actualBoundingBoxRight,alphabeticBaseline:e.alphabeticBaseline,fontBoundingBoxAscent:e.fontBoundingBoxAscent,fontBoundingBoxDescent:e.fontBoundingBoxDescent,hangingBaseline:e.hangingBaseline,ideographicBaseline:e.ideographicBaseline,width:e.width})}return this.measureMap.get(t)}},TextUtils=class{static toFontString({fontSize:t=10,fontStyle:e,fontWeight:i,fontFamily:s,lineHeight:n}){let o="";return e&&(o+=`${e} `),i&&(o+=`${i} `),o+=`${t}px`,n&&(o+=`/${n}px`),o+=` ${s}`,o.trim()}static getLineHeight(t){return Math.ceil(t*this.defaultLineHeight)}static getVerticalModifier(t){switch(t){case"hanging":case"top":return 0;case"middle":return .5;case"alphabetic":case"bottom":case"ideographic":default:return 1}}};TextUtils.EllipsisChar="\u2026",TextUtils.defaultLineHeight=1.15,TextUtils.lineSplitter=/\r?\n/g;var SimpleTextMeasurer=class{constructor(t,e="alphabetic"){this.measureTextFn=t,this.textBaseline=e,this.charMap=new Map}getMetrics(t){const e=this.measureTextFn(t);return e.fontBoundingBoxAscent??(e.fontBoundingBoxAscent=e.emHeightAscent),e.fontBoundingBoxDescent??(e.fontBoundingBoxDescent=e.emHeightDescent),{width:e.width,height:e.actualBoundingBoxAscent+e.actualBoundingBoxDescent,lineHeight:e.fontBoundingBoxAscent+e.fontBoundingBoxDescent,offsetTop:e.actualBoundingBoxAscent,offsetLeft:e.actualBoundingBoxLeft}}getMultilineMetrics(t){let e=0,i=0,s=0,n=0,o=0;const a=TextUtils.getVerticalModifier(this.textBaseline),r=[];let l=0;const c=t.length;for(const h of t){const d=this.measureTextFn(h);d.fontBoundingBoxAscent??(d.fontBoundingBoxAscent=d.emHeightAscent),d.fontBoundingBoxDescent??(d.fontBoundingBoxDescent=d.emHeightDescent),e<d.width&&(e=d.width),n<d.actualBoundingBoxLeft&&(n=d.actualBoundingBoxLeft),l===0?(i+=d.actualBoundingBoxAscent,s+=d.actualBoundingBoxAscent):o+=d.fontBoundingBoxAscent,l===c-1?i+=d.actualBoundingBoxDescent:o+=d.fontBoundingBoxDescent,r.push({text:h,width:d.width,height:d.actualBoundingBoxAscent+d.actualBoundingBoxDescent,lineHeight:d.fontBoundingBoxAscent+d.fontBoundingBoxDescent,offsetTop:d.actualBoundingBoxAscent,offsetLeft:d.actualBoundingBoxLeft}),l++}return i+=o,s+=o*a,{width:e,height:i,offsetTop:s,offsetLeft:n,lineMetrics:r}}textWidth(t,e){if(e){let i=0;for(let s=0;s<t.length;s++)i+=this.textWidth(t.charAt(s));return i}return t.length>1?this.measureTextFn(t).width:this.charMap.get(t)??this.charWidth(t)}measureText(t){return this.getMetrics(t)}measureLines(t){const e=typeof t=="string"?t.split(TextUtils.lineSplitter):t;return this.getMultilineMetrics(e)}charWidth(t){const{width:e}=this.measureTextFn(t);return this.charMap.set(t,e),e}},_Text=class Pt extends Shape{constructor(){super(...arguments),this.x=0,this.y=0,this.lines=[],this.text=void 0,this.fontSize=10,this.fontFamily="sans-serif",this.textAlign=Pt.defaultStyles.textAlign,this.textBaseline=Pt.defaultStyles.textBaseline}onTextChange(){this.lines=this.text?.split(`
`).map(e=>e.trim())??[]}static computeBBox(e,i,s,n){const{offsetTop:o,offsetLeft:a,width:r,height:l}=CachedTextMeasurerPool.measureLines(e,n);return new BBox(i-a,s-o,r,l)}computeBBox(){const{x:e,y:i,lines:s,textBaseline:n,textAlign:o}=this;return Pt.computeBBox(s,e,i,{font:this,textBaseline:n,textAlign:o})}isPointInPath(e,i){const s=this.getBBox();return s?s.containsPoint(e,i):!1}render(e){const{ctx:i,stats:s}=e;if(!this.lines.length||!this.layerManager)return s&&(s.nodesSkipped+=1),super.render(e);const{fill:n,stroke:o,strokeWidth:a}=this,{pixelRatio:r}=this.layerManager.canvas;if(!n&&!(o!=null&&a>0))return super.render(e);const l=TextUtils.toFontString(this);if(i.font!==l&&(i.font=l),i.textAlign=this.textAlign,i.textBaseline=this.textBaseline,n){this.applyFill(i),i.globalAlpha*=this.opacity*this.fillOpacity;const{fillShadow:c}=this;c?.enabled&&(i.shadowColor=c.color,i.shadowOffsetX=c.xOffset*r,i.shadowOffsetY=c.yOffset*r,i.shadowBlur=c.blur*r),this.renderLines((h,d,u)=>i.fillText(h,d,u))}if(o&&a){this.applyStroke(i),i.lineWidth=a,i.globalAlpha*=this.opacity*this.strokeOpacity;const{lineDash:c,lineDashOffset:h,lineCap:d,lineJoin:u}=this;c&&i.setLineDash(c),h&&(i.lineDashOffset=h),d&&(i.lineCap=d),u&&(i.lineJoin=u),this.renderLines((p,g,f)=>i.strokeText(p,g,f))}super.render(e)}renderLines(e){const{lines:i,x:s,y:n}=this,o=this.lineHeight??TextUtils.getLineHeight(this.fontSize);let a=(o-o*i.length)*TextUtils.getVerticalModifier(this.textBaseline);for(const r of i)e(r,s,n+a),a+=o}setFont(e){this.fontFamily=e.fontFamily,this.fontSize=e.fontSize,this.fontStyle=e.fontStyle,this.fontWeight=e.fontWeight}setAlign(e){this.textAlign=e.textAlign,this.textBaseline=e.textBaseline}toSVG(){if(!this.visible||!this.text)return;const e=createSvgElement("text");return this.applySvgFillAttributes(e),e.setAttribute("font-family",this.fontFamily?.split(",")[0]??""),e.setAttribute("font-size",String(this.fontSize)),e.setAttribute("font-style",this.fontStyle??""),e.setAttribute("font-weight",String(this.fontWeight??"")),e.setAttribute("text-anchor",{center:"middle",left:"start",right:"end",start:"start",end:"end"}[this.textAlign??"start"]),e.setAttribute("alignment-baseline",{alphabetic:"alphabetic",top:"top",bottom:"bottom",hanging:"hanging",middle:"middle",ideographic:"ideographic"}[this.textBaseline??"alphabetic"]),e.setAttribute("x",String(this.x)),e.setAttribute("y",String(this.y)),e.textContent=this.text??"",{elements:[e]}}};_Text.className="Text",_Text.defaultStyles={...Shape.defaultStyles,textAlign:"start",fontStyle:void 0,fontWeight:void 0,fontSize:10,fontFamily:"sans-serif",textBaseline:"alphabetic"},__decorateClass2([SceneChangeDetection()],_Text.prototype,"x",2),__decorateClass2([SceneChangeDetection()],_Text.prototype,"y",2),__decorateClass2([SceneChangeDetection({changeCb:t=>t.onTextChange()})],_Text.prototype,"text",2),__decorateClass2([SceneChangeDetection()],_Text.prototype,"fontStyle",2),__decorateClass2([SceneChangeDetection()],_Text.prototype,"fontWeight",2),__decorateClass2([SceneChangeDetection()],_Text.prototype,"fontSize",2),__decorateClass2([SceneChangeDetection()],_Text.prototype,"fontFamily",2),__decorateClass2([SceneChangeDetection()],_Text.prototype,"textAlign",2),__decorateClass2([SceneChangeDetection()],_Text.prototype,"textBaseline",2),__decorateClass2([SceneChangeDetection()],_Text.prototype,"lineHeight",2);var Text=_Text,RotatableText=class extends Rotatable(Text){},TransformableText=class extends Rotatable(Translatable(Text)){},TextWrapper=class{static wrapText(t,e){return this.wrapLines(t,e).join(`
`)}static wrapLines(t,e){const i=this.textWrap(t,e);return e.overflow==="hide"&&i.some(s=>s.endsWith(TextUtils.EllipsisChar))?[]:i}static appendEllipsis(t){return t.replace(/[.,]{1,5}$/,"")+TextUtils.EllipsisChar}static truncateLine(t,e,i,s){const n=e.textWidth(TextUtils.EllipsisChar);let o=0,a=0;for(;a<t.length;a++){const r=e.textWidth(t.charAt(a));if(o+r>i)break;o+=r}if(t.length===a&&(!s||o+n<=i))return s?t+TextUtils.EllipsisChar:t;for(t=t.slice(0,a).trimEnd();t.length&&e.textWidth(t)+n>i;)t=t.slice(0,-1).trimEnd();return t+TextUtils.EllipsisChar}static textWrap(t,e){const i=t.split(TextUtils.lineSplitter),s=CachedTextMeasurerPool.getMeasurer(e);if(e.textWrap==="never")return i.map(r=>this.truncateLine(r.trimEnd(),s,e.maxWidth));const n=[],o=e.textWrap==="hyphenate",a=e.textWrap==null||e.textWrap==="on-space";for(const r of i){let l=r.trimEnd();if(l===""){n.push(l);continue}let c=0,h=0,d=0;for(;c<l.length;){const u=l.charAt(c);if(h+=s.textWidth(u),u===" "&&(d=c),h>e.maxWidth){if(c===0)break;const p=s.textWidth(l.slice(0,c+1));if(p<=e.maxWidth){h=p,c++;continue}if(d){const m=this.getWordAt(l,d+1),y=s.textWidth(m);if(y<=e.maxWidth){n.push(l.slice(0,d).trimEnd()),l=l.slice(d).trimStart(),c=0,h=0,d=0;continue}else a&&y>e.maxWidth&&n.push(l.slice(0,d).trimEnd(),this.truncateLine(l.slice(d).trimStart(),s,e.maxWidth,!0))}else a&&n.push(this.truncateLine(l,s,e.maxWidth,!0));if(a){l="";break}const g=o?"-":"";let f=l.slice(0,c).trim();for(;f.length&&s.textWidth(f+g)>e.maxWidth;)f=f.slice(0,-1).trimEnd();if(n.push(f+g),!f.length){l="";break}l=l.slice(f.length).trimStart(),c=-1,h=0,d=0}c++}l&&n.push(l)}return this.avoidOrphans(n,s,e),this.clipLines(n,s,e)}static getWordAt(t,e){const i=t.indexOf(" ",e);return i===-1?t.slice(e):t.slice(e,i)}static clipLines(t,e,i){if(!i.maxHeight)return t;const{height:s,lineMetrics:n}=e.measureLines(t);if(s<=i.maxHeight)return t;for(let o=0,a=0;o<n.length;o++){const{lineHeight:r}=n[o];if(a+=r,a>i.maxHeight){if(i.overflow==="hide")return[];const l=t.slice(0,o||1),c=l.pop();return l.concat(this.truncateLine(c,e,i.maxWidth,!0))}}return t}static avoidOrphans(t,e,i){if(i.avoidOrphans===!1||t.length<2)return;const{length:s}=t,n=t[s-1],o=t[s-2];if(o.length<n.length)return;const a=o.lastIndexOf(" ");if(a===-1||a===o.indexOf(" ")||n.includes(" "))return;const r=o.slice(a+1);e.textWidth(n+r)<=i.maxWidth&&(t[s-2]=o.slice(0,a),t[s-1]=r+" "+n)}},Caption=class extends BaseProperties{constructor(){super(...arguments),this.id=createId(this),this.node=new RotatableText({zIndex:1}).setProperties({textAlign:"center",pointerEvents:1}),this.enabled=!1,this.textAlign="center",this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always",this.padding=0,this.layoutStyle="block",this.truncated=!1}registerInteraction(t,e){return t.layoutManager.addListener("layout:complete",()=>this.updateA11yText(t,e))}computeTextWrap(t,e){const{text:i,padding:s,wrapping:n}=this,o=Math.min(this.maxWidth??1/0,t)-s*2,a=this.maxHeight??e-s*2;if(!isFinite(o)&&!isFinite(a)){this.node.text=i;return}const r=TextWrapper.wrapText(i??"",{maxWidth:o,maxHeight:a,font:this,textWrap:n});this.node.text=r,this.truncated=r.includes(TextUtils.EllipsisChar)}updateA11yText(t,e){const{proxyInteractionService:i}=t;if(this.enabled&&this.text){const s=Transformable.toCanvas(this.node);if(s){const{id:n}=this;this.proxyText??(this.proxyText=i.createProxyElement({type:"text",domManagerId:n,where:e})),this.proxyText.textContent=this.text,this.proxyText.setBounds(s),this.proxyText.addListener("mousemove",o=>this.handleMouseMove(t,o)),this.proxyText.addListener("mouseleave",o=>this.handleMouseLeave(t,o))}}else this.proxyText?.destroy(),this.proxyText=void 0}handleMouseMove(t,e){if(e!=null&&this.enabled&&this.node.visible&&this.truncated){const{x:i,y:s}=Transformable.toCanvas(this.node),n=e.sourceEvent.offsetX+i,o=e.sourceEvent.offsetY+s;t.tooltipManager.updateTooltip(this.id,{canvasX:n,canvasY:o,showArrow:!1},[{type:"structured",title:this.text}])}}handleMouseLeave(t,e){t.tooltipManager.removeTooltip(this.id)}};Caption.SMALL_PADDING=10,__decorateClass2([TempValidate(BOOLEAN),ProxyPropertyOnWrite("node","visible")],Caption.prototype,"enabled",2),__decorateClass2([TempValidate(STRING,{optional:!0}),ProxyPropertyOnWrite("node")],Caption.prototype,"text",2),__decorateClass2([TempValidate(TEXT_ALIGN,{optional:!0}),ProxyPropertyOnWrite("node")],Caption.prototype,"textAlign",2),__decorateClass2([TempValidate(FONT_STYLE,{optional:!0}),ProxyPropertyOnWrite("node")],Caption.prototype,"fontStyle",2),__decorateClass2([TempValidate(FONT_WEIGHT,{optional:!0}),ProxyPropertyOnWrite("node")],Caption.prototype,"fontWeight",2),__decorateClass2([TempValidate(POSITIVE_NUMBER),ProxyPropertyOnWrite("node")],Caption.prototype,"fontSize",2),__decorateClass2([TempValidate(STRING),ProxyPropertyOnWrite("node")],Caption.prototype,"fontFamily",2),__decorateClass2([TempValidate(COLOR_STRING,{optional:!0}),ProxyPropertyOnWrite("node","fill")],Caption.prototype,"color",2),__decorateClass2([TempValidate(POSITIVE_NUMBER,{optional:!0})],Caption.prototype,"spacing",2),__decorateClass2([TempValidate(POSITIVE_NUMBER,{optional:!0})],Caption.prototype,"maxWidth",2),__decorateClass2([TempValidate(POSITIVE_NUMBER,{optional:!0})],Caption.prototype,"maxHeight",2),__decorateClass2([TempValidate(TEXT_WRAP)],Caption.prototype,"wrapping",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],Caption.prototype,"padding",2),__decorateClass2([TempValidate(STRING)],Caption.prototype,"layoutStyle",2);var ChartAxisDirection=(t=>(t.X="x",t.Y="y",t))(ChartAxisDirection||{}),LayoutElement=(t=>(t[t.Caption=0]="Caption",t[t.Legend=1]="Legend",t[t.ToolbarLeft=2]="ToolbarLeft",t[t.ToolbarBottom=3]="ToolbarBottom",t[t.Navigator=4]="Navigator",t[t.Overlay=5]="Overlay",t))(LayoutElement||{}),LayoutManager=class{constructor(){this.events=new EventEmitter,this.elements=new Map}addListener(t,e){return this.events.on(t,e)}registerElement(t,e){return this.elements.has(t)?this.elements.get(t).add(e):this.elements.set(t,new Set([e])),()=>this.elements.get(t)?.delete(e)}createContext(t,e){const i=new LayoutContext(t,e);for(const s of Object.values(LayoutElement))typeof s=="number"&&this.elements.get(s)?.forEach(n=>n(i));return i}emitLayoutComplete(t,e){const i="layout:complete",{width:s,height:n}=t;this.events.emit(i,{type:i,axes:e.axes??[],chart:{width:s,height:n},clipSeries:e.clipSeries??!1,series:e.series})}},LayoutContext=class{constructor(t,e){this.width=t,this.height=e,this.layoutBox=new BBox(0,0,t,e)}},ChartCaptions=class{constructor(){this.title=new Caption,this.subtitle=new Caption,this.footnote=new Caption}positionCaptions(t){const{title:e,subtitle:i,footnote:s}=this,n=t.layoutBox.height/10;if(e.enabled){const{spacing:o}=e;this.positionCaption("top",e,t.layoutBox,n),this.shrinkLayoutByCaption("top",e,t.layoutBox,o)}i.enabled&&(this.positionCaption("top",i,t.layoutBox,n),this.shrinkLayoutByCaption("top",i,t.layoutBox,i.spacing)),s.enabled&&(this.positionCaption("bottom",s,t.layoutBox,n),this.shrinkLayoutByCaption("bottom",s,t.layoutBox,s.spacing))}positionAbsoluteCaptions(t){const{title:e,subtitle:i,footnote:s}=this,{rect:n}=t.series;for(const o of[e,i,s])if(o.layoutStyle==="overlay"){if(o.textAlign==="left")o.node.x=n.x+o.padding;else if(o.textAlign==="right"){const a=o.node.getBBox();o.node.x=n.x+n.width-a.width-o.padding}}}computeX(t,e){return t==="left"?e.x:t==="right"?e.x+e.width:e.x+e.width/2}positionCaption(t,e,i,s){const n=Math.max(TextUtils.getLineHeight(e.fontSize),s);e.node.x=this.computeX(e.textAlign,i)+e.padding,e.node.y=i.y+(t==="top"?0:i.height)+e.padding,e.node.textBaseline=t,e.computeTextWrap(i.width,n)}shrinkLayoutByCaption(t,e,i,s=0){if(e.layoutStyle==="block"){const n=e.node.getBBox();i.shrink(Math.ceil(t==="top"?n.y-i.y+n.height+s:i.y+i.height-n.y+s),t)}}};__decorateClass2([TempValidate(OBJECT)],ChartCaptions.prototype,"title",2),__decorateClass2([TempValidate(OBJECT)],ChartCaptions.prototype,"subtitle",2),__decorateClass2([TempValidate(OBJECT)],ChartCaptions.prototype,"footnote",2);var chartTypes=["candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"],ChartTypeOriginator=class{constructor(t){this.chartService=t,this.mementoOriginatorKey="chartType"}createMemento(){let t=this.chartService.publicApi?.getOptions()?.chartType;return t==null&&(t="candlestick"),t}guardMemento(t){return t==null||chartTypes.includes(t)}restoreMemento(t,e,i){if(i==null)return;const s={chartType:i};this.chartService.publicApi?.updateDelta(s).catch(n=>logger_exports.error("error restoring state",n))}},DestroyFns=class{constructor(){this.destroyFns=[]}destroy(){this.destroyFns.forEach(t=>t()),this.destroyFns.length=0}setFns(t){this.destroy(),this.destroyFns=t}push(...t){this.destroyFns.push(...t)}},VERSION="11.2.3",NOT_FOUND=Symbol("previous-memento-not-found"),HistoryManager=class{constructor(t){this.history=[],this.historyIndex=-1,this.originators=new Map,this.clearState=new Map,this.maxHistoryLength=100,this.debug=Debug.create(!0,"history"),this.destroyFns=new DestroyFns,this.destroyFns.setFns([t.addListener("series-undo",this.undo.bind(this)),t.addListener("series-redo",this.redo.bind(this))])}destroy(){this.destroyFns.destroy()}addMementoOriginator(t){this.originators.set(t.mementoOriginatorKey,t),this.clearState.set(t.mementoOriginatorKey,t.createMemento()),this.debugEvent("History add originator:",t.mementoOriginatorKey)}clear(){this.debug("History clear:",Object.keys(this.originators)),this.history=[],this.historyIndex=-1;for(const[t,e]of this.originators.entries())this.clearState.set(t,e.createMemento())}record(t,...e){this.historyIndex<this.history.length-1&&(this.history=this.history.slice(0,this.historyIndex+1)),this.history.length>this.maxHistoryLength&&(this.history=this.history.slice(-this.maxHistoryLength));const i=new Map;for(const s of e){if(!this.originators.has(s.mementoOriginatorKey))throw new Error(`Originator [${s.mementoOriginatorKey}] has not been added to the HistoryManager.`);i.set(s.mementoOriginatorKey,s.createMemento())}this.history.push({label:t,mementos:i}),this.historyIndex=this.history.length-1,this.debugEvent(`History record: [${t}]`)}undo(){const t=this.history[this.historyIndex];if(t){for(const e of t.mementos.keys()){const i=this.findPreviousMemento(e);if(i===NOT_FOUND)throw new Error(`Could not find previous memento for [${e}].`);this.restoreMemento(e,i)}this.historyIndex-=1,this.debugEvent(`History undo: [${t.label}]`)}}redo(){const t=this.history[this.historyIndex+1];if(t){for(const[e,i]of t.mementos.entries())this.restoreMemento(e,i);this.historyIndex+=1,this.debugEvent(`History redo: [${t.label}]`)}}findPreviousMemento(t){for(let e=this.historyIndex-1;e>=0;e--)if(this.history[e].mementos.has(t))return this.history[e].mementos.get(t);return this.clearState.has(t)?this.clearState.get(t):NOT_FOUND}restoreMemento(t,e){this.originators.get(t)?.restoreMemento(VERSION,VERSION,e)}debugEvent(...t){this.debug(...t,this.history.map((e,i)=>i===this.historyIndex?`** ${e.label} **`:e.label))}},MementoCaretaker=class _t{constructor(e){this.version=e.split("-")[0]}save(...e){const i={version:this.version};for(const s of Object.values(e))i[s.mementoOriginatorKey]=this.encode(s,s.createMemento());return i}restore(e,...i){if(typeof e!="object"){logger_exports.warnOnce(`Could not restore data of type [${typeof e}], expecting an object, ignoring.`);return}if(e==null){logger_exports.warnOnce("Could not restore data of type [null], expecting an object, ignoring.");return}if(!("version"in e)||typeof e.version!="string"){logger_exports.warnOnce("Could not restore data, missing [version] string in object, ignoring.");return}for(const s of i){const n=this.decode(s,e[s.mementoOriginatorKey]),o=[];if(!s.guardMemento(n,o)){const a=o.length>0?`
${o.join(`
`)}
`:"";logger_exports.warnOnce(`Could not restore [${s.mementoOriginatorKey}] data, value was invalid, ignoring.${a}`,n);return}s.restoreMemento(this.version,e.version,n)}}encode(e,i){try{return JSON.parse(JSON.stringify(i,_t.encodeTypes))}catch(s){throw new Error(`Failed to encode [${e.mementoOriginatorKey}] value [${s}].`,{cause:s})}}decode(e,i){if(i==null)return i;try{return JSON.parse(JSON.stringify(i),_t.decodeTypes)}catch(s){throw new Error(`Failed to decode [${e.mementoOriginatorKey}] value [${s}].`,{cause:s})}}static encodeTypes(e,i){return isDate(this[e])?{__type:"date",value:this[e].toISOString()}:i}static decodeTypes(e,i){return isObject(this[e])&&"__type"in this[e]&&this[e].__type==="date"?new Date(this[e].value):i}},StateManager=class{constructor(){this.caretaker=new MementoCaretaker(VERSION),this.state=new Map}setState(t,e){objectsEqual(this.state.get(t.mementoOriginatorKey),e)||this.setStateAndRestore(t,e)}setStateAndRestore(t,e){this.state.set(t.mementoOriginatorKey,e),this.restoreState(t)}restoreState(t){const{caretaker:e,state:i}=this;if(!i.has(t.mementoOriginatorKey))return;const s=i.get(t.mementoOriginatorKey);e.restore({version:e.version,[t.mementoOriginatorKey]:s},t)}},styles_default=`.ag-charts-wrapper,.ag-charts-wrapper:after,.ag-charts-wrapper:before,.ag-charts-wrapper *,.ag-charts-wrapper *:after,.ag-charts-wrapper *:before{box-sizing:border-box}.ag-charts-wrapper{--align-items: center;--justify-content: center;position:relative;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ag-charts-wrapper--safe-horizontal{--justify-content: flex-start}.ag-charts-wrapper--safe-vertical{--align-items: flex-start}.ag-charts-tab-guard{width:0%;height:0%;position:absolute;pointer-events:none}.ag-charts-canvas-center{width:100%;height:100%;position:absolute;touch-action:auto;pointer-events:auto;display:flex;align-items:var(--align-items);justify-content:var(--justify-content)}.ag-charts-canvas-container,.ag-charts-canvas{position:relative;user-select:none;-webkit-user-select:none}.ag-charts-canvas-container>*,.ag-charts-canvas>*{pointer-events:none}.ag-charts-canvas canvas{display:block}.ag-charts-series-area{outline:none;pointer-events:auto;position:absolute}.ag-charts-swapchain{top:0;left:0;outline:none;opacity:0;pointer-events:none;position:absolute;width:100%;height:100%}.ag-charts-swapchain:focus-visible{opacity:1}.ag-charts-canvas-proxy,.ag-charts-canvas-overlay{inset:0;pointer-events:none;position:absolute;user-select:none;-webkit-user-select:none}.ag-charts-canvas-overlay>*{position:absolute;pointer-events:auto}.ag-charts-theme-default,.ag-charts-theme-default-dark{--ag-charts-accent-color: #2196f3;--ag-charts-background-color: #fff;--ag-charts-border-color: #dddddd;--ag-charts-foreground-color: #464646;--ag-charts-font-family: Verdana, sans-serif;--ag-charts-font-size: 12px;--ag-charts-font-weight: 400;--ag-charts-padding: 20px;--ag-charts-shadow-color: #00000080;--ag-charts-subtle-text-color: #8c8c8c;--ag-charts-text-color: #464646;--ag-charts-chrome-background-color: #fafafa;--ag-charts-chrome-font-family: Verdana, sans-serif;--ag-charts-chrome-font-size: 12px;--ag-charts-chrome-font-weight: 400;--ag-charts-chrome-subtle-text-color: #8c8c8c;--ag-charts-chrome-text-color: #181d1f;--ag-charts-input-background-color: #fff;--ag-charts-input-text-color: #464646;--ag-charts-crosshair-label-background-color: #fff;--ag-charts-crosshair-label-text-color: #464646;--ag-charts-spacing: 4px;--ag-charts-border-radius: 4px;--ag-charts-shadow: 0 2px 8px 0 color-mix(in srgb, black 8%, transparent);--ag-charts-focus-shadow: 0 0 0 3px var(--ag-charts-accent-color);--ag-charts-focus-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-accent-color) 12%);--ag-charts-input-border-color: var(--ag-charts-border-color);--ag-charts-input-border-radius: var(--ag-charts-border-radius);--ag-charts-input-focus-border-color: var(--ag-charts-accent-color);--ag-charts-input-focus-text-color: var(--ag-charts-accent-color);--ag-charts-input-disabled-background-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-foreground-color) 6% );--ag-charts-input-disabled-border-color: var(--ag-charts-border-color);--ag-charts-input-disabled-text-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-input-text-color) 50% );--ag-charts-input-placeholder-text-color: color-mix( in srgb, var(--ag-charts-input-background-color), var(--ag-charts-input-text-color) 60% );--ag-charts-button-background-color: var(--ag-charts-background-color);--ag-charts-button-border-color: var(--ag-charts-border-color);--ag-charts-button-border-radius: var(--ag-charts-border-radius);--ag-charts-button-text-color: var(--ag-charts-text-color);--ag-charts-button-focus-background-color: color-mix( in srgb, var(--ag-charts-button-background-color), var(--ag-charts-accent-color) 12% );--ag-charts-button-focus-border-color: var(--ag-charts-accent-color);--ag-charts-button-focus-text-color: var(--ag-charts-accent-color);--ag-charts-button-disabled-background-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-foreground-color) 6% );--ag-charts-button-disabled-border-color: var(--ag-charts-border-color);--ag-charts-button-disabled-text-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-chrome-text-color) 50% );--ag-charts-checkbox-background-color: color-mix( in srgb, var(--ag-charts-background-color), var(--ag-charts-foreground-color) 35% );--ag-charts-checkbox-checked-background-color: var(--ag-charts-accent-color);--ag-charts-chrome-font-size-small: var(--ag-charts-chrome-font-size);--ag-charts-chrome-font-size-medium: calc(var(--ag-charts-chrome-font-size) * (13 / 12));--ag-charts-chrome-font-size-large: calc(var(--ag-charts-chrome-font-size) * (14 / 12));--ag-charts-border: solid 1px var(--ag-charts-border-color);--ag-charts-focus-border: solid 1px var(--ag-charts-accent-color);--ag-charts-focus-border-shadow: 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-accent-color) 20%);--ag-charts-layer-menu: 6;--ag-charts-layer-ui-overlay: 5;--ag-charts-layer-tooltip: 4;--ag-charts-layer-toolbar: 3;--ag-charts-layer-crosshair: 2;--ag-charts-layer-annotations: 1}.ag-charts-theme-default-dark{--ag-charts-shadow: 0 2px 12px 0 color-mix(in srgb, black 33.3%, transparent);--ag-charts-focus-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-accent-color) 22%)}.ag-chart-canvas-wrapper .ag-charts-theme-default{--ag-charts-border-radius: var(--ag-border-radius, 4px);--ag-charts-border: var(--ag-borders-critical, solid 1px) var(--ag-charts-border-color);--ag-charts-focus-shadow: var(--ag-focus-shadow, 0 0 0 3px var(--ag-charts-accent-color));--ag-charts-focus-border-shadow: var( --ag-focus-shadow, 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-accent-color) 20%) )}.ag-charts-icon{display:block;width:20px;height:20px;speak:none;speak:never;mask:var(--icon) center / contain no-repeat;background-color:currentColor;transition:background-color .25s ease-in-out}.ag-charts-icon-align-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNyAxMGg2djFIN3pNNCA3aDEydjFINHptMSA2aDEwdjFINXoiLz48L3N2Zz4=)}.ag-charts-icon-align-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNCAxMGg2djFINHptMC0zaDEydjFINHptMCA2aDEwdjFINHoiLz48L3N2Zz4=)}.ag-charts-icon-align-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTAgMTBoNnYxaC02ek00IDdoMTJ2MUg0em0yIDZoMTB2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-arrow-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE1LjI5MyA0LjVIMTIuNXYtMUgxN3Y0aC0xVjUuMjA3bC05LjY0NiA5LjY0Ny0uNzA4LS43MDh6IiBmaWxsPSIjMDAwIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03IDE2YTIuNSAyLjUgMCAxIDEtNSAwIDIuNSAyLjUgMCAwIDEgNSAwbS0yLjUgMS41YTEuNSAxLjUgMCAxIDAgMC0zIDEuNSAxLjUgMCAwIDAgMCAzIiBmaWxsPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-arrow-down-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02IDhMMS41IDhMMTAgMThMMTguNSA4TDE0IDhMMTQgM0w2IDNMNiA4Wk03IDRMNyA5SDMuNjYyNDRMMTAgMTYuNDU2TDE2LjMzNzYgOUwxMyA5TDEzIDRMNyA0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-arrow-up-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNCAxMkgxOC41TDEwIDJMMS41IDEySDZMNi4wMDAwMiAxN0gxNFYxMlpNMTMgMTZWMTFIMTYuMzM3NkwxMCAzLjU0NDA1TDMuNjYyNDQgMTFIN0w3LjAwMDAyIDE2SDEzWiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-callout-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtNC41MTRhMjYgMjYgMCAwIDAtMi4wMTcgMS41NGwtLjMxNC4yNmMtLjU1LjQ1Ny0xLjExNS45MjYtMS43NiAxLjQtLjY2OS40OTEtMS41NjItLjAxMi0xLjU2Mi0uOFYxNEg0LjVBMS41IDEuNSAwIDAgMSAzIDEyLjV6TTQuNSA0YS41LjUgMCAwIDAtLjUuNXY4YS41LjUgMCAwIDAgLjUuNWgxLjgzM3YzLjM3MmEzNiAzNiAwIDAgMCAxLjY3OC0xLjMzOGwuMzItLjI2NWEyNiAyNiAwIDAgMSAyLjIyNS0xLjY4NWwuMTI2LS4wODRIMTUuNWEuNS41IDAgMCAwIC41LS41di04YS41LjUgMCAwIDAtLjUtLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyAxdjNoMnYxMkg3djNINnYtM0g0VjRoMlYxek01IDVoM3YxMEg1ek0xMSAxNFY2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6bTEtN2gzdjZoLTN6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-close{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtNSA1IDEwIDEwTTUgMTUgMTUgNSIgc3Ryb2tlPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-comment-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy41MTMgMy45OTVhNi41IDYuNSAwIDAgMSA2LjA5OCAxMS40MWMtLjU4OC4zOTMtMS4yMTcuNTM2LTEuODI5LjU4NWExMyAxMyAwIDAgMS0xLjI3LjAxN0EyNyAyNyAwIDAgMCAxMCAxNkg0LjVhLjUuNSAwIDAgMS0uNS0uNVYxMHEwLS4yNDctLjAwNy0uNTEzYy0uMDA4LS40MTYtLjAxNi0uODU3LjAxNy0xLjI2OS4wNS0uNjEyLjE5Mi0xLjI0LjU4NS0xLjgzYTYuNSA2LjUgMCAwIDEgMi45MTgtMi4zOTNtMy41Ni42MWE1LjUgNS41IDAgMCAwLTUuNjQ2IDIuMzRjLS4yNjYuMzk3LS4zNzkuODQyLS40MiAxLjM1NC0uMDMuMzYtLjAyMi43MTgtLjAxNSAxLjEwOFE1IDkuNjg5IDUgMTB2NWg1cS4zMTEuMDAxLjU5My4wMDhjLjM5LjAwNy43NDcuMDE1IDEuMTA4LS4wMTUuNTEyLS4wNDEuOTU3LS4xNTQgMS4zNTUtLjQyYTUuNSA1LjUgMCAwIDAtMS45ODMtOS45NjciIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-crosshair-add-line{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-date-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMiAyaDF2MTZIMnptMTUgMGgxdjE2aC0xeiIgZmlsbD0iIzE4MUQxRiIvPjxwYXRoIGQ9Ik0xMy4xNTcgMTFINXYtMWg3Ljc5M0wxMSA4LjIwN2wuNzA3LS43MDcgMy4xODIgMy4xODItMy4xODIgMy4xODItLjcwNy0uNzA3eiIgZmlsbD0iIzAwMCIvPjwvc3ZnPg==)}.ag-charts-icon-date-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMyAySDJ2MTZoMXptMy41MDcgNC44OUw4LjUgNC44OTVWMTBINXYxaDMuNXY3aDF2LTdoNS4wODhsLTEuOTU3IDEuOTU3LjcwNy43MDcgMy4xODItMy4xODJMMTMuMzM4IDcuM2wtLjcwNy43MDdMMTQuNjI0IDEwSDkuNVY0LjkzMmwxLjk1NyAxLjk1Ny43MDctLjcwN0w4Ljk4MiAzIDUuOCA2LjE4MnoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-delete{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTguNDk2IDguOTk2QS41LjUgMCAwIDEgOSA5LjQ5MnY0YS41LjUgMCAxIDEtMSAuMDA4di00YS41LjUgMCAwIDEgLjQ5Ni0uNTA0TTEyIDkuNWEuNS41IDAgMCAwLTEgMHY0YS41LjUgMCAwIDAgMSAweiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTYgNVYzLjVBMi41IDIuNSAwIDAgMSA4LjUgMWgzQTIuNSAyLjUgMCAwIDEgMTQgMy41VjVoMi44MzNhLjUuNSAwIDAgMSAwIDFIMTV2MTAuMjVjMCAuNDE1LS4wNjYuODYzLS4zIDEuMjIxLS4yNTcuMzk0LS42NzIuNjEyLTEuMi42MTJoLTdjLS41MjggMC0uOTQzLS4yMTgtMS4yLS42MTItLjIzNC0uMzU4LS4zLS44MDYtLjMtMS4yMjFWNkgzLjMzM2EuNS41IDAgMCAxIDAtMXptMS0xLjVBMS41IDEuNSAwIDAgMSA4LjUgMmgzQTEuNSAxLjUgMCAwIDEgMTMgMy41VjVIN3pNNiAxNi4yNVY2aDh2MTAuMjVjMCAuMzM1LS4wNTkuNTU0LS4xMzguNjc1LS4wNTUuMDg1LS4xNC4xNTgtLjM2Mi4xNThoLTdjLS4yMjIgMC0uMzA3LS4wNzMtLjM2Mi0uMTU4LS4wOC0uMTIxLS4xMzgtLjM0LS4xMzgtLjY3NSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-disjoint-channel,.ag-charts-icon-disjoint-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTkuMDI4IDE3LjQ2YTIuMjUgMi4yNSAwIDAgMC00LjA5Mi0xLjg1bC05LjUxMS0yLjM3OGEyLjI1IDIuMjUgMCAxIDAtLjIyNS45NzRsOS40NzUgMi4zNjlhMi4yNTEgMi4yNTEgMCAwIDAgNC4zNTMuODg2bS0xLjY2Mi0xLjk2NWExLjI1IDEuMjUgMCAxIDEtLjg4NSAyLjMzOCAxLjI1IDEuMjUgMCAwIDEgLjg4NS0yLjMzOE00LjM0MyAxMy42NjlhMS4yNSAxLjI1IDAgMSAwLTIuMzM4LS44ODUgMS4yNSAxLjI1IDAgMCAwIDIuMzM4Ljg4NU0zLjk3IDguNzY5YTIuMjUgMi4yNSAwIDAgMCAxLjQ1NS0yLjExbDkuNTExLTIuMzc4YTIuMjUgMi4yNSAwIDEgMC0uMjYtLjk2NUw1LjIgNS42ODVhMi4yNSAyLjI1IDAgMSAwLTEuMjMgMy4wODRtLjM3My0yLjU0N2ExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjc1LTMuNDM4YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-drag-handle{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjcuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjxjaXJjbGUgY3g9IjEzLjc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iMTMuNzUiIGN5PSIxMS43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjExLjc1IiByPSIuNzUiIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjUiLz48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iMTEuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjwvc3ZnPg==)}.ag-charts-icon-fibonacci-retracement-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA1aDEydjFIMnoiLz48Y2lyY2xlIGN4PSIxNS43NSIgY3k9IjUuNSIgcj0iMS43NSIgc3Ryb2tlPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC4yNSIgY3k9IjE0LjUiIHI9IjEuNzUiIHN0cm9rZT0iIzAwMCIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik0xOCAxNUg2di0xaDEyem0wLTQuNUgydi0xaDE2eiIvPjwvc3ZnPg==)}.ag-charts-icon-fibonacci-retracement-trend-based-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJtNC45OTYgMTIuNjc0IDMuMjkxLTUuNzQzLjg2OC40OTctMy4yOTEgNS43NDN6Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjUuNSIgcj0iMS43NSIgc3Ryb2tlPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC4zNTEiIGN5PSIxNC41IiByPSIxLjc1IiBzdHJva2U9IiMwMDAiLz48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTggNmgtN1Y1aDd6bTAgNC41aC03di0xaDd6bTAgNC41SDZ2LTFoMTJ6Ii8+PC9zdmc+)}.ag-charts-icon-fill-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtOC4wNzEgNC4wNi0uOTI0LS45MjQuNzA3LS43MDcgNy4yODggNy4yODgtNC45NSA0Ljk1YTMuNSAzLjUgMCAwIDEtNC45NSAwbC0xLjQxNC0xLjQxNGEzLjUgMy41IDAgMCAxIDAtNC45NXptLjcwNy43MDhMNC41MzYgOS4wMWEyLjUgMi41IDAgMCAwIDAgMy41MzZMNS45NSAxMy45NmEyLjUgMi41IDAgMCAwIDMuNTM1IDBsNC4yNDMtNC4yNDN6bTYuOSA3LjIwMi0uMzQ1LjM2My0uMzQ0LS4zNjNhLjUuNSAwIDAgMSAuNjg4IDBtLS4zNDUgMS4wOGE4IDggMCAwIDAtLjI4LjMyMyA0LjMgNC4zIDAgMCAwLS40MDkuNTgyYy0uMTEzLjIwMS0uMTQ0LjMyNi0uMTQ0LjM3OGEuODMzLjgzMyAwIDAgMCAxLjY2NyAwYzAtLjA1Mi0uMDMxLS4xNzctLjE0NC0uMzc4YTQuMyA0LjMgMCAwIDAtLjQxLS41ODIgOCA4IDAgMCAwLS4yOC0uMzIybS0uMzQ0LTEuMDguMzQ0LjM2My4zNDQtLjM2My4wMDIuMDAyLjAwNC4wMDQuMDEzLjAxMmE2IDYgMCAwIDEgLjIwNi4yMDhjLjEzMS4xMzYuMzA4LjMyNy40ODUuNTQ1LjE3Ni4yMTUuMzYzLjQ2Ny41MDcuNzI0LjEzNy4yNDMuMjczLjU1My4yNzMuODY4YTEuODMzIDEuODMzIDAgMSAxLTMuNjY3IDBjMC0uMzE1LjEzNi0uNjI1LjI3My0uODY4LjE0NC0uMjU3LjMzLS41MDkuNTA3LS43MjRhOSA5IDAgMCAxIC42NDUtLjcwOGwuMDQ2LS4wNDUuMDEzLS4wMTIuMDA0LS4wMDR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-hollow-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1vcGFjaXR5PSIuMTUiIGQ9Ik01IDVoM3YxMEg1eiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTcgMXYzaDJ2MTJIN3YzSDZ2LTNINFY0aDJWMXpNNSA1aDN2MTBINXptNyAyaDN2NmgtM3ptLTEgN1Y2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-horizontal-line,.ag-charts-icon-horizontal-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNLjUgOS41aDcuMzA2YTIuMjUgMi4yNSAwIDAgMSA0LjM4OCAwSDE5LjV2MWgtNy4zMDZhMi4yNSAyLjI1IDAgMCAxLTQuMzg4IDBILjV6bTkuNSAxLjc1YTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-line-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTQuMjQyIDIuNzIyYy0uNjEyIDAtMS4yLjI0My0xLjYzMi42NzVsLTEuMzQzIDEuMzQ0YS41LjUgMCAwIDAtLjExMi4xMTJMNC4wNSAxMS45NTljLS4yMDcuMjA3LS4zNi40Ni0uNDQ2Ljc0di4wMDFsLS42OSAyLjc2N3YuMDAyYS44Mi44MiAwIDAgMCAxLjAyMiAxLjAyMWguMDAybDIuNjM0LS44MjJjLjI4LS4wODUuNTM0LS4yMzcuNzQtLjQ0M2w3LjEwNy03LjEwOGEuNS41IDAgMCAwIC4xMTItLjExMmwxLjM0My0xLjM0M2EyLjMwOCAyLjMwOCAwIDAgMC0xLjYzMi0zLjk0TTE0LjEyMiA3bDEuMDQ0LTEuMDQ1YTEuMzA4IDEuMzA4IDAgMSAwLTEuODQ5LTEuODVMMTIuMjcxIDUuMTV6bS0yLjU1OC0xLjE0Mi02LjgwNyA2LjgwOWEuOC44IDAgMCAwLS4xOTYuMzI1bC0uNzUgMi40NjggMi40Ny0uNzQ5YS44LjggMCAwIDAgLjMyNS0uMTk0bDYuODA4LTYuODF6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTcuMzYyIDQuODczLTQuNTk0IDYuNjU0LTQuODUtMy4zMTctNC4yNTEgNi45NzctLjg1NC0uNTJMNy42MTIgNi43OWw0Ljg5OSAzLjM1IDQuMDI4LTUuODM2eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-line-style-dashed{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDR2MUgyem0xMiAwaDR2MWgtNHpNOCA5aDR2MUg4eiIvPjwvc3ZnPg==)}.ag-charts-icon-line-style-dotted{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSIyLjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAwMCIvPjxjaXJjbGUgY3g9IjYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSI4LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTAuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSIxMi41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAwMCIvPjxjaXJjbGUgY3g9IjE0LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48L3N2Zz4=)}.ag-charts-icon-line-style-solid{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDE2djFIMnoiLz48L3N2Zz4=)}.ag-charts-icon-line-with-markers-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTk4IDQuODg4LTMuNTU2IDQuOTE4YTIuMjUgMi4yNSAwIDEgMS0zLjg2Ni43NWwtMS40MzItLjlhMi4yNCAyLjI0IDAgMCAxLTIuMDA5LjQzNWwtMy44MjggNi40MjgtLjg2LS41MTJMNi40NSA5LjYyM2EyLjI1IDIuMjUgMCAxIDEgMy41MS0uNzYxbDEuMzI5LjgzNWEyLjI0IDIuMjQgMCAwIDEgMi41NTctLjQ5N2wzLjU0Mi00Ljg5OHptLTQuOTYgNS4xNTNhMS4yNSAxLjI1IDAgMSAwLS42NCAyLjQxOSAxLjI1IDEuMjUgMCAwIDAgLjY0LTIuNDE5TTkuMSA4LjMyMXEuMDY2LS4xOTIuMDY3LS40MDRhMS4yNSAxLjI1IDAgMSAwLS4wNjcuNDA0IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-lock,.ag-charts-icon-locked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuMjA3IDMuNzY0YTIuODk0IDIuODk0IDAgMCAwLTIuODk1IDIuODk0VjloNS43ODlWNi42NThhMi44OTQgMi44OTQgMCAwIDAtMi44OTUtMi44OTRNMTQuMSA5VjYuNjU4YTMuODk0IDMuODk0IDAgMSAwLTcuNzg5IDB2Mi4zNDlBMi41IDIuNSAwIDAgMCA0IDExLjV2M0EyLjUgMi41IDAgMCAwIDYuNSAxN2g4YTIuNSAyLjUgMCAwIDAgMi41LTIuNXYtM0EyLjUgMi41IDAgMCAwIDE0LjUgOXpNNi41IDEwQTEuNSAxLjUgMCAwIDAgNSAxMS41djNBMS41IDEuNSAwIDAgMCA2LjUgMTZoOGExLjUgMS41IDAgMCAwIDEuNS0xLjV2LTNhMS41IDEuNSAwIDAgMC0xLjUtMS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-measurer-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibTQuNDYxIDEyLjcxIDEuNTMyLTEuNTMxIDEuNDE0IDEuNDE0LjcwNy0uNzA3TDYuNyAxMC40NzJsMS41MzItMS41MzMgMiAyIC43MDctLjcwNy0yLTIgNi4wMS02LjAxIDIuODMgMi44MjhMNS4wNSAxNy43NzggMi4yMjIgMTQuOTVsMS41MzItMS41MzIgMS40MTQgMS40MTQuNzA3LS43MDd6TS44MDggMTQuOTVsLjcwNy0uNzA3TDE0LjI0MyAxLjUxNWwuNzA3LS43MDcuNzA3LjcwNyAyLjgyOCAyLjgyOC43MDcuNzA3LS43MDcuNzA3TDUuNzU3IDE4LjQ4NWwtLjcwNy43MDctLjcwNy0uNzA3LTIuODI4LTIuODI4em0xMS4wNzgtNi44MzVMMTAuNDcgNi43bC43MDctLjcwNyAxLjQxNSAxLjQxNHptLjgyNC0zLjY1NCAxIDEgLjcwOC0uNzA3LTEtMXoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-note-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtMy4yMWwtMS40NjkgMi41N2ExIDEgMCAwIDEtMS42ODIuMDg1TDcuMjQzIDE0SDQuNUExLjUgMS41IDAgMCAxIDMgMTIuNXpNNC41IDRhLjUuNSAwIDAgMC0uNS41djhhLjUuNSAwIDAgMCAuNS41aDMuMjU3bDIuMTk2IDMuMDc0TDExLjcxIDEzaDMuNzlhLjUuNSAwIDAgMCAuNS0uNXYtOGEuNS41IDAgMCAwLS41LS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNi41IDYuNUEuNS41IDAgMCAxIDcgNmg2YS41LjUgMCAwIDEgMCAxSDdhLjUuNSAwIDAgMS0uNS0uNU02LjUgOS41QS41LjUgMCAwIDEgNyA5aDZhLjUuNSAwIDAgMSAwIDFIN2EuNS41IDAgMCAxLS41LS41IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-ohlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTEzIDExaC0zdi0xaDNWM2gxdjJoNHYxaC00djExaC0xek02IDE3di0yaDN2LTFINlY0SDV2MUgydjFoM3YxMXoiLz48L3N2Zz4=)}.ag-charts-icon-pan-end{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0ibTYuNjQ2IDEzLjgxMy0uMzUzLjM1NC43MDcuNzA3LjM1NC0uMzU0ek0xMS4xNjYgMTBsLjM1NC4zNTQuMzU0LS4zNTQtLjM1NC0uMzU0ek03LjM1NSA1LjQ4IDcgNS4xMjZsLS43MDcuNzA3LjM1My4zNTR6bTAgOS4wNCA0LjE2Ni00LjE2Ni0uNzA3LS43MDgtNC4xNjcgNC4xNjd6bTQuMTY2LTQuODc0TDcuMzU0IDUuNDhsLS43MDguNzA3IDQuMTY3IDQuMTY3ek0xMy4wODMgNXYxMGgxVjV6Ii8+PC9zdmc+)}.ag-charts-icon-pan-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuNzkgNS44MzMgOC42MjUgMTBsNC4xNjYgNC4xNjctLjcwNy43MDdMNy4yMSAxMGw0Ljg3My00Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy4yMSAxNC4xNjcgMTEuMzc2IDEwIDcuMjEgNS44MzNsLjcwNy0uNzA3TDEyLjc5IDEwbC00Ljg3MyA0Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-start{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgNXYxMGgxVjV6TTkuNjI0IDEwbDQuMTY2LTQuMTY3LS43MDctLjcwN0w4LjIxIDEwbDQuODc0IDQuODc0LjcwNy0uNzA3eiIvPjwvc3ZnPg==)}.ag-charts-icon-parallel-channel,.ag-charts-icon-parallel-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTcuNzIgNS4zMzFBMi4yNSAyLjI1IDAgMSAwIDE0LjcwNSAzLjZsLTkuNDkgNC41NjJhMi4yNSAyLjI1IDAgMSAwIC4yMDkgMS4wMWw5LjY2Mi00LjY0NmEyLjI1IDIuMjUgMCAwIDAgMi42MzQuODA1bS4zNzMtMi41NDdhMS4yNSAxLjI1IDAgMSAxLTIuMzM4Ljg4NSAxLjI1IDEuMjUgMCAwIDEgMi4zMzgtLjg4NU00LjM0MyA4LjY3YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODVNNS4zMDcgMTYuNzI4YTIuMjUgMi4yNSAwIDEgMS0uNTI1LS44NThsOS45MjMtNC43N2EyLjI1IDIuMjUgMCAxIDEgLjM4MS45MjZ6bS0uOTY0LjI3NGExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjAyMy01LjEwNmExLjI1IDEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-position-bottom{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzem0zLTNoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgMTNoOHYxSDZ6Ii8+PC9zdmc+)}.ag-charts-icon-position-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMyAxMGgxNHYxSDN6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDdoOHYxSDZ6bTAgNmg4djFINnoiLz48L3N2Zz4=)}.ag-charts-icon-position-top{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzeiIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik02IDdoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDEzaDh2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-price-label-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNC41IDNBMS41IDEuNSAwIDAgMCAzIDQuNVYxM2ExLjUgMS41IDAgMCAwIDEuNSAxLjVoLjgzM3YuMDU3Yy4yNDItLjI5OS41OTctLjUwMyAxLS41NDhWMTMuNUg0LjVBLjUuNSAwIDAgMSA0IDEzVjQuNWEuNS41IDAgMCAxIC41LS41aDExYS41LjUgMCAwIDEgLjUuNXY4YS41LjUgMCAwIDEtLjUuNWgtNC44MThsLS4xMjYuMDg0YTI2IDI2IDAgMCAwLTIuMjI1IDEuNjg1bC0uMzIuMjY1LS4wNjguMDU2YTEuNSAxLjUgMCAwIDEtMi42MDkgMS4zNTRjLjAzMy43NjMuOTA1IDEuMjM4IDEuNTYuNzU2LjY0Ni0uNDc0IDEuMjEtLjk0MyAxLjc2MS0xLjRsLjMxMy0uMjZBMjYgMjYgMCAwIDEgMTAuOTg2IDE0SDE1LjVhMS41IDEuNSAwIDAgMCAxLjUtMS41di04QTEuNSAxLjUgMCAwIDAgMTUuNSAzeiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNOC43MTYgMTQuODE1YTIuMjUgMi4yNSAwIDEgMS00LjIxIDEuNTkzIDIuMjUgMi4yNSAwIDAgMSA0LjIxLTEuNTkzbS0xLjY2MiAxLjk2NmExLjI1IDEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS41IDYuMjI4IDcuMTY3IDguMzc2IDYuNSA3Ljc2MiA5LjUgNWwzIDIuNzYyLS42NjcuNjE0eiIgZmlsbD0iIzAwMCIvPjxwYXRoIGQ9Ik0yIDE4di0xaDE2djF6TTIgM1YyaDE2djF6IiBmaWxsPSIjMTgxRDFGIi8+PC9zdmc+)}.ag-charts-icon-reset{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuMDQgNC40NDVhNS44MSA1LjgxIDAgMCAwLTcuMjU3IDIuNDUzLjUuNSAwIDAgMS0uODY1LS41MDJBNi44MSA2LjgxIDAgMSAxIDMgOS44MTNhLjUuNSAwIDAgMSAxIDAgNS44MSA1LjgxIDAgMSAwIDguMDQtNS4zNjgiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTQuMjg5IDMuMDAyYS41LjUgMCAwIDEgLjUuNXYyLjY1NWgyLjY1NWEuNS41IDAgMCAxIDAgMUg0LjI5YS41LjUgMCAwIDEtLjUtLjVWMy41MDJhLjUuNSAwIDAgMSAuNS0uNSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-settings{--icon: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkIj48cGF0aCBkPSJNMTAgMTNhMyAzIDAgMSAwIDAtNiAzIDMgMCAwIDAgMCA2bTAtMWEyIDIgMCAxIDEtLjAwMS0zLjk5OUEyIDIgMCAwIDEgMTAgMTIiLz48cGF0aCBkPSJNMi4zMSAxNC4zNDVjLS44MTctMS40OTEuMDI3LTIuNDk5LjQ3NC0yLjg2NS41MzEtLjQzNC45NjktLjM2NS45NzItMS40OC0uMDAzLTEuMTE1LS40NDEtMS4wNDYtLjk3Mi0xLjQ4MS0uNDU0LS4zNzEtMS4zMTctMS40MDUtLjQzNC0yLjkzNmwuMDA1LS4wMDljLjg4NC0xLjUyIDIuMjA3LTEuMjkgMi43NTUtMS4wODMuNjQxLjI0My44MDEuNjU2IDEuNzY4LjEwMS45NjQtLjU2LjY4Ni0uOTA0Ljc5Ni0xLjU4Mi4wOTQtLjU3OC41NTktMS44NDMgMi4zMjYtMS44NDNoLjAxYzEuNzU5LjAwNSAyLjIyMiAxLjI2NiAyLjMxNiAxLjg0My4xMS42NzgtLjE2OCAxLjAyMi43OTYgMS41ODIuOTY3LjU1NSAxLjEyNy4xNDIgMS43NjgtLjEwMS41NDktLjIwOCAxLjg3Ni0uNDM4IDIuNzYgMS4wOTJzLjAyIDIuNTY1LS40MzQgMi45MzZjLS41MzEuNDM1LS45NjkuMzY2LS45NzIgMS40ODEuMDAzIDEuMTE1LjQ0MSAxLjA0Ni45NzIgMS40OC40NTQuMzcyIDEuMzE3IDEuNDA2LjQzNCAyLjkzN2wtLjAwNS4wMDljLS44ODQgMS41Mi0yLjIwNyAxLjI5LTIuNzU1IDEuMDgzLS42NDEtLjI0My0uODAxLS42NTYtMS43NjgtLjEwMS0uOTY0LjU2LS42ODYuOTA0LS43OTYgMS41ODEtLjA5NC41NzktLjU1OSAxLjg0NC0yLjMyNiAxLjg0NGgtLjAxYy0xLjc1OS0uMDA1LTIuMjIyLTEuMjY2LTIuMzE2LTEuODQ0LS4xMS0uNjc3LjE2OC0xLjAyMS0uNzk2LTEuNTgxLS45NjctLjU1NS0xLjEyNy0uMTQyLTEuNzY4LjEwMS0uNTQ5LjIwOC0xLjg3Ni40MzgtMi43Ni0xLjA5MmwtLjAyLS4wMzZ6TTkuOTg0IDIuMTYySDEwYzEuMzU1IDAgMS4zNDIgMS4wMzkgMS4zNTMgMS40MjUuMDA4LjMxMi4wNCAxLjE2IDEuMjU5IDEuODcybC4wMTUuMDA4YzEuMjI1LjcgMS45NzYuMzA0IDIuMjUxLjE1NS4zMzctLjE4MyAxLjIyNi0uNzExIDEuOTAyLjQ0NWwuMDA4LjAxNGMuNjc4IDEuMTczLS4yMjkgMS42ODItLjU1OCAxLjg4NC0uMjY2LjE2My0uOTg0LjYxNS0uOTkxIDIuMDI3di4wMTZjLjAwNyAxLjQxMi43MjUgMS44NjQuOTkxIDIuMDI3LjMyOC4yMDEgMS4yMjkuNzA3LjU2NiAxLjg3bC0uMDA4LjAxNGMtLjY3NyAxLjE3NC0xLjU3MS42NDMtMS45MS40NTktLjI3NS0uMTQ5LTEuMDI2LS41NDUtMi4yNTEuMTU0bC0uMDE1LjAwOWMtMS4yMTkuNzEyLTEuMjUxIDEuNTYtMS4yNTkgMS44NzItLjAxMS4zODYuMDAyIDEuNDI1LTEuMzUzIDEuNDI1cy0xLjM0Mi0xLjAzOS0xLjM1My0xLjQyNWMtLjAwOC0uMzEyLS4wNC0xLjE2LTEuMjU5LTEuODcybC0uMDE1LS4wMDljLTEuMjI1LS42OTktMS45NzYtLjMwMy0yLjI1MS0uMTU0LS4zMzYuMTgzLTEuMjE5LjcwNi0xLjg5NC0uNDMybC0uMDE2LS4wMjdjLS42NzgtMS4xNzQuMjI5LTEuNjgyLjU1OC0xLjg4NC4yNjYtLjE2My45ODQtLjYxNS45OTEtMi4wMjd2LS4wMTZjLS4wMDctMS40MTItLjcyNS0xLjg2NC0uOTkxLTIuMDI3LS4zMjgtLjIwMS0xLjIyOS0uNzA3LS41NjYtMS44N2wuMDA4LS4wMTRjLjY3Ny0xLjE3NCAxLjU3MS0uNjQzIDEuOTEtLjQ1OS4yNzUuMTQ5IDEuMDI2LjU0NSAyLjI1MS0uMTU1bC4wMTUtLjAwOGMxLjIxOS0uNzEyIDEuMjUxLTEuNTYgMS4yNTktMS44NzIuMDEtLjM4NC0uMDAyLTEuNDE3IDEuMzM3LTEuNDI1Ii8+PC9zdmc+)}.ag-charts-icon-step-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzE4MUQxRiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNiA0aDV2OGgzVjhoNXYxaC00djRoLTVWNUg3djEwSDJ2LTFoNHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-text-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00IDRIMTZWN0gxNVY1SDEwLjVWMTVIMTRWMTZINlYxNUg5LjVWNUg1VjdINFY0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-trend-line,.ag-charts-icon-trend-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS4zMTQgMTAuOTM4YTIuMjUgMi4yNSAwIDEgMSAuMDEtMWg5LjM1MmEyLjI1IDIuMjUgMCAxIDEgLjAxIDF6bS0yLjE4OS43MjlhMS4yNSAxLjI1IDAgMSAwIDAtMi41IDEuMjUgMS4yNSAwIDAgMCAwIDIuNW0xMy43NSAwYTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-unlock,.ag-charts-icon-unlocked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNjUxIDMuNWEyLjg5NCAyLjg5NCAwIDAgMC0yLjg5NCAyLjg5NFY5SDE0LjVhMi41IDIuNSAwIDAgMSAyLjUgMi41djNhMi41IDIuNSAwIDAgMS0yLjUgMi41aC04QTIuNSAyLjUgMCAwIDEgNCAxNC41di0zQTIuNSAyLjUgMCAwIDEgNi41IDloLjI1N1Y2LjM5NGEzLjg5NCAzLjg5NCAwIDEgMSA3Ljc4OSAwIC41LjUgMCAwIDEtMSAwQTIuODk0IDIuODk0IDAgMCAwIDEwLjY1IDMuNU02LjUgMTBBMS41IDEuNSAwIDAgMCA1IDExLjV2M0ExLjUgMS41IDAgMCAwIDYuNSAxNmg4YTEuNSAxLjUgMCAwIDAgMS41LTEuNXYtM2ExLjUgMS41IDAgMCAwLTEuNS0xLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-vertical-line,.ag-charts-icon-vertical-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNSA3LjgwNmEyLjI1IDIuMjUgMCAwIDEgMCA0LjM4OFYxOS41aC0xdi03LjMwNmEyLjI1IDIuMjUgMCAwIDEgMC00LjM4OFYuNWgxem0tLjUuOTQ0YTEuMjUgMS4yNSAwIDEgMSAwIDIuNSAxLjI1IDEuMjUgMCAwIDEgMC0yLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-zoom-in{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-zoom-out{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS41IDEwYS41LjUgMCAwIDEgLjUtLjVoOGEuNS41IDAgMCAxIDAgMUg2YS41LjUgMCAwIDEtLjUtLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-high-low-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyA0aDJ2MTJINFY0aDNNNSA1aDN2MTBINXpNMTEgMTRWNmg1djhoLTVtMS03aDN2NmgtM3oiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-hlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTYzIDEuODM3LTUuMzM0IDExLjYyMUw2Ljk1NyA4LjEybC00LjE5OSA5LjYyMi0uOTE2LS40IDQuNzU2LTEwLjlMMTIuNDkgMTEuOCAxNy4yNTQgMS40MnoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjQiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTUuODI1IDIuNzA0LjU1IDEzLjc4NWwuOTAyLjQzIDQuNzI0LTkuOTE5IDYuMDM0IDUuMDI5IDMuMjU1LTguMTQtLjkyOC0uMzctMi43NDUgNi44NnptNy44NTIgMTQuNjM2IDUuNzgtMTMuMTM5LS45MTUtLjQwMi01LjIxOSAxMS44Ni02LjAwNS01LjUwNC0zLjI3OCA3LjY0OC45Mi4zOTQgMi43MjItNi4zNTJ6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-zoom-in-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20taW4iPjxjaXJjbGUgY3g9IjExIiBjeT0iMTEiIHI9IjgiLz48bGluZSB4MT0iMjEiIHgyPSIxNi42NSIgeTE9IjIxIiB5Mj0iMTYuNjUiLz48bGluZSB4MT0iMTEiIHgyPSIxMSIgeTE9IjgiIHkyPSIxNCIvPjxsaW5lIHgxPSI4IiB4Mj0iMTQiIHkxPSIxMSIgeTI9IjExIi8+PC9zdmc+)}.ag-charts-icon-zoom-out-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20tb3V0Ij48Y2lyY2xlIGN4PSIxMSIgY3k9IjExIiByPSI4Ii8+PGxpbmUgeDE9IjIxIiB4Mj0iMTYuNjUiIHkxPSIyMSIgeTI9IjE2LjY1Ii8+PGxpbmUgeDE9IjgiIHgyPSIxNCIgeTE9IjExIiB5Mj0iMTEiLz48L3N2Zz4=)}.ag-charts-input{--input-layer-active: 1;--input-layer-focus: 2;--input-padding: calc(var(--ag-charts-spacing) * 2);--input-padding-large: calc(var(--ag-charts-spacing) * 2.5);color:var(--ag-charts-input-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-large);transition-duration:.25s;transition-property:none;transition-timing-function:ease-out}.ag-charts-input:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:var(--input-layer-focus)}.ag-charts-button{background:var(--ag-charts-button-background-color);border:1px solid var(--ag-charts-border-color);border-radius:var(--ag-charts-button-border-radius);color:var(--ag-charts-button-text-color);cursor:pointer;padding:var(--input-padding);transition-property:background,border-color}.ag-charts-button:hover{background:var(--ag-charts-focus-color)}.ag-charts-button:has(.ag-charts-icon){padding:2px}.ag-charts-checkbox{--checkbox-transition-duration: .1s;appearance:none;background:var(--ag-charts-checkbox-background-color);border-radius:calc(var(--ag-charts-border-radius) * 9);cursor:pointer;height:18px;margin:0;transition-duration:var(--checkbox-transition-duration);transition-property:margin;width:29px}.ag-charts-checkbox:before{display:block;background:var(--ag-charts-input-background-color);border-radius:calc(var(--ag-charts-border-radius) * 7);content:" ";height:14px;margin:2px;transition-duration:var(--checkbox-transition-duration);transition-property:margin;transition-timing-function:var(--ag-charts-input-transition-easing);width:14px}.ag-charts-checkbox:checked{background:var(--ag-charts-checkbox-checked-background-color)}.ag-charts-checkbox:checked:before{margin-left:13px}.ag-charts-select{background:var(--ag-charts-input-background-color);border:1px solid var(--ag-charts-input-border-color);border-radius:var(--ag-charts-input-border-radius);padding:3px 2px 4px;font-size:inherit}.ag-charts-textarea{--textarea-line-height: 1.38;background:var(--ag-charts-input-background-color);border:1px solid var(--ag-charts-border-color);border-radius:var(--ag-charts-input-border-radius);line-height:var(--textarea-line-height);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-large);padding:var(--input-padding-large) var(--input-padding)}.ag-charts-textarea::placeholder{color:var(--ag-charts-input-placeholder-text-color)}.ag-charts-proxy-container{pointer-events:none;position:absolute}.ag-charts-proxy-elem{-webkit-appearance:none;appearance:none;background:none;border:none;color:#0000;overflow:hidden;pointer-events:auto;position:absolute}.ag-charts-proxy-elem::-moz-range-thumb,.ag-charts-proxy-elem::-moz-range-track{opacity:0}.ag-charts-proxy-elem::-webkit-slider-runnable-track,.ag-charts-proxy-elem::-webkit-slider-thumb{opacity:0}.ag-charts-proxy-elem:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-focus-indicator{position:absolute;display:block;pointer-events:none;user-select:none;-webkit-user-select:none;width:100%;height:100%}.ag-charts-focus-indicator>div{position:absolute;outline:solid 1px var(--ag-charts-chrome-background-color);box-shadow:var(--ag-charts-focus-shadow)}.ag-charts-focus-indicator>svg{width:100%;height:100%;fill:none;overflow:visible}.ag-charts-focus-svg-outer-path{stroke:var(--ag-charts-chrome-background-color);stroke-width:4px}.ag-charts-focus-svg-inner-path{stroke:var(--ag-charts-accent-color);stroke-width:2px}.ag-charts-overlay{color:#181d1f;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay{color:#fff}.ag-charts-overlay--loading{color:#8c8c8c}.ag-charts-overlay__loading-background{background:#fff;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay .ag-charts-overlay__loading-background{background:#192232}.ag-charts-tooltip{--tooltip-arrow-size: 8px;--tooltip-row-spacing: 8px;--tooltip-column-spacing: 16px;position:fixed;inset:unset;margin:0;padding:0;overflow:visible;top:var(--top, 0px);left:var(--left, 0px);width:max-content;max-width:100%;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);color:var(--ag-charts-chrome-text-color);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)}.ag-charts-tooltip--compact .ag-charts-tooltip-content{--tooltip-row-spacing: 2px;--tooltip-column-spacing: 8px;padding:3px 6px}.ag-charts-tooltip--arrow-top:before,.ag-charts-tooltip--arrow-right:before,.ag-charts-tooltip--arrow-bottom:before,.ag-charts-tooltip--arrow-left:before{content:"";position:absolute;display:block;width:var(--tooltip-arrow-size);height:var(--tooltip-arrow-size);border:inherit;border-bottom-color:transparent;border-right-color:transparent;background:inherit;clip-path:polygon(0 0,100% 0,100% 1px,1px 100%,0 100%)}.ag-charts-tooltip--arrow-top:before{bottom:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * .5)) rotate(45deg)}.ag-charts-tooltip--arrow-bottom:before{top:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * -.5)) rotate(225deg)}.ag-charts-tooltip--arrow-left:before{right:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * .5)) rotate(315deg)}.ag-charts-tooltip--arrow-right:before{left:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * -.5)) rotate(135deg)}.ag-charts-tooltip--no-interaction{pointer-events:none;user-select:none;-webkit-user-select:none}.ag-charts-tooltip--wrap-always{overflow-wrap:break-word;word-break:break-word;hyphens:none}.ag-charts-tooltip--wrap-hyphenate{overflow-wrap:break-word;word-break:break-word;hyphens:auto}.ag-charts-tooltip--wrap-on-space{overflow-wrap:normal;word-break:normal}.ag-charts-tooltip--wrap-never{white-space:nowrap}.ag-charts-tooltip-heading,.ag-charts-tooltip-title,.ag-charts-tooltip-label,.ag-charts-tooltip-value{overflow:hidden;text-overflow:ellipsis}.ag-charts-tooltip-content{display:grid;grid:auto-flow minmax(1em,auto) / 1fr;padding:8px 12px;gap:var(--tooltip-row-spacing)}.ag-charts-tooltip-content:has(.ag-charts-tooltip-symbol){grid:auto-flow minmax(1em,auto) / auto 1fr}.ag-charts-tooltip-heading{grid-column:1 / -1}.ag-charts-tooltip-symbol{grid-column:1 / 2;place-self:center}.ag-charts-tooltip-symbol svg{display:block}.ag-charts-tooltip-title{grid-column:-2 / -1}.ag-charts-tooltip-row{grid-column:1 / -1;display:flex;gap:var(--tooltip-column-spacing);align-items:baseline;justify-content:space-between;overflow:hidden}.ag-charts-tooltip-row--inline{grid-column:-2 / -1}.ag-charts-tooltip-label{flex:1;min-width:0}.ag-charts-tooltip-value{min-width:0}.ag-charts-tooltip-footer{grid-column:1 / -1;color:var(--ag-charts-chrome-subtle-text-color);text-align:center}.ag-charts-popover{position:absolute;border:var(--ag-charts-border);border-radius:var(--ag-charts-border-radius);background:var(--ag-charts-chrome-background-color);color:var(--ag-charts-chrome-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);box-shadow:var(--ag-charts-shadow);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-menu{--item-padding: 6px 12px;--icon-color: var(--ag-charts-chrome-text-color);display:grid;grid:auto-flow auto / 1fr;column-gap:12px;font-size:var(--ag-charts-chrome-font-size)}.ag-charts-menu:has(.ag-charts-menu__icon,.ag-charts-menu__row--stroke-width-visible){grid:auto-flow auto / auto 1fr}.ag-charts-menu__row--stroke-width-visible:before{content:"";height:var(--strokeWidth);width:12px;background:var(--icon-color)}.ag-charts-menu__row--stroke-width-visible[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-menu__row{display:grid;grid-column:1 / -1;grid-template-columns:subgrid;align-items:center;padding:var(--item-padding)}.ag-charts-menu__row:not(.ag-charts-menu__row--active){cursor:pointer}.ag-charts-menu__row:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.ag-charts-menu__row:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.ag-charts-menu__row:focus{background:var(--ag-charts-focus-color)}.ag-charts-menu__row:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:var(--ag-charts-layer-menu)}.ag-charts-menu__row--active{--icon-color: var(--ag-charts-accent-color);background:var(--ag-charts-focus-color);color:var(--ag-charts-accent-color)}.ag-charts-menu__label{grid-column:-1 / span 1}.ag-charts-toolbar{--toolbar-gap: calc(var(--ag-charts-spacing) * 2);--toolbar-size: 34px;--toolbar-button-padding: 6px;align-items:center;display:flex;flex-wrap:nowrap;position:absolute}.ag-charts-toolbar__button{align-items:center;background:var(--ag-charts-chrome-background-color);border:var(--ag-charts-border);color:var(--ag-charts-chrome-text-color);cursor:pointer;display:flex;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-medium);font-weight:var(--ag-charts-chrome-font-weight);justify-content:center;min-height:var(--toolbar-size);min-width:var(--toolbar-size);padding:var(--toolbar-button-padding);position:relative;transition:background-color .25s ease-in-out,border-color .25s ease-in-out,color .25s ease-in-out;white-space:nowrap}.ag-charts-toolbar__button:hover{background:var(--ag-charts-focus-color);z-index:1}.ag-charts-toolbar__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-toolbar__button--active{background:var(--ag-charts-focus-color);border-color:var(--ag-charts-accent-color);color:var(--ag-charts-accent-color);z-index:2}.ag-charts-toolbar__button[aria-disabled=true]{background:var(--ag-charts-button-disabled-background-color);color:var(--ag-charts-button-disabled-text-color);cursor:default}.ag-charts-toolbar--horizontal{flex-direction:row;.ag-charts-toolbar__button{margin:0 0 0 -1px}.ag-charts-toolbar__button--first{border-bottom-left-radius:var(--ag-charts-border-radius);border-top-left-radius:var(--ag-charts-border-radius);margin:0}.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--vertical{flex-direction:column;.ag-charts-toolbar__button{margin:-1px 0 0;max-width:100%}.ag-charts-toolbar__button--first{border-top-left-radius:var(--ag-charts-border-radius);border-top-right-radius:var(--ag-charts-border-radius);margin:0}.ag-charts-toolbar__button--last{border-bottom-left-radius:var(--ag-charts-border-radius);border-bottom-right-radius:var(--ag-charts-border-radius)}}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{margin-left:var(--toolbar-gap)}.ag-charts-toolbar__icon,.ag-charts-toolbar__label{pointer-events:none}.ag-charts-floating-toolbar{border:none;display:flex;.ag-charts-toolbar{align-items:unset;position:unset}}.ag-charts-floating-toolbar__drag-handle{align-items:center;background:var(--ag-charts-chrome-background-color);border:var(--ag-charts-border);border-bottom-left-radius:var(--ag-charts-border-radius);border-top-left-radius:var(--ag-charts-border-radius);cursor:grab;display:flex;justify-content:center;min-width:24px;padding-left:0;padding-right:0}.ag-charts-floating-toolbar__drag-handle--dragging{cursor:grabbing}
`,Listeners=class{constructor(){this.registeredListeners=new Map}addListener(t,e){const i={symbol:Symbol(t),handler:e};return this.registeredListeners.has(t)?this.registeredListeners.get(t).push(i):this.registeredListeners.set(t,[i]),()=>this.removeListener(i.symbol)}removeListener(t){for(const[e,i]of this.registeredListeners.entries()){const s=i.findIndex(n=>n.symbol===t);if(s>=0){i.splice(s,1),i.length===0&&this.registeredListeners.delete(e);break}}}dispatch(t,...e){for(const i of this.getListenersByType(t))try{i.handler(...e)}catch(s){logger_exports.errorOnce(String(s))}}getListenersByType(t){return this.registeredListeners.get(t)??[]}destroy(){this.registeredListeners.clear()}},BaseManager=class{constructor(){this.listeners=new Listeners,this.destroyFns=[],this.destroyed=!1}addListener(t,e){return this.listeners.addListener(t,e)}destroy(){this.listeners.destroy(),this.destroyFns.forEach(t=>t()),this.destroyed=!0}},GuardedElement=class Bt{constructor(e,i,s){this.element=e,this.topTabGuard=i,this.bottomTabGuard=s,this.destroyFns=[],this.guardTabIndex=0,this.hasFocus=!1,this.initTabGuard(this.topTabGuard,n=>this.onTab(n,!1)),this.initTabGuard(this.bottomTabGuard,n=>this.onTab(n,!0)),this.element.addEventListener("focus",()=>this.onFocus(),{capture:!0}),this.element.addEventListener("blur",n=>this.onBlur(n),{capture:!0})}set tabIndex(e){this.guardTabIndex=e,this.guardTabIndex===0?this.setGuardIndices(void 0):this.hasFocus||this.setGuardIndices(this.guardTabIndex)}destroy(){for(const e of this.destroyFns)e();this.destroyFns.length=0}initTabGuard(e,i){const s=()=>i(e);e.addEventListener("focus",s),this.destroyFns.push(()=>e.removeEventListener("focus",s))}setGuardIndices(e){const i=e;setAttribute(this.topTabGuard,"tabindex",i),setAttribute(this.bottomTabGuard,"tabindex",i)}onFocus(){this.hasFocus=!0,this.guardTabIndex!==0&&this.setGuardIndices(0)}onBlur({relatedTarget:e}){const{topTabGuard:i,bottomTabGuard:s}=this;this.hasFocus=!1,this.guardTabIndex!==0&&e!==i&&e!==s&&this.setGuardIndices(this.guardTabIndex)}onTab(e,i){if(this.guardTabIndex!==0){let s;e.tabIndex===0?(s=this.findExitTarget(!i),this.setGuardIndices(this.guardTabIndex)):s=this.findEnterTarget(i),s?.focus()}}static queryFocusable(e,i){const s=getWindow();return Array.from(e.querySelectorAll(i)).filter(n=>{if(n instanceof HTMLElement){const o=s.getComputedStyle(n);return o.display!=="none"&&o.visibility!=="none"}return!1})}findEnterTarget(e){const i=Bt.queryFocusable(this.element,'[tabindex="0"]'),s=e?i.length-1:0;return i[s]}findExitTarget(e){const i=Bt.queryFocusable(getDocument(),"[tabindex]").filter(o=>o.tabIndex>0).sort((o,a)=>o.tabIndex-a.tabIndex),{before:s,after:n}=Bt.findBeforeAndAfter(i,this.guardTabIndex);return e?s:n}static findBeforeAndAfter(e,i){let s=0,n=e.length-1,o,a;for(;s<=n;){const r=Math.floor((s+n)/2),l=e[r].tabIndex;if(l===i){o=e[r-1]||void 0,a=e[r+1]||void 0;break}else l<i?(o=e[r],s=r+1):(a=e[r],n=r-1)}return{before:o,after:a}}};function addRemovableEventListener(t,e,i,s,n){e.addEventListener(i,s);const o=()=>e.removeEventListener(i,s,n);return t.push(o),o}function addEscapeEventListener(t,e,i){addRemovableEventListener(t,e,"keydown",s=>{s.key==="Escape"&&i(s)})}function addMouseCloseListener(t,e,i){const s=addRemovableEventListener(t,window,"mousedown",n=>{[0,2].includes(n.button)&&!containsPoint2(e,n)&&(i(),s())});return s}function addTouchCloseListener(t,e,i){const s=addRemovableEventListener(t,window,"touchstart",n=>{Array.from(n.targetTouches).some(a=>!containsPoint2(e,a))&&(i(),s())});return s}function containsPoint2(t,e){if(e.target instanceof Element){const{x:i,y:s,width:n,height:o}=t.getBoundingClientRect(),{clientX:a,clientY:r}=e;return a>=i&&r>=s&&a<=i+n&&r<=s+o}return!1}function hasNoModifiers(t){return!(t.shiftKey||t.altKey||t.ctrlKey||t.metaKey)}function matchesKey(t,e,...i){return hasNoModifiers(t)&&(t.key===e||i.some(s=>t.key===s))}function linkTwoButtons(t,e,i,s){i&&addRemovableEventListener(t,e,"keydown",n=>{matchesKey(n,s)&&i.focus()})}function linkThreeButtons(t,e,i,s,n,o){linkTwoButtons(t,e,n,o),linkTwoButtons(t,e,i,s),addRemovableEventListener(t,e,"keydown",a=>{matchesKey(a,s,o)&&a.preventDefault()})}var PREV_NEXT_KEYS={horizontal:{nextKey:"ArrowRight",prevKey:"ArrowLeft"},vertical:{nextKey:"ArrowDown",prevKey:"ArrowUp"}};function initRovingTabIndex(t){const{orientation:e,buttons:i,wrapAround:s=!1,onEscape:n,onFocus:o,onBlur:a}=t,{nextKey:r,prevKey:l}=PREV_NEXT_KEYS[e],c=p=>{p.target&&"tabIndex"in p.target&&(i.forEach(g=>g.tabIndex=-1),p.target.tabIndex=0)},[h,d]=s?[i.length,i.length]:[0,1/0],u=[];for(let p=0;p<i.length;p++){const g=i[(h+p-1)%d],f=i[p],m=i[(h+p+1)%d];addRemovableEventListener(u,f,"focus",c),o&&addRemovableEventListener(u,f,"focus",o),a&&addRemovableEventListener(u,f,"blur",a),n&&addEscapeEventListener(u,f,n),linkThreeButtons(u,f,m,r,g,l),f.tabIndex=p===0?0:-1}return u}var MenuCloserImp=class{constructor(t,e,i){this.lastFocus=e,this.closeCallback=i,this.destroyFns=[],this.destroyFns.push(addMouseCloseListener(this.destroyFns,t,()=>this.close(!0))),this.destroyFns.push(addTouchCloseListener(this.destroyFns,t,()=>this.close(!0)))}close(t){this.destroyFns.forEach(e=>e()),this.destroyFns.length=0,this.closeCallback(),this.finishClosing(t)}finishClosing(t){this.destroyFns.forEach(e=>e()),this.destroyFns.length=0,setAttribute(this.lastFocus,"aria-expanded",!1),t||this.lastFocus?.focus({preventScroll:!0}),this.lastFocus=void 0}};function initMenuKeyNav(t){const{sourceEvent:e,orientation:i,menu:s,buttons:n,closeCallback:o,overrideFocusVisible:a,autoCloseOnBlur:r=!1}=t,{nextKey:l,prevKey:c}=PREV_NEXT_KEYS[i],h=getLastFocus(e);setAttribute(h,"aria-expanded",!0);const d=new MenuCloserImp(s,h,o),u=()=>d.close(),{destroyFns:p}=d;if(s.role="menu",s.ariaOrientation=i,p.push(...initRovingTabIndex({orientation:i,buttons:n,onEscape:u,wrapAround:!0})),s.tabIndex=-1,addEscapeEventListener(p,s,u),addRemovableEventListener(p,s,"keydown",g=>{g.target===s&&(g.key===l||g.key===c)&&(g.preventDefault(),n[0]?.focus())}),r){const g=f=>{!n.includes(f.relatedTarget)&&u()};for(const f of n)addRemovableEventListener(p,f,"blur",g)}return n[0]?.focus({preventScroll:!0}),a!==void 0&&(n.forEach(f=>f.setAttribute("data-focus-visible-override",a.toString())),addRemovableEventListener(p,s,"keydown",()=>{n.forEach(f=>f.setAttribute("data-focus-visible-override","true"))},{once:!0})),d}function makeAccessibleClickListener(t,e){return i=>{if(t.ariaDisabled==="true")return i.preventDefault();e(i)}}function isButtonClickEvent(t){return"button"in t?t.button===0:hasNoModifiers(t)&&(t.code==="Space"||t.key==="Enter")}function getLastFocus(t){if(t?.target instanceof HTMLElement&&"tabindex"in t.target.attributes)return t.target}function stopPageScrolling(t){const e=i=>{if(i.defaultPrevented)return;getAttribute(i.target,"data-preventdefault",!0)&&matchesKey(i,"ArrowRight","ArrowLeft","ArrowDown","ArrowUp")&&i.preventDefault()};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)}var PixelRatioObserver=class{constructor(t){this.callback=t,this.devicePixelRatio=getWindow("devicePixelRatio")??1,this.devicePixelRatioMediaQuery=void 0,this.devicePixelRatioListener=e=>{e.matches||(this.devicePixelRatio=getWindow("devicePixelRatio")??1,this.unregisterDevicePixelRatioListener(),this.registerDevicePixelRatioListener(),this.callback(this.pixelRatio))}}get pixelRatio(){return this.devicePixelRatio}observe(){this.registerDevicePixelRatioListener()}disconnect(){this.unregisterDevicePixelRatioListener()}unregisterDevicePixelRatioListener(){this.devicePixelRatioMediaQuery?.removeEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=void 0}registerDevicePixelRatioListener(){const t=getWindow("matchMedia")?.(`(resolution: ${this.pixelRatio}dppx)`);t?.addEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=t}},SizeMonitor=class{constructor(){this.elements=new Map,this.documentReady=!1,this.queuedObserveRequests=[],this.onLoad=()=>{this.documentReady=!0,this.queuedObserveRequests.forEach(([e,i])=>this.observe(e,i)),this.queuedObserveRequests=[],this.observeWindow()},typeof ResizeObserver<"u"&&(this.resizeObserver=new ResizeObserver(e=>{for(const{target:i,contentRect:{width:s,height:n}}of e){const o=this.elements.get(i);this.checkSize(o,i,s,n)}}));let t;this.pixelRatioObserver=new PixelRatioObserver(()=>{clearTimeout(t),t=setTimeout(()=>this.checkPixelRatio(),0)}),this.documentReady=getDocument("readyState")==="complete",this.documentReady?this.observeWindow():getWindow()?.addEventListener("load",this.onLoad)}destroy(){getWindow()?.removeEventListener("load",this.onLoad),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.pixelRatioObserver?.disconnect(),this.pixelRatioObserver=void 0}observeWindow(){this.pixelRatioObserver?.observe()}checkPixelRatio(){const t=this.pixelRatioObserver?.pixelRatio??1;for(const[e,i]of this.elements)if(i.size!=null&&i.size.pixelRatio!==t){const{width:s,height:n}=i.size;i.size={width:s,height:n,pixelRatio:t},i.cb(i.size,e)}}checkSize(t,e,i,s){if(t&&(i!==t.size?.width||s!==t.size?.height)){const n=this.pixelRatioObserver?.pixelRatio??1;t.size={width:i,height:s,pixelRatio:n},t.cb(t.size,e)}}observe(t,e){if(!this.documentReady){this.queuedObserveRequests.push([t,e]);return}this.elements.has(t)?this.removeFromQueue(t):this.resizeObserver?.observe(t);const i={cb:e};this.elements.set(t,i)}unobserve(t){this.resizeObserver?.unobserve(t),this.elements.delete(t),this.removeFromQueue(t),this.elements.size||this.destroy()}removeFromQueue(t){this.queuedObserveRequests=this.queuedObserveRequests.filter(([e])=>e!==t)}},StateTracker=class extends Map{constructor(t,e){super(),this.defaultValue=t,this.defaultState=e}set(t,e){return this.delete(t),typeof e<"u"&&super.set(t,e),this}stateId(){return Array.from(this.keys()).pop()??this.defaultState}stateValue(){return Array.from(this.values()).pop()??this.defaultValue}},domLayout_default='<div role="presentation" class="ag-charts-wrapper ag-charts-styles" data-ag-charts><div role="presentation" class="ag-charts-canvas-center"><div role="presentation" class="ag-charts-canvas-container"><div role="presentation" class="ag-charts-canvas" aria-hidden="true"></div><div role="figure" class="ag-charts-canvas-proxy"><div role="presentation" class="ag-charts-series-area"></div></div><div role="presentation" class="ag-charts-canvas-overlay ag-charts-tooltip-container"></div></div></div></div>',DOM_ELEMENT_CLASSES=["styles","canvas","canvas-center","canvas-container","canvas-overlay","canvas-proxy","series-area","tooltip-container"],CONTAINER_MODIFIERS={safeHorizontal:"ag-charts-wrapper--safe-horizontal",safeVertical:"ag-charts-wrapper--safe-vertical"},domElementConfig=new Map([["styles",{childElementType:"style"}],["canvas",{childElementType:"canvas"}],["canvas-proxy",{childElementType:"div"}],["canvas-overlay",{childElementType:"div"}],["canvas-center",{childElementType:"div"}],["series-area",{childElementType:"div"}],["tooltip-container",{childElementType:"div"}]]);function setupObserver(t,e){if(typeof IntersectionObserver>"u")return;const i=new IntersectionObserver(s=>{for(const n of s)n.target===t&&e(n.intersectionRatio)},{root:t});return i.observe(t),i}var NULL_DOMRECT={x:0,y:0,width:0,height:0,top:0,bottom:0,left:0,right:0,toJSON(){return NULL_DOMRECT}};function createTabGuardElement(t,e){const i=createElement("div");return i.className="ag-charts-tab-guard",t.insertAdjacentElement(e,i),i}var _DOMManager=class At extends BaseManager{constructor(e,i,s="normal"){super(),this.styleContainer=i,this.mode=s,this.anchorName=`--${createId(this)}`,this.styles=new Map,this.pendingContainer=void 0,this.container=void 0,this.documentRoot=void 0,this.initiallyConnected=void 0,this.containerSize=void 0,this.sizeMonitor=new SizeMonitor,this.cursorState=new StateTracker("default"),this.minWidth=0,this.minHeight=0,this.element=this.initDOM(),this.rootElements=this.initRootElements(),this.rootElements.canvas.element.style.setProperty("anchor-name",this.anchorName);let n=!1;if(this.observer=setupObserver(this.element,o=>{o===0&&!n&&this.listeners.dispatch("hidden",{type:"hidden"}),n=o===0}),this.setSizeOptions(),this.updateContainerSize(),this.addStyles("ag-charts-community",styles_default),this.setContainer(e),this.destroyFns.push(stopPageScrolling(this.element)),this.mode==="normal"){const o=this.rootElements["canvas-center"].element;if(o==null)throw new Error("Error initializing tab guards");const a=createTabGuardElement(o,"beforebegin"),r=createTabGuardElement(o,"afterend");this.tabGuards=new GuardedElement(o,a,r)}}initDOM(){if(this.mode==="normal"){const s=createElement("div");return s.innerHTML=domLayout_default,s.firstChild}const e=createElement("div");e.role="presentation",e.classList.add("ag-charts-canvas-container","ag-charts-canvas","ag-charts-tooltip-container");const i=createElement("div");return e.appendChild(i),i.role="presentation",i.classList.add("ag-charts-series-area"),e}initRootElements(){return DOM_ELEMENT_CLASSES.reduce((e,i)=>{const s=`ag-charts-${i}`;let n=this.element.classList.contains(s)?this.element:this.element.querySelector(`.${s}`);if(!n&&this.mode==="normal")throw new Error(`AG Charts - unable to find DOM element ${s}`);return n??(n=createElement("div")),e[i]={element:n,children:new Map,listeners:[]},e},{})}destroy(){super.destroy(),this.observer?.unobserve(this.element),this.container&&this.sizeMonitor.unobserve(this.container),this.pendingContainer=void 0,Object.values(this.rootElements).forEach(e=>{e.children.forEach(i=>i.remove()),e.element.remove()}),this.element.remove()}postRenderUpdate(){this.mode!=="minimal"&&(this.pendingContainer==null||this.pendingContainer===this.container||(At.batchedUpdateContainer.length===0&&getWindow().setTimeout(this.applyBatchedUpdateContainer.bind(this),0),At.batchedUpdateContainer.push(this)))}applyBatchedUpdateContainer(){for(const e of At.batchedUpdateContainer)e.destroyed||e.updateContainer();At.batchedUpdateContainer.splice(0)}setSizeOptions(e=300,i=300,s,n){const{style:o}=this.element;o.width=`${s??e}px`,o.height=`${n??i}px`,this.minWidth=s??e,this.minHeight=n??i,this.updateContainerClassName()}updateContainerSize(){const{style:e}=this.rootElements["canvas-center"].element;e.visibility=this.containerSize==null?"hidden":"",this.containerSize?(e.width=`${this.containerSize.width??0}px`,e.height=`${this.containerSize.height??0}px`):(e.width="",e.height=""),this.updateContainerClassName()}setTabGuardIndex(e){this.tabGuards&&(this.tabGuards.tabIndex=e)}setContainer(e){e!==this.container&&(this.pendingContainer=e,(this.mode==="minimal"||this.container==null)&&this.updateContainer())}updateContainer(){const{pendingContainer:e}=this;if(!(e==null||e===this.container)){if(this.container&&(this.container.removeChild(this.element),this.sizeMonitor.unobserve(this.container)),this.documentRoot!=null)for(const i of this.rootElements.styles.children.keys())this.removeChild("styles",i);this.container=e,this.pendingContainer=void 0,this.documentRoot=this.getShadowDocumentRoot(e),this.initiallyConnected=this.mode==="minimal"||e.isConnected;for(const[i,s]of this.styles)this.addStyles(i,s);e.appendChild(this.element),this.sizeMonitor.observe(e,i=>{this.containerSize=i,this.updateContainerSize(),this.listeners.dispatch("resize",{type:"resize"})}),this.listeners.dispatch("container-changed",{type:"container-changed"})}}setThemeClass(e){const i="ag-charts-theme-";this.element.classList.forEach(s=>{s.startsWith(i)&&s!==e&&this.element.classList.remove(s)}),this.element.classList.add(e)}setThemeParameters(e){const i={accentColor:"accent-color",axisColor:"axis-color",backgroundColor:"background-color",borderColor:"border-color",foregroundColor:"foreground-color",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",gridLineColor:"grid-line-color",padding:"padding",subtleTextColor:"subtle-text-color",textColor:"text-color",chromeBackgroundColor:"chrome-background-color",chromeFontFamily:"chrome-font-family",chromeFontSize:"chrome-font-size",chromeFontWeight:"chrome-font-weight",chromeSubtleTextColor:"chrome-subtle-text-color",chromeTextColor:"chrome-text-color",inputBackgroundColor:"input-background-color",inputTextColor:"input-text-color",crosshairLabelBackgroundColor:"crosshair-label-background-color",crosshairLabelTextColor:"crosshair-label-text-color"},s=["fontSize","chromeFontSize"];for(const[n,o]of entries(e)){let a=`${o}`;s.includes(n)&&(a=`${o}px`),this.element.style.setProperty(`--ag-charts-${i[n]}`,a)}}updateCanvasLabel(e){setAttribute(this.rootElements["canvas-proxy"].element,"aria-label",e)}getEventElement(e,i){return["focus","blur","keydown","keyup"].includes(i)?this.rootElements["series-area"].element:e}addEventListener(e,i,s){this.getEventElement(this.element,e).addEventListener(e,i,s)}removeEventListener(e,i,s){this.getEventElement(this.element,e).removeEventListener(e,i,s)}getBoundingClientRect(){return this.rootElements.canvas.element.getBoundingClientRect()}getOverlayClientRect(){const e=getWindow(),i=new BBox(0,0,e.innerWidth,e.innerHeight),s=this.getRawOverlayClientRect();return i.intersection(s)?.toDOMRect()??NULL_DOMRECT}getRawOverlayClientRect(){let e=this.element;const i=this.element.getRootNode()?.fullscreenElement;for(;e!=null;){let o;if(i!=null&&e===i)o=!0;else{const r=e.computedStyleMap?.()?.get("overflow-y")?.toString();o=r==="auto"||r==="scroll"}if(o)return BBox.fromDOMRect(e.getBoundingClientRect());e=e.parentElement}if(this.documentRoot!=null)return BBox.fromDOMRect(this.documentRoot.getBoundingClientRect());const{innerWidth:s,innerHeight:n}=getWindow();return new BBox(0,0,s,n)}getShadowDocumentRoot(e=this.container){const i=e?.ownerDocument?.body??getDocument("body");for(;e!=null;){if(e===i)return;if(e.parentNode instanceof DocumentFragment)return e;e=e.parentNode}}getParent(e){return this.rootElements[e].element}getChildBoundingClientRect(e){const{children:i}=this.rootElements[e],s=[];for(const n of i.values())s.push(BBox.fromDOMRect(n.getBoundingClientRect()));return BBox.merge(s)}isManagedChildDOMElement(e,i,s){const{children:n}=this.rootElements[i],o=n?.get(s);return o!=null&&e.contains(o)}contains(e,i){return i==null?this.element.contains(e):this.rootElements[i].element.contains(e)}addStyles(e,i){const s="data-ag-charts";if(this.styles.set(e,i),this.container==null)return;const n=r=>r.getAttribute(s)===e,o=r=>{const l=new Set(["TITLE","META"]);let c=!0,h;for(const u of r.children){if(c&&l.has(u.tagName)){h=u;continue}if(c=!1,n(u))return;u.hasAttribute(s)&&(h=u)}const d=createElement("style");return h==null?r.prepend(d):r.insertBefore(d,h.nextSibling),d};let a;this.styleContainer?a=o(this.styleContainer):this.initiallyConnected===!1?a=this.addChild("styles",e):this.documentRoot==null&&!At.headStyles.has(e)?(a=o(getDocument("head")),At.headStyles.add(e)):this.documentRoot!=null&&(a=this.addChild("styles",e)),!(a==null||n(a))&&(a.setAttribute(s,e),a.innerHTML=i)}removeStyles(e){this.removeChild("styles",e)}updateCursor(e,i){this.cursorState.set(e,i),this.element.style.cursor=this.cursorState.stateValue()}getCursor(){return this.element.style.cursor}addChild(e,i,s,n){const{element:o,children:a,listeners:r}=this.rootElements[e];if(!a)throw new Error("AG Charts - unable to create DOM elements after destroy()");if(a.has(i))return a.get(i);const{childElementType:l="div"}=domElementConfig.get(e)??{};if(s&&s.tagName.toLowerCase()!==l.toLowerCase())throw new Error("AG Charts - mismatching DOM element type");const c=s??createElement(l);for(const[h,d,u]of r)c.addEventListener(h,d,u);if(a.set(i,c),n){const h=o.querySelector(n.query);if(h==null)throw new Error(`AG Charts - addChild query failed ${n.query}`);h.insertAdjacentElement(n.where,c)}else o?.appendChild(c);return c}removeChild(e,i){const{children:s}=this.rootElements[e];s&&(s.get(i)?.remove(),s.delete(i))}incrementDataCounter(e){const{dataset:i}=this.element;i[e]??(i[e]="0"),i[e]=String(Number(i[e])+1)}setDataBoolean(e,i){this.element.dataset[e]=String(i)}updateContainerClassName(){const{element:e,containerSize:i,minWidth:s,minHeight:n}=this;e.classList.toggle(CONTAINER_MODIFIERS.safeHorizontal,s>=(i?.width??1/0)),e.classList.toggle(CONTAINER_MODIFIERS.safeVertical,n>=(i?.height??1/0))}};_DOMManager.batchedUpdateContainer=[],_DOMManager.headStyles=new Set;var DOMManager=_DOMManager,BoundedTextWidget=class extends Widget{constructor(){super(createElement("div")),this.textElement=createSvgElement("text"),this.textElement.role="presentation",this.svgElement=createSvgElement("svg"),this.svgElement.appendChild(this.textElement),this.svgElement.style.width="100%",this.svgElement.style.opacity="0",this.svgElement.role="presentation",this.elem.appendChild(this.svgElement),this.elem.role="presentation"}set textContent(t){this.textElement.textContent=t;const i=this.textElement.getBBox?.();i&&this.svgElement.setAttribute("viewBox",`${i.x} ${i.y} ${i.width} ${i.height}`)}get textContent(){return this.textElement.textContent}destructor(){}},ButtonWidget=class extends Widget{constructor(){super(createElement("button")),this.setEnabled(!0)}destructor(){}setEnabled(t){setAttribute(this.elem,"aria-disabled",!t),setElementStyle(this.elem,"pointer-events",t?void 0:"none")}addListener(t,e){return super.addListener(t,(i,s)=>{(t==="click"||t==="dblclick")&&this.isDisabled()||e(i,s)})}},GroupWidget=class extends Widget{constructor(){super(createElement("div")),setAttribute(this.elem,"role","group")}destructor(){}},RovingTabContainerWidget=class extends Widget{constructor(t,e){super(createElement("div")),this.focusedChildIndex=0,this.onChildFocus=(i,s)=>{const n=this.children[this.focusedChildIndex];this.focusedChildIndex=s.index,n?.setTabIndex(-1),s.setTabIndex(0)},this.onChildKeyDown=(i,s)=>{const n=this.orientation,[o,a]=n==="both"?[PREV_NEXT_KEYS.horizontal,PREV_NEXT_KEYS.vertical]:[PREV_NEXT_KEYS[n],void 0];let r=-1;if(hasNoModifiers(i.sourceEvent)){const l=i.sourceEvent.key;l===o.nextKey||l===a?.nextKey?r=s.index+1:(l===o.prevKey||l===a?.prevKey)&&(r=s.index-1)}this.children[r]?.focus()},this.orientation=t,setAttribute(this.elem,"role",e)}get orientation(){return getAttribute(this.elem,"aria-orientation")??"both"}set orientation(t){setAttribute(this.elem,"aria-orientation",t!=="both"?t:void 0)}focus(){this.children[this.focusedChildIndex]?.focus()}onChildAdded(t){t.addListener("focus",this.onChildFocus),t.addListener("keydown",this.onChildKeyDown),t.setTabIndex(this.children.length===1?0:-1)}onChildRemoved(t){t.removeListener("focus",this.onChildFocus),t.removeListener("keydown",this.onChildKeyDown);const{focusedChildIndex:e,children:i}=this,s=e===t.index;for(let n=0;n<i.length;n++){const o=i[n];o.index===e&&(this.focusedChildIndex=n),o.index=n}if(s){const n=i[e]??i[e-1];n?(this.focusedChildIndex=n.index,n.setTabIndex(0)):this.focusedChildIndex=0}}},ListWidget=class extends RovingTabContainerWidget{constructor(){super("both","list"),this.setHidden(!0)}destructor(){this.children.forEach(t=>t.getElement().parentElement.remove())}addChildToDOM(t,e){const i=createElement("div");setAttribute(i,"role","listitem"),setElementStyle(i,"position","absolute"),Widget.setElementContainer(t,i),this.appendOrInsert(i,e),this.setHidden(!1)}removeChildFromDOM(t){t.getElement().parentElement.remove(),this.setHidden(this.children.length===0)}setHidden(t){this.children.length===0&&(t=!0),super.setHidden(t)}},NativeWidget=class extends Widget{constructor(t){super(t)}destructor(){}},percentFormatter=new Intl.NumberFormat("en-US",{style:"percent"});function formatValue(t,e=2){return typeof t=="number"?formatNumber(t,e):typeof t=="string"?t:String(t??"")}function formatPercent(t){return percentFormatter.format(t)}var numberFormatters=new Map().set(2,new Intl.NumberFormat("en-US",{maximumFractionDigits:2,useGrouping:!1}));function formatNumber(t,e){let i=numberFormatters.get(e);return i||(i=new Intl.NumberFormat("en-US",{maximumFractionDigits:e,useGrouping:!1}),numberFormatters.set(e,i)),i.format(t)}var _SliderWidget=class Lt extends Widget{constructor(){super(createElement("input")),this._step=Lt.STEP_ONE,this.orientation="both"}get step(){return this._step}set step(e){this._step=e,this.getElement().step=e.attributeValue}get keyboardStep(){return this._keyboardStep?.step??this._step}set keyboardStep(e){if(e!==this._keyboardStep?.step&&(this._keyboardStep!==void 0&&(this.removeListener("keydown",this._keyboardStep.onKeyDown),this.removeListener("keyup",this._keyboardStep.onKeyUp),this.removeListener("blur",this._keyboardStep.onBlur),this._keyboardStep=void 0),e!==void 0)){const i=()=>this.getElement().step=e.attributeValue,s=()=>this.getElement().step=this._step.attributeValue;this._keyboardStep={step:e,onKeyDown:i,onKeyUp:s,onBlur:s},this.addListener("keydown",this._keyboardStep.onKeyDown),this.addListener("keyup",this._keyboardStep.onKeyUp),this.addListener("blur",this._keyboardStep.onBlur)}}get orientation(){return getAttribute(this.elem,"aria-orientation")??"both"}set orientation(e){setAttribute(this.elem,"aria-orientation",e!=="both"?e:void 0),Lt.registerDefaultPreventers(this,e)}destructor(){}clampValueRatio(e,i){const s=this.getValueRatio(),n=clamp(e,s,i);return n!==s&&this.setValueRatio(n),n}setValueRatio(e,i){const{divider:s}=this.step,n=Math.round(e*1e4)/s,{ariaValueText:o=formatPercent(n/s)}=i??{},a=this.getElement();a.value=`${n}`,a.ariaValueText=o}getValueRatio(){return parseFloat(this.getElement().value)/this.step.divider}static registerDefaultPreventers(e,i){i==="both"?e.removeListener("keydown",Lt.onKeyDown):e.addListener("keydown",Lt.onKeyDown)}static onKeyDown(e,i){let s=[];const{orientation:n}=i;n==="horizontal"?s=["ArrowUp","ArrowDown"]:n==="vertical"&&(s=["ArrowLeft","ArrowRight"]),s.includes(e.sourceEvent.code)&&e.sourceEvent.preventDefault()}};_SliderWidget.STEP_ONE={attributeValue:"1",divider:1},_SliderWidget.STEP_HUNDRETH={attributeValue:"0.01",divider:100};var SliderWidget=_SliderWidget,SwitchWidget=class extends ButtonWidget{constructor(){super(),setAttribute(this.elem,"role","switch"),this.setChecked(!1)}setChecked(t){setAttribute(this.elem,"aria-checked",t)}},ToolbarWidget=class extends RovingTabContainerWidget{constructor(t="horizontal"){super(t,"toolbar")}destructor(){}};function checkType(t,e){return e.params?.type===t}function allocateResult(t){if(t==="button")return new ButtonWidget;if(t==="slider")return new SliderWidget;if(t==="toolbar")return new ToolbarWidget;if(t==="group")return new GroupWidget;if(t==="list")return new ListWidget;if(t==="region")return new NativeWidget(createElement("div"));if(t==="text")return new BoundedTextWidget;if(t==="listswitch")return new SwitchWidget;throw Error("AG Charts - error allocating meta")}function allocateMeta(t){const e={params:t,result:void 0};return e.result=allocateResult(e.params.type),e}var ProxyInteractionService=class{constructor(t,e){this.localeManager=t,this.domManager=e,this.destroyFns=[]}destroy(){this.destroyFns.forEach(t=>t())}addLocalisation(t){t(),this.destroyFns.push(this.localeManager.addListener("locale-changed",t))}createProxyContainer(t){const e=allocateMeta(t),{params:i,result:s}=e,n=s.getElement();return this.domManager.addChild("canvas-proxy",i.domManagerId,n),n.classList.add(...i.classList,"ag-charts-proxy-container"),n.role=i.type,"ariaOrientation"in i&&(n.ariaOrientation=i.ariaOrientation),checkType("toolbar",e)&&(e.result.orientation=e.params.orientation),this.addLocalisation(()=>{n.ariaLabel=this.localeManager.t(i.ariaLabel.id,i.ariaLabel.params)}),s}createProxyElement(t){const e=allocateMeta(t);if(checkType("button",e)){const{params:i,result:s}=e,n=s.getElement();if(this.initInteract(i,s),typeof i.textContent=="string")n.textContent=i.textContent;else{const{textContent:o}=i;this.addLocalisation(()=>{n.textContent=this.localeManager.t(o.id,o.params)})}this.setParent(e.params,e.result)}if(checkType("slider",e)){const{params:i,result:s}=e,n=s.getElement();this.initInteract(i,s),n.type="range",n.role="presentation",n.style.margin="0px",this.addLocalisation(()=>{n.ariaLabel=this.localeManager.t(i.ariaLabel.id,i.ariaLabel.params)}),this.setParent(e.params,e.result)}if(checkType("text",e)){const{params:i,result:s}=e;this.initElement(i,s),this.setParent(e.params,e.result)}if(checkType("listswitch",e)){const{params:i,result:s}=e;this.initInteract(i,s),s.setTextContent(i.textContent),s.setChecked(i.ariaChecked),s.setAriaDescribedBy(i.ariaDescribedBy),this.setParent(e.params,e.result)}if(checkType("region",e)){const{params:i,result:s}=e,n=s.getElement();this.initInteract(i,s),n.role="region",this.setParent(e.params,e.result)}return e.result}initElement(t,e){const i=e.getElement();return setAttribute(i,"id",t.id),setElementStyle(i,"cursor",t.cursor),i.classList.toggle("ag-charts-proxy-elem",!0),i}initInteract(t,e){const{tabIndex:i,domIndex:s}=t,n=this.initElement(t,e);i!==void 0&&(n.tabIndex=i),s!==void 0&&(e.domIndex=s)}setParent(t,e){if("parent"in t)t.parent?.addChild(e);else{const i={where:t.where,query:".ag-charts-series-area"};this.domManager.addChild("canvas-proxy",t.domManagerId,e.getElement(),i)}}},AG_CHARTS_LOCALE_EN_US={ariaAnnounceHoverDatum:"${datum}",ariaAnnounceChart:"chart, ${seriesCount}[number] series",ariaAnnounceHierarchyChart:"hierarchy chart, ${caption}",ariaAnnounceGaugeChart:"gauge chart, ${caption}",ariaAnnounceHierarchyDatum:"level ${level}[number], ${count}[number] children, ${description}",ariaAnnounceFlowProportionLink:"link ${index} of ${count}, from ${from} to ${to}, ${sizeName} ${size}",ariaAnnounceFlowProportionNode:"node ${index} of ${count}, ${description}",ariaDescriptionLegendItem:"Press Space or Enter to toggle visibility",ariaLabelAddHorizontalLine:"Add Horizontal Line",ariaLabelAnnotationOptionsToolbar:"Annotation Options",ariaLabelAnnotationSettingsDialog:"Annotation Settings",ariaLabelColorPicker:"Color picker",ariaLabelFinancialCharts:"Financial Charts",ariaLabelLegend:"Legend",ariaLabelLegendPagination:"Legend Pagination",ariaLabelLegendPagePrevious:"Previous Legend Page",ariaLabelLegendPageNext:"Next Legend Page",ariaLabelLegendItem:"${label}, Legend item ${index}[number] of ${count}[number]",ariaLabelLegendItemUnknown:"Unknown legend item",ariaLabelNavigator:"Navigator",ariaLabelNavigatorRange:"Range",ariaLabelNavigatorMinimum:"Minimum",ariaLabelNavigatorMaximum:"Maximum",ariaLabelRangesToolbar:"Ranges",ariaLabelSettingsTabBar:"Settings",ariaLabelZoomToolbar:"Zoom",ariaValuePanRange:"${min}[percent0to2dp] to ${max}[percent0to2dp]",iconAltTextLineStyleSolid:"Solid",iconAltTextLineStyleDashed:"Long-dashed",iconAltTextLineStyleDotted:"Short-dashed",iconAltTextPositionTop:"Top",iconAltTextPositionCenter:"Center",iconAltTextPositionBottom:"Bottom",iconAltTextAlignLeft:"Left",iconAltTextAlignCenter:"Center",iconAltTextAlignRight:"Right",iconAltTextClose:"Close",overlayLoadingData:"Loading data...",overlayNoData:"No data to display",overlayNoVisibleSeries:"No visible series",overlayUnsupportedBrowser:"Incompatible browser version. Please upgrade your browser.",seriesHistogramTooltipFrequency:"Frequency",seriesHistogramTooltipSum:"${yName} (sum)",seriesHistogramTooltipCount:"${yName} (count)",seriesHistogramTooltipMean:"${yName} (mean)",toolbarSeriesTypeDropdown:"Chart Type",toolbarSeriesTypeOHLC:"OHLC",toolbarSeriesTypeHLC:"HLC",toolbarSeriesTypeHighLow:"High Low",toolbarSeriesTypeCandles:"Candles",toolbarSeriesTypeHollowCandles:"Hollow Candles",toolbarSeriesTypeLine:"Line",toolbarSeriesTypeLineWithMarkers:"Line with Markers",toolbarSeriesTypeStepLine:"Step Line",toolbarAnnotationsTrendLine:"Trend Line",toolbarAnnotationsFibonacciRetracement:"Fib Retracement",toolbarAnnotationsFibonacciRetracementTrendBased:"Fib Trend Based",toolbarAnnotationsHorizontalLine:"Horizontal Line",toolbarAnnotationsVerticalLine:"Vertical Line",toolbarAnnotationsParallelChannel:"Parallel Channel",toolbarAnnotationsDisjointChannel:"Disjoint Channel",toolbarAnnotationsClearAll:"Clear All",toolbarAnnotationsFillColor:"Fill Color",toolbarAnnotationsLineColor:"Line Color",toolbarAnnotationsLineStyle:"Line Style",toolbarAnnotationsLineStrokeWidth:"Line Stroke Width",toolbarAnnotationsSettings:"Settings",toolbarAnnotationsTextColor:"Text Color",toolbarAnnotationsTextSize:"Text Size",toolbarAnnotationsLock:"Lock",toolbarAnnotationsUnlock:"Unlock",toolbarAnnotationsDelete:"Delete",toolbarAnnotationsDragHandle:"Drag Toolbar",toolbarAnnotationsLineAnnotations:"Trend Lines",toolbarAnnotationsFibonacciAnnotations:"Fibonacci",toolbarAnnotationsTextAnnotations:"Text Annotations",toolbarAnnotationsShapeAnnotations:"Arrows",toolbarAnnotationsMeasurerAnnotations:"Measurers",toolbarAnnotationsCallout:"Callout",toolbarAnnotationsComment:"Comment",toolbarAnnotationsNote:"Note",toolbarAnnotationsText:"Text",toolbarAnnotationsArrow:"Arrow",toolbarAnnotationsArrowUp:"Arrow Up",toolbarAnnotationsArrowDown:"Arrow Down",toolbarAnnotationsDateRange:"Date Range",toolbarAnnotationsPriceRange:"Price Range",toolbarAnnotationsDatePriceRange:"Date and Price",toolbarAnnotationsQuickDatePriceRange:"Measure",toolbarRange1Month:"1M",toolbarRange1MonthAria:"1 month",toolbarRange3Months:"3M",toolbarRange3MonthsAria:"3 months",toolbarRange6Months:"6M",toolbarRange6MonthsAria:"6 months",toolbarRangeYearToDate:"YTD",toolbarRangeYearToDateAria:"Year to date",toolbarRange1Year:"1Y",toolbarRange1YearAria:"1 year",toolbarRangeAll:"All",toolbarRangeAllAria:"All",toolbarZoomZoomOut:"Zoom out",toolbarZoomZoomIn:"Zoom in",toolbarZoomPanLeft:"Pan left",toolbarZoomPanRight:"Pan right",toolbarZoomPanStart:"Pan to the start",toolbarZoomPanEnd:"Pan to the end",toolbarZoomReset:"Reset the zoom",contextMenuDownload:"Download",contextMenuToggleSeriesVisibility:"Toggle Visibility",contextMenuToggleOtherSeries:"Toggle Other Series",contextMenuZoomToCursor:"Zoom to here",contextMenuPanToCursor:"Pan to here",dialogHeaderChannel:"Channel",dialogHeaderLine:"Line",dialogHeaderFibonacciRange:"Fib Retracement",dialogHeaderDateRange:"Date Range",dialogHeaderPriceRange:"Price Range",dialogHeaderDatePriceRange:"Date and Price",dialogHeaderText:"Text",dialogInputAlign:"Align",dialogInputColorPicker:"Color",dialogInputColorPickerAltText:"Text Color",dialogInputFillColorPicker:"Fill",dialogInputFillColorPickerAltText:"Fill Color",dialogInputExtendChannelStart:"Extend channel start",dialogInputExtendChannelEnd:"Extend channel end",dialogInputExtendLineStart:"Extend line start",dialogInputExtendLineEnd:"Extend line end",dialogInputExtendAbove:"Extend above",dialogInputExtendBelow:"Extend below",dialogInputExtendLeft:"Extend left",dialogInputExtendRight:"Extend right",dialogInputReverse:"Reverse",dialogInputShowFill:"Show Fill",dialogInputFontSize:"Size",dialogInputFontSizeAltText:"Font Size",dialogInputLineStyle:"Dash",dialogInputPosition:"Position",dialogInputStrokeWidth:"Weight",dialogInputStrokeWidthAltText:"Line Weight",dialogInputFibonacciBands:"Bands",dialogInputFibonacciBandsAltText:"Fibonacci Bands",inputTextareaPlaceholder:"Add Text",measurerDateRangeBars:"${value}[number] bars",measurerPriceRangeValue:"${value}[number]",measurerPriceRangePercent:"${value}[percent]",measurerVolume:"Vol ${value}",tooltipPaginationStatus:"${index}[number] of ${count}[number]"},messageRegExp=/\$\{(\w+)}(?:\[(\w+)])?/gi,formatters={number:new Intl.NumberFormat("en-US"),percent:new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}),percent0to2dp:new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:0,maximumFractionDigits:2}),date:new Intl.DateTimeFormat("en-US",{dateStyle:"full"}),time:new Intl.DateTimeFormat("en-US",{timeStyle:"full"}),datetime:new Intl.DateTimeFormat("en-US",{dateStyle:"full",timeStyle:"full"})},defaultMessageFormatter=({defaultValue:t,variables:e})=>t?.replaceAll(messageRegExp,(i,s,n)=>{const o=e[s],a=n!=null?formatters[n]:null;return n!=null&&a==null&&logger_exports.warnOnce(`Format style [${n}] is not supported`),a!=null?a.format(o):typeof o=="number"?formatters.number.format(o):o instanceof Date?formatters.datetime.format(o):String(o)}),LocaleManager=class extends Listeners{constructor(){super(...arguments),this.localeText=void 0,this.getLocaleText=void 0}setLocaleText(t){this.localeText!==t&&(this.localeText=t,this.dispatch("locale-changed"))}setLocaleTextFormatter(t){this.getLocaleText=t,this.getLocaleText!==t&&(this.getLocaleText=t,this.dispatch("locale-changed"))}t(t,e={}){const{localeText:i=AG_CHARTS_LOCALE_EN_US,getLocaleText:s}=this,n=i[t];return s?.({key:t,defaultValue:n,variables:e})??defaultMessageFormatter({key:t,defaultValue:n,variables:e})??t}},HdpiCanvas=class{constructor(t){this.enabled=!0,this.width=600,this.height=300;const{width:e,height:i,canvasElement:s,willReadFrequently:n=!1}=t;this.pixelRatio=t.pixelRatio??getWindow("devicePixelRatio")??1,this.element=s??createElement("canvas"),this.element.style.display="block",this.element.style.width=(e??this.width)+"px",this.element.style.height=(i??this.height)+"px",this.element.width=Math.round((e??this.width)*this.pixelRatio),this.element.height=Math.round((i??this.height)*this.pixelRatio),this.context=this.element.getContext("2d",{willReadFrequently:n}),this.onEnabledChange(),this.resize(e??0,i??0,this.pixelRatio),debugContext(this.context)}drawImage(t,e=0,i=0){return t.drawImage(this.context.canvas,e,i)}toDataURL(t){return this.element.toDataURL(t)}resize(t,e,i){if(!(t>0&&e>0))return;const{element:s,context:n}=this;s.width=Math.round(t*i),s.height=Math.round(e*i),n.setTransform(i,0,0,i,0,0),s.style.width=t+"px",s.style.height=e+"px",this.width=t,this.height=e,this.pixelRatio=i}clear(){clearContext(this)}destroy(){this.element.remove(),this.element.width=0,this.element.height=0,this.context.clearRect(0,0,0,0),Object.freeze(this)}onEnabledChange(){this.element&&(this.element.style.display=this.enabled?"":"none")}};__decorateClass2([ObserveChanges(t=>t.onEnabledChange())],HdpiCanvas.prototype,"enabled",2);var LayersManager=class{constructor(t){this.canvas=t,this.debug=Debug.create(!0,"scene"),this.layersMap=new Map,this.nextLayerId=0}get size(){return this.layersMap.size}resize(t,e,i){this.canvas.resize(t,e,i),this.layersMap.forEach(({canvas:s})=>s.resize(t,e,i))}addLayer(t){const{width:e,height:i,pixelRatio:s}=this.canvas,{name:n}=t,o=new HdpiOffscreenCanvas({width:e,height:i,pixelRatio:s});return this.layersMap.set(o,{id:this.nextLayerId++,name:n,canvas:o}),this.debug("Scene.addLayer() - layers",this.layersMap),o}removeLayer(t){this.layersMap.has(t)&&(this.layersMap.delete(t),t.destroy(),this.debug("Scene.removeLayer() - layers",this.layersMap))}clear(){for(const t of this.layersMap.values())t.canvas.destroy();this.layersMap.clear()}};function formatBytes(t){for(const e of["B","KB","MB","GB"]){if(t<1536)return`${t.toFixed(1)}${e}`;t/=1024}return`${t.toFixed(1)}TB}`}function memoryUsage(){if(!("memory"in performance))return;const{totalJSHeapSize:t,usedJSHeapSize:e,jsHeapSizeLimit:i}=performance.memory,s=[];for(const n of[e,t,i])typeof n=="number"&&s.push(formatBytes(n));return`Heap ${s.join(" / ")}`}function debugStats(t,e,i,s,n={},o=BBox.zero){if(!Debug.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:a=0,layersSkipped:r=0,nodesRendered:l=0,nodesSkipped:c=0,opsPerformed:h=0,opsSkipped:d=0}=s??{},u=performance.now(),{start:p,...g}=e,f=Object.entries(g).map(([k,w])=>time(k,w)).filter(k=>k!=null).join(" + "),m=Object.entries(n).map(([k,w])=>`${k}: ${JSON.stringify(w)}`).join(" ; "),y=Debug.check("scene:stats:verbose"),x=memoryUsage(),b=[`${time("\u23F1\uFE0F",p,u)} (${f})`,`${m}`,`Layers: ${y?pct(a,r):t.size}`,y?`Nodes: ${pct(l,c)}`:null,y?`Ops: ${pct(h,d)}`:null,y&&x?x:null].filter(isString),S=new SimpleTextMeasurer(k=>i.measureText(k)),v=new Map(b.map(k=>[k,S.measureLines(k)])),I=Math.max(...Array.from(v.values(),k=>k.width)),A=accumulate(v.values(),k=>k.height),D=2+o.x;i.save(),i.fillStyle="white",i.fillRect(D,0,I,A),i.fillStyle="black";let T=0;for(const[k,w]of v.entries())T+=w.height,i.fillText(k,D,T);i.restore()}function prepareSceneNodeHighlight(t){const e=toArray(getWindow("agChartsSceneDebug")),i=[];for(const s of e)s==="layout"?i.push("seriesRoot","legend","root",/.*Axis-\d+-axis.*/):i.push(s);t.debugNodeSearch=i}function debugSceneNodeHighlight(t,e){t.save();for(const[i,s]of Object.entries(e)){const n=Transformable.toCanvas(s);if(!n){logger_exports.log(`Scene.render() - no bbox for debugged node [${i}].`);continue}t.globalAlpha=.8,t.strokeStyle="red",t.lineWidth=1,t.strokeRect(n.x,n.y,n.width,n.height),t.fillStyle="red",t.strokeStyle="white",t.font="16px sans-serif",t.textBaseline="top",t.textAlign="left",t.lineWidth=2,t.strokeText(i,n.x,n.y,n.width),t.fillText(i,n.x,n.y,n.width)}t.restore()}var skippedProperties=new Set,allowedProperties=new Set(["gradient","zIndex","clipRect","cachedBBox","childNodeCounts","path","__zIndex","name","__scalingCenterX","__scalingCenterY","__rotationCenterX","__rotationCenterY","_previousDatum","__fill","__lineDash","borderPath","borderClipPath","_clipPath"]);function nodeProps(t){const{...e}=t;for(const i of Object.keys(e))allowedProperties.has(i)||typeof e[i]!="number"&&typeof e[i]!="string"&&typeof e[i]!="boolean"&&(skippedProperties.add(i),delete e[i]);return e}function buildTree(t,e){if(!Debug.check(!0,"scene"))return{};let i=0;return{node:e==="json"?nodeProps(t):t,name:t.name??t.id,dirty:t.dirty,...Array.from(t.children(),s=>buildTree(s,e)).reduce((s,n)=>{let{name:o}=n;const{node:{visible:a,opacity:r,zIndex:l,translationX:c,translationY:h,rotation:d,scalingX:u,scalingY:p},node:g}=n;(!a||r<=0)&&(o=`(${o})`),Group.is(g)&&g.renderToOffscreenCanvas&&(o=`*${o}*`);const f=Array.isArray(l)?`(${l.join(", ")})`:l,m=[`${(i++).toString().padStart(3,"0")}|`,`${o??"<unknown>"}`,`z: ${f}`,c&&`x: ${c}`,h&&`y: ${h}`,d&&`r: ${d}`,u!=null&&u!==1&&`sx: ${u}`,p!=null&&p!==1&&`sy: ${p}`].filter(b=>!!b).join(" ");let y=m,x=1;for(;s[y]!=null&&x<100;)y=`${m} (${x++})`;return s[y]=n,s},{})}}function buildDirtyTree(t){if(!t.dirty)return{dirtyTree:{},paths:[]};const e=Array.from(t.children(),n=>buildDirtyTree(n)).filter(n=>n.paths.length>0),i=Group.is(t)?t.name??t.id:t.id,s=e.length?e.flatMap(n=>n.paths).map(n=>`${i}.${n}`):[i];return{dirtyTree:{name:i,node:t,dirty:t.dirty,...e.map(n=>n.dirtyTree).filter(n=>n.dirty!=null).reduce((n,o)=>(n[o.name??"<unknown>"]=o,n),{})},paths:s}}function pct(t,e){const i=t+e;return`${t} / ${i} (${Math.round(100*t/i)}%)`}function time(t,e,i){const s=i!=null?i-e:e;return`${t}: ${Math.round(s*100)/100}ms`}function accumulate(t,e){let i=0;for(const s of t)i+=e(s);return i}var Scene=class{constructor(t){this.debug=Debug.create(!0,"scene"),this.id=createId(this),this.root=null,this.pendingSize=null,this.isDirty=!1,this.updateDebugFlags(),this.canvas=new HdpiCanvas(t),this.layersManager=new LayersManager(this.canvas)}get width(){return this.pendingSize?.[0]??this.canvas.width}get height(){return this.pendingSize?.[1]??this.canvas.height}get pixelRatio(){return this.pendingSize?.[2]??this.canvas.pixelRatio}setContainer(t){const{element:e}=this.canvas;return e.parentElement?.removeChild(e),t.appendChild(e),this}setRoot(t){return this.root===t?this:(this.isDirty=!0,this.root?._setLayerManager(),this.root=t,t&&(t.visible=!0,t._setLayerManager(this.layersManager)),this)}updateDebugFlags(){Debug.inDevelopmentMode(()=>Node._debugEnabled=!0)}clear(){this.canvas.clear()}attachNode(t){return this.appendChild(t),()=>this.removeChild(t)}appendChild(t){return this.root?.appendChild(t),this}removeChild(t){return this.root?.removeChild(t),this}download(t,e){downloadUrl(this.canvas.toDataURL(e),t?.trim()??"image")}getDataURL(t){return this.canvas.toDataURL(t)}resize(t,e,i){return t=Math.round(t),e=Math.round(e),i??(i=this.pixelRatio),t>0&&e>0&&(t!==this.width||e!==this.height||i!==this.pixelRatio)?(this.pendingSize=[t,e,i],this.isDirty=!0,!0):!1}render(t){const{debugSplitTimes:e={start:performance.now()},extraDebugStats:i,seriesRect:s}=t??{},{canvas:n,canvas:{context:o}={},root:a,pendingSize:r,width:l,height:c,pixelRatio:h}=this;if(!o)return;const d=performance.now();let u=!1;if(r&&(u=!0,this.layersManager.resize(...r),this.pendingSize=null),a&&!a.visible){this.isDirty=!1;return}if(a?.dirty===!1&&!this.isDirty){this.debug.check()&&this.debug("Scene.render() - no-op",{tree:buildTree(a,"console")}),debugStats(this.layersManager,e,o,void 0,i,s);return}const p={ctx:o,width:l,height:c,devicePixelRatio:h,debugNodes:{}};Debug.check("scene:stats:verbose")&&(p.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0,opsPerformed:0,opsSkipped:0}),prepareSceneNodeHighlight(p);let g=!1;if((a?.dirty!==!1||u)&&(g=!0,n.clear()),a&&Debug.check("scene:dirtyTree")){const{dirtyTree:f,paths:m}=buildDirtyTree(a);Debug.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:f,paths:m})}if(a&&g){if(a.visible&&a.preRender(p),this.debug.check()){const f=buildTree(a,"console");this.debug("Scene.render() - before",{canvasCleared:g,tree:f})}a.visible&&(o.save(),a.render(p),o.restore())}e["\u270D\uFE0F"]=performance.now()-d,o.verifyDepthZero?.(),this.isDirty=!1,debugStats(this.layersManager,e,o,p.stats,i,s),debugSceneNodeHighlight(o,p.debugNodes),a&&this.debug.check()&&this.debug("Scene.render() - after",{tree:buildTree(a,"console"),canvasCleared:g})}toSVG(){const{root:t,width:e,height:i}=this;if(t!=null)return Node.toSVG(t,e,i)}strip(){const{context:t,pixelRatio:e}=this.canvas;t.setTransform(e,0,0,e,0,0),this.layersManager.clear(),this.setRoot(null),this.isDirty=!1}destroy(){this.strip(),this.canvas.destroy(),Object.assign(this,{canvas:void 0})}};Scene.className="Scene";function needsContext(t,e){return"context"in t}function callWithContext(t,e,i){return needsContext(t,i)&&i[0]!=null&&typeof i[0]=="object"&&(i[0].context=t.context),e(...i)}var CallbackCache=class{constructor(){this.cache=new WeakMap}call(t,e,...i){let s,n=this.cache.get(e);try{s=JSON.stringify(i)}catch{return this.invoke(t,e,i,n)}return n==null&&(n=new Map,this.cache.set(e,n)),n.has(s)?n.get(s):this.invoke(t,e,i,n,s)}invoke(t,e,i,s,n){try{const o=callWithContext(t,e,i);return s&&n!=null&&s.set(n,o),o}catch(o){logger_exports.warnOnce("User callback errored, ignoring",o);return}}invalidateCache(){this.cache=new WeakMap}},AnnotationManager=class extends BaseManager{constructor(t,e){super(),this.annotationRoot=t,this.fireChartEvent=e,this.mementoOriginatorKey="annotations",this.annotations=[]}createMemento(){return this.annotations}guardMemento(t){return t==null||isArray(t)}restoreMemento(t,e,i){this.annotations=this.cleanData(i??[]).map(s=>{const n=this.getAnnotationTypeStyles(s.type);return mergeDefaults(s,n)}),this.listeners.dispatch("restore-annotations",{type:"restore-annotations",annotations:this.annotations})}updateData(t){this.annotations=this.cleanData(t??[])}fireChangedEvent(){this.fireChartEvent({type:"annotations",annotations:deepClone([...this.annotations])})}attachNode(t){return this.annotationRoot.append(t),()=>(this.annotationRoot?.removeChild(t),this)}setAnnotationStyles(t){this.styles=t}getAnnotationTypeStyles(t){return this.styles?.[t]}cleanData(t){for(const e of t)"textAlign"in e&&delete e.textAlign;return t}},ZIndexMap=(t=>(t[t.CHART_BACKGROUND=0]="CHART_BACKGROUND",t[t.AXIS_GRID=1]="AXIS_GRID",t[t.AXIS=2]="AXIS",t[t.ZOOM_SELECTION=3]="ZOOM_SELECTION",t[t.SERIES_CROSSLINE_RANGE=4]="SERIES_CROSSLINE_RANGE",t[t.SERIES_LAYER=5]="SERIES_LAYER",t[t.AXIS_FOREGROUND=6]="AXIS_FOREGROUND",t[t.SERIES_CROSSHAIR=7]="SERIES_CROSSHAIR",t[t.SERIES_CROSSLINE_LINE=8]="SERIES_CROSSLINE_LINE",t[t.SERIES_ANNOTATION=9]="SERIES_ANNOTATION",t[t.CHART_ANNOTATION=10]="CHART_ANNOTATION",t[t.CHART_ANNOTATION_FOCUSED=11]="CHART_ANNOTATION_FOCUSED",t[t.STATUS_BAR=12]="STATUS_BAR",t[t.SERIES_LABEL=13]="SERIES_LABEL",t[t.LEGEND=14]="LEGEND",t[t.NAVIGATOR=15]="NAVIGATOR",t[t.FOREGROUND=16]="FOREGROUND",t))(ZIndexMap||{}),AxisManager=class{constructor(t){this.sceneRoot=t,this.axes=new Map,this.axisGridGroup=new Group({name:"Axes-Grids",zIndex:1}),this.axisGroup=new Group({name:"Axes",zIndex:2}),this.axisLabelGroup=new Group({name:"Axes-Labels",zIndex:13}),this.axisCrosslineRangeGroup=new Group({name:"Axes-Crosslines-Range",zIndex:4}),this.axisCrosslineLineGroup=new Group({name:"Axes-Crosslines-Line",zIndex:8}),this.axisCrosslineLabelGroup=new Group({name:"Axes-Crosslines-Label",zIndex:13}),this.sceneRoot.appendChild(this.axisGroup),this.sceneRoot.appendChild(this.axisGridGroup),this.sceneRoot.appendChild(this.axisLabelGroup),this.sceneRoot.appendChild(this.axisCrosslineRangeGroup),this.sceneRoot.appendChild(this.axisCrosslineLineGroup),this.sceneRoot.appendChild(this.axisCrosslineLabelGroup)}updateAxes(t,e){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const s of t)e.includes(s)||(s.detachAxis(i),s.destroy());for(const s of e)t?.includes(s)||s.attachAxis(i);this.axes.clear();for(const s of e){const n=s.createAxisContext();this.axes.has(n.direction)?this.axes.get(n.direction)?.push(n):this.axes.set(n.direction,[n])}}getAxisContext(t){return this.axes.get(t)??[]}destroy(){this.axes.clear(),this.sceneRoot.removeChild(this.axisGroup),this.sceneRoot.removeChild(this.axisGridGroup)}},DataService=class extends Listeners{constructor(t){super(),this.animationManager=t,this.dispatchOnlyLatest=!0,this.dispatchThrottle=0,this.requestThrottle=300,this.isLoadingInitialData=!1,this.isLoadingData=!1,this.freshRequests=[],this.requestCounter=0,this.debug=Debug.create(!0,"data-model","data-source"),this.throttledFetch=this.createThrottledFetch(this.requestThrottle),this.throttledDispatch=this.createThrottledDispatch(this.dispatchThrottle)}updateCallback(t){typeof t=="function"&&(this.debug("DataService - updated data source callback"),this.dataSourceCallback=t,this.isLoadingInitialData=!0,this.animationManager.skip(),this.dispatch("data-source-change"))}clearCallback(){this.dataSourceCallback=void 0}load(t){this.isLoadingData=!0,this.throttledFetch(t)}isLazy(){return this.dataSourceCallback!=null}isLoading(){return this.isLazy()&&(this.isLoadingInitialData||this.isLoadingData)}createThrottledFetch(t){return throttle(e=>this.fetch(e).catch(i=>logger_exports.error("callback failed",i)),t,{leading:!1,trailing:!0})}createThrottledDispatch(t){return throttle((e,i)=>{this.debug(`DataService - dispatching 'data-load' | ${e}`),this.dispatch("data-load",{type:"data-load",data:i})},t,{leading:!0,trailing:!0})}async fetch(t){if(!this.dataSourceCallback)throw new Error("DataService - [dataSource.getData] callback not initialised");const e=performance.now(),i=this.requestCounter++;this.debug(`DataService - requesting | ${i}`),this.freshRequests.push(i);let s;try{s=await this.dataSourceCallback(t),this.debug(`DataService - response | ${performance.now()-e}ms | ${i}`)}catch(o){this.debug(`DataService - request failed | ${i}`),logger_exports.errorOnce(`DataService - request failed | [${o}]`)}this.isLoadingInitialData=!1;const n=this.freshRequests.findIndex(o=>o===i);if(n===-1||this.dispatchOnlyLatest&&n!==this.freshRequests.length-1){this.debug(`DataService - discarding stale request | ${i}`);return}this.freshRequests=this.freshRequests.slice(n+1),this.freshRequests.length===0&&(this.isLoadingData=!1),Array.isArray(s)?this.throttledDispatch(i,s):this.dispatch("data-error")}};__decorateClass2([ActionOnSet({newValue(t){this.throttledDispatch=this.createThrottledDispatch(t)}})],DataService.prototype,"dispatchThrottle",2),__decorateClass2([ActionOnSet({newValue(t){this.throttledFetch=this.createThrottledFetch(t)}})],DataService.prototype,"requestThrottle",2);function interpolateNumber(t,e){return i=>Number(t)*(1-i)+Number(e)*i}function interpolateColor(t,e){if(typeof t=="string")try{t=Color.fromString(t)}catch{t=Color.fromArray([0,0,0])}if(typeof e=="string")try{e=Color.fromString(e)}catch{e=Color.fromArray([0,0,0])}return i=>Color.mix(t,e,i).toRgbaString()}var easing_exports={};__export3(easing_exports,{easeIn:()=>easeIn,easeInOut:()=>easeInOut,easeInOutQuad:()=>easeInOutQuad,easeInQuad:()=>easeInQuad,easeOut:()=>easeOut,easeOutQuad:()=>easeOutQuad,inverseEaseOut:()=>inverseEaseOut,linear:()=>linear});var linear=t=>t,easeIn=t=>1-Math.cos(t*Math.PI/2),easeOut=t=>Math.sin(t*Math.PI/2),easeInOut=t=>-(Math.cos(t*Math.PI)-1)/2,easeInQuad=t=>t*t,easeOutQuad=t=>1-(1-t)**2,easeInOutQuad=t=>t<.5?2*t*t:1-(-2*t+2)**2/2,inverseEaseOut=t=>2*Math.asin(t)/Math.PI,QUICK_TRANSITION=.2,PHASE_ORDER=["initial","remove","update","add","trailing","end","none"],PHASE_METADATA={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:QUICK_TRANSITION,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1+QUICK_TRANSITION,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}},RepeatType=(t=>(t.Loop="loop",t.Reverse="reverse",t))(RepeatType||{});function isNodeArray(t){return t.every(e=>e instanceof Node)}function deconstructSelectionsOrNodes(t){return isNodeArray(t)?{nodes:t,selections:[]}:{nodes:[],selections:t}}function animationValuesEqual(t,e){return t===e?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((i,s)=>animationValuesEqual(i,e[s])):isInterpolating(t)&&isInterpolating(e)?t.equals(e):isPlainObject(t)&&isPlainObject(e)?objectsEqualWith(t,e,animationValuesEqual):!1}var Animation=class{constructor(t){this.isComplete=!1,this.elapsed=0,this.iteration=0,this.isPlaying=!1,this.isReverse=!1,this.id=t.id,this.groupId=t.groupId,this.autoplay=t.autoplay??!0,this.ease=t.ease??linear,this.phase=t.phase;const e=t.duration??PHASE_METADATA[this.phase].animationDuration;this.duration=e*t.defaultDuration,this.delay=(t.delay??0)*t.defaultDuration,this.onComplete=t.onComplete,this.onPlay=t.onPlay,this.onStop=t.onStop,this.onUpdate=t.onUpdate,this.interpolate=this.createInterpolator(t.from,t.to),this.from=t.from,t.skip===!0&&(this.onUpdate?.(t.to,!1,this),this.onStop?.(this),this.onComplete?.(this),this.isComplete=!0),t.collapsable!==!1&&(this.duration=this.checkCollapse(t,this.duration))}checkCollapse(t,e){return animationValuesEqual(t.from,t.to)?0:e}play(t=!1){this.isPlaying||this.isComplete||(this.isPlaying=!0,this.onPlay?.(this),this.autoplay&&(this.autoplay=!1,t&&this.onUpdate?.(this.from,!0,this)))}stop(){this.isPlaying=!1,this.isComplete||(this.isComplete=!0,this.onStop?.(this))}update(t){if(this.isComplete)return t;!this.isPlaying&&this.autoplay&&this.play(!0);const e=this.elapsed;if(this.elapsed+=t,this.delay>this.elapsed)return 0;const i=this.interpolate(this.isReverse?1-this.delta:this.delta);this.onUpdate?.(i,!1,this);const s=this.delay+this.duration;return this.elapsed>=s?(this.stop(),this.isComplete=!0,this.onComplete?.(this),t-(s-e)):0}get delta(){return this.ease(clamp(0,(this.elapsed-this.delay)/this.duration,1))}createInterpolator(t,e){if(typeof e!="object"||isInterpolating(e))return this.interpolateValue(t,e);const i=[];for(const s of Object.keys(e)){const n=this.interpolateValue(t[s],e[s]);n!=null&&i.push([s,n])}return s=>{const n={};for(const[o,a]of i)n[o]=a(s);return n}}interpolateValue(t,e){if(!(t==null||e==null)){if(isInterpolating(t))return i=>t[interpolate](e,i);try{switch(typeof t){case"number":return interpolateNumber(t,e);case"string":return interpolateColor(t,e);case"boolean":if(t===e)return()=>t;break;case"object":return()=>t}}catch{}throw new Error(`Unable to interpolate values: ${t}, ${e}`)}}},AnimationBatch=class{constructor(t){this.maxAnimationTime=t,this.debug=Debug.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(PHASE_ORDER.map(e=>[e,[]])),this.skipAnimations=!1,this.animationTimeConsumed=0,this.isReady=!1}get size(){return this.controllers.size}get consumedTimeMs(){return this.animationTimeConsumed}isActive(){return this.controllers.size>0}getActiveControllers(){return this.phases.get(PHASE_ORDER[this.currentPhase])??[]}checkOverlappingId(t){t!=null&&this.controllers.has(t)&&(this.controllers.get(t).stop(),this.debug(`Skipping animation batch due to update of existing animation: ${t}`),this.skip())}addAnimation(t){if(t.isComplete)return;if(PHASE_ORDER.indexOf(t.phase)<this.currentPhase){this.debug("Skipping animation due to being for an earlier phase",t.id),t.stop();return}this.controllers.set(t.id,t),this.phases.get(t.phase)?.push(t)}removeAnimation(t){this.controllers.delete(t.id);const e=this.phases.get(t.phase),i=e?.indexOf(t);i!=null&&i>=0&&e?.splice(i,1)}progress(t){if(!this.isReady)return;let e=t===0?.01:t;const i=()=>{const c=PHASE_ORDER[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:c,phaseMeta:PHASE_METADATA[c]}};let{phase:s,phaseControllers:n,phaseMeta:o}=i();const a=()=>PHASE_ORDER[this.currentPhase]==null,r=()=>{for({phase:s,phaseControllers:n,phaseMeta:o}=i();!a()&&n.length===0;)this.currentPhase++,{phase:s,phaseControllers:n,phaseMeta:o}=i(),this.debug(`AnimationBatch - phase changing to ${s}`,{unusedTime:e},n)},l=this.controllers.size;this.debug(`AnimationBatch - ${t}ms; phase ${s} with ${n?.length} of ${l}`);do{const c=e,h=o.skipIfNoEarlierAnimations&&this.animationTimeConsumed===0;let d=0;for(const u of n)h?u.stop():e=Math.min(u.update(c),e),u.isComplete&&(d++,this.removeAnimation(u));this.animationTimeConsumed+=c-e,this.debug(`AnimationBatch - updated ${n.length} controllers; ${d} completed`),this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`),r()}while(e>0&&!a());this.animationTimeConsumed>this.maxAnimationTime&&(this.debug("Animation batch exceeded max animation time, skipping",[...this.controllers]),this.stop())}ready(){if(this.isReady)return;this.isReady=!0,this.debug(`AnimationBatch - ready; skipped: ${this.skipAnimations}`,[...this.controllers]);let t=!0;for(const[,e]of this.controllers)if(e.duration>0&&PHASE_METADATA[e.phase].skipIfNoEarlierAnimations!==!0){t=!1;break}if(!t)for(const[,e]of this.controllers)e.autoplay&&e.play(!0)}skip(t=!0){if(this.skipAnimations===!1&&t===!0){for(const e of this.controllers.values())e.stop();this.controllers.clear()}this.skipAnimations=t}play(){for(const t of this.controllers.values())t.play()}stop(){for(const t of this.controllers.values())try{t.stop(),this.removeAnimation(t)}catch(e){logger_exports.error("Error during animation stop",e)}this.dispatchStopped()}stopByAnimationId(t){if(t!=null&&this.controllers.has(t)){const e=this.controllers.get(t);e&&(e.stop(),this.removeAnimation(e))}}stopByAnimationGroupId(t){for(const e of this.controllers.values())e.groupId===t&&this.stopByAnimationId(e.id)}dispatchStopped(){this.stoppedCbs.forEach(t=>t()),this.stoppedCbs.clear()}isSkipped(){return this.skipAnimations}destroy(){this.stop(),this.controllers.clear()}},InteractionState=(t=>(t[t.Default=32]="Default",t[t.ZoomDrag=16]="ZoomDrag",t[t.Annotations=8]="Annotations",t[t.ContextMenu=4]="ContextMenu",t[t.Animation=2]="Animation",t[t.AnnotationsSelected=1]="AnnotationsSelected",t[t.Clickable=41]="Clickable",t[t.Focusable=34]="Focusable",t[t.Keyable=43]="Keyable",t[t.ContextMenuable=36]="ContextMenuable",t[t.AnnotationsMoveable=9]="AnnotationsMoveable",t[t.AnnotationsDraggable=57]="AnnotationsDraggable",t[t.ZoomDraggable=50]="ZoomDraggable",t[t.ZoomClickable=34]="ZoomClickable",t[t.ZoomWheelable=59]="ZoomWheelable",t[t.All=63]="All",t))(InteractionState||{}),InteractionManager=class{constructor(){this.stateQueue=34}pushState(t){this.stateQueue|=t}popState(t){this.stateQueue&=~t}isState(t){return!!(this.stateQueue&-this.stateQueue&t)}};function validAnimationDuration(t){return t==null?!0:!isNaN(t)&&t>=0&&t<=2}var AnimationManager=class{constructor(t,e){this.interactionManager=t,this.chartUpdateMutex=e,this.defaultDuration=1e3,this.batch=new AnimationBatch(this.defaultDuration*1.5),this.debug=Debug.create(!0,"animation"),this.events=new EventEmitter,this.rafAvailable=typeof requestAnimationFrame<"u",this.isPlaying=!0,this.requestId=null,this.skipAnimations=!0,this.currentAnonymousAnimationId=0}addListener(t,e){return this.events.on(t,e)}animate(t){const e=this.batch;try{e.checkOverlappingId(t.id)}catch(r){this.failsafeOnError(r);return}let{id:i}=t;i==null&&(i=`__${this.currentAnonymousAnimationId}`,this.currentAnonymousAnimationId+=1);const s=this.isSkipped()||t.phase==="none";s&&this.debug("AnimationManager - skipping animation");const{delay:n,duration:o}=t;if(!validAnimationDuration(n))throw new Error(`Animation delay of ${n} is unsupported (${i})`);if(!validAnimationDuration(o))throw new Error(`Animation duration of ${o} is unsupported (${i})`);const a=new Animation({...t,id:i,skip:s,autoplay:this.isPlaying?t.autoplay:!1,phase:t.phase,defaultDuration:this.defaultDuration});if(!this.forceTimeJump(a,this.defaultDuration))return this.batch.addAnimation(a),a}play(){if(!this.isPlaying){this.isPlaying=!0,this.debug("AnimationManager.play()");try{this.batch.play()}catch(t){this.failsafeOnError(t)}this.requestAnimation()}}stop(){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.stop()"),this.batch.stop()}stopByAnimationId(t){try{this.batch.stopByAnimationId(t)}catch(e){this.failsafeOnError(e)}}stopByAnimationGroupId(t){try{this.batch.stopByAnimationGroupId(t)}catch(e){this.failsafeOnError(e)}}reset(){this.isPlaying?(this.stop(),this.play()):this.stop()}skip(t=!0){this.skipAnimations=t}isSkipped(){return!this.rafAvailable||this.skipAnimations||this.batch.isSkipped()}isActive(){return this.isPlaying&&this.batch.isActive()}skipCurrentBatch(){this.debug.check()&&this.debug("AnimationManager - skipCurrentBatch()",{stack:new Error().stack}),this.batch.skip()}isSkippingFrames(){return!0}scheduleAnimationFrame(t){this.requestId=getWindow().requestAnimationFrame(e=>{t(e).catch(i=>logger_exports.error(i))})}forceTimeJump(t,e){return!1}requestAnimation(){if(!this.rafAvailable||!this.batch.isActive()||this.requestId!==null)return;let t;const e=async i=>{const s=()=>{const n=i-(t??i);t=i,this.debug("AnimationManager - onAnimationFrame()",{controllersCount:this.batch.size,deltaTime:n}),this.interactionManager.pushState(2);try{this.batch.progress(n)}catch(o){this.failsafeOnError(o)}this.events.emit("animation-frame",{type:"animation-frame",deltaMs:n})};this.isSkippingFrames()?await this.chartUpdateMutex.acquireImmediately(s):await this.chartUpdateMutex.acquire(s),this.batch.isActive()?this.scheduleAnimationFrame(e):(this.batch.stop(),this.events.emit("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}))};this.events.emit("animation-start",{type:"animation-start",deltaMs:0}),this.scheduleAnimationFrame(e)}cancelAnimation(){this.requestId!==null&&(cancelAnimationFrame(this.requestId),this.requestId=null,this.startBatch())}failsafeOnError(t,e=!0){logger_exports.error("Error during animation, skipping animations",t),e&&this.cancelAnimation()}startBatch(t){this.debug(`AnimationManager - startBatch() with skipAnimations=${t}.`),this.reset(),this.batch.destroy(),this.batch=new AnimationBatch(this.defaultDuration*1.5),t===!0&&this.batch.skip()}endBatch(){this.batch.isActive()?(this.batch.ready(),this.requestAnimation()):(this.interactionManager.popState(2),this.batch.isSkipped()&&this.batch.skip(!1))}onBatchStop(t){this.batch.stoppedCbs.add(t)}destroy(){this.stop(),this.events.clear()}},ChartEventManager=class extends BaseManager{seriesEvent(t){this.listeners.dispatch(t,{type:t})}seriesKeyNavZoom(t,e){const i={type:"series-keynav-zoom",delta:t,widgetEvent:e};this.listeners.dispatch("series-keynav-zoom",i)}legendItemClick(t,e,i,s,n){const o={type:"legend-item-click",legendType:t,series:e,itemId:i,enabled:s,legendItemName:n};this.listeners.dispatch("legend-item-click",o)}legendItemDoubleClick(t,e,i,s,n,o){const a={type:"legend-item-double-click",legendType:t,series:e,itemId:i,enabled:s,legendItemName:o,numVisibleItems:n};this.listeners.dispatch("legend-item-double-click",a)}},ContextMenuRegistry=class{constructor(){this.defaultActions=[],this.disabledActions=new Set,this.hiddenActions=new Set,this.listeners=new Listeners}static check(t,e){return e.type===t}static checkCallback(t,e,i){return t===e}dispatchContext(t,e,i,s){const{sourceEvent:n}=e;if(n.defaultPrevented)return;const o=s?.x??e.canvasX,a=s?.y??e.canvasY,r={type:t,x:o,y:a,context:i,sourceEvent:n};this.listeners.dispatch("",r)}addListener(t){return this.listeners.addListener("",t)}filterActions(t){return this.defaultActions.filter(e=>e.id!=null&&!this.hiddenActions.has(e.id)&&["all",t].includes(e.type))}registerDefaultAction(t){const e=t.id!=null&&!this.defaultActions.some(({id:i})=>i===t.id);return e&&this.defaultActions.push(t),()=>{const i=e?this.defaultActions.findIndex(({id:s})=>s===t.id):-1;i!==-1&&this.defaultActions.splice(i,1)}}enableAction(t){this.disabledActions.delete(t)}disableAction(t){this.disabledActions.add(t)}showAction(t){this.hiddenActions.add(t)}hideAction(t){this.hiddenActions.delete(t)}isDisabled(t){return this.disabledActions.has(t)}},HighlightManager=class extends BaseManager{constructor(){super(...arguments),this.highlightStates=new StateTracker}updateHighlight(t,e){const{activeHighlight:i}=this;this.highlightStates.set(t,e),this.activeHighlight=this.highlightStates.stateValue(),this.isEqual(this.activeHighlight,i)||this.listeners.dispatch("highlight-change",{type:"highlight-change",currentHighlight:this.activeHighlight,previousHighlight:i,callerId:t})}getActiveHighlight(){return this.activeHighlight}isEqual(t,e){return t===e||t!=null&&e!=null&&t?.series===e?.series&&t?.itemId===e?.itemId&&t?.datum===e?.datum}};function datumBoundaryPoints(t,e){if(t==null||e.length===0)return[!1,!1];const i=t.valueOf(),s=e[0],n=e[e.length-1];if(typeof s=="string")return[i===s,i===n];let o=s.valueOf(),a=n.valueOf();return o>a&&([o,a]=[a,o]),[i===o,i===a]}function datumStylerProperties(t,e,i,s,n){const{xValue:o,yValue:a}=t,[r,l]=datumBoundaryPoints(a,n),[c,h]=datumBoundaryPoints(o,s);return{xKey:e,yKey:i,xValue:o,yValue:a,first:c,last:h,min:r,max:l}}function visibleRangeIndices(t,[e,i],s){const n=findMinIndex(0,t-1,a=>{const r=s(a)?.[1]??NaN;return!Number.isFinite(r)||r>e})??0;let o=findMaxIndex(0,t-1,a=>{const r=s(a)?.[0]??NaN;return!Number.isFinite(r)||r<i})??t-1;return o=Math.min(o+1,t),[n,o]}function getDatumRefPoint(t,e,i){if(i){const{x:n,y:o,width:a,height:r}=i;return{canvasX:n+a/2,canvasY:o+r/2}}const s=e.yBar?.upperPoint??e.midPoint??t.datumMidPoint?.(e);if(s){const{x:n,y:o}=Transformable.toCanvasPoint(t.contentGroup,s.x,s.y);return{canvasX:Math.round(n),canvasY:Math.round(o)}}}function countExpandingSearch(t,e,i,s,n){let o=-1,a=0,r=0,l=!1;for(;a<s&&o<=e-t;){o+=1;const c=i+r;if(l||(r*=-1),r>=0&&(r+=1),l&&r<0&&(r-=1),c<t||c>e){l=!0;continue}n(c)&&(a+=1)}return a}var TooltipManager=class{constructor(t,e,i){this.domManager=e,this.tooltip=i,this.stateTracker=new StateTracker,this.suppressState=new StateTracker(!1),this.appliedState=null,this.destroyFns=[],this.destroyFns.push(i.setup(t,e),e.addListener("hidden",()=>this.tooltip.hide()))}destroy(){this.destroyFns.forEach(t=>t())}updateTooltip(t,e,i,s){i??(i=this.stateTracker.get(t)?.content),this.stateTracker.set(t,{meta:e,content:i,pagination:s}),this.applyStates()}removeTooltip(t){this.stateTracker.delete(t),this.applyStates()}suppressTooltip(t){this.suppressState.set(t,!0)}unsuppressTooltip(t){this.suppressState.delete(t)}applyStates(){const t=this.stateTracker.stateId(),e=t?this.stateTracker.get(t):void 0;if(this.suppressState.stateValue()||e?.meta==null||e?.content==null){this.appliedState=null,this.tooltip.hide();return}const i=this.domManager.getBoundingClientRect(),s=this.tooltip.bounds==="extended"?this.domManager.getOverlayClientRect():i;if(this.appliedState?.content===e?.content){const n=this.tooltip.isVisible();this.tooltip.show(s,i,e?.meta,null,void 0,n)}else this.tooltip.show(s,i,e?.meta,e?.content,e?.pagination);this.appliedState=e}static makeTooltipMeta(t,e,i,s){const{canvasX:n,canvasY:o}=t,a=e.properties.tooltip,{placement:r,defaultPlacement:l,anchorTo:c,defaultAnchorTo:h,xOffset:d,yOffset:u}=a.position,p=getDatumRefPoint(e,i,s);return{canvasX:n,canvasY:o,nodeCanvasX:p?.canvasX??n,nodeCanvasY:p?.canvasY??o,enableInteraction:a.interaction?.enabled??!1,showArrow:a.showArrow,position:{placement:r,defaultPlacement:l,anchorTo:c,defaultAnchorTo:h,xOffset:d,yOffset:u}}}isEnteringInteractiveTooltip(t){const{tooltip:e}=this,i=t.relatedTarget;return e.interactive&&e.enabled&&e.isVisible()&&e.contains(i)}},DRAG_THRESHOLD_PX=3,DOUBLE_TAP_TIMER_MS=505,DOUBLE_TAP_THRESHOLD_PX=30;function makeSynthetic(t,e,i){const{offsetX:s,offsetY:n,clientX:o,clientY:a,currentX:r,currentY:l,sourceEvent:c}=i;return{type:e,device:t,offsetX:s,offsetY:n,clientX:o,clientY:a,currentX:r,currentY:l,sourceEvent:c}}function checkDragDistance(t,e){const i=t*t+e*e,s=DRAG_THRESHOLD_PX*DRAG_THRESHOLD_PX;return i>=s}function checkDoubleTapDistance(t,e){const i=t.clientX-e.clientX,s=t.clientY-e.clientY,n=i*i+s*s,o=DOUBLE_TAP_THRESHOLD_PX*DOUBLE_TAP_THRESHOLD_PX;return n<o}var DragInterpreter=class{constructor(t){this.destroyFns=[],this.listeners=new Listeners,this.isDragging=!1,this.touch={distanceTravelledX:0,distanceTravelledY:0,clientX:0,clientY:0},this.destroyFns.push(t.addListener("touchstart",this.onTouchStart.bind(this)),t.addListener("touchmove",this.onTouchMove.bind(this)),t.addListener("touchend",this.onTouchEnd.bind(this)),t.addListener("mousemove",this.onMouseMove.bind(this)),t.addListener("dblclick",this.onDblClick.bind(this)),t.addListener("drag-start",this.onDragStart.bind(this)),t.addListener("drag-move",this.onDragMove.bind(this)),t.addListener("drag-end",this.onDragEnd.bind(this)))}destroy(){this.destroyFns.forEach(t=>t()),this.listeners.destroy()}addListener(t,e){return this.listeners.addListener(t,e)}dispatch(t){this.listeners.dispatch(t.type,t)}onTouchStart(t){const{clientX:e,clientY:i}=t.sourceEvent.targetTouches[0]??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX=0,this.touch.distanceTravelledY=0,this.touch.clientX=e,this.touch.clientY=i}onTouchMove(t){const{clientX:e,clientY:i}=t.sourceEvent.targetTouches[0]??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX+=Math.abs(this.touch.clientX-e),this.touch.distanceTravelledY+=Math.abs(this.touch.clientY-i),this.touch.clientX=e,this.touch.clientY=i}onTouchEnd(t){t.sourceEvent.preventDefault()}onMouseMove(t){this.dispatch(t)}onDblClick(t){this.dispatch({device:"mouse",...t})}onDragStart(t){this.dragStartEvent=t}onDragMove(t){this.dragStartEvent!=null&&checkDragDistance(t.originDeltaX,t.originDeltaY)&&(this.dispatch(this.dragStartEvent),this.dispatch({...this.dragStartEvent,type:"drag-move"}),this.dragStartEvent=void 0,this.isDragging=!0),this.isDragging&&this.dispatch(t)}onDragEnd(t){if(this.isDragging){this.dispatch(t),this.isDragging=!1;return}if(t.device==="mouse"){const e=makeSynthetic("mouse","click",t);this.dispatch(e)}else if(t.sourceEvent.type==="touchend"){if(checkDragDistance(this.touch.distanceTravelledX,this.touch.distanceTravelledY))return;const e=makeSynthetic("touch","click",t);this.dispatch(e);const i=Date.now();if(this.lastClick!==void 0&&i-this.lastClick.time<=DOUBLE_TAP_TIMER_MS&&checkDoubleTapDistance(this.lastClick,t)){const s=makeSynthetic(t.device,"dblclick",t);this.dispatch(s),this.lastClick=void 0}else this.lastClick={time:i,clientX:t.clientX,clientY:t.clientY}}}},DOMManagerWidget=class extends NativeWidget{constructor(t){super(t)}addChildToDOM(){}removeChildFromDOM(){}},WidgetSet=class{constructor(t){this.seriesWidget=new DOMManagerWidget(t.getParent("series-area")),this.chartWidget=new DOMManagerWidget(t.getParent("canvas-proxy")),this.containerWidget=new DOMManagerWidget(t.getParent("canvas-container")),this.containerWidget.addChild(this.chartWidget),this.chartWidget.addChild(this.seriesWidget),this.seriesDragInterpreter=new DragInterpreter(this.seriesWidget)}destroy(){this.seriesDragInterpreter.destroy(),this.seriesWidget.destroy(),this.chartWidget.destroy(),this.containerWidget.destroy()}};function clampArray(t,e){const[i,s]=findMinMax(e);return clamp(i,t,s)}function findMinMax(t){if(t.length===0)return[];const e=[1/0,-1/0];for(const i of t)i<e[0]&&(e[0]=i),i>e[1]&&(e[1]=i);return e}function findRangeExtent(t){const[e,i]=findMinMax(t);return i-e}var _ContinuousScale=class Yt extends AbstractScale{constructor(e=[],i=[]){super(),this.domain=e,this.range=i,this.defaultClamp=!1}static is(e){return e instanceof Yt}normalizeDomains(...e){let i,s=1/0,n,o=-1/0;for(const a of e)for(const r of a){const l=r.valueOf();l<s&&(s=l,i=r),l>o&&(o=l,n=r)}return i!=null&&n!=null?{domain:[i,n],animatable:!0}:{domain:[],animatable:!1}}transform(e){return e}transformInvert(e){return e}calcBandwidth(e=1){const{domain:i}=this,s=this.getPixelRange();if(i.length===0)return s;const n=Math.abs(i[1].valueOf()-i[0].valueOf())/e+1,o=Math.floor(s),a=Math.min(n,o);return s/Math.max(1,a)}convert(e,i=this.defaultClamp){const{domain:s}=this;if(!s||s.length<2)return NaN;const n=Number(this.transform(s[0])),o=Number(this.transform(s[1])),a=Number(this.transform(e)),{range:r}=this,[l,c]=r;if(i){const[h,d]=findMinMax([n,o]);if(a<h)return l;if(a>d)return c}return n===o?(l+c)/2:a===n?l:a===o?c:l+(a-n)/(o-n)*(c-l)}invert(e,i){const s=this.domain.map(h=>this.transform(h)),[n,o]=s,{range:a}=this,[r,l]=a;let c;return r===l?c=this.toDomain((Number(n)+Number(o))/2):c=this.toDomain(Number(n)+(e-r)/(l-r)*(Number(o)-Number(n))),this.transformInvert(c)}getPixelRange(){const[e,i]=this.range;return Math.abs(i-e)}};_ContinuousScale.defaultTickCount=5;var ContinuousScale=_ContinuousScale;function compareDates(t,e){return t.valueOf()-e.valueOf()}function deduplicateSortedArray(t){let e=NaN;const i=[];for(const s of t){const n=s.valueOf();e!==n&&i.push(s),e=n}return i}function sortAndUniqueDates(t){const e=t.slice().sort(compareDates);return datesSortOrder(e)==null?deduplicateSortedArray(e):e}function datesSortOrder(t){if(t.length===0)return 1;const e=Number(t[t.length-1])>Number(t[0])?1:-1;let i=-1/0*e;for(const s of t){const n=s.valueOf();if(Math.sign(n-i)!==e)return;i=n}return e}var CONSTANTS={periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]};function dayOfYear(t,e=new Date(t.getFullYear(),0,1)){const i=t.getTimezoneOffset()-e.getTimezoneOffset(),s=t.getTime()-e.getTime()+i*6e4,n=36e5*24;return Math.floor(s/n)}function weekOfYear(t,e){const s=new Date(t.getFullYear(),0,1).getDay(),n=(e-s+7)%7,o=new Date(t.getFullYear(),0,n+1);return o<=t?Math.floor(dayOfYear(t,o)/7)+1:0}var SUNDAY=0,MONDAY=1,THURSDAY=4;function isoWeekOfYear(t,e=t.getFullYear()){const s=new Date(e,0,1).getDay(),n=(THURSDAY-s+7)%7,o=new Date(e,0,n-(THURSDAY-MONDAY)+1);return o<=t?Math.floor(dayOfYear(t,o)/7)+1:isoWeekOfYear(t,e-1)}function timezone(t){const e=t.getTimezoneOffset(),i=Math.abs(e);return`${e>0?"-":"+"}${pad(Math.floor(i/60),2,"0")}${pad(Math.floor(i%60),2,"0")}`}var FORMATTERS={a:t=>CONSTANTS.shortDays[t.getDay()],A:t=>CONSTANTS.days[t.getDay()],b:t=>CONSTANTS.shortMonths[t.getMonth()],B:t=>CONSTANTS.months[t.getMonth()],c:"%x, %X",d:(t,e)=>pad(t.getDate(),2,e??"0"),e:"%_d",f:(t,e)=>pad(t.getMilliseconds()*1e3,6,e??"0"),H:(t,e)=>pad(t.getHours(),2,e??"0"),I:(t,e)=>{const i=t.getHours()%12;return i===0?"12":pad(i,2,e??"0")},j:(t,e)=>pad(dayOfYear(t)+1,3,e??"0"),m:(t,e)=>pad(t.getMonth()+1,2,e??"0"),M:(t,e)=>pad(t.getMinutes(),2,e??"0"),L:(t,e)=>pad(t.getMilliseconds(),3,e??"0"),p:t=>t.getHours()<12?"AM":"PM",Q:t=>String(t.getTime()),s:t=>String(Math.floor(t.getTime()/1e3)),S:(t,e)=>pad(t.getSeconds(),2,e??"0"),u:t=>{let e=t.getDay();return e<1&&(e+=7),String(e%7)},U:(t,e)=>pad(weekOfYear(t,SUNDAY),2,e??"0"),V:(t,e)=>pad(isoWeekOfYear(t),2,e??"0"),w:(t,e)=>pad(t.getDay(),2,e??"0"),W:(t,e)=>pad(weekOfYear(t,MONDAY),2,e??"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(t,e)=>pad(t.getFullYear()%100,2,e??"0"),Y:(t,e)=>pad(t.getFullYear(),4,e??"0"),Z:t=>timezone(t),"%":()=>"%"},PADS={_:" ",0:"0","-":""};function pad(t,e,i){const s=String(Math.floor(t));return s.length>=e?s:`${i.repeat(e-s.length)}${s}`}function buildFormatter(t){const e=[];for(;t.length>0;){let i=t.indexOf("%");if(i!==0){const r=i>0?t.substring(0,i):t;e.push(r)}if(i<0)break;const s=t[i+1],n=PADS[s];n!=null&&i++;const o=t[i+1],a=FORMATTERS[o];if(typeof a=="function")e.push([a,n]);else if(typeof a=="string"){const r=buildFormatter(a);e.push([r,n])}else e.push(`${n??""}${o}`);t=t.substring(i+2)}return i=>{const s=typeof i=="number"?new Date(i):i;return e.map(n=>typeof n=="string"?n:n[0](s,n[1])).join("")}}var time_exports={};__export3(time_exports,{TimeInterval:()=>TimeInterval,day:()=>day,friday:()=>friday,hour:()=>hour,millisecond:()=>millisecond,minute:()=>minute,monday:()=>monday,month:()=>month,saturday:()=>saturday,second:()=>second,sunday:()=>sunday,thursday:()=>thursday,tuesday:()=>tuesday,utcDay:()=>utcDay,utcHour:()=>utcHour,utcMinute:()=>utcMinute,utcMonth:()=>utcMonth,utcYear:()=>utcYear,wednesday:()=>wednesday,year:()=>year});var TimeInterval=class{constructor(t,e,i){this._encode=t,this._decode=e,this._rangeCallback=i}floor(t){const e=new Date(t),i=this._encode(e);return this._decode(i)}ceil(t){const e=new Date(Number(t)-1),i=this._encode(e);return this._decode(i+1)}range(t,e,{extend:i=!1,visibleRange:s=[0,1]}={}){let n=!1;t.getTime()>e.getTime()&&([t,e]=[e,t],n=!0);const o=this._rangeCallback?.(t,e),a=this._encode(i?this.floor(t):this.ceil(t)),r=this._encode(i?this.ceil(e):this.floor(e));if(r<a)return[];const l=r-a;let c,h;n?(c=Math.ceil(a+(1-s[1])*l),h=Math.floor(a+(1-s[0])*l)):(c=Math.floor(a+s[0]*l),h=Math.ceil(a+s[1]*l));const d=[];for(let u=c;u<=h;u+=1){const p=this._decode(u);d.push(p)}return o?.(),d}},CountableTimeInterval=class extends TimeInterval{getOffset(t,e){return Math.floor(this._encode(new Date(t)))%e}every(t,e){let i=0,s;const n=t;t=Math.max(1,Math.round(t)),n!==t&&logger_exports.warnOnce(`interval step of [${n}] rounded to [${t}].`);const{snapTo:o="start"}=e??{};if(typeof o=="string"){const l=i;s=(c,h)=>{const d=o==="start"?c:h;return i=this.getOffset(d,t),()=>i=l}}else typeof o=="number"?i=this.getOffset(new Date(o),t):o instanceof Date&&(i=this.getOffset(o,t));const a=l=>Math.floor((this._encode(l)-i)/t),r=l=>this._decode(l*t+i);return new TimeInterval(a,r,s)}};function encode(t){return t.getTime()}function decode(t){return new Date(t)}var millisecond=new CountableTimeInterval(encode,decode),durationSecond=1e3,durationMinute=durationSecond*60,durationHour=durationMinute*60,durationDay=durationHour*24,durationWeek=durationDay*7,durationMonth=durationDay*30,durationYear=durationDay*365,offset=new Date().getTimezoneOffset()*durationMinute;function encode2(t){return Math.floor((t.getTime()-offset)/durationSecond)}function decode2(t){return new Date(offset+t*durationSecond)}var second=new CountableTimeInterval(encode2,decode2),offset2=new Date().getTimezoneOffset()*durationMinute;function encode3(t){return Math.floor((t.getTime()-offset2)/durationMinute)}function decode3(t){return new Date(offset2+t*durationMinute)}var minute=new CountableTimeInterval(encode3,decode3),offset3=new Date().getTimezoneOffset()*durationMinute;function encode4(t){return Math.floor((t.getTime()-offset3)/durationHour)}function decode4(t){return new Date(offset3+t*durationHour)}var hour=new CountableTimeInterval(encode4,decode4);function encode5(t){const e=t.getTimezoneOffset()*durationMinute;return Math.floor((t.getTime()-e)/durationDay)}function decode5(t){const e=new Date(1970,0,1);return e.setDate(e.getDate()+t),e}var day=new CountableTimeInterval(encode5,decode5);function weekday(t){const i=(7+t-4)%7;function s(o){const a=o.getTimezoneOffset()*durationMinute;return Math.floor((o.getTime()-a)/durationWeek-i/7)}function n(o){const a=new Date(1970,0,1);return a.setDate(a.getDate()+o*7+i),a}return new CountableTimeInterval(s,n)}var sunday=weekday(0),monday=weekday(1),tuesday=weekday(2),wednesday=weekday(3),thursday=weekday(4),friday=weekday(5),saturday=weekday(6);function encode6(t){return t.getFullYear()*12+t.getMonth()}function decode6(t){const e=Math.floor(t/12),i=t-e*12;return new Date(e,i,1)}var month=new CountableTimeInterval(encode6,decode6);function encode7(t){return t.getFullYear()}function decode7(t){const e=new Date;return e.setFullYear(t),e.setMonth(0,1),e.setHours(0,0,0,0),e}var year=new CountableTimeInterval(encode7,decode7);function encode8(t){return Math.floor(t.getTime()/durationMinute)}function decode8(t){return new Date(t*durationMinute)}var utcMinute=new CountableTimeInterval(encode8,decode8);function encode9(t){return Math.floor(t.getTime()/durationHour)}function decode9(t){return new Date(t*durationHour)}var utcHour=new CountableTimeInterval(encode9,decode9);function encode10(t){return Math.floor(t.getTime()/durationDay)}function decode10(t){const e=new Date(0);return e.setUTCDate(e.getUTCDate()+t),e.setUTCHours(0,0,0,0),e}var utcDay=new CountableTimeInterval(encode10,decode10);function encode11(t){return t.getUTCFullYear()*12+t.getUTCMonth()}function decode11(t){const e=Math.floor(t/12),i=t-e*12;return new Date(Date.UTC(e,i,1))}var utcMonth=new CountableTimeInterval(encode11,decode11);function encode12(t){return t.getUTCFullYear()}function decode12(t){const e=new Date;return e.setUTCFullYear(t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0),e}var utcYear=new CountableTimeInterval(encode12,decode12);function dateToNumber(t){return t instanceof Date?t.getTime():t}function defaultTimeTickFormat(t,e,i){const s=calculateDefaultTimeTickFormat(t,e,i),n=buildFormatter(s);return o=>n(o)}function calculateDefaultTimeTickFormat(t,e,i=0){let s=1/0;for(let h=1;h<t.length;h++)s=Math.min(s,Math.abs(t[h].valueOf()-t[h-1].valueOf()));const[n,o]=e.length===0?[0,0]:findMinMax([e[0].valueOf(),e[e.length-1].valueOf()]),a=new Date(n).getFullYear(),l=new Date(o).getFullYear()-a>0,c=isFinite(s)?getIntervalLowestGranularityFormat(s,t):getLowestGranularityFormat(t[0]);return formatStringBuilder(Math.max(c-i,0),l,t)}function getIntervalLowestGranularityFormat(t,e){return t<durationSecond?0:t<durationMinute?1:t<durationHour?2:t<durationDay?3:t<durationWeek?4:t<durationDay*28||t<durationDay*31&&hasDuplicateMonth(e)?5:t<durationYear?6:7}function getLowestGranularityFormat(t){return second.floor(t)<t?0:minute.floor(t)<t?1:hour.floor(t)<t?2:day.floor(t)<t?3:month.floor(t)<t?sunday.floor(t)<t?4:5:year.floor(t)<t?6:7}function hasDuplicateMonth(t){let e=new Date(t[0]).getMonth();for(let i=1;i<t.length;i++){const s=new Date(t[i]).getMonth();if(e===s)return!0;e=s}return!1}function formatStringBuilder(t,e,i){const s=dateToNumber(i[0]),n=dateToNumber(i.at(-1)),o=Math.abs(n-s),a=e||t===7,r=o===0,c=[["hour",6*durationHour,14*durationDay,3,"%I %p"],["hour",durationMinute,6*durationHour,3,"%I:%M"],["second",1e3,6*durationHour,1,":%S"],["ms",0,6*durationHour,0,".%L"],["am/pm",durationMinute,6*durationHour,3,"%p"]," ",["day",durationDay,durationWeek,4,"%a"],["month",r?0:durationWeek,52*durationWeek,5,"%b %d"],["month",5*durationWeek,10*durationYear,6,"%B"]," ",["year",a?0:durationYear,1/0,7,"%Y"]].filter(u=>{if(typeof u=="string")return!0;const[p,g,f,m]=u;return m>=t&&g<=o&&o<f}).reduce((u,p)=>(typeof p=="string"?u.result.push(p):u.used.has(p[0])||(u.result.push(p),u.used.add(p[0])),u),{result:[],used:new Set}).result,h=c.findIndex(u=>typeof u!="string"),d=c.findLastIndex(u=>typeof u!="string");return c.slice(h,d+1).map(u=>typeof u=="string"?u:u[4]).join("").replaceAll(/\s+/g," ").trim()}function filterVisibleTicks(t,e,i){if(i==null||i[0]===0&&i[1]===1)return t;const s=clamp(0,Math.floor(i[0]*t.length),t.length),n=clamp(0,Math.ceil(i[1]*t.length),t.length),o=e?t.length-n:s,a=e?t.length-s:n;return t.slice(o,a)}var _BandScale=class Kt extends AbstractScale{constructor(){super(...arguments),this.invalid=!0,this.range=[0,1],this.round=!1,this.interval=void 0,this._bandwidth=1,this._step=1,this._inset=1,this._rawBandwidth=1,this._paddingInner=0,this._paddingOuter=0}static is(e){return e instanceof Kt}get bandwidth(){return this.refresh(),this._bandwidth}get step(){return this.refresh(),this._step}get inset(){return this.refresh(),this._inset}get rawBandwidth(){return this.refresh(),this._rawBandwidth}set padding(e){e=clamp(0,e,1),this._paddingInner=e,this._paddingOuter=e}get padding(){return this._paddingInner}set paddingInner(e){this.invalid=!0,this._paddingInner=clamp(0,e,1)}get paddingInner(){return this._paddingInner}set paddingOuter(e){this.invalid=!0,this._paddingOuter=clamp(0,e,1)}get paddingOuter(){return this._paddingOuter}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&logger_exports.warnOnce("Expected update to not invalidate scale"))}ticks(e,i=this.domain,s){return filterVisibleTicks(i,!1,s)}convert(e,i){this.refresh();const s=this.getIndex(e);return s==null||s<0||s>=this.domain.length?NaN:this.ordinalRange(s)}invertNearestIndex(e){this.refresh();const{domain:i}=this;if(i.length===0)return-1;let s=0,n=i.length-1,o=1/0,a=0;for(;s<=n;){const r=(n+s)/2|0,l=this.ordinalRange(r),c=Math.abs(l-e);if(c===0)return r;c<o&&(o=c,a=r),l<e?s=r+1:n=r-1}return a}update(){const e=this.domain.length;if(e===0)return;const[i,s]=this.range;let{_paddingInner:n}=this;const{_paddingOuter:o,round:a}=this,r=s-i;let l;e===1?(n=0,l=r*(1-o*2)):l=r/Math.max(1,e-n+o*2);const c=a?Math.floor(l):l;let h=i+(r-c*(e-n))/2,d=c*(1-n);a&&(h=Math.round(h),d=Math.round(d)),this._step=c,this._inset=h,this._bandwidth=d,this._rawBandwidth=l*(1-n)}ordinalRange(e){const{_inset:i,_step:s,range:n}=this,o=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return clamp(o,i+s*e,a)}};__decorateClass2([Invalidating],_BandScale.prototype,"range",2),__decorateClass2([Invalidating],_BandScale.prototype,"round",2),__decorateClass2([Invalidating],_BandScale.prototype,"interval",2);var BandScale=_BandScale,tInterval=(t,e,i)=>({duration:e*i,timeInterval:t,step:i}),TickIntervals=[tInterval(second,durationSecond,1),tInterval(second,durationSecond,5),tInterval(second,durationSecond,15),tInterval(second,durationSecond,30),tInterval(minute,durationMinute,1),tInterval(minute,durationMinute,5),tInterval(minute,durationMinute,15),tInterval(minute,durationMinute,30),tInterval(hour,durationHour,1),tInterval(hour,durationHour,3),tInterval(hour,durationHour,6),tInterval(hour,durationHour,12),tInterval(day,durationDay,1),tInterval(day,durationDay,2),tInterval(sunday,durationWeek,1),tInterval(sunday,durationWeek,2),tInterval(sunday,durationWeek,3),tInterval(month,durationMonth,1),tInterval(month,durationMonth,2),tInterval(month,durationMonth,3),tInterval(month,durationMonth,4),tInterval(month,durationMonth,6),tInterval(year,durationYear,1)],TickMultipliers=[1,2,5,10];function isCloseToInteger(t,e){return Math.abs(Math.round(t)-t)<e}function createTicks(t,e,i,s,n,o){if(i<2)return[t,e];const a=tickStep(t,e,i,s,n);if(!Number.isFinite(a))return[];if(isCloseToInteger(t/a,1e-12)||(t=Math.ceil(t/a)*a),isCloseToInteger(e/a,1e-12)||(e=Math.floor(e/a)*a),o!=null&&o[0]!==0&&o[1]!==1){const r=e-t,l=t+r*o[0],c=e-r*(1-o[1]);return range(l-l%a,c+c%a,a)}return range(t,e,a)}function getTickTimeInterval(t,e,i,s,n,o){const a=o??Math.abs(e-t)/Math.max(i,1);let r=0;for(const u of TickIntervals){if(a<=u.duration)break;r++}if(r===0){const u=Math.max(tickStep(t,e,i,s,n),1);return millisecond.every(u)}else if(r===TickIntervals.length){const u=o==null?tickStep(t/durationYear,e/durationYear,i,s,n):1;return year.every(u)}const l=TickIntervals[r-1],c=TickIntervals[r],{timeInterval:h,step:d}=a-l.duration<c.duration-a?l:c;return h.every(d)}function tickStep(t,e,i,s=0,n=1/0){if(t===e)return clamp(1,s,n);if(i<1)return NaN;const o=Math.abs(e-t),a=10**Math.floor(Math.log10(o/i));let r=NaN,l=1/0,c=!1;for(const h of TickMultipliers){const d=Math.ceil(o/(h*a)),u=d>=s&&d<=n;if(c&&!u)continue;const p=Math.abs(d-i);(l>p||c!==u)&&(c||(c=u),l=p,r=h)}return r*a}function decimalPlaces(t){for(let e=t.length-1;e>=0;e-=1)if(t[e]!=="0")return e+1;return 0}function tickFormat(t,e){const i=parseNumberFormat(e??",f");(i.precision==null||isNaN(i.precision))&&(!i.type||"eEFgGnprs".includes(i.type)?i.precision=Math.max(...t.map(n=>{if(!Number.isFinite(n))return 0;const[o,a]=n.toExponential((i.type?6:12)-1).split(/[.e]/g);return(o!=="1"&&o!=="-1"?1:0)+decimalPlaces(a)+1})):"f%".includes(i.type)&&(i.precision=Math.max(...t.map(n=>{if(!Number.isFinite(n)||n===0)return 0;const o=Math.floor(Math.log10(Math.abs(n))),a=i.type?6:12,r=n.toExponential(a-1).split(/[.e]/g)[1],l=decimalPlaces(r);return Math.max(0,l-o)}))));const s=createNumberFormatter(i);return n=>s(Number(n))}function range(t,e,i){if(!Number.isFinite(i)||i<=0)return[];const s=10**countFractionDigits(i),n=Math.min(t,e),o=Math.max(t,e),a=[];for(let r=0;;r+=1){const l=Math.round((n+i*r)*s)/s;if(l>o)break;a.push(l)}return a}function isDenseInterval(t,e){return t>=e?(logger_exports.warnOnce("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0):!1}function niceTicksDomain(t,e){const i=Math.abs(e-t),s=10**Math.floor(Math.log10(i));let n=1/0,o=[t,e];for(const a of TickMultipliers){const r=a*s,l=Math.floor(t/r)*r,c=Math.ceil(e/r)*r,h=1-i/Math.abs(c-l);n>h&&(n=h,o=[l,c])}return o}function estimateTickCount(t,e,i,s,n,o){if(t<=0)return{minTickCount:0,maxTickCount:0,tickCount:0};o=Math.max(o,t/(n+1)),i??(i=o),s??(s=t),i>s&&(i===o?i=s:s=i);const a=Math.max(1,Math.floor(t/(e*i))),r=Math.min(a,Math.ceil(t/(e*s))),l=clamp(r,Math.floor(n/e),a);return{minTickCount:r,maxTickCount:a,tickCount:l}}var TimeScale=class extends ContinuousScale{constructor(){super([],[0,1]),this.type="time"}toDomain(t){return new Date(t)}convert(t,e){return t instanceof Date||(t=new Date(t)),super.convert(t,e)}invert(t){return new Date(super.invert(t))}niceDomain(t,e=this.domain){if(e.length<2)return[];let[i,s]=e;const n=4,o=this.getPixelRange();for(let a=0;a<n;a++){const[r,l]=updateNiceDomainIteration(i,s,t,o);if(dateToNumber(i)===dateToNumber(r)&&dateToNumber(s)===dateToNumber(l))break;i=r,s=l}return[i,s]}ticks(t,e=this.domain,i=[0,1]){const{nice:s,interval:n,tickCount:o=ContinuousScale.defaultTickCount,minTickCount:a,maxTickCount:r}=t;if(e.length<2)return[];const l=e.map(dateToNumber),c=l[0],h=l[l.length-1];if(n!=null){const d=this.getPixelRange();return getDateTicksForInterval({start:c,stop:h,interval:n,availableRange:d,visibleRange:i})??getDefaultDateTicks({start:c,stop:h,tickCount:o,minTickCount:a,maxTickCount:r,visibleRange:i})}else{if(s&&o===2)return e;if(s&&o===1)return e.slice(0,1)}return getDefaultDateTicks({start:c,stop:h,tickCount:o,minTickCount:a,maxTickCount:r,visibleRange:i})}_tickFormatter({domain:t,ticks:e,specifier:i},s){return i!=null?buildFormatter(i):defaultTimeTickFormat(e,t,s)}tickFormatter(t){return this._tickFormatter(t)}datumFormatter(t){return this._tickFormatter(t,1)}};function getDefaultDateTicks({start:t,stop:e,tickCount:i,minTickCount:s,maxTickCount:n,visibleRange:o}){const a=getTickTimeInterval(t,e,i,s,n);return a?a.range(new Date(t),new Date(e),{visibleRange:o}):[]}function getDateTicksForInterval({start:t,stop:e,interval:i,availableRange:s,visibleRange:n}){if(!i)return[];if(i instanceof TimeInterval){const h=i.range(new Date(t),new Date(e),{visibleRange:n});return isDenseInterval(h.length,s)?void 0:h}const o=Math.abs(i);if(isDenseInterval(Math.abs(e-t)/o,s))return;const a=TickIntervals.findLast(h=>o%h.duration===0);if(a)return a.timeInterval.every(o/(a.duration/a.step)).range(new Date(t),new Date(e),{visibleRange:n});let r=new Date(Math.min(t,e));const l=new Date(Math.max(t,e)),c=[];for(;r<=l;)c.push(r),r=new Date(r),r.setMilliseconds(r.getMilliseconds()+o);return c}function updateNiceDomainIteration(t,e,i,s){const{interval:n}=i,o=Math.min(dateToNumber(t),dateToNumber(e)),a=Math.max(dateToNumber(t),dateToNumber(e));let r;if(n instanceof TimeInterval)r=n;else{let l;typeof n=="number"&&(l=(a-o)/Math.max(n,1),isDenseInterval(l,s)&&(l=null)),l??(l=i.tickCount??ContinuousScale.defaultTickCount),r=getTickTimeInterval(o,a,l,i.minTickCount,i.maxTickCount)}if(r){const l=r.range(new Date(o),new Date(a),{extend:!0});return t>e&&l.reverse(),[l[0],l.at(-1)]}else return[t,e]}var OrdinalTimeScale=class $t extends BandScale{constructor(){super(...arguments),this.type="ordinal-time",this._domain=[],this.isReversed=!1}static is(e){return e instanceof $t}set domain(e){e!==this._domain&&(this.invalid=!0,this._domain=e,this.isReversed=e.length>0&&e[0]>e[e.length-1],this.sortedTimestamps=void 0,this.precomputedSteps=void 0)}get domain(){return this._domain}toDomain(e){return new Date(e)}normalizeDomains(...e){const i=e.filter(s=>s.length>0);if(i.length===0)return{domain:[],animatable:!1};if(i.length===1){let s=i[0];const n=datesSortOrder(s);return n===-1?s=s.slice().reverse():n==null&&(s=sortAndUniqueDates(s.slice())),{domain:s,animatable:!0}}return{domain:sortAndUniqueDates(i.flat()),animatable:!0}}ticks({interval:e,maxTickCount:i},s=this.domain,n=[0,1]){if(!s.length)return[];this.refresh();const{isReversed:o}=this;if(e==null)return getDefaultTicks(s,i,o,n);const[a,r]=[s[0].valueOf(),s.at(-1).valueOf()],l=Math.min(a,r),c=Math.max(a,r),[h,d]=this.range,u=Math.abs(d-h),p=getDateTicksForInterval({start:l,stop:c,interval:e,availableRange:u,visibleRange:n})??getDefaultTicks(s,i,o,n);let g=-1;return p.filter(f=>{const m=this.findInterval(f.valueOf()),y=m===g;return g=m,!y})}getSortedTimestamps(){let{sortedTimestamps:e}=this;return e==null&&(e=this.domain.map(dateToNumber),this.isReversed&&e.reverse(),this.sortedTimestamps=e),e}getPrecomputedSteps(){const{domain:e}=this;let{precomputedSteps:i}=this;const s=e.length<1e4?e.length:Math.ceil(e.length/16);if(i!=null||s<=1)return i;const n=this.getSortedTimestamps();i=new Int32Array(s);const o=n[0],r=n[n.length-1]-o,l=0,c=n.length-1;for(let h=0;h<i.length;h+=1)i[h]=this.findIntervalInRange(o+h/s*r,l,c);this.precomputedSteps=i}findIntervalInRange(e,i,s){const n=this.getSortedTimestamps();for(;i<=s;){const o=(i+s)/2|0;if(n[o]===e)return o;n[o]<e?i=o+1:s=o-1}return i}findInterval(e){const i=this.getPrecomputedSteps();let s,n;if(i==null)s=0,n=this.domain.length-1;else{const o=this.getSortedTimestamps(),a=o[0],r=o[o.length-1],l=Math.min((e-a)/(r-a)*i.length|0,i.length-1|0);s=i[l],n=l<i.length-2?i[l+1]:o.length-1}return this.findIntervalInRange(e,s,n)}tickFormatter({domain:e,ticks:i,specifier:s}){return s!=null?buildFormatter(s):defaultTimeTickFormat(i,e)}datumFormatter(e){return this.tickFormatter(e)}invert(e,i=!1){this.refresh();const{domain:s}=this;if(i){const o=this.invertNearestIndex(e-this.bandwidth/2);return o!=null?s[o]:void 0}return findMinValue(0,s.length-1,o=>this.ordinalRange(o)>=e?s[o]:void 0)??s[0]}getIndex(e){const i=this.getSortedTimestamps(),s=Number(e);if(s<i[0])return;let n=this.findInterval(s);return this.isReversed&&(n=this.domain.length-n-1),n}};function getDefaultTicks(t,e,i,s){const n=[],o=Math.ceil(t.length/e),a=Math.floor(o/2),r=Math.floor(s[0]*t.length),l=Math.ceil(s[1]*t.length);for(let c=r;c<l;c+=1){const h=i?t.length-1-c:c;(o<=0||(h+a)%o===0)&&n.push(t[c])}return i&&n.reverse(),n}var Vec4={bottomCenter,center,clone,collides,end,from,height,round:round2,start,topCenter,origin,width};function start(t){return{x:t.x1,y:t.y1}}function end(t){return{x:t.x2,y:t.y2}}function topCenter(t){return{x:(t.x1+t.x2)/2,y:Math.min(t.y1,t.y2)}}function center(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function bottomCenter(t){return{x:(t.x1+t.x2)/2,y:Math.max(t.y1,t.y2)}}function width(t){return Math.abs(t.x2-t.x1)}function height(t){return Math.abs(t.y2-t.y1)}function round2(t){return{x1:Math.round(t.x1),y1:Math.round(t.y1),x2:Math.round(t.x2),y2:Math.round(t.y2)}}function clone(t){return{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}}function collides(t,e){const i=normalise(t),s=normalise(e);return i.x1<=s.x2&&i.x2>=s.x1&&i.y1<=s.y2&&i.y2>=s.y1}function normalise(t){return{x1:Math.min(t.x1,t.x2),x2:Math.max(t.x1,t.x2),y1:Math.min(t.y1,t.y2),y2:Math.max(t.y1,t.y2)}}function from(t,e,i,s){if(typeof t=="number")return{x1:t,y1:e,x2:i,y2:s};if("width"in t)return normalise({x1:t.x,y1:t.y,x2:t.x+t.width,y2:t.y+t.height});throw new Error(`Values can not be converted into a vector4: [${JSON.stringify(t)}] [${e}] [${i}] [${s}]`)}function origin(){return{x1:0,y1:0,x2:0,y2:0}}function normalize2(t,e,i,s,n){return e+(s-e)*((n-t)/(i-t))}function unnormalize(t,e,i,s,n){return t+(n-e)*((i-t)/(s-e))}function calcWorldAxis(t,e,i){return[unnormalize(t,i.min,e,i.max,0),unnormalize(t,i.min,e,i.max,1)]}function calcWorldVec4(t,e,i){const[s,n]=calcWorldAxis(t.x1,t.x2,e),[o,a]=calcWorldAxis(t.y1,t.y2,i);return{x1:s,x2:n,y1:o,y2:a}}function panAxesUnnormalized(t,e,i,s,n,o){if(i<=n&&o<=s)return i;const a=n-i,r=o-s,l=Math.abs(a)<Math.abs(r)?a:r;return clamp(t,i+l,e)}function calcPanToBBoxRatios(t,e,i){const{x:s={min:0,max:1},y:n={min:0,max:1}}=e,o=Vec4.from(i),a=Vec4.from(t),r=calcWorldVec4(a,s,n),l=panAxesUnnormalized(r.x1,r.x2,a.x1,a.x2,o.x1,o.x2),c=panAxesUnnormalized(r.y1,r.y2,a.y1,a.y2,o.y1,o.y2),h={x:{min:normalize2(a.x1,s.min,a.x2,s.max,l),max:normalize2(a.x1,s.min,a.x2,s.max,l+t.width)},y:{min:normalize2(a.y1,n.min,a.y2,n.max,c),max:normalize2(a.y1,n.min,a.y2,n.max,c+t.height)}},d=h.x.max-h.x.min,u=h.y.max-h.y.min;return h.x.min=clamp(0,h.x.min,1-d),h.x.max=h.x.min+d,h.y.min=clamp(0,h.y.min,1-u),h.y.max=h.y.min+u,h}var expectedMementoKeys=["rangeX","rangeY","ratioX","ratioY","autoScaledAxes"],ZoomManagerAutoScaleAxis=class{constructor(){this.enabled=!1,this.padding=0,this.manuallyAdjusted=!1}},rangeValidator=t=>attachDescription((e,{options:i})=>!ContinuousScale.is(t?.scale)&&!OrdinalTimeScale.is(t?.scale)||e==null||i.end==null?!0:e<=i.end,"to be less than end"),ZoomManager=class extends BaseManager{constructor(t,e){super(),this.fireChartEvent=t,this.mementoOriginatorKey="zoom",this.axisZoomManagers=new Map,this.state=new StateTracker(void 0,"initial"),this.axes=[],this.didLayoutAxes=!1,this.autoScaleYAxis=new ZoomManagerAutoScaleAxis,this.lastRestoredState=void 0,this.independentAxes=!1,this.navigatorModule=!1,this.zoomModule=!1,this.pendingMemento=void 0,this.destroyFns.push(e.addListener("layout:complete",()=>{const{pendingMemento:i}=this,s=!this.didLayoutAxes;this.didLayoutAxes=!0,i?this.restoreMemento(i.version,i.mementoVersion,i.memento):s&&this.autoScaleYZoom("zoom-manager")}))}createMemento(){return this.getMementoRanges()}guardMemento(t,e){if(t==null)return!0;if(!isObject(t))return!1;for(const a of Object.keys(t))if(!expectedMementoKeys.includes(a))return!1;const i=this.getPrimaryAxis("x"),s=this.getPrimaryAxis("y"),n={rangeX:{start:and(or(number,date),rangeValidator(i)),end:or(number,date)},rangeY:{start:and(or(number,date),rangeValidator(s)),end:or(number,date)},ratioX:{start:and(ratio,lessThan("end")),end:ratio},ratioY:{start:and(ratio,lessThan("end")),end:ratio},autoScaledAxes:arrayOf(union("y"))},o=validate(t,n);return o.errors.length>0?(e.push(...o.errors.map(a=>a.message)),!1):!0}restoreMemento(t,e,i){const{independentAxes:s}=this;if(!this.axes||!this.didLayoutAxes){this.pendingMemento={version:t,mementoVersion:e,memento:i};return}this.pendingMemento=void 0;const n=this.getDefinedZoom();if(i?.rangeX?n.x=this.rangeToRatio(i.rangeX,"x")??{min:0,max:1}:i?.ratioX?n.x={min:i.ratioX.start??0,max:i.ratioX.end??1}:n.x={min:0,max:1},!this.navigatorModule||this.zoomModule){let r=i?.autoScaledAxes?.includes("y");i?.rangeY?(n.y=this.rangeToRatio(i.rangeY,"y")??{min:0,max:1},r??(r=!1)):i?.ratioY?(n.y={min:i.ratioY.start??0,max:i.ratioY.end??1},r??(r=!1)):(n.y={min:0,max:1},r??(r=!0)),n.autoScaleYAxis=r}if(this.lastRestoredState=n,s!==!0){this.updateZoom("zoom-manager",n);return}const o=this.getPrimaryAxis("x"),a=this.getPrimaryAxis("y");for(const r of[o,a])r&&this.updateAxisZoom("zoom-manager",r.id,n[r.direction])}updateAxes(t){this.axes=t;const e=new Map(t.map(i=>[i.id,this.axisZoomManagers.get(i.id)]));this.axisZoomManagers.clear();for(const i of t)this.axisZoomManagers.set(i.id,e.get(i.id)??new AxisZoomManager(i));this.state.size>0&&t.length>0&&this.updateZoom(this.state.stateId(),this.state.stateValue())}setIndependentAxes(t=!0){this.independentAxes=t}setAutoScaleYAxis(t,e){this.autoScaleYAxis.enabled=t,this.autoScaleYAxis.padding=e}setNavigatorEnabled(t=!0){this.navigatorModule=t}setZoomModuleEnabled(t=!0){this.zoomModule=t}isNavigatorEnabled(){return this.navigatorModule}isZoomEnabled(){return this.zoomModule}updateZoom(t,e){if(e?.x&&(e.x.min<0||e.x.max>1)&&(logger_exports.warnOnce(`Attempted to update x-axis zoom to an invalid ratio of [{ min: ${e.x.min}, max: ${e.x.max} }], expecting a ratio of 0 to 1, ignoring.`),e.x=void 0),e?.y&&(e.y.min<0||e.y.max>1)&&(logger_exports.warnOnce(`Attempted to update y-axis zoom to an invalid ratio of [{ min: ${e.y.min}, max: ${e.y.max} }], expecting a ratio of 0 to 1, ignoring.`),e.y=void 0),this.axisZoomManagers.size===0){const s=this.state.stateId();(s==="initial"||s===t)&&this.state.set(t,e);return}this.state.set(t,e);const i=e?.autoScaleYAxis;i!=null&&(this.autoScaleYAxis.manuallyAdjusted=!i),this.axisZoomManagers.forEach(s=>{s.updateZoom(t,e?.[s.getDirection()])}),this.applyChanges(t)}updateAxisZoom(t,e,i){this.axisZoomManagers.get(e)?.updateZoom(t,i),this.applyChanges(t)}resetZoom(t){this.autoScaleYAxis.manuallyAdjusted=!1;const e=this.getRestoredZoom();this.updateZoom(t,{x:{min:e?.x?.min??0,max:e?.x?.max??1},y:{min:e?.y?.min??0,max:e?.y?.max??1},autoScaleYAxis:e?.autoScaleYAxis??!0})}resetAxisZoom(t,e){const s=this.axisZoomManagers.get(e)?.getDirection();if(s==null)return;const n=this.getRestoredZoom();if(s==="y"){const o=n?.autoScaleYAxis??!0;this.autoScaleYAxis.manuallyAdjusted=!o}this.updateAxisZoom(t,e,n?.[s]??{min:0,max:1})}setAxisManuallyAdjusted(t,e){this.axisZoomManagers.get(e)?.getDirection()==="y"&&(this.autoScaleYAxis.manuallyAdjusted=!0)}updatePrimaryAxisZoom(t,e,i){const s=this.getPrimaryAxis(e);s&&this.updateAxisZoom(t,s.id,i)}panToBBox(t,e,i){if(!this.isZoomEnabled()&&!this.isNavigatorEnabled())return!1;const s=this.getZoom();if(s===void 0||!s.x&&!s.y)return!1;if(!(e.width>0&&e.height>0&&Math.abs(i.width)<=Math.abs(e.width)&&Math.abs(i.height)<=Math.abs(e.height)))return logger_exports.warnOnce("cannot pan to target BBox - chart too small?"),!1;const o=calcPanToBBoxRatios(e,s,i);return this.independentAxes?(this.updatePrimaryAxisZoom(t,"x",o.x),this.updatePrimaryAxisZoom(t,"y",o.y)):this.updateZoom(t,o),!0}fireZoomPanStartEvent(t){this.listeners.dispatch("zoom-pan-start",{type:"zoom-pan-start",callerId:t})}extendToEnd(t,e,i){return this.extendWith(t,e,s=>Number(s)-i)}extendWith(t,e,i){const s=this.getPrimaryAxis(e);if(!s)return;const n=this.getDomainExtents(s);if(!n)return;const[,o]=n,a=i(o),r=this.rangeToRatio({start:a,end:o},e);r&&this.updateZoom(t,{[e]:r})}updateWith(t,e,i){const s=this.getPrimaryAxis(e);if(!s)return;const n=this.getDomainExtents(s);if(!n)return;let[o,a]=n;[o,a]=i(o,a);const r=this.rangeToRatio({start:o,end:a},e);r&&this.updateZoom(t,{[e]:r})}getZoom(){let t,e;if(this.axisZoomManagers.forEach(i=>{i.getDirection()==="x"?t??(t=i.getZoom()):i.getDirection()==="y"&&(e??(e=i.getZoom()))}),t||e)return{x:t,y:e}}getAxisZoom(t){return this.axisZoomManagers.get(t)?.getZoom()??{min:0,max:1}}getAxisZooms(){const t={};for(const[e,i]of this.axisZoomManagers.entries())t[e]={direction:i.getDirection(),zoom:i.getZoom()};return t}getRestoredZoom(){return this.lastRestoredState}getPrimaryAxisId(t){return this.getPrimaryAxis(t)?.id}isVisibleItemsCountAtLeast(t,e){const i=this.getPrimaryAxis("x"),s=this.getPrimaryAxis("y"),n=new Set;let o=0;const a=[t.x.min,t.x.max],r=[t.y.min,t.y.max];for(const l of i?.boundSeries??[]){n.add(l.id);const c=e-(o??0),h=l.getVisibleItems(a,r,c);if(o+=h,o>=e)return!0}for(const l of s?.boundSeries??[]){if(n.has(l.id))continue;const c=e-(o??0),h=l.getVisibleItems(a,r,c);if(o+=h,o>=e)return!0}return n.size===0}getMementoRanges(){const t=this.getDefinedZoom();let e;return this.autoScaleYAxis.enabled&&(e=this.autoScaleYAxis.manuallyAdjusted?[]:["y"]),{rangeX:this.getRangeDirection(t.x,"x"),rangeY:this.getRangeDirection(t.y,"y"),ratioX:{start:t.x.min,end:t.x.max},ratioY:{start:t.y.min,end:t.y.max},autoScaledAxes:e}}autoScaleYZoom(t,e=!0){if(!this.isZoomEnabled())return;const{independentAxes:i,autoScaleYAxis:s}=this,n=this.getZoom();if(n?.x==null||!s.enabled||s.manuallyAdjusted)return;const{padding:o}=s;let a;if(n.x?.min===0&&n.x?.max===1?a={min:0,max:1}:i?a=this.primaryAxisZoom("y",n.x,{padding:o}):a=this.combinedAxisZoom("y",n.x,{padding:o}),a!=null){if(i){const r=this.getPrimaryAxis("y");(r==null?void 0:this.axisZoomManagers.get(r.id))?.updateZoom("zoom-manager",a)}else for(const r of this.axisZoomManagers.values())r.getDirection()==="y"&&r.updateZoom("zoom-manager",a);e&&this.applyChanges(t)}}applyChanges(t){if(this.autoScaleYZoom(t,!1),!Array.from(this.axisZoomManagers.values(),s=>s.applyChanges()).includes(!0))return;const i={};for(const[s,n]of this.axisZoomManagers.entries())i[s]=n.getZoom();this.listeners.dispatch("zoom-change",{type:"zoom-change",...this.getZoom(),axes:i,callerId:t}),this.fireChartEvent({type:"zoom",...this.getMementoRanges()})}getRangeDirection(t,e){const i=this.getPrimaryAxis(e);if(!i||!ContinuousScale.is(i.scale)&&!OrdinalTimeScale.is(i.scale))return;const s=this.getDomainPixelExtents(i);if(!s)return;const[n,o]=s;let a,r;return n<=o?(a=i.scale.invert(0),r=i.scale.invert(n+(o-n)*t.max)):(a=i.scale.invert(n-(n-o)*t.min),r=i.scale.invert(0)),{start:a,end:r}}rangeToRatio(t,e){const i=this.getPrimaryAxis(e);if(!i)return;const s=this.getDomainPixelExtents(i);if(!s)return;const[n,o]=s;let a=t.start==null?n:i.scale.convert?.(t.start),r=t.end==null?o:i.scale.convert?.(t.end);if(!isFiniteNumber(a)||!isFiniteNumber(r))return;const[l,c]=[Math.min(n,o),Math.max(n,o)];if(a<l||a>c){logger_exports.warnOnce(`Invalid range start [${t.start}], expecting a value between [${i.scale.invert?.(n)}] and [${i.scale.invert?.(o)}], ignoring.`);return}if(r<l||r>c){logger_exports.warnOnce(`Invalid range end [${t.end}], expecting a value between [${i.scale.invert?.(n)}] and [${i.scale.invert?.(o)}], ignoring.`);return}a=Math.min(c,Math.max(l,a)),r=Math.min(c,Math.max(l,r));const h=o-n,d=Math.abs((a-n)/h),u=Math.abs((r-n)/h);return{min:d,max:u}}getPrimaryAxis(t){return this.axes?.find(e=>e.direction===t)}getDomainExtents(t){const{domain:e}=t.scale,i=e.at(0),s=e.at(-1);if(!(i==null||s==null))return[i,s]}getDomainPixelExtents(t){const{domain:e}=t.scale,i=t.scale.convert?.(e.at(0)),s=t.scale.convert?.(e.at(-1));if(!(!isFiniteNumber(i)||!isFiniteNumber(s)))return[i,s]}getDefinedZoom(){const t=this.getZoom();return{x:{min:t?.x?.min??0,max:t?.x?.max??1},y:{min:t?.y?.min??0,max:t?.y?.max??1}}}zoomBounds(t,e,i,s){const n=t.scale,o=n.range;n.range=[0,1];const a=e.scale,r=a.range;a.range=[0,1];let l=1,c=!1,h=0,d=!1;for(const g of e.boundSeries){const{connectsToYAxis:f}=g,m=g.getRange("y",[i.min,i.max]);for(const y of m){const x=a.convert(y);Number.isFinite(x)&&(x<l&&(l=x,c=!f||y<0),x>h&&(h=x,d=!f||y>0))}}if(isFiniteNumber(e.min)&&(l=0),isFiniteNumber(e.max)&&(h=1),n.range=o,a.range=r,l>=h)return;const u=(c?s:0)+(d?s:0),p=Math.min((h-l)*(1+u),1);if(!(p<=0)){if(c&&d){const g=(h+l)/2;l=g-p/2,h=g+p/2}else!c&&d?h=l+p:c&&!d&&(l=h-p);return l<0?(h+=-l,l=0):h>1&&(l-=h-1,h=1),{min:l,max:h}}}primaryAxisZoom(t,e,{padding:i=0}={}){const s=t==="x"?"y":"x",n=this.getPrimaryAxis(s),o=this.getPrimaryAxis(t);if(!(n==null||o==null))return this.zoomBounds(n,o,e,i)}combinedAxisZoom(t,e,{padding:i=0}={}){const s=t==="x"?"y":"x",n=new Map;for(const l of this.axes)if(l.direction===s)for(const c of l.boundSeries)n.set(c,l);let o=1,a=0;for(const l of this.axes)if(l.direction===t)for(const c of l.boundSeries){const h=n.get(c);if(h==null)continue;const d=this.zoomBounds(h,l,e,i);if(d==null)return;o=Math.min(o,d.min),a=Math.max(a,d.max)}const r=1e-6;if(o<r&&(o=0),a>1-r&&(a=1),!(o>a))return{min:o,max:a}}},AxisZoomManager=class{constructor(t){this.axis=t;const[e=0,i=1]=t.visibleRange;this.state=new StateTracker({min:e,max:i}),this.currentZoom=this.state.stateValue()}getDirection(){return this.axis.direction}updateZoom(t,e){this.state.set(t,e)}getZoom(){return deepClone(this.state.stateValue())}hasChanges(){const t=this.currentZoom,e=this.state.stateValue();return t.min!==e.min||t.max!==e.max}applyChanges(){const t=this.hasChanges();return this.currentZoom=this.state.stateValue(),t}};function circleRectOverlap(t,e,i,s,n,o){if(t.size===0)return!1;let a=t.x,r=t.y;e!=null&&(a-=(e.x-.5)*t.size,r-=(e.y-.5)*t.size);let l=a;a<i?l=i:a>i+n&&(l=i+n);let c=r;r<s?c=s:r>s+o&&(c=s+o);const h=a-l,d=r-c;return Math.sqrt(h*h+d*d)<=t.size*.5}function rectRectOverlap(t,e,i,s,n){const o=t.x+t.width>e&&t.x<e+s,a=t.y+t.height>i&&t.y<i+n;return o&&a}function rectContainsRect(t,e,i,s,n){return e+s<t.x+t.width&&e>t.x&&i>t.y&&i+n<t.y+t.height}function isPointLabelDatum(t){return t!=null&&typeof t.point=="object"&&typeof t.label=="object"}var labelPlacements={top:{x:0,y:-1},bottom:{x:0,y:1},left:{x:-1,y:0},right:{x:1,y:0},"top-left":{x:-1,y:-1},"top-right":{x:1,y:-1},"bottom-left":{x:-1,y:1},"bottom-right":{x:1,y:1}};function placeLabels(t,e,i=5){const s=new Map,n=[],o=new Map([...t.entries()].map(([r,l])=>[r,l.toSorted((c,h)=>h.point.size-c.point.size)])),a=[...o.values()].flat();for(const[r,l]of o.entries()){const c=[];if(l[0]?.label){for(let h=0,d=l.length;h<d;h++){const u=l[h],{point:p,label:g,anchor:f}=u,{text:m,width:y,height:x}=g,b=p.size*.5;let S=0,v=0;if(b>0&&u.placement!=null){const L=labelPlacements[u.placement];S=(y*.5+b+i)*L.x,v=(x*.5+b+i)*L.y}const I=p.x-y*.5+S-((f?.x??.5)-.5)*p.size,A=p.y-x*.5+v-((f?.y??.5)-.5)*p.size;if(!(!e||rectContainsRect(e,I,A,y,x))||a.some(L=>circleRectOverlap(L.point,L.anchor,I,A,y,x))||n.some(L=>rectRectOverlap(L,I,A,y,x)))continue;const w={index:h,text:m,x:I,y:A,width:y,height:x,datum:u};c.push(w),n.push(w)}s.set(r,c)}}return s}function axisLabelsOverlap(t,e=0){const i=[];for(let s=0;s<t.length;s++){const n=t[s],{point:{x:o,y:a},label:{text:r}}=n;let{width:l,height:c}=n.label;if(l+=e,c+=e,i.some(h=>rectRectOverlap(h,o,a,l,c)))return!0;i.push({index:s,text:r,x:o,y:a,width:l,height:c,datum:n})}return!1}var SeriesLabelLayoutManager=class{constructor(){this.labelData=new Map}updateLabels(t,e,i=BBox.zero){const s={x:-e.left,y:-e.top,width:i.width+e.left+e.right,height:i.height+e.top+e.bottom},n=new Set(t.map(a=>a.id));for(const a of this.labelData.keys())n.has(a)||this.labelData.delete(a);for(const a of t){const r=a.getLabelData();r.every(isPointLabelDatum)&&this.labelData.set(a.id,r)}const o=placeLabels(this.labelData,s,5);for(const a of t)a.updatePlacedLabelData?.(o.get(a.id)??[])}},LegendManager=class extends BaseManager{constructor(){super(...arguments),this.mementoOriginatorKey="legend",this.legendDataMap=new Map}createMemento(){return this.getData().filter(({hideInLegend:t,isFixed:e})=>!t&&!e).map(({enabled:t,seriesId:e,itemId:i,legendItemName:s})=>({visible:t,seriesId:e,itemId:i,legendItemName:s}))}guardMemento(t){return t==null||isArray(t)}restoreMemento(t,e,i){i?.forEach(s=>{const{seriesId:n,data:o}=this.getRestoredData(s)??{};!n||!o||this.updateData(n,o)}),this.update()}getRestoredData(t){const{seriesId:e,itemId:i,legendItemName:s,visible:n}=t;if(e){const a=(this.legendDataMap.get(e)??[]).map(r=>{const l=r.seriesId===e&&(!i||r.itemId===i);return l&&r.isFixed&&this.warnFixed(r.seriesId,r.itemId),!r.isFixed&&l?{...r,enabled:n}:r});return{seriesId:e,data:a}}if(!(i==null&&s==null))for(const o of this.getData()){if(i!=null&&o.itemId!==i||s!=null&&o.legendItemName!==s)continue;if(o.isFixed){this.warnFixed(o.seriesId,i);return}const a=(this.legendDataMap.get(o.seriesId)??[]).map(r=>r.itemId===i||r.legendItemName===s?{...r,enabled:n}:r);return{seriesId:o.seriesId,data:a}}}warnFixed(t,e){logger_exports.warnOnce(`The legend item with seriesId [${t}] and itemId [${e}] is not configurable, this series item cannot be toggled through the legend.`)}update(t){this.listeners.dispatch("legend-change",{type:"legend-change",legendData:t??this.getData()})}updateData(t,e=[]){this.legendDataMap.set(t,e)}clearData(){this.legendDataMap.clear()}toggleItem(t,e,i,s){if(s){this.getData().forEach(r=>{const l=(this.legendDataMap.get(r.seriesId)??[]).map(c=>c.legendItemName===s?{...c,enabled:t}:c);this.updateData(r.seriesId,l)});return}const n=this.getData(e),o=n.length===1,a=n.map(r=>i==null&&o||r.itemId===i?{...r,enabled:t}:r);this.updateData(e,a)}getData(t){return t?this.legendDataMap.get(t)??[]:[...this.legendDataMap].reduce((e,[i,s])=>e.concat(s),[])}getDatum({seriesId:t,itemId:e}={}){return this.getData(t).find(i=>i.itemId===e)}getSeriesEnabled(t){const e=this.getData(t);if(e.length>0)return e.some(i=>i.enabled)}getItemEnabled({seriesId:t,itemId:e}={}){return this.getDatum({seriesId:t,itemId:e})?.enabled??!0}},SeriesStateManager=class{constructor(){this.groups={}}registerSeries({internalId:t,seriesGrouping:e,visible:i,type:s}){var n;e&&((n=this.groups)[s]??(n[s]={}),this.groups[s][t]={grouping:e,visible:i})}updateSeries({internalId:t,seriesGrouping:e,visible:i,type:s}){if(!e)return;const n=this.groups[s]?.[t];n&&(n.grouping=e,n.visible=i)}deregisterSeries({internalId:t,type:e}){this.groups[e]&&delete this.groups[e][t],this.groups[e]&&Object.keys(this.groups[e]).length===0&&delete this.groups[e]}getVisiblePeerGroupIndex({type:t,seriesGrouping:e,visible:i}){if(!e)return{visibleGroupCount:i?1:0,visibleSameStackCount:i?1:0,index:0};const s=new Set,n=new Set;for(const a of Object.values(this.groups[t]??{}))a.visible&&(s.add(a.grouping.groupIndex),a.grouping.groupIndex===e.groupIndex&&n.add(a.grouping.stackIndex));const o=Array.from(s);return o.sort((a,r)=>a-r),{visibleGroupCount:o.length,visibleSameStackCount:n.size,index:o.indexOf(e.groupIndex)}}},ChartUpdateType=(t=>(t[t.FULL=0]="FULL",t[t.UPDATE_DATA=1]="UPDATE_DATA",t[t.PROCESS_DATA=2]="PROCESS_DATA",t[t.PERFORM_LAYOUT=3]="PERFORM_LAYOUT",t[t.SERIES_UPDATE=4]="SERIES_UPDATE",t[t.PRE_SCENE_RENDER=5]="PRE_SCENE_RENDER",t[t.SCENE_RENDER=6]="SCENE_RENDER",t[t.NONE=7]="NONE",t))(ChartUpdateType||{}),UpdateService=class{constructor(t){this.updateCallback=t,this.events=new EventEmitter}addListener(t,e){return this.events.on(t,e)}removeListener(t,e){return this.events.on(t,e)}destroy(){this.events.clear()}update(t=0,e){this.updateCallback(t,e)}dispatchUpdateComplete(){this.events.emit("update-complete",{type:"update-complete"})}dispatchPreDomUpdate(){this.events.emit("pre-dom-update",{type:"pre-dom-update"})}dispatchPreSceneRender(){this.events.emit("pre-scene-render",{type:"pre-scene-render"})}dispatchProcessData({series:t}){this.events.emit("process-data",{type:"process-data",series:t})}},ChartContext=class{constructor(t,e){this.callbackCache=new CallbackCache,this.chartEventManager=new ChartEventManager,this.highlightManager=new HighlightManager,this.layoutManager=new LayoutManager,this.localeManager=new LocaleManager,this.seriesStateManager=new SeriesStateManager,this.stateManager=new StateManager,this.seriesLabelLayoutManager=new SeriesLabelLayoutManager,this.contextModules=[];const{scene:i,root:s,syncManager:n,container:o,fireEvent:a,updateCallback:r,updateMutex:l,styleContainer:c,chartType:h,domMode:d}=e;this.chartService=t,this.syncManager=n,this.domManager=new DOMManager(o,c,d),this.widgets=new WidgetSet(this.domManager);const u=this.domManager.addChild("canvas","scene-canvas",i?.canvas.element);this.scene=i??new Scene({canvasElement:u}),this.scene.setRoot(s),this.axisManager=new AxisManager(s),this.legendManager=new LegendManager,this.annotationManager=new AnnotationManager(t.annotationRoot,a),this.chartTypeOriginator=new ChartTypeOriginator(t),this.interactionManager=new InteractionManager,this.contextMenuRegistry=new ContextMenuRegistry,this.updateService=new UpdateService(r),this.proxyInteractionService=new ProxyInteractionService(this.localeManager,this.domManager),this.historyManager=new HistoryManager(this.chartEventManager),this.animationManager=new AnimationManager(this.interactionManager,l),this.dataService=new DataService(this.animationManager),this.tooltipManager=new TooltipManager(this.localeManager,this.domManager,t.tooltip),this.zoomManager=new ZoomManager(a,this.layoutManager);for(const p of moduleRegistry.byType("context")){if(!p.chartTypes.includes(h))continue;const g=p.moduleFactory(this);this.contextModules.push(g),this[p.contextKey]=g}}destroy(){this.animationManager.destroy(),this.highlightManager.destroy(),this.axisManager.destroy(),this.callbackCache.invalidateCache(),this.chartEventManager.destroy(),this.domManager.destroy(),this.highlightManager.destroy(),this.proxyInteractionService.destroy(),this.syncManager.destroy(),this.tooltipManager.destroy(),this.zoomManager.destroy(),this.widgets.destroy(),this.contextModules.forEach(t=>t.destroy())}},ChartHighlight=class extends BaseProperties{constructor(){super(...arguments),this.range="tooltip"}};__decorateClass2([TempValidate(UNION(["tooltip","node"],"a range"))],ChartHighlight.prototype,"range",2);function setsEqual(t,e){if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0}function idsMapEqual(t,e){if(t==null||e==null)return t===e;if(t.size!==e.size)return!1;for(const[i,s]of t){const n=e.get(i);if(n==null||!setsEqual(s,n))return!1}return!0}function propsEqual(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i+=1){const{type:s,idsMap:n,scopes:o,data:a,...r}=t[i],{type:l,idsMap:c,scopes:h,data:d,...u}=e[i];if(s!==l||o&&h&&!arraysEqual(o,h)||a&&d&&a!==d||!objectsEqual(r,u)||!idsMapEqual(n,c))return!1}return!0}function optsEqual(t,e){const{props:i,...s}=t,{props:n,...o}=e;return objectsEqual(s,o)&&propsEqual(i,n)}function canReuseCachedData(t,e,i,s){return e===t.data&&arraysEqual(i,t.ids)&&optsEqual(s,t.opts)}var DiscreteDomain=class Xt{constructor(){this.domain=new Set}static is(e){return e instanceof Xt}extend(e){this.domain.add(e)}getDomain(){return Array.from(this.domain)}},ContinuousDomain=class Zt{constructor(){this.domain=[1/0,-1/0]}static is(e){return e instanceof Zt}static extendDomain(e,i=[1/0,-1/0]){for(const s of e)typeof s=="number"&&(i[0]>s&&(i[0]=s),i[1]<s&&(i[1]=s));return i}extend(e){this.domain[0]>e&&(this.domain[0]=e),this.domain[1]<e&&(this.domain[1]=e)}getDomain(){return[...this.domain]}},MIN=0,MAX=1,SPAN=2,RangeLookup=class{constructor(t){const e=t.reduce((o,a)=>Math.max(o,a.length),0);let s=1<<32-Math.clz32(e);e===s/2&&(s=s>>>1),this.maxLevelSize=s;const n=new Float64Array((s*2-1)*2).fill(NaN);for(const o of t)for(let a=0;a<o.length;a+=1){const r=Number(o[a]),l=s+a-1,c=(l*SPAN|0)+MIN,h=(l*SPAN|0)+MAX,d=n[c],u=n[h];(!Number.isFinite(d)||r<d)&&(n[c]=r),(!Number.isFinite(u)||r>u)&&(n[h]=r)}for(let o=s/2|0;o>=1;o=o/2|0){const a=o-1|0,r=a+o|0;for(let l=0;l<o;l+=1){const c=a+l,h=r+l*2,d=h+1,u=n[(h*SPAN|0)+MIN],p=n[(d*SPAN|0)+MIN];n[(c*SPAN|0)+MIN]=!Number.isFinite(p)||u<p?u:p;const g=n[(h*SPAN|0)+MAX],f=n[(d*SPAN|0)+MAX];n[(c*SPAN|0)+MAX]=!Number.isFinite(f)||g>f?g:f}}this.buffer=n}computeRangeInto(t,e,i,s,n,o,a){const r=n+o-1;if(r<e||n>=i)return a;if(n>=e&&r<i){const l=t[(s*SPAN|0)+MIN],c=t[(s*SPAN|0)+MAX];Number.isFinite(l)&&(a[0]=Math.min(a[0],l)),Number.isFinite(c)&&(a[1]=Math.max(a[1],c))}else o>1&&(s=s*2|0,o=o/2|0,this.computeRangeInto(t,e,i,s+1|0,n,o,a),this.computeRangeInto(t,e,i,s+2|0,n+o,o,a));return a}rangeBetween(t,e){if(t>e)return[NaN,NaN];const{maxLevelSize:i,buffer:s}=this,n=[1/0,-1/0];return this.computeRangeInto(s,t,e,0,0,i,n),n}get range(){const{buffer:t}=this;return[t[MIN],t[MAX]]}},DOMAIN_RANGES=Symbol("domain-ranges");function toKeyString(t){return t.map(e=>isObject(e)?JSON.stringify(e):e).join("-")}function fixNumericExtent(t){const e=t?.map(Number);return e?.every(Number.isFinite)?e:[]}function getMissCount(t,e){return e?.get(t.id)??0}function isScoped(t){return"scopes"in t&&Array.isArray(t.scopes)}function createArray(t,e){const i=[];for(let s=0;s<t;s+=1)i[s]=e;return i}function datumKeys(t,e,i){const s=[];for(const n of t){const o=n.get(e)?.[i];if(o==null)return;s.push(o)}return s}function getPathComponents(t){const e=[];let i=0,s;const n=/((?:(?:^|\.)\s*\w+|\[\s*(?:'(?:[^']|(?<!\\)\\')*'|"(?:[^"]|(?<!\\)\\")*"|-?\d+)\s*\])\s*)/g;for(;s=n.exec(t);){if(s.index!==i)return;i=s.index+s[0].length;const o=s[1].trim();if(o.startsWith("."))e.push(o.slice(1).trim());else if(o.startsWith("[")){const a=o.slice(1,-1).trim();a.startsWith("'")?e.push(a.slice(1,-1).replace(/(?<!\\)\\'/g,"'")):a.startsWith('"')?e.push(a.slice(1,-1).replace(/(?<!\\)\\"/g,'"')):e.push(a)}else e.push(o)}if(i===t.length)return e}function createPathAccessor(t){return e=>{let i=e;for(const s of t)i=i[s];return i}}var DataModel=class{constructor(t,e="standalone",i=!1){this.opts=t,this.mode=e,this.suppressFieldDotNotation=i,this.debug=Debug.create(!0,"data-model"),this.scopeCache=new Map,this.keys=[],this.values=[],this.aggregates=[],this.groupProcessors=[],this.propertyProcessors=[],this.reducers=[],this.processors=[],this.markScopeDatumInvalid=function(r,l,c,h){for(const d of r)h.has(d)||h.set(d,createArray(l.length,!1)),h.get(d)[c]=!0};let s=!0;for(const r of t.props){if(r.type==="key"&&!s)throw new Error("AG Charts - internal config error: keys must come before values.");r.type==="value"&&s&&(s=!1)}const n=({matchGroupIds:r=[]})=>{for(const l of r)if(this.values.every(c=>c.groupId!==l))throw new Error(`AG Charts - internal config error: matchGroupIds properties must match defined groups (${l}).`)},o=new Set,a=new Set;for(const r of t.props){const l=r.type==="key"?o:a;switch(isScoped(r)&&r.scopes?.forEach(c=>l.add(c)),r.type){case"key":this.keys.push({...r,index:this.keys.length,missing:new Map});break;case"value":if(r.property==null)throw new Error(`AG Charts - internal config error: no properties specified for value definitions: ${JSON.stringify(r)}`);this.values.push({...r,index:this.values.length,missing:new Map});break;case"aggregate":n(r),this.aggregates.push({...r,index:this.aggregates.length});break;case"group-value-processor":n(r),this.groupProcessors.push({...r,index:this.groupProcessors.length});break;case"property-value-processor":this.propertyProcessors.push({...r,index:this.propertyProcessors.length});break;case"reducer":this.reducers.push({...r,index:this.reducers.length});break;case"processor":this.processors.push({...r,index:this.processors.length});break}}if(this.opts.groupByKeys||this.opts.groupByFn!=null){const r=new Set(a.values());if(o.forEach(l=>r.delete(l)),r.size>0)throw new Error(`AG Charts - scopes missing key for grouping, illegal configuration: ${[...r.values()]}`)}}resolveProcessedDataDefById(t,e){const i=this.scopeCache.get(t.id)?.get(e);if(!i)throw new Error(`AG Charts - didn't find property definition for [${e}, ${t.id}]`);return{index:i.index,def:i}}resolveProcessedDataIndexById(t,e){return this.resolveProcessedDataDefById(t,e).index}resolveKeysById(t,e,i){const s=this.resolveProcessedDataIndexById(t,e),n=i.keys[s];if(n==null)throw new Error(`AG Charts - didn't find keys for [${e}, ${t.id}]`);return n.get(t.id)}hasColumnById(t,e){return this.scopeCache.get(t.id)?.get(e)!=null}resolveColumnById(t,e,i){const s=this.resolveProcessedDataIndexById(t,e),n=i.columns?.[s];if(n==null)throw new Error(`AG Charts - didn't find column for [${e}, ${t.id}]`);return n}*forEachDatum(t,e,i){const s=e.columnScopes.findIndex(n=>n.has(t.id));for(const n of i.datumIndices[s]??[])yield e.columns[s][n]}*forEachGroupDatum(t,e){const i=e.columnScopes.findIndex(o=>o.has(t.id)),s={groupIndex:0,columnIndex:i},n=[];for(const o of e.groups){s.group=o;let a=0;for(const r of o.datumIndices[i]??n)s.datumIndex=r,s.valueIndex=a++,yield s;s.groupIndex++}}*forEachGroupDatumTuple(t,e){const s={columnIndex:e.columnScopes.findIndex(n=>n.has(t.id)),datumIndexes:[void 0,void 0,void 0]};for(const n of this.forEachGroupDatum(t,e))s.group=s.nextGroup,s.groupIndex=s.nextGroupIndex,s.nextGroup=n.group,s.nextGroupIndex=n.groupIndex,s.datumIndexes[0]=s.datumIndexes[1],s.datumIndexes[1]=s.datumIndexes[2],s.datumIndexes[2]=n.datumIndex,s.group!=null&&s.datumIndexes[1]!=null&&(yield s);s.group=s.nextGroup,s.groupIndex=s.nextGroupIndex,s.nextGroup=void 0,s.nextGroupIndex=void 0,s.datumIndexes[0]=s.datumIndexes[1],s.datumIndexes[1]=s.datumIndexes[2],s.datumIndexes[2]=void 0,s.group!=null&&s.datumIndexes[1]!=null&&(yield s)}getDomain(t,e,i,s){return this.getDomainsByType(i??"value",s)?.[this.resolveProcessedDataIndexById(t,e)]??[]}getDomainBetweenRange(t,e,[i,s],n){const o=e.map(c=>this.resolveProcessedDataIndexById(t,c)),a=o.join(":"),r=n[DOMAIN_RANGES];let l=r.get(a);if(l==null){const c=o.map(h=>n.columns[h]);l=new RangeLookup(c),r.set(a,l)}return l.rangeBetween(i,s)}getDomainsByType(t,e){switch(t){case"key":return e.domain.keys;case"value":return e.domain.values;case"aggregate":return e.domain.aggValues;case"group-value-processor":return e.domain.groups;default:return null}}processData(t){const{opts:{groupByKeys:e,groupByFn:i},aggregates:s,groupProcessors:n,reducers:o,processors:a,propertyProcessors:r}=this,l=performance.now();if(e&&this.keys.length===0)return;let c=this.extractData(t);e?c=this.groupData(c):i&&(c=this.groupData(c,i(c))),n.length>0&&c.type==="grouped"&&this.postProcessGroups(c),s.length>0&&c.type==="ungrouped"?this.aggregateUngroupedData(c):s.length>0&&c.type==="grouped"&&this.aggregateGroupedData(c),r.length>0&&this.postProcessProperties(c),o.length>0&&this.reduceData(c),a.length>0&&this.postProcessData(c),this.warnDataMissingProperties(t);const h=performance.now();return c.time=h-l,this.debug.check()&&logProcessedData(c),this.processScopeCache(),c}warnDataMissingProperties(t){if(t.size!==0)for(const e of iterate(this.keys,this.values))for(const[i,s]of e.missing){if(s<(t.get(i)?.length??1/0))continue;const n=i==null?"":` for ${i}`;logger_exports.warnOnce(`the key '${e.property}' was not found in any data element${n}.`)}}processScopeCache(){this.scopeCache.clear();for(const t of iterate(this.keys,this.values,this.aggregates))if(t.idsMap)for(const[e,i]of t.idsMap)for(const s of i)if(!this.scopeCache.has(e))this.scopeCache.set(e,new Map([[s,t]]));else{if(this.scopeCache.get(e)?.has(s))throw new Error("duplicate definition ids on the same scope are not allowed.");this.scopeCache.get(e).set(s,t)}}valueGroupIdxLookup({matchGroupIds:t}){const e=[];for(const[i,s]of this.values.entries())(!t||s.groupId&&t.includes(s.groupId))&&e.push(i);return e}valueIdxLookup(t,e){const i=t==null||t.length===0,s=typeof e=="string"?e:e.id,n=a=>{if(a.idsMap){for(const[r,l]of a.idsMap)if(t?.includes(r)&&l.has(s))return!0}return!1},o=this.values.reduce((a,r,l)=>((r.scopes==null||i&&!r.scopes.length||r.scopes.some(h=>t?.includes(h)))&&(r.property===s||r.id===s||n(r))&&a.push(l),a),[]);if(o.length===0)throw new Error(`AG Charts - configuration error, unknown property ${JSON.stringify(e)} in scope(s) ${JSON.stringify(t)}`);return o}extractData(t){const{dataDomain:e,processValue:i,allScopesHaveSameDefs:s}=this.initDataDomainProcessor(),{keys:n,values:o}=this,{invalidData:a,invalidKeys:r,allKeyMappings:l}=this.extractKeys(n,t,i),{columns:c,columnScopes:h,partialValidDataCount:d,maxDataLength:u}=this.extractValues(a,o,t,r,i),p=g=>{const f=e.get(g),m=f.getDomain();return ContinuousDomain.is(f)&&m[0]>m[1]?[]:m};return{type:"ungrouped",input:{count:u},scopes:new Set(t.keys()),dataSources:t,aggregation:void 0,keys:[...l.values()],columns:c,columnScopes:h,invalidKeys:r,invalidData:a,domain:{keys:n.map(p),values:o.map(p)},defs:{allScopesHaveSameDefs:s,keys:n,values:o},partialValidDataCount:d,time:0,[DOMAIN_RANGES]:new Map}}extractKeys(t,e,i){const s=new Map,n=new Map,o=new Map;let a,r;const l=(c,h)=>{const d=r.get(c);a.set(h,a.get(d)),s.has(d)&&(s.set(h,s.get(d)),n.set(h,n.get(d)))};for(const c of t){const{invalidValue:h,scopes:d}=c;a=new Map,r=new Map,o.set(c,a);for(const u of d??[]){const p=e.get(u)??[];if(r.has(p)){l(p,u);continue}const g=[];a.set(u,g),r.set(p,u);let f,m;for(let y=0;y<p.length;y++){if(p[y]==null||typeof p[y]!="object")continue;const x=i(c,p[y],y,u);if(x.valid){g.push(x.value);continue}g.push(h),f??(f=createArray(p.length,!1)),m??(m=createArray(p.length,!1)),f[y]=!0,m[y]=!0}f&&m&&(s.set(u,f),n.set(u,m))}}return{invalidData:n,invalidKeys:s,allKeyMappings:o}}extractValues(t,e,i,s,n){let o=0;const a=[],r=[];let l=0;for(const c of e){const{invalidValue:h}=c;if(new Set(c.scopes.map(m=>i.get(m))).size>1)throw new Error(`AG Charts - more than one data source for: ${JSON.stringify(c)}`);const u=new Set(c.scopes),p=first(c.scopes),g=i.get(p),f=new Array;for(let m=0;m<g.length;m++){if(g[m]==null||typeof g[m]!="object")continue;const y=g[m],x=s.get(p)?.[m],b=n(c,y,m,c.scopes);let S=b.value;(x||!b.valid)&&this.markScopeDatumInvalid(c.scopes,g,m,t),x?S=h:b.valid||(o+=1,S=h),f[m]=S}a.push(f),r.push(u),l=Math.max(l,f.length)}return{columns:a,columnScopes:r,partialValidDataCount:o,maxDataLength:l}}groupData(t,e){var i;const s=new Map,{keys:n,columns:o,columnScopes:a,invalidKeys:r,invalidData:l}=t,c=t.scopes,h=new Set;for(const p of c){const g=o.map((S,v)=>v).filter(S=>!h.has(S)&&a[S].has(p));if(g.length===0)continue;for(const S of g)h.add(S);const f=new Set;for(const S of g)for(const v of a[S])f.add(v);const m=n.map(S=>S.get(p)).filter(S=>S!=null),y=o[first(g)],x=l?.get(p),b=r?.get(p);for(let S=0;S<y.length;S++){if(b?.[S]===!0)continue;const v=m.map(T=>T[S]);if(v==null||v.length===0)throw new Error("AG Charts - no keys found for scope: "+p);const I=e?.(v)??v,A=toKeyString(I),D=s.get(A)??{keys:I,datumIndices:[],validScopes:c};if(s.has(A)||s.set(A,D),x?.[S]===!0){D.validScopes===c&&(D.validScopes=new Set(c.values()));for(const T of f)D.validScopes.delete(T)}for(const T of g)(i=D.datumIndices)[T]??(i[T]=[]),D.datumIndices[T].push(S)}}const d=[],u=[];for(const{keys:p,datumIndices:g,validScopes:f}of s.values())d.push(p),u.push({datumIndices:g,keys:p,aggregation:[],validScopes:f});return{...t,type:"grouped",domain:{...t.domain,groups:d},groups:u}}aggregateUngroupedData(t){const e=this.aggregates.map(()=>[1/0,-1/0]);t.domain.aggValues=e;const{keys:i,columns:s,dataSources:n}=t,o=first(n.keys()),a=n.get(o);t.aggregation=a?.map((r,l)=>{const c=[];for(const[h,d]of this.aggregates.entries()){const u=this.valueGroupIdxLookup(d);let p=d.groupAggregateFunction?.()??[1/0,-1/0];const g=u.map(x=>s[x][l]),f=datumKeys(i,o,l),m=f!=null?d.aggregateFunction(g,f):void 0;m&&(p=d.groupAggregateFunction?.(m,p)??ContinuousDomain.extendDomain(m,p));const y=d.finalFunction?.(p)??p;c[h]=y,ContinuousDomain.extendDomain(y,e[h])}return c})}aggregateGroupedData(t){const e=this.aggregates.map(()=>[1/0,-1/0]);t.domain.aggValues=e;const{columns:i}=t;for(const[s,n]of this.aggregates.entries()){const o=this.valueGroupIdxLookup(n);for(const a of t.groups){a.aggregation??(a.aggregation=[]);const r=a.keys;let l=n.groupAggregateFunction?.()??[1/0,-1/0];const c=Math.max(...o.map(d=>a.datumIndices[d]?.length??0));for(let d=0;d<c;d++){const u=o.map(g=>i[g][a.datumIndices[g]?.[d]]),p=n.aggregateFunction(u,r);p&&(l=n.groupAggregateFunction?.(p,l)??ContinuousDomain.extendDomain(p,l))}const h=n.finalFunction?.(l)??l;a.aggregation[s]=h,ContinuousDomain.extendDomain(h,e[s])}}}postProcessGroups(t){const{groupProcessors:e}=this,{columnScopes:i,columns:s,invalidData:n}=t;for(const o of e){const a=this.valueGroupIdxLookup(o),r=o.adjust()();for(const l of t.groups)r(s,a,l);for(const l of a){const h=this.values[l].valueType==="category",d=s[l],u=first(i[l]),p=n?.get(u),g=h?new DiscreteDomain:new ContinuousDomain;for(let f=0;f<d.length;f+=1)p?.[f]!==!0&&g.extend(d[f]);t.domain.values[l]=g.getDomain()}}}postProcessProperties(t){for(const{adjust:e,property:i,scopes:s}of this.propertyProcessors)for(const n of this.valueIdxLookup(s,i))e()(t,n)}reduceData(t){t.reduced??(t.reduced={});const{dataSources:e,keys:i}=t;for(const s of this.reducers){const n=s.reducer();let o=s.initialValue;if(t.type==="grouped")for(const a of t.groups)o=n(o,a.keys);else{const a=first(e.keys()),r=i.map(h=>h.get(a)).filter(h=>h!=null),l=r.map(()=>{}),c=e.get(a);for(let h=0;h<c.length;h+=1){for(let d=0;d<l.length;d++)l[d]=r[d]?.[h];o=n(o,l)}}t.reduced[s.property]=o}}postProcessData(t){t.reduced??(t.reduced={});for(const e of this.processors)t.reduced[e.property]=e.calculate(t,t.reduced[e.property])}initDataDomainProcessor(){const{keys:t,values:e}=this,i=new Set;for(const h of e)if(h.scopes)for(const d of h.scopes)i.add(d);const s=new Map,n=new Map;let o=!0;const a=()=>{for(const h of iterate(t,e))h.valueType==="category"?s.set(h,new DiscreteDomain):(s.set(h,new ContinuousDomain),o&&(o=(h.scopes??[]).length===i.size))};a();const r=this.buildAccessors(iterate(t,e)),l={value:void 0,missing:!1,valid:!1};return{dataDomain:s,processValue:(h,d,u,p)=>{let g,f;if(r.has(h.property)){try{f=r.get(h.property)(d)}catch{}g=f!=null}else g=h.property in d,f=g?d[h.property]:h.missingValue;h.forceValue!=null&&(f=g&&isNegative(f)?-1*h.forceValue:h.forceValue,g=!0),l.missing=!g;const m="missingValue"in h;if(!g&&!m)if(typeof p=="string"){const y=h.missing.get(p)??0;h.missing.set(p,y+1)}else for(const y of p){const x=h.missing.get(y)??0;h.missing.set(y,x+1)}if(s.has(h)||a(),g&&h.validation?.(f,d,u)===!1)if(l.valid=!1,"invalidValue"in h)f=h.invalidValue;else return this.mode!=="integrated"&&logger_exports.warnOnce(`invalid value of type [${typeof f}] for [${h.scopes} / ${h.id}] ignored:`,`[${f}]`),l.value=void 0,l;else l.valid=!0;if(h.processor){let y=n.get(h);y==null&&(y=h.processor(),n.set(h,y)),f=y(f,u)}return s.get(h)?.extend(f),l.value=f,l},initDataDomain:a,scopes:i,allScopesHaveSameDefs:o}}buildAccessors(t){const e=new Map;if(this.suppressFieldDotNotation)return e;for(const i of t){if(!(i.property.includes(".")||i.property.includes("[")))continue;const n=getPathComponents(i.property);if(n==null){logger_exports.warnOnce("Invalid property path [%s]",i.property);continue}const o=createPathAccessor(n);e.set(i.property,o)}return e}};function logProcessedData(t){const e=(i,s)=>{s.length>0&&(logger_exports.log(`DataModel.processData() - ${i}`),logger_exports.table(s))};logger_exports.log("DataModel.processData() - processedData",t),e("Key Domains",t.domain.keys),e("Group Domains",t.domain.groups??[]),e("Value Domains",t.domain.values),e("Aggregate Domains",t.domain.aggValues??[])}var _DataController=class bt{constructor(e,i){this.mode=e,this.suppressFieldDotNotation=i,this.debug=Debug.create(!0,"data-model"),this.requested=[],this.status="setup"}async request(e,i,s){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");return new Promise((n,o)=>{this.requested.push({id:e,opts:s,data:i,resolve:n,reject:o})})}execute(e){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");this.status="executed",this.debug("DataController.execute() - requested",this.requested);const i=this.validateRequests(this.requested);this.debug("DataController.execute() - validated",i);const s=this.mergeRequested(i);this.debug("DataController.execute() - merged",s),this.debug.check()&&(getWindow().processedData=[]);const n=[];for(const{data:o,ids:a,opts:r,resolves:l,rejects:c}of s){const h=e?.find(p=>canReuseCachedData(p,o,a,r));let d,u;if(h==null)try{d=new DataModel(r,this.mode,this.suppressFieldDotNotation);const p=new Map(i.map(g=>[g.id,g.data]));u=d.processData(p)}catch(p){c.forEach(g=>g(p));continue}else({dataModel:d,processedData:u}=h);n.push({opts:r,data:o,ids:a,dataModel:d,processedData:u}),this.debug.check()&&getWindow("processedData").push(u),u?.partialValidDataCount===0?l.forEach(p=>p({dataModel:d,processedData:u})):u?this.splitResult(d,u,a,l):c.forEach(p=>p(new Error("AG Charts - no processed data generated")))}return n}validateRequests(e){const i=[];for(const[s,n]of e.entries())s>0&&n.data.length!==e[0].data.length&&n.opts.groupByData===!1&&n.opts.groupByKeys===!1?n.reject(new Error("all series[].data arrays must be of the same length and have matching keys.")):i.push(n);return i}mergeRequested(e){const i=[];for(const s of e){const n=i.find(bt.groupMatch(s));n?n.push(s):i.push([s])}return i.map(bt.mergeRequests)}splitResult(e,i,s,n){for(let o=0;o<s.length;o++){const a=n[o];a({dataModel:e,processedData:i})}}static groupMatch({data:e,opts:i}){function s(c){return c.filter(h=>h.type==="key").map(h=>h.property).join(";")}const{groupByData:n,groupByKeys:o=!1,groupByFn:a,props:r}=i,l=s(r);return([c])=>(n===!1||c.data===e)&&(c.opts.groupByKeys??!1)===o&&c.opts.groupByFn===a&&s(c.opts.props)===l}static mergeRequests(e){const i=new Set(["key","group-value-processor"]);return e.reduce((s,{id:n,data:o,resolve:a,reject:r,opts:{props:l,...c}})=>{s.ids.push(n),s.rejects.push(r),s.resolves.push(a),s.data??(s.data=o),s.opts??(s.opts={...c,props:[]});for(const h of l){const d={...h,scopes:[n],data:o};bt.createIdsMap(n,d);const u=s.opts.props.find(p=>p.type===d.type&&(i.has(p.type)||p.data===d.data)&&bt.deepEqual(p,d));if(!u){s.opts.props.push(d);continue}u.scopes??(u.scopes=[]),u.scopes.push(...d.scopes??[]),(u.type==="key"||u.type==="value")&&d.idsMap?.size&&bt.mergeIdsMap(d.idsMap,u.idsMap)}return s},{ids:[],rejects:[],resolves:[],data:null,opts:null})}static mergeIdsMap(e,i){for(const[s,n]of e){const o=i.get(s);if(o==null)i.set(s,new Set(n));else for(const a of n)o.add(a)}}static createIdsMap(e,i){i.id!=null&&(i.idsMap??(i.idsMap=new Map),i.idsMap.has(e)?i.idsMap.get(e).add(i.id):i.idsMap.set(e,new Set([i.id])))}static deepEqual(e,i){if(e===i)return!0;if(e&&i&&typeof e=="object"&&typeof i=="object"){if(e.constructor!==i.constructor)return!1;let s,n;if(Array.isArray(e)){if(n=e.length,n!==i.length)return!1;for(s=n-1;s>=0;s--)if(!bt.deepEqual(e[s],i[s]))return!1;return!0}const o=Object.keys(e);if(n=o.length,n!==Object.keys(i).length)return!1;for(s=n-1;s>=0;s--){const a=o[s];if(!bt.skipKeys.has(a)&&(!Object.hasOwn(i,a)||!bt.deepEqual(e[a],i[a])))return!1}return!0}return!1}};_DataController.skipKeys=new Set(["id","idsMap","type","scopes","data"]);var DataController=_DataController,AxisRegistry=class{constructor(){this.axesMap=new Map,this.themeTemplates=new Map}register(t,e){this.axesMap.set(t,e.moduleFactory),e.themeTemplate&&this.setThemeTemplate(t,e.themeTemplate)}create(t,e){const i=this.axesMap.get(t);if(i)return i(e);throw new Error(`AG Charts - unknown axis type: ${t}`)}has(t){return this.axesMap.has(t)}keys(){return this.axesMap.keys()}setThemeTemplate(t,e){return this.themeTemplates.set(t,e),this}getThemeTemplate(t){return this.themeTemplates.get(t)}},axisRegistry=new AxisRegistry,EXPECTED_ENTERPRISE_MODULES=[{type:"root",optionsKey:"animation",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"]},{type:"root",optionsKey:"annotations",chartTypes:["cartesian"]},{type:"root",optionsKey:"background",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],optionsInnerKey:"image"},{type:"root",optionsKey:"foreground",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],optionsInnerKey:"image"},{type:"root",optionsKey:"chartToolbar",chartTypes:["cartesian"]},{type:"root",optionsKey:"contextMenu",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"]},{type:"root",optionsKey:"statusBar",chartTypes:["cartesian"],identifier:"status-bar"},{type:"root",optionsKey:"dataSource",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"]},{type:"root",optionsKey:"sync",chartTypes:["cartesian"]},{type:"root",optionsKey:"zoom",chartTypes:["cartesian","topology"]},{type:"root",optionsKey:"ranges",chartTypes:["cartesian"]},{type:"legend",optionsKey:"gradientLegend",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],identifier:"gradient"},{type:"root",optionsKey:"navigator",chartTypes:["cartesian"]},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"angle-category"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"angle-number"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"radius-category"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"radius-number"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"bar",community:!0},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"line",community:!0},{type:"axis",optionsKey:"axes[]",chartTypes:["cartesian"],identifier:"ordinal-time"},{type:"axis-option",optionsKey:"crosshair",chartTypes:["cartesian"]},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"box-plot"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"candlestick"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"cone-funnel"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"funnel"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"ohlc"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"heatmap"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"range-area"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"range-bar"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"waterfall"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"nightingale"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radar-area"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radar-line"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radial-bar"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radial-column"},{type:"series",optionsKey:"series[]",chartTypes:["hierarchy"],identifier:"sunburst"},{type:"series",optionsKey:"series[]",chartTypes:["hierarchy"],identifier:"treemap"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-shape"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-line"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-marker"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-shape-background"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-line-background"},{type:"series",optionsKey:"series[]",chartTypes:["flow-proportion"],identifier:"chord"},{type:"series",optionsKey:"series[]",chartTypes:["flow-proportion"],identifier:"sankey"},{type:"series",optionsKey:"series[]",chartTypes:["standalone"],identifier:"pyramid"},{type:"series",optionsKey:"series[]",chartTypes:["gauge"],identifier:"linear-gauge"},{type:"series",optionsKey:"series[]",chartTypes:["gauge"],identifier:"radial-gauge"},{type:"series-option",optionsKey:"errorBar",chartTypes:["cartesian"],identifier:"error-bars"},{type:"context",contextKey:"sharedToolbar",chartTypes:["cartesian"]}];function getEnterpriseSeriesChartTypes(t){return EXPECTED_ENTERPRISE_MODULES.find(e=>e.type==="series"&&e.identifier===t)?.chartTypes}function isEnterpriseCartesian(t){return getEnterpriseSeriesChartTypes(t)?.find(i=>i==="cartesian")==="cartesian"}function isEnterprisePolar(t){return getEnterpriseSeriesChartTypes(t)?.find(i=>i==="polar")==="polar"}function isEnterpriseHierarchy(t){return getEnterpriseSeriesChartTypes(t)?.find(i=>i==="hierarchy")==="hierarchy"}function isEnterpriseTopology(t){return getEnterpriseSeriesChartTypes(t)?.find(i=>i==="topology")==="topology"}function isEnterpriseFlowProportion(t){return getEnterpriseSeriesChartTypes(t)?.find(i=>i==="flow-proportion")==="flow-proportion"}function isEnterpriseStandalone(t){return getEnterpriseSeriesChartTypes(t)?.find(i=>i==="standalone")==="standalone"}function isEnterpriseGauge(t){return getEnterpriseSeriesChartTypes(t)?.find(i=>i==="gauge")==="gauge"}function isEnterpriseModule(t){return t.packageType==="enterprise"}function verifyIfModuleExpected(t){if(!isEnterpriseModule(t))throw new Error("AG Charts - internal configuration error, only enterprise modules need verification.");const e=EXPECTED_ENTERPRISE_MODULES.find(i=>i.type===t.type&&("optionsKey"in i&&"optionsKey"in t?i.optionsKey===t.optionsKey:!0)&&("contextKey"in i&&"contextKey"in t?i.contextKey===t.contextKey:!0)&&i.identifier===t.identifier&&t.chartTypes.every(s=>i.chartTypes.includes(s)));return e&&(e.useCount??(e.useCount=0),e.useCount++),e!=null}function getUnusedExpectedModules(){return EXPECTED_ENTERPRISE_MODULES.filter(({useCount:t})=>t==null||t===0)}var LegendRegistry=class{constructor(){this.legendMap=new Map,this.themeTemplates=new Map}register(t,{optionsKey:e,moduleFactory:i,themeTemplate:s}){this.legendMap.set(t,{optionsKey:e,moduleFactory:i}),this.themeTemplates.set(e,s)}create(t,e){const i=this.legendMap.get(t)?.moduleFactory;if(i)return i(e);throw new Error(`AG Charts - unknown legend type: ${t}`)}getThemeTemplates(){return Object.fromEntries(this.themeTemplates)}getKeys(){return Array.from(this.legendMap.entries()).reduce((t,[e,i])=>(t[e]=i.optionsKey,t),{})}},legendRegistry=new LegendRegistry,ChartTypes=class extends Map{get(t){return super.get(t)??"unknown"}isCartesian(t){return this.get(t)==="cartesian"}isPolar(t){return this.get(t)==="polar"}isHierarchy(t){return this.get(t)==="hierarchy"}isTopology(t){return this.get(t)==="topology"}isFlowProportion(t){return this.get(t)==="flow-proportion"}isStandalone(t){return this.get(t)==="standalone"}isGauge(t){return this.get(t)==="gauge"}get seriesTypes(){return Array.from(this.keys())}get cartesianTypes(){return this.seriesTypes.filter(t=>this.isCartesian(t))}get polarTypes(){return this.seriesTypes.filter(t=>this.isPolar(t))}get hierarchyTypes(){return this.seriesTypes.filter(t=>this.isHierarchy(t))}get topologyTypes(){return this.seriesTypes.filter(t=>this.isTopology(t))}get flowProportionTypes(){return this.seriesTypes.filter(t=>this.isFlowProportion(t))}get standaloneTypes(){return this.seriesTypes.filter(t=>this.isStandalone(t))}get gaugeTypes(){return this.seriesTypes.filter(t=>this.isGauge(t))}},ChartDefaults=class extends Map{set(t,e){return super.set(t,mergeDefaults(e,this.get(t)))}},chartTypes2=new ChartTypes,publicChartTypes=new ChartTypes,chartDefaults=new ChartDefaults,SeriesRegistry=class{constructor(){this.seriesMap=new Map,this.themeTemplates=new Map}register(t,{chartTypes:[e],moduleFactory:i,tooltipDefaults:s,defaultAxes:n,themeTemplate:o,solo:a,stackable:r,groupable:l,stackedByDefault:c,hidden:h}){this.setThemeTemplate(t,o),this.seriesMap.set(t,{moduleFactory:i,tooltipDefaults:s,defaultAxes:n,solo:a,stackable:r,groupable:l,stackedByDefault:c}),chartTypes2.set(t,e),h||publicChartTypes.set(t,e)}create(t,e){const i=this.seriesMap.get(t)?.moduleFactory;if(i)return i(e);throw new Error(`AG Charts - unknown series type: ${t}`)}cloneDefaultAxes(t){const e=this.seriesMap.get(t)?.defaultAxes;return e==null?null:{axes:deepClone(e)}}setThemeTemplate(t,e){const i=this.themeTemplates.get(t);this.themeTemplates.set(t,mergeDefaults(e,i))}getThemeTemplate(t){return this.themeTemplates.get(t)}getTooltipDefauls(t){return this.seriesMap.get(t)?.tooltipDefaults}isSolo(t){return this.seriesMap.get(t)?.solo??!1}isGroupable(t){return this.seriesMap.get(t)?.groupable??!1}isStackable(t){return this.seriesMap.get(t)?.stackable??!1}isStackedByDefault(t){return this.seriesMap.get(t)?.stackedByDefault??!1}},seriesRegistry=new SeriesRegistry,_SyncManager=class It extends BaseManager{constructor(e){super(),this.chart=e}subscribe(e=It.DEFAULT_GROUP){let i=this.get(e);return i||(i=new Set,It.chartsGroups.set(e,i)),i.add(this.chart),this}unsubscribe(e=It.DEFAULT_GROUP){return this.get(e)?.delete(this.chart),this}getChart(){return this.chart}getGroup(e=It.DEFAULT_GROUP){const i=this.get(e);return i?Array.from(i):[]}getGroupSiblings(e=It.DEFAULT_GROUP){return this.getGroup(e).filter(i=>i!==this.chart)}get(e){return It.chartsGroups.get(e)}};_SyncManager.chartsGroups=new Map,_SyncManager.DEFAULT_GROUP=Symbol("sync-group-default");var SyncManager=_SyncManager,Keyboard=class extends BaseProperties{constructor(){super(...arguments),this.enabled=!1}};__decorateClass2([TempValidate(BOOLEAN)],Keyboard.prototype,"enabled",2),__decorateClass2([TempValidate(NUMBER)],Keyboard.prototype,"tabIndex",2);var fromToMotion_exports={};__export3(fromToMotion_exports,{NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>NODE_UPDATE_STATE_TO_PHASE_MAPPING,fromToMotion:()=>fromToMotion,staticFromToMotion:()=>staticFromToMotion});var NODE_UPDATE_STATE_TO_PHASE_MAPPING={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"};function fromToMotion(t,e,i,s,n,o,a){const{fromFn:r,toFn:l,applyFn:c=(g,f)=>g.setProperties(f)}=n,{nodes:h,selections:d}=deconstructSelectionsOrNodes(s),u=(g,f)=>{let m,y=0,x=0;for(const b of f){const S=g[y]===b,v={last:x>=f.length-1,lastLive:y>=g.length-1,prev:f[x-1],prevFromProps:m,prevLive:g[y-1],next:f[x+1],nextLive:g[y+(S?1:0)]},I=`${t}_${e}_${b.id}`;i.stopByAnimationId(I);let A="unknown";S?o&&a&&(A=calculateStatus(b,b.datum,o,a)):A="removed",b.transitionOut=A==="removed";const{phase:D,start:T,finish:k,delay:w,duration:L,...O}=r(b,b.datum,A,v),{phase:F,start:R,finish:E,delay:_,duration:G,...B}=l(b,b.datum,A,v),z=k==null;i.animate({id:I,groupId:t,phase:D??F??"update",duration:L??G,delay:w??_,from:O,to:B,ease:easeOut,collapsable:z,onPlay:()=>{const P={...T,...R,...O};c(b,P,"start")},onUpdate(P){c(b,P,"update")},onStop:()=>{const P={...T,...R,...O,...B,...k,...E};c(b,P,"end")}}),S&&y++,x++,m=O}};let p=0;for(const g of d){const f=g.nodes(),m=f.filter(y=>!g.isGarbage(y));u(m,f),i.animate({id:`${t}_${e}_selection_${p}`,groupId:t,phase:"end",from:0,to:1,ease:easeOut,onStop(){g.cleanup()}}),p++}u(h,h)}function staticFromToMotion(t,e,i,s,n,o,a){const{nodes:r,selections:l}=deconstructSelectionsOrNodes(s),{start:c,finish:h,phase:d}=a;i.animate({id:`${t}_${e}`,groupId:t,phase:d??"update",from:n,to:o,ease:easeOut,onPlay:()=>{if(c){for(const u of r)u.setProperties(c);for(const u of l)for(const p of u.nodes())p.setProperties(c)}},onUpdate(u){for(const p of r)p.setProperties(u);for(const p of l)for(const g of p.nodes())g.setProperties(u)},onStop:()=>{for(const u of r)u.setProperties({...o,...h});for(const u of l){for(const p of u.nodes())p.setProperties({...o,...h});u.cleanup()}}})}function calculateStatus(t,e,i,s){const n=i(t,e);return s.added.has(n)?"added":s.removed.has(n)?"removed":"updated"}var resetMotion_exports={};__export3(resetMotion_exports,{resetMotion:()=>resetMotion});function resetMotion(t,e){const{nodes:i,selections:s}=deconstructSelectionsOrNodes(t);for(const n of s){for(const o of n.nodes()){const a=e(o,o.datum);o.setProperties(a)}n.cleanup()}for(const n of i){const o=e(n,n.datum);n.setProperties(o)}}var debugColor="color: green",debugQuietColor="color: grey";function StateMachineProperty(){return addObserverToInstanceProperty(()=>{})}function applyProperties(t,e){const i=listDecoratedProperties(e);if(i.length===0)return;const s=extractDecoratedProperties(t);for(const n of i)n in s&&(e[n]=s[n])}var AbstractStateMachine=class{transitionRoot(t,e){this.parent?this.parent.transitionRoot(t,e):this.transition(t,e)}},_StateMachine=class gt extends AbstractStateMachine{constructor(e,i,s){super(),this.defaultState=e,this.states=i,this.enterEach=s,this.debug=Debug.create(!0,"animation"),this.state=e,this.debug(`%c${this.constructor.name} | init -> ${e}`,debugColor)}transition(e,i){if(!this.transitionChild(e,i)||this.state===gt.child||this.state===gt.parent)return;const n=this.state,o=this.states[this.state];let a=o[e];const r=`%c${this.constructor.name} | ${this.state} -> ${e} ->`;if(Array.isArray(a))a=a.find(h=>{if(!h.guard)return!0;const d=h.guard(i);return d||this.debug(`${r} (guarded)`,h.target,debugQuietColor),d});else if(typeof a=="object"&&!(a instanceof gt)&&a.guard&&!a.guard(i)){this.debug(`${r} (guarded)`,a.target,debugQuietColor);return}if(!a){this.debug(`${r} ${this.state}`,debugQuietColor);return}const l=this.getDestinationState(a),c=l===this.state?void 0:o.onExit;this.debug(`${r} ${l}`,debugColor),this.state=l,typeof a=="function"?a(i):typeof a=="object"&&!(a instanceof gt)&&a.action?.(i),c?.(),this.enterEach?.(n,l),l!==n&&l!==gt.child&&l!==gt.parent&&this.states[l].onEnter?.(n,i)}transitionAsync(e,i){setTimeout(()=>{this.transition(e,i)},0)}is(e){return this.state===gt.child&&this.childState?this.childState.is(e):this.state===e}resetHierarchy(){this.debug(`%c${this.constructor.name} | ${this.state} -> [resetHierarchy] -> ${this.defaultState}`,"color: green"),this.state=this.defaultState}transitionChild(e,i){return this.state!==gt.child||!this.childState||(applyProperties(this,this.childState),this.childState.transition(e,i),!this.childState.is(gt.parent))?!0:(this.debug(`%c${this.constructor.name} | ${this.state} -> ${e} -> ${this.defaultState}`,debugColor),this.state=this.defaultState,this.states[this.state].onEnter?.(),this.childState.resetHierarchy(),!1)}getDestinationState(e){let i=this.state;return typeof e=="string"?i=e:e instanceof gt?(this.childState=e,this.childState.parent=this,i=gt.child):typeof e=="object"&&(e.target instanceof gt?(this.childState=e.target,this.childState.parent=this,i=gt.child):e.target!=null&&(i=e.target)),i}};_StateMachine.child="__child",_StateMachine.parent="__parent";var StateMachine=_StateMachine,ParallelStateMachine=class extends AbstractStateMachine{constructor(...t){super(),this.stateMachines=t;for(const e of t)e.parent=this}transition(t,e){for(const i of this.stateMachines)applyProperties(this,i),i.transition(t,e)}transitionAsync(t,e){for(const i of this.stateMachines)applyProperties(this,i),i.transitionAsync(t,e)}},ModuleMap=class{constructor(){this.moduleMap=new Map}*modules(){for(const t of this.moduleMap.values())yield t.moduleInstance}addModule(t,e){if(this.moduleMap.has(t.optionsKey))throw new Error(`AG Charts - module already initialised: ${t.optionsKey}`);this.moduleMap.set(t.optionsKey,{module:t,moduleInstance:e(t)})}removeModule(t){const e=isString(t)?t:t.optionsKey;this.moduleMap.get(e)?.moduleInstance.destroy(),this.moduleMap.delete(e)}getModule(t){return this.moduleMap.get(isString(t)?t:t.optionsKey)?.moduleInstance}isEnabled(t){return this.moduleMap.has(isString(t)?t:t.optionsKey)}mapModules(t){return Array.from(this.moduleMap.values(),(e,i)=>t(e.moduleInstance,i))}destroy(){for(const t of this.moduleMap.keys())this.moduleMap.get(t)?.moduleInstance.destroy();this.moduleMap.clear()}},Selection=class Tt{constructor(e,i,s=!0){this.parentNode=e,this.autoCleanup=s,this.garbageBin=new Set,this._nodesMap=new Map,this._nodes=[],this.data=[],this.debug=Debug.create(!0,"scene","scene:selections"),this.nodeFactory=Object.prototype.isPrototypeOf.call(Node,i)?()=>new i:i}static select(e,i,s=!0){return new Tt(e,i,s)}static selectAll(e,i){const s=[],n=o=>{i(o)&&s.push(o);for(const a of o.children())n(a)};return n(e),s}static selectByClass(e,...i){return Tt.selectAll(e,s=>i.some(n=>s instanceof n))}static selectByTag(e,i){return Tt.selectAll(e,s=>s.tag===i)}createNode(e,i,s){const n=this.nodeFactory(e);return n.datum=e,i?.(n),s==null?this._nodes.push(n):this._nodes.splice(s,0,n),this.parentNode.appendChild(n),n}update(e,i,s){if(this.garbageBin.size>0&&this.debug("Selection - update() called with pending garbage",e),s){const n=new Map(e.map((o,a)=>[s(o),[o,a]]));for(const[o,a]of this._nodesMap.entries())if(n.has(a)){const[r]=n.get(a);o.datum=r,this.garbageBin.delete(o),n.delete(a)}else this.garbageBin.add(o);for(const[o,[a,r]]of n.entries())this._nodesMap.set(this.createNode(a,i,r),o)}else{const n=Math.max(e.length,this.data.length);for(let o=0;o<n;o++)o>=e.length?this.garbageBin.add(this._nodes[o]):o>=this._nodes.length?this.createNode(e[o],i):(this._nodes[o].datum=e[o],this.garbageBin.delete(this._nodes[o]))}return this.data=e.slice(),this.autoCleanup&&this.cleanup(),this}cleanup(){return this.garbageBin.size===0?this:(this._nodes=this._nodes.filter(e=>this.garbageBin.has(e)?(this._nodesMap.delete(e),this.garbageBin.delete(e),e.destroy(),!1):!0),this)}clear(){return this.update([]),this}isGarbage(e){return this.garbageBin.has(e)}each(e){for(const i of this._nodes.entries())e(i[1],i[1].datum,i[0]);return this}*[Symbol.iterator](){for(let e=0;e<this._nodes.length;e++){const i=this._nodes[e];yield{node:i,datum:i.datum,index:e}}}select(e){return Tt.selectAll(this.parentNode,e)}selectByClass(e){return Tt.selectByClass(this.parentNode,e)}selectByTag(e){return Tt.selectByTag(this.parentNode,e)}nodes(){return this._nodes}at(e){return this._nodes.at(e)}get length(){return this._nodes.length}},Line=class extends Shape{constructor(t={}){super(t),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.restoreOwnStyles()}set x(t){this.x1=t,this.x2=t}set y(t){this.y1=t,this.y2=t}get midPoint(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}}computeBBox(){return new BBox(Math.min(this.x1,this.x2),Math.min(this.y1,this.y2),Math.abs(this.x2-this.x1),Math.abs(this.y2-this.y1))}isPointInPath(t,e){return this.x1===this.x2||this.y1===this.y2?this.getBBox().clone().grow(this.strokeWidth/2).containsPoint(t,e):!1}distanceSquared(t,e){const{x1:i,y1:s,x2:n,y2:o}=this;return lineDistanceSquared(t,e,i,s,n,o,1/0)}render(t){const{ctx:e,devicePixelRatio:i}=t;let{x1:s,y1:n,x2:o,y2:a}=this;if(s===o){const{strokeWidth:r}=this,l=Math.round(s*i)/i+Math.trunc(r*i)%2/(i*2);s=l,o=l}else if(n===a){const{strokeWidth:r}=this,l=Math.round(n*i)/i+Math.trunc(r*i)%2/(i*2);n=l,a=l}e.beginPath(),e.moveTo(s,n),e.lineTo(o,a),this.fillStroke(e),this.fillShadow?.markClean(),super.render(t)}toSVG(){if(!this.visible)return;const t=createSvgElement("line");return t.setAttribute("x1",String(this.x1)),t.setAttribute("y1",String(this.y1)),t.setAttribute("x2",String(this.x2)),t.setAttribute("y2",String(this.y2)),this.applySvgStrokeAttributes(t),{elements:[t]}}};Line.className="Line",Line.defaultStyles={...Shape.defaultStyles,fill:void 0,strokeWidth:1},__decorateClass2([SceneChangeDetection()],Line.prototype,"x1",2),__decorateClass2([SceneChangeDetection()],Line.prototype,"y1",2),__decorateClass2([SceneChangeDetection()],Line.prototype,"x2",2),__decorateClass2([SceneChangeDetection()],Line.prototype,"y2",2);var Range=class extends Shape{constructor(t={}){super(t),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.startLine=!1,this.endLine=!1,this.isRange=!1,this.restoreOwnStyles()}computeBBox(){return new BBox(this.x1,this.y1,this.x2-this.x1,this.y2-this.y1)}isPointInPath(t,e){return!1}render(t){const{ctx:e}=t;let{x1:i,y1:s,x2:n,y2:o}=this;i=this.align(i),s=this.align(s),n=this.align(n),o=this.align(o);const{fill:a,opacity:r,isRange:l}=this;if(!!(l&&a)){const{fillOpacity:f}=this;this.applyFill(e),e.globalAlpha=r*f,e.beginPath(),e.moveTo(i,s),e.lineTo(n,s),e.lineTo(n,o),e.lineTo(i,o),e.closePath(),e.fill()}const{stroke:h,strokeWidth:d,startLine:u,endLine:p}=this;if(!!((u||p)&&h&&d)){const{strokeOpacity:f,lineDash:m,lineDashOffset:y,lineCap:x,lineJoin:b}=this;this.applyStroke(e),e.globalAlpha=r*f,e.lineWidth=d,m&&e.setLineDash(m),y&&(e.lineDashOffset=y),x&&(e.lineCap=x),b&&(e.lineJoin=b),e.beginPath(),u&&(e.moveTo(i,s),e.lineTo(n,s)),p&&(e.moveTo(n,o),e.lineTo(i,o)),e.stroke()}this.fillShadow?.markClean(),super.render(t)}};Range.className="Range",Range.defaultStyles={...Shape.defaultStyles,strokeWidth:1},__decorateClass2([SceneChangeDetection()],Range.prototype,"x1",2),__decorateClass2([SceneChangeDetection()],Range.prototype,"y1",2),__decorateClass2([SceneChangeDetection()],Range.prototype,"x2",2),__decorateClass2([SceneChangeDetection()],Range.prototype,"y2",2),__decorateClass2([SceneChangeDetection()],Range.prototype,"startLine",2),__decorateClass2([SceneChangeDetection()],Range.prototype,"endLine",2),__decorateClass2([SceneChangeDetection()],Range.prototype,"isRange",2);var Label=class extends BaseProperties{constructor(){super(...arguments),this.enabled=!0}getFont(){return TextUtils.toFontString(this)}};__decorateClass2([TempValidate(BOOLEAN)],Label.prototype,"enabled",2),__decorateClass2([TempValidate(COLOR_STRING,{optional:!0})],Label.prototype,"color",2),__decorateClass2([TempValidate(FONT_STYLE,{optional:!0})],Label.prototype,"fontStyle",2),__decorateClass2([TempValidate(FONT_WEIGHT,{optional:!0})],Label.prototype,"fontWeight",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],Label.prototype,"fontSize",2),__decorateClass2([TempValidate(STRING)],Label.prototype,"fontFamily",2),__decorateClass2([TempValidate(FUNCTION,{optional:!0})],Label.prototype,"formatter",2);function calculateLabelRotation(t){const{parallelFlipRotation:e=0,regularFlipRotation:i=0}=t,s=t.rotation?normalizeAngle360(toRadians(t.rotation)):0,n=!s&&e>=0&&e<=Math.PI?-1:1,o=!s&&i>=0&&i<=Math.PI?-1:1;let a=0;return t.parallel?a=n*Math.PI/2:o===-1&&(a=Math.PI),{configuredRotation:s,defaultRotation:a,parallelFlipFlag:n,regularFlipFlag:o}}function getLabelSpacing(t,e){return t??(e?0:10)}function getTextBaseline(t,e,i,s){return t&&!e?i*s===-1?"hanging":"bottom":"middle"}function getTextAlign(t,e,i,s,n){const o=e>0&&e<=Math.PI,a=i>0&&i<=Math.PI,r=o||a?-1:1;if(t)if(e||i){if(s*r===-1)return"end"}else return"center";else if(s*n===-1)return"end";return"start"}function createLabelData(t,e,i,s){const n=[];for(const{tickLabel:o,translationY:a}of t){if(!o)continue;const{width:r,height:l}=s.measureLines(o),c=new BBox(e,a,r,l),h=new BBox(e,a,0,0);i.transformBBox(h,c);const{x:d,y:u}=c;n.push({point:{x:d,y:u},label:{text:o,width:r,height:l}})}return n}function isStringObject(t){return t!=null&&Object.hasOwn(t,"toString")&&isString(t.toString())}function isNumberObject(t){return t!=null&&Object.hasOwn(t,"valueOf")&&isFiniteNumber(t.valueOf())}function isContinuous(t){return isFiniteNumber(t)||isValidDate(t)||isNumberObject(t)}function checkDatum(t,e){return t!=null&&(!e||isContinuous(t))}function transformIntegratedCategoryValue(t){return isStringObject(t)&&Object.hasOwn(t,"id")?t.id:t}var MATCHING_CROSSLINE_TYPE=t=>t==="value"?predicateWithMessage((e,i)=>i.target.type==="line",e=>e.target.type==="range"?"crossLine type 'range' to have a 'range' property instead of 'value'":"crossLine property 'type' to be 'line'"):predicateWithMessage((e,i)=>i.target.type==="range",e=>e.target.type==="line"?"crossLine type 'line' to have a 'value' property instead of 'range'":"crossLine property 'type' to be 'range'");function getCrossLineValue(t){switch(t.type){case"line":return t.value;case"range":return t.range}}function validateCrossLineValue(t,e){if(t==null)return!1;const i=ContinuousScale.is(e)||OrdinalTimeScale.is(e),s=n=>checkDatum(n,i)&&!isNaN(e.convert(n));if(isArray(t)){const[n,o]=t;return s(n)&&s(o)}else return s(t)}var horizontalCrosslineTranslationDirections={top:{xTranslationDirection:0,yTranslationDirection:-1},bottom:{xTranslationDirection:0,yTranslationDirection:1},left:{xTranslationDirection:-1,yTranslationDirection:0},right:{xTranslationDirection:1,yTranslationDirection:0},"top-left":{xTranslationDirection:1,yTranslationDirection:-1},"top-right":{xTranslationDirection:-1,yTranslationDirection:-1},"bottom-left":{xTranslationDirection:1,yTranslationDirection:1},"bottom-right":{xTranslationDirection:-1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},"inside-left":{xTranslationDirection:1,yTranslationDirection:0},"inside-right":{xTranslationDirection:-1,yTranslationDirection:0},"inside-top":{xTranslationDirection:0,yTranslationDirection:1},"inside-bottom":{xTranslationDirection:0,yTranslationDirection:-1},"inside-top-left":{xTranslationDirection:1,yTranslationDirection:1},"inside-bottom-left":{xTranslationDirection:1,yTranslationDirection:-1},"inside-top-right":{xTranslationDirection:-1,yTranslationDirection:1},"inside-bottom-right":{xTranslationDirection:-1,yTranslationDirection:-1}},verticalCrossLineTranslationDirections={top:{xTranslationDirection:1,yTranslationDirection:0},bottom:{xTranslationDirection:-1,yTranslationDirection:0},left:{xTranslationDirection:0,yTranslationDirection:-1},right:{xTranslationDirection:0,yTranslationDirection:1},"top-left":{xTranslationDirection:-1,yTranslationDirection:-1},"top-right":{xTranslationDirection:-1,yTranslationDirection:1},"bottom-left":{xTranslationDirection:1,yTranslationDirection:-1},"bottom-right":{xTranslationDirection:1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},"inside-left":{xTranslationDirection:0,yTranslationDirection:1},"inside-right":{xTranslationDirection:0,yTranslationDirection:-1},"inside-top":{xTranslationDirection:-1,yTranslationDirection:0},"inside-bottom":{xTranslationDirection:1,yTranslationDirection:0},"inside-top-left":{xTranslationDirection:-1,yTranslationDirection:1},"inside-bottom-left":{xTranslationDirection:1,yTranslationDirection:1},"inside-top-right":{xTranslationDirection:-1,yTranslationDirection:-1},"inside-bottom-right":{xTranslationDirection:1,yTranslationDirection:-1}};function calculateLabelTranslation({yDirection:t,padding:e=0,position:i="top",bbox:s}){const n=t?horizontalCrosslineTranslationDirections:verticalCrossLineTranslationDirections,{xTranslationDirection:o,yTranslationDirection:a}=n[i],r=o*(e+s.width/2),l=a*(e+s.height/2);return{xTranslation:r,yTranslation:l}}function calculateLabelChartPadding({yDirection:t,bbox:e,padding:i=0,position:s="top"}){const n={};return s.startsWith("inside")||(s==="top"&&!t?n.top=i+e.height:s==="bottom"&&!t?n.bottom=i+e.height:s==="left"&&t?n.left=i+e.width:s==="right"&&t&&(n.right=i+e.width)),n}var POSITION_TOP_COORDINATES=({direction:t,xEnd:e,yStart:i,yEnd:s})=>t==="y"?{x:e/2,y:i}:{x:e,y:isNaN(s)?i:(i+s)/2},POSITION_LEFT_COORDINATES=({direction:t,xStart:e,xEnd:i,yStart:s,yEnd:n})=>t==="y"?{x:e,y:isNaN(n)?s:(s+n)/2}:{x:i/2,y:s},POSITION_RIGHT_COORDINATES=({direction:t,xEnd:e,yStart:i,yEnd:s})=>t==="y"?{x:e,y:isNaN(s)?i:(i+s)/2}:{x:e/2,y:isNaN(s)?i:s},POSITION_BOTTOM_COORDINATES=({direction:t,xStart:e,xEnd:i,yStart:s,yEnd:n})=>t==="y"?{x:i/2,y:isNaN(n)?s:n}:{x:e,y:isNaN(n)?s:(s+n)/2},POSITION_INSIDE_COORDINATES=({xEnd:t,yStart:e,yEnd:i})=>({x:t/2,y:isNaN(i)?e:(e+i)/2}),POSITION_TOP_LEFT_COORDINATES=({direction:t,xStart:e,xEnd:i,yStart:s})=>t==="y"?{x:e/2,y:s}:{x:i,y:s},POSITION_BOTTOM_LEFT_COORDINATES=({direction:t,xStart:e,yStart:i,yEnd:s})=>t==="y"?{x:e,y:isNaN(s)?i:s}:{x:e,y:i},POSITION_TOP_RIGHT_COORDINATES=({direction:t,xEnd:e,yStart:i,yEnd:s})=>t==="y"?{x:e,y:i}:{x:e,y:isNaN(s)?i:s},POSITION_BOTTOM_RIGHT_COORDINATES=({direction:t,xStart:e,xEnd:i,yStart:s,yEnd:n})=>t==="y"?{x:i,y:isNaN(n)?s:n}:{x:e,y:isNaN(n)?s:n},labelDirectionHandling={top:{c:POSITION_TOP_COORDINATES},bottom:{c:POSITION_BOTTOM_COORDINATES},left:{c:POSITION_LEFT_COORDINATES},right:{c:POSITION_RIGHT_COORDINATES},"top-left":{c:POSITION_TOP_LEFT_COORDINATES},"top-right":{c:POSITION_TOP_RIGHT_COORDINATES},"bottom-left":{c:POSITION_BOTTOM_LEFT_COORDINATES},"bottom-right":{c:POSITION_BOTTOM_RIGHT_COORDINATES},inside:{c:POSITION_INSIDE_COORDINATES},"inside-left":{c:POSITION_LEFT_COORDINATES},"inside-right":{c:POSITION_RIGHT_COORDINATES},"inside-top":{c:POSITION_TOP_COORDINATES},"inside-bottom":{c:POSITION_BOTTOM_COORDINATES},"inside-top-left":{c:POSITION_TOP_LEFT_COORDINATES},"inside-bottom-left":{c:POSITION_BOTTOM_LEFT_COORDINATES},"inside-top-right":{c:POSITION_TOP_RIGHT_COORDINATES},"inside-bottom-right":{c:POSITION_BOTTOM_RIGHT_COORDINATES}},CROSSLINE_LABEL_POSITION=UNION(["top","left","right","bottom","top-left","top-right","bottom-left","bottom-right","inside","inside-left","inside-right","inside-top","inside-bottom","inside-top-left","inside-bottom-left","inside-top-right","inside-bottom-right"],"crossLine label position"),CartesianCrossLineLabel=class extends BaseProperties{constructor(){super(...arguments),this.fontSize=14,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)"}};__decorateClass2([TempValidate(BOOLEAN,{optional:!0})],CartesianCrossLineLabel.prototype,"enabled",2),__decorateClass2([TempValidate(STRING,{optional:!0})],CartesianCrossLineLabel.prototype,"text",2),__decorateClass2([TempValidate(FONT_STYLE,{optional:!0})],CartesianCrossLineLabel.prototype,"fontStyle",2),__decorateClass2([TempValidate(FONT_WEIGHT,{optional:!0})],CartesianCrossLineLabel.prototype,"fontWeight",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],CartesianCrossLineLabel.prototype,"fontSize",2),__decorateClass2([TempValidate(STRING)],CartesianCrossLineLabel.prototype,"fontFamily",2),__decorateClass2([TempValidate(NUMBER)],CartesianCrossLineLabel.prototype,"padding",2),__decorateClass2([TempValidate(COLOR_STRING,{optional:!0})],CartesianCrossLineLabel.prototype,"color",2),__decorateClass2([TempValidate(CROSSLINE_LABEL_POSITION,{optional:!0})],CartesianCrossLineLabel.prototype,"position",2),__decorateClass2([TempValidate(NUMBER,{optional:!0})],CartesianCrossLineLabel.prototype,"rotation",2),__decorateClass2([TempValidate(BOOLEAN,{optional:!0})],CartesianCrossLineLabel.prototype,"parallel",2);var CartesianCrossLine=class extends BaseProperties{constructor(){super(),this.id=createId(this),this.defaultColorRange=[],this.fill="#c16068",this.label=new CartesianCrossLineLabel,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.direction="x",this.rangeGroup=new Group({name:this.id}),this.lineGroup=new Group({name:this.id}),this.labelGroup=new Group({name:this.id}),this.crossLineRange=new Range,this.crossLineLabel=new TransformableText,this.labelPoint=void 0,this.data=void 0,this.startLine=!1,this.endLine=!1,this._isRange=void 0,this.lineGroup.append(this.crossLineRange),this.labelGroup.append(this.crossLineLabel),this.crossLineRange.pointerEvents=1}update(t){const{enabled:e,type:i,data:s,scale:n}=this;if(!n||!e||!t||!this.isValid()||!validateCrossLineValue(getCrossLineValue(this),n)||s==null){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,this.updateNodes();const o=i==="range";o!==this._isRange&&(o?this.rangeGroup.appendChild(this.crossLineRange):this.lineGroup.appendChild(this.crossLineRange)),this._isRange=o}calculateLayout(t,e){if(!t)return;const{type:i,range:s,value:n,scale:o,gridLength:a,sideFlag:r,direction:l,label:{position:c="top"},clippedRange:h,strokeWidth:d=0}=this;if(this.data=void 0,!o)return;const u=o.bandwidth??0,p=o.step??0,g=(e?-1:1)*(o instanceof BandScale?(p-u)/2:0),[f,m]=[0,r*a];let y,x,b,S;if(i==="line"){const T=u/2;y=o.convert(n)+T,x=NaN,b=o.convert(n,!0)+T,S=NaN}else if(s){const[T,k]=s,w=T?.valueOf()===k?.valueOf()&&OrdinalTimeScale.is(o)?u/2+g:0;y=o.convert(T)+w,x=o.convert(k)+u,b=o.convert(T,!0)+w-g,S=o.convert(k,!0)+u+g}else return;b=clampArray(b,h),S=clampArray(S,h);const v=(y===b||x===S||b!==S)&&Math.abs(S-b)>0;if(v&&b>S&&([b,S]=[S,b],[y,x]=[x,y]),y-g>=b&&(y-=g),x+g<=S&&(x+=g),this.startLine=d>0&&y>=b&&y<=b+g,this.endLine=d>0&&x>=S-u-g&&x<=S,i==="range"&&!v&&!this.startLine&&!this.endLine||(this.data=[b,S],this.label.enabled===!1||!this.label.text))return;const{c:I=POSITION_TOP_COORDINATES}=labelDirectionHandling[c]??{},{x:A,y:D}=I({direction:l,xStart:f,xEnd:m,yStart:b,yEnd:S});this.labelPoint={x:A,y:D}}updateNodes(){this.updateRangeNode();const{label:t}=this;t.enabled!==!1&&t.text&&(this.updateLabel(),this.positionLabel())}updateRangeNode(){const{type:t,crossLineRange:e,sideFlag:i,gridLength:s,data:n,startLine:o,endLine:a,fill:r,fillOpacity:l,stroke:c,strokeWidth:h,lineDash:d}=this;e.x1=0,e.x2=i*s,e.y1=n?.[0]??0,e.y2=n?.[1]??0,e.startLine=o,e.endLine=a,e.isRange=t==="range",e.fill=r,e.fillOpacity=l??1,e.stroke=c,e.strokeWidth=h??1,e.strokeOpacity=this.strokeOpacity??1,e.lineDash=d}updateLabel(){const{crossLineLabel:t,label:e}=this;e.text&&(t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.fontSize=e.fontSize,t.fontFamily=e.fontFamily,t.fill=e.color,t.text=e.text)}positionLabel(){const{crossLineLabel:t,labelPoint:{x:e=void 0,y:i=void 0}={},label:{parallel:s,rotation:n,position:o="top",padding:a=0},direction:r,parallelFlipRotation:l,regularFlipRotation:c}=this;if(e===void 0||i===void 0)return;const{defaultRotation:h,configuredRotation:d}=calculateLabelRotation({rotation:n,parallel:s,regularFlipRotation:c,parallelFlipRotation:l});t.rotation=h+d,t.textBaseline="middle",t.textAlign="center";const u=t.getBBox();if(!u)return;const p=r==="y",{xTranslation:g,yTranslation:f}=calculateLabelTranslation({yDirection:p,padding:a,position:o,bbox:u});t.translationX=e+g,t.translationY=i+f}computeLabelBBox(){const{label:t}=this;if(t.enabled===!1||!t.text)return;const e=new TransformableText;e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.text=t.text;const{labelPoint:{x:i=void 0,y:s=void 0}={},label:{parallel:n,rotation:o,position:a="top",padding:r=0},direction:l,parallelFlipRotation:c,regularFlipRotation:h}=this;if(i===void 0||s===void 0)return;const{configuredRotation:d}=calculateLabelRotation({rotation:o,parallel:n,regularFlipRotation:h,parallelFlipRotation:c});e.rotation=d,e.textBaseline="middle",e.textAlign="center";const u=e.getBBox();if(!u)return;const p=l==="y",{xTranslation:g,yTranslation:f}=calculateLabelTranslation({yDirection:p,padding:r,position:a,bbox:u});return e.x=i+g,e.y=s+f,e.getBBox()}calculatePadding(t){const{data:e,direction:i,label:{padding:s=0,position:n="top"}}=this;if(e==null)return;const o=this.computeLabelBBox();if(o?.x==null||o?.y==null)return;const a=calculateLabelChartPadding({yDirection:i==="y",padding:s,position:n,bbox:o});t.left=Math.max(t.left??0,a.left??0),t.right=Math.max(t.right??0,a.right??0),t.top=Math.max(t.top??0,a.top??0),t.bottom=Math.max(t.bottom??0,a.bottom??0)}};CartesianCrossLine.className="CrossLine",__decorateClass2([TempValidate(BOOLEAN,{optional:!0})],CartesianCrossLine.prototype,"enabled",2),__decorateClass2([TempValidate(UNION(["range","line"],"a crossLine type"))],CartesianCrossLine.prototype,"type",2),__decorateClass2([TempValidate(AND(MATCHING_CROSSLINE_TYPE("range"),ARRAY.restrict({length:2})),{optional:!0})],CartesianCrossLine.prototype,"range",2),__decorateClass2([TempValidate(MATCHING_CROSSLINE_TYPE("value"),{optional:!0})],CartesianCrossLine.prototype,"value",2),__decorateClass2([TempValidate(COLOR_STRING_ARRAY)],CartesianCrossLine.prototype,"defaultColorRange",2),__decorateClass2([TempValidate(COLOR_STRING)],CartesianCrossLine.prototype,"fill",2),__decorateClass2([TempValidate(RATIO,{optional:!0})],CartesianCrossLine.prototype,"fillOpacity",2),__decorateClass2([TempValidate(COLOR_STRING,{optional:!0})],CartesianCrossLine.prototype,"stroke",2),__decorateClass2([TempValidate(NUMBER,{optional:!0})],CartesianCrossLine.prototype,"strokeWidth",2),__decorateClass2([TempValidate(RATIO,{optional:!0})],CartesianCrossLine.prototype,"strokeOpacity",2),__decorateClass2([TempValidate(LINE_DASH,{optional:!0})],CartesianCrossLine.prototype,"lineDash",2),__decorateClass2([TempValidate(OBJECT)],CartesianCrossLine.prototype,"label",2);var GRID_STYLE_KEYS=["stroke","lineDash"],GRID_STYLE=ARRAY_OF(t=>isObject(t)&&Object.keys(t).every(e=>GRID_STYLE_KEYS.includes(e)),"objects with gridline style properties such as 'stroke' or 'lineDash'"),AxisGridLine=class{constructor(){this.enabled=!0,this.width=1,this.style=[{stroke:void 0,lineDash:[]}]}};__decorateClass2([TempValidate(BOOLEAN)],AxisGridLine.prototype,"enabled",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],AxisGridLine.prototype,"width",2),__decorateClass2([TempValidate(GRID_STYLE)],AxisGridLine.prototype,"style",2);var TICK_INTERVAL=predicateWithMessage(t=>isFiniteNumber(t)&&t>0||t instanceof TimeInterval,"a non-zero positive Number value or, for a time axis, a Time Interval such as 'agCharts.time.month'"),AxisInterval=class extends BaseProperties{};__decorateClass2([TempValidate(TICK_INTERVAL,{optional:!0})],AxisInterval.prototype,"step",2),__decorateClass2([TempValidate(ARRAY,{optional:!0})],AxisInterval.prototype,"values",2),__decorateClass2([TempValidate(MIN_SPACING,{optional:!0})],AxisInterval.prototype,"minSpacing",2),__decorateClass2([TempValidate(MAX_SPACING,{optional:!0})],AxisInterval.prototype,"maxSpacing",2);var AxisLabel=class extends BaseProperties{constructor(){super(...arguments),this.enabled=!0,this.spacing=5,this.color="#575757",this.avoidCollisions=!0,this.mirrored=!1,this.parallel=!1}getSideFlag(){return this.mirrored?1:-1}getFont(){return TextUtils.toFontString(this)}};__decorateClass2([TempValidate(BOOLEAN)],AxisLabel.prototype,"enabled",2),__decorateClass2([TempValidate(FONT_STYLE,{optional:!0})],AxisLabel.prototype,"fontStyle",2),__decorateClass2([TempValidate(FONT_WEIGHT,{optional:!0})],AxisLabel.prototype,"fontWeight",2),__decorateClass2([TempValidate(NUMBER.restrict({min:1}))],AxisLabel.prototype,"fontSize",2),__decorateClass2([TempValidate(STRING)],AxisLabel.prototype,"fontFamily",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],AxisLabel.prototype,"spacing",2),__decorateClass2([TempValidate(NUMBER_OR_NAN,{optional:!0})],AxisLabel.prototype,"minSpacing",2),__decorateClass2([TempValidate(COLOR_STRING,{optional:!0})],AxisLabel.prototype,"color",2),__decorateClass2([TempValidate(NUMBER,{optional:!0})],AxisLabel.prototype,"rotation",2),__decorateClass2([TempValidate(BOOLEAN)],AxisLabel.prototype,"avoidCollisions",2),__decorateClass2([TempValidate(BOOLEAN)],AxisLabel.prototype,"mirrored",2),__decorateClass2([TempValidate(BOOLEAN)],AxisLabel.prototype,"parallel",2),__decorateClass2([TempValidate(FUNCTION,{optional:!0})],AxisLabel.prototype,"itemStyler",2),__decorateClass2([TempValidate(FUNCTION,{optional:!0})],AxisLabel.prototype,"formatter",2),__decorateClass2([TempValidate(STRING,{optional:!0})],AxisLabel.prototype,"format",2);var AxisLine=class{constructor(){this.enabled=!0,this.width=1,this.stroke=void 0}};__decorateClass2([TempValidate(BOOLEAN)],AxisLine.prototype,"enabled",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],AxisLine.prototype,"width",2),__decorateClass2([TempValidate(COLOR_STRING,{optional:!0})],AxisLine.prototype,"stroke",2);var AxisTick=class extends BaseProperties{constructor(){super(...arguments),this.enabled=!0,this.width=1,this.size=6}};__decorateClass2([TempValidate(BOOLEAN)],AxisTick.prototype,"enabled",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],AxisTick.prototype,"width",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],AxisTick.prototype,"size",2),__decorateClass2([TempValidate(COLOR_STRING,{optional:!0})],AxisTick.prototype,"stroke",2);var AxisTitle=class extends BaseProperties{constructor(){super(...arguments),this.caption=new Caption,this.enabled=!1,this.spacing=Caption.SMALL_PADDING,this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always"}};__decorateClass2([TempValidate(BOOLEAN)],AxisTitle.prototype,"enabled",2),__decorateClass2([TempValidate(STRING,{optional:!0})],AxisTitle.prototype,"text",2),__decorateClass2([TempValidate(POSITIVE_NUMBER,{optional:!0})],AxisTitle.prototype,"spacing",2),__decorateClass2([TempValidate(FONT_STYLE,{optional:!0})],AxisTitle.prototype,"fontStyle",2),__decorateClass2([TempValidate(FONT_WEIGHT,{optional:!0})],AxisTitle.prototype,"fontWeight",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],AxisTitle.prototype,"fontSize",2),__decorateClass2([TempValidate(STRING)],AxisTitle.prototype,"fontFamily",2),__decorateClass2([TempValidate(COLOR_STRING,{optional:!0})],AxisTitle.prototype,"color",2),__decorateClass2([TempValidate(TEXT_WRAP)],AxisTitle.prototype,"wrapping",2),__decorateClass2([TempValidate(FUNCTION,{optional:!0})],AxisTitle.prototype,"formatter",2);var NiceMode=(t=>(t[t.TickAndDomain=0]="TickAndDomain",t[t.TicksOnly=1]="TicksOnly",t[t.Off=2]="Off",t))(NiceMode||{});function prepareAxisAnimationContext(t){const[e,i]=findMinMax(t.range),s=Math.floor(e),n=Math.ceil(i);return{min:s,max:n,visible:s!==n}}var fullCircle=Math.PI*2,halfCircle=fullCircle/2;function normaliseEndRotation(t,e){return Math.abs(e-t)<halfCircle?e:t>e?e+fullCircle:e-fullCircle}function prepareAxisAnimationFunctions(t){const e=(a,r)=>{const[l=t.min,c=t.max]=findMinMax(r??[]);return a<l||a>c};return{tick:{fromFn(a,r,l){let c=a.y1+a.translationY,h=a.opacity;return(l==="added"||e(a.datum.translationY,a.datum.range))&&(c=r.translationY,h=0),{y:0,translationY:c,opacity:h,phase:NODE_UPDATE_STATE_TO_PHASE_MAPPING[l]}},toFn(a,r,l){const c=r.translationY;let h=1;return l==="removed"&&(h=0),{y:0,translationY:c,opacity:h,finish:{y:c,translationY:0}}},applyFn(a,r){a.setProperties(r),a.visible=!e(a.y)}},line:{fromFn(a,r){return{...a.previousDatum??r,phase:NODE_UPDATE_STATE_TO_PHASE_MAPPING.updated}},toFn(a,r){return{...r}}},label:{fromFn(a,r,l){const c=a.previousDatum??r,h=c.x,d=c.y,u=c.rotationCenterX;let p=Math.round(a.translationY),g=c.rotation,f=a.opacity;return l==="removed"||e(c.y,c.range)?g=r.rotation:(l==="added"||e(a.datum.y,a.datum.range))&&(p=Math.round(c.translationY),f=0,g=r.rotation),{x:h,y:d,rotationCenterX:u,translationY:p,rotation:g,opacity:f,phase:NODE_UPDATE_STATE_TO_PHASE_MAPPING[l]}},toFn(a,r,l){const c=r.x,h=r.y,d=r.rotationCenterX,u=Math.round(r.translationY);let p=0,g=1;return l==="added"?p=r.rotation:l==="removed"?(g=0,p=r.rotation):p=normaliseEndRotation(a.previousDatum?.rotation??r.rotation,r.rotation),{x:c,y:h,rotationCenterX:d,translationY:u,rotation:p,opacity:g,finish:{rotation:r.rotation}}}},group:{fromFn(a,r){const{rotation:l,translationX:c,translationY:h}=a;return{rotation:l,translationX:c,translationY:h,phase:NODE_UPDATE_STATE_TO_PHASE_MAPPING.updated}},toFn(a,r){const{rotation:l,translationX:c,translationY:h}=r;return{rotation:l,translationX:c,translationY:h}}}}}function resetAxisGroupFn(){return(t,e)=>({rotation:e.rotation,rotationCenterX:e.rotationCenterX,rotationCenterY:e.rotationCenterY,translationX:e.translationX,translationY:e.translationY})}function resetAxisSelectionFn(t){const{visible:e,min:i,max:s}=t;return(n,o)=>{const a=o.translationY,r=e&&a>=i&&a<=s;return{y:a,translationY:0,opacity:1,visible:r}}}function resetAxisLabelSelectionFn(){return(t,e)=>({x:e.x,y:e.y,translationY:e.translationY,rotation:e.rotation,rotationCenterX:e.rotationCenterX})}function resetAxisLineSelectionFn(){return(t,e)=>({...e})}var TranslatableLine=class extends Translatable(Line){},AxisGroupZIndexMap=(t=>(t[t.TickLines=0]="TickLines",t[t.AxisLine=1]="AxisLine",t[t.TickLabels=2]="TickLabels",t))(AxisGroupZIndexMap||{}),_Axis=class Qt{constructor(e,i){this.moduleCtx=e,this.scale=i,this.id=createId(this),this.nice=!0,this.reverse=!1,this.keys=[],this.interval=new AxisInterval,this.dataDomain={domain:[],clipped:!1},this.layoutConstraints={stacked:!0,align:"start",width:100,unit:"percent"},this.boundSeries=[],this.includeInvisibleDomains=!1,this.interactionEnabled=!0,this.axisGroup=new TransformableGroup({name:`${this.id}-axis`}),this.tickLineGroup=this.axisGroup.appendChild(new Group({name:`${this.id}-Axis-tick-lines`,zIndex:0})),this.tickLabelGroup=this.axisGroup.appendChild(new Group({name:`${this.id}-Axis-tick-labels`,zIndex:2})),this.labelGroup=new Group({name:`${this.id}-Labels`,zIndex:9}),this.gridGroup=new TransformableGroup({name:`${this.id}-Axis-grid`,zIndex:1}),this.gridLineGroup=this.gridGroup.appendChild(new Group({name:`${this.id}-gridLines`})),this.crossLineRangeGroup=new TransformableGroup({name:`${this.id}-CrossLines-Range`,zIndex:4}),this.crossLineLineGroup=new TransformableGroup({name:`${this.id}-CrossLines-Line`,zIndex:8}),this.crossLineLabelGroup=new TransformableGroup({name:`${this.id}-CrossLines-Label`,zIndex:13}),this.tickLineGroupSelection=Selection.select(this.tickLineGroup,TranslatableLine,!1),this.tickLabelGroupSelection=Selection.select(this.tickLabelGroup,TransformableText,!1),this.gridLineGroupSelection=Selection.select(this.gridLineGroup,TranslatableLine,!1),this._crossLines=[],this.line=new AxisLine,this.tick=new AxisTick,this.gridLine=new AxisGridLine,this.label=this.createLabel(),this.defaultTickMinSpacing=Qt.defaultTickMinSpacing,this.translation={x:0,y:0},this.rotation=0,this.layout={label:{fractionDigits:0,spacing:this.label.spacing,format:this.label.format}},this.axisContext=void 0,this.labelFormatter=void 0,this.datumFormatter=void 0,this.scaleFormatterParams=void 0,this.destroyFns=[],this.range=[0,1],this.visibleRange=[0,1],this.title=new AxisTitle,this.gridLength=0,this.gridPadding=0,this.seriesAreaPadding=0,this.animatable=!0,this._scaleNiceDomainInputDomain=void 0,this._scaleNiceDomainRangeExtent=NaN,this.moduleMap=new ModuleMap,this.range=this.scale.range.slice(),this.crossLines.forEach(s=>this.initCrossLine(s))}get type(){return this.constructor.type??""}get labelNodes(){return this.tickLabelGroupSelection.nodes()}set crossLines(e){const{CrossLineConstructor:i}=this.constructor;this._crossLines.forEach(s=>this.detachCrossLine(s)),this._crossLines=e.map(s=>{const n=new i;return n.set(s),n}),this._crossLines.forEach(s=>{this.attachCrossLine(s),this.initCrossLine(s)})}get crossLines(){return this._crossLines}resetAnimation(e){}attachCrossLine(e){this.crossLineRangeGroup.appendChild(e.rangeGroup),this.crossLineLineGroup.appendChild(e.lineGroup),this.crossLineLabelGroup.appendChild(e.labelGroup)}detachCrossLine(e){this.crossLineRangeGroup.removeChild(e.rangeGroup),this.crossLineLineGroup.removeChild(e.lineGroup),this.crossLineLabelGroup.removeChild(e.labelGroup)}destroy(){this.moduleMap.destroy(),this.destroyFns.forEach(e=>e())}updateScale(){const{range:e,visibleRange:i,scale:s}=this,n=(e[1]-e[0])/(i[1]-i[0]),o=n*i[0],a=e[0]-o;s.range=[a,a+n],this.crossLines.forEach(r=>{r.clippedRange=[e[0],e[1]]})}setCrossLinesVisible(e){this.crossLineRangeGroup.visible=e,this.crossLineLineGroup.visible=e,this.crossLineLabelGroup.visible=e}attachAxis(e){e.gridNode.appendChild(this.gridGroup),e.axisNode.appendChild(this.axisGroup),e.labelNode.appendChild(this.labelGroup),e.crossLineRangeNode.appendChild(this.crossLineRangeGroup),e.crossLineLineNode.appendChild(this.crossLineLineGroup),e.crossLineLabelNode.appendChild(this.crossLineLabelGroup)}detachAxis(e){e.gridNode.removeChild(this.gridGroup),e.axisNode.removeChild(this.axisGroup),e.labelNode.removeChild(this.labelGroup),e.crossLineRangeNode.removeChild(this.crossLineRangeGroup),e.crossLineLineNode.removeChild(this.crossLineLineGroup),e.crossLineLabelNode.removeChild(this.crossLineLabelGroup)}attachLabel(e){this.labelGroup.append(e)}inRange(e,i=0){const[s,n]=findMinMax(this.range);return e>=s-i&&e<=n+i}getRangeOverflow(e){const{range:i,visibleRange:s}=this,n=(i[1]-i[0])/(s[1]-s[0]),[o,a]=findMinMax([i[0]-n*s[0],i[0]-n*s[0]+n]);return e<o?e-o:e>a?e-a:0}defaultDatumFormatter(e,i){return formatValue(e,i+1)}defaultLabelFormatter(e,i){return formatValue(e,i)}onGridLengthChange(e,i){i^e&&this.onGridVisibilityChange(),this.crossLines.forEach(s=>this.initCrossLine(s))}onGridVisibilityChange(){this.gridLineGroupSelection.clear()}createLabel(){return new AxisLabel}update(){this.updatePosition(),this.updateSelections(),this.tickLineGroup.visible=this.tick.enabled,this.gridLineGroup.visible=this.gridLine.enabled,this.tickLabelGroup.visible=this.label.enabled,this.updateLabels(),this.updateGridLines(),this.updateTickLines(),this.updateCrossLines()}getAxisLineCoordinates(){const[e,i]=findMinMax(this.range);return{x:0,y1:e,y2:i}}getLabelStyles(e,i){const{label:s}=this,n={color:s.color,spacing:s.spacing,fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight};let o;s.itemStyler&&(o=this.moduleCtx.callbackCache.call(this,s.itemStyler,{...e,...n}));const{color:a,fontFamily:r,fontSize:l,fontStyle:c,fontWeight:h,spacing:d}=mergeDefaults(o,i,n);return{fill:a,fontFamily:r,fontSize:l,fontStyle:c,fontWeight:h,spacing:d}}getTickSize(){return this.tick.enabled?this.tick.size:0}processData(){const{includeInvisibleDomains:e,boundSeries:i,direction:s}=this,o=(e?i:i.filter(a=>a.isEnabled())).map(a=>a.getDomain(s));this.setDomains(...o)}setDomains(...e){let i,s;e.length>0?{domain:i,animatable:s}=this.scale.normalizeDomains(...e):(i=[],s=!0),this.dataDomain=this.normaliseDataDomain(i),this.reverse&&this.dataDomain.domain.reverse(),this.animatable=s}calculateLayout(e){const{scale:i,label:s,visibleRange:n,nice:o}=this;this.updateScale();const a=findRangeExtent(this.range),r=this.dataDomain.domain;let l;n[0]===0&&n[1]===1?l=void 0:o?this._scaleNiceDomainInputDomain===r&&this._scaleNiceDomainRangeExtent===a?l=this.scale.domain:l=this.calculateTickLayout(r,0,[0,1]).niceDomain:l=r;let c;o?l==null?c=0:c=1:c=2;const{niceDomain:h,primaryTickCount:d,ticks:u,tickDomain:p,fractionDigits:g,bbox:f}=this.calculateTickLayout(l??r,c,n,e);this.scale.domain=h,this._scaleNiceDomainInputDomain=o?r:void 0,this._scaleNiceDomainRangeExtent=o?a:NaN;const m=s.format;this.labelFormatter=i.tickFormatter({domain:p,specifier:m,ticks:u,fractionDigits:g})??(I=>this.defaultLabelFormatter(I,g)),this.datumFormatter=i.datumFormatter({domain:p,specifier:m,ticks:u,fractionDigits:g})??(I=>this.defaultDatumFormatter(I,g)),this.scaleFormatterParams={domain:p,ticks:u,fractionDigits:g},this.layout.label={fractionDigits:g,spacing:this.label.spacing,format:this.label.format};const y=s.getSideFlag(),x=this.isAnySeriesActive(),{rotation:b,parallelFlipRotation:S,regularFlipRotation:v}=this.calculateRotations();return this.crossLines.forEach(I=>{var A;I.sideFlag=-y,I.direction=b===-Math.PI/2?"x":"y",I instanceof CartesianCrossLine&&((A=I.label).parallel??(A.parallel=s.parallel)),I.parallelFlipRotation=S,I.regularFlipRotation=v,I.calculateLayout?.(x,this.reverse)}),{primaryTickCount:d,bbox:f}}getTransformBox(e){const i=new Matrix,{rotation:s,translationX:n,translationY:o}=this.getAxisTransform();return Matrix.updateTransformMatrix(i,1,1,s,n,o),i.transformBBox(e)}calculateRotations(){const e=toRadians(this.rotation),i=normalizeAngle360(e),s=normalizeAngle360(e-Math.PI/2);return{rotation:e,parallelFlipRotation:i,regularFlipRotation:s}}updateCrossLines(){const e=this.isAnySeriesActive();this.crossLines.forEach(i=>{i.update(e)})}updateTickLines(){const{tick:e,label:i}=this,s=i.getSideFlag();this.tickLineGroupSelection.each((n,o)=>{n.strokeWidth=o.tickWidth??e.width,n.stroke=o.tickStroke??e.stroke,n.x1=s*(o.tickSize??this.getTickSize()),n.x2=0})}getAxisTransform(){return{rotation:toRadians(this.rotation),translationX:Math.floor(this.translation.x),translationY:Math.floor(this.translation.y)}}updatePosition(){const{crossLineRangeGroup:e,crossLineLineGroup:i,crossLineLabelGroup:s,gridGroup:n,translation:o}=this,{rotation:a}=this.calculateRotations(),r=Math.floor(o.x),l=Math.floor(o.y);e.setProperties({rotation:a,translationX:r,translationY:l}),i.setProperties({rotation:a,translationX:r,translationY:l}),s.setProperties({rotation:a,translationX:r,translationY:l}),n.setProperties({rotation:a,translationX:r,translationY:l})}updateGridLines(){const e=this.label.getSideFlag(),{gridLine:{style:i,width:s},gridPadding:n,gridLength:o}=this;o===0||i.length===0||this.gridLineGroupSelection.each((a,r,l)=>{const{stroke:c,lineDash:h}=i[l%i.length];a.setProperties({x1:n,x2:-e*o+n,stroke:c,strokeWidth:s,lineDash:h})})}formatTick(e,i,s,n,o){const{labelFormatter:a,label:{formatter:r},moduleCtx:{callbackCache:l}}=this;let c;if(r){const h=this.getFormatterBoundSeries();c=l.call(this,r,{value:e,index:i,domain:s,fractionDigits:n,boundSeries:h})}else o?c=o(e):a&&(c=a(e));return String(c??e)}formatDatum(e){const{label:{formatter:i},moduleCtx:{callbackCache:s},datumFormatter:n=this.labelFormatter}=this;let o;if(i){const{domain:a}=this.scale,r=this.getFormatterBoundSeries();o=s.call(this,i,{value:e,index:NaN,domain:a,boundSeries:r})}else n?o=s.call(this,n,e):isArray(e)&&(o=e.filter(Boolean).join(" - "));return String(o??e)}getScaleValueFormatter(e){const{scaleFormatterParams:i}=this;let s;try{e!=null&&i!=null&&(s=this.scale.tickFormatter({...i,specifier:e}))}catch{logger_exports.warnOnce(`the format string ${e} is invalid, ignoring.`)}return s??(s=n=>this.formatDatum(n)),s}getBBox(){return this.axisGroup.getBBox()}initCrossLine(e){e.scale=this.scale,e.gridLength=this.gridLength}isAnySeriesActive(){return this.boundSeries.some(e=>this.includeInvisibleDomains||e.isEnabled())}clipTickLines(e,i,s,n){this.tickLineGroup.setClipRect(new BBox(e,i,s,n))}clipGrid(e,i,s,n){this.gridGroup.setClipRect(new BBox(e,i,s,n))}getFormatterBoundSeries(){const{direction:e}=this,i=[];for(const s of this.boundSeries){const n=s.getKeys(e),o=s.getNames(e);for(let a=0;a<n.length;a++)i.push({key:n[a],name:o[a]})}return i}getTitleFormatterParams(e){const{direction:i}=this,s=this.getFormatterBoundSeries();return{domain:e,direction:i,boundSeries:s,defaultValue:this.title?.text}}normaliseDataDomain(e){return{domain:[...e],clipped:!1}}getLayoutState(){return{id:this.id,rect:this.getBBox(),gridPadding:this.gridPadding,seriesAreaPadding:this.seriesAreaPadding,tickSize:this.getTickSize(),direction:this.direction,domain:this.dataDomain.domain,scale:this.scale,...this.layout}}getModuleMap(){return this.moduleMap}createModuleContext(){return this.axisContext??(this.axisContext=this.createAxisContext()),{...this.moduleCtx,parent:this.axisContext}}createAxisContext(){const{scale:e}=this;return{axisId:this.id,scale:this.scale,direction:this.direction,continuous:ContinuousScale.is(e)||OrdinalTimeScale.is(e),getCanvasBounds:()=>Transformable.toCanvas(this.axisGroup),seriesKeyProperties:()=>this.boundSeries.reduce((i,s)=>(s.getKeyProperties(this.direction).forEach(o=>i.add(o)),i),new Set),seriesIds:()=>this.boundSeries.map(i=>i.id),scaleValueFormatter:i=>this.getScaleValueFormatter(i),scaleInvert:i=>e.invert(i,!0),scaleInvertNearest:i=>e.invert(i,!0),attachLabel:i=>this.attachLabel(i),inRange:(i,s)=>this.inRange(i,s),getRangeOverflow:i=>this.getRangeOverflow(i)}}isReversed(){return this.reverse}};_Axis.defaultTickMinSpacing=50,_Axis.CrossLineConstructor=CartesianCrossLine,__decorateClass2([TempValidate(BOOLEAN)],_Axis.prototype,"nice",2),__decorateClass2([TempValidate(BOOLEAN)],_Axis.prototype,"reverse",2),__decorateClass2([TempValidate(STRING_ARRAY)],_Axis.prototype,"keys",2),__decorateClass2([TempValidate(OBJECT)],_Axis.prototype,"interval",2),__decorateClass2([TempValidate(OBJECT)],_Axis.prototype,"title",2),__decorateClass2([ObserveChanges((t,e,i)=>t.onGridLengthChange(e,i))],_Axis.prototype,"gridLength",2);var Axis=_Axis;function calculateNiceSecondaryAxis(t,e,i){let[s,n]=findMinMax(t);s=calculateNiceStart(Math.floor(s),n,e);const o=getTickStep(s,n,e),a=e-1;n=s+a*o;const r=i?[n,s]:[s,n],l=getTicks(s,o,e);return{domain:r,ticks:l}}function calculateNiceStart(t,e,i){const s=Math.abs(e-t)/(i-1),n=Math.floor(Math.log10(s)),o=Math.pow(10,n);return Math.floor(t/o)*o}function getTicks(t,e,i){const s=Math.floor(Math.log10(e)),n=e>0&&e<1?Math.abs(s):0,o=Math.pow(10,n),a=[];for(let r=0;r<i;r++){const l=t+e*r;a[r]=Math.round(l*o)/o}return a}function getTickStep(t,e,i){const s=i-1,n=(e-t)/s;return calculateNextNiceStep(n)}function calculateNextNiceStep(t){const e=Math.floor(Math.log10(t)),i=Math.pow(10,e),s=t/i*10;return s>0&&s<=1?i/10:s>1&&s<=2?2*i/10:s>1&&s<=5?5*i/10:s>5&&s<=10?10*i/10:s>10&&s<=20?20*i/10:s>20&&s<=40?40*i/10:s>40&&s<=50?50*i/10:s>50&&s<=100?100*i/10:s}function createIdsGenerator(){const t=new Map;return e=>{const i=t.get(e);return i?(t.set(e,i+1),`${e}_${i}`):(t.set(e,1),e)}}var AxisTickGenerator=class{constructor(t){this.axis=t}estimateTickCount(t,e,i){return estimateTickCount(findRangeExtent(this.axis.range),findRangeExtent(t),e,i,ContinuousScale.defaultTickCount,this.axis.defaultTickMinSpacing)}filterTicks(t,e){const{minSpacing:i,maxSpacing:s}=this.axis.interval,o=i!=null||s!=null?Math.ceil(t.length/e):2,a=t.length%o?-1:0;return t.filter((r,l)=>(l+a)%o===0)}generateTicks({domain:t,primaryTickCount:e,visibleRange:i,niceMode:s,parallelFlipRotation:n,regularFlipRotation:o,labelX:a,sideFlag:r}){const{scale:l,label:c,interval:{minSpacing:h,maxSpacing:d}}=this.axis,{parallel:u,rotation:p,fontFamily:g,fontSize:f,fontStyle:m,fontWeight:y}=c,x=e!==void 0,{defaultRotation:b,configuredRotation:S,parallelFlipFlag:v,regularFlipFlag:I}=calculateLabelRotation({rotation:p,parallel:u,regularFlipRotation:o,parallelFlipRotation:n}),A=S+b,D=new Matrix,{maxTickCount:T}=this.estimateTickCount(i,h,d),w=!(ContinuousScale.is(l)||OrdinalTimeScale.is(l))||isNaN(T)?10:T;let L=getTextAlign(u,S,0,r,I);const O=getTextBaseline(u,S,r,v),F=TextUtils.toFontString({fontFamily:g,fontSize:f,fontStyle:m,fontWeight:y}),R=CachedTextMeasurerPool.getMeasurer({font:F}),E={fontFamily:g,fontSize:f,fontStyle:m,fontWeight:y,textBaseline:O,textAlign:L},_=c.enabled&&c.avoidCollisions,G=({ticks:Y},U)=>{if(!_)return!1;const $=S!==0||U!==0,W=A+U,X=getLabelSpacing(c.minSpacing,$);Matrix.updateTransformMatrix(D,1,1,W,0,0);const Z=createLabelData(Y,a,D,R);return axisLabelsOverlap(Z,X)};let B={tickDomain:[],ticks:[],rawTicks:[],fractionDigits:0,niceDomain:void 0},z=0,P=0,V=!0,j=!1;for(;!j&&V&&z<=w;){P=0;for(const Y of this.getTickStrategies({domain:t,niceMode:s,secondaryAxis:x,index:z}))({tickData:B,index:z,autoRotation:P,terminate:j}=Y({index:z,tickData:B,textProps:E,terminate:j,primaryTickCount:e,visibleRange:i,get labelOverlap(){return G(B,P)}}));V=G(B,P)}L=getTextAlign(u,S,P,r,I);const H=b+S+P;return!x&&B.rawTicks.length>0&&(e=B.rawTicks.length),{tickData:B,primaryTickCount:e,combinedRotation:H,textBaseline:O,textAlign:L}}getTickStrategies({domain:t,niceMode:e,index:i,secondaryAxis:s}){const{scale:n,label:o,interval:a}=this.axis,{minSpacing:r}=a,l=ContinuousScale.is(n)||OrdinalTimeScale.is(n),c=o.enabled&&o.avoidCollisions,h=!l&&i!==0&&c,d=o.autoRotate===!0&&o.rotation===void 0,u=[];let p;a.values?p=3:s?p=1:h?p=2:p=0;const g=({index:f,tickData:m,primaryTickCount:y,visibleRange:x,terminate:b})=>this.createTickData(t,e,x,y,p,f,m,b);if(u.push(g),!l&&r!=null){const f=({index:m,tickData:y,primaryTickCount:x,visibleRange:b,terminate:S})=>this.createTickData(t,e,b,x,2,m,y,S);u.push(f)}if(c&&d){const f=({index:m,tickData:y,labelOverlap:x,terminate:b})=>({index:m,tickData:y,autoRotation:x?normalizeAngle360(toRadians(o.autoRotateAngle??0)):0,terminate:b});u.push(f)}return u}createTickData(t,e,i,s,n,o,a,r){const{scale:l,interval:c}=this.axis,{step:h,values:d,minSpacing:u,maxSpacing:p}=c,{maxTickCount:g,minTickCount:f,tickCount:m}=this.estimateTickCount(i,u,p),y=ContinuousScale.is(l)||OrdinalTimeScale.is(l),x=!y||isNaN(g)?10:g,b=v=>y?Math.max(m-v,f):g,S=h==null&&d==null&&b(o)>f&&(y||n===2);for(;o<=x;){const v=a.rawTicks;if(a=this.getTicks({domain:t,niceMode:e,visibleRange:i,tickGenerationType:n,previousTicks:v,minTickCount:f,maxTickCount:g,primaryTickCount:s,tickCount:b(o)}),o++,!S||!arraysEqual(a.rawTicks,v))break}return r||(r=h!=null||d!=null),{tickData:a,index:o,autoRotation:0,terminate:r}}getTicks({domain:t,niceMode:e,visibleRange:i,tickGenerationType:s,previousTicks:n,tickCount:o,minTickCount:a,maxTickCount:r,primaryTickCount:l}){const{axis:c}=this,{label:h,range:d,scale:u,interval:p}=c,g=createIdsGenerator(),f={nice:e===0,interval:p.step,tickCount:o,minTickCount:a,maxTickCount:r},m={...f,nice:e===0||e===1};let y=e===0?u.niceDomain(f,t):t,x=y,b;switch(s){case 3:if(x=p.values,b=p.values,ContinuousScale.is(u)){const[k,w]=findMinMax(y.map(Number));b=b.filter(L=>Number(L)>=k&&Number(L)<=w).sort((L,O)=>Number(L)-Number(O))}break;case 1:if(ContinuousScale.is(u)){const k=calculateNiceSecondaryAxis(t.map(Number),l??0,c.reverse);b=k.ticks,y=k.domain.map(w=>u.toDomain(w))}else b=u.ticks(m,y,i)??[];break;case 2:b=this.filterTicks(n,o);break;default:b=u.ticks(m,y,i)??[]}const S=b.reduce((k,w)=>Math.max(k,typeof w=="number"?countFractionDigits(w):0),0),v={domain:x,ticks:b,fractionDigits:S,specifier:h.format},I=u.tickFormatter(v),A=u.domain;u.domain=y;const D=(u.bandwidth??0)/2,T=[];for(let k=0;k<b.length;k++){const w=b[k],L=u.convert(w)+D;if(d.length>0&&!c.inRange(L,.001))continue;const O=h.enabled?c.formatTick(w,k,y,S,I):"";T.push({tick:w,tickId:g(O),tickLabel:O,translationY:Math.floor(L)})}return u.domain=A,{tickDomain:x,rawTicks:b,fractionDigits:S,ticks:T,niceDomain:y}}},CartesianAxisLabel=class extends AxisLabel{constructor(){super(...arguments),this.autoRotateAngle=335}};__decorateClass2([TempValidate(BOOLEAN,{optional:!0})],CartesianAxisLabel.prototype,"autoRotate",2),__decorateClass2([TempValidate(NUMBER)],CartesianAxisLabel.prototype,"autoRotateAngle",2);var _CartesianAxis=class qt extends Axis{constructor(e,i){super(e,i),this.lineNode=this.axisGroup.appendChild(new TranslatableLine({name:`${this.id}-Axis-line`,zIndex:1})),this.tempText=new TransformableText({debugDirty:!1}),this.tempCaption=new Caption,this.tickGenerator=new AxisTickGenerator(this),this.generatedTicks=void 0,this.animationManager=e.animationManager,this.animationState=new StateMachine("empty",{empty:{update:{target:"ready",action:()=>this.resetSelectionNodes()},reset:"empty"},ready:{update:n=>this.animateReadyUpdate(n),resize:()=>this.resetSelectionNodes(),reset:"empty"}}),this.axisGroup.appendChild(this.title.caption.node);let s;this.destroyFns.push(e.layoutManager.addListener("layout:complete",n=>{const o=[n.chart.width,n.chart.height];s!=null&&!arraysEqual(o,s)&&this.animationState.transition("resize"),s=o}),this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}static is(e){return e instanceof qt}resetAnimation(e){e==="initial"&&this.animationState.transition("reset")}get direction(){return this.position==="top"||this.position==="bottom"?"x":"y"}createAxisContext(){return{...super.createAxisContext(),position:this.position}}createLabel(){return new CartesianAxisLabel}updateDirection(){switch(this.position){case"top":this.rotation=-90,this.label.mirrored=!0,this.label.parallel=!0;break;case"right":this.rotation=0,this.label.mirrored=!0,this.label.parallel=!1;break;case"bottom":this.rotation=-90,this.label.mirrored=!1,this.label.parallel=!0;break;case"left":this.rotation=0,this.label.mirrored=!1,this.label.parallel=!1;break}this.axisContext&&(this.axisContext.position=this.position,this.axisContext.direction=this.direction)}calculateLayout(e){return this.updateDirection(),super.calculateLayout(e)}calculateTickLayout(e,i,s,n){const o=this.label.getSideFlag(),{parallelFlipRotation:a,regularFlipRotation:r}=this.calculateRotations(),l=o*(this.getTickSize()+this.label.spacing+this.seriesAreaPadding);if(i===2&&this.label.enabled===!1&&this.tick.enabled===!1&&this.gridLine.enabled===!1)return this.generatedTicks={ticks:[],labels:[]},{ticks:[],tickDomain:e,niceDomain:e,primaryTickCount:n,fractionDigits:0,bbox:this.tickBBox(e,[],[])};const c=this.tickGenerator.generateTicks({domain:e,niceMode:i,visibleRange:s,primaryTickCount:n,parallelFlipRotation:a,regularFlipRotation:r,labelX:l,sideFlag:o}),{tickData:h,primaryTickCount:d=n}=c,{ticks:u,tickDomain:p,rawTicks:g,fractionDigits:f,niceDomain:m=e}=h,y=u.map(b=>this.getTickLabelProps(b,c)),x=this.tickBBox(p,u,y);return this.generatedTicks={ticks:u,labels:y},{ticks:g,tickDomain:p,niceDomain:m,primaryTickCount:d,fractionDigits:f,bbox:x}}update(){this.updateDirection();const e=Array.from(this.tickLabelGroupSelection.nodes(),o=>o.datum.tickId);if(super.update(),this.animatable||this.moduleCtx.animationManager.skipCurrentBatch(),this.generatedTicks){const{ticks:o}=this.generatedTicks;if(this.animationManager.isSkipped())this.resetSelectionNodes();else{const a=o.map(l=>l.tickId),r=diffArrays(e,a);this.animationState.transition("update",r)}}const{enabled:i,stroke:s,width:n}=this.line;this.lineNode.setProperties({stroke:s,strokeWidth:i?n:0}),this.updateTitle(this.scale.domain,!this.generatedTicks?.ticks.length)}updatePosition(){super.updatePosition(),this.axisGroup.datum=this.getAxisTransform()}tickBBox(e,i,s){const n=this.label.getSideFlag(),o=[],{x:a,y1:r,y2:l}=this.getAxisLineCoordinates(),c=new BBox(a+Math.min(n*this.seriesAreaPadding,0),r,this.seriesAreaPadding,l-r);if(o.push(c),this.tick.enabled)for(const u of i){const{x1:p,x2:g,y:f}=this.getTickLineCoordinates(u),m=new BBox(p,f,g-p,0);o.push(m)}const{tempText:h}=this;if(this.label.enabled)for(const u of s){if(!u.visible)continue;h.setProperties({...u,translationY:Math.round(u.translationY)});const p=h.getBBox();p&&o.push(p)}if(this.title?.enabled){const u=BBox.merge(o).width;this.setTitleProps(this.tempCaption,{domain:e,spacing:u});const p=this.tempCaption.node.getBBox();p&&o.push(p)}const d=BBox.merge(o);return this.getTransformBox(d)}setTitleProps(e,i){const{title:s}=this;if(!s.enabled){e.enabled=!1,e.node.visible=!1;return}e.enabled=!0,e.color=s.color,e.fontFamily=s.fontFamily,e.fontSize=s.fontSize,e.fontStyle=s.fontStyle,e.fontWeight=s.fontWeight,e.wrapping=s.wrapping;const n=e.node,o=(s.spacing??0)+i.spacing,a=this.label.getSideFlag(),r=normalizeAngle360(this.rotation),l=a===-1&&r>Math.PI&&r<Math.PI*2?-1:1,c=l*a*Math.PI/2,h=l===1?"bottom":"top",{range:d}=this,u=Math.floor(l*a*(d[0]+d[1])/2),p=Math.floor(a===-1?l*-o:-o),{callbackCache:g}=this.moduleCtx,{formatter:f=y=>y.defaultValue}=s,m=g.call(this,f,this.getTitleFormatterParams(i.domain));e.text=m,n.setProperties({visible:!0,text:m,textBaseline:h,x:u,y:p,rotation:c})}getTickLabelProps(e,i){const{combinedRotation:s,textBaseline:n,textAlign:o}=i,{range:a}=this.scale,r=e.tickLabel,c=this.label.getSideFlag()*(this.getTickSize()+this.label.spacing+this.seriesAreaPadding),h=r!==""&&r!=null;return{...this.getLabelStyles({value:e.tickLabel}),tickId:e.tickId,rotation:s,rotationCenterX:c,translationY:e.translationY,text:r,textAlign:o,textBaseline:n,visible:h,x:c,y:0,range:a}}getTickLineCoordinates(e){const s=this.label.getSideFlag()*this.getTickSize(),n=Math.min(0,s),o=n+Math.abs(s),a=e.translationY;return{x1:n,x2:o,y:a}}updateSelections(){if(!this.generatedTicks)return;const e=this.getAxisLineCoordinates(),{ticks:i,labels:s}=this.generatedTicks,n=o=>o.tickId;this.lineNode.datum=e,this.gridLineGroupSelection.update(this.gridLength?i:[],void 0,n),this.tickLineGroupSelection.update(i,void 0,n),this.tickLabelGroupSelection.update(s,void 0,n)}updateTitle(e,i,s){const{title:n,tickLineGroup:o,tickLabelGroup:a,lineNode:r}=this;n.enabled&&!i&&s==null&&(s=Group.computeChildrenBBox([o,a,r]).width+(a.visible?0:this.seriesAreaPadding)),s??(s=0),this.setTitleProps(n.caption,{domain:e,spacing:s})}updateLabels(){this.label.enabled&&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"})}animateReadyUpdate(e){const{animationManager:i}=this.moduleCtx,s=prepareAxisAnimationContext(this),n=prepareAxisAnimationFunctions(s);fromToMotion(this.id,"axis-group",i,[this.axisGroup],n.group),fromToMotion(this.id,"line",i,[this.lineNode],n.line),fromToMotion(this.id,"line-paths",i,[this.gridLineGroupSelection,this.tickLineGroupSelection],n.tick,(o,a)=>a.tickId,e),fromToMotion(this.id,"tick-labels",i,[this.tickLabelGroupSelection],n.label,(o,a)=>a.tickId,e)}resetSelectionNodes(){const e=prepareAxisAnimationContext(this);resetMotion([this.axisGroup],resetAxisGroupFn()),resetMotion([this.gridLineGroupSelection,this.tickLineGroupSelection],resetAxisSelectionFn(e)),resetMotion([this.tickLabelGroupSelection],resetAxisLabelSelectionFn()),resetMotion([this.lineNode],resetAxisLineSelectionFn())}};__decorateClass2([TempValidate(POSITIVE_NUMBER,{optional:!0})],_CartesianAxis.prototype,"thickness",2),__decorateClass2([TempValidate(POSITION)],_CartesianAxis.prototype,"position",2);var CartesianAxis=_CartesianAxis,CartesianAxisPositions=["top","right","bottom","left"];function isAxisPosition(t){return typeof t=="string"&&CartesianAxisPositions.includes(t)}function guessInvalidPositions(t){const e=[],i=[],s=[...CartesianAxisPositions];for(const n of t)n instanceof CartesianAxis&&(isAxisPosition(n.position)?i.push(n.position):e.push(n));for(const n of e){let o;do o=s.pop();while(o&&i.includes(o));if(o==null)break;n.position=o}}var MATCHING_KEYS=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo"];function matchSeriesOptions(t,e,i){const s=(c,h,d)=>{const u=[c];for(const p of MATCHING_KEYS)p in h&&h[p]!=null&&u.push(`${p}=${h[p]}`);return d?.seriesGrouping&&u.push(`seriesGrouping.groupId=${d?.seriesGrouping.groupId}`),u.join(";")},n=new Map;let o=0;for(const c of t){const h=s(c.type,c.properties,i?.[o]);n.has(h)||n.set(h,[]),n.get(h)?.push([c,o++])}const a=new Map;o=0;for(const c of e){const h=s(c.type,c,c);a.has(h)||a.set(h,[]),a.get(h)?.push([c,o++])}if(![...n.keys()].some(c=>a.has(c)))return{status:"no-overlap",oldKeys:n.keys(),newKeys:a.keys()};const l=[];for(const[c,h]of a.entries())for(const[d,u]of h){const p=n.get(c);if(p==null||p.length<1){l.push({opts:d,targetIdx:u,idx:u,status:"add"}),n.delete(c);continue}const[g,f]=p.shift(),m=i?.[f]??{},y=jsonDiff(m,d??{}),{groupIndex:x,stackIndex:b}=y?.seriesGrouping??{};x!=null||b!=null?l.push({opts:d,series:g,diff:y,targetIdx:u,idx:f,status:"series-grouping"}):y?l.push({opts:d,series:g,diff:y,targetIdx:u,idx:f,status:"update"}):l.push({opts:d,series:g,targetIdx:u,idx:f,status:"no-op"}),p.length===0&&n.delete(c)}for(const c of n.values())for(const[h,d]of c)l.push({series:h,idx:d,targetIdx:-1,status:"remove"});return{status:"overlap",changes:l}}function optionsType(t){const{series:e}=t;return e?.[0]?.type??"line"}function isAgCartesianChartOptions(t){const e=optionsType(t);return chartTypes2.isCartesian(e)||isEnterpriseCartesian(e)}function isAgPolarChartOptions(t){const e=optionsType(t);return chartTypes2.isPolar(e)||isEnterprisePolar(e)}function isAgHierarchyChartOptions(t){const e=optionsType(t);return chartTypes2.isHierarchy(e)||isEnterpriseHierarchy(e)}function isAgTopologyChartOptions(t){const e=optionsType(t);return chartTypes2.isTopology(e)||isEnterpriseTopology(e)}function isAgFlowProportionChartOptions(t){const e=optionsType(t);return chartTypes2.isFlowProportion(e)||isEnterpriseFlowProportion(e)}function isAgStandaloneChartOptions(t){const e=optionsType(t);return chartTypes2.isStandalone(e)||isEnterpriseStandalone(e)}function isAgGaugeChartOptions(t){const e=optionsType(t);return chartTypes2.isGauge(e)||isEnterpriseGauge(e)}function isAgPolarChartOptionsWithSeriesBasedLegend(t){const e=optionsType(t);return isAgPolarChartOptions(t)&&e!=="pie"&&e!=="donut"}var ModulesManager=class extends ModuleMap{applyOptions(t){for(const e of this.moduleMap.values())e.module.optionsKey in t&&isProperties(e.moduleInstance)&&e.moduleInstance.set(t[e.module.optionsKey])}*legends(){for(const{module:t,moduleInstance:e}of this.moduleMap.values())t.type==="legend"&&(yield{legendType:t.identifier,legend:e})}},DEFAULT_OVERLAY_CLASS="ag-charts-overlay",DEFAULT_OVERLAY_DARK_CLASS="ag-charts-dark-overlay",Overlay=class extends BaseProperties{constructor(t,e){super(),this.className=t,this.defaultMessageId=e,this.enabled=!0}getText(t){return t.t(this.text??this.defaultMessageId)}getElement(t,e,i){if(this.content?.remove(),this.focusBox=i,this.renderer){const s=this.renderer();if(s instanceof HTMLElement)this.content=s;else{const n=createElement("div");n.innerHTML=s,this.content=n.firstElementChild}}else{const s=createElement("div",{display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",height:"100%",margin:"8px",fontFamily:"var(--ag-charts-font-family)",fontSize:"var(--ag-charts-font-size)",fontWeight:"var(--ag-charts-font-weight)"});s.innerText=this.getText(e),this.content=s,t?.animate({from:0,to:1,id:"overlay",phase:"add",groupId:"opacity",onUpdate(n){s.style.opacity=String(n)},onStop(){s.style.opacity="1"}})}return this.content}removeElement(t=()=>this.content?.remove(),e){if(this.content){if(e){const{content:i}=this;e.animate({from:1,to:0,phase:"remove",id:"overlay",groupId:"opacity",onUpdate(s){i.style.opacity=String(s)},onStop(){t?.()}})}else t?.();this.content=void 0,this.focusBox=void 0}}};__decorateClass2([TempValidate(BOOLEAN)],Overlay.prototype,"enabled",2),__decorateClass2([TempValidate(STRING,{optional:!0})],Overlay.prototype,"text",2),__decorateClass2([TempValidate(FUNCTION,{optional:!0})],Overlay.prototype,"renderer",2);var ChartOverlays=class extends BaseProperties{constructor(){super(...arguments),this.darkTheme=!1,this.loading=new Overlay("ag-charts-loading-overlay","overlayLoadingData"),this.noData=new Overlay("ag-charts-no-data-overlay","overlayNoData"),this.noVisibleSeries=new Overlay("ag-charts-no-visible-series","overlayNoVisibleSeries"),this.unsupportedBrowser=new Overlay("ag-charts-unsupported-browser","overlayUnsupportedBrowser")}getFocusInfo(t){for(const e of[this.loading,this.noData,this.noVisibleSeries,this.unsupportedBrowser])if(e.focusBox!==void 0)return{text:e.getText(t),rect:e.focusBox}}destroy(){this.loading.removeElement(),this.noData.removeElement(),this.noVisibleSeries.removeElement(),this.unsupportedBrowser.removeElement()}};__decorateClass2([TempValidate(BOOLEAN)],ChartOverlays.prototype,"darkTheme",2),__decorateClass2([TempValidate(OBJECT)],ChartOverlays.prototype,"loading",2),__decorateClass2([TempValidate(OBJECT)],ChartOverlays.prototype,"noData",2),__decorateClass2([TempValidate(OBJECT)],ChartOverlays.prototype,"noVisibleSeries",2),__decorateClass2([TempValidate(OBJECT)],ChartOverlays.prototype,"unsupportedBrowser",2);function getLoadingSpinner(t,e){const{animationDuration:i}=PHASE_METADATA.add,s=i*e,n=createElement("div",`${DEFAULT_OVERLAY_CLASS}--loading`,{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",height:"100%",boxSizing:"border-box",font:"13px Verdana, sans-serif",userSelect:"none",animation:`ag-charts-loading ${s}ms linear 50ms both`}),o=createElement("span",{width:"45px",height:"40px",backgroundImage:["linear-gradient(#0000 calc(1 * 100% / 6), #ccc 0 calc(3 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(2 * 100% / 6), #ccc 0 calc(4 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(3 * 100% / 6), #ccc 0 calc(5 * 100% / 6), #0000 0)"].join(""),backgroundSize:"10px 400%",backgroundRepeat:"no-repeat",animation:"ag-charts-loading-matrix 1s infinite linear"}),a=createElement("p",{marginTop:"1em"});a.innerText=t;const r=createElement("div",`${DEFAULT_OVERLAY_CLASS}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),l=createElement("style");return l.innerText=["@keyframes ag-charts-loading { from { opacity: 0 } to { opacity: 1 } }","@keyframes ag-charts-loading-matrix {","0% { background-position: 0% 0%, 50% 0%, 100% 0%; }","100% { background-position: 0% 100%, 50% 100%, 100% 100%; }","}"].join(" "),n.replaceChildren(l,o,a,r),n}var SeriesZIndexMap=(t=>(t[t.BACKGROUND=0]="BACKGROUND",t[t.ANY_CONTENT=1]="ANY_CONTENT",t))(SeriesZIndexMap||{}),SeriesContentZIndexMap=(t=>(t[t.FOREGROUND=0]="FOREGROUND",t[t.HIGHLIGHT=1]="HIGHLIGHT",t[t.LABEL=2]="LABEL",t))(SeriesContentZIndexMap||{});function getShapeFill(t,e,i){if(isGradientFill(t))return{type:"gradient",gradient:t.gradient??e.gradient,colorStops:t.colorStops??e.colorStops,bounds:t.bounds??e.bounds,rotation:t.rotation??e.rotation,reverse:t.reverse??e.reverse};if(isPatternFill(t)&&i){const s=t.pattern??i.pattern;let n=t.strokeWidth;s==="backward-slanted-lines"||s==="forward-slanted-lines"||s==="horizontal-lines"||s==="vertical-lines"?n??(n=i.strokeWidth):n??(n=0);const o=t.width??t.height??i.width,a=t.height??t.width??i.height;return{type:"pattern",pattern:s,width:o,height:a,padding:t.padding??i.padding,fill:t.fill??i.fill,fillOpacity:t.fillOpacity??i.fillOpacity,backgroundFill:t.backgroundFill??i.backgroundFill,backgroundFillOpacity:t.backgroundFillOpacity??i.backgroundFillOpacity,stroke:t.stroke??i.stroke,strokeOpacity:t.strokeOpacity??i.strokeOpacity,strokeWidth:n,rotation:t.rotation??i.rotation}}return t}function getShapeStyle(t,e,i){return!isGradientFill(t?.fill)&&!isPatternFill(t?.fill)?t:{...t,fill:getShapeFill(t.fill,e,i)}}function applyShapeFillBBox(t,e,i,s){i==null||!isGradientFill(e)||e.bounds==null||e.bounds==="item"?t.fillBBox=void 0:t.fillBBox=i[e.bounds],t.fillParams=s}function applyShapeStyle(t,e,i,s,n){const o=i?.fill??e.fill;t.fill=o,applyShapeFillBBox(t,i?.fill??e.fill,s,n),t.fillOpacity=i?.fillOpacity??e.fillOpacity??1,t.stroke=i?.stroke??e.stroke,t.strokeOpacity=i?.strokeOpacity??e.strokeOpacity??1,t.strokeWidth=i?.strokeWidth??e.strokeWidth??0,t.lineDash=i?.lineDash??e.lineDash,t.lineDashOffset=i?.lineDashOffset??e.lineDashOffset??0}var SeriesNodePickMode=(t=>(t[t.EXACT_SHAPE_MATCH=0]="EXACT_SHAPE_MATCH",t[t.NEAREST_NODE=1]="NEAREST_NODE",t[t.AXIS_ALIGNED=2]="AXIS_ALIGNED",t))(SeriesNodePickMode||{}),CROSS_FILTER_MARKER_FILL_OPACITY_FACTOR=.25,CROSS_FILTER_MARKER_STROKE_OPACITY_FACTOR=.125,SeriesNodeEvent=class{constructor(t,e,i,s){this.type=t,this.event=e,this.defaultPrevented=!1,this.datum=i.datum,this.seriesId=s.id}preventDefault(){this.defaultPrevented=!0}},SeriesGroupingChangedEvent=class{constructor(t,e,i){this.series=t,this.seriesGrouping=e,this.oldGrouping=i,this.type="groupingChanged"}},Series=class extends Observable{constructor(t){super(),this.destroyFns=[],this.usesPlacedLabels=!1,this.seriesGrouping=void 0,this.NodeEvent=SeriesNodeEvent,this.internalId=createId(this),this.contentGroup=new TranslatableGroup({name:`${this.internalId}-content`,zIndex:1}),this.highlightGroup=new TranslatableGroup({name:`${this.internalId}-highlight`,zIndex:1}),this.annotationGroup=new TranslatableGroup({name:`${this.internalId}-annotation`}),this.labelGroup=new TranslatableGroup({name:`${this.internalId}-series-labels`}),this.axes={x:void 0,y:void 0},this.directions=["x","y"],this.nodeDataRefresh=!0,this.moduleMap=new ModuleMap,this.datumCallbackCache=new Map,this.connectsToYAxis=!1,this._declarationOrder=-1,this.seriesListeners=new Listeners,this._pickNodeCache=new LRUCache;const{moduleCtx:e,pickModes:i,directionKeys:s={},directionNames:n={},canHaveAxes:o=!1,usesPlacedLabels:a=!1}=t;this.ctx=e,this.directionKeys=s,this.directionNames=n,this.canHaveAxes=o,this.usesPlacedLabels=a,this.highlightGroup=new TranslatableGroup({name:`${this.internalId}-highlight`}),this.highlightNode=this.highlightGroup.appendChild(new Group({name:"highlightNode",zIndex:0})),this.highlightLabel=this.highlightGroup.appendChild(new Group({name:"highlightLabel",zIndex:10})),this.pickModes=i}get pickModeAxis(){return"main"}get id(){return this.properties?.id??this.internalId}get type(){return this.constructor.type??""}get focusable(){return!0}get data(){return this._data??this._chartData}set visible(t){this.properties.visible=t,this.ctx.legendManager.toggleItem(t,this.id),this.ctx.legendManager.update(),this.visibleMaybeChanged()}get visible(){return this.ctx.legendManager.getSeriesEnabled(this.id)??this.properties.visible}get hasData(){return this.data!=null&&this.data.length>0}get tooltipEnabled(){return this.properties.tooltip?.enabled}onDataChange(){this.nodeDataRefresh=!0,this._pickNodeCache.clear()}setOptionsData(t){this._data=t,this.onDataChange()}setChartData(t){this._chartData=t,this.data===t&&this.onDataChange()}onSeriesGroupingChange(t,e){const{internalId:i,type:s,visible:n}=this;t&&this.ctx.seriesStateManager.deregisterSeries(this),e&&this.ctx.seriesStateManager.registerSeries({internalId:i,type:s,visible:n,seriesGrouping:e}),this.fireEvent(new SeriesGroupingChangedEvent(this,e,t))}getBandScalePadding(){return{inner:1,outer:0}}attachSeries(t,e,i){t.appendChild(this.contentGroup),e.appendChild(this.highlightGroup),e.appendChild(this.labelGroup),i?.appendChild(this.annotationGroup)}detachSeries(t,e,i){t?.removeChild(this.contentGroup),e.removeChild(this.highlightGroup),e.removeChild(this.labelGroup),i?.removeChild(this.annotationGroup)}setSeriesIndex(t){return t===this._declarationOrder?!1:(this._declarationOrder=t,this.contentGroup.zIndex=[1,t,0],this.highlightGroup.zIndex=[1,t,1],this.labelGroup.zIndex=[1,t,2],this.annotationGroup.zIndex=t,!0)}renderToOffscreenCanvas(){return!1}addEventListener(t,e){return super.addEventListener(t,e)}removeEventListener(t,e){return super.removeEventListener(t,e)}hasEventListener(t){return super.hasEventListener(t)}addListener(t,e){return this.seriesListeners.addListener(t,e)}dispatch(t,e){this.seriesListeners.dispatch(t,e)}addChartEventListeners(){}destroy(){this.destroyFns.forEach(t=>t()),this.destroyFns=[],this.resetDatumCallbackCache(),this.ctx.seriesStateManager.deregisterSeries(this)}getDirectionValues(t,e){const i=this.resolveKeyDirection(t),s=e?.[i],n=[];if(!s)return n;const o=(...a)=>{for(const r of a)Array.isArray(r)?o(...r):typeof r=="object"?o(...Object.values(r)):n.push(r)};return o(...s.map(a=>this.properties[a])),n}getKeys(t){return this.getDirectionValues(t,this.directionKeys)}getKeyProperties(t){return this.directionKeys[this.resolveKeyDirection(t)]??[]}getNames(t){return this.getDirectionValues(t,this.directionNames)}resolveKeyDirection(t){return t}getDomain(t){const e=this.getSeriesDomain(t),i=this.moduleMap.mapModules(s=>s.getDomain(t)).flat();return i.length!==0?e.concat(i):e}getRange(t,e){return this.getSeriesRange(t,e)}getVisibleItems(t,e,i){return 1/0}markNodeDataDirty(){this.nodeDataRefresh=!0,this._pickNodeCache.clear(),this.visibleMaybeChanged()}visibleMaybeChanged(){this.ctx.seriesStateManager.updateSeries(this)}getOpacity(){const{dimOpacity:e=1,enabled:i=!0}=this.properties.highlightStyle.series;if(!i||e===1)return 1;switch(this.isItemIdHighlighted()){case 0:case 1:return 1;case 2:default:return e}}getStrokeWidth(t){const{strokeWidth:e,enabled:i=!0}=this.properties.highlightStyle.series;if(!i||e===void 0)return t;switch(this.isItemIdHighlighted()){case 1:return e;case 0:case 2:return t}}isItemIdHighlighted(){const t=this.ctx.highlightManager?.getActiveHighlight()?.series;return t==null?0:t!==this?2:1}getModuleTooltipParams(){return this.moduleMap.mapModules(t=>t.getTooltipParams()).reduce((t,e)=>Object.assign(t,e),{})}pickNodes(t,e,i=!1){const{pickModes:s,pickModeAxis:n,visible:o,contentGroup:a}=this;if(!o||!a.visible||e==="highlight"&&!this.properties.highlight.enabled||e==="highlight-tooltip"&&!this.properties.highlight.enabled)return;let r=1/0;if(e==="tooltip"||e==="highlight-tooltip"){const{tooltip:u}=this.properties;r=typeof u.range=="number"?u.range:1/0,i||(i=u.range==="exact")}else if(e==="event"||e==="context-menu"){const{nodeClickRange:u}=this.properties;r=typeof u=="number"?u:1/0,i||(i=u==="exact")}const l=s.filter(u=>!i||u===0),{x:c,y:h}=t,d=JSON.stringify({x:c,y:h,maxDistance:r,selectedPickModes:l});if(this._pickNodeCache.has(d))return this._pickNodeCache.get(d);for(const u of l){let p;switch(u){case 0:{const g=this.pickNodesExactShape(t);p=g.length===0?void 0:{datums:g,distance:0};break}case 1:{const g=this.pickNodeClosestDatum(t),f=g?.distance===0?this.pickNodesExactShape(t):void 0;f!=null&&f.length!==0?p={datums:f,distance:0}:g?p={datums:[g.datum],distance:g.distance}:p=void 0;break}case 2:{const g=n!=null?this.pickNodeMainAxisFirst(t,n==="main-category"):void 0;p=g!=null?{datums:[g.datum],distance:g.distance}:void 0;break}}if(p&&p.distance<=r)return this._pickNodeCache.set(d,{pickMode:u,datums:p.datums,distance:p.distance})}return this._pickNodeCache.set(d,void 0)}pickNodesExactShape(t){const e=[];for(const i of this.contentGroup.pickNodes(t.x,t.y)){const s=i.closestDatum();s!=null&&s.missing!==!0&&e.push(s)}return e}pickNodeClosestDatum(t){throw new Error("AG Charts - Series.pickNodeClosestDatum() not implemented")}pickNodeNearestDistantObject(t,e){const i=nearestSquared(t.x,t.y,e),s=i.nearest?.closestDatum();if(s!=null&&s.missing!==!0)return{datum:s,distance:Math.sqrt(i.distanceSquared)}}pickNodeMainAxisFirst(t,e){throw new Error("AG Charts - Series.pickNodeMainAxisFirst() not implemented")}getLabelData(){return[]}updatePlacedLabelData(t){}fireNodeClickEvent(t,e){const i=new this.NodeEvent("seriesNodeClick",t,e,this);return this.fireEvent(i),!i.defaultPrevented}fireNodeDoubleClickEvent(t,e){const i=new this.NodeEvent("seriesNodeDoubleClick",t,e,this);return this.fireEvent(i),!i.defaultPrevented}createNodeContextMenuActionEvent(t,e){return new this.NodeEvent("nodeContextMenuAction",t,e,this)}onLegendInitialState(t,e){const{visible:i=!0,itemId:s,legendItemName:n}=e??{};this.toggleSeriesItem(i,t,s,n)}onLegendItemClick(t){const{enabled:e,itemId:i,series:s,legendType:n}=t,o="legendItemName"in this.properties?this.properties.legendItemName:void 0,a="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,r=o!=null&&o===t.legendItemName;(s.id===this.id||r||a!=null)&&this.toggleSeriesItem(e,n,i,o,t)}onLegendItemDoubleClick(t){const{enabled:e,itemId:i,series:s,numVisibleItems:n,legendType:o}=t,a="legendItemName"in this.properties?this.properties.legendItemName:void 0,r="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,l=a!=null&&a===t.legendItemName;s.id===this.id||l||r!=null?this.toggleSeriesItem(!0,o,i,a,t):e&&n===1?this.toggleSeriesItem(!0,o,void 0,a):this.toggleSeriesItem(!1,o,void 0,a)}toggleSeriesItem(t,e,i,s,n){const o=this.id;(t||e!=="category")&&(this.visible=t),this.nodeDataRefresh=!0,this._pickNodeCache.clear();const a={type:"seriesVisibilityChange",seriesId:o,itemId:i,legendItemName:n?.legendItemName??s,visible:t};this.fireEvent(a),this.ctx.legendManager.toggleItem(t,o,i,s)}isEnabled(){return this.visible}getModuleMap(){return this.moduleMap}createModuleContext(){return{...this.ctx,series:this}}getLabelText(t,e,i=formatValue){return t.formatter?this.ctx.callbackCache.call(this.properties,t.formatter,{seriesId:this.id,...e})??this.callWithContext(i,e.value):this.callWithContext(i,e.value)}getMarkerStyle(t,e,i,s=!1,n=t.size??0,o){const{itemStyler:a,fillGradientDefaults:r,fillPatternDefaults:l}=t;let h=getShapeStyle(mergeDefaults({size:n},o,t.getStyle()),r,l);if(a&&i){const d=this.ctx.callbackCache.call(this.properties,a,{seriesId:this.id,...h,...i,highlighted:s,datum:e});h=getShapeStyle(mergeDefaults(d,h),r,l)}return h}updateMarkerStyle(t,e,i,s,n,o,a,r,{applyTranslation:l=!0,selected:c=!0}={}){const h=this.getMarkerStyle(t,i,n,o,s?.size,a),{shape:d,size:u}=h,p=this.visible&&u>0&&s&&!isNaN(s.x)&&!isNaN(s.y);if(applyShapeStyle(e,h,void 0,r),l?e.setProperties({visible:p,shape:d,size:u,x:s?.x,y:s?.y,scalingCenterX:s?.x,scalingCenterY:s?.y}):e.setProperties({visible:p,shape:d,size:u}),c||(e.fillOpacity*=CROSS_FILTER_MARKER_FILL_OPACITY_FACTOR,e.strokeOpacity*=CROSS_FILTER_MARKER_STROKE_OPACITY_FACTOR),typeof t.shape=="function"&&!e.dirtyPath){e.path.clear(!0),e.updatePath(),e.checkPathDirty();const g=e.getBBox();if(s!==void 0&&g.isFinite()){const f=g.computeCenter(),[m,y]=["x","y"].map(x=>(h.strokeWidth??0)+Math.abs(f[x]-s[x]));s.focusSize=Math.max(g.width+m,g.height+y)}}}get nodeDataDependencies(){return this._nodeDataDependencies??{seriesRectWidth:NaN,seriesRectHeight:NaN}}checkResize(t){const{width:e,height:i}=t??{width:NaN,height:NaN},s=t?{seriesRectWidth:e,seriesRectHeight:i}:void 0,n=jsonDiff(this.nodeDataDependencies,s)!=null;return n&&(this._nodeDataDependencies=s,this.markNodeDataDirty()),n}pickFocus(t){}resetDatumCallbackCache(){this.datumCallbackCache.clear()}cachedDatumCallback(t,e){const{datumCallbackCache:i}=this,s=i.get(t);if(s!=null)return s;try{const n=e();return i.set(t,n),n}catch(n){logger_exports.error(String(n))}}callWithContext(t,...e){return callWithContext(this.properties,t,e)}};__decorateClass2([ActionOnSet({changeValue:function(t,e){this.onSeriesGroupingChange(e,t)}})],Series.prototype,"seriesGrouping",2);function ScenePathChangeDetection(t){const{changeCb:e,convertor:i}=t??{};return SceneChangeDetection({type:"path",convertor:i,changeCb:e})}var Path=class extends Shape{constructor(){super(...arguments),this.path=new ExtendedPath2D,this._clipX=NaN,this._clipY=NaN,this.clip=!1,this._dirtyPath=!0,this.lastPixelRatio=NaN}set clipX(t){this._clipX=t,this.dirtyPath=!0}set clipY(t){this._clipY=t,this.dirtyPath=!0}set dirtyPath(t){this._dirtyPath!==t&&(this._dirtyPath=t,t&&this.markDirty("path"))}get dirtyPath(){return this._dirtyPath}checkPathDirty(){this._dirtyPath||(this.dirtyPath=this.path.isDirty()||(this.fillShadow?.isDirty()??!1)||(this._clipPath?.isDirty()??!1))}computeBBox(){return this.updatePathIfDirty(),this.path.computeBBox()}isPointInPath(t,e){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(t,e)}distanceSquared(t,e){return this.distanceSquaredTransformedPoint(t,e)}svgPathData(t){return this.updatePathIfDirty(),this.path.toSVG(t)}distanceSquaredTransformedPoint(t,e){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(t,e)?0:this.path.distanceSquared(t,e)}isDirtyPath(){return!1}updatePath(){}updatePathIfDirty(){(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1)}preRender(t){return t.devicePixelRatio!==this.lastPixelRatio&&(this.dirtyPath=!0),this.lastPixelRatio=t.devicePixelRatio,this.updatePathIfDirty(),super.preRender(t,this.path.commands.length)}render(t){const{ctx:e}=t;if(this.clip&&!isNaN(this._clipX)&&!isNaN(this._clipY)){e.save();const i=this.strokeWidth/2;this._clipPath??(this._clipPath=new ExtendedPath2D),this._clipPath.clear(),this._clipPath.rect(-i,-i,this._clipX+i,this._clipY+i+i),e.clip(this._clipPath?.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(e),e.restore()}else this._clipPath=void 0,this.drawPath(e);this.fillShadow?.markClean(),super.render(t)}drawPath(t){this.fillStroke(t,this.path.getPath2D())}toSVG(){if(!this.visible)return;const t=createSvgElement("path");t.setAttribute("d",this.svgPathData());const e=this.applySvgFillAttributes(t,[]);return this.applySvgStrokeAttributes(t),{elements:[t],defs:e}}};Path.className="Path",__decorateClass2([ScenePathChangeDetection()],Path.prototype,"clip",2),__decorateClass2([ScenePathChangeDetection()],Path.prototype,"clipX",1),__decorateClass2([ScenePathChangeDetection()],Path.prototype,"clipY",1);var FocusIndicator=class{constructor(t){this.swapChain=t,this.hasBeenActivated=!1,this.div=createElement("div"),this.svg=createSvgElement("svg"),this.outerPath=createSvgElement("path"),this.innerPath=createSvgElement("path"),this.svg.append(this.outerPath),this.svg.append(this.innerPath),this.outerPath.classList.add("ag-charts-focus-svg-outer-path"),this.innerPath.classList.add("ag-charts-focus-svg-inner-path"),this.element=createElement("div","ag-charts-focus-indicator"),this.element.ariaHidden="true",this.element.append(this.svg),this.swapChain.addListener("swap",e=>this.onSwap(e))}clear(){}update(t,e,i){if(e!=null)if(t instanceof Path){const s=(o,a)=>{let{x:r,y:l}=Transformable.toCanvasPoint(t,o,a);return r-=e.x??0,l-=e.y??0,{x:r,y:l}},n=t.svgPathData(s);this.outerPath.setAttribute("d",n),this.innerPath.setAttribute("d",n),this.show(this.svg)}else{let s;if(i){const n=Math.max(t.x-e.x,0),o=Math.max(t.y-e.y,0),a=Math.min(t.x+t.width-e.x,e.width),r=Math.min(t.y+t.height-e.y,e.height);s=new BBox(n,o,a-n,r-o)}else s=new BBox(t.x-e.x,t.y-e.y,t.width,t.height);setElementBBox(this.div,s),this.show(this.div)}}onSwap(t){t!==this.element.parentElement&&(this.element.remove(),t.appendChild(this.element),this.overrideFocusVisible(this.focusVisible))}show(t){this.hasBeenActivated=!0,this.element.innerHTML="",this.element.append(t)}overrideFocusVisible(t){this.focusVisible=t;const e={true:"1",false:"0",undefined:""};this.element.parentElement?.style.setProperty("opacity",e[`${t}`])}isFocusVisible(t=!1){if(!t&&!this.hasBeenActivated)return!1;const e=this.element.parentElement;return e!=null&&getWindow().getComputedStyle(e).opacity==="1"}},FocusSwapChain=class{constructor(t,e,i,s){this.label1=t,this.label2=e,this.hasFocus=!1,this.skipDispatch=!1,this.listeners={blur:[],focus:[],swap:[]},this.onBlur=n=>(setElementStyle(n.target,"pointer-events",void 0),!this.skipDispatch&&this.dispatch("blur",n)),this.onFocus=n=>(setElementStyle(n.target,"pointer-events","auto"),!this.skipDispatch&&this.dispatch("focus",n)),setAttribute(this.label1,"id",`${i}-label1`),setAttribute(this.label2,"id",`${i}-label2`),setElementStyle(this.label1,"display","none"),setElementStyle(this.label2,"display","none"),this.activeAnnouncer=this.createAnnouncer(s),this.inactiveAnnouncer=this.createAnnouncer(s),setAttribute(this.activeAnnouncer,"tabindex",0),this.label2.insertAdjacentElement("afterend",this.activeAnnouncer),this.label2.insertAdjacentElement("afterend",this.inactiveAnnouncer),this.swap("")}createAnnouncer(t){const e=createElement("div");return e.role=t,e.className="ag-charts-swapchain",e.addEventListener("blur",this.onBlur),e.addEventListener("focus",this.onFocus),e}destroy(){for(const t of[this.activeAnnouncer,this.inactiveAnnouncer])t.removeEventListener("blur",this.onBlur),t.removeEventListener("focus",this.onFocus),t.remove()}focus(t){this.focusOptions=t,this.activeAnnouncer.focus(t),this.focusOptions=void 0}update(t){this.skipDispatch=!0,this.swap(t),this.hasFocus&&this.activeAnnouncer.focus(this.focusOptions),this.skipDispatch=!1}addListener(t,e){this.listeners[t].push(e),t==="swap"&&e(this.activeAnnouncer)}dispatch(t,e){t==="focus"?this.hasFocus=!0:t==="blur"&&(this.hasFocus=!1),this.listeners[t].forEach(i=>i(e))}swap(t){const e=this.activeAnnouncer.tabIndex;this.label2.textContent=t,[this.inactiveAnnouncer,this.activeAnnouncer]=[this.activeAnnouncer,this.inactiveAnnouncer],[this.label1,this.label2]=[this.label2,this.label1],setAttributes(this.inactiveAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!0,tabindex:void 0}),setAttributes(this.activeAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!1,tabindex:e}),this.dispatch("swap",this.activeAnnouncer)}},KEY_BINDINGS={arrowdown:{bindings:[{code:"ArrowDown"}]},arrowleft:{bindings:[{code:"ArrowLeft"}]},arrowright:{bindings:[{code:"ArrowRight"}]},arrowup:{bindings:[{code:"ArrowUp"}]},delete:{bindings:[{key:"Backspace"},{key:"Delete"}],activatesFocusIndicator:!1},redo:{bindings:[{key:"y",ctrlOrMeta:!0},{key:"z",ctrlOrMeta:!0,shift:!0}],activatesFocusIndicator:!1},undo:{bindings:[{key:"z",ctrlOrMeta:!0}],activatesFocusIndicator:!1},submit:{bindings:[{key:"Enter"},{code:"Enter"},{code:"Space"}]},zoomin:{bindings:[{key:"+"},{code:"ZoomIn"},{code:"Add"}],activatesFocusIndicator:!1},zoomout:{bindings:[{key:"-"},{code:"ZoomOut"},{code:"Substract"}],activatesFocusIndicator:!1}};function matchesKeyBinding(t,e){for(const i of e)if("code"in i){if(i.code===t.code)return!0}else if(i.key===t.key&&(i.shift===void 0||i.shift===t.shiftKey)&&(i.ctrlOrMeta===void 0||i.ctrlOrMeta===t.ctrlKey||i.ctrlOrMeta===t.metaKey))return!0;return!1}function mapKeyboardEventToAction(t){for(const[e,{activatesFocusIndicator:i=!0,bindings:s}]of entries(KEY_BINDINGS))if(matchesKeyBinding(t,s))return{name:e,activatesFocusIndicator:i}}function computeCenter(t,e,i){const s=getDatumRefPoint(t,i.datum,i.movedBounds);if(s!=null)return{x:s.canvasX,y:s.canvasY};const n=i.bounds;if(n!=null){if(n instanceof BBox){const{x:o,y:a}=n.computeCenter();return{x:e.x+o,y:e.y+a}}return Transformable.toCanvas(n).computeCenter()}}function getPickedFocusBBox({bounds:t}){return t instanceof BBox?t:t!=null?Transformable.toCanvas(t):BBox.NaN}function makeKeyboardPointerEvent(t,e,i){const{x:s,y:n}=computeCenter(t,e,i)??{};if(s!==void 0&&n!==void 0)return{type:"keyboard",canvasX:s,canvasY:n}}function createDeprecationWarning(){return(t,e)=>{const i=[`Property [${t}] is deprecated.`,e].filter(Boolean).join(" ");logger_exports.warnOnce(i)}}function Deprecated(t,e){const i=createDeprecationWarning(),s=e?.default;return addTransformToInstanceProperty((n,o,a)=>(a!==s&&i(o.toString(),t),a))}function DeprecatedAndRenamedTo(t,e){const i=createDeprecationWarning();return addTransformToInstanceProperty((s,n,o)=>(o!==s[t]&&(i(n.toString(),`Use [${t}] instead.`),setPath(s,t,e?e(o):o)),BREAK_TRANSFORM_CHAIN),(s,n)=>(i(n.toString(),`Use [${t}] instead.`),getPath(s,t)))}function calculatePlacement(t,e,i,s){let{top:n,right:o,bottom:a,left:r,width:l,height:c}=s;return r!=null?l!=null?o=i.width-r+l:o!=null&&(l=i.width-r-o):o!=null&&l!=null&&(r=i.width-o-l),n!=null?c!=null?a=i.height-n-c:a!=null&&(c=i.height-a-n):a!=null&&c!=null&&(n=i.height-a-c),l==null?c==null?(l=t,c=e):l=Math.ceil(t*c/e):c==null&&(c=Math.ceil(e*l/t)),r==null&&(o==null?r=Math.floor((i.width-l)/2):r=i.width-o-l),n==null&&(a==null?n=Math.floor((i.height-c)/2):n=i.height-c-a),{x:r,y:n,width:l,height:c}}var M=.1,K=200,C=12,DELTA=.5,SpringAnimation=class extends Listeners{constructor(){super(...arguments),this.x1=NaN,this.y1=NaN,this.x=NaN,this.y=NaN,this.vx=0,this.vy=0,this.t0=NaN,this.animationFrameHandle=void 0}reset(){this.x=NaN,this.y=NaN,this.animationFrameHandle!=null&&(cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0)}update(t,e){if(Number.isNaN(this.x)||Number.isNaN(this.y)){this.x=t,this.y=e,this.vx=0,this.vy=0,this.emitUpdate(),this.animationFrameHandle!=null&&(cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0);return}this.x1=t,this.y1=e,this.t0=Date.now(),this.animationFrameHandle==null&&(this.animationFrameHandle=requestAnimationFrame(this.onFrame.bind(this)))}onFrame(){this.animationFrameHandle=void 0;const{x1:t,y1:e,t0:i}=this,s=Date.now(),n=s-i;this.t0=s;const o=.001,a=Math.ceil(n/(o*1e3))|0;let{x:r,y:l,vx:c,vy:h}=this;for(let d=0;d<a;d+=1){const u=r-t,p=l-e,g=-(K*u+C*c)/M,f=-(K*p+C*h)/M;c+=g*o,h+=f*o,r+=c*o,l+=h*o}Math.hypot(r-t,l-e)<DELTA?(this.x=this.x1,this.y=this.y1,this.vx=0,this.vy=0):(this.x=r,this.y=l,this.vx=c,this.vy=h,this.animationFrameHandle=requestAnimationFrame(this.onFrame.bind(this))),this.emitUpdate()}emitUpdate(){this.dispatch("update",{type:"update",x:this.x,y:this.y})}},element=null;function sanitizeHtml(t){return t===""?"":(element??(element=createElement("div")),element.textContent=String(t),element.innerHTML.replace(/\n/g,"<br>"))}function drawMarkerUnitPolygon(t,e){const{path:i,size:s}=t,{x:n,y:o}=t;i.clear();let a=!1;for(const[r,l]of e){const c=n+(r-.5)*s,h=o+(l-.5)*s;a?i.lineTo(c,h):i.moveTo(c,h),a=!0}i.closePath()}var MARKER_SHAPES={circle({path:t,x:e,y:i,size:s}){const n=s/2;t.clear(),t.arc(e,i,n,0,Math.PI*2),t.closePath()},cross(t){drawMarkerUnitPolygon(t,[[.25,0],[.5,.25],[.75,0],[1,.25],[.75,.5],[1,.75],[.75,1],[.5,.75],[.25,1],[0,.75],[.25,.5],[0,.25]])},diamond(t){drawMarkerUnitPolygon(t,[[.5,0],[1,.5],[.5,1],[0,.5]])},heart({path:t,x:e,y:i,size:s}){const n=s/4;i=i+n/2,t.clear(),t.arc(e-n,i-n,n,toRadians(130),toRadians(330)),t.arc(e+n,i-n,n,toRadians(220),toRadians(50)),t.lineTo(e,i+n),t.closePath()},pin({path:t,x:e,y:i,size:s}){t.moveTo(e+(.15625-.5)*s,i+(.34375-.5)*s),t.cubicCurveTo(e+(.15625-.5)*s,i+(.151491-.5)*s,e+(.307741-.5)*s,i+(0-.5)*s,e+(.5-.5)*s,i+(0-.5)*s),t.cubicCurveTo(e+(.692259-.5)*s,i+(0-.5)*s,e+(.84375-.5)*s,i+(.151491-.5)*s,e+(.84375-.5)*s,i+(.34375-.5)*s),t.cubicCurveTo(e+(.84375-.5)*s,i+(.493824-.5)*s,e+(.784625-.5)*s,i+(.600181-.5)*s,e+(.716461-.5)*s,i+(.695393-.5)*s),t.cubicCurveTo(e+(.699009-.5)*s,i+(.719769-.5)*s,e+(.681271-.5)*s,i+(.743104-.5)*s,e+(.663785-.5)*s,i+(.766105-.5)*s),t.cubicCurveTo(e+(.611893-.5)*s,i+(.834367-.5)*s,e+(.562228-.5)*s,i+(.899699-.5)*s,e+(.528896-.5)*s,i+(.980648-.5)*s),t.cubicCurveTo(e+(.524075-.5)*s,i+(.992358-.5)*s,e+(.512663-.5)*s,i+(1-.5)*s,e+(.5-.5)*s,i+(1-.5)*s),t.cubicCurveTo(e+(.487337-.5)*s,i+(1-.5)*s,e+(.475925-.5)*s,i+(.992358-.5)*s,e+(.471104-.5)*s,i+(.980648-.5)*s),t.cubicCurveTo(e+(.487337-.5)*s,i+(1-.5)*s,e+(.475925-.5)*s,i+(.992358-.5)*s,e+(.471104-.5)*s,i+(.980648-.5)*s),t.cubicCurveTo(e+(.437772-.5)*s,i+(.899699-.5)*s,e+(.388107-.5)*s,i+(.834367-.5)*s,e+(.336215-.5)*s,i+(.766105-.5)*s),t.cubicCurveTo(e+(.318729-.5)*s,i+(.743104-.5)*s,e+(.300991-.5)*s,i+(.719769-.5)*s,e+(.283539-.5)*s,i+(.695393-.5)*s),t.cubicCurveTo(e+(.215375-.5)*s,i+(.600181-.5)*s,e+(.15625-.5)*s,i+(.493824-.5)*s,e+(.15625-.5)*s,i+(.34375-.5)*s),t.closePath()},plus(t){drawMarkerUnitPolygon(t,[[1/3,0],[2/3,0],[2/3,1/3],[1,1/3],[1,2/3],[2/3,2/3],[2/3,1],[1/3,1],[1/3,2/3],[0,2/3],[0,1/3],[1/3,1/3]])},square({path:t,x:e,y:i,size:s,pixelRatio:n}){const o=s/2;t.clear(),t.moveTo(align(n,e-o),align(n,i-o)),t.lineTo(align(n,e+o),align(n,i-o)),t.lineTo(align(n,e+o),align(n,i+o)),t.lineTo(align(n,e-o),align(n,i+o)),t.closePath()},star({path:t,x:e,y:i,size:s}){const o=s/2,a=o/2,r=Math.PI/2;for(let l=0;l<5*2;l++){const c=l%2===0?o:a,h=l*Math.PI/5-r,d=e+Math.cos(h)*c,u=i+Math.sin(h)*c;t.lineTo(d,u)}t.closePath()},triangle(t){drawMarkerUnitPolygon(t,[[.5,0],[1,.87],[0,.87]])}},InternalMarker=class extends Path{constructor(){super(...arguments),this.shape="square",this.x=0,this.y=0,this.size=12}updatePath(){const{path:t,shape:e,x:i,y:s,size:n}=this,o=this.layerManager?.canvas?.pixelRatio??1,a=Marker.anchor(e),r={path:t,x:i-(a.x-.5)*n,y:s-(a.y-.5)*n,size:n,pixelRatio:o};t.clear(),typeof e=="string"?MARKER_SHAPES[e](r):typeof e=="function"&&e(r)}computeBBox(){const{x:t,y:e,size:i}=this,s=Marker.anchor(this.shape);return new BBox(t-i*s.x,e-i*s.y,i,i)}executeFill(t,e){if(e)return super.executeFill(t,e)}executeStroke(t,e){if(e)return super.executeStroke(t,e)}};__decorateClass2([ScenePathChangeDetection()],InternalMarker.prototype,"shape",2),__decorateClass2([ScenePathChangeDetection()],InternalMarker.prototype,"x",2),__decorateClass2([ScenePathChangeDetection()],InternalMarker.prototype,"y",2),__decorateClass2([ScenePathChangeDetection({convertor:Math.abs})],InternalMarker.prototype,"size",2);var Marker=class extends Rotatable(Scalable(Translatable(InternalMarker))){static anchor(t){return t==="pin"?{x:.5,y:1}:typeof t=="function"&&"anchor"in t?t.anchor:{x:.5,y:.5}}constructor(t){super(t),t?.shape!=null&&(this.shape=t.shape)}};function legendSymbolSvg(t,e,i=e*(5/3)){const s=new Group,n=Math.min(t.marker.strokeWidth??1,2),o=Math.min(t.line?.strokeWidth??0,2),a=Math.max(t.marker.enabled===!1?0:e,t.line==null?0:i),r=Math.max(t.marker.enabled===!1?0:e,o);if(t.line!=null){const{stroke:l,strokeOpacity:c,lineDash:h}=t.line,d=new Line;d.x1=0,d.y1=r/2,d.x2=a,d.y2=r/2,d.stroke=l,d.strokeOpacity=c,d.strokeWidth=o,d.lineDash=h,s.append(d)}if(t.marker.enabled!==!1){const{shape:l,fill:c,fillOpacity:h,stroke:d,strokeOpacity:u,lineDash:p,lineDashOffset:g}=t.marker,f=new Marker;f.shape=l??"square",f.size=e,f.fill=c,f.fillOpacity=h??1,f.stroke=d,f.strokeOpacity=u??1,f.strokeWidth=n,f.lineDash=p,f.lineDashOffset=g??0;const m=Marker.anchor(l),y=a/2+(m.x-.5)*e,x=r/2+(m.y-.5)*e,b=e/(e+n);f.x=y,f.y=x,f.scalingCenterX=y,f.scalingCenterY=x,f.scalingX=b,f.scalingY=b,s.append(f)}return Group.toSVG(s,a,r)}var DEFAULT_TOOLTIP_CLASS="ag-charts-tooltip",DEFAULT_TOOLTIP_DARK_CLASS="ag-charts-tooltip--dark";function aggregateTooltipContent(t){const e=[],i=new Map;for(const s of t)if(s.type==="structured"){const{heading:n}=s,o=n!=null?i.get(n):void 0,a={type:"structured",heading:n,items:[s]};o==null?(i.set(n,a),e.push(a)):o.items.push(s)}else e.push(s);return e}function tooltipContentAriaLabel(t){const e=aggregateTooltipContent(t),i=[];return e.forEach(s=>{if(s.type==="raw")return"";s.heading!=null&&i.push(s.heading),s.items.forEach(n=>{n.title!=null&&i.push(n.title),n.data?.forEach(o=>{i.push(o.label??o.fallbackLabel,o.value)})})}),i.join("; ")}function dataHtml(t,e,i){let s="";t==null?s+=`<span class="${DEFAULT_TOOLTIP_CLASS}-label">${sanitizeHtml(e)}</span>`:(s+=`<span class="${DEFAULT_TOOLTIP_CLASS}-label">${sanitizeHtml(t)}</span>`,s+=" ",s+=`<span class="${DEFAULT_TOOLTIP_CLASS}-value">${sanitizeHtml(e)}</span>`);const n=[`${DEFAULT_TOOLTIP_CLASS}-row`];return i&&n.push(`${DEFAULT_TOOLTIP_CLASS}-row--inline`),s=`<div class="${n.join(" ")}">${s}</div>`,s}function tooltipRowContentHtml(t){let e="";const i=t.title==null&&t.data?.length===1,s=t.symbol==null?void 0:legendSymbolSvg(t.symbol,12);return s!=null&&(t.title!=null||t.data?.length)&&(e+=`<span class="${DEFAULT_TOOLTIP_CLASS}-symbol">${s}</span>`),t.title!=null&&(e+=`<span class="${DEFAULT_TOOLTIP_CLASS}-title">${sanitizeHtml(t.title)}</span>`,e+=" "),t.data?.forEach(n=>{e+=dataHtml(n.label??n.fallbackLabel,n.value,i),e+=" "}),e}function tooltipPaginationContentHtml(t,e){if(t==null||e.length===1)return;const i=t?.t("tooltipPaginationStatus",{index:e.index+1,count:e.length});return`<div class="${DEFAULT_TOOLTIP_CLASS}-footer">${i}</div>`}function tooltipContentHtml(t,e,i,s){const n=e.items.length===1?e.items[0]:void 0;let o,a,r;switch(i){case"compact":o=!0,a=n?.title;break;case"single":o=n!=null&&(e.heading==null||n.title==null)&&n.data?.length===1&&n.data[0].label==null&&n.data[0].value!=null,r=e.heading??n?.title;break;case"shared":o=!1}let l="";if(o&&n!=null?(a!=null&&(l+=dataHtml(void 0,a,!1)),n.data?.forEach(h=>{l+=dataHtml(h.label??r,h.value,!1),l+=" "})):(e.heading!=null&&(l+=`<span class="${DEFAULT_TOOLTIP_CLASS}-heading">${sanitizeHtml(e.heading)}</span>`,l+=" "),e.items.forEach(h=>{l+=tooltipRowContentHtml(h)})),l.length===0)return;const c=i!=="compact"&&s!=null?tooltipPaginationContentHtml(t,s):void 0;return c+null&&(l+=c),l=`<div class="${DEFAULT_TOOLTIP_CLASS}-content">${l.trimEnd()}</div>`,l}function tooltipPaginationHtml(t,e){const i=e==null?void 0:tooltipPaginationContentHtml(t,e);return i==null?"":`<div class="${DEFAULT_TOOLTIP_CLASS}-content">${i}</div>`}function tooltipHtml(t,e,i,s){const n=aggregateTooltipContent(e);if(n.length!==0){if(n.length===1&&n[0].type==="structured")return tooltipContentHtml(t,n[0],i,s);{const o=n.map(a=>a.type==="structured"?tooltipContentHtml(t,a,i):a.rawHtmlString);return s!=null&&o.push(tooltipPaginationHtml(t,s)??""),o.join("")}}}var horizontalAlignments={left:-1,"top-left":-1,"bottom-left":-1,top:0,center:0,bottom:0,right:1,"top-right":1,"bottom-right":1},verticalAlignments={"top-left":-1,top:-1,"top-right":-1,left:0,center:0,right:0,"bottom-left":1,bottom:1,"bottom-right":1},arrowPositions={left:3,"top-left":void 0,"bottom-left":void 0,top:2,center:void 0,bottom:1,right:0,"top-right":void 0,"bottom-right":void 0},directionChecks={top:2,bottom:2,left:1,right:1,"top-right":3,"top-left":3,"bottom-right":3,"bottom-left":3,center:0},TOOLTIP_MODE=UNION(["single","shared","compact"]),POSITION_TYPE=UNION(["pointer","node","top","right","bottom","left","top-left","top-right","bottom-right","bottom-left"],"a position type"),ANCHOR_TO=UNION(["pointer","node","chart"],"an anchorTo"),PLACEMENT_UNION=UNION(["top","right","bottom","left","top-right","bottom-right","bottom-left","top-left","center"],"a placement"),PLACEMENT2=OR(PLACEMENT_UNION,ARRAY_OF(PLACEMENT_UNION)),TooltipPosition=class extends BaseProperties{constructor(){super(...arguments),this.xOffset=0,this.yOffset=0}get defaultAnchorTo(){const{type:t,_seriesOverrideType:e}=this,i=t??e??"pointer";return i==="node"||i==="pointer"?i:"chart"}get defaultPlacement(){const{type:t,_seriesOverrideType:e}=this,i=t??e??"pointer";return i==="node"||i==="pointer"?"top":i}};__decorateClass2([TempValidate(POSITION_TYPE,{optional:!0}),Deprecated("Use `anchorTo` and/or `placement` options instead.")],TooltipPosition.prototype,"type",2),__decorateClass2([TempValidate(POSITION_TYPE,{optional:!0})],TooltipPosition.prototype,"_seriesOverrideType",2),__decorateClass2([TempValidate(NUMBER)],TooltipPosition.prototype,"xOffset",2),__decorateClass2([TempValidate(NUMBER)],TooltipPosition.prototype,"yOffset",2),__decorateClass2([TempValidate(ANCHOR_TO,{optional:!0})],TooltipPosition.prototype,"anchorTo",2),__decorateClass2([TempValidate(PLACEMENT2,{optional:!0})],TooltipPosition.prototype,"placement",2);var Tooltip=class extends BaseProperties{constructor(){super(),this.enabled=!0,this.mode="single",this.delay=0,this.range=void 0,this.wrapping="hyphenate",this.position=new TooltipPosition,this.pagination=!1,this.darkTheme=!1,this.bounds="extended",this.destroyFns=[],this.springAnimation=new SpringAnimation,this.enableInteraction=!1,this.wrapTypes=["always","hyphenate","on-space","never"],this.sizeMonitor=new SizeMonitor,this._elementSize=void 0,this._showTimeout=void 0,this.arrowPosition=void 0,this._visible=!1,this.positionParams=void 0,this.localeManager=void 0,this.destroyFns.push(this.springAnimation.addListener("update",this.updateTooltipPosition.bind(this)))}get interactive(){return this.enableInteraction}setup(t,e){return"togglePopover"in getWindow().HTMLElement.prototype&&(this.element=e.addChild("tooltip-container",DEFAULT_TOOLTIP_CLASS),this.element.setAttribute("popover","manual"),this.element.className=DEFAULT_TOOLTIP_CLASS,this.element.style.positionAnchor=e.anchorName,this.sizeMonitor.observe(this.element,i=>{this._elementSize=i,this.updateTooltipPosition()})),this.localeManager=t,()=>{e.removeChild("tooltip-container",DEFAULT_TOOLTIP_CLASS),this.destroyFns.forEach(i=>i()),this.element&&this.sizeMonitor.unobserve(this.element)}}isVisible(){return this._visible}contains(t){return this.element?.contains(t)??!1}updateTooltipPosition(){const{element:t,_elementSize:e,positionParams:i}=this;if(t==null||e==null||i==null)return;const{canvasRect:s,relativeRect:n,meta:o}=i,{x:a,y:r}=this.springAnimation;let l=o.position?.placement??this.position.placement??o.position?.defaultPlacement??this.position.defaultPlacement;Array.isArray(l)||(l=[l]);const c=o.position?.anchorTo??this.position.anchorTo??o.position?.defaultAnchorTo??this.position.defaultAnchorTo,h=o.position?.xOffset??0,d=o.position?.yOffset??0,u=n.x,p=n.y,g=n.width-e.width-1+u,f=n.height-e.height+p;let m=0,y,x,b=!1;do{y=l[m],m+=1;const D=this.getTooltipBounds({elementSize:e,placement:y,anchorTo:c,canvasX:a,canvasY:r,yOffset:d,xOffset:h,canvasRect:s});x=calculatePlacement(e.width,e.height,n,D),b=!1,directionChecks[y]&1&&(b||(b=x.x<u||x.x>g)),directionChecks[y]&2&&(b||(b=x.y<p||x.y>f))}while(m<l.length&&b);const S=clamp(u,x.x,g),v=clamp(p,x.y,f);b||(b=S!==x.x||v!==x.y);const I=c!=="chart"&&!b&&!h&&!d,A=o.showArrow??this.showArrow??I;this.arrowPosition=A?arrowPositions[y]:void 0,this.updateClassModifiers(),t.style.translate=`${S}px ${v}px`}show(t,e,i,s,n,o=!1){const{element:a}=this;if(a!=null&&s!=null&&s.length!==0){const c=tooltipHtml(this.localeManager,s,this.mode,this.pagination?n:void 0);if(c==null){this.toggle(!1);return}a.innerHTML=c}else if(a==null||a.innerHTML===""){this.toggle(!1);return}const r={x:t.x-e.x,y:t.y-e.y,width:t.width,height:t.height};switch(this.positionParams={canvasRect:e,relativeRect:r,meta:i},i.position?.anchorTo??this.position.anchorTo??i.position?.defaultAnchorTo??this.position.defaultAnchorTo){case"node":this.springAnimation.update(i.nodeCanvasX??i.canvasX,i.nodeCanvasY??i.canvasY);break;case"pointer":this.springAnimation.update(i.canvasX,i.canvasY);break;case"chart":this.springAnimation.reset()}i.enableInteraction?(this.enableInteraction=!0,a.style.pointerEvents="auto",a.removeAttribute("aria-hidden"),a.tabIndex=-1):(this.enableInteraction=!1,a.style.pointerEvents="none",a.setAttribute("aria-hidden","true"),a.removeAttribute("tabindex")),a.style.setProperty("--top",`${e.top}px`),a.style.setProperty("--left",`${e.left}px`),this.updateClassModifiers(),this.toggle(!0,o)}hide(){this.toggle(!1)}toggle(t,e=!1){const{delay:i}=this;t&&i>0&&!e?this._showTimeout??(this._showTimeout=setTimeout(()=>{this._showTimeout=void 0,this.toggleCallback(!0)},i)):(clearTimeout(this._showTimeout),this._showTimeout=void 0,this.toggleCallback(t))}toggleCallback(t){this.element?.isConnected&&this._visible!==t&&(this._visible=t,this.element.togglePopover(t),t?this.updateTooltipPosition():this.springAnimation.reset())}updateClassModifiers(){if(!this.element?.isConnected)return;const{classList:t}=this.element,e=(i,s)=>t.toggle(`${DEFAULT_TOOLTIP_CLASS}--${i}`,s);e("no-interaction",!this.enableInteraction),e("arrow-top",this.arrowPosition===1),e("arrow-right",this.arrowPosition===3),e("arrow-bottom",this.arrowPosition===2),e("arrow-left",this.arrowPosition===0),e("compact",this.mode==="compact"),t.toggle(DEFAULT_TOOLTIP_DARK_CLASS,this.darkTheme);for(const i of this.wrapTypes)t.toggle(`${DEFAULT_TOOLTIP_CLASS}--wrap-${i}`,i===this.wrapping)}getTooltipBounds(t){const{elementSize:e,anchorTo:i,placement:s,canvasX:n,canvasY:o,yOffset:a,xOffset:r,canvasRect:l}=t,{width:c,height:h}=e,d={width:c,height:h};if(i==="node"||i==="pointer"){const u=horizontalAlignments[s],p=verticalAlignments[s];return d.top=o+a+h*(p-1)/2+8*p,d.left=n+r+c*(u-1)/2+8*u,d}switch(s){case"top":return d.top=a,d.left=l.width/2-c/2+r,d;case"right":return d.top=l.height/2-h/2+a,d.left=l.width-c/2+r,d;case"left":return d.top=l.height/2-h/2+a,d.left=r,d;case"bottom":return d.top=l.height-h+a,d.left=l.width/2-c/2+r,d;case"top-left":return d.top=a,d.left=r,d;case"top-right":return d.top=a,d.left=l.width-c+r,d;case"bottom-right":return d.top=l.height-h+a,d.left=l.width-c+r,d;case"bottom-left":return d.top=l.height-h+a,d.left=r,d}return d}};__decorateClass2([TempValidate(BOOLEAN)],Tooltip.prototype,"enabled",2),__decorateClass2([TempValidate(TOOLTIP_MODE)],Tooltip.prototype,"mode",2),__decorateClass2([TempValidate(BOOLEAN,{optional:!0})],Tooltip.prototype,"showArrow",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],Tooltip.prototype,"delay",2),__decorateClass2([TempValidate(INTERACTION_RANGE,{optional:!0})],Tooltip.prototype,"range",2),__decorateClass2([TempValidate(TEXT_WRAP)],Tooltip.prototype,"wrapping",2),__decorateClass2([TempValidate(OBJECT)],Tooltip.prototype,"position",2),__decorateClass2([TempValidate(BOOLEAN)],Tooltip.prototype,"pagination",2),__decorateClass2([TempValidate(BOOLEAN)],Tooltip.prototype,"darkTheme",2),__decorateClass2([TempValidate(UNION(["extended","canvas"]))],Tooltip.prototype,"bounds",2);function pickedNodesEqual(t,e){return t.series===e.series&&objectsEqual(t.datumIndex,e.datumIndex)}var PickedNodeState=class{constructor(){this.candidates=[]}get current(){return this.active}reset(){this.candidates.length=0,this.active=void 0}update(t,e){this.candidates=t;let i=e!=null?t.findIndex(s=>pickedNodesEqual(s,e)):-1;return i===-1&&(i=0),this.active=t[i],{current:this.active,index:i,length:t.length}}next(){const{candidates:t,active:e}=this,i=e==null?-1:t.findIndex(n=>pickedNodesEqual(n,e));if(i===-1)return;let s=i+1;return s>=t.length&&(s=0),this.active=t[s],{current:this.active,index:s,length:this.candidates.length}}},SeriesAreaManager=class extends BaseManager{constructor(t){super(),this.chart=t,this.id=createId(this),this.series=[],this.highlight={pendingHoverEvent:void 0,appliedHoverEvent:void 0,stashedHoverEvent:void 0},this.tooltip={lastHover:void 0},this.hoverDevice="pointer",this.previousInputDevice="keyboard",this.focus={sortedSeries:[],series:void 0,seriesIndex:0,datumIndex:0,datum:void 0},this.hoverScheduler=debouncedAnimationFrame(()=>{if(!(!this.tooltip.lastHover&&!this.highlight.pendingHoverEvent)){if(this.chart.getUpdateType()<=4){this.hoverScheduler.schedule();return}this.highlight.pendingHoverEvent&&this.handleHoverHighlight(!1),this.tooltip.lastHover&&this.handleHoverTooltip(this.tooltip.lastHover,!1)}}),this.tooltipCandidates=new PickedNodeState;const e=t.ctx.domManager.addChild("series-area","series-area-aria-label1"),i=t.ctx.domManager.addChild("series-area","series-area-aria-label2");this.swapChain=new FocusSwapChain(e,i,this.id,"img"),this.swapChain.addListener("blur",a=>this.onBlur(a)),this.swapChain.addListener("focus",()=>this.onFocus()),t.ctx.domManager.mode==="normal"&&(this.focusIndicator=new FocusIndicator(this.swapChain),this.focusIndicator.overrideFocusVisible(t.mode==="integrated"?!1:void 0));const{seriesDragInterpreter:s,seriesWidget:n,containerWidget:o}=t.ctx.widgets;n.setTabIndex(-1),this.destroyFns.push(()=>t.ctx.domManager.removeChild("series-area","series-area-aria-label1"),()=>t.ctx.domManager.removeChild("series-area","series-area-aria-label2"),n.addListener("focus",()=>this.swapChain.focus()),n.addListener("mousemove",a=>this.onHover(a)),n.addListener("wheel",a=>this.onWheel(a)),n.addListener("mouseleave",a=>this.onLeave(a)),n.addListener("keydown",a=>this.onKeyDown(a)),n.addListener("contextmenu",(a,r)=>this.onContextMenu(a,r)),s.addListener("drag-move",a=>this.onDragMove(a)),s.addListener("click",a=>this.onClick(a,n)),s.addListener("dblclick",a=>this.onClick(a,n)),o.addListener("contextmenu",(a,r)=>this.onContextMenu(a,r)),o.addListener("click",(a,r)=>this.onClick(a,r)),o.addListener("dblclick",(a,r)=>this.onClick(a,r)),t.ctx.animationManager.addListener("animation-start",()=>this.clearAll()),t.ctx.domManager.addListener("resize",()=>this.clearAll()),t.ctx.highlightManager.addListener("highlight-change",a=>this.changeHighlightDatum(a)),t.ctx.layoutManager.addListener("layout:complete",a=>this.layoutComplete(a)),t.ctx.updateService.addListener("pre-scene-render",()=>this.preSceneRender()),t.ctx.updateService.addListener("update-complete",()=>this.updateComplete()),t.ctx.zoomManager.addListener("zoom-change",()=>this.clearAll()),t.ctx.zoomManager.addListener("zoom-pan-start",()=>this.clearAll()))}isState(t){return this.chart.ctx.interactionManager.isState(t)}isIgnoredTouch(t){return!(t.device!=="touch"||t.type==="click"||this.chart.ctx.chartService.touch.dragAction==="hover"||this.chart.ctx.chartService.touch.dragAction==="drag"&&this.isState(9))}dataChanged(){var t;(t=this.highlight).stashedHoverEvent??(t.stashedHoverEvent=this.highlight.appliedHoverEvent),this.chart.ctx.tooltipManager.removeTooltip(this.id),this.focusIndicator?.clear(),this.clearHighlight()}preSceneRender(){this.highlight.stashedHoverEvent!=null&&(this.highlight.pendingHoverEvent=this.highlight.stashedHoverEvent,this.highlight.stashedHoverEvent=void 0,this.handleHoverHighlight(!0)),this.tooltip.lastHover!=null&&this.handleHoverTooltip(this.tooltip.lastHover,!0)}updateComplete(){this.isState(34)&&this.focusIndicator?.isFocusVisible()&&this.handleSeriesFocus(0,0,!0)}update(t,e){this.chart.ctx.updateService.update(t,e)}seriesChanged(t){this.focus.sortedSeries=[...t].sort((e,i)=>{let s=e.properties.focusPriority??1/0,n=i.properties.focusPriority??1/0;return s===n&&([s,n]=[e._declarationOrder,i._declarationOrder]),s<n?-1:s>n?1:0}),this.series=t}layoutComplete(t){this.seriesRect=t.series.rect,this.hoverRect=t.series.paddedRect,this.chart.ctx.widgets.seriesWidget.setBounds(t.series.paddedRect),this.chart.ctx.domManager.mode==="normal"&&this.chart.ctx.widgets.chartWidget.setBounds(t.chart)}onContextMenu(t,e){const{sourceEvent:i}=t;if(i.currentTarget!=e.getElement())return;if(i.target==this.chart.ctx.widgets.containerWidget.getElement()){if(this.isState(36)){const{currentX:l,currentY:c}=t;this.chart.ctx.contextMenuRegistry.dispatchContext("all",{sourceEvent:i,canvasX:l,canvasY:c},{})}return}let s,n;if(this.focusIndicator?.isFocusVisible())s=this.chart.ctx.highlightManager.getActiveHighlight(),s&&this.seriesRect&&s.midPoint&&(n=Transformable.toCanvasPoint(s.series.contentGroup,s.midPoint.x,s.midPoint.y));else if(this.isState(36)){const l=this.pickNodes({x:t.currentX,y:t.currentY},"context-menu");l&&(this.chart.ctx.highlightManager.updateHighlight(this.id),s=l.matches[0].datum)}const o=s?.series;this.clearAll();const a=t.currentX+e.cssLeft(),r=t.currentY+e.cssTop();this.chart.ctx.contextMenuRegistry.dispatchContext("series-area",{sourceEvent:i,canvasX:a,canvasY:r},{pickedSeries:o,pickedNode:s},n)}onLeave(t){!this.isState(41)||t.sourceEvent.relatedTarget?.className==="ag-charts-text-input__textarea"||this.chart.ctx.tooltipManager.isEnteringInteractiveTooltip(t.sourceEvent)||(this.chart.ctx.domManager.updateCursor(this.id),this.hoverDevice!=="keyboard"&&this.clearAll())}onWheel(t){this.isState(41)&&(this.focusIndicator?.overrideFocusVisible(!1),this.previousInputDevice="pointer")}onDragMove(t){this.isState(41)&&(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(t))}onHover(t){this.isState(41)&&this.onHoverLikeEvent(t)}onHoverLikeEvent(t){if(!this.isIgnoredTouch(t)&&((t.device==="touch"||excludesType(t,"drag-move"))&&(this.tooltip.lastHover=t),t.device==="touch"&&this.chart.ctx.chartService.touch.dragAction==="hover"&&t.sourceEvent.preventDefault(),this.hoverDevice="pointer",this.previousInputDevice="pointer",this.highlight.pendingHoverEvent=t,this.hoverScheduler.schedule(),this.isState(32))){const{currentX:e,currentY:i}=t,s=this.pickNodes({x:e,y:i},"event")?.matches,n=s?.[0];n?.series.hasEventListener("seriesNodeClick")||n?.series.hasEventListener("seriesNodeDoubleClick")||s!=null&&s.length>1&&this.chart.tooltip.pagination?this.chart.ctx.domManager.updateCursor(this.id,"pointer"):this.chart.ctx.domManager.updateCursor(this.id)}}onClick(t,e){if(t.device==="touch"&&e===this.chart.ctx.widgets.seriesWidget&&this.swapChain.focus({preventScroll:!0}),!this.isState(41))return;if(e===this.chart.ctx.widgets.seriesWidget){if(!e.getElement().contains(t.sourceEvent.target))return}else if(t.sourceEvent.target!=e.getElement())return;if(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(t),!this.isState(32))return;if(e==this.chart.ctx.widgets.seriesWidget&&this.checkSeriesNodeClick(t)){this.update(4),t.sourceEvent.preventDefault();return}const i={type:t.type==="click"?"click":"doubleClick",event:t.sourceEvent};this.chart.fireEvent(i)}onFocus(){this.isState(34)&&(this.hoverDevice=this.focusIndicator?.isFocusVisible(!0)?"keyboard":"pointer",this.handleFocus(0,0))}onBlur(t){this.isState(34)&&(this.hoverDevice="pointer",this.chart.ctx.tooltipManager.isEnteringInteractiveTooltip(t)||this.clearAll(),this.focusIndicator?.overrideFocusVisible(void 0))}onKeyDown(t){if(!this.isState(43))return;const e=mapKeyboardEventToAction(t.sourceEvent);switch(e?.activatesFocusIndicator===!1&&this.focusIndicator?.overrideFocusVisible(this.previousInputDevice==="keyboard"),e?.name){case"redo":return this.chart.ctx.chartEventManager.seriesEvent("series-redo");case"undo":return this.chart.ctx.chartEventManager.seriesEvent("series-undo");case"zoomin":return this.chart.ctx.chartEventManager.seriesKeyNavZoom(1,t);case"zoomout":return this.chart.ctx.chartEventManager.seriesKeyNavZoom(-1,t);case"arrowup":return this.onArrow(-1,0,t);case"arrowdown":return this.onArrow(1,0,t);case"arrowleft":return this.onArrow(0,-1,t);case"arrowright":return this.onArrow(0,1,t);case"submit":return this.onSubmit(t)}}onArrow(t,e,i){this.isState(34)&&(this.hoverDevice="keyboard",this.previousInputDevice="keyboard",this.focusIndicator?.overrideFocusVisible(!0),this.focus.seriesIndex+=t,this.focus.datumIndex+=e,this.handleFocus(t,e),i.sourceEvent.preventDefault(),this.chart.ctx.chartEventManager.seriesEvent("series-focus-change"))}onSubmit(t){if(!this.isState(34))return;const{series:e,datum:i}=this.focus,s=t.sourceEvent;e!==void 0&&i!==void 0?e.fireNodeClickEvent(s,i):this.chart.fireEvent({type:"click",event:s}),s.preventDefault()}checkSeriesNodeClick(t){var e;const i=this.pickNodes({x:t.currentX,y:t.currentY},"event");if(i==null||i.matches.length===0)return;const s=this.chart.tooltip.pagination?this.tooltipCandidates.update(i.matches,this.tooltipCandidates.current)?.current:void 0,{series:n,datum:o}=s??i.matches[0],a=s==null?i.distance:0;if(t.type==="click"){const l=n.fireNodeClickEvent(t.sourceEvent,o)&&this.chart.tooltip.pagination?this.tooltipCandidates.next():void 0;if(l!=null){t.sourceEvent.preventDefault();const{currentX:c,currentY:h}=t,d=c+(this.hoverRect?.x??0),u=h+(this.hoverRect?.y??0);(e=this.highlight).pendingHoverEvent??(e.pendingHoverEvent=this.highlight.appliedHoverEvent),this.handleHoverHighlight(!1),this.showTooltip(l.current,d,u,{index:l.index,length:l.length})}return!0}return t.type==="dblclick"?(t.preventZoomDblClick=a===0,n.fireNodeDoubleClickEvent(t.sourceEvent,o),!0):!1}handleFocus(t,e){const i=this.chart.overlays.getFocusInfo(this.chart.ctx.localeManager);i==null?this.handleSeriesFocus(t,e):this.focusIndicator?.update(i.rect,this.seriesRect,!1)}handleSeriesFocus(t,e,i=!1){if(this.chart.chartType==="hierarchy"||this.chart.chartType==="gauge"){this.handleSoloSeriesFocus(t,e,i);return}const{focus:s}=this,n=s.sortedSeries.filter(c=>c.visible&&c.focusable);if(n.length===0)return;const o=s.datumIndex-e,a=s.seriesIndex-t;s.seriesIndex=clamp(0,s.seriesIndex,n.length-1),s.series=n[s.seriesIndex];const r=this.focus.datumIndex,l=this.focus.seriesIndex;this.updatePickedFocus(r,e,o,l,t,a,i)}handleSoloSeriesFocus(t,e,i){this.focus.series=this.focus.sortedSeries[0];const s=this.focus.datumIndex,n=this.focus.seriesIndex,o=this.focus.datumIndex-e,a=this.focus.seriesIndex-t;this.updatePickedFocus(s,e,o,n,t,a,i)}updatePickedFocus(t,e,i,s,n,o,a){const{focus:r,hoverRect:l,seriesRect:c}=this;if(r.series===void 0||l===void 0)return;const h=r?.series?.pickFocus({datumIndex:t,datumIndexDelta:e,otherIndex:s,otherIndexDelta:n,seriesRect:c});if(!h)return;const{datum:d}=h;if(h.otherIndex!==void 0&&(r.seriesIndex=h.otherIndex),r.datumIndex=h.datumIndex,r.datum=d,this.focusIndicator?.isFocusVisible()&&this.chart.ctx.animationManager.reset(),this.focusIndicator?.isFocusVisible()){const p=getPickedFocusBBox(h),{x:g,y:f}=p.computeCenter();if(!l.containsPoint(g,f)&&this.chart.ctx.zoomManager.panToBBox(this.id,l,p))return;const{x1:m,x2:y,y1:x,y2:b}=Vec4.from(p),S=l.containsPoint(m,x),v=l.containsPoint(y,x),I=l.containsPoint(m,b),A=l.containsPoint(y,b);if(!(S||v||I||A)){const D=Vec4.from(l);h.movedBounds=p.clone(),m<D.x1&&y<D.x1?(h.movedBounds.x=D.x1-2,h.movedBounds.width=4):m>D.x2&&y>D.x2&&(h.movedBounds.x=D.x2-2,h.movedBounds.width=4),x<D.y1&&b<D.y1?(h.movedBounds.y=D.y1-2,h.movedBounds.height=4):x>D.y2&&b>D.y2&&(h.movedBounds.y=D.y2-2,h.movedBounds.height=4)}}this.focusIndicator?.update(h.movedBounds??h.bounds,this.seriesRect,h.clipFocusBox);const u=makeKeyboardPointerEvent(r.series,l,h);if(u!==void 0&&this.hoverDevice==="keyboard"){this.tooltip.lastHover=void 0,this.highlight.appliedHoverEvent=void 0,this.highlight.pendingHoverEvent=void 0,this.highlight.stashedHoverEvent=void 0;const p=this.chart.getTooltipContent(r.series,d.datumIndex,d),g=TooltipManager.makeTooltipMeta(u,r.series,d,h.movedBounds);this.chart.ctx.highlightManager.updateHighlight(this.id,d),r.series.tooltipEnabled??this.chart.tooltip.enabled?this.chart.ctx.tooltipManager.updateTooltip(this.id,g,p):this.chart.ctx.tooltipManager.removeTooltip(this.id),a||(e===0&&n===0||i!==h.datumIndex||o!==(h.otherIndex??r.seriesIndex))&&this.swapChain.update(this.getDatumAriaText(d,p))}}getDatumAriaText(t,e){const i=e==null?"":tooltipContentAriaLabel(e);return this.chart.ctx.localeManager.t("ariaAnnounceHoverDatum",{datum:t.series.getDatumAriaText?.(t,i)??i})}clearHighlight(){this.highlight.pendingHoverEvent=void 0,this.highlight.appliedHoverEvent=void 0,this.chart.ctx.highlightManager.updateHighlight(this.id)}clearTooltip(){this.chart.ctx.tooltipManager.removeTooltip(this.id),this.tooltip.lastHover=void 0}clearAll(){this.clearHighlight(),this.clearTooltip(),this.focusIndicator?.clear()}handleHoverHighlight(t){this.highlight.appliedHoverEvent=this.highlight.pendingHoverEvent,this.highlight.pendingHoverEvent=void 0;const e=this.highlight.appliedHoverEvent;if(!e||!this.isState(41))return;const{currentX:i,currentY:s}=e,n=e.currentX+(this.hoverRect?.x??0),o=e.currentY+(this.hoverRect?.y??0);if(t?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(n,o)){this.clearHighlight();return}const{range:a}=this.chart.highlight,r=a==="tooltip"?"highlight-tooltip":"highlight",l=this.pickNodes({x:i,y:s},r);if(!l||l.matches.length===0){this.chart.ctx.highlightManager.updateHighlight(this.id);return}const{current:c}=this.tooltipCandidates,d=(c==null?void 0:l.matches.find(u=>pickedNodesEqual(u,c)))?.datum??l.matches[0].datum;this.chart.ctx.highlightManager.updateHighlight(this.id,d),this.hoverDevice="pointer"}handleHoverTooltip(t,e){const{current:i}=this.tooltipCandidates;if(this.tooltipCandidates.reset(),!this.isState(41))return;const{currentX:s,currentY:n}=t,o=s+(this.hoverRect?.x??0),a=n+(this.hoverRect?.y??0),r=t.sourceEvent.target;if(e?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(o,a)){this.hoverDevice=="pointer"&&this.clearTooltip();return}if(r&&this.chart.tooltip.interactive&&this.chart.ctx.domManager.isManagedChildDOMElement(r,"canvas-overlay",DEFAULT_TOOLTIP_CLASS))return;const l=this.pickNodes({x:t.currentX,y:t.currentY},"tooltip");if(!l||l.matches.length===0){this.hoverDevice=="pointer"&&this.clearTooltip();return}if(this.hoverDevice="pointer",l.distance===0){const{current:c,index:h,length:d}=this.tooltipCandidates.update(l.matches,this.chart.tooltip.pagination?i:void 0);this.showTooltip(c,o,a,{index:h,length:d})}else this.showTooltip(l.matches[0],o,a)}showTooltip({series:t,datum:e,datumIndex:i},s,n,o){const a=this.chart.getTooltipContent(t,i,e);if((t.tooltipEnabled??this.chart.tooltip.enabled)&&a!=null){const c=TooltipManager.makeTooltipMeta({type:"pointermove",canvasX:s,canvasY:n},t,e,void 0);this.chart.ctx.tooltipManager.updateTooltip(this.id,c,a,o)}else this.chart.ctx.tooltipManager.removeTooltip(this.id)}changeHighlightDatum(t){const e=new Set,{series:i=void 0,datum:s}=t.currentHighlight??{},{series:n=void 0,datum:o}=t.previousHighlight??{};n&&e.add(n),i&&e.add(i),n?.properties.cursor&&o&&this.chart.ctx.domManager.updateCursor(n.id),i?.properties.cursor&&i?.properties.cursor!=="default"&&s&&this.chart.ctx.domManager.updateCursor(i.id,i.properties.cursor),i==null||n==null?this.update(4):this.update(4,{seriesToUpdate:e})}pickNodes(t,e,i){const s=[...this.series].reverse();let n;for(const o of s){if(!o.visible||!o.contentGroup.visible)continue;const a=o.pickNodes(t,e,i);if(a==null||a.datums.length===0)continue;const{datums:r,distance:l}=a;if(a.datums.length!==0){if(l===0){n?.distance!==0&&(n={matches:[],distance:0});for(const c of r){const{datumIndex:h}=c;n.matches.push({series:o,datum:c,datumIndex:h})}}else if(n==null||n.distance>l){const[c]=r,{datumIndex:h}=c;n={matches:[{series:o,datum:c,datumIndex:h}],distance:l}}}}return n}};function excludesType(t,e){return t.type!==e}var SERIES_THRESHOLD_FOR_AGGRESSIVE_LAYER_REDUCTION=30,SeriesLayerManager=class{constructor(t){this.seriesRoot=t,this.groups=new Map,this.series=new Map,this.expectedSeriesCount=1,this.mode="normal"}setSeriesCount(t){this.expectedSeriesCount=t}requestGroup(t){const{internalId:e,type:i,contentGroup:s,seriesGrouping:n}=t,{groupIndex:o=e}=n??{},a=this.series.get(e);if(a!=null)throw new Error(`AG Charts - series already has an allocated layer: ${JSON.stringify(a)}`);this.series.size===0&&(this.mode=this.expectedSeriesCount>=SERIES_THRESHOLD_FOR_AGGRESSIVE_LAYER_REDUCTION?"aggressive-grouping":"normal");let r=this.groups.get(i);r==null&&(r=new Map,this.groups.set(i,r));const l=this.lookupIdx(o);let c=r.get(l);return c==null&&(c={type:i,id:l,seriesIds:[],group:this.seriesRoot.appendChild(new Group({name:`${t.contentGroup.name??i}-managed-layer`,zIndex:t.contentGroup.zIndex,renderToOffscreenCanvas:!1}))},r.set(l,c)),this.series.set(e,{layerState:c,seriesConfig:t}),c.seriesIds.push(e),c.group.appendChild(s),c.group}changeGroup(t){const{internalId:e,seriesGrouping:i,type:s,contentGroup:n,oldGrouping:o}=t,{groupIndex:a=e}=i??{};this.groups.get(s)?.get(a)?.seriesIds.includes(e)||(this.series.has(e)&&this.releaseGroup({internalId:e,seriesGrouping:o,type:s,contentGroup:n}),this.requestGroup(t))}releaseGroup(t){const{internalId:e,contentGroup:i,type:s}=t;if(!this.series.has(e))throw new Error(`AG Charts - series doesn't have an allocated layer: ${e}`);const n=this.series.get(e)?.layerState;n&&(n.seriesIds=n.seriesIds.filter(o=>o!==e),n.group.removeChild(i)),n?.seriesIds.length===0?(this.seriesRoot.removeChild(n.group),this.groups.get(n.type)?.delete(n.id),this.groups.get(s)?.delete(e)):n!=null&&n.seriesIds.length>0&&(n.group.zIndex=this.getLowestSeriesZIndex(n.seriesIds)),this.series.delete(e)}updateLayerCompositing(){this.groups.forEach(t=>{t.forEach(e=>{const{group:i,seriesIds:s}=e;let n;s.length===0?n=!1:s.length>1?n=!0:n=this.series.get(s[0])?.seriesConfig.renderToOffscreenCanvas()===!0,i.renderToOffscreenCanvas=n,i.zIndex=this.getLowestSeriesZIndex(s)})})}lookupIdx(t){return this.mode==="normal"?t:typeof t=="string"&&(t=Number(t.split("-").at(-1)),!t)?0:Math.floor(clamp(0,t/this.expectedSeriesCount,1)*SERIES_THRESHOLD_FOR_AGGRESSIVE_LAYER_REDUCTION)}destroy(){this.groups.forEach(t=>{t.forEach(e=>{this.seriesRoot.removeChild(e.group)})}),this.groups.clear(),this.series.clear()}getLowestSeriesZIndex(t){return t.reduce((i,s)=>{const o=this.series.get(s)?.seriesConfig.contentGroup.zIndex;return i==null||o==null?o:compareZIndex(i,o)<=0?i:o},void 0)??1}},Touch=class extends BaseProperties{constructor(){super(...arguments),this.dragAction="drag"}};__decorateClass2([TempValidate(UNION(["none","drag","hover"]))],Touch.prototype,"dragAction",2);var DataWindowProcessor=class{constructor(t,e,i,s,n){this.chart=t,this.dataService=e,this.updateService=i,this.zoomManager=s,this.animationManager=n,this.dirtyZoom=!1,this.dirtyDataSource=!1,this.lastAxisZooms=new Map,this.destroyFns=[],this.destroyFns.push(this.dataService.addListener("data-source-change",()=>this.onDataSourceChange()),this.dataService.addListener("data-load",()=>this.onDataLoad()),this.dataService.addListener("data-error",()=>this.onDataError()),this.updateService.addListener("update-complete",()=>this.onUpdateComplete()),this.zoomManager.addListener("zoom-change",()=>this.onZoomChange()))}destroy(){this.destroyFns.forEach(t=>t())}onDataLoad(){this.animationManager.skip(),this.updateService.update(1)}onDataError(){this.updateService.update(3)}onDataSourceChange(){this.dirtyDataSource=!0}onUpdateComplete(){!this.dirtyZoom&&!this.dirtyDataSource||this.updateWindow()}onZoomChange(){this.dirtyZoom=!0}updateWindow(){if(!this.dataService.isLazy())return;const t=this.getValidAxis();let e,i=!0;if(t){const s=this.zoomManager.getAxisZoom(t.id);e=this.getAxisWindow(t,s),i=this.shouldRefresh(t,s)}this.dirtyZoom=!1,this.dirtyDataSource=!1,i&&this.dataService.load({windowStart:e?.min,windowEnd:e?.max})}getValidAxis(){return this.chart.axes.find(t=>t.type==="time")}shouldRefresh(t,e){if(this.dirtyDataSource)return!0;if(!this.dirtyZoom)return!1;const i=this.lastAxisZooms.get(t.id);return i&&e.min===i.min&&e.max===i.max?!1:(this.lastAxisZooms.set(t.id,e),!0)}getAxisWindow(t,e){const{domain:i}=t.scale;if(!e||i.length===0||isNaN(Number(i[0])))return;const s=Number(i[1])-Number(i[0]),n=new Date(Number(i[0])+s*e.min),o=new Date(Number(i[0])+s*e.max);return{min:n,max:o}}},isSafariRegexp=/^((?!chrome|android).)*safari/i,safariVersionRegexp=/Version\/(\d+(\.\d+)?)/,isChromeRegexp=/Chrome/,chromeVersionRegexp=/Chrome\/(\d+)/,isEdge=/Edg/,isOpera=/OPR/;function isUnsupportedBrowser(){const{userAgent:t}=getWindow("navigator");if(isSafariRegexp.test(t)){const e=safariVersionRegexp.exec(t);if(e==null)return!1;const i=parseFloat(e[1]),s=Math.floor(i)>16;return s||logger_exports.warnOnce(`Unsupported Safari version: ${i}; ${t}`),!s}else if(isChromeRegexp.test(t)&&!isEdge.test(t)&&!isOpera.test(t)){const e=chromeVersionRegexp.exec(t);if(e==null)return!1;const i=parseInt(e[1],10),s=i>126;return s||logger_exports.warnOnce(`Unsupported Chrome version: ${i}; ${t}`),!s}return!1}var visibleIgnoredSeries=new Set(["map-shape-background","map-line-background"]),OverlaysProcessor=class{constructor(t,e,i,s,n,o,a){this.chartLike=t,this.overlays=e,this.dataService=i,this.layoutManager=s,this.localeManager=n,this.animationManager=o,this.domManager=a,this.destroyFns=[],this.overlayElem=this.domManager.addChild("canvas-overlay","overlay"),this.overlayElem.role="status",this.overlayElem.ariaAtomic="false",this.overlayElem.ariaLive="polite",this.overlayElem.classList.toggle(DEFAULT_OVERLAY_CLASS),this.destroyFns.push(this.layoutManager.addListener("layout:complete",r=>this.onLayoutComplete(r)))}destroy(){this.destroyFns.forEach(t=>t()),this.domManager.removeChild("canvas-overlay","overlay")}onLayoutComplete({series:{rect:t}}){const e=this.dataService.isLoading(),i=this.chartLike.series.some(c=>c.hasData),s=this.chartLike.series.some(c=>c.visible&&!visibleIgnoredSeries.has(c.type));this.overlays.darkTheme?this.overlayElem.classList.add(DEFAULT_OVERLAY_DARK_CLASS):this.overlayElem.classList.remove(DEFAULT_OVERLAY_DARK_CLASS),this.overlayElem.style.left=`${t.x}px`,this.overlayElem.style.top=`${t.y}px`,this.overlayElem.style.width=`${t.width}px`,this.overlayElem.style.height=`${t.height}px`;const n=e,o=!e&&!i,a=i&&!s,r=this.overlays.unsupportedBrowser.enabled&&isUnsupportedBrowser();n?this.showOverlay(this.overlays.loading,t):this.hideOverlay(this.overlays.loading),o?this.showOverlay(this.overlays.noData,t):this.hideOverlay(this.overlays.noData),a?this.showOverlay(this.overlays.noVisibleSeries,t):this.hideOverlay(this.overlays.noVisibleSeries),r?this.showOverlay(this.overlays.unsupportedBrowser,t):this.hideOverlay(this.overlays.unsupportedBrowser);const l=n||o||a||r;setAttribute(this.overlayElem,"aria-hidden",!l)}showOverlay(t,e){if(!t.enabled)return;const i=t.getElement(this.animationManager,this.localeManager,e);this.overlayElem.appendChild(i)}hideOverlay(t){t.removeElement(()=>{this.overlayElem.innerText="\xA0"},this.animationManager)}},debug=Debug.create(!0,"opts"),SeriesArea=class extends BaseProperties{constructor(){super(...arguments),this.padding=new Padding(0)}};__decorateClass2([TempValidate(BOOLEAN,{optional:!0})],SeriesArea.prototype,"clip",2),__decorateClass2([TempValidate(OBJECT)],SeriesArea.prototype,"padding",2);var _Chart=class Jt extends Observable{constructor(e,i){var s;super(),this.id=createId(this),this.seriesRoot=new TranslatableGroup({name:`${this.id}-series-root`,zIndex:5}),this.annotationRoot=new TranslatableGroup({name:`${this.id}-annotation-root`,zIndex:9}),this.titleGroup=new Group({name:"titles",zIndex:13}),this.debug=Debug.create(),this.extraDebugStats={},this.data=[],this._firstAutoSize=!0,this._autoSizeNotify=new AsyncAwaitQueue,this.padding=new Padding(20),this.seriesArea=new SeriesArea,this.keyboard=new Keyboard,this.touch=new Touch,this.mode="standalone",this.chartCaptions=new ChartCaptions,this.suppressFieldDotNotation=!1,this.destroyed=!1,this._destroyFns=[],this.skipSync=!1,this.chartAnimationPhase="initial",this.modulesManager=new ModulesManager,this.processors=[],this.queuedUserOptions=[],this.queuedChartOptions=[],this.firstApply=!0,this._pendingFactoryUpdatesCount=0,this._performUpdateSkipAnimations=!1,this._performUpdateNotify=new AsyncAwaitQueue,this.performUpdateType=7,this.runningUpdateType=7,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new Mutex,this.updateRequestors={},this.performUpdateTrigger=debouncedCallback(({count:h})=>{this.destroyed||this.updateMutex.acquire(async()=>{try{await this.performUpdate(h)}catch(d){logger_exports.error("update error",d)}}).catch(d=>logger_exports.errorOnce(d))}),this._performUpdateSplits={},this.axes=[],this.series=[],this._cachedData=void 0,this.onSeriesNodeClick=h=>{this.fireEvent(h)},this.onSeriesNodeDoubleClick=h=>{this.fireEvent(h)},this.onSeriesVisibilityChange=h=>{this.fireEvent(h)},this.seriesGroupingChanged=h=>{if(!(h instanceof SeriesGroupingChangedEvent))return;const{series:d,seriesGrouping:u,oldGrouping:p}=h;d.contentGroup.isRoot()||this.seriesLayerManager.changeGroup({internalId:d.internalId,type:d.type,contentGroup:d.contentGroup,renderToOffscreenCanvas:()=>d.renderToOffscreenCanvas(),seriesGrouping:u,oldGrouping:p})},this.chartOptions=e;const n=i?.scene,o=i?.container??e.processedOptions.container??void 0,a=i?.styleContainer??e.specialOverrides.styleContainer;n&&(this._firstAutoSize=!1,this._lastAutoSize=[n.width,n.height,n.pixelRatio]);const r=new Group({name:"root"});r.visible=!1,r.append(this.seriesRoot),r.append(this.annotationRoot),r.append(this.titleGroup),this.titleGroup.append(this.title.node),this.titleGroup.append(this.subtitle.node),this.titleGroup.append(this.footnote.node),this.tooltip=new Tooltip,this.seriesLayerManager=new SeriesLayerManager(this.seriesRoot),this.mode=e.userOptions.mode??this.mode;const l=this.ctx=new ChartContext(this,{chartType:this.getChartType(),scene:n,root:r,container:o,styleContainer:a,domMode:e.optionMetadata.domMode,syncManager:new SyncManager(this),fireEvent:h=>this.fireEvent(h),updateCallback:(h,d)=>this.update(h,d),updateMutex:this.updateMutex});this._destroyFns.push(l.domManager.addListener("resize",()=>this.parentResize(l.domManager.containerSize))),this.overlays=new ChartOverlays,(s=this.overlays.loading).renderer??(s.renderer=()=>getLoadingSpinner(this.overlays.loading.getText(l.localeManager),l.animationManager.defaultDuration)),this.processors=[new DataWindowProcessor(this,l.dataService,l.updateService,l.zoomManager,l.animationManager),new OverlaysProcessor(this,this.overlays,l.dataService,l.layoutManager,l.localeManager,l.animationManager,l.domManager)],this.highlight=new ChartHighlight,this.container=o;const c=this.getModuleContext();l.domManager.setDataBoolean("animating",!1),this.seriesAreaManager=new SeriesAreaManager(this.initSeriesAreaDependencies()),this._destroyFns.push(l.layoutManager.registerElement(0,h=>{h.layoutBox.shrink(this.padding.toJson()),this.chartCaptions.positionCaptions(h)}),l.layoutManager.addListener("layout:complete",h=>this.chartCaptions.positionAbsoluteCaptions(h)),l.dataService.addListener("data-load",h=>{this.data=h.data}),this.title.registerInteraction(c,"beforebegin"),this.subtitle.registerInteraction(c,"beforebegin"),this.footnote.registerInteraction(c,"afterend"),Widget.addWindowEvent("page-left",()=>this.destroy()),l.animationManager.addListener("animation-frame",()=>{this.update(6)}),l.animationManager.addListener("animation-start",()=>l.domManager.setDataBoolean("animating",!0)),l.animationManager.addListener("animation-stop",()=>l.domManager.setDataBoolean("animating",!1)),l.zoomManager.addListener("zoom-change",()=>{this.series.forEach(d=>d.animationState?.transition("updateData"));const h=this.chartAnimationPhase!=="initial";this.update(3,{forceNodeDataRefresh:!0,skipAnimations:h})})),this.parentResize(l.domManager.containerSize)}static getInstance(e){return Jt.chartsInstances.get(e)}get canvasElement(){return this.ctx.scene.canvas.element}download(e,i){this.ctx.scene.download(e,i)}getCanvasDataURL(e){return this.ctx.scene.getDataURL(e)}toSVG(){return this.ctx.scene.toSVG()}getOptions(){return this.queuedUserOptions.at(-1)??this.chartOptions.userOptions}getChartOptions(){return this.queuedChartOptions.at(-1)??this.chartOptions}overrideFocusVisible(e){this.seriesAreaManager.focusIndicator?.overrideFocusVisible(e)}initSeriesAreaDependencies(){const{ctx:e,tooltip:i,highlight:s,overlays:n,seriesRoot:o,mode:a}=this,r=this.getChartType();return{fireEvent:this.fireEvent.bind(this),getUpdateType:()=>this.performUpdateType,getTooltipContent:(d,u,p)=>this.getTooltipContent(d,u,p),chartType:r,ctx:e,tooltip:i,highlight:s,overlays:n,seriesRoot:o,mode:a}}getModuleContext(){return this.ctx}getTooltipContent(e,i,s){const n=e.properties.tooltip.enabled!==!1?e.getTooltipContent(i,s):void 0,o=n==null?[]:[n];if(this.tooltip.mode!=="shared"||this.series.length===1)return o;const a=e.getCategoryValue(i);return a==null?o:this.series.flatMap(r=>{if(r===e)return o;if(!r.isEnabled()||r.properties.tooltip.enabled===!1)return[];const l=r.datumIndexForCategoryValue(a),c=l==null?void 0:r.getTooltipContent(l,void 0);return c==null?[]:[c]})}getCaptionText(){return[this.title,this.subtitle,this.footnote].filter(e=>e.enabled&&e.text).map(e=>e.text).join(". ")}getAriaLabel(){return this.ctx.localeManager.t("ariaAnnounceChart",{seriesCount:this.series.length})}resetAnimations(){this.chartAnimationPhase="initial";for(const e of this.series)e.resetAnimation(this.chartAnimationPhase);for(const e of this.axes)e.resetAnimation(this.chartAnimationPhase);this.animationRect=void 0,this.ctx.animationManager.reset()}skipAnimations(){this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0}detachAndClear(){this.container=void 0,this.ctx.scene.clear()}destroy(e){if(this.destroyed)return;const i=e?.keepTransferableResources;let s;return this.performUpdateType=7,this._destroyFns.forEach(n=>n()),this.processors.forEach(n=>n.destroy()),this.overlays.destroy(),this.modulesManager.destroy(),i?(this.ctx.scene.strip(),s={container:this.container,scene:this.ctx.scene}):(this.ctx.scene.destroy(),this.container=void 0),this.destroySeries(this.series),this.seriesLayerManager.destroy(),this.axes.forEach(n=>n.destroy()),this.axes=[],this.animationRect=void 0,this.ctx.destroy(),this.destroyed=!0,Object.freeze(this),s}requestFactoryUpdate(e){this.destroyed||(this._pendingFactoryUpdatesCount++,this.updateMutex.acquire(async()=>{if(!this.destroyed)try{await e(this)}finally{this.destroyed||this._pendingFactoryUpdatesCount--}}).catch(i=>logger_exports.errorOnce(i)))}clearCallbackCache(){this.ctx.callbackCache.invalidateCache();for(const e of this.series)e.resetDatumCallbackCache()}update(e=0,i){if(this.destroyed)return;const{forceNodeDataRefresh:s=!1,skipAnimations:n,seriesToUpdate:o=this.series,newAnimationBatch:a}=i??{};this.ctx.widgets.seriesWidget.setDragTouchEnabled(this.touch.dragAction!=="none"),s&&this.series.forEach(r=>r.markNodeDataDirty());for(const r of o)this.seriesToUpdate.add(r);if(n&&(this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0),a&&this.ctx.animationManager.isActive()&&(this._performUpdateSkipAnimations=!0),this.skipSync=i?.skipSync??!1,this.debug.check()){let r=new Error().stack??"<unknown>";r=r.replace(/\([^)]*/g,""),this.updateRequestors[r]=e}e<this.performUpdateType&&(this.performUpdateType=e,this.ctx.domManager.setDataBoolean("updatePending",!0),this.performUpdateTrigger.schedule(i?.backOffMs))}async performUpdate(e){const{performUpdateType:i,extraDebugStats:s,_performUpdateSplits:n,ctx:o}=this,a=[...this.seriesToUpdate];this.clearCallbackCache(),this.performUpdateType=7,this.seriesToUpdate.clear(),this.runningUpdateType=i,this.updateShortcutCount===0&&i<6&&(o.animationManager.startBatch(this._performUpdateSkipAnimations),o.animationManager.onBatchStop(()=>this.chartAnimationPhase="ready")),this.ctx.scene.updateDebugFlags(),this.debug("Chart.performUpdate() - start",ChartUpdateType[i]);let r=performance.now();n.start??(n.start=r);const l=h=>{n[h]??(n[h]=0),n[h]+=performance.now()-r,r=performance.now()};switch(i){case 0:if(this.checkUpdateShortcut(0))break;this.ctx.updateService.dispatchPreDomUpdate(),this.updateDOM();case 1:if(this.checkUpdateShortcut(1))break;await this.updateData(),l("\u2B07\uFE0F");case 2:if(this.checkUpdateShortcut(2))break;await this.processData(),this.seriesAreaManager.dataChanged(),l("\u{1F3ED}");case 3:if(await this.checkFirstAutoSize(),this.checkUpdateShortcut(3))break;await this.processLayout(),l("\u2316");case 4:{if(this.checkUpdateShortcut(4))break;await this.updateSeries(a),l("\u{1F914}"),this.updateAriaLabels(),this.seriesLayerManager.updateLayerCompositing()}case 5:if(this.checkUpdateShortcut(5))break;o.updateService.dispatchPreSceneRender(),l("\u2196");case 6:if(this.checkUpdateShortcut(6))break;o.animationManager.endBatch(),s.updateShortcutCount=this.updateShortcutCount,o.scene.render({debugSplitTimes:n,extraDebugStats:s,seriesRect:this.seriesRect}),this.extraDebugStats={};for(const h of Object.keys(n))delete n[h];this.ctx.domManager.incrementDataCounter("sceneRenders"),this.ctx.domManager.postRenderUpdate();case 7:this.updateShortcutCount=0,this.updateRequestors={},this._performUpdateSkipAnimations=!1,o.animationManager.endBatch()}this.destroyed||(o.updateService.dispatchUpdateComplete(),this.ctx.domManager.setDataBoolean("updatePending",!1),this.runningUpdateType=7),this._performUpdateNotify.notify();const c=performance.now();this.debug("Chart.performUpdate() - end",{chart:this,durationMs:Math.round((c-n.start)*100)/100,count:e,performUpdateType:ChartUpdateType[i]})}updateThemeClassName(){const e="ag-charts-theme-",i=[`${e}default`,`${e}default-dark`];let s=i[0],n=!1,{theme:o}=this.chartOptions.processedOptions;for(;typeof o!="string"&&o!=null;)o=o.baseTheme;typeof o=="string"&&(s=o.replace("ag-",e),n=o.includes("-dark")),i.includes(s)||(s=n?i[1]:i[0]),this.ctx.domManager.setThemeClass(s)}updateDOM(){this.updateThemeClassName();const{enabled:e,tabIndex:i}=this.keyboard;this.ctx.domManager.setTabGuardIndex(e?i??0:-1),this.ctx.domManager.setThemeParameters(this.chartOptions.themeParameters)}updateAriaLabels(){this.ctx.domManager.updateCanvasLabel(this.getAriaLabel())}checkUpdateShortcut(e){return this.destroyed?!0:this.updateShortcutCount>3?(logger_exports.warn("exceeded the maximum number of simultaneous updates (4), discarding changes and rendering",this.updateRequestors),!1):this.performUpdateType<=e?(this.updateShortcutCount++,!0):!1}async checkFirstAutoSize(){this.width!=null&&this.height!=null||this._lastAutoSize||await this._autoSizeNotify.await(500)||this.debug("Chart.checkFirstAutoSize() - timeout for first size update.")}onAxisChange(e,i){i==null&&e.length===0||this.ctx.axisManager.updateAxes(i??[],e)}onSeriesChange(e,i){const s=i?.filter(n=>!e.includes(n))??[];this.destroySeries(s),this.seriesLayerManager?.setSeriesCount(e.length);for(const n of e){if(i?.includes(n))continue;const o=this.seriesLayerManager.requestGroup(n);n.attachSeries(o,this.seriesRoot,this.annotationRoot);const a=this;n.chart={get mode(){return a.mode},get isMiniChart(){return!1},get seriesRect(){return a.seriesRect}},n.resetAnimation(this.chartAnimationPhase),this.addSeriesListeners(n),n.addChartEventListeners()}this.seriesAreaManager?.seriesChanged(e)}destroySeries(e){e?.forEach(i=>{i.removeEventListener("seriesNodeClick",this.onSeriesNodeClick),i.removeEventListener("seriesNodeDoubleClick",this.onSeriesNodeDoubleClick),i.removeEventListener("groupingChanged",this.seriesGroupingChanged),i.destroy(),this.seriesLayerManager.releaseGroup(i),i.detachSeries(void 0,this.seriesRoot,this.annotationRoot),i.chart=void 0})}addSeriesListeners(e){this.hasEventListener("seriesNodeClick")&&e.addEventListener("seriesNodeClick",this.onSeriesNodeClick),this.hasEventListener("seriesNodeDoubleClick")&&e.addEventListener("seriesNodeDoubleClick",this.onSeriesNodeDoubleClick),this.hasEventListener("seriesVisibilityChange")&&e.addEventListener("seriesVisibilityChange",this.onSeriesVisibilityChange),e.addEventListener("groupingChanged",this.seriesGroupingChanged)}assignSeriesToAxes(){for(const e of this.axes)e.boundSeries=this.series.filter(i=>i.axes[e.direction]===e)}assignAxesToSeries(){const e=groupBy(this.axes,i=>i.direction);for(const i of this.series)for(const s of i.directions){const n=e[s];if(!n){logger_exports.warnOnce(`no available axis for direction [${s}]; check series and axes configuration.`);return}const o=i.getKeys(s),a=n.find(r=>!r.keys.length||o.some(l=>r.keys.includes(l)));if(!a){logger_exports.warnOnce(`no matching axis for direction [${s}] and keys [${o}]; check series and axes configuration.`);return}i.axes[s]=a}}parentResize(e){if(e==null||this.width!=null&&this.height!=null)return;let{width:i,height:s}=e;const{pixelRatio:n}=e;if(i=Math.floor(i),s=Math.floor(s),i===0&&s===0)return;const[o=0,a=0,r=1]=this._lastAutoSize??[];o===i&&a===s&&r===n||(this._lastAutoSize=[i,s,n],this.resize("SizeMonitor",{}))}resize(e,i){const{scene:s,animationManager:n}=this.ctx,{inWidth:o,inHeight:a,inMinWidth:r,inMinHeight:l,inOverrideDevicePixelRatio:c}=i;this.ctx.domManager.setSizeOptions(r??this.minWidth,l??this.minHeight,o??this.width,a??this.height);const h=o??this.width??this._lastAutoSize?.[0],d=a??this.height??this._lastAutoSize?.[1],u=c??this.overrideDevicePixelRatio??this._lastAutoSize?.[2];if(this.debug(`Chart.resize() from ${e}`,{width:h,height:d,pixelRatio:u,stack:new Error().stack}),!(h==null||d==null||!isFiniteNumber(h)||!isFiniteNumber(d))&&s.resize(h,d,u)){n.reset();let p=!0;(this.width==null||this.height==null)&&this._firstAutoSize&&(p=!1,this._firstAutoSize=!1),this.update(3,{forceNodeDataRefresh:!0,skipAnimations:p}),this._autoSizeNotify.notify()}}async updateData(){this.series.forEach(i=>i.setChartData(this.data));const e=this.modulesManager.mapModules(i=>i.updateData?.(this.data));await Promise.all(e)}async processData(){this.series.some(n=>n.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes());const e=new DataController(this.mode,this.suppressFieldDotNotation),i=this.series.map(n=>n.processData(e)),s=this.modulesManager.mapModules(n=>n.processData?.(e));this._cachedData=e.execute(this._cachedData),await Promise.all([...i,...s]);for(const n of this.axes)n.processData();this.updateLegends()}updateLegends(e){for(const{legend:i,legendType:s}of this.modulesManager.legends())s==="category"?this.setCategoryLegendData(e):this.setLegendData(s,i)}setCategoryLegendData(e){var i;const{ctx:{legendManager:s,stateManager:n}}=this;e&&this.series.forEach(a=>{const r=e.find(l=>l.seriesId===a.id);a.onLegendInitialState("category",r)});const o=this.series.flatMap(a=>{const r=a.getLegendData("category");return s.updateData(a.id,r),r});if(e){n.setStateAndRestore(s,e);return}if(this.mode!=="integrated"){const a={},r=new Map(this.series.map(l=>[l.id,l.type]));for(const{seriesId:l,symbol:{marker:c},label:h}of o.filter(d=>!d.hideInLegend)){if(c.fill==null)continue;const d=r.get(l),u=a[d]??(a[d]={});u[i=h.text]??(u[i]=c.fill),u[h.text]!==c.fill&&logger_exports.warnOnce(`legend item '${h.text}' has multiple fill colors, this may cause unexpected behaviour.`)}}s.update()}setLegendData(e,i){i.data=this.series.filter(s=>s.properties.showInLegend).flatMap(s=>s.getLegendData(e))}async processLayout(){const e=this.animationRect,{width:i,height:s}=this.ctx.scene,n=this.ctx.layoutManager.createContext(i,s);await this.performLayout(n),e&&!this.animationRect?.equals(e)&&this.ctx.animationManager.skipCurrentBatch(),this.debug("Chart.performUpdate() - seriesRect",this.seriesRect)}async updateSeries(e){const{seriesRect:i}=this;await Promise.all(e.map(s=>s.update({seriesRect:i}))),this.ctx.seriesLabelLayoutManager.updateLabels(this.series.filter(s=>s.visible&&s.usesPlacedLabels),this.padding,this.seriesRect)}async waitForUpdate(e=1e4,i=!1){const s=performance.now();for(;(this._pendingFactoryUpdatesCount>0||this.performUpdateType!==7||this.runningUpdateType!==7)&&!this.destroyed;){if(this._pendingFactoryUpdatesCount>0&&await this.updateMutex.waitForClearAcquireQueue(),(this.performUpdateType!==7||this.runningUpdateType!==7)&&await this._performUpdateNotify.await(),performance.now()-s>e){const n=`Chart.waitForUpdate() timeout of ${e} reached - first chart update taking too long.`;if(i)throw new Error(n);logger_exports.warnOnce(n)}isInputPending()&&await pause()}}filterMiniChartSeries(e){return e?.filter(i=>i.showInMiniChart!==!1)}applyOptions(e){const i=this.firstApply?e.processedOptions:e.diffOptions(this.chartOptions);if(i==null||Object.keys(i).length===0)return;const s=this.firstApply?{}:this.chartOptions.processedOptions,n=e.processedOptions;debug("Chart.applyOptions() - applying delta",i);const o=this.applyModules(n),a=["type","data","series","listeners","preset","theme","legend.listeners","navigator.miniChart.series","navigator.miniChart.label","locale.localeText","axes","topology","nodes","initialState","styleContainer"];i.listeners&&this.registerListeners(this,i.listeners),jsonApply(this,i,{skip:a});let r=!1,l="no-op";i.series!=null&&(l=this.applySeries(this,i.series,s?.series),r=!0),l==="replaced"&&this.resetAnimations(),this.applyAxes(this,n,s,l,[])&&(r=!0),i.data&&(this.data=i.data),i.legend?.listeners&&this.modulesManager.isEnabled("legend")&&Object.assign(this.legend.listeners,i.legend.listeners),i.locale?.localeText&&(this.modulesManager.getModule("locale").localeText=i.locale?.localeText),this.chartOptions=e;const c=this.modulesManager.getModule("navigator"),h=this.modulesManager.getModule("zoom");!c?.enabled&&!h?.enabled&&this.ctx.zoomManager.updateZoom("chart");const d=c?.miniChart,u=n.navigator?.miniChart?.series??n.series;d?.enabled===!0&&u!=null?this.applyMiniChartOptions(d,u,n,s):d?.enabled===!1&&(d.series=[],d.axes=[]),this.ctx.annotationManager.setAnnotationStyles(e.annotationThemes),r||(r=this.shouldForceNodeDataRefresh(i,l));const g=r||o?0:3;this.maybeResetAnimations(l),this.shouldClearLegendData(n,s,l)&&this.ctx.legendManager.clearData(),this.applyInitialState(n),debug("Chart.applyOptions() - update type",ChartUpdateType[g],{seriesStatus:l,forceNodeDataRefresh:r}),this.update(g,{forceNodeDataRefresh:r,newAnimationBatch:!0}),this.firstApply=!1}applyInitialState(e){const{annotationManager:i,chartTypeOriginator:s,historyManager:n,stateManager:o,zoomManager:a}=this.ctx,{initialState:r}=e;if("annotations"in e&&e.annotations?.enabled&&r?.annotations!=null){const l=r.annotations.map(c=>{const h=i.getAnnotationTypeStyles(c.type);return mergeDefaults(c,h)});o.setState(i,l)}r?.chartType!=null&&o.setState(s,r.chartType),(e.navigator?.enabled||e.zoom?.enabled)&&r?.zoom!=null&&o.setState(a,r.zoom),r?.legend!=null&&this.updateLegends(r.legend),r!=null&&n.clear()}maybeResetAnimations(e){if(this.mode==="standalone")switch(e){case"series-grouping-change":case"replaced":this.resetAnimations();break;default:}}shouldForceNodeDataRefresh(e,i){const s=!!e.data||i==="data-change"||i==="replaced",n=legendRegistry.getKeys(),o=Object.values(n).some(r=>e[r]!=null),a=e.title!=null&&e.subtitle!=null;return s||o||a}shouldClearLegendData(e,i,s){const n=s==="replaced"||s==="series-grouping-change"||s==="updated",o=i.legend!=null&&e.legend==null;return n||o}applyMiniChartOptions(e,i,s,n){const o=n?.navigator?.miniChart?.series??n?.series,a=this.applySeries(e,this.filterMiniChartSeries(i),this.filterMiniChartSeries(o));this.applyAxes(e,s,n,a,["axes[].tick","axes[].thickness","axes[].title","axes[].crosshair","axes[].gridLine","axes[].label"]);const r=e.series;for(const h of r)h.properties.id=void 0;const l=e.axes,c=l.find(h=>h.direction==="x");for(const h of l)h.nice=!1,h.gridLine.enabled=!1,h.label.enabled=h===c,h.tick.enabled=!1,h.interactionEnabled=!1;if(c!=null){const h=s.navigator?.miniChart,d=h?.label,u=h?.label?.interval;if(c.line.enabled=!1,c.label.set(without(d,["interval","rotation","minSpacing","autoRotate","autoRotateAngle"])),c.tick.set(without(u,["enabled","width","size","color","interval","step"])),c.type==="grouped-category"){c.label.enabled=!1,c.label.rotation=0;const{depthOptions:g}=c;if(g.length===0)g.set([{label:{enabled:!0}}]);else for(let f=1;f<g.length;f++)g[f].label.enabled=!1}const p=u?.step;p!=null&&(c.interval.step=p)}}applyModules(e){const{type:i}=this.constructor;let s=!1;for(const n of moduleRegistry.byType("root","legend")){const a=e[n.optionsKey]!=null&&n.chartTypes.includes(i);a!==this.modulesManager.isEnabled(n)&&(a?(this.modulesManager.addModule(n,r=>r.moduleFactory(this.getModuleContext())),n.type==="legend"&&this.modulesManager.getModule(n)?.attachLegend(this.ctx.scene),this[n.optionsKey]=this.modulesManager.getModule(n)):(this.modulesManager.removeModule(n),delete this[n.optionsKey]),s=!0)}return s}initSeriesDeclarationOrder(e){for(let i=0;i<e.length;i++)e[i].setSeriesIndex(i)}applySeries(e,i,s){if(!i)return"no-change";const n=matchSeriesOptions(e.series,i,s);if(n.status==="no-overlap"){debug(`Chart.applySeries() - creating new series instances, status: ${n.status}`,n);const h=i.map(d=>this.createSeries(d));return this.initSeriesDeclarationOrder(h),e.series=h,"replaced"}debug("Chart.applySeries() - matchResult",n);const o=[];let a=!1,r=!1,l=!1;const c=n.changes.toSorted((h,d)=>h.targetIdx-d.targetIdx);for(const h of c)switch(r||(r=h.status==="series-grouping"),a||(a=h.diff?.data!=null),l||(l=h.status!=="no-op"),h.status){case"add":{const d=this.createSeries(h.opts);o.push(d),debug("Chart.applySeries() - created new series",d);break}case"remove":debug(`Chart.applySeries() - removing series at previous idx ${h.idx}`,h.series);break;case"no-op":o.push(h.series),debug(`Chart.applySeries() - no change to series at previous idx ${h.idx}`,h.series);break;case"series-grouping":case"update":default:{const{series:d,diff:u,idx:p}=h;debug(`Chart.applySeries() - applying series diff previous idx ${p}`,u,d),this.applySeriesValues(d,u),d.markNodeDataDirty(),o.push(d)}}return this.initSeriesDeclarationOrder(o),debug("Chart.applySeries() - final series instances",o),e.series=o,r?"series-grouping-change":a?"data-change":l?"updated":"no-op"}applyAxes(e,i,s,n,o=[]){if(!("axes"in i)||!i.axes)return!1;o=["axes[].type",...o];const{axes:a}=i;return!(n==="replaced")&&e.axes.length===a.length&&e.axes.every((c,h)=>c.type===a[h].type)&&isAgCartesianChartOptions(s)?(e.axes.forEach((c,h)=>{const d=s.axes?.[h]??{},u=jsonDiff(d,a[h]);debug(`Chart.applyAxes() - applying axis diff idx ${h}`,u);const p=`axes[${h}]`;jsonApply(c,u,{path:p,skip:o})}),!0):(debug(`Chart.applyAxes() - creating new axes instances; seriesStatus: ${n}`),e.axes=this.createAxis(a,o),!0)}createSeries(e){const i=seriesRegistry.create(e.type,this.getModuleContext());return this.applySeriesOptionModules(i,e),this.applySeriesValues(i,e),i}applySeriesOptionModules(e,i){const s=e.createModuleContext(),n=e.getModuleMap();for(const o of moduleRegistry.byType("series-option"))o.optionsKey in i&&o.seriesTypes.includes(e.type)&&n.addModule(o,a=>a.moduleFactory(s))}applySeriesValues(e,i){const s=e.getModuleMap(),{type:n,data:o,listeners:a,seriesGrouping:r,showInMiniChart:l,...c}=i;for(const h of EXPECTED_ENTERPRISE_MODULES)if(h.type==="series-option"&&h.optionsKey in c){const d=s.getModule(h.optionsKey);if(d){const u=c[h.optionsKey];delete c[h.optionsKey],d.properties.set(u)}}e.properties.set(c),"data"in i&&e.setOptionsData(o),a&&this.registerListeners(e,a,{nodeClick:"seriesNodeClick",nodeDoubleClick:"seriesNodeDoubleClick"}),"seriesGrouping"in i&&(r==null?e.seriesGrouping=void 0:e.seriesGrouping={...e.seriesGrouping,...r})}createAxis(e,i){const s=[],n=this.getModuleContext();for(let o=0;o<e.length;o++){const a=e[o],r=axisRegistry.create(a.type,n);this.applyAxisModules(r,a),jsonApply(r,a,{path:`axes[${o}]`,skip:i}),s.push(r)}return guessInvalidPositions(s),s}applyAxisModules(e,i){const s=e.createModuleContext(),n=e.getModuleMap();for(const o of moduleRegistry.byType("axis-option")){const a=i[o.optionsKey]!=null;a!==n.isEnabled(o)&&(a?(n.addModule(o,r=>r.moduleFactory(s)),e[o.optionsKey]=n.getModule(o)):(n.removeModule(o),delete e[o.optionsKey]))}}registerListeners(e,i,s){e.clearEventListeners();for(const[n,o]of entries(i))if(isFunction(o)){const a=s?.[n];a==null?e.addEventListener(n,o):e.addEventListener(a,r=>{if(r?.type===a){const l=new Proxy(r,{get(c,h,d){return h==="type"?n:Reflect.get(c,h,d)}});o(l)}else o(r)})}}};_Chart.chartsInstances=new WeakMap,__decorateClass2([ActionOnSet({newValue(t){this.destroyed||(this.ctx.domManager.setContainer(t),_Chart.chartsInstances.set(t,this))},oldValue(t){_Chart.chartsInstances.delete(t)}})],_Chart.prototype,"container",2),__decorateClass2([ActionOnSet({newValue(t){this.resize("width option",{inWidth:t})}})],_Chart.prototype,"width",2),__decorateClass2([ActionOnSet({newValue(t){this.resize("height option",{inHeight:t})}})],_Chart.prototype,"height",2),__decorateClass2([ActionOnSet({newValue(t){this.resize("minWidth option",{inMinWidth:t})}})],_Chart.prototype,"minWidth",2),__decorateClass2([ActionOnSet({newValue(t){this.resize("minHeight option",{inMinHeight:t})}})],_Chart.prototype,"minHeight",2),__decorateClass2([ActionOnSet({newValue(t){this.resize("overrideDevicePixelRatio option",{inOverrideDevicePixelRatio:t})}})],_Chart.prototype,"overrideDevicePixelRatio",2),__decorateClass2([TempValidate(OBJECT)],_Chart.prototype,"padding",2),__decorateClass2([TempValidate(OBJECT)],_Chart.prototype,"seriesArea",2),__decorateClass2([TempValidate(OBJECT)],_Chart.prototype,"keyboard",2),__decorateClass2([TempValidate(OBJECT)],_Chart.prototype,"touch",2),__decorateClass2([TempValidate(UNION(["standalone","integrated"],"a chart mode"))],_Chart.prototype,"mode",2),__decorateClass2([ProxyProperty("chartCaptions.title")],_Chart.prototype,"title",2),__decorateClass2([ProxyProperty("chartCaptions.subtitle")],_Chart.prototype,"subtitle",2),__decorateClass2([ProxyProperty("chartCaptions.footnote")],_Chart.prototype,"footnote",2),__decorateClass2([TempValidate(BOOLEAN)],_Chart.prototype,"suppressFieldDotNotation",2),__decorateClass2([ActionOnSet({changeValue(t,e){this.onAxisChange(t,e)}})],_Chart.prototype,"axes",2),__decorateClass2([ActionOnSet({changeValue(t,e){this.onSeriesChange(t,e)}})],_Chart.prototype,"series",2);var Chart=_Chart,debug2=Debug.create(!0,"opts"),DESTROYED_ERROR="AG Charts - Chart was destroyed, cannot perform request.",_AgChartInstanceProxy=class{constructor(e,i,s){this.factoryApi=i,this.licenseManager=s,this.chart=e}async update(e){if(!this.chart)throw new Error(DESTROYED_ERROR);return debug2.group("AgChartInstance.update()",async()=>{this.factoryApi.update(e,this),await this.chart?.waitForUpdate()})}async updateDelta(e){if(!this.chart)throw new Error(DESTROYED_ERROR);return debug2.group("AgChartInstance.updateDelta()",async()=>{this.factoryApi.updateUserDelta(this,e),await this.chart?.waitForUpdate()})}getOptions(){if(!this.chart)throw new Error(DESTROYED_ERROR);const e=deepClone(this.chart.getOptions());for(const i of Object.keys(e))i.startsWith("_")&&delete e[i];return e}waitForUpdate(){if(!this.chart)throw new Error(DESTROYED_ERROR);return this.chart.waitForUpdate()}async download(e){if(!this.chart)throw new Error(DESTROYED_ERROR);const i=await this.prepareResizedChart(this,this.chart,e);try{i.chart?.download(e?.fileName,e?.fileFormat)}finally{i.destroy()}}async __toSVG(e){if(!this.chart)throw new Error(DESTROYED_ERROR);const i=await this.prepareResizedChart(this,this.chart,{width:600,height:300,...e});try{return i?.chart?.toSVG()}finally{i?.destroy()}}async getImageDataURL(e){if(!this.chart)throw new Error(DESTROYED_ERROR);const i=await this.prepareResizedChart(this,this.chart,e);try{return i.chart.getCanvasDataURL(e?.fileFormat)}finally{i.destroy()}}getState(){return this.factoryApi.caretaker.save(...this.getEnabledOriginators())}async setState(e){const{chart:i}=this;if(!i)return;const s=this.getEnabledOriginators();if(!s.includes(i.ctx.legendManager)){await this.setStateOriginators(e,s);return}await this.setStateOriginators(e,s.filter(n=>n!==i.ctx.zoomManager)),await this.setStateOriginators(e,[i.ctx.zoomManager])}resetAnimations(){this.chart?.resetAnimations()}skipAnimations(){this.chart?.skipAnimations()}destroy(){this.releaseChart?(this.releaseChart(),this.releaseChart=void 0):this.chart&&(this.chart.publicApi=void 0,this.chart.destroy()),this.chart=void 0}async prepareResizedChart(e,i,s={}){const n=s.width??i.width??i.ctx.scene.canvas.width,o=s.height??i.height??i.ctx.scene.canvas.height,a=e.getState(),r=moduleRegistry.hasEnterpriseModules(),l={...i.chartOptions.processedOverrides,container:document.createElement("div"),width:n,height:o};s.width!=null&&s.height!=null&&(l.overrideDevicePixelRatio=1);const c=i.getOptions();r&&(l.animation={enabled:!1},this.licenseManager?.isDisplayWatermark()&&(l.foreground={text:this.licenseManager.getWatermarkMessage(),image:{url:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=",width:170,height:25,right:25,bottom:50,opacity:.7}}));const h={...i.chartOptions.specialOverrides},d={...i.chartOptions.optionMetadata},u=this.factoryApi.create(c,l,h,d);await u.setState(a),u.chart?.ctx.zoomManager.updateZoom("chartProxy",i.ctx.zoomManager.getZoom()),u.chart?.ctx.legendManager.clearData(),u.chart?.ctx.legendManager.update(i.ctx.legendManager.getData()),i.series.forEach((g,f)=>{g.visible||(u.chart.series[f].visible=!1)});const p=[];for(const g of i.modulesManager.legends())p.push(g.legend.pagination?.currentPage??0);for(const g of u.chart.modulesManager.legends()){const f=p.shift()??0;g.legend.pagination&&g.legend.pagination.setPage(f)}return u.chart?.update(0,{forceNodeDataRefresh:!0}),await u.waitForUpdate(),u}getEnabledOriginators(){if(!this.chart)return[];const{chartOptions:{processedOptions:e,optionMetadata:i},ctx:{annotationManager:s,chartTypeOriginator:n,zoomManager:o,legendManager:a}}=this.chart,r=[];return"annotations"in e&&e.annotations?.enabled&&r.push(s),i.presetType==="price-volume"&&r.push(n),(e.navigator?.enabled||e.zoom?.enabled)&&r.push(o),"legend"in this.chart&&r.push(a),r}async setStateOriginators(e,i){this.factoryApi.caretaker.restore(e,...i),this.chart?.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),await this.chart?.waitForUpdate()}};_AgChartInstanceProxy.chartInstances=new WeakMap,__decorateClass2([ActionOnSet({oldValue(t){t.destroyed||(t.publicApi=void 0),_AgChartInstanceProxy.chartInstances.delete(t)},newValue(t){t&&(t.publicApi=this,_AgChartInstanceProxy.chartInstances.set(t,this))}})],_AgChartInstanceProxy.prototype,"chart",2);var AgChartInstanceProxy=_AgChartInstanceProxy,Locale=class extends BaseModuleInstance{constructor(t){super(),this.ctx=t,this.localeText=void 0}};__decorateClass2([ObserveChanges(t=>{t.ctx.localeManager.setLocaleText(t.localeText)}),TempValidate(PLAIN_OBJECT,{optional:!0})],Locale.prototype,"localeText",2),__decorateClass2([ObserveChanges(t=>{t.ctx.localeManager.setLocaleTextFormatter(t.getLocaleText)}),TempValidate(FUNCTION,{optional:!0})],Locale.prototype,"getLocaleText",2);var LocaleModule={type:"root",optionsKey:"locale",packageType:"community",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new Locale(t)},CategoryScale=class extends BandScale{constructor(){super(...arguments),this.type="band",this.index=void 0,this._domain=[]}set domain(t){this._domain!==t&&(this.invalid=!0,this._domain=t,this.index=void 0)}get domain(){return this._domain}normalizeDomains(...t){let e;const i=new Set;let s=!0;for(const n of t)i.has(n)||(i.add(n),e==null?e=deduplicateCategories(n):(s&&(s=domainOrderedToNormalizedDomain(n,e)),e=deduplicateCategories([...e,...n])));return e??(e=[]),{domain:e,animatable:s}}toDomain(t){}invert(t,e=!1){this.refresh();const i=e?this.bandwidth/2:0,s=this.invertNearestIndex(Math.max(0,t-i));return e||t===this.ordinalRange(s)?this.domain[s]:void 0}getIndex(t){let{index:e}=this;if(e==null){const{domain:i}=this;e=new Map;for(let s=0;s<i.length;s++)e.set(dateToNumber(i[s]),s);this.index=e}return e.get(dateToNumber(t))}};function deduplicateCategories(t){let e;const i=new Set;for(const s of t){const n=dateToNumber(s),o=i.size;i.add(n),i.size!==o?e?.push(s):e??(e=t.slice(0,i.size))}return e??t}function domainOrderedToNormalizedDomain(t,e){let i=-1;for(const s of t){const n=e.indexOf(s);if(n===-1)i=1/0;else{if(n<=i)return!1;i=n}}return!0}var _CategoryAxis=class te extends CartesianAxis{constructor(e,i=new CategoryScale){super(e,i),this.groupPaddingInner=.1,this.includeInvisibleDomains=!0,this.nice=!1}static is(e){return e instanceof te}normaliseDataDomain(e){return{domain:e,clipped:!1}}updateScale(){super.updateScale();let{paddingInner:e,paddingOuter:i}=this;if(!isFiniteNumber(e)||!isFiniteNumber(i)){const s=this.reduceBandScalePadding();e??(e=s.inner),i??(i=s.outer)}this.scale.paddingInner=e??0,this.scale.paddingOuter=i??0}reduceBandScalePadding(){return this.boundSeries.reduce((e,i)=>{const s=i.getBandScalePadding?.();return s&&(e.inner>s.inner&&(e.inner=s.inner),e.outer<s.outer&&(e.outer=s.outer)),e},{inner:1/0,outer:-1/0})}};_CategoryAxis.className="CategoryAxis",_CategoryAxis.type="category",__decorateClass2([TempValidate(RATIO)],_CategoryAxis.prototype,"groupPaddingInner",2),__decorateClass2([TempValidate(RATIO,{optional:!0})],_CategoryAxis.prototype,"paddingInner",2),__decorateClass2([TempValidate(RATIO,{optional:!0})],_CategoryAxis.prototype,"paddingOuter",2);var CategoryAxis=_CategoryAxis,GroupedCategoryScale=class extends CategoryScale{normalizeDomains(...t){const{domain:e}=super.normalizeDomains(...t);return{domain:e,animatable:!1}}getIndex(t){return super.getIndex(t)??this.getMatchIndex(t)}getMatchIndex(t){const e=JSON.stringify(t),i=this._domain.find(s=>JSON.stringify(s)===e);if(i!=null)return super.getIndex(i)}};function extent(t){if(t.length===0)return null;let e=1/0,i=-1/0;for(const n of t){const o=n instanceof Date?n.getTime():n;typeof o=="number"&&(o<e&&(e=o),o>i&&(i=o))}const s=[e,i];return s.every(isFinite)?s:null}function normalisedExtentWithMetadata(t,e,i){let s=!1;return t.length>2&&(t=extent(t)??[NaN,NaN]),e!=null&&(s||(s=e>t[0]),t=[e,t[1]]),i!=null&&(s||(s=i<t[1]),t=[t[0],i]),t[0]>t[1]&&(t=[]),{extent:t,clipped:s}}var memorizedFns=new WeakMap;function memo(t,e){const i=JSON.stringify(t,null,0);return memorizedFns.has(e)||memorizedFns.set(e,new Map),memorizedFns.get(e)?.has(i)||memorizedFns.get(e)?.set(i,e(t)),memorizedFns.get(e)?.get(i)}function simpleMemorize(t,e){const i=new Map,s=(...a)=>a.map(r=>typeof r=="object"||typeof r=="symbol"?r:(i.has(r)||i.set(r,{v:r}),i.get(r))),n={},o=new WeakMap;return(...a)=>{const r=a.length===0?[n]:s(...a);let l=o;for(const d of r.slice(0,-1))l.has(d)||l.set(d,new WeakMap),l=l.get(d);const c=r.at(-1);let h=l.get(c);return h?e?.("hit",t,a):(h=t(...a),l.set(c,h),e?.("miss",t,a)),h}}function sumValues(t,e=[0,0]){for(const i of t)typeof i=="number"&&(i<0&&(e[0]+=i),i>0&&(e[1]+=i));return e}function sum(t,e){return{id:t,matchGroupIds:[e],type:"aggregate",aggregateFunction:s=>sumValues(s)}}function groupSum(t,e){return{id:t,type:"aggregate",matchGroupIds:e?[e]:void 0,aggregateFunction:i=>sumValues(i),groupAggregateFunction:(i,s=[0,0])=>(s[0]+=i?.[0]??0,s[1]+=i?.[1]??0,s)}}function range2(t,e){return{id:t,matchGroupIds:[e],type:"aggregate",aggregateFunction:s=>ContinuousDomain.extendDomain(s)}}function groupCount(t){return{id:t,type:"aggregate",aggregateFunction:()=>[0,1],groupAggregateFunction:(e,i=[0,0])=>(i[0]+=e?.[0]??0,i[1]+=e?.[1]??0,i)}}function groupAverage(t,e){return{id:t,matchGroupIds:e?[e]:void 0,type:"aggregate",aggregateFunction:s=>sumValues(s),groupAggregateFunction:(s,n=[0,0,-1])=>(n[0]+=s?.[0]??0,n[1]+=s?.[1]??0,n[2]++,n),finalFunction:(s=[0,0,0])=>{const n=s[0]+s[1];return n>=0?[0,n/s[2]]:[n/s[2],0]}}}function area(t,e,i){const s={id:t,matchGroupIds:i?[i]:void 0,type:"aggregate",aggregateFunction:(n,o=[])=>{const a=o[1]-o[0];return e.aggregateFunction(n).map(r=>r/a)}};return e.groupAggregateFunction&&(s.groupAggregateFunction=e.groupAggregateFunction),s}function accumulatedValue(t){return()=>{let e=0;return i=>isFiniteNumber(i)?(e+=t?Math.max(0,i):i,e):i}}function trailingAccumulatedValue(){return()=>{let t=0;return e=>{if(!isFiniteNumber(e))return e;const i=t;return t+=e,i}}}function basicContinuousCheckDatumValidation(t){return t!=null&&isContinuous(t)}function basicDiscreteCheckDatumValidation(t){return t!=null}function getValidationFn(t){switch(t){case"number":case"log":case"ordinal-time":case"time":case"color":return basicContinuousCheckDatumValidation;default:return basicDiscreteCheckDatumValidation}}function getValueType(t){switch(t){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function keyProperty(t,e,i={}){return{property:t,type:"key",valueType:getValueType(e),validation:getValidationFn(e),...i}}function valueProperty(t,e,i={}){return{property:t,type:"value",valueType:getValueType(e),validation:getValidationFn(e),...i}}function rowCountProperty(t,e={}){return{property:t,type:"value",valueType:"range",missingValue:1,processor:()=>()=>1,...e}}var noopProcessor=function(t){return t};function processorChain(...t){const e=t.filter(i=>i!=null);return e.length===0?()=>noopProcessor:e.length===1?e[0]:()=>{const i=e.map(s=>s());return(s,n)=>i.reduce((o,a)=>a(o,n),s)}}function rangedValueProperty(t,e={}){const{min:i=-1/0,max:s=1/0,processor:n,...o}=e;return{type:"value",property:t,valueType:"range",validation:basicContinuousCheckDatumValidation,processor:processorChain(n,()=>a=>isFiniteNumber(a)?clamp(i,a,s):a),...o}}function accumulativeValueProperty(t,e,i={}){const{onlyPositive:s,processor:n,...o}=i;return{...valueProperty(t,e,o),processor:processorChain(n,accumulatedValue(s))}}function trailingAccumulatedValueProperty(t,e,i={}){return{...valueProperty(t,e,i),processor:trailingAccumulatedValue()}}function groupAccumulativeValueProperty(t,e,i,s,n){return[valueProperty(t,n,s),accumulateGroup(s.groupId,e,i,s.separateNegative),...s.rangeId!=null?[range2(s.rangeId,s.groupId)]:[]]}function groupStackValueProperty(t,e,i){return[valueProperty(t,e,i),accumulateStack(i.groupId)]}var SMALLEST_KEY_INTERVAL={type:"reducer",property:"smallestKeyInterval",initialValue:1/0,reducer:()=>{let t=NaN;return(e=1/0,i)=>{const s=typeof i[0]=="number"?i[0]:Number(i[0]),n=Math.abs(s-t);return t=s,!isNaN(n)&&n>0&&n<e?n:e}}},LARGEST_KEY_INTERVAL={type:"reducer",property:"largestKeyInterval",initialValue:-1/0,reducer:()=>{let t=NaN;return(e=-1/0,i)=>{const s=typeof i[0]=="number"?i[0]:Number(i[0]),n=Math.abs(s-t);return t=s,!isNaN(n)&&n>0&&n>e?n:e}}},SORT_DOMAIN_GROUPS={type:"processor",property:"sortedGroupDomain",calculate:({domain:{groups:t}})=>t?.slice().sort((e,i)=>{for(let s=0;s<e.length;s++){const n=e[s]-i[s];if(n!==0)return n}return 0})};function normaliseFnBuilder({normaliseTo:t}){const e=(i,s)=>{if(s===0)return null;const n=(i??0)*t/s;return n>=0?Math.min(t,n):Math.max(-t,n)};return()=>()=>(i,s,n)=>{const o=normaliseFindExtent(i,s,n);for(const a of s)for(const r of n.datumIndices[a]??[]){const l=i[a],c=l[r];if(c==null){l[r]=void 0;continue}l[r]=typeof c=="number"?e(c,o):c.map(h=>e(h,o))}}}function normaliseFindExtent(t,e,i){const s=[0,0];for(const n of e){const o=t[n];for(const a of i.datumIndices[n]??[]){const r=o[a];if(r==null)continue;const l=typeof r=="number"?r:Math.max(...r.map(h=>h??0)),c=l<0?0:1;c===0?s[c]=Math.min(s[c],l):s[c]=Math.max(s[c],l)}}return Math.max(Math.abs(s[0]),s[1])}function normaliseGroupTo(t,e){return{type:"group-value-processor",matchGroupIds:t,adjust:memo({normaliseTo:e},normaliseFnBuilder)}}function normalisePropertyFnBuilder({normaliseTo:t,zeroDomain:e,rangeMin:i,rangeMax:s}){const n=t[1]-t[0],o=(a,r,l)=>{const c=t[0]+(a-r)/l*n;return l===0?e:c>=t[1]?t[1]:c<t[0]?t[0]:c};return()=>(a,r)=>{let[l,c]=a.domain.values[r];i!=null&&(l=i),s!=null&&(c=s);const h=c-l;a.domain.values[r]=[t[0],t[1]];const d=a.columns[r];for(let u=0;u<d.length;u+=1)d[u]=o(d[u],l,h)}}function normalisePropertyTo(t,e,i,s,n){return{type:"property-value-processor",property:t,adjust:memo({normaliseTo:e,rangeMin:s,rangeMax:n,zeroDomain:i},normalisePropertyFnBuilder)}}var ANIMATION_VALIDATION_UNIQUE_KEYS=1,ANIMATION_VALIDATION_ORDERED_KEYS=2,animationValidationProcessKey=(t,e,i,s)=>{let n=ANIMATION_VALIDATION_UNIQUE_KEYS|ANIMATION_VALIDATION_ORDERED_KEYS;if(e.valueType==="category")return i.length!==t&&(n&=~ANIMATION_VALIDATION_UNIQUE_KEYS),n;let o=s[0]?.valueOf();for(let a=1;n!==0&&a<s.length;a++){const r=s[a]?.valueOf();(!Number.isFinite(r)||o>r)&&(n&=~ANIMATION_VALIDATION_ORDERED_KEYS),Number.isFinite(r)&&o===r&&(n&=~ANIMATION_VALIDATION_UNIQUE_KEYS),o=r}return n};function animationValidation(t){return{type:"processor",property:"animationValidation",calculate(e){const{keys:i,values:s}=e.defs,{input:{count:n},domain:{keys:o,values:a},keys:r,columns:l}=e;let c=ANIMATION_VALIDATION_UNIQUE_KEYS|ANIMATION_VALIDATION_ORDERED_KEYS;if(n!==0){for(let h=0;c!==0&&h<i.length;h++)for(const d of i[h].scopes)c&=animationValidationProcessKey(n,i[h],o[h],r[h].get(d));for(let h=0;c!==0&&h<s.length;h++){const d=s[h];t?.includes(d.id)&&(c&=animationValidationProcessKey(n,d,a[h],l[h]))}}return{uniqueKeys:(c&ANIMATION_VALIDATION_UNIQUE_KEYS)!==0,orderedKeys:(c&ANIMATION_VALIDATION_ORDERED_KEYS)!==0}}}}function buildGroupAccFn({mode:t,separateNegative:e}){return()=>()=>(i,s,n)=>{const o=[0,0];for(const a of s)for(const r of n.datumIndices[a]??[]){const l=i[a],c=l[r],h=isNegative(c)&&e?0:1;isFiniteNumber(c)&&(t==="normal"&&(o[h]+=c),l[r]=o[h],t==="trailing"&&(o[h]+=c))}}}function buildGroupWindowAccFn({mode:t,sum:e}){return()=>{const i=[];let s=!0;return()=>(n,o,a)=>{let r=0;for(const l of o){const c=n[l];for(const h of a.datumIndices[l]??[]){const d=c[h],u=s&&e==="current"?0:i[l];i[l]=d;const p=e==="current"?d:u;if(!isFiniteNumber(d)||!isFiniteNumber(u)){c[h]=r;continue}t==="normal"&&(r+=p),c[h]=r,t==="trailing"&&(r+=p)}}s=!1}}}function accumulateGroup(t,e,i,s=!1){let n;if(e.startsWith("window")){const o=e.endsWith("-trailing")?"trailing":"normal";n=memo({mode:o,sum:i},buildGroupWindowAccFn)}else n=memo({mode:e,separateNegative:s},buildGroupAccFn);return{type:"group-value-processor",matchGroupIds:[t],adjust:n}}function groupStackAccFn(){return()=>(t,e,i)=>{const s=new Float64Array(e.length);let n=0;for(const o of e){const a=t[o];for(const r of i.datumIndices[o]??[]){const l=a[r];s[n]=Number.isFinite(l)?l:NaN,n+=1,a[r]=s.subarray(0,n)}}}}function accumulateStack(t){return{type:"group-value-processor",matchGroupIds:[t],adjust:groupStackAccFn}}function valueIdentifier(t){return t.id??t.property}function valueIndices(t,e,i){const s=new Map,n=e.defs.values;for(let r=0;r<n.length;r+=1){const l=n[r];if(l.scopes?.includes(t)===!1)continue;const c=valueIdentifier(l);if(s.has(c))return;s.set(c,r)}const o=[],a=i.defs.values;for(let r=0;r<a.length;r+=1){const l=a[r];if(l.scopes?.includes(t)===!1)continue;const c=valueIdentifier(l),h=s.get(c);if(h==null)return;s.delete(c),o.push({previousIndex:h,nextIndex:r})}if(s.size===0)return o}function columnsEqual(t,e,i,s,n){for(const{previousIndex:o,nextIndex:a}of i){const r=t[o],l=e[a],c=r[s],h=l[n];if(c!==h)return!1}return!0}function diff(t,e,i=!0){return{type:"processor",property:"diff",calculate(s,n){const o=new Map,a=new Map,r=new Map,l=new Map,c=e.keys,h=s.keys,d=e.columns,u=s.columns,p=valueIndices(t,e,s);if(p==null)return n;const g=Math.max(e.input.count,s.input.count);for(let y=0;y<g;y++){const x=y<e.input.count,b=y<s.input.count,S=x?datumKeys(c,t,y):void 0,v=S!=null?createDatumId(S):"",I=b?datumKeys(h,t,y):void 0,A=I!=null?createDatumId(I):"";if(b&&x&&v===A){columnsEqual(d,u,p,y,y)||r.set(A,y);continue}const D=l.get(A);D!=null?((i||!columnsEqual(d,u,p,D,y))&&(r.set(A,y),o.set(A,y)),l.delete(A)):b&&a.set(A,y);const T=a.get(v);T!=null?((i||!columnsEqual(d,u,p,T,y))&&(r.set(v,y),o.set(v,y)),a.delete(v)):x&&(r.delete(v),l.set(v,y))}const m={changed:a.size>0||r.size>0||l.size>0,added:new Set(a.keys()),updated:new Set(r.keys()),removed:new Set(l.keys()),moved:new Set(o.keys())};return{...n,[t]:m}}}}function createDatumId(t,...e){let i;return isArray(t)?i=t.map(n=>transformIntegratedCategoryValue(n)).join("___"):i=transformIntegratedCategoryValue(t),(typeof i=="string"||typeof i=="number"||typeof i=="boolean"||i instanceof Date)&&e.length>0&&(i+=`___${e.join("___")}`),i}var Dimensions=class{constructor(){this.top=1/0,this.right=-1/0,this.bottom=-1/0,this.left=1/0}update(t,e){t>this.right&&(this.right=t),t<this.left&&(this.left=t),e>this.bottom&&(this.bottom=e),e<this.top&&(this.top=e)}},TreeNode=class ee{constructor(e="",i,s){this.label=e,this.parent=i,this.refId=s,this.x=0,this.y=0,this.subtreeLeft=NaN,this.subtreeRight=NaN,this.children=[],this.leafCount=0,this.prelim=0,this.mod=0,this.ancestor=this,this.change=0,this.shift=0,this.index=0,this.screenX=0,this.depth=i?i.depth+1:0}insertTick(e,i){let s=this;for(let n=0;n<e.length;n++){const o=e[n],a=n!==e.length-1,{children:r}=s,l=r.find(c=>c.label===o);if(l&&a)s=l;else{const c=new ee(o,s,i);c.index=r.length,r.push(c),a&&(s=c)}}}getLeftSibling(){return this.index>0?this.parent?.children[this.index-1]:void 0}getLeftmostSibling(){return this.index>0?this.parent?.children[0]:void 0}nextLeft(){return this.children[0]}nextRight(){return this.children.at(-1)}getSiblings(){return this.parent?.children.filter((e,i)=>i!==this.index)??[]}};function ticksToTree(t){const e=t.reduce((s,n)=>s<n.length?n.length:s,0),i=new TreeNode;for(let s=0;s<t.length;s++){const n=t[s];for(;n.length<e;)n.push("");i.insertTick(n,s)}return i}function moveSubtree(t,e,i){const s=e.index-t.index,n=i/s;e.change-=n,e.shift+=i,t.change+=n,e.prelim+=i,e.mod+=i}function ancestor(t,e,i){return e.getSiblings().indexOf(t.ancestor)>=0?t.ancestor:i}function executeShifts({children:t}){let e=0,i=0;for(let s=t.length-1;s>=0;s--){const n=t[s];n.prelim+=e,n.mod+=e,i+=n.change,e+=n.shift+i}}function apportion(t,e){const i=t.getLeftSibling();if(i){let s=t,n=t,o=i,a=n.getLeftmostSibling(),r=n.mod,l=s.mod,c=o.mod,h=a.mod;for(;o.nextRight()&&n.nextLeft();){o=o.nextRight(),n=n.nextLeft(),a=a.nextLeft(),s=s.nextRight(),s.ancestor=t;const d=o.prelim+c-(n.prelim+r)+1;d>0&&(moveSubtree(ancestor(o,t,e),t,d),r+=d,l+=d),c+=o.mod,r+=n.mod,h+=a.mod,l+=s.mod}o.nextRight()&&!s.nextRight()?s.mod+=c-l:(n.nextLeft()&&!a.nextLeft()&&(a.mod+=r-h),e=t)}return e}function firstWalk(t){const{children:e}=t;if(e.length){let[i]=e;for(const o of e)firstWalk(o),i=apportion(o,i);executeShifts(t);const s=(e[0].prelim+e.at(-1).prelim)/2,n=t.getLeftSibling();n?(t.prelim=n.prelim+1,t.mod=t.prelim-s):t.prelim=s}else{const i=t.getLeftSibling();t.prelim=i?i.prelim+1:0}}function secondWalk(t,e,i){t.x=t.prelim+e,t.y=t.depth,i.insertNode(t);for(const s of t.children)secondWalk(s,e+t.mod,i)}function thirdWalk(t){const{children:e}=t;let i=0;for(const s of e)thirdWalk(s),s.children.length?i+=s.leafCount:i++;t.leafCount=i,e.length?(t.subtreeLeft=e[0].subtreeLeft,t.subtreeRight=e[e.length-1].subtreeRight,t.x=(t.subtreeLeft+t.subtreeRight)/2):(t.subtreeLeft=t.x,t.subtreeRight=t.x)}function treeLayout(t){const e=new TreeLayout,i=ticksToTree(t);return firstWalk(i),secondWalk(i,-i.prelim,e),thirdWalk(i),e}var TreeLayout=class{constructor(){this.dimensions=new Dimensions,this.nodes=[],this.depth=0}insertNode(t){this.depth<t.depth&&(this.depth=t.depth),this.dimensions.update(t.x,t.y),this.nodes.push(t)}scalingX(t,e){let i=1;if(t>0){const{left:s,right:n}=this.dimensions;i=t/(n-s)}return e&&(i*=-1),i}},DepthLabelProperties=class extends BaseProperties{constructor(){super(...arguments),this.enabled=!0}};__decorateClass2([TempValidate(BOOLEAN)],DepthLabelProperties.prototype,"enabled",2),__decorateClass2([TempValidate(BOOLEAN,{optional:!0})],DepthLabelProperties.prototype,"avoidCollisions",2),__decorateClass2([TempValidate(COLOR_STRING,{optional:!0})],DepthLabelProperties.prototype,"color",2),__decorateClass2([TempValidate(POSITIVE_NUMBER,{optional:!0})],DepthLabelProperties.prototype,"spacing",2),__decorateClass2([TempValidate(FONT_STYLE,{optional:!0})],DepthLabelProperties.prototype,"fontStyle",2),__decorateClass2([TempValidate(FONT_WEIGHT,{optional:!0})],DepthLabelProperties.prototype,"fontWeight",2),__decorateClass2([TempValidate(NUMBER.restrict({min:1}),{optional:!0})],DepthLabelProperties.prototype,"fontSize",2),__decorateClass2([TempValidate(STRING,{optional:!0})],DepthLabelProperties.prototype,"fontFamily",2);var DepthTickProperties=class extends BaseProperties{constructor(){super(...arguments),this.enabled=!0}};__decorateClass2([TempValidate(BOOLEAN)],DepthTickProperties.prototype,"enabled",2),__decorateClass2([TempValidate(POSITIVE_NUMBER,{optional:!0})],DepthTickProperties.prototype,"width",2),__decorateClass2([TempValidate(COLOR_STRING,{optional:!0})],DepthTickProperties.prototype,"stroke",2);var DepthProperties=class extends BaseProperties{constructor(){super(...arguments),this.label=new DepthLabelProperties,this.tick=new DepthTickProperties}};__decorateClass2([TempValidate(OBJECT)],DepthProperties.prototype,"label",2),__decorateClass2([TempValidate(OBJECT)],DepthProperties.prototype,"tick",2);var GroupedCategoryAxis=class extends CategoryAxis{constructor(t){super(t,new GroupedCategoryScale),this.tickScale=new GroupedCategoryScale,this.depthOptions=new PropertiesArray(DepthProperties),this.includeInvisibleDomains=!0,this.tickScale.paddingInner=1,this.tickScale.paddingOuter=0}resizeTickTree(){if(!this.tickTreeLayout)return;const{nodes:t}=this.tickTreeLayout,{range:e,step:i,inset:s,bandwidth:n}=this.scale,o=Math.abs(e[1]-e[0])-i,a=this.tickTreeLayout.scalingX(o,e[0]>e[1]),r=s+n/2;let l=0;for(const c of t){const h=c.x*a;l>h&&(l=h),c.screenX=h+r}for(const c of t)c.screenX-=l}getDepthOptionsMap(t){const e=[],{depthOptions:i,label:s}=this;for(let n=0;n<t;n++)e.push(i[n]?.label.enabled??s.enabled?{enabled:!0,spacing:i[n]?.label.spacing??s.spacing,lineHeight:TextUtils.getLineHeight(i[n]?.label.fontSize??s.fontSize??10),avoidCollisions:i[n]?.label.avoidCollisions??s.avoidCollisions}:{enabled:!1,spacing:0,lineHeight:0,avoidCollisions:!1});return e}updateCategoryLabels(){this.computedLayout&&this.tickLabelGroupSelection.update(this.computedLayout.tickLabelLayout).each((t,e)=>t.setProperties(e))}updateAxisLine(){this.computedLayout&&(this.lineNode.visible=this.line.enabled,this.lineNode.stroke=this.line.stroke,this.lineNode.strokeWidth=this.line.width)}computeLayout(){if(this.updateDirection(),this.updateScale(),this.resizeTickTree(),!this.tickTreeLayout?.depth)return{bbox:BBox.zero,separatorLayout:[],tickLabelLayout:[]};const{step:t}=this.scale,{title:e,label:i,range:s,depthOptions:n}=this,{depth:o,nodes:a}=this.tickTreeLayout,r=Math.ceil(i.fontSize/t),l=toRadians(this.rotation),c=this.position==="top"||this.position==="bottom",h=i.getSideFlag(),d=[],u=new Map,p=new TransformableText,{defaultRotation:g,configuredRotation:f}=calculateLabelRotation({rotation:i.rotation,parallel:i.parallel,regularFlipRotation:normalizeAngle360(l-Math.PI/2),parallelFlipRotation:normalizeAngle360(l)}),m=g+f,y=this.getDepthOptionsMap(o),x=(R,E)=>{const _=o-R.depth;if(!y[_]?.enabled||E%r!==0||!inRange(R.screenX,s))return!1;const G=this.formatTick(R.label,E-1,this.scale.domain),B=this.getLabelStyles({value:G,depth:_},n[_]?.label);return p.setProperties({...B,text:G,textAlign:"center",textBaseline:i.parallel?"hanging":"bottom",rotation:0,translationX:0,translationY:R.screenX}),!0};let b=0;const S={};a.forEach((R,E)=>{const _=o-R.depth,G=countLines(R.label);if(S[_]??(S[_]=1),S[_]<G&&(S[_]=G),!(!x(R,E)||!p.getBBox())&&(u.set(E,p.getBBox()),!R.leafCount)){p.rotation=m;const{width:z}=p.getBBox();b<z&&(b=z)}});const v=createIdsGenerator(),I=h*y[0].spacing,A=new Map,D=R=>{let E=b;for(let _=1;_<=R;_++)E+=y[_].spacing,(i.mirrored||_!==R)&&(E+=S[_]*y[_].lineHeight);return E};a.forEach((R,E)=>{if(E===0)return;const _=x(R,E),G=!R.children.length,B=o-R.depth;if(R.parent){const P=G?R.x:R.x-(R.leafCount-1)/2;if(!A.has(P)){const V=this.depthOptions[B]?.tick;let j=b;for(let H=0;H<=B;H++)j+=y[H].spacing,H!==0&&(j+=S[H]*y[H].lineHeight);A.set(P,{tickSize:j,tickStroke:V?.stroke,tickWidth:V?.enabled!==!1?V?.width:0})}}if(!_)return;if(p.x=I,p.y=0,G){const{width:P}=u.get(E),V=getAngleRatioRadians(m);p.rotation=m,p.textAlign="end",p.textBaseline="middle",p.rotationCenterX=I-P/2,p.translationX=(y[B].spacing-P)/2*V*h,i.mirrored&&(p.translationX+=P)}else p.rotation=c?g:-Math.PI/2,p.rotationCenterX=I,p.translationX=h*D(B);if(y[B].avoidCollisions){const P=G?t:R.leafCount*t;if(p.getBBox().height>P){u.delete(E);return}}const{text:z=""}=p;d.push({text:z,visible:!0,range:this.scale.range,tickId:v(z),fill:p.fill,fontFamily:p.fontFamily,fontSize:p.fontSize,fontStyle:p.fontStyle,fontWeight:p.fontWeight,rotation:p.rotation,rotationCenterX:p.rotationCenterX,textAlign:p.textAlign,textBaseline:p.textBaseline,translationX:p.translationX,translationY:p.translationY,x:p.x,y:p.y}),u.set(E,Transformable.toCanvas(p))});const{enabled:T,stroke:k,width:w}=this.line;this.lineNode.datum={x:0,y1:s[0],y2:s[1]},this.lineNode.setProperties({stroke:k,strokeWidth:T?w:0});const L=[...A.values()];L.push(L[0]);const O=[this.lineNode.getBBox(),new BBox(0,0,L[0].tickSize*h,0)];e.enabled&&(this.updateTitle(this.scale.domain,!1,L[0].tickSize),O.push(e.caption.node.getBBox()));const F=BBox.merge(iterate(u.values(),O));return{bbox:this.getTransformBox(F),separatorLayout:L,tickLabelLayout:d}}update(){if(!this.computedLayout)return;this.moduleCtx.animationManager.skipCurrentBatch();const{tickScale:t,gridLine:e,gridLength:i}=this,{separatorLayout:s}=this.computedLayout,n=t.ticks({nice:!1,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0}).map((o,a)=>({...s[a],tick:o,tickId:createDatumId(o,a),tickLabel:o.filter(Boolean).join(" - "),translationY:Math.round(t.convert(o))}));this.gridLineGroupSelection.update(e.enabled&&i?n:[]),this.tickLineGroupSelection.update(this.tick.enabled?n:[]),this.updatePosition(),this.updateCategoryLabels(),this.updateAxisLine(),this.updateGridLines(),this.updateTickLines(),this.updateTitle(this.scale.domain),this.resetSelectionNodes()}calculateLayout(){const{separatorLayout:t,tickLabelLayout:e,bbox:i}=this.computeLayout();return this.computedLayout={separatorLayout:t,tickLabelLayout:e},{bbox:i,niceDomain:this.scale.domain}}onGridVisibilityChange(){this.gridLineGroupSelection.clear(),this.tickLabelGroupSelection.clear()}updateScale(){super.updateScale(),this.tickScale.range=this.scale.range,this.scale.paddingOuter=this.scale.paddingInner/2}processData(){const{direction:t}=this,e=this.boundSeries.filter(n=>n.visible).flatMap(n=>n.getDomain(t));this.dataDomain={domain:extent(e)??this.filterDuplicateArrays(e),clipped:!1},this.isReversed()&&this.dataDomain.domain.reverse();const i=this.dataDomain.domain.map(n=>toArray(isObject(n)&&"value"in n?n.value:n));this.tickTreeLayout=treeLayout(i);const s=[];for(const n of this.tickTreeLayout.nodes)n.leafCount||n.refId==null||s.push(this.dataDomain.domain[n.refId]);this.scale.domain=sortBasedOnArray(this.dataDomain.domain,s),this.tickScale.domain=i.concat([[""]])}updateGridLines(){if(!this.gridLength)return;const{width:t,style:e}=this.gridLine,i=this.gridLength*-this.label.getSideFlag();this.gridLineGroupSelection.each((s,n,o)=>{const{stroke:a,lineDash:r}=e[o%e.length],l=n.translationY;s.visible=this.inRange(l),s.x1=0,s.x2=i,s.y=l,s.stroke=a,s.strokeWidth=t,s.lineDash=r})}filterDuplicateArrays(t){const e=new Set;return t.filter(i=>{const s=isArray(i)?JSON.stringify(i):i;return e.has(s)?!1:(e.add(s),!0)})}};GroupedCategoryAxis.className="GroupedCategoryAxis",GroupedCategoryAxis.type="grouped-category",__decorateClass2([TempValidate(OBJECT_ARRAY)],GroupedCategoryAxis.prototype,"depthOptions",2);var logFunctions={2:(t,e)=>Math.log2(e),[Math.E]:(t,e)=>Math.log(e),10:(t,e)=>Math.log10(e)},DEFAULT_LOG=(t,e)=>Math.log(e)/Math.log(t);function log2(t,e,i){const s=Math.min(...e),n=logFunctions[t]??DEFAULT_LOG;return s>=0?n(t,i):-n(t,-i)}var powFunctions={[Math.E]:(t,e)=>Math.exp(e),10:(t,e)=>e>=0?10**e:1/10**-e},DEFAULT_POW=(t,e)=>t**e;function pow(t,e,i){const s=Math.min(...e),n=powFunctions[t]??DEFAULT_POW;return s>=0?n(t,i):-n(t,-i)}var LogScale=class extends ContinuousScale{constructor(t=[1,10],e=[0,1]){super(t,e),this.type="log",this.defaultClamp=!0,this.base=10,this.log=i=>log2(this.base,this.domain,i),this.pow=i=>pow(this.base,this.domain,i)}toDomain(t){return t}transform(t){const[e,i]=findMinMax(this.domain);return e>=0!=i>=0?NaN:e>=0?Math.log(t):-Math.log(-t)}transformInvert(t){const[e,i]=findMinMax(this.domain);return e>=0!=i>=0?NaN:e>=0?Math.exp(t):-Math.exp(-t)}niceDomain(t,e=this.domain){if(e.length<2)return[];const{base:i}=this,[s,n]=e,o=s>n?Math.ceil:Math.floor,a=s>n?Math.floor:Math.ceil,r=pow(i,e,o(log2(i,e,s))),l=pow(i,e,a(log2(i,e,n)));return[r,l]}ticks({interval:t,tickCount:e=ContinuousScale.defaultTickCount},i=this.domain,s){if(!i||i.length<2||e<1)return[];const n=this.base,[o,a]=i,r=Math.min(o,a),l=Math.max(o,a);let c=this.log(r),h=this.log(l);if(t){const f=x=>x>=r&&x<=l,m=Math.min(Math.abs(t),Math.abs(h-c)),y=range(c,h,m).map(this.pow).filter(f);if(!isDenseInterval(y.length,this.getPixelRange()))return y}if(!isInteger(n)||h-c>=e)return createTicks(c,h,Math.min(h-c,e)).map(this.pow);let d=[];const u=r>0;c=Math.floor(c)-1,h=Math.round(h)+1;const p=findRangeExtent(this.range)/e;let g=1/0;for(let f=c;f<=h;f++){const m=this.convert(this.pow(f+1));for(let y=1;y<n;y++){const x=u?y:n-y+1,b=this.pow(f)*x,S=this.convert(b),v=Math.abs(g-S),I=Math.abs(S-m),A=v>=p&&I>=p;b>=r&&b<=l&&(y===1||A||d.length===0)&&(d.push(b),g=S)}}return d=filterVisibleTicks(d,u,s),d}tickFormatter({specifier:t}){return t!=null?createNumberFormatter(t):String}datumFormatter(t){return this.tickFormatter(t)}},LinearScale=class ie extends ContinuousScale{constructor(){super([0,1],[0,1]),this.type="number"}static getTickStep(e,i,s){const{interval:n,tickCount:o=ContinuousScale.defaultTickCount,minTickCount:a,maxTickCount:r}=s;return n??tickStep(e,i,o,a,r)}toDomain(e){return e}ticks({interval:e,tickCount:i=ContinuousScale.defaultTickCount,minTickCount:s,maxTickCount:n},o=this.domain,a){if(!o||o.length<2||i<1||!o.every(isFinite))return[];const[r,l]=o;if(e){const c=Math.abs(e);if(!isDenseInterval((l-r)/c,this.getPixelRange()))return range(r,l,c)}return createTicks(r,l,i,s,n,a)}niceDomain(e,i=this.domain){if(i.length<2)return[];const{tickCount:s=ContinuousScale.defaultTickCount}=e;let[n,o]=i;if(s===1)[n,o]=niceTicksDomain(n,o);else if(s>1){const a=n>o?Math.ceil:Math.floor,r=n>o?Math.floor:Math.ceil,l=4;for(let c=0;c<l;c++){const h=n,d=o,u=ie.getTickStep(n,o,e),[p,g]=i;if(n=a(p/u)*u,o=r(g/u)*u,n===h&&o===d)break}}return[n,o]}tickFormatter({ticks:e,fractionDigits:i,specifier:s}){return s!=null?tickFormat(e,s):n=>formatValue(n,i)}datumFormatter({ticks:e,fractionDigits:i,specifier:s}){return s!=null?tickFormat(e,s):n=>formatValue(n,i+1)}},NumberAxis=class extends CartesianAxis{constructor(t,e=new LinearScale){super(t,e)}normaliseDataDomain(t){const{min:e,max:i}=this,{extent:s,clipped:n}=normalisedExtentWithMetadata(t,e,i);return{domain:s,clipped:n}}};NumberAxis.className="NumberAxis",NumberAxis.type="number",__decorateClass2([TempValidate(AND(NUMBER_OR_NAN,LESS_THAN("max")),{optional:!0})],NumberAxis.prototype,"min",2),__decorateClass2([TempValidate(AND(NUMBER_OR_NAN,GREATER_THAN("min")),{optional:!0})],NumberAxis.prototype,"max",2);var LogAxis=class extends NumberAxis{normaliseDataDomain(t){const{min:e,max:i}=this,{extent:s,clipped:n}=normalisedExtentWithMetadata(t,e,i);return s[0]<0&&s[1]>0||t[0]<0&&t[1]>0?(logger_exports.warn("The log axis domain crosses zero, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:n}):s[0]===0||s[1]===0||t[0]===0||t[1]===0?(logger_exports.warn("The log axis domain contains a value of 0, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:n}):{domain:s,clipped:n}}set base(t){this.scale.base=t}get base(){return this.scale.base}constructor(t){super(t,new LogScale)}defaultDatumFormatter(t,e){return String(t)}defaultLabelFormatter(t,e){return String(t)}};LogAxis.className="LogAxis",LogAxis.type="log";var TimeAxis=class extends CartesianAxis{constructor(t){super(t,new TimeScale),this.min=void 0,this.max=void 0}normaliseDataDomain(t){let{min:e,max:i}=this,s=!1;return typeof e=="number"&&(e=new Date(e)),typeof i=="number"&&(i=new Date(i)),t.length>2&&(t=extent(t)?.map(n=>new Date(n))??[]),e instanceof Date&&(s||(s=e>t[0]),t=[e,t[1]]),i instanceof Date&&(s||(s=i<t[1]),t=[t[0],i]),t[0]>t[1]&&(t=[]),{domain:t,clipped:s}}};TimeAxis.className="TimeAxis",TimeAxis.type="time",__decorateClass2([TempValidate(AND(DATE_OR_DATETIME_MS,LESS_THAN("max")),{optional:!0})],TimeAxis.prototype,"min",2),__decorateClass2([TempValidate(AND(DATE_OR_DATETIME_MS,GREATER_THAN("min")),{optional:!0})],TimeAxis.prototype,"max",2);var drawCorner=(t,{x0:e,y0:i,x1:s,y1:n,cx:o,cy:a},r,l)=>{if(l&&t.moveTo(e,i),e!==s||i!==n){const c=Math.atan2(i-a,e-o),h=Math.atan2(n-a,s-o);t.arc(o,a,r,c,h)}else t.lineTo(e,i)},epsilon=1e-6,cornerEdges=(t,e,i,s,n)=>{let o=!1,a=!1,r=s-Math.sqrt(Math.max(n**2-i**2,0)),l=0,c=0,h=i-Math.sqrt(Math.max(n**2-s**2,0));return r>t?(o=!0,r=t,l=i-Math.sqrt(Math.max(n**2-(s-t)**2))):r<epsilon&&(r=0),h>e?(a=!0,c=s-Math.sqrt(Math.max(n**2-(i-e)**2)),h=e):h<epsilon&&(h=0),{leading0:r,leading1:l,trailing0:c,trailing1:h,leadingClipped:o,trailingClipped:a}},clippedRoundRect=(t,e,i,s,n,o,a)=>{let{topLeft:r,topRight:l,bottomRight:c,bottomLeft:h}=o;const d=Math.max(r+h,l+c),u=Math.max(r+l,h+c);if(d<=0&&u<=0){a==null?t.rect(e,i,s,n):t.rect(a.x,a.y,a.width,a.height);return}else if(a==null&&r===l&&r===c&&r===h){t.roundRect(e,i,s,n,r);return}if(s<0&&(e+=s,s=Math.abs(s)),n<0&&(i+=n,n=Math.abs(n)),s<=0||n<=0)return;if(a==null)a=new BBox(e,i,s,n);else{const A=Math.max(e,a.x),D=Math.min(e+s,a.x+a.width),T=Math.max(i,a.y),k=Math.min(i+n,a.y+a.height);a=new BBox(A,T,D-A,k-T)}const p=Math.max(d/n,u/s,1);p>1&&(r/=p,l/=p,c/=p,h/=p);let g=!0,f=!0,m=!0,y=!0,x,b,S,v;if(g){const A=cornerEdges(a.height,a.width,Math.max(e+r-a.x,0),Math.max(i+r-a.y,0),r);A.leadingClipped&&(y=!1),A.trailingClipped&&(f=!1);const D=Math.max(a.x+A.leading1,a.x),T=Math.max(a.y+A.leading0,a.y),k=Math.max(a.x+A.trailing1,a.x),w=Math.max(a.y+A.trailing0,a.y),L=e+r,O=i+r;x={x0:D,y0:T,x1:k,y1:w,cx:L,cy:O}}if(f){const A=cornerEdges(a.width,a.height,Math.max(i+l-a.y,0),Math.max(a.x+a.width-(e+s-l),0),l);A.leadingClipped&&(g=!1),A.trailingClipped&&(m=!1);const D=Math.min(a.x+a.width-A.leading0,a.x+a.width),T=Math.max(a.y+A.leading1,a.y),k=Math.min(a.x+a.width-A.trailing0,a.x+a.width),w=Math.max(a.y+A.trailing1,a.y),L=e+s-l,O=i+l;b={x0:D,y0:T,x1:k,y1:w,cx:L,cy:O}}if(m){const A=cornerEdges(a.height,a.width,Math.max(a.x+a.width-(e+s-c),0),Math.max(a.y+a.height-(i+n-c),0),c);A.leadingClipped&&(f=!1),A.trailingClipped&&(y=!1);const D=Math.min(a.x+a.width-A.leading1,a.x+a.width),T=Math.min(a.y+a.height-A.leading0,a.y+a.height),k=Math.min(a.x+a.width-A.trailing1,a.x+a.width),w=Math.min(a.y+a.height-A.trailing0,a.y+a.height),L=e+s-c,O=i+n-c;S={x0:D,y0:T,x1:k,y1:w,cx:L,cy:O}}if(y){const A=cornerEdges(a.width,a.height,Math.max(a.y+a.height-(i+n-h),0),Math.max(e+h-a.x,0),h);A.leadingClipped&&(m=!1),A.trailingClipped&&(g=!1);const D=Math.max(a.x+A.leading0,a.x),T=Math.min(a.y+a.height-A.leading1,a.y+a.height),k=Math.max(a.x+A.trailing0,a.x),w=Math.min(a.y+a.height-A.trailing1,a.y+a.height),L=e+h,O=i+n-h;v={x0:D,y0:T,x1:k,y1:w,cx:L,cy:O}}let I=!1;g&&x!=null&&(drawCorner(t,x,r,!I),I||(I=!0)),f&&b!=null&&(drawCorner(t,b,l,!I),I||(I=!0)),m&&S!=null&&(drawCorner(t,S,c,!I),I||(I=!0)),y&&v!=null&&drawCorner(t,v,h,!I),t.closePath()},Rect=class extends Path{constructor(){super(...arguments),this.borderPath=new ExtendedPath2D,this.x=0,this.y=0,this.width=10,this.height=10,this.topLeftCornerRadius=0,this.topRightCornerRadius=0,this.bottomRightCornerRadius=0,this.bottomLeftCornerRadius=0,this.clipBBox=void 0,this.crisp=!1,this.lastUpdatePathStrokeWidth=Shape.defaultStyles.strokeWidth,this.effectiveStrokeWidth=Shape.defaultStyles.strokeWidth,this.hittester=super.isPointInPath.bind(this),this.distanceCalculator=super.distanceSquaredTransformedPoint.bind(this),this.microPixelEffectOpacity=1}set cornerRadius(t){this.topLeftCornerRadius=t,this.topRightCornerRadius=t,this.bottomRightCornerRadius=t,this.bottomLeftCornerRadius=t}isDirtyPath(){return this.lastUpdatePathStrokeWidth!==this.strokeWidth||!!(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){const{path:t,borderPath:e,crisp:i,topLeftCornerRadius:s,topRightCornerRadius:n,bottomRightCornerRadius:o,bottomLeftCornerRadius:a}=this;let{x:r,y:l,width:c,height:h,strokeWidth:d,clipBBox:u}=this;const g=1/(this.layerManager?.canvas.pixelRatio??1);let f=1;if(t.clear(!0),e.clear(!0),i&&(c<=g&&(f*=c/g),h<=g&&(f*=h/g),c=this.align(r,c),h=this.align(l,h),r=this.align(r),l=this.align(l),u=u!=null?new BBox(this.align(u.x),this.align(u.y),this.align(u.x,u.width),this.align(u.y,u.height)):void 0),d)if(c<g){const m=r+g/2;e.moveTo(m,l),e.lineTo(m,l+h),d=g,this.borderClipPath=void 0}else if(h<g){const m=l+g/2;e.moveTo(r,m),e.lineTo(r+c,m),d=g,this.borderClipPath=void 0}else if(d<c&&d<h){const m=d/2;r+=m,l+=m,c-=d,h-=d;const y=u?.clone().shrink(m),x={topLeft:s>0?s-d:0,topRight:n>0?n-d:0,bottomRight:o>0?o-d:0,bottomLeft:a>0?a-d:0};this.borderClipPath=void 0,c>0&&h>0&&(y==null||y?.width>0&&y?.height>0)&&(clippedRoundRect(t,r,l,c,h,x,y),clippedRoundRect(e,r,l,c,h,x,y))}else this.borderClipPath=this.borderClipPath??new ExtendedPath2D,this.borderClipPath.clear(!0),this.borderClipPath.rect(r,l,c,h),e.rect(r,l,c,h);else{const m={topLeft:s,topRight:n,bottomRight:o,bottomLeft:a};this.borderClipPath=void 0,clippedRoundRect(t,r,l,c,h,m,u)}if([s,n,o,a].every(m=>m===0)){const m=this.getBBox();this.hittester=m.containsPoint.bind(m),this.distanceSquared=(y,x)=>this.getBBox().distanceSquared(y,x)}else this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquaredTransformedPoint;this.effectiveStrokeWidth=d,this.lastUpdatePathStrokeWidth=d,this.microPixelEffectOpacity=f}computeBBox(){const{x:t,y:e,width:i,height:s,clipBBox:n}=this;return n?.clone()??new BBox(t,e,i,s)}isPointInPath(t,e){return this.hittester(t,e)}get midPoint(){return{x:this.x+this.width/2,y:this.y+this.height/2}}distanceSquared(t,e){return this.distanceCalculator(t,e)}applyFillAlpha(t){const{fillOpacity:e,microPixelEffectOpacity:i,opacity:s}=this;t.globalAlpha*=s*e*i}renderStroke(t){const{stroke:e,effectiveStrokeWidth:i}=this;if(e&&i){const{globalAlpha:s}=t,{strokeOpacity:n,lineDash:o,lineDashOffset:a,lineCap:r,lineJoin:l,borderPath:c,borderClipPath:h,opacity:d,microPixelEffectOpacity:u}=this;h&&t.clip(h.getPath2D()),this.applyStroke(t),t.globalAlpha*=d*n*u,t.lineWidth=i,o&&t.setLineDash(o),a&&(t.lineDashOffset=a),r&&(t.lineCap=r),l&&(t.lineJoin=l),t.stroke(c.getPath2D()),t.globalAlpha=s}}};Rect.className="Rect",__decorateClass2([ScenePathChangeDetection()],Rect.prototype,"x",2),__decorateClass2([ScenePathChangeDetection()],Rect.prototype,"y",2),__decorateClass2([ScenePathChangeDetection()],Rect.prototype,"width",2),__decorateClass2([ScenePathChangeDetection()],Rect.prototype,"height",2),__decorateClass2([ScenePathChangeDetection()],Rect.prototype,"topLeftCornerRadius",2),__decorateClass2([ScenePathChangeDetection()],Rect.prototype,"topRightCornerRadius",2),__decorateClass2([ScenePathChangeDetection()],Rect.prototype,"bottomRightCornerRadius",2),__decorateClass2([ScenePathChangeDetection()],Rect.prototype,"bottomLeftCornerRadius",2),__decorateClass2([ScenePathChangeDetection()],Rect.prototype,"clipBBox",2),__decorateClass2([ScenePathChangeDetection()],Rect.prototype,"crisp",2);var Background=class extends BaseModuleInstance{constructor(t){super(),this.ctx=t,this.rectNode=new Rect,this.textNode=new Text,this.fill="white",this.node=this.createNode(),this.node.append([this.rectNode,this.textNode]),this.visible=!0,this.destroyFns.push(t.scene.attachNode(this.node),t.layoutManager.addListener("layout:complete",e=>this.onLayoutComplete(e)))}createNode(){return new Group({name:"background",zIndex:0})}onLayoutComplete(t){const{width:e,height:i}=t.chart;this.rectNode.width=e,this.rectNode.height=i}};__decorateClass2([TempValidate(BOOLEAN),ProxyPropertyOnWrite("node","visible")],Background.prototype,"visible",2),__decorateClass2([TempValidate(COLOR_STRING,{optional:!0}),ProxyPropertyOnWrite("rectNode","fill")],Background.prototype,"fill",2),__decorateClass2([TempValidate(OBJECT,{optional:!0})],Background.prototype,"image",2),__decorateClass2([TempValidate(STRING,{optional:!0}),ProxyPropertyOnWrite("textNode")],Background.prototype,"text",2);var BackgroundModule={type:"root",optionsKey:"background",packageType:"community",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new Background(t)};function gridLayout({orientation:t,bboxes:e,maxHeight:i,maxWidth:s,itemPaddingY:n=0,itemPaddingX:o=0,forceResult:a=!1}){const r=t==="horizontal",l={max:r?s:i,fn:r?u=>u.width:u=>u.height,padding:r?o:n},c={max:r?i:s,fn:r?u=>u.height:u=>u.width,padding:r?n:o};let h=0;const d=[];for(;h<e.length;){const u=e.slice(h),p=processBBoxes(u,h,l,c,a);if(!p)return;h+=p.processedBBoxCount,d.push(p.pageIndices)}return buildPages(d,t,e,n,o)}function processBBoxes(t,e,i,s,n){let a=estimateStartingGuess(t,i);if(a<1){if(!n)return;a=1}let r=a;for(;r>=1;){const l=calculatePage(t,e,r,i,s,n);if(l==null&&r<=1)return;if(l==null){r--;continue}if(typeof l=="number"){if(l<=1)return;r=l<r&&l>1?l:r,r--;continue}return{processedBBoxCount:l.length*l[0].length,pageIndices:l}}}function calculatePage(t,e,i,s,n,o){const a=[];let r=0,l=0,c=[];const h=[];for(let d=0;d<t.length;d++){const u=(d+i)%i;u===0&&(r+=l,l=0,c.length>0&&a.push(c),c=[]);const p=s.fn(t[d])+s.padding;h[u]=Math.max(h[u]??0,p),l=Math.max(l,n.fn(t[d])+n.padding);const g=r+l,f=!o||a.length>0;if(g>n.max&&f){c=[];break}if(h.reduce((y,x)=>y+x,0)>s.max&&!o)return h.length<i?h.length:void 0;c.push(d+e)}return c.length>0&&a.push(c),a.length>0?a:void 0}function buildPages(t,e,i,s,n){let o=0,a=0;return{pages:t.map(l=>{e==="horizontal"&&(l=transpose(l));let c=0;const h=l.map(p=>{const g=p.map(y=>(c=Math.max(y,c),i[y]));let f=0,m=0;return g.forEach(y=>{f+=y.height+s,m=Math.max(m,y.width+n)}),{indices:p,bboxes:g,columnHeight:Math.ceil(f),columnWidth:Math.ceil(m)}});let d=0,u=0;return h.forEach(p=>{d+=p.columnWidth,u=Math.max(u,p.columnHeight)}),o=Math.max(d,o),a=Math.max(u,a),{columns:h,startIndex:l[0][0],endIndex:c,pageWidth:d,pageHeight:u}}),maxPageWidth:o,maxPageHeight:a}}function transpose(t){const e=[];for(const i of t[0])e.push([]);return t.forEach((i,s)=>{i.forEach((n,o)=>{e[o][s]=n})}),e}function estimateStartingGuess(t,e){const i=t.length;let s=0;for(let n=0;n<i;n++)if(s+=e.fn(t[n])+e.padding,s>e.max)return i/n<2?Math.ceil(i/2):n;return i}var PaginationLabel=class extends BaseProperties{constructor(){super(...arguments),this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};__decorateClass2([TempValidate(COLOR_STRING)],PaginationLabel.prototype,"color",2),__decorateClass2([TempValidate(FONT_STYLE,{optional:!0})],PaginationLabel.prototype,"fontStyle",2),__decorateClass2([TempValidate(FONT_WEIGHT,{optional:!0})],PaginationLabel.prototype,"fontWeight",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],PaginationLabel.prototype,"fontSize",2),__decorateClass2([TempValidate(STRING)],PaginationLabel.prototype,"fontFamily",2);var PaginationMarkerStyle=class extends BaseProperties{constructor(){super(...arguments),this.size=15,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=1,this.strokeOpacity=1}};__decorateClass2([TempValidate(POSITIVE_NUMBER)],PaginationMarkerStyle.prototype,"size",2),__decorateClass2([TempValidate(COLOR_STRING,{optional:!0})],PaginationMarkerStyle.prototype,"fill",2),__decorateClass2([TempValidate(RATIO,{optional:!0})],PaginationMarkerStyle.prototype,"fillOpacity",2),__decorateClass2([TempValidate(COLOR_STRING,{optional:!0})],PaginationMarkerStyle.prototype,"stroke",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],PaginationMarkerStyle.prototype,"strokeWidth",2),__decorateClass2([TempValidate(RATIO)],PaginationMarkerStyle.prototype,"strokeOpacity",2);var PaginationMarker=class extends BaseProperties{constructor(t){super(),this.parent=t,this.shape="triangle",this.size=15,this.padding=8}};__decorateClass2([ActionOnSet({changeValue(){this.parent.marker===this&&this.parent.onMarkerShapeChange()}})],PaginationMarker.prototype,"shape",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],PaginationMarker.prototype,"size",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],PaginationMarker.prototype,"padding",2);var Pagination=class extends BaseProperties{constructor(t,e){super(),this.chartUpdateCallback=t,this.pageUpdateCallback=e,this.id=createId(this),this.marker=new PaginationMarker(this),this.activeStyle=new PaginationMarkerStyle,this.inactiveStyle=new PaginationMarkerStyle,this.highlightStyle=new PaginationMarkerStyle,this.label=new PaginationLabel,this.group=new TranslatableGroup({name:"pagination"}),this.labelNode=new Text,this.totalPages=0,this.currentPage=0,this.translationX=0,this.translationY=0,this.nextButtonDisabled=!1,this.previousButtonDisabled=!1,this._visible=!0,this._enabled=!0,this._orientation="vertical",this.nextButton=new Marker,this.previousButton=new Marker,this.labelNode.setProperties({textBaseline:"middle",fontSize:12,fontFamily:"Verdana, sans-serif",fill:"black",y:1}),this.group.append([this.nextButton,this.previousButton,this.labelNode]),this.update(),this.updateMarkers()}set visible(t){this._visible=t,this.updateGroupVisibility()}get visible(){return this._visible}set enabled(t){this._enabled=t,this.updateGroupVisibility()}get enabled(){return this._enabled}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible}set orientation(t){switch(this._orientation=t,t){case"horizontal":{this.previousButton.rotation=-Math.PI/2,this.nextButton.rotation=Math.PI/2;break}case"vertical":default:this.previousButton.rotation=0,this.nextButton.rotation=Math.PI}}get orientation(){return this._orientation}update(){this.updateLabel(),this.updatePositions(),this.enableOrDisableButtons()}updatePositions(){this.group.translationX=this.translationX,this.group.translationY=this.translationY,this.updateLabelPosition(),this.updateNextButtonPosition()}updateLabelPosition(){const{size:t,padding:e}=this.marker;this.nextButton.size=t,this.previousButton.size=t,this.labelNode.x=t/2+e}updateNextButtonPosition(){const t=this.labelNode.getBBox();this.nextButton.translationX=t.width+(this.marker.size/2+this.marker.padding)*2}updateLabel(){const{currentPage:t,totalPages:e,labelNode:i,label:{color:s,fontStyle:n,fontWeight:o,fontSize:a,fontFamily:r}}=this;i.text=`${t+1} / ${e}`,i.fill=s,i.fontStyle=n,i.fontWeight=o,i.fontSize=a,i.fontFamily=r}updateMarkers(){const{nextButton:t,previousButton:e,nextButtonDisabled:i,previousButtonDisabled:s,activeStyle:n,inactiveStyle:o,highlightStyle:a,highlightActive:r}=this,l=(c,h)=>h?o:c===r?a:n;this.updateMarker(t,l("next",i)),this.updateMarker(e,l("previous",s))}updateMarker(t,e){const{shape:i,size:s}=this.marker;t.shape=i,t.size=s,t.fill=e.fill,t.fillOpacity=e.fillOpacity??1,t.stroke=e.stroke,t.strokeWidth=e.strokeWidth,t.strokeOpacity=e.strokeOpacity}enableOrDisableButtons(){const{currentPage:t,totalPages:e}=this,i=e===0,s=t===e-1,n=t===0;this.nextButtonDisabled=s||i,this.previousButtonDisabled=n||i}setPage(t){t=clamp(0,t,Math.max(0,this.totalPages-1)),this.currentPage!==t&&(this.currentPage=t,this.onPaginationChanged())}getCursor(t){return{previous:this.previousButtonDisabled,next:this.nextButtonDisabled}[t]?void 0:"pointer"}onClick(t,e){t.preventDefault(),e==="next"&&!this.nextButtonDisabled?(this.incrementPage(),this.onPaginationChanged()):e==="previous"&&!this.previousButtonDisabled&&(this.decrementPage(),this.onPaginationChanged())}onMouseHover(t){this.highlightActive=t,this.updateMarkers(),this.chartUpdateCallback(6)}onPaginationChanged(){this.pageUpdateCallback(this.currentPage)}incrementPage(){this.currentPage=Math.min(this.currentPage+1,this.totalPages-1)}decrementPage(){this.currentPage=Math.max(this.currentPage-1,0)}onMarkerShapeChange(){this.updatePositions(),this.updateMarkers(),this.chartUpdateCallback(6)}attachPagination(t){t.append(this.group)}getBBox(){return this.group.getBBox()}computeCSSBounds(){const t=Transformable.toCanvas(this.previousButton),e=Transformable.toCanvas(this.nextButton);return{prev:t,next:e}}};Pagination.className="Pagination",__decorateClass2([TempValidate(OBJECT)],Pagination.prototype,"marker",2),__decorateClass2([TempValidate(OBJECT)],Pagination.prototype,"activeStyle",2),__decorateClass2([TempValidate(OBJECT)],Pagination.prototype,"inactiveStyle",2),__decorateClass2([TempValidate(OBJECT)],Pagination.prototype,"highlightStyle",2),__decorateClass2([TempValidate(OBJECT)],Pagination.prototype,"label",2);var ChangeDetectableProperties=class extends BaseProperties{constructor(){super(...arguments),this._dirty=!0}markDirty(){this._dirty=!0}markClean(t){this._dirty=!1}isDirty(){return this._dirty}},MARKER_SUPPORTED_SHAPES=new Set(["circle","cross","diamond","heart","pin","plus","square","star","triangle"]);function isSupportedMarkerShape(t){return typeof t=="string"&&MARKER_SUPPORTED_SHAPES.has(t)}var SeriesItemHighlightStyle=class extends BaseProperties{constructor(){super(...arguments),this.fill="rgba(255,255,255, 0.33)",this.stroke="rgba(0, 0, 0, 0.4)",this.strokeWidth=2}};__decorateClass2([TempValidate(COLOR_STRING,{optional:!0})],SeriesItemHighlightStyle.prototype,"fill",2),__decorateClass2([TempValidate(RATIO,{optional:!0})],SeriesItemHighlightStyle.prototype,"fillOpacity",2),__decorateClass2([TempValidate(COLOR_STRING,{optional:!0})],SeriesItemHighlightStyle.prototype,"stroke",2),__decorateClass2([TempValidate(POSITIVE_NUMBER,{optional:!0})],SeriesItemHighlightStyle.prototype,"strokeWidth",2),__decorateClass2([TempValidate(RATIO,{optional:!0})],SeriesItemHighlightStyle.prototype,"strokeOpacity",2),__decorateClass2([TempValidate(LINE_DASH,{optional:!0})],SeriesItemHighlightStyle.prototype,"lineDash",2),__decorateClass2([TempValidate(POSITIVE_NUMBER,{optional:!0})],SeriesItemHighlightStyle.prototype,"lineDashOffset",2);var SeriesHighlightStyle=class extends BaseProperties{};__decorateClass2([TempValidate(POSITIVE_NUMBER,{optional:!0})],SeriesHighlightStyle.prototype,"strokeWidth",2),__decorateClass2([TempValidate(RATIO,{optional:!0})],SeriesHighlightStyle.prototype,"dimOpacity",2),__decorateClass2([TempValidate(BOOLEAN,{optional:!0})],SeriesHighlightStyle.prototype,"enabled",2);var TextHighlightStyle=class extends BaseProperties{constructor(){super(...arguments),this.color="black"}};__decorateClass2([TempValidate(COLOR_STRING,{optional:!0})],TextHighlightStyle.prototype,"color",2);var HighlightProperties=class extends BaseProperties{constructor(){super(...arguments),this.enabled=!0}};__decorateClass2([TempValidate(BOOLEAN,{optional:!0})],HighlightProperties.prototype,"enabled",2);var FillGradientDefaults=class extends BaseProperties{constructor(){super(...arguments),this.type="gradient",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.reverse=!1}};__decorateClass2([TempValidate(STRING)],FillGradientDefaults.prototype,"type",2),__decorateClass2([TempValidate(ARRAY)],FillGradientDefaults.prototype,"colorStops",2),__decorateClass2([TempValidate(STRING)],FillGradientDefaults.prototype,"bounds",2),__decorateClass2([TempValidate(STRING)],FillGradientDefaults.prototype,"gradient",2),__decorateClass2([TempValidate(NUMBER)],FillGradientDefaults.prototype,"rotation",2),__decorateClass2([TempValidate(BOOLEAN)],FillGradientDefaults.prototype,"reverse",2);var FillPatternDefaults=class extends BaseProperties{constructor(){super(...arguments),this.type="pattern",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.reverse=!1,this.pattern="forward-slanted-lines",this.width=26,this.height=26,this.padding=6,this.fill="black",this.fillOpacity=1,this.backgroundFill="white",this.backgroundFillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0}};__decorateClass2([TempValidate(STRING)],FillPatternDefaults.prototype,"type",2),__decorateClass2([TempValidate(ARRAY)],FillPatternDefaults.prototype,"colorStops",2),__decorateClass2([TempValidate(STRING)],FillPatternDefaults.prototype,"bounds",2),__decorateClass2([TempValidate(STRING)],FillPatternDefaults.prototype,"gradient",2),__decorateClass2([TempValidate(NUMBER)],FillPatternDefaults.prototype,"rotation",2),__decorateClass2([TempValidate(BOOLEAN)],FillPatternDefaults.prototype,"reverse",2),__decorateClass2([TempValidate(STRING)],FillPatternDefaults.prototype,"pattern",2),__decorateClass2([TempValidate(NUMBER)],FillPatternDefaults.prototype,"width",2),__decorateClass2([TempValidate(NUMBER)],FillPatternDefaults.prototype,"height",2),__decorateClass2([TempValidate(NUMBER)],FillPatternDefaults.prototype,"padding",2),__decorateClass2([TempValidate(STRING)],FillPatternDefaults.prototype,"fill",2),__decorateClass2([TempValidate(NUMBER)],FillPatternDefaults.prototype,"fillOpacity",2),__decorateClass2([TempValidate(STRING)],FillPatternDefaults.prototype,"backgroundFill",2),__decorateClass2([TempValidate(NUMBER)],FillPatternDefaults.prototype,"backgroundFillOpacity",2),__decorateClass2([TempValidate(STRING)],FillPatternDefaults.prototype,"stroke",2),__decorateClass2([TempValidate(NUMBER)],FillPatternDefaults.prototype,"strokeOpacity",2),__decorateClass2([TempValidate(NUMBER)],FillPatternDefaults.prototype,"strokeWidth",2);var HighlightStyle=class extends BaseProperties{constructor(){super(...arguments),this.item=new SeriesItemHighlightStyle,this.series=new SeriesHighlightStyle,this.text=new TextHighlightStyle}};__decorateClass2([TempValidate(OBJECT)],HighlightStyle.prototype,"item",2),__decorateClass2([TempValidate(OBJECT)],HighlightStyle.prototype,"series",2),__decorateClass2([TempValidate(OBJECT)],HighlightStyle.prototype,"text",2);var SeriesProperties=class extends BaseProperties{constructor(){super(...arguments),this.visible=!0,this.focusPriority=1/0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlight=new HighlightProperties,this.highlightStyle=new HighlightStyle}handleUnknownProperties(t,e){"context"in e&&(this.context=e.context,t.delete("context"))}};__decorateClass2([TempValidate(STRING,{optional:!0})],SeriesProperties.prototype,"id",2),__decorateClass2([TempValidate(BOOLEAN)],SeriesProperties.prototype,"visible",2),__decorateClass2([TempValidate(REAL_NUMBER,{optional:!0})],SeriesProperties.prototype,"focusPriority",2),__decorateClass2([TempValidate(BOOLEAN)],SeriesProperties.prototype,"showInLegend",2),__decorateClass2([TempValidate(STRING)],SeriesProperties.prototype,"cursor",2),__decorateClass2([TempValidate(INTERACTION_RANGE)],SeriesProperties.prototype,"nodeClickRange",2),__decorateClass2([TempValidate(OBJECT)],SeriesProperties.prototype,"highlight",2),__decorateClass2([TempValidate(OBJECT)],SeriesProperties.prototype,"highlightStyle",2);var MARKER_SHAPE=predicateWithMessage(t=>isSupportedMarkerShape(t)||typeof t=="function","a marker shape keyword such as 'circle', 'diamond' or 'square' or an object extending the Marker class"),SeriesMarker=class extends ChangeDetectableProperties{constructor(){super(...arguments),this.enabled=!0,this.shape="circle",this.size=6,this.fillGradientDefaults=new FillGradientDefaults,this.fillPatternDefaults=new FillPatternDefaults,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(){const{size:t,shape:e,fill:i,fillOpacity:s,stroke:n,strokeWidth:o,strokeOpacity:a,lineDash:r,lineDashOffset:l}=this;return{size:t,shape:e,fill:i,fillOpacity:s,stroke:n,strokeWidth:o,strokeOpacity:a,lineDash:r,lineDashOffset:l}}getDiameter(){return this.size+this.strokeWidth}};__decorateClass2([TempValidate(BOOLEAN),SceneChangeDetection()],SeriesMarker.prototype,"enabled",2),__decorateClass2([TempValidate(MARKER_SHAPE),SceneChangeDetection()],SeriesMarker.prototype,"shape",2),__decorateClass2([TempValidate(POSITIVE_NUMBER),SceneChangeDetection()],SeriesMarker.prototype,"size",2),__decorateClass2([TempValidate(OR(COLOR_STRING,COLOR_PATTERN,COLOR_GRADIENT),{optional:!0}),SceneChangeDetection()],SeriesMarker.prototype,"fill",2),__decorateClass2([TempValidate(OBJECT)],SeriesMarker.prototype,"fillGradientDefaults",2),__decorateClass2([TempValidate(OBJECT)],SeriesMarker.prototype,"fillPatternDefaults",2),__decorateClass2([TempValidate(RATIO),SceneChangeDetection()],SeriesMarker.prototype,"fillOpacity",2),__decorateClass2([TempValidate(COLOR_STRING,{optional:!0}),SceneChangeDetection()],SeriesMarker.prototype,"stroke",2),__decorateClass2([TempValidate(POSITIVE_NUMBER),SceneChangeDetection()],SeriesMarker.prototype,"strokeWidth",2),__decorateClass2([TempValidate(RATIO),SceneChangeDetection()],SeriesMarker.prototype,"strokeOpacity",2),__decorateClass2([TempValidate(LINE_DASH)],SeriesMarker.prototype,"lineDash",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],SeriesMarker.prototype,"lineDashOffset",2),__decorateClass2([TempValidate(FUNCTION,{optional:!0}),SceneChangeDetection()],SeriesMarker.prototype,"itemStyler",2);var LegendDOMProxy=class{constructor(t,e){this.idPrefix=e,this.dirty=!0,this.destroyFns=new DestroyFns,this.itemList=t.proxyInteractionService.createProxyContainer({type:"list",domManagerId:`${e}-toolbar`,classList:["ag-charts-proxy-legend-toolbar"],ariaLabel:{id:"ariaLabelLegend"}}),this.paginationGroup=t.proxyInteractionService.createProxyContainer({type:"group",domManagerId:`${e}-pagination`,classList:["ag-charts-proxy-legend-pagination"],ariaLabel:{id:"ariaLabelLegendPagination"},ariaOrientation:"horizontal"}),this.itemDescription=createElement("p"),this.itemDescription.style.display="none",this.itemDescription.id=`${e}-ariaDescription`,this.itemDescription.textContent=this.getItemAriaDescription(t.localeManager),this.itemList.getElement().append(this.itemDescription)}destroy(){this.destroyFns.destroy()}initLegendList(t){if(!this.dirty)return;const{ctx:e,itemSelection:i,datumReader:s,itemListener:n}=t,o=e.localeManager,a=i.length;i.each((r,l,c)=>{r.proxyButton?.destroy(),r.proxyButton=e.proxyInteractionService.createProxyElement({type:"listswitch",textContent:this.getItemAriaText(o,s.getItemLabel(l),c,a),ariaChecked:!!r.datum.enabled,ariaDescribedBy:this.itemDescription.id,parent:this.itemList});const h=r.proxyButton;h.addListener("click",d=>n.onClick(d.sourceEvent,r.datum,h)),h.addListener("dblclick",d=>n.onDoubleClick(d.sourceEvent,r.datum)),h.addListener("mouseenter",d=>n.onHover(d.sourceEvent,r)),h.addListener("mouseleave",()=>n.onLeave()),h.addListener("contextmenu",d=>n.onContextClick(d.sourceEvent,r)),h.addListener("blur",()=>n.onLeave()),h.addListener("focus",d=>n.onHover(d.sourceEvent,r)),h.addListener("drag-start",()=>{})}),this.dirty=!1}update(t){t.visible&&(this.initLegendList(t),this.updateItemProxyButtons(t),this.updatePaginationProxyButtons(t,!0)),this.updateVisibility(t.visible)}updateVisibility(t){this.itemList.setHidden(!t),this.paginationGroup.setHidden(!t)}updateItemProxyButtons({itemSelection:t,group:e,pagination:i,interactive:s}){const n=Transformable.toCanvas(e);this.itemList.setBounds(n);const o=Math.max(...t.nodes().map(a=>a.getBBox().height));t.each((a,r)=>{if(a.proxyButton){const l=a.pageIndex===i.currentPage,{x:c,y:h,height:d,width:u}=Transformable.toCanvas(a),p=(o-d)/2,g={x:c-n.x,y:h-p-n.y,height:o,width:u};a.proxyButton.setCursor("pointer"),a.proxyButton.setEnabled(s&&l),a.proxyButton.setBounds(g)}})}updatePaginationProxyButtons(t,e){const{pagination:i}=t;if(this.paginationGroup.setHidden(!i.visible),e&&"ctx"in t){const{ctx:o,oldPages:a,newPages:r}=t,l=(a?.length??r.length)>1,c=r.length>1;l!==c&&(c?(this.prevButton=o.proxyInteractionService.createProxyElement({type:"button",id:`${this.idPrefix}-prev-page`,textContent:{id:"ariaLabelLegendPagePrevious"},tabIndex:0,parent:this.paginationGroup}),this.prevButton.addListener("click",h=>this.onPageButton(t,h,"previous")),this.prevButton.addListener("mouseenter",()=>i.onMouseHover("previous")),this.prevButton.addListener("mouseleave",()=>i.onMouseHover(void 0)),this.nextButton??(this.nextButton=o.proxyInteractionService.createProxyElement({type:"button",id:`${this.idPrefix}-next-page`,textContent:{id:"ariaLabelLegendPageNext"},tabIndex:0,parent:this.paginationGroup})),this.nextButton.addListener("click",h=>this.onPageButton(t,h,"next")),this.nextButton.addListener("mouseenter",()=>i.onMouseHover("next")),this.nextButton.addListener("mouseleave",()=>i.onMouseHover(void 0))):(this.nextButton?.destroy(),this.prevButton?.destroy(),this.nextButton=void 0,this.prevButton=void 0))}const{prev:s,next:n}=i.computeCSSBounds();this.prevButton?.setBounds(s),this.nextButton?.setBounds(n),this.prevButton?.setEnabled(i.currentPage!==0),this.nextButton?.setEnabled(i.currentPage!==i.totalPages-1),this.nextButton?.setCursor(i.getCursor("next")),this.prevButton?.setCursor(i.getCursor("previous"))}onPageButton(t,e,i){t.pagination.onClick(e.sourceEvent,i),this.updatePaginationProxyButtons(t,!1)}onDataUpdate(t,e){this.dirty=t.length!==e.length||t.some((i,s,n)=>{const[o,a]=[e[s],t[s]];return o.id!==a.id})}onLocaleChanged(t,e,i){const s=e.length;e.each(({proxyButton:n},o,a)=>{const r=n?.getElement();if(r!=null){const l=i.getItemLabel(o);r.textContent=this.getItemAriaText(t,l,a,s)}}),this.itemDescription.textContent=this.getItemAriaDescription(t)}onPageChange(t){this.updateItemProxyButtons(t),this.updatePaginationProxyButtons(t,!1)}getItemAriaText(t,e,i,s){return i>=0&&e?(i++,t.t("ariaLabelLegendItem",{label:e,index:i,count:s})):t.t("ariaLabelLegendItemUnknown")}getItemAriaDescription(t){return t.t("ariaDescriptionLegendItem")}};function makeLegendItemEvent(t,e,i,s){const n={defaultPrevented:!1,apiEvent:{type:t,itemId:e,seriesId:i,event:s,preventDefault:()=>n.defaultPrevented=!0}};return n}var LegendMarkerLabel=class extends Translatable(Group){constructor(){super({name:"markerLabelGroup"}),this.symbolsGroup=this.appendChild(new Group({name:"legend-markerLabel-symbols"})),this.label=this.appendChild(new Text),this.enabled=!0,this.pageIndex=NaN,this.spacing=0,this.length=0,this.isCustomMarker=!1,this.marker=this.symbolsGroup.appendChild(new Marker({zIndex:1})),this.line=this.symbolsGroup.appendChild(new Line({zIndex:0}));const{label:t,line:e,symbolsGroup:i}=this;e.visible=!1,i.renderToOffscreenCanvas=!0,i.optimizeForInfrequentRedraws=!0,t.textBaseline="middle",t.fontSize=12,t.fontFamily="Verdana, sans-serif",t.fill="black",t.y=1}destroy(){super.destroy(),this.proxyButton?.destroy()}setEnabled(t){this.enabled=t,this.refreshVisibilities()}refreshVisibilities(){const t=this.enabled?1:.5;this.label.opacity=t,this.opacity=t}layout(){const{marker:t,line:e,length:i,isCustomMarker:s}=this;let n=0,o=0;if(t.visible){const{size:a}=t,r=Marker.anchor(t.shape);n=(r.x-.5)*a+i/2,o=(r.y-.5)*a,s?(t.x=0,t.y=0,t.translationX=n,t.translationY=o):(t.x=n,t.y=o,t.translationX=0,t.translationY=0)}e.visible&&(e.x1=0,e.x2=i,e.y1=0,e.y2=0)}preRender(t){const e=super.preRender(t);return this.layout(),e}layoutLabel(){const{length:t,spacing:e}=this;this.label.x=t+e}computeBBox(){return this.layout(),super.computeBBox()}};LegendMarkerLabel.className="MarkerLabel",__decorateClass2([ProxyPropertyOnWrite("label")],LegendMarkerLabel.prototype,"text",2),__decorateClass2([ProxyPropertyOnWrite("label")],LegendMarkerLabel.prototype,"fontStyle",2),__decorateClass2([ProxyPropertyOnWrite("label")],LegendMarkerLabel.prototype,"fontWeight",2),__decorateClass2([ProxyPropertyOnWrite("label")],LegendMarkerLabel.prototype,"fontSize",2),__decorateClass2([ProxyPropertyOnWrite("label")],LegendMarkerLabel.prototype,"fontFamily",2),__decorateClass2([ProxyPropertyOnWrite("label","fill")],LegendMarkerLabel.prototype,"color",2),__decorateClass2([ObserveChanges(t=>t.layoutLabel())],LegendMarkerLabel.prototype,"spacing",2),__decorateClass2([ObserveChanges(t=>t.layoutLabel())],LegendMarkerLabel.prototype,"length",2),__decorateClass2([SceneChangeDetection()],LegendMarkerLabel.prototype,"isCustomMarker",2);var LegendLabel=class extends BaseProperties{constructor(){super(...arguments),this.maxLength=void 0,this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};__decorateClass2([TempValidate(POSITIVE_NUMBER,{optional:!0})],LegendLabel.prototype,"maxLength",2),__decorateClass2([TempValidate(COLOR_STRING)],LegendLabel.prototype,"color",2),__decorateClass2([TempValidate(FONT_STYLE,{optional:!0})],LegendLabel.prototype,"fontStyle",2),__decorateClass2([TempValidate(FONT_WEIGHT,{optional:!0})],LegendLabel.prototype,"fontWeight",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],LegendLabel.prototype,"fontSize",2),__decorateClass2([TempValidate(STRING)],LegendLabel.prototype,"fontFamily",2),__decorateClass2([TempValidate(FUNCTION,{optional:!0})],LegendLabel.prototype,"formatter",2);var LegendMarker=class extends BaseProperties{constructor(){super(...arguments),this.shape=void 0,this.size=15,this.padding=8}};__decorateClass2([TempValidate(MARKER_SHAPE,{optional:!0})],LegendMarker.prototype,"shape",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],LegendMarker.prototype,"size",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],LegendMarker.prototype,"padding",2),__decorateClass2([TempValidate(POSITIVE_NUMBER,{optional:!0})],LegendMarker.prototype,"strokeWidth",2),__decorateClass2([TempValidate(BOOLEAN)],LegendMarker.prototype,"enabled",2);var LegendLine=class extends BaseProperties{};__decorateClass2([TempValidate(POSITIVE_NUMBER,{optional:!0})],LegendLine.prototype,"strokeWidth",2),__decorateClass2([TempValidate(POSITIVE_NUMBER,{optional:!0})],LegendLine.prototype,"length",2);var LegendItem=class extends BaseProperties{constructor(){super(...arguments),this.paddingX=16,this.paddingY=8,this.showSeriesStroke=!1,this.marker=new LegendMarker,this.label=new LegendLabel,this.line=new LegendLine}};__decorateClass2([TempValidate(POSITIVE_NUMBER,{optional:!0})],LegendItem.prototype,"maxWidth",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],LegendItem.prototype,"paddingX",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],LegendItem.prototype,"paddingY",2),__decorateClass2([TempValidate(BOOLEAN)],LegendItem.prototype,"showSeriesStroke",2),__decorateClass2([TempValidate(OBJECT)],LegendItem.prototype,"marker",2),__decorateClass2([TempValidate(OBJECT)],LegendItem.prototype,"label",2),__decorateClass2([TempValidate(OBJECT)],LegendItem.prototype,"line",2);var LegendListeners=class extends BaseProperties{};__decorateClass2([TempValidate(FUNCTION,{optional:!0})],LegendListeners.prototype,"legendItemClick",2),__decorateClass2([TempValidate(FUNCTION,{optional:!0})],LegendListeners.prototype,"legendItemDoubleClick",2);var ID_LEGEND_VISIBILITY="legend-visibility",ID_LEGEND_OTHER_SERIES="legend-other-series",fillGradientDefaults2={type:"gradient",bounds:"item",gradient:"linear",colorStops:[{color:"black"}],rotation:0,reverse:!1},fillPatternDefaults2={type:"pattern",pattern:"forward-slanted-lines",width:8,height:8,padding:1,fill:"black",fillOpacity:1,backgroundFill:"white",backgroundFillOpacity:1,stroke:"black",strokeOpacity:1,strokeWidth:0,rotation:0},Legend=class extends BaseProperties{constructor(t){super(),this.ctx=t,this.id=createId(this),this.group=new TranslatableGroup({name:"legend",zIndex:14}),this.itemSelection=Selection.select(this.group,LegendMarkerLabel),this.oldSize=[0,0],this.pages=[],this.maxPageSize=[0,0],this.paginationTrackingIndex=0,this.truncatedItems=new Set,this._data=[],this.toggleSeries=!0,this.item=new LegendItem,this.listeners=new LegendListeners,this.enabled=!0,this.position="bottom",this.spacing=20,this.destroyFns=[],this.size=[0,0],this._visible=!0,this.pagination=new Pagination(e=>t.updateService.update(e),e=>this.updatePageNumber(e)),this.pagination.attachPagination(this.group),this.destroyFns.push(t.contextMenuRegistry.registerDefaultAction({id:ID_LEGEND_VISIBILITY,type:"legend",label:"contextMenuToggleSeriesVisibility",action:e=>this.contextToggleVisibility(e)}),t.contextMenuRegistry.registerDefaultAction({id:ID_LEGEND_OTHER_SERIES,type:"legend",label:"contextMenuToggleOtherSeries",action:e=>this.contextToggleOtherSeries(e)}),t.legendManager.addListener("legend-change",this.onLegendDataChange.bind(this))),this.destroyFns.push(t.layoutManager.registerElement(1,e=>this.positionLegend(e)),t.localeManager.addListener("locale-changed",()=>this.onLocaleChanged()),()=>this.group.remove()),this.domProxy=new LegendDOMProxy(this.ctx,this.id),this.ctx.historyManager.addMementoOriginator(t.legendManager)}set data(t){objectsEqual(t,this._data)||(this.domProxy.onDataUpdate(this._data,t),this._data=t,this.updateGroupVisibility())}get data(){return this._data}onLegendDataChange({legendData:t=[]}){this.enabled&&(this.data=t.filter(e=>!e.hideInLegend))}destroy(){this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-toolbar`),this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-pagination`),this.destroyFns.forEach(t=>t()),this.itemSelection.clear(),this.domProxy.destroy()}getOrientation(){return this.orientation??"horizontal"}set visible(t){this._visible=t,this.updateGroupVisibility()}get visible(){return this._visible}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible&&this.data.length>0}attachLegend(t){t.appendChild(this.group)}getItemLabel(t){const{ctx:{callbackCache:e}}=this,{formatter:i}=this.item.label;if(i){const s=t.datum;return e.call(this,i,{itemId:t.itemId,value:t.label.text,seriesId:t.seriesId,...s&&{datum:s}})}return t.label.text}calcLayout(t,e){const{paddingX:i,paddingY:s,label:n,maxWidth:o,label:{maxLength:a=1/0,fontStyle:r,fontWeight:l,fontSize:c,fontFamily:h}}=this.item,d=[...this.data];this.reverseOrder&&d.reverse(),this.itemSelection.update(d);const u=[],p=TextUtils.toFontString(n),f=o??t*.8,{markerWidth:m,anyLineEnabled:y}=this.calculateMarkerWidth();if(this.itemSelection.each((k,w)=>{k.fontStyle=r,k.fontWeight=l,k.fontSize=c,k.fontFamily=h;const L=this.updateMarkerLabel(k,w,m,y),O=w.itemId??w.id,R=(this.getItemLabel(w)??"<unknown>").replace(/\r?\n/g," ");k.text=this.truncate(R,a,f,L,p,O),u.push(k.getBBox())}),t=Math.max(1,t),e=Math.max(1,e),!isFinite(t))return{};const x=this.size,b=this.oldSize;x[0]=t,x[1]=e,(x[0]!==b[0]||x[1]!==b[1])&&(b[0]=x[0],b[1]=x[1]);const{pages:S,maxPageHeight:v,maxPageWidth:I}=this.updatePagination(u,t,e),A=this.pages;this.pages=S,this.maxPageSize=[I-i,v-s];const D=this.pagination.currentPage,T=this.pages[D];return this.pages.length<1||!T?(this.visible=!1,{oldPages:A}):(this.visible=!0,this.updatePositions(D),this.update(),{oldPages:A})}isCustomMarker(t,e){return t&&e!==void 0&&typeof e!="string"}calcSymbolsEnabled(t){const{showSeriesStroke:e,marker:i}=this.item,s=!!i.enabled||!e||(t.marker.enabled??!0),n=!!(t.line&&e),o=this.isCustomMarker(s,t.marker.shape);return{markerEnabled:s,lineEnabled:n,isCustomMarker:o}}calcSymbolsLengths(t,e,i){const{marker:s,line:n}=this.item;let o;const{shape:a}=t.marker;if(this.isCustomMarker(e,a)){const c=new Marker;c.shape=a,c.updatePath();const h=c.getBBox();o=Math.max(h.width,h.height)}const r=e?s.size:0,l=i?n.length??25:0;return{markerLength:r,lineLength:l,customMarkerSize:o}}calculateMarkerWidth(){let t=0,e=!1;return this.itemSelection.each((i,s)=>{const{symbol:n}=s,{lineEnabled:o,markerEnabled:a}=this.calcSymbolsEnabled(n),{markerLength:r,lineLength:l,customMarkerSize:c=-1/0}=this.calcSymbolsLengths(n,a,o);t=Math.max(t,l,c,r),e||(e=o)}),{markerWidth:t,anyLineEnabled:e}}updateMarkerLabel(t,e,i,s){const{marker:n,paddingX:o}=this.item,{symbol:a}=e;let r=o;const{markerEnabled:l,isCustomMarker:c}=this.calcSymbolsEnabled(a),h=n.padding;(l||s)&&(r+=h+i);const{marker:d,line:u}=t;return d.visible=l,d.visible&&(d.shape=n.shape??a.marker.shape??"square",d.size=n.size,applyShapeStyle(d,this.getMarkerStyles(a))),u.visible=s,u.visible&&applyShapeStyle(u,this.getLineStyles(a)),t.length=i,t.spacing=h,t.isCustomMarker=c,r}truncate(t,e,i,s,n,o){let a=!1;t.length>e&&(t=t.substring(0,e),a=!0);const r=CachedTextMeasurerPool.getMeasurer({font:n}),l=TextWrapper.truncateLine(t,r,i-s,a);return l.endsWith(TextUtils.EllipsisChar)?this.truncatedItems.add(o):this.truncatedItems.delete(o),l}updatePagination(t,e,i){const s=this.getOrientation(),n=Math.min(this.paginationTrackingIndex,t.length);this.pagination.orientation=s,this.pagination.translationX=0,this.pagination.translationY=0;const{pages:o,maxPageHeight:a,maxPageWidth:r,paginationBBox:l,paginationVertical:c}=this.calculatePagination(t,e,i),h=o.findIndex(b=>b.endIndex>=n);this.pagination.currentPage=clamp(0,h,o.length-1);const{paddingX:d,paddingY:u}=this.item,p=8,g=r-d,f=a-u;let m=0,y=-l.y-this.item.marker.size/2;c?y+=f+p:(m+=-l.x+g+p,y+=(f-l.height)/2),this.pagination.translationX=m,this.pagination.translationY=y,this.pagination.update(),this.pagination.updateMarkers();let x=0;return this.itemSelection.each((b,S,v)=>{v>(o[x]?.endIndex??1/0)&&x++,b.pageIndex=x}),{maxPageHeight:a,maxPageWidth:r,pages:o}}calculatePagination(t,e,i){const{paddingX:s,paddingY:n}=this.item,o=this.getOrientation(),a=["left","right"].includes(this.position);let r=this.pagination.getBBox(),l=new BBox(0,0,0,0),c=[],h=0,d=0,u=0;const p=f=>f.width===r.width&&f.height===r.height,g=this.maxWidth!==void 0&&this.maxHeight!==void 0;do{if(u++>10){logger_exports.warn("unable to find stable legend layout.");break}r=l;const f=e-(a?0:r.width),m=i-(a?r.height:0),y=gridLayout({orientation:o,bboxes:t,maxHeight:m,maxWidth:f,itemPaddingY:n,itemPaddingX:s,forceResult:g});c=y?.pages??[],h=y?.maxPageWidth??0,d=y?.maxPageHeight??0;const x=c.length;if(this.pagination.visible=x>1,this.pagination.totalPages=x,this.pagination.update(),this.pagination.updateMarkers(),l=this.pagination.getBBox(),!this.pagination.visible)break}while(!p(l));return{maxPageWidth:h,maxPageHeight:d,pages:c,paginationBBox:l,paginationVertical:a}}updatePositions(t=0){const{item:{paddingY:e},itemSelection:i,pages:s}=this;if(s.length<1||!s[t])return;const{columns:n,startIndex:o,endIndex:a}=s[t];let r=0,l=0;const c=n.length,h=n[0].indices.length,d=this.getOrientation()==="horizontal",u=n[0].bboxes[0].height+e,p=[];i.each((g,f,m)=>{if(m<o||m>a){g.visible=!1;return}const y=m-o;let x,b;d?(x=y%c,b=Math.floor(y/c)):(x=Math.floor(y/h),b=y%h),g.visible=!0;const S=n[x];S&&(l=Math.floor(u*b),r=Math.floor(p[b]??0),p[b]=(p[b]??0)+S.columnWidth,g.translationX=r,g.translationY=l)})}updatePageNumber(t){const{itemSelection:e,group:i,pagination:s,pages:n,toggleSeries:o}=this,{startIndex:a,endIndex:r}=n[t];a===0?this.paginationTrackingIndex=0:t===n.length-1?this.paginationTrackingIndex=r:this.paginationTrackingIndex=Math.floor((a+r)/2),this.pagination.update(),this.pagination.updateMarkers(),this.updatePositions(t),this.domProxy.onPageChange({itemSelection:e,group:i,pagination:s,interactive:o}),this.ctx.updateService.update(6)}update(){const{label:{color:t}}=this.item;this.itemSelection.each((e,i)=>{e.setEnabled(i.enabled),e.color=t}),this.updateContextMenu()}updateContextMenu(){const{toggleSeries:t,ctx:{contextMenuRegistry:e}}=this;t?(e.hideAction(ID_LEGEND_VISIBILITY),e.hideAction(ID_LEGEND_OTHER_SERIES)):(e.showAction(ID_LEGEND_VISIBILITY),e.showAction(ID_LEGEND_OTHER_SERIES))}getLineStyles(t){const{stroke:e,strokeOpacity:i=1,strokeWidth:s,lineDash:n}=t.line??{},o=Math.min(2,s??1);return{stroke:e,strokeOpacity:i,strokeWidth:this.item.line.strokeWidth??o,lineDash:n}}getMarkerStyles({marker:t}){const{fill:e,stroke:i,strokeOpacity:s=1,fillOpacity:n=1,strokeWidth:o,lineDash:a,lineDashOffset:r}=t,l=Math.min(2,o??1);return isPatternFill(e)&&(e.width=8,e.height=8,e.padding=1,e.strokeWidth=Math.min(2,e.strokeWidth??2)),getShapeStyle({fill:e,stroke:i,strokeOpacity:s,fillOpacity:n,strokeWidth:this.item.marker.strokeWidth??l,lineDash:a,lineDashOffset:r},fillGradientDefaults2,fillPatternDefaults2)}computePagedBBox(){const t=Group.computeChildrenBBox(this.group.children());if(this.pages.length>1){const[e,i]=this.maxPageSize;t.height=Math.max(i,t.height),t.width=Math.max(e,t.width)}return t}findNode(t){const{datum:e,proxyButton:i}=this.itemSelection.select(s=>s.datum?.itemId===t.itemId)[0]??{};if(e===void 0||i===void 0)throw new Error(`AG Charts - Missing required properties { datum: ${e}, proxyButton: ${JSON.stringify(i)} }`);return{datum:e,proxyButton:i}}contextToggleVisibility(t){const{datum:e,proxyButton:i}=this.findNode(t);this.doClick(t.event,e,i)}contextToggleOtherSeries(t){this.doDoubleClick(t.event,this.findNode(t).datum)}onContextClick(t,e){const i=e.datum;this.preventHidingAll&&this.contextMenuDatum?.enabled&&this.getVisibleItemCount()<=1?this.ctx.contextMenuRegistry.disableAction(ID_LEGEND_VISIBILITY):this.ctx.contextMenuRegistry.enableAction(ID_LEGEND_VISIBILITY);const{offsetX:s,offsetY:n}=t,{x:o,y:a}=Transformable.toCanvasPoint(e,s,n);this.ctx.contextMenuRegistry.dispatchContext("legend",{sourceEvent:t,canvasX:o,canvasY:a},{legendItem:i})}onClick(t,e,i){this.doClick(t,e,i)&&t.preventDefault()}getVisibleItemCount(){return this.ctx.chartService.series.flatMap(t=>t.getLegendData("category")).filter(t=>t.enabled).length}doClick(t,e,i){const{listeners:{legendItemClick:s},ctx:{chartService:n,highlightManager:o},preventHidingAll:a,toggleSeries:r}=this;if(!e)return!1;const{legendType:l,seriesId:c,itemId:h,enabled:d}=e,u=n.series.find(f=>f.id===c);if(!u)return!1;let p=d;const g=makeLegendItemEvent("click",h,u.id,t);return s?.(g.apiEvent),g.defaultPrevented||(r&&(p=!d,a&&!p&&this.getVisibleItemCount()<2&&(p=!0),i.setChecked(p),this.ctx.chartEventManager.legendItemClick(l,u,h,p,e.legendItemName)),p?o.updateHighlight(this.id,{series:u,itemId:h,datum:void 0,datumIndex:void 0}):o.updateHighlight(this.id),this.ctx.legendManager.update(),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0,skipAnimations:e.skipAnimations??!1})),!0}onDoubleClick(t,e){this.doDoubleClick(t,e)&&t.preventDefault()}doDoubleClick(t,e){const{listeners:{legendItemDoubleClick:i},ctx:{chartService:s},toggleSeries:n}=this;if(s.mode==="integrated"||!e)return!1;const{legendType:o,id:a,itemId:r,seriesId:l}=e,c=s.series.find(d=>d.id===a);if(!c)return!1;const h=makeLegendItemEvent("dblclick",r,c.id,t);if(i?.(h.apiEvent),h.defaultPrevented)return!0;if(n){const d=s.series.flatMap(f=>f.getLegendData("category"));let u=0;const p=new Set;for(const f of d)f.enabled&&(u+=1,f.legendItemName!=null&&p.add(f.legendItemName));p.size>0&&(u=p.size);const g=d.find(f=>f.itemId===r&&f.seriesId===l);this.ctx.chartEventManager.legendItemDoubleClick(o,c,r,g?.enabled??!1,u,g?.legendItemName)}return this.ctx.legendManager.update(),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),!0}toTooltipMeta(t,e){let i;return t instanceof FocusEvent?i=Transformable.toCanvas(e).computeCenter():(t.preventDefault(),i=Transformable.toCanvasPoint(e,t.offsetX,t.offsetY)),{canvasX:i.x,canvasY:i.y,showArrow:!1}}onHover(t,e){if(!this.enabled)throw new Error("AG Charts - onHover handler called on disabled legend");this.pagination.setPage(e.pageIndex);const i=e.datum,s=i?this.ctx.chartService.series.find(n=>n.id===i?.id):void 0;if(i&&this.truncatedItems.has(i.itemId??i.id)){const n=this.toTooltipMeta(t,e);this.ctx.tooltipManager.updateTooltip(this.id,n,[{type:"structured",title:this.getItemLabel(i)}])}else this.ctx.tooltipManager.removeTooltip(this.id);i?.enabled&&s?this.updateHighlight({series:s,itemId:i?.itemId,datum:void 0,datumIndex:void 0}):this.updateHighlight()}onLeave(){this.ctx.tooltipManager.removeTooltip(this.id),this.updateHighlight()}updateHighlight(t){this.ctx.interactionManager.isState(32)?this.ctx.highlightManager.updateHighlight(this.id,t):this.ctx.interactionManager.isState(2)&&(this.pendingHighlightDatum=t,this.ctx.animationManager.onBatchStop(()=>{this.ctx.highlightManager.updateHighlight(this.id,this.pendingHighlightDatum)}))}onLocaleChanged(){this.domProxy.onLocaleChanged(this.ctx.localeManager,this.itemSelection,this)}positionLegend(t){const e=this.positionLegendScene(t);this.positionLegendDOM(e)}positionLegendScene(t){if(!this.enabled||!this.data.length)return;const{layoutBox:e}=t,{x:i,y:s,width:n,height:o}=e,[a,r]=this.calculateLegendDimensions(e),{oldPages:l}=this.calcLayout(a,r),c=this.computePagedBBox(),h=()=>{switch(this.position){case"top":case"left":return 0;case"bottom":return o-c.height;case"right":default:return n-c.width}};if(this.visible){const d=this.spacing;let u,p;switch(this.position){case"top":case"bottom":u=(n-c.width)/2,p=h(),e.shrink(c.height+d,this.position);break;case"left":case"right":default:u=h(),p=(o-c.height)/2,e.shrink(c.width+d,this.position)}this.group.translationX=Math.floor(i+u-c.x),this.group.translationY=Math.floor(s+p-c.y)}return l}positionLegendDOM(t){const{ctx:e,itemSelection:i,pagination:s,pages:n,toggleSeries:o,group:a,listeners:{legendItemClick:r,legendItemDoubleClick:l}}=this,c=this.visible&&this.enabled,h=o||l!=null||r!=null;this.domProxy.update({visible:c,interactive:h,ctx:e,itemSelection:i,group:a,pagination:s,oldPages:t,newPages:n,datumReader:this,itemListener:this})}calculateLegendDimensions(t){const{width:e,height:i}=t,s=e/i,n=.5,o=.2,a=.25;let r,l;switch(this.position){case"top":case"bottom":{const c=s<1?Math.min(n,o*(1/s)):o;r=this.maxWidth?Math.min(this.maxWidth,e):e,l=this.maxHeight?Math.min(this.maxHeight,i):Math.round(i*c);break}case"left":case"right":default:{const c=s>1?Math.min(n,a*s):a;r=this.maxWidth?Math.min(this.maxWidth,e):Math.round(e*c),l=this.maxHeight?Math.min(this.maxHeight,i):i}}return[r,l]}};Legend.className="Legend",__decorateClass2([TempValidate(BOOLEAN)],Legend.prototype,"toggleSeries",2),__decorateClass2([TempValidate(OBJECT)],Legend.prototype,"pagination",2),__decorateClass2([TempValidate(OBJECT)],Legend.prototype,"item",2),__decorateClass2([TempValidate(OBJECT)],Legend.prototype,"listeners",2),__decorateClass2([ObserveChanges((t,e,i)=>{if(t.updateGroupVisibility(),e===i)return;const{ctx:{legendManager:s,stateManager:n}}=t;i===!1&&e===!0&&n.restoreState(s)}),TempValidate(BOOLEAN)],Legend.prototype,"enabled",2),__decorateClass2([TempValidate(POSITION)],Legend.prototype,"position",2),__decorateClass2([TempValidate(POSITIVE_NUMBER,{optional:!0})],Legend.prototype,"maxWidth",2),__decorateClass2([TempValidate(POSITIVE_NUMBER,{optional:!0})],Legend.prototype,"maxHeight",2),__decorateClass2([TempValidate(BOOLEAN,{optional:!0})],Legend.prototype,"reverseOrder",2),__decorateClass2([TempValidate(UNION(["horizontal","vertical"],"an orientation"),{optional:!0})],Legend.prototype,"orientation",2),__decorateClass2([TempValidate(BOOLEAN,{optional:!0})],Legend.prototype,"preventHidingAll",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],Legend.prototype,"spacing",2);var CommunityLegendModule={type:"legend",optionsKey:"legend",identifier:"category",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new Legend(t),packageType:"community",removable:"standalone-only"},constants_exports={};__export3(constants_exports,{CARTESIAN_AXIS_TYPE:()=>CARTESIAN_AXIS_TYPE,CARTESIAN_POSITION:()=>CARTESIAN_POSITION,FONT_SIZE:()=>FONT_SIZE,FONT_SIZE_RATIO:()=>FONT_SIZE_RATIO,POLAR_AXIS_SHAPE:()=>POLAR_AXIS_SHAPE,POLAR_AXIS_TYPE:()=>POLAR_AXIS_TYPE});var FONT_SIZE=(t=>(t[t.SMALLEST=8]="SMALLEST",t[t.SMALLER=10]="SMALLER",t[t.SMALL=12]="SMALL",t[t.MEDIUM=13]="MEDIUM",t[t.LARGE=14]="LARGE",t[t.LARGEST=17]="LARGEST",t))(FONT_SIZE||{}),FONT_SIZE_RATIO=(t=>(t[t.SMALLEST=.6666666666666666]="SMALLEST",t[t.SMALLER=.8333333333333334]="SMALLER",t[t.SMALL=1]="SMALL",t[t.MEDIUM=1.0833333333333333]="MEDIUM",t[t.LARGE=1.1666666666666667]="LARGE",t[t.LARGEST=1.4166666666666667]="LARGEST",t))(FONT_SIZE_RATIO||{}),CARTESIAN_POSITION=(t=>(t.TOP="top",t.RIGHT="right",t.BOTTOM="bottom",t.LEFT="left",t))(CARTESIAN_POSITION||{}),CARTESIAN_AXIS_TYPE=(t=>(t.CATEGORY="category",t.GROUPED_CATEGORY="grouped-category",t.ORDINAL_TIME="ordinal-time",t.NUMBER="number",t.TIME="time",t.LOG="log",t))(CARTESIAN_AXIS_TYPE||{}),POLAR_AXIS_TYPE=(t=>(t.ANGLE_CATEGORY="angle-category",t.ANGLE_NUMBER="angle-number",t.RADIUS_CATEGORY="radius-category",t.RADIUS_NUMBER="radius-number",t))(POLAR_AXIS_TYPE||{}),POLAR_AXIS_SHAPE=(t=>(t.CIRCLE="circle",t.POLYGON="polygon",t))(POLAR_AXIS_SHAPE||{}),symbols_exports={};__export3(symbols_exports,{DEFAULT_ANNOTATION_HANDLE_FILL:()=>DEFAULT_ANNOTATION_HANDLE_FILL,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>DEFAULT_ANNOTATION_STATISTICS_COLOR,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>DEFAULT_ANNOTATION_STATISTICS_FILL,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>DEFAULT_ANNOTATION_STATISTICS_STROKE,DEFAULT_CAPTION_ALIGNMENT:()=>DEFAULT_CAPTION_ALIGNMENT,DEFAULT_CAPTION_LAYOUT_STYLE:()=>DEFAULT_CAPTION_LAYOUT_STYLE,DEFAULT_FIBONACCI_STROKES:()=>DEFAULT_FIBONACCI_STROKES,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,DEFAULT_GRIDLINE_ENABLED:()=>DEFAULT_GRIDLINE_ENABLED,DEFAULT_POLAR_SERIES_STROKE:()=>DEFAULT_POLAR_SERIES_STROKE,DEFAULT_SEPARATION_LINES_COLOUR:()=>DEFAULT_SEPARATION_LINES_COLOUR,DEFAULT_SHADOW_COLOUR:()=>DEFAULT_SHADOW_COLOUR,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>DEFAULT_SPARKLINE_CROSSHAIR_STROKE,DEFAULT_TEXTBOX_COLOR:()=>DEFAULT_TEXTBOX_COLOR,DEFAULT_TEXTBOX_FILL:()=>DEFAULT_TEXTBOX_FILL,DEFAULT_TEXTBOX_STROKE:()=>DEFAULT_TEXTBOX_STROKE,DEFAULT_TEXT_ANNOTATION_COLOR:()=>DEFAULT_TEXT_ANNOTATION_COLOR,DEFAULT_TOOLBAR_POSITION:()=>DEFAULT_TOOLBAR_POSITION,IS_COMMUNITY:()=>IS_COMMUNITY,IS_DARK_THEME:()=>IS_DARK_THEME,IS_ENTERPRISE:()=>IS_ENTERPRISE,PALETTE_ALT_DOWN_FILL:()=>PALETTE_ALT_DOWN_FILL,PALETTE_ALT_DOWN_STROKE:()=>PALETTE_ALT_DOWN_STROKE,PALETTE_ALT_NEUTRAL_FILL:()=>PALETTE_ALT_NEUTRAL_FILL,PALETTE_ALT_NEUTRAL_STROKE:()=>PALETTE_ALT_NEUTRAL_STROKE,PALETTE_ALT_UP_FILL:()=>PALETTE_ALT_UP_FILL,PALETTE_ALT_UP_STROKE:()=>PALETTE_ALT_UP_STROKE,PALETTE_DOWN_FILL:()=>PALETTE_DOWN_FILL,PALETTE_DOWN_STROKE:()=>PALETTE_DOWN_STROKE,PALETTE_NEUTRAL_FILL:()=>PALETTE_NEUTRAL_FILL,PALETTE_NEUTRAL_STROKE:()=>PALETTE_NEUTRAL_STROKE,PALETTE_UP_FILL:()=>PALETTE_UP_FILL,PALETTE_UP_STROKE:()=>PALETTE_UP_STROKE});var IS_DARK_THEME=Symbol("is-dark-theme"),IS_COMMUNITY=Symbol("is-community"),IS_ENTERPRISE=Symbol("is-enterprise"),DEFAULT_SEPARATION_LINES_COLOUR=Symbol("default-separation-lines-colour"),DEFAULT_SHADOW_COLOUR=Symbol("default-shadow-colour"),DEFAULT_CAPTION_LAYOUT_STYLE=Symbol("default-caption-layout-style"),DEFAULT_CAPTION_ALIGNMENT=Symbol("default-caption-alignment"),PALETTE_UP_STROKE=Symbol("palette-up-stroke"),PALETTE_DOWN_STROKE=Symbol("palette-down-stroke"),PALETTE_UP_FILL=Symbol("palette-up-fill"),PALETTE_DOWN_FILL=Symbol("palette-down-fill"),PALETTE_NEUTRAL_STROKE=Symbol("palette-neutral-stroke"),PALETTE_NEUTRAL_FILL=Symbol("palette-neutral-fill"),PALETTE_ALT_UP_STROKE=Symbol("palette-alt-up-stroke"),PALETTE_ALT_DOWN_STROKE=Symbol("palette-alt-down-stroke"),PALETTE_ALT_UP_FILL=Symbol("palette-alt-up-fill"),PALETTE_ALT_DOWN_FILL=Symbol("palette-alt-down-fill"),PALETTE_ALT_NEUTRAL_FILL=Symbol("palette-gray-fill"),PALETTE_ALT_NEUTRAL_STROKE=Symbol("palette-gray-stroke"),DEFAULT_POLAR_SERIES_STROKE=Symbol("default-polar-series-stroke"),DEFAULT_SPARKLINE_CROSSHAIR_STROKE=Symbol("default-sparkline-crosshair-stroke"),DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR=Symbol("default-financial-charts-annotation-stroke"),DEFAULT_FIBONACCI_STROKES=Symbol("default-hierarchy-strokes"),DEFAULT_TEXT_ANNOTATION_COLOR=Symbol("default-text-annotation-color"),DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL=Symbol("default-financial-charts-annotation-background-fill"),DEFAULT_ANNOTATION_HANDLE_FILL=Symbol("default-annotation-handle-fill"),DEFAULT_ANNOTATION_STATISTICS_FILL=Symbol("default-annotation-statistics-fill"),DEFAULT_ANNOTATION_STATISTICS_STROKE=Symbol("default-annotation-statistics-stroke"),DEFAULT_ANNOTATION_STATISTICS_COLOR=Symbol("default-annotation-statistics-color"),DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE=Symbol("default-annotation-statistics-divider-stroke"),DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL=Symbol("default-annotation-statistics-fill"),DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE=Symbol("default-annotation-statistics-stroke"),DEFAULT_TEXTBOX_FILL=Symbol("default-textbox-fill"),DEFAULT_TEXTBOX_STROKE=Symbol("default-textbox-stroke"),DEFAULT_TEXTBOX_COLOR=Symbol("default-textbox-color"),DEFAULT_TOOLBAR_POSITION=Symbol("default-toolbar-position"),DEFAULT_GRIDLINE_ENABLED=Symbol("default-gridline-enabled"),DIRECTION_SWAP_AXES=[{type:"number",position:{$if:[{$eq:[{$path:["/direction",void 0]},"horizontal"]},"bottom","left"]}},{type:"category",position:{$if:[{$eq:[{$path:["/direction",void 0]},"horizontal"]},"left","bottom"]}}],SAFE_FILL_OPERATION={$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isPattern:[{$palette:"fill"}]}]},{$palette:"fillFallback"},{$palette:"fill"}]},SAFE_FILLS_OPERATION={$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isPattern:[{$palette:"fill"}]}]},{$palette:"fillsFallback"},{$palette:"fills"}]},SAFE_STROKE_FILL_OPERATION={$if:[{$isGradient:[{$palette:"fill"}]},{$palette:"fillFallback"},{$if:[{$isPattern:[{$palette:"fill"}]},{$path:["./stroke",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},SAFE_RANGE2_OPERATION={$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isPattern:[{$palette:"fill"}]}]},[{$palette:"fillFallback"},{$palette:"fillFallback"}],{$palette:"range2"}]},FILL_PATTERN_DEFAULTS={type:"pattern",pattern:"forward-slanted-lines",width:10,height:10,padding:2,fill:{$if:[{$isGradient:[{$palette:"fill"}]},{$palette:"fillFallback"},{$if:[{$isPattern:[{$palette:"fill"}]},{$path:["./fill",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},fillOpacity:1,stroke:SAFE_STROKE_FILL_OPERATION,strokeOpacity:1,strokeWidth:4,backgroundFill:"transparent",backgroundFillOpacity:1,rotation:0};function getSequentialColors(t){return mapValues(t,e=>{const i=Color.fromString(e);return[Color.darken(i,.15).toString(),e,Color.lighten(i,.15).toString()]})}function pathMotion(t,e,i,s,n){const{addPhaseFn:o,updatePhaseFn:a,removePhaseFn:r}=n,l=(c,h,d)=>{i.animate({id:`${t}_${e}_${h.id}_${c}`,groupId:t,from:0,to:1,ease:easeOut,collapsable:!1,onUpdate(u,p){p&&c!=="removed"||(h.path.clear(!0),d(u,h),h.checkPathDirty())},onStop(){c==="added"&&(h.path.clear(!0),d(1,h),h.checkPathDirty())},phase:NODE_UPDATE_STATE_TO_PHASE_MAPPING[c]})};for(const c of s)i.isSkipped()||(l("removed",c,r),l("updated",c,a)),l("added",c,o)}function seriesLabelFadeInAnimation({id:t},e,i,...s){staticFromToMotion(t,e,i,s,{opacity:0},{opacity:1},{phase:"trailing"})}function seriesLabelFadeOutAnimation({id:t},e,i,...s){staticFromToMotion(t,e,i,s,{opacity:1},{opacity:0},{phase:"remove"})}function resetLabelFn(t){return{opacity:1}}var DropShadow=class extends ChangeDetectableProperties{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}};__decorateClass2([TempValidate(BOOLEAN),SceneChangeDetection()],DropShadow.prototype,"enabled",2),__decorateClass2([TempValidate(COLOR_STRING),SceneChangeDetection()],DropShadow.prototype,"color",2),__decorateClass2([TempValidate(NUMBER),SceneChangeDetection()],DropShadow.prototype,"xOffset",2),__decorateClass2([TempValidate(NUMBER),SceneChangeDetection()],DropShadow.prototype,"yOffset",2),__decorateClass2([TempValidate(POSITIVE_NUMBER),SceneChangeDetection()],DropShadow.prototype,"blur",2);var SeriesTooltipInteraction=class extends BaseProperties{constructor(){super(...arguments),this.enabled=!1}};__decorateClass2([TempValidate(BOOLEAN)],SeriesTooltipInteraction.prototype,"enabled",2);var SeriesTooltip=class extends BaseProperties{constructor(){super(...arguments),this.interaction=new SeriesTooltipInteraction,this.position=new TooltipPosition,this.range=void 0,this.class=void 0}formatTooltip(t,e,i){const s=this.renderer==null?void 0:callWithContext(t,this.renderer,[i]);return typeof s=="string"?{type:"raw",rawHtmlString:s}:s!=null?{type:"structured",...e,...s}:{type:"structured",...e}}};__decorateClass2([TempValidate(BOOLEAN,{optional:!0})],SeriesTooltip.prototype,"enabled",2),__decorateClass2([TempValidate(BOOLEAN,{optional:!0})],SeriesTooltip.prototype,"showArrow",2),__decorateClass2([TempValidate(FUNCTION,{optional:!0})],SeriesTooltip.prototype,"renderer",2),__decorateClass2([TempValidate(OBJECT)],SeriesTooltip.prototype,"interaction",2),__decorateClass2([TempValidate(OBJECT)],SeriesTooltip.prototype,"position",2),__decorateClass2([TempValidate(INTERACTION_RANGE,{optional:!0})],SeriesTooltip.prototype,"range",2),__decorateClass2([TempValidate(STRING,{optional:!0})],SeriesTooltip.prototype,"class",2);var QuadtreeNearest=class{constructor(t,e,i){this.root=new QuadtreeNodeNearest(t,e,i)}clear(t){this.root.clear(t)}addValue(t,e){const i={hitTester:t,value:e,distanceSquared:(s,n)=>t.distanceSquared(s,n)};this.root.addElem(i)}find(t,e){const i={best:{nearest:void 0,distanceSquared:1/0}};return this.root.find(t,e,i),i.best}},QuadtreeSubdivisions=class{constructor(t,e,i,s){this.nw=t,this.ne=e,this.sw=i,this.se=s}addElem(t){this.nw.addElem(t),this.ne.addElem(t),this.sw.addElem(t),this.se.addElem(t)}find(t,e,i){this.nw.find(t,e,i),this.ne.find(t,e,i),this.sw.find(t,e,i),this.se.find(t,e,i)}},QuadtreeNode=class{constructor(t,e,i){this.capacity=t,this.maxdepth=e,this.boundary=i??BBox.NaN,this.elems=[],this.subdivisions=void 0}clear(t){this.elems.length=0,this.boundary=t,this.subdivisions=void 0}addElem(t){this.addCondition(t)&&(this.subdivisions===void 0?this.maxdepth===0||this.elems.length<this.capacity?this.elems.push(t):this.subdivide(t):this.subdivisions.addElem(t))}find(t,e,i){this.findCondition(t,e,i)&&(this.subdivisions===void 0?this.findAction(t,e,i):this.subdivisions.find(t,e,i))}subdivide(t){this.subdivisions=this.makeSubdivisions();for(const e of this.elems)this.subdivisions.addElem(e);this.subdivisions.addElem(t),this.elems.length=0}makeSubdivisions(){const{x:t,y:e,width:i,height:s}=this.boundary,{capacity:n}=this,o=this.maxdepth-1,a=i/2,r=s/2,l=new BBox(t,e,a,r),c=new BBox(t+a,e,a,r),h=new BBox(t,e+r,a,r),d=new BBox(t+a,e+r,a,r);return new QuadtreeSubdivisions(this.child(n,o,l),this.child(n,o,c),this.child(n,o,h),this.child(n,o,d))}},QuadtreeNodeNearest=class se extends QuadtreeNode{addCondition(e){const{x:i,y:s}=e.hitTester.midPoint;return this.boundary.containsPoint(i,s)}findCondition(e,i,s){const{best:n}=s;return n.distanceSquared!==0&&this.boundary.distanceSquared(e,i)<n.distanceSquared}findAction(e,i,s){const n=nearestSquared(e,i,this.elems,s.best.distanceSquared);n.nearest!==void 0&&n.distanceSquared<s.best.distanceSquared&&(s.best=n)}child(e,i,s){return new se(e,i,s)}},DataModelSeries=class extends Series{constructor({clipFocusBox:t,categoryKey:e,...i}){super(i),this.categoryKey=e,this.clipFocusBox=t??!0}getScaleInformation({xScale:t,yScale:e}){const i=ContinuousScale.is(t),s=ContinuousScale.is(e);return{isContinuousX:i,isContinuousY:s,xScaleType:t?.type,yScaleType:e?.type}}getModulePropertyDefinitions(){const t=this.axes.x?.scale,e=this.axes.y?.scale;return this.moduleMap.mapModules(i=>i.getPropertyDefinitions(this.getScaleInformation({xScale:t,yScale:e}))).flat()}async requestDataModel(t,e,i){i.props.push(...this.getModulePropertyDefinitions());const{dataModel:s,processedData:n}=await t.request(this.id,e??[],i);return this.dataModel=s,this.processedData=n,this.dispatch("data-processed",{dataModel:s,processedData:n}),{dataModel:s,processedData:n}}isProcessedDataAnimatable(){const t=this.processedData?.reduced?.animationValidation;if(!t)return!0;const{orderedKeys:e,uniqueKeys:i}=t;return e&&i}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}pickFocus(t){const e=this.getNodeData();if(e===void 0||e.length===0)return;const i=this.computeFocusDatumIndex(t,e);if(i===void 0)return;const{clipFocusBox:s}=this,n=e[i],o={...t,datumIndex:i},a=this.computeFocusBounds(o);if(a!==void 0)return{bounds:a,clipFocusBox:s,datum:n,datumIndex:i}}isDatumEnabled(t,e){const{missing:i=!1,enabled:s=!0,focusable:n=!0}=t[e];return!i&&s&&n}computeFocusDatumIndex(t,e){const i=(a,r)=>{for(;a>=0&&!this.isDatumEnabled(e,a);)a+=r;return a===-1?void 0:a},s=(a,r)=>{for(;a<e.length&&!this.isDatumEnabled(e,a);)a+=r;return a===e.length?void 0:a};let n;const o=clamp(0,t.datumIndex,e.length-1);return t.datumIndexDelta<0?n=i(o,t.datumIndexDelta):t.datumIndexDelta>0?n=s(o,t.datumIndexDelta):n=s(o,1)??i(o,-1),n===void 0?t.datumIndexDelta===0?void 0:t.datumIndex-t.datumIndexDelta:n}keysOrValues(t){const e=this.dataModel.resolveProcessedDataIndexById(this,t);return this.processedData?.keys[e]?.get(this.id)??this.processedData?.columns[e]??[]}getCategoryKey(){return this.categoryKey}getCategoryValue(t){const{processedData:e,dataModel:i}=this,s=this.getCategoryKey();return!e||!i||!s||(e.invalidData?.get(this.id)?.[t]??!1)?void 0:this.keysOrValues(s)[t]}datumIndexForCategoryValue(t){const{processedData:e,dataModel:i}=this,s=this.getCategoryKey();if(!e||!i||!s)return;t=t.valueOf();const n=e.invalidData?.get(this.id),o=this.keysOrValues(s);for(let a=0;a<o.length;a+=1){if(n?.[a]===!0)continue;const r=o[a]?.valueOf();if(objectsEqual(t,r))return a}}},DEFAULT_CARTESIAN_DIRECTION_KEYS={x:["xKey"],y:["yKey"]},DEFAULT_CARTESIAN_DIRECTION_NAMES={x:["xName"],y:["yName"]},CartesianSeriesNodeEvent=class extends SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.xKey=s.properties.xKey,this.yKey=s.properties.yKey}},CartesianSeriesProperties=class extends SeriesProperties{constructor(){super(...arguments),this.pickOutsideVisibleMinorAxis=!1}};__decorateClass2([TempValidate(STRING,{optional:!0})],CartesianSeriesProperties.prototype,"legendItemName",2),__decorateClass2([TempValidate(BOOLEAN,{optional:!0})],CartesianSeriesProperties.prototype,"pickOutsideVisibleMinorAxis",2);var RENDER_TO_OFFSCREEN_CANVAS_THRESHOLD=100,CartesianSeries=class extends DataModelSeries{constructor({pathsPerSeries:t=["path"],hasMarkers:e=!1,hasHighlightedLabels:i=!1,pathsZIndexSubOrderOffset:s=[],datumSelectionGarbageCollection:n=!0,markerSelectionGarbageCollection:o=!0,animationAlwaysUpdateSelections:a=!1,animationResetFns:r,directionKeys:l,directionNames:c,...h}){if(super({directionKeys:l,directionNames:c,canHaveAxes:!0,...h}),this.NodeEvent=CartesianSeriesNodeEvent,this.dataNodeGroup=this.contentGroup.appendChild(new Group({name:`${this.id}-series-dataNodes`,zIndex:0})),this.markerGroup=this.contentGroup.appendChild(new Group({name:`${this.id}-series-markers`,zIndex:1})),this.labelGroup=this.contentGroup.appendChild(new TranslatableGroup({name:`${this.id}-series-labels`})),this.labelSelection=Selection.select(this.labelGroup,Text),this.highlightSelection=Selection.select(this.highlightNode,()=>this.opts.hasMarkers?new Marker:this.nodeFactory()),this.highlightLabelSelection=Selection.select(this.highlightLabel,Text),this.annotationSelections=new Set,this.debug=Debug.create(),!l||!c)throw new Error(`Unable to initialise series type ${this.type}`);this.opts={pathsPerSeries:t,hasMarkers:e,hasHighlightedLabels:i,pathsZIndexSubOrderOffset:s,directionKeys:l,directionNames:c,animationResetFns:r,animationAlwaysUpdateSelections:a,datumSelectionGarbageCollection:n,markerSelectionGarbageCollection:o},this.paths=t.map(d=>new Path({name:`${this.id}-${d}`})),this.datumSelection=Selection.select(this.dataNodeGroup,()=>this.nodeFactory(),n),this.markerSelection=Selection.select(this.markerGroup,Marker,o),this.animationState=new StateMachine("empty",{empty:{update:{target:"ready",action:d=>this.animateEmptyUpdateReady(d)},reset:"empty",skip:"ready",disable:"disabled"},ready:{updateData:"waiting",clear:"clearing",highlight:d=>this.animateReadyHighlight(d),highlightMarkers:d=>this.animateReadyHighlightMarkers(d),resize:d=>this.animateReadyResize(d),reset:"empty",skip:"ready",disable:"disabled"},waiting:{update:{target:"ready",action:d=>{this.ctx.animationManager.isSkipped()?this.resetAllAnimation(d):this.animateWaitingUpdateReady(d)}},reset:"empty",skip:"ready",disable:"disabled"},disabled:{update:d=>this.resetAllAnimation(d),reset:"empty"},clearing:{update:{target:"empty",action:d=>this.animateClearingUpdateEmpty(d)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}get contextNodeData(){return this._contextNodeData}getNodeData(){return this.contextNodeData?.nodeData}attachSeries(t,e,i){super.attachSeries(t,e,i),this.attachPaths(this.paths,e,i)}detachSeries(t,e,i){super.detachSeries(t,e,i),this.detachPaths(this.paths,e,i)}attachPaths(t,e,i){for(const s of t)this.contentGroup.appendChild(s)}detachPaths(t,e,i){for(const s of t)this.contentGroup.removeChild(s)}renderToOffscreenCanvas(){const t=this.getNodeData();return t!=null&&t.length>RENDER_TO_OFFSCREEN_CANVAS_THRESHOLD}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"?this.animationState.transition("skip"):t==="disabled"&&this.animationState.transition("disable")}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)))}destroy(){super.destroy(),this._contextNodeData=void 0}update({seriesRect:t}){const{visible:e,_contextNodeData:i}=this,n=this.ctx.highlightManager?.getActiveHighlight()?.series===this,o=this.checkResize(t),a=this.updateHighlightSelection(n);this.updateSelections(e),this.updateNodes(a,n,e);const r=this.getAnimationData(t,i);r&&(o&&this.animationState.transition("resize",r),this.animationState.transition("update",r))}updateSelections(t){var e;const i=!this.opts.animationAlwaysUpdateSelections&&this.ctx.animationManager.isSkipped();if(!(!t&&i)&&!(!this.nodeDataRefresh&&!this.isPathOrSelectionDirty())){if(this.nodeDataRefresh){this.nodeDataRefresh=!1,this.debug("CartesianSeries.updateSelections() - calling createNodeData() for",this.id),this.markQuadtreeDirty(),this._contextNodeData=this.createNodeData();const s=this.isProcessedDataAnimatable();this._contextNodeData&&((e=this._contextNodeData).animationValid??(e.animationValid=s));const{dataModel:n,processedData:o}=this;n!==void 0&&o!==void 0&&this.dispatch("data-update",{dataModel:n,processedData:o})}this.updateSeriesSelections()}}updateSeriesSelections(t){const{datumSelection:e,labelSelection:i,markerSelection:s,paths:n}=this,o=this._contextNodeData;if(!o)return;const{nodeData:a,labelData:r,itemId:l}=o;this.updatePaths({seriesHighlighted:t,itemId:l,contextData:o,paths:n}),this.datumSelection=this.updateDatumSelection({nodeData:a,datumSelection:e}),this.labelSelection=this.updateLabelSelection({labelData:r,labelSelection:i})??i,this.opts.hasMarkers&&(this.markerSelection=this.updateMarkerSelection({nodeData:a,markerSelection:s}))}getShapeFillBBox(){const{axes:t}=this,e=t.x,i=t.y,[s,n]=findMinMax(e?.range??[0,1]),[o,a]=findMinMax(i?.range??[0,1]),r=this.getSeriesDomain("x"),l=[e?.scale.convert(r.at(0)),e?.scale.convert(r.at(-1))],c=this.getSeriesDomain("y"),h=[i?.scale.convert(c.at(0)),i?.scale.convert(c.at(-1))],[d,u]=findMinMax(l),[p,g]=findMinMax(h);return{axis:new BBox(s,o,n-s,a-o),series:new BBox(d,p,u-d,g-p)}}updateNodes(t,e,i){const{highlightSelection:s,highlightLabelSelection:n,opts:{hasMarkers:o,hasHighlightedLabels:a}}=this,r=!this.ctx.animationManager.isSkipped(),l=this.visible&&this._contextNodeData!=null&&i;this.contentGroup.visible=r||l,this.highlightGroup.visible=(r||l)&&e;const c=this.getOpacity();o?(this.updateMarkerNodes({markerSelection:s,isHighlight:!0}),this.animationState.transition("highlightMarkers",s)):(this.updateDatumNodes({datumSelection:s,isHighlight:!0}),this.animationState.transition("highlight",s)),a&&this.updateLabelNodes({labelSelection:n});const{dataNodeGroup:h,markerGroup:d,datumSelection:u,labelSelection:p,markerSelection:g,paths:f,labelGroup:m}=this,{itemId:y}=this.contextNodeData??{};h.opacity=c,h.visible=r||l,m.visible=l,o&&(d.opacity=c,d.visible=l),m&&(m.opacity=c),this.updatePathNodes({seriesHighlighted:e,itemId:y,paths:f,opacity:c,visible:l,animationEnabled:r}),h.visible&&(this.updateDatumNodes({datumSelection:u,highlightedItems:t,isHighlight:!1}),this.usesPlacedLabels||this.updateLabelNodes({labelSelection:p}),o&&this.updateMarkerNodes({markerSelection:g,isHighlight:!1}))}getHighlightLabelData(t,e){const i=t.filter(s=>s.datum===e.datum&&s.itemId===e.itemId);return i.length===0?void 0:i}getHighlightData(t,e){return e?[e]:void 0}updateHighlightSelection(t){const{highlightSelection:e,highlightLabelSelection:i,_contextNodeData:s}=this;if(!s)return;const n=this.ctx.highlightManager?.getActiveHighlight(),o=t&&n?.datum?n:void 0;let a,r;if(o!=null){const l=this.isLabelEnabled(),{labelData:c,nodeData:h}=s;r=this.getHighlightData(h,o),a=l?this.getHighlightLabelData(c,o):void 0}return this.highlightSelection=this.updateHighlightSelectionItem({items:r,highlightSelection:e}),this.highlightLabelSelection=this.updateHighlightSelectionLabel({items:a,highlightLabelSelection:i}),r}markQuadtreeDirty(){this.quadtree=void 0}*datumNodesIter(){for(const{node:t}of this.datumSelection)t.datum.missing!==!0&&(yield t)}getQuadTree(){if(this.quadtree===void 0){const{width:t,height:e}=this.ctx.scene.canvas,i=new BBox(0,0,t,e);this.quadtree=new QuadtreeNearest(100,10,i),this.initQuadTree(this.quadtree)}return this.quadtree}initQuadTree(t){}pickNodesExactShape(t){const e=super.pickNodesExactShape(t);if(e.length!==0)return e;const{x:i,y:s}=t,{opts:{hasMarkers:n}}=this,{dataNodeGroup:o,markerGroup:a}=this;let r=o.pickNodes(i,s).filter(l=>l.datum.missing!==!0);if(r.length===0&&n&&(r=a?.pickNodes(i,s).filter(l=>l.datum.missing!==!0)),r.length!==0)return r.map(c=>c.datum);for(const l of this.moduleMap.modules()){const{datum:c}=l.pickNodeExact(t)??{};if(c!=null&&c?.missing!==!0)return[c]}return[]}pickNodeClosestDatum(t){const{x:e,y:i}=t,{axes:s,_contextNodeData:n}=this;if(!n)return;const o=s.x,a=s.y,r={x:e,y:i};let l=1/0,c;for(const h of n.nodeData){const{point:{x:d=NaN,y:u=NaN}={}}=h;if(isNaN(d)||isNaN(u)||!(o?.inRange(d)&&a?.inRange(u)))continue;const g=Math.max((r.x-d)**2+(r.y-u)**2,0);g<l&&(l=g,c=h)}for(const h of this.moduleMap.modules()){const d=h.pickNodeNearest(t);if(d!==void 0&&d.distanceSquared<l){l=d.distanceSquared,c=d.datum;break}}if(c){const h=Math.max(Math.sqrt(l)-(c.point?.size??0)/2,0);return{datum:c,distance:h}}}pickNodeMainAxisFirst(t,e){const{x:i,y:s}=t,{axes:n,_contextNodeData:o}=this,{pickOutsideVisibleMinorAxis:a}=this.properties;if(!o)return;const r=n.x,l=n.y,c=[r,l].filter(CategoryAxis.is).map(g=>g.direction);if(e&&c.length===0)return;const[h="x"]=c,d=[i,s];h!=="x"&&d.reverse();const u=[1/0,1/0];let p;for(const g of o.nodeData){const{x:f=NaN,y:m=NaN}=g.point??g.midPoint??{};if(isNaN(f)||isNaN(m)||g.missing===!0)continue;const y=[r?.inRange(f),l?.inRange(m)];if(h!=="x"&&y.reverse(),!y[0]||!a&&!y[1])continue;const x=[f,m];h!=="x"&&x.reverse();let b=!0;for(let S=0;S<x.length;S++){const v=Math.abs(x[S]-d[S]);if(v>u[S]){b=!1;break}else v<u[S]&&(u[S]=v,u.fill(1/0,S+1,u.length))}b&&(p=g)}if(p){let g=Math.max(u[0]**2+u[1]**2-(p.point?.size??0),0);for(const f of this.moduleMap.modules()){const m=f.pickNodeMainAxisFirst(t);if(m!==void 0&&m.distanceSquared<g){p=m.datum,g=m.distanceSquared;break}}return{datum:p,distance:Math.sqrt(g)}}}isPathOrSelectionDirty(){return!1}shouldFlipXY(){return!1}visibleRange(t,e,i){const s=this.keysOrValues(t),n=0;return visibleRangeIndices(i?.length??s.length,e,o=>{const a=i?.[o]??o;return this.xCoordinateRange(s[a],n,a)})}domainForVisibleRange(t,e,i,s,n,o){const{processedData:a,dataModel:r}=this,[l,c]=s,h=this.keysOrValues(i);if(n){const g=this.visibleRange(i,s,o);return r.getDomainBetweenRange(this,e,g,a)}const d=e.map(g=>this.keysOrValues(g));let u=1/0,p=-1/0;return h.forEach((g,f)=>{const[m,y]=this.xCoordinateRange(g,0,f);if(!(y<l||m>c))for(let x=0;x<e.length;x++){const b=d[x][f];u=Math.min(u,b),p=Math.max(p,b)}}),u>p?[NaN,NaN]:[u,p]}domainForClippedRange(t,e,i,s){const{processedData:n,dataModel:o,axes:a}=this,l=axisExtent(a[t==="x"?"y":"x"]);if(!l)return e.flatMap(g=>o.getDomain(this,g,"value",n));const c=this.keysOrValues(i);if(s){const g=clippedRangeIndices(c.length,l,f=>c[f]);return o.getDomainBetweenRange(this,e,g,n)}const h=e.map(g=>this.keysOrValues(g)),d=l[0].valueOf(),u=l[1].valueOf(),p=[];return c.forEach((g,f)=>{const m=g.valueOf();if(m<d||m>u)return;const y=h.map(x=>x[f]);m>=d&&p.push(...y),m<=u&&p.push(...y)}),p}countVisibleItems(t,e,i,s,n){const{dataModel:o,processedData:a}=this;if(!o||!a)return 1/0;const r=this.keysOrValues(t),l=e.map(v=>o.resolveColumnById(this,v,a)),c=this.axes.x,h=this.axes.y,d=this.shouldFlipXY(),u=c.range,p=h.range,g=(v,I,A)=>v[0]+(A-I[0])/(I[1]-I[0])*(v[1]-v[0]),f=g(u,c.visibleRange,i[0]),m=g(u,c.visibleRange,i[1]),y=g(p,h.visibleRange,d?s[0]:s[1]),x=g(p,h.visibleRange,d?s[1]:s[0]),b=Math.round((i[0]+(i[1]-i[0])/2)*r.length),S=0;return countExpandingSearch(0,r.length-1,b,n,v=>{let[I,A]=this.xCoordinateRange(r[v],S,v),[D,T]=this.yCoordinateRange(l.map(k=>k[v]),S,v);return!isFiniteNumber(I)||!isFiniteNumber(A)||!isFiniteNumber(D)||!isFiniteNumber(T)?!1:(d&&([I,A,D,T]=[D,T,I,A]),I>=f&&A<=m&&D>=y&&T<=x)})}updateHighlightSelectionItem(t){const{opts:{hasMarkers:e}}=this,{items:i,highlightSelection:s}=t,n=i??[];if(e){const o=s;return this.updateMarkerSelection({nodeData:n,markerSelection:o})}else return this.updateDatumSelection({nodeData:n,datumSelection:s})}updateHighlightSelectionLabel(t){return this.updateLabelSelection({labelData:t.items??[],labelSelection:t.highlightLabelSelection})}updateDatumSelection(t){return t.datumSelection}updateDatumNodes(t){}updateMarkerSelection(t){return t.markerSelection}updateMarkerNodes(t){}updatePaths(t){t.paths.forEach(e=>e.visible=!1)}updatePathNodes(t){const{paths:e,opacity:i,visible:s}=t;for(const n of e)n.opacity=i,n.visible=s}resetPathAnimation(t){const{path:e}=this.opts?.animationResetFns??{};e&&t.paths.forEach(i=>{resetMotion([i],e)})}resetDatumAnimation(t){const{datum:e}=this.opts?.animationResetFns??{};e&&resetMotion([t.datumSelection],e)}resetLabelAnimation(t){const{label:e}=this.opts?.animationResetFns??{};e&&resetMotion([t.labelSelection],e)}resetMarkerAnimation(t){const{marker:e}=this.opts?.animationResetFns??{};e&&this.opts.hasMarkers&&resetMotion([t.markerSelection],e)}resetAllAnimation(t){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.resetPathAnimation(t),this.resetDatumAnimation(t),this.resetLabelAnimation(t),this.resetMarkerAnimation(t),t.contextData?.animationValid===!1&&this.ctx.animationManager.skipCurrentBatch()}animateEmptyUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateWaitingUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateReadyHighlight(t){const{datum:e}=this.opts?.animationResetFns??{};e&&resetMotion([t],e)}animateReadyHighlightMarkers(t){const{marker:e}=this.opts?.animationResetFns??{};e&&resetMotion([t],e)}animateReadyResize(t){this.resetAllAnimation(t)}animateClearingUpdateEmpty(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}getAnimationData(t,e){const{_contextNodeData:i}=this;return i?{datumSelection:this.datumSelection,markerSelection:this.markerSelection,labelSelection:this.labelSelection,annotationSelections:[...this.annotationSelections],contextData:i,previousContextData:e,paths:this.paths,seriesRect:t}:void 0}updateLabelSelection(t){return t.labelSelection}getScaling(t){if(t instanceof LogScale){const{range:e,domain:i}=t;return{type:"log",convert:s=>t.convert(s),domain:[i[0],i[1]],range:[e[0],e[1]]}}else if(t instanceof ContinuousScale){const{range:e,domain:i}=t;return{type:"continuous",domain:[i[0],i[1]],range:[e[0],e[1]]}}else if(t instanceof BandScale){const{domain:e}=t;return{type:"category",domain:e,inset:t.inset,step:t.step}}}calculateScaling(){const t={};for(const e of Object.values(ChartAxisDirection)){const i=this.axes[e];if(!i)continue;const s=this.getScaling(i.scale);s!=null&&(t[e]=s)}return t}};function axisExtent(t){let e,i;if((t instanceof NumberAxis||t instanceof TimeAxis)&&({min:e,max:i}=t),!(e==null&&i==null))return e??(e=-1/0),i??(i=1/0),[e,i]}function clippedRangeIndices(t,e,i){const s=e[0].valueOf(),n=e[1].valueOf(),o=findMinIndex(0,t-1,r=>{const l=i(r)?.valueOf();return!Number.isFinite(l)||l>=s});let a=findMaxIndex(0,t-1,r=>{const l=i(r)?.valueOf();return!Number.isFinite(l)||l<=n});return o==null||a==null?[0,0]:(a=Math.min(a+1,t),[o,a])}var INTERPOLATION_TYPE=UNION(["linear","smooth","step"],"a line style"),INTERPOLATION_STEP_POSITION=UNION(["start","middle","end"]),InterpolationProperties=class extends BaseProperties{constructor(){super(...arguments),this.type="linear",this.tension=1,this.position="end"}};__decorateClass2([TempValidate(INTERPOLATION_TYPE)],InterpolationProperties.prototype,"type",2),__decorateClass2([TempValidate(RATIO)],InterpolationProperties.prototype,"tension",2),__decorateClass2([TempValidate(INTERPOLATION_STEP_POSITION)],InterpolationProperties.prototype,"position",2);var AreaSeriesProperties=class extends CartesianSeriesProperties{constructor(){super(...arguments),this.xName=void 0,this.fill="#c16068",this.fillGradientDefaults=new FillGradientDefaults,this.fillPatternDefaults=new FillPatternDefaults,this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new InterpolationProperties,this.shadow=new DropShadow,this.marker=new SeriesMarker,this.label=new Label,this.tooltip=new SeriesTooltip,this.connectMissingData=!1}};__decorateClass2([TempValidate(STRING)],AreaSeriesProperties.prototype,"xKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],AreaSeriesProperties.prototype,"xName",2),__decorateClass2([TempValidate(STRING)],AreaSeriesProperties.prototype,"yKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],AreaSeriesProperties.prototype,"yName",2),__decorateClass2([TempValidate(STRING,{optional:!0})],AreaSeriesProperties.prototype,"yFilterKey",2),__decorateClass2([TempValidate(POSITIVE_NUMBER,{optional:!0})],AreaSeriesProperties.prototype,"normalizedTo",2),__decorateClass2([TempValidate(OR(COLOR_GRADIENT,COLOR_PATTERN,COLOR_STRING))],AreaSeriesProperties.prototype,"fill",2),__decorateClass2([TempValidate(OBJECT)],AreaSeriesProperties.prototype,"fillGradientDefaults",2),__decorateClass2([TempValidate(OBJECT)],AreaSeriesProperties.prototype,"fillPatternDefaults",2),__decorateClass2([TempValidate(RATIO)],AreaSeriesProperties.prototype,"fillOpacity",2),__decorateClass2([TempValidate(COLOR_STRING)],AreaSeriesProperties.prototype,"stroke",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],AreaSeriesProperties.prototype,"strokeWidth",2),__decorateClass2([TempValidate(RATIO)],AreaSeriesProperties.prototype,"strokeOpacity",2),__decorateClass2([TempValidate(LINE_DASH)],AreaSeriesProperties.prototype,"lineDash",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],AreaSeriesProperties.prototype,"lineDashOffset",2),__decorateClass2([TempValidate(OBJECT)],AreaSeriesProperties.prototype,"interpolation",2),__decorateClass2([TempValidate(OBJECT)],AreaSeriesProperties.prototype,"shadow",2),__decorateClass2([TempValidate(OBJECT)],AreaSeriesProperties.prototype,"marker",2),__decorateClass2([TempValidate(OBJECT)],AreaSeriesProperties.prototype,"label",2),__decorateClass2([TempValidate(OBJECT)],AreaSeriesProperties.prototype,"tooltip",2),__decorateClass2([TempValidate(BOOLEAN)],AreaSeriesProperties.prototype,"connectMissingData",2);function spanRange(t){switch(t.type){case"linear":case"step":return[{x:t.x0,y:t.y0},{x:t.x1,y:t.y1}];case"cubic":return[{x:t.cp0x,y:t.cp0y},{x:t.cp3x,y:t.cp3y}]}}function spanRangeNormalized(t){const e=spanRange(t);return e[0].x>e[1].x&&e.reverse(),e}function collapseSpanToPoint(t,e){const{x:i,y:s}=e;switch(t.type){case"linear":return{type:"linear",moveTo:t.moveTo,x0:i,y0:s,x1:i,y1:s};case"step":return{type:"step",moveTo:t.moveTo,x0:i,y0:s,x1:i,y1:s,stepX:i};case"cubic":return{type:"cubic",moveTo:t.moveTo,cp0x:i,cp0y:s,cp1x:i,cp1y:s,cp2x:i,cp2y:s,cp3x:i,cp3y:s}}}function rescaleSpan(t,e,i){const[s,n]=spanRange(t),o=n.x!==s.x?(i.x-e.x)/(n.x-s.x):0,a=n.y!==s.y?(i.y-e.y)/(n.y-s.y):0;switch(t.type){case"linear":return{type:"linear",moveTo:t.moveTo,x0:e.x,y0:e.y,x1:i.x,y1:i.y};case"cubic":return{type:"cubic",moveTo:t.moveTo,cp0x:e.x,cp0y:e.y,cp1x:i.x-(t.cp2x-s.x)*o,cp1y:i.y-(t.cp2y-s.y)*a,cp2x:i.x-(t.cp1x-s.x)*o,cp2y:i.y-(t.cp1y-s.y)*a,cp3x:i.x,cp3y:i.y};case"step":return{type:"step",moveTo:t.moveTo,x0:e.x,y0:e.y,x1:i.x,y1:i.y,stepX:i.x-(t.stepX-s.x)*o}}}function clipSpanX(t,e,i){const{moveTo:s}=t,[n,o]=spanRangeNormalized(t),{x:a,y:r}=n,{x:l,y:c}=o;if(i<a)return rescaleSpan(t,n,n);if(e>l)return rescaleSpan(t,o,o);switch(t.type){case"linear":{const h=r===c?void 0:(c-r)/(l-a),d=h==null?r:h*(e-a)+r,u=h==null?r:h*(i-a)+r;return{type:"linear",moveTo:s,x0:e,y0:d,x1:i,y1:u}}case"step":if(i<=t.stepX){const h=t.y0;return{type:"step",moveTo:s,x0:e,y0:h,x1:i,y1:h,stepX:i}}else if(e>=t.stepX){const h=t.y1;return{type:"step",moveTo:s,x0:e,y0:h,x1:i,y1:h,stepX:e}}else{const{y0:h,y1:d,stepX:u}=t;return{type:"step",moveTo:s,x0:e,y0:h,x1:i,y1:d,stepX:u}}case"cubic":{const h=solveBezier(t.cp0x,t.cp1x,t.cp2x,t.cp3x,e);let[d,u]=splitBezier(t.cp0x,t.cp0y,t.cp1x,t.cp1y,t.cp2x,t.cp2y,t.cp3x,t.cp3y,h);const p=solveBezier(u[0].x,u[1].x,u[2].x,u[3].x,i);return[u,d]=splitBezier(u[0].x,u[0].y,u[1].x,u[1].y,u[2].x,u[2].y,u[3].x,u[3].y,p),{type:"cubic",moveTo:s,cp0x:u[0].x,cp0y:u[0].y,cp1x:u[1].x,cp1y:u[1].y,cp2x:u[2].x,cp2y:u[2].y,cp3x:u[3].x,cp3y:u[3].y}}}}function linearPoints(t){const e=[];let i=0,s=NaN,n=NaN;for(const{x:o,y:a}of t){if(i>0){const r=i===1;e.push({type:"linear",moveTo:r,x0:s,y0:n,x1:o,y1:a})}i+=1,s=o,n=a}return e}var lineSteps={start:0,middle:.5,end:1};function stepPoints(t,e){const i=[];let s=0,n=NaN,o=NaN;const a=typeof e=="number"?e:lineSteps[e];for(const{x:r,y:l}of t){if(s>0){const c=s===1,h=n+(r-n)*a;i.push({type:"step",moveTo:c,x0:n,y0:o,x1:r,y1:l,stepX:h})}s+=1,n=r,o=l}return i}var flatnessRatio=.05;function smoothPoints(t,e){const i=Array.isArray(t)?t:Array.from(t);if(i.length<=1)return[];const s=i.map((o,a)=>{const r=a===0?o:i[a-1],l=a===i.length-1?o:i[a+1],c=a===0||a===i.length-1;if(Math.sign(r.y-o.y)===Math.sign(l.y-o.y))return 0;if(!c){const h=Math.abs(r.y-l.y),d=Math.abs(o.y-r.y)/h,u=Math.abs(o.y-l.y)/h;if(d<=flatnessRatio||1-d<=flatnessRatio||u<=flatnessRatio||1-u<=flatnessRatio)return 0}return(l.y-r.y)/(l.x-r.x)});s[1]===0&&(s[0]*=2),s[s.length-2]===0&&(s[s.length-1]*=2);const n=[];for(let o=1;o<i.length;o+=1){const a=i[o-1],r=s[o-1],l=i[o],c=s[o],h=l.x-a.x,d=l.y-a.y;let u=h*e/3,p=h*r*e/3,g=h*e/3,f=h*c*e/3;c===0&&Math.abs(p)>Math.abs(d)&&(u*=Math.abs(d/p),p=Math.sign(p)*Math.abs(d)),r===0&&Math.abs(f)>Math.abs(d)&&(g*=Math.abs(d/f),f=Math.sign(f)*Math.abs(d)),n.push({type:"cubic",moveTo:o===1,cp0x:a.x,cp0y:a.y,cp1x:a.x+u,cp1y:a.y+p,cp2x:l.x-g,cp2y:l.y-f,cp3x:l.x,cp3y:l.y})}return n}function lerp2(t,e,i){return(e-t)*i+t}function linearSupertype(t,e){const{x0:i,y0:s,x1:n,y1:o}=t,r=(o-s)/(n-i)*(e-i)+s;return{leftCp1x:i,leftCp1y:s,leftCp2x:e,leftCp2y:r,stepX:e,stepY0:r,stepY1:r,rightCp1x:e,rightCp1y:r,rightCp2x:n,rightCp2y:o}}function bezierSupertype(t,e){const{cp0x:i,cp0y:s,cp1x:n,cp1y:o,cp2x:a,cp2y:r,cp3x:l,cp3y:c}=t,h=solveBezier(i,n,a,l,e),[d,u]=splitBezier(i,s,n,o,a,r,l,c,h),p=d[3].y;return{leftCp1x:d[1].x,leftCp1y:d[1].y,leftCp2x:d[2].x,leftCp2y:d[2].y,stepX:e,stepY0:p,stepY1:p,rightCp1x:u[1].x,rightCp1y:u[1].y,rightCp2x:u[2].x,rightCp2y:u[2].y}}function stepSupertype(t){const{x0:e,y0:i,x1:s,y1:n,stepX:o}=t;return{leftCp1x:(e+o)/2,leftCp1y:i,leftCp2x:(e+o)/2,leftCp2y:i,stepX:o,stepY0:i,stepY1:n,rightCp1x:(o+s)/2,rightCp1y:n,rightCp2x:(o+s)/2,rightCp2y:n}}function spanSupertype(t,e){return t.type==="linear"?linearSupertype(t,e):t.type==="cubic"?bezierSupertype(t,e):stepSupertype(t)}function plotStart(t,e,i,s,n,o,a){switch(e){case 0:a?t.moveTo(n,o):t.moveTo(i,s);break;case 1:a?t.lineTo(n,o):t.lineTo(i,s);break}}function plotLinear(t,e,i,s,n,o){o?t.lineTo(e,i):t.lineTo(s,n)}function plotCubic(t,e,i,s,n,o,a,r,l,c){c?t.cubicCurveTo(o,a,s,n,e,i):t.cubicCurveTo(s,n,o,a,r,l)}function plotStep(t,e,i,s,n,o,a){a?(t.lineTo(o,n),t.lineTo(o,i),t.lineTo(e,i)):(t.lineTo(o,i),t.lineTo(o,n),t.lineTo(s,n))}function plotSpan(t,e,i,s){const[n,o]=spanRange(e);switch(plotStart(t,i,n.x,n.y,o.x,o.y,s),e.type){case"linear":plotLinear(t,e.x0,e.y0,e.x1,e.y1,s);break;case"cubic":plotCubic(t,e.cp0x,e.cp0y,e.cp1x,e.cp1y,e.cp2x,e.cp2y,e.cp3x,e.cp3y,s);break;case"step":plotStep(t,e.x0,e.y0,e.x1,e.y1,e.stepX,s);break}}function interpolatedSpanRange(t,e,i){const[s,n]=spanRange(t),[o,a]=spanRange(e),r=lerp2(s.x,o.x,i),l=lerp2(s.y,o.y,i),c=lerp2(n.x,a.x,i),h=lerp2(n.y,a.y,i);return[{x:r,y:l},{x:c,y:h}]}function plotInterpolatedSpans(t,e,i,s,n,o){const[{x:a,y:r},{x:l,y:c}]=interpolatedSpanRange(e,i,s);if(plotStart(t,n,a,r,l,c,o),e.type==="cubic"&&i.type==="cubic"){const h=lerp2(e.cp1x,i.cp1x,s),d=lerp2(e.cp1y,i.cp1y,s),u=lerp2(e.cp2x,i.cp2x,s),p=lerp2(e.cp2y,i.cp2y,s);plotCubic(t,a,r,h,d,u,p,l,c,o)}else if(e.type==="step"&&i.type==="step"){const h=lerp2(e.stepX,i.stepX,s);plotStep(t,a,r,l,c,h,o)}else if(e.type==="linear"&&i.type==="linear")plotLinear(t,a,r,l,c,o);else{let h;e.type==="step"?h=e.stepX:i.type==="step"?h=i.stepX:h=(a+l)/2;const d=spanSupertype(e,h),u=spanSupertype(i,h),p=lerp2(d.leftCp1x,u.leftCp1x,s),g=lerp2(d.leftCp1y,u.leftCp1y,s),f=lerp2(d.leftCp2x,u.leftCp2x,s),m=lerp2(d.leftCp2y,u.leftCp2y,s),y=lerp2(d.stepX,u.stepX,s),x=lerp2(d.stepY0,u.stepY0,s),b=lerp2(d.stepY1,u.stepY1,s),S=lerp2(d.rightCp1x,u.rightCp1x,s),v=lerp2(d.rightCp1y,u.rightCp1y,s),I=lerp2(d.rightCp2x,u.rightCp2x,s),A=lerp2(d.rightCp2y,u.rightCp2y,s);o?(t.cubicCurveTo(I,A,S,v,y,b),t.lineTo(y,x),t.cubicCurveTo(f,m,p,g,a,r)):(t.cubicCurveTo(p,g,f,m,y,x),t.lineTo(y,b),t.cubicCurveTo(S,v,I,A,l,c))}}var CollapseMode=(t=>(t[t.Zero=0]="Zero",t[t.Split=1]="Split",t))(CollapseMode||{});function integratedCategoryMatch(t,e){return t==null||e==null||typeof t!="object"||typeof e!="object"?!1:"id"in t&&"id"in e?t.id===e.id:t.toString()===e.toString()}function scale(t,e){if(!e)return NaN;if(t instanceof Date&&(t=t.getTime()),e.type==="continuous"&&typeof t=="number")return(t-e.domain[0])/(e.domain[1]-e.domain[0])*(e.range[1]-e.range[0])+e.range[0];if(e.type==="log"&&typeof t=="number")return e.convert(t);if(e.type!=="category")return NaN;const i=e.domain.findIndex(n=>n===t);return i>=0||e.domain.findIndex(n=>integratedCategoryMatch(t,n))>=0?e.inset+e.step*i:NaN}function toAxisValue(t){return transformIntegratedCategoryValue(t).valueOf()}function getAxisIndices({data:t},e){return t.map((i,s)=>({xValue0Index:e.indexOf(toAxisValue(i.xValue0)),xValue1Index:e.indexOf(toAxisValue(i.xValue1)),datumIndex:s}))}function validateCategorySorting(t,e){const i=e.scales.x,s=t.scales.x;if(i?.type!=="category"||s?.type!=="category")return!0;let n=-1/0;for(const o of i.domain){const a=scale(o,s);if(Number.isFinite(a)){if(a<n)return!1;n=a}}return!0}function validateAxisEntriesOrder(t,e){let i=-1/0;for(const s of t){const n=scale(s.value,e.scales.x);if(Number.isFinite(n)){if(n<i)return!1;i=n}}return!0}function spanAxisContext(t,e){const i=new Map;for(const{xValue0:h,xValue1:d}of t.data){const u=toAxisValue(h),p=toAxisValue(d);i.set(u,h).set(p,d)}const s=Array.from(i,([h,d])=>({axisValue:h,value:d}));s.sort((h,d)=>scale(h.value,t.scales.x)-scale(d.value,t.scales.x));const n=[];for(const{xValue0:h,xValue1:d}of e.data){const u=toAxisValue(h),p=toAxisValue(d);i.has(u)||(i.set(u,h),n.push({axisValue:u,value:h})),i.has(p)||(i.set(p,d),n.push({axisValue:p,value:d}))}n.sort((h,d)=>scale(h.value,e.scales.x)-scale(d.value,e.scales.x));const o=s;let a=0;for(const h of n){for(let d=o.length-1;d>a;d-=1){const u=scale(h.value,e.scales.x),p=scale(o[d].value,e.scales.x);if(u>p){a=d+1;break}}o.splice(a,0,h),a+=1}if(!validateAxisEntriesOrder(o,e))return;const r=o.map(h=>h.axisValue),l=getAxisIndices(e,r),c=getAxisIndices(t,r);return{axisValues:r,oldDataAxisIndices:l,newDataAxisIndices:c}}function clipSpan(t,e,i){if(i.xValue1Index===i.xValue0Index+1)return t;const s=spanRange(t),n=(s[1].x-s[0].x)/(i.xValue1Index-i.xValue0Index),o=s[0].x+(e-i.xValue0Index)*n,a=o+n;return clipSpanX(t,o,a)}function axisZeroSpan(t,e){const[i,s]=spanRange(t),n=scale(0,e.scales.y);return rescaleSpan(t,{x:i.x,y:n},{x:s.x,y:n})}function collapseSpanToMidpoint(t){const[e,i]=spanRange(t);return collapseSpanToPoint(t,{x:(e.x+i.x)/2,y:(e.y+i.y)/2})}function collapseSpan(t,e,i,s,n,o){let a,r;if(n.xValue0Index>=o.xValue1Index){const d=s.findLast(p=>p.xValue1Index<=o.xValue1Index)?.datumIndex,u=d!=null?i.data[d]:void 0;a=u?.xValue1,r=u?.yValue1}else if(n.xValue0Index<=o.xValue0Index){const d=s.find(p=>p.xValue0Index>=o.xValue0Index)?.datumIndex,u=d!=null?i.data[d]:void 0;a=u?.xValue0,r=u?.yValue0}if(a==null||r==null)switch(e){case 0:return axisZeroSpan(t,i);case 1:return collapseSpanToMidpoint(t)}const l=scale(a,i.scales.x),c=scale(r,i.scales.y),h={x:l,y:c};return rescaleSpan(t,h,h)}function zeroDataSpan(t,e){if(e==null)return;const i=toAxisValue(t.xValue0),s=toAxisValue(t.xValue1);return e.find(n=>toAxisValue(n.xValue0)===i&&toAxisValue(n.xValue1)===s)?.span}function addSpan(t,e,i,s,n,o,a){const r=t.data[s.datumIndex],l=r.span,c=zeroDataSpan(r,n);if(c!=null)a.removed.push({from:c,to:c}),a.moved.push({from:c,to:l}),a.added.push({from:l,to:l});else{const h=collapseSpan(l,e,t,i,s,o);a.added.push({from:h,to:l})}}function removeSpan(t,e,i,s,n,o,a){const r=t.data[s.datumIndex],l=r.span,c=zeroDataSpan(r,n);if(c!=null)a.removed.push({from:l,to:l}),a.moved.push({from:l,to:c}),a.added.push({from:c,to:c});else{const h=collapseSpan(l,e,t,i,s,o);a.removed.push({from:l,to:h})}}function alignSpanToContainingSpan(t,e,i,s,n){const o=e[n.xValue0Index],a=i.data.find(m=>toAxisValue(m.xValue0)===o),r=e[n.xValue1Index],l=i.data.find(m=>toAxisValue(m.xValue1)===r);if(a==null||l==null)return;const[{x:c},{x:h}]=spanRange(t),d=scale(a.xValue0,i.scales.x),u=scale(a.yValue0,i.scales.y),p=scale(l.xValue1,i.scales.x),g=scale(l.yValue1,i.scales.y);let f=s.data[n.datumIndex].span;return f=rescaleSpan(f,{x:d,y:u},{x:p,y:g}),f=clipSpanX(f,c,h),f}function appendSpanPhases(t,e,i,s,n,o,a,r,l){const c=n+1,h=a.find(b=>b.xValue0Index<=n&&b.xValue1Index>=c),d=o.find(b=>b.xValue0Index<=n&&b.xValue1Index>=c),u=e.zeroData,p=t.zeroData;if(h==null&&d!=null){addSpan(t,i,o,d,u,r,l);return}else if(h!=null&&d==null){removeSpan(e,i,a,h,p,r,l);return}else if(h==null||d==null)return;let g;h.xValue0Index===d.xValue0Index&&h.xValue1Index===d.xValue1Index?g=0:h.xValue0Index<=d.xValue0Index&&h.xValue1Index>=d.xValue1Index?g=-1:h.xValue0Index>=d.xValue0Index&&h.xValue1Index<=d.xValue1Index?g=1:g=0;const f=e.data[h.datumIndex],m=clipSpan(f.span,n,h),y=t.data[d.datumIndex],x=clipSpan(y.span,n,d);if(g===1){const b=alignSpanToContainingSpan(m,s,e,t,d);b!=null?(l.removed.push({from:m,to:b}),l.moved.push({from:b,to:x}),l.added.push({from:x,to:x})):removeSpan(e,i,a,h,p,r,l)}else if(g===-1){const b=alignSpanToContainingSpan(x,s,t,e,h);b!=null?(l.removed.push({from:m,to:m}),l.moved.push({from:m,to:b}),l.added.push({from:b,to:x})):addSpan(t,i,o,d,u,r,l)}else l.removed.push({from:m,to:m}),l.moved.push({from:m,to:x}),l.added.push({from:x,to:x})}function phaseAnimation(t,e,i,s){const n={removed:[],moved:[],added:[]},{axisValues:o,oldDataAxisIndices:a,newDataAxisIndices:r}=t,l={xValue0Index:Math.max(a.at(0)?.xValue0Index??-1/0,r.at(0)?.xValue0Index??-1/0),xValue1Index:Math.min(a.at(-1)?.xValue1Index??1/0,r.at(-1)?.xValue1Index??1/0)};for(let c=0;c<o.length-1;c+=1)appendSpanPhases(e,i,s,o,c,r,a,l,n);return n}function resetSpan(t,e,i){const{span:s}=e;switch(i){case 0:return zeroDataSpan(e,t.zeroData)??axisZeroSpan(s,t);case 1:return collapseSpanToMidpoint(s)}}function resetAnimation(t,e,i){const s=[],n=[];for(const o of e.data){const a=o.span,r=resetSpan(e,o,i);n.push({from:a,to:r})}for(const o of t.data){const a=o.span,r=resetSpan(t,o,i);s.push({from:r,to:a})}return{removed:n,moved:[],added:s}}function pairUpSpans(t,e,i){if(!validateCategorySorting(t,e))return;const s=spanAxisContext(t,e);return s==null?resetAnimation(t,e,i):phaseAnimation(s,t,e,i)}function isContinuousScaling(t){return t.type==="continuous"||t.type==="log"}function isCategoryScaling(t){return t.type==="category"}function areScalingEqual(t,e){return t===void 0||e===void 0?t!==void 0||e!==void 0:isContinuousScaling(t)&&isContinuousScaling(e)?t.type===e.type&&arraysEqual(t.domain,e.domain)&&arraysEqual(t.range,e.range):isCategoryScaling(t)&&isCategoryScaling(e)?t.inset===e.inset&&t.step===e.step&&arraysEqual(t.domain,e.domain):!1}function isScaleValid(t){return t==null?!1:t.type==="category"?t.domain.every(e=>e!=null):t.domain.every(e=>Number.isFinite(e)||e instanceof Date)&&t.range.every(e=>Number.isFinite(e))}function interpolatePoints(t,e){let i;const s=t.map(n=>n.point);switch(e.type){case"linear":i=linearPoints(s);break;case"smooth":i=smoothPoints(s,e.tension);break;case"step":i=stepPoints(s,e.position);break}return i.map((n,o)=>({span:n,xValue0:t[o].xDatum,yValue0:t[o].yDatum,xValue1:t[o+1].xDatum,yValue1:t[o+1].yDatum}))}function pointsEq(t,e,i=.001){return Math.abs(t.x-e.x)<i&&Math.abs(t.y-e.y)<i}function plotLinePathStroke({path:t},e){let i;for(const{span:s}of e){const[n,o]=spanRange(s),a=i!=null&&pointsEq(i,n)?1:0;plotSpan(t,s,a,!1),i=o}}function plotInterpolatedLinePathStroke(t,e,i){let s;for(const n of i){const[o,a]=interpolatedSpanRange(n.from,n.to,t),r=s!=null&&pointsEq(s,o)?1:0;plotInterpolatedSpans(e.path,n.from,n.to,t,r,!1),s=a}}function prepareLinePathStrokeAnimationFns(t,e,i){const s=(r,l)=>plotInterpolatedLinePathStroke(r,l,e.removed),n=(r,l)=>plotInterpolatedLinePathStroke(r,l,e.moved),o=(r,l)=>plotInterpolatedLinePathStroke(r,l,e.added),a=prepareLinePathPropertyAnimation(t,i);return{status:t,path:{addPhaseFn:o,updatePhaseFn:n,removePhaseFn:s},pathProperties:a}}function prepareLinePathPropertyAnimation(t,e){const i=e==="none"?"updated":t,s={fromFn:n=>{let o;return t==="removed"?o={finish:{visible:!1}}:t==="added"?o={start:{visible:!0}}:o={},{phase:NODE_UPDATE_STATE_TO_PHASE_MAPPING[i],...o}},toFn:n=>({phase:NODE_UPDATE_STATE_TO_PHASE_MAPPING[i]})};return e==="fade"?{fromFn:n=>({opacity:t==="added"?0:n.opacity,...s.fromFn(n)}),toFn:n=>({opacity:t==="removed"?0:1,...s.toFn(n)})}:s}function prepareLinePathAnimation(t,e,i){const s=t.scales.x?.type==="category",n=e.scales.x?.type==="category";if(s!==n||!isScaleValid(t.scales.x)||!isScaleValid(e.scales.x)||t.strokeData==null||e.strokeData==null)return;let o="updated";e.visible&&!t.visible?o="removed":!e.visible&&t.visible&&(o="added");const a=pairUpSpans({scales:t.scales,data:t.strokeData.spans},{scales:e.scales,data:e.strokeData.spans},1);if(a==null)return;const r=prepareLinePathStrokeAnimationFns(o,a,"fade"),l=(i?.changed??!0)||!areScalingEqual(t.scales.x,e.scales.x)||!areScalingEqual(t.scales.y,e.scales.y)||o!=="updated";return{status:o,stroke:r,hasMotion:l}}function plotAreaPathFill({path:t},{spans:e,phantomSpans:i}){for(let s=0;s<e.length;s+=1){const{span:n}=e[s],o=i[s].span;plotSpan(t,n,0,!1),plotSpan(t,o,1,!0),t.closePath()}}function plotInterpolatedAreaSeriesFillSpans(t,{path:e},i,s){for(let n=0;n<i.length;n+=1){const o=i[n],a=s[n];plotInterpolatedSpans(e,o.from,o.to,t,0,!1),plotInterpolatedSpans(e,a.from,a.to,t,1,!0),e.closePath()}}function prepareAreaFillAnimationFns(t,e,i,s){const n=(l,c)=>plotInterpolatedAreaSeriesFillSpans(l,c,e.removed,i.removed),o=(l,c)=>plotInterpolatedAreaSeriesFillSpans(l,c,e.moved,i.moved),a=(l,c)=>plotInterpolatedAreaSeriesFillSpans(l,c,e.added,i.added),r=prepareLinePathPropertyAnimation(t,s);return{status:t,path:{addPhaseFn:a,updatePhaseFn:o,removePhaseFn:n},pathProperties:r}}function prepareAreaPathAnimation(t,e){const i=t.scales.x?.type==="category",s=e.scales.x?.type==="category";if(i!==s||!isScaleValid(t.scales.x)||!isScaleValid(e.scales.x))return;let n="updated";e.visible&&!t.visible?n="removed":!e.visible&&t.visible&&(n="added");const o=pairUpSpans({scales:t.scales,data:t.fillData.spans},{scales:e.scales,data:e.fillData.spans},0);if(o==null)return;const a=pairUpSpans({scales:t.scales,data:t.fillData.phantomSpans},{scales:e.scales,data:e.fillData.phantomSpans},0);if(a==null)return;const r=pairUpSpans({scales:t.scales,data:t.strokeData.spans,zeroData:t.fillData.phantomSpans},{scales:e.scales,data:e.strokeData.spans,zeroData:e.fillData.phantomSpans},0);if(r==null)return;const l="none",c=prepareAreaFillAnimationFns(n,o,a,l),h=prepareLinePathStrokeAnimationFns(n,r,l);return{status:n,fill:c,stroke:h}}function markerFadeInAnimation({id:t},e,i,...s){const n={phase:i?NODE_UPDATE_STATE_TO_PHASE_MAPPING[i]:"trailing"};staticFromToMotion(t,"markers",e,s,{opacity:0},{opacity:1},n),s.forEach(o=>o.cleanup())}function markerScaleInAnimation({id:t},e,...i){staticFromToMotion(t,"markers",e,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"}),i.forEach(s=>s.cleanup())}function markerSwipeScaleInAnimation({id:t,nodeDataDependencies:e},i,...s){const n=e.seriesRectWidth;fromToMotion(t,"markers",i,s,{fromFn:(r,l)=>{const c=l.midPoint?.x??n;let h=clamp(0,inverseEaseOut(c/n),1);return isNaN(h)&&(h=0),{scalingX:0,scalingY:0,delay:h,duration:QUICK_TRANSITION,phase:"initial"}},toFn:()=>({scalingX:1,scalingY:1})})}function resetMarkerFn(t){return{opacity:1,scalingX:1,scalingY:1}}function resetMarkerPositionFn(t,e){return{x:e.point?.x??NaN,y:e.point?.y??NaN,scalingCenterX:e.point?.x??NaN,scalingCenterY:e.point?.y??NaN}}function computeMarkerFocusBounds(t,{datumIndex:e}){const i=t.getNodeData();if(i===void 0)return;const s=i[e],{point:n}=s??{};if(s==null||n==null)return;const o=4+(n.focusSize??t.getFormattedMarkerStyle(s).size),a=o/2,r=s.point.x-a,l=s.point.y-a;return Transformable.toCanvas(t.contentGroup,new BBox(r,l,o,o))}function pathSwipeInAnimation({id:t,visible:e,nodeDataDependencies:i},s,...n){const{seriesRectWidth:o,seriesRectHeight:a}=i;staticFromToMotion(t,"path_properties",s,n,{clipX:0},{clipX:o},{phase:"initial",start:{clip:!0,clipY:a,visible:e},finish:{clip:!1,visible:e}})}function pathFadeInAnimation({id:t},e,i,s="add",...n){staticFromToMotion(t,e,i,n,{opacity:0},{opacity:1},{phase:s})}function buildResetPathFn(t){return e=>({visible:t.getVisible(),opacity:t.getOpacity(),clipScalingX:1,clip:!1})}function updateClipPath({nodeDataDependencies:t},e){const i=s=>isFinite(s)?s:0;e.clipX=i(t.seriesRectWidth),e.clipY=i(t.seriesRectHeight)}var CROSS_FILTER_AREA_FILL_OPACITY_FACTOR=.125,CROSS_FILTER_AREA_STROKE_OPACITY_FACTOR=.25,AreaSeries=class extends CartesianSeries{constructor(t){super({moduleCtx:t,directionKeys:DEFAULT_CARTESIAN_DIRECTION_KEYS,directionNames:DEFAULT_CARTESIAN_DIRECTION_NAMES,categoryKey:"xValue",pathsPerSeries:["fill","stroke"],pathsZIndexSubOrderOffset:[0,1e3],hasMarkers:!0,markerSelectionGarbageCollection:!1,pickModes:[2,0],animationResetFns:{path:buildResetPathFn({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:resetLabelFn,marker:(e,i)=>({...resetMarkerFn(e),...resetMarkerPositionFn(e,i)})},clipFocusBox:!1}),this.properties=new AreaSeriesProperties,this.connectsToYAxis=!0,this.backgroundGroup=new Group({name:`${this.id}-background`,zIndex:0}),this._isStacked=void 0}get pickModeAxis(){return"main"}renderToOffscreenCanvas(){return super.renderToOffscreenCanvas()||this.contextNodeData!=null&&(this.contextNodeData.fillData.spans.length>RENDER_TO_OFFSCREEN_CANVAS_THRESHOLD||this.contextNodeData.strokeData.spans.length>RENDER_TO_OFFSCREEN_CANVAS_THRESHOLD)}attachSeries(t,e,i){super.attachSeries(t,e,i),t.appendChild(this.backgroundGroup)}detachSeries(t,e,i){super.detachSeries(t,e,i),t?.removeChild(this.backgroundGroup)}attachPaths([t,e]){this.backgroundGroup.appendChild(t),this.contentGroup.appendChild(e),e.zIndex=-1}detachPaths([t,e]){this.backgroundGroup.removeChild(t),this.contentGroup.removeChild(e)}isStacked(){return(this.seriesGrouping?.stackCount??1)>1}setSeriesIndex(t){const e=this.isStacked();return!super.setSeriesIndex(t)&&this._isStacked===e?!1:(this._isStacked=e,e?(this.backgroundGroup.zIndex=[0,t],this.contentGroup.zIndex=[1,t,0]):(this.backgroundGroup.zIndex=[1,t,0,0],this.contentGroup.zIndex=[1,t,0,1]),!0)}async processData(t){if(this.data==null||!this.properties.isValid())return;const{data:e,visible:i,seriesGrouping:{groupIndex:s=this.id,stackCount:n=1}={}}=this,{xKey:o,yKey:a,yFilterKey:r,connectMissingData:l,normalizedTo:c}=this.properties,h=!this.ctx.animationManager.isSkipped(),d=this.axes.x?.scale,u=this.axes.y?.scale,{xScaleType:p,yScaleType:g}=this.getScaleInformation({xScale:d,yScale:u}),f={value:`area-stack-${s}-yValue`,values:`area-stack-${s}-yValues`,stack:`area-stack-${s}-yValue-stack`,marker:`area-stack-${s}-yValues-marker`},m=[];isDefined(c)&&m.push(normaliseGroupTo(Object.values(f),c)),h&&m.push(animationValidation());const y={invalidValue:null};(isDefined(c)||l)&&n>1&&(y.invalidValue=0),i||(y.forceValue=0),await this.requestDataModel(t,e,{props:[keyProperty(o,p,{id:"xValue"}),valueProperty(a,g,{id:"yValueRaw",...y}),...r!=null?[valueProperty(r,g,{id:"yFilterRaw"})]:[],...groupStackValueProperty(a,g,{id:"yValueStack",...y,groupId:f.stack}),valueProperty(a,g,{id:"yValue",...y,groupId:f.value}),...groupAccumulativeValueProperty(a,"window","current",{id:"yValueEnd",...y,groupId:f.values},g),...groupAccumulativeValueProperty(a,"normal","current",{id:"yValueCumulative",...y,groupId:f.marker},g),...m],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}xCoordinateRange(t,e){const{marker:i}=this.properties,s=this.axes.x.scale.convert(t),n=i.enabled?.5*i.size*e:0;return[s-n,s+n]}yCoordinateRange(t,e){const{marker:i}=this.properties,s=this.axes.y.scale.convert(t[0]),n=i.enabled?.5*i.size*e:0;return[s-n,s+n]}getSeriesDomain(t){const{processedData:e,dataModel:i,axes:s}=this;if(!e||!i)return[];const n=s.y;if(t==="x"){const a=i.resolveProcessedDataDefById(this,"xValue"),r=i.getDomain(this,"xValue","key",e);return a?.def.type==="key"&&a.def.valueType==="category"?r:fixNumericExtent(extent(r))}const o=this.domainForClippedRange("y",["yValueCumulative"],"xValue",!0);if(n instanceof LogAxis||n instanceof TimeAxis)return fixNumericExtent(o);{const a=Number.isFinite(o[1]-o[0])?[o[0]>0?0:o[0],o[1]<0?0:o[1]]:[];return fixNumericExtent(a)}}getSeriesRange(t,e){const[i,s]=this.domainForVisibleRange("y",["yValueCumulative"],"xValue",e,!0);return[Math.min(i,0),Math.max(s,0)]}getVisibleItems(t,e,i){return this.countVisibleItems("xValue",["yValueCumulative"],t,e,i)}createNodeData(){const{axes:t,data:e,processedData:i,dataModel:s}=this,n=t.x,o=t.y;if(!n||!o||!e||!s||i?.type!=="grouped"||!this.properties.isValid())return;const{yKey:a,xKey:r,yFilterKey:l,marker:c,label:h,fill:d,stroke:u,connectMissingData:p,interpolation:g}=this.properties,{scale:f}=n,{scale:m}=o,{isContinuousY:y}=this.getScaleInformation({xScale:f,yScale:m}),x=(f.bandwidth??0)/2,b=s.resolveKeysById(this,"xValue",i),S=s.resolveColumnById(this,"yValueEnd",i),v=s.resolveColumnById(this,"yValueRaw",i),I=s.resolveColumnById(this,"yValueCumulative",i),A=l!=null?s.resolveColumnById(this,"yFilterRaw",i):void 0,D=s.resolveColumnById(this,"yValueStack",i),T=(U,$,W)=>{let X;return(isDefined(this.properties.normalizedTo)?y&&isContinuous(W):!isNaN(W))&&(X=$),{x:f.convert(U)+x,y:m.convert(X),size:c.size}},k=[],w=[],{visibleSameStackCount:L}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);let O=!1;const{dataSources:F}=i,R=F.get(this.id)??[];for(const{datumIndex:U}of s.forEachGroupDatum(this,i)){const $=b[U];if($==null)return;const W=R[U],X=v[U],Z=I[U],q=S[U],Q=Number.isFinite(X),tt=T($,+Z,X),it=A!=null?A[U]===X:void 0;if(it===!1&&(O=!0),Q&&c&&w.push({series:this,itemId:a,datum:W,datumIndex:U,midPoint:{x:tt.x,y:tt.y},cumulativeValue:q,yValue:X,xValue:$,yKey:a,xKey:r,point:tt,fill:c.fill??d,stroke:c.stroke??u,strokeWidth:c.strokeWidth??this.getStrokeWidth(this.properties.strokeWidth),selected:it}),Q&&h){const J=this.getLabelText(h,{value:X,datum:W,xKey:r,yKey:a,xName:this.properties.xName,yName:this.properties.yName});k.push({series:this,itemId:a,datum:W,datumIndex:U,x:tt.x,y:tt.y,labelText:J})}}const E=U=>U.flatMap($=>Array.isArray($)?interpolatePoints($,g):new Array($.skip).fill(null)),_=(U,$)=>({point:{x:f.convert(U)+x,y:m.convert($)},xDatum:U,yDatum:$}),G=U=>{const $=[];for(const{datumIndexes:[W,X,Z]}of s.forEachGroupDatumTuple(this,i)){const q=b[X],Q=D[X],tt=Q[U],it=Number.isFinite(tt);if(p&&!it)continue;const J=W!=null?D[W]:void 0,at=Z!=null?D[Z]:void 0;let lt=0,nt=0;for(let et=0;et<=U;et+=1){const st=Q[et];if(Number.isFinite(st)){const rt=J==null||Number.isFinite(J[et]),ut=at==null||Number.isFinite(at[et]);rt&&(lt+=st),ut&&(nt+=st)}}const ot=$[$.length-1];if(!p&&(lt!==nt||!it))if(!it&&Array.isArray(ot)&&ot.length===1)$[$.length-1]={skip:1};else{const et=_(q,lt),st=_(q,nt);Array.isArray(ot)?ot.push(et):ot!=null&&(ot.skip+=1),$.push(it?[st]:{skip:0})}else{const et=p?tt:Math.max(lt,nt),st=_(q,et);Array.isArray(ot)?ot.push(st):ot!=null?(ot.skip+=1,$.push([st])):$.push([st])}}return E($)},B=this.seriesGrouping?.stackIndex??0,z=()=>{const U=Array.from(s.forEachGroupDatum(this,i),({datumIndex:$})=>{const W=b[$],Z=D[$][B];if(!(p&&!Number.isFinite(Z)))return _(W,0)}).filter($=>$!=null);return interpolatePoints(U,g)},P=G(B),V=P.map(()=>null);for(let U=B-1;U>=-1;U-=1){let $;for(let W=0;W<V.length;W+=1)V[W]==null&&($??($=U!==-1?G(U):z()),V[W]=$[W])}const j=P.map((U,$)=>U??V[$]),H=P.filter(U=>U!=null);return{itemId:a,fillData:{itemId:a,spans:j,phantomSpans:V},strokeData:{itemId:a,spans:H},labelData:k,nodeData:w,scales:this.calculateScaling(),visible:this.visible,stackVisible:L>0,crossFiltering:O}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(t){const{opacity:e,visible:i,animationEnabled:s}=t,[n,o]=t.paths,a=this.contextNodeData?.crossFiltering===!0,r=this.getStrokeWidth(this.properties.strokeWidth);o.setProperties({fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:1,stroke:this.properties.stroke,strokeWidth:r,strokeOpacity:this.properties.strokeOpacity*(a?CROSS_FILTER_AREA_STROKE_OPACITY_FACTOR:1),lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,opacity:e,visible:i||s});const l=getShapeFill(this.properties.fill,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults);applyShapeStyle(n,{fill:l,stroke:void 0,fillOpacity:this.properties.fillOpacity*(a?CROSS_FILTER_AREA_FILL_OPACITY_FACTOR:1)},void 0,this.getShapeFillBBox()),n.setProperties({lineJoin:"round",pointerEvents:1,fillShadow:this.properties.shadow,opacity:e,visible:i||s}),updateClipPath(this,o),updateClipPath(this,n)}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("AreaSeries")}updateFillPath(t,e){const[i]=t;i.path.clear(),plotAreaPathFill(i,e.fillData),i.markDirty("AreaSeries")}updateStrokePath(t,e){const{spans:i}=e.strokeData,[,s]=t;s.path.clear(),plotLinePathStroke(s,i),s.markDirty("AreaSeries")}updateMarkerSelection(t){const{nodeData:e,markerSelection:i}=t,s=this.properties.marker.enabled||this.contextNodeData?.crossFiltering===!0;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(s?e:[])}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,marker:o,fill:a,stroke:r,strokeWidth:l,fillOpacity:c,strokeOpacity:h,highlightStyle:d}=this.properties,u=this.getSeriesDomain("x"),p=this.getSeriesDomain("y"),g=mergeDefaults(i&&d.item,o.getStyle(),{fill:a,stroke:r,strokeWidth:l,fillOpacity:c,strokeOpacity:h}),f=this.getShapeFillBBox();e.each((m,y)=>{this.updateMarkerStyle(o,m,y.datum,y.point,datumStylerProperties(y,s,n,u,p),i,g,f,{selected:y.selected})}),i||this.properties.marker.markClean()}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e)}updateLabelNodes(t){const{labelSelection:e}=t,{enabled:i,fontStyle:s,fontWeight:n,fontSize:o,fontFamily:a,color:r}=this.properties.label;e.each((l,c)=>{const{x:h,y:d,labelText:u}=c;u&&i&&this.visible?(l.fontStyle=s,l.fontWeight=n,l.fontSize=o,l.fontFamily=a,l.textAlign="center",l.textBaseline="bottom",l.text=u,l.x=h,l.y=d-10,l.fill=r,l.visible=!0):l.visible=!1})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:o}=this,{xKey:a,xName:r,yKey:l,yName:c,tooltip:h,marker:d}=o,u=n.x,p=n.y;if(!i||!s||!u||!p)return;const g=s.dataSources.get(this.id)?.[t],f=i.resolveKeysById(this,"xValue",s)[t],m=i.resolveColumnById(this,"yValueRaw",s)[t],{xDomain:y,yDomain:x}=this.cachedDatumCallback("domain",()=>({xDomain:this.getSeriesDomain("x"),yDomain:this.getSeriesDomain("y")}));if(f==null)return;const b=d.getStyle(),S={datum:g,xValue:f,yValue:m},v=this.getMarkerStyle(d,g,datumStylerProperties(S,a,l,y,x),!1,void 0,b);return h.formatTooltip(this.properties,{heading:u.formatDatum(f),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:p.formatDatum(m)}]},{seriesId:e,datum:g,title:c,xKey:a,xName:r,yKey:l,yName:c,...v,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:t,stroke:e,fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:o,marker:a,fillGradientDefaults:r,fillPatternDefaults:l}=this.properties,c=!a.enabled||a.fill===void 0,h=c?getShapeFill(t,r,l):getShapeFill(a.fill,a.fillGradientDefaults,a.fillPatternDefaults);return{marker:{...this.getMarkerStyle(a,void 0,void 0,!1,void 0,{fill:h,fillOpacity:c?i:a.fillOpacity}),enabled:a.enabled||n<=0},line:{stroke:e,strokeOpacity:s,strokeWidth:n,lineDash:o}}}getLegendData(t){if(!this.properties.isValid()||t!=="category")return[];const{id:e,ctx:{legendManager:i},visible:s}=this,{yKey:n,yName:o,legendItemName:a,showInLegend:r}=this.properties;return[{legendType:t,id:e,itemId:n,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:a??o??n},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!r}]}animateEmptyUpdateReady(t){const{markerSelection:e,labelSelection:i,contextData:s,paths:n}=t,{animationManager:o}=this.ctx;this.updateAreaPaths(n,s),pathSwipeInAnimation(this,o,...n),resetMotion([e],resetMarkerPositionFn),markerSwipeScaleInAnimation(this,o,e),seriesLabelFadeInAnimation(this,"labels",o,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:s,contextData:n,paths:o,previousContextData:a}=t,[r,l]=o;if(r==null&&l==null)return;this.resetMarkerAnimation(t),this.resetLabelAnimation(t);const c=()=>{this.resetPathAnimation(t),this.updateAreaPaths(o,n)},h=()=>{e.skipCurrentBatch(),c()};if(n==null||a==null){c(),markerFadeInAnimation(this,e,"added",i),pathFadeInAnimation(this,"fill_path_properties",e,"add",r),pathFadeInAnimation(this,"stroke_path_properties",e,"add",l),seriesLabelFadeInAnimation(this,"labels",e,s);return}if(n.crossFiltering!==a.crossFiltering){h();return}const d=prepareAreaPathAnimation(n,a);if(d===void 0){h();return}else if(d.status==="no-op")return;markerFadeInAnimation(this,e,void 0,i),fromToMotion(this.id,"fill_path_properties",e,[r],d.fill.pathProperties),pathMotion(this.id,"fill_path_update",e,[r],d.fill.path),fromToMotion(this.id,"stroke_path_properties",e,[l],d.stroke.pathProperties),pathMotion(this.id,"stroke_path_update",e,[l],d.stroke.path),seriesLabelFadeInAnimation(this,"labels",e,s),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(o,n)})}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Group}getFormattedMarkerStyle(t){const{xKey:e,yKey:i}=t,s=this.getSeriesDomain("x"),n=this.getSeriesDomain("y");return this.getMarkerStyle(this.properties.marker,t.datum,datumStylerProperties(t,e,i,s,n),!0)}computeFocusBounds(t){return computeMarkerFocusBounds(this,t)}};AreaSeries.className="AreaSeries",AreaSeries.type="area";var numberFormatValidator=attachDescription(isValidNumberFormat,"a valid number format string"),commonCrossLineLabelOptionsDefs={enabled:boolean,text:string,padding:number,...fontOptionsDef},commonCrossLineOptionsDefs=attachDescription({enabled:boolean,type:required(union("line","range")),range:and(attachDescription((t,{options:e})=>e.type==="range","crossLine type to be 'range'"),arrayOf(defined),arrayLength(2,2)),value:and(attachDescription((t,{options:e})=>e.type==="line","crossLine type to be 'line'"),defined),label:commonCrossLineLabelOptionsDefs,fill:string,fillOpacity:ratio,...strokeOptionsDef,...lineDashOptionsDef},"cross-line options"),cartesianCrossLineOptionsDefs={...commonCrossLineOptionsDefs,label:{...commonCrossLineLabelOptionsDefs,position:union("top","left","right","bottom","top-left","top-right","bottom-left","bottom-right","inside","inside-left","inside-right","inside-top","inside-bottom","inside-top-left","inside-bottom-left","inside-top-right","inside-bottom-right"),rotation:number}},commonAxisLabelOptionsDefs={enabled:boolean,rotation:number,avoidCollisions:boolean,minSpacing:positiveNumber,spacing:positiveNumber,formatter:callback,itemStyler:callback,...fontOptionsDef},cartesianAxisLabelOptionsDefs={autoRotate:boolean,autoRotateAngle:number,...commonAxisLabelOptionsDefs},commonAxisOptionsDefs={reverse:boolean,gridLine:{enabled:boolean,width:positiveNumber,style:arrayOfDefs({stroke:color,lineDash:arrayOf(positiveNumber)},"a grid-line style object array")},interval:{values:arrayOf(defined),minSpacing:positiveNumber},label:commonAxisLabelOptionsDefs,line:{enabled:boolean,width:positiveNumber,stroke:color},tick:{enabled:boolean,width:positiveNumber,size:positiveNumber,stroke:color}};commonAxisOptionsDefs.context=defined,commonAxisOptionsDefs.layoutConstraints={stacked:required(boolean),align:required(union("start","end")),unit:required(union("percent","px")),width:required(positiveNumber)};var cartesianAxisOptionsDefs={...commonAxisOptionsDefs,keys:arrayOf(string),crossLines:arrayOfDefs(cartesianCrossLineOptionsDefs,"a cross-line options array"),position:union("top","right","bottom","left"),thickness:positiveNumber,title:{enabled:boolean,text:string,spacing:positiveNumber,formatter:callback,...fontOptionsDef}};function cartesianAxisCrosshairOptions(t){const e={enabled:boolean,xOffset:number,yOffset:number,renderer:callback};return t&&(e.format=string),{enabled:boolean,snap:boolean,label:e,...strokeOptionsDef,...lineDashOptionsDef}}function continuousAxisOptions(t,e){return{min:and(t,lessThan("max")),max:and(t,greaterThan("min")),nice:boolean,interval:{step:e?or(positiveNumberNonZero,or(positiveNumberNonZero,instanceOf(TimeInterval))):positiveNumberNonZero,values:arrayOf(t),minSpacing:and(positiveNumber,lessThan("maxSpacing")),maxSpacing:and(positiveNumber,greaterThan("minSpacing"))}}}var shapeValidator=or(union("circle","cross","diamond","heart","plus","pin","square","star","triangle"),callback),textWrapValidator=union("never","always","hyphenate","on-space"),tooltipPlacementValidator=union("top","right","bottom","left","top-right","bottom-right","bottom-left","top-left","center"),tooltipDeprecatedTypeValidator=union("pointer","node","top","right","bottom","left","top-left","top-right","bottom-left","bottom-right"),rangeValidator2=or(positiveNumber,union("exact","nearest")),zoomAnchorPoint=union("pointer","start","middle","end"),chartCaptionOptionsDefs={enabled:boolean,text:string,textAlign:union("left","center","right"),wrapping:union("never","always","hyphenate","on-space"),spacing:positiveNumber,maxWidth:positiveNumber,maxHeight:positiveNumber,...fontOptionsDef},chartOverlayOptionsDefs={enabled:boolean,text:string,renderer:callback},contextMenuActionsArray=arrayOfDefs({label:string,action:callback},"a context menu actions array"),toolbarButtonOptionsDefs={label:string,ariaLabel:string,tooltip:string,icon:union("align-center","align-left","align-right","arrow-drawing","arrow-down-drawing","arrow-up-drawing","callout-annotation","candlestick-series","close","comment-annotation","date-range-drawing","date-price-range-drawing","delete","disjoint-channel-drawing","drag-handle","fill-color","line-style-solid","line-style-dashed","line-style-dotted","high-low-series","hlc-series","hollow-candlestick-series","horizontal-line-drawing","line-color","line-series","line-with-markers-series","locked","measurer-drawing","note-annotation","ohlc-series","pan-end","pan-left","pan-right","pan-start","parallel-channel-drawing","position-bottom","position-center","position-top","price-label-annotation","price-range-drawing","reset","settings","step-line-series","text-annotation","trend-line-drawing","fibonacci-retracement-drawing","fibonacci-retracement-trend-based-drawing","unlocked","vertical-line-drawing","zoom-in","zoom-out")},commonChartOptionsDefs={width:positiveNumber,height:positiveNumber,minWidth:positiveNumber,minHeight:positiveNumber,suppressFieldDotNotation:boolean,title:chartCaptionOptionsDefs,subtitle:chartCaptionOptionsDefs,footnote:chartCaptionOptionsDefs,padding:{top:positiveNumber,right:positiveNumber,bottom:positiveNumber,left:positiveNumber},seriesArea:{clip:boolean,padding:{top:positiveNumber,right:positiveNumber,bottom:positiveNumber,left:positiveNumber}},legend:{enabled:boolean,position:union("top","right","bottom","left"),orientation:union("horizontal","vertical"),maxWidth:positiveNumber,maxHeight:positiveNumber,spacing:positiveNumber,preventHidingAll:boolean,reverseOrder:boolean,toggleSeries:boolean,item:{marker:{size:positiveNumber,shape:shapeValidator,padding:positiveNumber,strokeWidth:positiveNumber},line:{length:positiveNumber,strokeWidth:positiveNumber},label:{maxLength:positiveNumber,formatter:callback,...fontOptionsDef},maxWidth:positiveNumber,paddingX:positiveNumber,paddingY:positiveNumber,showSeriesStroke:boolean},pagination:{marker:{size:positiveNumber,shape:shapeValidator,padding:positiveNumber},activeStyle:{...fillOptionsDef,...strokeOptionsDef},inactiveStyle:{...fillOptionsDef,...strokeOptionsDef},highlightStyle:{...fillOptionsDef,...strokeOptionsDef},label:fontOptionsDef},listeners:{legendItemClick:callback,legendItemDoubleClick:callback}},gradientLegend:{enabled:boolean,position:union("top","right","bottom","left"),spacing:positiveNumber,reverseOrder:boolean,gradient:{preferredLength:positiveNumber,thickness:positiveNumber},scale:{label:{...fontOptionsDef,format:numberFormatValidator,formatter:callback},padding:positiveNumber,interval:{step:number,values:array,minSpacing:and(positiveNumber,lessThan("maxSpacing")),maxSpacing:and(positiveNumber,greaterThan("minSpacing"))}}},listeners:{seriesNodeClick:callback,seriesNodeDoubleClick:callback,seriesVisibilityChange:callback,click:callback,doubleClick:callback,annotations:callback,zoom:callback},highlight:{range:union("tooltip","node")},overlays:{loading:chartOverlayOptionsDefs,noData:chartOverlayOptionsDefs,noVisibleSeries:chartOverlayOptionsDefs,unsupportedBrowser:chartOverlayOptionsDefs},tooltip:{enabled:boolean,showArrow:boolean,pagination:boolean,delay:positiveNumber,range:rangeValidator2,wrapping:textWrapValidator,mode:union("single","shared","compact"),position:{type:tooltipDeprecatedTypeValidator,anchorTo:union("pointer","node","chart"),placement:or(tooltipPlacementValidator,arrayOf(tooltipPlacementValidator)),xOffset:number,yOffset:number}},animation:{enabled:boolean,duration:positiveNumber},contextMenu:{enabled:boolean,extraActions:contextMenuActionsArray,extraSeriesAreaActions:contextMenuActionsArray,extraNodeActions:contextMenuActionsArray,extraLegendItemActions:contextMenuActionsArray},dataSource:{getData:callback},keyboard:{enabled:boolean,tabIndex:number},touch:{dragAction:union("none","drag","hover")},ranges:{enabled:boolean,buttons:arrayOfDefs({...toolbarButtonOptionsDefs,value:or(number,and(arrayOf(or(number,date)),arrayLength(2,2)),callback)},"range button options array")},locale:{localeText:object,getLocaleText:callback},background:{visible:boolean,fill:color,image:{url:string,top:number,right:number,bottom:number,left:number,width:positiveNumber,height:positiveNumber,opacity:ratio}},sync:{enabled:boolean,groupId:string,axes:union("x","y","xy"),nodeInteraction:boolean,zoom:boolean},zoom:{enabled:boolean,enableAxisDragging:boolean,enableDoubleClickToReset:boolean,enablePanning:boolean,enableScrolling:boolean,enableSelecting:boolean,enableTwoFingerZoom:boolean,keepAspectRatio:boolean,anchorPointX:zoomAnchorPoint,anchorPointY:zoomAnchorPoint,axes:union("x","y","xy"),deceleration:or(union("off","short","long"),ratio),minVisibleItems:positiveNumber,minVisibleItemsX:positiveNumber,minVisibleItemsY:positiveNumber,panKey:union("alt","ctrl","meta","shift"),scrollingStep:ratio,autoScaling:{enabled:boolean,padding:ratio},buttons:{enabled:boolean,buttons:arrayOfDefs({...toolbarButtonOptionsDefs,value:union("reset","zoom-in","zoom-out","pan-left","pan-right","pan-start","pan-end"),section:string},"zoom button options array"),visible:union("always","zoomed","hover")}}};commonChartOptionsDefs.dataSource.requestThrottle=positiveNumber,commonChartOptionsDefs.dataSource.updateThrottle=positiveNumber,commonChartOptionsDefs.dataSource.updateDuringInteraction=boolean,commonChartOptionsDefs.zoom.enableIndependentAxes=boolean,commonChartOptionsDefs.statusBar=defined,commonChartOptionsDefs.foreground={visible:boolean,text:string,image:{url:string,top:number,right:number,bottom:number,left:number,width:positiveNumber,height:positiveNumber,opacity:ratio},...fillOptionsDef},commonChartOptionsDefs.overrideDevicePixelRatio=number;var commonSeriesOptionsDefs={id:string,cursor:string,visible:boolean,data:arrayOf(object),showInLegend:boolean,nodeClickRange:rangeValidator2,listeners:{nodeClick:callback,nodeDoubleClick:callback},highlightStyle:{item:{...fillOptionsDef,...strokeOptionsDef},series:{enabled:boolean,dimOpacity:ratio,strokeWidth:positiveNumber}}};commonSeriesOptionsDefs.context=defined,commonSeriesOptionsDefs.seriesGrouping=defined,commonSeriesOptionsDefs.highlight={enabled:boolean};var markerOptionsDefs={enabled:boolean,shape:shapeValidator,size:positiveNumber,itemStyler:callback,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},seriesLabelOptionsDefs={enabled:boolean,formatter:callback,...fontOptionsDef},autoSizedLabelOptionsDefs={...seriesLabelOptionsDefs,lineHeight:positiveNumber,minimumFontSize:positiveNumber,wrapping:textWrapValidator,overflowStrategy:union("ellipsis","hide")},errorBarOptionsDefs={visible:boolean,xLowerKey:string,xUpperKey:string,yLowerKey:string,yUpperKey:string,xLowerName:string,xUpperName:string,yLowerName:string,yUpperName:string,itemStyler:callback,cap:{visible:boolean,length:positiveNumber,lengthRatio:ratio,...strokeOptionsDef,...lineDashOptionsDef},...strokeOptionsDef,...lineDashOptionsDef},tooltipOptionsDefs={enabled:boolean,showArrow:boolean,range:rangeValidator2,renderer:callback,position:{type:tooltipDeprecatedTypeValidator,anchorTo:union("node","pointer","chart"),placement:or(tooltipPlacementValidator,arrayOf(tooltipPlacementValidator)),xOffset:number,yOffset:number},interaction:{enabled:boolean}};tooltipOptionsDefs.position._seriesOverrideType=tooltipDeprecatedTypeValidator;var shadowOptionsDefs={enabled:boolean,xOffset:number,yOffset:number,blur:positiveNumber,color},interpolationValidator=typeUnion({linear:{},smooth:{tension:ratio},step:{position:union("start","middle","end")}},"interpolation line options"),areaSeriesOptionsDef={type:required(constant("area")),xKey:required(string),yKey:required(string),xName:string,yName:string,stacked:boolean,stackGroup:string,normalizedTo:number,showInMiniChart:boolean,connectMissingData:boolean,interpolation:interpolationValidator,label:seriesLabelOptionsDefs,marker:markerOptionsDefs,tooltip:tooltipOptionsDefs,shadow:shadowOptionsDefs,...commonSeriesOptionsDefs,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},AreaSeriesModule={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"area",moduleFactory:t=>new AreaSeries(t),stackable:!0,tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{nodeClickRange:"nearest",tooltip:{position:{_seriesOverrideType:"node"}},fill:{$palette:"fill"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:FILL_PATTERN_DEFAULTS,stroke:{$palette:"stroke"},fillOpacity:.8,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:DEFAULT_SHADOW_COLOUR,xOffset:3,yOffset:3,blur:5},interpolation:{type:"linear"},marker:{enabled:!1,shape:"circle",size:7,strokeWidth:0,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:FILL_PATTERN_DEFAULTS},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}}}},NewAreaSeriesModule={type:"series",name:"area",chartType:"cartesian",options:areaSeriesOptionsDef,create:t=>new AreaSeries(t)};function addHitTestersToQuadtree(t,e){for(const i of e){const s=i.datum;s===void 0?logger_exports.error("undefined datum"):t.addValue(i,s)}}function findQuadtreeMatch(t,e){const{x:i,y:s}=e,{nearest:n,distanceSquared:o}=t.getQuadTree().find(i,s);if(n!==void 0)return{datum:n.value,distance:Math.sqrt(o)}}var AbstractBarSeriesProperties=class extends CartesianSeriesProperties{constructor(){super(...arguments),this.direction="vertical"}};__decorateClass2([TempValidate(DIRECTION)],AbstractBarSeriesProperties.prototype,"direction",2);var AbstractBarSeries=class extends CartesianSeries{constructor(){super(...arguments),this.groupScale=new CategoryScale,this.smallestDataInterval=void 0,this.largestDataInterval=void 0}padBandExtent(t,e){const i=typeof e=="boolean"?1:.5,s=isFiniteNumber(this.smallestDataInterval)?this.smallestDataInterval*i:0,n=extent(t)??[NaN,NaN];return typeof e=="boolean"?n[e?0:1]-=(e?1:-1)*s:(n[0]-=s,n[1]+=s),fixNumericExtent(n)}getBandScalePadding(){return{inner:.3,outer:.15}}shouldFlipXY(){return!this.isVertical()}isVertical(){return this.properties.direction==="vertical"}getBarDirection(){return this.shouldFlipXY()?"x":"y"}getCategoryDirection(){return this.shouldFlipXY()?"y":"x"}getValueAxis(){const t=this.getBarDirection();return this.axes[t]}getCategoryAxis(){const t=this.getCategoryDirection();return this.axes[t]}getBandwidth(t){return ContinuousScale.is(t.scale)?t.scale.calcBandwidth(this.smallestDataInterval):t.scale.bandwidth}xCoordinateRange(t){const e=this.axes[this.getCategoryDirection()],i=e.scale,s=this.getBandwidth(e)??0,n=ContinuousScale.is(i)?s*-.5:0,o=i.convert(t)+n;return[o,o+s]}yCoordinateRange(t){const i=this.axes[this.getBarDirection()].scale,s=t.map(n=>i.convert(n));if(s.length===1){const n=i.convert(0);return[Math.min(s[0],n),Math.max(s[0],n)]}return[Math.min(...s),Math.max(...s)]}updateGroupScale(t){const e=[],{groupScale:i}=this,s=this.getBandwidth(t),{index:n,visibleGroupCount:o}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);for(let r=0;r<o;r++)e.push(String(r));return i.domain=e,i.range=[0,s??0],t instanceof GroupedCategoryAxis?i.paddingInner=t.groupPaddingInner:t instanceof CategoryAxis?(i.paddingInner=t.groupPaddingInner,i.round=i.padding!==0):i.padding=0,{barWidth:i.bandwidth>=1?i.bandwidth:i.rawBandwidth,groupIndex:n}}resolveKeyDirection(t){return this.getBarDirection()==="x"?t==="x"?"y":"x":t}initQuadTree(t){addHitTestersToQuadtree(t,this.datumNodesIter())}pickNodeClosestDatum(t){return findQuadtreeMatch(this,t)}},BarSeriesLabel=class extends Label{constructor(){super(...arguments),this.placement="inside-center",this.padding=0}};__decorateClass2([TempValidate(UNION(["inside-center","inside-start","inside-end","outside-start","outside-end"],"a placement"))],BarSeriesLabel.prototype,"placement",2),__decorateClass2([TempValidate(NUMBER)],BarSeriesLabel.prototype,"padding",2);var BarSeriesProperties=class extends AbstractBarSeriesProperties{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new FillGradientDefaults,this.fillPatternDefaults=new FillPatternDefaults,this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.crisp=void 0,this.shadow=new DropShadow,this.label=new BarSeriesLabel,this.tooltip=new SeriesTooltip,this.sparklineMode=!1,this.fastDataProcessing=!1}};__decorateClass2([TempValidate(STRING)],BarSeriesProperties.prototype,"xKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],BarSeriesProperties.prototype,"xName",2),__decorateClass2([TempValidate(STRING)],BarSeriesProperties.prototype,"yKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],BarSeriesProperties.prototype,"yName",2),__decorateClass2([TempValidate(STRING,{optional:!0})],BarSeriesProperties.prototype,"yFilterKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],BarSeriesProperties.prototype,"stackGroup",2),__decorateClass2([TempValidate(NUMBER,{optional:!0})],BarSeriesProperties.prototype,"normalizedTo",2),__decorateClass2([TempValidate(OR(COLOR_GRADIENT,COLOR_PATTERN,COLOR_STRING))],BarSeriesProperties.prototype,"fill",2),__decorateClass2([TempValidate(OBJECT)],BarSeriesProperties.prototype,"fillGradientDefaults",2),__decorateClass2([TempValidate(OBJECT)],BarSeriesProperties.prototype,"fillPatternDefaults",2),__decorateClass2([TempValidate(RATIO)],BarSeriesProperties.prototype,"fillOpacity",2),__decorateClass2([TempValidate(COLOR_STRING)],BarSeriesProperties.prototype,"stroke",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],BarSeriesProperties.prototype,"strokeWidth",2),__decorateClass2([TempValidate(RATIO)],BarSeriesProperties.prototype,"strokeOpacity",2),__decorateClass2([TempValidate(LINE_DASH)],BarSeriesProperties.prototype,"lineDash",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],BarSeriesProperties.prototype,"lineDashOffset",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],BarSeriesProperties.prototype,"cornerRadius",2),__decorateClass2([TempValidate(BOOLEAN,{optional:!0})],BarSeriesProperties.prototype,"crisp",2),__decorateClass2([TempValidate(FUNCTION,{optional:!0})],BarSeriesProperties.prototype,"itemStyler",2),__decorateClass2([TempValidate(OBJECT,{optional:!0})],BarSeriesProperties.prototype,"shadow",2),__decorateClass2([TempValidate(OBJECT)],BarSeriesProperties.prototype,"label",2),__decorateClass2([TempValidate(OBJECT)],BarSeriesProperties.prototype,"tooltip",2),__decorateClass2([TempValidate(BOOLEAN)],BarSeriesProperties.prototype,"sparklineMode",2),__decorateClass2([TempValidate(BOOLEAN)],BarSeriesProperties.prototype,"fastDataProcessing",2);function checkCrisp(t,e,i,s){if(e!=null){const[n,o]=e;if(n!==0||o!==1)return!1}if(ContinuousScale.is(t)){const n=t.calcBandwidth(s)-t.calcBandwidth(i);if(n>0&&n<1)return!1}return!0}var isDatumNegative=t=>isNegative(t.yValue??0);function collapsedStartingBarPosition(t,e,i){const{startingX:s,startingY:n}=getStartingValues(t,e);return{isVertical:t,calculate:(a,r)=>{let l=t?a.x:s,c=t?n:a.y,h=t?a.width:0,d=t?0:a.height;const{opacity:u=1}=a;r&&(isNaN(l)||isNaN(c))&&({x:l,y:c}=r,h=t?r.width:0,d=t?0:r.height,t&&!isDatumNegative(r)?c+=r.height:!t&&isDatumNegative(r)&&(l+=r.width));let p;return a.clipBBox==null?p=void 0:isDatumNegative(a)?p=t?new BBox(l,c-d,h,d):new BBox(l-h,c,h,d):p=new BBox(l,c,h,d),{x:l,y:c,width:h,height:d,clipBBox:p,opacity:u}},mode:i}}function midpointStartingBarPosition(t,e){return{isVertical:t,calculate:i=>({x:t?i.x:i.x+i.width/2,y:t?i.y+i.height/2:i.y,width:t?i.width:0,height:t?0:i.height,clipBBox:i.clipBBox,opacity:i.opacity??1}),mode:e}}function prepareBarAnimationFunctions(t){const e=o=>o==null||isNaN(o.x)||isNaN(o.y);return{toFn:(o,a,r)=>r==="removed"&&o.datum==null&&t.mode==="fade"?{...resetBarSelectionsFn(o,a),opacity:0}:r==="removed"||e(a)?t.calculate(a,o.previousDatum):{x:a.x,y:a.y,width:a.width,height:a.height,clipBBox:a.clipBBox,opacity:a.opacity??1},fromFn:(o,a,r)=>{r==="updated"&&e(a)?r="removed":r==="updated"&&e(o.previousDatum)&&(r="added");let l;r==="added"&&o.previousDatum==null&&t.mode==="fade"?l={...resetBarSelectionsFn(o,a),opacity:0}:r==="unknown"||r==="added"?l=t.calculate(a,o.previousDatum):l={x:o.x,y:o.y,width:o.width,height:o.height,clipBBox:o.clipBBox,opacity:o.opacity??1};const c=NODE_UPDATE_STATE_TO_PHASE_MAPPING[r];return{...l,phase:c}},applyFn:(o,a,r)=>{o.setProperties(a),o.crisp=r==="end"&&(o.datum?.crisp??!1)}}}function getStartingValues(t,e){const i=e[t?"y":"x"];let s=1/0,n=0;return i?(t?n=i.scale.convert(ContinuousScale.is(i.scale)?0:Math.max(...i.range)):s=i.scale.convert(ContinuousScale.is(i.scale)?0:Math.min(...i.range)),{startingX:s,startingY:n}):{startingX:s,startingY:n}}function resetBarSelectionsFn(t,{x:e,y:i,width:s,height:n,clipBBox:o,opacity:a=1}){return{x:e,y:i,width:s,height:n,clipBBox:o,opacity:a,crisp:t.datum?.crisp??!1}}function computeBarFocusBounds(t,e){if(e===void 0)return;const{x:i,y:s,width:n,height:o}=e;return Transformable.toCanvas(t.contentGroup,new BBox(i,s,n,o))}function updateLabelNode(t,e,i){if(e.enabled&&i){const{x:s,y:n,text:o,textAlign:a,textBaseline:r}=i,{color:l,fontStyle:c,fontWeight:h,fontSize:d,fontFamily:u}=e;t.setProperties({visible:!0,x:s,y:n,text:o,fill:l,fontStyle:c,fontWeight:h,fontSize:d,fontFamily:u,textAlign:a,textBaseline:r})}else t.visible=!1}var placements={"inside-start":{inside:!0,direction:-1,textAlignment:1},"inside-end":{inside:!0,direction:1,textAlignment:-1},"outside-start":{inside:!1,direction:-1,textAlignment:-1},"outside-end":{inside:!1,direction:1,textAlignment:1}};function adjustLabelPlacement({isUpward:t,isVertical:e,placement:i,padding:s=0,rect:n}){let o=n.x+n.width/2,a=n.y+n.height/2,r="center",l="middle";if(i!=="inside-center"){const c=(t?1:-1)*(e?-1:1),{direction:h,textAlignment:d}=placements[i],u=(h+1)*.5;if(e){const p=t?n.y+n.height:n.y,g=n.height*c;a=p+g*u+s*d*c,l=d===c?"top":"bottom"}else{const p=t?n.x:n.x+n.width,g=n.width*c;o=p+g*u+s*d*c,r=d===c?"left":"right"}}return{x:o,y:a,textAlign:r,textBaseline:l}}var X_MIN=0,X_MAX=1,Y_MIN=2,Y_MAX=3,SPAN2=4,BarSeries=class extends AbstractBarSeries{constructor(t){super({moduleCtx:t,directionKeys:DEFAULT_CARTESIAN_DIRECTION_KEYS,directionNames:DEFAULT_CARTESIAN_DIRECTION_NAMES,categoryKey:"xValue",pickModes:[2,1,0],pathsPerSeries:[],hasHighlightedLabels:!0,datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:resetBarSelectionsFn,label:resetLabelFn}}),this.properties=new BarSeriesProperties,this.connectsToYAxis=!0,this.dataAggregationFilters=void 0}get pickModeAxis(){return this.properties.sparklineMode?"main":void 0}crossFilteringEnabled(){return this.properties.yFilterKey!=null&&(this.seriesGrouping==null||this.seriesGrouping.stackIndex===0)}async processData(t){if(!this.properties.isValid()||!this.data)return;const{xKey:e,yKey:i,yFilterKey:s,normalizedTo:n,fastDataProcessing:o}=this.properties,{seriesGrouping:{groupIndex:a=this.id}={},data:r}=this,l=this.seriesGrouping?.groupCount??0,h=(this.seriesGrouping?.stackCount??0)>=1||n!=null,d=!o||l>1||h,u=!this.ctx.animationManager.isSkipped(),p=this.getCategoryAxis()?.scale,g=this.getValueAxis()?.scale,{isContinuousX:f,xScaleType:m,yScaleType:y}=this.getScaleInformation({xScale:p,yScale:g}),x=`bar-stack-${a}-yValues`,b=`${x}-trailing`,S=this.visible?{}:{forceValue:0},v=[keyProperty(e,m,{id:"xValue"}),valueProperty(i,y,{id:"yValue-raw",invalidValue:null,...S})];this.crossFilteringEnabled()&&v.push(valueProperty(s,y,{id:"yFilterValue",invalidValue:null,...S})),h&&v.push(...groupAccumulativeValueProperty(i,"normal","current",{id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:x,separateNegative:!0,...S},y),...groupAccumulativeValueProperty(i,"trailing","current",{id:"yValue-start",invalidValue:null,missingValue:0,groupId:b,separateNegative:!0,...S},y)),f&&v.push(SMALLEST_KEY_INTERVAL,LARGEST_KEY_INTERVAL),isFiniteNumber(n)&&v.push(normaliseGroupTo([x,b],Math.abs(n))),u&&this.processedData&&v.push(diff(this.id,this.processedData)),(u||!d)&&v.push(animationValidation());const{dataModel:I,processedData:A}=await this.requestDataModel(t,r,{props:v,groupByKeys:d,groupByData:!d});this.dataAggregationFilters=this.aggregateData(I,A),this.smallestDataInterval=A.reduced?.smallestKeyInterval,this.largestDataInterval=A.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(i==null||e==null)return[];if(t===this.getCategoryDirection()){const a=i.resolveProcessedDataDefById(this,"xValue"),r=i.getDomain(this,"xValue","key",e);return a?.def.type==="key"&&a.def.valueType==="category"?r:this.padBandExtent(r)}const s=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw";let n=this.domainForClippedRange("y",[s],"xValue",!0);const o=this.crossFilteringEnabled()?i.getDomain(this,"yFilterValue","value",e):void 0;if(o!=null&&(n=[Math.min(n[0],o[0]),Math.max(n[1],o[1])]),this.getValueAxis()instanceof LogAxis)return fixNumericExtent(n);{const a=Number.isFinite(n[1]-n[0])?[Math.min(0,n[0]),Math.max(0,n[1])]:[];return fixNumericExtent(a)}}getSeriesRange(t,e){const i=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw",[s,n]=this.domainForVisibleRange("y",[i],"xValue",e,!0);return[Math.min(s,0),Math.max(n,0)]}getVisibleItems(t,e,i){const s=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw";return this.countVisibleItems("xValue",[s],t,e,i)}aggregateData(t,e){}createNodeData(){const{dataModel:t,processedData:e,groupScale:i,dataAggregationFilters:s}=this,n=this.getCategoryAxis(),o=this.getValueAxis();if(!t||!e||!n||!o||!this.properties.isValid())return;const a=e.dataSources?.get(this.id);if(a==null)return;const r=n.scale,l=o.scale,{xKey:c,yKey:h,xName:d,yName:u,legendItemName:p,label:g}=this.properties,f=o.isReversed(),{barWidth:m,groupIndex:y}=this.updateGroupScale(n),x=i.convert(String(y)),b=ContinuousScale.is(r)?m*-.5:0,S=t.resolveKeysById(this,"xValue",e),v=t.resolveColumnById(this,"yValue-raw",e),I=this.crossFilteringEnabled()?t.resolveColumnById(this,"yFilterValue",e):void 0,A=!this.ctx.animationManager.isSkipped(),D=z=>r.convert(S[z])+x+b,T=this.properties.crisp??checkCrisp(n?.scale,n?.visibleRange,this.smallestDataInterval,this.largestDataInterval),k=l.convert(0),w=({datum:z,datumIndex:P,valueIndex:V,xValue:j,yValue:H,cumulativeValue:Y,phantom:U,currY:$,prevY:W,x:X,width:Z,isPositive:q,yRange:Q,labelText:tt,opacity:it,crossScale:J=1})=>{const at=q!==f,lt=l.convert($),nt=l.convert(W),ot=l.convert(Q),et=this.getBarDirection()==="x",st=Z*.5*(1-J),rt={x:et?Math.min(lt,nt):X+st,y:et?X+st:Math.min(lt,nt),width:et?Math.abs(nt-lt):Z*J,height:et?Z*J:Math.abs(nt-lt)},ut=new BBox(rt.x,rt.y,rt.width,rt.height),pt={x:et?Math.min(k,ot):X+st,y:et?X+st:Math.min(k,ot),width:et?Math.abs(k-ot):Z*J,height:et?Z*J:Math.abs(k-ot)},yt=this.shouldFlipXY()?rt.height:rt.width;return{series:this,itemId:U?createDatumId(h,U):h,datum:z,datumIndex:P,valueIndex:V,cumulativeValue:Y,phantom:U,xValue:j,yValue:H,yKey:h,xKey:c,capDefaults:{lengthRatioMultiplier:yt,lengthMax:yt},x:pt.x,y:pt.y,width:pt.width,height:pt.height,midPoint:{x:rt.x+rt.width/2,y:rt.y+rt.height/2},opacity:it,topLeftCornerRadius:et!==at,topRightCornerRadius:at,bottomRightCornerRadius:et===at,bottomLeftCornerRadius:!at,clipBBox:ut,crisp:T,label:tt!=null?{text:tt,...adjustLabelPlacement({isUpward:at,isVertical:!et,placement:g.placement,padding:g.padding,rect:rt})}:void 0,missing:H==null,focusable:!U}},L=[],O=[],F=[],R=(z,P,V,j,H,Y,U,$)=>{const W=S[z];if(W==null)return;const X=v[z],Z=I!=null?Number(I[z]):void 0,q=X>=0&&!Object.is(X,-0);if(!Number.isFinite(Y)||Z!=null&&!Number.isFinite(Z))return;const Q=X!=null?this.getLabelText(this.properties.label,{datum:a[z],value:Z??X,xKey:c,yKey:h,xName:d,yName:u,legendItemName:p}):void 0,tt=Z!=null&&Z>X,it=w({datum:a[z],datumIndex:z,valueIndex:P,xValue:W,yValue:Z??X,cumulativeValue:Z??Y,phantom:!1,currY:Z!=null?H+Z:Y,prevY:H,x:V,width:j,isPositive:q,yRange:Math.max(H+(Z??-1/0),U),labelText:Q,opacity:$,crossScale:tt?.6:void 0});if(O.push(it),F.push(it),Z!=null){const J=w({datum:a[z],datumIndex:z,valueIndex:P,xValue:W,yValue:Z,cumulativeValue:Z,phantom:!0,currY:Y,prevY:H,x:V,width:j,isPositive:q,yRange:U,labelText:void 0,opacity:$,crossScale:void 0});L.push(J)}},[E,_]=r.range,G=_-E,B=s?.find(z=>z.maxRange>G);if(e.type==="grouped"){const z=m,P=t.hasColumnById(this,"yValue-start"),V=P?t.resolveColumnById(this,"yValue-start",e):void 0,j=P?t.resolveColumnById(this,"yValue-end",e):void 0,H=P?t.resolveProcessedDataIndexById(this,"yValue-range"):-1;for(const{datumIndex:Y,valueIndex:U,group:{aggregation:$}}of t.forEachGroupDatum(this,e)){const W=D(Y),X=v[Y],Z=X>=0&&!Object.is(X,-0),q=P?Number(V?.[Y]):0,Q=P?Number(j?.[Y]):X;let tt=Q;P&&(tt=$[H][Z?1:0]),R(Y,U,W,z,q,Q,tt,1)}}else if(B==null){const z=m;let[P,V]=this.visibleRange("xValue",n.range);e.input.count<1e3&&(P=0,V=e.input.count);for(let j=P;j<V;j+=1){const H=D(j),Y=Number(v[j]);R(j,0,H,z,0,Y,Y,1)}}else{const{indexData:z,indices:P}=B,[V,j]=this.visibleRange("xValue",n.range,P);for(let H=V;H<j;H+=1){const Y=H*SPAN2,U=z[Y+X_MIN],$=z[Y+X_MAX],W=z[Y+Y_MIN],X=z[Y+Y_MAX];if(U===-1)continue;const Z=D((U+$)/2|0),q=Math.abs(D($)-D(U))+m,Q=S[X]!=null?Number(v[X]):NaN,tt=S[W]!=null?Number(v[W]):NaN;if(Q>0){const it=tt>=0?tt/Q:1;R(X,0,Z,q,0,Q,Q,it)}if(tt<0){const it=Q<=0?Q/tt:1;R(W,1,Z,q,0,tt,tt,it)}}}return{itemId:h,nodeData:L.length>0?[...L,...O]:O,labelData:F,scales:this.calculateScaling(),visible:this.visible||A,groupScale:this.getScaling(this.groupScale)}}nodeFactory(){return new Rect}getHighlightData(t,e){const i=t.find(s=>s.datum===e.datum&&!s.phantom);return i!=null?[i]:void 0}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>this.getDatumId(e))}getItemBaseStyle(t){const{properties:e}=this,{cornerRadius:i,fillGradientDefaults:s,fillPatternDefaults:n}=e,o=t?e.highlightStyle.item:void 0;return getShapeStyle({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},s,n)}getItemStyleOverrides(t,e,i,s,n,o){const{id:a,properties:r}=this,{xKey:l,yKey:c,itemStyler:h,fillGradientDefaults:d,fillPatternDefaults:u}=r;if(h==null)return;const{xDomain:p,yDomain:g}=this.cachedDatumCallback("domain",()=>({xDomain:this.getSeriesDomain("x"),yDomain:this.getSeriesDomain("y")})),f=this.cachedDatumCallback(createDatumId(t,o?"highlight":"node"),()=>this.callWithContext(h,{seriesId:a,...datumStylerProperties(e,l,c,p,g),datum:e,xValue:i,yValue:s,highlighted:o,...n}));return getShapeStyle(f,d,u)}updateDatumNodes(t){if(!this.properties.isValid())return;const{shadow:e}=this.properties,i=this.getCategoryDirection()==="x",s=this.getItemBaseStyle(t.isHighlight),n=this.getShapeFillBBox();t.datumSelection.each((o,a)=>{const r=this.getItemStyleOverrides(String(a.datumIndex),a.datum,a.xValue,a.yValue,s,t.isHighlight);o.opacity=a.opacity??0,applyShapeStyle(o,s,r,n);const l=r?.cornerRadius??s.cornerRadius;o.topLeftCornerRadius=a.topLeftCornerRadius?l:0,o.topRightCornerRadius=a.topRightCornerRadius?l:0,o.bottomRightCornerRadius=a.bottomRightCornerRadius?l:0,o.bottomLeftCornerRadius=a.bottomLeftCornerRadius?l:0,o.visible=i?(a.clipBBox?.width??a.width)>0:(a.clipBBox?.height??a.height)>0,o.crisp=a.crisp,o.fillShadow=e})}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e,i=>{i.pointerEvents=1})}updateLabelNodes(t){t.labelSelection.each((e,i)=>{updateLabelNode(e,this.properties.label,i.label)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{xKey:o,xName:a,yKey:r,yName:l,legendItemName:c,stackGroup:h,tooltip:d}=n,u=this.getCategoryAxis(),p=this.getValueAxis();if(!i||!s||!u||!p)return;const g=s.dataSources.get(this.id)?.[t],f=i.resolveKeysById(this,"xValue",s)[t],m=i.resolveColumnById(this,"yValue-raw",s)[t];if(f==null)return;const y=this.getItemBaseStyle(!1);return Object.assign(y,this.getItemStyleOverrides(String(t),g,f,m,y,!1)),d.formatTooltip(this.properties,{heading:u.formatDatum(f),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:r,value:p.formatDatum(m)}]},{seriesId:e,datum:g,title:l,xKey:o,xName:a,yKey:r,yName:l,legendItemName:c,stackGroup:h,...y,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:t,stroke:e,strokeWidth:i,fillOpacity:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,fillGradientDefaults:r,fillPatternDefaults:l}=this.properties;return{marker:getShapeStyle({fill:t??"rgba(0, 0, 0, 0)",stroke:e??"rgba(0, 0, 0, 0)",fillOpacity:s,strokeOpacity:n,strokeWidth:i,lineDash:o,lineDashOffset:a},r,l)}}getLegendData(t){const{showInLegend:e}=this.properties;if(t!=="category"||!this.properties.isValid())return[];const{id:i,ctx:{legendManager:s},visible:n}=this,{yKey:o,yName:a,legendItemName:r}=this.properties;return[{legendType:"category",id:i,itemId:o,seriesId:i,enabled:n&&s.getItemEnabled({seriesId:i,itemId:o}),label:{text:r??a??o},symbol:this.legendItemSymbol(),legendItemName:r,hideInLegend:!e}]}animateEmptyUpdateReady({datumSelection:t,labelSelection:e,annotationSelections:i}){const s=prepareBarAnimationFunctions(collapsedStartingBarPosition(this.isVertical(),this.axes,"normal"));fromToMotion(this.id,"nodes",this.ctx.animationManager,[t],s),seriesLabelFadeInAnimation(this,"labels",this.ctx.animationManager,e),seriesLabelFadeInAnimation(this,"annotations",this.ctx.animationManager,...i)}animateWaitingUpdateReady(t){const{datumSelection:e,labelSelection:i,annotationSelections:s,previousContextData:n}=t;this.ctx.animationManager.stopByAnimationGroupId(this.id);let o=this.processedData?.reduced?.diff?.[this.id];o==null&&this.processedData?.reduced?.diff!=null&&(o={changed:!0,added:new Set(Array.from(e,({datum:h})=>this.getDatumId(h))),updated:new Set,removed:new Set,moved:new Set});const a=n==null?"fade":"normal",r=prepareBarAnimationFunctions(collapsedStartingBarPosition(this.isVertical(),this.axes,a));fromToMotion(this.id,"nodes",this.ctx.animationManager,[e],r,(h,d)=>this.getDatumId(d),o);const l=n!=null&&(!areScalingEqual(t.contextData.scales.x,n.scales.x)||!areScalingEqual(t.contextData.scales.y,n.scales.y)||!areScalingEqual(t.contextData.groupScale,t.previousContextData.groupScale));((o?.changed??!1)||l)&&(seriesLabelFadeInAnimation(this,"labels",this.ctx.animationManager,i),seriesLabelFadeInAnimation(this,"annotations",this.ctx.animationManager,...s))}getDatumId(t){return createDatumId(t.xValue,t.valueIndex,t.phantom)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){const e=this.contextNodeData?.nodeData[t].clipBBox;return computeBarFocusBounds(this,e)}};BarSeries.className="BarSeries",BarSeries.type="bar";var barSeriesOptionsDef={type:required(constant("bar")),xKey:required(string),yKey:required(string),xName:string,yName:string,direction:union("horizontal","vertical"),grouped:boolean,stacked:boolean,stackGroup:string,normalizedTo:number,legendItemName:string,showInMiniChart:boolean,cornerRadius:positiveNumber,itemStyler:callback,crisp:boolean,label:{...seriesLabelOptionsDefs,placement:union("inside-center","inside-start","inside-end","outside-start","outside-end"),padding:positiveNumber},errorBar:errorBarOptionsDefs,shadow:shadowOptionsDefs,tooltip:tooltipOptionsDefs,...commonSeriesOptionsDefs,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef};barSeriesOptionsDef.pickOutsideVisibleMinorAxis=boolean,barSeriesOptionsDef.fastDataProcessing=boolean,barSeriesOptionsDef.focusPriority=number,barSeriesOptionsDef.sparklineMode=boolean;var BarSeriesModule={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bar",moduleFactory:t=>new BarSeries(t),stackable:!0,groupable:!0,tooltipDefaults:{range:"exact"},defaultAxes:DIRECTION_SWAP_AXES,themeTemplate:{series:{direction:"vertical",fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:FILL_PATTERN_DEFAULTS,fillOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,label:{enabled:!1,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$if:[{$or:[{$eq:[{$path:"./placement"},"outside-start"]},{$eq:[{$path:"./placement"},"outside-end"]}]},{$ref:"textColor"},{$ref:"backgroundColor"}]},placement:"inside-center"},shadow:{enabled:!1,color:DEFAULT_SHADOW_COLOUR,xOffset:3,yOffset:3,blur:5},errorBar:{cap:{lengthRatio:.3}}}}},NewBarSeriesModule={type:"series",name:"bar",chartType:"cartesian",options:barSeriesOptionsDef,create:t=>new BarSeries(t)},BubbleSeriesMarker=class extends SeriesMarker{constructor(){super(...arguments),this.maxSize=30}};__decorateClass2([TempValidate(POSITIVE_NUMBER),SceneChangeDetection()],BubbleSeriesMarker.prototype,"maxSize",2),__decorateClass2([TempValidate(NUMBER_ARRAY,{optional:!0}),SceneChangeDetection()],BubbleSeriesMarker.prototype,"domain",2);var BubbleSeriesLabel=class extends Label{constructor(){super(...arguments),this.placement="top"}};__decorateClass2([TempValidate(LABEL_PLACEMENT)],BubbleSeriesLabel.prototype,"placement",2);var BubbleSeriesProperties=class extends CartesianSeriesProperties{constructor(){super(...arguments),this.label=new BubbleSeriesLabel,this.tooltip=new SeriesTooltip,this.marker=new BubbleSeriesMarker}};__decorateClass2([TempValidate(STRING)],BubbleSeriesProperties.prototype,"xKey",2),__decorateClass2([TempValidate(STRING)],BubbleSeriesProperties.prototype,"yKey",2),__decorateClass2([TempValidate(STRING)],BubbleSeriesProperties.prototype,"sizeKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],BubbleSeriesProperties.prototype,"labelKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],BubbleSeriesProperties.prototype,"xFilterKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],BubbleSeriesProperties.prototype,"yFilterKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],BubbleSeriesProperties.prototype,"sizeFilterKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],BubbleSeriesProperties.prototype,"xName",2),__decorateClass2([TempValidate(STRING,{optional:!0})],BubbleSeriesProperties.prototype,"yName",2),__decorateClass2([TempValidate(STRING,{optional:!0})],BubbleSeriesProperties.prototype,"sizeName",2),__decorateClass2([TempValidate(STRING,{optional:!0})],BubbleSeriesProperties.prototype,"labelName",2),__decorateClass2([TempValidate(STRING,{optional:!0})],BubbleSeriesProperties.prototype,"title",2),__decorateClass2([ProxyProperty("marker.shape")],BubbleSeriesProperties.prototype,"shape",2),__decorateClass2([ProxyProperty("marker.size")],BubbleSeriesProperties.prototype,"size",2),__decorateClass2([ProxyProperty("marker.maxSize")],BubbleSeriesProperties.prototype,"maxSize",2),__decorateClass2([ProxyProperty("marker.domain",{optional:!0})],BubbleSeriesProperties.prototype,"domain",2),__decorateClass2([ProxyProperty("marker.fillGradientDefaults")],BubbleSeriesProperties.prototype,"fillGradientDefaults",2),__decorateClass2([ProxyProperty("marker.fillPatternDefaults")],BubbleSeriesProperties.prototype,"fillPatternDefaults",2),__decorateClass2([ProxyProperty("marker.fill",{optional:!0})],BubbleSeriesProperties.prototype,"fill",2),__decorateClass2([ProxyProperty("marker.fillOpacity")],BubbleSeriesProperties.prototype,"fillOpacity",2),__decorateClass2([ProxyProperty("marker.stroke",{optional:!0})],BubbleSeriesProperties.prototype,"stroke",2),__decorateClass2([ProxyProperty("marker.strokeWidth")],BubbleSeriesProperties.prototype,"strokeWidth",2),__decorateClass2([ProxyProperty("marker.strokeOpacity")],BubbleSeriesProperties.prototype,"strokeOpacity",2),__decorateClass2([ProxyProperty("marker.lineDash")],BubbleSeriesProperties.prototype,"lineDash",2),__decorateClass2([ProxyProperty("marker.lineDashOffset")],BubbleSeriesProperties.prototype,"lineDashOffset",2),__decorateClass2([ProxyProperty("marker.itemStyler",{optional:!0})],BubbleSeriesProperties.prototype,"itemStyler",2),__decorateClass2([TempValidate(OBJECT)],BubbleSeriesProperties.prototype,"label",2),__decorateClass2([TempValidate(OBJECT)],BubbleSeriesProperties.prototype,"tooltip",2);var BubbleSeriesNodeEvent=class extends CartesianSeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.sizeKey=s.properties.sizeKey}},BubbleSeries=class extends CartesianSeries{constructor(t){super({moduleCtx:t,directionKeys:DEFAULT_CARTESIAN_DIRECTION_KEYS,directionNames:DEFAULT_CARTESIAN_DIRECTION_NAMES,categoryKey:void 0,pickModes:[2,1,0],pathsPerSeries:[],hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{label:resetLabelFn,marker:resetMarkerFn},usesPlacedLabels:!0,clipFocusBox:!1}),this.NodeEvent=BubbleSeriesNodeEvent,this.properties=new BubbleSeriesProperties,this.sizeScale=new LinearScale}get pickModeAxis(){return"main-category"}async processData(t){if(!this.properties.isValid()||this.data==null||!this.visible)return;const e=this.axes.x?.scale,i=this.axes.y?.scale,{xScaleType:s,yScaleType:n}=this.getScaleInformation({xScale:e,yScale:i}),o=this.sizeScale.type,{xKey:a,yKey:r,sizeKey:l,xFilterKey:c,yFilterKey:h,sizeFilterKey:d,labelKey:u,marker:p}=this.properties,{dataModel:g,processedData:f}=await this.requestDataModel(t,this.data,{props:[valueProperty(a,s,{id:"xValue"}),valueProperty(r,n,{id:"yValue"}),...c!=null?[valueProperty(c,s,{id:"xFilterValue"})]:[],...h!=null?[valueProperty(h,n,{id:"yFilterValue"})]:[],...d!=null?[valueProperty(d,o,{id:"sizeFilterValue"})]:[],valueProperty(l,o,{id:"sizeValue"}),...u?[valueProperty(u,"band",{id:"labelValue"})]:[]]}),m=g.resolveProcessedDataIndexById(this,"sizeValue");this.sizeScale.domain=p.domain??f.domain.values[m]??[],this.animationState.transition("updateData")}xCoordinateRange(t,e,i){const{properties:s,sizeScale:n}=this,{size:o,sizeKey:a}=s,r=this.axes.x.scale.convert(t),l=a!=null?this.dataModel.resolveColumnById(this,"sizeValue",this.processedData):void 0,h=.5*(l!=null?n.convert(l[i]):o)*e;return[r-h,r+h]}yCoordinateRange(t,e,i){const{properties:s,sizeScale:n}=this,{size:o,sizeKey:a}=s,r=this.axes.y.scale.convert(t[0]),l=a!=null?this.dataModel.resolveColumnById(this,"sizeValue",this.processedData):void 0,h=.5*(l!=null?n.convert(l[i]):o)*e;return[r-h,r+h]}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];const s={x:"xValue",y:"yValue"},n=s[t],o=e.resolveProcessedDataDefById(this,n),a=e.getDomain(this,n,"value",i);if(o?.def.type==="value"&&o?.def.valueType==="category")return a;const l=s[t==="x"?"y":"x"],c=this.domainForClippedRange(t,[n],l,!1);return fixNumericExtent(extent(c))}getSeriesRange(t,e){return this.domainForVisibleRange("y",["yValue"],"xValue",e,!1)}getVisibleItems(t,e,i){return this.countVisibleItems("xValue",["yValue"],t,e,i)}createNodeData(){const{axes:t,dataModel:e,processedData:i,sizeScale:s,visible:n}=this,{xKey:o,yKey:a,sizeKey:r,xFilterKey:l,yFilterKey:c,sizeFilterKey:h,labelKey:d,xName:u,yName:p,sizeName:g,labelName:f,label:m,marker:y}=this.properties,{placement:x}=m,b=Marker.anchor(y.shape),S=t.x,v=t.y;if(!(e&&i&&n&&S&&v))return;const I=e.resolveColumnById(this,"xValue",i),A=e.resolveColumnById(this,"yValue",i),D=r!=null?e.resolveColumnById(this,"sizeValue",i):void 0,T=d!=null?e.resolveColumnById(this,"labelValue",i):void 0,k=l!=null?e.resolveColumnById(this,"xFilterValue",i):void 0,w=c!=null?e.resolveColumnById(this,"yFilterValue",i):void 0,L=h!=null?e.resolveColumnById(this,"sizeFilterValue",i):void 0,O=S.scale,F=v.scale,R=(O.bandwidth??0)/2,E=(F.bandwidth??0)/2,_=[];s.range=[y.size,y.maxSize];const G=m.getFont(),B=CachedTextMeasurerPool.getMeasurer({font:G});return i.dataSources.get(this.id)?.forEach((z,P)=>{const V=I[P],j=A[P],H=D?.[P],Y=O.convert(V)+R,U=F.convert(j)+E;let $;k!=null&&w!=null&&($=k[P]===V&&w[P]===j,L!=null&&$&&($=L[P]===H));const W=this.getLabelText(m,{value:T!=null?T[P]:j,datum:z,xKey:o,yKey:a,sizeKey:r,labelKey:d,xName:u,yName:p,sizeName:g,labelName:f}),X=B.measureText(String(W)),Z=H!=null?s.convert(H):y.size;_.push({series:this,itemId:a,yKey:a,xKey:o,datum:z,datumIndex:P,xValue:V,yValue:j,sizeValue:H,point:{x:Y,y:U,size:Z},midPoint:{x:Y,y:U},label:{text:W,...X},anchor:b,placement:x,selected:$})}),{itemId:a,nodeData:_,labelData:_,scales:this.calculateScaling(),visible:this.visible}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}updateMarkerSelection(t){const{nodeData:e,markerSelection:i}=t;this.properties.marker.isDirty()&&(i.clear(),i.cleanup());const s=this.properties.marker.enabled?e:[];return i.update(s,void 0,n=>createDatumId([n.xValue,n.yValue,n.sizeValue,n.label.text]))}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,sizeKey:o,labelKey:a,marker:r}=this.properties,l=mergeDefaults(i&&this.properties.highlightStyle.item,r.getStyle());this.sizeScale.range=[r.size,r.maxSize];const c=this.getShapeFillBBox();e.each((h,d)=>{this.updateMarkerStyle(r,h,d.datum,d.point,{xKey:s,yKey:n,sizeKey:o,labelKey:a},i,l,c,{selected:d.selected})}),i||this.properties.marker.markClean()}updatePlacedLabelData(t){this.labelSelection.update(t.map(e=>({...e.datum,point:{x:e.x,y:e.y,size:e.datum.point.size}})),e=>{e.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(t){const{label:e}=this.properties;t.labelSelection.each((i,s)=>{i.text=s.label.text,i.fill=e.color,i.x=s.point?.x??0,i.y=s.point?.y??0,i.fontStyle=e.fontStyle,i.fontWeight=e.fontWeight,i.fontSize=e.fontSize,i.fontFamily=e.fontFamily,i.textAlign="left",i.textBaseline="top"})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:o}=this,{xKey:a,xName:r,yKey:l,yName:c,sizeKey:h,sizeName:d,labelKey:u,labelName:p,title:g,tooltip:f,marker:m}=o,y=n.x,x=n.y;if(!i||!s||!y||!x)return;const b=s.dataSources.get(this.id)?.[t],S=i.resolveColumnById(this,"xValue",s)[t],v=i.resolveColumnById(this,"yValue",s)[t],I=this.contextNodeData?.nodeData[t];if(S==null||I==null)return;const A=[{label:r,fallbackLabel:a,value:y.formatDatum(S)},{label:c,fallbackLabel:l,value:x.formatDatum(v)}];if(h!=null){const k=i.resolveColumnById(this,"sizeValue",s)[t];A.push({label:d,fallbackLabel:h,value:String(k)})}const D=m.getStyle(),T=this.getMarkerStyle(m,b,{xKey:a,yKey:l,sizeKey:h,labelKey:u,highlighted:!0},!1,void 0,D);return f.formatTooltip(this.properties,{title:g,symbol:this.legendItemSymbol(),data:A},{seriesId:e,datum:b,title:l,xKey:a,xName:r,yKey:l,yName:c,sizeKey:h,sizeName:d,labelKey:u,labelName:p,...T,...this.getModuleTooltipParams()})}legendItemSymbol(){return{marker:this.getMarkerStyle(this.properties.marker)}}getLegendData(){if(!this.properties.isValid())return[];const{id:t,ctx:{legendManager:e},visible:i}=this,{yKey:s,yName:n,title:o}=this.properties;return[{legendType:"category",id:t,itemId:s,seriesId:t,enabled:i&&e.getItemEnabled({seriesId:t,itemId:s}),label:{text:o??n??s},symbol:this.legendItemSymbol()}]}animateEmptyUpdateReady({markerSelection:t,labelSelection:e}){markerScaleInAnimation(this,this.ctx.animationManager,t),seriesLabelFadeInAnimation(this,"labels",this.ctx.animationManager,e)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Group}getFormattedMarkerStyle(t){const{xKey:e,yKey:i,sizeKey:s,labelKey:n,marker:o}=this.properties;return this.getMarkerStyle(o,t,{xKey:e,yKey:i,sizeKey:s,labelKey:n},!1,t.point.size)}computeFocusBounds(t){return computeMarkerFocusBounds(this,t)}};BubbleSeries.className="BubbleSeries",BubbleSeries.type="bubble";var bubbleSeriesOptionsDef={type:required(constant("bubble")),xKey:required(string),yKey:required(string),sizeKey:required(string),labelKey:string,xName:string,yName:string,sizeName:string,labelName:string,title:string,domain:arrayOf(number),maxSize:positiveNumber,showInMiniChart:boolean,label:{placement:union("top","right","bottom","left"),...seriesLabelOptionsDefs},tooltip:tooltipOptionsDefs,...commonSeriesOptionsDefs,...without(markerOptionsDefs,["enabled"])},BubbleSeriesModule={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bubble",moduleFactory:t=>new BubbleSeries(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{shape:"circle",size:7,maxSize:30,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:FILL_PATTERN_DEFAULTS,fillOpacity:.8,tooltip:{position:{_seriesOverrideType:"node"}},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}}}},NewBubbleSeriesModule={type:"series",name:"bubble",chartType:"cartesian",options:bubbleSeriesOptionsDef,create:t=>new BubbleSeries(t)},HistogramSeriesProperties=class extends CartesianSeriesProperties{constructor(){super(...arguments),this.fillGradientDefaults=new FillGradientDefaults,this.fillPatternDefaults=new FillPatternDefaults,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.areaPlot=!1,this.aggregation="sum",this.shadow=new DropShadow,this.label=new Label,this.tooltip=new SeriesTooltip}};__decorateClass2([TempValidate(STRING)],HistogramSeriesProperties.prototype,"xKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],HistogramSeriesProperties.prototype,"yKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],HistogramSeriesProperties.prototype,"xName",2),__decorateClass2([TempValidate(STRING,{optional:!0})],HistogramSeriesProperties.prototype,"yName",2),__decorateClass2([TempValidate(OR(COLOR_GRADIENT,COLOR_PATTERN,COLOR_STRING))],HistogramSeriesProperties.prototype,"fill",2),__decorateClass2([TempValidate(OBJECT)],HistogramSeriesProperties.prototype,"fillGradientDefaults",2),__decorateClass2([TempValidate(OBJECT)],HistogramSeriesProperties.prototype,"fillPatternDefaults",2),__decorateClass2([TempValidate(RATIO)],HistogramSeriesProperties.prototype,"fillOpacity",2),__decorateClass2([TempValidate(COLOR_STRING,{optional:!0})],HistogramSeriesProperties.prototype,"stroke",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],HistogramSeriesProperties.prototype,"strokeWidth",2),__decorateClass2([TempValidate(RATIO)],HistogramSeriesProperties.prototype,"strokeOpacity",2),__decorateClass2([TempValidate(LINE_DASH)],HistogramSeriesProperties.prototype,"lineDash",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],HistogramSeriesProperties.prototype,"lineDashOffset",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],HistogramSeriesProperties.prototype,"cornerRadius",2),__decorateClass2([TempValidate(BOOLEAN)],HistogramSeriesProperties.prototype,"areaPlot",2),__decorateClass2([TempValidate(ARRAY,{optional:!0})],HistogramSeriesProperties.prototype,"bins",2),__decorateClass2([TempValidate(UNION(["count","sum","mean"],"a histogram aggregation"))],HistogramSeriesProperties.prototype,"aggregation",2),__decorateClass2([TempValidate(POSITIVE_NUMBER,{optional:!0})],HistogramSeriesProperties.prototype,"binCount",2),__decorateClass2([TempValidate(OBJECT)],HistogramSeriesProperties.prototype,"shadow",2),__decorateClass2([TempValidate(OBJECT)],HistogramSeriesProperties.prototype,"label",2),__decorateClass2([TempValidate(OBJECT)],HistogramSeriesProperties.prototype,"tooltip",2);var defaultBinCount=10,HistogramSeries=class extends CartesianSeries{constructor(t){super({moduleCtx:t,directionKeys:DEFAULT_CARTESIAN_DIRECTION_KEYS,directionNames:DEFAULT_CARTESIAN_DIRECTION_NAMES,categoryKey:void 0,pickModes:[1,0],datumSelectionGarbageCollection:!1,animationResetFns:{datum:resetBarSelectionsFn,label:resetLabelFn}}),this.properties=new HistogramSeriesProperties,this.calculatedBins=[]}deriveBins(t){const e=createTicks(t[0],t[1],defaultBinCount),i=tickStep(t[0],t[1],defaultBinCount),[s]=e,n=o=>[o,o+i];return[[s-i,s],...e.map(n)]}calculateNiceBins(t,e){const i=Math.floor(t[0]),s=t[1],n=e||1,{start:o,binSize:a}=this.calculateNiceStart(i,s,n);return this.getBins(o,s,a,n)}getBins(t,e,i,s){const n=[],o=this.calculatePrecision(i);for(let a=0;a<s;a++){const r=Math.round((t+a*i)*o)/o;let l=Math.round((t+(a+1)*i)*o)/o;a===s-1&&(l=Math.max(l,e)),n[a]=[r,l]}return n}calculatePrecision(t){let e=10;if(isFinite(t)&&t>0)for(;t<1;)e*=10,t*=10;return e}calculateNiceStart(t,e,i){const s=Math.abs(e-t)/i,n=Math.floor(Math.log10(s)),o=Math.pow(10,n);return{start:Math.floor(t/o)*o,binSize:s}}async processData(t){this.visible||(this.processedData=void 0,this.animationState.transition("updateData"));const{xKey:e,yKey:i,areaPlot:s,aggregation:n}=this.properties,o=this.axes.x?.scale,a=this.axes.y?.scale,{xScaleType:r,yScaleType:l}=this.getScaleInformation({yScale:a,xScale:o}),c=[keyProperty(e,r),SORT_DOMAIN_GROUPS];if(i){let d=groupCount("groupAgg");n==="count"||(n==="sum"?d=groupSum("groupAgg"):n==="mean"&&(d=groupAverage("groupAgg"))),s&&(d=area("groupAgg",d)),c.push(valueProperty(i,l,{invalidValue:void 0}),d)}else{c.push(rowCountProperty("count"));let d=groupCount("groupAgg");s&&(d=area("groupAgg",d)),c.push(d)}const h=d=>{const u=fixNumericExtent(d.domain.keys[0]);if(u.length===0)return d.domain.groups=[],()=>[];const p=isNumber(this.properties.binCount)?this.calculateNiceBins(u,this.properties.binCount):this.properties.bins??this.deriveBins(u),g=p.length;return this.calculatedBins=[...p],f=>{let m=f[0];if(isDate(m)&&(m=m.getTime()),!isNumber(m))return[];for(let y=0;y<g;y++){const x=p[y];if(m>=x[0]&&m<x[1]||y===g-1&&m<=x[1])return x}return[]}};!this.ctx.animationManager.isSkipped()&&this.processedData&&c.push(diff(this.id,this.processedData,!1)),await this.requestDataModel(t,this.data,{props:c,groupByFn:h}),this.animationState.transition("updateData")}xCoordinateRange(){return[NaN,NaN]}yCoordinateRange(){return[NaN,NaN]}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!e||!i||!this.calculatedBins.length)return[];const s=i.getDomain(this,"groupAgg","aggregate",e),n=this.calculatedBins?.[0][0],o=this.calculatedBins?.[(this.calculatedBins?.length??0)-1][1];return fixNumericExtent(t==="x"?[n,o]:s)}getSeriesRange(t,[e,i]){const{dataModel:s,processedData:n}=this;if(!s||n?.type!=="grouped")return[NaN,NaN];const o=this.axes.x.scale,a=0;let r=-1/0;return n.groups.forEach(({keys:l,aggregation:c})=>{const[[h,d]=[0,0]]=c,[u,p]=l,[g,f]=findMinMax([o.convert(u),o.convert(p)]);if(f>=e&&g<=i){const m=h+d;r=Math.max(r,m)}}),a>r?[NaN,NaN]:[a,r]}createNodeData(){const{id:t,axes:e,processedData:i,dataModel:s}=this,n=e.x,o=e.y;if(!n||!o||!s)return;const{scale:a}=n,{scale:r}=o,{xKey:l,yKey:c,xName:h,yName:d}=this.properties,u=this.properties.label.formatter,p=[],g={itemId:this.properties.yKey??this.id,nodeData:p,labelData:p,scales:this.calculateScaling(),animationValid:!0,visible:this.visible};return!this.visible||i==null||i.type!=="grouped"||(i.groups.forEach((f,m)=>{const{keys:y,datumIndices:x,aggregation:b}=f,[[S,v]=[0,0]]=b,I=x.length,A=y,[D,T]=A,k=[...s.forEachDatum(this,i,f)],w=a.convert(D),L=a.convert(T),O=S+v,F=r.convert(0),R=r.convert(O),E=Math.abs(L-w),_=Math.abs(R-F),G=Math.min(w,L),B=Math.min(F,R);let z;O!==0&&(z={x:G+E/2,y:B+_/2,text:this.cachedDatumCallback(createDatumId(m,"label"),()=>u?.({value:O,datum:k,seriesId:t,xKey:l,yKey:c,xName:h,yName:d}))??o.formatDatum(O)});const P={x:G+E/2,y:B+_/2},V=o.isReversed();p.push({series:this,datumIndex:m,datum:k,aggregatedValue:O,frequency:I,domain:A,yKey:c,xKey:l,x:G,y:B,xValue:w,yValue:R,width:E,height:_,midPoint:P,topLeftCornerRadius:!V,topRightCornerRadius:!V,bottomRightCornerRadius:V,bottomLeftCornerRadius:V,label:z,crisp:!0})}),p.sort((f,m)=>f.x-m.x)),g}nodeFactory(){return new Rect}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t;return i.update(e,void 0,s=>s.domain.join("_"))}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return getShapeStyle({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},e.fillGradientDefaults,e.fillPatternDefaults)}updateDatumNodes(t){const{isHighlight:e}=t,{shadow:i}=this.properties,s=this.getItemBaseStyle(e),n=this.getShapeFillBBox();t.datumSelection.each((o,a)=>{const{cornerRadius:r}=s,{topLeftCornerRadius:l,topRightCornerRadius:c,bottomRightCornerRadius:h,bottomLeftCornerRadius:d}=a;applyShapeStyle(o,s,void 0,n),o.topLeftCornerRadius=l?r:0,o.topRightCornerRadius=c?r:0,o.bottomRightCornerRadius=h?r:0,o.bottomLeftCornerRadius=d?r:0,o.crisp=a.crisp,o.fillShadow=i,o.visible=a.height>0})}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e,s=>{s.pointerEvents=1,s.textAlign="center",s.textBaseline="middle"})}updateLabelNodes(t){const{fontStyle:e,fontWeight:i,fontFamily:s,fontSize:n,color:o}=this.properties.label,a=this.isLabelEnabled();t.labelSelection.each((r,l)=>{a&&l?.label?(r.text=l.label.text,r.x=l.label.x,r.y=l.label.y,r.fontStyle=e,r.fontWeight=i,r.fontFamily=s,r.fontSize=n,r.fill=o,r.visible=!0):r.visible=!1})}initQuadTree(t){const{value:e}=this.contentGroup.children().next();e&&addHitTestersToQuadtree(t,e.children())}pickNodeClosestDatum(t){return findQuadtreeMatch(this,t)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:o,ctx:{localeManager:a}}=this,{xKey:r,xName:l,yKey:c,yName:h,tooltip:d}=o,u=n.x,p=n.y;if(!i||s?.type!=="grouped"||!u||!p)return;const g=s.groups[t],{aggregation:f,datumIndices:m,keys:y}=g,[[x,b]=[0,0]]=f,S=m.length,v=y,[I,A]=v,D=x+b,T={data:[...i.forEachDatum(this,s,g)],aggregatedValue:D,frequency:S,domain:v},k=[{label:l,fallbackLabel:r,value:`${u.formatDatum(I)} - ${u.formatDatum(A)}`},{label:a.t("seriesHistogramTooltipFrequency"),value:p.formatDatum(S)}];if(c!=null){let w;switch(o.aggregation){case"sum":w=a.t("seriesHistogramTooltipSum",{yName:h??c});break;case"mean":w=a.t("seriesHistogramTooltipMean",{yName:h??c});break;case"count":w=a.t("seriesHistogramTooltipCount",{yName:h??c});break}k.push({label:w,value:p.formatDatum(D)})}return d.formatTooltip(this.properties,{symbol:this.legendItemSymbol(),data:k},{seriesId:e,datum:T,title:h,xKey:r,xName:l,yKey:c,yName:h,xRange:[I,A],frequency:S,...this.getItemBaseStyle(!1)})}legendItemSymbol(){const{fill:t,fillOpacity:e,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,fillGradientDefaults:r,fillPatternDefaults:l}=this.properties;return{marker:getShapeStyle({fill:t??"rgba(0, 0, 0, 0)",stroke:i??"rgba(0, 0, 0, 0)",fillOpacity:e,strokeOpacity:n,strokeWidth:s,lineDash:o,lineDashOffset:a},r,l)}}getLegendData(t){if(t!=="category")return[];const{id:e,ctx:{legendManager:i},visible:s}=this,{xKey:n,yName:o,showInLegend:a}=this.properties;return[{legendType:"category",id:e,itemId:n,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:o??n??"Frequency"},symbol:this.legendItemSymbol(),hideInLegend:!a}]}animateEmptyUpdateReady({datumSelection:t,labelSelection:e}){const i=prepareBarAnimationFunctions(collapsedStartingBarPosition(!0,this.axes,"normal"));fromToMotion(this.id,"datums",this.ctx.animationManager,[t],i),seriesLabelFadeInAnimation(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(t){const e=this.processedData?.reduced?.diff?.[this.id],i=prepareBarAnimationFunctions(collapsedStartingBarPosition(!0,this.axes,"normal"));fromToMotion(this.id,"datums",this.ctx.animationManager,[t.datumSelection],i,(s,n)=>createDatumId(n.domain),e),seriesLabelFadeInAnimation(this,"labels",this.ctx.animationManager,t.labelSelection)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){return computeBarFocusBounds(this,this.contextNodeData?.nodeData[t])}};HistogramSeries.className="HistogramSeries",HistogramSeries.type="histogram";var histogramSeriesOptionsDef={type:required(constant("histogram")),xKey:required(string),yKey:string,xName:string,yName:string,areaPlot:boolean,aggregation:union("count","sum","mean"),bins:arrayOf(arrayOf(number)),binCount:positiveNumber,showInMiniChart:boolean,cornerRadius:positiveNumber,label:seriesLabelOptionsDefs,tooltip:tooltipOptionsDefs,shadow:shadowOptionsDefs,...commonSeriesOptionsDefs,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},HistogramSeriesModule={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"histogram",moduleFactory:t=>new HistogramSeries(t),tooltipDefaults:{range:"exact"},defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:FILL_PATTERN_DEFAULTS,strokeWidth:1,fillOpacity:1,strokeOpacity:1,lineDash:[0],lineDashOffset:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}},shadow:{enabled:!1,color:DEFAULT_SHADOW_COLOUR,xOffset:3,yOffset:3,blur:5}}}},NewHistogramSeriesModule={type:"series",name:"histogram",chartType:"cartesian",enterprise:!0,options:histogramSeriesOptionsDef,create:t=>new HistogramSeries(t)},LineSeriesProperties=class extends CartesianSeriesProperties{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new InterpolationProperties,this.marker=new SeriesMarker,this.label=new Label,this.tooltip=new SeriesTooltip,this.connectMissingData=!1,this.sparklineMode=!1}};__decorateClass2([TempValidate(STRING)],LineSeriesProperties.prototype,"xKey",2),__decorateClass2([TempValidate(STRING)],LineSeriesProperties.prototype,"yKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],LineSeriesProperties.prototype,"xName",2),__decorateClass2([TempValidate(STRING,{optional:!0})],LineSeriesProperties.prototype,"yName",2),__decorateClass2([TempValidate(STRING,{optional:!0})],LineSeriesProperties.prototype,"yFilterKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],LineSeriesProperties.prototype,"stackGroup",2),__decorateClass2([TempValidate(POSITIVE_NUMBER,{optional:!0})],LineSeriesProperties.prototype,"normalizedTo",2),__decorateClass2([TempValidate(STRING,{optional:!0})],LineSeriesProperties.prototype,"title",2),__decorateClass2([TempValidate(COLOR_STRING)],LineSeriesProperties.prototype,"stroke",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],LineSeriesProperties.prototype,"strokeWidth",2),__decorateClass2([TempValidate(RATIO)],LineSeriesProperties.prototype,"strokeOpacity",2),__decorateClass2([TempValidate(LINE_DASH)],LineSeriesProperties.prototype,"lineDash",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],LineSeriesProperties.prototype,"lineDashOffset",2),__decorateClass2([TempValidate(OBJECT)],LineSeriesProperties.prototype,"interpolation",2),__decorateClass2([TempValidate(OBJECT)],LineSeriesProperties.prototype,"marker",2),__decorateClass2([TempValidate(OBJECT)],LineSeriesProperties.prototype,"label",2),__decorateClass2([TempValidate(OBJECT)],LineSeriesProperties.prototype,"tooltip",2),__decorateClass2([TempValidate(BOOLEAN)],LineSeriesProperties.prototype,"connectMissingData",2),__decorateClass2([TempValidate(BOOLEAN)],LineSeriesProperties.prototype,"sparklineMode",2);var CROSS_FILTER_LINE_STROKE_OPACITY_FACTOR=.25,LineSeries=class extends CartesianSeries{constructor(t){super({moduleCtx:t,directionKeys:DEFAULT_CARTESIAN_DIRECTION_KEYS,directionNames:DEFAULT_CARTESIAN_DIRECTION_NAMES,categoryKey:"xValue",hasMarkers:!0,pickModes:[2,1,0],markerSelectionGarbageCollection:!1,animationResetFns:{path:buildResetPathFn({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:resetLabelFn,marker:(e,i)=>({...resetMarkerFn(e),...resetMarkerPositionFn(e,i)})},clipFocusBox:!1}),this.properties=new LineSeriesProperties,this.dataAggregationFilters=void 0}get pickModeAxis(){return this.properties.sparklineMode?"main":"main-category"}async processData(t){if(this.data==null||!this.properties.isValid())return;const{data:e,visible:i,seriesGrouping:{groupIndex:s=this.id,stackCount:n=0}={}}=this,{xKey:o,yKey:a,yFilterKey:r,connectMissingData:l,normalizedTo:c}=this.properties,h=!this.ctx.animationManager.isSkipped(),d=this.axes.x?.scale,u=this.axes.y?.scale,{isContinuousX:p,xScaleType:g,yScaleType:f}=this.getScaleInformation({xScale:d,yScale:u}),m=n>=1||c!=null,y={invalidValue:null};l&&m&&(y.invalidValue=0),m&&!i&&(y.forceValue=0);const x=[];if((!p||m)&&x.push(keyProperty(o,g,{id:"xKey"})),x.push(valueProperty(o,g,{id:"xValue"}),valueProperty(a,f,{id:"yValueRaw",...y,invalidValue:void 0})),r!=null&&x.push(valueProperty(r,f,{id:"yFilterRaw"})),m){const v=[`line-stack-${s}-yValues`,`line-stack-${s}-yValues-trailing`,`line-stack-${s}-yValues-marker`];x.push(...groupAccumulativeValueProperty(a,"window","current",{id:"yValueEnd",...y,groupId:v[0]},f),...groupAccumulativeValueProperty(a,"window-trailing","current",{id:"yValueStart",...y,groupId:v[1]},f),...groupAccumulativeValueProperty(a,"normal","current",{id:"yValueCumulative",...y,groupId:v[2]},f)),isDefined(c)&&x.push(normaliseGroupTo([v[0],v[1],v[2]],c))}h&&(x.push(animationValidation(p?["xValue"]:void 0)),this.processedData&&x.push(diff(this.id,this.processedData)));const{dataModel:b,processedData:S}=await this.requestDataModel(t,e,{props:x,groupByKeys:m,groupByData:!m});this.dataAggregationFilters=this.aggregateData(b,S),this.animationState.transition("updateData")}xCoordinateRange(t,e){const{marker:i}=this.properties,s=this.axes.x.scale.convert(t),n=i.enabled?.5*i.size*e:0;return[s-n,s+n]}yCoordinateRange(t,e){const{marker:i}=this.properties,s=this.axes.y.scale.convert(t[0]),n=i.enabled?.5*i.size*e:0;return[s-n,s+n]}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!e||!i)return[];if(t==="x"){const o=e.resolveProcessedDataDefById(this,"xValue"),a=e.getDomain(this,"xValue","value",i);return o?.def.type==="value"&&o.def.valueType==="category"?a:fixNumericExtent(extent(a))}const s=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw",n=this.domainForClippedRange("y",[s],"xValue",!0);return fixNumericExtent(n)}getSeriesRange(t,e){const i=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw";return this.domainForVisibleRange("y",[i],"xValue",e,!0)}getVisibleItems(t,e,i){const s=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw";return this.countVisibleItems("xValue",[s],t,e,i)}aggregateData(t,e){}createNodeData(){const{dataModel:t,processedData:e,axes:i,dataAggregationFilters:s}=this,n=i.x,o=i.y;if(!t||!e||!n||!o)return;const{xKey:a,yKey:r,yFilterKey:l,xName:c,yName:h,marker:d,label:u,connectMissingData:p,interpolation:g,legendItemName:f}=this.properties,m=this.dataModel?.hasColumnById(this,"yValueEnd"),y=n.scale,x=o.scale,b=(y.bandwidth??0)/2,S=(x.bandwidth??0)/2,v=d.enabled?d.size:0,I=e.dataSources.get(this.id)??[],A=t.resolveColumnById(this,"xValue",e),D=t.resolveColumnById(this,"yValueRaw",e),T=m?t.resolveColumnById(this,"yValueEnd",e):void 0,k=m?t.resolveColumnById(this,"yValueCumulative",e):D,w=l!=null?t.resolveColumnById(this,"yFilterRaw",e):void 0,L=W=>y.convert(A[W])+b,O=W=>x.convert(k[W])+S,F={lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},R=[];let E;const _=W=>{const X=I[W],Z=A[W],q=D[W],Q=T?.[W],tt=w?.[W],it=L(W),J=O(W);if(!Number.isFinite(it))return;if(q!=null){const lt=u.enabled?this.getLabelText(u,{value:q,datum:X,xKey:a,yKey:r,xName:c,yName:h,legendItemName:f}):void 0;R.push({series:this,datum:X,datumIndex:W,yKey:r,xKey:a,point:{x:it,y:J,size:v},midPoint:{x:it,y:J},cumulativeValue:Q,yValue:q,xValue:Z,capDefaults:F,labelText:lt,selected:tt})}if(E==null)return;const at=E[E.length-1];if(q!=null){const lt={point:{x:it,y:J},xDatum:Z,yDatum:q};Array.isArray(at)?at.push(lt):at!=null?(at.skip+=1,E.push([lt])):E.push([lt])}else p||(Array.isArray(at)||at==null?E.push({skip:0}):at.skip+=1)},[G,B]=y.range,z=B-G,V=s?.find(W=>W.maxRange>z)?.indices;let[j,H]=this.visibleRange("xValue",n.range,V);j=Math.max(j-1,0),H=Math.min(H+1,V?.length??A.length),e.input.count<1e3&&(j=0,H=e.input.count),V==null&&(E=[]);for(let W=j;W<H;W+=1)_(V?.[W]??W);const Y=E?.flatMap(W=>Array.isArray(W)?interpolatePoints(W,g):[]),U=Y!=null?{itemId:r,spans:Y}:void 0,$=w?.some((W,X)=>W===D[X])??!1;return{itemId:r,nodeData:R,labelData:R,strokeData:U,scales:this.calculateScaling(),visible:this.visible,crossFiltering:$}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(t){const{paths:[e],opacity:i,visible:s,animationEnabled:n}=t,o=this.contextNodeData?.crossFiltering===!0;e.setProperties({fill:void 0,lineJoin:"round",pointerEvents:1,opacity:i,stroke:this.properties.stroke,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.properties.strokeOpacity*(o?CROSS_FILTER_LINE_STROKE_OPACITY_FACTOR:1),lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset}),n||(e.visible=s),updateClipPath(this,e)}getMarkerItemBaseStyle(t){const{properties:e}=this,{marker:i}=e,s=t?e.highlightStyle.item:void 0;return getShapeStyle({size:i.size,shape:i.shape,fill:s?.fill??i.fill,fillOpacity:s?.fillOpacity??i.fillOpacity,stroke:s?.stroke??i.stroke,strokeWidth:s?.strokeWidth??i.strokeWidth,strokeOpacity:s?.strokeOpacity??i.strokeOpacity,lineDash:s?.lineDash??i.lineDash,lineDashOffset:s?.lineDashOffset??i.lineDashOffset},i.fillGradientDefaults,i.fillPatternDefaults)}getMarkerItemStyleOverrides(t,e,i,s){const{id:n,properties:o}=this,{xKey:a,yKey:r,marker:l}=o,{itemStyler:c}=l;if(c!=null)return this.cachedDatumCallback(createDatumId(t,s?"highlight":"node"),()=>{const h=this.getSeriesDomain("x"),d=this.getSeriesDomain("y");return this.callWithContext(c,{seriesId:n,...datumStylerProperties(e,a,r,h,d),datum:e,highlighted:s,...i})})}updateMarkerSelection(t){let{nodeData:e}=t;const{markerSelection:i}=t;return e=this.properties.marker.enabled||this.contextNodeData?.crossFiltering===!0?e:[],this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(e,void 0,n=>createDatumId(n.xValue))}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,stroke:o,strokeWidth:a,strokeOpacity:r,marker:l,highlightStyle:c}=this.properties,h=this.getSeriesDomain("x"),d=this.getSeriesDomain("y"),u=mergeDefaults(i&&c.item,l.getStyle(),{stroke:o,strokeWidth:a,strokeOpacity:r}),p=this.ctx.animationManager.isSkipped(),g=this.getShapeFillBBox();e.each((f,m)=>{this.updateMarkerStyle(l,f,m.datum,m.point,datumStylerProperties(m,s,n,h,d),i,u,g,{applyTranslation:p,selected:m.selected})}),i||l.markClean()}updateLabelSelection(t){return t.labelSelection.update(this.isLabelEnabled()?t.labelData:[])}updateLabelNodes(t){const{enabled:e,fontStyle:i,fontWeight:s,fontSize:n,fontFamily:o,color:a}=this.properties.label;t.labelSelection.each((r,l)=>{e&&l?.labelText?(r.fontStyle=i,r.fontWeight=s,r.fontSize=n,r.fontFamily=o,r.textAlign="center",r.textBaseline="bottom",r.text=l.labelText,r.x=l.point.x,r.y=l.point.y-10,r.fill=a,r.visible=!0):r.visible=!1})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:o}=this,{xKey:a,xName:r,yKey:l,yName:c,tooltip:h}=o,d=n.x,u=n.y;if(!i||!s||!d||!u)return;const p=s.dataSources.get(this.id)?.[t],g=i.resolveColumnById(this,"xValue",s)[t],f=i.resolveColumnById(this,"yValueRaw",s)[t];if(g==null)return;const m=this.getMarkerItemBaseStyle(!1);return Object.assign(m,this.getMarkerItemStyleOverrides(String(t),p,m,!1)),h.formatTooltip(this.properties,{heading:d.formatDatum(g),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:u.formatDatum(f)}]},{seriesId:e,datum:p,title:c,xKey:a,xName:r,yKey:l,yName:c,...m,...this.getModuleTooltipParams()})}legendItemSymbol(){const t="rgba(0, 0, 0, 0)",{stroke:e,strokeOpacity:i,strokeWidth:s,lineDash:n,marker:o}=this.properties;return{marker:{...this.getMarkerStyle(o,void 0,void 0,!1,void 0,{fill:o.fill??t,stroke:o.stroke??e??t}),enabled:o.enabled},line:{stroke:e??t,strokeOpacity:i,strokeWidth:s,lineDash:n}}}getLegendData(t){if(!(this.properties.isValid()&&t==="category"))return[];const{id:e,ctx:{legendManager:i},visible:s}=this,{yKey:n,yName:o,title:a,legendItemName:r,showInLegend:l}=this.properties;return[{legendType:"category",id:e,itemId:n,legendItemName:r,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:r??a??o??n},symbol:this.legendItemSymbol(),hideInLegend:!l}]}updatePaths(t){this.updateLinePaths(t.paths,t.contextData)}plotNodeDataPoints(t,e){if(e.length===0)return;const i=e[0].point;t.moveTo(i.x,i.y);for(let s=1;s<e.length;s+=1){const{x:n,y:o}=e[s].point;t.lineTo(n,o)}}updateLinePaths(t,e){const i=e.strokeData?.spans,[s]=t;s.path.clear(),i!=null?plotLinePathStroke(s,i):this.plotNodeDataPoints(s.path,e.nodeData),s.markDirty("LineSeries")}animateEmptyUpdateReady(t){const{markerSelection:e,labelSelection:i,annotationSelections:s,contextData:n,paths:o}=t,{animationManager:a}=this.ctx;this.updateLinePaths(o,n),pathSwipeInAnimation(this,a,...o),resetMotion([e],resetMarkerPositionFn),markerSwipeScaleInAnimation(this,a,e),seriesLabelFadeInAnimation(this,"labels",a,i),seriesLabelFadeInAnimation(this,"annotations",a,...s)}animateReadyResize(t){const{contextData:e,paths:i}=t;this.updateLinePaths(i,e),super.animateReadyResize(t)}animateWaitingUpdateReady(t){const{animationManager:e}=this.ctx,{markerSelection:i,labelSelection:s,annotationSelections:n,contextData:o,paths:a,previousContextData:r}=t,[l]=a;this.resetMarkerAnimation(t),this.resetLabelAnimation(t);const c=()=>{this.resetPathAnimation(t),this.updateLinePaths(a,o)},h=()=>{e.skipCurrentBatch(),c()};if(o==null||r==null){c(),markerFadeInAnimation(this,e,"added",i),pathFadeInAnimation(this,"path_properties",e,"add",l),seriesLabelFadeInAnimation(this,"labels",e,s),seriesLabelFadeInAnimation(this,"annotations",e,...n);return}if(o.crossFiltering!==r.crossFiltering){h();return}const d=prepareLinePathAnimation(o,r,this.processedData?.reduced?.diff?.[this.id]);if(d===void 0){h();return}else if(d.status==="no-op")return;fromToMotion(this.id,"path_properties",e,[l],d.stroke.pathProperties),d.status==="added"?this.updateLinePaths(a,o):d.status==="removed"?this.updateLinePaths(a,r):pathMotion(this.id,"path_update",e,[l],d.stroke.path),d.hasMotion&&(markerFadeInAnimation(this,e,void 0,i),seriesLabelFadeInAnimation(this,"labels",e,s),seriesLabelFadeInAnimation(this,"annotations",e,...n))}isLabelEnabled(){return this.properties.label.enabled}getBandScalePadding(){return{inner:1,outer:.1}}nodeFactory(){return new Group}getFormattedMarkerStyle(t){const{xKey:e,yKey:i}=this.properties,s=this.getSeriesDomain("x"),n=this.getSeriesDomain("y");return this.getMarkerStyle(this.properties.marker,t.datum,datumStylerProperties(t,e,i,s,n),!0)}computeFocusBounds(t){return computeMarkerFocusBounds(this,t)}};LineSeries.className="LineSeries",LineSeries.type="line";var lineSeriesOptionsDef={type:constant("line"),xKey:required(string),yKey:required(string),xName:string,yName:string,title:string,stacked:boolean,stackGroup:string,normalizedTo:number,legendItemName:string,showInMiniChart:boolean,connectMissingData:boolean,interpolation:interpolationValidator,label:seriesLabelOptionsDefs,marker:markerOptionsDefs,tooltip:tooltipOptionsDefs,errorBar:errorBarOptionsDefs,...commonSeriesOptionsDefs,...strokeOptionsDef,...lineDashOptionsDef};lineSeriesOptionsDef.pickOutsideVisibleMinorAxis=boolean,lineSeriesOptionsDef.focusPriority=number,lineSeriesOptionsDef.sparklineMode=boolean;var LineSeriesModule={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"line",moduleFactory:t=>new LineSeries(t),stackable:!0,tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{tooltip:{position:{_seriesOverrideType:"node"}},stroke:SAFE_STROKE_FILL_OPERATION,strokeWidth:2,strokeOpacity:1,lineDash:[0],lineDashOffset:0,interpolation:{type:"linear"},marker:{shape:"circle",size:7,strokeWidth:0,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:FILL_PATTERN_DEFAULTS},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},errorBar:{cap:{lengthRatio:1}}}}},NewLineSeriesModule={type:"series",name:"line",chartType:"cartesian",options:lineSeriesOptionsDef,create:t=>new LineSeries(t)},ScatterSeriesLabel=class extends Label{constructor(){super(...arguments),this.placement="top"}};__decorateClass2([TempValidate(LABEL_PLACEMENT)],ScatterSeriesLabel.prototype,"placement",2);var ScatterSeriesProperties=class extends CartesianSeriesProperties{constructor(){super(...arguments),this.label=new ScatterSeriesLabel,this.tooltip=new SeriesTooltip,this.marker=new SeriesMarker}};__decorateClass2([TempValidate(STRING)],ScatterSeriesProperties.prototype,"xKey",2),__decorateClass2([TempValidate(STRING)],ScatterSeriesProperties.prototype,"yKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],ScatterSeriesProperties.prototype,"labelKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],ScatterSeriesProperties.prototype,"xFilterKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],ScatterSeriesProperties.prototype,"yFilterKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],ScatterSeriesProperties.prototype,"xName",2),__decorateClass2([TempValidate(STRING,{optional:!0})],ScatterSeriesProperties.prototype,"yName",2),__decorateClass2([TempValidate(STRING,{optional:!0})],ScatterSeriesProperties.prototype,"labelName",2),__decorateClass2([TempValidate(STRING,{optional:!0})],ScatterSeriesProperties.prototype,"title",2),__decorateClass2([ProxyProperty("marker.shape")],ScatterSeriesProperties.prototype,"shape",2),__decorateClass2([ProxyProperty("marker.size")],ScatterSeriesProperties.prototype,"size",2),__decorateClass2([ProxyProperty("marker.fill",{optional:!0})],ScatterSeriesProperties.prototype,"fill",2),__decorateClass2([ProxyProperty("marker.fillGradientDefaults")],ScatterSeriesProperties.prototype,"fillGradientDefaults",2),__decorateClass2([ProxyProperty("marker.fillPatternDefaults")],ScatterSeriesProperties.prototype,"fillPatternDefaults",2),__decorateClass2([ProxyProperty("marker.fillOpacity")],ScatterSeriesProperties.prototype,"fillOpacity",2),__decorateClass2([ProxyProperty("marker.stroke")],ScatterSeriesProperties.prototype,"stroke",2),__decorateClass2([ProxyProperty("marker.strokeWidth")],ScatterSeriesProperties.prototype,"strokeWidth",2),__decorateClass2([ProxyProperty("marker.strokeOpacity")],ScatterSeriesProperties.prototype,"strokeOpacity",2),__decorateClass2([ProxyProperty("marker.lineDash")],ScatterSeriesProperties.prototype,"lineDash",2),__decorateClass2([ProxyProperty("marker.lineDashOffset")],ScatterSeriesProperties.prototype,"lineDashOffset",2),__decorateClass2([ProxyProperty("marker.itemStyler",{optional:!0})],ScatterSeriesProperties.prototype,"itemStyler",2),__decorateClass2([TempValidate(OBJECT)],ScatterSeriesProperties.prototype,"label",2),__decorateClass2([TempValidate(OBJECT)],ScatterSeriesProperties.prototype,"tooltip",2);var ScatterSeries=class extends CartesianSeries{constructor(t){super({moduleCtx:t,directionKeys:DEFAULT_CARTESIAN_DIRECTION_KEYS,directionNames:DEFAULT_CARTESIAN_DIRECTION_NAMES,categoryKey:void 0,pickModes:[2,1,0],pathsPerSeries:[],hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{marker:resetMarkerFn,label:resetLabelFn},usesPlacedLabels:!0,clipFocusBox:!1}),this.properties=new ScatterSeriesProperties}get pickModeAxis(){return"main-category"}async processData(t){if(!this.properties.isValid()||this.data==null||!this.visible)return;const e=this.axes.x?.scale,i=this.axes.y?.scale,{xScaleType:s,yScaleType:n}=this.getScaleInformation({xScale:e,yScale:i}),{xKey:o,yKey:a,xFilterKey:r,yFilterKey:l,labelKey:c}=this.properties;await this.requestDataModel(t,this.data,{props:[valueProperty(o,s,{id:"xValue"}),valueProperty(a,n,{id:"yValue"}),...r!=null?[valueProperty(r,s,{id:"xFilterValue"})]:[],...l!=null?[valueProperty(l,n,{id:"yFilterValue"})]:[],...c?[valueProperty(c,"band",{id:"labelValue"})]:[]]}),this.animationState.transition("updateData")}xCoordinateRange(t,e){const i=this.axes.x.scale.convert(t),s=.5*this.properties.size*e;return[i-s,i+s]}yCoordinateRange(t,e){const i=this.axes.y.scale.convert(t[0]),s=.5*this.properties.size*e;return[i-s,i+s]}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];const s={x:"xValue",y:"yValue"},n=s[t],o=e.resolveProcessedDataDefById(this,n),a=e.getDomain(this,n,"value",i);if(o?.def.type==="value"&&o?.def.valueType==="category")return a;const l=s[t==="x"?"y":"x"],c=this.domainForClippedRange(t,[n],l,!1);return fixNumericExtent(extent(c))}getSeriesRange(t,e){return this.domainForVisibleRange("y",["yValue"],"xValue",e,!1)}getVisibleItems(t,e,i){return this.countVisibleItems("xValue",["yValue"],t,e,i)}createNodeData(){const{axes:t,dataModel:e,processedData:i,visible:s}=this,{xKey:n,yKey:o,xFilterKey:a,yFilterKey:r,labelKey:l,xName:c,yName:h,labelName:d,marker:u,label:p}=this.properties,{placement:g}=p,f=Marker.anchor(u.shape),m=t.x,y=t.y;if(!(e&&i&&s&&m&&y))return;const x=e.resolveColumnById(this,"xValue",i),b=e.resolveColumnById(this,"yValue",i),S=l!=null?e.resolveColumnById(this,"labelValue",i):void 0,v=a!=null?e.resolveColumnById(this,"xFilterValue",i):void 0,I=r!=null?e.resolveColumnById(this,"yFilterValue",i):void 0,A=m.scale,D=y.scale,T=(A.bandwidth??0)/2,k=(D.bandwidth??0)/2,w=[],L=p.getFont(),O=CachedTextMeasurerPool.getMeasurer({font:L});return(i.dataSources.get(this.id)??[]).forEach((R,E)=>{const _=x[E],G=b[E],B=A.convert(_)+T,z=D.convert(G)+k,P=v!=null&&I!=null?v[E]===_&&I[E]===G:void 0,V=this.getLabelText(p,{value:S!=null?S?.[E]:G,datum:R,xKey:n,yKey:o,labelKey:l,xName:c,yName:h,labelName:d}),j=O.measureText(V);w.push({series:this,itemId:o,yKey:o,xKey:n,datum:R,datumIndex:E,xValue:_,yValue:G,capDefaults:{lengthRatioMultiplier:u.getDiameter(),lengthMax:1/0},point:{x:B,y:z,size:u.size},midPoint:{x:B,y:z},label:{text:V,...j},anchor:f,placement:g,selected:P})}),{itemId:o,nodeData:w,labelData:w,scales:this.calculateScaling(),visible:this.visible}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}updateMarkerSelection(t){const{nodeData:e,markerSelection:i}=t;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(this.properties.marker.enabled?e:[])}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,labelKey:o,marker:a,highlightStyle:r}=this.properties,l=mergeDefaults(i&&r.item,a.getStyle()),c=this.getShapeFillBBox();e.each((h,d)=>{this.updateMarkerStyle(a,h,d.datum,d.point,{xKey:s,yKey:n,labelKey:o},i,l,c,{selected:d.selected})}),i||a.markClean()}updatePlacedLabelData(t){this.labelSelection.update(t.map(e=>({...e.datum,point:{x:e.x,y:e.y,size:e.datum.point.size}})),e=>{e.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(t){const{label:e}=this.properties;t.labelSelection.each((i,s)=>{i.text=s.label.text,i.fill=e.color,i.x=s.point?.x??0,i.y=s.point?.y??0,i.fontStyle=e.fontStyle,i.fontWeight=e.fontWeight,i.fontSize=e.fontSize,i.fontFamily=e.fontFamily,i.textAlign="left",i.textBaseline="top"})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:o}=this,{xKey:a,xName:r,yKey:l,yName:c,labelKey:h,labelName:d,title:u,tooltip:p,marker:g}=o,f=n.x,m=n.y;if(!i||!s||!f||!m)return;const y=s.dataSources.get(this.id)?.[t],x=i.resolveColumnById(this,"xValue",s)[t],b=i.resolveColumnById(this,"yValue",s)[t],S=this.contextNodeData?.nodeData[t];if(x==null||S==null)return;const v=this.getMarkerStyle(g,S.datum,{xKey:a,yKey:l,labelKey:h,highlighted:!0});return p.formatTooltip(this.properties,{symbol:this.legendItemSymbol(),title:u,data:[{label:r,fallbackLabel:a,value:f.formatDatum(x)},{label:c,fallbackLabel:l,value:m.formatDatum(b)}]},{seriesId:e,datum:y,title:c,xKey:a,xName:r,yKey:l,yName:c,labelKey:h,labelName:d,...v,...this.getModuleTooltipParams()})}legendItemSymbol(){return{marker:this.getMarkerStyle(this.properties.marker)}}getLegendData(t){if(!this.properties.isValid()||t!=="category")return[];const{yKey:e,yName:i,title:s,showInLegend:n}=this.properties,{id:o,ctx:{legendManager:a},visible:r}=this;return[{legendType:"category",id:o,itemId:e,seriesId:o,enabled:r&&a.getItemEnabled({seriesId:o,itemId:e}),label:{text:s??i??e},symbol:this.legendItemSymbol(),hideInLegend:!n}]}animateEmptyUpdateReady(t){const{markerSelection:e,labelSelection:i,annotationSelections:s}=t;markerScaleInAnimation(this,this.ctx.animationManager,e),seriesLabelFadeInAnimation(this,"labels",this.ctx.animationManager,i),seriesLabelFadeInAnimation(this,"annotations",this.ctx.animationManager,...s)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Group}getFormattedMarkerStyle(t){const{xKey:e,yKey:i,labelKey:s}=this.properties;return this.getMarkerStyle(this.properties.marker,t.datum,{xKey:e,yKey:i,labelKey:s},!0)}computeFocusBounds(t){return computeMarkerFocusBounds(this,t)}};ScatterSeries.className="ScatterSeries",ScatterSeries.type="scatter";var scatterSeriesOptionsDef={type:required(constant("scatter")),xKey:required(string),yKey:required(string),labelKey:string,xName:string,yName:string,labelName:string,title:string,showInMiniChart:boolean,label:{placement:union("top","right","bottom","left"),...seriesLabelOptionsDefs},tooltip:tooltipOptionsDefs,errorBar:errorBarOptionsDefs,...commonSeriesOptionsDefs,...without(markerOptionsDefs,["enabled"])},ScatterSeriesModule={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"scatter",moduleFactory:t=>new ScatterSeries(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{shape:"circle",size:7,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:FILL_PATTERN_DEFAULTS,fillOpacity:.8,tooltip:{position:{_seriesOverrideType:"node"}},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},errorBar:{cap:{lengthRatio:1}}}}},NewScatterSeriesModule={type:"series",name:"scatter",chartType:"cartesian",options:scatterSeriesOptionsDef,create:t=>new ScatterSeries(t)},SectorBox=class Gt{constructor(e,i,s,n){this.startAngle=e,this.endAngle=i,this.innerRadius=s,this.outerRadius=n}clone(){const{startAngle:e,endAngle:i,innerRadius:s,outerRadius:n}=this;return new Gt(e,i,s,n)}equals(e){return this.startAngle===e.startAngle&&this.endAngle===e.endAngle&&this.innerRadius===e.innerRadius&&this.outerRadius===e.outerRadius}[interpolate](e,i){return new Gt(this.startAngle*(1-i)+e.startAngle*i,this.endAngle*(1-i)+e.endAngle*i,this.innerRadius*(1-i)+e.innerRadius*i,this.outerRadius*(1-i)+e.outerRadius*i)}};function sectorBox({startAngle:t,endAngle:e,innerRadius:i,outerRadius:s}){let n=1/0,o=1/0,a=-1/0,r=-1/0;const l=(c,h)=>{n=Math.min(c,n),o=Math.min(h,o),a=Math.max(c,a),r=Math.max(h,r)};return l(i*Math.cos(t),i*Math.sin(t)),l(i*Math.cos(e),i*Math.sin(e)),l(s*Math.cos(t),s*Math.sin(t)),l(s*Math.cos(e),s*Math.sin(e)),isBetweenAngles(0,t,e)&&l(s,0),isBetweenAngles(Math.PI*.5,t,e)&&l(0,s),isBetweenAngles(Math.PI,t,e)&&l(-s,0),isBetweenAngles(Math.PI*1.5,t,e)&&l(0,-s),new BBox(n,o,a-n,r-o)}function isPointInSector(t,e,i){const s=Math.sqrt(Math.pow(t,2)+Math.pow(e,2)),{innerRadius:n,outerRadius:o}=i;if(i.startAngle===i.endAngle||s<Math.min(n,o)||s>Math.max(n,o))return!1;const a=normalizeAngle180(i.startAngle),r=normalizeAngle180(i.endAngle),l=Math.atan2(e,t);return a<r?l<=r&&l>=a:l<=r&&l>=-Math.PI||l>=a&&l<=Math.PI}function lineCollidesSector(t,e){const{startAngle:i,endAngle:s,innerRadius:n,outerRadius:o}=e,a={x:o*Math.cos(i),y:o*Math.sin(i)},r={x:o*Math.cos(s),y:o*Math.sin(s)},l=n===0?{x:0,y:0}:{x:n*Math.cos(i),y:n*Math.sin(i)},c=n===0?{x:0,y:0}:{x:n*Math.cos(s),y:n*Math.sin(s)};return segmentIntersection(t.start.x,t.start.y,t.end.x,t.end.y,a.x,a.y,l.x,l.y)||segmentIntersection(t.start.x,t.start.y,t.end.x,t.end.y,r.x,r.y,c.x,c.y)||arcIntersections(0,0,o,i,s,!0,t.start.x,t.start.y,t.end.x,t.end.y)}function boxCollidesSector(t,e){const i={x:t.x,y:t.y},s={x:t.x+t.width,y:t.y},n={x:t.x,y:t.y+t.height},o={x:t.x+t.width,y:t.y+t.height};return lineCollidesSector({start:i,end:s},e)||lineCollidesSector({start:n,end:o},e)}function radiiScalingFactor(t,e,i,s){if(i===0&&s===0)return 0;if(Math.asin(Math.abs(1*i)/(t+1*i))+Math.asin(Math.abs(1*s)/(t+1*s))-e<0)return 1;let o=0,a=1;for(let r=0;r<8;r+=1){const l=(o+a)/2;Math.asin(Math.abs(l*i)/(t+l*i))+Math.asin(Math.abs(l*s)/(t+l*s))-e<0?o=l:a=l}return o}var delta2=1e-6;function clockwiseAngle(t,e){return angleBetween(t,e)<delta2?e:normalizeAngle360(t-e)+e}function clockwiseAngles(t,e,i=0){const n=Math.abs(e-t)>=2*Math.PI?2*Math.PI:normalizeAngle360(e-t);return t=clockwiseAngle(t,i),e=t+n,{startAngle:t,endAngle:e}}function arcRadialLineIntersectionAngle(t,e,i,s,n,o){const a=Math.sin(o),r=Math.cos(o),l=t**2+e**2-i**2;let c,h,d,u;if(r>.5){const b=a/r,S=1+b**2,v=-2*(t+e*b),I=v**2-4*S*l;if(I<0)return;const A=(-v+Math.sqrt(I))/(2*S),D=(-v-Math.sqrt(I))/(2*S);c=A,h=A*b,d=D,u=D*b}else{const b=r/a,S=1+b**2,v=-2*(e+t*b),I=v**2-4*S*l;if(I<0)return;const A=(-v+Math.sqrt(I))/(2*S),D=(-v-Math.sqrt(I))/(2*S);c=A*b,h=A,d=D*b,u=D}const p=r,g=a,f=c*p+h*g,m=d*p+u*g,y=f>0?clockwiseAngle(Math.atan2(h-e,c-t),s):NaN,x=m>0?clockwiseAngle(Math.atan2(u-e,d-t),s):NaN;if(y>=s&&y<=n)return y;if(x>=s&&x<=n)return x}function arcCircleIntersectionAngle(t,e,i,s,n,o){const a=Math.hypot(t,e),r=(a**2-i**2+o**2)/(2*a),l=a-r,c=Math.atan2(e,t),h=Math.acos(-l/i),d=clockwiseAngle(c+h,s),u=clockwiseAngle(c-h,s);if(d>=s&&d<=n)return d;if(u>=s&&u<=n)return u}var Arc=class{constructor(t,e,i,s,n){this.cx=t,this.cy=e,this.r=i,this.a0=s,this.a1=n,this.a0>=this.a1&&(this.a0=NaN,this.a1=NaN)}isValid(){return Number.isFinite(this.a0)&&Number.isFinite(this.a1)}pointAt(t){return{x:this.cx+this.r*Math.cos(t),y:this.cy+this.r*Math.sin(t)}}clipStart(t){t==null||!this.isValid()||t<this.a0||(this.a0=t,(Number.isNaN(t)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}clipEnd(t){t==null||!this.isValid()||t>this.a1||(this.a1=t,(Number.isNaN(t)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}},Sector=class extends Path{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.innerRadius=10,this.outerRadius=20,this.startAngle=0,this.endAngle=Math.PI*2,this.clipSector=void 0,this.concentricEdgeInset=0,this.radialEdgeInset=0,this.startOuterCornerRadius=0,this.endOuterCornerRadius=0,this.startInnerCornerRadius=0,this.endInnerCornerRadius=0}set inset(t){this.concentricEdgeInset=t,this.radialEdgeInset=t}set cornerRadius(t){this.startOuterCornerRadius=t,this.endOuterCornerRadius=t,this.startInnerCornerRadius=t,this.endInnerCornerRadius=t}computeBBox(){return sectorBox(this).translate(this.centerX,this.centerY)}normalizedRadii(){const{concentricEdgeInset:t}=this;let{innerRadius:e,outerRadius:i}=this;return e=e>0?e+t:0,i=Math.max(i-t,0),{innerRadius:e,outerRadius:i}}normalizedClipSector(){const{clipSector:t}=this;if(t==null)return;const{startAngle:e,endAngle:i}=clockwiseAngles(this.startAngle,this.endAngle),{innerRadius:s,outerRadius:n}=this.normalizedRadii(),o=clockwiseAngles(t.startAngle,t.endAngle,e);return new SectorBox(Math.max(e,o.startAngle),Math.min(i,o.endAngle),Math.max(s,t.innerRadius),Math.min(n,t.outerRadius))}getAngleOffset(t){return t>0?this.radialEdgeInset/t:0}arc(t,e,i,s,n,o,a,r){if(t<=0)return;const{startAngle:l,endAngle:c}=clockwiseAngles(this.startAngle,this.endAngle),{innerRadius:h,outerRadius:d}=this.normalizedRadii(),u=this.normalizedClipSector();if(r&&h<=0)return;const p=r?this.getAngleOffset(h+t):this.getAngleOffset(d-t),g=a?l+p+e:c-p-e,f=r?h+t:d-t,m=f*Math.cos(g),y=f*Math.sin(g);if(u!=null&&(!a&&!(g>=l-1e-6&&g<=u.endAngle-1e-6)||a&&!(g>=u.startAngle+1e-6&&g<=c-1e-6)||r&&f<u.innerRadius-1e-6||!r&&f>u.outerRadius+1e-6))return;const x=new Arc(m,y,t,i,s);if(u!=null){r?(x.clipStart(arcRadialLineIntersectionAngle(m,y,t,i,s,u.endAngle)),x.clipEnd(arcRadialLineIntersectionAngle(m,y,t,i,s,u.startAngle))):(x.clipStart(arcRadialLineIntersectionAngle(m,y,t,i,s,u.startAngle)),x.clipEnd(arcRadialLineIntersectionAngle(m,y,t,i,s,u.endAngle)));let A,D;if(a?(A=arcCircleIntersectionAngle(m,y,t,i,s,u.innerRadius),D=arcCircleIntersectionAngle(m,y,t,i,s,u.outerRadius)):(A=arcCircleIntersectionAngle(m,y,t,i,s,u.outerRadius),D=arcCircleIntersectionAngle(m,y,t,i,s,u.innerRadius)),x.clipStart(A),x.clipEnd(D),A!=null){const{x:T,y:k}=x.pointAt(A),w=clockwiseAngle(Math.atan2(k,T),l);a?o?.clipStart(w):n.clipEnd(w)}if(D!=null){const{x:T,y:k}=x.pointAt(D),w=clockwiseAngle(Math.atan2(k,T),l);a?n.clipStart(w):o?.clipEnd(w)}}if(u!=null){const{x:A,y:D}=x.pointAt((x.a0+x.a1)/2);if(!isPointInSector(A,D,u))return}const{x:b,y:S}=x.pointAt(a===r?x.a0:x.a1),v=clockwiseAngle(Math.atan2(S,b),l),I=r?o:n;return a?I?.clipStart(v):I?.clipEnd(v),x}updatePath(){const{path:e,centerX:i,centerY:s,concentricEdgeInset:n,radialEdgeInset:o}=this;let{startOuterCornerRadius:a,endOuterCornerRadius:r,startInnerCornerRadius:l,endInnerCornerRadius:c}=this;const{startAngle:h,endAngle:d}=clockwiseAngles(this.startAngle,this.endAngle),{innerRadius:u,outerRadius:p}=this.normalizedRadii(),g=this.normalizedClipSector(),f=d-h,m=f>=2*Math.PI-1e-6;if(e.clear(),u===0&&p===0||u>p)return;if((g?.startAngle??h)===(g?.endAngle??d))return;if(m&&this.clipSector==null&&a===0&&r===0&&l===0&&c===0){e.moveTo(i+p*Math.cos(h),s+p*Math.sin(h)),e.arc(i,s,p,h,d),u>n&&(e.moveTo(i+u*Math.cos(d),s+u*Math.sin(d)),e.arc(i,s,u,d,h,!0)),e.closePath();return}else if(this.clipSector==null&&Math.abs(u-p)<1e-6){e.arc(i,s,p,h,d,!1),e.arc(i,s,p,d,h,!0),e.closePath();return}const y=this.getAngleOffset(u),x=this.getAngleOffset(p);if(f<2*x)return;const S=(g?.innerRadius??u)>n,v=u<n||f<2*y,I=p-u,A=Math.max(a,l,r,c),D=A>0?Math.min(I/A,1):1;a*=D,r*=D,l*=D,c*=D;const T=radiiScalingFactor(p,f-2*x,-a,-r);if(a*=T,r*=T,!v&&S){const W=radiiScalingFactor(u,f-2*y,l,c);l*=W,c*=W}else l=0,c=0;const k=Math.max(a+l,r+c),w=k>0?Math.min(I/k,1):1;a*=w,r*=w,l*=w,c*=w;let L=0,O=0;const F=a/(p-a),R=r/(p-r);if(F>=0&&F<1-1e-6)L=Math.asin(F);else{L=f/2;const W=p/(1/Math.sin(L)+1);a=Math.min(W,a)}if(R>=0&&R<1-1e-6)O=Math.asin(R);else{O=f/2;const W=p/(1/Math.sin(O)+1);r=Math.min(W,r)}const E=Math.asin(l/(u+l)),_=Math.asin(c/(u+c)),G=g?.outerRadius??p,B=this.getAngleOffset(G),z=new Arc(0,0,G,h+B,d-B),P=g?.innerRadius??u,V=this.getAngleOffset(P),j=S?new Arc(0,0,P,h+V,d-V):void 0;g!=null&&(z.clipStart(g.startAngle),z.clipEnd(g.endAngle),j?.clipStart(g.startAngle),j?.clipEnd(g.endAngle));const H=this.arc(a,L,h-Math.PI*.5,h+L,z,j,!0,!1),Y=this.arc(r,O,d-O,d+Math.PI*.5,z,j,!1,!1),U=this.arc(c,_,d+Math.PI*.5,d+Math.PI-_,z,j,!1,!0),$=this.arc(l,E,h+Math.PI+E,h+Math.PI*1.5,z,j,!0,!0);if(v){const W=f<Math.PI*.5?o*(1+Math.cos(f))/Math.sin(f):NaN;let X;W>0&&W<p?X=Math.max(Math.hypot(o,W),u):X=o,X=Math.max(X,u);const Z=h+f*.5;e.moveTo(i+X*Math.cos(Z),s+X*Math.sin(Z))}else if(!($?.isValid()===!0||j?.isValid()===!0)){const W=h+f/2,X=u*Math.cos(W),Z=u*Math.sin(W);e.moveTo(i+X,s+Z)}if(H?.isValid()===!0){const{cx:W,cy:X,r:Z,a0:q,a1:Q}=H;e.arc(i+W,s+X,Z,q,Q)}if(z.isValid()){const{r:W,a0:X,a1:Z}=z;e.arc(i,s,W,X,Z)}if(Y?.isValid()===!0){const{cx:W,cy:X,r:Z,a0:q,a1:Q}=Y;e.arc(i+W,s+X,Z,q,Q)}if(!v){if(U?.isValid()===!0){const{cx:W,cy:X,r:Z,a0:q,a1:Q}=U;e.arc(i+W,s+X,Z,q,Q)}if(j?.isValid()===!0){const{r:W,a0:X,a1:Z}=j;e.arc(i,s,W,Z,X,!0)}if($?.isValid()===!0){const{cx:W,cy:X,r:Z,a0:q,a1:Q}=$;e.arc(i+W,s+X,Z,q,Q)}}e.closePath()}isPointInPath(t,e){const{startAngle:i,endAngle:s,innerRadius:n,outerRadius:o}=this.clipSector??this;return isPointInSector(t-this.centerX,e-this.centerY,{startAngle:i,endAngle:s,innerRadius:Math.min(n,o),outerRadius:Math.max(n,o)})}};Sector.className="Sector",__decorateClass2([ScenePathChangeDetection()],Sector.prototype,"centerX",2),__decorateClass2([ScenePathChangeDetection()],Sector.prototype,"centerY",2),__decorateClass2([ScenePathChangeDetection()],Sector.prototype,"innerRadius",2),__decorateClass2([ScenePathChangeDetection()],Sector.prototype,"outerRadius",2),__decorateClass2([ScenePathChangeDetection()],Sector.prototype,"startAngle",2),__decorateClass2([ScenePathChangeDetection()],Sector.prototype,"endAngle",2),__decorateClass2([ScenePathChangeDetection()],Sector.prototype,"clipSector",2),__decorateClass2([ScenePathChangeDetection()],Sector.prototype,"concentricEdgeInset",2),__decorateClass2([ScenePathChangeDetection()],Sector.prototype,"radialEdgeInset",2),__decorateClass2([ScenePathChangeDetection()],Sector.prototype,"startOuterCornerRadius",2),__decorateClass2([ScenePathChangeDetection()],Sector.prototype,"endOuterCornerRadius",2),__decorateClass2([ScenePathChangeDetection()],Sector.prototype,"startInnerCornerRadius",2),__decorateClass2([ScenePathChangeDetection()],Sector.prototype,"endInnerCornerRadius",2);var DEFAULT_FILLS={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},DEFAULT_STROKES={BLUE:"#2b5c95",ORANGE:"#cc6f10",GREEN:"#1e652e",CYAN:"#18859e",YELLOW:"#a69400",VIOLET:"#603c88",GRAY:"#575757",MAGENTA:"#7d2f6d",BROWN:"#4f3508",RED:"#a82529"},DonutTitle=class extends Caption{constructor(){super(...arguments),this.showInLegend=!1}};__decorateClass2([TempValidate(BOOLEAN)],DonutTitle.prototype,"showInLegend",2);var DonutInnerLabel=class extends Label{constructor(){super(...arguments),this.spacing=2}set(t,e){return super.set(t)}};__decorateClass2([TempValidate(STRING)],DonutInnerLabel.prototype,"text",2),__decorateClass2([TempValidate(NUMBER)],DonutInnerLabel.prototype,"spacing",2);var DonutInnerCircle=class extends BaseProperties{constructor(){super(...arguments),this.fill="transparent",this.fillOpacity=1}};__decorateClass2([TempValidate(COLOR_STRING)],DonutInnerCircle.prototype,"fill",2),__decorateClass2([TempValidate(RATIO)],DonutInnerCircle.prototype,"fillOpacity",2);var DonutSeriesCalloutLabel=class extends Label{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};__decorateClass2([TempValidate(POSITIVE_NUMBER)],DonutSeriesCalloutLabel.prototype,"offset",2),__decorateClass2([TempValidate(NUMBER.restrict({min:0,max:360}))],DonutSeriesCalloutLabel.prototype,"minAngle",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],DonutSeriesCalloutLabel.prototype,"minSpacing",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],DonutSeriesCalloutLabel.prototype,"maxCollisionOffset",2),__decorateClass2([TempValidate(BOOLEAN)],DonutSeriesCalloutLabel.prototype,"avoidCollisions",2);var DonutSeriesSectorLabel=class extends Label{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};__decorateClass2([TempValidate(NUMBER)],DonutSeriesSectorLabel.prototype,"positionOffset",2),__decorateClass2([TempValidate(RATIO)],DonutSeriesSectorLabel.prototype,"positionRatio",2);var DonutSeriesCalloutLine=class extends BaseProperties{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};__decorateClass2([TempValidate(ARRAY_OF(OR(COLOR_GRADIENT,COLOR_STRING,COLOR_PATTERN)),{optional:!0})],DonutSeriesCalloutLine.prototype,"colors",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],DonutSeriesCalloutLine.prototype,"length",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],DonutSeriesCalloutLine.prototype,"strokeWidth",2);var DonutSeriesProperties=class extends SeriesProperties{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(DEFAULT_FILLS),this.strokes=Object.values(DEFAULT_STROKES),this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.outerRadiusOffset=0,this.outerRadiusRatio=1,this.strokeWidth=1,this.sectorSpacing=0,this.hideZeroValueSectorsInLegend=!1,this.innerLabels=new PropertiesArray(DonutInnerLabel),this.title=new DonutTitle,this.innerCircle=new DonutInnerCircle,this.shadow=new DropShadow,this.calloutLabel=new DonutSeriesCalloutLabel,this.sectorLabel=new DonutSeriesSectorLabel,this.calloutLine=new DonutSeriesCalloutLine,this.tooltip=new SeriesTooltip}};__decorateClass2([TempValidate(STRING)],DonutSeriesProperties.prototype,"angleKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],DonutSeriesProperties.prototype,"angleName",2),__decorateClass2([TempValidate(STRING,{optional:!0})],DonutSeriesProperties.prototype,"angleFilterKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],DonutSeriesProperties.prototype,"radiusKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],DonutSeriesProperties.prototype,"radiusName",2),__decorateClass2([TempValidate(POSITIVE_NUMBER,{optional:!0})],DonutSeriesProperties.prototype,"radiusMin",2),__decorateClass2([TempValidate(POSITIVE_NUMBER,{optional:!0})],DonutSeriesProperties.prototype,"radiusMax",2),__decorateClass2([TempValidate(STRING,{optional:!0})],DonutSeriesProperties.prototype,"calloutLabelKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],DonutSeriesProperties.prototype,"calloutLabelName",2),__decorateClass2([TempValidate(STRING,{optional:!0})],DonutSeriesProperties.prototype,"sectorLabelKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],DonutSeriesProperties.prototype,"sectorLabelName",2),__decorateClass2([TempValidate(STRING,{optional:!0})],DonutSeriesProperties.prototype,"legendItemKey",2),__decorateClass2([TempValidate(ARRAY_OF(COLOR_STRING_ARRAY))],DonutSeriesProperties.prototype,"defaultColorRange",2),__decorateClass2([TempValidate(ARRAY_OF(COLOR_STRING))],DonutSeriesProperties.prototype,"defaultPatternFills",2),__decorateClass2([TempValidate(ARRAY_OF(OR(COLOR_GRADIENT,COLOR_STRING,COLOR_PATTERN)))],DonutSeriesProperties.prototype,"fills",2),__decorateClass2([TempValidate(COLOR_STRING_ARRAY)],DonutSeriesProperties.prototype,"strokes",2),__decorateClass2([TempValidate(RATIO)],DonutSeriesProperties.prototype,"fillOpacity",2),__decorateClass2([TempValidate(RATIO)],DonutSeriesProperties.prototype,"strokeOpacity",2),__decorateClass2([TempValidate(LINE_DASH)],DonutSeriesProperties.prototype,"lineDash",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],DonutSeriesProperties.prototype,"lineDashOffset",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],DonutSeriesProperties.prototype,"cornerRadius",2),__decorateClass2([TempValidate(FUNCTION,{optional:!0})],DonutSeriesProperties.prototype,"itemStyler",2),__decorateClass2([TempValidate(NUMBER)],DonutSeriesProperties.prototype,"rotation",2),__decorateClass2([TempValidate(NUMBER)],DonutSeriesProperties.prototype,"outerRadiusOffset",2),__decorateClass2([TempValidate(RATIO)],DonutSeriesProperties.prototype,"outerRadiusRatio",2),__decorateClass2([TempValidate(NUMBER,{optional:!0})],DonutSeriesProperties.prototype,"innerRadiusOffset",2),__decorateClass2([TempValidate(RATIO,{optional:!0})],DonutSeriesProperties.prototype,"innerRadiusRatio",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],DonutSeriesProperties.prototype,"strokeWidth",2),__decorateClass2([TempValidate(NUMBER)],DonutSeriesProperties.prototype,"sectorSpacing",2),__decorateClass2([TempValidate(BOOLEAN)],DonutSeriesProperties.prototype,"hideZeroValueSectorsInLegend",2),__decorateClass2([TempValidate(OBJECT_ARRAY)],DonutSeriesProperties.prototype,"innerLabels",2),__decorateClass2([TempValidate(OBJECT)],DonutSeriesProperties.prototype,"title",2),__decorateClass2([TempValidate(OBJECT)],DonutSeriesProperties.prototype,"innerCircle",2),__decorateClass2([TempValidate(OBJECT)],DonutSeriesProperties.prototype,"shadow",2),__decorateClass2([TempValidate(OBJECT)],DonutSeriesProperties.prototype,"calloutLabel",2),__decorateClass2([TempValidate(OBJECT)],DonutSeriesProperties.prototype,"sectorLabel",2),__decorateClass2([TempValidate(OBJECT)],DonutSeriesProperties.prototype,"calloutLine",2),__decorateClass2([TempValidate(OBJECT)],DonutSeriesProperties.prototype,"tooltip",2);function preparePieSeriesAnimationFunctions(t,e,i,s){const n=[i.convert(0),i.convert(1)],o=[s.convert(0),s.convert(1)],a=Math.PI/-2+toRadians(e),r=t?"initial":"update",l=({radius:g})=>({innerRadius:n[0],outerRadius:n[0]+(n[1]-n[0])*g}),c=({radius:g})=>({innerRadius:o[0],outerRadius:o[0]+(o[1]-o[0])*g});return{nodes:{toFn:(g,f,m,{prevLive:y})=>{let{startAngle:x,endAngle:b,innerRadius:S,outerRadius:v}=f;const{stroke:I,fill:A}=f.sectorFormat;if(m==="removed"&&y?(x=y.datum?.endAngle,b=y.datum?.endAngle):m==="removed"&&!y&&(x=a,b=a),m==="removed"){const D=l(f);S=D.innerRadius,v=D.outerRadius}return{startAngle:x,endAngle:b,outerRadius:v,innerRadius:S,stroke:I,fill:A}},fromFn:(g,f,m,{prevFromProps:y})=>{let{startAngle:x,endAngle:b,innerRadius:S,outerRadius:v}=g,{fill:I,stroke:A}=f.sectorFormat;if(m==="updated"&&g.previousDatum==null&&(m="added"),m==="unknown"||m==="added"&&!y?(x=a,b=a,S=f.innerRadius,v=f.outerRadius):m==="added"&&y&&(x=y.endAngle??a,b=y.endAngle??a,S=y.innerRadius??f.innerRadius,v=y.outerRadius??f.outerRadius),m==="added"&&!t){const D=c(f);S=D.innerRadius,v=D.outerRadius}return m==="updated"&&(I=g.fill??I,A=(typeof g.stroke=="string"?g.stroke:void 0)??A),{startAngle:x,endAngle:b,innerRadius:S,outerRadius:v,fill:I,stroke:A,phase:r}}},innerCircle:{fromFn:(g,f)=>({size:g.previousDatum?.radius??g.size??0,phase:r}),toFn:(g,f)=>({size:f.radius??0})}}}function resetPieSelectionsFn(t,e){return{startAngle:e.startAngle,endAngle:e.endAngle,innerRadius:e.innerRadius,outerRadius:e.outerRadius,stroke:e.sectorFormat.stroke}}function pickByMatchingAngle(t,e){const i=e.y-t.centerY,s=e.x-t.centerX,n=Math.atan2(i,s),o=t.getItemNodes();for(const a of o)if(a.datum.missing!==!0&&isBetweenAngles(n,a.startAngle,a.endAngle)){const r=Math.sqrt(s*s+i*i);let l=0;return r<a.innerRadius?l=a.innerRadius-r:r>a.outerRadius&&(l=r-a.outerRadius),{datum:a.datum,distance:l}}}var PolarZIndexMap=(t=>(t[t.BACKGROUND=0]="BACKGROUND",t[t.FOREGROUND=1]="FOREGROUND",t[t.HIGHLIGHT=2]="HIGHLIGHT",t[t.LABEL=3]="LABEL",t))(PolarZIndexMap||{}),PolarSeries=class extends DataModelSeries{constructor({categoryKey:t,useLabelLayer:e=!1,pickModes:i=[1,0],canHaveAxes:s=!1,animationResetFns:n,...o}){super({...o,categoryKey:t,useLabelLayer:e,pickModes:i,directionKeys:{x:["angleKey"],y:["radiusKey"]},directionNames:{x:["angleName"],y:["radiusName"]},canHaveAxes:s}),this.itemGroup=this.contentGroup.appendChild(new Group),this.nodeData=[],this.itemSelection=Selection.select(this.itemGroup,()=>this.nodeFactory(),!1),this.labelSelection=Selection.select(this.labelGroup,()=>this.labelFactory(),!1),this.highlightSelection=Selection.select(this.highlightGroup,()=>this.nodeFactory()),this.highlightLabelSelection=Selection.select(this.highlightLabel,()=>this.labelFactory()),this.centerX=0,this.centerY=0,this.radius=0,this.animationResetFns=n,this.animationState=new StateMachine("empty",{empty:{update:{target:"ready",action:a=>this.animateEmptyUpdateReady(a)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:a=>this.animateReadyHighlight(a),highlightMarkers:a=>this.animateReadyHighlightMarkers(a),resize:a=>this.animateReadyResize(a),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:a=>this.animateWaitingUpdateReady(a)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:a=>this.animateClearingUpdateEmpty(a)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getItemNodes(){return[...this.itemGroup.children()]}getNodeData(){return this.nodeData}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.contentGroup.zIndex=[t,1],this.highlightGroup.zIndex=[t,2],this.labelGroup.zIndex=[t,3],!0):!1}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}labelFactory(){const t=new Text;return t.pointerEvents=1,t}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)))}getInnerRadius(){return 0}computeLabelsBBox(t,e){return null}getShapeFillBBox(){const t=this.radius;return{series:new BBox(-t,-t,t*2,t*2),axis:new BBox(-t,-t,t*2,t*2)}}resetAllAnimation(){const{item:t,label:e}=this.animationResetFns??{};this.ctx.animationManager.stopByAnimationGroupId(this.id),t&&resetMotion([this.itemSelection,this.highlightSelection],t),e&&resetMotion([this.labelSelection,this.highlightLabelSelection],e),this.itemSelection.cleanup(),this.labelSelection.cleanup(),this.highlightSelection.cleanup(),this.highlightLabelSelection.cleanup()}animateEmptyUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateWaitingUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateReadyHighlight(t){const{item:e,label:i}=this.animationResetFns??{};e&&resetMotion([this.highlightSelection],e),i&&resetMotion([this.highlightLabelSelection],i)}animateReadyHighlightMarkers(t){}animateReadyResize(t){this.resetAllAnimation()}animateClearingUpdateEmpty(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}computeFocusBounds(t){const e=this.getNodeData()?.[t.datumIndex];if(e!==void 0)return this.itemSelection.select(i=>i instanceof Path&&i.datum===e)[0]}getSeriesRange(t,e){return[NaN,NaN]}},DonutSeriesNodeEvent=class extends SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey,this.calloutLabelKey=s.properties.calloutLabelKey,this.sectorLabelKey=s.properties.sectorLabelKey}},DonutSeries=class extends PolarSeries{constructor(t){super({moduleCtx:t,categoryKey:void 0,pickModes:[1,0],useLabelLayer:!0,animationResetFns:{item:resetPieSelectionsFn,label:resetLabelFn}}),this.properties=new DonutSeriesProperties,this.phantomNodeData=void 0,this.backgroundGroup=new TranslatableGroup({name:`${this.id}-background`,zIndex:0}),this.noVisibleData=!1,this.previousRadiusScale=new LinearScale,this.radiusScale=new LinearScale,this.phantomGroup=this.backgroundGroup.appendChild(new Group({name:"phantom"})),this.phantomSelection=Selection.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new Group({name:"pieCalloutLabels"})),this.calloutLabelSelection=new Selection(this.calloutLabelGroup,Group),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new Group({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new Marker({shape:"circle"})),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new Marker({shape:"circle"})),this.innerLabelsGroup=this.contentGroup.appendChild(new Group({name:"innerLabels"})),this.innerCircleGroup=this.backgroundGroup.appendChild(new Group({name:`${this.id}-innerCircle`})),this.innerLabelsSelection=Selection.select(this.innerLabelsGroup,Text),this.innerCircleSelection=Selection.select(this.innerCircleGroup,()=>new Marker({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=DonutSeriesNodeEvent,this.angleScale=new LinearScale,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(e=>e+Math.PI/2),this.phantomGroup.opacity=.2}get calloutNodeData(){return this.phantomNodeData??this.nodeData}attachSeries(t,e,i){super.attachSeries(t,e,i),t?.appendChild(this.backgroundGroup)}detachSeries(t,e,i){super.detachSeries(t,e,i),t?.removeChild(this.backgroundGroup)}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.backgroundGroup.zIndex=[0,t],!0):!1}nodeFactory(){return new Sector}getSeriesDomain(t){return t==="x"?this.angleScale.domain:this.radiusScale.domain}async processData(t){if(this.data==null||!this.properties.isValid())return;const{visible:e,id:i,ctx:{legendManager:s}}=this,{angleKey:n,angleFilterKey:o,radiusKey:a,calloutLabelKey:r,sectorLabelKey:l,legendItemKey:c}=this.properties,h=()=>(m,y)=>e&&s.getItemEnabled({seriesId:i,itemId:y})?m:0,d=!this.ctx.animationManager.isSkipped(),u=[],p=[];c?u.push(keyProperty(c,"band",{id:"legendItemKey"})):r?u.push(keyProperty(r,"band",{id:"calloutLabelKey"})):l&&u.push(keyProperty(l,"band",{id:"sectorLabelKey"}));const g=this.radiusScale.type,f=this.angleScale.type;a&&p.push(rangedValueProperty(a,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,processor:h}),valueProperty(a,g,{id:"radiusRaw",processor:h}),normalisePropertyTo("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),r&&p.push(valueProperty(r,"band",{id:"calloutLabelValue"})),l&&p.push(valueProperty(l,"band",{id:"sectorLabelValue"})),c&&p.push(valueProperty(c,"band",{id:"legendItemValue"})),o&&p.push(accumulativeValueProperty(o,f,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:h}),valueProperty(o,f,{id:"angleFilterRaw"}),normalisePropertyTo("angleFilterValue",[0,1],0,0)),d&&this.processedData&&u.length>0&&p.push(diff(this.id,this.processedData)),p.push(animationValidation()),await this.requestDataModel(t,this.data,{props:[...u,accumulativeValueProperty(n,f,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:h}),valueProperty(n,f,{id:"angleRaw"}),normalisePropertyTo("angleValue",[0,1],0,0),...p]});for(const m of this.processedData?.defs?.values??[]){const{id:y,missing:x,property:b}=m,S=getMissCount(this,x);y!=="angleRaw"&&S>0&&logger_exports.warnOnce(`no value was found for the key '${String(b)}' on ${S} data element${S>1?"s":""}`)}this.animationState.transition("updateData")}maybeRefreshNodeData(){if(!this.nodeDataRefresh)return;const{nodeData:t=[],phantomNodeData:e}=this.createNodeData()??{};this.nodeData=t,this.phantomNodeData=e,this.nodeDataRefresh=!1}getProcessedDataValues(t,e){const i=t.resolveColumnById(this,"angleValue",e),s=t.resolveColumnById(this,"angleRaw",e),n=this.properties.angleFilterKey!=null?t.resolveColumnById(this,"angleFilterValue",e):void 0,o=this.properties.angleFilterKey!=null?t.resolveColumnById(this,"angleFilterRaw",e):void 0,a=this.properties.radiusKey?t.resolveColumnById(this,"radiusValue",e):void 0,r=this.properties.radiusKey?t.resolveColumnById(this,"radiusRaw",e):void 0,l=this.properties.calloutLabelKey?t.resolveColumnById(this,"calloutLabelValue",e):void 0,c=this.properties.sectorLabelKey?t.resolveColumnById(this,"sectorLabelValue",e):void 0,h=this.properties.legendItemKey?t.resolveColumnById(this,"legendItemValue",e):void 0;return{angleValues:i,angleRawValues:s,angleFilterValues:n,angleFilterRawValues:o,radiusValues:a,radiusRawValues:r,calloutLabelValues:l,sectorLabelValues:c,legendItemValues:h}}createNodeData(){const{id:t,processedData:e,dataModel:i,angleScale:s,ctx:{legendManager:n},visible:o}=this,{rotation:a,innerRadiusRatio:r}=this.properties;if(!this.properties.isValid())return this.zerosumOuterRing.visible=!0,this.zerosumInnerRing.visible=!0,{itemId:t,nodeData:[],labelData:[]};if(!i||e?.type!=="ungrouped")return;const{angleValues:l,angleRawValues:c,angleFilterValues:h,angleFilterRawValues:d,radiusValues:u,radiusRawValues:p,calloutLabelValues:g,sectorLabelValues:f,legendItemValues:m}=this.getProcessedDataValues(i,e),y=d?.some((D,T)=>D>c[T])??!1;let x=0,b=0;const S=[],v=d!=null?[]:void 0,I=e.dataSources.get(this.id)??[],A=e.invalidData?.get(this.id);return I.forEach((D,T)=>{if(A?.[T]===!0)return;const k=y?h[T]:l[T],w=d!=null&&!y?Math.sqrt(d[T]/c[T]):1,L=s.convert(x)+toRadians(a);x=k,b+=k;const O=s.convert(x)+toRadians(a),F=Math.abs(O-L),R=L+F/2,E=c[T],G=(u?.[T]??1)*w,B=p?.[T],z=m?.[T],P=this.getLabels(D,R,F,!0,g?.[T],f?.[T],z),V=this.getSectorFormat(D,T,!1),j={itemId:T,series:this,datum:D,datumIndex:T,angleValue:E,midAngle:R,midCos:Math.cos(R),midSin:Math.sin(R),startAngle:L,endAngle:O,radius:G,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(G),0),sectorFormat:V,radiusValue:B,legendItemValue:z,enabled:o&&n.getItemEnabled({seriesId:t,itemId:T}),focusable:!0,...P};S.push(j),v?.push({...j,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0),focusable:!1})}),this.zerosumOuterRing.visible=b===0,this.zerosumInnerRing.visible=b===0&&r!=null&&r!==1&&r>0,{itemId:t,nodeData:S,labelData:S,phantomNodeData:v}}getLabels(t,e,i,s,n,o,a){const{calloutLabel:r,sectorLabel:l,legendItemKey:c}=this.properties,h=!s||r.enabled?this.properties.calloutLabelKey:void 0,d=!s||l.enabled?this.properties.sectorLabelKey:void 0;if(!h&&!d&&!c)return{};const u={datum:t,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey},p={};return h&&i>=toRadians(r.minAngle)&&(p.calloutLabel={...this.getTextAlignment(e),text:this.getLabelText(r,{...u,value:n}),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),d&&(p.sectorLabel={text:this.getLabelText(l,{...u,value:o})}),c!=null&&a!=null&&(p.legendItem={key:c,text:a}),p}getTextAlignment(t){const e=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=normalizeAngle180(t),s=-.75*Math.PI,n=i-s,o=Math.floor(n/(Math.PI/2)),a=modulus(o,e.length);return e[a]}getNodeFill(t,e,i){return getShapeFill(t,{type:"gradient",bounds:"series",colorStops:e.map(s=>({color:s})),gradient:"radial",rotation:0,reverse:!0},{type:"pattern",pattern:"forward-slanted-lines",fill:i,fillOpacity:1,backgroundFill:"transparent",backgroundFillOpacity:1,stroke:i,strokeOpacity:1,strokeWidth:4,rotation:0})}getFillParams(t,e,i){if(!(!isGradientFill(t)||t.bounds==="item"))return{centerX:0,centerY:0,innerRadius:e,outerRadius:i}}getSectorFormat(t,e,i){const{angleKey:s,radiusKey:n,calloutLabelKey:o,sectorLabelKey:a,legendItemKey:r,fills:l,strokes:c,defaultColorRange:h,defaultPatternFills:d,itemStyler:u}=this.properties,p=c[e%c.length],{fill:g,fillOpacity:f,stroke:m,strokeWidth:y,strokeOpacity:x,lineDash:b,lineDashOffset:S,cornerRadius:v}=mergeDefaults(i&&this.properties.highlightStyle.item,{fill:l.length>0?l[e%l.length]:void 0,stroke:p,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()},this.properties),I=h[e%h.length],A=d[e%d.length],D=g??"black";let T;return u&&(T=this.cachedDatumCallback(this.getDatumId(t,e)+(i?"-highlight":"-hide"),()=>this.callWithContext(u,{datum:t,angleKey:s,radiusKey:n,calloutLabelKey:o,sectorLabelKey:a,legendItemKey:r,fill:this.getNodeFill(D,I,A),fillOpacity:f,stroke:m,strokeWidth:y,strokeOpacity:x,lineDash:b,lineDashOffset:S,cornerRadius:v,highlighted:i,seriesId:this.id}))),{fill:this.getNodeFill(T?.fill??D,I,A),fillOpacity:T?.fillOpacity??f,stroke:T?.stroke??m,strokeWidth:T?.strokeWidth??y,strokeOpacity:T?.strokeOpacity??x,lineDash:T?.lineDash??b,lineDashOffset:T?.lineDashOffset??S,cornerRadius:T?.cornerRadius??v}}getInnerRadius(){const{radius:t}=this,{innerRadiusRatio:e=1,innerRadiusOffset:i=0}=this.properties,s=t*e+i;return s===t||s<0?0:s}getOuterRadius(){const{outerRadiusRatio:t,outerRadiusOffset:e}=this.properties;return Math.max(this.radius*t+e,0)}updateRadiusScale(t){const e=[this.getInnerRadius(),this.getOuterRadius()];this.radiusScale.range=e,t&&(this.previousRadiusScale.range=e);const i=s=>({...s,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(s.radius),0)});this.nodeData=this.nodeData.map(i),this.phantomNodeData=this.phantomNodeData?.map(i)}getTitleTranslationY(){const t=Math.max(0,this.radiusScale.range[1]);if(t===0)return NaN;const i=2+(this.properties.title?.spacing??0),s=Math.max(0,-t);return-t-i-s}update({seriesRect:t}){const{title:e}=this.properties,i={seriesRectWidth:t?.width,seriesRectHeight:t?.height},s=jsonDiff(this.nodeDataDependencies,i)!=null;if(s&&(this._nodeDataDependencies=i),this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(s),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),e){const n=this.getTitleTranslationY();e.node.y=isFinite(n)?n:0;const o=e.node.getBBox();e.node.visible=e.enabled&&isFinite(n)&&!this.bboxIntersectsSurroundingSeries(o)}for(const n of[this.zerosumInnerRing,this.zerosumOuterRing])n.fillOpacity=0,n.stroke=this.properties.calloutLabel.color,n.strokeWidth=1,n.strokeOpacity=1;this.updateNodeMidPoint(),this.updateSelections(),this.updateNodes(t)}updateTitleNodes(){const{oldTitle:t}=this,{title:e}=this.properties;t!==e&&(t&&this.labelGroup?.removeChild(t.node),e&&(e.node.textBaseline="bottom",this.labelGroup?.appendChild(e.node)),this.oldTitle=e)}updateNodeMidPoint(){const t=e=>{const i=e.innerRadius+(e.outerRadius-e.innerRadius)/2;e.midPoint={x:e.midCos*Math.max(0,i),y:e.midSin*Math.max(0,i)}};this.nodeData.forEach(t),this.phantomNodeData?.forEach(t)}updateSelections(){this.updateGroupSelection(),this.updateInnerCircleSelection()}updateGroupSelection(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,highlightLabelSelection:s,calloutLabelSelection:n,labelSelection:o,innerLabelsSelection:a}=this,r=this.nodeData.map(c=>({...c,sectorFormat:{...c.sectorFormat}})),l=(c,h)=>{c.update(h,void 0,d=>this.getDatumId(d.datum,d.datumIndex)),this.ctx.animationManager.isSkipped()&&c.cleanup()};l(t,this.nodeData),l(e,r),l(i,this.phantomNodeData??[]),n.update(this.calloutNodeData,c=>{const h=new Line;h.tag=0,h.pointerEvents=1,c.appendChild(h);const d=new Text;d.tag=1,d.pointerEvents=1,c.appendChild(d)}),o.update(this.nodeData),s.update(r),a.update(this.properties.innerLabels,c=>{c.pointerEvents=1})}updateInnerCircleSelection(){const{innerCircle:t}=this.properties;let e=0;const i=this.getInnerRadius();if(i>0){const n=Math.min(i,this.getOuterRadius());e=Math.ceil(n*2+1)}const s=t?[{radius:e}]:[];this.innerCircleSelection.update(s)}updateNodes(t){const e=this.ctx.highlightManager.getActiveHighlight(),{visible:i}=this;this.backgroundGroup.visible=i,this.contentGroup.visible=i,this.highlightGroup.visible=i&&e?.series===this,this.highlightLabel.visible=i&&e?.series===this,this.labelGroup.visible=i,this.contentGroup.opacity=this.getOpacity(),this.innerCircleSelection.each((l,{radius:c})=>{l.setProperties({fill:this.getNodeFill(this.properties.innerCircle?.fill,["black"],"black"),opacity:this.properties.innerCircle?.fillOpacity,size:c})});const s=this.radiusScale.range[0],n=this.radiusScale.range[1],o=this.getShapeFillBBox(),a=this.ctx.animationManager.isSkipped(),r=(l,c,h,d)=>{const u=this.getSectorFormat(c.datum,c.itemId,d);c.sectorFormat.fill=u.fill,c.sectorFormat.stroke=u.stroke,a&&(l.startAngle=c.startAngle,l.endAngle=c.endAngle,l.innerRadius=c.innerRadius,l.outerRadius=c.outerRadius),(d||a)&&(l.fill=u.fill,l.stroke=u.stroke);const p=this.getFillParams(u.fill,s,n);applyShapeFillBBox(l,u.fill,o,p),l.strokeWidth=u.strokeWidth,l.fillOpacity=u.fillOpacity,l.strokeOpacity=u.strokeOpacity,l.lineDash=u.lineDash,l.lineDashOffset=u.lineDashOffset,l.cornerRadius=u.cornerRadius,l.fillShadow=this.properties.shadow;const g=Math.max((this.properties.sectorSpacing+(u.stroke!=null?u.strokeWidth:0))/2,0);l.inset=g,l.lineJoin=this.properties.sectorSpacing>=0||g>0?"miter":"round"};this.itemSelection.each((l,c,h)=>r(l,c,h,!1)),this.highlightSelection.each((l,c,h)=>{r(l,c,h,!0),l.visible=c.itemId===e?.itemId}),this.phantomSelection.each((l,c,h)=>r(l,c,h,!1)),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(t),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{calloutLine:{length:t,strokeWidth:e,colors:i},strokes:s}=this.properties,n=e,o=isStringFillArray(i)?i??this.properties.strokes:s,{offset:a}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach((r,l)=>{const c=r.closestDatum(),{calloutLabel:h,outerRadius:d}=c;if(h?.text&&!h.hidden&&d!==0){r.visible=!0,r.strokeWidth=n,r.stroke=o[l%o.length],r.fill=void 0;const u=c.midCos*d,p=c.midSin*d;let g=c.midCos*(d+t),f=c.midSin*(d+t);if((h.collisionTextAlign??h.collisionOffsetY!==0)&&h.box!=null){const y=h.box;let x=g,b=f;g<y.x?x=y.x:g>y.x+y.width&&(x=y.x+y.width),f<y.y?b=y.y:f>y.y+y.height&&(b=y.y+y.height);const S=x-g,v=b-f,I=Math.sqrt(Math.pow(S,2)+Math.pow(v,2)),A=I-a;A>0&&(g=g+S*A/I,f=f+v*A/I)}r.x1=u,r.y1=p,r.x2=g,r.y2=f}else r.visible=!1})}getLabelOverflow(t,e,i){const s=-this.centerX,n=s+i.width,o=-this.centerY,a=o+i.height,r=1;let l=1;e.x+r<s?l=(e.x+e.width-s)/e.width:e.x+e.width-r>n&&(l=(n-e.x)/e.width);const c=e.y+r<o||e.y+e.height-r>a,h=l===1?t.length:Math.floor(t.length*l)-1,d=this.bboxIntersectsSurroundingSeries(e);return{textLength:h,hasVerticalOverflow:c,hasSurroundingSeriesOverflow:d}}bboxIntersectsSurroundingSeries(t){const{surroundingRadius:e}=this;if(e==null)return!1;const i=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],s=e**2;return i.some(n=>n.x**2+n.y**2>s)}computeCalloutLabelCollisionOffsets(){const{radiusScale:t}=this,{calloutLabel:e,calloutLine:i}=this.properties,{offset:s,minSpacing:n}=e,o=t.convert(0),a=y=>!y.calloutLabel||y.outerRadius===0,r=this.calloutNodeData,l=r.filter(y=>!a(y));if(l.forEach(y=>{const x=y.calloutLabel;x!=null&&(x.hidden=!1,x.collisionTextAlign=void 0,x.collisionOffsetY=0)}),l.length<=1)return;const c=l.filter(y=>y.midCos<0).sort((y,x)=>y.midSin-x.midSin),h=l.filter(y=>y.midCos>=0).sort((y,x)=>y.midSin-x.midSin),d=l.filter(y=>y.midSin<0&&y.calloutLabel?.textAlign==="center").sort((y,x)=>y.midCos-x.midCos),u=l.filter(y=>y.midSin>=0&&y.calloutLabel?.textAlign==="center").sort((y,x)=>y.midCos-x.midCos),p=y=>{const x=y.calloutLabel;if(x==null)return BBox.zero.clone();const b=y.outerRadius+i.length+s,S=y.midCos*b,v=y.midSin*b+x.collisionOffsetY,I=x.collisionTextAlign??x.textAlign,A=x.textBaseline;return Text.computeBBox(x.text,S,v,{font:this.properties.calloutLabel,textAlign:I,textBaseline:A})},g=(y,x,b)=>{const S=p(y).grow(n/2),v=p(x).grow(n/2);S.x<v.x+v.width&&S.x+S.width>v.x&&(b==="to-top"?S.y<v.y+v.height:S.y+S.height>v.y)&&(x.calloutLabel.collisionOffsetY=b==="to-top"?S.y-v.y-v.height:S.y+S.height-v.y)},f=y=>{const x=y.slice().sort((S,v)=>Math.abs(S.midSin)-Math.abs(v.midSin))[0],b=y.indexOf(x);for(let S=b-1;S>=0;S--){const v=y[S+1],I=y[S];g(v,I,"to-top")}for(let S=b+1;S<y.length;S++){const v=y[S-1],I=y[S];g(v,I,"to-bottom")}},m=y=>{const x=l.some(D=>D.calloutLabel.collisionOffsetY!==0),b=y.map(D=>p(D)),S=b.map(D=>D.clone().grow(n/2));let v=!1;for(let D=0;D<S.length&&!v;D++){const T=S[D];for(let k=D+1;k<y.length;k++){const w=S[k];if(T.collidesBBox(w)){v=!0;break}}}const I=r.map(D=>{const{startAngle:T,endAngle:k,outerRadius:w}=D;return{startAngle:T,endAngle:k,innerRadius:o,outerRadius:w}}),A=b.some(D=>I.some(T=>boxCollidesSector(D,T)));!v&&!x&&!A||y.filter(D=>D.calloutLabel.textAlign==="center").forEach(D=>{const T=D.calloutLabel;D.midCos<0?T.collisionTextAlign="right":D.midCos>0?T.collisionTextAlign="left":T.collisionTextAlign="center"})};f(c),f(h),m(d),m(u)}updateCalloutLabelNodes(t){const{radiusScale:e}=this,{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:o,color:a}=i,r=new Text;this.calloutLabelSelection.selectByTag(1).forEach(l=>{const c=l.closestDatum(),h=c.calloutLabel,d=e.convert(c.radius),u=Math.max(0,d);if(!h?.text||u===0||h.hidden){l.visible=!1;return}const p=u+n+o,g=c.midCos*p,f=c.midSin*p+h.collisionOffsetY,m={textAlign:h.collisionTextAlign??h.textAlign,textBaseline:h.textBaseline};r.text=h.text,r.x=g,r.y=f,r.setFont(this.properties.calloutLabel),r.setAlign(m);const y=r.getBBox();let x=h.text,b=!0;if(i.avoidCollisions){const{textLength:S,hasVerticalOverflow:v}=this.getLabelOverflow(h.text,y,t);x=h.text.length===S?h.text:`${h.text.substring(0,S)}\u2026`,b=!v}l.text=x,l.x=g,l.y=f,l.setFont(this.properties.calloutLabel),l.setAlign(m),l.fill=a,l.visible=b})}computeLabelsBBox(t,e){const{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:o,maxCollisionOffset:a,minSpacing:r}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],c=new Text;let h;const{title:d}=this.properties;if(d?.text&&d.enabled){const u=this.getTitleTranslationY();isFinite(u)&&(c.text=d.text,c.x=0,c.y=u,c.setFont(d),c.setAlign({textBaseline:"bottom",textAlign:"center"}),h=c.getBBox(),l.push(h))}return this.calloutNodeData.forEach(u=>{const p=u.calloutLabel;if(!p||u.outerRadius===0)return null;const g=u.outerRadius+n+o,f=u.midCos*g,m=u.midSin*g+p.collisionOffsetY;c.text=p.text,c.x=f,c.y=m,c.setFont(this.properties.calloutLabel),c.setAlign({textAlign:p.collisionTextAlign??p.textAlign,textBaseline:p.textBaseline});const y=c.getBBox();if(p.box=y,Math.abs(p.collisionOffsetY)>a){p.hidden=!0;return}if(h){const x=-this.centerY,b=new BBox(h.x-r,x,h.width+2*r,h.y+h.height+r-x);if(y.collidesBBox(b)){p.hidden=!0;return}}if(t.hideWhenNecessary){const{textLength:x,hasVerticalOverflow:b,hasSurroundingSeriesOverflow:S}=this.getLabelOverflow(p.text,y,e),v=p.text.length>2&&x<2;if(b||v||S){p.hidden=!0;return}}p.hidden=!1,l.push(y)}),l.length===0?null:BBox.merge(l)}updateSectorLabelNodes(){const{radiusScale:t}=this,e=t.convert(0),{fontSize:i,fontStyle:s,fontWeight:n,fontFamily:o,positionOffset:a,positionRatio:r,color:l}=this.properties.sectorLabel,c=(h,d)=>{const{sectorLabel:u,outerRadius:p}=d;let g=!1;if(u&&p!==0){const f=e*(1-r)+p*r+a;h.fill=l,h.fontStyle=s,h.fontWeight=n,h.fontSize=i,h.fontFamily=o,h.text=u.text,h.x=d.midCos*f,h.y=d.midSin*f,h.textAlign="center",h.textBaseline="middle";const m=h.getBBox(),y=[[m.x,m.y],[m.x+m.width,m.y],[m.x+m.width,m.y+m.height],[m.x,m.y+m.height]],{startAngle:x,endAngle:b}=d,S={startAngle:x,endAngle:b,innerRadius:e,outerRadius:p};y.every(([v,I])=>isPointInSector(v,I,S))&&(g=!0)}h.visible=g};this.labelSelection.each(c),this.highlightLabelSelection.each(c)}updateInnerLabelNodes(){const t=[],e=[];this.innerLabelsSelection.each((h,d)=>{const{fontStyle:u,fontWeight:p,fontSize:g,fontFamily:f,color:m}=d;h.fontStyle=u,h.fontWeight=p,h.fontSize=g,h.fontFamily=f,h.text=d.text,h.x=0,h.y=0,h.fill=m,h.textAlign="center",h.textBaseline="alphabetic",t.push(h.getBBox()),e.push(d.spacing)});const i=h=>h===0?0:e[h],s=h=>h===e.length-1?0:e[h],n=t.reduce((h,d,u)=>h+d.height+i(u)+s(u),0),o=Math.max(...t.map(h=>h.width)),a=this.getInnerRadius(),l=Math.sqrt(Math.pow(o/2,2)+Math.pow(n/2,2))<=(a>0?a:this.getOuterRadius()),c=[];for(let h=0,d=-n/2;h<t.length;h++){const p=t[h].height+d+i(h);c.push(p),d=p+s(h)}this.innerLabelsSelection.each((h,d,u)=>{h.y=c[u],h.visible=l})}updateZerosumRings(){this.zerosumOuterRing.size=this.getOuterRadius()*2,this.zerosumInnerRing.size=this.getInnerRadius()*2}pickNodeClosestDatum(t){return pickByMatchingAngle(this,t)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{legendItemKey:o,calloutLabelKey:a,calloutLabelName:r,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:d,radiusKey:u,radiusName:p,tooltip:g}=n,f=this.properties.title.text;if(!i||!s)return;const m=s.dataSources.get(this.id)?.[t],{angleRawValues:y,legendItemValues:x,calloutLabelValues:b,sectorLabelValues:S}=this.getProcessedDataValues(i,s),v=y[t],I=x?.[t]??(a===h?void 0:b?.[t])??(l===h?void 0:S?.[t])??d;return g.formatTooltip(this.properties,{title:f,symbol:this.legendItemSymbol(t),data:[{label:I,fallbackLabel:h,value:formatValue(v,3)}]},{seriesId:e,datum:m,title:d,legendItemKey:o,calloutLabelKey:a,calloutLabelName:r,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:d,radiusKey:u,radiusName:p,...this.getSectorFormat(m,t,!1)})}legendItemSymbol(t){const e=this.processedData?.dataSources.get(this.id)?.[t],i=this.getSectorFormat(e,t,!1),{fillOpacity:s,strokeOpacity:n,strokeWidth:o,lineDash:a,lineDashOffset:r}=this.properties;let{fill:l}=i;const{stroke:c}=i;return isGradientFill(l)&&(l={...l,gradient:"linear",rotation:0,reverse:!1}),{marker:{fill:l,stroke:c,fillOpacity:s,strokeOpacity:n,strokeWidth:o,lineDash:a,lineDashOffset:r}}}getLegendData(t){const{visible:e,processedData:i,dataModel:s,id:n,ctx:{legendManager:o}}=this;if(!s||!i||!this.properties.isValid()||t!=="category")return[];const{angleKey:a,calloutLabelKey:r,sectorLabelKey:l,legendItemKey:c,showInLegend:h}=this.properties;if(!c&&(!r||r===a)&&(!l||l===a))return[];const{angleRawValues:d,calloutLabelValues:u,sectorLabelValues:p,legendItemValues:g}=this.getProcessedDataValues(s,i),f=this.properties.title?.showInLegend&&this.properties.title.text,m=[],y=this.properties.hideZeroValueSectorsInLegend,x=i.dataSources.get(this.id),b=i.invalidData?.get(this.id);for(let S=0;S<i.input.count;S++){const v=x?.[S],I=d[S];if(b?.[S]===!0||y&&I===0)continue;const A=[];f&&A.push(f);const D=this.getLabels(v,2*Math.PI,2*Math.PI,!1,u?.[S],p?.[S],g?.[S]);c&&D.legendItem!==void 0?A.push(D.legendItem.text):r&&r!==a&&D.calloutLabel?.text!==void 0?A.push(D.calloutLabel?.text):l&&l!==a&&D.sectorLabel?.text!==void 0&&A.push(D.sectorLabel?.text),A.length!==0&&m.push({legendType:"category",id:n,datum:v,itemId:S,seriesId:n,enabled:e&&o.getItemEnabled({seriesId:n,itemId:S}),label:{text:A.join(" - ")},symbol:this.legendItemSymbol(S),legendItemName:c!=null?v[c]:void 0,hideInLegend:!h})}return m}setLegendState(t){const{id:e,ctx:{legendManager:i,updateService:s}}=this;t.forEach((n,o)=>i.toggleItem(n,e,o)),i.update(),s.update(4)}animateEmptyUpdateReady(t){const{animationManager:e}=this.ctx,i=preparePieSeriesAnimationFunctions(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);fromToMotion(this.id,"nodes",e,[this.itemSelection,this.highlightSelection,this.phantomSelection],i.nodes,(s,n)=>this.getDatumId(n.datum,n.datumIndex)),fromToMotion(this.id,"innerCircle",e,[this.innerCircleSelection],i.innerCircle),seriesLabelFadeInAnimation(this,"callout",e,this.calloutLabelSelection),seriesLabelFadeInAnimation(this,"sector",e,this.labelSelection),seriesLabelFadeInAnimation(this,"highlight",e,this.highlightLabelSelection),seriesLabelFadeInAnimation(this,"inner",e,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,processedData:s,radiusScale:n,previousRadiusScale:o}=this,{animationManager:a}=this.ctx,r=s?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=(r?.moved.size??0)===0,c=(s?.defs.keys.length??0)>0,h=s?.reduced?.animationValidation?.uniqueKeys??!0;(!l||!c||!h)&&this.ctx.animationManager.skipCurrentBatch();const d=!this.nodeData.some(p=>p.enabled),u=preparePieSeriesAnimationFunctions(!1,this.properties.rotation,n,o);fromToMotion(this.id,"nodes",a,[t,e,i],u.nodes,(p,g)=>this.getDatumId(g.datum,g.datumIndex),r),fromToMotion(this.id,"innerCircle",a,[this.innerCircleSelection],u.innerCircle),seriesLabelFadeInAnimation(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),seriesLabelFadeInAnimation(this,"sector",this.ctx.animationManager,this.labelSelection),seriesLabelFadeInAnimation(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.noVisibleData!==d&&(this.noVisibleData=d,seriesLabelFadeInAnimation(this,"inner",this.ctx.animationManager,this.innerLabelsSelection)),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,radiusScale:s,previousRadiusScale:n}=this,{animationManager:o}=this.ctx,a=preparePieSeriesAnimationFunctions(!1,this.properties.rotation,s,n);fromToMotion(this.id,"nodes",o,[t,e,i],a.nodes,(r,l)=>this.getDatumId(l.datum,l.datumIndex)),fromToMotion(this.id,"innerCircle",o,[this.innerCircleSelection],a.innerCircle),seriesLabelFadeOutAnimation(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),seriesLabelFadeOutAnimation(this,"sector",this.ctx.animationManager,this.labelSelection),seriesLabelFadeOutAnimation(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),seriesLabelFadeOutAnimation(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(t,e){const{calloutLabelKey:i,sectorLabelKey:s,legendItemKey:n}=this.properties;return this.processedData?.reduced?.animationValidation?.uniqueKeys?n?createDatumId(t[n]):i?createDatumId(t[i]):s?createDatumId(t[s]):`${e}`:`${e}`}};DonutSeries.className="DonutSeries",DonutSeries.type="donut";var pieSeriesOptionsDef={type:required(constant("pie")),angleKey:required(string),radiusKey:string,calloutLabelKey:string,sectorLabelKey:string,legendItemKey:string,angleName:string,radiusName:string,calloutLabelName:string,sectorLabelName:string,radiusMin:positiveNumber,radiusMax:positiveNumber,rotation:number,outerRadiusOffset:number,outerRadiusRatio:ratio,hideZeroValueSectorsInLegend:boolean,sectorSpacing:positiveNumber,cornerRadius:positiveNumber,itemStyler:callback,title:{enabled:boolean,text:string,showInLegend:boolean,spacing:positiveNumber,...fontOptionsDef},calloutLabel:{enabled:boolean,offset:number,minAngle:positiveNumber,avoidCollisions:boolean,formatter:callback,...fontOptionsDef},sectorLabel:{enabled:boolean,positionOffset:number,positionRatio:ratio,formatter:callback,...fontOptionsDef},calloutLine:{colors:arrayOf(color),length:positiveNumber,strokeWidth:positiveNumber},fills:arrayOf(colorUnion),strokes:arrayOf(color),tooltip:tooltipOptionsDefs,shadow:shadowOptionsDefs,...commonSeriesOptionsDefs,...lineDashOptionsDef,...without(fillOptionsDef,["fill"]),...without(strokeOptionsDef,["stroke"])};pieSeriesOptionsDef.defaultColorRange=arrayOf(arrayOf(color)),pieSeriesOptionsDef.defaultPatternFills=arrayOf(color);var donutSeriesOptionsDef={...pieSeriesOptionsDef,type:required(constant("donut")),innerRadiusOffset:number,innerRadiusRatio:ratio,innerCircle:{fill:string,fillOpacity:ratio},innerLabels:arrayOfDefs({text:required(string),spacing:positiveNumber,...fontOptionsDef},"inner label options array")},donutTheme={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.1666666666666667]},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"backgroundColor"},positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2,colors:{$map:[{$if:[{$or:[{$isGradient:[{$value:"$1"}]},{$isPattern:[{$value:"$1"}]}]},{$path:["../../strokes/$index",{$ref:"foregroundColor"}]},{$value:"$1"}]},{$if:[{$eq:[{$path:"../strokeWidth"},0]},{$path:"../fills"},{$path:"../strokes"}]}]}},fills:{$palette:"fills"},strokes:{$palette:"strokes"},defaultColorRange:{$palette:"gradients"},defaultPatternFills:SAFE_FILLS_OPERATION,fillOpacity:1,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,innerRadiusRatio:{$if:[{$eq:[{$path:["./innerRadiusOffset",void 0]},void 0]},.7,void 0]},shadow:{enabled:!1,color:DEFAULT_SHADOW_COLOUR,xOffset:3,yOffset:3,blur:5},innerLabels:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:2}},legend:{enabled:!0}},DonutSeriesModule={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"donut",moduleFactory:t=>new DonutSeries(t),tooltipDefaults:{range:"exact"},themeTemplate:donutTheme},NewDonutSeriesModule={type:"series",name:"donut",chartType:"polar",options:donutSeriesOptionsDef,create:t=>new DonutSeries(t)},PieTitle=class extends Caption{constructor(){super(...arguments),this.showInLegend=!1}};__decorateClass2([TempValidate(BOOLEAN)],PieTitle.prototype,"showInLegend",2);var PieSeriesCalloutLabel=class extends Label{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};__decorateClass2([TempValidate(POSITIVE_NUMBER)],PieSeriesCalloutLabel.prototype,"offset",2),__decorateClass2([TempValidate(NUMBER.restrict({min:0,max:360}))],PieSeriesCalloutLabel.prototype,"minAngle",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],PieSeriesCalloutLabel.prototype,"minSpacing",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],PieSeriesCalloutLabel.prototype,"maxCollisionOffset",2),__decorateClass2([TempValidate(BOOLEAN)],PieSeriesCalloutLabel.prototype,"avoidCollisions",2);var PieSeriesSectorLabel=class extends Label{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};__decorateClass2([TempValidate(NUMBER)],PieSeriesSectorLabel.prototype,"positionOffset",2),__decorateClass2([TempValidate(RATIO)],PieSeriesSectorLabel.prototype,"positionRatio",2);var PieSeriesCalloutLine=class extends BaseProperties{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};__decorateClass2([TempValidate(ARRAY_OF(OR(COLOR_GRADIENT,COLOR_STRING,COLOR_PATTERN)),{optional:!0})],PieSeriesCalloutLine.prototype,"colors",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],PieSeriesCalloutLine.prototype,"length",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],PieSeriesCalloutLine.prototype,"strokeWidth",2);var PieSeriesProperties=class extends SeriesProperties{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(DEFAULT_FILLS),this.strokes=Object.values(DEFAULT_STROKES),this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.outerRadiusOffset=0,this.outerRadiusRatio=1,this.strokeWidth=1,this.sectorSpacing=0,this.hideZeroValueSectorsInLegend=!1,this.title=new PieTitle,this.shadow=new DropShadow,this.calloutLabel=new PieSeriesCalloutLabel,this.sectorLabel=new PieSeriesSectorLabel,this.calloutLine=new PieSeriesCalloutLine,this.tooltip=new SeriesTooltip}};__decorateClass2([TempValidate(STRING)],PieSeriesProperties.prototype,"angleKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],PieSeriesProperties.prototype,"angleName",2),__decorateClass2([TempValidate(STRING,{optional:!0})],PieSeriesProperties.prototype,"angleFilterKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],PieSeriesProperties.prototype,"radiusKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],PieSeriesProperties.prototype,"radiusName",2),__decorateClass2([TempValidate(POSITIVE_NUMBER,{optional:!0})],PieSeriesProperties.prototype,"radiusMin",2),__decorateClass2([TempValidate(POSITIVE_NUMBER,{optional:!0})],PieSeriesProperties.prototype,"radiusMax",2),__decorateClass2([TempValidate(STRING,{optional:!0})],PieSeriesProperties.prototype,"calloutLabelKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],PieSeriesProperties.prototype,"calloutLabelName",2),__decorateClass2([TempValidate(STRING,{optional:!0})],PieSeriesProperties.prototype,"sectorLabelKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],PieSeriesProperties.prototype,"sectorLabelName",2),__decorateClass2([TempValidate(STRING,{optional:!0})],PieSeriesProperties.prototype,"legendItemKey",2),__decorateClass2([TempValidate(ARRAY_OF(COLOR_STRING_ARRAY))],PieSeriesProperties.prototype,"defaultColorRange",2),__decorateClass2([TempValidate(ARRAY_OF(COLOR_STRING))],PieSeriesProperties.prototype,"defaultPatternFills",2),__decorateClass2([TempValidate(ARRAY_OF(OR(COLOR_GRADIENT,COLOR_STRING,COLOR_PATTERN)))],PieSeriesProperties.prototype,"fills",2),__decorateClass2([TempValidate(COLOR_STRING_ARRAY)],PieSeriesProperties.prototype,"strokes",2),__decorateClass2([TempValidate(RATIO)],PieSeriesProperties.prototype,"fillOpacity",2),__decorateClass2([TempValidate(RATIO)],PieSeriesProperties.prototype,"strokeOpacity",2),__decorateClass2([TempValidate(LINE_DASH)],PieSeriesProperties.prototype,"lineDash",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],PieSeriesProperties.prototype,"lineDashOffset",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],PieSeriesProperties.prototype,"cornerRadius",2),__decorateClass2([TempValidate(FUNCTION,{optional:!0})],PieSeriesProperties.prototype,"itemStyler",2),__decorateClass2([TempValidate(NUMBER)],PieSeriesProperties.prototype,"rotation",2),__decorateClass2([TempValidate(NUMBER)],PieSeriesProperties.prototype,"outerRadiusOffset",2),__decorateClass2([TempValidate(RATIO)],PieSeriesProperties.prototype,"outerRadiusRatio",2),__decorateClass2([TempValidate(POSITIVE_NUMBER)],PieSeriesProperties.prototype,"strokeWidth",2),__decorateClass2([TempValidate(NUMBER)],PieSeriesProperties.prototype,"sectorSpacing",2),__decorateClass2([TempValidate(BOOLEAN)],PieSeriesProperties.prototype,"hideZeroValueSectorsInLegend",2),__decorateClass2([TempValidate(OBJECT)],PieSeriesProperties.prototype,"title",2),__decorateClass2([TempValidate(OBJECT)],PieSeriesProperties.prototype,"shadow",2),__decorateClass2([TempValidate(OBJECT)],PieSeriesProperties.prototype,"calloutLabel",2),__decorateClass2([TempValidate(OBJECT)],PieSeriesProperties.prototype,"sectorLabel",2),__decorateClass2([TempValidate(OBJECT)],PieSeriesProperties.prototype,"calloutLine",2),__decorateClass2([TempValidate(OBJECT)],PieSeriesProperties.prototype,"tooltip",2);var PieSeriesNodeEvent=class extends SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey,this.calloutLabelKey=s.properties.calloutLabelKey,this.sectorLabelKey=s.properties.sectorLabelKey}},PieSeries=class extends PolarSeries{constructor(t){super({moduleCtx:t,categoryKey:void 0,pickModes:[1,0],useLabelLayer:!0,animationResetFns:{item:resetPieSelectionsFn,label:resetLabelFn}}),this.properties=new PieSeriesProperties,this.phantomNodeData=void 0,this.backgroundGroup=new TranslatableGroup({name:`${this.id}-background`,zIndex:0}),this.previousRadiusScale=new LinearScale,this.radiusScale=new LinearScale,this.phantomGroup=this.backgroundGroup.appendChild(new Group({name:"phantom"})),this.phantomSelection=Selection.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new Group({name:"pieCalloutLabels"})),this.calloutLabelSelection=new Selection(this.calloutLabelGroup,Group),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new Group({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new Marker({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=PieSeriesNodeEvent,this.angleScale=new LinearScale,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(e=>e+Math.PI/2),this.phantomGroup.opacity=.2}get calloutNodeData(){return this.phantomNodeData??this.nodeData}attachSeries(t,e,i){super.attachSeries(t,e,i),t.appendChild(this.backgroundGroup)}detachSeries(t,e,i){super.detachSeries(t,e,i),t?.removeChild(this.backgroundGroup)}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.backgroundGroup.zIndex=[0,t],!0):!1}nodeFactory(){const t=new Sector;return t.miterLimit=1e9,t}getSeriesDomain(t){return t==="x"?this.angleScale.domain:this.radiusScale.domain}async processData(t){if(this.data==null||!this.properties.isValid())return;const{visible:e,id:i,ctx:{legendManager:s}}=this,{angleKey:n,angleFilterKey:o,radiusKey:a,calloutLabelKey:r,sectorLabelKey:l,legendItemKey:c}=this.properties,h=()=>(m,y)=>e&&s.getItemEnabled({seriesId:i,itemId:y})?m:0,d=!this.ctx.animationManager.isSkipped(),u=[],p=[];c?u.push(keyProperty(c,"band",{id:"legendItemKey"})):r?u.push(keyProperty(r,"band",{id:"calloutLabelKey"})):l&&u.push(keyProperty(l,"band",{id:"sectorLabelKey"}));const g=this.radiusScale.type,f=this.angleScale.type;a&&p.push(rangedValueProperty(a,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,processor:h}),valueProperty(a,g,{id:"radiusRaw",processor:h}),normalisePropertyTo("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),r&&p.push(valueProperty(r,"band",{id:"calloutLabelValue"})),l&&p.push(valueProperty(l,"band",{id:"sectorLabelValue"})),c&&p.push(valueProperty(c,"band",{id:"legendItemValue"})),o&&p.push(accumulativeValueProperty(o,f,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:h}),valueProperty(o,f,{id:"angleFilterRaw"}),normalisePropertyTo("angleFilterValue",[0,1],0,0)),d&&this.processedData?.reduced?.animationValidation?.uniqueKeys&&u.length>0&&p.push(diff(this.id,this.processedData)),p.push(animationValidation()),await this.requestDataModel(t,this.data,{props:[...u,accumulativeValueProperty(n,f,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:h}),valueProperty(n,f,{id:"angleRaw"}),normalisePropertyTo("angleValue",[0,1],0,0),...p]});for(const m of this.processedData?.defs?.values??[]){const{id:y,missing:x,property:b}=m,S=getMissCount(this,x);y!=="angleRaw"&&S>0&&logger_exports.warnOnce(`no value was found for the key '${String(b)}' on ${S} data element${S>1?"s":""}`)}this.animationState.transition("updateData")}maybeRefreshNodeData(){if(!this.nodeDataRefresh)return;const{nodeData:t=[],phantomNodeData:e}=this.createNodeData()??{};this.nodeData=t,this.phantomNodeData=e,this.nodeDataRefresh=!1}getProcessedDataValues(t,e){const i=t.resolveColumnById(this,"angleValue",e),s=t.resolveColumnById(this,"angleRaw",e),n=this.properties.angleFilterKey!=null?t.resolveColumnById(this,"angleFilterValue",e):void 0,o=this.properties.angleFilterKey!=null?t.resolveColumnById(this,"angleFilterRaw",e):void 0,a=this.properties.radiusKey?t.resolveColumnById(this,"radiusValue",e):void 0,r=this.properties.radiusKey?t.resolveColumnById(this,"radiusRaw",e):void 0,l=this.properties.calloutLabelKey?t.resolveColumnById(this,"calloutLabelValue",e):void 0,c=this.properties.sectorLabelKey?t.resolveColumnById(this,"sectorLabelValue",e):void 0,h=this.properties.legendItemKey?t.resolveColumnById(this,"legendItemValue",e):void 0;return{angleValues:i,angleRawValues:s,angleFilterValues:n,angleFilterRawValues:o,radiusValues:a,radiusRawValues:r,calloutLabelValues:l,sectorLabelValues:c,legendItemValues:h}}createNodeData(){const{id:t,processedData:e,dataModel:i,angleScale:s,ctx:{legendManager:n},visible:o}=this,{rotation:a}=this.properties;if(!i||e?.type!=="ungrouped")return;const{angleValues:r,angleRawValues:l,angleFilterValues:c,angleFilterRawValues:h,radiusValues:d,radiusRawValues:u,calloutLabelValues:p,sectorLabelValues:g,legendItemValues:f}=this.getProcessedDataValues(i,e),m=h?.some((A,D)=>A>l[D])??!1;let y=0,x=0;const b=[],S=h!=null?[]:void 0,v=e.dataSources.get(this.id)??[],I=e.invalidData?.get(this.id);return v.forEach((A,D)=>{if(I?.[D]===!0)return;const T=m?c[D]:r[D],k=h!=null&&!m?Math.sqrt(h[D]/l[D]):1,w=s.convert(y)+toRadians(a);y=T,x+=T;const L=s.convert(y)+toRadians(a),O=Math.abs(L-w),F=w+O/2,R=l[D],_=(d?.[D]??1)*k,G=u?.[D],B=f?.[D],z=this.getLabels(A,F,O,!0,p?.[D],g?.[D],B),P=this.getSectorFormat(A,D,!1),V={itemId:D,series:this,datum:A,datumIndex:D,angleValue:R,midAngle:F,midCos:Math.cos(F),midSin:Math.sin(F),startAngle:w,endAngle:L,radius:_,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(_),0),sectorFormat:P,radiusValue:G,legendItemValue:B,enabled:o&&n.getItemEnabled({seriesId:t,itemId:D}),...z};b.push(V),S?.push({...V,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0)})}),this.zerosumOuterRing.visible=x===0,{itemId:t,nodeData:b,labelData:b,phantomNodeData:S}}getLabels(t,e,i,s,n,o,a){const{calloutLabel:r,sectorLabel:l,legendItemKey:c}=this.properties,h=!s||r.enabled?this.properties.calloutLabelKey:void 0,d=!s||l.enabled?this.properties.sectorLabelKey:void 0;if(!h&&!d&&!c)return{};const u={datum:t,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey},p={};return h&&i>=toRadians(r.minAngle)&&(p.calloutLabel={...this.getTextAlignment(e),text:this.getLabelText(r,{...u,value:n}),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),d&&(p.sectorLabel={text:this.getLabelText(l,{...u,value:o})}),c!=null&&a!=null&&(p.legendItem={key:c,text:a}),p}getTextAlignment(t){const e=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=normalizeAngle180(t),s=-.75*Math.PI,n=i-s,o=Math.floor(n/(Math.PI/2)),a=modulus(o,e.length);return e[a]}getNodeFill(t,e,i){return getShapeFill(t,{type:"gradient",bounds:"series",colorStops:e.map(s=>({color:s})),gradient:"radial",rotation:0,reverse:!0},{type:"pattern",pattern:"forward-slanted-lines",fill:i,fillOpacity:1,backgroundFill:"transparent",backgroundFillOpacity:1,stroke:i,strokeOpacity:1,strokeWidth:4,rotation:0})}getFillParams(t,e,i){if(!(!isGradientFill(t)||t.bounds==="item"))return{centerX:0,centerY:0,innerRadius:e,outerRadius:i}}getSectorFormat(t,e,i){const{angleKey:s,radiusKey:n,calloutLabelKey:o,sectorLabelKey:a,legendItemKey:r,fills:l,strokes:c,defaultColorRange:h,defaultPatternFills:d,itemStyler:u}=this.properties,p=c[e%c.length],{fill:g,fillOpacity:f,stroke:m,strokeWidth:y,strokeOpacity:x,lineDash:b,lineDashOffset:S,cornerRadius:v}=mergeDefaults(i&&this.properties.highlightStyle.item,{fill:l.length>0?l[e%l.length]:void 0,stroke:p,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()},this.properties),I=h[e%h.length],A=d[e%d.length],D=g??"black";let T;return u&&(T=this.cachedDatumCallback(this.getDatumId(t,e)+(i?"-highlight":"-hide"),()=>this.callWithContext(u,{datum:t,angleKey:s,radiusKey:n,calloutLabelKey:o,sectorLabelKey:a,legendItemKey:r,fill:this.getNodeFill(D,I,A),strokeOpacity:x,stroke:m,strokeWidth:y,fillOpacity:f,lineDash:b,lineDashOffset:S,cornerRadius:v,highlighted:i,seriesId:this.id}))),{fill:this.getNodeFill(T?.fill??D,I,A),fillOpacity:T?.fillOpacity??f,stroke:T?.stroke??m,strokeWidth:T?.strokeWidth??y,strokeOpacity:T?.strokeOpacity??x,lineDash:T?.lineDash??b,lineDashOffset:T?.lineDashOffset??S,cornerRadius:T?.cornerRadius??v}}getOuterRadius(){return Math.max(this.radius*this.properties.outerRadiusRatio+this.properties.outerRadiusOffset,0)}updateRadiusScale(t){const e=[0,this.getOuterRadius()];this.radiusScale.range=e,t&&(this.previousRadiusScale.range=e);const i=s=>({...s,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(s.radius),0)});this.nodeData=this.nodeData.map(i),this.phantomNodeData=this.phantomNodeData?.map(i)}getTitleTranslationY(){const t=Math.max(0,this.radiusScale.range[1]);if(t===0)return NaN;const i=2+(this.properties.title?.spacing??0),s=Math.max(0,-t);return-t-i-s}update({seriesRect:t}){const{title:e}=this.properties,i={seriesRectWidth:t?.width,seriesRectHeight:t?.height},s=jsonDiff(this.nodeDataDependencies,i)!=null;if(s&&(this._nodeDataDependencies=i),this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(s),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),e){const n=this.getTitleTranslationY();e.node.y=isFinite(n)?n:0;const o=e.node.getBBox();e.node.visible=e.enabled&&isFinite(n)&&!this.bboxIntersectsSurroundingSeries(o)}this.zerosumOuterRing.fillOpacity=0,this.zerosumOuterRing.stroke=this.properties.calloutLabel.color,this.zerosumOuterRing.strokeWidth=1,this.zerosumOuterRing.strokeOpacity=1,this.updateNodeMidPoint(),this.updateSelections(),this.updateNodes(t)}updateTitleNodes(){const{oldTitle:t}=this,{title:e}=this.properties;t!==e&&(t&&this.labelGroup?.removeChild(t.node),e&&(e.node.textBaseline="bottom",this.labelGroup?.appendChild(e.node)),this.oldTitle=e)}updateNodeMidPoint(){const t=e=>{const i=e.innerRadius+(e.outerRadius-e.innerRadius)/2;e.midPoint={x:e.midCos*Math.max(0,i),y:e.midSin*Math.max(0,i)}};this.nodeData.forEach(t),this.phantomNodeData?.forEach(t)}updateSelections(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,highlightLabelSelection:s,calloutLabelSelection:n,labelSelection:o}=this,a=this.nodeData.map(l=>({...l,sectorFormat:{...l.sectorFormat}})),r=(l,c)=>{l.update(c,void 0,h=>this.getDatumId(h.datum,h.datumIndex)),this.ctx.animationManager.isSkipped()&&l.cleanup()};r(t,this.nodeData),r(e,a),r(i,this.phantomNodeData??[]),n.update(this.calloutNodeData,l=>{const c=new Line;c.tag=0,c.pointerEvents=1,l.appendChild(c);const h=new Text;h.tag=1,h.pointerEvents=1,l.appendChild(h)}),o.update(this.nodeData),s.update(a)}updateNodes(t){const e=this.ctx.highlightManager.getActiveHighlight(),{visible:i}=this;this.backgroundGroup.visible=i,this.contentGroup.visible=i,this.highlightGroup.visible=i&&e?.series===this,this.highlightLabel.visible=i&&e?.series===this,this.labelGroup&&(this.labelGroup.visible=i),this.contentGroup.opacity=this.getOpacity();const s=this.radiusScale.range[0],n=this.radiusScale.range[1],o=this.getShapeFillBBox(),a=this.ctx.animationManager.isSkipped(),r=(l,c,h,d)=>{const u=this.getSectorFormat(c.datum,c.itemId,d);c.sectorFormat.fill=u.fill,c.sectorFormat.stroke=u.stroke,a&&(l.startAngle=c.startAngle,l.endAngle=c.endAngle,l.innerRadius=c.innerRadius,l.outerRadius=c.outerRadius),(d||a)&&(l.fill=u.fill,l.stroke=u.stroke);const p=this.getFillParams(u.fill,s,n);applyShapeFillBBox(l,u.fill,o,p),l.strokeWidth=u.strokeWidth,l.fillOpacity=u.fillOpacity,l.strokeOpacity=u.strokeOpacity,l.lineDash=u.lineDash,l.lineDashOffset=u.lineDashOffset,l.cornerRadius=u.cornerRadius,l.fillShadow=this.properties.shadow;const g=Math.max((this.properties.sectorSpacing+(u.stroke!=null?u.strokeWidth:0))/2,0);l.inset=g,l.lineJoin=this.properties.sectorSpacing>=0||g>0?"miter":"round"};this.itemSelection.each((l,c,h)=>r(l,c,h,!1)),this.highlightSelection.each((l,c,h)=>{r(l,c,h,!0),l.visible=c.itemId===e?.itemId}),this.phantomSelection.each((l,c,h)=>r(l,c,h,!1)),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(t),this.updateSectorLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{calloutLine:{length:t,strokeWidth:e,colors:i},strokes:s}=this.properties,n=e,o=isStringFillArray(i)?i:s,{offset:a}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach((r,l)=>{const c=r.closestDatum(),{calloutLabel:h,outerRadius:d}=c;if(h?.text&&!h.hidden&&d!==0){r.visible=!0,r.strokeWidth=n,r.stroke=o[l%o.length],r.fill=void 0;const u=c.midCos*d,p=c.midSin*d;let g=c.midCos*(d+t),f=c.midSin*(d+t);if((h.collisionTextAlign??h.collisionOffsetY!==0)&&h.box!=null){const y=h.box;let x=g,b=f;g<y.x?x=y.x:g>y.x+y.width&&(x=y.x+y.width),f<y.y?b=y.y:f>y.y+y.height&&(b=y.y+y.height);const S=x-g,v=b-f,I=Math.sqrt(Math.pow(S,2)+Math.pow(v,2)),A=I-a;A>0&&(g=g+S*A/I,f=f+v*A/I)}r.x1=u,r.y1=p,r.x2=g,r.y2=f}else r.visible=!1})}getLabelOverflow(t,e,i){const s=-this.centerX,n=s+i.width,o=-this.centerY,a=o+i.height,r=1;let l=1;e.x+r<s?l=(e.x+e.width-s)/e.width:e.x+e.width-r>n&&(l=(n-e.x)/e.width);const c=e.y+r<o||e.y+e.height-r>a,h=l===1?t.length:Math.floor(t.length*l)-1,d=this.bboxIntersectsSurroundingSeries(e);return{textLength:h,hasVerticalOverflow:c,hasSurroundingSeriesOverflow:d}}bboxIntersectsSurroundingSeries(t){const{surroundingRadius:e}=this;if(e==null)return!1;const i=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],s=e**2;return i.some(n=>n.x**2+n.y**2>s)}computeCalloutLabelCollisionOffsets(){const{radiusScale:t}=this,{calloutLabel:e,calloutLine:i}=this.properties,{offset:s,minSpacing:n}=e,o=t.convert(0),a=y=>!y.calloutLabel||y.outerRadius===0,r=this.calloutNodeData,l=r.filter(y=>!a(y));if(l.forEach(y=>{const x=y.calloutLabel;x!=null&&(x.hidden=!1,x.collisionTextAlign=void 0,x.collisionOffsetY=0)}),l.length<=1)return;const c=l.filter(y=>y.midCos<0).sort((y,x)=>y.midSin-x.midSin),h=l.filter(y=>y.midCos>=0).sort((y,x)=>y.midSin-x.midSin),d=l.filter(y=>y.midSin<0&&y.calloutLabel?.textAlign==="center").sort((y,x)=>y.midCos-x.midCos),u=l.filter(y=>y.midSin>=0&&y.calloutLabel?.textAlign==="center").sort((y,x)=>y.midCos-x.midCos),p=y=>{const x=y.calloutLabel;if(x==null)return BBox.zero.clone();const b=y.outerRadius+i.length+s,S=y.midCos*b,v=y.midSin*b+x.collisionOffsetY,I=x.collisionTextAlign??x.textAlign,A=x.textBaseline;return Text.computeBBox(x.text,S,v,{font:this.properties.calloutLabel,textAlign:I,textBaseline:A})},g=(y,x,b)=>{const S=p(y).grow(n/2),v=p(x).grow(n/2);S.x<v.x+v.width&&S.x+S.width>v.x&&(b==="to-top"?S.y<v.y+v.height:S.y+S.height>v.y)&&(x.calloutLabel.collisionOffsetY=b==="to-top"?S.y-v.y-v.height:S.y+S.height-v.y)},f=y=>{const x=y.slice().sort((S,v)=>Math.abs(S.midSin)-Math.abs(v.midSin))[0],b=y.indexOf(x);for(let S=b-1;S>=0;S--){const v=y[S+1],I=y[S];g(v,I,"to-top")}for(let S=b+1;S<y.length;S++){const v=y[S-1],I=y[S];g(v,I,"to-bottom")}},m=y=>{const x=l.some(D=>D.calloutLabel.collisionOffsetY!==0),b=y.map(D=>p(D)),S=b.map(D=>D.clone().grow(n/2));let v=!1;for(let D=0;D<S.length&&!v;D++){const T=S[D];for(let k=D+1;k<y.length;k++){const w=S[k];if(T.collidesBBox(w)){v=!0;break}}}const I=r.map(D=>{const{startAngle:T,endAngle:k,outerRadius:w}=D;return{startAngle:T,endAngle:k,innerRadius:o,outerRadius:w}}),A=b.some(D=>I.some(T=>boxCollidesSector(D,T)));!v&&!x&&!A||y.filter(D=>D.calloutLabel.textAlign==="center").forEach(D=>{const T=D.calloutLabel;D.midCos<0?T.collisionTextAlign="right":D.midCos>0?T.collisionTextAlign="left":T.collisionTextAlign="center"})};f(c),f(h),m(d),m(u)}updateCalloutLabelNodes(t){const{radiusScale:e}=this,{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:o,color:a}=i,r=new Text;this.calloutLabelSelection.selectByTag(1).forEach(l=>{const c=l.closestDatum(),h=c.calloutLabel,d=e.convert(c.radius),u=Math.max(0,d);if(!h?.text||u===0||h.hidden){l.visible=!1;return}const p=u+n+o,g=c.midCos*p,f=c.midSin*p+h.collisionOffsetY,m={textAlign:h.collisionTextAlign??h.textAlign,textBaseline:h.textBaseline};r.text=h.text,r.x=g,r.y=f,r.setFont(this.properties.calloutLabel),r.setAlign(m);const y=r.getBBox();let x=h.text,b=!0;if(i.avoidCollisions){const{textLength:S,hasVerticalOverflow:v}=this.getLabelOverflow(h.text,y,t);x=h.text.length===S?h.text:`${h.text.substring(0,S)}\u2026`,b=!v}l.text=x,l.x=g,l.y=f,l.setFont(this.properties.calloutLabel),l.setAlign(m),l.fill=a,l.visible=b})}computeLabelsBBox(t,e){const{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:o,maxCollisionOffset:a,minSpacing:r}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],c=new Text;let h;const{title:d}=this.properties;if(d?.text&&d.enabled){const u=this.getTitleTranslationY();isFinite(u)&&(c.text=d.text,c.x=0,c.y=u,c.setFont(d),c.setAlign({textBaseline:"bottom",textAlign:"center"}),h=c.getBBox(),l.push(h))}return this.calloutNodeData.forEach(u=>{const p=u.calloutLabel;if(!p||u.outerRadius===0)return null;const g=u.outerRadius+n+o,f=u.midCos*g,m=u.midSin*g+p.collisionOffsetY;c.text=p.text,c.x=f,c.y=m,c.setFont(this.properties.calloutLabel),c.setAlign({textAlign:p.collisionTextAlign??p.textAlign,textBaseline:p.textBaseline});const y=c.getBBox();if(p.box=y,Math.abs(p.collisionOffsetY)>a){p.hidden=!0;return}if(h){const x=-this.centerY,b=new BBox(h.x-r,x,h.width+2*r,h.y+h.height+r-x);if(y.collidesBBox(b)){p.hidden=!0;return}}if(t.hideWhenNecessary){const{textLength:x,hasVerticalOverflow:b,hasSurroundingSeriesOverflow:S}=this.getLabelOverflow(p.text,y,e),v=p.text.length>2&&x<2;if(b||v||S){p.hidden=!0;return}}p.hidden=!1,l.push(y)}),l.length===0?null:BBox.merge(l)}updateSectorLabelNodes(){const{radiusScale:t}=this,e=t.convert(0),{fontSize:i,fontStyle:s,fontWeight:n,fontFamily:o,positionOffset:a,positionRatio:r,color:l}=this.properties.sectorLabel,c=e>0,h=this.ctx.legendManager.getData(this.id)?.filter(u=>u.enabled).length===1,d=(u,p)=>{const{sectorLabel:g,outerRadius:f,startAngle:m,endAngle:y}=p;let x=!1;if(g&&f!==0){const b=e*(1-r)+f*r+a;u.fill=l,u.fontStyle=s,u.fontWeight=n,u.fontSize=i,u.fontFamily=o,u.text=g.text,!c&&h?(u.x=0,u.y=0):(u.x=p.midCos*b,u.y=p.midSin*b),u.textAlign="center",u.textBaseline="middle";const v=u.getBBox(),I=[[v.x,v.y],[v.x+v.width,v.y],[v.x+v.width,v.y+v.height],[v.x,v.y+v.height]],A={startAngle:m,endAngle:y,innerRadius:e,outerRadius:f};I.every(([D,T])=>isPointInSector(D,T,A))&&(x=!0)}u.visible=x};this.labelSelection.each(d),this.highlightLabelSelection.each(d)}updateZerosumRings(){this.zerosumOuterRing.size=this.getOuterRadius()*2}pickNodeClosestDatum(t){return pickByMatchingAngle(this,t)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{legendItemKey:o,calloutLabelKey:a,calloutLabelName:r,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:d,radiusKey:u,radiusName:p,tooltip:g}=n,f=this.properties.title.text;if(!i||!s)return;const m=s.dataSources.get(this.id)?.[t],{angleRawValues:y,legendItemValues:x,calloutLabelValues:b,sectorLabelValues:S}=this.getProcessedDataValues(i,s),v=y[t],I=x?.[t]??(a===h?void 0:b?.[t])??(l===h?void 0:S?.[t])??d;return g.formatTooltip(this.properties,{title:f,symbol:this.legendItemSymbol(t),data:[{label:I,fallbackLabel:h,value:formatValue(v,3)}]},{seriesId:e,datum:m,title:d,legendItemKey:o,calloutLabelKey:a,calloutLabelName:r,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:d,radiusKey:u,radiusName:p,...this.getSectorFormat(m,t,!1)})}legendItemSymbol(t){const e=this.processedData?.dataSources.get(this.id)?.[t],i=this.getSectorFormat(e,t,!1),{fillOpacity:s,strokeOpacity:n,strokeWidth:o,lineDash:a,lineDashOffset:r}=this.properties;let{fill:l}=i;const{stroke:c}=i;return isGradientFill(l)&&(l={...l,gradient:"linear",rotation:0,reverse:!1}),{marker:{fill:l,stroke:c,fillOpacity:s,strokeOpacity:n,strokeWidth:o,lineDash:a,lineDashOffset:r}}}getLegendData(t){const{id:e,visible:i,processedData:s,dataModel:n,ctx:{legendManager:o}}=this;if(!n||!s||t!=="category")return[];const{angleKey:a,calloutLabelKey:r,sectorLabelKey:l,legendItemKey:c,showInLegend:h}=this.properties;if(!c&&(!r||r===a)&&(!l||l===a))return[];const{calloutLabelValues:d,sectorLabelValues:u,legendItemValues:p,angleRawValues:g}=this.getProcessedDataValues(n,s),f=this.properties.title?.showInLegend&&this.properties.title.text,m=[],y=this.properties.hideZeroValueSectorsInLegend,x=s.dataSources.get(this.id),b=s.invalidData?.get(this.id);for(let S=0;S<s.input.count;S++){const v=x?.[S],I=g[S];if(b?.[S]===!0||y&&I===0)continue;const A=[];f&&A.push(f);const D=this.getLabels(v,2*Math.PI,2*Math.PI,!1,d?.[S],u?.[S],p?.[S]);c&&D.legendItem!==void 0?A.push(D.legendItem.text):r&&r!==a&&D.calloutLabel?.text!==void 0?A.push(D.calloutLabel?.text):l&&l!==a&&D.sectorLabel?.text!==void 0&&A.push(D.sectorLabel?.text),A.length!==0&&m.push({legendType:"category",id:e,datum:v,itemId:S,seriesId:e,enabled:i&&o.getItemEnabled({seriesId:e,itemId:S}),label:{text:A.join(" - ")},symbol:this.legendItemSymbol(S),legendItemName:c!=null?v[c]:void 0,hideInLegend:!h})}return m}setLegendState(t){const{id:e,ctx:{legendManager:i,updateService:s}}=this;t.forEach((n,o)=>i.toggleItem(n,e,o)),i.update(),s.update(4)}animateEmptyUpdateReady(t){const{animationManager:e}=this.ctx,i=preparePieSeriesAnimationFunctions(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);fromToMotion(this.id,"nodes",e,[this.itemSelection,this.highlightSelection,this.phantomSelection],i.nodes,(s,n)=>this.getDatumId(n.datum,n.datumIndex)),seriesLabelFadeInAnimation(this,"callout",e,this.calloutLabelSelection),seriesLabelFadeInAnimation(this,"sector",e,this.labelSelection),seriesLabelFadeInAnimation(this,"highlight",e,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,processedData:s,radiusScale:n,previousRadiusScale:o}=this,{animationManager:a}=this.ctx,r=s?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=(r?.moved.size??0)===0,c=(s?.defs.keys.length??0)>0,h=s?.reduced?.animationValidation?.uniqueKeys??!0;(!l||!c||!h)&&this.ctx.animationManager.skipCurrentBatch();const d=preparePieSeriesAnimationFunctions(!1,this.properties.rotation,n,o);fromToMotion(this.id,"nodes",a,[t,e,i],d.nodes,(u,p)=>this.getDatumId(p.datum,p.datumIndex),r),seriesLabelFadeInAnimation(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),seriesLabelFadeInAnimation(this,"sector",this.ctx.animationManager,this.labelSelection),seriesLabelFadeInAnimation(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,radiusScale:s,previousRadiusScale:n}=this,{animationManager:o}=this.ctx,a=preparePieSeriesAnimationFunctions(!1,this.properties.rotation,s,n);fromToMotion(this.id,"nodes",o,[t,e,i],a.nodes,(r,l)=>this.getDatumId(l.datum,l.datumIndex)),seriesLabelFadeOutAnimation(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),seriesLabelFadeOutAnimation(this,"sector",this.ctx.animationManager,this.labelSelection),seriesLabelFadeOutAnimation(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(t,e){const{calloutLabelKey:i,sectorLabelKey:s,legendItemKey:n}=this.properties;return this.processedData?.reduced?.animationValidation?.uniqueKeys?n?createDatumId(t[n]):i?createDatumId(t[i]):s?createDatumId(t[s]):`${e}`:`${e}`}};PieSeries.className="PieSeries",PieSeries.type="pie";var pieTheme={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.1666666666666667]},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"backgroundColor"},positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2,colors:{$map:[{$if:[{$or:[{$isGradient:[{$value:"$1"}]},{$isPattern:[{$value:"$1"}]}]},{$path:["../../strokes/$index",{$ref:"foregroundColor"}]},{$value:"$1"}]},{$if:[{$eq:[{$path:"../strokeWidth"},0]},{$path:"../fills"},{$path:"../strokes"}]}]}},fills:{$palette:"fills"},strokes:{$palette:"strokes"},defaultColorRange:{$palette:"gradients"},defaultPatternFills:SAFE_FILLS_OPERATION,fillOpacity:1,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,shadow:{enabled:!1,color:DEFAULT_SHADOW_COLOUR,xOffset:3,yOffset:3,blur:5}},legend:{enabled:!0}},PieSeriesModule={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"pie",moduleFactory:t=>new PieSeries(t),tooltipDefaults:{range:"exact"},themeTemplate:pieTheme},NewPieSeriesModule={type:"series",name:"pie",chartType:"polar",options:pieSeriesOptionsDef,create:t=>new PieSeries(t)};function registerInbuiltModules(){moduleRegistry.register(BackgroundModule,CommunityLegendModule,LocaleModule,AreaSeriesModule,BarSeriesModule,BubbleSeriesModule,LineSeriesModule,ScatterSeriesModule,DonutSeriesModule,PieSeriesModule,HistogramSeriesModule);for(const t of[NumberAxis,CategoryAxis,TimeAxis,GroupedCategoryAxis,LogAxis])axisRegistry.register(t.type,{moduleFactory:e=>new t(e)})}function setupModules(){for(const t of moduleRegistry.modules){if(t.packageType==="enterprise"&&!verifyIfModuleExpected(t)&&logger_exports.errorOnce("Unexpected enterprise module registered: "+t.identifier),t.type==="root"&&t.themeTemplate)for(const e of t.chartTypes)chartDefaults.set(e,t.themeTemplate);if(t.type==="series"){if(t.chartTypes.length>1)throw new Error(`AG Charts - Module definition error: ${t.identifier}`);seriesRegistry.register(t.identifier,t)}if(t.type==="series-option"&&t.themeTemplate)for(const e of t.seriesTypes)seriesRegistry.setThemeTemplate(e,t.themeTemplate);if(t.type==="axis-option"&&t.themeTemplate)for(const e of t.axisTypes){const i=axisRegistry.getThemeTemplate(e),s=mergeDefaults(t.themeTemplate,i);axisRegistry.setThemeTemplate(e,s)}t.type==="axis"&&axisRegistry.register(t.identifier,t),t.type==="legend"&&legendRegistry.register(t.identifier,t)}if(moduleRegistry.hasEnterpriseModules()){const t=getUnusedExpectedModules();t.length>0&&logger_exports.errorOnce("Enterprise modules expected but not registered: ",t)}}var directions=["top","right","bottom","left"],_CartesianChart=class ne extends Chart{constructor(e,i){super(e,i),this.paired=!0,this.lastUpdateClipRect=void 0,this.lastLayoutWidth=NaN,this.lastLayoutHeight=NaN}onAxisChange(e,i){super.onAxisChange(e,i),this.ctx!=null&&this.ctx.zoomManager.updateAxes(e)}destroySeries(e){super.destroySeries(e),this.lastLayoutWidth=NaN,this.lastLayoutHeight=NaN}getChartType(){return"cartesian"}setRootClipRects(e){const{seriesRoot:i,annotationRoot:s}=this;i.setClipRect(e),s.setClipRect(e)}async processData(){await super.processData();for(const e of this.axes){const i=this.getSyncedDomain(e);i!=null&&e.setDomains(i)}this.ctx.updateService.dispatchProcessData({series:{shouldFlipXY:this.shouldFlipXY()}})}performLayout(e){const{seriesRoot:i,annotationRoot:s}=this,{clipSeries:n,seriesRect:o,visible:a}=this.updateAxes(e.layoutBox);this.seriesRoot.visible=a,this.seriesRect=o,this.animationRect=e.layoutBox;const{x:r,y:l}=o;if(e.width!==this.lastLayoutWidth||e.height!==this.lastLayoutHeight)for(const u of[i,s])u.translationX=Math.floor(r),u.translationY=Math.floor(l);else{const{translationX:u,translationY:p}=i;staticFromToMotion(this.id,"seriesRect",this.ctx.animationManager,[i,s],{translationX:u,translationY:p},{translationX:Math.floor(r),translationY:Math.floor(l)},{phase:"update"})}this.lastLayoutWidth=e.width,this.lastLayoutHeight=e.height;const c=o.clone().grow(this.seriesArea.padding),h=this.seriesArea.clip||n?c:void 0,{lastUpdateClipRect:d}=this;this.lastUpdateClipRect=h,this.ctx.animationManager.isActive()&&d!=null?this.ctx.animationManager.animate({id:this.id,groupId:"clip-rect",phase:"update",from:d,to:c,onUpdate:u=>this.setRootClipRects(u),onComplete:()=>this.setRootClipRects(h)}):this.setRootClipRects(h),this.ctx.layoutManager.emitLayoutComplete(e,{axes:this.axes.map(u=>u.getLayoutState()),series:{visible:a,rect:o,paddedRect:c},clipSeries:n})}updateAxes(e){const{clipSeries:i,seriesRect:s,overflows:n}=this.resolveAxesLayout(e);for(const o of this.axes)o.update(),o.setCrossLinesVisible(!n),this.clipAxis(o,s,e);return{clipSeries:i,seriesRect:s,visible:!n}}resolveAxesLayout(e){let i,s,n=0;const o=10;do if(s=i??this.getDefaultState(),i=this.updateAxesPass(new Map(s.axisAreaWidths),e.clone()),n++>o){logger_exports.warn("Max iterations reached. Unable to stabilize axes layout.");break}while(!this.isLayoutStable(i,s));return this.lastAreaWidths=i.axisAreaWidths,i}updateAxesPass(e,i){const s=new Map,n={};let o=!1,a=!1;for(const y of directions){const x=this.seriesArea.padding[y],b=this.axes.findLast(S=>S.position===y);b?b.seriesAreaPadding=x:i.shrink(x,y)}const r=(e.get("left")??0)+(e.get("right")??0),l=(e.get("top")??0)+(e.get("bottom")??0),c=this.buildCrossLinePadding(e);i.width<=r+c.hPadding||i.height<=l+c.vPadding?o=!0:i.shrink(c);const h=i.clone().shrink(Object.fromEntries(e));for(const y of this.axes){const{position:x="left",direction:b}=y;this.sizeAxis(y,h,x);const S=b==="y",{primaryTickCount:v,bbox:I}=y.calculateLayout(y.nice?n[b]:void 0);n[b]??(n[b]=v),a||(a=y.dataDomain.clipped||y.visibleRange[0]>0||y.visibleRange[1]<1),s.set(y.id,Math.ceil(y.thickness??(S?I?.width:I?.height)??0))}const d=groupBy(this.axes,y=>y.position??"left"),{width:u,height:p,pixelRatio:g}=this.ctx.scene,f=new Map,m=new Map;for(const[y,x]of entries(d)){let S=y==="left"||y==="right"?p%g:u%g,v=0;for(const I of x??[]){m.set(I.id,S);const A=s.get(I.id)??0;v=Math.max(v,S+A),I.layoutConstraints.stacked&&(S+=A+ne.AxesPadding)}f.set(y,Math.ceil(v))}for(const[y,x]of entries(d))this.positionAxes({axes:x??[],position:y,axisWidths:s,axisOffsets:m,axisAreaWidths:f,axisBound:i,seriesRect:h});return{clipSeries:a,seriesRect:h,axisAreaWidths:f,overflows:o}}buildCrossLinePadding(e){const i={top:0,right:0,bottom:0,left:0,hPadding:0,vPadding:0};this.axes.forEach(s=>{s.crossLines?.forEach(n=>{n.calculatePadding?.(i)})});for(const[s,n=0]of entries(i))i[s]=Math.max(n-(e.get(s)??0),0);return i.hPadding=i.left+i.right,i.vPadding=i.top+i.bottom,i}clampToOutsideSeriesRect(e,i,s,n){const o=s==="x"?e.x:e.y,a=s==="x"?e.width:e.height;return n===1?Math.min(i,o+a):Math.max(i,o)}getSyncedDomain(e){const i=this.modulesManager.getModule("sync");if(!i?.enabled)return;const s=i.getSyncedDomain(e);if(s&&e.dataDomain.domain.length){let n;const{domain:o}=e.scale;if(ContinuousScale.is(e.scale)){const[a,r]=findMinMax(s);n=a!==o[0]||r!==o[1]}else n=!arraysEqual(s,o);n&&!this.skipSync&&i.updateSiblings()}return s}sizeAxis(e,i,s){const n=e instanceof CategoryAxis,o=s==="left"||s==="right",{width:a,height:r}=i,l=o?r:a;let c=0,h=l,{min:d,max:u}=this.ctx.zoomManager.getAxisZoom(e.id);const{width:p,unit:g,align:f}=e.layoutConstraints;g==="px"?h=c+p:h=h*p/100,f==="end"&&(c=l-(h-c),h=l),o&&(n?[d,u]=[1-u,1-d]:[c,h]=[h,c]),e.range=[c,h],e.visibleRange=[d,u],e.gridLength=o?a:r}positionAxes(e){const{axes:i,axisBound:s,axisWidths:n,axisOffsets:o,axisAreaWidths:a,seriesRect:r,position:l}=e,c=a.get(l)??0;let h="x",d="y",u=1;(l==="top"||l==="bottom")&&(h="y",d="x");let p=s[h];(l==="right"||l==="bottom")&&(u=-1,p+=h==="x"?s.width:s.height);for(const g of i){const f=a.get(d==="x"?"left":"top")??0,m=n.get(g.id)??0,y=o.get(g.id)??0;g.gridPadding=c-y-m,g.translation[d]=s[d]+f,g.translation[h]=this.clampToOutsideSeriesRect(r,p+u*(y+m),h,u)}}shouldFlipXY(){return this.series.every(e=>e instanceof CartesianSeries&&e.shouldFlipXY())}getDefaultState(){const e=new Map;if(this.lastAreaWidths)for(const{position:i="left"}of this.axes){const s=this.lastAreaWidths.get(i);s!=null&&e.set(i,s)}return{axisAreaWidths:e,clipSeries:!1,overflows:!1}}isLayoutStable(e,i){if(i.overflows!==e.overflows||i.clipSeries!==e.clipSeries)return!1;for(const s of e.axisAreaWidths.keys())if(!i.axisAreaWidths.has(s))return!1;for(const[s,n]of i.axisAreaWidths.entries()){const o=e.axisAreaWidths.get(s);if((n!=null||o!=null)&&n!==o)return!1}return!0}clipAxis(e,i,s){const n=Math.ceil(e.gridLine?.width??0),o=Math.ceil(e.line?.width??0);let{width:a,height:r}=i;switch(a+=e.direction==="x"?n:o,r+=e.direction==="y"?n:o,e.clipGrid(i.x,i.y,a,r),e.position){case"left":case"right":e.clipTickLines(s.x,i.y-n,s.width+n,i.height+n*2);break;case"top":case"bottom":e.clipTickLines(i.x-n,s.y,i.width+n*2,s.height+n);const{label:l,labelNodes:c,scale:h}=e;if(ContinuousScale.is(h)&&l.enabled&&l.avoidCollisions&&c.length>1){const d=c.toSorted((f,m)=>f.translationY-m.translationY),u=d.at(-1),p=u.getBBox(),g=i.x+p.y+p.height<=s.x+s.width+this.padding.right;if(u.visible=g,g||e.visibleRange[0]>0||e.visibleRange[1]<1)d[0].visible=!0;else{const f=d[0].getBBox();d[0].visible=f.y>=0}}break}}};_CartesianChart.className="CartesianChart",_CartesianChart.type="cartesian",_CartesianChart.AxesPadding=15;var CartesianChart=_CartesianChart,htmlElement=attachDescription(t=>typeof HTMLElement>"u"||t instanceof HTMLElement,"an html element"),commonChartOptions={mode:union("integrated","standalone"),container:htmlElement,theme:defined,series:array,annotations:defined,navigator:defined,initialState:defined},cartesianChartOptionsDefs={...commonChartOptionsDefs,...commonChartOptions,axes:defined,data:array},polarChartOptionsDefs={...commonChartOptionsDefs,...commonChartOptions,axes:defined,data:array},topologyChartOptionsDefs={...commonChartOptionsDefs,...commonChartOptions,data:array,topology:object},standaloneChartOptionsDefs={...commonChartOptionsDefs,...commonChartOptions,data:array},hierarchyChartOptionsDefs={...commonChartOptionsDefs,...commonChartOptions,data:array},flowProportionChartOptionsDefs={...commonChartOptionsDefs,...commonChartOptions,data:array,nodes:array},gaugeChartOptionsDefs={...commonChartOptionsDefs,...commonChartOptions,data:array},CartesianChartModule={type:"chart",name:"cartesian",options:cartesianChartOptionsDefs,detect:isAgCartesianChartOptions,create(t,e){return new CartesianChart(t,e)}},placeholderCreate=()=>{throw new Error("Enterprise module placeholder cannot be initialised")},FlowProportionChartModule={type:"chart",name:"flow-proportion",placeholder:!0,options:{},detect:isAgFlowProportionChartOptions,create:placeholderCreate},GaugeChartModule={type:"chart",name:"gauge",placeholder:!0,options:{},detect:isAgGaugeChartOptions,create:placeholderCreate},HierarchyChartModule={type:"chart",name:"hierarchy",placeholder:!0,options:{},detect:isAgHierarchyChartOptions,create:placeholderCreate},StandaloneChartModule={type:"chart",name:"standalone",placeholder:!0,options:{},detect:isAgStandaloneChartOptions,create:placeholderCreate},TopologyChartModule={type:"chart",name:"topology",placeholder:!0,options:{},detect:isAgTopologyChartOptions,create:placeholderCreate},PolarAxis=class extends Axis{constructor(){super(...arguments),this.shape="polygon",this.innerRadiusRatio=0,this.defaultTickMinSpacing=20}updatePosition(){super.updatePosition();const t=prepareAxisAnimationContext(this),e=resetAxisSelectionFn(t);this.axisGroup.setProperties(this.getAxisTransform()),this.gridLineGroupSelection.each(e),this.tickLineGroupSelection.each(e),this.tickLabelGroupSelection.each(resetAxisLabelSelectionFn())}computeLabelsBBox(t,e){return null}computeRange(){}getAxisLinePoints(){}};__decorateClass2([TempValidate(UNION(["polygon","circle"],"a polar axis shape"))],PolarAxis.prototype,"shape",2),__decorateClass2([TempValidate(RATIO)],PolarAxis.prototype,"innerRadiusRatio",2);var PolarChart=class extends Chart{constructor(t,e){super(t,e),this.padding=new Padding(40),this.ctx.axisManager.axisGroup.zIndex=6}getChartType(){return"polar"}async performLayout(t){const{layoutBox:e}=t;e.shrink(this.seriesArea.padding.toJson());const i=e.clone();this.seriesRect=i,this.animationRect=i,this.seriesRoot.translationX=i.x,this.seriesRoot.translationY=i.y,await this.computeCircle(i),this.axes.forEach(s=>s.update()),this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:!0,rect:i,paddedRect:i}})}updateAxes(t,e,i,s){const n=this.axes.find(l=>l.direction==="x"),o=this.axes.find(l=>l.direction==="y");if(!(n instanceof PolarAxis)||!(o instanceof PolarAxis))return;const a=n.scale,r=o.innerRadiusRatio;n.innerRadiusRatio=r,n.computeRange(),n.gridLength=s,o.gridAngles=a.ticks({nice:n.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.map(l=>a.convert(l)),o.gridRange=n.range,o.range=[s,s*r],[n,o].forEach(l=>{l.translation.x=t.x+e,l.translation.y=t.y+i,l.calculateLayout()})}async computeCircle(t){const e=this.series.filter(isPolarSeries),i=this.axes.filter(isPolarAxis),s=(c,h,d)=>{this.updateAxes(t,c,h,d),e.forEach(p=>{p.centerX=c,p.centerY=h,p.radius=d});const u=e.filter(p=>p.type==="donut"||p.type==="pie");if(u.length>1){const p=u.map(g=>{const f=g.getInnerRadius();return{series:g,innerRadius:f}}).sort((g,f)=>g.innerRadius-f.innerRadius);p.at(-1).series.surroundingRadius=void 0;for(let g=0;g<p.length-1;g++)p[g].series.surroundingRadius=p[g+1].innerRadius}},n=t.width/2,o=t.height/2,a=Math.max(0,Math.min(t.width,t.height)/2);let r=a;s(n,o,r);const l=async({hideWhenNecessary:c=!1}={})=>{const h=[];for(const p of iterate(i,e)){const g=await p.computeLabelsBBox({hideWhenNecessary:c},t);g&&h.push(g)}if(h.length===0){s(n,o,a);return}const d=BBox.merge(h),u=this.refineCircle(d,r,t);s(u.centerX,u.centerY,u.radius),r=u.radius};await l(),await l(),await l(),await l({hideWhenNecessary:!0}),await l({hideWhenNecessary:!0});for(const c of iterate(i,e))await c.computeLabelsBBox({hideWhenNecessary:!0},t);return{radius:r,centerX:n,centerY:o}}refineCircle(t,e,i){const n=-e,o=-e,a=e,r=e;let l=Math.max(0,n-t.x),c=Math.max(0,o-t.y),h=Math.max(0,t.x+t.width-a),d=Math.max(0,t.y+t.height-r);l=h=Math.max(l,h),c=d=Math.max(c,d);const u=i.width-l-h,p=i.height-c-d;let g=Math.min(u,p)/2;const f=.5*i.width/2,m=.5*i.height/2,y=Math.min(f,m);if(g<y){g=y;const S=l+h,v=c+d;if(2*g+v>i.height){const I=i.height-2*g;Math.min(c,d)*2>I?(c=I/2,d=I/2):c>d?c=I-d:d=I-c}if(2*g+S>i.width){const I=i.width-2*g;Math.min(l,h)*2>I?(l=I/2,h=I/2):l>h?l=I-h:h=I-l}}const x=l+2*g+h,b=c+2*g+d;return{centerX:(i.width-x)/2+l+g,centerY:(i.height-b)/2+c+g,radius:g}}};PolarChart.className="PolarChart",PolarChart.type="polar";function isPolarSeries(t){return t instanceof PolarSeries}function isPolarAxis(t){return t instanceof PolarAxis}var PolarChartModule={type:"chart",name:"polar",options:polarChartOptionsDefs,detect:isAgPolarChartOptions,create(t,e){return new PolarChart(t,e)}},numberAxisOptionsDefs={...cartesianAxisOptionsDefs,...continuousAxisOptions(number),type:required(constant("number")),label:{format:numberFormatValidator,...cartesianAxisLabelOptionsDefs},crosshair:cartesianAxisCrosshairOptions(!0)},logAxisOptionsDefs={...cartesianAxisOptionsDefs,...continuousAxisOptions(number),type:required(constant("log")),base:and(positiveNumberNonZero,attachDescription(t=>t!==1,"not equal to 1")),label:{format:numberFormatValidator,...cartesianAxisLabelOptionsDefs},crosshair:cartesianAxisCrosshairOptions(!0)},timeAxisOptionsDefs={...cartesianAxisOptionsDefs,...continuousAxisOptions(or(number,date),!0),type:required(constant("time")),label:{...cartesianAxisLabelOptionsDefs,format:string},crosshair:cartesianAxisCrosshairOptions(!0)},categoryAxisOptionsDefs={...cartesianAxisOptionsDefs,type:required(constant("category")),label:cartesianAxisLabelOptionsDefs,paddingInner:positiveNumber,paddingOuter:positiveNumber,groupPaddingInner:positiveNumber,crosshair:cartesianAxisCrosshairOptions()},groupedCategoryAxisOptionsDefs={...cartesianAxisOptionsDefs,type:required(constant("grouped-category")),label:cartesianAxisLabelOptionsDefs,crosshair:cartesianAxisCrosshairOptions(),paddingInner:positiveNumber,groupPaddingInner:positiveNumber,depthOptions:arrayOfDefs({label:{enabled:boolean,avoidCollisions:boolean,...fontOptionsDef},tick:{enabled:boolean,stroke:color,width:positiveNumber}},"depth options objects array")},NumberAxisModule={type:"axis",name:"number",chartType:"cartesian",options:numberAxisOptionsDefs,create:t=>new NumberAxis(t)},LogAxisModule={type:"axis",name:"log",chartType:"cartesian",options:logAxisOptionsDefs,create:t=>new LogAxis(t)},TimeAxisModule={type:"axis",name:"time",chartType:"cartesian",options:timeAxisOptionsDefs,create:t=>new TimeAxis(t)},CategoryAxisModule={type:"axis",name:"category",chartType:"cartesian",options:categoryAxisOptionsDefs,create:t=>new CategoryAxis(t)},GroupedCategoryAxisModule={type:"axis",name:"grouped-category",chartType:"cartesian",options:groupedCategoryAxisOptionsDefs,create:t=>new GroupedCategoryAxis(t)},AllCartesianCommunityModules=[CartesianChartModule,NumberAxisModule,LogAxisModule,TimeAxisModule,CategoryAxisModule,GroupedCategoryAxisModule,NewAreaSeriesModule,NewBarSeriesModule,NewBubbleSeriesModule,NewHistogramSeriesModule,NewLineSeriesModule,NewScatterSeriesModule],AllPolarCommunityModules=[PolarChartModule,NewDonutSeriesModule,NewPieSeriesModule],AllCommunityModules=[...AllCartesianCommunityModules,...AllPolarCommunityModules,FlowProportionChartModule,GaugeChartModule,HierarchyChartModule,StandaloneChartModule,TopologyChartModule],enterpriseModule={isEnterprise:!1},AgErrorBarSupportedSeriesTypes=["bar","line","scatter"],__MINI_CHART_SERIES_OPTIONS=void 0,__VERIFY_MINI_CHART_SERIES_OPTIONS=void 0;__VERIFY_MINI_CHART_SERIES_OPTIONS=__MINI_CHART_SERIES_OPTIONS;var __THEME_OVERRIDES=void 0,__VERIFY_THEME_OVERRIDES=void 0;__VERIFY_THEME_OVERRIDES=__THEME_OVERRIDES;var AgTooltipAnchorToType=(t=>(t.POINTER="pointer",t.NODE="node",t.CHART="chart",t))(AgTooltipAnchorToType||{}),AgTooltipPlacementType=(t=>(t.TOP="top",t.RIGHT="right",t.BOTTOM="bottom",t.LEFT="left",t.TOP_RIGHT="top-right",t.BOTTOM_RIGHT="bottom-right",t.BOTTOM_LEFT="bottom-left",t.TOP_LEFT="top-left",t.CENTER="center",t))(AgTooltipPlacementType||{}),AgTooltipPositionType=(t=>(t.POINTER="pointer",t.NODE="node",t.TOP="top",t.RIGHT="right",t.BOTTOM="bottom",t.LEFT="left",t.TOP_LEFT="top-left",t.TOP_RIGHT="top-right",t.BOTTOM_RIGHT="bottom-right",t.BOTTOM_LEFT="bottom-left",t))(AgTooltipPositionType||{}),__THEMEABLE_OPTIONS=void 0,__VERIFY_THEMEABLE_OPTIONS=void 0;__VERIFY_THEMEABLE_OPTIONS=__THEMEABLE_OPTIONS;var __AXIS_LABEL_OPTIONS=void 0,__VERIFY_AXIS_LABEL_OPTIONS=void 0;__VERIFY_AXIS_LABEL_OPTIONS=__AXIS_LABEL_OPTIONS;var IGNORED_PROP=Symbol("IGNORED_PROP");function pickProps(t,e){const i={};for(const s of Object.keys(e)){const n=e[s];n!==IGNORED_PROP&&Object.hasOwn(t,s)&&(i[s]=n)}return i}function isRadialGauge(t){return t.type==="radial-gauge"}function isLinearGauge(t){return t.type==="linear-gauge"}function tooltipOptions(t){const{enabled:e,mode:i,showArrow:s,range:n,position:o,pagination:a,delay:r,wrapping:l,interaction:c,renderer:h,...d}=t,u=pickProps(t,{enabled:e,showArrow:s,range:n,position:o,interaction:c,renderer:h,...d});return{chartTooltipOptions:pickProps(t,{enabled:IGNORED_PROP,showArrow:IGNORED_PROP,range:IGNORED_PROP,position:IGNORED_PROP,mode:i,pagination:a,delay:r,wrapping:l,...d}),seriesTooltipOptions:u}}function radialGaugeOptions(t){const{animation:e,background:i,container:s,contextMenu:n,footnote:o,height:a,listeners:r,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:d,padding:u,subtitle:p,theme:g,title:f,width:m,type:y,cursor:x,nodeClickRange:b,tooltip:S={},value:v,scale:I={},startAngle:A,endAngle:D,highlightStyle:T,segmentation:k,bar:w,needle:L,targets:O,outerRadius:F,innerRadius:R,outerRadiusRatio:E,innerRadiusRatio:_,cornerRadius:G,cornerMode:B,label:z,secondaryLabel:P,spacing:V,...j}=t,{chartTooltipOptions:H,seriesTooltipOptions:Y}=tooltipOptions(S),U=pickProps(t,{animation:e,background:i,container:s,contextMenu:n,footnote:o,height:a,listeners:r,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:d,padding:u,subtitle:p,theme:g,title:f,tooltip:H,width:m}),$=pickProps(t,{needle:L!=null?{enabled:!0,...L}:IGNORED_PROP,startAngle:A,endAngle:D,scale:I,type:y,cursor:x,nodeClickRange:b,listeners:r,tooltip:Y,value:v,highlightStyle:T,segmentation:k,bar:w,targets:O,outerRadius:F,innerRadius:R,outerRadiusRatio:E,innerRadiusRatio:_,cornerRadius:G,cornerMode:B,label:z,secondaryLabel:P,spacing:V,...j});return{...U,series:[$]}}function linearGaugeOptions(t){const{animation:e,background:i,container:s,contextMenu:n,footnote:o,height:a,listeners:r,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:d,padding:u,subtitle:p,theme:g,title:f,width:m,type:y,cursor:x,nodeClickRange:b,tooltip:S={},value:v,scale:I={},direction:A="vertical",thickness:D,highlightStyle:T,segmentation:k,bar:w,targets:L,cornerRadius:O,cornerMode:F,label:R,...E}=t,{chartTooltipOptions:_,seriesTooltipOptions:G}=tooltipOptions(S),B=pickProps(t,{animation:e,background:i,container:s,contextMenu:n,footnote:o,height:a,listeners:r,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:d,padding:u,subtitle:p,theme:g,title:f,tooltip:_,width:m}),z=pickProps(t,{scale:I,type:y,cursor:x,nodeClickRange:b,listeners:r,tooltip:G,value:v,direction:A,thickness:D,highlightStyle:T,segmentation:k,bar:w,targets:L,cornerRadius:O,cornerMode:F,label:R,...E});return{...B,series:[z]}}function applyThemeDefaults(t,e){if(e==null)return t;const{targets:i,...s}=e;return t=mergeDefaults(t,s),t.targets!=null&&i!=null&&(t.targets=mergeArrayDefaults(t.targets,i)),t}function gauge(t,e){if(isRadialGauge(t)){const x=applyThemeDefaults(t,e);return radialGaugeOptions(x)}else if(isLinearGauge(t)){const x=applyThemeDefaults(t,e);return linearGaugeOptions(x)}const{animation:i,background:s,container:n,contextMenu:o,footnote:a,height:r,listeners:l,locale:c,minHeight:h,minWidth:d,padding:u,subtitle:p,theme:g,title:f,tooltip:m,width:y}=t;return pickProps(t,{animation:i,background:s,container:n,contextMenu:o,footnote:a,height:r,listeners:l,locale:c,minHeight:h,minWidth:d,padding:u,subtitle:p,theme:g,title:f,tooltip:m,width:y})}var stroke={stroke:DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR},handle={fill:DEFAULT_ANNOTATION_HANDLE_FILL},axisLabel={color:"white",fill:DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR},lineText={color:DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR},font={color:DEFAULT_TEXT_ANNOTATION_COLOR,fontSize:{$rem:[1.1666666666666667]},fontFamily:{$ref:"fontFamily"}},text={...font,textAlign:"left"},measurerStatistics={...font,fontSize:{$ref:"fontSize"},color:DEFAULT_ANNOTATION_STATISTICS_COLOR,fill:DEFAULT_ANNOTATION_STATISTICS_FILL,stroke:DEFAULT_ANNOTATION_STATISTICS_STROKE,strokeWidth:1,divider:{stroke:DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE,strokeWidth:1,strokeOpacity:.5}},measurer={...stroke,background:{fill:DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,fillOpacity:.2},handle:{...handle},text:{...lineText},statistics:{...measurerStatistics}},annotationsTheme={line:{...stroke,handle:{...handle},text:{...lineText}},"horizontal-line":{...stroke,handle:{...handle},axisLabel:{...axisLabel},text:{...lineText}},"vertical-line":{...stroke,handle:{...handle},axisLabel:{...axisLabel},text:{...lineText}},"disjoint-channel":{...stroke,background:{fill:DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,fillOpacity:.2},handle:{...handle},text:{...lineText}},"parallel-channel":{...stroke,background:{fill:DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,fillOpacity:.2},handle:{...handle},text:{...lineText}},"fibonacci-retracement":{...stroke,strokes:DEFAULT_FIBONACCI_STROKES,rangeStroke:DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,handle:{...handle},text:{...lineText,position:"center"},label:{...font,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},"fibonacci-retracement-trend-based":{...stroke,strokes:DEFAULT_FIBONACCI_STROKES,rangeStroke:DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,handle:{...handle},text:{...lineText,position:"center"},label:{...font,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},callout:{...stroke,...text,color:{$ref:"textColor"},handle:{...handle},fill:DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,fillOpacity:.2},comment:{...text,color:"white",fontWeight:700,handle:{...handle},fill:DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR},note:{...text,color:DEFAULT_TEXTBOX_COLOR,fill:DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,stroke:{$ref:"backgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...handle},background:{fill:DEFAULT_TEXTBOX_FILL,stroke:DEFAULT_TEXTBOX_STROKE,strokeWidth:1}},text:{...text,handle:{...handle}},arrow:{...stroke,handle:{...handle},text:{...lineText}},"arrow-up":{fill:PALETTE_UP_FILL,handle:{...handle,stroke:DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR}},"arrow-down":{fill:PALETTE_DOWN_FILL,handle:{...handle,stroke:DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR}},"date-range":{...measurer},"price-range":{...measurer},"date-price-range":{...measurer},"quick-date-price-range":{up:{...stroke,fill:DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,fillOpacity:.2,handle:{...handle},statistics:{...measurerStatistics,color:"#fff",fill:DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...stroke,stroke:DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE,fill:DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,fillOpacity:.2,handle:{...handle,stroke:DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE},statistics:{...measurerStatistics,color:"#fff",fill:DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{enabled:!0}},chartTypes3=["ohlc","line","step-line","hlc","high-low","candlestick","hollow-candlestick"],toolbarButtons=[{icon:"trend-line-drawing",tooltip:"toolbarAnnotationsLineAnnotations",value:"line-menu"},{icon:"fibonacci-retracement-drawing",tooltip:"toolbarAnnotationsFibonacciAnnotations",value:"fibonacci-menu"},{icon:"text-annotation",tooltip:"toolbarAnnotationsTextAnnotations",value:"text-menu"},{icon:"arrow-drawing",tooltip:"toolbarAnnotationsShapeAnnotations",value:"shape-menu"},{icon:"measurer-drawing",tooltip:"toolbarAnnotationsMeasurerAnnotations",value:"measurer-menu"},{icon:"delete",tooltip:"toolbarAnnotationsClearAll",value:"clear"}];function priceVolume(t,e,i){const{dateKey:s="date",highKey:n="high",openKey:o="open",lowKey:a="low",closeKey:r="close",volumeKey:l="volume",chartType:c="candlestick",navigator:h=!1,volume:d=!0,rangeButtons:u=!0,statusBar:p=!0,toolbar:g=!0,zoom:f=!0,theme:m,data:y,...x}=t,b=createPriceSeries(c,s,n,a,o,r),S=createVolumeSeries(i,o,r,d,l),I={navigator:{enabled:h,...d?{miniChart:{enabled:h,series:[{type:"line",xKey:s,yKey:l,stroke:SAFE_STROKE_FILL_OPERATION,marker:{enabled:!1}}]},height:40,minHandle:{height:46},maxHandle:{height:46}}:null}},A={annotations:{enabled:g,optionsToolbar:{enabled:g},snap:!0,toolbar:{enabled:g,buttons:toolbarButtons,padding:0},data:y,xKey:s,volumeKey:d?l:void 0}},D=p?{statusBar:{enabled:!0,data:y,highKey:n,openKey:o,lowKey:a,closeKey:r,volumeKey:d?l:void 0}}:null,T={zoom:{enabled:f,autoScaling:{enabled:!0},enableIndependentAxes:!0}},k={ranges:{enabled:u}},w=d?[{type:"number",position:"left",keys:[l],label:{enabled:!1},crosshair:{enabled:!1},gridLine:{enabled:!1},nice:!1,layoutConstraints:{stacked:!1,width:20,unit:"percent",align:"end"}}]:[];return{theme:{baseTheme:typeof m=="string"?m:"ag-financial",...mergeDefaults(typeof m=="object"?m:null,{overrides:{common:{title:{padding:4},padding:{top:6,right:8,bottom:5},chartToolbar:{enabled:g},annotations:{...annotationsTheme},axes:{number:{interval:{maxSpacing:45},label:{format:".2f"}}}},bar:{series:{fillOpacity:.5}},line:{series:{marker:{enabled:!1},...inlineSwitch(c,{hlc:{stroke:PALETTE_ALT_NEUTRAL_STROKE,strokeWidth:2},line:{stroke:PALETTE_NEUTRAL_STROKE},"step-line":{stroke:PALETTE_NEUTRAL_STROKE,interpolation:{type:"step"}}})}},candlestick:{series:{...inlineSwitch(c,{"hollow-candlestick":{item:{up:{fill:"transparent"}}}})}},"range-area":{series:{fillOpacity:.3,strokeWidth:2}}}})},animation:{enabled:!1},legend:{enabled:!1},series:[...S,...b],axes:[{type:"number",position:"right",keys:[o,r,n,a],crosshair:{enabled:!0,snap:!1},layoutConstraints:{stacked:!1,width:100,unit:"percent",align:"start"}},...w,{type:"ordinal-time",position:"bottom",line:{enabled:!1},label:{enabled:!0},crosshair:{enabled:!0}}],tooltip:{enabled:!1},data:y,...A,...I,...D,...T,...k,...x}}function createVolumeSeries(t,e,i,s,n){return s?[{type:"bar",xKey:"date",yKey:n,tooltip:{enabled:!1},itemStyler({datum:o}){const{up:a,down:r}=t().palette;return{fill:o[e]<o[i]?a?.fill:r?.fill}},focusPriority:1,fastDataProcessing:!0,highlight:{enabled:!1}}]:[]}var RANGE_AREA_TYPE="range-area";function createPriceSeries(t,e,i,s,n,o){const a={xKey:e,openKey:n,closeKey:o,highKey:i,lowKey:s},r={xKey:e,yKey:o},l={pickOutsideVisibleMinorAxis:!0};switch(t??"candlestick"){case"ohlc":return createPriceSeriesOHLC(l,a);case"line":case"step-line":return createPriceSeriesLine(l,r);case"hlc":return createPriceSeriesHLC(l,r,a);case"high-low":return createPriceSeriesHighLow(l,a);case"candlestick":case"hollow-candlestick":return createPriceSeriesCandlestick(l,a);default:return logger_exports.warnOnce(`unknown chart type: ${t}; expected one of: ${chartTypes3.join(", ")}`),createPriceSeriesCandlestick(l,a)}}function createPriceSeriesOHLC(t,e){return[{type:"ohlc",focusPriority:0,...t,...e}]}function createPriceSeriesLine(t,e){return[{type:"line",focusPriority:0,...t,...e}]}function createPriceSeriesHLC(t,e,{xKey:i,highKey:s,closeKey:n,lowKey:o}){return[{type:RANGE_AREA_TYPE,focusPriority:0,...t,xKey:i,yHighKey:s,yLowKey:n,fill:PALETTE_UP_FILL,stroke:PALETTE_UP_STROKE},{type:RANGE_AREA_TYPE,focusPriority:0,...t,xKey:i,yHighKey:n,yLowKey:o,fill:PALETTE_DOWN_FILL,stroke:PALETTE_DOWN_STROKE},{type:"line",...t,...e}]}function createPriceSeriesHighLow(t,{xKey:e,highKey:i,lowKey:s}){return[{type:"range-bar",...t,xKey:e,yHighKey:i,yLowKey:s,fill:PALETTE_NEUTRAL_FILL,stroke:PALETTE_NEUTRAL_STROKE,tooltip:{range:"nearest"},focusPriority:0,fastDataProcessing:!0}]}function createPriceSeriesCandlestick(t,e){return[{type:"candlestick",focusPriority:0,...t,...e}]}function inlineSwitch(t,e){return e[t]??e.default}var commonAxisProperties={title:{enabled:!1},label:{enabled:!1},line:{enabled:!1},gridLine:{enabled:!1},crosshair:{enabled:!1,stroke:DEFAULT_SPARKLINE_CROSSHAIR_STROKE,lineDash:[0],label:{enabled:!1}}},numericAxisProperties={...commonAxisProperties,nice:!1},chartTooltipDefaults={mode:"compact",position:{anchorTo:"node",placement:["right","left"]},showArrow:!1},barGridLineDefaults={style:[{stroke:{$ref:"gridLineColor"}}],width:2},barAxisDefaults={number:{gridLine:barGridLineDefaults},time:{gridLine:barGridLineDefaults},category:{gridLine:barGridLineDefaults}},SPARKLINE_THEME={overrides:{common:{animation:{enabled:!1},contextMenu:{enabled:!1},keyboard:{enabled:!1},background:{visible:!1},navigator:{enabled:!1},padding:{top:0,right:0,bottom:0,left:0},axes:{number:{...numericAxisProperties,interval:{values:[0]}},log:{...numericAxisProperties},time:{...numericAxisProperties},category:{...commonAxisProperties}}},bar:{series:{crisp:!1,label:{placement:"inside-end",padding:4},sparklineMode:!0},tooltip:{...chartTooltipDefaults,position:{...chartTooltipDefaults.position,anchorTo:"pointer"},range:"nearest"},axes:barAxisDefaults},line:{seriesArea:{padding:{top:2,right:2,bottom:2,left:2}},series:{sparklineMode:!0,strokeWidth:1,marker:{enabled:!1,size:3}},tooltip:chartTooltipDefaults},area:{seriesArea:{padding:{top:1,right:0,bottom:1,left:0}},series:{strokeWidth:1,fillOpacity:.4},tooltip:chartTooltipDefaults}}},setInitialBaseTheme=simpleMemorize(createInitialBaseTheme);function createInitialBaseTheme(t,e){return typeof t=="string"?{...e,baseTheme:t}:t!=null?{...t,baseTheme:setInitialBaseTheme(t.baseTheme,e)}:e}function sparklineDataPreset(t){if(Array.isArray(t)&&t.length!==0){const e=t[0];if(typeof e=="number")return{data:t.map((s,n)=>({x:n,y:s})),series:[{xKey:"x",yKey:"y"}],datumKey:"y"};if(Array.isArray(e))return{data:t.map(s=>({x:s[0],y:s[1],datum:s})),series:[{xKey:"x",yKey:"y"}],datumKey:"datum"}}return{data:t}}function axisPreset(t,e){switch(t?.type){case"number":{const{type:i,min:s,max:n,reverse:o}=t;return pickProps(t,{type:i,reverse:o,min:s,max:n})}case"time":{const{type:i,min:s,max:n,reverse:o}=t;return pickProps(t,{type:i,reverse:o,min:s,max:n})}case"category":{const{type:i,paddingInner:s,paddingOuter:n,reverse:o}=t;return pickProps(t,{type:i,reverse:o,paddingInner:s,paddingOuter:n})}}return{type:e}}function gridLinePreset(t,e,i){const s={};return t?.stroke!=null&&(s.style=[{stroke:t?.stroke}],s.enabled??(s.enabled=!0)),t?.strokeWidth!=null&&(s.width=t?.strokeWidth,s.enabled??(s.enabled=!0)),i.type==="bar"&&i.direction!=="horizontal"&&(s.enabled??(s.enabled=!0)),t?.visible!=null&&(s.enabled=t.visible),s.enabled??(s.enabled=e),s}var tooltipRendererFn=simpleMemorize((t,e,i)=>s=>{const n=s.datum[s.xKey],o=s.datum[s.yKey],a=i!=null?s.datum[i]:s.datum,r=e?.renderer?.({context:t,datum:a,xValue:n,yValue:o});return typeof r=="string"?r:{heading:void 0,title:void 0,data:[{label:r?.title,value:r?.content??o.toFixed(2)}]}});function sparkline(t){const{background:e,container:i,height:s,listeners:n,locale:o,minHeight:a,minWidth:r,overrideDevicePixelRatio:l,padding:c,width:h,theme:d,data:u,crosshair:p,axis:g,min:f,max:m,tooltip:y,context:x,...b}=t,S=pickProps(t,{background:e,container:i,height:s,listeners:n,locale:o,minHeight:a,minWidth:r,overrideDevicePixelRatio:l,padding:c,width:h,tooltip:IGNORED_PROP,context:IGNORED_PROP,data:IGNORED_PROP,crosshair:IGNORED_PROP,axis:IGNORED_PROP,min:IGNORED_PROP,max:IGNORED_PROP,theme:IGNORED_PROP}),{data:v,series:[I]=[],datumKey:A}=sparklineDataPreset(u),D=b;I!=null&&Object.assign(D,I),D.tooltip={...y,renderer:tooltipRendererFn(x,y,A)},S.theme=setInitialBaseTheme(d,SPARKLINE_THEME),S.data=v,S.series=[D];const T=D.type!=="bar"||D.direction!=="horizontal",[k,w]=T?["bottom","left"]:["left","bottom"],L={...axisPreset(g,"category"),position:k,...pickProps(t,{crosshair:p})},O={type:"number",gridLine:gridLinePreset(g,!1,t),position:w,...pickProps(t,{min:f,max:m})};return S.axes=T?[O,L]:[L,O],S}var PRESETS={"price-volume":priceVolume,gauge,sparkline},PRESET_DATA_PROCESSORS={sparkline:sparklineDataPreset};function removeUsedEnterpriseOptions(t,e){let i=[];const s=isAgGaugeChartOptions(t),n=optionsType(t),o=n?chartTypes2.get(n):"unknown";for(const a of EXPECTED_ENTERPRISE_MODULES)if(!(o!=="unknown"&&!a.chartTypes.includes(o))){if(a.type==="root"||a.type==="legend"){const r=t[a.optionsKey];if(r==null)continue;a.optionsInnerKey?r[a.optionsInnerKey]&&(i.push(`${a.optionsKey}.${a.optionsInnerKey}`),delete r[a.optionsInnerKey]):(i.push(a.optionsKey),delete t[a.optionsKey])}else if(a.type==="axis"){if(!("axes"in t)||!isArray(t.axes)||!t.axes?.some(r=>r.type===a.identifier))continue;i.push(`axis[type=${a.identifier}]`),t.axes=t.axes.filter(r=>r.type!==a.identifier)}else if(a.type==="axis-option"){if(!("axes"in t)||!isArray(t.axes)||!t.axes?.some(r=>r[a.optionsKey]))continue;i.push(`axis.${a.optionsKey}`),t.axes.forEach(r=>{r[a.optionsKey]&&delete r[a.optionsKey]})}else if(a.type==="series"){if(a.community||!isArray(t.series)||!t.series?.some(r=>r.type===a.identifier))continue;i.push(`series[type=${a.identifier}]`),t.series=t.series.filter(r=>r.type!==a.identifier)}else if(a.type==="series-option"){if(!isArray(t.series)||!t.series?.some(r=>r[a.optionsKey]))continue;i.push(`series.${a.optionsKey}`),t.series.forEach(r=>{r[a.optionsKey]&&delete r[a.optionsKey]})}}if(i.length&&!e){s&&(i=["AgCharts.createGauge"]);let a="ag-charts-enterprise",r="https://www.ag-grid.com/charts/javascript/installation/";t.mode==="integrated"&&(a="ag-grid-charts-enterprise' or 'ag-grid-enterprise/charts-enterprise",r="https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/"),logger_exports.warnOnce([`unable to use these enterprise features as '${a}' has not been loaded:`,"",...i,"",`See: ${r}`].join(`
`))}}function removeUnusedEnterpriseOptions(t){const e="mode"in t&&t.mode==="integrated";for(const i of moduleRegistry.byType("root","legend")){const s=t[i.optionsKey],n=s!=null&&s.enabled===!1,o=!("removable"in i)||i.removable===!0||i.removable==="standalone-only"&&!e;n&&o&&delete t[i.optionsKey]}}function paletteType(t){return t?.up||t?.down||t?.neutral?"user-full":t?.fills||t?.strokes?"user-indexed":"inbuilt"}var DEFAULT_BACKGROUND_FILL="white",CHART_TYPE_CONFIG={get cartesian(){return{seriesTypes:chartTypes2.cartesianTypes,commonOptions:["zoom","navigator"]}},get polar(){return{seriesTypes:chartTypes2.polarTypes,commonOptions:[]}},get hierarchy(){return{seriesTypes:chartTypes2.hierarchyTypes,commonOptions:[]}},get topology(){return{seriesTypes:chartTypes2.topologyTypes,commonOptions:[]}},get"flow-proportion"(){return{seriesTypes:chartTypes2.flowProportionTypes,commonOptions:[]}},get standalone(){return{seriesTypes:chartTypes2.standaloneTypes,commonOptions:[]}},get gauge(){return{seriesTypes:chartTypes2.gaugeTypes,commonOptions:[]}}},PRESET_OVERRIDES_TYPES={"radial-gauge":!0,"linear-gauge":!0};function isPresetOverridesType(t){return PRESET_OVERRIDES_TYPES[t]===!0}var CHART_TYPE_SPECIFIC_COMMON_OPTIONS=Object.values(CHART_TYPE_CONFIG).reduce((t,{commonOptions:e})=>t.concat(e),[]),_ChartTheme=class Nt{static getDefaultColors(){return{fills:DEFAULT_FILLS,fillsFallback:Object.values(DEFAULT_FILLS),strokes:DEFAULT_STROKES,sequentialColors:getSequentialColors(DEFAULT_FILLS),divergingColors:[DEFAULT_FILLS.ORANGE,DEFAULT_FILLS.YELLOW,DEFAULT_FILLS.GREEN],hierarchyColors:["#fff","#e0e5ea","#c1ccd5","#a3b4c1","#859cad"],secondSequentialColors:Color.interpolate([Color.fromHexString(DEFAULT_FILLS.BLUE),Color.fromHexString("#cbdef5")],8).map(e=>e.toString()),secondDivergingColors:[DEFAULT_FILLS.GREEN,DEFAULT_FILLS.YELLOW,DEFAULT_FILLS.RED],secondHierarchyColors:["#fff","#c5cbd1","#a4b1bd","#8498a9","#648096"],up:{fill:DEFAULT_FILLS.GREEN,stroke:DEFAULT_STROKES.GREEN},down:{fill:DEFAULT_FILLS.RED,stroke:DEFAULT_STROKES.RED},neutral:{fill:DEFAULT_FILLS.GRAY,stroke:DEFAULT_STROKES.GRAY},altUp:{fill:DEFAULT_FILLS.BLUE,stroke:DEFAULT_STROKES.BLUE},altDown:{fill:DEFAULT_FILLS.ORANGE,stroke:DEFAULT_STROKES.ORANGE},altNeutral:{fill:DEFAULT_FILLS.GRAY,stroke:DEFAULT_STROKES.GRAY}}}static getDefaultPublicParameters(){return{accentColor:"#2196f3",axisColor:{$foregroundBackgroundMix:[.675]},backgroundColor:DEFAULT_BACKGROUND_FILL,borderColor:{$foregroundBackgroundMix:[.818]},foregroundColor:"#464646",fontFamily:"Verdana, sans-serif",fontSize:12,fontWeight:400,gridLineColor:{$foregroundBackgroundAccentMix:[.93,.085]},padding:20,subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"backgroundColor"},.38]},textColor:{$ref:"foregroundColor"},chromeBackgroundColor:{$foregroundBackgroundMix:[.975]},chromeFontFamily:{$ref:"fontFamily"},chromeFontSize:{$ref:"fontSize"},chromeFontWeight:{$ref:"fontWeight"},chromeTextColor:"#181d1f",chromeSubtleTextColor:{$mix:[{$ref:"chromeTextColor"},{$ref:"backgroundColor"},.38]},inputBackgroundColor:{$ref:"backgroundColor"},inputTextColor:{$ref:"textColor"},crosshairLabelBackgroundColor:{$ref:"foregroundColor"},crosshairLabelTextColor:{$ref:"backgroundColor"}}}static getAxisDefaults(e,i=!0){return mergeDefaults(e,i&&{title:{enabled:!1,text:"Axis Title",spacing:25,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}}},{label:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:11,color:{$ref:"textColor"},avoidCollisions:!0},line:{enabled:!0,width:1,stroke:{$ref:"axisColor"}},tick:{enabled:!1,width:1,stroke:{$ref:"axisColor"}},gridLine:{enabled:!0,style:[{stroke:{$ref:"gridLineColor"},lineDash:[]}]},crossLines:{enabled:!0,fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},fillOpacity:.1,strokeWidth:1,label:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},padding:5,color:{$ref:"textColor"}}}})}getChartDefaults(){return{minHeight:300,minWidth:300,background:{visible:!0,fill:{$ref:"backgroundColor"}},padding:{top:{$ref:"padding"},right:{$ref:"padding"},bottom:{$ref:"padding"},left:{$ref:"padding"}},seriesArea:{padding:{top:0,right:0,bottom:0,left:0}},keyboard:{enabled:!0},title:{enabled:!1,text:"Title",spacing:{$if:[{$path:"../subtitle/enabled"},10,20]},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.4166666666666667]},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},wrapping:"hyphenate",layoutStyle:DEFAULT_CAPTION_LAYOUT_STYLE,textAlign:DEFAULT_CAPTION_ALIGNMENT},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:DEFAULT_CAPTION_LAYOUT_STYLE,textAlign:DEFAULT_CAPTION_ALIGNMENT},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:DEFAULT_CAPTION_LAYOUT_STYLE,textAlign:DEFAULT_CAPTION_ALIGNMENT},legend:{position:"bottom",orientation:{$if:[{$or:[{$eq:[{$path:"./position"},"left"]},{$eq:[{$path:"./position"},"right"]}]},"vertical","horizontal"]},spacing:30,listeners:{},toggleSeries:!0,item:{paddingX:16,paddingY:8,marker:{size:15,padding:8},showSeriesStroke:!0,label:{color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"}}},reverseOrder:!1,pagination:{marker:{size:12},activeStyle:{fill:{$ref:"foregroundColor"}},inactiveStyle:{fill:{$ref:"subtleTextColor"}},highlightStyle:{fill:{$ref:"foregroundColor"}},label:{color:{$ref:"textColor"}}}},tooltip:{enabled:!0,darkTheme:IS_DARK_THEME,delay:0,pagination:!1},overlays:{darkTheme:IS_DARK_THEME},listeners:{}}}constructor(e={}){const{overrides:i,palette:s}=deepClone(e),n=this.createChartConfigPerChartType(this.getDefaults()),o={};i&&this.mergeOverrides(n,o,i);const{fills:a,strokes:r,sequentialColors:l,...c}=this.getDefaultColors();this.palette=deepFreeze(mergeDefaults(s,{fills:Object.values(a),strokes:Object.values(r),sequentialColors:Object.values(l),...c})),this.paletteType=paletteType(s),this.config=deepFreeze(this.templateTheme(n)),this.presets=deepFreeze(o)}mergeOverrides(e,i,s){for(const{seriesTypes:n,commonOptions:o}of Object.values(CHART_TYPE_CONFIG)){const a={...s.common};for(const r of CHART_TYPE_SPECIFIC_COMMON_OPTIONS)o.includes(r)||delete a[r];if(a)for(const r of n){const l=r;isPresetOverridesType(l)||(e[l]=mergeDefaults(a,e[l]))}}chartTypes2.seriesTypes.forEach(n=>{const o=n,a=s[o];isPresetOverridesType(o)?i[o]=a:e[o]=mergeDefaults(a,e[o])})}createChartConfigPerChartType(e){for(const[i,{seriesTypes:s}]of entries(CHART_TYPE_CONFIG)){const n=chartDefaults.get(i);for(const o of s)e[o]??(e[o]=deepClone(n))}return e}getDefaults(){const e=(i,s)=>{const n={},o={axes:{},...legendRegistry.getThemeTemplates(),...this.getChartDefaults(),...chartDefaults.get(i)};for(const a of s){n[a]=mergeDefaults(seriesRegistry.getThemeTemplate(a),n[a]??deepClone(o));const{axes:r}=n[a];for(const l of axisRegistry.keys())r[l]=mergeDefaults(r[l],axisRegistry.getThemeTemplate(l),Nt.axisDefault[l])}return n};return mergeDefaults(e("cartesian",chartTypes2.cartesianTypes),e("polar",chartTypes2.polarTypes),e("hierarchy",chartTypes2.hierarchyTypes),e("topology",chartTypes2.topologyTypes),e("flow-proportion",chartTypes2.flowProportionTypes),e("standalone",chartTypes2.standaloneTypes),e("gauge",chartTypes2.gaugeTypes))}static applyTemplateTheme(e,i,s){if(isArray(e))for(let n=0;n<e.length;n++){const o=e[n];typeof o=="symbol"&&s?.has(o)&&(e[n]=s.get(o))}else for(const n of Object.keys(e)){const o=e[n];typeof o=="symbol"&&s?.has(o)&&(e[n]=s.get(o))}}templateTheme(e,i=!0){const s=i?deepClone(e):e,n=this.getTemplateParameters();return jsonWalk(s,Nt.applyTemplateTheme,void 0,void 0,n),s}getDefaultColors(){return Nt.getDefaultColors()}getPublicParameters(){return Nt.getDefaultPublicParameters()}getTemplateParameters(){const{isEnterprise:e}=enterpriseModule,i=new Map;i.set(IS_DARK_THEME,!1),i.set(IS_ENTERPRISE,e),i.set(IS_COMMUNITY,!e),i.set(DEFAULT_SEPARATION_LINES_COLOUR,"#d9d9d9"),i.set(DEFAULT_SHADOW_COLOUR,"#00000080"),i.set(DEFAULT_SPARKLINE_CROSSHAIR_STROKE,"#aaa"),i.set(DEFAULT_CAPTION_LAYOUT_STYLE,"block"),i.set(DEFAULT_CAPTION_ALIGNMENT,"center"),i.set(DEFAULT_FIBONACCI_STROKES,["#797b86","#e24c4a","#f49d2d","#65ab58","#409682","#4db9d2","#5090dc","#3068f9","#e24c4a","#913aac","#d93e64"]),i.set(DEFAULT_POLAR_SERIES_STROKE,DEFAULT_BACKGROUND_FILL),i.set(DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,DEFAULT_FILLS.BLUE),i.set(DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,DEFAULT_FILLS.BLUE),i.set(DEFAULT_TEXT_ANNOTATION_COLOR,DEFAULT_FILLS.BLUE),i.set(DEFAULT_ANNOTATION_HANDLE_FILL,DEFAULT_BACKGROUND_FILL),i.set(DEFAULT_ANNOTATION_STATISTICS_FILL,"#fafafa"),i.set(DEFAULT_ANNOTATION_STATISTICS_STROKE,"#ddd"),i.set(DEFAULT_ANNOTATION_STATISTICS_COLOR,"#000"),i.set(DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE,"#181d1f"),i.set(DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,"#e35c5c"),i.set(DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE,"#e35c5c"),i.set(DEFAULT_TEXTBOX_FILL,"#fafafa"),i.set(DEFAULT_TEXTBOX_STROKE,"#ddd"),i.set(DEFAULT_TEXTBOX_COLOR,"#000"),i.set(DEFAULT_TOOLBAR_POSITION,"top"),i.set(DEFAULT_GRIDLINE_ENABLED,!1);const s=this.getDefaultColors();return i.set(PALETTE_UP_STROKE,this.palette.up?.stroke??s.up.stroke),i.set(PALETTE_UP_FILL,this.palette.up?.fill??s.up.fill),i.set(PALETTE_DOWN_STROKE,this.palette.down?.stroke??s.down.stroke),i.set(PALETTE_DOWN_FILL,this.palette.down?.fill??s.down.fill),i.set(PALETTE_NEUTRAL_STROKE,this.palette.neutral?.stroke??s.neutral.stroke),i.set(PALETTE_NEUTRAL_FILL,this.palette.neutral?.fill??s.neutral.fill),i.set(PALETTE_ALT_UP_STROKE,this.palette.altUp?.stroke??s.up.stroke),i.set(PALETTE_ALT_UP_FILL,this.palette.altUp?.fill??s.up.fill),i.set(PALETTE_ALT_DOWN_STROKE,this.palette.altDown?.stroke??s.down.stroke),i.set(PALETTE_ALT_DOWN_FILL,this.palette.altDown?.fill??s.down.fill),i.set(PALETTE_ALT_NEUTRAL_FILL,this.palette.altNeutral?.fill??s.altNeutral.fill),i.set(PALETTE_ALT_NEUTRAL_STROKE,this.palette.altNeutral?.stroke??s.altNeutral.stroke),i}};_ChartTheme.axisDefault={number:_ChartTheme.getAxisDefaults({keys:[],line:{enabled:!1},crosshair:{enabled:!0}}),log:_ChartTheme.getAxisDefaults({keys:[],base:10,line:{enabled:!1},crosshair:{enabled:!0}}),category:_ChartTheme.getAxisDefaults({keys:[],groupPaddingInner:.1,label:{autoRotate:!0},gridLine:{enabled:DEFAULT_GRIDLINE_ENABLED},crosshair:{enabled:!1}}),"grouped-category":_ChartTheme.getAxisDefaults({keys:[],tick:{enabled:!0,stroke:DEFAULT_SEPARATION_LINES_COLOUR},label:{spacing:10,rotation:270},paddingInner:.4,groupPaddingInner:.2,crosshair:{enabled:!1}}),time:_ChartTheme.getAxisDefaults({keys:[],gridLine:{enabled:DEFAULT_GRIDLINE_ENABLED},crosshair:{enabled:!0}}),"ordinal-time":_ChartTheme.getAxisDefaults({keys:[],groupPaddingInner:0,label:{autoRotate:!1},gridLine:{enabled:DEFAULT_GRIDLINE_ENABLED},crosshair:{enabled:!0}}),"angle-category":_ChartTheme.getAxisDefaults({label:{spacing:5},gridLine:{enabled:DEFAULT_GRIDLINE_ENABLED},shape:{$path:["./shape",void 0,{$find:[{$not:[{$isOperation:"./shape"}]},{$path:".."}]}]}},!1),"angle-number":_ChartTheme.getAxisDefaults({label:{spacing:5},gridLine:{enabled:DEFAULT_GRIDLINE_ENABLED}},!1),"radius-category":_ChartTheme.getAxisDefaults({positionAngle:0,line:{enabled:!1}}),"radius-number":_ChartTheme.getAxisDefaults({positionAngle:0,line:{enabled:!1},shape:{$path:["./shape",void 0,{$find:[{$not:[{$isOperation:"./shape"}]},{$path:".."}]}]}})};var ChartTheme=_ChartTheme,DEFAULT_DARK_BACKGROUND_FILL="#192232",DEFAULT_DARK_FILLS={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},DEFAULT_DARK_STROKES={BLUE:"#74a8e6",ORANGE:"#ffbe70",GREEN:"#6cb176",CYAN:"#75d4ef",YELLOW:"#f6e559",VIOLET:"#aa86d8",GRAY:"#a1a1a1",MAGENTA:"#ce7ab9",BROWN:"#997b52",RED:"#ff7872"},DarkTheme=class extends ChartTheme{getDefaultColors(){return{fills:DEFAULT_DARK_FILLS,fillsFallback:Object.values(DEFAULT_DARK_FILLS),strokes:DEFAULT_DARK_STROKES,sequentialColors:getSequentialColors(DEFAULT_DARK_FILLS),divergingColors:[DEFAULT_DARK_FILLS.ORANGE,DEFAULT_DARK_FILLS.YELLOW,DEFAULT_DARK_FILLS.GREEN],hierarchyColors:["#192834","#253746","#324859","#3f596c","#4d6a80"],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[DEFAULT_DARK_FILLS.GREEN,DEFAULT_DARK_FILLS.YELLOW,DEFAULT_DARK_FILLS.RED],secondHierarchyColors:["#192834","#3b5164","#496275","#577287","#668399"],up:{fill:DEFAULT_DARK_FILLS.GREEN,stroke:DEFAULT_DARK_STROKES.GREEN},down:{fill:DEFAULT_DARK_FILLS.RED,stroke:DEFAULT_DARK_STROKES.RED},neutral:{fill:DEFAULT_DARK_FILLS.GRAY,stroke:DEFAULT_DARK_STROKES.GRAY},altUp:{fill:DEFAULT_DARK_FILLS.BLUE,stroke:DEFAULT_DARK_STROKES.BLUE},altDown:{fill:DEFAULT_DARK_FILLS.ORANGE,stroke:DEFAULT_DARK_STROKES.ORANGE},altNeutral:{fill:DEFAULT_DARK_FILLS.GRAY,stroke:DEFAULT_DARK_STROKES.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),axisColor:{$foregroundBackgroundMix:[.263]},backgroundColor:DEFAULT_DARK_BACKGROUND_FILL,borderColor:{$foregroundBackgroundMix:[.784]},chromeBackgroundColor:{$foregroundBackgroundMix:[.93]},foregroundColor:"#fff",gridLineColor:{$foregroundBackgroundAccentMix:[.743,.01]},subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"backgroundColor"},.57]},chromeTextColor:{$ref:"textColor"},crosshairLabelBackgroundColor:{$foregroundBackgroundAccentMix:[.35,.1]}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(IS_DARK_THEME,!0),t.set(DEFAULT_POLAR_SERIES_STROKE,DEFAULT_DARK_BACKGROUND_FILL),t.set(DEFAULT_SEPARATION_LINES_COLOUR,"#7f8389"),t.set(DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,DEFAULT_DARK_FILLS.BLUE),t.set(DEFAULT_TEXT_ANNOTATION_COLOR,"#fff"),t.set(DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,DEFAULT_DARK_FILLS.BLUE),t.set(DEFAULT_ANNOTATION_HANDLE_FILL,DEFAULT_DARK_BACKGROUND_FILL),t.set(DEFAULT_ANNOTATION_STATISTICS_FILL,"#28313e"),t.set(DEFAULT_ANNOTATION_STATISTICS_STROKE,"#4b525d"),t.set(DEFAULT_ANNOTATION_STATISTICS_COLOR,"#fff"),t.set(DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE,"#fff"),t.set(DEFAULT_TEXTBOX_FILL,"#28313e"),t.set(DEFAULT_TEXTBOX_STROKE,"#4b525d"),t.set(DEFAULT_TEXTBOX_COLOR,"#fff"),t}constructor(t){super(t)}},FINANCIAL_DARK_FILLS={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},FINANCIAL_DARK_STROKES={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},FinancialDark=class extends DarkTheme{getDefaultColors(){return{...super.getDefaultColors(),fills:{...FINANCIAL_DARK_FILLS},fillsFallback:Object.values({...FINANCIAL_DARK_FILLS}),strokes:{...FINANCIAL_DARK_STROKES},sequentialColors:getSequentialColors(FINANCIAL_DARK_FILLS),divergingColors:[FINANCIAL_DARK_FILLS.GREEN,FINANCIAL_DARK_FILLS.BLUE,FINANCIAL_DARK_FILLS.RED],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],up:{fill:FINANCIAL_DARK_FILLS.GREEN,stroke:FINANCIAL_DARK_STROKES.GREEN},down:{fill:FINANCIAL_DARK_FILLS.RED,stroke:FINANCIAL_DARK_STROKES.RED},neutral:{fill:FINANCIAL_DARK_FILLS.BLUE,stroke:FINANCIAL_DARK_STROKES.BLUE},altUp:{fill:FINANCIAL_DARK_FILLS.GREEN,stroke:FINANCIAL_DARK_STROKES.GREEN},altDown:{fill:FINANCIAL_DARK_FILLS.RED,stroke:FINANCIAL_DARK_STROKES.RED},altNeutral:{fill:FINANCIAL_DARK_FILLS.GRAY,stroke:FINANCIAL_DARK_STROKES.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),gridLineColor:{$foregroundBackgroundAccentMix:[.88,.01]},padding:0}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,FINANCIAL_DARK_FILLS.BLUE),t.set(DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,FINANCIAL_DARK_FILLS.BLUE),t.set(DEFAULT_CAPTION_LAYOUT_STYLE,"overlay"),t.set(DEFAULT_CAPTION_ALIGNMENT,"left"),t.set(DEFAULT_TOOLBAR_POSITION,"bottom"),t.set(DEFAULT_GRIDLINE_ENABLED,!0),t}},FINANCIAL_LIGHT_FILLS={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},FINANCIAL_LIGHT_STROKES={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},FinancialLight=class extends ChartTheme{getDefaultColors(){return{...super.getDefaultColors(),fills:{...FINANCIAL_LIGHT_FILLS},fillsFallback:Object.values({...FINANCIAL_LIGHT_FILLS}),strokes:{...FINANCIAL_LIGHT_STROKES},sequentialColors:getSequentialColors(FINANCIAL_LIGHT_FILLS),divergingColors:[FINANCIAL_LIGHT_FILLS.GREEN,FINANCIAL_LIGHT_FILLS.BLUE,FINANCIAL_LIGHT_FILLS.RED],up:{fill:FINANCIAL_LIGHT_FILLS.GREEN,stroke:FINANCIAL_LIGHT_STROKES.GREEN},down:{fill:FINANCIAL_LIGHT_FILLS.RED,stroke:FINANCIAL_LIGHT_STROKES.RED},neutral:{fill:FINANCIAL_LIGHT_FILLS.BLUE,stroke:FINANCIAL_LIGHT_STROKES.BLUE},altUp:{fill:FINANCIAL_LIGHT_FILLS.GREEN,stroke:FINANCIAL_LIGHT_STROKES.GREEN},altDown:{fill:FINANCIAL_LIGHT_FILLS.RED,stroke:FINANCIAL_LIGHT_STROKES.RED},altNeutral:{fill:FINANCIAL_LIGHT_FILLS.GRAY,stroke:FINANCIAL_LIGHT_STROKES.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),gridLineColor:{$foregroundBackgroundAccentMix:[.94,.01]},padding:0}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,FINANCIAL_LIGHT_FILLS.BLUE),t.set(DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,FINANCIAL_LIGHT_FILLS.BLUE),t.set(DEFAULT_CAPTION_LAYOUT_STYLE,"overlay"),t.set(DEFAULT_CAPTION_ALIGNMENT,"left"),t.set(DEFAULT_TOOLBAR_POSITION,"bottom"),t.set(DEFAULT_GRIDLINE_ENABLED,!0),t}},MATERIAL_DARK_FILLS={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},MATERIAL_DARK_STROKES={BLUE:"#90CAF9",ORANGE:"#FFCC80",GREEN:"#A5D6A7",CYAN:"#80DEEA",YELLOW:"#FFF9C4",VIOLET:"#B39DDB",GRAY:"#E0E0E0",MAGENTA:"#F48FB1",BROWN:"#A1887F",RED:"#EF9A9A"},MaterialDark=class extends DarkTheme{getDefaultColors(){return{...super.getDefaultColors(),fills:MATERIAL_DARK_FILLS,fillsFallback:Object.values(MATERIAL_DARK_FILLS),strokes:MATERIAL_DARK_STROKES,sequentialColors:getSequentialColors(MATERIAL_DARK_FILLS),divergingColors:[MATERIAL_DARK_FILLS.ORANGE,MATERIAL_DARK_FILLS.YELLOW,MATERIAL_DARK_FILLS.GREEN],secondSequentialColors:["#2196f3","#208FEC","#1E88E5","#1C7FDC","#1976d2","#176EC9","#1565c0"],secondDivergingColors:[MATERIAL_DARK_FILLS.GREEN,MATERIAL_DARK_FILLS.YELLOW,MATERIAL_DARK_FILLS.RED],up:{fill:MATERIAL_DARK_FILLS.GREEN,stroke:MATERIAL_DARK_STROKES.GREEN},down:{fill:MATERIAL_DARK_FILLS.RED,stroke:MATERIAL_DARK_STROKES.RED},neutral:{fill:MATERIAL_DARK_FILLS.GRAY,stroke:MATERIAL_DARK_STROKES.GRAY},altUp:{fill:MATERIAL_DARK_FILLS.BLUE,stroke:MATERIAL_DARK_STROKES.BLUE},altDown:{fill:MATERIAL_DARK_FILLS.RED,stroke:MATERIAL_DARK_STROKES.RED},altNeutral:{fill:MATERIAL_DARK_FILLS.GRAY,stroke:MATERIAL_DARK_STROKES.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,MATERIAL_DARK_FILLS.BLUE),t.set(DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,MATERIAL_DARK_FILLS.BLUE),t}},MATERIAL_LIGHT_FILLS={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},MATERIAL_LIGHT_STROKES={BLUE:"#1565C0",ORANGE:"#E65100",GREEN:"#2E7D32",CYAN:"#00838F",YELLOW:"#F9A825",VIOLET:"#4527A0",GRAY:"#616161",MAGENTA:"#C2185B",BROWN:"#4E342E",RED:"#B71C1C"},MaterialLight=class extends ChartTheme{getDefaultColors(){return{...super.getDefaultColors(),fills:MATERIAL_LIGHT_FILLS,fillsFallback:Object.values(MATERIAL_LIGHT_FILLS),strokes:MATERIAL_LIGHT_STROKES,sequentialColors:getSequentialColors(MATERIAL_LIGHT_FILLS),divergingColors:[MATERIAL_LIGHT_FILLS.ORANGE,MATERIAL_LIGHT_FILLS.YELLOW,MATERIAL_LIGHT_FILLS.GREEN],secondSequentialColors:["#2196f3","#329EF4","#42a5f5","#53ADF6","#64b5f6","#7AC0F8","#90caf9"],secondDivergingColors:[MATERIAL_LIGHT_FILLS.GREEN,MATERIAL_LIGHT_FILLS.YELLOW,MATERIAL_LIGHT_FILLS.RED],up:{fill:MATERIAL_LIGHT_FILLS.GREEN,stroke:MATERIAL_LIGHT_STROKES.GREEN},down:{fill:MATERIAL_LIGHT_FILLS.RED,stroke:MATERIAL_LIGHT_STROKES.RED},neutral:{fill:MATERIAL_LIGHT_FILLS.GRAY,stroke:MATERIAL_LIGHT_STROKES.GRAY},altUp:{fill:MATERIAL_LIGHT_FILLS.BLUE,stroke:MATERIAL_LIGHT_STROKES.BLUE},altDown:{fill:MATERIAL_LIGHT_FILLS.RED,stroke:MATERIAL_LIGHT_STROKES.RED},altNeutral:{fill:MATERIAL_LIGHT_FILLS.GRAY,stroke:MATERIAL_LIGHT_STROKES.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,MATERIAL_LIGHT_FILLS.BLUE),t.set(DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,MATERIAL_LIGHT_FILLS.BLUE),t}},POLYCHROMA_DARK_FILLS={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},POLYCHROMA_DARK_STROKES={BLUE:"#6698ff",PURPLE:"#c0a3ff",MAGENTA:"#fc8dfc",PINK:"#ff82b1",RED:"#ff9b70",ORANGE:"#ffcf4e",YELLOW:"#ffff58",GREEN:"#58dd70",CYAN:"#51e2c9",MODERATE_BLUE:"#4fd7ff",GRAY:"#eeeeee"},PolychromaDark=class extends DarkTheme{getDefaultColors(){return{fills:POLYCHROMA_DARK_FILLS,fillsFallback:Object.values(POLYCHROMA_DARK_FILLS),strokes:POLYCHROMA_DARK_STROKES,sequentialColors:getSequentialColors(POLYCHROMA_DARK_FILLS),divergingColors:[POLYCHROMA_DARK_FILLS.BLUE,POLYCHROMA_DARK_FILLS.RED],hierarchyColors:[],secondSequentialColors:[POLYCHROMA_DARK_FILLS.BLUE,POLYCHROMA_DARK_FILLS.PURPLE,POLYCHROMA_DARK_FILLS.MAGENTA,POLYCHROMA_DARK_FILLS.PINK,POLYCHROMA_DARK_FILLS.RED,POLYCHROMA_DARK_FILLS.ORANGE,POLYCHROMA_DARK_FILLS.YELLOW,POLYCHROMA_DARK_FILLS.GREEN],secondDivergingColors:[POLYCHROMA_DARK_FILLS.BLUE,POLYCHROMA_DARK_FILLS.RED],secondHierarchyColors:[],up:{fill:POLYCHROMA_DARK_FILLS.GREEN,stroke:POLYCHROMA_DARK_STROKES.GREEN},down:{fill:POLYCHROMA_DARK_FILLS.RED,stroke:POLYCHROMA_DARK_STROKES.RED},neutral:{fill:POLYCHROMA_DARK_FILLS.GRAY,stroke:POLYCHROMA_DARK_STROKES.GRAY},altUp:{fill:POLYCHROMA_DARK_FILLS.BLUE,stroke:POLYCHROMA_DARK_STROKES.BLUE},altDown:{fill:POLYCHROMA_DARK_FILLS.RED,stroke:POLYCHROMA_DARK_STROKES.RED},altNeutral:{fill:POLYCHROMA_DARK_FILLS.GRAY,stroke:POLYCHROMA_DARK_STROKES.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,POLYCHROMA_DARK_FILLS.BLUE),t.set(DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,POLYCHROMA_DARK_FILLS.BLUE),t}},POLYCHROMA_LIGHT_FILLS={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},POLYCHROMA_LIGHT_STROKES={BLUE:"#2346c9",PURPLE:"#7653d4",MAGENTA:"#a73da9",PINK:"#c32d66",RED:"#c84b1c",ORANGE:"#c87f00",YELLOW:"#c1b900",GREEN:"#008c1c",CYAN:"#00927c",MODERATE_BLUE:"#0087bb",GRAY:"#888888"},PolychromaLight=class extends ChartTheme{getDefaultColors(){return{...super.getDefaultColors(),fills:POLYCHROMA_LIGHT_FILLS,fillsFallback:Object.values(POLYCHROMA_LIGHT_FILLS),strokes:POLYCHROMA_LIGHT_STROKES,sequentialColors:getSequentialColors(POLYCHROMA_LIGHT_FILLS),divergingColors:[POLYCHROMA_LIGHT_FILLS.BLUE,POLYCHROMA_LIGHT_FILLS.RED],hierarchyColors:[],secondSequentialColors:[POLYCHROMA_LIGHT_FILLS.BLUE,POLYCHROMA_LIGHT_FILLS.PURPLE,POLYCHROMA_LIGHT_FILLS.MAGENTA,POLYCHROMA_LIGHT_FILLS.PINK,POLYCHROMA_LIGHT_FILLS.RED,POLYCHROMA_LIGHT_FILLS.ORANGE,POLYCHROMA_LIGHT_FILLS.YELLOW,POLYCHROMA_LIGHT_FILLS.GREEN],secondDivergingColors:[POLYCHROMA_LIGHT_FILLS.BLUE,POLYCHROMA_LIGHT_FILLS.RED],secondHierarchyColors:[],up:{fill:POLYCHROMA_LIGHT_FILLS.GREEN,stroke:POLYCHROMA_LIGHT_STROKES.GREEN},down:{fill:POLYCHROMA_LIGHT_FILLS.RED,stroke:POLYCHROMA_LIGHT_STROKES.RED},neutral:{fill:POLYCHROMA_LIGHT_FILLS.GRAY,stroke:POLYCHROMA_LIGHT_STROKES.GRAY},altUp:{fill:POLYCHROMA_LIGHT_FILLS.BLUE,stroke:POLYCHROMA_LIGHT_STROKES.BLUE},altDown:{fill:POLYCHROMA_LIGHT_FILLS.RED,stroke:POLYCHROMA_LIGHT_STROKES.RED},altNeutral:{fill:POLYCHROMA_LIGHT_FILLS.GRAY,stroke:POLYCHROMA_LIGHT_STROKES.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,POLYCHROMA_LIGHT_FILLS.BLUE),t.set(DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,POLYCHROMA_LIGHT_FILLS.BLUE),t}},SHEETS_DARK_FILLS={BLUE:"#4472C4",ORANGE:"#ED7D31",GRAY:"#A5A5A5",YELLOW:"#FFC000",MODERATE_BLUE:"#5B9BD5",GREEN:"#70AD47",DARK_GRAY:"#7B7B7B",DARK_BLUE:"#264478",VERY_DARK_GRAY:"#636363",DARK_YELLOW:"#997300"},SHEETS_DARK_STROKES={BLUE:"#6899ee",ORANGE:"#ffa55d",GRAY:"#cdcdcd",YELLOW:"#ffea53",MODERATE_BLUE:"#82c3ff",GREEN:"#96d56f",DARK_GRAY:"#a1a1a1",DARK_BLUE:"#47689f",VERY_DARK_GRAY:"#878787",DARK_YELLOW:"#c0993d"},SheetsDark=class extends DarkTheme{getDefaultColors(){return{...super.getDefaultColors(),fills:{...SHEETS_DARK_FILLS,RED:SHEETS_DARK_FILLS.ORANGE},fillsFallback:Object.values({...SHEETS_DARK_FILLS,RED:SHEETS_DARK_FILLS.ORANGE}),strokes:{...SHEETS_DARK_STROKES,RED:SHEETS_DARK_STROKES.ORANGE},sequentialColors:getSequentialColors({...SHEETS_DARK_FILLS,RED:SHEETS_DARK_FILLS.ORANGE}),divergingColors:[SHEETS_DARK_FILLS.ORANGE,SHEETS_DARK_FILLS.YELLOW,SHEETS_DARK_FILLS.GREEN],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[SHEETS_DARK_FILLS.GREEN,SHEETS_DARK_FILLS.YELLOW,SHEETS_DARK_FILLS.ORANGE],up:{fill:SHEETS_DARK_FILLS.GREEN,stroke:SHEETS_DARK_STROKES.GREEN},down:{fill:SHEETS_DARK_FILLS.ORANGE,stroke:SHEETS_DARK_STROKES.ORANGE},neutral:{fill:SHEETS_DARK_FILLS.GRAY,stroke:SHEETS_DARK_STROKES.GRAY},altUp:{fill:SHEETS_DARK_FILLS.BLUE,stroke:SHEETS_DARK_STROKES.BLUE},altDown:{fill:SHEETS_DARK_FILLS.ORANGE,stroke:SHEETS_DARK_STROKES.ORANGE},altNeutral:{fill:SHEETS_DARK_FILLS.GRAY,stroke:SHEETS_DARK_STROKES.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,SHEETS_DARK_FILLS.BLUE),t.set(DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,SHEETS_DARK_FILLS.BLUE),t}},SHEETS_LIGHT_FILLS={BLUE:"#5281d5",ORANGE:"#ff8d44",GRAY:"#b5b5b5",YELLOW:"#ffd02f",MODERATE_BLUE:"#6aabe6",GREEN:"#7fbd57",DARK_GRAY:"#8a8a8a",DARK_BLUE:"#335287",VERY_DARK_GRAY:"#717171",DARK_YELLOW:"#a98220"},SHEETS_LIGHT_STROKES={BLUE:"#214d9b",ORANGE:"#c25600",GRAY:"#7f7f7f",YELLOW:"#d59800",MODERATE_BLUE:"#3575ac",GREEN:"#4b861a",DARK_GRAY:"#575757",DARK_BLUE:"#062253",VERY_DARK_GRAY:"#414141",DARK_YELLOW:"#734f00"},SheetsLight=class extends ChartTheme{getDefaultColors(){return{...super.getDefaultColors(),fills:{...SHEETS_LIGHT_FILLS,RED:SHEETS_LIGHT_FILLS.ORANGE},fillsFallback:Object.values({...SHEETS_LIGHT_FILLS,RED:SHEETS_LIGHT_FILLS.ORANGE}),strokes:{...SHEETS_LIGHT_STROKES,RED:SHEETS_LIGHT_STROKES.ORANGE},sequentialColors:getSequentialColors({...SHEETS_LIGHT_FILLS,RED:SHEETS_LIGHT_FILLS.ORANGE}),divergingColors:[SHEETS_LIGHT_FILLS.ORANGE,SHEETS_LIGHT_FILLS.YELLOW,SHEETS_LIGHT_FILLS.GREEN],secondSequentialColors:["#5090dc","#629be0","#73a6e3","#85b1e7","#96bcea","#a8c8ee","#b9d3f1","#cbdef5"],secondDivergingColors:[SHEETS_LIGHT_FILLS.GREEN,SHEETS_LIGHT_FILLS.YELLOW,SHEETS_LIGHT_FILLS.ORANGE],secondHierarchyColors:[],up:{fill:SHEETS_LIGHT_FILLS.GREEN,stroke:SHEETS_LIGHT_STROKES.GREEN},down:{fill:SHEETS_LIGHT_FILLS.ORANGE,stroke:SHEETS_LIGHT_STROKES.ORANGE},neutral:{fill:SHEETS_LIGHT_STROKES.GRAY,stroke:SHEETS_LIGHT_STROKES.GRAY},altUp:{fill:SHEETS_LIGHT_FILLS.BLUE,stroke:SHEETS_LIGHT_STROKES.BLUE},altDown:{fill:SHEETS_LIGHT_FILLS.ORANGE,stroke:SHEETS_LIGHT_STROKES.ORANGE},altNeutral:{fill:SHEETS_LIGHT_FILLS.GRAY,stroke:SHEETS_LIGHT_STROKES.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,SHEETS_LIGHT_FILLS.BLUE),t.set(DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,SHEETS_LIGHT_FILLS.BLUE),t}},VIVID_DARK_FILLS={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},VIVID_DARK_STROKES={BLUE:"#67b7ff",ORANGE:"#ffc24d",GREEN:"#5cc86f",CYAN:"#54ebff",VIOLET:"#fff653",YELLOW:"#c18aff",GRAY:"#aeaeae",MAGENTA:"#f078d4",BROWN:"#ba8438",RED:"#ff726e"},VividDark=class extends DarkTheme{getDefaultColors(){return{fills:VIVID_DARK_FILLS,fillsFallback:Object.values(VIVID_DARK_FILLS),strokes:VIVID_DARK_STROKES,sequentialColors:getSequentialColors(VIVID_DARK_FILLS),divergingColors:[VIVID_DARK_FILLS.ORANGE,VIVID_DARK_FILLS.YELLOW,VIVID_DARK_FILLS.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#0076e6","#0069cc","#005cb3","#004f99","#004280","#003466","#00274c"],secondDivergingColors:[VIVID_DARK_FILLS.GREEN,VIVID_DARK_FILLS.YELLOW,VIVID_DARK_FILLS.RED],secondHierarchyColors:[],up:{fill:VIVID_DARK_FILLS.GREEN,stroke:VIVID_DARK_STROKES.GREEN},down:{fill:VIVID_DARK_FILLS.RED,stroke:VIVID_DARK_STROKES.RED},neutral:{fill:VIVID_DARK_FILLS.GRAY,stroke:VIVID_DARK_STROKES.GRAY},altUp:{fill:VIVID_DARK_FILLS.BLUE,stroke:VIVID_DARK_STROKES.BLUE},altDown:{fill:VIVID_DARK_FILLS.ORANGE,stroke:VIVID_DARK_STROKES.ORANGE},altNeutral:{fill:VIVID_DARK_FILLS.GRAY,stroke:VIVID_DARK_STROKES.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,VIVID_DARK_FILLS.BLUE),t.set(DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,VIVID_DARK_FILLS.BLUE),t}},VIVID_FILLS={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},VIVID_STROKES={BLUE:"#0f68c0",ORANGE:"#d47100",GREEN:"#007922",CYAN:"#009ac2",VIOLET:"#bca400",YELLOW:"#753cac",GRAY:"#646464",MAGENTA:"#9b2685",BROWN:"#6c3b00",RED:"#cb0021"},VividLight=class extends ChartTheme{getDefaultColors(){return{...super.getDefaultColors(),fills:VIVID_FILLS,fillsFallback:Object.values(VIVID_FILLS),strokes:VIVID_STROKES,sequentialColors:getSequentialColors(VIVID_FILLS),divergingColors:[VIVID_FILLS.ORANGE,VIVID_FILLS.YELLOW,VIVID_FILLS.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#1a8fff","#339cff","#4da8ff","#66b5ff","#80c1ff","#99cdff","#b3daff"],secondDivergingColors:[VIVID_FILLS.GREEN,VIVID_FILLS.YELLOW,VIVID_FILLS.RED],secondHierarchyColors:[],up:{fill:VIVID_FILLS.GREEN,stroke:VIVID_STROKES.GREEN},down:{fill:VIVID_FILLS.RED,stroke:VIVID_STROKES.RED},neutral:{fill:VIVID_FILLS.GRAY,stroke:VIVID_STROKES.GRAY},altUp:{fill:VIVID_FILLS.BLUE,stroke:VIVID_STROKES.BLUE},altDown:{fill:VIVID_FILLS.ORANGE,stroke:VIVID_STROKES.ORANGE},altNeutral:{fill:VIVID_FILLS.GRAY,stroke:VIVID_STROKES.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,VIVID_FILLS.BLUE),t.set(DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,VIVID_FILLS.BLUE),t}},lightTheme=simpleMemorize(()=>new ChartTheme),darkTheme=simpleMemorize(()=>new DarkTheme),themeCacheDebug=Debug.create(!0,"perf"),cacheCallback=(t,e,i)=>{themeCacheDebug("[CACHE] ChartTheme",t,e.name,i)},themes={"ag-default-dark":darkTheme,"ag-sheets-dark":simpleMemorize(()=>new SheetsDark,cacheCallback),"ag-polychroma-dark":simpleMemorize(()=>new PolychromaDark,cacheCallback),"ag-vivid-dark":simpleMemorize(()=>new VividDark,cacheCallback),"ag-material-dark":simpleMemorize(()=>new MaterialDark,cacheCallback),"ag-financial-dark":simpleMemorize(()=>new FinancialDark,cacheCallback),null:lightTheme,undefined:lightTheme,"ag-default":lightTheme,"ag-sheets":simpleMemorize(()=>new SheetsLight,cacheCallback),"ag-polychroma":simpleMemorize(()=>new PolychromaLight,cacheCallback),"ag-vivid":simpleMemorize(()=>new VividLight,cacheCallback),"ag-material":simpleMemorize(()=>new MaterialLight,cacheCallback),"ag-financial":simpleMemorize(()=>new FinancialLight,cacheCallback)},getChartTheme=simpleMemorize(createChartTheme,cacheCallback);function createChartTheme(t){if(t instanceof ChartTheme)return t;if(t==null||typeof t=="string"){const i=themes[t];return i?i():(logger_exports.warnOnce(`the theme [${t}] is invalid, using [ag-default] instead.`),lightTheme())}const{errors:e}=validate(t,themeOptionsDef,"theme");if(!e.length){const i=reduceThemeOptions(t),s=i.baseTheme?getChartTheme(i.baseTheme):lightTheme();return new s.constructor(i)}for(const{message:i}of e)logger_exports.warnOnce(i);return lightTheme()}function reduceThemeOptions(t){let e=t,i,s;const n=[];for(;typeof e=="object";)i??(i=e.palette),s??(s=e.params),e.overrides&&n.push(e.overrides),e=e.baseTheme;return{baseTheme:e,overrides:mergeDefaults(...n),params:s,palette:i}}var themeOptionsDef={baseTheme:or(string,object),overrides:object,params:{accentColor:color,axisColor:color,backgroundColor:color,borderColor:color,foregroundColor:color,fontFamily:string,fontSize:number,fontWeight:or(string,number),gridLineColor:color,padding:number,subtleTextColor:color,textColor:color,chromeBackgroundColor:color,chromeFontFamily:string,chromeFontSize:number,chromeFontWeight:or(string,number),chromeSubtleTextColor:color,chromeTextColor:color,inputBackgroundColor:color,inputTextColor:color,crosshairLabelBackgroundColor:color,crosshairLabelTextColor:color},palette:{fills:arrayOf(colorUnion),strokes:arrayOf(color),up:{fill:or(color,gradientStrict),stroke:color},down:{fill:or(color,gradientStrict),stroke:color},neutral:{fill:or(color,gradientStrict),stroke:color}}},stringFormat=t=>`'${t}'`,_ChartOptions=class ht{constructor(e,i,s,n,o,a,r=!1){this.themeParameters={},this.optionMetadata=o??{},this.processedOverrides=s??{};let l=null;e instanceof ht?(l=e,this.specialOverrides=l.specialOverrides,a===void 0&&(a=jsonDiff(l.userOptions,i,ht.JSON_DIFF_OPTS)),this.userOptions=deepClone(merge(a,l.userOptions),ht.OPTIONS_CLONE_OPTS)):(this.userOptions=deepClone(e??i,ht.OPTIONS_CLONE_OPTS),this.specialOverrides=this.specialOverridesDefaults({...n})),r&&this.removeLeftoverSymbols(this.userOptions);let c,h,d,u,p,g;!r&&a!==void 0&&ht.isFastPathDelta(a)&&l!=null?({activeTheme:c,processedOptions:h,defaultAxes:d,fastDelta:u}=this.fastSetup(a,l),p=l.themeParameters,g=l.annotationThemes):(ht.perfDebug("ChartOptions.slowSetup()"),{activeTheme:c,processedOptions:h,defaultAxes:d,themeParameters:p,annotationThemes:g}=this.slowSetup(s,a,r)),this.activeTheme=c,this.processedOptions=h,this.defaultAxes=d,this.fastDelta=u??void 0,this.themeParameters=p,this.annotationThemes=g,Debug.inDevelopmentMode(()=>deepFreeze(this))}static isFastPathDelta(e){for(const i of Object.keys(e??{}))if(!this.FAST_PATH_OPTIONS.has(i))return ht.perfDebug("ChartOptions.isFastPathDelta() - slow path required due to presence of: ",i),!1;return ht.perfDebug("ChartOptions.isFastPathDelta() - fast path possible."),!0}fastSetup(e,i){const{activeTheme:s,defaultAxes:n,processedOptions:o}=i,{presetType:a}=this.optionMetadata,r=a?PRESET_DATA_PROCESSORS[a]:void 0;if(a!=null&&e?.data!=null&&r!=null){const{series:c,data:h}=r(e.data);e=mergeDefaults({series:c,data:h},e)}this.fastSeriesSetup(e,o);const l=mergeDefaults(e,o);return ht.debug("ChartOptions.fastSetup() - processed options",l),{activeTheme:s,defaultAxes:n,processedOptions:l,fastDelta:e}}fastSeriesSetup(e,i){e?.series&&(e.series?.every((s,n)=>jsonPropertyCompare(s,i.series?.[n]??{}))?delete e.series:e.series=e.series.map((s,n)=>merge(s,i.series?.[n]??{})))}slowSetup(e,i,s=!1){let n=deepClone(this.userOptions,ht.OPTIONS_CLONE_OPTS);i&&(n=mergeDefaults(i,n),s&&this.removeLeftoverSymbols(n));const{presetType:o}=this.optionMetadata;if(o!=null){const x=PRESETS[o],b=n,S=n.type,v=S!=null?getChartTheme(n.theme).presets[S]:void 0;ht.debug(">>> AgCharts.createOrUpdate() - applying preset",b),n=x?.(b,v,()=>this.activeTheme)??n}this.soloSeriesIntegrity(n),enterpriseModule.isEnterprise||removeUsedEnterpriseOptions(n);const a=getChartTheme(n.theme);if(o!=null&&a.templateTheme(n,!1),this.validateSeriesOptions(n),this.chartDef=moduleRegistry_exports.detectChartDefinition(n),!this.chartDef.placeholder){const{valid:x,errors:b}=validate(n,this.chartDef.options);b.forEach(S=>logger_exports.warn(S)),n=x}this.validatePluginOptions(n),this.validateAxesOptions(n),this.removeDisabledOptions(n);const r=this.optionsType(n),{annotations:l={},axes:c={},series:h,...d}=this.getSeriesThemeConfig(r,a),[u,p]=this.splitAnnotationsOptions(l),g=deepClone(p),f=this.getDefaultAxes(n,h);let m=mergeDefaults(e,n,u,d,f);this.processAxesOptions(m,c),this.processSeriesOptions(m,a),m=deepClone(m,ht.OPTIONS_CLONE_OPTS),(isAgCartesianChartOptions(m)||isAgStandaloneChartOptions(m)||isAgPolarChartOptionsWithSeriesBasedLegend(m))&&m.legend?.enabled==null&&(m.legend??(m.legend={}),m.legend.enabled=m.series.length>1),this.enableConfiguredOptions(m,n);const y=this.getThemeParameters(a,m);return y.__palette=deepClone(a.palette),y.__palette.type=isObject(n.theme)?paletteType(n.theme?.palette):"inbuilt",this.resolveThemeOperations(y,y),this.resolveThemeOperations(y,m),this.resolveThemeOperations(y,g),this.processMiniChartSeriesOptions(m),a.templateTheme(m,!1),removeUnusedEnterpriseOptions(m),enterpriseModule.isEnterprise||removeUsedEnterpriseOptions(m,!0),this.validateSeriesOptions(m),this.validateAxesOptions(m),ht.debug(()=>["ChartOptions.slowSetup() - processed options",deepClone(m)]),{activeTheme:a,processedOptions:m,defaultAxes:f,themeParameters:y,annotationThemes:g}}validatePluginOptions(e){for(const i of moduleRegistry_exports.listModulesByType(ModuleType.Plugin)){const s=i.name;if(s in e&&(!i.chartType||i.chartType===this.chartDef?.name)){const{valid:n,errors:o}=validate(e[s],i.options,i.name);o.forEach(a=>logger_exports.warn(a)),e[s]=n}}}validateSeriesOptions(e){const i=this.chartDef?.name,s=[],n=e.series?.length??0;let o;for(let a=0;a<n;a++){const r=`series[${a}]`,l=e.series[a],c=moduleRegistry_exports.getSeriesModule(l.type??"line");if(c==null){o??(o=joinFormatted(Array.from(moduleRegistry_exports.listModulesByType(ModuleType.Series)).filter(p=>!i||p.chartType===i).map(p=>p.name),"or",stringFormat)),logger_exports.warn(`Unknown type \`${l.type}\` at \`${r}.type\`; expecting ${o}, ignoring.`);continue}else if(i&&c.chartType!==i){logger_exports.warn(`Series type \`${c.name}\` at \`${r}.type\` is not supported by chart type \`${i}\`, ignoring.`);continue}const{validate:h=validate}=c,{valid:d,errors:u}=h(l,c.options,r);u.forEach(p=>logger_exports.warn(p)),u.some(p=>p.required&&p.path===r)||s.push(d)}e.series=s}validateAxesOptions(e){if(!("axes"in e)||!e.axes)return;const i=this.chartDef?.name,s=[],n=e.axes.length??0;let o;for(let a=0;a<n;a++){const r=`axes[${a}]`,l=e.axes[a],c=moduleRegistry_exports.getAxisModule(l.type);if(c==null){o??(o=joinFormatted(Array.from(moduleRegistry_exports.listModulesByType(ModuleType.Axis)).filter(p=>p.chartType===i).map(p=>p.name),"or",stringFormat)),logger_exports.warn(`Unknown type \`${l.type}\` at \`${r}.type\`; expecting one of ${o}, ignoring all axes options.`),delete e.axes;break}else if(c.chartType!==i){logger_exports.warn(`Axis type \`${c.name}\` at \`${r}.type\` is not supported by chart type \`${i}\`, ignoring.`);break}const{validate:h=validate}=c,{valid:d,errors:u}=h(l,c.options,r);u.forEach(p=>logger_exports.warn(p)),u.some(p=>p.required&&p.path===r)||s.push(d)}e.axes=s}diffOptions(e){return this===e?{}:e==null?this.processedOptions:this.fastDelta??jsonDiff(e.processedOptions,this.processedOptions,ht.JSON_DIFF_OPTS)}getSeriesThemeConfig(e,i){return i?.config[e]??{}}getDefaultAxes(e,i){const s=this.optionsType(e),n=e.series?.find(a=>(a.type??"line")===s)??{},o=seriesRegistry.cloneDefaultAxes(s);return jsonResolveOperations(o,{},void 0,mergeDefaults(n,i)),o}optionsType(e){return e.series?.[0]?.type??"line"}splitAnnotationsOptions(e){const{axesButtons:i=null,enabled:s=null,optionsToolbar:n=null,toolbar:o=null,...a}=e;return i==null&&s==null&&n==null&&o==null?[{},a]:[{annotations:{axesButtons:i,enabled:s,optionsToolbar:n,toolbar:o}},a]}processAxesOptions(e,i){"axes"in e&&(e.axes=e.axes?.map(s=>{const{crossLines:n,...o}=mergeDefaults(i[s.type]?.[s.position],i[s.type]);s.crossLines&&(s.crossLines=mergeArrayDefaults(s.crossLines,n));const a=o.gridLine?.style;s.gridLine?.style&&a?.length&&(s.gridLine.style=s.gridLine.style.map((u,p)=>u.stroke!=null||u.lineDash!=null?mergeDefaults(u,a.at(p%a.length)):u));const{top:r,right:l,bottom:c,left:h,...d}=mergeDefaults(s,o);return d}))}processSeriesOptions(e,i){const s=this.getTooltipPositionDefaults(e),n=e.series?.map(o=>{o.type??(o.type="line");const{innerLabels:a,...r}=this.getSeriesThemeConfig(o.type,i).series??{},l=moduleRegistry_exports.getSeriesModule(o.type),c=!!l?.options.tooltip,h=!!l?.options.visible,d=c&&this.getTooltipRangeDefaults(e,o.type),u=mergeDefaults(this.getSeriesGroupingOptions(o),o,c&&s,d,r,h&&{visible:!0});return u.innerLabels&&(u.innerLabels=mergeArrayDefaults(u.innerLabels,a)),u});e.series=this.setSeriesGroupingOptions(n??[])}processMiniChartSeriesOptions(e){let i=e.navigator?.miniChart?.series;i!=null&&(i=i.map(s=>(s.type??(s.type="line"),s)),e.navigator.miniChart.series=this.setSeriesGroupingOptions(i))}getThemeParameters(e,i){const s=e.getPublicParameters();if(!isPlainObject(i.theme)||!i.theme.params)return s;const{valid:n,errors:o}=validate(i.theme.params,themeOptionsDef.params);for(const{message:a}of o)logger_exports.warnOnce(a);return mergeDefaults(n,s)}resolveThemeOperations(e,i){const s=jsonResolveOperations(i,e,new Set(["palette","data","theme"]));ht.debug("ChartOptions.resolveTheme()",s)}getSeriesGroupingOptions(e){const i=seriesRegistry.isGroupable(e.type),s=seriesRegistry.isStackable(e.type),n=seriesRegistry.isStackedByDefault(e.type);e.grouped&&!i&&logger_exports.warnOnce(`unsupported grouping of series type "${e.type}".`),(e.stacked||e.stackGroup)&&!s&&logger_exports.warnOnce(`unsupported stacking of series type "${e.type}".`);let{grouped:o,stacked:a}=e;return a??(a=(n||e.stackGroup!=null)&&!(i&&o)),o??(o=!0),{stacked:s&&a,grouped:i&&o&&!(s&&a)}}setSeriesGroupingOptions(e){const i=this.getSeriesGrouping(e);ht.debug("ChartOptions.setSeriesGroupingOptions() - series grouping: ",i);const s={},n=i.reduce((o,a)=>{var r;return a.groupType==="default"||(o[r=a.seriesType]??(o[r]=0),o[a.seriesType]+=a.groupType==="stack"?1:a.series.length),o},{});return i.flatMap(o=>{var a;switch(s[a=o.seriesType]??(s[a]=0),o.groupType){case"stack":{const r=s[o.seriesType]++;return o.series.map((l,c)=>Object.assign(l,{seriesGrouping:{groupId:o.groupId,groupIndex:r,groupCount:n[o.seriesType],stackIndex:c,stackCount:o.series.length}}))}case"group":return o.series.map(r=>Object.assign(r,{seriesGrouping:{groupId:o.groupId,groupIndex:s[o.seriesType]++,groupCount:n[o.seriesType],stackIndex:0,stackCount:0}}))}return o.series}).map(({stacked:o,grouped:a,...r})=>r)}getSeriesGroupId(e){return[e.type,e.xKey,e.stacked?e.stackGroup??"stacked":"grouped"].filter(Boolean).join("-")}getSeriesGrouping(e){const i=new Map;return e.reduce((s,n)=>{const o=n.type;if(!n.stacked&&!n.grouped)s.push({groupType:"default",seriesType:o,series:[n],groupId:"__default__"});else{const a=this.getSeriesGroupId(n);if(!i.has(a)){const l={groupType:n.stacked?"stack":"group",seriesType:o,series:[],groupId:a};i.set(a,l),s.push(l)}i.get(a).series.push(n)}return s},[])}getTooltipPositionDefaults(e){const i=e.tooltip?.position;if(!isPlainObject(i))return;const{type:s,anchorTo:n,placement:o,xOffset:a,yOffset:r}=i,l={};return isString(s)&&isEnumValue(AgTooltipPositionType,s)&&(l.type=s),isString(n)&&isEnumValue(AgTooltipAnchorToType,n)&&(l.anchorTo=n),isString(o)&&isEnumValue(AgTooltipPlacementType,o)&&(l.placement=o),isFiniteNumber(a)&&(l.xOffset=a),isFiniteNumber(r)&&(l.yOffset=r),{tooltip:{position:l}}}getTooltipRangeDefaults(e,i){return{tooltip:{range:e.tooltip?.range??seriesRegistry.getTooltipDefauls(i)?.range}}}soloSeriesIntegrity(e){if(!isArray(e.series))return;const i=e.series;if(i&&i.length>1&&i.some(s=>seriesRegistry.isSolo(s.type))){const s=this.optionsType(e);if(seriesRegistry.isSolo(s))logger_exports.warn(`series[0] of type '${s}' is incompatible with other series types. Only processing series[0]`),e.series=i.slice(0,1);else{const{solo:n,nonSolo:o}=groupBy(i,r=>seriesRegistry.isSolo(r.type)?"solo":"nonSolo"),a=unique(n.map(r=>r.type)).join(", ");logger_exports.warn(`Unable to mix these series types with the lead series type: ${a}`),e.series=o}}}static enableConfiguredJsonOptions(e,i){typeof i=="object"&&"enabled"in i&&!i._enabledFromTheme&&e.enabled==null&&(i.enabled=!0)}static cleanupEnabledFromThemeJsonOptions(e){e._enabledFromTheme!=null&&delete e._enabledFromTheme}enableConfiguredOptions(e,i){jsonWalk(i,ht.enableConfiguredJsonOptions,new Set(["data","theme"]),e),jsonWalk(e,ht.cleanupEnabledFromThemeJsonOptions,new Set(["data","theme"]))}static removeDisabledOptionJson(e){"enabled"in e&&e.enabled===!1&&Object.keys(e).forEach(i=>{i!=="enabled"&&delete e[i]})}removeDisabledOptions(e){jsonWalk(e,ht.removeDisabledOptionJson,new Set(["data","theme"]))}static removeLeftoverSymbolsJson(e){if(!(!e||!isObject(e)))for(const i of Object.keys(e)){const s=e[i];isSymbol(s)&&delete e[i]}}removeLeftoverSymbols(e){jsonWalk(e,ht.removeLeftoverSymbolsJson,new Set(["data"]))}specialOverridesDefaults(e){if(e.window==null?e.window=getWindow():setWindow(e.window),e.document==null?e.document=getDocument():setDocument(e.document),e.window==null)throw new Error("AG Charts - unable to resolve global window");if(e.document==null)throw new Error("AG Charts - unable to resolve global document");return e}};_ChartOptions.OPTIONS_CLONE_OPTS={shallow:new Set(["data","container"]),assign:new Set(["context","theme"])},_ChartOptions.JSON_DIFF_OPTS=new Set(["data"]),_ChartOptions.perfDebug=Debug.create(!0,"perf"),_ChartOptions.FAST_PATH_OPTIONS=new Set(["data","width","height","container"]),_ChartOptions.debug=Debug.create(!0,"opts");var ChartOptions=_ChartOptions,CLEANUP_TIMEOUT_MS=1e3,_Pool=class vt{constructor(e,i,s,n,o,a=CLEANUP_TIMEOUT_MS){this.name=e,this.buildItem=i,this.releaseItem=s,this.destroyItem=n,this.maxPoolSize=o,this.cleanupTimeMs=a,this.freePool=[],this.busyPool=new Set}static getPool(e,i,s,n,o){return this.pools.has(e)||this.pools.set(e,new vt(e,i,s,n,o)),this.pools.get(e)}isFull(){return this.freePool.length+this.busyPool.size>=this.maxPoolSize}hasFree(){return this.freePool.length>0}obtain(e){if(!this.hasFree()&&this.isFull())throw new Error("AG Charts - pool exhausted");let i=this.freePool.pop();return i==null?(i=this.buildItem(e),vt.debug(()=>[`Pool[name=${this.name}]: Created instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i])):vt.debug(()=>[`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i]),this.busyPool.add(i),{item:i,release:()=>this.release(i)}}obtainFree(){const e=this.freePool.pop();if(e==null)throw new Error("AG Charts - pool has no free instances");return vt.debug(()=>[`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,e]),this.busyPool.add(e),{item:e,release:()=>this.release(e)}}release(e){if(!this.busyPool.has(e))throw new Error("AG Charts - cannot free item from pool which is not tracked as busy.");vt.debug(()=>[`Pool[name=${this.name}]: Releasing instance (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,e]),this.releaseItem(e),this.busyPool.delete(e),this.freePool.push(e),vt.debug(()=>[`Pool[name=${this.name}]: Returned instance to free pool (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,e]);const i=Date.now(),s=i+this.cleanupTimeMs*.5;this.cleanPoolTimer&&(this.cleanPoolDue??1/0)<s&&(clearTimeout(this.cleanPoolTimer),this.cleanPoolTimer=void 0),this.cleanPoolTimer||(this.cleanPoolDue=i+this.cleanupTimeMs,this.cleanPoolTimer=setTimeout(this.cleanPool.bind(this),this.cleanupTimeMs))}cleanPool(){const e=this.freePool.splice(0);for(const i of e)this.destroyItem(i);vt.debug(()=>[`Pool[name=${this.name}]: Cleaned pool of ${e.length} items (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`])}destroy(){this.cleanPool();for(const e of this.busyPool.values())this.destroyItem(e);this.busyPool.clear()}};_Pool.pools=new Map,_Pool.debug=Debug.create(!0,"pool");var Pool=_Pool;moduleRegistry_exports.registerMany(AllCommunityModules);var debug3=Debug.create(!0,"opts"),AgCharts=class{static licenseCheck(t){this.licenseChecked||(this.licenseManager=enterpriseModule.licenseManager?.(t),this.licenseManager?.validateLicense(),this.licenseChecked=!0)}static getLicenseDetails(t){return enterpriseModule.licenseManager?.({}).getLicenseDetails(t)}static getInstance(t){return AgChartsInternal.getInstance(t)}static create(t,e){return debug3.group("AgCharts.create()",()=>{t=Debug.inDevelopmentMode(()=>deepFreeze(deepClone(t)))??t,this.licenseCheck(t);const i=AgChartsInternal.createOrUpdate({userOptions:t,licenseManager:this.licenseManager,optionsMetadata:e});return this.licenseManager?.isDisplayWatermark()&&this.licenseManager&&enterpriseModule.injectWatermark?.(i.chart.ctx.domManager,this.licenseManager.getWatermarkMessage()),i})}static createFinancialChart(t){return debug3.group("AgCharts.createFinancialChart()",()=>this.create(t,{presetType:"price-volume"}))}static createGauge(t){return debug3.group("AgCharts.createGauge()",()=>this.create(t,{presetType:"gauge"}))}static __createSparkline(t){return debug3.group("AgCharts.__createSparkline()",()=>{const{pool:e,...i}=t;return this.create(i,{presetType:"sparkline",pool:e??!0,domMode:"minimal"})})}};AgCharts.licenseChecked=!1;var _AgChartsInternal=class Mt{static getInstance(e){const i=Chart.getInstance(e);return i?AgChartInstanceProxy.chartInstances.get(i):void 0}static initialiseModules(){Mt.initialised||(registerInbuiltModules(),setupModules(),Mt.initialised=!0)}static createOrUpdate(e){let{proxy:i}=e;const{userOptions:s,licenseManager:n,processedOverrides:o=i?.chart?.chartOptions.processedOverrides??{},specialOverrides:a=i?.chart?.chartOptions.specialOverrides??{},optionsMetadata:r=i?.chart?.chartOptions.optionMetadata??{},deltaOptions:l,stripSymbols:c=!1}=e,h=enterpriseModule.styles!=null?[["ag-charts-enterprise",enterpriseModule.styles]]:[],{presetType:d}=r;Mt.initialiseModules(),debug3(()=>[">>> AgCharts.createOrUpdate() user options",deepClone(s)]);let u=s;AgCharts.optionsMutationFn&&u&&(u=AgCharts.optionsMutationFn(deepClone(u),d),debug3(()=>[">>> AgCharts.createOrUpdate() MUTATED user options",deepClone(u)]));const p=this.getPool(r);let g=!1,f,m=i?.chart;m==null&&p?.hasFree()&&(f=p.obtainFree(),m=f.item);const{document:y,window:x,styleContainer:b,...S}=u??{},v=m?.getChartOptions(),I=new ChartOptions(v,S,o,{...a,document:y,window:x,styleContainer:b},r,l,c);return(m==null||moduleRegistry_exports.detectChartDefinition(I.processedOptions)!==moduleRegistry_exports.detectChartDefinition(m.chartOptions.processedOptions))&&(f?.release(),f=this.getPool(I.optionMetadata)?.obtain(I),f?m=f.item:(g=!0,m=Mt.createChartInstance(I,m))),h.forEach(([A,D])=>{m.ctx.domManager.addStyles(A,D)}),i==null?(i=new AgChartInstanceProxy(m,Mt.callbackApi,n),i.releaseChart=f?.release):(f||g)&&(i.releaseChart?.(),i.chart=m,i.releaseChart=f?.release),debug3.check()&&typeof window<"u"&&(window.agChartInstances??(window.agChartInstances={}),window.agChartInstances[m.id]=m),m.queuedUserOptions.push(I.userOptions),m.queuedChartOptions.push(I),m.requestFactoryUpdate(A=>{debug3.group(">>>> Chart.applyOptions()",()=>{A.applyOptions(I);const D=A.queuedUserOptions.indexOf(I.userOptions)+1;A.queuedUserOptions.splice(0,D),A.queuedChartOptions.splice(0,D)})}),i}static markRemovedProperties(e,i,s=!1){if(typeof e!="object")return s;for(const n of Object.keys(e))typeof e[n]>"u"&&(Object.assign(e,{[n]:Symbol("UNSET")}),s||(s=!0));return s}static updateUserDelta(e,i){i=deepClone(i,ChartOptions.OPTIONS_CLONE_OPTS);const s=jsonWalk(i,Mt.markRemovedProperties,new Set(["data"]),void 0,void 0,!1);debug3(()=>[">>> AgCharts.updateUserDelta() user delta",deepClone(i)]),Mt.createOrUpdate({proxy:e,deltaOptions:i,stripSymbols:s})}static createChartInstance(e,i){const s=i?.destroy({keepTransferableResources:!0});return moduleRegistry_exports.detectChartDefinition(e.processedOptions).create(e,s)}static getPool(e){if(e.pool===!0)return Pool.getPool(e.presetType??"default",this.createChartInstance,this.detachAndClear,this.destroy,1/0)}};_AgChartsInternal.caretaker=new MementoCaretaker(VERSION),_AgChartsInternal.initialised=!1,_AgChartsInternal.callbackApi={caretaker:_AgChartsInternal.caretaker,create(t,e,i,s){return _AgChartsInternal.createOrUpdate({userOptions:t,processedOverrides:e,specialOverrides:i,optionsMetadata:s})},update(t,e){return _AgChartsInternal.createOrUpdate({userOptions:t,proxy:e})},updateUserDelta(t,e){return _AgChartsInternal.updateUserDelta(t,e)}},_AgChartsInternal.detachAndClear=t=>t.detachAndClear(),_AgChartsInternal.destroy=t=>t.destroy();var AgChartsInternal=_AgChartsInternal,integrated_charts_scene_exports={};__export3(integrated_charts_scene_exports,{Arc:()=>Arc2,BBox:()=>BBox,Caption:()=>Caption,CategoryScale:()=>CategoryScale,Group:()=>Group,Line:()=>Line,LinearScale:()=>LinearScale,Marker:()=>Marker,Path:()=>Path,RadialColumnShape:()=>RadialColumnShape,Rect:()=>Rect,Scene:()=>Scene,Sector:()=>Sector,Shape:()=>Shape,TranslatableGroup:()=>TranslatableGroup,getRadialColumnWidth:()=>getRadialColumnWidth,toRadians:()=>toRadians});var Arc2=class extends Path{constructor(){super(),this.centerX=0,this.centerY=0,this.radius=10,this.startAngle=0,this.endAngle=Math.PI*2,this.counterClockwise=!1,this.type=0,this.restoreOwnStyles()}get fullPie(){return isNumberEqual(normalizeAngle360(this.startAngle),normalizeAngle360(this.endAngle))}updatePath(){const t=this.path;t.clear(),t.arc(this.centerX,this.centerY,this.radius,this.startAngle,this.endAngle,this.counterClockwise),this.type===1?t.closePath():this.type===2&&!this.fullPie&&(t.lineTo(this.centerX,this.centerY),t.closePath())}computeBBox(){return new BBox(this.centerX-this.radius,this.centerY-this.radius,this.radius*2,this.radius*2)}isPointInPath(t,e){const i=this.getBBox();return this.type!==0&&i.containsPoint(t,e)&&this.path.isPointInPath(t,e)}};Arc2.className="Arc",__decorateClass2([ScenePathChangeDetection()],Arc2.prototype,"centerX",2),__decorateClass2([ScenePathChangeDetection()],Arc2.prototype,"centerY",2),__decorateClass2([ScenePathChangeDetection()],Arc2.prototype,"radius",2),__decorateClass2([ScenePathChangeDetection()],Arc2.prototype,"startAngle",2),__decorateClass2([ScenePathChangeDetection()],Arc2.prototype,"endAngle",2),__decorateClass2([ScenePathChangeDetection()],Arc2.prototype,"counterClockwise",2),__decorateClass2([ScenePathChangeDetection()],Arc2.prototype,"type",2);function rotatePoint(t,e,i){const s=Math.sqrt(t**2+e**2),o=Math.atan2(e,t)+i;return{x:Math.cos(o)*s,y:Math.sin(o)*s}}var RadialColumnShape=class extends Path{constructor(){super(...arguments),this.isBeveled=!0,this.columnWidth=0,this.startAngle=0,this.endAngle=0,this.outerRadius=0,this.innerRadius=0,this.axisInnerRadius=0,this.axisOuterRadius=0,this.isRadiusAxisReversed=!1}set cornerRadius(t){}computeBBox(){const{innerRadius:t,outerRadius:e,columnWidth:i}=this,s=this.getRotation(),n=-i/2,o=i/2,a=-e,r=-t;let l=1/0,c=1/0,h=-1/0,d=-1/0;for(let u=0;u<4;u+=1){const{x:p,y:g}=rotatePoint(u%2===0?n:o,u<2?a:r,s);l=Math.min(p,l),c=Math.min(g,c),h=Math.max(p,h),d=Math.max(g,d)}return new BBox(l,c,h-l,d-c)}getRotation(){const{startAngle:t,endAngle:e}=this,i=angleBetween(t,e);return normalizeAngle360(t+i/2+Math.PI/2)}updatePath(){const{isBeveled:t}=this;t?this.updateBeveledPath():this.updateRectangularPath(),this.checkPathDirty()}updateRectangularPath(){const{columnWidth:t,innerRadius:e,outerRadius:i,path:s}=this,n=-t/2,o=t/2,a=-i,r=-e,l=this.getRotation(),c=[[n,r],[n,a],[o,a],[o,r]].map(([h,d])=>rotatePoint(h,d,l));s.clear(!0),s.moveTo(c[0].x,c[0].y),s.lineTo(c[1].x,c[1].y),s.lineTo(c[2].x,c[2].y),s.lineTo(c[3].x,c[3].y),s.closePath()}updateBeveledPath(){const{columnWidth:t,path:e,outerRadius:i,innerRadius:s,axisInnerRadius:n,axisOuterRadius:o,isRadiusAxisReversed:a}=this,r=isNumberEqual(s,n),l=Math.asin(t/2/s),c=this.getRotation(),h=(D,T)=>rotatePoint(D,T,c),d=(D,T)=>Math.sqrt(D**2+T**2),u=(D,T)=>T>D?0:Math.sqrt(D**2-T**2),p=(D,T,k)=>k?D<T:D>T,g=r&&!isNaN(l)&&l<Math.PI/6;let f=-t/2,m=t/2;const y=-i,x=-s*(g?Math.cos(l):1),b=p(o,d(s,t/2),!a);if(b){const D=u(o,s);f=-D,m=D}e.clear(!0);const S=h(f,x);e.moveTo(S.x,S.y);const v=isNumberEqual(s,i),I=p(o,d(i,t/2),!a);if(v&&g)e.arc(0,0,s,normalizeAngle360(-l-Math.PI/2)+c,normalizeAngle360(l-Math.PI/2)+c,!1);else if(I){const D=-u(o,t/2),T=u(o,i);if(!b){const k=h(f,D);e.lineTo(k.x,k.y)}if(e.arc(0,0,o,Math.atan2(D,f)+c,Math.atan2(y,-T)+c,!1),!isNumberEqual(T,0)){const k=h(T,y);e.lineTo(k.x,k.y)}e.arc(0,0,o,Math.atan2(y,T)+c,Math.atan2(D,m)+c,!1)}else{const D=h(f,y),T=h(m,y);e.lineTo(D.x,D.y),e.lineTo(T.x,T.y)}const A=h(m,x);if(e.lineTo(A.x,A.y),g)e.arc(0,0,s,normalizeAngle360(l-Math.PI/2)+c,normalizeAngle360(-l-Math.PI/2)+c,!0);else{const D=h(f,x);e.lineTo(D.x,D.y)}e.closePath()}};RadialColumnShape.className="RadialColumnShape",__decorateClass2([ScenePathChangeDetection()],RadialColumnShape.prototype,"isBeveled",2),__decorateClass2([ScenePathChangeDetection()],RadialColumnShape.prototype,"columnWidth",2),__decorateClass2([ScenePathChangeDetection()],RadialColumnShape.prototype,"startAngle",2),__decorateClass2([ScenePathChangeDetection()],RadialColumnShape.prototype,"endAngle",2),__decorateClass2([ScenePathChangeDetection()],RadialColumnShape.prototype,"outerRadius",2),__decorateClass2([ScenePathChangeDetection()],RadialColumnShape.prototype,"innerRadius",2),__decorateClass2([ScenePathChangeDetection()],RadialColumnShape.prototype,"axisInnerRadius",2),__decorateClass2([ScenePathChangeDetection()],RadialColumnShape.prototype,"axisOuterRadius",2),__decorateClass2([ScenePathChangeDetection()],RadialColumnShape.prototype,"isRadiusAxisReversed",2);function getRadialColumnWidth(t,e,i,s,n){const o=angleBetween(t,e),a=o*(1-s)/2;if(t+=a,e-=a,o<.001)return 2*i*n;if(o>=2*Math.PI){const p=t+o/2;t=p-Math.PI,e=p+Math.PI}const r=i*Math.cos(t),l=i*Math.sin(t),c=i*Math.cos(e),h=i*Math.sin(e),d=Math.floor(Math.sqrt((r-c)**2+(l-h)**2)),u=2*i*n;return Math.max(1,Math.min(u,d))}var integrated_charts_theme_exports={};__export3(integrated_charts_theme_exports,{ChartTheme:()=>ChartTheme,DEFAULT_ANNOTATION_HANDLE_FILL:()=>DEFAULT_ANNOTATION_HANDLE_FILL,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>DEFAULT_ANNOTATION_STATISTICS_COLOR,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>DEFAULT_ANNOTATION_STATISTICS_FILL,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>DEFAULT_ANNOTATION_STATISTICS_STROKE,DEFAULT_CAPTION_ALIGNMENT:()=>DEFAULT_CAPTION_ALIGNMENT,DEFAULT_CAPTION_LAYOUT_STYLE:()=>DEFAULT_CAPTION_LAYOUT_STYLE,DEFAULT_FIBONACCI_STROKES:()=>DEFAULT_FIBONACCI_STROKES,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,DEFAULT_GRIDLINE_ENABLED:()=>DEFAULT_GRIDLINE_ENABLED,DEFAULT_POLAR_SERIES_STROKE:()=>DEFAULT_POLAR_SERIES_STROKE,DEFAULT_SEPARATION_LINES_COLOUR:()=>DEFAULT_SEPARATION_LINES_COLOUR,DEFAULT_SHADOW_COLOUR:()=>DEFAULT_SHADOW_COLOUR,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>DEFAULT_SPARKLINE_CROSSHAIR_STROKE,DEFAULT_TEXTBOX_COLOR:()=>DEFAULT_TEXTBOX_COLOR,DEFAULT_TEXTBOX_FILL:()=>DEFAULT_TEXTBOX_FILL,DEFAULT_TEXTBOX_STROKE:()=>DEFAULT_TEXTBOX_STROKE,DEFAULT_TEXT_ANNOTATION_COLOR:()=>DEFAULT_TEXT_ANNOTATION_COLOR,DEFAULT_TOOLBAR_POSITION:()=>DEFAULT_TOOLBAR_POSITION,IS_COMMUNITY:()=>IS_COMMUNITY,IS_DARK_THEME:()=>IS_DARK_THEME,IS_ENTERPRISE:()=>IS_ENTERPRISE,PALETTE_ALT_DOWN_FILL:()=>PALETTE_ALT_DOWN_FILL,PALETTE_ALT_DOWN_STROKE:()=>PALETTE_ALT_DOWN_STROKE,PALETTE_ALT_NEUTRAL_FILL:()=>PALETTE_ALT_NEUTRAL_FILL,PALETTE_ALT_NEUTRAL_STROKE:()=>PALETTE_ALT_NEUTRAL_STROKE,PALETTE_ALT_UP_FILL:()=>PALETTE_ALT_UP_FILL,PALETTE_ALT_UP_STROKE:()=>PALETTE_ALT_UP_STROKE,PALETTE_DOWN_FILL:()=>PALETTE_DOWN_FILL,PALETTE_DOWN_STROKE:()=>PALETTE_DOWN_STROKE,PALETTE_NEUTRAL_FILL:()=>PALETTE_NEUTRAL_FILL,PALETTE_NEUTRAL_STROKE:()=>PALETTE_NEUTRAL_STROKE,PALETTE_UP_FILL:()=>PALETTE_UP_FILL,PALETTE_UP_STROKE:()=>PALETTE_UP_STROKE,getChartTheme:()=>getChartTheme,resolveOperation:()=>resolveOperation2,themeNames:()=>themeNames,themeSymbols:()=>symbols_exports,themes:()=>themes});var themeNames=Object.keys(themes);function resolveOperation2(t){const e=ChartTheme.getDefaultPublicParameters();e.__palette=ChartTheme.getDefaultColors();const i={operation:t};return jsonResolveOperations(i,e),i.operation}var integrated_charts_util_exports={};__export3(integrated_charts_util_exports,{Color:()=>Color,interpolateColor:()=>interpolateColor});var module_support_exports={};__export3(module_support_exports,{AND:()=>AND,ARRAY:()=>ARRAY,ARRAY_OF:()=>ARRAY_OF,AbstractBarSeries:()=>AbstractBarSeries,AbstractBarSeriesProperties:()=>AbstractBarSeriesProperties,ActionOnSet:()=>ActionOnSet,AnchoredPopover:()=>AnchoredPopover,Animation:()=>Animation,AnimationManager:()=>AnimationManager,Arc:()=>Arc2,Axis:()=>Axis,AxisGroupZIndexMap:()=>AxisGroupZIndexMap,AxisInterval:()=>AxisInterval,AxisLabel:()=>AxisLabel,AxisTick:()=>AxisTick,AxisTickGenerator:()=>AxisTickGenerator,AxisTicks:()=>AxisTicks,BBox:()=>BBox,BBoxValues:()=>BBoxValues,BOOLEAN:()=>BOOLEAN,BOOLEAN_ARRAY:()=>BOOLEAN_ARRAY,Background:()=>Background,BackgroundModule:()=>BackgroundModule,BandScale:()=>BandScale,BarSeries:()=>BarSeries,BarSeriesModule:()=>BarSeriesModule,BaseModuleInstance:()=>BaseModuleInstance,BaseProperties:()=>BaseProperties,BaseToolbar:()=>BaseToolbar,ButtonWidget:()=>ButtonWidget,COLOR_GRADIENT:()=>COLOR_GRADIENT,COLOR_PATTERN:()=>COLOR_PATTERN,COLOR_STRING:()=>COLOR_STRING,COLOR_STRING_ARRAY:()=>COLOR_STRING_ARRAY,CachedTextMeasurer:()=>CachedTextMeasurer,CachedTextMeasurerPool:()=>CachedTextMeasurerPool,Caption:()=>Caption,CartesianAxis:()=>CartesianAxis,CartesianSeries:()=>CartesianSeries,CartesianSeriesNodeEvent:()=>CartesianSeriesNodeEvent,CartesianSeriesProperties:()=>CartesianSeriesProperties,CategoryAxis:()=>CategoryAxis,CategoryScale:()=>CategoryScale,ChangeDetectableProperties:()=>ChangeDetectableProperties,Chart:()=>Chart,ChartAxisDirection:()=>ChartAxisDirection,ChartEventManager:()=>ChartEventManager,ChartOptions:()=>ChartOptions,ChartUpdateType:()=>ChartUpdateType,CollapseMode:()=>CollapseMode,Color:()=>Color,ColorScale:()=>ColorScale,ConicGradient:()=>ConicGradient,ContextMenuRegistry:()=>ContextMenuRegistry,ContinuousScale:()=>ContinuousScale,DATE:()=>DATE,DATE_ARRAY:()=>DATE_ARRAY,DATE_OR_DATETIME_MS:()=>DATE_OR_DATETIME_MS,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>DEFAULT_CARTESIAN_DIRECTION_KEYS,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>DEFAULT_CARTESIAN_DIRECTION_NAMES,DEFAULT_TOOLTIP_CLASS:()=>DEFAULT_TOOLTIP_CLASS,DEFAULT_TOOLTIP_DARK_CLASS:()=>DEFAULT_TOOLTIP_DARK_CLASS,DIRECTION:()=>DIRECTION,DIRECTION_SWAP_AXES:()=>DIRECTION_SWAP_AXES,DOMManager:()=>DOMManager,DataController:()=>DataController,DataModel:()=>DataModel,DataModelSeries:()=>DataModelSeries,DataService:()=>DataService,Debug:()=>Debug,Deprecated:()=>Deprecated,DeprecatedAndRenamedTo:()=>DeprecatedAndRenamedTo,DragInterpreter:()=>DragInterpreter,DraggablePopover:()=>DraggablePopover,DropShadow:()=>DropShadow,ExtendedPath2D:()=>ExtendedPath2D,FILL_PATTERN_DEFAULTS:()=>FILL_PATTERN_DEFAULTS,FONT_SIZE_RATIO:()=>FONT_SIZE_RATIO,FONT_STYLE:()=>FONT_STYLE,FONT_WEIGHT:()=>FONT_WEIGHT,FUNCTION:()=>FUNCTION,FillGradientDefaults:()=>FillGradientDefaults,FillPatternDefaults:()=>FillPatternDefaults,FloatingToolbar:()=>FloatingToolbar,GREATER_THAN:()=>GREATER_THAN,Gradient:()=>Gradient,Group:()=>Group,GroupedCategoryAxis:()=>GroupedCategoryAxis,HdpiCanvas:()=>HdpiCanvas,HierarchyNode:()=>HierarchyNode,HierarchySeries:()=>HierarchySeries,HierarchySeriesProperties:()=>HierarchySeriesProperties,HighlightManager:()=>HighlightManager,HighlightProperties:()=>HighlightProperties,HighlightStyle:()=>HighlightStyle,INTERACTION_RANGE:()=>INTERACTION_RANGE,INTERPOLATION_STEP_POSITION:()=>INTERPOLATION_STEP_POSITION,INTERPOLATION_TYPE:()=>INTERPOLATION_TYPE,Image:()=>Image,InteractionManager:()=>InteractionManager,InteractionState:()=>InteractionState,InterpolationProperties:()=>InterpolationProperties,Invalidating:()=>Invalidating,LABEL_PLACEMENT:()=>LABEL_PLACEMENT,LARGEST_KEY_INTERVAL:()=>LARGEST_KEY_INTERVAL,LESS_THAN:()=>LESS_THAN,LINE_CAP:()=>LINE_CAP,LINE_DASH:()=>LINE_DASH,LINE_JOIN:()=>LINE_JOIN,LINE_STYLE:()=>LINE_STYLE,Label:()=>Label,LayoutElement:()=>LayoutElement,LayoutManager:()=>LayoutManager,LegendMarkerLabel:()=>LegendMarkerLabel,Line:()=>Line,LineSeries:()=>LineSeries,LineSeriesModule:()=>LineSeriesModule,LinearGradient:()=>LinearGradient,LinearScale:()=>LinearScale,Listeners:()=>Listeners,LogScale:()=>LogScale,LonLatBBox:()=>LonLatBBox,MARKER_SHAPE:()=>MARKER_SHAPE,MATCHING_CROSSLINE_TYPE:()=>MATCHING_CROSSLINE_TYPE,MAX_SPACING:()=>MAX_SPACING,MIN_SPACING:()=>MIN_SPACING,Marker:()=>Marker,Menu:()=>Menu,MercatorScale:()=>MercatorScale,ModuleRegistry:()=>moduleRegistry_exports,Motion:()=>easing_exports,NAN:()=>NAN,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>NODE_UPDATE_STATE_TO_PHASE_MAPPING,NUMBER:()=>NUMBER,NUMBER_ARRAY:()=>NUMBER_ARRAY,NUMBER_OR_NAN:()=>NUMBER_OR_NAN,NativeWidget:()=>NativeWidget,NewAreaSeriesModule:()=>NewAreaSeriesModule,NewBarSeriesModule:()=>NewBarSeriesModule,NewBubbleSeriesModule:()=>NewBubbleSeriesModule,NewHistogramSeriesModule:()=>NewHistogramSeriesModule,NewLineSeriesModule:()=>NewLineSeriesModule,NewScatterSeriesModule:()=>NewScatterSeriesModule,NiceMode:()=>NiceMode,Node:()=>Node,NumberAxis:()=>NumberAxis,OBJECT:()=>OBJECT,OBJECT_ARRAY:()=>OBJECT_ARRAY,OR:()=>OR,OVERFLOW_STRATEGY:()=>OVERFLOW_STRATEGY,ObserveChanges:()=>ObserveChanges,OrdinalTimeScale:()=>OrdinalTimeScale,PHASE_METADATA:()=>PHASE_METADATA,PHASE_ORDER:()=>PHASE_ORDER,PLACEMENT:()=>PLACEMENT,PLAIN_OBJECT:()=>PLAIN_OBJECT,POSITION:()=>POSITION,POSITION_TOP_COORDINATES:()=>POSITION_TOP_COORDINATES,POSITIVE_NUMBER:()=>POSITIVE_NUMBER,PREV_NEXT_KEYS:()=>PREV_NEXT_KEYS,Padding:()=>Padding,ParallelStateMachine:()=>ParallelStateMachine,Path:()=>Path,PointerEvents:()=>PointerEvents,PolarAxis:()=>PolarAxis,PolarSeries:()=>PolarSeries,PolarZIndexMap:()=>PolarZIndexMap,Popover:()=>Popover,PropertiesArray:()=>PropertiesArray,ProxyInteractionService:()=>ProxyInteractionService,ProxyOnWrite:()=>ProxyOnWrite,ProxyProperty:()=>ProxyProperty,ProxyPropertyOnWrite:()=>ProxyPropertyOnWrite,QUICK_TRANSITION:()=>QUICK_TRANSITION,RATIO:()=>RATIO,REAL_NUMBER:()=>REAL_NUMBER,RENDER_TO_OFFSCREEN_CANVAS_THRESHOLD:()=>RENDER_TO_OFFSCREEN_CANVAS_THRESHOLD,RadialColumnShape:()=>RadialColumnShape,Range:()=>Range,Rect:()=>Rect,RepeatType:()=>RepeatType,Rotatable:()=>Rotatable,RotatableGroup:()=>RotatableGroup,RotatableText:()=>RotatableText,SAFE_FILLS_OPERATION:()=>SAFE_FILLS_OPERATION,SAFE_FILL_OPERATION:()=>SAFE_FILL_OPERATION,SAFE_RANGE2_OPERATION:()=>SAFE_RANGE2_OPERATION,SAFE_STROKE_FILL_OPERATION:()=>SAFE_STROKE_FILL_OPERATION,SKIP_JS_BUILTINS:()=>SKIP_JS_BUILTINS,SMALLEST_KEY_INTERVAL:()=>SMALLEST_KEY_INTERVAL,SORT_DOMAIN_GROUPS:()=>SORT_DOMAIN_GROUPS,STRING:()=>STRING,STRING_ARRAY:()=>STRING_ARRAY,Scalable:()=>Scalable,ScalableGroup:()=>ScalableGroup,Scene:()=>Scene,SceneChangeDetection:()=>SceneChangeDetection,ScenePathChangeDetection:()=>ScenePathChangeDetection,Sector:()=>Sector,SectorBox:()=>SectorBox,Selection:()=>Selection,Series:()=>Series,SeriesContentZIndexMap:()=>SeriesContentZIndexMap,SeriesGroupingChangedEvent:()=>SeriesGroupingChangedEvent,SeriesItemHighlightStyle:()=>SeriesItemHighlightStyle,SeriesMarker:()=>SeriesMarker,SeriesNodeEvent:()=>SeriesNodeEvent,SeriesNodePickMode:()=>SeriesNodePickMode,SeriesProperties:()=>SeriesProperties,SeriesTooltip:()=>SeriesTooltip,SeriesZIndexMap:()=>SeriesZIndexMap,Shape:()=>Shape,SimpleTextMeasurer:()=>SimpleTextMeasurer,SliderWidget:()=>SliderWidget,StateMachine:()=>StateMachine,StateMachineProperty:()=>StateMachineProperty,StopProperties:()=>StopProperties,SvgPath:()=>SvgPath,TEXT_ALIGN:()=>TEXT_ALIGN,TEXT_WRAP:()=>TEXT_WRAP,TICK_INTERVAL:()=>TICK_INTERVAL,TempValidate:()=>TempValidate,Text:()=>Text,TextUtils:()=>TextUtils,TextWrapper:()=>TextWrapper,ThemeConstants:()=>constants_exports,ThemeSymbols:()=>symbols_exports,TimeScale:()=>TimeScale,Toolbar:()=>Toolbar,ToolbarButtonProperties:()=>ToolbarButtonProperties,ToolbarButtonWidget:()=>ToolbarButtonWidget,ToolbarWidget:()=>ToolbarWidget,Tooltip:()=>Tooltip,TooltipManager:()=>TooltipManager,TooltipPosition:()=>TooltipPosition,Transformable:()=>Transformable,TransformableText:()=>TransformableText,Translatable:()=>Translatable,TranslatableGroup:()=>TranslatableGroup,TranslatableLine:()=>TranslatableLine,UNION:()=>UNION,UpdateService:()=>UpdateService,VERTICAL_ALIGN:()=>VERTICAL_ALIGN,Validate:()=>Validate,Vec2:()=>Vec2,Vec4:()=>Vec4,WIDGET_HTML_EVENTS:()=>WIDGET_HTML_EVENTS,Widget:()=>Widget,WidgetEventUtil:()=>WidgetEventUtil,ZIndexMap:()=>ZIndexMap,ZoomManager:()=>ZoomManager,accumulateGroup:()=>accumulateGroup,accumulateStack:()=>accumulateStack,accumulatedValue:()=>accumulatedValue,accumulativeValueProperty:()=>accumulativeValueProperty,addHitTestersToQuadtree:()=>addHitTestersToQuadtree,adjustLabelPlacement:()=>adjustLabelPlacement,angleBetween:()=>angleBetween,animationValidation:()=>animationValidation,applyShapeFillBBox:()=>applyShapeFillBBox,applyShapeStyle:()=>applyShapeStyle,areScalingEqual:()=>areScalingEqual,area:()=>area,autoSizedLabelOptionsDefs:()=>autoSizedLabelOptionsDefs,buildFormatter:()=>buildFormatter,buildResetPathFn:()=>buildResetPathFn,calculateDefaultTimeTickFormat:()=>calculateDefaultTimeTickFormat,calculateDerivativeExtrema:()=>calculateDerivativeExtrema,calculateDerivativeExtremaXY:()=>calculateDerivativeExtremaXY,calculateLabelChartPadding:()=>calculateLabelChartPadding,calculateLabelTranslation:()=>calculateLabelTranslation,calculatePlacement:()=>calculatePlacement,cartesianAxisCrosshairOptions:()=>cartesianAxisCrosshairOptions,cartesianAxisLabelOptionsDefs:()=>cartesianAxisLabelOptionsDefs,cartesianAxisOptionsDefs:()=>cartesianAxisOptionsDefs,cartesianChartOptionsDefs:()=>cartesianChartOptionsDefs,cartesianCrossLineOptionsDefs:()=>cartesianCrossLineOptionsDefs,checkCrisp:()=>checkCrisp,clampArray:()=>clampArray,clippedRoundRect:()=>clippedRoundRect,collapsedStartingBarPosition:()=>collapsedStartingBarPosition,commonAxisLabelOptionsDefs:()=>commonAxisLabelOptionsDefs,commonAxisOptionsDefs:()=>commonAxisOptionsDefs,commonChartOptionsDefs:()=>commonChartOptionsDefs,commonCrossLineLabelOptionsDefs:()=>commonCrossLineLabelOptionsDefs,commonCrossLineOptionsDefs:()=>commonCrossLineOptionsDefs,commonSeriesOptionsDefs:()=>commonSeriesOptionsDefs,compareDates:()=>compareDates,computeBarFocusBounds:()=>computeBarFocusBounds,computeMarkerFocusBounds:()=>computeMarkerFocusBounds,continuousAxisOptions:()=>continuousAxisOptions,countExpandingSearch:()=>countExpandingSearch,createButton:()=>createButton,createCheckbox:()=>createCheckbox,createDatumId:()=>createDatumId,createDeprecationWarning:()=>createDeprecationWarning,createElementId:()=>createElementId,createIcon:()=>createIcon,createId:()=>createId,createSelect:()=>createSelect,createTextArea:()=>createTextArea,dateToNumber:()=>dateToNumber,datesSortOrder:()=>datesSortOrder,datumKeys:()=>datumKeys,datumStylerProperties:()=>datumStylerProperties,deconstructSelectionsOrNodes:()=>deconstructSelectionsOrNodes,deepClone:()=>deepClone,deepFreeze:()=>deepFreeze,defaultTimeTickFormat:()=>defaultTimeTickFormat,diff:()=>diff,drawCorner:()=>drawCorner,drawMarkerUnitPolygon:()=>drawMarkerUnitPolygon,easing:()=>easing_exports,enterpriseModule:()=>enterpriseModule,errorBarOptionsDefs:()=>errorBarOptionsDefs,evaluateBezier:()=>evaluateBezier,extent:()=>extent,extractDecoratedProperties:()=>extractDecoratedProperties,findMinMax:()=>findMinMax,findQuadtreeMatch:()=>findQuadtreeMatch,findRangeExtent:()=>findRangeExtent,fixNumericExtent:()=>fixNumericExtent,flowProportionChartOptionsDefs:()=>flowProportionChartOptionsDefs,focusCursorAtEnd:()=>focusCursorAtEnd,formatNumber:()=>formatNumber,formatPercent:()=>formatPercent,formatValue:()=>formatValue,fromToMotion:()=>fromToMotion,gaugeChartOptionsDefs:()=>gaugeChartOptionsDefs,generateUUID:()=>generateUUID,getAngleRatioRadians:()=>getAngleRatioRadians,getColorStops:()=>getColorStops,getCrossLineValue:()=>getCrossLineValue,getDateTicksForInterval:()=>getDateTicksForInterval,getDatumRefPoint:()=>getDatumRefPoint,getElementBBox:()=>getElementBBox,getIconClassNames:()=>getIconClassNames,getLastFocus:()=>getLastFocus,getMissCount:()=>getMissCount,getPath:()=>getPath,getPathComponents:()=>getPathComponents,getRadialColumnWidth:()=>getRadialColumnWidth,getSequentialColors:()=>getSequentialColors,getShapeFill:()=>getShapeFill,getShapeStyle:()=>getShapeStyle,groupAccumulativeValueProperty:()=>groupAccumulativeValueProperty,groupAverage:()=>groupAverage,groupCount:()=>groupCount,groupStackValueProperty:()=>groupStackValueProperty,groupSum:()=>groupSum,hasNoModifiers:()=>hasNoModifiers,hierarchyChartOptionsDefs:()=>hierarchyChartOptionsDefs,initMenuKeyNav:()=>initMenuKeyNav,initRovingTabIndex:()=>initRovingTabIndex,interpolatePoints:()=>interpolatePoints,interpolationValidator:()=>interpolationValidator,isAgFlowProportionChartOptions:()=>isAgFlowProportionChartOptions,isAgGaugeChartOptions:()=>isAgGaugeChartOptions,isAgHierarchyChartOptions:()=>isAgHierarchyChartOptions,isAgStandaloneChartOptions:()=>isAgStandaloneChartOptions,isAgTopologyChartOptions:()=>isAgTopologyChartOptions,isBetweenAngles:()=>isBetweenAngles,isButtonClickEvent:()=>isButtonClickEvent,isContinuous:()=>isContinuous,isDecoratedObject:()=>isDecoratedObject,isDenseInterval:()=>isDenseInterval,isGradientFill:()=>isGradientFill,isGradientOrPatternFill:()=>isGradientOrPatternFill,isInputPending:()=>isInputPending,isPatternFill:()=>isPatternFill,isProperties:()=>isProperties,isScaleValid:()=>isScaleValid,jsonApply:()=>jsonApply,jsonDiff:()=>jsonDiff,jsonPropertyCompare:()=>jsonPropertyCompare,jsonResolveOperations:()=>jsonResolveOperations,jsonWalk:()=>jsonWalk,keyProperty:()=>keyProperty,labelDirectionHandling:()=>labelDirectionHandling,legendSymbolSvg:()=>legendSymbolSvg,lineDistanceSquared:()=>lineDistanceSquared,listDecoratedProperties:()=>listDecoratedProperties,makeAccessibleClickListener:()=>makeAccessibleClickListener,mapValues:()=>mapValues,markerFadeInAnimation:()=>markerFadeInAnimation,markerOptionsDefs:()=>markerOptionsDefs,markerScaleInAnimation:()=>markerScaleInAnimation,markerSwipeScaleInAnimation:()=>markerSwipeScaleInAnimation,merge:()=>merge,mergeArrayDefaults:()=>mergeArrayDefaults,mergeDefaults:()=>mergeDefaults,midpointStartingBarPosition:()=>midpointStartingBarPosition,moduleRegistry:()=>moduleRegistry,motion:()=>motion,nearestSquared:()=>nearestSquared,nearestSquaredInContainer:()=>nearestSquaredInContainer,normaliseGroupTo:()=>normaliseGroupTo,normalisePropertyTo:()=>normalisePropertyTo,normalisedExtentWithMetadata:()=>normalisedExtentWithMetadata,normalizeAngle180:()=>normalizeAngle180,normalizeAngle360:()=>normalizeAngle360,normalizeAngle360Inclusive:()=>normalizeAngle360Inclusive,numberFormatValidator:()=>numberFormatValidator,objectsEqual:()=>objectsEqual,objectsEqualWith:()=>objectsEqualWith,pairUpSpans:()=>pairUpSpans,partialAssign:()=>partialAssign,pathFadeInAnimation:()=>pathFadeInAnimation,pathMotion:()=>pathMotion,pathSwipeInAnimation:()=>pathSwipeInAnimation,pickByMatchingAngle:()=>pickByMatchingAngle,plotAreaPathFill:()=>plotAreaPathFill,plotInterpolatedAreaSeriesFillSpans:()=>plotInterpolatedAreaSeriesFillSpans,plotInterpolatedLinePathStroke:()=>plotInterpolatedLinePathStroke,plotLinePathStroke:()=>plotLinePathStroke,polarChartOptionsDefs:()=>polarChartOptionsDefs,predicateWithMessage:()=>predicateWithMessage,prepareAreaFillAnimationFns:()=>prepareAreaFillAnimationFns,prepareAreaPathAnimation:()=>prepareAreaPathAnimation,prepareAxisAnimationContext:()=>prepareAxisAnimationContext,prepareAxisAnimationFunctions:()=>prepareAxisAnimationFunctions,prepareBarAnimationFunctions:()=>prepareBarAnimationFunctions,prepareLinePathAnimation:()=>prepareLinePathAnimation,prepareLinePathPropertyAnimation:()=>prepareLinePathPropertyAnimation,prepareLinePathStrokeAnimationFns:()=>prepareLinePathStrokeAnimationFns,preparePieSeriesAnimationFunctions:()=>preparePieSeriesAnimationFunctions,range:()=>range,rangedValueProperty:()=>rangedValueProperty,resetAxisGroupFn:()=>resetAxisGroupFn,resetAxisLabelSelectionFn:()=>resetAxisLabelSelectionFn,resetAxisLineSelectionFn:()=>resetAxisLineSelectionFn,resetAxisSelectionFn:()=>resetAxisSelectionFn,resetBarSelectionsFn:()=>resetBarSelectionsFn,resetIds:()=>resetIds,resetLabelFn:()=>resetLabelFn,resetMarkerFn:()=>resetMarkerFn,resetMarkerPositionFn:()=>resetMarkerPositionFn,resetMotion:()=>resetMotion,resetPieSelectionsFn:()=>resetPieSelectionsFn,rowCountProperty:()=>rowCountProperty,scale:()=>scale,sectorBox:()=>sectorBox,seriesLabelFadeInAnimation:()=>seriesLabelFadeInAnimation,seriesLabelFadeOutAnimation:()=>seriesLabelFadeOutAnimation,seriesLabelOptionsDefs:()=>seriesLabelOptionsDefs,setAttribute:()=>setAttribute,setAttributes:()=>setAttributes,setElementBBox:()=>setElementBBox,setElementStyle:()=>setElementStyle,setPath:()=>setPath,shadowOptionsDefs:()=>shadowOptionsDefs,shallowClone:()=>shallowClone,solveBezier:()=>solveBezier,sortAndUniqueDates:()=>sortAndUniqueDates,splitBezier:()=>splitBezier,standaloneChartOptionsDefs:()=>standaloneChartOptionsDefs,staticFromToMotion:()=>staticFromToMotion,stopPageScrolling:()=>stopPageScrolling,sum:()=>sum,sumValues:()=>sumValues,toDegrees:()=>toDegrees,toRadians:()=>toRadians,toolbarButtonOptionsDefs:()=>toolbarButtonOptionsDefs,tooltipContentAriaLabel:()=>tooltipContentAriaLabel,tooltipHtml:()=>tooltipHtml,tooltipOptionsDefs:()=>tooltipOptionsDefs,topologyChartOptionsDefs:()=>topologyChartOptionsDefs,trailingAccumulatedValue:()=>trailingAccumulatedValue,trailingAccumulatedValueProperty:()=>trailingAccumulatedValueProperty,updateClipPath:()=>updateClipPath,updateLabelNode:()=>updateLabelNode,validateCrossLineValue:()=>validateCrossLineValue,valueProperty:()=>valueProperty,visibleRangeIndices:()=>visibleRangeIndices,without:()=>without});var Vec2={add,angle,apply,equal,distance,distanceSquared,from:from2,gradient,intercept,intersectAtX,intersectAtY,length,lengthSquared,multiply,normalized,origin:origin2,required:required11,rotate,round:round3,sub};function add(t,e){return typeof e=="number"?{x:t.x+e,y:t.y+e}:{x:t.x+e.x,y:t.y+e.y}}function sub(t,e){return typeof e=="number"?{x:t.x-e,y:t.y-e}:{x:t.x-e.x,y:t.y-e.y}}function multiply(t,e){return typeof e=="number"?{x:t.x*e,y:t.y*e}:{x:t.x*e.x,y:t.y*e.y}}function length(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function lengthSquared(t){return t.x*t.x+t.y*t.y}function distance(t,e){const i=sub(t,e);return Math.sqrt(i.x*i.x+i.y*i.y)}function distanceSquared(t,e){const i=sub(t,e);return i.x*i.x+i.y*i.y}function normalized(t){const e=length(t);return{x:t.x/e,y:t.y/e}}function angle(t,e){return e==null?Math.atan2(t.y,t.x):Math.atan2(t.y,t.x)-Math.atan2(e.y,e.x)}function rotate(t,e,i=origin2()){const s=length(t);return{x:i.x+s*Math.cos(e),y:i.y+s*Math.sin(e)}}function gradient(t,e,i){const s=e.x-t.x;return(i==null?e.y-t.y:i-e.y-(i-t.y))/s}function intercept(t,e,i){return(i==null?t.y:i-t.y)-e*t.x}function intersectAtY(t,e,i=0,s){return{x:t===1/0?1/0:(i-e)/t,y:s==null?i:s-i}}function intersectAtX(t,e,i=0,s){const n=t===1/0?1/0:t*i+e;return{x:i,y:s==null?n:s-n}}function round3(t,e=2){return{x:roundTo(t.x,e),y:roundTo(t.y,e)}}function equal(t,e){return t.x===e.x&&t.y===e.y}function from2(t,e){if(typeof t=="number")return{x:t,y:e};if("currentX"in t)return{x:t.currentX,y:t.currentY};if("offsetWidth"in t)return{x:t.offsetWidth,y:t.offsetHeight};if("width"in t)return[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y+t.height}];if("x1"in t)return[{x:t.x1,y:t.y1},{x:t.x2,y:t.y2}];throw new Error(`Values can not be converted into a vector: [${JSON.stringify(t)}] [${e}]`)}function apply(t,e){return t.x=e.x,t.y=e.y,t}function required11(t){return{x:t?.x??0,y:t?.y??0}}function origin2(){return{x:0,y:0}}var _HierarchyNode=class zt{constructor(e,i,s,n,o,a,r,l,c){this.series=e,this.datumIndex=i,this.datum=s,this.sizeValue=n,this.colorValue=o,this.sumSize=a,this.depth=r,this.parent=l,this.children=c,this.midPoint={x:0,y:0}}get hasChildren(){return this.children.length>0}walk(e,i=zt.Walk.PreOrder){i===zt.Walk.PreOrder&&e(this),this.children.forEach(s=>{s.walk(e,i)}),i===zt.Walk.PostOrder&&e(this)}*[Symbol.iterator](){yield this;for(const e of this.children)yield*e}};_HierarchyNode.Walk={PreOrder:0,PostOrder:1};var HierarchyNode=_HierarchyNode,HierarchySeries=class extends Series{constructor(t){super({moduleCtx:t,pickModes:[1,0]}),this.colorDomain=[0,0],this.maxDepth=0,this.colorScale=new ColorScale,this.animationState=new StateMachine("empty",{empty:{update:{target:"ready",action:e=>this.animateEmptyUpdateReady(e)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:e=>this.animateReadyHighlight(e),resize:e=>this.animateReadyResize(e),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:e=>this.animateWaitingUpdateReady(e)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:e=>this.animateClearingUpdateEmpty(e)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}processData(){const{NodeClass:t}=this,{childrenKey:e,sizeKey:i,colorKey:s,colorRange:n}=this.properties;let o=0,a=1/0,r=-1/0;const l=(u,p,g)=>{const f=g.depth!=null?g.depth+1:0,m=e!=null?u[e]:void 0,y=m==null||m.length===0;let x=i!=null?u[i]:void 0;Number.isFinite(x)?x=Math.max(x,0):x=y?1:0;const b=x;o=Math.max(o,f);const S=s!=null?u[s]:void 0;return typeof S=="number"&&(a=Math.min(a,S),r=Math.max(r,S)),c(new t(this,p,u,x,S,b,f,g,[]),m)},c=(u,p)=>{const{datumIndex:g}=u;return p?.forEach((f,m)=>{const y=l(f,g.concat(m),u);u.children.push(y),u.sumSize+=y.sumSize}),u},h=c(new t(this,[],void 0,0,void 0,0,void 0,void 0,[]),this.data),d=[a,r];this.colorScale.domain=a<r?[a,r]:[0,1],this.colorScale.range=n??["black"],this.colorScale.update(),this.rootNode=h,this.maxDepth=o,this.colorDomain=d}update({seriesRect:t}){this.updateSelections(),this.updateNodes();const e=this.getAnimationData();this.checkResize(t)&&this.animationState.transition("resize",e),this.animationState.transition("update",e)}resetAllAnimation(t){this.ctx.animationManager.stopByAnimationGroupId(this.id)}animateEmptyUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateWaitingUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateReadyHighlight(t){}animateReadyResize(t){this.resetAllAnimation(t)}animateClearingUpdateEmpty(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}getAnimationData(){return{}}isProcessedDataAnimatable(){return!0}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(t,e){return[NaN,NaN]}getLegendData(t){const{colorKey:e,colorName:i,colorRange:s}=this.properties,{id:n,ctx:{legendManager:o},visible:a}=this;return t==="gradient"&&e!=null&&s!=null?[{legendType:"gradient",enabled:a&&o.getItemEnabled({seriesId:n}),seriesId:n,colorName:i,colorRange:s,colorDomain:this.colorDomain}]:[]}getDatumIdFromData(t){return t.datumIndex.join(":")}getDatumId(t){return this.getDatumIdFromData(t)}removeMeIndexPathForIndex(t){return this.datumSelection.at(t+1)?.datum.datumIndex??[]}removeMeIndexForIndexPath(t){for(const{index:e,datum:i}of this.datumSelection)if(arraysEqual(i.datumIndex,t))return e-1;return 0}pickFocus(t){if(!this.rootNode?.children.length)return;const e=clamp(0,t.datumIndex-t.datumIndexDelta,this.datumSelection.length-1),{datumIndexDelta:i,otherIndexDelta:s}=t;let n=this.removeMeIndexPathForIndex(e);const o=n.reduce((l,c)=>l.children[c],this.rootNode);if(s>0&&o.hasChildren)n=[...n,0];else if(s<0&&n.length>1)n=n.slice(0,-1);else if(s===0&&i!==0){const l=o.parent.children.length-1;n=n.slice(),n[n.length-1]=clamp(0,n[n.length-1]+i,l)}const a=n.reduce((l,c)=>l.children[c],this.rootNode),r=this.computeFocusBounds(this.datumSelection.at(e+1));if(r!=null)return{datum:a,datumIndex:this.removeMeIndexForIndexPath(n),otherIndex:a.depth,bounds:r,clipFocusBox:!0}}getDatumAriaText(t,e){if(!(t instanceof this.NodeClass)){logger_exports.error(`datum is not HierarchyNode: ${JSON.stringify(t)}`);return}return this.ctx.localeManager.t("ariaAnnounceHierarchyDatum",{level:(t.depth??-1)+1,count:t.children.length,description:e})}getCategoryValue(t){}datumIndexForCategoryValue(t){}},HierarchySeriesProperties=class extends SeriesProperties{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(DEFAULT_FILLS),this.fillGradientDefaults=new FillGradientDefaults,this.fillPatternDefaults=new FillPatternDefaults,this.strokes=Object.values(DEFAULT_STROKES)}};__decorateClass2([TempValidate(STRING)],HierarchySeriesProperties.prototype,"childrenKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],HierarchySeriesProperties.prototype,"sizeKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],HierarchySeriesProperties.prototype,"colorKey",2),__decorateClass2([TempValidate(STRING,{optional:!0})],HierarchySeriesProperties.prototype,"colorName",2),__decorateClass2([TempValidate(ARRAY_OF(OR(COLOR_GRADIENT,COLOR_PATTERN,COLOR_STRING)))],HierarchySeriesProperties.prototype,"fills",2),__decorateClass2([TempValidate(OBJECT)],HierarchySeriesProperties.prototype,"fillGradientDefaults",2),__decorateClass2([TempValidate(OBJECT)],HierarchySeriesProperties.prototype,"fillPatternDefaults",2),__decorateClass2([TempValidate(COLOR_STRING_ARRAY)],HierarchySeriesProperties.prototype,"strokes",2),__decorateClass2([TempValidate(COLOR_STRING_ARRAY,{optional:!0})],HierarchySeriesProperties.prototype,"colorRange",2);var LonLatBBox=class{constructor(t,e,i,s){this.lon0=t,this.lat0=e,this.lon1=i,this.lat1=s}merge(t){this.lon0=Math.min(this.lon0,t.lon0),this.lat0=Math.min(this.lat0,t.lat0),this.lon1=Math.max(this.lon1,t.lon1),this.lat1=Math.max(this.lat1,t.lat1)}},radsInDeg=Math.PI/180,lonX=t=>t*radsInDeg,latY=t=>-Math.log(Math.tan(Math.PI*.25+t*radsInDeg*.5)),xLon=t=>t/radsInDeg,yLat=t=>(Math.atan(Math.exp(-t))-Math.PI*.25)/(radsInDeg*.5),MercatorScale=class Vt extends AbstractScale{constructor(e,i){super(),this.domain=e,this.range=i,this.type="mercator",this.bounds=Vt.bounds(e)}static bounds(e){const[[i,s],[n,o]]=e,a=lonX(i),r=latY(s),l=lonX(n),c=latY(o);return new BBox(Math.min(a,l),Math.min(r,c),Math.abs(l-a),Math.abs(c-r))}static fixedScale(){return new Vt([[xLon(0),yLat(0)],[xLon(1),yLat(1)]],[[0,0],[1,1]])}toDomain(){}normalizeDomains(...e){let i=-1/0,s=1/0,n=-1/0,o=1/0;for(const a of e)for(const[r,l]of a)i=Math.min(r,i),s=Math.max(r,s),n=Math.min(l,n),o=Math.max(l,o);return{domain:[[i,n],[s,o]],animatable:!0}}convert([e,i]){const[[s,n],[o,a]]=this.range,r=(o-s)/this.bounds.width,l=(a-n)/this.bounds.height;return[(lonX(e)-this.bounds.x)*r+s,(latY(i)-this.bounds.y)*l+n]}invert([e,i]){const[[s,n],[o,a]]=this.range,r=(o-s)/this.bounds.width,l=(a-n)/this.bounds.height;return[xLon((e-s)/r+this.bounds.x),yLat((i-n)/l+this.bounds.y)]}},_AxisTicks=class jt{constructor(){this.id=createId(this),this.axisGroup=new TranslatableGroup({name:`${this.id}-AxisTicks`,zIndex:2}),this.labelSelection=Selection.select(this.axisGroup,Text),this.interval=new AxisInterval,this.label=new AxisLabel,this.scale=new LinearScale,this.position="bottom",this.translationX=0,this.translationY=0,this.padding=0}attachAxis(e){e.appendChild(this.axisGroup)}calculateLayout(){const e=[],i=this.generateTicks(),{translationX:s,translationY:n}=this;return this.labelSelection.update(i.ticks.map(o=>this.createLabelDatum(o)),void 0,o=>o.tickId),this.labelSelection.each((o,a)=>{o.setProperties(a),a.visible&&e.push(o.getBBox())}),this.axisGroup.setProperties({translationX:s,translationY:n}),e.length>0?BBox.merge(e):void 0}getLabelParams(e){const{padding:i}=this,{translate:s}=e;switch(this.position){case"top":case"bottom":return{x:s,y:i,textAlign:"center",textBaseline:"top"};case"left":case"right":return{x:i,y:s,textAlign:"start",textBaseline:"middle"}}}inRange(e,i=.001){const[s,n]=findMinMax(this.scale.range);return e>=s-i&&e<=n+i}createLabelDatum(e){const{x:i,y:s,textBaseline:n,textAlign:o}=this.getLabelParams(e);return{visible:!!e.tickLabel,tickId:e.tickId,fill:this.label.color,fontFamily:this.label.fontFamily,fontSize:this.label.fontSize,fontStyle:this.label.fontStyle,fontWeight:this.label.fontWeight,rotation:0,rotationCenterX:0,text:e.tickLabel,textAlign:o,textBaseline:n,x:i,y:s}}generateTicks(){const{minSpacing:e,maxSpacing:i}=this.interval,{maxTickCount:s,minTickCount:n,tickCount:o}=estimateTickCount(findRangeExtent(this.scale.range),1,e,i,jt.DefaultTickCount,jt.DefaultMinSpacing),a=this.getTicksData({nice:!0,interval:this.interval.step,tickCount:o,minTickCount:n,maxTickCount:s});if(this.position==="bottom"||this.position==="top"){const r=CachedTextMeasurerPool.getMeasurer({font:this.label}),{domain:l}=this.scale,h=l[0]>l[1]?-1:1;let d=-1/0*h;a.ticks=a.ticks.filter(u=>Math.sign(u.translate-d)!==h?!1:(d=u.translate+r.textWidth(u.tickLabel,!0)*h,!0))}return a}getTicksData(e){const i=[],s=e.nice?this.scale.niceDomain(e):this.scale.domain,n=this.scale.ticks(e,s),o=n.reduce((c,h)=>Math.max(c,countFractionDigits(h)),0),a=[],r=createIdsGenerator(),l=this.label.format?this.scale.tickFormatter({domain:s,ticks:n,fractionDigits:o,specifier:this.label.format}):c=>formatValue(c,o);for(let c=0;c<n.length;c++){const h=n[c],d=this.scale.convert(h);if(!this.inRange(d))continue;const u=this.label.formatter?.({value:h,index:c,domain:s,fractionDigits:o,boundSeries:a})??l(h),p=r(u);i.push({tick:h,tickId:p,tickLabel:u,translate:d})}return{rawTicks:n,fractionDigits:o,ticks:i}}};_AxisTicks.DefaultTickCount=5,_AxisTicks.DefaultMinSpacing=10;var AxisTicks=_AxisTicks;function createButton(t,e){const i=createElement("button",getClassName("ag-charts-input ag-charts-button",e));return t.label!==void 0?i.append(t.label):(i.append(createIcon(t.icon)),i.ariaLabel=t.altText),i.addEventListener("click",t.onPress),setAttributes(i,e),i}function createCheckbox(t,e){const i=createElement("input",getClassName("ag-charts-input ag-charts-checkbox",e));return i.type="checkbox",i.checked=t.checked,i.addEventListener("change",s=>t.onChange(i.checked,s)),i.addEventListener("keydown",s=>{isButtonClickEvent(s)&&(s.preventDefault(),i.click())}),setAttributes(i,e),i}function createSelect(t,e){const i=createElement("select",getClassName("ag-charts-input ag-charts-select",e));return i.append(...t.options.map(s=>{const n=createElement("option");return n.value=s.value,n.textContent=s.label,n})),setAttribute(i,"data-preventdefault",!1),i.value=t.value,i.addEventListener("change",s=>t.onChange(i.value,s)),setAttributes(i,e),i}function createTextArea(t,e){const i=createElement("textarea",getClassName("ag-charts-input ag-charts-textarea",e));return i.value=t.value,i.addEventListener("input",s=>t.onChange(i.value,s)),setAttributes(i,e),setAttribute(i,"data-preventdefault",!1),i}function createIcon(t){const e=createElement("span",`ag-charts-icon ag-charts-icon-${t}`);return setAttribute(e,"aria-hidden",!0),e}function getClassName(t,e){return e==null?t:`${t} ${e.class}`}var SvgPath=class extends Path{constructor(t=""){super(),this.x=0,this.y=0,this.commands=[],this._d="",this.d=t}get d(){return this._d}set d(t){if(t!==this._d){this._d=t,this.commands.length=0;for(const[e,i,s]of t.matchAll(/([A-Z])([0-9. ]*)/g)){const n=s.split(/\s+/g).map(Number);this.commands.push([i,n])}this.checkPathDirty()}}updatePath(){const{path:t,x:e,y:i}=this;t.clear();let s=e,n=i;for(const[o,a]of this.commands)switch(o){case"M":t.moveTo(e+a[0],i+a[1]),s=e+a[0];break;case"C":t.cubicCurveTo(e+a[0],i+a[1],e+a[2],i+a[3],e+a[4],i+a[5]),s=e+a[4],n=i+a[5];break;case"H":t.lineTo(e+a[0],n),s=i+a[0];break;case"L":t.lineTo(e+a[0],i+a[1]),s=e+a[0],n=i+a[1];break;case"V":t.lineTo(s,i+a[0]),n=i+a[0];break;case"Z":t.closePath();break;default:throw new Error(`Could not translate command '${o}' with '${a.join(" ")}'`)}t.closePath()}};__decorateClass2([ScenePathChangeDetection()],SvgPath.prototype,"x",2),__decorateClass2([ScenePathChangeDetection()],SvgPath.prototype,"y",2);var Image=class extends Node{constructor(t){super(),this.sourceImage=t,this.x=0,this.y=0,this.width=0,this.height=0,this.opacity=1}render(t){const{ctx:e}=t,i=this.sourceImage;i&&(e.globalAlpha=this.opacity,e.drawImage(i,0,0,i.width,i.height,this.x,this.y,this.width,this.height)),super.render(t)}};__decorateClass2([SceneChangeDetection()],Image.prototype,"x",2),__decorateClass2([SceneChangeDetection()],Image.prototype,"y",2),__decorateClass2([SceneChangeDetection()],Image.prototype,"width",2),__decorateClass2([SceneChangeDetection()],Image.prototype,"height",2),__decorateClass2([SceneChangeDetection()],Image.prototype,"opacity",2);var exports_exports={};__export3(exports_exports,{ButtonWidget:()=>ButtonWidget,NativeWidget:()=>NativeWidget,SliderWidget:()=>SliderWidget,ToolbarWidget:()=>ToolbarWidget,WIDGET_HTML_EVENTS:()=>WIDGET_HTML_EVENTS,Widget:()=>Widget,WidgetEventUtil:()=>WidgetEventUtil});var canvasOverlay="canvas-overlay",Popover=class extends BaseModuleInstance{constructor(t,e,i){super(),this.ctx=t,this.hideFns=[],this.moduleId=`popover-${e}`,i?.detached?this.element=createElement("div"):this.element=t.domManager.addChild(canvasOverlay,this.moduleId),this.element.setAttribute("role","presentation"),this.destroyFns.push(()=>t.domManager.removeChild(canvasOverlay,this.moduleId))}attachTo(t){this.element.parentElement||t.element.append(this.element)}hide(t){const{lastFocus:e=this.lastFocus}=t??{};this.element.children.length!==0&&(this.hideFns.forEach(i=>i()),e?.focus(),this.lastFocus=void 0)}removeChildren(){this.element.replaceChildren()}showWithChildren(t,e){if(!this.element.parentElement)throw new Error("Can not show popover that has not been attached to a parent.");const i=createElement("div","ag-charts-popover");if(e.ariaLabel!=null&&i.setAttribute("aria-label",e.ariaLabel),e.class!=null&&i.classList.add(e.class),i.replaceChildren(...t),this.element.replaceChildren(i),this.hideFns.push(()=>this.removeChildren()),e.onHide&&this.hideFns.push(e.onHide),e.initialFocus&&e.sourceEvent){const s=getLastFocus(e.sourceEvent);s!==void 0&&(this.lastFocus=s,this.initialFocus=e.initialFocus)}return i}getPopoverElement(){return this.element.firstElementChild}updatePosition(t){const e=this.getPopoverElement();e&&(e.style.setProperty("right","unset"),e.style.setProperty("bottom","unset"),t.x!=null&&e.style.setProperty("left",`${Math.floor(t.x)}px`),t.y!=null&&e.style.setProperty("top",`${Math.floor(t.y)}px`),this.initialFocus?.focus(),this.initialFocus=void 0)}},AnchoredPopover=class extends Popover{setAnchor(t,e){this.anchor=t,this.fallbackAnchor=e,this.updatePosition(t),this.repositionWithinBounds()}showWithChildren(t,e){const i=e.anchor??this.anchor,s=e.fallbackAnchor??this.fallbackAnchor,n=super.showWithChildren(t,e);return i&&this.setAnchor(i,s),getWindow().requestAnimationFrame(()=>{this.repositionWithinBounds()}),n}repositionWithinBounds(){const{anchor:t,ctx:e,fallbackAnchor:i}=this,s=this.getPopoverElement();if(!t||!s)return;const n=e.domManager.getBoundingClientRect(),{offsetWidth:o,offsetHeight:a}=s;let r=clamp(0,t.x,n.width-o),l=clamp(0,t.y,n.height-a);r!==t.x&&i?.x!=null&&(r=clamp(0,i.x-o,n.width-o)),l!==t.y&&i?.y!=null&&(l=clamp(0,i.y-a,n.height-a)),this.updatePosition({x:r,y:l})}},Menu=class extends AnchoredPopover{show(t){const e=t.items.map(s=>this.createRow(t,s)),i=this.showWithChildren(e,t);i.classList.add("ag-charts-menu"),i.setAttribute("role","menu"),this.menuCloser=initMenuKeyNav({orientation:"vertical",menu:i,buttons:e,sourceEvent:t.sourceEvent,closeCallback:()=>this.hide()}),this.hideFns.push(()=>{this.menuCloser?.finishClosing(),this.menuCloser=void 0})}createRow(t,e){const{menuItemRole:i="menuitem"}=t,s=e.value===t.value,n=createElement("div","ag-charts-menu__row");if(n.setAttribute("role",i),i==="menuitemradio"&&n.setAttribute("aria-checked",(t.value===e.value).toString()),typeof e.value=="string"&&(n.dataset.popoverId=e.value),n.classList.toggle("ag-charts-menu__row--active",s),e.icon!=null){const l=createElement("span",`ag-charts-menu__icon ${getIconClassNames(e.icon)}`);n.appendChild(l)}const o=e.strokeWidth!=null;if(o&&(n.classList.toggle("ag-charts-menu__row--stroke-width-visible",o),n.style.setProperty("--strokeWidth",o?`${e.strokeWidth}px`:null)),e.label!=null){const l=createElement("span","ag-charts-menu__label");l.textContent=this.ctx.localeManager.t(e.label),n.appendChild(l)}"altText"in e&&(n.ariaLabel=this.ctx.localeManager.t(e.altText));const a=()=>{t.onPress?.(e)},r=l=>{isButtonClickEvent(l)&&(a(),l.preventDefault(),l.stopPropagation())};return n.addEventListener("keydown",r),n.addEventListener("click",r),n.addEventListener("mousemove",()=>{n.focus({preventScroll:!0})}),n}},DraggablePopover=class extends Popover{constructor(){super(...arguments),this.dragged=!1}setDragHandle(t){t.addListener("drag-start",e=>{t.addClass(this.dragHandleDraggingClass),this.onDragStart(e)}),t.addListener("drag-move",this.onDragMove.bind(this)),t.addListener("drag-end",()=>{t.removeClass(this.dragHandleDraggingClass),this.onDragEnd.bind(this)})}onDragStart(t){const e=this.getPopoverElement();e&&(t.sourceEvent.preventDefault(),this.dragged=!0,this.dragStartState={client:Vec2.from(t.clientX,t.clientY),position:Vec2.from(Number(e.style.getPropertyValue("left").replace("px","")),Number(e.style.getPropertyValue("top").replace("px","")))})}onDragMove(t){const{dragStartState:e}=this,i=this.getPopoverElement();if(!e||!i)return;const s=Vec2.sub(Vec2.from(t.clientX,t.clientY),e.client),n=Vec2.add(e.position,s),o=this.ctx.domManager.getBoundingClientRect(),a={};n.x>=0&&n.x+i.offsetWidth<=o.width&&(a.x=n.x),n.y>=0&&n.y+i.offsetHeight<=o.height&&(a.y=n.y),this.updatePosition(a)}onDragEnd(){this.dragStartState=void 0}},ToolbarButtonProperties=class extends BaseProperties{};__decorateClass2([TempValidate(STRING,{optional:!0})],ToolbarButtonProperties.prototype,"icon",2),__decorateClass2([TempValidate(STRING,{optional:!0})],ToolbarButtonProperties.prototype,"label",2),__decorateClass2([TempValidate(STRING,{optional:!0})],ToolbarButtonProperties.prototype,"ariaLabel",2),__decorateClass2([TempValidate(STRING,{optional:!0})],ToolbarButtonProperties.prototype,"tooltip",2);var ToolbarButtonWidget=class extends ButtonWidget{constructor(t){super(),this.localeManager=t}update(t){const{localeManager:e}=this;t.tooltip&&(this.elem.title=e.t(t.tooltip));let i="";if(t.icon!=null&&(i=`<span class="${getIconClassNames(t.icon)} ag-charts-toolbar__icon"></span>`),t.label!=null){const s=e.t(t.label);i=`${i}<span class="ag-charts-toolbar__label">${s}</span>`}this.elem.innerHTML=i}setChecked(t){setAttribute(this.elem,"aria-checked",t)}},BUTTON_ACTIVE_CLASS="ag-charts-toolbar__button--active",BaseToolbar=class extends ToolbarWidget{constructor(t,e="horizontal"){super(e),this.localeManager=t,this.horizontalSpacing=10,this.verticalSpacing=10,this.events=new Listeners,this.hasPrefix=!1,this.buttonWidgets=[],this.addClass("ag-charts-toolbar"),this.toggleClass("ag-charts-toolbar--horizontal",e==="horizontal"),this.toggleClass("ag-charts-toolbar--vertical",e==="vertical")}addToolbarListener(t,e){return this.events.addListener(t,e)}clearButtons(){for(const t of this.buttonWidgets)t.destroy();this.buttonWidgets.splice(0)}updateButtons(t){const{buttonWidgets:e}=this;for(const[i,s]of t.entries())(this.buttonWidgets.at(i)??this.createButton(i,s)).update(s);for(let i=t.length;i<e.length;i++)this.buttonWidgets.at(i)?.destroy();this.buttonWidgets.splice(t.length),this.refreshButtonClasses()}updateButtonByIndex(t,e){this.buttonWidgets.at(t)?.update(e)}clearActiveButton(){for(const t of this.buttonWidgets)t.toggleClass(BUTTON_ACTIVE_CLASS,!1)}toggleActiveButtonByIndex(t){if(t!==-1)for(const[e,i]of this.buttonWidgets.entries())i.toggleClass(BUTTON_ACTIVE_CLASS,t!=null&&t===e)}toggleButtonEnabledByIndex(t,e){t!==-1&&this.buttonWidgets.at(t)?.setEnabled(e)}toggleSwitchCheckedByIndex(t,e){t!==-1&&this.buttonWidgets.at(t)?.setChecked(e)}getButtonBounds(){return this.buttonWidgets.map(t=>this.getButtonWidgetBounds(t))}setButtonHiddenByIndex(t,e){this.buttonWidgets.at(t)?.setHidden(e)}getButtonWidgetBounds(t){const e=this.getBounds(),i=t.getBounds();return new BBox(i.x+e.x,i.y+e.y,i.width,i.height)}refreshButtonClasses(){const{buttonWidgets:t,hasPrefix:e}=this;let i,s,n;for(const[o,a]of t.entries())i=!e&&o===0||n!=a.section,s=o===t.length-1||a.section!=t.at(o+1)?.section,a.toggleClass("ag-charts-toolbar__button--first",i),a.toggleClass("ag-charts-toolbar__button--last",s),a.toggleClass("ag-charts-toolbar__button--gap",o>0&&i),n=a.section}createButton(t,e){const i=this.createButtonWidget();return i.addClass("ag-charts-toolbar__button"),i.addListener("click",s=>{const n={index:t,...e instanceof BaseProperties?e.toJson():e},o=this.getButtonWidgetBounds(i);this.events.dispatch("button-pressed",{event:s,button:n,buttonBounds:o})}),i.addListener("focus",()=>{this.events.dispatch("button-focused",{button:{index:t}})}),e.section&&(i.section=e.section),this.buttonWidgets.push(i),this.addChild(i),i}},Toolbar=class extends BaseToolbar{createButtonWidget(){return new ToolbarButtonWidget(this.localeManager)}},FloatingToolbarPopover=class extends DraggablePopover{constructor(t,e,i){super(t,e),this.onPopoverMoved=i,this.dragHandleDraggingClass="ag-charts-floating-toolbar__drag-handle--dragging"}show(t,e={}){this.showWithChildren(t,{...e,class:"ag-charts-floating-toolbar"})}hide(){this.dragged=!1,super.hide()}getBounds(){const t=this.getPopoverElement();return new BBox(t?.offsetLeft??0,t?.offsetTop??0,t?.offsetWidth??0,t?.offsetHeight??0)}hasBeenDragged(){return this.dragged}setAnchor(t,e,i){const s=this.getPopoverElement();if(!s)return;const n=t.position??"above",{offsetWidth:o,offsetHeight:a}=s;let r=t.y-a-i,l=t.x-o/2;n==="below"?r=t.y+i:n==="right"?(r=t.y-a/2,l=t.x+e):n==="above-left"&&(l=t.x),this.updatePosition({x:l,y:r})}ignorePointerEvents(){const t=this.getPopoverElement();t&&(t.style.pointerEvents="none")}capturePointerEvents(){const t=this.getPopoverElement();t&&(t.style.pointerEvents="unset")}updatePosition(t){const e=this.getBounds(),i=this.ctx.domManager.getBoundingClientRect();t.x=Math.floor(clamp(0,t.x,i.width-e.width)),t.y=Math.floor(clamp(0,t.y,i.height-e.height)),super.updatePosition(t),this.onPopoverMoved()}},FloatingToolbar=class extends BaseToolbar{constructor(t,e){super(t.localeManager),this.hasPrefix=!0,this.popover=new FloatingToolbarPopover(t,e,this.onPopoverMoved.bind(this)),this.dragHandle=new DragHandleWidget(t.localeManager.t("toolbarAnnotationsDragHandle")),this.popover.setDragHandle(this.dragHandle)}show(t={}){this.popover.show([this.dragHandle.getElement(),this.getElement()],t)}hide(){this.popover.hide()}setAnchor(t){this.popover.setAnchor(t,this.horizontalSpacing,this.verticalSpacing)}hasBeenDragged(){return this.popover.hasBeenDragged()}ignorePointerEvents(){this.popover.ignorePointerEvents()}capturePointerEvents(){this.popover.capturePointerEvents()}onPopoverMoved(){const t=this.popover.getBounds();if(this.popoverBounds?.equals(t))return;this.popoverBounds=t.clone();const e=this.getButtonBounds();this.events.dispatch("toolbar-moved",{popoverBounds:t,buttonBounds:e})}getButtonWidgetBounds(t){const e=this.popover.getBounds(),i=super.getButtonWidgetBounds(t),s=this.dragHandle.getBounds();return new BBox(i.x+e.x-s.width,i.y+e.y,i.width,i.height)}},DragHandleWidget=class extends NativeWidget{constructor(t){super(createElement("div","ag-charts-floating-toolbar__drag-handle"));const e=new NativeWidget(createElement("span",`${getIconClassNames("drag-handle")} ag-charts-toolbar__icon`));e.setAriaHidden(!0),this.addChild(e),this.elem.title=t}},motion={...fromToMotion_exports,...resetMotion_exports},AgChartsCommunityModule={VERSION,_Scene:integrated_charts_scene_exports,_Theme:integrated_charts_theme_exports,_Util:integrated_charts_util_exports,create:AgCharts.create.bind(AgCharts),createSparkline:AgCharts.__createSparkline.bind(AgCharts),setup:registerInbuiltModules,isEnterprise:!1},MD5=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility=this.md5("hello")!="5d41402abc4b2a76b9719d911017c592"}md5cycle(t,e){let i=t[0],s=t[1],n=t[2],o=t[3];i=this.ff(i,s,n,o,e[0],7,-680876936),o=this.ff(o,i,s,n,e[1],12,-389564586),n=this.ff(n,o,i,s,e[2],17,606105819),s=this.ff(s,n,o,i,e[3],22,-1044525330),i=this.ff(i,s,n,o,e[4],7,-176418897),o=this.ff(o,i,s,n,e[5],12,1200080426),n=this.ff(n,o,i,s,e[6],17,-1473231341),s=this.ff(s,n,o,i,e[7],22,-45705983),i=this.ff(i,s,n,o,e[8],7,1770035416),o=this.ff(o,i,s,n,e[9],12,-1958414417),n=this.ff(n,o,i,s,e[10],17,-42063),s=this.ff(s,n,o,i,e[11],22,-1990404162),i=this.ff(i,s,n,o,e[12],7,1804603682),o=this.ff(o,i,s,n,e[13],12,-40341101),n=this.ff(n,o,i,s,e[14],17,-1502002290),s=this.ff(s,n,o,i,e[15],22,1236535329),i=this.gg(i,s,n,o,e[1],5,-165796510),o=this.gg(o,i,s,n,e[6],9,-1069501632),n=this.gg(n,o,i,s,e[11],14,643717713),s=this.gg(s,n,o,i,e[0],20,-373897302),i=this.gg(i,s,n,o,e[5],5,-701558691),o=this.gg(o,i,s,n,e[10],9,38016083),n=this.gg(n,o,i,s,e[15],14,-660478335),s=this.gg(s,n,o,i,e[4],20,-405537848),i=this.gg(i,s,n,o,e[9],5,568446438),o=this.gg(o,i,s,n,e[14],9,-1019803690),n=this.gg(n,o,i,s,e[3],14,-187363961),s=this.gg(s,n,o,i,e[8],20,1163531501),i=this.gg(i,s,n,o,e[13],5,-1444681467),o=this.gg(o,i,s,n,e[2],9,-51403784),n=this.gg(n,o,i,s,e[7],14,1735328473),s=this.gg(s,n,o,i,e[12],20,-1926607734),i=this.hh(i,s,n,o,e[5],4,-378558),o=this.hh(o,i,s,n,e[8],11,-2022574463),n=this.hh(n,o,i,s,e[11],16,1839030562),s=this.hh(s,n,o,i,e[14],23,-35309556),i=this.hh(i,s,n,o,e[1],4,-1530992060),o=this.hh(o,i,s,n,e[4],11,1272893353),n=this.hh(n,o,i,s,e[7],16,-155497632),s=this.hh(s,n,o,i,e[10],23,-1094730640),i=this.hh(i,s,n,o,e[13],4,681279174),o=this.hh(o,i,s,n,e[0],11,-358537222),n=this.hh(n,o,i,s,e[3],16,-722521979),s=this.hh(s,n,o,i,e[6],23,76029189),i=this.hh(i,s,n,o,e[9],4,-640364487),o=this.hh(o,i,s,n,e[12],11,-421815835),n=this.hh(n,o,i,s,e[15],16,530742520),s=this.hh(s,n,o,i,e[2],23,-995338651),i=this.ii(i,s,n,o,e[0],6,-198630844),o=this.ii(o,i,s,n,e[7],10,1126891415),n=this.ii(n,o,i,s,e[14],15,-1416354905),s=this.ii(s,n,o,i,e[5],21,-57434055),i=this.ii(i,s,n,o,e[12],6,1700485571),o=this.ii(o,i,s,n,e[3],10,-1894986606),n=this.ii(n,o,i,s,e[10],15,-1051523),s=this.ii(s,n,o,i,e[1],21,-2054922799),i=this.ii(i,s,n,o,e[8],6,1873313359),o=this.ii(o,i,s,n,e[15],10,-30611744),n=this.ii(n,o,i,s,e[6],15,-1560198380),s=this.ii(s,n,o,i,e[13],21,1309151649),i=this.ii(i,s,n,o,e[4],6,-145523070),o=this.ii(o,i,s,n,e[11],10,-1120210379),n=this.ii(n,o,i,s,e[2],15,718787259),s=this.ii(s,n,o,i,e[9],21,-343485551),t[0]=this.add32(i,t[0]),t[1]=this.add32(s,t[1]),t[2]=this.add32(n,t[2]),t[3]=this.add32(o,t[3])}cmn(t,e,i,s,n,o){return e=this.add32(this.add32(e,t),this.add32(s,o)),this.add32(e<<n|e>>>32-n,i)}ff(t,e,i,s,n,o,a){return this.cmn(e&i|~e&s,t,e,n,o,a)}gg(t,e,i,s,n,o,a){return this.cmn(e&s|i&~s,t,e,n,o,a)}hh(t,e,i,s,n,o,a){return this.cmn(e^i^s,t,e,n,o,a)}ii(t,e,i,s,n,o,a){return this.cmn(i^(e|~s),t,e,n,o,a)}md51(t){const e=t.length,i=[1732584193,-271733879,-1732584194,271733878];let s;for(s=64;s<=t.length;s+=64)this.md5cycle(i,this.md5blk(t.substring(s-64,s)));t=t.substring(s-64);const n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(s=0;s<t.length;s++)n[s>>2]|=t.charCodeAt(s)<<(s%4<<3);if(n[s>>2]|=128<<(s%4<<3),s>55)for(this.md5cycle(i,n),s=0;s<16;s++)n[s]=0;return n[14]=e*8,this.md5cycle(i,n),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="",s=0;for(;s<4;s++)i+=e[t>>s*8+4&15]+e[t>>s*8&15];return i}hex(t){for(let e=0;e<t.length;e++)t[e]=this.rhex(t[e]);return t.join("")}md5(t){return this.hex(this.md51(t))}add32(t,e){return this.ieCompatibility?this.add32Compat(t,e):this.add32Std(t,e)}add32Std(t,e){return t+e&4294967295}add32Compat(t,e){const i=(t&65535)+(e&65535);return(t>>16)+(e>>16)+(i>>16)<<16|i&65535}};function missingOrEmpty(t){return t==null||t.length===0}var LICENSE_TYPES={"01":"GRID","02":"CHARTS","0102":"BOTH"},LICENSING_HELP_URL="https://www.ag-grid.com/charts/licensing/",_LicenseManager=class dt{constructor(e){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=e,this.md5=new MD5,this.md5.init()}validateLicense(){const e=this.getLicenseDetails(dt.licenseKey,dt.gridContext),i=`AG ${e.currentLicenseType==="BOTH"?"Grid and ":""}Charts Enterprise`;let s="";if(e.suppliedLicenseType==="BOTH"?s="AG Grid and AG Charts Enterprise":e.suppliedLicenseType==="GRID"?s="AG Grid Enterprise":e.suppliedLicenseType!==void 0&&(s="AG Charts Enterprise"),e.missing)(!this.isWebsiteUrl()||this.isForceWatermark())&&this.outputMissingLicenseKey(i);else if(e.expired){const n=dt.getChartsReleaseDate(),o=dt.formatDate(n);this.outputExpiredKey(e.expiry,o,s)}else e.valid?e.isTrial&&e.trialExpired&&this.outputExpiredTrialKey(e.expiry,i,s):this.outputInvalidLicenseKey(!!e.incorrectLicenseType,i,s)}static extractExpiry(e){const i=e.substring(e.lastIndexOf("_")+1,e.length);return new Date(parseInt(dt.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 s=i.length-32,n=i.substring(s),o=i.substring(0,s),[a,r,l]=dt.extractBracketedInformation(i);return{md5:n,license:o,version:a,isTrial:r,type:l}}getLicenseDetails(e,i=!1){const s="CHARTS";if(missingOrEmpty(e))return{licenseKey:e,valid:!1,missing:!0,currentLicenseType:s};const n=dt.getChartsReleaseDate(),{md5:o,license:a,version:r,isTrial:l,type:c}=dt.extractLicenseComponents(e);let h=o===this.md5.md5(a)&&e.indexOf("For_Trialing_ag-Grid_Only")===-1,d,u,p=null,g=!1,f;function m(){d=p<new Date,u=void 0}if(h&&(p=dt.extractExpiry(a),h=!isNaN(p.getTime()),h))switch(u=n>p,r){case"legacy":case"2":{h=!1;break}case"3":missingOrEmpty(c)?h=!1:(f=c,c!==LICENSE_TYPES["02"]&&c!==LICENSE_TYPES["0102"]?(h=!1,g=!0):l&&m())}return h?{licenseKey:e,valid:h,expiry:dt.formatDate(p),expired:u,version:r,isTrial:l,trialExpired:d,invalidLicenseTypeForCombo:i?f!=="BOTH":void 0,incorrectLicenseType:g,currentLicenseType:s,suppliedLicenseType:f}:{licenseKey:e,valid:h,incorrectLicenseType:g,currentLicenseType:s,suppliedLicenseType:f}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isWebsiteUrl()&&!missingOrEmpty(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:s=""}=i;return s}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"],s=e.getDate(),n=e.getMonth(),o=e.getFullYear();return s+" "+i[n]+" "+o}static getChartsReleaseDate(){return new Date(parseInt(dt.decode(dt.RELEASE_INFORMATION),10))}static decode(e){const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let s="",n,o,a,r,l,c,h,d=0;const u=e.replace(/[^A-Za-z0-9+/=]/g,"");for(;d<u.length;)r=i.indexOf(u.charAt(d++)),l=i.indexOf(u.charAt(d++)),c=i.indexOf(u.charAt(d++)),h=i.indexOf(u.charAt(d++)),n=r<<2|l>>4,o=(l&15)<<4|c>>2,a=(c&3)<<6|h,s=s+String.fromCharCode(n),c!=64&&(s=s+String.fromCharCode(o)),h!=64&&(s=s+String.fromCharCode(a));return s=dt.utf8_decode(s),s}static utf8_decode(e){e=e.replace(/rn/g,"n");let i="";for(let s=0;s<e.length;s++){const n=e.charCodeAt(s);n<128?i+=String.fromCharCode(n):n>127&&n<2048?(i+=String.fromCharCode(n>>6|192),i+=String.fromCharCode(n&63|128)):(i+=String.fromCharCode(n>>12|224),i+=String.fromCharCode(n>>6&63|128),i+=String.fromCharCode(n&63|128))}return i}static setGridContext(e=!1){dt.gridContext=e}static setLicenseKey(e){dt.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 s=i.filter(r=>r==="TRIAL").length===1,n=i.filter(r=>r.startsWith("v"))[0],o=n?n.replace("v",""):"legacy",a=LICENSE_TYPES[i.filter(r=>LICENSE_TYPES[r])[0]];return[o,s,a]}centerPadAndOutput(e){const i=this.totalMessageLength-e.length;console.error(e.padStart(i/2+e.length,"*").padEnd(this.totalMessageLength,"*"))}padAndOutput(e,i="*",s=""){console.error(e.padEnd(this.totalMessageLength-s.length,i)+s)}outputInvalidLicenseKey(e,i,s){dt.gridContext||(e?(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Incompatible License Key "),this.padAndOutput(`* Your license key is for ${s} only and does not cover you for ${i}.`," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${LICENSING_HELP_URL}.`," ","*"),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 ${LICENSING_HELP_URL}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""))),this.watermarkMessage="Invalid License"}outputExpiredTrialKey(e,i,s){dt.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Trial Period Expired. "),this.padAndOutput(`* Your trial only license for ${s} 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){dt.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,s){dt.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${s} License `),this.centerPadAndOutput(" Incompatible Software Version "),this.padAndOutput(`* Your license key works with versions of ${s} 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"}};_LicenseManager.RELEASE_INFORMATION="MTc0NDM2MDQwOTAxMw==",_LicenseManager.gridContext=!1;var LicenseManager=_LicenseManager;function loopSymmetrically(t,e,i){const s=(o,a,r,l)=>{let c=t[0];for(let h=o;r>0?h<=a:h>a;h+=r){const d=t[h];if(l(c,d))return!0;c=d}return!1},n=Math.floor(t.length/2);return s(e,n,e,i)?!0:s(t.length-e,n,-e,i)}var{OR:OR2,POSITIVE_NUMBER:POSITIVE_NUMBER2,NAN:NAN2,AxisInterval:AxisInterval2,TempValidate:TempValidate2}=module_support_exports,AngleAxisInterval=class extends AxisInterval2{};__decorateClass([TempValidate2(OR2(POSITIVE_NUMBER2,NAN2))],AngleAxisInterval.prototype,"minSpacing",2);var{BaseProperties:BaseProperties2,ChartAxisDirection:ChartAxisDirection2,ARRAY:ARRAY2,BOOLEAN:BOOLEAN2,COLOR_STRING:COLOR_STRING2,FONT_STYLE:FONT_STYLE2,FONT_WEIGHT:FONT_WEIGHT2,LINE_DASH:LINE_DASH2,NUMBER:NUMBER2,OBJECT:OBJECT2,POSITIVE_NUMBER:POSITIVE_NUMBER3,RATIO:RATIO2,STRING:STRING2,UNION:UNION2,AND:AND2,COLOR_STRING_ARRAY:COLOR_STRING_ARRAY2,TempValidate:TempValidate3,MATCHING_CROSSLINE_TYPE:MATCHING_CROSSLINE_TYPE2,createId:createId2,Group:Group2}=module_support_exports,PolarCrossLineLabel=class extends BaseProperties2{constructor(){super(...arguments),this.fontSize=14,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)"}};__decorateClass([TempValidate3(BOOLEAN2,{optional:!0})],PolarCrossLineLabel.prototype,"enabled",2),__decorateClass([TempValidate3(STRING2,{optional:!0})],PolarCrossLineLabel.prototype,"text",2),__decorateClass([TempValidate3(FONT_STYLE2,{optional:!0})],PolarCrossLineLabel.prototype,"fontStyle",2),__decorateClass([TempValidate3(FONT_WEIGHT2,{optional:!0})],PolarCrossLineLabel.prototype,"fontWeight",2),__decorateClass([TempValidate3(POSITIVE_NUMBER3)],PolarCrossLineLabel.prototype,"fontSize",2),__decorateClass([TempValidate3(STRING2)],PolarCrossLineLabel.prototype,"fontFamily",2),__decorateClass([TempValidate3(NUMBER2)],PolarCrossLineLabel.prototype,"padding",2),__decorateClass([TempValidate3(COLOR_STRING2,{optional:!0})],PolarCrossLineLabel.prototype,"color",2),__decorateClass([TempValidate3(BOOLEAN2,{optional:!0})],PolarCrossLineLabel.prototype,"parallel",2);var PolarCrossLine=class extends BaseProperties2{constructor(){super(...arguments),this.id=createId2(this),this.defaultColorRange=[],this.shape="polygon",this.label=new PolarCrossLineLabel,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.direction=ChartAxisDirection2.X,this.axisInnerRadius=0,this.axisOuterRadius=0,this.lineGroup=new Group2({name:this.id}),this.rangeGroup=new Group2({name:this.id}),this.labelGroup=new Group2({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,s,n){const{label:o}=this;t.x=e,t.y=i,t.text=o.text,t.textAlign="center",t.textBaseline=s,t.rotation=n,t.rotationCenterX=e,t.rotationCenterY=i,t.fill=o.color,t.fontFamily=o.fontFamily,t.fontSize=o.fontSize,t.fontStyle=o.fontStyle,t.visible=!0}};__decorateClass([TempValidate3(BOOLEAN2,{optional:!0})],PolarCrossLine.prototype,"enabled",2),__decorateClass([TempValidate3(UNION2(["range","line"],"a crossLine type"))],PolarCrossLine.prototype,"type",2),__decorateClass([TempValidate3(AND2(MATCHING_CROSSLINE_TYPE2("range"),ARRAY2.restrict({length:2})),{optional:!0})],PolarCrossLine.prototype,"range",2),__decorateClass([TempValidate3(MATCHING_CROSSLINE_TYPE2("value"),{optional:!0})],PolarCrossLine.prototype,"value",2),__decorateClass([TempValidate3(COLOR_STRING_ARRAY2)],PolarCrossLine.prototype,"defaultColorRange",2),__decorateClass([TempValidate3(COLOR_STRING2,{optional:!0})],PolarCrossLine.prototype,"fill",2),__decorateClass([TempValidate3(RATIO2,{optional:!0})],PolarCrossLine.prototype,"fillOpacity",2),__decorateClass([TempValidate3(COLOR_STRING2,{optional:!0})],PolarCrossLine.prototype,"stroke",2),__decorateClass([TempValidate3(NUMBER2,{optional:!0})],PolarCrossLine.prototype,"strokeWidth",2),__decorateClass([TempValidate3(RATIO2,{optional:!0})],PolarCrossLine.prototype,"strokeOpacity",2),__decorateClass([TempValidate3(LINE_DASH2,{optional:!0})],PolarCrossLine.prototype,"lineDash",2),__decorateClass([TempValidate3(UNION2(["polygon","circle"],"a shape"))],PolarCrossLine.prototype,"shape",2),__decorateClass([TempValidate3(OBJECT2)],PolarCrossLine.prototype,"label",2);var{ChartAxisDirection:ChartAxisDirection3,getCrossLineValue:getCrossLineValue2,validateCrossLineValue:validateCrossLineValue2,normalizeAngle360:normalizeAngle3602,Group:Group3,Path:Path2,Sector:Sector2,RotatableText:RotatableText2,ContinuousScale:ContinuousScale2}=module_support_exports,AngleCrossLine=class extends PolarCrossLine{constructor(){super(),this.direction=ChartAxisDirection3.X,this.polygonNode=new Path2,this.sectorNode=new Sector2,this.lineNode=new Path2,this.crossLineRange=new Group3,this.labelNode=new RotatableText2,this.ticks=[],this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.crossLineRange.append(this.lineNode),this.labelGroup.append(this.labelNode)}visibilityCheck(){if(!ContinuousScale2.is(this.scale))return!0;const[t,e]=this.scale.domain,i=getCrossLineValue2(this);if(isArray(i)){const[s,n]=i;return s>=t&&s<=e&&n>=s&&n<=e}else return i>=t&&i<=e}update(t){const{scale:e}=this;if(!e||!this.isValid()||!validateCrossLineValue2(getCrossLineValue2(this),e)||!this.visibilityCheck()){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,this.updateLineNode(t),this.updatePolygonNode(t),this.updateSectorNode(t),this.updateLabelNode(t)}updateLineNode(t){const{scale:e,type:i,value:s,lineNode:n}=this;if(!t||i!=="line"||!e){n.visible=!1;return}const o=e.convert(s);if(isNaN(o)){n.visible=!1;return}const{axisInnerRadius:a,axisOuterRadius:r}=this;n.visible=!0,n.stroke=this.stroke,n.strokeOpacity=this.strokeOpacity??1,n.strokeWidth=this.strokeWidth??1,n.fill=void 0,n.lineDash=this.lineDash;const l=r*Math.cos(o),c=r*Math.sin(o),h=a*Math.cos(o),d=a*Math.sin(o);n.path.clear(!0),n.path.moveTo(h,d),n.path.lineTo(l,c),this.assignCrossLineGroup(!1,this.crossLineRange)}updatePolygonNode(t){const{polygonNode:e,range:i,scale:s,shape:n,type:o,ticks:a}=this;if(!t||o!=="range"||n!=="polygon"||!s||!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(g=>s.convert(g));e.visible=!0,this.setSectorNodeProps(e);const{path:p}=e;p.clear(!0),u.forEach((g,f)=>{const m=l*Math.cos(g),y=l*Math.sin(g);f===0?p.moveTo(m,y):p.lineTo(m,y)}),r===0?p.lineTo(0,0):u.slice().reverse().forEach(g=>{const f=r*Math.cos(g),m=r*Math.sin(g);p.lineTo(f,m)}),e.path.closePath(),this.assignCrossLineGroup(!0,this.crossLineRange)}updateSectorNode(t){const{sectorNode:e,range:i,scale:s,shape:n,type:o}=this;if(!t||o!=="range"||n!=="circle"||!s||!i){e.visible=!1;return}const{axisInnerRadius:a,axisOuterRadius:r}=this,l=i.map(d=>s.convert(d)),c=s.step??0,h=s instanceof module_support_exports.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:s,scale:n,type:o,ticks:a}=this;if(!t||e.enabled===!1||!e.text||!n||o==="range"&&!s){i.visible=!1;return}i.visible=!0;const{axisInnerRadius:r,axisOuterRadius:l}=this;let c,h,d,u;if(o==="line"){const p=normalizeAngle3602(n.convert(this.value)),g=1.5*Math.PI,f=isNumberEqual(p,g)||p>g||p<Math.PI/2,m=(r+l)/2*Math.cos(p),y=(r+l)/2*Math.sin(p);c=m+e.padding*Math.cos(p+Math.PI/2),h=y+e.padding*Math.sin(p+Math.PI/2),u=f?"top":"bottom",d=f?p:p-Math.PI}else{const[p,g]=s.map(x=>normalizeAngle3602(n.convert(x)));let f=(p+g)/2;p>g&&(f-=Math.PI),f=normalizeAngle3602(f);const m=(isNumberEqual(f,0)||f>0)&&f<Math.PI;let y;this.shape==="circle"||a.length<3?y=l-e.padding:y=l*Math.cos(Math.PI/a.length)-e.padding,c=y*Math.cos(f),h=y*Math.sin(f),u=m?"bottom":"top",d=m?f-Math.PI/2:f+Math.PI/2}this.setLabelNodeProps(i,c,h,u,d)}};AngleCrossLine.className="AngleCrossLine";var{ChartAxisDirection:ChartAxisDirection4,NUMBER:NUMBER3,UNION:UNION3,ProxyOnWrite:ProxyOnWrite2,TextWrapper:TextWrapper2,TextUtils:TextUtils2,TempValidate:TempValidate4,toRadians:toRadians2,normalizeAngle360:normalizeAngle3603,normalizeAngle360Inclusive:normalizeAngle360Inclusive2,Path:Path3,RotatableText:RotatableText3,Transformable:Transformable2,BBox:BBox2}=module_support_exports,AngleAxisLabel=class extends module_support_exports.AxisLabel{constructor(){super(...arguments),this.orientation="fixed"}};__decorateClass([TempValidate4(UNION3(["fixed","parallel","perpendicular"],"a label orientation"))],AngleAxisLabel.prototype,"orientation",2);var AngleAxis=class extends module_support_exports.PolarAxis{constructor(t,e){super(t,e),this.startAngle=0,this.endAngle=void 0,this.labelData=[],this.tickData=[],this.radiusLine=this.axisGroup.appendChild(new Path3),this.includeInvisibleDomains=!0}get direction(){return ChartAxisDirection4.X}createLabel(){return new AngleAxisLabel}calculateTickLayout(t){const{nice:e,scale:i}=this,s={nice:e,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0},n=e?i.niceDomain(s,t):t,o=this.generateAngleTicks(n);this.tickData=o;const a=o.map(l=>l.value),r=a.reduce((l,c)=>Math.max(typeof c=="number"?countFractionDigits(c):0,l),0);return{niceDomain:n,primaryTickCount:void 0,tickDomain:n,ticks:a,fractionDigits:r,bbox:this.getBBox()}}update(){super.update(),this.updateRadiusLine()}normalizedAngles(){const t=normalizeAngle3603(-Math.PI/2+toRadians2(this.startAngle)),e=this.endAngle!=null?normalizeAngle360Inclusive2(toRadians2(this.endAngle)-toRadians2(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:s,crossLineLineGroup:n,crossLineLabelGroup:o}=this,a=Math.floor(t.x),r=Math.floor(t.y);e.translationX=a,e.translationY=r,i.translationX=a,i.translationY=r,s.translationX=a,s.translationY=r,n.translationX=a,n.translationY=r,o.translationX=a,o.translationY=r}updateRadiusLine(){const t=this.radiusLine,{path:e}=t;e.clear(!0);const{points:i,closePath:s}=this.getAxisLinePoints();i.forEach(({x:n,y:o,moveTo:a,arc:r,radius:l=0,startAngle:c=0,endAngle:h=0})=>{r?e.arc(n,o,l,c,h):a?e.moveTo(n,o):e.lineTo(n,o)}),s&&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,[s,n]=this.range,o=isNumberEqual(n-s,2*Math.PI),a=[];if(e==="circle")o?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(s),y:i*Math.sin(s),moveTo:!0},{x:0,y:0,radius:i,startAngle:normalizeAngle3603(s),endAngle:normalizeAngle3603(n),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),d=i*Math.sin(l),u=c===0;a.push({x:h,y:d,moveTo:u})})}return{points:a,closePath:o}}updateGridLines(){const{scale:t,gridLength:e,gridLine:{style:i,width:s},innerRadiusRatio:n}=this;if(!(i&&e>0))return;const o=e*n,a=i.length;this.gridLineGroupSelection.each((r,l,c)=>{const{value:h}=l,{stroke:d,lineDash:u}=i[c%a],p=t.convert(h);r.x1=o*Math.cos(p),r.y1=o*Math.sin(p),r.x2=e*Math.cos(p),r.y2=e*Math.sin(p),r.stroke=d,r.strokeWidth=s,r.lineDash=u,r.fill=void 0}),this.gridLineGroupSelection.cleanup()}updateLabels(){const{label:t,tickLabelGroupSelection:e}=this;e.each((i,s,n)=>{const o=this.labelData[n];if(!o||o.hidden){i.visible=!1;return}i.text=o.text,i.setFont(t),i.fill=t.color,i.x=o.x,i.y=o.y,i.textAlign=o.textAlign,i.textBaseline=o.textBaseline,i.visible=!0,o.rotation?(i.rotation=o.rotation,i.rotationCenterX=o.x,i.rotationCenterY=o.y):i.rotation=0})}updateTickLines(){const{scale:t,gridLength:e,tick:i,tickLineGroupSelection:s}=this;s.each((n,o)=>{const{value:a}=o,r=t.convert(a),l=Math.cos(r),c=Math.sin(r);n.x1=e*l,n.y1=e*c,n.x2=(e+i.size)*l,n.y2=(e+i.size)*c,n.stroke=i.stroke,n.strokeWidth=i.width})}createLabelNodeData(t,e,i){const{label:s,gridLength:n,scale:o,tick:a}=this;if(!s.enabled)return[];const r=new RotatableText3,l=i.x-this.translation.x,c=i.x+i.width-this.translation.x,h=t.map((d,u)=>{const{value:p}=d,g=n+s.spacing+a.size,f=o.convert(p),m=Math.cos(f),y=Math.sin(f),x=g*m,b=g*y,{textAlign:S,textBaseline:v}=this.getLabelAlign(f),I=u===t.length-1&&p!==t[0]&&isNumberEqual(normalizeAngle3603(f),normalizeAngle3603(o.convert(t[0]))),A=this.getLabelRotation(f);let D=this.formatTick(p,u,o.domain);r.text=D,r.x=x,r.y=b,r.setFont(s),r.textAlign=S,r.textBaseline=v,r.rotation=A,A&&(r.rotationCenterX=x,r.rotationCenterY=b);let T=A?Transformable2.toCanvas(r):r.getBBox();if(T&&e.hideWhenNecessary&&!A){const k=l-T.x,w=T.x+T.width-c,L=1;if(k>L||w>L){const O=T.width-Math.max(k,w);D=TextWrapper2.wrapText(D,{maxWidth:O,font:s,textWrap:"never"}),D===TextUtils2.EllipsisChar&&(D=""),r.text=D,T=r.getBBox()}}return{text:D,x,y:b,textAlign:S,textBaseline:v,hidden:D===""||d.hidden||I,rotation:A,box:T}});return s.avoidCollisions&&this.avoidLabelCollisions(h),h}computeLabelsBBox(t,e){this.labelData=this.createLabelNodeData(this.tickData,t,e);const i=this.labelData.map(({box:s})=>s).filter(s=>s!=null);return!this.label.enabled||i.length===0?null:BBox2.merge(i)}getLabelOrientation(){const{label:t}=this;return t instanceof AngleAxisLabel?t.orientation:"fixed"}getLabelRotation(t){let e=toRadians2(this.label.rotation??0);t=normalizeAngle3603(t);const i=this.getLabelOrientation();return i==="parallel"?(e+=t,t>=0&&t<Math.PI?e-=Math.PI/2:e+=Math.PI/2):i==="perpendicular"&&(e+=t,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 s,n;const o=this.getLabelOrientation(),a=isNumberEqual(e,0),r=isNumberEqual(i,0),l=isNumberEqual(e,1),c=isNumberEqual(i,-1),h=e>0&&!a,d=i>0&&!r;return o==="parallel"?(s="center",n=l&&r||d?"top":"bottom"):o==="perpendicular"?(s=c||h?"left":"right",n="middle"):(s="right",a?s="center":h&&(s="left"),n="bottom",r?n="middle":d&&(n="top")),{textAlign:s,textBaseline:n}}updateCrossLines(){const{shape:t,gridLength:e,innerRadiusRatio:i}=this;this.crossLines.forEach(s=>{s instanceof AngleCrossLine&&(s.ticks=this.tickData.map(n=>n.value),s.shape=t,s.axisOuterRadius=e,s.axisInnerRadius=e*i)}),super.updateCrossLines()}};AngleAxis.CrossLineConstructor=AngleCrossLine,__decorateClass([ProxyOnWrite2("rotation"),TempValidate4(NUMBER3)],AngleAxis.prototype,"startAngle",2),__decorateClass([TempValidate4(NUMBER3,{optional:!0})],AngleAxis.prototype,"endAngle",2);var{RATIO:RATIO3,OBJECT:OBJECT3,TempValidate:TempValidate5,CategoryScale:CategoryScale2}=module_support_exports,AngleCategoryAxis=class extends AngleAxis{constructor(t){super(t,new CategoryScale2),this.groupPaddingInner=0,this.paddingInner=0,this.interval=new AngleAxisInterval}generateAngleTicks(){const{scale:t,gridLength:e}=this,{values:i,minSpacing:s}=this.interval,n=i??t.ticks({nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})??[];if(n.length<2||s==null)return n.map(c=>({value:c,visible:!0}));const o=n[0],a=t.convert(o),r=e*Math.cos(a),l=e*Math.sin(a);for(let c=1;c<n.length-1;c++){const h=n[c],d=t.convert(h);if(d-a>Math.PI)break;const u=e*Math.cos(d),p=e*Math.sin(d);if(Math.sqrt((u-r)**2+(p-l)**2)>s){const f=new Set([o]);return loopSymmetrically(n,c,(m,y)=>{f.add(y)}),n.map(m=>{const y=f.has(m);return{value:m,visible:y}})}}return[{value:o,visible:!0}]}avoidLabelCollisions(t){const{minSpacing:e}=this.label;if(t.length<3)return;const i=(l,c)=>{if(l.hidden||c.hidden)return!1;if(e==null)return l.box.collidesBBox(c.box);const h=l.box.clone().grow(e/2),d=c.box.clone().grow(e/2);return h.collidesBBox(d)},s=t[0],n=t.at(-1),o=new Set([s]),a=isNumberEqual(s.x,n.x)&&isNumberEqual(s.y,n.y),r=Math.floor(t.length/2);for(let l=1;l<=r;l++){const c=a?t.slice(0,-1):t;if(!loopSymmetrically(c,l,i)){loopSymmetrically(c,l,(d,u)=>{o.add(u)});break}}t.forEach(l=>{o.has(l)||(l.hidden=!0,l.box=void 0)})}};AngleCategoryAxis.className="AngleCategoryAxis",AngleCategoryAxis.type="angle-category",__decorateClass([TempValidate5(RATIO3)],AngleCategoryAxis.prototype,"groupPaddingInner",2),__decorateClass([TempValidate5(RATIO3)],AngleCategoryAxis.prototype,"paddingInner",2),__decorateClass([TempValidate5(OBJECT3)],AngleCategoryAxis.prototype,"interval",2);var AngleCategoryAxisModule={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"angle-category",moduleFactory:t=>new AngleCategoryAxis(t)},{range:range3,isDenseInterval:isDenseInterval2,LinearScale:LinearScale2}=module_support_exports,LinearAngleScale=class Wt extends LinearScale2{constructor(){super(...arguments),this.arcLength=0}static getNiceStepAndTickCount(e,i){const[s,n]=i;let o=LinearScale2.getTickStep(s,n,e);const a=isNaN(e.maxTickCount)?1/0:e.maxTickCount,r=Math.abs(n-s)/o;let l=Math.pow(2,Math.ceil(Math.log(r)/Math.log(2)));return l>a&&(l/=2,o*=2),{count:l,step:o}}ticks(e,i=this.domain){const{arcLength:s}=this;if(!i||i.length<2||i.some(c=>!isFinite(c))||s<=0)return[];const{nice:n,interval:o}=e,[a,r]=i;if(o){const c=Math.abs(o),h=this.getPixelRange();if(!isDenseInterval2((r-a)/c,h))return range3(a,r,c)}let l;if(n&&this.hasNiceRange()){const c=super.niceDomain(e,i);l=Wt.getNiceStepAndTickCount(e,c).step}else l=LinearScale2.getTickStep(a,r,e);return range3(a,r,l)}hasNiceRange(){const e=this.range.slice().sort((s,n)=>s-n);return[Math.PI,2*Math.PI].some(s=>isNumberEqual(s,e[1]-e[0]))}niceDomain(e,i=this.domain){const s=super.niceDomain(e,i);if(!this.hasNiceRange())return s;const n=s[0]>s[1],o=n?s[1]:s[0],{step:a,count:r}=Wt.getNiceStepAndTickCount(e,s),l=1/a,c=a>=1?Math.ceil(o/a+r)*a:Math.ceil((o+r*a)*l)/l;return n?[c,o]:[o,c]}getPixelRange(){return this.arcLength}},{AND:AND3,GREATER_THAN:GREATER_THAN2,LESS_THAN:LESS_THAN2,NUMBER_OR_NAN:NUMBER_OR_NAN2,OBJECT:OBJECT4,TempValidate:TempValidate6,angleBetween:angleBetween2,normalisedExtentWithMetadata:normalisedExtentWithMetadata2,findMinMax:findMinMax2}=module_support_exports,AngleNumberAxis=class extends AngleAxis{constructor(t){super(t,new LinearAngleScale),this.shape="circle",this.interval=new AngleAxisInterval}normaliseDataDomain(t){const{min:e,max:i}=this,{extent:s,clipped:n}=normalisedExtentWithMetadata2(t,e,i);return{domain:s,clipped:n}}updateScale(){super.updateScale(),this.scale.arcLength=this.getRangeArcLength()}getRangeArcLength(){const{range:t}=this,e=Math.min(...t),i=Math.max(...t),s=angleBetween2(e,i)||2*Math.PI,n=this.gridLength;return s*n}generateAngleTicks(t){const{scale:e,range:i,nice:s}=this,{values:n,step:o,minSpacing:a,maxSpacing:r}=this.interval;let l;if(n==null){const{arcLength:c}=e,h=r?Math.floor(c/r):1,d=a?Math.floor(c/a):1/0,u=Math.floor(4/Math.PI*Math.abs(i[0]-i[1])),p=Math.max(h,Math.min(d,u)),g={nice:s,interval:o,tickCount:p,minTickCount:h,maxTickCount:d};l=e.ticks(g,t)}else{const[c,h]=findMinMax2(t.map(Number));l=n.filter(d=>d>=c&&d<=h).sort((d,u)=>d-u)}return l.map(c=>({value:c,visible:!0}))}avoidLabelCollisions(t){const{minSpacing:e}=this.label,i=(o,a)=>{if(o.hidden||a.hidden)return!1;if(e==null)return o.box.collidesBBox(a.box);const r=o.box.clone().grow(e/2),l=a.box.clone().grow(e/2);return r.collidesBBox(l)},s=t[0],n=t.at(-1);s!==n&&isNumberEqual(s.x,n.x)&&isNumberEqual(s.y,n.y)&&(n.hidden=!0);for(let o=1;o<t.length;o*=2){let a=!1;for(let r=o;r<t.length;r+=o){const l=t[r],c=t[r-o];if(i(c,l)){a=!0;break}}if(!a){t.forEach((r,l)=>{l%o>0&&(r.hidden=!0,r.box=void 0)});return}}t.forEach((o,a)=>{a>0&&(o.hidden=!0,o.box=void 0)})}};AngleNumberAxis.className="AngleNumberAxis",AngleNumberAxis.type="angle-number",__decorateClass([TempValidate6(AND3(NUMBER_OR_NAN2,LESS_THAN2("max")),{optional:!0})],AngleNumberAxis.prototype,"min",2),__decorateClass([TempValidate6(AND3(NUMBER_OR_NAN2,GREATER_THAN2("min")),{optional:!0})],AngleNumberAxis.prototype,"max",2),__decorateClass([TempValidate6(OBJECT4)],AngleNumberAxis.prototype,"interval",2);var AngleNumberAxisModule={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"angle-number",moduleFactory:t=>new AngleNumberAxis(t)},{OrdinalTimeScale:OrdinalTimeScale2}=module_support_exports,OrdinalTimeAxis=class extends module_support_exports.CategoryAxis{constructor(t){super(t,new OrdinalTimeScale2)}};OrdinalTimeAxis.className="OrdinalTimeAxis",OrdinalTimeAxis.type="ordinal-time";var OrdinalTimeAxisModule={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"ordinal-time",moduleFactory:t=>new OrdinalTimeAxis(t)},{ChartAxisDirection:ChartAxisDirection5,TempValidate:TempValidate7,NUMBER:NUMBER4,getCrossLineValue:getCrossLineValue3,validateCrossLineValue:validateCrossLineValue3,normalizeAngle360:normalizeAngle3604,toRadians:toRadians3,Group:Group4,Path:Path4,Sector:Sector3,RotatableText:RotatableText4}=module_support_exports,RadiusCrossLineLabel=class extends PolarCrossLineLabel{constructor(){super(...arguments),this.positionAngle=void 0}};__decorateClass([TempValidate7(NUMBER4,{optional:!0})],RadiusCrossLineLabel.prototype,"positionAngle",2);var RadiusCrossLine=class extends PolarCrossLine{constructor(){super(),this.direction=ChartAxisDirection5.Y,this.label=new RadiusCrossLineLabel,this.polygonNode=new Path4,this.sectorNode=new Sector3,this.crossLineRange=new Group4,this.labelNode=new RotatableText4,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}=this;if(!e||!this.isValid()||!validateCrossLineValue3(getCrossLineValue3(this),e)){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.updateRadii();const{innerRadius:i,outerRadius:s}=this;t&&(t=i>=this.axisInnerRadius&&s<=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:s,axisOuterRadius:n}=this;if(!e)return{innerRadius:0,outerRadius:0};const o=l=>n+s-l;let a,r;if(i==="line")a=o(e.convert(this.value)),r=a;else{const l=Math.abs(e?.bandwidth??0),c=t.map(h=>e.convert(h));a=o(Math.max(...c)),r=o(Math.min(...c))+l}this.outerRadius=a,this.innerRadius=r}drawPolygon(t,e,i){e.forEach((s,n)=>{const o=t*Math.cos(s),a=t*Math.sin(s);n===0?i.path.moveTo(o,a):i.path.lineTo(o,a)}),i.path.closePath()}updatePolygonNode(t){const{gridAngles:e,polygonNode:i,scale:s,shape:n,type:o,innerRadius:a,outerRadius:r}=this;if(!t||n!=="polygon"||!s||!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=o==="line"?r-l:a+l;this.drawPolygon(h,c,i),this.setSectorNodeProps(i)}updateSectorNode(t){const{axisInnerRadius:e,axisOuterRadius:i,scale:s,sectorNode:n,shape:o,innerRadius:a,outerRadius:r}=this;if(!t||o!=="circle"||!s){n.visible=!1;return}n.visible=!0,n.startAngle=0,n.endAngle=2*Math.PI;const l=this.getPadding(),c=clamp(e,a+l,i),h=clamp(e,r-l,i);n.innerRadius=Math.min(c,h),n.outerRadius=Math.max(c,h),this.setSectorNodeProps(n)}updateLabelNode(t){const{innerRadius:e,label:i,labelNode:s,scale:n,shape:o,type:a}=this;if(!t||i.enabled===!1||!i.text||!n){s.visible=!1;return}const r=normalizeAngle3604(toRadians3((i.positionAngle??0)-90)),l=(isNumberEqual(r,0)||r>0)&&r<Math.PI,c=l?r-Math.PI/2:r+Math.PI/2;let h;const d=this.gridAngles??[];a==="line"?h=e+i.padding:o==="circle"||d.length<3?h=e-i.padding:h=e*Math.cos(Math.PI/d.length)-i.padding;const u=h*Math.cos(r),p=h*Math.sin(r);let g;a==="line"?g=l?"top":"bottom":g=l?"bottom":"top",this.setLabelNodeProps(s,u,p,g,c)}getPadding(){const{scale:t}=this;if(!t)return 0;const e=Math.abs(t.bandwidth??0),i=Math.abs(t.step??0);return t instanceof module_support_exports.BandScale?(i-e)/2:0}};RadiusCrossLine.className="RadiusCrossLine";var{ChartAxisDirection:ChartAxisDirection6,ZIndexMap:ZIndexMap2,NUMBER:NUMBER5,BOOLEAN:BOOLEAN3,TempValidate:TempValidate8,normalizeAngle360:normalizeAngle3605,toRadians:toRadians4,Caption:Caption2,Group:Group5,Path:Path5,Line:Line2,Selection:Selection2,AxisTickGenerator:AxisTickGenerator2,AxisGroupZIndexMap:AxisGroupZIndexMap2}=module_support_exports,RadiusAxisLabel=class extends module_support_exports.AxisLabel{constructor(){super(...arguments),this.autoRotateAngle=335}};__decorateClass([TempValidate8(BOOLEAN3,{optional:!0})],RadiusAxisLabel.prototype,"autoRotate",2),__decorateClass([TempValidate8(NUMBER5)],RadiusAxisLabel.prototype,"autoRotateAngle",2);var RadiusAxis=class extends module_support_exports.PolarAxis{constructor(t,e){super(t,e),this.positionAngle=0,this.tickGenerator=new AxisTickGenerator2(this),this.generatedTicks=void 0,this.lineNode=this.axisGroup.appendChild(new Line2({name:`${this.id}-Axis-line`,zIndex:AxisGroupZIndexMap2.AxisLine})),this.gridPathGroup=this.gridGroup.appendChild(new Group5({name:`${this.id}-gridPaths`,zIndex:ZIndexMap2.AXIS_GRID})),this.gridPathSelection=Selection2.select(this.gridPathGroup,Path5),this.axisGroup.appendChild(this.title.caption.node),this.destroyFns.push(this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}get direction(){return ChartAxisDirection6.Y}getAxisTransform(){const t=this.scale.range[0],{translation:e,positionAngle:i,innerRadiusRatio:s}=this,n=t*s,o=toRadians4(i);return{translationX:e.x,translationY:e.y-t-n,rotation:o,rotationCenterX:0,rotationCenterY:t+n}}update(){super.update(),this.updateTitle();const{enabled:t,stroke:e,width:i}=this.line;this.lineNode.setProperties({stroke:e,strokeWidth:t?i:0,x1:0,y1:this.range[0],x2:0,y2:this.range[1]})}calculateTickLayout(t,e,i,s){const{parallelFlipRotation:n,regularFlipRotation:o}=this.calculateRotations(),a=[0,1],r=this.label.getSideFlag(),l=r*(this.getTickSize()+this.label.spacing+this.seriesAreaPadding),c=this.tickGenerator.generateTicks({domain:t,niceMode:e,visibleRange:a,primaryTickCount:s,parallelFlipRotation:n,regularFlipRotation:o,labelX:l,sideFlag:r}),{tickData:h,primaryTickCount:d=s}=c,{ticks:u,rawTicks:p,tickDomain:g,fractionDigits:f,niceDomain:m=t}=h,y=u.map(x=>this.getTickLabelProps(x,c));return this.generatedTicks={ticks:u,labels:y},{ticks:p,tickDomain:g,niceDomain:m,primaryTickCount:d,fractionDigits:f}}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=module_support_exports.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:s}=this;if(!t||!s)return;const n=t.length,o=(u,p)=>{const{stroke:g,lineDash:f}=t[p%n];u.stroke=g,u.strokeWidth=e,u.lineDash=f,u.fill=void 0},[a,r]=this.gridRange??[0,2*Math.PI],l=isNumberEqual(r-a,2*Math.PI),d=i==="circle"?(u,p)=>{const{path:g}=u;g.clear(!0);const f=this.getTickRadius(p);l?(g.moveTo(f,0),g.arc(0,0,f,0,2*Math.PI)):(g.moveTo(f*Math.cos(a),f*Math.sin(a)),g.arc(0,0,f,normalizeAngle3605(a),normalizeAngle3605(r))),l&&g.closePath()}:(u,p)=>{const{path:g}=u,f=this.gridAngles;if(g.clear(!0),!f||f.length<3)return;const m=this.getTickRadius(p);f.forEach((y,x)=>{const b=m*Math.cos(y),S=m*Math.sin(y);x===0?g.moveTo(b,S):g.lineTo(b,S),f.forEach((v,I)=>{const A=m*Math.cos(v),D=m*Math.sin(v);I===0?g.moveTo(A,D):g.lineTo(A,D)}),g.closePath()}),g.closePath()};this.gridPathSelection.each((u,p,g)=>{o(u,g),d(u,p)})}updateTitle(){const t=r=>r.defaultValue,{title:e,range:i,moduleCtx:{callbackCache:s}}=this,{formatter:n=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 o=!1;const a=e.caption.node;e.enabled&&(o=!0,a.rotation=Math.PI/2,a.x=Math.floor((i[0]+i[1])/2),a.y=-Caption2.SMALL_PADDING,a.textAlign="center",a.textBaseline="bottom",a.text=s.call(this,n,this.getTitleFormatterParams(this.scale.domain))),a.visible=o}updateCrossLines(){this.crossLines.forEach(t=>{if(t instanceof RadiusCrossLine){const{shape:e,gridAngles:i,range:s,innerRadiusRatio:n}=this,o=s[0];t.shape=e,t.gridAngles=i,t.axisOuterRadius=o,t.axisInnerRadius=o*n}}),super.updateCrossLines()}createLabel(){return new RadiusAxisLabel}getTickLabelProps(t,e){const{label:i}=this,{combinedRotation:s,textBaseline:n,textAlign:o}=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:s,rotationCenterX:c,translationY:t.translationY,text:r,textAlign:o,textBaseline:n,visible:h,x:c,y:0,range:a}}};RadiusAxis.CrossLineConstructor=RadiusCrossLine,__decorateClass([TempValidate8(NUMBER5)],RadiusAxis.prototype,"positionAngle",2);var{RATIO:RATIO4,ProxyPropertyOnWrite:ProxyPropertyOnWrite2,TempValidate:TempValidate9,CategoryScale:CategoryScale3}=module_support_exports,RadiusCategoryAxis=class extends RadiusAxis{constructor(t){super(t,new CategoryScale3),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,s=e.range[0],n=s*i;if(CategoryScale3.is(e)){const o=e.domain,a=o.length-1-o.indexOf(t.tick);return a===0?n:e.inset+e.step*(a-.5)+e.bandwidth/2}else{const o=(s-n)/e.domain.length;return s-t.translationY+n-o/2}}};RadiusCategoryAxis.className="RadiusCategoryAxis",RadiusCategoryAxis.type="radius-category",__decorateClass([TempValidate9(RATIO4)],RadiusCategoryAxis.prototype,"groupPaddingInner",2),__decorateClass([ProxyPropertyOnWrite2("scale","paddingInner"),TempValidate9(RATIO4)],RadiusCategoryAxis.prototype,"paddingInner",2),__decorateClass([ProxyPropertyOnWrite2("scale","paddingOuter"),TempValidate9(RATIO4)],RadiusCategoryAxis.prototype,"paddingOuter",2);var RadiusCategoryAxisModule={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radius-category",moduleFactory:t=>new RadiusCategoryAxis(t)},{AND:AND4,GREATER_THAN:GREATER_THAN3,LESS_THAN:LESS_THAN3,NUMBER_OR_NAN:NUMBER_OR_NAN3,TempValidate:TempValidate10,normalisedExtentWithMetadata:normalisedExtentWithMetadata3,LinearScale:LinearScale3}=module_support_exports,RadiusNumberAxis=class extends RadiusAxis{constructor(t){super(t,new LinearScale3),this.shape="polygon"}prepareGridPathTickData(t){const{scale:e}=this,i=e.domain[1];return t.filter(({tick:s})=>s!==i).sort((s,n)=>n.tick-s.tick)}getTickRadius(t){const{scale:e}=this,i=e.range[0],s=i*this.innerRadiusRatio;return i-t.translationY+s}normaliseDataDomain(t){const{min:e,max:i}=this,{extent:s,clipped:n}=normalisedExtentWithMetadata3(t,e,i);return{domain:s,clipped:n}}};RadiusNumberAxis.className="RadiusNumberAxis",RadiusNumberAxis.type="radius-number",__decorateClass([TempValidate10(AND4(NUMBER_OR_NAN3,LESS_THAN3("max")),{optional:!0})],RadiusNumberAxis.prototype,"min",2),__decorateClass([TempValidate10(AND4(NUMBER_OR_NAN3,GREATER_THAN3("min")),{optional:!0})],RadiusNumberAxis.prototype,"max",2);var RadiusNumberAxisModule={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radius-number",moduleFactory:t=>new RadiusNumberAxis(t)},{BOOLEAN:BOOLEAN4,POSITIVE_NUMBER:POSITIVE_NUMBER4,ObserveChanges:ObserveChanges2,TempValidate:TempValidate11}=module_support_exports,Animation2=class extends module_support_exports.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!0,t.animationManager.skip(!1),this.destroyFns.push(()=>{t.animationManager.skip(!0)})}};__decorateClass([ObserveChanges2((t,e)=>{t.ctx.animationManager.skip(!e)}),TempValidate11(BOOLEAN4)],Animation2.prototype,"enabled",2),__decorateClass([ObserveChanges2((t,e)=>{t.ctx.animationManager.defaultDuration=e}),TempValidate11(POSITIVE_NUMBER4,{optional:!0})],Animation2.prototype,"duration",2);var AnimationModule={type:"root",optionsKey:"animation",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new Animation2(t),themeTemplate:{animation:{enabled:!0}}},textInputTemplate_default='<div contenteditable="plaintext-only" class="ag-charts-text-input__textarea" tabindex="0"></div>',{focusCursorAtEnd:focusCursorAtEnd2}=module_support_exports,moduleId="text-input",canvasOverlay2="canvas-overlay",TextInput=class extends module_support_exports.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(canvasOverlay2,moduleId),this.element.classList.add("ag-charts-text-input"),this.destroyFns.push(()=>t.domManager.removeChild(canvasOverlay2,moduleId))}setKeyDownHandler(t){this.element.addEventListener("keydown",t),this.destroyFns.push(()=>this.element.removeEventListener("keydown",t))}show(t){this.element.innerHTML=textInputTemplate_default;const e=this.element.firstElementChild;module_support_exports.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",focusCursorAtEnd2(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:s,getTextInputCoords:n,getTextPosition:o,alignment:a,textAlign:r}=this.layout;t.style.setProperty("width",s?`${s}px`:"unset");const l=e.getBoundingClientRect(),c=n(l.height);let h=c.x;a==="center"?h-=(s??l.width)/2:a==="right"&&(h-=s??l.width);const d=o();let u=c.y;d==="center"?u-=l.height/2:d==="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:s}=this.element.getBoundingClientRect();return new module_support_exports.BBox(t,e,i,s)}},{BOOLEAN:BOOLEAN5,BaseProperties:BaseProperties3,TempValidate:TempValidate12,UNION:UNION4}=module_support_exports,AXIS_TYPE=UNION4(["x","y","xy"],"an axis type"),AxesButtons=class extends BaseProperties3{constructor(){super(...arguments),this.enabled=!1,this.axes="y"}};__decorateClass([TempValidate12(BOOLEAN5)],AxesButtons.prototype,"enabled",2),__decorateClass([TempValidate12(AXIS_TYPE,{optional:!0})],AxesButtons.prototype,"axes",2);var AnnotationType=(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))(AnnotationType||{}),ANNOTATION_TYPES=Object.values(AnnotationType);function stringToAnnotationType(t){for(const e of ANNOTATION_TYPES)if(e===t)return e}var{BOOLEAN:BOOLEAN6,COLOR_STRING:COLOR_STRING3,DATE:DATE2,FONT_STYLE:FONT_STYLE3,FONT_WEIGHT:FONT_WEIGHT3,FUNCTION:FUNCTION2,LINE_DASH:LINE_DASH3,LINE_STYLE:LINE_STYLE2,NUMBER:NUMBER6,OBJECT:OBJECT5,OR:OR3,POSITIVE_NUMBER:POSITIVE_NUMBER5,RATIO:RATIO5,STRING:STRING3,TEXT_ALIGN:TEXT_ALIGN2,UNION:UNION5,BaseProperties:BaseProperties4,TempValidate:TempValidate13,predicateWithMessage:predicateWithMessage2,generateUUID:generateUUID2}=module_support_exports,GROUPING_VALUE_KEYS=["value","groupPercentage"],GROUPING_VALUE=predicateWithMessage2(t=>isObject(t)&&Object.keys(t).every(e=>GROUPING_VALUE_KEYS.includes(e)),"objects with grouping value properties such as 'value' or 'groupPercentage'"),PointProperties=class extends BaseProperties4{};__decorateClass([TempValidate13(OR3(STRING3,NUMBER6,DATE2,GROUPING_VALUE))],PointProperties.prototype,"x",2),__decorateClass([TempValidate13(OR3(STRING3,NUMBER6,DATE2,GROUPING_VALUE))],PointProperties.prototype,"y",2);var ChannelAnnotationMiddleProperties=class extends Stroke(LineStyle(Visible(BaseProperties4))){},AxisLabelProperties=class extends Stroke(LineStyle(Fill(Label2(Font(BaseProperties4))))){constructor(){super(...arguments),this.cornerRadius=2}};__decorateClass([TempValidate13(BOOLEAN6)],AxisLabelProperties.prototype,"enabled",2),__decorateClass([TempValidate13(POSITIVE_NUMBER5)],AxisLabelProperties.prototype,"cornerRadius",2);var BackgroundProperties=class extends Fill(BaseProperties4){},HandleProperties=class extends Stroke(LineStyle(Fill(BaseProperties4))){},LineTextProperties=class extends Font(BaseProperties4){constructor(){super(...arguments),this.label="",this.position="top",this.alignment="left"}};__decorateClass([TempValidate13(STRING3)],LineTextProperties.prototype,"label",2),__decorateClass([TempValidate13(UNION5(["top","center","bottom"]),{optional:!0})],LineTextProperties.prototype,"position",2),__decorateClass([TempValidate13(UNION5(["left","center","right"]),{optional:!0})],LineTextProperties.prototype,"alignment",2);var LabelTextProperties=class extends Font(BaseProperties4){},ChannelTextProperties=class extends Font(BaseProperties4){constructor(){super(...arguments),this.label=""}};__decorateClass([TempValidate13(STRING3)],ChannelTextProperties.prototype,"label",2),__decorateClass([TempValidate13(UNION5(["top","inside","bottom"]),{optional:!0})],ChannelTextProperties.prototype,"position",2),__decorateClass([TempValidate13(UNION5(["left","center","right"]),{optional:!0})],ChannelTextProperties.prototype,"alignment",2);function Annotation(t){class e extends Lockable(Visible(t)){constructor(){super(...arguments),this.id=generateUUID2()}isValidWithContext(s,n){return super.isValid(n)}}return e}function Line3(t){class e extends t{constructor(){super(...arguments),this.start=new PointProperties,this.end=new PointProperties}}return __decorateClass([TempValidate13(OBJECT5)],e.prototype,"start",2),__decorateClass([TempValidate13(OBJECT5)],e.prototype,"end",2),e}function Point(t){class e extends t{}return __decorateClass([TempValidate13(OR3(STRING3,NUMBER6,DATE2,GROUPING_VALUE))],e.prototype,"x",2),__decorateClass([TempValidate13(OR3(STRING3,NUMBER6,DATE2,GROUPING_VALUE))],e.prototype,"y",2),e}function Value(t){class e extends t{}return __decorateClass([TempValidate13(OR3(STRING3,NUMBER6,DATE2,GROUPING_VALUE))],e.prototype,"value",2),e}function Background2(t){class e extends t{constructor(){super(...arguments),this.background=new BackgroundProperties}}return __decorateClass([TempValidate13(OBJECT5,{optional:!0})],e.prototype,"background",2),e}function Handle(t){class e extends t{constructor(){super(...arguments),this.handle=new HandleProperties}}return __decorateClass([TempValidate13(OBJECT5,{optional:!0})],e.prototype,"handle",2),e}function AxisLabel2(t){class e extends t{constructor(){super(...arguments),this.axisLabel=new AxisLabelProperties}}return __decorateClass([TempValidate13(OBJECT5,{optional:!0})],e.prototype,"axisLabel",2),e}function Label2(t){class e extends t{constructor(){super(...arguments),this.padding=void 0,this.textAlign="center",this.formatter=void 0}}return __decorateClass([TempValidate13(POSITIVE_NUMBER5,{optional:!0})],e.prototype,"padding",2),__decorateClass([TempValidate13(TEXT_ALIGN2,{optional:!0})],e.prototype,"textAlign",2),__decorateClass([TempValidate13(FUNCTION2,{optional:!0})],e.prototype,"formatter",2),e}function Cappable(t){class e extends t{}return e}function Extendable(t){class e extends t{}return __decorateClass([TempValidate13(BOOLEAN6,{optional:!0})],e.prototype,"extendStart",2),__decorateClass([TempValidate13(BOOLEAN6,{optional:!0})],e.prototype,"extendEnd",2),e}function Lockable(t){class e extends t{}return __decorateClass([TempValidate13(BOOLEAN6,{optional:!0})],e.prototype,"locked",2),e}function Localisable(t){class e extends t{setLocaleManager(s){this.localeManager??(this.localeManager=s)}}return e}function Visible(t){class e extends t{}return __decorateClass([TempValidate13(BOOLEAN6,{optional:!0})],e.prototype,"visible",2),e}function Fill(t){class e extends t{}return __decorateClass([TempValidate13(COLOR_STRING3,{optional:!0})],e.prototype,"fill",2),__decorateClass([TempValidate13(RATIO5,{optional:!0})],e.prototype,"fillOpacity",2),e}function Stroke(t){class e extends t{}return __decorateClass([TempValidate13(COLOR_STRING3,{optional:!0})],e.prototype,"stroke",2),__decorateClass([TempValidate13(RATIO5,{optional:!0})],e.prototype,"strokeOpacity",2),__decorateClass([TempValidate13(NUMBER6,{optional:!0})],e.prototype,"strokeWidth",2),e}function LineStyle(t){class e extends t{constructor(){super(...arguments),this.lineCap=void 0,this.computedLineDash=void 0}}return __decorateClass([TempValidate13(LINE_DASH3,{optional:!0})],e.prototype,"lineDash",2),__decorateClass([TempValidate13(NUMBER6,{optional:!0})],e.prototype,"lineDashOffset",2),__decorateClass([TempValidate13(LINE_STYLE2,{optional:!0})],e.prototype,"lineStyle",2),e}function Font(t){class e extends t{constructor(){super(...arguments),this.fontSize=12,this.fontFamily="Verdana, sans-serif"}}return __decorateClass([TempValidate13(FONT_STYLE3,{optional:!0})],e.prototype,"fontStyle",2),__decorateClass([TempValidate13(FONT_WEIGHT3,{optional:!0})],e.prototype,"fontWeight",2),__decorateClass([TempValidate13(POSITIVE_NUMBER5)],e.prototype,"fontSize",2),__decorateClass([TempValidate13(STRING3)],e.prototype,"fontFamily",2),__decorateClass([TempValidate13(COLOR_STRING3,{optional:!0})],e.prototype,"color",2),e}function getGrouping(t){return isNumber(t)||isString(t)||isDate(t)?{value:t,groupPercentage:0}:t??{value:void 0,groupPercentage:0}}function getGroupingValue(t){return getGrouping(t)?.value}var{clampArray:clampArray2}=module_support_exports;function convertLine(t,e){if(t.start==null||t.end==null)return;const i=convertPoint(t.start,e),s=convertPoint(t.end,e);if(!(i==null||s==null))return{x1:i.x,y1:i.y,x2:s.x,y2:s.y}}function convertPoint(t,e){const i=convert(t.x,e.xAxis),s=convert(t.y,e.yAxis);return{x:i,y:s}}function convert(t,e){if(t==null)return 0;const{value:i,groupPercentage:s}=getGrouping(t),{scale:n,snapToGroup:o}=e,a=n.bandwidth===0?n.step??0:n.bandwidth??0,r=o?a/2:a*s;return n.convert(i)+r}function invertCoords(t,e){const i=invert(t.x,e.xAxis),s=invert(t.y,e.yAxis);return{x:i,y:s}}function invert(t,e){const{scale:i}=e;if(e.continuous&&i.step==null)return e.scaleInvert(t);const s=e.scaleInvertNearest(t),n=i.bandwidth===0?i.step:i.bandwidth??0,o=i.convert(s),a=o+n,r=clampArray2(t,i.range),l=o===a?0:(r-o)/(a-o);return{value:s,groupPercentage:l}}var{BaseProperties:BaseProperties5}=module_support_exports,StartEndProperties=class extends Annotation(Line3(Handle(BaseProperties5))){constructor(){super(...arguments),this.snapToAngle=45}isValidWithContext(t,e){return super.isValid(e)}getDefaultColor(t){}getDefaultOpacity(t){}},{STRING:STRING4,TempValidate:TempValidate14}=module_support_exports,TextualStartEndProperties=class extends Localisable(Label2(Font(StartEndProperties))){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 convertPoint(this.end,t)}getTextPosition(){return this.position}};__decorateClass([TempValidate14(STRING4)],TextualStartEndProperties.prototype,"text",2);var{STRING:STRING5,TempValidate:TempValidate15,Color:Color2}=module_support_exports,DEFAULT_CALLOUT_PADDING={top:6,right:12,bottom:9,left:12},CalloutProperties=class extends Fill(Stroke(TextualStartEndProperties)){constructor(){super(...arguments),this.type="callout",this.position="bottom",this.alignment="left"}static is(t){return isObject(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}=Color2.fromString(this.color??"#888888");return new Color2(t,e,i,.66).toString()}getPadding(){const{padding:t}=this;return t==null?{...DEFAULT_CALLOUT_PADDING}:{top:t,right:t,bottom:t,left:t}}getTextInputCoords(t,e){const i=super.getTextInputCoords(t,e),s=this.getPadding(),n=s.left??0,o=s.bottom??0;return{x:i.x+n,y:i.y-o}}};__decorateClass([TempValidate15(STRING5)],CalloutProperties.prototype,"type",2);var{STRING:STRING6,BaseProperties:BaseProperties6,TempValidate:TempValidate16}=module_support_exports,TextualPointProperties=class extends Annotation(Point(Handle(Label2(Font(BaseProperties6))))){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 convertPoint(this,t)}getTextPosition(){return this.position}};__decorateClass([TempValidate16(STRING6)],TextualPointProperties.prototype,"text",2);var{STRING:STRING7,TempValidate:TempValidate17,Color:Color3}=module_support_exports,DEFAULT_COMMENT_PADDING={top:8,right:14,bottom:8,left:14},CommentProperties=class extends Fill(Stroke(TextualPointProperties)){constructor(){super(...arguments),this.type="comment",this.position="bottom",this.alignment="left"}static is(t){return isObject(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}=Color3.fromString(this.color??"#888888");return new Color3(t,e,i,.66).toString()}getPadding(){const{padding:t,fontSize:e}=this;return t==null?{top:Math.max(e*.4,DEFAULT_COMMENT_PADDING.top),bottom:Math.max(e*.4,DEFAULT_COMMENT_PADDING.bottom),left:Math.max(e*.8,DEFAULT_COMMENT_PADDING.left),right:Math.max(e*.8,DEFAULT_COMMENT_PADDING.right)}:{top:t,right:t,bottom:t,left:t}}getTextInputCoords(t,e){const i=super.getTextInputCoords(t,e),s=this.getPadding();return{x:i.x+s.left,y:i.y-s.bottom}}};__decorateClass([TempValidate17(STRING7)],CommentProperties.prototype,"type",2);var{Vec2:Vec22}=module_support_exports;function getLineStyle(t,e){return t?"dashed":e??"solid"}function getComputedLineDash(t,e){switch(e){case"solid":return[];case"dashed":return[t*4,t*2];case"dotted":return[0,t*2]}}function getLineDash(t,e,i,s){const n=getLineStyle(t,i);return e??t??getComputedLineDash(s??1,n)}function getLineCap(t,e,i){const s=getLineStyle(e,i);return t??s==="dotted"?"round":void 0}function boundsIntersections(t,e){const[i,s]=Vec22.from(t),n=e.height,o=Vec22.gradient(s,i,n),a=Vec22.intercept(s,o,n),r=[{x:i.x,y:n??0},{x:i.x,y:n==null?e.height:n-e.height}];if(o===1/0)return r;let l=[Vec22.intersectAtY(o,a,0,n),Vec22.intersectAtY(o,a,e.height,n),Vec22.intersectAtX(o,a,0,n),Vec22.intersectAtX(o,a,e.width,n)];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<h.x?-1:1),l.length!==2?r:l}var{BOOLEAN:BOOLEAN7,OBJECT:OBJECT6,STRING:STRING8,BaseProperties:BaseProperties7,TempValidate:TempValidate18}=module_support_exports,MeasurerStatisticsDivider=class extends Stroke(BaseProperties7){},MeasurerStatistics=class extends Font(Fill(Stroke(BaseProperties7))){constructor(){super(...arguments),this.divider=new MeasurerStatisticsDivider}};__decorateClass([TempValidate18(OBJECT6,{optional:!0})],MeasurerStatistics.prototype,"divider",2);var MeasurerDirectionProperties=class extends Fill(Stroke(Handle(BaseProperties7))){constructor(){super(...arguments),this.statistics=new MeasurerStatistics}};__decorateClass([TempValidate18(OBJECT6,{optional:!0})],MeasurerDirectionProperties.prototype,"statistics",2);var MeasurerTypeProperties=class extends Localisable(Background2(Stroke(LineStyle(StartEndProperties)))){constructor(){super(...arguments),this.direction="both",this.hasDateRange=!1,this.hasPriceRange=!1,this.statistics=new MeasurerStatistics,this.getVolume=()=>{},this.text=new LineTextProperties}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 getLineDash(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return getLineCap(this.lineCap,this.lineDash,this.lineStyle)}};__decorateClass([TempValidate18(OBJECT6,{optional:!0})],MeasurerTypeProperties.prototype,"statistics",2),__decorateClass([TempValidate18(OBJECT6,{optional:!0})],MeasurerTypeProperties.prototype,"text",2);function DateRange(t){class e extends t{constructor(){super(...arguments),this.hasDateRange=!0}}return e}function PriceRange(t){class e extends t{constructor(){super(...arguments),this.hasPriceRange=!0}}return e}var DateRangeProperties=class extends DateRange(MeasurerTypeProperties){constructor(){super(...arguments),this.type="date-range",this.direction="horizontal"}static is(t){return isObject(t)&&t.type==="date-range"}};__decorateClass([TempValidate18(STRING8)],DateRangeProperties.prototype,"type",2),__decorateClass([TempValidate18(BOOLEAN7,{optional:!0})],DateRangeProperties.prototype,"extendAbove",2),__decorateClass([TempValidate18(BOOLEAN7,{optional:!0})],DateRangeProperties.prototype,"extendBelow",2);var PriceRangeProperties=class extends PriceRange(MeasurerTypeProperties){constructor(){super(...arguments),this.type="price-range",this.direction="vertical"}static is(t){return isObject(t)&&t.type==="price-range"}};__decorateClass([TempValidate18(STRING8)],PriceRangeProperties.prototype,"type",2),__decorateClass([TempValidate18(BOOLEAN7,{optional:!0})],PriceRangeProperties.prototype,"extendLeft",2),__decorateClass([TempValidate18(BOOLEAN7,{optional:!0})],PriceRangeProperties.prototype,"extendRight",2);var DatePriceRangeProperties=class extends DateRange(PriceRange(MeasurerTypeProperties)){constructor(){super(...arguments),this.type="date-price-range",this.direction="both"}static is(t){return isObject(t)&&t.type==="date-price-range"}};__decorateClass([TempValidate18(STRING8)],DatePriceRangeProperties.prototype,"type",2);var QuickDatePriceRangeProperties=class extends DateRange(PriceRange(MeasurerTypeProperties)){constructor(){super(...arguments),this.type="quick-date-price-range",this.up=new MeasurerDirectionProperties,this.down=new MeasurerDirectionProperties,this.direction="both"}static is(t){return isObject(t)&&t.type==="quick-date-price-range"}};__decorateClass([TempValidate18(STRING8)],QuickDatePriceRangeProperties.prototype,"type",2),__decorateClass([TempValidate18(OBJECT6,{optional:!0})],QuickDatePriceRangeProperties.prototype,"up",2),__decorateClass([TempValidate18(OBJECT6,{optional:!0})],QuickDatePriceRangeProperties.prototype,"down",2);var{TextWrapper:TextWrapper3,CachedTextMeasurerPool:CachedTextMeasurerPool2,BBox:BBox3}=module_support_exports,ANNOTATION_TEXT_LINE_HEIGHT=1.38;function getTextWrapOptions(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:ANNOTATION_TEXT_LINE_HEIGHT,avoidOrphans:!1,textWrap:"always"}}function wrapText(t,e,i){return i?TextWrapper3.wrapText(e,{...getTextWrapOptions(t),maxWidth:i}):e}function measureAnnotationText(t,e){const i=getTextWrapOptions(t),{lineMetrics:s,width:n}=CachedTextMeasurerPool2.measureLines(e,i),o=s.length*(t.fontSize??14)*ANNOTATION_TEXT_LINE_HEIGHT;return{width:n,height:o}}function getBBox(t,e,i,s){let n=s?.width??0,o=s?.height??0;if(!s){const a=t.width!=null?wrapText(t,e,t.width):e;({width:n,height:o}=measureAnnotationText(t,a))}return new BBox3(i.x,i.y,n,o)}function updateTextNode(t,e,i,s,{x:n,y:o},a){const{visible:r=!0,fontFamily:l,fontSize:c=14,fontStyle:h,fontWeight:d,textAlign:u}=s,p=c*ANNOTATION_TEXT_LINE_HEIGHT;a??(a=s.position=="center"?"middle":s.position);const g=i?s.getPlaceholderColor():s.color;t.setProperties({x:n,y:o,visible:r,text:e,fill:g,fontFamily:l,fontSize:c,fontStyle:h,fontWeight:d,textAlign:u,lineHeight:p,textBaseline:a})}var{OBJECT:OBJECT7,STRING:STRING9,BaseProperties:BaseProperties8,TempValidate:TempValidate19}=module_support_exports,DEFAULT_NOTE_PADDING=10,HANDLE_SIZE=11,ICON_HEIGHT=20,ICON_WIDTH=22,ICON_SPACING=10,LABEL_OFFSET=ICON_HEIGHT+ICON_SPACING,TOOLBAR_OFFSET=34,NoteBackgroundProperties=class extends Fill(Stroke(BaseProperties8)){},NoteProperties=class extends Fill(Stroke(TextualPointProperties)){constructor(){super(...arguments),this.type="note",this.background=new NoteBackgroundProperties,this.position="bottom",this.alignment="center",this.width=200}static is(t){return isObject(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??DEFAULT_NOTE_PADDING;return{top:t,right:t,bottom:t,left:t}}getTextInputCoords(t,e){const{width:i,text:s}=this,n=super.getTextInputCoords(t,e),o=this.getPadding().top,a=getBBox(this,s,n);a.x=clamp(i/2,a.x,t.seriesRect.width-i/2);const r=a.y-LABEL_OFFSET-o*2,l=a.y+HANDLE_SIZE+o*2,c=Math.max(a.height,e);return r-c-TOOLBAR_OFFSET<0?(a.y=l,this.position="top"):(a.y=r+o,this.position="bottom"),{x:a.x,y:a.y}}};__decorateClass([TempValidate19(STRING9)],NoteProperties.prototype,"type",2),__decorateClass([TempValidate19(OBJECT7,{optional:!0})],NoteProperties.prototype,"background",2);var{BaseProperties:BaseProperties9}=module_support_exports,PointProperties2=class extends Annotation(Point(Handle(BaseProperties9))){isValidWithContext(t,e){return super.isValid(e)}getDefaultColor(t){}getDefaultOpacity(t){}},ShapePointProperties=class oe extends Fill(PointProperties2){constructor(){super(...arguments),this.size=32}static is(e){return e instanceof oe}getDefaultColor(e){return e==="fill-color"?this.fill:void 0}getDefaultOpacity(e){return e==="fill-color"?this.fillOpacity:void 0}},{ContinuousScale:ContinuousScale3}=module_support_exports;function validateDatumLine(t,e,i={overflowContinuous:!1},s){let n=!0;return n&&(n=validateDatumPoint(t,e.start,i,s&&`${s}[start] `)),n&&(n=validateDatumPoint(t,e.end,i,s&&`${s}[end] `)),n}function validateDatumValue(t,e,i){const s=e.direction==="horizontal"?t.yAxis:t.xAxis,n=validateDatumPointDirection(e.value,s);if(!n&&i){const o=getGroupingValue(e.value);logger_exports.warnOnce(`${i}is outside the axis domain, ignoring. - value: [${o}]]`)}return n}function validateDatumPoint(t,e,i={overflowContinuous:!1},s){if(e.x==null||e.y==null)return s&&logger_exports.warnOnce(`${s}requires both an [x] and [y] property, ignoring.`),!1;const{xAxis:n,yAxis:o}=t,a=i.overflowContinuous&&ContinuousScale3.is(n.scale),r=i.overflowContinuous&&ContinuousScale3.is(o.scale),l=a||validateDatumPointDirection(e.x,n),c=r||validateDatumPointDirection(e.y,o);if(l&&c)return!0;if(s){let h="x & y domains";l&&(h="y domain"),c&&(h="x domain");const d=getGroupingValue(e.x),u=getGroupingValue(e.y);logger_exports.warnOnce(`${s}is outside the ${h}, ignoring. - x: [${d}], y: ${u}]`)}return!1}function validateDatumPointDirection(t,e){const{domain:i}=e.scale,s=getGroupingValue(t);return i&&s!=null&&e.continuous?s>=i[0]&&s<=i.at(-1):!0}var{OBJECT:OBJECT8,STRING:STRING10,BaseProperties:BaseProperties10,TempValidate:TempValidate20}=module_support_exports,HorizontalLineProperties=class extends Annotation(Value(Handle(AxisLabel2(Stroke(LineStyle(BaseProperties10)))))){constructor(){super(...arguments),this.direction="horizontal",this.type="horizontal-line",this.text=new LineTextProperties}static is(t){return isObject(t)&&t.type==="horizontal-line"}isValidWithContext(t,e){return super.isValid(e)&&validateDatumValue(t,this,e)}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return getLineDash(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return getLineCap(this.lineCap,this.lineDash,this.lineStyle)}};__decorateClass([TempValidate20(STRING10)],HorizontalLineProperties.prototype,"type",2),__decorateClass([TempValidate20(OBJECT8,{optional:!0})],HorizontalLineProperties.prototype,"text",2);var VerticalLineProperties=class extends Annotation(Value(Handle(AxisLabel2(Stroke(LineStyle(BaseProperties10)))))){constructor(){super(...arguments),this.direction="vertical",this.type="vertical-line",this.text=new LineTextProperties}static is(t){return isObject(t)&&t.type==="vertical-line"}isValidWithContext(t,e){return super.isValid(e)&&validateDatumValue(t,this,e)}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return getLineDash(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return getLineCap(this.lineCap,this.lineDash,this.lineStyle)}};__decorateClass([TempValidate20(STRING10)],VerticalLineProperties.prototype,"type",2),__decorateClass([TempValidate20(OBJECT8,{optional:!0})],VerticalLineProperties.prototype,"text",2);var{NUMBER:NUMBER7,OBJECT:OBJECT9,STRING:STRING11,BaseProperties:BaseProperties11,TempValidate:TempValidate21}=module_support_exports,DisjointChannelProperties=class extends Annotation(Background2(Line3(Handle(Extendable(Stroke(LineStyle(BaseProperties11))))))){constructor(){super(...arguments),this.type="disjoint-channel",this.text=new ChannelTextProperties,this.snapToAngle=45}static is(t){return isObject(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):logger_exports.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),t}isValidWithContext(t,e){return super.isValid(e)&&validateDatumLine(t,this,{overflowContinuous:!0},e)&&validateDatumLine(t,this.bottom,{overflowContinuous:!0},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 getLineDash(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return getLineCap(this.lineCap,this.lineDash,this.lineStyle)}};__decorateClass([TempValidate21(STRING11)],DisjointChannelProperties.prototype,"type",2),__decorateClass([TempValidate21(NUMBER7)],DisjointChannelProperties.prototype,"startHeight",2),__decorateClass([TempValidate21(NUMBER7)],DisjointChannelProperties.prototype,"endHeight",2),__decorateClass([TempValidate21(OBJECT9,{optional:!0})],DisjointChannelProperties.prototype,"text",2);var{OBJECT:OBJECT10,STRING:STRING12,TempValidate:TempValidate22}=module_support_exports,LineTypeProperties=class extends Localisable(Cappable(Extendable(Stroke(LineStyle(StartEndProperties))))){constructor(){super(...arguments),this.text=new LineTextProperties}isValidWithContext(t,e){return super.isValid(e)&&validateDatumLine(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 getLineDash(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return getLineCap(this.lineCap,this.lineDash,this.lineStyle)}};__decorateClass([TempValidate22(OBJECT10,{optional:!0})],LineTypeProperties.prototype,"text",2);var ArrowProperties=class extends LineTypeProperties{constructor(){super(...arguments),this.type="arrow",this.endCap="arrow"}static is(t){return isObject(t)&&t.type==="arrow"}};__decorateClass([TempValidate22(STRING12)],ArrowProperties.prototype,"type",2);var LineProperties=class extends LineTypeProperties{constructor(){super(...arguments),this.type="line"}static is(t){return isObject(t)&&t.type==="line"}};__decorateClass([TempValidate22(STRING12)],LineProperties.prototype,"type",2);var{OBJECT:OBJECT11,BOOLEAN:BOOLEAN8,COLOR_STRING:COLOR_STRING4,COLOR_STRING_ARRAY:COLOR_STRING_ARRAY3,TempValidate:TempValidate23,predicateWithMessage:predicateWithMessage3}=module_support_exports,fibonacciBands=[10,6,4],FIBONACCI_BANDS=predicateWithMessage3(t=>isFiniteNumber(t)&&fibonacciBands.includes(t),"Number of fibonacci ranges, 10, 6 or 4"),FibonacciProperties=class extends LineTypeProperties{constructor(){super(...arguments),this.label=new LabelTextProperties,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}}};__decorateClass([TempValidate23(OBJECT11,{optional:!0})],FibonacciProperties.prototype,"label",2),__decorateClass([TempValidate23(BOOLEAN8,{optional:!0})],FibonacciProperties.prototype,"reverse",2),__decorateClass([TempValidate23(BOOLEAN8,{optional:!0})],FibonacciProperties.prototype,"showFill",2),__decorateClass([TempValidate23(BOOLEAN8,{optional:!0})],FibonacciProperties.prototype,"isMultiColor",2),__decorateClass([TempValidate23(COLOR_STRING_ARRAY3,{optional:!0})],FibonacciProperties.prototype,"strokes",2),__decorateClass([TempValidate23(COLOR_STRING4,{optional:!0})],FibonacciProperties.prototype,"rangeStroke",2),__decorateClass([TempValidate23(FIBONACCI_BANDS,{optional:!0})],FibonacciProperties.prototype,"bands",2);var{STRING:STRING13,OBJECT:OBJECT12,TempValidate:TempValidate24}=module_support_exports,FibonacciRetracementTrendBasedProperties=class extends FibonacciProperties{constructor(){super(...arguments),this.type="fibonacci-retracement-trend-based",this.endRetracement=new PointProperties}static is(t){return isObject(t)&&t.type==="fibonacci-retracement-trend-based"}isValidWithContext(t,e){return validateDatumLine(t,this,{overflowContinuous:!0},e)}};__decorateClass([TempValidate24(STRING13)],FibonacciRetracementTrendBasedProperties.prototype,"type",2),__decorateClass([TempValidate24(OBJECT12)],FibonacciRetracementTrendBasedProperties.prototype,"endRetracement",2);var{STRING:STRING14,TempValidate:TempValidate25}=module_support_exports,FibonacciRetracementProperties=class extends FibonacciProperties{constructor(){super(...arguments),this.type="fibonacci-retracement"}static is(t){return isObject(t)&&t.type==="fibonacci-retracement"}isValidWithContext(t,e){return validateDatumLine(t,this,{overflowContinuous:!0},e)}};__decorateClass([TempValidate25(STRING14)],FibonacciRetracementProperties.prototype,"type",2);var{NUMBER:NUMBER8,STRING:STRING15,OBJECT:OBJECT13,BaseProperties:BaseProperties12,TempValidate:TempValidate26}=module_support_exports,ParallelChannelProperties=class extends Annotation(Background2(Line3(Handle(Extendable(Stroke(LineStyle(BaseProperties12))))))){constructor(){super(...arguments),this.type="parallel-channel",this.middle=new ChannelAnnotationMiddleProperties,this.text=new ChannelTextProperties,this.snapToAngle=45}static is(t){return isObject(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):logger_exports.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),t}isValidWithContext(t,e){return super.isValid(e)&&validateDatumLine(t,this,{overflowContinuous:!0},e)&&validateDatumLine(t,this.bottom,{overflowContinuous:!0},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 getLineDash(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return getLineCap(this.lineCap,this.lineDash,this.lineStyle)}};__decorateClass([TempValidate26(STRING15)],ParallelChannelProperties.prototype,"type",2),__decorateClass([TempValidate26(NUMBER8)],ParallelChannelProperties.prototype,"height",2),__decorateClass([TempValidate26(OBJECT13,{optional:!0})],ParallelChannelProperties.prototype,"middle",2),__decorateClass([TempValidate26(OBJECT13,{optional:!0})],ParallelChannelProperties.prototype,"text",2);var{STRING:STRING16,TempValidate:TempValidate27}=module_support_exports,TextProperties=class extends TextualPointProperties{constructor(){super(...arguments),this.type="text",this.position="bottom"}static is(t){return isObject(t)&&t.type==="text"}};__decorateClass([TempValidate27(STRING16)],TextProperties.prototype,"type",2);function isEphemeralType(t){return QuickDatePriceRangeProperties.is(t)}function isLineType(t){return LineProperties.is(t)||HorizontalLineProperties.is(t)||VerticalLineProperties.is(t)||ArrowProperties.is(t)||isFibonacciType(t)}function isChannelType(t){return DisjointChannelProperties.is(t)||ParallelChannelProperties.is(t)}function isFibonacciType(t){return FibonacciRetracementProperties.is(t)||FibonacciRetracementTrendBasedProperties.is(t)}function isTextType(t){return CalloutProperties.is(t)||CommentProperties.is(t)||NoteProperties.is(t)||TextProperties.is(t)}function isMeasurerType(t){return DateRangeProperties.is(t)||PriceRangeProperties.is(t)||DatePriceRangeProperties.is(t)||QuickDatePriceRangeProperties.is(t)}function hasFontSize(t){return isTextType(t)&&!NoteProperties.is(t)}function hasLineStyle(t){return isLineType(t)||isChannelType(t)||isMeasurerType(t)&&!QuickDatePriceRangeProperties.is(t)}function hasLineColor(t){return isLineType(t)||isChannelType(t)||isMeasurerType(t)||CalloutProperties.is(t)||NoteProperties.is(t)}function hasIconColor(t){return NoteProperties.is(t)}function hasFillColor(t){return isChannelType(t)||isMeasurerType(t)||CalloutProperties.is(t)||CommentProperties.is(t)||ShapePointProperties.is(t)}function hasTextColor(t){return isTextType(t)&&!NoteProperties.is(t)}function hasLineText(t){return(isLineType(t)||isChannelType(t)||isMeasurerType(t))&&!isEphemeralType(t)&&isObject(t.text)}function setFontSize(t,e){"fontSize"in t&&(t.fontSize=e),hasLineText(t)&&(t.text.fontSize=e)}function setLineStyle(t,e){const i=e?.strokeWidth??t.strokeWidth??1,s=e?.type??t.lineStyle,n=s??getLineStyle(t.lineDash,s),o=getComputedLineDash(i,n);t.strokeWidth=i,t.computedLineDash=o,t.lineStyle=n,t.lineCap=n==="dotted"?"round":void 0}function setColor(t,e,i,s,n,o){switch(e){case"fill-color":{"fill"in t&&(t.fill=s),"fillOpacity"in t&&(t.fillOpacity=n),"background"in t&&(t.background.fill=s,t.background.fillOpacity=n);break}case"line-color":{"axisLabel"in t&&(t.axisLabel.fill=s,t.axisLabel.fillOpacity=n,t.axisLabel.stroke=s,t.axisLabel.strokeOpacity=n),"fill"in t&&"fillOpacity"in t&&hasIconColor(t)?(t.fill=s,t.fillOpacity=n):("strokeOpacity"in t&&(t.strokeOpacity=n),"isMultiColor"in t&&"rangeStroke"in t?(t.isMultiColor=o,t.rangeStroke=s):"stroke"in t&&(t.stroke=s));break}case"text-color":{"color"in t&&(t.color=i),hasLineText(t)&&(t.text.color=s);break}}}var{deepClone:deepClone2}=module_support_exports,AnnotationDefaults=class{constructor(){this.mementoOriginatorKey="annotation-defaults",this.colors=new Map(Object.values(AnnotationType).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:deepClone2(this.colors),fontSizes:deepClone2(this.fontSizes),lineStyles:deepClone2(this.lineStyles),lineTextAlignments:deepClone2(this.lineTextAlignments),lineTextPositions:deepClone2(this.lineTextPositions),fibonacciOptions:deepClone2(this.fibonacciOptions)}}guardMemento(t){return!0}restoreMemento(t,e,i){this.colors=deepClone2(i.colors),this.fontSizes=deepClone2(i.fontSizes),this.lineStyles=deepClone2(i.lineStyles),this.lineTextAlignments=deepClone2(i.lineTextAlignments),this.lineTextPositions=deepClone2(i.lineTextPositions),this.fibonacciOptions=deepClone2(i.fibonacciOptions)}setDefaultColor(t,e,i,s,n,o){this.colors.get(t)?.set(e,[i,s,n,o])}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 s=this.fibonacciOptions.get(t);s[e]=i,this.fibonacciOptions.set(t,s)}applyDefaults(t){for(const[e,i]of this.colors)if(t.type===e)for(const[s,[n,o,a,r]=[]]of i)n&&o&&a!=null&&r!=null&&setColor(t,s,n,o,a,r);for(const[e,i]of this.fontSizes)t.type!==e||i==null||setFontSize(t,i);for(const[e,i]of this.lineStyles)t.type!==e||i==null||setLineStyle(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.keys(i).forEach(s=>{const n=i[s];n!=null&&t.set({[s]:n})})}},colorPickerTemplate_default='<div class="ag-charts-color-picker__palette" tabindex="0"></div><div class="ag-charts-color-picker__color-row"><button class="ag-charts-color-picker__multi-color-button" tabindex="0" type="button"></button> <input class="ag-charts-color-picker__hue-input" tabindex="0" type="range" min="0" max="360" value="0"></div><input class="ag-charts-color-picker__alpha-input" tabindex="0" type="range" min="0" max="1" value="1" step="0.01"> <label class="ag-charts-color-picker__color-field"><span class="ag-charts-color-picker__color-label">Color</span> <input class="ag-charts-color-picker__color-input" tabindex="0" value="#000"></label>',{Color:Color4}=module_support_exports,getHsva=t=>{try{const e=Color4.fromString(t),[i,s,n]=e.toHSB();return[i,s,n,e.a]}catch{return}},ColorPicker=class extends module_support_exports.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),s=this.showWithChildren([e],{initialFocus:i,...t});s.classList.add("ag-charts-color-picker"),s.setAttribute("role","dialog")}createColorPicker(t){let e=t.isMultiColor??!1,[i,s,n,o]=getHsva(t.color??"#f00")??[0,1,.5,1];o=t.opacity??o;const a=createElement("div","ag-charts-color-picker__content");a.innerHTML=colorPickerTemplate_default,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"),d=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 p=(y=!0)=>{const b=Color4.fromHSB(i,s,n,o).toHexString();if(a.style.setProperty("--h",`${i}`),a.style.setProperty("--s",`${s}`),a.style.setProperty("--v",`${n}`),a.style.setProperty("--a",`${o}`),a.style.setProperty("--color",b.slice(0,7)),a.style.setProperty("--color-a",b),l.value=`${i}`,h.value=`${o}`,h.classList.toggle("ag-charts-color-picker__alpha-input--opaque",o===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!==d&&(d.value=e?"Multi Colour":b.toUpperCase()),y||t.color==null){const S=Color4.fromHSB(i,s,n,1).toHexString();t.onChange?.(b,S,o,e)}y&&(this.hasChanged=!0)};p(!1);const g=y=>y.preventDefault(),f=y=>y.stopPropagation(),m=y=>{y.preventDefault();const x=y.currentTarget;x.focus();const b=x.getBoundingClientRect(),S=({clientX:I,clientY:A})=>{e=!1,s=Math.min(Math.max((I-b.left)/b.width,0),1),n=1-Math.min(Math.max((A-b.top)/b.height,0),1),p()},v=()=>{window.removeEventListener("pointermove",S)};S(y),window.addEventListener("pointermove",S),window.addEventListener("pointerup",v,{once:!0})};return a.addEventListener("mousedown",f),a.addEventListener("touchstart",f),a.addEventListener("touchmove",f),a.addEventListener("keydown",y=>{switch(y.stopPropagation(),y.key){case"Enter":case"Escape":this.hide();break;default:return}y.preventDefault()}),r.addEventListener("pointerdown",m),r.addEventListener("touchstart",g,{passive:!1}),r.addEventListener("touchmove",g,{passive:!1}),r.addEventListener("keydown",y=>{if(y.key==="ArrowLeft")s=clamp(0,s-.01,1);else if(y.key==="ArrowRight")s=clamp(0,s+.01,1);else if(y.key==="ArrowUp")n=clamp(0,n+.01,1);else if(y.key==="ArrowDown")n=clamp(0,n-.01,1);else return;y.preventDefault(),p()}),c.addEventListener("click",()=>{e=!e,p()}),l.addEventListener("input",y=>{e=!1,i=y.currentTarget.valueAsNumber??0,p()}),h.addEventListener("input",y=>{e=!1,o=y.currentTarget.valueAsNumber??0,p()}),d.addEventListener("input",y=>{e=!1;const x=getHsva(y.currentTarget.value);x!=null&&([i,s,n,o]=x,p())}),d.addEventListener("blur",()=>p()),d.addEventListener("keydown",y=>{y.key==="Enter"&&(y.currentTarget.blur(),p())}),{element:a,initialFocus:r}}};function channelMenuItemVisible(t){return!(t instanceof module_support_exports.LogScale)&&!(t instanceof module_support_exports.BandScale)}var LINE_ANNOTATION_ITEMS=[{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:channelMenuItemVisible},{label:"toolbarAnnotationsDisjointChannel",icon:"disjoint-channel-drawing",value:"disjoint-channel",visible:channelMenuItemVisible}],FIBONACCI_ANNOTATION_ITEMS=[{label:"toolbarAnnotationsFibonacciRetracement",icon:"fibonacci-retracement-drawing",value:"fibonacci-retracement"},{label:"toolbarAnnotationsFibonacciRetracementTrendBased",icon:"fibonacci-retracement-trend-based-drawing",value:"fibonacci-retracement-trend-based"}],FIBONACCI_RATIO_ITEMS=[{label:"Fibonacci - Extended",value:10},{label:"Fibonacci - 6 Band",value:6},{label:"Fibonacci - 4 Band",value:4}],TEXT_ANNOTATION_ITEMS=[{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"}],SHAPE_ANNOTATION_ITEMS=[{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"}],MEASURER_ANNOTATION_ITEMS=[{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"}],LINE_STROKE_WIDTH_ITEMS=[{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}],LINE_STYLE_TYPE_ITEMS=[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],TEXT_SIZE_ITEMS=[{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:ARRAY3,BOOLEAN:BOOLEAN9,NUMBER:NUMBER9,OBJECT:OBJECT14,STRING:STRING17,UNION:UNION6,Color:Color5,FloatingToolbar:FloatingToolbar2,Listeners:Listeners2,Menu:Menu2,PropertiesArray:PropertiesArray2,ToolbarButtonProperties:ToolbarButtonProperties2,ToolbarButtonWidget:ToolbarButtonWidget2,TempValidate:TempValidate28}=module_support_exports,AnnotationOptionsButtonProperties=class extends ToolbarButtonProperties2{constructor(){super(...arguments),this.checkedOverrides=new ToolbarButtonProperties2}};__decorateClass([TempValidate28(UNION6(["line-stroke-width","line-style-type","line-color","fill-color","text-color","text-size","delete","settings","lock"]))],AnnotationOptionsButtonProperties.prototype,"value",2),__decorateClass([TempValidate28(OBJECT14,{optional:!0})],AnnotationOptionsButtonProperties.prototype,"checkedOverrides",2),__decorateClass([TempValidate28(STRING17,{optional:!0})],AnnotationOptionsButtonProperties.prototype,"color",2),__decorateClass([TempValidate28(NUMBER9,{optional:!0})],AnnotationOptionsButtonProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate28(Boolean,{optional:!0})],AnnotationOptionsButtonProperties.prototype,"isMultiColor",2);var AnnotationOptionsButtonWidget=class extends ToolbarButtonWidget2{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`)}},FloatingAnnotationOptionsToolbar=class extends FloatingToolbar2{createButtonWidget(){return new AnnotationOptionsButtonWidget(this.localeManager)}},AnnotationOptionsToolbar=class extends module_support_exports.BaseProperties{constructor(t,e){super(),this.ctx=t,this.getActiveDatum=e,this.enabled=!0,this.buttons=new PropertiesArray2(AnnotationOptionsButtonProperties),this.destroyFns=[],this.events=new Listeners2,this.visibleButtons=[],this.toolbar=new FloatingAnnotationOptionsToolbar(this.ctx,"annotation-options"),this.colorPicker=new ColorPicker(this.ctx),this.textSizeMenu=new Menu2(this.ctx,"text-size"),this.lineStyleTypeMenu=new Menu2(this.ctx,"annotations-line-style-type"),this.lineStrokeWidthMenu=new Menu2(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":hasLineStyle(t),"line-stroke-width":hasLineStyle(t),"line-color":hasLineColor(t),"text-color":hasTextColor(t),"fill-color":hasFillColor(t),"text-size":hasFontSize(t),settings:hasLineText(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,s){if(e!=null&&i!=null){const{r:n,g:o,b:a}=Color5.fromString(e);e=Color5.fromArray([n,o,a,i]).toHexString()}this.updateButtonByValue(t,{color:e,isMultiColor:s})}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 s=hasLineStyle(i)?getLineStyle(i.lineDash,i.lineStyle):void 0;this.lineStyleTypeMenu.show({items:LINE_STYLE_TYPE_ITEMS,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStyle"),value:s,sourceEvent:t.sourceEvent,onPress:n=>this.onLineStyleTypeMenuPress(n,i),class:"ag-charts-annotations__line-style-type-menu"});break}case"line-stroke-width":{const s=hasLineStyle(i)?i.strokeWidth:void 0;this.lineStrokeWidthMenu.show({items:LINE_STROKE_WIDTH_ITEMS,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStrokeWidth"),value:s,sourceEvent:t.sourceEvent,onPress:n=>this.onLineStrokeWidthMenuPress(n,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:(s=>{this.dispatch("saved-color",{type:i.type,colorPickerType:e.value,color:i.getDefaultColor(s)})}).bind(this,e.value)});break}case"text-size":{const s=isTextType(i)?i.fontSize:void 0;this.textSizeMenu.show({items:TEXT_SIZE_ITEMS,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsTextSize"),value:s,sourceEvent:t.sourceEvent,onPress:n=>this.onTextSizeMenuPress(n,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,s={x:i.x,y:i.y+i.height+4},n={y:i.y-4};this.colorPicker.setAnchor(s,n);for(const[o,a]of e.entries()){const r=this.visibleButtons.at(o);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,s,n,o){this.dispatch("updated-color",{type:e.type,colorPickerType:t,colorOpacity:i,color:s,opacity:n,isMultiColor:o}),this.updateColorPickerColor(t,i,n,o)}onTextSizeMenuPress(t,e){if(!hasFontSize(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(!hasLineStyle(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(!hasLineStyle(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,s]of this.visibleButtons.entries())s&&(s.value==="lock"?(this.toolbar.toggleSwitchCheckedByIndex(i,e),this.updateButtonByIndex(i,e?s.checkedOverrides.toJson():s.toJson())):this.toolbar.toggleButtonEnabledByIndex(i,!e));hasFontSize(t)&&this.updateFontSize(t.fontSize),this.updateColors(t),this.updateLineStyles(t)}updateLineStyles(t){if(!hasLineStyle(t))return;const e=t.strokeWidth??1,i=getLineStyle(t.lineDash,t.lineStyle);this.updateStrokeWidth({strokeWidth:e,value:e,label:String(e)}),this.updateLineStyleType(LINE_STYLE_TYPE_ITEMS.find(s=>s.value===i)??LINE_STYLE_TYPE_ITEMS[0])}updateButtonByValue(t,e){const i=this.visibleButtons.findIndex(s=>s.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})}};__decorateClass([TempValidate28(BOOLEAN9)],AnnotationOptionsToolbar.prototype,"enabled",2),__decorateClass([TempValidate28(ARRAY3)],AnnotationOptionsToolbar.prototype,"buttons",2);var{StateMachine:StateMachine2,StateMachineProperty:StateMachineProperty2,Vec2:Vec23,Debug:Debug2}=module_support_exports,DragStateMachine=class extends StateMachine2{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:s})=>{this.hasMoved=!1,this.dragStart=i,this.offset=i,this.node?.dragStart(this.datum,i,s)}}},dragging:{keyDown:e,keyUp:e,drag:({offset:i,context:s})=>{this.hasMoved=Vec23.lengthSquared(Vec23.sub(i,this.dragStart))>0,this.offset=i,this.node?.drag(this.datum,i,s,this.snapping),t.update()},dragEnd:{target:StateMachine2.parent,action:()=>{this.node?.stopDragging(),this.hasMoved&&t.recordAction("Move annotation"),t.update()}}}}),this.debug=Debug2.create(!0,"annotations"),this.hasMoved=!1,this.snapping=!1}};__decorateClass([StateMachineProperty2()],DragStateMachine.prototype,"snapping",2),__decorateClass([StateMachineProperty2()],DragStateMachine.prototype,"datum",2),__decorateClass([StateMachineProperty2()],DragStateMachine.prototype,"node",2);var{STRING:STRING18,TempValidate:TempValidate29}=module_support_exports,ArrowDownProperties=class extends ShapePointProperties{constructor(){super(...arguments),this.type="arrow-down"}static is(t){return isObject(t)&&t.type==="arrow-down"}};__decorateClass([TempValidate29(STRING18)],ArrowDownProperties.prototype,"type",2);var _Handle=class ae extends module_support_exports.Group{constructor(){super(...arguments),this.active=!1,this.locked=!1,this.visible=!1,this.zIndex=1}drag(e){const{handle:i,locked:s}=this;return s?{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=ae.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)}};_Handle.INACTIVE_STROKE_WIDTH=2;var Handle2=_Handle,_InvariantHandle=class re extends Handle2{constructor(){super(),this.handle=new module_support_exports.Marker({shape:"circle"}),this.glow=new module_support_exports.Marker({shape:"circle"}),this.append([this.handle]),this.handle.size=re.HANDLE_SIZE,this.handle.strokeWidth=Handle2.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2}update(e){this.handle.setProperties({...e,strokeWidth:Handle2.INACTIVE_STROKE_WIDTH})}drag(e){return{point:e,offset:{x:0,y:0}}}};_InvariantHandle.HANDLE_SIZE=7,_InvariantHandle.GLOW_SIZE=9;var InvariantHandle=_InvariantHandle,_UnivariantHandle=class ft extends Handle2{constructor(){super(),this.handle=new module_support_exports.Rect,this.glow=new module_support_exports.Rect,this.gradient="horizontal",this.append([this.glow,this.handle]),this.handle.cornerRadius=ft.CORNER_RADIUS,this.handle.width=ft.HANDLE_SIZE,this.handle.height=ft.HANDLE_SIZE,this.handle.strokeWidth=Handle2.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.cornerRadius=ft.CORNER_RADIUS,this.glow.width=ft.GLOW_SIZE,this.glow.height=ft.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=(ft.HANDLE_SIZE-InvariantHandle.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=InvariantHandle.HANDLE_SIZE,this.handle.height=InvariantHandle.HANDLE_SIZE,this.glow.width=InvariantHandle.GLOW_SIZE,this.glow.height=InvariantHandle.GLOW_SIZE}else this.handle.cornerRadius=ft.CORNER_RADIUS,this.handle.width=ft.HANDLE_SIZE,this.handle.height=ft.HANDLE_SIZE,this.glow.width=ft.GLOW_SIZE,this.glow.height=ft.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=(ft.HANDLE_SIZE-InvariantHandle.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"}};_UnivariantHandle.HANDLE_SIZE=12,_UnivariantHandle.GLOW_SIZE=16,_UnivariantHandle.CORNER_RADIUS=4;var UnivariantHandle=_UnivariantHandle,_DivariantHandle=class wt extends Handle2{constructor(){super(),this.handle=new module_support_exports.Marker({shape:"circle"}),this.glow=new module_support_exports.Marker({shape:"circle"}),this.append([this.glow,this.handle]),this.handle.size=wt.HANDLE_SIZE,this.handle.strokeWidth=Handle2.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.size=wt.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=InvariantHandle.HANDLE_SIZE,this.glow.size=InvariantHandle.GLOW_SIZE):(this.handle.size=wt.HANDLE_SIZE,this.glow.size=wt.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"}};_DivariantHandle.HANDLE_SIZE=11,_DivariantHandle.GLOW_SIZE=17;var DivariantHandle=_DivariantHandle,{ZIndexMap:ZIndexMap3}=module_support_exports,AnnotationScene=class extends module_support_exports.Group{constructor(){super(...arguments),this.name="AnnotationScene",this.zIndex=ZIndexMap3.CHART_ANNOTATION}static isCheck(t,e){return isObject(t)&&Object.hasOwn(t,"type")&&t.type===e}toggleHovered(t){this.toggleHandles(t)}*nonHandleChildren(){for(const t of this.children())t instanceof Handle2||(yield t)}computeBBoxWithoutHandles(){return module_support_exports.Transformable.toCanvas(this,module_support_exports.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}},{ContinuousScale:ContinuousScale4,Vec2:Vec24,toRadians:toRadians5}=module_support_exports;function snapPoint(t,e,i=!1,s,n=1){if(!i)return invertCoords(t,e);const o=s?convertPoint(s,e):Vec24.origin();return invertCoords(snapToAngle(t,o,n),e)}function snapToAngle(t,e,i){const s=Vec24.sub(t,e),n=toRadians5(i),o=Math.round(Vec24.angle(s)/n)*n;return Vec24.rotate(s,o,e)}function getDragStartState(t,e){const i={};for(const[s,n]of entries(t))i[s]=convertPoint(n,e);return i}function translate(t,e,i,s={overflowContinuous:0,translateVectors:void 0,invertYVectors:void 0,snap:void 0}){const{xAxis:n,yAxis:o}=i,a=Object.keys(t),r=[],l=[],c=new Set(s.translateVectors??a),h=new Set(s.invertYVectors??[]),d=new Set([...c,...h]),u=Vec24.multiply(e,Vec24.from(1,-1));for(const y of a)d.has(y)&&(t[y]=Vec24.add(t[y],h.has(y)?u:e),s.snap&&(t[y]=snapToAngle(t[y],s.snap.vectors[y],s.snap.angle))),r.push(n.getRangeOverflow(t[y].x)),l.push(o.getRangeOverflow(t[y].y));const p=(y,x)=>Math.abs(y)-Math.abs(x),g=(y,x,b)=>s.overflowContinuous===0||!ContinuousScale4.is(y)?b.toSorted(p).at(-1)??0:a.length===d.size?b.toSorted(p).at(-s.overflowContinuous-1)??0:b.filter(v=>v!==0).length<=s.overflowContinuous?0:b.filter((v,I)=>v!==0&&Math.abs(v)<=Math.abs(x)&&d.has(a[I])).toSorted(p).at(-1)??0,f=Vec24.from(g(n.scale,e.x,r),g(o.scale,e.y,l));if(!Vec24.equal(f,Vec24.origin()))for(const y of a)d.has(y)&&(t[y]=Vec24.round(Vec24.sub(t[y],f),4));const m={};for(const y of a)m[y]=invertCoords(t[y],i);return m}var{Vec2:Vec25}=module_support_exports,PointScene=class extends AnnotationScene{constructor(){super(...arguments),this.handle=new DivariantHandle,this.anchor={x:0,y:0,position:"above"}}update(t,e){const i=convertPoint(t,e);this.updateHandle(t,i),this.anchor=this.updateAnchor(t,i,e)}dragStart(t,e,i){this.dragState={offset:e,...getDragStartState({handle:t},i)}}drag(t,e,i){const{dragState:s}=this;if(t.locked||!s)return;const{point:n}=translate({point:s.handle},Vec25.sub(e,s.offset),i);t.x=n.x,t.y=n.y}translate(t,e,i){if(t.locked)return;const{point:s}=translate({point:convertPoint(t,i)},e,i);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 s=convertPoint(t,i),n=invertCoords({x:s.x-30,y:s.y-30},i);return e.x=n.x,e.y=n.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:s,y:n}=this.getHandleCoords(t,e,i),o=this.getHandleStyles(t);this.handle.update({...o,x:s,y:n}),this.handle.toggleLocked(t.locked??!1)}updateAnchor(t,e,i){const s=this.getHandleCoords(t,e);return{x:s.x+i.seriesRect.x,y:s.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}}},ShapePointScene=class extends PointScene{constructor(){super(),this.append([this.handle])}update(t,e){super.update(t,e);const i=convertPoint(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)}},arrowUpPoints=[[.5,0],[1,.5],[.75,.5],[.75,1],[.25,1],[.25,.5],[0,.5]];function arrowUp(t){module_support_exports.drawMarkerUnitPolygon(t,arrowUpPoints)}arrowUp.anchor={x:.5,y:0};var ArrowUpScene=class extends ShapePointScene{constructor(){super(),this.type="arrow-up",this.shape=new module_support_exports.Marker({shape:arrowUp}),this.append([this.shape])}static is(t){return AnnotationScene.isCheck(t,"arrow-up")}getHandleCoords(t,e){const i=DivariantHandle.HANDLE_SIZE/2,s=super.getHandleCoords(t,e);return s.y-=i,s}},arrowDownPoints=arrowUpPoints.map(([t,e])=>[t,1-e]);function arrowDown(t){module_support_exports.drawMarkerUnitPolygon(t,arrowDownPoints)}arrowDown.anchor={x:.5,y:1};var ArrowDownScene=class extends ShapePointScene{constructor(){super(),this.type="arrow-down",this.shape=new module_support_exports.Marker({shape:arrowDown}),this.append([this.shape])}static is(t){return AnnotationScene.isCheck(t,"arrow-down")}updateAnchor(t,e,i){const s=super.updateAnchor(t,e,i);return s.y-=t.size,s}getHandleCoords(t,e){const i=DivariantHandle.HANDLE_SIZE/2,s=super.getHandleCoords(t,e);return s.y+=i,s}},{StateMachine:StateMachine3,StateMachineProperty:StateMachineProperty3,Debug:Debug3}=module_support_exports,PointStateMachine=class extends StateMachine3{constructor(t){const e=({point:s})=>{const n=this.createDatum();n.set({x:s.x,y:s.y}),t.create(n)},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:StateMachine3.parent,reset:StateMachine3.parent},"waiting-first-render":{render:{target:StateMachine3.parent,action:i}}}),this.debug=Debug3.create(!0,"annotations")}};__decorateClass([StateMachineProperty3()],PointStateMachine.prototype,"node",2);var ArrowDownStateMachine=class extends PointStateMachine{createDatum(){return new ArrowDownProperties}},arrowDownConfig={type:"arrow-down",datum:ArrowDownProperties,scene:ArrowDownScene,isDatum:ArrowDownProperties.is,translate:(t,e,i,s)=>{ArrowDownProperties.is(e)&&ArrowDownScene.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(ArrowDownProperties.is(e)&&ArrowDownProperties.is(i)&&ArrowDownScene.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{ArrowDownProperties.is(e)&&ArrowDownScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new ArrowDownStateMachine({...t,create:e("arrow-down")}),dragState:t=>new DragStateMachine(t)},{STRING:STRING19,TempValidate:TempValidate30}=module_support_exports,ArrowUpProperties=class extends ShapePointProperties{constructor(){super(...arguments),this.type="arrow-up"}static is(t){return isObject(t)&&t.type==="arrow-up"}};__decorateClass([TempValidate30(STRING19)],ArrowUpProperties.prototype,"type",2);var ArrowUpStateMachine=class extends PointStateMachine{createDatum(){return new ArrowUpProperties}},arrowUpConfig={type:"arrow-up",datum:ArrowUpProperties,scene:ArrowUpScene,isDatum:ArrowUpProperties.is,translate:(t,e,i,s)=>{ArrowUpProperties.is(e)&&ArrowUpScene.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(ArrowUpProperties.is(e)&&ArrowUpProperties.is(i)&&ArrowUpScene.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{ArrowUpProperties.is(e)&&ArrowUpScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new ArrowUpStateMachine({...t,create:e("arrow-up")}),dragState:t=>new DragStateMachine(t)},{Vec2:Vec26,Vec4:Vec42}=module_support_exports,LinearScene=class extends AnnotationScene{constructor(){super(...arguments),this.overflowContinuous=0}extendLine({x1:t,y1:e,x2:i,y2:s},n,o){const a={x1:t,y1:e,x2:i,y2:s};if(!n.extendStart&&!n.extendEnd)return a;const[r,l]=boundsIntersections(a,o.yAxis.bounds),c=a.x2<a.x1,h=a.y1>=a.y2,d=a.x2===a.x1;return n.extendEnd&&(d?a.y2=h?l.y:r.y:(a.x2=c?r.x:l.x,a.y2=c?r.y:l.y)),n.extendStart&&(d?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,...getDragStartState({start:t.start,end:t.end},i)}}drag(t,e,i,s){t.locked||(this.activeHandle?this.dragHandle(t,e,i,s):this.dragAll(t,e,i))}dragAll(t,e,i){const{dragState:s}=this;s&&this.translatePoints(t,s.start,s.end,Vec26.sub(e,s.offset),i)}translate(t,e,i){t.locked||this.translatePoints(t,convertPoint(t.start,i),convertPoint(t.end,i),e,i)}copy(t,e,i){const s=convertLine(t,i);if(!s)return;const n=this.computeBBoxWithoutHandles(),o={x:-n.width/2,y:-n.height/2};return this.translatePoints(e,Vec42.start(s),Vec42.end(s),o,i),e}translatePoints(t,e,i,s,n){const o=this.getTranslatePointsVectors(e,i),a=translate(o,s,n,{overflowContinuous:this.overflowContinuous});t.start.x=a.start.x,t.end.x=a.end.x,t.start.y=a.start.y,t.end.y=a.end.y}getTranslatePointsVectors(t,e){return{start:t,end:e}}},{Vec2:Vec27,Vec4:Vec43}=module_support_exports,StartEndScene=class extends LinearScene{constructor(){super(...arguments),this.start=new DivariantHandle,this.end=new DivariantHandle,this.anchor={x:0,y:0,position:"above"}}update(t,e){const i=convertLine(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 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,s){const{activeHandle:n,dragState:o}=this;if(!n||!o)return;this[n].toggleDragging(!0);const a=n==="start"?"end":"start",r=s?{vectors:{[n]:convertPoint(t[a],i)},angle:t.snapToAngle}:void 0,{[n]:l}=translate({[n]:o[n]},Vec27.sub(e,o.offset),i,{overflowContinuous:0,snap:r});t[n].x=l.x,t[n].y=l.y}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(t,e){const{start:i,end:s}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="start",!0):s.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,s){this.anchor={x:e.x1+i.seriesRect.x,y:e.y1+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(t,e,i,s){return i==="start"?Vec43.start(e):Vec43.end(e)}getHandleStyles(t,e){return{fill:t.handle.fill,stroke:t.handle.stroke,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}}},{Vec4:Vec44}=module_support_exports,TextualStartEndScene=class extends StartEndScene{constructor(){super(...arguments),this.label=new module_support_exports.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(t){this.textInputBBox=t,this.markDirty("TextualStartEndScene")}update(t,e){const i=convertLine(t,e);if(i==null)return;const s=this.getTextBBox(t,i);this.updateLabel(t,s,i),this.updateHandles(t,i,s),this.updateShape(t,s,i),this.updateAnchor(t,i,e,s)}containsPoint(t,e){return super.containsPoint(t,e)||this.label.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 getBBox(t,i,Vec44.end(e),this.textInputBBox)}updateLabel(t,e,i){const{text:s,isPlaceholder:n}=t.getText();updateTextNode(this.label,s,n,t,this.getLabelCoords(t,e,i))}updateShape(t,e,i){}getLabelCoords(t,e,i){return Vec44.end(i)}getHandleStyles(t,e){return{...super.getHandleStyles(t,e),stroke:t.handle.stroke??t.color}}},{drawCorner:drawCorner2,Path:Path6}=module_support_exports,CalloutScene=class extends TextualStartEndScene{constructor(){super(),this.type="callout",this.shape=new Path6,this.append([this.shape,this.label,this.start,this.end])}static is(t){return AnnotationScene.isCheck(t,"callout")}drag(t,e,i,s){t.locked||(this.activeHandle==="end"?this.dragHandle(t,e,i,s):this.dragAll(t,e,i))}getLabelCoords(t,e,i){const s=t.getPadding(),{bodyBounds:n={x:0,y:0,width:0,height:0}}=this.getDimensions(t,e,i)??{};return{x:n.x+s.left,y:n.y-s.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,s){const{bodyBounds:n}=this.getDimensions(t,s,e)??{},o=n??s;this.anchor={x:o.x+i.seriesRect.x,y:o.y+i.seriesRect.y-o.height,position:this.anchor.position}}updateShape(t,e,i){const{shape:s}=this;s.fill=t.fill,s.fillOpacity=t.fillOpacity??1,s.stroke=t.stroke,s.strokeWidth=t.strokeWidth??1,s.strokeOpacity=t.strokeOpacity??1;const{tailPoint:n,bodyBounds:o}=this.getDimensions(t,e,i)??{};!n||!o||this.updatePath(n,o)}updatePath(t,e){const{x:i,y:s}=t,{x:n,y:o,width:a,height:r}=e,l=o-r,c=n+a,h=this.calculateCalloutPlacement({x:i,y:s},e),d=8,u=[{coordinates:{x0:n,x1:n+d,y0:l+d,y1:l,cx:h==="topLeft"?i:n+d,cy:h==="topLeft"?s:l+d},type:h==="topLeft"?"calloutCorner":"corner"},{coordinates:{x0:n+d,x1:c-d,y0:l,y1:l,cx:i,cy:s},type:h==="top"?"calloutSide":"side"},{coordinates:{x0:c-d,x1:c,y0:l,y1:l+d,cx:h==="topRight"?i:c-d,cy:h==="topRight"?s:l+d},type:h==="topRight"?"calloutCorner":"corner"},{coordinates:{x0:c,x1:c,y0:l+d,y1:o-d,cx:i,cy:s},type:h==="right"?"calloutSide":"side"},{coordinates:{x0:c,x1:c-d,y0:o-d,y1:o,cx:h==="bottomRight"?i:c-d,cy:h==="bottomRight"?s:o-d},type:h==="bottomRight"?"calloutCorner":"corner"},{coordinates:{x0:c-d,x1:n+d,y0:o,y1:o,cx:i,cy:s},type:h==="bottom"?"calloutSide":"side"},{coordinates:{x0:n+d,x1:n,y0:o,y1:o-d,cx:h==="bottomLeft"?i:n+d,cy:h==="bottomLeft"?s:o-d},type:h==="bottomLeft"?"calloutCorner":"corner"},{coordinates:{x0:n,x1:n,y0:o-d,y1:l+d,cx:i,cy:s},type:h==="left"?"calloutSide":"side"}],{path:p}=this.shape;p.clear(),p.moveTo(n,l+d),u.forEach(({coordinates:g,type:f})=>{this.drawPath(p,g,d,f)}),p.closePath()}drawPath(t,{x0:e,y0:i,x1:s,y1:n,cx:o,cy:a},r,l){switch(l){case"calloutCorner":{t.lineTo(o,a),t.lineTo(s,n);break}case"corner":{drawCorner2(t,{x0:e,x1:s,y0:i,y1:n,cx:o,cy:a},r,!1);break}case"calloutSide":{if(e!==s){const h=e>s?-1:1,d=Math.min(e,s)+Math.abs(s-e)/2;t.lineTo(d-6*h,i),t.lineTo(o,a),t.lineTo(d+6*h,i),t.lineTo(s,n)}else{const h=i>n?-1:1,d=Math.min(i,n)+Math.abs(i-n)/2;t.lineTo(e,d-6*h),t.lineTo(o,a),t.lineTo(e,d+6*h),t.lineTo(s,n)}break}case"side":default:{t.lineTo(s,n);break}}}calculateCalloutPlacement(t,e){const i=e.x+e.width,s=e.y-e.height;let n,o;return t.x>i?n="right":t.x<e.x&&(n="left"),t.y>e.y?o="bottom":t.y<s&&(o="top"),n&&o?`${o}${n[0].toUpperCase()}${n.substring(1)}`:o??n}getDimensions(t,e,i){const{fontSize:s}=t,n=t.getPadding(),o=n.left+n.right,a=n.top+n.bottom,r=e.width+o,l=Math.max(e.height+a,s+a);return{tailPoint:{x:i.x1,y:i.y1},bodyBounds:{x:e.x,y:e.y,width:r,height:l}}}containsPoint(t,e){const{start:i,end:s,shape:n}=this;if(this.activeHandle=void 0,i.containsPoint(t,e))return this.activeHandle="start",!0;const o=s.containsPoint(t,e)||n.containsPoint(t,e);return o&&(this.activeHandle="end"),o}};function guardCancelAndExit({key:t}){return t==="Escape"}function guardSaveAndExit({key:t,shiftKey:e}){return!e&&t==="Enter"}var{StateMachine:StateMachine4,StateMachineProperty:StateMachineProperty4,Debug:Debug4}=module_support_exports,TextualStartEndStateMachine=class extends StateMachine4{constructor(t){const e=({point:u})=>{const p=this.createDatum();p.set({start:u,end:u,visible:!0}),t.create(p)},i=()=>{const{node:u}=this;u?.toggleActive(!0),u?.toggleHandles({start:!0})},s=()=>{t.showTextInput(),this.datum&&(this.datum.visible=!1)},n=()=>{t.hideTextInput(),this.datum&&(this.datum.visible=!0),t.deselect()},o=u=>{this.node?.setTextInputBBox(u),t.update()},a=({point:u})=>{const{datum:p,node:g}=this;p?.set({end:u}),g?.toggleActive(!0),g?.toggleHandles({end:!1}),t.update()},r=()=>{t.showAnnotationOptions(),this.node?.toggleHandles({end:!0})},l=({colorPickerType:u,colorOpacity:p,color:g,opacity:f,isMultiColor:m})=>{const{datum:y}=this;y&&(u==="text-color"&&t.updateTextInputColor(g),setColor(y,u,p,g,f,m),t.update())},c=u=>{const{datum:p,node:g}=this;!p||!g||!isTextType(p)||(p.fontSize=u,t.updateTextInputFontSize(u),t.update())},h=()=>{t.delete()},d=({textInputValue:u,bbox:p})=>{const{datum:g}=this;if(p!=null&&u!=null&&u.length>0){if(!isTextType(g))return;const f=wrapText(g,u,p.width);g?.set({text:f}),t.update(),t.recordAction(`Create ${g?.type} annotation`)}else t.delete()};super("start",{start:{click:{target:"waiting-first-render",action:e},dragStart:{target:"waiting-first-render",action:e},cancel:StateMachine4.parent,reset:StateMachine4.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:StateMachine4.parent,action:h},cancel:{target:StateMachine4.parent,action:h}},edit:{onEnter:s,updateTextInputBBox:o,color:l,fontSize:c,textInput:[{guard:guardCancelAndExit,target:StateMachine4.parent,action:h},{guard:guardSaveAndExit,target:StateMachine4.parent,action:d}],click:{target:StateMachine4.parent,action:d},dragStart:{target:StateMachine4.parent,action:d},resize:{target:StateMachine4.parent,action:d},onExit:n,cancel:{target:StateMachine4.parent,action:h}}}),this.debug=Debug4.create(!0,"annotations")}};__decorateClass([StateMachineProperty4()],TextualStartEndStateMachine.prototype,"datum",2),__decorateClass([StateMachineProperty4()],TextualStartEndStateMachine.prototype,"node",2);var CalloutStateMachine=class extends TextualStartEndStateMachine{createDatum(){return new CalloutProperties}},calloutConfig={type:"callout",datum:CalloutProperties,scene:CalloutScene,isDatum:CalloutProperties.is,translate:(t,e,i,s)=>{if(CalloutProperties.is(e)&&CalloutScene.is(t))return t.translate(e,i,s)},copy:(t,e,i,s)=>{if(CalloutProperties.is(e)&&CalloutProperties.is(i)&&CalloutScene.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{CalloutProperties.is(e)&&CalloutScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new CalloutStateMachine({...t,create:e("callout")}),dragState:t=>new DragStateMachine(t)},TextualPointScene=class extends PointScene{constructor(){super(...arguments),this.label=new module_support_exports.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(t){this.textInputBBox=t,this.markDirty("TextualPointScene")}update(t,e){const i=convertPoint(t,e),s=this.getTextBBox(t,i,e);this.updateLabel(t,s),this.updateHandle(t,i,s),this.updateShape(t,s),this.anchor=this.updateAnchor(t,s,e)}copy(t,e,i){const s=convertPoint(t,i),n=this.getTextBBox(t,s,i),o=t.getPadding(),a=o.left+o.right,r=o.top+o.bottom,l=(n.width+a)/2,c=n.height+r,h=invertCoords({x:s.x-l,y:s.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:s}=t.getText();return getBBox(t,s,{x:e.x,y:e.y},this.textInputBBox)}updateLabel(t,e){const{text:i,isPlaceholder:s}=t.getText();updateTextNode(this.label,i,s,t,this.getLabelCoords(t,e),this.getTextBaseline(t))}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}getTextBaseline(t){return t.position=="center"?"middle":t.position}getHandleCoords(t,e,i){return i}getHandleStyles(t){const e=super.getHandleStyles(t);return e.stroke=t.handle.stroke??t.color,e}},{drawCorner:drawCorner3}=module_support_exports,CommentScene=class extends TextualPointScene{constructor(){super(),this.type="comment",this.shape=new module_support_exports.Path,this.append([this.shape,this.label,this.handle])}static is(t){return AnnotationScene.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 s=super.updateAnchor(t,e,i),n=t.getPadding();return s.y-=n.bottom+n.top,s}updatePath(t,e){const i=t.getPadding(),{x:s,y:n}=e;let{width:o,height:a}=e;const{fontSize:r}=t,l=i.left+i.right,c=i.top+i.bottom;o=o+l,a=Math.max(a+c,r+c);const h=n-a,d=s+o,u=(r*ANNOTATION_TEXT_LINE_HEIGHT+c)/2,{path:p}=this.shape;p.clear(),p.moveTo(s,n),p.lineTo(s,h+u),drawCorner3(p,{x0:s,x1:s+u,y0:h+u,y1:h,cx:s+u,cy:h+u},u,!1),p.lineTo(d-u,h),drawCorner3(p,{x0:d-u,x1:d,y0:h,y1:h+u,cx:d-u,cy:h+u},u,!1),p.lineTo(d,n-u),drawCorner3(p,{x0:d,x1:d-u,y0:n-u,y1:n,cx:d-u,cy:n-u},u,!1),p.closePath()}containsPoint(t,e){return super.containsPoint(t,e)||this.shape.containsPoint(t,e)}},{StateMachine:StateMachine5,StateMachineProperty:StateMachineProperty5,Debug:Debug5}=module_support_exports,TextualPointStateMachine=class extends StateMachine5{constructor(t){const e=({point:h})=>{const d=this.createDatum();d.set({x:h.x,y:h.y}),t.create(d)},i=()=>{this.node?.toggleActive(!0),t.showAnnotationOptions(),t.update()},s=()=>{t.showTextInput(),this.datum&&(this.datum.visible=!1)},n=()=>{t.hideTextInput(),this.datum&&(this.datum.visible=!0),t.deselect()},o=h=>{this.node?.setTextInputBBox(h),t.update()},a=({colorPickerType:h,colorOpacity:d,color:u,opacity:p,isMultiColor:g})=>{this.datum&&(h==="text-color"&&t.updateTextInputColor(u),setColor(this.datum,h,d,u,p,g),t.update())},r=h=>{const{datum:d,node:u}=this;!d||!u||!isTextType(d)||(d.fontSize=h,t.updateTextInputFontSize(h),t.update())},l=()=>{t.delete()},c=({textInputValue:h,bbox:d})=>{if(d!=null&&h!=null&&h.length>0){const{datum:u}=this;if(!isTextType(u))return;const p=wrapText(u,h,d.width);u?.set({text:p}),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:StateMachine5.parent,reset:StateMachine5.parent},"waiting-first-render":{render:{target:"edit",action:i}},edit:{onEnter:s,updateTextInputBBox:o,color:a,fontSize:r,textInput:[{guard:guardCancelAndExit,target:StateMachine5.parent,action:l},{guard:guardSaveAndExit,target:StateMachine5.parent,action:c}],click:{target:StateMachine5.parent,action:c},dragStart:{target:StateMachine5.parent,action:c},resize:{target:StateMachine5.parent,action:c},onExit:n,cancel:{target:StateMachine5.parent,action:l}}}),this.debug=Debug5.create(!0,"annotations")}};__decorateClass([StateMachineProperty5()],TextualPointStateMachine.prototype,"datum",2),__decorateClass([StateMachineProperty5()],TextualPointStateMachine.prototype,"node",2);var CommentStateMachine=class extends TextualPointStateMachine{createDatum(){return new CommentProperties}},commentConfig={type:"comment",datum:CommentProperties,scene:CommentScene,isDatum:CommentProperties.is,translate:(t,e,i,s)=>{CommentProperties.is(e)&&CommentScene.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(CommentProperties.is(e)&&CommentProperties.is(i)&&CommentScene.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{CommentProperties.is(e)&&CommentScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new CommentStateMachine({...t,create:e("comment")}),dragState:t=>new DragStateMachine(t)},{calculateLabelTranslation:calculateLabelTranslation2,ChartAxisDirection:ChartAxisDirection7}=module_support_exports,AxisLabelScene=class extends module_support_exports.Group{constructor(){super({name:"AnnotationAxisLabelGroup"}),this.label=new module_support_exports.Text({zIndex:1}),this.rect=new module_support_exports.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:s,fontSize:n,fontStyle:o,fontFamily:a,textAlign:r,color:l="white",formatter:c}=e,h=c?c({value:t}):i.scaleValueFormatter()(t);this.label.setProperties({fontWeight:s,fontSize:n,fontStyle:o,fontFamily:a,textAlign:r,fill:l,text:h})}updateRect({styles:t}){const{rect:e}=this,{cornerRadius:i,fill:s,fillOpacity:n,stroke:o,strokeOpacity:a}=t;e.setProperties({cornerRadius:i,fill:s,fillOpacity:n,stroke:o,strokeOpacity:a})}updatePosition({x:t,y:e,context:i,styles:{padding:s}}){const{label:n,rect:o}=this,a=n.getBBox()?.clone(),r=s??8,l=s??5;a.grow(r,"horizontal"),a.grow(l,"vertical");const c=i.direction===ChartAxisDirection7.X?Math.round(l/2):r,{xTranslation:h,yTranslation:d}=calculateLabelTranslation2({yDirection:!0,padding:i.labelPadding-c,position:i.position??"left",bbox:a}),u=t+h,p=e+d;n.x=u,n.y=p,o.y=p-Math.round(a.height/2),o.x=u-Math.round(a.width/2),o.height=a.height,o.width=a.width}};AxisLabelScene.className="AxisLabel";var{Vec2:Vec28}=module_support_exports,CollidableLine=class extends module_support_exports.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:s,x2:n,y2:o}=this;let a=e+t;a%2===0&&(a+=1);const r=Vec28.from(i,s-Math.floor(a/2)),l=Vec28.from(n,o),c=Vec28.distance(r,l);this.collisionBBox=new module_support_exports.BBox(r.x,r.y,c,a)}isPointInPath(t,e){const{collisionBBox:i,x1:s,y1:n,x2:o,y2:a}=this;if(!i)return!1;const r=Vec28.from(s,n),l=Vec28.from(o,a),c=Vec28.sub(Vec28.from(t,e),r),h=Vec28.sub(l,r),d=Vec28.rotate(c,Vec28.angle(c,h),r);return i.containsPoint(d.x,d.y)??!1}render(t){this.applyClipMask(t.ctx),super.render(t),this.closeClipMask(t.ctx)}setClipMask(t,e){const i=this.clipMask.get(t);module_support_exports.jsonDiff(i,e)!=null&&this.markDirty("CollidableLine"),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:s,y:n,radius:o}=i;t.save(),t.beginPath(),t.rect(0,0,t.canvas.width,t.canvas.height),t.ellipse(s,n,o,o,0,Math.PI*2,0,!0),t.clip()})}closeClipMask(t){this.clipMask.size!==0&&t.restore()}},CollidableText=class extends module_support_exports.TransformableText{constructor(){super(...arguments),this.growCollisionBox={top:4,right:4,bottom:4,left:4}}isPointInPath(t,e){const i=this.fromParentPoint(t,e),s=this.computeBBoxWithoutTransforms();return s?s.grow(this.growCollisionBox).containsPoint(i.x,i.y):!1}},{Vec2:Vec29}=module_support_exports;function updateLineText(t,e,i,s,n,o,a){if(!o||!n||!s){e.setClipMask(t);return}const{alignment:r,position:l}=s,c=getNumbers(i,s.fontSize,a),{point:h,textBaseline:d}=positionAndAlignment(c,l,r);setProperties(n,o,s,h,c.angle,d);const{x:u,y:p,width:g,height:f}=n.getBBox(),m=Vec29.length(Vec29.from(g,f)),y={x:u+g/2,y:p+f/2,radius:m/2+Vec29.length(c.offset)};return l==="center"?e.setClipMask(t,y):e.setClipMask(t),{clipMask:y,numbers:c}}function updateChannelText(t,e,i,s,n,o,a){if(!a||!o)return;const{alignment:r,position:l}=s,[c,h]=e.y1<=i.y1?[e,i]:[i,e];let d=c;l==="bottom"?d=h:l==="inside"&&(d={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=getNumbers(d,s.fontSize,n),{point:p,textBaseline:g}=positionAndAlignment(u,l==="inside"?"center":l,r,t);setProperties(o,a,s,p,u.angle,g)}function getNumbers(t,e,i){let[s,n]=Vec29.from(t);s.x>n.x&&([s,n]=[n,s]);const o=Vec29.normalized(Vec29.sub(n,s)),a=Vec29.angle(o),r=Vec29.multiply(o,DivariantHandle.HANDLE_SIZE/2+(e??14)/2),l=Vec29.multiply(o,(i??2)/2+(e??14)/3);return{left:s,right:n,normal:o,angle:a,inset:r,offset:l}}function positionAndAlignment({left:t,right:e,normal:i,angle:s,inset:n,offset:o},a,r,l){let c;r==="right"?c=Vec29.sub(e,n):r==="center"?c=Vec29.add(t,Vec29.multiply(i,Vec29.distance(t,e)/2)):c=Vec29.add(t,n);let h="bottom";return a==="bottom"?(c=Vec29.rotate(o,s+Math.PI/2,c),h="top"):a==="center"&&!l?h="middle":c=Vec29.rotate(o,s-Math.PI/2,c),{point:c,textBaseline:h}}function setProperties(t,e,i,s,n,o){t.setProperties({text:e,x:s.x,y:s.y,rotation:n,rotationCenterX:s.x,rotationCenterY:s.y,fill:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,fontWeight:i.fontWeight,textAlign:i.alignment,textBaseline:o})}var{ChartAxisDirection:ChartAxisDirection8,Vec2:Vec210,Vec4:Vec45}=module_support_exports,CrossLineScene=class extends AnnotationScene{constructor(){super(),this.type="cross-line",this.line=new CollidableLine,this.middle=new UnivariantHandle,this.isHorizontal=!1,this.append([this.line,this.middle])}static is(t){return AnnotationScene.isCheck(t,"cross-line")}update(t,e){const{seriesRect:i}=e;this.seriesRect=i,this.isHorizontal=HorizontalLineProperties.is(t);const s=this.isHorizontal?e.yAxis:e.xAxis,n=this.convertCrossLine(t,s);if(n==null){this.visible=!1;return}this.visible=t.visible??!0,this.visible&&(this.updateLine(t,n),this.updateHandle(t,n),this.updateText(t,n),this.updateAxisLabel(t,s,n))}updateLine(t,e){const{line:i}=this,{lineDashOffset:s,stroke:n,strokeWidth:o,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:s,stroke:n,strokeWidth:o,strokeOpacity:a,fillOpacity:0})}updateHandle(t,e){const{middle:i}=this,{locked:s,stroke:n,strokeWidth:o,strokeOpacity:a}=t,r={fill:t.handle.fill,stroke:t.handle.stroke??n,strokeOpacity:t.handle.strokeOpacity??a,strokeWidth:t.handle.strokeWidth??o},l=Vec210.sub(Vec45.center(e),Vec210.from(i.handle.width/2,i.handle.height/2));i.gradient=this.isHorizontal?"horizontal":"vertical",i.update({...r,...l}),i.toggleLocked(s??!1)}updateText(t,e){this.text=this.updateNode(CollidableText,this.text,!!t.text.label),updateLineText(this.line.id,this.line,e,t.text,this.text,t.text.label,t.strokeWidth)}createAxisLabel(t){const e=new AxisLabelScene;return t.attachLabel(e),e}updateAxisLabel(t,e,i){this.axisLabel||(this.axisLabel=this.createAxisLabel(e));const{axisLabel:s,seriesRect:n}=this,{direction:o,position:a}=e;if(t.axisLabel.enabled){s.visible=this.visible;const r=a==="left"||a==="top"?Vec45.start(i):Vec45.end(i),l=o===ChartAxisDirection8.X?r.x:r.y;if(!e.inRange(l)){s.visible=!1;return}const c=getGroupingValue(t.value);s.update({...Vec210.add(r,Vec210.required(n)),value:c,styles:t.axisLabel,context:e})}else s.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 s=HorizontalLineProperties.is(t)?{x:e.x,y:convert(t.value,i.yAxis)}:{x:convert(t.value,i.xAxis),y:e.y};this.dragState={offset:e,middle:s}}drag(t,e,i){const{activeHandle:s,dragState:n}=this;t.locked||!n||(s&&this[s].toggleDragging(!0),this.translatePoint(t,n.middle,Vec210.sub(e,n.offset),i))}translate(t,e,i){if(t.locked)return;const s=HorizontalLineProperties.is(t)?Vec210.from(0,convert(t.value,i.yAxis)):Vec210.from(convert(t.value,i.xAxis),0);this.translatePoint(t,s,e,i)}translatePoint(t,e,i,s){const n=HorizontalLineProperties.is(t);n?i.x=0:i.y=0;const{point:o}=translate({point:e},i,s);t.value=n?o.y:o.x}stopDragging(){this.middle.toggleDragging(!1)}copy(t,e,i){const s=HorizontalLineProperties.is(t),n=this.isHorizontal?i.yAxis:i.xAxis,o=this.convertCrossLine(t,n);if(!o)return;const a=s?-30:0,r=s?0:-30,l=invertCoords({x:o.x1+r,y:o.y1+a},i);return e.set({value:s?l.y:l.x}),e}getCursor(){return this.activeHandle==null?"pointer":this[this.activeHandle].getCursor()}containsPoint(t,e){const{middle:i,line:s,text:n}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="middle",!0):s.isPointInPath(t,e)||!!n?.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,s=0,n,o;const{bounds:a}=e,r=convert(t.value,e);return HorizontalLineProperties.is(t)?(n=a.width,s=r,o=r):(i=r,n=r,o=a.height),{x1:i,y1:s,x2:n,y2:o}}},{StateMachine:StateMachine6,StateMachineProperty:StateMachineProperty6,Debug:Debug6}=module_support_exports,CrossLineStateMachine=class extends StateMachine6{constructor(t,e){const i=({point:n})=>{const o=t==="horizontal",a=o?new HorizontalLineProperties:new VerticalLineProperties;a.set({value:o?n.y:n.x}),e.create(a),e.recordAction(`Create ${o?"horizontal-line":"vertical-line"} annotation`)},s=()=>{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:StateMachine6.parent,cancel:StateMachine6.parent},"waiting-first-render":{render:{target:StateMachine6.parent,action:s}}}),this.debug=Debug6.create(!0,"annotations")}};__decorateClass([StateMachineProperty6()],CrossLineStateMachine.prototype,"node",2);var horizontalLineConfig={type:"horizontal-line",datum:HorizontalLineProperties,scene:CrossLineScene,isDatum:HorizontalLineProperties.is,translate:(t,e,i,s)=>{HorizontalLineProperties.is(e)&&CrossLineScene.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(HorizontalLineProperties.is(e)&&HorizontalLineProperties.is(i)&&CrossLineScene.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{HorizontalLineProperties.is(e)&&CrossLineScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new CrossLineStateMachine("horizontal",{...t,create:e("horizontal-line")}),dragState:t=>new DragStateMachine(t)},verticalLineConfig={type:"vertical-line",datum:VerticalLineProperties,scene:CrossLineScene,isDatum:VerticalLineProperties.is,translate:(t,e,i,s)=>{VerticalLineProperties.is(e)&&CrossLineScene.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(VerticalLineProperties.is(e)&&VerticalLineProperties.is(i)&&CrossLineScene.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{VerticalLineProperties.is(e)&&CrossLineScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new CrossLineStateMachine("vertical",{...t,create:e("vertical-line")}),dragState:t=>new DragStateMachine(t)},{Vec4:Vec46}=module_support_exports,WithBackgroundScene=class{static updateBackground(t,e,i,s){const{background:n}=this,{seriesRect:o}=s;n.path.clear(!0);const a=Vec46.from(0,0,o.width,o.height),r=this.getBackgroundPoints(t,e,i,a);for(let c=0;c<r.length;c++){const h=r[c];c===0?n.path.moveTo(h.x,h.y):n.path.lineTo(h.x,h.y)}n.path.closePath(),n.checkPathDirty();const l=this.getBackgroundStyles?.(t)??t.background;n.setProperties({fill:l.fill,fillOpacity:l.fillOpacity})}},ChannelScene=class extends LinearScene{constructor(){super(...arguments),this.handles={},this.overflowContinuous=2,this.topLine=new CollidableLine,this.bottomLine=new CollidableLine,this.background=new module_support_exports.Path({zIndex:-1}),this.anchor={x:0,y:0},this.updateBackground=WithBackgroundScene.updateBackground.bind(this)}update(t,e){const{locked:i,visible:s}=t,n=convertLine(t,e),o=convertLine(t.bottom,e);if(n==null||o==null){this.visible=!1;return}else this.visible=s??!0;const a=this.extendLine(n,t,e),r=this.extendLine(o,t,e);this.updateLines(t,a,r,e,n,o),this.updateHandles(t,n,o),this.updateText(t,n,o),this.updateBackground(t,a,r,e),this.updateAnchor(n,o);for(const l of Object.values(this.handles))l.toggleLocked(i??!1)}toggleHandles(t){const{handles:e}=this;if(typeof t=="boolean"){for(const[i,s]of Object.entries(e))s.visible=t,s.toggleHovered(this.activeHandle===i);return}for(const[i,s]of Object.entries(t)){const n=e[i];n.visible=s??!0,n.toggleHovered(this.activeHandle===i)}}toggleActive(t){this.toggleHandles(t);for(const e of Object.values(this.handles))e.toggleActive(t)}stopDragging(){const{activeHandle:t,handles:e}=this;t!=null&&e[t].toggleDragging(!1)}getAnchor(){return this.anchor}getCursor(){return this.activeHandle==null?"pointer":this.handles[this.activeHandle].getCursor()}containsPoint(t,e){const{handles:i,topLine:s,bottomLine:n,text:o}=this;this.activeHandle=void 0;for(const[a,r]of Object.entries(i))if(r.containsPoint(t,e))return this.activeHandle=a,!0;return s.containsPoint(t,e)||n.containsPoint(t,e)||!!o?.containsPoint(t,e)}getNodeAtCoords(t,e){if(this.text?.containsPoint(t,e))return"text";if(this.topLine.containsPoint(t,e)||this.bottomLine.containsPoint(t,e))return"line";for(const[i,s]of Object.entries(this.handles))if(s.containsPoint(t,e))return"handle"}updateAnchor(t,e){const{x:i,y:s}=module_support_exports.Transformable.toCanvasPoint(this.topLine,(t.x1+t.x2)/2,Math.min(t.y1,t.y2,e.y1,e.y2));this.anchor.x=i,this.anchor.y=s}},{Vec2:Vec211,Vec4:Vec47}=module_support_exports,DisjointChannelScene=class extends ChannelScene{constructor(){super(),this.type="disjoint-channel",this.handles={topLeft:new DivariantHandle,topRight:new DivariantHandle,bottomLeft:new DivariantHandle,bottomRight:new UnivariantHandle},this.append([this.background,this.topLine,this.bottomLine,...Object.values(this.handles)])}static is(t){return AnnotationScene.isCheck(t,"disjoint-channel")}dragHandle(t,e,i,s){const{activeHandle:n,handles:o}=this;if(n==null)return;const{offset:a}=o[n].drag(e);o[n].toggleDragging(!0),n==="bottomRight"&&(a.x=0);let r=[],l=[],c=s;switch(n){case"topLeft":r=["topLeft"],l=["bottomLeft"];break;case"bottomLeft":r=["bottomLeft"],l=["topLeft"];break;case"topRight":r=["topRight"],l=["bottomRight"];break;case"bottomRight":r=["bottomLeft","bottomRight"],c=!1;break}const h=convertLine(t,i),d=convertLine(t.bottom,i);if(!h||!d)return;const u={topLeft:Vec47.start(h),topRight:Vec47.end(h),bottomLeft:Vec47.start(d),bottomRight:Vec47.end(d)},p={vectors:{topLeft:u.topRight,bottomLeft:u.bottomRight,topRight:u.topLeft,bottomRight:u.bottomLeft},angle:t.snapToAngle},g=translate(u,a,i,{overflowContinuous:this.overflowContinuous,translateVectors:r,invertYVectors:l,snap:c?p:void 0});t.start.x=g.topLeft.x,t.start.y=g.topLeft.y,t.end.x=g.topRight.x,t.end.y=g.topRight.y,t.startHeight=g.topLeft.y-g.bottomLeft.y,t.endHeight=g.topRight.y-g.bottomRight.y}getTranslatePointsVectors(t,e){const{bottomLeft:i,bottomRight:s,topLeft:n,topRight:o}=this.handles,a=i.getBBox().y-n.getBBox().y,r=s.getBBox().y-o.getBBox().y,l=Vec211.add(t,Vec211.from(0,a)),c=Vec211.add(e,Vec211.from(0,r));return{start:t,end:e,bottomStart:l,bottomEnd:c}}updateLines(t,e,i){const{topLine:s,bottomLine:n}=this,{lineDashOffset:o,stroke:a,strokeOpacity:r,strokeWidth:l}=t,c={lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:o,stroke:a,strokeOpacity:r,strokeWidth:l};s.setProperties({...e,...c}),n.setProperties({...i,...c})}updateHandles(t,e,i){const{handles:{topLeft:s,topRight:n,bottomLeft:o,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};s.update({...r,...Vec47.start(e)}),n.update({...r,...Vec47.end(e)}),o.update({...r,...Vec47.start(i)}),a.update({...r,...Vec211.sub(Vec47.end(i),Vec211.from(a.handle.width/2,a.handle.height/2))})}updateText(t,e,i){this.text=this.updateNode(CollidableText,this.text,!!t.text.label),updateChannelText(!1,e,i,t.text,t.strokeWidth,this.text,t.text.label)}getBackgroundPoints(t,e,i,s){const n=e.x1>e.x2,o=e.y1>e.y2,a=o?s.y2:s.y1,r=o?s.y1:s.y2,l=Vec211.from(e);return t.extendEnd&&e.y2===r&&l.push(Vec211.from(n?s.x1:s.x2,o?s.y1:s.y2)),t.extendEnd&&i.y2===a&&l.push(Vec211.from(n?s.x1:s.x2,o?s.y2:s.y1)),l.push(...Vec211.from(i).reverse()),t.extendStart&&i.y1===r&&l.push(Vec211.from(n?s.x2:s.x1,o?s.y1:s.y2)),t.extendStart&&e.y1===a&&l.push(Vec211.from(n?s.x2:s.x1,o?s.y2:s.y1)),l}},{StateMachine:StateMachine7,StateMachineProperty:StateMachineProperty7,Debug:Debug7}=module_support_exports,DisjointChannelStateMachine=class extends StateMachine7{constructor(t){const e=({point:l})=>{const c=new DisjointChannelProperties;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})},s=({offset:l,context:c})=>{const{datum:h,snapping:d}=this;h&&(h.set({end:snapPoint(l,c,d,h.start,h.snapToAngle)}),t.update())},n=()=>{this.node?.toggleHandles({topRight:!0}),t.update()},o=({point:l})=>{const{datum:c,node:h}=this,d=getGroupingValue(c?.end.y),u=getGroupingValue(c?.start.y),{y:p}=l;if(c==null||!isNumber(u)||!isNumber(d)||!isNumber(p))return;const g=d-(p??0),f=(u-d)*2+g,m={x:c?.start.x,y:u-f},y={x:c?.end.x,y:l.y};h?.toggleHandles({bottomLeft:!0,bottomRight:!0}),!(!t.validatePoint(m,{overflowContinuous:!0})||!t.validatePoint(y,{overflowContinuous:!0}))&&(c.set({startHeight:f,endHeight:g}),t.update())},a=({point:l})=>{const{datum:c,node:h}=this,d=getGroupingValue(c?.end.y),u=getGroupingValue(c?.start.y),{y:p}=l;if(c==null||!isNumber(u)||!isNumber(d)||!isNumber(p))return;const g=d-(p??0),f=(u-d)*2+g,m={x:c.start.x,y:u-g},y={x:c.end.x,y:l.y};h?.toggleHandles(!0),!(!t.validatePoint(m,{overflowContinuous:!0})||!t.validatePoint(y,{overflowContinuous:!0}))&&(c.set({startHeight:f,endHeight:g}),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:StateMachine7.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,drag:s,click:{target:"height",action:n},dragEnd:{target:"height",action:n},reset:{target:StateMachine7.parent,action:r},cancel:{target:StateMachine7.parent,action:r}},height:{hover:o,click:{target:StateMachine7.parent,action:a},drag:{target:StateMachine7.parent,action:a},reset:{target:StateMachine7.parent,action:r},cancel:{target:StateMachine7.parent,action:r}}}),this.debug=Debug7.create(!0,"annotations"),this.snapping=!1}};__decorateClass([StateMachineProperty7()],DisjointChannelStateMachine.prototype,"datum",2),__decorateClass([StateMachineProperty7()],DisjointChannelStateMachine.prototype,"node",2),__decorateClass([StateMachineProperty7()],DisjointChannelStateMachine.prototype,"snapping",2);var disjointChannelConfig={type:"disjoint-channel",datum:DisjointChannelProperties,scene:DisjointChannelScene,isDatum:DisjointChannelProperties.is,translate:(t,e,i,s)=>{DisjointChannelProperties.is(e)&&DisjointChannelScene.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(DisjointChannelProperties.is(e)&&DisjointChannelProperties.is(i)&&DisjointChannelScene.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{DisjointChannelProperties.is(e)&&DisjointChannelScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new DisjointChannelStateMachine({...t,create:e("disjoint-channel")}),dragState:t=>new DragStateMachine(t)},FIBONACCI_RETRACEMENT_RATIOS=[0,23.6,38.2,50,61.8,78.6,100],FIBONACCI_EXTENSION_RATIOS=[161.8,261.8,361.8,423.6],FIBONACCI_RATIOS=[...FIBONACCI_RETRACEMENT_RATIOS,...FIBONACCI_EXTENSION_RATIOS],FIBONACCI_RATIOS_MAP={10:FIBONACCI_RATIOS,6:FIBONACCI_RETRACEMENT_RATIOS,4:FIBONACCI_RETRACEMENT_RATIOS.filter(t=>t!==78.6&&t!==23.6)},FIBONACCI_RANGE_LABEL_PADDING=10;function getFibonacciCoords(t,e){const{x2:i,y1:s,y2:n}=t,o=s-n;return e==null?{x1:i,x2:i,y1:n-o,y2:n}:{x1:e.x1,x2:e.x2,y1:e.y2-o,y2:e.y2}}function createFibonacciRangesData({x1:t,y1:e,x2:i,y2:s},n,o,a,r=10){const l=e-s,c=o?-1:1;let h=a;const d=[];return FIBONACCI_RATIOS_MAP[r].forEach((u,p)=>{const g=a+l*(u/100)*c,f=n.yAxis.scaleInvert(g);d.push({id:p,x1:t,x2:i,y1:h,y2:g,tag:u==100?0:1,label:{x1:Math.min(t,i)-FIBONACCI_RANGE_LABEL_PADDING,x2:i,y1:g,y2:g,text:`${(u/100).toFixed(3)} (${f.toFixed(2)})`}}),h=g}),d}var{Vec2:Vec212,Vec4:Vec48}=module_support_exports,FibonacciScene=class extends AnnotationScene{constructor(){super(),this.trendLine=new CollidableLine,this.rangeFillsGroup=new module_support_exports.Group({name:`${this.id}-range-fills`}),this.rangeFillsGroupSelection=module_support_exports.Selection.select(this.rangeFillsGroup,module_support_exports.Range),this.rangeStrokesGroup=new module_support_exports.Group({name:`${this.id}-range-strokes`}),this.rangeStrokesGroupSelection=module_support_exports.Selection.select(this.rangeStrokesGroup,CollidableLine),this.labelsGroup=new module_support_exports.Group({name:`${this.id}-ranges-labels`}),this.labelsGroupSelection=module_support_exports.Selection.select(this.labelsGroup,CollidableText),this.anchor={x:0,y:0,position:"above"},this.append([this.trendLine,this.rangeFillsGroup,this.rangeStrokesGroup,this.labelsGroup])}update(t,e){let i=convertLine(t,e);if(i==null){this.visible=!1;return}if(i=Vec48.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:s}=t,n=this.extendLine(i,t,e),o=s?n.y1:n.y2,a=s?n.y2:n.y1,r=createFibonacciRangesData(n,e,t.reverse,o,t.bands);this.updateRanges(t,r,e);const l={...n,y1:a,y2:a};this.updateText(t,l)}extendLine({x1:t,y1:e,x2:i,y2:s},n,o){const a={x1:t,y1:e,x2:i,y2:s};if(!n.extendStart&&!n.extendEnd)return a;const{x:r,width:l}=o.xAxis.bounds;return n.extendEnd&&(a[t>i?"x1":"x2"]=r+l),n.extendStart&&(a[t>i?"x2":"x1"]=r),a}updateLine(t,e,i){if(!e||!i)return;const{lineDashOffset:s,strokeWidth:n,strokeOpacity:o,stroke:a}=t;i.setProperties({...e,lineCap:t.getLineCap(),lineDash:[3,4],lineDashOffset:s,strokeWidth:n,strokeOpacity:o,fillOpacity:0,stroke:a})}updateRangeStrokes(t){const{lineDashOffset:e,strokeWidth:i,strokeOpacity:s,strokes:n,rangeStroke:o,isMultiColor:a}=t;this.rangeStrokesGroupSelection.each((r,{x1:l,x2:c,y2:h,tag:d},u)=>{const p=h,g=a?n[u%n.length]:o;r.setProperties({x1:l,x2:c,y1:p,y2:p,stroke:g,strokeOpacity:s,strokeWidth:i,lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:e,tag:d})})}updateRanges(t,e,i){const s=n=>n.id;this.rangeFillsGroupSelection.update(e,void 0,s),this.rangeStrokesGroupSelection.update(e,void 0,s),this.labelsGroupSelection.update(e,void 0,s),this.updateRangeFills(t),this.updateRangeStrokes(t),this.updateRangeLabels(t,i)}updateRangeFills(t){const{lineDashOffset:e,strokeWidth:i,strokeOpacity:s,strokes:n,rangeStroke:o,showFill:a,isMultiColor:r}=t;this.rangeFillsGroupSelection.each((l,{x1:c,x2:h,y1:d,y2:u},p)=>{const g=r?n[p%n.length]:o;if(!a){l.visible=!1;return}l.setProperties({x1:c,x2:h,y1:d,y2:u,startLine:!1,endLine:!1,isRange:!0,stroke:g,strokeOpacity:s,fill:g,fillOpacity:(s??1)*.15,strokeWidth:i,lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:e,visible:!0})})}updateRangeLabels(t,{xAxis:e}){const{rangeStrokesGroupSelection:i}=this,{strokes:s,strokeWidth:n,rangeStroke:o,isMultiColor:a,label:{fontFamily:r,fontSize:l,fontStyle:c,fontWeight:h,color:d}}=t,u={fontFamily:r,fontSize:l,fontStyle:c,fontWeight:h},p=this.checkWithinBounds(e,u,this.labelsGroupSelection.at(0));this.labelsGroupSelection.each((g,f,m)=>{const y=d??(a?s[m%s.length]:o),x=i.at(m);if(!x)return;const{text:b,...S}=f.label;if(p)g.setProperties({...u,text:b,x:S.x1,y:S.y1,textBaseline:"middle",textAlign:"end",fill:y}),updateLineText(g.id,x,S);else{const v={...u,label:b,position:"center",alignment:"left",color:y};updateLineText(g.id,x,S,v,g,b,n)}})}checkWithinBounds(t,e,i){if(!i)return!1;const{text:s,...n}=i.datum.label;i.setProperties({...e,text:s,x:n.x1,y:n.y1,textBaseline:"middle",textAlign:"end"});const{x:o}=i.getBBox();return o>=t.bounds.x&&o<=t.bounds.x+t.bounds.width}updateText(t,e){const i=this.rangeStrokesGroupSelection.selectByTag(0)[0];if(!i)return;const{text:s,strokeWidth:n}=t;this.text=this.updateNode(CollidableText,this.text,!!s.label),updateLineText(i.id,i,e,s,this.text,s.label,n)}updateAnchor(t,e,i,s){const n=Vec48.topCenter(e);Vec212.apply(this.anchor,module_support_exports.Transformable.toCanvasPoint(this.trendLine,n.x,n.y))}containsPoint(t,e){const{trendLine:i,rangeStrokesGroupSelection:s,text:n}=this;let o=!1;return s.each(a=>o||(o=a.isPointInPath(t,e))),o||i.isPointInPath(t,e)||!!n?.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,s){t.locked||(this.activeHandle?this.dragHandle(t,e,i,s):this.dragAll(t,e,i))}getAnchor(){return this.anchor}getCursor(){return"pointer"}},{Vec2:Vec213,Vec4:Vec49}=module_support_exports,FibonacciRetracementTrendBasedScene=class extends FibonacciScene{constructor(){super(),this.type="fibonacci-retracement-trend-based",this.endRetracementLine=new CollidableLine,this.start=new DivariantHandle,this.end=new DivariantHandle,this.endRetracement=new DivariantHandle,this.append([this.endRetracementLine,this.start,this.end,this.endRetracement])}static is(t){return AnnotationScene.isCheck(t,"fibonacci-retracement-trend-based")}update(t,e){let{coords1:i,coords2:s}=this.getCoords(t,e);if(i==null||s==null){this.visible=!1;return}if(i=Vec49.round(i),s=Vec49.round(s),this.visible=t.visible??!0,!this.visible)return;(t.endRetracement.x==null||t.endRetracement.y==null)&&(s=void 0),this.updateLine(t,i,this.trendLine),this.updateLine(t,s,this.endRetracementLine),this.updateHandles(t,i,s),this.updateAnchor(t,s??i,e);const{reverse:n,bands:o}=t,a=getFibonacciCoords(i,s),r=this.extendLine(a,t,e),l=r.y2,c=r.y1,h=s?createFibonacciRangesData(r,e,n,l,o):[];this.updateRanges(t,h,e);const d={...r,y1:c,y2:c};this.updateText(t,d)}containsPoint(t,e){const{start:i,end:s,endRetracement:n,endRetracementLine:o}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="start",!0):s.containsPoint(t,e)?(this.activeHandle="end",!0):n.containsPoint(t,e)?(this.activeHandle="endRetracement",!0):o.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,...getDragStartState({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:s}=this;s&&this.translatePoints({datum:t,start:s.start,end:s.end,endRetracement:s.endRetracement,translation:Vec213.sub(e,s.offset),context:i})}dragHandle(t,e,i,s){const{activeHandle:n,dragState:o}=this;if(!n||!o)return;this[n].toggleDragging(!0);const a=s?this.snapToAngle(t,e,i):invertCoords(this[n].drag(e).point,i);!a||!validateDatumPoint(i,a)||(t[n].x=a.x,t[n].y=a.y)}snapToAngle(t,e,i){const{activeHandle:s}=this,n=["start","end","endRetracement"];if(!s)return;const o=(n.indexOf(s)+1)%n.length,a=n[o];this[s].toggleDragging(!0);const r=convertPoint(t[a],i);return invertCoords(snapToAngle(e,r,t.snapToAngle),i)}translatePoints({datum:t,start:e,end:i,endRetracement:s,translation:n,context:o}){const a=translate({start:e,end:i,endRetracement:s},n,o,{overflowContinuous:2});t.start.x=a.start.x,t.end.x=a.end.x,t.endRetracement.x=a.endRetracement.x,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:convertPoint(t.start,i),end:convertPoint(t.end,i),endRetracement:convertPoint(t.endRetracement,i),translation:e,context:i})}copy(t,e,i){const{coords1:s,coords2:n}=this.getCoords(t,i);if(!s||!n)return;const o=this.computeBBoxWithoutHandles();return this.translatePoints({datum:e,start:Vec49.start(s),end:Vec49.end(s),endRetracement:Vec49.end(n),translation:{x:-o.width/2,y:-o.height/2},context:i}),e}getCoords(t,e){return{coords1:convertLine(t,e),coords2:convertLine({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 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,s){this.start.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"start")}),this.end.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"end",s)}),i&&this.endRetracement.update({...this.getHandleStyles(t),...this.getHandleCoords(t,i,"endRetracement",s)}),this.start.toggleLocked(t.locked??!1),this.end.toggleLocked(t.locked??!1),this.endRetracement.toggleLocked(t.locked??!1)}getHandleCoords(t,e,i,s){return i==="start"?Vec49.start(e):Vec49.end(e)}},{StateMachine:StateMachine8,StateMachineProperty:StateMachineProperty8,Debug:Debug8}=module_support_exports,FibonacciRetracementTrendBasedStateMachine=class extends StateMachine8{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})},s=({offset:c,context:h})=>{const{datum:d,snapping:u}=this;d&&(d.set({end:snapPoint(c,h,u,d.start,d.snapToAngle)}),t.update())},n=()=>{const{datum:c}=this;c&&(c.endRetracement.x=c.end.x,c.endRetracement.y=c.end.y,this.node?.toggleHandles({end:!0}),t.update())},o=({offset:c,context:h})=>{const{datum:d,snapping:u}=this;d&&(d.set({endRetracement:snapPoint(c,h,u,d.end,d.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:StateMachine8.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,click:{target:"endRetracement",action:n},drag:s,dragEnd:{target:"endRetracement",action:n},reset:{target:StateMachine8.parent,action:r},cancel:{target:StateMachine8.parent,action:r},onExit:l},endRetracement:{hover:o,click:{target:StateMachine8.parent,action:a},drag:{target:StateMachine8.parent,action:a},reset:{target:StateMachine8.parent,action:r},cancel:{target:StateMachine8.parent,action:r}}}),this.debug=Debug8.create(!0,"annotations"),this.snapping=!1}createDatum(){return new FibonacciRetracementTrendBasedProperties}};__decorateClass([StateMachineProperty8()],FibonacciRetracementTrendBasedStateMachine.prototype,"datum",2),__decorateClass([StateMachineProperty8()],FibonacciRetracementTrendBasedStateMachine.prototype,"node",2),__decorateClass([StateMachineProperty8()],FibonacciRetracementTrendBasedStateMachine.prototype,"snapping",2);var fibonacciRetracementTrendBasedConfig={type:"fibonacci-retracement-trend-based",datum:FibonacciRetracementTrendBasedProperties,scene:FibonacciRetracementTrendBasedScene,isDatum:FibonacciRetracementTrendBasedProperties.is,translate:(t,e,i,s)=>{FibonacciRetracementTrendBasedProperties.is(e)&&FibonacciRetracementTrendBasedScene.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(FibonacciRetracementTrendBasedProperties.is(e)&&FibonacciRetracementTrendBasedProperties.is(i)&&FibonacciRetracementTrendBasedScene.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{FibonacciRetracementTrendBasedProperties.is(e)&&FibonacciRetracementTrendBasedScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new FibonacciRetracementTrendBasedStateMachine({...t,create:e("fibonacci-retracement-trend-based")}),dragState:t=>new DragStateMachine(t)},{Vec2:Vec214,Vec4:Vec410}=module_support_exports,FibonacciRetracementScene=class extends FibonacciScene{constructor(){super(),this.type="fibonacci-retracement",this.start=new DivariantHandle,this.end=new DivariantHandle,this.append([this.start,this.end])}static is(t){return AnnotationScene.isCheck(t,"fibonacci-retracement")}containsPoint(t,e){const{start:i,end:s}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="start",!0):s.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,...getDragStartState({start:t.start,end:t.end},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}dragAll(t,e,i){const{dragState:s}=this;s&&this.translatePoints({datum:t,start:s.start,end:s.end,translation:Vec214.sub(e,s.offset),context:i})}dragHandle(t,e,i,s){const{activeHandle:n,dragState:o}=this;if(!n||!o)return;this[n].toggleDragging(!0);const a=s?this.snapToAngle(t,e,i):invertCoords(this[n].drag(e).point,i);!a||!validateDatumPoint(i,a)||(t[n].x=a.x,t[n].y=a.y)}snapToAngle(t,e,i){const{activeHandle:s}=this,o=["start","end"].find(r=>r!==s);if(!s||!o)return;this[s].toggleDragging(!0);const a=convertPoint(t[o],i);return invertCoords(snapToAngle(e,a,t.snapToAngle),i)}translatePoints({datum:t,start:e,end:i,translation:s,context:n}){const o=translate({start:e,end:i},s,n,{overflowContinuous:1});t.start.x=o.start.x,t.end.x=o.end.x,t.start.y=o.start.y,t.end.y=o.end.y}translate(t,e,i){this.translatePoints({datum:t,start:convertPoint(t.start,i),end:convertPoint(t.end,i),translation:e,context:i})}copy(t,e,i){const s=convertLine(t,i);if(!s)return;const n=this.computeBBoxWithoutHandles();return this.translatePoints({datum:e,start:{x:s.x1,y:s.y1},end:{x:s.x2,y:s.y2},translation:{x:-n.width/2,y:-n.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 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,s){this.start.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"start")}),this.end.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"end",s)}),this.start.toggleLocked(t.locked??!1),this.end.toggleLocked(t.locked??!1)}getHandleCoords(t,e,i,s){return i==="start"?Vec410.start(e):Vec410.end(e)}},{StateMachine:StateMachine9,StateMachineProperty:StateMachineProperty9,Debug:Debug9}=module_support_exports,LineTypeStateMachine=class extends StateMachine9{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})},s=({offset:r,context:l})=>{const{datum:c,snapping:h}=this;c&&(c.set({end:snapPoint(r,l,h,c.start,c.snapToAngle)}),t.update())},n=()=>{this.node?.toggleHandles({end:!0}),t.update()},o=()=>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:StateMachine9.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,click:{target:StateMachine9.parent,action:n},drag:s,dragEnd:{target:StateMachine9.parent,action:n},reset:{target:StateMachine9.parent,action:o},cancel:{target:StateMachine9.parent,action:o},onExit:a}}),this.debug=Debug9.create(!0,"annotations"),this.snapping=!1}};__decorateClass([StateMachineProperty9()],LineTypeStateMachine.prototype,"datum",2),__decorateClass([StateMachineProperty9()],LineTypeStateMachine.prototype,"node",2),__decorateClass([StateMachineProperty9()],LineTypeStateMachine.prototype,"snapping",2);var ArrowStateMachine=class extends LineTypeStateMachine{createDatum(){return new ArrowProperties}},LineStateMachine=class extends LineTypeStateMachine{createDatum(){return new LineProperties}},FibonacciRetracementStateMachine=class extends LineTypeStateMachine{createDatum(){return new FibonacciRetracementProperties}},fibonacciRetracementConfig={type:"fibonacci-retracement",datum:FibonacciRetracementProperties,scene:FibonacciRetracementScene,isDatum:FibonacciRetracementProperties.is,translate:(t,e,i,s)=>{FibonacciRetracementProperties.is(e)&&FibonacciRetracementScene.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(FibonacciRetracementProperties.is(e)&&FibonacciRetracementProperties.is(i)&&FibonacciRetracementScene.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{FibonacciRetracementProperties.is(e)&&FibonacciRetracementScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new FibonacciRetracementStateMachine({...t,create:e("fibonacci-retracement")}),dragState:t=>new DragStateMachine(t)},{Vec2:Vec215}=module_support_exports,CapScene=class extends module_support_exports.Group{},ArrowCapScene=class extends CapScene{constructor(){super(),this.type="arrow",this.path=new module_support_exports.Path,this.armLength=6,this.append([this.path])}update(t){const{path:e}=this,{x:i,y:s,angle:n,...o}=t,a=Vec215.from(i,s),r=3*Math.PI/4,l=this.armLength+(t.strokeWidth??0)*2,c=Vec215.rotate(Vec215.from(0,l),n+r,a),h=Vec215.rotate(Vec215.from(l,0),n-r,a);e.setProperties(o),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:Vec216,Vec4:Vec411}=module_support_exports,LineScene=class extends StartEndScene{constructor(){super(),this.type="line",this.line=new CollidableLine,this.append([this.line,this.start,this.end])}static is(t){return AnnotationScene.isCheck(t,"line")}update(t,e){let i=convertLine(t,e);if(i==null){this.visible=!1;return}i=Vec411.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:s}=this,{lineDashOffset:n,stroke:o,strokeWidth:a,strokeOpacity:r}=t,l=this.extendLine(e,t,i);s.setProperties({...l,lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:n,stroke:o,strokeWidth:a,strokeOpacity:r,fillOpacity:0})}updateText(t,e){this.text=this.updateNode(CollidableText,this.text,!!t.text.label),updateLineText(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:s,strokeOpacity:n}=t,[o,a]=Vec216.from(e),r=Vec216.angle(Vec216.sub(a,o));t.startCap&&(this.startCap&&this.startCap.type!==t.startCap&&(this.removeChild(this.startCap),this.startCap=void 0),this.startCap==null&&(this.startCap=new ArrowCapScene,this.append([this.startCap])),this.startCap.update({x:o.x,y:o.y,angle:r-Math.PI,stroke:i,strokeWidth:s,strokeOpacity:n})),t.endCap&&(this.endCap&&this.endCap.type!==t.endCap&&(this.removeChild(this.endCap),this.endCap=void 0),this.endCap==null&&(this.endCap=new ArrowCapScene,this.append([this.endCap])),this.endCap.update({x:a.x,y:a.y,angle:r,stroke:i,strokeWidth:s,strokeOpacity:n}))}updateAnchor(t,e,i,s){const n=Vec411.topCenter(e);Vec216.apply(this.anchor,module_support_exports.Transformable.toCanvasPoint(this.line,n.x,n.y))}containsPoint(t,e){const{line:i,text:s}=this;return super.containsPoint(t,e)||i.isPointInPath(t,e)||!!s?.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,s){const{startCap:n,endCap:o}=this;let[a,r]=Vec216.from(e);const l=Vec216.angle(Vec216.sub(r,a));return n&&(a=Vec216.rotate(Vec216.from(0,-DivariantHandle.HANDLE_SIZE/2),l,a)),o&&(r=Vec216.rotate(Vec216.from(0,DivariantHandle.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}}},lineConfig={type:"line",datum:LineProperties,scene:LineScene,isDatum:LineProperties.is,translate:(t,e,i,s)=>{LineProperties.is(e)&&LineScene.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(LineProperties.is(e)&&LineProperties.is(i)&&LineScene.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{LineProperties.is(e)&&LineScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new LineStateMachine({...t,create:e("line")}),dragState:t=>new DragStateMachine(t)},arrowConfig={type:"arrow",datum:ArrowProperties,scene:LineScene,isDatum:ArrowProperties.is,translate:(t,e,i,s)=>{ArrowProperties.is(e)&&LineScene.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(ArrowProperties.is(e)&&ArrowProperties.is(i)&&LineScene.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{ArrowProperties.is(e)&&LineScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new ArrowStateMachine({...t,create:e("arrow")}),dragState:t=>new DragStateMachine(t)};function layoutScenesRow(t,e=0,i=0){let s=e;for(const n of t)if(Array.isArray(n)){for(const o of n)layoutSetX(o,s);s+=module_support_exports.Group.computeChildrenBBox(n).width+i}else layoutSetX(n,s),s+=n.getBBox().width+i}function layoutScenesColumn(t,e=0,i=0){let s=e;for(const n of t)if(Array.isArray(n)){for(const o of n)layoutSetY(o,s);s+=module_support_exports.Group.computeChildrenBBox(n).height+i}else layoutSetY(n,s),s+=n.getBBox().height+i}function layoutSetX(t,e){"x1"in t?(t.x2=e+(t.x2-t.x1),t.x1=e):t.x=e}function layoutSetY(t,e){"y1"in t?(t.y2=e+(t.y2-t.y1),t.y1=e):t.y=e}function layoutAddX(t,e){"x1"in t?(t.x1+=e,t.x2+=e):t.x+=e}function layoutAddY(t,e){"y1"in t?(t.y1+=e,t.y2+=e):t.y+=e}var{Vec4:Vec412}=module_support_exports,MeasurerStatisticsScene=class extends module_support_exports.Group{constructor(){super(),this.name="MeasurerStatisticsScene",this.background=new module_support_exports.Rect,this.dateRangeBarsText=new module_support_exports.Text,this.dateRangeDivider=new module_support_exports.Line,this.dateRangeValueText=new module_support_exports.Text,this.priceRangeValueText=new module_support_exports.Text,this.priceRangeDivider=new module_support_exports.Line,this.priceRangePercentageText=new module_support_exports.Text,this.volumeText=new module_support_exports.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,s,n,o,a){this.verticalDirection=o;const r=this.updateStatistics(t,e,i,a),l=module_support_exports.Group.computeChildrenBBox(r.flat()),c=10;l.grow(c),this.updateBackground(t,l,c),this.reposition(r,c,n),this.checkVisibility(t,n,s)}checkVisibility(t,e,i){const s=Vec412.from(new module_support_exports.BBox(0,0,e.seriesRect.width,e.seriesRect.height));Vec412.collides(i,s)?this.visible=t.visible??!0:this.visible=!1}updateStatistics(t,e,i,s){const{dateRangeBarsText:n,dateRangeDivider:o,dateRangeValueText:a,priceRangeValueText:r,priceRangeDivider:l,priceRangePercentageText:c,volumeText:h}=this,d=8,u=6,p=t.statistics.fontSize+3,g=-2,f=this.getTextStyles(t),m={...this.getDividerStyles(t),x1:0,y1:0,x2:0,y2:p},y=[n,o,a],x=[r,l,c],b=[];return e.priceRange&&(r.setProperties({...f,text:this.formatPriceRangeValue(e.priceRange.value,s)}),l.setProperties(m),c.setProperties({...f,text:this.formatPriceRangePercentage(e.priceRange.percentage,s)}),layoutScenesRow(x,i.x,d),b.push(x)),e.dateRange&&(n.setProperties({...f,text:this.formatDateRangeBars(e.dateRange.bars,s)}),o.setProperties(m),a.setProperties({...f,text:this.formatDateRangeValue(e.dateRange.value)}),layoutScenesRow(y,i.x,d),b.push(y)),e.volume!=null?(h.setProperties({...f,x:i.x,text:this.formatVolume(e.volume,s),visible:!0}),b.push(h)):h.visible=!1,layoutScenesColumn(b,i.y,u),l.y1+=g,l.y2+=g,o.y1+=g,o.y2+=g,b}updateBackground(t,e,i){const s=this.getBackgroundStyles(t);this.background.setProperties({...s,...e,x:e.x-e.width/2+i,y:e.y})}reposition(t,e,i){const{width:s,height:n}=i.seriesRect,o=Vec412.from(this.background.getBBox());let a=0;o.x1<0&&(a=-o.x1),o.x2>s&&(a=s-o.x2);const r=Math.min(e,n-o.y2);for(const l of t)if(Array.isArray(l)){const c=module_support_exports.Group.computeChildrenBBox(l).width;for(const h of l)layoutAddX(h,a-c/2),layoutAddY(h,r)}else layoutAddX(l,a-l.getBBox().width/2),layoutAddY(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 s=1e3*60,n=s*60,o=n*24,a=Math.floor(t/s),r=Math.floor(t/n),l=Math.floor(t/o),c=r%(o/n),h=a%(n/s);return l>=1&&e.push(`${l}d`),r>=1&&(t<o||c!==0)&&e.push(`${c}h`),(t<n||h!==0)&&e.push(`${h}m`),e[0]=`${i}${e[0]}`,e.join(" ")}formatPriceRangeValue(t,e){return e?.t("measurerPriceRangeValue",{value:Number(t.toFixed(2))})??`${t}`}formatPriceRangePercentage(t,e){return e?.t("measurerPriceRangePercent",{value:t})??`${t}`}formatVolume(t,e){const i=isNaN(t)?"":this.volumeFormatter.format(t);return e?.t("measurerVolume",{value:i})??i}},QuickMeasurerStatisticsScene=class extends MeasurerStatisticsScene{getDirectionStyles(t){return this.verticalDirection==="down"?t.down.statistics:t.up.statistics}getTextStyles(t){const e=this.getDirectionStyles(t);return{...super.getTextStyles(t),fill:e.color,fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight}}getDividerStyles(t){const e=this.getDirectionStyles(t);return{stroke:e.divider.stroke,strokeOpacity:e.divider.strokeOpacity,strokeWidth:e.divider.strokeWidth}}getBackgroundStyles(t){const e=this.getDirectionStyles(t);return{...super.getBackgroundStyles(t),fill:e.fill,stroke:e.stroke,strokeOpacity:e.strokeOpacity,strokeWidth:e.strokeWidth}}},{Vec2:Vec217,Vec4:Vec413}=module_support_exports,MeasurerScene=class extends StartEndScene{constructor(){super(),this.type="measurer",this.horizontalLine=new CollidableLine,this.verticalLine=new CollidableLine,this.horizontalStartLine=new CollidableLine,this.horizontalEndLine=new CollidableLine,this.verticalStartLine=new CollidableLine,this.verticalEndLine=new CollidableLine,this.horizontalEndCap=new ArrowCapScene,this.verticalEndCap=new ArrowCapScene,this.background=new module_support_exports.Path({zIndex:-1}),this.updateBackground=WithBackgroundScene.updateBackground.bind(this),this.statistics=this.createStatisticsScene(),this.statistics.zIndex=1,this.append([this.background,this.verticalStartLine,this.verticalEndLine,this.horizontalStartLine,this.horizontalEndLine,this.horizontalLine,this.verticalLine,this.horizontalEndCap,this.verticalEndCap,this.start,this.end,this.statistics])}static is(t){return AnnotationScene.isCheck(t,"measurer")}createStatisticsScene(){return new MeasurerStatisticsScene}update(t,e){const i=convertLine(t,e);if(i==null){this.visible=!1;return}if(this.visible=t.visible??!0,!this.visible)return;const s=this.extendPerpendicular(i,t,e),n={...s,y2:s.y1},o={...s,y1:s.y2};this.verticalDirection=i.y1<i.y2?"down":"up",this.updateVisibilities(t),this.updateLines(t,i),this.updateHandles(t,i),this.updateText(t,i),this.updateCaps(t,i),this.updateBoundingLines(t,s),this.updateBackground(t,n,o,e),this.updateStatistics(t,i,e),this.updateAnchor(t,i,e)}extendPerpendicular(t,e,i){const s={x1:Math.min(t.x1,t.x2),x2:Math.max(t.x1,t.x2),y1:Math.min(t.y1,t.y2),y2:Math.max(t.y1,t.y2)},[n,o]=Vec217.from(i.yAxis.bounds);return DateRangeProperties.is(e)?(e.extendAbove&&(s.y1=n.y),e.extendBelow&&(s.y2=o.y)):PriceRangeProperties.is(e)&&(e.extendLeft&&(s.x1=n.x),e.extendRight&&(s.x2=o.x)),s}updateVisibilities(t){const{horizontalStartLine:e,horizontalEndLine:i,horizontalEndCap:s,verticalStartLine:n,verticalEndLine:o,verticalEndCap:a}=this,{direction:r}=t;n.visible=r!=="vertical",o.visible=r!=="vertical",s.visible=r!=="vertical",e.visible=r!=="horizontal",i.visible=r!=="horizontal",a.visible=r!=="horizontal"}updateLines(t,e){const{horizontalLine:i,verticalLine:s}=this,{direction:n}=t,{x1:o,y1:a,x2:r,y2:l}=e,c=Vec217.round(Vec413.center(e),0),h=this.getLineStyles(t);n!=="vertical"&&i.setProperties({...h,x1:o,x2:r,y1:c.y,y2:c.y}),n!=="horizontal"&&s.setProperties({...h,x1:c.x,x2:c.x,y1:a,y2:l})}updateText(t,e){const{direction:i}=t,s=Vec217.round(Vec413.center(e),0);let n;const o={...e};i==="vertical"?(n=this.verticalLine,o.x1=s.x,o.x2=s.x):(n=this.horizontalLine,o.y1=s.y,o.y2=s.y),this.text=this.updateNode(CollidableText,this.text,!!t.text.label);const{id:a}=n,r=updateLineText(a,n,o,t.text,this.text,t.text.label,t.strokeWidth);let l;if(i==="both"&&r&&this.text){const c=Vec413.from(this.text.getBBox()),{offset:h}=r.numbers;c.x1<=s.x+h.x&&c.x2>=s.x-h.x&&(l={x:s.x,y:r.clipMask.y,radius:this.text.getBBox().height/2+Vec217.length(h)})}this.verticalLine.setClipMask(a,l)}updateCaps(t,e){const{horizontalEndCap:i,verticalEndCap:s}=this,{direction:n}=t,{x1:o,y1:a,x2:r,y2:l}=e,c=Vec217.round(Vec413.center(e),0),{stroke:h,strokeWidth:d,strokeOpacity:u}=this.getLineStyles(t),p={stroke:h,strokeWidth:d,strokeOpacity:u};if(n!=="vertical"){const g=o<=r?0:Math.PI;let f=r;n==="horizontal"&&(f+=o<=r?-2:2),i.update({...p,x:f,y:c.y,angle:g})}if(n!=="horizontal"){const g=a<=l?Math.PI/2:Math.PI/-2;let f=l;n==="vertical"&&(f+=a<=l?-2:2),s.update({...p,x:c.x,y:f,angle:g})}}updateBoundingLines(t,e){const{verticalStartLine:i,verticalEndLine:s,horizontalStartLine:n,horizontalEndLine:o}=this,{direction:a}=t,{x1:r,y1:l,x2:c,y2:h}=e,d=this.getLineStyles(t);a==="horizontal"&&(i.setProperties({...d,x1:r,y1:l,x2:r,y2:h}),s.setProperties({...d,x1:c,y1:l,x2:c,y2:h})),a==="vertical"&&(n.setProperties({...d,x1:r,y1:l,x2:c,y2:l}),o.setProperties({...d,x1:r,y1:h,x2:c,y2:h}))}updateStatistics(t,e,i){const s=Vec217.add(Vec413.bottomCenter(e),Vec217.from(0,10)),n={volume:this.getVolume(t)};t.hasPriceRange&&(n.priceRange={percentage:this.getPriceRangePercentage(t),value:this.getPriceRangeValue(t)}),t.hasDateRange&&(n.dateRange={bars:this.getDateRangeBars(e,i),value:this.getDateRangeValue(t)}),this.statistics.update(t,n,s,e,i,this.verticalDirection,t.localeManager)}updateAnchor(t,e,i,s){const n=Vec413.topCenter(e);Vec217.apply(this.anchor,module_support_exports.Transformable.toCanvasPoint(this.horizontalLine,n.x,n.y))}getBackgroundPoints(t,e,i,s){const[n,o]=Vec217.from(e),[a,r]=Vec217.from(i);return[n,o,r,a]}getLineStyles(t){const{lineDashOffset:e,stroke:i,strokeWidth:s,strokeOpacity:n}=t;return{lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:e,stroke:i,strokeWidth:s,strokeOpacity:n,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:s,verticalLine:n,horizontalStartLine:o,horizontalEndLine:a,verticalStartLine:r,verticalEndLine:l}=this;return super.containsPoint(t,e)||i.isPointInPath(t,e)||n.isPointInPath(t,e)||o.visible&&o.isPointInPath(t,e)||a.visible&&a.isPointInPath(t,e)||r.visible&&r.isPointInPath(t,e)||l.visible&&l.isPointInPath(t,e)||!!s?.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,s=t.x1<=t.x2?1:-1;return i?Math.round(Vec413.width(t)/i)*s:0}getDateRangeValue(t){const e=getGroupingValue(t.start.x),i=getGroupingValue(t.end.x);if(!isDate(e)||!isDate(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 e=getGroupingValue(t.end.y),i=getGroupingValue(t.start.y);if(!isNumber(e)||!isNumber(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 e=getGroupingValue(t.end.y),i=getGroupingValue(t.start.y);if(!isNumber(e)||!isNumber(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)}},QuickMeasurerScene=class extends MeasurerScene{constructor(){super(...arguments),this.type="quick-measurer"}static is(t){return AnnotationScene.isCheck(t,"quick-measurer")}createStatisticsScene(){return new QuickMeasurerStatisticsScene}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}}},{StateMachine:StateMachine10,StateMachineProperty:StateMachineProperty10,Debug:Debug10}=module_support_exports,MeasurerTypeStateMachine=class extends StateMachine10{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()},s=()=>{this.node?.toggleHandles({end:!0})},n=()=>t.delete(),o=()=>{t.showAnnotationOptions(),!isEphemeralType(this.datum)&&t.recordAction(`Create ${this.node?.type} annotation`)};super("start",{start:{reset:StateMachine10.parent,click:{target:"end",action:e},drag:{target:"end",action:e}},end:{hover:i,drag:i,click:{target:StateMachine10.parent,action:s},dragEnd:{target:StateMachine10.parent,action:s},reset:{target:StateMachine10.parent,action:n},cancel:{target:StateMachine10.parent,action:n},onExit:o}}),this.debug=Debug10.create(!0,"annotations")}};__decorateClass([StateMachineProperty10()],MeasurerTypeStateMachine.prototype,"datum",2),__decorateClass([StateMachineProperty10()],MeasurerTypeStateMachine.prototype,"node",2);var DateRangeStateMachine=class extends MeasurerTypeStateMachine{createDatum(){return new DateRangeProperties}},PriceRangeStateMachine=class extends MeasurerTypeStateMachine{createDatum(){return new PriceRangeProperties}},DatePriceRangeStateMachine=class extends MeasurerTypeStateMachine{createDatum(){return new DatePriceRangeProperties}},QuickDatePriceRangeStateMachine=class extends MeasurerTypeStateMachine{createDatum(){return new QuickDatePriceRangeProperties}},dateRangeConfig={type:"date-range",datum:DateRangeProperties,scene:MeasurerScene,isDatum:DateRangeProperties.is,translate:(t,e,i,s)=>{DateRangeProperties.is(e)&&MeasurerScene.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(DateRangeProperties.is(e)&&DateRangeProperties.is(i)&&MeasurerScene.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{DateRangeProperties.is(e)&&MeasurerScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new DateRangeStateMachine({...t,create:e("date-range")}),dragState:t=>new DragStateMachine(t)},priceRangeConfig={type:"price-range",datum:PriceRangeProperties,scene:MeasurerScene,isDatum:PriceRangeProperties.is,translate:(t,e,i,s)=>{PriceRangeProperties.is(e)&&MeasurerScene.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(PriceRangeProperties.is(e)&&PriceRangeProperties.is(i)&&MeasurerScene.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{PriceRangeProperties.is(e)&&MeasurerScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new PriceRangeStateMachine({...t,create:e("date-range")}),dragState:t=>new DragStateMachine(t)},datePriceRangeConfig={type:"date-price-range",datum:DatePriceRangeProperties,scene:MeasurerScene,isDatum:DatePriceRangeProperties.is,translate:(t,e,i,s)=>{DatePriceRangeProperties.is(e)&&MeasurerScene.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(DatePriceRangeProperties.is(e)&&DatePriceRangeProperties.is(i)&&MeasurerScene.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{DatePriceRangeProperties.is(e)&&MeasurerScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new DatePriceRangeStateMachine({...t,create:e("date-range")}),dragState:t=>new DragStateMachine(t)},quickDatePriceRangeConfig={type:"quick-date-price-range",datum:QuickDatePriceRangeProperties,scene:QuickMeasurerScene,isDatum:QuickDatePriceRangeProperties.is,translate:(t,e,i,s)=>{QuickDatePriceRangeProperties.is(e)&&QuickMeasurerScene.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(QuickDatePriceRangeProperties.is(e)&&QuickDatePriceRangeProperties.is(i)&&QuickMeasurerScene.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{QuickDatePriceRangeProperties.is(e)&&QuickMeasurerScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new QuickDatePriceRangeStateMachine({...t,create:e("quick-date-price-range")}),dragState:t=>new DragStateMachine(t)},{ZIndexMap:ZIndexMap4,TextWrapper:TextWrapper4}=module_support_exports,NoteScene=class extends TextualPointScene{constructor(){super(),this.type="note",this.shape=new module_support_exports.Rect,this.iconBackground=new module_support_exports.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 module_support_exports.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 module_support_exports.DropShadow,this.append([this.shape,this.label,this.iconBackground,this.iconLines,this.handle])}static is(t){return AnnotationScene.isCheck(t,"note")}update(t,e){this.updateIcon(t,e),super.update(t,e)}getTextBBox(t,e,i){const s=super.getTextBBox(t,e,i);s.x-=t.width/2,s.x=clamp(0,s.x,i.seriesRect.width-t.width);const n=t.getPadding().top,o=s.y-LABEL_OFFSET-n*2,a=s.y+DivariantHandle.HANDLE_SIZE+n*2;return o-s.height-TOOLBAR_OFFSET<0?(s.y=a,t.position="top"):(s.y=o+n,t.position="bottom"),s}updateLabel(t,e){const i=t.visible===!1?!1:this.label.visible;super.updateLabel(t,e),this.label.visible=i,this.label.text=TextWrapper4.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 s=t.getPadding().top,n=t.position==="top";i.x=e.x-s,i.width=t.width+s*2,i.height=e.height+s*2,i.y=e.y+(n?0:-e.height)-s}updateIcon(t,e){const{active:i,iconBackground:s,iconLines:n}=this,{x:o,y:a}=convertPoint(t,e);s.x=o-ICON_WIDTH/2,s.y=a-ICON_HEIGHT,n.x=s.x,n.y=s.y,s.fill=t.fill,s.fillOpacity=t.fillOpacity??1,s.stroke=t.stroke,s.strokeOpacity=t.strokeOpacity??1,s.strokeWidth=t.strokeWidth??1,n.fill=t.stroke,i?s.fillShadow.color=t.fill??"rgba(0, 0, 0, 0.22)":s.fillShadow.color="rgba(0, 0, 0, 0.22)"}updateAnchor(t,e,i){const s=t.getPadding().top,n=t.position==="top",o=n?1:-1;return{x:e.x+i.seriesRect.x+t.width/2,y:e.y+i.seriesRect.y+o*(e.height+s),position:n?"below":"above"}}getLabelCoords(t,e){const i=t.position==="top",s=t.getPadding().top+t.fontSize*ANNOTATION_TEXT_LINE_HEIGHT/2;return{x:e.x,y:e.y+(i?s/2:0)}}getTextBaseline(t){return t.position==="top"?"middle":t.position}getHandleCoords(t,e,i){return{x:e.x,y:e.y+DivariantHandle.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?ZIndexMap4.CHART_ANNOTATION_FOCUSED:ZIndexMap4.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)}},NoteStateMachine=class extends TextualPointStateMachine{createDatum(){return new NoteProperties}},noteConfig={type:"note",datum:NoteProperties,scene:NoteScene,isDatum:NoteProperties.is,translate:(t,e,i,s)=>{NoteProperties.is(e)&&NoteScene.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(NoteProperties.is(e)&&NoteProperties.is(i)&&NoteScene.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{NoteProperties.is(e)&&NoteScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new NoteStateMachine({...t,create:e("note")}),dragState:t=>new DragStateMachine(t)},{Vec2:Vec218,Vec4:Vec414}=module_support_exports,ParallelChannelScene=class extends ChannelScene{constructor(){super(),this.type="parallel-channel",this.handles={topLeft:new DivariantHandle,topMiddle:new UnivariantHandle,topRight:new DivariantHandle,bottomLeft:new DivariantHandle,bottomMiddle:new UnivariantHandle,bottomRight:new DivariantHandle},this.middleLine=new CollidableLine,this.append([this.background,this.topLine,this.middleLine,this.bottomLine,...Object.values(this.handles)])}static is(t){return AnnotationScene.isCheck(t,"parallel-channel")}dragHandle(t,e,i,s){const{activeHandle:n,handles:o}=this;if(n==null)return;const{offset:a}=o[n].drag(e);o[n].toggleDragging(!0),(n==="topMiddle"||n==="bottomMiddle")&&(a.x=0);let r=[],l=s;switch(n){case"topLeft":case"bottomLeft":r=["topLeft","bottomLeft"];break;case"topMiddle":r=["topLeft","topRight"],a.y-=UnivariantHandle.HANDLE_SIZE/2,l=!1;break;case"topRight":case"bottomRight":r=["topRight","bottomRight"];break;case"bottomMiddle":r=["bottomLeft","bottomRight"],a.y-=UnivariantHandle.HANDLE_SIZE/2,l=!1;break}const c=convertLine(t,i),h=convertLine(t.bottom,i);if(!c||!h)return;const d={topLeft:Vec414.start(c),topRight:Vec414.end(c),bottomLeft:Vec414.start(h),bottomRight:Vec414.end(h)},u={vectors:{topLeft:d.topRight,bottomLeft:d.bottomRight,topRight:d.topLeft,bottomRight:d.bottomLeft},angle:t.snapToAngle},p=translate(d,a,i,{overflowContinuous:this.overflowContinuous,translateVectors:r,snap:l?u:void 0});t.start.x=p.topLeft.x,t.start.y=p.topLeft.y,t.end.x=p.topRight.x,t.end.y=p.topRight.y,t.height=p.topLeft.y-p.bottomLeft.y}getTranslatePointsVectors(t,e){const{bottomLeft:i,topLeft:s}=this.handles,n=i.getBBox().y-s.getBBox().y,o=Vec218.add(t,Vec218.from(0,n)),a=Vec218.add(e,Vec218.from(0,n));return{start:t,end:e,bottomStart:o,bottomEnd:a}}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,s,n,o){const{topLine:a,middleLine:r,bottomLine:l}=this,{lineDashOffset:c,stroke:h,strokeOpacity:d,strokeWidth:u}=t,p=t.getLineDash(),g={lineCap:t.getLineCap(),lineDash:p,lineDashOffset:c,stroke:h,strokeOpacity:d,strokeWidth:u};a.setProperties({...e,...g}),l.setProperties({...i,...g});const f=this.extendLine({x1:n.x1,y1:o.y1+(n.y1-o.y1)/2,x2:n.x2,y2:o.y2+(n.y2-o.y2)/2},t,s);r.setProperties({...f,lineDash:t.middle.lineDash??p,lineDashOffset:t.middle.lineDashOffset??c,stroke:t.middle.stroke??h,strokeOpacity:t.middle.strokeOpacity??d,strokeWidth:t.middle.strokeWidth??u,visible:t.middle.visible??!0})}updateHandles(t,e,i){const{handles:{topLeft:s,topMiddle:n,topRight:o,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};s.update({...c,...Vec414.start(e)}),o.update({...c,...Vec414.end(e)}),a.update({...c,...Vec414.start(i)}),l.update({...c,...Vec414.end(i)}),n.update({...c,...Vec218.sub(Vec414.center(e),Vec218.from(n.handle.width/2,n.handle.height/2))}),r.update({...c,...Vec218.sub(Vec414.center(i),Vec218.from(r.handle.width/2,r.handle.height/2))})}updateText(t,e,i){this.text=this.updateNode(CollidableText,this.text,!!t.text.label),updateChannelText(!0,e,i,t.text,t.strokeWidth,this.text,t.text.label)}getBackgroundPoints(t,e,i,s){const n=e.x1>e.x2,o=e.y1>e.y2,a=e.x1!==i.x1&&e.y1!==i.y1,r=e.x2!==i.x2&&e.y2!==i.y2,l=Vec218.from(e);return t.extendEnd&&r&&l.push(Vec218.from(n?s.x1:s.x2,o?s.y1:s.y2)),l.push(...Vec218.from(i).reverse()),t.extendStart&&a&&l.push(Vec218.from(n?s.x2:s.x1,o?s.y2:s.y1)),l}},{StateMachine:StateMachine11,StateMachineProperty:StateMachineProperty11,Debug:Debug11}=module_support_exports,ParallelChannelStateMachine=class extends StateMachine11{constructor(t){const e=({point:l})=>{const c=new ParallelChannelProperties;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})},s=({offset:l,context:c})=>{const{datum:h,snapping:d}=this;h&&(h.set({end:snapPoint(l,c,d,h.start,h.snapToAngle)}),t.update())},n=()=>{this.node?.toggleHandles({topRight:!0}),t.update()},o=({point:l})=>{const{datum:c,node:h}=this,d=getGroupingValue(c?.end.y),u=getGroupingValue(c?.start.y),{y:p}=l;if(c==null||!isNumber(u)||!isNumber(d)||!isNumber(p))return;const g=d-(p??0),f=u-g;h?.toggleHandles({bottomLeft:!0,bottomRight:!0}),!(!t.validatePoint({x:c.start.x,y:f},{overflowContinuous:!0})||!t.validatePoint({x:c.end.x,y:l.y},{overflowContinuous:!0}))&&(c.set({height:g}),t.update())},a=({point:l})=>{const{datum:c,node:h}=this,d=getGroupingValue(c?.end.y),u=getGroupingValue(c?.start.y),{y:p}=l;if(c==null||!isNumber(u)||!isNumber(d)||!isNumber(p))return;const g=d-(p??0),f=u-g;h?.toggleHandles(!0),!(!t.validatePoint({x:c.start.x,y:f},{overflowContinuous:!0})||!t.validatePoint({x:c.end.x,y:l.y},{overflowContinuous:!0}))&&(c.set({height:g}),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:StateMachine11.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,drag:s,click:{target:"height",action:n},dragEnd:{target:"height",action:n},reset:{target:StateMachine11.parent,action:r},cancel:{target:StateMachine11.parent,action:r}},height:{hover:o,click:{target:StateMachine11.parent,action:a},drag:{target:StateMachine11.parent,action:a},reset:{target:StateMachine11.parent,action:r},cancel:{target:StateMachine11.parent,action:r}}}),this.debug=Debug11.create(!0,"annotations"),this.snapping=!1}};__decorateClass([StateMachineProperty11()],ParallelChannelStateMachine.prototype,"datum",2),__decorateClass([StateMachineProperty11()],ParallelChannelStateMachine.prototype,"node",2),__decorateClass([StateMachineProperty11()],ParallelChannelStateMachine.prototype,"snapping",2);var parallelChannelConfig={type:"parallel-channel",datum:ParallelChannelProperties,scene:ParallelChannelScene,isDatum:ParallelChannelProperties.is,translate:(t,e,i,s)=>{ParallelChannelProperties.is(e)&&ParallelChannelScene.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(ParallelChannelProperties.is(e)&&ParallelChannelProperties.is(i)&&ParallelChannelScene.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{ParallelChannelProperties.is(e)&&ParallelChannelScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new ParallelChannelStateMachine({...t,create:e("parallel-channel")}),dragState:t=>new DragStateMachine(t)},TextScene=class extends TextualPointScene{constructor(){super(),this.type="text",this.append([this.label,this.handle])}static is(t){return AnnotationScene.isCheck(t,"text")}getHandleCoords(t,e){const i=DivariantHandle.HANDLE_SIZE/2;return{x:e.x+i,y:e.y+2+i}}},TextStateMachine=class extends TextualPointStateMachine{createDatum(){return new TextProperties}},textConfig={type:"text",datum:TextProperties,scene:TextScene,isDatum:TextProperties.is,translate:(t,e,i,s)=>{TextProperties.is(e)&&TextScene.is(t)&&t.translate(e,i,s)},copy:(t,e,i,s)=>{if(TextProperties.is(e)&&TextProperties.is(i)&&TextScene.is(t))return t.copy(e,i,s)},update:(t,e,i)=>{TextProperties.is(e)&&TextScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new TextStateMachine({...t,create:e("text")}),dragState:t=>new DragStateMachine(t)},annotationConfigs={[lineConfig.type]:lineConfig,[horizontalLineConfig.type]:horizontalLineConfig,[verticalLineConfig.type]:verticalLineConfig,[parallelChannelConfig.type]:parallelChannelConfig,[disjointChannelConfig.type]:disjointChannelConfig,[fibonacciRetracementConfig.type]:fibonacciRetracementConfig,[fibonacciRetracementTrendBasedConfig.type]:fibonacciRetracementTrendBasedConfig,[calloutConfig.type]:calloutConfig,[commentConfig.type]:commentConfig,[noteConfig.type]:noteConfig,[textConfig.type]:textConfig,[arrowConfig.type]:arrowConfig,[arrowUpConfig.type]:arrowUpConfig,[arrowDownConfig.type]:arrowDownConfig,[dateRangeConfig.type]:dateRangeConfig,[priceRangeConfig.type]:priceRangeConfig,[datePriceRangeConfig.type]:datePriceRangeConfig,[quickDatePriceRangeConfig.type]:quickDatePriceRangeConfig};function getTypedDatum(t){for(const{isDatum:e}of Object.values(annotationConfigs))if(e(t))return t}var{ActionOnSet:ActionOnSet2,ParallelStateMachine:ParallelStateMachine2,StateMachine:StateMachine12,StateMachineProperty:StateMachineProperty12,Debug:Debug12}=module_support_exports,AnnotationsStateMachine=class extends ParallelStateMachine2{constructor(t){super(new SnappingStateMachine(e=>{this.snapping=e}),new UpdateMachine(()=>{this.node=this.active==null?void 0:t.node(this.active)}),new AnnotationsMainStateMachine(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}};__decorateClass([StateMachineProperty12()],AnnotationsStateMachine.prototype,"snapping",2),__decorateClass([StateMachineProperty12()],AnnotationsStateMachine.prototype,"datum",2),__decorateClass([StateMachineProperty12()],AnnotationsStateMachine.prototype,"node",2);var SnappingStateMachine=class extends StateMachine12{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:{},translating:{},"text-input":{}})}},UpdateMachine=class extends StateMachine12{constructor(t){super("idle",{idle:{onEnter:t,render:t},dragging:{onEnter:t,render:t},translating:{onEnter:t,render:t},"text-input":{render:t}})}},AnnotationsMainStateMachine=class extends StateMachine12{constructor(t,e){const i=b=>S=>{t.create(b,S),this.active=t.selectLast()},s=()=>{this.active!=null&&t.delete(this.active),this.active=void 0,t.select()},n={createDatum:i},o={...t,delete:s,showTextInput:()=>{this.active!=null&&t.showTextInput(this.active)},deselect:()=>{const b=this.active;this.active=void 0,this.hovered=void 0,t.select(this.active,b)},showAnnotationOptions:()=>{this.active!=null&&t.showAnnotationOptions(this.active)}},a=Object.fromEntries(Object.entries(annotationConfigs).map(([b,S])=>[b,S.createState(o,n)])),r=Object.fromEntries(Object.entries(annotationConfigs).map(([b,S])=>[b,S.dragState(t,n)])),l=({colorPickerType:b,colorOpacity:S,color:v,opacity:I,isMultiColor:A})=>{this.datum&&(b==="text-color"&&t.updateTextInputColor(v),setColor(this.datum,b,S,v,I,A),t.update())},c=b=>{const{datum:S,node:v}=this;!S||!v||(isTextType(S)?(S.fontSize=b,t.updateTextInputFontSize(b)):hasLineText(S)&&(S.text.fontSize=b),t.update())},h=b=>{const{datum:S,node:v}=this;!S||!v||!hasLineStyle(S)||(setLineStyle(S,b),t.update())},d=b=>{const{node:S}=this;!S||!("setTextInputBBox"in S)||(S.setTextInputBBox(b),t.update())},u=({textInputValue:b,bbox:S})=>{const{datum:v}=this;if(S!=null&&b!=null&&b.length>0){if(!isTextType(v))return;const I=wrapText(v,b,S.width);v.set({text:I}),t.update(),t.recordAction(`Change ${v.type} annotation text`)}else t.delete(this.active),t.recordAction(`Delete ${v?.type} annotation`)},p=()=>{t.updateTextInputBBox(void 0)},g=()=>this.active!=null,f=()=>this.copied!=null,m=()=>{const{active:b,datum:S}=this;return b==null||!S?!1:hasLineText(S)&&!S.locked},y=()=>this.active!=null&&!isEphemeralType(this.datum),x=()=>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:b})=>{this.hovered=t.hoverAtCoords(b,this.active,this.hovered),this.hoverCoords=b},translate:{guard:g,target:"translating",action:({translation:b})=>{t.startInteracting(),t.translate(this.active,b),t.update()}},copy:{guard:y,action:()=>{this.copied=t.copy(this.active)}},cut:{guard:y,action:()=>{this.copied=t.copy(this.active),s()}},paste:{guard:f,action:()=>{t.paste(this.copied)}},selectLast:()=>{const b=this.active;this.active=t.selectLast(),t.select(this.active,b)},click:[{guard:()=>{const{active:b,hovered:S,datum:v}=this;return b==null||S!==b||!v?!1:isTextType(v)&&!v.locked},target:"text-input"},{action:()=>{const b=this.active;this.active=this.hovered,t.select(this.active,b)}}],dblclick:{guard:m,action:({offset:b})=>{const S=t.getNodeAtCoords(b,this.active)==="text"?"text":"line";t.showAnnotationSettings(this.active,void 0,S)}},dragStart:[{guard:x,target:"dragging",action:()=>{const b=this.active;this.active=this.hovered,t.select(this.active,b),t.startInteracting()}},{action:()=>{const b=this.active;this.active=this.hovered,t.select(this.active,b)}}],color:{guard:g,action:l},fontSize:{guard:g,action:c},lineProps:{guard:g,action:b=>{const S=getTypedDatum(this.datum);S?.set(b),t.update(),t.recordAction(`Change ${S?.type} ${Object.entries(b).map(([v,I])=>`${v} to ${I}`).join(", ")}`)}},lineStyle:{guard:g,action:h},lineText:{guard:g,action:b=>{const S=getTypedDatum(this.datum);hasLineText(S)&&(isChannelType(S)&&b.position==="center"&&(b.position="inside"),S.text.set(b),t.update())}},updateTextInputBBox:{guard:g,action:d},toolbarPressSettings:{guard:m,action:b=>{t.showAnnotationSettings(this.active,b)}},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),!isEphemeralType(this.datum)&&t.recordAction(`Delete ${this.datum?.type} annotation`))},deleteAll:()=>{t.deleteAll()},...a},dragging:{onEnter:(b,S)=>{if(this.active==null)return;const v=t.getAnnotationType(this.active);v&&(this.transitionRoot(v),this.transitionRoot("dragStart",S))},...r},translating:{onEnter:()=>{},translate:{guard:g,target:"translating",action:({translation:b})=>{t.startInteracting(),t.translate(this.active,b),t.update()}},translateEnd:{guard:g,target:"idle"},onExit:()=>{t.stopInteracting(),t.update(),t.recordAction("Translate annotation")}},"text-input":{onEnter:()=>{if(this.active==null)return;const b=getTypedDatum(this.datum);!b||!("getTextInputCoords"in b)||(t.startInteracting(),t.showTextInput(this.active),b.visible=!1,t.update())},updateTextInputBBox:{guard:g,action:d},resize:{target:"idle",action:u},click:{target:"idle",action:u},drag:{target:"idle",action:u},textInput:[{guard:guardCancelAndExit,target:"idle",action:p},{guard:guardSaveAndExit,target:"idle",action:u}],color:{guard:g,action:l},fontSize:{guard:g,action:c},cancel:{target:"idle",action:p},onExit:()=>{t.stopInteracting(),t.hideTextInput();const b=this.active;if(this.active=this.hovered=void 0,t.select(this.active,b),b==null)return;const S=t.datum(b),v=t.node(b);!S||!v||(S.visible=!0)}}}),this.setActive=e,this.debug=Debug12.create(!0,"annotations"),this.snapping=!1}};__decorateClass([ActionOnSet2({changeValue(t){this.setActive(t)}}),StateMachineProperty12()],AnnotationsMainStateMachine.prototype,"active",2),__decorateClass([StateMachineProperty12()],AnnotationsMainStateMachine.prototype,"hovered",2),__decorateClass([StateMachineProperty12()],AnnotationsMainStateMachine.prototype,"hoverCoords",2),__decorateClass([StateMachineProperty12()],AnnotationsMainStateMachine.prototype,"copied",2),__decorateClass([StateMachineProperty12()],AnnotationsMainStateMachine.prototype,"snapping",2),__decorateClass([StateMachineProperty12()],AnnotationsMainStateMachine.prototype,"datum",2),__decorateClass([StateMachineProperty12()],AnnotationsMainStateMachine.prototype,"node",2);var{ARRAY:ARRAY4,BOOLEAN:BOOLEAN10,UNION:UNION7,POSITIVE_NUMBER:POSITIVE_NUMBER6,ActionOnSet:ActionOnSet3,LayoutElement:LayoutElement2,Menu:Menu3,PropertiesArray:PropertiesArray3,ToolbarButtonProperties:ToolbarButtonProperties3,TempValidate:TempValidate31,ChartAxisDirection:ChartAxisDirection9}=module_support_exports,AnnotationsToolbarButtonProperties=class extends ToolbarButtonProperties3{};__decorateClass([TempValidate31(UNION7(["line-menu","fibonacci-menu","text-menu","shape-menu","measurer-menu","clear"]))],AnnotationsToolbarButtonProperties.prototype,"value",2);var AnnotationsToolbar=class extends module_support_exports.BaseProperties{constructor(t){super(),this.ctx=t,this.enabled=!0,this.padding=20,this.buttons=new PropertiesArray3(AnnotationsToolbarButtonProperties),this.events=new module_support_exports.Listeners,this.annotationMenu=new Menu3(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(LayoutElement2.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 s=this.ctx.axisManager.getAxisContext(ChartAxisDirection9.Y)[0].scale;switch(e.value){case"clear":this.dispatch("pressed-clear");break;case"line-menu":this.onToolbarButtonPressShowMenu(t,i,e.value,"toolbarAnnotationsLineAnnotations",LINE_ANNOTATION_ITEMS.filter(n=>n.visible?n.visible(s):!0));break;case"fibonacci-menu":this.onToolbarButtonPressShowMenu(t,i,e.value,"toolbarAnnotationsFibonacciAnnotations",FIBONACCI_ANNOTATION_ITEMS);break;case"text-menu":this.onToolbarButtonPressShowMenu(t,i,e.value,"toolbarAnnotationsTextAnnotations",TEXT_ANNOTATION_ITEMS);break;case"shape-menu":this.onToolbarButtonPressShowMenu(t,i,e.value,"toolbarAnnotationsShapeAnnotations",SHAPE_ANNOTATION_ITEMS);break;case"measurer-menu":this.onToolbarButtonPressShowMenu(t,i,e.value,"toolbarAnnotationsMeasurerAnnotations",MEASURER_ANNOTATION_ITEMS);break}}onToolbarButtonPressShowMenu(t,e,i,s,n){this.dispatch("pressed-show-menu");const o=this.buttons.findIndex(a=>a.value===i);this.toolbar.toggleActiveButtonByIndex(o),this.annotationMenu.setAnchor({x:e.x+e.width+6,y:e.y}),this.annotationMenu.show({items:n,ariaLabel:this.ctx.localeManager.t(s),class:"ag-charts-annotations__toolbar-menu",sourceEvent:t.sourceEvent,onPress:this.onButtonPressMenuCreateAnnotation.bind(this,i)})}onButtonPressMenuCreateAnnotation(t,e){const i=this.buttons.findIndex(s=>s.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()}))}};__decorateClass([TempValidate31(BOOLEAN10),ActionOnSet3({changeValue(t){this.toolbar?.setHidden(!t)}})],AnnotationsToolbar.prototype,"enabled",2),__decorateClass([TempValidate31(POSITIVE_NUMBER6)],AnnotationsToolbar.prototype,"padding",2),__decorateClass([TempValidate31(ARRAY4)],AnnotationsToolbar.prototype,"buttons",2);var{BaseModuleInstance:BaseModuleInstance2,InteractionState:InteractionState2,TempValidate:TempValidate32,BOOLEAN:BOOLEAN11,ChartAxisDirection:ChartAxisDirection10,getIconClassNames:getIconClassNames2}=module_support_exports,DEFAULT_ANNOTATION_AXIS_BUTTON_CLASS="ag-charts-annotations__axis-button",AxisButton=class extends BaseModuleInstance2{constructor(t,e,i,s){super(),this.ctx=t,this.axisCtx=e,this.onButtonClick=i,this.seriesRect=s,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:n})=>{const o=n instanceof HTMLElement?n:void 0;!(o&&t.domManager.contains(o,"series-area"))&&o!==this.button.getElement()&&this.hide()}),this.destroyFns.push(t.widgets.seriesWidget.addListener("drag-move",n=>this.onMouseDrag(n)),t.widgets.seriesWidget.addListener("mousemove",n=>this.onMouseMove(n)),t.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseLeave()),t.widgets.seriesDragInterpreter.addListener("click",n=>this.onClick(n)),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 exports_exports.ButtonWidget;return t.addClass(DEFAULT_ANNOTATION_AXIS_BUTTON_CLASS),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",DEFAULT_ANNOTATION_AXIS_BUTTON_CLASS)}onMouseMove(t){this.ctx.interactionManager.isState(InteractionState2.Clickable)&&this.show(t)}onMouseDrag(t){this.ctx.interactionManager.isState(InteractionState2.AnnotationsMoveable)&&this.show(t)}onMouseLeave(){this.ctx.interactionManager.isState(InteractionState2.Clickable)&&this.hide()}onClick(t){this.ctx.interactionManager.isState(InteractionState2.Clickable)&&t.device==="touch"&&this.show(t)}show(t){const{sourceEvent:e,currentX:i,currentY:s}=t;if(!(this.enabled&&this.ctx.widgets.seriesWidget.getElement().contains(e.target))){this.hide();return}this.toggleVisibility(!0);const n=this.getButtonCoordinates({x:i,y:s});this.coords={x:n.x+this.button.clientWidth/2,y:n.y+this.button.clientHeight/2},this.updatePosition(n)}hide(){this.toggleVisibility(!1)}onKeyPress(){this.snap&&this.ctx.interactionManager.isState(InteractionState2.Default)||this.hide()}getButtonCoordinates({x:t,y:e}){const{axisCtx:{direction:i,position:s},seriesRect:n,snap:o,axisCtx:a,padding:r}=this,{clientWidth:l,clientHeight:c}=this.button,[h,d]=[0,n.height],[u,p]=[0,n.width];if(o&&(t=convert(invert(t-n.x,a),a)+n.x,e=convert(invert(e-n.y,a),a)+n.y),i===ChartAxisDirection10.X){const f=c-Math.max(0,r-5);t=t-l/2,e=s==="top"?h-c+f:d-f}else{const f=l-Math.max(0,r-9);t=s==="left"?u-l+f:p-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(`${DEFAULT_ANNOTATION_AXIS_BUTTON_CLASS}-${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(`<span class="${getIconClassNames2("zoom-in")} ${DEFAULT_ANNOTATION_AXIS_BUTTON_CLASS}-icon"></span>`)}};__decorateClass([TempValidate32(BOOLEAN11)],AxisButton.prototype,"enabled",2);var{Color:Color6,DraggablePopover:DraggablePopover2,NativeWidget:NativeWidget2,Vec2:Vec219,createButton:createButton2,createCheckbox:createCheckbox2,createElementId:createElementId2,createSelect:createSelect2,createTextArea:createTextArea2,initRovingTabIndex:initRovingTabIndex2,getIconClassNames:getIconClassNames3,mapValues:mapValues2,setAttribute:setAttribute2,setAttributes:setAttributes2}=module_support_exports,_Dialog=class Ht extends DraggablePopover2{constructor(e,i){super(e,i),this.dragHandleDraggingClass="ag-charts-dialog__drag-handle--dragging",this.colorPicker=new ColorPicker(this.ctx,{detached:!0}),this.destroyFns.push(e.layoutManager.addListener("layout:complete",this.onLayoutComplete.bind(this)))}showWithChildren(e,i){const s=super.showWithChildren(e,i);return s.classList.add("ag-charts-dialog"),s.setAttribute("role","dialog"),s.addEventListener("mousedown",n=>{n.target.classList?.contains("ag-charts-dialog__color-picker-button")||this.colorPicker.hide()}),s.addEventListener("keydown",this.onKeyDown.bind(this)),getWindow().requestAnimationFrame(()=>this.reposition()),this.colorPicker.attachTo(this),s}updatePosition(e){super.updatePosition(e);const{anchor:i,fallbackAnchor:s}=this.getColorPickerAnchors()??{};i&&this.colorPicker.setAnchor(i,s)}createTabs(e,i,s){const n=createElement("div","ag-charts-dialog__tabs"),o=mapValues2(s,()=>createElementId2("ag-charts-dialog__tab")),a=mapValues2(s,()=>createElementId2("ag-charts-dialog__tab-panel"));for(const[p,g]of entries(s))setAttributes2(g.panel,{id:a[p],role:"tabpanel","aria-labelledby":o[p]});const r=p=>{for(const[g,f]of entries(s))f.panel.classList.toggle("ag-charts-dialog__tab-panel--active",g===p),h[g].classList.toggle("ag-charts-dialog__tab-button--active",g===p),setAttribute2(h[g],"aria-selected",g===p),g===p&&f.onShow?.()},l=new NativeWidget2(createElement("div","ag-charts-dialog__header"));l.addListener("drag-start",p=>{const{sourceEvent:g}=p;g.target instanceof Element&&g.target.classList.contains("ag-charts-dialog__header")&&this.onDragStart(p)}),l.addListener("drag-move",p=>this.onDragMove(p)),l.addListener("drag-end",()=>this.onDragEnd());const c=new DragHandleWidget2;this.setDragHandle(c);const h=mapValues2(s,(p,g)=>createButton2({label:this.ctx.localeManager.t(p.label),onPress:()=>r(g)},{id:o[g],class:"ag-charts-dialog__tab-button",role:"tab","aria-controls":a[g]})),d=createElement("div","ag-charts-dialog__tab-list");setAttributes2(d,{role:"tablist","aria-label":this.ctx.localeManager.t(e)}),d.append(...Object.values(h));const u=this.createHeaderCloseButton();return l.getElement().append(c.getElement(),d,u),n.append(l.getElement(),...Object.values(s).map(p=>p.panel)),r(i),initRovingTabIndex2({orientation:"horizontal",buttons:Object.values(h)}),{tabs:n,initialFocus:h[i]}}createTabPanel(){return createElement("div","ag-charts-dialog__tab-panel")}createInputGroupLine(){return createElement("div","ag-charts-dialog__input-group-line")}createRadioGroup({label:e,options:i,value:s,onChange:n}){const o=this.createInputGroup(e);setAttributes2(o,{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,d=this.ctx.localeManager.t(h),u=createButton2({icon:c,altText:d,onPress:()=>{for(const p of Array.from(o.children))p.classList.remove(a),p.ariaChecked="false";u.classList.add(a),u.ariaChecked="true",n(l.value)}},{"aria-checked":l.value===s,class:"ag-charts-dialog__button",role:"radio",title:d});l.value===s&&u.classList.add(a),o.appendChild(u),r.push(u)}return initRovingTabIndex2({orientation:"horizontal",buttons:r}),o}createSelect({altText:e,label:i,options:s,value:n,onChange:o}){const a=this.createInputGroup(i),r=this.ctx.localeManager.t(e),l=createSelect2({value:n,options:s,onChange:o},{class:"ag-charts-dialog__select","aria-label":r,title:r});return a.append(l),a}createTextArea({placeholder:e,value:i,onChange:s}){const n=e?this.ctx.localeManager.t(e):void 0;return createTextArea2({value:i,onChange:s},{placeholder:n})}createCheckbox({label:e,checked:i,onChange:s}){const n=`ag-charts__${e}`,o=this.createInputGroup(e,{for:n}),a=createCheckbox2({checked:i,onChange:s},{class:"ag-charts-dialog__checkbox",role:"switch",id:n});return o.append(a),o}createColorPicker({color:e,opacity:i,label:s,altText:n,onChange:o,onChangeHide:a,isMultiColor:r,hasMultiColorOption:l}){const c=this.createInputGroup(s),h=this.ctx.localeManager.t(n),d=createButton2({label:h,onPress:u=>{const{anchor:p,fallbackAnchor:g}=this.getColorPickerAnchors(d)??{};this.colorPicker.show({anchor:p,fallbackAnchor:g,color:e,opacity:i,isMultiColor:r,hasMultiColorOption:l,sourceEvent:u,onChange:(f,m,y,x)=>{d.style.setProperty("--color",f),d.classList.toggle("ag-charts-dialog__color-picker-button--multi-color",x),o(f,m,y,x)},onChangeHide:a})}},{"aria-label":h,tabindex:0,class:"ag-charts-dialog__color-picker-button",title:h});if(r)d.classList.toggle("ag-charts-dialog__color-picker-button--multi-color");else if(e){const u=Color6.fromString(e),p=new Color6(u.r,u.g,u.b,i);d.style.setProperty("--color",p.toHexString())}return c.append(d),this.hideFns.push(()=>{this.colorPicker.hide()}),c}createHeaderCloseButton(){return createButton2({icon:"close",altText:this.ctx.localeManager.t("iconAltTextClose"),onPress:()=>this.hide()},{class:"ag-charts-dialog__close-button"})}createInputGroup(e,i){const s=createElement("div","ag-charts-dialog__input-group"),n=createElement("label","ag-charts-dialog__input-group-label");return n.innerText=this.ctx.localeManager.t(e),i?.for&&n.setAttribute("for",i.for),s.appendChild(n),s}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,s=i.domManager.getBoundingClientRect(),n=this.getPopoverElement();if(!e||!n)return;const o=Vec219.from(0,e.y),a=Vec219.from(s.width,e.height),r=Vec219.from(n),l=Vec219.from(.5,1);let c;if(e.width>1e3){const h=Vec219.sub(Vec219.add(o,Vec219.multiply(a,l)),Vec219.multiply(r,l));c=Vec219.sub(h,Vec219.from(0,Ht.offset))}else{const h=Vec219.sub(Vec219.add(o,a),r);c=Vec219.sub(h,Ht.offset)}this.updatePosition(c)}getColorPickerAnchors(e){if(e&&(this.colorPickerAnchorElement=e),!this.colorPickerAnchorElement)return;const i=this.colorPickerAnchorElement.getBoundingClientRect(),s=this.ctx.domManager.getBoundingClientRect(),n=Vec219.sub(Vec219.from(i.x,i.y),Vec219.from(s.left,s.top)),o=Vec219.add(n,Vec219.from(0,i.height+5)),a=Vec219.sub(n,Vec219.from(0,5));return{anchor:o,fallbackAnchor:a}}};_Dialog.offset=60;var Dialog=_Dialog,DragHandleWidget2=class extends NativeWidget2{constructor(){super(createElement("div","ag-charts-dialog__drag-handle"));const t=new NativeWidget2(createElement("span",getIconClassNames3("drag-handle")));t.setAriaHidden(!0),this.addChild(t)}},{Listeners:Listeners3,focusCursorAtEnd:focusCursorAtEnd3}=module_support_exports,AnnotationSettingsDialog=class extends Dialog{constructor(t){super(t,"settings"),this.events=new Listeners3,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),s=this.createLinearTextTab(t,e);let n="dialogHeaderLine";isChannelType(t)?n="dialogHeaderChannel":isFibonacciType(t)?n="dialogHeaderFibonacciRange":t.type==="date-range"?n="dialogHeaderDateRange":t.type==="price-range"?n="dialogHeaderPriceRange":t.type==="date-price-range"&&(n="dialogHeaderDatePriceRange");const{tabs:o,initialFocus:a}=this.createTabs("ariaLabelSettingsTabBar",e.initialSelectedTab,{line:{label:n,panel:i},text:{label:"dialogHeaderText",panel:s.panel,onShow:s.onShow}});e.initialFocus=a,this.showWithChildren([o],e).classList.add("ag-charts-dialog--annotation-settings")}createLinearLineTab(t,e){const i=this.createTabPanel(),s=this.createInputGroupLine(),n=this.createInputGroupLine(),o="isMultiColor"in t,a=this.createColorPickerInput("line-color",t.getDefaultColor("line-color"),t.getDefaultOpacity("line-color"),o?t.isMultiColor:!1,o,e.onChangeLineColor,e.onChangeHideLineColor),r=this.createStrokeWidthSelect(t.strokeWidth??2,e.onChangeLineStyleWidth),l=this.createLineStyleRadioGroup(t.lineStyle??"solid",e.onChangeLineStyleType);if(s.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);s.append(c),n.append(r)}else"showFill"in t?(s.append(this.createCheckbox({label:"dialogInputShowFill",checked:t.showFill??!0,onChange:c=>e.onChangeLine({showFill:c})})),n.append(r)):s.append(r);return n.append(l),i.append(s,n),"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:isChannelType(t)?"dialogInputExtendChannelStart":"dialogInputExtendLineStart",checked:t.extendStart??!1,onChange:c=>e.onChangeLine({extendStart:c})}),this.createCheckbox({label:isChannelType(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(),s=this.createTextArea({placeholder:"inputTextareaPlaceholder",value:t.text.label,onChange:h=>e.onChangeText({label:h})}),n=this.createFontSizeSelect(t.text.fontSize,e.onChangeTextFontSize),o=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(n,o,r,l),i.append(s,c),{panel:i,onShow:()=>focusCursorAtEnd3(s)}}createColorPickerInput(t,e,i,s,n,o,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:s,hasMultiColorOption:n,onChange:o,onChangeHide:a})}createStrokeWidthSelect(t,e){return this.createSelect({label:"dialogInputStrokeWidth",altText:"dialogInputStrokeWidthAltText",options:LINE_STROKE_WIDTH_ITEMS.map(({label:i,value:s})=>({label:i,value:`${s}`})),value:String(t),onChange:i=>e(Number(i))})}createFibonacciRatioSelect(t,e){return this.createSelect({label:"dialogInputFibonacciBands",altText:"dialogInputFibonacciBandsAltText",options:FIBONACCI_RATIO_ITEMS.map(({label:i,value:s})=>({label:i,value:`${s}`})),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:TEXT_SIZE_ITEMS.map(({label:i,value:s})=>({label:i,value:String(s)})),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 calculateAxisLabelPadding(t){return t.gridPadding+t.seriesAreaPadding+t.tickSize+t.label.spacing}function updateAnnotation(t,e,i){for(const{update:s}of Object.values(annotationConfigs))s(t,e,i)}var{BOOLEAN:BOOLEAN12,OBJECT:OBJECT15,ChartUpdateType:ChartUpdateType2,InteractionState:InteractionState3,ObserveChanges:ObserveChanges3,PropertiesArray:PropertiesArray4,TempValidate:TempValidate33,ChartAxisDirection:ChartAxisDirection11,Vec2:Vec220,keyProperty:keyProperty2,valueProperty:valueProperty2,Selection:Selection3,BBox:BBox4}=module_support_exports,_Annotations=class le extends module_support_exports.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!0,this.toolbar=new AnnotationsToolbar(this.ctx),this.optionsToolbar=new AnnotationOptionsToolbar(this.ctx,()=>{const i=this.state.getActive();if(i!=null)return getTypedDatum(this.annotationData.at(i))}),this.axesButtons=new AxesButtons,this.snap=!1,this.data=void 0,this.xKey=void 0,this.volumeKey=void 0,this.annotationData=new PropertiesArray4(le.createAnnotationDatum),this.defaults=new AnnotationDefaults,this.container=new module_support_exports.Group({name:"static-annotations"}),this.annotations=new Selection3(this.container,this.createAnnotationScene.bind(this)),this.settingsDialog=new AnnotationSettingsDialog(this.ctx),this.textInput=new TextInput(this.ctx),this.isRestoringAnnotations=!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 AnnotationsStateMachine({resetToIdle:()=>{e.domManager.updateCursor("annotations"),this.popAnnotationState(InteractionState3.Annotations),this.hideOverlays(),this.optionsToolbar.hide(),this.deleteEphemeralAnnotations(),this.update()},hoverAtCoords:(i,s,n)=>{let o;return this.annotations.each((a,r,l)=>{const c=a.containsPoint(i.x,i.y);c&&(o??(o=l)),a.toggleHovered(c||s===l)}),o!=null?e.tooltipManager.suppressTooltip("annotations"):this.isAnnotationState()||e.tooltipManager.unsuppressTooltip("annotations"),this.ctx.domManager.updateCursor("annotations",o==null?void 0:this.annotations.at(o)?.getCursor()),o!==n&&this.update(),o},getNodeAtCoords:(i,s)=>{const n=this.annotations.at(s);if(n)return n.getNodeAtCoords(i.x,i.y)},translate:(i,s)=>{const n=this.annotations.at(i),o=getTypedDatum(this.annotationData.at(i));if(!(!n||!o))return this.translateNode(n,o,s)},copy:i=>{const s=this.annotations.at(i),n=getTypedDatum(this.annotationData.at(i));if(!(!s||!n))return this.createAnnotationDatumCopy(s,n)},paste:i=>{this.createAnnotation(i.type,i,!1),this.postUpdateFns.push(()=>{this.state.transitionAsync("selectLast"),this.state.transitionAsync("copy")})},select:(i,s)=>{const{annotations:n,optionsToolbar:o,toolbar:a}=this;this.hideOverlays(),a.clearActiveButton(),a.resetButtonIcons();const r=i!=null?n.at(i):null,l=s!=null?n.at(s):null;l===r&&r!=null||(l?.toggleActive(!1),o.hide(),r?(this.pushAnnotationState(InteractionState3.AnnotationsSelected),r.toggleActive(!0),o.updateButtons(this.annotationData.at(i)),this.postUpdateFns.push(()=>{o.show(),o.setAnchorScene(r)})):(this.popAnnotationState(InteractionState3.AnnotationsSelected),this.popAnnotationState(InteractionState3.Annotations)),this.deleteEphemeralAnnotations(),this.update())},selectLast:()=>(this.pushAnnotationState(InteractionState3.AnnotationsSelected),this.annotationData.length-1),startInteracting:()=>{this.pushAnnotationState(InteractionState3.Annotations)},stopInteracting:()=>{this.popAnnotationState(InteractionState3.Annotations)},create:(i,s)=>{this.createAnnotation(i,s)},delete:i=>{this.annotationData.splice(i,1)},deleteAll:()=>{this.annotationData.splice(0,this.annotationData.length)},validatePoint:(i,s)=>{const n=this.getAnnotationContext();return n?validateDatumPoint(n,i,s):!0},getAnnotationType:i=>stringToAnnotationType(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(),s=i!=null?this.annotations.at(i):null;s!=null&&this.optionsToolbar.setAnchorScene(s)}),this.update()},showTextInput:i=>{const s=getTypedDatum(this.annotationData.at(i));if(!this.annotations.at(i)||!s||!("getTextInputCoords"in s)||!("getTextPosition"in s))return;const o={color:s.color,fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight,placeholderColor:s.getPlaceholderColor()},a=this.getAnnotationContext(),r=c=>Vec220.add(s.getTextInputCoords(a,c),Vec220.required(this.seriesRect)),l=()=>s.getTextPosition();this.textInput.show({styles:o,layout:{getTextInputCoords:r,getTextPosition:l,alignment:s.alignment,textAlign:s.textAlign,width:s.width},text:s.text,placeholderText:s.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 s=this.textInput.updateFontSize(i);this.state.transition("updateTextInputBBox",s)},updateTextInputBBox:i=>{this.state.transition("updateTextInputBBox",i)},showAnnotationOptions:i=>{const s=this.annotations.at(i);!s||isEphemeralType(this.annotationData.at(i))||(this.optionsToolbar.updateButtons(this.annotationData.at(i)),this.optionsToolbar.show(),this.optionsToolbar.setAnchorScene(s))},showAnnotationSettings:(i,s,n="line")=>{const o=this.annotationData.at(i);if(!isLineType(o)&&!isChannelType(o)&&!isMeasurerType(o)||isEphemeralType(o))return;const a=c=>(h,d,u,p)=>{this.setColorAndDefault(o.type,c,h,d,u,p),this.optionsToolbar.updateColorPickerColor(c,d,u,p)},r=c=>()=>{this.recordActionAfterNextUpdate(`Change ${o.type} ${c} to ${o.getDefaultColor(c)}`,["annotations","defaults"]),this.update()},l={initialSelectedTab:n,ariaLabel:this.ctx.localeManager.t("ariaLabelAnnotationSettingsDialog"),sourceEvent:s,onChangeLine:c=>{this.state.transition("lineProps",c),c.bands!=null&&this.defaults.setDefaultFibonacciOptions(o.type,"bands",c.bands),c.reverse!=null&&this.defaults.setDefaultFibonacciOptions(o.type,"reverse",c.reverse),c.showFill!=null&&this.defaults.setDefaultFibonacciOptions(o.type,"showFill",c.showFill)},onChangeText:c=>{this.state.transition("lineText",c),c.alignment&&this.defaults.setDefaultLineTextAlignment(o.type,c.alignment),c.position&&this.defaults.setDefaultLineTextPosition(o.type,c.position),this.recordActionAfterNextUpdate(`Change ${o.type} text ${Object.keys(c).map(h=>`${h} to ${c[h]}`).join(", ")}`)},onChangeFillColor:a("fill-color"),onChangeHideFillColor:r("fill-color"),onChangeLineColor:a("line-color"),onChangeHideLineColor:r("line-color"),onChangeLineStyleType:c=>{this.setLineStyleTypeAndDefault(o.type,c),this.optionsToolbar.updateLineStyleType(LINE_STYLE_TYPE_ITEMS.find(h=>h.value===c)??LINE_STYLE_TYPE_ITEMS[0])},onChangeLineStyleWidth:c=>{this.setLineStyleWidthAndDefault(o.type,c),this.optionsToolbar.updateStrokeWidth({strokeWidth:c,value:c,label:String(c)})},onChangeTextColor:a("text-color"),onChangeHideTextColor:r("text-color"),onChangeTextFontSize:c=>{this.setFontSizeAndDefault(o.type,c)}};this.settingsDialog.show(o,l)}})}setupListeners(){const{ctx:e,optionsToolbar:i,settingsDialog:s,toolbar:n}=this,{seriesWidget:o,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)),o.addListener("keydown",this.onKeyDown.bind(this)),o.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()),n.addListener("cancel-create-annotation",()=>{this.cancel(),this.reset(),this.update()}),n.addListener("pressed-create-annotation",({annotation:l})=>{this.cancel(),this.pushAnnotationState(InteractionState3.Annotations),this.state.transition(l),this.update()}),n.addListener("pressed-clear",()=>{this.clear(),this.recordActionAfterNextUpdate("Clear all")}),n.addListener("pressed-show-menu",()=>{this.cancel(),this.reset()}),n.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:d,opacity:u,isMultiColor:p})=>{this.setColorAndDefault(l,c,h,d,u,p)}),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)}),s.addListener("hidden",()=>{this.optionsToolbar.clearActiveButton()}))}setupDOM(){const{ctx:e,toolbar:i}=this;this.destroyFns.push(e.annotationManager.attachNode(this.container),()=>e.domManager.removeStyles(DEFAULT_ANNOTATION_AXIS_BUTTON_CLASS),()=>i.destroy())}async processData(e){if(!this.enabled||this.data==null||this.xKey==null||this.volumeKey==null)return;const i=[keyProperty2(this.xKey,void 0,{id:"date"}),valueProperty2(this.volumeKey,"number",{id:"volume"})],{dataModel:s,processedData:n}=await e.request("annotations",this.data,{props:i});this.dataModel=s,this.processedData=n}createAnnotationScene(e){if(e.type in annotationConfigs)return new annotationConfigs[e.type].scene;throw new Error(`AG Charts - Cannot create annotation scene of type [${e.type}], expected one of [${Object.keys(annotationConfigs)}], ignoring.`)}static createAnnotationDatum(e){if(e.type in annotationConfigs)return new annotationConfigs[e.type].datum().set(e);throw new Error(`AG Charts - Cannot create annotation datum of unknown type [${e.type}], expected one of [${Object.keys(annotationConfigs)}], ignoring.`)}createAnnotation(e,i,s=!0){if(this.annotationData.push(i),s){const n=this.ctx.annotationManager.getAnnotationTypeStyles(e);n&&i.set(n),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:s,processedData:n}=this;let o=getGroupingValue(e),a=getGroupingValue(i);if(!isValidDate(o)||!isValidDate(a)||!s||!n||this.volumeKey==null)return;o>a&&([o,a]=[a,o]);const r=s.resolveKeysById({id:"annotations"},"date",n),l=s.resolveColumnById({id:"annotations"},"volume",n);let c=0;for(let h=0;h<n.input.count;h++){const d=r[h];isValidDate(d)&&d>=o&&d<=a&&(c+=l[h])}return c}translateNode(e,i,s){const n=this.getAnnotationConfig(i),o=this.getAnnotationContext();o&&n.translate(e,i,s,o)}createAnnotationDatumCopy(e,i){const s=this.getAnnotationConfig(i),n=new s.datum;n.set(i.toJson());const o=this.getAnnotationContext();if(o)return s.copy(e,i,n,o)}getAnnotationConfig(e){if(e.type in annotationConfigs)return annotationConfigs[e.type];throw new Error(`AG Charts - Cannot get annotation config of unknown type [${e.type}], expected one of [${Object.keys(annotationConfigs)}], ignoring.`)}onRestoreAnnotations(e){this.enabled&&(this.clear(),this.annotationData.set(e.annotations),this.isRestoringAnnotations=!0,this.postUpdateFns.push(()=>{this.ctx.annotationManager.fireChangedEvent()}),this.update())}onLayoutComplete(e){const i=e.series.paddedRect;this.seriesRect=i,this.container.setClipRect(i);for(const s of e.axes??[])s.direction===module_support_exports.ChartAxisDirection.X?this.xAxis=this.getAxis(s,i,this.xAxis?.button):this.yAxis=this.getAxis(s,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(n=>n.hasData),s=this.yAxis.context.seriesIds().some(n=>this.ctx.chartService.series.find(a=>a.id===n)?.visible);return e&&s}animateAnnotations({from:e,to:i,phase:s}){const{annotations:n}=this;this.ctx.animationManager?.animate({from:e,to:i,id:"chart-annotations",phase:s,groupId:"opacity",onUpdate(o){n.each(a=>{a.opacity=o,"setAxisLabelOpacity"in a&&a.setAxisLabelOpacity(o)})},onStop(){n.each(o=>{o.opacity=i,"setAxisLabelOpacity"in o&&o.setAxisLabelOpacity(i)})}})}onPreRender(){this.updateAnnotations(),this.state.transition("render")}getAxis(e,i,s){const n=this.ctx.axisManager.getAxisContext(e.direction)[0],{position:o="bottom",direction:a}=n,r=e.gridPadding+e.seriesAreaPadding,l=new BBox4(0,0,i.width,i.height).grow(r,o),c=n.direction===ChartAxisDirection11.X?"vertical":"horizontal",{axesButtons:h,snap:d}=this;if(this.enabled&&h.enabled&&(h.axes==="xy"||h.axes===a)){s??(s=new AxisButton(this.ctx,{...n,snapToGroup:d},g=>this.onAxisButtonClick(g,c),i));const p=calculateAxisLabelPadding(e);s.update(i,p)}else s?.destroy(),s=void 0;return{layout:e,context:n,bounds:l,button:s}}recordActionAfterNextUpdate(e,i=["annotations"]){const{defaults:s,ctx:{annotationManager:n,historyManager:o}}=this,a=i.map(r=>r==="defaults"?s:n);this.postUpdateFns.push(()=>{o.record(e,...a),n.fireChangedEvent()})}setColorAndDefault(e,i,s,n,o,a){this.state.transition("color",{colorPickerType:i,colorOpacity:s,color:n,opacity:o,isMultiColor:a}),this.defaults.setDefaultColor(e,i,s,n,o,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:s,ctx:{annotationManager:n}}=this,o=this.getAnnotationContext();if(!s||!o)return;n.updateData(e.toJson().filter(r=>!isEphemeralType(r)));const a=this.showAnnotations();this.toolbar.refreshButtonsEnabled(a),this.toolbar.toggleClearButtonEnabled(e.length>0&&a),i.update(e??[],void 0,r=>r.id).each((r,l)=>{if(!a||!this.validateDatum(l)){r.visible=!1,"setAxisLabelVisible"in r&&r.setAxisLabelVisible(!1);return}"setAxisLabelVisible"in r&&r.setAxisLabelVisible(!0),this.injectDatumDependencies(l),updateAnnotation(r,l,o)}),this.postUpdateFns.forEach(r=>r()),this.postUpdateFns=[],this.isRestoringAnnotations=!1}validateDatum(e){if(!this.isRestoringAnnotations)return!0;const i=this.getAnnotationContext(),s=`Annotation [${e.type}] `;return i?e.isValidWithContext(i,s):!0}getAnnotationContext(){const{seriesRect:e,xAxis:i,yAxis:s,snap:n}=this;if(e&&i&&s)return{seriesRect:e,xAxis:{...i.context,bounds:i.bounds,labelPadding:calculateAxisLabelPadding(i.layout),snapToGroup:n},yAxis:{...s.context,bounds:s.bounds,labelPadding:calculateAxisLabelPadding(i.layout),snapToGroup:n}}}onHover(e){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const n=e.sourceEvent.shiftKey,o=Vec220.from(e),a=invertCoords(o,s);i.transition("hover",{offset:o,point:a,shiftKey:n,context:s})}onClick(e){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const n=e.sourceEvent.shiftKey,o=invertCoords(Vec220.from(e),s),a=this.textInput.getValue(),r=this.textInput.getBBox();i.transition("click",{point:o,shiftKey:n,textInputValue:a,bbox:r})}onDoubleClick(e){const{state:i}=this;if(!this.getAnnotationContext())return;const n=Vec220.from(e);i.transition("dblclick",{offset:n})}onAxisButtonClick(e,i){this.cancel(),this.reset();const s=this.getAnnotationContext();if(!this.annotationData||!s)return;const{state:n}=this;this.pushAnnotationState(InteractionState3.Annotations);const o=i==="horizontal";if(n.transition(o?"horizontal-line":"vertical-line"),this.optionsToolbar.hide(),!e)return;const a=invertCoords(e,s);validateDatumPoint(s,a)&&(n.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(InteractionState3.AnnotationsSelected)&&e.sourceEvent.preventDefault()}onDragStart(e){if(!this.ctx.interactionManager.isState(InteractionState3.AnnotationsDraggable))return;const i=this.getAnnotationContext();if(!i)return;const s=Vec220.from(e),n=invertCoords(s,i),o=this.textInput.getValue(),a=this.textInput.getBBox();this.state.transition("dragStart",{context:i,offset:s,point:n,textInputValue:o,bbox:a})}onDrag(e){if(!this.ctx.interactionManager.isState(InteractionState3.AnnotationsDraggable))return;const i=this.getAnnotationContext();if(!i)return;const s=Vec220.from(e),n=invertCoords(s,i),o=e.sourceEvent.shiftKey,a=this.textInput.getValue(),r=this.textInput.getBBox();this.state.transition("drag",{context:i,offset:s,point:n,shiftKey:o,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,s=this.getAnnotationContext();if(!s)return;const{key:n,shiftKey:o}=e,a=this.textInput.getValue(),r=this.textInput.getBBox();i.transition("textInput",{key:n,shiftKey:o,textInputValue:a,bbox:r,context:s})}onKeyDown(e){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const{sourceEvent:n}=e,{shiftKey:o,ctrlKey:a,metaKey:r}=n,l=a||r,c=a||o;i.transition("keyDown",{shiftKey:o,context:s});const h={x:0,y:0},d=Math.max(s?.xAxis.scale.bandwidth??0,c?10:1),u=Math.max(s?.yAxis.scale.bandwidth??0,c?10:1);switch(n.key){case"ArrowDown":h.y=u;break;case"ArrowUp":h.y=-u;break;case"ArrowLeft":h.x=-d;break;case"ArrowRight":h.x=d;break;case"Escape":this.onCancel();return;case"Backspace":case"Delete":this.onDelete();return}if((h.x||h.y)&&(i.transition("translate",{translation:h}),n.stopPropagation(),n.preventDefault()),!!l)switch(n.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,s=this.getAnnotationContext();s&&(this.state.transition("keyUp",{shiftKey:i,context:s}),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())isEphemeralType(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(InteractionState3.Annotations)||this.ctx.interactionManager.isState(InteractionState3.AnnotationsSelected)}update(e=ChartUpdateType2.PRE_SCENE_RENDER){this.ctx.updateService.update(e)}};__decorateClass([ObserveChanges3((t,e,i)=>{const{ctx:{annotationManager:s,stateManager:n}}=t;e!==i&&(t.toolbar?.toggleVisibility(!!e),i===!1&&e===!0?n.restoreState(s):e===!1&&t.clear())}),TempValidate33(BOOLEAN12)],_Annotations.prototype,"enabled",2),__decorateClass([TempValidate33(OBJECT15)],_Annotations.prototype,"toolbar",2),__decorateClass([TempValidate33(OBJECT15)],_Annotations.prototype,"optionsToolbar",2),__decorateClass([TempValidate33(OBJECT15)],_Annotations.prototype,"axesButtons",2),__decorateClass([TempValidate33(BOOLEAN12)],_Annotations.prototype,"snap",2);var Annotations=_Annotations,{FONT_SIZE_RATIO:FONT_SIZE_RATIO2,ThemeSymbols}=module_support_exports,stroke2={stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:2},handle2={fill:ThemeSymbols.DEFAULT_ANNOTATION_HANDLE_FILL,strokeOpacity:1,strokeWidth:2},font2={color:{$ref:"backgroundColor"},fontSize:{$rem:[FONT_SIZE_RATIO2.LARGE]},fontFamily:{$ref:"fontFamily"}},axisLabel2={...font2,enabled:!0,fill:{$ref:"foregroundColor"},fontSize:{$ref:"fontSize"}},text2={...font2,textAlign:"left"},lineText2={...font2,position:"top",alignment:"center",color:{$ref:"textColor"}},channelText={...font2,position:"top",alignment:"center",color:{$ref:"textColor"}},measurerStatistics2={...font2,fontSize:{$ref:"fontSize"},color:ThemeSymbols.DEFAULT_ANNOTATION_STATISTICS_COLOR,fill:ThemeSymbols.DEFAULT_ANNOTATION_STATISTICS_FILL,stroke:ThemeSymbols.DEFAULT_ANNOTATION_STATISTICS_STROKE,strokeWidth:1,divider:{stroke:ThemeSymbols.DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE,strokeWidth:1,strokeOpacity:.5}},measurer2={...stroke2,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...handle2},text:{...lineText2},statistics:{...measurerStatistics2}},toolbar={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"}},optionsToolbar={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"}]},annotationsTheme2={enabled:!1,line:{...stroke2,handle:{...handle2},text:{...lineText2}},"horizontal-line":{...stroke2,handle:{...handle2},axisLabel:{...axisLabel2},text:{...lineText2}},"vertical-line":{...stroke2,handle:{...handle2},axisLabel:{...axisLabel2},text:{...lineText2}},"disjoint-channel":{...stroke2,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...handle2},text:{...channelText}},"parallel-channel":{...stroke2,middle:{lineDash:[6,5],strokeWidth:1},background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...handle2},text:{...channelText}},"fibonacci-retracement":{...stroke2,strokes:ThemeSymbols.DEFAULT_FIBONACCI_STROKES,rangeStroke:{$ref:"foregroundColor"},handle:{...handle2},text:{...lineText2,position:"center"},label:{...font2,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},"fibonacci-retracement-trend-based":{...stroke2,strokes:ThemeSymbols.DEFAULT_FIBONACCI_STROKES,rangeStroke:{$ref:"foregroundColor"},handle:{...handle2},text:{...lineText2,position:"center"},label:{...font2,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},callout:{...stroke2,...text2,color:{$ref:"textColor"},handle:{...handle2},fill:{$ref:"foregroundColor"},fillOpacity:.075},comment:{...text2,fontWeight:700,handle:{...handle2},fill:{$ref:"foregroundColor"}},note:{...text2,color:ThemeSymbols.DEFAULT_TEXTBOX_COLOR,fill:ThemeSymbols.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,stroke:{$ref:"backgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...handle2},background:{fill:ThemeSymbols.DEFAULT_TEXTBOX_FILL,stroke:ThemeSymbols.DEFAULT_TEXTBOX_STROKE,strokeWidth:1}},text:{...text2,color:{$ref:"textColor"},handle:{...handle2}},arrow:{...stroke2,handle:{...handle2},text:{...lineText2}},"arrow-up":{fill:ThemeSymbols.PALETTE_UP_FILL,handle:{...handle2,stroke:{$ref:"foregroundColor"}}},"arrow-down":{fill:ThemeSymbols.PALETTE_DOWN_FILL,handle:{...handle2,stroke:{$ref:"foregroundColor"}}},"date-range":{...measurer2},"price-range":{...measurer2},"date-price-range":{...measurer2},"quick-date-price-range":{up:{...stroke2,fill:ThemeSymbols.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,fillOpacity:.2,handle:{...handle2},statistics:{...measurerStatistics2,color:"#fff",fill:ThemeSymbols.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...stroke2,stroke:ThemeSymbols.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE,fill:ThemeSymbols.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,fillOpacity:.2,handle:{...handle2,stroke:ThemeSymbols.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE},statistics:{...measurerStatistics2,color:"#fff",fill:ThemeSymbols.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{},toolbar,optionsToolbar},AnnotationsModule={type:"root",optionsKey:"annotations",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new Annotations(t),themeTemplate:{annotations:annotationsTheme2}},{BaseProperties:BaseProperties13,ObserveChanges:ObserveChanges4,ProxyProperty:ProxyProperty2,TempValidate:TempValidate34,NUMBER:NUMBER10,POSITIVE_NUMBER:POSITIVE_NUMBER7,RATIO:RATIO6,calculatePlacement:calculatePlacement2}=module_support_exports,Image2=class extends BaseProperties13{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=createElement("img"),this.imageElement.onload=this.onImageLoad,this.node=new module_support_exports.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},s=calculatePlacement2(this.imageElement.width,this.imageElement.height,i,this);return this.node.setProperties(this.complete?{visible:!0,opacity:this.opacity,...s}:{visible:!1}),s}};__decorateClass([TempValidate34(NUMBER10,{optional:!0})],Image2.prototype,"top",2),__decorateClass([TempValidate34(NUMBER10,{optional:!0})],Image2.prototype,"right",2),__decorateClass([TempValidate34(NUMBER10,{optional:!0})],Image2.prototype,"bottom",2),__decorateClass([TempValidate34(NUMBER10,{optional:!0})],Image2.prototype,"left",2),__decorateClass([TempValidate34(POSITIVE_NUMBER7,{optional:!0})],Image2.prototype,"width",2),__decorateClass([TempValidate34(POSITIVE_NUMBER7,{optional:!0})],Image2.prototype,"height",2),__decorateClass([TempValidate34(RATIO6)],Image2.prototype,"opacity",2),__decorateClass([ProxyProperty2("imageElement.src"),ObserveChanges4(t=>t.loadedSynchronously=t.complete)],Image2.prototype,"url",2);var{ActionOnSet:ActionOnSet4,OBJECT:OBJECT16,TempValidate:TempValidate35}=module_support_exports,Background3=class extends module_support_exports.Background{constructor(){super(...arguments),this.image=new Image2}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(module_support_exports.ChartUpdateType.SCENE_RENDER)}};__decorateClass([TempValidate35(OBJECT16,{optional:!0}),ActionOnSet4({newValue(t){this.node.appendChild(t.node),t.onLoad=()=>this.onImageLoad()},oldValue(t){this.node.removeChild(t.node),t.onLoad=void 0}})],Background3.prototype,"image",2);var BackgroundModule2={type:"root",optionsKey:"background",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new Background3(t)},{BOOLEAN:BOOLEAN13,ActionOnSet:ActionOnSet5,LayoutElement:LayoutElement3,Menu:Menu4,TempValidate:TempValidate36}=module_support_exports,menuItems=[{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"}],ChartToolbar=class extends module_support_exports.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!1,this.menu=new Menu4(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(LayoutElement3.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:menuItems,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=menuItems.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=>logger_exports.error(i))}getChartType(){const t=this.ctx.chartService.publicApi?.getOptions()?.chartType;return t==null||!menuItems.some(e=>e.value===t)?"candlestick":t}};__decorateClass([TempValidate36(BOOLEAN13),ActionOnSet5({changeValue(t){this.toolbar?.setHidden(!t)}})],ChartToolbar.prototype,"enabled",2);var ChartToolbarModule={type:"root",optionsKey:"chartToolbar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new ChartToolbar(t)},DEFAULT_CONTEXT_MENU_CLASS="ag-charts-context-menu",DEFAULT_CONTEXT_MENU_DARK_CLASS="ag-charts-dark-context-menu",{BOOLEAN:BOOLEAN14,TempValidate:TempValidate37,initMenuKeyNav:initMenuKeyNav2,makeAccessibleClickListener:makeAccessibleClickListener2,ContextMenuRegistry:ContextMenuRegistry2}=module_support_exports,moduleId2="context-menu";function getChildrenOfType(t,e){const{children:i}=t??{};if(!i)return[];const s=[];for(const n of Array.from(i))n instanceof e&&s.push(n);return s}var ContextMenu=class extends module_support_exports.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",moduleId2),this.element.classList.add(DEFAULT_CONTEXT_MENU_CLASS),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(s=>{logger_exports.error("Unable to download chart",s)})}})),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=[],ContextMenuRegistry2.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=[],ContextMenuRegistry2.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:s,extraNode:n,extraLegendItem:o}=this.groups;[e,i,s,n,o].reduce((r,l)=>l.length+r,0)!==0&&this.show(t.sourceEvent)}show(t){this.interactionManager.pushState(module_support_exports.InteractionState.ContextMenu),this.element.classList.toggle(DEFAULT_CONTEXT_MENU_DARK_CLASS,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,s=getChildrenOfType(e,HTMLButtonElement);this.menuCloser=initMenuKeyNav2({menu:e,buttons:s,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(module_support_exports.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=createElement("div");return t.classList.add(`${DEFAULT_CONTEXT_MENU_CLASS}__menu`),t.classList.toggle(DEFAULT_CONTEXT_MENU_DARK_CLASS,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(s=>{const n=this.renderItem(s);n&&t.appendChild(n)}))}renderItem(t){if(t&&typeof t=="object"&&t.constructor===Object)return this.createActionElement(t)}createDividerElement(){const t=createElement("div");return t.classList.add(`${DEFAULT_CONTEXT_MENU_CLASS}__divider`),t.classList.toggle(DEFAULT_CONTEXT_MENU_DARK_CLASS,this.darkTheme),t.role="separator",t}createActionElement({id:t,label:e,type:i,action:s}){const n=!!(t&&this.registry.isDisabled(t));return this.createButtonElement(i,e,s,n)}createButtonOnClick(t,e){return ContextMenuRegistry2.checkCallback("legend",t,e)?i=>{if(this.pickedLegendItem){const{seriesId:s,itemId:n}=this.pickedLegendItem;e({type:"contextmenu",seriesId:s,itemId:n,event:i}),this.hide()}}:ContextMenuRegistry2.checkCallback("series-area",t,e)?()=>{e({type:"seriesContextMenuAction",event:this.showEvent}),this.hide()}:ContextMenuRegistry2.checkCallback("node",t,e)?()=>{const{pickedNode:i,showEvent:s}=this,n=i?.series.createNodeContextMenuActionEvent(s,i);n?e(n):logger_exports.error("series node not found"),this.hide()}:()=>{e({type:"contextMenuEvent",event:this.showEvent}),this.hide()}}createButtonElement(t,e,i,s){const n=createElement("button");return n.classList.add(`${DEFAULT_CONTEXT_MENU_CLASS}__item`),n.classList.toggle(DEFAULT_CONTEXT_MENU_DARK_CLASS,this.darkTheme),n.ariaDisabled=s.toString(),n.textContent=this.ctx.localeManager.t(e),n.role="menuitem",n.onclick=makeAccessibleClickListener2(n,this.createButtonOnClick(t,i)),n.addEventListener("mouseover",()=>n.focus({preventScroll:!0})),n}reposition(){let{x:t,y:e}=this;this.element.style.top="unset",this.element.style.bottom="unset";const i=this.ctx.domManager.getBoundingClientRect(),{offsetWidth:s,offsetHeight:n}=this.element;t=clamp(0,t,i.width-s),e=clamp(0,e,i.height-n),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(moduleId2),this.ctx.domManager.removeChild("canvas-overlay",moduleId2)}};__decorateClass([TempValidate37(BOOLEAN14)],ContextMenu.prototype,"enabled",2),__decorateClass([TempValidate37(BOOLEAN14)],ContextMenu.prototype,"darkTheme",2);var ContextMenuModule={type:"root",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],optionsKey:"contextMenu",moduleFactory:t=>new ContextMenu(t),themeTemplate:{contextMenu:{enabled:!0,darkTheme:module_support_exports.ThemeSymbols.IS_DARK_THEME}}},{BaseProperties:BaseProperties14,BOOLEAN:BOOLEAN15,FUNCTION:FUNCTION3,NUMBER:NUMBER11,STRING:STRING20,TempValidate:TempValidate38,createId:createId3,setAttribute:setAttribute3}=module_support_exports,DEFAULT_LABEL_CLASS="ag-charts-crosshair-label",CrosshairLabelProperties=class extends module_support_exports.ChangeDetectableProperties{constructor(){super(...arguments),this.enabled=!0,this.xOffset=0,this.yOffset=0,this.format=void 0,this.renderer=void 0}};__decorateClass([TempValidate38(BOOLEAN15)],CrosshairLabelProperties.prototype,"enabled",2),__decorateClass([TempValidate38(NUMBER11)],CrosshairLabelProperties.prototype,"xOffset",2),__decorateClass([TempValidate38(NUMBER11)],CrosshairLabelProperties.prototype,"yOffset",2),__decorateClass([TempValidate38(STRING20,{optional:!0})],CrosshairLabelProperties.prototype,"format",2),__decorateClass([TempValidate38(FUNCTION3,{optional:!0})],CrosshairLabelProperties.prototype,"renderer",2);var CrosshairLabel=class extends BaseProperties14{constructor(t,e,i){super(),this.domManager=t,this.id=createId3(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(DEFAULT_LABEL_CLASS),setAttribute3(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,s=t.y+this.yOffset;e.style.top=`${Math.round(s)}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 module_support_exports.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:s=e.color,backgroundColor:n=e.backgroundColor,opacity:o=e.opacity??1}=t;return`<div class="ag-charts-crosshair-label-content" style="${`opacity: ${o}; background-color: ${n?.toLowerCase()}; color: ${s}`}">
<span>${i}</span>
</div>`}};__decorateClass([TempValidate38(BOOLEAN15)],CrosshairLabel.prototype,"enabled",2),__decorateClass([TempValidate38(NUMBER11)],CrosshairLabel.prototype,"xOffset",2),__decorateClass([TempValidate38(NUMBER11)],CrosshairLabel.prototype,"yOffset",2),__decorateClass([TempValidate38(STRING20,{optional:!0})],CrosshairLabel.prototype,"format",2),__decorateClass([TempValidate38(FUNCTION3,{optional:!0})],CrosshairLabel.prototype,"renderer",2);var{Group:Group6,TranslatableGroup:TranslatableGroup2,Line:Line4,BBox:BBox5,createId:createId4,POSITIVE_NUMBER:POSITIVE_NUMBER8,RATIO:RATIO7,BOOLEAN:BOOLEAN16,COLOR_STRING:COLOR_STRING5,LINE_DASH:LINE_DASH4,OBJECT:OBJECT17,InteractionState:InteractionState4,TempValidate:TempValidate39,ZIndexMap:ZIndexMap5,formatNumber:formatNumber2,ChartAxisDirection:ChartAxisDirection12}=module_support_exports,Crosshair=class extends module_support_exports.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.id=createId4(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 CrosshairLabelProperties,this.seriesRect=new BBox5(0,0,0,0),this.bounds=new BBox5(0,0,0,0),this.crosshairGroup=new TranslatableGroup2({name:"crosshairs",zIndex:ZIndexMap5.SERIES_CROSSHAIR}),this.lineGroup=this.crosshairGroup.appendChild(new Group6({name:`${this.id}-crosshair-lines`,zIndex:ZIndexMap5.SERIES_CROSSHAIR})),this.lineGroupSelection=module_support_exports.Selection.select(this.lineGroup,Line4,!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(module_support_exports.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.values(this.labels).forEach(e=>e.destroy()))}layout({series:{rect:t,visible:e},axes:i}){if(!e||!i||!this.enabled)return;this.seriesRect=t;const{position:s="left",axisId:n}=this.axisCtx,o=i.find(c=>c.id===n);if(!o)return;this.axisLayout=o,this.bounds=t.clone().grow(o.gridPadding+o.seriesAreaPadding,s);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 Line4),e=>e)}updateLabels(t){const{labels:e,ctx:i}=this;for(const s of t)this.label.enabled&&(e[s]??(e[s]=new CrosshairLabel(i.domManager,s,this.axisCtx.axisId))),e[s]&&this.updateLabel(e[s]);this.labelFormatter=this.axisCtx.scaleValueFormatter(this.label.format)}updateLabel(t){const{enabled:e,xOffset:i,yOffset:s,format:n,renderer:o}=this.label;t.enabled=e,t.xOffset=i,t.yOffset=s,t.format=n,t.renderer=o}updateLines(){const{lineGroupSelection:t,bounds:e,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,axisLayout:r}=this;if(!r)return;const l=this.isVertical();t.each(c=>{c.stroke=i,c.strokeWidth=s,c.strokeOpacity=n,c.lineDash=o,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===ChartAxisDirection12.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:s}}=this;if(e){const n=s.call(this.axisCtx,e,t);if(n!=null)return n}if(typeof t=="number"){const n=(i?.label.fractionDigits??0)+(isInteger(t)?0:1);return formatNumber2(t,n)}return String(t??"")}onClick(t){t.device==="touch"&&this.onMouseHoverLike(t)}onMouseHoverLike(t){if(!this.enabled||this.snap)return;const e=this.isHover(t)?InteractionState4.Clickable:InteractionState4.AnnotationsMoveable;this.ctx.interactionManager.isState(e)&&(this.updatePositions(this.getData(t)),this.crosshairGroup.visible=!0,this.ctx.updateService.update(module_support_exports.ChartUpdateType.SCENE_RENDER))}onMouseOut(){this.ctx.interactionManager.isState(InteractionState4.Clickable)&&(this.hideCrosshairs(),this.ctx.updateService.update(module_support_exports.ChartUpdateType.SCENE_RENDER))}onKeyPress(){this.enabled&&!this.snap&&this.ctx.interactionManager.isState(InteractionState4.Default)&&this.hideCrosshairs()}onHighlightChange(t){if(!this.enabled)return;const{crosshairGroup:e,axisCtx:i}=this,{datum:s,series:n}=t.currentHighlight??{},o=s&&(n?.axes.x?.id===i.axisId||n?.axes.y?.id===i.axisId);if(this.activeHighlight=o?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((s,n)=>{const o=t[n];if(!o){s.visible=!1,this.hideLabel(n);return}s.visible=!0;const{value:a,position:r}=o;let l=0,c=0;this.isVertical()?(l=r,s.x=Math.round(l)):(c=r,s.y=Math.round(c)),this.label.enabled?this.showLabel(l+e.x,c+e.y,a,n):this.hideLabel(n)})}getData(t){const{axisCtx:e}=this,i="pointer",{datum:s,xKey:n="",yKey:o=""}=this.activeHighlight??{},{currentX:a,currentY:r}=t,l=this.isVertical(),c=l?a:r;let h=s?.[l?n:o]??"";return e.continuous&&(h=e.scaleInvert(c)),{[i]:{position:c,value:h}}}getActiveHighlightData(t){const{axisCtx:e}=this,{datum:i,series:s,xKey:n="",aggregatedValue:o,cumulativeValue:a,midPoint:r}=t,l=s.getKeyProperties(e.direction),c=(e.scale.bandwidth??0)/2,h=s.axes[e.direction]?.id===e.axisId,d=l.indexOf("yKey")>-1&&h,u=l.indexOf("xKey")>-1&&h,p=o??a;if(d&&p!==void 0){const f=e.scale.convert(p)+c;return this.isInRange(f)?{yKey:{value:p,position:f}}:{}}if(u){const f=(this.isVertical()?r?.x:r?.y)??0,m=e.continuous?e.scaleInvert(f):i[n];return this.isInRange(f)?{xKey:{value:m,position:f}}:{}}const g={};return l.forEach(f=>{const m=s.properties[f],y=i[m],x=e.scale.convert(y)+c;this.isInRange(x)&&(g[f]={value:y,position:x})}),g}getLabelHtml(t,e){const i=this.axisLayout?.label?.fractionDigits??0,s={text:this.formatValue(t)};return this.label.renderer?e.toLabelHtml(this.label.renderer({value:t,fractionDigits:i}),s):e.toLabelHtml(s)}showLabel(t,e,i,s){if(!this.axisLayout)return;const{bounds:n}=this,o=this.labels[s],a=this.getLabelHtml(i,o);o.setLabelHtml(a);const{width:r,height:l}=o.getBBox(),c=this.axisCtx.position;let h=this.axisLayout.label.spacing+this.axisLayout.tickSize;this.axisCtx.direction===ChartAxisDirection12.X?(h-=4,o.show({x:t-r/2,y:c==="bottom"?n.y+n.height+h:n.y-l-h})):(h-=8,o.show({x:c==="right"?n.x+n.width+h:n.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)}};__decorateClass([TempValidate39(BOOLEAN16)],Crosshair.prototype,"enabled",2),__decorateClass([TempValidate39(COLOR_STRING5,{optional:!0})],Crosshair.prototype,"stroke",2),__decorateClass([TempValidate39(LINE_DASH4,{optional:!0})],Crosshair.prototype,"lineDash",2),__decorateClass([TempValidate39(POSITIVE_NUMBER8)],Crosshair.prototype,"lineDashOffset",2),__decorateClass([TempValidate39(POSITIVE_NUMBER8)],Crosshair.prototype,"strokeWidth",2),__decorateClass([TempValidate39(RATIO7)],Crosshair.prototype,"strokeOpacity",2),__decorateClass([TempValidate39(BOOLEAN16)],Crosshair.prototype,"snap",2),__decorateClass([TempValidate39(OBJECT17)],Crosshair.prototype,"label",2);var CrosshairModule={type:"axis-option",optionsKey:"crosshair",packageType:"enterprise",chartTypes:["cartesian"],axisTypes:["category","ordinal-time","number","log","time"],moduleFactory:t=>new Crosshair(t),themeTemplate:{crosshair:{snap:!0,stroke:{$ref:"subtleTextColor"},strokeWidth:1,strokeOpacity:1,lineDash:[5,6],lineDashOffset:0,label:{enabled:!0}}}},{BOOLEAN:BOOLEAN17,FUNCTION:FUNCTION4,ActionOnSet:ActionOnSet6,TempValidate:TempValidate40}=module_support_exports,DataSource=class extends module_support_exports.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())}};__decorateClass([ActionOnSet6({newValue(t){this.updateCallback(t,this.getData)}}),TempValidate40(BOOLEAN17)],DataSource.prototype,"enabled",2),__decorateClass([ActionOnSet6({newValue(t){this.updateCallback(this.enabled,t)}}),TempValidate40(FUNCTION4)],DataSource.prototype,"getData",2),__decorateClass([ActionOnSet6({newValue(t){this.dataService.requestThrottle=t}})],DataSource.prototype,"requestThrottle",2),__decorateClass([ActionOnSet6({newValue(t){this.dataService.dispatchThrottle=t}})],DataSource.prototype,"updateThrottle",2),__decorateClass([ActionOnSet6({newValue(t){this.dataService.dispatchOnlyLatest=!t}})],DataSource.prototype,"updateDuringInteraction",2);var DataSourceModule={type:"root",optionsKey:"dataSource",packageType:"enterprise",chartTypes:["cartesian","hierarchy","polar","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new DataSource(t),themeTemplate:{dataSource:{enabled:!1}}},{nearestSquaredInContainer:nearestSquaredInContainer2,partialAssign:partialAssign2,mergeDefaults:mergeDefaults2,BBox:BBox6}=module_support_exports,HierarchicalBBox=class{constructor(t){this.components=t,this.union=BBox6.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}},ErrorBarNode=class extends module_support_exports.Group{constructor(){super(),this.capLength=NaN,this._datum=void 0,this.whiskerPath=new module_support_exports.Path,this.capsPath=new module_support_exports.Path,this.bboxes=new HierarchicalBBox([]),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:s}=t,{lengthRatioMultiplier:n,lengthMax:o}=e,a=s??i*n;return Math.min(a,o)}getItemStylerParams(t,e,i){const{datum:s}=this;if(s==null||t.itemStyler==null)return;const{xLowerKey:n,xUpperKey:o,yLowerKey:a,yUpperKey:r}=t;return{...e,datum:s.datum,seriesId:s.datum.seriesId,xKey:s.xKey,yKey:s.yKey,xLowerKey:n,xUpperKey:o,yLowerKey:a,yUpperKey:r,highlighted:i}}formatStyles(t,e,i,s){let{cap:n,...o}=t;const a=this.getItemStylerParams(e,t,s);if(a!=null&&e.itemStyler!=null){const r=i.callWithContext(e.itemStyler,a);o=mergeDefaults2(r,o),n=mergeDefaults2(r?.cap,r,n)}return{whiskerStyle:o,capsStyle:n}}applyStyling(t,e){partialAssign2(["visible","stroke","strokeWidth","strokeOpacity","lineDash","lineDashOffset"],t,e)}update(t,e,i,s){if(this.datum===void 0)return;const{whiskerStyle:n,capsStyle:o}=this.formatStyles(t,e,i,s),{xBar:a,yBar:r,capDefaults:l}=this.datum,c=this.whiskerPath;this.applyStyling(c,n),c.path.clear(!0),r!==void 0&&(c.path.moveTo(r.lowerPoint.x,r.lowerPoint.y),c.path.lineTo(r.upperPoint.x,r.upperPoint.y)),a!==void 0&&(c.path.moveTo(a.lowerPoint.x,a.lowerPoint.y),c.path.lineTo(a.upperPoint.x,a.upperPoint.y)),c.path.closePath(),this.capLength=this.calculateCapLength(o??{},l);const h=this.capLength/2,d=this.capsPath;this.applyStyling(d,o),d.path.clear(!0),r!==void 0&&(d.path.moveTo(r.lowerPoint.x-h,r.lowerPoint.y),d.path.lineTo(r.lowerPoint.x+h,r.lowerPoint.y),d.path.moveTo(r.upperPoint.x-h,r.upperPoint.y),d.path.lineTo(r.upperPoint.x+h,r.upperPoint.y)),a!==void 0&&(d.path.moveTo(a.lowerPoint.x,a.lowerPoint.y-h),d.path.lineTo(a.lowerPoint.x,a.lowerPoint.y+h),d.path.moveTo(a.upperPoint.x,a.upperPoint.y-h),d.path.lineTo(a.upperPoint.x,a.upperPoint.y+h)),d.path.closePath()}updateBBoxes(){const{capLength:t,whiskerPath:e,capsPath:i}=this,{yBar:s,xBar:n}=this.datum??{},o=t/2,a=[];if(s!==void 0){const r=s.lowerPoint.y-s.upperPoint.y;a.push(new BBox6(s.lowerPoint.x,s.upperPoint.y,e.strokeWidth,r),new BBox6(s.lowerPoint.x-o,s.lowerPoint.y,t,i.strokeWidth),new BBox6(s.upperPoint.x-o,s.upperPoint.y,t,i.strokeWidth))}if(n!==void 0){const r=n.upperPoint.x-n.lowerPoint.x;a.push(new BBox6(n.lowerPoint.x,n.upperPoint.y,r,e.strokeWidth),new BBox6(n.lowerPoint.x,n.lowerPoint.y-o,i.strokeWidth,t),new BBox6(n.upperPoint.x,n.upperPoint.y-o,i.strokeWidth,t))}this.bboxes.components=a,this.bboxes.union=BBox6.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:s}=this;if(s.union.distanceSquared(t,e)>i)return{nearest:void 0,distanceSquared:1/0};const{distanceSquared:n}=BBox6.nearestBox(t,e,s.components);return{nearest:this,distanceSquared:n}}},ErrorBarGroup=class extends module_support_exports.Group{nearestSquared(t,e){const{nearest:i,distanceSquared:s}=nearestSquaredInContainer2(t,e,{children:this.children()});if(i!==void 0&&!isNaN(s))return{datum:i.datum,distanceSquared:s}}},{BaseProperties:BaseProperties15,TempValidate:TempValidate41,BOOLEAN:BOOLEAN18,COLOR_STRING:COLOR_STRING6,FUNCTION:FUNCTION5,LINE_DASH:LINE_DASH5,NUMBER:NUMBER12,OBJECT:OBJECT18,POSITIVE_NUMBER:POSITIVE_NUMBER9,RATIO:RATIO8,STRING:STRING21}=module_support_exports,ErrorBarCap=class extends BaseProperties15{};__decorateClass([TempValidate41(BOOLEAN18,{optional:!0})],ErrorBarCap.prototype,"visible",2),__decorateClass([TempValidate41(COLOR_STRING6,{optional:!0})],ErrorBarCap.prototype,"stroke",2),__decorateClass([TempValidate41(POSITIVE_NUMBER9,{optional:!0})],ErrorBarCap.prototype,"strokeWidth",2),__decorateClass([TempValidate41(RATIO8,{optional:!0})],ErrorBarCap.prototype,"strokeOpacity",2),__decorateClass([TempValidate41(LINE_DASH5,{optional:!0})],ErrorBarCap.prototype,"lineDash",2),__decorateClass([TempValidate41(POSITIVE_NUMBER9,{optional:!0})],ErrorBarCap.prototype,"lineDashOffset",2),__decorateClass([TempValidate41(NUMBER12,{optional:!0})],ErrorBarCap.prototype,"length",2),__decorateClass([TempValidate41(RATIO8,{optional:!0})],ErrorBarCap.prototype,"lengthRatio",2);var ErrorBarProperties=class extends BaseProperties15{constructor(){super(...arguments),this.visible=!0,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.cap=new ErrorBarCap}};__decorateClass([TempValidate41(STRING21,{optional:!0})],ErrorBarProperties.prototype,"yLowerKey",2),__decorateClass([TempValidate41(STRING21,{optional:!0})],ErrorBarProperties.prototype,"yLowerName",2),__decorateClass([TempValidate41(STRING21,{optional:!0})],ErrorBarProperties.prototype,"yUpperKey",2),__decorateClass([TempValidate41(STRING21,{optional:!0})],ErrorBarProperties.prototype,"yUpperName",2),__decorateClass([TempValidate41(STRING21,{optional:!0})],ErrorBarProperties.prototype,"xLowerKey",2),__decorateClass([TempValidate41(STRING21,{optional:!0})],ErrorBarProperties.prototype,"xLowerName",2),__decorateClass([TempValidate41(STRING21,{optional:!0})],ErrorBarProperties.prototype,"xUpperKey",2),__decorateClass([TempValidate41(STRING21,{optional:!0})],ErrorBarProperties.prototype,"xUpperName",2),__decorateClass([TempValidate41(BOOLEAN18,{optional:!0})],ErrorBarProperties.prototype,"visible",2),__decorateClass([TempValidate41(COLOR_STRING6,{optional:!0})],ErrorBarProperties.prototype,"stroke",2),__decorateClass([TempValidate41(POSITIVE_NUMBER9,{optional:!0})],ErrorBarProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate41(RATIO8,{optional:!0})],ErrorBarProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate41(LINE_DASH5,{optional:!0})],ErrorBarProperties.prototype,"lineDash",2),__decorateClass([TempValidate41(POSITIVE_NUMBER9,{optional:!0})],ErrorBarProperties.prototype,"lineDashOffset",2),__decorateClass([TempValidate41(FUNCTION5,{optional:!0})],ErrorBarProperties.prototype,"itemStyler",2),__decorateClass([TempValidate41(OBJECT18)],ErrorBarProperties.prototype,"cap",2);var{fixNumericExtent:fixNumericExtent2,groupAccumulativeValueProperty:groupAccumulativeValueProperty2,mergeDefaults:mergeDefaults3,valueProperty:valueProperty3,ChartAxisDirection:ChartAxisDirection13}=module_support_exports;function toErrorBoundCartesianSeries(t){for(const e of AgErrorBarSupportedSeriesTypes)if(e===t.series.type)return t.series;throw new Error(`AG Charts - unsupported series type '${t.series.type}', error bars supported series types: ${AgErrorBarSupportedSeriesTypes.join(", ")}`)}var ErrorBars=class Ot extends module_support_exports.BaseModuleInstance{constructor(e){super(),this.properties=new ErrorBarProperties;const i=toErrorBoundCartesianSeries(e),{annotationGroup:s,annotationSelections:n}=i;this.cartesianSeries=i,this.groupNode=new ErrorBarGroup({name:`${s.id}-errorBars`}),s.appendChild(this.groupNode),this.selection=module_support_exports.Selection.select(this.groupNode,()=>this.errorBarFactory()),n.add(this.selection),i.addEventListener("seriesVisibilityChange",o=>this.onToggleSeriesItem(o)),this.destroyFns.push(i.addListener("data-processed",o=>this.onDataProcessed(o)),i.addListener("data-update",o=>this.onDataUpdate(o)),e.highlightManager.addListener("highlight-change",o=>this.onHighlightChange(o)),()=>s.removeChild(this.groupNode),()=>n.delete(this.selection))}hasErrorBars(){const{xLowerKey:e,xUpperKey:i,yLowerKey:s,yUpperKey:n}=this.properties;return isDefined(e)&&isDefined(i)||isDefined(s)&&isDefined(n)}isStacked(){const e=this.cartesianSeries.seriesGrouping?.stackCount;return e==null?!1:e>0}getUnstackPropertyDefinition(e){const i=[],{xLowerKey:s,xUpperKey:n,yLowerKey:o,yUpperKey:a,xErrorsID:r,yErrorsID:l}=this.getMaybeFlippedKeys(),{xScaleType:c,yScaleType:h}=e;return o!=null&&a!=null&&i.push(valueProperty3(o,h,{id:`${l}-lower`}),valueProperty3(a,h,{id:`${l}-upper`})),s!=null&&n!=null&&i.push(valueProperty3(s,c,{id:`${r}-lower`}),valueProperty3(n,c,{id:`${r}-upper`})),i}getStackPropertyDefinition(e){const i=[],{cartesianSeries:s}=this,{xLowerKey:n,xUpperKey:o,yLowerKey:a,yUpperKey:r,xErrorsID:l,yErrorsID:c}=this.getMaybeFlippedKeys(),{xScaleType:h,yScaleType:d}=e,u=s.seriesGrouping?.groupIndex??s.id,p={invalidValue:null,missingValue:0,separateNegative:!0,...s.visible?{}:{forceValue:0}},g=(m,y,x,b)=>groupAccumulativeValueProperty2(m,"normal","current",{id:`${y}-${x}`,groupId:`errorGroup-${u}-${x}`,...p},b),f=(m,y,x,b)=>{i.push(...g(m,x,"lower",b),...g(y,x,"upper",b))};return a!=null&&r!=null&&f(a,r,c,d),n!=null&&o!=null&&f(n,o,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:s,xErrorsID:n,yLowerKey:o,yUpperKey:a,yErrorsID:r}=this.getMaybeFlippedKeys();if(e===ChartAxisDirection13.X?isDefined(i)&&isDefined(s):isDefined(o)&&isDefined(a)){const{dataModel:c,processedData:h,cartesianSeries:d}=this;if(c!=null&&h!=null){const u={x:n,y:r}[e],p=c.getDomain(d,`${u}-lower`,"value",h),g=c.getDomain(d,`${u}-upper`,"value",h),f=[Math.min(...p,...g),Math.max(...p,...g)];return fixNumericExtent2(f)}}return[]}onDataUpdate(e){this.dataModel=e.dataModel,this.processedData=e.processedData,isDefined(e.dataModel)&&isDefined(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[ChartAxisDirection13.X]?.scale,s=this.cartesianSeries.axes[ChartAxisDirection13.Y]?.scale;if(!(!i||!s||!e))for(let n=0;n<e.length;n++){const{midPoint:o,xLower:a,xUpper:r,yLower:l,yUpper:c}=this.getDatum(e,n);if(o!=null){let h,d;isDefined(a)&&isDefined(r)&&(h={lowerPoint:{x:this.convert(i,a),y:o.y},upperPoint:{x:this.convert(i,r),y:o.y}}),isDefined(l)&&isDefined(c)&&(d={lowerPoint:{x:o.x,y:this.convert(s,l)},upperPoint:{x:o.x,y:this.convert(s,c)}}),e[n].xBar=h,e[n].yBar=d}}}getMaybeFlippedKeys(){let{xLowerKey:e,xUpperKey:i,yLowerKey:s,yUpperKey:n}=this.properties,[o,a]=["xValue-errors","yValue-errors"];return this.cartesianSeries.shouldFlipXY()&&([e,s]=[s,e],[i,n]=[n,i],[o,a]=[a,o]),{xLowerKey:e,xUpperKey:i,xErrorsID:o,yLowerKey:s,yUpperKey:n,yErrorsID:a}}static getDatumKey(e,i,s){if(i==null)return;const n=e.datum[i];if(n!=null){if(typeof n!="number"){logger_exports.warnOnce(`Found [${i}] error value of type ${typeof n}. Expected number type`);return}return n+s}}getDatum(e,i){const{xLowerKey:s,xUpperKey:n,yLowerKey:o,yUpperKey:a}=this.getMaybeFlippedKeys(),r=e[i],l=r.cumulativeValue==null||!this.isStacked()?0:r.cumulativeValue-r.yValue,[c,h]=this.cartesianSeries.shouldFlipXY()?[l,0]:[0,l];return{midPoint:r.midPoint,xLower:Ot.getDatumKey(r,s,c),xUpper:Ot.getDatumKey(r,n,c),yLower:Ot.getDatumKey(r,o,h),yUpper:Ot.getDatumKey(r,a,h)}}convert(e,i){const s=(e.bandwidth??0)/2;return e.convert(i)+s}update(){const e=this.getNodeData();e!=null&&(this.selection.update(e),this.selection.each((i,s,n)=>this.updateNode(i,s,n)))}updateNode(e,i,s){e.datum=i,e.update(this.getDefaultStyle(),this.properties,this.cartesianSeries,!1),e.updateBBoxes()}pickNodeExact(e){const{x:i,y:s}=e,n=this.groupNode.pickNode(i,s);if(n!=null)return{datum:n.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:s,yUpperKey:n,xLowerName:o=e,xUpperName:a=i,yLowerName:r=s,yUpperName:l=n}=this.properties;return{xLowerKey:e,xLowerName:o,xUpperKey:i,xUpperName:a,yLowerKey:s,yLowerName:r,yUpperKey:n,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:mergeDefaults3(this.properties.cap,e)}}getDefaultStyle(){return this.makeStyle(this.getWhiskerProperties())}getHighlightStyle(){return this.makeStyle(this.getWhiskerProperties())}restyleHighlightChange(e,i,s){const n=this.getNodeData();if(n!=null){for(let o=0;o<n.length;o++)if(e===n[o]){this.selection.at(o)?.update(i,this.properties,this.cartesianSeries,s);break}}}onHighlightChange(e){const{previousHighlight:i,currentHighlight:s}=e;s?.series===this.cartesianSeries&&this.restyleHighlightChange(s,this.getHighlightStyle(),!0),i?.series===this.cartesianSeries&&this.restyleHighlightChange(i,this.getDefaultStyle(),!1),this.groupNode.opacity=this.cartesianSeries.getOpacity()}errorBarFactory(){return new ErrorBarNode}getWhiskerProperties(){const{stroke:e,strokeWidth:i,visible:s,strokeOpacity:n,lineDash:o,lineDashOffset:a}=this.properties;return{stroke:e,strokeWidth:i,visible:s,strokeOpacity:n,lineDash:o,lineDashOffset:a}}},ERROR_BARS_THEME={series:{errorBar:{visible:!0,stroke:{$ref:"foregroundColor"},strokeWidth:1,strokeOpacity:1,cap:{length:void 0,lengthRatio:void 0}}}},ErrorBarsModule={type:"series-option",identifier:"error-bars",optionsKey:"errorBar",packageType:"enterprise",chartTypes:["cartesian"],seriesTypes:AgErrorBarSupportedSeriesTypes,moduleFactory:t=>new ErrorBars(t),themeTemplate:ERROR_BARS_THEME},{ZIndexMap:ZIndexMap6,ActionOnSet:ActionOnSet7,TempValidate:TempValidate42,ProxyPropertyOnWrite:ProxyPropertyOnWrite3,OBJECT:OBJECT19,RATIO:RATIO9,COLOR_STRING:COLOR_STRING7}=module_support_exports,Foreground=class extends module_support_exports.Background{constructor(){super(...arguments),this.image=new Image2,this.fill="transparent",this.fillOpacity=void 0}createNode(){return new module_support_exports.Group({name:"foreground",zIndex:ZIndexMap6.FOREGROUND})}onLayoutComplete(t){super.onLayoutComplete(t);const{width:e,height:i}=t.chart;let s={x:0,y:0,width:e,height:i};this.image&&(s=this.image.performLayout(e,i)),this.text&&this.updateTextNode(s)}onImageLoad(){this.ctx.updateService.update(module_support_exports.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(),s=10;e.x=t.x+t.width/2-i.width/2,e.y=t.y+t.height+s}};__decorateClass([TempValidate42(OBJECT19,{optional:!0}),ActionOnSet7({newValue(t){this.node.appendChild(t.node),t.onLoad=()=>this.onImageLoad()},oldValue(t){this.node.removeChild(t.node),t.onLoad=void 0}})],Foreground.prototype,"image",2),__decorateClass([TempValidate42(COLOR_STRING7,{optional:!0}),ProxyPropertyOnWrite3("rectNode","fill")],Foreground.prototype,"fill",2),__decorateClass([TempValidate42(RATIO9,{optional:!0}),ProxyPropertyOnWrite3("rectNode","fillOpacity")],Foreground.prototype,"fillOpacity",2);var ForegroundModule={type:"root",optionsKey:"foreground",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new Foreground(t)},{TranslatableGroup:TranslatableGroup3,ScenePathChangeDetection:ScenePathChangeDetection2}=module_support_exports,MiniChartGroup=class extends TranslatableGroup3{constructor(){super(...arguments),this.inset=0,this.cornerRadius=0}applyClip(t,e){const{cornerRadius:i,inset:s}=this,{x:n,y:o,width:a,height:r}=e;t.beginPath(),t.roundRect(n+s,o+s,a-2*s,r-2*s,i),t.clip()}};__decorateClass([ScenePathChangeDetection2()],MiniChartGroup.prototype,"inset",2),__decorateClass([ScenePathChangeDetection2()],MiniChartGroup.prototype,"cornerRadius",2);var{TempValidate:TempValidate43,BOOLEAN:BOOLEAN19,POSITIVE_NUMBER:POSITIVE_NUMBER10,ZIndexMap:ZIndexMap7,ActionOnSet:ActionOnSet8,CategoryAxis:CategoryAxis2,TextUtils:TextUtils3,Padding:Padding2,Group:Group7,BBox:BBox7,ProxyProperty:ProxyProperty3}=module_support_exports,MiniChartPadding=class{constructor(){this.top=0,this.bottom=0}};__decorateClass([TempValidate43(POSITIVE_NUMBER10)],MiniChartPadding.prototype,"top",2),__decorateClass([TempValidate43(POSITIVE_NUMBER10)],MiniChartPadding.prototype,"bottom",2);var MiniChart=class extends module_support_exports.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!1,this.padding=new MiniChartPadding,this.root=new Group7({name:"root"}),this.seriesRoot=this.root.appendChild(new MiniChartGroup({name:"Series-root",zIndex:ZIndexMap7.SERIES_LAYER,renderToOffscreenCanvas:!0})),this.axisGridGroup=this.root.appendChild(new Group7({name:"Axes-Grids",zIndex:ZIndexMap7.AXIS_GRID})),this.axisGroup=this.root.appendChild(new Group7({name:"Axes-Grids",zIndex:ZIndexMap7.AXIS_GRID})),this.axisLabelGroup=this.root.appendChild(new Group7({name:"Axes-Labels",zIndex:ZIndexMap7.SERIES_LABEL})),this.axisCrosslineRangeGroup=this.root.appendChild(new Group7({name:"Axes-Crosslines-Range",zIndex:ZIndexMap7.SERIES_CROSSLINE_RANGE})),this.axisCrosslineLineGroup=this.root.appendChild(new Group7({name:"Axes-Crosslines-Line",zIndex:ZIndexMap7.SERIES_CROSSLINE_LINE})),this.axisCrosslineLabelGroup=this.root.appendChild(new Group7({name:"Axes-Crosslines-Label",zIndex:ZIndexMap7.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(s=>!t.includes(s))??[];this.destroySeries(i);for(const s of t){if(e?.includes(s))continue;s.attachSeries(this.seriesRoot,this.seriesRoot,void 0);const n=this;s.chart={get mode(){return"standalone"},get isMiniChart(){return!0},get seriesRect(){return n.seriesRect}},s.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 s=t[i];if(!s){logger_exports.warnOnce(`no available axis for direction [${i}]; check series and axes configuration.`);return}const n=e.getKeys(i),o=this.findMatchingAxis(s,n);if(!o){logger_exports.warnOnce(`no matching axis for direction [${i}] and keys [${n}]; check series and axes configuration.`);return}e.axes[i]=o})})}findMatchingAxis(t,e){for(const i of t){if(!i.keys.length)return i;if(e){for(const s of e)if(i.keys.includes(s))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 Padding2;return this.enabled&&this.axes.forEach(({position:e,thickness:i,line:s,label:n})=>{if(e==null)return;let o;i?o=i:o=(s.enabled?s.width:0)+(n.enabled?TextUtils3.getLineHeight(n.fontSize??0)+n.spacing:0),t[e]=Math.ceil(o)}),t}async layout(t,e){const{padding:i}=this,s=this.seriesRect!=null,n=new BBox7(0,0,t,e-(i.top+i.bottom));this.seriesRect=n,this.seriesRoot.translationY=i.top,this.seriesRoot.setClipRectCanvasSpace(new BBox7(0,-i.top,t,e)),this.axes.forEach(o=>{const{position:a="left"}=o;switch(a){case"top":case"bottom":o.range=[0,n.width],o.gridLength=n.height;break;case"right":case"left":{const r=o instanceof CategoryAxis2;o.range=r?[0,n.height]:[n.height,0],o.gridLength=n.width;break}}o.gridPadding=0,o.translation.x=0,o.translation.y=0,a==="right"?o.translation.x=t:a==="bottom"&&(o.translation.y=e),s||o.resetAnimation("initial"),o.calculateLayout(),o.update()}),await Promise.all(this.series.map(o=>o.update({seriesRect:n})))}};__decorateClass([TempValidate43(BOOLEAN19)],MiniChart.prototype,"enabled",2),__decorateClass([ProxyProperty3(["seriesRoot","inset"])],MiniChart.prototype,"inset",2),__decorateClass([ProxyProperty3(["seriesRoot","cornerRadius"])],MiniChart.prototype,"cornerRadius",2),__decorateClass([ActionOnSet8({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 s of e)t.includes(s)||(s.detachAxis(i),s.destroy());for(const s of t)e?.includes(s)||s.attachAxis(i)}})],MiniChart.prototype,"axes",2),__decorateClass([ActionOnSet8({changeValue(t,e){this.onSeriesChange(t,e)}})],MiniChart.prototype,"series",2);var{SliderWidget:SliderWidget2}=module_support_exports,NavigatorDOMProxy=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,s]of["min","pan","max"].entries()){const n=this.sliders[i];n.step=SliderWidget2.STEP_HUNDRETH,n.keyboardStep=SliderWidget2.STEP_ONE,n.orientation="horizontal",n.setPreventsDefault(!1),n.addListener("drag-start",o=>this.onDragStart(i,o,s)),n.addListener("drag-move",o=>this.onDrag(n,o,s)),n.addListener("drag-end",()=>this.updateSliderRatios()),n.addListener("contextmenu",o=>this.onContextMenu(n,o))}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(){let{_min:t,_max:e}=this;t=Math.round(t*100)/100,e=Math.round(e*100)/100;const 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 s=this.sliders[t],n=this.toolbar.cssLeft(),o=s.cssLeft();this.dragStartX=n+o+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:s}){const{x:n,y:o}=this.toolbar.getBounds(),{x:a,y:r}=t.getBounds(),l=i+n+a,c=s+o+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=clamp(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()}},{TempValidate:TempValidate44,ScenePathChangeDetection:ScenePathChangeDetection3,POSITIVE_NUMBER:POSITIVE_NUMBER11,BOOLEAN:BOOLEAN20,BBox:BBox8,ExtendedPath2D:ExtendedPath2D2}=module_support_exports,RangeHandle=class extends module_support_exports.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 ExtendedPath2D2}setCenter(t,e){this.dirtyPath=!0,(this.centerX!==t||this.centerY!==e)&&(this.centerX=t,this.centerY=e,this.markDirty("center"))}static align(t,e,i,s,n,o,a,r,l){const c=t.align(i+n*a)+l,h=c+t.align(i+n*a,n*(r-a))-2*l,d=t.align(s+o/2);t.setCenter(c,d),e.setCenter(h,d)}computeBBox(){const{centerX:t,centerY:e,width:i,height:s}=this,n=t-i/2,o=e-s/2;return new BBox8(n,o,i,s)}isPointInPath(t,e){return this.getBBox().containsPoint(t,e)}updatePath(){const{centerX:t,centerY:e,path:i,gripPath:s,strokeWidth:n,cornerRadius:o,grip:a}=this,r=n/2,l=this.layerManager?.canvas?.pixelRatio??1;i.clear(),s.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),o);const d=3;if(a)for(let u=-.5;u<=.5;u+=1)for(let p=-1;p<=1;p+=1)s.arc(t+u*d,e+p*d,1,0,2*Math.PI),s.closePath()}renderFill(t,e){const{stroke:i}=this;super.renderFill(t,e),t.fillStyle=typeof i=="string"?i:"black",t.fill(this.gripPath.getPath2D())}};RangeHandle.className="RangeHandle",__decorateClass([TempValidate44(POSITIVE_NUMBER11),ScenePathChangeDetection3()],RangeHandle.prototype,"width",2),__decorateClass([TempValidate44(POSITIVE_NUMBER11),ScenePathChangeDetection3()],RangeHandle.prototype,"height",2),__decorateClass([TempValidate44(POSITIVE_NUMBER11),ScenePathChangeDetection3()],RangeHandle.prototype,"cornerRadius",2),__decorateClass([TempValidate44(BOOLEAN20),ScenePathChangeDetection3()],RangeHandle.prototype,"grip",2);var{Path:Path7,BBox:BBox9,ExtendedPath2D:ExtendedPath2D3,clippedRoundRect:clippedRoundRect2,POSITIVE_NUMBER:POSITIVE_NUMBER12,TempValidate:TempValidate45,ScenePathChangeDetection:ScenePathChangeDetection4}=module_support_exports,RangeMask=class extends Path7{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 ExtendedPath2D3}layout(t,e,i,s,n,o){n=isNaN(n)?this.min:n,o=isNaN(o)?this.max:o,(t!==this.x||e!==this.y||i!==this.width||this.height!==s||n!==this.min||o!==this.max)&&(this.x=t,this.y=e,this.width=i,this.height=s,this.min=n,this.max=o,this.dirtyPath=!0,this.markDirty("RangeMask.layout"))}computeBBox(){const{x:t,y:e,width:i,height:s}=this;return new BBox9(t,e,i,s)}computeVisibleRangeBBox(){const{x:t,y:e,width:i,height:s,min:n,max:o}=this,a=t+i*n,r=t+i*o;return new BBox9(a,e,r-a,s)}updatePath(){const{path:t,visiblePath:e,x:i,y:s,width:n,height:o,min:a,max:r,strokeWidth:l,cornerRadius:c}=this,h=l/2;t.clear(),e.clear();const d=this.align(i)+h,u=this.align(s)+h,p=this.align(i,n)-2*h,g=this.align(s,o)-2*h,f=this.align(i+n*a)+h,m=f+this.align(i+n*a,n*(r-a))-2*h,y={topLeft:c,topRight:c,bottomRight:c,bottomLeft:c};clippedRoundRect2(t,d,u,p,g,y,new BBox9(d,u,f-d,g)),clippedRoundRect2(t,d,u,p,g,y,new BBox9(m,u,p+d-m,g)),m-f>1&&clippedRoundRect2(e,d,u,p,g,y,new BBox9(f,u,m-f,g))}renderStroke(t,e){super.renderStroke(t,e),super.renderStroke(t,this.visiblePath.getPath2D())}};RangeMask.className="RangeMask",__decorateClass([TempValidate45(POSITIVE_NUMBER12),ScenePathChangeDetection4()],RangeMask.prototype,"cornerRadius",2);var RangeSelector=class extends module_support_exports.Group{constructor(t){super({name:"rangeSelectorGroup",zIndex:module_support_exports.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 module_support_exports.TranslatableGroup({name:"navigator-background",zIndex:1})),this.append(t)}layout(t,e,i,s,n,o){this.x=t,this.y=e,this.width=i,this.height=s,this.lOffset=n,this.rOffset=o,this.background.translationX=t,this.background.translationY=e,this.markDirty("RangeSelector")}updateBackground(t,e){t!=null&&this.background.removeChild(t),e!=null&&this.background.appendChild(e),this.markDirty("RangeSelector")}computeBBox(){const{x:t,y:e,width:i,height:s,lOffset:n,rOffset:o}=this;return new module_support_exports.BBox(t-n,e,i+(n+o),s)}},{BaseModuleInstance:BaseModuleInstance3,ObserveChanges:ObserveChanges5,TempValidate:TempValidate46,BOOLEAN:BOOLEAN21,POSITIVE_NUMBER:POSITIVE_NUMBER13}=module_support_exports,Navigator=class extends BaseModuleInstance3{constructor(t){super(),this.ctx=t,this.enabled=!1,this.mask=new RangeMask,this.minHandle=new RangeHandle,this.maxHandle=new RangeHandle,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 RangeSelector([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(module_support_exports.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 NavigatorDOMProxy(t,this),this.updateGroupVisibility(),this.miniChart=new MiniChart(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:s,height:n}=this;if(this.domProxy.updateVisibility(this.enabled),this.enabled){const{_min:o,_max:a}=this.domProxy;this.layoutNodes(e,s,i,n,o,a),this.domProxy.updateBounds({x:e,y:s,width:i,height:n})}this.x=e,this.width=i,this.miniChart?.layout(i,n).catch(o=>logger_exports.error(o))}canDrag(){return this.enabled&&this.ctx.interactionManager.isState(module_support_exports.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:s,width:n}=this,{minRange:o}=this.domProxy;let{_min:a,_max:r}=this.domProxy;const l=(e-s)/n;if(t==="min")a=clamp(0,l,r-o);else if(t==="max")r=clamp(a+o,l,1);else if(t==="pan"&&i!=null){const c=r-a;a=clamp(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:s,width:n,height:o}=this,{min:a,max:r}=e;this.domProxy.updateMinMax(a,r),this.layoutNodes(i,s,n,o,a,r)}layoutNodes(t,e,i,s,n,o){const{rangeSelector:a,mask:r,minHandle:l,maxHandle:c}=this;r.layout(t,e,i,s,n,o),a.layout(t,e,i,s,l.width/2,c.width/2),RangeHandle.align(l,c,t,e,i,s,n,o,r.strokeWidth/2),n+(o-n)/2<.5?(l.zIndex=3,c.zIndex=4):(l.zIndex=4,c.zIndex=3),[l,this.maskVisibleRange,c].forEach((h,d)=>{const u=h.getBBox(),p={x:u.x-t,y:u.y-e,height:u.height,width:u.width};this.domProxy.updateSliderBounds(d,p)})}updateZoom(){this.enabled&&this.domProxy.updateZoom()}updateData(t){return this.miniChart?.updateData(t)}async processData(t){if(this.miniChart)return this.miniChart?.processData(t)}};__decorateClass([ObserveChanges5((t,e,i)=>{t.updateBackground(i?.root,e?.root)})],Navigator.prototype,"miniChart",2),__decorateClass([TempValidate46(BOOLEAN21),ObserveChanges5((t,e)=>{t.ctx.zoomManager.setNavigatorEnabled(!!e),t.updateGroupVisibility()})],Navigator.prototype,"enabled",2),__decorateClass([TempValidate46(POSITIVE_NUMBER13)],Navigator.prototype,"height",2),__decorateClass([TempValidate46(POSITIVE_NUMBER13),ObserveChanges5((t,e)=>{t.mask.cornerRadius=e})],Navigator.prototype,"cornerRadius",2),__decorateClass([TempValidate46(POSITIVE_NUMBER13)],Navigator.prototype,"spacing",2);var NAVIGATOR_THEME={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:[module_support_exports.FONT_SIZE_RATIO.SMALLER]},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:5},padding:{top:0,bottom:0}}},NavigatorModule={type:"root",optionsKey:"navigator",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new Navigator(t),removable:!1,themeTemplate:{navigator:NAVIGATOR_THEME}},{AND:AND5,ARRAY:ARRAY5,FUNCTION:FUNCTION6,NUMBER:NUMBER13,OR:OR4,ToolbarButtonProperties:ToolbarButtonProperties4,TempValidate:TempValidate47}=module_support_exports,RangesButtonProperties=class extends ToolbarButtonProperties4{};__decorateClass([TempValidate47(OR4(NUMBER13,AND5(ARRAY5,ARRAY5.restrict({length:2})),FUNCTION6))],RangesButtonProperties.prototype,"value",2);var{BOOLEAN:BOOLEAN22,OBJECT:OBJECT20,ChartAxisDirection:ChartAxisDirection14,LayoutElement:LayoutElement4,PropertiesArray:PropertiesArray5,Toolbar:Toolbar2,TempValidate:TempValidate48}=module_support_exports,Ranges=class extends module_support_exports.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!1,this.buttons=new PropertiesArray5(RangesButtonProperties),this.verticalSpacing=10,this.container=t.domManager.addChild("canvas-overlay","range-buttons"),this.container.role="presentation",this.toolbar=new Toolbar2(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(LayoutElement4.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:s,toolbar:n,verticalSpacing:o}=this,{layoutBox:a}=t;if(!s||!i.zoomManager.isZoomEnabled()){n.setHidden(!0);return}n.setHidden(!1),n.updateButtons(e);const r=n.getBounds().height;n.setBounds({x:a.x,y:a.y+a.height-r,width:a.width,height:r}),a.shrink({bottom:r+o})}onZoomChanged(){this.toolbar.clearActiveButton()}onButtonPress({button:{index:t}}){const{zoomManager:e}=this.ctx,i=this.buttons.at(t);if(!i)return;const{value:s}=i;typeof s=="number"?e.extendToEnd("zoom-buttons",ChartAxisDirection14.X,s):Array.isArray(s)?e.updateWith("zoom-buttons",ChartAxisDirection14.X,()=>s):typeof s=="function"&&e.updateWith("zoom-buttons",ChartAxisDirection14.X,s),this.toolbar.toggleActiveButtonByIndex(t)}};__decorateClass([TempValidate48(BOOLEAN22)],Ranges.prototype,"enabled",2),__decorateClass([TempValidate48(OBJECT20)],Ranges.prototype,"buttons",2);var DAY=1e3*60*60*24,MONTH=DAY*30,YEAR=DAY*365,RangesModule={type:"root",optionsKey:"ranges",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new Ranges(t),themeTemplate:{ranges:{enabled:!1,buttons:[{label:"toolbarRange1Month",ariaLabel:"toolbarRange1MonthAria",value:MONTH},{label:"toolbarRange3Months",ariaLabel:"toolbarRange3MonthsAria",value:3*MONTH},{label:"toolbarRange6Months",ariaLabel:"toolbarRange6MonthsAria",value:6*MONTH},{label:"toolbarRangeYearToDate",ariaLabel:"toolbarRangeYearToDateAria",value:(t,e)=>[new Date(`${new Date(e).getFullYear()}-01-01`).getTime(),e]},{label:"toolbarRange1Year",ariaLabel:"toolbarRange1YearAria",value:YEAR},{label:"toolbarRangeAll",ariaLabel:"toolbarRangeAllAria",value:(t,e)=>[t,e]}]}}},_SharedToolbar=class Et extends module_support_exports.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 module_support_exports.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,s={layout:(n,o)=>{if(this.firstLayoutSection!=null&&this.firstLayoutSection!==e&&this.activeSections.has(this.firstLayoutSection))return;this.firstLayoutSection=e;const a=i.getBounds().width;i.setBounds({x:n.x,y:n.y,width:a}),n.shrink({left:a+i.horizontalSpacing+(o??0)})},addToolbarListener:(n,o)=>i.addToolbarListener(n,a=>{const r=this.getSectionIndex(e,a.button.index);if(r<0)return;const l={...a,button:this.sectionButtons[e][r]};o(l)}),updateButtons:n=>{this.sectionButtons[e]=n;const o=Et.SECTION_ORDER.flatMap(a=>this.sectionButtons[a]);i.updateButtons(o)},updateButtonByIndex:(n,o)=>{i.updateButtonByIndex(this.getIndex(e,n),o)},toggleActiveButtonByIndex:n=>{i.toggleActiveButtonByIndex(this.getIndex(e,n))},toggleButtonEnabledByIndex:(n,o)=>{i.toggleButtonEnabledByIndex(this.getIndex(e,n),o)},setHidden:n=>{n?this.activeSections.delete(e):this.activeSections.add(e);let o=0;for(const a of Et.SECTION_ORDER){if(a!==e){o+=this.sectionButtons[a].length;continue}for(const r of this.sectionButtons[e].keys())i.setButtonHiddenByIndex(o+r,n)}},destroy:()=>{s.setHidden(!0),this.activeSections.size===0&&this.destroy()},clearActiveButton:i.clearActiveButton.bind(i),addListener:i.addListener.bind(i),removeListener:i.removeListener.bind(i)};return s.setHidden(!1),s}getIndex(e,i){let s=0;for(const n of Et.SECTION_ORDER){if(n===e)return s+i;s+=this.sectionButtons[n].length}return-1}getSectionIndex(e,i){let s=0;for(const n of Et.SECTION_ORDER){if(n===e)return i>=s+this.sectionButtons[e].length?-1:i-s;s+=this.sectionButtons[n].length}return-1}};_SharedToolbar.SECTION_ORDER=["chartToolbar","annotations"];var SharedToolbar=_SharedToolbar,SharedToolbarModule={type:"context",contextKey:"sharedToolbar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new SharedToolbar(t)},{CachedTextMeasurerPool:CachedTextMeasurerPool3,ZIndexMap:ZIndexMap8,LayoutElement:LayoutElement5,TempValidate:TempValidate49,BaseProperties:BaseProperties16,OBJECT:OBJECT21,BOOLEAN:BOOLEAN23,STRING:STRING22,COLOR_STRING:COLOR_STRING8,RATIO:RATIO10,valueProperty:valueProperty4,TextUtils:TextUtils4,Group:Group8,Label:Label3,Rect:Rect2,Text:Text2}=module_support_exports,chartConfigurations={ohlc:62,candlestick:62,"hollow-candlestick":62,line:96,"step-line":96,hlc:184,"high-low":800},itemIdMap={up:"positive",down:"negative"},neutralColorMap={hlc:"altNeutral"},StatusBarBackground=class extends BaseProperties16{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1}};__decorateClass([TempValidate49(COLOR_STRING8)],StatusBarBackground.prototype,"fill",2),__decorateClass([TempValidate49(RATIO10)],StatusBarBackground.prototype,"fillOpacity",2);var StatusBar=class extends module_support_exports.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 Label3,this.positive=new Label3,this.negative=new Label3,this.neutral=new Label3,this.altNeutral=new Label3,this.background=new StatusBarBackground,this.layoutStyle="block",this.id="status-bar",this.data=void 0,this.layer=new Group8({name:"StatusBar",zIndex:ZIndexMap8.STATUS_BAR}),this.labelGroup=this.layer.appendChild(new module_support_exports.TranslatableGroup),this.backgroundNode=this.labelGroup.appendChild(new Rect2),this.labels=[{label:"O",configuration:2,title:this.labelGroup.appendChild(new Text2),value:this.labelGroup.appendChild(new Text2),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 Text2),value:this.labelGroup.appendChild(new Text2),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 Text2),value:this.labelGroup.appendChild(new Text2),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 Text2),value:this.labelGroup.appendChild(new Text2),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 Text2),value:this.labelGroup.appendChild(new Text2),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 Text2),value:this.labelGroup.appendChild(new Text2),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 Text2),value:this.labelGroup.appendChild(new Text2),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 Text2),value:this.labelGroup.appendChild(new Text2),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 Text2),value:this.labelGroup.appendChild(new Text2),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(LayoutElement5.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 n of this.labels){const{id:o,key:a}=n,r=this[a];r==null?n.domain=void 0:e.push(valueProperty4(r,"number",{id:o}))}if(e.length===0)return;const{processedData:i,dataModel:s}=await t.request(this.id,this.data,{props:e});for(const n of this.labels){const{id:o,key:a}=n;this[a]!=null&&(n.domain=s.getDomain(this,o,"value",i))}}startPerformLayout(t){if(this.labelGroup.translationX=0,this.labelGroup.translationY=0,!this.enabled)return;const{layoutBox:e}=t,i=4,s=12,n=0,o=8;this.labelGroup.translationY=e.y+n;const a=Math.max(this.title.fontSize,this.positive.fontSize,this.negative.fontSize),r=TextUtils4.getLineHeight(a),l=chartConfigurations[this.getChartType()]??0;let c=0,h,d="alphabetic";if(this.layoutStyle==="block")e.shrink(n+r+o,"top"),h=a+(r-a)/2;else{const{title:u}=this.ctx.chartService;if(d="top",h=n+u.padding,u.enabled){const p=u.node.getBBox();c=p.x+p.width+s}else c=u.padding}for(const{label:u,configuration:p,title:g,value:f,domain:m,formatter:y}of this.labels){if(m==null||!(l&p)){g.visible=!1,f.visible=!1;continue}const x=Math.max(CachedTextMeasurerPool3.measureText(y.format(m[0]),{font:this.positive.getFont(),textBaseline:d,textAlign:"left"}).width,CachedTextMeasurerPool3.measureText(y.format(m[1]),{font:this.positive.getFont(),textBaseline:d,textAlign:"left"}).width,CachedTextMeasurerPool3.measureText(y.format(m[0]),{font:this.negative.getFont(),textBaseline:d,textAlign:"left"}).width,CachedTextMeasurerPool3.measureText(y.format(m[1]),{font:this.negative.getFont(),textBaseline:d,textAlign:"left"}).width);g.visible=!0,f.visible=!0;const b=CachedTextMeasurerPool3.measureText(u,{font:this.title.getFont(),textBaseline:d,textAlign:"left"});g.setFont(this.title),g.fill=this.title.color,g.text=u,g.textBaseline=d,g.y=h,g.x=c,c+=b.width+i,f.textBaseline=d,f.y=h,f.x=c,c+=x+s}this.backgroundNode.x=0,this.backgroundNode.y=0,this.backgroundNode.width=c-s,this.backgroundNode.height=r+n+o,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 s=i!=null?itemIdMap[i]:void 0;s==null&&this.openKey!=null&&this.closeKey!=null&&(e[this.openKey]<e[this.closeKey]?s="positive":s="negative");for(const{domain:n,value:o,key:a,formatter:r,style:l}of this.labels){if(n==null)continue;let c=l??s??"neutral";c==="neutral"&&(c=neutralColorMap[this.getChartType()]??c);const h=this[a],d=h!=null?e?.[h]:void 0;o.setFont(this[c]),o.fill=this[c].color,o.text=typeof d=="number"?r.format(d):""}}getChartType(){let t=this.ctx.chartService.publicApi?.getOptions()?.chartType;return(t==null||chartConfigurations[t]==null)&&(t="candlestick"),t}};__decorateClass([TempValidate49(BOOLEAN23)],StatusBar.prototype,"enabled",2),__decorateClass([TempValidate49(STRING22,{optional:!0})],StatusBar.prototype,"openKey",2),__decorateClass([TempValidate49(STRING22,{optional:!0})],StatusBar.prototype,"highKey",2),__decorateClass([TempValidate49(STRING22,{optional:!0})],StatusBar.prototype,"lowKey",2),__decorateClass([TempValidate49(STRING22,{optional:!0})],StatusBar.prototype,"closeKey",2),__decorateClass([TempValidate49(STRING22,{optional:!0})],StatusBar.prototype,"volumeKey",2),__decorateClass([TempValidate49(OBJECT21)],StatusBar.prototype,"title",2),__decorateClass([TempValidate49(OBJECT21)],StatusBar.prototype,"positive",2),__decorateClass([TempValidate49(OBJECT21)],StatusBar.prototype,"negative",2),__decorateClass([TempValidate49(OBJECT21)],StatusBar.prototype,"neutral",2),__decorateClass([TempValidate49(OBJECT21)],StatusBar.prototype,"altNeutral",2),__decorateClass([TempValidate49(OBJECT21)],StatusBar.prototype,"background",2),__decorateClass([TempValidate49(STRING22)],StatusBar.prototype,"layoutStyle",2);var StatusBarModule={type:"root",identifier:"status-bar",optionsKey:"statusBar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new StatusBar(t),themeTemplate:{statusBar:{enabled:!1,layoutStyle:module_support_exports.ThemeSymbols.DEFAULT_CAPTION_LAYOUT_STYLE,title:{color:{$ref:"textColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},positive:{color:module_support_exports.ThemeSymbols.PALETTE_UP_STROKE,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},negative:{color:module_support_exports.ThemeSymbols.PALETTE_DOWN_STROKE,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},neutral:{color:module_support_exports.ThemeSymbols.PALETTE_NEUTRAL_STROKE,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},background:{fill:{$ref:"backgroundColor"},fillOpacity:.5},altNeutral:{color:"gray",fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}}}}},{BOOLEAN:BOOLEAN24,STRING:STRING23,UNION:UNION8,BaseProperties:BaseProperties17,CartesianAxis:CartesianAxis2,ChartUpdateType:ChartUpdateType3,ObserveChanges:ObserveChanges6,TooltipManager:TooltipManager2,TempValidate:TempValidate50}=module_support_exports,ChartSync=class extends BaseProperties17{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=ChartUpdateType3.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 s of e.getGroupSiblings(this.groupId))if(s.modulesManager.getModule("sync")?.nodeInteraction){if(!i.currentHighlight?.datum){s.ctx.highlightManager.updateHighlight(s.id),s.ctx.tooltipManager.removeTooltip(s.id);continue}for(const n of s.axes){const o=this.axes==="xy"?"x":this.axes;if(!CartesianAxis2.is(n)||n.direction!==o)continue;const a=s.series.map(r=>{const l=r.getKeys(n.direction);if(n.keys.length&&!n.keys.some(g=>l.includes(g)))return;const{nodeData:c}=r.contextNodeData;if(!c?.length)return;const h=c[0][`${n.direction}Key`];let d=i.currentHighlight.datum[h];const u=isDate(d);u&&(d=d.getTime());const p=c.find(g=>{const f=g.datum[h];return u?f.getTime()===d:f===d});return p?{series:r,nodeDatum:p}:null}).filter(isDefined);if(a.length<2&&a[0]?.nodeDatum!==s.ctx.highlightManager.getActiveHighlight()){const{series:r,nodeDatum:l}=a[0]??{};if(s.ctx.highlightManager.updateHighlight(s.id,l),l){const c=l.midPoint?.x??l.point?.x??0,h=l.midPoint?.y??l.point?.y??0,d=TooltipManager2.makeTooltipMeta({type:"pointermove",canvasX:c,canvasY:h},r,l,void 0);s.ctx.tooltipManager.updateTooltip(s.id,d,s.getTooltipContent(r,l.datumIndex,l))}else s.ctx.tooltipManager.removeTooltip(s.id);this.updateChart(s,ChartUpdateType3.SERIES_UPDATE)}}}})}getSyncedDomain(t){if(!CartesianAxis2.is(t)||this.axes!=="xy"&&this.axes!==t.direction)return;const{syncManager:e}=this.moduleContext,i=e.getGroup(this.groupId),[{axes:s}]=i,{direction:n,min:o,max:a,nice:r,reverse:l}=t;for(const c of s)if(n===c.direction&&(r!==c.nice||l!==c.reverse||o!==c.min&&(isFiniteNumber(o)||isFiniteNumber(c.min))||a!==c.max&&(isFiniteNumber(a)||isFiniteNumber(c.max)))){logger_exports.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 unique(i.flatMap(c=>c.series).filter(c=>{if(c.visible){const h=c.getKeys(t.direction);return t.keys.length?t.keys.some(d=>h.includes(d)):!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?.()}};ChartSync.className="Sync",__decorateClass([TempValidate50(BOOLEAN24),ObserveChanges6(t=>t.onEnabledChange())],ChartSync.prototype,"enabled",2),__decorateClass([TempValidate50(STRING23,{optional:!0}),ObserveChanges6((t,e,i)=>t.onGroupIdChange(e,i))],ChartSync.prototype,"groupId",2),__decorateClass([TempValidate50(UNION8(["x","y","xy"],"an axis")),ObserveChanges6(t=>t.onAxesChange())],ChartSync.prototype,"axes",2),__decorateClass([TempValidate50(BOOLEAN24),ObserveChanges6(t=>t.onNodeInteractionChange())],ChartSync.prototype,"nodeInteraction",2),__decorateClass([TempValidate50(BOOLEAN24),ObserveChanges6(t=>t.onZoomChange())],ChartSync.prototype,"zoom",2);var SyncModule={type:"root",optionsKey:"sync",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new ChartSync(t),themeTemplate:{sync:{enabled:!1}}},{COLOR_STRING:COLOR_STRING9,RATIO:RATIO11,TempValidate:TempValidate51}=module_support_exports,VALID_COLOR="#2196f3",INVALID_COLOR="#8a8a8a",ZoomRect=class extends module_support_exports.Rect{constructor(){super(...arguments),this.fill=VALID_COLOR,this.fillOpacity=.2,this.zIndex=module_support_exports.ZIndexMap.ZOOM_SELECTION}updateValid(){this.fill=VALID_COLOR}updateInvalid(){this.fill=INVALID_COLOR}};ZoomRect.className="ZoomRect",__decorateClass([TempValidate51(COLOR_STRING9)],ZoomRect.prototype,"fill",2),__decorateClass([TempValidate51(RATIO11)],ZoomRect.prototype,"fillOpacity",2);var{UNION:UNION9}=module_support_exports,UNIT={min:0,max:1},UNIT_SIZE=UNIT.max-UNIT.min,DEFAULT_ANCHOR_POINT_X="end",DEFAULT_ANCHOR_POINT_Y="middle",ANCHOR_POINT=UNION9(["pointer","start","middle","end"],"an anchor point"),constrain=(t,e=UNIT.min,i=UNIT.max)=>clamp(e,t,i);function unitZoomState(){return{x:{...UNIT},y:{...UNIT}}}function dx(t){return t.x.max-t.x.min}function dy(t){return t.y.max-t.y.min}function isZoomRangeEqual(t,e,i=1e-10){return isNumberEqual(t.min,e.min,i)&&isNumberEqual(t.max,e.max,i)}function isZoomEqual(t,e,i){return isZoomRangeEqual(t.x,e.x,i)&&isZoomRangeEqual(t.y,e.y,i)}function definedZoomState(t){return{x:{min:t?.x?.min??UNIT.min,max:t?.x?.max??UNIT.max},y:{min:t?.y?.min??UNIT.min,max:t?.y?.max??UNIT.max}}}function pointToRatio(t,e,i){if(!t)return{x:0,y:0};const s=constrain(e-t.x,0,t.x+t.width),n=constrain(i-t.y,0,t.y+t.height),o=1/t.width*s,a=1-1/t.height*n;return{x:constrain(o),y:constrain(a)}}function translateZoom(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 scaleZoom(t,e,i){return{x:{min:t.x.min,max:t.x.min+dx(t)*e},y:{min:t.y.min,max:t.y.min+dy(t)*i}}}function scaleZoomCenter(t,e,i){const s=dx(t),n=dy(t),o=t.x.min+s/2,a=t.y.min+n/2;return{x:{min:o-s*e/2,max:o+s*e/2},y:{min:a-n*i/2,max:a+n*i/2}}}function scaleZoomAxisWithAnchor(t,e,i,s){const{min:n,max:o}=e,a=n+(o-n)/2,r=t.max-t.min;switch(i){case"start":return{min:n,max:e.min+r};case"end":return{min:e.max-r,max:o};case"middle":return{min:a-r/2,max:a+r/2};case"pointer":return scaleZoomAxisWithPoint(t,e,s??a);default:return{min:n,max:o}}}function scaleZoomAxisWithPoint(t,e,i){const s=t.max-t.min,n=e.max-e.min,o=i*(1-(n-s)),a=i-o,r=t.min+a,l=t.max+a;return{min:r,max:l}}function multiplyZoom(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 constrainZoom(t){return{x:constrainAxis(t.x),y:constrainAxis(t.y)}}function constrainAxis(t){const e=t.max-t.min;let i=t.max>UNIT.max?UNIT.max-e:t.min,s=t.min<UNIT.min?e:t.max;return i=Math.max(UNIT.min,i),s=Math.min(UNIT.max,s),{min:i,max:s}}var ZoomAxisDragger=class{update(t,e,i,s,n,o){return this.oldZoom??(this.oldZoom=definedZoomState(e===module_support_exports.ChartAxisDirection.X?{...n,x:o}:{...n,y:o})),this.updateCoords(t.currentX,t.currentY),this.updateZoom(e,i,s)}stop(){this.coords=void 0,this.oldZoom=void 0}updateCoords(t,e){this.coords?(this.coords.x2=t,this.coords.y2=e):this.coords={x1:t,y1:e,x2:t,y2:e}}updateZoom(t,e,i){const{coords:s,oldZoom:n}=this;let o=definedZoomState(n);if(!s||!n)return t===module_support_exports.ChartAxisDirection.X?o.x:o.y;const a=pointToRatio(i,s.x1,s.y1),r=pointToRatio(i,s.x2,s.y2);if(t===module_support_exports.ChartAxisDirection.X){const c=(r.x-a.x)*dx(n);return o.x.max+=c,o.x=scaleZoomAxisWithAnchor(o.x,n.x,e,a.x),o=constrainZoom(o),o.x}const l=(r.y-a.y)*dy(n);return o.y.max-=l,o.y=scaleZoomAxisWithAnchor(o.y,n.y,e,a.y),o=constrainZoom(o),o.y}},CONTEXT_ZOOM_ACTION_ID="zoom-action",CONTEXT_PAN_ACTION_ID="pan-action",ZoomContextMenu=class{constructor(t,e,i,s,n,o){this.contextMenuRegistry=t,this.zoomManager=e,this.getModuleProperties=i,this.getRect=s,this.updateZoom=n,this.isZoomValid=o}registerActions(t){if(!t)return;const{contextMenuRegistry:e}=this,i=e.registerDefaultAction({id:CONTEXT_ZOOM_ACTION_ID,type:"series-area",label:"contextMenuZoomToCursor",action:this.onZoomToHere.bind(this),toggleEnabledOnShow:n=>{const o=this.getRect();if(!o)return!0;const a=pointToRatio(o,n.x,n.y);return this.iterateFindNextZoomAtPoint(a)!=null}}),s=e.registerDefaultAction({id:CONTEXT_PAN_ACTION_ID,type:"series-area",label:"contextMenuPanToCursor",action:this.onPanToHere.bind(this),toggleEnabledOnShow:()=>!isZoomEqual(definedZoomState(this.zoomManager.getZoom()),unitZoomState())});return()=>{i(),s()}}computeOrigin(t){const e=this.getRect(),{enabled:i}=this.getModuleProperties();if(!i||!e||!t?.target||!(t instanceof MouseEvent))return;const s={x:0,y:0,width:e.width,height:e.height};return pointToRatio(s,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=definedZoomState(this.zoomManager.getZoom()),s=dx(i),n=dy(i),o=e.x*s,a=e.y*n,r=UNIT_SIZE/2;let l={x:{min:e.x-r,max:e.x+r},y:{min:e.y-r,max:e.y+r}};l=scaleZoomCenter(l,s,n),l=translateZoom(l,i.x.min-e.x+o,i.y.min-e.y+a),this.updateZoom(constrainZoom(l))}iterateFindNextZoomAtPoint(t){const{scrollingStep:e}=this.getModuleProperties();for(let i=e;i<=1-e;i+=e){const s=this.getNextZoomAtPoint(t,i);if(this.isZoomValid(s))return s}}getNextZoomAtPoint(t,e){const{isScalingX:i,isScalingY:s}=this.getModuleProperties(),n=definedZoomState(this.zoomManager.getZoom()),o=t.x*dx(n),a=t.y*dy(n),r=UNIT_SIZE/2;let l={x:{min:t.x-r,max:t.x+r},y:{min:t.y-r,max:t.y+r}};return l=scaleZoomCenter(l,i?dx(n)*e:UNIT_SIZE,s?dy(n)*e:UNIT_SIZE),l=translateZoom(l,n.x.min-t.x+o,n.y.min-t.y+a),constrainZoom(l)}},{BBoxValues:BBoxValues2,ChartAxisDirection:ChartAxisDirection15}=module_support_exports,ZoomDOMProxy=class{constructor(t){this.axesHandlers=t,this.axes=[]}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:s}=module_support_exports.ChartAxisDirection,n=[...e.axisManager.getAxisContext(i),...e.axisManager.getAxisContext(s)],{removed:o,added:a}=this.diffAxisIds(n);o.length>0&&(this.axes=this.axes.filter(r=>o.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=n.find(h=>h.axisId===r.axisId).getCanvasBounds();r.div.setHidden(BBoxValues2.isEmpty(c)),c!==void 0&&r.div.setBounds(c)}}toggleAxisDraggingCursor(t,e){for(const i of this.axes)i.direction===t&&i.div.setCursor(e?this.getCursor(t):void 0)}getCursor(t){return t===ChartAxisDirection15.X?"ew-resize":"ns-resize"}initAxis(t,e,i,s){const o=t.proxyInteractionService.createProxyElement({type:"region",domManagerId:e,where:"afterend"});return o.setCursor(this.getCursor(s)),o.addListener("drag-start",a=>{a.device==="touch"&&a.sourceEvent.preventDefault(),i.onDragStart(e,s)}),o.addListener("drag-move",a=>i.onDrag(a)),o.addListener("drag-end",i.onDragEnd),o.addListener("dblclick",()=>i.onDoubleClick(e,s)),{axisId:e,div:o,direction:s}}diffAxisIds(t){const e=this.axes.map(o=>o.axisId),i=t.map(o=>o.axisId),s=e.filter(o=>!i.includes(o)),n=t.filter(o=>!e.includes(o.axisId));return{removed:s,added:n}}},maxZoomCoords=16,decelerationValues={off:1,short:.01,long:.002},ZoomPanner=class{constructor(){this.deceleration=1,this.zoomCoordsHistoryIndex=0,this.coordsHistory=[]}get decelerationValue(){const{deceleration:t}=this;return Math.max(typeof t=="number"?t:decelerationValues[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:s=0,y2:n=0}=this.coords??{};this.onUpdate?.({type:"update",deltaX:e-s,deltaY:i-n})}start(){this.coordsMonitorTimeout=setInterval(this.recordCurrentZoomCoords.bind(this),16)}stop(){const{coordsHistory:t}=this;let e=0,i=0,s=0;if(t.length>0){const n=this.zoomCoordsHistoryIndex%maxZoomCoords;let o=n-1;o<0&&(o=t.length-1);let a=n;a>=t.length&&(a=0);const r=t[o],l=t[a];e=r.x-l.x,i=r.y-l.y,s=r.t-l.t}if(this.coords=void 0,clearInterval(this.coordsMonitorTimeout),this.coordsMonitorTimeout=void 0,this.zoomCoordsHistoryIndex=0,this.coordsHistory.length=0,s>0&&this.decelerationValue<1){const n=e/s,o=i/s,a=Math.hypot(n,o),r=Math.atan2(o,n),l=performance.now();this.inertiaHandle=getWindow().requestAnimationFrame(c=>{this.animateInertia(c,c,l,a,r)})}}recordCurrentZoomCoords(){const{coords:t,coordsHistory:e,zoomCoordsHistoryIndex:i}=this;if(!t)return;const{x2:s,y2:n}=t,o=Date.now();e[i%maxZoomCoords]={x:s,y:n,t:o},this.zoomCoordsHistoryIndex+=1}animateInertia(t,e,i,s,n){const o=1-this.decelerationValue,a=-s/Math.log(o),r=s*(o**(e-i)-1)/Math.log(o),l=s*(o**(t-i)-1)/Math.log(o);this.onUpdate?.({type:"update",deltaX:-Math.cos(n)*(l-r),deltaY:-Math.sin(n)*(l-r)}),!(l>=a-1)&&(this.inertiaHandle=requestAnimationFrame(c=>{this.animateInertia(c,t,i,s,n)}))}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,s){const n=pointToRatio(t,t.x+Math.abs(i),t.y+t.height-Math.abs(s)),o=Math.sign(i)*n.x,a=-Math.sign(s)*n.y,r={};for(const[l,{direction:c,zoom:h}]of entries(e)){if(h&&h.min===UNIT.min&&h.max===UNIT.max)continue;let d=definedZoomState({[c]:h});d=constrainZoom(translateZoom(d,o*dx(d),a*dy(d))),r[l]={direction:c,zoom:d[c]}}return r}},DELTA_SCALE=200,ZoomScrollPanner=class{update(t,e,i,s){const n=t.deltaX*e*DELTA_SCALE;return this.translateZooms(i,s,n)}translateZooms(t,e,i){const s={},n=pointToRatio(t,t.x+Math.abs(i),0),o=i<0?-n.x:n.x;for(const[a,{direction:r,zoom:l}]of entries(e)){if(r!==module_support_exports.ChartAxisDirection.X)continue;let c=definedZoomState({x:l});c=constrainZoom(translateZoom(c,o*dx(c),0)),s[a]={direction:r,zoom:c.x}}return s}},ZoomScroller=class{updateAxes(t,e,i,s){const n=t.sourceEvent,o={},{anchorPointX:a,anchorPointY:r,isScalingX:l,isScalingY:c,scrollingStep:h}=e,d=pointToRatio(i,n.offsetX??n.clientX,n.offsetY??n.clientY);for(const[u,{direction:p,zoom:g}]of entries(s)){if(g==null)continue;let f={...g};const m=h*t.deltaY*(g.max-g.min);if(p===module_support_exports.ChartAxisDirection.X&&l)f.max+=m,f=scaleZoomAxisWithAnchor(f,g,a,d.x);else if(p===module_support_exports.ChartAxisDirection.Y&&c)f.max+=m,f=scaleZoomAxisWithAnchor(f,g,r,d.y);else continue;o[u]={direction:p,zoom:constrainAxis(f)}}return o}update(t,e,i,s){const{anchorPointX:n,anchorPointY:o,isScalingX:a,isScalingY:r,scrollingStep:l}=e,c=t.offsetX+i.x,h=t.offsetY+i.y,d=pointToRatio(i,c,h),u=t.deltaY;let p=definedZoomState(s);return p.x.max+=a?l*u*dx(s):0,p.y.max+=r?l*u*dy(s):0,a&&(p.x=scaleZoomAxisWithAnchor(p.x,s.x,n,d.x)),r&&(p.y=scaleZoomAxisWithAnchor(p.y,s.y,o,d.y)),p=constrainZoom(p),p}updateDelta(t,e,i){const{anchorPointX:s,anchorPointY:n,isScalingX:o,isScalingY:a,scrollingStep:r}=e;let l=definedZoomState(i);return l.x.max+=o?r*-t*dx(i):0,l.y.max+=a?r*-t*dy(i):0,o&&(l.x=scaleZoomAxisWithAnchor(l.x,i.x,s)),a&&(l.y=scaleZoomAxisWithAnchor(l.y,i.y,n)),l=constrainZoom(l),l}},ZoomSelector=class{constructor(t,e,i){this.rect=t,this.getZoom=e,this.isZoomValid=i,this.rect.visible=!1}update(t,e,i){const s=t.currentX+(i?.x??0),n=t.currentY+(i?.y??0);this.rect.visible=!0,this.updateCoords(s,n,e,i),this.updateRect(i)}stop(t,e,i){let s=definedZoomState();if(!t||!e)return s;this.coords&&(s=this.createZoomFromCoords(e,i));const n=e.width/t.width,o=e.height/t.height;return s=constrainZoom(multiplyZoom(s,n,o)),this.reset(),s}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,s){if(!this.coords){this.coords={x1:t,y1:e,x2:t,y2:e};return}const{coords:n}=this;if(n.x2=t,n.y2=e,!s)return;const{isScalingX:o,isScalingY:a,keepAspectRatio:r}=i,l=this.getNormalisedDimensions();if(r&&o&&a){const c=s.width/s.height;n.y2<n.y1?n.y2=Math.min(n.y1-l.width/c,n.y1):n.y2=Math.max(n.y1+l.width/c,n.y1)}o||(n.x1=s.x,n.x2=s.x+s.width),a||(n.y1=s.y,n.y2=s.y+s.height)}updateRect(t){if(!t)return;const{rect:e}=this,i=this.getNormalisedDimensions(),{width:s,height:n}=i;let{x:o,y:a}=i;o=Math.max(o,t.x),o-=Math.max(0,o+s-(t.x+t.width)),a=Math.max(a,t.y),a-=Math.max(0,a+n-(t.y+t.height)),e.x=o,e.y=a,e.width=s,e.height=n;const r=this.createZoomFromCoords(t,this.getZoom());this.isZoomValid(r)?e.updateValid():e.updateInvalid()}createZoomFromCoords(t,e){const i=definedZoomState(e),s=this.getNormalisedDimensions(),n=pointToRatio(t,s.x,s.y+s.height),o=s.width/t.width,a=s.height/t.height;let r=scaleZoom(i,o,a);const l=n.x*dx(i),c=n.y*dy(i);return r=translateZoom(r,l,c),r=constrainZoom(r),r}getNormalisedDimensions(){const{x1:t=0,y1:e=0,x2:i=0,y2:s=0}=this.coords??{},n=t<=i?t:i,o=e<=s?e:s,a=t<=i?i-t:t-i,r=e<=s?s-e:e-s;return{x:n,y:o,width:a,height:r}}},{ARRAY:ARRAY6,BOOLEAN:BOOLEAN25,STRING:STRING24,UNION:UNION10,ActionOnSet:ActionOnSet9,BaseProperties:BaseProperties18,ChartAxisDirection:ChartAxisDirection16,NativeWidget:NativeWidget3,PropertiesArray:PropertiesArray6,Toolbar:Toolbar3,ToolbarButtonProperties:ToolbarButtonProperties5,TempValidate:TempValidate52}=module_support_exports,ZoomButtonProperties=class extends ToolbarButtonProperties5{};__decorateClass([TempValidate52(UNION10(["reset","zoom-in","zoom-out","pan-left","pan-right","pan-start","pan-end"]))],ZoomButtonProperties.prototype,"value",2),__decorateClass([TempValidate52(STRING24)],ZoomButtonProperties.prototype,"section",2);var ZoomToolbar=class extends BaseProperties18{constructor(t,e,i,s,n,o,a){super(),this.ctx=t,this.getModuleProperties=e,this.getResetZoom=i,this.updateZoom=s,this.updateAxisZoom=n,this.resetZoom=o,this.isZoomValid=a,this.enabled=!1,this.buttons=new PropertiesArray6(ZoomButtonProperties),this.visible="hover",this.verticalSpacing=10,this.detectionRange=38,this.destroyFns=[],this.container=new NativeWidget3(createElement("div")),this.container.addClass("ag-charts-zoom-buttons"),t.domManager.addChild("canvas-overlay","zoom-buttons",this.container.getElement()),this.toolbar=new Toolbar3(t.localeManager),this.container.addChild(this.toolbar),this.toolbar.getElement().style.transform="translateY(54px)",this.toggleVisibility(this.visible==="always"),this.destroyFns.push(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.toolbar.addToolbarListener("button-focused",this.onButtonFocus.bind(this)),t.widgets.containerWidget.addListener("mousemove",this.onHover.bind(this)),t.widgets.containerWidget.addListener("mouseleave",this.onLeave.bind(this)),t.layoutManager.addListener("layout:complete",this.onLayoutComplete.bind(this)),this.teardown.bind(this))}destroy(){for(const t of this.destroyFns)t()}toggleVisibleZoomed(t){this.visible==="zoomed"&&this.toggleVisibility(!t)}teardown(){this.ctx.domManager.removeChild("canvas-overlay","zoom-buttons"),this.container.destroy()}onLayoutComplete(t){const{buttons:e,container:i}=this,{rect:s}=t.series;this.toolbar.updateButtons(e),this.toggleButtons();const n=i.getBounds().height;i.setBounds({y:s.y+s.height-n})}onHover(t){if(!this.enabled||this.visible!=="hover"||this.toolbar.isHidden())return;const{container:e,detectionRange:i,ctx:{scene:s}}=this,{currentY:n,sourceEvent:{target:o}}=t,a=e.getElement(),r=a.offsetTop-i,l=n>r&&n<s.canvas.element.offsetHeight||o===a;this.toggleVisibility(l)}onLeave(){this.visible==="hover"&&this.toggleVisibility(!1)}toggleVisibility(t,e=!1){const{container:i,toolbar:s,verticalSpacing:n}=this;s.toggleClass("ag-charts-zoom-buttons__toolbar--hidden",!t);const o=s.getElement();o.style.transitionDuration=e?"0s":"",o.style.transform=t?"translateY(0)":`translateY(${i.getBounds().height+n}px)`}toggleButtons(){const t=definedZoomState(this.ctx.zoomManager.getZoom());if(!(this.previousZoom&&isZoomEqual(this.previousZoom,t))){this.previousZoom=t;for(const[e,i]of this.buttons.entries()){let s=!0;switch(i?.value){case"pan-start":s=t.x.min>UNIT.min;break;case"pan-end":s=t.x.max<UNIT.max;break;case"pan-left":s=t.x.min>UNIT.min;break;case"pan-right":s=t.x.max<UNIT.max;break;case"zoom-out":s=!isZoomEqual(t,unitZoomState());break;case"zoom-in":s=this.isZoomValid(this.getNextZoomStateUnified("zoom-in",t,this.getModuleProperties()));break;case"reset":s=!isZoomEqual(t,this.getResetZoom());break}this.toolbar.toggleButtonEnabledByIndex(e,s)}}}onButtonPress({button:t}){if(!this.enabled||this.toolbar.isHidden())return;const e=this.getModuleProperties();if(e.independentAxes&&t.value!=="reset"){const i=this.ctx.zoomManager.getAxisZooms();for(const[s,{direction:n,zoom:o}]of entries(i))o!=null&&this.onButtonPressAxis(t,e,s,n,o)}else this.onButtonPressUnified(t,e)}onButtonFocus(t){this.toggleVisibility(!0,!0)}onButtonPressAxis(t,e,i,s,n){const{isScalingX:o,isScalingY:a,scrollingStep:r}=e;let l={...n};const c=n.max-n.min;switch(t.value){case"pan-start":l.max=c,l.min=0;break;case"pan-end":l.min=l.max-c,l.max=UNIT.max;break;case"pan-left":l.min-=c*r,l.max-=c*r;break;case"pan-right":l.min+=c*r,l.max+=c*r;break;case"zoom-in":case"zoom-out":{const h=s===ChartAxisDirection16.X,d=h&&o||!h&&a;let u=t.value==="zoom-in"?1-r:1+r;d||(u=1);const p=h?this.getAnchorPointX(e):this.getAnchorPointY(e);l.max=l.min+(l.max-l.min)*u,l=scaleZoomAxisWithAnchor(l,n,p);break}}this.updateAxisZoom(i,s,constrainAxis(l))}onButtonPressUnified(t,e){const{scrollingStep:i}=e,s=definedZoomState(this.ctx.zoomManager.getZoom());let n=definedZoomState(s);switch(t.value){case"reset":this.resetZoom();return;case"pan-start":n.x.max=dx(n),n.x.min=0;break;case"pan-end":n.x.min=UNIT.max-dx(n),n.x.max=UNIT.max;break;case"pan-left":n=translateZoom(n,-dx(n)*i,0);break;case"pan-right":n=translateZoom(n,dx(n)*i,0);break;case"zoom-in":case"zoom-out":{n=this.getNextZoomStateUnified(t.value,s,e);break}}this.updateZoom(constrainZoom(n))}getNextZoomStateUnified(t,e,i){const{isScalingX:s,isScalingY:n,scrollingStep:o}=i,a=t==="zoom-in"?1-o:1+o,r=scaleZoom(e,s?a:1,n?a:1);return r.x=scaleZoomAxisWithAnchor(r.x,e.x,this.getAnchorPointX(i)),r.y=scaleZoomAxisWithAnchor(r.y,e.y,this.getAnchorPointY(i)),r}getAnchorPointX(t){const e=this.anchorPointX??t.anchorPointX;return e==="pointer"?DEFAULT_ANCHOR_POINT_X:e}getAnchorPointY(t){const e=this.anchorPointY??t.anchorPointY;return e==="pointer"?DEFAULT_ANCHOR_POINT_Y:e}};__decorateClass([TempValidate52(BOOLEAN25),ActionOnSet9({changeValue(t){this.toolbar?.setHidden(!t)}})],ZoomToolbar.prototype,"enabled",2),__decorateClass([TempValidate52(ARRAY6)],ZoomToolbar.prototype,"buttons",2),__decorateClass([TempValidate52(UNION10(["always","zoomed","hover"])),ActionOnSet9({changeValue(t,e){e!=null&&this.toggleVisibility(t==="always")}})],ZoomToolbar.prototype,"visible",2),__decorateClass([TempValidate52(ANCHOR_POINT)],ZoomToolbar.prototype,"anchorPointX",2),__decorateClass([TempValidate52(ANCHOR_POINT)],ZoomToolbar.prototype,"anchorPointY",2);var N=1e6;function clientToNormal({min:t,max:e},i,s,n){return n===0?0:N*((i-s)/n*(e-t)+t)}function solveTwoUnknowns(t,e,i,s,n,o){[t,e]=[Math.min(t,e),Math.max(t,e)],[i,s]=[Math.min(i,s),Math.max(i,s)];const a=N*(i-n)/o,r=N*(s-n)/o,l=(i-n)/(s-n),c=(t-l*e)/(N-a+l*(r-N)),h=(e+(r-N)*c)/r;return{min:c,max:h}}function isRangeOverlapping(t,e,i,s){e===0&&(e=30),s===0&&(s=30);const n=t-e,o=t+e,a=i-s,r=i+s;return!(o<a||r<n)}var ZoomTwoFingers=class{constructor(){this.touchStart={origins:[{identifier:0,normalX:NaN,normalY:NaN},{identifier:0,normalX:NaN,normalY:NaN}]},this.initialZoom={x:{min:0,max:1},y:{min:0,max:1}},this.previous={a1:NaN,a2:NaN,b1:NaN,b2:NaN}}start(t,e,i){if(t.sourceEvent.targetTouches.length!==2)return!1;t.sourceEvent.preventDefault();const s=Array.from(t.sourceEvent.targetTouches),{x:n,y:o,width:a,height:r}=e.getBoundingClientRect();this.initialZoom.x.min=i.x?.min??0,this.initialZoom.x.max=i.x?.max??1,this.initialZoom.y.min=i.y?.min??0,this.initialZoom.y.max=i.y?.max??1,this.touchStart.origins.forEach(g=>g.identifier=0),this.previous.a1=NaN,this.previous.a2=NaN,this.previous.b1=NaN,this.previous.b2=NaN;for(const g of[0,1]){const f=s[g].clientX,m=o+r-s[g].clientY;this.touchStart.origins[g].identifier=s[g].identifier,this.touchStart.origins[g].normalX=clientToNormal(this.initialZoom.x,f,n,a),this.touchStart.origins[g].normalY=clientToNormal(this.initialZoom.y,m,o,r)}const[l,c]=s,[h,d]=this.touchStart.origins,u=isRangeOverlapping(l.clientX,l.radiusX,c.clientX,c.radiusX);return isRangeOverlapping(l.clientY,l.radiusY,c.clientY,c.radiusY)&&(h.normalY=d.normalY=(h.normalY+d.normalY)/2),u&&(h.normalX=d.normalX=(h.normalX+d.normalX)/2),!0}update(t,e){t.sourceEvent.preventDefault();const i=Array.from(t.sourceEvent.targetTouches),{x:s,y:n,width:o,height:a}=e.getBoundingClientRect(),{origins:r}=this.touchStart,l=[0,1].map(y=>i.find(x=>x.identifier===r[y].identifier)),c=r[0].normalX,h=r[1].normalX,d=l[0].clientX,u=l[1].clientX,p=r[0].normalY,g=r[1].normalY,f=n+a-l[0].clientY,m=n+a-l[1].clientY;return this.twitchTolerantZoomPan4(c,h,d,u,p,g,f,m,s,n,o,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,s,n,o,a,r,l,c,h,d){const{initialZoom:u,previous:p}=this,g=twitchTolerantZoomPan2(t,e,i,s,p,"a1","a2",l,h,u.x),f=twitchTolerantZoomPan2(n,o,a,r,p,"b1","b2",c,d,u.y);return{x:g,y:f}}};function twitchTolerantZoomPan2(t,e,i,s,n,o,a,r,l,c){if(t!=e){const h=n[o],d=n[a];return Math.abs(i-h)+Math.abs(s-d)<=1?(i=h,s=d):(n[o]=i,n[a]=s),solveTwoUnknowns(t,e,i,s,r,l)}else{const h=clientToNormal(c,i,r,l),d=clientToNormal(c,s,r,l),u=(h+d)/2,p=(t-u)/N;return{min:c.min+p,max:c.max+p}}}var{BOOLEAN:BOOLEAN26,NUMBER:NUMBER14,POSITIVE_NUMBER:POSITIVE_NUMBER14,RATIO:RATIO12,UNION:UNION11,OBJECT:OBJECT22,OR:OR5,ActionOnSet:ActionOnSet10,ChartAxisDirection:ChartAxisDirection17,ChartUpdateType:ChartUpdateType4,Deprecated:Deprecated2,TempValidate:TempValidate53,InteractionState:InteractionState5,ProxyProperty:ProxyProperty4}=module_support_exports,round4=t=>roundTo(t,10),CURSOR_ID="zoom-cursor",TOOLTIP_ID="zoom-tooltip",ZoomAutoScaling=class extends module_support_exports.BaseProperties{constructor(t){super(),this.onChange=t,this.enabled=!1,this.padding=0}};__decorateClass([TempValidate53(BOOLEAN26),ActionOnSet10({changeValue(t){this.onChange({enabled:t,padding:this.padding})}})],ZoomAutoScaling.prototype,"enabled",2),__decorateClass([TempValidate53(RATIO12),ActionOnSet10({changeValue(t){this.onChange({enabled:this.enabled,padding:t})}})],ZoomAutoScaling.prototype,"padding",2);var Zoom=class extends module_support_exports.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=UNIT_SIZE/10,this.keepAspectRatio=!1,this.minVisibleItems=2,this.anchorPointX=DEFAULT_ANCHOR_POINT_X,this.anchorPointY=DEFAULT_ANCHOR_POINT_Y,this.autoScaling=new ZoomAutoScaling(i=>{this.ctx.zoomManager.setAutoScaleYAxis(i.enabled,i.padding)}),this.buttons=new ZoomToolbar(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 ZoomAxisDragger,this.panner=new ZoomPanner,this.scroller=new ZoomScroller,this.scrollPanner=new ZoomScrollPanner,this.twoFingers=new ZoomTwoFingers,this.deceleration="short",this.dragState=0,this.isState=i=>this.ctx.interactionManager.isState(i),this.destroyContextMenuActions=void 0,this.isFirstWheelEvent=!0,this.debouncedWheelReset=debounce(()=>{this.isFirstWheelEvent=!0},100);const e=new ZoomRect;this.selector=new ZoomSelector(e,this.getZoom.bind(this),this.isZoomValid.bind(this)),this.contextMenu=new ZoomContextMenu(t.contextMenuRegistry,t.zoomManager,this.getModuleProperties.bind(this),()=>this.paddedRect,this.updateZoom.bind(this),this.isZoomValid.bind(this)),this.domProxy=new ZoomDOMProxy({onDragStart:(i,s)=>this.onAxisDragStart(i,s),onDrag:i=>{this.onDragMove({...i,currentX:i.offsetX,currentY:i.offsetY})},onDragEnd:()=>this.onDragEnd(),onDoubleClick:(i,s)=>{this.hoveredAxis={id:i,direction:s},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,s)=>this.onTouchStart(i,s)),t.widgets.seriesWidget.addListener("touchmove",(i,s)=>this.onTouchMove(i,s)),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:s,ctx:{zoomManager:n}}=this;!e||!i||!this.isState(InteractionState5.ZoomClickable)||(s?n.resetAxisZoom("zoom",s.id):t?.preventZoomDblClick||this.resetZoom())}onDragStart(t){const{enabled:e,enableAxisDragging:i,enablePanning:s,enableSelecting:n,hoveredAxis:o,ctx:{domManager:a,zoomManager:r}}=this;if(!e||!this.hoveredAxis&&(!this.isState(InteractionState5.ZoomDraggable)||this.dragState!==0||this.isIgnoredTouch(t)))return;this.panner.stopInteractions();let l=0;if(i&&o)l=1;else if(t!=null){const c=this.isPanningKeyPressed(t.sourceEvent);s&&(!n||c)?(a.updateCursor(CURSOR_ID,"grabbing"),l=2,this.panner.start()):n&&!c&&(l=3)}(this.dragState=l)!==0&&r.fireZoomPanStartEvent("zoom")}onDragMove(t){const{anchorPointX:e,anchorPointY:i,axisDragger:s,dragState:n,enabled:o,paddedRect:a,panner:r,selector:l,seriesRect:c,shouldFlipXY:h,hoveredAxis:d,ctx:{interactionManager:u,tooltipManager:p,updateService:g,zoomManager:f}}=this;if(!o||!a||!c||!d&&(!this.isState(InteractionState5.ZoomDraggable)||this.isIgnoredTouch(t)))return;u.pushState(module_support_exports.InteractionState.ZoomDrag),t.device==="touch"&&t.sourceEvent.preventDefault();const m=this.getZoom();switch(n){case 1:{if(!d)break;const{id:y,direction:x}=d;let b=x===ChartAxisDirection17.X?e:i;h&&(b=x===ChartAxisDirection17.X?i:e);const S=f.getAxisZoom(y),v=s.update(t,x,b,c,m,S);f.setAxisManuallyAdjusted("zoom",y),this.updateAxisZoom(y,x,v);break}case 2:r.update(t);break;case 3:l.update(t,this.getModuleProperties(),a);break;case 0:return}p.updateTooltip(TOOLTIP_ID),g.update(ChartUpdateType4.PERFORM_LAYOUT,{skipAnimations:!0})}onDragEnd(){const{axisDragger:t,dragState:e,enabled:i,panner:s,selector:n,ctx:{domManager:o,interactionManager:a,tooltipManager:r}}=this;if(a.popState(module_support_exports.InteractionState.ZoomDrag),!(!i||e===0)){switch(e){case 1:this.hoveredAxis=void 0,t.stop();break;case 2:s.stop();break;case 3:{if(!n.didUpdate())break;const l=this.getZoom(),c=n.stop(this.seriesRect,this.paddedRect,l);this.updateZoom(c);break}}this.dragState=0,o.updateCursor(CURSOR_ID),r.removeTooltip(TOOLTIP_ID)}}onNavZoom(t){const{enabled:e,enableScrolling:i,scroller:s}=this;!this.ctx.interactionManager.isState(module_support_exports.InteractionState.Default)||!e||!i||(t.widgetEvent.sourceEvent.preventDefault(),this.updateZoom(s.updateDelta(t.delta,this.getModuleProperties(),this.getZoom())))}onWheel(t){const{enabled:e,enablePanning:i,enableScrolling:s,paddedRect:n}=this;if(!e||!s||!n||!this.isState(InteractionState5.ZoomWheelable))return;const{deltaX:o,deltaY:a}=t.sourceEvent,r=o!=null&&a!=null&&Math.abs(o)>Math.abs(a);i&&r?this.onWheelPanning(t):this.onWheelScrolling(t)}onWheelPanning(t){const{scrollingStep:e,scrollPanner:i,seriesRect:s,ctx:{zoomManager:n}}=this;if(!s)return;t.sourceEvent.preventDefault();const o=i.update(t,e,s,n.getAxisZooms());for(const[a,{direction:r,zoom:l}]of entries(o))this.updateAxisZoom(a,r,l)}onWheelScrolling(t){const{enableAxisDragging:e,enableIndependentAxes:i,hoveredAxis:s,scroller:n,seriesRect:o,ctx:{zoomManager:a}}=this;if(!o)return;const r=this.getZoom();let l=t.deltaY>0&&this.isMaxZoom(r);const c=e&&s!=null;let h=this.isScalingX(),d=this.isScalingY();c&&(h=s.direction===module_support_exports.ChartAxisDirection.X,d=!h);const u=this.getModuleProperties({isScalingX:h,isScalingY:d});let p=!0;if(i===!0){const g=n.updateAxes(t,u,o,a.getAxisZooms());for(const[f,{direction:m,zoom:y}]of entries(g))c&&s.id!==f||p&&(p=this.updateAxisZoom(f,m,y))}else{const g=n.update(t,u,o,this.getZoom());p=this.updateUnifiedZoom(g)}l||(l=t.deltaY<0&&!p),(!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(constrainZoom(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),this.enabled&&(this.seriesRect=t.series.rect,this.paddedRect=t.series.paddedRect,this.enableAxisDragging&&this.toggleAxisDraggingCursors())}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:s,zoomManager:n}}=this;if(!i)return;const o=e.translateZooms(i,n.getAxisZooms(),t.deltaX,t.deltaY);for(const[a,{direction:r,zoom:l}]of entries(o))this.updateAxisZoom(a,r,l);s.updateTooltip(TOOLTIP_ID)}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 isZoomEqual(t,unitZoomState())}isZoomValid(t){const{minVisibleItems:e,minVisibleItemsX:i,minVisibleItemsY:s,ctx:{zoomManager:n}}=this;if(e===0)return!0;const o=this.getZoom(),a=round4(dx(t))<round4(dx(o)),r=round4(dy(t))<round4(dy(o));return!a&&!r?!0:i!=null&&a?n.isVisibleItemsCountAtLeast(t,i):s!=null&&r?n.isVisibleItemsCountAtLeast(t,s):n.isVisibleItemsCountAtLeast(t,e)}isAxisZoomValid(t,e){const{minVisibleItems:i,minVisibleItemsX:s,minVisibleItemsY:n,ctx:{zoomManager:o}}=this,a=this.getZoom(),r=e.max-e.min,l=a[t].max-a[t].min,c={...a,[t]:e},h=t===ChartAxisDirection17.X?s:n;return r>=l||o.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(ChartUpdateType4.SCENE_RENDER,{skipAnimations:!0}),!1)}updatePrimaryAxisZooms(t){this.updatePrimaryAxisZoom(t,ChartAxisDirection17.X),this.updatePrimaryAxisZoom(t,ChartAxisDirection17.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:s,ctx:{zoomManager:n}}=this;if(!i)return!1;const o=this.getZoom();return s!==!0?(o[e]=i,this.updateUnifiedZoom(o)):this.isAxisZoomValid(e,i)?(n.updateAxisZoom("zoom",t,i),!0):!1}toggleAxisDraggingCursors(){const{anchorPointX:t,anchorPointY:e,domProxy:i}=this,s=this.getZoom();let n=dx(s)!==UNIT_SIZE,o=dy(s)!==UNIT_SIZE;if(!n){const a=scaleZoom(s,.999,1);a.x=scaleZoomAxisWithAnchor(a.x,s.x,t),n=this.isZoomValid(a)}if(!o){const a=scaleZoom(s,1,.999);a.y=scaleZoomAxisWithAnchor(a.y,s.y,e),o=this.isZoomValid(a)}i.toggleAxisDraggingCursor(ChartAxisDirection17.X,n),i.toggleAxisDraggingCursor(ChartAxisDirection17.Y,o)}getZoom(){return definedZoomState(this.ctx.zoomManager.getZoom())}getResetZoom(){return definedZoomState(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}}};__decorateClass([ActionOnSet10({newValue(t){this.onEnabledChange(t)}}),TempValidate53(BOOLEAN26)],Zoom.prototype,"enabled",2),__decorateClass([TempValidate53(BOOLEAN26)],Zoom.prototype,"enableAxisDragging",2),__decorateClass([TempValidate53(BOOLEAN26)],Zoom.prototype,"enableDoubleClickToReset",2),__decorateClass([ActionOnSet10({changeValue(t){this.ctx.zoomManager.setIndependentAxes(!!t)}}),TempValidate53(BOOLEAN26,{optional:!0})],Zoom.prototype,"enableIndependentAxes",2),__decorateClass([TempValidate53(BOOLEAN26)],Zoom.prototype,"enablePanning",2),__decorateClass([TempValidate53(BOOLEAN26)],Zoom.prototype,"enableScrolling",2),__decorateClass([TempValidate53(BOOLEAN26)],Zoom.prototype,"enableSelecting",2),__decorateClass([TempValidate53(BOOLEAN26)],Zoom.prototype,"enableTwoFingerZoom",2),__decorateClass([TempValidate53(UNION11(["alt","ctrl","meta","shift"],"a pan key"))],Zoom.prototype,"panKey",2),__decorateClass([TempValidate53(UNION11(["x","y","xy"],"an axis"))],Zoom.prototype,"axes",2),__decorateClass([TempValidate53(RATIO12)],Zoom.prototype,"scrollingStep",2),__decorateClass([TempValidate53(BOOLEAN26)],Zoom.prototype,"keepAspectRatio",2),__decorateClass([TempValidate53(POSITIVE_NUMBER14)],Zoom.prototype,"minVisibleItems",2),__decorateClass([Deprecated2("Use [minVisibleItems] instead."),TempValidate53(NUMBER14.restrict({min:1}))],Zoom.prototype,"minVisibleItemsX",2),__decorateClass([Deprecated2("Use [minVisibleItems] instead."),TempValidate53(NUMBER14.restrict({min:1}))],Zoom.prototype,"minVisibleItemsY",2),__decorateClass([TempValidate53(ANCHOR_POINT)],Zoom.prototype,"anchorPointX",2),__decorateClass([TempValidate53(ANCHOR_POINT)],Zoom.prototype,"anchorPointY",2),__decorateClass([TempValidate53(OBJECT22)],Zoom.prototype,"autoScaling",2),__decorateClass([TempValidate53(OBJECT22)],Zoom.prototype,"buttons",2),__decorateClass([ProxyProperty4("panner.deceleration"),TempValidate53(OR5(RATIO12,UNION11(["off","short","long"],"a deceleration")))],Zoom.prototype,"deceleration",2);var buttons={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"}]},ZoomModule={type:"root",optionsKey:"zoom",packageType:"enterprise",chartTypes:["cartesian","topology"],moduleFactory:t=>new Zoom(t),themeTemplate:{zoom:{anchorPointX:"end",anchorPointY:"middle",axes:"x",buttons,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}}}},{BOOLEAN:BOOLEAN27,OBJECT:OBJECT23,POSITION:POSITION2,POSITIVE_NUMBER:POSITIVE_NUMBER15,BaseProperties:BaseProperties19,AxisTicks:AxisTicks2,ZIndexMap:ZIndexMap9,ProxyProperty:ProxyProperty5,TempValidate:TempValidate54,LayoutElement:LayoutElement6,createId:createId5,Group:Group9,Rect:Rect3,Marker:Marker2,TranslatableGroup:TranslatableGroup4,BBox:BBox10}=module_support_exports,GradientBar=class extends BaseProperties19{constructor(){super(...arguments),this.thickness=16,this.preferredLength=100}};__decorateClass([TempValidate54(POSITIVE_NUMBER15)],GradientBar.prototype,"thickness",2),__decorateClass([TempValidate54(POSITIVE_NUMBER15)],GradientBar.prototype,"preferredLength",2);var GradientLegendScale=class{constructor(t){this.axisTicks=t}};__decorateClass([ProxyProperty5("axisTicks.label")],GradientLegendScale.prototype,"label",2),__decorateClass([ProxyProperty5("axisTicks.interval")],GradientLegendScale.prototype,"interval",2),__decorateClass([ProxyProperty5("axisTicks.padding")],GradientLegendScale.prototype,"padding",2);var GradientLegend=class{constructor(t){this.ctx=t,this.id=createId5(this),this.legendGroup=new TranslatableGroup4({name:"legend",zIndex:ZIndexMap9.LEGEND}),this.gradientRect=new Rect3,this.arrow=new Marker2({shape:"triangle"}),this.ticksGroup=new Group9({name:"legend-axis-group"}),this.destroyFns=[],this.enabled=!1,this.position="bottom",this.reverseOrder=!1,this.gradient=new GradientBar,this.spacing=20,this.data=[],this.highlightManager=t.highlightManager,this.axisTicks=new AxisTicks2,this.axisTicks.attachAxis(this.ticksGroup),this.scale=new GradientLegendScale(this.axisTicks),this.legendGroup.append([this.gradientRect,this.arrow,this.ticksGroup]),this.destroyFns.push(t.highlightManager.addListener("highlight-change",()=>this.onChartHoverChange()),t.layoutManager.registerElement(LayoutElement6.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||e.legendType!=="gradient"){this.legendGroup.visible=!1;return}const{colorRange:i}=this.normalizeColorArrays(e);this.updateGradientRect(t.layoutBox,i);const s=this.updateAxis(e)??new BBox10(0,0,0,0),{left:n,top:o}=this.getMeasurements(t.layoutBox,s);this.updateArrow(),this.legendGroup.visible=!0,this.legendGroup.translationX=n,this.legendGroup.translationY=o}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[s,n]=e,o=i.length;return e=i.map((a,r)=>r===0?s:r===o-1?n:s+(n-s)*r/(o-1)),{colorDomain:e,colorRange:i}}updateGradientRect(t,e){const{gradientRect:i}=this,{preferredLength:s,thickness:n}=this.gradient;let o;this.isVertical()?(o=0,i.width=n,i.height=Math.min(t.height,s)):(o=90,i.width=Math.min(t.width,s),i.height=n),i.fill={type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:e.map((a,r)=>({stop:r/(e.length-1),color:a})),rotation:o}}updateAxis(t){const{axisTicks:e}=this,i=this.isVertical(),s=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=s?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:s}=this.axisTicks,n=s.fontSize??0,o=i.convert(t.colorValue);let{x:a,y:r}=this.gradientRect,l=Math.PI;this.isVertical()?(a-=n/2,r+=o,l/=2):(a+=o,r-=n/2),e.visible=!0,e.fill=s.color,e.rotation=l,e.size=n,e.translationX=a,e.translationY=r}getMeasurements(t,e){let{x:i,y:s}=t,{width:n,height:o}=this.gradientRect;switch(this.isVertical()?n+=e.width+5:o+=e.height+5,this.position){case"left":s+=t.height/2-o/2,t.shrink(n+this.spacing,"left");break;case"right":i+=t.width-n,s+=t.height/2-o/2,t.shrink(n+this.spacing,"right");break;case"top":i+=t.width/2-n/2,t.shrink(o+this.spacing,"top");break;case"bottom":i+=t.width/2-n/2,s+=t.height-o,t.shrink(o+this.spacing,"bottom")}return{top:s,left:i}}onChartHoverChange(){this.enabled&&this.updateArrow()}};GradientLegend.className="GradientLegend",__decorateClass([TempValidate54(BOOLEAN27)],GradientLegend.prototype,"enabled",2),__decorateClass([TempValidate54(POSITION2)],GradientLegend.prototype,"position",2),__decorateClass([TempValidate54(BOOLEAN27)],GradientLegend.prototype,"reverseOrder",2),__decorateClass([TempValidate54(OBJECT23)],GradientLegend.prototype,"gradient",2),__decorateClass([TempValidate54(POSITIVE_NUMBER15)],GradientLegend.prototype,"spacing",2);var GradientLegendModule={type:"legend",optionsKey:"gradientLegend",packageType:"enterprise",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],identifier:"gradient",moduleFactory:t=>new GradientLegend(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"};function injectWatermark(t,e){const i=t.addChild("canvas-overlay","watermark"),s=createElement("span");s.innerText=e,i.addEventListener("animationend",()=>{t.removeChild("canvas-overlay","watermark"),t.removeStyles("watermark")}),i.classList.add("ag-watermark"),i.appendChild(s)}var{cartesianAxisLabelOptionsDefs:cartesianAxisLabelOptionsDefs2,cartesianAxisOptionsDefs:cartesianAxisOptionsDefs2,cartesianAxisCrosshairOptions:cartesianAxisCrosshairOptions2,continuousAxisOptions:continuousAxisOptions2,commonAxisLabelOptionsDefs:commonAxisLabelOptionsDefs2,commonAxisOptionsDefs:commonAxisOptionsDefs2,commonCrossLineOptionsDefs:commonCrossLineOptionsDefs2,commonCrossLineLabelOptionsDefs:commonCrossLineLabelOptionsDefs2,numberFormatValidator:numberFormatValidator2}=module_support_exports,ordinalTimeAxisOptionsDefs={...cartesianAxisOptionsDefs2,type:required(constant("ordinal-time")),paddingInner:ratio,paddingOuter:ratio,groupPaddingInner:ratio,label:{...cartesianAxisLabelOptionsDefs2,format:string},interval:continuousAxisOptions2(or(number,date),!0).interval,crosshair:cartesianAxisCrosshairOptions2(!0)},angleNumberAxisOptionsDefs={...commonAxisOptionsDefs2,...continuousAxisOptions2(number),type:required(constant("angle-number")),crossLines:arrayOfDefs(commonCrossLineOptionsDefs2),startAngle:number,endAngle:number,label:{...commonAxisLabelOptionsDefs2,orientation:union("fixed","parallel","perpendicular"),format:numberFormatValidator2}},invalidOptionsFromIntegratedCharts={innerRadiusRatio:ratio},angleCategoryAxisOptionsDefs={...commonAxisOptionsDefs2,...invalidOptionsFromIntegratedCharts,type:required(constant("angle-category")),shape:union("polygon","circle"),crossLines:arrayOfDefs(commonCrossLineOptionsDefs2),startAngle:number,endAngle:number,paddingInner:ratio,groupPaddingInner:ratio,label:{...commonAxisLabelOptionsDefs2,orientation:union("fixed","parallel","perpendicular")}},radiusNumberAxisOptionsDefs={...commonAxisOptionsDefs2,...continuousAxisOptions2(number),type:required(constant("radius-number")),shape:union("polygon","circle"),positionAngle:number,innerRadiusRatio:ratio,crossLines:arrayOfDefs({...commonCrossLineOptionsDefs2,label:{...commonCrossLineLabelOptionsDefs2,positionAngle:number}},"cross-line options"),title:{enabled:boolean,text:string,spacing:positiveNumber,formatter:callback,...fontOptionsDef},label:{...commonAxisLabelOptionsDefs2,format:numberFormatValidator2}},radiusCategoryAxisOptionsDefs={...commonAxisOptionsDefs2,type:required(constant("radius-category")),positionAngle:number,innerRadiusRatio:ratio,paddingInner:ratio,paddingOuter:ratio,groupPaddingInner:ratio,label:commonAxisLabelOptionsDefs2,crossLines:arrayOfDefs({...commonCrossLineOptionsDefs2,label:{...commonCrossLineLabelOptionsDefs2,positionAngle:number}},"cross-line options"),title:{enabled:boolean,text:string,spacing:positiveNumber,formatter:callback,...fontOptionsDef}},OrdinalTimeAxisModule2={type:"axis",name:"ordinal-time",chartType:"cartesian",enterprise:!0,options:ordinalTimeAxisOptionsDefs,create:t=>new OrdinalTimeAxis(t)},AngleNumberAxisModule2={type:"axis",name:"angle-number",chartType:"polar",enterprise:!0,options:angleNumberAxisOptionsDefs,create:t=>new AngleNumberAxis(t)},AngleCategoryAxisModule2={type:"axis",name:"angle-category",chartType:"polar",enterprise:!0,options:angleCategoryAxisOptionsDefs,create:t=>new AngleCategoryAxis(t)},RadiusNumberAxisModule2={type:"axis",name:"radius-number",chartType:"polar",enterprise:!0,options:radiusNumberAxisOptionsDefs,create:t=>new RadiusNumberAxis(t)},RadiusCategoryAxisModule2={type:"axis",name:"radius-category",chartType:"polar",enterprise:!0,options:radiusCategoryAxisOptionsDefs,create:t=>new RadiusCategoryAxis(t)},{Chart:Chart2,TempValidate:TempValidate55,ARRAY:ARRAY7}=module_support_exports;function isFlowProportion(t){return t.type==="sankey"||t.type==="chord"}var FlowProportionChart=class extends Chart2{getChartType(){return"flow-proportion"}async updateData(){await super.updateData();const t=this.getOptions();this.nodes!==t.nodes&&(this.nodes=t.nodes);const{nodes:e}=this;this.series.forEach(i=>{isFlowProportion(i)&&i.setChartNodes(e)})}performLayout(t){const{seriesRoot:e,annotationRoot:i}=this,{layoutBox:s}=t;s.shrink(this.seriesArea.padding.toJson());const n=s.clone();this.seriesRect=n,this.animationRect=n,e.visible=this.series.some(o=>o.visible);for(const o of[e,i])o.translationX=Math.floor(n.x),o.translationY=Math.floor(n.y);this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:e.visible,rect:n,paddedRect:n}})}};FlowProportionChart.className="FlowProportionChart",FlowProportionChart.type="flow-proportion",__decorateClass([TempValidate55(ARRAY7,{optional:!0})],FlowProportionChart.prototype,"nodes",2);var{isAgFlowProportionChartOptions:isAgFlowProportionChartOptions2,flowProportionChartOptionsDefs:flowProportionChartOptionsDefs2}=module_support_exports,FlowProportionChartModule2={type:"chart",name:"flow-proportion",enterprise:!0,options:flowProportionChartOptionsDefs2,detect:isAgFlowProportionChartOptions2,create(t,e){return new FlowProportionChart(t,e)}},{Chart:Chart3}=module_support_exports,GaugeChart=class extends Chart3{getChartType(){return"gauge"}performLayout(t){const{seriesRoot:e,annotationRoot:i,series:s,seriesArea:n}=this,{layoutBox:o}=t,a=o.clone();o.shrink(n.padding.toJson()),this.seriesRect=a.clone().translate(a.x-o.x,a.y-o.y),this.animationRect=o,e.visible=s.some(r=>r.visible);for(const r of[e,i])r.translationX=Math.floor(o.x),r.translationY=Math.floor(o.y);this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:e.visible,rect:a,paddedRect:o}})}getAriaLabel(){const t=[],e=this.getCaptionText();e.length!==0&&t.push(e);for(const s of this.series)t.push(s.getCaptionText());const i=t.join(". ");return this.ctx.localeManager.t("ariaAnnounceGaugeChart",{caption:i})}};GaugeChart.className="GaugeChart",GaugeChart.type="gauge";var{isAgGaugeChartOptions:isAgGaugeChartOptions2,gaugeChartOptionsDefs:gaugeChartOptionsDefs2}=module_support_exports,GaugeChartModule2={type:"chart",name:"gauge",enterprise:!0,options:gaugeChartOptionsDefs2,detect:isAgGaugeChartOptions2,create(t,e){return new GaugeChart(t,e)}},{Chart:Chart4}=module_support_exports,HierarchyChart=class extends Chart4{getChartType(){return"hierarchy"}performLayout(t){const{seriesRoot:e,annotationRoot:i}=this,{layoutBox:s}=t;s.shrink(this.seriesArea.padding.toJson());const n=s.clone();this.seriesRect=n,this.animationRect=n;for(const o of[e,i])o.translationX=Math.floor(n.x),o.translationY=Math.floor(n.y);e.visible=this.series[0].visible,e.setClipRect(n.clone()),this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:!0,rect:n,paddedRect:n}})}getAriaLabel(){const t=this.getCaptionText();return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:t})}};HierarchyChart.className="HierarchyChart",HierarchyChart.type="hierarchy";var{isAgHierarchyChartOptions:isAgHierarchyChartOptions2,hierarchyChartOptionsDefs:hierarchyChartOptionsDefs2}=module_support_exports,HierarchyChartModule2={type:"chart",name:"hierarchy",enterprise:!0,options:hierarchyChartOptionsDefs2,detect:isAgHierarchyChartOptions2,create(t,e){return new HierarchyChart(t,e)}},{Chart:Chart5}=module_support_exports,StandaloneChart=class extends Chart5{getChartType(){return"standalone"}performLayout(t){const{seriesRoot:e,annotationRoot:i}=this,{layoutBox:s}=t;s.shrink(this.seriesArea.padding.toJson());const n=s.clone();this.seriesRect=n,this.animationRect=n;for(const o of[e,i])o.translationX=Math.floor(s.x),o.translationY=Math.floor(s.y);e.visible=this.series[0].visible,this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:!0,rect:n,paddedRect:s}})}getAriaLabel(){const t=this.getCaptionText();return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:t})}};StandaloneChart.className="StandaloneChart",StandaloneChart.type="standalone";var{isAgStandaloneChartOptions:isAgStandaloneChartOptions2,standaloneChartOptionsDefs:standaloneChartOptionsDefs2}=module_support_exports,StandaloneChartModule2={type:"chart",name:"standalone",enterprise:!0,options:standaloneChartOptionsDefs2,detect:isAgStandaloneChartOptions2,create(t,e){return new StandaloneChart(t,e)}};function isValidCoordinate(t){return Array.isArray(t)&&t.length>=2&&t.every(isFiniteNumber)}function isValidCoordinates(t){return Array.isArray(t)&&t.length>=2&&t.every(isValidCoordinate)}var delta3=.001;function hasSameStartEndPoint(t){return Math.abs(t[0][0]-t[t.length-1][0])<delta3&&Math.abs(t[0][1]-t[t.length-1][1])<delta3}function isValidPolygon(t){return Array.isArray(t)&&t.every(isValidCoordinates)&&t.every(hasSameStartEndPoint)}function isValidGeometry(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(isValidGeometry);case"MultiPolygon":return Array.isArray(i)&&i.every(isValidPolygon);case"Polygon":return isValidPolygon(i);case"MultiLineString":return Array.isArray(i)&&i.every(isValidCoordinates);case"LineString":return isValidCoordinates(i);case"MultiPoint":return isValidCoordinates(i);case"Point":return isValidCoordinate(i)}}function isValidFeature(t){return t!==null&&typeof t=="object"&&t.type==="Feature"&&isValidGeometry(t.geometry)}function isValidFeatureCollection(t){return t!==null&&typeof t=="object"&&t.type==="FeatureCollection"&&Array.isArray(t.features)&&t.features.every(isValidFeature)}var GEOJSON_OBJECT=module_support_exports.predicateWithMessage(isValidFeatureCollection,"a GeoJSON object"),{Chart:Chart6,MercatorScale:MercatorScale2,NumberAxis:NumberAxis2,TempValidate:TempValidate56}=module_support_exports;function isTopologySeries(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 TopologyChart=class extends Chart6{constructor(t,e){super(t,e),this.xAxis=new NumberAxis2(this.getModuleContext()),this.xAxis.position="bottom",this.yAxis=new NumberAxis2(this.getModuleContext()),this.yAxis.position="left",this.ctx.zoomManager.updateAxes([this.xAxis,this.yAxis])}getChartType(){return"topology"}async updateData(){await super.updateData();const t=this.getOptions();this.topology!==t.topology&&(this.topology=t.topology);const{topology:e}=this;this.series.forEach(i=>{isTopologySeries(i)&&i.setChartTopology(e)})}performLayout(t){const{seriesRoot:e,annotationRoot:i}=this,{layoutBox:s}=t;s.shrink(this.seriesArea.padding.toJson());const n=s.clone();this.seriesRect=n,this.animationRect=n;const o=this.series.filter(isTopologySeries),a=o.reduce((c,h)=>{if(!h.visible)return c;const d=h.topologyBounds;return d==null?c:c==null?d:(c.merge(d),c)},void 0);let r;if(a!=null){const{lon0:c,lat0:h,lon1:d,lat1:u}=a,p=[[c,h],[d,u]],g=MercatorScale2.bounds(p),{width:f,height:m}=n,y=Math.min(f/g.width,m/g.height),x=g.width*y,b=g.height*y,S=(f-x)/2,v=(m-b)/2,I=S,A=v,D=S+x,T=v+b,k=this.ctx.zoomManager.getAxisZoom(this.xAxis.id),w=this.ctx.zoomManager.getAxisZoom(this.yAxis.id),L=(D-I)/(k.max-k.min),O=I-L*k.min,F=(T-A)/(1-w.min-(1-w.max)),R=A-F*(1-w.max);r=new MercatorScale2(p,[[O,R],[O+L,R+F]])}o.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(n.x),c.translationY=Math.floor(n.y),c.setClipRect(n.clone());this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:l,rect:n,paddedRect:n}})}};TopologyChart.className="TopologyChart",TopologyChart.type="topology",__decorateClass([TempValidate56(GEOJSON_OBJECT,{optional:!0})],TopologyChart.prototype,"topology",2);var{isAgTopologyChartOptions:isAgTopologyChartOptions2,topologyChartOptionsDefs:topologyChartOptionsDefs2}=module_support_exports,TopologyChartModule2={type:"chart",name:"topology",enterprise:!0,options:topologyChartOptionsDefs2,detect:isAgTopologyChartOptions2,create(t,e){return new TopologyChart(t,e)}},{toolbarButtonOptionsDefs:toolbarButtonOptionsDefs2}=module_support_exports,annotationOptionsDef={enabled:boolean,axesButtons:{enabled:boolean,axes:union("x","y","xy")},toolbar:{enabled:boolean,padding:positiveNumber,buttons:arrayOfDefs({...toolbarButtonOptionsDefs2,value:union("line-menu","fibonacci-menu","text-menu","shape-menu","measurer-menu","line","horizontal-line","vertical-line","parallel-channel","disjoint-channel","fibonacci-retracement","fibonacci-retracement-trend-based","text","comment","callout","note","clear")},"annotation toolbar buttons array")},optionsToolbar:{enabled:boolean,buttons:arrayOf(or(optionsDefs({...toolbarButtonOptionsDefs2,value:union("line-stroke-width","line-style-type","line-color","fill-color","text-color","text-size","delete","settings")}),optionsDefs({...toolbarButtonOptionsDefs2,value:union("lock"),checkedOverrides:toolbarButtonOptionsDefs2})))}};annotationOptionsDef.data=array,annotationOptionsDef.xKey=string,annotationOptionsDef.volumeKey=string,annotationOptionsDef.snap=boolean;var serializableDate=optionsDefs({__type:required(constant("date")),value:or(string,number)},"a serializable date object"),xValue=or(string,number,serializableDate),annotationValue=or(xValue,optionsDefs({value:xValue,groupPercentage:number})),annotationAxisLabelOptionsDef={enabled:boolean,cornerRadius:positiveNumber,formatter:callback,...fontOptionsDef,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},lineAnnotationTextOptionsDef={label:string,position:union("top","center","bottom"),alignment:union("left","center","right"),...fontOptionsDef},channelAnnotationTextOptionsDef={label:string,position:union("top","inside","bottom"),alignment:union("left","center","right"),...fontOptionsDef},annotationHandleOptionsDef={...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},annotationPointOptionsDef={x:annotationValue,y:number},annotationLineOptionsDef={lineStyle:union("solid","dashed","dotted"),...lineDashOptionsDef},fibonacciAnnotationStylesOptionsDef={visible:boolean,extendStart:boolean,extendEnd:boolean,locked:boolean,text:lineAnnotationTextOptionsDef,handle:annotationHandleOptionsDef,label:fontOptionsDef,showFill:boolean,isMultiColor:boolean,strokes:arrayOf(color),rangeStroke:color,bands:union(4,6,10),...strokeOptionsDef,...annotationLineOptionsDef},annotationInitialStateOptionsDef=typeUnion({line:{visible:boolean,extendStart:boolean,extendEnd:boolean,locked:boolean,text:lineAnnotationTextOptionsDef,handle:annotationHandleOptionsDef,start:annotationPointOptionsDef,end:annotationPointOptionsDef,...strokeOptionsDef,...annotationLineOptionsDef},"horizontal-line":{visible:boolean,locked:boolean,value:annotationValue,axisLabel:annotationAxisLabelOptionsDef,text:lineAnnotationTextOptionsDef,handle:annotationHandleOptionsDef,...strokeOptionsDef,...annotationLineOptionsDef},"vertical-line":{visible:boolean,locked:boolean,value:annotationValue,axisLabel:annotationAxisLabelOptionsDef,text:lineAnnotationTextOptionsDef,handle:annotationHandleOptionsDef,...strokeOptionsDef,...annotationLineOptionsDef},"disjoint-channel":{visible:boolean,extendStart:boolean,extendEnd:boolean,locked:boolean,startHeight:positiveNumber,endHeight:positiveNumber,text:channelAnnotationTextOptionsDef,handle:annotationHandleOptionsDef,start:annotationPointOptionsDef,end:annotationPointOptionsDef,background:fillOptionsDef,...strokeOptionsDef,...annotationLineOptionsDef},"parallel-channel":{visible:boolean,extendStart:boolean,extendEnd:boolean,locked:boolean,height:positiveNumber,text:channelAnnotationTextOptionsDef,handle:annotationHandleOptionsDef,start:annotationPointOptionsDef,end:annotationPointOptionsDef,background:fillOptionsDef,middle:{visible:boolean,...strokeOptionsDef,...annotationLineOptionsDef},...strokeOptionsDef,...annotationLineOptionsDef},"fibonacci-retracement":{reverse:boolean,start:annotationPointOptionsDef,end:annotationPointOptionsDef,...fibonacciAnnotationStylesOptionsDef},"fibonacci-retracement-trend-based":{reverse:boolean,start:annotationPointOptionsDef,end:annotationPointOptionsDef,endRetracement:annotationPointOptionsDef,...fibonacciAnnotationStylesOptionsDef},callout:{visible:boolean,locked:boolean,text:string,handle:annotationHandleOptionsDef,start:annotationPointOptionsDef,end:annotationPointOptionsDef,...fontOptionsDef,...fillOptionsDef,...strokeOptionsDef},comment:{visible:boolean,locked:boolean,text:string,handle:annotationHandleOptionsDef,...annotationPointOptionsDef,...fontOptionsDef,...fillOptionsDef},note:{visible:boolean,locked:boolean,text:string,handle:annotationHandleOptionsDef,background:{...fillOptionsDef,...strokeOptionsDef},...annotationPointOptionsDef,...fontOptionsDef,...fillOptionsDef,...strokeOptionsDef},text:{visible:boolean,locked:boolean,text:string,handle:annotationHandleOptionsDef,...annotationPointOptionsDef,...fontOptionsDef,...fillOptionsDef},arrow:{visible:boolean,extendStart:boolean,extendEnd:boolean,locked:boolean,text:lineAnnotationTextOptionsDef,handle:annotationHandleOptionsDef,start:annotationPointOptionsDef,end:annotationPointOptionsDef,...strokeOptionsDef,...annotationLineOptionsDef},"arrow-up":{visible:boolean,locked:boolean,handle:annotationHandleOptionsDef,...annotationPointOptionsDef,...fillOptionsDef},"arrow-down":{visible:boolean,locked:boolean,handle:annotationHandleOptionsDef,...annotationPointOptionsDef,...fillOptionsDef},"date-range":{visible:boolean,extendAbove:boolean,extendBelow:boolean,locked:boolean,text:lineAnnotationTextOptionsDef,handle:annotationHandleOptionsDef,start:annotationPointOptionsDef,end:annotationPointOptionsDef,statistics:{divider:strokeOptionsDef,...fontOptionsDef,...fillOptionsDef,...strokeOptionsDef},...strokeOptionsDef,...annotationLineOptionsDef},"price-range":{visible:boolean,extendLeft:boolean,extendRight:boolean,locked:boolean,text:lineAnnotationTextOptionsDef,handle:annotationHandleOptionsDef,start:annotationPointOptionsDef,end:annotationPointOptionsDef,statistics:{divider:strokeOptionsDef,...fontOptionsDef,...fillOptionsDef,...strokeOptionsDef},...strokeOptionsDef,...annotationLineOptionsDef},"date-price-range":{visible:boolean,locked:boolean,text:lineAnnotationTextOptionsDef,handle:annotationHandleOptionsDef,start:annotationPointOptionsDef,end:annotationPointOptionsDef,statistics:{divider:strokeOptionsDef,...fontOptionsDef,...fillOptionsDef,...strokeOptionsDef},...strokeOptionsDef,...annotationLineOptionsDef}}),initialStateOptionsDef={chartType:union("candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"),annotations:arrayOf(annotationInitialStateOptionsDef),legend:arrayOfDefs({visible:boolean,seriesId:string,itemId:string,legendItemName:string},"legend state array"),zoom:{rangeX:{start:or(number,serializableDate),end:or(number,serializableDate)},rangeY:{start:or(number,serializableDate),end:or(number,serializableDate)},ratioX:{start:ratio,end:ratio},ratioY:{start:ratio,end:ratio},autoScaledAxes:arrayOf(constant("y"))}};function prepareBoxPlotFromTo(t){return{from:t?{scalingX:1,scalingY:0}:{scalingX:0,scalingY:1},to:{scalingX:1,scalingY:1}}}function resetBoxPlotSelectionsScalingCenterFn(t){return(e,i)=>t?{scalingCenterY:i.scaledValues.medianValue}:{scalingCenterX:i.scaledValues.medianValue}}var{ScalableGroup:ScalableGroup2,Rect:Rect4,Line:Line5,BBox:BBox11,Selection:Selection4,applyShapeFillBBox:applyShapeFillBBox2}=module_support_exports,BoxPlotGroup=class extends ScalableGroup2{constructor(){super(),this.append([new Rect4({tag:0}),new Rect4({tag:2}),new Rect4({tag:1}),new Line5({tag:3}),new Line5({tag:3}),new Line5({tag:4}),new Line5({tag:4})])}updateDatumStyles(t,e,i,s,n){const{bandwidth:o,scaledValues:{xValue:a,medianValue:r}}=t;let{minValue:l,q1Value:c,q3Value:h,maxValue:d}=t.scaledValues;(i&&!s||!i&&s)&&([d,h,c,l]=[l,c,h,d]);const u=(P,V,j,H)=>i?{y:P,x:V,width:H,height:j}:{x:P,y:V,width:j,height:H},p=(P,V,j)=>i?{y1:P,y2:V,x:j}:{x1:P,x2:V,y:j},g=(P,V,j)=>i?{x1:V,x2:j,y:P}:{x:P,y1:V,y2:j},f=(P,V,j,H)=>({x:P,y:V,width:j,height:H}=u(P,V,j,H),new BBox11(P,V,j,H)),{fill:m,fillOpacity:y,stroke:x,strokeWidth:b,strokeOpacity:S,lineDash:v,lineDashOffset:I,cornerRadius:A,cap:D,whisker:T}=e,k=Selection4.select(this,Rect4),[w]=k.selectByTag(0),[L]=k.selectByTag(2),[O]=k.selectByTag(1),F=k.selectByTag(3),R=k.selectByTag(4);T.strokeWidth>o&&(T.strokeWidth=o);const E=u(c,a,h-c,o);L.setProperties(E),w.setProperties(E),w.setProperties({cornerRadius:A});const _=Math.max(Math.round(r-b/2),c+b),G=Math.min(Math.round(r+b/2),h-b);O.setProperties(E),O.setProperties({visible:_<G,cornerRadius:A,clipBBox:f(_,a+b,G-_,Math.max(0,o-b*2))});const B=Math.floor(a+o*(1-D.lengthRatio)/2),z=Math.ceil(a+o*(1+D.lengthRatio)/2);R[0].setProperties(g(l,B,z)),R[1].setProperties(g(d,B,z)),F[0].setProperties(p(Math.round(l+T.strokeWidth/2),c,Math.floor(a+o/2))),F[1].setProperties(p(h,Math.round(d-T.strokeWidth/2),Math.floor(a+o/2))),applyShapeFillBBox2(w,m,n),w.setProperties({fill:m,fillOpacity:y,strokeWidth:b*2,strokeOpacity:0}),O.setProperties({fill:x,fillOpacity:S,strokeWidth:0});for(const P of[...F,...R])P.setProperties(T);L.setProperties({stroke:x,strokeWidth:b,strokeOpacity:S,lineDash:v,lineDashOffset:I,cornerRadius:A,fillOpacity:0})}distanceSquared(t,e){const i=Selection4.selectByClass(this,Rect4,Line5);return module_support_exports.nearestSquared(t,e,i).distanceSquared}get midPoint(){const t=this.datum;return t.midPoint===void 0?(logger_exports.error("BoxPlotGroup.datum.midPoint is undefined"),{x:NaN,y:NaN}):t.midPoint}},{BaseProperties:BaseProperties20,FillGradientDefaults:FillGradientDefaults2,FillPatternDefaults:FillPatternDefaults2,AbstractBarSeriesProperties:AbstractBarSeriesProperties2,SeriesTooltip:SeriesTooltip2,TempValidate:TempValidate57,COLOR_STRING:COLOR_STRING10,FUNCTION:FUNCTION7,LINE_DASH:LINE_DASH6,OBJECT:OBJECT24,POSITIVE_NUMBER:POSITIVE_NUMBER16,RATIO:RATIO13,STRING:STRING25,mergeDefaults:mergeDefaults4,COLOR_GRADIENT:COLOR_GRADIENT2,COLOR_PATTERN:COLOR_PATTERN2,OR:OR6}=module_support_exports,BoxPlotSeriesCap=class extends BaseProperties20{constructor(){super(...arguments),this.lengthRatio=.5}};__decorateClass([TempValidate57(RATIO13)],BoxPlotSeriesCap.prototype,"lengthRatio",2);var BoxPlotSeriesWhisker=class extends BaseProperties20{};__decorateClass([TempValidate57(COLOR_STRING10,{optional:!0})],BoxPlotSeriesWhisker.prototype,"stroke",2),__decorateClass([TempValidate57(POSITIVE_NUMBER16)],BoxPlotSeriesWhisker.prototype,"strokeWidth",2),__decorateClass([TempValidate57(RATIO13)],BoxPlotSeriesWhisker.prototype,"strokeOpacity",2),__decorateClass([TempValidate57(LINE_DASH6,{optional:!0})],BoxPlotSeriesWhisker.prototype,"lineDash",2),__decorateClass([TempValidate57(POSITIVE_NUMBER16)],BoxPlotSeriesWhisker.prototype,"lineDashOffset",2);var BoxPlotSeriesProperties=class extends AbstractBarSeriesProperties2{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new FillGradientDefaults2,this.fillPatternDefaults=new FillPatternDefaults2,this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.cap=new BoxPlotSeriesCap,this.whisker=new BoxPlotSeriesWhisker,this.tooltip=new SeriesTooltip2}toJson(){const{stroke:t,strokeWidth:e,strokeOpacity:i,lineDash:s,lineDashOffset:n}=this,o=super.toJson();return o.whisker=mergeDefaults4(o.whisker,{stroke:t,strokeWidth:e,strokeOpacity:i,lineDash:s,lineDashOffset:n}),o}};__decorateClass([TempValidate57(STRING25)],BoxPlotSeriesProperties.prototype,"xKey",2),__decorateClass([TempValidate57(STRING25)],BoxPlotSeriesProperties.prototype,"minKey",2),__decorateClass([TempValidate57(STRING25)],BoxPlotSeriesProperties.prototype,"q1Key",2),__decorateClass([TempValidate57(STRING25)],BoxPlotSeriesProperties.prototype,"medianKey",2),__decorateClass([TempValidate57(STRING25)],BoxPlotSeriesProperties.prototype,"q3Key",2),__decorateClass([TempValidate57(STRING25)],BoxPlotSeriesProperties.prototype,"maxKey",2),__decorateClass([TempValidate57(STRING25,{optional:!0})],BoxPlotSeriesProperties.prototype,"xName",2),__decorateClass([TempValidate57(STRING25,{optional:!0})],BoxPlotSeriesProperties.prototype,"yName",2),__decorateClass([TempValidate57(STRING25,{optional:!0})],BoxPlotSeriesProperties.prototype,"minName",2),__decorateClass([TempValidate57(STRING25,{optional:!0})],BoxPlotSeriesProperties.prototype,"q1Name",2),__decorateClass([TempValidate57(STRING25,{optional:!0})],BoxPlotSeriesProperties.prototype,"medianName",2),__decorateClass([TempValidate57(STRING25,{optional:!0})],BoxPlotSeriesProperties.prototype,"q3Name",2),__decorateClass([TempValidate57(STRING25,{optional:!0})],BoxPlotSeriesProperties.prototype,"maxName",2),__decorateClass([TempValidate57(OR6(COLOR_GRADIENT2,COLOR_PATTERN2,COLOR_STRING10))],BoxPlotSeriesProperties.prototype,"fill",2),__decorateClass([TempValidate57(OBJECT24)],BoxPlotSeriesProperties.prototype,"fillGradientDefaults",2),__decorateClass([TempValidate57(OBJECT24)],BoxPlotSeriesProperties.prototype,"fillPatternDefaults",2),__decorateClass([TempValidate57(RATIO13)],BoxPlotSeriesProperties.prototype,"fillOpacity",2),__decorateClass([TempValidate57(COLOR_STRING10)],BoxPlotSeriesProperties.prototype,"stroke",2),__decorateClass([TempValidate57(POSITIVE_NUMBER16)],BoxPlotSeriesProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate57(RATIO13)],BoxPlotSeriesProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate57(LINE_DASH6)],BoxPlotSeriesProperties.prototype,"lineDash",2),__decorateClass([TempValidate57(POSITIVE_NUMBER16)],BoxPlotSeriesProperties.prototype,"lineDashOffset",2),__decorateClass([TempValidate57(POSITIVE_NUMBER16)],BoxPlotSeriesProperties.prototype,"cornerRadius",2),__decorateClass([TempValidate57(FUNCTION7,{optional:!0})],BoxPlotSeriesProperties.prototype,"itemStyler",2),__decorateClass([TempValidate57(OBJECT24)],BoxPlotSeriesProperties.prototype,"cap",2),__decorateClass([TempValidate57(OBJECT24)],BoxPlotSeriesProperties.prototype,"whisker",2),__decorateClass([TempValidate57(OBJECT24)],BoxPlotSeriesProperties.prototype,"tooltip",2);var{extractDecoratedProperties:extractDecoratedProperties2,fixNumericExtent:fixNumericExtent3,keyProperty:keyProperty3,mergeDefaults:mergeDefaults5,SeriesNodePickMode:SeriesNodePickMode2,SMALLEST_KEY_INTERVAL:SMALLEST_KEY_INTERVAL2,valueProperty:valueProperty5,diff:diff2,animationValidation:animationValidation2,computeBarFocusBounds:computeBarFocusBounds2,createDatumId:createDatumId2,ContinuousScale:ContinuousScale5,ChartAxisDirection:ChartAxisDirection18,motion:motion2,isGradientFill:isGradientFill3,getShapeStyle:getShapeStyle2}=module_support_exports,BoxPlotSeriesNodeEvent=class extends module_support_exports.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.xKey=s.properties.xKey,this.minKey=s.properties.minKey,this.q1Key=s.properties.q1Key,this.medianKey=s.properties.medianKey,this.q3Key=s.properties.q3Key,this.maxKey=s.properties.maxKey}},BoxPlotSeries=class extends module_support_exports.AbstractBarSeries{constructor(t){super({moduleCtx:t,pickModes:[SeriesNodePickMode2.NEAREST_NODE,SeriesNodePickMode2.EXACT_SHAPE_MATCH],directionKeys:{x:["xKey"],y:["medianKey","q1Key","q3Key","minKey","maxKey"]},directionNames:{x:["xName"],y:["medianName","q1Name","q3Name","minName","maxName"]},categoryKey:"xValue",pathsPerSeries:[],hasHighlightedLabels:!0}),this.properties=new BoxPlotSeriesProperties,this.NodeEvent=BoxPlotSeriesNodeEvent}async processData(t){if(!this.properties.isValid()||!this.visible)return;const{xKey:e,minKey:i,q1Key:s,medianKey:n,q3Key:o,maxKey:a}=this.properties,r=!this.ctx.animationManager.isSkipped(),l=this.getCategoryAxis()?.scale,c=this.getValueAxis()?.scale,{isContinuousX:h,xScaleType:d,yScaleType:u}=this.getScaleInformation({xScale:l,yScale:c}),p=[];r&&this.processedData&&p.push(diff2(this.id,this.processedData)),r&&p.push(animationValidation2());const{processedData:g}=await this.requestDataModel(t,this.data,{props:[keyProperty3(e,d,{id:"xValue"}),valueProperty5(i,u,{id:"minValue"}),valueProperty5(s,u,{id:"q1Value"}),valueProperty5(n,u,{id:"medianValue"}),valueProperty5(o,u,{id:"q3Value"}),valueProperty5(a,u,{id:"maxValue"}),...h?[SMALLEST_KEY_INTERVAL2]:[],...p]});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!(e&&i))return[];if(t!==this.getBarDirection()){const{index:n,def:o}=i.resolveProcessedDataDefById(this,"xValue"),a=e.domain.keys[n];return o.type==="key"&&o.valueType==="category"?a:this.padBandExtent(a)}const s=this.domainForClippedRange(ChartAxisDirection18.Y,["minValue","maxValue"],"xValue",!0);return fixNumericExtent3(s)}getSeriesRange(t,e){return this.domainForVisibleRange(ChartAxisDirection18.Y,["maxValue","minValue"],"xValue",e,!0)}createNodeData(){const{visible:t,dataModel:e,processedData:i}=this,s=this.getCategoryAxis(),n=this.getValueAxis();if(!(e&&i&&s&&n))return;const{xKey:o,fill:a,fillOpacity:r,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:d,lineDashOffset:u,cap:p,whisker:g}=this.properties,f=[],m=e.resolveKeysById(this,"xValue",i),y=e.resolveColumnById(this,"minValue",i),x=e.resolveColumnById(this,"q1Value",i),b=e.resolveColumnById(this,"medianValue",i),S=e.resolveColumnById(this,"q3Value",i),v=e.resolveColumnById(this,"maxValue",i),{barWidth:I,groupIndex:A}=this.updateGroupScale(s),D=ContinuousScale5.is(s.scale)?I*-.5:0,{groupScale:T}=this,k=this.isVertical(),w={itemId:o,nodeData:f,labelData:[],scales:this.calculateScaling(),visible:this.visible};return t&&(i.dataSources.get(this.id)??[]).forEach((O,F)=>{const R=m[F];if(R==null)return;const E=y[F],_=x[F],G=b[F],B=S[F],z=v[F];if([E,_,G,B,z].some(W=>typeof W!="number")||E>_||_>G||G>B||B>z)return;const P={xValue:Math.round(s.scale.convert(R)),minValue:Math.round(n.scale.convert(E)),q1Value:Math.round(n.scale.convert(_)),medianValue:Math.round(n.scale.convert(G)),q3Value:Math.round(n.scale.convert(B)),maxValue:Math.round(n.scale.convert(z))};P.xValue+=Math.round(T.convert(String(A)))+D;const V=Math.round(I),j=Math.abs(P.q3Value-P.q1Value),H=P.xValue+V/2,Y=Math.min(P.q3Value,P.q1Value)+j/2,U={x:k?H:Y,y:k?Y:H};let $;k?$={x:U.x-V/2,y:P.minValue,width:V,height:P.maxValue-P.minValue}:$={x:P.minValue,y:U.y-V/2,width:P.maxValue-P.minValue,height:V},f.push({series:this,itemId:R,datum:O,datumIndex:F,xKey:o,bandwidth:V,scaledValues:P,cap:p,whisker:g,fill:a,fillOpacity:r,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:d,lineDashOffset:u,midPoint:U,focusRect:$})}),w}legendItemSymbol(){const{fill:t,fillOpacity:e,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,fillGradientDefaults:r,fillPatternDefaults:l}=this.properties;return{marker:getShapeStyle2({fill:t,fillOpacity:e,stroke:i,strokeOpacity:n,strokeWidth:s,lineDash:o,lineDashOffset:a},r,l)}}getLegendData(t){const{id:e,ctx:{legendManager:i},visible:s}=this,{xKey:n,yName:o,showInLegend:a,legendItemName:r}=this.properties;return!n||t!=="category"?[]:[{legendType:"category",id:e,itemId:e,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:e}),label:{text:r??o??e},symbol:this.legendItemSymbol(),legendItemName:r,hideInLegend:!a}]}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{xKey:o,xName:a,yName:r,medianKey:l,medianName:c,q1Key:h,q1Name:d,q3Key:u,q3Name:p,minKey:g,minName:f,maxKey:m,maxName:y,legendItemName:x,tooltip:b}=n,S=this.getCategoryAxis(),v=this.getValueAxis();if(!i||!s||!S||!v)return;const I=s.dataSources.get(this.id)?.[t],A=i.resolveKeysById(this,"xValue",s)[t],D=i.resolveColumnById(this,"minValue",s)[t],T=i.resolveColumnById(this,"q1Value",s)[t],k=i.resolveColumnById(this,"medianValue",s)[t],w=i.resolveColumnById(this,"q3Value",s)[t],L=i.resolveColumnById(this,"maxValue",s)[t];if(A==null)return;const O=this.getItemBaseStyle(!1);return Object.assign(O,this.getItemStyleOverrides(String(t),I,O,!1)),b.formatTooltip(this.properties,{heading:S.formatDatum(A),title:x??r,symbol:this.legendItemSymbol(),data:[{label:f,fallbackLabel:g,value:v.formatDatum(D)},{label:d,fallbackLabel:h,value:v.formatDatum(T)},{label:c,fallbackLabel:l,value:v.formatDatum(k)},{label:p,fallbackLabel:u,value:v.formatDatum(w)},{label:y,fallbackLabel:m,value:v.formatDatum(L)}]},{seriesId:e,datum:I,title:r,xKey:o,xName:a,yName:r,medianKey:l,medianName:c,q1Key:h,q1Name:d,q3Key:u,q3Name:p,minKey:g,minName:f,maxKey:m,maxName:y,...O})}animateEmptyUpdateReady({datumSelection:t}){const e=this.isVertical(),{from:i,to:s}=prepareBoxPlotFromTo(e);motion2.resetMotion([t],resetBoxPlotSelectionsScalingCenterFn(e)),motion2.staticFromToMotion(this.id,"datums",this.ctx.animationManager,[t],i,s,{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:s,whisker:n,fillGradientDefaults:o,fillPatternDefaults:a}=e,r=t?e.highlightStyle.item:void 0,l=this.getStrokeWidth(e.strokeWidth);return getShapeStyle2({fill:r?.fill??e.fill,fillOpacity:r?.fillOpacity??e.fillOpacity,stroke:r?.stroke??e.stroke,strokeWidth:r?.strokeWidth??l,strokeOpacity:r?.strokeOpacity??e.strokeOpacity,lineDash:r?.lineDash??e.lineDash??[],lineDashOffset:r?.lineDashOffset??e.lineDashOffset,cornerRadius:i,cap:s,whisker:n},o,a)}getItemStyleOverrides(t,e,i,s){const{id:n,properties:o}=this,{xKey:a,minKey:r,q1Key:l,medianKey:c,q3Key:h,maxKey:d,fillGradientDefaults:u,fillPatternDefaults:p,itemStyler:g}=o;if(g==null)return;const f=this.cachedDatumCallback(createDatumId2(t,s?"highlight":"node"),()=>this.callWithContext(g,{seriesId:n,datum:e,xKey:a,minKey:r,q1Key:l,medianKey:c,q3Key:h,maxKey:d,highlighted:s,...i}));return getShapeStyle2(f,u,p)}updateDatumNodes({datumSelection:t,isHighlight:e}){const i=this.isVertical(),s=this.getValueAxis()?.isReversed(),{highlightStyle:n}=this.properties;t.each((o,a)=>{let r=this.getFormattedStyles(a,e?"highlight":"node");e&&(r=mergeDefaults5(n.item,r));const{stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:d,lineDashOffset:u}=r;r.whisker=mergeDefaults5(r.whisker,{stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:d,lineDashOffset:u});const p=this.getShapeFillBBox();o.updateDatumStyles(a,r,i,s,p)})}updateLabelNodes(){}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e)}nodeFactory(){return new BoxPlotGroup}getFormattedStyles(t,e){const{id:i,properties:s}=this,{xKey:n,minKey:o,q1Key:a,medianKey:r,q3Key:l,maxKey:c,itemStyler:h,cornerRadius:d,fillGradientDefaults:u,fillPatternDefaults:p}=s,{datum:g,stroke:f,strokeWidth:m,strokeOpacity:y,lineDash:x,lineDashOffset:b,cap:S,whisker:v}=t;let I,A=1;isGradientFill3(t.fill)?I=t.fill:(I=t.fill,A=s.fillOpacity);let D=getShapeStyle2({fill:I,fillOpacity:A,stroke:f,strokeWidth:m,strokeOpacity:y,lineDash:x,lineDashOffset:b,cornerRadius:d,cap:extractDecoratedProperties2(S),whisker:extractDecoratedProperties2(v)},u,p);if(h){const T=this.cachedDatumCallback(createDatumId2(g.index,e),()=>this.callWithContext(h,{datum:g,seriesId:i,highlighted:e==="highlight",...D,xKey:n,minKey:o,q1Key:a,medianKey:r,q3Key:l,maxKey:c}));T&&(D=getShapeStyle2(mergeDefaults5(T,D),u,p))}return D}computeFocusBounds({datumIndex:t}){return computeBarFocusBounds2(this,this.contextNodeData?.nodeData[t].focusRect)}};BoxPlotSeries.className="BoxPlotSeries",BoxPlotSeries.type="box-plot";var{commonSeriesOptionsDefs:commonSeriesOptionsDefs2,tooltipOptionsDefs:tooltipOptionsDefs2}=module_support_exports,boxPlotSeriesOptionsDef={type:required(constant("box-plot")),xKey:required(string),minKey:required(string),q1Key:required(string),medianKey:required(string),q3Key:required(string),maxKey:required(string),xName:string,yName:string,minName:string,q1Name:string,medianName:string,q3Name:string,maxName:string,direction:union("horizontal","vertical"),grouped:boolean,legendItemName:string,showInMiniChart:boolean,cornerRadius:positiveNumber,itemStyler:callback,whisker:{...strokeOptionsDef,...lineDashOptionsDef},cap:{lengthRatio:ratio},tooltip:tooltipOptionsDefs2,...commonSeriesOptionsDefs2,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},{CARTESIAN_AXIS_TYPE:CARTESIAN_AXIS_TYPE2}=module_support_exports.ThemeConstants,BOX_PLOT_SERIES_THEME={series:{direction:"vertical",fill:{$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isPattern:[{$palette:"fill"}]}]},{$palette:"fill"},{$mix:[module_support_exports.SAFE_FILL_OPERATION,{$ref:"backgroundColor"},.7]}]},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:module_support_exports.FILL_PATTERN_DEFAULTS,strokeWidth:2},axes:{[CARTESIAN_AXIS_TYPE2.NUMBER]:{crosshair:{snap:!1}},[CARTESIAN_AXIS_TYPE2.CATEGORY]:{groupPaddingInner:.2,crosshair:{enabled:!1,snap:!1}}}},BoxPlotModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"box-plot",moduleFactory:t=>new BoxPlotSeries(t),tooltipDefaults:{range:"exact"},defaultAxes:module_support_exports.DIRECTION_SWAP_AXES,themeTemplate:BOX_PLOT_SERIES_THEME,groupable:!0},BoxPlotSeriesModule={type:"series",name:"box-plot",chartType:"cartesian",enterprise:!0,options:boxPlotSeriesOptionsDef,create:t=>new BoxPlotSeries(t)},{findMinMax:findMinMax3}=module_support_exports,X_MIN2=0,X_MAX2=1,Y_MIN2=2,Y_MAX2=3,SPAN3=4;function maxRangeFittingPoints(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 aggregationDomain(t){return findMinMax3(t.map(e=>Number(e)))}function xRatioForDatumIndex(t,e,i){return(t.valueOf()-e)/(i-e)}function aggregationIndexForXRatio(t,e){return Math.min(Math.floor(t*e),e-1)*SPAN3|0}function createAggregationIndices(t,e,i,s,n,o){const a=new Int32Array(o*SPAN3).fill(-1),r=new Float64Array(o*SPAN3).fill(NaN);for(let l=0;l<t.length;l+=1){const c=t[l],h=e[l],d=i[l];if(c==null||h==null||d==null)continue;const u=xRatioForDatumIndex(c,s,n),p=h.valueOf(),g=d.valueOf(),f=aggregationIndexForXRatio(u,o),m=a[f+X_MIN2]===-1;(m||u<r[f+X_MIN2])&&(a[f+X_MIN2]=l,r[f+X_MIN2]=u),(m||u>r[f+X_MAX2])&&(a[f+X_MAX2]=l,r[f+X_MAX2]=u),(m||g<r[f+Y_MIN2])&&(a[f+Y_MIN2]=l,r[f+Y_MIN2]=g),(m||p>r[f+Y_MAX2])&&(a[f+Y_MAX2]=l,r[f+Y_MAX2]=p)}return{indexData:a,valueData:r}}function compactAggregationIndices(t,e,i,{inPlace:s=!1}={}){const n=i/2|0,o=s?t:new Int32Array(n*SPAN3),a=s?e:new Float64Array(n*SPAN3);for(let r=0;r<n;r+=1){const l=r*SPAN3|0,c=l*2|0,h=c+SPAN3|0,d=t[h+X_MIN2]===-1,u=d||e[c+X_MIN2]<e[h+X_MIN2]?c:h;o[l+X_MIN2]=t[u+X_MIN2],a[l+X_MIN2]=e[u+X_MIN2];const p=d||e[c+X_MAX2]>e[h+X_MAX2]?c:h;o[l+X_MAX2]=t[p+X_MAX2],a[l+X_MAX2]=e[p+X_MAX2];const g=d||e[c+Y_MIN2]<e[h+Y_MIN2]?c:h;o[l+Y_MIN2]=t[g+Y_MIN2],a[l+Y_MIN2]=e[g+Y_MIN2];const f=d||e[c+Y_MAX2]>e[h+Y_MAX2]?c:h;o[l+Y_MAX2]=t[f+Y_MAX2],a[l+Y_MAX2]=e[f+Y_MAX2]}return{maxRange:n,indexData:o,valueData:a}}var AGGREGATION_THRESHOLD=1e3,OPEN=X_MIN2,HIGH=Y_MAX2,LOW=Y_MIN2,CLOSE=X_MAX2;function aggregateOhlcData(t,e,i,s){if(t.length<AGGREGATION_THRESHOLD)return;const[n,o]=aggregationDomain(s);let a=maxRangeFittingPoints(t),{indexData:r,valueData:l}=createAggregationIndices(t,e,i,n,o,a);const c=[{maxRange:a,indexData:r}];for(;a>64;)({indexData:r,valueData:l,maxRange:a}=compactAggregationIndices(r,l,a)),c.push({maxRange:a,indexData:r});return c.reverse(),c}var{fixNumericExtent:fixNumericExtent4,keyProperty:keyProperty4,createDatumId:createDatumId3,SeriesNodePickMode:SeriesNodePickMode3,ChartAxisDirection:ChartAxisDirection19,SMALLEST_KEY_INTERVAL:SMALLEST_KEY_INTERVAL3,valueProperty:valueProperty6,diff:diff3,animationValidation:animationValidation3,computeBarFocusBounds:computeBarFocusBounds3,visibleRangeIndices:visibleRangeIndices2,ContinuousScale:ContinuousScale6,OrdinalTimeScale:OrdinalTimeScale3,BandScale:BandScale2,getShapeStyle:getShapeStyle3}=module_support_exports,OhlcSeriesNodeEvent=class extends module_support_exports.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.xKey=s.properties.xKey,this.openKey=s.properties.openKey,this.closeKey=s.properties.closeKey,this.highKey=s.properties.highKey,this.lowKey=s.properties.lowKey}},OhlcSeriesBase=class extends module_support_exports.AbstractBarSeries{constructor(t){super({moduleCtx:t,pickModes:[SeriesNodePickMode3.AXIS_ALIGNED,SeriesNodePickMode3.EXACT_SHAPE_MATCH],directionKeys:{x:["xKey"],y:["lowKey","highKey","openKey","closeKey"]},directionNames:{x:["xName"],y:["lowName","highName","openName","closeName"]},categoryKey:"xValue",pathsPerSeries:[]}),this.NodeEvent=OhlcSeriesNodeEvent,this.dataAggregationFilters=void 0}async processData(t){if(!this.properties.isValid()||!this.visible)return;const{xKey:e,openKey:i,closeKey:s,highKey:n,lowKey:o}=this.properties,a=!this.ctx.animationManager.isSkipped(),r=this.getCategoryAxis()?.scale,l=this.getValueAxis()?.scale,{isContinuousX:c,xScaleType:h,yScaleType:d}=this.getScaleInformation({xScale:r,yScale:l}),u=[];a&&(this.processedData&&u.push(diff3(this.id,this.processedData)),u.push(animationValidation3())),i&&u.push(valueProperty6(i,d,{id:"openValue",invalidValue:void 0,missingValue:void 0}));const{dataModel:p,processedData:g}=await this.requestDataModel(t,this.data,{props:[keyProperty4(e,h,{id:"xValue"}),valueProperty6(s,d,{id:"closeValue"}),valueProperty6(n,d,{id:"highValue"}),valueProperty6(o,d,{id:"lowValue"}),...c?[SMALLEST_KEY_INTERVAL3]:[],...u]});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.dataAggregationFilters=this.aggregateData(p,g),this.animationState.transition("updateData")}aggregateData(t,e){const i=this.axes[ChartAxisDirection19.X];if(i==null||!(ContinuousScale6.is(i.scale)||OrdinalTimeScale3.is(i.scale)))return;const s=t.resolveKeysById(this,"xValue",e),n=t.resolveColumnById(this,"highValue",e),o=t.resolveColumnById(this,"lowValue",e),{index:a}=t.resolveProcessedDataDefById(this,"xValue"),r=e.domain.keys[a];return aggregateOhlcData(s,n,o,r)}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!(e&&i))return[];if(t!==this.getBarDirection()){const{index:n,def:o}=i.resolveProcessedDataDefById(this,"xValue"),a=e.domain.keys[n];return o.type==="key"&&o.valueType==="category"?a:this.padBandExtent(a)}const s=this.domainForClippedRange(ChartAxisDirection19.Y,["highValue","lowValue"],"xValue",!0);return fixNumericExtent4(s)}getSeriesRange(t,e){return this.domainForVisibleRange(ChartAxisDirection19.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,s=this.getCategoryAxis(),n=this.getValueAxis();if(!(e&&i&&s&&n))return;const o=[],{xKey:a,highKey:r,lowKey:l}=this.properties,c=i.dataSources.get(this.id)??[],h=e.resolveKeysById(this,"xValue",i),d=e.resolveColumnById(this,"openValue",i),u=e.resolveColumnById(this,"closeValue",i),p=e.resolveColumnById(this,"highValue",i),g=e.resolveColumnById(this,"lowValue",i),{groupScale:f}=this,{barWidth:m,groupIndex:y}=this.updateGroupScale(s),x=f.convert(String(y)),b=m>=1?m:f.rawBandwidth,S=BandScale2.is(s.scale),v={itemId:a,nodeData:o,labelData:[],scales:this.calculateScaling(),visible:this.visible};if(!t)return v;const I=(F,R,E,_,G,B,z,P)=>{const V=c[F],j=S?z/2:0,H=s.scale.convert(R)+x+j,Y=n.scale.convert(E),U=n.scale.convert(_),$=n.scale.convert(G),W=n.scale.convert(B),X=_>E,Z=X?"up":"down",q=Math.min($,W),Q=Math.max($,W)-q,tt={x:H,y:q+Q/2};o.push({series:this,itemId:Z,datum:V,datumIndex:F,xKey:a,xValue:R,openValue:E,closeValue:_,highValue:G,lowValue:B,midPoint:tt,aggregatedValue:_,isRising:X,centerX:H,width:z,y:q,height:Q,yOpen:Y,yClose:U,crisp:P})},{dataAggregationFilters:A}=this,D=s.scale,[T,k]=D.range,w=k-T,L=F=>D.convert(h[F])+x,O=A?.find(F=>F.maxRange>w);if(O==null){let[F,R]=visibleRangeIndices2(c.length,s.range,E=>{const _=L(E);return[_,_+b]});i.input.count<1e3&&(F=0,R=i.input.count);for(let E=F;E<R;E+=1){const _=h[E];if(_==null)continue;const G=d[E],B=u[E],z=p[E],P=g[E],V=P!=null&&P<=G&&P<=B,j=z!=null&&z>=G&&z>=B;if(!V){logger_exports.warnOnce(`invalid low value for key [${l}] in data element, low value cannot be higher than datum open or close values`);continue}if(!j){logger_exports.warnOnce(`invalid high value for key [${r}] in data element, high value cannot be lower than datum open or close values.`);continue}I(E,_,G,B,z,P,b,!0)}}else{const{maxRange:F,indexData:R}=O,[E,_]=visibleRangeIndices2(F,s.range,G=>{const B=G*SPAN3,z=R[B+OPEN],P=R[B+CLOSE];if(z!==-1)return[L(z),L(P)+b]});for(let G=E;G<_;G+=1){const B=G*SPAN3,z=R[B+OPEN],P=R[B+CLOSE],V=R[B+HIGH],j=R[B+LOW];if(z===-1)continue;const H=(z+P)/2|0,Y=h[H];if(Y==null)continue;const U=d[z],$=u[P],W=p[V],X=g[j],Z=Math.abs(L(P)-L(z))+b;I(H,Y,U,$,W,X,Z,!1)}}return v}isVertical(){return!0}isLabelEnabled(){return!1}updateDatumSelection(t){const e=t.nodeData??[];return t.datumSelection.update(e)}updateLabelNodes(t){}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e)}getItemBaseStyle(t,e){const{properties:i}=this,s=i.item[t],n=e?i.highlightStyle.item:void 0,o={fill:n?.fill??s.fill,fillOpacity:n?.fillOpacity??s.fillOpacity,stroke:n?.stroke??s.stroke,strokeWidth:n?.strokeWidth??s.strokeWidth,strokeOpacity:n?.strokeOpacity??s.strokeOpacity,lineDash:n?.lineDash??s.lineDash,lineDashOffset:n?.lineDashOffset??s.lineDashOffset};return s.fillGradientDefaults&&s.fillPatternDefaults?getShapeStyle3(o,s.fillGradientDefaults,s.fillPatternDefaults):o}getItemStyleOverrides(t,e,i,s,n){const{id:o,properties:a}=this,r=a.item[i],{itemStyler:l}=a;if(l==null)return;const{xKey:c,openKey:h,closeKey:d,highKey:u,lowKey:p}=a,g=this.cachedDatumCallback(createDatumId3(t,n?"highlight":"node"),()=>this.callWithContext(l,{seriesId:o,datum:e,itemId:i,xKey:c,openKey:h,closeKey:d,highKey:u,lowKey:p,highlighted:n,...s}));return r.fillGradientDefaults&&r.fillPatternDefaults?getShapeStyle3(g,r.fillGradientDefaults,r.fillPatternDefaults):g}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{xKey:o,xName:a,yName:r,openKey:l,openName:c,highKey:h,highName:d,lowKey:u,lowName:p,closeKey:g,closeName:f,legendItemName:m,tooltip:y}=n,x=this.getCategoryAxis(),b=this.getValueAxis();if(!i||!s||!x||!b)return;const S=s.dataSources.get(this.id)?.[t],v=i.resolveKeysById(this,"xValue",s)[t],I=i.resolveColumnById(this,"openValue",s)[t],A=i.resolveColumnById(this,"highValue",s)[t],D=i.resolveColumnById(this,"lowValue",s)[t],T=i.resolveColumnById(this,"closeValue",s)[t];if(v==null)return;const k=T>=I?"up":"down",w=this.properties.item[k],L=this.getItemBaseStyle(k,!1);Object.assign(L,this.getItemStyleOverrides(String(t),S,k,L,!1));let O={fill:w.fill??w.stroke,fillOpacity:w.fillOpacity??w.strokeOpacity??1,stroke:w.stroke,strokeWidth:w.strokeWidth??1,strokeOpacity:w.strokeOpacity??1,lineDash:w.lineDash??[0],lineDashOffset:w.lineDashOffset??0};return w.fillGradientDefaults&&w.fillPatternDefaults&&(O=getShapeStyle3(O,w.fillGradientDefaults,w.fillPatternDefaults)),y.formatTooltip(this.properties,{heading:x.formatDatum(v),title:m,symbol:{marker:O},data:[{label:c,fallbackLabel:l,value:b.formatDatum(I)},{label:d,fallbackLabel:h,value:b.formatDatum(A)},{label:p,fallbackLabel:u,value:b.formatDatum(D)},{label:f,fallbackLabel:g,value:b.formatDatum(T)}]},{seriesId:e,datum:S,title:r,itemId:k,xKey:o,xName:a,yName:r,openKey:l,openName:c,highKey:h,highName:d,lowKey:u,lowName:p,closeKey:g,closeName:f,...L})}getDatumId(t){return createDatumId3(t.xValue)}computeFocusBounds(t){const e=this.getNodeData()?.at(t.datumIndex);if(e==null)return;const{centerX:i,y:s,width:n,height:o}=e,a={x:i-n/2,y:s,width:n,height:o};return computeBarFocusBounds3(this,a)}},{Path:Path8,ScenePathChangeDetection:ScenePathChangeDetection5,BBox:BBox12}=module_support_exports,OhlcBaseNode=class extends Path8{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:s}=this;return new BBox12(t-i/2,e,i,s)}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:s,strokeAlignment:n}=this;let{centerX:o,yOpen:a,yClose:r}=this,l=o-e/2,c=o+e/2,h=t,d=t+i;if(s&&e>1){o=this.align(o),a=this.align(a),r=this.align(r);const p=this.align(e/2);l=o-p,c=o+p,h=this.align(t),d=h+this.align(h,i)}const u=(h+d)/2;return o+=n,l+=n,c+=n,h-=n,d+=n,a+=a<u?n:-n,r+=r<u?n:-n,{centerX:o,x0:l,x1:c,y0:h,y1:d,yOpen:a,yClose:r}}executeStroke(t,e){const{width:i,strokeWidth:s}=this;i<s&&(t.lineWidth=i),super.executeStroke(t,e)}};__decorateClass([ScenePathChangeDetection5()],OhlcBaseNode.prototype,"centerX",2),__decorateClass([ScenePathChangeDetection5()],OhlcBaseNode.prototype,"y",2),__decorateClass([ScenePathChangeDetection5()],OhlcBaseNode.prototype,"width",2),__decorateClass([ScenePathChangeDetection5()],OhlcBaseNode.prototype,"height",2),__decorateClass([ScenePathChangeDetection5()],OhlcBaseNode.prototype,"yOpen",2),__decorateClass([ScenePathChangeDetection5()],OhlcBaseNode.prototype,"yClose",2),__decorateClass([ScenePathChangeDetection5()],OhlcBaseNode.prototype,"crisp",2),__decorateClass([ScenePathChangeDetection5()],OhlcBaseNode.prototype,"strokeAlignment",2);var OhlcNode=class extends OhlcBaseNode{updatePath(){const{path:t}=this,{centerX:e,x0:i,x1:s,y0:n,y1:o,yOpen:a,yClose:r}=this.alignedCoordinates();t.clear(),t.moveTo(e,n),t.lineTo(e,o),Math.abs(s-i)>1&&(t.moveTo(i,a),t.lineTo(e,a),t.moveTo(e,r),t.lineTo(s,r))}},{ScenePathChangeDetection:ScenePathChangeDetection6,ExtendedPath2D:ExtendedPath2D4,BBox:BBox13}=module_support_exports,CandlestickNode=class extends OhlcBaseNode{constructor(){super(...arguments),this.wickPath=new ExtendedPath2D4,this.wickStroke=void 0,this.wickStrokeWidth=void 0,this.wickStrokeOpacity=void 0}computeDefaultGradientFillBBox(){const{width:t,centerX:e,yOpen:i,yClose:s}=this,n=Math.min(i,s),a=Math.max(i,s)-n,r=e-t/2,l=e+t/2;return new BBox13(r,n,l-r,a)}updatePath(){const{path:t,stroke:e,strokeWidth:i,strokeOpacity:s,lineDash:n,lineDashOffset:o,wickStroke:a,wickStrokeWidth:r,wickStrokeOpacity:l,wickLineDash:c,wickLineDashOffset:h,strokeAlignment:d}=this,{centerX:u,x0:p,x1:g,y0:f,y1:m,yOpen:y,yClose:x}=this.alignedCoordinates();this.path.clear(),this.wickPath.clear();const S=a!=null&&a!==e||r!=null&&r!==i||l!=null&&l!==s||c!=null&&c!==n||h!=null&&h!==o?this.wickPath:t;if(Math.abs(g-p)<=3){S.moveTo(u,f),S.lineTo(u,m);return}const v=Math.min(y,x),I=Math.max(y,x);S.moveTo(u,f),S.lineTo(u,v+i/2),S.moveTo(u,m),S.lineTo(u,I-i/2);const A=d+i/2,D=I-v-2*A;if(D>0)t.rect(p+A,v+A,g-p-2*A,D);else{const T=(v+I)/2;t.moveTo(p,T),t.lineTo(g,T)}}drawPath(t){super.drawPath(t);const{wickPath:e}=this;if(e.isEmpty())return;const{stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,wickStroke:r=i,wickStrokeWidth:l=s,wickStrokeOpacity:c=n,wickLineDash:h=o,wickLineDashOffset:d=a}=this;l!==0&&(t.globalAlpha*=c,typeof r=="string"&&(t.strokeStyle=r),t.lineWidth=l,h!=null&&t.setLineDash(h),t.lineDashOffset=d,t.stroke(e.getPath2D()))}};__decorateClass([ScenePathChangeDetection6()],CandlestickNode.prototype,"wickStroke",2),__decorateClass([ScenePathChangeDetection6()],CandlestickNode.prototype,"wickStrokeWidth",2),__decorateClass([ScenePathChangeDetection6()],CandlestickNode.prototype,"wickStrokeOpacity",2),__decorateClass([ScenePathChangeDetection6()],CandlestickNode.prototype,"wickLineDash",2),__decorateClass([ScenePathChangeDetection6()],CandlestickNode.prototype,"wickLineDashOffset",2);var{BaseProperties:BaseProperties21,TempValidate:TempValidate58,AbstractBarSeriesProperties:AbstractBarSeriesProperties3,SeriesTooltip:SeriesTooltip3,STRING:STRING26,COLOR_STRING:COLOR_STRING11,FUNCTION:FUNCTION8,LINE_DASH:LINE_DASH7,OBJECT:OBJECT25,POSITIVE_NUMBER:POSITIVE_NUMBER17,RATIO:RATIO14}=module_support_exports,OhlcSeriesItem=class extends BaseProperties21{constructor(){super(...arguments),this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};__decorateClass([TempValidate58(COLOR_STRING11)],OhlcSeriesItem.prototype,"stroke",2),__decorateClass([TempValidate58(POSITIVE_NUMBER17)],OhlcSeriesItem.prototype,"strokeWidth",2),__decorateClass([TempValidate58(RATIO14)],OhlcSeriesItem.prototype,"strokeOpacity",2),__decorateClass([TempValidate58(LINE_DASH7)],OhlcSeriesItem.prototype,"lineDash",2),__decorateClass([TempValidate58(POSITIVE_NUMBER17)],OhlcSeriesItem.prototype,"lineDashOffset",2);var OhlcSeriesItems=class extends BaseProperties21{constructor(){super(...arguments),this.up=new OhlcSeriesItem,this.down=new OhlcSeriesItem}};__decorateClass([TempValidate58(OBJECT25)],OhlcSeriesItems.prototype,"up",2),__decorateClass([TempValidate58(OBJECT25)],OhlcSeriesItems.prototype,"down",2);var OhlcSeriesBaseProperties=class extends AbstractBarSeriesProperties3{};__decorateClass([TempValidate58(STRING26)],OhlcSeriesBaseProperties.prototype,"xKey",2),__decorateClass([TempValidate58(STRING26)],OhlcSeriesBaseProperties.prototype,"openKey",2),__decorateClass([TempValidate58(STRING26)],OhlcSeriesBaseProperties.prototype,"closeKey",2),__decorateClass([TempValidate58(STRING26)],OhlcSeriesBaseProperties.prototype,"highKey",2),__decorateClass([TempValidate58(STRING26)],OhlcSeriesBaseProperties.prototype,"lowKey",2),__decorateClass([TempValidate58(STRING26,{optional:!0})],OhlcSeriesBaseProperties.prototype,"xName",2),__decorateClass([TempValidate58(STRING26,{optional:!0})],OhlcSeriesBaseProperties.prototype,"yName",2),__decorateClass([TempValidate58(STRING26,{optional:!0})],OhlcSeriesBaseProperties.prototype,"openName",2),__decorateClass([TempValidate58(STRING26,{optional:!0})],OhlcSeriesBaseProperties.prototype,"closeName",2),__decorateClass([TempValidate58(STRING26,{optional:!0})],OhlcSeriesBaseProperties.prototype,"highName",2),__decorateClass([TempValidate58(STRING26,{optional:!0})],OhlcSeriesBaseProperties.prototype,"lowName",2);var OhlcSeriesProperties=class extends OhlcSeriesBaseProperties{constructor(){super(...arguments),this.tooltip=new SeriesTooltip3,this.item=new OhlcSeriesItems}};__decorateClass([TempValidate58(OBJECT25)],OhlcSeriesProperties.prototype,"tooltip",2),__decorateClass([TempValidate58(OBJECT25)],OhlcSeriesProperties.prototype,"item",2),__decorateClass([TempValidate58(FUNCTION8,{optional:!0})],OhlcSeriesProperties.prototype,"itemStyler",2);var{FillGradientDefaults:FillGradientDefaults3,FillPatternDefaults:FillPatternDefaults3,BaseProperties:BaseProperties22,SeriesTooltip:SeriesTooltip4,TempValidate:TempValidate59,COLOR_STRING:COLOR_STRING12,FUNCTION:FUNCTION9,LINE_DASH:LINE_DASH8,OBJECT:OBJECT26,POSITIVE_NUMBER:POSITIVE_NUMBER18,RATIO:RATIO15,COLOR_GRADIENT:COLOR_GRADIENT3,COLOR_PATTERN:COLOR_PATTERN3,OR:OR7}=module_support_exports,CandlestickSeriesWick=class extends BaseProperties22{};__decorateClass([TempValidate59(COLOR_STRING12,{optional:!0})],CandlestickSeriesWick.prototype,"stroke",2),__decorateClass([TempValidate59(POSITIVE_NUMBER18)],CandlestickSeriesWick.prototype,"strokeWidth",2),__decorateClass([TempValidate59(RATIO15)],CandlestickSeriesWick.prototype,"strokeOpacity",2),__decorateClass([TempValidate59(LINE_DASH8,{optional:!0})],CandlestickSeriesWick.prototype,"lineDash",2),__decorateClass([TempValidate59(POSITIVE_NUMBER18)],CandlestickSeriesWick.prototype,"lineDashOffset",2);var CandlestickSeriesItem=class extends BaseProperties22{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new FillGradientDefaults3,this.fillPatternDefaults=new FillPatternDefaults3,this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.wick=new CandlestickSeriesWick}};__decorateClass([TempValidate59(OR7(COLOR_GRADIENT3,COLOR_PATTERN3,COLOR_STRING12))],CandlestickSeriesItem.prototype,"fill",2),__decorateClass([TempValidate59(OBJECT26)],CandlestickSeriesItem.prototype,"fillGradientDefaults",2),__decorateClass([TempValidate59(OBJECT26)],CandlestickSeriesItem.prototype,"fillPatternDefaults",2),__decorateClass([TempValidate59(RATIO15)],CandlestickSeriesItem.prototype,"fillOpacity",2),__decorateClass([TempValidate59(COLOR_STRING12)],CandlestickSeriesItem.prototype,"stroke",2),__decorateClass([TempValidate59(POSITIVE_NUMBER18)],CandlestickSeriesItem.prototype,"strokeWidth",2),__decorateClass([TempValidate59(RATIO15)],CandlestickSeriesItem.prototype,"strokeOpacity",2),__decorateClass([TempValidate59(LINE_DASH8)],CandlestickSeriesItem.prototype,"lineDash",2),__decorateClass([TempValidate59(POSITIVE_NUMBER18)],CandlestickSeriesItem.prototype,"lineDashOffset",2),__decorateClass([TempValidate59(POSITIVE_NUMBER18)],CandlestickSeriesItem.prototype,"cornerRadius",2),__decorateClass([TempValidate59(OBJECT26)],CandlestickSeriesItem.prototype,"wick",2);var CandlestickSeriesItems=class extends BaseProperties22{constructor(){super(...arguments),this.up=new CandlestickSeriesItem,this.down=new CandlestickSeriesItem}};__decorateClass([TempValidate59(OBJECT26)],CandlestickSeriesItems.prototype,"up",2),__decorateClass([TempValidate59(OBJECT26)],CandlestickSeriesItems.prototype,"down",2);var CandlestickSeriesProperties=class extends OhlcSeriesBaseProperties{constructor(){super(...arguments),this.item=new CandlestickSeriesItems,this.tooltip=new SeriesTooltip4}};__decorateClass([TempValidate59(OBJECT26)],CandlestickSeriesProperties.prototype,"item",2),__decorateClass([TempValidate59(OBJECT26)],CandlestickSeriesProperties.prototype,"tooltip",2),__decorateClass([TempValidate59(FUNCTION9,{optional:!0})],CandlestickSeriesProperties.prototype,"itemStyler",2);var{createDatumId:createDatumId4,isGradientFill:isGradientFill4,isPatternFill:isPatternFill3,applyShapeFillBBox:applyShapeFillBBox3,getShapeFill:getShapeFill2,getShapeStyle:getShapeStyle4}=module_support_exports,CandlestickSeries=class extends OhlcSeriesBase{constructor(){super(...arguments),this.properties=new CandlestickSeriesProperties}nodeFactory(){return new CandlestickNode}updateDatumNodes({datumSelection:t,isHighlight:e}){const{id:i,properties:s}=this,{xKey:n,highKey:o,lowKey:a,openKey:r,closeKey:l,item:c,itemStyler:h}=s,{up:d,down:u}=c,p=getShapeStyle4({fill:d.fill,fillOpacity:d.fillOpacity,stroke:d.stroke,strokeWidth:d.strokeWidth,strokeOpacity:d.strokeOpacity,lineDash:d.lineDash,lineDashOffset:d.lineDashOffset},d.fillGradientDefaults,d.fillPatternDefaults),g=getShapeStyle4({fill:u.fill,fillOpacity:u.fillOpacity,stroke:u.stroke,strokeWidth:u.strokeWidth,strokeOpacity:u.strokeOpacity,lineDash:u.lineDash,lineDashOffset:u.lineDashOffset},u.fillGradientDefaults,u.fillPatternDefaults),f=e?s.highlightStyle.item:void 0;t.each((m,y)=>{const{isRising:x,centerX:b,width:S,y:v,height:I,yOpen:A,yClose:D,crisp:T}=y;let k;if(h!=null){const{fill:R,fillOpacity:E,stroke:_,strokeWidth:G,strokeOpacity:B,lineDash:z,lineDashOffset:P}=x?p:g;k=getShapeStyle4(this.cachedDatumCallback(createDatumId4(this.getDatumId(y),e?"highlight":"node"),()=>this.callWithContext(h,{seriesId:i,itemId:y.itemId,xKey:n,highKey:o,lowKey:a,openKey:r,closeKey:l,datum:y.datum,fill:R,fillOpacity:E,strokeOpacity:B,stroke:_,strokeWidth:G,lineDash:z,lineDashOffset:P,highlighted:e})),x?d.fillGradientDefaults:u.fillGradientDefaults,x?d.fillPatternDefaults:u.fillPatternDefaults)}m.centerX=b,m.width=S,m.y=v,m.height=I,m.yOpen=A,m.yClose=D,m.crisp=T;const w=x?p:g,L=x?d.wick:u.wick,O=f?.fill??k?.fill??w.fill;applyShapeFillBBox3(m,O,this.getShapeFillBBox()),m.fill=f?.fill??k?.fill??w.fill,m.fillOpacity=f?.fillOpacity??k?.fillOpacity??w.fillOpacity,m.stroke=f?.stroke??k?.stroke??w.stroke,m.strokeWidth=f?.strokeWidth??k?.strokeWidth??w.strokeWidth,m.strokeOpacity=f?.strokeOpacity??k?.strokeOpacity??w.strokeOpacity,m.lineDash=f?.lineDash??k?.lineDash??w.lineDash,m.lineDashOffset=f?.lineDashOffset??k?.lineDashOffset??w.lineDashOffset;const F=k?.wick;m.wickStroke=f?.stroke??F?.stroke??L.stroke,m.wickStrokeWidth=f?.strokeWidth??F?.strokeWidth??L.strokeWidth,m.wickStrokeOpacity=f?.strokeOpacity??F?.strokeOpacity??L.strokeOpacity,m.wickLineDash=f?.lineDash??F?.lineDash??L.lineDash,m.wickLineDashOffset=f?.lineDashOffset??F?.lineDashOffset??L.lineDashOffset,m.strokeAlignment=(k?.strokeWidth??w.strokeWidth)/2})}legendItemSymbol(){const{up:t,down:e}=this.properties.item,i=getShapeFill2(t.fill,t.fillGradientDefaults,t.fillPatternDefaults),s=isGradientFill4(i)?i.colorStops.map(l=>typeof l=="string"?l:{color:l.color,stop:l.stop!=null?l.stop*.5:void 0}):[{color:isPatternFill3(i)?t.stroke:i,stop:0},{color:isPatternFill3(i)?t.stroke:i,stop:.5}],n=getShapeFill2(e.fill,e.fillGradientDefaults,e.fillPatternDefaults),o=isGradientFill4(n)?n.colorStops.map(l=>typeof l=="string"?l:{color:l.color,stop:l.stop!=null?l.stop*.5:void 0}):[{color:isPatternFill3(n)?e.stroke:n,stop:.5}],a={type:"gradient",gradient:"linear",rotation:90,colorStops:[...s,...o],reverse:!1},r={type:"gradient",gradient:"linear",rotation:90,colorStops:[{color:t.stroke,stop:0},{color:t.stroke,stop:.5},{color:e.stroke,stop:.5}],reverse:!1};return{marker:{fill:a,fillOpacity:t.fillOpacity,stroke:r,strokeWidth:t.strokeWidth??1,strokeOpacity:t.strokeOpacity??1,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset}}}getLegendData(t){const{id:e,data:i,visible:s,ctx:{legendManager:n}}=this,{xKey:o,yName:a,showInLegend:r,legendItemName:l}=this.properties;return!i?.length||!o||t!=="category"?[]:[{legendType:"category",id:e,itemId:e,seriesId:e,enabled:s&&n.getItemEnabled({seriesId:e,itemId:e}),label:{text:l??a??e},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!r}]}};CandlestickSeries.className="CandleStickSeries",CandlestickSeries.type="candlestick";var{commonSeriesOptionsDefs:commonSeriesOptionsDefs3,tooltipOptionsDefs:tooltipOptionsDefs3}=module_support_exports,candlestickSeriesItemOptionsDef={cornerRadius:positiveNumber,wick:{...strokeOptionsDef,...lineDashOptionsDef},...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},candlestickSeriesOptionsDef={type:required(constant("candlestick")),xKey:required(string),openKey:required(string),highKey:required(string),lowKey:required(string),closeKey:required(string),xName:string,yName:string,openName:string,highName:string,lowName:string,closeName:string,item:{up:candlestickSeriesItemOptionsDef,down:candlestickSeriesItemOptionsDef},itemStyler:callback,showInMiniChart:boolean,tooltip:tooltipOptionsDefs3,...commonSeriesOptionsDefs3};candlestickSeriesOptionsDef.pickOutsideVisibleMinorAxis=boolean,candlestickSeriesOptionsDef.focusPriority=number;var{CARTESIAN_AXIS_TYPE:CARTESIAN_AXIS_TYPE3}=module_support_exports.ThemeConstants;function itemTheme(t){return{fill:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},t==="up"?"transparent":{$palette:"fill"},{$palette:`${t}.fill`}]},stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:`${t}.stroke`}]},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$if:[{$or:[{$isGradient:[{$palette:`${t}.fill`}]},{$isPattern:[{$palette:`${t}.fill`}]}]},{$map:[{$path:["./color",void 0,{$value:"$1"}]},{$path:["./colorStops",void 0,{$palette:`${t}.fill`}]}]},[{$mix:[{$palette:`${t}.fill`},"black",.15]},{$mix:[{$palette:`${t}.fill`},"white",.15]}]]},rotation:0,reverse:!1},fillPatternDefaults:module_support_exports.FILL_PATTERN_DEFAULTS}}var CANDLESTICK_SERIES_THEME={series:{item:{up:itemTheme("up"),down:itemTheme("down")},highlightStyle:{item:{strokeWidth:3}}},animation:{enabled:!1},axes:{[CARTESIAN_AXIS_TYPE3.NUMBER]:{crosshair:{snap:!1}},[CARTESIAN_AXIS_TYPE3.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},{CARTESIAN_AXIS_TYPE:CARTESIAN_AXIS_TYPE4,CARTESIAN_POSITION:CARTESIAN_POSITION2}=module_support_exports.ThemeConstants,CandlestickModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"candlestick",moduleFactory:t=>new CandlestickSeries(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:CARTESIAN_AXIS_TYPE4.NUMBER,position:CARTESIAN_POSITION2.LEFT},{type:CARTESIAN_AXIS_TYPE4.ORDINAL_TIME,position:CARTESIAN_POSITION2.BOTTOM}],themeTemplate:CANDLESTICK_SERIES_THEME,groupable:!1},CandlestickSeriesModule={type:"series",name:"candlestick",chartType:"cartesian",enterprise:!0,options:candlestickSeriesOptionsDef,create:t=>new CandlestickSeries(t)},{CachedTextMeasurerPool:CachedTextMeasurerPool4,TextUtils:TextUtils5,TextWrapper:TextWrapper5}=module_support_exports;function generateLabelSecondaryLabelFontSizeCandidates(t,e){const{fontSize:i,minimumFontSize:s=i}=t,{fontSize:n,minimumFontSize:o=n}=e,a=i-s,r=n-o;let l=t.fontSize,c=e.fontSize;const h=[{labelFontSize:i,secondaryLabelFontSize:n}];for(;l>s||c>o;){const d=a>0?(l-s)/a:-1,u=r>0?(c-o)/r:-1;d>u?l--:c--,h.push({labelFontSize:l,secondaryLabelFontSize:c})}return h.reverse(),h}function getLineHeight(t,e){return t.lineHeight!=null&&t.fontSize!=null?t.lineHeight*e/t.fontSize:TextUtils5.getLineHeight(e)}function formatStackedLabels(t,e,i,s,{padding:n},o){const{spacing:a=0}=e,r=2*n,l=2*n+a,c=(e.minimumFontSize??e.fontSize)+(s.minimumFontSize??s.fontSize);if(c>o(c+l,!1).height-l)return;const h=generateLabelSecondaryLabelFontSizeCandidates(e,s),d={fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight},u={fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight};let p,g;return findMaxValue(0,h.length-1,f=>{const{labelFontSize:m,secondaryLabelFontSize:y}=h[f],x=f===0,b=getLineHeight(e,m),S=getLineHeight(s,y),v=o(b+S+l,x),I=v.width-r,A=v.height-l;if(b+S>A||((p==null||p.fontSize!==m)&&(d.fontSize=m,p=wrapLabel(e,t,I,A,d,e.wrapping,x?e.overflowStrategy:"hide")),p==null||p.width>I||p.height>A)||((g==null||g.fontSize!==y)&&(u.fontSize=y,g=wrapLabel(s,i,I,A,u,s.wrapping,x?s.overflowStrategy:"hide")),g==null))return;const D=p.height+g.height;if(!(g.width>I||D>A))return{width:Math.max(p.width,g.width),height:D+a,meta:v.meta,label:p,secondaryLabel:g}})}function formatSingleLabel(t,e,{padding:i},s){const n=2*i,o=Math.min(e.minimumFontSize??e.fontSize,e.fontSize),a={fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontWeight:e.fontWeight};return findMaxValue(o,e.fontSize,r=>{const l=getLineHeight(e,r),c=r===o,h=s(l+n,c),d=h.width-n,u=h.height-n;if(l>u)return;a.fontSize=r;const p=TextWrapper5.wrapLines(t,{maxWidth:d,maxHeight:u,font:a,textWrap:e.wrapping,overflow:(c?e.overflowStrategy:void 0)??"hide"});if(!p.length)return;const g=clipLines(p,{lineHeight:l,font:a,maxWidth:d,maxHeight:u});if(g)return[{fontSize:r,lineHeight:l,...g},h.meta]})}function hasInvalidFontSize(t){return t?.minimumFontSize!=null&&t?.fontSize!=null&&t?.minimumFontSize>t?.fontSize}function formatLabels(t,e,i,s,n,o){const a=e.enabled?t:void 0,r=s.enabled?i:void 0;(hasInvalidFontSize(e)||hasInvalidFontSize(s))&&logger_exports.warnOnce("minimumFontSize should be set to a value less than or equal to the font size");let l;a!=null&&r!=null&&(l=formatStackedLabels(a,e,r,s,n,o));let c;if(l==null&&a!=null&&(c=formatSingleLabel(a,e,n,o)),c!=null){const[d,u]=c;l={width:d.width,height:d.height,meta:u,label:d,secondaryLabel:void 0}}let h;if(l==null&&a==null&&r!=null&&(h=formatSingleLabel(r,s,n,o)),h!=null){const[d,u]=h;l={width:d.width,height:d.height,meta:u,label:void 0,secondaryLabel:d}}return l}function wrapLabel(t,e,i,s,n,o,a){const r=TextWrapper5.wrapLines(e,{maxWidth:i,maxHeight:s,font:n,textWrap:o,overflow:a});if(!r.length)return;const l=getLineHeight(t,n.fontSize),{width:c}=CachedTextMeasurerPool4.measureLines(r,{font:n});return{width:c,lineHeight:l,text:r.join(`
`),height:r.length*l,fontSize:n.fontSize}}function clipLines(t,{font:e,lineHeight:i=TextUtils5.defaultLineHeight,maxWidth:s,maxHeight:n=1/0}){let o=i*t.length;for(;o>n;){if(t.length===1)return;t.pop(),t[t.length-1]=TextWrapper5.appendEllipsis(t.at(-1)),o=i*t.length}const a=CachedTextMeasurerPool4.measureLines(t,{font:e});let r,l;if(a.width>s){const c=[];l=0;for(const h of a.lineMetrics){if(h.width>s){if(!c.length)return;break}c.push(h.text),l=Math.max(l,h.width)}r=TextWrapper5.appendEllipsis(c.join(`
`))}else r=t.join(`
`),l=a.width;return{text:r,width:l,height:o}}var{TempValidate:TempValidate60,NUMBER:NUMBER15,POSITIVE_NUMBER:POSITIVE_NUMBER19,TEXT_WRAP:TEXT_WRAP2,OVERFLOW_STRATEGY:OVERFLOW_STRATEGY2}=module_support_exports,BaseAutoSizedLabel=class extends module_support_exports.Label{constructor(){super(...arguments),this.wrapping="on-space",this.overflowStrategy="ellipsis"}};__decorateClass([TempValidate60(TEXT_WRAP2)],BaseAutoSizedLabel.prototype,"wrapping",2),__decorateClass([TempValidate60(OVERFLOW_STRATEGY2)],BaseAutoSizedLabel.prototype,"overflowStrategy",2),__decorateClass([TempValidate60(POSITIVE_NUMBER19,{optional:!0})],BaseAutoSizedLabel.prototype,"lineHeight",2),__decorateClass([TempValidate60(POSITIVE_NUMBER19,{optional:!0})],BaseAutoSizedLabel.prototype,"minimumFontSize",2);var AutoSizedLabel=class extends BaseAutoSizedLabel{constructor(){super(...arguments),this.spacing=0}};__decorateClass([TempValidate60(NUMBER15)],AutoSizedLabel.prototype,"spacing",2);var AutoSizedSecondaryLabel=class extends BaseAutoSizedLabel{},{CartesianSeriesProperties:CartesianSeriesProperties2,SeriesTooltip:SeriesTooltip5,TempValidate:TempValidate61,AND:AND6,ARRAY:ARRAY8,COLOR_STRING:COLOR_STRING13,COLOR_STRING_ARRAY:COLOR_STRING_ARRAY4,FUNCTION:FUNCTION10,OBJECT:OBJECT27,POSITIVE_NUMBER:POSITIVE_NUMBER20,RATIO:RATIO16,STRING:STRING27,TEXT_ALIGN:TEXT_ALIGN3,VERTICAL_ALIGN:VERTICAL_ALIGN2}=module_support_exports,HeatmapSeriesProperties=class extends CartesianSeriesProperties2{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 AutoSizedLabel,this.tooltip=new SeriesTooltip5}};__decorateClass([TempValidate61(STRING27,{optional:!0})],HeatmapSeriesProperties.prototype,"title",2),__decorateClass([TempValidate61(STRING27)],HeatmapSeriesProperties.prototype,"xKey",2),__decorateClass([TempValidate61(STRING27)],HeatmapSeriesProperties.prototype,"yKey",2),__decorateClass([TempValidate61(STRING27,{optional:!0})],HeatmapSeriesProperties.prototype,"colorKey",2),__decorateClass([TempValidate61(STRING27,{optional:!0})],HeatmapSeriesProperties.prototype,"xName",2),__decorateClass([TempValidate61(STRING27,{optional:!0})],HeatmapSeriesProperties.prototype,"yName",2),__decorateClass([TempValidate61(STRING27,{optional:!0})],HeatmapSeriesProperties.prototype,"colorName",2),__decorateClass([TempValidate61(AND6(COLOR_STRING_ARRAY4,ARRAY8.restrict({minLength:1})))],HeatmapSeriesProperties.prototype,"colorRange",2),__decorateClass([TempValidate61(COLOR_STRING13,{optional:!0})],HeatmapSeriesProperties.prototype,"stroke",2),__decorateClass([TempValidate61(RATIO16)],HeatmapSeriesProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate61(POSITIVE_NUMBER20,{optional:!0})],HeatmapSeriesProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate61(TEXT_ALIGN3)],HeatmapSeriesProperties.prototype,"textAlign",2),__decorateClass([TempValidate61(VERTICAL_ALIGN2)],HeatmapSeriesProperties.prototype,"verticalAlign",2),__decorateClass([TempValidate61(POSITIVE_NUMBER20)],HeatmapSeriesProperties.prototype,"itemPadding",2),__decorateClass([TempValidate61(FUNCTION10,{optional:!0})],HeatmapSeriesProperties.prototype,"itemStyler",2),__decorateClass([TempValidate61(OBJECT27)],HeatmapSeriesProperties.prototype,"label",2),__decorateClass([TempValidate61(OBJECT27)],HeatmapSeriesProperties.prototype,"tooltip",2);var{SeriesNodePickMode:SeriesNodePickMode4,computeBarFocusBounds:computeBarFocusBounds4,getMissCount:getMissCount2,valueProperty:valueProperty7,ChartAxisDirection:ChartAxisDirection20,DEFAULT_CARTESIAN_DIRECTION_KEYS:DEFAULT_CARTESIAN_DIRECTION_KEYS2,DEFAULT_CARTESIAN_DIRECTION_NAMES:DEFAULT_CARTESIAN_DIRECTION_NAMES2,createDatumId:createDatumId5,ColorScale:ColorScale2,Rect:Rect5,PointerEvents:PointerEvents2,applyShapeStyle:applyShapeStyle2}=module_support_exports,HeatmapSeriesNodeEvent=class extends module_support_exports.CartesianSeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.colorKey=s.properties.colorKey}},textAlignFactors={left:-.5,center:0,right:-.5},verticalAlignFactors={top:-.5,middle:0,bottom:-.5},HeatmapSeries=class extends module_support_exports.CartesianSeries{constructor(t){super({moduleCtx:t,directionKeys:DEFAULT_CARTESIAN_DIRECTION_KEYS2,directionNames:DEFAULT_CARTESIAN_DIRECTION_NAMES2,categoryKey:void 0,pickModes:[SeriesNodePickMode4.NEAREST_NODE,SeriesNodePickMode4.EXACT_SHAPE_MATCH],pathsPerSeries:[],hasMarkers:!1,hasHighlightedLabels:!0}),this.properties=new HeatmapSeriesProperties,this.NodeEvent=HeatmapSeriesNodeEvent,this.colorScale=new ColorScale2}async processData(t){const e=this.axes[ChartAxisDirection20.X],i=this.axes[ChartAxisDirection20.Y];if(!e||!i||!this.properties.isValid()||!this.data?.length)return;const{xKey:s,yKey:n,colorRange:o,colorKey:a}=this.properties,r=this.axes[ChartAxisDirection20.X]?.scale,l=this.axes[ChartAxisDirection20.Y]?.scale,{xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:r,yScale:l}),d=this.colorScale.type,{dataModel:u,processedData:p}=await this.requestDataModel(t,this.data,{props:[valueProperty7(s,c,{id:"xValue"}),valueProperty7(n,h,{id:"yValue"}),...a?[valueProperty7(a,d,{id:"colorValue"})]:[]]});if(this.isColorScaleValid()){const g=u.resolveProcessedDataIndexById(this,"colorValue");this.colorScale.domain=p.domain.values[g],this.colorScale.range=o,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 s=e.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,o=getMissCount2(this,i.defs.values[s].missing);return!(n===0||n===o)}xCoordinateRange(t,e){const i=this.axes[ChartAxisDirection20.X].scale,s=e*(i.bandwidth??0)/2,n=i.convert(t)+s,o=e*(i.bandwidth??10);return[n,n+o]}yCoordinateRange(t,e){const i=this.axes[ChartAxisDirection20.Y].scale,s=e*(i.bandwidth??0)/2,n=i.convert(t[0])+s,o=e*(i.bandwidth??10);return[n,n+o]}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;return!e||!i?[]:t===ChartAxisDirection20.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:s,processedData:n}=this,o=i[ChartAxisDirection20.X],a=i[ChartAxisDirection20.Y];if(!(t&&s&&n&&e&&o&&a))return;if(o.type!=="category"||a.type!=="category"){logger_exports.warnOnce(`Heatmap series expected axes to have "category" type, but received "${o.type}" and "${a.type}" instead.`);return}const{xKey:r,xName:l,yKey:c,yName:h,colorKey:d,colorName:u,textAlign:p,verticalAlign:g,itemPadding:f,label:m}=this.properties,y=s.resolveColumnById(this,"xValue",n),x=s.resolveColumnById(this,"yValue",n),b=d?s.resolveColumnById(this,"colorValue",n):void 0,S=o.scale,v=a.scale,I=(S.bandwidth??0)/2,A=(v.bandwidth??0)/2,D=[],T=[],k=S.bandwidth??10,w=v.bandwidth??10,L=(k-2*f)*textAlignFactors[p],O=(w-2*f)*verticalAlignFactors[g],F=()=>({width:k,height:w,meta:null});return(n.dataSources.get(this.id)??[]).forEach((E,_)=>{const G=y[_],B=x[_],z=S.convert(G)+I,P=v.convert(B)+A,V=b?.[_],j=V==null?void 0:this.getLabelText(m,{value:V,datum:E,colorKey:d,colorName:u,xKey:r,yKey:c,xName:l,yName:h}),H=formatLabels(j,this.properties.label,void 0,this.properties.label,{padding:f},F),Y={x:z,y:P,size:0};if(D.push({series:this,itemId:c,datumIndex:_,yKey:c,xKey:r,xValue:G,yValue:B,colorValue:V,datum:E,point:Y,width:k,height:w,midPoint:{x:z,y:P},missing:b!=null&&V==null}),H?.label!=null){const{text:U,fontSize:$,lineHeight:W,height:X}=H.label,{fontStyle:Z,fontFamily:q,fontWeight:Q,color:tt}=this.properties.label,it=Y.x+L*(k-2*f),J=Y.y+O*(w-2*f)-(H.height-X)*.5;T.push({series:this,itemId:c,datum:E,datumIndex:_,text:U,fontSize:$,lineHeight:W,fontStyle:Z,fontFamily:q,fontWeight:Q,color:tt,textAlign:p,verticalAlign:g,x:it,y:J})}}),{itemId:this.properties.yKey??this.id,nodeData:D,labelData:T,scales:this.calculateScaling(),visible:this.visible}}nodeFactory(){return new Rect5}update(t){return this.ctx.animationManager.skipCurrentBatch(),super.update(t)}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,s=e??[];return i.update(s)}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,s,n){const{id:o,properties:a}=this,{xKey:r,yKey:l,colorRange:c,itemStyler:h}=a,d=this.isColorScaleValid()&&i!=null?this.colorScale.convert(i):c[0];let u=s.fill==null?{fill:d}:void 0;if(h!=null){u??(u={});const p=this.cachedDatumCallback(createDatumId5(t,n?"highlight":"node"),()=>this.callWithContext(h,{seriesId:o,datum:e,xKey:r,yKey:l,highlighted:n,...s,fill:d}));Object.assign(u,p)}return u}updateDatumNodes(t){const{isHighlight:e}=t,i=this.axes[ChartAxisDirection20.X],[s,n]=i?.visibleRange??[],a=!(s!==0||n!==1),r=this.getItemBaseStyle(e);t.datumSelection.each((l,c)=>{const{datumIndex:h,colorValue:d,datum:u,point:p,width:g,height:f}=c,m=this.getItemStyleOverrides(String(h),u,d,r,e);l.crisp=a,l.x=Math.floor(p.x-g/2),l.y=Math.floor(p.y-f/2),l.width=Math.ceil(g),l.height=Math.ceil(f),applyShapeStyle2(l,r,m)})}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t,{enabled:s}=this.properties.label,n=s?e:[];return i.update(n)}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=PointerEvents2.None})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:o,colorScale:a}=this,{xKey:r,xName:l,yKey:c,yName:h,colorKey:d,colorName:u,colorRange:p,title:g,legendItemName:f,tooltip:m}=o,y=n[ChartAxisDirection20.X],x=n[ChartAxisDirection20.Y];if(!i||!s||!y||!x)return;const b=s.dataSources.get(this.id)?.[t],S=i.resolveColumnById(this,"xValue",s)[t],v=i.resolveColumnById(this,"yValue",s)[t],I=d!=null&&this.isColorScaleValid()?i.resolveColumnById(this,"colorValue",s)[t]:void 0;if(S==null)return;const A=[];let D;I==null?D=p[0]:(D=a.convert(I),A.push({label:u,fallbackLabel:d,value:String(I)})),A.push({label:l,fallbackLabel:r,value:y.formatDatum(S)},{label:h,fallbackLabel:c,value:x.formatDatum(v)});const T=this.getItemBaseStyle(!1);Object.assign(T,this.getItemStyleOverrides(String(t),b,I,T,!1)),T.fill!=null&&(D=T.fill);const k=D!=null?{marker:{shape:"square",fill:D,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}}:void 0;return m.formatTooltip(this.properties,{title:g??f,symbol:k,data:A},{seriesId:e,datum:b,title:g,xKey:r,xName:l,yKey:c,yName:h,colorKey:d,colorName:u,...T})}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:s,midPoint:n}=e,o={x:n.x-i/2,y:n.y-s/2,width:i,height:s};return computeBarFocusBounds4(this,o)}};HeatmapSeries.className="HeatmapSeries",HeatmapSeries.type="heatmap";var{commonSeriesOptionsDefs:commonSeriesOptionsDefs4,autoSizedLabelOptionsDefs:autoSizedLabelOptionsDefs2,tooltipOptionsDefs:tooltipOptionsDefs4}=module_support_exports,heatmapSeriesOptionsDef={type:required(constant("heatmap")),xKey:required(string),yKey:required(string),colorKey:string,xName:string,yName:string,colorName:string,colorRange:arrayOf(color),title:string,textAlign:union("left","center","right"),verticalAlign:union("top","middle","bottom"),itemPadding:positiveNumber,itemStyler:callback,showInMiniChart:boolean,label:autoSizedLabelOptionsDefs2,tooltip:tooltipOptionsDefs4,...commonSeriesOptionsDefs4,...strokeOptionsDef},HEATMAP_SERIES_THEME={series:{stroke:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$ref:"backgroundColor"},{$path:["./0",{$palette:"stroke"},{$palette:"strokes"}]}]},colorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},module_support_exports.SAFE_RANGE2_OPERATION]},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}},{ThemeConstants:{CARTESIAN_AXIS_TYPE:CARTESIAN_AXIS_TYPE5,CARTESIAN_POSITION:CARTESIAN_POSITION3}}=module_support_exports,HeatmapModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"heatmap",moduleFactory:t=>new HeatmapSeries(t),tooltipDefaults:{range:"exact"},defaultAxes:[{type:CARTESIAN_AXIS_TYPE5.CATEGORY,position:CARTESIAN_POSITION3.LEFT},{type:CARTESIAN_AXIS_TYPE5.CATEGORY,position:CARTESIAN_POSITION3.BOTTOM}],themeTemplate:HEATMAP_SERIES_THEME},HeatmapSeriesModule={type:"series",name:"heatmap",chartType:"cartesian",enterprise:!0,options:heatmapSeriesOptionsDef,create:t=>new HeatmapSeries(t)},{createDatumId:createDatumId6}=module_support_exports,OhlcSeries=class extends OhlcSeriesBase{constructor(){super(...arguments),this.properties=new OhlcSeriesProperties}nodeFactory(){return new OhlcNode}updateDatumNodes({datumSelection:t,isHighlight:e}){const{id:i,properties:s}=this,{xKey:n,highKey:o,lowKey:a,openKey:r,closeKey:l,item:c,itemStyler:h}=s,{up:d,down:u}=c,{stroke:p,strokeWidth:g,strokeOpacity:f,lineDash:m,lineDashOffset:y}=d,{stroke:x,strokeWidth:b,strokeOpacity:S,lineDash:v,lineDashOffset:I}=u,A=e?s.highlightStyle.item:void 0;t.each((D,T)=>{const{isRising:k,centerX:w,width:L,y:O,height:F,yOpen:R,yClose:E,crisp:_}=T;let G;if(h!=null){const{stroke:B,strokeWidth:z,strokeOpacity:P,lineDash:V,lineDashOffset:j}=k?d:u;G=this.cachedDatumCallback(createDatumId6(this.getDatumId(T),e?"highlight":"node"),()=>this.callWithContext(h,{seriesId:i,itemId:T.itemId,xKey:n,highKey:o,lowKey:a,openKey:r,closeKey:l,datum:T.datum,strokeOpacity:P,stroke:B,strokeWidth:z,lineDash:V,lineDashOffset:j,highlighted:e}))}D.centerX=w,D.width=L,D.y=O,D.height=F,D.yOpen=R,D.yClose=E,D.crisp=_,D.stroke=A?.stroke??G?.stroke??(k?p:x),D.strokeWidth=A?.strokeWidth??G?.strokeWidth??(k?g:b),D.strokeOpacity=A?.strokeOpacity??G?.strokeOpacity??(k?f:S),D.lineDash=A?.lineDash??G?.lineDash??(k?m:v),D.lineDashOffset=A?.lineDashOffset??G?.lineDashOffset??(k?y:I),D.strokeAlignment=(G?.strokeWidth??(k?g:b))/2})}getLegendData(t){const{id:e,data:i,ctx:{legendManager:s},visible:n}=this,{xKey:o,yName:a,item:{up:r,down:l},showInLegend:c,legendItemName:h}=this.properties;if(!i?.length||!o||t!=="category")return[];const d={type:"gradient",gradient:"linear",colorSpace:"rgb",colorStops:[{color:r.stroke,stop:0},{color:r.stroke,stop:.5},{color:l.stroke,stop:.5}],rotation:90};return[{legendType:"category",id:e,itemId:e,seriesId:e,enabled:n&&s.getItemEnabled({seriesId:e,itemId:e}),label:{text:h??a??e},symbol:{marker:{fill:d,fillOpacity:r.strokeOpacity,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}},legendItemName:h,hideInLegend:!c}]}};OhlcSeries.className="ohlc",OhlcSeries.type="ohlc";var{commonSeriesOptionsDefs:commonSeriesOptionsDefs5,tooltipOptionsDefs:tooltipOptionsDefs5}=module_support_exports,ohlcSeriesItemOptionsDef={...strokeOptionsDef,...lineDashOptionsDef},ohlcSeriesOptionsDef={type:required(constant("ohlc")),xKey:required(string),openKey:required(string),highKey:required(string),lowKey:required(string),closeKey:required(string),xName:string,yName:string,openName:string,highName:string,lowName:string,closeName:string,showInMiniChart:boolean,itemStyler:callback,item:{up:ohlcSeriesItemOptionsDef,down:ohlcSeriesItemOptionsDef},tooltip:tooltipOptionsDefs5,...commonSeriesOptionsDefs5};ohlcSeriesOptionsDef.pickOutsideVisibleMinorAxis=boolean,ohlcSeriesOptionsDef.focusPriority=number;var{CARTESIAN_AXIS_TYPE:CARTESIAN_AXIS_TYPE6,CARTESIAN_POSITION:CARTESIAN_POSITION4}=module_support_exports.ThemeConstants,OhlcModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"ohlc",moduleFactory:t=>new OhlcSeries(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:CARTESIAN_AXIS_TYPE6.NUMBER,position:CARTESIAN_POSITION4.LEFT},{type:CARTESIAN_AXIS_TYPE6.ORDINAL_TIME,position:CARTESIAN_POSITION4.BOTTOM}],themeTemplate:{animation:{enabled:!1},series:{item:{up:{stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:"up.stroke"}]}},down:{stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:"down.stroke"}]}}}},axes:{[CARTESIAN_AXIS_TYPE6.NUMBER]:{crosshair:{snap:!1}},[CARTESIAN_AXIS_TYPE6.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},groupable:!1},OhlcSeriesModule={type:"series",name:"ohlc",chartType:"cartesian",enterprise:!0,options:ohlcSeriesOptionsDef,create:t=>new OhlcSeries(t)},AGGREGATION_THRESHOLD2=1e3;function aggregationContainsTopIndex(t,e,i,s,n,o){const a=t[o];if(a==null)return!1;const r=xRatioForDatumIndex(a,e,i),l=aggregationIndexForXRatio(r,n);return o===s[l+Y_MAX2]}function aggregationContainsBottomIndex(t,e,i,s,n,o){const a=t[o];if(a==null)return!1;const r=xRatioForDatumIndex(a,e,i),l=aggregationIndexForXRatio(r,n);return o===s[l+Y_MIN2]}function aggregateData(t,e,i,s){if(t.length<AGGREGATION_THRESHOLD2)return;const[n,o]=aggregationDomain(s);let a=maxRangeFittingPoints(t);const{indexData:r,valueData:l}=createAggregationIndices(t,e,i,n,o,a);let c=[],h=[];for(let u=0;u<t.length;u+=1)aggregationContainsTopIndex(t,n,o,r,a,u)&&c.push(u),aggregationContainsBottomIndex(t,n,o,r,a,u)&&h.push(u);const d=[{maxRange:a,topIndices:c,bottomIndices:h}];for(;a>64;)({maxRange:a}=compactAggregationIndices(r,l,a,{inPlace:!0})),c=c.filter(aggregationContainsTopIndex.bind(null,t,n,o,r,a)),h=h.filter(aggregationContainsBottomIndex.bind(null,t,n,o,r,a)),d.push({maxRange:a,topIndices:c,bottomIndices:h});return d.reverse(),d}var{CartesianSeriesProperties:CartesianSeriesProperties3,FillGradientDefaults:FillGradientDefaults4,FillPatternDefaults:FillPatternDefaults4,InterpolationProperties:InterpolationProperties2,SeriesMarker:SeriesMarker2,SeriesTooltip:SeriesTooltip6,TempValidate:TempValidate62,BOOLEAN:BOOLEAN28,COLOR_STRING:COLOR_STRING14,LINE_DASH:LINE_DASH9,OBJECT:OBJECT28,PLACEMENT:PLACEMENT3,POSITIVE_NUMBER:POSITIVE_NUMBER21,COLOR_GRADIENT:COLOR_GRADIENT4,COLOR_PATTERN:COLOR_PATTERN4,OR:OR8,RATIO:RATIO17,STRING:STRING28,DropShadow:DropShadow2,Label:Label4}=module_support_exports,RangeAreaSeriesLabel=class extends Label4{constructor(){super(...arguments),this.placement="outside",this.padding=6}};__decorateClass([TempValidate62(PLACEMENT3)],RangeAreaSeriesLabel.prototype,"placement",2),__decorateClass([TempValidate62(POSITIVE_NUMBER21)],RangeAreaSeriesLabel.prototype,"padding",2);var RangeAreaProperties=class extends CartesianSeriesProperties3{constructor(){super(...arguments),this.fill="#99CCFF",this.fillGradientDefaults=new FillGradientDefaults4,this.fillPatternDefaults=new FillPatternDefaults4,this.fillOpacity=1,this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new InterpolationProperties2,this.shadow=new DropShadow2().set({enabled:!1}),this.marker=new SeriesMarker2,this.label=new RangeAreaSeriesLabel,this.tooltip=new SeriesTooltip6,this.connectMissingData=!1}};__decorateClass([TempValidate62(STRING28)],RangeAreaProperties.prototype,"xKey",2),__decorateClass([TempValidate62(STRING28)],RangeAreaProperties.prototype,"yLowKey",2),__decorateClass([TempValidate62(STRING28)],RangeAreaProperties.prototype,"yHighKey",2),__decorateClass([TempValidate62(STRING28,{optional:!0})],RangeAreaProperties.prototype,"xName",2),__decorateClass([TempValidate62(STRING28,{optional:!0})],RangeAreaProperties.prototype,"yName",2),__decorateClass([TempValidate62(STRING28,{optional:!0})],RangeAreaProperties.prototype,"yLowName",2),__decorateClass([TempValidate62(STRING28,{optional:!0})],RangeAreaProperties.prototype,"yHighName",2),__decorateClass([TempValidate62(OR8(COLOR_GRADIENT4,COLOR_PATTERN4,COLOR_STRING14))],RangeAreaProperties.prototype,"fill",2),__decorateClass([TempValidate62(OBJECT28)],RangeAreaProperties.prototype,"fillGradientDefaults",2),__decorateClass([TempValidate62(OBJECT28)],RangeAreaProperties.prototype,"fillPatternDefaults",2),__decorateClass([TempValidate62(RATIO17)],RangeAreaProperties.prototype,"fillOpacity",2),__decorateClass([TempValidate62(COLOR_STRING14)],RangeAreaProperties.prototype,"stroke",2),__decorateClass([TempValidate62(POSITIVE_NUMBER21)],RangeAreaProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate62(RATIO17)],RangeAreaProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate62(LINE_DASH9)],RangeAreaProperties.prototype,"lineDash",2),__decorateClass([TempValidate62(POSITIVE_NUMBER21)],RangeAreaProperties.prototype,"lineDashOffset",2),__decorateClass([TempValidate62(OBJECT28)],RangeAreaProperties.prototype,"interpolation",2),__decorateClass([TempValidate62(OBJECT28)],RangeAreaProperties.prototype,"shadow",2),__decorateClass([TempValidate62(OBJECT28)],RangeAreaProperties.prototype,"marker",2),__decorateClass([TempValidate62(OBJECT28)],RangeAreaProperties.prototype,"label",2),__decorateClass([TempValidate62(OBJECT28)],RangeAreaProperties.prototype,"tooltip",2),__decorateClass([TempValidate62(BOOLEAN28)],RangeAreaProperties.prototype,"connectMissingData",2);var{CollapseMode:CollapseMode2,isScaleValid:isScaleValid2,pairUpSpans:pairUpSpans2,prepareAreaFillAnimationFns:prepareAreaFillAnimationFns2,plotInterpolatedLinePathStroke:plotInterpolatedLinePathStroke2,prepareLinePathPropertyAnimation:prepareLinePathPropertyAnimation2,areScalingEqual:areScalingEqual2}=module_support_exports;function prepareRangeAreaPathStrokeAnimationFns(t,e,i,s){const n=(l,c)=>{plotInterpolatedLinePathStroke2(l,c,e.removed),plotInterpolatedLinePathStroke2(l,c,i.removed)},o=(l,c)=>{plotInterpolatedLinePathStroke2(l,c,e.moved),plotInterpolatedLinePathStroke2(l,c,i.moved)},a=(l,c)=>{plotInterpolatedLinePathStroke2(l,c,e.added),plotInterpolatedLinePathStroke2(l,c,i.added)},r=prepareLinePathPropertyAnimation2(t,s);return{status:t,path:{addPhaseFn:a,updatePhaseFn:o,removePhaseFn:n},pathProperties:r}}function prepareRangeAreaPathAnimation(t,e,i){const s=t.scales.x?.type==="category",n=e.scales.x?.type==="category";if(s!==n||!isScaleValid2(t.scales.x)||!isScaleValid2(e.scales.x))return;let o="updated";e.visible&&!t.visible?o="removed":!e.visible&&t.visible&&(o="added");const a=pairUpSpans2({scales:t.scales,data:t.fillData.spans},{scales:e.scales,data:e.fillData.spans},CollapseMode2.Split);if(a==null)return;const r=pairUpSpans2({scales:t.scales,data:t.fillData.phantomSpans},{scales:e.scales,data:e.fillData.phantomSpans},CollapseMode2.Split);if(r==null)return;const l=pairUpSpans2({scales:t.scales,data:t.highStrokeData.spans},{scales:e.scales,data:e.highStrokeData.spans},CollapseMode2.Split);if(l==null)return;const c=pairUpSpans2({scales:t.scales,data:t.lowStrokeData.spans},{scales:e.scales,data:e.lowStrokeData.spans},CollapseMode2.Split);if(c==null)return;const h="fade",d=prepareAreaFillAnimationFns2(o,a,r,h),u=prepareRangeAreaPathStrokeAnimationFns(o,l,c,h),p=(i?.changed??!0)||!areScalingEqual2(t.scales.x,e.scales.x)||!areScalingEqual2(t.scales.y,e.scales.y)||o!=="updated";return{status:o,fill:d,stroke:u,hasMotion:p}}var{valueProperty:valueProperty8,keyProperty:keyProperty5,ChartAxisDirection:ChartAxisDirection21,mergeDefaults:mergeDefaults6,updateLabelNode:updateLabelNode2,fixNumericExtent:fixNumericExtent5,buildResetPathFn:buildResetPathFn2,resetLabelFn:resetLabelFn2,resetMarkerFn:resetMarkerFn2,resetMarkerPositionFn:resetMarkerPositionFn2,pathSwipeInAnimation:pathSwipeInAnimation2,resetMotion:resetMotion2,markerSwipeScaleInAnimation:markerSwipeScaleInAnimation2,seriesLabelFadeInAnimation:seriesLabelFadeInAnimation2,animationValidation:animationValidation4,diff:diff4,updateClipPath:updateClipPath2,computeMarkerFocusBounds:computeMarkerFocusBounds2,plotAreaPathFill:plotAreaPathFill2,plotLinePathStroke:plotLinePathStroke2,interpolatePoints:interpolatePoints2,pathFadeInAnimation:pathFadeInAnimation2,markerFadeInAnimation:markerFadeInAnimation2,fromToMotion:fromToMotion2,pathMotion:pathMotion2,extent:extent2,createDatumId:createDatumId7,applyShapeFillBBox:applyShapeFillBBox4,PointerEvents:PointerEvents3,Group:Group10,BBox:BBox14,ContinuousScale:ContinuousScale7,OrdinalTimeScale:OrdinalTimeScale4,findMinMax:findMinMax4,getShapeStyle:getShapeStyle5,getShapeFill:getShapeFill3}=module_support_exports,RangeAreaSeriesNodeEvent=class extends module_support_exports.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.xKey=s.properties.xKey,this.yLowKey=s.properties.yLowKey,this.yHighKey=s.properties.yHighKey}},RangeAreaSeries=class extends module_support_exports.CartesianSeries{constructor(t){super({moduleCtx:t,hasMarkers:!0,pathsPerSeries:["fill","stroke"],pickModes:[module_support_exports.SeriesNodePickMode.AXIS_ALIGNED],directionKeys:{[ChartAxisDirection21.X]:["xKey"],[ChartAxisDirection21.Y]:["yLowKey","yHighKey"]},directionNames:{[ChartAxisDirection21.X]:["xName"],[ChartAxisDirection21.Y]:["yLowName","yHighName","yName"]},categoryKey:"xValue",animationResetFns:{path:buildResetPathFn2({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:resetLabelFn2,marker:(e,i)=>({...resetMarkerFn2(e),...resetMarkerPositionFn2(e,i)})},clipFocusBox:!1}),this.properties=new RangeAreaProperties,this.NodeEvent=RangeAreaSeriesNodeEvent,this.dataAggregationFilters=void 0}async processData(t){if(!this.properties.isValid())return;const{xKey:e,yLowKey:i,yHighKey:s}=this.properties,n=this.axes[ChartAxisDirection21.X]?.scale,o=this.axes[ChartAxisDirection21.Y]?.scale,{xScaleType:a,yScaleType:r}=this.getScaleInformation({xScale:n,yScale:o}),l=[],c=!this.ctx.animationManager.isSkipped();!this.ctx.animationManager.isSkipped()&&this.processedData&&l.push(diff4(this.id,this.processedData)),c&&l.push(animationValidation4());const{dataModel:h,processedData:d}=await this.requestDataModel(t,this.data,{props:[keyProperty5(e,a,{id:"xValue"}),valueProperty8(i,r,{id:"yLowValue"}),valueProperty8(s,r,{id:"yHighValue"}),...l]});this.dataAggregationFilters=this.aggregateData(h,d),this.animationState.transition("updateData")}aggregateData(t,e){const i=this.axes[ChartAxisDirection21.X];if(i==null||!(ContinuousScale7.is(i.scale)||OrdinalTimeScale4.is(i.scale)))return;const s=t.resolveKeysById(this,"xValue",e),n=t.resolveColumnById(this,"yHighValue",e),o=t.resolveColumnById(this,"yLowValue",e),{index:a}=t.resolveProcessedDataDefById(this,"xValue"),r=e.domain.keys[a];return aggregateData(s,n,o,r)}xCoordinateRange(t){const e=this.axes[ChartAxisDirection21.X].scale.convert(t);return[e,e]}yCoordinateRange(t){const e=this.axes[ChartAxisDirection21.Y].scale.convert(t[0]);return[e,e]}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!(e&&i))return[];const{domain:{keys:[s]}}=e;if(t===ChartAxisDirection21.X){const n=i.resolveProcessedDataDefById(this,"xValue");return n?.def.type==="key"&&n.def.valueType==="category"?s:fixNumericExtent5(extent2(s))}else{const n=this.domainForClippedRange(ChartAxisDirection21.Y,["yHighValue","yLowValue"],"xValue",!0),o=findMinMax4(n);return fixNumericExtent5(o)}}getSeriesRange(t,e){return this.domainForVisibleRange(ChartAxisDirection21.Y,["yHighValue","yLowValue"],"xValue",e,!0)}createNodeData(){const{data:t,dataModel:e,processedData:i,axes:s}=this,n=s[ChartAxisDirection21.X],o=s[ChartAxisDirection21.Y];if(!(t&&n&&o&&e&&i))return;const a=n.scale,r=o.scale,{xKey:l,yLowKey:c,yHighKey:h,connectMissingData:d,marker:u,interpolation:p}=this.properties,g=i.dataSources.get(this.id)??[],f=(a.bandwidth??0)/2,m=e.resolveKeysById(this,"xValue",i),y=e.resolveColumnById(this,"yHighValue",i),x=e.resolveColumnById(this,"yLowValue",i),b=z=>a.convert(m[z])+f,S=[],v=[],I=[],A=(z,P,V)=>{const j=g[z],H=m[z];if(H==null)return;const Y=I[I.length-1];if(Number.isFinite(P)&&Number.isFinite(V)){const U=(tt,it,J)=>{v.push({index:z,series:this,itemId:tt,datum:j,datumIndex:z,midPoint:{x:W,y:J},yHighValue:P,yLowValue:V,xValue:H,xKey:l,yLowKey:c,yHighKey:h,point:{x:W,y:J,size:q},enabled:!0});const at=this.createLabelData({datumIndex:z,point:{x:W,y:J},value:it,yLowValue:V,yHighValue:P,itemId:tt,inverted:$,datum:j,series:this});S.push(at)},$=V>P,W=b(z),X=r.convert(P),Z=r.convert(V),{size:q}=u;U("high",P,X),U("low",V,Z);const Q={high:{point:{x:W,y:X},xDatum:H,yDatum:P},low:{point:{x:W,y:Z},xDatum:H,yDatum:V}};Array.isArray(Y)?Y.push(Q):Y!=null?(Y.skip+=1,I.push([Q])):I.push([Q])}else d||(Array.isArray(Y)||Y==null?I.push({skip:0}):Y.skip+=1)},{dataAggregationFilters:D}=this,[T,k]=a.range,w=k-T,L=D?.find(z=>z.maxRange>w),O=L?.topIndices,F=L?.bottomIndices;let[R,E]=this.visibleRange("xValue",n.range,O);R=Math.max(R-1,0),E=Math.min(E+1,O?.length??m.length),i.input.count<1e3&&(R=0,E=i.input.count);for(let z=R;z<E;z+=1){const P=O?.[z]??z,V=F?.[z]??z;A(P,y[P],x[V])}const _=I.flatMap(z=>{if(!Array.isArray(z))return[];const P=z.map(V=>V.high);return interpolatePoints2(P,p)}),G=I.flatMap(z=>{if(!Array.isArray(z))return[];const P=z.map(V=>V.low);return interpolatePoints2(P,p)});return{itemId:`${c}-${h}`,labelData:S,nodeData:v,fillData:{itemId:"high",spans:_,phantomSpans:G},highStrokeData:{itemId:"high",spans:_},lowStrokeData:{itemId:"low",spans:G},scales:this.calculateScaling(),visible:this.visible}}createLabelData({datumIndex:t,point:e,value:i,itemId:s,inverted:n,datum:o,series:a}){const{xKey:r,yLowKey:l,yHighKey:c,xName:h,yName:d,yLowName:u,yHighName:p,label:g}=this.properties,{placement:f,padding:m=10}=g;let y=s;n&&(y=s==="low"?"high":"low");const x=f==="outside"&&y==="high"||f==="inside"&&y==="low"?-1:1;return{x:e.x,y:e.y+m*x,series:a,itemId:s,datum:o,datumIndex:t,text:this.getLabelText(g,{value:i,datum:o,itemId:s,xKey:r,yLowKey:l,yHighKey:c,xName:h,yLowName:u,yHighName:p,yName:d}),textAlign:"center",textBaseline:x===-1?"bottom":"top"}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(t){const{opacity:e,visible:i,animationEnabled:s}=t,[n,o]=t.paths,a=this.getStrokeWidth(this.properties.strokeWidth);o.setProperties({fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:PointerEvents3.None,stroke:this.properties.stroke,strokeWidth:a,strokeOpacity:this.properties.strokeOpacity,lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,opacity:e,visible:i||s});const r=getShapeFill3(this.properties.fill,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults),l=this.getShapeFillBBox();applyShapeFillBBox4(n,r,l),n.setProperties({stroke:void 0,lineJoin:"round",pointerEvents:PointerEvents3.None,fill:r,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||s}),updateClipPath2(this,o),updateClipPath2(this,n)}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("RangeArea")}updateFillPath(t,e){const[i]=t;i.path.clear(),plotAreaPathFill2(i,e.fillData),i.markDirty("RangeArea")}updateStrokePath(t,e){const[,i]=t;i.path.clear(),plotLinePathStroke2(i,e.highStrokeData.spans),plotLinePathStroke2(i,e.lowStrokeData.spans),i.markDirty("RangeArea")}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,s=t?e.highlightStyle.item:void 0;return{shape:i.shape,size:i.size,fill:s?.fill??i.fill,fillOpacity:s?.fillOpacity??i.fillOpacity,stroke:s?.stroke??i.stroke,strokeWidth:s?.strokeWidth??this.getStrokeWidth(i.strokeWidth),strokeOpacity:s?.strokeOpacity??i.strokeOpacity,lineDash:s?.lineDash??i.lineDash,lineDashOffset:s?.lineDashOffset??i.lineDashOffset}}getMarkerItemStyleOverrides(t,e,i,s){const{id:n,properties:o}=this,{xKey:a,yHighKey:r,yLowKey:l,marker:c}=o,{itemStyler:h}=c;if(h!=null)return this.cachedDatumCallback(createDatumId7(t,s?"highlight":"node"),()=>this.callWithContext(h,{seriesId:n,datum:e,xKey:a,yHighKey:r,yLowKey:l,highlighted:s,...i}))}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yLowKey:n,yHighKey:o,marker:a,fill:r,stroke:l,strokeWidth:c,fillOpacity:h,strokeOpacity:d}=this.properties,u=mergeDefaults6(i&&this.properties.highlightStyle.item,a.getStyle(),{fill:r,fillOpacity:h,stroke:l,strokeWidth:c,strokeOpacity:d}),p=this.getShapeFillBBox();e.each((g,f)=>{this.updateMarkerStyle(a,g,f.datum,f.point,{xKey:s,yHighKey:o,yLowKey:n},i,u,p)}),i||this.properties.marker.markClean()}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e,s=>{s.pointerEvents=PointerEvents3.None})}updateLabelNodes(t){t.labelSelection.each((e,i)=>{updateLabelNode2(e,this.properties.label,i)})}getHighlightLabelData(t,e){const i=t.filter(s=>s.datum===e.datum);return i.length>0?i:void 0}getHighlightData(t,e){const i=t.filter(s=>s.datum===e.datum);return i.length>0?i:void 0}getTooltipContent(t,e){const{id:i,dataModel:s,processedData:n,axes:o,properties:a}=this,{xName:r,yName:l,yLowKey:c,yLowName:h,xKey:d,yHighKey:u,yHighName:p,tooltip:g}=a,f=o[ChartAxisDirection21.X],m=o[ChartAxisDirection21.Y];if(!s||!n||!f||!m)return;const y=n.dataSources.get(this.id)?.[t],x=s.resolveKeysById(this,"xValue",n)[t],b=s.resolveColumnById(this,"yHighValue",n)[t],S=s.resolveColumnById(this,"yLowValue",n)[t];if(x==null)return;const v=this.getMarkerItemBaseStyle(!1);Object.assign(v,this.getMarkerItemStyleOverrides(String(t),t,v,!1));const I=`${m.formatDatum(S)} - ${m.formatDatum(b)}`;return g.formatTooltip(this.properties,{heading:f.formatDatum(x),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:`${h??c} - ${p??u}`,value:I}]},{seriesId:i,datum:y,title:l,itemId:e?.itemId??"unknown",xName:r,yName:l,yLowKey:c,yLowName:h,xKey:d,yHighKey:u,yHighName:p,...v})}legendItemSymbol(){const{fill:t,stroke:e,strokeWidth:i,strokeOpacity:s,lineDash:n,marker:o}=this.properties;return{marker:getShapeStyle5({shape:o.shape,fill:o.fill??t,stroke:o.stroke??e,fillOpacity:o.fillOpacity,strokeOpacity:o.strokeOpacity,strokeWidth:o.strokeWidth,lineDash:o.lineDash,lineDashOffset:o.lineDashOffset},o.fillGradientDefaults,o.fillPatternDefaults),line:{stroke:e,strokeOpacity:s,strokeWidth:i,lineDash:n}}}getLegendData(t){if(t!=="category")return[];const{id:e,visible:i}=this,{yLowKey:s,yHighKey:n,yName:o,yLowName:a,yHighName:r,showInLegend:l}=this.properties,c=o??`${a??s} - ${r??n}`,h=`${s}-${n}`;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 Group10}animateEmptyUpdateReady(t){const{markerSelection:e,labelSelection:i,contextData:s,paths:n}=t,{animationManager:o}=this.ctx;this.updateAreaPaths(n,s),pathSwipeInAnimation2(this,o,...n),resetMotion2([e],resetMarkerPositionFn2),markerSwipeScaleInAnimation2(this,o,e),seriesLabelFadeInAnimation2(this,"labels",o,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:s,contextData:n,paths:o,previousContextData:a}=t,[r,l]=o;if(r==null&&l==null)return;this.resetMarkerAnimation(t),this.resetLabelAnimation(t);const c=()=>{this.resetPathAnimation(t),this.updateAreaPaths(o,n)},h=()=>{e.skipCurrentBatch(),c()};if(n==null||a==null){c(),markerFadeInAnimation2(this,e,"added",i),pathFadeInAnimation2(this,"fill_path_properties",e,"add",r),pathFadeInAnimation2(this,"stroke_path_properties",e,"add",l),seriesLabelFadeInAnimation2(this,"labels",e,s);return}const d=prepareRangeAreaPathAnimation(n,a,this.processedData?.reduced?.diff?.[this.id]);if(d===void 0){h();return}else if(d.status==="no-op")return;fromToMotion2(this.id,"fill_path_properties",e,[r],d.fill.pathProperties),fromToMotion2(this.id,"stroke_path_properties",e,[l],d.stroke.pathProperties),d.status==="added"?this.updateAreaPaths(o,n):d.status==="removed"?this.updateAreaPaths(o,a):(pathMotion2(this.id,"fill_path_update",e,[r],d.fill.path),pathMotion2(this.id,"stroke_path_update",e,[l],d.stroke.path)),d.hasMotion&&(markerFadeInAnimation2(this,e,void 0,i),seriesLabelFadeInAnimation2(this,"labels",e,s)),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(o,n)})}getFormattedMarkerStyle(t){const{xKey:e,yLowKey:i,yHighKey:s}=this.properties;return this.getMarkerStyle(this.properties.marker,t.datum,{xKey:e,yLowKey:i,yHighKey:s},!0)}computeFocusBounds(t){const e=computeMarkerFocusBounds2(this,t),i=computeMarkerFocusBounds2(this,{...t,datumIndex:t.datumIndex+1});if(e&&i)return BBox14.merge([e,i])}isDatumEnabled(t,e){return e%2===0&&super.isDatumEnabled(t,e)}};RangeAreaSeries.className="RangeAreaSeries",RangeAreaSeries.type="range-area";var{commonSeriesOptionsDefs:commonSeriesOptionsDefs6,interpolationValidator:interpolationValidator2,markerOptionsDefs:markerOptionsDefs2,seriesLabelOptionsDefs:seriesLabelOptionsDefs2,shadowOptionsDefs:shadowOptionsDefs2,tooltipOptionsDefs:tooltipOptionsDefs6}=module_support_exports,rangeAreaSeriesOptionsDef={type:required(constant("range-area")),xKey:required(string),yLowKey:required(string),yHighKey:required(string),xName:string,yName:string,yLowName:string,yHighName:string,showInMiniChart:boolean,connectMissingData:boolean,interpolation:interpolationValidator2,label:{...seriesLabelOptionsDefs2,padding:positiveNumber,placement:union("inside","outside")},marker:markerOptionsDefs2,tooltip:tooltipOptionsDefs6,shadow:shadowOptionsDefs2,...commonSeriesOptionsDefs6,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef};rangeAreaSeriesOptionsDef.pickOutsideVisibleMinorAxis=boolean,rangeAreaSeriesOptionsDef.focusPriority=number;var RANGE_AREA_SERIES_THEME={series:{fill:{$palette:"fill"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:module_support_exports.FILL_PATTERN_DEFAULTS,stroke:{$palette:"stroke"},fillOpacity:.7,nodeClickRange:"nearest",marker:{enabled:!1,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:module_support_exports.FILL_PATTERN_DEFAULTS,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"}},axes:{[module_support_exports.ThemeConstants.CARTESIAN_AXIS_TYPE.NUMBER]:{crosshair:{enabled:!0}}}},{ThemeConstants:{CARTESIAN_AXIS_TYPE:CARTESIAN_AXIS_TYPE7,CARTESIAN_POSITION:CARTESIAN_POSITION5}}=module_support_exports,RangeAreaModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"range-area",moduleFactory:t=>new RangeAreaSeries(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:CARTESIAN_AXIS_TYPE7.NUMBER,position:CARTESIAN_POSITION5.LEFT},{type:CARTESIAN_AXIS_TYPE7.CATEGORY,position:CARTESIAN_POSITION5.BOTTOM}],themeTemplate:RANGE_AREA_SERIES_THEME},RangeAreaSeriesModule={type:"series",name:"range-area",chartType:"cartesian",enterprise:!0,options:rangeAreaSeriesOptionsDef,create:t=>new RangeAreaSeries(t)},AGGREGATION_THRESHOLD3=1e3,PRECISION=5;function aggregateRangeBarData(t,e,i,s){if(t.length<AGGREGATION_THRESHOLD3)return;const[n,o]=aggregationDomain(s);let a=maxRangeFittingPoints(t,PRECISION),{indexData:r,valueData:l}=createAggregationIndices(t,e,i,n,o,a);const c=[{maxRange:a,indexData:r}];for(;a>64;)({indexData:r,valueData:l,maxRange:a}=compactAggregationIndices(r,l,a)),c.push({maxRange:a,indexData:r});return c.reverse(),c}var{AbstractBarSeriesProperties:AbstractBarSeriesProperties4,FillGradientDefaults:FillGradientDefaults5,FillPatternDefaults:FillPatternDefaults5,SeriesTooltip:SeriesTooltip7,TempValidate:TempValidate63,COLOR_STRING:COLOR_STRING15,FUNCTION:FUNCTION11,LINE_DASH:LINE_DASH10,OBJECT:OBJECT29,PLACEMENT:PLACEMENT4,POSITIVE_NUMBER:POSITIVE_NUMBER22,RATIO:RATIO18,STRING:STRING29,BOOLEAN:BOOLEAN29,COLOR_GRADIENT:COLOR_GRADIENT5,COLOR_PATTERN:COLOR_PATTERN5,OR:OR9,DropShadow:DropShadow3,Label:Label5}=module_support_exports,RangeBarSeriesLabel=class extends Label5{constructor(){super(...arguments),this.placement="inside",this.padding=6}};__decorateClass([TempValidate63(PLACEMENT4)],RangeBarSeriesLabel.prototype,"placement",2),__decorateClass([TempValidate63(POSITIVE_NUMBER22)],RangeBarSeriesLabel.prototype,"padding",2);var RangeBarProperties=class extends AbstractBarSeriesProperties4{constructor(){super(...arguments),this.fill="#99CCFF",this.fillGradientDefaults=new FillGradientDefaults5,this.fillPatternDefaults=new FillPatternDefaults5,this.fillOpacity=1,this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.shadow=new DropShadow3().set({enabled:!1}),this.label=new RangeBarSeriesLabel,this.tooltip=new SeriesTooltip7,this.fastDataProcessing=!1}};__decorateClass([TempValidate63(STRING29)],RangeBarProperties.prototype,"xKey",2),__decorateClass([TempValidate63(STRING29)],RangeBarProperties.prototype,"yLowKey",2),__decorateClass([TempValidate63(STRING29)],RangeBarProperties.prototype,"yHighKey",2),__decorateClass([TempValidate63(STRING29,{optional:!0})],RangeBarProperties.prototype,"xName",2),__decorateClass([TempValidate63(STRING29,{optional:!0})],RangeBarProperties.prototype,"yName",2),__decorateClass([TempValidate63(STRING29,{optional:!0})],RangeBarProperties.prototype,"yLowName",2),__decorateClass([TempValidate63(STRING29,{optional:!0})],RangeBarProperties.prototype,"yHighName",2),__decorateClass([TempValidate63(OR9(COLOR_GRADIENT5,COLOR_PATTERN5,COLOR_STRING15))],RangeBarProperties.prototype,"fill",2),__decorateClass([TempValidate63(OBJECT29)],RangeBarProperties.prototype,"fillGradientDefaults",2),__decorateClass([TempValidate63(OBJECT29)],RangeBarProperties.prototype,"fillPatternDefaults",2),__decorateClass([TempValidate63(RATIO18)],RangeBarProperties.prototype,"fillOpacity",2),__decorateClass([TempValidate63(COLOR_STRING15)],RangeBarProperties.prototype,"stroke",2),__decorateClass([TempValidate63(POSITIVE_NUMBER22)],RangeBarProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate63(RATIO18)],RangeBarProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate63(LINE_DASH10)],RangeBarProperties.prototype,"lineDash",2),__decorateClass([TempValidate63(POSITIVE_NUMBER22)],RangeBarProperties.prototype,"lineDashOffset",2),__decorateClass([TempValidate63(POSITIVE_NUMBER22)],RangeBarProperties.prototype,"cornerRadius",2),__decorateClass([TempValidate63(FUNCTION11,{optional:!0})],RangeBarProperties.prototype,"itemStyler",2),__decorateClass([TempValidate63(OBJECT29)],RangeBarProperties.prototype,"shadow",2),__decorateClass([TempValidate63(OBJECT29)],RangeBarProperties.prototype,"label",2),__decorateClass([TempValidate63(OBJECT29)],RangeBarProperties.prototype,"tooltip",2),__decorateClass([TempValidate63(BOOLEAN29)],RangeBarProperties.prototype,"fastDataProcessing",2);var{SeriesNodePickMode:SeriesNodePickMode5,valueProperty:valueProperty9,keyProperty:keyProperty6,ChartAxisDirection:ChartAxisDirection22,checkCrisp:checkCrisp2,updateLabelNode:updateLabelNode3,SMALLEST_KEY_INTERVAL:SMALLEST_KEY_INTERVAL4,LARGEST_KEY_INTERVAL:LARGEST_KEY_INTERVAL2,diff:diff5,prepareBarAnimationFunctions:prepareBarAnimationFunctions2,midpointStartingBarPosition:midpointStartingBarPosition2,resetBarSelectionsFn:resetBarSelectionsFn2,fixNumericExtent:fixNumericExtent6,seriesLabelFadeInAnimation:seriesLabelFadeInAnimation3,resetLabelFn:resetLabelFn3,animationValidation:animationValidation5,computeBarFocusBounds:computeBarFocusBounds5,visibleRangeIndices:visibleRangeIndices3,createDatumId:createDatumId8,ContinuousScale:ContinuousScale8,OrdinalTimeScale:OrdinalTimeScale5,Rect:Rect6,PointerEvents:PointerEvents4,motion:motion3,applyShapeStyle:applyShapeStyle3,findMinMax:findMinMax5,getShapeStyle:getShapeStyle6}=module_support_exports,RangeBarSeriesNodeEvent=class extends module_support_exports.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.xKey=s.properties.xKey,this.yLowKey=s.properties.yLowKey,this.yHighKey=s.properties.yHighKey}},RangeBarSeries=class extends module_support_exports.AbstractBarSeries{constructor(t){super({moduleCtx:t,pickModes:[SeriesNodePickMode5.AXIS_ALIGNED,SeriesNodePickMode5.EXACT_SHAPE_MATCH],hasHighlightedLabels:!0,directionKeys:{x:["xKey"],y:["yLowKey","yHighKey"]},directionNames:{x:["xName"],y:["yLowName","yHighName","yName"]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:resetBarSelectionsFn2,label:resetLabelFn3}}),this.properties=new RangeBarProperties,this.dataAggregationFilters=void 0,this.NodeEvent=RangeBarSeriesNodeEvent}async processData(t){if(!this.properties.isValid())return;const{xKey:e,yLowKey:i,yHighKey:s,fastDataProcessing:n}=this.properties,o=!n,a=this.getCategoryAxis()?.scale,r=this.getValueAxis()?.scale,{isContinuousX:l,xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:a,yScale:r}),d=[];this.ctx.animationManager.isSkipped()||(this.processedData&&d.push(diff5(this.id,this.processedData)),d.push(animationValidation5()));const u=this.visible?{}:{forceValue:0},{dataModel:p,processedData:g}=await this.requestDataModel(t,this.data,{props:[keyProperty6(e,c,{id:"xValue"}),valueProperty9(i,h,{id:"yLowValue",invalidValue:null,...u}),valueProperty9(s,h,{id:"yHighValue",invalidValue:null,...u}),...l?[SMALLEST_KEY_INTERVAL4,LARGEST_KEY_INTERVAL2]:[],...d],groupByKeys:o});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.largestDataInterval=g.reduced?.largestKeyInterval,this.dataAggregationFilters=this.aggregateData(p,g),this.animationState.transition("updateData")}aggregateData(t,e){if(e.type!=="grouped")return;const i=this.axes[ChartAxisDirection22.X];if(i==null||!(ContinuousScale8.is(i.scale)||OrdinalTimeScale5.is(i.scale)))return;const s=t.resolveKeysById(this,"xValue",e),n=t.resolveColumnById(this,"yHighValue",e),o=t.resolveColumnById(this,"yLowValue",e),{index:a}=t.resolveProcessedDataDefById(this,"xValue"),r=e.domain.keys[a];return aggregateRangeBarData(s,n,o,r)}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!e||!i)return[];const{keys:[s]}=e.domain;if(t===this.getCategoryDirection()){const n=i.resolveProcessedDataDefById(this,"xValue");return n?.def.type==="key"&&n?.def.valueType==="category"?s:this.padBandExtent(s)}else{const n=this.domainForClippedRange(ChartAxisDirection22.Y,["yHighValue","yLowValue"],"xValue",!0),o=findMinMax5(n);return fixNumericExtent6(o)}}getSeriesRange(t,e){return this.domainForVisibleRange(ChartAxisDirection22.Y,["yHighValue","yLowValue"],"xValue",e,!0)}createNodeData(){const{data:t,dataModel:e,groupScale:i,processedData:s,visible:n}=this,o=this.getCategoryAxis(),a=this.getValueAxis();if(!(t&&o&&a&&e&&s?.dataSources))return;const r=o.scale,l=a.scale,c=this.getBarDirection()===ChartAxisDirection22.X,{xKey:h,yLowKey:d,yHighKey:u,strokeWidth:p}=this.properties,g=`${d}-${u}`,f={itemId:g,nodeData:[],labelData:[],scales:this.calculateScaling(),visible:this.visible};if(!n)return f;const m=s.dataSources.get(this.id)??[],y=e.resolveKeysById(this,"xValue",s),x=e.resolveColumnById(this,"yLowValue",s),b=e.resolveColumnById(this,"yHighValue",s),{barWidth:S,groupIndex:v}=this.updateGroupScale(o),I=ContinuousScale8.is(r)?S*-.5:0,A=i.convert(String(v)),D=checkCrisp2(o?.scale,o?.visibleRange,this.smallestDataInterval,this.largestDataInterval),T=E=>Math.round(r.convert(y[E]))+A+I,k=(E,_,G,B,z,P,V)=>{const j=m[E],H=y[E];if(H==null)return;const Y=x[E],U=b[E];if(!Number.isFinite(Y?.valueOf())||!Number.isFinite(U?.valueOf()))return;const[$,W]=Y<U?[Y,U]:[U,Y],X=Math.round(l.convert(P)),Z=Math.round(l.convert(z)),q=Math.max(p,Math.abs(Z-X)),Q={x:c?Math.min(X,Z):G,y:c?G:Math.min(X,Z),width:c?q:B,height:c?B:q},tt={x:Q.x+Q.width/2,y:Q.y+Q.height/2},it=this.createLabelData({datumIndex:E,rect:Q,barAlongX:c,yLowValue:$,yHighValue:W,datum:j,series:this}),J={index:_,valueIndex:E,series:this,itemId:g,datum:j,datumIndex:E,xValue:H,yLowValue:Y,yHighValue:U,yLowKey:d,yHighKey:u,xKey:h,x:Q.x,y:Q.y,width:Q.width,height:Q.height,midPoint:tt,crisp:V,labels:it};f.nodeData.push(J),f.labelData.push(...it)},{dataAggregationFilters:w}=this,[L,O]=r.range,F=O-L,R=w?.find(E=>E.maxRange>F);if(R!=null){const{maxRange:E,indexData:_}=R,[G,B]=visibleRangeIndices3(E,o.range,z=>{const P=z*SPAN3,V=_[P+X_MIN2],j=_[P+X_MAX2];if(V===-1)return;const H=(V+j)/2|0;return[T(H),T(j)+S]});for(let z=G;z<B;z+=1){const P=z*SPAN3,V=_[P+X_MIN2],j=_[P+X_MAX2],H=_[P+Y_MIN2],Y=_[P+Y_MAX2];if(V===-1)continue;const U=(V+j)/2|0;if(y[U]==null)continue;const W=T(U),X=Math.abs(T(V)-T(j))+S,Z=x[H],q=b[Y];k(U,0,W,X,Z,q,!1)}}else if(s.type==="ungrouped"){let[E,_]=visibleRangeIndices3(m.length,o.range,G=>[T(G),S]);s.input.count<1e3&&(E=0,_=s.input.count);for(let G=E;G<_;G+=1){const B=T(G),z=S,P=x[G],V=b[G];k(G,0,B,z,P,V,D)}}else for(const{datumIndex:E,groupIndex:_}of e.forEachGroupDatum(this,s)){const G=T(E),B=S,z=x[E],P=b[E];k(E,_,G,B,z,P,D)}return f}createLabelData({datumIndex:t,rect:e,barAlongX:i,yLowValue:s,yHighValue:n,datum:o,series:a}){const{xKey:r,yLowKey:l,yHighKey:c,xName:h,yLowName:d,yHighName:u,yName:p,label:g}=this.properties,f={datum:o,xKey:r,yLowKey:l,yHighKey:c,xName:h,yLowName:d,yHighName:u,yName:p},{placement:m,padding:y}=g,b=y*(m==="outside"?1:-1),S={datumIndex:t,x:e.x+(i?-b:e.width/2),y:e.y+(i?e.height/2:e.height+b),textAlign:i?"left":"center",textBaseline:i?"middle":"bottom",text:this.getLabelText(g,{itemId:"low",value:s,...f}),itemId:"low",datum:o,series:a},v={datumIndex:t,x:e.x+(i?e.width+b:e.width/2),y:e.y+(i?e.height/2:-b),textAlign:i?"right":"center",textBaseline:i?"middle":"top",text:this.getLabelText(g,{itemId:"high",value:n,...f}),itemId:"high",datum:o,series:a};return m==="outside"&&(S.textAlign=i?"right":"center",S.textBaseline=i?"middle":"top",v.textAlign=i?"left":"center",v.textBaseline=i?"middle":"bottom"),[S,v]}nodeFactory(){return new Rect6}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,s=e??[];return i.update(s,void 0,n=>this.getDatumId(n))}getItemBaseStyle(t){const{properties:e}=this,{cornerRadius:i,fillGradientDefaults:s,fillPatternDefaults:n}=e,o=t?e.highlightStyle.item:void 0;return getShapeStyle6({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},s,n)}getItemStyleOverrides(t,e,i,s){const{id:n,properties:o}=this,{xKey:a,yHighKey:r,yLowKey:l,itemStyler:c,fillGradientDefaults:h,fillPatternDefaults:d}=o;if(c==null)return;const u=this.cachedDatumCallback(createDatumId8(t,s?"highlight":"node"),()=>this.callWithContext(c,{seriesId:n,datum:e,xKey:a,yHighKey:r,yLowKey:l,highlighted:s,...i}));return getShapeStyle6(u,h,d)}updateDatumNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getCategoryDirection()===ChartAxisDirection22.X,n=this.getItemBaseStyle(i),o=this.getShapeFillBBox();e.each((a,r)=>{const l=this.getItemStyleOverrides(String(r.datumIndex),r.datum,n,i);applyShapeStyle3(a,n,l,o),a.cornerRadius=l?.cornerRadius??n.cornerRadius,a.visible=s?r.width>0:r.height>0,a.crisp=r.crisp})}getHighlightLabelData(t,e){const i=t.filter(s=>s.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=PointerEvents4.None})}updateLabelNodes(t){t.labelSelection.each((e,i)=>{updateLabelNode3(e,this.properties.label,i)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{xKey:o,xName:a,yName:r,yLowKey:l,yHighKey:c,yLowName:h,yHighName:d,tooltip:u}=n,p=this.getCategoryAxis(),g=this.getValueAxis();if(!i||!s||!p||!g)return;const f=s.dataSources.get(this.id)?.[t],m=i.resolveKeysById(this,"xValue",s)[t],y=i.resolveColumnById(this,"yHighValue",s)[t],x=i.resolveColumnById(this,"yLowValue",s)[t];if(m==null)return;const b=this.getItemBaseStyle(!1);Object.assign(b,this.getItemStyleOverrides(String(t),f,b,!1));const S=`${g.formatDatum(x)} - ${g.formatDatum(y)}`;return u.formatTooltip(this.properties,{heading:p.formatDatum(m),symbol:this.legendItemSymbol(),data:[{label:r,fallbackLabel:`${h??l} - ${d??c}`,value:S}]},{seriesId:e,datum:f,title:r,xKey:o,xName:a,yName:r,yLowKey:l,yHighKey:c,yLowName:h,yHighName:d,...b})}legendItemSymbol(){const{fill:t,stroke:e,strokeWidth:i,fillOpacity:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,fillGradientDefaults:r,fillPatternDefaults:l}=this.properties;return{marker:getShapeStyle6({fill:t,stroke:e,fillOpacity:s,strokeOpacity:n,strokeWidth:i,lineDash:o,lineDashOffset:a},r,l)}}getLegendData(t){if(t!=="category")return[];const{id:e,visible:i}=this,{yName:s,yLowName:n,yHighName:o,yLowKey:a,yHighKey:r,showInLegend:l}=this.properties,c=s??`${n??a} - ${o??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=prepareBarAnimationFunctions2(midpointStartingBarPosition2(this.isVertical(),"normal"));motion3.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],i),seriesLabelFadeInAnimation3(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(t){const{datumSelection:e,labelSelection:i,previousContextData:s}=t,{processedData:n}=this,o=n?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const a=s==null?"fade":"normal",r=prepareBarAnimationFunctions2(midpointStartingBarPosition2(this.isVertical(),a));motion3.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],r,(l,c)=>this.getDatumId(c),o),seriesLabelFadeInAnimation3(this,"labels",this.ctx.animationManager,i)}getDatumId(t){return`${t.xValue}-${t.valueIndex}`}isLabelEnabled(){return this.properties.label.enabled}onDataChange(){}computeFocusBounds({datumIndex:t}){return computeBarFocusBounds5(this,this.contextNodeData?.nodeData[t])}};RangeBarSeries.className="RangeBarSeries",RangeBarSeries.type="range-bar";var{commonSeriesOptionsDefs:commonSeriesOptionsDefs7,seriesLabelOptionsDefs:seriesLabelOptionsDefs3,shadowOptionsDefs:shadowOptionsDefs3,tooltipOptionsDefs:tooltipOptionsDefs7}=module_support_exports,rangeBarSeriesOptionsDef={type:required(constant("range-bar")),xKey:required(string),yLowKey:required(string),yHighKey:required(string),xName:string,yName:string,yLowName:string,yHighName:string,direction:union("horizontal","vertical"),showInMiniChart:boolean,cornerRadius:positiveNumber,itemStyler:callback,label:{...seriesLabelOptionsDefs3,padding:positiveNumber,placement:union("inside","outside")},tooltip:tooltipOptionsDefs7,shadow:shadowOptionsDefs3,...commonSeriesOptionsDefs7,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef};rangeBarSeriesOptionsDef.pickOutsideVisibleMinorAxis=boolean,rangeBarSeriesOptionsDef.fastDataProcessing=boolean,rangeBarSeriesOptionsDef.focusPriority=number;var RANGE_BAR_SERIES_THEME={series:{direction:"vertical",fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:module_support_exports.FILL_PATTERN_DEFAULTS,strokeWidth:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"},placement:"inside"}},axes:{[module_support_exports.ThemeConstants.CARTESIAN_AXIS_TYPE.NUMBER]:{crosshair:{enabled:!0}}}},RangeBarModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"range-bar",moduleFactory:t=>new RangeBarSeries(t),tooltipDefaults:{range:"exact"},defaultAxes:module_support_exports.DIRECTION_SWAP_AXES,themeTemplate:RANGE_BAR_SERIES_THEME,groupable:!0},RangeBarSeriesModule={type:"series",name:"range-bar",chartType:"cartesian",enterprise:!0,options:rangeBarSeriesOptionsDef,create:t=>new RangeBarSeries(t)},{AbstractBarSeriesProperties:AbstractBarSeriesProperties5,BaseProperties:BaseProperties23,FillGradientDefaults:FillGradientDefaults6,FillPatternDefaults:FillPatternDefaults6,PropertiesArray:PropertiesArray7,SeriesTooltip:SeriesTooltip8,TempValidate:TempValidate64,BOOLEAN:BOOLEAN30,COLOR_STRING:COLOR_STRING16,COLOR_PATTERN:COLOR_PATTERN6,FUNCTION:FUNCTION12,LINE_DASH:LINE_DASH11,NUMBER:NUMBER16,OBJECT:OBJECT30,OBJECT_ARRAY:OBJECT_ARRAY2,POSITIVE_NUMBER:POSITIVE_NUMBER23,OR:OR10,COLOR_GRADIENT:COLOR_GRADIENT6,RATIO:RATIO19,STRING:STRING30,UNION:UNION12,DropShadow:DropShadow4,Label:Label6}=module_support_exports,WaterfallSeriesTotal=class extends BaseProperties23{};__decorateClass([TempValidate64(UNION12(["subtotal","total"],"a total type"))],WaterfallSeriesTotal.prototype,"totalType",2),__decorateClass([TempValidate64(NUMBER16)],WaterfallSeriesTotal.prototype,"index",2),__decorateClass([TempValidate64(STRING30)],WaterfallSeriesTotal.prototype,"axisLabel",2);var WaterfallSeriesItemTooltip=class extends BaseProperties23{};__decorateClass([TempValidate64(FUNCTION12,{optional:!0})],WaterfallSeriesItemTooltip.prototype,"renderer",2);var WaterfallSeriesLabel=class extends Label6{constructor(){super(...arguments),this.placement="outside-end",this.padding=6}};__decorateClass([TempValidate64(UNION12(["inside-center","inside-start","inside-end","outside-start","outside-end"],"a placement"))],WaterfallSeriesLabel.prototype,"placement",2),__decorateClass([TempValidate64(POSITIVE_NUMBER23)],WaterfallSeriesLabel.prototype,"padding",2);var WaterfallSeriesItem=class extends BaseProperties23{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new FillGradientDefaults6,this.fillPatternDefaults=new FillPatternDefaults6,this.stroke="#c16068",this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=1,this.cornerRadius=0,this.shadow=new DropShadow4().set({enabled:!1}),this.label=new WaterfallSeriesLabel,this.tooltip=new WaterfallSeriesItemTooltip}};__decorateClass([TempValidate64(STRING30,{optional:!0})],WaterfallSeriesItem.prototype,"name",2),__decorateClass([TempValidate64(OR10(COLOR_GRADIENT6,COLOR_STRING16,COLOR_PATTERN6))],WaterfallSeriesItem.prototype,"fill",2),__decorateClass([TempValidate64(OBJECT30)],WaterfallSeriesItem.prototype,"fillGradientDefaults",2),__decorateClass([TempValidate64(OBJECT30)],WaterfallSeriesItem.prototype,"fillPatternDefaults",2),__decorateClass([TempValidate64(COLOR_STRING16)],WaterfallSeriesItem.prototype,"stroke",2),__decorateClass([TempValidate64(RATIO19)],WaterfallSeriesItem.prototype,"fillOpacity",2),__decorateClass([TempValidate64(RATIO19)],WaterfallSeriesItem.prototype,"strokeOpacity",2),__decorateClass([TempValidate64(LINE_DASH11)],WaterfallSeriesItem.prototype,"lineDash",2),__decorateClass([TempValidate64(POSITIVE_NUMBER23)],WaterfallSeriesItem.prototype,"lineDashOffset",2),__decorateClass([TempValidate64(POSITIVE_NUMBER23)],WaterfallSeriesItem.prototype,"strokeWidth",2),__decorateClass([TempValidate64(POSITIVE_NUMBER23)],WaterfallSeriesItem.prototype,"cornerRadius",2),__decorateClass([TempValidate64(FUNCTION12,{optional:!0})],WaterfallSeriesItem.prototype,"itemStyler",2),__decorateClass([TempValidate64(OBJECT30)],WaterfallSeriesItem.prototype,"shadow",2),__decorateClass([TempValidate64(OBJECT30)],WaterfallSeriesItem.prototype,"label",2),__decorateClass([TempValidate64(OBJECT30)],WaterfallSeriesItem.prototype,"tooltip",2);var WaterfallSeriesConnectorLine=class extends BaseProperties23{constructor(){super(...arguments),this.enabled=!0,this.stroke="black",this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=2}};__decorateClass([TempValidate64(BOOLEAN30)],WaterfallSeriesConnectorLine.prototype,"enabled",2),__decorateClass([TempValidate64(COLOR_STRING16)],WaterfallSeriesConnectorLine.prototype,"stroke",2),__decorateClass([TempValidate64(RATIO19)],WaterfallSeriesConnectorLine.prototype,"strokeOpacity",2),__decorateClass([TempValidate64(LINE_DASH11)],WaterfallSeriesConnectorLine.prototype,"lineDash",2),__decorateClass([TempValidate64(POSITIVE_NUMBER23)],WaterfallSeriesConnectorLine.prototype,"lineDashOffset",2),__decorateClass([TempValidate64(POSITIVE_NUMBER23)],WaterfallSeriesConnectorLine.prototype,"strokeWidth",2);var WaterfallSeriesItems=class extends BaseProperties23{constructor(){super(...arguments),this.positive=new WaterfallSeriesItem,this.negative=new WaterfallSeriesItem,this.total=new WaterfallSeriesItem}};__decorateClass([TempValidate64(OBJECT30)],WaterfallSeriesItems.prototype,"positive",2),__decorateClass([TempValidate64(OBJECT30)],WaterfallSeriesItems.prototype,"negative",2),__decorateClass([TempValidate64(OBJECT30)],WaterfallSeriesItems.prototype,"total",2);var WaterfallSeriesProperties=class extends AbstractBarSeriesProperties5{constructor(){super(...arguments),this.item=new WaterfallSeriesItems,this.totals=new PropertiesArray7(WaterfallSeriesTotal),this.line=new WaterfallSeriesConnectorLine,this.tooltip=new SeriesTooltip8}};__decorateClass([TempValidate64(STRING30)],WaterfallSeriesProperties.prototype,"xKey",2),__decorateClass([TempValidate64(STRING30)],WaterfallSeriesProperties.prototype,"yKey",2),__decorateClass([TempValidate64(STRING30,{optional:!0})],WaterfallSeriesProperties.prototype,"xName",2),__decorateClass([TempValidate64(STRING30,{optional:!0})],WaterfallSeriesProperties.prototype,"yName",2),__decorateClass([TempValidate64(OBJECT30)],WaterfallSeriesProperties.prototype,"item",2),__decorateClass([TempValidate64(OBJECT_ARRAY2)],WaterfallSeriesProperties.prototype,"totals",2),__decorateClass([TempValidate64(OBJECT30)],WaterfallSeriesProperties.prototype,"line",2),__decorateClass([TempValidate64(OBJECT30)],WaterfallSeriesProperties.prototype,"tooltip",2);var{adjustLabelPlacement:adjustLabelPlacement2,SeriesNodePickMode:SeriesNodePickMode6,fixNumericExtent:fixNumericExtent7,valueProperty:valueProperty10,keyProperty:keyProperty7,accumulativeValueProperty:accumulativeValueProperty2,trailingAccumulatedValueProperty:trailingAccumulatedValueProperty2,ChartAxisDirection:ChartAxisDirection23,createDatumId:createDatumId9,checkCrisp:checkCrisp3,updateLabelNode:updateLabelNode4,prepareBarAnimationFunctions:prepareBarAnimationFunctions3,collapsedStartingBarPosition:collapsedStartingBarPosition2,resetBarSelectionsFn:resetBarSelectionsFn3,seriesLabelFadeInAnimation:seriesLabelFadeInAnimation4,resetLabelFn:resetLabelFn4,animationValidation:animationValidation6,DEFAULT_CARTESIAN_DIRECTION_KEYS:DEFAULT_CARTESIAN_DIRECTION_KEYS3,DEFAULT_CARTESIAN_DIRECTION_NAMES:DEFAULT_CARTESIAN_DIRECTION_NAMES3,computeBarFocusBounds:computeBarFocusBounds6,isContinuous:isContinuous2,Rect:Rect7,motion:motion4,applyShapeStyle:applyShapeStyle4,getShapeStyle:getShapeStyle7}=module_support_exports,WaterfallSeries=class extends module_support_exports.AbstractBarSeries{constructor(t){super({moduleCtx:t,directionKeys:DEFAULT_CARTESIAN_DIRECTION_KEYS3,directionNames:DEFAULT_CARTESIAN_DIRECTION_NAMES3,categoryKey:void 0,pickModes:[SeriesNodePickMode6.NEAREST_NODE,SeriesNodePickMode6.EXACT_SHAPE_MATCH],pathsPerSeries:["connector"],hasHighlightedLabels:!0,pathsZIndexSubOrderOffset:[-1,-1],animationResetFns:{datum:resetBarSelectionsFn3,label:resetLabelFn4}}),this.properties=new WaterfallSeriesProperties,this.seriesItemTypes=new Set(["positive","negative","total"])}async processData(t){const{xKey:e,yKey:i,totals:s}=this.properties,{data:n=[]}=this;if(!this.properties.isValid()||!this.visible)return;const o=x=>isContinuous2(x)&&Number(x)>=0,a=x=>isContinuous2(x)&&Number(x)>=0,r=x=>x==="total"||x==="subtotal",l={missingValue:void 0,invalidValue:void 0},c=[],h=s.reduce((x,b)=>{const S=x.get(b.index);return S?S.push(b):x.set(b.index,[b]),x},new Map);n.forEach((x,b)=>{c.push(x),h.get(b)?.forEach(S=>c.push({...S.toJson(),[e]:S.axisLabel}))});const d=[];this.ctx.animationManager.isSkipped()||d.push(animationValidation6());const u=this.getCategoryAxis()?.scale,p=this.getValueAxis()?.scale,{isContinuousX:g,xScaleType:f,yScaleType:m}=this.getScaleInformation({xScale:u,yScale:p}),{processedData:y}=await this.requestDataModel(t,c,{props:[keyProperty7(e,f,{id:"xValue"}),accumulativeValueProperty2(i,m,{...l,id:"yCurrent"}),accumulativeValueProperty2(i,m,{...l,missingValue:0,id:"yCurrentTotal"}),accumulativeValueProperty2(i,m,{...l,id:"yCurrentPositive",validation:o}),accumulativeValueProperty2(i,m,{...l,id:"yCurrentNegative",validation:a}),trailingAccumulatedValueProperty2(i,m,{...l,id:"yPrevious"}),valueProperty10(i,m,{id:"yRaw"}),valueProperty10("totalType","band",{id:"totalTypeValue",missingValue:void 0,validation:r}),...g?[module_support_exports.SMALLEST_KEY_INTERVAL,module_support_exports.LARGEST_KEY_INTERVAL]:[],...d]});this.smallestDataInterval=y.reduced?.smallestKeyInterval,this.largestDataInterval=y.reduced?.largestKeyInterval,this.updateSeriesItemTypes(),this.animationState.transition("updateData")}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!e||!i)return[];const{keys:[s],values:n}=e.domain;if(t===this.getCategoryDirection()){const o=i.resolveProcessedDataDefById(this,"xValue");if(o?.def.type==="key"&&o?.def.valueType==="category")return s;const a=t===ChartAxisDirection23.Y,r=this.getCategoryAxis().isReversed();return this.padBandExtent(s,r!==a)}else{const o=i.resolveProcessedDataIndexById(this,"yCurrent"),a=n[o],r=[Math.min(0,a[0]),Math.max(0,a[1])];return fixNumericExtent7(r)}}getSeriesRange(t,e){return[NaN,NaN]}createNodeData(){const{data:t,dataModel:e,processedData:i}=this,s=this.getCategoryAxis(),n=this.getValueAxis();if(!t||!s||!n||!e||!i)return;const{line:o}=this.properties,a=s.scale,r=n.scale,l=this.getBarDirection()===ChartAxisDirection23.X,c=this.getBandwidth(s)??10,h=s.isReversed(),d=n.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 p=[],g=e.resolveKeysById(this,"xValue",i),f=e.resolveColumnById(this,"yRaw",i),m=e.resolveColumnById(this,"totalTypeValue",i),y=e.resolveColumnById(this,"yCurrent",i),x=e.resolveColumnById(this,"yPrevious",i),b=e.resolveColumnById(this,"yCurrentTotal",i),S=checkCrisp3(s?.scale,s?.visibleRange,this.smallestDataInterval,this.largestDataInterval);function v(F,R,E){return F||R?{cumulativeValue:b[E],trailingValue:R?A:0}:{cumulativeValue:y[E],trailingValue:x[E]}}function I(F,R,E,_,G){return F?_:R?(_??0)-(G??0):E}let A=0;const{xKey:D,yKey:T,xName:k,yName:w}=this.properties;(i.dataSources.get(this.id)??[]).forEach((F,R)=>{const E=m[R],_=this.isSubtotal(E),G=this.isTotal(E),B=G||_,z=g[R];if(z==null)return;const P=Math.round(a.convert(z)),V=f[R],{cumulativeValue:j,trailingValue:H}=v(G,_,R);B&&(A=j??0);const Y=Math.round(r.convert(j)),U=Math.round(r.convert(H)),$=I(G,_,V,j,H),W=($??0)>=0,X=this.getSeriesItemType(W,E),{strokeWidth:Z,label:q}=this.getItemConfig(X),Q=W?Y:U,tt=W?U:Y,it=Math.max(Z,Math.abs(tt-Q)),J={x:l?Math.min(Q,tt):P,y:l?P:Math.min(Q,tt),width:l?it:c,height:l?c:it},at={x:J.x+J.width/2,y:J.y+J.height/2},lt=B?Y:U,nt=Math.floor(o.strokeWidth)%2/2,ot=h?Y:lt,et=h?lt:Y;let st,rt;l?(st={x:ot+nt,y:J.y},rt={x:et+nt,y:J.y+J.height}):(st={x:J.x,y:ot+nt},rt={x:J.x+J.width,y:et+nt});const ut={x:h?rt.x:st.x,y:h?rt.y:st.y,x2:h?st.x:rt.x,y2:h?st.y:rt.y,size:0};p.push(ut);const pt=X==="subtotal"?"total":X,yt=this.getLabelText(q,{itemId:pt,value:$,datum:F,xKey:D,yKey:T,xName:k,yName:w}),Dt={index:R,series:this,itemId:X,datum:F,datumIndex:R,cumulativeValue:j??0,xValue:z,yValue:$,yKey:T,xKey:D,x:J.x,y:J.y,width:J.width,height:J.height,midPoint:at,crisp:S,label:{text:yt,...adjustLabelPlacement2({isUpward:($??-1)>=0!==d,isVertical:!l,placement:q.placement,padding:q.padding,rect:J})}};u.nodeData.push(Dt),u.labelData.push(Dt)});const O=this.properties.line.enabled;return y!=null&&O&&(u.pointData=p),u}updateSeriesItemTypes(){const{dataModel:t,seriesItemTypes:e,processedData:i}=this;if(!t||!i)return;e.clear();const s=t.resolveProcessedDataIndexById(this,"yCurrentPositive"),n=t.resolveProcessedDataIndexById(this,"yCurrentNegative"),o=t.resolveProcessedDataIndexById(this,"totalTypeValue"),a=i.domain.values[s]??[],r=i.domain.values[n]??[];a.length>0&&e.add("positive"),r.length>0&&e.add("negative");const l=i?.domain.values[o];l&&l.forEach(c=>{(c==="total"||c==="subtotal")&&e.add("total")})}isSubtotal(t){return t==="subtotal"}isTotal(t){return t==="total"}nodeFactory(){return new Rect7}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,s=e??[];return i.update(s)}getItemStyle(t,e,i,s){const{id:n,properties:o}=this,a=o.item[i==="subtotal"?"total":i],r=s?o.highlightStyle.item:void 0,{itemStyler:l,fillGradientDefaults:c,fillPatternDefaults:h}=a,{xKey:d,yKey:u}=o,p=getShapeStyle7({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},c,h);if(l!=null){let g=this.cachedDatumCallback(createDatumId9(t,s?"highlight":"node"),()=>this.callWithContext(l,{seriesId:n,itemId:i,datum:e,xKey:d,yKey:u,highlighted:s,...p}));g=getShapeStyle7(g,c,h),Object.assign(p,g)}return p}updateDatumNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getCategoryDirection()===ChartAxisDirection23.X,n=this.getShapeFillBBox();e.each((o,a)=>{const r=a.itemId,l=this.getItemStyle(String(a.datumIndex),a.datum,r,i);applyShapeStyle4(o,l,void 0,n),o.visible=s?a.width>0:a.height>0,o.crisp=a.crisp})}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;if(e.length===0)return i.update([]);const s=e.filter(n=>{const{label:o}=this.getItemConfig(n.itemId);return o.enabled});return i.update(s)}updateLabelNodes(t){t.labelSelection.each((e,i)=>{updateLabelNode4(e,this.getItemConfig(i.itemId).label,i.label)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{xKey:o,xName:a,yKey:r,yName:l,tooltip:c}=n,h=this.getCategoryAxis(),d=this.getValueAxis();if(!i||!s||!h||!d)return;const u=s.dataSources.get(this.id)?.[t],p=i.resolveKeysById(this,"xValue",s)[t],g=i.resolveColumnById(this,"yRaw",s)[t],f=i.resolveColumnById(this,"yCurrentTotal",s),m=i.resolveColumnById(this,"totalTypeValue",s);if(p==null)return;const y=m[t],x=(g??0)>=0,b=this.getSeriesItemType(x,y);let S;if(this.isTotal(y))S=f[t];else if(this.isSubtotal(y)){S=f[t];for(let I=t-1;I>=0;I-=1)if(this.isSubtotal(m[I])){S=S-f[I];break}}else S=g;const v=this.getItemStyle(String(t),u,b,!1);return c.formatTooltip(this.properties,{heading:h.formatDatum(p),symbol:this.legendItemSymbol(b),data:[{label:l,fallbackLabel:r,value:d.formatDatum(S)}]},{seriesId:e,datum:u,title:l,itemId:b,xKey:o,xName:a,yKey:r,yName:l,...v})}legendItemSymbol(t){const{fill:e,stroke:i,fillOpacity:s,strokeOpacity:n,strokeWidth:o,lineDash:a,lineDashOffset:r,fillGradientDefaults:l,fillPatternDefaults:c}=this.getItemConfig(t);return{marker:getShapeStyle7({fill:e,stroke:i,fillOpacity:s,strokeOpacity:n,strokeWidth:o,lineDash:a,lineDashOffset:r},l,c)}}getLegendData(t){if(t!=="category")return[];const{id:e,seriesItemTypes:i}=this,s=[],n=a=>a.charAt(0).toUpperCase()+a.substring(1),{showInLegend:o}=this.properties;return i.forEach(a=>{const{name:r}=this.getItemConfig(a);s.push({legendType:"category",id:e,itemId:a,seriesId:e,enabled:!0,label:{text:r??n(a)},symbol:this.legendItemSymbol(a),hideInLegend:!o,isFixed:!0})}),s}toggleSeriesItem(){}animateEmptyUpdateReady(t){const{datumSelection:e,labelSelection:i,contextData:s}=t,n=prepareBarAnimationFunctions3(collapsedStartingBarPosition2(this.isVertical(),this.axes,"normal"));motion4.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],n),seriesLabelFadeInAnimation4(this,"labels",this.ctx.animationManager,i);const{pointData:o}=s;o&&(this.isVertical()?this.animateConnectorLinesVertical(t):this.animateConnectorLinesHorizontal(t))}animateConnectorLinesHorizontal(t){const{pointData:e=[]}=t.contextData,[i]=t.paths,{path:s}=i;this.updateLineNode(i);const n=this.getValueAxis(),o=n?.isReversed(),a=o?(h,d)=>h<d:(h,d)=>h>d,r=n?.scale.convert(0),l=e.reduce((h,d)=>(a(d.x,h)&&(h=d.x),h),o?1/0:0),c=(h,d,u,p,g)=>(h-d)/(u-d)*(g-p)+p;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:r,to:l,ease:module_support_exports.Motion.easeOut,collapsable:!1,onUpdate(h){s.clear(!0),e.forEach((d,u)=>{const p=c(h,r,l,r,d.x),g=c(h,r,l,r,d.x2);u!==0&&s.lineTo(p,d.y),s.moveTo(g,d.y2)}),i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(t)})}animateConnectorLinesVertical(t){const{pointData:e=[]}=t.contextData,[i]=t.paths,{path:s}=i;this.updateLineNode(i);const n=this.getValueAxis(),o=n?.isReversed(),a=o?(h,d)=>h>d:(h,d)=>h<d,r=n?.scale.convert(0),l=e.reduce((h,d)=>(a(d.y,h)&&(h=d.y),h),o?0:1/0),c=(h,d,u,p,g)=>(h-d)/(u-d)*(g-p)+p;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:r,to:l,ease:module_support_exports.Motion.easeOut,collapsable:!1,onUpdate(h){s.clear(!0),e.forEach((d,u)=>{const p=c(h,r,l,r,d.y),g=c(h,r,l,r,d.y2);u!==0&&s.lineTo(d.x,p),s.moveTo(d.x2,g)}),i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(t)})}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:s}=i;s.clear(!0);const{pointData:n}=t;n&&(n.forEach((o,a)=>{a!==0&&s.lineTo(o.x,o.y),s.moveTo(o.x2,o.y2)}),i.checkPathDirty())}updateLineNode(t){const{stroke:e,strokeWidth:i,strokeOpacity:s,lineDash:n,lineDashOffset:o}=this.properties.line;t.setProperties({fill:void 0,stroke:e,strokeWidth:this.getStrokeWidth(i),strokeOpacity:s,lineDash:n,lineDashOffset:o,lineJoin:"round",pointerEvents:module_support_exports.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 computeBarFocusBounds6(this,this.contextNodeData?.nodeData[t])}};WaterfallSeries.className="WaterfallSeries",WaterfallSeries.type="waterfall";var{commonSeriesOptionsDefs:commonSeriesOptionsDefs8,seriesLabelOptionsDefs:seriesLabelOptionsDefs4,shadowOptionsDefs:shadowOptionsDefs4,tooltipOptionsDefs:tooltipOptionsDefs8}=module_support_exports,waterfallSeriesItemOptionsDef={name:string,cornerRadius:positiveNumber,itemStyler:callback,label:{...seriesLabelOptionsDefs4,padding:positiveNumber,placement:union("inside-start","inside-center","inside-end","outside-start","outside-end")},tooltip:tooltipOptionsDefs8,shadow:shadowOptionsDefs4,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},waterfallSeriesOptionsDef={type:required(constant("waterfall")),xKey:required(string),yKey:required(string),xName:string,yName:string,direction:union("horizontal","vertical"),totals:arrayOfDefs({totalType:required(union("total","subtotal")),index:required(positiveNumber),axisLabel:required(string)},"a total definition options array"),showInMiniChart:boolean,item:{positive:waterfallSeriesItemOptionsDef,negative:waterfallSeriesItemOptionsDef,total:waterfallSeriesItemOptionsDef},line:{enabled:boolean,...strokeOptionsDef,...lineDashOptionsDef},tooltip:tooltipOptionsDefs8,...commonSeriesOptionsDefs8};function itemTheme2(t,e){return{fill:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$path:[`./${e}`,{$palette:"fill"},{$palette:"fills"}]},{$palette:`${t}.fill`}]},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$if:[{$or:[{$isGradient:[{$palette:`${t}.fill`}]},{$isPattern:[{$palette:`${t}.fill`}]}]},{$map:[{$path:["./color",void 0,{$value:"$1"}]},{$path:["./colorStops",void 0,{$palette:`${t}.fill`}]}]},[{$mix:[{$palette:`${t}.fill`},"black",.15]},{$mix:[{$palette:`${t}.fill`},"white",.15]}]]},rotation:0,reverse:!1},fillPatternDefaults:module_support_exports.FILL_PATTERN_DEFAULTS,stroke:{$palette:`${t}.stroke`},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"}}}var WATERFALL_SERIES_THEME={series:{item:{positive:itemTheme2("altUp",0),negative:itemTheme2("altDown",1),total:itemTheme2("neutral",2)},line:{stroke:{$palette:"neutral.stroke"},strokeOpacity:1,lineDash:[0],lineDashOffset:0,strokeWidth:2}},legend:{enabled:!0,toggleSeries:!1}},WaterfallModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"waterfall",solo:!0,moduleFactory:t=>new WaterfallSeries(t),tooltipDefaults:{range:"exact"},defaultAxes:module_support_exports.DIRECTION_SWAP_AXES,themeTemplate:WATERFALL_SERIES_THEME},WaterfallSeriesModule={type:"series",name:"waterfall",chartType:"cartesian",enterprise:!0,options:waterfallSeriesOptionsDef,create:t=>new WaterfallSeries(t)},{NewAreaSeriesModule:NewAreaSeriesModule2,NewBarSeriesModule:NewBarSeriesModule2,NewBubbleSeriesModule:NewBubbleSeriesModule2,NewHistogramSeriesModule:NewHistogramSeriesModule2,NewLineSeriesModule:NewLineSeriesModule2,NewScatterSeriesModule:NewScatterSeriesModule2,numberFormatValidator:numberFormatValidator3,without:without2}=module_support_exports,navigatorHandleOptionsDef={width:positiveNumber,height:positiveNumber,grip:boolean,fill:color,stroke:color,strokeWidth:positiveNumber,cornerRadius:positiveNumber},commonIgnoredMiniChartProperties=["cursor","highlightStyle","listeners","nodeClickRange","showInLegend","showInMiniChart","tooltip","visible","xName","yName"],navigatorOptionsDef={enabled:boolean,height:positiveNumber,spacing:positiveNumber,cornerRadius:number,mask:{fill:color,fillOpacity:ratio,stroke:color,strokeWidth:positiveNumber},minHandle:navigatorHandleOptionsDef,maxHandle:navigatorHandleOptionsDef,miniChart:{enabled:boolean,padding:{top:positiveNumber,bottom:positiveNumber},label:{enabled:boolean,avoidCollisions:boolean,spacing:positiveNumber,format:numberFormatValidator3,formatter:callback,interval:{minSpacing:positiveNumber,maxSpacing:positiveNumber,values:array,step:number},...fontOptionsDef},series:arrayOf(typeUnion({area:without2(NewAreaSeriesModule2.options,commonIgnoredMiniChartProperties),bar:without2(NewBarSeriesModule2.options,[...commonIgnoredMiniChartProperties,"errorBar","label","legendItemName","direction"]),"box-plot":without2(BoxPlotSeriesModule.options,[...commonIgnoredMiniChartProperties,"direction","legendItemName","minName","q1Name","medianName","q3Name","maxName"]),bubble:without2(NewBubbleSeriesModule2.options,[...commonIgnoredMiniChartProperties,"title","label","labelKey","labelName","sizeName"]),candlestick:without2(CandlestickSeriesModule.options,commonIgnoredMiniChartProperties),heatmap:without2(HeatmapSeriesModule.options,[...commonIgnoredMiniChartProperties,"title","label","colorName","textAlign","verticalAlign","itemPadding","colorRange"]),histogram:without2(NewHistogramSeriesModule2.options,[...commonIgnoredMiniChartProperties,"label"]),line:without2(NewLineSeriesModule2.options,[...commonIgnoredMiniChartProperties,"errorBar","title","label"]),ohlc:without2(OhlcSeriesModule.options,commonIgnoredMiniChartProperties),"range-area":without2(RangeAreaSeriesModule.options,[...commonIgnoredMiniChartProperties,"label","yLowName","yHighName"]),"range-bar":without2(RangeBarSeriesModule.options,[...commonIgnoredMiniChartProperties,"direction","label","yLowName","yHighName"]),scatter:without2(NewScatterSeriesModule2.options,[...commonIgnoredMiniChartProperties,"errorBar","title","label","labelKey","labelName"]),waterfall:without2(WaterfallSeriesModule.options,[...commonIgnoredMiniChartProperties,"direction"])}))}},AnnotationsModule2={type:"plugin",name:"annotations",chartType:"cartesian",options:annotationOptionsDef,create(){return null}},NavigatorModule2={type:"plugin",name:"navigator",chartType:"cartesian",options:navigatorOptionsDef,create(){return null}},InitialStateModule={type:"plugin",name:"initialState",options:initialStateOptionsDef,create(){return null}};function computeNodeGraph(t,e,i){i||(e=removeCircularLinks(e));const s=new Map;for(const o of t)s.set(o.id,{datum:o,linksBefore:[],linksAfter:[],maxPathLengthBefore:-1,maxPathLengthAfter:-1});let n=0;return s.forEach((o,a)=>{n=Math.max(n,computePathLength(s,e,o,a,-1,[])+computePathLength(s,e,o,a,1,[])+1)}),{links:e,nodeGraph:s,maxPathLength:n}}function findCircularLinks(t,e,i,s){const n=s.indexOf(e);if(n!==-1){for(let a=n;a<s.length;a+=1)i.add(s[a]);return}s.push(e);const{toNode:o}=e;for(const a of t)a.fromNode===o&&findCircularLinks(t,a,i,s);s.pop()}function removeCircularLinks(t){const e=new Set;for(const i of t)findCircularLinks(t,i,e,[]);return e.size!==0&&logger_exports.warnOnce("Some links formed circular references. These will be removed from the output."),e.size===0?t:t.filter(i=>!e.has(i))}function computePathLength(t,e,i,s,n,o){if(o.includes(s))return 1/0;let a=n===-1?i.maxPathLengthBefore:i.maxPathLengthAfter;if(a===-1){a=0;const r=n===-1?i.linksBefore:i.linksAfter;for(const l of e){const{fromNode:c,toNode:h}=l,d=n===-1?h.id:c.id,u=n===-1?c.id:h.id,p=s===d?t.get(u):void 0;p!=null&&(r.push({node:p,link:l}),o?.push(s),a=Math.max(a,computePathLength(t,e,p,u,n,o)+1),o?.pop())}n===-1?i.maxPathLengthBefore=a:i.maxPathLengthAfter=a}return a}var{Series:Series2,DataController:DataController2,keyProperty:keyProperty8,valueProperty:valueProperty11,Selection:Selection5,Group:Group11,TransformableText:TransformableText2}=module_support_exports,FlowProportionSeriesNodeEvent=class extends module_support_exports.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s);const{datumIndex:n}=i,o=s.contextNodeData?.nodeData.find(a=>a.datumIndex.type===n.type&&a.datumIndex.index===n.index);this.size=o?.size,this.label=o?.type===1?o?.label:void 0}},FlowProportionSeries=class extends Series2{constructor(){super(...arguments),this.NodeEvent=FlowProportionSeriesNodeEvent,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 Group11({name:"linkGroup"})),this.nodeGroup=this.contentGroup.appendChild(new Group11({name:"nodeGroup"})),this.focusLinkGroup=this.highlightNode.appendChild(new Group11({name:"linkGroup"})),this.focusNodeGroup=this.highlightNode.appendChild(new Group11({name:"nodeGroup"})),this.highlightLinkGroup=this.highlightNode.appendChild(new Group11({name:"linkGroup"})),this.highlightNodeGroup=this.highlightNode.appendChild(new Group11({name:"nodeGroup"})),this.labelSelection=Selection5.select(this.labelGroup,TransformableText2),this.linkSelection=Selection5.select(this.linkGroup,()=>this.linkFactory()),this.nodeSelection=Selection5.select(this.nodeGroup,()=>this.nodeFactory()),this.focusLinkSelection=Selection5.select(this.focusLinkGroup,()=>this.linkFactory()),this.focusNodeSelection=Selection5.select(this.focusNodeGroup,()=>this.nodeFactory()),this.highlightLinkSelection=Selection5.select(this.highlightLinkGroup,()=>this.linkFactory()),this.highlightNodeSelection=Selection5.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:s,toKey:n,sizeKey:o,idKey:a,labelKey:r}=this.properties,l=new DataController2("standalone",t.suppressFieldDotNotation),c=i!=null?l.request(this.id,i,{props:[keyProperty8(a,void 0,{id:"idValue",includeProperty:!1}),...r!=null?[valueProperty11(r,void 0,{id:"labelValue",includeProperty:!1})]:[]],groupByKeys:!0}):null,h=t.request(this.id,e,{props:[valueProperty11(s,void 0,{id:"fromValue",includeProperty:!1}),valueProperty11(n,void 0,{id:"toValue",includeProperty:!1}),...o!=null?[valueProperty11(o,void 0,{id:"sizeValue",includeProperty:!1,missingValue:0})]:[]],groupByKeys:!1});i!=null&&l.execute();const[d,u]=await Promise.all([c,h]);this.nodesDataModel=d?.dataModel,this.nodesProcessedData=d?.processedData,this.linksDataModel=u?.dataModel,this.linksProcessedData=u?.processedData;const p=new Map;if(d==null){const g=u.dataModel.resolveColumnById(this,"fromValue",u.processedData),f=u.dataModel.resolveColumnById(this,"toValue",u.processedData),m=y=>{const x=p.size;return{series:this,itemId:void 0,datum:{},datumIndex:{type:1,index:x},type:1,index:x,linksBefore:[],linksAfter:[],id:y,size:0,label:y}};u.processedData.dataSources.get(this.id)?.forEach((y,x)=>{const b=g[x],S=f[x];b==null||S==null||(p.has(b)||p.set(b,m(b)),p.has(S)||p.set(S,m(S)))})}else{const g=d.dataModel.resolveColumnById(this,"idValue",d.processedData),f=r!=null?d.dataModel.resolveColumnById(this,"labelValue",d.processedData):void 0;d.processedData.dataSources.get(this.id)?.forEach((m,y)=>{const x=g[y],b=f?.[y];p.set(x,{series:this,itemId:void 0,datum:m,datumIndex:{type:1,index:y},type:1,index:y,linksBefore:[],linksAfter:[],id:x,size:0,label:b})})}this.processedNodes=p}getNodeGraph(t,e,{includeCircularReferences:i}){const{linksDataModel:s,linksProcessedData:n}=this;if(s==null||n==null){const{links:g,nodeGraph:f,maxPathLength:m}=computeNodeGraph(new Map().values(),[],i);return this.nodeCount=0,this.linkCount=0,{nodeGraph:f,links:g,maxPathLength:m}}const{sizeKey:o}=this.properties,a=s.resolveColumnById(this,"fromValue",n),r=s.resolveColumnById(this,"toValue",n),l=o!=null?s.resolveColumnById(this,"sizeValue",n):void 0,c=new Map;this.processedNodes.forEach(g=>{const f=t(g);c.set(g.id,f)});const h=[];n.dataSources.get(this.id)?.forEach((g,f)=>{const m=a[f],y=r[f],x=l!=null?l[f]:1,b=c.get(m),S=c.get(y);if(x<=0||b==null||S==null)return;const v=e({series:this,itemId:void 0,datum:g,datumIndex:{type:0,index:f},type:0,index:f,fromNode:b,toNode:S,size:x});h.push(v)});const{links:d,nodeGraph:u,maxPathLength:p}=computeNodeGraph(c.values(),h,i);return u.forEach(g=>{g.datum.linksBefore=g.linksBefore.map(f=>f.link),g.datum.linksAfter=g.linksAfter.map(f=>f.link)}),this.nodeCount=u.size,this.linkCount=d.length,{nodeGraph:u,links:d,maxPathLength:p}}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 s=this.contextNodeData?.nodeData??[],n=this.contextNodeData?.labelData??[];let o=this.ctx.highlightManager?.getActiveHighlight();if(o?.series===this&&o.type==null){const{itemId:h}=o;o=h!=null?s.find(d=>d.type===1&&d.id===h):void 0}else o?.series!==this&&(o=void 0);this.contentGroup.visible=this.visible,this.contentGroup.opacity=o!=null?this.properties.highlightStyle.series.dimOpacity??1:1,this.labelSelection=this.updateLabelSelection({labelData:n,labelSelection:this.labelSelection}),this.updateLabelNodes({labelSelection:this.labelSelection}),this.linkSelection=this.updateLinkSelection({nodeData:s.filter(h=>h.type===0),datumSelection:this.linkSelection}),this.updateLinkNodes({datumSelection:this.linkSelection,isHighlight:!1}),this.nodeSelection=this.updateNodeSelection({nodeData:s.filter(h=>h.type===1),datumSelection:this.nodeSelection}),this.updateNodeNodes({datumSelection:this.nodeSelection,isHighlight:!1});let a,r,l,c;o?.type===1?(a=s.filter(h=>h.type===0&&(h.toNode===o||h.fromNode===o)),r=a.map(h=>h.fromNode===o?h.toNode:h.fromNode),r.push(o),l=[],c=[o]):o?.type===0?(a=[o],r=[o.fromNode,o.toNode],l=[o],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:s,strokes:n}=this.properties,{fill:o=s[e%s.length],fillOpacity:a=1,stroke:r=n[e%n.length],strokeWidth:l=0,strokeOpacity:c=1,lineDash:h=[0],lineDashOffset:d=0}=i;return{marker:{fill:o,fillOpacity:a,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}}}getLegendData(t){if(t!=="category")return[];const{showInLegend:e}=this.properties;return Array.from(this.processedNodes.values(),({id:i,label:s},n)=>({legendType:"category",id:this.id,itemId:i,seriesId:this.id,enabled:!0,label:{text:s??i},symbol:this.legendItemSymbol(1,n),hideInLegend:!e,isFixed:!0}))}pickNodeClosestDatum({x:t,y:e}){let i=1/0,s;return this.linkSelection.each((n,o)=>{const a=n.containsPoint(t,e)?0:1/0;a<i&&(i=a,s=o)}),this.nodeSelection.each((n,o)=>{const a=n.distanceSquared(t,e);a<i&&(i=a,s=o)}),s!=null?{datum:s,distance:Math.sqrt(i)}:void 0}getDatumAriaText(t,e){if(t.type===0)return this.ctx.localeManager.t("ariaAnnounceFlowProportionLink",{index:t.index+1,count:this.linkCount,from:t.fromNode.id,to:t.toNode.id,size:t.size,sizeName:this.properties.sizeName??this.properties.sizeKey});if(t.type===1)return this.ctx.localeManager.t("ariaAnnounceFlowProportionNode",{index:t.index+1,count:this.nodeCount,description:e})}pickFocus(t){const{datumIndexDelta:e,otherIndexDelta:i}=t,s=this.contextNodeData?.nodeData[t.datumIndex-t.datumIndexDelta];let n=s;if(i!==0||e===0)return;if(s?.type===0){const r=Array.from(this.linkSelection,h=>h.datum),c=r.indexOf(s)+e;if(c>=0&&c<r.length)n=r[c];else if(c>0)n=r[r.length-1];else{const h=Array.from(this.nodeSelection,d=>d.datum);n=h[h.length-1]}}else if(s?.type===1){const r=Array.from(this.nodeSelection,h=>h.datum),c=r.indexOf(s)+e;c>=0&&c<r.length?n=r[c]:c<0?n=r[0]:n=Array.from(this.linkSelection,d=>d.datum)[0]}if(n==null)return;const o=n.type===1?Array.from(this.nodeSelection).find(r=>r.datum===n):Array.from(this.linkSelection).find(r=>r.datum===n);if(o==null)return;const a=this.computeFocusBounds(o.node);if(a!=null)return{datum:o.datum,datumIndex:this.contextNodeData?.nodeData.indexOf(o.datum)??0,otherIndex:0,bounds:a,clipFocusBox:!0}}getCategoryValue(t){}datumIndexForCategoryValue(t){}},{BBox:BBox15,Path:Path9,ScenePathChangeDetection:ScenePathChangeDetection7}=module_support_exports;function bezierControlPoints({radius:t,startAngle:e,endAngle:i,tension:s}){const n=t*Math.cos(e),o=t*Math.sin(e),a=t*Math.cos(i),r=t*Math.sin(i),l=n*s,c=o*s,h=a*s,d=r*s;return{x:[n,l,h,a],y:[o,c,d,r]}}var ChordLink=class extends Path9{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:s,endAngle1:n,startAngle2:o,endAngle2:a,tension:r}=this,l=bezierControlPoints({radius:i,startAngle:s,endAngle:a,tension:r}),c=bezierControlPoints({radius:i,startAngle:o,endAngle:n,tension:r}),h=Math.min(...l.x,...c.x),d=Math.max(...l.x,...c.x)-h,u=Math.min(...l.y,...c.y),p=Math.max(...l.y,...c.y)-u;return new BBox15(t+h,e+u,d,p)}isPointInPath(t,e){return super.isPointInPath(t,e)&&this.getBBox().containsPoint(t,e)}tensionedCurveTo(t,e,i,s,n,o,a,r){const{path:l,tension:c}=this,h=1-c;l.cubicCurveTo((i-t)*h+t,(s-e)*h+e,(n-a)*h+a,(o-r)*h+r,a,r)}updatePath(){const{path:t,centerX:e,centerY:i,radius:s}=this;let{startAngle1:n,endAngle1:o,startAngle2:a,endAngle2:r}=this;n>a&&([n,a]=[a,n],[o,r]=[r,o]),t.clear();const l=e+s*Math.cos(n),c=i+s*Math.sin(n);t.moveTo(l,c),this.tensionedCurveTo(l,c,e,i,e,i,e+s*Math.cos(r),i+s*Math.sin(r)),t.arc(e,i,s,r,a,!0),this.tensionedCurveTo(e+s*Math.cos(a),i+s*Math.sin(a),e,i,e,i,e+s*Math.cos(o),i+s*Math.sin(o)),t.arc(e,i,s,o,n,!0),t.closePath()}};__decorateClass([ScenePathChangeDetection7()],ChordLink.prototype,"centerX",2),__decorateClass([ScenePathChangeDetection7()],ChordLink.prototype,"centerY",2),__decorateClass([ScenePathChangeDetection7()],ChordLink.prototype,"radius",2),__decorateClass([ScenePathChangeDetection7()],ChordLink.prototype,"startAngle1",2),__decorateClass([ScenePathChangeDetection7()],ChordLink.prototype,"endAngle1",2),__decorateClass([ScenePathChangeDetection7()],ChordLink.prototype,"startAngle2",2),__decorateClass([ScenePathChangeDetection7()],ChordLink.prototype,"endAngle2",2),__decorateClass([ScenePathChangeDetection7()],ChordLink.prototype,"tension",2);var{FillGradientDefaults:FillGradientDefaults7,FillPatternDefaults:FillPatternDefaults7,BaseProperties:BaseProperties24,SeriesTooltip:SeriesTooltip9,SeriesProperties:SeriesProperties2,ARRAY:ARRAY9,ARRAY_OF:ARRAY_OF2,COLOR_STRING:COLOR_STRING17,COLOR_STRING_ARRAY:COLOR_STRING_ARRAY5,FUNCTION:FUNCTION13,LINE_DASH:LINE_DASH12,OBJECT:OBJECT31,POSITIVE_NUMBER:POSITIVE_NUMBER24,RATIO:RATIO20,STRING:STRING31,OR:OR11,COLOR_GRADIENT:COLOR_GRADIENT7,TempValidate:TempValidate65,COLOR_PATTERN:COLOR_PATTERN7,Label:Label7}=module_support_exports,ChordSeriesLabelProperties=class extends Label7{constructor(){super(...arguments),this.spacing=1,this.maxWidth=1}};__decorateClass([TempValidate65(POSITIVE_NUMBER24)],ChordSeriesLabelProperties.prototype,"spacing",2),__decorateClass([TempValidate65(POSITIVE_NUMBER24)],ChordSeriesLabelProperties.prototype,"maxWidth",2);var ChordSeriesLinkProperties=class extends BaseProperties24{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}};__decorateClass([TempValidate65(OR11(COLOR_GRADIENT7,COLOR_STRING17,COLOR_PATTERN7),{optional:!0})],ChordSeriesLinkProperties.prototype,"fill",2),__decorateClass([TempValidate65(RATIO20)],ChordSeriesLinkProperties.prototype,"fillOpacity",2),__decorateClass([TempValidate65(COLOR_STRING17,{optional:!0})],ChordSeriesLinkProperties.prototype,"stroke",2),__decorateClass([TempValidate65(RATIO20)],ChordSeriesLinkProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate65(POSITIVE_NUMBER24)],ChordSeriesLinkProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate65(LINE_DASH12)],ChordSeriesLinkProperties.prototype,"lineDash",2),__decorateClass([TempValidate65(POSITIVE_NUMBER24)],ChordSeriesLinkProperties.prototype,"lineDashOffset",2),__decorateClass([TempValidate65(RATIO20)],ChordSeriesLinkProperties.prototype,"tension",2),__decorateClass([TempValidate65(FUNCTION13,{optional:!0})],ChordSeriesLinkProperties.prototype,"itemStyler",2);var ChordSeriesNodeProperties=class extends BaseProperties24{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}};__decorateClass([TempValidate65(POSITIVE_NUMBER24)],ChordSeriesNodeProperties.prototype,"spacing",2),__decorateClass([TempValidate65(POSITIVE_NUMBER24)],ChordSeriesNodeProperties.prototype,"width",2),__decorateClass([TempValidate65(OR11(COLOR_GRADIENT7,COLOR_STRING17,COLOR_PATTERN7),{optional:!0})],ChordSeriesNodeProperties.prototype,"fill",2),__decorateClass([TempValidate65(RATIO20)],ChordSeriesNodeProperties.prototype,"fillOpacity",2),__decorateClass([TempValidate65(COLOR_STRING17,{optional:!0})],ChordSeriesNodeProperties.prototype,"stroke",2),__decorateClass([TempValidate65(RATIO20)],ChordSeriesNodeProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate65(POSITIVE_NUMBER24)],ChordSeriesNodeProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate65(LINE_DASH12)],ChordSeriesNodeProperties.prototype,"lineDash",2),__decorateClass([TempValidate65(POSITIVE_NUMBER24)],ChordSeriesNodeProperties.prototype,"lineDashOffset",2),__decorateClass([TempValidate65(FUNCTION13,{optional:!0})],ChordSeriesNodeProperties.prototype,"itemStyler",2);var ChordSeriesProperties=class extends SeriesProperties2{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.fillGradientDefaults=new FillGradientDefaults7,this.fillPatternDefaults=new FillPatternDefaults7,this.fills=[],this.strokes=[],this.label=new ChordSeriesLabelProperties,this.link=new ChordSeriesLinkProperties,this.node=new ChordSeriesNodeProperties,this.tooltip=new SeriesTooltip9}};__decorateClass([TempValidate65(STRING31)],ChordSeriesProperties.prototype,"fromKey",2),__decorateClass([TempValidate65(STRING31)],ChordSeriesProperties.prototype,"toKey",2),__decorateClass([TempValidate65(STRING31)],ChordSeriesProperties.prototype,"idKey",2),__decorateClass([TempValidate65(STRING31,{optional:!0})],ChordSeriesProperties.prototype,"idName",2),__decorateClass([TempValidate65(STRING31,{optional:!0})],ChordSeriesProperties.prototype,"labelKey",2),__decorateClass([TempValidate65(STRING31,{optional:!0})],ChordSeriesProperties.prototype,"labelName",2),__decorateClass([TempValidate65(STRING31,{optional:!0})],ChordSeriesProperties.prototype,"sizeKey",2),__decorateClass([TempValidate65(STRING31,{optional:!0})],ChordSeriesProperties.prototype,"sizeName",2),__decorateClass([TempValidate65(ARRAY9,{optional:!0})],ChordSeriesProperties.prototype,"nodes",2),__decorateClass([TempValidate65(OBJECT31)],ChordSeriesProperties.prototype,"fillGradientDefaults",2),__decorateClass([TempValidate65(OBJECT31)],ChordSeriesProperties.prototype,"fillPatternDefaults",2),__decorateClass([TempValidate65(ARRAY_OF2(OR11(COLOR_GRADIENT7,COLOR_STRING17,COLOR_PATTERN7)))],ChordSeriesProperties.prototype,"fills",2),__decorateClass([TempValidate65(COLOR_STRING_ARRAY5)],ChordSeriesProperties.prototype,"strokes",2),__decorateClass([TempValidate65(OBJECT31)],ChordSeriesProperties.prototype,"label",2),__decorateClass([TempValidate65(OBJECT31)],ChordSeriesProperties.prototype,"link",2),__decorateClass([TempValidate65(OBJECT31)],ChordSeriesProperties.prototype,"node",2),__decorateClass([TempValidate65(OBJECT31)],ChordSeriesProperties.prototype,"tooltip",2);var{SeriesNodePickMode:SeriesNodePickMode7,CachedTextMeasurerPool:CachedTextMeasurerPool5,TextWrapper:TextWrapper6,TextUtils:TextUtils6,createDatumId:createDatumId10,angleBetween:angleBetween3,normalizeAngle360:normalizeAngle3606,isBetweenAngles:isBetweenAngles2,Sector:Sector4,evaluateBezier:evaluateBezier2,applyShapeStyle:applyShapeStyle5,getShapeStyle:getShapeStyle8,BBox:BBox16}=module_support_exports,nodeMidAngle=t=>t.startAngle+angleBetween3(t.startAngle,t.endAngle)/2,ChordSeries=class extends FlowProportionSeries{constructor(t){super({moduleCtx:t,pickModes:[SeriesNodePickMode7.NEAREST_NODE,SeriesNodePickMode7.EXACT_SHAPE_MATCH]}),this.properties=new ChordSeriesProperties}isLabelEnabled(){return(this.properties.labelKey!=null||this.nodes==null)&&this.properties.label.enabled}linkFactory(){return new ChordLink}nodeFactory(){return new Sector4}createNodeData(){const{id:t,_nodeDataDependencies:{seriesRectWidth:e,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0}}=this,{fromKey:s,toKey:n,sizeKey:o,label:{spacing:a,maxWidth:r,fontSize:l},node:{width:c,spacing:h}}=this.properties,d=e/2,u=i/2;let p=[];const{nodeGraph:g,links:f}=this.getNodeGraph(O=>({...O,centerX:d,centerY:u,innerRadius:NaN,outerRadius:NaN,startAngle:NaN,endAngle:NaN}),O=>({...O,centerX:d,centerY:u,radius:NaN,startAngle1:NaN,endAngle1:NaN,startAngle2:NaN,endAngle2:NaN}),{includeCircularReferences:!0});let m=0;g.forEach(({datum:O,linksBefore:F,linksAfter:R},E)=>{const _=F.reduce((G,{link:B})=>G+B.size,0)+R.reduce((G,{link:B})=>G+B.size,0);if(_===0)g.delete(E);else{O.size=_,m+=O.size;const G=this.getLabelText(this.properties.label,{datum:O.datum,value:O.label,fromKey:s,toKey:n,sizeKey:o,size:O.size});O.label=String(G)}});let y=0;if(this.isLabelEnabled()){const O=this.properties.label.getFont();let F=0;g.forEach(({datum:R})=>{const{id:E,label:_}=R;if(_==null)return;const G=TextWrapper6.wrapText(_,{maxWidth:r,font:this.properties.label,textWrap:"never"}),{width:B}=CachedTextMeasurerPool5.measureText(G,{font:O,textAlign:"left",textBaseline:"middle"});F=Math.max(B,F),p.push({id:E,text:G,centerX:d,centerY:u,angle:NaN,radius:NaN})}),y=F+a}const x=g.size;let b=Math.min(e,i)/2-c-y,S=h/b;if(y!==0&&(x*S>=1.5*Math.PI||b<=0)&&(p=[],b=Math.min(e,i)/2-c,S=h/b),x*S>=2*Math.PI||b<=0){logger_exports.warnOnce("There was insufficient space to display the Chord Series.");return}const v=b,I=b+c,A=Math.max((2*Math.PI-x*S)/m,0);let D=0;g.forEach(({datum:O})=>{O.innerRadius=v,O.outerRadius=I,O.startAngle=D,O.endAngle=D+O.size*A,D=O.endAngle+S;const F=(O.innerRadius+O.outerRadius)/2,R=nodeMidAngle(O);O.midPoint={x:O.centerX+F*Math.cos(R),y:O.centerY+F*Math.sin(R)}});const T=[];g.forEach(({datum:O,linksBefore:F,linksAfter:R})=>{const E=nodeMidAngle(O),_=[...F.map(B=>({link:B.link,distance:angleBetween3(nodeMidAngle(B.node.datum),E),after:!1})),...R.map(B=>({link:B.link,distance:angleBetween3(nodeMidAngle(B.node.datum),E),after:!0}))];let G=O.startAngle;_.toSorted((B,z)=>B.distance-z.distance).forEach(({link:B,after:z})=>{const P=B.size*A;z?(B.startAngle1=G,B.endAngle1=G+P):(B.startAngle2=G,B.endAngle2=G+P),G+=B.size*A}),T.push(O)});const{tension:k}=this.properties.link;f.forEach(O=>{O.radius=b;const F=bezierControlPoints({radius:b,startAngle:O.startAngle1,endAngle:O.endAngle2,tension:k}),R=bezierControlPoints({radius:b,startAngle:O.startAngle2,endAngle:O.endAngle1,tension:k}),E=evaluateBezier2(...F.x,.5),_=evaluateBezier2(...F.y,.5),G=evaluateBezier2(...R.x,.5),B=evaluateBezier2(...R.y,.5);O.midPoint={x:O.centerX+(E+G)/2,y:O.centerY+(_+B)/2},T.push(O)}),p.forEach(O=>{const F=g.get(O.id)?.datum;F!=null&&(O.radius=I+a,O.angle=normalizeAngle3606(F.startAngle+angleBetween3(F.startAngle,F.endAngle)/2))}),p.sort((O,F)=>O.angle-F.angle);let w=1/0,L=-1/0;return p=p.filter(O=>{const F=TextUtils6.getLineHeight(l),R=Math.atan2(F/2,O.radius),E=O.angle-R,_=O.angle+R;return isBetweenAngles2(w,E,_)||isBetweenAngles2(L,E,_)?!1:(w=Math.min(E,w),L=Math.max(_,L),!0)}),{itemId:t,nodeData:T,labelData:p}}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e)}updateLabelNodes(t){const{labelSelection:e}=t,{color:i,fontStyle:s,fontWeight:n,fontSize:o,fontFamily:a}=this.properties.label;e.each((r,{text:l,centerX:c,centerY:h,radius:d,angle:u})=>{r.visible=!0,r.translationX=c+d*Math.cos(u),r.translationY=h+d*Math.sin(u),r.text=l,r.fill=i,r.fontStyle=s,r.fontWeight=n,r.fontSize=o,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=>createDatumId10([e.type,e.id]))}getBaseNodeStyle(t){const{properties:e}=this,{fill:i,fillOpacity:s,stroke:n,strokeOpacity:o,lineDash:a,lineDashOffset:r}=e.node,l=t?e.highlightStyle.item:void 0;return getShapeStyle8({fill:l?.fill??i,fillOpacity:l?.fillOpacity??s,stroke:l?.stroke??n,strokeOpacity:l?.strokeOpacity??o,strokeWidth:l?.strokeWidth??this.getStrokeWidth(e.node.strokeWidth),lineDash:l?.lineDash??a,lineDashOffset:l?.lineDashOffset??r},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}getNodeStyleOverrides(t,e,i,s,n,o,a){const{id:r,properties:l}=this,{fills:c,strokes:h}=l,{itemStyler:d}=l.node,u=o.fill??c[i%c.length],p=o.stroke??h[i%h.length];let g;if(a||(g??(g={}),g.fill=u,g.stroke=p),d!=null){const f=this.cachedDatumCallback(createDatumId10(t,"node",a?"highlight":"node"),()=>{const{fillOpacity:m=1,strokeOpacity:y=1,strokeWidth:x=0,lineDash:b=[],lineDashOffset:S=0}=o;return this.callWithContext(d,{seriesId:r,datum:e,highlighted:a,label:n,size:s,fill:u,fillOpacity:m,stroke:p,strokeOpacity:y,strokeWidth:x,lineDash:b,lineDashOffset:S})});g??(g={}),Object.assign(g,f)}return getShapeStyle8(g,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}updateNodeNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getBaseNodeStyle(i),n=this.getShapeFillBBox();e.each((o,a)=>{const{datumIndex:r,size:l,label:c}=a,h=this.getNodeStyleOverrides(String(r.index),a.datum,r.index,l,c,s,i);applyShapeStyle5(o,s,h,n),o.centerX=a.centerX,o.centerY=a.centerY,o.innerRadius=a.innerRadius,o.outerRadius=a.outerRadius,o.startAngle=a.startAngle,o.endAngle=a.endAngle,o.inset=o.strokeWidth/2})}updateLinkSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>createDatumId10([e.type,e.index,e.fromNode.id,e.toNode.id]))}getBaseLinkStyle(t){const{properties:e}=this,{fill:i,fillOpacity:s,stroke:n,strokeOpacity:o,lineDash:a,lineDashOffset:r,tension:l}=e.link,c=t?e.highlightStyle.item:void 0;return getShapeStyle8({fill:c?.fill??i,fillOpacity:c?.fillOpacity??s,stroke:c?.stroke??n,strokeOpacity:c?.strokeOpacity??o,strokeWidth:c?.strokeWidth??this.getStrokeWidth(e.link.strokeWidth),lineDash:c?.lineDash??a,lineDashOffset:c?.lineDashOffset??r,tension:l},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}getLinkStyleOverrides(t,e,i,s,n){const{id:o,properties:a}=this,{fills:r,strokes:l}=a,{itemStyler:c}=a.link,h=s.fill??r[i%r.length],d=s.stroke??l[i%l.length];let u;if(n||(u??(u={}),u.fill=h,u.stroke=d),c!=null){const p=this.cachedDatumCallback(createDatumId10(t,"link",n?"highlight":"node"),()=>{const{fillOpacity:g=1,strokeOpacity:f=1,strokeWidth:m=0,lineDash:y=[],lineDashOffset:x=0,tension:b}=s;return this.callWithContext(c,{seriesId:o,datum:e,highlighted:n,tension:b,fill:h,fillOpacity:g,stroke:d,strokeOpacity:f,strokeWidth:m,lineDash:y,lineDashOffset:x})});u??(u={}),Object.assign(u,p)}return getShapeStyle8(u,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}updateLinkNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getBaseLinkStyle(i),n=this.getShapeFillBBox();e.each((o,a)=>{const{datumIndex:r}=a,l=a.fromNode.datumIndex,c=this.getLinkStyleOverrides(String(r.index),a.datum,l.index,s,i);o.centerX=a.centerX,o.centerY=a.centerY,o.radius=a.radius,o.startAngle1=a.startAngle1,o.endAngle1=a.endAngle1,o.startAngle2=a.startAngle2,o.endAngle2=a.endAngle2,applyShapeStyle5(o,s,c,n),o.tension=c?.tension??s.tension})}getShapeFillBBox(){const t=this._nodeDataDependencies?.seriesRectWidth??0,e=this._nodeDataDependencies?.seriesRectHeight??0,i=Math.min(t,e),s=(t-i)/2,n=(e-i)/2,o=new BBox16(s,n,t,e);return{series:o,axis:o}}getTooltipContent(t){const{id:e,linksProcessedData:i,nodesProcessedData:s,properties:n}=this,{fromKey:o,toKey:a,sizeKey:r,sizeName:l,tooltip:c}=n,h=this.contextNodeData?.nodeData.find(m=>m.datumIndex.type===t.type&&m.datumIndex.index===t.index);if(h==null)return;const d=h.type===0?h.fromNode.index:h.index,u=h.type===0?`${h.fromNode.label} - ${h.toNode.label}`:h.label,p=t.type===0?i?.dataSources.get(this.id)?.[t.index]:s?.dataSources.get(this.id)?.[t.index],g=h.size;let f;if(h.type===0){const m=h.fromNode.datumIndex,y=this.getBaseLinkStyle(!1);Object.assign(y,this.getLinkStyleOverrides(String(t.index),p,m.index,y,!1)),f=y}else{const m=h.label,y=this.getBaseNodeStyle(!1);Object.assign(y,this.getNodeStyleOverrides(String(t.index),p,t.index,g,m,y,!1)),f=y}return c.formatTooltip(this.properties,{title:u,symbol:this.legendItemSymbol(h.type,d,f),data:r!=null?[{label:l,fallbackLabel:r,value:String(g)}]:[]},{seriesId:e,datum:p,title:u,fromKey:o,toKey:a,sizeKey:r,sizeName:l,size:g,...f})}computeFocusBounds(t){return t}};ChordSeries.className="ChordSeries",ChordSeries.type="chord";var{commonSeriesOptionsDefs:commonSeriesOptionsDefs9,seriesLabelOptionsDefs:seriesLabelOptionsDefs5,tooltipOptionsDefs:tooltipOptionsDefs9}=module_support_exports,chordSeriesOptionsDef={type:required(constant("chord")),fromKey:required(string),toKey:required(string),sizeKey:string,sizeName:string,fills:arrayOf(colorUnion),strokes:arrayOf(color),label:{spacing:positiveNumber,maxWidth:positiveNumber,...seriesLabelOptionsDefs5},link:{tension:ratio,itemStyler:callback,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},node:{width:positiveNumber,spacing:positiveNumber,itemStyler:callback,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},tooltip:tooltipOptionsDefs9,...commonSeriesOptionsDefs9};chordSeriesOptionsDef.fillGradientDefaults=fillGradientDefaults,chordSeriesOptionsDef.fillPatternDefaults=fillPatternDefaults;var ChordModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["flow-proportion"],solo:!0,identifier:"chord",tooltipDefaults:{range:"exact"},moduleFactory:t=>new ChordSeries(t),themeTemplate:{series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:module_support_exports.FILL_PATTERN_DEFAULTS,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}}},ChordSeriesModule={type:"series",name:"chord",chartType:"flow-proportion",enterprise:!0,options:chordSeriesOptionsDef,create:t=>new ChordSeries(t)},{ThemeConstants:{CARTESIAN_AXIS_TYPE:CARTESIAN_AXIS_TYPE8,CARTESIAN_POSITION:CARTESIAN_POSITION6},ThemeSymbols:{DEFAULT_SHADOW_COLOUR:DEFAULT_SHADOW_COLOUR2}}=module_support_exports,FUNNEL_SERIES_AXES={$if:[{$eq:[{$path:["/direction",void 0]},"horizontal"]},[{type:CARTESIAN_AXIS_TYPE8.NUMBER,position:CARTESIAN_POSITION6.LEFT},{type:CARTESIAN_AXIS_TYPE8.CATEGORY,position:{$if:[{$eq:[{$path:["/stageLabel/placement",void 0]},"before"]},CARTESIAN_POSITION6.TOP,CARTESIAN_POSITION6.BOTTOM]},label:{$omit:[["placement"],{$path:["/stageLabel",void 0]}]}}],[{type:CARTESIAN_AXIS_TYPE8.CATEGORY,position:{$if:[{$eq:[{$path:["/stageLabel/placement",void 0]},"after"]},CARTESIAN_POSITION6.RIGHT,CARTESIAN_POSITION6.LEFT]},label:{$omit:[["placement"],{$path:["/stageLabel",void 0]}]}},{type:CARTESIAN_AXIS_TYPE8.NUMBER,position:CARTESIAN_POSITION6.BOTTOM}]]},FUNNEL_SERIES_THEME={series:{direction:"vertical",strokeWidth:0,spacingRatio:.25,fills:[{$palette:"fill"}],strokes:[{$palette:"stroke"}],fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:module_support_exports.FILL_PATTERN_DEFAULTS,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:DEFAULT_SHADOW_COLOUR2,xOffset:3,yOffset:3,blur:5}},axes:{[CARTESIAN_AXIS_TYPE8.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1,formatter(t){return Math.abs(t.value).toFixed(t.fractionDigits??0)}}},[CARTESIAN_AXIS_TYPE8.CATEGORY]:{line:{enabled:!1}}}},{lineDistanceSquared:lineDistanceSquared2,BBox:BBox17,Path:Path10,ScenePathChangeDetection:ScenePathChangeDetection8}=module_support_exports,delta4=1e-6;function pointsEq2([t,e],[i,s]){return Math.abs(t-i)<=delta4&&Math.abs(e-s)<=delta4}var FunnelConnector=class extends Path10{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:s,x2:n,y2:o,x3:a,y3:r}=this;return{x:(t+i+n+a)/4,y:(e+s+o+r)/4}}distanceSquared(t,e){if(this.containsPoint(t,e))return 0;const{x0:i,y0:s,x1:n,y1:o,x2:a,y2:r,x3:l,y3:c}=this;return Math.min(lineDistanceSquared2(t,e,i,s,n,o,1/0),lineDistanceSquared2(t,e,n,o,a,r,1/0),lineDistanceSquared2(t,e,a,r,l,c,1/0),lineDistanceSquared2(t,e,l,c,i,s,1/0))}computeBBox(){const{x0:t,y0:e,x1:i,y1:s,x2:n,y2:o,x3:a,y3:r}=this,l=Math.min(t,i,n,a),c=Math.max(t,i,n,a)-l,h=Math.min(e,s,o,r),d=Math.max(e,s,o,r)-h;return new BBox17(l,h,c,d)}updatePath(){const{path:t,x0:e,y0:i,x1:s,y1:n,x2:o,y2:a,x3:r,y3:l}=this,c=[[e,i],[s,n],[o,a],[r,l]];t.clear();let h,d;c.forEach(u=>{if(h!=null&&pointsEq2(h,u)||d!=null&&pointsEq2(d,u))return;const[p,g]=u;h==null?t.moveTo(p,g):t.lineTo(p,g),h??(h=u),d=u}),t.closePath()}};__decorateClass([ScenePathChangeDetection8()],FunnelConnector.prototype,"x0",2),__decorateClass([ScenePathChangeDetection8()],FunnelConnector.prototype,"y0",2),__decorateClass([ScenePathChangeDetection8()],FunnelConnector.prototype,"x1",2),__decorateClass([ScenePathChangeDetection8()],FunnelConnector.prototype,"y1",2),__decorateClass([ScenePathChangeDetection8()],FunnelConnector.prototype,"x2",2),__decorateClass([ScenePathChangeDetection8()],FunnelConnector.prototype,"y2",2),__decorateClass([ScenePathChangeDetection8()],FunnelConnector.prototype,"x3",2),__decorateClass([ScenePathChangeDetection8()],FunnelConnector.prototype,"y3",2);var{NODE_UPDATE_STATE_TO_PHASE_MAPPING:NODE_UPDATE_STATE_TO_PHASE_MAPPING2}=module_support_exports;function connectorStartingPosition(t,e,i,s){const{x0:n,y0:o,x1:a,y1:r,x2:l,y2:c,x3:h,y3:d,opacity:u}=t;return i?{x0:(n+h)/2,y0:(o+d)/2,x1:(a+l)/2,y1:(r+c)/2,x2:(a+l)/2,y2:(r+c)/2,x3:(n+h)/2,y3:(o+d)/2,opacity:u}:{x0:(n+a)/2,y0:(o+r)/2,x1:(n+a)/2,y1:(o+r)/2,x2:(l+h)/2,y2:(c+d)/2,x3:(l+h)/2,y3:(c+d)/2,opacity:u}}function prepareConnectorAnimationFunctions(t,e){const i=o=>o==null;return{fromFn:(o,a,r)=>{r==="updated"&&i(a)?r="removed":r==="updated"&&i(o.previousDatum)&&(r="added");let l;r==="added"&&o.previousDatum==null&&e==="fade"?l={...resetConnectorSelectionsFn(o,a),opacity:0}:r==="unknown"||r==="added"?l=connectorStartingPosition(a,o.previousDatum,t,e):l={x0:o.x0,y0:o.y0,x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2,x3:o.x3,y3:o.y3,opacity:o.opacity};const c=NODE_UPDATE_STATE_TO_PHASE_MAPPING2[r];return{...l,phase:c}},toFn:(o,a,r)=>{let l;return r==="removed"&&o.datum==null&&e==="fade"?l={...resetConnectorSelectionsFn(o,a),opacity:0}:r==="removed"||i(a)?l=connectorStartingPosition(a,o.previousDatum,t,e):l=resetConnectorSelectionsFn(o,a),l}}}function resetConnectorSelectionsFn(t,e){const{x0:i,y0:s,x1:n,y1:o,x2:a,y2:r,x3:l,y3:c,opacity:h}=e;return{x0:i,y0:s,x1:n,y1:o,x2:a,y2:r,x3:l,y3:c,opacity:h}}var{SeriesNodePickMode:SeriesNodePickMode8,SeriesZIndexMap:SeriesZIndexMap2,valueProperty:valueProperty12,keyProperty:keyProperty9,ChartAxisDirection:ChartAxisDirection24,updateLabelNode:updateLabelNode5,SMALLEST_KEY_INTERVAL:SMALLEST_KEY_INTERVAL5,LARGEST_KEY_INTERVAL:LARGEST_KEY_INTERVAL3,diff:diff6,fixNumericExtent:fixNumericExtent8,seriesLabelFadeInAnimation:seriesLabelFadeInAnimation5,resetMotion:resetMotion3,resetLabelFn:resetLabelFn5,animationValidation:animationValidation7,computeBarFocusBounds:computeBarFocusBounds7,ContinuousScale:ContinuousScale9,Group:Group12,Selection:Selection6,PointerEvents:PointerEvents5,motion:motion5,checkCrisp:checkCrisp4,createDatumId:createDatumId11,applyShapeFillBBox:applyShapeFillBBox5,getShapeStyle:getShapeStyle9,getShapeFill:getShapeFill4}=module_support_exports,FunnelSeriesNodeEvent=class extends module_support_exports.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.xKey=s.properties.stageKey,this.yKey=s.properties.valueKey}},BaseFunnelSeries=class extends module_support_exports.AbstractBarSeries{constructor({moduleCtx:t,animationResetFns:e}){super({moduleCtx:t,pickModes:[SeriesNodePickMode8.AXIS_ALIGNED,SeriesNodePickMode8.EXACT_SHAPE_MATCH],hasHighlightedLabels:!0,directionKeys:{x:["stageKey"],y:["valueKey"]},directionNames:{x:[],y:[]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:e.datum,label:resetLabelFn5}}),this.NodeEvent=FunnelSeriesNodeEvent,this.connectorNodeGroup=this.contentGroup.appendChild(new Group12({name:`${this.id}-series-connectorNodes`,zIndex:SeriesZIndexMap2.BACKGROUND})),this.connectorSelection=Selection6.select(this.connectorNodeGroup,()=>this.connectionFactory()),this.connectorNodeGroup.pointerEvents=PointerEvents5.None}get pickModeAxis(){return"main-category"}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.connectorNodeGroup.zIndex=[SeriesZIndexMap2.BACKGROUND,t],!0):!1}isVertical(){return!super.isVertical()}connectionFactory(){return new FunnelConnector}async processData(t){if(!this.properties.isValid())return;const{stageKey:e,valueKey:i}=this.properties,{visible:s,id:n}=this,o=(g,f,m)=>s&&this.ctx.legendManager.getItemEnabled({seriesId:n,itemId:m}),a=this.getCategoryAxis()?.scale,r=this.getValueAxis()?.scale,{isContinuousX:l,xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:a,yScale:r}),d=[];this.ctx.animationManager.isSkipped()||(this.processedData&&d.push(diff6(this.id,this.processedData)),d.push(animationValidation7()));const u=this.visible?{}:{forceValue:0},{processedData:p}=await this.requestDataModel(t,this.data,{props:[keyProperty9(e,c,{id:"xValue"}),valueProperty12(i,h,{id:"yValue",...u,validation:o,invalidValue:0}),...l?[SMALLEST_KEY_INTERVAL5,LARGEST_KEY_INTERVAL3]:[],...d],groupByKeys:!1});this.smallestDataInterval=p.reduced?.smallestKeyInterval,this.largestDataInterval=p.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(t){const{processedData:e,dataModel:i,id:s,ctx:{legendManager:n}}=this;if(!e||!i)return[];const{keys:[o]}=e.domain;if(t===this.getCategoryDirection()){const a=i.resolveProcessedDataDefById(this,"xValue");return a?.def.type==="key"&&a?.def.valueType==="category"?this.hasData?o.filter((r,l)=>n.getItemEnabled({seriesId:s,itemId:l})):[]:this.padBandExtent(o)}else{const a=this.domainForClippedRange(ChartAxisDirection24.Y,["yValue"],"xValue",!0),r=Math.max(...a),l=[-r,r];return fixNumericExtent8(l)}}getSeriesRange(t,e){return[NaN,NaN]}createNodeData(){const{hasData:t,data:e,dataModel:i,groupScale:s,processedData:n,id:o,ctx:{legendManager:a}}=this,r=this.getCategoryAxis(),l=this.getValueAxis();if(!(t&&e&&r&&l&&i&&n?.type==="ungrouped"))return;const c=r.scale,h=l.scale,d=this.getBarDirection()===ChartAxisDirection24.X,{stageKey:u,valueKey:p}=this.properties,{strokeWidth:g}=this.barStyle(),f=`${p}`,m={itemId:f,nodeData:[],labelData:[],connectorData:[],scales:this.calculateScaling(),visible:this.visible},y=this.visible;if(!y)return m;const x=i.resolveKeysById(this,"xValue",n),b=i.resolveColumnById(this,"yValue",n),{barWidth:S,groupIndex:v}=this.updateGroupScale(r),I=ContinuousScale9.is(c)?S*-.5:0,A=checkCrisp4(r?.scale,r?.visibleRange,this.smallestDataInterval,this.largestDataInterval);let D;return(n.dataSources.get(this.id)??[]).forEach((k,w)=>{const L=y&&a.getItemEnabled({seriesId:o,itemId:w}),O=x[w];if(O==null)return;const F=Math.round(c.convert(O))+s.convert(String(v))+I,R=b[w],E=Math.round(h.convert(-R)),_=Math.round(h.convert(R)),G=Math.max(g,Math.abs(_-E)),B={x:d?Math.min(_,E):F,y:d?F:Math.min(_,E),width:d?G:S,height:d?S:G},z={x:B.x+B.width/2,y:B.y+B.height/2},P=this.createLabelData({datumIndex:w,rect:B,barAlongX:d,yDatum:R,datum:k,visible:L}),V={index:w,series:this,itemId:f,datum:k,datumIndex:w,xValue:O,yValue:R,xKey:u,yKey:p,x:B.x,y:B.y,width:B.width,height:B.height,midPoint:z,strokeWidth:g,crisp:A,label:P,visible:L};if(m.nodeData.push(V),P!=null&&m.labelData.push(P),D!=null){const j=D.rect,H=D.nodeDatum,Y=D.datumIndex;d?m.connectorData.push({datum:H,datumIndex:Y,x0:j.x,y0:j.y+j.height,x1:j.x+j.width,y1:j.y+j.height,x2:B.x+B.width,y2:B.y,x3:B.x,y3:B.y,opacity:1}):m.connectorData.push({datum:H,datumIndex:Y,x0:j.x+j.width,y0:j.y,x1:B.x,y1:B.y,x2:B.x,y2:B.y+B.height,x3:j.x+j.width,y3:j.y+j.height,opacity:1})}L&&(D={itemId:f,rect:B,nodeDatum:V,datumIndex:w})}),m}updateNodes(t,e,i){super.updateNodes(t,e,i);const{connectorSelection:s}=this,n=this.contextNodeData?.connectorData??[];this.connectorSelection=this.updateConnectorSelection({connectorSelection:s,connectorData:n}),this.updateConnectorNodes({connectorSelection:s})}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,s=e??[];return i.update(s,void 0,n=>this.getDatumId(n))}updateConnectorSelection(t){const{connectorData:e,connectorSelection:i}=t;return i.update(this.connectorEnabled()?e:[],void 0,s=>this.getDatumId(s.datum))}updateConnectorNodes(t){const{fills:e,strokes:i,fillGradientDefaults:s,fillPatternDefaults:n}=this.properties,{fill:o,fillOpacity:a,stroke:r,strokeOpacity:l,strokeWidth:c,lineDash:h,lineDashOffset:d}=this.connectorStyle(),u=this.getShapeFillBBox();t.connectorSelection.each((p,g)=>{const{datumIndex:f}=g;p.setProperties(resetConnectorSelectionsFn(p,g));const m=getShapeFill4(o??e[f%e.length],s,n);p.fill=m,applyShapeFillBBox5(p,m,u),p.fillOpacity=a,p.stroke=r??i[f%i.length],p.strokeOpacity=l,p.strokeWidth=c,p.lineDash=h,p.lineDashOffset=d})}getHighlightLabelData(t,e){const i=t.filter(s=>s.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=PointerEvents5.None})}updateLabelNodes(t){t.labelSelection.each((e,i)=>{updateLabelNode5(e,this.properties.label,i)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{stageKey:o,valueKey:a,tooltip:r}=n,l=this.getCategoryAxis(),c=this.getValueAxis();if(!i||!s||!l||!c)return;const h=s.dataSources.get(this.id)?.[t],d=i.resolveKeysById(this,"xValue",s)[t],u=i.resolveColumnById(this,"yValue",s)[t];if(d!=null)return r.formatTooltip(this.properties,{symbol:this.legendItemSymbol(t),data:[{label:l.formatDatum(d),value:c.formatDatum(u)}]},{seriesId:e,datum:h,title:o,stageKey:o,valueKey:a,...this.tooltipStyle(h,t)})}resetAllAnimation(t){super.resetAllAnimation(t),resetMotion3([this.connectorSelection],resetConnectorSelectionsFn)}animateEmptyUpdateReady({labelSelection:t}){const{connectorSelection:e}=this,i=this.isVertical(),n=prepareConnectorAnimationFunctions(i,"normal");motion5.fromToMotion(this.id,"connectors",this.ctx.animationManager,[e],n),seriesLabelFadeInAnimation5(this,"labels",this.ctx.animationManager,t)}animateWaitingUpdateReady(t){const{labelSelection:e}=t;this.ctx.animationManager.stopByAnimationGroupId(this.id),seriesLabelFadeInAnimation5(this,"labels",this.ctx.animationManager,e)}getDatumId(t){return createDatumId11(t.xValue)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){return computeBarFocusBounds7(this,this.contextNodeData?.nodeData[t])}legendItemSymbol(t){const{strokeWidth:e,fillOpacity:i,strokeOpacity:s,lineDash:n,lineDashOffset:o,fillGradientDefaults:a,fillPatternDefaults:r}=this.barStyle(),{fills:l,strokes:c}=this.properties,h=l[t%l.length]??"black",d=c[t%c.length]??"black";return{marker:getShapeStyle9({fill:h,fillOpacity:i,stroke:d,strokeWidth:e,strokeOpacity:s,lineDash:n,lineDashOffset:o},a,r)}}getLegendData(t){const{id:e,processedData:i,dataModel:s,ctx:{legendManager:n},visible:o}=this;if(!s||!i||t!=="category"||!this.properties.isValid())return[];const{showInLegend:a}=this.properties,r=s.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:o&&n.getItemEnabled({seriesId:e,itemId:c}),label:{text:String(h)},symbol:this.legendItemSymbol(c),skipAnimations:!0,hideInLegend:!a}}).filter(l=>l!=null)}},{FillGradientDefaults:FillGradientDefaults8,FillPatternDefaults:FillPatternDefaults8,Label:Label8,AbstractBarSeriesProperties:AbstractBarSeriesProperties6,SeriesTooltip:SeriesTooltip10,AxisLabel:AxisLabel3,TempValidate:TempValidate66,UNION:UNION13,OR:OR12,ARRAY_OF:ARRAY_OF3,COLOR_GRADIENT:COLOR_GRADIENT8,COLOR_STRING:COLOR_STRING18,COLOR_STRING_ARRAY:COLOR_STRING_ARRAY6,COLOR_PATTERN:COLOR_PATTERN8,LINE_DASH:LINE_DASH13,OBJECT:OBJECT32,POSITIVE_NUMBER:POSITIVE_NUMBER25,RATIO:RATIO21,STRING:STRING32}=module_support_exports,ConeFunnelSeriesLabel=class extends Label8{constructor(){super(...arguments),this.spacing=0}};__decorateClass([TempValidate66(UNION13(["before","middle","after"],"a placement"))],ConeFunnelSeriesLabel.prototype,"placement",2),__decorateClass([TempValidate66(POSITIVE_NUMBER25)],ConeFunnelSeriesLabel.prototype,"spacing",2);var ConeFunnelSeriesStageLabel=class extends AxisLabel3{};__decorateClass([TempValidate66(UNION13(["before","after"],"a placement"))],ConeFunnelSeriesStageLabel.prototype,"placement",2);var ConeFunnelProperties=class extends AbstractBarSeriesProperties6{constructor(){super(...arguments),this.fills=[],this.fillGradientDefaults=new FillGradientDefaults8,this.fillPatternDefaults=new FillPatternDefaults8,this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new ConeFunnelSeriesLabel,this.stageLabel=new ConeFunnelSeriesStageLabel,this.tooltip=new SeriesTooltip10}};__decorateClass([TempValidate66(STRING32)],ConeFunnelProperties.prototype,"stageKey",2),__decorateClass([TempValidate66(STRING32)],ConeFunnelProperties.prototype,"valueKey",2),__decorateClass([TempValidate66(ARRAY_OF3(OR12(COLOR_GRADIENT8,COLOR_PATTERN8,COLOR_STRING18)))],ConeFunnelProperties.prototype,"fills",2),__decorateClass([TempValidate66(OBJECT32)],ConeFunnelProperties.prototype,"fillGradientDefaults",2),__decorateClass([TempValidate66(OBJECT32)],ConeFunnelProperties.prototype,"fillPatternDefaults",2),__decorateClass([TempValidate66(RATIO21)],ConeFunnelProperties.prototype,"fillOpacity",2),__decorateClass([TempValidate66(COLOR_STRING_ARRAY6)],ConeFunnelProperties.prototype,"strokes",2),__decorateClass([TempValidate66(POSITIVE_NUMBER25)],ConeFunnelProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate66(RATIO21)],ConeFunnelProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate66(LINE_DASH13)],ConeFunnelProperties.prototype,"lineDash",2),__decorateClass([TempValidate66(POSITIVE_NUMBER25)],ConeFunnelProperties.prototype,"lineDashOffset",2),__decorateClass([TempValidate66(OBJECT32)],ConeFunnelProperties.prototype,"label",2),__decorateClass([TempValidate66(OBJECT32)],ConeFunnelProperties.prototype,"stageLabel",2),__decorateClass([TempValidate66(OBJECT32)],ConeFunnelProperties.prototype,"tooltip",2);function resetLineSelectionsFn(t,{x:e,y:i,width:s,height:n,opacity:o}){return{x1:e,y1:i,x2:e+s,y2:i+n,opacity:o}}var{formatValue:formatValue2,Line:Line6}=module_support_exports,ConeFunnelSeries=class extends BaseFunnelSeries{constructor(t){super({moduleCtx:t,animationResetFns:{datum:resetLineSelectionsFn}}),this.properties=new ConeFunnelProperties}get hasData(){const{id:t,ctx:{legendManager:e}}=this,i=this.data?.reduce((s,n,o)=>s+(e.getItemEnabled({seriesId:t,itemId:o})?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,fillGradientDefaults:this.properties.fillGradientDefaults,fillPatternDefaults:this.properties.fillPatternDefaults}}connectorStyle(){const{fillOpacity:t,strokeOpacity:e,strokeWidth:i,lineDash:s,lineDashOffset:n,fillGradientDefaults:o,fillPatternDefaults:a}=this.properties;return{fillOpacity:t,strokeOpacity:e,strokeWidth:i,lineDash:s,lineDashOffset:n,fillGradientDefaults:o,fillPatternDefaults:a}}nodeFactory(){return new Line6}createLabelData({datumIndex:t,rect:e,barAlongX:i,yDatum:s,datum:n,visible:o}){const{stageKey:a,valueKey:r,label:l}=this.properties,{spacing:c,placement:h}=l;let d,u,p,g;if(i)switch(d=e.x+e.width/2,p="center",h){case"before":u=e.y-c,g="bottom";break;case"after":u=e.y+e.height+c,g="top";break;default:u=e.y+e.height/2,g="middle"}else switch(u=e.y+e.height/2,g="middle",h){case"before":d=e.x-c,p="right";break;case"after":d=e.x+e.width+c,p="left";break;default:d=e.x+e.width/2,p="center"}return{x:d,y:u,textAlign:p,textBaseline:g,text:this.getLabelText(l,{itemId:r,value:s,datum:n,stageKey:a,valueKey:r},f=>formatValue2(f,0)),itemId:r,datum:n,datumIndex:t,series:this,visible:o}}updateDatumNodes(t){const e=t.isHighlight?this.properties.highlightStyle.item:void 0;t.datumSelection.each((i,s)=>{i.setProperties(resetLineSelectionsFn(i,s)),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:s}=this.properties,n=i[e%i.length]??"black",o=s[e%s.length]??"black",{fillOpacity:a,strokeOpacity:r,strokeWidth:l,lineDash:c,lineDashOffset:h}=this.barStyle();return{fill:n,fillOpacity:a,stroke:o,strokeOpacity:r,strokeWidth:l,lineDash:c,lineDashOffset:h}}};ConeFunnelSeries.className="ConeFunnelSeries",ConeFunnelSeries.type="cone-funnel";var{commonSeriesOptionsDefs:commonSeriesOptionsDefs10,seriesLabelOptionsDefs:seriesLabelOptionsDefs6,tooltipOptionsDefs:tooltipOptionsDefs10,without:without3}=module_support_exports,coneFunnelSeriesOptionsDef={type:required(constant("cone-funnel")),stageKey:required(string),valueKey:required(string),direction:union("horizontal","vertical"),fills:arrayOf(colorUnion),strokes:arrayOf(color),showInMiniChart:boolean,label:{spacing:positiveNumber,placement:union("before","middle","after"),...seriesLabelOptionsDefs6},stageLabel:{rotation:number,spacing:positiveNumber,minSpacing:positiveNumber,placement:union("before","after"),avoidCollisions:boolean,itemStyler:callback,format:string,...seriesLabelOptionsDefs6},tooltip:tooltipOptionsDefs10,...commonSeriesOptionsDefs10,...without3(fillOptionsDef,["fill"]),...without3(strokeOptionsDef,["stroke"]),...lineDashOptionsDef},{ThemeConstants:{CARTESIAN_AXIS_TYPE:CARTESIAN_AXIS_TYPE9}}=module_support_exports,CONE_FUNNEL_SERIES_THEME={series:{direction:"vertical",fills:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},module_support_exports.SAFE_RANGE2_OPERATION]},strokes:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},module_support_exports.SAFE_RANGE2_OPERATION]},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:module_support_exports.FILL_PATTERN_DEFAULTS,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:{[CARTESIAN_AXIS_TYPE9.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1,formatter(t){return Math.abs(t.value).toFixed(t.fractionDigits??0)}}},[CARTESIAN_AXIS_TYPE9.CATEGORY]:{line:{enabled:!1}}}},ConeFunnelModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"cone-funnel",moduleFactory:t=>new ConeFunnelSeries(t),solo:!0,tooltipDefaults:{range:"nearest"},defaultAxes:FUNNEL_SERIES_AXES,themeTemplate:CONE_FUNNEL_SERIES_THEME},ConeFunnelSeriesModule={type:"series",name:"cone-funnel",chartType:"cartesian",enterprise:!0,options:coneFunnelSeriesOptionsDef,create:t=>new ConeFunnelSeries(t)},{FillGradientDefaults:FillGradientDefaults9,FillPatternDefaults:FillPatternDefaults9,Label:Label9,DropShadow:DropShadow5,AbstractBarSeriesProperties:AbstractBarSeriesProperties7,BaseProperties:BaseProperties25,SeriesTooltip:SeriesTooltip11,AxisLabel:AxisLabel4,TempValidate:TempValidate67,UNION:UNION14,BOOLEAN:BOOLEAN31,ARRAY_OF:ARRAY_OF4,OR:OR13,COLOR_GRADIENT:COLOR_GRADIENT9,COLOR_STRING_ARRAY:COLOR_STRING_ARRAY7,COLOR_PATTERN:COLOR_PATTERN9,COLOR_STRING:COLOR_STRING19,FUNCTION:FUNCTION14,LINE_DASH:LINE_DASH14,OBJECT:OBJECT33,POSITIVE_NUMBER:POSITIVE_NUMBER26,RATIO:RATIO22,STRING:STRING33}=module_support_exports,FunnelSeriesLabel=class extends Label9{},FunnelSeriesStageLabel=class extends AxisLabel4{};__decorateClass([TempValidate67(UNION14(["before","after"],"a placement"))],FunnelSeriesStageLabel.prototype,"placement",2);var FunnelDropOff=class extends BaseProperties25{constructor(){super(...arguments),this.enabled=!0,this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};__decorateClass([TempValidate67(BOOLEAN31)],FunnelDropOff.prototype,"enabled",2),__decorateClass([TempValidate67(OR13(COLOR_GRADIENT9,COLOR_STRING19,COLOR_PATTERN9),{optional:!0})],FunnelDropOff.prototype,"fill",2),__decorateClass([TempValidate67(RATIO22)],FunnelDropOff.prototype,"fillOpacity",2),__decorateClass([TempValidate67(COLOR_STRING19,{optional:!0})],FunnelDropOff.prototype,"stroke",2),__decorateClass([TempValidate67(POSITIVE_NUMBER26)],FunnelDropOff.prototype,"strokeWidth",2),__decorateClass([TempValidate67(RATIO22)],FunnelDropOff.prototype,"strokeOpacity",2),__decorateClass([TempValidate67(LINE_DASH14)],FunnelDropOff.prototype,"lineDash",2),__decorateClass([TempValidate67(POSITIVE_NUMBER26)],FunnelDropOff.prototype,"lineDashOffset",2);var FunnelProperties=class extends AbstractBarSeriesProperties7{constructor(){super(...arguments),this.fills=[],this.fillGradientDefaults=new FillGradientDefaults9,this.fillPatternDefaults=new FillPatternDefaults9,this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.spacingRatio=0,this.dropOff=new FunnelDropOff,this.shadow=new DropShadow5().set({enabled:!1}),this.label=new FunnelSeriesLabel,this.stageLabel=new FunnelSeriesStageLabel,this.tooltip=new SeriesTooltip11}};__decorateClass([TempValidate67(STRING33)],FunnelProperties.prototype,"stageKey",2),__decorateClass([TempValidate67(STRING33)],FunnelProperties.prototype,"valueKey",2),__decorateClass([TempValidate67(ARRAY_OF4(OR13(COLOR_GRADIENT9,COLOR_PATTERN9,COLOR_STRING19)))],FunnelProperties.prototype,"fills",2),__decorateClass([TempValidate67(OBJECT33)],FunnelProperties.prototype,"fillGradientDefaults",2),__decorateClass([TempValidate67(OBJECT33)],FunnelProperties.prototype,"fillPatternDefaults",2),__decorateClass([TempValidate67(RATIO22)],FunnelProperties.prototype,"fillOpacity",2),__decorateClass([TempValidate67(COLOR_STRING_ARRAY7)],FunnelProperties.prototype,"strokes",2),__decorateClass([TempValidate67(POSITIVE_NUMBER26)],FunnelProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate67(RATIO22)],FunnelProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate67(LINE_DASH14)],FunnelProperties.prototype,"lineDash",2),__decorateClass([TempValidate67(POSITIVE_NUMBER26)],FunnelProperties.prototype,"lineDashOffset",2),__decorateClass([TempValidate67(RATIO22)],FunnelProperties.prototype,"spacingRatio",2),__decorateClass([TempValidate67(FUNCTION14,{optional:!0})],FunnelProperties.prototype,"itemStyler",2),__decorateClass([TempValidate67(OBJECT33)],FunnelProperties.prototype,"dropOff",2),__decorateClass([TempValidate67(OBJECT33)],FunnelProperties.prototype,"shadow",2),__decorateClass([TempValidate67(OBJECT33)],FunnelProperties.prototype,"label",2),__decorateClass([TempValidate67(OBJECT33)],FunnelProperties.prototype,"stageLabel",2),__decorateClass([TempValidate67(OBJECT33)],FunnelProperties.prototype,"tooltip",2);var{ChartAxisDirection:ChartAxisDirection25,resetBarSelectionsFn:resetBarSelectionsFn4,prepareBarAnimationFunctions:prepareBarAnimationFunctions4,midpointStartingBarPosition:midpointStartingBarPosition3,createDatumId:createDatumId12,formatValue:formatValue3,Rect:Rect8,motion:motion6,applyShapeStyle:applyShapeStyle6,getShapeStyle:getShapeStyle10}=module_support_exports,FunnelSeries=class extends BaseFunnelSeries{constructor(t){super({moduleCtx:t,animationResetFns:{datum:resetBarSelectionsFn4}}),this.properties=new FunnelProperties}getBandScalePadding(){return{inner:this.properties.spacingRatio,outer:0}}connectorEnabled(){return this.properties.dropOff.enabled}barStyle(){const{fillOpacity:t,strokeOpacity:e,strokeWidth:i,lineDash:s,lineDashOffset:n,fillGradientDefaults:o,fillPatternDefaults:a}=this.properties;return{fillOpacity:t,strokeOpacity:e,strokeWidth:i,lineDash:s,lineDashOffset:n,fillGradientDefaults:o,fillPatternDefaults:a}}connectorStyle(){const{fill:t,fillOpacity:e,stroke:i,strokeOpacity:s,strokeWidth:n,lineDash:o,lineDashOffset:a}=this.properties.dropOff;return{fill:t,fillOpacity:e,stroke:i,strokeOpacity:s,strokeWidth:n,lineDash:o,lineDashOffset:a,fillGradientDefaults:this.properties.fillGradientDefaults,fillPatternDefaults:this.properties.fillPatternDefaults}}nodeFactory(){return new Rect8}createLabelData({datumIndex:t,rect:e,yDatum:i,datum:s,visible:n}){const{valueKey:o,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:s,valueKey:o,stageKey:a},l=>formatValue3(l,0)),itemId:a,datum:s,datumIndex:t,series:this,visible:n}}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return getShapeStyle10({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},e.fillGradientDefaults,e.fillPatternDefaults)}getItemStyleOverrides(t,e,i,s,n){const{id:o,properties:a}=this,{stageKey:r,valueKey:l,fills:c,strokes:h,itemStyler:d}=a,u=s.fill??c[i%c.length]??"black",p=s.stroke??h[i%h.length]??"black",g={};if(n||(g.fill=u,g.stroke=p),d!=null){const f=this.cachedDatumCallback(createDatumId12(t,n?"highlight":"node"),()=>{const{fillOpacity:m,strokeOpacity:y,strokeWidth:x,lineDash:b,lineDashOffset:S}=s;return this.callWithContext(d,{seriesId:o,datum:e,highlighted:n,stageKey:r,valueKey:l,fill:u,fillOpacity:m,stroke:p,strokeOpacity:y,strokeWidth:x,lineDash:b,lineDashOffset:S})});Object.assign(g,f)}return getShapeStyle10(g,a.fillGradientDefaults,a.fillPatternDefaults)}updateDatumNodes(t){const{shadow:e}=this.properties,{datumSelection:i,isHighlight:s}=t,n=this.getCategoryDirection()===ChartAxisDirection25.X,o=this.getItemBaseStyle(s),a=this.getShapeFillBBox();i.each((r,l)=>{const{datumIndex:c}=l,h=this.getItemStyleOverrides(String(l.datumIndex),l.datum,c,o,s);applyShapeStyle6(r,o,h,a),r.visible=n?l.width>0:l.height>0,r.crisp=l.crisp,r.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(),n=prepareBarAnimationFunctions4(midpointStartingBarPosition3(i,"normal"));motion6.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],n)}animateWaitingUpdateReady(t){super.animateWaitingUpdateReady(t);const{datumSelection:e}=t,{processedData:i}=this,s=i?.reduced?.diff?.[this.id],n=prepareBarAnimationFunctions4(midpointStartingBarPosition3(this.isVertical(),"fade"));motion6.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],n,(o,a)=>a.xValue,s)}};FunnelSeries.className="FunnelSeries",FunnelSeries.type="funnel";var{commonSeriesOptionsDefs:commonSeriesOptionsDefs11,seriesLabelOptionsDefs:seriesLabelOptionsDefs7,shadowOptionsDefs:shadowOptionsDefs5,tooltipOptionsDefs:tooltipOptionsDefs11,without:without4}=module_support_exports,funnelSeriesOptionsDef={type:required(constant("funnel")),stageKey:required(string),valueKey:required(string),direction:union("horizontal","vertical"),fills:arrayOf(colorUnion),strokes:arrayOf(color),showInMiniChart:boolean,itemStyler:callback,spacingRatio:ratio,crisp:boolean,dropOff:{enabled:boolean,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},stageLabel:{rotation:number,spacing:positiveNumber,minSpacing:positiveNumber,placement:union("before","after"),avoidCollisions:boolean,itemStyler:callback,format:string,...seriesLabelOptionsDefs7},label:seriesLabelOptionsDefs7,tooltip:tooltipOptionsDefs11,shadow:shadowOptionsDefs5,...commonSeriesOptionsDefs11,...without4(fillOptionsDef,["fill"]),...without4(strokeOptionsDef,["stroke"]),...lineDashOptionsDef},FunnelModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"funnel",moduleFactory:t=>new FunnelSeries(t),solo:!0,tooltipDefaults:{range:"exact"},defaultAxes:FUNNEL_SERIES_AXES,themeTemplate:FUNNEL_SERIES_THEME},FunnelSeriesModule={type:"series",name:"funnel",chartType:"cartesian",enterprise:!0,options:funnelSeriesOptionsDef,create:t=>new FunnelSeries(t)},DatumUnion=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,s){const n=t.nodes();if(n.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 o=n[0],a=n.toReversed().find(r=>r.datum.datum.value>r.datum.datum.segmentStart)??n[n.length-1];this.node.datum=this.datum=o.datum,s(this.node,o,a)}}},fadeInFns={fromFn:()=>({opacity:0,phase:"initial"}),toFn:()=>({opacity:1})};function formatLabel(t,e){if(t==null)return"";const{min:i,max:s}=e,n=i!==0?Math.ceil(Math.log10(Math.abs(i))):0,o=s!==0?Math.ceil(Math.log10(Math.abs(s))):0,a=Math.max(2-Math.max(n,o),0);return t.toFixed(a)}function getLabelText(t,e,i){if(e.text!=null)return e.text;const s=i??e.value,n=e?.formatter?.({seriesId:t.id,datum:void 0,value:s});if(n!=null)return String(n)}function lineMarker({path:t,x:e,y:i,size:s}){t.moveTo(e,i-s/2),t.lineTo(e,i+s/2)}function pickGaugeNearestDatum(t,e){const i=iterate(t.datumUnion.nodes(),t.targetSelection.nodes());return t.pickNodeNearestDistantObject(e,i)}function pickGaugeFocus(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),s=clamp(0,e.otherIndex+e.otherIndexDelta,i.length-1);if(i.length===0)return;const{data:n,selection:o}=i[s];if(n==null||n.length===0)return;const a=clamp(0,e.datumIndex,n.length-1),r=n[a];for(const l of o)if(l.datum===r)return{bounds:l.node,clipFocusBox:!0,datum:r,datumIndex:a,otherIndex:s}}var{MARKER_SHAPE:MARKER_SHAPE2,UNION:UNION15,OR:OR14}=module_support_exports,FILL_MODE=UNION15(["continuous","discrete"],"a fill mode"),TARGET_MARKER_SHAPE=OR14(MARKER_SHAPE2,UNION15(["line"],"a marker shape")),CORNER_MODE=UNION15(["container","item"],"a corner mode"),{BaseProperties:BaseProperties26,TempValidate:TempValidate68,OBJECT:OBJECT34,BOOLEAN:BOOLEAN32,NUMBER:NUMBER17,NUMBER_ARRAY:NUMBER_ARRAY2}=module_support_exports,GaugeSegmentationIntervalProperties=class extends BaseProperties26{getSegments(t,e){const{values:i,step:s,count:n}=this,o=Math.min(...t.domain),a=Math.max(...t.domain);let r;if(i!=null){const l=i.filter(c=>c>o&&c<a).sort((c,h)=>c-h);r=[o,...l,a]}else if(s!=null){const l=[];for(let c=o;c<a;c+=s)l.push(c);l.push(a),r=l}else if(n!=null){const l=n+1;r=Array.from({length:l+1},(c,h)=>h/l*(a-o)+o)}else{const l=t.ticks({nice:!0,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.filter(c=>c>o&&c<a);r=l!=null?[o,...l,a]:void 0}return r!=null&&r.length>e&&(logger_exports.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=[o,a]),r}};__decorateClass([TempValidate68(NUMBER_ARRAY2,{optional:!0})],GaugeSegmentationIntervalProperties.prototype,"values",2),__decorateClass([TempValidate68(NUMBER17,{optional:!0})],GaugeSegmentationIntervalProperties.prototype,"step",2),__decorateClass([TempValidate68(NUMBER17,{optional:!0})],GaugeSegmentationIntervalProperties.prototype,"count",2);var GaugeSegmentationProperties=class extends BaseProperties26{constructor(){super(...arguments),this.enabled=!1,this.interval=new GaugeSegmentationIntervalProperties,this.spacing=0}};__decorateClass([TempValidate68(BOOLEAN32)],GaugeSegmentationProperties.prototype,"enabled",2),__decorateClass([TempValidate68(OBJECT34)],GaugeSegmentationProperties.prototype,"interval",2),__decorateClass([TempValidate68(NUMBER17)],GaugeSegmentationProperties.prototype,"spacing",2);var{BaseProperties:BaseProperties27,SeriesTooltip:SeriesTooltip12,SeriesProperties:SeriesProperties3,PropertiesArray:PropertiesArray8,TempValidate:TempValidate69,BOOLEAN:BOOLEAN33,COLOR_STRING:COLOR_STRING20,COLOR_STRING_ARRAY:COLOR_STRING_ARRAY8,FUNCTION:FUNCTION15,LINE_DASH:LINE_DASH15,NUMBER:NUMBER18,OBJECT_ARRAY:OBJECT_ARRAY3,OBJECT:OBJECT35,POSITIVE_NUMBER:POSITIVE_NUMBER27,RATIO:RATIO23,STRING:STRING34,NUMBER_ARRAY:NUMBER_ARRAY3,UNION:UNION16,AND:AND7,LESS_THAN:LESS_THAN4,GREATER_THAN:GREATER_THAN4,Label:Label10,AxisLabel:AxisLabel5}=module_support_exports,TARGET_PLACEMENT=UNION16(["before","after","middle"],"a placement"),LABEL_PLACEMENT2=UNION16(["inside-start","outside-start","inside-end","outside-end","inside-center","bar-inside","bar-inside-end","bar-outside-end","bar-end"],"an placement"),DIRECTION2=UNION16(["horizontal","vertical"],"an orientation"),PLACEMENT5=UNION16(["before","after"],"a placement"),LinearGaugeDefaultTargetLabelProperties=class extends Label10{};__decorateClass([TempValidate69(NUMBER18,{optional:!0})],LinearGaugeDefaultTargetLabelProperties.prototype,"spacing",2);var LinearGaugeTargetProperties=class extends BaseProperties27{constructor(){super(...arguments),this.value=0,this.label=new LinearGaugeDefaultTargetLabelProperties}};__decorateClass([TempValidate69(STRING34,{optional:!0})],LinearGaugeTargetProperties.prototype,"text",2),__decorateClass([TempValidate69(NUMBER18)],LinearGaugeTargetProperties.prototype,"value",2),__decorateClass([TempValidate69(TARGET_MARKER_SHAPE,{optional:!0})],LinearGaugeTargetProperties.prototype,"shape",2),__decorateClass([TempValidate69(TARGET_PLACEMENT,{optional:!0})],LinearGaugeTargetProperties.prototype,"placement",2),__decorateClass([TempValidate69(NUMBER18,{optional:!0})],LinearGaugeTargetProperties.prototype,"spacing",2),__decorateClass([TempValidate69(POSITIVE_NUMBER27,{optional:!0})],LinearGaugeTargetProperties.prototype,"size",2),__decorateClass([TempValidate69(NUMBER18,{optional:!0})],LinearGaugeTargetProperties.prototype,"rotation",2),__decorateClass([TempValidate69(COLOR_STRING20,{optional:!0})],LinearGaugeTargetProperties.prototype,"fill",2),__decorateClass([TempValidate69(RATIO23,{optional:!0})],LinearGaugeTargetProperties.prototype,"fillOpacity",2),__decorateClass([TempValidate69(COLOR_STRING20,{optional:!0})],LinearGaugeTargetProperties.prototype,"stroke",2),__decorateClass([TempValidate69(POSITIVE_NUMBER27,{optional:!0})],LinearGaugeTargetProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate69(RATIO23,{optional:!0})],LinearGaugeTargetProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate69(LINE_DASH15,{optional:!0})],LinearGaugeTargetProperties.prototype,"lineDash",2),__decorateClass([TempValidate69(POSITIVE_NUMBER27,{optional:!0})],LinearGaugeTargetProperties.prototype,"lineDashOffset",2),__decorateClass([TempValidate69(OBJECT35)],LinearGaugeTargetProperties.prototype,"label",2);var LinearGaugeBarProperties=class extends BaseProperties27{constructor(){super(...arguments),this.enabled=!0,this.thicknessRatio=1,this.fills=new PropertiesArray8(module_support_exports.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};__decorateClass([TempValidate69(BOOLEAN33)],LinearGaugeBarProperties.prototype,"enabled",2),__decorateClass([TempValidate69(POSITIVE_NUMBER27,{optional:!0})],LinearGaugeBarProperties.prototype,"thickness",2),__decorateClass([TempValidate69(RATIO23)],LinearGaugeBarProperties.prototype,"thicknessRatio",2),__decorateClass([TempValidate69(OBJECT_ARRAY3)],LinearGaugeBarProperties.prototype,"fills",2),__decorateClass([TempValidate69(FILL_MODE)],LinearGaugeBarProperties.prototype,"fillMode",2),__decorateClass([TempValidate69(COLOR_STRING20,{optional:!0})],LinearGaugeBarProperties.prototype,"fill",2),__decorateClass([TempValidate69(RATIO23)],LinearGaugeBarProperties.prototype,"fillOpacity",2),__decorateClass([TempValidate69(COLOR_STRING20)],LinearGaugeBarProperties.prototype,"stroke",2),__decorateClass([TempValidate69(POSITIVE_NUMBER27)],LinearGaugeBarProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate69(RATIO23)],LinearGaugeBarProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate69(LINE_DASH15)],LinearGaugeBarProperties.prototype,"lineDash",2),__decorateClass([TempValidate69(POSITIVE_NUMBER27)],LinearGaugeBarProperties.prototype,"lineDashOffset",2);var LinearGaugeScaleIntervalProperties=class extends BaseProperties27{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};__decorateClass([TempValidate69(NUMBER_ARRAY3,{optional:!0})],LinearGaugeScaleIntervalProperties.prototype,"values",2),__decorateClass([TempValidate69(NUMBER18,{optional:!0})],LinearGaugeScaleIntervalProperties.prototype,"step",2),__decorateClass([TempValidate69(NUMBER18)],LinearGaugeScaleIntervalProperties.prototype,"minSpacing",2),__decorateClass([TempValidate69(NUMBER18)],LinearGaugeScaleIntervalProperties.prototype,"maxSpacing",2);var LinearGaugeScaleLabelProperties=class extends AxisLabel5{constructor(){super(...arguments),this.placement=void 0}};__decorateClass([TempValidate69(PLACEMENT5,{optional:!0})],LinearGaugeScaleLabelProperties.prototype,"placement",2);var LinearGaugeScaleProperties=class extends BaseProperties27{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new PropertiesArray8(module_support_exports.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",this.interval=new LinearGaugeScaleIntervalProperties,this.label=new LinearGaugeScaleLabelProperties}};__decorateClass([TempValidate69(AND7(NUMBER18,LESS_THAN4("max")))],LinearGaugeScaleProperties.prototype,"min",2),__decorateClass([TempValidate69(AND7(NUMBER18,GREATER_THAN4("min")))],LinearGaugeScaleProperties.prototype,"max",2),__decorateClass([TempValidate69(OBJECT_ARRAY3)],LinearGaugeScaleProperties.prototype,"fills",2),__decorateClass([TempValidate69(FILL_MODE)],LinearGaugeScaleProperties.prototype,"fillMode",2),__decorateClass([TempValidate69(COLOR_STRING20,{optional:!0})],LinearGaugeScaleProperties.prototype,"fill",2),__decorateClass([TempValidate69(RATIO23)],LinearGaugeScaleProperties.prototype,"fillOpacity",2),__decorateClass([TempValidate69(COLOR_STRING20)],LinearGaugeScaleProperties.prototype,"stroke",2),__decorateClass([TempValidate69(POSITIVE_NUMBER27)],LinearGaugeScaleProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate69(RATIO23)],LinearGaugeScaleProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate69(LINE_DASH15)],LinearGaugeScaleProperties.prototype,"lineDash",2),__decorateClass([TempValidate69(POSITIVE_NUMBER27)],LinearGaugeScaleProperties.prototype,"lineDashOffset",2),__decorateClass([TempValidate69(COLOR_STRING20)],LinearGaugeScaleProperties.prototype,"defaultFill",2),__decorateClass([TempValidate69(OBJECT35)],LinearGaugeScaleProperties.prototype,"interval",2),__decorateClass([TempValidate69(OBJECT35)],LinearGaugeScaleProperties.prototype,"label",2);var LinearGaugeLabelProperties=class extends AutoSizedLabel{constructor(){super(...arguments),this.placement="inside-center",this.avoidCollisions=!0}};__decorateClass([TempValidate69(STRING34,{optional:!0})],LinearGaugeLabelProperties.prototype,"text",2),__decorateClass([TempValidate69(LABEL_PLACEMENT2)],LinearGaugeLabelProperties.prototype,"placement",2),__decorateClass([TempValidate69(BOOLEAN33)],LinearGaugeLabelProperties.prototype,"avoidCollisions",2);var LinearGaugeSeriesProperties=class extends SeriesProperties3{constructor(){super(...arguments),this.value=0,this.segmentation=new GaugeSegmentationProperties,this.defaultColorRange=[],this.targets=new PropertiesArray8(LinearGaugeTargetProperties),this.defaultTarget=new LinearGaugeTargetProperties,this.defaultScale=new LinearGaugeScaleProperties,this.direction="vertical",this.thickness=1,this.cornerRadius=0,this.cornerMode="container",this.margin=0,this.scale=new LinearGaugeScaleProperties,this.bar=new LinearGaugeBarProperties,this.label=new LinearGaugeLabelProperties,this.tooltip=new SeriesTooltip12}};__decorateClass([TempValidate69(NUMBER18)],LinearGaugeSeriesProperties.prototype,"value",2),__decorateClass([TempValidate69(OBJECT35)],LinearGaugeSeriesProperties.prototype,"segmentation",2),__decorateClass([TempValidate69(COLOR_STRING_ARRAY8)],LinearGaugeSeriesProperties.prototype,"defaultColorRange",2),__decorateClass([TempValidate69(OBJECT_ARRAY3)],LinearGaugeSeriesProperties.prototype,"targets",2),__decorateClass([TempValidate69(OBJECT35)],LinearGaugeSeriesProperties.prototype,"defaultTarget",2),__decorateClass([TempValidate69(OBJECT35)],LinearGaugeSeriesProperties.prototype,"defaultScale",2),__decorateClass([TempValidate69(DIRECTION2)],LinearGaugeSeriesProperties.prototype,"direction",2),__decorateClass([TempValidate69(POSITIVE_NUMBER27)],LinearGaugeSeriesProperties.prototype,"thickness",2),__decorateClass([TempValidate69(POSITIVE_NUMBER27)],LinearGaugeSeriesProperties.prototype,"cornerRadius",2),__decorateClass([TempValidate69(CORNER_MODE)],LinearGaugeSeriesProperties.prototype,"cornerMode",2),__decorateClass([TempValidate69(NUMBER18)],LinearGaugeSeriesProperties.prototype,"margin",2),__decorateClass([TempValidate69(OBJECT35)],LinearGaugeSeriesProperties.prototype,"scale",2),__decorateClass([TempValidate69(OBJECT35)],LinearGaugeSeriesProperties.prototype,"bar",2),__decorateClass([TempValidate69(FUNCTION15,{optional:!0})],LinearGaugeSeriesProperties.prototype,"itemStyler",2),__decorateClass([TempValidate69(OBJECT35)],LinearGaugeSeriesProperties.prototype,"label",2),__decorateClass([TempValidate69(OBJECT35)],LinearGaugeSeriesProperties.prototype,"tooltip",2);var{CachedTextMeasurerPool:CachedTextMeasurerPool6,BBox:BBox18}=module_support_exports;function datumRect(t){const{x0:e,y0:i,x1:s,y1:n,horizontalInset:o,verticalInset:a}=t,r=Math.min(e,s)+o,l=Math.min(i,n)+a,c=Math.max(Math.abs(s-e)-2*o,0),h=Math.max(Math.abs(n-i)-2*a,0);return{x:r,y:l,width:c,height:h}}function clipBBoxVisibility(t,e){if(e==null)return!0;const i=datumRect(t),s=1e-6,n=i.x+s,o=i.y+s,a=i.x+i.width-s,r=i.y+i.height-s,l=e.x,c=e.x+e.width,h=e.y,d=e.y+e.height;return Math.max(n,l)<=Math.min(a,c)&&Math.max(o,h)<=Math.min(r,d)}function hasClipBBox(t){const{clipX0:e,clipX1:i,clipY0:s,clipY1:n}=t;return e!=null&&i!=null||s!=null&&n!=null}function computeClipBBox(t){if(!hasClipBBox(t))return;const{x0:e,y0:i,x1:s,y1:n}=t,{x:o,y:a,width:r,height:l}=datumRect(t);let{clipX0:c,clipX1:h,clipY0:d,clipY1:u}=t;(c==null||h==null)&&(c=e,h=s),(d==null||u==null)&&(d=i,u=n);const p=Math.min(c,h),g=Math.min(d,u),f=Math.abs(h-c),m=Math.abs(u-d);return c=Math.max(o,p),d=Math.max(a,g),h=Math.min(o+r,p+f),u=Math.min(a+l,g+m),new BBox18(Math.min(c,h),Math.min(d,u),Math.abs(h-c),Math.abs(u-d))}function prepareLinearGaugeSeriesAnimationFunctions(t,e){const i=t?"initial":"update";return{node:{fromFn(n,o){const a=n.previousDatum;let{x0:r,y0:l,x1:c,y1:h,clipX0:d,clipY0:u,clipX1:p,clipY1:g}=a??o;const{horizontalInset:f,verticalInset:m}=o,y=a!=null&&hasClipBBox(a),x=hasClipBBox(o);return y&&x||(!y&&x?({x0:r,y0:l,x1:c,y1:h,clipX0:d,clipY0:u,clipX1:p,clipY1:g}=o,t&&(e?p=o.clipX0:g=o.clipY0)):y&&!x?({x0:r,y0:l,x1:c,y1:h}=o,d=void 0,u=void 0,p=void 0,g=void 0):t&&(e?c=r:h=l)),{x0:r,y0:l,x1:c,y1:h,clipX0:d,clipY0:u,clipX1:p,clipY1:g,horizontalInset:f,verticalInset:m,phase:i}},toFn(n,o){const{x0:a,y0:r,x1:l,y1:c,clipX0:h,clipY0:d,clipX1:u,clipY1:p,horizontalInset:g,verticalInset:f}=o;return{x0:a,y0:r,x1:l,y1:c,clipX0:h,clipY0:d,clipX1:u,clipY1:p,horizontalInset:g,verticalInset:f}},applyFn(n,o){n.setProperties(resetLinearGaugeSeriesResetRectFunction(n,o))}}}}function resetLinearGaugeSeriesResetRectFunction(t,e){const{x:i,y:s,width:n,height:o}=datumRect(e),a=computeClipBBox(e),r=clipBBoxVisibility(e,a);return{x:i,y:s,width:n,height:o,clipBBox:a,visible:r}}var horizontalTextAligns={Before:"right",Center:"center",After:"left"},verticalTextBaselines={Before:"top",Center:"middle",After:"bottom"},horizontalAlignFactors={Before:-1,Center:-.5,After:0},verticalAlignFactors2={Before:0,Center:-.5,After:-1};function formatLinearGaugeLabels(t,e,i,s,n){const{seriesRect:o,gaugeRect:a,barRect:r}=s,{padding:l,horizontal:c}=i;e.each((h,d)=>{const u=getLabelText(t,d,n?.label);let p,g;d.placement==="outside-start"?c?(p=a.x,g=o.height):(p=o.width,g=o.height-(a.y+a.height)):d.placement==="outside-end"?c?(p=o.width-(a.x+a.width),g=o.height):(p=o.width,g=a.y):d.avoidCollisions&&(p=a.width,g=a.height);let f;if(u==null)return;if(p!=null&&g!=null)f=formatSingleLabel(u,d,{padding:l},()=>({width:p,height:g,meta:null}))?.[0];else{const F={fontSize:d.fontSize,fontStyle:d.fontStyle,fontWeight:d.fontWeight,fontFamily:d.fontFamily,lineHeight:d.lineHeight},{width:R,height:E}=CachedTextMeasurerPool6.measureText(u,{font:F});f={text:u,fontSize:d.fontSize,lineHeight:getLineHeight(d,d.fontSize),width:R,height:E}}if(f==null){h.visible=!1;return}const m=c?a.x:a.y+a.height,y=c?a.x+a.width:a.y,x=c?r.x:r.y+r.height,b=c?r.x+r.width:r.y,S=d.spacing*(c?1:-1);let v,I,A,D;switch(d.placement){case"outside-start":v=-1/0,I=1/0,A=m-S,D="Before";break;case"outside-end":v=-1/0,I=1/0,A=y+S,D="After";break;case"inside-start":v=m,I=b,A=m+S,D="After";break;case"inside-end":v=b,I=y,A=y-S,D="Before";break;case"inside-center":v=m,I=y,A=(m+y)/2,D="Center";break;case"bar-inside":v=x,I=b,A=(x+b)/2,D="Center";break;case"bar-inside-end":v=x,I=b,A=b-S,D="Before";break;case"bar-outside-end":v=b,I=y,A=b+S,D="After";break;case"bar-end":v=-1/0,I=1/0,A=b,D="Center";break}const T=c?A:a.x+a.width/2,k=c?a.y+a.height/2:A;let w,L;c?(w=T+horizontalAlignFactors[D]*f.width,L=w+f.width):(w=k+verticalAlignFactors2[D]*f.height,L=w+f.height);const O=Math.min(w,L)>=Math.min(v,I)&&Math.max(w,L)<=Math.max(v,I);if(d.avoidCollisions&&!O){h.visible=!1;return}h.visible=!0,h.text=f.text,h.fontSize=f.fontSize,h.lineHeight=f.lineHeight,h.textAlign=c?horizontalTextAligns[D]:"center",h.textBaseline=c?"middle":verticalTextBaselines[D],h.x=T,h.y=k})}var{fromToMotion:fromToMotion3,resetMotion:resetMotion4,SeriesNodePickMode:SeriesNodePickMode9,StateMachine:StateMachine13,createDatumId:createDatumId13,CachedTextMeasurerPool:CachedTextMeasurerPool7,toRadians:toRadians6,BBox:BBox19,Group:Group13,PointerEvents:PointerEvents6,Selection:Selection7,Rect:Rect9,Text:Text3,TransformableText:TransformableText3,Marker:Marker3,LinearScale:LinearScale4,AxisTickGenerator:AxisTickGenerator3,NiceMode:NiceMode2,easing,getColorStops:getColorStops2,findRangeExtent:findRangeExtent2}=module_support_exports,horizontalTargetPlacementRotation={before:180,middle:0,after:0},verticalTargetPlacementRotation={before:90,middle:0,after:-90},LinearGaugeAxis=class{constructor(t){this.gauge=t}get defaultTickMinSpacing(){return 0}get range(){return this.gauge.range}get reverse(){return!1}get scale(){return this.gauge.scale}get label(){return this.gauge.properties.scale.label}get interval(){return this.gauge.properties.scale.interval}formatTick(t,e,i,s,n){const{label:o}=this;return o.formatter?.({value:t,index:e,domain:i,boundSeries:void 0})??(o.format!=null?n?.(t):void 0)??this.gauge.formatLabel(t)}inRange(){return!0}},LinearGaugeSeries=class extends module_support_exports.Series{constructor(t){super({moduleCtx:t,useLabelLayer:!0,pickModes:[SeriesNodePickMode9.EXACT_SHAPE_MATCH,SeriesNodePickMode9.NEAREST_NODE]}),this.properties=new LinearGaugeSeriesProperties,this.seriesRect=BBox19.NaN,this.gaugeRect=BBox19.NaN,this.scale=new LinearScale4,this.axis=new LinearGaugeAxis(this),this.tickGenerator=new AxisTickGenerator3(this.axis),this.originX=0,this.originY=0,this.scaleGroup=this.contentGroup.appendChild(new Group13({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new Group13({name:"itemGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new Group13({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new Group13({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new Group13({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new Group13({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new Group13({name:"tickGroup"})),this.scaleSelection=Selection7.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=Selection7.select(this.itemGroup,()=>this.nodeFactory()),this.targetSelection=Selection7.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=Selection7.select(this.itemTargetLabelGroup,Text3),this.labelSelection=Selection7.select(this.itemLabelGroup,Text3),this.highlightTargetSelection=Selection7.select(this.highlightTargetGroup,()=>this.markerFactory()),this.tickSelection=Selection7.select(this.tickGroup,TransformableText3),this.datumUnion=new DatumUnion,this.animationState=new StateMachine13("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=PointerEvents6.None,this.tickGroup.pointerEvents=PointerEvents6.None}get range(){return this.horizontal?[0,this.gaugeRect.width]:[0,this.gaugeRect.height]}get horizontal(){return this.properties.direction==="horizontal"}get hasData(){return!0}nodeFactory(){const t=new Rect9;return t.crisp=!0,t}markerFactory(){return new Marker3}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(t){return formatLabel(t,this.properties.scale)}createLinearGradient(t,e,i){const{properties:s,horizontal:n}=this,{defaultColorRange:o}=s;return{type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:getColorStops2(e,o,t.domain,i),rotation:n?90:0}}getShapeFillBBox(){const{properties:t,originX:e,originY:i,horizontal:s,scale:n}=this,{thickness:o}=t,a=findRangeExtent2(n.range);return new BBox19(e,i,s?a:o,s?o:a)}getTargets(){const{properties:t}=this,e=t.defaultTarget;return Array.from(t.targets).map(i=>{const{text:s=e.text,value:n=e.value??0,shape:o=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:d=e.fill??"black",fillOpacity:u=e.fillOpacity??1,stroke:p=e.stroke??"black",strokeOpacity:g=e.strokeOpacity??1,lineDash:f=e.lineDash??[0],lineDashOffset:m=e.lineDashOffset??0}=i,{enabled:y=e.label.enabled,color:x=e.label.color??"black",fontStyle:b=e.label.fontStyle??"normal",fontWeight:S=e.label.fontWeight??"normal",fontSize:v=e.label.fontSize,fontFamily:I=e.label.fontFamily,spacing:A=e.label.spacing??0}=i.label;return{text:s,value:n,shape:o,placement:l,spacing:c,size:h,rotation:a,fill:d,fillOpacity:u,stroke:p,strokeWidth:r,strokeOpacity:g,lineDash:f,lineDashOffset:m,label:{enabled:y,color:x,fontStyle:b,fontWeight:S,fontSize:v,fontFamily:I,spacing:A}}})}getTargetPoint(t){const{properties:e,originX:i,originY:s,horizontal:n,scale:o,gaugeRect:a}=this,{thickness:r}=e,{value:l,placement:c,spacing:h,size:d}=t,u=o.convert(l);let p;switch(c){case"before":p=-(h+d/2);break;case"after":p=r+h+d/2;break;default:p=r/2;break}return{x:i+a.x+(n?u:p),y:s+a.y+(n?p:u)}}getTargetLabel(t){const{size:e,placement:i,label:s}=t,{spacing:n,color:o,fontStyle:a,fontWeight:r,fontSize:l,fontFamily:c}=s,h=void 0,d=e/2+n;let u,p,g=0,f=0;return this.horizontal?(u="center",i==="after"?(p="top",f=d):(p="bottom",f=-d)):(p="middle",i==="before"?(u="right",g=-d):(u="left",g=d)),{offsetX:g,offsetY:f,fill:o,textAlign:u,textBaseline:p,fontStyle:a,fontWeight:r,fontSize:l,fontFamily:c,lineHeight:h}}labelDatum(t,e){const{placement:i,avoidCollisions:s,spacing:n,text:o,color:a,fontSize:r,minimumFontSize:l,fontStyle:c,fontWeight:h,fontFamily:d,lineHeight:u,wrapping:p,overflowStrategy:g,formatter:f=m=>this.formatLabel(m.value)}=t;return{placement:i,avoidCollisions:s,spacing:n,text:o,value:e,fill:a,fontSize:r,minimumFontSize:l,fontStyle:c,fontWeight:h,fontFamily:d,lineHeight:u,wrapping:p,overflowStrategy:g,formatter:f}}verticalLabelInset(){const{properties:t}=this,{label:e}=t,i=e.text?.split(`
`),s=getLineHeight(e,e.fontSize)*(i?.length??1);return e.spacing+s}horizontalLabelInset(){const{scale:t,properties:e}=this,{scale:i,label:s}=e,n=s.text?.split(`
`),o=s.getFont(),a=i.interval.values??t.ticks({nice:!1,interval:i.interval.step,minTickCount:0,maxTickCount:6,tickCount:5}),l=(n??a.map(c=>getLabelText(this,this.labelDatum(s,c))??"")).reduce((c,h)=>{const{width:d}=CachedTextMeasurerPool7.measureText(h,{font:o});return Math.max(c,d)},0);return s.spacing+l}createNodeData(){const{id:t,properties:e,horizontal:i,scale:s,seriesRect:n}=this;if(!e.isValid())return;const{value:o,segmentation:a,thickness:r,cornerRadius:l,cornerMode:c,bar:h,scale:d,label:u}=e;s.domain=[d.min,d.max],s.range=i?[0,n.width]:[n.height,0];let p,g;i?(g=1,p=Math.PI/2):d.label.placement==="before"?(g=1,p=0):(g=-1,p=0);const f=p-Math.PI/2;let m,y,x,b;i?(m=0,y=n.width,x=(n.height-r)/2,b=x+r,u.placement==="outside-start"?m+=this.horizontalLabelInset():u.placement==="outside-end"&&(y-=this.horizontalLabelInset())):(m=(n.width-r)/2,y=m+r,b=0,x=n.height,u.placement==="outside-start"?x-=this.verticalLabelInset():u.placement==="outside-end"&&(b+=this.verticalLabelInset())),this.gaugeRect=new BBox19(Math.min(m,y),Math.min(x,b),Math.abs(y-m),Math.abs(b-x));const S=0,v=0;s.domain=[d.min,d.max],s.range=i?[m,y]:[x,b];const{ticks:I}=this.tickGenerator.generateTicks({domain:s.domain,primaryTickCount:void 0,visibleRange:[0,1],niceMode:NiceMode2.Off,labelX:0,parallelFlipRotation:p,regularFlipRotation:f,sideFlag:g}).tickData,A=!1,D=this.getTargets(),T=[],k=[],w=[],L=[],[O,F]=s.range,R=Math.abs(F-O),E=i?s.convert(o):y,_=i?b:s.convert(o),G=a.enabled?a.spacing/2:0,B=i?G:0,z=i?0:G,P=Math.min(h.thickness??Math.round(h.thicknessRatio*r),r),V=-(r-P)/2,j=i?0:V,H=i?V:0,Y=c==="item",U=Math.ceil(R);let $=a.enabled?a.interval.getSegments(s,U):void 0;const W=h.fill??this.createLinearGradient(s,h.fills,h.fillMode),X=d.fill??(h.enabled&&d.fills.length===0?d.defaultFill:void 0)??this.createLinearGradient(s,d.fills,d.fillMode);if($==null&&Y){const q=Math.min(...s.domain),Q=Math.max(...s.domain),tt={value:o,segmentStart:q,segmentEnd:Q};if(h.enabled){const ot=Math.min(l,P/2,R/2)*(A?-1:1),et=i?ot:0,st=i?0:ot;T.push({series:this,itemId:"value",datum:tt,datumIndex:{type:0},type:0,x0:S+m-et-j,y0:v+x-st-H,x1:S+E+et+j,y1:v+_+st+H,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,fill:W,horizontalInset:B,verticalInset:z})}const J=Math.min(l,r/2,R/2)*(A?-1:1),at=i?J:0,lt=i?0:J;L.push({series:this,itemId:"scale",datum:tt,datumIndex:{type:0},type:0,x0:S+m-at,y0:v+x-lt,x1:S+y+at,y1:v+b+lt,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,fill:X,horizontalInset:B,verticalInset:z})}else{$??($=s.domain);const q=S+m-j,Q=v+x-H,tt=S+E+j,it=v+_+H;for(let J=0;J<$.length-1;J+=1){const at=$[J+0],lt=$[J+1],nt={value:o,segmentStart:at,segmentEnd:lt},ot=J===0,et=J===$.length-2,st=s.convert(at),rt=s.convert(lt),ut=Y||ot?l:0,pt=Y||et?l:0,yt=i?ut:pt,Dt=pt,xt=i?pt:ut,St=ut;h.enabled&&T.push({series:this,itemId:`value-${J}`,datum:nt,datumIndex:{type:0},type:0,x0:S+(i?st:m),y0:v+(i?x:st),x1:S+(i?rt:y),y1:v+(i?b:rt),clipX0:q,clipY0:Q,clipX1:tt,clipY1:it,topLeftCornerRadius:yt,topRightCornerRadius:Dt,bottomRightCornerRadius:xt,bottomLeftCornerRadius:St,fill:W,horizontalInset:B,verticalInset:z}),L.push({series:this,itemId:`scale-${J}`,datum:nt,datumIndex:{type:0},type:0,x0:S+(i?st:m),y0:v+(i?x:st),x1:S+(i?rt:y),y1:v+(i?b:rt),clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:yt,topRightCornerRadius:Dt,bottomRightCornerRadius:xt,bottomLeftCornerRadius:St,fill:X,horizontalInset:B,verticalInset:z})}}u.enabled&&w.push(this.labelDatum(u,o));const Z=i?horizontalTargetPlacementRotation:verticalTargetPlacementRotation;for(let q=0;q<D.length;q+=1){const Q=D[q],{value:tt,text:it,shape:J,size:at,fill:lt,fillOpacity:nt,stroke:ot,strokeWidth:et,strokeOpacity:st,lineDash:rt,lineDashOffset:ut}=Q,pt=this.getTargetPoint(Q),yt=toRadians6(Q.rotation+Z[Q.placement]);k.push({series:this,itemId:`target-${q}`,midPoint:pt,datum:{value:tt},datumIndex:{type:1,index:q},type:1,value:tt,text:it,x:pt.x,y:pt.y,shape:J,size:at,rotation:yt,fill:lt,fillOpacity:nt,stroke:ot,strokeOpacity:st,strokeWidth:et,lineDash:rt,lineDashOffset:ut,label:this.getTargetLabel(Q)})}return{itemId:t,nodeData:T,tickData:I,targetData:k,labelData:w,scaleData:L}}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,targetSelection:s,targetLabelSelection:n,scaleSelection:o,highlightTargetSelection:a,tickSelection:r}=this;this.seriesRect=t??BBox19.NaN;const 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??[],d=this.contextNodeData?.targetData??[],u=this.contextNodeData?.scaleData??[],p=this.contextNodeData?.tickData??[],g=this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());this.scaleSelection=this.updateScaleSelection({scaleData:u,scaleSelection:o}),this.updateScaleNodes({scaleSelection:o}),this.targetSelection=this.updateTargetSelection({targetData:d,targetSelection:s}),this.updateTargetNodes({targetSelection:s,isHighlight:!1}),this.targetLabelSelection=this.updateTargetLabelSelection({targetData:d,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:g!=null?[g]:[],targetSelection:a}),this.updateTargetNodes({targetSelection:a,isHighlight:!0}),this.tickSelection=this.updateTickSelection({tickData:p,tickSelection:r}),this.updateTickNodes({tickSelection:r}),l&&this.animationState.transition("resize"),this.animationState.transition("update")}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>createDatumId13(t.nodeData.length,e.itemId))}updateDatumNodes(t){const{datumSelection:e}=t,{ctx:i,properties:s}=this,{bar:n}=s,{fillOpacity:o,stroke:a,strokeOpacity:r,lineDash:l,lineDashOffset:c}=n,h=this.getStrokeWidth(n.strokeWidth),d=i.animationManager.isSkipped(),u=this.getShapeFillBBox();e.each((p,g)=>{const{topLeftCornerRadius:f,topRightCornerRadius:m,bottomRightCornerRadius:y,bottomLeftCornerRadius:x,fill:b}=g;p.fill=b,p.fillBBox=u,p.fillOpacity=o,p.stroke=a,p.strokeOpacity=r,p.strokeWidth=h,p.lineDash=l,p.lineDashOffset=c,p.topLeftCornerRadius=f,p.topRightCornerRadius=m,p.bottomRightCornerRadius=y,p.bottomLeftCornerRadius=x,p.pointerEvents=this.properties.bar.enabled?module_support_exports.PointerEvents.All:module_support_exports.PointerEvents.None,(d||p.previousDatum==null)&&p.setProperties(resetLinearGaugeSeriesResetRectFunction(p,g))}),this.datumUnion.update(e,this.itemGroup,module_support_exports.Rect,(p,g,f)=>{p.pointerEvents=module_support_exports.PointerEvents.None,p.clipBBox??(p.clipBBox=new BBox19(NaN,NaN,NaN,NaN)),p.x=g.x,p.y=g.y,p.clipBBox.x=g.clipBBox?.x??g.x,p.clipBBox.y=g.clipBBox?.y??g.y,this.horizontal?(p.height=p.clipBBox.height=f.height,p.width=f===g?f.width:f.x+f.width,p.clipBBox.width=p.width-(f.width-(f.clipBBox?.width??f.width)),p.topLeftCornerRadius=g.topLeftCornerRadius,p.bottomLeftCornerRadius=g.bottomLeftCornerRadius,p.topRightCornerRadius=f.topRightCornerRadius,p.bottomRightCornerRadius=f.bottomRightCornerRadius):(p.width=p.clipBBox.width=f.width,p.height=f===g?f.height:f.x+f.height,p.clipBBox.height=p.height-(f.height-(f.clipBBox?.height??f.height)),p.topLeftCornerRadius=g.topLeftCornerRadius,p.topRightCornerRadius=g.topRightCornerRadius,p.bottomLeftCornerRadius=f.bottomLeftCornerRadius,p.bottomRightCornerRadius=f.bottomRightCornerRadius)})}updateScaleSelection(t){return t.scaleSelection.update(t.scaleData,void 0,e=>createDatumId13(t.scaleData.length,e.itemId))}updateScaleNodes(t){const{scaleSelection:e}=t,{scale:i}=this.properties,{fillOpacity:s,stroke:n,strokeOpacity:o,strokeWidth:a,lineDash:r,lineDashOffset:l}=i,c=this.getShapeFillBBox();e.each((h,d)=>{const{topLeftCornerRadius:u,topRightCornerRadius:p,bottomRightCornerRadius:g,bottomLeftCornerRadius:f,fill:m}=d;h.fill=m,h.fillBBox=c,h.fillOpacity=s,h.stroke=n,h.strokeOpacity=o,h.strokeWidth=a,h.lineDash=r,h.lineDashOffset=l,h.topLeftCornerRadius=u,h.topRightCornerRadius=p,h.bottomRightCornerRadius=g,h.bottomLeftCornerRadius=f,h.setProperties(resetLinearGaugeSeriesResetRectFunction(h,d))})}updateTargetSelection(t){return t.targetSelection.update(t.targetData,void 0,e=>e.itemId)}updateTargetNodes(t){const{targetSelection:e,isHighlight:i}=t,s=i?this.properties.highlightStyle.item:void 0;e.each((n,o)=>{const{x:a,y:r,shape:l,size:c,rotation:h,fill:d,fillOpacity:u,stroke:p,strokeOpacity:g,strokeWidth:f,lineDash:m,lineDashOffset:y}=o;n.size=c,n.shape=l==="line"?lineMarker:l,n.fill=s?.fill??d,n.fillOpacity=s?.fillOpacity??u,n.stroke=s?.stroke??p,n.strokeOpacity=s?.strokeOpacity??g,n.strokeWidth=s?.strokeWidth??f,n.lineDash=s?.lineDash??m,n.lineDashOffset=s?.lineDashOffset??y,n.translationX=a,n.translationY=r,n.rotation=h})}updateTargetLabelSelection(t){return t.targetLabelSelection.update(t.targetData)}updateTargetLabelNodes(t){const{targetLabelSelection:e}=t;e.each((i,s)=>{const{x:n,y:o,text:a}=s,{offsetX:r,offsetY:l,fill:c,fontStyle:h,fontWeight:d,fontSize:u,fontFamily:p,textAlign:g,textBaseline:f}=s.label;i.visible=!0,i.x=n+r,i.y=o+l,i.text=a,i.fill=c,i.fontStyle=h,i.fontWeight=d,i.fontSize=u,i.fontFamily=p,i.textAlign=g,i.textBaseline=f})}updateTickSelection(t){return t.tickSelection.update(t.tickData,void 0,e=>e.tickId)}updateTickNodes(t){const{gaugeRect:e,properties:i}=this,s=i.defaultScale,{enabled:n,color:o,fontFamily:a=s.label.fontFamily,fontSize:r=s.label.fontSize,fontStyle:l,fontWeight:c=s.label.fontWeight,spacing:h}=i.scale.label;let{placement:d}=i.scale.label;const u=toRadians6(i.scale.label.rotation??0);let p,g,f,m;this.horizontal?(d??(d="after"),p="center",g=d==="before"?"bottom":"top",m=this.originY+e.y+(d==="before"?-h:e.height+h)):(d??(d="before"),p=d==="before"?"end":"start",g="middle",f=this.originX+e.x+(d==="before"?-h:e.width+h)),t.tickSelection.each((y,x)=>{if(!n){y.visible=!1;return}const b=f??x.translationY,S=m??x.translationY;y.visible=!0,y.text=x.tickLabel,y.fill=o,y.fontFamily=a,y.fontSize=r,y.fontStyle=l,y.fontWeight=c,y.textBaseline=g,y.textAlign=p,y.x=b,y.y=S,y.rotationCenterX=b,y.rotationCenterY=S,y.rotation=u})}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((s,n)=>{s.fill=n.fill,s.fontStyle=n.fontStyle,s.fontWeight=n.fontWeight,s.fontFamily=n.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,scale:s,seriesRect:n,gaugeRect:o}=this,{x:a,y:r,width:l,height:c}=o,h=t?.label??this.properties.value;let d;if(i){const g=s.convert(h);d=new BBox19(a,r,g-a,c)}else{const g=s.convert(h);d=new BBox19(a,g,l,c-g)}const u={seriesRect:n,gaugeRect:o,barRect:d},{margin:p}=this.properties;formatLinearGaugeLabels(this,e,{padding:p,horizontal:i},u,t)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),resetMotion4([this.datumSelection],resetLinearGaugeSeriesResetRectFunction),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,s=0;if(this.labelSelection.each((n,o)=>{n.opacity=1,i=n.previousDatum?.value??t.from??o.value,s=o.value}),!this.labelsHaveExplicitText())if(i===s)this.formatLabelText({label:s});else{const n=`${this.id}_labels`;e.animate({id:n,groupId:"label",from:{label:i},to:{label:s},phase:t.phase??"update",ease:easing.easeOut,onUpdate:o=>this.formatLabelText(o)})}}animateEmptyUpdateReady(){const{animationManager:t}=this.ctx,{node:e}=prepareLinearGaugeSeriesAnimationFunctions(!0,this.horizontal);fromToMotion3(this.id,"node",t,[this.datumSelection],e,(i,s)=>s.itemId),fromToMotion3(this.id,"label",t,[this.labelSelection],fadeInFns,()=>"primary"),this.animateLabelText({from:0,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:t}=this.ctx,{node:e}=prepareLinearGaugeSeriesAnimationFunctions(!1,this.horizontal);fromToMotion3(this.id,"node",t,[this.datumSelection],e,(i,s)=>s.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:s}=i;if(!i.isValid())return;let n,o;if(t.type===0?(n=i.value,o=i.label.text):{value:n,text:o}=i.targets[t.index],n!=null)return s.formatTooltip(this.properties,{data:[{label:o,fallbackLabel:"Value",value:this.formatLabel(n)}]},{seriesId:e,title:void 0,datum:void 0,value:n})}pickNodeClosestDatum(t){return pickGaugeNearestDatum(this,t)}pickFocus(t){return pickGaugeFocus(this,t)}getCaptionText(){return this.formatLabel(this.properties.value)}getCategoryValue(t){}datumIndexForCategoryValue(t){}};LinearGaugeSeries.className="LinearGaugeSeries",LinearGaugeSeries.type="linear-gauge";var{commonSeriesOptionsDefs:commonSeriesOptionsDefs12,autoSizedLabelOptionsDefs:autoSizedLabelOptionsDefs3,seriesLabelOptionsDefs:seriesLabelOptionsDefs8,tooltipOptionsDefs:tooltipOptionsDefs12,numberFormatValidator:numberFormatValidator4}=module_support_exports,fillsOptionsDef={fills:gradientColorStops,fillMode:union("continuous","discrete")},linearGaugeTargetOptionsDef={value:required(number),text:string,shape:or(union("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),callback),placement:union("before","after","middle"),spacing:positiveNumber,size:positiveNumber,rotation:number,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},linearGaugeSeriesOptionsDef={type:required(constant("linear-gauge")),value:required(number),direction:union("horizontal","vertical"),cornerMode:union("container","item"),cornerRadius:positiveNumber,thickness:positiveNumber,scale:{min:and(number,lessThan("max")),max:and(number,greaterThan("min")),label:{enabled:boolean,formatter:callback,rotation:number,spacing:positiveNumber,minSpacing:positiveNumber,placement:union("before","after"),avoidCollisions:boolean,format:numberFormatValidator4,...fontOptionsDef},interval:{values:arrayOf(number),step:number},...fillsOptionsDef,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},targets:arrayOfDefs(linearGaugeTargetOptionsDef,"target options array"),segmentation:{enabled:boolean,spacing:positiveNumber,interval:{values:arrayOf(number),step:number,count:number}},bar:{enabled:boolean,thickness:positiveNumber,thicknessRatio:ratio,...fillsOptionsDef,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},label:{...autoSizedLabelOptionsDefs3,text:string,spacing:positiveNumber,avoidCollisions:boolean,placement:union("inside-start","outside-start","inside-end","outside-end","inside-center","bar-inside","bar-inside-end","bar-outside-end","bar-end")},tooltip:tooltipOptionsDefs12,...commonSeriesOptionsDefs12};linearGaugeSeriesOptionsDef.margin=number,linearGaugeSeriesOptionsDef.defaultColorRange=arrayOf(color),linearGaugeSeriesOptionsDef.defaultTarget={...linearGaugeTargetOptionsDef,value:number,label:{...seriesLabelOptionsDefs8,spacing:number}},linearGaugeSeriesOptionsDef.defaultScale=linearGaugeSeriesOptionsDef.scale,linearGaugeSeriesOptionsDef.scale.defaultFill=color;var LinearGaugeModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["gauge"],identifier:"linear-gauge",moduleFactory:t=>new LinearGaugeSeries(t),tooltipDefaults:{range:10},themeTemplate:{minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{thickness:50,defaultColorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$interpolate:[{$palette:"secondDivergingColors"},5]},module_support_exports.SAFE_RANGE2_OPERATION]},scale:{defaultFill:{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["./2",module_support_exports.SAFE_STROKE_FILL_OPERATION,{$palette:"hierarchyColors"}]},label:{spacing:11}},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}},defaultScale:{label:{fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}}},label:{enabled:!1,placement:"inside-start",fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[2]},minimumFontSize:12,spacing:18,color:{$ref:"backgroundColor"}},margin:4}}},LinearGaugeSeriesModule={type:"series",name:"linear-gauge",chartType:"gauge",enterprise:!0,options:linearGaugeSeriesOptionsDef,create:t=>new LinearGaugeSeries(t)},MAP_THEME_DEFAULTS={zoom:{axes:"xy",anchorPointX:"pointer",anchorPointY:"pointer",buttons:{anchorPointX:"middle",anchorPointY:"middle"}},legend:{enabled:!1},gradientLegend:{enabled:!1}},delta5=1e-9;function lineSegmentDistanceToPointSquared(t,e,i,s){const[n,o]=t,[a,r]=e,l=a-n,c=r-o,h=l*l+c*c;let d,u;if(Math.abs(h)<delta5)d=n,u=o;else{let f=((i-n)*l+(s-o)*c)/h;f=Math.max(0,Math.min(1,f)),d=n+f*(a-n),u=o+f*(r-o)}const p=i-d,g=s-u;return p*p+g*g}function lineStringDistance(t,e,i){let s=1/0,n=t[t.length-1];for(const o of t)s=Math.min(s,lineSegmentDistanceToPointSquared(n,o,e,i)),n=o;return Math.sqrt(s)}function lineStringLength(t){let[e,i]=t[0],s=0;for(let n=1;n<t.length;n+=1){const[o,a]=t[n],r=Math.hypot(o-e,a-i);s+=r,e=o,i=a}return s}function lineStringCenter(t){if(t.length===0)return;const e=lineStringLength(t)/2;let[i,s]=t[0],n=0;for(let o=1;o<t.length;o+=1){const[a,r]=t[o],l=Math.hypot(a-i,r-s),c=n+l;if(c>e){const h=(e-n)/l,d=[i+(a-i)*h,s+(r-s)*h],u=Math.atan2(r-s,a-i);return{point:d,angle:u}}n=c,i=a,s=r}}var{LonLatBBox:LonLatBBox2}=module_support_exports;function extendBbox(t,e,i,s,n){return t==null?t=new LonLatBBox2(e,i,s,n):(t.lon0=Math.min(t.lon0,e),t.lat0=Math.min(t.lat0,i),t.lon1=Math.max(t.lon1,s),t.lat1=Math.max(t.lat1,n)),t}function polygonBbox(t,e){return t.forEach(i=>{const[s,n]=i;e=extendBbox(e,s,n,s,n)}),e}function polygonCentroid(t){if(t.length===0)return;let e=0,i=0,s=0,[n,o]=t[t.length-1];for(const[a,r]of t){const l=n*r-a*o;s+=l,e+=(n+a)*l,i+=(o+r)*l,n=a,o=r}return s*=3,[e/s,i/s]}function polygonDistance(t,e,i){let s=!1,n=1/0;for(const o of t){let a=o[o.length-1],[r,l]=a;for(const c of o){const[h,d]=c;d>i!=l>i&&e<(r-h)*(i-d)/(l-d)+h&&(s=!s),n=Math.min(n,lineSegmentDistanceToPointSquared(a,c,e,i)),a=c,r=h,l=d}}return(s?-1:1)*Math.sqrt(n)}var{Path:Path11,ExtendedPath2D:ExtendedPath2D5,BBox:BBox20,ScenePathChangeDetection:ScenePathChangeDetection9}=module_support_exports,GeoGeometry=class extends Path11{constructor(){super(...arguments),this.projectedGeometry=void 0,this.renderMode=3,this.strokePath=new ExtendedPath2D5}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 s=this.geometryDistance(i,t,e);return s>0?s*s:0}geometryDistance(t,e,i){const{renderMode:s,strokeWidth:n}=this,o=(s&1)!==0,a=(s&2)!==0,r=Math.max(n/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 o?t.coordinates.reduce((l,c)=>Math.min(l,Math.max(polygonDistance(c,e,i),0)),1/0):1/0;case"Polygon":return o?Math.max(polygonDistance(t.coordinates,e,i),0):1/0;case"MultiLineString":return a?t.coordinates.reduce((l,c)=>Math.min(l,Math.max(lineStringDistance(c,e,i)-r,0)),1/0):1/0;case"LineString":return a?Math.max(lineStringDistance(t.coordinates,e,i)-r,0):1/0;case"MultiPoint":case"Point":default:return 1/0}}drawGeometry(t,e){const{renderMode:i,path:s,strokePath:n}=this,o=(i&1)!==0,a=(i&2)!==0;switch(t.type){case"GeometryCollection":t.geometries.forEach(r=>{e=this.drawGeometry(r,e)});break;case"MultiPolygon":o&&t.coordinates.forEach(r=>{e=this.drawPolygon(s,r,e)});break;case"Polygon":o&&(e=this.drawPolygon(s,t.coordinates,e));break;case"LineString":a&&(e=this.drawLineString(n,t.coordinates,e,!1));break;case"MultiLineString":a&&t.coordinates.forEach(r=>{e=this.drawLineString(n,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 s=1;s<e.length;s+=1){const n=e[s];this.drawLineString(t,n,void 0,!0)}return i}drawLineString(t,e,i,s){if(e.length<2)return i;const n=s?e.length-1:e.length;for(let o=0;o<n;o+=1){const[a,r]=e[o];if(o===0?t.moveTo(a,r):t.lineTo(a,r),i==null)i=new BBox20(a,r,0,0);else{const{x:l,y:c}=i,h=l+i.width,d=c+i.height;i.x=Math.min(l,a),i.y=Math.min(c,r),i.width=Math.max(h,a)-i.x,i.height=Math.max(d,r)-i.y}}return s&&t.closePath(),i}};__decorateClass([ScenePathChangeDetection9()],GeoGeometry.prototype,"projectedGeometry",2),__decorateClass([ScenePathChangeDetection9()],GeoGeometry.prototype,"renderMode",2);function geometryBbox(t,e){if(t.bbox!=null){const[i,s,n,o]=t.bbox;return e=extendBbox(e,i,s,n,o),e}switch(t.type){case"GeometryCollection":t.geometries.forEach(i=>{e=geometryBbox(i,e)});break;case"MultiPolygon":t.coordinates.forEach(i=>{i.length>0&&(e=polygonBbox(i[0],e))});break;case"Polygon":t.coordinates.length>0&&(e=polygonBbox(t.coordinates[0],e));break;case"MultiLineString":t.coordinates.forEach(i=>{e=polygonBbox(i,e)});break;case"LineString":e=polygonBbox(t.coordinates,e);break;case"MultiPoint":t.coordinates.forEach(i=>{const[s,n]=i;e=extendBbox(e,s,n,s,n)});break;case"Point":{const[i,s]=t.coordinates;e=extendBbox(e,i,s,i,s);break}}return e}function largestPolygon(t){switch(t.type){case"GeometryCollection":{let e,i;return t.geometries.forEach(s=>{const n=largestPolygon(s);if(n==null)return;const o=polygonBbox(n[0],void 0);if(o==null)return;const a=Math.abs(o.lat1-o.lat0)*Math.abs(o.lon1-o.lon0);(e==null||a>e)&&(e=a,i=n)}),i}case"MultiPolygon":{let e,i;return t.coordinates.forEach(s=>{const n=polygonBbox(s[0],void 0);if(n==null)return;const o=Math.abs(n.lat1-n.lat0)*Math.abs(n.lon1-n.lon0);(e==null||o>e)&&(e=o,i=s)}),i}case"Polygon":return t.coordinates;case"MultiLineString":case"LineString":case"MultiPoint":case"Point":return}}function largestLineString(t){switch(t.type){case"GeometryCollection":{let e,i;return t.geometries.forEach(s=>{const n=largestLineString(s);if(n==null)return;const o=lineStringLength(n);o!=null&&(e==null||o>e)&&(e=o,i=n)}),i}case"MultiLineString":{let e=0,i;return t.coordinates.forEach(s=>{const n=lineStringLength(s);n>e&&(e=n,i=s)}),i}case"LineString":return t.coordinates;case"MultiPolygon":case"Polygon":case"MultiPoint":case"Point":return}}function containsType(t,e){if(t==null)return!1;switch(t.type){case"GeometryCollection":return t.geometries.some(i=>containsType(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 projectGeometry(t,e){switch(t.type){case"GeometryCollection":return{type:"GeometryCollection",geometries:t.geometries.map(i=>projectGeometry(i,e))};case"Polygon":return{type:"Polygon",coordinates:projectPolygon(t.coordinates,e)};case"MultiPolygon":return{type:"MultiPolygon",coordinates:projectMultiPolygon(t.coordinates,e)};case"MultiLineString":return{type:"MultiLineString",coordinates:projectPolygon(t.coordinates,e)};case"LineString":return{type:"LineString",coordinates:projectLineString(t.coordinates,e)};case"MultiPoint":return{type:"MultiPoint",coordinates:projectLineString(t.coordinates,e)};case"Point":return{type:"Point",coordinates:e.convert(t.coordinates)}}}function projectMultiPolygon(t,e){return t.map(i=>projectPolygon(i,e))}function projectPolygon(t,e){return t.map(i=>projectLineString(i,e))}function projectLineString(t,e){return t.map(i=>e.convert(i))}function prepareMapMarkerAnimationFunctions(){return{fromFn:(i,s,n)=>n==="removed"?{scalingX:1,scalingY:1}:i.previousDatum==null?{scalingX:0,scalingY:0}:{scalingX:i.scalingX,scalingY:i.scalingY},toFn:(i,s,n)=>n==="removed"?{scalingX:0,scalingY:0}:{scalingX:1,scalingY:1}}}function findFocusedGeoGeometry(t,e){const i=t.contextNodeData?.nodeData[e.datumIndex];if(i!==void 0){for(const s of t.datumSelection.nodes())if(s.datum===i)return s}}var TopologySeriesProperties=class extends module_support_exports.SeriesProperties{},TopologySeries=class extends module_support_exports.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]}},{AND:AND8,ARRAY:ARRAY10,COLOR_STRING:COLOR_STRING21,COLOR_STRING_ARRAY:COLOR_STRING_ARRAY9,FUNCTION:FUNCTION16,LINE_DASH:LINE_DASH16,NUMBER_ARRAY:NUMBER_ARRAY4,OBJECT:OBJECT36,POSITIVE_NUMBER:POSITIVE_NUMBER28,RATIO:RATIO24,STRING:STRING35,TempValidate:TempValidate70,SeriesProperties:SeriesProperties4,SeriesTooltip:SeriesTooltip13,Label:Label11}=module_support_exports,MapLineSeriesProperties=class extends SeriesProperties4{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 Label11,this.tooltip=new SeriesTooltip13}};__decorateClass([TempValidate70(GEOJSON_OBJECT,{optional:!0})],MapLineSeriesProperties.prototype,"topology",2),__decorateClass([TempValidate70(STRING35,{optional:!0})],MapLineSeriesProperties.prototype,"title",2),__decorateClass([TempValidate70(STRING35,{optional:!0})],MapLineSeriesProperties.prototype,"legendItemName",2),__decorateClass([TempValidate70(STRING35)],MapLineSeriesProperties.prototype,"idKey",2),__decorateClass([TempValidate70(STRING35)],MapLineSeriesProperties.prototype,"topologyIdKey",2),__decorateClass([TempValidate70(STRING35,{optional:!0})],MapLineSeriesProperties.prototype,"idName",2),__decorateClass([TempValidate70(STRING35,{optional:!0})],MapLineSeriesProperties.prototype,"labelKey",2),__decorateClass([TempValidate70(STRING35,{optional:!0})],MapLineSeriesProperties.prototype,"labelName",2),__decorateClass([TempValidate70(STRING35,{optional:!0})],MapLineSeriesProperties.prototype,"sizeKey",2),__decorateClass([TempValidate70(STRING35,{optional:!0})],MapLineSeriesProperties.prototype,"sizeName",2),__decorateClass([TempValidate70(STRING35,{optional:!0})],MapLineSeriesProperties.prototype,"colorKey",2),__decorateClass([TempValidate70(STRING35,{optional:!0})],MapLineSeriesProperties.prototype,"colorName",2),__decorateClass([TempValidate70(NUMBER_ARRAY4,{optional:!0})],MapLineSeriesProperties.prototype,"sizeDomain",2),__decorateClass([TempValidate70(AND8(COLOR_STRING_ARRAY9,ARRAY10.restrict({minLength:1})),{optional:!0})],MapLineSeriesProperties.prototype,"colorRange",2),__decorateClass([TempValidate70(POSITIVE_NUMBER28,{optional:!0})],MapLineSeriesProperties.prototype,"maxStrokeWidth",2),__decorateClass([TempValidate70(COLOR_STRING21)],MapLineSeriesProperties.prototype,"stroke",2),__decorateClass([TempValidate70(RATIO24)],MapLineSeriesProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate70(POSITIVE_NUMBER28)],MapLineSeriesProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate70(LINE_DASH16)],MapLineSeriesProperties.prototype,"lineDash",2),__decorateClass([TempValidate70(POSITIVE_NUMBER28)],MapLineSeriesProperties.prototype,"lineDashOffset",2),__decorateClass([TempValidate70(FUNCTION16,{optional:!0})],MapLineSeriesProperties.prototype,"itemStyler",2),__decorateClass([TempValidate70(OBJECT36)],MapLineSeriesProperties.prototype,"label",2),__decorateClass([TempValidate70(OBJECT36)],MapLineSeriesProperties.prototype,"tooltip",2);var{getMissCount:getMissCount3,createDatumId:createDatumId14,SeriesNodePickMode:SeriesNodePickMode10,valueProperty:valueProperty13,CachedTextMeasurerPool:CachedTextMeasurerPool8,ColorScale:ColorScale3,LinearScale:LinearScale5,Selection:Selection8,Text:Text4,Transformable:Transformable3}=module_support_exports,MapLineSeries=class extends TopologySeries{constructor(t){super({moduleCtx:t,categoryKey:void 0,useLabelLayer:!0,pickModes:[SeriesNodePickMode10.EXACT_SHAPE_MATCH,SeriesNodePickMode10.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new MapLineSeriesProperties,this._chartTopology=void 0,this.colorScale=new ColorScale3,this.sizeScale=new LinearScale5,this.datumSelection=Selection8.select(this.contentGroup,()=>this.nodeFactory()),this.labelSelection=Selection8.select(this.labelGroup,Text4),this.highlightDatumSelection=Selection8.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 GeoGeometry;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:s,colorScale:n}=this,{topologyIdKey:o,idKey:a,sizeKey:r,colorKey:l,labelKey:c,sizeDomain:h,colorRange:d}=this.properties,u=new Map;i?.features.forEach(b=>{const S=b.properties?.[o];S==null||!containsType(b.geometry,2)||u.set(S,b)});const p=this.sizeScale.type,g=this.colorScale.type,f=this.scale?.type,{dataModel:m,processedData:y}=await this.requestDataModel(t,e,{props:[valueProperty13(a,f,{id:"idValue",includeProperty:!1}),valueProperty13(a,f,{id:"featureValue",includeProperty:!1,processor:()=>b=>u.get(b)}),...c!=null?[valueProperty13(c,"band",{id:"labelValue"})]:[],...r!=null?[valueProperty13(r,p,{id:"sizeValue"})]:[],...l!=null?[valueProperty13(l,g,{id:"colorValue"})]:[]]}),x=m.resolveColumnById(this,"featureValue",y);if(this.topologyBounds=x.reduce((b,S)=>{const v=S?.geometry;return v==null?b:geometryBbox(v,b)},void 0),r!=null){const b=m.resolveProcessedDataIndexById(this,"sizeValue"),S=y.domain.values[b]??[];s.domain=h??S}if(d!=null&&this.isColorScaleValid()){const b=m.resolveProcessedDataIndexById(this,"colorValue");n.domain=y.domain.values[b],n.range=d,n.update()}i==null&&logger_exports.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 s=e.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,o=getMissCount3(this,i.defs.values[s].missing);return!(n===0||n===o)}getLabelDatum(t,e,i,s){if(e==null||i==null)return;const n=largestLineString(i);if(n==null)return;const{idKey:o,idName:a,sizeKey:r,sizeName:l,colorKey:c,colorName:h,labelKey:d,labelName:u,label:p}=this.properties,g=this.getLabelText(p,{value:e,datum:t,idKey:o,idName:a,sizeKey:r,sizeName:l,colorKey:c,colorName:h,labelKey:d,labelName:u});if(g==null)return;const f=CachedTextMeasurerPool8.measureText(String(g),{font:s}),m=lineStringCenter(n);if(m==null)return;const[y,x]=m.point,{width:b,height:S}=f;return{point:{x:y,y:x,size:0},label:{width:b,height:S,text:g},anchor:void 0,placement:void 0}}createNodeData(){const{id:t,dataModel:e,processedData:i,sizeScale:s,properties:n,scale:o}=this,{idKey:a,sizeKey:r,colorKey:l,labelKey:c,label:h}=n;if(e==null||i==null)return;const d=e.resolveColumnById(this,"idValue",i),u=e.resolveColumnById(this,"featureValue",i),p=c!=null?e.resolveColumnById(this,"labelValue",i):void 0,g=r!=null?e.resolveColumnById(this,"sizeValue",i):void 0,f=l!=null?e.resolveColumnById(this,"colorValue",i):void 0,m=n.maxStrokeWidth??n.strokeWidth;s.range=[Math.min(n.strokeWidth,m),m];const y=h.getFont(),x=new Map;i.dataSources.get(this.id)?.forEach((D,T)=>{const k=d[T],w=u[T]?.geometry??void 0,L=w!=null&&o!=null?projectGeometry(w,o):void 0;k!=null&&L!=null&&x.set(k,L)});const b=[],S=[],v=[];(i.dataSources.get(this.id)??[]).forEach((D,T)=>{const k=d[T],w=f?.[T],L=g?.[T],O=p?.[T],F=x.get(k);F==null&&v.push(k);const R=this.getLabelDatum(D,O,F,y);R!=null&&S.push(R),b.push({series:this,itemId:a,datum:D,datumIndex:T,idValue:k,labelValue:O,colorValue:w,sizeValue:L,projectedGeometry:F})});const A=10;if(v.length>A){const D=v.length-A;v.length=A,v.push(`(+${D} more)`)}return v.length>0&&logger_exports.warnOnce("some data items do not have matches in the provided topology",v),{itemId:t,nodeData:b,labelData:S}}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 s=this.contextNodeData?.nodeData??[];this.datumSelection=this.updateDatumSelection({nodeData:s,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=>createDatumId14(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,s,n,o){const{id:a,properties:r,colorScale:l,sizeScale:c}=this,{colorRange:h,itemStyler:d}=r;let u;if(!o&&i!=null&&(u??(u={}),u.stroke=this.isColorScaleValid()?l.convert(i):h?.[0]??r.stroke),s!=null&&(u??(u={}),u.strokeWidth=c.convert(s,!0)),d!=null){const p=this.cachedDatumCallback(createDatumId14(t,o?"highlight":"node"),()=>this.callWithContext(d,{seriesId:a,datum:e,highlighted:o,...n,...u}));u??(u={}),Object.assign(u,p)}return u}updateDatumNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getItemBaseStyle(i);e.each((n,o)=>{const{datum:a,datumIndex:r,colorValue:l,sizeValue:c,projectedGeometry:h}=o;if(h==null){n.visible=!1,n.projectedGeometry=void 0;return}const d=this.getItemStyleOverrides(String(r),a,l,c,s,i);n.visible=!0,n.projectedGeometry=h,n.stroke=d?.stroke??s.stroke,n.strokeWidth=d?.strokeWidth??s.strokeWidth,n.strokeOpacity=d?.strokeOpacity??s.strokeOpacity,n.lineDash=d?.lineDash??s.lineDash,n.lineDashOffset=d?.lineDashOffset??s.lineDashOffset})}updatePlacedLabelData(t){this.labelSelection=this.labelSelection.update(t,e=>{e.pointerEvents=module_support_exports.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(t){const{labelSelection:e}=t,{color:i,fontStyle:s,fontWeight:n,fontSize:o,fontFamily:a}=this.properties.label;e.each((r,{x:l,y:c,width:h,height:d,text:u})=>{r.visible=!0,r.x=l+h/2,r.y=c+d/2,r.text=u,r.fill=i,r.fontStyle=s,r.fontWeight=n,r.fontSize=o,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,s;return this.datumSelection.each((n,o)=>{const a=n.distanceSquared(t,e);a<i&&(i=a,s=o)}),s!=null?{datum:s,distance:Math.sqrt(i)}:void 0}datumMidPoint(t){const{_previousDatumMidPoint:e}=this;if(e?.datum===t)return e.point;const i=t.projectedGeometry,s=i!=null?largestLineString(i):void 0,n=s!=null?lineStringCenter(s)?.point:void 0,o=n!=null?{x:n[0],y:n[1]}:void 0;return this._previousDatumMidPoint={datum:t,point:o},o}legendItemSymbol(t){const{dataModel:e,processedData:i,properties:s}=this,{strokeWidth:n,strokeOpacity:o,lineDash:a}=s;let{stroke:r}=s;if(t!=null&&this.isColorScaleValid()){const c=e.resolveColumnById(this,"colorValue",i)[t];r=this.colorScale.convert(c)}return{marker:{fill:void 0,fillOpacity:0,stroke:void 0,strokeWidth:0,strokeOpacity:0,lineDash:[0],lineDashOffset:0,enabled:!1},line:{stroke:r,strokeWidth:n,strokeOpacity:o,lineDash:a}}}getLegendData(t){const{processedData:e,dataModel:i}=this;if(e==null||i==null)return[];const{id:s,visible:n}=this,{title:o,legendItemName:a,idKey:r,idName:l,colorKey:c,colorName:h,colorRange:d,showInLegend:u}=this.properties;if(t==="gradient"&&c!=null&&d!=null){const p=e.domain.values[i.resolveProcessedDataIndexById(this,"colorValue")];return[{legendType:"gradient",enabled:n,seriesId:s,colorName:h,colorRange:d,colorDomain:p}]}else return t==="category"?[{legendType:"category",id:s,itemId:s,seriesId:s,enabled:n,label:{text:a??o??l??r},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!u}]:[]}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{idKey:o,idName:a,colorKey:r,colorName:l,sizeKey:c,sizeName:h,labelKey:d,labelName:u,title:p,legendItemName:g,tooltip:f}=n;if(!i||!s)return;const m=s.dataSources.get(this.id)?.[t],y=i.resolveColumnById(this,"idValue",s),x=[],b=c!=null?i.resolveColumnById(this,"sizeValue",s)[t]:void 0,S=r!=null?i.resolveColumnById(this,"colorValue",s)[t]:void 0;if(c!=null&&x.push({label:h,fallbackLabel:c,value:String(b)}),r!=null&&x.push({label:l,fallbackLabel:r,value:String(S)}),d!=null&&d!==o){const I=i.resolveColumnById(this,"labelValue",s)[t];x.push({label:u,fallbackLabel:d,value:I})}const v=this.getItemBaseStyle(!1);return Object.assign(v,this.getItemStyleOverrides(String(t),t,S,b,v,!1)),f.formatTooltip(this.properties,{heading:y[t],title:p??g,symbol:this.legendItemSymbol(t),data:x},{seriesId:e,datum:m,title:p,idKey:o,idName:a,colorKey:r,colorName:l,sizeKey:c,sizeName:h,labelKey:d,labelName:u,...v})}computeFocusBounds(t){const e=findFocusedGeoGeometry(this,t);return e?Transformable3.toCanvas(this.contentGroup,e.getBBox()):void 0}};MapLineSeries.className="MapLineSeries",MapLineSeries.type="map-line";var{commonSeriesOptionsDefs:commonSeriesOptionsDefs13,seriesLabelOptionsDefs:seriesLabelOptionsDefs9,tooltipOptionsDefs:tooltipOptionsDefs13}=module_support_exports,mapLineSeriesOptionsDef={type:required(constant("map-line")),idKey:required(string),sizeKey:string,colorKey:string,labelKey:string,idName:string,sizeName:string,colorName:string,labelName:string,topology:object,topologyIdKey:string,legendItemName:string,maxStrokeWidth:positiveNumber,title:string,itemStyler:callback,sizeDomain:arrayOf(positiveNumber),label:seriesLabelOptionsDefs9,tooltip:tooltipOptionsDefs13,...commonSeriesOptionsDefs13,...strokeOptionsDef,...lineDashOptionsDef,highlightStyle:{...commonSeriesOptionsDefs13.highlightStyle,...strokeOptionsDef}};mapLineSeriesOptionsDef.colorRange=and(arrayOf(color),arrayLength(1));var MapLineModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-line",moduleFactory:t=>new MapLineSeries(t),tooltipDefaults:{range:"exact"},themeTemplate:{...MAP_THEME_DEFAULTS,series:{stroke:module_support_exports.SAFE_STROKE_FILL_OPERATION,colorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},module_support_exports.SAFE_RANGE2_OPERATION]},strokeWidth:1,maxStrokeWidth:3,lineDash:[0],lineDashOffset:0,label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}},tooltip:{range:"exact"}}},MapLineSeriesModule={type:"series",name:"map-line",chartType:"topology",enterprise:!0,options:mapLineSeriesOptionsDef,create:t=>new MapLineSeries(t)},{COLOR_STRING:COLOR_STRING22,LINE_DASH:LINE_DASH17,OBJECT:OBJECT37,POSITIVE_NUMBER:POSITIVE_NUMBER29,RATIO:RATIO25,TempValidate:TempValidate71,SeriesProperties:SeriesProperties5,SeriesTooltip:SeriesTooltip14}=module_support_exports,MapLineBackgroundSeriesProperties=class extends SeriesProperties5{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 SeriesTooltip14}};__decorateClass([TempValidate71(GEOJSON_OBJECT,{optional:!0})],MapLineBackgroundSeriesProperties.prototype,"topology",2),__decorateClass([TempValidate71(COLOR_STRING22)],MapLineBackgroundSeriesProperties.prototype,"stroke",2),__decorateClass([TempValidate71(RATIO25)],MapLineBackgroundSeriesProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate71(POSITIVE_NUMBER29)],MapLineBackgroundSeriesProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate71(LINE_DASH17)],MapLineBackgroundSeriesProperties.prototype,"lineDash",2),__decorateClass([TempValidate71(POSITIVE_NUMBER29)],MapLineBackgroundSeriesProperties.prototype,"lineDashOffset",2),__decorateClass([TempValidate71(OBJECT37)],MapLineBackgroundSeriesProperties.prototype,"tooltip",2);var{createDatumId:createDatumId15,SeriesNodePickMode:SeriesNodePickMode11,Group:Group14,Selection:Selection9,PointerEvents:PointerEvents7}=module_support_exports,MapLineBackgroundSeries=class extends TopologySeries{constructor(t){super({moduleCtx:t,categoryKey:void 0,useLabelLayer:!0,pickModes:[SeriesNodePickMode11.EXACT_SHAPE_MATCH]}),this.properties=new MapLineBackgroundSeriesProperties,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new Group14({name:"itemGroup"})),this.datumSelection=Selection9.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 GeoGeometry;return t.renderMode=2,t.lineJoin="round",t.lineCap="round",t.pointerEvents=PointerEvents7.None,t}processData(){const{topology:t}=this;this.topologyBounds=t?.features.reduce((e,i)=>{const s=i.geometry;return s==null?e:geometryBbox(s,e)},void 0),t==null&&logger_exports.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 s=[],n=[];return e.features.forEach((o,a)=>{const{geometry:r}=o,l=r!=null&&i!=null?projectGeometry(r,i):void 0;l!=null&&s.push({series:this,itemId:a,datum:o,datumIndex:0,index:a,projectedGeometry:l})}),{itemId:t,nodeData:s,labelData:n}}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=>createDatumId15(e.index))}updateDatumNodes(t){const{properties:e}=this,{datumSelection:i}=t,{stroke:s,strokeOpacity:n,lineDash:o,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=s,l.strokeWidth=r,l.strokeOpacity=n,l.lineDash=o,l.lineDashOffset=a})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(t){}computeFocusBounds(t){}};MapLineBackgroundSeries.className="MapLineBackgroundSeries",MapLineBackgroundSeries.type="map-line-background";var mapLineBackgroundSeriesOptionsDef={type:required(constant("map-line-background")),topology:object,...strokeOptionsDef,...lineDashOptionsDef},MapLineBackgroundModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-line-background",moduleFactory:t=>new MapLineBackgroundSeries(t),tooltipDefaults:{range:"exact"},themeTemplate:{...MAP_THEME_DEFAULTS,series:{stroke:{$path:["./1",{$palette:"stroke"},{$palette:"secondHierarchyColors"}]},strokeWidth:1,lineDash:[0],lineDashOffset:0}}},MapLineBackgroundSeriesModule={type:"series",name:"map-line-background",chartType:"topology",enterprise:!0,options:mapLineBackgroundSeriesOptionsDef,create:t=>new MapLineBackgroundSeries(t)},insertManySorted=(t,e,i)=>{let s=t,n=s;for(const o of e)if(s==null||i(s.value,o)>0)s={value:o,next:s},n=s;else{for(n=n;n.next!=null&&i(n.next.value,o)<=0;)n=n.next;n.next={value:o,next:n.next}}return s};function polygonPointSearch(t,e,i){const s=polygonBbox(t[0],void 0);if(s==null)return;const n=(s.lon0+s.lon1)/2,o=(s.lat0+s.lat1)/2,a=Math.abs(s.lon1-s.lon0),r=Math.abs(s.lat1-s.lat0),l=polygonCentroid(t[0]),[c,h]=l,d=-polygonDistance(t,c,h);let u;const p=(v,I)=>{const D=Math.max(I-d,0);return v-.5*D},g=(v,I,A)=>{const{distance:D,maxDistance:T}=i(t,v,I,A),k=Math.hypot(c-v,h-I),w=Math.min(Math.max(c,v-A/2),v+A/2),L=Math.min(Math.max(h,I-A/2),I+A/2),O=Math.hypot(c-w,h-L),F=p(D,k),R=p(T,O);return{distance:D,maxDistance:T,value:F,maxValue:R,x:v,y:I,stride:A}},f=(v,I,A,D)=>{const T=g(I,A,D);T.maxDistance>=0&&v.push(T)},m=Math.min(a,r)/2;let y={value:g(n,o,m),next:null};for(;y!=null;){const v=y.value,{distance:I,value:A,maxValue:D,x:T,y:k,stride:w}=v;if(y=y.next,I>0&&(u==null||A>u.value)&&(u=v),u!=null&&D-u.value<=e)continue;const L=w/2,O=[];f(O,T-L,k-L,L),f(O,T+L,k-L,L),f(O,T-L,k+L,L),f(O,T+L,k+L,L),O.sort(labelPlacementCmp),y=insertManySorted(y,O,labelPlacementCmp)}if(u==null)return;const{distance:x,x:b,y:S}=u;return{x:b,y:S,distance:x}}var labelPlacementCmp=(t,e)=>e.maxValue-t.maxValue;function polygonMarkerCenter(t,e){const i=polygonPointSearch(t,e,(o,a,r,l)=>{const c=-polygonDistance(o,a,r),h=c+l*Math.SQRT2;return{distance:c,maxDistance:h}});if(i==null)return;const{x:s,y:n}=i;return[s,n]}function markerPositions(t,e){let i;switch(t.type){case"GeometryCollection":return t.geometries.flatMap(s=>markerPositions(s,e));case"MultiPoint":return t.coordinates;case"Point":return[t.coordinates];case"MultiPolygon":{const s=largestPolygon(t);i=s!=null?polygonMarkerCenter(s,e):void 0;break}case"Polygon":{const s=t.coordinates;i=s!=null?polygonMarkerCenter(s,e):void 0;break}case"MultiLineString":{const s=largestLineString(t);i=s!=null?lineStringCenter(s)?.point:void 0;break}case"LineString":{const s=t.coordinates;i=lineStringCenter(s)?.point;break}}return i!=null?[i]:[]}var{BBox:BBox21}=module_support_exports;function getTopologyShapeFillBBox(t){if(!t)return;const{range:e}=t,i=e[1][0]-e[0][0],s=e[1][1]-e[0][1],n=new BBox21(0,0,i,s);return{series:n,axis:n}}var{FillGradientDefaults:FillGradientDefaults10,FillPatternDefaults:FillPatternDefaults10,AND:AND9,ARRAY:ARRAY11,COLOR_STRING:COLOR_STRING23,COLOR_STRING_ARRAY:COLOR_STRING_ARRAY10,FUNCTION:FUNCTION17,NUMBER_ARRAY:NUMBER_ARRAY5,OBJECT:OBJECT38,OR:OR15,COLOR_GRADIENT:COLOR_GRADIENT10,COLOR_PATTERN:COLOR_PATTERN10,POSITIVE_NUMBER:POSITIVE_NUMBER30,RATIO:RATIO26,STRING:STRING36,MARKER_SHAPE:MARKER_SHAPE3,LINE_DASH:LINE_DASH18,TempValidate:TempValidate72,SeriesProperties:SeriesProperties6,SeriesTooltip:SeriesTooltip15,Label:Label12}=module_support_exports,MapMarkerSeriesLabel=class extends Label12{constructor(){super(...arguments),this.placement="bottom"}};__decorateClass([TempValidate72(STRING36)],MapMarkerSeriesLabel.prototype,"placement",2);var MapMarkerSeriesProperties=class extends SeriesProperties6{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.fillGradientDefaults=new FillGradientDefaults10,this.fillPatternDefaults=new FillPatternDefaults10,this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new MapMarkerSeriesLabel,this.tooltip=new SeriesTooltip15}};__decorateClass([TempValidate72(GEOJSON_OBJECT,{optional:!0})],MapMarkerSeriesProperties.prototype,"topology",2),__decorateClass([TempValidate72(STRING36,{optional:!0})],MapMarkerSeriesProperties.prototype,"title",2),__decorateClass([TempValidate72(STRING36,{optional:!0})],MapMarkerSeriesProperties.prototype,"legendItemName",2),__decorateClass([TempValidate72(STRING36,{optional:!0})],MapMarkerSeriesProperties.prototype,"idKey",2),__decorateClass([TempValidate72(STRING36)],MapMarkerSeriesProperties.prototype,"topologyIdKey",2),__decorateClass([TempValidate72(STRING36,{optional:!0})],MapMarkerSeriesProperties.prototype,"idName",2),__decorateClass([TempValidate72(STRING36,{optional:!0})],MapMarkerSeriesProperties.prototype,"latitudeKey",2),__decorateClass([TempValidate72(STRING36,{optional:!0})],MapMarkerSeriesProperties.prototype,"latitudeName",2),__decorateClass([TempValidate72(STRING36,{optional:!0})],MapMarkerSeriesProperties.prototype,"longitudeKey",2),__decorateClass([TempValidate72(STRING36,{optional:!0})],MapMarkerSeriesProperties.prototype,"longitudeName",2),__decorateClass([TempValidate72(STRING36,{optional:!0})],MapMarkerSeriesProperties.prototype,"labelKey",2),__decorateClass([TempValidate72(STRING36,{optional:!0})],MapMarkerSeriesProperties.prototype,"labelName",2),__decorateClass([TempValidate72(STRING36,{optional:!0})],MapMarkerSeriesProperties.prototype,"sizeKey",2),__decorateClass([TempValidate72(STRING36,{optional:!0})],MapMarkerSeriesProperties.prototype,"sizeName",2),__decorateClass([TempValidate72(STRING36,{optional:!0})],MapMarkerSeriesProperties.prototype,"colorKey",2),__decorateClass([TempValidate72(STRING36,{optional:!0})],MapMarkerSeriesProperties.prototype,"colorName",2),__decorateClass([TempValidate72(AND9(COLOR_STRING_ARRAY10,ARRAY11.restrict({minLength:1})),{optional:!0})],MapMarkerSeriesProperties.prototype,"colorRange",2),__decorateClass([TempValidate72(MARKER_SHAPE3)],MapMarkerSeriesProperties.prototype,"shape",2),__decorateClass([TempValidate72(POSITIVE_NUMBER30)],MapMarkerSeriesProperties.prototype,"size",2),__decorateClass([TempValidate72(POSITIVE_NUMBER30,{optional:!0})],MapMarkerSeriesProperties.prototype,"maxSize",2),__decorateClass([TempValidate72(NUMBER_ARRAY5,{optional:!0})],MapMarkerSeriesProperties.prototype,"sizeDomain",2),__decorateClass([TempValidate72(OR15(COLOR_GRADIENT10,COLOR_PATTERN10,COLOR_STRING23))],MapMarkerSeriesProperties.prototype,"fill",2),__decorateClass([TempValidate72(OBJECT38)],MapMarkerSeriesProperties.prototype,"fillGradientDefaults",2),__decorateClass([TempValidate72(OBJECT38)],MapMarkerSeriesProperties.prototype,"fillPatternDefaults",2),__decorateClass([TempValidate72(RATIO26)],MapMarkerSeriesProperties.prototype,"fillOpacity",2),__decorateClass([TempValidate72(COLOR_STRING23)],MapMarkerSeriesProperties.prototype,"stroke",2),__decorateClass([TempValidate72(POSITIVE_NUMBER30)],MapMarkerSeriesProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate72(RATIO26)],MapMarkerSeriesProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate72(LINE_DASH18)],MapMarkerSeriesProperties.prototype,"lineDash",2),__decorateClass([TempValidate72(POSITIVE_NUMBER30)],MapMarkerSeriesProperties.prototype,"lineDashOffset",2),__decorateClass([TempValidate72(FUNCTION17,{optional:!0})],MapMarkerSeriesProperties.prototype,"itemStyler",2),__decorateClass([TempValidate72(OBJECT38)],MapMarkerSeriesProperties.prototype,"label",2),__decorateClass([TempValidate72(OBJECT38)],MapMarkerSeriesProperties.prototype,"tooltip",2);var{CachedTextMeasurerPool:CachedTextMeasurerPool9,fromToMotion:fromToMotion4,StateMachine:StateMachine14,getMissCount:getMissCount4,createDatumId:createDatumId16,SeriesNodePickMode:SeriesNodePickMode12,valueProperty:valueProperty14,computeMarkerFocusBounds:computeMarkerFocusBounds3,ColorScale:ColorScale4,LinearScale:LinearScale6,Group:Group15,Selection:Selection10,Text:Text5,Marker:Marker4,applyShapeStyle:applyShapeStyle7,getShapeStyle:getShapeStyle11}=module_support_exports,MapMarkerSeries=class extends TopologySeries{constructor(t){super({moduleCtx:t,categoryKey:void 0,useLabelLayer:!0,pickModes:[SeriesNodePickMode12.EXACT_SHAPE_MATCH,SeriesNodePickMode12.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new MapMarkerSeriesProperties,this._chartTopology=void 0,this.colorScale=new ColorScale4,this.sizeScale=new LinearScale6,this.markerGroup=this.contentGroup.appendChild(new Group15({name:"markerGroup"})),this.labelSelection=Selection10.select(this.labelGroup,Text5,!1),this.markerSelection=Selection10.select(this.markerGroup,Marker4,!1),this.highlightMarkerSelection=Selection10.select(this.highlightNode,Marker4),this.animationState=new StateMachine14("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:s,colorScale:n}=this,{topologyIdKey:o,idKey:a,latitudeKey:r,longitudeKey:l,sizeKey:c,colorKey:h,labelKey:d,sizeDomain:u,colorRange:p}=this.properties,g=new Map;i?.features.forEach(D=>{const T=D.properties?.[o];T!=null&&g.set(T,D)});const f=this.sizeScale.type,m=this.colorScale.type,y=this.scale?.type,x=r!=null&&l!=null,{dataModel:b,processedData:S}=await this.requestDataModel(t,e,{props:[...a!=null?[valueProperty14(a,y,{id:"idValue",includeProperty:!1}),valueProperty14(a,y,{id:"featureValue",includeProperty:!1,processor:()=>D=>g.get(D)})]:[],...x?[valueProperty14(r,y,{id:"latValue"}),valueProperty14(l,y,{id:"lonValue"})]:[],...d?[valueProperty14(d,"band",{id:"labelValue"})]:[],...c?[valueProperty14(c,f,{id:"sizeValue"})]:[],...h?[valueProperty14(h,m,{id:"colorValue"})]:[]]}),v=a!=null?b.resolveColumnById(this,"featureValue",S):void 0,I=x?b.resolveColumnById(this,"latValue",S):void 0,A=x?b.resolveColumnById(this,"lonValue",S):void 0;if(this.topologyBounds=S.dataSources.get(this.id)?.reduce((D,T,k)=>{const L=v?.[k]?.geometry;if(L!=null&&(D=geometryBbox(L,D)),I!=null&&A!=null){const O=A[k],F=I[k];D=extendBbox(D,O,F,O,F)}return D},void 0),c!=null){const D=b.resolveProcessedDataIndexById(this,"sizeValue"),T=S.domain.values[D]??[];s.domain=u??T}if(p!=null&&this.isColorScaleValid()){const D=b.resolveProcessedDataIndexById(this,"colorValue");n.domain=S.domain.values[D],n.range=p,n.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 s=e.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,o=getMissCount4(this,i.defs.values[s].missing);return!(n===0||n===o)}getLabelDatum(t,e,i,s,n,o){if(e==null)return;const{idKey:a,idName:r,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:d,sizeKey:u,sizeName:p,colorKey:g,colorName:f,labelKey:m,labelName:y,label:x,shape:b}=this.properties,{placement:S}=x,v=this.getLabelText(x,{value:e,datum:t,idKey:a,idName:r,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:d,sizeKey:u,sizeName:p,colorKey:g,colorName:f,labelKey:m,labelName:y});if(v==null)return;const{width:I,height:A}=CachedTextMeasurerPool9.measureText(String(v),{font:o}),D=Marker4.anchor(b);return{point:{x:i,y:s,size:n},label:{width:I,height:A,text:v},anchor:D,placement:S}}createNodeData(){const{id:t,dataModel:e,processedData:i,sizeScale:s,properties:n,scale:o}=this,{idKey:a,latitudeKey:r,longitudeKey:l,sizeKey:c,colorKey:h,labelKey:d,label:u}=n;if(e==null||i==null||o==null)return;const p=r!=null&&l!=null,g=a!=null?e.resolveColumnById(this,"idValue",i):void 0,f=a!=null?e.resolveColumnById(this,"featureValue",i):void 0,m=p?e.resolveColumnById(this,"latValue",i):void 0,y=p?e.resolveColumnById(this,"lonValue",i):void 0,x=d!=null?e.resolveColumnById(this,"labelValue",i):void 0,b=c!=null?e.resolveColumnById(this,"sizeValue",i):void 0,S=h!=null?e.resolveColumnById(this,"colorValue",i):void 0,v=n.maxSize??n.size;s.range=[Math.min(n.size,v),v];const I=u.getFont();let A;g!=null&&f!=null&&(A=new Map,i.dataSources.get(this.id)?.forEach((O,F)=>{const R=g[F],E=f[F]?.geometry??void 0,_=E!=null&&o!=null?projectGeometry(E,o):void 0;R!=null&&_!=null&&A.set(R,_)}));const D=[],T=[],k=[];(i.dataSources.get(this.id)??[]).forEach((O,F)=>{const R=g?.[F],E=y?.[F],_=m?.[F],G=S?.[F],B=b?.[F],z=x?.[F],P=B!=null?s.convert(B,!0):n.size,V=R!=null?A?.get(R):void 0;if(R!=null&&projectGeometry==null&&k.push(R),E!=null&&_!=null){const[j,H]=o.convert([E,_]),Y=this.getLabelDatum(O,z,j,H,P,I);Y&&T.push(Y),D.push({series:this,itemId:r,datum:O,datumIndex:F,index:-1,idValue:R,lonValue:E,latValue:_,labelValue:z,sizeValue:B,colorValue:G,point:{x:j,y:H,size:P},midPoint:{x:j,y:H}})}else V!=null&&markerPositions(V,1).forEach(([j,H],Y)=>{const U=this.getLabelDatum(O,z,j,H,P,I);U&&T.push(U),D.push({series:this,itemId:r,datum:O,datumIndex:F,index:Y,idValue:R,lonValue:E,latValue:_,labelValue:z,sizeValue:B,colorValue:G,point:{x:j,y:H,size:P},midPoint:{x:j,y:H}})})});const L=10;if(k.length>L){const O=k.length-L;k.length=L,k.push(`(+${O} more)`)}return k.length>0&&logger_exports.warnOnce("some data items do not have matches in the provided topology",k),{itemId:t,nodeData:D,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:s,highlightMarkerSelection:n}=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 a=this.contextNodeData?.nodeData??[];this.markerSelection=this.updateMarkerSelection({markerData:a,markerSelection:s}),this.updateMarkerNodes({markerSelection:s,isHighlight:!1,highlightedDatum:o}),this.highlightMarkerSelection=this.updateMarkerSelection({markerData:o!=null?[o]:[],markerSelection:n}),this.updateMarkerNodes({markerSelection:n,isHighlight:!0,highlightedDatum:o}),(i||e)&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePlacedLabelData(t){this.labelSelection=this.labelSelection.update(t,e=>{e.pointerEvents=module_support_exports.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(t){const{labelSelection:e}=t,{color:i,fontStyle:s,fontWeight:n,fontSize:o,fontFamily:a}=this.properties.label;e.each((r,{x:l,y:c,width:h,height:d,text:u})=>{r.visible=!0,r.x=l+h/2,r.y=c+d/2,r.text=u,r.fill=i,r.fontStyle=s,r.fontWeight=n,r.fontSize=o,r.fontFamily=a,r.textAlign="center",r.textBaseline="middle"})}updateMarkerSelection(t){const{markerData:e,markerSelection:i}=t;return i.update(e,void 0,s=>createDatumId16([s.index,s.idValue,s.lonValue,s.latValue]))}getMarkerItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return getShapeStyle11({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},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}getMarkerItemStyleOverrides(t,e,i,s,n,o){const{id:a,properties:r,colorScale:l,sizeScale:c}=this,{colorRange:h,itemStyler:d}=r;let u;if(u??(u={}),!o&&i!=null&&(u.fill=this.isColorScaleValid()?l.convert(i):h?.[0]??r.fill),s!=null&&(u.size=c.convert(s,!0)),d!=null){const p=this.cachedDatumCallback(createDatumId16(t,o?"highlight":"node"),()=>this.callWithContext(d,{seriesId:a,datum:e,highlighted:o,...n,...u}));u??(u={}),Object.assign(u,p)}return u}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i,highlightedDatum:s}=t,n=this.getMarkerItemBaseStyle(i),o=getTopologyShapeFillBBox(this.scale);e.each((a,r)=>{const{datumIndex:l,datum:c,point:h,colorValue:d,sizeValue:u}=r,p=this.getMarkerItemStyleOverrides(String(l),c,d,u,n,i);a.shape=p?.shape??n.shape,a.size=p?.size??n.size,applyShapeStyle7(a,n,p,o),a.x=h.x,a.y=h.y,a.scalingCenterX=h.x,a.scalingCenterY=h.y,a.zIndex=!i&&s!=null&&c===s.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=prepareMapMarkerAnimationFunctions();fromToMotion4(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 s=1/0,n;return this.contextNodeData?.nodeData.forEach(o=>{const{x:a,y:r,size:l}=o.point,c=Math.max(Math.abs(a-e)-l,0),h=Math.max(Math.abs(r-i)-l,0),d=c*c+h*h;d<s&&(s=d,n=o)}),n!=null?{datum:n,distance:Math.sqrt(s)}:void 0}legendItemSymbol(t){const{dataModel:e,processedData:i,properties:s}=this,{shape:n,fillOpacity:o,stroke:a,strokeWidth:r,strokeOpacity:l,lineDash:c,lineDashOffset:h}=s;let{fill:d}=s;if(t!=null&&this.isColorScaleValid()){const p=e.resolveColumnById(this,"colorValue",i)[t];d=this.colorScale.convert(p)}return{marker:getShapeStyle11({shape:n,fill:d,fillOpacity:o,stroke:a,strokeWidth:r,strokeOpacity:l,lineDash:c,lineDashOffset:h},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}}getLegendData(t){const{processedData:e,dataModel:i}=this;if(e==null||i==null)return[];const{id:s,visible:n}=this,{title:o,legendItemName:a,idName:r,idKey:l,colorKey:c,colorName:h,colorRange:d,showInLegend:u}=this.properties;if(t==="gradient"&&c!=null&&d!=null){const p=e.domain.values[i.resolveProcessedDataIndexById(this,"colorValue")];return[{legendType:"gradient",enabled:n,seriesId:s,colorName:h,colorRange:d,colorDomain:p}]}else return t==="category"?[{legendType:"category",id:s,itemId:s,seriesId:s,enabled:n,label:{text:a??o??r??l??s},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!u}]:[]}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{idKey:o,idName:a,latitudeKey:r,latitudeName:l,longitudeKey:c,longitudeName:h,colorKey:d,colorName:u,sizeKey:p,sizeName:g,labelKey:f,labelName:m,title:y,legendItemName:x,tooltip:b}=n;if(!i||!s)return;const S=s.dataSources.get(this.id)?.[t],v=p!=null?i.resolveColumnById(this,"sizeValue",s)[t]:void 0,I=d!=null?i.resolveColumnById(this,"colorValue",s)[t]:void 0,A=[];if(v!=null&&A.push({label:g,fallbackLabel:p,value:String(v)}),I!=null&&A.push({label:u,fallbackLabel:d,value:String(I)}),f!=null&&f!==o){const k=i.resolveColumnById(this,"labelValue",s)[t];A.push({label:m,fallbackLabel:f,value:k})}let D;if(o!=null)D=i.resolveColumnById(this,"idValue",s)[t];else if(r!=null&&c!=null){const k=i.resolveColumnById(this,"latValue",s)[t],w=i.resolveColumnById(this,"lonValue",s)[t];D=`${Math.abs(k).toFixed(4)}\xB0 ${k>=0?"N":"S"}, ${Math.abs(w).toFixed(4)}\xB0 ${w>=0?"W":"E"}`}const T=this.getMarkerItemBaseStyle(!1);return Object.assign(T,this.getMarkerItemStyleOverrides(String(t),t,I,v,T,!1)),b.formatTooltip(this.properties,{heading:D,title:y??x,symbol:this.legendItemSymbol(t),data:A},{seriesId:e,datum:S,title:y,idKey:o,idName:a,latitudeKey:r,latitudeName:l,longitudeKey:c,longitudeName:h,colorKey:d,colorName:u,sizeKey:p,sizeName:g,labelKey:f,labelName:m,...T})}getFormattedMarkerStyle(t){const{datumIndex:e,colorValue:i,sizeValue:s}=t,n=this.getMarkerItemBaseStyle(!1);return Object.assign(n,this.getMarkerItemStyleOverrides(String(e),e,i,s,n,!1)),{size:n.size}}computeFocusBounds(t){return computeMarkerFocusBounds3(this,t)}};MapMarkerSeries.className="MapMarkerSeries",MapMarkerSeries.type="map-marker";var{commonSeriesOptionsDefs:commonSeriesOptionsDefs14,markerOptionsDefs:markerOptionsDefs3,seriesLabelOptionsDefs:seriesLabelOptionsDefs10,tooltipOptionsDefs:tooltipOptionsDefs14,without:without5}=module_support_exports,mapMarkerSeriesOptionsDef={type:required(constant("map-marker")),idKey:string,latitudeKey:string,longitudeKey:string,sizeKey:string,colorKey:string,labelKey:string,idName:string,latitudeName:string,longitudeName:string,sizeName:string,colorName:string,labelName:string,topology:object,topologyIdKey:string,legendItemName:string,colorRange:arrayOf(color),title:string,maxSize:positiveNumber,sizeDomain:arrayOf(positiveNumber),label:{placement:union("top","bottom","left","right"),...seriesLabelOptionsDefs10},tooltip:tooltipOptionsDefs14,...commonSeriesOptionsDefs14,...without5(markerOptionsDefs3,["enabled"]),highlightStyle:{...commonSeriesOptionsDefs14.highlightStyle,...fillOptionsDef,...strokeOptionsDef}},MapMarkerModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-marker",moduleFactory:t=>new MapMarkerSeries(t),tooltipDefaults:{range:"exact"},themeTemplate:{...MAP_THEME_DEFAULTS,series:{shape:"circle",maxSize:30,fill:{$palette:"fill"},stroke:{$palette:"stroke"},colorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},module_support_exports.SAFE_RANGE2_OPERATION]},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:module_support_exports.FILL_PATTERN_DEFAULTS,fillOpacity:.5,label:{color:{$ref:"textColor"}}},tooltip:{range:"exact"}}},MapMarkerSeriesModule={type:"series",name:"map-marker",chartType:"topology",enterprise:!0,options:mapMarkerSeriesOptionsDef,create:t=>new MapMarkerSeries(t),validate(t,e,i){const s=validate(t,e,i);if(s.valid?.idKey==null&&(s.valid?.latitudeKey==null||s.valid?.longitudeKey==null)){const n=a=>i?`${i}.${a}`:a,o=`Either \`${n("idKey")}\` or both \`${n("latitudeKey")}\` and \`${n("longitudeKey")}\` are required.`;s.errors.push(new ValidationError(o,i,!0))}return s}};function preferredLabelCenter(t,{aspectRatio:e,precision:i}){const s=polygonPointSearch(t,i,(l,c,h,d)=>{const u=maxWidthOfRectConstrainedByCenterAndAspectRatioToPolygon(l,c,h,e),p=u+2*d*e,g=u*Math.SQRT2,f=p*Math.SQRT2;return{distance:g,maxDistance:f}});if(s==null)return;const{x:n,y:o,distance:a}=s,r=a/Math.SQRT2;return{x:n,y:o,maxWidth:r}}function maxWidthOfRectConstrainedByCenterAndAspectRatioToLineSegment(t,e,i,s,n){const[o,a]=t,[r,l]=e,c=1/n,h=r-o,d=l-a,[u,p]=a<=l?t:e,[g,f]=o<=r?t:e,[m,y]=a<=l?e:t,[x,b]=o<=r?e:t;let S=1/0;if(h!==0){const k=d/h;for(let w=0;w<=1;w+=1){const L=w===0?c:-c,O=(k*o-a-L*i+s)/(k-L);if(O>=g&&O<=x){const F=Math.abs(i-O)*2;S=Math.min(S,F)}}}else for(let k=0;k<=1;k+=1){const L=(k===0?c:-c)*(o-i)+s;if(L>=p&&L<=y){const F=Math.abs(s-L)*2*n;S=Math.min(S,F)}}const v=n,I=Math.abs((u-i)/(p-s)),A=Math.abs((m-i)/(y-s));if(y<s&&A<v){const w=Math.abs(s-y)*2*n;S=Math.min(S,w)}else if(p>s&&I<v){const w=Math.abs(s-p)*2*n;S=Math.min(S,w)}const D=Math.abs((f-s)/(g-i)),T=Math.abs((b-s)/(x-i));if(x<i&&T<c){const k=Math.abs(i-x)*2;S=Math.min(S,k)}else if(g>i&&D<c){const k=Math.abs(i-g)*2;S=Math.min(S,k)}return S}function maxWidthOfRectConstrainedByCenterAndAspectRatioToPolygon(t,e,i,s){let n=!1,o=1/0;for(const a of t){let r=a[a.length-1],[l,c]=r;for(const h of a){const[d,u]=h;u>i!=c>i&&e<(l-d)*(i-u)/(c-u)+d&&(n=!n);const p=maxWidthOfRectConstrainedByCenterAndAspectRatioToLineSegment(r,h,e,i,s);o=Math.min(o,p),r=h,l=d,c=u}}return(n?1:-1)*o}function applyX(t,e,i){i>=e&&(t.maxX=Math.min(t.maxX,i-e)),i<=e&&(t.minX=Math.max(t.minX,i-e))}function xExtentsOfRectConstrainedByCenterAndHeightToLineSegment(t,e,i,s,n,o){const a=n-o/2,r=n+o/2,[l,c]=e,[h,d]=i,u=h-l,p=d-c,[g,f]=l<=h?e:i,[m,y]=l<=h?i:e;if(u!==0){const x=p/u;for(let b=0;b<=1;b+=1){const v=((b===0?a:r)-c)/x+l;v>=g&&v<=m&&applyX(t,s,v)}}else Math.max(a,Math.min(c,d))<=Math.min(r,Math.max(c,d))&&applyX(t,s,l);return m<s&&y>=a&&y<=r?applyX(t,s,m):g>s&&f>=a&&f<=r&&applyX(t,s,g),t}function maxWidthInPolygonForRectOfHeight(t,e,i,s){const n={minX:-1/0,maxX:1/0};for(const r of t){let l=r[r.length-1];for(const c of r)xExtentsOfRectConstrainedByCenterAndHeightToLineSegment(n,l,c,e,i,s),l=c}const{minX:o,maxX:a}=n;return Number.isFinite(o)&&Number.isFinite(a)?{x:e+(o+a)/2,width:a-o}:{x:e,width:0}}var{AND:AND10,ARRAY:ARRAY12,COLOR_STRING:COLOR_STRING24,COLOR_STRING_ARRAY:COLOR_STRING_ARRAY11,COLOR_GRADIENT:COLOR_GRADIENT11,COLOR_PATTERN:COLOR_PATTERN11,FUNCTION:FUNCTION18,LINE_DASH:LINE_DASH19,OR:OR16,OBJECT:OBJECT39,POSITIVE_NUMBER:POSITIVE_NUMBER31,RATIO:RATIO27,STRING:STRING37,TempValidate:TempValidate73,SeriesProperties:SeriesProperties7,SeriesTooltip:SeriesTooltip16,FillGradientDefaults:FillGradientDefaults11,FillPatternDefaults:FillPatternDefaults11}=module_support_exports,MapShapeSeriesProperties=class extends SeriesProperties7{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.fillGradientDefaults=new FillGradientDefaults11,this.fillPatternDefaults=new FillPatternDefaults11,this.fillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.padding=0,this.label=new AutoSizedSecondaryLabel,this.tooltip=new SeriesTooltip16}};__decorateClass([TempValidate73(GEOJSON_OBJECT,{optional:!0})],MapShapeSeriesProperties.prototype,"topology",2),__decorateClass([TempValidate73(STRING37,{optional:!0})],MapShapeSeriesProperties.prototype,"title",2),__decorateClass([TempValidate73(STRING37,{optional:!0})],MapShapeSeriesProperties.prototype,"legendItemName",2),__decorateClass([TempValidate73(STRING37)],MapShapeSeriesProperties.prototype,"idKey",2),__decorateClass([TempValidate73(STRING37,{optional:!0})],MapShapeSeriesProperties.prototype,"idName",2),__decorateClass([TempValidate73(STRING37)],MapShapeSeriesProperties.prototype,"topologyIdKey",2),__decorateClass([TempValidate73(STRING37,{optional:!0})],MapShapeSeriesProperties.prototype,"labelKey",2),__decorateClass([TempValidate73(STRING37,{optional:!0})],MapShapeSeriesProperties.prototype,"labelName",2),__decorateClass([TempValidate73(STRING37,{optional:!0})],MapShapeSeriesProperties.prototype,"colorKey",2),__decorateClass([TempValidate73(STRING37,{optional:!0})],MapShapeSeriesProperties.prototype,"colorName",2),__decorateClass([TempValidate73(AND10(COLOR_STRING_ARRAY11,ARRAY12.restrict({minLength:1})),{optional:!0})],MapShapeSeriesProperties.prototype,"colorRange",2),__decorateClass([TempValidate73(OR16(COLOR_GRADIENT11,COLOR_PATTERN11,COLOR_STRING24))],MapShapeSeriesProperties.prototype,"fill",2),__decorateClass([TempValidate73(OBJECT39)],MapShapeSeriesProperties.prototype,"fillGradientDefaults",2),__decorateClass([TempValidate73(OBJECT39)],MapShapeSeriesProperties.prototype,"fillPatternDefaults",2),__decorateClass([TempValidate73(RATIO27)],MapShapeSeriesProperties.prototype,"fillOpacity",2),__decorateClass([TempValidate73(COLOR_STRING24)],MapShapeSeriesProperties.prototype,"stroke",2),__decorateClass([TempValidate73(RATIO27)],MapShapeSeriesProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate73(POSITIVE_NUMBER31)],MapShapeSeriesProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate73(LINE_DASH19)],MapShapeSeriesProperties.prototype,"lineDash",2),__decorateClass([TempValidate73(POSITIVE_NUMBER31)],MapShapeSeriesProperties.prototype,"lineDashOffset",2),__decorateClass([TempValidate73(POSITIVE_NUMBER31)],MapShapeSeriesProperties.prototype,"padding",2),__decorateClass([TempValidate73(FUNCTION18,{optional:!0})],MapShapeSeriesProperties.prototype,"itemStyler",2),__decorateClass([TempValidate73(OBJECT39)],MapShapeSeriesProperties.prototype,"label",2),__decorateClass([TempValidate73(OBJECT39)],MapShapeSeriesProperties.prototype,"tooltip",2);var{getMissCount:getMissCount5,createDatumId:createDatumId17,SeriesNodePickMode:SeriesNodePickMode13,valueProperty:valueProperty15,CachedTextMeasurerPool:CachedTextMeasurerPool10,TextUtils:TextUtils7,ColorScale:ColorScale5,Group:Group16,Selection:Selection11,Text:Text6,PointerEvents:PointerEvents8,applyShapeStyle:applyShapeStyle8,getShapeStyle:getShapeStyle12}=module_support_exports,fixedScale=module_support_exports.MercatorScale.fixedScale(),MapShapeSeries=class extends TopologySeries{constructor(t){super({moduleCtx:t,categoryKey:void 0,useLabelLayer:!0,pickModes:[SeriesNodePickMode13.EXACT_SHAPE_MATCH,SeriesNodePickMode13.NEAREST_NODE]}),this.properties=new MapShapeSeriesProperties,this._chartTopology=void 0,this.colorScale=new ColorScale5,this.itemGroup=this.contentGroup.appendChild(new Group16({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new Group16({name:"itemLabelGroup"})),this.datumSelection=Selection11.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=Selection11.select(this.itemLabelGroup,Text6),this.highlightDatumSelection=Selection11.select(this.highlightNode,()=>this.nodeFactory()),this.previousLabelLayouts=void 0,this._previousDatumMidPoint=void 0,this.itemLabelGroup.pointerEvents=PointerEvents8.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 GeoGeometry;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:s}=this,{topologyIdKey:n,idKey:o,colorKey:a,labelKey:r,colorRange:l}=this.properties,c=new Map;i?.features.forEach(f=>{const m=f.properties?.[n];m==null||!containsType(f.geometry,1)||c.set(m,f)});const h=this.colorScale.type,d=this.scale?.type,{dataModel:u,processedData:p}=await this.requestDataModel(t,e,{props:[valueProperty15(o,d,{id:"idValue",includeProperty:!1}),valueProperty15(o,d,{id:"featureValue",includeProperty:!1,processor:()=>f=>c.get(f)}),...r?[valueProperty15(r,"band",{id:"labelValue"})]:[],...a?[valueProperty15(a,h,{id:"colorValue"})]:[]]}),g=u.resolveColumnById(this,"featureValue",p);if(this.topologyBounds=g.reduce((f,m)=>{const y=m?.geometry;return y==null?f:geometryBbox(y,f)},void 0),l!=null&&this.isColorScaleValid()){const f=u.resolveProcessedDataIndexById(this,"colorValue");s.domain=p.domain.values[f],s.range=l,s.update()}i==null&&logger_exports.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 s=e.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,o=getMissCount5(this,i.defs.values[s].missing);return!(n===0||n===o)}getLabelLayout(t,e,i,s,n){if(e==null||s==null)return;const{idKey:o,idName:a,colorKey:r,colorName:l,labelKey:c,labelName:h,padding:d,label:u}=this.properties,p=this.getLabelText(u,{value:e,datum:t,idKey:o,idName:a,colorKey:r,colorName:l,labelKey:c,labelName:h});if(p==null)return;const g=CachedTextMeasurerPool10.measureText(String(p),{font:i}),f=p.split(`
`).length,m=(g.width+2*d)/(f*TextUtils7.getLineHeight(u.fontSize)+2*d);if(n?.geometry===s&&n?.labelText===p&&n?.aspectRatio===m)return n;const y=projectGeometry(s,fixedScale),x=largestPolygon(y);if(x==null)return;const b=preferredLabelCenter(x,{aspectRatio:m,precision:.001});if(b==null)return;const{x:S,y:v,maxWidth:I}=b;return{geometry:s,labelText:p,aspectRatio:m,x:S,y:v,maxWidth:I,fixedPolygon:x}}getLabelDatum(t,e){const{scale:i}=this;if(i==null)return;const{padding:s,label:n}=this.properties,{labelText:o,aspectRatio:a,x:r,y:l,maxWidth:c,fixedPolygon:h}=t,d={width:Math.ceil(c*e),height:Math.ceil(c*e/a),meta:r},u=formatSingleLabel(o,n,{padding:s},(S,v)=>{if(!v)return d;const I=maxWidthInPolygonForRectOfHeight(h,r,l,S/e);return{width:I.width*e,height:S,meta:I.x}});if(u==null)return;const[{text:p,fontSize:g,lineHeight:f,width:m},y]=u;if(p===TextUtils7.EllipsisChar)return;const x=m<d.width?r:y,b=this.scale.convert(fixedScale.invert([x,l]));return{x:b[0],y:b[1],text:p,fontSize:g,lineHeight:f}}createNodeData(){const{id:t,dataModel:e,processedData:i,properties:s,scale:n,previousLabelLayouts:o}=this,{idKey:a,colorKey:r,labelKey:l,label:c}=s;if(e==null||i==null)return;const h=n!=null?(n.range[1][0]-n.range[0][0])/n.bounds.width:NaN,d=e.resolveColumnById(this,"idValue",i),u=e.resolveColumnById(this,"featureValue",i),p=l!=null?e.resolveColumnById(this,"labelValue",i):void 0,g=r!=null?e.resolveColumnById(this,"colorValue",i):void 0,f=c.getFont(),m=new Map;this.previousLabelLayouts=m;const y=[],x=[],b=[];(i.dataSources.get(this.id)??[]).forEach((I,A)=>{const D=d[A],T=g?.[A],k=p?.[A],w=u[A]?.geometry??void 0;w==null&&b.push(D);const L=this.getLabelLayout(I,k,f,w,o?.get(D));L!=null&&m.set(D,L);const O=L!=null&&n!=null?this.getLabelDatum(L,h):void 0;O!=null&&x.push(O);const F=w!=null&&n!=null?projectGeometry(w,n):void 0;y.push({series:this,itemId:a,datum:I,datumIndex:A,idValue:D,colorValue:T,labelValue:k,projectedGeometry:F})});const v=10;if(b.length>v){const I=b.length-v;b.length=v,b.push(`(+${I} more)`)}return b.length>0&&logger_exports.warnOnce("some data items do not have matches in the provided topology",b),{itemId:t,nodeData:y,labelData:x}}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 s=this.ctx.highlightManager?.getActiveHighlight();s!=null&&(s.series!==this||s.datum==null)&&(s=void 0);const n=this.contextNodeData?.nodeData??[],o=this.contextNodeData?.labelData??[];this.datumSelection=this.updateDatumSelection({nodeData:n,datumSelection:t}),this.updateDatumNodes({datumSelection:t,isHighlight:!1}),this.labelSelection=this.updateLabelSelection({labelData:o,labelSelection:e}),this.updateLabelNodes({labelSelection:e}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:s!=null?[s]:[],datumSelection:i}),this.updateDatumNodes({datumSelection:i,isHighlight:!0})}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>createDatumId17(e.idValue))}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return getShapeStyle12({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},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}getItemStyleOverrides(t,e,i,s,n){const{id:o,properties:a,colorScale:r}=this,{colorRange:l,itemStyler:c}=a;let h;if(!n&&i!=null&&(h??(h={}),h.fill=this.isColorScaleValid()?r.convert(i):l?.[0]??a.fill),c!=null){const d=this.cachedDatumCallback(createDatumId17(t,n?"highlight":"node"),()=>this.callWithContext(c,{seriesId:o,datum:e,highlighted:n,...s,...h}));h??(h={}),Object.assign(h,d)}return getShapeStyle12(h,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}updateDatumNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getItemBaseStyle(i),n=getTopologyShapeFillBBox(this.scale);e.each((o,a)=>{const{datum:r,datumIndex:l,colorValue:c,projectedGeometry:h}=a;if(h==null){o.visible=!1,o.projectedGeometry=void 0;return}const d=this.getItemStyleOverrides(String(l),r,c,s,i);o.visible=!0,o.projectedGeometry=h,applyShapeStyle8(o,s,d,n)})}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e)}updateLabelNodes(t){const{labelSelection:e}=t,{color:i,fontStyle:s,fontWeight:n,fontFamily:o}=this.properties.label;e.each((a,{x:r,y:l,text:c,fontSize:h,lineHeight:d})=>{a.visible=!0,a.x=r,a.y=l,a.text=c,a.fill=i,a.fontStyle=s,a.fontWeight=n,a.fontSize=h,a.lineHeight=d,a.fontFamily=o,a.textAlign="center",a.textBaseline="middle"})}resetAnimation(){}pickNodeClosestDatum({x:t,y:e}){let i=1/0,s;return this.datumSelection.each((n,o)=>{const a=n.distanceSquared(t,e);a<i&&(i=a,s=o)}),s!=null?{datum:s,distance:Math.sqrt(i)}:void 0}datumMidPoint(t){const{_previousDatumMidPoint:e}=this;if(e?.datum===t)return e.point;const i=t.projectedGeometry,s=i!=null?largestPolygon(i):void 0,n=s!=null?polygonMarkerCenter(s,2):void 0,o=n!=null?{x:n[0],y:n[1]}:void 0;return this._previousDatumMidPoint={datum:t,point:o},o}legendItemSymbol(t){const{dataModel:e,processedData:i,properties:s}=this,{fillOpacity:n,stroke:o,strokeWidth:a,strokeOpacity:r,lineDash:l,lineDashOffset:c}=s;let{fill:h}=s;if(t!=null&&this.isColorScaleValid()){const u=e.resolveColumnById(this,"colorValue",i)[t];h=this.colorScale.convert(u)}return{marker:getShapeStyle12({fill:h,fillOpacity:n,stroke:o,strokeWidth:a,strokeOpacity:r,lineDash:l,lineDashOffset:c},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}}getLegendData(t){const{processedData:e,dataModel:i}=this;if(e==null||i==null)return[];const{id:s,visible:n}=this,{title:o,legendItemName:a,idKey:r,idName:l,colorKey:c,colorName:h,colorRange:d,showInLegend:u}=this.properties;if(t==="gradient"&&c!=null&&d!=null){const p=e.domain.values[i.resolveProcessedDataIndexById(this,"colorValue")];return[{legendType:"gradient",enabled:n,seriesId:s,colorName:h,colorRange:d,colorDomain:p}]}else return t==="category"?[{legendType:"category",id:s,itemId:s,seriesId:s,enabled:n,label:{text:a??o??l??r},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!u}]:[]}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{idKey:o,idName:a,colorKey:r,colorName:l,labelKey:c,labelName:h,legendItemName:d,title:u,tooltip:p}=n;if(!i||!s)return;const g=s.dataSources.get(this.id)?.[t],f=i.resolveColumnById(this,"idValue",s)[t],m=r!=null?i.resolveColumnById(this,"colorValue",s)[t]:void 0,y=[];if(m!=null&&y.push({label:l,fallbackLabel:r,value:String(m)}),c!=null&&c!==o){const b=i.resolveColumnById(this,"labelValue",s)[t];y.push({label:h,fallbackLabel:c,value:b})}const x=this.getItemBaseStyle(!1);return Object.assign(x,this.getItemStyleOverrides(String(t),t,m,x,!1)),p.formatTooltip(this.properties,{heading:f,title:u??d,symbol:this.legendItemSymbol(t),data:y},{seriesId:e,datum:g,title:u,idKey:o,idName:a,colorKey:r,colorName:l,labelKey:c,labelName:h,...x})}computeFocusBounds(t){return findFocusedGeoGeometry(this,t)}};MapShapeSeries.className="MapShapeSeries",MapShapeSeries.type="map-shape";var{commonSeriesOptionsDefs:commonSeriesOptionsDefs15,autoSizedLabelOptionsDefs:autoSizedLabelOptionsDefs4,tooltipOptionsDefs:tooltipOptionsDefs15}=module_support_exports,mapShapeSeriesOptionsDef={type:required(constant("map-shape")),idKey:required(string),colorKey:string,labelKey:string,idName:string,colorName:string,labelName:string,topology:object,topologyIdKey:string,legendItemName:string,colorRange:arrayOf(color),padding:positiveNumber,itemStyler:callback,title:string,label:autoSizedLabelOptionsDefs4,tooltip:tooltipOptionsDefs15,...commonSeriesOptionsDefs15,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef,highlightStyle:{...commonSeriesOptionsDefs15.highlightStyle,...fillOptionsDef,...strokeOptionsDef}},MapShapeModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-shape",moduleFactory:t=>new MapShapeSeries(t),tooltipDefaults:{range:"exact"},themeTemplate:{...MAP_THEME_DEFAULTS,series:{fill:{$palette:"fill"},stroke:{$ref:"backgroundColor"},colorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},module_support_exports.SAFE_RANGE2_OPERATION]},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:module_support_exports.FILL_PATTERN_DEFAULTS,fillOpacity:1,strokeWidth:1,lineDash:[0],lineDashOffset:0,padding:2,label:{color:{$ref:"backgroundColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:"bold",overflowStrategy:"hide"}},tooltip:{range:"exact"}}},MapShapeSeriesModule={type:"series",name:"map-shape",chartType:"topology",enterprise:!0,options:mapShapeSeriesOptionsDef,create:t=>new MapShapeSeries(t)},{FillGradientDefaults:FillGradientDefaults12,FillPatternDefaults:FillPatternDefaults12,COLOR_STRING:COLOR_STRING25,COLOR_GRADIENT:COLOR_GRADIENT12,COLOR_PATTERN:COLOR_PATTERN12,OR:OR17,LINE_DASH:LINE_DASH20,OBJECT:OBJECT40,POSITIVE_NUMBER:POSITIVE_NUMBER32,RATIO:RATIO28,TempValidate:TempValidate74,SeriesProperties:SeriesProperties8,SeriesTooltip:SeriesTooltip17}=module_support_exports,MapShapeBackgroundSeriesProperties=class extends SeriesProperties8{constructor(){super(...arguments),this.topology=void 0,this.fill="black",this.fillGradientDefaults=new FillGradientDefaults12,this.fillPatternDefaults=new FillPatternDefaults12,this.fillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.tooltip=new SeriesTooltip17}};__decorateClass([TempValidate74(GEOJSON_OBJECT,{optional:!0})],MapShapeBackgroundSeriesProperties.prototype,"topology",2),__decorateClass([TempValidate74(OR17(COLOR_GRADIENT12,COLOR_PATTERN12,COLOR_STRING25))],MapShapeBackgroundSeriesProperties.prototype,"fill",2),__decorateClass([TempValidate74(OBJECT40)],MapShapeBackgroundSeriesProperties.prototype,"fillGradientDefaults",2),__decorateClass([TempValidate74(OBJECT40)],MapShapeBackgroundSeriesProperties.prototype,"fillPatternDefaults",2),__decorateClass([TempValidate74(RATIO28)],MapShapeBackgroundSeriesProperties.prototype,"fillOpacity",2),__decorateClass([TempValidate74(COLOR_STRING25)],MapShapeBackgroundSeriesProperties.prototype,"stroke",2),__decorateClass([TempValidate74(RATIO28)],MapShapeBackgroundSeriesProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate74(POSITIVE_NUMBER32)],MapShapeBackgroundSeriesProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate74(LINE_DASH20)],MapShapeBackgroundSeriesProperties.prototype,"lineDash",2),__decorateClass([TempValidate74(POSITIVE_NUMBER32)],MapShapeBackgroundSeriesProperties.prototype,"lineDashOffset",2),__decorateClass([TempValidate74(OBJECT40)],MapShapeBackgroundSeriesProperties.prototype,"tooltip",2);var{createDatumId:createDatumId18,SeriesNodePickMode:SeriesNodePickMode14,Selection:Selection12,Group:Group17,PointerEvents:PointerEvents9,getShapeStyle:getShapeStyle13}=module_support_exports,MapShapeBackgroundSeries=class extends TopologySeries{constructor(t){super({moduleCtx:t,categoryKey:void 0,useLabelLayer:!0,pickModes:[SeriesNodePickMode14.EXACT_SHAPE_MATCH]}),this.properties=new MapShapeBackgroundSeriesProperties,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new Group17({name:"itemGroup"})),this.datumSelection=Selection12.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 GeoGeometry;return t.renderMode=1,t.lineJoin="round",t.pointerEvents=PointerEvents9.None,t}processData(){const{topology:t}=this;this.topologyBounds=t?.features.reduce((e,i)=>{const s=i.geometry;return s==null?e:geometryBbox(s,e)},void 0),t==null&&logger_exports.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 s=[],n=[];return e.features.forEach((o,a)=>{const{geometry:r}=o,l=r!=null&&i!=null?projectGeometry(r,i):void 0;l!=null&&s.push({series:this,itemId:a,datum:o,datumIndex:0,index:a,projectedGeometry:l})}),{itemId:t,nodeData:s,labelData:n}}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=>createDatumId18(e.index))}updateDatumNodes(t){const{properties:e}=this,{datumSelection:i}=t,{fill:s,fillOpacity:n,stroke:o,strokeOpacity:a,lineDash:r,lineDashOffset:l}=e,c=this.getStrokeWidth(e.strokeWidth);i.each((h,d)=>{const{projectedGeometry:u}=d;if(u==null){h.visible=!1,h.projectedGeometry=void 0;return}h.visible=!0,h.projectedGeometry=u;const p=getShapeStyle13({fill:s,fillOpacity:n,stroke:o,strokeWidth:c,strokeOpacity:a,lineDash:r,lineDashOffset:l},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults);h.setProperties(p)})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(t){}pickFocus(){}computeFocusBounds(t){}};MapShapeBackgroundSeries.className="MapShapeBackgroundSeries",MapShapeBackgroundSeries.type="map-shape-background";var{commonSeriesOptionsDefs:commonSeriesOptionsDefs16}=module_support_exports,mapShapeBackgroundSeriesOptionsDef={type:required(constant("map-shape-background")),topology:object,...commonSeriesOptionsDefs16,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},MapShapeBackgroundModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-shape-background",moduleFactory:t=>new MapShapeBackgroundSeries(t),tooltipDefaults:{range:"exact"},themeTemplate:{...MAP_THEME_DEFAULTS,series:{fill:{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$ref:"backgroundColor"},strokeWidth:1,fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:[{$mix:[{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"black",.15]},{$mix:[{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"white",.15]}],rotation:0,reverse:!1},fillPatternDefaults:{...module_support_exports.FILL_PATTERN_DEFAULTS,fill:{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]}}}}},MapShapeBackgroundSeriesModule={type:"series",name:"map-shape-background",chartType:"topology",enterprise:!0,options:mapShapeBackgroundSeriesOptionsDef,create:t=>new MapShapeBackgroundSeries(t)},{ChartAxisDirection:ChartAxisDirection26,PolarAxis:PolarAxis2,diff:diff7,fixNumericExtent:fixNumericExtent9,groupAccumulativeValueProperty:groupAccumulativeValueProperty3,keyProperty:keyProperty10,normaliseGroupTo:normaliseGroupTo2,resetLabelFn:resetLabelFn6,seriesLabelFadeInAnimation:seriesLabelFadeInAnimation6,seriesLabelFadeOutAnimation:seriesLabelFadeOutAnimation2,valueProperty:valueProperty16,animationValidation:animationValidation8,createDatumId:createDatumId19,SeriesNodePickMode:SeriesNodePickMode15,normalizeAngle360:normalizeAngle3607,CategoryScale:CategoryScale4,motion:motion7,applyShapeStyle:applyShapeStyle9,isGradientFill:isGradientFill5,getShapeStyle:getShapeStyle14}=module_support_exports,RadialColumnSeriesNodeEvent=class extends module_support_exports.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},RadialColumnSeriesBase=class extends module_support_exports.PolarSeries{constructor(t,{animationResetFns:e}){super({moduleCtx:t,categoryKey:"angleValue",useLabelLayer:!0,canHaveAxes:!0,pickModes:[SeriesNodePickMode15.NEAREST_NODE,SeriesNodePickMode15.EXACT_SHAPE_MATCH],animationResetFns:{...e,label:resetLabelFn6}}),this.NodeEvent=RadialColumnSeriesNodeEvent,this.groupScale=new CategoryScale4,this.circleCache={r:0,cx:0,cy:0}}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];if(t===ChartAxisDirection26.X)return e.getDomain(this,"angleValue","key",i);{const s=e.getDomain(this,"radiusValue-end","value",i),n=Number.isFinite(s[1]-s[0])?[s[0]>0?0:s[0],s[1]<0?0:s[1]]:[];return fixNumericExtent9(n)}}async processData(t){const{angleKey:e,radiusKey:i,normalizedTo:s}=this.properties,n=!this.ctx.animationManager.isSkipped();if(!this.properties.isValid())return;const o=this.getStackId(),a=`${o}-trailing`,r=[];isDefined(s)&&r.push(normaliseGroupTo2([o,a],Math.abs(s))),n&&this.processedData&&r.push(diff7(this.id,this.processedData)),n&&r.push(animationValidation8());const l=this.visible?{}:{forceValue:0},c=this.axes[ChartAxisDirection26.Y]?.scale.type,h=this.axes[ChartAxisDirection26.X]?.scale.type;await this.requestDataModel(t,this.data,{props:[keyProperty10(e,h,{id:"angleValue"}),valueProperty16(i,c,{id:"radiusValue-raw",invalidValue:null,...l}),...groupAccumulativeValueProperty3(i,"normal","current",{id:"radiusValue-end",rangeId:"radiusValue-range",invalidValue:null,groupId:o,separateNegative:!0,...l},c),...groupAccumulativeValueProperty3(i,"trailing","current",{id:"radiusValue-start",invalidValue:null,groupId:a,separateNegative:!0,...l},c),...r],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const t=this.radius,e=this.centerX,i=this.centerY,s=this.circleCache;return t!==s.r||e!==s.cx||i!==s.cy?(this.circleCache={r:t,cx:e,cy:i},!0):!1}isRadiusAxisReversed(){return this.axes[ChartAxisDirection26.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[ChartAxisDirection26.Y];return t instanceof PolarAxis2?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 s=this.axes[ChartAxisDirection26.X],n=this.axes[ChartAxisDirection26.Y],o=s?.scale,a=n?.scale;if(!o||!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),d=e.resolveProcessedDataIndexById(this,"radiusValue-range");let u=0,p=0;s instanceof AngleCategoryAxis&&(u=s.groupPaddingInner,p=s.paddingInner);const f=(o.bandwidth??0)*(1-p),{index:m,visibleGroupCount:y}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);i.domain=Array.from({length:y}).map((E,_)=>String(_)),i.range=[-f/2,f/2],i.paddingInner=y>1?u:0;const x=this.isRadiusAxisReversed(),b=x?this.radius:this.getAxisInnerRadius(),S=x?this.getAxisInnerRadius():this.radius,v=S+b,{angleKey:I,radiusKey:A,angleName:D,radiusName:T,label:k}=this.properties,w=(E,_,G,B)=>{const z=this.getLabelText(k,{value:_,datum:E,angleKey:I,radiusKey:A,angleName:D,radiusName:T});if(z)return{x:G,y:B,text:z,textAlign:"center",textBaseline:"middle"}},L=[],O={itemId:A,nodeData:L,labelData:L};if(!this.visible)return O;const{dataSources:F}=t,R=F.get(this.id)??[];for(const{datumIndex:E,group:_}of e.forEachGroupDatum(this,t)){const G=R[E],B=r[E];if(B==null)return;const z=h[E],P=z>=0&&!Object.is(z,-0),V=l[E],j=c[E],H=_.aggregation[d][P?1:0]??0,Y=P===x;if(V===void 0||j===void 0)return;let U,$;if(R.length===1)U=-.5*Math.PI,$=1.5*Math.PI;else{const nt=o.convert(B);U=normalizeAngle3607(nt+i.convert(String(m))),$=normalizeAngle3607(U+i.bandwidth)}const W=U+i.bandwidth/2,X=v-a.convert(V),Z=v-a.convert(j),q=(X+Z)/2,Q=v-a.convert(0),tt=v-a.convert(H),it=Math.cos(W)*q,J=Math.sin(W)*q,at=this.properties.label.enabled?w(G,z,it,J):void 0,lt=this.getColumnWidth(U,$);L.push({series:this,datum:G,datumIndex:E,point:{x:it,y:J,size:0},midPoint:{x:it,y:J},label:at,angleValue:B,radiusValue:z,negative:Y,innerRadius:X,outerRadius:Z,stackInnerRadius:Q,stackOuterRadius:tt,startAngle:U,endAngle:$,midAngle:W,axisInnerRadius:b,axisOuterRadius:S,columnWidth:lt,index:E})}return{itemId:A,nodeData:L,labelData:L}}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 getShapeStyle14({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},e.fillGradientDefaults,e.fillPatternDefaults)}getItemStyleOverrides(t,e,i,s){const{id:n,properties:o}=this,{angleKey:a,radiusKey:r,itemStyler:l,fillGradientDefaults:c,fillPatternDefaults:h}=o;if(l==null)return;const d=this.cachedDatumCallback(createDatumId19(t,s?"highlight":"node"),()=>this.callWithContext(l,{seriesId:n,datum:e,highlighted:s,angleKey:a,radiusKey:r,...i}));return getShapeStyle14(d,c,h)}updateSectorSelection(t,e){let i=[];if(e){const l=this.ctx.highlightManager?.getActiveHighlight();l?.datum&&l.series===this&&i.push(l)}else i=this.nodeData;const s=this.isRadiusAxisReversed(),n=s?this.radius:this.getAxisInnerRadius(),o=s?this.getAxisInnerRadius():this.radius,a=this.getShapeFillBBox(),r=this.getItemBaseStyle(e);t.update(i,void 0,l=>this.getDatumId(l)).each((l,c)=>{const{datum:h,datumIndex:d,midPoint:u}=c,p=this.getItemStyleOverrides(String(d),h,r,e),g=p?.fill??r.fill,m=isGradientFill5(g)&&g.bounds==="item"?{centerX:u?.x??0,centerY:u?.y??0}:{centerX:0,centerY:0,innerRadius:n,outerRadius:o};this.updateItemPath(l,c,e),applyShapeStyle9(l,r,p,a,m),l.cornerRadius=p?.cornerRadius??r.cornerRadius,l.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();motion7.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],e),seriesLabelFadeInAnimation6(this,"labels",this.ctx.animationManager,t)}animateClearingUpdateEmpty(){const{itemSelection:t}=this,{animationManager:e}=this.ctx,i=this.getColumnTransitionFunctions();motion7.fromToMotion(this.id,"datums",e,[t],i),seriesLabelFadeOutAnimation2(this,"labels",e,this.labelSelection)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:o}=this,{angleKey:a,angleName:r,radiusKey:l,radiusName:c,tooltip:h}=o,d=n[ChartAxisDirection26.X],u=n[ChartAxisDirection26.Y];if(!i||!s||!d||!u)return;const p=s.dataSources.get(this.id)?.[t],g=i.resolveKeysById(this,"angleValue",s)[t],f=i.resolveColumnById(this,"radiusValue-raw",s)[t];if(g==null)return;const m=this.getItemBaseStyle(!1);return Object.assign(m,this.getItemStyleOverrides(String(t),t,m,!1)),h.formatTooltip(this.properties,{heading:d.formatDatum(g),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:u.formatDatum(f)}]},{seriesId:e,datum:p,title:r,angleKey:a,angleName:r,radiusKey:l,radiusName:c,...m})}pickNodeClosestDatum(t){return this.pickNodeNearestDistantObject(t,this.itemSelection.nodes())}legendItemSymbol(){const{fill:t,stroke:e,fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:o,lineDashOffset:a,fillGradientDefaults:r,fillPatternDefaults:l}=this.properties,c=getShapeStyle14({fill:t??"rgba(0, 0, 0, 0)",stroke:e??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:o,lineDashOffset:a},r,l);return module_support_exports.isGradientFill(c.fill)&&(c.fill={...c.fill,gradient:"linear",rotation:0,reverse:!1}),{marker:c}}getLegendData(t){if(!this.properties.isValid()||t!=="category")return[];const{id:e,visible:i}=this,{radiusKey:s,radiusName:n,showInLegend:o}=this.properties;return[{legendType:"category",id:e,itemId:s,seriesId:e,enabled:i,label:{text:n??s},symbol:this.legendItemSymbol(),hideInLegend:!o}]}getDatumId(t){return createDatumId19(t.angleValue)}computeLabelsBBox(){return null}},{SeriesProperties:SeriesProperties9,FillGradientDefaults:FillGradientDefaults13,FillPatternDefaults:FillPatternDefaults13,SeriesTooltip:SeriesTooltip18,TempValidate:TempValidate75,COLOR_STRING:COLOR_STRING26,NUMBER:NUMBER19,FUNCTION:FUNCTION19,LINE_DASH:LINE_DASH21,OBJECT:OBJECT41,POSITIVE_NUMBER:POSITIVE_NUMBER33,RATIO:RATIO29,STRING:STRING38,Label:Label13,OR:OR18,COLOR_GRADIENT:COLOR_GRADIENT13,COLOR_PATTERN:COLOR_PATTERN13}=module_support_exports,RadialColumnSeriesBaseProperties=class extends SeriesProperties9{constructor(){super(...arguments),this.fill="black",this.fillGradientDefaults=new FillGradientDefaults13,this.fillPatternDefaults=new FillPatternDefaults13,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 Label13,this.tooltip=new SeriesTooltip18}};__decorateClass([TempValidate75(STRING38)],RadialColumnSeriesBaseProperties.prototype,"angleKey",2),__decorateClass([TempValidate75(STRING38,{optional:!0})],RadialColumnSeriesBaseProperties.prototype,"angleName",2),__decorateClass([TempValidate75(STRING38)],RadialColumnSeriesBaseProperties.prototype,"radiusKey",2),__decorateClass([TempValidate75(STRING38,{optional:!0})],RadialColumnSeriesBaseProperties.prototype,"radiusName",2),__decorateClass([TempValidate75(OR18(COLOR_GRADIENT13,COLOR_PATTERN13,COLOR_STRING26))],RadialColumnSeriesBaseProperties.prototype,"fill",2),__decorateClass([TempValidate75(OBJECT41)],RadialColumnSeriesBaseProperties.prototype,"fillGradientDefaults",2),__decorateClass([TempValidate75(OBJECT41)],RadialColumnSeriesBaseProperties.prototype,"fillPatternDefaults",2),__decorateClass([TempValidate75(RATIO29)],RadialColumnSeriesBaseProperties.prototype,"fillOpacity",2),__decorateClass([TempValidate75(COLOR_STRING26)],RadialColumnSeriesBaseProperties.prototype,"stroke",2),__decorateClass([TempValidate75(POSITIVE_NUMBER33)],RadialColumnSeriesBaseProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate75(RATIO29)],RadialColumnSeriesBaseProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate75(LINE_DASH21)],RadialColumnSeriesBaseProperties.prototype,"lineDash",2),__decorateClass([TempValidate75(POSITIVE_NUMBER33)],RadialColumnSeriesBaseProperties.prototype,"lineDashOffset",2),__decorateClass([TempValidate75(POSITIVE_NUMBER33)],RadialColumnSeriesBaseProperties.prototype,"cornerRadius",2),__decorateClass([TempValidate75(FUNCTION19,{optional:!0})],RadialColumnSeriesBaseProperties.prototype,"itemStyler",2),__decorateClass([TempValidate75(NUMBER19)],RadialColumnSeriesBaseProperties.prototype,"rotation",2),__decorateClass([TempValidate75(STRING38,{optional:!0})],RadialColumnSeriesBaseProperties.prototype,"stackGroup",2),__decorateClass([TempValidate75(NUMBER19,{optional:!0})],RadialColumnSeriesBaseProperties.prototype,"normalizedTo",2),__decorateClass([TempValidate75(OBJECT41)],RadialColumnSeriesBaseProperties.prototype,"label",2),__decorateClass([TempValidate75(OBJECT41)],RadialColumnSeriesBaseProperties.prototype,"tooltip",2);var{motion:motion8}=module_support_exports;function createAngleMotionCalculator(){const t={startAngle:new Map,endAngle:new Map},e=["startAngle","endAngle"],i=(a,r,l)=>{e.forEach(c=>{const h=t[c];let d=(l==="removed"||l==="updated"?a:r)[c],u=(l==="removed"?a:r)[c];isNaN(u)&&(u=a.previousDatum?.[c]??NaN);const p=d-u;Math.abs(p)>Math.PI&&(d-=Math.sign(p)*2*Math.PI),h.set(r,{from:d,to:u})})},s=(a,r)=>({startAngle:t.startAngle.get(a)[r],endAngle:t.endAngle.get(a)[r]});return{calculate:i,from:a=>s(a,"from"),to:a=>s(a,"to")}}function fixRadialColumnAnimationStatus(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 prepareRadialColumnAnimationFunctions(t){const e=createAngleMotionCalculator();return{toFn:(n,o,a)=>{const{startAngle:r,endAngle:l}=e.to(o);let c,h,d,u,p;return a==="removed"?(c=n.innerRadius,h=n.innerRadius,d=n.columnWidth,u=n.axisInnerRadius,p=n.axisOuterRadius):(c=isNaN(o.innerRadius)?t:o.innerRadius,h=isNaN(o.outerRadius)?t:o.outerRadius,d=isNaN(o.columnWidth)?n.columnWidth:o.columnWidth,u=o.axisInnerRadius,p=o.axisOuterRadius),{innerRadius:c,outerRadius:h,columnWidth:d,axisInnerRadius:u,axisOuterRadius:p,startAngle:r,endAngle:l}},fromFn:(n,o,a)=>{a=fixRadialColumnAnimationStatus(n,o,a),e.calculate(n,o,a);const{startAngle:r,endAngle:l}=e.from(o);let c,h,d,u,p;a==="removed"||a==="updated"?(c=n.innerRadius,h=n.outerRadius,d=n.columnWidth,u=n.axisInnerRadius,p=n.axisOuterRadius):(c=t,h=t,d=o.columnWidth,u=o.axisInnerRadius,p=o.axisOuterRadius);const g=motion8.NODE_UPDATE_STATE_TO_PHASE_MAPPING[a];return{innerRadius:c,outerRadius:h,columnWidth:d,axisInnerRadius:u,axisOuterRadius:p,startAngle:r,endAngle:l,phase:g}}}}function resetRadialColumnSelectionFn(t,{innerRadius:e,outerRadius:i,columnWidth:s,axisInnerRadius:n,axisOuterRadius:o,startAngle:a,endAngle:r}){return{innerRadius:e,outerRadius:i,columnWidth:s,axisInnerRadius:n,axisOuterRadius:o,startAngle:a,endAngle:r}}var{SectorBox:SectorBox2,motion:motion9}=module_support_exports;function getRadii(t){const{negative:e,innerRadius:i,outerRadius:s,stackInnerRadius:n,stackOuterRadius:o}=t;return{innerRadius:e?o:n,outerRadius:e?n:o,clipInnerRadius:e?s:i,clipOuterRadius:e?i:s}}function prepareNightingaleAnimationFunctions(t){const e=createAngleMotionCalculator();return{toFn:(n,o,a)=>{const{startAngle:r,endAngle:l}=e.to(o);let c,h,d;if(a==="removed")c=t,h=t,d=new SectorBox2(r,l,c,h);else{let u,p;({innerRadius:c,outerRadius:h,clipInnerRadius:u,clipOuterRadius:p}=getRadii(o)),isNaN(c)&&(c=t),isNaN(h)&&(h=t),isNaN(u)&&(u=t),isNaN(p)&&(p=t),d=new SectorBox2(r,l,u,p)}return{innerRadius:c,outerRadius:h,startAngle:r,endAngle:l,clipSector:d}},fromFn:(n,o,a)=>{a=fixRadialColumnAnimationStatus(n,o,a),e.calculate(n,o,a);const{startAngle:r,endAngle:l}=e.from(o);let c,h,d;a==="removed"||a==="updated"?(c=n.innerRadius,h=n.outerRadius,d=n.clipSector):(c=t,h=t),d??(d=new SectorBox2(r,l,c,h));const u=motion9.NODE_UPDATE_STATE_TO_PHASE_MAPPING[a];return{innerRadius:c,outerRadius:h,startAngle:r,endAngle:l,clipSector:d,phase:u}}}}function resetNightingaleSelectionFn(t,e){const{startAngle:i,endAngle:s}=e,{innerRadius:n,outerRadius:o,clipInnerRadius:a,clipOuterRadius:r}=getRadii(e),l=new SectorBox2(i,s,a,r);return{innerRadius:n,outerRadius:o,startAngle:i,endAngle:s,clipSector:l}}var{Sector:Sector5,SectorBox:SectorBox3,PolarZIndexMap:PolarZIndexMap2}=module_support_exports,NightingaleSeries=class extends RadialColumnSeriesBase{constructor(t){super(t,{animationResetFns:{item:resetNightingaleSelectionFn}}),this.properties=new RadialColumnSeriesBaseProperties}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.contentGroup.zIndex=[0,PolarZIndexMap2.FOREGROUND,t],this.highlightGroup.zIndex=[0,PolarZIndexMap2.HIGHLIGHT,t],this.labelGroup.zIndex=[0,PolarZIndexMap2.LABEL,t],!0):!1}getStackId(){return`nightingale-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new Sector5}updateItemPath(t,e,i){const{negative:s}=e;if(t.centerX=0,t.centerY=0,t.startOuterCornerRadius=s?0:this.properties.cornerRadius,t.endOuterCornerRadius=s?0:this.properties.cornerRadius,t.startInnerCornerRadius=s?this.properties.cornerRadius:0,t.endInnerCornerRadius=s?this.properties.cornerRadius:0,i){const{startAngle:n,endAngle:o}=e,{innerRadius:a,outerRadius:r,clipInnerRadius:l,clipOuterRadius:c}=getRadii(e);t.innerRadius=a,t.outerRadius=r,t.startAngle=n,t.endAngle=o,t.clipSector=new SectorBox3(n,o,l,c)}}getColumnTransitionFunctions(){const t=this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius();return prepareNightingaleAnimationFunctions(t)}};NightingaleSeries.className="NightingaleSeries",NightingaleSeries.type="nightingale";var{commonSeriesOptionsDefs:commonSeriesOptionsDefs17,seriesLabelOptionsDefs:seriesLabelOptionsDefs11,tooltipOptionsDefs:tooltipOptionsDefs16}=module_support_exports,nightingaleSeriesOptionsDef={type:required(constant("nightingale")),angleKey:required(string),radiusKey:required(string),angleName:string,radiusName:string,grouped:boolean,stacked:boolean,stackGroup:string,normalizedTo:number,cornerRadius:positiveNumber,itemStyler:callback,label:seriesLabelOptionsDefs11,tooltip:tooltipOptionsDefs16,...commonSeriesOptionsDefs17,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},{ThemeConstants:{POLAR_AXIS_TYPE:POLAR_AXIS_TYPE2,POLAR_AXIS_SHAPE:POLAR_AXIS_SHAPE2}}=module_support_exports,axisShape={$path:["./shape",POLAR_AXIS_SHAPE2.CIRCLE,{$find:[{$not:[{$isOperation:"./shape"}]},{$path:".."}]}]},NIGHTINGALE_SERIES_THEME={series:{fill:{$palette:"fill"},stroke:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$ref:"backgroundColor"},{$palette:"stroke"}]},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"series",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:module_support_exports.FILL_PATTERN_DEFAULTS,strokeWidth:1,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}},axes:{[POLAR_AXIS_TYPE2.ANGLE_CATEGORY]:{shape:axisShape,groupPaddingInner:0,paddingInner:0,label:{spacing:10}},[POLAR_AXIS_TYPE2.RADIUS_NUMBER]:{shape:axisShape}}},{ThemeConstants:{POLAR_AXIS_TYPE:POLAR_AXIS_TYPE3}}=module_support_exports,NightingaleModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"nightingale",moduleFactory:t=>new NightingaleSeries(t),tooltipDefaults:{range:"exact"},defaultAxes:[{type:POLAR_AXIS_TYPE3.ANGLE_CATEGORY},{type:POLAR_AXIS_TYPE3.RADIUS_NUMBER}],themeTemplate:NIGHTINGALE_SERIES_THEME,stackable:!0,groupable:!0,stackedByDefault:!0},NightingaleSeriesModule={type:"series",name:"nightingale",chartType:"polar",enterprise:!0,options:nightingaleSeriesOptionsDef,create:t=>new NightingaleSeries(t)},{SeriesProperties:SeriesProperties10,FillGradientDefaults:FillGradientDefaults14,FillPatternDefaults:FillPatternDefaults14,SeriesTooltip:SeriesTooltip19,TempValidate:TempValidate76,UNION:UNION17,OR:OR19,ARRAY_OF:ARRAY_OF5,COLOR_GRADIENT:COLOR_GRADIENT14,COLOR_STRING:COLOR_STRING27,COLOR_STRING_ARRAY:COLOR_STRING_ARRAY12,FUNCTION:FUNCTION20,DIRECTION:DIRECTION3,BOOLEAN:BOOLEAN34,LINE_DASH:LINE_DASH22,OBJECT:OBJECT42,NUMBER:NUMBER20,POSITIVE_NUMBER:POSITIVE_NUMBER34,COLOR_PATTERN:COLOR_PATTERN14,RATIO:RATIO30,STRING:STRING39,Label:Label14,DropShadow:DropShadow6}=module_support_exports,PyramidSeriesLabel=class extends Label14{},PyramidSeriesStageLabel=class extends Label14{constructor(){super(...arguments),this.spacing=0}};__decorateClass([TempValidate76(NUMBER20)],PyramidSeriesStageLabel.prototype,"spacing",2),__decorateClass([TempValidate76(UNION17(["before","after"],"a placement"))],PyramidSeriesStageLabel.prototype,"placement",2);var PyramidProperties=class extends SeriesProperties10{constructor(){super(...arguments),this.fills=[],this.fillGradientDefaults=new FillGradientDefaults14,this.fillPatternDefaults=new FillPatternDefaults14,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 DropShadow6().set({enabled:!1}),this.label=new PyramidSeriesLabel,this.stageLabel=new PyramidSeriesStageLabel,this.tooltip=new SeriesTooltip19}};__decorateClass([TempValidate76(STRING39)],PyramidProperties.prototype,"stageKey",2),__decorateClass([TempValidate76(STRING39)],PyramidProperties.prototype,"valueKey",2),__decorateClass([TempValidate76(ARRAY_OF5(OR19(COLOR_GRADIENT14,COLOR_PATTERN14,COLOR_STRING27)))],PyramidProperties.prototype,"fills",2),__decorateClass([TempValidate76(OBJECT42)],PyramidProperties.prototype,"fillGradientDefaults",2),__decorateClass([TempValidate76(OBJECT42)],PyramidProperties.prototype,"fillPatternDefaults",2),__decorateClass([TempValidate76(RATIO30)],PyramidProperties.prototype,"fillOpacity",2),__decorateClass([TempValidate76(COLOR_STRING_ARRAY12)],PyramidProperties.prototype,"strokes",2),__decorateClass([TempValidate76(POSITIVE_NUMBER34)],PyramidProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate76(RATIO30)],PyramidProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate76(LINE_DASH22)],PyramidProperties.prototype,"lineDash",2),__decorateClass([TempValidate76(POSITIVE_NUMBER34)],PyramidProperties.prototype,"lineDashOffset",2),__decorateClass([TempValidate76(DIRECTION3)],PyramidProperties.prototype,"direction",2),__decorateClass([TempValidate76(BOOLEAN34,{optional:!0})],PyramidProperties.prototype,"reverse",2),__decorateClass([TempValidate76(POSITIVE_NUMBER34)],PyramidProperties.prototype,"spacing",2),__decorateClass([TempValidate76(POSITIVE_NUMBER34,{optional:!0})],PyramidProperties.prototype,"aspectRatio",2),__decorateClass([TempValidate76(FUNCTION20,{optional:!0})],PyramidProperties.prototype,"itemStyler",2),__decorateClass([TempValidate76(OBJECT42)],PyramidProperties.prototype,"shadow",2),__decorateClass([TempValidate76(OBJECT42)],PyramidProperties.prototype,"label",2),__decorateClass([TempValidate76(OBJECT42)],PyramidProperties.prototype,"stageLabel",2),__decorateClass([TempValidate76(OBJECT42)],PyramidProperties.prototype,"tooltip",2);function applyPyramidDatum(t,{x:e,y:i,top:s,right:n,bottom:o,left:a}){t.x0=e-s/2,t.x1=e+s/2,t.x2=e+o/2,t.x3=e-o/2,t.y0=i-a/2,t.y1=i-n/2,t.y2=i+n/2,t.y3=i+a/2}function preparePyramidAnimationFunctions(t){return{fromFn:(n,o)=>{const{x:a,y:r}=o;let{top:l,right:c,bottom:h,left:d}=o;return t==="vertical"?(l=0,h=0):(d=0,c=0),{x:a,y:r,top:l,right:c,bottom:h,left:d}},toFn:(n,o)=>{const{x:a,y:r,top:l,right:c,bottom:h,left:d}=o;return{x:a,y:r,top:l,right:c,bottom:h,left:d}},applyFn:applyPyramidDatum}}var{StateMachine:StateMachine15,valueProperty:valueProperty17,SeriesNodePickMode:SeriesNodePickMode16,CachedTextMeasurerPool:CachedTextMeasurerPool11,TextUtils:TextUtils8,createDatumId:createDatumId20,BBox:BBox22,Group:Group18,Selection:Selection13,Text:Text7,PointerEvents:PointerEvents10,applyShapeStyle:applyShapeStyle10,fromToMotion:fromToMotion5,seriesLabelFadeInAnimation:seriesLabelFadeInAnimation7,getShapeStyle:getShapeStyle15}=module_support_exports,PyramidSeries=class extends module_support_exports.DataModelSeries{constructor(t){super({moduleCtx:t,categoryKey:void 0,pickModes:[SeriesNodePickMode16.EXACT_SHAPE_MATCH,SeriesNodePickMode16.NEAREST_NODE]}),this.properties=new PyramidProperties,this.itemGroup=this.contentGroup.appendChild(new Group18({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new Group18({name:"itemLabelGroup"})),this.stageLabelGroup=this.contentGroup.appendChild(new Group18({name:"stageLabelGroup"})),this.datumSelection=Selection13.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=Selection13.select(this.itemLabelGroup,Text7),this.stageLabelSelection=Selection13.select(this.stageLabelGroup,Text7),this.highlightDatumSelection=Selection13.select(this.highlightNode,()=>this.nodeFactory()),this.animationState=new StateMachine15("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{clear:"empty",reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable()),this.itemLabelGroup.pointerEvents=PointerEvents10.None,this.stageLabelGroup.pointerEvents=PointerEvents10.None}addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager?.addListener("legend-item-click",t=>this.onLegendItemClick(t)))}nodeFactory(){return new FunnelConnector}getNodeData(){return this.contextNodeData?.nodeData}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}async processData(t){if(this.data==null||!this.properties.isValid())return;const{id:e,visible:i,ctx:{legendManager:s}}=this,{stageKey:n,valueKey:o}=this.properties,a="band",r="number",l=(h,d,u)=>i&&s.getItemEnabled({seriesId:e,itemId:u}),c=this.visible?{}:{forceValue:0};await this.requestDataModel(t,this.data,{props:[valueProperty17(n,a,{id:"xValue"}),valueProperty17(o,r,{id:"yValue",...c,validation:l,invalidValue:0})]})}createNodeData(){const{id:t,dataModel:e,processedData:i,properties:s,visible:n,ctx:{legendManager:o}}=this,{stageKey:a,valueKey:r,direction:l,reverse:c=l==="horizontal",spacing:h,aspectRatio:d,label:u,stageLabel:p}=s;if(e==null||i==null)return;const g=l==="horizontal",f=e.resolveColumnById(this,"xValue",i),m=e.resolveColumnById(this,"yValue",i),y=CachedTextMeasurerPool11.getMeasurer({font:p.getFont()});let x,b;g?(x="center",b=p.placement==="before"?"bottom":"top"):(x=p.placement==="after"?"left":"right",b="middle");const S=p.enabled?[]:void 0;let v=0,I=0,A=0;const D=i.dataSources.get(this.id)??[];D.forEach((z,P)=>{const V=f[P],j=m[P],H=n&&o.getItemEnabled({seriesId:t,itemId:P});if(A+=j,S==null)return;const Y=this.getLabelText(this.properties.stageLabel,{datum:z,value:V,stageKey:a,valueKey:r}),{width:U}=y.measureText(Y),$=Y.split(`
`).length*TextUtils8.getLineHeight(u.fontSize);v=Math.max(v,U),I=Math.max(I,$),S.push({x:NaN,y:NaN,text:Y,textAlign:x,textBaseline:b,visible:H})});const T=this._nodeDataDependencies?.seriesRectWidth??0,k=this._nodeDataDependencies?.seriesRectHeight??0,w=h*(i.input.count-1);let L;if(g){const z=I+p.spacing;L=new BBox22(0,p.placement==="before"?z:0,T,k-z)}else{const z=v+p.spacing;L=new BBox22(p.placement==="after"?0:z,0,T-z,k)}if(d!=null&&d!==0){const z=l==="horizontal"?1/d:d,P=Math.min(L.width,L.height*z),V=P/z;L=new BBox22(L.x+(L.width-P)/2,L.y+(L.height-V)/2,P,V)}let O,F;g?F=p.placement==="before"?L.y-p.spacing:L.y+L.height+p.spacing:O=p.placement==="after"?L.x+L.width+p.spacing:L.x-p.spacing;const R=L.width-(g?w:0),E=L.height-(g?0:w);if(R<0||E<0)return;const _=[],G=[];let B=0;return D.forEach((z,P)=>{const V=f[P],j=m[P],H=n&&o.getItemEnabled({seriesId:t,itemId:P}),Y=B+j,U=(B+Y)/(2*A),$=(Y-B)/A,W=g?R*U+h*P:R*.5,X=g?E*.5:E*U+h*P,Z=L.x+W,q=L.y+X;if(S!=null){const nt=S[P];nt.x=O??Z,nt.y=F??q}let Q,tt,it,J;if(g){const nt=R*$;Q=nt,it=nt;const ot=(W+nt/2)*(E/L.width),et=(W-nt/2)*(E/L.width);tt=c?L.height-ot:ot,J=c?L.height-et:et}else{const nt=E*$;tt=nt,J=nt;const ot=(X-nt/2)*(R/L.height),et=(X+nt/2)*(R/L.height);Q=c?L.width-ot:ot,it=c?L.width-et:et}const at=this.getLabelText(u,{datum:z,value:j,stageKey:a,valueKey:r}),lt={x:Z,y:q,text:at,textAlign:"center",textBaseline:"middle",visible:H};G.push(lt),_.push({series:this,itemId:r,datum:z,datumIndex:P,index:P,xValue:V,yValue:j,x:Z,y:q,top:Q,right:tt,bottom:it,left:J,label:lt,enabled:H,midPoint:{x:Z,y:q}}),B=Y}),{itemId:t,nodeData:_,labelData:G,stageLabelData:S,bounds:L}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update({seriesRect:t}){this.checkResize(t);const{datumSelection:e,labelSelection:i,stageLabelSelection:s,highlightDatumSelection:n}=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 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:s}),this.updateLabelNodes({labelSelection:s,labelProperties:this.properties.stageLabel}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:o!=null?[o]:[],datumSelection:n}),this.updateDatumNodes({datumSelection:n,isHighlight:!0}),this.animationState.transition("update")}updateDatumSelection(t){return t.datumSelection.update(t.nodeData)}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return getShapeStyle15({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},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}getItemStyleOverrides(t,e,i,s,n){const{id:o,properties:a}=this,{fills:r,strokes:l,stageKey:c,valueKey:h,itemStyler:d}=a,u=s.fill??r[i%r.length],p=s.stroke??l[i%l.length],g={};if(n||(g.fill=u,g.stroke=p),d!=null){const f=this.cachedDatumCallback(createDatumId20(t,n?"highlight":"node"),()=>this.callWithContext(d,{seriesId:o,datum:e,stageKey:c,valueKey:h,highlighted:n,fill:u,stroke:p,...s}));Object.assign(g,f)}return getShapeStyle15(g,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}updateDatumNodes(t){const{datumSelection:e,isHighlight:i}=t,{properties:s}=this,{shadow:n}=s,o=this.getItemBaseStyle(i),a=this.contextNodeData?.bounds,r=a?{series:a,axis:a}:void 0;e.each((l,c)=>{const{datumIndex:h,datum:d}=c,u=this.getItemStyleOverrides(String(h),d,h,o,i);applyShapeStyle10(l,o,u,r),applyPyramidDatum(l,c),l.fillShadow=n})}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:s,fontSize:n,fontStyle:o,fontWeight:a,fontFamily:r}=i;e.each((l,{visible:c,x:h,y:d,text:u,textAlign:p,textBaseline:g})=>{l.visible=c,l.x=h,l.y=d,l.text=u,l.fill=s,l.fontStyle=o,l.fontWeight=a,l.fontSize=n,l.fontFamily=r,l.textAlign=p,l.textBaseline=g})}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:s,properties:n}=this,{stageKey:o,valueKey:a,tooltip:r}=n;if(!i||!s)return;const l=s.dataSources.get(this.id)?.[t],c=i.resolveColumnById(this,"xValue",s)[t],h=i.resolveColumnById(this,"yValue",s)[t];if(c==null)return;const d=this.getLabelText(this.properties.stageLabel,{datum:s.dataSources.get(this.id)?.[t],value:h,stageKey:o,valueKey:a}),u=this.getItemBaseStyle(!1);return Object.assign(u,this.getItemStyleOverrides(String(t),t,t,u,!1)),r.formatTooltip(this.properties,{symbol:this.legendItemSymbol(t),data:[{label:String(c),value:d}]},{seriesId:e,datum:l,title:void 0,stageKey:o,valueKey:a,...u})}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(t,e){return[NaN,NaN]}pickNodeClosestDatum({x:t,y:e}){let i=1/0,s;return this.datumSelection.each((n,o)=>{const a=n.distanceSquared(t,e);a<i&&(i=a,s=o)}),s!=null?{datum:s,distance:Math.sqrt(i)}:void 0}legendItemSymbol(t){const{fills:e,strokes:i,strokeWidth:s,fillOpacity:n,strokeOpacity:o,lineDash:a,lineDashOffset:r}=this.properties,l=e[t%e.length]??"black",c=i[t%i.length]??"black";return{marker:getShapeStyle15({fill:l,fillOpacity:n,stroke:c,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:r},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}}getLegendData(t){const{processedData:e,dataModel:i,id:s,ctx:{legendManager:n},visible:o}=this;if(!i||!e||t!=="category"||!this.properties.isValid())return[];const{showInLegend:a}=this.properties,r=[],l=i.resolveColumnById(this,"xValue",e);return(e.dataSources.get(this.id)??[]).forEach((h,d)=>{const u=l[d];r.push({legendType:"category",id:s,itemId:d,seriesId:s,enabled:o&&n.getItemEnabled({seriesId:s,itemId:d}),label:{text:u},symbol:this.legendItemSymbol(d),hideInLegend:!a})}),r}animateReset(){this.ctx.animationManager.skipCurrentBatch(),this.ctx.animationManager.stopByAnimationGroupId(this.id)}animateEmptyUpdateReady(){const{datumSelection:t,labelSelection:e,properties:i}=this,s=preparePyramidAnimationFunctions(i.direction);fromToMotion5(this.id,"nodes",this.ctx.animationManager,[t],s),seriesLabelFadeInAnimation7(this,"labels",this.ctx.animationManager,e)}};PyramidSeries.className="PyramidSeries",PyramidSeries.type="pyramid";var{commonSeriesOptionsDefs:commonSeriesOptionsDefs18,seriesLabelOptionsDefs:seriesLabelOptionsDefs12,shadowOptionsDefs:shadowOptionsDefs6,tooltipOptionsDefs:tooltipOptionsDefs17,without:without6}=module_support_exports,pyramidSeriesOptionsDef={type:required(constant("pyramid")),stageKey:required(string),valueKey:required(string),direction:union("horizontal","vertical"),aspectRatio:positiveNumber,spacing:positiveNumber,reverse:boolean,itemStyler:callback,fills:arrayOf(colorUnion),strokes:arrayOf(color),label:seriesLabelOptionsDefs12,stageLabel:{spacing:positiveNumber,placement:union("before","after"),...seriesLabelOptionsDefs12},tooltip:tooltipOptionsDefs17,shadow:shadowOptionsDefs6,...commonSeriesOptionsDefs18,...without6(fillOptionsDef,["fill"]),...without6(strokeOptionsDef,["stroke"]),...lineDashOptionsDef},{ThemeSymbols:{DEFAULT_SHADOW_COLOUR:DEFAULT_SHADOW_COLOUR3}}=module_support_exports,PYRAMID_SERIES_THEME={series:{direction:"vertical",strokeWidth:0,spacing:2,fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:module_support_exports.FILL_PATTERN_DEFAULTS,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:DEFAULT_SHADOW_COLOUR3,xOffset:3,yOffset:3,blur:5}}},PyramidModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],identifier:"pyramid",moduleFactory:t=>new PyramidSeries(t),solo:!0,tooltipDefaults:{range:"exact"},themeTemplate:PYRAMID_SERIES_THEME},PyramidSeriesModule={type:"series",name:"pyramid",chartType:"standalone",enterprise:!0,options:pyramidSeriesOptionsDef,create:t=>new PyramidSeries(t)},{ThemeConstants:{POLAR_AXIS_TYPE:POLAR_AXIS_TYPE4}}=module_support_exports,BASE_RADAR_SERIES_THEME={series:{stroke:{$palette:"stroke"},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},marker:{enabled:!0,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:module_support_exports.FILL_PATTERN_DEFAULTS,fillOpacity:1,shape:"circle",size:6,strokeOpacity:1,strokeWidth:0}},axes:{[POLAR_AXIS_TYPE4.ANGLE_CATEGORY]:{label:{spacing:10}}}},RADAR_LINE_SERIES_THEME=module_support_exports.mergeDefaults({series:{stroke:module_support_exports.SAFE_STROKE_FILL_OPERATION,strokeWidth:2}},BASE_RADAR_SERIES_THEME),RADAR_AREA_SERIES_THEME=module_support_exports.mergeDefaults({series:{fill:{$palette:"fill"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:module_support_exports.FILL_PATTERN_DEFAULTS,fillOpacity:.8,strokeWidth:2,marker:{enabled:!1,fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:module_support_exports.FILL_PATTERN_DEFAULTS}}},BASE_RADAR_SERIES_THEME),{Label:Label15,SeriesMarker:SeriesMarker3,SeriesProperties:SeriesProperties11,SeriesTooltip:SeriesTooltip20,TempValidate:TempValidate77,BOOLEAN:BOOLEAN35,COLOR_STRING:COLOR_STRING28,NUMBER:NUMBER21,LINE_DASH:LINE_DASH23,OBJECT:OBJECT43,POSITIVE_NUMBER:POSITIVE_NUMBER35,RATIO:RATIO31,STRING:STRING40}=module_support_exports,RadarSeriesProperties=class extends SeriesProperties11{constructor(){super(...arguments),this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.rotation=0,this.marker=new SeriesMarker3,this.label=new Label15,this.tooltip=new SeriesTooltip20,this.connectMissingData=!1}};__decorateClass([TempValidate77(STRING40)],RadarSeriesProperties.prototype,"angleKey",2),__decorateClass([TempValidate77(STRING40)],RadarSeriesProperties.prototype,"radiusKey",2),__decorateClass([TempValidate77(STRING40,{optional:!0})],RadarSeriesProperties.prototype,"angleName",2),__decorateClass([TempValidate77(STRING40,{optional:!0})],RadarSeriesProperties.prototype,"radiusName",2),__decorateClass([TempValidate77(COLOR_STRING28)],RadarSeriesProperties.prototype,"stroke",2),__decorateClass([TempValidate77(POSITIVE_NUMBER35)],RadarSeriesProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate77(RATIO31)],RadarSeriesProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate77(LINE_DASH23)],RadarSeriesProperties.prototype,"lineDash",2),__decorateClass([TempValidate77(POSITIVE_NUMBER35)],RadarSeriesProperties.prototype,"lineDashOffset",2),__decorateClass([TempValidate77(NUMBER21)],RadarSeriesProperties.prototype,"rotation",2),__decorateClass([TempValidate77(OBJECT43)],RadarSeriesProperties.prototype,"marker",2),__decorateClass([TempValidate77(OBJECT43)],RadarSeriesProperties.prototype,"label",2),__decorateClass([TempValidate77(OBJECT43)],RadarSeriesProperties.prototype,"tooltip",2),__decorateClass([TempValidate77(BOOLEAN35)],RadarSeriesProperties.prototype,"connectMissingData",2);var{ChartAxisDirection:ChartAxisDirection27,PolarAxis:PolarAxis3,SeriesNodePickMode:SeriesNodePickMode17,valueProperty:valueProperty18,fixNumericExtent:fixNumericExtent10,seriesLabelFadeInAnimation:seriesLabelFadeInAnimation8,markerFadeInAnimation:markerFadeInAnimation3,resetMarkerFn:resetMarkerFn3,animationValidation:animationValidation9,computeMarkerFocusBounds:computeMarkerFocusBounds4,extent:extent3,BBox:BBox23,Group:Group19,Path:Path12,PointerEvents:PointerEvents11,Selection:Selection14,Text:Text8,Marker:Marker5,mergeDefaults:mergeDefaults7,getShapeStyle:getShapeStyle16}=module_support_exports,RadarSeriesNodeEvent=class extends module_support_exports.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},RadarSeries=class extends module_support_exports.PolarSeries{constructor(t){super({moduleCtx:t,categoryKey:"angleValue",useLabelLayer:!0,pickModes:[SeriesNodePickMode17.NEAREST_NODE,SeriesNodePickMode17.EXACT_SHAPE_MATCH],canHaveAxes:!0,animationResetFns:{item:resetMarkerFn3},clipFocusBox:!1}),this.properties=new RadarSeriesProperties,this.NodeEvent=RadarSeriesNodeEvent,this.lineGroup=this.contentGroup.appendChild(new Group19({name:"radar-line"})),this.lineSelection=Selection14.select(this.lineGroup,Path12),this.resetInvalidToZero=!1,this.circleCache={r:0,cx:0,cy:0},this.lineGroup.zIndex=0,this.itemGroup.zIndex=1}nodeFactory(){return new Marker5}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];if(t===ChartAxisDirection27.X)return e.getDomain(this,"angleValue","value",i);{const s=e.getDomain(this,"radiusValue","value",i),n=extent3(s.length===0?s:[0].concat(s));return fixNumericExtent10(n)}}async processData(t){if(!this.properties.isValid())return;const{angleKey:e,radiusKey:i}=this.properties,s=[];this.ctx.animationManager.isSkipped()||s.push(animationValidation9());const n=this.axes[ChartAxisDirection27.Y]?.scale.type,o=this.axes[ChartAxisDirection27.X]?.scale.type;await this.requestDataModel(t,this.data,{props:[valueProperty18(e,o,{id:"angleValue"}),valueProperty18(i,n,{id:"radiusValue",invalidValue:void 0}),...s]}),this.animationState.transition("updateData")}didCircleChange(){const t=this.radius,e=this.centerX,i=this.centerY,s=this.circleCache;return t===s.r&&e===s.cx&&i===s.cy?!1:(this.circleCache={r:t,cx:e,cy:i},!0)}getAxisInnerRadius(){const t=this.axes[ChartAxisDirection27.Y];return t instanceof PolarAxis3?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:s,angleName:n,radiusName:o,marker:a,label:r}=this.properties,l=this.axes[ChartAxisDirection27.X]?.scale,c=this.axes[ChartAxisDirection27.Y]?.scale;if(!l||!c)return;const h=e.resolveColumnById(this,"angleValue",t),d=e.resolveColumnById(this,"radiusValue",t),u=this.getAxisInnerRadius(),g=(t.dataSources.get(this.id)??[]).map((f,m)=>{const y=h[m],x=d[m],b=l.convert(y),S=this.radius+u-c.convert(x),v=Math.cos(b),I=Math.sin(b),A=v*S,D=I*S;let T;if(r.enabled){const k=this.getLabelText(r,{value:x,datum:f,angleKey:i,radiusKey:s,angleName:n,radiusName:o});if(k){let w="right";isNumberEqual(v,0)?w="center":v>0&&(w="left");let L="bottom";isNumberEqual(I,0)?L="middle":I>0&&(L="top"),T={x:A+v*a.size,y:D+I*a.size,text:k,textAlign:w,textBaseline:L}}}return{series:this,datum:f,datumIndex:m,index:m,point:{x:A,y:D,size:a.size},midPoint:{x:A,y:D},label:T,angleValue:y,radiusValue:x,missing:!isFiniteNumber(b)||!isFiniteNumber(S)}});return{itemId:s,nodeData:g,labelData:g}}update({seriesRect:t}){const e=this.checkResize(t),i=!this.ctx.animationManager.isSkipped(),{series:s}=this.ctx.highlightManager?.getActiveHighlight()??{};this.highlightGroup.visible=(i||this.visible)&&s===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=Selection14.select(this.itemGroup,()=>this.nodeFactory(),!1)),this.itemSelection.update(this.properties.marker.enabled?this.nodeData:[])}getMarkerFill(t){return t?.fill??this.properties.marker.fill}getDatumStylerProperties(t){const{id:e,properties:i}=this,{angleKey:s,radiusKey:n}=i;return{seriesId:e,datum:t,angleKey:s,radiusKey:n}}updateMarkers(t,e){const{visible:i}=this,{marker:s,stroke:n,strokeWidth:o,strokeOpacity:a,highlightStyle:r}=this.properties;let l=[];if(i&&s.shape&&s.enabled)if(e){const d=this.ctx.highlightManager?.getActiveHighlight();d?.datum&&(l=[d])}else l=this.nodeData;const c=mergeDefaults7(e&&r.item,s.getStyle(),{stroke:n,strokeWidth:o,strokeOpacity:a}),h=this.getShapeFillBBox();t.update(l).each((d,u)=>{this.updateMarkerStyle(s,d,u.datum,u.point,this.getDatumStylerProperties(u),e,c,h)})}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:s,axes:n,properties:o}=this,{angleKey:a,angleName:r,radiusKey:l,radiusName:c,tooltip:h,marker:d}=o,u=n[ChartAxisDirection27.X],p=n[ChartAxisDirection27.Y];if(!i||!s||!u||!p)return;const g=s.dataSources.get(this.id)?.[t],f=i.resolveColumnById(this,"angleValue",s)[t],m=i.resolveColumnById(this,"radiusValue",s)[t];if(f==null)return;const y=this.getMarkerStyle(d,g,this.getDatumStylerProperties(g),!1);return h.formatTooltip(this.properties,{heading:u.formatDatum(f),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:p.formatDatum(m)}]},{seriesId:e,datum:g,title:r,angleKey:a,radiusKey:l,angleName:r,radiusName:c,...y})}legendItemSymbol(){const{stroke:t,strokeWidth:e,strokeOpacity:i,lineDash:s,marker:n}=this.properties;return{marker:getShapeStyle16({shape:n.shape,enabled:n.enabled||e<=0,fill:this.getMarkerFill()??n.stroke??t??"rgba(0, 0, 0, 0)",stroke:n.stroke??t??"rgba(0, 0, 0, 0)",fillOpacity:n.fillOpacity,strokeOpacity:n.strokeOpacity,strokeWidth:n.strokeWidth,lineDash:n.lineDash,lineDashOffset:n.lineDashOffset},n.fillGradientDefaults,n.fillPatternDefaults),line:{stroke:t,strokeOpacity:i,strokeWidth:e,lineDash:s}}}getLegendData(t){if(!this.properties.isValid()||t!=="category")return[];const{id:e,ctx:{legendManager:i},visible:s}=this,{radiusKey:n,radiusName:o,showInLegend:a}=this.properties;return[{legendType:"category",id:e,itemId:n,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:o??n},symbol:this.legendItemSymbol(),hideInLegend:!a}]}pickNodeClosestDatum(t){const{nodeData:e,centerX:i,centerY:s}=this,{x:n,y:o}=t,a=this.radius;if(Math.sqrt((n-i)**2+(o-s)**2)>a+this.properties.marker.size)return;let l=1/0,c;for(const h of e){const{point:{x:d=NaN,y:u=NaN}={}}=h;if(isNaN(d)||isNaN(u))continue;const p=Math.sqrt((t.x-d-i)**2+(t.y-u-s)**2);p<l&&(l=p,c=h)}if(c){const h=Math.max(l-(c.point?.size??0),0);return{datum:c,distance:h}}}computeLabelsBBox(){const{label:t}=this.properties;this.maybeRefreshNodeData();const e=[],i=new Text8;return this.nodeData.forEach(s=>{if(!t.enabled||!s.label)return;i.text=s.label.text,i.x=s.label.x,i.y=s.label.y,i.setFont(t),i.setAlign(s.label);const n=i.getBBox();e.push(n)}),e.length===0?null:BBox23.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=PointerEvents11.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 s=this.axes[ChartAxisDirection27.Y],o=this.axes[ChartAxisDirection27.X]?.isReversed(),r=s?.isReversed()&&!o?[...t].reverse():t,l=[];let c=!1,h;return r.forEach((d,u)=>{let{x:p,y:g}=d.point;const f=isNaN(p)||isNaN(g);f||(h??(h=d)),f&&!i&&(p=0,g=0);const m=u===0||!e&&!i&&(f||c);l.push({x:p,y:g,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:s}=t;s.clear(!0);const n=this.getAxisInnerRadius(),o=this.axes[ChartAxisDirection27.Y],r=o?.isReversed()?this.radius+n-o?.scale.convert(0):n;e.forEach(l=>{const{x:c,y:h,arc:d,radius:u=0,startAngle:p=0,endAngle:g=0,moveTo:f}=l,m=Math.atan2(h,c),y=r*Math.cos(m),x=r*Math.sin(m),b=i,S=y*(1-b)+c*b,v=x*(1-b)+h*b;d?s.arc(c,h,u,p,g):f?s.moveTo(S,v):s.lineTo(S,v)}),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:s=>this.animatePaths(s),onStop:()=>this.animatePaths(1)}),markerFadeInAnimation3(this,i,"added",t),seriesLabelFadeInAnimation8(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:s,y:n,moveTo:o}of i)o?e.moveTo(s,n):e.lineTo(s,n);t.checkPathDirty()}}getFormattedMarkerStyle(t){const{angleKey:e,radiusKey:i}=this.properties;return this.getMarkerStyle(this.properties.marker,t.datum,{angleKey:e,radiusKey:i},!0)}computeFocusBounds(t){return computeMarkerFocusBounds4(this,t)}};RadarSeries.className="RadarSeries";var{FillGradientDefaults:FillGradientDefaults15,FillPatternDefaults:FillPatternDefaults15,RATIO:RATIO32,COLOR_STRING:COLOR_STRING29,TempValidate:TempValidate78,OR:OR20,COLOR_GRADIENT:COLOR_GRADIENT15,COLOR_PATTERN:COLOR_PATTERN15,OBJECT:OBJECT44}=module_support_exports,RadarAreaSeriesProperties=class extends RadarSeriesProperties{constructor(){super(...arguments),this.fill="black",this.fillGradientDefaults=new FillGradientDefaults15,this.fillPatternDefaults=new FillPatternDefaults15,this.fillOpacity=1}};__decorateClass([TempValidate78(OR20(COLOR_GRADIENT15,COLOR_PATTERN15,COLOR_STRING29))],RadarAreaSeriesProperties.prototype,"fill",2),__decorateClass([TempValidate78(OBJECT44)],RadarAreaSeriesProperties.prototype,"fillGradientDefaults",2),__decorateClass([TempValidate78(OBJECT44)],RadarAreaSeriesProperties.prototype,"fillPatternDefaults",2),__decorateClass([TempValidate78(RATIO32)],RadarAreaSeriesProperties.prototype,"fillOpacity",2);var{Group:Group20,Path:Path13,PointerEvents:PointerEvents12,Selection:Selection15,ChartAxisDirection:ChartAxisDirection28,applyShapeStyle:applyShapeStyle11,getShapeFill:getShapeFill5,getShapeStyle:getShapeStyle17}=module_support_exports,RadarAreaSeries=class extends RadarSeries{constructor(t){super(t),this.properties=new RadarAreaSeriesProperties,this.areaGroup=this.contentGroup.appendChild(new Group20({name:"radar-area"})),this.areaSelection=Selection15.select(this.areaGroup,Path13),this.resetInvalidToZero=!0,this.areaGroup.zIndex=-1}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(),{fillOpacity:e,fill:i}=this.properties,s=getShapeStyle17({fill:i,fillOpacity:e},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults);applyShapeStyle11(t,s,void 0,this.getShapeFillBBox()),t.pointerEvents=PointerEvents12.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 module_support_exports.PolarAxis?r:void 0},i=e(ChartAxisDirection28.Y),s=e(ChartAxisDirection28.X);if(!i?.isReversed())return t;const o=s?.getAxisLinePoints()?.points??[];return t.concat(...o)}resetPaths(){super.resetPaths();const t=this.getAreaNode();if(t){const{path:e}=t,i=this.getAreaPoints();t.fill=getShapeFill5(this.properties.fill,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults),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:s,y:n,moveTo:o,arc:a,radius:r=0,startAngle:l=0,endAngle:c=0})=>{a?e.arc(s,n,r,l,c):o?e.moveTo(s,n):e.lineTo(s,n)}),e.closePath(),t.checkPathDirty()}}};RadarAreaSeries.className="RadarAreaSeries",RadarAreaSeries.type="radar-area";var{commonSeriesOptionsDefs:commonSeriesOptionsDefs19,seriesLabelOptionsDefs:seriesLabelOptionsDefs13,markerOptionsDefs:markerOptionsDefs4,tooltipOptionsDefs:tooltipOptionsDefs18}=module_support_exports,radarAreaSeriesOptionsDef={type:required(constant("radar-area")),angleKey:required(string),radiusKey:required(string),angleName:string,radiusName:string,connectMissingData:boolean,marker:markerOptionsDefs4,label:seriesLabelOptionsDefs13,tooltip:tooltipOptionsDefs18,...commonSeriesOptionsDefs19,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},{ThemeConstants:{POLAR_AXIS_TYPE:POLAR_AXIS_TYPE5}}=module_support_exports,RadarAreaModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radar-area",moduleFactory:t=>new RadarAreaSeries(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:POLAR_AXIS_TYPE5.ANGLE_CATEGORY},{type:POLAR_AXIS_TYPE5.RADIUS_NUMBER}],themeTemplate:RADAR_AREA_SERIES_THEME},RadarAreaSeriesModule={type:"series",name:"radar-area",chartType:"polar",enterprise:!0,options:radarAreaSeriesOptionsDef,create:t=>new RadarAreaSeries(t)},RadarLineSeries=class extends RadarSeries{updatePathSelections(){this.lineSelection.update(this.visible?[!0]:[])}};RadarLineSeries.className="RadarLineSeries",RadarLineSeries.type="radar-line";var{commonSeriesOptionsDefs:commonSeriesOptionsDefs20,seriesLabelOptionsDefs:seriesLabelOptionsDefs14,markerOptionsDefs:markerOptionsDefs5,tooltipOptionsDefs:tooltipOptionsDefs19}=module_support_exports,radarLineSeriesOptionsDef={type:required(constant("radar-line")),angleKey:required(string),radiusKey:required(string),angleName:string,radiusName:string,connectMissingData:boolean,marker:markerOptionsDefs5,label:seriesLabelOptionsDefs14,tooltip:tooltipOptionsDefs19,...commonSeriesOptionsDefs20,...strokeOptionsDef,...lineDashOptionsDef},{POLAR_AXIS_TYPE:POLAR_AXIS_TYPE6}=module_support_exports.ThemeConstants,RadarLineModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radar-line",moduleFactory:t=>new RadarLineSeries(t),tooltipDefaults:{range:"nearest"},defaultAxes:[{type:POLAR_AXIS_TYPE6.ANGLE_CATEGORY},{type:POLAR_AXIS_TYPE6.RADIUS_NUMBER}],themeTemplate:RADAR_LINE_SERIES_THEME},RadarLineSeriesModule={type:"series",name:"radar-line",chartType:"polar",enterprise:!0,options:radarLineSeriesOptionsDef,create:t=>new RadarLineSeries(t)},{SeriesProperties:SeriesProperties12,FillGradientDefaults:FillGradientDefaults16,FillPatternDefaults:FillPatternDefaults16,SeriesTooltip:SeriesTooltip21,TempValidate:TempValidate79,COLOR_STRING:COLOR_STRING30,NUMBER:NUMBER22,FUNCTION:FUNCTION21,LINE_DASH:LINE_DASH24,OBJECT:OBJECT45,POSITIVE_NUMBER:POSITIVE_NUMBER36,RATIO:RATIO33,STRING:STRING41,Label:Label16,COLOR_GRADIENT:COLOR_GRADIENT16,COLOR_PATTERN:COLOR_PATTERN16,OR:OR21}=module_support_exports,RadialBarSeriesProperties=class extends SeriesProperties12{constructor(){super(...arguments),this.fill="black",this.fillGradientDefaults=new FillGradientDefaults16,this.fillPatternDefaults=new FillPatternDefaults16,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 Label16,this.tooltip=new SeriesTooltip21}};__decorateClass([TempValidate79(STRING41)],RadialBarSeriesProperties.prototype,"angleKey",2),__decorateClass([TempValidate79(STRING41)],RadialBarSeriesProperties.prototype,"radiusKey",2),__decorateClass([TempValidate79(STRING41,{optional:!0})],RadialBarSeriesProperties.prototype,"angleName",2),__decorateClass([TempValidate79(STRING41,{optional:!0})],RadialBarSeriesProperties.prototype,"radiusName",2),__decorateClass([TempValidate79(OR21(COLOR_GRADIENT16,COLOR_PATTERN16,COLOR_STRING30))],RadialBarSeriesProperties.prototype,"fill",2),__decorateClass([TempValidate79(OBJECT45)],RadialBarSeriesProperties.prototype,"fillGradientDefaults",2),__decorateClass([TempValidate79(OBJECT45)],RadialBarSeriesProperties.prototype,"fillPatternDefaults",2),__decorateClass([TempValidate79(RATIO33)],RadialBarSeriesProperties.prototype,"fillOpacity",2),__decorateClass([TempValidate79(COLOR_STRING30)],RadialBarSeriesProperties.prototype,"stroke",2),__decorateClass([TempValidate79(POSITIVE_NUMBER36)],RadialBarSeriesProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate79(RATIO33)],RadialBarSeriesProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate79(LINE_DASH24)],RadialBarSeriesProperties.prototype,"lineDash",2),__decorateClass([TempValidate79(POSITIVE_NUMBER36)],RadialBarSeriesProperties.prototype,"lineDashOffset",2),__decorateClass([TempValidate79(POSITIVE_NUMBER36)],RadialBarSeriesProperties.prototype,"cornerRadius",2),__decorateClass([TempValidate79(FUNCTION21,{optional:!0})],RadialBarSeriesProperties.prototype,"itemStyler",2),__decorateClass([TempValidate79(NUMBER22)],RadialBarSeriesProperties.prototype,"rotation",2),__decorateClass([TempValidate79(STRING41,{optional:!0})],RadialBarSeriesProperties.prototype,"stackGroup",2),__decorateClass([TempValidate79(NUMBER22,{optional:!0})],RadialBarSeriesProperties.prototype,"normalizedTo",2),__decorateClass([TempValidate79(OBJECT45)],RadialBarSeriesProperties.prototype,"label",2),__decorateClass([TempValidate79(OBJECT45)],RadialBarSeriesProperties.prototype,"tooltip",2);var{SectorBox:SectorBox4,motion:motion10}=module_support_exports;function fixRadialBarAnimationStatus(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 prepareRadialBarSeriesAnimationFunctions(t){return{toFn:(s,n,o)=>{let a,r,l,c,h;return o==="removed"?(a=t,r=t,l=n.innerRadius,c=n.outerRadius,h=new SectorBox4(a,r,l,c)):(a=n.startAngle,r=n.endAngle,l=isNaN(n.innerRadius)?s.innerRadius:n.innerRadius,c=isNaN(n.outerRadius)?s.outerRadius:n.outerRadius,h=n.clipSector),{startAngle:a,endAngle:r,innerRadius:l,outerRadius:c,clipSector:h}},fromFn:(s,n,o)=>{o=fixRadialBarAnimationStatus(s,n,o);let a,r,l,c,h;o==="removed"||o==="updated"?(a=s.startAngle,r=s.endAngle,l=s.innerRadius,c=s.outerRadius,h=s.clipSector):(a=t,r=t,l=n.innerRadius,c=n.outerRadius),h??(h=new SectorBox4(a,r,l,c));const d=motion10.NODE_UPDATE_STATE_TO_PHASE_MAPPING[o];return{startAngle:a,endAngle:r,innerRadius:l,outerRadius:c,clipSector:h,phase:d}}}}function resetRadialBarSelectionsFn(t,e){return{centerX:0,centerY:0,innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle,clipSector:e.clipSector}}var{ChartAxisDirection:ChartAxisDirection29,PolarAxis:PolarAxis4,diff:diff8,groupAccumulativeValueProperty:groupAccumulativeValueProperty4,keyProperty:keyProperty11,normaliseGroupTo:normaliseGroupTo3,valueProperty:valueProperty19,fixNumericExtent:fixNumericExtent11,resetLabelFn:resetLabelFn7,seriesLabelFadeInAnimation:seriesLabelFadeInAnimation9,seriesLabelFadeOutAnimation:seriesLabelFadeOutAnimation3,animationValidation:animationValidation10,angleBetween:angleBetween4,createDatumId:createDatumId21,CategoryScale:CategoryScale5,Sector:Sector6,SectorBox:SectorBox5,motion:motion11,isGradientFill:isGradientFill6,applyShapeStyle:applyShapeStyle12,getShapeStyle:getShapeStyle18}=module_support_exports,RadialBarSeriesNodeEvent=class extends module_support_exports.SeriesNodeEvent{constructor(t,e,i,s){super(t,e,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},RadialBarSeries=class extends module_support_exports.PolarSeries{constructor(t){super({moduleCtx:t,categoryKey:"radiusValue",useLabelLayer:!0,canHaveAxes:!0,animationResetFns:{item:resetRadialBarSelectionsFn,label:resetLabelFn7}}),this.properties=new RadialBarSeriesProperties,this.NodeEvent=RadialBarSeriesNodeEvent,this.groupScale=new CategoryScale5,this.circleCache={r:0,cx:0,cy:0}}get defaultShapeStyle(){const t=this.axes[ChartAxisDirection29.X]?.scale;return{...this.properties.fillGradientDefaults.toJson(),rotation:module_support_exports.toDegrees(t.range[0])+90}}nodeFactory(){return new Sector6}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];if(t===ChartAxisDirection29.X){const s=e.getDomain(this,"angleValue-end","value",i),n=[s[0]>0?0:s[0],s[1]<0?0:s[1]];return fixNumericExtent11(n)}else return e.getDomain(this,"radiusValue","key",i)}async processData(t){const{angleKey:e,radiusKey:i,normalizedTo:s}=this.properties,n=!this.ctx.animationManager.isSkipped();if(!this.properties.isValid())return;const o=this.getStackId(),a=`${o}-trailing`,r=[];isDefined(s)&&r.push(normaliseGroupTo3([o,a],Math.abs(s))),n&&(this.processedData&&r.push(diff8(this.id,this.processedData)),r.push(animationValidation10()));const l=this.visible?{}:{forceValue:0},c=this.axes[ChartAxisDirection29.Y]?.scale.type,h=this.axes[ChartAxisDirection29.X]?.scale.type;await this.requestDataModel(t,this.data,{props:[keyProperty11(i,c,{id:"radiusValue"}),valueProperty19(e,h,{id:"angleValue-raw",invalidValue:null,...l}),...groupAccumulativeValueProperty4(e,"normal","current",{id:"angleValue-end",rangeId:"angleValue-range",invalidValue:null,groupId:o,separateNegative:!0,...l},h),...groupAccumulativeValueProperty4(e,"trailing","current",{id:"angleValue-start",invalidValue:null,groupId:a,separateNegative:!0,...l},h),...r],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const t=this.radius,e=this.centerX,i=this.centerY,s=this.circleCache;return t===s.r&&e===s.cx&&i===s.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[ChartAxisDirection29.Y];return t instanceof PolarAxis4?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[ChartAxisDirection29.X],s=this.axes[ChartAxisDirection29.Y],n=i?.scale,o=s?.scale;if(!n||!o)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 d=0;s instanceof RadiusCategoryAxis&&(d=s.groupPaddingInner);const{groupScale:u}=this,{index:p,visibleGroupCount:g}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);u.domain=Array.from({length:g}).map((R,E)=>String(E)),u.range=[0,Math.abs(o.bandwidth??0)],u.paddingInner=g>1?d:0;const f=u.bandwidth>=1?u.bandwidth:u.rawBandwidth,m=i.isReversed(),y=s.isReversed(),x=y?this.radius:this.getAxisInnerRadius(),S=(y?this.getAxisInnerRadius():this.radius)+x,{angleKey:v,radiusKey:I,angleName:A,radiusName:D,label:T}=this.properties,k=(R,E,_,G)=>{const B=this.getLabelText(T,{value:E,datum:R,angleKey:v,radiusKey:I,angleName:A,radiusName:D});if(B)return{x:_,y:G,text:B,textAlign:"center",textBaseline:"middle"}},w=[],L={itemId:I,nodeData:w,labelData:w};if(!this.visible)return L;const{dataSources:O}=t,F=O.get(this.id)??[];for(const{datumIndex:R,group:E}of e.forEachGroupDatum(this,t)){const _=F[R],G=a[R];if(G==null)return;const B=c[R],z=r[R],P=l[R],V=B>=0&&!Object.is(B,-0),j=E.aggregation[h][V?1:0],H=V===m;let Y=n.convert(z,!0),U=n.convert(P,!0),$=n.convert(0,!0),W=n.convert(j,!0);H&&([$,W]=[W,$],[Y,U]=[U,Y]);const Z=S-o.convert(G)+u.convert(String(p)),q=Z+f,Q=(Z+q)/2,tt=Y+angleBetween4(Y,U)/2,it=Math.cos(tt)*Q,J=Math.sin(tt)*Q,at=this.properties.label.enabled?k(_,B,it,J):void 0,lt=new SectorBox5(Y,U,Z,q);w.push({series:this,datum:_,datumIndex:R,point:{x:it,y:J,size:0},midPoint:{x:it,y:J},label:at,angleValue:B,radiusValue:G,innerRadius:Z,outerRadius:q,startAngle:$,endAngle:W,clipSector:lt,reversed:H,index:R})}return L}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 getShapeStyle18({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},this.defaultShapeStyle,e.fillPatternDefaults)}getItemStyleOverrides(t,e,i,s){const{id:n,properties:o}=this,{angleKey:a,radiusKey:r,itemStyler:l}=o;let c;return l!=null&&(c=this.cachedDatumCallback(createDatumId21(t,s?"highlight":"node"),()=>this.callWithContext(l,{seriesId:n,datum:e,highlighted:s,angleKey:a,radiusKey:r,...i}))),getShapeStyle18(c,this.defaultShapeStyle,this.properties.fillPatternDefaults)}updateSectorSelection(t,e){let i=[];if(e){const o=this.ctx.highlightManager?.getActiveHighlight();o?.datum&&o.series===this&&i.push(o)}else i=this.nodeData;const s=this.getItemBaseStyle(e),n=this.getShapeFillBBox();t.update(i,void 0,o=>this.getDatumId(o)).each((o,a)=>{const{datum:r,datumIndex:l}=a,c=this.getItemStyleOverrides(String(l),r,s,e),h=c?.cornerRadius??s.cornerRadius,d=c?.fill??s.fill,u=module_support_exports.isGradientFill(d)&&d.bounds!=="item"?{centerX:0,centerY:0}:void 0;applyShapeStyle12(o,s,c,n,u),o.lineJoin="round",o.inset=o.stroke!=null?o.strokeWidth/2:0,o.startInnerCornerRadius=r.reversed?h:0,o.startOuterCornerRadius=r.reversed?h:0,o.endInnerCornerRadius=r.reversed?0:h,o.endOuterCornerRadius=r.reversed?0:h,e&&(o.startAngle=a.startAngle,o.endAngle=a.endAngle,o.clipSector=a.clipSector,o.innerRadius=a.innerRadius,o.outerRadius=a.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[ChartAxisDirection29.X]?.scale;let e=0;if(!t)return prepareRadialBarSeriesAnimationFunctions(e);const i=Math.min(t.domain[0],t.domain[1]),s=Math.max(t.domain[0],t.domain[1]);return i<=0&&s>=0&&(e=t.convert(0)),prepareRadialBarSeriesAnimationFunctions(e)}animateEmptyUpdateReady(){const{labelSelection:t}=this,e=this.getBarTransitionFunctions();motion11.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],e),seriesLabelFadeInAnimation9(this,"labels",this.ctx.animationManager,t)}animateClearingUpdateEmpty(){const{itemSelection:t}=this,{animationManager:e}=this.ctx,i=this.getBarTransitionFunctions();motion11.fromToMotion(this.id,"datums",e,[t],i),seriesLabelFadeOutAnimation3(this,"labels",e,this.labelSelection)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:o}=this,{angleKey:a,angleName:r,radiusKey:l,radiusName:c,tooltip:h}=o,d=n[ChartAxisDirection29.X],u=n[ChartAxisDirection29.Y];if(!i||!s||!d||!u)return;const p=s.dataSources.get(this.id)?.[t],g=i.resolveKeysById(this,"radiusValue",s)[t],f=i.resolveColumnById(this,"angleValue-raw",s)[t];if(g==null)return;const m=this.getItemBaseStyle(!1);return Object.assign(m,this.getItemStyleOverrides(String(t),t,m,!1)),h.formatTooltip(this.properties,{heading:u.formatDatum(g),symbol:this.legendItemSymbol(),data:[{label:r,fallbackLabel:a,value:d.formatDatum(f)}]},{seriesId:e,datum:p,title:r,angleKey:a,angleName:r,radiusKey:l,radiusName:c,...m})}pickNodeClosestDatum(t){return this.pickNodeNearestDistantObject(t,this.itemSelection.nodes())}legendItemSymbol(){const{fill:t,stroke:e,fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:o,lineDashOffset:a,fillPatternDefaults:r}=this.properties,l=getShapeStyle18({fill:t??"rgba(0, 0, 0, 0)",stroke:e??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:o,lineDashOffset:a},this.defaultShapeStyle,r);return isGradientFill6(l.fill)&&(l.fill={...l.fill,gradient:"linear",rotation:0,reverse:!1}),{marker:l}}getLegendData(t){if(!this.properties.isValid()||t!=="category")return[];const{id:e,visible:i}=this,{angleKey:s,angleName:n,showInLegend:o}=this.properties;return[{legendType:"category",id:e,itemId:s,seriesId:e,enabled:i,label:{text:n??s},symbol:this.legendItemSymbol(),hideInLegend:!o}]}getDatumId(t){return createDatumId21(t.radiusValue)}computeLabelsBBox(){return null}getStackId(){return`radialBar-stack-${this.seriesGrouping?.groupIndex??this.id}-xValues`}};RadialBarSeries.className="RadialBarSeries",RadialBarSeries.type="radial-bar";var{commonSeriesOptionsDefs:commonSeriesOptionsDefs21,seriesLabelOptionsDefs:seriesLabelOptionsDefs15,tooltipOptionsDefs:tooltipOptionsDefs20}=module_support_exports,radialBarSeriesOptionsDef={type:required(constant("radial-bar")),angleKey:required(string),radiusKey:required(string),angleName:string,radiusName:string,grouped:boolean,stacked:boolean,stackGroup:string,normalizedTo:number,cornerRadius:positiveNumber,itemStyler:callback,label:seriesLabelOptionsDefs15,tooltip:tooltipOptionsDefs20,...commonSeriesOptionsDefs21,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},{ThemeConstants:{POLAR_AXIS_TYPE:POLAR_AXIS_TYPE7}}=module_support_exports,RADIAL_BAR_SERIES_THEME={series:{fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"conic",bounds:"series",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:module_support_exports.FILL_PATTERN_DEFAULTS,strokeWidth:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}}},axes:{[POLAR_AXIS_TYPE7.RADIUS_CATEGORY]:{innerRadiusRatio:.2,groupPaddingInner:.2,paddingInner:.2,paddingOuter:.1}}},{POLAR_AXIS_TYPE:POLAR_AXIS_TYPE8}=module_support_exports.ThemeConstants,RadialBarModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radial-bar",moduleFactory:t=>new RadialBarSeries(t),tooltipDefaults:{range:"exact"},defaultAxes:[{type:POLAR_AXIS_TYPE8.ANGLE_NUMBER},{type:POLAR_AXIS_TYPE8.RADIUS_CATEGORY}],themeTemplate:RADIAL_BAR_SERIES_THEME,stackable:!0,groupable:!0},RadialBarSeriesModule={type:"series",name:"radial-bar",chartType:"polar",enterprise:!0,options:radialBarSeriesOptionsDef,create:t=>new RadialBarSeries(t)},{TempValidate:TempValidate80,RATIO:RATIO34}=module_support_exports,RadialColumnSeriesProperties=class extends RadialColumnSeriesBaseProperties{};__decorateClass([TempValidate80(RATIO34,{optional:!0})],RadialColumnSeriesProperties.prototype,"columnWidthRatio",2),__decorateClass([TempValidate80(RATIO34,{optional:!0})],RadialColumnSeriesProperties.prototype,"maxColumnWidthRatio",2);var{ChartAxisDirection:ChartAxisDirection30,PolarAxis:PolarAxis5,RadialColumnShape:RadialColumnShape2,getRadialColumnWidth:getRadialColumnWidth2}=module_support_exports,RadialColumnSeries=class extends RadialColumnSeriesBase{constructor(t){super(t,{animationResetFns:{item:resetRadialColumnSelectionFn}}),this.properties=new RadialColumnSeriesProperties}getStackId(){return`radarColumn-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new RadialColumnShape2}getColumnTransitionFunctions(){const t=this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius();return prepareRadialColumnAnimationFunctions(t)}isRadiusAxisCircle(){const t=this.axes[ChartAxisDirection30.Y];return t instanceof PolarAxis5?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:s=.5}=this.properties;return getRadialColumnWidth2(t,e,this.radius,i,s)}};RadialColumnSeries.className="RadialColumnSeries",RadialColumnSeries.type="radial-column";var{commonSeriesOptionsDefs:commonSeriesOptionsDefs22,seriesLabelOptionsDefs:seriesLabelOptionsDefs16,tooltipOptionsDefs:tooltipOptionsDefs21}=module_support_exports,radialColumnSeriesOptionsDef={type:required(constant("radial-column")),angleKey:required(string),radiusKey:required(string),angleName:string,radiusName:string,grouped:boolean,stacked:boolean,stackGroup:string,normalizedTo:number,cornerRadius:positiveNumber,columnWidthRatio:ratio,maxColumnWidthRatio:ratio,itemStyler:callback,label:seriesLabelOptionsDefs16,tooltip:tooltipOptionsDefs21,...commonSeriesOptionsDefs22,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},{ThemeConstants:{POLAR_AXIS_TYPE:POLAR_AXIS_TYPE9,POLAR_AXIS_SHAPE:POLAR_AXIS_SHAPE3}}=module_support_exports,axisShape2={$path:["./shape",POLAR_AXIS_SHAPE3.CIRCLE,{$find:[{$not:[{$isOperation:"./shape"}]},{$path:".."}]}]},RADIAL_COLUMN_SERIES_THEME={series:{fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"series",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:module_support_exports.FILL_PATTERN_DEFAULTS,columnWidthRatio:.5,maxColumnWidthRatio:.5,strokeWidth:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}},axes:{[POLAR_AXIS_TYPE9.ANGLE_CATEGORY]:{shape:axisShape2,groupPaddingInner:0,paddingInner:0,label:{spacing:10}},[POLAR_AXIS_TYPE9.RADIUS_NUMBER]:{shape:axisShape2,innerRadiusRatio:.5}}},{POLAR_AXIS_TYPE:POLAR_AXIS_TYPE10}=module_support_exports.ThemeConstants,RadialColumnModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radial-column",moduleFactory:t=>new RadialColumnSeries(t),tooltipDefaults:{range:"exact"},defaultAxes:[{type:POLAR_AXIS_TYPE10.ANGLE_CATEGORY},{type:POLAR_AXIS_TYPE10.RADIUS_NUMBER}],themeTemplate:RADIAL_COLUMN_SERIES_THEME,stackable:!0,groupable:!0},RadialColumnSeriesModule={type:"series",name:"radial-column",chartType:"polar",enterprise:!0,options:radialColumnSeriesOptionsDef,create:t=>new RadialColumnSeries(t)},{SvgPath:SvgPath2,Rotatable:Rotatable2,Translatable:Translatable2,Scalable:Scalable2}=module_support_exports,RadialGaugeNeedle=class extends Rotatable2(Scalable2(Translatable2(SvgPath2))){constructor(){super(...arguments),this.scalingCenterX=.5,this.scalingCenterY=.5,this.rotationCenterX=.5,this.rotationCenterY=.5}};RadialGaugeNeedle.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";var{BaseProperties:BaseProperties28,SeriesTooltip:SeriesTooltip22,SeriesProperties:SeriesProperties13,PropertiesArray:PropertiesArray9,AxisLabel:AxisLabel6,TempValidate:TempValidate81,BOOLEAN:BOOLEAN36,COLOR_STRING:COLOR_STRING31,COLOR_STRING_ARRAY:COLOR_STRING_ARRAY13,FUNCTION:FUNCTION22,LINE_DASH:LINE_DASH25,NUMBER:NUMBER23,NUMBER_ARRAY:NUMBER_ARRAY6,OBJECT_ARRAY:OBJECT_ARRAY4,OBJECT:OBJECT46,POSITIVE_NUMBER:POSITIVE_NUMBER37,RATIO:RATIO35,STRING:STRING42,UNION:UNION18,AND:AND11,LESS_THAN:LESS_THAN5,GREATER_THAN:GREATER_THAN5,Label:Label17}=module_support_exports,TARGET_PLACEMENT2=UNION18(["inside","outside","middle"],"a placement"),RadialGaugeDefaultTargetLabelProperties=class extends Label17{};__decorateClass([TempValidate81(NUMBER23,{optional:!0})],RadialGaugeDefaultTargetLabelProperties.prototype,"spacing",2);var RadialGaugeTargetProperties=class extends BaseProperties28{constructor(){super(...arguments),this.label=new RadialGaugeDefaultTargetLabelProperties}};__decorateClass([TempValidate81(STRING42,{optional:!0})],RadialGaugeTargetProperties.prototype,"text",2),__decorateClass([TempValidate81(NUMBER23,{optional:!0})],RadialGaugeTargetProperties.prototype,"value",2),__decorateClass([TempValidate81(TARGET_MARKER_SHAPE,{optional:!0})],RadialGaugeTargetProperties.prototype,"shape",2),__decorateClass([TempValidate81(TARGET_PLACEMENT2,{optional:!0})],RadialGaugeTargetProperties.prototype,"placement",2),__decorateClass([TempValidate81(NUMBER23,{optional:!0})],RadialGaugeTargetProperties.prototype,"spacing",2),__decorateClass([TempValidate81(POSITIVE_NUMBER37,{optional:!0})],RadialGaugeTargetProperties.prototype,"size",2),__decorateClass([TempValidate81(NUMBER23,{optional:!0})],RadialGaugeTargetProperties.prototype,"rotation",2),__decorateClass([TempValidate81(COLOR_STRING31,{optional:!0})],RadialGaugeTargetProperties.prototype,"fill",2),__decorateClass([TempValidate81(RATIO35,{optional:!0})],RadialGaugeTargetProperties.prototype,"fillOpacity",2),__decorateClass([TempValidate81(COLOR_STRING31,{optional:!0})],RadialGaugeTargetProperties.prototype,"stroke",2),__decorateClass([TempValidate81(POSITIVE_NUMBER37,{optional:!0})],RadialGaugeTargetProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate81(RATIO35,{optional:!0})],RadialGaugeTargetProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate81(LINE_DASH25,{optional:!0})],RadialGaugeTargetProperties.prototype,"lineDash",2),__decorateClass([TempValidate81(POSITIVE_NUMBER37,{optional:!0})],RadialGaugeTargetProperties.prototype,"lineDashOffset",2),__decorateClass([TempValidate81(OBJECT46)],RadialGaugeTargetProperties.prototype,"label",2);var RadialGaugeBarProperties=class extends BaseProperties28{constructor(){super(...arguments),this.enabled=!0,this.fills=new PropertiesArray9(module_support_exports.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};__decorateClass([TempValidate81(BOOLEAN36)],RadialGaugeBarProperties.prototype,"enabled",2),__decorateClass([TempValidate81(OBJECT_ARRAY4)],RadialGaugeBarProperties.prototype,"fills",2),__decorateClass([TempValidate81(FILL_MODE)],RadialGaugeBarProperties.prototype,"fillMode",2),__decorateClass([TempValidate81(COLOR_STRING31,{optional:!0})],RadialGaugeBarProperties.prototype,"fill",2),__decorateClass([TempValidate81(RATIO35)],RadialGaugeBarProperties.prototype,"fillOpacity",2),__decorateClass([TempValidate81(COLOR_STRING31,{optional:!0})],RadialGaugeBarProperties.prototype,"stroke",2),__decorateClass([TempValidate81(POSITIVE_NUMBER37,{optional:!0})],RadialGaugeBarProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate81(RATIO35)],RadialGaugeBarProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate81(LINE_DASH25)],RadialGaugeBarProperties.prototype,"lineDash",2),__decorateClass([TempValidate81(POSITIVE_NUMBER37)],RadialGaugeBarProperties.prototype,"lineDashOffset",2);var RadialGaugeScaleIntervalProperties=class extends BaseProperties28{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};__decorateClass([TempValidate81(NUMBER_ARRAY6,{optional:!0})],RadialGaugeScaleIntervalProperties.prototype,"values",2),__decorateClass([TempValidate81(NUMBER23,{optional:!0})],RadialGaugeScaleIntervalProperties.prototype,"step",2),__decorateClass([TempValidate81(NUMBER23)],RadialGaugeScaleIntervalProperties.prototype,"minSpacing",2),__decorateClass([TempValidate81(NUMBER23)],RadialGaugeScaleIntervalProperties.prototype,"maxSpacing",2);var RadialGaugeScaleLabelProperties=class extends AxisLabel6{},RadialGaugeScaleProperties=class extends BaseProperties28{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new PropertiesArray9(module_support_exports.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",this.interval=new RadialGaugeScaleIntervalProperties,this.label=new RadialGaugeScaleLabelProperties}};__decorateClass([TempValidate81(AND11(NUMBER23,LESS_THAN5("max")))],RadialGaugeScaleProperties.prototype,"min",2),__decorateClass([TempValidate81(AND11(NUMBER23,GREATER_THAN5("min")))],RadialGaugeScaleProperties.prototype,"max",2),__decorateClass([TempValidate81(OBJECT_ARRAY4)],RadialGaugeScaleProperties.prototype,"fills",2),__decorateClass([TempValidate81(FILL_MODE)],RadialGaugeScaleProperties.prototype,"fillMode",2),__decorateClass([TempValidate81(COLOR_STRING31,{optional:!0})],RadialGaugeScaleProperties.prototype,"fill",2),__decorateClass([TempValidate81(RATIO35)],RadialGaugeScaleProperties.prototype,"fillOpacity",2),__decorateClass([TempValidate81(COLOR_STRING31)],RadialGaugeScaleProperties.prototype,"stroke",2),__decorateClass([TempValidate81(POSITIVE_NUMBER37)],RadialGaugeScaleProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate81(RATIO35)],RadialGaugeScaleProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate81(LINE_DASH25)],RadialGaugeScaleProperties.prototype,"lineDash",2),__decorateClass([TempValidate81(POSITIVE_NUMBER37)],RadialGaugeScaleProperties.prototype,"lineDashOffset",2),__decorateClass([TempValidate81(COLOR_STRING31)],RadialGaugeScaleProperties.prototype,"defaultFill",2),__decorateClass([TempValidate81(OBJECT46)],RadialGaugeScaleProperties.prototype,"interval",2),__decorateClass([TempValidate81(OBJECT46)],RadialGaugeScaleProperties.prototype,"label",2);var RadialGaugeNeedleProperties=class extends BaseProperties28{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}};__decorateClass([TempValidate81(BOOLEAN36)],RadialGaugeNeedleProperties.prototype,"enabled",2),__decorateClass([TempValidate81(RATIO35,{optional:!0})],RadialGaugeNeedleProperties.prototype,"radiusRatio",2),__decorateClass([TempValidate81(NUMBER23)],RadialGaugeNeedleProperties.prototype,"spacing",2),__decorateClass([TempValidate81(COLOR_STRING31)],RadialGaugeNeedleProperties.prototype,"fill",2),__decorateClass([TempValidate81(RATIO35)],RadialGaugeNeedleProperties.prototype,"fillOpacity",2),__decorateClass([TempValidate81(COLOR_STRING31)],RadialGaugeNeedleProperties.prototype,"stroke",2),__decorateClass([TempValidate81(POSITIVE_NUMBER37)],RadialGaugeNeedleProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate81(RATIO35)],RadialGaugeNeedleProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate81(LINE_DASH25)],RadialGaugeNeedleProperties.prototype,"lineDash",2),__decorateClass([TempValidate81(POSITIVE_NUMBER37)],RadialGaugeNeedleProperties.prototype,"lineDashOffset",2);var RadialGaugeLabelProperties=class extends AutoSizedLabel{};__decorateClass([TempValidate81(STRING42,{optional:!0})],RadialGaugeLabelProperties.prototype,"text",2);var RadialGaugeSecondaryLabelProperties=class extends AutoSizedSecondaryLabel{};__decorateClass([TempValidate81(STRING42,{optional:!0})],RadialGaugeSecondaryLabelProperties.prototype,"text",2);var RadialGaugeSeriesProperties=class extends SeriesProperties13{constructor(){super(...arguments),this.startAngle=0,this.endAngle=0,this.segmentation=new GaugeSegmentationProperties,this.defaultColorRange=[],this.targets=new PropertiesArray9(RadialGaugeTargetProperties),this.defaultTarget=new RadialGaugeTargetProperties,this.outerRadiusRatio=1,this.innerRadiusRatio=1,this.cornerRadius=0,this.cornerMode="container",this.spacing=0,this.scale=new RadialGaugeScaleProperties,this.bar=new RadialGaugeBarProperties,this.needle=new RadialGaugeNeedleProperties,this.label=new RadialGaugeLabelProperties,this.secondaryLabel=new RadialGaugeSecondaryLabelProperties,this.tooltip=new SeriesTooltip22}isValid(t){if(!super.isValid(t))return!1;const{outerRadius:e,innerRadius:i}=this;return e==null!=(i==null)?(logger_exports.warnOnce("Either [innerRadius] and [outerRadius] must both be set, or neither can be set."),!1):!0}};__decorateClass([TempValidate81(NUMBER23)],RadialGaugeSeriesProperties.prototype,"value",2),__decorateClass([TempValidate81(NUMBER23)],RadialGaugeSeriesProperties.prototype,"startAngle",2),__decorateClass([TempValidate81(NUMBER23)],RadialGaugeSeriesProperties.prototype,"endAngle",2),__decorateClass([TempValidate81(OBJECT46)],RadialGaugeSeriesProperties.prototype,"segmentation",2),__decorateClass([TempValidate81(COLOR_STRING_ARRAY13)],RadialGaugeSeriesProperties.prototype,"defaultColorRange",2),__decorateClass([TempValidate81(OBJECT_ARRAY4)],RadialGaugeSeriesProperties.prototype,"targets",2),__decorateClass([TempValidate81(OBJECT46)],RadialGaugeSeriesProperties.prototype,"defaultTarget",2),__decorateClass([TempValidate81(RATIO35)],RadialGaugeSeriesProperties.prototype,"outerRadiusRatio",2),__decorateClass([TempValidate81(RATIO35)],RadialGaugeSeriesProperties.prototype,"innerRadiusRatio",2),__decorateClass([TempValidate81(POSITIVE_NUMBER37,{optional:!0})],RadialGaugeSeriesProperties.prototype,"outerRadius",2),__decorateClass([TempValidate81(POSITIVE_NUMBER37,{optional:!0})],RadialGaugeSeriesProperties.prototype,"innerRadius",2),__decorateClass([TempValidate81(POSITIVE_NUMBER37)],RadialGaugeSeriesProperties.prototype,"cornerRadius",2),__decorateClass([TempValidate81(CORNER_MODE)],RadialGaugeSeriesProperties.prototype,"cornerMode",2),__decorateClass([TempValidate81(NUMBER23)],RadialGaugeSeriesProperties.prototype,"spacing",2),__decorateClass([TempValidate81(OBJECT46)],RadialGaugeSeriesProperties.prototype,"scale",2),__decorateClass([TempValidate81(OBJECT46)],RadialGaugeSeriesProperties.prototype,"bar",2),__decorateClass([TempValidate81(OBJECT46)],RadialGaugeSeriesProperties.prototype,"needle",2),__decorateClass([TempValidate81(FUNCTION22,{optional:!0})],RadialGaugeSeriesProperties.prototype,"itemStyler",2),__decorateClass([TempValidate81(OBJECT46)],RadialGaugeSeriesProperties.prototype,"label",2),__decorateClass([TempValidate81(OBJECT46)],RadialGaugeSeriesProperties.prototype,"secondaryLabel",2),__decorateClass([TempValidate81(OBJECT46)],RadialGaugeSeriesProperties.prototype,"tooltip",2);var{SectorBox:SectorBox6}=module_support_exports;function computeClipSector(t){const{startAngle:e,endAngle:i,clipStartAngle:s,clipEndAngle:n,innerRadius:o,outerRadius:a}=t;if(!(s==null||n==null))return new SectorBox6(Math.max(s,e),Math.min(n,i),o,a)}function clipSectorVisibility(t,e,i){return Math.max(t,i.startAngle)<=Math.min(e,i.endAngle)}function hasClipSector(t){return t.clipStartAngle!=null&&t.clipEndAngle!=null}function datumClipSector(t,e){const{clipStartAngle:i,clipEndAngle:s,innerRadius:n,outerRadius:o}=t;return new SectorBox6(i,e?i:s,n,o)}function prepareRadialGaugeSeriesAnimationFunctions(t,e){const i=t?"initial":"update";return{node:{fromFn(o,a){const r=o.previousDatum;let{startAngle:l,endAngle:c}=r??a;const h=r!=null&&hasClipSector(r)?datumClipSector(r,t):void 0,d=hasClipSector(a)?datumClipSector(a,t):void 0;let u;return h!=null&&d!=null?u=h:h==null&&d!=null?(u=d,l=a.startAngle,c=a.endAngle):h!=null&&d==null?(u=void 0,l=a.startAngle,c=a.endAngle):t&&(c=l),{startAngle:l,endAngle:c,clipSector:u,phase:i}},toFn(o,a){const{startAngle:r,endAngle:l}=a;let c;return hasClipSector(a)&&(c=datumClipSector(a,!1)),{startAngle:r,endAngle:l,clipSector:c}},applyFn(o,a){const{startAngle:r,endAngle:l}=a;let{clipSector:c}=a;c!=null&&(c=new SectorBox6(Math.max(r,c.startAngle),Math.min(l,c.endAngle),c.innerRadius,c.outerRadius));const h=c==null||clipSectorVisibility(r,l,c);o.startAngle=r,o.endAngle=l,o.clipSector=c,o.visible=h}},needle:{fromFn(o){let{angle:a}=o.previousDatum??o.datum;return t&&(a=e),{rotation:a,phase:i}},toFn(o,a){const{angle:r}=a;return{rotation:r}}}}}function resetRadialGaugeSeriesResetSectorFunction(t,e){const{startAngle:i,endAngle:s}=e,n=computeClipSector(e),o=n==null||clipSectorVisibility(i,s,n);return{startAngle:i,endAngle:s,clipSector:n,visible:o}}function resetRadialGaugeSeriesResetNeedleFunction(t,e){const{angle:i}=e;return{rotation:i}}var verticalAlignFactors3={top:0,middle:.5,bottom:1};function formatRadialGaugeLabels(t,e,i,s,n){const{padding:o,textAlign:a,verticalAlign:r}=i;let l,c;if(e.each((S,v)=>{v.label==="primary"?l=v:v.label==="secondary"&&(c=v)}),l==null)return;const h=getLabelText(t,l,n?.label);if(h==null)return;const d=c!=null?getLabelText(t,c,n?.secondaryLabel):void 0,u={padding:o},p=a==="center"?2:1,g=r==="middle"?2:1,f=S=>({width:Math.sqrt(Math.max(s**2-(S/g)**2,0))*p,height:Math.min(S,g*s),meta:null});let m,y,x;if(c!=null&&d!=null){const S=formatStackedLabels(h,l,d,c,u,f);m=S?.label,y=S?.secondaryLabel,x=S?.height??0}else{const S=formatSingleLabel(h,l,u,f);m=S?.[0],y=void 0,x=S?.[0].height??0}const b=x*verticalAlignFactors3[r];e.each((S,v)=>{let I;if(v.label==="primary"?I=m:v.label==="secondary"&&(I=y),I==null){S.visible=!1;return}S.visible=!0,S.text=I.text,S.fontSize=I.fontSize,S.lineHeight=I.lineHeight,S.textAlign=a,S.textBaseline="middle";const A=v.label==="primary"?I.height/2:x-I.height/2;S.y=v.centerY+A-b,S.x=v.centerX})}var{fromToMotion:fromToMotion6,resetMotion:resetMotion5,CachedTextMeasurerPool:CachedTextMeasurerPool12,SeriesNodePickMode:SeriesNodePickMode18,StateMachine:StateMachine16,createDatumId:createDatumId22,normalizeAngle360:normalizeAngle3608,normalizeAngle360Inclusive:normalizeAngle360Inclusive3,isBetweenAngles:isBetweenAngles3,sectorBox:sectorBox2,toDegrees:toDegrees2,toRadians:toRadians7,BBox:BBox24,Group:Group21,PointerEvents:PointerEvents13,Selection:Selection16,Sector:Sector7,SectorBox:SectorBox7,Text:Text9,Marker:Marker6,getColorStops:getColorStops3}=module_support_exports,targetPlacementRotation={inside:90,middle:0,outside:-90},outsideLabelPlacements=[{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"},{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"}],insideLabelPlacements=[{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"},{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"}],RadialGaugeSeries=class extends module_support_exports.Series{constructor(t){super({moduleCtx:t,useLabelLayer:!0,pickModes:[SeriesNodePickMode18.EXACT_SHAPE_MATCH,SeriesNodePickMode18.NEAREST_NODE]}),this.centerX=0,this.centerY=0,this.radius=0,this.textAlign="center",this.verticalAlign="middle",this.properties=new RadialGaugeSeriesProperties,this.scale=new LinearAngleScale,this.scaleGroup=this.contentGroup.appendChild(new Group21({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new Group21({name:"itemGroup"})),this.itemNeedleGroup=this.contentGroup.appendChild(new Group21({name:"itemNeedleGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new Group21({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new Group21({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new Group21({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new Group21({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new Group21({name:"tickGroup"})),this.scaleSelection=Selection16.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=Selection16.select(this.itemGroup,()=>this.nodeFactory()),this.needleSelection=Selection16.select(this.itemNeedleGroup,RadialGaugeNeedle),this.targetSelection=Selection16.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=Selection16.select(this.itemTargetLabelGroup,Text9),this.labelSelection=Selection16.select(this.itemLabelGroup,Text9),this.highlightTargetSelection=Selection16.select(this.highlightTargetGroup,()=>this.markerFactory()),this.tickSelection=Selection16.select(this.tickGroup,module_support_exports.TransformableText),this.datumUnion=new DatumUnion,this.animationState=new StateMachine16("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=PointerEvents13.None,this.tickGroup.pointerEvents=PointerEvents13.None,this.itemNeedleGroup.pointerEvents=PointerEvents13.None,this.itemLabelGroup.pointerEvents=PointerEvents13.None}get hasData(){return this.properties.value!=null}nodeFactory(){return new Sector7}markerFactory(){const t=new Marker6;return t.size=1,t}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(t){const{min:e,max:i}=this.properties.scale;return formatLabel(t,{min:e,max:i})}layoutScale(){const{scale:t,properties:e}=this,{seriesRectWidth:i,seriesRectHeight:s}=this.nodeDataDependencies,{scale:n,outerRadius:o}=this.properties,{min:a,max:r,label:l,interval:c}=n,h=toRadians7(e.startAngle-90),d=toRadians7(e.endAngle-90),p=normalizeAngle360Inclusive3(d-h)>Math.PI,g=p||isBetweenAngles3(1.5*Math.PI,h,d),f=p||isBetweenAngles3(0*Math.PI,h,d),m=p||isBetweenAngles3(.5*Math.PI,h,d),y=p||isBetweenAngles3(1*Math.PI,h,d);let x;y&&!f?x="right":!y&&f?x="left":x="center";let b;g&&!m?b="bottom":!g&&m?b="top":b="middle";const S=sectorBox2({startAngle:h,endAngle:d,innerRadius:0,outerRadius:.5}),v=-(S.x+S.width/2)*2,I=-(S.y+S.height/2)*2,A=Math.min(i/S.width,s/S.height);t.domain=[a,r],t.range=[h,d],t.arcLength=A/2;const{maxSpacing:D,minSpacing:T}=c,{arcLength:k}=t,w=D?Math.floor(k/D):1,L=T?Math.floor(k/T):1/0,O=Math.floor(4/Math.PI*Math.abs(t.range[0]-t.range[1])),F=Math.max(w,Math.min(L,O)),R=c.values??t.ticks({nice:!1,interval:c.step,minTickCount:w,maxTickCount:L,tickCount:F}),E=R.reduce((Y,U)=>Math.max(Y,typeof U=="number"?countFractionDigits(U):0),0),_=t.tickFormatter({domain:t.domain,ticks:R,fractionDigits:E,specifier:l.format}),G=l.getFont(),B=R.map((Y,U)=>{const $=l.formatter?.({value:Y,index:U,domain:t.domain,boundSeries:void 0})??_(Y),{width:W,height:X}=CachedTextMeasurerPool12.measureText($,{font:G});return{index:U,value:Y,text:$,width:W,height:X}}),z=B.reduce((Y,U)=>Math.max(Y,U.width),0),P=B.reduce((Y,U)=>Math.max(Y,U.height),0),V=l.enabled?Math.max(z,P)+l.spacing:0,j=Math.max(.5*A-V,0),H=o??j;return this.centerX=i/2+v*H,this.centerY=s/2+I*H,this.radius=H,this.textAlign=x,this.verticalAlign=b,B}createConicGradient(t,e){const{scale:i}=this,{domain:s,range:n}=i,[o,a]=n,{defaultColorRange:r}=this.properties,l=normalizeAngle3608((o+a)/2+Math.PI),c=normalizeAngle360Inclusive3(a-o);return{type:"gradient",gradient:"conic",colorSpace:"oklch",colorStops:getColorStops3(t,r,s,e).map(({color:d,stop:u})=>(u=Math.min(Math.max(u,0),1),u=(o+c*u-l)/(2*Math.PI),u=(u%1+1)%1,{stop:u,color:d})),rotation:toDegrees2(l)+90}}getShapeFillBBox(){const{centerX:t,centerY:e,radius:i}=this;return new BBox24(t-i,e-i,2*i,2*i)}getTargets(){const{properties:t}=this,e=t.defaultTarget;return Array.from(t.targets).map(i=>{const{text:s=e.text,value:n=e.value??0,shape:o=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:d=e.fill??"black",fillOpacity:u=e.fillOpacity??1,stroke:p=e.stroke??"black",strokeOpacity:g=e.strokeOpacity??1,lineDash:f=e.lineDash??[0],lineDashOffset:m=e.lineDashOffset??0}=i,{enabled:y=e.label.enabled,color:x=e.label.color??"black",fontStyle:b=e.label.fontStyle??"normal",fontWeight:S=e.label.fontWeight??"normal",fontSize:v=e.label.fontSize,fontFamily:I=e.label.fontFamily,spacing:A=e.label.spacing??0}=i.label;return{text:s,value:n,shape:o,placement:l,spacing:c,size:h,rotation:a,fill:d,fillOpacity:u,stroke:p,strokeWidth:r,strokeOpacity:g,lineDash:f,lineDashOffset:m,label:{enabled:y,color:x,fontStyle:b,fontWeight:S,fontSize:v,fontFamily:I,spacing:A}}})}getTargetRadius(t){const{radius:e,properties:i}=this,{innerRadiusRatio:s,outerRadiusRatio:n}=i,{placement:o,spacing:a,size:r}=t,l=e*n,c=e*s;switch(o){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{scale:e}=this,{value:i,size:s,placement:n,label:o}=t,{spacing:a,color:r,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d}=o,u=void 0,p=e.convert(i),g=normalizeAngle3608(p)/(Math.PI/2)|0,f=s/2+a;let m,y,x,b;switch(n){case"outside":({textAlign:m,textBaseline:y}=outsideLabelPlacements[g]),x=f*Math.cos(p),b=f*Math.sin(p);break;case"inside":({textAlign:m,textBaseline:y}=insideLabelPlacements[g]),x=-f*Math.cos(p),b=-f*Math.sin(p);break;default:m="center",y="bottom",x=0,b=-f;break}return{offsetX:x,offsetY:b,fill:r,textAlign:m,textBaseline:y,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d,lineHeight:u}}createNodeData(){if(!this.properties.isValid())return;const t=this.layoutScale(),{id:e,scale:i,properties:s,radius:n,centerX:o,centerY:a}=this,{value:r,innerRadiusRatio:l,outerRadiusRatio:c,segmentation:h,cornerRadius:d,cornerMode:u,needle:p,bar:g,scale:f,label:m,secondaryLabel:y}=s,{outerRadius:x=n*c,innerRadius:b=n*l}=s,S=this.getTargets(),v=[],I=[],A=[],D=[],T=[],k=u==="item",w=i.convert(i.domain[0]),L=i.convert(r),O=Math.ceil(normalizeAngle360Inclusive3(L-w)*n);let F=h.enabled?h.interval.getSegments(i,O):void 0;const R=g.enabled?g.fill??this.createConicGradient(g.fills,g.fillMode):"rgba(0,0,0,0)",E=f.fill??(g.enabled&&f.fills.length===0?f.defaultFill:void 0)??this.createConicGradient(f.fills,f.fillMode);if(F==null&&k){const _=Math.min(...i.domain),G=Math.max(...i.domain),B={value:r,segmentStart:_,segmentEnd:G},P=Math.min(d,(x-b)/2)/((b+x)/2);v.push({series:this,itemId:"value",datum:B,datumIndex:{type:0},type:0,centerX:o,centerY:a,outerRadius:x,innerRadius:b,startAngle:w-P,endAngle:L+P,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:d,endCornerRadius:d,fill:R}),T.push({series:this,itemId:"scale",datum:B,datumIndex:{type:0},type:0,centerX:o,centerY:a,outerRadius:x,innerRadius:b,startAngle:i.range[0]-P,endAngle:i.range[1]+P,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:d,endCornerRadius:d,fill:E})}else{F??(F=i.domain);for(let _=0;_<F.length-1;_++){const G=F[_],B=F[_+1],z={value:r,segmentStart:G,segmentEnd:B},P=_===0,V=_===F.length-2,j=i.convert(G),H=i.convert(B);v.push({series:this,itemId:`value-${_}`,datum:z,datumIndex:{type:0},type:0,centerX:o,centerY:a,outerRadius:x,innerRadius:b,startAngle:j,endAngle:H,clipStartAngle:w,clipEndAngle:L,startCornerRadius:k||P?d:0,endCornerRadius:k||V?d:0,fill:R}),T.push({series:this,itemId:`scale-${_}`,datum:z,datumIndex:{type:0},type:0,centerX:o,centerY:a,outerRadius:x,innerRadius:b,startAngle:j,endAngle:H,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:k||P?d:0,endCornerRadius:k||V?d:0,fill:E})}}if(!p.enabled&&m.enabled){const{text:_,color:G,fontSize:B,minimumFontSize:z,fontStyle:P,fontWeight:V,fontFamily:j,lineHeight:H,formatter:Y=U=>this.formatLabel(U.value)}=m;D.push({label:"primary",centerX:o,centerY:a,text:_,value:r,fill:G,fontSize:B,minimumFontSize:z,fontStyle:P,fontWeight:V,fontFamily:j,lineHeight:H,formatter:Y})}if(!p.enabled&&y.enabled){const{text:_,color:G,fontSize:B,minimumFontSize:z,fontStyle:P,fontWeight:V,fontFamily:j,lineHeight:H,formatter:Y}=y;D.push({label:"secondary",centerX:o,centerY:a,text:_,value:r,fill:G,fontSize:B,minimumFontSize:z,fontStyle:P,fontWeight:V,fontFamily:j,lineHeight:H,formatter:Y})}if(p.enabled){let _=p.radiusRatio!=null?n*p.radiusRatio:b;_=Math.max(_-p.spacing,0);const G=i.convert(r);A.push({centerX:o,centerY:a,radius:_,angle:G,series:this})}for(let _=0;_<S.length;_+=1){const G=S[_],{value:B,text:z,size:P,shape:V,fill:j,fillOpacity:H,stroke:Y,strokeWidth:U,strokeOpacity:$,lineDash:W,lineDashOffset:X}=G;if(B<Math.min(...i.domain)||B>Math.max(...i.domain))continue;const Z=this.getTargetRadius(G),q=i.convert(B),Q=toRadians7(G.rotation+targetPlacementRotation[G.placement]);I.push({series:this,itemId:`target-${_}`,midPoint:{x:Z*Math.cos(q)+o,y:Z*Math.sin(q)+a},datum:{value:B},datumIndex:{type:1,index:_},type:1,value:B,text:z,centerX:o,centerY:a,shape:V,radius:Z,angle:q,rotation:Q,size:P,fill:j,fillOpacity:H,stroke:Y,strokeOpacity:$,strokeWidth:U,lineDash:W,lineDashOffset:X,label:this.getTargetLabel(G)})}return{itemId:e,nodeData:v,needleData:A,targetData:I,labelData:D,scaleData:T,tickData: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:s,targetSelection:n,targetLabelSelection:o,scaleSelection:a,highlightTargetSelection:r,tickSelection:l}=this,c=this.checkResize(t);this.updateSelections(c),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();const h=this.contextNodeData?.nodeData??[],d=this.contextNodeData?.labelData??[],u=this.contextNodeData?.needleData??[],p=this.contextNodeData?.targetData??[],g=this.contextNodeData?.scaleData??[],f=this.contextNodeData?.tickData??[],m=this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());this.scaleSelection=this.updateScaleSelection({scaleData:g,scaleSelection:a}),this.updateScaleNodes({scaleSelection:a}),this.needleSelection=this.updateNeedleSelection({needleData:u,needleSelection:s}),this.updateNeedleNodes({needleSelection:s}),this.targetSelection=this.updateTargetSelection({targetData:p,targetSelection:n}),this.updateTargetNodes({targetSelection:n,isHighlight:!1}),this.targetLabelSelection=this.updateTargetLabelSelection({targetData:p,targetLabelSelection:o}),this.updateTargetLabelNodes({targetLabelSelection:o}),this.datumSelection=this.updateDatumSelection({nodeData:h,datumSelection:e}),this.updateDatumNodes({datumSelection:e}),this.labelSelection=this.updateLabelSelection({labelData:d,labelSelection:i}),this.updateLabelNodes({labelSelection:i}),this.highlightTargetSelection=this.updateTargetSelection({targetData:m!=null?[m]:[],targetSelection:r}),this.updateTargetNodes({targetSelection:r,isHighlight:!0}),this.tickSelection=this.updateTickSelection({tickData:f,tickSelection:l}),this.updateTickNodes({tickSelection:l}),c&&this.animationState.transition("resize"),this.animationState.transition("update")}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>createDatumId22(t.nodeData.length,e.itemId))}updateDatumNodes(t){const{datumSelection:e}=t,{ctx:i,properties:s}=this,{bar:n,segmentation:o}=s,a=o.spacing??0,{fillOpacity:r,stroke:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}=n,u=this.getStrokeWidth(n.strokeWidth),p=i.animationManager.isSkipped(),g=this.getShapeFillBBox();e.each((f,m)=>{const{centerX:y,centerY:x,innerRadius:b,outerRadius:S,startCornerRadius:v,endCornerRadius:I,fill:A}=m;f.centerX=y,f.centerY=x,f.innerRadius=b,f.outerRadius=S,f.pointerEvents=this.properties.bar.enabled?module_support_exports.PointerEvents.All:module_support_exports.PointerEvents.None,f.fill=A,f.fillBBox=g,f.fillOpacity=r,f.stroke=l,f.strokeOpacity=c,f.strokeWidth=u,f.lineDash=h,f.lineDashOffset=d,f.startOuterCornerRadius=v,f.startInnerCornerRadius=v,f.endOuterCornerRadius=I,f.endInnerCornerRadius=I,f.radialEdgeInset=(a+f.strokeWidth)/2,f.concentricEdgeInset=f.strokeWidth/2,(p||f.previousDatum==null)&&f.setProperties(resetRadialGaugeSeriesResetSectorFunction(f,m))}),this.datumUnion.update(e,this.itemGroup,module_support_exports.Sector,(f,m,y)=>{f.clipSector??(f.clipSector=new SectorBox7(NaN,NaN,NaN,NaN)),f.centerX=m.centerX,f.centerY=m.centerY,f.outerRadius=f.clipSector.outerRadius=m.outerRadius,f.innerRadius=f.clipSector.innerRadius=m.innerRadius,f.startAngle=f.clipSector.startAngle=m.startAngle,f.startInnerCornerRadius=m.startInnerCornerRadius,f.startOuterCornerRadius=m.startOuterCornerRadius,f.endAngle=y.endAngle,f.clipSector.endAngle=y.clipSector?.endAngle??y.endAngle,f.endInnerCornerRadius=y.endInnerCornerRadius,f.endOuterCornerRadius=y.endOuterCornerRadius,f.pointerEvents=module_support_exports.PointerEvents.None})}updateScaleSelection(t){return t.scaleSelection.update(t.scaleData,void 0,e=>createDatumId22(t.scaleData.length,e.itemId))}updateScaleNodes(t){const{scaleSelection:e}=t,{scale:i,segmentation:s}=this.properties,n=s.spacing??0,{fillOpacity:o,stroke:a,strokeOpacity:r,strokeWidth:l,lineDash:c,lineDashOffset:h}=i,d=this.getShapeFillBBox();e.each((u,p)=>{const{centerX:g,centerY:f,innerRadius:m,outerRadius:y,startCornerRadius:x,endCornerRadius:b,fill:S}=p;u.centerX=g,u.centerY=f,u.innerRadius=m,u.outerRadius=y,u.fill=S,u.fillBBox=d,u.fillOpacity=o,u.stroke=a,u.strokeOpacity=r,u.strokeWidth=l,u.lineDash=c,u.lineDashOffset=h,u.startOuterCornerRadius=x,u.startInnerCornerRadius=x,u.endOuterCornerRadius=b,u.endInnerCornerRadius=b,u.radialEdgeInset=(n+u.strokeWidth)/2,u.concentricEdgeInset=u.strokeWidth/2,u.setProperties(resetRadialGaugeSeriesResetSectorFunction(u,p))})}updateNeedleSelection(t){return t.needleSelection.update(t.needleData,void 0,()=>createDatumId22([]))}updateNeedleNodes(t){const{needleSelection:e}=t,{fill:i,fillOpacity:s,stroke:n,strokeOpacity:o,strokeWidth:a,lineDash:r,lineDashOffset:l}=this.properties.needle,c=this.ctx.animationManager.isSkipped();e.each((h,d)=>{const{centerX:u,centerY:p,radius:g}=d,f=g*2;h.d=RadialGaugeNeedle.defaultPathData,h.fill=i,h.fillOpacity=s,h.stroke=n,h.strokeOpacity=o,h.strokeWidth=a/f,h.lineDash=r.map(m=>m/f),h.lineDashOffset=l/f,h.translationX=u,h.translationY=p,h.scalingX=f,h.scalingY=f,c&&h.setProperties(resetRadialGaugeSeriesResetNeedleFunction(h,d))})}updateTargetSelection(t){return t.targetSelection.update(t.targetData,void 0,e=>e.itemId)}updateTargetNodes(t){const{targetSelection:e,isHighlight:i}=t,s=i?this.properties.highlightStyle.item:void 0;e.each((n,o)=>{const{centerX:a,centerY:r,angle:l,radius:c,shape:h,size:d,rotation:u,fill:p,fillOpacity:g,stroke:f,strokeOpacity:m,strokeWidth:y,lineDash:x,lineDashOffset:b}=o;n.shape=h==="line"?lineMarker:h,n.size=d,n.fill=s?.fill??p,n.fillOpacity=s?.fillOpacity??g,n.stroke=s?.stroke??f,n.strokeOpacity=s?.strokeOpacity??m,n.strokeWidth=s?.strokeWidth??y,n.lineDash=s?.lineDash??x,n.lineDashOffset=s?.lineDashOffset??b,n.translationX=a+c*Math.cos(l),n.translationY=r+c*Math.sin(l),n.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,s)=>{const{centerX:n,centerY:o,radius:a,angle:r,text:l}=s,{offsetX:c,offsetY:h,fill:d,fontStyle:u,fontWeight:p,fontSize:g,fontFamily:f,textAlign:m,textBaseline:y}=s.label;if(l==null){i.visible=!1;return}i.visible=!0,i.x=n+a*Math.cos(r)+c,i.y=o+a*Math.sin(r)+h,i.text=l,i.fill=d,i.fontStyle=u,i.fontWeight=p,i.fontSize=g,i.fontFamily=f,i.textAlign=m,i.textBaseline=y})}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((s,n)=>{s.fill=n.fill,s.fontStyle=n.fontStyle,s.fontWeight=n.fontWeight,s.fontFamily=n.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}updateTickSelection(t){return t.tickSelection.update(t.tickData,void 0,e=>e.index)}updateTickNodes(t){const{scale:e,radius:i,centerX:s,centerY:n,properties:o}=this,{enabled:a,color:r,fontFamily:l,fontSize:c,fontStyle:h,fontWeight:d,spacing:u}=o.scale.label,p=toRadians7(o.scale.label.rotation??0);t.tickSelection.each((g,f)=>{if(!a){g.visible=!1;return}g.visible=!0,g.text=f.text,g.fill=r,g.fontFamily=l,g.fontSize=c,g.fontStyle=h,g.fontWeight=d,g.textAlign="center",g.textBaseline="middle";const m=e.convert(f.value),{width:y,height:x}=f,b=Math.abs(i*Math.cos(m)),S=Math.abs(i*Math.sin(m)),v=Math.min(Math.max(Math.abs(i/Math.tan(m)),b-y/2),b+y/2),I=Math.min(Math.max(Math.abs(i*Math.tan(m)),S-x/2),S+x/2),A=Math.hypot(v,I),D=s+(A+u)*Math.cos(m),T=n+(A+u)*Math.sin(m);g.x=D,g.y=T,g.rotationCenterX=D,g.rotationCenterY=T,g.rotation=p})}labelsHaveExplicitText(){for(const{datum:t}of this.labelSelection)if(t.text==null)return!1;return!0}formatLabelText(t){const{labelSelection:e,radius:i,textAlign:s,verticalAlign:n}=this,{spacing:o,innerRadiusRatio:a}=this.properties;formatRadialGaugeLabels(this,e,{padding:o,textAlign:s,verticalAlign:n},i*a,t)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),resetMotion5([this.datumSelection],resetRadialGaugeSeriesResetSectorFunction),resetMotion5([this.needleSelection],resetRadialGaugeSeriesResetNeedleFunction),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,s,n,o;if(this.labelSelection.each((a,r)=>{a.opacity=1,r.label==="primary"?(i=a.previousDatum?.value??t.from??r.value,s=r.value):r.label==="secondary"&&(n=a.previousDatum?.value??t.from??r.value,o=r.value)}),!this.labelsHaveExplicitText())if(s==null||o==null)this.formatLabelText();else if(i===s&&n===o)this.formatLabelText({label:s,secondaryLabel:o});else{const a=`${this.id}_labels`;e.animate({id:a,groupId:"label",from:{label:i,secondaryLabel:n},to:{label:s,secondaryLabel:o},phase:t.phase??"update",onUpdate:r=>this.formatLabelText(r)})}}animateEmptyUpdateReady(){const{animationManager:t}=this.ctx,{node:e,needle:i}=prepareRadialGaugeSeriesAnimationFunctions(!0,this.scale.range[0]);fromToMotion6(this.id,"node",t,[this.datumSelection],e,(s,n)=>n.itemId),fromToMotion6(this.id,"needle",t,[this.needleSelection],i,()=>"needle"),fromToMotion6(this.id,"label",t,[this.labelSelection],fadeInFns,(s,n)=>n.label),this.animateLabelText({from:this.properties.scale.min,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:t}=this.ctx,{node:e,needle:i}=prepareRadialGaugeSeriesAnimationFunctions(!1,this.scale.range[0]);fromToMotion6(this.id,"node",t,[this.datumSelection],e,(s,n)=>n.itemId),fromToMotion6(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:s}=i;if(!i.isValid())return;let n,o;if(t.type===0?(n=i.value,o=i.label.text):{value:n,text:o}=i.targets[t.index],n!=null)return s.formatTooltip(this.properties,{data:[{label:o,fallbackLabel:"Value",value:this.formatLabel(n)}]},{seriesId:e,title:void 0,datum:void 0,value:n})}pickNodeClosestDatum(t){return pickGaugeNearestDatum(this,t)}pickFocus(t){return pickGaugeFocus(this,t)}getCaptionText(){const{value:t}=this.properties,e=[];return e.push(this.formatLabel(t)),this.labelSelection.each((i,s)=>{const n=getLabelText(this,s);n!=null&&e.push(n)}),e.join(". ")}getCategoryValue(t){}datumIndexForCategoryValue(t){}};RadialGaugeSeries.className="RadialGaugeSeries",RadialGaugeSeries.type="radial-gauge";var{commonSeriesOptionsDefs:commonSeriesOptionsDefs23,autoSizedLabelOptionsDefs:autoSizedLabelOptionsDefs5,seriesLabelOptionsDefs:seriesLabelOptionsDefs17,tooltipOptionsDefs:tooltipOptionsDefs22,numberFormatValidator:numberFormatValidator5}=module_support_exports,radialGaugeTargetOptionsDef={value:required(number),text:string,shape:or(union("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),callback),placement:union("inside","outside","middle"),spacing:positiveNumber,size:positiveNumber,rotation:number,label:{...seriesLabelOptionsDefs17,spacing:positiveNumber},...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},radialGaugeSeriesOptionsDef={type:required(constant("radial-gauge")),value:required(number),outerRadius:positiveNumber,innerRadius:positiveNumber,outerRadiusRatio:ratio,innerRadiusRatio:ratio,startAngle:number,endAngle:number,spacing:positiveNumber,cornerMode:union("container","item"),cornerRadius:positiveNumber,scale:{min:and(number,lessThan("max")),max:and(number,greaterThan("min")),label:{enabled:boolean,formatter:callback,rotation:number,spacing:positiveNumber,minSpacing:positiveNumber,avoidCollisions:boolean,format:numberFormatValidator5,...fontOptionsDef},interval:{values:arrayOf(number),step:number},...fillsOptionsDef,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},targets:arrayOfDefs(radialGaugeTargetOptionsDef,"target options array"),segmentation:{enabled:boolean,spacing:positiveNumber,interval:{values:arrayOf(number),step:number,count:number}},bar:{enabled:boolean,...fillsOptionsDef,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},needle:{enabled:boolean,spacing:positiveNumber,radiusRatio:ratio,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},label:{text:string,spacing:positiveNumber,...autoSizedLabelOptionsDefs5},secondaryLabel:{text:string,...autoSizedLabelOptionsDefs5},tooltip:tooltipOptionsDefs22,...commonSeriesOptionsDefs23};radialGaugeSeriesOptionsDef.defaultColorRange=arrayOf(color),radialGaugeSeriesOptionsDef.defaultTarget={...radialGaugeTargetOptionsDef,value:number,label:{...seriesLabelOptionsDefs17,spacing:number}},radialGaugeSeriesOptionsDef.scale.defaultFill=color;var{FONT_SIZE_RATIO:FONT_SIZE_RATIO3}=module_support_exports,RadialGaugeModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["gauge"],identifier:"radial-gauge",moduleFactory:t=>new RadialGaugeSeries(t),tooltipDefaults:{range:10},themeTemplate:{minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{outerRadiusRatio:1,innerRadiusRatio:.8,startAngle:270,endAngle:450,defaultColorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$interpolate:[{$palette:"secondDivergingColors"},5]},module_support_exports.SAFE_RANGE2_OPERATION]},scale:{defaultFill:{$path:["./1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["./2",module_support_exports.SAFE_STROKE_FILL_OPERATION,{$palette:"hierarchyColors"}]},label:{fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:12}},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:[FONT_SIZE_RATIO3.LARGE]},minimumFontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"}}}}},RadialGaugeSeriesModule={type:"series",name:"radial-gauge",chartType:"gauge",enterprise:!0,options:radialGaugeSeriesOptionsDef,create:t=>new RadialGaugeSeries(t)};function sortNodesByY(t){t.nodes.sort((e,i)=>Math.round((e.datum.y-i.datum.y)*100)/100||-(e.datum.size-i.datum.size))}function justifyNodesAcrossColumn({nodes:t,size:e},{seriesRectHeight:i,nodeSpacing:s,sizeScale:n}){const o=i*e*n;let a=(i-(o+s*(t.length-1)))/2;t.forEach(({datum:r})=>{const l=i*r.size*n;r.y=a,r.height=l,a+=l+s})}function separateNodesInColumn(t,e){const{nodes:i}=t,{seriesRectHeight:s,nodeSpacing:n}=e;sortNodesByY(t);let o=0,a=0;for(const{datum:c}of i){const h=Math.max(a-c.y,0);c.y+=h,o+=h,a=c.y+c.height+n}if(a-n<s)return o>0;let l=s;for(let c=i.length-1;c>=0;c-=1){const{datum:h}=i[c],d=h.y+h.height,u=Math.min(l-d,0);h.y+=u,o+=u,l=h.y-n}return!0}function hasCrossOver(t,e,i,s,n,o,a,r){const l=(i-t)/(s-e),c=(a-n)/(r-o),h=((o-e)*(l*c)+t*c-n*l)/(c-l);return t<i?h>t&&h<Math.min(i,a):h<t&&h>Math.max(i,a)}function removeColumnCrossoversInDirection(t,e){let i=!1;const s=t.nodes.filter(o=>e(o).length===1);let n=!0;for(let o=0;n&&o<s.length;o+=1){n=!1;for(let a=0;a<s.length-1;a+=1){const{datum:r}=s[a],l=e(s[a])[0].node.datum,{datum:c}=s[a+1],h=e(s[a+1])[0].node.datum;if(!(hasCrossOver(r.x,r.y,l.x,l.y,c.x,c.y,h.x,h.y)||hasCrossOver(r.x,r.y+r.height/2,l.x,l.y+l.height/2,c.x,c.y+c.height/2,h.x,h.y+h.height/2)||hasCrossOver(r.x,r.y+r.height,l.x,l.y+l.height,c.x,c.y+c.height,h.x,h.y+h.height)))continue;const u=s[a];s[a]=s[a+1],s[a+1]=u;const p=r.y;r.y=c.y+c.height-r.height,c.y=p,i=!0,n=!0}}return i}function removeColumnCrossovers(t){let e=!1;return sortNodesByY(t),e=removeColumnCrossoversInDirection(t,i=>i.linksBefore)||e,e=removeColumnCrossoversInDirection(t,i=>i.linksAfter)||e,e}function weightedNodeY(t){if(t.length===0)return;let e=0,i=0;for(const{node:{datum:s}}of t)e+=s.y*s.size,i+=s.size;return e/i}function layoutColumn(t,e,i,s){return t.nodes.forEach(({datum:n,linksBefore:o,linksAfter:a})=>{const r=s===1?o:a,l=s===1?a:o,c=weightedNodeY(r);if(c!=null){const h=l.length!==0?i:1;n.y=n.y+(c-n.y)*h}}),separateNodesInColumn(t,e)}function layoutColumnsForward(t,e,i){let s=!1;for(const n of t)s=layoutColumn(n,e,i,1)||s;return s}function layoutColumnsBackwards(t,e,i){let s=!1;for(let n=t.length-1;n>=0;n-=1)s=layoutColumn(t[n],e,i,-1)||s;return s}function removeColumnsCrossovers(t){let e=!1;for(let i=t.length-1;i>=0;i-=1)e=removeColumnCrossovers(t[i])||e;return e}function layoutColumns(t,e){t.forEach(s=>{justifyNodesAcrossColumn(s,e)});let i=!1;for(let s=0;s<6;s+=1){const n=layoutColumnsForward(t,e,1);i=layoutColumnsBackwards(t,e,.5);const o=removeColumnsCrossovers(t);if(!n&&!i&&!o)break}i&&(layoutColumnsForward(t,e,1),removeColumnsCrossovers(t))}var{BBox:BBox25,Path:Path14,ScenePathChangeDetection:ScenePathChangeDetection10,splitBezier:splitBezier2}=module_support_exports;function offsetTrivialCubicBezier(t,e,i,s,n,o,a,r,l,c){let h,d;if(n!==i&&l!==a){const I=-(s-e)/(n-i),A=-(r-o)/(l-a);h=(a-i+I*e-A*o)/(I-A),d=I*(h-e)+i}else if(n===i&&l!==a)h=e,d=-(r-o)/(l-a)*(h-r)+l;else if(n!==i&&l===a)h=r,d=-(s-e)/(n-i)*(h-e)+i;else throw new Error("Offsetting flat bezier curve");const u=Math.hypot(i-d,e-h),p=(u+c)/u,g=Math.hypot(l-d,r-h),f=(g+c)/g,m=h+(s-h)*p,y=d+(n-d)*p,x=h+(o-h)*f,b=d+(a-d)*f,S=h+(r-h)*f,v=d+(l-d)*f;t.cubicCurveTo(m,y,x,b,S,v)}var SankeyLink=class extends Path14{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),s=Math.max(this.y1,this.y2)-i+this.height;return new BBox25(t,i,e,s)}updatePath(){const{path:t,inset:e}=this;t.clear();const i=this.x1+e,s=this.x2-e,n=this.y1+e,o=this.y2+e,a=this.height-2*e;if(a<0||i>s)return;const r=i,l=n+a/2,c=(i+s)/2,h=n+a/2,d=(i+s)/2,u=o+a/2,p=s,g=o+a/2;if(t.moveTo(r,l-a/2),Math.abs(this.y2-this.y1)<1||this.x2-this.x1<this.height*Math.SQRT2)t.cubicCurveTo(c,h-a/2,d,u-a/2,p,g-a/2),t.lineTo(p,g+a/2),t.cubicCurveTo(d,u+a/2,c,h+a/2,r,l+a/2);else{const[f,m]=splitBezier2(r,l,c,h,d,u,p,g,.5),y=(o>n?1:-1)*a/2;offsetTrivialCubicBezier(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,y),offsetTrivialCubicBezier(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,-y),t.lineTo(p,g+a/2),offsetTrivialCubicBezier(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,y),offsetTrivialCubicBezier(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,-y)}t.closePath()}};__decorateClass([ScenePathChangeDetection10()],SankeyLink.prototype,"x1",2),__decorateClass([ScenePathChangeDetection10()],SankeyLink.prototype,"x2",2),__decorateClass([ScenePathChangeDetection10()],SankeyLink.prototype,"y1",2),__decorateClass([ScenePathChangeDetection10()],SankeyLink.prototype,"y2",2),__decorateClass([ScenePathChangeDetection10()],SankeyLink.prototype,"height",2),__decorateClass([ScenePathChangeDetection10()],SankeyLink.prototype,"inset",2);var{BaseProperties:BaseProperties29,FillGradientDefaults:FillGradientDefaults17,FillPatternDefaults:FillPatternDefaults17,SeriesTooltip:SeriesTooltip23,SeriesProperties:SeriesProperties14,ARRAY:ARRAY13,ARRAY_OF:ARRAY_OF6,COLOR_STRING:COLOR_STRING32,COLOR_STRING_ARRAY:COLOR_STRING_ARRAY14,FUNCTION:FUNCTION23,LINE_DASH:LINE_DASH26,OBJECT:OBJECT47,POSITIVE_NUMBER:POSITIVE_NUMBER38,OR:OR22,COLOR_GRADIENT:COLOR_GRADIENT17,COLOR_PATTERN:COLOR_PATTERN17,RATIO:RATIO36,STRING:STRING43,UNION:UNION19,TempValidate:TempValidate82,Label:Label18}=module_support_exports,ALIGNMENT=UNION19(["left","right","center","justify"],"a justification value"),SankeySeriesLabelProperties=class extends Label18{constructor(){super(...arguments),this.spacing=1}};__decorateClass([TempValidate82(POSITIVE_NUMBER38)],SankeySeriesLabelProperties.prototype,"spacing",2);var SankeySeriesLinkProperties=class extends BaseProperties29{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}};__decorateClass([TempValidate82(OR22(COLOR_GRADIENT17,COLOR_STRING32),{optional:!0})],SankeySeriesLinkProperties.prototype,"fill",2),__decorateClass([TempValidate82(RATIO36)],SankeySeriesLinkProperties.prototype,"fillOpacity",2),__decorateClass([TempValidate82(COLOR_STRING32,{optional:!0})],SankeySeriesLinkProperties.prototype,"stroke",2),__decorateClass([TempValidate82(RATIO36)],SankeySeriesLinkProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate82(POSITIVE_NUMBER38)],SankeySeriesLinkProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate82(LINE_DASH26)],SankeySeriesLinkProperties.prototype,"lineDash",2),__decorateClass([TempValidate82(POSITIVE_NUMBER38)],SankeySeriesLinkProperties.prototype,"lineDashOffset",2),__decorateClass([TempValidate82(FUNCTION23,{optional:!0})],SankeySeriesLinkProperties.prototype,"itemStyler",2);var SankeySeriesNodeProperties=class extends BaseProperties29{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}};__decorateClass([TempValidate82(POSITIVE_NUMBER38)],SankeySeriesNodeProperties.prototype,"spacing",2),__decorateClass([TempValidate82(POSITIVE_NUMBER38)],SankeySeriesNodeProperties.prototype,"width",2),__decorateClass([TempValidate82(ALIGNMENT)],SankeySeriesNodeProperties.prototype,"alignment",2),__decorateClass([TempValidate82(OR22(COLOR_GRADIENT17,COLOR_STRING32),{optional:!0})],SankeySeriesNodeProperties.prototype,"fill",2),__decorateClass([TempValidate82(RATIO36)],SankeySeriesNodeProperties.prototype,"fillOpacity",2),__decorateClass([TempValidate82(COLOR_STRING32,{optional:!0})],SankeySeriesNodeProperties.prototype,"stroke",2),__decorateClass([TempValidate82(RATIO36)],SankeySeriesNodeProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate82(POSITIVE_NUMBER38)],SankeySeriesNodeProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate82(LINE_DASH26)],SankeySeriesNodeProperties.prototype,"lineDash",2),__decorateClass([TempValidate82(POSITIVE_NUMBER38)],SankeySeriesNodeProperties.prototype,"lineDashOffset",2),__decorateClass([TempValidate82(FUNCTION23,{optional:!0})],SankeySeriesNodeProperties.prototype,"itemStyler",2);var SankeySeriesProperties=class extends SeriesProperties14{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.fillGradientDefaults=new FillGradientDefaults17,this.fillPatternDefaults=new FillPatternDefaults17,this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=[],this.strokes=[],this.label=new SankeySeriesLabelProperties,this.link=new SankeySeriesLinkProperties,this.node=new SankeySeriesNodeProperties,this.tooltip=new SeriesTooltip23}};__decorateClass([TempValidate82(ARRAY13,{optional:!0})],SankeySeriesProperties.prototype,"nodes",2),__decorateClass([TempValidate82(STRING43)],SankeySeriesProperties.prototype,"fromKey",2),__decorateClass([TempValidate82(STRING43)],SankeySeriesProperties.prototype,"toKey",2),__decorateClass([TempValidate82(STRING43)],SankeySeriesProperties.prototype,"idKey",2),__decorateClass([TempValidate82(STRING43,{optional:!0})],SankeySeriesProperties.prototype,"idName",2),__decorateClass([TempValidate82(STRING43,{optional:!0})],SankeySeriesProperties.prototype,"labelKey",2),__decorateClass([TempValidate82(STRING43,{optional:!0})],SankeySeriesProperties.prototype,"labelName",2),__decorateClass([TempValidate82(STRING43,{optional:!0})],SankeySeriesProperties.prototype,"sizeKey",2),__decorateClass([TempValidate82(STRING43,{optional:!0})],SankeySeriesProperties.prototype,"sizeName",2),__decorateClass([TempValidate82(OBJECT47)],SankeySeriesProperties.prototype,"fillGradientDefaults",2),__decorateClass([TempValidate82(OBJECT47)],SankeySeriesProperties.prototype,"fillPatternDefaults",2),__decorateClass([TempValidate82(ARRAY_OF6(COLOR_STRING_ARRAY14))],SankeySeriesProperties.prototype,"defaultColorRange",2),__decorateClass([TempValidate82(ARRAY_OF6(COLOR_STRING32))],SankeySeriesProperties.prototype,"defaultPatternFills",2),__decorateClass([TempValidate82(ARRAY_OF6(OR22(COLOR_GRADIENT17,COLOR_STRING32,COLOR_PATTERN17)))],SankeySeriesProperties.prototype,"fills",2),__decorateClass([TempValidate82(COLOR_STRING_ARRAY14)],SankeySeriesProperties.prototype,"strokes",2),__decorateClass([TempValidate82(OBJECT47)],SankeySeriesProperties.prototype,"label",2),__decorateClass([TempValidate82(OBJECT47)],SankeySeriesProperties.prototype,"link",2),__decorateClass([TempValidate82(OBJECT47)],SankeySeriesProperties.prototype,"node",2),__decorateClass([TempValidate82(OBJECT47)],SankeySeriesProperties.prototype,"tooltip",2);var{Transformable:Transformable4,applyShapeStyle:applyShapeStyle13,SeriesNodePickMode:SeriesNodePickMode19,CachedTextMeasurerPool:CachedTextMeasurerPool13,TextWrapper:TextWrapper7,TextUtils:TextUtils9,createDatumId:createDatumId23,getShapeStyle:getShapeStyle19,Rect:Rect10,BBox:BBox26}=module_support_exports,SankeySeries=class extends FlowProportionSeries{constructor(t){super({moduleCtx:t,pickModes:[SeriesNodePickMode19.NEAREST_NODE,SeriesNodePickMode19.EXACT_SHAPE_MATCH]}),this.properties=new SankeySeriesProperties}isLabelEnabled(){return(this.properties.labelKey!=null||this.nodes==null)&&this.properties.label.enabled}linkFactory(){return new SankeyLink}nodeFactory(){return new Rect10}createNodeData(){const{id:t,_nodeDataDependencies:{seriesRectWidth:e,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0}}=this,{fromKey:s,toKey:n,sizeKey:o,label:{spacing:a},node:{spacing:r,width:l,alignment:c}}=this.properties,{nodeGraph:h,links:d,maxPathLength:u}=this.getNodeGraph(A=>({...A,x:NaN,y:NaN,width:l,height:NaN}),A=>({...A,x1:NaN,x2:NaN,y1:NaN,y2:NaN,height:NaN}),{includeCircularReferences:!1}),p=h,g=this.isLabelEnabled()?(e-l)*(1-u/(u+1)):0,f=(e-l-2*g)/(u-1),m=[];for(let A=0;A<u;A+=1){const D=g+A*f;m.push({index:A,size:0,nodes:[],x:D})}p.forEach(A=>{const{datum:D,linksBefore:T,linksAfter:k,maxPathLengthBefore:w,maxPathLengthAfter:L}=A,O=Math.max(T.reduce((E,{link:_})=>E+_.size,0),k.reduce((E,{link:_})=>E+_.size,0));if(T.length===0&&k.length===0||O===0){A.columnIndex=-1;return}let F;switch(c){case"left":F=m[w];break;case"right":F=m[u-1-L];break;case"center":{if(T.length!==0)F=m[w];else if(k.length!==0){const E=k.reduce((_,G)=>Math.min(_,G.node.maxPathLengthBefore),u)-1;F=m[E]}else F=m[0];break}case"justify":{F=k.length===0?m[u-1]:m[w];break}}D.x=F.x,D.size=O;const R=this.getLabelText(this.properties.label,{datum:D.datum,value:D.label,fromKey:s,toKey:n,sizeKey:o,size:O});D.label=String(R),F.nodes.push(A),F.size+=O,A.columnIndex=F.index}),p.forEach(A=>{let D=1/0,T=0;A.linksAfter.forEach(k=>{const w=k.node,{columnIndex:L}=w;L<D?(D=L,T=w.datum.size):L===D&&(T=Math.max(T,w.datum.size))}),A.closestColumnIndex=D,A.maxSizeOfClosestNodesAfter=T});const y=m.reduce((A,{size:D,nodes:T})=>{const k=(1-(T.length-1)*(r/i))/D;return Math.min(A,k)},1/0);for(let A=m.length-1;A>=0;A-=1)m[A].nodes.sort((T,k)=>T.closestColumnIndex-k.closestColumnIndex||T.maxSizeOfClosestNodesAfter-k.maxSizeOfClosestNodesAfter||T.datum.size-k.datum.size);layoutColumns(m,{seriesRectHeight:i,nodeSpacing:r,sizeScale:y});let x=!1;if(p.forEach(({datum:A,linksBefore:D,linksAfter:T})=>{x||(x=A.height<0);const k=A.y+A.height,w=F=>F.sort((R,E)=>{const _=R.node.datum,G=E.node.datum,B=_.y+_.height,z=G.y+G.height,P=Math.atan2(_.y-A.y,Math.abs(_.x-A.x))-Math.atan2(G.y-A.y,Math.abs(G.x-A.x)),V=Math.atan2(B-k,Math.abs(_.x-A.x))-Math.atan2(z-k,Math.abs(G.x-A.x));return P+V});let L=A.y;w(D).forEach(({link:F})=>{F.y2=L,L+=F.size*i*y});let O=A.y;w(T).forEach(({link:F})=>{F.y1=O,O+=F.size*i*y})}),x){logger_exports.warnOnce("There was insufficient space to display the Sankey Series. Reduce the node spacing, or provide a larger container.");return}const b=[],S=[],{fontSize:v}=this.properties.label,I=this.properties.label.getFont();return m.forEach((A,D)=>{const T=D===0,k=D===m.length-1;let w=-1/0;A.nodes.sort((L,O)=>L.datum.y-O.datum.y),A.nodes.forEach(({datum:L})=>{if(L.midPoint={x:L.x+L.width/2,y:L.y+L.height/2},b.push(L),L.label==null)return;const O=T?L.x-a:L.x+L.width+a,F=L.y+L.height/2;let R;if(!T&&!k){const B=F-TextUtils9.getLineHeight(v),z=F+TextUtils9.getLineHeight(v);let P=e;p.forEach(({datum:j})=>{j.x>L.x&&Math.max(j.y,B)<=Math.min(j.y+j.height,z)&&(P=Math.min(P,j.x-a))});const V=P-L.x-2*a;R=TextWrapper7.wrapText(L.label,{maxWidth:V,maxHeight:L.height,font:this.properties.label,textWrap:"never",overflow:"hide"})}if(R==null||R===""){const B=T||k?a:a*2;R=TextWrapper7.wrapText(L.label,{maxWidth:f-B,maxHeight:L.height,font:this.properties.label,textWrap:"never"})}if(R==="")return;const{height:E}=CachedTextMeasurerPool13.measureText(R,{font:I,textAlign:"left",textBaseline:"middle"}),_=F-E/2,G=F+E/2;_>=w&&(S.push({x:O,y:F,leading:T,text:R}),w=G)})}),d.forEach(A=>{const{fromNode:D,toNode:T,size:k}=A;A.height=i*k*y,A.x1=D.x+l,A.x2=T.x,A.midPoint={x:(A.x1+A.x2)/2,y:(A.y1+A.y2)/2+A.height/2},b.push(A)}),{itemId:t,nodeData:b,labelData:S}}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e)}updateLabelNodes(t){const{labelSelection:e}=t,{color:i,fontStyle:s,fontWeight:n,fontSize:o,fontFamily:a}=this.properties.label;e.each((r,{x:l,y:c,leading:h,text:d})=>{r.visible=!0,r.x=l,r.y=c,r.text=d,r.fill=i,r.fontStyle=s,r.fontWeight=n,r.fontSize=o,r.fontFamily=a,r.textAlign=h?"right":"left",r.textBaseline="middle"})}updateNodeSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>createDatumId23([e.type,e.id]))}getBaseNodeStyle(t){const{properties:e}=this,{fill:i,fillOpacity:s,stroke:n,strokeOpacity:o,lineDash:a,lineDashOffset:r}=e.node,l=t?e.highlightStyle.item:void 0;return getShapeStyle19({fill:l?.fill??i,fillOpacity:l?.fillOpacity??s,stroke:l?.stroke??n,strokeOpacity:l?.strokeOpacity??o,strokeWidth:l?.strokeWidth??this.getStrokeWidth(e.node.strokeWidth),lineDash:l?.lineDash??a,lineDashOffset:l?.lineDashOffset??r},e.fillGradientDefaults,e.fillPatternDefaults)}getNodeStyleOverrides(t,e,i,s,n,o,a){const{id:r,properties:l}=this,{fills:c,strokes:h,defaultColorRange:d,defaultPatternFills:u}=l,{itemStyler:p}=l.node,g=o.fill??c[i%c.length],f=o.stroke??h[i%h.length],m=d[i%d.length].map(b=>({color:b})),y=u[i%u.length];let x;if(a||(x??(x={}),x.fill=g,x.stroke=f),p!=null){const b=this.cachedDatumCallback(createDatumId23(t,"node",a?"highlight":"node"),()=>{const{fillOpacity:S=1,strokeOpacity:v=1,strokeWidth:I=0,lineDash:A=[],lineDashOffset:D=0}=o;return this.callWithContext(p,{seriesId:r,datum:e,highlighted:a,label:n,size:s,fill:g,fillOpacity:S,stroke:f,strokeOpacity:v,strokeWidth:I,lineDash:A,lineDashOffset:D})});x??(x={}),Object.assign(x,b)}return getShapeStyle19(x,{...this.properties.fillGradientDefaults.toJson(),colorStops:m},{...this.properties.fillPatternDefaults.toJson(),fill:y,stroke:y})}updateNodeNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getBaseNodeStyle(i),n=this.getShapeFillBBox();e.each((o,a)=>{const{datumIndex:r,size:l,label:c}=a,h=this.getNodeStyleOverrides(String(r.index),a.datum,r.index,l,c,s,i);o.x=a.x,o.y=a.y,o.width=Math.max(a.width,0),o.height=Math.max(a.height,0),applyShapeStyle13(o,s,h,n)})}getShapeFillBBox(){const t=this._nodeDataDependencies?.seriesRectWidth??0,e=this._nodeDataDependencies?.seriesRectHeight??0,i=new BBox26(0,0,t,e);return{series:i,axis:i}}updateLinkSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>createDatumId23([e.type,e.index,e.fromNode.id,e.toNode.id]))}getBaseLinkStyle(t){const{properties:e}=this,{fill:i,fillOpacity:s,stroke:n,strokeOpacity:o,lineDash:a,lineDashOffset:r}=e.link,l=t?e.highlightStyle.item:void 0;return getShapeStyle19({fill:l?.fill??i,fillOpacity:l?.fillOpacity??s,stroke:l?.stroke??n,strokeOpacity:l?.strokeOpacity??o,strokeWidth:l?.strokeWidth??this.getStrokeWidth(e.link.strokeWidth),lineDash:l?.lineDash??a,lineDashOffset:l?.lineDashOffset??r},e.fillGradientDefaults,e.fillPatternDefaults)}getLinkStyleOverrides(t,e,i,s,n){const{id:o,properties:a}=this,{fills:r,strokes:l,defaultColorRange:c,defaultPatternFills:h}=a,{itemStyler:d}=a.link,u=s.fill??r[i%r.length],p=s.stroke??l[i%l.length],g=c[i%c.length].map(y=>({color:y})),f=h[i%h.length];let m;if(n||(m??(m={}),m.fill=u,m.stroke=p),d!=null){const y=this.cachedDatumCallback(createDatumId23(t,"link",n?"highlight":"node"),()=>{const{fillOpacity:x=1,strokeOpacity:b=1,strokeWidth:S=0,lineDash:v=[],lineDashOffset:I=0}=s;return this.callWithContext(d,{seriesId:o,datum:e,highlighted:n,fill:u,fillOpacity:x,stroke:p,strokeOpacity:b,strokeWidth:S,lineDash:v,lineDashOffset:I})});m??(m={}),Object.assign(m,y)}return getShapeStyle19(m,{...this.properties.fillGradientDefaults.toJson(),colorStops:g},{...this.properties.fillPatternDefaults.toJson(),fill:f,stroke:f})}updateLinkNodes(t){const{datumSelection:e,isHighlight:i}=t,s=this.getBaseLinkStyle(i),n=this.getShapeFillBBox();e.each((o,a)=>{const{datumIndex:r}=a,l=a.fromNode.datumIndex,c=this.getLinkStyleOverrides(String(r.index),a.datum,l.index,s,i);o.x1=a.x1,o.y1=a.y1,o.x2=a.x2,o.y2=a.y2,o.height=a.height,applyShapeStyle13(o,s,c,n),o.inset=o.strokeWidth/2})}getTooltipContent(t){const{id:e,linksProcessedData:i,nodesProcessedData:s,properties:n}=this,{fromKey:o,toKey:a,sizeKey:r,sizeName:l,tooltip:c}=n,h=this.contextNodeData?.nodeData.find(m=>m.datumIndex.type===t.type&&m.datumIndex.index===t.index);if(h==null)return;const d=h.type===0?h.fromNode.index:h.index,u=h.type===0?`${h.fromNode.label} - ${h.toNode.label}`:h.label,p=t.type===0?i?.dataSources.get(this.id)?.[t.index]:s?.dataSources.get(this.id)?.[t.index],g=h.size;let f;if(h.type===0){const m=h.fromNode.datumIndex,y=this.getBaseLinkStyle(!1);Object.assign(y,this.getLinkStyleOverrides(String(t.index),p,m.index,y,!1)),f=y}else{const m=h.label,y=this.getBaseNodeStyle(!1);Object.assign(y,this.getNodeStyleOverrides(String(t.index),p,t.index,g,m,y,!1)),f=y}return c.formatTooltip(this.properties,{title:u,symbol:this.legendItemSymbol(h.type,d,f),data:r!=null?[{label:l,fallbackLabel:r,value:String(g)}]:[]},{seriesId:e,datum:p,title:u,fromKey:o,toKey:a,sizeKey:r,sizeName:l,size:g,...f})}computeFocusBounds(t){if(t instanceof Rect10){const{x:e,y:i,width:s,height:n}=t,o=new BBox26(e,i,s,n);return Transformable4.toCanvas(this.contentGroup,o)}return t}};SankeySeries.className="SankeySeries",SankeySeries.type="sankey";var{commonSeriesOptionsDefs:commonSeriesOptionsDefs24,seriesLabelOptionsDefs:seriesLabelOptionsDefs18,tooltipOptionsDefs:tooltipOptionsDefs23}=module_support_exports,sankeySeriesOptionsDef={type:required(constant("sankey")),fromKey:required(string),toKey:required(string),sizeKey:string,sizeName:string,fills:arrayOf(colorUnion),strokes:arrayOf(color),label:{...seriesLabelOptionsDefs18,spacing:positiveNumber},link:{itemStyler:callback,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},node:{width:positiveNumber,spacing:positiveNumber,alignment:union("left","center","right","justify"),itemStyler:callback,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},tooltip:tooltipOptionsDefs23,...commonSeriesOptionsDefs24};sankeySeriesOptionsDef.fillGradientDefaults=fillGradientDefaults,sankeySeriesOptionsDef.fillPatternDefaults=fillPatternDefaults,sankeySeriesOptionsDef.defaultColorRange=arrayOf(arrayOf(color)),sankeySeriesOptionsDef.defaultPatternFills=arrayOf(color);var SankeyModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["flow-proportion"],solo:!0,identifier:"sankey",moduleFactory:t=>new SankeySeries(t),tooltipDefaults:{range:"exact"},themeTemplate:{seriesArea:{padding:{top:10,bottom:10}},series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:module_support_exports.FILL_PATTERN_DEFAULTS,defaultColorRange:{$palette:"gradients"},defaultPatternFills:module_support_exports.SAFE_FILLS_OPERATION,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}}},SankeySeriesModule={type:"series",name:"sankey",chartType:"flow-proportion",enterprise:!0,options:sankeySeriesOptionsDef,create:t=>new SankeySeries(t)},{HierarchySeriesProperties:HierarchySeriesProperties2,HighlightStyle:HighlightStyle2,SeriesTooltip:SeriesTooltip24,TempValidate:TempValidate83,COLOR_STRING:COLOR_STRING33,FUNCTION:FUNCTION24,NUMBER:NUMBER24,OBJECT:OBJECT48,POSITIVE_NUMBER:POSITIVE_NUMBER39,RATIO:RATIO37,STRING:STRING44}=module_support_exports,SunburstSeriesTileHighlightStyle=class extends HighlightStyle2{constructor(){super(...arguments),this.label=new AutoSizedLabel,this.secondaryLabel=new AutoSizedLabel}};__decorateClass([TempValidate83(STRING44,{optional:!0})],SunburstSeriesTileHighlightStyle.prototype,"fill",2),__decorateClass([TempValidate83(RATIO37,{optional:!0})],SunburstSeriesTileHighlightStyle.prototype,"fillOpacity",2),__decorateClass([TempValidate83(COLOR_STRING33,{optional:!0})],SunburstSeriesTileHighlightStyle.prototype,"stroke",2),__decorateClass([TempValidate83(POSITIVE_NUMBER39,{optional:!0})],SunburstSeriesTileHighlightStyle.prototype,"strokeWidth",2),__decorateClass([TempValidate83(RATIO37,{optional:!0})],SunburstSeriesTileHighlightStyle.prototype,"strokeOpacity",2),__decorateClass([TempValidate83(OBJECT48)],SunburstSeriesTileHighlightStyle.prototype,"label",2),__decorateClass([TempValidate83(OBJECT48)],SunburstSeriesTileHighlightStyle.prototype,"secondaryLabel",2);var SunburstSeriesProperties=class extends HierarchySeriesProperties2{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=0,this.strokeOpacity=1,this.cornerRadius=0,this.highlightStyle=new SunburstSeriesTileHighlightStyle,this.label=new AutoSizedLabel,this.secondaryLabel=new AutoSizedSecondaryLabel,this.tooltip=new SeriesTooltip24}};__decorateClass([TempValidate83(STRING44,{optional:!0})],SunburstSeriesProperties.prototype,"sizeName",2),__decorateClass([TempValidate83(STRING44,{optional:!0})],SunburstSeriesProperties.prototype,"labelKey",2),__decorateClass([TempValidate83(STRING44,{optional:!0})],SunburstSeriesProperties.prototype,"secondaryLabelKey",2),__decorateClass([TempValidate83(RATIO37)],SunburstSeriesProperties.prototype,"fillOpacity",2),__decorateClass([TempValidate83(POSITIVE_NUMBER39)],SunburstSeriesProperties.prototype,"strokeWidth",2),__decorateClass([TempValidate83(RATIO37)],SunburstSeriesProperties.prototype,"strokeOpacity",2),__decorateClass([TempValidate83(POSITIVE_NUMBER39)],SunburstSeriesProperties.prototype,"cornerRadius",2),__decorateClass([TempValidate83(NUMBER24,{optional:!0})],SunburstSeriesProperties.prototype,"sectorSpacing",2),__decorateClass([TempValidate83(NUMBER24,{optional:!0})],SunburstSeriesProperties.prototype,"padding",2),__decorateClass([TempValidate83(FUNCTION24,{optional:!0})],SunburstSeriesProperties.prototype,"itemStyler",2),__decorateClass([TempValidate83(OBJECT48)],SunburstSeriesProperties.prototype,"highlightStyle",2),__decorateClass([TempValidate83(OBJECT48)],SunburstSeriesProperties.prototype,"label",2),__decorateClass([TempValidate83(OBJECT48)],SunburstSeriesProperties.prototype,"secondaryLabel",2),__decorateClass([TempValidate83(OBJECT48)],SunburstSeriesProperties.prototype,"tooltip",2);var{fromToMotion:fromToMotion7,normalizeAngle360:normalizeAngle3609,createDatumId:createDatumId24,Sector:Sector8,Group:Group22,ScalableGroup:ScalableGroup3,Selection:Selection17,TransformableText:TransformableText4,BBox:BBox27,applyShapeStyle:applyShapeStyle14,getShapeStyle:getShapeStyle20}=module_support_exports,SunburstNode=class extends module_support_exports.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 setAngleData(t,e=0,i=2*Math.PI/t.sumSize){for(const s of t.children){const n=e+s.sumSize*i;s.startAngle=e,s.endAngle=n,setAngleData(s,e,i),e=n}}var SunburstSeries=class extends module_support_exports.HierarchySeries{constructor(){super(...arguments),this.NodeClass=SunburstNode,this.properties=new SunburstSeriesProperties,this.scalingGroup=this.contentGroup.appendChild(new ScalableGroup3),this.sectorGroup=this.scalingGroup.appendChild(new Group22),this.sectorLabelGroup=this.scalingGroup.appendChild(new Group22),this.highlightSectorGroup=this.scalingGroup.appendChild(new Group22),this.datumSelection=Selection17.select(this.sectorGroup,Sector8),this.labelSelection=Selection17.select(this.sectorLabelGroup,Group22),this.highlightSelection=Selection17.select(this.highlightSectorGroup,Sector8)}processData(){super.processData(),setAngleData(this.rootNode)}updateSelections(){const t=this.ctx.highlightManager?.getActiveHighlight();if(this.highlightSelection.update(t!=null?[t]:[],void 0,o=>this.getDatumId(o)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{chart:e}=this;if(e==null||e.seriesRect==null)return;const s=Array.from(this.rootNode),n=o=>{o.append([new TransformableText4({tag:0}),new TransformableText4({tag:1})])};this.datumSelection.update(s,void 0,o=>this.getDatumId(o)),this.labelSelection.update(s,n,o=>this.getDatumId(o))}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle:void 0;return getShapeStyle20({fill:i?.fill,fillOpacity:i?.fillOpacity??e.fillOpacity,stroke:i?.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity},e.fillGradientDefaults,e.fillPatternDefaults)}getItemStyleOverrides(t,e,i,s,n,o){const{id:a,properties:r,colorScale:l}=this,{fills:c,strokes:h,itemStyler:d}=r,u=t[0],p=n.fill??c[u%c.length],g=n.stroke??h[u%h.length],f={};if(o||(f.fill=s!=null?l.convert(s):p,f.stroke=g),d!=null){const m=this.cachedDatumCallback(createDatumId24(t.join(":"),o?"highlight":"node"),()=>this.callWithContext(d,{seriesId:a,datum:e,depth:i,highlighted:o,fill:p,stroke:g,...n}));Object.assign(f,m)}return getShapeStyle20(f,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}updateNodes(){const{chart:t,data:e,maxDepth:i}=this;if(t==null||e==null)return;const{width:s,height:n}=t.seriesRect,{sectorSpacing:o=0,padding:a=0,cornerRadius:r,childrenKey:l,colorKey:c,colorName:h,labelKey:d,secondaryLabelKey:u,sizeKey:p,sizeName:g}=this.properties;this.contentGroup.translationX=s/2,this.contentGroup.translationY=n/2;const f=o*.5,m=Math.min(s,n)/2,y=m/(i+1),x=-Math.PI/2,b={series:new BBox27(-m,-m,2*m,2*m),axis:new BBox27(-m,-m,2*m,2*m)};this.rootNode?.walk(T=>{const{startAngle:k,endAngle:w}=T;if(T.depth!=null){const L=(k+w)/2+x,O=(T.depth+.5)*y;T.midPoint.x=Math.cos(L)*O,T.midPoint.y=Math.sin(L)*O}}),this.rootNode?.walk(T=>{const{datum:k,depth:w,startAngle:L,endAngle:O,parent:F,sumSize:R}=T;T.label=void 0,T.secondaryLabel=void 0,T.contentHeight=0;let E;if(k!=null&&w!=null&&d!=null){const et=k[d];E=this.getLabelText(this.properties.label,{depth:w,datum:k,childrenKey:l,colorKey:c,colorName:h,labelKey:d,secondaryLabelKey:u,sizeKey:p,sizeName:g,value:et})}E===""&&(E=void 0);let _;if(k!=null&&w!=null&&u!=null){const et=k[u];_=this.getLabelText(this.properties.secondaryLabel,{depth:w,datum:k,childrenKey:l,colorKey:c,colorName:h,labelKey:d,secondaryLabelKey:u,sizeKey:p,sizeName:g,value:et})}if(_===""&&(_=void 0),w==null)return;const G=w*y+f,B=(w+1)*y-f,z=G>f?f/G:f,P=B>f?f/B:f,V=L+z,H=O+z-V,Y=L+P,$=O+P-Y,W=et=>{if(w===0&&F?.sumSize===R)return{width:2*Math.sqrt(B**2-(et*.5)**2),height:et,meta:0};const rt=et,ut=2*Math.sqrt(B**2-(G+rt)**2),pt=H<Math.PI?2*G*Math.tan(H*.5):1/0,yt=Math.min(ut,pt),Dt=Math.PI/4;let xt,St;return w===0?(xt=et,St=Math.sqrt(B**2-(xt/2)**2)-et/(2*Math.tan($*.5))):normalizeAngle3609(H)<Dt?(xt=2*G*Math.tan(H*.5),St=Math.sqrt(B**2-(xt/2)**2)-G):(St=0,xt=0),yt>=St?{width:yt,height:rt,meta:1}:{width:St,height:xt,meta:2}},X=formatLabels(E,this.properties.label,_,this.properties.secondaryLabel,{padding:a},W);if(X==null)return;const{width:Z,height:q,meta:Q,label:tt,secondaryLabel:it}=X,J=x+(L+O)/2,at=Math.sin(J)>=0,lt=Math.cos(J)>=0,nt=(at?3:12)&(lt?6:9);let ot;switch(Q){case 0:ot=0;break;case 1:{const st=B-(y-q)*.58,rt=Math.sqrt((B-a)**2-(Z/2)**2);ot=Math.min(st,rt);break}case 2:if(w===0){const et=q/(2*Math.tan(H*.5))+Z*.5,st=Math.sqrt(B**2-(q*.5)**2)-Z*.5;ot=(et+st)*.5}else ot=(G+B)*.5;break}if(tt!=null){const{fontStyle:et="normal",fontFamily:st,fontWeight:rt="normal",color:ut="black"}=this.properties.label;T.label={...tt,fontStyle:et,fontFamily:st,fontWeight:rt,color:ut,labelPlacement:Q,circleQuarter:nt,radius:ot,theta:J}}if(it!=null){const{fontStyle:et="normal",fontFamily:st,fontWeight:rt="normal",color:ut="black"}=this.properties.secondaryLabel;T.secondaryLabel={...it,fontStyle:et,fontFamily:st,fontWeight:rt,color:ut,labelPlacement:Q,circleQuarter:nt,radius:ot,theta:J}}T.contentHeight=X.height});const S=(T,k,w,L)=>{const{datum:O,datumIndex:F,depth:R,colorValue:E,startAngle:_,endAngle:G}=T;if(R==null){k.visible=!1;return}k.visible=!0;const B=this.getItemStyleOverrides(F,O,R,E,w,L),z=B.fill??w.fill,P=B.strokeWidth??w.strokeWidth,V=module_support_exports.isGradientFill(z)&&z.bounds!=="item"?b:void 0;applyShapeStyle14(k,w,B,V),k.centerX=0,k.centerY=0,k.innerRadius=R*y,k.outerRadius=(R+1)*y,k.startAngle=_+x,k.endAngle=G+x,k.inset=f+P*.5,k.cornerRadius=r},v=this.getItemBaseStyle(!1);this.datumSelection.each((T,k)=>{S(k,T,v,!1)});const I=this.getItemBaseStyle(!0);this.highlightSelection.each((T,k)=>{S(k,T,I,!0)});const A=(T,k,w,L)=>{const{depth:O,contentHeight:F}=T,R=w===0,E=R?T.label:T.secondaryLabel;if(O==null||E==null){k.visible=!1;return}const{labelPlacement:_,circleQuarter:G,radius:B,theta:z}=E;let P;switch(L&&(P=(R?this.properties.highlightStyle.label:this.properties.highlightStyle.secondaryLabel).color),k.text=E.text,k.fontSize=E.fontSize,k.lineHeight=E.lineHeight,k.fontStyle=E.fontStyle,k.fontFamily=E.fontFamily,k.fontWeight=E.fontWeight,k.fill=P??E.color,_){case 0:k.textAlign="center",k.textBaseline="top",k.translationX=0,k.translationY=(R?0:F-E.height)-F*.5,k.rotation=0;break;case 1:{const V=(G&3)!==0,j=R===!V?B:B-(F-E.height);k.textAlign="center",k.textBaseline=V?"bottom":"top",k.translationX=Math.cos(z)*j,k.translationY=Math.sin(z)*j,k.rotation=V?z-Math.PI*.5:z+Math.PI*.5;break}case 2:{const V=(G&6)!==0,j=R===!V?(F-E.height)*.5:(E.height-F)*.5;k.textAlign="center",k.textBaseline="middle",k.translationX=Math.cos(z)*B+Math.cos(z+Math.PI/2)*j,k.translationY=Math.sin(z)*B+Math.sin(z+Math.PI/2)*j,k.rotation=V?z:z+Math.PI;break}}k.visible=!0},D=this.ctx.highlightManager?.getActiveHighlight();this.labelSelection.selectByClass(TransformableText4).forEach(T=>{const k=T.closestDatum();A(k,T,T.tag,k===D)})}getTooltipContent(t){const{id:e,properties:i}=this,{labelKey:s,secondaryLabelKey:n,childrenKey:o,sizeKey:a,sizeName:r,colorKey:l,colorName:c,tooltip:h}=i,d=t.reduce((S,v)=>S?.children[v],this.rootNode);if(d==null)return;const{datum:u,depth:p}=d;if(u==null||p==null)return;const g=[],f=a!=null?u[a]:void 0;f!=null&&g.push({label:r,fallbackLabel:a,value:f});const m=l!=null?u[l]:void 0;m!=null&&g.push({label:c,fallbackLabel:l,value:m});const y=this.getItemBaseStyle(!1);Object.assign(y,this.getItemStyleOverrides(t,u,p,m,y,!1));const x=y.fill,b=getShapeStyle20({shape:"square",fill:x,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0},i.fillGradientDefaults,i.fillPatternDefaults);return module_support_exports.isGradientFill(b.fill)&&(b.fill={...b.fill,gradient:"linear",rotation:0,reverse:!1}),h.formatTooltip(i,{title:s!=null?u[s]:void 0,symbol:{marker:b},data:g},{seriesId:e,datum:u,title:void 0,depth:p,labelKey:s,secondaryLabelKey:n,childrenKey:o,sizeKey:a,sizeName:r,colorKey:l,colorName:c,...y})}createNodeData(){}pickNodeClosestDatum(t){return this.pickNodeNearestDistantObject(t,this.datumSelection.selectByClass(Sector8))}animateEmptyUpdateReady(){fromToMotion7(this.id,"nodes",this.ctx.animationManager,[this.scalingGroup],{toFn(){return{scalingX:1,scalingY:1}},fromFn(){return{scalingX:0,scalingY:0}}})}computeFocusBounds(t){return t}};SunburstSeries.className="SunburstSeries",SunburstSeries.type="sunburst";var{commonSeriesOptionsDefs:commonSeriesOptionsDefs25,autoSizedLabelOptionsDefs:autoSizedLabelOptionsDefs6,tooltipOptionsDefs:tooltipOptionsDefs24,without:without7}=module_support_exports,sunburstSeriesOptionsDef={type:required(constant("sunburst")),labelKey:string,secondaryLabelKey:string,childrenKey:string,sizeKey:string,colorKey:string,sizeName:string,colorName:string,fills:arrayOf(colorUnion),strokes:arrayOf(color),colorRange:arrayOf(color),sectorSpacing:positiveNumber,cornerRadius:positiveNumber,padding:positiveNumber,itemStyler:callback,label:{spacing:positiveNumber,...autoSizedLabelOptionsDefs6},secondaryLabel:autoSizedLabelOptionsDefs6,tooltip:tooltipOptionsDefs24,...commonSeriesOptionsDefs25,...without7(fillOptionsDef,["fill"]),...without7(strokeOptionsDef,["stroke"]),highlightStyle:{label:{color},secondaryLabel:{color},...fillOptionsDef,...strokeOptionsDef}},{FONT_SIZE_RATIO:FONT_SIZE_RATIO4}=module_support_exports,SunburstModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["hierarchy"],identifier:"sunburst",moduleFactory:t=>new SunburstSeries(t),tooltipDefaults:{range:"exact"},solo:!0,themeTemplate:{series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},colorRange:{$palette:"divergingColors"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"series",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:module_support_exports.FILL_PATTERN_DEFAULTS,label:{fontFamily:{$ref:"fontFamily"},fontSize:{$rem:[FONT_SIZE_RATIO4.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:[FONT_SIZE_RATIO4.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}}},SunburstSeriesModule={type:"series",name:"sunburst",chartType:"hierarchy",enterprise:!0,options:sunburstSeriesOptionsDef,create:t=>new SunburstSeries(t)},{BaseProperties:BaseProperties30,HierarchySeriesProperties:HierarchySeriesProperties3,HighlightStyle:HighlightStyle3,SeriesTooltip:SeriesTooltip25,TempValidate:TempValidate84,BOOLEAN:BOOLEAN37,COLOR_STRING:COLOR_STRING34,FUNCTION:FUNCTION25,NUMBER:NUMBER25,OBJECT:OBJECT49,POSITIVE_NUMBER:POSITIVE_NUMBER40,RATIO:RATIO38,STRING:STRING45,STRING_ARRAY:STRING_ARRAY2,TEXT_ALIGN:TEXT_ALIGN4,VERTICAL_ALIGN:VERTICAL_ALIGN3,COLOR_GRADIENT:COLOR_GRADIENT18,COLOR_PATTERN:COLOR_PATTERN18,OR:OR23,Label:Label19}=module_support_exports,TreemapGroupLabel=class extends Label19{constructor(){super(...arguments),this.spacing=0}};__decorateClass([TempValidate84(NUMBER25)],TreemapGroupLabel.prototype,"spacing",2);var TreemapSeriesGroup=class extends BaseProperties30{constructor(){super(...arguments),this.fill=void 0,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 TreemapGroupLabel}};__decorateClass([TempValidate84(OR23(COLOR_GRADIENT18,COLOR_STRING34,COLOR_PATTERN18),{optional:!0})],TreemapSeriesGroup.prototype,"fill",2),__decorateClass([TempValidate84(RATIO38)],TreemapSeriesGroup.prototype,"fillOpacity",2),__decorateClass([TempValidate84(COLOR_STRING34,{optional:!0})],TreemapSeriesGroup.prototype,"stroke",2),__decorateClass([TempValidate84(POSITIVE_NUMBER40)],TreemapSeriesGroup.prototype,"strokeWidth",2),__decorateClass([TempValidate84(RATIO38)],TreemapSeriesGroup.prototype,"strokeOpacity",2),__decorateClass([TempValidate84(POSITIVE_NUMBER40)],TreemapSeriesGroup.prototype,"cornerRadius",2),__decorateClass([TempValidate84(TEXT_ALIGN4)],TreemapSeriesGroup.prototype,"textAlign",2),__decorateClass([TempValidate84(POSITIVE_NUMBER40)],TreemapSeriesGroup.prototype,"gap",2),__decorateClass([TempValidate84(POSITIVE_NUMBER40)],TreemapSeriesGroup.prototype,"padding",2),__decorateClass([TempValidate84(BOOLEAN37)],TreemapSeriesGroup.prototype,"interactive",2),__decorateClass([TempValidate84(OBJECT49)],TreemapSeriesGroup.prototype,"label",2);var TreemapSeriesTile=class extends BaseProperties30{constructor(){super(...arguments),this.fill=void 0,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 AutoSizedLabel,this.secondaryLabel=new AutoSizedSecondaryLabel}};__decorateClass([TempValidate84(OR23(COLOR_GRADIENT18,COLOR_STRING34,COLOR_PATTERN18),{optional:!0})],TreemapSeriesTile.prototype,"fill",2),__decorateClass([TempValidate84(RATIO38)],TreemapSeriesTile.prototype,"fillOpacity",2),__decorateClass([TempValidate84(COLOR_STRING34,{optional:!0})],TreemapSeriesTile.prototype,"stroke",2),__decorateClass([TempValidate84(POSITIVE_NUMBER40,{optional:!0})],TreemapSeriesTile.prototype,"strokeWidth",2),__decorateClass([TempValidate84(RATIO38)],TreemapSeriesTile.prototype,"strokeOpacity",2),__decorateClass([TempValidate84(POSITIVE_NUMBER40)],TreemapSeriesTile.prototype,"cornerRadius",2),__decorateClass([TempValidate84(TEXT_ALIGN4)],TreemapSeriesTile.prototype,"textAlign",2),__decorateClass([TempValidate84(VERTICAL_ALIGN3)],TreemapSeriesTile.prototype,"verticalAlign",2),__decorateClass([TempValidate84(POSITIVE_NUMBER40)],TreemapSeriesTile.prototype,"gap",2),__decorateClass([TempValidate84(POSITIVE_NUMBER40)],TreemapSeriesTile.prototype,"padding",2),__decorateClass([TempValidate84(OBJECT49)],TreemapSeriesTile.prototype,"label",2),__decorateClass([TempValidate84(OBJECT49)],TreemapSeriesTile.prototype,"secondaryLabel",2);var TreemapSeriesGroupHighlightStyle=class extends BaseProperties30{constructor(){super(...arguments),this.label=new AutoSizedLabel}};__decorateClass([TempValidate84(STRING45,{optional:!0})],TreemapSeriesGroupHighlightStyle.prototype,"fill",2),__decorateClass([TempValidate84(RATIO38,{optional:!0})],TreemapSeriesGroupHighlightStyle.prototype,"fillOpacity",2),__decorateClass([TempValidate84(COLOR_STRING34,{optional:!0})],TreemapSeriesGroupHighlightStyle.prototype,"stroke",2),__decorateClass([TempValidate84(POSITIVE_NUMBER40,{optional:!0})],TreemapSeriesGroupHighlightStyle.prototype,"strokeWidth",2),__decorateClass([TempValidate84(RATIO38,{optional:!0})],TreemapSeriesGroupHighlightStyle.prototype,"strokeOpacity",2),__decorateClass([TempValidate84(OBJECT49)],TreemapSeriesGroupHighlightStyle.prototype,"label",2);var TreemapSeriesTileHighlightStyle=class extends BaseProperties30{constructor(){super(...arguments),this.label=new AutoSizedLabel,this.secondaryLabel=new AutoSizedSecondaryLabel}};__decorateClass([TempValidate84(STRING45,{optional:!0})],TreemapSeriesTileHighlightStyle.prototype,"fill",2),__decorateClass([TempValidate84(RATIO38,{optional:!0})],TreemapSeriesTileHighlightStyle.prototype,"fillOpacity",2),__decorateClass([TempValidate84(COLOR_STRING34,{optional:!0})],TreemapSeriesTileHighlightStyle.prototype,"stroke",2),__decorateClass([TempValidate84(POSITIVE_NUMBER40,{optional:!0})],TreemapSeriesTileHighlightStyle.prototype,"strokeWidth",2),__decorateClass([TempValidate84(RATIO38,{optional:!0})],TreemapSeriesTileHighlightStyle.prototype,"strokeOpacity",2),__decorateClass([TempValidate84(OBJECT49)],TreemapSeriesTileHighlightStyle.prototype,"label",2),__decorateClass([TempValidate84(OBJECT49)],TreemapSeriesTileHighlightStyle.prototype,"secondaryLabel",2);var TreemapSeriesHighlightStyle=class extends HighlightStyle3{constructor(){super(...arguments),this.group=new TreemapSeriesGroupHighlightStyle,this.tile=new TreemapSeriesTileHighlightStyle}};__decorateClass([TempValidate84(OBJECT49)],TreemapSeriesHighlightStyle.prototype,"group",2),__decorateClass([TempValidate84(OBJECT49)],TreemapSeriesHighlightStyle.prototype,"tile",2);var TreemapSeriesProperties=class extends HierarchySeriesProperties3{constructor(){super(...arguments),this.highlightStyle=new TreemapSeriesHighlightStyle,this.tooltip=new SeriesTooltip25,this.group=new TreemapSeriesGroup,this.tile=new TreemapSeriesTile,this.undocumentedGroupFills=[],this.undocumentedGroupStrokes=[]}};__decorateClass([TempValidate84(STRING45,{optional:!0})],TreemapSeriesProperties.prototype,"sizeName",2),__decorateClass([TempValidate84(STRING45,{optional:!0})],TreemapSeriesProperties.prototype,"labelKey",2),__decorateClass([TempValidate84(STRING45,{optional:!0})],TreemapSeriesProperties.prototype,"secondaryLabelKey",2),__decorateClass([TempValidate84(FUNCTION25,{optional:!0})],TreemapSeriesProperties.prototype,"itemStyler",2),__decorateClass([TempValidate84(OBJECT49)],TreemapSeriesProperties.prototype,"highlightStyle",2),__decorateClass([TempValidate84(OBJECT49)],TreemapSeriesProperties.prototype,"tooltip",2),__decorateClass([TempValidate84(OBJECT49)],TreemapSeriesProperties.prototype,"group",2),__decorateClass([TempValidate84(OBJECT49)],TreemapSeriesProperties.prototype,"tile",2),__decorateClass([TempValidate84(STRING_ARRAY2)],TreemapSeriesProperties.prototype,"undocumentedGroupFills",2),__decorateClass([TempValidate84(STRING_ARRAY2)],TreemapSeriesProperties.prototype,"undocumentedGroupStrokes",2);var{TextUtils:TextUtils10,TextWrapper:TextWrapper8,createDatumId:createDatumId25,Rect:Rect11,Group:Group23,BBox:BBox28,Selection:Selection18,Text:Text10,Transformable:Transformable5,applyShapeStyle:applyShapeStyle15,getShapeStyle:getShapeStyle21}=module_support_exports,TreemapNode=class extends module_support_exports.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}},tempText=new Text10;function getTextSize(t,e){const{fontStyle:i,fontWeight:s,fontSize:n,fontFamily:o}=e;tempText.setProperties({text:t,fontStyle:i,fontWeight:s,fontSize:n,fontFamily:o,textAlign:"left",textBaseline:"top"});const{width:a,height:r}=tempText.getBBox();return{width:a,height:r}}function nodeSize(t){return t.children.length>0?t.sumSize-t.sizeValue:t.sizeValue}var textAlignFactors2={left:0,center:.5,right:1},verticalAlignFactors4={top:0,middle:.5,bottom:1},DistantGroup=class extends module_support_exports.Group{distanceSquared(t,e){return this.getBBox().distanceSquared(t,e)}},TreemapSeries=class extends module_support_exports.HierarchySeries{constructor(){super(...arguments),this.NodeClass=TreemapNode,this.properties=new TreemapSeriesProperties,this.rectGroup=this.contentGroup.appendChild(new Group23),this.datumSelection=Selection18.select(this.rectGroup,Rect11),this.labelSelection=Selection18.select(this.labelGroup,Group23),this.highlightSelection=Selection18.select(this.rectGroup,Rect11)}groupTitleHeight(t,e){const{labelValue:i}=t,{label:s}=this.properties.group,n=3;if(i!=null){if(s.fontSize>e.width/n||s.fontSize>e.height/n)return;{const{height:o}=getTextSize(i,s);return Math.max(o,s.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:s}=this.properties.group,n=this.groupTitleHeight(t,e),o=n!=null?n+i:0;return{top:s+o,right:s,bottom:s,left:s}}sortChildren({children:t}){const e=Array.from(t,(s,n)=>n).filter(s=>nodeSize(t[s])>0).sort((s,n)=>nodeSize(t[n])-nodeSize(t[s]));return{sortedChildrenIndices:e,childAt:s=>{const n=e[s];return t[n]}}}squarify(t,e){const{datum:i,children:s}=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 n=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=n,t.midPoint.x=e.x+e.width/2,t.midPoint.y=e.y);const{sortedChildrenIndices:o,childAt:a}=this.sortChildren(t),r=o.every(v=>s[v].children.length===0),l=1,c=e.width-n.left-n.right,h=e.height-n.top-n.bottom;if(c<=0||h<=0)return;const d=o.length;let u=0,p=0,g=1/0,f=o.reduce((v,I)=>v+nodeSize(s[I]),0);const m=new BBox28(e.x+n.left,e.y+n.top,c,h),y=m.clone();let x=0;for(;x<d;){const v=nodeSize(a(x)),I=nodeSize(a(p)),A=y.width<y.height;u+=v;const D=A?y.height:y.width,T=A?y.width:y.height,k=T*I/u;let w=D*u/f;const L=Math.max(k,w)/Math.min(k,w),O=Math.abs(l-L);if(O<g){g=O,x++;continue}u-=v,w=D*u/f;let F=A?y.x:y.y;for(let R=p;R<x;R++){const E=a(R),_=nodeSize(E),G=A?F:y.x,B=A?y.y:F,z=T*_/u,P=A?z:w,V=A?w:z,j=new BBox28(G,B,P,V);this.applyGap(m,j,r),this.squarify(E,j),f-=_,F+=z}A?(y.y+=w,y.height-=w):(y.x+=w,y.width-=w),p=x,u=0,g=1/0}const b=y.width<y.height;let S=b?y.x:y.y;for(let v=p;v<d;v++){const I=a(v),A=b?S:y.x,D=b?y.y:S,T=nodeSize(I)/f,k=y.width*(b?T:1),w=y.height*(b?1:T),L=new BBox28(A,D,k,w);this.applyGap(m,L,r),this.squarify(I,L),S+=b?k:w}}applyGap(t,e,i){const s=i?this.properties.tile.gap*.5:this.properties.group.gap*.5,n=l=>({left:l.x,top:l.y,right:l.x+l.width,bottom:l.y+l.height}),o=n(t),a=n(e);["top","right","bottom","left"].forEach(l=>{isNumberEqual(o[l],a[l])||e.shrink(s,l)})}createNodeData(){}getGroupBaseStyle(t){const{properties:e}=this,{group:i}=e,s=t?e.highlightStyle.group:void 0;return getShapeStyle21({fill:s?.fill??i.fill,fillOpacity:s?.fillOpacity??i.fillOpacity,stroke:s?.stroke??i.stroke,strokeWidth:s?.strokeWidth??i.strokeWidth,strokeOpacity:s?.strokeOpacity??i.strokeOpacity},e.fillGradientDefaults,e.fillPatternDefaults)}getGroupStyleOverrides(t,e,i,s,n){const{id:o,properties:a}=this,{undocumentedGroupFills:r,undocumentedGroupStrokes:l,itemStyler:c}=a,h=s.fill??r[Math.min(i??0,r.length)],d=s.stroke??l[Math.min(i??0,l.length)],u={};if(n||(u.fill=h,u.stroke=d),c!=null){const p=this.cachedDatumCallback(createDatumId25(t.join(":"),n?"highlight":"node"),()=>this.callWithContext(c,{seriesId:o,datum:e,depth:i,highlighted:n,fill:h,stroke:d,...s}));Object.assign(u,p)}return getShapeStyle21(u,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}getTileBaseStyle(t){const{properties:e}=this,{tile:i}=e,s=t?e.highlightStyle.tile:void 0;return getShapeStyle21({fill:s?.fill??i.fill,fillOpacity:s?.fillOpacity??i.fillOpacity,stroke:s?.stroke??i.stroke,strokeWidth:s?.strokeWidth??i.strokeWidth,strokeOpacity:s?.strokeOpacity??i.strokeOpacity},e.fillGradientDefaults,e.fillPatternDefaults)}getTileStyleOverrides(t,e,i,s,n,o){const{id:a,properties:r,colorScale:l}=this,{fills:c,strokes:h,itemStyler:d}=r,u=t[0],p=n.fill??c[u%c.length],g=n.stroke??h[u%h.length],f={};if(o||(f.fill=s!=null?l.convert(s):p,f.stroke=g),d!=null){const m=this.cachedDatumCallback(createDatumId25(t.join(":"),o?"highlight":"node"),()=>this.callWithContext(d,{seriesId:a,datum:e,depth:i,highlighted:o,fill:p,stroke:g,...n}));Object.assign(f,m)}return getShapeStyle21(f,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults)}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,n=>this.getDatumId(n)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{seriesRect:e}=this.chart??{};if(!e)return;const i=Array.from(this.rootNode),s=n=>{n.append([new Text10({tag:0}),new Text10({tag:1})])};this.datumSelection.update(i,void 0,n=>this.getDatumId(n)),this.labelSelection.update(i,s,n=>this.getDatumId(n))}updateNodes(){const{rootNode:t,data:e}=this,{childrenKey:i,colorKey:s,colorName:n,labelKey:o,secondaryLabelKey:a,sizeKey:r,sizeName:l,highlightStyle:c,tile:h,group:d}=this.properties,{seriesRect:u}=this.chart??{};if(!u||!e)return;this.rootNode?.walk(A=>{const{datum:D,depth:T,children:k}=A,w=k.length===0,L=w?h.label:d.label;let O;if(D!=null&&T!=null&&o!=null){const R=D[o];O=this.getLabelText(L,{depth:T,datum:D,childrenKey:i,colorKey:s,colorName:n,labelKey:o,secondaryLabelKey:a,sizeKey:r,sizeName:l,value:R})}O===""&&(O=void 0);let F;if(w&&D!=null&&T!=null&&a!=null){const R=D[a];F=this.getLabelText(h.secondaryLabel,{depth:T,datum:D,childrenKey:i,colorKey:s,colorName:n,labelKey:o,secondaryLabelKey:a,sizeKey:r,sizeName:l,value:R})}F===""&&(F=void 0),A.labelValue=O,A.secondaryLabelValue=F});const{width:p,height:g}=u;this.squarify(t,new BBox28(0,0,p,g)),this.rootNode?.walk(A=>{const{bbox:D,children:T,labelValue:k,secondaryLabelValue:w}=A;if(A.label=void 0,A.secondaryLabel=void 0,D!=null)if(T.length===0){const L={width:D.width,height:D.height,meta:null},O=formatLabels(k,this.properties.tile.label,w,this.properties.tile.secondaryLabel,{padding:h.padding},()=>L);if(O==null)return;const{height:F,label:R,secondaryLabel:E}=O,{textAlign:_,verticalAlign:G,padding:B}=h,z=textAlignFactors2[_]??.5,P=D.x+B+(D.width-2*B)*z,V=verticalAlignFactors4[G]??.5,j=D.y+B+F*.5+(D.height-2*B-F)*V;if(R!=null){const{fontStyle:H="normal",fontFamily:Y,fontWeight:U="normal",color:$="black"}=this.properties.tile.label;A.label={text:R.text,fontSize:R.fontSize,lineHeight:R.lineHeight,fontStyle:H,fontFamily:Y,fontWeight:U,color:$,textAlign:_,verticalAlign:"middle",x:P,y:j-(F-R.height)*.5}}if(E!=null){const{fontStyle:H="normal",fontFamily:Y,fontWeight:U="normal",color:$="black"}=this.properties.tile.secondaryLabel;A.secondaryLabel={text:E.text,fontSize:E.fontSize,lineHeight:E.fontSize,fontStyle:H,fontFamily:Y,fontWeight:U,color:$,textAlign:_,verticalAlign:"middle",x:P,y:j+(F-E.height)*.5}}}else{if(k==null)return;{const{padding:L,textAlign:O}=d,F=this.groupTitleHeight(A,D);if(F==null)return;const R=D.width-2*L,E=TextWrapper8.wrapText(k,{maxWidth:D.width-2*L,font:d.label,textWrap:"never"}),_=textAlignFactors2[O]??.5,{fontStyle:G="normal",fontFamily:B,fontWeight:z="normal",color:P="black"}=this.properties.group.label;A.label={text:E,fontSize:d.label.fontSize,lineHeight:TextUtils10.getLineHeight(d.label.fontSize),fontStyle:G,fontFamily:B,fontWeight:z,color:P,textAlign:O,verticalAlign:"middle",x:D.x+L+R*_,y:D.y+L+F*.5}}}});const f={series:new BBox28(0,0,p,g),axis:new BBox28(0,0,p,g)},m=(A,D,T,k,w)=>{const{bbox:L}=A;if(L==null){D.visible=!1;return}const{datum:O,depth:F=-1,datumIndex:R,colorValue:E}=A,_=A.children.length===0,G=_?k:T,B=_?this.getTileStyleOverrides(R,O,F,E,G,w):this.getGroupStyleOverrides(R,O,F,G,w);D.crisp=!0,applyShapeStyle15(D,G,B,f),D.cornerRadius=_?h.cornerRadius:d.cornerRadius,D.zIndex=[0,F,w?1:0];const z=A.parent?.children.every(j=>j.children.length===0),P=A.parent!=null?A.parent.bbox:void 0,V=A.parent!=null?A.parent.padding:void 0;z===!0&&P!=null&&V!=null?(D.clipBBox=L,D.x=P.x+V.left,D.y=P.y+V.top,D.width=P.width-(V.left+V.right),D.height=P.height-(V.top+V.bottom)):(D.clipBBox=void 0,D.x=L.x,D.y=L.y,D.width=L.width,D.height=L.height),D.visible=!0},y=this.getGroupBaseStyle(!1),x=this.getTileBaseStyle(!1);this.datumSelection.each((A,D)=>m(D,A,y,x,!1));const b=this.getGroupBaseStyle(!0),S=this.getTileBaseStyle(!0);this.highlightSelection.each((A,D)=>{m(D,A,b,S,!0)});const v=(A,D,T,k)=>{const w=A.children.length===0,L=T===0?A.label:A.secondaryLabel;if(L==null){D.visible=!1;return}let O;if(k){const{tile:F,group:R}=c;O=F.secondaryLabel.color,w?T===0&&(O=F.label.color):O=R.label.color}D.text=L.text,D.fontSize=L.fontSize,D.lineHeight=L.lineHeight,D.fontStyle=L.fontStyle,D.fontFamily=L.fontFamily,D.fontWeight=L.fontWeight,D.fill=O??L.color,D.textAlign=L.textAlign,D.textBaseline=L.verticalAlign,D.x=L.x,D.y=L.y,D.visible=!0,D.zIndex=1},I=this.ctx.highlightManager?.getActiveHighlight();this.labelSelection.selectByClass(Text10).forEach(A=>{const D=A.closestDatum();v(D,A,A.tag,D===I)})}pickNodesExactShape(t){const e=super.pickNodesExactShape(t);return e.sort((i,s)=>s.datumIndex.length-i.datumIndex.length),e}pickNodeClosestDatum(t){const e=this.pickNodesExactShape(t);return e.length!==0?{datum:e[0],distance:0}:this.pickNodeNearestDistantObject(t,this.datumSelection.nodes())}getTooltipContent(t){const{id:e,properties:i}=this,{labelKey:s,secondaryLabelKey:n,childrenKey:o,sizeKey:a,sizeName:r,colorKey:l,colorName:c,tooltip:h}=i,d=t.reduce((A,D)=>A?.children[D],this.rootNode);if(d==null)return;const{datum:u,depth:p,children:g}=d;if(u==null||p==null)return;const f=g.length===0,m=[],y=a!=null?u[a]:void 0;y!=null&&m.push({label:r,fallbackLabel:a,value:y});const x=l!=null?u[l]:void 0;x!=null&&m.push({label:c,fallbackLabel:l,value:x});let b;f?(b=this.getTileBaseStyle(!1),Object.assign(b,this.getTileStyleOverrides(t,u,p,x,b,!1))):(b=this.getGroupBaseStyle(!1),Object.assign(b,this.getGroupStyleOverrides(t,u,p,b,!1)));const S=b.fill,v=getShapeStyle21({shape:"square",fill:S,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0},this.properties.fillGradientDefaults,this.properties.fillPatternDefaults);module_support_exports.isGradientFill(v.fill)&&(v.fill={...v.fill,gradient:"linear",rotation:0,reverse:!1});const I=f?{marker:v}:void 0;return h.formatTooltip(this.properties,{title:s!=null?u[s]:void 0,symbol:I,data:m},{seriesId:e,datum:u,title:void 0,depth:p,labelKey:s,secondaryLabelKey:n,childrenKey:o,sizeKey:a,sizeName:r,colorKey:l,colorName:c,...b})}computeFocusBounds(t){return Transformable5.toCanvas(this.contentGroup,t.getBBox())}};TreemapSeries.className="TreemapSeries",TreemapSeries.type="treemap";var{commonSeriesOptionsDefs:commonSeriesOptionsDefs26,seriesLabelOptionsDefs:seriesLabelOptionsDefs19,tooltipOptionsDefs:tooltipOptionsDefs25}=module_support_exports,treemapSeriesOptionsDef={type:required(constant("treemap")),labelKey:string,secondaryLabelKey:string,childrenKey:string,sizeKey:string,colorKey:string,sizeName:string,colorName:string,fills:arrayOf(colorUnion),strokes:arrayOf(color),colorRange:arrayOf(color),itemStyler:callback,group:{gap:positiveNumber,padding:positiveNumber,cornerRadius:positiveNumber,textAlign:union("left","center","right"),interactive:boolean,label:{...seriesLabelOptionsDefs19,spacing:positiveNumber},...fillOptionsDef,...strokeOptionsDef},tile:{gap:positiveNumber,padding:positiveNumber,cornerRadius:positiveNumber,textAlign:union("left","center","right"),verticalAlign:union("top","middle","bottom"),label:{...seriesLabelOptionsDefs19,spacing:positiveNumber,lineHeight:positiveNumber,minimumFontSize:positiveNumber,wrapping:union("never","always","hyphenate","on-space"),overflowStrategy:union("ellipsis","hide")},secondaryLabel:{...seriesLabelOptionsDefs19,lineHeight:positiveNumber,minimumFontSize:positiveNumber,wrapping:union("never","always","hyphenate","on-space"),overflowStrategy:union("ellipsis","hide")},...fillOptionsDef,...strokeOptionsDef},tooltip:tooltipOptionsDefs25,...commonSeriesOptionsDefs26,highlightStyle:{group:{label:{color},...fillOptionsDef,...strokeOptionsDef},tile:{label:{color},secondaryLabel:{color},...fillOptionsDef,...strokeOptionsDef}}};treemapSeriesOptionsDef.fillGradientDefaults=fillGradientDefaults,treemapSeriesOptionsDef.fillPatternDefaults=fillPatternDefaults,treemapSeriesOptionsDef.undocumentedGroupFills=arrayOf(color),treemapSeriesOptionsDef.undocumentedGroupStrokes=arrayOf(color);var{FONT_SIZE_RATIO:FONT_SIZE_RATIO5}=module_support_exports,TreemapModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["hierarchy"],identifier:"treemap",moduleFactory:t=>new TreemapSeries(t),tooltipDefaults:{range:"exact"},solo:!0,themeTemplate:{series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},colorRange:{$palette:"divergingColors"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:module_support_exports.FILL_PATTERN_DEFAULTS,undocumentedGroupFills:{$palette:"hierarchyColors"},undocumentedGroupStrokes:{$palette:"secondHierarchyColors"},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:[FONT_SIZE_RATIO5.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:[FONT_SIZE_RATIO5.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}}},TreemapSeriesModule={type:"series",name:"treemap",chartType:"hierarchy",enterprise:!0,options:treemapSeriesOptionsDef,create:t=>new TreemapSeries(t)},ModuleRegistry2=module_support_exports.ModuleRegistry,AllCartesianEnterpriseModules=[OrdinalTimeAxisModule2,BoxPlotSeriesModule,CandlestickSeriesModule,ConeFunnelSeriesModule,FunnelSeriesModule,HeatmapSeriesModule,OhlcSeriesModule,RangeAreaSeriesModule,RangeBarSeriesModule,WaterfallSeriesModule],AllPolarEnterpriseModules=[AngleNumberAxisModule2,AngleCategoryAxisModule2,RadiusNumberAxisModule2,RadiusCategoryAxisModule2,NightingaleSeriesModule,RadarAreaSeriesModule,RadarLineSeriesModule,RadialBarSeriesModule,RadialColumnSeriesModule],AllFlowProportionEnterpriseModules=[FlowProportionChartModule2,ChordSeriesModule,SankeySeriesModule],AllGaugeEnterpriseModules=[GaugeChartModule2,LinearGaugeSeriesModule,RadialGaugeSeriesModule],AllHierarchyEnterpriseModules=[HierarchyChartModule2,SunburstSeriesModule,TreemapSeriesModule],AllStandaloneEnterpriseModules=[StandaloneChartModule2,PyramidSeriesModule],AllTopologyEnterpriseModules=[TopologyChartModule2,MapLineSeriesModule,MapLineBackgroundSeriesModule,MapMarkerSeriesModule,MapShapeSeriesModule,MapShapeBackgroundSeriesModule],AllEnterpriseModules=[...AllCartesianEnterpriseModules,...AllPolarEnterpriseModules,...AllFlowProportionEnterpriseModules,...AllGaugeEnterpriseModules,...AllHierarchyEnterpriseModules,...AllStandaloneEnterpriseModules,...AllTopologyEnterpriseModules,AnnotationsModule2,NavigatorModule2,InitialStateModule],indexes={xMin:X_MIN2,xMax:X_MAX2,yMin:Y_MIN2,yMax:Y_MAX2,span:SPAN3},AGGREGATION_THRESHOLD4=1e3,PRECISION2=5;function getIndices(t,e){return Array.from({length:t},(i,s)=>{const n=s*SPAN3,o=e[n+X_MIN2],a=e[n+X_MAX2];return(o+a)/2|0})}function aggregateBarData(t,e,i){if(t.length<AGGREGATION_THRESHOLD4)return;const[s,n]=aggregationDomain(i);let o=maxRangeFittingPoints(t,PRECISION2),{indexData:a,valueData:r}=createAggregationIndices(t,e,e,s,n,o),l=getIndices(o,a);const c=[{maxRange:o,indexData:a,indices:l,indexes}];for(;o>64;)({indexData:a,valueData:r,maxRange:o}=compactAggregationIndices(a,r,o)),l=getIndices(o,a),c.push({maxRange:o,indexData:a,indices:l,indexes});return c.reverse(),c}var{ChartAxisDirection:ChartAxisDirection31,ContinuousScale:ContinuousScale10,OrdinalTimeScale:OrdinalTimeScale6}=module_support_exports,BarSeries2=class extends module_support_exports.BarSeries{aggregateData(t,e){if(e?.type!=="ungrouped")return;const i=this.axes[ChartAxisDirection31.X];if(i==null||!(ContinuousScale10.is(i.scale)||OrdinalTimeScale6.is(i.scale)))return;const s=t.resolveKeysById(this,"xValue",e),n=t.resolveColumnById(this,"yValue-raw",e),{index:o}=t.resolveProcessedDataDefById(this,"xValue"),a=e.domain.keys[o];return aggregateBarData(s,n,a)}},{BarSeriesModule:BarSeriesModule2}=module_support_exports,BarModule={...BarSeriesModule2,type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"bar",moduleFactory:t=>new BarSeries2(t)},AGGREGATION_THRESHOLD5=1e3,MAX_POINTS=10;function aggregationContainsIndex(t,e,i,s,n,o){const a=t[o];if(a==null)return!1;const r=xRatioForDatumIndex(a,e,i),l=aggregationIndexForXRatio(r,n);return o===s[l+X_MIN2]||o===s[l+X_MAX2]||o===s[l+Y_MIN2]||o===s[l+Y_MAX2]}function aggregateLineData(t,e,i){if(t.length<AGGREGATION_THRESHOLD5)return;const[s,n]=aggregationDomain(i);let o=maxRangeFittingPoints(t,MAX_POINTS);const{indexData:a,valueData:r}=createAggregationIndices(t,e,e,s,n,o);let l=[];for(let h=0;h<t.length;h+=1)aggregationContainsIndex(t,s,n,a,o,h)&&l.push(h);const c=[{maxRange:o,indices:l}];for(;l.length>MAX_POINTS&&o>64;)({maxRange:o}=compactAggregationIndices(a,r,o,{inPlace:!0})),l=l.filter(aggregationContainsIndex.bind(null,t,s,n,a,o)),c.push({maxRange:o,indices:l});return c.reverse(),c}var{ChartAxisDirection:ChartAxisDirection32,ContinuousScale:ContinuousScale11,OrdinalTimeScale:OrdinalTimeScale7}=module_support_exports,LineSeries2=class extends module_support_exports.LineSeries{aggregateData(t,e){const i=this.axes[ChartAxisDirection32.X];if(i==null||!(ContinuousScale11.is(i.scale)||OrdinalTimeScale7.is(i.scale)))return;const s=t.resolveColumnById(this,"xValue",e),n=t.resolveColumnById(this,"yValueRaw",e),o=t.getDomain(this,"xValue","value",e);return aggregateLineData(s,n,o)}},{LineSeriesModule:LineSeriesModule2}=module_support_exports,LineModule={...LineSeriesModule2,type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"line",moduleFactory:t=>new LineSeries2(t)},styles_default2=`.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,#ff0 calc(100% * 1 / 6),#0f0 calc(100% * 2 / 6),#0ff 50%,#00f calc(100% * 4 / 6),#f0f calc(100% * 5 / 6),red)}.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,<svg xmlns="http://www.w3.org/2000/svg" width="4" height="4"><rect x="0" y="0" width="4" height="4" fill="%23fff"/><path d="M0 0H2V4H4V2H0Z" fill="%23b2b2b2"/></svg>');--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{border-top-left-radius:0;border-top-right-radius:0;.ag-charts-menu__row:first-child{border-radius:0}}.ag-charts-annotations__text-size-menu{--item-padding: 4px 8px;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}}
`;module_support_exports.ModuleRegistry.registerMany(AllEnterpriseModules);function setupEnterpriseModules(){module_support_exports.moduleRegistry.register(AngleCategoryAxisModule,AngleNumberAxisModule,AnimationModule,AnnotationsModule,BackgroundModule2,BarModule,ForegroundModule,BoxPlotModule,CandlestickModule,ChordModule,ConeFunnelModule,FunnelModule,OhlcModule,ChartToolbarModule,ContextMenuModule,CrosshairModule,DataSourceModule,ErrorBarsModule,LinearGaugeModule,LineModule,MapLineModule,MapLineBackgroundModule,MapMarkerModule,MapShapeModule,MapShapeBackgroundModule,NavigatorModule,StatusBarModule,GradientLegendModule,HeatmapModule,NightingaleModule,OrdinalTimeAxisModule,RadarAreaModule,RadarLineModule,RadialBarModule,RadialColumnModule,RadiusCategoryAxisModule,RadialGaugeModule,RadiusNumberAxisModule,RangeBarModule,RangeAreaModule,RangesModule,PyramidModule,SankeyModule,SharedToolbarModule,SunburstModule,SyncModule,TreemapModule,WaterfallModule,ZoomModule),module_support_exports.enterpriseModule.isEnterprise=!0,module_support_exports.enterpriseModule.styles=styles_default2,module_support_exports.enterpriseModule.licenseManager=t=>new LicenseManager(t.container?.ownerDocument??(typeof document>"u"?void 0:document)),module_support_exports.enterpriseModule.injectWatermark=injectWatermark}setupEnterpriseModules();var LicenseManager2={setLicenseKey(t){LicenseManager.setLicenseKey(t)}};function setupEnterpriseModules2(){setupEnterpriseModules(),registerInbuiltModules()}var AgChartsEnterpriseModule={VERSION,_Scene:integrated_charts_scene_exports,_Theme:integrated_charts_theme_exports,_Util:integrated_charts_util_exports,create:AgCharts.create.bind(AgCharts),createSparkline:AgCharts.__createSparkline.bind(AgCharts),setup:setupEnterpriseModules2,setGridContext:LicenseManager.setGridContext.bind(LicenseManager),setLicenseKey:LicenseManager.setLicenseKey.bind(LicenseManager),isEnterprise:!0};