UNPKG

@progress/kendo-ui

Version:

This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.

46 lines 730 kB
/* @license */
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("kendo.breadcrumb.min.js"),require("kendo.data.min.js"),require("kendo.dataviz.core.min.js"),require("kendo.dataviz.themes.min.js"),require("kendo.drawing.min.js"),require("kendo.userevents.min.js"),require("kendo.icons.min.js")):typeof define==`function`&&define.amd?define([`exports`,`kendo.breadcrumb.min`,`kendo.data.min`,`kendo.dataviz.core.min`,`kendo.dataviz.themes.min`,`kendo.drawing.min`,`kendo.userevents.min`,`kendo.icons.min`],t):(e=typeof globalThis<`u`?globalThis:e||self,t((e.kendo=e.kendo||{},e.kendo._globals=e.kendo._globals||{},e.kendo._globals.DatavizChart={}),e.kendo._globals.Breadcrumb,e.kendo._globals.Data,e.kendo._globals.DatavizCore,e.kendo._globals.DatavizThemes,e.kendo._globals.Drawing,e.kendo._globals.Userevents,e.kendo._globals.Icons))})(this,function(e,t,n,r,i,a,o,s){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var c=Object.defineProperty,l=(e,t)=>{let n={};for(var r in e)c(n,r,{get:e[r],enumerable:!0});return t||c(n,Symbol.toStringTag,{value:`Module`}),n};(function(e,t){let n=window.kendo,r=n.dataviz,i=n.ui.Widget,a=i.extend({init:function(e,t){if(i.fn.init.call(this,e,t),!t.chart)throw Error("ChartBreadcrumb: No Chart instance supplied as `options.chart`");this._attachChartEvents(),this._renderBreadcrumb(),n.notify(this,r.ui),i.fn.endInit.call(this)},events:[],options:{name:`ChartBreadcrumb`,rootItem:{type:`rootitem`,icon:`home`,text:`Home`,showIcon:!0}},destroy:function(){this.breadcrumb&&=(this.breadcrumb.destroy(),null),this.chart&&=(this.chart.unbind(`drilldown`,this._onChartDrilldown),this.chart.unbind(`drilldownLevelChange`,this._onChartDrilldownLevelChange),null),i.fn.destroy.call(this)},_attachChartEvents(t){let n=this.options;if(typeof n.chart.resetDrilldownLevel==`function`)this.chart=n.chart;else if(typeof n.chart==`string`){if(this.chart=e(n.chart).getKendoChart()||e(`#`+n.chart).getKendoChart(),!this.chart&&!t){setTimeout(()=>this._attachChartEvents(!0));return}}else throw Error("ChartBreadcrumb: `options.chart` must be a Chart instance, element ID or a selector");this._onChartDrilldown=this._onChartDrilldown.bind(this),this.chart.bind(`drilldown`,this._onChartDrilldown),this._onChartDrilldownLevelChange=this._onChartDrilldownLevelChange.bind(this),this.chart.bind(`drilldownLevelChange`,this._onChartDrilldownLevelChange)},_renderBreadcrumb:function(){let t=e(`<nav />`);this.element.append(t),this.breadcrumb=new n.ui.Breadcrumb(t,{items:[this.options.rootItem]}),this.breadcrumb.bind(`click`,e=>this._onBreadcrumbClick(e))},_onBreadcrumbClick:function(e){if(!this.breadcrumb||!this.chart)return;let t=this.breadcrumb.items().findIndex(t=>t===e.item);this.chart.resetDrilldownLevel(t)},_onChartDrilldown:function(e){!this.breadcrumb||e.isDefaultPrevented()||this.breadcrumb.items([...this.breadcrumb.items(),{type:`item`,text:e.point.category}])},_onChartDrilldownLevelChange:function(e){if(!this.breadcrumb)return;let t=this.breadcrumb.items();t=t.slice(0,e.level+1),this.breadcrumb.items(t)}});r.ui.plugin(a)})(window.kendo.jQuery);var u=class{constructor(e){this._axis=e,this.options=e.options}value(e){let t=this._axis;return t.getCategory?t.getCategory(e):t.getValue(e)}slot(e,t,n=!0){return this._axis.slot(e,t,n)}range(){return this._axis.range()}valueRange(){return this._axis.valueRange()}};function d(e,t){for(let n=0;n<t.length;n++)if(t[n].options.name===e)return t[n].prepareUserOptions(),new u(t[n])}var f=class{constructor(e){this.visual=e.visual,this.chartsVisual=e.chartContainer.visual,this._pane=e}findAxisByName(e){return d(e,this._pane.axes)}},p=class{constructor(e){this._plotArea=e,this.visual=e.visual,this.backgroundVisual=e._bgVisual}};let m=`ArrowUp`,h=`ArrowDown`,g=`ArrowLeft`,_=`ArrowRight`,v=`aria-activedescendant`,y=`#000`,b=`bottom`,x=`center`,S=`circle`,ee=`date`,C=`12px sans-serif`,te=/\{\d+:?/,w=`height`,T=`left`,E=Number.MAX_VALUE,D=-Number.MAX_VALUE,ne=`none`,re=`outside`,O=`right`,ie=`value`,k=`#fff`,ae=`width`,oe=`pointer`;function se(e){return Array.isArray(e)}function ce(e,t){let n=se(t)?t:[t];for(let t=0;t<n.length;t++){let r=n[t];e.className.indexOf(r)===-1&&(e.className+=` `+r)}}let le=/\s+/g;function ue(e,t){e&&e.className&&(e.className=e.className.replace(t,``).replace(le,` `))}var de=class{},fe=class extends de{constructor(){super(),this._events={}}bind(e,t,n){let r=me(e),i=pe(t),a=r.length;if(t===void 0){for(let t in e)this.bind(t,e[t]);return this}for(let e=0;e<a;e++){let a=r[e],o=i?t:t[a];if(o){if(n){let e=o;o=()=>{this.unbind(a,o),e.apply(this,arguments)},o.original=e}(this._events[a]=this._events[a]||[]).push(o)}}return this}one(e,t){return this.bind(e,t,!0)}first(e,t){let n=me(e),r=pe(t);for(let e=0,i=n.length;e<i;e++){let i=n[e],a=r?t:t[i];a&&(this._events[i]=this._events[i]||[]).unshift(a)}return this}trigger(e,t={}){let n=this._events[e];if(n){let e=n.length;t.sender=this,t._defaultPrevented=!1,t.preventDefault=he,t.isDefaultPrevented=ge,n=n.slice();for(let r=0;r<e;r++)n[r].call(this,t);return t._defaultPrevented===!0}return!1}unbind(e,t){let n=this._events[e];if(e===void 0)this._events={};else if(n)if(t)for(let e=n.length-1;e>=0;e--)(n[e]===t||n[e].original===t)&&n.splice(e,1);else this._events[e]=[];return this}};function pe(e){return typeof e==`function`}function me(e){return typeof e==`string`?[e]:e}function he(){this._defaultPrevented=!0}function ge(){return this._defaultPrevented===!0}let _e=e=>{let t=typeof window<`u`?window:{},n=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)};_e=e=>n.call(t,e),_e(e)};var ve=_e;let ye=/&/g,be=/</g,xe=/"/g,Se=/'/g,Ce=/>/g;function we(e){return String(e).replace(ye,`&amp;`).replace(be,`&lt;`).replace(Ce,`&gt;`).replace(xe,`&quot;`).replace(Se,`&#39;`)}function Te(e){let t=window.console;t!==void 0&&t.log&&t.log(e)}function Ee(e){let t={edge:/(edge)[ \/]([\w.]+)/i,webkit:/(chrome)[ \/]([\w.]+)/i,safari:/(webkit)[ \/]([\w.]+)/i,opera:/(opera)(?:.*version|)[ \/]([\w.]+)/i,msie:/(msie\s|trident.*? rv:)([\w.]+)/i,mozilla:/(mozilla)(?:.*? rv:([\w.]+))/i},n={};for(let r in t)if(t.hasOwnProperty(r)){let i=e.match(t[r]);if(i){n[r]=!0,n[i[1].toLowerCase().split(` `)[0].split(`/`)[0]]=!0,n.version=parseInt(document.documentMode||i[2],10);break}}return n}let De=null,Oe={get browser(){return typeof window>`u`||De||(De=Ee(window.navigator.userAgent)),De}},ke=Date.now||function(){return new Date().getTime()};function Ae(e,t){let n=0,r;if(!t||t<=0)return e;let i=function(){let i=ke()-n,a=arguments,o=function(){e.apply(null,a),n=ke()};if(!n)return o();r&&clearTimeout(r),i>t?o():r=setTimeout(o,t-i)};return i.cancel=function(){clearTimeout(r)},i}let je={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`,darkgrey:`a9a9a9`,darkgreen:`006400`,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`,grey:`808080`,green:`008000`,greenyellow:`adff2f`,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`,lightgrey:`d3d3d3`,lightgreen:`90ee90`,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:`9370d8`,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:`d87093`,papayawhip:`ffefd5`,peachpuff:`ffdab9`,peru:`cd853f`,pink:`ffc0cb`,plum:`dda0dd`,powderblue:`b0e0e6`,purple:`800080`,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`,turquoise:`40e0d0`,violet:`ee82ee`,wheat:`f5deb3`,white:`ffffff`,whitesmoke:`f5f5f5`,yellow:`ffff00`,yellowgreen:`9acd32`},Me=Oe.browser,Ne=e=>{let t=Object.keys(je);t.push(`transparent`);let n=RegExp(`^(`+t.join(`|`)+`)(\\W|$)`,`i`);return Ne=e=>n.exec(e),n.exec(e)};var Pe=class extends de{constructor(){super()}toHSV(){return this}toRGB(){return this}toHex(e){return this.toBytes().toHex(e)}toBytes(){return this}toCss(e){return`#`+this.toHex(e)}toCssRgba(){let e=this.toBytes();return`rgba(${e.r}, ${e.g}, ${e.b}, ${parseFloat(Number(this.a).toFixed(3))})`}toCssHex(){return this.a===1?`#`+this.toHex():`#`+this.toHex({alpha:!0})}toDisplay(){return Me.msie&&Me.version<9?this.toCss():this.toCssRgba()}equals(e){return e===this||e!=null&&this.toCssRgba()===He(e).toCssRgba()}diff(e){if(e===null)return NaN;let t=this.toBytes(),n=e.toBytes();return Math.sqrt(((t.r-n.r)*.3)**2+((t.g-n.g)*.59)**2+((t.b-n.b)*.11)**2)}clone(){let e=this.toBytes();return e===this&&(e=new Ie(e.r,e.g,e.b,e.a)),e}},Fe=class extends Pe{constructor(e,t,n,r){super(),this.r=e,this.g=t,this.b=n,this.a=r}toHSV(){let{r:e,g:t,b:n}=this,r=Math.min(e,t,n),i=Math.max(e,t,n),a=i-r,o=i,s,c;return a===0?new Re(0,0,o,this.a):(i===0?(c=0,s=-1):(c=a/i,s=e===i?(t-n)/a:t===i?2+(n-e)/a:4+(e-t)/a,s*=60,s<0&&(s+=360)),new Re(s,c,o,this.a))}toHSL(){let{r:e,g:t,b:n}=this,r=Math.max(e,t,n),i=Math.min(e,t,n),a,o,s=(r+i)/2;if(r===i)a=o=0;else{let c=r-i;switch(o=s>.5?c/(2-r-i):c/(r+i),r){case e:a=(t-n)/c+(t<n?6:0);break;case t:a=(n-e)/c+2;break;case n:a=(e-t)/c+4;break;default:break}}return new ze(a*60,o*100,s*100,this.a)}toBytes(){return new Ie(this.r*255,this.g*255,this.b*255,this.a)}},Ie=class extends Fe{constructor(e,t,n,r){super(Math.round(e),Math.round(t),Math.round(n),r)}toRGB(){return new Fe(this.r/255,this.g/255,this.b/255,this.a)}toHSV(){return this.toRGB().toHSV()}toHSL(){return this.toRGB().toHSL()}toHex(e){let t=Le(this.r,2)+Le(this.g,2)+Le(this.b,2);return e&&e.alpha&&(t+=Le(Math.round(this.a*255),2)),t}toBytes(){return this}};function Le(e,t,n=`0`){let r=e.toString(16);for(;t>r.length;)r=n+r;return r}var Re=class extends Pe{constructor(e,t,n,r){super(),this.h=e,this.s=t,this.v=n,this.a=r}toRGB(){let{h:e,s:t,v:n}=this,r,i,a;if(t===0)r=i=a=n;else{e/=60;let o=Math.floor(e),s=e-o,c=n*(1-t),l=n*(1-t*s),u=n*(1-t*(1-s));switch(o){case 0:r=n,i=u,a=c;break;case 1:r=l,i=n,a=c;break;case 2:r=c,i=n,a=u;break;case 3:r=c,i=l,a=n;break;case 4:r=u,i=c,a=n;break;default:r=n,i=c,a=l;break}}return new Fe(r,i,a,this.a)}toHSL(){return this.toRGB().toHSL()}toBytes(){return this.toRGB().toBytes()}},ze=class extends Pe{constructor(e,t,n,r){super(),this.h=e,this.s=t,this.l=n,this.a=r}toRGB(){let e=this.h/360,t=this.s/100,n=this.l/100,r,i,a;if(t===0)r=i=a=n;else{let o=n<.5?n*(1+t):n+t-n*t,s=2*n-o;r=Be(s,o,e+1/3),i=Be(s,o,e),a=Be(s,o,e-1/3)}return new Fe(r,i,a,this.a)}toHSV(){return this.toRGB().toHSV()}toBytes(){return this.toRGB().toBytes()}};function Be(e,t,n){let r=n;return r<0&&(r+=1),r>1&&--r,r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function Ve(e){return parseFloat(parseFloat(parseInt(e,16)/255).toFixed(3))}function He(e,t){let n,r;if(!e||e===`none`)return null;if(e instanceof Pe)return e;let i=e.toLowerCase();if(n=Ne(i))return i=n[1]===`transparent`?new Fe(1,1,1,0):He(je[n[1]],t),i.match=[n[1]],i;if((n=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})\b/i.exec(i))?r=new Ie(parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16),1):(n=/^#?([0-9a-f])([0-9a-f])([0-9a-f])\b/i.exec(i))?r=new Ie(parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16),1):(n=/^#?([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])\b/i.exec(i))?r=new Ie(parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16),Ve(n[4]+n[4])):(n=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})\b/i.exec(i))?r=new Ie(parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16),Ve(n[4])):(n=/^rgb\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/.exec(i))?r=new Ie(parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10),1):(n=/^rgba\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9.]+)\s*\)/.exec(i))?r=new Ie(parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10),parseFloat(n[4])):(n=/^rgb\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*\)/.exec(i))?r=new Fe(parseFloat(n[1])/100,parseFloat(n[2])/100,parseFloat(n[3])/100,1):(n=/^rgba\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9.]+)\s*\)/.exec(i))?r=new Fe(parseFloat(n[1])/100,parseFloat(n[2])/100,parseFloat(n[3])/100,parseFloat(n[4])):(n=/^color\(\s*srgb\s*([0-9]*\.?[0-9]+)\s+([0-9]*\.?[0-9]+)\s+([0-9]*\.?[0-9]+)\s*(\/\s+([0-9]*\.?[0-9]+))?\)/.exec(i))&&(r=new Fe(parseFloat(n[1]),parseFloat(n[2]),parseFloat(n[3]),parseFloat(n[5]||`1`))),r)r.match=n;else if(!t)throw Error(`Cannot parse color: `+i);return r}var Ue=class e extends de{constructor(t){if(super(),arguments.length===1){let n=e.formats,r=this.resolveColor(t);for(let e=0;e<n.length;e++){let t=n[e].re,i=n[e].process,a=t.exec(r);if(a){let e=i(a);this.r=e[0],this.g=e[1],this.b=e[2]}}}else this.r=arguments[0],this.g=arguments[1],this.b=arguments[2];this.r=this.normalizeByte(this.r),this.g=this.normalizeByte(this.g),this.b=this.normalizeByte(this.b)}toHex(){let e=this.padDigit,t=this.r.toString(16),n=this.g.toString(16),r=this.b.toString(16);return`#`+e(t)+e(n)+e(r)}resolveColor(t){let n=t||`black`;return n.charAt(0)===`#`&&(n=n.substr(1,6)),n=n.replace(/ /g,``),n=n.toLowerCase(),n=e.namedColors[n]||n,n}normalizeByte(e){return e<0||isNaN(e)?0:e>255?255:e}padDigit(e){return e.length===1?`0`+e:e}brightness(e){let t=Math.round;return this.r=t(this.normalizeByte(this.r*e)),this.g=t(this.normalizeByte(this.g*e)),this.b=t(this.normalizeByte(this.b*e)),this}percBrightness(){return Math.sqrt(.241*this.r*this.r+.691*this.g*this.g+.068*this.b*this.b)}isDark(){return this.percBrightness()<180}static fromBytes(e,t,n,r){return new Ie(e,t,n,r??1)}static fromRGB(e,t,n,r){return new Fe(e,t,n,r??1)}static fromHSV(e,t,n,r){return new Re(e,t,n,r??1)}static fromHSL(e,t,n,r){return new ze(e,t,n,r??1)}};Ue.formats=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,process:function(e){return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10)]}},{re:/^(\w{2})(\w{2})(\w{2})$/,process:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,process:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}}],Ue.namedColors=je;let We=e=>e.ownerDocument.defaultView.getComputedStyle(e),Ge=(e,t)=>{let n=document.createElement(`div`);e.parentElement?e.parentElement.appendChild(n):e.appendChild(n),n.style.color=`rgb(from ${t} clamp(0, r, 255) clamp(0, g, 255) clamp(0, b, 255))`;let r=He(We(n).color,!0);return n.remove(),r?r.toCssHex():`#000000`};function Ke(e,t){let n=We(e).getPropertyValue(t),r=He(n,!0);return r?r.toCssHex():Ge(e,n)}var qe=class extends de{observers(){return this._observers=this._observers||[],this._observers}addObserver(e){return this._observers?this._observers.push(e):this._observers=[e],this}removeObserver(e){let t=this.observers(),n=t.indexOf(e);return n!==-1&&t.splice(n,1),this}trigger(e,t){let n=this._observers;if(n&&!this._suspended)for(let r=0;r<n.length;r++){let i=n[r];i[e]&&i[e](t)}return this}optionsChange(e={}){e.element=this,this.trigger(`optionsChange`,e)}geometryChange(){this.trigger(`geometryChange`,{element:this})}suspend(){return this._suspended=(this._suspended||0)+1,this}resume(){return this._suspended=Math.max((this._suspended||0)-1,0),this}_observerField(e,t){this[e]&&this[e].removeObserver(this),this[e]=t,t.addObserver(this)}};let Je={}.toString;var Ye=class e extends qe{constructor(e,t=``){super(),this.prefix=t;for(let t in e){let n=e[t];n=this._wrap(n,t),this[t]=n}}get(e){let t=e.split(`.`),n=this;for(;t.length&&n;){let e=t.shift();n=n[e]}return n}set(e,t){this.get(e)!==t&&(this._set(e,this._wrap(t,e)),this.optionsChange({field:this.prefix+e,value:t}))}_set(t,n){let r=t.indexOf(`.`)>=0,i=this,a=t;if(r){let t=a.split(`.`),n=this.prefix;for(;t.length>1;){a=t.shift(),n+=a+`.`;let r=i[a];r||(r=new e({},n),r.addObserver(this),i[a]=r),i=r}a=t[0]}i._clear(a),i[a]=n}_clear(e){let t=this[e];t&&t.removeObserver&&t.removeObserver(this)}_wrap(t,n){let r=Je.call(t),i=t;return i!=null&&r===`[object Object]`&&(!(t instanceof e)&&!(t instanceof de)&&(i=new e(i,this.prefix+n+`.`)),i.addObserver(this)),i}};function Xe(e){return function(t){return this[e]!==t&&(this[e]=t,this.geometryChange()),this}}function Ze(e){return function(){return this[e]}}function Qe(e,t){for(let n=0;n<t.length;n++){let r=t[n],i=r.charAt(0).toUpperCase()+r.substring(1,r.length);e[`set`+i]=Xe(r),e[`get`+i]=Ze(r)}}let $e=(e,t)=>{let n=class extends e{};return Qe(n.prototype,t),n};function et(e,t){return e.push.apply(e,t),e}let tt={1:`i`,10:`x`,100:`c`,2:`ii`,20:`xx`,200:`cc`,3:`iii`,30:`xxx`,300:`ccc`,4:`iv`,40:`xl`,400:`cd`,5:`v`,50:`l`,500:`d`,6:`vi`,60:`lx`,600:`dc`,7:`vii`,70:`lxx`,700:`dcc`,8:`viii`,80:`lxxx`,800:`dccc`,9:`ix`,90:`xc`,900:`cm`,1e3:`m`};function nt(e){let t=[1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],n=``;for(;e>0;)e<t[0]?t.shift():(n+=tt[t[0]],e-=t[0]);return n}function rt(){let e,t,n=new Promise((r,i)=>{e=e=>(n._state=`resolved`,r(e),n),t=e=>(n._state=`rejected`,i(e),n)});return n._state=`pending`,n.resolve=e,n.reject=t,n.state=()=>n._state,n}function it(e){return e!==void 0}let at=1;function ot(){return`kdef`+at++}let st=Math.PI/180,ct=Number.MAX_VALUE,lt=-Number.MAX_VALUE;function ut(e){return e/st}let dt=String.fromCharCode;function ft(e){let t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(55296<=r&&r<=56319){let t=r,i=e.charCodeAt(++n);isNaN(i)||(r=(t-55296)*1024+(i-56320)+65536)}r<128?t+=dt(r):r<2048?(t+=dt(192|r>>>6),t+=dt(128|r&63)):r<65536?(t+=dt(224|r>>>12),t+=dt(128|r>>>6&63),t+=dt(128|r&63)):r<1114111&&(t+=dt(240|r>>>18),t+=dt(128|r>>>12&63),t+=dt(128|r>>>6&63),t+=dt(128|r&63))}return t}function pt(e){return dt(e>>8)+dt(e&255)}function mt(e){let t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r<65535)t+=pt(r);else{let e=(r-65536>>10)+55296,n=(r-65536&1023)+56320;t+=pt(e),t+=pt(n)}}return t}let ht=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`;function gt(e){let t=``,n=0,r=ft(e);for(;n<r.length;){let e=r.charCodeAt(n++),i=r.charCodeAt(n++),a=r.charCodeAt(n++),o=e>>2,s=(e&3)<<4|i>>4,c=(i&15)<<2|a>>6,l=a&63;isNaN(i)?c=l=64:isNaN(a)&&(l=64),t=t+ht.charAt(o)+ht.charAt(s)+ht.charAt(c)+ht.charAt(l)}return t}function _t(e){return(e.x||{}).location===void 0?{x:e.pageX||e.clientX||0,y:e.pageY||e.clientY||0}:{x:e.x.location,y:e.y.location}}function vt(e={}){return e.touch?e.touch.initialTouch:e.target}function yt(e){return e===``||e===null||e===`none`||e===`transparent`||e===void 0}function bt(e){if(e)return e[e.length-1]}function xt(e,t,n){return Math.max(Math.min(e,n),t)}function St(e,t){if(e.length<2)return e.slice();function n(e,n){for(var r=[],i=0,a=0,o=0;i<e.length&&a<n.length;)t(e[i],n[a])<=0?r[o++]=e[i++]:r[o++]=n[a++];return i<e.length&&r.push.apply(r,e.slice(i)),a<n.length&&r.push.apply(r,n.slice(a)),r}return(function e(t){if(t.length<=1)return t;var r=Math.floor(t.length/2),i=t.slice(0,r),a=t.slice(r);return i=e(i),a=e(a),n(i,a)})(e)}function Ct(e){return Promise.all(e)}function wt(e){return e*st}function Tt(e){return e?10**e:1}function Et(e,t){let n=Tt(t);return Math.round(e*n)/n}function Dt(e,t){return e===void 0?t:e}function Ot(e,t){for(let n in t){let r=n.trim().split(` `);for(let i=0;i<r.length;i++)e.addEventListener(r[i],t[n],!1)}}function kt(e){let t=e.getBoundingClientRect(),n=document.documentElement;return{top:t.top+(window.pageYOffset||n.scrollTop)-(n.clientTop||0),left:t.left+(window.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}}function At(e,t){let n={},r=window.getComputedStyle(e)||{},i=Array.isArray(t)?t:[t];for(let e=0;e<i.length;e++){let t=i[e];n[t]=r[t]}return n}function jt(e){return isNaN(e)?e:e+`px`}function Mt(e,t){if(t){let{width:n,height:r}=t;n!==void 0&&(e.style.width=jt(n)),r!==void 0&&(e.style.height=jt(r))}else{let t=At(e,[`width`,`height`]);return{width:parseInt(t.width,10),height:parseInt(t.height,10)}}}function Nt(e,t={}){for(let n in t){let r=n.trim().split(` `);for(let i=0;i<r.length;i++)e.removeEventListener(r[i],t[n],!1)}}function Pt(e){let{paddingLeft:t,paddingTop:n}=At(e,[`paddingLeft`,`paddingTop`]);return{top:parseFloat(n),left:parseFloat(t)}}var Ft=class e extends de{constructor(e=0,t=0,n=0,r=0,i=0,a=0){super(),this.a=e,this.b=t,this.c=n,this.d=r,this.e=i,this.f=a}multiplyCopy(t){return new e(this.a*t.a+this.c*t.b,this.b*t.a+this.d*t.b,this.a*t.c+this.c*t.d,this.b*t.c+this.d*t.d,this.a*t.e+this.c*t.f+this.e,this.b*t.e+this.d*t.f+this.f)}invert(){let{a:t,b:n,c:r,d:i,e:a,f:o}=this,s=t*i-n*r;return s===0?null:new e(i/s,-n/s,-r/s,t/s,(r*o-i*a)/s,(n*a-t*o)/s)}clone(){return new e(this.a,this.b,this.c,this.d,this.e,this.f)}equals(e){return e?this.a===e.a&&this.b===e.b&&this.c===e.c&&this.d===e.d&&this.e===e.e&&this.f===e.f:!1}round(e){return this.a=Et(this.a,e),this.b=Et(this.b,e),this.c=Et(this.c,e),this.d=Et(this.d,e),this.e=Et(this.e,e),this.f=Et(this.f,e),this}toArray(e){let t=[this.a,this.b,this.c,this.d,this.e,this.f];if(e!==void 0)for(let n=0;n<t.length;n++)t[n]=Et(t[n],e);return t}toString(e,t=`,`){return this.toArray(e).join(t)}static translate(t,n){return new e(1,0,0,1,t,n)}static unit(){return new e(1,0,0,1,0,0)}static rotate(t,n,r){let i=new e;return i.a=Math.cos(wt(t)),i.b=Math.sin(wt(t)),i.c=-i.b,i.d=i.a,i.e=n-n*i.a+r*i.b||0,i.f=r-r*i.a-n*i.b||0,i}static scale(t,n){return new e(t,0,0,n,0,0)}};Ft.IDENTITY=Ft.unit();let It=/matrix\((.*)\)/;function Lt(e){let t=e.match(It);return t===null||t.length!==2?Ft.unit():new Ft(...t[1].split(`,`).map(e=>parseFloat(e)))}function Rt(e){let t=getComputedStyle(e).transform;return t===`none`?Ft.unit():Lt(t)}function zt(e){if(!e)return Ft.unit();let t=Rt(e),n=e.parentElement;for(;n;){let e=Rt(n);t=t.multiplyCopy(e),n=n.parentElement}return t.b=t.c=t.e=t.f=0,t}var Bt=class extends de{constructor(e){super(),this._size=e,this._length=0,this._map={}}put(e,t){let n=this._map,r={key:e,value:t};n[e]=r,this._head?(this._tail.newer=r,r.older=this._tail,this._tail=r):this._head=this._tail=r,this._length>=this._size?(n[this._head.key]=null,this._head=this._head.newer,this._head.older=null):this._length++}get(e){let t=this._map[e];if(t)return t===this._head&&t!==this._tail&&(this._head=t.newer,this._head.older=null),t!==this._tail&&(t.older&&(t.older.newer=t.newer,t.newer.older=t.older),t.older=this._tail,t.newer=null,this._tail.newer=t,this._tail=t),t.value}};let Vt=/\r?\n|\r|\t/g;function Ht(e){return String(e).replace(Vt,` `)}function Ut(e){let t=[];for(let n in e)t.push(n+e[n]);return t.sort().join(``)}function Wt(e){let t=2166136261;for(let n=0;n<e.length;++n)t+=(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24),t^=e.charCodeAt(n);return t>>>0}function Gt(){return{width:0,height:0,baseline:0}}let Kt={baselineMarkerSize:1},qt;typeof document<`u`&&(qt=document.createElement(`div`),qt.style.setProperty(`position`,`absolute`,`important`),qt.style.setProperty(`top`,`-4000px`,`important`),qt.style.setProperty(`width`,`auto`,`important`),qt.style.setProperty(`height`,`auto`,`important`),qt.style.setProperty(`padding`,`0`,`important`),qt.style.setProperty(`margin`,`0`,`important`),qt.style.setProperty(`border`,`0`,`important`),qt.style.setProperty(`line-height`,`normal`,`important`),qt.style.setProperty(`visibility`,`hidden`,`important`),qt.style.setProperty(`white-space`,`pre`,`important`));var Jt=class extends de{constructor(e){super(),this._cache=new Bt(1e3),this.options=Object.assign({},Kt,e)}measure(e,t,n={}){if(e==null)return Gt();let r=Wt(e+Ut(t)),i=this._cache.get(r);if(i)return i;let a=Gt(),o=n.box||qt,s=this._baselineMarker().cloneNode(!1);for(let e in t){let n=t[e];n!==void 0&&(o.style[e]=n)}let c=n.normalizeText===!1?String(e):Ht(e);return o.textContent=c,o.appendChild(s),document.body.appendChild(o),c.length&&(a.width=o.offsetWidth-this.options.baselineMarkerSize,a.height=o.offsetHeight,a.baseline=s.offsetTop+this.options.baselineMarkerSize),a.width>0&&a.height>0&&this._cache.put(r,a),o.parentNode.removeChild(o),a}_baselineMarker(){let e=document.createElement(`div`);return e.style.display=`inline-block`,e.style.verticalAlign=`baseline`,e.style.width=this.options.baselineMarkerSize+`px`,e.style.height=this.options.baselineMarkerSize+`px`,e.style.overflow=`hidden`,e}};Jt.current=new Jt;function Yt(e,t,n){return Jt.current.measure(e,t,n)}let Xt=()=>typeof window<`u`,Zt={wp:/(Windows Phone(?: OS)?)\s(\d+)\.(\d+(\.\d+)?)/,fire:/(Silk)\/(\d+)\.(\d+(\.\d+)?)/,android:/(Android|Android.*(?:Opera|Firefox).*?\/)\s*(\d+)(\.(\d+(\.\d+)?))?/,iphone:/(iPhone|iPod).*OS\s+(\d+)[\._]([\d\._]+)/,ipad:/(iPad).*OS\s+(\d+)[\._]([\d_]+)/,meego:/(MeeGo).+NokiaBrowser\/(\d+)\.([\d\._]+)/,webos:/(webOS)\/(\d+)\.(\d+(\.\d+)?)/,blackberry:/(BlackBerry|BB10).*?Version\/(\d+)\.(\d+(\.\d+)?)/,playbook:/(PlayBook).*?Tablet\s*OS\s*(\d+)\.(\d+(\.\d+)?)/,windows:/(MSIE)\s+(\d+)\.(\d+(\.\d+)?)/,tizen:/(tizen).*?Version\/(\d+)\.(\d+(\.\d+)?)/i,sailfish:/(sailfish).*rv:(\d+)\.(\d+(\.\d+)?).*firefox/i,ffos:/(Mobile).*rv:(\d+)\.(\d+(\.\d+)?).*Firefox/},Qt={ios:/^i(phone|pad|pod)$/i,android:/^android|fire$/i,blackberry:/^blackberry|playbook/i,windows:/windows/,wp:/wp/,flat:/sailfish|ffos|tizen/i,meego:/meego/},$t={edge:/(edge)[ \/]([\w.]+)/i,webkit:/(chrome)[ \/]([\w.]+)/i,safari:/(webkit)[ \/]([\w.]+)/i,opera:/(opera)(?:.*version|)[ \/]([\w.]+)/i,msie:/(msie\s|trident.*? rv:)([\w.]+)/i,mozilla:/(mozilla)(?:.*? rv:([\w.]+)|)/i},en={omini:/Opera\sMini/i,omobile:/Opera\sMobi/i,firefox:/Firefox|Fennec/i,mobilesafari:/version\/.*safari/i,ie:/MSIE|Windows\sPhone/i,chrome:/chrome|crios/i,webkit:/webkit/i},tn=(e,t,n)=>{for(let n in t)if(t.hasOwnProperty(n)&&t[n].test(e))return n;return n===void 0?e:n},nn=e=>{let t,n=[];for(let r in Zt)if(Zt.hasOwnProperty(r)){if(n=e.match(Zt[r]),!n)continue;if(r===`windows`&&`plugins`in window.navigator)return null;let i={};return i.device=r,i.browser=tn(e,en,`default`),i.name=tn(r,Qt),i[i.name]=!0,i.majorVersion=n[2],i.minorVersion=n[3]?n[3].replace(`_`,`.`):`.0`,t=i.minorVersion.replace(`.`,``).substr(0,2),i.flatVersion=i.majorVersion+t+Array(3-(t.length<3?t.length:2)).join(`0`),i.cordova=!0,i.appMode=window.navigator.standalone||/file|local|wmapp/.test(window.location.protocol)||i.cordova,i}return null},rn=e=>{let t=null,n=[];for(let r in $t)if($t.hasOwnProperty(r)&&(n=e.match($t[r]),n)){t={},t[r]=!0,t[n[1].toLowerCase().split(` `)[0].split(`/`)[0]]=!0,t.version=parseInt(document.documentMode||n[2],10);break}return t},an=Xt()&&window.navigator?window.navigator.userAgent:null,on=an?rn(an):null;an&&nn(an),Xt()&&`ontouchstart`in window,on&&!on.chrome&&window.MSPointerEvent,on&&!on.chrome&&window.PointerEvent;let sn={};sn.undefined=e=>e;let cn={};cn.undefined=e=>e;let ln=/\/\*[\s\S]*?\*\//g,un=/([^\s:;]+?)\s*:\s*((?:(?:url\(\s*(?:(?:[^"')\\]|\\.)*|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')\s*\)|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|[^;"'])*?)\s*)(?=;|$)/gi,dn=/&quot;|&#34;|&#x22;/gi,fn=/&apos;|&#39;|&#x27;/gi;function pn(e){return e.replace(dn,`"`).replace(fn,`'`)}function mn(e){let t={},n=pn((e||``).replace(ln,``)),r=un.exec(n),i,a;for(;r!==null;)i=r[1].trim(),a=r[2].trim(),t[i]=a,r=un.exec(n);return t}let hn=(e,t)=>{let n=mn(t);Object.keys(n).forEach(t=>{e.style[t]=n[t]})},gn=`data-style`,_n=e=>(e||``).replace(/\sstyle=/g,` data-style=`),vn=e=>{Array.from(e.querySelectorAll(`[data-style]`)).forEach(e=>{let t=e.getAttribute(gn);e.removeAttribute(gn),hn(e,t)})},yn=(e,t)=>{e.innerHTML=_n(t),vn(e)},bn=(e,t)=>{let n=document.createElement(`div`);yn(n,t),n.firstElementChild&&e.insertBefore(n.firstElementChild,e.firstChild)};var xn=l({DEG_TO_RAD:()=>st,LRUCache:()=>Bt,MAX_NUM:()=>ct,MIN_NUM:()=>lt,TextMetrics:()=>Jt,append:()=>et,arabicToRoman:()=>nt,bindEvents:()=>Ot,createPromise:()=>rt,defined:()=>it,definitionId:()=>ot,deg:()=>ut,elementOffset:()=>kt,elementPadding:()=>Pt,elementScale:()=>zt,elementSize:()=>Mt,elementStyles:()=>At,encodeBase64:()=>gt,eventCoordinates:()=>_t,eventElement:()=>vt,hashKey:()=>Wt,isTransparent:()=>yt,last:()=>bt,limitValue:()=>xt,measureText:()=>Yt,mergeSort:()=>St,normalizeText:()=>Ht,now:()=>ke,objectKey:()=>Ut,promiseAll:()=>Ct,rad:()=>wt,round:()=>Et,setInnerHTML:()=>yn,unbindEvents:()=>Nt,valueOrDefault:()=>Dt});function Sn(e){return e&&typeof e.matrix==`function`?e.matrix():e}var A=class e extends $e(qe,[`x`,`y`]){constructor(e,t){super(),this.x=e||0,this.y=t||0}equals(e){return e&&e.x===this.x&&e.y===this.y}clone(){return new e(this.x,this.y)}rotate(t,n){let r=e.create(n)||e.ZERO;return this.transform(Ft.rotate(t,r.x,r.y))}translate(e,t){return this.x+=e,this.y+=t,this.geometryChange(),this}translateWith(e){return this.translate(e.x,e.y)}move(e,t){return this.x=this.y=0,this.translate(e,t)}scale(e,t=e){return this.x*=e,this.y*=t,this.geometryChange(),this}scaleCopy(e,t){return this.clone().scale(e,t)}transform(e){let t=Sn(e),{x:n,y:r}=this;return this.x=t.a*n+t.c*r+t.e,this.y=t.b*n+t.d*r+t.f,this.geometryChange(),this}transformCopy(e){let t=this.clone();return e&&t.transform(e),t}distanceTo(e){let t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)}round(e){return this.x=Et(this.x,e),this.y=Et(this.y,e),this.geometryChange(),this}toArray(e){let t=e!==void 0;return[t?Et(this.x,e):this.x,t?Et(this.y,e):this.y]}toString(e,t=` `){let{x:n,y:r}=this;return e!==void 0&&(n=Et(n,e),r=Et(r,e)),n+t+r}static create(t,n){if(t!==void 0)return t instanceof e?t:arguments.length===1&&t.length===2?new e(t[0],t[1]):new e(t,n)}static min(){let t=ct,n=ct;for(let e=0;e<arguments.length;e++){let r=arguments[e];t=Math.min(r.x,t),n=Math.min(r.y,n)}return new e(t,n)}static max(){let t=lt,n=lt;for(let e=0;e<arguments.length;e++){let r=arguments[e];t=Math.max(r.x,t),n=Math.max(r.y,n)}return new e(t,n)}static minPoint(){return new e(lt,lt)}static maxPoint(){return new e(ct,ct)}static get ZERO(){return new e(0,0)}},Cn=class e extends $e(qe,[`width`,`height`]){constructor(e,t){super(),this.width=e||0,this.height=t||0}equals(e){return e&&e.width===this.width&&e.height===this.height}clone(){return new e(this.width,this.height)}toArray(e){let t=e!==void 0;return[t?Et(this.width,e):this.width,t?Et(this.height,e):this.height]}static create(t,n){if(t!==void 0)return t instanceof e?t:arguments.length===1&&t.length===2?new e(t[0],t[1]):new e(t,n)}static get ZERO(){return new e(0,0)}},j=class e extends qe{constructor(e=new A,t=new Cn,n=0){super(),this.setOrigin(e),this.setSize(t),this.setCornerRadius(n)}clone(){return new e(this.origin.clone(),this.size.clone())}equals(e){return e&&e.origin.equals(this.origin)&&e.size.equals(this.size)}setOrigin(e){return this._observerField(`origin`,A.create(e)),this.geometryChange(),this}getOrigin(){return this.origin}setCornerRadius(e){return this.cornerRadius=Array.isArray(e)?e:[e,e],this.geometryChange(),this}getCornerRadius(){return this.cornerRadius}setSize(e){return this._observerField(`size`,Cn.create(e)),this.geometryChange(),this}getSize(){return this.size}width(){return this.size.width}height(){return this.size.height}topLeft(){return this.origin.clone()}bottomRight(){return this.origin.clone().translate(this.width(),this.height())}topRight(){return this.origin.clone().translate(this.width(),0)}bottomLeft(){return this.origin.clone().translate(0,this.height())}center(){return this.origin.clone().translate(this.width()/2,this.height()/2)}bbox(t){let n=this.topLeft().transformCopy(t),r=this.topRight().transformCopy(t),i=this.bottomRight().transformCopy(t),a=this.bottomLeft().transformCopy(t);return e.fromPoints(n,r,i,a)}transformCopy(t){return e.fromPoints(this.topLeft().transform(t),this.bottomRight().transform(t))}expand(e,t=e){return this.size.width+=2*e,this.size.height+=2*t,this.origin.translate(-e,-t),this}expandCopy(e,t){return this.clone().expand(e,t)}containsPoint(e){let t=this.origin,n=this.bottomRight();return!(e.x<t.x||e.y<t.y||n.x<e.x||n.y<e.y)}_isOnPath(e,t){let n=this.expandCopy(t,t),r=this.expandCopy(-t,-t);return n.containsPoint(e)&&!r.containsPoint(e)}static fromPoints(){let t=A.min.apply(null,arguments),n=A.max.apply(null,arguments),r=new Cn(n.x-t.x,n.y-t.y);return new e(t,r)}static union(t,n){return e.fromPoints(A.min(t.topLeft(),n.topLeft()),A.max(t.bottomRight(),n.bottomRight()))}static intersect(t,n){let r={left:t.topLeft().x,top:t.topLeft().y,right:t.bottomRight().x,bottom:t.bottomRight().y},i={left:n.topLeft().x,top:n.topLeft().y,right:n.bottomRight().x,bottom:n.bottomRight().y};if(r.left<=i.right&&i.left<=r.right&&r.top<=i.bottom&&i.top<=r.bottom)return e.fromPoints(new A(Math.max(r.left,i.left),Math.max(r.top,i.top)),new A(Math.min(r.right,i.right),Math.min(r.bottom,i.bottom)))}},wn=class e extends qe{constructor(e=Ft.unit()){super(),this._matrix=e}clone(){return new e(this._matrix.clone())}equals(e){return e&&e._matrix.equals(this._matrix)}translate(e,t){return this._matrix=this._matrix.multiplyCopy(Ft.translate(e,t)),this._optionsChange(),this}scale(e,t=e,n=null){let r=n;return r&&(r=A.create(r),this._matrix=this._matrix.multiplyCopy(Ft.translate(r.x,r.y))),this._matrix=this._matrix.multiplyCopy(Ft.scale(e,t)),r&&(this._matrix=this._matrix.multiplyCopy(Ft.translate(-r.x,-r.y))),this._optionsChange(),this}rotate(e,t){let n=A.create(t)||A.ZERO;return this._matrix=this._matrix.multiplyCopy(Ft.rotate(e,n.x,n.y)),this._optionsChange(),this}multiply(e){let t=Sn(e);return this._matrix=this._matrix.multiplyCopy(t),this._optionsChange(),this}matrix(e){return e?(this._matrix=e,this._optionsChange(),this):this._matrix}_optionsChange(){this.optionsChange({field:`transform`,value:this})}};function M(e){return e===null?null:e instanceof wn?e:new wn(e)}let Tn={dot:[1.5,3.5],dash:[4,3.5],longdash:[8,3.5],dashdot:[3.5,3.5,1.5,3.5],longdashdot:[8,3.5,1.5,3.5],longdashdotdot:[8,3.5,1.5,3.5,1.5,3.5]},En=`butt`;var Dn=class extends qe{get nodeType(){return`Rect`}constructor(e){super(),this._initOptions(e)}_initOptions(e={}){let{clip:t,transform:n}=e;n&&(e.transform=M(n)),t&&!t.id&&(t.id=ot()),this.options=new Ye(e),this.options.addObserver(this)}transform(e){if(e!==void 0)this.options.set(`transform`,M(e));else return this.options.get(`transform`)}parentTransform(){let e=this,t;for(;e.parent;){e=e.parent;let n=e.transform();n&&(t=n.matrix().multiplyCopy(t||Ft.unit()))}if(t)return M(t)}currentTransform(e=this.parentTransform()){let t=Sn(this.transform()),n=Sn(e),r;if(r=t&&n?n.multiplyCopy(t):t||n,r)return M(r)}visible(e){return e===void 0?this.options.get(`visible`)!==!1:(this.options.set(`visible`,e),this)}clip(e){let t=this.options;return e===void 0?t.get(`clip`):(e&&!e.id&&(e.id=ot()),t.set(`clip`,e),this)}opacity(e){return e===void 0?Dt(this.options.get(`opacity`),1):(this.options.set(`opacity`,e),this)}className(e){return e===void 0?this.options.get(`className`):(this.options.set(`className`,e),this)}clippedBBox(e){let t=this._clippedBBox(e);if(t){let n=this.clip();return n?j.intersect(t,n.bbox(e)):t}}containsPoint(e,t){if(this.visible()){let n=this.currentTransform(t),r=e;return n&&(r=e.transformCopy(n.matrix().invert())),this._hasFill()&&this._containsPoint(r)||this._isOnPath&&this._hasStroke()&&this._isOnPath(r)}return!1}_hasFill(){let e=this.options.fill;return e&&(e.nodeType===`Pattern`||!yt(e.color))}_hasStroke(){let e=this.options.stroke;return e&&e.width>0&&!yt(e.color)}_clippedBBox(e){return this.bbox(e)}};function On(e,t,n,r){let i=0,a=0;return r&&(i=Math.atan2(r.c*n,r.a*t),r.b!==0&&(a=Math.atan2(r.d*n,r.b*t))),{x:i,y:a}}let kn=Math.PI/2;var An=class e extends $e(qe,[`radius`]){constructor(e=new A,t=0){super(),this.setCenter(e),this.setRadius(t)}setCenter(e){return this._observerField(`center`,A.create(e)),this.geometryChange(),this}getCenter(){return this.center}equals(e){return e&&e.center.equals(this.center)&&e.radius===this.radius}clone(){return new e(this.center.clone(),this.radius)}pointAt(e){return this._pointAt(wt(e))}bbox(e){let t=On(this.center,this.radius,this.radius,e),n=A.maxPoint(),r=A.minPoint();for(let i=0;i<4;i++){let a=this._pointAt(t.x+i*kn).transformCopy(e),o=this._pointAt(t.y+i*kn).transformCopy(e),s=new A(a.x,o.y);n=A.min(n,s),r=A.max(r,s)}return j.fromPoints(n,r)}_pointAt(e){let{center:t,radius:n}=this;return new A(t.x+n*Math.cos(e),t.y+n*Math.sin(e))}containsPoint(e){let{center:t,radius:n}=this;return(e.x-t.x)**2+(e.y-t.y)**2<=n**2}_isOnPath(e,t){let{center:n,radius:r}=this,i=n.distanceTo(e);return r-t<=i&&i<=r+t}};let jn=e=>class extends e{fill(e,t){let n=this.options;if(e!==void 0){if(e&&e.nodeType!==`Gradient`){let r={color:e};t!==void 0&&(r.opacity=t),n.set(`fill`,r)}else n.set(`fill`,e);return this}return n.get(`fill`)}stroke(e,t,n){return e===void 0?this.options.get(`stroke`):(this.options.set(`stroke.color`,e),t!==void 0&&this.options.set(`stroke.width`,t),n!==void 0&&this.options.set(`stroke.opacity`,n),this)}},Mn=Ft.IDENTITY.toString(),Nn=e=>class extends e{bbox(e){let t=Sn(this.currentTransform(e)),n=t?t.toString():Mn,r;this._bboxCache&&this._matrixHash===n?r=this._bboxCache.clone():(r=this._bbox(t),this._bboxCache=r?r.clone():null,this._matrixHash=n);let i=this.options.get(`stroke.width`);return i&&r&&r.expand(i/2),r}geometryChange(){delete this._bboxCache,this.trigger(`geometryChange`,{element:this})}};function Pn(e){let t=`_`+e;return function(e){return e===void 0?this[t]:(this._observerField(t,e),this.geometryChange(),this)}}function Fn(e,t){for(let n=0;n<t.length;n++)e[t[n]]=Pn(t[n])}let In=(e,t=[`geometry`])=>{let n=class extends e{};return Fn(n.prototype,t),n};var Ln=class extends jn(Nn(In(Dn))){get nodeType(){return`Circle`}constructor(e=new An,t={}){super(t),this.geometry(e),this.options.stroke===void 0&&this.stroke(`#000`)}rawBBox(){return this._geometry.bbox()}_bbox(e){return this._geometry.bbox(e)}_containsPoint(e){return this.geometry().containsPoint(e)}_isOnPath(e){return this.geometry()._isOnPath(e,this.options.stroke.width/2)}};function Rn(e,t,n=10){return Et(Math.abs(e-t),n)===0}function zn(e,t,n){return e<t||Rn(e,t,n)}function Bn(e,t,n,r){let i=t.x-e.x,a=r.x-n.x,o=t.y-e.y,s=r.y-n.y,c=e.x-n.x,l=e.y-n.y,u=i*s-a*o,d=(i*l-o*c)/u,f=(a*l-s*c)/u;if(d>=0&&d<=1&&f>=0&&f<=1)return new A(e.x+f*i,e.y+f*o)}let Vn=Math.pow,Hn=[`radiusX`,`radiusY`,`startAngle`,`endAngle`,`anticlockwise`];var Un=class e extends $e(qe,Hn){constructor(e=new A,t={}){super(),this.setCenter(e),this.radiusX=t.radiusX,this.radiusY=t.radiusY||t.radiusX,this.startAngle=t.startAngle,this.endAngle=t.endAngle,this.anticlockwise=t.anticlockwise||!1,this.xRotation=t.xRotation}clone(){return new e(this.center,{radiusX:this.radiusX,radiusY:this.radiusY,startAngle:this.startAngle,endAngle:this.endAngle,anticlockwise:this.anticlockwise})}setCenter(e){return this._observerField(`center`,A.create(e)),this.geometryChange(),this}getCenter(){return this.center}pointAt(e){let t=this.center,n=wt(e);return new A(t.x+this.radiusX*Math.cos(n),t.y+this.radiusY*Math.sin(n))}curvePoints(){let e=this.startAngle,t=this.anticlockwise?-1:1,n=[this.pointAt(e)],r=this._arcInterval(),i=r.endAngle-r.startAngle,a=Math.ceil(i/45),o=i/a,s=e,c;this.xRotation&&(c=M().rotate(this.xRotation,this.center));for(let e=1;e<=a;e++){let e=s+t*o,r=this._intervalCurvePoints(s,e,c);n.push(r.cp1,r.cp2,r.p2),s=e}return n}bbox(e){let t=this._arcInterval(),n=t.startAngle,r=t.endAngle,i=On(this.center,this.radiusX,this.radiusY,e),a=ut(i.x),o=ut(i.y),s=this.pointAt(r).transformCopy(e),c=Kn(a,n),l=Kn(o,n),u=this.pointAt(n).transformCopy(e),d=A.min(u,s),f=A.max(u,s);for(;c<r||l<r;){let t;c<r&&(t=this.pointAt(c).transformCopy(e),c+=90);let n;l<r&&(n=this.pointAt(l).transformCopy(e),l+=90),u=new A(t.x,n.y),d=A.min(d,u),f=A.max(f,u)}return j.fromPoints(d,f)}_arcInterval(){let{startAngle:e,endAngle:t,anticlockwise:n}=this;if(n){let n=e;e=t,t=n}return(e>t||n&&e===t)&&(t+=360),{startAngle:e,endAngle:t}}_intervalCurvePoints(e,t,n){let r=this.pointAt(e),i=this.pointAt(t),a=this._derivativeAt(e),o=this._derivativeAt(t),s=(wt(t)-wt(e))/3,c=new A(r.x+s*a.x,r.y+s*a.y),l=new A(i.x-s*o.x,i.y-s*o.y);return n&&(r.transform(n),i.transform(n),c.transform(n),l.transform(n)),{p1:r,cp1:c,cp2:l,p2:i}}_derivativeAt(e){let t=wt(e);return new A(-this.radiusX*Math.sin(t),this.radiusY*Math.cos(t))}containsPoint(e){let t=this._arcInterval(),n=t.endAngle-t.startAngle,{center:r,radiusX:i,radiusY:a}=this,o=r.distanceTo(e),s=Math.atan2(e.y-r.y,e.x-r.x),c=i*a/Math.sqrt(Vn(i,2)*Vn(Math.sin(s),2)+Vn(a,2)*Vn(Math.cos(s),2)),l=this.pointAt(this.startAngle).round(10),u=this.pointAt(this.endAngle).round(10),d=Bn(r,e.round(10),l,u),f;if(n<180)f=d&&zn(r.distanceTo(d),o)&&zn(o,c);else{let n=Wn(r.x,r.y,i,a,e.x,e.y);n!==360&&(n=(360+n)%360);let s=t.startAngle<=n&&n<=t.endAngle;f=s&&zn(o,c)||!s&&(!d||d.equals(e))}return f}_isOnPath(e,t){let n=this._arcInterval(),r=this.center,i=Wn(r.x,r.y,this.radiusX,this.radiusY,e.x,e.y);return i!==360&&(i=(360+i)%360),n.startAngle<=i&&i<=n.endAngle&&this.pointAt(i).distanceTo(e)<=t}static fromPoints(t,n,r,i,a,o,s){let c=Gn({x1:t.x,y1:t.y,x2:n.x,y2:n.y,rx:r,ry:i,largeArc:a,swipe:o,rotation:s});return new e(c.center,{startAngle:c.startAngle,endAngle:c.endAngle,radiusX:c.radiusX,radiusY:c.radiusY,xRotation:c.xRotation,anticlockwise:o===0})}};function Wn(e,t,n,r,i,a){let o=Et((i-e)/n,3),s=Et((a-t)/r,3);return Et(ut(Math.atan2(s,o)))}function Gn(e){let{x1:t,y1:n,x2:r,y2:i,rx:a,ry:o,largeArc:s,swipe:c,rotation:l=0}=e,u=wt(l),d=Math.cos(u),f=Math.sin(u),p=d*(t-r)/2+f*(n-i)/2,m=-f*(t-r)/2+d*(n-i)/2,h=s===c?-1:1,g=p**2,_=m**2,v=a**2,y=o**2,b=g/v+_/y;b>1&&(b=Math.sqrt(g/v+_/y),a=b*a,v=a**2,o=b*o,y=o**2);let x=h*Math.sqrt((v*y-v*_-y*g)/(v*_+y*g));isNaN(x)&&(x=0);let S=a*m*x/o,ee=-x*(o*p)/a,C=d*S-f*ee+(t+r)/2,te=f*S+d*ee+(n+i)/2,w=(p-S)/a,T=(m-ee)/o,E=-(p+S)/a,D=-(m+ee)/o,ne=(T>=0?1:-1)*ut(Math.acos(w/Math.sqrt(w*w+T*T))),re=Et((w*E+T*D)/(Math.sqrt(w*w+T*T)*Math.sqrt(E*E+D*D)),10),O=(w*D-T*E>=0?1:-1)*ut(Math.acos(re));!c&&O>0&&(O-=360),c&&O<0&&(O+=360);let ie=ne+O,k=ie>=0?1:-1;return ie=Math.abs(ie)%360*k,{center:new A(C,te),startAngle:ne,endAngle:ie,radiusX:a,radiusY:o,xRotation:l}}function Kn(e,t){let n=e;for(;n<t;)n+=90;return n}let qn=[].splice,Jn=[].slice;var Yn=class extends qe{constructor(e=[]){super(),this.length=0,this._splice(0,e.length,e)}elements(e){return e?(this._splice(0,this.length,e),this._change(),this):this.slice(0)}push(...e){let t=this.length,n=e.length;for(let r=0;r<n;r++)this[t+r]=e[r],e[r].addObserver(this);return this.length=t+n,this._change(),this.length}slice(){return Jn.call(this)}pop(){if(this.length>0){let e=this[this.length-1];return this.length--,e.removeObserver(this),this._change(),e}}splice(e,t,...n){let r=this._splice(e,t,n);return this._change(),r}shift(){if(this.length>0){let e=this[0];for(let e=1;e<this.length;e++)this[e-1]=this[e];return this.length--,e.removeObserver(this),this._change(),e}}unshift(...e){let t=e.length;for(let e=this.length-1;e>=0;e--)this[e+t]=this[e];for(let n=0;n<t;n++)this[n]=e[n],e[n].addObserver(this);return this.length+=t,this._change(),this.length}indexOf(e){let t=this.length;for(let n=0;n<t;n++)if(this[n]===e)return n;return-1}_splice(e,t,n){let r=qn.apply(this,[e,t].concat(n));return this._clearObserver(r),this._setObserver(n),r}_add(e){this._setObserver(e),this._change()}_remove(e){this._clearObserver(e),this._change()}_setObserver(e){for(let t=0;t<e.length;t++)e[t].addObserver(this)}_clearObserver(e){for(let t=0;t<e.length;t++)e[t].removeObserver(this)}_change(){}},Xn=class extends Yn{_change(){this.geometryChange()}};function Zn(e,t,n){let r=ut(Math.atan2(t.y-e.y,t.x-e.x));return n.transformCopy(M().rotate(-r,e)).x<e.x}function Qn(e,t,n){let r=1-e;return r**3*n[0][t]+3*r**2*e*n[1][t]+3*e**2*r*n[2][t]+e**3*n[3][t]}function $n(e,t){return[-e[0][t]+3*e[1][t]-3*e[2][t]+e[3][t],3*(e[0][t]-2*e[1][t]+e[2][t]),3*(-e[0][t]+e[1][t]),e[0][t]]}var er=class e extends de{constructor(e=0,t=0){super(),this.real=e,this.img=t}add(t){return new e(Et(this.real+t.real,10),Et(this.img+t.img,10))}addConstant(t){return new e(this.real+t,this.img)}negate(){return new e(-this.real,-this.img)}multiply(t){return new e(this.real*t.real-this.img*t.img,this.real*t.img+this.img*t.real)}multiplyConstant(t){return new e(this.real*t,this.img*t)}nthRoot(t){let n=Math.atan2(this.img,this.real),r=Math.sqrt(this.img**2+this.real**2)**(1/t);return new e(r*Math.cos(n/t),r*Math.sin(n/t))}equals(e){return this.real===e.real&&this.img===e.img}isReal(){return this.img===0}};function tr(e){return e<0?-1:1}function nr(e,t,n){let r=Math.sqrt(t**2-4*e*n);return[(-t+r)/(2*e),(-t-r)/(2*e)]}function rr(e,t,n,r){if(e===0)return nr(t,n,r);let i=(3*e*n-t**2)/(3*e**2),a=(2*t**3-9*e*t*n+27*e**2*r)/(27*e**3),o=(i/3)**3+(a/2)**2,s=new er(0,1),c=-t/(3*e),l,u,d,f,p,m,h;o<0?(l=new er(-a/2,Math.sqrt(-o)).nthRoot(3),u=new er(-a/2,-Math.sqrt(-o)).nthRoot(3)):(l=-a/2+Math.sqrt(o),l=new er(tr(l)*Math.abs(l)**(1/3)),u=-a/2-Math.sqrt(o),u=new er(tr(u)*Math.abs(u)**(1/3))),d=l.add(u),m=l.add(u).multiplyConstant(-1/2),h=l.add(u.negate()).multiplyConstant(Math.sqrt(3)/2),f=m.add(s.multiply(h)),p=m.add(s.negate().multiply(h));let g=[];return d.isReal()&&g.push(Et(d.real+c,10)),f.isReal()&&g.push(Et(f.real+c,10)),p.isReal()&&g.push(Et(p.real+c,10)),g}function ir(e,t,n,r,i){let a=$n(e,r),o=rr(a[0],a[1],a[2],a[3]-t[r]),s;for(let r=0;r<o.length;r++)if(0<=o[r]&&o[r]<=1&&(s=Qn(o[r],n,e),Math.abs(s-t[n])<=i))return!0}function ar(e,t,n){let r=$n(e,`x`),i=rr(r[0],r[1],r[2],r[3]-t.x),a,o,s=0;for(let r=0;r<i.length;r++)a=Qn(i[r],`y`,e),o=Rn(a,t.y)||a>t.y,o&&((i[r]===0||i[r]===1)&&n.bottomRight().x>t.x||0<i[r]&&i[r]<1)&&s++;return s}function or(e,t,n){let r;if(e.x!==t.x){let i=Math.min(e.x,t.x),a=Math.max(e.x,t.x),o=Math.min(e.y,t.y),s=Math.max(e.y,t.y),c=i<=n.x&&n.x<a;r=o===s?n.y<=o&&c:c&&(s-o)*((e.x-t.x)*(e.y-t.y)>0?n.x-i:a-n.x)/(a-i)+o-n.y>=0}return+!!r}function sr(e){let t=`_`+e;return function(e){return e===void 0?this[t]:(this._observerField(t,A.create(e)),this.geometryChange(),this)}}function cr(e,t){for(let n=0;n<t.length;n++)e[t[n]]=sr(t[n])}let lr=(e,t)=>{let n=class extends e{};return cr(n.prototype,t),n},ur=[`anchor`,`controlIn`,`controlOut`];var dr=class extends lr(qe,ur){constructor(e,t,n){super(),this.anchor(e||new A),this.controlIn(t),this.controlOut(n)}bboxTo(e,t){let n=this.anchor().transformCopy(t),r=e.anchor().transformCopy(t),i;return i=this.controlOut()&&e.controlIn()?this._curveBoundingBox(n,this.controlOut().transformCopy(t),e.controlIn().transformCopy(t),r):this._lineBoundingBox(n,r),i}_lineBoundingBox(e,t){return j.fromPoints(e,t)}_curveBoundingBox(e,t,n,r){let i=[e,t,n,r],a=this._curveExtremesFor(i,`x`),o=this._curveExtremesFor(i,`y`),s=fr([a.min,a.max,e.x,r.x]),c=fr([o.min,o.max,e.y,r.y]);return j.fromPoints(new A(s.min,c.min),new A(s.max,c.max))}_curveExtremesFor(e,t){let n=this._curveExtremes(e[0][t],e[1][t],e[2][t],e[3][t]);return{min:Qn(n.min,t,e),max:Qn(n.max,t,e)}}_curveExtremes(e,t,n,r){let i=e-3*t+3*n-r,a=-2*(e-2*t+n),o=e-t,s=Math.sqrt(a*a-4*i*o),c=0,l=1;i===0?a!==0&&(c=l=-o/a):isNaN(s)||(c=(-a+s)/(2*i),l=(-a-s)/(2*i));let u=Math.max(Math.min(c,l),0);(u<0||u>1)&&(u=0);let d=Math.min(Math.max(c,l),1);return(d>1||d<0)&&(d=1),{min:u,max:d}}_intersectionsTo(e,t){let n;return n=this.controlOut()&&e.controlIn()?ar([this.anchor(),this.controlOut(),e.controlIn(),e.anchor()],t,this.bboxTo(e)):or(this.anchor(),e.anchor(),t),n}_isOnCurveTo(e,t,n,r){if(this.bboxTo(e).expand(n,n).containsPoint(t)){let i=this.anchor(),a=this.controlOut(),o=e.controlIn(),s=e.anchor();if(r===`start`&&i.distanceTo(t)<=n)return!Zn(i,a,t);if(r===`end`&&s.distanceTo(t)<=n)return!Zn(s,o,t);let c=[i,a,o,s];if(ir(c,t,`x`,`y`,n)||ir(c,t,`y`,`x`,n))return!0;let l=M().rotate(45,t),u=[i.transformCopy(l),a.transformCopy(l),o.transformCopy(l),s.transformCopy(l)];return ir(u,t,`x`,`y`,n)||ir(u,t,`y`,`x`,n)}}_isOnLineTo(e,t,n){let r=this.anchor(),i=e.anchor(),a=ut(Math.atan2(i.y-r.y,i.x-r.x));return new j([r.x,r.y-n/2],[r.distanceTo(i),n]).containsPoint(t.transformCopy(M().rotate(-a,r)))}_isOnPathTo(e,t,n,r){let i;return i=this.controlOut()&&e.controlIn()?this._isOnCurveTo(e,t,n/2,r):this._isOnLineTo(e,t,n),i}};function fr(e){let t=e.length,n=ct,r=lt;for(let i=0;i<t;i++)r=Math.max(r,e[i]),n=Math.min(n,e[i]);return{min:n,max:r}}let pr=.333;function mr(e,t){let n=e.slice(0),r=[],i=n.length;if(i>2&&(hr(0,n),i=n.length),i<2||i===2&&n[0].equals(n[1]))return r;let a=n[0],o=n[1],s=n[2];for(r.push(new dr(a));a.equals(n[i-1]);)t=!0,n.pop(),i--;if(i===2){let e=xr(a,o,`x`,`y`);return bt(r).controlOut(Cr(e,a,o,`x`,`y`)),r.push(new dr(o,wr(e,a,o,`x`,`y`))),r}let c,l;if(t){a=n[i-1],o=n[0],s=n[1];let e=yr(a,o,s);c=e[1],l=e[0]}else c=Cr(xr(a,o,`x`,`y`),a,o,`x`,`y`);let u=c;for(let e=0;e<=i-3;e++)if(hr(e,n),i=n.length,e+3<=i){a=n[e],o=n[e+1],s=n[e+2];let t=yr(a,o,s);bt(r).controlOut(u),u=t[1];let i=t[0];r.push(new dr(o,i))}if(t){a=n[i-2],o=n[i-1],s=n[0];let e=yr(a,o,s);bt(r).controlOut(u),r.push(new dr(o,e[0])),bt(r).controlOut(e[1]),r.push(new dr(s,l))}else{let e=xr(o,s,`x`,`y`);bt(r).controlOut(u),r.push(new dr(s,wr(e,o,s,`x`,`y`)))}return r}function hr(e,t){for(;t[e+1]&&(t[e].equals(t[e+1])||t[e+1].equals(t[e+2]));)t.splice(e+1,1)}function gr(e,t,n){let r=!1;if(e.x===t.x)r=!0;else if(t.x===n.x)(t.y<n.y&&e.y<=t.y||n.y<t.y&&t.y<=e.y)&&(r=!0);else{let i=Er(vr(e,t),n.x);!(e.y<=t.y&&n.y<=i)&&!(t.y<=e.y&&n.y>=i)&&(r=!0)}return r}function _r(e,t,n){let r=Er(vr(e,t),n.x);return e.x===t.x&&t.x===n.x||Et(r,1)===Et(n.y,1)}function vr(e,t){let n=(t.y-e.y)/(t.x-e.x);return[e.y-n*e.x,n]}function yr(e,t,n){let r=`x`,i=`y`,a=!1,o=!1,s;if(_r(e,t,n))s=xr(e,t,`x`,`y`);else{let c={x:Sr(e,t,n,`x`),y:Sr(e,t,n,`y`)};if(c.x&&c.y)s=xr(e,n,`x`,`y`),a=!0;else if(gr(e,t,n)&&(r=`y`,i=`x`),c[r])s=0;else{let a;a=n[i]<e[i]&&e[i]<=t[i]||e[i]<n[i]&&t[i]<=e[i]?Dr((n[i]-e[i])*(t[r]-e[r])):-Dr((n[r]-e[r])*(t[i]-e[i])),s=.01*a,o=!0}}let c=wr(s,e,t,r,i);if(o){let e=r;r=i,i=e}let l=Cr(s,t,n,r,i);return a&&(br(e,t,c,s),br(t,n,l,s)),[c,l]}function br(e,t,n,r){e.y<t.y?t.y<n.y?(n.x=e.x+(t.y-e.y)/r,n.y=t.y):n.y<e.y&&(n.x=t.x-(t.y-e.y)/r,n.y=e.y):n.y<t.y?(n.x=e.x-(e.y-t.y)/r,n.y=t.y):e.y<n.y&&(n.x=t.x+(e.y-t.y)/r,n.y=e.y)}function xr(e,t,n,r){let i=t[n]-e[n],a=t[r]-e[r],o;return o=i===0?0:a/i,o}function Sr(e,t,n,r){return n[r]>t[r]&&t[r]>e[r]||n[r]<t[r]&&t[r]<e[r]}function Cr(e,t,n,r,i){let a=t[r],o=(n[r]-a)*pr;return Tr(a+o,t[i]+o*e,r,i)}function wr(e,t,n,r,i){let a=t[r],o=n[r],s=(o-a)*pr;return Tr(o-s,n[i]-s*e,r,i)}function Tr(e,t,n,r){let i=new A;return i[n]=e,i[r]=t,i}function Er(e,t){let n=e.length,r=0;for(let i=0;i<n;i++)r+=t**+i*e[i];return r}function Dr(e){return e<=0?-1:1}let Or={l:function(e,t){let{parameters:n,position:r}=t;for(let i=0;i<n.length;i+=2){let a=new A(n[i],n[i+1]);t.isRelative&&a.translateWith(r),e.lineTo(a.x,a.y),r.x=a.x,r.y=a.y}},c:function(e,t){let{parameters:n,position:r}=t;for(let i=0;i<n.length;i+=6){let a=new A(n[i],n[i+1]),o=new A(n[i+2],n[i+3]),s=new A(n[i+4],n[i+5]);t.isRelative&&(o.translateWith(r),a.translateWith(r),s.translateWith(r)),e.curveTo(a,o,s),r.x=s.x,r.y=s.y}},v:function(e,t){let n=t.isRelative?0:t.position.x;kr(t.parameters,!0,n),this.l(e,t)},h:function(e,t){let n=t.isRelative?0:t.position.y;kr(t.parameters,!1,n),this.l(e,t)},a:function(e,t){let{parameters:n,position:r}=t;for(let i=0;i<n.length;i+=7){let a=n[i],o=n[i+1],s=n[i+2],c=n[i+3],l=n[i+4],u=new A(n[i+5],n[i+6]);t.isRelative&&u.translateWith(r),(r.x!==u.x||r.y!==u.y)&&(e.arcTo(u,a,o,c,l,s),r.x=u.x,r.y=u.y)}},s:function(e,t){let{parameters:n,position:r,previousCommand:i}=t,a;(i===`s`||i===`c`)&&(a=bt(bt(e.paths).segments).controlIn());for(let i=0;i<n.length;i+=4){let o=new A(n[i],n[i+1]),s=new A(n[i+2],n[i+3]),c;t.isRelative&&(o.translateWith(r),s.translateWith(r)),c=a?Ar(a,r):r.clone(),a=o,e.curveTo(c,o,s),r.x=s.x,r.y=s.y}},q:function(e,t){let{parameters:n,position:r}=t;for(let i=0;i<n.length;i+=4){let a=new A(n[i],n[i+1]),o=new A(n[i+2],n[i+3]);t.isRelative&&(a.translateWith(r),o.translateWith(r));let s=Mr(r,a,o);e.curveTo(s.controlOut,s.controlIn,o),r.x=o.x,r.y=o.y}},t:function(e,t){let{parameters:n,position:r,previousCommand:i}=t,a;(i===`q`||i===`t`)&&(a=bt(bt(e.paths).segments).controlIn().clone().translateWith(r.scaleCopy(-1/3)).scale(3/2));for(let i=0;i<n.length;i+=2){let o=new A(n[i],n[i+1]);t.isRelative&&o.translateWith(r),a=a?Ar(a,r):r.clone();let s=Mr(r,a,o);e.curveTo(s.controlOut,s.controlIn,o),r.x=o.x,r.y=o.y}}};function kr(e,t,n){let r=+!t;for(let t=0;t<e.length;t+=2)e.splice(t+r,0,n)}function Ar(e,t){if(e&&t)return t.scaleCopy(2).translate(-e.x,-e.y)}let jr=1/3;function Mr(e,t,n){let r=t.clone().scale(2/3);return{controlOut:r.clone().translateWith(e.scaleCopy(jr)),controlIn:r.translateWith(n.scaleCopy(jr))}}let Nr=/([a-df-z]{1})([^a-df-z]*)(z)?/gi,Pr=/[,\s]?([+\-]?(?:\d*\.\d+|\d+)(?:[eE][+\-]?\d+)?)/g;function Fr(e){let t=[];return e.replace(Pr,function(e,n){t.push(parseFloat(n))}),t}function Ir(e,t){let n=new A,r;return t.replace(Nr,(t,i,a,o)=>{let s=i.toLowerCase(),c=s===i,l=Fr(a.trim());if(s===`m`&&(c?(n.x+=l[0],n.y+=l[1]):(n.x=l[0],n.y=l[1]),e.moveTo(n.x,n.y),l.length>2&&(s=`l`,l.splice(0,2))),Or[s])Or[s](e,{parameters:l,position:n,isRelative:c,previousCommand:r}),o&&o.toLowerCase()===`z`&&e.close();else if(s!==`m`)throw Error(`Error while parsing SVG path. Unsupported command: `+s);r=s}),e}function Lr(e,t,n){let r;for(let i=0;i<e.length;i++){let a=e[i];if(a.visible()){let e=t?a.bbox(n):a.rawBBox();e&&(r=r?j.union(r,e):e)}}return r}function Rr(e,t){let n;for(let r=0;r<e.length;r++){let i=e[r];if(i.visible()){let e=i.clippedBBox(t);e&&(n=n?j.union(n,e):e)}}return n}let zr=e=>(...t)=>t.map(t=>t.toString(e)).join(` `),Br=(e,t)=>e.controlOut()&&t.controlIn()?`C`:`L`;var N=class e extends jn(Nn(Dn)){get nodeType(){return`Path`}constructor(e){super(e),this.segments=new Xn,this.segments.addObserver(this),this.options.stroke===void 0&&(this.stroke(`#000`),this.options.stroke.lineJoin===void 0&&this.options.set(`stroke.lineJoin`,`miter`))}moveTo(e,t){return this.suspend(),this.segments.elements([]),this.resume(),this.lineTo(e,t),this}lineTo(e,t){let n=new dr(t===void 0?e:new A(e,t));return this.segments.push(n),this}curveTo(e,t,n){if(this.segments.length>0){let r=bt(this.segments),i=new dr(n,t);this.suspend(),r.controlOut(e),this.resume(),this.segments.push(i)}return this}arc(e,t,n,r,i){if(this.segments.length>0){let a=bt(this.segments).anchor(),o=wt(e),s=new Un(new A(a.x-n*Math.cos(o),a.y-r*Math.sin(o)),{startAngle:e,endAngle:t,radiusX:n,radiusY:r,anticlockwise:i});this._addArcSegments(s)}return this}arcTo(e,t,n,r,i,a){if(this.segments.length>0){let o=bt(this.segments).anchor(),s=Un.fromPoints(o,A.create(e),t,n,r,i,a);this._addArcSegments(s)}return this}_addArcSegments(e){this.suspend();let t=e.curvePoints();for(let e=1;e<t.length;e+=3)this.curveTo(t[e],t[e+1],t[e+2]);this.resume(),this.geometryChange()}close(){return this.options.closed=!0,this.geometryChange(),this}rawBBox(){return this._bbox()}toString(e){let t=``,n=this.segments,r=n.length;if(r>0){let i=[],a=zr(e),o;for(let e=1;e<r;e++){let t=Br(n[e-1],n[e]);t!==o&&(o=t,i.push(t)),t===`L`?i.push(a(n[e].anchor())):i.push(a(n[e-1].controlOut(),n[e].controlIn(),n[e].anchor()))}t=`M`+a(n[0].anchor())+` `+i.join(` `),this.options.closed&&(t+=`Z`)}return t}_containsPoint(e){let t=this.segments,n=t.length,r=0,i,a;for(let o=1;o<n;o++)i=t[o-1],a=t[o],r+=i._intersectionsTo(a,e);return(this.options.closed||!t[0].anchor().equals(t[n-1].anchor()))&&(r+=or(t[0].anchor(),t[n-1].anchor(),e)),r%2!=0}_isOnPath(e,t){let n=this.segments,r=n.length,i=t||this.options.stroke.width;if(r>1){if(n[0]._isOnPathTo(n[1],e,i,`start`))return!0;for(let t=2;t<=r-2;t++)if(n[t-1]._isOnPathTo(n[t],e,i))return!0;if(n[r-2]._isOnPathTo(n[r-1],e,i,`end`))return!0}return!1}_bbox(e){let t=this.segments,n=t.length,r;if(n===1)r=new j(t[0].anchor().transformCopy(e),Cn.ZERO);else if(n>0)for(let i=1;i<n;i++){let n=t[i-1].bboxTo(t[i],e);r=r?j.union(r,n):n}return r}static parse(e,t){return Vr.parse(e,t)}static fromRect(t,n){let r=new e(n),[i,a]=t.cornerRadius;if(i===0&&a===0)r.moveTo(t.topLeft()).lineTo(t.topRight()).lineTo(t.bottomRight()).lineTo(t.bottomLeft()).close();else{let{x:e,y:n}=t.origin,o=t.width(),s=t.height();i=xt(i,0,o/2),a=xt(a,0,s/2),r.moveTo(e+i,n).lineTo(e+o-i,n).arcTo([e+o,n+a],i,a,!1).lineTo(e+o,n+s-a).arcTo([e+o-i,n+s],i,a,!1).lineTo(e+i,n+s).arcTo([e,n+s-a],i,a,!1).lineTo(e,n+a).arcTo([e+i,n],i,a,!1)}return r}static fromPoints(t,n){if(t){let r=new e(n);for(let e=0;e<t.length;e++){let n=A.create(t[e]);n&&(e===0?r.moveTo(n):r.lineTo(n))}return r}}static curveFromPoints(t,n){if(t){let r=mr(t),i=new e(n);return i.segments.push.apply(i.segments,r),i}}static fromArc(t,n){let r=new e(n),i=t.startAngle,a=t.pointAt(i);return r.moveTo(a.x,a.y),r.arc(i,t.endAngle,t.radiusX,t.radiusY,t.anticlockwise),r}},Vr=class e extends jn(Nn(Dn)){static parse(t,n){return Ir(new e(n),t)}toString(e){let t=this.paths,n=``;if(t.length>0){let r=[];for(let n=0;n<t.length;n++)r.push(t[n].toString(e));n=r.join(` `)}return n}get nodeType(){return`MultiPath`}constructor(e){super(e),this.paths=new Xn,this.paths.addObserver(this),this.options.stroke===void 0&&this.stroke(`#000`)}moveTo(e,t){let n=new N;return n.moveTo(e,t),this.paths.push(n),this}lineTo(e,t){return this.paths.length>0&&bt(this.paths).lineTo(e,t),this}curveTo(e,t,n){return this.paths.length>0&&bt(this.paths).curveTo(e,t,n),this}arc(e,t,n,r,i){return this.paths.length>0&&bt(this.paths).arc(e,t,n,r,i),this}arcTo(e,t,n,r,i,a){return this.paths.length>0&&bt(this.paths).arcTo(e,t,n,r,i,a),this}close(){return this.paths.length>0&&bt(this.paths).close(),this}_bbox(e){return Lr(this.paths,!0,e)}rawBBox(){return Lr(this.paths,!1)}_containsPoint(e){let t=this.paths;for(let n=0;n<t.length;n++)if(t[n]._containsPoint(e))return!0;return!1}_isOnPath(e){let t=this.paths,n=this.options.stroke.width;for(let r=0;r<t.length;r++)if(t[r]._isOnPath(e,n))return!0;return!1}_clippedBBox(e){return Rr(this.paths,this.currentTransform(e))}},Hr=class extends jn(Nn(In(Dn))){get nodeType(){return`Arc`}constructor(e=new Un,t={}){super(t),this.geometry(e),this.options.stroke===void 0&&this.stroke(`#000`)}_bbox(e){return this._geometry.bbox(e)}rawBBox(){return this.geometry().bbox()}toPath(){let e=new N,t=this.geometry().curvePoints();if(t.length>0){e.moveTo(t[0].x,t[0].y);for(let n=1;n<t.length;n+=3)e.curveTo(t[n],t[n+1],t[n+2])}return e}_containsPoint(e){return this.geometry().containsPoint(e)}_isOnPath(e){return this.geometry()._isOnPath(e,this.options.stroke.width/2)}},Ur=class extends jn(lr(Dn,[`position`])){get nodeType(){return`Text`}constructor(e,t=new A,n={}){super(n),this.content(e),this.position(t),this.options.font||(this.options.font=`12px sans-serif`),this.options.fill===void 0&&this.fill(`#000`)}content(e){return e===void 0?this.options.get(`content`):(this.options.set(`content`,e),this)}measure(){return Yt(this.content(),{font:this.options.get(`font`)})}rect(){let e=this.measure();return new j(this.position().clone(),[e.width,e.height])}bbox(e){let t=Sn(this.currentTransform(e));return this.rect().bbox(t)}rawBBox(){return this.rect().bbox()}_containsPoint(e){return this.rect().containsPoint(e)}},Wr=class extends In(Dn,[`rect`]){get nodeType(){return`Image`}constructor(e,t=new j,n={}){super(n),this.src(e),this.rect(t)}src(e){return e===void 0?this.options.get(`src`):(this.options.set(`src`,e),this)}bbox(e){let t=Sn(this.currentTransform(e));return this._rect.bbox(t)}rawBBox(){return this._rect.bbox()}_containsPoint(e){return this._rect.containsPoint(e)}_hasFill(){return this.src()}};let Gr=(e,t)=>class extends e{traverse(e){let n=this[t];for(let t=0;t<n.length;t++){let r=n[t];r.traverse?r.traverse(e):e(r)}return this}};var P=class extends Gr(Dn,`children`){get nodeType(){return`Group`}constructor(e){super(e),this.children=[]}childrenChange(e,t,n){this.trigger(`childrenChange`,{action:e,items:t,index:n})}append(){return et(this.children,arguments),this._reparent(arguments,this),this.childrenChange(`add`,arguments),this}insert(e,t){return this.children.splice(e,0,t),t.parent=this,this.childrenChange(`add`,[t],e),this}insertAt(e,t){return this.insert(t,e)}remove(e){let t=this.children.indexOf(e);return t>=0&&(this.children.splice(t,1),e.parent=null,this.childrenChange(`remove`,[e],t)),this}removeAt(e){if(0<=e&&e<this.children.length){let t=this.children[e];this.children.splice(e,1),t.parent=null,this.childrenChange(`remove`,[t],e)}return this}clear(){let e=this.children;return this.children=[],this._reparent(e,null),this.childrenChange(`remove`,e,0),this}bbox(e){return Lr(this.children,!0,this.currentTransform(e))}rawBBox(){return Lr(this.children,!1)}_clippedBBox(e){return Rr(this.children,this.currentTransform(e))}currentTransform(e){return Dn.prototype.currentTransform.call(this,e)||null}containsPoint(e,t){if(this.visible()){let n=this.children,r=this.currentTransform(t);for(let t=0;t<n.length;t++)if(n[t].containsPoint(e,r))return!0}return!1}_reparent(e,t){for(let n=0;n<e.length;n++){let r=e[n],i=r.parent;i&&i!==this&&i.remove&&i.remove(r),r.parent=t}}};function Kr(e,t,n){let r=n.transform()||M(),i=r.matrix();i.e+=e.x-t.origin.x,i.f+=e.y-t.origin.y,r.matrix(i),n.transform(r)}function qr(e,t,n,r,i){let a;return a=n===`start`?t.origin[r]:n===`end`?t.origin[r]+t.size[i]-e:t.origin[r]+(t.size[i]-e)/2,a}function Jr(e,t,n,r,i){let a;return a=n===`start`?t.origin[r]+t.size[i]-e:n===`end`?t.origin[r]:t.origin[r]+(t.size[i]-e)/2,a}let Yr={alignContent:`start`,justifyContent:`start`,alignItems:`start`,spacing:0,orientation:`horizontal`,lineSpacing:0,wrap:!0,revers:!1},Xr=(e,t)=>{e.forEach(t)},Zr=(e,t)=>{let n=e.length;for(let r=n-1;r>=0;r--)t(e[r],r)};var Qr=class extends P{constructor(e,t){super(Object.assign({},Yr,t)),this._rect=e,this._fieldMap={}}rect(e){return e?(this._rect=e,this):this._rect}appendBreak(){let e=new P;return e._isBreakMarker=!0,this.append(e),this}_initMap(){let e=this.options,t=this._fieldMap;e.orientation===`horizontal`?(t.sizeField=`width`,t.groupsSizeField=`height`,t.groupAxis=`x`,t.groupsAxis=`y`):(t.sizeField=`height`,t.groupsSizeField=`width`,t.groupAxis=`y`,t.groupsAxis=`x`),e.reverse?(this.forEach=Zr,this.justifyAlign=Jr):(this.forEach=Xr,this.justifyAlign=qr)}reflow(){if(!this._rect||this.children.length===0)return;this._initMap(),this.options.transform&&this.transform(null);let e=this.options,t=this._rect,{groups:n,groupsSize:r}=this._initGroups(),{sizeField:i,groupsSizeField:a,groupAxis:o,groupsAxis:s}=this._fieldMap,c=new A,l=new A,u=new Cn,d=qr(r,t,e.alignContent,s,a),f,p,m,h=(t,n)=>{let r=p.elements[n];l[o]=f,l[s]=qr(t.size[a],m,e.alignItems,s,a),Kr(l,t,r),f+=t.size[i]+e.spacing};for(let r=0;r<n.length;r++)p=n[r],c[o]=f=this.justifyAlign(p.size,t,e.justifyContent,o,i),c[s]=d,u[i]=p.size,u[a]=p.lineSize,m=new j(c,u),this.forEach(p.bboxes,h),d+=p.lineSize+e.lineSpacing;if(!e.wrap&&p.size>t.size[i]){let n=t.size[i]/m.size[i],r=m.topLeft().scale(n,n),c=qr(m.size[a]*n,t,e.alignContent,s,a),l=M();o===`x`?l.translate(t.origin.x-r.x,c-r.y):l.translate(c-r.x,t.origin.y-r.y),l.scale(n,n),this.transform(l)}}_initGroups(){let{options:e,children:t}=this,{lineSpacing:n,wrap:r,spacing:i}=e,a=this._fieldMap.sizeField,o=this._newGroup(),s=[],c=function(){s.push(o),l+=o.lineSize+n},l=-n;for(let e=0;e<t.length;e++){let n=t[e],s=t[e].clippedBBox();if(n._isBreakMarker){o.bboxes.length>0&&(c(),o=this._newGroup());continue}n.visible()&&s&&(r&&o.size+s.size[a]+i>this._rect.size[a]?o.bboxes.length===0?(this._addToGroup(o,s,n),c(),o=this._newGroup()):(c(),o=this._newGroup(),this._addToGroup(o,s,n)):this._addToGroup(o,s,n))}return o.bboxes.length&&c(),{groups:s,groupsSize:l}}_addToGroup(e,t,n){e.size+=t.size[this._fieldMap.sizeField]+this.options.spacing,e.lineSize=Math.max(t.size[this._fieldMap.groupsSizeField],e.lineSize),e.bboxes.push(t),e.elements.push(n)}_newGroup(){return{lineSize:0,size:-this.options.spacing,bboxes:[],elements:[]}}},$r=class extends jn(Nn(In(Dn))){get nodeType(){return`Rect`}constructor(e=new j,t={}){super(t),this.geometry(e),this.options.stroke===void 0&&this.stroke(`#000`)}_bbox(e){return this._geometry.bbox(e)}rawBBox(){return this._geometry.bbox()}_containsPoint(e){return this._geometry.containsPoint(e)}_isOnPath(e){return this.geometry()._isOnPath(e,this.options.stroke.width/2)}};function ei(e,t,n,r,i){for(let a=0;a<e.length;a++){let o=e[a].clippedBBox();if(o){let s=o.origin.clone();s[r]=qr(o.size[i],t,n||`start`,r,i),Kr(s,o,e[a])}}}function ti(e,t,n){ei(e,t,n,`x`,`width`)}function ni(e,t,n){ei(e,t,n,`y`,`height`)}function ri(e,t,n,r){if(e.length>1){let i=new A,a=e[0].bbox;for(let o=1;o<e.length;o++){let s=e[o].element,c=e[o].bbox;i[t]=a.origin[t]+a.size[r],i[n]=c.origin[n],Kr(i,c,s),c.origin[t]=i[t],a=c}}}function ii(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],i=r.clippedBBox();i&&t.push({element:r,bbox:i})}return t}function ai(e){ri(ii(e),`x`,`y`,`width`)}function oi(e){ri(ii(e),`y`,`x`,`height`)}function si(e,t,n){let r=t.size[n],i=[],a=[],o=0,s,c,l=function(){a.push({element:s,bbox:c})};for(let t=0;t<e.length;t++)if(s=e[t],c=s.clippedBBox(),c){let e=c.size[n];o+e>r?a.length?(i.push(a),a=[],l(),o=e):(l(),i.push(a),a=[],o=0):(l(),o+=e)}return a.length&&i.push(a),i}function ci(e,t,n,r,i){let a=si(e,t,i),o=t.origin.clone(),s=[];for(let e=0;e<a.length;e++){let t=a[e],c=t[0];o[r]=c.bbox.origin[r],Kr(o,c.bbox,c.element),c.bbox.origin[n]=o[n],ri(t,n,r,i),s.push([]);for(let n=0;n<t.length;n++)s[e].push(t[n].element)}return s}function li(e,t){return ci(e,t,`x`,`y`,`width`)}function ui(e,t){return ci(e,t,`y`,`x`,`height`)}function di(e,t){let n=e.clippedBBox();if(n){let r=n.size,i=t.size;if(i.width<r.width||i.height<r.height){let t=Math.min(i.width/r.width,i.height/r.height),n=e.transform()||M();n.scale(t,t),e.transform(n)}}}var fi=class extends Yn{_change(){this.optionsChange({field:`stops`})}};function pi(e){return function(t){return t===void 0?this.options.get(e):(this.options.set(e,t),this)}}function mi(e,t){for(let n=0;n<t.length;n++)e[t[n]]=pi(t[n])}let hi=(e,t)=>{let n=class extends e{};return mi(n.prototype,t),n},gi=[`offset`,`color`,`opacity`];var _i=class e extends hi(qe,gi){constructor(e,t,n){super(),this.options=new Ye({offset:e,color:t,opacity:n===void 0?1:n}),this.options.addObserver(this)}static create(t){if(t!==void 0){let n;return n=t instanceof e?t:t.length>1?new e(t[0],t[1],t[2]):new e(t.offset,t.color,t.opacity),n}}},vi=class extends qe{get nodeType(){return`Gradient`}constructor(e={}){super(),this.stops=new fi(this._createStops(e.stops)),this.stops.addObserver(this),this._userSpace=e.userSpace,this.id=ot()}userSpace(e){return e===void 0?this._userSpace:(this._userSpace=e,this.optionsChange(),this)}_createStops(e=[]){let t=[];for(let n=0;n<e.length;n++)t.push(_i.create(e[n]));return t}addStop(e,t,n){this.stops.push(new _i(e,t,n))}removeStop(e){let t=this.stops.indexOf(e);t>=0&&this.stops.splice(t,1)}optionsChange(e){this.trigger(`optionsChange`,{field:`gradient`+(e?`.`+e.field:``),value:this})}geometryChange(){this.optionsChange()}};let yi=[`start`,`end`];var bi=class extends lr(vi,yi){constructor(e={}){super(e),this.start(e.start||new A),this.end(e.end||new A(1,0))}},xi=class extends lr(vi,[`center`]){constructor(e={}){super(e),this.center(e.center||new A),this._radius=e.radius===void 0?1:e.radius,this._fallbackFill=e.fallbackFill}radius(e){return e===void 0?this._radius:(this._radius=e,this.geometryChange(),this)}fallbackFill(e){return e===void 0?this._fallbackFill:(this._fallbackFill=e,this.optionsChange(),this)}};let Si=`#aba4a6`,Ci={width:2,gap:18},wi={radius:10,gap:10},Ti={size:18,gap:2};var Ei=class extends P{get nodeType(){return`Pattern`}constructor(e){super();let{width:t,height:n}=e;this._size=Cn.create([t,n]),this.id=ot()}size(e){return e?(this._size=Cn.create(e),this):this._size}};let Di=(e,t,n)=>{t&&e.append(new $r(new j([0,0],n),{fill:{color:t},stroke:null}))};function Oi(e={}){let{gap:t=wi.gap,radius:n=wi.radius,color:r=Si,background:i}=e,a={fill:{color:r},stroke:null},o=4*n+2*t,s=3*n+1.5*t,c=[o/2,n+1/2*t],l=[0,s],u=[o,s],d=new Ei({width:o,height:o});return Di(d,i,[o,o]),d.append(new Ln(new An(c,n),a),new Ln(new An(l,n),a),new Ln(new An(u,n),a)),d}function ki(e={}){let{gap:t=Ci.gap,width:n=Ci.width,color:r=Si,background:i}=e,a=n+t,o={fill:null,stroke:{color:r,width:n/2}},s=new Ei({width:a,height:a});Di(s,i,[a,a]);let c=n/4,l=a-n/4,u=new N(o);u.moveTo(c,0).lineTo(c,a);let d=new N(o);return d.moveTo(l,0).lineTo(l,a),s.append(u,d),s}function Ai(e={}){let{gap:t=Ci.gap,width:n=Ci.width,color:r=Si,background:i}=e,a=Math.sqrt(2)*(n+t),o={fill:null,stroke:{color:r,width:n}},s=new Ei({width:a,height:a});Di(s,i,[a,a]);let c=new N(o);c.moveTo(0,0).lineTo(a,a);let l=new N(o);return l.moveTo(a,0).lineTo(0,a),s.append(c,l),s}function ji(e={}){let{gap:t=Ci.gap,width:n=Ci.width,color:r=Si,background:i}=e,a=Math.sqrt(2)*(n+t),o={fill:null,stroke:{color:r,width:n,lineCap:`square`}},s=new Ei({width:a,height:a});Di(s,i,[a,a]);let c=new N(o);c.moveTo(0,a/2).lineTo(a/2,0);let l=new N(o);return l.moveTo(a/2,a).lineTo(a,a/2),s.append(c,l),s}function Mi(e={}){let{gap:t=Ti.gap,size:n=Ti.size,color:r=Si,background:i}=e,a=n+t,o=t/2,s={fill:{color:r},stroke:null},c=new Ei({width:a,height:a});Di(c,i,[a,a]);let l=new $r(new j([o,o],[n,n]),s);return c.append(l),c}var Ni=l({easeInOutBack:()=>Ki,easeInOutCubic:()=>Ri,easeInOutExpo:()=>Wi,easeInOutQuad:()=>Bi,easeInOutQuint:()=>Ji,easeInOutSine:()=>Hi,easeOutBack:()=>Gi,easeOutCirc:()=>Vi,easeOutCubic:()=>Li,easeOutElastic:()=>Ii,easeOutExpo:()=>Ui,easeOutQuad:()=>zi,easeOutQuint:()=>qi,linear:()=>Fi,swing:()=>Pi});function Pi(e){return .5-Math.cos(e*Math.PI)/2}function Fi(e){return e}function Ii(e){return e===0||e===1?e:2**(-10*e)*Math.sin((e-.125)*(1.1*Math.PI)/.5)+1}function Li(e){return 1-(1-e)**3}function Ri(e){return e<.5?4*e*e*e:1-(-2*e+2)**3/2}function zi(e){return 1-(1-e)**2}function Bi(e){return e<.5?2*e*e:1-(-2*e+2)**2/2}function Vi(e){return Math.sqrt(1-(e-1)**2)}function Hi(e){return-(Math.cos(Math.PI*e)-1)/2}function Ui(e){return e===1?1:1-2**(-10*e)}function Wi(e){return e===0||e===1?e:e<.5?2**(20*e-10)/2:(2-2**(-20*e+10))/2}function Gi(e){return 1+2.70158*(e-1)**3+1.70158*(e-1)**2}function Ki(e){let t=1.70158*1.525;return e<.5?(2*e)**2*(3.5949095*2*e-t)/2:((2*e-2)**2*(3.5949095*(e*2-2)+t)+2)/2}function qi(e){return 1-(1-e)**5}function Ji(e){return e<.5?16*e**5:1-(-2*e+2)**5/2}let Yi;var Xi=class e extends de{static get current(){return Yi||=new e,Yi}constructor(){super(),this._items=[]}register(e,t){this._items.push({name:e,type:t})}create(e,t){let n=this._items,r;if(t&&t.type){let e=t.type.toLowerCase();for(let t=0;t<n.length;t++)if(n[t].name.toLowerCase()===e){r=n[t];break}}if(r)return new r.type(e,t)}};function Zi(e){return Math.min(1,Math.max(0,e))}function Qi(e,t,n,r){let i=3*e,a=3*(n-e)-i,o=1-i-a,s=3*t,c=3*(r-t)-s,l=1-s-c;function u(e){return((o*e+a)*e+i)*e}function d(e){return((l*e+c)*e+s)*e}function f(e){return(3*o*e+2*a)*e+i}function p(e){let t=e;for(let n=0;n<8;n++){let n=u(t)-e,r=f(t);if(Math.abs(n)<1e-7)return t;if(Math.abs(r)<1e-7)break;t-=n/r}let n=0,r=1;t=e;for(let t=0;t<24;t++){let t=(n+r)/2,i=u(t);if(Math.abs(i-e)<1e-7)return t;i<e?n=t:r=t}return(n+r)/2}return e=>{let t=Zi(e);return t===0||t===1?t:d(p(t))}}let $i={duration:500,easing:`swing`};var ea=class extends de{static create(e,t,n){return Xi.current.create(e,t,n)}get options(){return this._options||$i}set options(e){this._options=e}constructor(e,t){super(),this.options=Object.assign({},this.options,t),this.element=e}setup(){}step(){}play(){let e=this.options;typeof e.easing==`string`&&Ni[e.easing]?e.easing=Ni[e.easing]:Array.isArray(e.easing)&&e.easing.length===4?e.easing=Qi(...e.easing):e.easing=Ni[$i.easing];let{duration:t,delay:n=0,easing:r}=e,i=ke()+n,a=i+t;t===0?(this.step(1),this.abort()):setTimeout(()=>{let e=()=>{if(this._stopped)return;let n=ke(),o=xt(n-i,0,t),s=r(o/t);this.step(s),n<a?ve(e):this.abort()};e()},n)}abort(){this._stopped=!0}destroy(){this.abort()}};let ta;var na=class e extends de{static get current(){return ta||=new e,ta}parse(e,t){return Ir(new Vr(t),e)}},ra=class extends de{constructor(e){super(),this.childNodes=[],this.parent=null,e&&(this.srcElement=e,this.observe())}destroy(){this.srcElement&&this.srcElement.removeObserver(this);let e=this.childNodes;for(let t=0;t<e.length;t++)this.childNodes[t].destroy();this.parent=null}load(){}observe(){this.srcElement&&this.srcElement.addObserver(this)}append(e){this.childNodes.push(e),e.parent=this}insertAt(e,t){this.childNodes.splice(t,0,e),e.parent=this}remove(e,t){let n=e+t;for(let t=e;t<n;t++)this.childNodes[t].removeSelf();this.childNodes.splice(e,t)}removeSelf(){this.clear(),this.destroy()}clear(){this.remove(0,this.childNodes.length)}invalidate(){this.parent&&this.parent.invalidate()}geometryChange(){this.invalidate()}optionsChange(){this.invalidate()}childrenChange(e){e.action===`add`?this.load(e.items,e.index):e.action===`remove`&&this.remove(e.index,e.items.length),this.invalidate()}};let ia=[`click`,`mouseenter`,`mouseleave`,`mousemove`,`resize`];var aa=class extends fe{constructor(e,t){super(),this.options=Object.assign({},t),this.element=e,this.element._kendoExportVisual=this.exportVisual.bind(this),this._click=this._handler(`click`),this._mouseenter=this._handler(`mouseenter`),this._mouseleave=this._handler(`mouseleave`),this._mousemove=this._handler(`mousemove`),this._visual=new P,Mt(e,this.options),this.bind(ia,this.options),this._enableTracking()}draw(e){this._visual.children.push(e)}clear(){this._visual.children=[]}destroy(){this._visual=null,this.element._kendoExportVisual=null,this.unbind()}eventTarget(e){let t=vt(e),n;for(;!n&&t&&(n=t._kendoNode,t!==this.element);)t=t.parentElement;if(n)return n.srcElement}exportVisual(){return this._visual}getSize(){return Mt(this.element)}currentSize(e){if(e)this._size=e;else return this._size}setSize(e){Mt(this.element,e),this.currentSize(e),this._resize()}resize(e){let t=this.getSize(),n=this.currentSize();(e||(t.width>0||t.height>0)&&(!n||t.width!==n.width||t.height!==n.height))&&(this.currentSize(t),this._resize(t,e),this.trigger(`resize`,t))}size(e){if(!e)return this.getSize();this.setSize(e)}suspendTracking(){this._suspendedTracking=!0}resumeTracking(){this._suspendedTracking=!1}_enableTracking(){}_resize(){}_handler(e){return t=>{let n=this.eventTarget(t);n&&!this._suspendedTracking&&this.trigger(e,{element:n,originalEvent:t,type:e})}}_elementOffset(){let e=this.element,t=Pt(e),{left:n,top:r}=kt(e);return{left:n+t.left,top:r+t.top}}_surfacePoint(e){let t=this._elementOffset(),n=_t(e),r=n.x-t.left,i=n.y-t.top,a=zt(this.element).invert();return new A(r,i).transform(a)}};function oa(e,t){return t==null?``:` ${e}="${t}" `}function sa(e){let t=``;for(let n=0;n<e.length;n++)t+=oa(e[n][0],e[n][1]);return t}function ca(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n][1];r!==void 0&&(t+=e[n][0]+`:`+r+`;`)}if(t!==``)return t}let la={},ua=`http://www.w3.org/2000/svg`,da=`none`,fa=(e,t)=>{bn(e,t)},pa=(e,t)=>{let n=new DOMParser().parseFromString(_n(t),`text/xml`);vn(n);let r=document.adoptNode(n.documentElement);e.insertBefore(r,e.firstChild)},ma,ha=(e,t)=>{if(ma)return ma(e,t);if(ma=fa,typeof document<`u`){let e=document.createElement(`div`),t=typeof DOMParser<`u`;e.innerHTML=`<svg xmlns='http://www.w3.org/2000/svg'></svg>`,t&&e.firstChild.namespaceURI!==`http://www.w3.org/2000/svg`&&(ma=pa)}return ma(e,t)},ga=`transform`,_a={clip:`clip-path`,fill:`fill`};function va(e,t){return e===`clip`||e===`fill`&&(!t||t.nodeType===`Gradient`||t.nodeType===`Pattern`)}var ya=class extends ra{constructor(e,t){super(e),this.definitions={},this.options=t}destroy(){this.element&&=(this.element._kendoNode=null,null),this.clearDefinitions(),super.destroy()}load(e,t){for(let n=0;n<e.length;n++){let r=e[n],i=r.children,a=new la[r.nodeType](r,this.options);t===void 0?this.append(a):this.insertAt(a,t),a.createDefinitions(),i&&i.length>0&&a.load(i);let o=this.element;o&&a.attachTo(o,t)}}root(){let e=this;for(;e.parent;)e=e.parent;return e}attachTo(e,t){let n=document.createElement(`div`);ha(n,`<svg xmlns='http://www.w3.org/2000/svg' version='1.1'>`+this.render()+`</svg>`);let r=n.firstChild.firstChild;r&&(t===void 0?e.appendChild(r):e.insertBefore(r,e.childNodes[t]||null),this.setElement(r))}setElement(e){this.element&&(this.element._kendoNode=null),this.element=e,this.element._kendoNode=this;let t=this.childNodes;for(let n=0;n<t.length;n++){let r=e.childNodes[n];t[n].setElement(r)}}clear(){this.clearDefinitions(),this.element&&(this.element.innerHTML=``);let e=this.childNodes;for(let t=0;t<e.length;t++)e[t].destroy();this.childNodes=[]}removeSelf(){if(this.element){let e=this.element.parentNode;e&&e.removeChild(this.element),this.element=null}super.removeSelf()}template(){return this.renderChildren()}render(){return this.template()}renderChildren(){let e=this.childNodes,t=``;for(let n=0;n<e.length;n++)t+=e[n].render();return t}optionsChange(e){let{field:t,value:n}=e;t===`visible`?this.css(`display`,n?``:da):_a[t]&&va(t,n)?this.updateDefinition(t,n):t===`opacity`?this.attr(`opacity`,n):t===`cursor`?this.css(`cursor`,n):t===`id`&&(n?this.attr(`id`,n):this.removeAttr(`id`)),super.optionsChange(e)}accessibilityOptionsChange(e){let{field:t,value:n}=e;t===`role`?n?this.attr(`role`,n):this.removeAttr(`role`):t===`ariaLabel`?n?this.attr(`aria-label`,we(n)):this.removeAttr(`aria-label`):t===`ariaRoleDescription`?n?this.attr(`aria-roledescription`,we(n)):this.removeAttr(`aria-roledescription`):t===`ariaChecked`?n===void 0?this.removeAttr(`aria-checked`):this.attr(`aria-checked`,n):t===`className`&&this.className(n)}attr(e,t){this.element&&this.element.setAttribute(e,t)}allAttr(e){for(let t=0;t<e.length;t++)this.attr(e[t][0],e[t][1])}toggleAttr(e,t){t?this.attr(e,t):this.removeAttr(e)}css(e,t){this.element&&(this.element.style[e]=t)}allCss(e){for(let t=0;t<e.length;t++)this.css(e[t][0],e[t][1])}className(e){this.element&&(this.element.classList.remove(...this.element.classList),e&&e.split(` `).forEach(e=>{e&&this.element.classList.add(e)}))}removeAttr(e){this.element&&this.element.removeAttribute(e)}mapTransform(e){let t=[];return e&&t.push([ga,`matrix(`+e.matrix().toString(6)+`)`]),t}renderTransform(){return sa(this.mapTransform(this.srcElement.transform()))}transformChange(e){e?this.allAttr(this.mapTransform(e)):this.removeAttr(ga)}mapStyle(){let e=this.srcElement.options,t=[[`cursor`,e.cursor]];return e.visible===!1&&t.push([`display`,da]),t}renderStyle(){return oa(`style`,ca(this.mapStyle(!0)))}renderOpacity(){return oa(`opacity`,this.srcElement.options.opacity)}renderId(){return oa(`id`,this.srcElement.options.id)}renderClassName(){return oa(`class`,this.srcElement.options.className)}renderRole(){return oa(`role`,this.srcElement.options.role)}renderAriaLabel(){let e=this.srcElement.options.ariaLabel;return e&&=we(e),oa(`aria-label`,e)}renderAriaRoleDescription(){let e=this.srcElement.options.ariaRoleDescription;return e&&=we(e),oa(`aria-roledescription`,e)}renderAriaChecked(){return oa(`aria-checked`,this.srcElement.options.ariaChecked)}createDefinitions(){let e=this.srcElement,t=this.definitions;if(e){let n=e.options,r;for(let e in _a){let i=n.get(e);i&&va(e,i)&&(t[e]=i,r=!0)}r&&this.definitionChange({action:`add`,definitions:t})}}definitionChange(e){this.parent&&this.parent.definitionChange(e)}updateDefinition(e,t){let n=this.definitions,r=n[e],i=_a[e],a={};r&&(a[e]=r,this.definitionChange({action:`remove`,definitions:a}),delete n[e]),t?(a[e]=t,this.definitionChange({action:`add`,definitions:a}),n[e]=t,this.attr(i,this.refUrl(t.id))):r&&this.removeAttr(i)}clearDefinitions(){let e=this.definitions;this.definitionChange({action:`remove`,definitions:e}),this.definitions={}}renderDefinitions(){return sa(this.mapDefinitions())}mapDefinitions(){let e=this.definitions,t=[];for(let n in e){let r=e[n];t.push([_a[n],this.refUrl(r.id)])}return t}refUrl(e){return`url(#${e})`}},ba=class extends ya{template(){return`<stop ${this.renderOffset()} ${this.renderStyle()} />`}renderOffset(){return oa(`offset`,this.srcElement.offset())}mapStyle(){let e=this.srcElement;return[[`stop-color`,e.color()],[`stop-opacity`,e.opacity()]]}optionsChange(e){e.field===`offset`?this.attr(e.field,e.value):(e.field===`color`||e.field===`opacity`)&&this.css(`stop-`+e.field,e.value)}},xa=class extends ya{constructor(e){super(e),this.id=e.id,this.loadStops()}loadStops(){let e=this.srcElement.stops,t=this.element;for(let n=0;n<e.length;n++){let r=new ba(e[n]);this.append(r),t&&r.attachTo(t)}}optionsChange(e){e.field===`gradient.stops`?(ra.prototype.clear.call(this),this.loadStops()):e.field===`gradient`&&this.allAttr(this.mapCoordinates())}renderCoordinates(){return sa(this.mapCoordinates())}mapSpace(){return[`gradientUnits`,this.srcElement.userSpace()?`userSpaceOnUse`:`objectBoundingBox`]}},Sa=class extends xa{template(){return`<linearGradient id='${this.id}' ${this.renderCoordinates()}>${this.renderChildren()}</linearGradient>`}mapCoordinates(){let e=this.srcElement,t=e.start(),n=e.end();return[[`x1`,t.x],[`y1`,t.y],[`x2`,n.x],[`y2`,n.y],this.mapSpace()]}},Ca=class extends xa{template(){return`<radialGradient id='${this.id}' ${this.renderCoordinates()}>${this.renderChildren()}</radialGradient>`}mapCoordinates(){let e=this.srcElement,t=e.center(),n=e.radius();return[[`cx`,t.x],[`cy`,t.y],[`r`,n],this.mapSpace()]}},wa=class extends ya{constructor(e){super(e),this.id=e.id,this.load(e.children)}template(){let e=this.srcElement.size().getWidth(),t=this.srcElement.size().getHeight();return`<pattern id='${this.srcElement.id}' width='${e}' height='${t}' patternUnits='userSpaceOnUse'>${this.renderChildren()}</pattern>`}},Ta=class extends ya{constructor(e){super(),this.srcElement=e,this.id=e.id,this.load([e])}renderClipRule(){return oa(`clip-rule`,`evenodd`)}template(){return`<clipPath ${this.renderClipRule()} id='${this.id}'>${this.renderChildren()}</clipPath>`}},Ea=class extends ya{constructor(){super(),this.definitionMap={}}attachTo(e){this.element=e}template(){return`<defs>${this.renderChildren()}</defs>`}definitionChange(e){let{definitions:t,action:n}=e;n===`add`?this.addDefinitions(t):n===`remove`&&this.removeDefinitions(t)}createDefinition(e,t){let n;return e===`clip`?n=Ta:e===`fill`&&(t instanceof bi?n=Sa:t instanceof xi?n=Ca:t.nodeType===`Pattern`&&(n=wa)),new n(t)}addDefinitions(e){for(let t in e)this.addDefinition(t,e[t])}addDefinition(e,t){let{element:n,definitionMap:r}=this,i=t.id,a=r[i];if(a)a.count++;else{let a=this.createDefinition(e,t);r[i]={element:a,count:1},this.append(a),n&&a.attachTo(this.element)}}removeDefinitions(e){for(let t in e)this.removeDefinition(e[t])}removeDefinition(e){let t=this.definitionMap,n=e.id,r=t[n];r&&(r.count--,r.count===0&&(this.remove(this.childNodes.indexOf(r.element),1),delete t[n]))}},Da=class extends ya{constructor(e){super(),this.options=e,this.defs=new Ea}attachTo(e){this.element=e,this.defs.attachTo(e.firstElementChild)}clear(){ra.prototype.clear.call(this)}template(){return this.defs.render()+this.renderChildren()}definitionChange(e){this.defs.definitionChange(e)}};let Oa={"fill.opacity":`fill-opacity`,"stroke.color":`stroke`,"stroke.width":`stroke-width`,"stroke.opacity":`stroke-opacity`};var ka=class extends ya{geometryChange(){this.attr(`d`,this.renderData()),this.invalidate()}optionsChange(e){switch(e.field){case`fill`:e.value?this.allAttr(this.mapFill(e.value)):this.removeAttr(`fill`);break;case`fill.color`:this.allAttr(this.mapFill({color:e.value}));break;case`stroke`:e.value?this.allAttr(this.mapStroke(e.value)):this.removeAttr(`stroke`);break;case`transform`:this.transformChange(e.value);break;default:{let t=Oa[e.field];t&&this.attr(t,e.value);break}}this.accessibilityOptionsChange(e),super.optionsChange(e)}content(){this.element&&(this.element.textContent=this.srcElement.content())}renderData(){return this.srcElement.toString(3)||void 0}mapStroke(e){let t=[];return e&&!yt(e.color)?(t.push([`stroke`,e.color]),t.push([`stroke-width`,e.width]),t.push([`stroke-linecap`,this.renderLinecap(e)]),t.push([`stroke-linejoin`,e.lineJoin]),e.opacity!==void 0&&t.push([`stroke-opacity`,e.opacity]),e.dashType!==void 0&&t.push([`stroke-dasharray`,this.renderDashType(e)])):t.push([`stroke`,da]),t}renderStroke(){return sa(this.mapStroke(this.srcElement.options.stroke))}renderDashType(e){let{dashType:t,width:n=1}=e;if(t&&t!==`solid`){let e=Tn[t.toLowerCase()],r=[];for(let t=0;t<e.length;t++)r.push(e[t]*n);return r.join(` `)}}renderLinecap(e){let{dashType:t,lineCap:n}=e;return t&&t!==`solid`?En:n}mapFill(e){let t=[];return e&&(e.nodeType===`Gradient`||e.nodeType===`Pattern`)||(e&&!yt(e.color)?(t.push([`fill`,e.color]),e.opacity!==void 0&&t.push([`fill-opacity`,e.opacity])):t.push([`fill`,da])),t}renderFill(){return sa(this.mapFill(this.srcElement.options.fill))}template(){return`<path ${this.renderId()} ${this.renderStyle()} ${this.renderOpacity()} ${oa(`d`,this.renderData())}${this.renderStroke()}${this.renderFill()}${this.renderDefinitions()}${this.renderTransform()}${this.renderClassName()} ${this.renderRole()}${this.renderAriaLabel()} ${this.renderAriaRoleDescription()}${this.renderAriaChecked()} ></path>`}},Aa=class extends ka{renderData(){return this.srcElement.toPath().toString(3)}},ja=class extends ka{geometryChange(){let e=this.center();this.attr(`cx`,e.x),this.attr(`cy`,e.y),this.attr(`r`,this.radius()),this.invalidate()}center(){return this.srcElement.geometry().center}radius(){return this.srcElement.geometry().radius}template(){return`<circle ${this.renderId()} ${this.renderStyle()} ${this.renderOpacity()}cx='${this.center().x}' cy='${this.center().y}' r='${this.radius()}'${this.renderStroke()} ${this.renderFill()} ${this.renderDefinitions()}${this.renderClassName()} ${this.renderRole()}${this.renderAriaLabel()} ${this.renderAriaRoleDescription()}${this.renderAriaChecked()} ${this.renderTransform()} ></circle>`}},Ma=class extends ya{template(){return`<g${this.renderId()+this.renderTransform()+this.renderClassName()+this.renderStyle()+this.renderOpacity()+this.renderRole()+this.renderAriaLabel()+this.renderAriaRoleDescription()+this.renderAriaChecked()+this.renderDefinitions()}>${this.renderChildren()}</g>`}optionsChange(e){let{field:t,value:n}=e;t===`transform`&&this.transformChange(n),this.accessibilityOptionsChange(e),super.optionsChange(e)}},Na=class extends ka{geometryChange(){this.allAttr(this.mapPosition()),this.invalidate()}optionsChange(e){e.field===`src`&&this.allAttr(this.mapSource()),super.optionsChange(e)}mapPosition(){let e=this.srcElement.rect(),t=e.topLeft();return[[`x`,t.x],[`y`,t.y],[`width`,e.width()+`px`],[`height`,e.height()+`px`]]}renderPosition(){return sa(this.mapPosition())}mapSource(e){let t=this.srcElement.src();return e&&(t=we(t)),[[`xlink:href`,t]]}renderSource(){return sa(this.mapSource(!0))}template(){return`<image preserveAspectRatio='none' ${this.renderId()} ${this.renderStyle()} ${this.renderTransform()} ${this.renderOpacity()}${this.renderPosition()} ${this.renderSource()} ${this.renderDefinitions()}${this.renderClassName()} ${this.renderRole()}${this.renderAriaLabel()} ${this.renderAriaRoleDescription()}${this.renderAriaChecked()} ></image>`}},Pa=class extends ka{renderData(){return this.srcElement.toString(3)||`undefined`}},Fa=class extends ka{geometryChange(){let e=this.srcElement.geometry();this.attr(`x`,e.origin.x),this.attr(`y`,e.origin.y),this.attr(`width`,e.size.width),this.attr(`height`,e.size.height),this.attr(`rx`,e.cornerRadius[0]),this.attr(`ry`,e.cornerRadius[1]),this.invalidate()}size(){return this.srcElement.geometry().size}origin(){return this.srcElement.geometry().origin}rx(){return this.srcElement.geometry().cornerRadius[0]}ry(){return this.srcElement.geometry().cornerRadius[1]}template(){return`<rect ${this.renderId()} ${this.renderStyle()} ${this.renderOpacity()} x='${this.origin().x}' y='${this.origin().y}' rx='${this.rx()}' ry='${this.ry()}' width='${this.size().width}' height='${this.size().height}' ${this.renderStroke()} ${this.renderFill()} ${this.renderDefinitions()} ${this.renderTransform()}${this.renderClassName()} ${this.renderRole()}${this.renderAriaLabel()} ${this.renderAriaRoleDescription()}${this.renderAriaChecked()} />`}};let Ia=/&(?:[a-zA-Z]+|#\d+);/g;function La(e){if(!e||typeof e!=`string`||!Ia.test(e))return e;let t=La._element;return Ia.lastIndex=0,e.replace(Ia,e=>(t.innerHTML=e,t.textContent||t.innerText))}typeof document<`u`&&(La._element=document.createElement(`span`));var Ra=class extends ka{geometryChange(){let e=this.pos();this.attr(`x`,e.x),this.attr(`y`,e.y),this.invalidate()}optionsChange(e){e.field===`font`?(this.attr(`style`,ca(this.mapStyle())),this.geometryChange()):e.field===`content`&&super.content(this.srcElement.content()),super.optionsChange(e)}mapStyle(e){let t=super.mapStyle(e),n=this.srcElement.options.font;return e&&(n=we(n)),t.push([`font`,n],[`white-space`,`pre`]),t}pos(){let e=this.srcElement.position(),t=this.srcElement.measure();return e.clone().setY(e.y+t.baseline)}renderContent(){let e=this.srcElement.content();return e=La(e),e=we(e),Ht(e)}renderTextAnchor(){let e;return(this.options||{}).rtl&&!(Oe.browser.msie||Oe.browser.edge)&&(e=`end`),oa(`text-anchor`,e)}renderPaintOrder(){let e=this.srcElement.options.paintOrder;return e?oa(`paint-order`,e):``}template(){return`<text ${this.renderId()} ${this.renderTextAnchor()} ${this.renderStyle()} ${this.renderOpacity()}x='${this.pos().x}' y='${this.pos().y}' ${this.renderStroke()} ${this.renderTransform()} ${this.renderDefinitions()}${this.renderPaintOrder()}${this.renderFill()}${this.renderClassName()} ${this.renderRole()}${this.renderAriaLabel()} ${this.renderAriaRoleDescription()}${this.renderAriaChecked()}>${this.renderContent()}</text>`}};la.Arc=Aa,la.Circle=ja,la.Group=Ma,la.Image=Na,la.MultiPath=Pa,la.Path=ka,la.Rect=Fa,la.Text=Ra;function za(e){let t;try{t=e.getScreenCTM?e.getScreenCTM():null}catch{}if(t){let n=-t.e%1,r=-t.f%1,i=e.style;(n!==0||r!==0)&&(i.left=n+`px`,i.top=r+`px`)}}var Ba=class extends aa{get type(){return`svg`}constructor(e,t){super(e,t),this._root=new Da(Object.assign({rtl:At(e,`direction`).direction===`rtl`},this.options)),ha(this.element,this._template(``)),this._rootElement=this.element.firstElementChild,this._rootElement.style.width=`100%`,this._rootElement.style.height=`100%`,this._rootElement.style.overflow=`hidden`,za(this._rootElement),this._root.attachTo(this._rootElement),Ot(this.element,{click:this._click,mouseover:this._mouseenter,mouseout:this._mouseleave,mousemove:this._mousemove}),this.resize()}destroy(){this._root&&(this._root.destroy(),this._root=null,this._rootElement&&this._rootElement.parentNode&&this._rootElement.parentNode.removeChild(this._rootElement),this._rootElement=null,Nt(this.element,{click:this._click,mouseover:this._mouseenter,mouseout:this._mouseleave,mousemove:this._mousemove})),super.destroy()}translate(e){let t=`${Math.round(e.x)} ${Math.round(e.y)} ${this._size.width} ${this._size.height}`;this._offset=e,this._rootElement.setAttribute(`viewBox`,t)}draw(e){super.draw(e),this._root.load([e])}clear(){super.clear(),this._root.clear()}svg(){return`<?xml version='1.0' ?>`+this._template()}exportVisual(){let{_visual:e,_offset:t}=this;if(t){let n=new P;n.children.push(e),n.transform(M().translate(-t.x,-t.y)),e=n}return e}_resize(){this._offset&&this.translate(this._offset)}_template(e){return`<svg ${typeof e==`string`?e:`style='width: 100%; height: 100%; overflow: hidden;' `}xmlns='${ua}' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1'>${this._root.render()}</svg>`}};let Va={};var Ha=class extends ra{constructor(e){super(e),e&&this.initClip()}initClip(){let e=this.srcElement.clip();e&&(this.clip=e,e.addObserver(this))}clear(){this.srcElement&&this.srcElement.removeObserver(this),this.clearClip(),super.clear()}clearClip(){this.clip&&(this.clip.removeObserver(this),delete this.clip)}setClip(e){this.clip&&(e.beginPath(),new Va[this.clip.nodeType](this.clip).renderPoints(e,this.clip),e.clip(`evenodd`))}optionsChange(e){e.field===`clip`&&(this.clearClip(),this.initClip()),super.optionsChange(e)}setTransform(e){if(this.srcElement){let t=this.srcElement.transform();t&&e.transform.apply(e,t.matrix().toArray(6))}}loadElements(e,t,n){for(let r=0;r<e.length;r++){let i=e[r],a=i.children,o=new Va[i.nodeType](i,n);a&&a.length>0&&o.load(a,t,n),t===void 0?this.append(o):this.insertAt(o,t)}}load(e,t,n){this.loadElements(e,t,n),this.invalidate()}setOpacity(e){if(this.srcElement){let t=this.srcElement.opacity();t!==void 0&&this.globalAlpha(e,t)}}globalAlpha(e,t){let n=t;n&&e.globalAlpha&&(n*=e.globalAlpha),e.globalAlpha=n}visible(){let e=this.srcElement;return!e||e&&e.options.visible!==!1}},Ua=class extends Gr(Ha,`childNodes`){renderTo(e){if(!this.visible())return;e.save(),this.setTransform(e),this.setClip(e),this.setOpacity(e);let t=this.childNodes;for(let n=0;n<t.length;n++){let r=t[n];r.visible()&&r.renderTo(e)}e.restore()}},Wa=class extends Gr(Ua,`childNodes`){constructor(e,t){super(),this.canvas=e,this.size=t,this.ctx=e.getContext(`2d`);let n=this._invalidate.bind(this);this.invalidate=Ae(()=>{ve(n)},16.666666666666668)}destroy(){super.destroy(),this.canvas=null,this.ctx=null}load(e,t,n){this.loadElements(e,t,n),this._invalidate()}_rescale(e){let{canvas:t,size:n}=this;t.width=n.width*e,t.height=n.height*e,this.ctx.scale(e,e)}_devicePixelRatio(){return typeof window.devicePixelRatio==`number`?window.devicePixelRatio:1}_invalidate(e){if(!this.ctx)return;let t=e&&e.fixedScale?1:this._devicePixelRatio();this._rescale(t),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.renderTo(this.ctx)}},Ga=class extends de{constructor(){super(),this.shapes=[]}_add(e,t){this.shapes.push({bbox:t,shape:e}),e._quadNode=this}pointShapes(e){let t=this.shapes,n=t.length,r=[];for(let i=0;i<n;i++)t[i].bbox.containsPoint(e)&&r.push(t[i].shape);return r}insert(e,t){this._add(e,t)}remove(e){let t=this.shapes,n=t.length;for(let r=0;r<n;r++)if(t[r].shape===e){t.splice(r,1);break}}},Ka=class e extends Ga{constructor(e){super(),this.children=[],this.rect=e}inBounds(e){let t=this.rect,n=t.bottomRight(),r=e.bottomRight();return t.origin.x<=e.origin.x&&t.origin.y<=e.origin.y&&r.x<=n.x&&r.y<=n.y}pointShapes(e){let t=this.children,n=t.length,r=super.pointShapes(e);for(let i=0;i<n;i++)et(r,t[i].pointShapes(e));return r}insert(e,t){let n=this.children,r=!1;if(this.inBounds(t)){if(this.shapes.length<4)this._add(e,t);else{n.length||this._initChildren();for(let i=0;i<n.length;i++)if(n[i].insert(e,t)){r=!0;break}r||this._add(e,t)}r=!0}return r}_initChildren(){let{rect:t,children:n}=this,r=t.center(),i=t.width()/2,a=t.height()/2;n.push(new e(new j([t.origin.x,t.origin.y],[i,a])),new e(new j([r.x,t.origin.y],[i,a])),new e(new j([t.origin.x,r.y],[i,a])),new e(new j([r.x,r.y],[i,a])))}};let qa=3e3,Ja=BigInt(1e4);var Ya=class extends de{constructor(){super(),this.initRoots()}initRoots(){this.rootMap={},this.root=new Ga,this.rootElements=[]}clear(){let e=this.rootElements;for(let t=0;t<e.length;t++)this.remove(e[t]);this.initRoots()}pointShape(e){let t=(this.rootMap[Math.floor(e.x/qa)]||{})[Math.floor(e.y/qa)],n=this.root.pointShapes(e);t&&(n=n.concat(t.pointShapes(e)));let r=$a(n);this.assignZindex(n,r),n.sort(Xa);for(let t=0;t<n.length;t++)if(n[t].containsPoint(e))return n[t]}assignZindex(e,t){let n=Qa(Ja,BigInt(t)),r=[],i=BigInt(0);for(let t=0;t<e.length;t++){let a=e[t],o=i,s=n,c=[];for(;a;)c.push(a),a=a.parent;for(;c.length;)a=c.pop(),o+=BigInt((a.parent?a.parent.children:this.rootElements).indexOf(a)+1)*s,s/=Ja;e[t]._zIndex=o,r.push(o)}r.sort(Za);for(let t=0;t<e.length;t++)e[t]._zIndex=r.indexOf(e[t]._zIndex)}optionsChange(e){(e.field===`transform`||e.field===`stroke.width`)&&this.bboxChange(e.element)}geometryChange(e){this.bboxChange(e.element)}bboxChange(e){if(e.nodeType===`Group`)for(let t=0;t<e.children.length;t++)this.bboxChange(e.children[t]);else e._quadNode&&e._quadNode.remove(e),this._insertShape(e)}add(e){let t=Array.isArray(e)?e.slice(0):[e];et(this.rootElements,t),this._insert(t)}childrenChange(e){if(e.action===`remove`)for(let t=0;t<e.items.length;t++)this.remove(e.items[t]);else this._insert(Array.prototype.slice.call(e.items,0))}_insert(e){let t;for(;e.length>0;)t=e.pop(),t.addObserver(this),t.nodeType===`Group`?et(e,t.children):this._insertShape(t)}_insertShape(e){let t=e.bbox();if(t){let n=this.getSectors(t),r=n[0][0],i=n[1][0];if(this.inRoot(n))this.root.insert(e,t);else{let n=this.rootMap;n[r]||(n[r]={}),n[r][i]||(n[r][i]=new Ka(new j([r*qa,i*qa],[qa,qa]))),n[r][i].insert(e,t)}}}remove(e){if(e.removeObserver(this),e.nodeType===`Group`){let t=e.children;for(let e=0;e<t.length;e++)this.remove(t[e])}else e._quadNode&&(e._quadNode.remove(e),delete e._quadNode)}inRoot(e){return e[0].length>1||e[1].length>1}getSectors(e){let t=e.bottomRight(),n=Math.floor(t.x/qa),r=Math.floor(t.y/qa),i=[[],[]];for(let t=Math.floor(e.origin.x/qa);t<=n;t++)i[0].push(t);for(let t=Math.floor(e.origin.y/qa);t<=r;t++)i[1].push(t);return i}};function Xa(e,t){return e._zIndex<t._zIndex?1:e._zIndex>t._zIndex?-1:0}function Za(e,t){return e<t?-1:+(e>t)}function Qa(e,t){let n=e,r=t,i=BigInt(1),a=i;for(;r;)r&i&&(a*=n),r>>=i,r&&(n*=n);return a}function $a(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n],i=[];for(;r;)i.push(r),r=r.parent;t=Math.max(t,i.length)}return t+1}var eo=class{constructor(e){e.bind(`mouseenter`,this._mouseenter.bind(this)),e.bind(`mouseleave`,this._mouseleave.bind(this)),this.element=e.element}clear(){this._resetCursor()}destroy(){this._resetCursor(),delete this.element}_mouseenter(e){let t=this._shapeCursor(e);t?(this._current||(this._defaultCursor=this._getCursor()),this._setCursor(t)):this._resetCursor()}_mouseleave(){this._resetCursor()}_shapeCursor(e){let t=e.element;for(;t&&t.options.cursor===void 0;)t=t.parent;if(t)return t.options.cursor}_getCursor(){if(this.element)return this.element.style.cursor}_setCursor(e){this.element&&(this.element.style.cursor=e,this._current=e)}_resetCursor(){this._current&&(this._setCursor(this._defaultCursor||``),delete this._current)}};function to(e,t){let n=t.segments;if(n.length===0)return;let r=n[0],i=r.anchor();e.moveTo(i.x,i.y);for(let t=1;t<n.length;t++){r=n[t],i=r.anchor();let a=n[t-1].controlOut(),o=r.controlIn();a&&o?e.bezierCurveTo(a.x,a.y,o.x,o.y,i.x,i.y):e.lineTo(i.x,i.y)}t.options.closed&&e.closePath()}function no(e,t){for(let n=0;n<t.length;n++){let r=t[n],i=He(r.color());i.a*=r.opacity(),e.addColorStop(r.offset(),i.toCssRgba())}}var ro=class extends Ha{renderTo(e){e.save(),this.setTransform(e),this.setClip(e),this.setOpacity(e),e.beginPath(),this.renderPoints(e,this.srcElement),this.setLineDash(e),this.setLineCap(e),this.setLineJoin(e),this.setFill(e),this.setStroke(e),e.restore()}setFill(e){let t=this.srcElement.options.fill,n=!1;return t&&(t.nodeType===`Gradient`?(this.setGradientFill(e,t),n=!0):t.nodeType===`Pattern`?(this.setPatternFill(e,t),n=!0):yt(t.color)||(e.fillStyle=t.color,e.save(),this.globalAlpha(e,t.opacity),e.fill(),e.restore(),n=!0)),n}setGradientFill(e,t){let n=this.srcElement.rawBBox(),r;if(t instanceof bi){let n=t.start(),i=t.end();r=e.createLinearGradient(n.x,n.y,i.x,i.y)}else if(t instanceof xi){let n=t.center();r=e.createRadialGradient(n.x,n.y,0,n.x,n.y,t.radius())}no(r,t.stops),e.save(),t.userSpace()||e.transform(n.width(),0,0,n.height(),n.origin.x,n.origin.y),e.fillStyle=r,e.fill(),e.restore()}setPatternFill(e,t){let n=t.size(),r=document.createElement(`canvas`),i=r.getContext(`2d`);r.width=n.getWidth(),r.height=n.getHeight(),this.childNodes.length=0,this.loadElements(t.children);let a=this.childNodes;for(let e=0;e<a.length;e++)a[e].renderTo(i);e.save(),e.fillStyle=e.createPattern(r,`repeat`),e.fill(),e.restore()}setStroke(e){let t=this.srcElement.options.stroke;if(t&&!yt(t.color)&&t.width>0)return e.strokeStyle=t.color,e.lineWidth=Dt(t.width,1),e.lineJoin=Dt(t.lineJoin,e.lineJoin),e.save(),this.globalAlpha(e,t.opacity),e.stroke(),e.restore(),!0}dashType(){let e=this.srcElement.options.stroke;if(e&&e.dashType)return e.dashType.toLowerCase()}setLineDash(e){let t=this.dashType();if(t&&t!==`solid`){let n=Tn[t];e.setLineDash?e.setLineDash(n):(e.mozDash=n,e.webkitLineDash=n)}}setLineCap(e){let t=this.dashType(),n=this.srcElement.options.stroke;t&&t!==`solid`?e.lineCap=En:n&&n.lineCap&&(e.lineCap=n.lineCap)}setLineJoin(e){let t=this.srcElement.options.stroke;t&&t.lineJoin&&(e.lineJoin=t.lineJoin)}renderPoints(e,t){to(e,t)}},io=class extends ro{renderPoints(e){to(e,this.srcElement.toPath())}},ao=class extends ro{renderPoints(e){let{center:t,radius:n}=this.srcElement.geometry();e.arc(t.x,t.y,n,0,Math.PI*2)}},oo=class extends ro{constructor(e,t){super(e),this.onLoad=this.onLoad.bind(this),this.onError=this.onError.bind(this),this.loading=rt();let n=this.img=new Image,r=e.src();t&&!/^data:/i.test(r)&&(n.crossOrigin=t),r&&(n.src=r),n.complete?this.onLoad():(n.onload=this.onLoad,n.onerror=this.onError)}renderTo(e){this.loading.state()===`resolved`&&(e.save(),this.setTransform(e),this.setClip(e),this.drawImage(e),e.restore())}optionsChange(e){e.field===`src`?(this.loading=rt(),this.img.src=this.srcElement.src()):super.optionsChange(e)}onLoad(){this.loading.resolve(),this.invalidate()}onError(){this.loading.reject(Error(`Unable to load image '`+this.img.src+`'. Check for connectivity and verify CORS headers.`))}drawImage(e){let t=this.srcElement.rect(),n=t.topLeft();e.drawImage(this.img,n.x,n.y,t.width(),t.height())}},so=class extends ro{renderPoints(e){let t=this.srcElement.paths;for(let n=0;n<t.length;n++)to(e,t[n])}},co=class extends ro{renderPoints(e){let t=this.srcElement.geometry(),[n,r]=t.cornerRadius;if(n===0&&r===0){let{origin:n,size:r}=t;e.rect(n.x,n.y,r.width,r.height)}else super.renderPoints(e,N.fromRect(t))}},lo=class extends ro{renderTo(e){let t=this.srcElement,n=t.position(),r=t.measure();e.save(),this.setTransform(e),this.setClip(e),this.setOpacity(e),e.beginPath(),e.font=t.options.font,e.textAlign=`left`,t.options.paintOrder===`stroke`?(this.stroke(e,t,n,r),this.fill(e,t,n,r)):(this.fill(e,t,n,r),this.stroke(e,t,n,r)),e.restore()}stroke(e,t,n,r){this.setStroke(e)&&(this.setLineDash(e),e.strokeText(t.content(),n.x,n.y+r.baseline))}fill(e,t,n,r){this.setFill(e)&&e.fillText(t.content(),n.x,n.y+r.baseline)}};Va.Arc=io,Va.Circle=ao,Va.Group=Ua,Va.Image=oo,Va.MultiPath=so,Va.Path=ro,Va.Rect=co,Va.Text=lo;var uo=class extends aa{get type(){return`canvas`}constructor(e,t){super(e,t),bn(this.element,this._template(this));let n=this.element.firstElementChild;n.style.width=`100%`,n.style.height=`100%`;let r=Mt(e);n.width=r.width,n.height=r.height,this._rootElement=n,this._root=new Wa(n,r),this._mouseTrackHandler=this._trackMouse.bind(this),Ot(this.element,{click:this._mouseTrackHandler,mousemove:this._mouseTrackHandler})}destroy(){super.destroy(),this._root&&=(this._root.destroy(),null),this._searchTree&&(this._searchTree.clear(),delete this._searchTree),this._cursor&&(this._cursor.destroy(),delete this._cursor),Nt(this.element,{click:this._mouseTrackHandler,mousemove:this._mouseTrackHandler}),this._rootElement&&this._rootElement.parentNode&&this._rootElement.parentNode.removeChild(this._rootElement),this._rootElement=null}draw(e){super.draw(e),this._root.load([e],void 0,this.options.cors),this._searchTree&&this._searchTree.add([e])}clear(){super.clear(),this._root.clear(),this._searchTree&&this._searchTree.clear(),this._cursor&&this._cursor.clear()}eventTarget(e){if(this._searchTree){let t=this._surfacePoint(e);return this._searchTree.pointShape(t)}}image(){let{_root:e,_rootElement:t}=this,n=[];e.traverse(e=>{e.loading&&n.push(e.loading)});let r=rt(),i=()=>{e._invalidate({fixedScale:!0});try{let e=t.toDataURL();r.resolve(e)}catch(e){r.reject(e)}};return Ct(n).then(i,i),r}suspendTracking(){super.suspendTracking(),this._searchTree&&(this._searchTree.clear(),delete this._searchTree)}resumeTracking(){if(super.resumeTracking(),!this._searchTree){this._searchTree=new Ya;let e=this._root.childNodes,t=[];for(let n=0;n<e.length;n++)t.push(e[n].srcElement);this._searchTree.add(t)}}_resize(){this._rootElement.width=this._size.width,this._rootElement.height=this._size.height,this._root.size=this._size,this._root.invalidate()}_template(){return`<canvas></canvas>`}_enableTracking(){this._searchTree=new Ya,this._cursor=new eo(this),super._enableTracking()}_trackMouse(e){if(this._suspendedTracking)return;let t=this.eventTarget(e);if(e.type!==`click`){let n=this._currentShape;n&&n!==t&&this.trigger(`mouseleave`,{element:n,originalEvent:e,type:`mouseleave`}),t&&n!==t&&this.trigger(`mouseenter`,{element:t,originalEvent:e,type:`mouseenter`}),this.trigger(`mousemove`,{element:t,originalEvent:e,type:`mousemove`}),this._currentShape=t}else t&&this.trigger(`click`,{element:t,originalEvent:e,type:`click`})}};let fo,po,mo=()=>typeof document<`u`,ho=()=>mo()&&document.createElement(`canvas`).getContext,go=()=>mo()&&document.implementation.hasFeature(`http://www.w3.org/TR/SVG11/feature#BasicStructure`,`1.1`);var _o=class e extends de{static get support(){return po||={canvas:ho(),svg:go()},po}static get current(){return fo||=new e,fo}constructor(){super(),this._items=[{name:`svg`,type:Ba},{name:`canvas`,type:uo}]}create(e,t){let n=this._items,r=n[0];if(t&&t.type){let e=t.type.toLowerCase();for(let t=0;t<n.length;t++)if(n[t].name===e){r=n[t];break}}if(r)return new r.type(e,t);Te(`Warning: Unable to create Kendo UI Drawing Surface. Possible causes:
- The browser does not support SVG and Canvas. User agent: ${navigator.userAgent}`)}},vo=class extends aa{static get support(){return _o.support}static create(e,t){return _o.current.create(e,t)}};function yo(e){let t=new Da({skipBaseHref:!0}),n=e.clippedBBox(),r=e;if(n){let t=n.getOrigin(),i=new P;i.transform(M().translate(-t.x,-t.y)),i.children.push(e),r=i}t.load([r]);let i=`<?xml version='1.0' ?><svg xmlns='${ua}' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1'>${t.render()}</svg>`;return t.destroy(),i}var bo=l({ArcNode:()=>Aa,CircleNode:()=>ja,ClipNode:()=>Ta,DefinitionNode:()=>Ea,GradientStopNode:()=>ba,GroupNode:()=>Ma,ImageNode:()=>Na,LinearGradientNode:()=>Sa,MultiPathNode:()=>Pa,Node:()=>ya,PathNode:()=>ka,RadialGradientNode:()=>Ca,RectNode:()=>Fa,RootNode:()=>Da,Surface:()=>Ba,TextNode:()=>Ra,exportGroup:()=>yo}),xo=l({ArcNode:()=>io,CircleNode:()=>ao,GroupNode:()=>Ua,ImageNode:()=>oo,MultiPathNode:()=>so,Node:()=>Ha,PathNode:()=>ro,RectNode:()=>co,RootNode:()=>Wa,Surface:()=>uo,TextNode:()=>lo});function So(e,t){let n={width:`800px`,height:`600px`,cors:`Anonymous`},r=e,i=e.clippedBBox();if(i){let t=i.getOrigin();r=new P,r.transform(M().translate(-t.x,-t.y)),r.children.push(e);let a=i.getSize();n.width=a.width+`px`,n.height=a.height+`px`}let a=Object.assign(n,t),o=document.createElement(`div`),s=o.style;s.display=`none`,s.width=a.width,s.height=a.height,document.body.appendChild(o);let c=new uo(o,a);c.suspendTracking(),c.draw(r);let l=c.image(),u=()=>{c.destroy(),document.body.removeChild(o)};return l.then(u,u),l}function Co(e,t){let n=yo(e);return(!t||!t.raw)&&(n=`data:image/svg+xml;base64,`+gt(n)),rt().resolve(n)}var wo=l({Animation:()=>ea,AnimationFactory:()=>Xi,Arc:()=>Hr,BaseNode:()=>ra,Circle:()=>Ln,Element:()=>Dn,Gradient:()=>vi,GradientStop:()=>_i,Group:()=>P,HasObservers:()=>qe,Image:()=>Wr,Layout:()=>Qr,LinearGradient:()=>bi,MultiPath:()=>Vr,OptionsStore:()=>Ye,Path:()=>N,PathParser:()=>na,Pattern:()=>Ei,QuadNode:()=>Ka,RadialGradient:()=>xi,Rect:()=>$r,ShapesQuadTree:()=>Ya,Surface:()=>vo,SurfaceFactory:()=>_o,Text:()=>Ur,align:()=>ti,canvas:()=>xo,crosshatchPattern:()=>Ai,diagonalStripesPattern:()=>ji,dotsPattern:()=>Oi,exportImage:()=>So,exportSVG:()=>Co,fit:()=>di,gridPattern:()=>Mi,parsePath:()=>Ir,stack:()=>ai,svg:()=>bo,util:()=>xn,vAlign:()=>ni,vStack:()=>oi,vWrap:()=>ui,verticalStripesPattern:()=>ki,wrap:()=>li});let To=typeof Uint8Array<`u`&&Oe.browser&&(!Oe.browser.msie||Oe.browser.version>9),Eo=function(){var e=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`;return{decode:function(t){for(var n=t.replace(/[^A-Za-z0-9\+\/\=]/g,``),r=0,i=n.length,a=[];r<i;){var o=e.indexOf(n.charAt(r++)),s=e.indexOf(n.charAt(r++)),c=e.indexOf(n.charAt(r++)),l=e.indexOf(n.charAt(r++)),u=o<<2|s>>>4,d=(s&15)<<4|c>>>2,f=(c&3)<<6|l;a.push(u),c!=64&&a.push(d),l!=64&&a.push(f)}return a},encode:function(t){for(var n=0,r=t.length,i=``;n<r;){var a=t[n++],o=t[n++],s=t[n++],c=a>>>2,l=(a&3)<<4|o>>>4,u=(o&15)<<2|s>>>6,d=s&63;n-r==2?u=d=64:n-r==1&&(d=64),i+=e.charAt(c)+e.charAt(l)+e.charAt(u)+e.charAt(d)}return i}}}();function Do(e){var t=0,n=0;e==null?e=To?new Uint8Array(256):[]:n=e.length;var r=To?function(t){if(t>=e.length){var n=new Uint8Array(Math.max(t+256,e.length*2));n.set(e,0),e=n}}:function(){},i=To?function(){return new Uint8Array(e.buffer,0,n)}:function(){return e},a=To?function(i){if(typeof i==`string`)return C(i);var a=i.length;r(t+a),e.set(i,t),t+=a,t>n&&(n=t)}:function(e){if(typeof e==`string`)return C(e);for(var t=0;t<e.length;++t)l(e[t])},o=To?function(t,n){if(e.buffer.slice)return new Uint8Array(e.buffer.slice(t,t+n));var r=new Uint8Array(n);return r.set(new Uint8Array(e.buffer,t,n)),r}:function(t,n){return e.slice(t,t+n)};function s(){return t>=n}function c(){return t<n?e[t++]:0}function l(i){r(t),e[t++]=i&255,t>n&&(n=t)}function u(){return c()<<8|c()}function d(e){l(e>>8),l(e)}function f(){var e=u();return e>=32768?e-65536:e}function p(e){d(e<0?e+65536:e)}function m(){return u()*65536+u()}function h(e){d(e>>>16&65535),d(e&65535)}function g(){var e=m();return e>=2147483648?e-4294967296:e}function _(e){h(e<0?e+4294967296:e)}function v(){return m()/65536}function y(e){h(Math.round(e*65536))}function b(){return g()/65536}function x(e){_(Math.round(e*65536))}function S(e){return te(e,c)}function ee(e){return String.fromCharCode.apply(String,S(e))}function C(e){for(var t=0;t<e.length;++t)l(e.charCodeAt(t))}function te(e,t){for(var n=Array(e),r=0;r<e;++r)n[r]=t();return n}var w={eof:s,readByte:c,writeByte:l,readShort:u,writeShort:d,readLong:m,writeLong:h,readFixed:v,writeFixed:y,readShort_:f,writeShort_:p,readLong_:g,writeLong_:_,readFixed_:b,writeFixed_:x,read:S,write:a,readString:ee,writeString:C,times:te,get:i,slice:o,offset:function(e){return e==null?t:(t=e,w)},skip:function(e){t+=e},toString:function(){throw Error(`FIX CALLER.  BinaryStream is no longer convertible to string!`)},length:function(){return n},saveExcursion:function(e){var n=t;try{return e()}finally{t=n}},writeBase64:function(e){window.atob?C(window.atob(e)):a(Eo.decode(e))},base64:function(){return Eo.encode(i())}};return w}function Oo(e){return e.map(function(e){var t=``;return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t}).join(``)}var ko=class{constructor(e,t){this.definition=t,this.length=t.length,this.offset=t.offset,this.file=e,this.rawData=e.raw,this.parse(e.raw)}raw(){return this.rawData.slice(this.offset,this.length)}parse(){}};(class extends ko{parse(e){e.offset(this.offset),this.version=e.readLong(),this.revision=e.readLong(),this.checkSumAdjustment=e.readLong(),this.magicNumber=e.readLong(),this.flags=e.readShort(),this.unitsPerEm=e.readShort(),this.created=e.read(8),this.modified=e.read(8),this.xMin=e.readShort_(),this.yMin=e.readShort_(),this.xMax=e.readShort_(),this.yMax=e.readShort_(),this.macStyle=e.readShort(),this.lowestRecPPEM=e.readShort(),this.fontDirectionHint=e.readShort_(),this.indexToLocFormat=e.readShort_(),this.glyphDataFormat=e.readShort_()}render(e){var t=Do();return t.writeLong(this.version),t.writeLong(this.revision),t.writeLong(0),t.writeLong(this.magicNumber),t.writeShort(this.flags),t.writeShort(this.unitsPerEm),t.write(this.created),t.write(this.modified),t.writeShort_(this.xMin),t.writeShort_(this.yMin),t.writeShort_(this.xMax),t.writeShort_(this.yMax),t.writeShort(this.macStyle),t.writeShort(this.lowestRecPPEM),t.writeShort_(this.fontDirectionHint),t.writeShort_(e),t.writeShort_(this.glyphDataFormat),t.get()}}),class extends ko{parse(e){e.offset(this.offset),this.file.head.indexToLocFormat===0?this.offsets=e.times(this.length/2,function(){return 2*e.readShort()}):this.offsets=e.times(this.length/4,e.readLong)}offsetOf(e){return this.offsets[e]}lengthOf(e){return this.offsets[e+1]-this.offsets[e]}render(e){for(var t=Do(),n=e[e.length-1]>65535,r=0;r<e.length;++r)n?t.writeLong(e[r]):t.writeShort(e[r]/2);return{format:+!!n,table:t.get()}}},class extends ko{parse(e){e.offset(this.offset),this.version=e.readLong(),this.ascent=e.readShort_(),this.descent=e.readShort_(),this.lineGap=e.readShort_(),this.advanceWidthMax=e.readShort(),this.minLeftSideBearing=e.readShort_(),this.minRightSideBearing=e.readShort_(),this.xMaxExtent=e.readShort_(),this.caretSlopeRise=e.readShort_(),this.caretSlopeRun=e.readShort_(),this.caretOffset=e.readShort_(),e.skip(8),this.metricDataFormat=e.readShort_(),this.numOfLongHorMetrics=e.readShort()}render(e){var t=Do();return t.writeLong(this.version),t.writeShort_(this.ascent),t.writeShort_(this.descent),t.writeShort_(this.lineGap),t.writeShort(this.advanceWidthMax),t.writeShort_(this.minLeftSideBearing),t.writeShort_(this.minRightSideBearing),t.writeShort_(this.xMaxExtent),t.writeShort_(this.caretSlopeRise),t.writeShort_(this.caretSlopeRun),t.writeShort_(this.caretOffset),t.write([0,0,0,0,0,0,0,0]),t.writeShort_(this.metricDataFormat),t.writeShort(e.length),t.get()}},class extends ko{parse(e){e.offset(this.offset),this.version=e.readLong(),this.numGlyphs=e.readShort(),this.maxPoints=e.readShort(),this.maxContours=e.readShort(),this.maxComponentPoints=e.readShort(),this.maxComponentContours=e.readShort(),this.maxZones=e.readShort(),this.maxTwilightPoints=e.readShort(),this.maxStorage=e.readShort(),this.maxFunctionDefs=e.readShort(),this.maxInstructionDefs=e.readShort(),this.maxStackElements=e.readShort(),this.maxSizeOfInstructions=e.readShort(),this.maxComponentElements=e.readShort(),this.maxComponentDepth=e.readShort()}render(e){var t=Do();return t.writeLong(this.version),t.writeShort(e.length),t.writeShort(this.maxPoints),t.writeShort(this.maxContours),t.writeShort(this.maxComponentPoints),t.writeShort(this.maxComponentContours),t.writeShort(this.maxZones),t.writeShort(this.maxTwilightPoints),t.writeShort(this.maxStorage),t.writeShort(this.maxFunctionDefs),t.writeShort(this.maxInstructionDefs),t.writeShort(this.maxStackElements),t.writeShort(this.maxSizeOfInstructions),t.writeShort(this.maxComponentElements),t.writeShort(this.maxComponentDepth),t.get()}},class extends ko{parse(e){e.offset(this.offset);var t=this.file,n=t.hhea;this.metrics=e.times(n.numOfLongHorMetrics,function(){return{advance:e.readShort(),lsb:e.readShort_()}});var r=t.maxp.numGlyphs-t.hhea.numOfLongHorMetrics;this.leftSideBearings=e.times(r,e.readShort_)}forGlyph(e){var t=this.metrics,n=t.length;return e<n?t[e]:{advance:t[n-1].advance,lsb:this.leftSideBearings[e-n]}}render(e){for(var t=Do(),n=0;n<e.length;++n){var r=this.forGlyph(e[n]);t.writeShort(r.advance),t.writeShort_(r.lsb)}return t.get()}},(function(){var e=`.notdef .null nonmarkingreturn space exclam quotedbl numbersign dollar percent ampersand quotesingle parenleft parenright asterisk plus comma hyphen period slash zero one two three four five six seven eight nine colon semicolon less equal greater question at A B C D E F G H I J K L M N O P Q R S T U V W X Y Z bracketleft backslash bracketright asciicircum underscore grave a b c d e f g h i j k l m n o p q r s t u v w x y z braceleft bar braceright asciitilde Adieresis Aring Ccedilla Eacute Ntilde Odieresis Udieresis aacute agrave acircumflex adieresis atilde aring ccedilla eacute egrave ecircumflex edieresis iacute igrave icircumflex idieresis ntilde oacute ograve ocircumflex odieresis otilde uacute ugrave ucircumflex udieresis dagger degree cent sterling section bullet paragraph germandbls registered copyright trademark acute dieresis notequal AE Oslash infinity plusminus lessequal greaterequal yen mu partialdiff summation product pi integral ordfeminine ordmasculine Omega ae oslash questiondown exclamdown logicalnot radical florin approxequal Delta guillemotleft guillemotright ellipsis nonbreakingspace Agrave Atilde Otilde OE oe endash emdash quotedblleft quotedblright quoteleft quoteright divide lozenge ydieresis Ydieresis fraction currency guilsinglleft guilsinglright fi fl daggerdbl periodcentered quotesinglbase quotedblbase perthousand Acircumflex Ecircumflex Aacute Edieresis Egrave Iacute Icircumflex Idieresis Igrave Oacute Ocircumflex apple Ograve Uacute Ucircumflex Ugrave dotlessi circumflex tilde macron breve dotaccent ring cedilla hungarumlaut ogonek caron Lslash lslash Scaron scaron Zcaron zcaron brokenbar Eth eth Yacute yacute Thorn thorn minus multiply onesuperior twosuperior threesuperior onehalf onequarter threequarters franc Gbreve gbreve Idotaccent Scedilla scedilla Cacute cacute Ccaron ccaron dcroat`.split(/\s+/g);return class extends ko{parse(e){e.offset(this.offset),this.format=e.readLong(),this.italicAngle=e.readFixed_(),this.underlinePosition=e.readShort_(),this.underlineThickness=e.readShort_(),this.isFixedPitch=e.readLong(),this.minMemType42=e.readLong(),this.maxMemType42=e.readLong(),this.minMemType1=e.readLong(),this.maxMemType1=e.readLong();var t;switch(this.format){case 65536:case 196608:break;case 131072:t=e.readShort(),this.glyphNameIndex=e.times(t,e.readShort),this.names=[];for(var n=this.offset+this.length;e.offset()<n;)this.names.push(e.readString(e.readByte()));break;case 151552:t=e.readShort(),this.offsets=e.read(t);break;case 262144:this.map=e.times(this.file.maxp.numGlyphs,e.readShort);break}}glyphFor(t){switch(this.format){case 65536:return e[t]||`.notdef`;case 131072:var n=this.glyphNameIndex[t];return n<e.length?e[n]:this.names[n-e.length]||`.notdef`;case 151552:case 196608:return`.notdef`;case 262144:return this.map[t]||65535}}render(t){if(this.format==196608)return this.raw();var n=Do(this.rawData.slice(this.offset,32));n.writeLong(131072),n.offset(32);for(var r=[],i=[],a=0;a<t.length;++a){var o=t[a],s=this.glyphFor(o),c=e.indexOf(s);c>=0?r.push(c):(r.push(e.length+i.length),i.push(s))}for(n.writeShort(t.length),a=0;a<r.length;++a)n.writeShort(r[a]);for(a=0;a<i.length;++a)n.writeByte(i[a].length),n.writeString(i[a]);return n.get()}}})(),class extends ko{parse(e){e.offset(this.offset),this.version=e.readShort(),this.averageCharWidth=e.readShort_(),this.weightClass=e.readShort(),this.widthClass=e.readShort(),this.type=e.readShort(),this.ySubscriptXSize=e.readShort_(),this.ySubscriptYSize=e.readShort_(),this.ySubscriptXOffset=e.readShort_(),this.ySubscriptYOffset=e.readShort_(),this.ySuperscriptXSize=e.readShort_(),this.ySuperscriptYSize=e.readShort_(),this.ySuperscriptXOffset=e.readShort_(),this.ySuperscriptYOffset=e.readShort_(),this.yStrikeoutSize=e.readShort_(),this.yStrikeoutPosition=e.readShort_(),this.familyClass=e.readShort_(),this.panose=e.times(10,e.readByte),this.charRange=e.times(4,e.readLong),this.vendorID=e.readString(4),this.selection=e.readShort(),this.firstCharIndex=e.readShort(),this.lastCharIndex=e.readShort(),this.version>0&&(this.ascent=e.readShort_(),this.descent=e.readShort_(),this.lineGap=e.readShort_(),this.winAscent=e.readShort(),this.winDescent=e.readShort(),this.codePageRange=e.times(2,e.readLong),this.version>1&&(this.xHeight=e.readShort(),this.capHeight=e.readShort(),this.defaultChar=e.readShort(),this.breakChar=e.readShort(),this.maxContext=e.readShort()))}render(){return this.raw()}};function Ao(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function jo(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if(typeof n!=`object`)throw TypeError(n+`must be non-object`);for(var r in n)Ao(n,r)&&(e[r]=n[r])}}return e}function Mo(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)}var No={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray){e.set(t.subarray(n,n+r),i);return}for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){var t,n,r=0,i,a,o;for(t=0,n=e.length;t<n;t++)r+=e[t].length;for(o=new Uint8Array(r),i=0,t=0,n=e.length;t<n;t++)a=e[t],o.set(a,i),i+=a.length;return o},Buf8:function(e){return new Uint8Array(e)},Buf16:function(e){return new Uint16Array(e)},Buf32:function(e){return new Int32Array(e)}},Po={arraySet:function(e,t,n,r,i){for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){return[].concat.apply([],e)},Buf8:function(e){return Array(e)},Buf16:function(e){return Array(e)},Buf32:function(e){return Array(e)}};let Fo=()=>{let e=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Int32Array<`u`;return Fo=()=>e,e},Io=(e,t,n,r,i)=>(Io=Fo()?No.arraySet:Po.arraySet,Io(e,t,n,r,i)),Lo=e=>(Lo=Fo()?No.flattenChunks:Po.flattenChunks,Lo(e)),Ro=e=>(Ro=Fo()?No.Buf8:Po.Buf8,Ro(e)),zo=e=>(zo=Fo()?No.Buf16:Po.Buf16,zo(e)),Bo=e=>(Bo=Fo()?No.Buf32:Po.Buf32,Bo(e)),Vo=function(){let e=!0;try{String.fromCharCode.apply(null,[0])}catch{e=!1}return Vo=()=>e,e},Ho=function(){let e=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{e=!1}return Ho=()=>e,e},Uo=function(e){for(var t=Ro(256),n=0;n<256;n++)t[n]=n>=252?6:n>=248?5:n>=240?4:n>=224?3:n>=192?2:1;return t[254]=t[254]=1,Uo=e=>t[e],t[e]};function Wo(e){var t,n,r,i,a,o=e.length,s=0;for(i=0;i<o;i++)n=e.charCodeAt(i),(n&64512)==55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)==56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),a=0,i=0;a<s;i++)n=e.charCodeAt(i),(n&64512)==55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)==56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[a++]=n:n<2048?(t[a++]=192|n>>>6,t[a++]=128|n&63):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|n&63):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|n&63);return t}function Go(e,t){if(t<65534&&(e.subarray&&Ho()||!e.subarray&&Vo()))return String.fromCharCode.apply(null,Mo(e,t));for(var n=``,r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n}function Ko(e){return Go(e,e.length)}function qo(e,t,n,r){for(var i=e&65535|0,a=e>>>16&65535|0,o=0;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+t[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0}function Jo(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t}let Yo=function(){let e=Jo();return Yo=()=>e,e};function Xo(e,t,n,r){var i=Yo(),a=r+n;e^=-1;for(var o=r;o<a;o++)e=e>>>8^i[(e^t[o])&255];return e^-1}var Zo={2:`need dictionary`,1:`stream end`,0:``,"-1":`file error`,"-2":`stream error`,"-3":`data error`,"-4":`insufficient memory`,"-5":`buffer error`,"-6":`incompatible version`};function Qo(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}function $o(e){for(var t=e.length;--t>=0;)e[t]=0}var es=0,ts=1,ns=2,rs=3,is=258,as=29,os=256,ss=os+1+as,cs=30,ls=19,us=2*ss+1,ds=15,fs=16,ps=7,ms=256,hs=16,gs=17,_s=18,vs=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ys=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],bs=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],xs=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Ss=512,Cs,ws,Ts,Es,Ds,Os;function ks(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}var As,js,Ms;function Ns(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function Ps(e){return e<256?Ts[e]:Ts[256+(e>>>7)]}function Fs(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function Is(e,t,n){e.bi_valid>fs-n?(e.bi_buf|=t<<e.bi_valid&65535,Fs(e,e.bi_buf),e.bi_buf=t>>fs-e.bi_valid,e.bi_valid+=n-fs):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function Ls(e,t,n){Is(e,n[t*2],n[t*2+1])}function Rs(e,t){var n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1}function zs(e){e.bi_valid===16?(Fs(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function Bs(e,t){var n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length,l,u,d,f,p,m,h=0;for(f=0;f<=ds;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<us;l++)u=e.heap[l],f=n[n[u*2+1]*2+1]+1,f>c&&(f=c,h++),n[u*2+1]=f,!(u>r)&&(e.bl_count[f]++,p=0,u>=s&&(p=o[u-s]),m=n[u*2],e.opt_len+=m*(f+p),a&&(e.static_len+=m*(i[u*2+1]+p)));if(h!==0){do{for(f=c-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,h-=2}while(h>0);for(f=c;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--l],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),u--)}}function Vs(e,t,n){var r=Array(ds+1),i=0,a,o;for(a=1;a<=ds;a++)r[a]=i=i+n[a-1]<<1;for(o=0;o<=t;o++){var s=e[o*2+1];s!==0&&(e[o*2]=Rs(r[s]++,s))}}function Hs(){var e,t,n,r,i,a=Array(ds+1);for(Cs=Array((ss+2)*2),$o(Cs),ws=Array(cs*2),$o(ws),Ts=Array(Ss),$o(Ts),Es=Array(is-rs+1),$o(Es),Ds=Array(as),$o(Ds),Os=Array(cs),$o(Os),n=0,r=0;r<as-1;r++)for(Ds[r]=n,e=0;e<1<<vs[r];e++)Es[n++]=r;for(Es[n-1]=r,i=0,r=0;r<16;r++)for(Os[r]=i,e=0;e<1<<ys[r];e++)Ts[i++]=r;for(i>>=7;r<cs;r++)for(Os[r]=i<<7,e=0;e<1<<ys[r]-7;e++)Ts[256+i++]=r;for(t=0;t<=ds;t++)a[t]=0;for(e=0;e<=143;)Cs[e*2+1]=8,e++,a[8]++;for(;e<=255;)Cs[e*2+1]=9,e++,a[9]++;for(;e<=279;)Cs[e*2+1]=7,e++,a[7]++;for(;e<=287;)Cs[e*2+1]=8,e++,a[8]++;for(Vs(Cs,ss+1,a),e=0;e<cs;e++)ws[e*2+1]=5,ws[e*2]=Rs(e,5);As=new ks(Cs,vs,os+1,ss,ds),js=new ks(ws,ys,0,cs,ds),Ms=new ks([],bs,0,ls,ps)}function Us(e){var t;for(t=0;t<ss;t++)e.dyn_ltree[t*2]=0;for(t=0;t<cs;t++)e.dyn_dtree[t*2]=0;for(t=0;t<ls;t++)e.bl_tree[t*2]=0;e.dyn_ltree[ms*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function Ws(e){e.bi_valid>8?Fs(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Gs(e,t,n,r){Ws(e),r&&(Fs(e,n),Fs(e,~n)),Io(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}function Ks(e,t,n,r){var i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]}function qs(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&Ks(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!Ks(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function Js(e,t,n){var r,i,a=0,o,s;if(e.last_lit!==0)do r=e.pending_buf[e.d_buf+a*2]<<8|e.pending_buf[e.d_buf+a*2+1],i=e.pending_buf[e.l_buf+a],a++,r===0?Ls(e,i,t):(o=Es[i],Ls(e,o+os+1,t),s=vs[o],s!==0&&(i-=Ds[o],Is(e,i,s)),r--,o=Ps(r),Ls(e,o,n),s=ys[o],s!==0&&(r-=Os[o],Is(e,r,s)));while(a<e.last_lit);Ls(e,ms,t)}function Ys(e,t){var n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,o,s,c=-1,l;for(e.heap_len=0,e.heap_max=us,o=0;o<a;o++)n[o*2]===0?n[o*2+1]=0:(e.heap[++e.heap_len]=c=o,e.depth[o]=0);for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,n[l*2]=1,e.depth[l]=0,e.opt_len--,i&&(e.static_len-=r[l*2+1]);for(t.max_code=c,o=e.heap_len>>1;o>=1;o--)qs(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],qs(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,n[l*2]=n[o*2]+n[s*2],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,n[o*2+1]=n[s*2+1]=l,e.heap[1]=l++,qs(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Bs(e,t),Vs(n,c,e.bl_count)}function Xs(e,t,n){var r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)&&(s<l?e.bl_tree[a*2]+=s:a===0?s<=10?e.bl_tree[gs*2]++:e.bl_tree[_s*2]++:(a!==i&&e.bl_tree[a*2]++,e.bl_tree[hs*2]++),s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))}function Zs(e,t,n){var r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)){if(s<l)do Ls(e,a,e.bl_tree);while(--s!==0);else a===0?s<=10?(Ls(e,gs,e.bl_tree),Is(e,s-3,3)):(Ls(e,_s,e.bl_tree),Is(e,s-11,7)):(a!==i&&(Ls(e,a,e.bl_tree),s--),Ls(e,hs,e.bl_tree),Is(e,s-3,2));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}}function Qs(e){var t;for(Xs(e,e.dyn_ltree,e.l_desc.max_code),Xs(e,e.dyn_dtree,e.d_desc.max_code),Ys(e,e.bl_desc),t=ls-1;t>=3&&e.bl_tree[xs[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function $s(e,t,n,r){var i;for(Is(e,t-257,5),Is(e,n-1,5),Is(e,r-4,4),i=0;i<r;i++)Is(e,e.bl_tree[xs[i]*2+1],3);Zs(e,e.dyn_ltree,t-1),Zs(e,e.dyn_dtree,n-1)}function ec(e){var t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return 0;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return 1;for(n=32;n<os;n++)if(e.dyn_ltree[n*2]!==0)return 1;return 0}var tc=!1;function nc(e){tc||=(Hs(),!0),e.l_desc=new Ns(e.dyn_ltree,As),e.d_desc=new Ns(e.dyn_dtree,js),e.bl_desc=new Ns(e.bl_tree,Ms),e.bi_buf=0,e.bi_valid=0,Us(e)}function rc(e,t,n,r){Is(e,(es<<1)+ +!!r,3),Gs(e,t,n,!0)}function ic(e){Is(e,ts<<1,3),Ls(e,ms,Cs),zs(e)}function ac(e,t,n,r){var i,a,o=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=ec(e)),Ys(e,e.l_desc),Ys(e,e.d_desc),o=Qs(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=n+5,n+4<=i&&t!==-1?rc(e,t,n,r):e.strategy===4||a===i?(Is(e,(ts<<1)+ +!!r,3),Js(e,Cs,ws)):(Is(e,(ns<<1)+ +!!r,3),$s(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),Js(e,e.dyn_ltree,e.dyn_dtree)),Us(e),r&&Ws(e)}function oc(e,t,n){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=n&255,e.last_lit++,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(Es[n]+os+1)*2]++,e.dyn_dtree[Ps(t)*2]++),e.last_lit===e.lit_bufsize-1}var sc=9,cc=286,lc=30,uc=19,dc=2*cc+1,fc=15,F=3,pc=258,mc=pc+F+1,hc=32,gc=42,_c=69,vc=73,yc=91,bc=103,xc=113,Sc=666,Cc=1,wc=2,Tc=3,Ec=4,Dc=3;function Oc(e,t){return e.msg=Zo[t],t}function kc(e){return(e<<1)-(e>4?9:0)}function Ac(e){for(var t=e.length;--t>=0;)e[t]=0}function jc(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(Io(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))}function Mc(e,t){ac(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,jc(e.strm)}function I(e,t){e.pending_buf[e.pending++]=t}function Nc(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function Pc(e,t,n,r){var i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,Io(t,e.input,e.next_in,i,n),e.state.wrap===1?e.adler=qo(e.adler,t,i,n):e.state.wrap===2&&(e.adler=Xo(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)}function Fc(e,t){var n=e.max_chain_length,r=e.strstart,i,a,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-mc?e.strstart-(e.w_size-mc):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+pc,p=l[r+o-1],m=l[r+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(i=t,l[i+o]!==m||l[i+o-1]!==p||l[i]!==l[r]||l[++i]!==l[r+1])continue;r+=2,i++;do;while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<f);if(a=pc-(f-r),r=f-pc,a>o){if(e.match_start=t,o=a,a>=s)break;p=l[r+o-1],m=l[r+o]}}while((t=d[t&u])>c&&--n!==0);return o<=e.lookahead?o:e.lookahead}function Ic(e){var t=e.w_size,n,r,i,a,o;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-mc)){Io(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,r=e.hash_size,n=r;do i=e.head[--n],e.head[n]=i>=t?i-t:0;while(--r);r=t,n=r;do i=e.prev[--n],e.prev[n]=i>=t?i-t:0;while(--r);a+=t}if(e.strm.avail_in===0)break;if(r=Pc(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=r,e.lookahead+e.insert>=F)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+F-1])&e.hash_mask,e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<F)););}while(e.lookahead<mc&&e.strm.avail_in!==0)}function Lc(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Ic(e),e.lookahead===0&&t===0)return Cc;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,Mc(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-mc&&(Mc(e,!1),e.strm.avail_out===0))return Cc}return e.insert=0,t===4?(Mc(e,!0),e.strm.avail_out===0?Tc:Ec):(e.strstart>e.block_start&&(Mc(e,!1),e.strm.avail_out),Cc)}function Rc(e,t){for(var n,r;;){if(e.lookahead<mc){if(Ic(e),e.lookahead<mc&&t===0)return Cc;if(e.lookahead===0)break}if(n=0,e.lookahead>=F&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+F-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-mc&&(e.match_length=Fc(e,n)),e.match_length>=F)if(r=oc(e,e.strstart-e.match_start,e.match_length-F),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=F){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+F-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=oc(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Mc(e,!1),e.strm.avail_out===0))return Cc}return e.insert=e.strstart<F-1?e.strstart:F-1,t===4?(Mc(e,!0),e.strm.avail_out===0?Tc:Ec):e.last_lit&&(Mc(e,!1),e.strm.avail_out===0)?Cc:wc}function zc(e,t){for(var n,r,i;;){if(e.lookahead<mc){if(Ic(e),e.lookahead<mc&&t===0)return Cc;if(e.lookahead===0)break}if(n=0,e.lookahead>=F&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+F-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=F-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-mc&&(e.match_length=Fc(e,n),e.match_length<=5&&(e.strategy===1||e.match_length===F&&e.strstart-e.match_start>4096)&&(e.match_length=F-1)),e.prev_length>=F&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-F,r=oc(e,e.strstart-1-e.prev_match,e.prev_length-F),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+F-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=F-1,e.strstart++,r&&(Mc(e,!1),e.strm.avail_out===0))return Cc}else if(e.match_available){if(r=oc(e,0,e.window[e.strstart-1]),r&&Mc(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Cc}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(r=oc(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<F-1?e.strstart:F-1,t===4?(Mc(e,!0),e.strm.avail_out===0?Tc:Ec):e.last_lit&&(Mc(e,!1),e.strm.avail_out===0)?Cc:wc}function Bc(e,t){for(var n,r,i,a,o=e.window;;){if(e.lookahead<=pc){if(Ic(e),e.lookahead<=pc&&t===0)return Cc;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=F&&e.strstart>0&&(i=e.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){a=e.strstart+pc;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<a);e.match_length=pc-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=F?(n=oc(e,1,e.match_length-F),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=oc(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Mc(e,!1),e.strm.avail_out===0))return Cc}return e.insert=0,t===4?(Mc(e,!0),e.strm.avail_out===0?Tc:Ec):e.last_lit&&(Mc(e,!1),e.strm.avail_out===0)?Cc:wc}function Vc(e,t){for(var n;;){if(e.lookahead===0&&(Ic(e),e.lookahead===0)){if(t===0)return Cc;break}if(e.match_length=0,n=oc(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Mc(e,!1),e.strm.avail_out===0))return Cc}return e.insert=0,t===4?(Mc(e,!0),e.strm.avail_out===0?Tc:Ec):e.last_lit&&(Mc(e,!1),e.strm.avail_out===0)?Cc:wc}function Hc(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}let Uc=function(){let e=[new Hc(0,0,0,0,Lc),new Hc(4,4,8,4,Rc),new Hc(4,5,16,8,Rc),new Hc(4,6,32,32,Rc),new Hc(4,4,16,16,zc),new Hc(8,16,32,32,zc),new Hc(8,16,128,128,zc),new Hc(8,32,128,256,zc),new Hc(32,128,258,1024,zc),new Hc(32,258,258,4096,zc)];return Uc=()=>e,e};function Wc(e){e.window_size=2*e.w_size,Ac(e.head);let t=Uc();e.max_lazy_match=t[e.level].max_lazy,e.good_match=t[e.level].good_length,e.nice_match=t[e.level].nice_length,e.max_chain_length=t[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=F-1,e.match_available=0,e.ins_h=0}function Gc(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=zo(dc*2),this.dyn_dtree=zo((2*lc+1)*2),this.bl_tree=zo((2*uc+1)*2),Ac(this.dyn_ltree),Ac(this.dyn_dtree),Ac(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=zo(fc+1),this.heap=zo(2*cc+1),Ac(this.heap),this.heap_len=0,this.heap_max=0,this.depth=zo(2*cc+1),Ac(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Kc(e){var t;return!e||!e.state?Oc(e,-2):(e.total_in=e.total_out=0,e.data_type=2,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?gc:xc,e.adler=t.wrap===2?0:1,t.last_flush=0,nc(t),0)}function qc(e){var t=Kc(e);return t===0&&Wc(e.state),t}function Jc(e,t){return!e||!e.state||e.state.wrap!==2?-2:(e.state.gzhead=t,0)}function Yc(e,t,n,r,i,a){if(!e)return-2;var o=1;if(t===-1&&(t=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),i<1||i>sc||n!==8||r<8||r>15||t<0||t>9||a<0||a>4)return Oc(e,-2);r===8&&(r=9);var s=new Gc;return e.state=s,s.strm=e,s.wrap=o,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+F-1)/F),s.window=Ro(s.w_size*2),s.head=zo(s.hash_size),s.prev=zo(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=Ro(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=a,s.method=n,qc(e)}function Xc(e,t){var n,r,i,a;if(!e||!e.state||t>5||t<0)return e?Oc(e,-2):-2;if(r=e.state,!e.output||!e.input&&e.avail_in!==0||r.status===Sc&&t!==4)return Oc(e,e.avail_out===0?-5:-2);if(r.strm=e,n=r.last_flush,r.last_flush=t,r.status===gc)if(r.wrap===2)e.adler=0,I(r,31),I(r,139),I(r,8),r.gzhead?(I(r,+!!r.gzhead.text+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),I(r,r.gzhead.time&255),I(r,r.gzhead.time>>8&255),I(r,r.gzhead.time>>16&255),I(r,r.gzhead.time>>24&255),I(r,r.level===9?2:r.strategy>=2||r.level<2?4:0),I(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(I(r,r.gzhead.extra.length&255),I(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=Xo(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=_c):(I(r,0),I(r,0),I(r,0),I(r,0),I(r,0),I(r,r.level===9?2:r.strategy>=2||r.level<2?4:0),I(r,Dc),r.status=xc);else{var o=8+(r.w_bits-8<<4)<<8,s=-1;s=r.strategy>=2||r.level<2?0:r.level<6?1:r.level===6?2:3,o|=s<<6,r.strstart!==0&&(o|=hc),o+=31-o%31,r.status=xc,Nc(r,o),r.strstart!==0&&(Nc(r,e.adler>>>16),Nc(r,e.adler&65535)),e.adler=1}if(r.status===_c)if(r.gzhead.extra){for(i=r.pending;r.gzindex<(r.gzhead.extra.length&65535)&&!(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=Xo(e.adler,r.pending_buf,r.pending-i,i)),jc(e),i=r.pending,r.pending===r.pending_buf_size));)I(r,r.gzhead.extra[r.gzindex]&255),r.gzindex++;r.gzhead.hcrc&&r.pending>i&&(e.adler=Xo(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=vc)}else r.status=vc;if(r.status===vc)if(r.gzhead.name){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=Xo(e.adler,r.pending_buf,r.pending-i,i)),jc(e),i=r.pending,r.pending===r.pending_buf_size)){a=1;break}a=r.gzindex<r.gzhead.name.length?r.gzhead.name.charCodeAt(r.gzindex++)&255:0,I(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(e.adler=Xo(e.adler,r.pending_buf,r.pending-i,i)),a===0&&(r.gzindex=0,r.status=yc)}else r.status=yc;if(r.status===yc)if(r.gzhead.comment){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=Xo(e.adler,r.pending_buf,r.pending-i,i)),jc(e),i=r.pending,r.pending===r.pending_buf_size)){a=1;break}a=r.gzindex<r.gzhead.comment.length?r.gzhead.comment.charCodeAt(r.gzindex++)&255:0,I(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(e.adler=Xo(e.adler,r.pending_buf,r.pending-i,i)),a===0&&(r.status=bc)}else r.status=bc;if(r.status===bc&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&jc(e),r.pending+2<=r.pending_buf_size&&(I(r,e.adler&255),I(r,e.adler>>8&255),e.adler=0,r.status=xc)):r.status=xc),r.pending!==0){if(jc(e),e.avail_out===0)return r.last_flush=-1,0}else if(e.avail_in===0&&kc(t)<=kc(n)&&t!==4)return Oc(e,-5);if(r.status===Sc&&e.avail_in!==0)return Oc(e,-5);if(e.avail_in!==0||r.lookahead!==0||t!==0&&r.status!==Sc){var c=r.strategy===2?Vc(r,t):r.strategy===3?Bc(r,t):Uc()[r.level].func(r,t);if((c===Tc||c===Ec)&&(r.status=Sc),c===Cc||c===Tc)return e.avail_out===0&&(r.last_flush=-1),0;if(c===wc&&(t===1?ic(r):t!==5&&(rc(r,0,0,!1),t===3&&(Ac(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),jc(e),e.avail_out===0))return r.last_flush=-1,0}return t===4?r.wrap<=0?1:(r.wrap===2?(I(r,e.adler&255),I(r,e.adler>>8&255),I(r,e.adler>>16&255),I(r,e.adler>>24&255),I(r,e.total_in&255),I(r,e.total_in>>8&255),I(r,e.total_in>>16&255),I(r,e.total_in>>24&255)):(Nc(r,e.adler>>>16),Nc(r,e.adler&65535)),jc(e),r.wrap>0&&(r.wrap=-r.wrap),+(r.pending===0)):0}function Zc(e){var t;return!e||!e.state?-2:(t=e.state.status,t!==gc&&t!==_c&&t!==vc&&t!==yc&&t!==bc&&t!==xc&&t!==Sc?Oc(e,-2):(e.state=null,t===xc?Oc(e,-3):0))}function Qc(e,t){var n=t.length,r,i,a,o,s,c,l,u;if(!e||!e.state||(r=e.state,o=r.wrap,o===2||o===1&&r.status!==gc||r.lookahead))return-2;for(o===1&&(e.adler=qo(e.adler,t,n,0)),r.wrap=0,n>=r.w_size&&(o===0&&(Ac(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=Ro(r.w_size),Io(u,t,n-r.w_size,r.w_size,0),t=u,n=r.w_size),s=e.avail_in,c=e.next_in,l=e.input,e.avail_in=n,e.next_in=0,e.input=t,Ic(r);r.lookahead>=F;){i=r.strstart,a=r.lookahead-(F-1);do r.ins_h=(r.ins_h<<r.hash_shift^r.window[i+F-1])&r.hash_mask,r.prev[i&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=i,i++;while(--a);r.strstart=i,r.lookahead=F-1,Ic(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=F-1,r.match_available=0,e.next_in=c,e.input=l,e.avail_in=s,r.wrap=o,0}var $c=Object.prototype.toString,el=class{constructor(e){this.options=jo({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:``},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new Qo,this.strm.avail_out=0;var n=Yc(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==0)throw Error(Zo[n]);if(t.header&&Jc(this.strm,t.header),t.dictionary){var r=typeof t.dictionary==`string`?Wo(t.dictionary):$c.call(t.dictionary)===`[object ArrayBuffer]`?new Uint8Array(t.dictionary):t.dictionary;if(n=Qc(this.strm,r),n!==0)throw Error(Zo[n]);this._dict_set=!0}}push(e,t){var n=this.strm,r=this.options.chunkSize,i,a;if(this.ended)return!1;a=t===~~t?t:t===!0?4:0,typeof e==`string`?n.input=Wo(e):$c.call(e)===`[object ArrayBuffer]`?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;do{if(n.avail_out===0&&(n.output=Ro(r),n.next_out=0,n.avail_out=r),i=Xc(n,a),i!==1&&i!==0)return this.onEnd(i),this.ended=!0,!1;(n.avail_out===0||n.avail_in===0&&(a===4||a===2))&&(this.options.to===`string`?this.onData(Ko(Mo(n.output,n.next_out))):this.onData(Mo(n.output,n.next_out)))}while((n.avail_in>0||n.avail_out===0)&&i!==1);return a===4?(i=Zc(this.strm),this.onEnd(i),this.ended=!0,i===0):a===2?(this.onEnd(0),n.avail_out=0,!0):!0}onData(e){this.chunks.push(e)}onEnd(e){e===0&&(this.options.to===`string`?this.result=this.chunks.join(``):this.result=Lo(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg}};function tl(e,t){var n=new el(t);if(n.push(e,!0),n.err)throw n.msg||Zo[n.err];return n.result}let nl=tl;function rl(){return!0}Oe.browser;var il=0;let al=0;function ol(){var e=0,t=Do();function n(){for(var e=0;e<arguments.length;++e){var r=arguments[e];if(r===void 0)throw Error(`Cannot output undefined to PDF`);if(r instanceof ml)r.beforeRender(n),r.render(n);else if(ul(r))fl(r,n);else if(dl(r))pl(r,n);else if(typeof r==`number`){if(isNaN(r))throw Error(`Cannot output NaN to PDF`);var i=r.toFixed(7);i.indexOf(`.`)>=0&&(i=i.replace(/\.?0+$/,``)),i==`-0`&&(i=`0`),t.writeString(i)}else/string|boolean/.test(typeof r)?t.writeString(String(r)):typeof r.get==`function`?t.write(r.get()):typeof r==`object`&&(r?n(new vl(r)):t.writeString(`null`))}}return n.writeData=function(e){t.write(e)},n.withIndent=function(t){++e,t(n),--e},n.indent=function(){n(`
`,sl(``,e*2,`  `)),n.apply(null,arguments)},n.offset=function(){return t.offset()},n.toString=function(){throw Error(`FIX CALLER`)},n.get=function(){return t.get()},n.stream=function(){return t},n}function sl(e,t,n){for(;e.length<t;)e=n+e;return e}function cl(e,t){return sl(String(e),t,`0`)}function ll(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var ul=Array.isArray||function(e){return e instanceof Array};function dl(e){return e instanceof Date}function fl(e,t){t(`[`),e.length>0&&t.withIndent(function(){for(var n=0;n<e.length;++n)n>0&&n%8==0?t.indent(e[n]):t(` `,e[n])}),t(` ]`)}function pl(e,t){t(`(D:`,cl(e.getUTCFullYear(),4),cl(e.getUTCMonth()+1,2),cl(e.getUTCDate(),2),cl(e.getUTCHours(),2),cl(e.getUTCMinutes(),2),cl(e.getUTCSeconds(),2),`Z)`)}var ml=class{beforeRender(){}},hl=class extends ml{constructor(e,t){super(),this.value=e,this.utf16be=!!t}render(e){let t=this.value;if(this.utf16be)t=`þÿ`+mt(t),t=t.replace(/([\(\)\\])/g,`\\$1`),e(`(`,t,`)`);else{let r=[40];for(var n=0;n<t.length;++n){let e=t.charCodeAt(n)&255;(e==40||e==41||e==92)&&r.push(92),r.push(e)}r.push(41),e.writeData(r)}}toString(){return this.value}},gl=class extends hl{constructor(e){super(e),this.value=e}render(e){e(`<`);for(var t=0;t<this.value.length;++t)e(cl(this.value.charCodeAt(t).toString(16),4));e(`>`)}},_l=class extends ml{static get(e){return L(e)}constructor(e){super(),this.name=e}render(e){e(`/`+this.escape())}escape(){return this.name.replace(/[^\x21-\x7E]/g,function(e){return`#`+cl(e.charCodeAt(0).toString(16),2)})}toString(){return this.name}};function L(e){return new _l(e)}var vl=class extends ml{constructor(e){super(),this.props=e}render(e){var t=this.props,n=!0;e(`<<`),e.withIndent(function(){for(var r in t)ll(t,r)&&!/^_/.test(r)&&(n=!1,e.indent(L(r),` `,t[r]))}),n||e.indent(),e(`>>`)}},yl=class extends ml{constructor(e,t,n){if(super(),typeof e==`string`){var r=Do();r.write(e),e=r}this.data=e,this.props=t||{},this.compress=n}render(e){var t=this.data.get(),n=this.props;this.compress&&rl()&&(n.Filter?n.Filter instanceof Array||(n.Filter=[n.Filter]):n.Filter=[],n.Filter.unshift(L(`FlateDecode`)),t=nl(t)),n.Length=t.length,e(new vl(n),` stream`,`
`),e.writeData(t),e(`
`,`endstream`)}};(class extends vl{constructor(){super({Type:L(`Catalog`)})}setPages(e){this.props.Pages=e}}),class extends vl{constructor(){super({Type:L(`Pages`),Kids:[],Count:0})}addPage(e){this.props.Kids.push(e),this.props.Count++}},class extends vl{constructor(e,t,n){let{width:r,height:i}=e.size(),a=new kl(t._pdf,{});a._content=new yl(ol(),null,!0),n(e,a,{}),t._xResources=Object.assign(t._xResources,a._xResources),t._fontResources=Object.assign(t._fontResources,a._fontResources),t._gsResources=Object.assign(t._gsResources,a._gsResources),super({Type:L(`Pattern`),PatternType:1,PaintType:1,TilingType:1,BBox:[0,0,r,i],XStep:r,YStep:i,Matrix:[1,0,0,-1,0,i],Resources:{ExtGState:new vl(a._gsResources),XObject:new vl(a._xResources),Font:new vl(a._fontResources)}}),this._resourceName=L(`P`+ ++al),this.data=a._content.data,this.compress=!0}render(e){yl.prototype.render.call(this,e)}},class extends vl{constructor(e){super({Type:L(`Font`),Subtype:L(`Type1`),BaseFont:L(e)}),this._resourceName=L(`F`+ ++il)}encodeText(e){return new hl(String(e))}};var bl=class extends vl{constructor(e,t,n){super({}),n=this.props,n.Type=L(`Font`),n.Subtype=L(`Type0`),n.Encoding=L(`Identity-H`),this._pdf=e,this._font=t,this._sub=t.makeSubset(),this._resourceName=L(`F`+ ++il);var r=t.head;this.name=t.psName;var i=this.scale=t.scale;this.bbox=[r.xMin*i,r.yMin*i,r.xMax*i,r.yMax*i],this.italicAngle=t.post.italicAngle,this.ascent=t.ascent*i,this.descent=t.descent*i,this.lineGap=t.lineGap*i,this.capHeight=t.os2.capHeight||this.ascent,this.xHeight=t.os2.xHeight||0,this.stemV=0,this.familyClass=(t.os2.familyClass||0)>>8,this.isSerif=this.familyClass>=1&&this.familyClass<=7,this.isScript=this.familyClass==10,this.flags=!!t.post.isFixedPitch|(this.isSerif?2:0)|(this.isScript?8:0)|(this.italicAngle===0?0:64)|32}encodeText(e){return new gl(this._sub.encodeText(String(e)))}getTextWidth(e,t){for(var n=0,r=this._font.cmap.codeMap,i=0;i<t.length;++i){var a=r[t.charCodeAt(i)];n+=this._font.widthOfGlyph(a||0)}return n*e/1e3}beforeRender(){var e=this,t=e._sub,n=t.render(),r=new yl(Do(n),{Length1:n.length},!0),i=e._pdf.attach(new vl({Type:L(`FontDescriptor`),FontName:L(e._sub.psName),FontBBox:e.bbox,Flags:e.flags,StemV:e.stemV,ItalicAngle:e.italicAngle,Ascent:e.ascent,Descent:e.descent,CapHeight:e.capHeight,XHeight:e.xHeight,FontFile2:e._pdf.attach(r)})),a=t.ncid2ogid,o=t.firstChar,s=t.lastChar,c=[];(function t(n,r){if(n<=s){var i=a[n];i==null?t(n+1):(r||c.push(n,r=[]),r.push(e._font.widthOfGlyph(i)),t(n+1,r))}})(o);var l=new vl({Type:L(`Font`),Subtype:L(`CIDFontType2`),BaseFont:L(e._sub.psName),CIDSystemInfo:new vl({Registry:new hl(`Adobe`),Ordering:new hl(`Identity`),Supplement:0}),FontDescriptor:i,FirstChar:o,LastChar:s,DW:Math.round(e._font.widthOfGlyph(0)),W:c,CIDToGIDMap:e._pdf.attach(e._makeCidToGidMap())}),u=e.props;u.BaseFont=L(e._sub.psName),u.DescendantFonts=[e._pdf.attach(l)];var d=new xl(o,s,t.subset),f=new yl(ol(),null,!0);f.data(d),u.ToUnicode=e._pdf.attach(f)}_makeCidToGidMap(){return new yl(Do(this._sub.cidToGidMap()),null,!0)}},xl=class extends ml{constructor(e,t,n){super(),this.firstChar=e,this.lastChar=t,this.map=n}render(e){e.indent(`/CIDInit /ProcSet findresource begin`),e.indent(`12 dict begin`),e.indent(`begincmap`),e.indent(`/CIDSystemInfo <<`),e.indent(`  /Registry (Adobe)`),e.indent(`  /Ordering (UCS)`),e.indent(`  /Supplement 0`),e.indent(`>> def`),e.indent(`/CMapName /Adobe-Identity-UCS def`),e.indent(`/CMapType 2 def`),e.indent(`1 begincodespacerange`),e.indent(`  <0000><ffff>`),e.indent(`endcodespacerange`);var t=this;e.indent(t.lastChar-t.firstChar+1,` beginbfchar`),e.withIndent(function(){for(var n=t.firstChar;n<=t.lastChar;++n){var r=t.map[n],i=Oo([r]);e.indent(`<`,cl(n.toString(16),4),`>`,`<`);for(var a=0;a<i.length;++a)e(cl(i.charCodeAt(a).toString(16),4));e(`>`)}}),e.indent(`endbfchar`),e.indent(`endcmap`),e.indent(`CMapName currentdict /CMap defineresource pop`),e.indent(`end`),e.indent(`end`)}};function Sl(e){return e.map(function(e){return ul(e)?Sl(e):typeof e==`number`?(Math.round(e*1e3)/1e3).toFixed(3):e}).join(` `)}function Cl(e,t,n,r,i,a,o){var s=Sl([t,n,r,i,a,o]),c=e.GRAD_COL_FUNCTIONS[s];return c||=e.GRAD_COL_FUNCTIONS[s]=e.attach(new vl({FunctionType:2,Domain:[0,1],Range:[0,1,0,1,0,1],N:1,C0:[t,n,r],C1:[i,a,o]})),c}function wl(e,t,n){var r=Sl([t,n]),i=e.GRAD_OPC_FUNCTIONS[r];return i||=e.GRAD_OPC_FUNCTIONS[r]=e.attach(new vl({FunctionType:2,Domain:[0,1],Range:[0,1],N:1,C0:[t],C1:[n]})),i}function Tl(e,t){var n=!1,r=[],i=[],a=[],o=[],s,c,l,u,d;for(s=1;s<t.length;++s)c=t[s-1],l=t[s],u=c.color,d=l.color,i.push(Cl(e,u.r,u.g,u.b,d.r,d.g,d.b)),(u.a<1||d.a<1)&&(n=!0),a.push(l.offset),o.push(0,1);if(n)for(s=1;s<t.length;++s)c=t[s-1],l=t[s],u=c.color,d=l.color,r.push(wl(e,u.a,d.a));return a.pop(),{hasAlpha:n,colors:f(i),opacities:n?f(r):null};function f(e){return e.length==1?e[0]:{FunctionType:3,Functions:e,Domain:[0,1],Bounds:a,Encode:o}}}function El(e,t,n,r,i,a){var o,s;if(!a){var c=[t].concat(r);n.forEach(function(e){c.push(e.offset,e.color.r,e.color.g,e.color.b)}),s=Sl(c),o=e.GRAD_COL[s]}return o||(o=new vl({Type:L(`Shading`),ShadingType:t?3:2,ColorSpace:L(`DeviceRGB`),Coords:r,Domain:[0,1],Function:i,Extend:[!0,!0]}),e.attach(o),o._resourceName=`S`+ ++il,s&&(e.GRAD_COL[s]=o)),o}function Dl(e,t,n,r,i,a){var o,s;if(!a){var c=[t].concat(r);n.forEach(function(e){c.push(e.offset,e.color.a)}),s=Sl(c),o=e.GRAD_OPC[s]}return o||(o=new vl({Type:L(`ExtGState`),AIS:!1,CA:1,ca:1,SMask:{Type:L(`Mask`),S:L(`Luminosity`),G:e.attach(new yl(`/a0 gs /s0 sh`,{Type:L(`XObject`),Subtype:L(`Form`),FormType:1,BBox:a?[a.left,a.top+a.height,a.left+a.width,a.top]:[0,1,1,0],Group:{Type:L(`Group`),S:L(`Transparency`),CS:L(`DeviceGray`),I:!0},Resources:{ExtGState:{a0:{CA:1,ca:1}},Shading:{s0:{ColorSpace:L(`DeviceGray`),Coords:r,Domain:[0,1],ShadingType:t?3:2,Function:i,Extend:[!0,!0]}}}}))}}),e.attach(o),o._resourceName=`O`+ ++il,s&&(e.GRAD_OPC[s]=o)),o}function Ol(e,t,n){var r=t.type==`radial`,i=Tl(e,t.stops),a=r?[t.start.x,t.start.y,t.start.r,t.end.x,t.end.y,t.end.r]:[t.start.x,t.start.y,t.end.x,t.end.y],o=El(e,r,t.stops,a,i.colors,t.userSpace&&n),s=i.hasAlpha?Dl(e,r,t.stops,a,i.opacities,t.userSpace&&n):null;return{hasAlpha:i.hasAlpha,shading:o,opacity:s}}var kl=class extends vl{constructor(e,t){super(t),this._pdf=e,this._rcount=0,this._textMode=!1,this._fontResources={},this._gsResources={},this._xResources={},this._patResources={},this._shResources={},this._opacity=1,this._matrix=[1,0,0,1,0,0],this._annotations=[],this._font=null,this._fontSize=null,this._contextStack=[],t=this.props,t.Type=L(`Page`),t.ProcSet=[L(`PDF`),L(`Text`),L(`ImageB`),L(`ImageC`),L(`ImageI`)],t.Resources=new vl({Font:new vl(this._fontResources),ExtGState:new vl(this._gsResources),XObject:new vl(this._xResources),Pattern:new vl(this._patResources),Shading:new vl(this._shResources)}),t.Annots=this._annotations}_out(){this._content.data.apply(null,arguments)}transform(e,t,n,r,i,a){Ll(arguments)||(this._matrix=Il(arguments,this._matrix),this._out(e,` `,t,` `,n,` `,r,` `,i,` `,a,` cm`),this._out(`
`))}translate(e,t){this.transform(1,0,0,1,e,t)}scale(e,t){this.transform(e,0,0,t,0,0)}rotate(e){var t=Math.cos(e),n=Math.sin(e);this.transform(t,n,-n,t,0,0)}beginText(){this._textMode=!0,this._out(`BT`,`
`)}endText(){this._textMode=!1,this._out(`ET`,`
`)}_requireTextMode(){if(!this._textMode)throw Error(`Text mode required; call page.beginText() first`)}_requireFont(){if(!this._font)throw Error(`No font selected; call page.setFont() first`)}setFont(e,t){this._requireTextMode(),e==null?e=this._font:e instanceof bl||(e=this._pdf.getFont(e)),t??=this._fontSize,this._fontResources[e._resourceName]=e,this._font=e,this._fontSize=t,this._out(e._resourceName,` `,t,` Tf`,`
`)}setTextLeading(e){this._requireTextMode(),this._out(e,` TL`,`
`)}setTextRenderingMode(e){this._requireTextMode(),this._out(e,` Tr`,`
`)}showText(e,t){if(this._requireFont(),e.length>1&&t&&this._font instanceof bl){var n=t/this._font.getTextWidth(this._fontSize,e)*100;this._out(n,` Tz `)}this._out(this._font.encodeText(e),` Tj`,`
`)}showTextNL(e){this._requireFont(),this._out(this._font.encodeText(e),` '`,`
`)}addLink(e,t){var n=this._toPage({x:t.left,y:t.bottom}),r=this._toPage({x:t.right,y:t.top});this._annotations.push(new vl({Type:L(`Annot`),Subtype:L(`Link`),Rect:[n.x,n.y,r.x,r.y],Border:[0,0,0],A:new vl({Type:L(`Action`),S:L(`URI`),URI:new hl(e)})}))}setStrokeColor(e,t,n){this._out(e,` `,t,` `,n,` RG`,`
`)}setOpacity(e){this.setFillOpacity(e),this.setStrokeOpacity(e),this._opacity*=e}setStrokeOpacity(e){if(e<1){var t=this._pdf.getOpacityGS(this._opacity*e,!0);this._gsResources[t._resourceName]=t,this._out(t._resourceName,` gs`,`
`)}}setFillColor(e,t,n){this._out(e,` `,t,` `,n,` rg`,`
`)}pattern(e,t,n){let r=this._pdf.getPattern(e,this,n);this._patResources[r._resourceName]=r,this._out(`/Pattern cs`,`
`),this._out(r._resourceName,` scn`,`
`),this.rect(t.left,t.top,t.width,t.height),this.fill()}setFillOpacity(e){if(e<1){var t=this._pdf.getOpacityGS(this._opacity*e,!1);this._gsResources[t._resourceName]=t,this._out(t._resourceName,` gs`,`
`)}}gradient(e,t){this.save(),this.rect(t.left,t.top,t.width,t.height),this.clip(),e.userSpace||this.transform(t.width,0,0,t.height,t.left,t.top);var n=Ol(this._pdf,e,t),r=n.shading._resourceName,i;this._shResources[r]=n.shading,n.hasAlpha&&(i=n.opacity._resourceName,this._gsResources[i]=n.opacity,this._out(`/`+i+` gs `)),this._out(`/`+r+` sh`,`
`),this.restore()}setDashPattern(e,t){this._out(e,` `,t,` d`,`
`)}setLineWidth(e){this._out(e,` w`,`
`)}setLineCap(e){this._out(e,` J`,`
`)}setLineJoin(e){this._out(e,` j`,`
`)}setMitterLimit(e){this._out(e,` M`,`
`)}save(){this._contextStack.push(this._context()),this._out(`q`,`
`)}restore(){this._out(`Q`,`
`),this._context(this._contextStack.pop())}moveTo(e,t){this._out(e,` `,t,` m`,`
`)}lineTo(e,t){this._out(e,` `,t,` l`,`
`)}bezier(e,t,n,r,i,a){this._out(e,` `,t,` `,n,` `,r,` `,i,` `,a,` c`,`
`)}bezier1(e,t,n,r){this._out(e,` `,t,` `,n,` `,r,` y`,`
`)}bezier2(e,t,n,r){this._out(e,` `,t,` `,n,` `,r,` v`,`
`)}close(){this._out(`h`,`
`)}rect(e,t,n,r){this._out(e,` `,t,` `,n,` `,r,` re`,`
`)}ellipse(e,t,n,r){function i(t){return e+t}function a(e){return t+e}var o=.5522847498307936;this.moveTo(i(0),a(r)),this.bezier(i(n*o),a(r),i(n),a(r*o),i(n),a(0)),this.bezier(i(n),a(-r*o),i(n*o),a(-r),i(0),a(-r)),this.bezier(i(-n*o),a(-r),i(-n),a(-r*o),i(-n),a(0)),this.bezier(i(-n),a(r*o),i(-n*o),a(r),i(0),a(r))}circle(e,t,n){this.ellipse(e,t,n,n)}stroke(){this._out(`S`,`
`)}nop(){this._out(`n`,`
`)}clip(){this._out(`W n`,`
`)}clipStroke(){this._out(`W S`,`
`)}closeStroke(){this._out(`s`,`
`)}fill(){this._out(`f`,`
`)}fillStroke(){this._out(`B`,`
`)}drawImage(e){var t=this._pdf.getImage(e);t&&(this._xResources[t._resourceName]=t,this._out(t._resourceName,` Do`,`
`))}comment(e){var t=this;e.split(/\r?\n/g).forEach(function(e){t._out(`% `,e,`
`)})}_context(e){if(e!=null)this._opacity=e.opacity,this._matrix=e.matrix;else return{opacity:this._opacity,matrix:this._matrix}}_toPage(e){var t=this._matrix,n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5];return{x:n*e.x+i*e.y+o,y:r*e.x+a*e.y+s}}};function Al(e){return e.replace(/^\s*(['"])(.*)\1\s*$/,`$2`)}function jl(e){var t=/^\s*((normal|italic)\s+)?(([a-z0-9-]+)\s+)?((normal|bold|\d+)\s+)?(([0-9.]+)(px|pt))(\/(([0-9.]+)(px|pt)|normal))?\s+(.*?)\s*$/i.exec(e);if(!t)return{fontSize:12,fontFamily:`sans-serif`};var n=t[8]?parseInt(t[8],10):12;return{italic:t[2]&&t[2].toLowerCase()==`italic`,variant:t[4],bold:t[6]&&/bold|[6789]00/i.test(t[6]),fontSize:n,lineHeight:t[12]?t[12]==`normal`?n:parseInt(t[12],10):null,fontFamily:t[14].split(/\s*,\s*/g).map(Al)}}function Ml(e){function t(t){return e.bold&&(t+=`|bold`),e.italic&&(t+=`|italic`),t.toLowerCase()}var n=e.fontFamily,r,i;if(n instanceof Array)for(var a=0;a<n.length&&(r=t(n[a]),i=Nl[r],!i);++a);else i=Nl[n.toLowerCase()];for(;typeof i==`function`;)i=i();return i||=`Times-Roman`,i}var Nl={serif:`Times-Roman`,"serif|bold":`Times-Bold`,"serif|italic":`Times-Italic`,"serif|bold|italic":`Times-BoldItalic`,"sans-serif":`Helvetica`,"sans-serif|bold":`Helvetica-Bold`,"sans-serif|italic":`Helvetica-Oblique`,"sans-serif|bold|italic":`Helvetica-BoldOblique`,monospace:`Courier`,"monospace|bold":`Courier-Bold`,"monospace|italic":`Courier-Oblique`,"monospace|bold|italic":`Courier-BoldOblique`,zapfdingbats:`ZapfDingbats`,"zapfdingbats|bold":`ZapfDingbats`,"zapfdingbats|italic":`ZapfDingbats`,"zapfdingbats|bold|italic":`ZapfDingbats`};function Pl(e,t){e=e.toLowerCase(),Nl[e]=function(){return Nl[t]},Nl[e+`|bold`]=function(){return Nl[t+`|bold`]},Nl[e+`|italic`]=function(){return Nl[t+`|italic`]},Nl[e+`|bold|italic`]=function(){return Nl[t+`|bold|italic`]}}Pl(`Times New Roman`,`serif`),Pl(`Courier New`,`monospace`),Pl(`Arial`,`sans-serif`),Pl(`Helvetica`,`sans-serif`),Pl(`Verdana`,`sans-serif`),Pl(`Tahoma`,`sans-serif`),Pl(`Georgia`,`sans-serif`),Pl(`Monaco`,`monospace`),Pl(`Andale Mono`,`monospace`);function Fl(e,t){if(arguments.length==1)for(var n in e)ll(e,n)&&Fl(n,e[n]);else switch(e=e.toLowerCase(),Nl[e]=t,e){case`dejavu sans`:Nl[`sans-serif`]=t;break;case`dejavu sans|bold`:Nl[`sans-serif|bold`]=t;break;case`dejavu sans|italic`:Nl[`sans-serif|italic`]=t;break;case`dejavu sans|bold|italic`:Nl[`sans-serif|bold|italic`]=t;break;case`dejavu serif`:Nl.serif=t;break;case`dejavu serif|bold`:Nl[`serif|bold`]=t;break;case`dejavu serif|italic`:Nl[`serif|italic`]=t;break;case`dejavu serif|bold|italic`:Nl[`serif|bold|italic`]=t;break;case`dejavu mono`:Nl.monospace=t;break;case`dejavu mono|bold`:Nl[`monospace|bold`]=t;break;case`dejavu mono|italic`:Nl[`monospace|italic`]=t;break;case`dejavu mono|bold|italic`:Nl[`monospace|bold|italic`]=t;break}}function Il(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=t[0],l=t[1],u=t[2],d=t[3],f=t[4],p=t[5];return[n*c+r*u,n*l+r*d,i*c+a*u,i*l+a*d,o*c+s*u+f,o*l+s*d+p]}function Ll(e){return e[0]===1&&e[1]===0&&e[2]===0&&e[3]===1&&e[4]===0&&e[5]===0}let Rl={fill:0,stroke:1,fillAndStroke:2,invisible:3,fillAndClip:4,strokeAndClip:5,fillStrokeClip:6,clip:7},zl={dash:[4],dashDot:[4,2,1,2],dot:[1,2],longDash:[8,2],longDashDot:[8,2,1,2],longDashDotDot:[8,2,1,2,1,2],solid:[]},Bl={butt:0,round:1,square:2},Vl={miter:0,round:1,bevel:2};function Hl(e,t){var n=e[t.nodeType];return n?n.call.apply(n,arguments):t}function Ul(e,t,n){e.options._pdfDebug&&t.comment(`BEGIN: `+e.options._pdfDebug);var r=e.transform(),i=e.opacity();if(t.save(),i!=null&&i<1&&t.setOpacity(i),Wl(e,t,n),Gl(e,t,n),r){var a=r.matrix();t.transform(a.a,a.b,a.c,a.d,a.e,a.f)}Kl(e,t,n),Hl({Path:$l,MultiPath:eu,Circle:tu,Arc:nu,Text:ru,Image:ou,Group:au,Rect:su},e,t,n),t.restore(),e.options._pdfDebug&&t.comment(`END: `+e.options._pdfDebug)}function Wl(e,t){var n=e.stroke&&e.stroke();if(n){var r=n.color;if(r){if(r=cu(r),r==null)return;t.setStrokeColor(r.r,r.g,r.b),r.a!=1&&t.setStrokeOpacity(r.a)}var i=n.width;if(i!=null){if(i===0)return;t.setLineWidth(i)}var a=n.dashType;a&&t.setDashPattern(zl[a],0);var o=n.lineCap;o&&t.setLineCap(Bl[o]);var s=n.lineJoin;s&&t.setLineJoin(Vl[s]);var c=n.opacity;c!=null&&t.setStrokeOpacity(c)}}function Gl(e,t){var n=e.fill&&e.fill();if(n&&!(n instanceof vi||n instanceof Ei)){var r=n.color;if(r){if(r=cu(r),r==null)return;t.setFillColor(r.r,r.g,r.b),r.a!=1&&t.setFillOpacity(r.a)}var i=n.opacity;i!=null&&t.setFillOpacity(i)}}function Kl(e,t,n){var r=e.clip();r&&(Ql(r,t,n),t.clip())}function ql(e){return e&&(e instanceof vi||e instanceof Ei||e.color&&!/^(none|transparent)$/i.test(e.color)&&(e.width==null||e.width>0)&&(e.opacity==null||e.opacity>0))}function Jl(e,t,n,r){var i=e.fill();if(i instanceof vi){r?t.clipStroke():t.clip();var a=i instanceof xi,o,s;a?(o={x:i.center().x,y:i.center().y,r:0},s={x:i.center().x,y:i.center().y,r:i.radius()}):(o={x:i.start().x,y:i.start().y},s={x:i.end().x,y:i.end().y});var c=i.stops.elements().map(function(e){var t=e.offset();t=/%$/.test(t)?parseFloat(t)/100:parseFloat(t);var n=cu(e.color());return n.a*=e.opacity(),{offset:t,color:n}});c.unshift(c[0]),c.push(c[c.length-1]);var l={userSpace:i.userSpace(),type:a?`radial`:`linear`,start:o,end:s,stops:c},u=e.rawBBox(),d=u.topLeft(),f=u.getSize();return u={left:d.x,top:d.y,width:f.width,height:f.height},t.gradient(l,u),!0}}function Yl(e,t,n,r){let i=e.fill();if(i instanceof Ei){r?t.clipStroke():t.clip();let n=e.rawBBox(),a=n.topLeft(),o=n.getSize(),s=e.stroke()?e.stroke().width:0;return t.pattern(i,{left:a.x+s/2,top:a.y+s/2,width:o.width-s,height:o.height-s},iu),!0}}function Xl(e,t,n){ql(e.fill())&&ql(e.stroke())?!Jl(e,t,n,!0)&&!Yl(e,t,n,!0)&&t.fillStroke():ql(e.fill())?!Jl(e,t,n,!1)&&!Yl(e,t,n,!1)&&t.fill():ql(e.stroke())?t.stroke():t.nop()}function Zl(e,t){var n=e.segments;if(n.length==4&&e.options.closed){for(var r=[],i=0;i<n.length;++i){if(n[i].controlIn())return!1;r[i]=n[i].anchor()}if(r[0].y==r[1].y&&r[1].x==r[2].x&&r[2].y==r[3].y&&r[3].x==r[0].x||r[0].x==r[1].x&&r[1].y==r[2].y&&r[2].x==r[3].x&&r[3].y==r[0].y)return t.rect(r[0].x,r[0].y,r[2].x-r[0].x,r[2].y-r[0].y),!0}}function Ql(e,t,n){var r=e.segments;if(r.length!==0&&!Zl(e,t,n)){for(var i,a=0;a<r.length;++a){var o=r[a],s=o.anchor();if(!i)t.moveTo(s.x,s.y);else{var c=i.controlOut(),l=o.controlIn();c&&l?t.bezier(c.x,c.y,l.x,l.y,s.x,s.y):t.lineTo(s.x,s.y)}i=o}e.options.closed&&t.close()}}function $l(e,t,n){Ql(e,t,n),Xl(e,t,n)}function eu(e,t,n){for(var r=e.paths,i=0;i<r.length;++i)Ql(r[i],t,n);Xl(e,t,n)}function tu(e,t,n){var r=e.geometry();t.circle(r.center.x,r.center.y,r.radius),Xl(e,t,n)}function nu(e,t,n){var r=e.geometry().curvePoints();t.moveTo(r[0].x,r[0].y);for(var i=1;i<r.length;)t.bezier(r[i].x,r[i++].y,r[i].x,r[i++].y,r[i].x,r[i++].y);Xl(e,t,n)}function ru(e,t){var n=jl(e.options.font),r=e._position,i;t.transform(1,0,0,-1,r.x,r.y+n.fontSize);let a=r=>{t.beginText(),t.setFont(Ml(n),n.fontSize),t.setTextRenderingMode(r),t.showText(e.content(),e._pdfRect?e._pdfRect.width():null)};e.fill()&&e.stroke()?(i=Rl.fillAndStroke,e.options.paintOrder===`stroke`&&(a(Rl.stroke),i=Rl.fill)):e.fill()?i=Rl.fill:e.stroke()&&(i=Rl.stroke),a(i),t.endText()}function iu(e,t,n){for(var r=e.children,i=0;i<r.length;++i)Ul(r[i],t,n)}function au(e,t,n){e._pdfLink&&t.addLink(e._pdfLink.url,e._pdfLink);for(var r=e.children,i=0;i<r.length;++i)Ul(r[i],t,n)}function ou(e,t){var n=e.src();if(n){var r=e.rect(),i=r.getOrigin(),a=r.getSize();t.transform(a.width,0,0,-a.height,i.x,i.y+a.height),t.drawImage(n)}}function su(e,t,n){var r=e.geometry();let[i,a]=r.cornerRadius;i===0&&a===0?(t.rect(r.origin.x,r.origin.y,r.size.width,r.size.height),Xl(e,t,n)):$l(N.fromRect(r,e.options),t,n)}function cu(e){var t=He(e,!0);return t?t.toRGB():null}let lu=Oe.browser||{};function uu(e){return Array.prototype.slice.call(e)}var du=`KENDO-PSEUDO-ELEMENT`;let fu=`data-kendo-bullet-type`;var pu={},R={};R._root=R;let mu=typeof window<`u`?lu.msie||lu.edge:!1;var hu=class extends Ur{constructor(e,t,n){super(e,t.getOrigin(),n),this._pdfRect=t}rect(){return this._pdfRect}rawBBox(){return this._pdfRect}},gu=typeof Element<`u`&&Element.prototype&&(function(e){return e.matches?function(e,t){return e.matches(t)}:e.webkitMatchesSelector?function(e,t){return e.webkitMatchesSelector(t)}:e.mozMatchesSelector?function(e,t){return e.mozMatchesSelector(t)}:e.msMatchesSelector?function(e,t){return e.msMatchesSelector(t)}:function(e){return[].indexOf.call(document.querySelectorAll(e),this)!==-1}})(Element.prototype);(function(e){return e?function t(n){var r=n.cloneNode(!1);if(n.nodeType==1){var i=e(n),a=e(r),o,s=i.data();for(o in s)a.data(o,s[o]);for(/^canvas$/i.test(n.tagName)?r.getContext(`2d`).drawImage(n,0,0):/^(?:input|select|textarea|option)$/i.test(n.tagName)?(r.removeAttribute(`id`),r.removeAttribute(`name`),/^textarea$/i.test(n.tagName)||(r.value=n.value),r.checked=n.checked,r.selected=n.selected):/^img$/i.test(n.tagName)&&r.removeAttribute(`loading`),n._kendoExportVisual&&(r._kendoExportVisual=n._kendoExportVisual),o=n.firstChild;o;o=o.nextSibling)r.appendChild(t(o))}return r}:function(e){let t=(function e(t){let n=t.cloneNode(!1);t._kendoExportVisual&&(n._kendoExportVisual=t._kendoExportVisual);for(let r=t.firstChild;r;r=r.nextSibling)n.appendChild(e(r));return n})(e),n=e.querySelectorAll(`canvas`);n.length&&uu(t.querySelectorAll(`canvas`)).forEach((e,t)=>{e.getContext(`2d`).drawImage(n[t],0,0)});let r=e.querySelectorAll(`input, select, textarea, option`);return uu(t.querySelectorAll(`input, select, textarea, option`)).forEach((e,t)=>{e.removeAttribute(`id`),e.removeAttribute(`name`),/^textarea$/i.test(e.tagName)||(e.value=r[t].value),e.checked=r[t].checked,e.selected=r[t].selected}),uu(t.querySelectorAll(`img`)).forEach(e=>{e.removeAttribute(`loading`)}),t}})(typeof window<`u`&&window.kendo&&window.kendo.jQuery);var _u=(function(){var e=/^((-webkit-|-moz-|-o-|-ms-)?linear-gradient\s*)\(/,t=/^([-0-9.]+%)/,n=/^([-0-9.]+px)/,r=/^(left|right|top|bottom|to|center)\W/,i=/^([-0-9.]+(deg|grad|rad|turn)|0)/,a=/^(\s+)/,o=/^(\()/,s=/^(\))/,c=/^(,)/,l=/^(url)\(/,u=/^(.*?)\)/,d={},f={};function p(f){var p=f;if(bu(d,p))return d[p];function m(){var e=a.exec(f);e&&(f=f.substr(e[1].length))}function h(e){m();var t=e.exec(f);if(t)return f=f.substr(t[1].length),t[1]}function g(){var e=He(f,!0),r,i;if(e){let a=/^#[0-9a-f]+/i.exec(f)||/^rgba?\(.*?\)/i.exec(f)||/^..*?\b/.exec(f);return f=f.substr(a[0].length),e=e.toRGB(),(r=h(n))||(i=h(t)),{color:e,length:r,percent:i}}}function _(e){var n,a,l,u=[],d=!1;if(h(o)){if(n=h(i),n==`0`&&(n=`0deg`),n?(n=Uu(n),h(c)):(a=h(r),a==`to`?a=h(r):a&&/^-/.test(e)&&(d=!0),l=h(r),h(c)),/-moz-/.test(e)&&n==null&&a==null){var p=h(t),m=h(t);d=!0,p==`0%`?a=`left`:p==`100%`&&(a=`right`),m==`0%`?l=`top`:m==`100%`&&(l=`bottom`),h(c)}for(;f&&!h(s);){var _=g();if(!_)break;u.push(_),h(c)}return{type:`linear`,angle:n,to:a&&l?a+` `+l:a||l||null,stops:u,reverse:d}}}function v(){if(h(o)){var e=h(u);return e=e.replace(/^['"]+|["']+$/g,``),h(s),{type:`url`,url:e}}}var y;return(y=h(e))?y=_(y):(y=h(l))&&(y=v()),d[p]=y||{type:`none`}}return function(e){return bu(f,e)?f[e]:f[e]=vu(e).map(p)}})(),vu=(function(){var e={};return function(t,n){n||=/^\s*,\s*/;var r=t+n;if(bu(e,r))return e[r];var i=[],a=0,o=0,s=0,c=!1,l;function u(e){return l=e.exec(t.substr(o))}function d(e){return e.replace(/^\s+|\s+$/g,``)}for(;o<t.length;)!c&&u(/^[\(\[\{]/)?(s++,o++):!c&&u(/^[\)\]\}]/)?(s--,o++):!c&&u(/^[\"\']/)?(c=l[0],o++):c==`'`&&u(/^\\\'/)||c==`"`&&u(/^\\\"/)?o+=2:c==`'`&&u(/^\'/)||c==`"`&&u(/^\"/)?(c=!1,o++):u(n)?(!c&&!s&&o>a&&(i.push(d(t.substring(a,o))),a=o+l[0].length),o+=l[0].length):o++;return a<o&&i.push(d(t.substring(a,o))),e[r]=i}})(),yu=(function(e){return function(t){var n=e[t];return n??=e[t]=Yt(`Mapq`,{font:t}).height,n}})(Object.create(null));function bu(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function xu(e){return e=`_counter_`+e,R[e]}function Su(e){var t=[],n=R;for(e=`_counter_`+e;n;)bu(n,e)&&t.push(n[e]),n=Object.getPrototypeOf(n);return t.reverse()}function Cu(e,t){var n=R;for(e=`_counter_`+e;n&&!bu(n,e);)n=Object.getPrototypeOf(n);n||=R._root,n[e]=(n[e]||0)+(t??1)}function wu(e,t){e=`_counter_`+e,R[e]=t??0}function Tu(e,t,n){for(var r=0;r<e.length;){var i=e[r++],a=parseFloat(e[r]);isNaN(a)?t(i,n):(t(i,a),++r)}}function Eu(e){var t=z(e,`counter-reset`);t&&Tu(vu(t,/^\s+/),wu,0);var n=z(e,`counter-increment`);n&&Tu(vu(n,/^\s+/),Cu,1)}function Du(e,t){var n=He(e,!0);return n&&(n=n.toRGB(),t?n=n.toCssRgba():n.a===0&&(n=null)),n}function Ou(e){var t=``;do{var n=e%26;t=String.fromCharCode(97+n)+t,e=Math.floor(e/26)}while(e>0);return t}function ku(e,t,n){R=Object.create(R),R[e.tagName.toLowerCase()]={element:e,style:t};let r=z(t,`text-decoration`);if(r&&r!=`none`){let n=Ke(e,`text-decoration-color`);r.split(/\s+/g).forEach(function(e){if(!R[e]&&(R[e]=n,e==`underline`)){let e=z(t,`text-underline-offset`);e!=`auto`&&(R[`underline-offset`]=parseFloat(e))}})}Nu(t)&&(R._stackingContext={element:e,group:n})}function Au(){R=Object.getPrototypeOf(R)}function ju(e){if(R._clipbox!=null){var t=e.bbox(R._matrix);R._clipbox?R._clipbox=j.intersect(R._clipbox,t):R._clipbox=t}}function Mu(){var e=R._clipbox;if(e==null)return!0;if(e)return e.width()===0||e.height()===0}function Nu(e){function t(t){return z(e,t)}if(t(`transform`)!=`none`||t(`position`)!=`static`||t(`z-index`)!=`auto`||t(`opacity`)<1)return!0}function Pu(e,t){return window.getComputedStyle(e,t||null)}function z(e,t,n){var r=e.getPropertyValue(t);return(r==null||r===``)&&(lu.webkit?r=e.getPropertyValue(`-webkit-`+t):lu.mozilla?r=e.getPropertyValue(`-moz-`+t):lu.opera?r=e.getPropertyValue(`-o-`+t):mu&&(r=e.getPropertyValue(`-ms-`+t))),arguments.length>2&&(r==null||r===``)?n:r}function Fu(e,t,n,r){e.setProperty(t,n,r),lu.webkit?e.setProperty(`-webkit-`+t,n,r):lu.mozilla?e.setProperty(`-moz-`+t,n,r):lu.opera?e.setProperty(`-o-`+t,n,r):mu&&(e.setProperty(`-ms-`+t,n,r),t=`ms`+t.replace(/(^|-)([a-z])/g,function(e,t,n){return t+n.toUpperCase()}),e[t]=n)}function Iu(e,t,n){return n=`border-`+n,{width:parseFloat(z(t,n+`-width`)),style:z(t,n+`-style`),color:Ke(e,n+`-color`)}}function Lu(e,t){var n=e.style.cssText,r=t();return hn(e,n),r}function Ru(e,t){var n=z(e,`border-`+t+`-radius`).split(/\s+/g).map(parseFloat);return n.length==1&&n.push(n[0]),qu({x:n[0],y:n[1]})}function zu(e){var t=e.getBoundingClientRect();return t=Bu(t,`border-*-width`,e),t=Bu(t,`padding-*`,e),t}function Bu(e,t,n){var r,i,a,o,s;return typeof t==`string`?(r=Pu(n),i=parseFloat(z(r,t.replace(`*`,`top`))),a=parseFloat(z(r,t.replace(`*`,`right`))),o=parseFloat(z(r,t.replace(`*`,`bottom`))),s=parseFloat(z(r,t.replace(`*`,`left`)))):typeof t==`number`&&(i=a=o=s=t),{top:e.top+i,right:e.right-a,bottom:e.bottom-o,left:e.left+s,width:e.right-e.left-a-s,height:e.bottom-e.top-o-i}}function Vu(e){var t=z(e,`transform`);if(t==`none`)return null;var n=/^\s*matrix\(\s*(.*?)\s*\)\s*$/.exec(t);if(n){var r=z(e,`transform-origin`);return n=n[1].split(/\s*,\s*/g).map(parseFloat),r=r.split(/\s+/g).map(parseFloat),{matrix:n,origin:r}}}function Hu(e){return 180*e/Math.PI%360}function Uu(e){var t=parseFloat(e);if(/grad$/.test(e))return Math.PI*t/200;if(/rad$/.test(e))return t;if(/turn$/.test(e))return Math.PI*t*2;if(/deg$/.test(e))return Math.PI*t/180}function Wu(e,t){return t=new Ft(t[0],t[1],t[2],t[3],t[4],t[5]),e.transform(t),t}function Gu(e,t){e.clip(t)}function Ku(e,t,n,r){for(var i=new Un([t,n],r).curvePoints(),a=1;a<i.length;)e.curveTo(i[a++],i[a++],i[a++])}function qu(e){return(e.x<=0||e.y<=0)&&(e.x=e.y=0),e}function Ju(e,t,n,r,i){var a=Math.max(0,t.x),o=Math.max(0,t.y),s=Math.max(0,n.x),c=Math.max(0,n.y),l=Math.max(0,r.x),u=Math.max(0,r.y),d=Math.max(0,i.x),f=Math.max(0,i.y),p=Math.min(e.width/(a+s),e.height/(c+u),e.width/(l+d),e.height/(f+o));return p<1&&(a*=p,o*=p,s*=p,c*=p,l*=p,u*=p,d*=p,f*=p),{tl:{x:a,y:o},tr:{x:s,y:c},br:{x:l,y:u},bl:{x:d,y:f}}}function Yu(e,t,n){var r=Pu(e),i=Ru(r,`top-left`),a=Ru(r,`top-right`),o=Ru(r,`bottom-left`),s=Ru(r,`bottom-right`);if(n==`padding`||n==`content`){var c=Iu(e,r,`top`),l=Iu(e,r,`right`),u=Iu(e,r,`bottom`),d=Iu(e,r,`left`);if(i.x-=d.width,i.y-=c.width,a.x-=l.width,a.y-=c.width,s.x-=l.width,s.y-=u.width,o.x-=d.width,o.y-=u.width,n==`content`){var f=parseFloat(z(r,`padding-top`)),p=parseFloat(z(r,`padding-right`)),m=parseFloat(z(r,`padding-bottom`)),h=parseFloat(z(r,`padding-left`));i.x-=h,i.y-=f,a.x-=p,a.y-=f,s.x-=p,s.y-=m,o.x-=h,o.y-=m}}return typeof n==`number`&&(i.x-=n,i.y-=n,a.x-=n,a.y-=n,s.x-=n,s.y-=n,o.x-=n,o.y-=n),Xu(t,i,a,s,o)}function Xu(e,t,n,r,i){var a=Ju(e,t,n,r,i),o=a.tl,s=a.tr,c=a.br,l=a.bl,u=new N({fill:null,stroke:null});return u.moveTo(e.left,e.top+o.y),o.x&&Ku(u,e.left+o.x,e.top+o.y,{startAngle:-180,endAngle:-90,radiusX:o.x,radiusY:o.y}),u.lineTo(e.right-s.x,e.top),s.x&&Ku(u,e.right-s.x,e.top+s.y,{startAngle:-90,endAngle:0,radiusX:s.x,radiusY:s.y}),u.lineTo(e.right,e.bottom-c.y),c.x&&Ku(u,e.right-c.x,e.bottom-c.y,{startAngle:0,endAngle:90,radiusX:c.x,radiusY:c.y}),u.lineTo(e.left+l.x,e.bottom),l.x&&Ku(u,e.left+l.x,e.bottom-l.y,{startAngle:90,endAngle:180,radiusX:l.x,radiusY:l.y}),u.close()}function Zu(e,t){var n=String(parseFloat(e));switch(t){case`decimal-leading-zero`:return n.length<2&&(n=`0`+n),n;case`lower-roman`:return nt(e).toLowerCase();case`upper-roman`:return nt(e).toUpperCase();case`lower-latin`:case`lower-alpha`:return Ou(e-1);case`upper-latin`:case`upper-alpha`:return Ou(e-1).toUpperCase();default:return n}}function Qu(e,t){function n(e,t,n){return n?(n=n.replace(/^\s*(["'])(.*)\1\s*$/,`$2`),Su(e).map(function(e){return Zu(e,t)}).join(n)):Zu(xu(e)||0,t)}var r=vu(t,/^\s+/),i=[],a;return r.forEach(function(t){var r;(a=/^\s*(["'])(.*)\1\s*$/.exec(t))?i.push(a[2].replace(/\\([0-9a-f]{4})/gi,function(e,t){return String.fromCharCode(parseInt(t,16))})):(a=/^\s*counter\((.*?)\)\s*$/.exec(t))?(r=vu(a[1]),i.push(n(r[0],r[1]))):(a=/^\s*counters\((.*?)\)\s*$/.exec(t))?(r=vu(a[1]),i.push(n(r[0],r[2],r[1]))):(a=/^\s*attr\((.*?)\)\s*$/.exec(t))?i.push(e.getAttribute(a[1])||``):i.push(t)}),i.join(``)}function $u(e){if(e.cssText)return e.cssText;for(var t=[],n=0;n<e.length;++n)t.push(e[n]+`: `+z(e,e[n]));return t.join(`;
`)}function ed(e,t){if(e.tagName==du){td(e,t);return}let n=[];function r(t,r){let i=Pu(e,t),a=i.content;if(Eu(i),a&&a!=`normal`&&a!=`none`&&i.width!=`0px`){let t=e.ownerDocument.createElement(du);hn(t,$u(i)),t.textContent=Qu(e,a),e.insertBefore(t,r),n.push(t)}}if(r(`:before`,e.firstChild),r(`:after`,null),n.length>0){let r=e.className;e.className+=` kendo-pdf-hide-pseudo-elements`,td(e,t),e.className=r,n.forEach(function(t){e.removeChild(t)})}else td(e,t)}function td(e,t){var n=Pu(e),r=Iu(e,n,`top`),i=Iu(e,n,`right`),a=Iu(e,n,`bottom`),o=Iu(e,n,`left`),s=Ru(n,`top-left`),c=Ru(n,`top-right`),l=Ru(n,`bottom-left`),u=Ru(n,`bottom-right`),d=z(n,`direction`),f=Du(Ke(e,`background-color`)),p=_u(z(n,`background-image`)),m=vu(z(n,`background-repeat`)),h=vu(z(n,`background-position`)),g=vu(z(n,`background-origin`)),_=vu(z(n,`background-size`)),v,y;mu&&(v=n.textOverflow,v==`ellipsis`&&(y=e.style.textOverflow,e.style.textOverflow=`clip`)),lu.msie&&lu.version<10&&(h=vu(e.currentStyle.backgroundPosition));var b=Bu(e.getBoundingClientRect(),`border-*-width`,e);(function(){var e=z(n,`clip`),r=/^\s*rect\((.*)\)\s*$/.exec(e);if(r){var i=r[1].split(/[ ,]+/g),a=i[0]==`auto`?b.top:parseFloat(i[0])+b.top,o=i[1]==`auto`?b.right:parseFloat(i[1])+b.left,s=i[2]==`auto`?b.bottom:parseFloat(i[2])+b.top,c=i[3]==`auto`?b.left:parseFloat(i[3])+b.left,l=new P,u=new N().moveTo(c,a).lineTo(o,a).lineTo(o,s).lineTo(c,s).close();Gu(l,u),t.append(l),t=l,ju(u)}})();var x,S,ee,C=z(n,`display`);if(C==`table-row`)for(x=[],S=0,ee=e.children;S<ee.length;++S)x.push(ee[S].getBoundingClientRect());else x=e.getClientRects(),x.length==1&&(x=[e.getBoundingClientRect()]);for(x=te(x),S=0;S<x.length;++S)ne(x[S],S===0,S==x.length-1);if(e.tagName==`A`&&e.href&&!/^#?$/.test(e.getAttribute(`href`))&&(!R._avoidLinks||!gu(e,R._avoidLinks))){let n=document.createRange();n.selectNodeContents(e),uu(n.getClientRects()).forEach(function(n){let r=new P;r._pdfLink={url:e.href,top:n.top,right:n.right,bottom:n.bottom,left:n.left},t.append(r)})}return x.length>0&&C==`list-item`&&!e.getAttribute(`kendo-no-bullet`)&&D(x[0]),(function(){function r(){var n=Yu(e,b,`padding`),r=new P;Gu(r,n),t.append(r),t=r,ju(n)}(sd(e)||/^(hidden|auto|scroll)/.test(z(n,`overflow`))||/^(hidden|auto|scroll)/.test(z(n,`overflow-x`))||/^(hidden|auto|scroll)/.test(z(n,`overflow-y`)))&&r()})(),!rd(e,t)&&!id(e,t)&&fd(e,t),mu&&v==`ellipsis`&&(e.style.textOverflow=y),t;function te(t){if(/^td$/i.test(e.tagName)){var n=R.table;if(n&&z(n.style,`border-collapse`)==`collapse`){var r=Iu(n.element,n.style,`left`).width,i=Iu(n.element,n.style,`top`).width;if(r===0&&i===0)return t;var a=n.element.getBoundingClientRect(),o=n.element.rows[0].cells[0].getBoundingClientRect();if(o.top==a.top||o.left==a.left)return uu(t).map(function(e){return{left:e.left+r,top:e.top+i,right:e.right+r,bottom:e.bottom+i,height:e.height,width:e.width}})}}return t}function w(e,n,r,i,a,o,s,c){if(r<=0)return;var l,u=new P;Wu(u,c),t.append(u),qu(o),qu(s),l=new N({fill:{color:e},stroke:null}),u.append(l),l.moveTo(o.x?Math.max(o.x,i):0,0).lineTo(n-(s.x?Math.max(s.x,a):0),0).lineTo(n-Math.max(s.x,a),r).lineTo(Math.max(o.x,i),r).close(),o.x&&d(i,o,[-1,0,0,1,o.x,0]),s.x&&d(a,s,[1,0,0,1,n-s.x,0]);function d(t,n,i){var a=Math.PI/2*t/(t+r),o={x:n.x-t,y:n.y-r},s=new N({fill:{color:e},stroke:null}).moveTo(0,0);Wu(s,i),Ku(s,0,n.y,{startAngle:-90,endAngle:-Hu(a),radiusX:n.x,radiusY:n.y}),o.x>0&&o.y>0?(s.lineTo(o.x*Math.cos(a),n.y-o.y*Math.sin(a)),Ku(s,0,n.y,{startAngle:-Hu(a),endAngle:-90,radiusX:o.x,radiusY:o.y,anticlockwise:!0})):o.x>0?s.lineTo(o.x,r).lineTo(0,r):s.lineTo(o.x,r).lineTo(o.x,0),u.append(s.close())}}function T(e){var n=new P;if(Gu(n,Xu(e,s,c,u,l)),t.append(n),f){var r=new N({fill:{color:f.toCssRgba()},stroke:null});r.moveTo(e.left,e.top).lineTo(e.right,e.top).lineTo(e.right,e.bottom).lineTo(e.left,e.bottom).close(),n.append(r)}for(var i=p.length;--i>=0;)E(n,e,p[i],m[i%m.length],h[i%h.length],g[i%g.length],_[i%_.length])}function E(t,n,r,i,a,o,s){if(!r||r==`none`)return;if(r.type==`url`){var c=pu[r.url];c&&c.width>0&&c.height>0&&l(t,n,c.width,c.height,function(e,t){e.append(new Wr(r.url,t))})}else if(r.type==`linear`)l(t,n,n.width,n.height,nd(r));else return;function l(t,n,r,c,l){var u=r/c,d,f=n;if(o==`content-box`?(f=Bu(f,`border-*-width`,e),f=Bu(f,`padding-*`,e)):o==`padding-box`&&(f=Bu(f,`border-*-width`,e)),!/^\s*auto(\s+auto)?\s*$/.test(s))if(s==`contain`)d=Math.min(f.width/r,f.height/c),r*=d,c*=d;else if(s==`cover`)d=Math.max(f.width/r,f.height/c),r*=d,c*=d;else{var p=s.split(/\s+/g);r=/%$/.test(p[0])?f.width*parseFloat(p[0])/100:parseFloat(p[0]),c=p.length==1||p[1]==`auto`?r/u:/%$/.test(p[1])?f.height*parseFloat(p[1])/100:parseFloat(p[1])}var m=String(a);switch(m){case`bottom`:m=`50% 100%`;break;case`top`:m=`50% 0`;break;case`left`:m=`0 50%`;break;case`right`:m=`100% 50%`;break;case`center`:m=`50% 50%`;break}m=m.split(/\s+/),m.length==1&&(m[1]=`50%`),/%$/.test(m[0])?m[0]=parseFloat(m[0])/100*(f.width-r):m[0]=parseFloat(m[0]),/%$/.test(m[1])?m[1]=parseFloat(m[1])/100*(f.height-c):m[1]=parseFloat(m[1]);var h=new j([f.left+m[0],f.top+m[1]],[r,c]);function g(){for(;h.origin.x>n.left;)h.origin.x-=r}function _(){for(;h.origin.y>n.top;)h.origin.y-=c}function v(){for(;h.origin.x<n.right;)l(t,h.clone()),h.origin.x+=r}if(i==`no-repeat`)l(t,h);else if(i==`repeat-x`)g(),v();else if(i==`repeat-y`)for(_();h.origin.y<n.bottom;)l(t,h.clone()),h.origin.y+=c;else if(i==`repeat`){g(),_();for(var y=h.origin.clone();h.origin.y<n.bottom;)h.origin.x=y.x,v(),h.origin.y+=c}}}function D(){var r=z(n,`list-style-type`);if(r==`none`)return;var i=z(n,`list-style-position`);function a(n){Lu(e,function(){e.style.position=`relative`;var r=e.ownerDocument.createElement(du);r.style.position=`absolute`,r.style.boxSizing=`border-box`,i==`outside`?(r.style.width=`6em`,r.style.left=`-6.8em`,r.style.textAlign=`right`):r.style.left=`0px`,n(r),e.insertBefore(r,e.firstChild),hd(r,t),e.removeChild(r)})}function o(t){var n=e.parentNode.children,r=e.getAttribute(`kendo-split-index`);if(r!=null)return t(r|0,n.length);for(var i=0;i<n.length;++i)if(n[i]===e)return t(i,n.length)}switch(r){case`circle`:case`disc`:case`square`:a(function(e){e.innerHTML=`&nbsp;`,e.setAttribute(fu,r)});break;case`decimal`:case`decimal-leading-zero`:a(function(e){o(function(t){++t,r==`decimal-leading-zero`&&t<10&&(t=`0`+t),e.innerHTML=t+`.`})});break;case`lower-roman`:case`upper-roman`:a(function(e){o(function(t){t=nt(t+1),r==`upper-roman`&&(t=t.toUpperCase()),e.innerHTML=t+`.`})});break;case`lower-latin`:case`lower-alpha`:case`upper-latin`:case`upper-alpha`:a(function(e){o(function(t){t=Ou(t),/^upper/i.test(r)&&(t=t.toUpperCase()),e.innerHTML=t+`.`})});break}}function ne(n,f,p){if(n.width===0||n.height===0)return;T(n);var m=o.width>0&&(f&&d==`ltr`||p&&d==`rtl`),h=i.width>0&&(p&&d==`ltr`||f&&d==`rtl`);if(r.width===0&&o.width===0&&i.width===0&&a.width===0)return;if(r.color==i.color&&r.color==a.color&&r.color==o.color&&r.width==i.width&&r.width==a.width&&r.width==o.width&&m&&h){n=Bu(n,r.width/2);var g=Yu(e,n,r.width/2);g.options.stroke={color:r.color,width:r.width},t.append(g);return}if(s.x===0&&c.x===0&&u.x===0&&l.x===0&&r.width<2&&o.width<2&&i.width<2&&a.width<2){r.width>0&&t.append(new N({stroke:{width:r.width,color:r.color}}).moveTo(n.left,n.top+r.width/2).lineTo(n.right,n.top+r.width/2)),a.width>0&&t.append(new N({stroke:{width:a.width,color:a.color}}).moveTo(n.left,n.bottom-a.width/2).lineTo(n.right,n.bottom-a.width/2)),m&&t.append(new N({stroke:{width:o.width,color:o.color}}).moveTo(n.left+o.width/2,n.top).lineTo(n.left+o.width/2,n.bottom)),h&&t.append(new N({stroke:{width:i.width,color:i.color}}).moveTo(n.right-i.width/2,n.top).lineTo(n.right-i.width/2,n.bottom));return}var _=Ju(n,s,c,u,l),v=_.tl,y=_.tr,b=_.br,x=_.bl;w(r.color,n.width,r.width,o.width,i.width,v,y,[1,0,0,1,n.left,n.top]),w(a.color,n.width,a.width,i.width,o.width,b,x,[-1,0,0,-1,n.right,n.bottom]);function S(e){return{x:e.y,y:e.x}}w(o.color,n.height,o.width,a.width,r.width,S(x),S(v),[0,-1,1,0,n.left,n.bottom]),w(i.color,n.height,i.width,r.width,a.width,S(y),S(b),[0,1,-1,0,n.right,n.top])}}function nd(e){return function(t,n){var r=n.width(),i=n.height();switch(e.type){case`linear`:var a=e.angle==null?Math.PI:e.angle;switch(e.to){case`top`:a=0;break;case`left`:a=-Math.PI/2;break;case`bottom`:a=Math.PI;break;case`right`:a=Math.PI/2;break;case`top left`:case`left top`:a=-Math.atan2(i,r);break;case`top right`:case`right top`:a=Math.atan2(i,r);break;case`bottom left`:case`left bottom`:a=Math.PI+Math.atan2(i,r);break;case`bottom right`:case`right bottom`:a=Math.PI-Math.atan2(i,r);break}e.reverse&&(a-=Math.PI),a%=2*Math.PI,a<0&&(a+=2*Math.PI);var o=Math.abs(r*Math.sin(a))+Math.abs(i*Math.cos(a)),s=Math.atan(r*Math.tan(a)/i),c=Math.sin(s),l=Math.cos(s),u=Math.abs(c)+Math.abs(l),d=u/2*c,f=u/2*l;a>Math.PI/2&&a<=3*Math.PI/2&&(d=-d,f=-f);var p=[],m=0,h=e.stops.map(function(t,n){var r=t.percent;r?r=parseFloat(r)/100:t.length?r=parseFloat(t.length)/o:n===0?r=0:n==e.stops.length-1&&(r=1);var i={color:t.color.toCssRgba(),offset:r};return r==null?p.push({left:m,stop:i}):(m=r,p.forEach(function(e,t){var n=e.stop;n.offset=e.left+(m-e.left)*(t+1)/(p.length+1)}),p=[]),i}),g=[.5-d,.5+f],_=[.5+d,.5-f];t.append(N.fromRect(n).stroke(null).fill(new bi({start:g,end:_,stops:h,userSpace:!1})));break;case`radial`:window.console&&window.console.log&&window.console.log(`Radial gradients are not yet supported in HTML renderer`);break}}}function rd(e,t){let n=null;if(window.kendo&&window.kendo.jQuery&&e.getAttribute(window.kendo.attr(`role`))){let t=window.kendo.widgetInstance(window.kendo.jQuery(e));t&&(t.exportDOMVisual||t.exportVisual)&&(n=t.exportDOMVisual?t.exportDOMVisual():t.exportVisual())}if(n===null&&e._kendoExportVisual){let t=e.getBoundingClientRect(),r={width:t.width,height:t.height};n=e._kendoExportVisual(r)}if(!n)return!1;let r=new P;r.children.push(n);let i=e.getBoundingClientRect();return r.transform(M().translate(i.left,i.top)),t.append(r),!0}function id(e,t){let n=e.getAttribute(fu);if(!n)return!1;var r=e.getBoundingClientRect();let i=Ke(e,`color`);if(n===`square`){let e=r.height/5;t.append(new $r(new j([r.right-e,r.top+r.height/2.1],[e,e])).fill(i).stroke(i))}else{let e=r.height/7,a=new Ln(new An([r.right-e,r.top+(r.height+e)/2],e));n===`circle`?a.stroke(i,.5):a.fill(i).stroke(null),t.append(a)}return!0}function ad(e,t,n){var r=zu(e),i=new Wr(t,new j([r.left,r.top],[r.width,r.height]));Gu(i,Yu(e,r,`content`)),n.append(i)}function od(e,t){var n=Pu(e),r=Pu(t),i=parseFloat(z(n,`z-index`)),a=parseFloat(z(r,`z-index`)),o=z(n,`position`),s=z(r,`position`);return isNaN(i)&&isNaN(a)?/static|absolute/.test(o)&&/static|absolute/.test(s)?0:o==`static`?-1:+(s==`static`):isNaN(i)?a===0?0:a>0?-1:1:isNaN(a)?i===0?0:i>0?1:-1:parseFloat(i)-parseFloat(a)}function sd(e){return/^(?:textarea|select|input)$/i.test(e.tagName)}function cd(e){return e.selectedOptions&&e.selectedOptions.length>0?e.selectedOptions[0]:e.options[e.selectedIndex]}function ld(e,t){Pu(e);var n=Ke(e,`color`),r=e.getBoundingClientRect();e.type==`checkbox`?(t.append(N.fromRect(new j([r.left+1,r.top+1],[r.width-2,r.height-2])).stroke(n,1)),e.checked&&t.append(new N().stroke(n,1.2).moveTo(r.left+.22*r.width,r.top+.55*r.height).lineTo(r.left+.45*r.width,r.top+.75*r.height).lineTo(r.left+.78*r.width,r.top+.22*r.width))):(t.append(new Ln(new An([(r.left+r.right)/2,(r.top+r.bottom)/2],Math.min(r.width-2,r.height-2)/2)).stroke(n,1)),e.checked&&t.append(new Ln(new An([(r.left+r.right)/2,(r.top+r.bottom)/2],Math.min(r.width-8,r.height-8)/2)).fill(n).stroke(null)))}function ud(e,t){var n=e.tagName.toLowerCase();if(n==`input`&&(e.type==`checkbox`||e.type==`radio`))return ld(e,t);var r=e.parentNode,i=e.ownerDocument,a=i.createElement(du),o;if(hn(a,$u(Pu(e))),n==`input`&&(a.style.whiteSpace=`pre`),(n==`select`||n==`textarea`)&&(a.style.overflow=`auto`),n==`select`)if(e.multiple)for(var s=0;s<e.options.length;++s)o=i.createElement(du),hn(o,$u(Pu(e.options[s]))),o.style.display=`block`,o.textContent=e.options[s].textContent,a.appendChild(o);else o=cd(e),o&&(a.textContent=o.textContent);else a.textContent=e.value;r.insertBefore(a,e),a.scrollLeft=e.scrollLeft,a.scrollTop=e.scrollTop,e.style.display=`none`,fd(a,t),e.style.display=``,r.removeChild(a)}function dd(e){let t=new window.XMLSerializer,n=t.serializeToString(e);if(lu.mozilla&&!(e.getAttribute(`width`)&&e.getAttribute(`height`))){let r=new window.DOMParser().parseFromString(n,`image/svg+xml`).documentElement,i=zu(e);r.setAttribute(`width`,i.width),r.setAttribute(`height`,i.height),n=t.serializeToString(r)}return n}function fd(e,t){switch(R._stackingContext.element===e&&(R._stackingContext.group=t),e.tagName.toLowerCase()){case`img`:ad(e,e.src,t);break;case`svg`:ad(e,`data:image/svg+xml;base64,${gt(dd(e))}`,t);break;case`canvas`:try{ad(e,e.toDataURL(`image/png`),t)}catch{}break;case`textarea`:case`input`:case`select`:ud(e,t);break;default:for(var n=[],r=[],i=[],a=e.firstChild;a;a=a.nextSibling)switch(a.nodeType){case 3:/\S/.test(a.data)&&pd(e,a,t);break;case 1:var o=Pu(a),s=z(o,`float`);z(o,`position`)==`static`?s==`none`?n.push(a):r.push(a):i.push(a);break}St(n,od).forEach(function(e){hd(e,t)}),St(r,od).forEach(function(e){hd(e,t)}),St(i,od).forEach(function(e){hd(e,t)})}}function pd(e,t,n){if(Mu())return;var r=Pu(e);if(parseFloat(z(r,`text-indent`))<-500)return;var i=t.data,a=0,o=i.search(/\S\s*$/)+1;if(!o)return;var s=z(r,`font-size`),c=z(r,`line-height`),l=[z(r,`font-style`),z(r,`font-variant`),z(r,`font-weight`),s,z(r,`font-family`)].join(` `);if(s=parseFloat(s),c=parseFloat(c),s===0||isNaN(s))return;var u=Ke(e,`color`),d=e.ownerDocument.createRange(),f=z(r,`text-align`)==`justify`,p=z(r,`column-count`,1),m=z(r,`white-space`),h=z(r,`text-transform`),g=e.getBoundingClientRect().width/s*5;g===0&&(g=500);var _=null,v=R.underline,y=R[`line-through`],b=R.overline,x=R[`underline-offset`];for(v&&S(E);!C(););(y||b)&&S(T);return;function S(e){d.selectNode(t);let n=uu(d.getClientRects());S=e=>n.forEach(e),S(e)}function ee(e){if(mu||lu.chrome||lu.safari){for(var t=e.getClientRects(),n={top:1/0,right:-1/0,bottom:-1/0,left:1/0},r=!1,i=0;i<t.length;++i){var a=t[i];a.width<=1||a.bottom===_||(n.left=Math.min(a.left,n.left),n.top=Math.min(a.top,n.top),n.right=Math.max(a.right,n.right),n.bottom=Math.max(a.bottom,n.bottom),r=!0)}return r?(n.width=n.right-n.left,n.height=n.bottom-n.top,n):e.getBoundingClientRect()}return e.getBoundingClientRect()}function C(){var e=a,n,r=i.substr(a).search(/\S/);if(a+=r,r<0||a>=o)return!0;d.setStart(t,a),d.setEnd(t,a+1),n=ee(d);var s=!1;if((f||p>1)&&(r=i.substr(a).search(/\s/),r>=0)){d.setEnd(t,a+r);var c=ee(d);c.bottom==n.bottom&&(n=c,s=!0,a+=r)}if(!s){if(r=(function e(r,i,a){d.setEnd(t,i);var o=ee(d);return o.bottom!=n.bottom&&r<i?e(r,r+i>>1,i):o.right==n.right?i:(n=o,i<a?e(i,i+a>>1,a):i)})(a,Math.min(o,a+g),o),r==a)return!0;if(a=r,r=d.toString().search(/\s+$/),r===0)return!1;r>0&&(d.setEnd(t,d.startOffset+r),n=ee(d))}mu&&(n=d.getClientRects()[0]);var l=d.toString();if(!/^(?:pre|pre-wrap)$/i.test(m))l=l.replace(/\s+/g,` `);else if(/\t/.test(l)){var u=0;for(r=e;r<d.startOffset;++r){var h=i.charCodeAt(r);h==9?u+=8-u%8:h==10||h==13?u=0:u++}for(;(r=l.search(`	`))>=0;){var v=`        `.substr(0,8-(u+r)%8);l=l.substr(0,r)+v+l.substr(r+1)}}s||(_=n.bottom),te(l,n)}function te(e,t){if(mu&&!isNaN(c)){var r=yu(l),i=(t.top+t.bottom-r)/2;t={top:i,right:t.right,bottom:i+r,left:t.left,height:r,width:t.right-t.left}}switch(h){case`uppercase`:e=e.toUpperCase();break;case`lowercase`:e=e.toLowerCase();break;case`capitalize`:e=e.replace(/(?:^|\s)\S/g,e=>e.toUpperCase());break}var a=new hu(e,new j([t.left,t.top],[t.width,t.height]),{font:l,fill:{color:u}});n.append(a)}function w(e,t,r,i){if(r){var a=new N({stroke:{width:e,color:r}});i-=e,a.moveTo(t.left,i).lineTo(t.right,i),n.append(a)}}function T(e){let t=s/12;w(t,e,y,e.bottom-e.height/2.7),w(t,e,b,e.top)}function E(e){let t=s/12,n=e.bottom;x==null?n+=t:n+=x,w(t,e,v,n)}}function md(e,t,n){var r;n==`auto`?(r=t,n=0):(r=R._stackingContext.group,n=parseFloat(n));for(var i=r.children,a=0;a<i.length&&!(i[a]._dom_zIndex!=null&&i[a]._dom_zIndex>n);++a);var o=new P;if(r.insert(a,o),o._dom_zIndex=n,r!==t&&R._clipbox){var s=R._matrix.invert(),c=R._clipbox.transformCopy(s);Gu(o,N.fromRect(c))}return o}function hd(e,t){var n=Pu(e);if(Eu(n),!/^(style|script|link|meta|iframe|col|colgroup)$/i.test(e.tagName)&&R._clipbox!=null){var r=parseFloat(z(n,`opacity`)),i=z(n,`visibility`),a=z(n,`display`);if(r!==0&&i!=`hidden`&&a!=`none`){var o=Vu(n),s,c=z(n,`z-index`);(o||r<1)&&c==`auto`&&(c=0),s=md(e,t,c),r<1&&s.opacity(r*s.opacity()),ku(e,n,s),o?Lu(e,function(){Fu(e.style,`transform`,`none`,`important`),Fu(e.style,`transition`,`none`,`important`),z(n,`position`)==`static`&&Fu(e.style,`position`,`relative`,`important`);var t=e.getBoundingClientRect(),r=t.left+o.origin[0],i=t.top+o.origin[1],a=[1,0,0,1,-r,-i];a=gd(a,o.matrix),a=gd(a,[1,0,0,1,r,i]),a=Wu(s,a),R._matrix=R._matrix.multiplyCopy(a),ed(e,s)}):ed(e,s),Au()}}}function gd(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=t[0],l=t[1],u=t[2],d=t[3],f=t[4],p=t[5];return[n*c+r*u,n*l+r*d,i*c+a*u,i*l+a*d,o*c+s*u+f,o*l+s*d+p]}function _d(e){let t=.5;e.options.stroke&&it(e.options.stroke.width)&&e.options.stroke.width%2==0&&(t=0);for(let n=0;n<e.segments.length;n++)e.segments[n].anchor().round(0).translate(t,t);return e}function vd(e,t){return-e.x*t.y+e.y*t.x<0}function B(e){return typeof e==`number`&&!isNaN(e)}function yd(e){return typeof e==`string`}function bd(e){return B(e)||yd(e)&&isFinite(e)}function xd(e,t){return(e+1)%t}function Sd(e,t){let n=e-1;return n<0?t-1:n}function Cd(e,t){return t===1||e%t===0?0:e<0?t+e%t:e>=t?e%t:e}function wd(e){return typeof e==`function`}let Td=`object`;function Ed(e,t){for(let n in t){if(n===`__proto__`||n===`constructor`)continue;let r=t[n],i=typeof r,a;if(a=i===Td&&r!==null?r.constructor:null,a&&a!==Array)if(r instanceof Date)e[n]=new Date(r.getTime());else if(wd(r.clone))e[n]=r.clone();else{let t=e[n];typeof t==Td?e[n]=t||{}:e[n]={},Ed(e[n],r)}else i!==`undefined`&&(e[n]=r)}return e}function V(e){let t=arguments.length;for(let n=1;n<t;n++)Ed(e,arguments[n]);return e}function Dd(e){return typeof e==`object`}function Od(e){return B(e)?e+`px`:e}let kd=/width|height|top|left|bottom|right/i;function Ad(e){return kd.test(e)}function jd(e,t){let n=yd(t)?[t]:t;if(se(n)){let t={},r=window.getComputedStyle(e);for(let e=0;e<n.length;e++){let i=n[e];t[i]=Ad(i)?parseFloat(r[i]):r[i]}return t}else if(Dd(t))for(let n in t)e.style[n]=Od(t[n])}function H(e,t=0){let n={top:0,right:0,bottom:0,left:0};return typeof e==`number`?n.top=n[O]=n[b]=n[T]=e:(n.top=e.top||t,n[O]=e.right||t,n[b]=e.bottom||t,n[T]=e.left||t),n}let Md={compile:function(e){return e}};var Nd=class{static register(e){Md=e}static compile(e,t){return Md.compile(e,t)}};function Pd(e={}){let t;return e.template?e.template=t=Nd.compile(e.template):wd(e.content)&&(t=e.content),t}function Fd(e={}){let t;return e.ariaTemplate?e.ariaTemplate=t=Nd.compile(e.ariaTemplate):wd(e.ariaContent)&&(t=e.ariaContent),t}let Id=/\[(?:(\d+)|['"](.*?)['"])\]|((?:(?!\[.*?\]|\.).)+)/g,Ld={};Ld.undefined=function(e){return e};function Rd(e){if(Ld[e])return Ld[e];let t=[];return e.replace(Id,function(e,n,r,i){t.push(n===void 0?r||i:n)}),Ld[e]=function(e){let n=e;for(let e=0;e<t.length&&n;e++)n=n[t[e]];return n},Ld[e]}let zd=(e,t)=>e.filter(t);function Bd(e,t){if(e.className){let n=t.split(` `);for(let t=0;t<n.length;t++)if(e.className.indexOf&&e.className.indexOf(n[t])!==-1)return!0}}var Vd=class{constructor(){this._map=new Map}get(e){return this._map.get(e)}set(e,t){this._map.set(e,t)}};function U(e,t){if(t)return t.includes(e)}function Hd(e,t,n){return Et(e+(t-e)*n,3)}let Ud=`trigger`;var Wd=class{constructor(e,t){this.observer=e,this.handlerMap=V({},this.handlerMap,t)}trigger(e,t){let{observer:n,handlerMap:r}=this,i;return r[e]?i=this.callObserver(r[e],t):n[Ud]&&(i=this.callObserver(Ud,e,t)),i}callObserver(e,...t){return this.observer[e].apply(this.observer,t)}requiresHandlers(e){if(this.observer.requiresHandlers)return this.observer.requiresHandlers(e);for(let t=0;t<e.length;t++)if(this.handlerMap[e[t]])return!0}};function Gd(e){return Object.prototype.toString.call(e)===`[object Object]`}function Kd(e,t){let n=e.length,r=[];for(let i=0;i<n;i++){let n=t(e[i]);it(n)&&r.push(n)}return r}let qd=Oe.browser||{};function Jd(e){let t=0;return e.wheelDelta?(t=-e.wheelDelta/120,qd.webkit&&(t/=2*Math.max(window.devicePixelRatio,.625))):e.detail&&(t=e.detail/3),t=t>0?Math.ceil(t):Math.floor(t),t}let{append:Yd,bindEvents:Xd,defined:W,deg:Zd,elementOffset:Qd,elementSize:$d,eventCoordinates:ef,eventElement:tf,hashKey:nf,last:rf,limitValue:G,objectKey:af,rad:of,round:K,unbindEvents:sf,valueOrDefault:q}=xn;var cf=class e{static fetchFonts(t,n,r={depth:0}){!t||r.depth>5||!document.fonts||Object.keys(t).forEach(function(i){let a=t[i];i===`dataSource`||i[0]===`$`||!a||(i===`font`?n.push(a):typeof a==`object`&&(r.depth++,e.fetchFonts(a,n,r),r.depth--))})}static loadFonts(e,t){let n=[];if(e.length>0&&document.fonts){try{n=e.map(function(e){return document.fonts.load(e)})}catch(e){Te(e)}Promise.all(n).then(t,t)}else t()}static preloadFonts(t,n){let r=[];e.fetchFonts(t,r),e.loadFonts(r,n)}};function J(e,t){let n=e.prototype;n.options?n.options=V({},n.options,t):n.options=t}let lf=`k-i-`,uf=`k-svg-i-`;var df=class{constructor(e,t){this.element=e,this.options=V({},this.options,t),this.wrapper()}wrapper(){this.addClasses()}addClasses(){}html(){return this.element.outerHTML}};J(df,{name:``,size:`none`,themeColor:`none`,flip:`default`,iconClass:``,stylingOptions:[`size`,`themeColor`,`fill`]});var ff=class extends df{constructor(e,t){super(e,t)}wrapper(){let e=this.element.className.split(` `).find(e=>e.startsWith(lf)),t=this.options.icon?`${this.options.icon.startsWith(lf)?``:lf}${this.options.icon}`:``;this._className=t,ce(this.element,`k-icon`),ce(this.element,`k-font-icon`),ue(this.element,e),ce(this.element,t),ce(this.element,this.options.iconClass||``),super.wrapper()}};J(ff,{name:`HTMLFontIcon`,icon:null});var pf=class extends df{constructor(e,t){e.innerHTML=``,super(e,t)}wrapper(){let e=this.options.icon,t=this.options.iconClass,n=this.element.className.split(` `).find(e=>e.startsWith(uf));if(!e&&t){let n=t.match(/k-i-(\w+(?:-\w+)*)/);n&&(e=n[1],t=t.replace(n[0],``))}yd(e)&&(e=e.replace(`k-i-`,``).replace(/-./g,e=>e[1].toUpperCase()),e=this.options.svgIcons[e]||this.options.svgIcons[`${e}Icon`]);let r=e&&e.name?`${uf}${e.name}`:``;if(this._className=r,ce(this.element,`k-svg-icon`),ue(this.element,n),ce(this.element,r),ce(this.element,t||``),this.element.setAttribute(`aria-hidden`,`true`),e&&Gd(e)){let t=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);t.setAttribute(`viewBox`,e.viewBox||``),t.setAttribute(`focusable`,`false`),t.innerHTML=e.content||``,this.element.appendChild(t)}super.wrapper()}};J(pf,{name:`HTMLSvgIcon`,icon:null,svgIcons:{}});let mf={svg:pf,font:ff};function hf(e,t){let n=e,r=t;return(!n||Dd(n)&&!(n instanceof HTMLElement)||yd(n))&&(r=n,n=document.createElement(`span`)),yd(r)&&(r={icon:r}),r.type||=`svg`,mf[r.type]?new mf[r.type](n,r).html():null}function gf(e){let t=E,n=D;for(let r=0,i=e.length;r<i;r++){let i=e[r];i!==null&&isFinite(i)&&(t=Math.min(t,i),n=Math.max(n,i))}return{min:t===E?void 0:t,max:n===D?void 0:n}}function _f(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(t(r,n,e))return r}}let vf=Ft,yf=/matrix\((.*)\)/;function bf(e){let t=e.match(yf);if(t===null||t.length!==2)return vf.unit();let n=t[1].split(`,`).map(e=>parseFloat(e));return new vf(...n)}function xf(e){let t=getComputedStyle(e).transform;return t===`none`?vf.unit():bf(t)}function Sf(e){if(!e)return vf.unit();let t=xf(e),n=e.parentElement;for(;n;){let e=xf(n);t=t.multiplyCopy(e),n=n.parentElement}return t.b=t.c=t.e=t.f=0,t}function Cf(e){return new Ue(e).isDark()?k:y}let wf={};var Tf=class{constructor(e){this._index={},this._values=e?e.slice(0):[];for(let e=0;e<this._values.length;e++)this._index[this._values[e]]=e}values(){return this._values.filter(e=>e!==wf)}has(e){return this._index[e]!==void 0}add(e){this.has(e)||(this._index[e]=this._values.length,this._values.push(e))}delete(e){let t=this._index[e];t!==void 0&&(this._values[t]=wf,delete this._index[e])}clear(){this._index={},this._values=[]}get size(){return this._values.length}},Ef=class{constructor(e){this._set=new Set(e)}values(){return Array.from(this._set)}has(e){return this._set.has(e)}add(e){this._set.add(e)}delete(e){this._set.delete(e)}clear(){this._set.clear()}get size(){return this._set.size}};let Df=()=>{let e=!1;return typeof Set==`function`&&(e=new Set([1]).has(1)),e};function Of(e){return Df()?new Ef(e):new Tf(e)}function kf(e){throw e}let Af={INSERT:45,DELETE:46,BACKSPACE:8,TAB:9,ENTER:13,ESC:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,END:35,HOME:36,SPACEBAR:32,PAGEUP:33,PAGEDOWN:34,F2:113,F10:121,F12:123,NUMPAD_PLUS:107,NUMPAD_MINUS:109,NUMPAD_DOT:110};function jf(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Mf=class e{constructor(){this.height=0,this.width=0,this.data=[]}clone(){let t=new e;return t.height=this.height,t.width=this.width,t.data=this.data.map(e=>e.slice()),t}get(e,t){let n=this.data[e];return n?n[t]:null}set(e,t,n){let r=this.data[e];r??=this.data[e]=[],r[t]=n,e>=this.height&&(this.height=e+1),t>=this.width&&(this.width=t+1)}each(e,t){for(let n=0;n<this.height;++n)for(let r=0;r<this.width;++r){let i=this.get(n,r);if((t||i!=null)&&(i=e(i,n,r),i!==void 0))return i}}map(t,n){let r=new e;return this.each(function(e,n,i){r.set(n,i,t(e,n,i))},n),r}transpose(){let t=new e;return this.each(function(e,n,r){t.set(r,n,e)}),t}unit(e){this.width=this.height=e;let t=this.data=Array(e);for(let n=e;--n>=0;){let r=t[n]=Array(e);for(let t=e;--t>=0;)r[t]=+(n===t)}return this}multiply(t){let n=this,r=new e;for(let e=0;e<n.height;++e)for(let i=0;i<t.width;++i){let a=0;for(let r=0;r<n.width;++r){let o=n.get(e,r),s=t.get(r,i);typeof o==`number`&&typeof s==`number`&&(a+=o*s)}r.set(e,i,a)}return r}inverse(){let t=this.width,n=this.augment(new e().unit(t)),r=n.data;for(let e=0;e<t;++e){let n=Nf(e,t,function(t){return r[t][e]});if(!r[n][e])return null;if(e!==n){let t=r[e];r[e]=r[n],r[n]=t}for(let n=e+1;n<t;++n){for(let i=e+1;i<2*t;++i)r[n][i]-=r[e][i]*r[n][e]/r[e][e];r[n][e]=0}}for(let e=0;e<t;++e)for(let n=r[e][e],i=0;i<2*t;++i)r[e][i]/=n;for(let e=t;--e>=0;)for(let n=e;--n>=0;)if(r[n][e])for(let i=2*t;--i>=t;)r[n][i]-=r[e][i]*r[n][e];return n.slice(0,t,t,t)}augment(e){let t=this.clone(),n=t.width;return e.each(function(e,r,i){t.set(r,i+n,e)}),t}slice(t,n,r,i){let a=new e;for(let e=0;e<r;++e)for(let r=0;r<i;++r)a.set(e,r,this.get(t+e,n+r));return a}};function Nf(e,t,n){let r=n(e),i=e;for(let a=e+1;a<t;a++){let t=n(e);t>r&&(r=t,i=e)}return i}let Pf={down:`pointerdown`,move:`pointermove`,up:`pointerup`,cancel:`pointercancel pointerleave`};function Ff(e){return Pf[e]||e}let If=e=>e.replace(/([^ ]+)/g,Ff),Lf=1;function Rf(){return`kchart`+Lf++}function zf(){return Rf()}let Bf=new WeakMap,Vf=Symbol(`id`);function Hf(e,t,n,r,i){Gf(e,t,n,r,i)}function Uf(e,t,n,r,i){qf(e,t,n,r,i)}function Wf(e){return typeof e==`string`}function Gf(e,t,n,r,i){(se(t)?t:(t||``).split(` `)).forEach(function(t){Kf(e,t,n,r,i)})}function Kf(e,t,n,r,i){let a=r,o;n&&wd(n)&&!r?a=n:n&&Wf(n)&&wd(a)&&(o=n);let s=function(t){let n=t.target?t.target.closest(o):null;if(!o||o&&t.target&&n){let r=o?n:t.currentTarget;Object.defineProperty(t,"currentTarget",{value:r}),Object.defineProperty(t,"delegateTarget",{value:e}),a(t)}};a[Vf]||(a[Vf]=zf());let c=Bf.get(e);c||(c=new Map,Bf.set(e,c)),c.set(t+a[Vf],s),e.addEventListener(t,s,!!i)}function qf(e,t,n,r){(se(t)?t:(t||``).split(` `)).forEach(function(t){Jf(e,t,n,r)})}function Jf(e,t,n,r){let i=Bf.get(e);if(i&&n&&n[Vf]){let a=t+n[Vf],o=i.get(a);i.delete(a),o&&e.removeEventListener(t,o,!!r)}}function Yf(){let e=Xf(navigator.userAgent),t={};return t.mobileOS=e,t}function Xf(e){let t=!1,n={wp:/(Windows Phone(?: OS)?)\s(\d+)\.(\d+(\.\d+)?)/,fire:/(Silk)\/(\d+)\.(\d+(\.\d+)?)/,android:/(Android|Android.*(?:Opera|Firefox).*?\/)\s*(\d+)\.?(\d+(\.\d+)?)?/,iphone:/(iPhone|iPod).*OS\s+(\d+)[._]([\d._]+)/,ipad:/(iPad).*OS\s+(\d+)[._]([\d_]+)/,playbook:/(PlayBook).*?Tablet\s*OS\s*(\d+)\.(\d+(\.\d+)?)/,windows:/(MSIE)\s+(\d+)\.(\d+(\.\d+)?)/,tizen:/(tizen).*?Version\/(\d+)\.(\d+(\.\d+)?)/i,sailfish:/(sailfish).*rv:(\d+)\.(\d+(\.\d+)?).*firefox/i},r={ios:/^i(phone|pad|pod)$/i,android:/^android|fire$/i,windows:/windows/,wp:/wp/,flat:/sailfish|ffos|tizen/i};for(let i in n)if(e.match(n[i])){if(i===`windows`&&`plugins`in navigator)return!1;t={},t.device=i,t.name=Zf(i,r),t[t.name]=!0;break}return t}function Zf(e,t,n){for(let n in t)if(t[n].test(e))return n;return n===void 0?e:n}function Qf(){}function $f(){return new Date().getTime()}let ep=`string`,tp=`function`,np=function(){this._defaultPrevented=!0},rp=function(){return this._defaultPrevented===!0};var ip=class{constructor(){this._events={}}destroy(){this.unbind()}bind(e,t,n){let r=this,i,a=typeof e==ep?[e]:e||[],o,s,c,l=typeof t==tp,u;if(t===void 0){for(i in e)r.bind(i,e[i]);return r}for(i=0,o=a.length;i<o;i++){let e=a[i];c=l?t:t[e],c&&(n&&(s=c,c=function(){r.unbind(e,c),s.apply(r,arguments)},c.original=s),u=r._events[e]=r._events[e]||[],u.push(c))}return r}one(e,t){return this.bind(e,t,!0)}first(e,t){let n=this,r,i=typeof e==ep?[e]:e,a,o,s=typeof t==tp,c;for(r=0,a=i.length;r<a;r++){let e=i[r];o=s?t:t[e],o&&(c=n._events[e]=n._events[e]||[],c.unshift(o))}return n}trigger(e,t){let n=this,r=n._events[e],i,a;if(r){let e=t||{};for(e.sender=n,e._defaultPrevented=!1,e.preventDefault=np,e.isDefaultPrevented=rp,r=r.slice(),i=0,a=r.length;i<a;i++)r[i].call(n,e);return e._defaultPrevented===!0}return!1}unbind(e,t){let n=this,r=n._events[e],i;if(e===void 0)n._events={};else if(r)if(t)for(i=r.length-1;i>=0;i--)(r[i]===t||r[i].original===t)&&r.splice(i,1);else n._events[e]=[];return n}_setEvents(e){let t=(this.events||[]).length;for(let n=0;n<t;n++){let t=this.events[n];this.options[t]&&e[t]&&(this.unbind(t,this.options[t]),this._events&&this._events[t]&&delete this._events[t])}this.bind(this.events,e)}};let ap=Object.assign,op=e=>{e.preventDefault()},sp=800,cp=0,lp=`press`,up=`hold`,dp=`select`,fp=`start`,pp=`move`,mp=`cancel`,hp=`doubleTap`,gp=`release`,_p=`gesturechange`,vp=`gestureend`,yp=`gesturetap`,bp={api:0,touch:0,mouse:9,pointer:9};function xp(e,t){let n=e.x.location,r=e.y.location,i=t.x.location,a=t.y.location,o=n-i,s=r-a;return{center:{x:(n+i)/2,y:(r+a)/2},distance:Math.sqrt(o*o+s*s)}}function Sp(e){let t=[],n=e.originalEvent||e,r=e.currentTarget;return e.api?t.push({id:2,event:e,target:e.target,currentTarget:e.target,location:e,type:`api`}):t.push({location:n,event:e,target:e.target,currentTarget:r,id:n.pointerId,type:`pointer`}),t}var Cp=class{constructor(e,t){let n=this;n.support=Yf(),n.invalidZeroEvents=this.support.mobileOS&&this.support.mobileOS.android,n.axis=e,n._updateLocationData(t),n.startLocation=n.location,n.velocity=n.delta=0,n.timeStamp=$f()}move(e){let t=this,n=e[`page`+t.axis],r=$f(),i=r-t.timeStamp||1;!n&&this.invalidZeroEvents||(t.delta=n-t.location,t._updateLocationData(e),t.initialDelta=n-t.startLocation,t.velocity=t.delta/i,t.timeStamp=r)}_updateLocationData(e){let t=this,n=t.axis;t.location=e[`page`+n],t.client=e[`client`+n],t.screen=e[`screen`+n]}},wp=class{constructor(e,t,n){ap(this,{x:new Cp(`X`,n.location),y:new Cp(`Y`,n.location),type:n.type,threshold:e.threshold||bp[n.type],userEvents:e,target:t,currentTarget:n.currentTarget,initialTouch:n.target,id:n.id,pressEvent:n,_clicks:e._clicks,supportDoubleTap:e.supportDoubleTap,_moved:!1,_finished:!1})}press(){this._holdTimeout=setTimeout(()=>this._hold(),this.userEvents.minHold),this._trigger(lp,this.pressEvent)}_tap(e){let t=this;t.userEvents._clicks++,t.userEvents._clicks===1&&(t._clickTimeout=setTimeout(function(){t.userEvents._clicks===1?t._trigger(`tap`,e):t._trigger(hp,e),t.userEvents._clicks=0},300))}_hold(){this._trigger(up,this.pressEvent)}move(e){let t=this,n=e.type!==`api`&&t.userEvents._shouldNotMove;if(!(t._finished||n)){if(t.x.move(e.location),t.y.move(e.location),!t._moved){if(t._withinIgnoreThreshold())return;if(!Ep.current||Ep.current===t.userEvents)t._start(e);else return t.dispose()}t._finished||t._trigger(pp,e)}}end(e){this.endTime=$f(),!this._finished&&(this._finished=!0,this._trigger(gp,e),this._moved?this._trigger(`end`,e):this.supportDoubleTap?this._tap(e):this._trigger(`tap`,e),clearTimeout(this._holdTimeout),this.dispose())}dispose(){let e=this.userEvents.touches||[];this._finished=!0,this.pressEvent=null,clearTimeout(this._holdTimeout);let t=e.indexOf(this);e.splice(t,1)}skip(){this.dispose()}cancel(){this.dispose()}isMoved(){return this._moved}_start(e){clearTimeout(this._holdTimeout),this.startTime=$f(),this._moved=!0,this._trigger(fp,e)}_trigger(e,t){let n=t.event,r={touch:this,x:this.x,y:this.y,target:this.target,event:n};this.userEvents.notify(e,r)&&n.preventDefault()}_withinIgnoreThreshold(){let e=this.x.initialDelta,t=this.y.initialDelta;return Math.sqrt(e*e+t*t)<=this.threshold}};function Tp(e){let t=Pf.up.split(` `),n=0,r=t.length;for(;n<r;n++)e(t[n])}var Ep=class e extends ip{constructor(e,t){super();let n=this,r,i=Yf();if(this.support=i,t||={},this.options=t,r=n.filter=t.filter,n.threshold=t.threshold||cp,n.minHold=t.minHold||sp,n.touches=[],n._maxTouches=t.multiTouch?2:1,n.allowSelection=t.allowSelection,n.captureUpIfMoved=t.captureUpIfMoved,n._clicks=0,n.supportDoubleTap=t.supportDoubleTap,ap(n,{element:e,surface:t.surface||e,stopPropagation:t.stopPropagation,pressed:!1}),this._surfaceMoveHandler=this._move.bind(this),Hf(n.surface,If(`move`),this._surfaceMoveHandler),this._surfaceEndHandler=this._end.bind(this),Hf(n.surface,If(`up cancel`),this._surfaceEndHandler),this._elementStartHandler=this._start.bind(this),Hf(e,If(`down`),r,this._elementStartHandler),e.style[`touch-action`]=t.touchAction||`none`,t.preventDragEvent&&(this._elementDragStartHandler=op,Hf(e,If(`dragstart`),this._elementDragStartHandler)),this._elementSelectHandler=this._select.bind(this),Hf(e,If(`mousedown`),r,this._elementSelectHandler),n.captureUpIfMoved){let e=n.surface;n._preventIfMovingProxy=n.preventIfMoving.bind(n),Tp(function(t){e.addEventListener(t,n._preventIfMovingProxy,!0)})}n.bind([lp,up,`tap`,hp,fp,pp,`end`,gp,mp,`gesturestart`,_p,vp,yp,dp],t)}preventIfMoving(e){this._isMoved()&&e.preventDefault()}destroy(){let e=this,t=this.options,n=this.element;if(!e._destroyed){if(e._destroyed=!0,e.captureUpIfMoved){let t=e.surface;Tp(function(n){t.removeEventListener(n,e._preventIfMovingProxy,!0)})}Uf(e.surface,If(`move`),this._surfaceMoveHandler),Uf(e.surface,If(`up cancel`),this._surfaceEndHandler),Uf(n,If(`down`),this._elementStartHandler),t.preventDragEvent&&Uf(n,If(`dragstart`),this._elementDragStartHandler),Uf(n,If(`mousedown`),this._elementSelectHandler),e._disposeAll(),e.unbind(),delete e.surface,delete e.element,delete e.currentTarget}}capture(){e.current=this}cancel(){this._disposeAll(),this.trigger(mp)}notify(e,t){let n=this.touches,r=e;if(this._isMultiTouch()){switch(r){case pp:r=_p;break;case`end`:r=vp;break;case`tap`:r=yp;break;default:break}ap(t,{touches:n},xp(n[0],n[1]))}return this.trigger(r,ap(t,{type:r}))}press(e,t,n){this._apiCall(`_start`,e,t,n)}move(e,t){this._apiCall(`_move`,e,t)}end(e,t){this._apiCall(`_end`,e,t)}_isMultiTouch(){return this.touches.length>1}_maxTouchesReached(){return this.touches.length>=this._maxTouches}_disposeAll(){let e=this.touches;for(;e.length>0;)e.pop().dispose()}_isMoved(){return zd(this.touches,function(e){return e.isMoved()}).length}_select(e){(!this.allowSelection||this.trigger(dp,{event:e}))&&e.preventDefault()}_start(t){if(t.which&&t.which>1||this._maxTouchesReached())return;e.current=null,this.currentTarget=t.currentTarget,this.stopPropagation&&t.stopPropagation();let n,r=Sp(t);for(let e=0;e<r.length&&!this._maxTouchesReached();e++){let t=r[e];if(n=this.filter?t.currentTarget:this.element,n&&n.length===0)continue;let i=new wp(this,n,t);this.touches.push(i),i.press(),this._isMultiTouch()&&this.notify(`gesturestart`,{})}}_move(e){this._eachTouch(`move`,e)}_end(e){this._eachTouch(`end`,e)}_eachTouch(e,t){let n=this,r={},i=Sp(t),a=n.touches,o,s,c,l;for(o=0;o<a.length;o++)s=a[o],r[s.id]=s;for(o=0;o<i.length;o++)c=i[o],l=r[c.id],l&&(e===`move`&&c.type===`pointer`&&!this.surface.hasPointerCapture(c.id)&&this.surface.setPointerCapture(c.id),l[e](c))}_apiCall(e,t,n,r){this[e]({api:!0,pageX:t,pageY:n,clientX:t,clientY:n,target:r||this.element,stopPropagation:Qf,preventDefault:Qf})}static defaultThreshold(e){cp=e}static minHold(e){sp=e}};function Dp(e){let t=e.length,n=0;for(let r=0;r<t;r++){let t=e[r];B(t)&&n++}return n}let Op={min:function(e){let t=e.length,n=E;for(let r=0;r<t;r++){let t=e[r];B(t)&&(n=Math.min(n,t))}return n===E?e[0]:n},max:function(e){let t=e.length,n=D;for(let r=0;r<t;r++){let t=e[r];B(t)&&(n=Math.max(n,t))}return n===D?e[0]:n},sum:function(e){let t=e.length,n=0;for(let r=0;r<t;r++){let t=e[r];B(t)&&(n+=t)}return n},sumOrNull:function(e){let t=null;return Dp(e)&&(t=Op.sum(e)),t},count:function(e){let t=e.length,n=0;for(let r=0;r<t;r++)e[r]!=null&&n++;return n},avg:function(e){let t=Dp(e),n=e[0];return t>0&&(n=Op.sum(e)/t),n},first:function(e){let t=e.length;for(let n=0;n<t;n++){let t=e[n];if(t!=null)return t}return e[0]}};function kp(e,t){return t===null?t:Rd(e,!0)(t)}var Y=class{constructor(){this._valueFields={},this._otherFields={},this._nullValue={},this._undefinedValue={}}register(e,t=[ie],n={}){for(let r=0;r<e.length;r++){let i=e[r];this._valueFields[i]=t,this._otherFields[i]=n,this._nullValue[i]=this._makeValue(t,null),this._undefinedValue[i]=this._makeValue(t,void 0)}}canonicalFields(e){return this.valueFields(e).concat(this.otherFields(e))}valueFields(e){return this._valueFields[e.type]||[`value`]}otherFields(e){return this._otherFields[e.type]||[`value`]}bindPoint(e,t,n){let r=e.data,i=n===void 0?r[t]:n,a={valueFields:{value:i}},o=this.valueFields(e),s=this._otherFields[e.type],c,l;if(i===null)l=this._nullValue[e.type];else if(i===void 0)l=this._undefinedValue[e.type];else if(Array.isArray(i)){let e=i.slice(o.length);l=this._bindFromArray(i,o),c=this._bindFromArray(e,s)}else if(typeof i==`object`){let t=this.sourceFields(e,o),n=this.sourceFields(e,s);l=this._bindFromObject(i,o,t),c=this._bindFromObject(i,s,n)}return l!==void 0&&(o.length===1?a.valueFields.value=l[o[0]]:a.valueFields=l),a.fields=c||{},a}_makeValue(e,t){let n={},r=e.length;for(let i=0;i<r;i++){let r=e[i];n[r]=t}return n}_bindFromArray(e,t){let n={};if(t){let r=Math.min(t.length,e.length);for(let i=0;i<r;i++)n[t[i]]=e[i]}return n}_bindFromObject(e,t,n=t){let r={};if(t){let i=t.length;for(let a=0;a<i;a++){let i=t[a],o=n[a];o!==null&&(r[i]=kp(o,e))}}return r}sourceFields(e,t){let n=[];if(t){let r=t.length;for(let i=0;i<r;i++){let r=t[i],a=r===`value`?`field`:r+`Field`;n.push(e[a]===null?null:e[a]||r)}}return n}};Y.current=new Y;let Ap=/percent(?:\w*)\((\d+)\)/,jp=RegExp(`^stddev(?:\\((\\d+(?:\\.\\d+)?)\\))?$`);var Mp=class{constructor(e,t,n){this.initGlobalRanges(e,t,n)}initGlobalRanges(e,t,n){let r=t.data,i=jp.exec(e);if(i){this.valueGetter=this.createValueGetter(t,n);let e=this.getAverage(r),a=this.getStandardDeviation(r,e,!1),o=i[1]?parseFloat(i[1]):1,s={low:e.value-a*o,high:e.value+a*o};this.globalRange=function(){return s}}else if(e.indexOf&&e.indexOf(`stderr`)>=0){this.valueGetter=this.createValueGetter(t,n);let e=this.getStandardError(r,this.getAverage(r));this.globalRange=function(t){return{low:t-e,high:t+e}}}}createValueGetter(e,t){let n=e.data,r=Y.current,i=r.valueFields(e),a=W(n[0])?n[0]:{},o;return se(a)?o=Rd(`[`+(t?i.indexOf(t):0)+`]`):B(a)?o=Rd():typeof a==`object`&&(o=Rd(r.sourceFields(e,i)[i.indexOf(t)])),o}getErrorRange(e,t){let n,r,i;if(!W(t))return null;if(this.globalRange)return this.globalRange(e);if(se(t))n=e-t[0],r=e+t[1];else if(B(i=parseFloat(t)))n=e-i,r=e+i;else if(i=Ap.exec(t)){let t=e*(parseFloat(i[1])/100);n=e-Math.abs(t),r=e+Math.abs(t)}else throw Error(`Invalid ErrorBar value: `+t);return{low:n,high:r}}getStandardError(e,t){return this.getStandardDeviation(e,t,!0)/Math.sqrt(t.count)}getStandardDeviation(e,t,n){let r=e.length,i=n?t.count-1:t.count,a=0;for(let n=0;n<r;n++){let r=this.valueGetter(e[n]);B(r)&&(a+=(r-t.value)**2)}return Math.sqrt(a/i)}getAverage(e){let t=e.length,n=0,r=0;for(let i=0;i<t;i++){let t=this.valueGetter(e[i]);B(t)&&(n+=t,r++)}return{value:n/r,count:r}}};function Np(e,t=10){return!Number.isFinite(e)||e===0?e:parseFloat(e.toPrecision(t))}function Pp(e,t){let n=Np(t-e,9);if(n===0){if(t===0)return .1;n=Math.abs(t)}let r=10**Math.floor(Math.log(n)/Math.log(10)),i=Np(n/r,10),a=1;return a=i<1.904762?.2:i<4.761904?.5:i<9.523809?1:2,Np(r*a,10)}var X=class e{constructor(e,t){this.x=e||0,this.y=t||0}clone(){return new e(this.x,this.y)}equals(e){return e&&this.x===e.x&&this.y===e.y}rotate(e,t){let n=of(t),r=Math.cos(n),i=Math.sin(n),{x:a,y:o}=e,{x:s,y:c}=this;return this.x=K(a+(s-a)*r+(c-o)*i,3),this.y=K(o+(c-o)*r-(s-a)*i,3),this}multiply(e){return this.x*=e,this.y*=e,this}distanceTo(e){let t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)}static onCircle(t,n,r){let i=of(n);return new e(t.x-r*Math.cos(i),t.y-r*Math.sin(i))}},Z=class e{constructor(e,t,n,r){this.x1=e||0,this.y1=t||0,this.x2=n||0,this.y2=r||0}equals(e){return this.x1===e.x1&&this.x2===e.x2&&this.y1===e.y1&&this.y2===e.y2}width(){return this.x2-this.x1}height(){return this.y2-this.y1}translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this}move(e,t){let n=this.height(),r=this.width();return e!==void 0&&(this.x1=e,this.x2=this.x1+r),t!==void 0&&(this.y1=t,this.y2=this.y1+n),this}wrap(e){return this.x1=Math.min(this.x1,e.x1),this.y1=Math.min(this.y1,e.y1),this.x2=Math.max(this.x2,e.x2),this.y2=Math.max(this.y2,e.y2),this}wrapLimit(e,t,n){return this.x1=Math.min(this.x1,Math.max(this.x1-t,e.x1)),this.y1=Math.min(this.y1,Math.max(this.y1-n,e.y1)),this.x2=Math.max(this.x2,Math.min(this.x2+t,e.x2)),this.y2=Math.max(this.y2,Math.min(this.y2+n,e.y2)),this}wrapPoint(t){let n=se(t),r=n?t[0]:t.x,i=n?t[1]:t.y;return this.wrap(new e(r,i,r,i)),this}snapTo(e,t){return(t===`x`||!t)&&(this.x1=e.x1,this.x2=e.x2),(t===`y`||!t)&&(this.y1=e.y1,this.y2=e.y2),this}alignTo(e,t){let n=this.height(),r=this.width(),i=t===`top`||t===`bottom`?`y`:`x`,a=i===`y`?n:r;if(t===`center`){let t=e.center(),n=this.center();this.x1+=t.x-n.x,this.y1+=t.y-n.y}else t===`top`||t===`left`?this[i+1]=e[i+1]-a:this[i+1]=e[i+2];return this.x2=this.x1+r,this.y2=this.y1+n,this}shrink(e,t){return this.x2-=e,this.y2-=t,this}expand(e,t){return this.shrink(-e,-t),this}pad(e){let t=H(e);return this.x1-=t.left,this.x2+=t.right,this.y1-=t.top,this.y2+=t.bottom,this}unpad(e){let t=H(e);return t.left=-t.left,t.top=-t.top,t.right=-t.right,t.bottom=-t.bottom,this.pad(t)}clone(){return new e(this.x1,this.y1,this.x2,this.y2)}center(){return new X(this.x1+this.width()/2,this.y1+this.height()/2)}containsPoint(e){return e.x>=this.x1&&e.x<=this.x2&&e.y>=this.y1&&e.y<=this.y2}points(){return[new X(this.x1,this.y1),new X(this.x2,this.y1),new X(this.x2,this.y2),new X(this.x1,this.y2)]}getHash(){return[this.x1,this.y1,this.x2,this.y2].join(`,`)}overlaps(e){return!(e.y2<this.y1||this.y2<e.y1||e.x2<this.x1||this.x2<e.x1)}rotate(e){let t=this.width(),n=this.height(),{x:r,y:i}=this.center(),a=Fp(0,0,r,i,e),o=Fp(t,0,r,i,e),s=Fp(t,n,r,i,e),c=Fp(0,n,r,i,e);return t=Math.max(a.x,o.x,s.x,c.x)-Math.min(a.x,o.x,s.x,c.x),n=Math.max(a.y,o.y,s.y,c.y)-Math.min(a.y,o.y,s.y,c.y),this.x2=this.x1+t,this.y2=this.y1+n,this}toRect(){return new j([this.x1,this.y1],[this.width(),this.height()])}hasSize(){return this.width()!==0&&this.height()!==0}align(e,t,n){return t===`x`?this.alignX(e,n):this.alignY(e,n),this}alignX(e,t){let n=this.width();t===`left`?(this.x1=e.x1,this.x2=this.x1+n):t===`right`?(this.x2=e.x2,this.x1=this.x2-n):t===`center`&&(this.x1=e.x1+(e.width()-n)/2,this.x2=this.x1+n)}alignY(e,t){let n=this.height();t===`top`?(this.y1=e.y1,this.y2=this.y1+n):t===`bottom`?(this.y2=e.y2,this.y1=this.y2-n):t===`center`&&(this.y1=e.y1+(e.height()-n)/2,this.y2=this.y1+n)}};function Fp(e,t,n,r,i){let a=of(i);return new X(n+(e-n)*Math.cos(a)+(t-r)*Math.sin(a),r-(e-n)*Math.sin(a)+(t-r)*Math.cos(a))}var Ip=class e{constructor(e,t,n,r,i){this.center=e,this.innerRadius=t,this.radius=n,this.startAngle=r,this.angle=i}clone(){return new e(this.center,this.innerRadius,this.radius,this.startAngle,this.angle)}middle(){return this.startAngle+this.angle/2}setRadius(e,t){return t?this.innerRadius=e:this.radius=e,this}point(e,t){let n=of(e),r=Math.cos(n),i=Math.sin(n),a=t?this.innerRadius:this.radius;return new X(K(this.center.x-r*a,3),K(this.center.y-i*a,3))}adjacentBox(e,t,n){let r=this.clone().expand(e),i=r.middle(),a=r.point(i),o=t/2,s=n/2,c=Math.sin(of(i)),l=Math.cos(of(i)),u=a.x-o,d=a.y-s;return Math.abs(c)<.9&&(u+=o*-l/Math.abs(l)),Math.abs(l)<.9&&(d+=s*-c/Math.abs(c)),new Z(u,d,u+t,d+n)}containsPoint(e){let t=this.center,n=this.innerRadius,r=this.radius,i=this.startAngle,a=this.startAngle+this.angle,o=e.x-t.x,s=e.y-t.y,c=new X(o,s),l=this.point(i),u=new X(l.x-t.x,l.y-t.y),d=this.point(a),f=new X(d.x-t.x,d.y-t.y),p=K(o*o+s*s,3);return(u.equals(c)||vd(u,c))&&!vd(f,c)&&p>=n*n&&p<=r*r}getBBox(){let e=new Z(E,E,D,D),t=K(this.startAngle%360),n=K((t+this.angle)%360),r=this.innerRadius,i=[0,90,180,270,t,n].sort(Lp),a=i.indexOf(t),o=i.indexOf(n),s;s=t===n?i:a<o?i.slice(a,o+1):[].concat(i.slice(0,o+1),i.slice(a,i.length));for(let t=0;t<s.length;t++){let n=this.point(s[t]);e.wrapPoint(n),e.wrapPoint(n,r)}return r||e.wrapPoint(this.center),e}expand(e){return this.radius+=e,this}};function Lp(e,t){return e-t}(class e extends Ip{constructor(e,t,n,r){super(e,0,t,n,r)}expand(e){return super.expand(e)}clone(){return new e(this.center,this.radius,this.startAngle,this.angle)}setRadius(e){return this.radius=e,this}});var Rp=class{createRing(e,t){let n=e.startAngle+180,r=e.angle+n;(e.angle===0||e.angle>0&&n===r)&&(r+=.001);let i=new A(e.center.x,e.center.y),a=Math.max(e.radius,0),o=Math.max(e.innerRadius,0),s=new Un(i,{startAngle:n,endAngle:r,radiusX:a,radiusY:a}),c=N.fromArc(s,t).close();if(o){s.radiusX=s.radiusY=o;let e=s.pointAt(r);c.lineTo(e.x,e.y),c.arc(r,n,o,o,!0)}else c.lineTo(i.x,i.y);return c}};Rp.current=new Rp;var Q=class{constructor(e){this.children=[],this.initOptions(e)}initOptions(e){this.options=V({},this.options,this.initUserOptions(e))}initUserOptions(e){return e}reflow(e){let t=this.children,n;for(let r=0;r<t.length;r++){let i=t[r];i.reflow(e),n=n?n.wrap(i.box):i.box.clone()}this.box=n||e}destroy(){let e=this.children;this.animation&&this.animation.destroy();for(let t=0;t<e.length;t++)e[t].destroy()}getRoot(){let e=this.parent;return e?e.getRoot():null}getSender(){let e=this.getService();if(e)return e.sender}getService(){let e=this;for(;e;){if(e.chartService)return e.chartService;e=e.parent}}translateChildren(e,t){let n=this.children,r=n.length;for(let i=0;i<r;i++)n[i].box.translate(e,t)}append(){for(let e=0;e<arguments.length;e++){let t=arguments[e];this.children.push(t),t.parent=this}}renderVisual(){this.options.visible!==!1&&(this.createVisual(),this.addVisual(),this.renderChildren(),this.createAnimation(),this.renderComplete())}addVisual(){this.visual&&(this.visual.chartElement=this,this.parent&&this.parent.appendVisual(this.visual))}renderChildren(){let e=this.children,t=e.length;for(let n=0;n<t;n++)e[n].renderVisual()}createVisual(){this.visual=new P({zIndex:this.options.zIndex,visible:q(this.options.visible,!0)})}createAnimation(){this.visual&&this.options.animation&&(this.animation=ea.create(this.visual,this.options.animation))}appendVisual(e){e.chartElement||=this,e.options.noclip?this.clipRoot().visual.append(e):e.options.zIndex===void 0?this.isStackRoot?this.stackVisual(e):this.visual?this.visual.append(e):this.parent.appendVisual(e):this.stackRoot().stackVisual(e)}clipRoot(){return this.parent?this.parent.clipRoot():this}stackRoot(){return this.parent?this.parent.stackRoot():this}stackVisual(e){let t=e.options.zIndex||0,n=this.visual.children,r=n.length,i;for(i=0;i<r;i++){let e=n[i];if(q(e.options.zIndex,0)>t)break}this.visual.insert(i,e)}traverse(e){let t=this.children,n=t.length;for(let r=0;r<n;r++){let n=t[r];e(n),n.traverse&&n.traverse(e)}}closest(e){let t=this,n=!1;for(;t&&!n;)n=e(t),n||(t=t.parent);if(n)return t}renderComplete(){}hasHighlight(){let e=(this.options||{}).highlight;return!(!this.createHighlight||e&&e.visible===!1||this.visible===!1)}toggleHighlight(e,t){let n=(this.options||{}).highlight||{},r=n.visual,i=this._highlight;if(!i){let e={fill:{color:k,opacity:t||.2},stroke:{color:k,width:1,opacity:t||.2}};if(r){if(i=this._highlight=r(Object.assign(this.highlightVisualArgs(),{createVisual:()=>this.createHighlight(e),sender:this.getSender(),series:this.series,dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,runningTotal:this.runningTotal,total:this.total})),!i)return}else i=this._highlight=this.createHighlight(e);i.options.zIndex===void 0&&(i.options.zIndex=q(n.zIndex,this.options.zIndex)),this.appendVisual(i)}i.visible(e)}toggleFocusHighlight(e){let t=(this.options||{}).focusHighlight||{},n=this._focusHighlight;if(!(!e&&!n)){if(!n){let e=this.getRoot().options.background,r=Cf(e),i={fill:{opacity:t.opacity,color:t.color},stroke:Object.assign({},{color:r},t.border),zIndex:t.zIndex};n=this._focusHighlight=this.createFocusHighlight(i),this.appendVisual(n)}n.visible(e)}}createGradientOverlay(e,t,n){let r=new N(Object.assign({stroke:{color:`none`},fill:this.createGradient(n),closed:e.options.closed},t));return r.segments.elements(e.segments.elements()),r}createGradient(e){if(this.parent)return this.parent.createGradient(e)}supportsPointInactiveOpacity(){return!0}};Q.prototype.options={};let{dotsPattern:zp,verticalStripesPattern:Bp,crosshatchPattern:Vp,diagonalStripesPattern:Hp,gridPattern:Up}=wo,Wp={dots:zp,verticalStripes:Bp,crosshatch:Vp,diagonalStripes:Hp,grid:Up};function Gp(e,t){return wd(e)?e(t):e}function Kp(e,t,n){let r=Gp(e,n),i=r&&Wp[r.type];return i?i(Object.assign({},t,r)):t}var qp=class extends Q{constructor(e){super(e),this.options.margin=H(this.options.margin),this.options.padding=H(this.options.padding)}reflow(e){let t=this.options,{width:n,height:r,shrinkToFit:i}=t,a=n&&r,o=t.margin,s=t.padding,c=t.border.width,l,u=()=>{this.align(e,`x`,t.align),this.align(e,`y`,t.vAlign),this.paddingBox=l.clone().unpad(o).unpad(c)},d=e.clone();a&&(d.x2=d.x1+n,d.y2=d.y1+r),i&&d.unpad(o).unpad(c).unpad(s),super.reflow(d),l=a?this.box=new Z(0,0,n,r):this.box,i&&a?(u(),d=this.contentBox=this.paddingBox.clone().unpad(s)):(d=this.contentBox=l.clone(),l.pad(s).pad(c).pad(o),u()),this.translateChildren(l.x1-d.x1+o.left+c+s.left,l.y1-d.y1+o.top+c+s.top);let f=this.children;for(let e=0;e<f.length;e++){let t=f[e];t.reflow(t.box)}}align(e,t,n){this.box.align(e,t,n)}hasBox(){let e=this.options;return e.border.width||e.background}createVisual(){super.createVisual(),this.options.visible&&this.hasBox()&&this.visual.append(N.fromRect(this.paddingBox.toRect(),this.visualStyle()))}visualStyle(){let e=this.options,t=e.border||{};return{stroke:{width:t.width,color:t.color,opacity:q(t.opacity,e.opacity),dashType:t.dashType},fill:Kp(e.pattern,{color:e.background,opacity:e.opacity},void 0),cursor:e.cursor}}};J(qp,{align:T,vAlign:`top`,margin:{},padding:{},border:{color:y,width:0},background:``,shrinkToFit:!1,width:0,height:0,visible:!0});function Jp(e,t){e&&t&&(e.options.className=t.className,e.options.role=t.role,e.options.ariaLabel=t.ariaLabel,e.options.ariaRoleDescription=t.ariaRoleDescription,e.options.ariaChecked=t.ariaChecked)}var Yp=class extends qp{constructor(e,t){super(e),this.pointData=t}getElement(){let{options:e,paddingBox:t}=this,{type:n,rotation:r}=e,i=t.center(),a=t.width()/2,o=t.height()/2;if(!e.visible||!this.hasBox())return null;let s=this.visualStyle(),c;if(n===`circle`)c=new Ln(new An([K(t.x1+a,3),K(t.y1+o,3)],Math.min(a,o)),s);else if(n===`triangle`)c=N.fromPoints([[t.x1+a,t.y1],[t.x1,t.y2],[t.x2,t.y2]],s).close();else if(n===`cross`)c=new Vr(s),c.moveTo(t.x1,t.y1).lineTo(t.x2,t.y2),c.moveTo(t.x1,t.y2).lineTo(t.x2,t.y1);else{let r=t.toRect();if(n===`roundedRect`){let t=q(e.borderRadius,r.width()/5);r.setCornerRadius(t)}c=N.fromRect(r,s)}return r&&c.transform(M().rotate(-r,[i.x,i.y])),c.options.zIndex=e.zIndex,c}createElement(){let e=this.options.visual,t=this.pointData||{},n;return n=e?e({value:t.value,dataItem:t.dataItem,sender:this.getSender(),series:t.series,category:t.category,rect:this.paddingBox.toRect(),options:this.visualOptions(),createVisual:()=>this.getElement()}):this.getElement(),n}visualOptions(){let e=this.options;return{background:e.background,border:e.border,margin:e.margin,padding:e.padding,type:e.type,size:e.width,visible:e.visible}}createVisual(){this.visual=this.createElement(),Jp(this.visual,this.options.accessibilityOptions)}};J(Yp,{type:S,align:x,vAlign:x});let Xp=`radial`,Zp={glass:{type:`linear`,rotation:0,stops:[{offset:0,color:k,opacity:0},{offset:.25,color:k,opacity:.3},{offset:1,color:k,opacity:0}]},sharpBevel:{type:Xp,stops:[{offset:0,color:k,opacity:.55},{offset:.65,color:k,opacity:0},{offset:.95,color:k,opacity:.25}]},roundedBevel:{type:Xp,stops:[{offset:.33,color:k,opacity:.06},{offset:.83,color:k,opacity:.2},{offset:.95,color:k,opacity:0}]},roundedGlass:{type:Xp,supportVML:!1,stops:[{offset:0,color:k,opacity:0},{offset:.5,color:k,opacity:.3},{offset:.99,color:k,opacity:0}]},sharpGlass:{type:Xp,supportVML:!1,stops:[{offset:0,color:k,opacity:.2},{offset:.15,color:k,opacity:.15},{offset:.17,color:k,opacity:.35},{offset:.85,color:k,opacity:.05},{offset:.87,color:k,opacity:.15},{offset:.99,color:k,opacity:0}]},bubbleShadow:{type:Xp,center:[.5,.5],radius:.5}};function Qp(e,t){if(e.x1===t.x1&&e.y1===t.y1&&e.x2===t.x2&&e.y2===t.y2)return t;let n=Math.min(e.x1,t.x1),r=Math.max(e.x1,t.x1),i=Math.min(e.x2,t.x2),a=Math.max(e.x2,t.x2),o=Math.min(e.y1,t.y1),s=Math.max(e.y1,t.y1),c=Math.min(e.y2,t.y2),l=Math.max(e.y2,t.y2),u=[];return u[0]=new Z(r,o,i,s),u[1]=new Z(n,s,r,c),u[2]=new Z(i,s,a,c),u[3]=new Z(r,c,i,l),e.x1===n&&e.y1===o||t.x1===n&&t.y1===o?(u[4]=new Z(n,o,r,s),u[5]=new Z(i,c,a,l)):(u[4]=new Z(i,o,a,s),u[5]=new Z(n,c,r,l)),zd(u,function(e){return e.height()>0&&e.width()>0})[0]}var $p=class extends Q{constructor(e){super(e);let t=this.options;t.width=parseInt(t.width,10),t.height=parseInt(t.height,10),this.gradients={}}reflow(){let{options:e,children:t}=this,n=new Z(0,0,e.width,e.height);this.box=n.unpad(e.margin);for(let e=0;e<t.length;e++)t[e].reflow(n),n=Qp(n,t[e].box)||new Z}createVisual(){this.visual=new P,this.createBackground()}createBackground(){let e=this.options,t=e.border||{},n=this.box.clone().pad(e.margin).unpad(t.width),r=N.fromRect(n.toRect(),{stroke:{color:t.width?t.color:``,width:t.width,dashType:t.dashType},fill:{color:e.background,opacity:e.opacity},zIndex:-10});this.visual.append(r)}getRoot(){return this}createGradient(e){let t=this.gradients,n=af(e),r=Zp[e.gradient],i;if(t[n])i=t[n];else{let a=Object.assign({},r,e);r.type===`linear`?i=new bi(a):(e.innerRadius&&(a.stops=em(a)),i=new xi(a),i.supportVML=r.supportVML!==!1),t[n]=i}return i}cleanGradients(){let e=this.gradients;for(let t in e)e[t]._observers=[]}size(){let e=this.options;return new Z(0,0,e.width,e.height)}};J($p,{width:600,height:400,background:k,border:{color:y,width:0},margin:H(5),zIndex:-2});function em(e){let t=e.stops,n=e.innerRadius/e.radius*100,r=t.length,i=[];for(let e=0;e<r;e++){let r=Object.assign({},t[e]);r.offset=(r.offset*(100-n)+n)/100,i.push(r)}return i}var tm=class extends Q{constructor(e){super(e),this._initDirection()}_initDirection(){let e=this.options;e.vertical?(this.groupAxis=`x`,this.elementAxis=`y`,this.groupSizeField=ae,this.elementSizeField=w,this.groupSpacing=e.spacing,this.elementSpacing=e.vSpacing):(this.groupAxis=`y`,this.elementAxis=`x`,this.groupSizeField=w,this.elementSizeField=ae,this.groupSpacing=e.vSpacing,this.elementSpacing=e.spacing)}reflow(e){this.box=e.clone(),this.reflowChildren()}reflowChildren(){let{box:e,elementAxis:t,groupAxis:n,elementSizeField:r,groupSizeField:i}=this,{groups:a,groupsSize:o,maxGroupElementsSize:s}=this.groupOptions(),c=a.length,l=e[n+1]+this.alignStart(o,e[i]());if(c){let u=l;for(let o=0;o<c;o++){let s=a[o],c=s.groupElements,l=e[t+1],d=c.length;for(let e=0;e<d;e++){let a=c[e],o=this.elementSize(a),d=u+this.alignStart(o[i],s.groupSize),f=new Z;f[n+1]=d,f[n+2]=d+o[i],f[t+1]=l,f[t+2]=l+o[r],a.reflow(f),l+=o[r]+this.elementSpacing}u+=s.groupSize+this.groupSpacing}e[n+1]=l,e[n+2]=l+o,e[t+2]=e[t+1]+s}}alignStart(e,t){let n=0,r=this.options.align;return r===`right`||r===`bottom`?n=t-e:r===`center`&&(n=(t-e)/2),n}groupOptions(){let{box:e,children:t,elementSizeField:n,groupSizeField:r,elementSpacing:i,groupSpacing:a}=this,o=K(e[n]()),s=t.length,c=[],l=0,u=0,d=0,f=0,p=[];for(let m=0;m<s;m++){let s=t[m];s.box||s.reflow(e);let h=this.elementSize(s);this.options.wrap&&K(u+i+h[n])>o&&(c.push({groupElements:p,groupSize:l,groupElementsSize:u}),f=Math.max(f,u),d+=a+l,l=0,u=0,p=[]),l=Math.max(l,h[r]),u>0&&(u+=i),u+=h[n],p.push(s)}return c.push({groupElements:p,groupSize:l,groupElementsSize:u}),f=Math.max(f,u),d+=l,{groups:c,groupsSize:d,maxGroupElementsSize:f}}elementSize(e){return{width:e.box.width(),height:e.box.height()}}createVisual(){}};J(tm,{vertical:!0,wrap:!0,vSpacing:0,spacing:0});let nm=Ur;var rm=class extends Q{constructor(e,t){super(t),this.content=e,this.reflow(new Z)}reflow(e){let t=this.options,n=t.size=Yt(this.content,{font:t.font});this.baseline=n.baseline,this.box=new Z(e.x1,e.y1,e.x1+n.width,e.y1+n.height)}createVisual(){let{font:e,color:t,opacity:n,cursor:r,stroke:i,paintOrder:a}=this.options;this.visual=new nm(this.content,this.box.toRect().topLeft(),{font:e,fill:{color:t,opacity:n},cursor:r,stroke:i,paintOrder:a})}};J(rm,{font:C,color:y});function im(e){let t=e.origin,n=e.bottomRight();return new Z(t.x,t.y,n.x,n.y)}let am=/\n/m;var om=class extends qp{constructor(e,t,n){super(t),this.content=e,this.data=n,this._initContainer(),this.options._autoReflow!==!1&&this.reflow(new Z)}_initContainer(){let e=this.options,t=String(this.content).split(am),n=new tm({vertical:!0,align:e.align,wrap:!1}),r=V({},e,{opacity:1,animation:null});this.container=n,this.append(n);for(let e=0;e<t.length;e++){let i=new rm(t[e].trim(),r);n.append(i)}}reflow(e){let t=this.options,n=t.visual;if(this.container.options.align=t.align,n&&!this._boxReflow){let r=e;r.hasSize()||(this._boxReflow=!0,this.reflow(r),this._boxReflow=!1,r=this.box);let i=this.visual=n(this.visualContext(r));i&&(r=im(i.clippedBBox()||new j),i.options.zIndex=t.zIndex),this.box=this.contentBox=this.paddingBox=r}else if(super.reflow(e),t.rotation){let n=H(t.margin),r=this.box.unpad(n);this.targetBox=e,this.normalBox=r.clone(),r=this.rotate(),r.translate(n.left-n.right,n.top-n.bottom),this.rotatedBox=r.clone(),r.pad(n)}}createVisual(){let e=this.options;if(this.visual=new P({transform:this.rotationTransform(),zIndex:e.zIndex,noclip:e.noclip}),this.hasBox()){let e=N.fromRect(this.paddingBox.toRect(),this.visualStyle());this.visual.append(e)}}renderVisual(){if(this.options.visible)if(this.options.visual){let e=this.visual;e&&!W(e.options.noclip)&&(e.options.noclip=this.options.noclip),this.addVisual(),this.createAnimation()}else super.renderVisual()}visualContext(e){let t={text:this.content,rect:e.toRect(),sender:this.getSender(),options:this.options,createVisual:()=>(this._boxReflow=!0,this.reflow(e),this._boxReflow=!1,this.getDefaultVisual())};return this.data&&Object.assign(t,this.data),t}getDefaultVisual(){this.createVisual(),this.renderChildren();let e=this.visual;return delete this.visual,e}rotate(){let e=this.options;return this.box.rotate(e.rotation),this.align(this.targetBox,`x`,e.align),this.align(this.targetBox,`y`,e.vAlign),this.box}rotationTransform(){let e=this.options.rotation;if(!e)return null;let{x:t,y:n}=this.normalBox.center(),r=this.rotatedBox.center();return M().translate(r.x-t,r.y-n).rotate(e,[t,n])}},sm=class e extends Q{constructor(e){super(e),this._textBox=new om(this.options.text,Object.assign({},this.options,{vAlign:this.options.position})),this.append(this._textBox)}reflow(e){super.reflow(e),this.box.snapTo(e,`x`)}static buildTitle(t,n){let r=t;typeof t==`string`&&(r={text:t}),r=Object.assign({visible:!0},n,r);let i;return r&&r.visible&&r.text&&(i=new e(r)),i}static orderTitles(e){let t=[].concat(e),n=t.filter(e=>e&&e.options.position!==`bottom`),r=t.filter(e=>e&&e.options.position===`bottom`);return cm(n),cm(r),r.reverse(),n.concat(r)}};function cm(e){for(let t=1;t<e.length;t++){let n=e[t]._textBox,r=e[t-1]._textBox;r.options.margin=Object.assign(H(r.options.margin),{bottom:0}),n.options.margin=Object.assign(H(n.options.margin),{top:0})}}J(sm,{color:y,position:`top`,align:x,margin:H(5),padding:H(5)});var lm=class extends om{constructor(e,t,n,r,i){super(t,i),this.text=t,this.value=e,this.index=n,this.dataItem=r,this.reflow(new Z)}visualContext(e){let t=super.visualContext(e);return t.value=this.value,t.dataItem=this.dataItem,t.format=this.options.format,t.culture=this.options.culture,t}click(e,t){e.trigger(`axisLabelClick`,{element:tf(t),value:this.value,text:this.text,index:this.index,dataItem:this.dataItem,axis:this.parent.options})}rotate(){if(this.options.alignRotation!==`center`){let e=this.normalBox.toRect(),t=this.rotationTransform();this.box=im(e.bbox(t.matrix()))}else super.rotate();return this.box}rotationTransform(){let e=this.options,t=e.rotation;if(!t)return null;if(e.alignRotation===`center`)return super.rotationTransform();let n=M().rotate(t).matrix(),r=this.normalBox.toRect(),i=this.targetBox.toRect(),a=e.rotationOrigin||`top`,o=a===`top`||a===`bottom`?`x`:`y`,s=a===`top`||a===`bottom`?`y`:`x`,c=a===`top`||a===`left`?i.origin:i.bottomRight(),l=r.topLeft().transformCopy(n),u=r.topRight().transformCopy(n),d=r.bottomRight().transformCopy(n),f=r.bottomLeft().transformCopy(n),p=j.fromPoints(l,u,d,f),m={[s]:i.origin[s]-p.origin[s]},h=Math.abs(l[s]+m[s]-c[s]),g=Math.abs(u[s]+m[s]-c[s]),_,v;K(h,10)===K(g,10)?(_=l,v=u):g<h?(_=u,v=d):(_=l,v=f);let y=_[o]+(v[o]-_[o])/2;return m[o]=i.center()[o]-y,M().translate(m.x,m.y).rotate(t)}};J(lm,{_autoReflow:!1});var um=class extends qp{constructor(e,t,n){super(t),this.fields=e,this.chartService=n,this.render()}hide(){this.options.visible=!1}show(){this.options.visible=!0}render(){let e=this.options;if(e.visible){let{label:t,icon:n}=e,r=new Z,i=()=>this,a=n.size,o=this.fields.text,s,c;if(W(t)&&t.visible){let e=Pd(t);e?o=e(this.fields):t.format&&(o=this.chartService.format.auto(t.format,o)),t.color||=t.position===`inside`?`#fff`:n.background,this.label=new om(o,V({},t)),this.label.aliasFor=i,t.position===`inside`&&!W(a)&&(n.type===`circle`?a=Math.max(this.label.box.width(),this.label.box.height()):(s=this.label.box.width(),c=this.label.box.height()),r.wrap(this.label.box))}n.width=s||a||7,n.height=c||a||7;let l=new Yp(V({},n));l.aliasFor=i,this.marker=l,this.append(l),this.label&&this.append(this.label),l.reflow(new Z),this.wrapperBox=r.wrap(l.box)}}reflow(e){let{options:t,label:n,marker:r,wrapperBox:i}=this,a=e.center(),o=t.line.length,s=t.position;if(t.visible){let c,l,u;U(s,[`left`,`right`])?s===`left`?(u=i.alignTo(e,s).translate(-o,e.center().y-i.center().y),t.line.visible&&(c=[e.x1,a.y],this.linePoints=[c,[u.x2,a.y]],l=u.clone().wrapPoint(c))):(u=i.alignTo(e,s).translate(o,e.center().y-i.center().y),t.line.visible&&(c=[e.x2,a.y],this.linePoints=[c,[u.x1,a.y]],l=u.clone().wrapPoint(c))):s===`bottom`?(u=i.alignTo(e,s).translate(e.center().x-i.center().x,o),t.line.visible&&(c=[a.x,e.y2],this.linePoints=[c,[a.x,u.y1]],l=u.clone().wrapPoint(c))):(u=i.alignTo(e,s).translate(e.center().x-i.center().x,-o),t.line.visible&&(c=[a.x,e.y1],this.linePoints=[c,[a.x,u.y2]],l=u.clone().wrapPoint(c))),r&&r.reflow(u),n&&(n.reflow(u),r&&(t.label.position===`outside`&&n.box.alignTo(r.box,s),n.reflow(n.box))),this.contentBox=u,this.targetBox=e,this.box=l||u}}createVisual(){super.createVisual(),this.visual.options.noclip=this.options.noclip,this.options.visible&&this.createLine()}renderVisual(){let e=this.options,t=e.visual;e.visible&&t?(this.visual=t(Object.assign(this.fields,{sender:this.getSender(),rect:this.targetBox.toRect(),options:{background:e.background,border:e.background,icon:e.icon,label:e.label,line:e.line,position:e.position,visible:e.visible},createVisual:()=>{this.createVisual(),this.renderChildren();let e=this.visual;return delete this.visual,e}})),this.addVisual()):super.renderVisual()}createLine(){let e=this.options.line;if(this.linePoints){let t=N.fromPoints(this.linePoints,{stroke:{color:e.color,width:e.width,dashType:e.dashType}});_d(t),this.visual.append(t)}}click(e,t){let n=this.eventArgs(t);e.trigger(`noteClick`,n)||t.preventDefault()}over(e,t){let n=this.eventArgs(t);e.trigger(`noteHover`,n)||t.preventDefault()}out(e,t){let n=this.eventArgs(t);e.trigger(`noteLeave`,n)}eventArgs(e){let t=this.options;return Object.assign(this.fields,{element:tf(e),text:W(t.label)?t.label.text:``,visual:this.visual})}};J(um,{icon:{visible:!0,type:S},label:{position:`inside`,visible:!0,align:x,vAlign:x},line:{visible:!0},visible:!0,position:`top`,zIndex:2});let dm={format:(e,t)=>t,toString:e=>e,parseDate:e=>new Date(e),firstDay:()=>0};var fm=class{static register(e){dm=e}static get implementation(){return dm}};let pm=/\{(\d+)(:[^\}]+)?\}/g;var mm=class{constructor(e){this._intlService=e}get intl(){return this._intlService||fm.implementation}set intl(e){this._intlService=e}auto(e,...t){let n=this.intl;return yd(e)&&e.match(te)?n.format(e,...t):n.toString(t[0],e)}localeAuto(e,t,n){let r=this.intl,i;return i=yd(e)&&e.match(te)?e.replace(pm,function(e,i,a){let o=t[parseInt(i,10)];return r.toString(o,a?a.substring(1):``,n)}):r.toString(t[0],e,n),i}},hm=class{constructor(e,t={}){this._intlService=t.intlService,this.sender=t.sender||e,this.format=new mm(t.intlService),this.chart=e,this.rtl=!!t.rtl}get intl(){return this._intlService||fm.implementation}set intl(e){this._intlService=e,this.format.intl=e}notify(e,t){this.chart&&this.chart.trigger(e,t)}isPannable(e){let t=((this.chart||{}).options||{}).pannable;return t&&t.lock!==e}};let gm;var _m=class{static register(e){gm=e}static create(e,t){let n;return n=gm?gm.create(e,t):new Ep(e,Object.assign({},{multiTouch:!0,touchAction:`manipulation`},t)),n}};function vm(e,t){let{tickX:n,tickY:r,position:i}=e,a=new N({stroke:{width:t.width,color:t.color}});return e.vertical?a.moveTo(n,i).lineTo(n+t.size,i):a.moveTo(i,r).lineTo(i,r+t.size),_d(a),a}function ym(e,t){let{lineStart:n,lineEnd:r,position:i}=e,a=new N({stroke:{width:t.width,color:t.color,dashType:t.dashType}});return e.vertical?a.moveTo(n,i).lineTo(r,i):a.moveTo(i,n).lineTo(i,r),_d(a),a}var bm=class extends Q{constructor(e,t=new hm){super(e),this.chartService=t,this.options.visible||(this.options=V({},this.options,{labels:{visible:!1},line:{visible:!1},margin:0,majorTickSize:0,minorTickSize:0})),this.options.minorTicks=V({},{color:this.options.line.color,width:this.options.line.width,visible:this.options.minorTickType!==ne},this.options.minorTicks,{size:this.options.minorTickSize,align:this.options.minorTickType}),this.options.majorTicks=V({},{color:this.options.line.color,width:this.options.line.width,visible:this.options.majorTickType!==ne},this.options.majorTicks,{size:this.options.majorTickSize,align:this.options.majorTickType}),this.initFields(),this.options._deferLabels||this.createLabels(),this.createTitle(),this.createNotes()}initFields(){}labelsRange(){return{min:this.options.labels.skip,max:this.labelsCount()}}normalizeLabelRotation(e){let t=e.rotation;Dd(t)&&(e.alignRotation=t.align,e.rotation=t.angle)}createLabels(){let e=this.options,t=e.vertical?O:x,n=V({},e.labels,{align:t,zIndex:e.zIndex}),r=Math.max(1,n.step);if(this.clearLabels(),n.visible){this.normalizeLabelRotation(n),n.rotation===`auto`&&(n.rotation=0,e.autoRotateLabels=!0);let t=this.labelsRange();for(let e=t.min;e<t.max;e+=r){let r={index:e,count:t.max},i=this.createAxisLabel(e,n,r);i&&(this.append(i),this.labels.push(i))}}}clearLabels(){this.children=zd(this.children,e=>!(e instanceof lm)),this.labels=[]}clearTitle(){this.title&&=(this.children=zd(this.children,e=>e!==this.title),void 0)}clear(){this.clearLabels(),this.clearTitle()}lineBox(){let{options:e,box:t}=this,n=e.vertical,r=e.labels.mirror,i=r?t.x1:t.x2,a=r?t.y2:t.y1,o=e.line.width||0;return n?new Z(i,t.y1,i,t.y2-o):new Z(t.x1,a,t.x2-o,a)}createTitle(){let e=this.options,t=V({rotation:e.vertical?-90:0,text:``,zIndex:1,visualSize:!0},e.title);if(t.visible&&t.text){let e=new om(t.text,t);this.append(e),this.title=e}}createNotes(){let e=this.options,t=e.notes,n=t.data||[];this.notes=[];for(let r=0;r<n.length;r++){let i=V({},t,n[r]);i.value=this.parseNoteValue(i.value);let a=new um({value:i.value,text:i.label.text,dataItem:i},i,this.chartService);a.options.visible&&(W(a.options.position)?e.vertical&&!U(a.options.position,[`left`,`right`])?a.options.position=e.reverse?T:O:!e.vertical&&!U(a.options.position,[`top`,`bottom`])&&(a.options.position=e.reverse?b:`top`):e.vertical?a.options.position=e.reverse?T:O:a.options.position=e.reverse?b:`top`,this.append(a),this.notes.push(a))}}parseNoteValue(e){return e}renderVisual(){super.renderVisual(),this.createPlotBands()}createVisual(){super.createVisual(),this.createBackground(),this.createLine()}gridLinesVisual(){let e=this._gridLines;return e||(e=this._gridLines=new P({zIndex:-2}),this.appendVisual(this._gridLines)),e}createTicks(e){let t=this.options,n=this.lineBox(),r=t.labels.mirror,i=t.majorTicks.visible?t.majorUnit:0,a={vertical:t.vertical};function o(t,i,o){let s=t.length,c=Math.max(1,i.step);if(i.visible)for(let l=i.skip;l<s;l+=c)W(o)&&l%o===0||(a.tickX=r?n.x2:n.x2-i.size,a.tickY=r?n.y1-i.size:n.y1,a.position=t[l],e.append(vm(a,i)))}o(this.getMajorTickPositions(),t.majorTicks),o(this.getMinorTickPositions(),t.minorTicks,i/t.minorUnit)}createLine(){let e=this.options,t=e.line,n=this.lineBox();if(t.width>0&&t.visible){let r=new N({stroke:{width:t.width,color:t.color,dashType:t.dashType}});r.moveTo(n.x1,n.y1).lineTo(n.x2,n.y2),e._alignLines&&_d(r);let i=this._lineGroup=new P;i.append(r),this.visual.append(i),this.createTicks(i)}}getActualTickSize(){let e=this.options,t=0;return e.majorTicks.visible&&e.minorTicks.visible?t=Math.max(e.majorTicks.size,e.minorTicks.size):e.majorTicks.visible?t=e.majorTicks.size:e.minorTicks.visible&&(t=e.minorTicks.size),t}createBackground(){let{options:e,box:t}=this,n=e.background;n&&(this._backgroundPath=N.fromRect(t.toRect(),{fill:{color:n},stroke:null}),this.visual.append(this._backgroundPath))}createPlotBands(){let e=this.options,t=e.plotBands||[],n=e.vertical,r=this.plotArea;if(t.length===0)return;let i=this._plotbandGroup=new P({zIndex:-1}),a=zd(this.pane.axes,e=>e.options.vertical!==this.options.vertical)[0];for(let e=0;e<t.length;e++){let o=t[e],s,c,l=o.label,u;if(n?(s=(a||r.axisX).lineBox(),c=this.getSlot(o.from,o.to,!0)):(s=this.getSlot(o.from,o.to,!0),c=(a||r.axisY).lineBox()),l&&(l.vAlign=l.position||`left`,u=this.createPlotBandLabel(l,o,new Z(s.x1,c.y1,s.x2,c.y2))),s.width()!==0&&c.height()!==0){let e=new j([s.x1,c.y1],[s.width(),c.height()]),t=N.fromRect(e,{fill:{color:o.color,opacity:o.opacity},stroke:null});i.append(t),u&&i.append(u)}}this.appendVisual(i)}createPlotBandLabel(e,t,n){if(e.visible===!1)return null;let r=e.text,i;if(W(e)&&e.visible){let n=Pd(e);n?r=n({text:r,item:t}):e.format&&(r=this.chartService.format.auto(e.format,r)),e.color||=this.options.labels.color}return i=new om(r,e),i.reflow(n),i.renderVisual(),i.visual}createGridLines(e){let t=this.options,{minorGridLines:n,majorGridLines:r,minorUnit:i,vertical:a}=t,o=e.options.line.visible,s=r.visible?t.majorUnit:0,c=e.lineBox(),l=c[a?`y1`:`x1`],u={lineStart:c[a?`x1`:`y1`],lineEnd:c[a?`x2`:`y2`],vertical:a},d=[],f=this.gridLinesVisual();function p(e,t,n){let r=e.length,i=Math.max(1,t.step);if(t.visible)for(let a=t.skip;a<r;a+=i){let r=K(e[a]);U(r,d)||a%n!==0&&(!o||l!==r)&&(u.position=r,f.append(ym(u,t)),d.push(r))}}return p(this.getMajorTickPositions(),r),p(this.getMinorTickPositions(),n,s/i),f.children}reflow(e){let{options:t,labels:n,title:r}=this,i=t.vertical,a=n.length,o=i?ae:w,s=r?r.box[o]():0,c=this.getActualTickSize()+t.margin+s,l=((this.getRoot()||{}).box||e)[o](),u=0;for(let e=0;e<a;e++){let t=n[e].box[o]();t+c<=l&&(u=Math.max(u,t))}i?this.box=new Z(e.x1,e.y1,e.x1+u+c,e.y2):this.box=new Z(e.x1,e.y1,e.x2,e.y1+u+c),this.arrangeTitle(),this.arrangeLabels(),this.arrangeNotes()}getLabelsTickPositions(){return this.getMajorTickPositions()}labelTickIndex(e){return e.index}arrangeLabels(){let{options:e,labels:t}=this,n=this.labelsBetweenTicks(),r=e.vertical,i=e.labels.mirror,a=this.getLabelsTickPositions();for(let e=0;e<t.length;e++){let o=t[e],s=this.labelTickIndex(o),c=r?o.box.height():o.box.width(),l=a[s],u=a[s+1],d,f;r?(d=n?l+(u-l)/2-c/2:l-c/2,f=d):n?(d=l,f=u):(d=l-c/2,f=d+c),this.positionLabel(o,i,d,f)}}positionLabel(e,t,n,r=n){let i=this.options,a=i.vertical,o=this.lineBox(),s=this.getActualTickSize()+i.margin,c;if(a){let r=o.x2;t?(r+=s,e.options.rotationOrigin=T):(r-=s+e.box.width(),e.options.rotationOrigin=O),c=e.box.move(r,n)}else{let i=o.y1;t?(i-=s+e.box.height(),e.options.rotationOrigin=b):(i+=s,e.options.rotationOrigin=`top`),c=new Z(n,i,r,i+e.box.height())}e.reflow(c)}autoRotateLabelAngle(e,t){return e.width()<t?0:e.height()>t?-90:-45}autoRotateLabels(){if(!this.options.autoRotateLabels||this.options.vertical)return!1;let e=this.getMajorTickPositions(),t=this.labels,n=Math.min(t.length,e.length-1),r=0;for(let i=0;i<n;i++){let n=Math.abs(e[i+1]-e[i]),a=t[i].box,o=this.autoRotateLabelAngle(a,n);if(o!==0&&(r=o),r===-90)break}if(r!==0){for(let e=0;e<t.length;e++)t[e].options.rotation=r,t[e].reflow(new Z);return!0}}arrangeTitle(){let{options:e,title:t}=this,n=e.labels.mirror,r=e.vertical;t&&(r?(t.options.align=n?O:T,t.options.vAlign=t.options.position):(t.options.align=t.options.position,t.options.vAlign=n?`top`:b),t.reflow(this.box))}arrangeNotes(){for(let e=0;e<this.notes.length;e++){let t=this.notes[e],n=t.options.value,r;W(n)?(this.shouldRenderNote(n)?t.show():t.hide(),r=this.noteSlot(n)):t.hide(),t.reflow(r||this.lineBox())}}noteSlot(e){return this.getSlot(e)}alignTo(e){let t=e.lineBox(),n=this.options.vertical,r=n?`y`:`x`;this.box.snapTo(t,r),n?this.box.shrink(0,this.lineBox().height()-t.height()):this.box.shrink(this.lineBox().width()-t.width(),0),this.box[r+1]-=this.lineBox()[r+1]-t[r+1],this.box[r+2]-=this.lineBox()[r+2]-t[r+2]}axisLabelText(e,t,n){let r,i=Pd(t),a=()=>t.format?this.chartService.format.localeAuto(t.format,[e],t.culture):e;return r=i?i(Object.assign({},n,{get text(){return a()},value:e,format:t.format,culture:t.culture})):a(),r}slot(e,t,n){let r=this.getSlot(e,t,n);if(r)return r.toRect()}contentBox(){let e=this.box.clone(),t=this.labels;if(t.length){let n=this.options.vertical?`y`:`x`;if(this.chartService.isPannable(n)){let t=this.maxLabelOffset();e[n+1]-=t.start,e[n+2]+=t.end}else{t[0].options.visible&&e.wrap(t[0].box);let n=t[t.length-1];n.options.visible&&e.wrap(n.box)}}return e}maxLabelOffset(){let{vertical:e,reverse:t}=this.options,n=this.labelsBetweenTicks(),r=this.getLabelsTickPositions(),i=e?`y`:`x`,a=this.labels,o=+!!t,s=+!t,c=0,l=0;for(let e=0;e<a.length;e++){let t=a[e],u=this.labelTickIndex(t),d,f;n?(d=r[u+o],f=r[u+s]):d=f=r[u],c=Math.max(c,d-t.box[i+1]),l=Math.max(l,t.box[i+2]-f)}return{start:c,end:l}}limitRange(e,t,n,r,i){let a=this.options;if(e<n&&i<0&&(!W(a.min)||a.min<=n)||r<t&&i>0&&(!W(a.max)||r<=a.max))return null;if(t<n&&i>0||r<e&&i<0)return{min:e,max:t};let o=t-e,s=e,c=t;return e<n&&i<0?(s=G(e,n,r),c=G(e+o,n+o,r)):t>r&&i>0&&(c=G(t,n,r),s=G(t-o,n,r-o)),{min:s,max:c}}valueRange(){return{min:this.seriesMin,max:this.seriesMax}}lineDir(){let{vertical:e,reverse:t}=this.options;return(e?-1:1)*(t?-1:1)}lineInfo(){let{vertical:e}=this.options,t=this.lineBox(),n=e?t.height():t.width(),r=e?`y`:`x`,i=this.lineDir(),a=r+(i===1?1:2).toString();return{axis:r,axisOrigin:a,axisDir:i,lineBox:t,lineSize:n,lineStart:t[a]}}pointOffset(e){let{axis:t,axisDir:n,axisOrigin:r,lineBox:i,lineSize:a}=this.lineInfo();return(n>0?e[t]-i[r]:i[r]-e[t])/a}scaleToDelta(e,t){let n=G(e,-.999,.999),r;return r=n>0?t*Math.min(1,n):t-t/(1+n),r}labelsBetweenTicks(){return!this.options.justified}prepareUserOptions(){}};J(bm,{labels:{visible:!0,rotation:0,mirror:!1,step:1,skip:0},line:{width:1,color:y,visible:!0},title:{visible:!0,position:x},majorTicks:{align:re,size:4,skip:0,step:1},minorTicks:{align:re,size:3,skip:0,step:1},axisCrossingValue:0,majorTickType:re,minorTickType:ne,majorGridLines:{skip:0,step:1},minorGridLines:{visible:!1,width:1,color:y,skip:0,step:1},margin:5,visible:!0,reverse:!1,justified:!0,notes:{label:{text:``}},_alignLines:!0,_deferLabels:!1});let xm=`seconds`,Sm=`minutes`,Cm=`hours`,wm=`days`,Tm=`weeks`,Em=`months`,Dm=`years`,Om=1e3,km=60*Om,Am=60*km,jm=24*Am,Mm={years:31536e6,months:26784e5,weeks:6048e5,days:jm,hours:Am,minutes:km,seconds:Om,milliseconds:1};function Nm(e,t){return e.getTime()-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*km}function Pm(e,t){return new Date(e.getTime()+t)}function Fm(e){let t;return e instanceof Date?t=e:e&&(t=new Date(e)),t}function Im(e,t=0){let n=0,r=e.getDay();if(!isNaN(r))for(;r!==t;)r===0?r=6:r--,n++;return Pm(e,-n*jm)}function Lm(e,t){return t===0&&e.getHours()===23?(e.setHours(e.getHours()+2),!0):!1}function Rm(e,t){let n=new Date(e);return n.setMinutes(0,0,0),Pm(n,(e.getTimezoneOffset()-n.getTimezoneOffset())*km+t*Am)}function zm(e,t,n,r){let i=e;if(e){let a=Fm(e),o=a.getHours();n===`years`?(i=new Date(a.getFullYear()+t,0,1),Lm(i,0)):n===`months`?(i=new Date(a.getFullYear(),a.getMonth()+t,1),Lm(i,o)):n===`weeks`?(i=zm(Im(a,r),t*7,wm),Lm(i,o)):n===`days`?(i=new Date(a.getFullYear(),a.getMonth(),a.getDate()+t),Lm(i,o)):n===`hours`?i=Rm(a,t):n===`minutes`?(i=Pm(a,t*km),i.getSeconds()>0&&i.setSeconds(0)):n===`seconds`?i=Pm(a,t*Om):n===`milliseconds`&&(i=Pm(a,t)),n!==`milliseconds`&&i.getMilliseconds()>0&&i.setMilliseconds(0)}return i}function Bm(e,t,n){return zm(Fm(e),0,t,n)}function Vm(e,t,n){let r=Fm(e);return r&&Bm(r,t,n).getTime()===r.getTime()?r:zm(r,1,t,n)}function Hm(e,t){return e&&t?e.getTime()-t.getTime():-1}function Um(e,t){return e.getTime()-t}function Wm(e){if(se(e)){let t=[];for(let n=0;n<e.length;n++)t.push(Wm(e[n]));return t}else if(e)return Fm(e).getTime()}function Gm(e,t){return e&&t?Wm(e)===Wm(t):e===t}function Km(e,t,n){return Nm(e,t)/Mm[n]}function qm(e,t,n,r){let i=Fm(e),a=Fm(t),o;return o=n===`months`?i.getMonth()-a.getMonth()+(i.getFullYear()-a.getFullYear())*12+Km(i,new Date(i.getFullYear(),i.getMonth()),wm)/new Date(i.getFullYear(),i.getMonth()+1,0).getDate():n===`years`?i.getFullYear()-a.getFullYear()+qm(i,new Date(i.getFullYear(),0),Em,1)/12:n===`days`||n===`weeks`?Km(i,a,n):Um(i,t)/Mm[n],o/r}function Jm(e,t,n){let r;return r=n===`years`?t.getFullYear()-e.getFullYear():n===`months`?Jm(e,t,Dm)*12+t.getMonth()-e.getMonth():Math.floor(n===`days`?Um(t,e)/jm:Um(t,e)/Mm[n]),r}function Ym(e,t){let n;return n=yd(t)&&e.parseDate(t)||Fm(t),n}function Xm(e,t){if(se(t)){let n=[];for(let r=0;r<t.length;r++)n.push(Ym(e,t[r]));return n}return Ym(e,t)}function Zm(e,t){return B(e.weekStartDay)?e.weekStartDay:t&&t.firstDay?t.firstDay():0}let Qm=.1;function $m(e,t){return e instanceof Date?t.findIndex(t=>Gm(t,e)):t.indexOf(e)}var eh=class e extends bm{initFields(){this._ticks={}}categoriesHash(){return``}clone(){let t=new e(Object.assign({},this.options,{categories:this.options.srcCategories}),this.chartService);return t.createLabels(),t}initUserOptions(e){let t=e.categories||[],n=e.min!==void 0,r=e.max!==void 0;if(e.srcCategories=e.categories=t,(n||r)&&t.length){let i=n?Math.floor(e.min):0,a;a=r?e.justified?Math.floor(e.max)+1:Math.ceil(e.max):t.length,e.categories=e.categories.slice(i,a)}return e}rangeIndices(){let e=this.options,t=e.categories.length||1,n=B(e.min)?e.min%1:0,r;return r=B(e.max)&&e.max%1!=0&&e.max<this.totalRange().max?t-(1-e.max%1):t-+!!e.justified,{min:n,max:r}}range(){let e=this.options;return{min:B(e.min)?e.min:0,max:B(e.max)?e.max:this.totalRange().max}}roundedRange(){return this.range()}totalRange(){let e=this.options;return{min:0,max:Math.max(this._seriesMax||0,e.srcCategories.length)-+!!e.justified}}scaleOptions(){let{min:e,max:t}=this.rangeIndices(),n=this.lineBox();return{scale:(this.options.vertical?n.height():n.width())/(t-e||1)*(this.options.reverse?-1:1),box:n,min:e,max:t}}arrangeLabels(){super.arrangeLabels(),this.hideOutOfRangeLabels()}hideOutOfRangeLabels(){let{box:e,labels:t}=this;if(t.length>0){let n=this.options.vertical?`y`:`x`,r=e[n+1],i=e[n+2],a=t[0],o=rf(t);(a.box[n+1]>i||a.box[n+2]<r)&&(a.options.visible=!1),(o.box[n+1]>i||o.box[n+2]<r)&&(o.options.visible=!1)}}getMajorTickPositions(){return this.getTicks().majorTicks}getMinorTickPositions(){return this.getTicks().minorTicks}getLabelsTickPositions(){return this.getTicks().labelTicks}tickIndices(e){let{min:t,max:n}=this.rangeIndices(),r=Math.ceil(n),i=Math.floor(t),a=[];for(;i<=r;)a.push(i),i+=e;return a}getTickPositions(e){let{vertical:t,reverse:n}=this.options,{scale:r,box:i,min:a}=this.scaleOptions(),o=i[(t?`y`:`x`)+(n?2:1)],s=this.tickIndices(e),c=[];for(let e=0;e<s.length;e++)c.push(o+K(r*(s[e]-a),3));return c}getTicks(){let e=this.options,t=this._ticks,n=this.rangeIndices(),r=this.lineBox(),i=r.getHash()+n.min+`,`+n.max+e.reverse+e.justified;if(t._hash!==i){let n=e.minorTicks.visible||e.minorGridLines.visible;t._hash=i,t.labelTicks=this.getTickPositions(1),t.majorTicks=this.filterOutOfRangePositions(t.labelTicks,r),t.minorTicks=n?this.filterOutOfRangePositions(this.getTickPositions(.5),r):[]}return t}filterOutOfRangePositions(e,t){if(!e.length)return e;let n=this.options.vertical?`y`:`x`,r=e=>t[n+1]<=e&&e<=t[n+2],i=e.length-1,a=0;for(;!r(e[a])&&a<=i;)a++;let o=i;for(;!r(e[o])&&o>=0;)o--;return e.slice(a,o+1)}lineInfo(){let{vertical:e,reverse:t}=this.options,n=this.lineBox(),r=e?n.height():n.width(),i=e?`y`:`x`,a=t?-1:1,o=i+(a===1?1:2).toString();return{axis:i,axisOrigin:o,axisDir:a,lineBox:n,lineSize:r,lineStart:n[o]}}lineDir(){let{reverse:e}=this.options;return e?-1:1}getSlot(e,t,n){let{reverse:r,justified:i}=this.options,{scale:a,box:o,min:s}=this.scaleOptions(),{axis:c,lineStart:l}=this.lineInfo(),u=o.clone(),d=t===void 0,f=q(e,0),p=q(t,f);p=Math.max(p-1,f),p=Math.max(f,p);let m=l+(f-s)*a,h=l+(p+1-s)*a;return d&&i&&(h=m),n&&(m=G(m,o[c+1],o[c+2]),h=G(h,o[c+1],o[c+2])),u[c+1]=r?h:m,u[c+2]=r?m:h,u}limitSlot(e){let t=this.options.vertical?`y`:`x`,n=this.lineBox(),r=e.clone();return r[t+1]=G(e[t+1],n[t+1],n[t+2]),r[t+2]=G(e[t+2],n[t+1],n[t+2]),r}slot(e,t,n){let r=Math.floor(this.options.min||0),i=e,a=t;return typeof i==`string`?i=this.categoryIndex(i):B(i)&&(i-=r),typeof a==`string`?a=this.categoryIndex(a):B(a)&&(a-=r),super.slot(i,a,n)}pointCategoryIndex(e){let{reverse:t,justified:n,vertical:r}=this.options,i=r?`y`:`x`,{scale:a,box:o,min:s,max:c}=this.scaleOptions(),l=t?c:s,u=o[i+1],d=o[i+2],f=e[i];if(f<u||f>d)return null;let p=l+(f-u)/a,m=p%1;return n?p=Math.round(p):m===0&&p>0&&p--,Math.floor(p)}getCategory(e){let t=this.pointCategoryIndex(e);return t===null?null:this.options.categories[t]}categoryIndex(e){return this.totalIndex(e)-Math.floor(this.options.min||0)}categoryAt(e,t){let n=this.options;return(t?n.srcCategories:n.categories)[e]}categoriesCount(){return(this.options.categories||[]).length}translateRange(e){let t=this.options,n=this.lineBox(),r=t.vertical?n.height():n.width(),i=t.categories.length,a=r/i,o=K(e/a,10);return{min:o,max:i+o}}scaleRange(e,t){let n=Math.abs(this.pointOffset(t)),r=this.limitedRangeIndices(),i=r.max-r.min,a=this.scaleToDelta(e,i),o=n*a,s=(1-n)*a,c=r.min+o,l=r.max-s;return l-c<Qm&&(l=c+Qm),{min:c,max:l}}zoomRange(e,t){let{min:n,max:r}=this.totalRange(),i=this.scaleRange(e,t);return{min:G(i.min,n,r),max:G(i.max,n,r)}}labelsCount(){let e=this.labelsRange();return e.max-e.min}labelsRange(){let e=this.options,{justified:t,labels:n}=e,{min:r,max:i}=this.limitedRangeIndices(!0),a=Math.floor(r);t?(r=Math.ceil(r),i=Math.floor(i)):(r=Math.floor(r),i=Math.ceil(i));let o;return o=r>n.skip?n.skip+n.step*Math.ceil((r-n.skip)/n.step):n.skip,{min:o-a,max:(e.categories.length?i+ +!!t:0)-a}}createAxisLabel(e,t,n){let r=this.options,i=r.dataItems?r.dataItems[e]:null,a=q(r.categories[e],``);return n.dataItem=i,new lm(a,this.axisLabelText(a,t,n),e,i,t)}shouldRenderNote(e){let t=this.limitedRangeIndices();return Math.floor(t.min)<=e&&e<=Math.ceil(t.max)}noteSlot(e){let t=this.options,n=e-Math.floor(t.min||0);return this.getSlot(n)}arrangeNotes(){super.arrangeNotes(),this.hideOutOfRangeNotes()}hideOutOfRangeNotes(){let{notes:e,box:t}=this;if(e&&e.length){let n=this.options.vertical?`y`:`x`,r=t[n+1],i=t[n+2];for(let t=0;t<e.length;t++){let a=e[t];a.box&&(i<a.box[n+1]||a.box[n+2]<r)&&a.hide()}}}pan(e){let t=this.limitedRangeIndices(!0),{scale:n}=this.scaleOptions(),r=K(e/n,10),i=this.totalRange(),a=t.min+r,o=t.max+r;return this.limitRange(a,o,0,i.max,r)}pointsRange(e,t){let{reverse:n,vertical:r}=this.options,i=r?`y`:`x`,a=this.limitedRangeIndices(!0),{scale:o,box:s}=this.scaleOptions(),c=s[i+(n?2:1)],l=e[i]-c,u=t[i]-c,d=a.min+l/o,f=a.min+u/o,p=Math.min(d,f),m=Math.max(d,f);if(m-p>=.01)return{min:p,max:m}}valueRange(){return this.range()}totalIndex(e){let t=this.options;return this._categoriesMap?this._categoriesMap.get(e):$m(e,t.srcCategories)}currentRangeIndices(){let e=this.options,t=0;B(e.min)&&(t=Math.floor(e.min));let n;return n=B(e.max)?e.justified?Math.floor(e.max):Math.ceil(e.max)-1:this.totalCount()-1,{min:t,max:n}}limitedRangeIndices(e){let t=this.options,n=B(t.min)?t.min:0,r;if(r=B(t.max)?t.max:B(t.min)?n+t.categories.length:this.totalRange().max||1,e){let e=this.totalRange();n=G(n,0,e.max),r=G(r,0,e.max)}return{min:n,max:r}}totalRangeIndices(){return{min:0,max:this.totalRange().max||1}}indexCategories(){if(!this._categoriesMap){let e=this._categoriesMap=new Vd,t=this.options.srcCategories;for(let n=0;n<t.length;n++)e.set(t[n],n)}}totalCount(){return Math.max(this.options.srcCategories.length,this._seriesMax||0)}};J(eh,{type:`category`,vertical:!1,majorGridLines:{visible:!1,width:1,color:y},labels:{zIndex:1},justified:!1,_deferLabels:!0});let th={milliseconds:`HH:mm:ss.fff`,seconds:`HH:mm:ss`,minutes:`HH:mm`,hours:`HH:mm`,days:`M/d`,weeks:`M/d`,months:`MMM 'yy`,years:`yyyy`},nh=[`milliseconds`,xm,Sm,Cm,wm,Tm,Em,Dm];function rh(e,t){t&&(e._range=void 0);let n=e._range;return n||(n=e._range=gf(e),n.min=Fm(n.min),n.max=Fm(n.max)),n}var ih=class{constructor(e){this.options=e}displayIndices(){return{min:0,max:1}}displayRange(){return{}}total(){return{}}valueRange(){return{}}valueIndex(){return-1}values(){return[]}totalIndex(){return-1}valuesCount(){return 0}totalCount(){return 0}dateAt(){return null}},ah=class{constructor(e,t,n){this.options=n,n.baseUnitStep=n.baseUnitStep||1;let{roundToBaseUnit:r,justified:i}=n;this.start=zm(e,0,n.baseUnit,n.weekStartDay);let a=this.roundToTotalStep(t),o=!i&&Gm(t,a)&&!n.justifyEnd;this.end=this.roundToTotalStep(t,!i,+!!o);let s=n.min||e;this.valueStart=this.roundToTotalStep(s),this.displayStart=r?this.valueStart:s;let c=n.max;if(!c)this.valueEnd=a,this.displayEnd=r||o?this.end:t;else{let e=!i&&Gm(c,this.roundToTotalStep(c))?-1:0;this.valueEnd=this.roundToTotalStep(c,!1,e),this.displayEnd=r?this.roundToTotalStep(c,!i):n.max}this.valueEnd<this.valueStart&&(this.valueEnd=this.valueStart),this.displayEnd<=this.displayStart&&(this.displayEnd=this.roundToTotalStep(this.displayStart,!1,1))}displayRange(){return{min:this.displayStart,max:this.displayEnd}}displayIndices(){if(!this._indices){let{baseUnit:e,baseUnitStep:t}=this.options,n=qm(this.displayStart,this.valueStart,e,t),r=qm(this.displayEnd,this.valueStart,e,t);this._indices={min:n,max:r}}return this._indices}total(){return{min:this.start,max:this.end}}totalCount(){return this.totalIndex(this.end)+ +!!this.options.justified}valueRange(){return{min:this.valueStart,max:this.valueEnd}}valueIndex(e){let t=this.options;return Math.floor(qm(e,this.valueStart,t.baseUnit,t.baseUnitStep))}totalIndex(e){let t=this.options;return Math.floor(qm(e,this.start,t.baseUnit,t.baseUnitStep))}dateIndex(e){let t=this.options;return qm(e,this.valueStart,t.baseUnit,t.baseUnitStep)}valuesCount(){return this.valueIndex(this.valueEnd)+1}values(){let e=this._values;if(!e){let t=this.options,n=this.valueRange();this._values=e=[];for(let r=n.min;r<=n.max;)e.push(r),r=zm(r,t.baseUnitStep,t.baseUnit,t.weekStartDay)}return e}dateAt(e,t){let n=this.options;return zm(t?this.start:this.valueStart,n.baseUnitStep*e,n.baseUnit,n.weekStartDay)}roundToTotalStep(e,t,n){let{baseUnit:r,baseUnitStep:i,weekStartDay:a}=this.options,o=this.start,s=qm(e,o,r,i),c=t?Math.ceil(s):Math.floor(s);return n&&(c+=n),zm(o,c*i,r,a)}};function oh(e,t,n){let r=rh(e.categories),i=(e.max||r.max)-(e.min||r.min),{autoBaseUnitSteps:a,maxDateGroups:o}=e,s=e.baseUnit===`fit`,c=t?nh.indexOf(t):0,l=s?nh[c++]:e.baseUnit,u=i/Mm[l],d=u,f,p,m;for(;!p||u>=o;){f||=a[l].slice(0);do m=f.shift();while(m&&t===l&&m<n);if(m)p=m,u=d/p;else if(l===rf(nh)){p=Math.ceil(d/o);break}else if(s)l=nh[c++]||rf(nh),d=i/Mm[l],f=null;else{u>o&&(p=Math.ceil(d/o));break}}e.baseUnitStep=p,e.baseUnit=l}function sh(e){let t=e.categories,n=W(t)?t.length:0,r=E,i,a;for(let e=0;e<n;e++){let n=t[e];if(n&&i){let e=Math.abs(Nm(n,i));e!==0&&(r=Math.min(r,e),a=r>=31536e6?Dm:r>=26784e5-864e5*3?Em:r>=6048e5?Tm:r>=864e5?wm:r>=36e5?Cm:r>=6e4?Sm:xm)}i=n}e.baseUnit=a||`days`}function ch(e){let t=(e.baseUnit||``).toLowerCase();return t!==`fit`&&!U(t,nh)&&sh(e),(t===`fit`||e.baseUnitStep===`auto`)&&oh(e),e}var lh=class e extends eh{clone(){let t=new e(Object.assign({},this.options),this.chartService);return t.createLabels(),t}categoriesHash(){let e=this.dataRange.total().min;return this.options.baseUnit+this.options.baseUnitStep+e}initUserOptions(e){return e}initFields(){super.initFields();let e=this.chartService,t=e.intl,n=this.options,r=n.categories||[];if(r._parsed||(r=Xm(t,r),r._parsed=!0),n=V({roundToBaseUnit:!0},n,{categories:r,min:Ym(t,n.min),max:Ym(t,n.max),weekStartDay:Zm(n,t)}),e.panning&&e.isPannable(n.vertical?`y`:`x`)&&(n.roundToBaseUnit=!1),n.userSetBaseUnit=n.userSetBaseUnit||n.baseUnit,n.userSetBaseUnitStep=n.userSetBaseUnitStep||n.baseUnitStep,this.options=n,n.srcCategories=r,r.length>0){let e=rh(r,!0),t=n.maxDivisions,i=ch(n),a=n._forecast;if(a&&(a.before>0&&(e.min=zm(e.min,-a.before,i.baseUnit,i.weekStartDay)),a.after>0&&(e.max=zm(e.max,a.after,i.baseUnit,i.weekStartDay))),this.dataRange=new ah(e.min,e.max,i),t){let r=this.dataRange.displayRange(),i=Object.assign({},n,{justified:!0,roundToBaseUnit:!1,baseUnit:`fit`,min:r.min,max:r.max,maxDateGroups:t}),a=this.dataRange.options;oh(i,a.baseUnit,a.baseUnitStep),this.divisionRange=new ah(e.min,e.max,i)}else this.divisionRange=this.dataRange}else n.baseUnit=n.baseUnit||`days`,this.dataRange=this.divisionRange=new ih(n);this.rangeLabels=[]}tickIndices(e){let{dataRange:t,divisionRange:n}=this,r=n.valuesCount();if(!this.options.maxDivisions||!r)return super.tickIndices(e);let i=[],a=n.values(),o=0;this.options.justified||(a=a.concat(n.dateAt(r)),o=.5);for(let n=0;n<a.length;n++)if(i.push(t.dateIndex(a[n])+o),e!==1&&n>=1){let t=i.length-1;i.splice(n,0,i[t-1]+(i[t]-i[t-1])*e)}return i}shouldRenderNote(e){let t=this.range(),n=this.options.categories||[];return Hm(e,t.min)>=0&&Hm(e,t.max)<=0&&n.length}parseNoteValue(e){return Ym(this.chartService.intl,e)}noteSlot(e){return this.getSlot(e)}translateRange(e){let t=this.options,{baseUnit:n,weekStartDay:r,vertical:i}=t,a=this.lineBox(),o=i?a.height():a.width(),s=this.range(),c=o/(s.max-s.min),l=K(e/c,10);if(s.min&&s.max){let e=Pm(t.min||s.min,l),i=Pm(t.max||s.max,l);s={min:zm(e,0,n,r),max:zm(i,0,n,r)}}return s}labelsRange(){return{min:this.options.labels.skip,max:this.divisionRange.valuesCount()}}pan(e){if(this.isEmpty())return null;let t=this.options,n=this.lineBox(),r=t.vertical?n.height():n.width(),{min:i,max:a}=this.dataRange.displayRange(),o=this.dataRange.total(),s=r/(a-i),c=K(e/s,10)*(t.reverse?-1:1),l=Pm(i,c),u=Pm(a,c),d=this.limitRange(Wm(l),Wm(u),Wm(o.min),Wm(o.max),c);if(d)return d.min=Fm(d.min),d.max=Fm(d.max),d.baseUnit=t.baseUnit,d.baseUnitStep=t.baseUnitStep||1,d.userSetBaseUnit=t.userSetBaseUnit,d.userSetBaseUnitStep=t.userSetBaseUnitStep,d}pointsRange(e,t){if(this.isEmpty())return null;let n=super.pointsRange(e,t),r=this.dataRange.displayRange(),i=this.dataRange.displayIndices(),a=Um(r.max,r.min)/(i.max-i.min),o=this.options;return{min:Pm(r.min,n.min*a),max:Pm(r.min,n.max*a),baseUnit:o.userSetBaseUnit||o.baseUnit,baseUnitStep:o.userSetBaseUnitStep||o.baseUnitStep}}scaleRange(e,t){if(this.isEmpty())return{};let n=this.options,r=n.userSetBaseUnit===`fit`,i=this.dataRange.total(),{min:a,max:o}=this.dataRange.displayRange(),s=Math.abs(this.pointOffset(t)),c=o-a,l=this.scaleToDelta(e,c),u=Math.round(s*l),d=Math.round((1-s)*l),{baseUnit:f}=this.dataRange.options,p=new Date(a.getTime()+u),m=new Date(o.getTime()-d);if(r){let{autoBaseUnitSteps:e,maxDateGroups:t}=n,r=rf(e[f])*t*Mm[f],s=Um(o,a),c=Um(m,p),l=nh.indexOf(f),u,d;if(c<Mm[f]&&f!==`milliseconds`)f=nh[l-1],u=rf(e[f]),d=(s-(t-1)*u*Mm[f])/2,p=Pm(a,d),m=Pm(o,-d);else if(c>r&&f!==`years`){let t=0;do{l++,f=nh[l],t=0,d=2*Mm[f];do u=e[f][t],t++;while(t<e[f].length&&d*u<s)}while(f!==`years`&&d*u<s);d=(d*u-s)/2,d>0&&(p=Pm(a,-d),m=Pm(o,d),p=Pm(p,G(m,i.min,i.max)-m),m=Pm(m,G(p,i.min,i.max)-p))}}if(p&&m&&Um(m,p)>0)return{min:p,max:m,baseUnit:n.userSetBaseUnit||n.baseUnit,baseUnitStep:n.userSetBaseUnitStep||n.baseUnitStep}}zoomRange(e,t){let n=this.dataRange.total(),r=this.scaleRange(e,t);if(r){if(r.min<n.min){if(e<0&&this.options.justified){let e=Um(n.min,r.min);r.max=Pm(r.max,e)}r.min=n.min}r.max>n.max&&(r.max=n.max)}return r}range(){return this.dataRange.displayRange()}createLabels(){super.createLabels(),this.createRangeLabels()}clearLabels(){super.clearLabels(),this.rangeLabels=[]}arrangeLabels(){this.arrangeRangeLabels(),super.arrangeLabels()}arrangeRangeLabels(){let{options:e,rangeLabels:t}=this;if(t.length===0)return;let n=this.lineBox(),r=e.vertical,i=e.rangeLabels.mirror||e.labels.mirror,a=t[0];if(a){let e=r?n.y1-a.box.height()/2:n.x1;this.positionLabel(a,i,e)}let o=t[1];if(o){let e=r?n.y2-o.box.height()/2:n.x2;this.positionLabel(o,i,e)}}autoRotateLabels(){super.autoRotateLabels(),this.autoRotateRangeLabels()}hideOutOfRangeLabels(){super.hideOutOfRangeLabels(),this.hideOverlappingLabels()}hideOverlappingLabels(){let{rangeLabels:e,labels:t}=this;if(e.length===0)return;function n(e,t){return!t.options.visible||t.box.overlaps(e.box)?(t.options.visible=!1,!0):!1}let r=e[0];if(r&&r.options.visible)for(let e=0;e<t.length&&n(r,t[e]);e++);let i=e[1];if(i&&i.options.visible)for(let e=t.length-1;e>0&&n(i,t[e]);--e);}contentBox(){let e=super.contentBox(),t=this.rangeLabels;for(let n=0;n<t.length;n++){let r=t[n];r.options.visible&&e.wrap(r.box)}return e}createAxisLabel(e,t,n={}){let r=this.options,i=r.dataItems&&!r.maxDivisions?r.dataItems[e]:null,a=this.divisionRange.dateAt(e),o=t.dateFormats[this.divisionRange.options.baseUnit];t.format=t.format||o,n.dataItem=i;let s=this.axisLabelText(a,t,n);if(s)return new lm(a,s,e,i,t)}createRangeLabels(){let{displayStart:e,displayEnd:t}=this.divisionRange,n=this.options,r=Object.assign({},n.labels,n.rangeLabels,{align:x,zIndex:n.zIndex});if(r.visible!==!0)return;this.normalizeLabelRotation(r),r.alignRotation=x,r.rotation===`auto`&&(r.rotation=0,n.autoRotateRangeLabels=!0);let i=r.dateFormats[this.divisionRange.options.baseUnit];r.format=r.format||i;let a=(e,t,n)=>{if(n){let i=new lm(t,n,e,null,r);this.append(i),this.rangeLabels.push(i)}};a(0,e,this.axisLabelText(e,r,{index:0,count:2})),a(1,t,this.axisLabelText(t,r,{index:1,count:2}))}autoRotateRangeLabels(){let e=this.rangeLabels;if(!this.options.autoRotateRangeLabels||this.options.vertical||e.length!==2)return;let t=(e,t,n)=>{let r=Math.abs(t[n+1]-t[n])*2,i=this.autoRotateLabelAngle(e.box,r);i!==0&&(e.options.rotation=i,e.reflow(new Z))},n=this.getMajorTickPositions();t(e[0],n,0),t(e[1],n,n.length-2)}categoryIndex(e){return this.dataRange.valueIndex(e)}slot(e,t,n){let r=this.dataRange,i=e,a=t;i instanceof Date&&(i=r.dateIndex(i)),a instanceof Date&&(a=r.dateIndex(a));let o=this.getSlot(i,a,n);if(o)return o.toRect()}getSlot(e,t,n){let r=e,i=t;return typeof r==`object`&&(r=this.categoryIndex(r)),typeof i==`object`&&(i=this.categoryIndex(i)),super.getSlot(r,i,n)}valueRange(){let e=this.options,t=rh(e.srcCategories);return{min:Fm(t.min),max:Fm(t.max)}}categoryAt(e,t){return this.dataRange.dateAt(e,t)}categoriesCount(){return this.dataRange.valuesCount()}rangeIndices(){return this.dataRange.displayIndices()}labelsBetweenTicks(){return!this.divisionRange.options.justified}prepareUserOptions(){this.isEmpty()||(this.options.categories=this.dataRange.values())}getCategory(e){let t=this.pointCategoryIndex(e);return t===null?null:this.dataRange.dateAt(t)}totalIndex(e){return this.dataRange.totalIndex(e)}currentRangeIndices(){let e=this.dataRange.valueRange();return{min:this.dataRange.totalIndex(e.min),max:this.dataRange.totalIndex(e.max)}}totalRange(){return this.dataRange.total()}totalRangeIndices(){let e=this.dataRange.total();return{min:this.dataRange.totalIndex(e.min),max:this.dataRange.totalIndex(e.max)}}totalCount(){return this.dataRange.totalCount()}isEmpty(){return!this.options.srcCategories.length}roundedRange(){if(this.options.roundToBaseUnit!==!1||this.isEmpty())return this.range();let e=this.options,t=rh(e.srcCategories);return new ah(t.min,t.max,Object.assign({},e,{justified:!1,roundToBaseUnit:!0,justifyEnd:!1})).displayRange()}};J(lh,{type:ee,labels:{dateFormats:th},rangeLabels:{visible:!1},autoBaseUnitSteps:{milliseconds:[1,10,100],seconds:[1,2,5,15,30],minutes:[1,2,5,15,30],hours:[1,2,3],days:[1,2,3],weeks:[1,2],months:[1,2,3,6],years:[1,2,3,5,10,25,50]},maxDateGroups:10});function uh(e,t,n){if(!e&&!t)return 0;let r;if(e>=0&&t>=0){let i=e===t?0:e,a=(t-i)/t;if(n===!1||!n&&a>.2)return 0;r=Math.max(0,i-(t-i)/2)}else r=e;return r}function dh(e,t,n){if(!e&&!t)return 1;let r;if(e<=0&&t<=0){let i=e===t?0:t,a=Math.abs((i-e)/i);if(n===!1||!n&&a>.2)return 0;r=Math.min(0,i-(e-i)/2)}else r=t;return r}function fh(e,t){return Np(Math.floor(e/t)*t)}function ph(e,t){return Np(Math.ceil(e/t)*t)}function mh(e){return Math.max(Math.min(e,3e5),-3e5)}let hh=10**-9;var gh=class e extends bm{constructor(e,t,n,r){super(Object.assign({},n,{seriesMin:e,seriesMax:t}),r)}initUserOptions(e){let t=_h(e.seriesMin,e.seriesMax,e);return this.totalOptions=vh(t,e),bh(t,e)}initFields(){this.totalMin=this.totalOptions.min,this.totalMax=this.totalOptions.max,this.totalMajorUnit=this.totalOptions.majorUnit,this.seriesMin=this.options.seriesMin,this.seriesMax=this.options.seriesMax}clone(){return new e(this.seriesMin,this.seriesMax,Object.assign({},this.options),this.chartService)}startValue(){return 0}range(){let e=this.options;return{min:e.min,max:e.max}}getDivisions(e){if(e===0)return 1;let t=this.options,n=t.max-t.min;return Math.floor(K(n/e,3))+1}getTickPositions(e,t){let n=this.options,{axisDir:r,axisOrigin:i,lineBox:a,lineSize:o}=this.lineInfo(),s=e*(o/(n.max-n.min)),c=this.getDivisions(e),l=[],u=a[i],d=0;t&&(d=t/e);for(let e=0;e<c;e++)e%d!==0&&l.push(K(u,3)),u+=s*r;return l}getMajorTickPositions(){return this.getTickPositions(this.options.majorUnit)}getMinorTickPositions(){return this.getTickPositions(this.options.minorUnit)}getSlot(e,t,n=!1){let r=this.options,{axis:i,axisDir:a,lineBox:o,lineSize:s,lineStart:c}=this.lineInfo(),l=a*(s/(r.max-r.min)),u=q(e,t||0),d=q(t,e||0);n&&(u=G(u,r.min,r.max),d=G(d,r.min,r.max));let f=Math.min(u,d)-r.min,p=Math.max(u,d)-r.min,m=new Z(o.x1,o.y1,o.x1,o.y1);return m[i+1]=mh(c+l*(a>0?f:p)),m[i+2]=mh(c+l*(a>0?p:f)),m}getValue(e){let t=this.options,n=Number(t.max),r=Number(t.min),i=this.pointOffset(e),a=i*(n-r);return i<0||i>1?null:Np(r+a)}translateRange(e){let{vertical:t,reverse:n,max:r,min:i}=this.options,{lineSize:a}=this.lineInfo(),o=e/(a/(r-i));return(t||n)&&!(t&&n)&&(o=-o),{min:Np(i+o),max:Np(r+o),offset:o}}labelsCount(){return this.getDivisions(this.options.majorUnit)}createAxisLabel(e,t,n){let r=this.options,i=Np(r.min+e*r.majorUnit);return new lm(i,this.axisLabelText(i,t,n),e,null,t)}shouldRenderNote(e){let t=this.range();return t.min<=e&&e<=t.max}pan(e){let t=this.translateRange(e);return this.limitRange(t.min,t.max,this.totalMin,this.totalMax,t.offset)}pointsRange(e,t){let n=this.getValue(e),r=this.getValue(t),i=Math.min(n,r),a=Math.max(n,r);if(a-i>hh)return{min:i,max:a}}scaleRange(e,t){let n=Math.abs(this.pointOffset(t)),r=this.options.max-this.options.min,i=this.scaleToDelta(e,r),a=n*i,o=(1-n)*i;return{min:Np(this.options.min+a),max:Np(this.options.max-o)}}zoomRange(e,t){let{totalMin:n,totalMax:r}=this,i=this.scaleRange(e,t);return{min:G(i.min,n,r),max:G(i.max,n,r),narrowRange:!1}}};function _h(e,t,n){let r=n.narrowRange,i=uh(e,t,r),a=dh(e,t,r),o=Pp(i,a),s={majorUnit:o};return n.roundToMajorUnit!==!1&&(i<0&&xh(i,o,1/3)&&(i-=o),a>0&&xh(a,o,1/3)&&(a+=o)),s.min=fh(i,o),s.max=ph(a,o),s}function vh(e,t){return{min:W(t.min)?Math.min(e.min,t.min):e.min,max:W(t.max)?Math.max(e.max,t.max):e.max,majorUnit:e.majorUnit}}function yh(e,t){for(let n=0;n<t.length;n++){let r=t[n];e[r]===null&&(e[r]=void 0)}}function bh(e,t){let n=t,r,i;if(t){yh(t,[`min`,`max`]),r=W(t.min),i=W(t.max);let a=r||i;a&&t.min===t.max&&(t.min>0?t.min=0:t.max=1),t.majorUnit?(e.min=fh(e.min,t.majorUnit),e.max=ph(e.max,t.majorUnit)):a&&(n=V(e,t),e.majorUnit=Pp(n.min,n.max))}e.minorUnit=(n.majorUnit||e.majorUnit)/5;let a=V(e,n);return a.min>=a.max&&(r&&!i?a.max=a.min+a.majorUnit:!r&&i&&(a.min=a.max-a.majorUnit)),a}function xh(e,t,n){let r=K(Math.abs(e%t),10),i=t*(1-n);return r===0||r>i}J(gh,{type:`numeric`,min:0,max:1,vertical:!0,majorGridLines:{visible:!0,width:1,color:y},labels:{format:`#.####################`},zIndex:1});let Sh=1e3;var Ch=class e extends bm{constructor(e,t,n,r){let i=Fm(e),a=Fm(t),o=r.intl,s=n||{};s=V(s||{},{min:Ym(o,s.min),max:Ym(o,s.max),axisCrossingValue:Xm(o,s.axisCrossingValues||s.axisCrossingValue),weekStartDay:Zm(s,o)}),s=Th(i,a,s),super(s,r),this.intlService=o,this.seriesMin=i,this.seriesMax=a;let c=s.weekStartDay||0;this.totalMin=Wm(Bm(Wm(i)-1,s.baseUnit,c)),this.totalMax=Wm(Vm(Wm(a)+1,s.baseUnit,c))}clone(){return new e(this.seriesMin,this.seriesMax,Object.assign({},this.options),this.chartService)}range(){let e=this.options;return{min:e.min,max:e.max}}getDivisions(e){let t=this.options;return Math.floor(Jm(t.min,t.max,t.baseUnit)/e+1)}getTickPositions(e){let t=this.options,{axisDir:n,lineSize:r,lineStart:i}=this.lineInfo(),a=this.getDivisions(e),o=r/Um(t.max,t.min),s=t.weekStartDay||0,c=[i];for(let r=1;r<a;r++){let a=i+Um(zm(t.min,r*e,t.baseUnit,s),t.min)*o*n;c.push(K(a,3))}return c}getMajorTickPositions(){return this.getTickPositions(this.options.majorUnit)}getMinorTickPositions(){return this.getTickPositions(this.options.minorUnit)}getSlot(e,t,n){return gh.prototype.getSlot.call(this,Ym(this.intlService,e),Ym(this.intlService,t),n)}getValue(e){let t=gh.prototype.getValue.call(this,e);return t===null?null:Fm(t)}labelsCount(){return this.getDivisions(this.options.majorUnit)}createAxisLabel(e,t,n){let r=this.options,i=e*r.majorUnit,a=r.weekStartDay||0,o=r.min;i>0&&(o=zm(o,i,r.baseUnit,a));let s=t.dateFormats[r.baseUnit];t.format=t.format||s;let c=this.axisLabelText(o,t,n);return new lm(o,c,e,null,t)}translateRange(e){let t=this.options,n=this.lineBox(),{vertical:r,reverse:i}=t,a=r?n.height():n.width(),o=this.range(),s=a/Um(o.max,o.min),c=K(e/s,10);return(r||i)&&!(r&&i)&&(c=-c),{min:Pm(t.min,c),max:Pm(t.max,c),offset:c}}shouldRenderNote(e){let t=this.range();return Hm(e,t.min)>=0&&Hm(e,t.max)<=0}pan(e){let t=this.translateRange(e,!0),n=this.limitRange(Wm(t.min),Wm(t.max),this.totalMin,this.totalMax,t.offset);if(n)return{min:Fm(n.min),max:Fm(n.max)}}pointsRange(e,t){let n=this.getValue(e),r=this.getValue(t),i=Math.min(n,r),a=Math.max(n,r);return{min:Fm(i),max:Fm(a)}}scaleRange(e,t){let n=Math.abs(this.pointOffset(t)),r=this.options.max-this.options.min,i=this.scaleToDelta(e,r),a=n*i,o=(1-n)*i,s=Fm(Wm(this.options.min)+a),c=Fm(Wm(this.options.max)-o);return c-s<Sh&&(c=Fm(Wm(s)+Sh)),{min:s,max:c}}zoomRange(e,t){let n=this.scaleRange(e,t);return{min:Fm(G(Wm(n.min),this.totalMin,this.totalMax)),max:Fm(G(Wm(n.max),this.totalMin,this.totalMax))}}};function wh(e){let t=Cm;return e>=31536e6?t=Dm:e>=26784e5?t=Em:e>=6048e5?t=Tm:e>=864e5&&(t=wm),t}function Th(e,t,n){let r=n.min||e,i=n.max||t,a=n.baseUnit||(i&&r?wh(Nm(i,r)):`hours`),o=Mm[a],s=n.weekStartDay||0,c=Bm(Wm(r)-1,a,s)||Fm(i),l=Vm(Wm(i)+1,a,s),u=(n.majorUnit?n.majorUnit:void 0)||ph(Pp(c.getTime(),l.getTime()),o)/o,d=Jm(c,l,a),f=ph(d,u)-d,p=Math.floor(f/2),m=f-p;return n.baseUnit||delete n.baseUnit,n.baseUnit=n.baseUnit||a,n.min=n.min||zm(c,-p,a,s),n.max=n.max||zm(l,m,a,s),n.minorUnit=n.minorUnit||u/5,n.majorUnit=u,n}J(Ch,{type:ee,majorGridLines:{visible:!0,width:1,color:y},labels:{dateFormats:th}});let Eh=1e-6;var Dh=class e extends bm{constructor(e,t,n,r){let i=V({majorUnit:10,min:e,max:t},n),a=i.majorUnit,o=Ah(t,a),s=kh(e,t,i),c=Oh(s,o,i,n);i.max=c.max,i.min=c.min,i.minorUnit=n.minorUnit||K(a-1,10),super(i,r),this.totalMin=W(n.min)?Math.min(s,n.min):s,this.totalMax=W(n.max)?Math.max(o,n.max):o,this.logMin=K(Mh(c.min,a),10),this.logMax=K(Mh(c.max,a),10),this.seriesMin=e,this.seriesMax=t,this.createLabels()}clone(){return new e(this.seriesMin,this.seriesMax,Object.assign({},this.options),this.chartService)}startValue(){return this.options.min}getSlot(e,t,n){let{options:r,logMin:i,logMax:a}=this,{majorUnit:o,min:s,max:c}=r,{axis:l,axisDir:u,lineBox:d,lineSize:f,lineStart:p}=this.lineInfo(),m=u*(f/(a-i)),h=q(e,t||1),g=q(t,e||1);if(h<=0||g<=0)return null;n&&(h=G(h,s,c),g=G(g,s,c)),h=Mh(h,o),g=Mh(g,o);let _=Math.min(h,g)-i,v=Math.max(h,g)-i,y=new Z(d.x1,d.y1,d.x1,d.y1);return y[l+1]=mh(p+m*(u>0?_:v)),y[l+2]=mh(p+m*(u>0?v:_)),y}getValue(e){let{options:t,logMin:n,logMax:r}=this,{majorUnit:i}=t,{axis:a,axisDir:o,lineStart:s,lineSize:c}=this.lineInfo(),l=(r-n)/c,u=o*(e[a]-s),d=u*l;if(u<0||u>c)return null;let f=n+d;return K(i**+f,10)}range(){let e=this.options;return{min:e.min,max:e.max}}translateRange(e){let{options:t,logMin:n,logMax:r}=this,{reverse:i,vertical:a,majorUnit:o}=t,s=this.lineBox(),c=(a?s.height():s.width())/(r-n),l=K(e/c,10);return(a||i)&&!(a&&i)&&(l=-l),{min:o**+(n+l),max:o**+(r+l),offset:l}}labelsCount(){let e=Math.floor(this.logMax);return Math.floor(e-this.logMin)+1}getMajorTickPositions(){let e=[];return this.traverseMajorTicksPositions(t=>{e.push(t)},{step:1,skip:0}),e}createTicks(e){let t=this.options,{majorTicks:n,minorTicks:r,vertical:i}=t,a=t.labels.mirror,o=this.lineBox(),s=[],c={vertical:i};function l(t,n){c.tickX=a?o.x2:o.x2-n.size,c.tickY=a?o.y1-n.size:o.y1,c.position=t,e.append(vm(c,n))}return n.visible&&this.traverseMajorTicksPositions(l,n),r.visible&&this.traverseMinorTicksPositions(l,r),s}createGridLines(e){let{minorGridLines:t,majorGridLines:n,vertical:r}=this.options,i=e.lineBox(),a={lineStart:i[r?`x1`:`y1`],lineEnd:i[r?`x2`:`y2`],vertical:r},o=[],s=this.gridLinesVisual();function c(e,t){U(e,o)||(a.position=e,s.append(ym(a,t)),o.push(e))}return n.visible&&this.traverseMajorTicksPositions(c,n),t.visible&&this.traverseMinorTicksPositions(c,t),s.children}traverseMajorTicksPositions(e,t){let{lineStart:n,step:r}=this.lineInfo(),{logMin:i,logMax:a}=this;for(let o=Math.ceil(i)+t.skip;o<=a;o+=t.step)e(K(n+r*(o-i),10),t)}traverseMinorTicksPositions(e,t){let{min:n,max:r,minorUnit:i,majorUnit:a}=this.options,{lineStart:o,step:s}=this.lineInfo(),{logMin:c,logMax:l}=this,u=Math.floor(c);for(let d=u;d<l;d++){let l=this._minorIntervalOptions(d);for(let u=t.skip;u<i;u+=t.step){let i=l.value+u*l.minorStep;if(i>r)break;i>=n&&e(K(o+s*(Mh(i,a)-c),10),t)}}}createAxisLabel(e,t,n){let r=Math.ceil(this.logMin+e),i=this.options.majorUnit**+r;return new lm(i,this.axisLabelText(i,t,n),e,null,t)}shouldRenderNote(e){let t=this.range();return t.min<=e&&e<=t.max}pan(e){let t=this.translateRange(e);return this.limitRange(t.min,t.max,this.totalMin,this.totalMax,t.offset)}pointsRange(e,t){let n=this.getValue(e),r=this.getValue(t);return{min:Math.min(n,r),max:Math.max(n,r)}}scaleRange(e,t){let{majorUnit:n}=this.options,r=Mh(this.options.min,n),i=Mh(this.options.max,n),a=Math.abs(this.pointOffset(t)),o=i-r,s=this.scaleToDelta(e,o),c=n**+(r+a*s),l=n**(i-(1-a)*s);return l-c<Eh&&(l=c+Eh),{min:c,max:l}}zoomRange(e,t){let n=this.scaleRange(e,t),{totalMin:r,totalMax:i}=this;return{min:G(n.min,r,i),max:G(n.max,r,i)}}_minorIntervalOptions(e){let{minorUnit:t,majorUnit:n}=this.options,r=n**+e;return{value:r,minorStep:(n**+(e+1)-r)/t}}lineInfo(){let e=super.lineInfo();return e.step=e.axisDir*(e.lineSize/(this.logMax-this.logMin)),e}};function Oh(e,t,n,r){let{min:i,max:a}=n;return W(n.axisCrossingValue)&&n.axisCrossingValue<=0&&jh(),W(r.max)?r.max<=0&&jh():a=t,W(r.min)?r.min<=0&&jh():i=e,{min:i,max:a}}function kh(e,t,n){let r=n.majorUnit,i=e;return e<=0?i=t<=1?r**-2:1:n.narrowRange||(i=r**+Math.floor(Mh(e,r))),i}function Ah(e,t){let n=K(Mh(e,t),10)%1,r;return r=e<=0?t:n!==0&&(n<.3||n>.9)?t**+(Mh(e,t)+.2):t**+Math.ceil(Mh(e,t)),r}function jh(){throw Error(`Non positive values cannot be used for a logarithmic axis`)}function Mh(e,t){return Math.log(e)/Math.log(t)}J(Dh,{type:`log`,majorUnit:10,minorUnit:1,axisCrossingValue:1,vertical:!0,majorGridLines:{visible:!0,width:1,color:y},zIndex:1,_deferLabels:!0});let Nh={createGridLines:function(e){let t=this.options,n=Math.abs(this.box.center().y-e.lineBox().y1),r=[],i=!1,a,o;return t.majorGridLines.visible&&(a=this.majorGridLineAngles(e),i=!0,r=this.renderMajorGridLines(a,n,t.majorGridLines)),t.minorGridLines.visible&&(o=this.minorGridLineAngles(e,i),Yd(r,this.renderMinorGridLines(o,n,t.minorGridLines,e,i))),r},renderMajorGridLines:function(e,t,n){return this.renderGridLines(e,t,n)},renderMinorGridLines:function(e,t,n,r,i){let a=this.radiusCallback&&this.radiusCallback(t,r,i);return this.renderGridLines(e,t,n,a)},renderGridLines:function(e,t,n,r){let i={stroke:{width:n.width,color:n.color,dashType:n.dashType}},a=this.box.center(),o=new An([a.x,a.y],t),s=this.gridLinesVisual();for(let t=0;t<e.length;t++){let n=new N(i);r&&(o.radius=r(e[t])),n.moveTo(o.center).lineTo(o.pointAt(e[t]+180)),s.append(n)}return s.children},gridLineAngles:function(e,t,n,r,i){let a=this.intervals(t,n,r,i),o=e.options,s=o.visible&&(o.line||{}).visible!==!1;return Kd(a,e=>{let t=this.intervalAngle(e);if(!s||t!==90)return t})}};var Ph=class extends eh{range(){return{min:0,max:this.options.categories.length}}reflow(e){this.box=e,this.reflowLabels()}lineBox(){return this.box}reflowLabels(){let{labels:e,options:{labels:t}}=this,n=t.skip||0,r=t.step||1,i=new Z;for(let t=0;t<e.length;t++){e[t].reflow(i);let a=e[t].box;e[t].reflow(this.getSlot(n+t*r).adjacentBox(0,a.width(),a.height()))}}intervals(e,t,n,r=!1){let i=this.options,a=i.categories.length/e||1,o=360/a,s=t||0,c=n||1,l=[],u=0;for(let e=s;e<a;e+=c)u=i.reverse?360-e*o:e*o,u=K(u,3)%360,r&&U(u,r)||l.push(u);return l}majorIntervals(){return this.intervals(1)}minorIntervals(){return this.intervals(.5)}intervalAngle(e){return(360+e+this.options.startAngle)%360}majorAngles(){return Kd(this.majorIntervals(),e=>this.intervalAngle(e))}createLine(){return[]}majorGridLineAngles(e){let t=this.options.majorGridLines;return this.gridLineAngles(e,1,t.skip,t.step)}minorGridLineAngles(e,t){let{minorGridLines:n,majorGridLines:r}=this.options,i=t?this.intervals(1,r.skip,r.step):null;return this.gridLineAngles(e,.5,n.skip,n.step,i)}radiusCallback(e,t,n){if(t.options.type!==`arc`){let t=of(360/(this.options.categories.length*2)),r=Math.cos(t)*e,i=this.majorAngles();return function(t){return!n&&U(t,i)?e:r}}}createPlotBands(){let e=this.options.plotBands||[],t=this._plotbandGroup=new P({zIndex:-1});for(let n=0;n<e.length;n++){let r=e[n],i=this.plotBandSlot(r),a=this.getSlot(r.from),o=r.from-Math.floor(r.from);i.startAngle+=o*a.angle;let s=Math.ceil(r.to)-r.to;i.angle-=(s+o)*a.angle;let c=Rp.current.createRing(i,{fill:{color:r.color,opacity:r.opacity},stroke:{opacity:r.opacity}});t.append(c)}this.appendVisual(t)}plotBandSlot(e){return this.getSlot(e.from,e.to-1)}getSlot(e,t){let n=this.options,r=n.justified,i=this.box,a=this.majorAngles(),o=a.length,s=360/o,c=e;n.reverse&&!r&&(c=(c+1)%o),c=G(Math.floor(c),0,o-1);let l=a[c];r&&(l-=s/2,l<0&&(l+=360));let u=s*(G(Math.ceil(t||c),c,o-1)-c+1);return new Ip(i.center(),0,i.height()/2,l,u)}slot(e,t){let n=this.getSlot(e,t),r=n.startAngle+180,i=r+n.angle;return new Un([n.center.x,n.center.y],{startAngle:r,endAngle:i,radiusX:n.radius,radiusY:n.radius})}pointCategoryIndex(e){let t=this.options.categories.length,n=null;for(let r=0;r<t;r++)if(this.getSlot(r).containsPoint(e)){n=r;break}return n}};J(Ph,{startAngle:90,labels:{margin:H(10)},majorGridLines:{visible:!0},justified:!0}),V(Ph.prototype,Nh);var Fh=class extends bm{constructor(e,t){super(e,t);let n=this.options;n.minorUnit=n.minorUnit||n.majorUnit/2}getDivisions(e){return gh.prototype.getDivisions.call(this,e)-1}reflow(e){this.box=e,this.reflowLabels()}reflowLabels(){let{options:e,labels:t,options:{labels:n}}=this,r=n.skip||0,i=n.step||1,a=new Z,o=this.intervals(e.majorUnit,r,i);for(let e=0;e<t.length;e++){t[e].reflow(a);let n=t[e].box;t[e].reflow(this.getSlot(o[e]).adjacentBox(0,n.width(),n.height()))}}lineBox(){return this.box}intervals(e,t,n,r=!1){let i=this.options.min,a=this.getDivisions(e),o=[],s=t||0,c=n||1;for(let t=s;t<a;t+=c){let n=(360+i+t*e)%360;r&&U(n,r)||o.push(n)}return o}majorIntervals(){return this.intervals(this.options.majorUnit)}minorIntervals(){return this.intervals(this.options.minorUnit)}intervalAngle(e){return(540-e-this.options.startAngle)%360}createLine(){return[]}majorGridLineAngles(e){let t=this.options.majorGridLines;return this.gridLineAngles(e,this.options.majorUnit,t.skip,t.step)}minorGridLineAngles(e,t){let n=this.options,{minorGridLines:r,majorGridLines:i}=n,a=t?this.intervals(n.majorUnit,i.skip,i.step):null;return this.gridLineAngles(e,n.minorUnit,r.skip,r.step,a)}plotBandSlot(e){return this.getSlot(e.from,e.to)}getSlot(e,t){let{options:n,box:r}=this,i=n.startAngle,a=G(e,n.min,n.max),o=G(t||a,a,n.max);if(n.reverse&&(a*=-1,o*=-1),a=(540-a-i)%360,o=(540-o-i)%360,o<a){let e=a;a=o,o=e}return new Ip(r.center(),0,r.height()/2,a,o-a)}slot(e,t=e){let n=this.options,r=360-n.startAngle,i=this.getSlot(e,t),a=Math.min(e,t),o=Math.max(e,t),s,c;return n.reverse?(s=a,c=o):(s=360-o,c=360-a),s=(s+r)%360,c=(c+r)%360,new Un([i.center.x,i.center.y],{startAngle:s,endAngle:c,radiusX:i.radius,radiusY:i.radius})}getValue(e){let t=this.options,n=this.box.center(),r=e.x-n.x,i=e.y-n.y,a=Math.round(Zd(Math.atan2(i,r))),o=t.startAngle;return t.reverse||(a*=-1,o*=-1),(a+o+360)%360}valueRange(){return{min:0,max:Math.PI*2}}};J(Fh,{type:`polar`,startAngle:0,reverse:!1,majorUnit:60,min:0,max:360,labels:{margin:H(10)},majorGridLines:{color:y,visible:!0,width:1},minorGridLines:{color:`#aaa`}}),V(Fh.prototype,Nh,{createPlotBands:Ph.prototype.createPlotBands,majorAngles:Ph.prototype.majorAngles,range:gh.prototype.range,labelsCount:gh.prototype.labelsCount,createAxisLabel:gh.prototype.createAxisLabel});let Ih={options:{majorGridLines:{visible:!0}},createPlotBands:function(){let{majorGridLines:{type:e},plotBands:t=[]}=this.options,n=this.plotArea.polarAxis,r=n.majorAngles(),i=n.box.center(),a=this._plotbandGroup=new P({zIndex:-1});for(let n=0;n<t.length;n++){let o=t[n],s={fill:{color:o.color,opacity:o.opacity},stroke:{opacity:o.opacity}},c=this.getSlot(o.from,o.to,!0),l=new Ip(i,i.y-c.y2,i.y-c.y1,0,360),u;u=e===`arc`?Rp.current.createRing(l,s):N.fromPoints(this.plotBandPoints(l,r),s).close(),a.append(u)}this.appendVisual(a)},plotBandPoints:function(e,t){let n=[],r=[],i=[e.center.x,e.center.y],a=new An(i,e.innerRadius),o=new An(i,e.radius);for(let e=0;e<t.length;e++)n.push(a.pointAt(t[e]+180)),r.push(o.pointAt(t[e]+180));return n.reverse(),n.push(n[0]),r.push(r[0]),r.concat(n)},createGridLines:function(e){let t=this.options,n=this.radarMajorGridLinePositions(),r=e.majorAngles(),i=e.box.center(),a=[];if(t.majorGridLines.visible&&(a=this.renderGridLines(i,n,r,t.majorGridLines)),t.minorGridLines.visible){let e=this.radarMinorGridLinePositions();Yd(a,this.renderGridLines(i,e,r,t.minorGridLines))}return a},renderGridLines:function(e,t,n,r){let i={stroke:{width:r.width,color:r.color,dashType:r.dashType}},{skip:a=0,step:o=0}=r,s=this.gridLinesVisual();for(let c=a;c<t.length;c+=o){let a=e.y-t[c];if(a>0){let t=new An([e.x,e.y],a);if(r.type===`arc`)s.append(new Ln(t,i));else{let e=new N(i);for(let r=0;r<n.length;r++)e.lineTo(t.pointAt(n[r]+180));e.close(),s.append(e)}}}return s.children},getValue:function(e){let t=this.lineBox(),n=this.plotArea.polarAxis,r=n.majorAngles(),i=n.box.center(),a=e.distanceTo(i),o=a;if(this.options.majorGridLines.type!==`arc`&&r.length>1){let t=e.x-i.x,n=e.y-i.y,s=(Zd(Math.atan2(n,t))+540)%360;r.sort(function(e,t){return Lh(e,s)-Lh(t,s)});let c=Lh(r[0],r[1])/2,l=Lh(s,r[0]),u=90-c,d=180-l-u;o=a*(Math.sin(of(d))/Math.sin(of(u)))}return this.axisType().prototype.getValue.call(this,new X(t.x1,t.y2-o))}};function Lh(e,t){return 180-Math.abs(Math.abs(e-t)-180)}var Rh=class extends gh{radarMajorGridLinePositions(){return this.getTickPositions(this.options.majorUnit)}radarMinorGridLinePositions(){let e=this.options,t=0;return e.majorGridLines.visible&&(t=e.majorUnit),this.getTickPositions(e.minorUnit,t)}axisType(){return gh}};V(Rh.prototype,Ih);var zh=class extends Dh{radarMajorGridLinePositions(){let e=[];return this.traverseMajorTicksPositions(function(t){e.push(t)},this.options.majorGridLines),e}radarMinorGridLinePositions(){let e=[];return this.traverseMinorTicksPositions(function(t){e.push(t)},this.options.minorGridLines),e}axisType(){return Dh}};V(zh.prototype,Ih);let Bh=.333;var Vh=class{constructor(e){this.closed=e}process(e){let t=e.slice(0),n=[],r=this.closed,i=t.length;if(i>2&&(this.removeDuplicates(0,t),i=t.length),i<2||i===2&&t[0].equals(t[1]))return n;let a=t[0],o=t[1],s=t[2];for(n.push(new dr(a));a.equals(t[i-1]);)r=!0,t.pop(),i--;if(i===2){let e=this.tangent(a,o,`x`,`y`);return rf(n).controlOut(this.firstControlPoint(e,a,o,`x`,`y`)),n.push(new dr(o,this.secondControlPoint(e,a,o,`x`,`y`))),n}let c,l;if(r){a=t[i-1],o=t[0],s=t[1];let e=this.controlPoints(a,o,s);c=e[1],l=e[0]}else{let e=this.tangent(a,o,`x`,`y`);c=this.firstControlPoint(e,a,o,`x`,`y`)}let u=c;for(let e=0;e<=i-3;e++)if(this.removeDuplicates(e,t),i=t.length,e+3<=i){a=t[e],o=t[e+1],s=t[e+2];let r=this.controlPoints(a,o,s);rf(n).controlOut(u),u=r[1];let i=r[0];n.push(new dr(o,i))}if(r){a=t[i-2],o=t[i-1],s=t[0];let e=this.controlPoints(a,o,s);rf(n).controlOut(u),n.push(new dr(o,e[0])),rf(n).controlOut(e[1]),n.push(new dr(s,l))}else{let e=this.tangent(o,s,`x`,`y`);rf(n).controlOut(u),n.push(new dr(s,this.secondControlPoint(e,o,s,`x`,`y`)))}return n}removeDuplicates(e,t){for(;t[e+1]&&(t[e].equals(t[e+1])||t[e+1].equals(t[e+2]));)t.splice(e+1,1)}invertAxis(e,t,n){let r=!1;if(e.x===t.x)r=!0;else if(t.x===n.x)(t.y<n.y&&e.y<=t.y||n.y<t.y&&t.y<=e.y)&&(r=!0);else{let i=this.lineFunction(e,t),a=this.calculateFunction(i,n.x);!(e.y<=t.y&&n.y<=a)&&!(t.y<=e.y&&n.y>=a)&&(r=!0)}return r}isLine(e,t,n){let r=this.lineFunction(e,t),i=this.calculateFunction(r,n.x);return e.x===t.x&&t.x===n.x||K(i,1)===K(n.y,1)}lineFunction(e,t){let n=(t.y-e.y)/(t.x-e.x);return[e.y-n*e.x,n]}controlPoints(e,t,n){let r=`x`,i=`y`,a=!1,o;if(this.isLine(e,t,n))o=this.tangent(e,t,`x`,`y`);else{let s={x:this.isMonotonicByField(e,t,n,`x`),y:this.isMonotonicByField(e,t,n,`y`)};if(s.x&&s.y){let a=t[r]-e[r],s=n[r]-t[r],c=(t[i]-e[i])/a,l=(n[i]-t[i])/s;o=3*(a+s)/((2*s+a)/c+(s+2*a)/l)}else if(this.invertAxis(e,t,n)&&(r=`y`,i=`x`),s[r])o=0;else{let s;s=n[i]<e[i]&&e[i]<=t[i]||e[i]<n[i]&&t[i]<=e[i]?Hh((n[i]-e[i])*(t[r]-e[r])):-Hh((n[r]-e[r])*(t[i]-e[i])),o=.01*s,a=!0}}let s=this.secondControlPoint(o,e,t,r,i);if(a){let e=r;r=i,i=e}return[s,this.firstControlPoint(o,t,n,r,i)]}tangent(e,t,n,r){let i=t[n]-e[n],a=t[r]-e[r],o;return o=i===0?0:a/i,o}isMonotonicByField(e,t,n,r){return n[r]>t[r]&&t[r]>e[r]||n[r]<t[r]&&t[r]<e[r]}firstControlPoint(e,t,n,r,i){let a=t[r],o=(n[r]-a)*Bh;return this.point(a+o,t[i]+o*e,r,i)}secondControlPoint(e,t,n,r,i){let a=t[r],o=n[r],s=(o-a)*Bh;return this.point(o-s,n[i]-s*e,r,i)}point(e,t,n,r){let i=new A;return i[n]=e,i[r]=t,i}calculateFunction(e,t){let n=e.length,r=0;for(let i=0;i<n;i++)r+=t**+i*e[i];return r}};function Hh(e){return e<=0?-1:1}var Uh=l({ABOVE:()=>rg,AREA:()=>cg,BAR:()=>`bar`,BELOW:()=>ig,BORDER_BRIGHTNESS:()=>qh,BOTTOM:()=>ag,BOX_PLOT:()=>lg,BUBBLE:()=>ug,BULLET:()=>dg,CANDLESTICK:()=>fg,CATEGORY:()=>x_,CHART_POINT_CLASSNAME:()=>g_,CHART_POINT_ROLE:()=>h_,CHART_POINT_ROLE_DESCRIPTION:()=>__,COLUMN:()=>pg,DONUT:()=>mg,DRAG:()=>n_,DRAG_END:()=>r_,DRAG_START:()=>i_,DRILLDOWN:()=>D_,DRILLDOWN_FIELD:()=>O_,EQUALLY_SPACED_SERIES:()=>Rg,ERROR_HIGH_FIELD:()=>Xh,ERROR_LOW_FIELD:()=>Yh,FADEIN:()=>Gh,FUNNEL:()=>hg,GAP:()=>`gap`,GLASS:()=>Kh,HEATMAP:()=>_g,HIDE_TOOLTIP:()=>p_,HORIZONTAL_WATERFALL:()=>vg,INITIAL_ANIMATION_DURATION:()=>600,INSIDE_BASE:()=>C_,INSIDE_END:()=>S_,INTERPOLATE:()=>ng,LEGEND_ITEM_ARIA_ROLE_DESCRIPTION:()=>b_,LEGEND_ITEM_CLASSNAME:()=>y_,LEGEND_ITEM_CLICK:()=>Kg,LEGEND_ITEM_HOVER:()=>qg,LEGEND_ITEM_LEAVE:()=>Jg,LEGEND_ITEM_ROLE:()=>v_,LINE:()=>yg,LINE_MARKER_SIZE:()=>8,LOGARITHMIC:()=>`log`,MIN_MOVING_AVERAGE_PERIOD:()=>2,MOUSEWHEEL:()=>T_,MOUSEWHEEL_DELAY:()=>150,MOUSEWHEEL_ZOOM_RATE:()=>E_,OHLC:()=>bg,OUTSIDE_END:()=>w_,PANE_RENDER:()=>m_,PATTERN_FIELD:()=>k_,PIE:()=>`pie`,PLOT_AREA_CLICK:()=>$g,PLOT_AREA_HOVER:()=>e_,PLOT_AREA_LEAVE:()=>t_,POLAR_AREA:()=>xg,POLAR_LINE:()=>Sg,POLAR_SCATTER:()=>Cg,PYRAMID:()=>gg,RADAR_AREA:()=>wg,RADAR_COLUMN:()=>Tg,RADAR_LINE:()=>Eg,RANGE_AREA:()=>Dg,RANGE_BAR:()=>Og,RANGE_COLUMN:()=>kg,RENDER:()=>d_,SCATTER:()=>Ag,SCATTER_LINE:()=>jg,SELECT:()=>l_,SELECT_END:()=>u_,SELECT_START:()=>c_,SERIES_CLICK:()=>Yg,SERIES_HOVER:()=>Xg,SERIES_LEAVE:()=>Qg,SERIES_OVER:()=>Zg,SHOW_TOOLTIP:()=>f_,SMOOTH:()=>og,START_SCALE:()=>Jh,STEP:()=>sg,TOOLTIP_OFFSET:()=>5,TRENDLINE_EXPONENTIAL:()=>zg,TRENDLINE_LINEAR:()=>Bg,TRENDLINE_LOGARITHMIC:()=>Vg,TRENDLINE_MOVING_AVERAGE:()=>Hg,TRENDLINE_POLYNOMIAL:()=>Ug,TRENDLINE_POWER:()=>Wg,TRENDLINE_SERIES:()=>Gg,VERTICAL_AREA:()=>Mg,VERTICAL_BOX_PLOT:()=>Ng,VERTICAL_BULLET:()=>Pg,VERTICAL_LINE:()=>Fg,VERTICAL_RANGE_AREA:()=>Ig,WATERFALL:()=>Lg,X_ERROR_HIGH_FIELD:()=>Qh,X_ERROR_LOW_FIELD:()=>Zh,Y_ERROR_HIGH_FIELD:()=>eg,Y_ERROR_LOW_FIELD:()=>$h,ZERO:()=>tg,ZOOM:()=>o_,ZOOM_END:()=>s_,ZOOM_START:()=>a_});let Wh=Oe.browser||{},Gh=`fadeIn`,Kh=`glass`,qh=.8,Jh=Wh.msie?.001:0,Yh=`errorLow`,Xh=`errorHigh`,Zh=`xErrorLow`,Qh=`xErrorHigh`,$h=`yErrorLow`,eg=`yErrorHigh`,tg=`zero`,ng=`interpolate`,rg=`above`,ig=`below`,ag=`bottom`,og=`smooth`,sg=`step`,cg=`area`,lg=`boxPlot`,ug=`bubble`,dg=`bullet`,fg=`candlestick`,pg=`column`,mg=`donut`,hg=`funnel`,gg=`pyramid`,_g=`heatmap`,vg=`horizontalWaterfall`,yg=`line`,bg=`ohlc`,xg=`polarArea`,Sg=`polarLine`,Cg=`polarScatter`,wg=`radarArea`,Tg=`radarColumn`,Eg=`radarLine`,Dg=`rangeArea`,Og=`rangeBar`,kg=`rangeColumn`,Ag=`scatter`,jg=`scatterLine`,Mg=`verticalArea`,Ng=`verticalBoxPlot`,Pg=`verticalBullet`,Fg=`verticalLine`,Ig=`verticalRangeArea`,Lg=`waterfall`,Rg=[`bar`,pg,bg,fg,lg,Ng,dg,kg,Og,Lg,vg],zg=`exponentialTrendline`,Bg=`linearTrendline`,Vg=`logarithmicTrendline`,Hg=`movingAverageTrendline`,Ug=`polynomialTrendline`,Wg=`powerTrendline`,Gg=[zg,Bg,Vg,Hg,Ug,Wg],Kg=`legendItemClick`,qg=`legendItemHover`,Jg=`legendItemLeave`,Yg=`seriesClick`,Xg=`seriesHover`,Zg=`seriesOver`,Qg=`seriesLeave`,$g=`plotAreaClick`,e_=`plotAreaHover`,t_=`plotAreaLeave`,n_=`drag`,r_=`dragEnd`,i_=`dragStart`,a_=`zoomStart`,o_=`zoom`,s_=`zoomEnd`,c_=`selectStart`,l_=`select`,u_=`selectEnd`,d_=`render`,f_=`showTooltip`,p_=`hideTooltip`,m_=`paneRender`,h_=`graphics-symbol`,g_=`k-chart-point`,__=`Point`,v_=`checkbox`,y_=`k-chart-legend-item`,b_=`Legend item`,x_=`category`,S_=`insideEnd`,C_=`insideBase`,w_=`outsideEnd`,T_=`wheel`,E_=.3,D_=`drilldown`,O_=`drilldown`,k_=`pattern`;var A_=class extends Q{constructor(e,t,n,r,i,a){super(a),this.low=e,this.high=t,this.isVertical=n,this.chart=r,this.series=i}reflow(e){let t=this.options.endCaps,n=this.isVertical,r=this.getAxis().getSlot(this.low,this.high),i=e.center(),a=this.getCapsWidth(e,n),o=n?i.x:i.y,s=o-a,c=o+a,l;n?(l=[new X(i.x,r.y1),new X(i.x,r.y2)],t&&l.push(new X(s,r.y1),new X(c,r.y1),new X(s,r.y2),new X(c,r.y2)),this.box=new Z(s,r.y1,c,r.y2)):(l=[new X(r.x1,i.y),new X(r.x2,i.y)],t&&l.push(new X(r.x1,s),new X(r.x1,c),new X(r.x2,s),new X(r.x2,c)),this.box=new Z(r.x1,s,r.x2,c)),this.linePoints=l}getCapsWidth(e,t){let n=t?e.width():e.height();return Math.min(Math.floor(n/2),4)||4}createVisual(){let e=this.options,t=e.visual;t?this.visual=t({low:this.low,high:this.high,rect:this.box.toRect(),sender:this.getSender(),options:{endCaps:e.endCaps,color:e.color,line:e.line},createVisual:()=>{this.createDefaultVisual();let e=this.visual;return delete this.visual,e}}):this.createDefaultVisual()}createDefaultVisual(){let{options:e,linePoints:t}=this,n={stroke:{color:e.color,width:e.line.width,dashType:e.line.dashType}};super.createVisual();for(let e=0;e<t.length;e+=2){let r=new N(n).moveTo(t[e].x,t[e].y).lineTo(t[e+1].x,t[e+1].y);_d(r),this.visual.append(r)}}};J(A_,{animation:{type:Gh,delay:600},endCaps:!0,line:{width:2},zIndex:1});var j_=class extends A_{getAxis(){return this.chart.seriesValueAxis(this.series)}};function M_(e){for(let t=0;t<e.length;t++)if(W(e[t].zIndex))return!0}function N_(e,t){t!==null&&e.push(t)}function P_(e){return Dp(e)===e.length}function F_(e,t,n){let r=t.visible;if(W(r))return r;let i=e.pointVisibility;if(i)return i[n]}function I_(e){let t=e.data,n=[],r=0,i=0;for(let a=0;a<t.length;a++){let t=Y.current.bindPoint(e,a),o=t.valueFields.value;yd(o)&&(o=parseFloat(o)),B(o)?(t.visible=F_(e,t.fields,a)!==!1,t.value=Math.abs(o),n.push(t),t.visible&&(r+=t.value),o!==0&&i++):n.push(null)}return{total:r,points:n,count:i}}function L_(e){let t=e.length,n=0;for(let r=0;r<t;r++)n=Math.max(n,e[r].data.length);return n}function R_(e,t){return e&&t?e.toLowerCase()===t.toLowerCase():e===t}function z_(e,t,n={},r=!1){let i=n.defaults=n.defaults||{},a=n.depth=n.depth||0,o=!1;if(n.excluded=n.excluded||[],a>5)return null;for(let a in e)if(!U(a,n.excluded)&&jf(e,a)){let s=e[a];wd(s)?(o=!0,r||(e[a]=q(s(t),i[a]))):Dd(s)&&(r||(n.defaults=i[a]),n.depth++,o=z_(s,t,n,r)||o,n.depth--)}return o}function B_(e,t){let n=[],r=[].concat(t);for(let t=0;t<e.length;t++){let i=e[t];U(i.type,r)&&n.push(i)}return n}let V_=new WeakMap;function H_(e,t,n){if(typeof t!=`object`||!t)return Ym(n,e);let r=V_.get(t);return r||(r=Ym(n,e),V_.set(t,r)),r}function U_(e){let t=e.overlay;return t&&t.gradient&&t.gradient!==`none`}function W_(e){return W(e)&&e!==null}function G_(e,t){let n=e.type,r=t instanceof Date;return!n&&r||R_(n,`date`)}function K_(e){return e.length===1?e[0]:e}let q_=/area/i;function J_(e){return e.missingValues?e.missingValues:q_.test(e.type)||e.stack?tg:ng}function Y_(e,t){let n=Y.current.bindPoint(e,null,t).valueFields;for(let e in n)if(bd(n[e]))return!0}function X_({start:e,dir:t,min:n,max:r,getter:i,hasItem:a,series:o}){let s,c,l=e;do l+=t,a(l)&&(c=i(l),s=Y_(o,c.item));while(n<=l&&l<=r&&!s);if(s)return c}function Z_(e,t,n,r,i){let{min:a,max:o}=t,s=a>0&&a<n,c=o+1<n;if(s||c){let t=J_(e),l,u;if(t!==`interpolate`)s&&(l=r(a-1)),c&&(u=r(o+1));else{let t,d;s&&(t=r(a-1),d=Y_(e,t.item),l=d?t:X_({start:a,dir:-1,min:0,max:n-1,getter:r,hasItem:i,series:e})),c&&(t=r(o+1),d=Y_(e,t.item),u=d?t:X_({start:o,dir:1,min:0,max:n-1,getter:r,hasItem:i,series:e}))}l&&(e._outOfRangeMinPoint=l),u&&(e._outOfRangeMaxPoint=u)}}function Q_(e,t){return t.forEach(t=>{let n=t&&t.options,r=t&&(t.box||t.wrapperBox);n&&r&&n.noclip!==!1&&n.visible!==!1&&!n.visual&&e.wrap(r)}),e}var $_=class extends Q{constructor(e,t){super(t),this.plotArea=e,this.chartService=e.chartService,this.categoryAxis=e.seriesCategoryAxis(t.series[0]),this.valueAxisRanges={},this.points=[],this.categoryPoints=[],this.seriesPoints=[],this.seriesOptions=[],this._evalSeries=[],this.render()}render(){this.traverseDataPoints(this.addValue.bind(this))}pointOptions(e,t){let n=this.seriesOptions[t];if(!n){let r=this.pointType().prototype.defaults;this.seriesOptions[t]=n=V({},r,{vertical:!this.options.invertAxes},e)}return n}plotValue(e){if(!e)return 0;if(this.options.isStacked100&&B(e.value)){let t=e.categoryIx,n=this.categoryPoints[t],r=[],i=0;for(let t=0;t<n.length;t++){let a=n[t];if(a){let t=e.series.stack,n=a.series.stack;if(t&&n&&t.group!==n.group)continue;B(a.value)&&(i+=Math.abs(a.value),r.push(Math.abs(a.value)))}}if(i>0)return e.value/i}return e.value}plotRange(e,t=0){let n=this.categoryPoints[e.categoryIx];if(this.options.isStacked){let r=this.plotValue(e),i=r>=0,a=t,o=!1,s=e.series.stack===void 0?this.options.defaultStack:e.series.stack,c=e=>e===!0||typeof e==`object`&&!e.group;if(s)for(let l=0;l<n.length;l++){let u=n[l];if(e===u)break;let d=u.series.stack===void 0?this.options.defaultStack:u.series.stack;if(!d||typeof s==`string`&&s!==d||c(s)&&!c(d)||s.group&&s.group!==d.group)continue;let f=this.plotValue(u);(f>=0&&i||f<0&&!i)&&(t===0||f!==0)&&(a+=f,r+=f,o=!0,this.options.isStacked100&&(r=Math.min(r,1)))}return o&&(a-=t),[a,r]}let r=e.series,i=this.seriesValueAxis(r),a=this.categoryAxisCrossingValue(i);return[a,bd(e.value)?e.value:a]}stackLimits(e,t){let n=E,r=D;for(let i=0;i<this.categoryPoints.length;i++){let a=this.categoryPoints[i];if(a)for(let i=0;i<a.length;i++){let o=a[i];if(o&&(o.series.stack===t||o.series.axis===e)){let e=this.plotRange(o,0)[1];e!==void 0&&isFinite(e)&&(r=Math.max(r,e),n=Math.min(n,e))}}}return{min:n,max:r}}updateStackRange(){let{isStacked:e,series:t}=this.options,n={};if(e)for(let e=0;e<t.length;e++){let r=t[e],i=r.axis,a=i+r.stack,o=n[a];if(!o){o=this.stackLimits(i,r.stack);let e=this.errorTotals;e&&(e.negative.length&&(o.min=Math.min(o.min,gf(e.negative).min)),e.positive.length&&(o.max=Math.max(o.max,gf(e.positive).max))),o.min!==E||o.max!==D?n[a]=o:o=null}o&&(this.valueAxisRanges[i]=o)}}addErrorBar(e,t,n){let{value:r,series:i,seriesIx:a}=e,o=e.options.errorBars,s=t.fields[Yh],c=t.fields[Xh],l;B(s)&&B(c)?l={low:s,high:c}:o&&o.value!==void 0&&(this.seriesErrorRanges=this.seriesErrorRanges||[],this.seriesErrorRanges[a]=this.seriesErrorRanges[a]||new Mp(o.value,i,`value`),l=this.seriesErrorRanges[a].getErrorRange(r,o.value)),l&&(e.low=l.low,e.high=l.high,this.addPointErrorBar(e,n))}addPointErrorBar(e,t){let n=!this.options.invertAxes,r=e.options.errorBars,{series:i,low:a,high:o}=e;if(this.options.isStacked){let n=this.stackedErrorRange(e,t);a=n.low,o=n.high}else{let e={categoryIx:t,series:i};this.updateRange({value:a},e),this.updateRange({value:o},e)}let s=new j_(a,o,n,this,i,r);e.errorBars=[s],e.append(s)}stackedErrorRange(e,t){let n=this.plotRange(e,0)[1]-e.value,r=e.low+n,i=e.high+n;return this.errorTotals=this.errorTotals||{positive:[],negative:[]},r<0&&(this.errorTotals.negative[t]=Math.min(this.errorTotals.negative[t]||0,r)),i>0&&(this.errorTotals.positive[t]=Math.max(this.errorTotals.positive[t]||0,i)),{low:r,high:i}}addValue(e,t){let{categoryIx:n,series:r,seriesIx:i}=t,a=this.categoryPoints[n];a||(this.categoryPoints[n]=a=[]);let o=this.seriesPoints[i];o||(this.seriesPoints[i]=o=[]);let s=this.createPoint(e,t);s&&(Object.assign(s,t),s.owner=this,s.noteText=e.fields.noteText,s.dataItem===void 0&&(s.dataItem=r.data[n]),this.addErrorBar(s,e,n)),this.points.push(s),o.push(s),a.push(s),this.updateRange(e.valueFields,t)}evalPointOptions(e,t,n){let r=n.categoryIx,i=n.category,a=n.series,o=n.seriesIx,s={defaults:a._defaults,excluded:[`data`,`aggregate`,`_events`,`tooltip`,`content`,`template`,`visual`,`toggle`,`_outOfRangeMinPoint`,`_outOfRangeMaxPoint`,`drilldownSeriesFactory`,`ariaTemplate`,`ariaContent`]},c=this._evalSeries[o];c===void 0&&(this._evalSeries[o]=c=z_(e,{},s,!0));let l=e;return c&&(l=V({},l),z_(l,{value:t,category:i,index:r,series:a,dataItem:a.data[r]},s)),l}updateRange(e,t){let n=t.series.axis,r=e.value,i=this.valueAxisRanges[n];isFinite(r)&&r!==null&&(i=this.valueAxisRanges[n]=i||{min:E,max:D},i.min=Math.min(i.min,r),i.max=Math.max(i.max,r))}seriesValueAxis(e){let t=this.plotArea,n=e.axis,r=n?t.namedValueAxes[n]:t.valueAxis;if(!r)throw Error(`Unable to locate value axis with name `+n);return r}reflow(e){let t=this.categorySlots=[],n=this.points,r=this.categoryAxis,i=0;this.traverseDataPoints((e,a)=>{let{categoryIx:o,series:s}=a,c=this.seriesValueAxis(s),l=n[i++],u=t[o];if(u||(t[o]=u=this.categorySlot(r,o,c)),l){let e=this.plotRange(l,c.startValue()),t=this.valueSlot(c,e);if(t){let n=this.pointSlot(u,t);l.aboveAxis=this.aboveAxis(l,c),l.stackValue=e[1],this.options.isStacked100&&(l.percentage=this.plotValue(l)),this.reflowPoint(l,n)}else l.visible=!1}}),this.reflowCategories(t),!this.options.clip&&this.options.limitPoints&&this.points.length&&this.limitPoints(),this.box=e}valueSlot(e,t){return e.getSlot(t[0],t[1],!this.options.clip)}limitPoints(){let e=this.categoryPoints,t=e[0].concat(rf(e));for(let e=0;e<t.length;e++)t[e]&&this.limitPoint(t[e])}limitPoint(e){let t=this.categoryAxis.limitSlot(e.box);t.equals(e.box)||e.reflow(t)}aboveAxis(e,t){let n=this.categoryAxisCrossingValue(t),r=e.value;return t.options.reverse?r<n:r>=n}categoryAxisCrossingValue(e){let t=this.categoryAxis,n=e.options;return[].concat(n.axisCrossingValues||n.axisCrossingValue)[t.axisIndex||0]||0}reflowPoint(e,t){e.reflow(t)}reflowCategories(){}pointSlot(e,t){let n=this.options.invertAxes,r=n?t:e,i=n?e:t;return new Z(r.x1,i.y1,r.x2,i.y2)}categorySlot(e,t){return e.getSlot(t)}traverseDataPoints(e){let t=this.options.series,n=L_(t),r=t.length;for(let n=0;n<r;n++)this._outOfRangeCallback(t[n],`_outOfRangeMinPoint`,n,e);for(let i=0;i<n;i++){let a=this.categoryAxis.categoryAt(i);for(let o=0;o<r;o++){let r=t[o];e(this.plotArea.bindPoint(r,i),{category:a,categoryIx:i,categoriesCount:n,series:r,seriesIx:o})}}for(let n=0;n<r;n++)this._outOfRangeCallback(t[n],`_outOfRangeMaxPoint`,n,e)}_outOfRangeCallback(e,t,n,r){let i=e[t];if(i){let t=i.categoryIx;r(this.plotArea.bindPoint(e,t,i.item),{category:i.category,categoryIx:t,series:e,seriesIx:n,dataItem:i.item})}}formatPointValue(e,t){return e.value===null?``:this.chartService.format.auto(t,e.value)}pointValue(e){return e.valueFields.value}};J($_,{series:[],invertAxes:!1,isStacked:!1,clip:!0,limitPoints:!0});let ev={click:function(e,t){return e.trigger(Yg,this.eventArgs(t))},hover:function(e,t){return e.trigger(Xg,this.eventArgs(t))},over:function(e,t){return e.trigger(Zg,this.eventArgs(t))},out:function(e,t){return e.trigger(Qg,this.eventArgs(t))},eventArgs:function(e){return{value:this.value,percentage:this.percentage,stackValue:this.stackValue,category:this.category,series:this.series,dataItem:this.dataItem,runningTotal:this.runningTotal,total:this.total,element:tf(e),originalEvent:e,point:this}}},tv={createNote:function(){let e=this.options.notes,t=this.noteText||e.label.text;e.visible!==!1&&t!=null&&(this.note=new um({value:this.value,text:t,dataItem:this.dataItem,category:this.category,series:this.series},this.options.notes,this.owner.chartService),this.append(this.note))}};var nv=class extends Q{constructor(e,t){super(t),this.value=e,this.aboveAxis=q(this.options.aboveAxis,!0),this.tooltipTracking=!0,this._id=Rf()}initOptions(e){this.options=Object.assign({},e)}render(){let{markers:e}=this.options;this._rendered||(this._rendered=!0,e.visible&&e.size&&(this.marker=this.createMarker(),this.append(this.marker)),this.createLabel(),this.createNote(),this.errorBar&&this.append(this.errorBar))}createLabel(){let e=this.options.labels;e.visible&&(this.label=this.createLabelElement(e),this.append(this.label))}createLabelElement(e){return new om(this.getLabelText(e),Object.assign({},{align:x,vAlign:x,zIndex:q(e.zIndex,this.series.zIndex)},e,{margin:Object.assign({},{left:5,right:5},e.margin)}),this.pointData())}getLabelText(e){let t=Pd(e);return t?t(this.pointData()):e.format?this.formatValue(e.format):this.value}getAriaLabelText(){let e=this.options.labels,t=Fd(e);return t?t(this.pointData()):this.getLabelText(e)}markerBorder(){let e=this.options.markers,t=e.background,n=Object.assign({},{color:this.color},e.border);return n.color===void 0&&(n.color=new Ue(t).brightness(qh).toHex()),n}createVisual(){}createMarker(){let e=this.options.markers;return new Yp({type:e.type,width:e.size,height:e.size,rotation:e.rotation,background:e.background,border:this.markerBorder(),opacity:e.opacity,pattern:this.options.pattern,zIndex:q(e.zIndex,this.series.zIndex),animation:e.animation,visual:e.visual,accessibilityOptions:Object.assign({},{ariaLabel:this.getAriaLabelText(this.options.labels)},this.options.accessibility)},{dataItem:this.dataItem,value:this.value,series:this.series,category:this.category})}markerBox(){return this.marker||(this.marker=this.createMarker(),this.marker.reflow(this._childBox)),this.marker.box}reflow(e){let{options:t,aboveAxis:n}=this,r=t.vertical;this.render(),this.box=e;let i=e.clone();if(r?n?i.y1-=i.height():i.y2+=i.height():n?i.x1+=i.width():i.x2-=i.width(),this._childBox=i,this.marker&&this.marker.reflow(i),this.reflowLabel(i),this.errorBars)for(let e=0;e<this.errorBars.length;e++)this.errorBars[e].reflow(i);if(this.note){let e=this.markerBox();if(!(t.markers.visible&&t.markers.size)){let t=e.center();e=new Z(t.x,t.y,t.x,t.y)}this.note.reflow(e)}}reflowLabel(e){let{options:t,label:n}=this,r=t.labels.position;n&&(r=r===`above`?`top`:r,r=r===`below`?b:r,n.reflow(e),n.box.alignTo(this.markerBox(),r),n.reflow(n.box))}createHighlight(){let e=this.options.highlight.markers,t=this.markerBorder().color,n=this.options.markers,r=n.size+(n.border.width||0)+(e.border.width||0),i=new Yp({type:n.type,width:r,height:r,rotation:n.rotation,background:e.color||t,border:{color:e.border.color,width:e.border.width,opacity:q(e.border.opacity,1)},opacity:q(e.opacity,1)});return i.reflow(this._childBox),i.getElement()}highlightVisual(){return(this.marker||{}).visual}highlightVisualArgs(){let e=this.marker,t,n;if(e)n=e.paddingBox.toRect(),t=e.visual;else{let e=this.options.markers.size,t=e/2,r=this.box.center();n=new j([r.x-t,r.y-t],[e,e])}return{options:this.options,rect:n,visual:t}}createFocusHighlight(){let e=this.options.markers,t=this.options.focusHighlight,n=e.size+(e.border.width||0),r=new Yp({type:e.type,width:n,height:n,rotation:e.rotation,background:t.color,border:t.border,opacity:t.opacity,padding:t.border.width/2,zIndex:t.zIndex});return r.reflow(this._childBox),r.getElement()}tooltipAnchor(){let e=this.markerBox(),t=this.owner.pane.clipBox();if(!t||t.overlaps(e)){let t=e.x2+5,n,r;return this.aboveAxis?(n=e.y1,r=b):(n=e.y2,r=`top`),{point:new X(t,n),align:{horizontal:`left`,vertical:r}}}}formatValue(e){return this.owner.formatPointValue(this,e)}overlapsBox(e){return this.markerBox().overlaps(e)}clipElements(){this.options.visible=!1}unclipElements(){this.label&&(this.label.options.noclip=!0),this.note&&(this.note.options.noclip=!0)}unclipBox(){return Q_(this.markerBox().clone(),[this.label,this.note])}labelBox(){return this.label?this.label.box:new Z}noteBox(){return this.note?this.note.box:new Z}pointData(){return{dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,stackValue:this.stackValue,series:this.series}}focusVisual(){this.marker&&(this.marker.visual&&this.marker.visual.options.set(`id`,this._id),this.toggleFocusHighlight(!0))}clearFocusFromVisual(){this.marker&&(this.marker.visual&&this.marker.visual.options.set(`id`,``),this.toggleFocusHighlight(!1))}getIndex(){return this.categoryIx===void 0?this.pointIx:this.categoryIx}};nv.prototype.defaults={vertical:!0,markers:{visible:!0,background:k,size:8,type:S,border:{width:2},opacity:1},labels:{visible:!1,position:rg,margin:H(3),padding:H(4),animation:{type:Gh,delay:600}},notes:{label:{}},highlight:{markers:{border:{color:`#fff`,width:2}},zIndex:100},errorBars:{line:{width:1}},accessibility:{tabIndex:0,role:h_,className:g_,ariaRoleDescription:__}},V(nv.prototype,ev),V(nv.prototype,tv);var rv=class extends Q{constructor(e,t,n){super(),this.linePoints=e,this.series=t,this.seriesIx=n}points(){return this.toGeometryPoints(this.linePoints)}toGeometryPoints(e){let t=[];for(let n=0,r=e.length;n<r;n++)e[n]&&e[n].visible!==!1&&t.push(e[n]._childBox.toRect().center());return t}createVisual(){let e=this.series.visual;e?(this.visual=e({points:this.toGeometryPoints(this.linePoints),series:this.series,sender:this.getSender(),createVisual:()=>(this.segmentVisual(),this.visual)}),this.visual&&!W(this.visual.options.zIndex)&&(this.visual.options.zIndex=this.series.zIndex)):this.segmentVisual()}segmentVisual(){let{options:e,series:t}=this,{color:n,_defaults:r}=t;wd(n)&&r&&(n=r.color);let i=N.fromPoints(this.points(),{stroke:{color:n,width:t.width,opacity:t.opacity,dashType:t.dashType},zIndex:t.zIndex});e.closed&&i.close(),this.visual=i}aliasFor(e,t){return this.parent.getNearestPoint(t.x,t.y,this.seriesIx)}};J(rv,{closed:!1});let iv={calculateStepPoints:function(e){let{justified:t,vertical:n,reverse:r}=this.parent.plotArea.seriesCategoryAxis(this.series).options,i=n?`x`:`y`,a=n?`y`:`x`,o=r?2:1,s=o,c=av(e[0],i,o,a,s),l=[c];for(let t=1;t<e.length;t++){let n=av(e[t],i,o,a,s);if(c[i]!==n[i]){let e=new A;e[i]=c[i],e[a]=n[a],l.push(e,n)}c=n}return t?c!==rf(l)&&l.push(c):l.push(av(rf(e),i,o,a,r?1:2)),l}};function av(e,t,n,r,i){let a=e.box,o=new A;return o[t]=a[t+n],o[r]=a[r+i],o}var ov=class extends rv{points(){return this.calculateStepPoints(this.linePoints)}};V(ov.prototype,iv);var sv=class extends rv{segmentVisual(){let e=this.series,t=e._defaults,n=e.color;wd(n)&&t&&(n=t.color);let r=new Vh(this.options.closed).process(this.points()),i=new N({stroke:{color:n,width:e.width,opacity:e.opacity,dashType:e.dashType},zIndex:e.zIndex});i.segments.push.apply(i.segments,r),this.visual=i}};let cv={renderSegments:function(){let{options:e,seriesPoints:t}=this,n=e.series,r=t.length,i;this._segments=[];for(let e=0;e<r;e++){let r=n[e],a=this.sortPoints(t[e]),o=a.length,s=[];for(let t=0;t<o;t++){let n=a[t];n?s.push(n):this.seriesMissingValues(r)!==`interpolate`&&(s.length>1&&(i=this.createSegment(s,r,e,i),this._addSegment(i)),s=[])}s.length>1&&(i=this.createSegment(s,r,e,i),this._addSegment(i))}this.children.unshift.apply(this.children,this._segments)},_addSegment:function(e){this._segments.push(e),e.parent=this},hasSegmentForPoint(e,t){return this._segments.some(n=>{if(n.seriesIx!==e)return!1;let r=n.linePoints,i=r[0].categoryIx,a=r[r.length-1].categoryIx;return t>=i&&t<=a})},sortPoints:function(e){return e},seriesMissingValues:function(e){let t=e.missingValues;return!t&&this.options.isStacked?tg:t||`interpolate`},getNearestPoint:function(e,t,n){let r=new X(e,t),i=this.seriesPoints[n],a=E,o;for(let e=0;e<i.length;e++){let t=i[e];if(t&&t.value!==void 0&&t.value!==null&&t.visible!==!1){let e=t.box.center().distanceTo(r);e<a&&(o=t,a=e)}}return o}};var lv=class extends ea{setup(){let e=this.options;e.duration=e.duration===void 0?e.motionConfig.steady:e.duration,e.easing=e.motionConfig[e.easing]||[],this._setEnd(e.box.x1)}step(e){let t=this.options.box;this._setEnd(Hd(t.x1,t.x2,e))}_setEnd(e){let t=this.element,n=t.segments,r=n[1].anchor(),i=n[2].anchor();t.suspend(),r.setX(e),t.resume(),i.setX(e)}};J(lv,{motionConfig:{}}),Xi.current.register(`clip`,lv);let uv={createAnimation:function(){let e=this.getRoot(),t=(e&&e.options||{}).transitions;if(e&&t!==!1){let t=this.parent&&this.parent.clipBox||e.size(),n=N.fromRect(t.toRect());this.visual.clip(n),this.animation=new lv(n,{box:t}),M_(this.options.series)&&this._setChildrenAnimation(n)}},_setChildrenAnimation:function(e){let t=this.animationPoints();for(let n=0;n<t.length;n++){let r=t[n];r&&r.visual&&W(r.visual.options.zIndex)&&r.visual.clip(e)}}};var dv=class extends $_{render(){super.render(),this.updateStackRange(),this.renderSegments()}pointType(){return nv}createPoint(e,t){let{series:n,seriesIx:r}=t,i=this.seriesMissingValues(n),a=e.valueFields.value;if(a==null)if(i===`zero`)a=0;else return null;let o=this.pointOptions(n,r);o=this.evalPointOptions(o,a,t);let s=e.fields.color||n.color;wd(n.color)&&(s=o.color);let c=new nv(a,o);return c.color=s,this.append(c),c}plotRange(e){let t=this.plotValue(e);if(this.options.isStacked){let n=e.categoryIx,r=this.categoryPoints[n];for(let n=0;n<r.length;n++){let i=r[n];if(e===i)break;t+=this.plotValue(i),this.options.isStacked100&&(t=Math.min(t,1))}}return[t,t]}createSegment(e,t,n){let r=t.style,i;return i=r===`step`?ov:r===`smooth`?sv:rv,new i(e,t,n)}animationPoints(){let e=this.points,t=[];for(let n=0;n<e.length;n++)t.push((e[n]||{}).marker);return t.concat(this._segments)}supportsPointInactiveOpacity(){return!1}};V(dv.prototype,cv,uv);var fv=class extends rv{constructor(e,t,n,r,i){super(e,t,n),this.prevSegment=r,this.stackPoints=i}createVisual(){let e=this.series,t=e._defaults,n=e.line||{},r=e.color;wd(r)&&t&&(r=t.color),this.visual=new P({zIndex:e.zIndex}),this.createFill({fill:Kp(e.pattern,{color:r,opacity:e.opacity}),stroke:null}),n.width>0&&n.visible!==!1&&this.createStroke({stroke:V({color:r,opacity:e.opacity,lineCap:`butt`},n)})}strokeSegments(){let e=this._strokeSegments;return e||=this._strokeSegments=this.createStrokeSegments(),e}createStrokeSegments(){return this.segmentsFromPoints(this.points())}stackSegments(){return this.prevSegment?this.prevSegment.createStackSegments(this.stackPoints):this.createStackSegments(this.stackPoints)}createStackSegments(e){return this.segmentsFromPoints(this.toGeometryPoints(e)).reverse()}segmentsFromPoints(e){return e.map(e=>new dr(e))}createStroke(e){let t=new N(e);t.segments.push.apply(t.segments,this.strokeSegments()),this.visual.append(t)}hasStackSegment(){return this.prevSegment||this.stackPoints&&this.stackPoints.length}createFill(e){let t=this.strokeSegments(),n=t.slice(0),r=this.hasStackSegment();if(r){let e=this.stackSegments();Yd(n,e)}let i=new N(e);i.segments.push.apply(i.segments,n),!r&&t.length>1&&this.fillToAxes(i),this.visual.append(i)}fillToAxes(e){let t=this.parent,n=t.options.invertAxes,r=t.seriesValueAxis(this.series),i=t.categoryAxisCrossingValue(r),a=r.getSlot(i,i,!0),o=this.strokeSegments(),s=o[0].anchor(),c=rf(o).anchor(),l=n?a.x1:a.y1;n?e.lineTo(l,c.y).lineTo(l,s.y):e.lineTo(c.x,l).lineTo(s.x,l)}},pv=class extends fv{createStrokeSegments(){return this.segmentsFromPoints(this.calculateStepPoints(this.linePoints))}createStackSegments(e){return this.segmentsFromPoints(this.calculateStepPoints(e)).reverse()}};V(pv.prototype,iv);var mv=class extends fv{createStrokeSegments(){let e=new Vh(this.options.closed),t=this.points();return e.process(t)}},hv=class extends dv{createSegment(e,t,n,r){let i=this.options.isStacked,a=(t.line||{}).style,o,s;i&&n>0&&r&&(s=this._getStackPoints(e,n,a),o=r);let c;return c=a===`step`?pv:a===`smooth`?mv:fv,new c(e,t,n,o,s)}reflow(e){super.reflow(e);let t=this._stackPoints;if(t)for(let e=0;e<t.length;e++){let n=t[e],r=this.categoryAxis.getSlot(n.categoryIx);n.reflow(r)}}_getStackPoints(e,t,n){let r=this.seriesPoints,i=Math.max(-1,e[0].categoryIx),a=rf(e).categoryIx+1,o=+!!this.seriesOptions[0]._outOfRangeMinPoint,s=[];this._stackPoints=this._stackPoints||[];for(let e=i;e<a;e++){let c=e,l=t,u,d=!1;do if(l--,u=r[l][c+o],!u&&this.hasSegmentForPoint(l,e)){d=!0;break}while(l>0&&!u);if(u)n!==`step`&&e>i&&(this.hasSegmentForPoint(l,c-1)||s.push(this._previousSegmentPoint(e,c,c-1,l))),s.push(u),n!==`step`&&e+1<a&&(this.hasSegmentForPoint(l,c+1)||s.push(this._previousSegmentPoint(e,c,c+1,l)));else if(!d){let t=this._createGapStackPoint(e);this._stackPoints.push(t),s.push(t)}}return s}_previousSegmentPoint(e,t,n,r){let i=this.seriesPoints,a=r,o;for(;a>0&&!o;)a--,o=i[a][n];return o?o=i[a][t]:(o=this._createGapStackPoint(e),this._stackPoints.push(o)),o}_createGapStackPoint(e){let t=new nv(0,this.pointOptions({},0));return t.categoryIx=e,t.series={},t}seriesMissingValues(e){return e.missingValues||`zero`}supportsPointInactiveOpacity(){return!1}},gv=class{constructor(){this.axisRanges={}}update(e){let t=this.axisRanges;for(let n in e){let r=e[n],i=t[n];t[n]=i||={min:E,max:D},i.min=Math.min(i.min,r.min),i.max=Math.max(i.max,r.max)}}reset(e){this.axisRanges[e]=void 0}query(e){return this.axisRanges[e]}},_v=class extends Q{constructor(e,t,n){super(t),this.textBox=new om(e,this.options,n),this.append(this.textBox)}createVisual(){this.textBox.options.noclip=this.options.noclip}reflow(e){let t=this.options,{vertical:n,aboveAxis:r}=t,i=this.children[0],a=i.options,o=i.box,s=i.options.padding,c=e;if(a.align=n?x:T,a.vAlign=n?`top`:x,t.position===`insideEnd`)n?(a.vAlign=`top`,!r&&o.height()<e.height()&&(a.vAlign=b)):a.align=r?O:T;else if(t.position===`center`)a.vAlign=x,a.align=x;else if(t.position===`insideBase`)n?a.vAlign=r?b:`top`:a.align=r?T:O;else if(t.position===`outsideEnd`)if(n)if(r){let t=(o.width()-e.width()-s.left-s.right)/2;c=new Z(e.x1-t,e.y1-o.height(),e.x2+t,e.y1)}else c=new Z(e.x1,e.y2,e.x2,e.y2+o.height());else a.align=x,c=r?new Z(e.x2,e.y1,e.x2+o.width(),e.y2):new Z(e.x1-o.width(),e.y1,e.x1,e.y2);t.rotation||(n?s.left=s.right=(c.width()-i.contentBox.width())/2:s.top=s.bottom=(c.height()-i.contentBox.height())/2),i.reflow(c)}alignToClipBox(e){let t=this.options.vertical?`y`:`x`,n=t+`1`,r=t+`2`,i=this.children[0],a=this.parent.box;if(a[n]<e[n]||e[r]<a[r]){let t=i.paddingBox.clone();t[n]=Math.max(a[n],e[n]),t[r]=Math.min(a[r],e[r]),this.reflow(t)}}};J(_v,{position:w_,margin:H(3),padding:H(4),color:y,background:``,border:{width:1,color:``},aboveAxis:!0,vertical:!1,animation:{type:Gh,delay:600},zIndex:2});let vv={addAccessibilityAttributesToVisual:function(){this._id=this._id||zf();let e=Object.assign({},{ariaLabel:this.getAriaLabelText()},this.options.accessibility);Jp(this.visual,e)},getAriaLabelText(){let e=this.options.labels,t=Fd(e);return t?t(this.pointData()):this.getLabelText(e)},focusVisual(){this.visual.options.set(`id`,this._id),this.toggleFocusHighlight(!0)},clearFocusFromVisual(){this.visual.options.set(`id`,``),this.toggleFocusHighlight(!1)}};var yv=class extends Q{constructor(e,t){super(),this.options=t,this.color=t.color||`#fff`,this.aboveAxis=q(this.options.aboveAxis,!0),this.value=e}render(){this._rendered||(this._rendered=!0,this.createLabel(),this.createNote(),this.errorBar&&this.append(this.errorBar))}createLabel(){let e=this.options.labels;e.visible&&(this.label=this.createLabelElement(e),this.append(this.label))}createLabelElement(e){return new _v(this.getLabelText(e),V({vertical:this.options.vertical},e),this.pointData())}getLabelText(e){let t=Pd(e);return t?t(this.pointData()):this.formatValue(e.format)}formatValue(e){return this.owner.formatPointValue(this,e)}reflow(e){this.render();let t=this.label;if(this.box=e,t&&(t.options.aboveAxis=this.aboveAxis,t.reflow(e)),this.note&&this.note.reflow(e),this.errorBars)for(let t=0;t<this.errorBars.length;t++)this.errorBars[t].reflow(e)}createVisual(){let{box:e,options:t}=this,n=t.visual;if(this.visible!==!1)if(super.createVisual(),this.addAccessibilityAttributesToVisual(),n){let r=this.rectVisual=n({category:this.category,dataItem:this.dataItem,value:this.value,sender:this.getSender(),series:this.series,percentage:this.percentage,stackValue:this.stackValue,runningTotal:this.runningTotal,total:this.total,rect:e.toRect(),createVisual:()=>{let e=new P;return this.createRect(e),e},options:t});r&&this.visual.append(r)}else e.width()>0&&e.height()>0&&this.createRect(this.visual)}createRect(e){let t=this.options,n=t.border,r=W(n.opacity)?n.opacity:t.opacity,i=this.box.toRect();i.size.width=Math.round(i.size.width);let a=this.rectVisual=N.fromRect(i,{fill:Kp(t.pattern,{color:this.color,opacity:t.opacity}),stroke:{color:this.getBorderColor(),width:n.width,opacity:r,dashType:n.dashType}}),o=this.box.width(),s=this.box.height();if((t.vertical?o:s)>6&&(_d(a),(o<1||s<1)&&(a.options.stroke.lineJoin=`round`)),e.append(a),U_(t)){let n=this.createGradientOverlay(a,{baseColor:this.color},V({end:t.vertical?void 0:[0,1]},t.overlay));e.append(n)}}createHighlight(e){return _d(N.fromRect(this.box.toRect(),e))}highlightVisual(){return this.rectVisual}highlightVisualArgs(){return{options:this.options,rect:this.box.toRect(),visual:this.rectVisual}}createFocusHighlight(e){let t=this.options.focusHighlight.border.width;return _d(N.fromRect(this.box.pad(t/2).toRect(),e))}getBorderColor(){let e=this.color,t=this.options.border,n=t._brightness||.8,r=t.color;return W(r)||(r=new Ue(e).brightness(n).toHex()),r}tooltipAnchor(){let{options:e,box:t,aboveAxis:n}=this,r=this.owner.pane.clipBox()||t,i=T,a=`top`,o,s;if(e.vertical)o=Math.min(t.x2,r.x2)+5,n?s=Math.max(t.y1,r.y1):(s=Math.min(t.y2,r.y2),a=b);else{let c=Math.max(t.x1,r.x1),l=Math.min(t.x2,r.x2);e.isStacked?(a=b,n?(i=O,o=l):o=c,s=Math.max(t.y1,r.y1)-5):(n?o=l+5:(o=c-5,i=O),s=Math.max(t.y1,r.y1))}return{point:new X(o,s),align:{horizontal:i,vertical:a}}}overlapsBox(e){return this.box.overlaps(e)}unclipBox(){let e=this.label&&this.label.textBox;return Q_(this.box.clone(),[e,this.note])}labelBox(){let e=this.label&&this.label.textBox;return e?e.box:new Z}noteBox(){return this.note?this.note.box:new Z}pointData(){return{dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,stackValue:this.stackValue,runningTotal:this.runningTotal,total:this.total,series:this.series}}getIndex(){return this.categoryIx}};V(yv.prototype,ev),V(yv.prototype,tv),V(yv.prototype,vv),yv.prototype.defaults={border:{width:1},vertical:!0,overlay:{gradient:`glass`},labels:{visible:!1,format:`{0}`},opacity:1,notes:{label:{}},accessibility:{role:h_,className:g_,ariaRoleDescription:__}};function bv(e,t){e.forEach(t)}function xv(e,t){let n=e.length;for(let r=n-1;r>=0;r--)t(e[r],r-n-1)}var Sv=class extends Q{constructor(e){super(e),this.forEach=e.rtl?xv:bv}reflow(e){let{vertical:t,gap:n,spacing:r}=this.options,i=this.children,a=i.length,o=t?`y`:`x`,s=a+n+r*(a-1),c=(t?e.height():e.width())/s,l=e[o+1]+n/2*c;this.forEach(i,(t,n)=>{let i=(t.box||e).clone();i[o+1]=l,i[o+2]=l+c,t.reflow(i),n<a-1&&(l+=c*r),l+=c})}};J(Sv,{vertical:!1,gap:0,spacing:0});var Cv=class extends Q{reflow(e){let t=this.options.vertical?`x`:`y`,n=this.children,r=n.length,i=this.box=new Z;for(let a=0;a<r;a++){let r=n[a];if(r.visible!==!1){let n=r.box.clone();n.snapTo(e,t),a===0&&(i=this.box=n.clone()),r.reflow(n),i.wrap(n)}}}};J(Cv,{vertical:!0});var wv=class extends $_{render(){super.render(),this.updateStackRange()}pointType(){return yv}clusterType(){return Sv}stackType(){return Cv}stackLimits(e,t){return super.stackLimits(e,t)}createPoint(e,t){let{categoryIx:n,series:r,seriesIx:i}=t,{options:a,children:o}=this,s=W(r.stack)?r.stack:a.defaultStack,c=this.pointValue(e),l=this.pointOptions(r,i),u=l.labels;s&&u.position===`outsideEnd`&&(u.position=S_),l.isStacked=s;let d=e.fields.color||r.color;c<0&&l.negativeColor&&(d=l.negativeColor),l=this.evalPointOptions(l,c,t),wd(r.color)&&(d=l.color);let f=new(this.pointType())(c,l);f.color=d;let p=o[n];return p||(p=new(this.clusterType())({vertical:a.invertAxes,gap:a.gap,spacing:a.spacing,rtl:!a.invertAxes&&(this.chartService||{}).rtl}),this.append(p)),a.isStacked?this.getStackWrap(s,p).append(f):p.append(f),f}getStackWrap(e,t){let n=typeof e==`object`?e.group||!0:e,r=t.children,i;if(typeof n==`string`||n===!0){for(let e=0;e<r.length;e++)if(r[e]._stackGroup===n){i=r[e];break}}return i||(i=new(this.stackType())({vertical:!this.options.invertAxes}),i._stackGroup=n,t.append(i)),i}categorySlot(e,t,n){let r=this.options,i=e.getSlot(t),a=n.startValue();if(r.isStacked){let e=n.getSlot(a,a,!0),t=r.invertAxes?`x`:`y`;i[t+1]=i[t+2]=e[t+1]}return i}reflowCategories(e){let t=this.children,n=t.length;for(let r=0;r<n;r++)t[r].reflow(e[r])}createAnimation(){this._setAnimationOptions(),super.createAnimation(),M_(this.options.series)&&this._setChildrenAnimation()}_setChildrenAnimation(){let e=this.points;for(let t=0;t<e.length;t++){let n=e[t],r=n.visual;r&&W(r.options.zIndex)&&(n.options.animation=this.options.animation,n.createAnimation())}}_setAnimationOptions(){let e=this.options,t=e.animation||{},n;if(e.isStacked){let t=this.seriesValueAxis(e.series[0]);n=t.getSlot(t.startValue())}else n=this.categoryAxis.getSlot(0);t.origin=new A(n.x1,n.y1),t.vertical=!e.invertAxes}};J(wv,{animation:{type:`bar`}});var Tv=class extends Q{constructor(e,t){super(t),this.value=e}getLabelText(e){return this.formatValue(e.format)}reflow(e){let{options:t,value:n,owner:r}=this,i=r.seriesValueAxis(t),a=i.getSlot(n.open,n.close),o=i.getSlot(n.low,n.high);a.x1=o.x1=e.x1,a.x2=o.x2=e.x2,this.realBody=a;let s=o.center().x,c=[];c.push([[s,o.y1],[s,a.y1]]),c.push([[s,a.y2],[s,o.y2]]),this.lines=c,this.box=o.clone().wrap(a),this._rendered||(this._rendered=!0,this.createNote()),this.reflowNote()}reflowNote(){this.note&&this.note.reflow(this.box)}createVisual(){super.createVisual(),this.addAccessibilityAttributesToVisual(),this._mainVisual=this.mainVisual(this.options),this.visual.append(this._mainVisual),this.createOverlay()}mainVisual(e){let t=new P;return this.createBody(t,e),this.createLines(t,e),t}createBody(e,t){let n=N.fromRect(this.realBody.toRect(),{fill:Kp(t.pattern,{color:this.color,opacity:t.opacity}),stroke:null});t.border.width>0&&n.options.set(`stroke`,{color:this.getBorderColor(t),width:t.border.width,dashType:t.border.dashType,opacity:q(t.border.opacity,t.opacity)}),_d(n),e.append(n),U_(t)&&e.append(this.createGradientOverlay(n,{baseColor:this.color},V({end:t.vertical?void 0:[0,1]},t.overlay)))}createLines(e,t){this.drawLines(e,t,this.lines,t.line)}drawLines(e,t,n,r){if(!n)return;let i={stroke:{color:r.color||this.color,opacity:q(r.opacity,t.opacity),width:r.width,dashType:r.dashType,lineCap:`butt`}};for(let t=0;t<n.length;t++){let r=N.fromPoints(n[t],i);_d(r),e.append(r)}}getBorderColor(e){let t=e.border.color;return W(t)||(t=new Ue(this.color).brightness(this.options.border._brightness).toHex()),t}createOverlay(){let e=N.fromRect(this.box.toRect(),{fill:{color:k,opacity:0},stroke:null});this.visual.append(e)}createHighlight(){let e=this.options.highlight,t=this.color;this.color=e.color||this.color;let n=this.mainVisual(V({},this.options,{line:{color:this.getBorderColor(e)}},e));return this.color=t,n}highlightVisual(){return this._mainVisual}highlightVisualArgs(){return{options:this.options,rect:this.box.toRect(),visual:this._mainVisual}}tooltipAnchor(){let e=this.box,t=this.owner.pane.clipBox()||e;return{point:new X(e.x2+5,Math.max(e.y1,t.y1)+5),align:{horizontal:T,vertical:`top`}}}formatValue(e){return this.owner.formatPointValue(this,e)}overlapsBox(e){return this.box.overlaps(e)}pointData(){return{dataItem:this.dataItem,value:this.value,meanPoints:this.meanPoints,medianPoints:this.medianPoints,whiskerPoints:this.whiskerPoints,stackValue:this.stackValue,series:this.series}}getIndex(){return this.categoryIx}};Tv.prototype.createFocusHighlight=yv.prototype.createFocusHighlight,J(Tv,{vertical:!0,border:{_brightness:.8},line:{width:2},overlay:{gradient:`glass`},tooltip:{format:`<table><tr><th colspan='2'>{4:d}</th></tr><tr><td>Open:</td><td>{0:C}</td></tr><tr><td>High:</td><td>{1:C}</td></tr><tr><td>Low:</td><td>{2:C}</td></tr><tr><td>Close:</td><td>{3:C}</td></tr></table>`},labels:{format:``},highlight:{opacity:1,border:{width:1,opacity:1},line:{width:1,opacity:1}},notes:{visible:!0,label:{}},accessibility:{role:h_,className:g_,ariaRoleDescription:__}}),V(Tv.prototype,ev),V(Tv.prototype,tv),V(Tv.prototype,vv);var Ev=class extends $_{reflowCategories(e){let t=this.children,n=t.length;for(let r=0;r<n;r++)t[r].reflow(e[r])}addValue(e,t){let{categoryIx:n,category:r,series:i,seriesIx:a}=t,{children:o,options:s}=this,c=e.valueFields,l=P_(this.splitValue(c)),u=i.data[n],d=this.categoryPoints[n],f;d||(this.categoryPoints[n]=d=[]),l&&(f=this.createPoint(e,t));let p=o[n];p||(p=new Sv({vertical:s.invertAxes,gap:s.gap,spacing:s.spacing,rtl:!s.invertAxes&&(this.chartService||{}).rtl}),this.append(p)),f&&(this.updateRange(c,t),p.append(f),f.categoryIx=n,f.category=r,f.series=i,f.seriesIx=a,f.owner=this,f.dataItem=u,f.noteText=e.fields.noteText),this.points.push(f),d.push(f)}pointType(){return Tv}createPoint(e,t){let{series:n}=t,r=this.pointType(),i=e.valueFields,a=V({},n),o=e.fields.color||n.color;a=this.evalPointOptions(a,i,t),(n.type===`candlestick`||n.type===`ohlc`)&&i.open>i.close&&(o=e.fields.downColor||n.downColor||n.color),wd(n.color)&&(o=a.color),a.vertical=!this.options.invertAxes;let s=new r(i,a);return s.color=o,s}splitValue(e){return[e.low,e.open,e.close,e.high]}updateRange(e,t){let n=t.series.axis,r=this.splitValue(e),i=this.valueAxisRanges[n]||{min:E,max:D};this.valueAxisRanges[n]={min:Math.min.apply(Math,r.concat([i.min])),max:Math.max.apply(Math,r.concat([i.max]))}}formatPointValue(e,t){let n=e.value;return this.chartService.format.auto(t,n.open,n.high,n.low,n.close,e.category)}animationPoints(){return this.points}};V(Ev.prototype,uv);var Dv=class extends Tv{constructor(e,t){super(e,t),this.createNote()}reflow(e){let{options:t,value:n,owner:r}=this,i=r.seriesValueAxis(t),a,o;this.boxSlot=o=i.getSlot(n.q1,n.q3),this.realBody=o,this.reflowBoxSlot(e),this.whiskerSlot=a=i.getSlot(n.lower,n.upper),this.reflowWhiskerSlot(e);let s=i.getSlot(n.median);if(n.mean){let t=i.getSlot(n.mean);this.meanPoints=this.calcMeanPoints(e,t)}this.whiskerPoints=this.calcWhiskerPoints(o,a),this.medianPoints=this.calcMedianPoints(e,s),this.box=a.clone().wrap(o),this.reflowNote()}reflowBoxSlot(e){this.boxSlot.x1=e.x1,this.boxSlot.x2=e.x2}reflowWhiskerSlot(e){this.whiskerSlot.x1=e.x1,this.whiskerSlot.x2=e.x2}calcMeanPoints(e,t){return[[[e.x1,t.y1],[e.x2,t.y1]]]}calcWhiskerPoints(e,t){let n=t.center().x;return[[[n-5,t.y1],[n+5,t.y1],[n,t.y1],[n,e.y1]],[[n-5,t.y2],[n+5,t.y2],[n,t.y2],[n,e.y2]]]}calcMedianPoints(e,t){return[[[e.x1,t.y1],[e.x2,t.y1]]]}renderOutliers(e){let t=this.value,n=t.outliers||[],r=Math.abs(t.q3-t.q1)*3,i=[],a=e.markers||{};for(let o=0;o<n.length;o++){let s=n[o];a=s<t.q3+r&&s>t.q1-r?e.outliers:e.extremes;let c=V({},a.border);W(c.color)||(W(this.color)?c.color=this.color:c.color=new Ue(a.background).brightness(qh).toHex());let l=new Yp({type:a.type,width:a.size,height:a.size,rotation:a.rotation,background:a.background,border:c,opacity:a.opacity});l.value=s,i.push(l)}return this.reflowOutliers(i),i}reflowOutliers(e){let t=this.owner.seriesValueAxis(this.options),n=this.box.center();for(let r=0;r<e.length;r++){let i=e[r].value,a=t.getSlot(i);this.options.vertical?a.move(n.x):a.move(void 0,n.y),this.box=this.box.wrap(a),e[r].reflow(a)}}mainVisual(e){let t=super.mainVisual(e),n=this.renderOutliers(e);for(let e=0;e<n.length;e++){let r=n[e].getElement();r&&t.append(r)}return t}createLines(e,t){this.drawLines(e,t,this.whiskerPoints,t.whiskers),this.drawLines(e,t,this.medianPoints,t.median),this.drawLines(e,t,this.meanPoints,t.mean)}getBorderColor(){return(this.options.border||{}).color?this.options.border.color:this.color?this.color:super.getBorderColor()}};J(Dv,{border:{_brightness:.8},line:{width:2},median:{color:`#f6f6f6`},mean:{width:2,dashType:`dash`,color:`#f6f6f6`},overlay:{gradient:`glass`},tooltip:{format:`<table><tr><th colspan='2'>{6:d}</th></tr><tr><td>Lower:</td><td>{0:C}</td></tr><tr><td>Q1:</td><td>{1:C}</td></tr><tr><td>Median:</td><td>{2:C}</td></tr><tr><td>Mean:</td><td>{5:C}</td></tr><tr><td>Q3:</td><td>{3:C}</td></tr><tr><td>Upper:</td><td>{4:C}</td></tr></table>`},highlight:{opacity:1,border:{width:1,opacity:1},line:{width:1,opacity:1}},notes:{visible:!0,label:{}},outliers:{visible:!0,size:8,type:`cross`,background:k,border:{width:2,opacity:1},opacity:0},extremes:{visible:!0,size:8,type:S,background:k,border:{width:2,opacity:1},opacity:0}}),V(Dv.prototype,ev);var Ov=class extends Dv{reflowBoxSlot(e){this.boxSlot.y1=e.y1,this.boxSlot.y2=e.y2}reflowWhiskerSlot(e){this.whiskerSlot.y1=e.y1,this.whiskerSlot.y2=e.y2}calcMeanPoints(e,t){return[[[t.x1,e.y1],[t.x1,e.y2]]]}calcWhiskerPoints(e,t){let n=t.center().y;return[[[t.x1,n-5],[t.x1,n+5],[t.x1,n],[e.x1,n]],[[t.x2,n-5],[t.x2,n+5],[t.x2,n],[e.x2,n]]]}calcMedianPoints(e,t){return[[[t.x1,e.y1],[t.x1,e.y2]]]}},kv=class extends Ev{addValue(e,t){let{categoryIx:n,category:r,series:i,seriesIx:a}=t,{children:o,options:s}=this,c=e.valueFields,l=P_(this.splitValue(c)),u=i.data[n],d=this.categoryPoints[n],f;d||(this.categoryPoints[n]=d=[]),l&&(f=this.createPoint(e,t));let p=o[n];p||(p=new Sv({vertical:s.invertAxes,gap:s.gap,spacing:s.spacing,rtl:!s.invertAxes&&(this.chartService||{}).rtl}),this.append(p)),f&&(this.updateRange(c,t),p.append(f),f.categoryIx=n,f.category=r,f.series=i,f.seriesIx=a,f.owner=this,f.dataItem=u),this.points.push(f),d.push(f)}pointType(){return this.options.invertAxes?Ov:Dv}splitValue(e){return[e.lower,e.q1,e.median,e.q3,e.upper]}updateRange(e,t){let n=t.series.axis,r=this.splitValue(e).concat(this.filterOutliers(e.outliers));W(e.mean)&&(r=r.concat(e.mean));let i=this.valueAxisRanges[n]||{min:E,max:D};this.valueAxisRanges[n]={min:Math.min.apply(Math,r.concat([i.min])),max:Math.max.apply(Math,r.concat([i.max]))}}formatPointValue(e,t){let n=e.value;return this.chartService.format.auto(t,n.lower,n.q1,n.median,n.q3,n.upper,n.mean,e.category)}filterOutliers(e){let t=(e||[]).length,n=[];for(let r=0;r<t;r++){let t=e[r];W(t)&&t!==null&&n.push(t)}return n}supportsPointInactiveOpacity(){return!1}},Av=class extends A_{getAxis(){let e=this.chart.seriesAxes(this.series);return this.isVertical?e.y:e.x}},jv=class extends Q{constructor(e,t){super(t),this.plotArea=e,this.chartService=e.chartService,this._initFields(),this.render()}_initFields(){this.xAxisRanges={},this.yAxisRanges={},this.points=[],this.seriesPoints=[],this.seriesOptions=[],this._evalSeries=[]}render(){this.traverseDataPoints(this.addValue.bind(this))}addErrorBar(e,t,n){let r=e.value[t],i=t+`Value`,a=t+`ErrorLow`,o=t+`ErrorHigh`,{seriesIx:s,series:c}=n,l=e.options.errorBars,u=n[a],d=n[o];if(B(r)){let n;B(u)&&B(d)&&(n={low:u,high:d}),l&&W(l[i])&&(this.seriesErrorRanges=this.seriesErrorRanges||{x:[],y:[]},this.seriesErrorRanges[t][s]=this.seriesErrorRanges[t][s]||new Mp(l[i],c,t),n=this.seriesErrorRanges[t][s].getErrorRange(r,l[i])),n&&this.addPointErrorBar(n,e,t)}}addPointErrorBar(e,t,n){let{low:r,high:i}=e,{series:a,options:{errorBars:o}}=t,s=n===`y`,c={};t[n+`Low`]=r,t[n+`High`]=i,t.errorBars=t.errorBars||[];let l=new Av(r,i,s,this,a,o);t.errorBars.push(l),t.append(l),c[n]=r,this.updateRange(c,a),c[n]=i,this.updateRange(c,a)}addValue(e,t){let{x:n,y:r}=e,i=t.seriesIx,a=this.options.series[i],o=this.seriesMissingValues(a),s=this.seriesPoints[i],c=e;W_(n)&&W_(r)||(c=this.createMissingValue(c,o));let l;c&&(l=this.createPoint(c,t),l&&(Object.assign(l,t),this.addErrorBar(l,`x`,t),this.addErrorBar(l,`y`,t)),this.updateRange(c,t.series)),this.points.push(l),s.push(l)}seriesMissingValues(e){return e.missingValues}createMissingValue(){}updateRange(e,t){let n=this.chartService.intl,{xAxis:r,yAxis:i}=t,{x:a,y:o}=e,s=this.xAxisRanges[r],c=this.yAxisRanges[i];W_(a)&&(s=this.xAxisRanges[r]=s||{min:E,max:D},yd(a)&&(a=Ym(n,a)),s.min=Math.min(s.min,a),s.max=Math.max(s.max,a)),W_(o)&&(c=this.yAxisRanges[i]=c||{min:E,max:D},yd(o)&&(o=Ym(n,o)),c.min=Math.min(c.min,o),c.max=Math.max(c.max,o))}evalPointOptions(e,t,n){let{series:r,seriesIx:i}=n,a={defaults:r._defaults,excluded:[`data`,`tooltip`,`content`,`template`,`visual`,`toggle`,`_outOfRangeMinPoint`,`_outOfRangeMaxPoint`,`drilldownSeriesFactory`,`ariaTemplate`,`ariaContent`]},o=this._evalSeries[i];W(o)||(this._evalSeries[i]=o=z_(e,{},a,!0));let s=e;return o&&(s=V({},e),z_(s,{value:t,series:r,dataItem:n.dataItem},a)),s}pointType(){return nv}pointOptions(e,t){let n=this.seriesOptions[t];if(!n){let r=this.pointType().prototype.defaults;this.seriesOptions[t]=n=V({},r,{markers:{opacity:e.opacity},tooltip:{format:this.options.tooltip.format},labels:{format:this.options.labels.format}},e)}return n}createPoint(e,t){let n=t.series,r=this.pointOptions(n,t.seriesIx),i=t.color||n.color;r=this.evalPointOptions(r,e,t),wd(n.color)&&(i=r.color);let a=new nv(e,r);return a.color=i,this.append(a),a}seriesAxes(e){let{xAxis:t,yAxis:n}=e,r=this.plotArea,i=t?r.namedXAxes[t]:r.axisX,a=n?r.namedYAxes[n]:r.axisY;if(!i)throw Error(`Unable to locate X axis with name `+t);if(!a)throw Error(`Unable to locate Y axis with name `+n);return{x:i,y:a}}reflow(e){let t=this.points,n=!this.options.clip,r=0;this.traverseDataPoints((e,i)=>{let a=t[r++],o=this.seriesAxes(i.series),s=o.x.getSlot(e.x,e.x,n),c=o.y.getSlot(e.y,e.y,n);if(a)if(s&&c){let e=this.pointSlot(s,c);a.reflow(e)}else a.visible=!1}),this.box=e}pointSlot(e,t){return new Z(e.x1,t.y1,e.x2,t.y2)}traverseDataPoints(e){let{options:{series:t},seriesPoints:n}=this;for(let r=0;r<t.length;r++){let i=t[r];n[r]||(n[r]=[]);for(let t=0;t<i.data.length;t++){let{valueFields:n,fields:a}=this.plotArea.bindPoint(i,t);e(n,V({pointIx:t,series:i,seriesIx:r,dataItem:i.data[t],owner:this},a))}}}formatPointValue(e,t){let n=e.value;return this.chartService.format.auto(t,n.x,n.y)}animationPoints(){let e=this.points,t=[];for(let n=0;n<e.length;n++)t.push((e[n]||{}).marker);return t}};J(jv,{series:[],tooltip:{format:`{0}, {1}`},labels:{format:`{0}, {1}`},clip:!0}),V(jv.prototype,uv);var Mv=class extends nv{constructor(e,t){super(e,t),this.category=e.category}createHighlight(){let e=this.options.highlight,t=e.border,n=this.options.markers,r=this.box.center(),i=(n.size+n.border.width+t.width)/2,a=new P,o=new Ln(new An([r.x,r.y+i/5+t.width/2],i+t.width/2),{stroke:{color:`none`},fill:this.createGradient({gradient:`bubbleShadow`,color:n.background,stops:[{offset:0,color:n.background,opacity:.3},{offset:1,color:n.background,opacity:0}]})}),s=new Ln(new An([r.x,r.y],i),{stroke:{color:t.color||new Ue(n.background).brightness(.8).toHex(),width:t.width,opacity:t.opacity,dashType:t.dashType},fill:Kp(this.options.pattern,{color:n.background,opacity:e.opacity})});return a.append(o,s),a}createFocusHighlight(e){let t=this.options.focusHighlight,n=this.options.markers,r=this.box.center(),i=(n.size+n.border.width)/2+t.border.width/2;return new Ln(new An([r.x,r.y],i),e)}};Mv.prototype.defaults=V({},Mv.prototype.defaults,{labels:{position:x},highlight:{opacity:1,border:{color:`#fff`,width:2,opacity:1}}}),Mv.prototype.defaults.highlight.zIndex=void 0;var Nv=class extends jv{_initFields(){this._maxSize=D,super._initFields()}addValue(e,t){e.size!==null&&(e.size>0||e.size<0&&t.series.negativeValues.visible)?(this._maxSize=Math.max(this._maxSize,Math.abs(e.size)),super.addValue(e,t)):(this.points.push(null),this.seriesPoints[t.seriesIx].push(null))}reflow(e){this.updateBubblesSize(e),super.reflow(e)}pointType(){return Mv}createPoint(e,t){let n=t.series,r=n.data.length,i=(this.chartService.chart?this.chartService.chart.options.motion:{steady:600}).steady,a=t.pointIx*(i/r),o={delay:a,duration:i-a,type:ug},s=t.color||n.color;e.size<0&&n.negativeValues.visible&&(s=q(n.negativeValues.color,s));let c=V({labels:{animation:{delay:a,duration:i-a}}},this.pointOptions(n,t.seriesIx),{markers:{type:S,border:n.border,opacity:n.opacity,animation:o}});c=this.evalPointOptions(c,e,t),wd(n.color)&&(s=c.color),c.markers.background=s;let l=new Mv(e,c);return l.color=s,this.append(l),l}updateBubblesSize(e){let{options:{series:t}}=this,n=Math.min(e.width(),e.height());for(let e=0;e<t.length;e++){let r=t[e],i=this.seriesPoints[e],a=r.minSize||Math.max(n*.02,10),o=r.maxSize||n*.2,s=a/2,c=o/2,l=Math.PI*s*s,u=(Math.PI*c*c-l)/this._maxSize;for(let e=0;e<i.length;e++){let t=i[e];if(t){let e=Math.abs(t.value.size)*u,n=Math.sqrt((l+e)/Math.PI),r=q(t.options.zIndex,0)+(1-n/c);V(t.options,{zIndex:r,markers:{size:n*2,zIndex:r},labels:{zIndex:r+1}})}}}}formatPointValue(e,t){let n=e.value;return this.chartService.format.auto(t,n.x,n.y,n.size,e.category)}createAnimation(){}createVisual(){}};J(Nv,{tooltip:{format:`{3}`},labels:{format:`{3}`}});var Pv=class extends Yp{};V(Pv.prototype,ev);var Fv=class extends Q{constructor(e,t){super(t),this.aboveAxis=this.options.aboveAxis,this.color=t.color||`#fff`,this.value=e}render(){let e=this.options;this._rendered||(this._rendered=!0,W(this.value.target)&&(this.target=new Pv({type:e.target.shape,background:e.target.color||this.color,opacity:e.opacity,zIndex:e.zIndex,border:e.target.border,vAlign:`top`,align:O}),this.target.value=this.value,this.target.dataItem=this.dataItem,this.target.series=this.series,this.append(this.target)),this.createLabel(),this.createNote())}createLabel(){let e=this.options.labels;e.visible&&(this.label=this.createLabelElement(e),this.append(this.label))}createLabelElement(e){return new _v(this.getLabelText(e),e,this.pointData())}getLabelText(e){let t=Pd(e);return t?t(this.pointData()):this.formatValue(e.format)}reflow(e){this.render();let{options:t,target:n,owner:r}=this,i=t.invertAxes,a=r.seriesValueAxis(this.options),o=r.categorySlot(r.categoryAxis,t.categoryIx,a),s=a.getSlot(this.value.target),c=i?s:o,l=i?o:s;if(n){let e=new Z(c.x1,l.y1,c.x2,l.y2);n.options.height=i?e.height():t.target.line.width,n.options.width=i?t.target.line.width:e.width(),n.reflow(e)}let u=this.label;u&&(u.options.aboveAxis=this.aboveAxis,u.reflow(e)),this.note&&this.note.reflow(e),this.box=e}createVisual(){super.createVisual(),this.addAccessibilityAttributesToVisual();let e=this.options,t=N.fromRect(this.box.toRect(),{fill:Kp(e.pattern,{color:this.color,opacity:e.opacity}),stroke:null});e.border.width>0&&t.options.set(`stroke`,{color:e.border.color||this.color,width:e.border.width,dashType:e.border.dashType,opacity:q(e.border.opacity,e.opacity)}),this.bodyVisual=t,_d(t),this.visual.append(t)}createAnimation(){this.bodyVisual&&(this.animation=ea.create(this.bodyVisual,this.options.animation))}createHighlight(e){return N.fromRect(this.box.toRect(),e)}highlightVisual(){return this.bodyVisual}highlightVisualArgs(){return{rect:this.box.toRect(),visual:this.bodyVisual,options:this.options}}formatValue(e){return this.owner.formatPointValue(this,e)}pointData(){return{dataItem:this.dataItem,category:this.category,value:this.value,series:this.series}}overlapsBox(e){return this.box.overlaps(e)}getIndex(){return this.categoryIx}};Fv.prototype.tooltipAnchor=yv.prototype.tooltipAnchor,Fv.prototype.createFocusHighlight=yv.prototype.createFocusHighlight,J(Fv,{border:{width:1},vertical:!1,opacity:1,target:{shape:``,border:{width:0,color:`green`},line:{width:2}},labels:{visible:!1},tooltip:{format:`Current: {0}<br />Target: {1}`},notes:{label:{}},accessibility:{role:h_,className:g_,ariaRoleDescription:__}}),V(Fv.prototype,ev),V(Fv.prototype,tv),V(Fv.prototype,vv);var Iv=class extends $_{constructor(e,t){Lv(t),super(e,t)}reflowCategories(e){let t=this.children,n=t.length;for(let r=0;r<n;r++)t[r].reflow(e[r])}plotRange(e){let t=e.series,n=this.seriesValueAxis(t),r=this.categoryAxisCrossingValue(n);return[r,e.value.current||r]}createPoint(e,t){let{categoryIx:n,series:r}=t,{options:i,children:a}=this,o=e.valueFields,s=V({vertical:!i.invertAxes,overlay:r.overlay,categoryIx:n,invertAxes:i.invertAxes},r),c=e.fields.color||r.color;s=this.evalPointOptions(s,o,t),wd(r.color)&&(c=s.color);let l=new Fv(o,s);l.color=c;let u=a[n];return u||(u=new Sv({vertical:i.invertAxes,gap:i.gap,spacing:i.spacing,rtl:!i.invertAxes&&(this.chartService||{}).rtl}),this.append(u)),u.append(l),l}updateRange(e,t){let{current:n,target:r}=e,i=t.series.axis,a=this.valueAxisRanges[i];W(n)&&!isNaN(n)&&W(r&&!isNaN(r))&&(a=this.valueAxisRanges[i]=a||{min:E,max:D},a.min=Math.min(a.min,n,r),a.max=Math.max(a.max,n,r))}formatPointValue(e,t){return this.chartService.format.auto(t,e.value.current,e.value.target)}pointValue(e){return e.valueFields.current}aboveAxis(e){return e.value.current>0}createAnimation(){let e=this.points;this._setAnimationOptions();for(let t=0;t<e.length;t++){let n=e[t];n.options.animation=this.options.animation,n.createAnimation()}}};Iv.prototype._setAnimationOptions=wv.prototype._setAnimationOptions,J(Iv,{animation:{type:`bar`}});function Lv(e){let t=e.series;for(let e=0;e<t.length;e++){let n=t[e],r=n.data;r&&!se(r[0])&&!Dd(r[0])&&(n.data=[r])}}var Rv=class{constructor(e,t){this.chartService=e,this.options=V({},this.options,t)}getStyle(e,t){let{background:n,border:{color:r}}=e;if(t){let e=t.color||t.options.color;n=q(n,e),r=q(r,e)}let i=e.padding===void 0?{}:H(e.padding);return typeof e.padding==`object`&&(i.top=e.padding.top===void 0?void 0:i.top,i.right=e.padding.right===void 0?void 0:i.right,i.bottom=e.padding.bottom===void 0?void 0:i.bottom,i.left=e.padding.left===void 0?void 0:i.left),{backgroundColor:n,borderColor:r,font:e.font,color:e.color,opacity:e.opacity,borderWidth:Od(e.border.width),paddingTop:Od(i.top),paddingBottom:Od(i.bottom),paddingLeft:Od(i.left),paddingRight:Od(i.right)}}show(e,t,n){if(!this.chartService)return;e.format=t.format;let r=this.getStyle(t,n);e.style=r;let i=new Ue(r.backgroundColor);!W(t.color)&&!i.isDark()&&(e.className=`k-chart-tooltip-inverse`),this.chartService.notify(f_,e),this.visible=!0}hide(){this.chartService&&this.chartService.notify(p_),this.visible=!1}destroy(){delete this.chartService}};J(Rv,{border:{width:1},opacity:1});var zv=class extends Rv{constructor(e,t,n){super(e,n),this.crosshair=t,this.formatService=e.format,this.initAxisName()}initAxisName(){let e=this.crosshair.axis,t=e.plotArea,n;n=t.categoryAxis?e.getCategory?`categoryAxis`:`valueAxis`:e.options.vertical?`yAxis`:`xAxis`,this.axisName=n}showAt(e){let{crosshair:{axis:t},options:n}=this,r=t[n.stickyMode?`getCategory`:`getValue`](e),i=r;n.format?i=this.formatService.auto(n.format,r):t.options.type===`date`&&(i=this.formatService.auto(t.options.labels.dateFormats[t.options.baseUnit],r)),this.show({point:e,anchor:this.getAnchor(),crosshair:this.crosshair,value:i,axisName:this.axisName,axisIndex:this.crosshair.axis.axisIndex},this.options)}hide(){this.chartService.notify(p_,{crosshair:this.crosshair,axisName:this.axisName,axisIndex:this.crosshair.axis.axisIndex})}getAnchor(){let{crosshair:e,options:{position:t,padding:n}}=this,r=!e.axis.options.vertical,i=e.line.bbox(),a,o,s;return r?(a=x,t===`bottom`?(o=`top`,s=i.bottomLeft().translate(0,n)):(o=b,s=i.topLeft().translate(0,-n))):(o=x,t===`left`?(a=O,s=i.topLeft().translate(-n,0)):(a=T,s=i.topRight().translate(n,0))),{point:s,align:{horizontal:a,vertical:o}}}};J(zv,{padding:10});var Bv=class extends Q{constructor(e,t,n){super(n),this.axis=t,this.stickyMode=t instanceof eh;let r=this.options.tooltip;r.visible&&(this.tooltip=new zv(e,this,V({},r,{stickyMode:this.stickyMode})))}showAt(e){this.point=e,this.moveLine(),this.line.visible(!0),this.tooltip&&this.tooltip.showAt(e)}hide(){this.line.visible(!1),this.tooltip&&this.tooltip.hide()}moveLine(){let{axis:e,point:t}=this,n=e.options.vertical,r=this.getBox(),i=n?`y`:`x`,a=new A(r.x1,r.y1),o;if(o=n?new A(r.x2,r.y1):new A(r.x1,r.y2),t)if(this.stickyMode){let n=e.getSlot(e.pointCategoryIndex(t));a[i]=o[i]=n.center()[i]}else a[i]=o[i]=t[i];this.box=r,this.line.moveTo(a).lineTo(o)}getBox(){let e=this.axis,t=e.pane.axes,n=t.length,r=e.options.vertical,i=e.lineBox().clone(),a=r?`x`:`y`,o;for(let e=0;e<n;e++){let n=t[e];n.options.vertical!==r&&(o?o.wrap(n.lineBox()):o=n.lineBox().clone())}return i[a+1]=o[a+1],i[a+2]=o[a+2],i}createVisual(){super.createVisual();let e=this.options;this.line=new N({stroke:{color:e.color,width:e.width,opacity:e.opacity,dashType:e.dashType},visible:!1}),this.moveLine(),this.visual.append(this.line)}destroy(){this.tooltip&&this.tooltip.destroy(),super.destroy()}};J(Bv,{color:y,width:2,zIndex:-1,tooltip:{visible:!1}});var Vv=class extends Q{constructor(e,t){super(e),this.pane=t}shouldClip(){let e=this.children,t=e.length;for(let n=0;n<t;n++)if(e[n].options.clip===!0)return!0;return!1}_clipBox(){return this.pane.chartsBox()}createVisual(){if(this.visual=new P({zIndex:0}),this.shouldClip()){let e=(this.clipBox=this._clipBox()).toRect(),t=N.fromRect(e);_d(t),this.visual.clip(t),this.unclipLabels()}}stackRoot(){return this}unclipLabels(){let{children:e,clipBox:t}=this;for(let n=0;n<e.length;n++){let r=e[n].points||[],i=r.length;for(let e=0;e<i;e++){let n=r[e];if(n&&n.visible!==!1&&n.overlapsBox&&n.overlapsBox(t))if(n.unclipElements)n.unclipElements();else{let{label:e,note:r}=n;e&&e.options.visible&&(e.alignToClipBox&&e.alignToClipBox(t),e.options.noclip=!0),r&&r.options.visible&&(r.options.noclip=!0)}}}}unclipBox(){let{children:e}=this,t=this._clipBox(),n=t.clone();for(let r=0;r<e.length;r++){if(e[r].options.clip===!1)continue;let i=e[r].points||[],a=i.length;for(let e=0;e<a;e++){let r=i[e];if(r&&r.unclipBox&&r.overlapsBox&&r.visible!==!1){if(!r.overlapsBox(t)){r.clipElements&&r.clipElements();continue}let e=r.unclipBox();if(n.overlaps(e)){let t=r.labelBox?r.labelBox():new Z,i=r.noteBox?r.noteBox():new Z,a=Math.max(t.height(),i.height()),o=Math.max(t.width(),i.width());n.wrapLimit(e,o,a)}}}}return n}destroy(){super.destroy(),delete this.parent}};Vv.prototype.isStackRoot=!0;var Hv=class e extends qp{constructor(e){super(e),this.id=Wv(),this.createTitle(),this.content=new Q,this.chartContainer=new Vv({},this),this.append(this.content),this.axes=[],this.charts=[]}createTitle(){let t=this.options.title;Dd(t)&&(t=V({},t,{align:t.position,position:`top`})),this.title=sm.buildTitle(t,e.prototype.options.title),this.title&&this.append(this.title)}appendAxis(e){this.content.append(e),this.axes.push(e),e.pane=this}appendAxisAt(e,t){this.content.append(e),this.axes.splice(t,0,e),e.pane=this}appendChart(e){this.chartContainer.parent!==this.content&&this.content.append(this.chartContainer),this.charts.push(e),this.chartContainer.append(e),e.pane=this}empty(){let e=this.parent;if(e){for(let t=0;t<this.axes.length;t++)e.removeAxis(this.axes[t]);for(let t=0;t<this.charts.length;t++)e.removeChart(this.charts[t])}this.axes=[],this.charts=[],this.content.destroy(),this.content.children=[],this.chartContainer.children=[]}reflow(e){let t;rf(this.children)===this.content&&(t=this.children.pop()),super.reflow(e),t&&this.children.push(t),this.title&&(this.contentBox.y1+=this.title.box.height())}unclipBox(){return this.chartContainer.unclipBox()}visualStyle(){let e=super.visualStyle();return e.zIndex=-10,e}renderComplete(){this.options.visible&&this.createGridLines()}stackRoot(){return this}clipRoot(){return this}createGridLines(){let e=this.axes,t=e.concat(this.parent.axes),n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a.options.vertical,s=o?n:r;for(let e=0;e<t.length;e++)if(s.length===0){let n=t[e];o!==n.options.vertical&&Yd(s,a.createGridLines(n))}}}refresh(){this.visual.clear(),this.content.parent=null,this.content.createGradient=this.createGradient.bind(this),this.content.renderVisual(),this.content.parent=this,this.title&&this.visual.append(this.title.visual),this.visual.append(this.content.visual),this.renderComplete(),this.notifyRender()}chartsBox(){let e=this.axes,t=e.length,n=new Z;for(let r=0;r<t;r++){let t=e[r],i=t.options.vertical?`y`:`x`,a=t.lineBox();n[i+1]=a[i+1],n[i+2]=a[i+2]}if(n.x2===0){let e=this.parent.axes,t=e.length;for(let r=0;r<t;r++){let t=e[r];if(!t.options.vertical){let e=t.lineBox();n.x1=e.x1,n.x2=e.x2}}}return n}clipBox(){return this.chartContainer.clipBox}notifyRender(){let e=this.getService();e&&e.notify(m_,{pane:new f(this),index:this.paneIndex,name:this.options.name})}};let Uv=1;function Wv(){return`pane`+Uv++}Hv.prototype.isStackRoot=!0,J(Hv,{zIndex:-1,shrinkToFit:!0,title:{align:T},visible:!0});let Gv=e=>e.options.visible!==!1;var Kv=class extends Q{constructor(e,t,n){super(t),this.initFields(e,t),this.series=e,this.initSeries(),this.charts=[],this.options.legend=this.options.legend||{},this.options.legend.data=[],this.axes=[],this.crosshairs=[],this.chartService=n,this.originalOptions=t,this.originalSeries=e,this._bindCache=new WeakMap,this.createPanes(),this.render(),this.createCrosshairs()}initFields(){}initSeries(){let e=this.series;for(let t=0;t<e.length;t++)e[t].index=t}bindPoint(e,t,n){let r=this._bindCache.get(e);r||(r=[],this._bindCache.set(e,r));let i=r[t];return i||=r[t]=Y.current.bindPoint(e,t,n),i}createPanes(){let e=this.options.title||{},t=this.options.paneDefaults,n=this.options.panes||[],r=Math.max(n.length,1),i=[],a=V({title:{color:e.color}},t);for(let e=0;e<r;e++){let t=V({},a,n[e]);yd(t.title)&&(t.title=V({text:t.title},a.title));let r=new Hv(t);r.paneIndex=e,i.push(r),this.append(r)}this.panes=i}crosshairOptions(e){return e.options.crosshair}createCrosshairs(e=this.panes){for(let t=0;t<e.length;t++){let n=e[t];for(let e=0;e<n.axes.length;e++){let t=n.axes[e],r=this.crosshairOptions(t);if(r&&r.visible){let e=new Bv(this.chartService,t,r);this.crosshairs.push(e),n.content.append(e)}}}}removeCrosshairs(e){let t=this.crosshairs,n=e.axes;for(let e=t.length-1;e>=0;e--)for(let r=0;r<n.length;r++)if(t[e].axis===n[r]){t.splice(e,1);break}}hideCrosshairs(){let e=this.crosshairs;for(let t=0;t<e.length;t++)e[t].hide()}findPane(e){let t=this.panes,n;for(let r=0;r<t.length;r++)if(t[r].options.name===e){n=t[r];break}return n||t[0]}findPointPane(e){let t=this.panes,n;for(let r=0;r<t.length;r++)if(t[r].box.containsPoint(e)){n=t[r];break}return n}appendAxis(e){this.findPane(e.options.pane).appendAxis(e),this.axes.push(e),e.plotArea=this}removeAxis(e){let t=[];for(let n=0;n<this.axes.length;n++){let r=this.axes[n];e===r?r.destroy():t.push(r)}this.axes=t}appendChart(e,t){this.charts.push(e),t?t.appendChart(e):this.append(e)}removeChart(e){let t=[];for(let n=0;n<this.charts.length;n++){let r=this.charts[n];r===e?r.destroy():t.push(r)}this.charts=t}addToLegend(e){let t=e.length,n=this.options.legend,r=n.labels||{},i=n.inactiveItems||{},a=i.labels||{},o=[];for(let n=0;n<t;n++){let t=e[n],s=t.visible!==!1;if(t.visibleInLegend===!1)continue;let c=t.name,l=s?Pd(r):Pd(a)||Pd(r);l&&(c=l({text:W_(c)?c:``,series:t}));let u=t._defaults,d=t.color;wd(d)&&u&&(d=u.color);let f,p;s?(f={},p=d):(f={color:a.color,font:a.font},p=i.markers.color),W_(c)&&c!==``&&o.push({text:c,labels:f,markerColor:p,series:t,active:s})}Yd(n.data,o)}groupAxes(e){let t=[],n=[];for(let r=0;r<e.length;r++){let i=e[r].axes;for(let e=0;e<i.length;e++){let r=i[e];r.options.vertical?n.push(r):t.push(r)}}return{x:t,y:n,any:t.concat(n)}}groupSeriesByPane(){let e=this.series,t={};for(let n=0;n<e.length;n++){let r=e[n],i=this.seriesPaneName(r);t[i]?t[i].push(r):t[i]=[r]}return t}filterVisibleSeries(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];r.visible!==!1&&t.push(r)}return t}reflow(e){let t=this.options.plotArea,n=this.panes,r=H(t.margin);this.box=e.clone().unpad(r),this.reflowArea(n),this.ensureLabelsFit(n)&&(this.reflowPanes(),this.reflowAxes(n),this.reflowCharts(n))}reflowArea(e){this.reflowPanes(),this.detachLabels(),this.reflowAxes(e),this.reflowCharts(e)}ensureLabelsFit(e){let t=!1;return e.forEach(e=>{let n=e.unclipBox(),r=e.chartContainer._clipBox(),i=H(e.options.padding||{}),a=r.width()+i.left+i.right,o=r.height()+i.top+i.bottom,s=.2,c=!1;if(n.y1<r.y1-i.top){let e=r.y1-n.y1;e<=o*s&&e>i.top&&(c=!0,i.top=e)}if(n.y2>r.y2+i.bottom){let e=n.y2-r.y2;e<=o*s&&e>i.bottom&&(c=!0,i.bottom=e)}if(n.x1<r.x1-i.left){let e=r.x1-n.x1;e<=a*s&&e>i.left&&(c=!0,i.left=e)}if(n.x2>r.x2+i.right){let e=n.x2-r.x2;e<=a*s&&e>i.right&&(c=!0,i.right=e)}c&&(t=!0,e.options.padding=i)}),t}redraw(e){let t=[].concat(e);this.initSeries();let n=this.getRoot();n&&n.cleanGradients();for(let e=0;e<t.length;e++)this.removeCrosshairs(t[e]),t[e].empty();this._bindCache=new WeakMap,this.render(t),this.detachLabels(),this.reflowAxes(this.panes),this.reflowCharts(t),this.createCrosshairs(t);for(let e=0;e<t.length;e++)t[e].refresh()}axisCrossingValues(e,t){let n=e.options,r=[].concat(n.axisCrossingValues||n.axisCrossingValue),i=t.length-r.length,a=r[0]||0;for(let e=0;e<i;e++)r.push(a);return r}alignAxisTo(e,t,n,r){let i=e.getSlot(n,n,!0),a=e.options.reverse?2:1,o=t.getSlot(r,r,!0),s=t.options.reverse?2:1,c=e.box.translate(o[`x`+s]-i[`x`+a],o[`y`+s]-i[`y`+a]);e.pane!==t.pane&&c.translate(0,e.pane.box.y1-t.pane.box.y1),e.reflow(c)}alignAxes(e,t){let n=e[0],r=t[0],i=this.axisCrossingValues(n,t),a=this.axisCrossingValues(r,e),o={},s={},c={},l={};for(let c=0;c<t.length;c++){let l=t[c],u=l.pane,d=u.id,f=l.options.visible!==!1,p=Yv(e,u)||n,m=i;if(p!==n&&(m=this.axisCrossingValues(p,t)),this.alignAxisTo(l,p,a[c],m[c]),l.options._overlap)continue;K(l.lineBox().x1)===K(p.lineBox().x1)&&(o[d]&&l.reflow(l.box.alignTo(o[d].box,T).translate(-l.options.margin,0)),f&&(o[d]=l)),K(l.lineBox().x2)===K(p.lineBox().x2)&&(l._mirrored||=(l.options.labels.mirror=!l.options.labels.mirror,!0),this.alignAxisTo(l,p,a[c],m[c]),s[d]&&l.reflow(l.box.alignTo(s[d].box,O).translate(l.options.margin,0)),f&&(s[d]=l));let h=Yv(t,u)||r;h!==l&&(l.alignTo(h),l.reflow(l.box))}for(let o=0;o<e.length;o++){let s=e[o],u=s.pane,d=u.id,f=s.options.visible!==!1,p=Yv(t,u)||r,m=a;p!==r&&(m=this.axisCrossingValues(p,e)),this.alignAxisTo(s,p,i[o],m[o]),!s.options._overlap&&(K(s.lineBox().y1)===K(p.lineBox().y1)&&(s._mirrored||=(s.options.labels.mirror=!s.options.labels.mirror,!0),this.alignAxisTo(s,p,i[o],m[o]),c[d]&&s.reflow(s.box.alignTo(c[d].box,`top`).translate(0,-s.options.margin)),f&&(c[d]=s)),K(s.lineBox().y2,3)===K(p.lineBox().y2,3)&&(l[d]&&s.reflow(s.box.alignTo(l[d].box,b).translate(0,s.options.margin)),f&&(l[d]=s)),o!==0&&(s.alignTo(n),s.reflow(s.box)))}}shrinkAxisWidth(e){let t=this.groupAxes(e).any,n=Jv(t),r=0;for(let t=0;t<e.length;t++){let i=e[t];i.axes.length>0&&(r=Math.max(r,n.width()-i.contentBox.width()))}if(r!==0)for(let e=0;e<t.length;e++){let n=t[e];n.options.vertical||n.reflow(n.box.shrink(r,0))}}shrinkAxisHeight(e){let t;for(let n=0;n<e.length;n++){let r=e[n],i=r.axes,a=Math.max(0,Jv(i).height()-r.contentBox.height());if(a!==0){for(let e=0;e<i.length;e++){let t=i[e];t.options.vertical&&t.reflow(t.box.shrink(0,a))}t=!0}}return t}fitAxes(e){let t=this.groupAxes(e).any,n=0;for(let t=0;t<e.length;t++){let r=e[t],i=r.axes,a=r.contentBox;if(i.length>0){let e=Jv(i),t=Math.max(a.y1-e.y1,a.y2-e.y2);n=Math.max(n,a.x1-e.x1);for(let e=0;e<i.length;e++){let n=i[e];n.reflow(n.box.translate(0,t))}}}for(let e=0;e<t.length;e++){let r=t[e];r.reflow(r.box.translate(n,0))}}reflowAxes(e){let t=this.groupAxes(e);for(let t=0;t<e.length;t++)this.reflowPaneAxes(e[t]);t.x.length>0&&t.y.length>0&&(this.alignAxes(t.x,t.y),this.shrinkAxisWidth(e),this.autoRotateAxisLabels(t),this.alignAxes(t.x,t.y),this.shrinkAxisWidth(e)&&this.alignAxes(t.x,t.y),this.shrinkAxisHeight(e),this.alignAxes(t.x,t.y),this.shrinkAxisHeight(e)&&this.alignAxes(t.x,t.y),this.fitAxes(e))}autoRotateAxisLabels(e){let{panes:t}=this,n=Zv(t),r;for(let e=0;e<n.length;e++)n[e].autoRotateLabels()&&(r=!0);if(r){for(let e=0;e<t.length;e++)this.reflowPaneAxes(t[e]);e.x.length>0&&e.y.length>0&&(this.alignAxes(e.x,e.y),this.shrinkAxisWidth(t))}}reflowPaneAxes(e){let t=e.axes,n=t.length;if(n>0)for(let r=0;r<n;r++)t[r].reflow(e.contentBox)}reflowCharts(e){let t=this.charts,n=t.length,r=this.box;for(let i=0;i<n;i++){let n=t[i].pane;(!n||U(n,e))&&t[i].reflow(r)}}reflowPanes(){let{box:e,panes:t}=this,n=t.length,r=e.height(),i=0,a=e.y1;for(let a=0;a<n;a++){let n=t[a],o=n.options.height;if(n.options.width=e.width(),!n.options.height)i++;else{if(o.indexOf&&o.indexOf(`%`)){let t=parseInt(o,10)/100;n.options.height=t*e.height()}n.reflow(e.clone()),r-=n.options.height}}for(let e=0;e<n;e++){let n=t[e];n.options.height||(n.options.height=r/i)}for(let r=0;r<n;r++){let n=t[r],i=e.clone().move(e.x1,a);n.reflow(i),a+=n.options.height}}backgroundBox(){let e=this.axes,t=e.length,n;for(let r=0;r<t;r++){let i=e[r];for(let r=0;r<t;r++){let t=e[r];if(i.options.vertical!==t.options.vertical){let e=i.lineBox().clone().wrap(t.lineBox());n=n?n.wrap(e):e}}}return n||this.box}chartsBoxes(){let e=this.panes,t=[];for(let n=0;n<e.length;n++)t.push(e[n].chartsBox());return t}addBackgroundPaths(e){let t=this.chartsBoxes();for(let n=0;n<t.length;n++)e.paths.push(N.fromRect(t[n].toRect()))}backgroundContainsPoint(e){let t=this.chartsBoxes();for(let n=0;n<t.length;n++)if(t[n].containsPoint(e))return!0}createVisual(){super.createVisual();let{opacity:e,background:t,border:n={}}=this.options.plotArea;Xv(t)&&(t=k,e=0);let r=this._bgVisual=new Vr({fill:{color:t,opacity:e},stroke:{color:n.width?n.color:``,width:n.width,dashType:n.dashType},zIndex:-1});this.addBackgroundPaths(r),this.appendVisual(r)}pointsByCategoryIndex(e){let t=this.charts,n=[];if(e!==null)for(let r=0;r<t.length;r++){if(t[r].pane.options.name===`_navigator`)continue;let i=t[r].categoryPoints[e];if(i&&i.length)for(let e=0;e<i.length;e++){let t=i[e];t&&W(t.value)&&t.value!==null&&n.push(t)}}return n}pointsBySeriesIndex(e){return this.filterPoints(function(t){return t.series.index===e})}pointsByPointIndex(e){return this.filterPoints(function(t){return t.getIndex()===e})}pointsBySeriesName(e){return this.filterPoints(function(t){return t.series.name===e})}filterPoints(e){let t=this.charts,n=[];for(let r=0;r<t.length;r++){let i=t[r].points;for(let t=0;t<i.length;t++){let r=i[t];r&&r.visible!==!1&&e(r)&&n.push(r)}}return n}findPoint(e){let t=this.charts;for(let n=0;n<t.length;n++){let r=t[n].points;for(let t=0;t<r.length;t++){let n=r[t];if(n&&n.visible!==!1&&e(n))return n}}}paneByPoint(e){let t=this.panes;for(let n=0;n<t.length;n++){let r=t[n];if(r.box.containsPoint(e))return r}}detachLabels(){let e=this.groupAxes(this.panes),t=e.x,n=e.y;this.detachAxisGroupLabels(n,t),this.detachAxisGroupLabels(t,n)}detachAxisGroupLabels(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r],a=i.pane,o=Yv(t,a)||t[0],s=r+n,c=this.createLabelAxis(i,s,o);if(c){n++;let e=a.axes.indexOf(i)+n;a.appendAxisAt(c,e)}}}createLabelAxis(e,t,n){let r=e.options.labels,i=r.position,a=i!==`end`&&i!==`start`,o=r.visible;if(a||o===!1)return null;let s=this.groupAxes(this.panes),c=n.options.vertical?s.x:s.y,l=this.axisCrossingValues(n,c),u=i===`end`,d=n.range(),f=u?d.max:d.min;if(G(l[t],d.min,d.max)-f===0)return null;l.splice(t+1,0,f),n.options.axisCrossingValues=l;let p=e.clone();return e.clear(),p.options.name=void 0,p.options.line.visible=!1,p.options.crosshair=void 0,p.options.notes=void 0,p.options.plotBands=void 0,p}isTrendline(e){return e&&U(e.type,Gg)}trendlineFactory(){}createTrendlineSeries(){let e=[];return this.series=this.series.map(t=>{if(!this.isTrendline(t))return t;let n=this.seriesByName(t.for);if(!n)throw Error(`Invalid Configuration: Unable to locate linked series "${t.for}" for trendline "${t.name}".`);let r=Y.current.valueFields(n),i=rf(r),a=this.trendlineFactory(Object.assign({},{field:i},t),n);return a&&(n.visible===!1&&(a.visible=!1),a.color===`inherit`&&(a.color=n.color),e.push(a)),a}).filter(e=>e!==null),e}seriesByName(e){return this.series.find(t=>t.name===e)}getFirstPoint(){for(let e=0;e<this.series.length;e++){let t=this.pointsBySeriesIndex(e).find(Gv);if(t)return t}}getPointBelow(e){return this._getNextPoint(e,this._pointsByVertical,1)}getPointAbove(e){return this._getNextPoint(e,this._pointsByVertical,-1)}getPointToTheRight(e){return this._getNextPoint(e,this._pointsByHorizontal,1)}getPointToTheLeft(e){return this._getNextPoint(e,this._pointsByHorizontal,-1)}_getNextPoint(e,t,n){let r=t.call(this,e).filter(Gv),i=r.indexOf(e)+n,a=n=>{let r,i=0;do i+=n,r=t.call(this,e,i).filter(Gv);while(r.length===0);return r};return i<0?(r=a(-1),r.at(-1)):i>=r.length?(r=a(1),r.at(0)):r[i]}_pointsByVertical(e){return this.pointsByPointIndex(e.getIndex())}_pointsByHorizontal(e,t=0){let n=Cd(e.series.index+t,this.series.length);return this.pointsBySeriesIndex(n)}};function qv(e){return!e.pane.axes.some(t=>t.options.vertical===e.options.vertical&&t!==e&&t.options.visible!==!1)}function Jv(e){let t=e.length,n;for(let r=0;r<t;r++){let t=e[r],i=t.options.visible!==!1;if(i||qv(t)){let e=i?t.contentBox():t.lineBox();n?n.wrap(e):n=e.clone()}}return n||new Z}function Yv(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(r&&r.pane===t)return r}}function Xv(e){return e===``||e===null||e===`none`||e===`transparent`||!W(e)}let Zv=e=>e.reduce((e,t)=>e.concat(t.axes),[]);J(Kv,{series:[],plotArea:{margin:{}},background:``,border:{color:y,width:0},paneDefaults:{title:{}},legend:{inactiveItems:{labels:{color:`#919191`},markers:{color:`#919191`}}}});let Qv={hover:function(e,t){this._dispatchEvent(e,t,e_)},click:function(e,t){this._dispatchEvent(e,t,$g)}};var $v=class{constructor(e,t,n){let r=t.canonicalFields(e),i=t.valueFields(e),a=t.sourceFields(e,r),o=this._seriesFields=[],s=n.query(e.type),c=e.aggregate||s;this._series=e,this._binder=t;for(let e=0;e<r.length;e++){let t=r[e],n;if(Dd(c))n=c[t];else if(e===0||U(t,i))n=c;else break;n&&o.push({canonicalName:t,name:a[e],transform:wd(n)?n:Op[n]})}}aggregatePoints(e,t){let{_series:n,_seriesFields:r}=this,i=this._bindPoints(e||[]),a=i.dataItems[0],o=null;if(a&&!B(a)&&!se(a)){let e=function(){};e.prototype=a,o=new e}for(let e=0;e<r.length;e++){let a=r[e],s=this._bindField(i.values,a.canonicalName),c=a.transform(s,n,i.dataItems,t);if(c!==null&&Dd(c)&&c.length===void 0&&!(c instanceof Date)){o=c;break}else c!==void 0&&(o===null&&(o={}),ey(a.name,o,c))}return o}_bindPoints(e){let{_binder:t,_series:n}=this,r=[],i=[];for(let a=0;a<e.length;a++){let o=e[a];r.push(t.bindPoint(n,o)),i.push(n.data[o])}return{values:r,dataItems:i}}_bindField(e,t){let n=[],r=e.length;for(let i=0;i<r;i++){let r=e[i],a=r.valueFields,o;o=a[t]===void 0?r.fields[t]:a[t],n.push(o)}return n}};function ey(e,t,n){let r=t,i=e;if(e.indexOf(`.`)>-1){let t=e.split(`.`);for(;t.length>1;)i=t.shift(),r[i]===void 0&&(r[i]={}),r=r[i];i=t.shift()}r[i]=n}var ty=class{constructor(){this._defaults={}}register(e,t){for(let n=0;n<e.length;n++)this._defaults[e[n]]=t}query(e){return this._defaults[e]}};ty.current=new ty;var ny=class extends yv{createLabel(){let e=this.options.labels,t=V({},e,e.from),n=V({},e,e.to);t.visible&&(this.labelFrom=this.createLabelElement(t),this.append(this.labelFrom)),n.visible&&(this.labelTo=this.createLabelElement(n),this.append(this.labelTo))}reflow(e){this.render();let{labelFrom:t,labelTo:n,value:r}=this;this.box=e,t&&(t.options.aboveAxis=r.from>r.to,t.reflow(e)),n&&(n.options.aboveAxis=r.to>r.from,n.reflow(e)),this.note&&this.note.reflow(e)}};ny.prototype.defaults=V({},ny.prototype.defaults,{labels:{format:`{0} - {1}`},tooltip:{format:`{1}`}});var ry=class extends wv{pointType(){return ny}pointValue(e){return e.valueFields}formatPointValue(e,t){return e.value.from===null&&e.value.to===null?``:this.chartService.format.auto(t,e.value.from,e.value.to)}plotRange(e){return e?[e.value.from,e.value.to]:0}updateRange(e,t){let n=t.series.axis,{from:r,to:i}=e,a=this.valueAxisRanges[n];e!==null&&B(r)&&B(i)&&(a=this.valueAxisRanges[n]=a||{min:E,max:D},a.min=Math.min(a.min,r),a.max=Math.max(a.max,r),a.min=Math.min(a.min,i),a.max=Math.max(a.max,i))}aboveAxis(e){let t=e.value;return t.from<t.to}};ry.prototype.plotLimits=$_.prototype.plotLimits;var iy=class extends nv{aliasFor(){return this.parent}};let ay=`auto`;var oy=class extends Q{constructor(e,t){super(),this.value=e,this.options=t,this.aboveAxis=q(this.options.aboveAxis,!0),this.tooltipTracking=!0,this._id=zf(),this.initLabelsFormat()}render(){if(this._rendered)return;this._rendered=!0;let{markers:e,labels:t}=this.options,n=this.value,r=this.fromPoint=new iy(n,V({},this.options,{labels:t.from,markers:e.from})),i=this.toPoint=new iy(n,V({},this.options,{labels:t.to,markers:e.to}));this.copyFields(r),this.copyFields(i),this.append(r),this.append(i)}reflow(e){this.render();let{from:t,to:n}=e;this.positionLabels(t,n),this.fromPoint.reflow(t),this.toPoint.reflow(n),this.box=this.fromPoint.markerBox().clone().wrap(this.toPoint.markerBox())}createHighlight(){let e=new P;return e.append(this.fromPoint.createHighlight()),e.append(this.toPoint.createHighlight()),e}highlightVisual(){return this.visual}highlightVisualArgs(){return{options:this.options,from:this.fromPoint.highlightVisualArgs(),to:this.toPoint.highlightVisualArgs()}}createFocusHighlight(){let e=new P;return e.append(this.fromPoint.createFocusHighlight()),e.append(this.toPoint.createFocusHighlight()),e}tooltipAnchor(){let e=this.owner.pane.clipBox();if(!e||e.overlaps(this.box)){let e=this.box,t=e.center(),n,r,i;return this.options.vertical?(n=t.x,r=e.y1-5,i=b):(n=e.x2+5,r=t.y,i=x),{point:new X(n,r),align:{horizontal:`left`,vertical:i}}}}formatValue(e){return this.owner.formatPointValue(this,e)}overlapsBox(e){return this.box.overlaps(e)}unclipElements(){this.fromPoint.unclipElements(),this.toPoint.unclipElements()}initLabelsFormat(){let e=this.options.labels;e.format||((!e.from||!e.from.format)&&(e.from=Object.assign({},e.from,{format:`{0}`})),(!e.to||!e.to.format)&&(e.to=Object.assign({},e.to,{format:`{1}`})))}positionLabels(e,t){let{labels:n,vertical:r}=this.options;if(n.position===ay){let i,a;r?t.y1<=e.y1?(a=rg,i=ig):(a=ig,i=rg):t.x1<=e.x1?(a=T,i=O):(a=O,i=T),(!n.from||!n.from.position)&&(this.fromPoint.options.labels.position=i),(!n.to||!n.to.position)&&(this.toPoint.options.labels.position=a)}}copyFields(e){e.dataItem=this.dataItem,e.category=this.category,e.series=this.series,e.color=this.color,e.owner=this.owner}focusVisual(){this.fromPoint.focusVisual()}clearFocusFromVisual(){this.toPoint.clearFocusFromVisual()}getIndex(){return this.categoryIx}getLabelText(e){let t=Pd(e);return t?t(this.pointData()):e.format?this.formatValue(e.format):this.value}getAriaLabelText(){let e=this.options.labels,t=Fd(e);return t?t(this.pointData()):this.getLabelText(e)}pointData(){return{dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,stackValue:this.stackValue,series:this.series}}};V(oy.prototype,ev),V(oy.prototype,tv),oy.prototype.defaults={markers:{visible:!1,background:k,size:8,type:S,border:{width:2},opacity:1},labels:{visible:!1,margin:H(3),padding:H(4),animation:{type:Gh,delay:600},position:ay},notes:{label:{}},highlight:{markers:{border:{color:k,width:2}},zIndex:100},tooltip:{format:`{0} - {1}`},accessibility:{role:h_,className:g_,ariaRoleDescription:__}};var sy=class extends fv{createStrokeSegments(){return this.segmentsFromPoints(this.toGeometryPoints(this.toPoints()))}stackSegments(){let e=this.fromSegments;return this.fromSegments||(e=this.fromSegments=this.segmentsFromPoints(this.toGeometryPoints(this.fromPoints().reverse()))),e}createStroke(e){let t=new N(e),n=new N(e);t.segments.push.apply(t.segments,this.strokeSegments()),n.segments.push.apply(n.segments,this.stackSegments()),this.visual.append(t),this.visual.append(n)}hasStackSegment(){return!0}fromPoints(){return this.linePoints.map(e=>e.fromPoint)}toPoints(){return this.linePoints.map(e=>e.toPoint)}},cy=class extends sy{createStrokeSegments(){return this.createCurveSegments(this.toPoints())}stackSegments(){let e=this.fromSegments;return this.fromSegments||(e=this.fromSegments=this.createCurveSegments(this.fromPoints().reverse())),e}createCurveSegments(e){return new Vh().process(this.toGeometryPoints(e))}},ly=class extends sy{createStrokeSegments(){return this.segmentsFromPoints(this.calculateStepPoints(this.toPoints()))}stackSegments(){let e=this.fromSegments;return this.fromSegments||(e=this.fromSegments=this.segmentsFromPoints(this.calculateStepPoints(this.fromPoints())),e.reverse()),e}};V(ly.prototype,iv);var uy=class extends $_{render(){super.render(),this.renderSegments()}pointType(){return oy}createPoint(e,t){let{series:n,seriesIx:r}=t,i=e.valueFields;if(!W_(i.from)&&!W_(i.to))if(this.seriesMissingValues(n)===`zero`)i={from:0,to:0};else return null;let a=this.pointOptions(n,r);a=this.evalPointOptions(a,i,t);let o=e.fields.color||n.color;wd(n.color)&&(o=a.color);let s=new oy(i,a);return s.color=o,this.append(s),s}createSegment(e,t,n){let r=(t.line||{}).style,i;return i=r===`smooth`?cy:r===`step`?ly:sy,new i(e,t,n)}plotRange(e,t){return e?[e.value.from,e.value.to]:[t,t]}valueSlot(e,t){let n=e.getSlot(t[0],t[0],!this.options.clip),r=e.getSlot(t[1],t[1],!this.options.clip);if(n&&r)return{from:n,to:r}}pointSlot(e,t){let{from:n,to:r}=t,i,a;return this.options.invertAxes?(i=new Z(n.x1,e.y1,n.x2,e.y2),a=new Z(r.x1,e.y1,r.x2,e.y2)):(i=new Z(e.x1,n.y1,e.x2,n.y2),a=new Z(e.x1,r.y1,e.x2,r.y2)),{from:i,to:a}}addValue(e,t){let n=e.valueFields;B(n.from)||(n.from=n.to),B(n.to)||(n.to=n.from),super.addValue(e,t)}updateRange(e,t){if(e!==null&&B(e.from)&&B(e.to)){let n=t.series.axis,r=this.valueAxisRanges[n]=this.valueAxisRanges[n]||{min:E,max:D},{from:i,to:a}=e;r.min=Math.min(r.min,i,a),r.max=Math.max(r.max,i,a)}}formatPointValue(e,t){let n=e.value;return this.chartService.format.auto(t,n.from,n.to)}animationPoints(){let e=this.points,t=[];for(let n=0;n<e.length;n++){let r=e[n];r&&(t.push((r.fromPoint||{}).marker),t.push((r.toPoint||{}).marker))}return t.concat(this._segments)}};V(uy.prototype,cv,uv);var dy=class extends Tv{reflow(e){let{options:t,value:n,owner:r}=this,i=r.seriesValueAxis(t),a=[],o=[],s=[],c=i.getSlot(n.low,n.high),l=i.getSlot(n.open,n.open),u=i.getSlot(n.close,n.close);l.x1=u.x1=c.x1=e.x1,l.x2=u.x2=c.x2=e.x2;let d=c.center().x;a.push([l.x1,l.y1]),a.push([d,l.y1]),o.push([d,u.y1]),o.push([u.x2,u.y1]),s.push([d,c.y1]),s.push([d,c.y2]),this.lines=[a,o,s],this.box=c.clone().wrap(l.clone().wrap(u)),this.reflowNote()}createBody(){}},fy=class extends Ev{pointType(){return dy}},py=class extends Q{constructor(e,t,n){super(),this.from=e,this.to=t,this.series=n}linePoints(){let e=this.from,{from:{box:t},to:{box:n}}=this,r=[];if(e.isVertical){let i=e.aboveAxis?t.y1:t.y2;r.push([t.x1,i],[n.x2,i])}else{let i=e.aboveAxis?t.x2:t.x1;r.push([i,t.y1],[i,n.y2])}return r}createVisual(){super.createVisual();let e=this.series.line||{},t=N.fromPoints(this.linePoints(),{stroke:{color:e.color,width:e.width,opacity:e.opacity,dashType:e.dashType}});_d(t),this.visual.append(t)}};J(py,{animation:{type:Gh,delay:600}});var my=class extends wv{render(){super.render(),this.createSegments()}traverseDataPoints(e){let t=this.options.series,n=L_(t),r=!this.options.invertAxes;for(let i=0;i<t.length;i++){let a=t[i],o=0,s=0;for(let t=0;t<n;t++){let n=Y.current.bindPoint(a,t),c=n.valueFields.value,l=n.fields.summary,u=o,d;l?l.toLowerCase()===`total`?(n.valueFields.value=o,u=0,d=o):(n.valueFields.value=s,d=u-s,s=0):B(c)&&(s+=c,o+=c,d=o),e(n,{category:this.categoryAxis.categoryAt(t),categoryIx:t,series:a,seriesIx:i,total:o,runningTotal:s,from:u,to:d,isVertical:r})}}}updateRange(e,t){super.updateRange({value:t.to},t)}aboveAxis(e){return e.value>=0}plotRange(e){return[e.from,e.to]}createSegments(){let e=this.options.series,t=this.seriesPoints,n=this.segments=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r];if(a){let e;for(let t=0;t<a.length;t++){let r=a[t];if(r&&e){let t=new py(e,r,i);n.push(t),this.append(t)}e=r}}}}};function hy(e,t,n){let r=e[String(t)];return r?r(n):null}function gy(e,t){let n=0,r=0,i=0,a=0,o=0,s,c,l=Number.MAX_VALUE,u=Number.MIN_VALUE;for(let s=0;s<e.length;s++){let c=e[s],{xValue:d,yValue:f}=t(c);isFinite(d)&&d!==null&&isFinite(f)&&f!==null&&(l=Math.min(d,l),u=Math.max(d,u),o++,n+=d,r+=f,i+=d**2,a+=d*f)}return o>0&&(s=(o*a-n*r)/(o*i-n**2),c=(r-s*n)/o),{slope:s,intercept:c,count:o,xMin:l,xMax:u}}let _y=(e,t)=>e.every(({valueFields:e})=>!W_(e[t])||e[t]>0);function vy(e,t){let n=[],r=t.totalRangeIndices(),i=t.currentRangeIndices(),a={min:Math.floor(Math.max(i.min-1,r.min)),max:Math.ceil(Math.min(i.max+2,r.max))};for(let r=a.min;r<a.max;r++){let i=r+1;n[r]={category:t.categoryAt(r,!0),value:e(i)}}return n}function yy(e){let{options:t,categoryAxis:n,seriesValues:r}=e,i=xy({seriesValues:r,categoryAxis:n,options:t});return i?Object.assign({},t,{type:`line`,data:i,categoryField:`category`,field:`value`}):null}let by=e=>({categoryIx:t,valueFields:n})=>({xValue:t+1,yValue:Math.log(n[e])});function xy({seriesValues:e,categoryAxis:t,options:n}){let r=e();if(!_y(r,n.field))return null;let{slope:i,intercept:a,count:o}=gy(r,by(n.field));if(o>0){let e=Math.exp(a),n=i;return vy(t=>e*Math.exp(n*t),t)}return null}function Sy(e){let{options:t,categoryAxis:n,seriesValues:r}=e,i=wy({seriesValues:r,categoryAxis:n,options:t});return i?Object.assign({},t,{type:`line`,data:i,categoryField:`category`,field:`value`}):null}let Cy=e=>({categoryIx:t,valueFields:n})=>({xValue:t+1,yValue:n[e]});function wy({seriesValues:e,categoryAxis:t,options:n}){let{slope:r,intercept:i,count:a}=gy(e(),Cy(n.field));return a>0?vy(e=>r*e+i,t):null}function Ty(e){let{options:t,categoryAxis:n,seriesValues:r}=e,i=Dy({seriesValues:r,categoryAxis:n,options:t});return i?Object.assign({},t,{type:`line`,data:i,categoryField:`category`,field:`value`}):null}let Ey=e=>({categoryIx:t,valueFields:n})=>({xValue:Math.log(t+1),yValue:n[e]});function Dy({seriesValues:e,categoryAxis:t,options:n}){let{slope:r,intercept:i,count:a}=gy(e(),Ey(n.field));if(a>0){let e=r,n=i;return vy(t=>e*Math.log(t)+n,t)}return null}function Oy(e,t,n){let r=[],i=[],a=Math.max(2,n)-1,o=0,s=0;for(let n=0;n<e.length;n++){let c=e[n],{xValue:l,yValue:u}=t(c);if(isFinite(u)&&u!==null?(i.push(u),s+=u,o=Math.max(n,o)):i.push(null),n>=a){let e=i.filter(e=>e!==null).length,t=i.shift()||0;if(e>0){let n=s/e;r.push([l,n]),s-=t;continue}}r.push([l,null])}return r.slice(0,o+1)}function ky(e){let{options:t}=e,n=My(e);return n?Object.assign({},t,{type:`line`,data:n,categoryField:`category`,field:`value`}):null}let Ay=e=>({categoryIx:t,valueFields:n})=>({xValue:t,yValue:n[e]});function jy({options:e,categoryAxis:t,seriesValues:n}){let r=(e.trendline||{}).period||2,i=t.totalRangeIndices(),a=t.currentRangeIndices();return Oy(n({min:Math.floor(Math.max(a.min-r,i.min)),max:Math.ceil(Math.min(a.max+r+2,i.max))}),Ay(e.field),r)}function My(e){let{categoryAxis:t}=e,n=jy(e),r=[];return n.forEach(([e,n])=>{r[e]={category:t.categoryAt(e,!0),value:n}}),r.length>0?r:null}function Ny(e,t,n){let r=Math.min(Math.max(n||1,1),6)+1,i=new Mf,a=new Mf,o=0,s=Number.MAX_VALUE,c=Number.MIN_VALUE,l=e=>e,u=[];for(let n=0;n<e.length;n++){let l=e[n],{xValue:u,yValue:d}=t(l);if(isFinite(u)&&u!==null&&isFinite(d)&&d!==null){s=Math.min(u,s),c=Math.max(u,c),o++,a.set(n,0,d),i.set(n,0,1),i.set(n,1,u);for(let e=2;e<=r;e++)i.set(n,e,i.get(n,1)**+e)}else i.set(n,0,0)}return i.width=Math.min(r,o),o>0&&(u=Py(i,a),l=e=>u.reduce((t,n,r)=>t+n*e**+r,0)),{coefficients:u,count:o,valueMapper:l,xMin:s,xMax:c}}function Py(e,t){let n=e.transpose(),r=n.multiply(e).inverse().multiply(n).multiply(t),i=[];for(let e=0;e<r.height;e++)i.push(r.get(e,0));return i}function Fy(e){let{options:t,categoryAxis:n,seriesValues:r}=e,i=Ly({seriesValues:r,categoryAxis:n,options:t});return i?Object.assign({},t,{type:`line`,data:i,categoryField:`category`,field:`value`}):null}let Iy=e=>({categoryIx:t,valueFields:n})=>({xValue:t+1,yValue:n[e]});function Ly({seriesValues:e,categoryAxis:t,options:n}){let r=(n.trendline||{}).order,{count:i,valueMapper:a}=Ny(e(),Iy(n.field),r);return i>0?vy(e=>a(e),t):null}function Ry(e){let{options:t,categoryAxis:n,seriesValues:r}=e,i=By({seriesValues:r,categoryAxis:n,options:t});return i?Object.assign({},t,{type:`line`,data:i,categoryField:`category`,field:`value`}):null}let zy=e=>({categoryIx:t,valueFields:n})=>({xValue:Math.log(t+1),yValue:Math.log(n[e])});function By({seriesValues:e,categoryAxis:t,options:n}){let r=e();if(!_y(r,n.field))return null;let{slope:i,intercept:a,count:o}=gy(r,zy(n.field));if(o>0){let e=Math.exp(a),n=i;return vy(t=>e*t**+n,t)}return null}let Vy={};Vy[zg]=yy,Vy[Bg]=Sy,Vy[Vg]=Ty,Vy[Hg]=ky,Vy[Ug]=Fy,Vy[Wg]=Ry;let Hy=[cg,Mg,Dg,Ig],Uy=[yg,Fg].concat(Hy);var Wy=class extends Kv{initFields(e){if(this.namedCategoryAxes={},this.namedValueAxes={},this.valueAxisRangeTracker=new gv,this._seriesPointsCache={},this._currentPointsCache={},e.length>0){this.invertAxes=U(e[0].type,[`bar`,dg,Fg,Mg,Ig,Og,vg,Ng]);for(let t=0;t<e.length;t++){let n=e[t].stack;if(n&&n.type===`100%`){this.stack100=!0;break}}}}render(e=this.panes){this.series=[...this.originalSeries],this.createCategoryAxes(e),this.aggregateCategories(e),this.createTrendlineSeries(e),this.createCategoryAxesLabels(e),this.createCharts(e),this.createValueAxes(e)}removeAxis(e){let t=e.options.name;super.removeAxis(e),e instanceof eh?delete this.namedCategoryAxes[t]:(this.valueAxisRangeTracker.reset(t),delete this.namedValueAxes[t]),e===this.categoryAxis&&delete this.categoryAxis,e===this.valueAxis&&delete this.valueAxis}trendlineFactory(e,t){let n=this.seriesCategoryAxis(e),r=this.seriesValues.bind(this,t.index),i=hy(Vy,e.type,{options:e,categoryAxis:n,seriesValues:r});return i&&(i.categoryAxis=t.categoryAxis,i.valueAxis=t.valueAxis,this.filterSeries(i,n))}trendlineAggregateForecast(){return this.series.map(e=>(e.trendline||{}).forecast).filter(e=>e!==void 0).reduce((e,t)=>({before:Math.max(e.before,t.before||0),after:Math.max(e.after,t.after||0)}),{before:0,after:0})}seriesValues(e,t){let n=[],r=this.srcSeries[e],i=this.seriesCategoryAxis(r);R_(i.options.type,ee)&&(this._seriesPointsCache={},this._currentPointsCache={},i.options.dataItems=[],r=this.aggregateSeries(r,i));let a=t?t.min:0,o=t?t.max:r.data.length;for(let e=a;e<o;e++){let t=this.bindPoint(r,e);n.push({categoryIx:e,category:t.fields.category,valueFields:t.valueFields})}return n}createCharts(e){let t=this.groupSeriesByPane();for(let n=0;n<e.length;n++){let r=e[n],i=t[r.options.name||`default`]||[];this.addToLegend(i);let a=this.filterVisibleSeries(i);if(!a)continue;let o=this.groupSeriesByCategoryAxis(a);for(let e=0;e<o.length;e++)this.createChartGroup(o[e],r)}}createChartGroup(e,t){this.createAreaChart(B_(e,[cg,Mg]),t),this.createRangeAreaChart(B_(e,[Dg,Ig]),t),this.createBarChart(B_(e,[pg,`bar`]),t),this.createRangeBarChart(B_(e,[kg,Og]),t),this.createBulletChart(B_(e,[dg,Pg]),t),this.createCandlestickChart(B_(e,fg),t),this.createBoxPlotChart(B_(e,[lg,Ng]),t),this.createOHLCChart(B_(e,bg),t),this.createWaterfallChart(B_(e,[Lg,vg]),t),this.createLineChart(B_(e,[yg,Fg]),t)}aggregateCategories(e){let t=[...this.series],n=[];this._currentPointsCache={},this._seriesPointsCache=this._seriesPointsCache||{};for(let r=0;r<t.length;r++){let i=t[r];if(!this.isTrendline(i)){let t=this.seriesCategoryAxis(i),n=this.findPane(t.options.pane);i=(R_(t.options.type,ee)||i.categoryField)&&U(n,e)?this.aggregateSeries(i,t,t.currentRangeIndices()):this.filterSeries(i,t)}n.push(i)}this._seriesPointsCache=this._currentPointsCache,this._currentPointsCache=null,this.srcSeries=t,this.series=n}filterSeries(e,t){let n=(e.data||{}).length;if(t._seriesMax=Math.max(t._seriesMax||0,n),!(W(t.options.min)||W(t.options.max)))return e;let r=t.currentRangeIndices(),i=U(e.type,Uy),a=V({},e);return a.data=(a.data||[]).slice(r.min,r.max+1),i&&Z_(a,r,n,n=>({item:e.data[n],category:t.categoryAt(n,!0),categoryIx:n-r.min}),t=>W(e.data[t])),a}clearSeriesPointsCache(){this._seriesPointsCache={}}seriesSourcePoints(e,t){let n=`${e.index};${t.categoriesHash()}`;if(this._seriesPointsCache&&this._seriesPointsCache[n])return this._currentPointsCache[n]=this._seriesPointsCache[n],this._seriesPointsCache[n];let r=t.options,i=r.srcCategories,a=R_(r.type,ee),o=e.data,s=[];a||t.indexCategories();for(let n=0;n<o.length;n++){let r=Y.current.bindPoint(e,n).fields.category;if(a&&(r=H_(r,o[n],this.chartService.intl)),r===void 0&&(r=i[n]),r!=null){let e=t.totalIndex(r);s[e]=s[e]||{items:[],category:r},s[e].items.push(n)}}return this._currentPointsCache[n]=s,s}aggregateSeries(e,t,n=null){if(!e.data.length)return e;let r=this.seriesSourcePoints(e,t),i=V({},e),a=new $v(V({},e),Y.current,ty.current),o=i.data=[],s=t.options.dataItems||[],c=n||{min:0,max:r.length-1},l=e=>{let n=e-c.min,i=r[e];if(i||=r[e]={},i.categoryIx=n,!i.item){let n=t.categoryAt(e,!0);i.category=n,i.item=a.aggregatePoints(i.items,n)}return i};for(let e=c.min;e<=c.max;e++){let t=l(e);o[t.categoryIx]=t.item,t.items&&t.items.length&&(s[t.categoryIx]=t.item)}return U(i.type,Uy)&&Z_(i,c,t.totalCount(),l,e=>r[e]),t.options.dataItems=s,i}appendChart(e,t){let n=e.options.series,r=this.seriesCategoryAxis(n[0]),i=r.options.categories,a=Math.max(0,L_(n)-i.length);if(a>0)for(i=r.options.categories=r.options.categories.slice(0);a--;)i.push(``);this.valueAxisRangeTracker.update(e.valueAxisRanges),super.appendChart(e,t)}seriesPaneName(e){let t=this.options,n=e.axis,r=[].concat(t.valueAxis),i=zd(r,function(e){return e.name===n})[0],a=((t.panes||[{}])[0]||{}).name||`default`;return(i||{}).pane||a}seriesCategoryAxis(e){let t=e.categoryAxis,n=t?this.namedCategoryAxes[t]:this.categoryAxis;if(!n)throw Error(`Unable to locate category axis with name `+t);return n}stackableChartOptions(e,t){let n=e.some(e=>e.stack),r=e.some(e=>e.stack&&e.stack.type===`100%`),i=t.options.clip;return{defaultStack:e[0].stack,isStacked:n,isStacked100:r,clip:i}}groupSeriesByCategoryAxis(e){let t=[],n={};for(let r=0;r<e.length;r++){let i=e[r].categoryAxis||`$$default$$`;jf(n,i)||(n[i]=!0,t.push(i))}let r=[];for(let n=0;n<t.length;n++){let i=t[n],a=Ky(e,i,n);a.length!==0&&r.push(a)}return r}createBarChart(e,t){if(e.length===0)return;let n=e[0],r=new wv(this,Object.assign({series:e,invertAxes:this.invertAxes,gap:n.gap,spacing:n.spacing},this.stackableChartOptions(e,t)));this.appendChart(r,t)}createRangeBarChart(e,t){if(e.length===0)return;let n=e[0],r=new ry(this,{series:e,invertAxes:this.invertAxes,gap:n.gap,spacing:n.spacing});this.appendChart(r,t)}createBulletChart(e,t){if(e.length===0)return;let n=e[0],r=new Iv(this,{series:e,invertAxes:this.invertAxes,gap:n.gap,spacing:n.spacing,clip:t.options.clip});this.appendChart(r,t)}createLineChart(e,t){if(e.length===0)return;let n=new dv(this,Object.assign({invertAxes:this.invertAxes,series:e},this.stackableChartOptions(e,t)));this.appendChart(n,t)}createAreaChart(e,t){if(e.length===0)return;let n=new hv(this,Object.assign({invertAxes:this.invertAxes,series:e},this.stackableChartOptions(e,t)));this.appendChart(n,t)}createRangeAreaChart(e,t){if(e.length===0)return;let n=new uy(this,{invertAxes:this.invertAxes,series:e,clip:t.options.clip});this.appendChart(n,t)}createOHLCChart(e,t){if(e.length===0)return;let n=e[0],r=new fy(this,{invertAxes:this.invertAxes,gap:n.gap,series:e,spacing:n.spacing,clip:t.options.clip});this.appendChart(r,t)}createCandlestickChart(e,t){if(e.length===0)return;let n=e[0],r=new Ev(this,{invertAxes:this.invertAxes,gap:n.gap,series:e,spacing:n.spacing,clip:t.options.clip});this.appendChart(r,t)}createBoxPlotChart(e,t){if(e.length===0)return;let n=e[0],r=new kv(this,{invertAxes:this.invertAxes,gap:n.gap,series:e,spacing:n.spacing,clip:t.options.clip});this.appendChart(r,t)}createWaterfallChart(e,t){if(e.length===0)return;let n=e[0],r=new my(this,{series:e,invertAxes:this.invertAxes,gap:n.gap,spacing:n.spacing});this.appendChart(r,t)}axisRequiresRounding(e,t){let n=B_(this.series,Rg);for(let e=0;e<this.series.length;e++){let t=this.series[e];if(U(t.type,Hy)){let e=t.line;e&&e.style===`step`&&n.push(t)}}for(let r=0;r<n.length;r++){let i=n[r].categoryAxis||``;if(i===e||!i&&t===0)return!0}}aggregatedAxis(e,t){let n=this.series;for(let r=0;r<n.length;r++){let i=n[r].categoryAxis||``;if((i===e||!i&&t===0)&&n[r].categoryField)return!0}}createCategoryAxesLabels(){let e=this.axes;for(let t=0;t<e.length;t++)e[t]instanceof eh&&e[t].createLabels()}createCategoryAxes(e){let t=this.invertAxes,n=[].concat(this.options.categoryAxis),r=[];for(let i=0;i<n.length;i++){let a=n[i];if(U(this.findPane(a.pane),e)){let{name:e,categories:o=[]}=a;a=V({vertical:t,reverse:!t&&this.chartService.rtl,axisCrossingValue:t?E:0},a),W(a.justified)||(a.justified=this.isJustified()),this.axisRequiresRounding(e,i)&&(a.justified=!1);let s;if(G_(a,o[0])?(a._forecast=this.trendlineAggregateForecast(),s=new lh(a,this.chartService)):s=new eh(a,this.chartService),n[i].categories=s.options.srcCategories,e){if(this.namedCategoryAxes[e])throw Error(`Category axis with name ${e} is already defined`);this.namedCategoryAxes[e]=s}s.axisIndex=i,r.push(s),this.appendAxis(s)}}let i=this.categoryAxis||r[0];this.categoryAxis=i,t?this.axisY=i:this.axisX=i}isJustified(){let e=this.series;for(let t=0;t<e.length;t++){let n=e[t];if(!U(n.type,Hy))return!1}return!0}createValueAxes(e){let t=this.valueAxisRangeTracker,n=t.query(),r=[].concat(this.options.valueAxis),i=this.invertAxes,a={vertical:!i,reverse:i&&this.chartService.rtl},o=[];this.stack100&&(a.roundToMajorUnit=!1,a.labels={format:`P0`});for(let i=0;i<r.length;i++){let s=r[i];if(U(this.findPane(s.pane),e)){let e=s.name,r=R_(s.type,`log`)?{min:.1,max:1}:{min:0,max:1},c=t.query(e)||n||r;i===0&&c&&n&&(c.min=Math.min(c.min,n.min),c.max=Math.max(c.max,n.max));let l;l=R_(s.type,`log`)?Dh:gh;let u=new l(c.min,c.max,V({},a,s),this.chartService);if(e){if(this.namedValueAxes[e])throw Error(`Value axis with name ${e} is already defined`);this.namedValueAxes[e]=u}u.axisIndex=i,o.push(u),this.appendAxis(u)}}let s=this.valueAxis||o[0];this.valueAxis=s,i?this.axisX=s:this.axisY=s}_dispatchEvent(e,t,n){let r=e._eventCoordinates(t),i=new X(r.x,r.y),a=this.pointPane(i),o=[],s=[];if(!a)return;let c=a.axes;for(let e=0;e<c.length;e++){let t=c[e];t.getValue?N_(s,t.getValue(i)):N_(o,t.getCategory(i))}o.length===0&&N_(o,this.categoryAxis.getCategory(i)),o.length>0&&s.length>0&&e.trigger(n,{element:tf(t),originalEvent:t,category:K_(o),value:K_(s)})}pointPane(e){let t=this.panes;for(let n=0;n<t.length;n++){let r=t[n];if(r.contentBox.containsPoint(e))return r}}updateAxisOptions(e,t){Gy(this.options,e,t),Gy(this.originalOptions,e,t)}_pointsByVertical(e,t=0){return this.invertAxes?this._siblingsBySeriesIndex(e.series.index,t):this._siblingsByPointIndex(e.getIndex())}_pointsByHorizontal(e,t=0){if(this.invertAxes)return this._siblingsByPointIndex(e.getIndex());let n=this._siblingsBySeriesIndex(e.series.index,t);return this.chartService.rtl?n.reverse():n}_siblingsByPointIndex(e){let t=this.charts,n=[];for(let r=0;r<t.length;r++){let i=t[r];if(i.pane&&i.pane.options.name===`_navigator`)continue;let a=i.points.filter(t=>t&&t.visible!==!1&&t.getIndex()===e);n.push(...a.sort(this._getSeriesCompareFn(a[0])))}return n}_siblingsBySeriesIndex(e,t){let n=Cd(e+t,this.series.length);return this.pointsBySeriesIndex(n)}_getSeriesCompareFn(e){let t=this._isInStackedSeries(e);return t&&this.invertAxes||!t&&!this.invertAxes?(e,t)=>e.box.center().x-t.box.center().x:(e,t)=>e.box.center().y-t.box.center().y}_isInStackedSeries(e){let t=U(e.series.type,[cg,Mg,Dg,Ig,yg,Fg,Eg,wg]),n=U(e.series.type,[pg,`bar`]);return t||n&&e.options.isStacked}categoryAxisByPoint(e){let t=this.axes,n;for(let r=0;r<t.length;r++){let i=t[r];if(i instanceof eh&&i.pane.chartsBox().containsPoint(e)){n=i;break}}return n}};function Gy(e,t,n){V((t instanceof eh?[].concat(e.categoryAxis):[].concat(e.valueAxis))[t.axisIndex],n)}function Ky(e,t,n){return zd(e,function(e){return n===0&&!e.categoryAxis||e.categoryAxis===t})}J(Wy,{categoryAxis:{},valueAxis:{}}),V(Wy.prototype,Qv);var qy=class{constructor(){this._points=[]}destroy(){this._points=[]}show(e,t){let n=[].concat(e);this.hide();for(let e=0;e<n.length;e++){let r=n[e];r&&r.toggleHighlight&&r.hasHighlight()&&(this.togglePointHighlight(r,!0,t),this._points.push(r))}}togglePointHighlight(e,t,n){let r=(e.options.highlight||{}).toggle,i=e.options.highlight||{},a=n===void 0?i.inactiveOpacity:n;if(r){let n={category:e.category,series:e.series,dataItem:e.dataItem,value:e.value,stackValue:e.stackValue,preventDefault:Jy,visual:e.highlightVisual(),show:t};r(n),n._defaultPrevented||e.toggleHighlight(t,a)}else e.toggleHighlight(t,a)}hide(){let e=this._points;for(;e.length;){let t=e.pop(),n=t.options.highlight||{};this.togglePointHighlight(t,!1,n.inactiveOpacity)}}isHighlighted(e){let t=this._points;for(let n=0;n<t.length;n++)if(e===t[n])return!0;return!1}};function Jy(){this._defaultPrevented=!0}function Yy(e,t){let n=(t||``).toLowerCase(),r=e.event;return n===`none`&&!(r.ctrlKey||r.shiftKey||r.altKey)||r[n+`Key`]}function Xy(e){let t={};for(let n=0;n<e.length;n++){let r=e[n];r.axis.options.name&&(t[r.axis.options.name]={min:r.range.min,max:r.range.max})}return t}var Zy=class{constructor(e,t){this.plotArea=e,this.options=V({},this.options,t)}start(e){return this._active=Yy(e,this.options.key),this._active}move(e){if(this._active){let t=this.axisRanges=this._panAxes(e,`x`).concat(this._panAxes(e,`y`));if(t.length)return this.axisRanges=t,Xy(t)}}end(){let e=this._active;return this._active=!1,e}pan(){let{plotArea:e,axisRanges:t}=this;if(t.length){for(let n=0;n<t.length;n++){let r=t[n];e.updateAxisOptions(r.axis,r.range)}e.redraw(e.panes)}}destroy(){delete this.plotArea}_panAxes(e,t){let n=this.plotArea,r=-e[t].delta,i=(this.options.lock||``).toLowerCase(),a=[];if(r!==0&&(i||``).toLowerCase()!==t){let e=n.axes;for(let n=0;n<e.length;n++){let i=e[n];if(t===`x`&&!i.options.vertical||t===`y`&&i.options.vertical){let e=i.pan(r);e&&(e.limitRange=!0,a.push({axis:i,range:e}))}}}return a}};Zy.prototype.options={key:`none`,lock:`none`};var Qy=class{constructor(e,t){this.chart=e,this.options=V({},this.options,t),this.createElement()}createElement(){let e=this._marquee=document.createElement(`div`);e.className=`k-marquee`;let t=document.createElement(`div`);t.className=`k-marquee-color`,e.appendChild(t)}removeElement(){this._marquee.parentNode&&this._marquee.parentNode.removeChild(this._marquee)}setStyles(e){jd(this._marquee,e)}start(e){if(Yy(e,this.options.key)){let t=this.chart,n=t._eventCoordinates(e),r=this._zoomPane=t._plotArea.paneByPoint(n),i=r?r.chartsBox().clone():null;if(r&&i){let t=this._elementOffset();return i.translate(t.left,t.top),this._zoomPaneClipBox=i,document.body.appendChild(this._marquee),this.setStyles({left:e.pageX+1,top:e.pageY+1,width:0,height:0}),!0}}return!1}_elementOffset(){let e=this.chart.element,{paddingLeft:t,paddingTop:n}=jd(e,[`paddingLeft`,`paddingTop`]),r=Qd(e);return{left:t+r.left,top:n+r.top}}move(e){this._zoomPane&&this.setStyles(this._selectionPosition(e))}end(e){if(this._zoomPane){let t=this._elementOffset(),n=this._selectionPosition(e);n.left-=t.left,n.top-=t.top;let r={x:n.left,y:n.top},i={x:n.left+n.width,y:n.top+n.height};return this._updateAxisRanges(r,i),this.removeElement(),delete this._zoomPane,Xy(this.axisRanges)}}zoom(){let e=this.axisRanges;if(e&&e.length){let t=this.chart._plotArea;for(let n=0;n<e.length;n++){let r=e[n];t.updateAxisOptions(r.axis,r.range)}t.redraw(t.panes)}}destroy(){this.removeElement(),delete this._marquee,delete this.chart}_updateAxisRanges(e,t){let n=(this.options.lock||``).toLowerCase(),r=[],i=this._zoomPane.axes;for(let a=0;a<i.length;a++){let o=i[a],s=o.options.vertical;if(!(n===`x`&&!s)&&!(n===`y`&&s)&&W(o.axisIndex)){let n=o.pointsRange(e,t);n&&r.push({axis:o,range:n})}}this.axisRanges=r}_selectionPosition(e){let t=this._zoomPaneClipBox,n={x:e.x.startLocation,y:e.y.startLocation},{x:{location:r},y:{location:i}}=e,a=(this.options.lock||``).toLowerCase(),o=Math.min(n.x,r),s=Math.min(n.y,i),c=Math.abs(n.x-r),l=Math.abs(n.y-i);return a===`x`&&(o=t.x1,c=t.width()),a===`y`&&(s=t.y1,l=t.height()),r>t.x2&&(c=t.x2-n.x),r<t.x1&&(c=n.x-t.x1),i>t.y2&&(l=t.y2-n.y),i<t.y1&&(l=n.y-t.y1),{left:Math.max(o,t.x1),top:Math.max(s,t.y1),width:c,height:l}}};Qy.prototype.options={key:`shift`,lock:`none`};var $y=class{constructor(e,t){this.chart=e,this.options=V({rate:.3},this.options,t)}updateRanges(e,t){let n=(this.options.lock||``).toLowerCase(),r=[],i=this.chart._plotArea.axes;for(let a=0;a<i.length;a++){let o=i[a],s=o.options.vertical;if(!(n===`x`&&!s)&&!(n===`y`&&s)&&o.zoomRange){let n=G(this.options.rate,.01,.9),i=o.zoomRange(-e*n,t);i&&r.push({axis:o,range:i})}}return this.axisRanges=r,Xy(r)}zoom(){let e=this.axisRanges,t=this.chart._plotArea;if(e&&e.length&&t.updateAxisOptions){for(let n=0;n<e.length;n++){let r=e[n];t.updateAxisOptions(r.axis,r.range)}t.redraw(t.panes)}}destroy(){delete this.chart}};let eb=e=>e?`end`:`start`;var tb=class extends Q{constructor(e,t){super(e),this.chartService=t}render(){let{children:e,options:t}=this,n=t.vertical;this.visual=new Qr(null,{spacing:n?0:t.spacing,lineSpacing:n?t.spacing:0,orientation:n?`vertical`:`horizontal`,reverse:t.rtl,alignItems:n?eb(t.rtl):x});for(let t=0;t<e.length;t++){let n=e[t];n.reflow(new Z),n.renderVisual()}}reflow(e){this.visual.rect(e.toRect()),this.visual.reflow();let t=this.visual.clippedBBox();t?this.box=im(t):this.box=new Z}renderVisual(){this.addVisual()}createVisual(){}},nb=class extends Yp{visualStyle(){let e=this.markerOptions(),t=e.border;return{stroke:{width:t.width,color:t.color,opacity:q(t.opacity,e.opacity),dashType:t.dashType},fill:{color:e.background,opacity:e.opacity},cursor:e.cursor}}markerOptions(){return this.options}markerHighlightOptions(){let e=this.markerOptions(),t=e.highlight.border.width;return V({},e,{background:e.border.color},e.highlight,e.type===`cross`?{background:e.highlight.border.color,border:{color:e.highlight.background,width:t/2},width:e.width,height:e.height,margin:{top:0,left:0}}:{})}createHighlight(){let e=new Yp(this.markerHighlightOptions()),t=this.paddingBox.clone();return e.reflow(t.pad(e.options.border.width)),this.highlight=[e.getElement()],this.highlight}};J(nb,{border:{width:2},width:8,height:8,background:k,margin:{top:-1,left:-1},vAlign:`top`,align:T,highlight:{width:10,height:10,border:{color:k,width:2}}});var rb=class extends Yp{getElement(){let e=new P,t=new Vr(this.visualStyle()),{paddingBox:n}=this,r=n.height()/2;return t.moveTo(n.x1,n.y1+r).lineTo(n.x1,n.y2).lineTo(n.x2,n.y2),e.append(t),e}};J(rb,{width:15,height:15,align:O,vAlign:b,margin:{right:-2,bottom:2}});var ib=class extends Yp{getElement(){let e=new P,t=new Vr({stroke:{color:this.options.border.color,opacity:this.options.opacity,width:this.options.height,dashType:this.options.dashType}}),n=this.paddingBox,r=n.center().y;return t.moveTo(n.x1,r).lineTo(n.x2,r),e.append(t),e}createHighlight(){return this.highlight=[this.createHighlightLine(),this.createHighlightMarker()],this.highlight}createHighlightLine(){let e=new rb(V({},{border:{color:this.options.border.color,opacity:this.options.border.opacity,dashType:this.options.border.dashType}},this.options.highlight));return e.reflow(this.parent.paddingBox.clone()),this.highlightLine=e.getElement(),this.highlightLine}createHighlightMarker(){let e=V({},{background:this.options.background},this.options.highlight.markers),t=new Yp(e),n=this.parent.paddingBox,r=e.border.width,i=this.parent.box.clone();return i.pad({left:r-n.x1,top:r-n.y1}),t.reflow(i),this.highlightMarker=t.getElement(),this.highlightMarker}};J(ib,{border:{width:0},type:`rect`,align:T,vAlign:x,highlight:{border:{width:2},markers:{type:S,width:10,height:10,border:{width:2,color:k},align:T,vAlign:`top`}}});var ab=class extends Yp{createHighlight(){let e=new Yp(V({},{background:this.options.background},this.options.highlight.markers)),t=this.paddingBox.clone(),n=this.parent.box.clone();return t.align(n,`x`,T),t.align(n,`y`,`top`),e.reflow(t),this.highlight=[e.getElement()],this.highlight}};J(ab,{highlight:{markers:{type:S,width:10,height:10,border:{width:2,color:k},margin:{top:-3,left:-3}}}});var ob=class extends qp{constructor(e){super(e),this.createContainer(),e.rtl?(this.createLabel(),this.createMarker()):(this.createMarker(),this.createLabel()),this._id=zf(),this.options.accessibility.ariaChecked=e.active}createContainer(){this.container=new tm({vertical:!1,wrap:!1,align:x,spacing:this.options.spacing}),this.append(this.container)}createMarker(){this.markerWrap=new qp({vertical:!1,shrinkToFit:!0,wrap:!1,margin:1,width:22,height:22}),this.container.append(this.markerWrap),this.createMarkerArea(),this.options.markers.visible&&(this._marker=this._createMarker(),this.markerWrap.append(this._marker))}createMarkerArea(){let{markerColor:e,line:t={}}=this.options,n={border:{color:t.color||e,opacity:t.opacity,dashType:t.dashType}};return this._createLine(n)||this._createMarkerLine(n,t)||this._createSquare()}markerOptions(){let e=this.options,{markers:t={},markerColor:n}=e,{border:r={}}=t;return t.zIndex=void 0,V({},t,{border:{color:r.color||n},highlight:e.highlight.markers})}_highlightOptions(){let e=this.options;return V({markers:{type:e.markers.type}},e.highlight)}_createLine(e){let t=this.options;return t.type===`line`&&!t.markers.visible&&(this._line=new ib(V({},{background:t.markerColor,highlight:this._highlightOptions()},e,t.line)),this.markerWrap.append(this._line)),this._line}_createMarkerLine(e,t){return this.options.type===`line`&&(this._markerLineArea=new rb(V({},{border:{width:t.height}},e)),this.markerWrap.append(this._markerLineArea)),this._markerLineArea}_reduceSize(e,t,n=.6){typeof e[t]==`number`&&(e[t]=e[t]*n)}_createSquare(){let e=this.options;if(e.type===`area`){let t=e.pattern||(e.series||{}).pattern;t&&(typeof t==`function`&&(t=t(e.series)),t=Object.assign({},t),this._reduceSize(t,`gap`),this._reduceSize(t,`width`),this._reduceSize(t,`radius`)),this._square=new ab(Object.assign({},{border:e.border,vAlign:e.markers.visible?b:x,highlight:this._highlightOptions()},e.area,{pattern:t,background:e.area.background||e.markerColor})),this.markerWrap.append(this._square)}return this._square}_createMarker(){return new nb(this.markerOptions())}_highlightMarkers(){this.options.active&&this._toggleHighlight(!0)}_restoreMarkers(){this._toggleHighlight(!1)}_toggleHighlight(e){if(!this.options.highlight.visible)return;let t=this._marker||this._square||this._line;if(t&&t===this._line&&this._line.visual.visible(!e),t){let n=t.highlight;n||(n=t.createHighlight(),n.forEach(e=>e&&this.markerWrap.appendVisual(e))),n.forEach(t=>t&&t.visible(e))}}createLabel(){let e=this.options,t=V({},e.labels);this.container.append(new om(e.text,t))}getAriaLabelText(){return this.options.text}focusVisual(){this.visual.options.set(`id`,this._id),this.toggleFocusHighlight(!0),this._highlightMarkers()}clearFocusFromVisual(){this.visual.options.set(`id`,``),this.toggleFocusHighlight(!1),this._restoreMarkers()}renderComplete(){super.renderComplete();let e=this.options.cursor||{},t=this._itemOverlay=N.fromRect(this.container.box.toRect(),{fill:{color:k,opacity:0},stroke:null,cursor:e.style||e});this.appendVisual(t)}click(e,t){let n=this.eventArgs(t);!e.trigger(`legendItemClick`,n)&&t&&t.type===`contextmenu`&&t.preventDefault()}over(e,t){let n=this.eventArgs(t);return e.trigger(`legendItemHover`,n)||(e._legendItemHover(n.seriesIndex,n.pointIndex),this._highlightMarkers()),!0}out(e,t){e._unsetActivePoint(),this._restoreMarkers(),e.trigger(Jg,this.eventArgs(t))}eventArgs(e){let t=this.options;return{element:tf(e),text:t.text,series:t.series,seriesIndex:t.series.index,pointIndex:t.pointIndex}}createVisual(){super.createVisual();let e=this.options;if(this.options.visible){let t=V({ariaLabel:e.accessibility.ariaLabel===void 0?e.text:e.accessibility.ariaLabel},e.accessibility);Jp(this.visual,t)}}renderVisual(){let e=this.options,t=e.visual;t?(this.visual=t({active:e.active,series:e.series,sender:this.getSender(),pointIndex:e.pointIndex,options:{type:e.type,markers:V({background:this.options.markerColor},this.markerOptions()),labels:e.labels},createVisual:()=>{this.createVisual(),this.renderChildren(),this.renderComplete();let e=this.visual;return delete this.visual,e}}),this._marker=this._markerLineArea=this._square=this._line=null,this.addVisual()):super.renderVisual()}createFocusHighlight(e){let t=e.stroke.width;return N.fromRect(this.container.box.pad(t/2).toRect(),e)}};J(ob,{accessibility:{role:v_,className:y_,ariaRoleDescription:b_},markers:{},highlight:{visible:!0,markers:{}}});let sb=`custom`;var cb=class extends Q{constructor(e,t={}){super(e),this.chartService=t,U(this.options.position,[`top`,`right`,`bottom`,`left`,sb])||(this.options.position=O),this.createContainers(),this.createLegendTitle(e.title),this.createItems()}createContainers(){let e=this.options,{position:t,align:n}=e,r=t,i=x;t===sb?r=T:U(t,[`top`,`bottom`])?(r=n===`start`?T:n===`end`?O:x,i=t):n&&(n===`start`?i=`top`:n===`end`&&(i=b)),this.container=new qp({margin:e.margin,padding:e.padding,background:e.background,border:e.border,vAlign:i,align:r,zIndex:e.zIndex,shrinkToFit:!0}),this.hasTitle()?this.itemsContainer=new qp({vAlign:i,align:r,zIndex:e.zIndex,shrinkToFit:!0}):this.itemsContainer=this.container,this.append(this.container)}createItems(){let e=this.getService(),t=this.options,n=new tb({vertical:this.isVertical(),spacing:t.spacing,rtl:e.rtl},e),r=t.data;t.reverse&&(r=r.slice(0).reverse());let i=r.length;for(let a=0;a<i;a++){let i=r[a],{markers:o={},dashType:s,legendItem:c,opacity:l}=i.series||{},u=V({visible:o.visible!==!1,type:S},o);delete u.size;let d=V({},{markers:u,labels:t.labels,rtl:e.rtl,line:Object.assign({},{dashType:s},t.line),area:Object.assign({},{opacity:l},t.area),opacity:l,accessibility:t.accessibility,focusHighlight:t.focusHighlight},t.item,c,i,{markers:t.markers});n.append(new ob(d))}n.render(),this.itemsContainer.append(n)}isVertical(){let{orientation:e,position:t}=this.options;return t===sb&&e!==`horizontal`||(W(e)?e!==`horizontal`:U(t,[`left`,`right`]))}hasItems(){return this.container.children[0].children.length>0}getItems(){return this.itemsContainer.children[0].children}reflow(e){let t=this.options,n=e.clone();if(!this.hasItems()){this.box=n;return}t.position===sb?(this.containerCustomReflow(n),this.box=n):this.containerReflow(n),this.hasTitle()&&(this.title.reflow(new Z(this.container.box.x1,this.title.box.y1,this.container.box.x2,this.title.box.y2)),this.title.box.width()>this.itemsContainer.box.width()&&this.itemsContainer.reflow(new Z(this.container.box.x1,this.itemsContainer.box.y1,this.container.box.x2,this.itemsContainer.box.y2)))}containerReflow(e){let{options:t,container:n}=this,{position:r,width:i,height:a}=t,o=r===`top`||r===`bottom`?`x`:`y`,s=this.isVertical(),c=e.clone(),l=e.clone();(r===`left`||r===`right`)&&(l.y1=c.y1=0),s&&a?(l.y2=l.y1+a,l.align(c,`y`,n.options.vAlign)):!s&&i&&(l.x2=l.x1+i,l.align(c,`x`,n.options.align)),n.reflow(l),l=n.box;let u=l.clone();(t.offsetX||t.offsetY)&&(l.translate(t.offsetX,t.offsetY),n.reflow(l)),u[o+1]=e[o+1],u[o+2]=e[o+2],this.box=u}containerCustomReflow(e){let{options:t,container:n}=this,{offsetX:r,offsetY:i,width:a,height:o}=t,s=this.isVertical(),c=e.clone();s&&o?c.y2=c.y1+o:!s&&a&&(c.x2=c.x1+a),n.reflow(c),c=n.box,n.reflow(new Z(r,i,r+c.width(),i+c.height()))}renderVisual(){this.hasItems()&&super.renderVisual()}createLegendTitle(e){let t=V({},{color:y,position:`top`,align:x},e),n=t.text;if(!(!e||e.visible===!1||!e.text)){if(W(t)&&t.visible){let e=Pd(t);e?n=e({text:n}):t.format&&(n=this.chartService.format.auto(t.format,n))}this.title=new om(n,t),this.createTitleLayout(),this.appendTitleLayoutContent()}}createTitleLayout(){this.layout=new tm({vertical:!0,wrap:!1}),this.container.append(this.layout)}hasTitle(){return!!(this.options.title&&this.options.title.visible!==!1&&this.options.title.text)}appendTitleLayoutContent(){this.options.title.position===`bottom`?(this.layout.append(this.itemsContainer),this.layout.append(this.title)):(this.layout.append(this.title),this.layout.append(this.itemsContainer))}};J(cb,{position:O,data:[],offsetX:0,offsetY:0,margin:H(2),padding:H(5),border:{color:y,width:0},item:{cursor:oe,spacing:6},spacing:6,background:``,zIndex:1,markers:{},line:{width:20,height:2,cursor:oe,opacity:1},area:{type:`square`,align:O,width:15,height:15}});var lb=class{constructor(){this._registry=[]}register(e,t){this._registry.push({type:e,seriesTypes:t})}create(e,t,n){let r=this._registry,i=r[0],a;for(let t=0;t<r.length;t++){let n=r[t];a=B_(e,n.seriesTypes);let o=B_(e,Gg);if(a.length-o.length>0){i=n;break}}return new i.type(a,t,n)}};lb.current=new lb;function ub(e){let t=document.createElement(`div`);return e&&(t.className=e),t}function db(e){let t=e;for(;t&&!Bd(t,`k-handle`);)t=t.parentNode;return t}var fb=class{constructor(e,t,n,r){let i=e.element;this.options=V({},this.options,n),this.chart=e,this.observer=r,this.chartElement=i,this.categoryAxis=t,this._dateAxis=this.categoryAxis instanceof lh,this.initOptions(),this.visible=this.options.visible&&i.offsetHeight,this.visible&&(this.createElements(),this.set(this._index(this.options.from),this._index(this.options.to)),this.bindEvents())}onPane(e){return this.categoryAxis.pane===e}createElements(){let e=this.options,t=this.wrapper=ub(`k-selector k-pointer-events-none`);jd(t,{top:e.offset.top,left:e.offset.left,width:e.width,height:e.height,direction:`ltr`});let n=this.selection=ub(`k-selection k-pointer-events-none`);this.leftMask=ub(`k-mask k-pointer-events-none`),this.rightMask=ub(`k-mask k-pointer-events-none`),t.appendChild(this.leftMask),t.appendChild(this.rightMask),t.appendChild(n);let r=this.body=ub(`k-selection-bg k-pointer-events-none`);n.appendChild(r);let i=this.leftHandle=ub(`k-handle k-left-handle k-pointer-events-auto`),a=this.rightHandle=ub(`k-handle k-right-handle k-pointer-events-auto`);i.appendChild(ub()),a.appendChild(ub()),n.appendChild(i),n.appendChild(a),this.chartElement.appendChild(t);let o=jd(n,[`borderLeftWidth`,`borderRightWidth`,`height`]),s=jd(i,`height`).height,c=jd(a,`height`).height;e.selection={border:{left:o.borderLeftWidth,right:o.borderRightWidth}},jd(i,{top:(o.height-s)/2}),jd(a,{top:(o.height-c)/2}),t.style.cssText=t.style.cssText}bindEvents(){this.options.mousewheel!==!1&&(this._mousewheelHandler=this._mousewheel.bind(this),Xd(this.chartElement,{[T_]:this._mousewheelHandler})),this._domEvents=_m.create(this.chartElement,{stopPropagation:!0,start:this._start.bind(this),move:this._move.bind(this),end:this._end.bind(this),tap:this._tap.bind(this),press:this._press.bind(this),gesturestart:this._gesturestart.bind(this),gesturechange:this._gesturechange.bind(this),gestureend:this._gestureend.bind(this)})}initOptions(){let{options:e,categoryAxis:t}=this,n=t.pane.chartsBox(),r=this.chart.chartService.intl;this._dateAxis&&V(e,{min:Ym(r,e.min),max:Ym(r,e.max),from:Ym(r,e.from),to:Ym(r,e.to)});let{paddingLeft:i,paddingTop:a}=jd(this.chartElement,[`paddingLeft`,`paddingTop`]);this.options=V({},{width:n.width(),height:n.height()+.1,padding:{left:i,top:a},offset:{left:n.x1+i,top:n.y1+a},from:e.min,to:e.max},e)}destroy(){this._domEvents&&(this._domEvents.destroy(),delete this._domEvents),clearTimeout(this._mwTimeout),this._state=null,this.wrapper&&=(this._mousewheelHandler&&=(sf(this.chartElement,{[T_]:this._mousewheelHandler}),null),this.chartElement.removeChild(this.wrapper),null)}_rangeEventArgs(e){return{axis:this.categoryAxis.options,from:this._value(e.from),to:this._value(e.to)}}_pointInPane(e,t){let n=this.categoryAxis.pane.box,r=this.chart._toModelCoordinates(e,t);return n.containsPoint(r)}_start(e){let t=this.options,n=tf(e);if(this._state||!n)return;let r=ef(e);if(!this._pointInPane(r.x,r.y))return;let i=db(n),a=this.body.getBoundingClientRect(),o=!i&&r.x>=a.x&&r.x<=a.x+a.width&&r.y>=a.y&&r.y<=a.y+a.height;this.chart._unsetActivePoint(),this._state={moveTarget:i,startLocation:e.x?e.x.location:0,inBody:o,range:{from:this._index(t.from),to:this._index(t.to)}};let s=this._rangeEventArgs({from:this._index(t.from),to:this._index(t.to)});this.trigger(`selectStart`,s)&&(this._state=null)}_press(e){let t;t=this._state?this._state.moveTarget:db(tf(e)),t&&ce(t,`k-handle-active`)}_move(e){if(!this._state)return;let{_state:t,options:n,categoryAxis:r}=this,{range:i,moveTarget:a}=t,o=r.options.reverse,s=this._index(n.from),c=this._index(n.to),l=this._index(n.min),u=this._index(n.max),d=t.startLocation-e.x.location,f={from:i.from,to:i.to},p=i.to-i.from,m=jd(this.wrapper,`width`).width/(r.categoriesCount()-1),h=Math.round(d/m)*(o?-1:1);if(!a&&!t.inBody)return;let g=a&&Bd(a,`k-left-handle`),_=a&&Bd(a,`k-right-handle`);t.inBody?(i.from=Math.min(Math.max(l,s-h),u-p),i.to=Math.min(i.from+p,u)):g&&!o||_&&o?(i.from=Math.min(Math.max(l,s-h),u-1),i.to=Math.max(i.from+1,i.to)):(g&&o||_&&!o)&&(i.to=Math.min(Math.max(l+1,c-h),u),i.from=Math.min(i.to-1,i.from)),(i.from!==f.from||i.to!==f.to)&&(this.move(i.from,i.to),this.trigger(l_,this._rangeEventArgs(i)))}_end(){if(this._state){let e=this._state.moveTarget;e&&ue(e,`k-handle-active`);let t=this._state.range;this.set(t.from,t.to),this.trigger(u_,this._rangeEventArgs(t)),delete this._state}}_tap(e){let{options:t,categoryAxis:n}=this,r=this.chart._eventCoordinates(e),i=n.pointCategoryIndex(new X(r.x,n.box.y1)),a=this._index(t.from),o=this._index(t.to),s=this._index(t.min),c=this._index(t.max),l=o-a,u=a+l/2,d={},f=e.event.which===3,p=Math.round(u-i);this._state||f||(this.chart._unsetActivePoint(),n.options.justified||p--,d.from=Math.min(Math.max(s,a-p),c-l),d.to=Math.min(d.from+l,c),this._start(e),this._state&&(this._state.range=d,this.trigger(l_,this._rangeEventArgs(d)),this._end()))}_mousewheel(e){let t=Jd(e);if(this._start(e),this._state){let n=this._state.range;e.preventDefault(),e.stopPropagation(),Math.abs(t)>1&&(t*=3),this.options.mousewheel.reverse&&(t*=-1),this.expand(t)&&this.trigger(l_,{axis:this.categoryAxis.options,delta:t,originalEvent:e,from:this._value(n.from),to:this._value(n.to)}),this._mwTimeout&&clearTimeout(this._mwTimeout),this._mwTimeout=setTimeout(()=>{this._end()},150)}}_gesturestart(e){let t=this.options,n=e.touches[0];if(!this._pointInPane(n.pageX,n.pageY))return;this._state={range:{from:this._index(t.from),to:this._index(t.to)}};let r=this._rangeEventArgs(this._state.range);this.trigger(`selectStart`,r)?this._state=null:e.preventDefault()}_gestureend(){this._state&&(this.trigger(u_,this._rangeEventArgs(this._state.range)),delete this._state)}_gesturechange(e){if(!this._state)return;let{chart:t,_state:n,options:r,categoryAxis:i}=this,a=n.range,o=t._toModelCoordinates(e.touches[0].x.location).x,s=t._toModelCoordinates(e.touches[1].x.location).x,c=Math.min(o,s),l=Math.max(o,s);e.preventDefault(),a.from=i.pointCategoryIndex(new X(c))||r.min,a.to=i.pointCategoryIndex(new X(l))||r.max,this.move(a.from,a.to),this.trigger(l_,this._rangeEventArgs(a))}_index(e){let t=e;return e instanceof Date&&(t=this.categoryAxis.categoryIndex(e)),t}_value(e){let t=e;return this._dateAxis&&(t=this.categoryAxis.categoryAt(e),t>this.options.max&&(t=this.options.max)),t}_slot(e){let t=this.categoryAxis,n=this._index(e);return t.getSlot(n,n,!0)}move(e,t){let n=this.options,r=this.categoryAxis.options.reverse,{offset:i,padding:a,selection:{border:o}}=n,s=r?t:e,c=r?e:t,l=`x`+(r?2:1),u=this._slot(s),d=K(u[l]-i.left+a.left);jd(this.leftMask,{width:d}),jd(this.selection,{left:d}),u=this._slot(c);let f=K(n.width-(u[l]-i.left+a.left));jd(this.rightMask,{width:f});let p=n.width-f;p!==n.width&&(p+=o.right),jd(this.rightMask,{left:p}),jd(this.selection,{width:Math.max(n.width-(d+f)-o.right,0)})}set(e,t){let n=this.options,r=this._index(n.min),i=this._index(n.max),a=G(this._index(e),r,i),o=G(this._index(t),a+1,i);n.visible&&this.move(a,o),n.from=this._value(a),n.to=this._value(o)}expand(e){let t=this.options,n=this._index(t.min),r=this._index(t.max),i=t.mousewheel.zoom,a=this._index(t.from),o=this._index(t.to),s={from:a,to:o},c=V({},s);if(this._state&&(s=this._state.range),i!==`right`&&(s.from=G(G(a-e,0,o-1),n,r)),i!==`left`&&(s.to=G(G(o+e,s.from+1,r),n,r)),s.from!==c.from||s.to!==c.to)return this.set(s.from,s.to),!0}zoom(e,t){let n=this.options,r=this._index(n.min),i=this._index(n.max),a=this._index(n.from),o=this._index(n.to),s={from:a,to:o},c=V({},s),{reverse:l}=this.categoryAxis.options,u=`x`+(l?`2`:`1`),d=this.categoryAxis.lineBox(),f=Math.abs(d[u]-t.x),p=d.width(),m=K(f/p,2),h=K(m*e),g=K((1-m)*e);if(this._state&&(s=this._state.range),s.from=G(G(a-h,0,o-1),r,i),s.to=G(G(o+g,s.from+1,i),r,i),s.from!==c.from||s.to!==c.to)return this.set(s.from,s.to),!0}trigger(e,t){return(this.observer||this.chart).trigger(e,t)}};J(fb,{visible:!0,mousewheel:{zoom:`both`},min:D,max:E});var pb=class extends Rv{show(e){if(!e||!e.tooltipAnchor||this._current&&this._current===e)return;let t=V({},this.options,e.options.tooltip),n=e.tooltipAnchor();n?(this._current=e,super.show({point:e,anchor:n},t,e)):this.hide()}hide(){delete this._current,super.hide()}},mb=class extends Rv{constructor(e,t){super(e.chartService,t),this.plotArea=e,this.formatService=e.chartService.format}showAt(e,t){let n=zd(e,function(e){let t=e.series.tooltip;return!(t&&t.visible===!1)});if(n.length>0){let r=n[0],i=this.plotArea.categoryAxis.getSlot(r.categoryIx),a=t?this._slotAnchor(t,i):this._defaultAnchor(r,i);this.show({anchor:a,shared:!0,points:e,category:r.category,categoryText:this.formatService.auto(this.options.categoryFormat,r.category),series:this.plotArea.series},this.options)}}_slotAnchor(e,t){return this.plotArea.categoryAxis.options.vertical||(e.x=t.center().x),{point:e,align:{horizontal:`left`,vertical:`center`}}}_defaultAnchor(e,t){let n=e.owner.pane.chartsBox(),r=this.plotArea.categoryAxis.options.vertical,i=n.center(),a=t.center(),o={horizontal:`center`,vertical:`center`},s;return s=r?new X(i.x,a.y):new X(a.x,i.y),{point:s,align:o}}};J(mb,{categoryFormat:`{0:d}`});var hb=class extends ea{setup(){let{element:e,options:t}=this;if(t.duration=t.duration===void 0?t.motionConfig.steady:t.duration,t.easing=t.motionConfig[t.easing]||[],e.bbox()){this.origin=t.origin;let n=t.vertical?`y`:`x`,r=this.fromScale=new A(1,1);r[n]=Jh,e.transform(M().scale(r.x,r.y))}else this.abort()}step(e){let t=Hd(this.fromScale.x,1,e),n=Hd(this.fromScale.y,1,e);this.element.transform(M().scale(t,n,this.origin))}abort(){super.abort(),this.element.transform(null)}};J(hb,{motionConfig:{}}),Xi.current.register(`bar`,hb);var gb=class extends ea{setup(){let e=this.options;e.duration=e.duration===void 0?e.motionConfig.steady:e.duration,e.easing=e.motionConfig.easeOutElastic||[];let t=this.center=this.element.bbox().center();this.element.transform(M().scale(Jh,Jh,t))}step(e){this.element.transform(M().scale(e,e,this.center))}};J(gb,{motionConfig:{}}),Xi.current.register(ug,gb);var _b=class extends ea{setup(){let e=this.options;e.duration=e.duration===void 0?e.motionConfig.rapid:e.duration,e.easing=e.motionConfig.linear||[],this.fadeTo=this.element.opacity(),this.element.opacity(0)}step(e){this.element.opacity(e*this.fadeTo)}};J(_b,{motionConfig:{}}),Xi.current.register(Gh,_b);var vb=class extends ea{setup(){let e=this.options;e.duration=e.duration===void 0?e.motionConfig.steady:e.duration,e.easing=e.motionConfig.easeOutElastic||[],this.element.transform(M().scale(Jh,Jh,this.options.center))}step(e){this.element.transform(M().scale(e,e,this.options.center))}};J(vb,{motionConfig:{}}),Xi.current.register(`pie`,vb);var yb=class extends jv{render(){super.render(),this.renderSegments()}createSegment(e,t,n){let r=t.style,i;return i=r===`smooth`?sv:rv,new i(e,t,n)}animationPoints(){return super.animationPoints().concat(this._segments)}createMissingValue(e,t){if(t===`zero`){let t={x:e.x,y:e.y};return W_(t.x)||(t.x=0),W_(t.y)||(t.y=0),t}}};V(yb.prototype,cv);function bb(e,t,n){let r=[],{xMin:i,xMax:a}=t,o=(n||{}).forecast;o&&(o.before>0&&(i-=o.before),o.after>0&&(a+=o.after));let s=(n||{}).samplingInterval,c=q(s,Pp(i,a)/10);s<=0&&(c=a-i);for(let t=i;t<=a;t+=c)r.push([t,e(t)]);return r}function xb(e){let{options:t,seriesValues:n}=e,r=Cb({seriesValues:n,options:t});return r?Object.assign({},t,{type:`scatterLine`,data:r}):null}let Sb=e=>({valueFields:t})=>({xValue:t.x,yValue:Math.log(t[e])});function Cb({seriesValues:e,options:t}){let n=e();if(!_y(n,t.field))return null;let{slope:r,intercept:i,count:a,xMin:o,xMax:s}=gy(n,Sb(t.field)),c={xMin:o,xMax:s};if(a>0){let e=Math.exp(i),n=r;return bb(t=>e*Math.exp(n*t),c,t.trendline)}return null}let wb=e=>({valueFields:t})=>({xValue:t.x,yValue:t[e]});function Tb(e){let{options:t,seriesValues:n}=e,r=Eb({seriesValues:n,options:t});return r?Object.assign({},t,{type:`scatterLine`,data:r}):null}function Eb({seriesValues:e,options:t}){let{slope:n,intercept:r,count:i,xMin:a,xMax:o}=gy(e(),wb(t.field));return i>0?bb(e=>n*e+r,{xMin:a,xMax:o},t.trendline):null}function Db(e,t){let n=Number.MAX_VALUE,r=Number.MIN_VALUE;for(let i=0;i<e.length;i++){let a=e[i],{xValue:o,yValue:s}=t(a);isFinite(o)&&o!==null&&isFinite(s)&&s!==null&&(n=Math.min(o,n),r=Math.max(o,r))}return{xMin:n,xMax:r}}function Ob(e){let{options:t,seriesValues:n}=e,r=jb({seriesValues:n,options:t});return r?Object.assign({},t,{type:`scatterLine`,data:r}):null}let kb=e=>({valueFields:t})=>({xValue:t.x,yValue:t[e]}),Ab=e=>({valueFields:t})=>({xValue:Math.log(t.x),yValue:t[e]});function jb({seriesValues:e,options:t}){let n=e();if(!_y(n,`x`))return null;let{slope:r,intercept:i,count:a}=gy(n,Ab(t.field)),o=Db(n,kb(t.field));if(a>0){let e=r,n=i;return bb(t=>e*Math.log(t)+n,o,t.trendline)}return null}function Mb(e){let{options:t}=e,n=Nb(e);return n?Object.assign({},t,{type:`scatterLine`,data:n}):null}function Nb({options:e,seriesValues:t}){let n=(e.trendline||{}).period||2,r=Oy(t({before:n,after:n}),wb(e.field),n);return r.length>0?r:null}function Pb(e){let{options:t,seriesValues:n}=e,r=Fb({seriesValues:n,options:t});return r?Object.assign({},t,{type:`scatterLine`,data:r}):null}function Fb({seriesValues:e,options:t}){let n=(t.trendline||{}).order,r=wb(t.field),{count:i,valueMapper:a,xMin:o,xMax:s}=Ny(e(),r,n);return i>0?bb(a,{xMin:o,xMax:s},t.trendline):null}function Ib(e){let{options:t,seriesValues:n}=e,r=Rb({seriesValues:n,options:t});return r?Object.assign({},t,{type:`scatterLine`,data:r}):null}let Lb=e=>({valueFields:t})=>({xValue:Math.log(t.x),yValue:Math.log(t[e])});function Rb({seriesValues:e,options:t}){let n=e();if(!_y(n,`x`))return null;let{slope:r,intercept:i,count:a}=gy(n,Lb(t.field)),o=Db(n,wb(t.field));if(a>0){let e=Math.exp(i),n=r;return bb(t=>e*t**+n,o,t.trendline)}return null}let zb={};zb[zg]=xb,zb[Bg]=Tb,zb[Vg]=Ob,zb[Hg]=Mb,zb[Ug]=Pb,zb[Wg]=Ib;var Bb=class extends Kv{initFields(){this.namedXAxes={},this.namedYAxes={},this.xAxisRangeTracker=new gv,this.yAxisRangeTracker=new gv}render(e=this.panes){this.series=[...this.originalSeries],this.createTrendlineSeries();let t=this.groupSeriesByPane();for(let n=0;n<e.length;n++){let r=e[n],i=t[r.options.name||`default`]||[];this.addToLegend(i);let a=this.filterVisibleSeries(i);a&&(this.createScatterChart(B_(a,Ag),r),this.createScatterLineChart(B_(a,jg),r),this.createBubbleChart(B_(a,ug),r))}this.createAxes(e)}appendChart(e,t){this.xAxisRangeTracker.update(e.xAxisRanges),this.yAxisRangeTracker.update(e.yAxisRanges),super.appendChart(e,t)}removeAxis(e){let t=e.options.name;super.removeAxis(e),e.options.vertical?(this.yAxisRangeTracker.reset(t),delete this.namedYAxes[t]):(this.xAxisRangeTracker.reset(t),delete this.namedXAxes[t]),e===this.axisX&&delete this.axisX,e===this.axisY&&delete this.axisY}seriesPaneName(e){let t=this.options,n=e.xAxis,r=[].concat(t.xAxis),i=zd(r,function(e){return e.name===n})[0],a=e.yAxis,o=[].concat(t.yAxis),s=zd(o,function(e){return e.name===a})[0],c=(t.panes||[{}])[0].name||`default`;return(i||{}).pane||(s||{}).pane||c}createScatterChart(e,t){e.length>0&&this.appendChart(new jv(this,{series:e,clip:t.options.clip}),t)}createScatterLineChart(e,t){e.length>0&&this.appendChart(new yb(this,{series:e,clip:t.options.clip}),t)}createBubbleChart(e,t){e.length>0&&this.appendChart(new Nv(this,{series:e,clip:t.options.clip}),t)}createXYAxis(e,t,n){let r=e.name,i=t?this.namedYAxes:this.namedXAxes,a=t?this.yAxisRangeTracker:this.xAxisRangeTracker,o=V({reverse:!t&&this.chartService.rtl},e,{vertical:t}),s=R_(o.type,`log`),c=a.query(),l=s?{min:.1,max:1}:{min:0,max:1},u=a.query(r)||c||l,d=[o.min,o.max],f=this.series;for(let e=0;e<f.length;e++){let r=f[e],i=r[t?`yAxis`:`xAxis`];if(i===o.name||n===0&&!i){let e=Y.current.bindPoint(r,0).valueFields;d.push(e[t?`y`:`x`]);break}}n===0&&c&&(u.min=Math.min(u.min,c.min),u.max=Math.max(u.max,c.max));let p;for(let e=0;e<d.length;e++)if(d[e]instanceof Date){p=!0;break}let m;m=R_(o.type,`date`)||!o.type&&p?Ch:s?Dh:gh;let h=new m(u.min,u.max,o,this.chartService);if(h.axisIndex=n,r){if(i[r])throw Error(`${t?`Y`:`X`} axis with name ${r} is already defined`);i[r]=h}return this.appendAxis(h),h}createAxes(e){let t=this.options,n=[].concat(t.xAxis),r=[],i=[].concat(t.yAxis),a=[];for(let t=0;t<n.length;t++)U(this.findPane(n[t].pane),e)&&r.push(this.createXYAxis(n[t],!1,t));for(let t=0;t<i.length;t++)U(this.findPane(i[t].pane),e)&&a.push(this.createXYAxis(i[t],!0,t));this.axisX=this.axisX||r[0],this.axisY=this.axisY||a[0]}_dispatchEvent(e,t,n){let r=e._eventCoordinates(t),i=new X(r.x,r.y),a=this.axes,o=a.length,s=[],c=[];for(let e=0;e<o;e++){let t=a[e],n=t.options.vertical?c:s,r=t.getValue(i);r!==null&&n.push(r)}s.length>0&&c.length>0&&e.trigger(n,{element:tf(t),originalEvent:t,x:K_(s),y:K_(c)})}updateAxisOptions(e,t){let n=e.options.vertical,r=this.groupAxes(this.panes),i=(n?r.y:r.x).indexOf(e);Vb(this.options,i,n,t),Vb(this.originalOptions,i,n,t)}trendlineFactory(e,t){let n=this.seriesValues.bind(this,t.index),r=hy(zb,e.type,{options:e,seriesValues:n});return r&&(r.xAxis=t.xAxis,r.yAxis=t.yAxis),r}seriesValues(e){let t=[],n=this.series[e];for(let e=0;e<n.data.length;e++){let r=this.bindPoint(n,e);t.push({pointIx:e,valueFields:r.valueFields})}return t}};function Vb(e,t,n,r){let i=[].concat(n?e.yAxis:e.xAxis)[t];V(i,r)}J(Bb,{xAxis:{},yAxis:{}}),V(Bb.prototype,Qv);var Hb=class extends Q{constructor(e,t,n){super(n),this.value=e,this.sector=t}render(){this._rendered||this.visible===!1||(this._rendered=!0,this.createLabel())}createLabel(){let e=this.options.labels,t=this.owner.chartService,n=this.getLabelText(e);if(e.visible&&(n||n===0)){if(e.position===`center`||e.position===`insideEnd`)e.color||=Cf(this.options.color),e.background||=this.options.color;else{let n=t.theme.seriesDefaults.labels;e.color=e.color||n.color,e.background=e.background||n.background}this.label=new om(n,V({},e,{align:x,vAlign:``,animation:{type:Gh,delay:this.animationDelay}}),this.pointData()),this.append(this.label)}}getLabelText(e){let t=Pd(e);return t?t(this.pointData()):this.owner.chartService.format.auto(e.format,this.value)}reflow(e){this.render(),this.box=e,this.reflowLabel()}reflowLabel(){let{options:{labels:e},label:t}=this,n=this.sector.clone(),r=e.distance,i=n.middle();if(t){let a=t.box.height(),o=t.box.width(),s;if(e.position===`center`)n.radius=Math.abs((n.radius-a)/2)+a,s=n.point(i),t.reflow(new Z(s.x,s.y-a/2,s.x,s.y));else if(e.position===`insideEnd`)n.radius-=a/2,s=n.point(i),t.reflow(new Z(s.x,s.y-a/2,s.x,s.y));else{let e;s=n.clone().expand(r).point(i),s.x>=n.center.x?(e=s.x+o,t.orientation=O):(e=s.x-o,t.orientation=T),t.reflow(new Z(e,s.y-a,s.x,s.y))}}}createVisual(){let{sector:e,options:t}=this;if(super.createVisual(),this.addAccessibilityAttributesToVisual(),this.value)if(t.visual){let n=(e.startAngle+180)%360,r=t.visual({category:this.category,dataItem:this.dataItem,value:this.value,series:this.series,percentage:this.percentage,center:new A(e.center.x,e.center.y),radius:e.radius,innerRadius:e.innerRadius,startAngle:n,endAngle:n+e.angle,options:t,sender:this.getSender(),createVisual:()=>{let e=new P;return this.createSegmentVisual(e),e}});r&&this.visual.append(r)}else this.createSegmentVisual(this.visual)}createSegmentVisual(e){let{sector:t,options:n}=this,r=n.border||{},i=r.width>0?{stroke:{color:r.color,width:r.width,opacity:r.opacity,dashType:r.dashType}}:{},a=n.color,o=Kp(n.pattern,{color:a,opacity:n.opacity}),s=this.createSegment(t,V({fill:o,stroke:{opacity:n.opacity},zIndex:n.zIndex},i));e.append(s),U_(n)&&e.append(this.createGradientOverlay(s,{baseColor:a,fallbackFill:o},V({center:[t.center.x,t.center.y],innerRadius:t.innerRadius,radius:t.radius,userSpace:!0},n.overlay)))}createSegment(e,t){return t.singleSegment?new Ln(new An(new A(e.center.x,e.center.y),e.radius),t):Rp.current.createRing(e,t)}createAnimation(){let{options:e,sector:{center:t}}=this;V(e,{animation:{center:[t.x,t.y],delay:this.animationDelay}}),super.createAnimation()}createHighlight(e){let t=this.options.highlight||{},n=t.border||{};return this.createSegment(this.sector,V({},e,{fill:{color:t.color,opacity:t.opacity},stroke:{opacity:n.opacity,width:n.width,color:n.color,dashType:n.dashType}}))}highlightVisual(){return this.visual.children[0]}highlightVisualArgs(){let e=this.sector;return{options:this.options,radius:e.radius,innerRadius:e.innerRadius,center:new A(e.center.x,e.center.y),startAngle:e.startAngle,endAngle:e.angle+e.startAngle,visual:this.visual}}createFocusHighlight(e){let t=this.options.focusHighlight.border.width,n=this.createSegment(this.sector,V({},e,{stroke:{width:t*2}})),r=new Vr;return r.paths.push(N.fromRect(n.bbox())),r.paths.push(this.createSegment(this.sector,{})),n.clip(r),n}tooltipAnchor(){let e=this.sector.clone().expand(5),t=e.middle();return{point:e.point(t),align:Gb(t+180)}}formatValue(e){return this.owner.formatPointValue(this,e)}pointData(){return{dataItem:this.dataItem,category:this.category,value:this.value,series:this.series,percentage:this.percentage}}getIndex(){return this.index}};let Ub=K(of(30),10),Wb=K(of(60),10);function Gb(e){let t=of(e),n=K(Math.sin(t),10),r=K(Math.cos(t),10),i;i=Math.abs(n)>Wb?x:r<0?O:T;let a;return a=Math.abs(n)<Ub?x:n<0?b:`top`,{horizontal:i,vertical:a}}J(Hb,{color:k,overlay:{gradient:`roundedBevel`},border:{width:.5},labels:{visible:!1,distance:35,font:C,margin:H(.5),align:S,zIndex:1,position:w_},animation:{type:`pie`},highlight:{visible:!0,border:{width:1}},visible:!0,accessibility:{role:h_,className:g_,ariaRoleDescription:__}}),V(Hb.prototype,ev),V(Hb.prototype,vv);let Kb={createLegendItem:function(e,t,n){let r=this.options.legend||{},i=r.labels||{},a=r.inactiveItems||{},o=a.labels||{};if(n&&n.visibleInLegend!==!1){let r=n.visible!==!1,s=r?Pd(i):Pd(o)||Pd(i),c=n.category;s&&(c=s({text:c,series:n.series,dataItem:n.dataItem,percentage:n.percentage,value:e}));let l,u;r?(l={},u=t.color):(l={color:o.color,font:o.font},u=(a.markers||{}).color),W_(c)&&c!==``&&this.legendItems.push({active:r,pointIndex:n.index,text:c,series:n.series,markerColor:u,pattern:t.pattern,labels:l})}}};var qb=class extends Q{constructor(e,t){super(t),this.plotArea=e,this.chartService=e.chartService,this.points=[],this.legendItems=[],this.render()}render(){this.traverseDataPoints(this.addValue.bind(this))}traverseDataPoints(e){let{options:t,plotArea:{options:{seriesColors:n=[]}}}=this,r=n.length,i=t.series,a=i.length;for(let o=0;o<a;o++){let s=i[o],c=s.data,{total:l,points:u,count:d}=I_(s),f=360/l,p;isFinite(f)||(p=360/d);let m;m=W(s.startAngle)?s.startAngle:t.startAngle,o!==a-1&&s.labels.position===`outsideEnd`&&(s.labels.position=x);for(let t=0;t<u.length;t++){let i=u[t];if(!i)continue;let{fields:d,value:h,visible:g}=i,_=h===0?0:p||h*f,v=c.length!==1&&!!d.explode;wd(s.color)||(s.color=d.color||n[t%r]),e(h,new Ip(null,0,0,m,_),{owner:this,category:W(d.category)?d.category:``,pattern:W(d.pattern)?d.pattern:s.pattern,index:t,series:s,seriesIx:o,dataItem:c[t],percentage:l===0?0:h/l,explode:v,visibleInLegend:d.visibleInLegend,visible:g,zIndex:a-o,animationDelay:this.animationDelay(t,o,a)}),g!==!1&&(m+=_)}}}evalSegmentOptions(e,t,n){let r=n.series;z_(e,{value:t,series:r,dataItem:n.dataItem,category:n.category,percentage:n.percentage},{defaults:r._defaults,excluded:[`data`,`content`,`template`,`visual`,`toggle`,`ariaTemplate`,`ariaContent`]})}addValue(e,t,n){let r=V({},n.series,{index:n.index});if(r.pattern=n.pattern||r.pattern,this.evalSegmentOptions(r,e,n),this.createLegendItem(e,r,n),n.visible===!1)return;let i=new Hb(e,t,r);Object.assign(i,n),this.append(i),this.points.push(i)}reflow(e){let{options:t,points:n,seriesConfigs:r=[]}=this,i=n.length,a=e.clone(),o=Math.min(a.width(),a.height()),s=o/2,c=o-o*.85,l=new Z(a.x1,a.y1,a.x1+o,a.y1+o),u=l.center(),d=a.center(),f=t.series.length,p=[],m=[],h=q(t.padding,c);this.targetBox=e,h=h>s-5?s-5:h,l.translate(d.x-u.x,d.y-u.y);let g=s-h,_=new X(g+l.x1+h,g+l.y1+h);for(let e=0;e<i;e++){let t=n[e],i=t.sector,a=t.seriesIx;if(i.radius=g,i.center=_,r.length){let e=r[a];i.innerRadius=e.innerRadius,i.radius=e.radius}a===f-1&&t.explode&&(i.center=i.clone().setRadius(i.radius*.15).point(i.middle())),t.reflow(l);let o=t.label;o&&o.options.position===`outsideEnd`&&a===f-1&&(o.orientation===`right`?m.push(o):p.push(o))}p.length>0&&(p.sort(this.labelComparator(!0)),this.leftLabelsReflow(p)),m.length>0&&(m.sort(this.labelComparator(!1)),this.rightLabelsReflow(m)),this.box=l}leftLabelsReflow(e){let t=this.distanceBetweenLabels(e);this.distributeLabels(t,e)}rightLabelsReflow(e){let t=this.distanceBetweenLabels(e);this.distributeLabels(t,e)}distanceBetweenLabels(e){let t=rf(this.points),n=t.sector,r=e.length-1,i=n.radius+t.options.labels.distance,a=[],o=e[0].box,s=K(o.y1-(n.center.y-i-o.height()-o.height()/2));a.push(s);for(let t=0;t<r;t++){let n=e[t+1].box;o=e[t].box,s=K(n.y1-o.y2),a.push(s)}return s=K(n.center.y+i-e[r].box.y2-e[r].box.height()/2),a.push(s),a}distributeLabels(e,t){let n=e.length,r,i,a;for(let t=0;t<n;t++)for(a=-e[t],r=i=t;a>0&&(r>=0||i<n);)a=this._takeDistance(e,t,--r,a),a=this._takeDistance(e,t,++i,a);this.reflowLabels(e,t)}_takeDistance(e,t,n,r){let i=r;if(e[n]>0){let r=Math.min(e[n],i);i-=r,e[n]-=r,e[t]+=r}return i}reflowLabels(e,t){let n=rf(this.points),r=n.sector,i=n.options.labels,a=t.length,o=i.distance,s=r.center.y-(r.radius+o)-t[0].box.height(),c;e[0]+=2;for(let n=0;n<a;n++){let a=t[n],l=a.box;s+=e[n],c=this.hAlignLabel(l.x2,r.clone().expand(o),s,s+l.height(),a.orientation===O),a.orientation===`right`?(i.align!==`circle`&&(c=r.radius+r.center.x+o),a.reflow(new Z(c+l.width(),s,c,s))):(i.align!==`circle`&&(c=r.center.x-r.radius-o),a.reflow(new Z(c-l.width(),s,c,s))),s+=l.height()}}createVisual(){let{options:{connectors:e},points:t}=this,n=t.length;super.createVisual(),this._connectorLines=[];for(let r=0;r<n;r++){let n=t[r],{sector:i,label:a}=n,o=i.middle(),s=(n.options.connectors||{}).color||e.color;if(a){let t=new N({stroke:{color:s,width:e.width},animation:{type:Gh,delay:n.animationDelay}});if(a.options.position===`outsideEnd`){let r=a.box,s=i.center,c=i.point(o),l=new X(r.x1,r.center().y),u,d,f;c=i.clone().expand(e.padding).point(o),t.moveTo(c.x,c.y),a.orientation===`right`?(d=new X(r.x1-e.padding,r.center().y),f=Jb(s,c,l,d),l=new X(d.x-4,d.y),f||=l,f.x=Math.min(f.x,l.x),this.pointInCircle(f,i.center,i.radius+4)||f.x<i.center.x?(u=i.center.x+i.radius+4,n.options.labels.align===`column`||u<l.x?t.lineTo(u,c.y):t.lineTo(c.x+8,c.y),t.lineTo(l.x,d.y)):(f.y=d.y,t.lineTo(f.x,f.y))):(d=new X(r.x2+e.padding,r.center().y),f=Jb(s,c,l,d),l=new X(d.x+4,d.y),f||=l,f.x=Math.max(f.x,l.x),this.pointInCircle(f,i.center,i.radius+4)||f.x>i.center.x?(u=i.center.x-i.radius-4,n.options.labels.align===`column`||u>l.x?t.lineTo(u,c.y):t.lineTo(c.x-8,c.y),t.lineTo(l.x,d.y)):(f.y=d.y,t.lineTo(f.x,f.y))),t.lineTo(d.x,d.y),this._connectorLines.push(t),this.visual.append(t)}}}}renderVisual(){if(super.renderVisual(),_f(this.options.series,e=>e.autoFit)){let e=this.targetBox,t=this.box.center(),n=this.visual.bbox();if(!n)return;let r=n.bottomRight(),i=Math.min((t.y-e.y1)/(t.y-n.origin.y),(e.y2-t.y)/(r.y-t.y),(t.x-e.x1)/(t.x-n.origin.x),(e.x2-t.x)/(r.x-t.x));i<1&&this.visual.transform(M().scale(i,i,[t.x,t.y]))}}labelComparator(e){let t=e?-1:1;return function(e,n){return((e.parent.sector.middle()+270)%360-(n.parent.sector.middle()+270)%360)*t}}hAlignLabel(e,t,n,r,i){let{radius:a,center:{x:o,y:s}}=t,c=Math.min(Math.abs(s-n),Math.abs(s-r));return c>a?e:o+Math.sqrt(a*a-c*c)*(i?1:-1)}pointInCircle(e,t,n){return(t.x-e.x)**2+(t.y-e.y)**2<n**2}formatPointValue(e,t){return this.chartService.format.auto(t,e.value)}animationDelay(e){return e*70}stackRoot(){return this}};function Jb(e,t,n,r){let i=(r.x-n.x)*(e.y-n.y)-(r.y-n.y)*(e.x-n.x),a=(r.y-n.y)*(t.x-e.x)-(r.x-n.x)*(t.y-e.y),o;if(a!==0){let n=i/a;o=new X(e.x+n*(t.x-e.x),e.y+n*(t.y-e.y))}return o}J(qb,{startAngle:90,connectors:{width:2,color:`#939393`,padding:8},inactiveItems:{markers:{},labels:{}}}),V(qb.prototype,Kb),qb.prototype.isStackRoot=!0;var Yb=class extends Kv{render(){this.createPieChart(this.series)}createPieChart(e){let t=e[0],n=new qb(this,{series:e,padding:t.padding,startAngle:t.startAngle,connectors:t.connectors,legend:this.options.legend});this.appendChart(n)}appendChart(e,t){super.appendChart(e,t),Yd(this.options.legend.data,e.legendItems)}getPointBelow(e){return this.getPointToTheRight(e)}getPointAbove(e){return this.getPointToTheLeft(e)}},Xb=class extends Hb{reflowLabel(){let{options:{labels:e},label:t}=this,n=this.sector.clone(),r=n.middle();if(t){let i=t.box.height();if(e.position===`center`){n.radius-=(n.radius-n.innerRadius)/2;let e=n.point(r);t.reflow(new Z(e.x,e.y-i/2,e.x,e.y))}else super.reflowLabel()}}createSegment(e,t){return Rp.current.createRing(e,t)}};J(Xb,{overlay:{gradient:`roundedGlass`},labels:{position:x},animation:{type:`pie`}}),V(Xb.prototype,ev);var Zb=class extends qb{addValue(e,t,n){let r=V({},n.series,{index:n.index});if(r.pattern=n.pattern||r.pattern,this.evalSegmentOptions(r,e,n),this.createLegendItem(e,r,n),n.visible===!1)return;let i=new Xb(e,t,r);Object.assign(i,n),this.append(i),this.points.push(i)}reflow(e){let t=this.options,n=e.clone(),r=Math.min(n.width(),n.height()),i=r/2,a=r-r*.85,o=t.series,s=o.length,c=q(t.padding,a);c=c>i-5?i-5:c;let l=i-c,u=0,d;for(let e=0;e<s;e++){let t=o[e];e===0&&W(t.holeSize)&&(d=t.holeSize,l-=t.holeSize),W(t.size)?l-=t.size:u++,W(t.margin)&&e!==s-1&&(l-=t.margin)}W(d)||(d=(i-c)/(s+.75)*.75,l-=d);let f=d,p=0,m,h;this.seriesConfigs=[];for(let e=0;e<s;e++){let t=o[e];m=q(t.size,l/u),f+=p,h=f+m,this.seriesConfigs.push({innerRadius:f,radius:h}),p=t.margin||0,f=h}super.reflow(e)}animationDelay(e,t,n){return e*50+600*(t+1)/(n+1)}};J(Zb,{startAngle:90,connectors:{width:2,color:`#939393`,padding:8}});var Qb=class extends Yb{render(){this.createDonutChart(this.series)}createDonutChart(e){let t=e[0],n=new Zb(this,{series:e,padding:t.padding,connectors:t.connectors,legend:this.options.legend});this.appendChart(n)}getPointBelow(e){return this._getNextPoint(e,this._pointsByVertical,-1)}getPointAbove(e){return this._getNextPoint(e,this._pointsByVertical,1)}},$b=class extends Kv{initFields(){this.valueAxisRangeTracker=new gv}render(){this.addToLegend(this.series),this.createPolarAxis(),this.createCharts(),this.createValueAxis()}alignAxes(){let e=this.valueAxis,t=e.range(),n=e.options.reverse?t.max:t.min,r=e.getSlot(n),i=this.polarAxis.getSlot(0).center,a=e.box.translate(i.x-r.x1,i.y-r.y1);e.reflow(a)}createValueAxis(){let e=this.valueAxisRangeTracker.query(),t=this.valueAxisOptions({roundToMajorUnit:!1,zIndex:-1}),n,r;t.type===`log`?(n=zh,r={min:.1,max:1}):(n=Rh,r={min:0,max:1});let i=e||r,a=new n(i.min,i.max,t,this.chartService);this.valueAxis=a,this.appendAxis(a)}reflowAxes(){let{options:{plotArea:e},valueAxis:t,polarAxis:n,box:r}=this,i=Math.min(r.width(),r.height())*.15,a=H(e.padding||{},i),o=r.clone().unpad(a),s=o.clone();s.y2=s.y1+Math.min(s.width(),s.height()),s.align(o,`y`,x);let c=s.clone().shrink(0,s.height()/2);n.reflow(s),t.reflow(c);let l=t.lineBox().height()-t.box.height();t.reflow(t.box.unpad({top:l})),this.axisBox=s,this.alignAxes(s)}backgroundBox(){return this.box}detachLabels(){}},ex=class extends jv{pointSlot(e,t){let n=e.center.y-t.y1,r=X.onCircle(e.center,e.startAngle,n);return new Z(r.x,r.y,r.x,r.y)}};J(ex,{clip:!1});var tx=class extends yb{};tx.prototype.pointSlot=ex.prototype.pointSlot,J(tx,{clip:!1});var nx=class extends mv{fillToAxes(e){let t=this._polarAxisCenter();e.lineTo(t.x,t.y)}_polarAxisCenter(){return this.parent.plotArea.polarAxis.box.center()}strokeSegments(){let e=this._strokeSegments;if(!e){let t=this._polarAxisCenter(),n=new Vh(!1),r=this.points();r.push(t),e=this._strokeSegments=n.process(r),e.pop()}return e}},rx=class extends fv{fillToAxes(e){let t=this.parent.plotArea.polarAxis.box.center(),n=new dr([t.x,t.y]);e.segments.unshift(n),e.segments.push(n)}},ix=class extends tx{createSegment(e,t,n){let r=(t.line||{}).style,i;return i=r===`smooth`?new nx(e,t,n):new rx(e,t,n),i}createMissingValue(e,t){let n;return W_(e.x)&&t!==`interpolate`&&(n={x:e.x,y:e.y},t===`zero`&&(n.y=0)),n}seriesMissingValues(e){return e.missingValues||`zero`}_hasMissingValuesGap(){let e=this.options.series;for(let t=0;t<e.length;t++)if(this.seriesMissingValues(e[t])===`gap`)return!0}sortPoints(e){if(e.sort(ax),this._hasMissingValuesGap())for(let t=0;t<e.length;t++){let n=e[t];if(n){let r=n.value;!W_(r.y)&&this.seriesMissingValues(n.series)===`gap`&&delete e[t]}}return e}};function ax(e,t){return e.value.x-t.value.x}var ox=class extends $b{createPolarAxis(){let e=new Fh(this.options.xAxis,this.chartService);this.polarAxis=e,this.axisX=e,this.appendAxis(e)}render(){this.series=[...this.originalSeries],this.createTrendlineSeries(),super.render()}valueAxisOptions(e){return V(e,{majorGridLines:{type:`arc`},minorGridLines:{type:`arc`}},this.options.yAxis)}createValueAxis(){super.createValueAxis(),this.axisY=this.valueAxis}trendlineFactory(e,t){let n=Bb.prototype.trendlineFactory.call(this,e,t);return n&&(n.type=Sg),n}appendChart(e,t){this.valueAxisRangeTracker.update(e.yAxisRanges),Kv.prototype.appendChart.call(this,e,t)}createCharts(){let e=this.filterVisibleSeries(this.series),t=this.panes[0];this.createLineChart(B_(e,[Sg]),t),this.createScatterChart(B_(e,[Cg]),t),this.createAreaChart(B_(e,[xg]),t)}createLineChart(e,t){if(e.length===0)return;let n=new tx(this,{series:e});this.appendChart(n,t)}createScatterChart(e,t){if(e.length===0)return;let n=new ex(this,{series:e});this.appendChart(n,t)}createAreaChart(e,t){if(e.length===0)return;let n=new ix(this,{series:e});this.appendChart(n,t)}_dispatchEvent(e,t,n){let r=e._eventCoordinates(t),i=new X(r.x,r.y),a=this.axisX.getValue(i),o=this.axisY.getValue(i);a!==null&&o!==null&&e.trigger(n,{element:tf(t),x:a,y:o})}createCrosshairs(){}};J(ox,{xAxis:{},yAxis:{}}),V(ox.prototype,Qv,{seriesValues:Bb.prototype.seriesValues});function sx(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];t[r.seriesIx]=t[r.seriesIx]||[],t[r.seriesIx].push(r)}return t}var cx=class extends dv{pointSlot(e,t){let n=e.center.y-t.y1,r=X.onCircle(e.center,e.middle(),n);return new Z(r.x,r.y,r.x,r.y)}renderSegments(){if(super.renderSegments(),this._segments&&this._segments.length>1){let e=sx(this._segments);for(let t=0;t<e.length;t++){let n=e[t];if(n&&n.length>1){let e=n[0].linePoints[0],t=rf(n),r=rf(t.linePoints),i=e.categoryIx===0,a=r.categoryIx===r.categoriesCount-1;i&&a&&rf(n).linePoints.push(e)}}}}createSegment(e,t,n){let r=t.style,i;i=r===`smooth`?sv:rv;let a=new i(e,t,n),o=this.seriesMissingValues(t);return(e.length===t.data.length||o===`interpolate`)&&(a.options.closed=!0),a}};J(cx,{clip:!1,limitPoints:!1});var lx=class extends mv{fillToAxes(){}},ux=class extends fv{fillToAxes(){}},dx=class extends cx{createSegment(e,t,n,r){let i=this.options.isStacked,a=(t.line||{}).style,o,s,c;return i&&n>0&&r&&(s=r.linePoints.slice(0),o=r),a===`smooth`?(c=new lx(e,t,n,o,s),c.options.closed=!0):(e.push(e[0]),c=new ux(e,t,n,o,s)),c}seriesMissingValues(e){return e.missingValues||`zero`}},fx=class extends Xb{constructor(e,t){super(e,null,t)}getIndex(){return this.categoryIx}};J(fx,{overlay:{gradient:`none`},labels:{distance:10}});var px=class extends Q{constructor(e){super(e),this.forEach=e.rtl?xv:bv}reflow(e){let{options:t,children:n}=this,{gap:r,spacing:i}=t,a=n.length,o=a+r+i*(a-1),s=e.angle/o,c=e.startAngle+r/2*s;this.forEach(n,t=>{let n=e.clone();n.startAngle=c,n.angle=s,t.sector&&(n.radius=t.sector.radius),t.reflow(n),t.sector=n,c+=s+s*i})}};J(px,{gap:1,spacing:0});var mx=class extends Q{reflow(e){let{options:{reverse:t},children:n}=this,r=n.length,i=t?r-1:0,a=t?-1:1;this.box=new Z;for(let t=i;t>=0&&t<r;t+=a){let r=n[t].sector;r.startAngle=e.startAngle,r.angle=e.angle}}},hx=class extends wv{pointType(){return fx}clusterType(){return px}stackType(){return mx}categorySlot(e,t){return e.getSlot(t)}pointSlot(e,t){let n=e.clone(),r=e.center.y;return n.radius=r-t.y1,n.innerRadius=r-t.y2,n}reflowPoint(e,t){e.sector=t,e.reflow()}createAnimation(){this.options.animation.center=this.box.toRect().center(),super.createAnimation()}};hx.prototype.reflow=$_.prototype.reflow,J(hx,{clip:!1,limitPoints:!1,animation:{type:`pie`}});var gx=class extends $b{createPolarAxis(){let e=new Ph(this.options.categoryAxis,this.chartService);this.polarAxis=e,this.categoryAxis=e,this.appendAxis(e),this.aggregateCategories(),this.createTrendlineSeries(),this.createCategoryAxesLabels()}valueAxisOptions(e){return this._hasBarCharts&&V(e,{majorGridLines:{type:`arc`},minorGridLines:{type:`arc`}}),this._isStacked100&&V(e,{roundToMajorUnit:!1,labels:{format:`P0`}}),V(e,this.options.valueAxis)}aggregateCategories(){Wy.prototype.aggregateCategories.call(this,this.panes)}createCategoryAxesLabels(){Wy.prototype.createCategoryAxesLabels.call(this,this.panes)}filterSeries(e){return e}trendlineFactory(e,t){let n=Wy.prototype.trendlineFactory.call(this,e,t);return n&&(n.type=Eg),n}createCharts(){let e=this.filterVisibleSeries(this.series),t=this.panes[0];this.createAreaChart(B_(e,[wg]),t),this.createLineChart(B_(e,[Eg]),t),this.createBarChart(B_(e,[Tg]),t)}chartOptions(e){let t={series:e},n=e[0];if(n){let r=this.filterVisibleSeries(e),i=n.stack;t.isStacked=i&&r.length>1,t.isStacked100=i&&i.type===`100%`&&r.length>1,t.isStacked100&&(this._isStacked100=!0)}return t}createAreaChart(e,t){if(e.length===0)return;let n=new dx(this,this.chartOptions(e));this.appendChart(n,t)}createLineChart(e,t){if(e.length===0)return;let n=new cx(this,this.chartOptions(e));this.appendChart(n,t)}createBarChart(e,t){if(e.length===0)return;let n=e[0],r=this.chartOptions(e),i=this.filterVisibleSeries(e),a=i.some(e=>e.stack),o=i.some(e=>e.stack&&e.stack.type===`100%`);r.gap=n.gap,r.spacing=n.spacing,r.defaultStack=n.stack&&i.length>1,r.isStacked=a&&i.length>1,r.isStacked100=o&&i.length>1;let s=new hx(this,r);this.appendChart(s,t),this._hasBarCharts=!0}seriesCategoryAxis(){return this.categoryAxis}_dispatchEvent(e,t,n){let r=e._eventCoordinates(t),i=new X(r.x,r.y),a=this.categoryAxis.getCategory(i),o=this.valueAxis.getValue(i);a!==null&&o!==null&&e.trigger(n,{element:tf(t),category:a,value:o})}createCrosshairs(){}_pointsByVertical(e){return super._pointsByVertical(e).sort(this._getSeriesCompareFn())}_getSeriesCompareFn(){return(e,t)=>t.value-e.value}};V(gx.prototype,Qv,{appendChart:Wy.prototype.appendChart,aggregateSeries:Wy.prototype.aggregateSeries,seriesSourcePoints:Wy.prototype.seriesSourcePoints,seriesValues:Wy.prototype.seriesValues}),J(gx,{categoryAxis:{categories:[]},valueAxis:{}});var _x=class extends Q{constructor(e,t,n){super(t),this.value=e,this.options.index=n.index}getLabelText(e){let t=Pd(e);return t?t(this.pointData()):e.format?this.formatValue(e.format):this.value}reflow(e){let t=this.points,n=this.children[0],r=Math.min(t[0].x,t[3].x),i=Math.max(t[1].x,t[2].x);this.box=new Z(r,t[0].y,i,t[2].y),n&&n.reflow(new Z(e.x1,t[0].y,e.x2,t[2].y))}createVisual(){let e=this.options,t;super.createVisual(),this.addAccessibilityAttributesToVisual(),t=e.visual?e.visual({category:this.category,dataItem:this.dataItem,value:this.value,series:this.series,percentage:this.percentage,points:this.points,options:e,sender:this.getSender(),createVisual:()=>this.createPath()}):this.createPath(),t&&this.visual.append(t)}createPath(){let e=this.options,t=e.border;return N.fromPoints(this.points,{fill:Kp(e.pattern,{color:e.color,opacity:e.opacity}),stroke:{color:t.color,opacity:t.opacity,width:t.width}}).close()}createHighlight(e){return N.fromPoints(this.points,e)}highlightVisual(){return this.visual.children[0]}highlightVisualArgs(){let e=N.fromPoints(this.points).close();return{options:this.options,path:e}}createFocusHighlight(e){let t=this.options.focusHighlight.border.width,n=N.fromPoints(this.points,V({},e,{stroke:{width:t*2}})).close(),r=new Vr;return r.paths.push(N.fromRect(this.box.clone().pad(t).toRect())),r.paths.push(N.fromPoints(this.points)),n.clip(r),n}tooltipAnchor(){let e=this.box;return{point:new X(e.center().x,e.y1),align:{horizontal:`center`,vertical:`top`}}}formatValue(e){let t=this;return t.owner.formatPointValue(t,e)}pointData(){return{dataItem:this.dataItem,category:this.category,value:this.value,series:this.series,percentage:this.percentage}}getIndex(){return this.index}};J(_x,{color:k,border:{width:1},labels:{format:``},accessibility:{role:h_,className:g_,ariaRoleDescription:__}}),V(_x.prototype,ev),V(_x.prototype,vv);var vx=class extends Q{constructor(e,t){super(t),this.plotArea=e,this.chartService=e.chartService,this.points=[],this.labels=[],this.legendItems=[],this.render()}formatPointValue(e,t){return this.plotArea.chartService.format.auto(t,e.value)}render(){let{options:e,plotArea:{options:{seriesColors:t=[]}}}=this,n=e.series[0],r=n.data;if(!r)return;let{total:i,points:a}=I_(n);for(let e=0;e<a.length;e++){let o=a[e];if(!o)continue;let s=o.fields;wd(n.color)||(n.color=s.color||t[e%t.length]),s=V({index:e,owner:this,series:n,seriesIx:0,dataItem:r[e],percentage:o.value/i},s,{visible:o.visible});let c=o.valueFields.value,l=this.createSegment(c,s),u=this.createLabel(c,s);l&&u&&l.append(u)}}evalSegmentOptions(e,t,n){let r=n.series;z_(e,{value:t,series:r,dataItem:n.dataItem,index:n.index},{defaults:r._defaults,excluded:[`data`,`content`,`template`,`toggle`,`visual`,`ariaTemplate`,`ariaContent`]})}createSegment(e,t){let n=V({},t.series);if(n.pattern=t.pattern||n.pattern,this.evalSegmentOptions(n,e,t),this.createLegendItem(e,n,t),t.visible!==!1){let r=new _x(e,n,t);return Object.assign(r,t),this.append(r),this.points.push(r),r}}createLabel(e,t){let{series:n,dataItem:r}=t,i=V({},this.options.labels,n.labels),a=e;if(i.visible){let o=Pd(i),s={dataItem:r,value:e,percentage:t.percentage,category:t.category,series:n};o?a=o(s):i.format&&(a=this.chartService.format.auto(i.format,a)),i.color||(i.color=Cf(n.color),i.background||=n.color),this.evalSegmentOptions(i,e,t);let c=new om(a,V({vAlign:i.position},i),s);return this.labels.push(c),c}}labelPadding(){let e=this.labels,t={left:0,right:0};for(let n=0;n<e.length;n++){let r=e[n].options.align;if(r!==`center`){let i=e[n].box.width();r===`left`?t.left=Math.max(t.left,i):t.right=Math.max(t.right,i)}}return t}dynamicSlopeReflow(e,t,n){let{options:r,points:i}=this,a=i.length,o=i[0],s=o;for(let e=0;e<i.length;e++)i[e].percentage>s.percentage&&(s=i[e]);let c=o.percentage/s.percentage*t,l=(t-c)/2,u=0;for(let o=0;o<a;o++){let s=i[o].percentage,d=i[o+1],f=d?d.percentage:s,p=i[o].points=[],m=r.dynamicHeight?n*s:n/a,h;h=s?(t-f/s*c)/2:f?0:t/2,h=G(h,0,t),p.push(new A(e.x1+l,e.y1+u)),p.push(new A(e.x1+t-l,e.y1+u)),p.push(new A(e.x1+t-h,e.y1+m+u)),p.push(new A(e.x1+h,e.y1+m+u)),l=h,u+=m+r.segmentSpacing,c=G(t-2*h,0,t)}}constantSlopeReflow(e,t,n){let{options:r,points:i}=this,a=i.length,o=r.neckRatio<=1,s=o?r.neckRatio*t:t,c=o?0:(t-t/r.neckRatio)/2,l=((o?t:t-c*2)-s)/2,u=0;for(let o=0;o<a;o++){let s=i[o].points=[],d=i[o].percentage,f=r.dynamicHeight?l*d:l/a,p=r.dynamicHeight?n*d:n/a;s.push(new A(e.x1+c,e.y1+u)),s.push(new A(e.x1+t-c,e.y1+u)),s.push(new A(e.x1+t-c-f,e.y1+p+u)),s.push(new A(e.x1+c+f,e.y1+p+u)),c+=f,u+=p+r.segmentSpacing}}reflow(e){let t=this.points,n=t.length;if(!n)return;let r=this.options,i=e.clone().unpad(this.labelPadding()),a=i.height()-r.segmentSpacing*(n-1),o=i.width();r.dynamicSlope?this.dynamicSlopeReflow(i,o,a):this.constantSlopeReflow(i,o,a);for(let r=0;r<n;r++)t[r].reflow(e)}};J(vx,{neckRatio:.3,width:300,dynamicSlope:!1,dynamicHeight:!0,segmentSpacing:0,labels:{visible:!1,align:x,position:x,zIndex:1}}),V(vx.prototype,Kb);var yx=class extends vx{constructor(e,t){t.dynamicSlope=!1,t.neckRatio=1e6,super(e,t)}},bx=class extends Kv{render(){this.createChart(vx,B_(this.series,[hg])),this.createChart(yx,B_(this.series,[gg]))}createChart(e,t){let n=t[0];if(!n)return;let r=new e(this,{series:t,legend:this.options.legend,neckRatio:n.neckRatio,dynamicHeight:n.dynamicHeight,dynamicSlope:n.dynamicSlope,segmentSpacing:n.segmentSpacing,highlight:n.highlight});this.appendChart(r)}appendChart(e,t){super.appendChart(e,t),Yd(this.options.legend.data,e.legendItems)}_pointsByVertical(e){return this.pointsBySeriesIndex(e.series.index)}getPointToTheRight(e){return this.getPointBelow(e)}getPointToTheLeft(e){return this.getPointAbove(e)}};let xx=(e,t=.05)=>{let n=He(e),r=1-t;return e=>{let t=n.toHSL(),i=100-t.l,a=r-e;return t.l+=Math.min(a*i,i),t.toCss()}};var Sx=class extends Q{constructor(e,t){super(),this.options=t,this.color=t.color||`#fff`,this.value=e}render(){this._rendered||(this._rendered=!0,this.createMarker(),this.createLabel(),this.createNote())}createLabel(){let e=this.options.labels;e.visible&&(this.label=this.createLabelElement(e),this.append(this.label))}createLabelElement(e){let t=e.color;return t||=Cf(this.color),new om(this.getLabelText(e),V({align:x,vAlign:x,margin:{left:5,right:5},zIndex:q(e.zIndex,this.series.zIndex)},e,{color:t}),this.pointData())}getLabelText(e){let t=Pd(e);return t?t(this.pointData()):this.formatValue(e.format)}formatValue(e){return this.owner.formatPointValue(this,e)}reflow(e){this.render();let t=this.label;this.box=e,t&&t.reflow(this.markerBox()),this.note&&this.note.reflow(e),this.marker.reflow(this.markerBox())}createVisual(){super.createVisual(),this.addAccessibilityAttributesToVisual()}markerBox(){let e=this.options.markers,t=e.border,n=this.box.toRect(),r=q(e.type,`rect`)===`roundedRect`,i=q(t.width,+!!r),a=Math.round(i/2);if(e.size){let t=n.center();n.size.width=n.size.height=e.size,n.origin.x=Math.round(t.x-n.size.width/2),n.origin.y=Math.round(t.y-n.size.height/2)}return n.size.width-=i,n.size.height-=i,n.origin.y+=a+.5,n.origin.x+=a+.5,im(n)}markerBorder(){let e=this.options,t=e.markers.border,n=q(t.opacity,e.opacity);return{color:t.color||this.color,width:t.width,opacity:n,dashType:t.dashType}}createMarker(){let e=this.options,t=e.markers,n=new Yp({type:q(t.type,`rect`),width:t.size,height:t.size,rotation:t.rotation,background:this.color,border:this.markerBorder(),pattern:e.pattern,borderRadius:t.borderRadius,opacity:this.series.opacity||e.opacity,zIndex:q(e.zIndex,this.series.zIndex),animation:e.animation,visual:e.visual},{dataItem:this.dataItem,value:this.value,series:this.series,category:this.category});this.marker=n,this.append(n)}createHighlight(e){let t=this.options,n=this.options.highlight.markers||this.options.markers,r=new Yp({type:q(n.type,`rect`),width:n.size,height:n.size,rotation:n.rotation,background:n.color||this.color,border:this.markerBorder(),borderRadius:n.borderRadius,opacity:this.series.opacity||t.opacity,zIndex:q(t.zIndex,this.series.zIndex)});r.reflow(this.markerBox());let i=r.getElement();return i.options.fill=e.fill,i.options.stroke=e.stroke,i}highlightVisual(){return this.rectVisual}highlightVisualArgs(){return{options:this.options,rect:this.box.toRect(),visual:this.rectVisual}}createFocusHighlight(){let e=this.options.markers,t=this.options.focusHighlight,n=new Yp({type:q(e.type,`rect`),width:e.size,height:e.size,rotation:e.rotation,background:t.color,border:t.border,borderRadius:e.borderRadius,padding:t.border.width/2,zIndex:t.zIndex});return n.reflow(this.markerBox()),n.getElement()}tooltipAnchor(){let e=this.box.center().x;return{point:new X(e,this.box.y1-5),align:{horizontal:x,vertical:b}}}overlapsBox(e){return this.box.overlaps(e)}unclipElements(){}pointData(){return{x:this.value.x,y:this.value.y,value:this.value.value,dataItem:this.dataItem,series:this.series}}};V(Sx.prototype,ev),V(Sx.prototype,tv),V(Sx.prototype,vv),Sx.prototype.defaults={markers:{type:`rect`,borderRadius:4,border:{color:`transparent`}},padding:{top:1},labels:{visible:!1,padding:3},opacity:1,notes:{label:{}},accessibility:{role:h_,className:g_,ariaRoleDescription:__}};var Cx=class extends Q{constructor(e,t){super(t),this.plotArea=e,this.chartService=e.chartService,this._initFields(),this.render()}_initFields(){this.points=[],this.seriesOptions=[],this.valueRange={min:E,max:D},this._evalSeries=[]}render(){this.setRange(),this.traverseDataPoints(this.addValue.bind(this))}setRange(){let{options:{series:e}}=this;for(let t=0;t<e.length;t++){let n=e[t];for(let e=0;e<n.data.length;e++){let{valueFields:t}=this.plotArea.bindPoint(n,e);W(t.value)&&t.value!==null&&(this.valueRange.min=Math.min(this.valueRange.min,t.value),this.valueRange.max=Math.max(this.valueRange.max,t.value))}}}addValue(e,t){let n;e&&W(e.value)&&e.value!==null&&(n=this.createPoint(e,t),n&&Object.assign(n,t)),this.points.push(n)}evalPointOptions(e,t,n){let{series:r,seriesIx:i}=n,a={defaults:r._defaults,excluded:[`data`,`tooltip`,`content`,`template`,`visual`,`toggle`,`drilldownSeriesFactory`,`ariaTemplate`,`ariaContent`]},o=this._evalSeries[i];W(o)||(this._evalSeries[i]=o=z_(e,{},a,!0));let s=e;return o&&(s=V({},e),z_(s,{value:t,series:r,dataItem:n.dataItem,min:this.valueRange.min,max:this.valueRange.max},a)),s}pointType(){return Sx}pointOptions(e,t){let n=this.seriesOptions[t];if(!n){let r=this.pointType().prototype.defaults;this.seriesOptions[t]=n=V({},r,{markers:{opacity:e.opacity},tooltip:{format:this.options.tooltip.format},labels:{format:this.options.labels.format}},e)}return Object.assign({},n)}createPoint(e,t){let n=t.series,r=this.pointOptions(n,t.seriesIx),i=t.color||n.color;r.pattern=t.pattern||r.pattern,r=this.evalPointOptions(r,e,t),wd(n.color)?i=r.color:this.valueRange.max!==0&&(i=xx(i)(e.value/this.valueRange.max));let a=new Sx(e,r);return a.color=i,this.append(a),a}seriesAxes(e){let{xAxis:t,yAxis:n}=e,r=this.plotArea,i=t?r.namedXAxes[t]:r.axisX,a=n?r.namedYAxes[n]:r.axisY;if(!i)throw Error(`Unable to locate X axis with name `+t);if(!a)throw Error(`Unable to locate Y axis with name `+n);return{xAxis:i,yAxis:a}}reflow(e){let t=this.points,n=!this.options.clip,r=0;this.traverseDataPoints((e,i)=>{let a=t[r++],{xAxis:o,yAxis:s}=this.seriesAxes(i.series),c=o.categoryIndex(e.x),l=s.categoryIndex(e.y),u=o.getSlot(c,c,n),d=s.getSlot(l,l,n);if(a)if(u&&d){let e=this.pointSlot(u,d);a.reflow(e)}else a.visible=!1}),this.box=e}pointSlot(e,t){return new Z(e.x1,t.y1,e.x2,t.y2)}traverseDataPoints(e){let{options:{series:t}}=this;for(let n=0;n<t.length;n++){let r=t[n],{xAxis:i,yAxis:a}=this.seriesAxes(r),o=i.currentRangeIndices(),s=a.currentRangeIndices();for(let t=0;t<r.data.length;t++){let{valueFields:c,fields:l}=this.plotArea.bindPoint(r,t),u=i.totalIndex(c.x),d=a.totalIndex(c.y),f=o.min<=u&&u<=o.max,p=s.min<=d&&d<=s.max;f&&p&&e(c,V({pointIx:t,series:r,seriesIx:n,dataItem:r.data[t],owner:this},l))}}}formatPointValue(e,t){let n=e.value;return this.chartService.format.auto(t,n.x,n.y,n.value)}animationPoints(){let e=this.points,t=[];for(let n=0;n<e.length;n++)t.push((e[n]||{}).marker);return t}};J(Cx,{series:[],tooltip:{format:`{0}, {1}: {2}`},labels:{format:`{2}`},clip:!0});var wx=class extends Kv{initFields(){this.namedXAxes={},this.namedYAxes={}}render(e=this.panes){this.bindCategories(),this.createAxes(e),this.createCharts(e),this.createAxisLabels()}bindCategories(){let e=this.srcSeries||this.series;for(let t=0;t<e.length;t++){let n=e[t],r=n.data||[],{xAxis:i,yAxis:a}=this.seriesAxes(n),o=Of(i.categories||[]),s=Of(a.categories||[]);for(let e=0;e<r.length;e++){let{x:t,y:r}=Y.current.bindPoint(n,e).valueFields;o.has(t)||o.add(t),s.has(r)||s.add(r)}i.categories=o.values(),a.categories=s.values()}}createCharts(e){let t=this.groupSeriesByPane();for(let n=0;n<e.length;n++){let r=e[n],i=t[r.options.name||`default`]||[];this.addToLegend(i);let a=this.filterVisibleSeries(i);a&&this.createHeatmapChart(B_(a,[_g]),r)}}createHeatmapChart(e,t){let n=new Cx(this,{series:e});this.appendChart(n,t)}seriesPaneName(e){let t=this.options,n=e.xAxis,r=[].concat(t.xAxis),i=zd(r,function(e){return e.name===n})[0],a=e.yAxis,o=[].concat(t.yAxis),s=zd(o,function(e){return e.name===a})[0],c=(t.panes||[{}])[0].name||`default`;return(i||{}).pane||(s||{}).pane||c}seriesAxes(e){let t,n,r=this.options,i=[].concat(r.xAxis),a=e.xAxis;t=a?i.find(e=>e.name===a):i[0];let o=[].concat(r.yAxis),s=e.yAxis;if(n=s?o.find(e=>e.name===s):o[0],!t)throw Error(`Unable to locate X axis with name `+a);if(!n)throw Error(`Unable to locate Y axis with name `+s);return{xAxis:t,yAxis:n}}createAxisLabels(){let e=this.axes;for(let t=0;t<e.length;t++)e[t].createLabels()}createXYAxis(e,t,n){let r=e.name,i=t?this.namedYAxes:this.namedXAxes,a=Object.assign({axisCrossingValue:0},e,{vertical:t,reverse:t||this.chartService.rtl?!e.reverse:e.reverse,justified:!1}),o=a.categories?a.categories[0]:null,s=[a.min,a.max,o],c=this.series;for(let e=0;e<c.length;e++){let r=c[e],i=r[t?`yAxis`:`xAxis`];if(i===a.name||n===0&&!i){let e=Y.current.bindPoint(r,0).valueFields;s.push(e[t?`y`:`x`]);break}}let l;for(let e=0;e<s.length;e++)if(s[e]instanceof Date){l=!0;break}let u;u=R_(a.type,`date`)||!a.type&&l?lh:eh;let d=new u(a,this.chartService);if(d.axisIndex=n,r){if(i[r])throw Error(`${t?`Y`:`X`} axis with name ${r} is already defined`);i[r]=d}return this.appendAxis(d),d.indexCategories(),d}createAxes(e){let t=this.options,n=[].concat(t.xAxis),r=[],i=[].concat(t.yAxis),a=[];for(let t=0;t<n.length;t++)U(this.findPane(n[t].pane),e)&&r.push(this.createXYAxis(n[t],!1,t));for(let t=0;t<i.length;t++)U(this.findPane(i[t].pane),e)&&a.push(this.createXYAxis(i[t],!0,t));this.axisX=this.axisX||r[0],this.axisY=this.axisY||a[0]}removeAxis(e){let t=e.options.name;super.removeAxis(e),e.options.vertical?delete this.namedYAxes[t]:delete this.namedXAxes[t],e===this.axisX&&delete this.axisX,e===this.axisY&&delete this.axisY}_dispatchEvent(e,t,n){let r=e._eventCoordinates(t),i=new X(r.x,r.y),a=this.axes,o=a.length,s=[],c=[];for(let e=0;e<o;e++){let t=a[e];N_(t.options.vertical?c:s,t.getCategory(i))}s.length>0&&c.length>0&&e.trigger(n,{element:tf(t),originalEvent:t,x:K_(s),y:K_(c)})}updateAxisOptions(e,t){let n=e.options.vertical,r=this.groupAxes(this.panes),i=(n?r.y:r.x).indexOf(e);Ex(this.options,i,n,t),Ex(this.originalOptions,i,n,t)}crosshairOptions(e){return Object.assign({},e.options.crosshair,{zIndex:0})}_pointsByVertical(e,t=0){let n=this.axisX.options.reverse?t*-1:t,r=this.axisX.children,i=this._getPointAxisXIndex(e)+n;i=Cd(i,r.length);let a=r[i].value,o=this.filterPoints(e=>Tx(e.pointData().x,a)).sort((e,t)=>this._getPointAxisYIndex(e)-this._getPointAxisYIndex(t));return this.axisY.options.reverse?o.reverse():o}_pointsByHorizontal(e,t=0){let n=this.axisY.options.reverse?t*-1:t,r=this.axisY.children,i=this._getPointAxisYIndex(e)+n;i=Cd(i,r.length);let a=r[i].value,o=this.filterPoints(e=>Tx(e.pointData().y,a)).sort((e,t)=>this._getPointAxisXIndex(e)-this._getPointAxisXIndex(t));return this.axisX.options.reverse?o.reverse():o}_getPointAxisXIndex(e){return this._getPointAxisIndex(this.axisX,e.pointData().x)}_getPointAxisYIndex(e){return this._getPointAxisIndex(this.axisY,e.pointData().y)}_getPointAxisIndex(e,t){return e.children.findIndex(e=>Tx(t,e.value))}};function Tx(e,t){return e instanceof Date&&t instanceof Date?Gm(e,t):e===t}function Ex(e,t,n,r){let i=[].concat(n?e.yAxis:e.xAxis)[t];V(i,r)}J(wx,{xAxis:{},yAxis:{}}),V(wx.prototype,Qv);let Dx=`color`,Ox=`first`,kx=`noteText`;lb.current.register(Wy,[`bar`,pg,yg,Fg,cg,Mg,fg,bg,dg,Pg,lg,Ng,kg,Og,Lg,vg,Dg,Ig,...Gg]),lb.current.register(Bb,[Ag,jg,ug,...Gg]),lb.current.register(Yb,[`pie`]),lb.current.register(Qb,[mg]),lb.current.register(bx,[hg,gg]),lb.current.register(ox,[xg,Sg,Cg,...Gg]),lb.current.register(gx,[wg,Tg,Eg,...Gg]),lb.current.register(wx,[_g]),Y.current.register([`bar`,pg,yg,Fg,cg,Mg],[ie],[x_,Dx,kx,Yh,Xh,O_,k_]),Y.current.register([kg,Og,Dg,Ig],[`from`,`to`],[x_,Dx,kx,O_,k_]),Y.current.register([Lg,vg],[ie],[x_,Dx,kx,`summary`,O_,k_]),Y.current.register([xg,Sg,Cg],[`x`,`y`],[Dx,O_,k_]),Y.current.register([wg,Tg,Eg],[ie],[x_,Dx,O_,k_]),Y.current.register([hg,gg],[ie],[x_,Dx,`visibleInLegend`,`visible`,O_,k_]),ty.current.register([`bar`,pg,yg,Fg,cg,Mg,Lg,vg],{value:`max`,color:Ox,noteText:Ox,errorLow:`min`,errorHigh:`max`}),ty.current.register([kg,Og,Dg,Ig],{from:`min`,to:`max`,color:Ox,noteText:Ox}),ty.current.register([wg,Tg,Eg],{value:`max`,color:Ox}),Y.current.register([Ag,jg,ug],[`x`,`y`],[Dx,kx,Zh,Qh,$h,eg]),Y.current.register([ug],[`x`,`y`,`size`],[Dx,x_,kx,k_]),Y.current.register([_g],[`x`,`y`,ie],[Dx,kx,k_]),Y.current.register([fg,bg],[`open`,`high`,`low`,`close`],[x_,Dx,`downColor`,kx,k_]),ty.current.register([fg,bg],{open:`max`,high:`max`,low:`min`,close:`max`,color:Ox,downColor:Ox,noteText:Ox}),Y.current.register([lg,Ng],[`lower`,`q1`,`median`,`q3`,`upper`,`mean`,`outliers`],[x_,Dx,kx,O_,k_]),ty.current.register([lg,Ng],{lower:`max`,q1:`max`,median:`max`,q3:`max`,upper:`max`,mean:`max`,outliers:Ox,color:Ox,noteText:Ox}),Y.current.register([dg,Pg],[`current`,`target`],[x_,Dx,`visibleInLegend`,kx,O_,k_]),ty.current.register([dg,Pg],{current:`max`,target:`max`,color:Ox,noteText:Ox}),Y.current.register([`pie`,mg],[ie],[x_,Dx,`explode`,`visibleInLegend`,`visible`,O_,k_]);function Ax(e,t,n){let r=getComputedStyle(e),i=new Map;n.forEach(e=>{i.set(e,r.getPropertyValue(e))});let a=!1,o=()=>{if(!e.isConnected)return;let a=!1;n.forEach(e=>{let t=r.getPropertyValue(e);i.get(e)!==t&&(i.set(e,t),a=!0)}),a&&t()},s=setInterval(()=>{a||(a=!0,requestAnimationFrame(()=>{a=!1,o()}))},500);return{disconnect:()=>{clearInterval(s),i.clear()}}}let jx=`--kendo-chart-series-`,Mx=e=>e.ownerDocument.defaultView.getComputedStyle(e),Nx=(e,t)=>Mx(e).getPropertyValue(t),Px=(e,t)=>parseFloat(Mx(e).getPropertyValue(t)),Fx,Ix=(e,t)=>{let n=Mx(e).getPropertyValue(t);if(!n)return;Fx||=new Map;let r;return Fx.has(n)?r=Fx.get(n):(r=Ke(e,t),Fx.set(n,r)),r},Lx=(e,t,n,r)=>{let i=Mx(e);return[i.getPropertyValue(t),i.getPropertyValue(n),i.getPropertyValue(r)||i.fontFamily].join(` `)},Rx={};for(let e=1;e<=30;e++)Rx[`series-color-${e}`]=`${jx}${e}`;let zx=(e,t)=>{let n=`${jx}${t}`;return Ix(e,n)},Bx=e=>{let t=[],n=0;for(;n++<=30;){let r=zx(e,n);if(r===void 0)break;t.push(r)}return t},Vx=e=>typeof e==`string`&&e.endsWith(`ms`)?parseFloat(e):typeof e==`string`&&e.endsWith(`s`)?parseFloat(e)*1e3:parseFloat(e);function Hx(e){let t=(e||``).trim().match(/cubic-bezier\s*\(\s*([+-]?\d*\.?\d+)\s*,\s*([+-]?\d*\.?\d+)\s*,\s*([+-]?\d*\.?\d+)\s*,\s*([+-]?\d*\.?\d+)\s*\)\s*/i);return t?[Number(t[1]),Number(t[2]),Number(t[3]),Number(t[4])]:null}let Ux={text:`--kendo-chart-text`,chartBg:`--kendo-chart-bg`,fontWeight:`--kendo-font-weight`,fontFamily:`--kendo-font-family`},Wx={majorLines:`--kendo-chart-major-lines`,minorLines:`--kendo-chart-minor-lines`,areaOpacity:`--kendo-chart-area-opacity`,surface:`--kendo-color-surface`,primaryBg:`--kendo-chart-primary-bg`,crosshairBg:`--kendo-chart-crosshair-bg`,axisLabelFontSize:`--kendo-chart-label-font-size`,axisLabelFontWeight:`--kendo-font-weight`,axisLabelFontFamily:`--kendo-font-family`,chartFontSize:`--kendo-chart-font-size`,paneTitleFontSize:`--kendo-chart-pane-title-font-size`,paneTitleFontWeight:`--kendo-chart-pane-title-font-weight`,titleFontSize:`--kendo-chart-title-font-size`,titleFontWeight:`--kendo-font-weight`,errorBarsBg:`--kendo-chart-error-bars-bg`,areaInactiveOpacity:`--kendo-chart-area-inactive-opacity`,lineInactiveOpacity:`--kendo-chart-line-inactive-opacity`,bulletTarget:`--kendo-chart-bullet-target`,notesBg:`--kendo-chart-notes-bg`,notesBorder:`--kendo-chart-notes-border`,notesLines:`--kendo-chart-notes-lines`,inactive:`--kendo-chart-inactive`,initialAnimationDuration:`--kendo-duration-steady`,fadeInAnimationDuration:`--kendo-duration-rapid`,elasticEasing:`--kendo-easing-stretchy`,linearEasing:`--kendo-easing-linear`,swingEasing:`--kendo-easing-standard`},Gx={linksColor:`--kendo-color-subtle`},Kx={gaugePointer:`--kendo-chart-gauge-pointer`,gaugeTrack:`--kendo-chart-gauge-track`},qx=e=>Lx(e,Ux.fontWeight,Wx.chartFontSize,Ux.fontFamily),Jx=e=>Lx(e,Wx.paneTitleFontWeight,Wx.paneTitleFontSize,Ux.fontFamily),Yx=e=>Ix(e,Ux.text),Xx=e=>({color:Yx(e),font:Lx(e,Ux.fontWeight,Wx.titleFontSize,Ux.fontFamily)}),Zx=e=>{let t=Yx(e);return{labels:{color:t,font:qx(e)},title:{color:t}}},Qx=e=>{let t=Ix(e,Wx.inactive);return Object.assign({},{inactiveItems:{labels:{color:t},markers:{color:t}}},Zx(e))},$x=Object.assign({},Ux,Wx,Rx);Object.assign({},Ux,Gx,Rx),Object.assign({},Ux,Kx);let eS=e=>({icon:{background:Ix(e,Wx.notesBg),border:{color:Ix(e,Wx.notesBorder)}},line:{color:Ix(e,Wx.notesLines)},label:{font:qx(e)}}),tS=e=>{let t=$x,n=Ix(e,t.majorLines),r=Ix(e,t.text),i=Lx(e,t.axisLabelFontWeight,t.axisLabelFontSize,t.axisLabelFontFamily),a=Ix(e,t.chartBg),o=eS(e),s=Px(e,t.areaOpacity),c=Ix(e,t.surface),l=Ix(e,t.primaryBg),u=()=>({downColor:n,mean:{color:c},median:{color:c},whiskers:{color:l}}),d=()=>({line:{color:n}}),f=()=>({opacity:s,highlight:{inactiveOpacity:Px(e,t.areaInactiveOpacity)}}),p=()=>({highlight:{inactiveOpacity:Px(e,t.lineInactiveOpacity)}}),m=()=>({target:{color:r}}),h={steady:Vx(Nx(e,t.initialAnimationDuration))||600,rapid:Vx(Nx(e,t.fadeInAnimationDuration))||200,easeOutElastic:Hx(Nx(e,t.elasticEasing))||[.07,1.81,.3,.81],linear:Hx(Nx(e,t.linearEasing))||[0,0,1,1],swing:Hx(Nx(e,t.swingEasing))||[.42,0,.58,1]};return{axisDefaults:{crosshair:{color:Ix(e,t.crosshairBg)},labels:{color:r,font:i},line:{color:n},majorGridLines:{color:n},minorGridLines:{color:Ix(e,t.minorLines)},notes:structuredClone(o),title:{color:r,font:qx(e)}},categoryAxis:{highlight:{color:`#8C9FD9`,opacity:.15}},chartArea:{background:a},legend:Qx(e),seriesColors:Bx(e),seriesDefaults:{area:f(),verticalArea:f(),radarArea:f(),boxPlot:u(),verticalBoxPlot:u(),bullet:m(),verticalBullet:m(),horizontalWaterfall:d(),waterfall:d(),line:p(),verticalLine:p(),candlestick:{downColor:r,line:{color:r}},errorBars:{color:Ix(e,t.errorBarsBg)},icon:{border:{color:n}},labels:{background:a,color:r,font:i,opacity:s},notes:structuredClone(o)},subtitle:{color:r,font:Jx(e)},title:Xx(e),paneDefaults:{title:{font:Jx(e)}},motion:h}},nS=[x_,ie,`x`,`y`],rS=`mousedown`,iS=`mousemove`,aS=`contextmenu`,oS=`mouseleave`,sS=`keydown`,cS=`focus`,lS=`blur`,uS=`k-chart-overlay-top`,dS=e=>/^kendo-/i.test(e.nodeName)||e.nodeType===8;var fS=class{constructor(e,t,n,r={}){this.observers=[],this.addObserver(r.observer),this.chartService=new hm(this,r),this.chartService.theme=n,this._initElement(e);let i=V({},this.options,t);this._originalOptions=V({},i),this._theme=n,this._initTheme(i,n),this._focusState={},this._initHandlers(),this._createSurface=r.createSurface||vo.create.bind(vo),this._initSurface(),this.bindCategories(),cf.preloadFonts(t,()=>{this.fontLoaded=!0,this._destroyed||(this.trigger(`init`),this._redraw(),this._attachEvents(),this._restoreOverlayElement(),this._initStyleObserver())})}_initStyleObserver(){this._destroyStyleObserver(),this.options.observeStyles&&(this._stylesObserver=Ax(this.element,()=>{this.trigger(`styleChanged`)},Object.values($x)))}_destroyStyleObserver(){this._stylesObserver&&=(this._stylesObserver.disconnect(),null)}_initElement(e){this._setElementClass(e),e.style.position=`relative`,e.tabIndex=e.getAttribute(`tabindex`)?e.getAttribute(`tabindex`):0,e.setAttribute(`role`,`graphics-document document`);for(let t=e.childNodes.length-1;t>=0;t--){let n=e.childNodes[t];Bd(n,`k-chart-overlay`)?this.overlayElement=n:dS(n)||e.removeChild(n)}this.element=e}_setElementClass(e){ce(e,`k-chart`)}_restoreOverlayElement(){this.overlayElement&&(this._hasSeriesData()?this.overlayElement.style.display=`none`:(!this.options.title||this.options.title&&this.options.title.position!==`bottom`?ce(this.overlayElement,uS):ue(this.overlayElement,uS),this.overlayElement.style.display=``),this.overlayElement.parentElement!==this.element&&this.element.appendChild(this.overlayElement))}_hasSeriesData(){let e=this.options.series||[];return e.length>0&&e.some(e=>e.data&&e.data.length>0)}_initTheme(e,t){let n=[],r=e.series||[];for(let e=0;e<r.length;e++)n.push(Object.assign({},r[e]));e.series=n,pS(e),this.applyDefaults(e,t),e.seriesColors===null&&delete e.seriesColors,yd(e.title)&&(e.title={text:e.title}),this.options=V({},t,e),this.applySeriesColors()}getSize(){let e=this.options.chartArea||{};return{width:e.width?parseInt(e.width,10):Math.floor(this.element.offsetWidth),height:e.height?parseInt(e.height,10):Math.floor(this.element.offsetHeight)}}resize(e){let t=this.getSize(),n=this._size,r=t.width>0||t.height>0;e||r&&(!n||t.width!==n.width||t.height!==n.height)?(this._size=t,this._resize(t,e),this.trigger(`resize`,t)):r&&this._selections&&_f(this._selections,e=>!e.visible)&&(this._destroySelections(),this._setupSelection())}_resize(){this._noTransitionsRedraw()}redraw(e){if(this.applyDefaults(this.options),this.applySeriesColors(),e){let t=this._model._plotArea,n=t.findPane(e);t.redraw(n)}else this._redraw()}getAxis(e){return d(e,this._plotArea.axes)}findAxisByName(e){return this.getAxis(e)}findPaneByName(e){let t=this._plotArea.panes;for(let n=0;n<t.length;n++)if(t[n].options.name===e)return new f(t[n])}findPaneByIndex(e){let t=this._plotArea.panes;if(t[e])return new f(t[e])}plotArea(){return new p(this._plotArea)}toggleHighlight(e,t){let n=this._plotArea,r=(n.srcSeries||n.series||[])[0],i;if(wd(t))i=n.filterPoints(t);else{let e,a;Dd(t)?(e=t.series,a=t.category):e=a=t,i=r.type===`donut`?mS(n.pointsBySeriesName(e),a):U(r.type,[`pie`,`funnel`,`pyramid`])?mS((n.charts[0]||{}).points,a):n.pointsBySeriesName(e)}i&&this.togglePointsHighlight(e,i)}togglePointsHighlight(e,t){let n=this._highlight;for(let r=0;r<t.length;r++)n.togglePointHighlight(t[r],e)}showTooltip(e){let t=this._sharedTooltip(),{_tooltip:n,_plotArea:r}=this,i,a;if(wd(e)?(i=r.findPoint(e),i&&t&&(a=i.categoryIx)):t&&W(e)&&(a=r.categoryAxis.categoryIndex(e)),t){if(a>=0){let e=this._plotArea.pointsByCategoryIndex(a);n.showAt(e)}}else i&&n.show(i)}hideTooltip(){this._tooltip.hide()}_initSurface(){let e=this.surface,t=this._surfaceWrap(),n=this.options.chartArea||{};n.width&&$d(t,{width:n.width}),n.height&&$d(t,{height:n.height}),!e||e.options.type!==this.options.renderAs?(this._destroySurface(),this.surface=this._createSurface(t,{type:this.options.renderAs}),this.surface.bind(`mouseenter`,this._surfaceMouseenterHandler),this.surface.bind(`mouseleave`,this._surfaceMouseleaveHandler)):(this.surface.clear(),this.surface.resize()),this.element._kendoExportVisual=this._kendoExportVisual.bind(this)}_surfaceWrap(){return this.element}_redraw(){let e=this._getModel();this._size={width:e.options.width,height:e.options.height},this._destroyView(),this._setElementAccessibilityAttributes(),this._model=e,this._plotArea=e._plotArea,this._legend=e._legend,e.renderVisual();let t=this.options.transitions,n=this.options.motion||{};t!==!1&&e.traverse(function(e){e.animation&&(e.animation.options=Object.assign({},e.animation.options,{duration:void 0,motionConfig:Object.assign({},n)}),e.animation.setup())}),this._initSurface(),this.surface.draw(e.visual),t!==!1&&e.traverse(function(e){e.animation&&e.animation.play()}),this._tooltip=this._createTooltip(),this._highlight=new qy,this._setupSelection(),this._createPannable(),this._createZoomSelection(),this._createMousewheelZoom(),this._setComputedStyles(),this.trigger(d_),xS(this._plotArea.panes),this._navState||this._cancelDomEvents(),this._redrawFocusHighlight()}_setComputedStyles(){let e=this.titleHeight();this.element.style.setProperty(`--kendo-chart-computed-title-height`,`${e}px`)}_redrawFocusHighlight(){if(this._destroyed)return;let{_focusState:{legendInFocus:e,preserveHighlight:t}}=this;e&&t&&(this._focusElement(this._getFocusedLegendItem(),!1),this._focusState.preserveHighlight=!1)}_setElementAccessibilityAttributes(){let e=this.options.title,t=yd(e)?e:e.description||e.text;t&&this.element.setAttribute(`aria-roledescription`,t)}_kendoExportVisual(e){if(e&&e.width&&e.height){let t=this._originalOptions.chartArea||{},n={width:t.width||e.width,height:t.height||e.height};return this.exportVisual(n)}return this.exportVisual()}exportVisual(e){let t;if(e&&(e.width||e.height||e.options)){let n=this.options,r=V({},e.options,{chartArea:{width:e.width,height:e.height}});bS(this._originalOptions,r),this.options=V({},this._originalOptions,r),this._initTheme(this.options,this._theme),this.bindCategories();let i=this._getModel();i.renderVisual(),xS(i._plotArea.panes),t=i.visual,this.options=n}else t=this.surface.exportVisual();return t}_toggleCategoryHighlight(e,t){let n=this._plotArea,r=t||n.categoryAxis;if(this._categoryHighlightIndex===e&&this._categoryHighlightAxis===r)return;this._categoryHighlightIndex=e,this._categoryHighlightAxis=r;let i=r?(r.options||{}).highlight:null;if(!i||!i.visible||e===null){this._categoryHighlight&&this._categoryHighlight.visible(!1);return}this._categoryHighlight?(this._categoryHighlight.fill(i.color,i.opacity),this._categoryHighlight.options.set(`stroke`,i.border||null)):this._categoryHighlight=new N({fill:{color:i.color,opacity:i.opacity},stroke:i.border||null,closed:!0,zIndex:-1});let a=r.getSlot(e).toRect(),o=n.box;r.pane&&(o=r.pane.chartsBox()),r.options.vertical?(a.origin.x=o.x1,a.size.width=o.width()):(a.origin.y=o.y1,a.size.height=o.height());let s=N.fromRect(a);this._categoryHighlight.segments.elements(s.segments.elements()),this._categoryHighlight.visible(!0);let c=(r.pane||this._plotArea).visual;c&&this._categoryHighlight.parent!==c&&(this._categoryHighlight.parent&&this._categoryHighlight.parent.remove(this._categoryHighlight),c.insert(0,this._categoryHighlight))}_categoryHighlightEnabled(){return this._plotArea instanceof Wy&&[].concat(this.options.categoryAxis||{}).some(e=>e.highlight&&e.highlight.visible)}_sharedTooltip(){return this._plotArea instanceof Wy&&this.options.tooltip&&this.options.tooltip.shared}_createPannable(){let e=this.options;e.pannable!==!1&&(this._pannable=new Zy(this._plotArea,e.pannable))}_createZoomSelection(){let e=this.options.zoomable,t=(e||{}).selection;e!==!1&&t!==!1&&(this._zoomSelection=new Qy(this,t))}_createMousewheelZoom(){let e=this.options.zoomable,t=(e||{}).mousewheel;e!==!1&&t!==!1&&(this._mousewheelZoom=new $y(this,t))}_toggleDragZoomEvents(){let e=this.options.pannable,t=this.options.zoomable,n=(t||{}).selection,r=(t||{}).mousewheel,i=!e&&(t===!1||n===!1)&&!this.requiresHandlers([`dragStart`,`drag`,`dragEnd`]),a=(t===!1||r===!1)&&!this.requiresHandlers([`zoomStart`,`zoom`,`zoomEnd`]),o=this.element;this._dragZoomEnabled&&i&&a?(o.style.touchAction=this._touchAction||``,this._dragZoomEnabled=!1):!this._dragZoomEnabled&&!(i&&a)&&(o.style.touchAction=`none`,this._dragZoomEnabled=!0),this._toggleDomEvents(!i,!a)}_toggleDomEvents(e,t){let n=this.domEvents;n&&(n.toggleDrag&&n.toggleDrag(e),n.toggleZoom&&n.toggleZoom(t))}_createTooltip(){let{options:{tooltip:e}}=this,t;return t=this._sharedTooltip()?this._createSharedTooltip(e):new pb(this.chartService,e),t}_createSharedTooltip(e){return new mb(this._plotArea,e)}applyDefaults(e,t){hS(e,t),gS(e,t)}applySeriesColors(){let e=this.options,t=e.series,n=e.seriesColors||[];for(let e=0;e<t.length;e++){let r=t[e],i=n[e%n.length],a=r._defaults;r.color=r.color||i,a&&(a.color=a.color||i)}}_getModel(){let e=this.options,t=this._createPlotArea(),n=new $p(this._modelOptions());n.chart=this,n._plotArea=t;let r=sm.buildTitle(e.title),i=sm.buildTitle(e.subtitle,{align:e.title.align,position:e.title.position});if(n.append.apply(n,sm.orderTitles([r,i])),e.legend&&e.legend.visible){let e=new cb(t.options.legend,this.chartService);n.append(e),n._legend=e}return n.append(t),n.reflow(),this._setTitleBox(r,i),n}_setTitleBox(e,t){if(!e&&!t)return;this._titleBox=(e||t).box.clone();let n=e?e.options.position:``,r=t?t.options.position:``;n===r&&t?this._titleBox.wrap(t.box):e&&t&&r!==b&&(this._titleBox=t.box.clone())}_modelOptions(){let e=this.options,t=this.getSize();return V({transitions:e.transitions,width:t.width||600,height:t.height||400},e.chartArea)}_createPlotArea(e){let t=this.options;return lb.current.create(e?[]:t.series,t,this.chartService)}_setupSelection(){let{_plotArea:{axes:e}}=this,t=this._selections=[];for(let n=0;n<e.length;n++){let r=e[n],i=r.options;if(r instanceof eh&&i.select&&!i.vertical){let e=r.range(),n=new fb(this,r,V({min:e.min,max:e.max},i.select));t.push(n)}}}_selectStart(e){return this.trigger(c_,e)}_select(e){return this.trigger(l_,e)}_selectEnd(e){return this.trigger(u_,e)}_initHandlers(){this._clickHandler=this._click.bind(this),this._keydownHandler=this._keydown.bind(this),this._focusHandler=this._focus.bind(this),this._blurHandler=this._blur.bind(this),this._mousedownHandler=this._mousedown.bind(this),this._mousewheelHandler=this._mousewheel.bind(this),this._mouseleaveHandler=this._mouseleave.bind(this),this._surfaceMouseenterHandler=this._mouseover.bind(this),this._surfaceMouseleaveHandler=this._mouseout.bind(this),this._mousemoveThrottled=Ae(this._mousemove.bind(this),20)}addObserver(e){e&&this.observers.push(e)}removeObserver(e){let t=this.observers.indexOf(e);t>=0&&this.observers.splice(t,1)}requiresHandlers(e){let t=this.observers;for(let n=0;n<t.length;n++)if(t[n].requiresHandlers(e))return!0}trigger(e,t={}){t.sender=this,e===`showTooltip`?t.anchor.point=this._toDocumentCoordinates(t.anchor.point):e===`seriesOver`?this._updateDrilldownPoint(t.point):e===`seriesLeave`?this._resetDrilldownPoint():e===`seriesClick`?(this._focusPoint(t.point),this._startDrilldown(t.point)):e===`legendItemClick`&&this._focusLegendItem(t);let n=this.observers,r=!1;for(let i=0;i<n.length;i++)n[i].trigger(e,t)&&(r=!0);return r}titleHeight(){return this._titleBox?this._titleBox.height():0}_attachEvents(){let e=this.element;this._touchAction=e.style.touchAction,Xd(e,{[aS]:this._clickHandler,[T_]:this._mousewheelHandler,[oS]:this._mouseleaveHandler,[sS]:this._keydownHandler,[rS]:this._mousedownHandler,[cS]:this._focusHandler,[lS]:this._blurHandler}),this._shouldAttachMouseMove()&&Xd(e,{[iS]:this._mousemoveThrottled}),this.domEvents=_m.create(this.element,{start:this._start.bind(this),move:this._move.bind(this),end:this._end.bind(this),tap:this._tap.bind(this),gesturestart:this._gesturestart.bind(this),gesturechange:this._gesturechange.bind(this),gestureend:this._gestureend.bind(this)}),this._toggleDragZoomEvents()}_mouseleave(e){this._hoveredPoint&&=(this._hoveredPoint.out(this,e),null),this._plotAreaHovered&&(this._plotAreaHovered=!1,this.trigger(t_)),this._hasInactiveOpacity()&&this._activeChartInstance&&(this._applySeriesOpacity(this._activeChartInstance.children,null,!0),this._updateSeriesOpacity(null,!0))}_cancelDomEvents(){this.domEvents&&this.domEvents.cancel&&this.domEvents.cancel()}_gesturestart(e){this._mousewheelZoom&&!this._stopChartHandlers(e)&&(this._gestureDistance=e.distance,this._unsetActivePoint(),this._clearFocusedElement(),this.surface.suspendTracking())}_gestureend(e){this._zooming&&!this._stopChartHandlers(e)&&(this.surface&&this.surface.resumeTracking(),this._zooming=!1,this.trigger(s_,{axisRanges:vS(this._plotArea.axes),originalEvent:e}))}_gesturechange(e){let t=this._mousewheelZoom;if(t&&!this._stopChartHandlers(e)){e.preventDefault();let n=this._gestureDistance,r=-e.distance/n+1;if(Math.abs(r)>=.1){r=Math.round(r*10),this._gestureDistance=e.distance;let n={delta:r,axisRanges:vS(this._plotArea.axes),originalEvent:e};if(this._zooming||!this.trigger(`zoomStart`,n)){let i=this._eventCoordinates(e);this._zooming||=!0,(n.axisRanges=t.updateRanges(r,i))&&!this.trigger(`zoom`,n)&&t.zoom()}}}}_mouseout(e){if(e.element){let t=this._drawingChartElement(e.element,e);t&&t.leave&&t.leave(this,e.originalEvent)}}_start(e){let t=this._eventCoordinates(e);this._stopChartHandlers(e)||!this._plotArea.backgroundContainsPoint(t)||(this.requiresHandlers([`dragStart`,`drag`,`dragEnd`])&&this._startNavigation(e,t,i_),this._pannable&&this._pannable.start(e)&&(this.surface.suspendTracking(),this._unsetActivePoint(),this._clearFocusedElement(),this._suppressHover=!0,this.chartService.panning=!0),this._zoomSelection&&this._zoomSelection.start(e)&&this.trigger(a_,{axisRanges:vS(this._plotArea.axes),originalEvent:e}))}_move(e){let{_navState:t,_pannable:n}=this;if(!this._stopChartHandlers(e)){if(n){let t=n.move(e);t&&!this.trigger(`drag`,{axisRanges:t,originalEvent:e})&&n.pan()}else if(t){let n={},r=t.axes;for(let t=0;t<r.length;t++){let i=r[t];if(i.options.name){let t=i.options.vertical?e.y:e.x,r=t.startLocation-t.location;r!==0&&(n[i.options.name]=i.translateRange(r))}}t.axisRanges=n,this.trigger(n_,{axisRanges:n,originalEvent:e})}this._zoomSelection&&this._zoomSelection.move(e)}}_end(e){if(this._stopChartHandlers(e))return;let t=this._pannable;if(t&&t.end(e)?(this.surface.resumeTracking(),this.trigger(r_,{axisRanges:vS(this._plotArea.axes),originalEvent:e}),this._suppressHover=!1,this.chartService.panning=!1):this._endNavigation(e,r_),this._zoomSelection){let t=this._zoomSelection.end(e);t&&!this.trigger(`zoom`,{axisRanges:t,originalEvent:e})&&(this._zoomSelection.zoom(),this.trigger(s_,{axisRanges:t,originalEvent:e}))}}_stopChartHandlers(e){let t=this._selections||[];if(!t.length)return!1;let n=this._eventCoordinates(e),r=this._plotArea.paneByPoint(n);if(r){for(let e=0;e<t.length;e++)if(t[e].onPane(r))return!0}}_mousewheelZoomRate(){let e=(this.options.zoomable||{}).mousewheel||{};return q(e.rate,E_)}_mousewheel(e){let t=Jd(e),n=this._mousewheelZoom,r=this._eventCoordinates(e);if(!(this._stopChartHandlers(e)||!this._plotArea.backgroundContainsPoint(r)))if(n){let i={delta:t,axisRanges:vS(this._plotArea.axes),originalEvent:e};(this._zooming||!this.trigger(`zoomStart`,i))&&(e.preventDefault(),this._zooming||=(this._unsetActivePoint(),this._clearFocusedElement(),this.surface.suspendTracking(),!0),this._mwTimeout&&clearTimeout(this._mwTimeout),i.axisRanges=n.updateRanges(t,r),i.axisRanges&&!this.trigger(`zoom`,i)&&n.zoom(),this._mwTimeout=setTimeout(()=>{this.trigger(s_,i),this._zooming=!1,this.surface&&this.surface.resumeTracking()},150))}else{let n=this._navState;if(n||this._startNavigation(e,r,a_)||(n=this._navState),n){let i=n.totalDelta||t;n.totalDelta=i+t;let a=this._navState.axes,o={};for(let e=0;e<a.length;e++){let t=a[e],n=t.options.name;n&&(o[n]=t.scaleRange(-i*this._mousewheelZoomRate(),r))}this.trigger(o_,{delta:t,axisRanges:o,originalEvent:e}),this._mwTimeout&&clearTimeout(this._mwTimeout),this._mwTimeout=setTimeout(()=>{this._endNavigation(e,s_)},150)}}}_startNavigation(e,t,n){let r=this._model._plotArea,i=r.findPointPane(t),a=r.axes.slice(0);if(!i)return;let o=vS(a);this.trigger(n,{axisRanges:o,originalEvent:e})?this._cancelDomEvents():(this._suppressHover=!0,this._unsetActivePoint(),this._clearFocusedElement(),this._navState={axisRanges:o,pane:i,axes:a})}_endNavigation(e,t){this._navState&&=(this.trigger(t,{axisRanges:this._navState.axisRanges,originalEvent:e}),this._suppressHover=!1,null)}_getChartElement(e,t){let n=this.surface.eventTarget(e);if(n)return this._drawingChartElement(n,e,t)}_drawingChartElement(e,t,n){let r=e,i;for(;r&&!i;)i=r.chartElement,r=r.parent;if(i)return i.aliasFor&&(i=i.aliasFor(t,this._eventCoordinates(t))),n&&(i=i.closest(n),i&&i.aliasFor&&(i=i.aliasFor())),i}_eventCoordinates(e){let t=ef(e);return this._toModelCoordinates(t.x,t.y)}_elementPadding(){if(!this._padding){let{paddingLeft:e,paddingTop:t}=jd(this.element,[`paddingLeft`,`paddingTop`]);this._padding={top:t,left:e}}return this._padding}_toDocumentCoordinates(e){let t=this._elementPadding(),n=Qd(this.element);return{left:K(e.x+t.left+n.left),top:K(e.y+t.top+n.top)}}_toModelCoordinates(e,t){let n=this.element,r=Qd(n),i=this._elementPadding(),a=Sf(n).invert(),o=new A(e-r.left-i.left,t-r.top-i.top).transform(a);return new X(o.x,o.y)}_tap(e){let t=this.surface.eventTarget(e),n=this._drawingChartElement(t,e),r=this._sharedTooltip();!this._startHover(t,e)&&!r&&this._unsetActivePoint(),r&&this._trackSharedTooltip(this._eventCoordinates(e),e,!0),this._propagateClick(n,e),this.handlingTap=!0,setTimeout(()=>{this.handlingTap=!1},0)}_click(e){let t=this._getChartElement(e);this._propagateClick(t,e)}_propagateClick(e,t){let n=e;for(;n;)n.click&&n.click(this,t),n=n.parent}_isLegendBeforeChart(){let{options:{legend:{position:e}},_legend:t}=this;return t&&t.hasItems()&&(e===`top`||e===`left`)}_focus(){this._preventInitialPointFocus||(this._isLegendBeforeChart()?this._focusFirstLegendItem():this._focusFirstPoint()),this._preventInitialPointFocus=!1}_keydown(e){let{_focusState:{legendInFocus:t,focusedElement:n},_legend:r}=this;if(e.key===`Tab`){this._clearFocusedElement();let n=this._isLegendBeforeChart();t&&n!==e.shiftKey?this._navigatePoints(e):!t&&n===e.shiftKey&&r.hasItems()&&this._navigateLegend(e)}else e.key===`Escape`?(n&&e.stopPropagation(),this._tooltip&&this._tooltip.visible?this._hideTooltip():this._blur()):e.key===`Enter`?n&&(this._focusState.preserveHighlight=!0,this._propagateClick(n,e),this._focusElement(n)):t?this._navigateLegend(e):this._navigatePoints(e)}_navigatePoints(e){let{_focusState:t,_plotArea:n}=this;if(t.legendInFocus=!1,!t.focusedElement){this._focusFirstPoint(),e.preventDefault();return}let r=n=>{t.focusedPoint=n,this._focusElement(t.focusedPoint),this._displayTooltip(n),e.preventDefault()};switch(e.key){case _:r(n.getPointToTheRight(t.focusedPoint));break;case g:r(n.getPointToTheLeft(t.focusedPoint));break;case h:r(n.getPointBelow(t.focusedPoint));break;case m:r(n.getPointAbove(t.focusedPoint));break;default:break}}_navigateLegend(e){let{_focusState:t,_legend:n,chartService:{rtl:r}}=this;if(t.legendInFocus=!0,!t.focusedElement){this._focusFirstLegendItem(),e.preventDefault();return}let i=n.getItems().length,a=n=>{t.focusedLegendItemIndex=n(t.focusedLegendItemIndex,i),this._focusElement(this._getFocusedLegendItem()),e.preventDefault()};switch(e.key){case m:case g:a(r?xd:Sd);break;case h:case _:a(r?Sd:xd);break;default:break}}_focusFirstPoint(){let e=this._focusState.focusedPoint=this._plotArea.getFirstPoint();e&&(this._focusElement(e),this._displayTooltip(e))}_hasFocus(){return this.element.ownerDocument.activeElement===this.element}_mousedown(){this._hasFocus()||(this._preventInitialPointFocus=!0)}_focusChart(){this._hasFocus()||(this._preventInitialPointFocus=!0,this.element.focus())}_focusPoint(e){this._focusState.focusedPoint=e,this._focusChart(),this._focusElement(e,!0)}_focusFirstLegendItem(){let{_focusState:e}=this;e.focusedLegendItemIndex=0,this._focusElement(this._getFocusedLegendItem()),e.legendInFocus=!0,this._hideTooltip()}_focusLegendItem(e){let{_focusState:t}=this;t.focusedLegendItemIndex=this._legend.getItems().findIndex(t=>t.options.series.index===e.seriesIndex&&t.options.pointIndex===e.pointIndex),t.legendInFocus=!0,this._focusChart(),this._focusElement(this._getFocusedLegendItem(),!0)}_getFocusedLegendItem(){let{_focusState:e,_legend:t}=this;return t.getItems()[e.focusedLegendItemIndex]}_focusElement(e,t){let{_focusState:n}=this;if(this._clearFocusedElement(),e&&(n.focusedElement=e,this._setElementActiveDescendant(e),!t))if(e.focusVisual(),n.legendInFocus){let t=e.options;this._showSeriesInactiveOpacity(t.series.index,t.pointIndex)}else this._showInactiveOpacity(e)}_clearFocusedElement(){let{_focusState:e}=this;e&&(e.focusedElement&&e.focusedElement.clearFocusFromVisual&&(e.focusedElement.clearFocusFromVisual(),this._clearElementActiveDescendant()),e.focusedElement=null)}_setElementActiveDescendant(e){this.options.renderAs===`canvas`&&(this._pseudoFocusedElement=this._createPseudoFocusedElement(e),this.element.append(this._pseudoFocusedElement)),this.element.setAttribute(v,e._id)}_clearElementActiveDescendant(){this._pseudoFocusedElement&&=(this._pseudoFocusedElement.remove(),null),this.element.removeAttribute(v)}_createPseudoFocusedElement(e){let t=document.createElement(`div`),n=e.options.accessibility;t.id=e._id,t.setAttribute(`aria-label`,e.getAriaLabelText()),t.setAttribute(`role`,n.role),t.setAttribute(`aria-roledescription`,n.ariaRoleDescription);let r=n.ariaChecked;return W(r)&&t.setAttribute(`aria-checked`,r),t}_blur(){this._focusState.legendInFocus=!1,this._clearFocusedElement(),this._hideInactiveOpacity()}_startHover(e,t){if(this._suppressHover)return!1;let n=this._drawingChartElement(e,t,function(e){return(e.hover||e.over)&&!(e instanceof Kv)}),r=this._activePoint;return this._updateHoveredPoint(n,t),n&&r!==n&&n.hover&&(this._activePoint=n,!this._sharedTooltip()&&!n.hover(this,t)&&(this._displayTooltip(n),this._showInactiveOpacity(n))),n}_displayTooltip(e){V({},this.options.tooltip,e.options.tooltip).visible&&(this._sharedTooltip()&&e.box?this._trackSharedTooltip(e.box.center(),{}):this._tooltip.show(e))}_hideTooltip(){this._tooltip&&this._tooltip.hide()}_displayInactiveOpacity(e,t,n){let r=this._activeChartInstance=this._chartInstanceFromPoint(e);if(r)if(t)this._updateSeriesOpacity(e),this._applySeriesOpacity(r.children,null,!0),this._applySeriesOpacity(r.children,e.series),this._highlight.show(n||e);else{let t;if(!r.supportsPointInactiveOpacity()){this._highlight.show(e);return}t=this._getInactivePoints(e,r),t&&t.length&&this._highlight.show(t,this._getInactiveOpacityForSeries(e.series))}}_getInactivePoints(e,t){return this._getAllPointsOfType(t,e.constructor).filter(t=>t!==e)}_getAllPointsOfType(e,t){let n=[];for(let r=0;r<e.children.length;r++){let i=e.children[r];i.constructor===t?n.push(i):i.children&&i.children.length&&(n=n.concat(this._getAllPointsOfType(i,t)))}return n}_updateHoveredPoint(e,t){let n=this._hoveredPoint;n&&n!==e&&(n.out(this,t),this._hoveredPoint=null),e&&n!==e&&e.over&&(this._hoveredPoint=e,e.over(this,t))}_updateDrilldownPoint(e){if(!e||!e.series)return;let{fields:t}=Y.current.bindPoint(e.series,null,e.dataItem);t.drilldown&&(this._drilldownState={cursor:this.element.style.cursor},this.element.style.cursor=`pointer`)}_resetDrilldownPoint(){this._drilldownState&&=(this.element.style.cursor=this._drilldownState.cursor,null)}_startDrilldown(e){if(!e||!e.series)return;let t=e.series,{fields:n}=Y.current.bindPoint(t,null,e.dataItem),r=n.drilldown;if(r){let n={series:t,point:e,value:r,sender:this};this.trigger(D_,n)}}_updateSeriesOpacity(e,t){let n=this._plotArea,r=n.series.length;for(let i=0;i<r;i++){let r=n.series[i],a=this._getDefaultOpacityForSeries(r),o=this._getInactiveOpacityForSeries(r);!t&&r!==e.series?(r.defaultOpacity=a,r.opacity=o,r.line&&(r.line.opacity=o)):(r.opacity=a,r.line&&(r.line.opacity=a))}}_applySeriesOpacity(e,t,n,r){for(let i=0;i<e.length;i++){let a=e[i],o=a.series||r;if(o&&(o.highlight||{}).visible&&a.visual){let e=r?r.opacity:a.series.opacity;(o!==t||n)&&a.visual.opacity(n?1:e)}a.children&&a.children.length&&this._applySeriesOpacity(a.children,t,n,a.series)}}_chartInstanceFromPoint(e){let t=e.parent;for(;t&&!t.plotArea;)t=t.parent;return t}_showInactiveOpacity(e){let t=this._plotArea.series.length>1;this._hasInactiveOpacity()?this._displayInactiveOpacity(e,t):this._highlight.show(e)}_hideInactiveOpacity(e){let t=this._plotArea.series.length>1;this._hasInactiveOpacity()&&(t&&this._activeChartInstance&&(this._updateSeriesOpacity(e,!0),this._applySeriesOpacity(this._activeChartInstance.children,null,!0),this._activeChartInstance=null),this._highlight&&this._highlight.hide(),this._activePoint=null)}_hasInactiveOpacity(){let e=this.options.seriesDefaults.highlight.inactiveOpacity!==void 0,t=this.options.series.filter(e=>e.highlight.inactiveOpacity!==void 0).length>0;return e||t}_getInactiveOpacityForSeries(e){let t=this.options.seriesDefaults.highlight.inactiveOpacity,n=e.highlight.inactiveOpacity;return n===void 0?t===void 0?e.opacity===void 0?1:e.opacity:t:n}_getDefaultOpacityForSeries(e){return e.defaultOpacity||e.opacity||1}_mouseover(e){let t=this._startHover(e.element,e.originalEvent);t&&t.tooltipTracking&&!this._mouseMoveTrackHandler&&!this._sharedTooltip()&&(this._mouseMoveTrackHandler=this._mouseMoveTracking.bind(this),Xd(document,{[iS]:this._mouseMoveTrackHandler}))}_mouseMoveTracking(e){let{options:t,_tooltip:n,_highlight:r,_activePoint:i}=this,a=this._eventCoordinates(e);if(this._plotArea.box.containsPoint(a)){if(i&&i.tooltipTracking&&i.series&&i.parent.getNearestPoint){let o=i.parent.getNearestPoint(a.x,a.y,i.seriesIx);o&&o!==i&&(this._activePoint=o,o.hover(this,e)||(V({},t.tooltip,o.options.tooltip).visible&&n.show(o),r.show(o)))}}else sf(document,{[iS]:this._mouseMoveTrackHandler}),this._unsetActivePoint(),this._clearFocusedElement(),this._mouseMoveTrackHandler=null,this._hideInactiveOpacity(i)}_mousemove(e){let t=this._eventCoordinates(e),n=this._plotArea;if(this._trackCrosshairs(t),n.hover){let r=n.backgroundContainsPoint(t);r?(this._plotAreaHovered=!0,this._plotArea.hover(this,e)):this._plotAreaHovered&&!r&&(this._plotAreaHovered=!1,this.trigger(t_))}this._sharedTooltip()&&this._trackSharedTooltip(t,e),this._categoryHighlightEnabled()&&this._trackCategoryHighlight(t)}_trackCategoryHighlight(e){let{_plotArea:t}=this,n=t.categoryAxisByPoint(e)||t.categoryAxis;if(t.backgroundContainsPoint(e)){let t=n.pointCategoryIndex(e);this._toggleCategoryHighlight(t,n)}else this._toggleCategoryHighlight(null)}_trackCrosshairs(e){let t=this._plotArea.crosshairs;for(let n=0;n<t.length;n++){let r=t[n];r.box.containsPoint(e)?r.showAt(e):r.hide()}}_trackSharedTooltip(e,t,n){if(this._suppressHover)return;let{options:{tooltip:r},_plotArea:i,_plotArea:{categoryAxis:a},_tooltip:o,_highlight:s}=this;if(i.backgroundContainsPoint(e)){let c=a.pointCategoryIndex(e);if(c!==this._tooltipCategoryIx||!this._sharedHighlight&&n){let n=i.pointsByCategoryIndex(c),a=n.map(function(e){return e.eventArgs(t)}),l=a[0]||{};l.categoryPoints=a,n.length>0&&!this.trigger(`seriesHover`,l)?(r.visible&&o.showAt(n,e),s.show(n),this._sharedHighlight=!0):o.hide(),this._tooltipCategoryIx=c}else n&&this._sharedHighlight&&(s.hide(),o.hide(),this._sharedHighlight=!1)}else this._sharedHighlight&&=(s.hide(),o.hide(),this._tooltipCategoryIx=null,!1)}hideElements(e){let t=this._plotArea;this._mousemoveThrottled.cancel(),t.hideCrosshairs(),this._unsetActivePoint(e),this._toggleCategoryHighlight(null)}_unsetActivePoint(e){let{_highlight:t}=this;this._activePoint=null,this._hoveredPoint=null,(!e||!e.keepTooltipOpen)&&this._hideTooltip(),this._tooltipCategoryIx=null,this._sharedHighlight=!1,t&&t.hide()}_deferRedraw(){this._redraw()}_clearRedrawTimeout(){this._redrawTimeout&&=(clearInterval(this._redrawTimeout),null)}bindCategories(){let e=this.options,t=[].concat(e.categoryAxis);for(let e=0;e<t.length;e++){let n=t[e];n.autoBind!==!1&&this.bindCategoryAxisFromSeries(n,e)}}bindCategoryAxisFromSeries(e,t){let n=new Set,r=this.options.series.filter(n=>n.categoryAxis===e.name||!n.categoryAxis&&t===0),i=r.some(e=>!!e.categoryField),a=r.filter(e=>e.data&&e.data.length>0),o=a.map(e=>Y.current.bindPoint(e,0).fields.category),s=o.reduce((t,n)=>t||G_(e,n),!1);if(a.filter((e,t)=>e.categoryField||W(o[t])).forEach(e=>e.data.forEach((t,r)=>{let i=Y.current.bindPoint(e,r).fields.category;if(s){let e=H_(i,t,this.chartService.intl);i=e?e.getTime():void 0}n.add(i)})),n.size>0){let t=Array.from(n.values());s&&(t=t.sort().map(e=>e&&new Date(e))),e.categories=t}else i&&(e.categories=[])}_isBindable(e){let t=Y.current.valueFields(e),n=!0;for(let r=0;r<t.length;r++){let i=t[r];if(i===`value`?i=`field`:i+=`Field`,!W(e[i])){n=!1;break}}return n}_noTransitionsRedraw(){let e=this.options,t;e.transitions!==!1&&(t=e.transitions,e.transitions=!1),this._redraw(),t&&(e.transitions=t)}_legendItemHover(e,t){this._showSeriesInactiveOpacity(e,t)}_showSeriesInactiveOpacity(e,t){let{_plotArea:n,_highlight:r}=this,i=(n.srcSeries||n.series)[e],a;if(a=U(i.type,[`pie`,`donut`,`funnel`,`pyramid`])?n.findPoint(function(n){return n.series.index===e&&n.index===t}):n.pointsBySeriesIndex(e),this._hasInactiveOpacity()&&i.visible&&a){let e=n.series.length>1,t=a.length?a[0]:a;this._displayInactiveOpacity(t,e,a)}else r.show(a)}_shouldAttachMouseMove(){return this._plotArea.crosshairs.length||this._tooltip&&this._sharedTooltip()||this._categoryHighlightEnabled()||this.requiresHandlers([`plotAreaHover`,`plotAreaLeave`])}updateMouseMoveHandler(){sf(this.element,{[iS]:this._mousemoveThrottled}),this._shouldAttachMouseMove()&&Xd(this.element,{[iS]:this._mousemoveThrottled})}applyTheme(e){let t=Object.assign({},this._originalOptions);requestAnimationFrame(()=>{this.applyOptions(t,e),this.noTransitionsRedraw()})}applyOptions(e,t){bS(this._originalOptions,e),this._originalOptions=V(this._originalOptions,e),this.options=V({},this._originalOptions),t&&(this._theme=t,this.chartService.theme=t),this._initTheme(this.options,this._theme),this._toggleDragZoomEvents()}setOptions(e,t){this.applyOptions(e,t),this.bindCategories(),this.redraw(),this.updateMouseMoveHandler(),this._restoreOverlayElement(),this._initStyleObserver()}setDirection(e){this.chartService.rtl=!!e,this.surface&&this.surface.type===`svg`&&this._destroySurface()}setIntlService(e){this.chartService.intl=e}noTransitionsRedraw(){this._noTransitionsRedraw()}destroy(){this._destroyed=!0,sf(this.element,{[aS]:this._clickHandler,[T_]:this._mousewheelHandler,[iS]:this._mousemoveThrottled,[oS]:this._mouseleaveHandler,[rS]:this._mousedownHandler,[sS]:this._keydownHandler,[cS]:this._focusHandler,[lS]:this._blurHandler}),this.domEvents&&(this.domEvents.destroy(),delete this.domEvents),this._mouseMoveTrackHandler&&sf(document,{[iS]:this._mouseMoveTrackHandler}),this._focusState=null,this.element._kendoExportVisual=null,this._destroyView(),this._destroySurface(),this._clearRedrawTimeout(),this._destroyStyleObserver()}_destroySurface(){let e=this.surface;e&&(e.unbind(`mouseenter`,this._surfaceMouseenterHandler),e.unbind(`mouseleave`,this._surfaceMouseleaveHandler),e.destroy(),this.surface=null)}_destroySelections(){let e=this._selections;if(e)for(;e.length>0;)e.shift().destroy()}_destroyView(){let e=this._model;e&&(e.destroy(),this._model=null),this._unsetActivePoint(),this._clearFocusedElement(),this._resetDrilldownPoint(),this._destroySelections(),this._tooltip&&this._tooltip.destroy(),this._highlight&&this._highlight.destroy(),this._zoomSelection&&(this._zoomSelection.destroy(),delete this._zoomSelection),this._pannable&&(this._pannable.destroy(),delete this._pannable),this._mousewheelZoom&&(this._mousewheelZoom.destroy(),delete this._mousewheelZoom)}};function pS(e){let t=nS;for(let n=0;n<t.length;n++){let r=t[n]+`Axes`;e[r]&&(e[t[n]+`Axis`]=e[r],delete e[r])}}function mS(e,t){if(e){for(let n=0;n<e.length;n++)if(e[n].category===t)return[e[n]]}}function hS(e,t){let n=(t||{}).axisDefaults||{},r,i,a;function o(e){let t=(e||{}).color||i.color,a=V({},n,n[r],i,i[r],{line:{color:t},labels:{color:t},title:{color:t}},e);return delete a[r],a}for(let t=0;t<nS.length;t++)r=nS[t]+`Axis`,i=e.axisDefaults||{},a=[].concat(e[r]),a=a.map(o),e[r]=a.length>1?a:a[0]}function gS(e,t){let n=e.series,r=n.length,i=e.seriesDefaults,a=V({},e.seriesDefaults),o=t?V({},t.seriesDefaults):{},s=V({},o);_S(a),_S(s);for(let t=0;t<r;t++){let r=n[t].type||e.seriesDefaults.type,c=V({data:[]},s,o[r],{tooltip:e.tooltip},a,i[r]);n[t]._defaults=c,n[t]=V({},c,n[t]),n[t].data=n[t].data||[]}}function _S(e){delete e.bar,delete e.column,delete e.rangeColumn,delete e.line,delete e.verticalLine,delete e.pie,delete e.donut,delete e.area,delete e.verticalArea,delete e.scatter,delete e.scatterLine,delete e.bubble,delete e.candlestick,delete e.ohlc,delete e.boxPlot,delete e.bullet,delete e.verticalBullet,delete e.polarArea,delete e.polarLine,delete e.radarArea,delete e.radarLine,delete e.waterfall}function vS(e){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=r.options.name;i&&(t[i]=r.range())}return t}let yS=[`data`,`categories`];function bS(e,t){for(let n in t)if(!U(n,yS)&&jf(t,n)){let r=t[n],i=e[n];if(W(i)){let a=r===null;a||!W(r)?(delete e[n],a&&delete t[n]):i&&Dd(r)&&Dd(i)&&bS(i,r)}}}function xS(e){for(let t=0;t<e.length;t++)e[t].notifyRender()}J(fS,{renderAs:``,motion:{},chartArea:{},axisDefaults:{categoryAxis:{highlight:{visible:!1,border:null}},valueAxis:{narrowRange:!1}},legend:{visible:!0,labels:{},accessibility:{},focusHighlight:{border:{opacity:1,color:y,width:2}}},categoryAxis:{},seriesDefaults:{type:pg,data:[],highlight:{visible:!0},labels:{},negativeValues:{visible:!1},accessibility:{},focusHighlight:{border:{opacity:1,width:2},zIndex:200}},series:[],seriesColors:null,tooltip:{visible:!1},transitions:!0,observeStyles:!1,valueAxis:{},plotArea:{},title:{},xAxis:{},yAxis:{},panes:[{}],pannable:!1,zoomable:!1});var SS=l({Aggregates:()=>Op,AreaChart:()=>hv,AreaSegment:()=>fv,AxisGroupRangeTracker:()=>gv,Bar:()=>yv,BarChart:()=>wv,BarLabel:()=>_v,BoxPlot:()=>Dv,BoxPlotChart:()=>kv,BubbleChart:()=>Nv,Bullet:()=>Fv,BulletChart:()=>Iv,Candlestick:()=>Tv,CandlestickChart:()=>Ev,CategoricalChart:()=>$_,CategoricalErrorBar:()=>j_,CategoricalPlotArea:()=>Wy,Chart:()=>fS,ChartAxis:()=>u,ChartContainer:()=>Vv,ChartPane:()=>f,ChartPlotArea:()=>p,ClipAnimation:()=>lv,ClusterLayout:()=>Sv,Crosshair:()=>Bv,CrosshairTooltip:()=>zv,DefaultAggregates:()=>ty,DonutChart:()=>Zb,DonutPlotArea:()=>Qb,DonutSegment:()=>Xb,ErrorBarBase:()=>A_,ErrorRangeCalculator:()=>Mp,Highlight:()=>qy,Legend:()=>cb,LegendItem:()=>ob,LegendLayout:()=>tb,LineChart:()=>dv,LinePoint:()=>nv,LineSegment:()=>rv,MousewheelZoom:()=>$y,OHLCChart:()=>fy,OHLCPoint:()=>dy,Pane:()=>Hv,Pannable:()=>Zy,PieAnimation:()=>vb,PieChart:()=>qb,PieChartMixin:()=>Kb,PiePlotArea:()=>Yb,PieSegment:()=>Hb,PlotAreaBase:()=>Kv,PlotAreaEventsMixin:()=>Qv,PlotAreaFactory:()=>lb,PointEventsMixin:()=>ev,RangeAreaChart:()=>uy,RangeAreaPoint:()=>oy,RangeBar:()=>ny,RangeBarChart:()=>ry,ScatterChart:()=>jv,ScatterErrorBar:()=>Av,ScatterLineChart:()=>yb,Selection:()=>fb,SeriesAggregator:()=>$v,SeriesBinder:()=>Y,SharedTooltip:()=>mb,SplineAreaSegment:()=>mv,SplineSegment:()=>sv,StackWrap:()=>Cv,Tooltip:()=>pb,WaterfallChart:()=>my,WaterfallSegment:()=>py,XYPlotArea:()=>Bb,ZoomSelection:()=>Qy,anyHasZIndex:()=>M_,appendIfNotNull:()=>N_,areNumbers:()=>P_,bindSegments:()=>I_,categoriesCount:()=>L_,constants:()=>Uh,countNumbers:()=>Dp,createOutOfRangePoints:()=>Z_,equalsIgnoreCase:()=>R_,evalOptions:()=>z_,filterSeriesByType:()=>B_,findAxisByName:()=>d,getField:()=>kp,hasGradientOverlay:()=>U_,hasValue:()=>W_,isDateAxis:()=>G_,parseDateCategory:()=>H_,segmentVisible:()=>F_,singleItemOrArray:()=>K_,unclipBox:()=>Q_}),CS=class extends mb{_slotAnchor(e,t){let n=this.plotArea.categoryAxis.options.vertical,r=n?{horizontal:`left`,vertical:`center`}:{horizontal:`center`,vertical:`bottom`},i;return i=n?new X(this.plotArea.box.x2,t.center().y):new X(t.center().x,-2),{point:i,align:r}}_defaultAnchor(e,t){return this._slotAnchor({},t)}};let wS=[`bar`,dg];function TS(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];t[n]=r.style.display,r.style.display=`none`}return t}function ES(e,t){for(let n=0;n<e.length;n++)e[n].style.display=t[n]}function DS(e){return B(e)?[e]:e}J(class extends fS{_setElementClass(e){ce(e,`k-sparkline`)}_initElement(e){super._initElement(e),this._initialWidth=Math.floor($d(e).width)}_resize(){let e=this.element,t=TS(e.children);this._initialWidth=Math.floor($d(e).width),ES(e.children,t),super._resize()}_modelOptions(){let e=this.options,t=this._surfaceWrap(),n=TS(t.children),r=document.createElement(`span`);r.innerHTML=`&nbsp;`,t.appendChild(r);let i=V({width:this._autoWidth,height:$d(t).height,transitions:e.transitions},e.chartArea,{inline:!0,align:!1});return $d(t,{width:i.width,height:i.height}),t.removeChild(r),ES(t.children,n),this.surface&&this.surface.resize(),i}_surfaceWrap(){if(!this.stage){let e=this.stage=document.createElement(`span`);this.element.appendChild(e)}return this.stage}_createPlotArea(e){let t=super._createPlotArea(e);return this._autoWidth=this._initialWidth||this._calculateWidth(t),t}_calculateWidth(e){let t=this.options,n=H(t.chartArea.margin),r=e.charts,i=this._surfaceWrap(),a=0;for(let e=0;e<r.length;e++){let t=r[e],n=(t.options.series||[])[0];if(!n)continue;if(n.type===`bar`||n.type===`bullet`)return 150;if(n.type===`pie`)return $d(i).height;let o=t.categoryAxis;if(o){let e=o.categoriesCount()*(!t.options.isStacked&&U(n.type,[`column`,`verticalBullet`])?t.seriesOptions.length:1);a=Math.max(a,e)}}let o=a*t.pointWidth;return o>0&&(o+=n.left+n.right),o}_createSharedTooltip(e){return new CS(this._plotArea,e)}static normalizeOptions(e){let t=DS(e);return t=se(t)?{seriesDefaults:{data:t}}:V({},t),t.series||=[{data:DS(t.data)}],V(t,{seriesDefaults:{type:t.type}}),(U(t.series[0].type,wS)||U(t.seriesDefaults.type,wS))&&(t=V({},{categoryAxis:{crosshair:{visible:!1}}},t)),t}},{chartArea:{margin:2},axisDefaults:{visible:!1,majorGridLines:{visible:!1},valueAxis:{narrowRange:!0}},seriesDefaults:{type:`line`,area:{line:{width:.5}},bar:{stack:!0},padding:2,width:.5,overlay:{gradient:null},highlight:{visible:!1},border:{width:0},markers:{size:2,visible:!1}},tooltip:{visible:!0,shared:!0},categoryAxis:{crosshair:{visible:!0,tooltip:{visible:!1}}},legend:{visible:!1},transitions:!1,pointWidth:5,panes:[{clip:!1}]});var OS=class extends ea{setup(){this._initialOpacity=parseFloat(jd(this.element,`opacity`).opacity)}step(e){jd(this.element,{opacity:String(Hd(this._initialOpacity,0,e))})}abort(){super.abort(),jd(this.element,{display:`none`,opacity:String(this._initialOpacity)})}cancel(){super.abort(),jd(this.element,{opacity:String(this._initialOpacity)})}};function kS(e,t){let n=document.createElement(`div`);return n.className=e,t&&(n.style.cssText=t),n}var AS=class{constructor(e,t,n){this.options=V({},this.options,n),this.container=e,this.chartService=t;let r=jd(e,[`paddingLeft`,`paddingTop`]);this.chartPadding={top:r.paddingTop,left:r.paddingLeft},this.createElements(),e.appendChild(this.element)}createElements(){let e=this.element=kS(`k-navigator-hint`,`display: none; position: absolute; top: 1px; left: 1px;`),t=this.tooltip=kS(`k-tooltip k-chart-tooltip`),n=this.scroll=kS(`k-scroll`);t.innerHTML=`&nbsp;`,e.appendChild(t),e.appendChild(n)}show(e,t,n){let{element:r,options:i,scroll:a,tooltip:o}=this,s=Fm(Wm(e)+Wm(t-e)/2),c=n.width()*.4,l=n.center().x-c,u=(n.center().x-l)/(i.max-i.min),d=s-i.min,f=this.chartService.intl.format(i.format,e,t),p=Pd(i);this.clearHideTimeout(),this._visible||=(jd(r,{visibility:`hidden`,display:`block`}),!0),p&&(f=p({from:e,to:t})),o.innerHTML=f,jd(o,{left:n.center().x-o.offsetWidth/2,top:n.y1});let m=jd(o,[`marginTop`,`borderTopWidth`,`height`]);jd(a,{width:c,left:l+d*u,top:n.y1+m.marginTop+m.borderTopWidth+m.height/2}),jd(r,{visibility:`visible`})}clearHideTimeout(){this._hideTimeout&&clearTimeout(this._hideTimeout),this._hideAnimation&&this._hideAnimation.cancel()}hide(){this.clearHideTimeout(),this._hideTimeout=setTimeout(()=>{this._visible=!1,this._hideAnimation=new OS(this.element),this._hideAnimation.setup(),this._hideAnimation.play()},this.options.hideDelay)}destroy(){this.clearHideTimeout(),this.container&&this.container.removeChild(this.element),delete this.container,delete this.chartService,delete this.element,delete this.tooltip,delete this.scroll}};J(AS,{format:`{0:d} - {1:d}`,hideDelay:500});let jS=`_navigator`,MS=jS;var NS=class e{constructor(e){this.chart=e;let t=this.options=V({},this.options,e.options.navigator),n=t.select;n&&(n.from=this.parseDate(n.from),n.to=this.parseDate(n.to)),W(t.hint.visible)||(t.hint.visible=t.visible),this.chartObserver=new Wd(this,{[n_]:`_drag`,[r_]:`_dragEnd`,[o_]:`_zoom`,[s_]:`_zoomEnd`}),e.addObserver(this.chartObserver)}parseDate(e){return Ym(this.chart.chartService.intl,e)}clean(){this.selection&&=(this.selection.destroy(),null),this.hint&&=(this.hint.destroy(),null)}destroy(){this.chart&&(this.chart.removeObserver(this.chartObserver),delete this.chart),this.clean()}redraw(){this._redrawSelf(),this.initSelection()}initSelection(){let{chart:e,options:t}=this,n=this.mainAxis(),{min:r,max:i}=n.roundedRange(),{from:a,to:o,mousewheel:s}=t.select,c=FS(n);n.categoriesCount()!==0&&(this.clean(),c.box=n.box,this.selection=new fb(e,c,{min:r,max:i,from:a||r,to:o||i,mousewheel:q(s,{zoom:`left`}),visible:t.visible},new Wd(this,{selectStart:`_selectStart`,select:`_select`,selectEnd:`_selectEnd`})),t.hint.visible&&(this.hint=new AS(e.element,e.chartService,{min:r,max:i,template:Pd(t.hint),format:t.hint.format})))}setRange(){let{min:e,max:t}=this.chart._createPlotArea(!0).namedCategoryAxes[MS].roundedRange(),n=this.options.select||{},r=n.from||e;r<e&&(r=e);let i=n.to||t;i>t&&(i=t),this.options.select=V({},n,{from:r,to:i}),this.filterAxes()}_redrawSelf(e){let t=this.chart._plotArea;t&&t.redraw(rf(t.panes),e)}redrawSlaves(){let e=this.chart,t=e._plotArea,n=t.panes.filter(e=>e.options.name!==jS);t.srcSeries=e.options.series,t.options.categoryAxis=e.options.categoryAxis,t.clearSeriesPointsCache(),t.redraw(n)}_drag(e){let{chart:t,selection:n}=this,r=t._eventCoordinates(e.originalEvent),i=this.mainAxis(),a=i.roundedRange(),o=i.pane.box.containsPoint(r),s=t._plotArea.categoryAxis,c=e.axisRanges[s.options.name],l=this.options.select,u;if(!c||o||!n)return;u=l.from&&l.to?Wm(l.to)-Wm(l.from):Wm(n.options.to)-Wm(n.options.from);let d=Fm(G(Wm(c.min),a.min,Wm(a.max)-u)),f=Fm(G(Wm(d)+u,Wm(a.min)+u,a.max));this.options.select={from:d,to:f},this.options.liveDrag&&(this.filterAxes(),this.redrawSlaves()),n.set(d,f),this.showHint(d,f)}_dragEnd(){this.filterAxes(),this.filter(),this.redrawSlaves(),this.hint&&this.hint.hide()}readSelection(){let{selection:{options:{from:e,to:t}},options:{select:n}}=this;n.from=e,n.to=t}filterAxes(){let{options:{select:e={}},chart:t}=this,n=t.options.categoryAxis,{from:r,to:i}=e;for(let e=0;e<n.length;e++){let t=n[e];t.pane!==`_navigator`&&(t.min=r,t.max=i)}}filter(){let{chart:e,options:{select:t}}=this;if(!e.requiresHandlers([`navigatorFilter`]))return;let n=this.mainAxis(),r={from:t.from,to:t.to};if(n.options.type!==`category`){let n=new lh(V({baseUnit:`fit`},e.options.categoryAxis[0],{categories:[t.from,t.to]}),e.chartService).options;r.from=zm(n.min,-n.baseUnitStep,n.baseUnit),r.to=zm(n.max,n.baseUnitStep,n.baseUnit)}this.chart.trigger(`navigatorFilter`,r)}_zoom(e){let{chart:{_plotArea:{categoryAxis:t}},selection:n,options:{select:r,liveDrag:i}}=this,a=this.mainAxis(),o=e.delta;if(!n)return;let s=a.categoryIndex(n.options.from),c=a.categoryIndex(n.options.to),l=this.chart._eventCoordinates(e.originalEvent);e.originalEvent.preventDefault(),Math.abs(o)>1&&(o*=3),c-s>1?(n.zoom(o,l),this.readSelection()):(t.options.min=r.from,r.from=t.scaleRange(-e.delta*this.chart._mousewheelZoomRate(),l).min),i&&(this.filterAxes(),this.redrawSlaves()),n.set(r.from,r.to),this.showHint(this.options.select.from,this.options.select.to)}_zoomEnd(e){this._dragEnd(e)}showHint(e,t){let n=this.chart._plotArea;this.hint&&this.hint.show(e,t,n.backgroundBox())}_selectStart(e){return this.chart._selectStart(e)}_select(e){return this.showHint(e.from,e.to),this.chart._select(e)}_selectEnd(e){return this.hint&&this.hint.hide(),this.readSelection(),this.filterAxes(),this.filter(),this.redrawSlaves(),this.chart._selectEnd(e)}mainAxis(){let e=this.chart._plotArea;if(e)return e.namedCategoryAxes[MS]}select(e,t){let n=this.options.select;return e&&t&&(n.from=this.parseDate(e),n.to=this.parseDate(t),this.filterAxes(),this.filter(),this.redrawSlaves(),this.selection.set(e,t)),{from:n.from,to:n.to}}static setup(t={},n={}){if(t.__navi)return;t.__navi=!0;let r=V({},n.navigator,t.navigator),i=t.panes=[].concat(t.panes),a=V({},r.pane,{name:jS});r.visible||(a.visible=!1,a.height=.1),t.navigator.position===`top`?i.unshift(a):i.push(a),i.forEach(e=>{e.name=e.name||`_default`}),e.attachAxes(t,r),e.attachSeries(t,r,n)}static attachAxes(e,t){let n=t.series||[],r=e.categoryAxis=[].concat(e.categoryAxis),i=e.valueAxis=[].concat(e.valueAxis);r.concat(i).forEach(e=>{e.pane=e.pane||`_default`});let a=B_(n,Rg).length===0,o=V({type:`date`,pane:jS,roundToBaseUnit:!a,justified:a,_collapse:!1,majorTicks:{visible:!0},tooltip:{visible:!1},labels:{step:1},autoBind:t.autoBindElements,autoBaseUnitSteps:{minutes:[1],hours:[1,2],days:[1,2],weeks:[],months:[1],years:[1]}}),s=t.categoryAxis;r.push(V({},o,{maxDateGroups:200},s,{name:MS,title:null,baseUnit:`fit`,baseUnitStep:`auto`,labels:{visible:!1},majorTicks:{visible:!1}}),V({},o,s,{name:`_navigator_labels`,maxDateGroups:20,baseUnitStep:`auto`,labels:{position:``},plotBands:[],autoBaseUnitSteps:{minutes:[]},_overlap:!0}),V({},o,s,{name:`_navigator_ticks`,maxDateGroups:200,majorTicks:{width:.5},plotBands:[],title:null,labels:{visible:!1,mirror:!0},_overlap:!0})),i.push(V({name:MS,pane:jS,majorGridLines:{visible:!1},visible:!1},t.valueAxis))}static attachSeries(e,t,n){let r=e.series=e.series||[],i=[].concat(t.series||[]),a=n.seriesColors,o=t.seriesDefaults;for(let e=0;e<i.length;e++)r.push(V({color:a[e%a.length],categoryField:t.dateField,visibleInLegend:!1,tooltip:{visible:!1}},o,i[e],{axis:MS,categoryAxis:MS,autoBind:t.autoBindElements}))}};function PS(){}function FS(e){return PS.prototype=e,new PS}J(class extends fS{applyDefaults(e,t){let n=$d(this.element).width||600,r=t,i={seriesDefaults:{categoryField:e.dateField},axisDefaults:{categoryAxis:{name:`default`,majorGridLines:{visible:!1},labels:{step:2},majorTicks:{visible:!1},maxDateGroups:Math.floor(n/28)}}};r&&=V({},r,i),NS.setup(e,r),super.applyDefaults(e,r)}_setElementClass(e){ce(e,`k-chart k-stockchart`)}setOptions(e){this.destroyNavigator(),super.setOptions(e)}noTransitionsRedraw(){let e=this.options.transitions;this.options.transitions=!1,this._fullRedraw(),this.options.transitions=e}_resize(){this.noTransitionsRedraw()}_redraw(){let e=this.navigator;!this._dirty()&&e&&e.options.partialRedraw?e.redrawSlaves():this._fullRedraw()}_dirty(){let e=this.options,t=[].concat(e.series,e.navigator.series),n=zd(t,function(e){return e&&e.visible}).length,r=this._seriesCount!==n;return this._seriesCount=n,r}_fullRedraw(){let e=this.navigator;e||(e=this.navigator=new NS(this),this.trigger(`navigatorCreated`,{navigator:e})),e.clean(),e.setRange(),super._redraw(),e.initSelection()}_trackSharedTooltip(e){let t=this._plotArea.paneByPoint(e);t&&t.options.name===`_navigator`?this._unsetActivePoint():super._trackSharedTooltip(e)}bindCategories(){super.bindCategories(),this.copyNavigatorCategories()}copyNavigatorCategories(){let e=[].concat(this.options.categoryAxis),t;for(let n=0;n<e.length;n++){let r=e[n];r.name===`_navigator`?t=r.categories:t&&r.pane===`_navigator`&&(r.categories=t)}}destroyNavigator(){this.navigator&&=(this.navigator.destroy(),null)}destroy(){this.destroyNavigator(),super.destroy()}_stopChartHandlers(e){let t=this._eventCoordinates(e),n=this._plotArea.paneByPoint(t);return super._stopChartHandlers(e)||n&&n.options.name===`_navigator`}_toggleDragZoomEvents(){this._dragZoomEnabled||=(this.element.style.touchAction=`none`,!0)}},{dateField:`date`,axisDefaults:{categoryAxis:{type:`date`,baseUnit:`fit`,justified:!0},valueAxis:{narrowRange:!0,labels:{format:`C`}}},valueAxis:{narrowRange:!1},navigator:{select:{},seriesDefaults:{markers:{visible:!1},tooltip:{visible:!1},highlight:{visible:!1},line:{width:2}},hint:{},visible:!0},tooltip:{visible:!0},legend:{visible:!1}});let IS=`arrowPointer`,LS=`barPointer`,RS=.5,zS=Math.PI/180,BS=`inside`,VS=`linear`,HS=`radialPointer`,US=`radialRangePointer`;function WS(e,t){let n=e.getOrigin(),r=e.getSize(),i=H(t);return e.setOrigin([n.x-i.left,n.y-i.top]),e.setSize([r.width+(i.left+i.right),r.height+(i.top+i.bottom)]),e}let{Group:GS,Path:KS,Text:qS}=wo;function JS(e,t){let n=e.box,r=e.children[0].box,i=t.border||{},a=t.background||``,o=KS.fromRect(new j([n.x1,n.y1],[n.width(),n.height()]),{stroke:{}}),s=new qS(e.text,new A(r.x1,r.y1),{font:t.font,fill:{color:t.color}}),c=WS(s.bbox().clone(),t.padding),l=KS.fromRect(c,{stroke:{color:i.width?i.color:``,width:i.width,opacity:i.opacity,dashType:i.dashType,lineJoin:`round`,lineCap:`round`},fill:{color:a}}),u=new GS;return u.append(o),u.append(l),u.append(s),u}function YS(e,t,n){let r=W(e.from)?e.from:D,i=W(e.to)?e.to:E;return e.from=Math.max(Math.min(i,r),t),e.to=Math.min(Math.max(i,r),n),e}function XS(e,t){let n=H(t);return n.left=-n.left,n.top=-n.top,n.right=-n.right,n.bottom=-n.bottom,WS(e,n)}let{Path:ZS,Surface:QS}=wo;var $S=class{constructor(e,t,n,r={}){this.element=e,this.theme=n,this.contextService=new hm(this,r),this._originalOptions=V({},this.options,t),this.options=V({},this._originalOptions),this._initTheme(n),this.redraw()}destroy(){this.surface&&=(this.surface.destroy(),null),delete this.element,delete this.surfaceElement}value(e){let t=this.pointers[0];if(arguments.length===0)return t.value();t.value(e),this._setValueOptions(e)}_draw(){let e=this.surface;e.clear(),e.draw(this._visuals)}exportVisual(){return this._visuals}allValues(e){let t=this.pointers,n=[];if(arguments.length===0){for(let e=0;e<t.length;e++)n.push(t[e].value());return n}if(se(e))for(let n=0;n<e.length;n++)B(e[n])&&t[n].value(e[n]);this._setValueOptions(e)}_setValueOptions(e){let t=[].concat(this.options.pointer),n=[].concat(e);for(let e=0;e<n.length;e++)t[e].value=n[e]}resize(){this.noTransitionsRedraw()}noTransitionsRedraw(){let e=this.options.transitions;this._toggleTransitions(!1),this.redraw(),this._toggleTransitions(e)}redraw(){let e=this._surfaceSize(),t=new j([0,0],[e.width,e.height]);this._initSurface(),this.gaugeArea=this._createGaugeArea(),this._createModel();let n=XS(t.bbox(),this._gaugeAreaMargin);this.reflow(n)}setOptions(e,t){this._originalOptions=V(this._originalOptions,e),this.options=V({},this._originalOptions),this._initTheme(t),this.redraw()}setDirection(e){this.contextService.rtl=!!e,this.surface&&this.surface.type===`svg`&&(this.surface.destroy(),this.surface=null)}setIntlService(e){this.contextService.intl=e}_initTheme(e){let t=e||this.theme||{};this.theme=t,this.options=V({},t,this.options);let n=this.options,r=n.pointer;if(se(r)){let e=[];for(let n=0;n<r.length;n++)e.push(V({},t.pointer,r[n]));n.pointer=e}}_createGaugeArea(){let e=this.options.gaugeArea,t=this.surface.size(),n=e.border||{},r=new j([0,0],[t.width,t.height]);return this._gaugeAreaMargin=e.margin||5,n.width>0&&(r=XS(r,n.width)),ZS.fromRect(r,{stroke:{color:n.width?n.color:``,width:n.width,opacity:n.opacity,dashType:n.dashType,lineJoin:`round`,lineCap:`round`},fill:{color:e.background}})}_initSurface(){let{options:e,surface:t}=this,n=this._surfaceElement(),r=this._surfaceSize();$d(n,r),!t||t.options.type!==e.renderAs?(t&&t.destroy(),this.surface=QS.create(n,{type:e.renderAs})):(this.surface.clear(),this.surface.resize())}_surfaceSize(){let e=this.options,t=this._getSize();return e.gaugeArea&&V(t,e.gaugeArea),t}_surfaceElement(){return this.surfaceElement||(this.surfaceElement=document.createElement(`div`),this.element.appendChild(this.surfaceElement)),this.surfaceElement}getSize(){return this._getSize()}_getSize(){let e=this.element,t=this._defaultSize(),n=e.offsetWidth,r=e.offsetHeight;return n||=t.width,r||=t.height,{width:n,height:r}}_defaultSize(){return{width:200,height:200}}_toggleTransitions(e){this.options.transitions=e;for(let t=0;t<this.pointers.length;t++)this.pointers[t].options.animation.transitions=e}};J($S,{plotArea:{},theme:`default`,renderAs:``,pointer:{},scale:{},gaugeArea:{}});let{Path:eC,Group:tC}=wo,nC=A;function rC(e,t){let{position:n,tickX:r,tickY:i}=e,a,o;return e.vertical?(a=new nC(r,n),o=new nC(r+t.size,n)):(a=new nC(n,i),o=new nC(n,i+t.size)),new eC({stroke:{color:t.color,width:t.width}}).moveTo(a).lineTo(o)}function iC(e,t,n,r){let i=t.length;if(r.visible){let{mirror:a,lineBox:o}=n;for(let s=r.skip;s<i;s+=r.step)s%r.skipUnit!==0&&(n.tickX=a?o.x2:o.x2-r.size,n.tickY=a?o.y1-r.size:o.y1,n.position=t[s],e.append(rC(n,r)))}}var aC=class extends gh{constructor(e,t){let n=e||{};!W(n.reverse)&&n.vertical===!1&&(t||{}).rtl&&(n=Object.assign({},n,{reverse:!0})),super(0,1,n,t),this.options.minorUnit=this.options.minorUnit||this.options.majorUnit/10}initUserOptions(e){let t=V({},this.options,e);return t=V({},t,{labels:{mirror:t.mirror}}),t.majorUnit=t.majorUnit||Pp(t.min,t.max),t}initFields(){}render(){let e=this.elements=new tC,t=this.renderLabels(),n=this.renderLine(),r=this.renderTicks(),i=this.renderRanges();return e.append(n,t,r,i),e}renderRanges(){let e=this.options,{min:t,max:n,vertical:r,labels:{mirror:i}}=e,a=e.ranges||[],o=new tC,s=a.length,c=e.rangeSize||e.minorTicks.size/2;for(let e=0;e<s;e++){let s=YS(a[e],t,n),l=this.getSlot(s.from,s.to),u=r?this.lineBox():l,d=r?l:this.lineBox();r?u.x1-=c*(i?-1:1):d.y2+=c*(i?-1:1),o.append(eC.fromRect(new j([u.x1,d.y1],[u.x2-u.x1,d.y2-d.y1]),{fill:{color:s.color,opacity:s.opacity},stroke:{}}))}return o}renderLabels(){let{labels:e,options:t}=this,n=new tC;for(let r=0;r<e.length;r++)n.append(JS(e[r],t.labels));return n}renderLine(){let e=this.options.line,t=this.lineBox(),n=new tC;if(e.width>0&&e.visible){let r=new eC({stroke:{color:e.color,dashType:e.dashType,width:e.width}});r.moveTo(t.x1,t.y1).lineTo(t.x2,t.y2),n.append(r)}return n}renderTicks(){let e=new tC,t=this.options,n=t.majorTicks.visible?t.majorUnit:0,r={vertical:t.vertical,mirror:t.labels.mirror,lineBox:this.lineBox()};return iC(e,this.getMajorTickPositions(),r,t.majorTicks),iC(e,this.getMinorTickPositions(),r,V({},{skipUnit:n/t.minorUnit},t.minorTicks)),e}};J(aC,{min:0,max:50,majorTicks:{size:15,align:BS,color:y,width:RS,visible:!0},minorTicks:{size:10,align:BS,color:y,width:RS,visible:!0},line:{width:RS},labels:{position:BS,padding:2},mirror:!1,_alignLines:!1});var oC=class{constructor(e,t){let{min:n,max:r}=e.options,i=this.options=V({},this.options,t);i.fill=i.color,this.scale=e,W(i.value)?i.value=G(i.value,n,r):i.value=n}value(e){let t=this.options,n=t.value;if(arguments.length===0)return n;let{min:r,max:i}=this.scale.options;t._oldValue=W(t._oldValue)?t.value:r,t.value=G(e,r,i),this.elements&&this.repaint()}};J(oC,{color:y});var sC=class extends oC{constructor(e,t){super(e,t),this.options=V({track:{visible:W(t.track)}},this.options)}reflow(){let{options:e,scale:t}=this,{mirror:n,vertical:r}=t.options,i=t.lineBox(),a=e.track.size||e.size,o=e.size/2,s=H(e.margin),c=r?s[n?`left`:`right`]:s[n?`bottom`:`top`],l,u,d;c=n?-c:c,r?(d=new Z(i.x1+c,i.y1,i.x1+c,i.y2),n?d.x1-=a:d.x2+=a,e.shape!==`barPointer`&&(u=new Z(i.x2+c,i.y1-o,i.x2+c,i.y2+o),l=u)):(d=new Z(i.x1,i.y1-c,i.x2,i.y1-c),n?d.y2+=a:d.y1-=a,e.shape!==`barPointer`&&(u=new Z(i.x1-o,i.y1-c,i.x2+o,i.y1-c),l=u)),this.trackBox=d,this.pointerRangeBox=u,this.box=l||d.clone().pad(e.border.width)}getElementOptions(){let e=this.options;return{fill:{color:e.color,opacity:e.opacity},stroke:W(e.border)?{color:e.border.width?e.border.color||e.color:``,width:e.border.width,dashType:e.border.dashType,opacity:e.opacity}:null}}_margin(){let{scale:e,options:t}=this,{mirror:n,vertical:r}=e.options,i=H(t.margin);return r?i[n?`left`:`right`]:i[n?`bottom`:`top`]}};J(sC,{shape:LS,track:{border:{width:1}},color:y,border:{width:1},opacity:1,margin:H(3),animation:{type:LS},visible:!0});var cC=class extends ea{setup(){let e=this.options,{margin:t,from:n,to:r,vertical:i}=e,a=i?`x1`:`y1`;e.mirror===i?(n[a]-=t,r[a]-=t):(n[a]+=t,r[a]+=t);let o=this.fromScale=new A(n.x1,n.y1),s=this.toScale=new A(r.x1,r.y1);e.duration!==0&&(e.duration=Math.max(o.distanceTo(s)/e.duration*1e3,1))}step(e){let t=Hd(this.fromScale.x,this.toScale.x,e),n=Hd(this.fromScale.y,this.toScale.y,e);this.element.transform(M().translate(t,n))}};J(cC,{easing:VS,duration:250}),Xi.current.register(IS,cC);let lC=A,uC=N;var dC=class extends sC{constructor(e,t){super(e,t),W(this.options.size)||(this.options.size=this.scale.options.majorTicks.size*.6)}pointerShape(){let{scale:e,options:{size:t}}=this,n=t/2,r=e.options.mirror?-1:1,i;return i=e.options.vertical?[new lC(0,0-n),new lC(0-r*t,0),new lC(0,0+n)]:[new lC(0-n,0),new lC(0,0+r*t),new lC(0+n,0)],i}repaint(){let{scale:e,options:t}=this,n=new cC(this.elements,V(t.animation,{vertical:e.options.vertical,mirror:e.options.mirror,margin:this._margin(t.margin),from:e.getSlot(t._oldValue),to:e.getSlot(t.value)}));t.animation.transitions===!1&&(n.options.duration=0),n.setup(),n.play()}render(){let{scale:e,options:t}=this,n=this.getElementOptions(),r=this.pointerShape(t.value);t.animation.type=IS;let i=new uC({stroke:n.stroke,fill:n.fill}).moveTo(r[0]).lineTo(r[1]).lineTo(r[2]).close(),a=e.getSlot(t.value);return i.transform(M().translate(a.x1,a.y1)),this.elements=i,i}},fC=class extends ea{setup(){let e=this.options,t=this.axis=e.vertical?`y`:`x`,n=this.to=e.newPoints[0][t],r=this.from=e.oldPoints[0][t];e.duration!==0&&(e.duration=Math.max(Math.abs(n-r)/e.speed*1e3,1)),this._set(r)}step(e){let t=Hd(this.from,this.to,e);this._set(t)}_set(e){let t=`set`+this.axis.toUpperCase(),n=this.options.newPoints;n[0][t](e),n[1][t](e)}};J(fC,{easing:VS,speed:250}),Xi.current.register(LS,fC);let{Group:pC,Path:mC}=wo;var hC=class extends sC{constructor(e,t){super(e,t),W(this.options.size)||(this.options.size=this.scale.options.majorTicks.size*.3)}pointerShape(e){let{scale:t,options:n}=this,{mirror:r,vertical:i}=t.options,a=r===i?-1:1,o=n.size*a,s=t.getSlot(t.options.min),c=t.getSlot(e),l=i?`y`:`x`,u=i?`x`:`y`,d=this._margin()*a,f=new A;f[l]=s[l+`1`],f[u]=s[u+`1`];let p=new A;p[l]=c[l+`1`],p[u]=c[u+`1`],i?(f.translate(d,0),p.translate(d,0)):(f.translate(0,d),p.translate(0,d));let m=p.clone(),h=f.clone();return i?(m.translate(o,0),h.translate(o,0)):(m.translate(0,o),h.translate(0,o)),[f,p,m,h]}repaint(){let{scale:e,options:t}=this,n=this.pointerShape(t.value),r=this.pointerPath,i=this.pointerShape(t._oldValue);r.moveTo(n[0]).lineTo(n[1]).lineTo(n[2]).lineTo(n[3]).close();let a=new fC(r,V(t.animation,{reverse:e.options.reverse,vertical:e.options.vertical,oldPoints:[i[1],i[2]],newPoints:[n[1],n[2]]}));t.animation.transitions===!1&&(a.options.duration=0),a.setup(),a.play()}render(){let e=new pC,t=this.getElementOptions();this.options.track.visible&&e.append(this.renderTrack());let n=this.pointerPath=new mC({stroke:t.stroke,fill:t.fill});return e.append(n),this.elements=e,e}renderTrack(){let e=this.options.track,t=e.border||{},n=this.trackBox.clone().pad(t.width||0);return mC.fromRect(n.toRect(),{fill:{color:e.color,opacity:e.opacity},stroke:{color:t.width?t.color||e.color:``,width:t.width,dashType:t.dashType}})}};let gC=P;J(class extends $S{reflow(e){let t=this.pointers,n=e.origin.x,r=e.origin.y,i=new Z(n,r,n+e.width(),r+e.height());this.scale.reflow(i),this._shrinkScaleWidth(i);for(let e=0;e<t.length;e++)t[e].reflow();this.bbox=this._getBox(i),this._alignElements(),this._shrinkElements(),this._buildVisual(),this._draw()}_buildVisual(){let e=new gC,t=this.scale.render(),n=this.pointers;e.append(this.gaugeArea),e.append(t);for(let t=0;t<n.length;t++){let r=n[t];e.append(r.render()),r.value(r.options.value)}this._visuals=e}_createModel(){let e=this.options,t=this.scale=new aC(e.scale,this.contextService);this.pointers=[];let n=e.pointer;n=se(n)?n:[n];for(let r=0;r<n.length;r++){let i=V({},n[r],{animation:{transitions:e.transitions}}),a=i.shape===`arrow`?dC:hC;this.pointers.push(new a(t,i))}}_defaultSize(){let e=this.options.scale.vertical;return{width:e?60:200,height:e?200:60}}_getBox(e){let{scale:t,pointers:n}=this,r=e.center(),i=n[0].box.clone().wrap(t.box);for(let e=0;e<n.length;e++)i.wrap(n[e].box.clone());let a;return t.options.vertical?(a=i.width()/2,i=new Z(r.x-a,e.y1,r.x+a,e.y2)):(a=i.height()/2,i=new Z(e.x1,r.y-a,e.x2,r.y+a)),i}_alignElements(){let{scale:e,pointers:t}=this,n=e.box,r=t[0].box.clone().wrap(e.box),i=this.bbox;for(let e=0;e<t.length;e++)r.wrap(t[e].box.clone());let a;e.options.vertical?(a=i.center().x-r.center().x,e.reflow(new Z(n.x1+a,i.y1,n.x2+a,i.y2))):(a=i.center().y-r.center().y,e.reflow(new Z(n.x1,n.y1+a,n.x2,n.y2+a)));for(let e=0;e<t.length;e++)t[e].reflow(this.bbox)}_shrinkScaleWidth(e){let{scale:t}=this;if(!t.options.vertical){let n=t.contentBox().width()-e.width();n>0&&(t.box.shrink(n,0),t.box.alignTo(e,`center`),t.reflow(t.box))}}_shrinkElements(){let{scale:e,pointers:t}=this,n=e.box.clone(),r=e.options.vertical?`y`:`x`,i=t[0].box;for(let e=0;e<t.length;e++)i.wrap(t[e].box.clone());n[r+1]+=Math.max(n[r+1]-i[r+1],0),n[r+2]-=Math.max(i[r+2]-n[r+2],0),e.reflow(n);for(let e=0;e<t.length;e++)t[e].reflow(this.bbox)}},{transitions:!0,gaugeArea:{background:``},scale:{vertical:!0}});let{Arc:_C,Path:vC,Group:yC}=wo;function bC(e,t,n,r){let i=new yC,a=e.center,o=e.getRadiusX();if(r.visible)for(let n=0;n<t.length;n++){let s=e.pointAt(t[n]),c=new A(a.x+o-r.size,a.y).rotate(t[n],a);i.append(new vC({stroke:{color:r.color,width:r.width}}).moveTo(s).lineTo(c))}return i}function xC(e,t,n,r){return{from:e,to:t,color:n,opacity:r}}var SC=class extends gh{constructor(e,t){super(0,1,e,t)}initUserOptions(e){let t=V({},this.options,e);return t.majorUnit=t.majorUnit||Pp(t.min,t.max),t.minorUnit=t.minorUnit||t.majorUnit/10,t}initFields(){}render(e,t){let n=this.renderArc(e,t);this.bbox=n.bbox(),this.labelElements=this.renderLabels(),this.ticks=this.renderTicks(),this.ranges=this.renderRanges()}reflow(e){let t=e.center(),n=Math.min(e.height(),e.width())/2;if(W(this.bbox))this.bbox=this.arc.bbox(),this.radius(this.arc.getRadiusX()),this.repositionRanges(),this.renderLabels();else return this.render(t,n)}slotAngle(e){let{min:t,max:n,reverse:r,startAngle:i,endAngle:a}=this.options,o=a-i,s;return s=r?a-(e-t)/(n-t)*o:(e-t)/(n-t)*o+i,s+180}hasRanges(){let e=this.options.ranges;return e&&e.length}ticksSize(){let{majorTicks:e,minorTicks:t}=this.options,n=0;return e.visible&&(n=e.size),t.visible&&(n=Math.max(t.size,n)),n}labelsCount(){let e=super.labelsCount(),t=this.options;return t.endAngle-t.startAngle>=360&&t.max%t.majorUnit===0&&--e,e}renderLabels(){let e=this.options,t=this.arc.clone(),n=t.getRadiusX(),r=this.tickAngles(t,e.majorUnit),i=e.rangeSize=e.rangeSize||n*.1,a=new yC,o=n*.05;W(e.rangeDistance)?o=e.rangeDistance:e.rangeDistance=o;let s=e.labels,c=s.position===BS,l=W(this.labelElements);c&&(n-=this.ticksSize(),this.hasRanges()&&!l&&(n-=i+o),t.setRadiusX(n).setRadiusY(n));let u=this.labels,d=u.length,f=H(s.padding),p=(f.left+f.right)/2,m=(f.top+f.bottom)/2;for(let n=0;n<d;n++){let i=u[n],o=i.box.width()/2,s=i.box.height()/2,d=r[n],f=(d-180)*zS,h=t.pointAt(d),g=h.x+Math.cos(f)*(o+p)*(c?1:-1),_=h.y+Math.sin(f)*(s+m)*(c?1:-1);i.reflow(new Z(g-o,_-s,g+o,_+s));let v=new A(i.box.x1,i.box.y1),y;if(!l)y=JS(i,e.labels),a.append(y);else{y=this.labelElements.children[n];let e=y.bbox().origin,t=y.transform()||M();t.translate(v.x-e.x,v.y-e.y),y.transform(t)}this.bbox=j.union(this.bbox,y.bbox())}return a}repositionRanges(){let e=this.ranges.children;if(e.length>0){let{rangeDistance:t,rangeSize:n}=this.options,r=this.getRangeRadius();this.options.labels.position===`inside`&&(r+=n+t);let i=r+n/2;for(let t=0;t<e.length;t++)e[t]._geometry.setRadiusX(i).setRadiusY(i);this.bbox=j.union(this.bbox,this.ranges.bbox())}}renderRanges(){let e=this.rangeSegments(),t=e.length,n=new yC;if(t){let{rangeSize:r,reverse:i,rangeDistance:a}=this.options,o=this.getRangeRadius();this.radius(this.radius()-r-a);for(let r=0;r<t;r++){let t=e[r],a=this.slotAngle(t[i?`to`:`from`]),s=this.slotAngle(t[i?`from`:`to`]);s-a!==0&&n.append(this.createRange(a,s,o,t))}}return n}createRange(e,t,n,r){let i=this.options.rangeSize,a=new Un(this.arc.center,{radiusX:n+i/2,radiusY:n+i/2,startAngle:e,endAngle:t});return new _C(a,{stroke:{width:i,color:r.color,opacity:r.opacity,lineCap:r.lineCap}})}rangeSegments(){let e=this.options,t=e.ranges||[],n=t.length,r=[];if(n){let{min:i,max:a,rangePlaceholderColor:o}=e;r.push(xC(i,a,o));for(let e=0;e<n;e++){let n=YS(t[e],i,a),s=r.length;for(let e=0;e<s;e++){let t=r[e];if(t.from<=n.from&&n.from<=t.to){r.push(xC(n.from,n.to,n.color,n.opacity)),t.from<=n.to&&n.to<=t.to&&r.push(xC(n.to,t.to,o,n.opacity)),t.to=n.from;break}}}}return r}getRangeRadius(){let{arc:e,options:t}=this,{rangeSize:n,rangeDistance:r,majorTicks:{size:i}}=t,a;return a=t.labels.position===`outside`?e.getRadiusX()-i-r-n:e.getRadiusX()-n,a}renderArc(e,t){let n=this.options;return this.arc=new Un(e,{radiusX:t,radiusY:t,startAngle:n.startAngle+180,endAngle:n.endAngle+180})}renderTicks(){let{arc:e,options:t}=this,n=e.clone();this.majorTickAngles=this.tickAngles(e,t.majorUnit),this.majorTicks=bC(n,this.majorTickAngles,t.majorUnit,t.majorTicks);let r=new yC;r.append(this.majorTicks);let i=t.majorTicks.size,a=t.minorTicks.size;if(this._tickDifference=i-a,t.labels.position===`outside`){let e=n.getRadiusX();n.setRadiusX(e-i+a).setRadiusY(e-i+a)}return this.minorTickAngles=this.normalizeTickAngles(this.tickAngles(e,t.minorUnit)),this.minorTicks=bC(n,this.minorTickAngles,t.minorUnit,t.minorTicks),r.append(this.minorTicks),r}normalizeTickAngles(e){let t=this.options,n=t.majorUnit/t.minorUnit;for(let t=e.length-1;t>=0;t--)t%n===0&&e.splice(t,1);return e}tickAngles(e,t){let n=this.options,r=n.reverse,i=n.max-n.min,a=e.endAngle-e.startAngle,o=i/t,s=e.startAngle,c=a/o;r&&(s+=a,c=-c),a>=360&&n.max%t===0&&--o;let l=[];for(let e=0;e<o;e++)l.push(K(s,3)),s+=c;return K(s)<=e.endAngle&&l.push(s),l}radius(e){if(e)this.arc.setRadiusX(e).setRadiusY(e),this.repositionTicks(this.majorTicks.children,this.majorTickAngles),this.repositionTicks(this.minorTicks.children,this.minorTickAngles,!0);else return this.arc.getRadiusX()}repositionTicks(e,t,n){let r=n&&this._tickDifference||0,i=this.arc,a=i.getRadiusX();n&&this.options.labels.position===`outside`&&r!==0&&(i=this.arc.clone(),i.setRadiusX(a-r).setRadiusY(a-r));for(let n=0;n<e.length;n++){let r=i.pointAt(t[n]),a=e[n].segments,o=r.x-a[0].anchor().x,s=r.y-a[0].anchor().y;e[n].transform(new M().translate(o,s))}}};J(SC,{min:0,max:100,majorTicks:{size:15,align:BS,color:y,width:RS,visible:!0},minorTicks:{size:10,align:BS,color:y,width:RS,visible:!0},startAngle:-30,endAngle:210,labels:{position:BS,padding:2}});var CC=class extends ea{constructor(e,t){super(e,t);let n=this.options;n.duration=Math.max(Math.abs(n.newAngle-n.oldAngle)/n.duration*1e3,1)}step(e){let t=this.options,n=Hd(t.oldAngle,t.newAngle,e);this.element.transform(M().rotate(n,t.center))}};J(CC,{easing:VS,duration:150}),Xi.current.register(HS,CC);let{Circle:wC,Group:TC,Path:EC}=wo;var DC=class extends oC{setAngle(e){this.elements.transform(M().rotate(e,this.center))}repaint(){let{scale:e,options:t}=this,n=e.slotAngle(t._oldValue),r=e.slotAngle(t.value);t.animation.transitions===!1?this.setAngle(r):new CC(this.elements,V(t.animation,{oldAngle:n,newAngle:r})).play()}render(){let{scale:e,options:t}=this,n=new TC;return t.animation!==!1&&V(t.animation,{startAngle:0,center:e.arc.center,reverse:e.options.reverse}),n.append(this._renderNeedle(),this._renderCap()),this.elements=n,this.setAngle(zS),n}reflow(e){let t=this.center=e.center,n=G(this.options.length||1,.1,1.5),r=this.radius=e.getRadiusX()*n,i=this.capSize=Math.round(r*this.options.cap.size);this.bbox=j.fromPoints(new A(t.x-i,t.y-i),new A(t.x+i,t.y+i))}_renderNeedle(){let e=this.scale.options.minorTicks.size,t=this.center,n=this.options.color,r=new EC({fill:{color:n},stroke:{color:n,width:RS}});return r.moveTo(t.x+this.radius-e,t.y).lineTo(t.x,t.y-this.capSize/2).lineTo(t.x,t.y+this.capSize/2).close(),r}_renderCap(){let e=this.options,t=e.cap.color||e.color,n=new An(this.center,this.capSize);return new wC(n,{fill:{color:t},stroke:{color:t}})}};J(DC,{cap:{size:.05},arrow:{width:16,height:14},animation:{type:HS,duration:150}});let OC=P;var kC=class extends $S{reflow(e){let t=this.pointers;this.scale.reflow(e),this._initialPlotArea=this.scale.bbox;for(let e=0;e<t.length;e++)t[e].reflow(this.scale.arc),this._initialPlotArea=j.union(this._initialPlotArea,t[e].bbox);this.fitScale(e),this.alignScale(e),this._buildVisual(this.gaugeArea,t,this.scale),this._draw()}_buildVisual(e,t,n){let r=this._visuals=new OC;r.append(e),r.append(n.ticks),r.append(n.ranges),this._buildPointers(t),r.append(n.labelElements)}_buildPointers(e){for(let t=0;t<e.length;t++){let n=e[t];n.render(),this._visuals.append(n.elements),n.value(n.options.value)}}fitScale(e){let t=this.scale.arc,n=this._initialPlotArea,r=Math.abs(this.getDiff(n,e)),i=K(r,3),a=K(-r,3),o,s,c,l,u,d=0,f=0;for(;f++<100&&(d=u===c?d+1:0,!(d>5||i!==l&&(o=this.getPlotBox(i,e,t),0<=o&&o<=2)||a!==l&&(c=this.getPlotBox(a,e,t),0<=c&&c<=2)||(l=o>0&&c>0?i*2:o<0&&c<0?a*2:K((i+a)/2||1,3),s=this.getPlotBox(l,e,t),0<=s&&s<=2)));)u=c,s>0?(a=l,c=s):(i=l,o=s)}getPlotBox(e,t,n){let r=this.scale,i=this.pointers,a=n.getRadiusX(),o=n.clone();o.setRadiusX(a+e).setRadiusY(a+e),r.arc=o,r.reflow(t),this.plotBbox=r.bbox;for(let e=0;e<i.length;e++)i[e].reflow(o),this.plotBbox=j.union(this.plotBbox,i[e].bbox);return this.getDiff(this.plotBbox,t)}getDiff(e,t){return Math.min(t.width()-e.width(),t.height()-e.height())}alignScale(e){let t=this.plotBbox.center(),n=e.center(),r=t.x-n.x,i=t.y-n.y,{scale:a,pointers:o}=this;a.arc.center.x-=r,a.arc.center.y-=i,a.reflow(e);for(let e=0;e<o.length;e++)o[e].reflow(a.arc),this.plotBbox=j.union(a.bbox,o[e].bbox)}_createModel(){let e=this.options,t=e.pointer,n=this.scale=new SC(e.scale,this.contextService);this.pointers=[];let r=se(t)?t:[t];for(let t=0;t<r.length;t++){let i=new DC(n,V({},r[t],{animation:{transitions:e.transitions}}));this.pointers.push(i)}}};J(kC,{transitions:!0,gaugeArea:{background:``}});var AC=class extends SC{rangeSegments(){let{min:e,max:t,rangePlaceholderColor:n,rangeLineCap:r}=this.options;return[{from:e,to:t,color:n,lineCap:r}]}hasRanges(){return!0}placeholderRangeAngle(e){let t=this.ranges.children[0].geometry();this.options.reverse?t.setEndAngle(e):t.setStartAngle(e)}addRange(e,t,n){let r=this.options.reverse,i=this.slotAngle(r?t:e),a=this.slotAngle(r?e:t),o=this.createRange(i,a,this.getRangeRadius(),n);return this.ranges.append(o),o}};J(AC,{min:0,max:100,majorTicks:{visible:!1},minorTicks:{visible:!1},labels:{visible:!1},startAngle:0,endAngle:180,rangeLineCap:`round`});var jC=class extends ea{constructor(e,t){super(e,t);let n=this.options,r=Math.abs(n.newAngle-n.oldAngle)/n.duration*1e3;n.duration=G(r,150,800);let i=e.elements.options.get(`stroke.color`),a=e.currentColor();i!==a&&(this.startColor=new Ue(i),this.color=new Ue(a))}step(e){let{options:t,startColor:n,color:r}=this,i=Hd(t.oldAngle,t.newAngle,e);if(this.element.angle(i),r){let t=K(Hd(n.r,r.r,e)),i=K(Hd(n.g,r.g,e)),a=K(Hd(n.b,r.b,e));this.element.stroke(new Ue(t,i,a).toHex())}}};J(jC,{easing:VS,duration:150}),Xi.current.register(US,jC);var MC=class extends oC{repaint(){let{scale:e,options:t}=this,n=e.slotAngle(t._oldValue),r=e.slotAngle(t.value);this.animation&&this.animation.abort(),t.animation.transitions===!1?(this.angle(r),this.stroke(this.currentColor())):(this.animation=new jC(this,V(t.animation,{oldAngle:n,newAngle:r})),this.animation.play())}angle(e){let t=this.elements.geometry();this.scale.options.reverse?t.setStartAngle(e):t.setEndAngle(e),this.scale.placeholderRangeAngle(e)}stroke(e){this.elements.stroke(e)}render(){if(this.elements)return;let{scale:e,options:t}=this;t.animation!==!1&&V(t.animation,{startAngle:0,center:e.arc.center,reverse:e.options.reverse}),this.elements=e.addRange(e.options.min,this.options.value,{color:this.currentColor(),opacity:t.opacity,lineCap:e.options.rangeLineCap})}currentColor(){let{min:e,max:t}=this.scale.options,{colors:n,color:r,value:i}=this.options,a=B(i)?i:e;if(n)for(let r=0;r<n.length;r++){let{color:i,from:o=e,to:s=t}=n[r];if(o<=a&&a<=s)return i}return r}reflow(){this.render(),this.bbox=this.elements.bbox()}};J(MC,{animation:{type:US,duration:150}});var NC=class extends kC{_initTheme(e){super._initTheme(e),this.options.color=this.options.color||(this.theme.pointer||{}).color}_createModel(){let e=this.options,t=new MC(this.scale=new AC(e.scale,this.contextService),V({},{colors:e.colors,color:e.color,value:e.value,opacity:e.opacity,animation:{transitions:e.transitions}}));this.pointers=[t]}_buildPointers(e){for(let t=0;t<e.length;t++){let n=e[t];n.render(),n.value(n.options.value)}}_setValueOptions(e){this.options.value=e}currentColor(){let e=this.pointers[0];if(e)return e.currentColor()}centerLabelPosition(e,t){let n=this.getSize(),r=this.scale.arc.center,i=r.x-e/2,a=r.y-t/2;if(e<n.width){let t=i+e;i=Math.max(i,0),t>n.width&&(i-=t-n.width)}if(t<n.height){let e=this.scale.bbox,n=e.bottomRight().y,r=a+t;a=Math.max(a,e.origin.y),r>n&&(a-=r-n)}return{left:i,top:a}}};(class extends NC{_createModel(){let e=this.options.scale;typeof e.startAngle!=`number`&&(e.startAngle=90),e.endAngle=e.startAngle+360,super._createModel()}});var PC=class{constructor(e){this.setOptions(e),this.initProperties()}initProperties(){}setOptions(e){this.options=Object.assign({},this.options,e),this.quietZoneLength=this.options.addQuietZone?2*this.options.quietZoneLength:0}encode(e,t,n){let r=W(e)?String(e):e;return this.initValue(r,t,n),this.options.addQuietZone&&this.addQuietZone(),this.addData(),this.options.addQuietZone&&this.addQuietZone(),{baseUnit:this.baseUnit,pattern:this.pattern}}initValue(){}addQuietZone(){this.pattern.push(this.options.quietZoneLength||10)}addData(){}invalidCharacterError(e){throw Error(`Character "${e}" is not valid for symbology ${this.name}.`)}};J(PC,{quietZoneLength:10,addQuietZone:!0,addCheckSum:!0});let FC=Object.assign;var IC=class extends PC{initProperties(){super.initProperties(),FC(this,{name:`Code 11`,characterMap:[`111121`,`211121`,`121121`,`221111`,`112121`,`212111`,`122111`,`111221`,`211211`,`211111`,`112111`],cCheckSumTotal:10,kCheckSumTotal:9,kCheckSumMinLength:10,checkSumMod:11,DASH_VALUE:10,DASH:`-`,START:`112211`,STOP:`11221`})}initValue(e,t){this.pattern=[],this.value=e,this.width=t,this.totalUnits=0}addData(){let e=this.value;this.addPattern(this.START);for(let t=0;t<e.length;t++)this.addCharacter(e.charAt(t));this.options.addCheckSum&&this.addCheckSum(),this.addPattern(this.STOP),this.setBaseUnit()}setBaseUnit(){this.baseUnit=this.width/(this.totalUnits+this.quietZoneLength)}addCheckSum(){let e=this.value,t=e.length,n=this.getWeightedSum(e,t,this.cCheckSumTotal)%this.checkSumMod;if(this.checksum=String(n),this.addPattern(this.characterMap[n]),t++,t>=this.kCheckSumMinLength){let r=(n+this.getWeightedSum(e,t,this.kCheckSumTotal))%this.checkSumMod;this.checksum+=r,this.addPattern(this.characterMap[r])}}getWeightedSum(e,t,n){let r=0;for(let i=0;i<e.length;i++)r+=this.weightedValue(this.getValue(e.charAt(i)),t,i,n);return r}weightedValue(e,t,n,r){return((t-n)%r||r)*e}getValue(e){if(isNaN(e))e!==this.DASH&&this.invalidCharacterError(e);else return parseInt(e,10);return this.DASH_VALUE}addCharacter(e){let t=this.getValue(e),n=this.characterMap[t];this.addPattern(n)}addPattern(e){let t;for(let n=0;n<e.length;n++)t=parseInt(e.charAt(n),10),this.pattern.push(t),this.totalUnits+=t}};J(IC,{addCheckSum:!0});let LC=Object.assign;var RC=class extends PC{initProperties(){super.initProperties(),LC(this,{minBaseUnitLength:.7})}addData(){let e=this.value;this.addStart();for(let t=0;t<e.length;t++)this.addCharacter(e.charAt(t));this.options.addCheckSum&&this.pushCheckSum(),this.addStop(),this.prepareValues()}addCharacter(e){let t=this.characterMap[e];t||this.invalidCharacterError(e),this.addBase(t)}addBase(){}},zC=class extends RC{initProperties(){super.initProperties(),LC(this,{name:`Code 39`,checkSumMod:43,minRatio:2.5,maxRatio:3,gapWidth:1,splitCharacter:`|`,patternMappings:{b:`1|`,w:`1|`,B:`ratio|`,W:`ratio|`},characterMap:{0:{pattern:`bwbWBwBwb`,value:0},1:{pattern:`BwbWbwbwB`,value:1},2:{pattern:`bwBWbwbwB`,value:2},3:{pattern:`BwBWbwbwb`,value:3},4:{pattern:`bwbWBwbwB`,value:4},5:{pattern:`BwbWBwbwb`,value:5},6:{pattern:`bwBWBwbwb`,value:6},7:{pattern:`bwbWbwBwB`,value:7},8:{pattern:`BwbWbwBwb`,value:8},9:{pattern:`bwBWbwBwb`,value:9},A:{pattern:`BwbwbWbwB`,value:10},B:{pattern:`bwBwbWbwB`,value:11},C:{pattern:`BwBwbWbwb`,value:12},D:{pattern:`bwbwBWbwB`,value:13},E:{pattern:`BwbwBWbwb`,value:14},F:{pattern:`bwBwBWbwb`,value:15},G:{pattern:`bwbwbWBwB`,value:16},H:{pattern:`BwbwbWBwb`,value:17},I:{pattern:`bwBwbWBwb`,value:18},J:{pattern:`bwbwBWBwb`,value:19},K:{pattern:`BwbwbwbWB`,value:20},L:{pattern:`bwBwbwbWB`,value:21},M:{pattern:`BwBwbwbWb`,value:22},N:{pattern:`bwbwBwbWB`,value:23},O:{pattern:`BwbwBwbWb`,value:24},P:{pattern:`bwBwBwbWb`,value:25},Q:{pattern:`bwbwbwBWB`,value:26},R:{pattern:`BwbwbwBWb`,value:27},S:{pattern:`bwBwbwBWb`,value:28},T:{pattern:`bwbwBwBWb`,value:29},U:{pattern:`BWbwbwbwB`,value:30},V:{pattern:`bWBwbwbwB`,value:31},W:{pattern:`BWBwbwbwb`,value:32},X:{pattern:`bWbwBwbwB`,value:33},Y:{pattern:`BWbwBwbwb`,value:34},Z:{pattern:`bWBwBwbwb`,value:35},"-":{pattern:`bWbwbwBwB`,value:36},".":{pattern:`BWbwbwBwb`,value:37}," ":{pattern:`bWBwbwBwb`,value:38},$:{pattern:`bWbWbWbwb`,value:39},"/":{pattern:`bWbWbwbWb`,value:40},"+":{pattern:`bWbwbWbWb`,value:41},"%":{pattern:`bwbWbWbWb`,value:42},START:{pattern:`bWbwBwBwb`}}})}initValue(e,t,n){this.width=t,this.height=n,this.value=e,this.dataLength=e.length,this.pattern=[],this.patternString=``}prepareValues(){let e=this.minBaseUnitLength,t=this.minRatio,n=Math.ceil(Math.max(.15*this.width,24)),r,i=this.maxRatio;if(this.height<n)throw Error(`Insufficient height for Code39 encoding: the current height is ${this.height}px and the minimum height is ${n}px.`);for(r=this.getBaseUnit(i);r<e&&i>t;)i=parseFloat((i-.1).toFixed(1)),r=this.getBaseUnit(i);if(r<e){let n=Math.ceil(this.getBaseWidth(t)*e);throw Error(`Insufficient width for Code39 encoding: the current width is ${this.width}px and the minimum width for value "${this.value}" is ${n}px.`)}this.ratio=i,this.baseUnit=r,this.patternString=this.patternString.substring(0,this.patternString.length-1),this.pattern=this.pattern.concat(this.patternString.replace(/ratio/g,i).split(this.splitCharacter))}getBaseUnit(e){return this.width/this.getBaseWidth(e)}getBaseWidth(e){let t=3*(e+2);return this.quietZoneLength+t*(this.dataLength+2)+this.gapWidth*(this.dataLength+1)}addStart(){this.addPattern(this.characterMap.START.pattern),this.addCharacterGap()}addBase(e){this.addPattern(e.pattern),this.addCharacterGap()}addStop(){this.addPattern(this.characterMap.START.pattern)}addPattern(e){for(let t=0;t<e.length;t++)this.patternString+=this.patternMappings[e.charAt(t)]}addCharacterGap(){this.patternString+=this.gapWidth+this.splitCharacter}};J(zC,{addCheckSum:!1});let BC={addCharacter(e){this.characterMap[e]?this.addBase(this.characterMap[e]):e.charCodeAt(0)>127?this.invalidCharacterError(e):this.addExtended(e.charCodeAt(0))},addExtended(e){let t;for(let n=0;n<this.extendedMappings.length;n++)if(t=this.extendedMappings[n].call(this,e),t){for(let e=0;e<t.length;e++){let n=t[e];this.addBase(n)}this.dataLength+=t.length-1;return}},extendedMappings:[function(e){if(97<=e&&e<=122)return[this.characterMap[this.shiftCharacters[0]],this.characterMap[String.fromCharCode(e-32)]]},function(e){if(33<=e&&e<=58)return[this.characterMap[this.shiftCharacters[1]],this.characterMap[String.fromCharCode(e+32)]]},function(e){if(1<=e&&e<=26)return[this.characterMap[this.shiftCharacters[2]],this.characterMap[String.fromCharCode(e+64)]]},function(e){let t,n;if(!this.specialAsciiCodes[e])n=Math.floor(e/32)*6+(e-27)%32+64,t=[this.characterMap[this.shiftCharacters[3]],this.characterMap[String.fromCharCode(n)]];else{t=[];for(let n=0;n<this.specialAsciiCodes[e].length;n++)t.push(this.characterMap[this.shiftCharacters[3]]),t.push(this.characterMap[this.specialAsciiCodes[e][n]])}return t}],specialAsciiCodes:{0:[`U`],64:[`V`],96:[`W`],127:[`T`,`X`,`Y`,`Z`]},shiftValuesAsciiCodes:{39:36,40:47,41:43,42:37},characterMap:{"+":!1,"/":!1,$:!1,"%":!1},shiftCharacters:[`SHIFT0`,`SHIFT1`,`SHIFT2`,`SHIFT3`]};var VC=class extends zC{initProperties(){super.initProperties(),V(this,BC,{name:`Code 39 extended`,characterMap:{SHIFT0:{pattern:`bWbwbWbWb`,value:41},SHIFT1:{pattern:`bWbWbwbWb`,value:40},SHIFT2:{pattern:`bWbWbWbwb`,value:39},SHIFT3:{pattern:`bwbWbWbWb`,value:42}}})}};let HC=Object.assign;var UC=class extends RC{initProperties(){super.initProperties(),HC(this,{name:`Code 93`,cCheckSumTotal:20,kCheckSumTotal:15,checkSumMod:47,characterMap:{0:{pattern:`131112`,value:0},1:{pattern:`111213`,value:1},2:{pattern:`111312`,value:2},3:{pattern:`111411`,value:3},4:{pattern:`121113`,value:4},5:{pattern:`121212`,value:5},6:{pattern:`121311`,value:6},7:{pattern:`111114`,value:7},8:{pattern:`131211`,value:8},9:{pattern:`141111`,value:9},A:{pattern:`211113`,value:10},B:{pattern:`211212`,value:11},C:{pattern:`211311`,value:12},D:{pattern:`221112`,value:13},E:{pattern:`221211`,value:14},F:{pattern:`231111`,value:15},G:{pattern:`112113`,value:16},H:{pattern:`112212`,value:17},I:{pattern:`112311`,value:18},J:{pattern:`122112`,value:19},K:{pattern:`132111`,value:20},L:{pattern:`111123`,value:21},M:{pattern:`111222`,value:22},N:{pattern:`111321`,value:23},O:{pattern:`121122`,value:24},P:{pattern:`131121`,value:25},Q:{pattern:`212112`,value:26},R:{pattern:`212211`,value:27},S:{pattern:`211122`,value:28},T:{pattern:`211221`,value:29},U:{pattern:`221121`,value:30},V:{pattern:`222111`,value:31},W:{pattern:`112122`,value:32},X:{pattern:`112221`,value:33},Y:{pattern:`122121`,value:34},Z:{pattern:`123111`,value:35},"-":{pattern:`121131`,value:36},".":{pattern:`311112`,value:37}," ":{pattern:`311211`,value:38},$:{pattern:`321111`,value:39},"/":{pattern:`112131`,value:40},"+":{pattern:`113121`,value:41},"%":{pattern:`211131`,value:42},SHIFT0:{pattern:`122211`,value:46},SHIFT1:{pattern:`311121`,value:45},SHIFT2:{pattern:`121221`,value:43},SHIFT3:{pattern:`312111`,value:44},START:{pattern:`111141`},TERMINATION_BAR:`1`}})}initValue(e,t,n){this.value=e,this.width=t,this.height=n,this.pattern=[],this.values=[],this.dataLength=e.length}prepareValues(){let e=Math.ceil(Math.max(.15*this.width,24));if(this.height<e)throw Error(`Insufficient height for Code93 encoding: the current height is ${this.height}px, the minimum required height is ${e}px.`);if(this.setBaseUnit(),this.baseUnit<this.minBaseUnitLength){let e=Math.ceil(this.minBaseUnitLength*(this.width/this.baseUnit));throw Error(`Insufficient width for Code93 encoding: the current width is ${this.width}px and the minimum required width for value "${this.value}" is ${e}px.`)}}setBaseUnit(){this.baseUnit=this.width/(9*(this.dataLength+2+2)+this.quietZoneLength+1)}addStart(){let e=this.characterMap.START.pattern;this.addPattern(e)}addStop(){this.addStart(),this.pattern.push(this.characterMap.TERMINATION_BAR)}addBase(e){this.addPattern(e.pattern),this.values.push(e.value)}pushCheckSum(){let e=this._getCheckValues(),t;this.checksum=e.join(``);for(let n=0;n<e.length;n++)t=this.characterMap[this._findCharacterByValue(e[n])],this.addPattern(t.pattern)}_getCheckValues(){let e=this.values,t=e.length,n=0,r,i,a;for(a=t-1;a>=0;a--)n+=this.weightedValue(e[a],t-a,this.cCheckSumTotal);for(r=n%this.checkSumMod,n=this.weightedValue(r,1,this.kCheckSumTotal),a=t-1;a>=0;a--)n+=this.weightedValue(e[a],t-a+1,this.kCheckSumTotal);return i=n%this.checkSumMod,[r,i]}_findCharacterByValue(e){for(let t in this.characterMap)if(this.characterMap[t].value===e)return t}weightedValue(e,t,n){return(t%n||n)*e}addPattern(e){let t;for(let n=0;n<e.length;n++)t=parseInt(e.charAt(n),10),this.pattern.push(t)}},WC=class extends UC{initProperties(){super.initProperties(),V(this,BC,{name:`Code 93 extended`,pushCheckSum:function(){let e=this._getCheckValues(),t;this.checksum=e.join(``);for(let n=0;n<e.length;n++)if(t=e[n],this.shiftValuesAsciiCodes[t])this.addExtended(this.shiftValuesAsciiCodes[t]);else{let e=this._findCharacterByValue(t);this.addPattern(this.characterMap[e].pattern)}}})}};let GC=/^\d+$/,KC=Object.assign;var qC=class extends PC{initProperties(){super.initProperties(),KC(this,{name:`Postnet`,START:`2`,VALID_CODE_LENGTHS:[5,9,11],DIGIT_SEPARATOR:`-`,characterMap:[`22111`,`11122`,`11212`,`11221`,`12112`,`12121`,`12211`,`21112`,`21121`,`21211`]})}initValue(e,t,n){this.height=n,this.width=t,this.baseHeight=n/2,this.value=e.replace(new RegExp(this.DIGIT_SEPARATOR,`g`),``),this.pattern=[],this.validate(this.value),this.checkSum=0,this.setBaseUnit()}addData(){let e=this.value;this.addPattern(this.START);for(let t=0;t<e.length;t++)this.addCharacter(e.charAt(t));this.options.addCheckSum&&this.addCheckSum(),this.addPattern(this.START),this.pattern.pop()}addCharacter(e){let t=this.characterMap[e];this.checkSum+=parseInt(e,10),this.addPattern(t)}addCheckSum(){this.checksum=(10-this.checkSum%10)%10,this.addCharacter(this.checksum)}setBaseUnit(){this.baseUnit=this.width/((this.value.length+1)*10+3+this.quietZoneLength)}validate(e){if(GC.test(e)||this.invalidCharacterError(e.match(/[^0-9]/)[0]),!U(e.length,this.VALID_CODE_LENGTHS))throw Error(`Invalid value length. Valid lengths for the Postnet symbology are `+this.VALID_CODE_LENGTHS.join(`,`)+`.`)}addPattern(e){let t;for(let n=0;n<e.length;n++)t=this.height-this.baseHeight*e.charAt(n),this.pattern.push({width:1,y1:t,y2:this.height}),this.pattern.push(1)}};let JC=/^\d+$/,YC=/^[a-z0-9]+$/i,XC=Object.assign;var ZC=class{constructor(e){this.encoding=e,this.initProperties()}initProperties(){}addStart(){}is(){}isCode(){return!1}move(){}pushState(){}},QC=class extends ZC{constructor(e,t){super(e),this.states=t,this._initMoves(t)}initProperties(){super.initProperties(),V(this,{FNC4:`FNC4`,SHIFT:98})}addStart(){this.encoding.addPattern(this.START)}is(e,t){let n=e.charCodeAt(t);return this.isCode(n)}move(e){let t=0;for(;!this._moves[t].call(this,e)&&t<this._moves.length;)t++}pushState(e){let t=this.states,n=e.value,r=n.length,i;if(U(`C`,t)){let t=n.substr(e.index).match(/\d{4,}/g);t&&(r=n.indexOf(t[0],e.index))}for(;(i=e.value.charCodeAt(e.index))>=0&&this.isCode(i)&&e.index<r;)this.encoding.addPattern(this.getValue(i)),e.index++}_initMoves(e){this._moves=[],U(this.FNC4,e)&&this._moves.push(this._moveFNC),U(this.shiftKey,e)&&this._moves.push(this._shiftState),this._moves.push(this._moveState)}_moveFNC(e){if(e.fnc)return e.fnc=!1,e.previousState===this.key}_shiftState(e){if(e.previousState===this.shiftKey&&(e.index+1>=e.value.length||this.encoding[this.shiftKey].is(e.value,e.index+1)))return this.encoding.addPattern(this.SHIFT),e.shifted=!0,!0}_moveState(){return this.encoding.addPattern(this.MOVE),!0}};let $C={};$C.A=class extends QC{initProperties(){super.initProperties(),XC(this,{key:`A`,shiftKey:`B`,MOVE:101,START:103})}isCode(e){return 0<=e&&e<96}getValue(e){return e<32?e+64:e-32}},$C.B=class extends QC{initProperties(){super.initProperties(),XC(this,{key:`B`,shiftKey:`A`,MOVE:100,START:104})}isCode(e){return 32<=e&&e<128}getValue(e){return e-32}},$C.C=class extends ZC{initProperties(){super.initProperties(),XC(this,{key:`C`,MOVE:99,START:105})}addStart(){this.encoding.addPattern(this.START)}is(e,t){let n=ow(e,t,4);return(t+4<=e.length||e.length===2)&&JC.test(n)}move(){this.encoding.addPattern(this.MOVE)}pushState(e){let t;for(;(t=ow(e.value,e.index,2))&&JC.test(t)&&t.length===2;)this.encoding.addPattern(parseInt(t,10)),e.index+=2}getValue(e){return e}},$C.FNC4=class extends ZC{constructor(e,t){super(e),this._initSubStates(t)}initProperties(){super.initProperties(),XC(this,{key:`FNC4`,dependentStates:[`A`,`B`]})}addStart(e){let t=e.value.charCodeAt(0)-128,n=this._getSubState(t);this.encoding[n].addStart()}is(e,t){let n=e.charCodeAt(t);return this.isCode(n)}isCode(e){return 128<=e&&e<256}pushState(e){let t=this._initSubState(e),n=this.encoding,r=t.value.length,i;if(e.index+=r,r<3)for(;t.index<r;t.index++)i=t.value.charCodeAt(t.index),t.state=this._getSubState(i),t.previousState!==t.state&&(t.previousState=t.state,n[t.state].move(t)),n.addPattern(n[t.state].MOVE),n.addPattern(n[t.state].getValue(i));else t.state!==t.previousState&&n[t.state].move(t),this._pushStart(t),n.pushData(t,this.subStates),e.index<e.value.length&&this._pushStart(t);e.fnc=!0,e.state=t.state}_pushStart(e){this.encoding.addPattern(this.encoding[e.state].MOVE),this.encoding.addPattern(this.encoding[e.state].MOVE)}_initSubState(e){let t={value:this._getAll(e.value,e.index),index:0};return t.state=this._getSubState(t.value.charCodeAt(0)),t.previousState=e.previousState===this.key?t.state:e.previousState,t}_initSubStates(e){this.subStates=[];for(let t=0;t<e.length;t++)U(e[t],this.dependentStates)&&this.subStates.push(e[t])}_getSubState(e){for(let t=0;t<this.subStates.length;t++)if(this.encoding[this.subStates[t]].isCode(e))return this.subStates[t]}_getAll(e,t){let n,r=``,i=t;for(;(n=e.charCodeAt(i++))&&this.isCode(n);)r+=String.fromCharCode(n-128);return r}},$C.FNC1=class extends ZC{constructor(e,t){super(e),this.states=t}initProperties(){super.initProperties(),XC(this,{key:`FNC1`,startState:`C`,startAI:`(`,endAI:`)`,dependentStates:[`C`,`B`],applicationIdentifiers:{22:{max:29,type:`alphanumeric`},402:{length:17},7004:{max:4,type:`alphanumeric`},242:{max:6,type:`alphanumeric`},8020:{max:25,type:`alphanumeric`},703:{min:3,max:30,type:`alphanumeric`},8008:{min:8,max:12,type:`alphanumeric`},253:{min:13,max:17,type:`alphanumeric`},8003:{min:14,max:30,type:`alphanumeric`},multiKey:[{ids:[`15`,`17`,`8005`,`8100`],ranges:[[11,13],[310,316],[320,336],[340,369]],type:{length:6}},{ids:[`240`,`241`,`250`,`251`,`400`,`401`,`403`,`7002`,`8004`,`8007`,`8110`],ranges:[[-9]],type:{max:30,type:`alphanumeric`}},{ids:[`7001`],ranges:[[410,414]],type:{length:13}},{ids:[`10`,`21`,`254`,`420`,`8002`],type:{max:20,type:`alphanumeric`}},{ids:[`00`,`8006`,`8017`,`8018`],type:{length:18}},{ids:[`01`,`02`,`8001`],type:{length:14}},{ids:[`422`],ranges:[[424,426]],type:{length:3}},{ids:[`20`,`8102`],type:{length:2}},{ids:[`30`,`37`],type:{max:8,type:`alphanumeric`}},{ids:[`390`,`392`],type:{max:15,type:`alphanumeric`}},{ids:[`421`,`423`],type:{min:3,max:15,type:`alphanumeric`}},{ids:[`391`,`393`],type:{min:3,max:18,type:`alphanumeric`}},{ids:[`7003`,`8101`],type:{length:10}}]},START:102})}addStart(){this.encoding[this.startState].addStart()}is(){return U(this.key,this.states)}pushState(e){let t=this.encoding,n=e.value.replace(/\s/g,``),r=RegExp(`[`+this.startAI+this.endAI+`]`,`g`),i=e.index,a={state:this.startState},o,s,c;for(t.addPattern(this.START);;){if(a.index=0,c=n.charAt(i)===this.startAI?2:0,o=c>0?this.getBySeparator(n,i):this.getByLength(n,i),o.ai.length)s=i+c+o.id.length+o.ai.length;else if(s=n.indexOf(this.startAI,i+1),s<0){if(i+o.ai.max+o.id.length+c<n.length)throw Error(`Separators are required after variable length identifiers`);s=n.length}if(a.value=n.substring(i,s).replace(r,``),this.validate(o,a.value),t.pushData(a,this.dependentStates),s>=n.length)break;i=s,a.state!==this.startState&&(t[this.startState].move(a),a.state=this.startState),o.ai.length||t.addPattern(this.START)}e.index=e.value.length}validate(e,t){let n=t.substr(e.id.length),r=e.ai;if(!r.type&&!JC.test(n))throw Error(`Application identifier `+e.id+` is numeric only but contains non numeric character(s).`);if(r.type===`alphanumeric`&&!YC.test(n))throw Error(`Application identifier `+e.id+` is alphanumeric only but contains non alphanumeric character(s).`);if(r.length&&r.length!==n.length)throw Error(`Application identifier `+e.id+` must be `+r.length+` characters long.`);if(r.min&&r.min>n.length)throw Error(`Application identifier `+e.id+` must be at least `+r.min+` characters long.`);if(r.max&&r.max<n.length)throw Error(`Application identifier `+e.id+` must be at most `+r.max+` characters long.`)}getByLength(e,t){let n,r;for(let i=2;i<=4;i++)if(n=ow(e,t,i),r=this.getApplicationIdentifier(n)||this.getApplicationIdentifier(n.substring(0,n.length-1)),r)return{id:n,ai:r};this.unsupportedAIError(n)}unsupportedAIError(e){throw Error(`'`+e+`' is not a supported Application Identifier`)}getBySeparator(e,t){let n=e.indexOf(this.startAI,t),r=e.indexOf(this.endAI,n),i=e.substring(n+1,r),a=this.getApplicationIdentifier(i)||this.getApplicationIdentifier(i.substr(i.length-1));return a||this.unsupportedAIError(i),{ai:a,id:i}}getApplicationIdentifier(e){let t=this.applicationIdentifiers,n=t.multiKey;if(t[e])return t[e];for(let t=0;t<n.length;t++){if(n[t].ids&&U(e,n[t].ids))return n[t].type;if(n[t].ranges){let r=n[t].ranges;for(let i=0;i<r.length;i++)if(r[i][0]<=e&&e<=r[i][1])return n[t].type}}}};var ew=class extends PC{constructor(e){super(e),this._initStates()}initProperties(){super.initProperties(),XC(this,{characterMap:[212222,222122,222221,121223,121322,131222,122213,122312,132212,221213,221312,231212,112232,122132,122231,113222,123122,123221,223211,221132,221231,213212,223112,312131,311222,321122,321221,312212,322112,322211,212123,212321,232121,111323,131123,131321,112313,132113,132311,211313,231113,231311,112133,112331,132131,113123,113321,133121,313121,211331,231131,213113,213311,213131,311123,311321,331121,312113,312311,332111,314111,221411,431111,111224,111422,121124,121421,141122,141221,112214,112412,122114,122411,142112,142211,241211,221114,413111,241112,134111,111242,121142,121241,114212,124112,124211,411212,421112,421211,212141,214121,412121,111143,111341,131141,114113,114311,411113,411311,113141,114131,311141,411131,211412,211214,211232,2331112],STOP:106})}_initStates(){for(let e=0;e<this.states.length;e++)this[this.states[e]]=new $C[this.states[e]](this,this.states)}initValue(e,t,n){this.pattern=[],this.value=e,this.width=t,this.height=n,this.checkSum=0,this.totalUnits=0,this.index=0,this.position=1}addData(){let e={value:this.value,index:0,state:``};this.value.length!==0&&(e.state=e.previousState=this.getNextState(e,this.states),this.addStart(e),this.pushData(e,this.states),this.addCheckSum(),this.addStop(),this.setBaseUnit())}pushData(e,t){for(;this[e.state].pushState(e),!(e.index>=e.value.length);)if(!e.shifted)e.previousState=e.state,e.state=this.getNextState(e,t),this[e.state].move(e);else{let t=e.state;e.state=e.previousState,e.previousState=t,e.shifted=!1}}addStart(e){this[e.state].addStart(e),this.position=1}addCheckSum(){this.checksum=this.checkSum%103,this.addPattern(this.checksum)}addStop(){this.addPattern(this.STOP)}setBaseUnit(){this.baseUnit=this.width/(this.totalUnits+this.quietZoneLength)}addPattern(e){let t=this.characterMap[e].toString(),n;for(let e=0;e<t.length;e++)n=parseInt(t.charAt(e),10),this.pattern.push(n),this.totalUnits+=n;this.checkSum+=e*this.position++}getNextState(e,t){for(let n=0;n<t.length;n++)if(this[t[n]].is(e.value,e.index))return t[n];this.invalidCharacterError(e.value.charAt(e.index))}},tw=class extends ew{initProperties(){super.initProperties(),XC(this,{name:`Code 128 A`,states:[`A`]})}},nw=class extends ew{initProperties(){super.initProperties(),XC(this,{name:`Code 128 B`,states:[`B`]})}},rw=class extends ew{initProperties(){super.initProperties(),XC(this,{name:`Code 128 C`,states:[`C`]})}},iw=class extends ew{initProperties(){super.initProperties(),XC(this,{name:`Code 128`,states:[`C`,`B`,`A`,`FNC4`]})}},aw=class extends ew{initProperties(){super.initProperties(),XC(this,{name:`Code GS1-128`,states:[`FNC1`,`C`,`B`]})}};function ow(e,t,n){return e.substring(t,t+n)}let sw=Object.assign;var cw=class extends PC{initProperties(){super.initProperties(),sw(this,{characterMap:[`12121212`,`12121221`,`12122112`,`12122121`,`12211212`,`12211221`,`12212112`,`12212121`,`21121212`,`21121221`],START:`21`,STOP:`121`,checkSumType:``,checkSums:pw})}initValue(e,t){this.pattern=[],this.value=e,this.checkSumLength=0,this.width=t}setBaseUnit(){this.baseUnit=this.width/(12*(this.value.length+this.checkSumLength)+this.quietZoneLength+7)}addData(){let e=this.value;this.addPattern(this.START);for(let t=0;t<e.length;t++)this.addCharacter(e.charAt(t));this.options.addCheckSum&&this.addCheckSum(),this.addPattern(this.STOP),this.setBaseUnit()}addCharacter(e){let t=this.characterMap[e];t||this.invalidCharacterError(e),this.addPattern(t)}addPattern(e){for(let t=0;t<e.length;t++)this.pattern.push(parseInt(e.charAt(t),10))}addCheckSum(){let e=this.checkSums[this.checkSumType].call(this.checkSums,this.value);this.checksum=e.join(``);for(let t=0;t<e.length;t++)this.checkSumLength++,this.addPattern(this.characterMap[e[t]])}},lw=class extends cw{initProperties(){super.initProperties(),sw(this,{name:`MSI Modulo10`,checkSumType:`Modulo10`})}},uw=class extends cw{initProperties(){super.initProperties(),sw(this,{name:`MSI Modulo11`,checkSumType:`Modulo11`})}},dw=class extends cw{initProperties(){super.initProperties(),sw(this,{name:`MSI Modulo10 Modulo10`,checkSumType:`Modulo10Modulo10`})}},fw=class extends cw{initProperties(){super.initProperties(),sw(this,{name:`MSI Modulo11 Modulo10`,checkSumType:`Modulo11Modulo10`})}};let pw={Modulo10(e){let t=[0,``],n=e.length%2,r,i,a;for(r=0;r<e.length;r++)t[(r+n)%2]+=parseInt(e.charAt(r),10);for(a=t[0],i=(t[1]*2).toString(),r=0;r<i.length;r++)a+=parseInt(i.charAt(r),10);return[(10-a%10)%10]},Modulo11(e){let t=0,n=e.length,r,i;for(let i=0;i<n;i++)r=((n-i)%6||6)+1,t+=r*e.charAt(i);return i=(11-t%11)%11,i===10?[1,0]:[i]},Modulo11Modulo10(e){let t=this.Modulo11(e),n;return n=e+t[0],t.concat(this.Modulo10(n))},Modulo10Modulo10(e){let t=this.Modulo10(e),n;return n=e+t[0],t.concat(this.Modulo10(n))}},mw=Object.assign;var hw=class extends PC{initProperties(){super.initProperties(),mw(this,{name:`EAN 13`,keyTable:[`000000`,`001011`,`001101`,`001110`,`010011`,`011001`,`011100`,`010101`,`010110`,`011010`],characterMap:{digits:[[3,2,1,1],[2,2,2,1],[2,1,2,2],[1,4,1,1],[1,1,3,2],[1,2,3,1],[1,1,1,4],[1,3,1,2],[1,2,1,3],[3,1,1,2]],start:[1,1,1],middle:[1,1,1,1,1]}})}initValue(e,t,n){let r=String(e);if(r.length!==12||/\D/.test(r))throw Error(`The value of the "EAN13" encoding should be 12 symbols`);this.pattern=[],this.options.height=n,this.baseUnit=t/(95+this.quietZoneLength),this.value=r,this.checksum=this.calculateChecksum(),this.leftKey=r[0],this.leftPart=r.substr(1,6),this.rightPart=r.substr(7)+this.checksum}addData(){this.addPieces(this.characterMap.start),this.addSide(this.leftPart,this.leftKey),this.addPieces(this.characterMap.middle),this.addSide(this.rightPart),this.addPieces(this.characterMap.start)}addSide(e,t){for(let n=0;n<e.length;n++)t&&parseInt(this.keyTable[t].charAt(n),10)?this.addPieces(Array.prototype.slice.call(this.characterMap.digits[e.charAt(n)]).reverse(),!0):this.addPieces(this.characterMap.digits[e.charAt(n)],!0)}addPieces(e,t){for(let n=0;n<e.length;n++)t?this.pattern.push({y1:0,y2:this.options.height*.95,width:e[n]}):this.pattern.push(e[n])}calculateChecksum(){let e=0,t=0,n=this.value.split(``).reverse().join(``);for(let r=0;r<n.length;r++)r%2?t+=parseInt(n.charAt(r),10):e+=parseInt(n.charAt(r),10);return(10-(3*e+t)%10)%10}};let gw=Object.assign,_w={code11:IC,code39:zC,code39extended:VC,code93:UC,code93extended:WC,code128:iw,code128a:tw,code128b:nw,code128c:rw,"gs1-128":aw,msimod10:lw,msimod11:uw,msimod1010:dw,msimod1110:fw,postnet:qC,ean8:class extends hw{initProperties(){super.initProperties(),gw(this,{name:`EAN 8`})}initValue(e,t,n){if(e.length!==7||/\D/.test(e))throw Error(`Invalid value provided`);this.value=e,this.options.height=n,this.checksum=this.calculateChecksum(this.value),this.leftPart=this.value.substr(0,4),this.rightPart=this.value.substr(4)+this.checksum,this.pattern=[],this.baseUnit=t/(67+this.quietZoneLength)}},ean13:hw};function vw(e,t){let n=e.style.display;t===`canvas`&&(e.style.display=`block`);let r={width:e.clientWidth,height:e.clientHeight};return e.style.display=n,r}J(class{constructor(e,t,n=kf){this.options=V({},this.options,t),this.element=e,this.onError=n,this._initElement(),this._initSurface(),this._setOptions(t),t&&W(t.value)&&this.redraw()}destroy(){this._destroySurface()}_initElement(){ce(this.element,`k-barcode`)}_initSurface(){let{options:e,surface:t}=this;(!t||t.options.type!==e.renderAs)&&(this._destroySurface(),this._initSurfaceElement(),this.surface=this._createSurface())}_createSurface(){return vo.create(this.surfaceElement,{type:this.options.renderAs})}_destroySurface(){this.surface&&(this.surface.destroy(),this.surface=null,this._destroySurfaceElement())}_initSurfaceElement(){this.surfaceElement||(this.surfaceElement=document.createElement(`div`),this.surfaceElement.style.position=`relative`,this.element.appendChild(this.surfaceElement))}_destroySurfaceElement(){this.surfaceElement&&this.surfaceElement.parentNode&&(this.surfaceElement.parentNode.removeChild(this.surfaceElement),this.surfaceElement=null)}setOptions(e){this._setOptions(e),this._initSurface(),this.redraw()}redraw(){let e=this._getSize();this.surface.clear(),this.surface.setSize({width:e.width,height:e.height}),this.createVisual(),this.surface.draw(this.visual)}getSize(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}}_resize(){this.redraw()}createVisual(){this.visual=this._render()}_render(){let e=this.options,t=e.value,n=e.text,r=H(n.margin),i=this._getSize(),a=e.border||{},o=this.encoding,s=new Z(0,0,i.width,i.height).unpad(a.width).unpad(e.padding),c=s.height(),l,u,d,f=new P;this.contentBox=s,f.append(this._getBackground(i)),n.visible&&(d=Yt(t,{font:n.font}).height,c-=d+r.top+r.bottom);try{l=o.encode(t,s.width(),c)}catch(e){return this.onError(e),f}return n.visible&&(u=this._displayValue==null?t:this._displayValue,e.checksum&&W(o.checksum)&&(u+=` `+o.checksum),f.append(this._getText(u))),this.barHeight=c,this._bandsGroup=this._getBands(l.pattern,l.baseUnit),f.append(this._bandsGroup),f}exportVisual(){return this._render()}_getSize(){let e=this.element,t=vw(e,this.options.renderAs),n=new Cn(300,100);return t.width>0&&(n.width=t.width),t.height>0&&(n.height=t.height),this.options.width&&(n.width=this.options.width),this.options.height&&(n.height=this.options.height),n}value(e){if(!W(e))return this.options.value;this.options.value=String(e),this.redraw()}_getBands(e,t){let n=this.contentBox,r=n.x1,i,a,o=new P;for(let s=0;s<e.length;s++){if(a=Dd(e[s])?e[s]:{width:e[s],y1:0,y2:this.barHeight},i=a.width*t,s%2){let e=j.fromPoints(new A(r,a.y1+n.y1),new A(r+i,a.y2+n.y1)),t=N.fromRect(e,{fill:{color:this.options.color},stroke:null});o.append(t)}r+=i}return o}_getBackground(e){let t=this.options,n=t.border||{},r=new Z(0,0,e.width,e.height).unpad(n.width/2);return N.fromRect(r.toRect(),{fill:{color:t.background},stroke:{color:n.width?n.color:``,width:n.width,dashType:n.dashType}})}_getText(e){let t=this.options.text,n=this._textbox=new om(e,{font:t.font,color:t.color,align:`center`,vAlign:`bottom`,margin:t.margin});return n.reflow(this.contentBox),n.renderVisual(),n.visual}_setOptions(e){if(this.type=(e.type||this.options.type).toLowerCase(),this._displayValue=null,this.type===`upca`&&(this.type=`ean13`,this._displayValue=e.value,e.value=`0`+e.value),this.type===`upce`&&(this.type=`ean8`,this._displayValue=e.value,e.value=`0`+e.value),!_w[this.type])throw Error(`Encoding '${this.type}' is not supported.`);this.encoding=new _w[this.type],this.options=V({},this.options,e)}},{name:`Barcode`,renderAs:`svg`,value:``,type:`code39`,checksum:!1,width:0,height:0,color:`black`,background:`white`,text:{visible:!0,font:`16px Consolas, Monaco, Sans Mono, monospace, sans-serif`,color:`black`,margin:{top:0,bottom:0,left:0,right:0}},border:{width:0,dashType:`solid`,color:`black`},padding:{top:0,bottom:0,left:0,right:0}});let yw=Object.assign;function bw(e,t){let n=[],r=0;for(;r<e.length;)n.push(e.substring(r,r+t)),r+=t;return n}function xw(e,t){let n=Number(e).toString(2);return n.length<t&&(n=Array(t-n.length+1).join(0)+n),n}function Sw(e){return parseInt(e,2)}var Cw=class{constructor(e){this.matrix=e,this.row=e.length-1,this.column=e.length-1,this.startColumn=this.column,this.dir=-1,this.c=0}move(){this.row+=this.dir*this.c,this.c^=1,this.column=this.startColumn-this.c}getNextCell(){for(;this.matrix[this.row][this.column]!==void 0;)this.move(),(this.row<0||this.row>=this.matrix.length)&&(this.dir=-this.dir,this.startColumn-=this.startColumn===8?3:2,this.column=this.startColumn,this.row=this.dir<0?this.matrix.length-1:0);return{row:this.row,column:this.column}}getNextRemainderCell(){if(this.move(),this.matrix[this.row][this.column]===void 0)return{row:this.row,column:this.column}}},ww=class{constructor(e,t){this.dataString=e,this.version=t}};let Tw=`alphanumeric`,Ew=/^\d+/,Dw=RegExp(`^[A-Z $%*+./:-]+`),Ow=RegExp(`^[A-Z0-9 $%*+./:-]+`),kw=RegExp(`^[^A-Z0-9 $%*+./:-]+`);function Aw(e,t,n,r,i){let a=Ew.exec(e),o=a?a[0]:``,s=Dw.exec(e),c=s?s[0]:``,l=Ow.exec(e),u=l?l[0]:``,d,f;return o&&(o.length>=t||e.length===o.length||o.length>=n&&!Ow.test(e.charAt(o.length)))?(d=`numeric`,f=o):u&&(e.length===u.length||u.length>=r||i===Tw)?(d=Tw,f=o||c):(d=`byte`,f=u?u+kw.exec(e.substring(u.length))[0]:kw.exec(e)[0]),{mode:d,modeString:f}}var jw=class{constructor(){this.initProperties()}initProperties(){yw(this,{modeIndicator:``,bitsInCharacterCount:[]})}getVersionIndex(e){return e<10?0:e>26?2:1}getBitsCharacterCount(e){return this.bitsInCharacterCount[this.getVersionIndex(e||40)]}getModeCountString(e,t){return this.modeIndicator+xw(e,this.getBitsCharacterCount(t))}encode(){}getStringBitsLength(){}getValue(){}},Mw=class extends jw{initProperties(){super.initProperties(),yw(this,{bitsInCharacterCount:[10,12,14],modeIndicator:`0001`})}getValue(e){return parseInt(e,10)}encode(e,t){let n=this,r=bw(e,3),i=n.getModeCountString(e.length,t),a;for(a=0;a<r.length-1;a++)i+=xw(r[a],10);return i+xw(r[a],1+3*r[a].length)}getStringBitsLength(e,t){let n=e%3;return 4+this.getBitsCharacterCount(t)+10*Math.floor(e/3)+3*n+(n===0?0:1)}},Nw=class extends jw{initProperties(){super.initProperties(),yw(this,{characters:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,G:16,H:17,I:18,J:19,K:20,L:21,M:22,N:23,O:24,P:25,Q:26,R:27,S:28,T:29,U:30,V:31,W:32,X:33,Y:34,Z:35," ":36,$:37,"%":38,"*":39,"+":40,"-":41,".":42,"/":43,":":44},bitsInCharacterCount:[9,11,13],modeIndicator:`0010`})}getValue(e){return this.characters[e]}encode(e,t){let n=bw(e,2),r=this.getModeCountString(e.length,t),i,a;for(a=0;a<n.length-1;a++)i=45*this.getValue(n[a].charAt(0))+this.getValue(n[a].charAt(1)),r+=xw(i,11);return i=n[a].length===2?45*this.getValue(n[a].charAt(0))+this.getValue(n[a].charAt(1)):this.getValue(n[a].charAt(0)),r+xw(i,1+5*n[a].length)}getStringBitsLength(e,t){return 4+this.getBitsCharacterCount(t)+11*Math.floor(e/2)+e%2*6}},Pw=class extends jw{initProperties(){super.initProperties(),yw(this,{bitsInCharacterCount:[8,16,16],modeIndicator:`0100`})}getValue(e){let t=e.charCodeAt(0);if(t<=127||160<=t&&t<=255)return t;throw Error(`Unsupported character in QR Code: "${e}".`)}encode(e,t){let n=this,r=n.getModeCountString(e.length,t);for(let t=0;t<e.length;t++)r+=xw(n.getValue(e.charAt(t)),8);return r}getStringBitsLength(e,t){return 4+this.getBitsCharacterCount(t)+8*e}};let Fw={numeric:new Mw,alphanumeric:new Nw,byte:new Pw};function Iw(e){let t=0,n;for(let r=0;r<e.length;r++)n=Fw[e[r].mode],t+=n.getStringBitsLength(e[r].modeString.length);return Math.ceil(t/8)}function Lw(e,t){let n=``,r;for(let i=0;i<e.length;i++)r=Fw[e[i].mode],n+=r.encode(e[i].modeString,t);return n}function Rw(e){let t=[],n,r=0,i=e;for(t.push(Aw(i,8,5,8,n)),n=t[0].mode,i=i.substr(t[0].modeString.length);i.length>0;){let e=Aw(i,17,9,16,n);e.mode===n?t[r].modeString+=e.modeString:(n=e.mode,t.push(e),r++),i=i.substr(e.modeString.length)}return t}let zw=[{L:{groups:[[1,19]],totalDataCodewords:19,errorCodewordsPerBlock:7},M:{groups:[[1,16]],totalDataCodewords:16,errorCodewordsPerBlock:10},Q:{groups:[[1,13]],totalDataCodewords:13,errorCodewordsPerBlock:13},H:{groups:[[1,9]],totalDataCodewords:9,errorCodewordsPerBlock:17}},{L:{groups:[[1,34]],totalDataCodewords:34,errorCodewordsPerBlock:10},M:{groups:[[1,28]],totalDataCodewords:28,errorCodewordsPerBlock:16},Q:{groups:[[1,22]],totalDataCodewords:22,errorCodewordsPerBlock:22},H:{groups:[[1,16]],totalDataCodewords:16,errorCodewordsPerBlock:28}},{L:{groups:[[1,55]],totalDataCodewords:55,errorCodewordsPerBlock:15},M:{groups:[[1,44]],totalDataCodewords:44,errorCodewordsPerBlock:26},Q:{groups:[[2,17]],totalDataCodewords:34,errorCodewordsPerBlock:18},H:{groups:[[2,13]],totalDataCodewords:26,errorCodewordsPerBlock:22}},{L:{groups:[[1,80]],totalDataCodewords:80,errorCodewordsPerBlock:20},M:{groups:[[2,32]],totalDataCodewords:64,errorCodewordsPerBlock:18},Q:{groups:[[2,24]],totalDataCodewords:48,errorCodewordsPerBlock:26},H:{groups:[[4,9]],totalDataCodewords:36,errorCodewordsPerBlock:16}},{L:{groups:[[1,108]],totalDataCodewords:108,errorCodewordsPerBlock:26},M:{groups:[[2,43]],totalDataCodewords:86,errorCodewordsPerBlock:24},Q:{groups:[[2,15],[2,16]],totalDataCodewords:62,errorCodewordsPerBlock:18},H:{groups:[[2,11],[2,12]],totalDataCodewords:46,errorCodewordsPerBlock:22}},{L:{groups:[[2,68]],totalDataCodewords:136,errorCodewordsPerBlock:18},M:{groups:[[4,27]],totalDataCodewords:108,errorCodewordsPerBlock:16},Q:{groups:[[4,19]],totalDataCodewords:76,errorCodewordsPerBlock:24},H:{groups:[[4,15]],totalDataCodewords:60,errorCodewordsPerBlock:28}},{L:{groups:[[2,78]],totalDataCodewords:156,errorCodewordsPerBlock:20},M:{groups:[[4,31]],totalDataCodewords:124,errorCodewordsPerBlock:18},Q:{groups:[[2,14],[4,15]],totalDataCodewords:88,errorCodewordsPerBlock:18},H:{groups:[[4,13],[1,14]],totalDataCodewords:66,errorCodewordsPerBlock:26}},{L:{groups:[[2,97]],totalDataCodewords:194,errorCodewordsPerBlock:24},M:{groups:[[2,38],[2,39]],totalDataCodewords:154,errorCodewordsPerBlock:22},Q:{groups:[[4,18],[2,19]],totalDataCodewords:110,errorCodewordsPerBlock:22},H:{groups:[[4,14],[2,15]],totalDataCodewords:86,errorCodewordsPerBlock:26}},{L:{groups:[[2,116]],totalDataCodewords:232,errorCodewordsPerBlock:30},M:{groups:[[3,36],[2,37]],totalDataCodewords:182,errorCodewordsPerBlock:22},Q:{groups:[[4,16],[4,17]],totalDataCodewords:132,errorCodewordsPerBlock:20},H:{groups:[[4,12],[4,13]],totalDataCodewords:100,errorCodewordsPerBlock:24}},{L:{groups:[[2,68],[2,69]],totalDataCodewords:274,errorCodewordsPerBlock:18},M:{groups:[[4,43],[1,44]],totalDataCodewords:216,errorCodewordsPerBlock:26},Q:{groups:[[6,19],[2,20]],totalDataCodewords:154,errorCodewordsPerBlock:24},H:{groups:[[6,15],[2,16]],totalDataCodewords:122,errorCodewordsPerBlock:28}},{L:{groups:[[4,81]],totalDataCodewords:324,errorCodewordsPerBlock:20},M:{groups:[[1,50],[4,51]],totalDataCodewords:254,errorCodewordsPerBlock:30},Q:{groups:[[4,22],[4,23]],totalDataCodewords:180,errorCodewordsPerBlock:28},H:{groups:[[3,12],[8,13]],totalDataCodewords:140,errorCodewordsPerBlock:24}},{L:{groups:[[2,92],[2,93]],totalDataCodewords:370,errorCodewordsPerBlock:24},M:{groups:[[6,36],[2,37]],totalDataCodewords:290,errorCodewordsPerBlock:22},Q:{groups:[[4,20],[6,21]],totalDataCodewords:206,errorCodewordsPerBlock:26},H:{groups:[[7,14],[4,15]],totalDataCodewords:158,errorCodewordsPerBlock:28}},{L:{groups:[[4,107]],totalDataCodewords:428,errorCodewordsPerBlock:26},M:{groups:[[8,37],[1,38]],totalDataCodewords:334,errorCodewordsPerBlock:22},Q:{groups:[[8,20],[4,21]],totalDataCodewords:244,errorCodewordsPerBlock:24},H:{groups:[[12,11],[4,12]],totalDataCodewords:180,errorCodewordsPerBlock:22}},{L:{groups:[[3,115],[1,116]],totalDataCodewords:461,errorCodewordsPerBlock:30},M:{groups:[[4,40],[5,41]],totalDataCodewords:365,errorCodewordsPerBlock:24},Q:{groups:[[11,16],[5,17]],totalDataCodewords:261,errorCodewordsPerBlock:20},H:{groups:[[11,12],[5,13]],totalDataCodewords:197,errorCodewordsPerBlock:24}},{L:{groups:[[5,87],[1,88]],totalDataCodewords:523,errorCodewordsPerBlock:22},M:{groups:[[5,41],[5,42]],totalDataCodewords:415,errorCodewordsPerBlock:24},Q:{groups:[[5,24],[7,25]],totalDataCodewords:295,errorCodewordsPerBlock:30},H:{groups:[[11,12],[7,13]],totalDataCodewords:223,errorCodewordsPerBlock:24}},{L:{groups:[[5,98],[1,99]],totalDataCodewords:589,errorCodewordsPerBlock:24},M:{groups:[[7,45],[3,46]],totalDataCodewords:453,errorCodewordsPerBlock:28},Q:{groups:[[15,19],[2,20]],totalDataCodewords:325,errorCodewordsPerBlock:24},H:{groups:[[3,15],[13,16]],totalDataCodewords:253,errorCodewordsPerBlock:30}},{L:{groups:[[1,107],[5,108]],totalDataCodewords:647,errorCodewordsPerBlock:28},M:{groups:[[10,46],[1,47]],totalDataCodewords:507,errorCodewordsPerBlock:28},Q:{groups:[[1,22],[15,23]],totalDataCodewords:367,errorCodewordsPerBlock:28},H:{groups:[[2,14],[17,15]],totalDataCodewords:283,errorCodewordsPerBlock:28}},{L:{groups:[[5,120],[1,121]],totalDataCodewords:721,errorCodewordsPerBlock:30},M:{groups:[[9,43],[4,44]],totalDataCodewords:563,errorCodewordsPerBlock:26},Q:{groups:[[17,22],[1,23]],totalDataCodewords:397,errorCodewordsPerBlock:28},H:{groups:[[2,14],[19,15]],totalDataCodewords:313,errorCodewordsPerBlock:28}},{L:{groups:[[3,113],[4,114]],totalDataCodewords:795,errorCodewordsPerBlock:28},M:{groups:[[3,44],[11,45]],totalDataCodewords:627,errorCodewordsPerBlock:26},Q:{groups:[[17,21],[4,22]],totalDataCodewords:445,errorCodewordsPerBlock:26},H:{groups:[[9,13],[16,14]],totalDataCodewords:341,errorCodewordsPerBlock:26}},{L:{groups:[[3,107],[5,108]],totalDataCodewords:861,errorCodewordsPerBlock:28},M:{groups:[[3,41],[13,42]],totalDataCodewords:669,errorCodewordsPerBlock:26},Q:{groups:[[15,24],[5,25]],totalDataCodewords:485,errorCodewordsPerBlock:30},H:{groups:[[15,15],[10,16]],totalDataCodewords:385,errorCodewordsPerBlock:28}},{L:{groups:[[4,116],[4,117]],totalDataCodewords:932,errorCodewordsPerBlock:28},M:{groups:[[17,42]],totalDataCodewords:714,errorCodewordsPerBlock:26},Q:{groups:[[17,22],[6,23]],totalDataCodewords:512,errorCodewordsPerBlock:28},H:{groups:[[19,16],[6,17]],totalDataCodewords:406,errorCodewordsPerBlock:30}},{L:{groups:[[2,111],[7,112]],totalDataCodewords:1006,errorCodewordsPerBlock:28},M:{groups:[[17,46]],totalDataCodewords:782,errorCodewordsPerBlock:28},Q:{groups:[[7,24],[16,25]],totalDataCodewords:568,errorCodewordsPerBlock:30},H:{groups:[[34,13]],totalDataCodewords:442,errorCodewordsPerBlock:24}},{L:{groups:[[4,121],[5,122]],totalDataCodewords:1094,errorCodewordsPerBlock:30},M:{groups:[[4,47],[14,48]],totalDataCodewords:860,errorCodewordsPerBlock:28},Q:{groups:[[11,24],[14,25]],totalDataCodewords:614,errorCodewordsPerBlock:30},H:{groups:[[16,15],[14,16]],totalDataCodewords:464,errorCodewordsPerBlock:30}},{L:{groups:[[6,117],[4,118]],totalDataCodewords:1174,errorCodewordsPerBlock:30},M:{groups:[[6,45],[14,46]],totalDataCodewords:914,errorCodewordsPerBlock:28},Q:{groups:[[11,24],[16,25]],totalDataCodewords:664,errorCodewordsPerBlock:30},H:{groups:[[30,16],[2,17]],totalDataCodewords:514,errorCodewordsPerBlock:30}},{L:{groups:[[8,106],[4,107]],totalDataCodewords:1276,errorCodewordsPerBlock:26},M:{groups:[[8,47],[13,48]],totalDataCodewords:1e3,errorCodewordsPerBlock:28},Q:{groups:[[7,24],[22,25]],totalDataCodewords:718,errorCodewordsPerBlock:30},H:{groups:[[22,15],[13,16]],totalDataCodewords:538,errorCodewordsPerBlock:30}},{L:{groups:[[10,114],[2,115]],totalDataCodewords:1370,errorCodewordsPerBlock:28},M:{groups:[[19,46],[4,47]],totalDataCodewords:1062,errorCodewordsPerBlock:28},Q:{groups:[[28,22],[6,23]],totalDataCodewords:754,errorCodewordsPerBlock:28},H:{groups:[[33,16],[4,17]],totalDataCodewords:596,errorCodewordsPerBlock:30}},{L:{groups:[[8,122],[4,123]],totalDataCodewords:1468,errorCodewordsPerBlock:30},M:{groups:[[22,45],[3,46]],totalDataCodewords:1128,errorCodewordsPerBlock:28},Q:{groups:[[8,23],[26,24]],totalDataCodewords:808,errorCodewordsPerBlock:30},H:{groups:[[12,15],[28,16]],totalDataCodewords:628,errorCodewordsPerBlock:30}},{L:{groups:[[3,117],[10,118]],totalDataCodewords:1531,errorCodewordsPerBlock:30},M:{groups:[[3,45],[23,46]],totalDataCodewords:1193,errorCodewordsPerBlock:28},Q:{groups:[[4,24],[31,25]],totalDataCodewords:871,errorCodewordsPerBlock:30},H:{groups:[[11,15],[31,16]],totalDataCodewords:661,errorCodewordsPerBlock:30}},{L:{groups:[[7,116],[7,117]],totalDataCodewords:1631,errorCodewordsPerBlock:30},M:{groups:[[21,45],[7,46]],totalDataCodewords:1267,errorCodewordsPerBlock:28},Q:{groups:[[1,23],[37,24]],totalDataCodewords:911,errorCodewordsPerBlock:30},H:{groups:[[19,15],[26,16]],totalDataCodewords:701,errorCodewordsPerBlock:30}},{L:{groups:[[5,115],[10,116]],totalDataCodewords:1735,errorCodewordsPerBlock:30},M:{groups:[[19,47],[10,48]],totalDataCodewords:1373,errorCodewordsPerBlock:28},Q:{groups:[[15,24],[25,25]],totalDataCodewords:985,errorCodewordsPerBlock:30},H:{groups:[[23,15],[25,16]],totalDataCodewords:745,errorCodewordsPerBlock:30}},{L:{groups:[[13,115],[3,116]],totalDataCodewords:1843,errorCodewordsPerBlock:30},M:{groups:[[2,46],[29,47]],totalDataCodewords:1455,errorCodewordsPerBlock:28},Q:{groups:[[42,24],[1,25]],totalDataCodewords:1033,errorCodewordsPerBlock:30},H:{groups:[[23,15],[28,16]],totalDataCodewords:793,errorCodewordsPerBlock:30}},{L:{groups:[[17,115]],totalDataCodewords:1955,errorCodewordsPerBlock:30},M:{groups:[[10,46],[23,47]],totalDataCodewords:1541,errorCodewordsPerBlock:28},Q:{groups:[[10,24],[35,25]],totalDataCodewords:1115,errorCodewordsPerBlock:30},H:{groups:[[19,15],[35,16]],totalDataCodewords:845,errorCodewordsPerBlock:30}},{L:{groups:[[17,115],[1,116]],totalDataCodewords:2071,errorCodewordsPerBlock:30},M:{groups:[[14,46],[21,47]],totalDataCodewords:1631,errorCodewordsPerBlock:28},Q:{groups:[[29,24],[19,25]],totalDataCodewords:1171,errorCodewordsPerBlock:30},H:{groups:[[11,15],[46,16]],totalDataCodewords:901,errorCodewordsPerBlock:30}},{L:{groups:[[13,115],[6,116]],totalDataCodewords:2191,errorCodewordsPerBlock:30},M:{groups:[[14,46],[23,47]],totalDataCodewords:1725,errorCodewordsPerBlock:28},Q:{groups:[[44,24],[7,25]],totalDataCodewords:1231,errorCodewordsPerBlock:30},H:{groups:[[59,16],[1,17]],totalDataCodewords:961,errorCodewordsPerBlock:30}},{L:{groups:[[12,121],[7,122]],totalDataCodewords:2306,errorCodewordsPerBlock:30},M:{groups:[[12,47],[26,48]],totalDataCodewords:1812,errorCodewordsPerBlock:28},Q:{groups:[[39,24],[14,25]],totalDataCodewords:1286,errorCodewordsPerBlock:30},H:{groups:[[22,15],[41,16]],totalDataCodewords:986,errorCodewordsPerBlock:30}},{L:{groups:[[6,121],[14,122]],totalDataCodewords:2434,errorCodewordsPerBlock:30},M:{groups:[[6,47],[34,48]],totalDataCodewords:1914,errorCodewordsPerBlock:28},Q:{groups:[[46,24],[10,25]],totalDataCodewords:1354,errorCodewordsPerBlock:30},H:{groups:[[2,15],[64,16]],totalDataCodewords:1054,errorCodewordsPerBlock:30}},{L:{groups:[[17,122],[4,123]],totalDataCodewords:2566,errorCodewordsPerBlock:30},M:{groups:[[29,46],[14,47]],totalDataCodewords:1992,errorCodewordsPerBlock:28},Q:{groups:[[49,24],[10,25]],totalDataCodewords:1426,errorCodewordsPerBlock:30},H:{groups:[[24,15],[46,16]],totalDataCodewords:1096,errorCodewordsPerBlock:30}},{L:{groups:[[4,122],[18,123]],totalDataCodewords:2702,errorCodewordsPerBlock:30},M:{groups:[[13,46],[32,47]],totalDataCodewords:2102,errorCodewordsPerBlock:28},Q:{groups:[[48,24],[14,25]],totalDataCodewords:1502,errorCodewordsPerBlock:30},H:{groups:[[42,15],[32,16]],totalDataCodewords:1142,errorCodewordsPerBlock:30}},{L:{groups:[[20,117],[4,118]],totalDataCodewords:2812,errorCodewordsPerBlock:30},M:{groups:[[40,47],[7,48]],totalDataCodewords:2216,errorCodewordsPerBlock:28},Q:{groups:[[43,24],[22,25]],totalDataCodewords:1582,errorCodewordsPerBlock:30},H:{groups:[[10,15],[67,16]],totalDataCodewords:1222,errorCodewordsPerBlock:30}},{L:{groups:[[19,118],[6,119]],totalDataCodewords:2956,errorCodewordsPerBlock:30},M:{groups:[[18,47],[31,48]],totalDataCodewords:2334,errorCodewordsPerBlock:28},Q:{groups:[[34,24],[34,25]],totalDataCodewords:1666,errorCodewordsPerBlock:30},H:{groups:[[20,15],[61,16]],totalDataCodewords:1276,errorCodewordsPerBlock:30}}];function Bw(e,t){let n=0,r=zw.length-1,i=Math.floor(zw.length/2);do e<zw[i][t].totalDataCodewords?r=i:n=i,i=n+Math.floor((r-n)/2);while(r-n>1);return e<=zw[n][t].totalDataCodewords?i+1:r+1}var Vw=class{getEncodingResult(e,t){let n=Rw(e),r=Bw(Iw(n),t);return new ww(Lw(n,r),r)}},Hw=class{constructor(e={}){this.includeBOM=e.includeBOM===void 0||e.includeBOM,this.initProperties(),this.mode=Fw[this.encodingMode]}initProperties(){yw(this,{encodingMode:`byte`,utfBOM:`111011111011101110111111`,initialModeCountStringLength:20,ranges:[128,2048,65536,2097152,67108864]})}getEncodingResult(e,t){let n=this.encode(e),r=Bw(this.getDataCodewordsCount(n),t);return new ww(this.mode.getModeCountString(n.length/8,r)+n,r)}getDataCodewordsCount(e){let t=e.length;return Math.ceil((this.initialModeCountStringLength+t)/8)}encode(e){let t=this.includeBOM?this.utfBOM:``;for(let n=0;n<e.length;n++)t+=this.encodeCharacter(e.charCodeAt(n));return t}encodeCharacter(e){let t=this.getBytesCount(e),n=t-1,r=``;if(t===1)r=xw(e,8);else{let i=8-t;for(let t=0;t<n;t++)r=xw(e>>t*6&63|128,8)+r;r=(e>>n*6|255>>i<<i).toString(2)+r}return r}getBytesCount(e){let t=this.ranges;for(let n=0;n<t.length;n++)if(e<t[n])return n+1}};let Uw={1:0},Ww={0:1},Gw={15:20,16:20,18:24,19:24,22:20,24:22,26:24,28:20,30:20,31:24,32:28,33:24,36:18,37:22,39:20,40:24},Kw=[1,0,1,1,1],qw=[1,0,1],Jw={L:`01`,M:`00`,Q:`11`,H:`10`},Yw=[`11101100`,`00010001`],Xw=[(e,t)=>(e+t)%2==0,(e,t)=>e%2==0,(e,t)=>t%3==0,(e,t)=>(e+t)%3==0,(e,t)=>(Math.floor(e/2)+Math.floor(t/3))%2==0,(e,t)=>e*t%2+e*t%3==0,(e,t)=>(e*t%2+e*t%3)%2==0,(e,t)=>((e+t)%2+e*t%3)%2==0],Zw=[[1,0],[1,25,0]];function Qw(e,t,n,r){for(let i=0;i<e.length;i++)e[i][n][r]=t}function $w(e,t,n,r){for(let i=0;i<Xw.length;i++)e[i][n][r]=Xw[i](n,r)?t^1:parseInt(t,10)}function eT(e,t){let n=new Cw(e[0]),r,i,a;for(let o=0;o<t.length;o++)for(r=t[o],i=0;r.length>0;){for(let t=0;t<r.length;t++)for(let o=0;o<8;o++)a=n.getNextCell(),$w(e,r[t][i].charAt(o),a.row,a.column);for(i++;r[0]&&i===r[0].length;)r.splice(0,1)}for(;a=n.getNextRemainderCell();)$w(e,0,a.row,a.column)}function tT(e,t){let n=t*8,r=0,i=0,a=e;for(;a.length<n&&r<4;)a+=`0000`.charAt(r++);for(a.length%8!=0&&(a+=Array(9-a.length%8).join(`0`));a.length<n;)a+=Yw[i],i^=1;return a}function nT(){let e,t;for(t=1;t<255;t++)e=Ww[t-1]*2,e>255&&(e^=285),Ww[t]=e,Uw[e]=t;e=Ww[t-1]*2^285,Ww[t]=e,Ww[-1]=0}function rT(e,t){let n=[],r=e.length-2;for(let i=r;i>=0;i--)n[i]=e[i]^t[i];return n}function iT(e,t){let n=[];for(let r=0;r<e.length;r++)for(let i=0;i<t.length;i++)n[r+i]===void 0?n[r+i]=(e[r]+(t[i]>=0?t[i]:0))%255:n[r+i]=Uw[Ww[n[r+i]]^Ww[(e[r]+t[i])%255]];return n}function aT(){for(let e=2;e<=68;e++){let t=Zw[e-1];Zw[e]=iT(t,[e,0])}}nT(),aT();function oT(e,t){let n=[],r=e.length-1;do n[r]=Ww[(e[r]+t)%255],r--;while(e[r]!==void 0);return n}function sT(e,t){let n=Zw[t-1],r=Array(t).concat(e),i=Array(r.length-n.length).concat(n),a=e.length,o=[],s,c;for(c=0;c<a;c++)s=oT(i,Uw[r[r.length-1]]),i.splice(0,1),r=rT(s,r);for(c=r.length-1;c>=0;c--)o[t-1-c]=xw(r[c],8);return o}function cT(e,t){let n=0,r=[],i=[],a,o=t.groups,s,c,l,u;for(let d=0;d<o.length;d++){c=o[d][0];for(let f=0;f<c;f++){s=o[d][1],a=[],l=[];for(let t=1;t<=s;t++)u=e.substring(n,n+8),a.push(u),l[s-t]=Sw(u),n+=8;r.push(a),i.push(sT(l,t.errorCodewordsPerBlock))}}return[r,i]}function lT(e){let t=Sw(e),n,r=``;if(t===0)return`101010000010010`;n=uT(Sw(e),`10100110111`,15);for(let e=0;e<n.length;e++)r+=n.charAt(e)^`101010000010010`.charAt(e);return r}function uT(e,t,n){let r=Sw(t),i=t.length-1,a=e<<i,o=xw(e,n-i),s=dT(a,r);return s=o+xw(s,i),s}function dT(e,t){let n=t.toString(2).length,r=e.toString(2).length,i=e;do i^=t<<r-n,r=i.toString(2).length;while(r>=n);return i}function fT(e,t){return parseInt(e.charAt(t),10)}function pT(e){let t=[],n=17+4*e;for(let e=0;e<Xw.length;e++){t[e]=Array(n);for(let r=0;r<n;r++)t[e][r]=Array(n)}return t}function mT(e,t){let n=e[0],r,i,a=0,o=t.length;for(r=0,i=8;r<=8;r++)r!==6&&Qw(e,fT(t,o-1-a++),r,i);for(r=8,i=7;i>=0;i--)i!==6&&Qw(e,fT(t,o-1-a++),r,i);for(a=0,i=n.length-1,r=8;i>=n.length-8;i--)Qw(e,fT(t,o-1-a++),r,i);for(Qw(e,1,n.length-8,8),r=n.length-7,i=8;r<n.length;r++)Qw(e,fT(t,o-1-a++),r,i)}function hT(e){return uT(e,`1111100100101`,18)}function gT(e,t){let n=e[0].length,r=n-11,i=n-11,a,o,s;for(let n=0;n<t.length;n++)a=Math.floor(n/3),o=n%3,s=fT(t,t.length-n-1),Qw(e,s,0+a,r+o),Qw(e,s,i+o,0+a)}function _T(e,t,n,r){let i=t.length+2,a=t.length+1,o;for(let s=0;s<t.length;s++)for(let c=s;c<i-s;c++)o=t[s],Qw(e,o,n+c,r+s),Qw(e,o,n+s,r+c),Qw(e,o,n+a-c,r+a-s),Qw(e,o,n+a-s,r+a-c)}function vT(e,t,n,r){let i=n,a=r,o=e[0];do Qw(e,0,i,r),Qw(e,0,n,a),i+=t[0],a+=t[1];while(i>=0&&i<o.length)}function yT(e){let t=e[0].length;_T(e,Kw,0,0),vT(e,[-1,-1],7,7),_T(e,Kw,t-7,0),vT(e,[1,-1],t-8,7),_T(e,Kw,0,t-7),vT(e,[-1,1],7,t-8)}function bT(e,t){if(t<2)return;let n=e[0],r=n.length,i=Math.floor(t/7),a=[6],o,s,c=0;for((o=Gw[t])?s=(r-13-o)/i:o=s=(r-13)/(i+1),a.push(a[c++]+o);a[c]+s<r;)a.push(a[c++]+s);for(let t=0;t<a.length;t++)for(let r=0;r<a.length;r++)n[a[t]][a[r]]===void 0&&_T(e,qw,a[t]-2,a[r]-2)}function xT(e){let t=1,n=e[0].length;for(let r=8;r<n-8;r++)Qw(e,t,6,r),Qw(e,t,r,6),t^=1}function ST(e){let t=[],n=[],r=[],i=[],a=[],o,s,c=e[0].length;for(s=0;s<e.length;s++)t[s]=0,r[s]=0,a[s]=[0,0],i[s]=[0,0],n[s]=[];for(let s=0;s<c;s++)for(let l=0;l<c;l++)for(let u=0;u<e.length;u++)o=e[u],r[u]+=parseInt(o[s][l],10),n[u][0]===o[s][l]&&s+1<c&&l-1>=0&&o[s+1][l]===n[u][0]&&o[s+1][l-1]===n[u][0]&&(t[u]+=3),CT(u,i,t,0,o[s][l]),CT(u,i,t,1,o[l][s]),wT(u,t,n,o[s][l],a,0),wT(u,t,n,o[l][s],a,1);let l=c*c,u,d=Number.MAX_VALUE;for(s=0;s<t.length;s++)t[s]+=TT(r[s],l),t[s]<d&&(d=t[s],u=s);return u}function CT(e,t,n,r,i){t[e][r]=(t[e][r]<<1^i)%128,t[e][r]===93&&(n[e]+=40)}function wT(e,t,n,r,i,a){n[e][a]===r?i[e][a]++:(n[e][a]=r,i[e][a]>=5&&(t[e]+=3+i[e][a]-5),i[e][a]=1)}function TT(e,t){let n=Math.floor(e/t*100),r=n%5,i=Math.abs(n-r-50),a=Math.abs(n+5-r-50);return 10*Math.min(i/5,a/5)}function ET(e){return e&&e.toLowerCase().indexOf(`utf_8`)>=0?new Hw({includeBOM:e.toLowerCase().indexOf(`no_bom`)<0}):new Vw}function DT(e,t,n){let r=ET(n).getEncodingResult(e,t),i=r.version,a=zw[i-1][t],o=cT(tT(r.dataString,a.totalDataCodewords),a),s=pT(i);yT(s),bT(s,i),xT(s),i>=7&&gT(s,xw(0,18)),mT(s,xw(0,15)),eT(s,o);let c=ST(s),l=s[c];i>=7&&gT([l],hT(i));let u=Jw[t]+xw(c,3);return mT([l],lT(u)),l}let OT=Math.round,kT=[[0,1],[1,1],[1,2],[2,2],[2,1],[3,1],[3,0],[2,0],[2,-1],[1,-1],[1,0]],AT=[[0,1],[1,1],[1,0]],jT={DEFAULT_SIZE:200,QUIET_ZONE_LENGTH:4,DEFAULT_ERROR_CORRECTION_LEVEL:`L`,DEFAULT_BACKGROUND:`#fff`,DEFAULT_DARK_MODULE_COLOR:`#000`,MIN_BASE_UNIT_SIZE:1,DEFAULT_LOGO_SIZE:7};J(class{constructor(e,t,n=kf){this.options=V({},this.options,t),this.element=e,this.wrapper=this.element,this.onError=n,this._initElement(),this._initSurface(),this.setOptions(t)}destroy(){this._destroySurface()}_initElement(){ce(this.element,`k-qrcode`)}_initSurface(){let{options:e,surface:t}=this;(!t||t.options.type!==e.renderAs)&&(this._destroySurface(),this._initSurfaceElement(),this.surface=this._createSurface())}_createSurface(){return vo.create(this.surfaceElement,{type:this.options.renderAs})}_destroySurface(){this.surface&&(this.surface.destroy(),this.surface=null,this._destroySurfaceElement())}_initSurfaceElement(){this.surfaceElement||(this.surfaceElement=document.createElement(`div`),this.surfaceElement.style.position=`relative`,this.element.appendChild(this.surfaceElement))}_destroySurfaceElement(){this.surfaceElement&&this.surfaceElement.parentNode&&(this.surfaceElement.parentNode.removeChild(this.surfaceElement),this.surfaceElement=null)}redraw(){let e=this._getSize();this.surface.clear(),this.surface.setSize({width:e,height:e}),this.createVisual(),this.surface.draw(this.visual)}getSize(){let e=this.element,t=e.clientWidth,n=e.clientHeight,r={width:0,height:0};return t>0&&(r.width=t),n&&(r.height=n),r}_resize(){this.redraw()}createVisual(){this.visual=this._render()}exportVisual(){return this._render()}_render(){let e=this._value,t,n=this.options.border||{},r=this.options.padding||0,i=n.width||0,a,o,s,c,l;n.width=i;let u=new P;try{e&&(o=DT(e,this.options.errorCorrection,this.options.encoding),s=this._getSize(),l=s-2*(i+r),t=this._calculateBaseUnit(l,o.length),c=o.length*t,a=i+r+(l-c)/2,u.append(this._renderBackground(s,n)),u.append(this._renderMatrix(o,t,a)),this._hasCustomLogo()?u.append(this._renderLogo(s,t)):this._isSwiss()&&u.append(this._renderSwissCode(s,t)))}catch(e){this.onError(e)}return u}_renderLogo(e,t){let n,r,i=OT(e/2),a=this._getLogoSize(t*jT.DEFAULT_LOGO_SIZE),o=this.options.overlay.imageUrl,s={x:i-a.width/2,y:i-a.height/2};return r=new j(new A(s.x,s.y),new Cn(a.width,a.height)),n=new Wr(o,r),n}_renderSwissCode(e,t){let n=this._getLogoSize(t*jT.DEFAULT_LOGO_SIZE);n=Math.max(n.width,n.height);let r=n/4,i=r/2,a=e/2,o={},s=new P;return o.x=o.y=Math.ceil(a-t-n/2),s.append(this._renderShape(o,Math.ceil(n+t*2),AT,`#fff`)),o.x=o.y=a-n/2,s.append(this._renderShape(o,n,AT,this.options.color)),o.x=a+i-n/2,o.y=a+i+r-n/2,s.append(this._renderShape(o,r,kT,`#fff`)),s}_renderShape(e,t,n,r){let i=new Vr({fill:{color:r},stroke:null});i.moveTo(e.x,e.y);for(let r=0;r<n.length;r++)i.lineTo(e.x+t*n[r][0],e.y+t*n[r][1]);return i.close(),i}_getSize(){let e;if(this.options.size)e=parseInt(this.options.size,10);else{let t=this.element,n=vw(t,this.options.renderAs),r=Math.min(n.width,n.height);e=r>0?r:jT.DEFAULT_SIZE}return e}_calculateBaseUnit(e,t){let n=Math.floor(e/t);if(n<jT.MIN_BASE_UNIT_SIZE){let n=Math.ceil(t*jT.MIN_BASE_UNIT_SIZE);this.onError(Error(`Insufficient size for QR Code: the current size is ${e}px and the minimum size is ${n}px.`))}else n*t>=e&&n-1>=jT.MIN_BASE_UNIT_SIZE&&n--;return n}_renderMatrix(e,t,n){let r=new Vr({fill:{color:this.options.color},stroke:null});for(let i=0;i<e.length;i++){let a=n+i*t,o=0;for(;o<e.length;){for(;e[i][o]===0&&o<e.length;)o++;if(o<e.length){let s=o;for(;e[i][o]===1;)o++;let c=OT(n+s*t),l=OT(a),u=OT(n+o*t),d=OT(a+t);r.moveTo(c,l).lineTo(c,d).lineTo(u,d).lineTo(u,l).close()}}}return r}_renderBackground(e,t){let n=new Z(0,0,e,e).unpad(t.width/2);return N.fromRect(n.toRect(),{fill:{color:this.options.background},stroke:{color:t.color,width:t.width}})}setOptions(e){let t=e||{};this.options=yw(this.options,t),e.value!==void 0&&(this._value=String(this.options.value)),this._initSurface(),this.redraw()}value(e){if(e===void 0)return this._value;this._value=String(e),this.redraw()}_hasCustomLogo(){return!!this.options.overlay.imageUrl}_isSwiss(){return this.options.overlay.type===`swiss`}_getLogoSize(e){let t=this.options.overlay.width,n=this.options.overlay.height;return!t&&!n?t=n=e:t&&!n?n=t:!t&&n&&(t=n),{width:t,height:n}}},{name:`QRCode`,renderAs:`svg`,encoding:`ISO_8859_1`,value:``,errorCorrection:jT.DEFAULT_ERROR_CORRECTION_LEVEL,background:jT.DEFAULT_BACKGROUND,color:jT.DEFAULT_DARK_MODULE_COLOR,size:``,padding:0,border:{color:``,width:0},overlay:{type:`image`,imageUrl:``,width:0,height:0}});let MT={WGS84:{a:6378137,b:6356752.314245179,f:.0033528106647474805,e:.08181919084262149}};function NT(e){return e*e}let PT=Math,FT=PT.abs,IT=PT.atan,LT=PT.atan2,RT=PT.cos,zT=PT.sin,BT=PT.tan;var VT=class e{constructor(e,t){this.initProperties(),arguments.length===1?(this.lat=e[0],this.lng=e[1]):(this.lat=e,this.lng=t)}initProperties(){V(this,{DISTANCE_ITERATIONS:100,DISTANCE_CONVERGENCE:1e-12,DISTANCE_PRECISION:2,FORMAT:`{0:N6}{1:N6}`})}toArray(){return[this.lat,this.lng]}equals(e){return e&&e.lat===this.lat&&e.lng===this.lng}clone(){return new e(this.lat,this.lng)}round(e){return this.lng=K(this.lng,e),this.lat=K(this.lat,e),this}wrap(){return this.lng%=180,this.lat%=90,this}distanceTo(e,t){return this.greatCircleTo(e,t).distance}destination(t,n,r){let i=of(n),a=r||MT.WGS84,o=of(this.lat),s=of(this.lng),c=t/a.a,l=PT.asin(zT(o)*RT(c)+RT(o)*zT(c)*RT(i)),u=s+LT(zT(i)*zT(c)*RT(o),RT(c)-zT(o)*zT(l));return new e(Zd(l),Zd(u))}greatCircleTo(t,n){let r=e.create(r),i=n||MT.WGS84;if(!r||this.clone().round(8).equals(r.clone().round(8)))return{distance:0,azimuthFrom:0,azimuthTo:0};let a=i.a,o=i.b,s=i.f,c=of(r.lng-this.lng),l=IT((1-s)*BT(of(this.lat))),u=zT(l),d=RT(l),f=IT((1-s)*BT(of(r.lat))),p=zT(f),m=RT(f),h=c,g,_=this.DISTANCE_ITERATIONS,v=!1,y,b,x,S,ee,C,te;for(;!v&&_-->0;){y=zT(h),b=RT(h),x=PT.sqrt(NT(m*y)+NT(d*p-u*m*b)),ee=u*p+d*m*b,te=LT(x,ee);let e=d*m*y/x;S=1-NT(e),C=0,S!==0&&(C=ee-2*u*p/S),g=h;let t=s/16*S*(4+s*(4-3*S));h=c+(1-t)*s*e*(te+t*x*(C+t*ee*(-1+2*NT(C)))),v=FT(h-g)<=this.DISTANCE_CONVERGENCE}let w=S*(NT(a)-NT(o))/NT(o),T=1+w/16384*(4096+w*(-768+w*(320-175*w))),E=w/1024*(256+w*(-128+w*(74-47*w))),D=E*x*(C+E/4*(ee*(-1+2*NT(C))-E/6*C*(-3+4*NT(x))*(-3+4*NT(C)))),ne=LT(m*y,d*p-u*m*b),re=LT(d*y,-u*m+d*p*b);return{distance:K(o*T*(te-D),this.DISTANCE_PRECISION),azimuthFrom:Zd(ne),azimuthTo:Zd(re)}}toString(){return String(this.lat)+`,`+String(this.lng)}static fromLngLat(t){return new e(t[1],t[0])}static fromLatLng(t){return new e(t[0],t[1])}static create(t,n){if(W(t))return t instanceof e?t.clone():arguments.length===1&&t.length===2?e.fromLatLng(t):new e(t,n)}};let HT=Math,UT=HT.atan,WT=HT.exp,GT=HT.pow,KT=HT.sin,qT=HT.log,JT=HT.tan,YT=A,XT=HT.PI,ZT=XT/2,QT=XT/4,$T=XT/180,eE=MT.WGS84;var tE=class{constructor(e){this.initProperties(),this._initOptions(e)}_initOptions(e){this.options=V({},this.options,e)}initProperties(){V(this,{MAX_LNG:180,MAX_LAT:85.0840590501,INVERSE_ITERATIONS:15,INVERSE_CONVERGENCE:1e-12})}forward(e,t){let n=this,r=n.options,i=r.datum.a,a=r.centralMeridian,o=G(e.lat,-n.MAX_LAT,n.MAX_LAT),s=t?G(e.lng,-n.MAX_LNG,n.MAX_LNG):e.lng,c=of(s-a)*i,l=n._projectLat(o);return new YT(c,l)}_projectLat(e){let t=this.options.datum,n=t.e,r=t.a,i=of(e),a=JT(QT+i/2),o=n*KT(i),s=GT((1-o)/(1+o),n/2);return r*qT(a*s)}inverse(e,t){let n=this,r=n.options,i=r.datum.a,a=r.centralMeridian,o=e.x/($T*i)+a,s=G(n._inverseY(e.y),-n.MAX_LAT,n.MAX_LAT);return t&&(o=G(o,-n.MAX_LNG,n.MAX_LNG)),new VT(s,o)}_inverseY(e){let t=this,n=t.options.datum,r=n.a,i=n.e,a=i/2,o=WT(-e/r),s=ZT-2*UT(o),c;for(c=0;c<=t.INVERSE_ITERATIONS;c++){let e=i*KT(s),n=GT((1-e)/(1+e),a),r=ZT-2*UT(o*n)-s;if(s+=r,HT.abs(r)<=t.INVERSE_CONVERGENCE)break}return Zd(s)}};J(tE,{centralMeridian:0,datum:eE});var nE=class extends tE{initProperties(){super.initProperties(),V(this,{MAX_LAT:85.0511287798})}_projectLat(e){let t=this.options.datum.a,n=of(e),r=JT(QT+n/2);return t*qT(r)}_inverseY(e){let t=this.options.datum.a,n=WT(-e/t);return Zd(ZT-2*UT(n))}},rE=class{constructor(){let e=this,t=e._proj=new nE,n=this.c=2*XT*t.options.datum.a;this._tm=M().translate(.5,.5).scale(1/n,-1/n),this._itm=M().scale(n,-n).translate(-.5,-.5)}toPoint(e,t,n){return this._proj.forward(e,n).transform(this._tm).scale(t||1)}toLocation(e,t,n){let r=e.clone().scale(1/(t||1)).transform(this._itm);return this._proj.inverse(r,n)}};let iE=(e,t)=>e.bind(t),aE=e=>{let t=document.createElement(`div`);return t.innerHTML=e,t.firstChild},oE=(e,t)=>{let n=document.createElement(`div`);for(n.innerHTML=e;n.childNodes.length>0;)t.appendChild(n.childNodes[0])},sE=e=>{for(;e.firstChild;)e.removeChild(e.firstChild)},cE=(e,t)=>{t.insertBefore(e,t.firstChild)},lE=(e,t)=>{for(e.appendChild(t);e.firstChild!==t;)t.appendChild(e.firstChild)},uE=e=>e.replace(/([a-z][A-Z])/g,function(e){return e.charAt(0)+`-`+e.charAt(1).toLowerCase()}),dE=e=>{let t;return t=e&&String(e).endsWith(`px`)?e:String(e)+`px`,t},fE=e=>{let{mobileOS:t}=Yf(e);return t.ios||t.android},pE=(e,t)=>{let n=e.prototype;n.events?t.forEach(e=>{n.events.indexOf(e)<0&&n.events.push(e)}):n.events=t},mE=e=>{let t=e.wheelDeltaY,n;return e.wheelDelta?(t===void 0||t)&&(n=e.wheelDelta):e.detail&&e.axis===e.VERTICAL_AXIS&&(n=-e.detail*10),n},hE=e=>{let t=[];switch(e){case`topLeft`:return`k-top-start`;case`topRight`:return`k-top-end`;case`bottomLeft`:return`k-bottom-start`;case`bottomRight`:return`k-bottom-end`;default:break}return t.join(` `)};var gE=class extends ip{constructor(e,t){super(),this.element=e,this._initOptions(t),this.items=[],ce(this.element,`k-widget k-attribution`)}_initOptions(e){this.options=V({},this.options,e)}filter(e,t){this._extent=e,this._zoom=t,this._render()}add(e){let t=e;W(e)&&(typeof e==`string`&&(t={text:e}),this.items.push(t),this._render())}remove(e){let t=[];for(let n=0;n<this.items.length;n++){let r=this.items[n];r.text!==e&&t.push(r)}this.items=t,this._render()}clear(){this.items=[],sE(this.element)}_render(){let e=[];for(let t=0;t<this.items.length;t++){let n=this.items[t],r=this._itemText(n);r!==``&&e.push(r)}if(e.length>0){sE(this.element);let t=e.join(this.options.separator);oE(t,this.element),this.showElement()}else this.hideElement()}hideElement(){this.element.style.display=`none`}showElement(){this.element.style.display=``}_itemText(e){let t=``,n=this._inZoomLevel(e.minZoom,e.maxZoom),r=this._inArea(e.extent);return n&&r&&(t+=e.text),t}_inZoomLevel(e,t){let n=!0,r=q(e,-Number.MAX_VALUE),i=q(t,Number.MAX_VALUE);return n=this._zoom>r&&this._zoom<i,n}_inArea(e){let t=!0;return e&&(t=e.contains(this._extent)),t}};J(gE,{name:`Attribution`,separator:`&nbsp;|&nbsp;`});let _E={up:{className:`k-navigator-n`,iconClass:`k-i-chevron-up`},down:{className:`k-navigator-s`,iconClass:`k-i-chevron-down`},right:{className:`k-navigator-e`,iconClass:`k-i-chevron-right`},left:{className:`k-navigator-w`,iconClass:`k-i-chevron-left`}};function vE(e,t){let n=`<button type="button" class="k-button k-button-square k-rounded-full k-button-flat k-icon-button `+_E[e].className+`" aria-label="move `+e+`">`+hf({icon:`chevron-${e}`,iconClass:`k-button-icon`,svgIcons:t.svgIcons,type:t.type})+`</button>`;return aE(n)}var yE=class extends ip{constructor(e,t){super(),this.element=e,this._initOptions(t);let n=vE(`up`,t.icons),r=vE(`right`,t.icons),i=vE(`down`,t.icons),a=vE(`left`,t.icons);this.element.appendChild(n),this.element.appendChild(r),this.element.appendChild(i),this.element.appendChild(a),ce(this.element,`k-widget k-navigator`),Hf(this.element,`click`,`.k-button`,iE(this._click,this));let o=this.element.parentNode.closest(`[data-role]`);this._keyroot=o||this.element,this._tabindex(this._keyroot),this._keydownHandler=iE(this._keydown,this),Hf(this._keyroot,`keydown`,this._keydownHandler)}destroy(){this.dispose()}dispose(){Uf(this._keyroot,`keydown`,this._keydownHandler)}_tabindex(e){let t=e||this.wrapper||this.element,n=this.element,r=`tabindex`,i=t.getAttribute(r)||n.getAttribute(r);n.removeAttribute(r),t.setAttribute(r,isNaN(i)?0:i)}_initOptions(e){this.options=V({},this.options,e)}_pan(e,t){let n=this.options.panStep;this.trigger(`pan`,{x:e*n,y:t*n})}_click(e){let t=0,n=0,r=e.currentTarget;r.matches(`.k-navigator-n`)?n=1:r.matches(`.k-navigator-s`)?n=-1:r.matches(`.k-navigator-e`)?t=1:r.matches(`.k-navigator-w`)&&(t=-1),this._pan(t,n),e.preventDefault()}_keydown(e){switch(e.which){case Af.UP:this._pan(0,1),e.preventDefault();break;case Af.DOWN:this._pan(0,-1),e.preventDefault();break;case Af.RIGHT:this._pan(1,0),e.preventDefault();break;case Af.LEFT:this._pan(-1,0),e.preventDefault();break;default:break}}};J(yE,{name:`Navigator`,panStep:1}),pE(yE,[`pan`]);function bE(e,t,n){let r=`<button type="button" class="k-button k-icon-button k-zoom-`+e+`" title="zoom-`+e+`" aria-label="zoom-`+e+`">`+hf({icon:t,iconClass:`k-button-icon`,svgIcons:n.svgIcons,type:n.type})+`</button>`;return aE(r)}let xE=`change`;var SE=class extends ip{constructor(e,t,n){super(),this.element=e,this._initOptions(t);let r=bE(`in`,`plus`,n),i=bE(`out`,`minus`,n);this.element.appendChild(r),this.element.appendChild(i),this.element.setAttribute(`role`,`group`),ce(this.element,`k-widget k-zoom-control k-button-group k-group-horizontal`),this._clickHandler=this._click.bind(this),Hf(this.element,`click`,`.k-button`,this._clickHandler);let a=this.element.parentNode.closest(`[data-role]`);this._keyroot=a||this.element,this._tabindex(this._keyroot),this._keydownHandler=this._keydown.bind(this),Hf(this._keyroot,`keydown`,this._keydownHandler)}destroy(){this.element&&Uf(this.element,`click`,this._clickHandler),this._keyroot&&Uf(this._keyroot,`keydown`,this._keydownHandler)}_tabindex(e){let t=e||this.wrapper||this.element,n=this.element,r=`tabindex`,i=t.getAttribute(r)||n.getAttribute(r);n.removeAttribute(r),t.setAttribute(r,isNaN(i)?0:i)}_initOptions(e){this.options=V({},this.options,e)}_change(e){let t=this.options.zoomStep;this.trigger(xE,{delta:e*t})}_click(e){let t=e.currentTarget,n=1;Bd(t,`k-zoom-out`)&&(n=-1),this._change(n),e.preventDefault()}_keydown(e){switch(e.which){case Af.NUMPAD_PLUS:case 187:case 61:this._change(1);break;case Af.NUMPAD_MINUS:case 189:case 173:this._change(-1);break;default:break}}};J(SE,{name:`ZoomControl`,zoomStep:1}),pE(SE,[xE]);let CE=Math,wE=CE.max,TE=CE.min;var EE=class e{constructor(e,t){let n=VT.create(e),r=VT.create(t);n.lng+180>r.lng+180&&n.lat+90<r.lat+90?(this.se=n,this.nw=r):(this.se=r,this.nw=n)}contains(e){let t=this.nw,n=this.se,r=q(e.lng,e[1]),i=q(e.lat,e[0]);return e&&r+180>=t.lng+180&&r+180<=n.lng+180&&i+90>=n.lat+90&&i+90<=t.lat+90}center(){let e=this.nw,t=this.se,n=e.lng+(t.lng-e.lng)/2;return new VT(e.lat+(t.lat-e.lat)/2,n)}containsAny(e){let t=!1;for(let n=0;n<e.length;n++)t||=this.contains(e[n]);return t}include(e){let t=this.nw,n=this.se,r=q(e.lng,e[1]),i=q(e.lat,e[0]);t.lng=TE(t.lng,r),t.lat=wE(t.lat,i),n.lng=wE(n.lng,r),n.lat=TE(n.lat,i)}includeAll(e){for(let t=0;t<e.length;t++)this.include(e[t])}edges(){let e=this.nw,t=this.se;return{nw:this.nw,ne:new VT(e.lat,t.lng),se:this.se,sw:new VT(t.lat,e.lng)}}toArray(){let e=this.nw,t=this.se;return[e,new VT(e.lat,t.lng),t,new VT(t.lat,e.lng)]}overlaps(e){return this.containsAny(e.toArray())||e.containsAny(this.toArray())}static create(t,n){if(t instanceof e)return t;if(t&&n)return new e(t,n);if(t&&t.length===4&&!n)return new e([t[0],t[1]],[t[2],t[3]])}static get World(){return new e([90,-180],[-90,180])}};let DE=`centerChange`;var OE=class{constructor(e,t){this.widgetService=e,this.options=V({},this.options,t),this.offset={x:0,y:0}}show(e,t){this.location!==t.location&&(this.anchor=e,this.location=t.location,this.widgetService.notify(`showTooltip`,Object.assign({anchor:this.anchor},t)),this.visible=!0)}hide(){this.widgetService&&this.widgetService.notify(`hideTooltip`),this.visible=!1,this.location=null}get anchor(){return this._anchor}set anchor(e){let t=this.widgetService.widget._toDocumentCoordinates({x:e.left-this.offset.x,y:e.top-this.offset.y});this._anchor={left:t.left,top:t.top}}destroy(){this.widgetService=null}};J(OE,{border:{width:1},opacity:1});var kE=class{constructor(e,t){this.support=Yf(),this._initOptions(t),this.map=e;let n=document.createElement(`div`);ce(n,`k-layer`),n.style.zIndex=this.options.zIndex,n.style.opacity=this.options.opacity,this.element=n,e.scrollElement.appendChild(this.element),this._beforeReset=this._beforeReset.bind(this),this._reset=this._reset.bind(this),this._resize=this._resize.bind(this),this._panEnd=this._panEnd.bind(this),this._activate(),this._updateAttribution()}destroy(){this._deactivate()}_initOptions(e){this.options=V({},this.options,e)}show(){this.reset(),this._activate(),this._applyExtent(!0)}hide(){this._deactivate(),this._setVisibility(!1)}reset(){this._beforeReset(),this._reset()}_reset(){this._applyExtent()}_beforeReset(){}_resize(){}_panEnd(){this._applyExtent()}_applyExtent(){let e=this.options,t=this.map.zoom(),n=!W(e.minZoom)||t>=e.minZoom,r=!W(e.maxZoom)||t<=e.maxZoom,i=EE.create(e.extent),a=!i||i.overlaps(this.map.extent());this._setVisibility(n&&r&&a)}_setVisibility(e){this.element.style.display=e?``:`none`}_activate(){let e=this.map;this._deactivate(),e.bind(`beforeReset`,this._beforeReset),e.bind(`reset`,this._reset),e.bind(`resize`,this._resize),e.bind(`panEnd`,this._panEnd)}_deactivate(){let e=this.map;e.unbind(`beforeReset`,this._beforeReset),e.unbind(`reset`,this._reset),e.unbind(`resize`,this._resize),e.unbind(`panEnd`,this._panEnd)}_updateAttribution(){let e=this.map.attribution;e&&e.add(this.options.attribution)}_readData(){return this.options.data||[]}_hasData(){return this._data&&this._data.length>0}_layerIndex(){return(this.map.layers||[]).indexOf(this)}};let AE=Math,jE=A;function ME(e){return wd(e)?e:Nd.compile(e)}function NE(e){return new jE(K(e.x),K(e.y))}function PE(e){let t=e;return typeof e!=`string`&&(t+=`px`),t}var FE=class extends kE{constructor(e,t){super(e,t),typeof this.options.subdomains==`string`&&(this.options.subdomains=this.options.subdomains.split(``));let n=this._viewType();this._view=new n(this.element,this.options)}destroy(){super.destroy(),this._view.destroy(),this._view=null}_beforeReset(){let e=this.map,t=e.locationToLayer(e.extent().nw).round();this._view.viewOrigin(t)}_reset(){super._reset(),this._updateView(),this._view.reset()}_viewType(){return IE}_activate(){super._activate(),this.support.mobileOS||(this._pan||=Ae(this._render.bind(this),100),this.map.bind(`pan`,this._pan))}_deactivate(){super._deactivate(),this._pan&&this.map.unbind(`pan`,this._pan)}_updateView(){let e=this._view,t=this.map,n=t.extent(),r={nw:t.locationToLayer(n.nw).round(),se:t.locationToLayer(n.se).round()};e.center(t.locationToLayer(t.center())),e.extent(r),e.zoom(t.zoom())}_resize(){this._render()}_panEnd(e){super._panEnd(e),this._render()}_render(){this._updateView(),this._view.render()}};J(FE,{tileSize:256,subdomains:[`a`,`b`,`c`],urlTemplate:``,zIndex:1});var IE=class{constructor(e,t){this.element=e,this._initOptions(t),this.pool=new RE}_initOptions(e){this.options=V({},this.options,e)}center(e){this._center=e}extent(e){this._extent=e}viewOrigin(e){this._viewOrigin=e}zoom(e){this._zoom=e}pointToTileIndex(e){return new jE(AE.floor(e.x/this.options.tileSize),AE.floor(e.y/this.options.tileSize))}tileCount(){let e=this.size(),t=this.pointToTileIndex(this._extent.nw),n=this._extent.nw,r=this.indexToPoint(t).translate(-n.x,-n.y);return{x:AE.ceil((AE.abs(r.x)+e.width)/this.options.tileSize),y:AE.ceil((AE.abs(r.y)+e.height)/this.options.tileSize)}}size(){let e=this._extent.nw,t=this._extent.se.clone().translate(-e.x,-e.y);return{width:t.x,height:t.y}}indexToPoint(e){let t=e.x,n=e.y;return new jE(t*this.options.tileSize,n*this.options.tileSize)}subdomainText(){let e=this.options.subdomains;return e[this.subdomainIndex++%e.length]}destroy(){sE(this.element),this.pool.empty()}reset(){this.pool.reset(),this.subdomainIndex=0,this.render()}render(){let e=this.tileCount(),t=this.pointToTileIndex(this._extent.nw),n,r,i;for(r=0;r<e.x;r++)for(i=0;i<e.y;i++)n=this.createTile({x:t.x+r,y:t.y+i}),n.visible||n.show()}createTile(e){let t=this.tileOptions(e),n=this.pool.get(this._center,t);return n.element.parentNode||this.element.append(n.element),n}tileOptions(e){let t=this.wrapIndex(e),n=this.indexToPoint(e),r=this._viewOrigin;return{index:t,currentIndex:e,point:n,offset:NE(n.clone().translate(-r.x,-r.y)),zoom:this._zoom,size:this.options.tileSize,subdomain:this.subdomainText(),urlTemplate:this.options.urlTemplate,errorUrlTemplate:this.options.errorUrlTemplate}}wrapIndex(e){let t=AE.pow(2,this._zoom);return{x:this.wrapValue(e.x,t),y:G(e.y,0,t-1)}}wrapValue(e,t){let n=AE.abs(e)%t,r=e;return r=e>=0?n:t-(n===0?t:n),r}},LE=class{constructor(e,t){this.id=e,this.visible=!0,this._initOptions(t),this.createElement(),this.show()}destroy(){let e=this.element,t=e?e.parentNode:null;e&&(t&&t.removeChild(e),this.element=null)}_initOptions(e){this.options=V({},this.options,e)}createElement(){let e=document.createElement(`img`),t=this.options.size+`px`;e.setAttribute(`alt`,``),e.style.position=`absolute`,e.style.display=`block`,e.style.width=e.style.maxWidth=t,e.style.height=e.style.maxHeight=t,this.element=e}show(){let e=this.element;e.style.top=PE(this.options.offset.y),e.style.left=PE(this.options.offset.x);let t=this.url();t&&e.setAttribute(`src`,t),e.style.visibility=`visible`,this.visible=!0}hide(){this.element.style.visibility=`hidden`,this.visible=!1}url(){return ME(this.options.urlTemplate)(this.urlOptions())}errorUrl(){return ME(this.options.errorUrlTemplate)(this.urlOptions())}urlOptions(){let e=this.options;return{zoom:e.zoom,subdomain:e.subdomain,z:e.zoom,x:e.index.x,y:e.index.y,s:e.subdomain,quadkey:e.quadkey,q:e.quadkey,culture:e.culture,c:e.culture}}};J(LE,{urlTemplate:``,errorUrlTemplate:``});var RE=class{constructor(){this._items=[]}get(e,t){return this._items.length>=this.options.maxSize&&this._remove(e),this._create(t)}empty(){let e=this._items;for(let t=0;t<e.length;t++)e[t].destroy();this._items=[]}reset(){let e=this._items;for(let t=0;t<e.length;t++)e[t].hide()}_create(e){let t=this._items,n,r=nf(e.point.toString()+e.offset.toString()+e.zoom+e.urlTemplate);for(let e=0;e<t.length;e++)if(t[e].id===r){n=t[e];break}return n?n.show():(n=new LE(r,e),this._items.push(n)),n}_remove(e){let t=this._items,n=-1,r=-1;for(let i=0;i<t.length;i++){let a=t[i].options.point.distanceTo(e);a>n&&!t[i].visible&&(r=i,n=a)}r!==-1&&(t[r].destroy(),t.splice(r,1))}};J(RE,{maxSize:100});let zE=Object.assign,BE=`change`;var VE=class extends ip{constructor(e,t){super();let n=this,r=e[0]||e;n.capture=!1,r.addEventListener?(Pf.down.split(` `).forEach(function(e){r.addEventListener(e,iE(n._press,n),!0)}),Pf.up.split(` `).forEach(function(e){r.addEventListener(e,iE(n._release,n),!0)})):(Pf.down.split(` `).forEach(function(e){r.attachEvent(e,iE(n._press,n))}),Pf.up.split(` `).forEach(function(e){r.attachEvent(e,iE(n._release,n))})),n.bind([`press`,`release`],t||{})}captureNext(){this.capture=!0}cancelCapture(){this.capture=!1}_press(e){let t=this;t.trigger(`press`),t.capture&&e.preventDefault()}_release(e){let t=this;t.trigger(`release`),t.capture&&(e.preventDefault(),t.cancelCapture())}},HE=class extends ip{constructor(e){super();let t=this;t.forcedEnabled=!1,zE(t,e),t.scale=1,t.horizontal?(t.measure=`offsetWidth`,t.scrollSize=`scrollWidth`,t.axis=`x`):(t.measure=`offsetHeight`,t.scrollSize=`scrollHeight`,t.axis=`y`)}makeVirtual(){zE(this,{virtual:!0,forcedEnabled:!0,_virtualMin:0,_virtualMax:0})}virtualSize(e,t){(this._virtualMin!==e||this._virtualMax!==t)&&(this._virtualMin=e,this._virtualMax=t,this.update())}outOfBounds(e){return e>this.max||e<this.min}forceEnabled(){this.forcedEnabled=!0}getSize(){return this.container[this.measure]}getTotal(){return this.element[this.scrollSize]}rescale(e){this.scale=e}update(e){let t=this,n=t.virtual?t._virtualMax:t.getTotal(),r=n*t.scale,i=t.getSize();n===0&&!t.forcedEnabled||(t.max=t.virtual?-t._virtualMin:0,t.size=i,t.total=r,t.min=Math.min(t.max,i-r),t.minScale=i/n,t.centerOffset=(r-i)/2,t.enabled=t.forcedEnabled||r>i,e||t.trigger(BE,t))}},UE=class extends ip{constructor(e){super();let t=this;t.x=new HE(zE({horizontal:!0},e)),t.y=new HE(zE({horizontal:!1},e)),t.container=e.container,t.forcedMinScale=e.minScale,t.maxScale=e.maxScale||100,t.bind(BE,e)}rescale(e){this.x.rescale(e),this.y.rescale(e),this.refresh()}centerCoordinates(){return{x:Math.min(0,-this.x.centerOffset),y:Math.min(0,-this.y.centerOffset)}}refresh(){let e=this;e.x.update(),e.y.update(),e.enabled=e.x.enabled||e.y.enabled,e.minScale=e.forcedMinScale||Math.min(e.x.minScale,e.y.minScale),e.fitScale=Math.max(e.x.minScale,e.y.minScale),e.trigger(BE)}},WE=class extends ip{constructor(e){super(),zE(this,e)}outOfBounds(){return this.dimension.outOfBounds(this.movable[this.axis])}dragMove(e){let t=this,n=t.dimension,r=t.axis,i=t.movable,a=i[r]+e;if(!n.enabled)return;let o=e;(a<n.min&&e<0||a>n.max&&e>0)&&(o*=t.resistance),i.translateAxis(r,o),t.trigger(BE,t)}},GE=class{constructor(e){let t=this,n,r,i,a;zE(t,{elastic:!0},e),i=t.elastic?.5:0,a=t.movable,t.x=n=new WE({axis:`x`,dimension:t.dimensions.x,resistance:i,movable:a}),t.y=r=new WE({axis:`y`,dimension:t.dimensions.y,resistance:i,movable:a}),t.userEvents.bind([`press`,`move`,`end`,`gesturestart`,`gesturechange`],{gesturestart(e){t.gesture=e,t.offset=Qd(t.dimensions.container)},press(e){let t=e.event.target.closest(`a`);t&&t.matches(`[data-navigate-on-press=true]`)&&e.sender.cancel()},gesturechange(e){let i=t.gesture,o=i.center,s=e.center,c=e.distance/i.distance,l=t.dimensions.minScale,u=t.dimensions.maxScale,d;a.scale<=l&&c<1&&(c+=(1-c)*.8),a.scale*c>=u&&(c=u/a.scale);let f=a.x+t.offset.left,p=a.y+t.offset.top;d={x:(f-o.x)*c+s.x-f,y:(p-o.y)*c+s.y-p},a.scaleWith(c),n.dragMove(d.x),r.dragMove(d.y),t.dimensions.rescale(a.scale),t.gesture=e,e.preventDefault()},move(e){e.event.target.tagName.match(/textarea|input/i)||(n.dimension.enabled||r.dimension.enabled?(n.dragMove(e.x.delta),r.dragMove(e.y.delta),e.preventDefault()):e.touch.skip())},end(e){e.preventDefault()}})}};let KE=function(e,t,n){return`translate3d(`+e+`px,`+t+`px,0) scale(`+n+`)`};var qE=class extends ip{constructor(e){super();let t=this;t.element=e,t.element.style.transformOrigin=`left top`,t.x=0,t.y=0,t.scale=1;let n=KE(t.x,t.y,t.scale);t.element.style.transform=n,t._saveCoordinates(n)}translateAxis(e,t){this[e]+=t,this.refresh()}scaleTo(e){this.scale=e,this.refresh()}scaleWith(e){this.scale*=e,this.refresh()}translate(e){this.x+=e.x,this.y+=e.y,this.refresh()}moveAxis(e,t){this[e]=t,this.refresh()}moveTo(e){zE(this,e),this.refresh()}refresh(){let e=this,t=e.x,n=e.y,r;e.round&&(t=Math.round(t),n=Math.round(n)),r=KE(t,n,e.scale),r!==e.coordinates&&(e.element.style.transform=r,e._saveCoordinates(r),e.trigger(BE))}_saveCoordinates(e){this.coordinates=e}};let JE=P;var YE=class extends kE{constructor(e,t){super(e,t),this._pan=iE(this._pan,this),this.surface=vo.create(this.element,{width:e.scrollElement.clientWidth,height:e.scrollElement.clientHeight}),this._initRoot(),this.movable=new qE(this.surface.element),this._markers=[],this._click=this._handler(`shapeClick`),this.surface.bind(`click`,this._click),this._mouseleave=this._handler(`shapeMouseLeave`),this.surface.bind(`mouseleave`,this._mouseleave),this.surface.bind(`mouseenter`,this._mouseenter.bind(this))}destroy(){super.destroy(),this.surface.destroy()}_reset(){super._reset(),this._translateSurface(),this._data=this._readData(),this._hasData()&&this._load(this._data)}_initRoot(){this._root=new JE,this.surface.draw(this._root)}_beforeReset(){this.surface.clear(),this._initRoot()}_resize(){this.surface.size(this.map.size())}_readData(){let e=super._readData();return e.type===`FeatureCollection`?e.features:e.type===`GeometryCollection`?e.geometries:e}_load(e){this._data=e,this._clearMarkers(),this._loader||=new XE(this.map,this.options.style,this);let t=new JE;for(let n=0;n<e.length;n++){let r=this._loader.parse(e[n]);r&&t.append(r)}this._root.clear(),this._root.append(t)}shapeCreated(e){let t=!1;if(e instanceof Ln&&this.map.options.renderPointsAsMarkers&&(t=W(this._createMarker(e))),!t){let n={layer:this,shape:e};t=this.map.trigger(`shapeCreated`,n)}return t}featureCreated(e){e.layer=this,this.map.trigger(`shapeFeatureCreated`,e)}_createMarker(e){let t=this.map.markers.bind({location:e.location},e.dataItem);return t&&this._markers.push(t),t}_clearMarkers(){for(let e=0;e<this._markers.length;e++)this.map.markers.remove(this._markers[e]);this._markers=[]}_pan(){this._panning||(this._panning=!0,this.surface.suspendTracking())}_panEnd(e){super._panEnd(e),this._translateSurface(),this.surface.resumeTracking(),this._panning=!1}_translateSurface(){let e=this.map,t=e.locationToView(e.extent().nw);this.surface.translate&&(this.surface.translate(t),this.movable.moveTo({x:t.x,y:t.y}))}_eventArgs(e){return{layer:this,layerIndex:this._layerIndex(),shape:e.element,shapeIndex:(this._data||[]).indexOf(e.element.dataItem),originalEvent:e.originalEvent}}_handler(e){return t=>{t.element&&this.map.trigger(e,this._eventArgs(t))}}_mouseenter(e){if(!e.element)return;this.map.trigger(`shapeMouseEnter`,this._eventArgs(e));let t=e.element,n=this._tooltipAnchor(e);this.map._tooltip.show(n,this._tooltipContext(t))}_tooltipContext(e){return{type:`shape`,layerIndex:this._layerIndex(),className:`k-map-shape-tooltip`,dataItem:e.dataItem,location:e.location}}_tooltipAnchor(e){let t=this.map.eventOffset(e.originalEvent);return{top:t.y,left:t.x}}_activate(){super._activate(),this._panHandler=iE(this._pan,this),this.map.bind(`pan`,this.panHandler)}_deactivate(){super._deactivate(),this.map.unbind(`pan`,this._panHandler)}};J(YE,{autoBind:!0,zIndex:100});var XE=class{constructor(e,t,n){this.observer=n,this.locator=e,this.style=t}parse(e){let t=new JE,n=!0;return e.type===`Feature`?(n=!1,this._loadGeometryTo(t,e.geometry,e),this._featureCreated(t,e)):this._loadGeometryTo(t,e,e),n&&t.children.length<2&&(t=t.children[0]),t}_shapeCreated(e){let t=!1;return this.observer&&this.observer.shapeCreated&&(t=this.observer.shapeCreated(e)),t}_featureCreated(e,t){this.observer&&this.observer.featureCreated&&this.observer.featureCreated({group:e,dataItem:t,properties:t.properties})}_loadGeometryTo(e,t,n){let r=t.coordinates,i,a;switch(t.type){case`LineString`:a=this._loadPolygon(e,[r],n),this._setLineFill(a);break;case`MultiLineString`:for(i=0;i<r.length;i++)a=this._loadPolygon(e,[r[i]],n),this._setLineFill(a);break;case`Polygon`:this._loadPolygon(e,r,n);break;case`MultiPolygon`:for(i=0;i<r.length;i++)this._loadPolygon(e,r[i],n);break;case`Point`:this._loadPoint(e,r,n);break;case`MultiPoint`:for(i=0;i<r.length;i++)this._loadPoint(e,r[i],n);break;default:break}}_setLineFill(e){let t=e.segments;(t.length<4||!t[0].anchor().equals(rf(t).anchor()))&&(e.options.fill=null)}_loadShape(e,t){return this._shapeCreated(t)||e.append(t),t}_loadPolygon(e,t,n){let r=this._buildPolygon(t);return r.dataItem=n,r.location=this.locator.viewToLocation(r.bbox().center()),this._loadShape(e,r)}_buildPolygon(e){let t=new(e.length>1?Vr:N)(this.style);for(let n=0;n<e.length;n++)for(let r=0;r<e[n].length;r++){let i=this.locator.locationToView(VT.fromLngLat(e[n][r]));r===0?t.moveTo(i.x,i.y):t.lineTo(i.x,i.y)}return t}_loadPoint(e,t,n){let r=VT.fromLngLat(t),i=new Ln(new An(this.locator.locationToView(r),10),this.style);return i.dataItem=n,i.location=r,this._loadShape(e,i)}},ZE=class extends YE{_readData(){return this.options.data||[]}_load(e){if(this._data=e,this.surface.clear(),e.length===0)return;let t=this.options,n=Rd(t.valueField),r=e.slice(0);r.sort(function(e,t){return n(t)-n(e)});let i=this._scaleType(),a,o=Rd(this.options.locationField);for(let e=0;e<r.length;e++){let s=r[e],c=o(s),l=n(s);if(W(c)&&W(l)){a||=new i([0,l],[t.minSize,t.maxSize]),c=VT.create(c);let e=this.map.locationToView(c),n=a.map(l),r=this._createSymbol({center:e,size:n,style:t.style,dataItem:s,location:c});r.dataItem=s,r.location=c,r.value=l,this._drawSymbol(r)}}}_scaleType(){let e=this.options.scale;return wd(e)?e:QE[e]}_createSymbol(e){let t=this.options.symbol;return wd(t)||(t=$E[t]),t(e)}_drawSymbol(e){let t={layer:this,shape:e};this.map.trigger(`shapeCreated`,t)||this.surface.draw(e)}_tooltipContext(e){return{type:`bubble`,layerIndex:this._layerIndex(),className:`k-map-bubble-tooltip`,dataItem:e.dataItem,location:e.location,value:e.value}}_tooltipAnchor(e){let t=e.element.bbox().center();return{top:t.y,left:t.x}}};J(ZE,{locationField:`location`,valueField:`value`,minSize:0,maxSize:100,scale:`sqrt`,symbol:`circle`,zIndex:200});let QE={sqrt:class{constructor(e,t){this._domain=e,this._range=t;let n=Math.sqrt(e[1])-Math.sqrt(e[0]),r=t[1]-t[0];this._ratio=r/n}map(e){let t=(Math.sqrt(e)-Math.sqrt(this._domain[0]))*this._ratio;return this._range[0]+t}}},$E={circle:function(e){return new Ln(new An(e.center,e.size/2),e.style)},square:function(e){let t=new N(e.style),n=e.size/2,r=e.center;return t.moveTo(r.x-n,r.y-n).lineTo(r.x+n,r.y-n).lineTo(r.x+n,r.y+n).lineTo(r.x-n,r.y+n).close(),t}},eD=`click`,tD=`mouseenter`,nD=`mouseleave`,rD=Object.assign,iD=`.k-marker`;var aD=class extends kE{constructor(e,t){super(e,t),this._markerClickHandler=iE(this._markerClick,this),Hf(this.element,eD,iD,this._markerClickHandler),this.items=[],this._load(this._readData())}destroy(){super.destroy(),Uf(this.element,eD,this._markerClickHandler),this.clear()}add(e){if(se(e))for(let t=0;t<e.length;t++)this._addOne(e[t]);else return this._addOne(e)}remove(e){e.destroy();let t=(this.items||[]).indexOf(e);t>-1&&this.items.splice(t,1)}clear(){for(let e=0;e<this.items.length;e++)this.items[e].destroy();this.items=[]}update(e){let t=e.location();if(t){e.showAt(this.map.locationToView(t));let n={marker:e,layer:this};this.map.trigger(`markerActivate`,n)}}_reset(){super._reset();let e=this.items;for(let t=0;t<e.length;t++)this.update(e[t])}bind(e,t){let n=oD.create(e,this.options);n.dataItem=t;let r={marker:n,layer:this};if(!this.map.trigger(`markerCreated`,r))return this.add(n),n}_addOne(e){let t=oD.create(e,this.options);return t.addTo(this),t}_readData(){return this.options.data||[]}_load(e){this._data=e,this.clear();let t=Rd(this.options.locationField),n=Rd(this.options.titleField);for(let r=0;r<e.length;r++){let i=e[r];this.bind({location:t(i),title:n(i)},i)}}_markerClick(e){let t=e.currentTarget._kendoNode,n={layer:this,layerIndex:this._layerIndex(),marker:t,markerIndex:(this.items||[]).indexOf(t),originalEvent:e};this.map.trigger(`markerClick`,n)}_markerMouseEnter(e){let t=this._createMarkerEventArgs(e);this.map.trigger(`markerMouseEnter`,t)}_markerMouseLeave(e){let t=this._createMarkerEventArgs(e);this.map.trigger(`markerMouseLeave`,t)}_createMarkerEventArgs(e){let t=e.marker;return rD({},{layer:this,layerIndex:this._layerIndex(),marker:t,markerIndex:(this.items||[]).indexOf(t)},e)}};J(aD,{zIndex:1e3,autoBind:!0,locationField:`location`,titleField:`title`,template:``});var oD=class e{constructor(e){this.options=e||{}}destroy(){this.layer=null,this.unbindEvents(),this.hide()}addTo(e){this.layer=e.markers||e,this.layer.items.push(this),this.layer.update(this)}location(e){return e?(this.options.location=VT.create(e).toArray(),this.layer&&this.layer.update(this),this):VT.create(this.options.location)}showAt(e){this.render(),this._anchor={left:Math.round(e.x),top:Math.round(e.y)},this.element.style.left=dE(this._anchor.left),this.element.style.top=dE(this._anchor.top)}hide(){this.element&&=(this.element.remove(),null)}bindEvents(){this.element&&(this._mouseEnterHandler=iE(this._mouseEnter,this),Hf(this.element,tD,iD,this._mouseEnterHandler),this._mouseLeaveHandler=iE(this._mouseLeave,this),Hf(this.element,nD,iD,this._mouseLeaveHandler))}unbindEvents(){this.element&&(Uf(this.element,tD,this._mouseEnterHandler),Uf(this.element,nD,this._mouseLeaveHandler))}render(){if(!this.element){let e=this.options,t=this.layer,n=document.createElement(`span`);if(ce(n,`k-marker`),this.options.template){let e=this._compileTemplate(this.options.template)(this.dataItem),t=aE(e);n.appendChild(t)}else if(e.svgIcon)hf(n,{icon:e.svgIcon,iconClass:`k-icon-xxl`,svgIcons:this.options.icons.svgIcons,type:`svg`});else{let t={icon:`map-marker`,iconClass:`k-icon-xxl`,svgIcons:this.options.icons.svgIcons,type:this.options.icons.type};e.shape?e.shape===`pinTarget`?(t.icon=`map-marker-target`,hf(n,t)):e.shape===`pin`?hf(n,t):ce(n,`k-icon k-icon-xxl k-i-marker-`+uE(e.shape||`pin`)):hf(n,t)}e.title&&n.setAttribute(`title`,e.title);let r=e.attributes||{};Object.keys(r).forEach(function(e){n.setAttribute(e,r[e])}),n._kendoNode=this,n.style.zIndex=e.zIndex,this.element=n,t&&t.element.appendChild(this.element),this.bindEvents()}}_mouseEnter(e){let t=this._createEventArgs(e);this.layer._markerMouseEnter(t),this.layer.map._tooltip.show({top:this._anchor.top-this.element.offsetHeight,left:this._anchor.left},this._tooltipContext())}_tooltipContext(){return{type:`marker`,layerIndex:this.layer._layerIndex(),className:`k-map-marker-tooltip`,dataItem:this.dataItem,title:this.options.title,location:this.location()}}_mouseLeave(e){let t=this._createEventArgs(e);this.layer._markerMouseLeave(t)}_createEventArgs(e){return{marker:this,originalEvent:e}}_compileTemplate(e){return Nd.compile(e,{paramName:`dataItem`,useWithBlock:!1})}static create(t,n){return t instanceof e?t:new e(V({},n,t))}};let sD=Object.assign;function cD(e){window.requestAnimationFrame(e)}var lD=class{constructor(){let e=this;e._tickProxy=iE(e._tick,e),e._started=!1}tick(){}done(){}onEnd(){}onCancel(){}start(){this.enabled()&&(this.done()?this.onEnd():(this._started=!0,cD(this._tickProxy)))}enabled(){return!0}cancel(){this._started=!1,this.onCancel()}_tick(){let e=this;e._started&&(e.tick(),e.done()?(e._started=!1,e.onEnd()):cD(e._tickProxy))}},uD=class extends lD{constructor(e){super(),sD(this,e)}done(){return this.timePassed()>=this.duration}timePassed(){return Math.min(this.duration,$f()-this.startDate)}moveTo(e){let t=this;t.initial=t.movable[t.axis],t.delta=e.location-t.initial,t.duration=typeof e.duration==`number`?e.duration:300,t.tick=t._easeProxy(e.ease),t.startDate=$f(),t.start()}_easeProxy(e){let t=this;return function(){t.movable.moveAxis(t.axis,e(t.timePassed(),t.initial,t.delta,t.duration))}}static easeOutExpo(e,t,n,r){return e===r?t+n:n*(-(2**(-10*e/r))+1)+t}};let dD=Object.assign,fD=Math.abs,pD=`change`,mD=`scroll`;var hD=class extends lD{constructor(e){super(e);let t=this;dD(t,e),t.userEvents.bind(`gestureend`,t.start.bind(this)),t.tapCapture.bind(`press`,t.cancel.bind(this))}enabled(){return this.movable.scale<this.dimensions.minScale}done(){return this.dimensions.minScale-this.movable.scale<.01}tick(){let e=this.movable;e.scaleWith(1.1),this.dimensions.rescale(e.scale)}onEnd(){let e=this.movable;e.scaleTo(this.dimensions.minScale),this.dimensions.rescale(e.scale)}},gD=class extends lD{constructor(e){super();let t=this;dD(t,e,{transition:new uD({axis:e.axis,movable:e.movable,onEnd(){t._end()}})}),t.tapCapture.bind(`press`,function(){t.cancel()}),t.userEvents.bind(`end`,iE(t.start,t)),t.userEvents.bind(`gestureend`,iE(t.start,t)),t.userEvents.bind(`tap`,iE(t.onEnd,t))}onCancel(){this.transition.cancel()}freeze(e){let t=this;t.cancel(),t._moveTo(e)}onEnd(){let e=this;e.paneAxis.outOfBounds()?e._snapBack():e._end()}done(){return fD(this.velocity)<1}start(e){let t=this,n;t.dimension.enabled&&(t.paneAxis.outOfBounds()?t.transition._started?(t.transition.cancel(),t.velocity=Math.min(e.touch[t.axis].velocity*t.velocityMultiplier,55),super.start()):t._snapBack():(n=e.touch.id===2?0:e.touch[t.axis].velocity,t.velocity=Math.max(Math.min(n*t.velocityMultiplier,55),-55),t.tapCapture.captureNext(),super.start()))}tick(){let e=this,t=e.dimension,n=e.paneAxis.outOfBounds()?.5:e.friction,r=e.velocity*=n,i=e.movable[e.axis]+r;!e.elastic&&t.outOfBounds(i)&&(i=Math.max(Math.min(i,t.max),t.min),e.velocity=0),e.movable.moveAxis(e.axis,i)}_end(){this.tapCapture.cancelCapture(),this.end()}_snapBack(){let e=this,t=e.dimension,n=e.movable[e.axis]>t.max?t.max:t.min;e._moveTo(n)}_moveTo(e){this.transition.moveTo({location:e,duration:500,ease:uD.easeOutExpo})}},_D=class extends lD{constructor(e){super(e);let t=this;dD(t,e,{origin:{},destination:{},offset:{}})}tick(){this._updateCoordinates(),this.moveTo(this.origin)}done(){return fD(this.offset.y)<5&&fD(this.offset.x)<5}onEnd(){this.moveTo(this.destination),this.callback&&this.callback.call()}setCoordinates(e,t){this.offset={},this.origin=e,this.destination=t}setCallback(e){e&&wd(e)?this.callback=e:e=void 0}_updateCoordinates(){this.offset={x:(this.destination.x-this.origin.x)/4,y:(this.destination.y-this.origin.y)/4},this.origin={y:this.origin.y+this.offset.y,x:this.origin.x+this.offset.x}}},vD=class{constructor(e){let t=this,n=e.axis===`x`,r=aE(`<div class="km-touch-scrollbar km-`+(n?`horizontal`:`vertical`)+`-scrollbar" />`);dD(t,e,{element:r,elementSize:0,movable:new qE(r),scrollMovable:e.movable,alwaysVisible:e.alwaysVisible,size:n?`width`:`height`}),t.scrollMovable.bind(pD,t.refresh.bind(t)),t.container.appendChild(r),e.alwaysVisible&&t.show()}refresh(){let e=this,t=e.axis,n=e.dimension,r=n.size,i=e.scrollMovable,a=r/n.total,o=Math.round(-i[t]*a),s=Math.round(r*a);a>=1?this.element.style.display=`none`:this.element.style.display=``,o+s>r?s=r-o:o<0&&(s+=o,o=0),e.elementSize!==s&&(e.element.style[e.size]=s+`px`,e.elementSize=s),e.movable.moveAxis(t,o)}show(){this.element.style.opacity=.7,this.element.style.visibility=`visible`}hide(){this.alwaysVisible||(this.element.style.opacity=0)}},yD=class extends ip{constructor(e,t){super();let n=this;this.element=e,this._initOptions(t);let r=fE(navigator.userAgent);n._native=n.options.useNative&&r;let i=aE(`<div class="km-scroll-header"/>`);if(n._native){ce(e,`km-native-scroller`),cE(i,e),dD(n,{scrollElement:e,fixedContainer:e.children[0]});return}e.style.overflow=`hidden`,ce(e,`km-scroll-wrapper`);let a=aE(`<div class="km-scroll-container"/>`);lE(e,a),cE(i,e);let o=e.children[1],s=new VE(e),c=new qE(o),l=new UE({element:o,container:e,forcedEnabled:n.options.zoom}),u=this.options.avoidScrolling,d=new Ep(e,{touchAction:`none`,allowSelection:!0,preventDragEvent:!0,captureUpIfMoved:!0,multiTouch:n.options.zoom,supportDoubleTap:n.options.supportDoubleTap,start(e){l.refresh();let t=fD(e.x.velocity),r=fD(e.y.velocity),i=t*2>=r,a=n.fixedContainer.contains(e.event.target),o=r*2>=t;!a&&!u(e)&&n.enabled&&(l.x.enabled&&i||l.y.enabled&&o)?d.capture():d.cancel()}}),f=new GE({movable:c,dimensions:l,userEvents:d,elastic:n.options.elastic}),p=new hD({movable:c,dimensions:l,userEvents:d,tapCapture:s}),m=new _D({moveTo(e){n.scrollTo(e.x,e.y)}});c.bind(pD,function(){n.scrollTop=-c.y,n.scrollLeft=-c.x,n.trigger(mD,{scrollTop:n.scrollTop,scrollLeft:n.scrollLeft})}),n.options.mousewheelScrolling&&(this._wheelScrollHandler=this._wheelScroll.bind(this),Hf(e,`wheel`,this._wheelScrollHandler)),dD(n,{movable:c,dimensions:l,zoomSnapBack:p,animatedScroller:m,userEvents:d,pane:f,tapCapture:s,pulled:!1,enabled:!0,scrollElement:o,scrollTop:0,scrollLeft:0,fixedContainer:e.children[0]}),n._initAxis(`x`),n._initAxis(`y`),n._wheelEnd=function(){n._wheel=!1,n.userEvents.end(0,n._wheelY)},l.refresh(),n.options.pullToRefresh&&n._initPullToRefresh()}_initOptions(e){this.options=V({},this.options,e)}_wheelScroll(e){if(e.ctrlKey)return;this._wheel||(this._wheel=!0,this._wheelY=0,this.userEvents.press(0,this._wheelY)),clearTimeout(this._wheelTimeout),this._wheelTimeout=setTimeout(this._wheelEnd,50);let t=mE(e);t&&(this._wheelY+=t,this.userEvents.move(0,this._wheelY)),e.preventDefault()}makeVirtual(){this.dimensions.y.makeVirtual()}virtualSize(e,t){this.dimensions.y.virtualSize(e,t)}height(){return this.dimensions.y.size}scrollHeight(){return this.scrollElement.scrollHeight}scrollWidth(){return this.scrollElement.scrollWidth}_resize(){this._native||this.contentResized()}setOptions(e){let t=this;this._initOptions(e),e.pullToRefresh&&t._initPullToRefresh()}reset(){this._native?this.scrollElement.scrollTop(0):(this.movable.moveTo({x:0,y:0}),this._scale(1))}contentResized(){this.dimensions.refresh(),this.pane.x.outOfBounds()&&this.movable.moveAxis(`x`,this.dimensions.x.min),this.pane.y.outOfBounds()&&this.movable.moveAxis(`y`,this.dimensions.y.min)}zoomOut(){let e=this.dimensions;e.refresh(),this._scale(e.fitScale),this.movable.moveTo(e.centerCoordinates())}enable(){this.enabled=!0}disable(){this.enabled=!1}scrollTo(e,t){this._native?(this.scrollElement.scrollLeft(fD(e)),this.scrollElement.scrollTop(fD(t))):(this.dimensions.refresh(),this.movable.moveTo({x:e,y:t}))}animatedScrollTo(e,t,n){let r,i;this._native?this.scrollTo(e,t):(r={x:this.movable.x,y:this.movable.y},i={x:e,y:t},this.animatedScroller.setCoordinates(r,i),this.animatedScroller.setCallback(n),this.animatedScroller.start())}pullHandled(){}destroy(){let e=this.element;Uf(e,`wheel`,this._wheelScrollHandler),this.userEvents&&this.userEvents.destroy()}_scale(e){this.dimensions.rescale(e),this.movable.scaleTo(e)}_initPullToRefresh(){}_dragEnd(){}_paneChange(){}_initAxis(e){let t=this,n=t.movable,r=t.dimensions[e],i=t.tapCapture,a=t.pane[e],o=new vD({axis:e,movable:n,dimension:r,container:t.element,alwaysVisible:t.options.visibleScrollHints});r.bind(pD,function(){o.refresh()}),a.bind(pD,function(){o.show()}),t[e+`inertia`]=new gD({axis:e,paneAxis:a,movable:n,tapCapture:i,userEvents:t.userEvents,dimension:r,elastic:t.options.elastic,friction:t.options.friction||.96,velocityMultiplier:t.options.velocityMultiplier||10,end(){o.hide(),t.trigger(`scrollEnd`,{axis:e,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft})}})}};J(yD,{name:`Scroller`,zoom:!1,pullOffset:140,visibleScrollHints:!1,elastic:!0,useNative:!1,mousewheelScrolling:!0,avoidScrolling(){return!1},pullToRefresh:!1,messages:{pullTemplate:`Pull to refresh`,releaseTemplate:`Release to refresh`,refreshTemplate:`Refreshing`}}),pE(yD,[`pull`,mD,`resize`]);var bD=class{constructor(e,t={}){this.sender=t.sender||e,this.widget=e,this.rtl=!!t.rtl}notify(e,t){this.widget&&this.widget.trigger(e,t)}};let xD=Math,SD=xD.min,CD=xD.pow,wD=A,TD=`marker`,ED=`location`,DD=`wheel`,OD={bubble:ZE,shape:YE,tile:FE,[TD]:aD};var kD=class extends ip{constructor(e,t={},n={},r={}){super(),this._init(e,t,n,r)}destroy(){this.scroller.destroy(),this._tooltip&&this._tooltip.destroy(),this.navigator&&this.navigator.destroy(),this.attribution&&this.attribution.destroy(),this.zoomControl&&this.zoomControl.destroy(),se(this.markers)?this.markers.forEach(e=>{e.destroy()}):this.markers.destroy();for(let e=0;e<this.layers.length;e++)this.layers[e].destroy();Uf(this.element,DD,this._mousewheelHandler),super.destroy()}_init(e,t={},n={},r={}){this.support=Yf(),this.context=r,this.initObserver(r),this.initServices(r),this._notifyObserver(`init`),this._initOptions(t),this._setEvents(t),this.crs=new rE,this._initElement(e),this._viewOrigin=this._getOrigin(),this._tooltip=this._createTooltip(),this._initScroller(),this._initMarkers(),this._initControls(),this._initLayers(),this._reset();let i=Ae(this._mousewheel.bind(this),50);this._mousewheelHandler=e=>{e.preventDefault(),i(e)},Hf(this.element,DD,this._mousewheelHandler)}_initOptions(e){this.options=V({},this.options,e)}_initElement(e){this.element=e,ce(e,`k-map`),e.style.position=`relative`,e.setAttribute(`data-role`,`map`),sE(e);let t=aE(`<div />`);this.element.appendChild(t)}initServices(e={}){this.widgetService=new bD(this,e)}initObserver(e={}){this.observers=[],this.addObserver(e.observer)}addObserver(e){e&&this.observers.push(e)}removeObserver(e){let t=this.observers.indexOf(e);t>=0&&this.observers.splice(t,1)}requiresHandlers(e){let t=this.observers;for(let n=0;n<t.length;n++)if(t[n].requiresHandlers(e))return!0}trigger(e,t={}){t.sender=this;let n=this.observers,r=!1;for(let i=0;i<n.length;i++)n[i].trigger(e,t)&&(r=!0);return r||super.trigger(e,t),r}_notifyObserver(e,t={}){t.sender=this;let n=this.observers,r=!1;for(let i=0;i<n.length;i++)n[i].trigger(e,t)&&(r=!0);return r}zoom(e){let t=this.options,n;if(W(e)){let r=xD.round(G(e,t.minZoom,t.maxZoom));t.zoom!==r&&(t.zoom=r,this.widgetService.notify(`zoomChange`,{zoom:t.zoom}),this._reset()),n=this}else n=t.zoom;return n}center(e){let t;if(e){let n=VT.create(e),r=VT.create(this.options.center);n.equals(r)||(this.options.center=n.toArray(),this.widgetService.notify(DE,{center:this.options.center}),this._reset()),t=this}else t=VT.create(this.options.center);return t}extent(e){let t;return e?(this._setExtent(e),t=this):t=this._getExtent(),t}setOptions(e={}){let t=this.element;this.destroy(),sE(t),this._init(t,e,{},this.context),this._reset()}locationToLayer(e,t){let n=!this.options.wraparound,r=VT.create(e);return this.crs.toPoint(r,this._layerSize(t),n)}layerToLocation(e,t){let n=!this.options.wraparound,r=wD.create(e);return this.crs.toLocation(r,this._layerSize(t),n)}locationToView(e){let t=VT.create(e),n=this.locationToLayer(this._viewOrigin);return this.locationToLayer(t).translateWith(n.scale(-1))}viewToLocation(e,t){let n=this.locationToLayer(this._getOrigin(),t),r=wD.create(e).clone().translateWith(n);return this.layerToLocation(r,t)}eventOffset(e){let t,n,r=Qd(this.element);if(e.x&&e.x[ED]||e.y&&e.y[ED])t=e.x[ED]-r.left,n=e.y[ED]-r.top;else{let i=e.originalEvent||e;t=q(i.pageX,i.clientX)-r.left,n=q(i.pageY,i.clientY)-r.top}return new A(t,n)}eventToView(e){let t=this.eventOffset(e);return this.locationToView(this.viewToLocation(t))}eventToLayer(e){return this.locationToLayer(this.eventToLocation(e))}eventToLocation(e){let t=this.eventOffset(e);return this.viewToLocation(t)}viewSize(){let e=this.element,t=this._layerSize(),n=e.clientWidth;return this.options.wraparound||(n=SD(t,n)),{width:n,height:SD(t,e.clientHeight)}}exportVisual(){return this._reset(),!1}hideTooltip(){this._tooltip&&this._tooltip.hide()}_setOrigin(e,t){let n=this.viewSize(),r,i=this._origin=VT.create(e);return r=this.locationToLayer(i,t),r.x+=n.width/2,r.y+=n.height/2,this.options.center=this.layerToLocation(r,t).toArray(),this.widgetService.notify(DE,{center:this.options.center}),this}_getOrigin(e){let t=this.viewSize(),n;return(e||!this._origin)&&(n=this.locationToLayer(this.center()),n.x-=t.width/2,n.y-=t.height/2,this._origin=this.layerToLocation(n)),this._origin}_setExtent(e){let t=EE.create(e),n=t.se.clone();this.options.wraparound&&n.lng<0&&e.nw.lng>0&&(n.lng=180+(180+n.lng));let r=new EE(t.nw,n);this.center(r.center());let i=this.element.clientWidth,a=this.element.clientHeight,o;for(o=this.options.maxZoom;o>=this.options.minZoom;o--){let e=this.locationToLayer(r.nw,o),t=this.locationToLayer(r.se,o),n=xD.abs(t.x-e.x),s=xD.abs(t.y-e.y);if(n<=i&&s<=a)break}this.zoom(o)}_getExtent(){let e=this._getOrigin(),t=this.locationToLayer(e),n=this.viewSize();return t.x+=n.width,t.y+=n.height,new EE(e,this.layerToLocation(t))}_zoomAround(e,t){this._setOrigin(this.layerToLocation(e,t),t),this.zoom(t)}_initControls(){let e=this.options.controls;e.attribution&&this._createAttribution(e.attribution),this.support.mobileOS||(e.navigator&&this._createNavigator(e.navigator),e.zoom&&this._createZoomControl(e.zoom))}_createControlElement(e,t){let n=e.position||t,r=`.`+hE(n).replace(` `,`.`),i=this.element.querySelector(`.k-map-controls`+r)||[];if(i.length===0){let e=document.createElement(`div`);ce(e,`k-map-controls `+hE(n)),i=e,this.element.appendChild(i)}let a=document.createElement(`div`);return i.appendChild(a),a}_createAttribution(e){let t=this._createControlElement(e,`bottomRight`);this.attribution=new gE(t,e)}_createNavigator(e){let t=this._createControlElement(e,`topLeft`),n=this.navigator=new yE(t,V({},e,{icons:this.options.icons}));this._navigatorPan=this._navigatorPan.bind(this),n.bind(`pan`,this._navigatorPan),this._navigatorCenter=this._navigatorCenter.bind(this),n.bind(`center`,this._navigatorCenter)}_navigatorPan(e){let t=this.scroller,n=t.scrollLeft+e.x,r=t.scrollTop-e.y,i=this._virtualSize,a=this.element.clientWidth,o=this.element.clientHeight;n=G(n,i.x.min,i.x.max-a),r=G(r,i.y.min,i.y.max-o),this.scroller.one(`scroll`,iE(this._scrollEnd,this)),this.scroller.scrollTo(-n,-r)}_navigatorCenter(){this.center(this.options.center)}_createZoomControl(e){let t=this._createControlElement(e,`topLeft`),n=this.zoomControl=new SE(t,e,this.options.icons);this._zoomControlChange=this._zoomControlChange.bind(this),n.bind(`change`,this._zoomControlChange)}_zoomControlChange(e){this.trigger(`zoomStart`,{originalEvent:e})||(this.zoom(this.zoom()+e.delta),this.trigger(`zoomEnd`,{originalEvent:e}))}_initScroller(){let e=this.support.mobileOS?.93:.9,t=this.options.zoomable!==!1,n=this.scroller=new yD(this.element.children[0],{friction:e,velocityMultiplier:5,zoom:t,mousewheelScrolling:!1,supportDoubleTap:!0});n.bind(`scroll`,iE(this._scroll,this)),n.bind(`scrollEnd`,iE(this._scrollEnd,this)),n.userEvents.bind(`gesturestart`,iE(this._scaleStart,this)),n.userEvents.bind(`gestureend`,iE(this._scale,this)),n.userEvents.bind(`doubleTap`,iE(this._doubleTap,this)),n.userEvents.bind(`tap`,iE(this._tap,this)),this.scrollElement=n.scrollElement}_initLayers(){let e=this.options.layers,t=this.layers=[];for(let n=0;n<e.length;n++){let r=e[n],i=this._createLayer(r);t.push(i)}}_createLayer(e){let t=e.type||`shape`,n=this.options.layerDefaults[t],r=t===TD?V({},this.options.markerDefaults,e,{icons:this.options.icons}):V({},n,e),i=OD[t],a=new i(this,r);return t===TD&&(this.markers=a),a}_createTooltip(){return new OE(this.widgetService,this.options.tooltip)}_initMarkers(){(this.options.layers||[]).filter(e=>e&&e.type===TD).length>0||(this.markers=new aD(this,V({},this.options.markerDefaults,{icons:this.options.icons})),this.markers.add(this.options.markers))}_scroll(e){let t=this.locationToLayer(this._viewOrigin).round(),n=e.sender.movable,r=new A(n.x,n.y).scale(-1).scale(1/n.scale);t.x+=r.x,t.y+=r.y,this._scrollOffset=r,this._tooltip.offset=r,this.hideTooltip(),this._setOrigin(this.layerToLocation(t)),this.trigger(`pan`,{originalEvent:e,origin:this._getOrigin(),center:this.center()})}_scrollEnd(e){!this._scrollOffset||!this._panComplete()||(this._scrollOffset=null,this._panEndTimestamp=$f(),this.trigger(`panEnd`,{originalEvent:e,origin:this._getOrigin(),center:this.center()}))}_panComplete(){return $f()-(this._panEndTimestamp||0)>50}_scaleStart(e){if(this.trigger(`zoomStart`,{originalEvent:e})){let t=e.touches[1];t&&t.cancel()}}_scale(e){let t=this.scroller.movable.scale,n=this._scaleToZoom(t),r=new A(e.center.x,e.center.y),i=this.viewToLocation(r,n),a=this.locationToLayer(i,n).translate(-r.x,-r.y);this._zoomAround(a,n),this.trigger(`zoomEnd`,{originalEvent:e})}_scaleToZoom(e){let t=this._layerSize()*e/this.options.minSize,n=xD.log(t)/xD.log(2);return xD.round(n)}_reset(){this.attribution&&this.attribution.filter(this.center(),this.zoom()),this._viewOrigin=this._getOrigin(!0),this._resetScroller(),this.hideTooltip(),this.trigger(`beforeReset`),this.trigger(`reset`)}_resetScroller(){let e=this.scroller,t=e.dimensions.x,n=e.dimensions.y,r=this._layerSize(),i=this.extent().nw,a=this.locationToLayer(i).round();e.movable.round=!0,e.reset(),e.userEvents.cancel();let o=this.zoom();e.dimensions.forcedMinScale=CD(2,this.options.minZoom-o),e.dimensions.maxScale=CD(2,this.options.maxZoom-o);let s={min:-a.x,max:r-a.x},c={min:-a.y,max:r-a.y};if(this.options.wraparound&&(s.max=20*r,s.min=-s.max),this.options.pannable===!1){let e=this.viewSize();s.min=c.min=0,s.max=e.width,c.max=e.height}t.makeVirtual(),n.makeVirtual(),t.virtualSize(s.min,s.max),n.virtualSize(c.min,c.max),this._virtualSize={x:s,y:c}}_renderLayers(){}_layerSize(e){let t=q(e,this.options.zoom);return this.options.minSize*CD(2,t)}_tap(e){if(!this._panComplete())return;let t=this.eventOffset(e);this.hideTooltip(),this.trigger(`click`,{originalEvent:e,location:this.viewToLocation(t)})}_doubleTap(e){if(this.options.zoomable!==!1&&!this.trigger(`zoomStart`,{originalEvent:e})){let t=this.zoom()+1,n=this.eventOffset(e),r=this.viewToLocation(n),i=this.locationToLayer(r,t).translate(-n.x,-n.y);this._zoomAround(i,t),this.trigger(`zoomEnd`,{originalEvent:e})}}_mousewheel(e){let t=Jd(e)>0?-1:1,n=this.options,r=this.zoom(),i=G(r+t,n.minZoom,n.maxZoom);if(n.zoomable!==!1&&i!==r&&!this.trigger(`zoomStart`,{originalEvent:e})){let t=this.eventOffset(e),n=this.viewToLocation(t),r=this.locationToLayer(n,i).translate(-t.x,-t.y);this._zoomAround(r,i),this.trigger(`zoomEnd`,{originalEvent:e})}}_toDocumentCoordinates(e){let t=Qd(this.element);return{left:K(e.x+t.left),top:K(e.y+t.top)}}};J(kD,{name:`Map`,controls:{attribution:!0,navigator:{panStep:100},zoom:!0},layers:[],layerDefaults:{shape:{style:{fill:{color:`#fff`},stroke:{color:`#aaa`,width:.5}}},bubble:{style:{fill:{color:`#fff`,opacity:.5},stroke:{color:`#aaa`,width:.5}}},marker:{shape:`pinTarget`,tooltip:{position:`top`}}},center:[0,0],icons:{type:`font`,svgIcons:{}},zoom:3,minSize:256,minZoom:1,maxZoom:19,markers:[],markerDefaults:{shape:`pinTarget`,tooltip:{position:`top`}},wraparound:!0,renderPointsAsMarkers:!1}),pE(kD,[`beforeReset`,`click`,`markerActivate`,`markerClick`,`markerCreated`,`markerMouseEnter`,`markerMouseLeave`,`pan`,`panEnd`,`reset`,`shapeClick`,`shapeCreated`,`shapeFeatureCreated`,`shapeMouseEnter`,`shapeMouseLeave`,`zoomEnd`,`zoomStart`]);let AD=(e,t)=>Math.max.apply(null,e.map(t)),jD=(e,t)=>Math.min.apply(null,e.map(t)),MD=(e,t)=>e.map(t).reduce((e,t)=>e+t,0),ND=(e,t)=>e.y0===t.y0?e.index-t.index:e.y0+e.y1-t.y0-t.y1,PD=(e,t)=>ND(e.source,t.source),FD=(e,t)=>ND(e.target,t.target),ID=e=>e.value;function LD(e){e.forEach(e=>{e.targetLinks.forEach(e=>{e.source.sourceLinks.sort(FD)}),e.sourceLinks.forEach(e=>{e.target.targetLinks.sort(PD)})})}let RD=(e,t)=>e.align===`left`?e.depth:e.align===`right`?t-e.height:e.sourceLinks.length?e.depth:t;var zD=class{constructor(e){let{offset:t={},align:n}=e.nodesOptions;this.data={nodes:e.nodes.map(e=>V({},{offset:t,align:n},e)),links:e.links.map(e=>V({},e))},this.width=e.width,this.height=e.height,this.offsetX=e.offsetX||0,this.offsetY=e.offsetY||0,this.nodeWidth=e.nodesOptions.width,this.nodePadding=e.nodesOptions.padding,this.reverse=e.reverse,this.targetColumnIndex=e.targetColumnIndex,this.loops=e.loops,this.autoLayout=e.autoLayout}calculate(){let{nodes:e,links:t}=this.data;this.connectLinksToNodes(e,t),this.calculateNodeValues(e);let n=this.calculateNodeHeights(e);if(n)return{nodes:[],links:[],columns:[],circularLinks:n};this.calculateNodeDepths(e);let r=this.calculateNodeColumns(e);return this.calculateNodeBreadths(r),this.applyNodesOffset(e),this.calculateLinkBreadths(e),Object.assign({},this.data,{columns:r})}connectLinksToNodes(e,t){let n=new Map;e.forEach((e,t)=>{e.index=t,e.sourceLinks=[],e.targetLinks=[],e.id=e.id===void 0?e.label.text:e.id,n.set(e.id,e)}),t.forEach(e=>{e.source=n.get(e.sourceId),e.target=n.get(e.targetId),e.source.sourceLinks.push(e),e.target.targetLinks.push(e)})}calculateNodeValues(e){e.forEach(e=>{e.value=Math.max(MD(e.sourceLinks,ID),MD(e.targetLinks,ID))})}calculateNodeDepths(e){let t=new Set(e),n=new Set,r=0;for(;t.size;){let e=Array.from(t);for(let t=0;t<e.length;t++){let i=e[t];i.depth=r;for(let e=0;e<i.sourceLinks.length;e++){let t=i.sourceLinks[e];n.add(t.target)}}r++,t=n,n=new Set}}calculateNodeHeights(e){let t=e.length,n=new Set(e),r=new Set,i=0,a=e=>{e.height=i,e.targetLinks.forEach(e=>{r.add(e.source)})};for(;n.size;){if(n.forEach(a),i++,i>t)return!0;n=r,r=new Set}return!1}calculateNodeColumns(e){let t=AD(e,e=>e.depth),n=(this.width-this.offsetX-this.nodeWidth)/t,r=Array(t+1);for(let i=0;i<e.length;i++){let a=e[i],o=Math.max(0,Math.min(t,RD(a,t)));a.x0=this.offsetX+o*n,a.x1=a.x0+this.nodeWidth,a.layer=o,r[o]=r[o]||[],r[o].push(a)}return r}calculateNodeBreadths(e){let t=jD(e,e=>(this.height-this.offsetY-(e.length-1)*this.nodePadding)/MD(e,ID));if(e.forEach(e=>{let n=this.offsetY;e.forEach(e=>{e.y0=n,e.y1=n+e.value*t,n=e.y1+this.nodePadding,e.sourceLinks.forEach(e=>{e.width=e.value*t})}),n=(this.height-n+this.nodePadding)/(e.length+1),e.forEach((e,t)=>{e.y0+=n*(t+1),e.y1+=n*(t+1)})}),this.autoLayout!==!1){let t=this.loops===void 0?e.length-1:this.loops,n=this.targetColumnIndex||1;for(let r=0;r<t;r++)this.reverse?(this.uncurlLinksToRight(e,n),this.uncurlLinksToLeft(e,n)):(this.uncurlLinksToLeft(e,n),this.uncurlLinksToRight(e,n))}e.forEach(LD)}applyNodesOffset(e){e.forEach(e=>{let t=(e.offset?e.offset.left:0)||0,n=(e.offset?e.offset.top:0)||0;e.x0+=t,e.x1+=t,e.y0+=n,e.y1+=n})}calculateLinkBreadths(e){e.forEach(e=>{let{sourceLinks:t,targetLinks:n}=e,r=e.y0,i=r;t.forEach(e=>{e.x0=e.source.x1,e.y0=r+e.width/2,r+=e.width}),n.forEach(e=>{e.x1=e.target.x0,e.y1=i+e.width/2,i+=e.width})})}uncurlLinksToRight(e,t){let n=e.length;for(let r=t;r<n;r++){let t=e[r];t.forEach(e=>{let t=0,n=0;e.targetLinks.forEach(r=>{let i=r.value*(e.layer-r.source.layer);t+=this.targetTopPos(r.source,e)*i,n+=i});let r=t===0?0:t/n-e.y0;e.y0+=r,e.y1+=r,LD([e])}),t.sort(ND),this.arrangeNodesVertically(t)}}uncurlLinksToLeft(e,t){let n=e.length-1-t;for(let t=n;t>=0;t--){let n=e[t];for(let e=0;e<n.length;e++){let t=n[e],r=0,i=0;t.sourceLinks.forEach(e=>{let n=e.value*(e.target.layer-t.layer);r+=this.sourceTopPos(t,e.target)*n,i+=n});let a=r===0?0:r/i-t.y0;t.y0+=a,t.y1+=a,LD([t])}n.sort(ND),this.arrangeNodesVertically(n)}}arrangeNodesVertically(e){let t=e.length-1;this.arrangeUp(e,this.height,t),this.arrangeDown(e,this.offsetY,0)}arrangeDown(e,t,n){let r=t;for(let t=n;t<e.length;t++){let n=e[t],i=Math.max(0,r-n.y0);n.y0+=i,n.y1+=i,r=n.y1+this.nodePadding}}arrangeUp(e,t,n){let r=t;for(let t=n;t>=0;--t){let n=e[t],i=Math.max(0,n.y1-r);n.y0-=i,n.y1-=i,r=n.y0-this.nodePadding}}sourceTopPos(e,t){let n=t.y0-(t.targetLinks.length-1)*this.nodePadding/2;for(let r=0;r<t.targetLinks.length;r++){let i=t.targetLinks[r];if(i.source===e)break;n+=i.width+this.nodePadding}for(let r=0;r<e.sourceLinks.length;r++){let i=e.sourceLinks[r];if(i.target===t)break;n-=i.width}return n}targetTopPos(e,t){let n=e.y0-(e.sourceLinks.length-1)*this.nodePadding/2;for(let r=0;r<e.sourceLinks.length;r++){let i=e.sourceLinks[r];if(i.target===t)break;n+=i.width+this.nodePadding}for(let r=0;r<t.targetLinks.length;r++){let i=t.targetLinks[r];if(i.source===e)break;n-=i.width}return n}};let BD=e=>new zD(e).calculate(),VD=e=>{let t=0,n=e.length;for(let r=0;r<n;r++){let i=e[r];for(let a=r+1;a<n;a++){let n=e[a];UD(i,n)&&(t+=Math.min(i.value,n.value))}}return t};function HD(e,t,n,r,i,a){let o=(a-t)*(n-e),s=(r-t)*(i-e);return o>s?1:o===s?0:-1}function UD(e,t){let n=HD(e.x0,e.y0,e.x1,e.y1,t.x1,t.y1),r=HD(e.x0,e.y0,e.x1,e.y1,t.x0,t.y0),i=HD(e.x0,e.y0,t.x0,t.y0,t.x1,t.y1),a=HD(e.x1,e.y1,t.x0,t.y0,t.x1,t.y1);return n!==r&&i!==a}var WD=class{constructor(e){this.options=V({},this.options,e),this.createVisual()}createVisual(){this.visual=this.createElement()}exportVisual(){return this.visual}createElement(){let e=this.options.visual,t;return t=e?e({sender:this.getSender(),options:this.visualOptions(),createVisual:()=>this.getElement()}):this.getElement(),t}getSender(){return this}},GD=class extends WD{getElement(){return N.fromRect(this.getRect(),this.visualOptions())}getRect(){let e=this.options.node;return new j([e.x0,e.y0],[e.x1-e.x0,e.y1-e.y0])}getLabelText(e){let t=e.labels.ariaTemplate;if(t)return t({node:e.node})}visualOptions(){let e=V({},this.options,this.options.node),t=this.getLabelText(e);return{fill:{color:e.color,opacity:e.opacity},stroke:{width:0},className:`k-sankey-node`,role:`graphics-symbol`,ariaRoleDescription:`Node`,ariaLabel:t}}createFocusHighlight(){if(this.options.navigatable)return this._highlight=N.fromRect(this.getRect(),{stroke:this.options.focusHighlight.border,visible:!1}),this._highlight}focus(e){if(this._highlight){let{highlight:t=!0}=e||{};t&&this._highlight.options.set(`visible`,!0);let n=this.options.node.id;this.visual.options.set(`id`,n),this.options.root()&&this.options.root().setAttribute(v,n)}}blur(){this._highlight&&(this._highlight.options.set(`visible`,!1),this.visual.options.set(`id`,``),this.options.root()&&this.options.root().removeAttribute(v))}};let KD=(e,t,n)=>e.color||t[n%t.length],qD=(e,t,n,r)=>{let i=V({},t,t.node);return V({},{color:KD(e,n,r)},i,{node:e},{visual:e.visual,opacity:e.opacity,offset:e.offset,color:e.color})},JD=(e,t,n,r,i)=>{let a=1-i,o=a*a,s=i*i;return e*o*a+3*t*i*o+3*n*s*a+r*s*i};function YD(e,t,n,r,i){let a=(e+n)/2,o=(t+r)/2,s,c;if(t===r)s=0,c=i/2;else if(e===n)s=i/2,c=0;else{let a=-1/((r-t)/(n-e));s=i/2/Math.sqrt(1+a*a),c=a*s}return{P1:{x:a-s,y:o-c},P2:{x:a+s,y:o+c}}}function XD(e,t,n,r,i){let a={x:(e.x+t.x)/2,y:(e.y+t.y)/2},o=t.x-e.x,s=-(t.y-e.y),c=o,l=Math.sqrt(s*s+c*c);s=s/l*n,c=c/l*n;let u={x:a.x+s,y:a.y+c},d={x:a.x-s,y:a.y-c},f=i.x-r.x,p=i.y-r.y,m=p*(u.x-d.x)-f*(u.y-d.y);if(Math.abs(m)<1e-10)return null;let h=(f*(d.y-r.y)-p*(d.x-r.x))/m,g=((u.x-d.x)*(d.y-r.y)-(u.y-d.y)*(d.x-r.x))/m;return h>=0&&h<=1&&g>=0&&g<=1?{x:d.x+h*(u.x-d.x)}:null}let ZD=(e,t)=>{let n=e.width/2,r=t?e.x1:e.x0,i=t?e.x0:e.x1,a=t?e.y1:e.y0,o=t?e.y0:e.y1,s=(r+i)/2,c=[s,JD(a,a,o,o,.5)],l=.4999,u=[JD(r,s,s,i,l),JD(a,a,o,o,l)],d=YD(c[0],c[1],u[0],u[1],e.width),f=[s,JD(a+n,a+n,o+n,o+n,.5)],p=d.P1.y>d.P2.y?d.P1:d.P2,m=n,h=(a>o?1:-1)*m,g=XD(p,{x:f[0],y:f[1]},m,{x:f[0],y:f[1]},{x:Math.max(1,f[0]+h),y:f[1]})||{x:(f[0]+p.x)/2},_=r,v=i;return s-(g.x-.125*_-.125*v)/.75};var QD=class extends WD{getElement(){let{x0:e,x1:t,y0:n,y1:r}=this.options.link,i=(e+t)/2;return new N(this.visualOptions()).moveTo(e,n).curveTo([i,n],[i,r],[t,r])}getLabelText(e){let t=e.labels.ariaTemplate;if(t)return t({link:e.link})}visualOptions(){let e=this.options,t=this.options.link,n=this.getLabelText(e);return{stroke:{width:e.link.width,color:t.color||e.color,opacity:W(t.opacity)?t.opacity:e.opacity},role:`graphics-symbol`,ariaRoleDescription:`Link`,ariaLabel:n}}createFocusHighlight(){if(!this.options.navigatable)return;let{link:e}=this.options,{x0:t,x1:n,y0:r,y1:i}=e,a=(t+n)/2,o=e.width/2,s=ZD(e,this.options.rtl);this._highlight=new N({stroke:this.options.focusHighlight.border,visible:!1}).moveTo(t,r+o).lineTo(t,r-o).curveTo([a+s,r-o],[a+s,i-o],[n,i-o]).lineTo(n,i+o).curveTo([a-s,i+o],[a-s,r+o],[t,r+o])}focus(e){if(this._highlight){let{highlight:t=!0}=e||{};t&&this._highlight.options.set(`visible`,!0);let n=`${this.options.link.sourceId}->${this.options.link.targetId}`;this.visual.options.set(`id`,n),this.options.root()&&this.options.root().setAttribute(v,n)}}blur(){this._highlight&&(this._highlight.options.set(`visible`,!1),this.visual.options.set(`id`,``),this.options.root()&&this.options.root().removeAttribute(v))}};let $D=(e,t,n,r)=>{let i=V({},t,{link:e,opacity:e.opacity,color:e.color,colorType:e.colorType,visual:e.visual,highlight:e.highlight});return i.colorType===`source`?i.color=n.options.fill.color:i.colorType===`target`&&(i.color=r.options.fill.color),i},eO=`inside`,tO=`before`,nO=`after`;var rO=class extends WD{getElement(){let e=V({},this.options,this.options.node.label),{node:t,diagramMinX:n,diagramMaxX:r,text:i,offset:a,rtl:o}=e,s=e.position;if(o&&s!==eO&&(s=s===tO?nO:tO),!e.visible||!i)return null;let c=new Z(t.x0,t.y0,t.x1,t.y1),l=this.visualOptions();o&&!l.align&&(l.align=`right`);let u=new om(i,l);u.reflow(new Z);let d=u.box,f=c.center().y-d.height()/2,p=t.x1+d.width()>r,m=t.x0-d.width()<n,h=s===tO||s===eO&&p?tO:nO;o&&(h=s===nO||s===eO&&m?nO:tO);let g=[h===tO?t.x0-d.width():t.x1,f],_=new Z(g[0],g[1],g[0]+d.width(),g[1]+d.height());return _.translate(a.left||0,a.top||0),u.reflow(_),u.renderVisual(),u.visual}visualOptions(){let e=V({},this.options,this.options.node.label);return{color:e.color,font:e.font,border:e.border,margin:e.margin,padding:e.padding,align:e.align,paintOrder:e.paintOrder,stroke:e.stroke}}};J(rO,{position:eO});let iO=(e,t,n,r,i)=>V({},t,{node:e,diagramMinX:r,diagramMaxX:i,rtl:n,visual:e.label.visual,visible:e.label.visible,margin:e.label.margin,padding:e.label.padding,border:e.label.border,align:e.label.align,offset:e.label.offset});var aO=class extends WD{getElement(){let e=this.options,{drawingRect:t,text:n}=e;if(e.visible===!1||!n)return null;let r=sm.buildTitle(n,e);return r.reflow(t),r.renderVisual(),r.visual}createElement(){return this.getElement()}};J(aO,{align:x,border:{width:0},margin:H(5),padding:H(5)});let oO=(e,t)=>e.node.x0-t.node.x0===0?e.node.y0-t.node.y0:e.node.x0-t.node.x0,sO=(e,t)=>e.node.x1-t.node.x1===0?t.node.y0-e.node.y0:e.node.x1-t.node.x1,cO=e=>e?sO:oO;var lO=class extends WD{getElement(){let e=this.options,{drawingRect:t,rtl:n,nodes:r=[],item:i,position:a}=e;if(e.visible===!1||!r.length)return null;let o=e.labels||{},s;o.content&&(s=Pd(o));let c=r.map(e=>{let t=e.label&&e.label.text||``;return{text:s?s({text:t,node:e}):t,area:{background:i.areaBackground===void 0?e.color:i.areaBackground,opacity:i.areaOpacity===void 0?e.opacity:i.areaOpacity},node:e}});c.sort(cO(n));let l=new cb(Object.assign({},e,{data:c,reverse:n&&a!==`left`&&a!==`right`}),{rtl:n});return l.reflow(t),l.renderVisual(),l.visual}createElement(){return this.getElement()}};J(lO,{markers:{visible:!1},item:{type:cg,cursor:oe,opacity:1},position:b,align:x,accessibility:{role:`presentation`,ariaLabel:null,ariaRoleDescription:null},border:{width:0}});let uO=`link`,dO=`node`,fO=e=>{let{nodes:t,links:n}=e,r=Math.min(...t.map(e=>e.x0)),i=Math.max(...t.map(e=>e.x1))-r;t.forEach(e=>{let t=i-(e.x1-2*r),n=i-(e.x0-2*r);e.x0=t,e.x1=n}),n.forEach(e=>{let t=i-(e.x1-2*r),n=i-(e.x0-2*r);e.x1=t,e.x0=n})};var pO=class extends ip{constructor(e,t,n){super(),this._initTheme(n),this._setOptions(t),this._initElement(e),this._initSurface(),t&&t.data&&(this._redraw(),this._initResizeObserver(),this._initNavigation(e))}destroy(){this.unbind(),this._destroySurface(),this._destroyResizeObserver(),this.element&&(this.element.removeEventListener(`keydown`,this._keydownHandler),this.element.removeEventListener(`focus`,this._focusHandler),this.element.removeEventListener(`mousedown`,this._onDownHandler),this.element.removeEventListener(`touchstart`,this._onDownHandler),this.element.removeEventListener(`pointerdown`,this._onDownHandler)),this._focusState=null,this.element=null}_initElement(e){this.element=e,ce(e,[`k-chart`,`k-sankey`]),e.setAttribute(`role`,`graphics-document`);let{title:t}=this.options;t.text&&e.setAttribute(`aria-label`,t.text),t.description&&e.setAttribute(`aria-roledescription`,t.description)}_initSurface(){this.surface||=(this._destroySurface(),this._initSurfaceElement(),this._createSurface())}_initNavigation(e){e.tabIndex=e.getAttribute(`tabindex`)||0,!this.options.disableKeyboardNavigation&&(this._keydownHandler=this._keydown.bind(this),this._focusHandler=this._focus.bind(this),this._blurHandler=this._blur.bind(this),this._onDownHandler=this._onDown.bind(this),e.addEventListener(`keydown`,this._keydownHandler),e.addEventListener(`focus`,this._focusHandler),e.addEventListener(`blur`,this._blurHandler),e.addEventListener(`mousedown`,this._onDownHandler),e.addEventListener(`touchstart`,this._onDownHandler),e.addEventListener(`pointerdown`,this._onDownHandler),this._focusState={node:this.firstFocusableNode(),link:null})}firstFocusableNode(){return this.columns[0][0]}_initResizeObserver(){let e=new ResizeObserver(e=>{e.forEach(e=>{let{width:t,height:n}=e.contentRect;e.target!==this.element||this.size&&this.size.width===t&&this.size.height===n||(this.size={width:t,height:n},this.surface.setSize(this.size),this.resize=!0,this._redraw())})});this._resizeObserver=e,e.observe(this.element)}_createSurface(){return vo.create(this.surfaceElement,{mouseenter:this._mouseenter.bind(this),mouseleave:this._mouseleave.bind(this),mousemove:this._mousemove.bind(this),click:this._click.bind(this)})}_initTheme(e){let t=e||this.theme||{};this.theme=t,this.options=V({},t,this.options)}setLinksOpacity(e){this.linksVisuals.forEach(t=>{this.setOpacity(t,e,t.linkOptions.opacity)})}setLinksInactivityOpacity(e){this.linksVisuals.forEach(t=>{this.setOpacity(t,e,t.linkOptions.highlight.inactiveOpacity)})}setOpacity(e,t,n){e.options.set(`stroke`,Object.assign({},e.options.stroke,{opacity:W(n)?n:t}))}trigger(e,t){let n=t.element.dataItem,r=t.element.type,i=Object.assign({},t,{type:e,targetType:r,dataItem:n});return super.trigger(e,i)}_mouseenter(e){let t=e.element,n=t.type===uO,r=t.type===dO,i=!!(t.chartElement&&t.chartElement.options.node);if(n&&this.trigger(`linkEnter`,e)||r&&this.trigger(`nodeEnter`,e))return;let{highlight:a}=this.options.links;if(n)this.setLinksInactivityOpacity(a.inactiveOpacity),this.setOpacity(t,a.opacity,t.linkOptions.highlight.opacity);else if(r)this.highlightLinks(t,a);else if(i){let e=this.nodesVisuals.get(t.chartElement.options.node.id);this.highlightLinks(e,a)}}_mouseleave(e){let t=e.element,n=t.type===uO,r=t.type===dO,i=!!(t.chartElement&&t.chartElement.options.node),a=e.originalEvent.relatedTarget;n&&a&&a.nodeName===`text`||((n||r)&&(this.tooltipTimeOut&&=(clearTimeout(this.tooltipTimeOut),null),this.tooltipShown=!1,this.trigger(`tooltipHide`,e)),!(n&&this.trigger(`linkLeave`,e)||r&&this.trigger(`nodeLeave`,e))&&(n||r||i)&&this.linksVisuals.forEach(e=>{this.setOpacity(e,this.options.links.opacity,e.linkOptions.opacity)}))}_mousemove(e){let{followPointer:t,delay:n}=this.options.tooltip,r=e.element,i=r.type;if(i!==uO&&i!==dO||this.tooltipShown&&!t)return;let a=e.originalEvent,o=this.element.getBoundingClientRect(),s=a.clientX-o.left<o.width/2,c=a.clientY-o.top<o.height/2;if(e.tooltipData={popupOffset:{left:a.pageX,top:a.pageY},popupAlign:{horizontal:s?`left`:`right`,vertical:c?`top`:`bottom`}},i===dO){let{sourceLinks:t,targetLinks:n}=r.dataItem;e.nodeValue=(n.length?n:t).reduce((e,t)=>e+t.value,0)}this.tooltipTimeOut&&=(clearTimeout(this.tooltipTimeOut),null);let l=t&&this.tooltipShown?0:n;this.tooltipTimeOut=setTimeout(()=>{this.trigger(`tooltipShow`,e),this.tooltipShown=!0,this.tooltipTimeOut=null},l)}_click(e){let t=e.element,n=t.dataItem,r=t.type===uO,i=t.type===dO,a=this._focusState||{};if(i)!a.link&&this.sameNode(a.node,n)||(this._focusState={node:n,link:null},this._focusNode({highlight:!1})),this.trigger(`nodeClick`,e);else if(r){let t={sourceId:n.source.id,targetId:n.target.id,value:n.value};this.sameLink(a.link,t)||(this._focusState={node:n.source,link:t},this._focusLink({highlight:!1})),this.trigger(`linkClick`,e)}}sameNode(e,t){return e&&t&&e.id===t.id}sameLink(e,t){return e&&t&&e.sourceId===t.sourceId&&e.targetId===t.targetId}_focusNode(e){this._cleanFocusHighlight();let t=this._focusState.node;this.models.map.get(t.id).focus(e)}_focusLink(e){this._cleanFocusHighlight();let t=this._focusState.link;this.models.map.get(`${t.sourceId}-${t.targetId}`).focus(e)}_focusNextNode(e=1){let t=this._focusState.node,n=this.columns.findIndex(e=>e.find(e=>e.id===t.id)),r=this.columns[n],i=r[r.findIndex(e=>e.id===t.id)+e];i&&(this._focusState.node=i,this._focusNode())}_focusNextLink(e=1){let t=this._focusState.node,n=this._focusState.link,r=t.sourceLinks.findIndex(e=>e.sourceId===n.sourceId&&e.targetId===n.targetId),i=t.targetLinks.findIndex(e=>e.sourceId===n.sourceId&&e.targetId===n.targetId);if(r!==-1){let n=t.sourceLinks[r+e];n&&(this._focusState.link=n,this._focusLink())}else if(i!==-1){let n=t.targetLinks[i+e];n&&(this._focusState.link=n,this._focusLink())}}_focusSourceNode(){let e=this._focusState.link,t=this.models.map.get(e.sourceId);this._focusState={node:t.options.node,link:null},this._focusNode()}_focusTargetNode(){let e=this._focusState.link,t=this.models.map.get(e.targetId);this._focusState={node:t.options.node,link:null},this._focusNode()}_focusSourceLink(){let e=this._focusState.node.sourceLinks[0];e&&(this._focusState.link=e,this._focusLink())}_focusTargetLink(){let e=this._focusState.node.targetLinks[0];e&&(this._focusState.link=e,this._focusLink())}_focus(){this._skipFocusHighlight||(this._focusState.link?this._focusLink():this._focusNode()),this._skipFocusHighlight=!1}_blur(){this._cleanFocusHighlight()}_onDown(){this._hasFocus()||(this._skipFocusHighlight=!0)}_hasFocus(){return this.element.ownerDocument.activeElement===this.element}_cleanFocusHighlight(){this.models.nodes.forEach(e=>e.blur()),this.models.links.forEach(e=>e.blur())}_keydown(e){let t=this[`on`+e.key],n=this.options.rtl;n&&e.key===`ArrowLeft`?t=this.onArrowRight:n&&e.key===`ArrowRight`&&(t=this.onArrowLeft),t&&t.call(this,e)}onEscape(e){e.preventDefault(),this._focusState={node:this.firstFocusableNode(),link:null},this._focusNode()}onArrowDown(e){e.preventDefault(),this._focusState.link?this._focusNextLink(1):this._focusNextNode(1)}onArrowUp(e){e.preventDefault(),this._focusState.link?this._focusNextLink(-1):this._focusNextNode(-1)}onArrowLeft(e){e.preventDefault(),this._focusState.link?this._focusSourceNode():this._focusTargetLink()}onArrowRight(e){e.preventDefault(),this._focusState.link?this._focusTargetNode():this._focusSourceLink()}highlightLinks(e,t){e&&(this.setLinksInactivityOpacity(t.inactiveOpacity),e.links.forEach(e=>{this.setOpacity(e,t.opacity,e.linkOptions.highlight.opacity)}))}_destroySurface(){this.surface&&(this.surface.destroy(),this.surface=null,this._destroySurfaceElement())}_destroyResizeObserver(){this._resizeObserver&&=(this._resizeObserver.disconnect(),null)}_initSurfaceElement(){this.surfaceElement||(this.surfaceElement=document.createElement(`div`),this.element.appendChild(this.surfaceElement))}_destroySurfaceElement(){this.surfaceElement&&this.surfaceElement.parentNode&&(this.surfaceElement.parentNode.removeChild(this.surfaceElement),this.surfaceElement=null)}setOptions(e,t){this._setOptions(e),this._initTheme(t),this._initSurface(),this._redraw()}_redraw(){this.surface.clear();let{width:e,height:t}=this._getSize();this.size={width:e,height:t},this.surface.setSize(this.size),this.createVisual(),this.surface.draw(this.visual)}_getSize(){return this.element.getBoundingClientRect()}createVisual(){this.visual=this._render()}titleBox(e,t){return!e||e.visible===!1||!e.text?null:new aO(Object.assign({},{drawingRect:t},e)).exportVisual().chartElement.box}legendBox(e,t,n){return!e||e.visible===!1?null:new lO(Object.assign({},{nodes:t},e,{drawingRect:n})).exportVisual().chartElement.box}calculateSankey(e,t){let{title:n,legend:r,data:i,nodes:a,labels:o,nodeColors:s,disableAutoLayout:c,disableKeyboardNavigation:l,rtl:u}=t,d=!c,f=((a.focusHighlight||{}).border||{}).width||0,p=l?0:f/2,m=new Z(0,0,e.width,e.height);m.unpad(p);let h=this.titleBox(n,m),g=m.clone();if(h){let t=h.height();n.position===`top`?(m.unpad({top:t}),g=new Z(0,t,e.width,e.height)):(m.shrink(0,t),g=new Z(0,0,e.width,e.height-t))}let _=this.legendBox(r,i.nodes,g),v=r&&r.position||lO.prototype.options.position;_&&(v===`left`&&m.unpad({left:_.width()}),v===`right`&&m.shrink(_.width(),0),v===`top`&&m.unpad({top:_.height()}),v===`bottom`&&m.shrink(0,_.height()));let{nodes:y,circularLinks:b}=BD(Object.assign({},e,{offsetX:0,offsetY:0,width:m.width(),height:m.height()}));if(b)return console.warn(`Circular links detected. Kendo Sankey diagram does not support circular links.`),{sankey:{nodes:[],links:[],columns:[[]],circularLinks:b},legendBox:_,titleBox:h};let x=new Z,S=y.reduce((e,t)=>Math.min(e,t.x0),1/0),ee=y.reduce((e,t)=>Math.max(e,t.x1),0);y.forEach((e,t)=>{if(u){let{x0:t,x1:n}=e;e.x0=ee-n,e.x1=ee-t}let n=new GD(qD(e,a,s,t));x.wrap(im(n.exportVisual().rawBBox()));let r=new rO(iO(e,o,u,S,ee)).exportVisual();r&&x.wrap(im(r.rawBBox()))});let C=m.x1,te=m.y1,w=m.width()+C,T=m.height()+te;if(w-=x.x2>m.width()?x.x2-m.width():0,T-=x.y2>m.height()?x.y2-m.height():0,C+=x.x1<0?-x.x1:0,te+=x.y1<0?-x.y1:0,d===!1)return{sankey:BD(Object.assign({},e,{offsetX:C,offsetY:te,width:w,height:T,autoLayout:!1})),legendBox:_,titleBox:h};if(this.resize&&d&&this.permutation)return this.resize=!1,{sankey:BD(Object.assign({},e,{offsetX:C,offsetY:te,width:w,height:T},this.permutation)),legendBox:_,titleBox:h};let E=BD(Object.assign({},e,{offsetX:C,offsetY:te,width:w,height:T,autoLayout:!1})).columns.length,D=[],ne=(t,n)=>{let r=BD(Object.assign({},e,{offsetX:C,offsetY:te,width:w,height:T,loops:2,targetColumnIndex:t,reverse:n})),i=VD(r.links);return D.push({crosses:i,reverse:n,targetColumnIndex:t}),i===0};for(let e=1;e<=E-1&&!(ne(e,!1)||ne(e,!0));e++);let re=Math.min.apply(null,D.map(e=>e.crosses)),O=D.find(e=>e.crosses===re);return this.permutation={targetColumnIndex:O.targetColumnIndex,reverse:O.reverse},{sankey:BD(Object.assign({},e,{offsetX:C,offsetY:te,width:w,height:T},this.permutation)),legendBox:_,titleBox:h}}_render(e,t){let n=e||this.options,r=t||this,{labels:i,nodes:a,links:o,nodeColors:s,title:c,legend:l,rtl:u,disableKeyboardNavigation:d}=n,f=n.data,{width:p,height:m}=r.size,h=Object.assign({},f,{width:p,height:m,nodesOptions:a,title:c,legend:l}),{sankey:g,titleBox:_,legendBox:v}=this.calculateSankey(h,n);u&&fO(g);let{nodes:y,links:b,columns:x}=g;r.columns=x.map(e=>{let t=e.slice();return t.sort((e,t)=>e.y0-t.y0),t});let S=new P({clip:N.fromRect(new j([0,0],[p,m]))});if(_){let e=new aO(Object.assign({},c,{drawingRect:_})).exportVisual();S.append(e)}if(g.circularLinks)return S;let ee=new Map;r.nodesVisuals=ee;let C={nodes:[],links:[],map:new Map};r.models=C;let te=[];y.forEach((e,t)=>{let n=qD(e,a,s,t);n.root=()=>r.element,n.navigatable=d!==!0;let i=new GD(n),o=i.exportVisual();o.links=[],o.type=dO,e.color=n.color,e.opacity=n.opacity,o.dataItem=Object.assign({},f.nodes[t],{color:n.color,opacity:n.opacity,sourceLinks:e.sourceLinks.map(e=>({sourceId:e.sourceId,targetId:e.targetId,value:e.value})),targetLinks:e.targetLinks.map(e=>({sourceId:e.sourceId,targetId:e.targetId,value:e.value}))}),ee.set(e.id,o),C.nodes.push(i),C.map.set(e.id,i),S.append(o),i.createFocusHighlight(),i._highlight&&te.push(i._highlight)});let w=b.slice().sort((e,t)=>t.value-e.value),T=[];r.linksVisuals=T,w.forEach(e=>{let{source:t,target:n}=e,i=ee.get(t.id),a=ee.get(n.id),s=$D(e,o,i,a);s.root=()=>r.element,s.navigatable=d!==!0,s.rtl=u;let c=new QD(s),l=c.exportVisual();l.type=uO,l.dataItem={source:Object.assign({},i.dataItem),target:Object.assign({},a.dataItem),value:e.value},l.linkOptions=s,T.push(l),i.links.push(l),a.links.push(l),C.links.push(c),C.map.set(`${t.id}-${n.id}`,c),c.createFocusHighlight(),c._highlight&&te.push(c._highlight),S.append(l)});let E=y.reduce((e,t)=>Math.min(e,t.x0),1/0),D=y.reduce((e,t)=>Math.max(e,t.x1),0);if(y.forEach(e=>{let t=new rO(iO(e,i,u,E,D)).exportVisual();t&&S.append(t)}),v){let e=new lO(Object.assign({},l,{rtl:u,drawingRect:v,nodes:y})).exportVisual();S.append(e)}if(te.length!==0){let e=new P;e.append(...te),S.append(e)}return S}exportVisual(e){let t=e&&e.options?V({},this.options,e.options):this.options,n={size:{width:W(e&&e.width)?e.width:this.size.width,height:W(e&&e.height)?e.height:this.size.height}};return this._render(t,n)}_setOptions(e){this.options=V({},this.options,e)}};let mO={opacity:1,width:2,color:y};J(pO,{title:{position:`top`},labels:{visible:!0,margin:{left:8,right:8},padding:0,border:{width:0},paintOrder:`stroke`,stroke:{lineJoin:`round`,width:1},offset:{left:0,top:0}},nodes:{width:24,padding:16,opacity:1,align:`stretch`,offset:{left:0,top:0},focusHighlight:{border:Object.assign({},mO)},labels:{ariaTemplate:({node:e})=>e.label.text}},links:{colorType:`static`,opacity:.4,highlight:{opacity:.8,inactiveOpacity:.2},focusHighlight:{border:Object.assign({},mO)},labels:{ariaTemplate:({link:e})=>`${e.source.label.text} to ${e.target.label.text}`}},tooltip:{followPointer:!1,delay:200}});function hO(e){let t=[];return e.forEach(e=>{let{dataItem:n,dataColumns:r}=e,i=[];r.forEach(e=>{i.push({field:e.title||e.field,value:Rd(e.field)(n)})}),t.push(i)}),t}let $=Object.freeze({seriesType:0,stacked:1,categoryAxisX:2,valueAxisY:3,seriesChange:4,areaMarginLeft:5,areaMarginRight:6,areaMarginTop:7,areaMarginBottom:8,areaBackground:9,titleText:10,titleFontName:11,titleFontSize:12,titleColor:13,subtitleText:14,subtitleFontName:15,subtitleFontSize:16,subtitleColor:17,seriesColor:18,seriesLabel:19,legendVisible:20,legendFontName:21,legendFontSize:22,legendColor:23,legendPosition:24,categoryAxisTitleText:25,categoryAxisTitleFontName:26,categoryAxisTitleFontSize:27,categoryAxisTitleColor:28,categoryAxisLabelsFontName:29,categoryAxisLabelsFontSize:30,categoryAxisLabelsColor:31,categoryAxisLabelsRotation:32,categoryAxisReverseOrder:33,valueAxisTitleText:34,valueAxisTitleFontName:35,valueAxisTitleFontSize:36,valueAxisTitleColor:37,valueAxisLabelsFormat:38,valueAxisLabelsFontName:39,valueAxisLabelsFontSize:40,valueAxisLabelsColor:41,valueAxisLabelsRotation:42}),gO=[{text:`10`,value:`10px`},{text:`12`,value:`12px`},{text:`14`,value:`14px`},{text:`16`,value:`16px`},{text:`20`,value:`20px`},{text:`28`,value:`28px`},{text:`42`,value:`42px`},{text:`56`,value:`56px`}],_O=`12px`,vO=`16px`,yO=[{text:`Arial`,value:`Arial, Helvetica, sans-serif`,style:{fontFamily:`Arial, Helvetica, sans-serif`}},{text:`Courier New`,value:`'Courier New', Courier, monospace`,style:{fontFamily:`'Courier New', Courier, monospace`}},{text:`Georgia`,value:`Georgia, serif`,style:{fontFamily:`Georgia, serif`}},{text:`Impact`,value:`Impact, Charcoal, sans-serif`,style:{fontFamily:`Impact, Charcoal, sans-serif`}},{text:`Lucida Console`,value:`'Lucida Console', Monaco, monospace`,style:{fontFamily:`'Lucida Console', Monaco, monospace`}},{text:`Tahoma`,value:`Tahoma, Geneva, sans-serif`,style:{fontFamily:`Tahoma, Geneva, sans-serif`}},{text:`Times New Roman`,value:`'Times New Roman', Times,serif`,style:{fontFamily:`'Times New Roman', Times,serif`}},{text:`Trebuchet MS`,value:`'Trebuchet MS', Helvetica, sans-serif`,style:{fontFamily:`'Trebuchet MS', Helvetica, sans-serif`}},{text:`Verdana`,value:`Verdana, Geneva, sans-serif`,style:{fontFamily:`Verdana, Geneva, sans-serif`}}],bO=yO[0].value,xO=`line`,SO=`scatter`,CO=[`column`,`bar`,xO,SO],wO={type:xO,width:0};function TO(e){return e&&CO.includes(e)}let EO=[`string`,`date`,`number`],DO=[`number`],OO={bar:[{axisType:`category`,types:EO},{axisType:`value`,types:DO}],column:[{axisType:`category`,types:EO},{axisType:`value`,types:DO}],line:[{axisType:`category`,types:EO},{axisType:`value`,types:DO}],pie:[{axisType:`category`,types:EO},{axisType:`value`,types:DO,count:1}],scatter:[{axisType:`category`,types:EO},{axisType:`value`,types:DO}]};function kO(e,t){return`${t||``} ${e||``}`.trim()}function AO(e){let t=(e||``).indexOf(` `);return{size:e&&e.substring(0,t),name:e&&e.substring(t+1)}}let jO=(e,t,n)=>{let{size:r}=AO(n);return e?kO(e,r||t):``},MO=(e,t,n)=>{let{name:r}=AO(n);return e?kO(r||t,e):``},NO=e=>e!=null,PO=e=>{let t=structuredClone(e[0]);return t.forEach((t,n)=>{if(!NO(t.value))for(let r=0;r<e.length;r++){let i=e[r][n].value;if(NO(i)){t.value=i;break}}}),t},FO=(e,t)=>{let n=[],r=PO(e);t.types.forEach(e=>{r.forEach((t,r)=>{typeof t.value===e&&n.push(r)})});let i=n.findIndex(t=>{let n=e.map(e=>e[t].value);return new Set(n).size===n.length});return Math.max(i,0)},IO=(e,t)=>{let n=[],r=PO(e);return t.forEach(e=>{e.types.forEach(e=>{r.forEach((t,r)=>{typeof t.value===e&&n.push(r)})})}),n},LO=()=>structuredClone({columns:[],data:[],series:[],initialSeries:[],categoryAxis:[{categories:[],labels:{visible:!0,rotation:`auto`},title:{text:``}}],valueAxis:[{labels:{visible:!0,rotation:`auto`}}],area:{margin:{left:void 0,right:void 0,top:void 0,bottom:void 0}},title:{text:``},subtitle:{text:``},stack:!1}),RO=(e,t,n)=>{let r=LO();r.seriesType=t,r.data=e||[],r.legend={visible:!0,position:`bottom`};let i=OO[t];if(!i||!e.length)return r;let a=e[0].slice();r.columns=e[0].map(e=>String(e.field));let o=i.find(e=>e.axisType===`category`),s=-1;o&&(s=n&&n.categoryAxis?r.columns.indexOf(n.categoryAxis):FO(e,o));let c=i.filter(e=>e.axisType===`value`),l=IO(e,c);l.includes(s)&&(l.length>1?l=l.filter(e=>e!==s):s=-1);let u=[];l.forEach(n=>{let r=a[n],i=[];e.forEach(e=>{i.push(e[n].value)}),u.push(Object.assign({},{name:r.field,type:t,data:i,stack:!1,labels:{visible:!1}},t===SO?wO:{}))});let d=s>-1?e.map(e=>String(NO(e[s].value)?e[s].value:` `)):[];return u.length&&(r.series=u.map((e,t)=>Object.assign({},e,{id:t})),r.initialSeries=structuredClone(r.series)),r.categoryAxis=[{categories:d,labels:{visible:!0,rotation:`auto`}}],r.categoryField=r.columns[s],r},zO=(e,t,n)=>{let r=LO();r.seriesType=t,r.data=e||[];let i=OO[t];if(!i||!e.length)return r;let a=e[0].map(e=>e.field),o=i.find(e=>e.axisType===`category`),s=-1;o&&(s=n&&n.categoryAxis?a.indexOf(n.categoryAxis):FO(e,o));let c=i.filter(e=>e.axisType===`value`),l=[];l=n&&n.valueAxis?[a.indexOf(n.valueAxis)]:IO(e,c),l.includes(s)&&l.length>1&&(l=l.filter(e=>e!==s)),typeof c[0].count==`number`&&(l=l.slice(0,c[0].count));let u=s>-1?e.map(e=>String(e[s].value)):[],d=[];return e.forEach(e=>{let t={};l.forEach(n=>{let r=e[n];t[r.field]=r.value||0,t[e[s].field]=e[s].value||` `}),d.push(t)}),r.columns=a,r.categoryAxis=[{categories:u,title:{text:``}}],r.series=[{id:0,data:d,type:t,name:a[s],labels:{visible:!0},categoryField:a[s],field:a[l[0]]}],r.categoryField=a[s],r.valueField=a[l[0]],r.initialSeries=structuredClone(r.series),r};function BO(e,t,n){let r=VO(e,n&&n.seriesType||t);return(n&&n.stack)===void 0?r:WO(r,$.stacked,n.stack)}function VO(e,t){return(TO(t)?RO:zO)(e,t)}function HO(e,t){if(e.stack!==void 0){t.stack=e.stack;for(let n=0;n<t.series.length;n++)t.series[n].stack=e.stack}}function UO(e,t){let n=structuredClone(t);if(n.legend=e.legend,n.area=e.area,n.title=e.title,n.subtitle=e.subtitle,n.series.length===e.series.length)for(let t=0;t<n.series.length;t++)n.series[t].color=e.series[t].color,n.series[t].labels=e.series[t].labels;return e.series.every(e=>e.labels&&e.labels.visible)&&TO(n.seriesType)&&TO(e.seriesType)&&n.series.forEach(e=>{e.labels=e.labels||{},e.labels.visible=!0}),n}function WO(e,t,n){let r=Object.assign({},e);switch(t){case $.seriesType:return VO(r.data,n);case $.stacked:return r.series=r.series.map(e=>Object.assign({},e,{stack:n})),r.stack=n,r;case $.categoryAxisX:if(r.seriesType&&TO(r.seriesType)){let e=RO(r.data,r.seriesType,{categoryAxis:n});return HO(r,e),UO(r,e)}else if(r.seriesType===`pie`)return UO(r,zO(r.data,r.seriesType,{categoryAxis:n}));return r;case $.valueAxisY:return r.seriesType===`pie`?UO(r,zO(r.data,r.seriesType,{categoryAxis:r.categoryField,valueAxis:n})):r;case $.seriesChange:return r.series=n,r;case $.areaMarginLeft:return r.area=Object.assign({},r.area,{margin:Object.assign({},r.area&&r.area.margin||{},{left:n})}),r;case $.areaMarginRight:return r.area=Object.assign({},r.area,{margin:Object.assign({},r.area&&r.area.margin||{},{right:n})}),r;case $.areaMarginTop:return r.area=Object.assign({},r.area,{margin:Object.assign({},r.area&&r.area.margin||{},{top:n})}),r;case $.areaMarginBottom:return r.area=Object.assign({},r.area,{margin:Object.assign({},r.area&&r.area.margin||{},{bottom:n})}),r;case $.areaBackground:return r.area=Object.assign({},r.area,{background:n}),r;case $.titleText:return r.title=Object.assign({},r.title,{text:n}),r;case $.titleFontName:return r.title=Object.assign({},r.title,{font:jO(n,`20px`,r.title&&r.title.font)}),r;case $.titleFontSize:return r.title=Object.assign({},r.title,{font:MO(n,bO,r.title&&r.title.font)}),r;case $.titleColor:return r.title=Object.assign({},r.title,{color:n}),r;case $.subtitleText:return r.subtitle=Object.assign({},r.subtitle,{text:n}),r;case $.subtitleFontName:return r.subtitle=Object.assign({},r.subtitle,{font:jO(n,`16px`,r.subtitle&&r.subtitle.font)}),r;case $.subtitleFontSize:return r.subtitle=Object.assign({},r.subtitle,{font:MO(n,bO,r.subtitle&&r.subtitle.font)}),r;case $.subtitleColor:return r.subtitle=Object.assign({},r.subtitle,{color:n}),r;case $.seriesColor:return r.series=r.series.map(e=>Object.assign({},e,{color:n.seriesName===e.name?n.color:e.color})),r;case $.seriesLabel:return r.series=r.series.map(e=>n.all||n.seriesName===e.name?Object.assign({},e,{labels:{visible:n.visible}}):e),r;case $.legendVisible:return r.legend=Object.assign({},r.legend,{visible:n}),r;case $.legendFontName:{let e=r.legend||{};return r.legend=Object.assign({},e,{labels:Object.assign({},e.labels,{font:jO(n,_O,e.labels&&e.labels.font)})}),r}case $.legendFontSize:{let e=r.legend||{};return r.legend=Object.assign({},e,{labels:Object.assign({},e.labels,{font:MO(n,bO,e.labels&&e.labels.font)})}),r}case $.legendColor:{let e=r.legend||{};return r.legend=Object.assign({},e,{labels:Object.assign({},e.labels,{color:n})}),r}case $.legendPosition:return r.legend=Object.assign({},r.legend,{position:n}),r;case $.categoryAxisTitleText:return r.categoryAxis=(r.categoryAxis||[]).map(e=>Object.assign({},e,{title:Object.assign({},e.title,{text:n})})),r;case $.categoryAxisTitleFontName:return r.categoryAxis=(r.categoryAxis||[]).map(e=>Object.assign({},e,{title:Object.assign({},e.title,{font:jO(n,vO,e.title&&e.title.font)})})),r;case $.categoryAxisTitleFontSize:return r.categoryAxis=(r.categoryAxis||[]).map(e=>Object.assign({},e,{title:Object.assign({},e.title,{font:MO(n,bO,e.title&&e.title.font)})})),r;case $.categoryAxisTitleColor:return r.categoryAxis=(r.categoryAxis||[]).map(e=>Object.assign({},e,{title:Object.assign({},e.title,{color:n})})),r;case $.categoryAxisLabelsFontName:return r.categoryAxis=(r.categoryAxis||[]).map(e=>Object.assign({},e,{labels:Object.assign({},e.labels,{font:jO(n,_O,e.labels&&e.labels.font)})})),r;case $.categoryAxisLabelsFontSize:return r.categoryAxis=(r.categoryAxis||[]).map(e=>Object.assign({},e,{labels:Object.assign({},e.labels,{font:MO(n,bO,e.labels&&e.labels.font)})})),r;case $.categoryAxisLabelsColor:return r.categoryAxis=(r.categoryAxis||[]).map(e=>Object.assign({},e,{labels:Object.assign({},e.labels,{color:n})})),r;case $.categoryAxisLabelsRotation:{let e=NO(n)?n:`auto`;return r.categoryAxis=(r.categoryAxis||[]).map(t=>Object.assign({},t,{labels:Object.assign({},t.labels,{rotation:e})})),r}case $.categoryAxisReverseOrder:return r.categoryAxis=(r.categoryAxis||[]).map(e=>Object.assign({},e,{reverse:n})),r;case $.valueAxisTitleText:return!r.valueAxis||r.valueAxis.length===0?r.valueAxis=[{title:{text:n}}]:r.valueAxis=(r.valueAxis||[]).map(e=>Object.assign({},e,{title:Object.assign({},e.title,{text:n})})),r;case $.valueAxisTitleFontName:return r.valueAxis=(r.valueAxis||[]).map(e=>Object.assign({},e,{title:Object.assign({},e.title,{font:jO(n,vO,e.title&&e.title.font)})})),r;case $.valueAxisTitleFontSize:return r.valueAxis=(r.valueAxis||[]).map(e=>Object.assign({},e,{title:Object.assign({},e.title,{font:MO(n,bO,e.title&&e.title.font)})})),r;case $.valueAxisTitleColor:return r.valueAxis=(r.valueAxis||[]).map(e=>Object.assign({},e,{title:Object.assign({},e.title,{color:n})})),r;case $.valueAxisLabelsFormat:return r.valueAxis=(r.valueAxis||[]).map(e=>Object.assign({},e,{labels:Object.assign({},e.labels,{format:n})})),r;case $.valueAxisLabelsFontName:return r.valueAxis=(r.valueAxis||[]).map(e=>Object.assign({},e,{labels:Object.assign({},e.labels,{font:jO(n,_O,e.labels&&e.labels.font)})})),r;case $.valueAxisLabelsFontSize:return r.valueAxis=(r.valueAxis||[]).map(e=>Object.assign({},e,{labels:Object.assign({},e.labels,{font:MO(n,bO,e.labels&&e.labels.font)})})),r;case $.valueAxisLabelsColor:return r.valueAxis=(r.valueAxis||[]).map(e=>Object.assign({},e,{labels:Object.assign({},e.labels,{color:n})})),r;case $.valueAxisLabelsRotation:{let e=NO(n)?n:`auto`;return r.valueAxis=(r.valueAxis||[]).map(t=>Object.assign({},t,{labels:Object.assign({},t.labels,{rotation:e})})),r}default:return r}}let GO=Object.freeze({windowTitle:`Chart Preview`,exportButton:`Export`,exportPDFButton:`PDF File`,exportSVGButton:`SVG File`,exportPNGButton:`PNG File`,tabChart:`Chart`,tabData:`Data`,tabFormat:`Format`,barChart:`Bar Chart`,barChartBar:`Bar`,barChartStackedBar:`Stacked Bar`,barChart100StackedBar:`100% Stacked Bar`,pieChart:`Pie Chart`,pieChartPie:`Pie`,columnChart:`Column Chart`,columnChartColumn:`Column`,columnChartStackedColumn:`Stacked Column`,columnChart100StackedColumn:`100% Stacked Column`,lineChart:`Line Chart`,lineChartLine:`Line`,lineChartStackedLine:`Stacked Line`,lineChart100StackedLine:`100% Stacked Line`,scatterChart:`Scatter Chart`,scatterChartScatter:`Scatter`,configuration:`Configuration`,configurationCategoryAxis:`Category Axis`,configurationXAxis:`X Axis`,configurationValueAxis:`Value Axis`,configurationSeries:`Series`,configurationSeriesAdd:`Add`,formatChartArea:`Chart Area`,formatChartAreaMargins:`Margins`,formatChartAreaMarginsAuto:`Auto`,formatChartAreaMarginsLeft:`Left`,formatChartAreaMarginsRight:`Right`,formatChartAreaMarginsTop:`Top`,formatChartAreaMarginsBottom:`Bottom`,formatChartAreaBackground:`Background`,formatChartAreaBackgroundColor:`Color`,formatTitle:`Title`,formatTitleApplyTo:`Apply to`,formatTitleChartTitle:`Chart Title`,formatTitleChartSubtitle:`Chart Subtitle`,formatTitleLabel:`Title`,formatTitleFont:`Font`,formatTitleFontPlaceholder:`(inherited font)`,formatTitleSize:`Size`,formatTitleSizePlaceholder:`px`,formatTitleColor:`Color`,formatSeries:`Series`,formatSeriesApplyTo:`Apply to`,formatSeriesAllSeries:`All Series`,formatSeriesColor:`Color`,formatSeriesShowLabels:`Show Labels`,formatLegend:`Legend`,formatLegendShowLegend:`Show Legend`,formatLegendFont:`Font`,formatLegendFontPlaceholder:`(inherited font)`,formatLegendSize:`Size`,formatLegendSizePlaceholder:`px`,formatLegendColor:`Color`,formatLegendPosition:`Position`,formatLegendPositionTop:`Top`,formatLegendPositionBottom:`Bottom`,formatLegendPositionLeft:`Left`,formatLegendPositionRight:`Right`,formatCategoryAxis:`Category Axis`,formatXAxis:`X Axis`,formatCategoryAxisTitle:`Title`,formatCategoryAxisTitlePlaceholder:`Axis Title`,formatCategoryAxisTitleFont:`Font`,formatCategoryAxisTitleFontPlaceholder:`(inherited font)`,formatCategoryAxisTitleSize:`Size`,formatCategoryAxisTitleSizePlaceholder:`px`,formatCategoryAxisTitleColor:`Color`,formatCategoryAxisLabels:`Labels`,formatCategoryAxisLabelsFont:`Font`,formatCategoryAxisLabelsFontPlaceholder:`(inherited font)`,formatCategoryAxisLabelsSize:`Size`,formatCategoryAxisLabelsSizePlaceholder:`px`,formatCategoryAxisLabelsColor:`Color`,formatCategoryAxisLabelsRotation:`Rotation`,formatCategoryAxisLabelsRotationAuto:`Auto`,formatCategoryAxisLabelsReverseOrder:`Reverse Order`,formatValueAxis:`Value Axis`,formatYAxis:`Y Axis`,formatValueAxisTitle:`Title`,formatValueAxisTitlePlaceholder:`Axis Title`,formatValueAxisTitleFont:`Font`,formatValueAxisTitleFontPlaceholder:`(inherited font)`,formatValueAxisTitleSize:`Size`,formatValueAxisTitleSizePlaceholder:`px`,formatValueAxisTitleColor:`Color`,formatValueAxisLabels:`Labels`,formatValueAxisLabelsFormat:`Label Format`,formatValueAxisLabelsFormatText:`Text`,formatValueAxisLabelsFormatNumber:`Number`,formatValueAxisLabelsFormatCurrency:`Currency`,formatValueAxisLabelsFormatPercent:`Percent`,formatValueAxisLabelsFont:`Font`,formatValueAxisLabelsFontPlaceholder:`(inherited font)`,formatValueAxisLabelsSize:`Size`,formatValueAxisLabelsSizePlaceholder:`px`,formatValueAxisLabelsColor:`Color`,formatValueAxisLabelsRotation:`Rotation`,formatValueAxisLabelsRotationAuto:`Auto`});Object.freeze({getWizardDataFromDataRows:hO,ActionTypes:$,createInitialState:BO,createState:VO,fontNames:yO,fontSizes:gO,isCategorical:TO,mergeStates:UO,parseFont:AO,updateState:WO,messages:GO});let KO=1.5,qO=.4,JO=`#000`,YO=`12px Arial, Helvetica, sans-serif`,XO=`16px Arial, Helvetica, sans-serif`,ZO=`transparent`,QO=`#fff`,$O={type:yg},ek={type:cg},tk=Object.assign({},ek,{markers:{visible:!1},highlight:{visible:!1}}),nk=()=>({icon:{border:{width:1}},label:{font:YO,padding:3},line:{length:10,width:2},legendItem:tk,visible:!0}),rk=()=>({labels:{font:YO},notes:nk(),title:{font:XO,margin:5}}),ik=()=>({highlight:{markers:{border:{}}},line:{opacity:1,width:0},markers:{size:6,visible:!1},legendItem:ek,opacity:.4}),ak=()=>({highlight:{markers:{border:{}}},line:{opacity:1,width:0},markers:{size:6,visible:!1},legendItem:ek,opacity:.4}),ok=()=>({gap:KO,spacing:qO,legendItem:tk}),sk=()=>({outliersField:``,meanField:``,border:{_brightness:.8,width:1},downColor:QO,gap:1,highlight:{border:{opacity:1,width:2},whiskers:{width:3},mean:{width:2},median:{width:2}},mean:{width:2},median:{width:2},spacing:.3,whiskers:{width:2},legendItem:tk}),ck=()=>({border:{width:0},labels:{background:ZO},legendItem:tk,opacity:.6}),lk=()=>({gap:KO,spacing:qO,target:{color:`#ff0000`},legendItem:tk}),uk=()=>({border:{_brightness:.8,width:1},downColor:QO,gap:1,highlight:{border:{opacity:1,width:2},line:{width:2}},line:{color:JO,width:1},legendItem:tk,spacing:.3}),dk=()=>({gap:KO,spacing:qO,legendItem:tk}),fk=()=>({legendItem:tk}),pk=()=>({legendItem:$O}),mk=()=>({legendItem:$O}),hk=()=>({margin:1,legendItem:tk}),gk=()=>({width:2,legendItem:$O}),_k=()=>({gap:1,highlight:{line:{opacity:1,width:3}},line:{width:1},legendItem:tk,spacing:.3}),vk=()=>({line:{opacity:1,width:0},markers:{size:6,visible:!1},legendItem:ek,opacity:.5}),yk=()=>({markers:{visible:!1},legendItem:$O,width:2}),bk=()=>({gap:KO,spacing:qO,legendItem:tk}),xk=()=>({gap:KO,spacing:qO,legendItem:tk}),Sk=()=>({width:1,legendItem:$O}),Ck=()=>({gap:.5,line:{color:JO,width:1},legendItem:tk,spacing:qO}),wk=()=>({labels:{background:``,color:``,padding:{top:5,bottom:5,left:7,right:7}},legendItem:tk}),Tk=()=>({labels:{background:``,color:``,padding:{top:5,bottom:5,left:7,right:7}},legendItem:tk}),Ek=Tk,Dk=()=>({labels:{color:``,background:ZO,visible:!0},highlight:{border:{width:0}},legendItem:tk}),Ok=e=>Object.assign({color:`inherit`,trendline:{},markers:{visible:!1},width:1,dashType:`longDash`,legendItem:$O},e),kk=e=>({visible:!0,labels:{font:`11px Arial, Helvetica, sans-serif`},overlay:e.gradients?{}:{gradient:`none`},area:ik(),rangeArea:ak(),verticalRangeArea:ak(),bar:ok(),boxPlot:sk(),bubble:ck(),bullet:lk(),candlestick:uk(),column:dk(),heatmap:Dk(),pie:wk(),donut:hk(),funnel:Tk(),pyramid:Ek(),horizontalWaterfall:Ck(),line:gk(),notes:nk(),ohlc:_k(),radarArea:vk(),radarLine:yk(),radarColumn:fk(),polarArea:vk(),polarLine:yk(),polarScatter:pk(),rangeBar:bk(),rangeColumn:xk(),scatter:mk(),scatterLine:Sk(),verticalArea:ik(),verticalBoxPlot:sk(),verticalBullet:lk(),verticalLine:gk(),waterfall:Ck(),linearTrendline:Ok(),exponentialTrendline:Ok({style:`smooth`}),logarithmicTrendline:Ok({style:`smooth`}),polynomialTrendline:Ok({style:`smooth`}),powerTrendline:Ok({style:`smooth`}),movingAverageTrendline:Ok()}),Ak=()=>({font:XO}),jk=()=>({font:YO}),Mk=()=>({labels:{font:YO}}),Nk=(e={})=>({axisDefaults:rk(),categoryAxis:{majorGridLines:{visible:!0}},navigator:{pane:{height:90,margin:{top:10}}},seriesDefaults:kk(e),title:Ak(),subtitle:jk(),legend:Mk()});(function(e,t){var n=window.kendo;n.dataviz=n.dataviz||{},n.deepExtend(n.dataviz,n.deepExtend({},SS));var r=`.kendoChart`,i=n.Class,a=n._outerWidth,o=n._outerHeight,s=n.dataviz,c=n.ui.Widget,l=n.data.DataSource,u=n.deepExtend,d=Array.isArray,f=e.extend,p=n.template,m=n.htmlEncode,h=`mouseleave`+r,g=Uh,_=`axisLabelClick`,v=g.LEGEND_ITEM_CLICK,y=g.LEGEND_ITEM_HOVER,b=g.LEGEND_ITEM_LEAVE,x=g.SERIES_CLICK,S=g.SERIES_HOVER,ee=g.SERIES_OVER,C=g.SERIES_LEAVE,te=g.PANE_RENDER,w=g.PLOT_AREA_CLICK,T=g.PLOT_AREA_HOVER,E=g.PLOT_AREA_LEAVE,D=g.DRAG,ne=g.DRAG_END,re=g.DRAG_START,O=g.DRILLDOWN,ie=`drilldownLevelChange`,k=g.ZOOM_START,ae=g.ZOOM,oe=g.ZOOM_END,se=g.SELECT_START,ce=g.SELECT,le=g.SELECT_END,ue=g.RENDER,de=`noteClick`,fe=`noteHover`,pe=`noteLeave`,me=e(document.documentElement),he=`change`,ge=`dataBound`,_e=`leave`,ve=`down`,ye=`value`,be=g.PIE,xe=g.DONUT,Se=g.FUNNEL,Ce=n.Observable,we=150,Te=100,Ee=`k-chart-tooltip-inverse`,De=`k-chart-shared-tooltip`,Oe=`rtl`;_m.register({create:function(e,t){return new n.UserEvents(e,u({global:!0,multiTouch:!0,fastTap:!0},t))}});var ke=n.ConvertClass(Wd).extend({handlerMap:{showTooltip:`_showTooltip`,hideTooltip:`_hideTooltip`,legendItemClick:`_onLegendItemClick`,render:`_onRender`,init:`_onInit`,drilldown:`_onDrilldown`}}),Ae=c.extend({init:function(e,t){var r;n.destroy(e),c.fn.init.call(this,e),t&&(r=t.dataSource,delete t.dataSource),this.options=u({},this.options,t),this.wrapper=this.element,this._attachEvents(),t&&(t.dataSource=r),this._seriesVisibility=new Fe,this.bind(this.events,this.options),this._initDataSource(t),this._drilldownState=[],n.notify(this,s.ui),this._showWatermarkOverlay&&this._showWatermarkOverlay(this.wrapper[0])},events:[ge,O,ie,x,S,ee,C,_,v,y,b,te,w,T,E,re,D,ne,k,ae,oe,se,ce,le,de,fe,pe,ue],options:{name:`Chart`,renderAs:``,theme:`sass`,axisDefaults:{},chartArea:{},legend:{},categoryAxis:{},autoBind:!0,seriesDefaults:{},series:[],seriesColors:null,tooltip:{},transitions:!0,valueAxis:{},plotArea:{},title:{},xAxis:{},yAxis:{},panes:[{}],pannable:!1,zoomable:!1,noData:!0,messages:{noData:`No data available`}},items:function(){return e()},refresh:function(){var e=this,t=e._instance;t.applyDefaults(e.options),t.applySeriesColors(),e._bindSeries(),e._bindCategories(),e.trigger(ge),e._redraw()},getSize:function(){return n.dimensions(this.element)},redraw:function(e){this._size=null,this._instance.redraw(e)},setOptions:function(e){var t=this,n=e.dataSource;delete e.dataSource,c.fn._setEvents.call(t,e),this._instance.applyOptions(e,this._getThemeOptions(e)),this.options=this._instance.options,this._tooltip.setOptions(this.options.tooltip),this._seriesVisibility.setOptions(this.options),this._sourceSeries=null,n&&t.setDataSource(n),t._hasDataSource?t._onDataChanged():(t._bindCategories(),t.redraw()),t._destroyNoData(),t._initNoData(),t._instance.updateMouseMoveHandler(),t._instance._restoreOverlayElement()},setDataSource:function(e){var t=this;t.dataSource.unbind(he,t._dataChangeHandler),t.dataSource=e=l.create(e),t._hasDataSource=!0,t._hasData=!1,e.bind(he,t._dataChangeHandler),t.options.autoBind&&e.fetch()},destroy:function(){var e=this,t=e.dataSource;e.element.off(r),t&&t.unbind(he,e._dataChangeHandler),e._instance&&(e._instance.destroy(),delete e._instance),e._tooltip&&(e._tooltip.destroy(),delete e._tooltip),e._destroyNoData(),e._destroyCrosshairTooltips(),c.fn.destroy.call(e)},findPaneByName:function(e){for(var t=this._plotArea.panes,n=0;n<t.length;n++)if(t[n].options.name===e)return new Be(this,t[n])},findPaneByIndex:function(e){var t=this._plotArea.panes;if(t[e])return new Be(this,t[e])},findSeries:function(e){for(var t=this._plotArea,n=t.srcSeries||t.series,r=0;r<n.length;r++)if(e(n[r]))return new Ve(this,n[r])},findSeriesByName:function(e){return this._createSeries({name:e})},findSeriesByIndex:function(e){return this._createSeries({index:e})},exportVisual:function(e){var t=this._instance;if(t){var n;if(e&&(e.width||e.height)){var r=t.options.chartArea,i=t._originalOptions.chartArea;u(r,e);var a=t._getModel();r.width=i.width,r.height=i.height,a.renderVisual(),He(a._plotArea.panes),n=a.visual}else n=t.exportVisual();return n}},resetDrilldownLevel(e){e||=0;let t=this._drilldownState;if(!t||e<0||e>t.length-1)return;let n={level:e,sender:this};this.trigger(ie,n),this.options.series=this._drilldownState[e],this._drilldownState=this._drilldownState.slice(0,e),this._bindCategories(),this._redraw()},_createSeries:function(e){var t=this._seriesOptions(e);if(t)return new Ve(this,t)},_seriesOptions:function(e){var t=this._plotArea,n=t.srcSeries||t.series,r;if(W(e.index))r=n[e.index];else if(W(e.name)){for(var i=0;i<n.length;i++)if(n[i].name===e.name){r=n[i];break}}return r},_attachEvents:function(){this.element.on(h,this._mouseleave.bind(this))},_mouseleave:function(t){var n=this._instance,r=this._tooltip,i=t.relatedTarget;!(i&&e(i).closest(r.element).length)&&n&&!n.handlingTap&&n.hideElements({keepTooltipOpen:!r.options.autoHide})},_getThemeOptions:function(e){var t=(e||{}).theme;if(t&&s.SASS_THEMES.indexOf(t.toLowerCase())!==-1){this.element.addClass(`k-chart`);let e=u(Nk(),tS(this.element[0]));return this.element.removeClass(`k-chart`),e}if(W(t)){var n=s.ui.themes||{};return(n[t]||n[t.toLowerCase()]||{}).chart||{}}},_initChart:function(){this._createChart(this.options,this._getThemeOptions(this.options)),this.options=this._instance.options,this._seriesVisibility.setOptions(this.options)},_createChart:function(e,t){this._instance=new fS(this.element[0],e,t,{observer:new Wd(this,{showTooltip:`_showTooltip`,hideTooltip:`_hideTooltip`,legendItemClick:`_onLegendItemClick`,render:`_onRender`,init:`_onInit`,drilldown:`_onDrilldown`}),sender:this,rtl:this._isRtl(),createSurface:n.drawing.Surface.create})},_onInit:function(e){this._instance=e.sender},_initDataSource:function(e){var t=this,n=(e||{}).dataSource;t._dataChangeHandler=t._onDataChanged.bind(t),t.dataSource=l.create(n).bind(`change`,t._dataChangeHandler),t._bindCategories(),n&&(t._hasDataSource=!0),this._initNoData(),this._initChart(),this._initTooltip(),n&&t.options.autoBind&&t.dataSource.fetch()},_destroyCrosshairTooltips:function(){var e=this._crosshairTooltips;if(e)for(var t in e)e[t].destroy();this._crosshairTooltips={}},_getCrosshairTooltip:function(e,t){var n=this._crosshairTooltips=this._crosshairTooltips||{},r=e+t,i=n[r];return i||=n[r]=new ze(this.element),i},_showTooltip:function(e){e.crosshair?this._getCrosshairTooltip(e.axisName,e.axisIndex).show(e):this._tooltip&&this._tooltip.show(e)},_hideTooltip:function(e){e.crosshair?this._getCrosshairTooltip(e.axisName,e.axisIndex).hide():this._tooltip&&this._tooltip.hide()},_onRender:function(e){this._destroyCrosshairTooltips(),this._copyMembers(e.sender),(!this._hasDataSource||this._hasData||!this.options.autoBind)&&this.trigger(ue)},_copyMembers:function(e){this.options=e.options,this._originalOptions=e._originalOptions,this.surface=e.surface,this._plotArea=e._plotArea,this._model=e._model,this._highlight=e._highlight,this._selections=e._selections,this._pannable=e._pannable,this._zoomSelection=e._zoomSelection,this._mousewheelZoom=e._mousewheelZoom},requiresHandlers:function(e){for(var t=this._events,n=0;n<e.length;n++)if(W(t[e[n]]))return!0},_initTooltip:function(){this._tooltip=this._createTooltip(),this._tooltip.bind(_e,this._tooltipleave.bind(this))},_onLegendItemClick:function(e){this.trigger(v,e)||this._legendItemClick(e.seriesIndex,e.pointIndex)},_legendItemClick:function(t,n){var r=this._instance,i=r._plotArea,a=(i.srcSeries||i.series)[t];if(r._hasInactiveOpacity()&&r._activeChartInstance&&(r._updateSeriesOpacity(null,!0),r._applySeriesOpacity(r._activeChartInstance.children,null,!0),r._activeChartInstance=null),e.inArray(a.type,[be,xe,Se])>=0){var o=a.data[n];if(o&&W(o.visible))o.visible=!o.visible;else{var s=a.pointVisibility=a.pointVisibility||{},c=s[n];s[n]=W(c)?!c:!1}}else a.visible=!a.visible,this._seriesVisibility.save(a);r._noTransitionsRedraw()},_createTooltip:function(){return new Re(this.element,f({},this.options.tooltip,{rtl:this._isRtl()}))},_tooltipleave:function(){this._instance&&this._instance.hideElements()},_onDrilldown:function(e){let{series:t,value:n}=e;if(t.drilldownSeriesFactory){let r=t.drilldownSeriesFactory(n);if(r)r instanceof Promise?r.then(t=>this._onDrilldownData(e,t)):this._onDrilldownData(e,r);else return}else typeof n==`object`&&this._onDrilldownData(e,n)},_onDrilldownData:function(e,t){let n=Object.assign({},e.series,t),r={point:e.point,series:e.series,drilldownSeries:n,sender:this};this.trigger(O,r)||(this._drilldownState.push(this.options.series),this.options.series=[n],this._bindCategories(),this._redraw())},_bindData:function(e){var t=this,n=t.options,r=t._sourceSeries||n.series,i,a=r.length,o=t.dataSource.view(),s=(t.dataSource.group()||[]).length>0,c=[],l=this._seriesVisibility,u,d;for(l.read(),i=0;i<a;i++)u=r[i],t._isBindable(u)&&s?(d=Pe(u,o),c=c.concat(d),l.applyByGroup(d,e)):(u=f({},u),c.push(u),l.applyByIndex(u,e));t._sourceSeries=r,n.series=c,this._instance.applySeriesColors(),t._bindSeries(),t._bindCategories(),this._hasData=!0},_initNoData:function(){if(this._noData||this.options.noData===!1)return;let t=e(`<div class='k-chart-overlay'></div>`);this._noData=t.hide().appendTo(this.wrapper);let r=e(`<div class='k-no-data'></div>`);r.appendTo(this._noData);let i=this.options.noData?.template||(()=>m(this.options.messages.noData));if(i){let e=typeof i==`function`?i:n.template(i);r.html(e({}))}this._instance&&!this._instance.overlayElement&&(this._instance.overlayElement=t[0])},_destroyNoData:function(){this._noData&&(n.destroy(this._noData),this._noData.remove(),delete this._noData,delete this._noDataContent),this._instance&&delete this._instance.overlayElement},_onDataChanged:function(e){this._bindData(e),this.dataSource.total()>0&&this._destroyNoData(),this.trigger(ge),this._instance&&this._instance.fontLoaded&&this._redraw()},_bindSeries:function(){var e=this,t=e.dataSource.view(),n=e.options.series,r=(this._instance?this._instance._originalOptions:{}).series||[],i,a=n.length,o,s,c;for(i=0;i<a;i++)o=n[i],e._isBindable(o)&&(s=o._groupIx,c=W(s)?(t[s]||{}).items:t,o.autoBind!==!1&&(o.data=c,r[i]&&(r[i].data=c.slice())))},_bindCategories:function(){var e=this,t=e.dataSource.view()||[],n=(e.dataSource.group()||[]).length>0,r=t,i=e.options,a=[].concat(i.categoryAxis),o,s;for(n&&t.length&&(r=t[0].items),o=0;o<a.length;o++)s=a[o],s.autoBind!==!1&&e._bindCategoryAxis(s,r,o)},_bindCategoryAxis:function(e,t,n){var r=(t||[]).length,i,a,o;if(e.field)for(e.categories=[],i=0;i<r;i++)o=t[i],a=kp(e.field,o),i===0?(e.categories=[a],e.dataItems=[o]):(e.categories.push(a),e.dataItems.push(o));else this._instance&&this._instance.bindCategoryAxisFromSeries(e,n)},_isBindable:function(e){var t=Y.current.valueFields(e),n=!0,r,i;for(i=0;i<t.length;i++)if(r=t[i],r===ye?r=`field`:r+=`Field`,!W(e[r])){n=!1;break}return n},_isRtl:function(){return n.support.isRtl(this.element)&&this.element.css(`direction`)===Oe}}),je=[`getAxis`,`findAxisByName`,`plotArea`,`toggleHighlight`,`showTooltip`,`hideTooltip`,`_resize`,`_redraw`,`_noTransitionsRedraw`,`_legendItemHover`,`_eventCoordinates`];function Me(e){Ae.fn[e]=function(){var t=this._instance;if(t)return t[e].apply(t,arguments)}}for(var Ne=0;Ne<je.length;Ne++)Me(je[Ne]);function Pe(e,r){var i=[],a,o=e.groupNameTemplate,s,c=r.length,l,d=({group:t})=>`${W(e.name)?t.value+`: `+e.name:t.value}`;if(c===0)return l=u({},e),l.visibleInLegend=!1,[l];for(W(o)?(n.logToConsole(`'groupNameTemplate' is obsolete and will be removed in future versions. Specify the group name template as 'series.name'`),o&&(a=p(o))):a=p(e.name||d),s=0;s<c;s++)l=u({},e),n.isFunction(l.color)||(l.color=t),l._groupIx=s,l._groupValue=r[s].value,i.push(l),a&&(l.name=a({series:l,group:r[s]}));return i}s.ExportMixin.extend(Ae.fn),n.PDFMixin&&n.PDFMixin.extend(Ae.fn),s.ui.plugin(Ae);var Fe=i.extend({init:function(){this.groups={},this.index={},this.options={}},applyByGroup:function(e,t){if(t&&t.action||this.options.persistSeriesVisibility)for(var n=0;n<e.length;n++)this.groups[e[n]._groupValue]===!1&&(e[n].visible=!1);else this.groups={}},applyByIndex:function(e,t){t&&t.action||this.options.persistSeriesVisibility?this.index[e.index]===!1&&(e.visible=!1):this.index={}},save:function(e){e&&(this.options.persistSeriesVisibility?this.options.series[e.index].visible=e.visible:this.saveState(e))},setOptions:function(e){this.options=e,this.groups={},this.index={}},read:function(){var e=this.options;if(e.persistSeriesVisibility)for(var t=e.series,n=0;n<t.length;n++)this.saveState(t[n])},saveState:function(e){W(e._groupValue)?this.groups[e._groupValue]=e.visible:this.index[e.index]=e.visible}}),Ie=n.geometry;function Le(e){for(var n in e)e[n]===t&&(e[n]=``);return e}var Re=Ce.extend({init:function(t,r){var i=this;Ce.fn.init.call(i),this.setOptions(r),i.chartElement=t,i.template=Re.template,i.template||=Re.template=({autoHide:t,rtl:r,font:i,border:a,opacity:o})=>`<div class='k-tooltip ${t?`k-tooltip-closable`:``} k-chart-tooltip ${r?`k-rtl`:``}' ${n.attr(`style-display`)}="none" ${n.attr(`style-position`)}="absolute" ${n.attr(`style-font`)}="${i}" ${n.attr(`style-opacity`)}="${o}" ${a?`${n.attr(`style-border`)}="${a.width}px solid" `:``}><div class="k-tooltip-content"></div>${t?``:`<div class="k-tooltip-button">`+n.ui.icon(e(`<a href="#" title="Close"></a>`),{icon:`x`})+`</div>`}</div>`,i.element=e(i.template(i.options)),n.applyStylesFromKendoAttributes(i.element,[`display`,`position`,`font`,`border`,`opacity`]),i.move=i.move.bind(i),i._mouseleave=i._mouseleave.bind(i);var a=n.format(`[{0}='content'],[{0}='scroller']`,n.attr(`role`));i._mobileScroller=t.closest(a).data(`kendoMobileScroller`),i.downEvent=n.applyEventMap(ve,n.guid()),i._closeTooltipHandler=i._closeTooltip.bind(i)},destroy:function(){var e=this;this._clearShowTimeout(),me.off(e.downEvent,e._closeTooltipHandler),this.element&&=(this.element.off(h).remove(),null)},setOptions:function(e){this.options=u({},this.options,e)},options:{opacity:1,animation:{duration:we},sharedTemplate:({colspan:e,categoryText:t,points:n,content:r,colorMarker:i,nameColumn:a})=>`<table><th colspan='${e}'>${t}</th>`+Ue(n,i,a,r)+`</table>`,categoryFormat:`{0:d}`,autoHide:!0},move:function(){var e=this,t=e.options,n=e.element,r;!e.anchor||!e.element||(r=e._offset(),e.visible||n.css({top:r.top,left:r.left}),e.visible=!0,e._ensureElement(document.body),n.stop(!0,!0).show().animate({left:r.left,top:r.top},t.animation.duration))},_clearShowTimeout:function(){this.showTimeout&&=(clearTimeout(this.showTimeout),null)},getAnchor:function(e){var t=this.anchor,n=t.point,r=t.align,i=n.left,a=n.top;return r.horizontal===`center`?i-=e.width/2:r.horizontal===`right`&&(i-=e.width),r.vertical===`center`?a-=e.height/2:r.vertical===`bottom`&&(a-=e.height),{x:i,y:a}},_offset:function(){var t=this,r=t._measure(),i=t.getAnchor(r),s=i.y,c=i.x,l=n.support.zoomLevel(),u=e(window),d=window.pageYOffset||document.documentElement.scrollTop||0,f=window.pageXOffset||document.documentElement.scrollLeft||0,p=(this._mobileScroller||{}).movable;if(!p||p.scale===1)s+=t._fit(s-d,r.height,o(u)/l),c+=t._fit(c-f,r.width,a(u)/l);else{var m=Ie.transform().scale(p.scale,p.scale,[p.x,p.y]),h=new Ie.Point(c,s).transform(m);c=h.x,s=h.y}return{top:s,left:c}},show:function(t){var i=this,a=e(`<div></div>`);this.anchor=t.anchor,this.element.css(Le(t.style)),this.element.toggleClass(Ee,!!t.className),this.element.toggleClass(De,!!t.shared);var o=t.shared?this._sharedContent(t):this._pointContent(t.point);a.html(o),n.applyStylesFromKendoAttributes(a,[`background-color`]),this.element.find(`.k-tooltip-content`).empty().append(a),i.options.autoHide||(i.element.off(`click`+r).on(`click`+r,`.k-tooltip-button`,i._closeTooltipHandler),me.off(i.downEvent,i._closeTooltipHandler).on(i.downEvent,i._closeTooltipHandler)),this._clearShowTimeout(),this.showTimeout=setTimeout(this.move,Te)},hide:function(e){var t=this;!t.options.autoHide&&!e||(clearTimeout(t.showTimeout),t._hideElement(),t.visible&&(t.point=null,t.visible=!1,t.index=null,me.off(t.downEvent,t._closeTooltipHandler)))},_closeTooltip:function(t){e(t.target).is(`.k-chart-tooltip, .k-tooltip-content`)||(t.preventDefault(),this.chartElement.data(`kendoChart`)._instance.hideElements(),this.hide(!0))},_sharedContent:function(e){var t=e.points,r=this,i=zd(t,function(e){return W(e.series.name)}).length,a=e.series.length>1,o=1;return i&&o++,a&&o++,n.template(this.options.sharedTemplate)({points:t,category:e.category,categoryText:e.categoryText,content:this._pointContent.bind(r),colorMarker:a,nameColumn:i,colspan:o})},_measure:function(){return this._ensureElement(),{width:a(this.element),height:o(this.element)}},_ensureElement:function(){this.element&&this.element.appendTo(document.body).on(h,this._mouseleave)},_mouseleave:function(t){var n=t.relatedTarget,r=this.chartElement[0];n&&n!==r&&!e.contains(r,n)&&this.trigger(_e)},_hideElement:function(){var e=this,t=this.element;t&&t.fadeOut({always:function(){e.visible||t.off(h).remove()}})},_pointContent:function(e){var t=u({},this.options,e.options.tooltip),n,r;return W(e.value)&&(n=e.value.toString()),t.template?(r=p(t.template),n=r({value:e.value,category:e.category,series:e.series,dataItem:e.dataItem,percentage:e.percentage,runningTotal:e.runningTotal,total:e.total,low:e.low,high:e.high,xLow:e.xLow,xHigh:e.xHigh,yLow:e.yLow,yHigh:e.yHigh})):t.format&&(n=e.formatValue(t.format)),n},_fit:function(e,t,n){var r=0;return e+t>n&&(r=n-(e+t)),e<0&&(r=-e),r}}),ze=Re.extend({init:function(e,t){Re.fn.init.call(this,e,t),this.element.addClass(`k-chart-crosshair-tooltip`)},show:function(e){this.element&&(this.anchor=e.anchor,this.element.css(e.style),this.element.html(this.content(e)),this.move())},move:function(){var e=this,t=e.element,n=e._offset();e._ensureElement(),t.css({top:n.top,left:n.left}).show()},content:function(e){var t=e.value,n=e.crosshair.options.tooltip;return n.template&&(t=p(n.template)({value:t})),t},hide:function(){this.element.hide()}}),Be=i.extend({init:function(e,t){this._chart=e,this._pane=t,this.visual=t.visual,this.chartsVisual=t.chartContainer.visual,this.name=t.options.name},series:function(){var e=this._chart,t=e._plotArea.groupSeriesByPane()[this.name||`default`],n=[];if(t)for(var r=0;r<t.length;r++)n.push(new Ve(e,t[r]));return n}}),Ve=i.extend({init:function(e,t){this._chart=e,this._options=t},points:function(e){var t=this._points;if(!t){var r=this._seriesOptions(),i=this._chart._plotArea;this._points=t=i.pointsBySeriesIndex(r.index)}return n.isFunction(e)&&(t=this._filterPoints(t,e)),t},data:function(e){var t=this._seriesOptions();if(e){var n=this._chart,r=n._plotArea;if(t.data=e,t.categoryField){var i=r.seriesCategoryAxis(t),a=[].concat(n.options.categoryAxis);n._instance.bindCategoryAxisFromSeries(a[i.axisIndex],i.axisIndex)}n._noTransitionsRedraw(),this._clearFields()}return t.data},findPoint:function(e){for(var t=this.points(),n=0;n<t.length;n++)if(e(t[n]))return t[n]},toggleHighlight:function(e,t){t=t?n.isFunction(t)?this.points(t):d(t)?t:[t]:this.points(),this._chart._instance.togglePointsHighlight(e,t)},toggleVisibility:function(e,t){var r=this._chart,i=this._seriesOptions();if(!n.isFunction(t))i.visible=e,r._seriesVisibility.save(i);else if(U(i.type,[be,xe,Se]))for(var a=this._filterData(t),o=0;o<a.length;o++)a[o].visible=e;else i.visible=function(n){return!t(n.dataItem)||e};r._noTransitionsRedraw(),this._clearFields()},_filterData:function(e){for(var t=this._seriesOptions().data,n=t.length,r=[],i=0;i<n;i++)e(t[i])&&r.push(t[i]);return r},_filterPoints:function(e,t){for(var n=[],r=e.length,i=0;i<r;i++)t(e[i])&&n.push(e[i]);return n},_seriesOptions:function(){var e=this._series;return e||=this._series=this._chart._seriesOptions(this._options),e},_clearFields:function(){delete this._points,delete this._series}});function He(e){for(var t=0;t<e.length;t++)e[t].notifyRender()}function Ue(e,t,r,i){for(var a=``,o=0;o<e.length;o++){var s=e[o];a+=`<tr>`,t&&(a+=`<td><span class='k-chart-shared-tooltip-marker' ${n.attr(`style-background-color`)}="${m(s.series.color)}"></span></td>`),r&&(a+=`<td> ${s.series.name?s.series.name+`:`:`&nbsp;`}</td>`),a+=`<td>${i(s)}</td>`,a+=`</tr>`}return a}s.Tooltip=Re,s.CrosshairTooltip=ze,s.ChartInstanceObserver=ke,s.ChartPane=Be,s.ChartSeries=Ve})(window.kendo.jQuery),e.__meta__={id:`dataviz.chart`,name:`Chart`,category:`dataviz`,description:`The Chart widget uses modern browser technologies to render high-quality data visualizations in the browser.`,depends:[`data`,`userevents`,`drawing`,`dataviz.core`,`dataviz.themes`,`breadcrumb`],features:[{id:`dataviz.chart-pdf-export`,name:`PDF export`,description:`Export Chart as PDF`,depends:[`pdf`]}]}});
//# sourceMappingURL=kendo.dataviz.chart.min.js.map