@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
46 lines • 297 kB
JavaScript
/* @license */
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("kendo.drawing.min.js")):typeof define==`function`&&define.amd?define([`exports`,`kendo.drawing.min`],t):(e=typeof globalThis<`u`?globalThis:e||self,t((e.kendo=e.kendo||{},e.kendo._globals=e.kendo._globals||{},e.kendo._globals.DatavizCore={}),e.kendo._globals.Drawing))})(this,function(e,t){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var n=Object.defineProperty,r=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t||n(r,Symbol.toStringTag,{value:`Module`}),r},i=r({ARC:()=>`arc`,ARIA_ACTIVE_DESCENDANT:()=>l,ARROW_DOWN:()=>o,ARROW_LEFT:()=>s,ARROW_RIGHT:()=>c,ARROW_UP:()=>a,AXIS_LABEL_CLICK:()=>u,BLACK:()=>d,BOTTOM:()=>f,CENTER:()=>p,CIRCLE:()=>m,COORD_PRECISION:()=>3,CROSS:()=>h,DATE:()=>g,DEFAULT_FONT:()=>_,DEFAULT_HEIGHT:()=>400,DEFAULT_PRECISION:()=>10,DEFAULT_SERIES_OPACITY:()=>1,DEFAULT_WIDTH:()=>600,END:()=>`end`,ENTER:()=>v,ESCAPE:()=>y,FORMAT_REGEX:()=>b,HEIGHT:()=>x,HIGHLIGHT_ZINDEX:()=>100,HORIZONTAL:()=>ve,INHERIT:()=>ee,INSIDE:()=>S,LEFT:()=>C,MAX_VALUE:()=>te,MIN_VALUE:()=>w,NONE:()=>ne,NOTE_CLICK:()=>re,NOTE_HOVER:()=>ie,NOTE_LEAVE:()=>ae,OBJECT:()=>oe,OUTSIDE:()=>se,POINTER:()=>_e,RECT:()=>me,RIGHT:()=>ce,ROUNDED_RECT:()=>le,SQUARE:()=>pe,START:()=>ue,STRING:()=>de,TAB:()=>`Tab`,TOP:()=>`top`,TRIANGLE:()=>fe,VALUE:()=>he,VERTICAL:()=>ye,WHITE:()=>T,WIDTH:()=>ge,X:()=>`x`,Y:()=>`y`});let a=`ArrowUp`,o=`ArrowDown`,s=`ArrowLeft`,c=`ArrowRight`,l=`aria-activedescendant`,u=`axisLabelClick`,d=`#000`,f=`bottom`,p=`center`,m=`circle`,h=`cross`,g=`date`,_=`12px sans-serif`,v=`Enter`,y=`Escape`,b=/\{\d+:?/,x=`height`,S=`inside`,ee=`inherit`,C=`left`,te=Number.MAX_VALUE,w=-Number.MAX_VALUE,ne=`none`,re=`noteClick`,ie=`noteHover`,ae=`noteLeave`,oe=`object`,se=`outside`,ce=`right`,le=`roundedRect`,ue=`start`,de=`string`,fe=`triangle`,pe=`square`,me=`rect`,he=`value`,T=`#fff`,ge=`width`,_e=`pointer`,ve=`horizontal`,ye=`vertical`;function be(e,t=10){return!Number.isFinite(e)||e===0?e:parseFloat(e.toPrecision(t))}function xe(e,t){let n=be(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=be(n/r,10),a=1;return a=i<1.904762?.2:i<4.761904?.5:i<9.523809?1:2,be(r*a,10)}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 we=/\s+/g;function Te(e,t){e&&e.className&&(e.className=e.className.replace(t,``).replace(we,` `))}var E=class{},Ee=class extends E{constructor(){super(),this._events={}}bind(e,t,n){let r=Oe(e),i=De(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=Oe(e),r=De(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=ke,t.isDefaultPrevented=Ae,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 De(e){return typeof e==`function`}function Oe(e){return typeof e==`string`?[e]:e}function ke(){this._defaultPrevented=!0}function Ae(){return this._defaultPrevented===!0}let je=e=>{let t=typeof window<`u`?window:{},n=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)};je=e=>n.call(t,e),je(e)};var Me=je;let Ne=/&/g,Pe=/</g,Fe=/"/g,Ie=/'/g,Le=/>/g;function Re(e){return String(e).replace(Ne,`&`).replace(Pe,`<`).replace(Le,`>`).replace(Fe,`"`).replace(Ie,`'`)}function ze(e){let t=window.console;t!==void 0&&t.log&&t.log(e)}function Be(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 Ve=null,He={get browser(){return typeof window>`u`||Ve||(Ve=Be(window.navigator.userAgent)),Ve}},Ue=Date.now||function(){return new Date().getTime()};function We(e,t){let n=0,r;if(!t||t<=0)return e;let i=function(){let i=Ue()-n,a=arguments,o=function(){e.apply(null,a),n=Ue()};if(!n)return o();r&&clearTimeout(r),i>t?o():r=setTimeout(o,t-i)};return i.cancel=function(){clearTimeout(r)},i}let Ge={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`},Ke=He.browser,qe=e=>{let t=Object.keys(Ge);t.push(`transparent`);let n=RegExp(`^(`+t.join(`|`)+`)(\\W|$)`,`i`);return qe=e=>n.exec(e),n.exec(e)};var Je=class extends E{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 Ke.msie&&Ke.version<9?this.toCss():this.toCssRgba()}equals(e){return e===this||e!=null&&this.toCssRgba()===nt(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 Xe(e.r,e.g,e.b,e.a)),e}},Ye=class extends Je{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 Qe(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 Qe(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 $e(a*60,o*100,s*100,this.a)}toBytes(){return new Xe(this.r*255,this.g*255,this.b*255,this.a)}},Xe=class extends Ye{constructor(e,t,n,r){super(Math.round(e),Math.round(t),Math.round(n),r)}toRGB(){return new Ye(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=Ze(this.r,2)+Ze(this.g,2)+Ze(this.b,2);return e&&e.alpha&&(t+=Ze(Math.round(this.a*255),2)),t}toBytes(){return this}};function Ze(e,t,n=`0`){let r=e.toString(16);for(;t>r.length;)r=n+r;return r}var Qe=class extends Je{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 Ye(r,i,a,this.a)}toHSL(){return this.toRGB().toHSL()}toBytes(){return this.toRGB().toBytes()}},$e=class extends Je{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=et(s,o,e+1/3),i=et(s,o,e),a=et(s,o,e-1/3)}return new Ye(r,i,a,this.a)}toHSV(){return this.toRGB().toHSV()}toBytes(){return this.toRGB().toBytes()}};function et(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 tt(e){return parseFloat(parseFloat(parseInt(e,16)/255).toFixed(3))}function nt(e,t){let n,r;if(!e||e===`none`)return null;if(e instanceof Je)return e;let i=e.toLowerCase();if(n=qe(i))return i=n[1]===`transparent`?new Ye(1,1,1,0):nt(Ge[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 Xe(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 Xe(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 Xe(parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16),tt(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 Xe(parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16),tt(n[4])):(n=/^rgb\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/.exec(i))?r=new Xe(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 Xe(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 Ye(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 Ye(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 Ye(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 rt=class e extends E{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 Xe(e,t,n,r??1)}static fromRGB(e,t,n,r){return new Ye(e,t,n,r??1)}static fromHSV(e,t,n,r){return new Qe(e,t,n,r??1)}static fromHSL(e,t,n,r){return new $e(e,t,n,r??1)}};rt.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)]}}],rt.namedColors=Ge;let it=e=>e.ownerDocument.defaultView.getComputedStyle(e),at=(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=nt(it(n).color,!0);return n.remove(),r?r.toCssHex():`#000000`};function ot(e,t){let n=it(e).getPropertyValue(t),r=nt(n,!0);return r?r.toCssHex():at(e,n)}var st=class extends E{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 ct={}.toString;var lt=class e extends st{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=ct.call(t),i=t;return i!=null&&r===`[object Object]`&&(!(t instanceof e)&&!(t instanceof E)&&(i=new e(i,this.prefix+n+`.`)),i.addObserver(this)),i}};function ut(e){return function(t){return this[e]!==t&&(this[e]=t,this.geometryChange()),this}}function dt(e){return function(){return this[e]}}function ft(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]=ut(r),e[`get`+i]=dt(r)}}let pt=(e,t)=>{let n=class extends e{};return ft(n.prototype,t),n};function mt(e,t){return e.push.apply(e,t),e}let ht={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 gt(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+=ht[t[0]],e-=t[0]);return n}function _t(){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 vt(e){return e!==void 0}let yt=1;function bt(){return`kdef`+yt++}let xt=Math.PI/180,St=Number.MAX_VALUE,Ct=-Number.MAX_VALUE;function wt(e){return e/xt}let Tt=String.fromCharCode;function Et(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+=Tt(r):r<2048?(t+=Tt(192|r>>>6),t+=Tt(128|r&63)):r<65536?(t+=Tt(224|r>>>12),t+=Tt(128|r>>>6&63),t+=Tt(128|r&63)):r<1114111&&(t+=Tt(240|r>>>18),t+=Tt(128|r>>>12&63),t+=Tt(128|r>>>6&63),t+=Tt(128|r&63))}return t}function Dt(e){return Tt(e>>8)+Tt(e&255)}function Ot(e){let t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r<65535)t+=Dt(r);else{let e=(r-65536>>10)+55296,n=(r-65536&1023)+56320;t+=Dt(e),t+=Dt(n)}}return t}let kt=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`;function At(e){let t=``,n=0,r=Et(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+kt.charAt(o)+kt.charAt(s)+kt.charAt(c)+kt.charAt(l)}return t}function jt(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 Mt(e={}){return e.touch?e.touch.initialTouch:e.target}function Nt(e){return e===``||e===null||e===`none`||e===`transparent`||e===void 0}function D(e){if(e)return e[e.length-1]}function Pt(e,t,n){return Math.max(Math.min(e,n),t)}function Ft(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 It(e){return Promise.all(e)}function Lt(e){return e*xt}function Rt(e){return e?10**e:1}function O(e,t){let n=Rt(t);return Math.round(e*n)/n}function zt(e,t){return e===void 0?t:e}function Bt(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 Vt(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 Ht(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 Ut(e){return isNaN(e)?e:e+`px`}function Wt(e,t){if(t){let{width:n,height:r}=t;n!==void 0&&(e.style.width=Ut(n)),r!==void 0&&(e.style.height=Ut(r))}else{let t=Ht(e,[`width`,`height`]);return{width:parseInt(t.width,10),height:parseInt(t.height,10)}}}function Gt(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 Kt(e){let{paddingLeft:t,paddingTop:n}=Ht(e,[`paddingLeft`,`paddingTop`]);return{top:parseFloat(n),left:parseFloat(t)}}var k=class e extends E{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=O(this.a,e),this.b=O(this.b,e),this.c=O(this.c,e),this.d=O(this.d,e),this.e=O(this.e,e),this.f=O(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]=O(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(Lt(t)),i.b=Math.sin(Lt(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)}};k.IDENTITY=k.unit();let qt=/matrix\((.*)\)/;function Jt(e){let t=e.match(qt);return t===null||t.length!==2?k.unit():new k(...t[1].split(`,`).map(e=>parseFloat(e)))}function Yt(e){let t=getComputedStyle(e).transform;return t===`none`?k.unit():Jt(t)}function Xt(e){if(!e)return k.unit();let t=Yt(e),n=e.parentElement;for(;n;){let e=Yt(n);t=t.multiplyCopy(e),n=n.parentElement}return t.b=t.c=t.e=t.f=0,t}var Zt=class extends E{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 Qt=/\r?\n|\r|\t/g;function $t(e){return String(e).replace(Qt,` `)}function en(e){let t=[];for(let n in e)t.push(n+e[n]);return t.sort().join(``)}function tn(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 nn(){return{width:0,height:0,baseline:0}}let rn={baselineMarkerSize:1},an;typeof document<`u`&&(an=document.createElement(`div`),an.style.setProperty(`position`,`absolute`,`important`),an.style.setProperty(`top`,`-4000px`,`important`),an.style.setProperty(`width`,`auto`,`important`),an.style.setProperty(`height`,`auto`,`important`),an.style.setProperty(`padding`,`0`,`important`),an.style.setProperty(`margin`,`0`,`important`),an.style.setProperty(`border`,`0`,`important`),an.style.setProperty(`line-height`,`normal`,`important`),an.style.setProperty(`visibility`,`hidden`,`important`),an.style.setProperty(`white-space`,`pre`,`important`));var on=class extends E{constructor(e){super(),this._cache=new Zt(1e3),this.options=Object.assign({},rn,e)}measure(e,t,n={}){if(e==null)return nn();let r=tn(e+en(t)),i=this._cache.get(r);if(i)return i;let a=nn(),o=n.box||an,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):$t(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}};on.current=new on;function sn(e,t,n){return on.current.measure(e,t,n)}let cn=()=>typeof window<`u`,ln={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/},un={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/},dn={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},fn={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},pn=(e,t,n)=>{for(let n in t)if(t.hasOwnProperty(n)&&t[n].test(e))return n;return n===void 0?e:n},mn=e=>{let t,n=[];for(let r in ln)if(ln.hasOwnProperty(r)){if(n=e.match(ln[r]),!n)continue;if(r===`windows`&&`plugins`in window.navigator)return null;let i={};return i.device=r,i.browser=pn(e,fn,`default`),i.name=pn(r,un),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},hn=e=>{let t=null,n=[];for(let r in dn)if(dn.hasOwnProperty(r)&&(n=e.match(dn[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},gn=cn()&&window.navigator?window.navigator.userAgent:null,_n=gn?hn(gn):null;gn&&mn(gn),cn()&&`ontouchstart`in window,_n&&!_n.chrome&&window.MSPointerEvent,_n&&!_n.chrome&&window.PointerEvent;let vn={};vn.undefined=e=>e;let yn={};yn.undefined=e=>e;let bn=/\/\*[\s\S]*?\*\//g,xn=/([^\s:;]+?)\s*:\s*((?:(?:url\(\s*(?:(?:[^"')\\]|\\.)*|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')\s*\)|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|[^;"'])*?)\s*)(?=;|$)/gi,Sn=/"|"|"/gi,Cn=/'|'|'/gi;function wn(e){return e.replace(Sn,`"`).replace(Cn,`'`)}function Tn(e){let t={},n=wn((e||``).replace(bn,``)),r=xn.exec(n),i,a;for(;r!==null;)i=r[1].trim(),a=r[2].trim(),t[i]=a,r=xn.exec(n);return t}let En=(e,t)=>{let n=Tn(t);Object.keys(n).forEach(t=>{e.style[t]=n[t]})},Dn=`data-style`,On=e=>(e||``).replace(/\sstyle=/g,` data-style=`),kn=e=>{Array.from(e.querySelectorAll(`[data-style]`)).forEach(e=>{let t=e.getAttribute(Dn);e.removeAttribute(Dn),En(e,t)})},An=(e,t)=>{e.innerHTML=On(t),kn(e)},jn=(e,t)=>{let n=document.createElement(`div`);An(n,t),n.firstElementChild&&e.insertBefore(n.firstElementChild,e.firstChild)};var Mn=r({DEG_TO_RAD:()=>xt,LRUCache:()=>Zt,MAX_NUM:()=>St,MIN_NUM:()=>Ct,TextMetrics:()=>on,append:()=>mt,arabicToRoman:()=>gt,bindEvents:()=>Bt,createPromise:()=>_t,defined:()=>vt,definitionId:()=>bt,deg:()=>wt,elementOffset:()=>Vt,elementPadding:()=>Kt,elementScale:()=>Xt,elementSize:()=>Wt,elementStyles:()=>Ht,encodeBase64:()=>At,eventCoordinates:()=>jt,eventElement:()=>Mt,hashKey:()=>tn,isTransparent:()=>Nt,last:()=>D,limitValue:()=>Pt,measureText:()=>sn,mergeSort:()=>Ft,normalizeText:()=>$t,now:()=>Ue,objectKey:()=>en,promiseAll:()=>It,rad:()=>Lt,round:()=>O,setInnerHTML:()=>An,unbindEvents:()=>Gt,valueOrDefault:()=>zt});function Nn(e){return e&&typeof e.matrix==`function`?e.matrix():e}var A=class e extends pt(st,[`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(k.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=Nn(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=O(this.x,e),this.y=O(this.y,e),this.geometryChange(),this}toArray(e){let t=e!==void 0;return[t?O(this.x,e):this.x,t?O(this.y,e):this.y]}toString(e,t=` `){let{x:n,y:r}=this;return e!==void 0&&(n=O(n,e),r=O(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=St,n=St;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=Ct,n=Ct;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(Ct,Ct)}static maxPoint(){return new e(St,St)}static get ZERO(){return new e(0,0)}},Pn=class e extends pt(st,[`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?O(this.width,e):this.width,t?O(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 st{constructor(e=new A,t=new Pn,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`,Pn.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 Pn(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)))}},Fn=class e extends st{constructor(e=k.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(k.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(k.translate(r.x,r.y))),this._matrix=this._matrix.multiplyCopy(k.scale(e,t)),r&&(this._matrix=this._matrix.multiplyCopy(k.translate(-r.x,-r.y))),this._optionsChange(),this}rotate(e,t){let n=A.create(t)||A.ZERO;return this._matrix=this._matrix.multiplyCopy(k.rotate(e,n.x,n.y)),this._optionsChange(),this}multiply(e){let t=Nn(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 Fn?e:new Fn(e)}let In={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]},Ln=`butt`;var Rn=class extends st{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=bt()),this.options=new lt(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||k.unit()))}if(t)return M(t)}currentTransform(e=this.parentTransform()){let t=Nn(this.transform()),n=Nn(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=bt()),t.set(`clip`,e),this)}opacity(e){return e===void 0?zt(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`||!Nt(e.color))}_hasStroke(){let e=this.options.stroke;return e&&e.width>0&&!Nt(e.color)}_clippedBBox(e){return this.bbox(e)}};function zn(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 Bn=Math.PI/2;var Vn=class e extends pt(st,[`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(Lt(e))}bbox(e){let t=zn(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*Bn).transformCopy(e),o=this._pointAt(t.y+i*Bn).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 Hn=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)}},Un=k.IDENTITY.toString(),Wn=e=>class extends e{bbox(e){let t=Nn(this.currentTransform(e)),n=t?t.toString():Un,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 Gn(e){let t=`_`+e;return function(e){return e===void 0?this[t]:(this._observerField(t,e),this.geometryChange(),this)}}function Kn(e,t){for(let n=0;n<t.length;n++)e[t[n]]=Gn(t[n])}let qn=(e,t=[`geometry`])=>{let n=class extends e{};return Kn(n.prototype,t),n};var Jn=class extends Hn(Wn(qn(Rn))){get nodeType(){return`Circle`}constructor(e=new Vn,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 Yn(e,t,n=10){return O(Math.abs(e-t),n)===0}function Xn(e,t,n){return e<t||Yn(e,t,n)}function Zn(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 Qn=Math.pow,$n=[`radiusX`,`radiusY`,`startAngle`,`endAngle`,`anticlockwise`];var er=class e extends pt(st,$n){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=Lt(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=zn(this.center,this.radiusX,this.radiusY,e),a=wt(i.x),o=wt(i.y),s=this.pointAt(r).transformCopy(e),c=rr(a,n),l=rr(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=(Lt(t)-Lt(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=Lt(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(Qn(i,2)*Qn(Math.sin(s),2)+Qn(a,2)*Qn(Math.cos(s),2)),l=this.pointAt(this.startAngle).round(10),u=this.pointAt(this.endAngle).round(10),d=Zn(r,e.round(10),l,u),f;if(n<180)f=d&&Xn(r.distanceTo(d),o)&&Xn(o,c);else{let n=tr(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&&Xn(o,c)||!s&&(!d||d.equals(e))}return f}_isOnPath(e,t){let n=this._arcInterval(),r=this.center,i=tr(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=nr({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 tr(e,t,n,r,i,a){let o=O((i-e)/n,3),s=O((a-t)/r,3);return O(wt(Math.atan2(s,o)))}function nr(e){let{x1:t,y1:n,x2:r,y2:i,rx:a,ry:o,largeArc:s,swipe:c,rotation:l=0}=e,u=Lt(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,ne=(m-ee)/o,re=-(p+S)/a,ie=-(m+ee)/o,ae=(ne>=0?1:-1)*wt(Math.acos(w/Math.sqrt(w*w+ne*ne))),oe=O((w*re+ne*ie)/(Math.sqrt(w*w+ne*ne)*Math.sqrt(re*re+ie*ie)),10),se=(w*ie-ne*re>=0?1:-1)*wt(Math.acos(oe));!c&&se>0&&(se-=360),c&&se<0&&(se+=360);let ce=ae+se,le=ce>=0?1:-1;return ce=Math.abs(ce)%360*le,{center:new A(C,te),startAngle:ae,endAngle:ce,radiusX:a,radiusY:o,xRotation:l}}function rr(e,t){let n=e;for(;n<t;)n+=90;return n}let ir=[].splice,ar=[].slice;var or=class extends st{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 ar.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=ir.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(){}},sr=class extends or{_change(){this.geometryChange()}};function cr(e,t,n){let r=wt(Math.atan2(t.y-e.y,t.x-e.x));return n.transformCopy(M().rotate(-r,e)).x<e.x}function lr(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 ur(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 dr=class e extends E{constructor(e=0,t=0){super(),this.real=e,this.img=t}add(t){return new e(O(this.real+t.real,10),O(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 fr(e){return e<0?-1:1}function pr(e,t,n){let r=Math.sqrt(t**2-4*e*n);return[(-t+r)/(2*e),(-t-r)/(2*e)]}function mr(e,t,n,r){if(e===0)return pr(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 dr(0,1),c=-t/(3*e),l,u,d,f,p,m,h;o<0?(l=new dr(-a/2,Math.sqrt(-o)).nthRoot(3),u=new dr(-a/2,-Math.sqrt(-o)).nthRoot(3)):(l=-a/2+Math.sqrt(o),l=new dr(fr(l)*Math.abs(l)**(1/3)),u=-a/2-Math.sqrt(o),u=new dr(fr(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(O(d.real+c,10)),f.isReal()&&g.push(O(f.real+c,10)),p.isReal()&&g.push(O(p.real+c,10)),g}function hr(e,t,n,r,i){let a=ur(e,r),o=mr(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=lr(o[r],n,e),Math.abs(s-t[n])<=i))return!0}function gr(e,t,n){let r=ur(e,`x`),i=mr(r[0],r[1],r[2],r[3]-t.x),a,o,s=0;for(let r=0;r<i.length;r++)a=lr(i[r],`y`,e),o=Yn(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 _r(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 vr(e){let t=`_`+e;return function(e){return e===void 0?this[t]:(this._observerField(t,A.create(e)),this.geometryChange(),this)}}function yr(e,t){for(let n=0;n<t.length;n++)e[t[n]]=vr(t[n])}let br=(e,t)=>{let n=class extends e{};return yr(n.prototype,t),n},xr=[`anchor`,`controlIn`,`controlOut`];var Sr=class extends br(st,xr){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=Cr([a.min,a.max,e.x,r.x]),c=Cr([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:lr(n.min,t,e),max:lr(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()?gr([this.anchor(),this.controlOut(),e.controlIn(),e.anchor()],t,this.bboxTo(e)):_r(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!cr(i,a,t);if(r===`end`&&s.distanceTo(t)<=n)return!cr(s,o,t);let c=[i,a,o,s];if(hr(c,t,`x`,`y`,n)||hr(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 hr(u,t,`x`,`y`,n)||hr(u,t,`y`,`x`,n)}}_isOnLineTo(e,t,n){let r=this.anchor(),i=e.anchor(),a=wt(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 Cr(e){let t=e.length,n=St,r=Ct;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 wr=.333;function Tr(e,t){let n=e.slice(0),r=[],i=n.length;if(i>2&&(Er(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 Sr(a));a.equals(n[i-1]);)t=!0,n.pop(),i--;if(i===2){let e=Mr(a,o,`x`,`y`);return D(r).controlOut(Pr(e,a,o,`x`,`y`)),r.push(new Sr(o,Fr(e,a,o,`x`,`y`))),r}let c,l;if(t){a=n[i-1],o=n[0],s=n[1];let e=Ar(a,o,s);c=e[1],l=e[0]}else c=Pr(Mr(a,o,`x`,`y`),a,o,`x`,`y`);let u=c;for(let e=0;e<=i-3;e++)if(Er(e,n),i=n.length,e+3<=i){a=n[e],o=n[e+1],s=n[e+2];let t=Ar(a,o,s);D(r).controlOut(u),u=t[1];let i=t[0];r.push(new Sr(o,i))}if(t){a=n[i-2],o=n[i-1],s=n[0];let e=Ar(a,o,s);D(r).controlOut(u),r.push(new Sr(o,e[0])),D(r).controlOut(e[1]),r.push(new Sr(s,l))}else{let e=Mr(o,s,`x`,`y`);D(r).controlOut(u),r.push(new Sr(s,Fr(e,o,s,`x`,`y`)))}return r}function Er(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 Dr(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=Lr(kr(e,t),n.x);!(e.y<=t.y&&n.y<=i)&&!(t.y<=e.y&&n.y>=i)&&(r=!0)}return r}function Or(e,t,n){let r=Lr(kr(e,t),n.x);return e.x===t.x&&t.x===n.x||O(r,1)===O(n.y,1)}function kr(e,t){let n=(t.y-e.y)/(t.x-e.x);return[e.y-n*e.x,n]}function Ar(e,t,n){let r=`x`,i=`y`,a=!1,o=!1,s;if(Or(e,t,n))s=Mr(e,t,`x`,`y`);else{let c={x:Nr(e,t,n,`x`),y:Nr(e,t,n,`y`)};if(c.x&&c.y)s=Mr(e,n,`x`,`y`),a=!0;else if(Dr(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]?Rr((n[i]-e[i])*(t[r]-e[r])):-Rr((n[r]-e[r])*(t[i]-e[i])),s=.01*a,o=!0}}let c=Fr(s,e,t,r,i);if(o){let e=r;r=i,i=e}let l=Pr(s,t,n,r,i);return a&&(jr(e,t,c,s),jr(t,n,l,s)),[c,l]}function jr(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 Mr(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 Nr(e,t,n,r){return n[r]>t[r]&&t[r]>e[r]||n[r]<t[r]&&t[r]<e[r]}function Pr(e,t,n,r,i){let a=t[r],o=(n[r]-a)*wr;return Ir(a+o,t[i]+o*e,r,i)}function Fr(e,t,n,r,i){let a=t[r],o=n[r],s=(o-a)*wr;return Ir(o-s,n[i]-s*e,r,i)}function Ir(e,t,n,r){let i=new A;return i[n]=e,i[r]=t,i}function Lr(e,t){let n=e.length,r=0;for(let i=0;i<n;i++)r+=t**+i*e[i];return r}function Rr(e){return e<=0?-1:1}let zr={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;Br(t.parameters,!0,n),this.l(e,t)},h:function(e,t){let n=t.isRelative?0:t.position.y;Br(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=D(D(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?Vr(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=Ur(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=D(D(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?Vr(a,r):r.clone();let s=Ur(r,a,o);e.curveTo(s.controlOut,s.controlIn,o),r.x=o.x,r.y=o.y}}};function Br(e,t,n){let r=+!t;for(let t=0;t<e.length;t+=2)e.splice(t+r,0,n)}function Vr(e,t){if(e&&t)return t.scaleCopy(2).translate(-e.x,-e.y)}let Hr=1/3;function Ur(e,t,n){let r=t.clone().scale(2/3);return{controlOut:r.clone().translateWith(e.scaleCopy(Hr)),controlIn:r.translateWith(n.scaleCopy(Hr))}}let Wr=/([a-df-z]{1})([^a-df-z]*)(z)?/gi,Gr=/[,\s]?([+\-]?(?:\d*\.\d+|\d+)(?:[eE][+\-]?\d+)?)/g;function Kr(e){let t=[];return e.replace(Gr,function(e,n){t.push(parseFloat(n))}),t}function qr(e,t){let n=new A,r;return t.replace(Wr,(t,i,a,o)=>{let s=i.toLowerCase(),c=s===i,l=Kr(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))),zr[s])zr[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 Jr(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 Yr(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 Xr=e=>(...t)=>t.map(t=>t.toString(e)).join(` `),Zr=(e,t)=>e.controlOut()&&t.controlIn()?`C`:`L`;var N=class e extends Hn(Wn(Rn)){get nodeType(){return`Path`}constructor(e){super(e),this.segments=new sr,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 Sr(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=D(this.segments),i=new Sr(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=D(this.segments).anchor(),o=Lt(e),s=new er(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=D(this.segments).anchor(),s=er.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=Xr(e),o;for(let e=1;e<r;e++){let t=Zr(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+=_r(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),Pn.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 Qr.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=Pt(i,0,o/2),a=Pt(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=Tr(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}},Qr=class e extends Hn(Wn(Rn)){static parse(t,n){return qr(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 sr,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&&D(this.paths).lineTo(e,t),this}curveTo(e,t,n){return this.paths.length>0&&D(this.paths).curveTo(e,t,n),this}arc(e,t,n,r,i){return this.paths.length>0&&D(this.paths).arc(e,t,n,r,i),this}arcTo(e,t,n,r,i,a){return this.paths.length>0&&D(this.paths).arcTo(e,t,n,r,i,a),this}close(){return this.paths.length>0&&D(this.paths).close(),this}_bbox(e){return Jr(this.paths,!0,e)}rawBBox(){return Jr(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 Yr(this.paths,this.currentTransform(e))}},$r=class extends Hn(Wn(qn(Rn))){get nodeType(){return`Arc`}constructor(e=new er,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)}},ei=class extends Hn(br(Rn,[`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 sn(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=Nn(this.currentTransform(e));return this.rect().bbox(t)}rawBBox(){return this.rect().bbox()}_containsPoint(e){return this.rect().containsPoint(e)}},ti=class extends qn(Rn,[`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=Nn(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 ni=(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 ni(Rn,`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 mt(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 Jr(this.children,!0,this.currentTransform(e))}rawBBox(){return Jr(this.children,!1)}_clippedBBox(e){return Yr(this.children,this.currentTransform(e))}currentTransform(e){return Rn.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 ri(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 ii(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 ai(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 oi={alignContent:`start`,justifyContent:`start`,alignItems:`start`,spacing:0,orientation:`horizontal`,lineSpacing:0,wrap:!0,revers:!1},si=(e,t)=>{e.forEach(t)},ci=(e,t)=>{let n=e.length;for(let r=n-1;r>=0;r--)t(e[r],r)};var li=class extends P{constructor(e,t){super(Object.assign({},oi,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=ci,this.justifyAlign=ai):(this.forEach=si,this.justifyAlign=ii)}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 Pn,d=ii(r,t,e.alignContent,s,a),f,p,m,h=(t,n)=>{let r=p.elements[n];l[o]=f,l[s]=ii(t.size[a],m,e.alignItems,s,a),ri(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=ii(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:[]}}},ui=class extends Hn(Wn(qn(Rn))){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 di(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]=ii(o.size[i],t,n||`start`,r,i),ri(s,o,e[a])}}}function fi(e,t,n){di(e,t,n,`x`,`width`)}function pi(e,t,n){di(e,t,n,`y`,`height`)}function mi(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],ri(i,c,s),c.origin[t]=i[t],a=c}}}function hi(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 gi(e){mi(hi(e),`x`,`y`,`width`)}function _i(e){mi(hi(e),`y`,`x`,`height`)}function vi(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 yi(e,t,n,r,i){let a=vi(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],ri(o,c.bbox,c.element),c.bbox.origin[n]=o[n],mi(t,n,r,i),s.push([]);for(let n=0;n<t.length;n++)s[e].push(t[n].element)}return s}function bi(e,t){return yi(e,t,`x`,`y`,`width`)}function xi(e,t){return yi(e,t,`y`,`x`,`height`)}function Si(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 Ci=class extends or{_change(){this.optionsChange({field:`stops`})}};function wi(e){return function(t){return t===void 0?this.options.get(e):(this.options.set(e,t),this)}}function Ti(e,t){for(let n=0;n<t.length;n++)e[t[n]]=wi(t[n])}let Ei=(e,t)=>{let n=class extends e{};return Ti(n.prototype,t),n},Di=[`offset`,`color`,`opacity`];var Oi=class e extends Ei(st,Di){constructor(e,t,n){super(),this.options=new lt({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}}},ki=class extends st{get nodeType(){return`Gradient`}constructor(e={}){super(),this.stops=new Ci(this._createStops(e.stops)),this.stops.addObserver(this),this._userSpace=e.userSpace,this.id=bt()}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(Oi.create(e[n]));return t}addStop(e,t,n){this.stops.push(new Oi(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 Ai=[`start`,`end`];var ji=class extends br(ki,Ai){constructor(e={}){super(e),this.start(e.start||new A),this.end(e.end||new A(1,0))}},Mi=class extends br(ki,[`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 Ni=`#aba4a6`,Pi={width:2,gap:18},Fi={radius:10,gap:10},Ii={size:18,gap:2};var Li=class extends P{get nodeType(){return`Pattern`}constructor(e){super();let{width:t,height:n}=e;this._size=Pn.create([t,n]),this.id=bt()}size(e){return e?(this._size=Pn.create(e),this):this._size}};let Ri=(e,t,n)=>{t&&e.append(new ui(new j([0,0],n),{fill:{color:t},stroke:null}))};function zi(e={}){let{gap:t=Fi.gap,radius:n=Fi.radius,color:r=Ni,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 Li({width:o,height:o});return Ri(d,i,[o,o]),d.append(new Jn(new Vn(c,n),a),new Jn(new Vn(l,n),a),new Jn(new Vn(u,n),a)),d}function Bi(e={}){let{gap:t=Pi.gap,width:n=Pi.width,color:r=Ni,background:i}=e,a=n+t,o={fill:null,stroke:{color:r,width:n/2}},s=new Li({width:a,height:a});Ri(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 Vi(e={}){let{gap:t=Pi.gap,width:n=Pi.width,color:r=Ni,background:i}=e,a=Math.sqrt(2)*(n+t),o={fill:null,stroke:{color:r,width:n}},s=new Li({width:a,height:a});Ri(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 Hi(e={}){let{gap:t=Pi.gap,width:n=Pi.width,color:r=Ni,background:i}=e,a=Math.sqrt(2)*(n+t),o={fill:null,stroke:{color:r,width:n,lineCap:`square`}},s=new Li({width:a,height:a});Ri(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 Ui(e={}){let{gap:t=Ii.gap,size:n=Ii.size,color:r=Ni,background:i}=e,a=n+t,o=t/2,s={fill:{color:r},stroke:null},c=new Li({width:a,height:a});Ri(c,i,[a,a]);let l=new ui(new j([o,o],[n,n]),s);return c.append(l),c}var Wi=r({easeInOutBack:()=>ra,easeInOutCubic:()=>Yi,easeInOutExpo:()=>ta,easeInOutQuad:()=>Zi,easeInOutQuint:()=>aa,easeInOutSine:()=>$i,easeOutBack:()=>na,easeOutCirc:()=>Qi,easeOutCubic:()=>Ji,easeOutElastic:()=>qi,easeOutExpo:()=>ea,easeOutQuad:()=>Xi,easeOutQuint:()=>ia,linear:()=>Ki,swing:()=>Gi});function Gi(e){return .5-Math.cos(e*Math.PI)/2}function Ki(e){return e}function qi(e){return e===0||e===1?e:2**(-10*e)*Math.sin((e-.125)*(1.1*Math.PI)/.5)+1}function Ji(e){return 1-(1-e)**3}function Yi(e){return e<.5?4*e*e*e:1-(-2*e+2)**3/2}function Xi(e){return 1-(1-e)**2}function Zi(e){return e<.5?2*e*e:1-(-2*e+2)**2/2}function Qi(e){return Math.sqrt(1-(e-1)**2)}function $i(e){return-(Math.cos(Math.PI*e)-1)/2}function ea(e){return e===1?1:1-2**(-10*e)}function ta(e){return e===0||e===1?e:e<.5?2**(20*e-10)/2:(2-2**(-20*e+10))/2}function na(e){return 1+2.70158*(e-1)**3+1.70158*(e-1)**2}function ra(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 ia(e){return 1-(1-e)**5}function aa(e){return e<.5?16*e**5:1-(-2*e+2)**5/2}let oa;var sa=class e extends E{static get current(){return oa||=new e,oa}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 ca(e){return Math.min(1,Math.max(0,e))}function la(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=ca(e);return t===0||t===1?t:d(p(t))}}let ua={duration:500,easing:`swing`};var da=class extends E{static create(e,t,n){return sa.current.create(e,t,n)}get options(){return this._options||ua}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`&&Wi[e.easing]?e.easing=Wi[e.easing]:Array.isArray(e.easing)&&e.easing.length===4?e.easing=la(...e.easing):e.easing=Wi[ua.easing];let{duration:t,delay:n=0,easing:r}=e,i=Ue()+n,a=i+t;t===0?(this.step(1),this.abort()):setTimeout(()=>{let e=()=>{if(this._stopped)return;let n=Ue(),o=Pt(n-i,0,t),s=r(o/t);this.step(s),n<a?Me(e):this.abort()};e()},n)}abort(){this._stopped=!0}destroy(){this.abort()}};let fa;var pa=class e extends E{static get current(){return fa||=new e,fa}parse(e,t){return qr(new Qr(t),e)}},ma=class extends E{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 ha=[`click`,`mouseenter`,`mouseleave`,`mousemove`,`resize`];var ga=class extends Ee{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,Wt(e,this.options),this.bind(ha,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=Mt(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 Wt(this.element)}currentSize(e){if(e)this._size=e;else return this._size}setSize(e){Wt(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=Kt(e),{left:n,top:r}=Vt(e);return{left:n+t.left,top:r+t.top}}_surfacePoint(e){let t=this._elementOffset(),n=jt(e),r=n.x-t.left,i=n.y-t.top,a=Xt(this.element).invert();return new A(r,i).transform(a)}};function _a(e,t){return t==null?``:` ${e}="${t}" `}function va(e){let t=``;for(let n=0;n<e.length;n++)t+=_a(e[n][0],e[n][1]);return t}function ya(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 ba={},xa=`http://www.w3.org/2000/svg`,Sa=`none`,Ca=(e,t)=>{jn(e,t)},wa=(e,t)=>{let n=new DOMParser().parseFromString(On(t),`text/xml`);kn(n);let r=document.adoptNode(n.documentElement);e.insertBefore(r,e.firstChild)},Ta,Ea=(e,t)=>{if(Ta)return Ta(e,t);if(Ta=Ca,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`&&(Ta=wa)}return Ta(e,t)},Da=`transform`,Oa={clip:`clip-path`,fill:`fill`};function ka(e,t){return e===`clip`||e===`fill`&&(!t||t.nodeType===`Gradient`||t.nodeType===`Pattern`)}var Aa=class extends ma{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 ba[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`);Ea(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?``:Sa):Oa[t]&&ka(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`,Re(n)):this.removeAttr(`aria-label`):t===`ariaRoleDescription`?n?this.attr(`aria-roledescription`,Re(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([Da,`matrix(`+e.matrix().toString(6)+`)`]),t}renderTransform(){return va(this.mapTransform(this.srcElement.transform()))}transformChange(e){e?this.allAttr(this.mapTransform(e)):this.removeAttr(Da)}mapStyle(){let e=this.srcElement.options,t=[[`cursor`,e.cursor]];return e.visible===!1&&t.push([`display`,Sa]),t}renderStyle(){return _a(`style`,ya(this.mapStyle(!0)))}renderOpacity(){return _a(`opacity`,this.srcElement.options.opacity)}renderId(){return _a(`id`,this.srcElement.options.id)}renderClassName(){return _a(`class`,this.srcElement.options.className)}renderRole(){return _a(`role`,this.srcElement.options.role)}renderAriaLabel(){let e=this.srcElement.options.ariaLabel;return e&&=Re(e),_a(`aria-label`,e)}renderAriaRoleDescription(){let e=this.srcElement.options.ariaRoleDescription;return e&&=Re(e),_a(`aria-roledescription`,e)}renderAriaChecked(){return _a(`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 Oa){let i=n.get(e);i&&ka(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=Oa[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 va(this.mapDefinitions())}mapDefinitions(){let e=this.definitions,t=[];for(let n in e){let r=e[n];t.push([Oa[n],this.refUrl(r.id)])}return t}refUrl(e){return`url(#${e})`}},ja=class extends Aa{template(){return`<stop ${this.renderOffset()} ${this.renderStyle()} />`}renderOffset(){return _a(`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)}},Ma=class extends Aa{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 ja(e[n]);this.append(r),t&&r.attachTo(t)}}optionsChange(e){e.field===`gradient.stops`?(ma.prototype.clear.call(this),this.loadStops()):e.field===`gradient`&&this.allAttr(this.mapCoordinates())}renderCoordinates(){return va(this.mapCoordinates())}mapSpace(){return[`gradientUnits`,this.srcElement.userSpace()?`userSpaceOnUse`:`objectBoundingBox`]}},Na=class extends Ma{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()]}},Pa=class extends Ma{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()]}},Fa=class extends Aa{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>`}},Ia=class extends Aa{constructor(e){super(),this.srcElement=e,this.id=e.id,this.load([e])}renderClipRule(){return _a(`clip-rule`,`evenodd`)}template(){return`<clipPath ${this.renderClipRule()} id='${this.id}'>${this.renderChildren()}</clipPath>`}},La=class extends Aa{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=Ia:e===`fill`&&(t instanceof ji?n=Na:t instanceof Mi?n=Pa:t.nodeType===`Pattern`&&(n=Fa)),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]))}},Ra=class extends Aa{constructor(e){super(),this.options=e,this.defs=new La}attachTo(e){this.element=e,this.defs.attachTo(e.firstElementChild)}clear(){ma.prototype.clear.call(this)}template(){return this.defs.render()+this.renderChildren()}definitionChange(e){this.defs.definitionChange(e)}};let za={"fill.opacity":`fill-opacity`,"stroke.color":`stroke`,"stroke.width":`stroke-width`,"stroke.opacity":`stroke-opacity`};var Ba=class extends Aa{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=za[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&&!Nt(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`,Sa]),t}renderStroke(){return va(this.mapStroke(this.srcElement.options.stroke))}renderDashType(e){let{dashType:t,width:n=1}=e;if(t&&t!==`solid`){let e=In[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`?Ln:n}mapFill(e){let t=[];return e&&(e.nodeType===`Gradient`||e.nodeType===`Pattern`)||(e&&!Nt(e.color)?(t.push([`fill`,e.color]),e.opacity!==void 0&&t.push([`fill-opacity`,e.opacity])):t.push([`fill`,Sa])),t}renderFill(){return va(this.mapFill(this.srcElement.options.fill))}template(){return`<path ${this.renderId()} ${this.renderStyle()} ${this.renderOpacity()} ${_a(`d`,this.renderData())}${this.renderStroke()}${this.renderFill()}${this.renderDefinitions()}${this.renderTransform()}${this.renderClassName()} ${this.renderRole()}${this.renderAriaLabel()} ${this.renderAriaRoleDescription()}${this.renderAriaChecked()} ></path>`}},Va=class extends Ba{renderData(){return this.srcElement.toPath().toString(3)}},Ha=class extends Ba{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>`}},Ua=class extends Aa{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)}},Wa=class extends Ba{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 va(this.mapPosition())}mapSource(e){let t=this.srcElement.src();return e&&(t=Re(t)),[[`xlink:href`,t]]}renderSource(){return va(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>`}},Ga=class extends Ba{renderData(){return this.srcElement.toString(3)||`undefined`}},Ka=class extends Ba{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 qa=/&(?:[a-zA-Z]+|#\d+);/g;function Ja(e){if(!e||typeof e!=`string`||!qa.test(e))return e;let t=Ja._element;return qa.lastIndex=0,e.replace(qa,e=>(t.innerHTML=e,t.textContent||t.innerText))}typeof document<`u`&&(Ja._element=document.createElement(`span`));var Ya=class extends Ba{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`,ya(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=Re(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=Ja(e),e=Re(e),$t(e)}renderTextAnchor(){let e;return(this.options||{}).rtl&&!(He.browser.msie||He.browser.edge)&&(e=`end`),_a(`text-anchor`,e)}renderPaintOrder(){let e=this.srcElement.options.paintOrder;return e?_a(`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>`}};ba.Arc=Va,ba.Circle=Ha,ba.Group=Ua,ba.Image=Wa,ba.MultiPath=Ga,ba.Path=Ba,ba.Rect=Ka,ba.Text=Ya;function Xa(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 Za=class extends ga{get type(){return`svg`}constructor(e,t){super(e,t),this._root=new Ra(Object.assign({rtl:Ht(e,`direction`).direction===`rtl`},this.options)),Ea(this.element,this._template(``)),this._rootElement=this.element.firstElementChild,this._rootElement.style.width=`100%`,this._rootElement.style.height=`100%`,this._rootElement.style.overflow=`hidden`,Xa(this._rootElement),this._root.attachTo(this._rootElement),Bt(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,Gt(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='${xa}' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1'>${this._root.render()}</svg>`}};let Qa={};var $a=class extends ma{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 Qa[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 Qa[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}},eo=class extends ni($a,`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()}},to=class extends ni(eo,`childNodes`){constructor(e,t){super(),this.canvas=e,this.size=t,this.ctx=e.getContext(`2d`);let n=this._invalidate.bind(this);this.invalidate=We(()=>{Me(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)}},no=class extends E{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}}},ro=class e extends no{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++)mt(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 io=3e3,ao=BigInt(1e4);var oo=class extends E{constructor(){super(),this.initRoots()}initRoots(){this.rootMap={},this.root=new no,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/io)]||{})[Math.floor(e.y/io)],n=this.root.pointShapes(e);t&&(n=n.concat(t.pointShapes(e)));let r=uo(n);this.assignZindex(n,r),n.sort(so);for(let t=0;t<n.length;t++)if(n[t].containsPoint(e))return n[t]}assignZindex(e,t){let n=lo(ao,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/=ao;e[t]._zIndex=o,r.push(o)}r.sort(co);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];mt(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`?mt(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 ro(new j([r*io,i*io],[io,io]))),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/io),r=Math.floor(t.y/io),i=[[],[]];for(let t=Math.floor(e.origin.x/io);t<=n;t++)i[0].push(t);for(let t=Math.floor(e.origin.y/io);t<=r;t++)i[1].push(t);return i}};function so(e,t){return e._zIndex<t._zIndex?1:e._zIndex>t._zIndex?-1:0}function co(e,t){return e<t?-1:+(e>t)}function lo(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 uo(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 fo=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 po(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 mo(e,t){for(let n=0;n<t.length;n++){let r=t[n],i=nt(r.color());i.a*=r.opacity(),e.addColorStop(r.offset(),i.toCssRgba())}}var ho=class extends $a{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):Nt(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 ji){let n=t.start(),i=t.end();r=e.createLinearGradient(n.x,n.y,i.x,i.y)}else if(t instanceof Mi){let n=t.center();r=e.createRadialGradient(n.x,n.y,0,n.x,n.y,t.radius())}mo(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&&!Nt(t.color)&&t.width>0)return e.strokeStyle=t.color,e.lineWidth=zt(t.width,1),e.lineJoin=zt(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=In[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=Ln: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){po(e,t)}},go=class extends ho{renderPoints(e){po(e,this.srcElement.toPath())}},_o=class extends ho{renderPoints(e){let{center:t,radius:n}=this.srcElement.geometry();e.arc(t.x,t.y,n,0,Math.PI*2)}},vo=class extends ho{constructor(e,t){super(e),this.onLoad=this.onLoad.bind(this),this.onError=this.onError.bind(this),this.loading=_t();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=_t(),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())}},yo=class extends ho{renderPoints(e){let t=this.srcElement.paths;for(let n=0;n<t.length;n++)po(e,t[n])}},bo=class extends ho{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))}},xo=class extends ho{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)}};Qa.Arc=go,Qa.Circle=_o,Qa.Group=eo,Qa.Image=vo,Qa.MultiPath=yo,Qa.Path=ho,Qa.Rect=bo,Qa.Text=xo;var So=class extends ga{get type(){return`canvas`}constructor(e,t){super(e,t),jn(this.element,this._template(this));let n=this.element.firstElementChild;n.style.width=`100%`,n.style.height=`100%`;let r=Wt(e);n.width=r.width,n.height=r.height,this._rootElement=n,this._root=new to(n,r),this._mouseTrackHandler=this._trackMouse.bind(this),Bt(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),Gt(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=_t(),i=()=>{e._invalidate({fixedScale:!0});try{let e=t.toDataURL();r.resolve(e)}catch(e){r.reject(e)}};return It(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 oo;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 oo,this._cursor=new fo(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 Co,wo,To=()=>typeof document<`u`,Eo=()=>To()&&document.createElement(`canvas`).getContext,Do=()=>To()&&document.implementation.hasFeature(`http://www.w3.org/TR/SVG11/feature#BasicStructure`,`1.1`);var Oo=class e extends E{static get support(){return wo||={canvas:Eo(),svg:Do()},wo}static get current(){return Co||=new e,Co}constructor(){super(),this._items=[{name:`svg`,type:Za},{name:`canvas`,type:So}]}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);ze(`Warning: Unable to create Kendo UI Drawing Surface. Possible causes:
- The browser does not support SVG and Canvas. User agent: ${navigator.userAgent}`)}},ko=class extends ga{static get support(){return Oo.support}static create(e,t){return Oo.current.create(e,t)}};function Ao(e){let t=new Ra({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='${xa}' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1'>${t.render()}</svg>`;return t.destroy(),i}var jo=r({ArcNode:()=>Va,CircleNode:()=>Ha,ClipNode:()=>Ia,DefinitionNode:()=>La,GradientStopNode:()=>ja,GroupNode:()=>Ua,ImageNode:()=>Wa,LinearGradientNode:()=>Na,MultiPathNode:()=>Ga,Node:()=>Aa,PathNode:()=>Ba,RadialGradientNode:()=>Pa,RectNode:()=>Ka,RootNode:()=>Ra,Surface:()=>Za,TextNode:()=>Ya,exportGroup:()=>Ao}),Mo=r({ArcNode:()=>go,CircleNode:()=>_o,GroupNode:()=>eo,ImageNode:()=>vo,MultiPathNode:()=>yo,Node:()=>$a,PathNode:()=>ho,RectNode:()=>bo,RootNode:()=>to,Surface:()=>So,TextNode:()=>xo});function No(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 So(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 Po(e,t){let n=Ao(e);return(!t||!t.raw)&&(n=`data:image/svg+xml;base64,`+At(n)),_t().resolve(n)}var Fo=r({Animation:()=>da,AnimationFactory:()=>sa,Arc:()=>$r,BaseNode:()=>ma,Circle:()=>Jn,Element:()=>Rn,Gradient:()=>ki,GradientStop:()=>Oi,Group:()=>P,HasObservers:()=>st,Image:()=>ti,Layout:()=>li,LinearGradient:()=>ji,MultiPath:()=>Qr,OptionsStore:()=>lt,Path:()=>N,PathParser:()=>pa,Pattern:()=>Li,QuadNode:()=>ro,RadialGradient:()=>Mi,Rect:()=>ui,ShapesQuadTree:()=>oo,Surface:()=>ko,SurfaceFactory:()=>Oo,Text:()=>ei,align:()=>fi,canvas:()=>Mo,crosshatchPattern:()=>Vi,diagonalStripesPattern:()=>Hi,dotsPattern:()=>zi,exportImage:()=>No,exportSVG:()=>Po,fit:()=>Si,gridPattern:()=>Ui,parsePath:()=>qr,stack:()=>gi,svg:()=>jo,util:()=>Mn,vAlign:()=>pi,vStack:()=>_i,vWrap:()=>xi,verticalStripesPattern:()=>Bi,wrap:()=>bi});let Io=typeof Uint8Array<`u`&&He.browser&&(!He.browser.msie||He.browser.version>9),Lo=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 Ro(e){var t=0,n=0;e==null?e=Io?new Uint8Array(256):[]:n=e.length;var r=Io?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=Io?function(){return new Uint8Array(e.buffer,0,n)}:function(){return e},a=Io?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=Io?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(Lo.decode(e))},base64:function(){return Lo.encode(i())}};return w}function zo(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 Bo=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 Bo{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=Ro();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 Bo{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=Ro(),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 Bo{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=Ro();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 Bo{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=Ro();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 Bo{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=Ro(),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 Bo{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=Ro(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 Bo{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 Vo(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ho(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)Vo(n,r)&&(e[r]=n[r])}}return e}function Uo(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)}var Wo={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)}},Go={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 Ko=()=>{let e=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Int32Array<`u`;return Ko=()=>e,e},qo=(e,t,n,r,i)=>(qo=Ko()?Wo.arraySet:Go.arraySet,qo(e,t,n,r,i)),Jo=e=>(Jo=Ko()?Wo.flattenChunks:Go.flattenChunks,Jo(e)),Yo=e=>(Yo=Ko()?Wo.Buf8:Go.Buf8,Yo(e)),Xo=e=>(Xo=Ko()?Wo.Buf16:Go.Buf16,Xo(e)),Zo=e=>(Zo=Ko()?Wo.Buf32:Go.Buf32,Zo(e)),Qo=function(){let e=!0;try{String.fromCharCode.apply(null,[0])}catch{e=!1}return Qo=()=>e,e},$o=function(){let e=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{e=!1}return $o=()=>e,e},es=function(e){for(var t=Yo(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,es=e=>t[e],t[e]};function ts(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 ns(e,t){if(t<65534&&(e.subarray&&$o()||!e.subarray&&Qo()))return String.fromCharCode.apply(null,Uo(e,t));for(var n=``,r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n}function rs(e){return ns(e,e.length)}function is(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 as(){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 os=function(){let e=as();return os=()=>e,e};function ss(e,t,n,r){var i=os(),a=r+n;e^=-1;for(var o=r;o<a;o++)e=e>>>8^i[(e^t[o])&255];return e^-1}var cs={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 ls(){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 us(e){for(var t=e.length;--t>=0;)e[t]=0}var ds=0,fs=1,ps=2,ms=3,hs=258,gs=29,_s=256,vs=_s+1+gs,ys=30,bs=19,xs=2*vs+1,Ss=15,Cs=16,ws=7,Ts=256,Es=16,Ds=17,Os=18,ks=[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],As=[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],js=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Ms=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Ns=512,Ps,Fs,Is,Ls,Rs,zs;function Bs(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 Vs,Hs,Us;function Ws(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function Gs(e){return e<256?Is[e]:Is[256+(e>>>7)]}function Ks(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function qs(e,t,n){e.bi_valid>Cs-n?(e.bi_buf|=t<<e.bi_valid&65535,Ks(e,e.bi_buf),e.bi_buf=t>>Cs-e.bi_valid,e.bi_valid+=n-Cs):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function Js(e,t,n){qs(e,n[t*2],n[t*2+1])}function Ys(e,t){var n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1}function Xs(e){e.bi_valid===16?(Ks(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 Zs(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<=Ss;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<xs;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 Qs(e,t,n){var r=Array(Ss+1),i=0,a,o;for(a=1;a<=Ss;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]=Ys(r[s]++,s))}}function $s(){var e,t,n,r,i,a=Array(Ss+1);for(Ps=Array((vs+2)*2),us(Ps),Fs=Array(ys*2),us(Fs),Is=Array(Ns),us(Is),Ls=Array(hs-ms+1),us(Ls),Rs=Array(gs),us(Rs),zs=Array(ys),us(zs),n=0,r=0;r<gs-1;r++)for(Rs[r]=n,e=0;e<1<<ks[r];e++)Ls[n++]=r;for(Ls[n-1]=r,i=0,r=0;r<16;r++)for(zs[r]=i,e=0;e<1<<As[r];e++)Is[i++]=r;for(i>>=7;r<ys;r++)for(zs[r]=i<<7,e=0;e<1<<As[r]-7;e++)Is[256+i++]=r;for(t=0;t<=Ss;t++)a[t]=0;for(e=0;e<=143;)Ps[e*2+1]=8,e++,a[8]++;for(;e<=255;)Ps[e*2+1]=9,e++,a[9]++;for(;e<=279;)Ps[e*2+1]=7,e++,a[7]++;for(;e<=287;)Ps[e*2+1]=8,e++,a[8]++;for(Qs(Ps,vs+1,a),e=0;e<ys;e++)Fs[e*2+1]=5,Fs[e*2]=Ys(e,5);Vs=new Bs(Ps,ks,_s+1,vs,Ss),Hs=new Bs(Fs,As,0,ys,Ss),Us=new Bs([],js,0,bs,ws)}function ec(e){var t;for(t=0;t<vs;t++)e.dyn_ltree[t*2]=0;for(t=0;t<ys;t++)e.dyn_dtree[t*2]=0;for(t=0;t<bs;t++)e.bl_tree[t*2]=0;e.dyn_ltree[Ts*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function tc(e){e.bi_valid>8?Ks(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 nc(e,t,n,r){tc(e),r&&(Ks(e,n),Ks(e,~n)),qo(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}function rc(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 ic(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&rc(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!rc(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function ac(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?Js(e,i,t):(o=Ls[i],Js(e,o+_s+1,t),s=ks[o],s!==0&&(i-=Rs[o],qs(e,i,s)),r--,o=Gs(r),Js(e,o,n),s=As[o],s!==0&&(r-=zs[o],qs(e,r,s)));while(a<e.last_lit);Js(e,Ts,t)}function oc(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=xs,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--)ic(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ic(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++,ic(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Zs(e,t),Qs(n,c,e.bl_count)}function sc(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[Ds*2]++:e.bl_tree[Os*2]++:(a!==i&&e.bl_tree[a*2]++,e.bl_tree[Es*2]++),s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))}function cc(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 Js(e,a,e.bl_tree);while(--s!==0);else a===0?s<=10?(Js(e,Ds,e.bl_tree),qs(e,s-3,3)):(Js(e,Os,e.bl_tree),qs(e,s-11,7)):(a!==i&&(Js(e,a,e.bl_tree),s--),Js(e,Es,e.bl_tree),qs(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 lc(e){var t;for(sc(e,e.dyn_ltree,e.l_desc.max_code),sc(e,e.dyn_dtree,e.d_desc.max_code),oc(e,e.bl_desc),t=bs-1;t>=3&&e.bl_tree[Ms[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function uc(e,t,n,r){var i;for(qs(e,t-257,5),qs(e,n-1,5),qs(e,r-4,4),i=0;i<r;i++)qs(e,e.bl_tree[Ms[i]*2+1],3);cc(e,e.dyn_ltree,t-1),cc(e,e.dyn_dtree,n-1)}function dc(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<_s;n++)if(e.dyn_ltree[n*2]!==0)return 1;return 0}var fc=!1;function pc(e){fc||=($s(),!0),e.l_desc=new Ws(e.dyn_ltree,Vs),e.d_desc=new Ws(e.dyn_dtree,Hs),e.bl_desc=new Ws(e.bl_tree,Us),e.bi_buf=0,e.bi_valid=0,ec(e)}function mc(e,t,n,r){qs(e,(ds<<1)+ +!!r,3),nc(e,t,n,!0)}function hc(e){qs(e,fs<<1,3),Js(e,Ts,Ps),Xs(e)}function gc(e,t,n,r){var i,a,o=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=dc(e)),oc(e,e.l_desc),oc(e,e.d_desc),o=lc(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?mc(e,t,n,r):e.strategy===4||a===i?(qs(e,(fs<<1)+ +!!r,3),ac(e,Ps,Fs)):(qs(e,(ps<<1)+ +!!r,3),uc(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),ac(e,e.dyn_ltree,e.dyn_dtree)),ec(e),r&&tc(e)}function _c(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[(Ls[n]+_s+1)*2]++,e.dyn_dtree[Gs(t)*2]++),e.last_lit===e.lit_bufsize-1}var vc=9,yc=286,bc=30,xc=19,Sc=2*yc+1,Cc=15,F=3,wc=258,Tc=wc+F+1,Ec=32,Dc=42,Oc=69,kc=73,Ac=91,jc=103,Mc=113,Nc=666,I=1,Pc=2,Fc=3,Ic=4,Lc=3;function Rc(e,t){return e.msg=cs[t],t}function zc(e){return(e<<1)-(e>4?9:0)}function Bc(e){for(var t=e.length;--t>=0;)e[t]=0}function Vc(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(qo(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 L(e,t){gc(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Vc(e.strm)}function R(e,t){e.pending_buf[e.pending++]=t}function Hc(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function Uc(e,t,n,r){var i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,qo(t,e.input,e.next_in,i,n),e.state.wrap===1?e.adler=is(e.adler,t,i,n):e.state.wrap===2&&(e.adler=ss(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)}function Wc(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-Tc?e.strstart-(e.w_size-Tc):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+wc,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=wc-(f-r),r=f-wc,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 Gc(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-Tc)){qo(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=Uc(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<Tc&&e.strm.avail_in!==0)}function Kc(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Gc(e),e.lookahead===0&&t===0)return I;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,L(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-Tc&&(L(e,!1),e.strm.avail_out===0))return I}return e.insert=0,t===4?(L(e,!0),e.strm.avail_out===0?Fc:Ic):(e.strstart>e.block_start&&(L(e,!1),e.strm.avail_out),I)}function qc(e,t){for(var n,r;;){if(e.lookahead<Tc){if(Gc(e),e.lookahead<Tc&&t===0)return I;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-Tc&&(e.match_length=Wc(e,n)),e.match_length>=F)if(r=_c(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=_c(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(L(e,!1),e.strm.avail_out===0))return I}return e.insert=e.strstart<F-1?e.strstart:F-1,t===4?(L(e,!0),e.strm.avail_out===0?Fc:Ic):e.last_lit&&(L(e,!1),e.strm.avail_out===0)?I:Pc}function Jc(e,t){for(var n,r,i;;){if(e.lookahead<Tc){if(Gc(e),e.lookahead<Tc&&t===0)return I;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-Tc&&(e.match_length=Wc(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=_c(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&&(L(e,!1),e.strm.avail_out===0))return I}else if(e.match_available){if(r=_c(e,0,e.window[e.strstart-1]),r&&L(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return I}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(r=_c(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<F-1?e.strstart:F-1,t===4?(L(e,!0),e.strm.avail_out===0?Fc:Ic):e.last_lit&&(L(e,!1),e.strm.avail_out===0)?I:Pc}function Yc(e,t){for(var n,r,i,a,o=e.window;;){if(e.lookahead<=wc){if(Gc(e),e.lookahead<=wc&&t===0)return I;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+wc;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=wc-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=F?(n=_c(e,1,e.match_length-F),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=_c(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(L(e,!1),e.strm.avail_out===0))return I}return e.insert=0,t===4?(L(e,!0),e.strm.avail_out===0?Fc:Ic):e.last_lit&&(L(e,!1),e.strm.avail_out===0)?I:Pc}function Xc(e,t){for(var n;;){if(e.lookahead===0&&(Gc(e),e.lookahead===0)){if(t===0)return I;break}if(e.match_length=0,n=_c(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(L(e,!1),e.strm.avail_out===0))return I}return e.insert=0,t===4?(L(e,!0),e.strm.avail_out===0?Fc:Ic):e.last_lit&&(L(e,!1),e.strm.avail_out===0)?I:Pc}function Zc(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 Qc=function(){let e=[new Zc(0,0,0,0,Kc),new Zc(4,4,8,4,qc),new Zc(4,5,16,8,qc),new Zc(4,6,32,32,qc),new Zc(4,4,16,16,Jc),new Zc(8,16,32,32,Jc),new Zc(8,16,128,128,Jc),new Zc(8,32,128,256,Jc),new Zc(32,128,258,1024,Jc),new Zc(32,258,258,4096,Jc)];return Qc=()=>e,e};function $c(e){e.window_size=2*e.w_size,Bc(e.head);let t=Qc();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 el(){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=Xo(Sc*2),this.dyn_dtree=Xo((2*bc+1)*2),this.bl_tree=Xo((2*xc+1)*2),Bc(this.dyn_ltree),Bc(this.dyn_dtree),Bc(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=Xo(Cc+1),this.heap=Xo(2*yc+1),Bc(this.heap),this.heap_len=0,this.heap_max=0,this.depth=Xo(2*yc+1),Bc(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 tl(e){var t;return!e||!e.state?Rc(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?Dc:Mc,e.adler=t.wrap===2?0:1,t.last_flush=0,pc(t),0)}function nl(e){var t=tl(e);return t===0&&$c(e.state),t}function rl(e,t){return!e||!e.state||e.state.wrap!==2?-2:(e.state.gzhead=t,0)}function il(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>vc||n!==8||r<8||r>15||t<0||t>9||a<0||a>4)return Rc(e,-2);r===8&&(r=9);var s=new el;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=Yo(s.w_size*2),s.head=Xo(s.hash_size),s.prev=Xo(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=Yo(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,nl(e)}function al(e,t){var n,r,i,a;if(!e||!e.state||t>5||t<0)return e?Rc(e,-2):-2;if(r=e.state,!e.output||!e.input&&e.avail_in!==0||r.status===Nc&&t!==4)return Rc(e,e.avail_out===0?-5:-2);if(r.strm=e,n=r.last_flush,r.last_flush=t,r.status===Dc)if(r.wrap===2)e.adler=0,R(r,31),R(r,139),R(r,8),r.gzhead?(R(r,+!!r.gzhead.text+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),R(r,r.gzhead.time&255),R(r,r.gzhead.time>>8&255),R(r,r.gzhead.time>>16&255),R(r,r.gzhead.time>>24&255),R(r,r.level===9?2:r.strategy>=2||r.level<2?4:0),R(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(R(r,r.gzhead.extra.length&255),R(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=ss(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Oc):(R(r,0),R(r,0),R(r,0),R(r,0),R(r,0),R(r,r.level===9?2:r.strategy>=2||r.level<2?4:0),R(r,Lc),r.status=Mc);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|=Ec),o+=31-o%31,r.status=Mc,Hc(r,o),r.strstart!==0&&(Hc(r,e.adler>>>16),Hc(r,e.adler&65535)),e.adler=1}if(r.status===Oc)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=ss(e.adler,r.pending_buf,r.pending-i,i)),Vc(e),i=r.pending,r.pending===r.pending_buf_size));)R(r,r.gzhead.extra[r.gzindex]&255),r.gzindex++;r.gzhead.hcrc&&r.pending>i&&(e.adler=ss(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=kc)}else r.status=kc;if(r.status===kc)if(r.gzhead.name){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=ss(e.adler,r.pending_buf,r.pending-i,i)),Vc(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,R(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(e.adler=ss(e.adler,r.pending_buf,r.pending-i,i)),a===0&&(r.gzindex=0,r.status=Ac)}else r.status=Ac;if(r.status===Ac)if(r.gzhead.comment){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=ss(e.adler,r.pending_buf,r.pending-i,i)),Vc(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,R(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(e.adler=ss(e.adler,r.pending_buf,r.pending-i,i)),a===0&&(r.status=jc)}else r.status=jc;if(r.status===jc&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&Vc(e),r.pending+2<=r.pending_buf_size&&(R(r,e.adler&255),R(r,e.adler>>8&255),e.adler=0,r.status=Mc)):r.status=Mc),r.pending!==0){if(Vc(e),e.avail_out===0)return r.last_flush=-1,0}else if(e.avail_in===0&&zc(t)<=zc(n)&&t!==4)return Rc(e,-5);if(r.status===Nc&&e.avail_in!==0)return Rc(e,-5);if(e.avail_in!==0||r.lookahead!==0||t!==0&&r.status!==Nc){var c=r.strategy===2?Xc(r,t):r.strategy===3?Yc(r,t):Qc()[r.level].func(r,t);if((c===Fc||c===Ic)&&(r.status=Nc),c===I||c===Fc)return e.avail_out===0&&(r.last_flush=-1),0;if(c===Pc&&(t===1?hc(r):t!==5&&(mc(r,0,0,!1),t===3&&(Bc(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),Vc(e),e.avail_out===0))return r.last_flush=-1,0}return t===4?r.wrap<=0?1:(r.wrap===2?(R(r,e.adler&255),R(r,e.adler>>8&255),R(r,e.adler>>16&255),R(r,e.adler>>24&255),R(r,e.total_in&255),R(r,e.total_in>>8&255),R(r,e.total_in>>16&255),R(r,e.total_in>>24&255)):(Hc(r,e.adler>>>16),Hc(r,e.adler&65535)),Vc(e),r.wrap>0&&(r.wrap=-r.wrap),+(r.pending===0)):0}function ol(e){var t;return!e||!e.state?-2:(t=e.state.status,t!==Dc&&t!==Oc&&t!==kc&&t!==Ac&&t!==jc&&t!==Mc&&t!==Nc?Rc(e,-2):(e.state=null,t===Mc?Rc(e,-3):0))}function sl(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!==Dc||r.lookahead))return-2;for(o===1&&(e.adler=is(e.adler,t,n,0)),r.wrap=0,n>=r.w_size&&(o===0&&(Bc(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=Yo(r.w_size),qo(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,Gc(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,Gc(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 cl=Object.prototype.toString,ll=class{constructor(e){this.options=Ho({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 ls,this.strm.avail_out=0;var n=il(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==0)throw Error(cs[n]);if(t.header&&rl(this.strm,t.header),t.dictionary){var r=typeof t.dictionary==`string`?ts(t.dictionary):cl.call(t.dictionary)===`[object ArrayBuffer]`?new Uint8Array(t.dictionary):t.dictionary;if(n=sl(this.strm,r),n!==0)throw Error(cs[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=ts(e):cl.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=Yo(r),n.next_out=0,n.avail_out=r),i=al(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(rs(Uo(n.output,n.next_out))):this.onData(Uo(n.output,n.next_out)))}while((n.avail_in>0||n.avail_out===0)&&i!==1);return a===4?(i=ol(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=Jo(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg}};function ul(e,t){var n=new ll(t);if(n.push(e,!0),n.err)throw n.msg||cs[n.err];return n.result}let dl=ul;function fl(){return!0}He.browser;var pl=0;let ml=0;function hl(){var e=0,t=Ro();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 Cl)r.beforeRender(n),r.render(n);else if(yl(r))xl(r,n);else if(bl(r))Sl(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 B(r)):t.writeString(`null`))}}return n.writeData=function(e){t.write(e)},n.withIndent=function(t){++e,t(n),--e},n.indent=function(){n(`
`,gl(``,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 gl(e,t,n){for(;e.length<t;)e=n+e;return e}function _l(e,t){return gl(String(e),t,`0`)}function vl(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var yl=Array.isArray||function(e){return e instanceof Array};function bl(e){return e instanceof Date}function xl(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 Sl(e,t){t(`(D:`,_l(e.getUTCFullYear(),4),_l(e.getUTCMonth()+1,2),_l(e.getUTCDate(),2),_l(e.getUTCHours(),2),_l(e.getUTCMinutes(),2),_l(e.getUTCSeconds(),2),`Z)`)}var Cl=class{beforeRender(){}},wl=class extends Cl{constructor(e,t){super(),this.value=e,this.utf16be=!!t}render(e){let t=this.value;if(this.utf16be)t=`þÿ`+Ot(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}},Tl=class extends wl{constructor(e){super(e),this.value=e}render(e){e(`<`);for(var t=0;t<this.value.length;++t)e(_l(this.value.charCodeAt(t).toString(16),4));e(`>`)}},El=class extends Cl{static get(e){return z(e)}constructor(e){super(),this.name=e}render(e){e(`/`+this.escape())}escape(){return this.name.replace(/[^\x21-\x7E]/g,function(e){return`#`+_l(e.charCodeAt(0).toString(16),2)})}toString(){return this.name}};function z(e){return new El(e)}var B=class extends Cl{constructor(e){super(),this.props=e}render(e){var t=this.props,n=!0;e(`<<`),e.withIndent(function(){for(var r in t)vl(t,r)&&!/^_/.test(r)&&(n=!1,e.indent(z(r),` `,t[r]))}),n||e.indent(),e(`>>`)}},Dl=class extends Cl{constructor(e,t,n){if(super(),typeof e==`string`){var r=Ro();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&&fl()&&(n.Filter?n.Filter instanceof Array||(n.Filter=[n.Filter]):n.Filter=[],n.Filter.unshift(z(`FlateDecode`)),t=dl(t)),n.Length=t.length,e(new B(n),` stream`,`
`),e.writeData(t),e(`
`,`endstream`)}};(class extends B{constructor(){super({Type:z(`Catalog`)})}setPages(e){this.props.Pages=e}}),class extends B{constructor(){super({Type:z(`Pages`),Kids:[],Count:0})}addPage(e){this.props.Kids.push(e),this.props.Count++}},class extends B{constructor(e,t,n){let{width:r,height:i}=e.size(),a=new Ll(t._pdf,{});a._content=new Dl(hl(),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:z(`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 B(a._gsResources),XObject:new B(a._xResources),Font:new B(a._fontResources)}}),this._resourceName=z(`P`+ ++ml),this.data=a._content.data,this.compress=!0}render(e){Dl.prototype.render.call(this,e)}},class extends B{constructor(e){super({Type:z(`Font`),Subtype:z(`Type1`),BaseFont:z(e)}),this._resourceName=z(`F`+ ++pl)}encodeText(e){return new wl(String(e))}};var Ol=class extends B{constructor(e,t,n){super({}),n=this.props,n.Type=z(`Font`),n.Subtype=z(`Type0`),n.Encoding=z(`Identity-H`),this._pdf=e,this._font=t,this._sub=t.makeSubset(),this._resourceName=z(`F`+ ++pl);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 Tl(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 Dl(Ro(n),{Length1:n.length},!0),i=e._pdf.attach(new B({Type:z(`FontDescriptor`),FontName:z(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 B({Type:z(`Font`),Subtype:z(`CIDFontType2`),BaseFont:z(e._sub.psName),CIDSystemInfo:new B({Registry:new wl(`Adobe`),Ordering:new wl(`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=z(e._sub.psName),u.DescendantFonts=[e._pdf.attach(l)];var d=new kl(o,s,t.subset),f=new Dl(hl(),null,!0);f.data(d),u.ToUnicode=e._pdf.attach(f)}_makeCidToGidMap(){return new Dl(Ro(this._sub.cidToGidMap()),null,!0)}},kl=class extends Cl{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=zo([r]);e.indent(`<`,_l(n.toString(16),4),`>`,`<`);for(var a=0;a<i.length;++a)e(_l(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 Al(e){return e.map(function(e){return yl(e)?Al(e):typeof e==`number`?(Math.round(e*1e3)/1e3).toFixed(3):e}).join(` `)}function jl(e,t,n,r,i,a,o){var s=Al([t,n,r,i,a,o]),c=e.GRAD_COL_FUNCTIONS[s];return c||=e.GRAD_COL_FUNCTIONS[s]=e.attach(new B({FunctionType:2,Domain:[0,1],Range:[0,1,0,1,0,1],N:1,C0:[t,n,r],C1:[i,a,o]})),c}function Ml(e,t,n){var r=Al([t,n]),i=e.GRAD_OPC_FUNCTIONS[r];return i||=e.GRAD_OPC_FUNCTIONS[r]=e.attach(new B({FunctionType:2,Domain:[0,1],Range:[0,1],N:1,C0:[t],C1:[n]})),i}function Nl(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(jl(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(Ml(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 Pl(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=Al(c),o=e.GRAD_COL[s]}return o||(o=new B({Type:z(`Shading`),ShadingType:t?3:2,ColorSpace:z(`DeviceRGB`),Coords:r,Domain:[0,1],Function:i,Extend:[!0,!0]}),e.attach(o),o._resourceName=`S`+ ++pl,s&&(e.GRAD_COL[s]=o)),o}function Fl(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=Al(c),o=e.GRAD_OPC[s]}return o||(o=new B({Type:z(`ExtGState`),AIS:!1,CA:1,ca:1,SMask:{Type:z(`Mask`),S:z(`Luminosity`),G:e.attach(new Dl(`/a0 gs /s0 sh`,{Type:z(`XObject`),Subtype:z(`Form`),FormType:1,BBox:a?[a.left,a.top+a.height,a.left+a.width,a.top]:[0,1,1,0],Group:{Type:z(`Group`),S:z(`Transparency`),CS:z(`DeviceGray`),I:!0},Resources:{ExtGState:{a0:{CA:1,ca:1}},Shading:{s0:{ColorSpace:z(`DeviceGray`),Coords:r,Domain:[0,1],ShadingType:t?3:2,Function:i,Extend:[!0,!0]}}}}))}}),e.attach(o),o._resourceName=`O`+ ++pl,s&&(e.GRAD_OPC[s]=o)),o}function Il(e,t,n){var r=t.type==`radial`,i=Nl(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=Pl(e,r,t.stops,a,i.colors,t.userSpace&&n),s=i.hasAlpha?Fl(e,r,t.stops,a,i.opacities,t.userSpace&&n):null;return{hasAlpha:i.hasAlpha,shading:o,opacity:s}}var Ll=class extends B{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=z(`Page`),t.ProcSet=[z(`PDF`),z(`Text`),z(`ImageB`),z(`ImageC`),z(`ImageI`)],t.Resources=new B({Font:new B(this._fontResources),ExtGState:new B(this._gsResources),XObject:new B(this._xResources),Pattern:new B(this._patResources),Shading:new B(this._shResources)}),t.Annots=this._annotations}_out(){this._content.data.apply(null,arguments)}transform(e,t,n,r,i,a){Wl(arguments)||(this._matrix=Ul(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 Ol||(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 Ol){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 B({Type:z(`Annot`),Subtype:z(`Link`),Rect:[n.x,n.y,r.x,r.y],Border:[0,0,0],A:new B({Type:z(`Action`),S:z(`URI`),URI:new wl(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=Il(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 Rl(e){return e.replace(/^\s*(['"])(.*)\1\s*$/,`$2`)}function zl(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(Rl)}}function Bl(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=V[r],!i);++a);else i=V[n.toLowerCase()];for(;typeof i==`function`;)i=i();return i||=`Times-Roman`,i}var V={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 Vl(e,t){e=e.toLowerCase(),V[e]=function(){return V[t]},V[e+`|bold`]=function(){return V[t+`|bold`]},V[e+`|italic`]=function(){return V[t+`|italic`]},V[e+`|bold|italic`]=function(){return V[t+`|bold|italic`]}}Vl(`Times New Roman`,`serif`),Vl(`Courier New`,`monospace`),Vl(`Arial`,`sans-serif`),Vl(`Helvetica`,`sans-serif`),Vl(`Verdana`,`sans-serif`),Vl(`Tahoma`,`sans-serif`),Vl(`Georgia`,`sans-serif`),Vl(`Monaco`,`monospace`),Vl(`Andale Mono`,`monospace`);function Hl(e,t){if(arguments.length==1)for(var n in e)vl(e,n)&&Hl(n,e[n]);else switch(e=e.toLowerCase(),V[e]=t,e){case`dejavu sans`:V[`sans-serif`]=t;break;case`dejavu sans|bold`:V[`sans-serif|bold`]=t;break;case`dejavu sans|italic`:V[`sans-serif|italic`]=t;break;case`dejavu sans|bold|italic`:V[`sans-serif|bold|italic`]=t;break;case`dejavu serif`:V.serif=t;break;case`dejavu serif|bold`:V[`serif|bold`]=t;break;case`dejavu serif|italic`:V[`serif|italic`]=t;break;case`dejavu serif|bold|italic`:V[`serif|bold|italic`]=t;break;case`dejavu mono`:V.monospace=t;break;case`dejavu mono|bold`:V[`monospace|bold`]=t;break;case`dejavu mono|italic`:V[`monospace|italic`]=t;break;case`dejavu mono|bold|italic`:V[`monospace|bold|italic`]=t;break}}function Ul(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 Wl(e){return e[0]===1&&e[1]===0&&e[2]===0&&e[3]===1&&e[4]===0&&e[5]===0}let Gl={fill:0,stroke:1,fillAndStroke:2,invisible:3,fillAndClip:4,strokeAndClip:5,fillStrokeClip:6,clip:7},Kl={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:[]},ql={butt:0,round:1,square:2},Jl={miter:0,round:1,bevel:2};function Yl(e,t){var n=e[t.nodeType];return n?n.call.apply(n,arguments):t}function Xl(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),Zl(e,t,n),Ql(e,t,n),r){var a=r.matrix();t.transform(a.a,a.b,a.c,a.d,a.e,a.f)}$l(e,t,n),Yl({Path:ou,MultiPath:su,Circle:cu,Arc:lu,Text:uu,Image:pu,Group:fu,Rect:mu},e,t,n),t.restore(),e.options._pdfDebug&&t.comment(`END: `+e.options._pdfDebug)}function Zl(e,t){var n=e.stroke&&e.stroke();if(n){var r=n.color;if(r){if(r=hu(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(Kl[a],0);var o=n.lineCap;o&&t.setLineCap(ql[o]);var s=n.lineJoin;s&&t.setLineJoin(Jl[s]);var c=n.opacity;c!=null&&t.setStrokeOpacity(c)}}function Ql(e,t){var n=e.fill&&e.fill();if(n&&!(n instanceof ki||n instanceof Li)){var r=n.color;if(r){if(r=hu(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 $l(e,t,n){var r=e.clip();r&&(au(r,t,n),t.clip())}function eu(e){return e&&(e instanceof ki||e instanceof Li||e.color&&!/^(none|transparent)$/i.test(e.color)&&(e.width==null||e.width>0)&&(e.opacity==null||e.opacity>0))}function tu(e,t,n,r){var i=e.fill();if(i instanceof ki){r?t.clipStroke():t.clip();var a=i instanceof Mi,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=hu(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 nu(e,t,n,r){let i=e.fill();if(i instanceof Li){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},du),!0}}function ru(e,t,n){eu(e.fill())&&eu(e.stroke())?!tu(e,t,n,!0)&&!nu(e,t,n,!0)&&t.fillStroke():eu(e.fill())?!tu(e,t,n,!1)&&!nu(e,t,n,!1)&&t.fill():eu(e.stroke())?t.stroke():t.nop()}function iu(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 au(e,t,n){var r=e.segments;if(r.length!==0&&!iu(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 ou(e,t,n){au(e,t,n),ru(e,t,n)}function su(e,t,n){for(var r=e.paths,i=0;i<r.length;++i)au(r[i],t,n);ru(e,t,n)}function cu(e,t,n){var r=e.geometry();t.circle(r.center.x,r.center.y,r.radius),ru(e,t,n)}function lu(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);ru(e,t,n)}function uu(e,t){var n=zl(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(Bl(n),n.fontSize),t.setTextRenderingMode(r),t.showText(e.content(),e._pdfRect?e._pdfRect.width():null)};e.fill()&&e.stroke()?(i=Gl.fillAndStroke,e.options.paintOrder===`stroke`&&(a(Gl.stroke),i=Gl.fill)):e.fill()?i=Gl.fill:e.stroke()&&(i=Gl.stroke),a(i),t.endText()}function du(e,t,n){for(var r=e.children,i=0;i<r.length;++i)Xl(r[i],t,n)}function fu(e,t,n){e._pdfLink&&t.addLink(e._pdfLink.url,e._pdfLink);for(var r=e.children,i=0;i<r.length;++i)Xl(r[i],t,n)}function pu(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 mu(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),ru(e,t,n)):ou(N.fromRect(r,e.options),t,n)}function hu(e){var t=nt(e,!0);return t?t.toRGB():null}let gu=He.browser||{};function _u(e){return Array.prototype.slice.call(e)}var vu=`KENDO-PSEUDO-ELEMENT`;let yu=`data-kendo-bullet-type`;var bu={},H={};H._root=H;let xu=typeof window<`u`?gu.msie||gu.edge:!1;var Su=class extends ei{constructor(e,t,n){super(e,t.getOrigin(),n),this._pdfRect=t}rect(){return this._pdfRect}rawBBox(){return this._pdfRect}},Cu=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&&_u(t.querySelectorAll(`canvas`)).forEach((e,t)=>{e.getContext(`2d`).drawImage(n[t],0,0)});let r=e.querySelectorAll(`input, select, textarea, option`);return _u(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}),_u(t.querySelectorAll(`img`)).forEach(e=>{e.removeAttribute(`loading`)}),t}})(typeof window<`u`&&window.kendo&&window.kendo.jQuery);var wu=(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(Du(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=nt(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=Xu(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 Du(f,e)?f[e]:f[e]=Tu(e).map(p)}})(),Tu=(function(){var e={};return function(t,n){n||=/^\s*,\s*/;var r=t+n;if(Du(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}})(),Eu=(function(e){return function(t){var n=e[t];return n??=e[t]=sn(`Mapq`,{font:t}).height,n}})(Object.create(null));function Du(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ou(e){return e=`_counter_`+e,H[e]}function ku(e){var t=[],n=H;for(e=`_counter_`+e;n;)Du(n,e)&&t.push(n[e]),n=Object.getPrototypeOf(n);return t.reverse()}function Au(e,t){var n=H;for(e=`_counter_`+e;n&&!Du(n,e);)n=Object.getPrototypeOf(n);n||=H._root,n[e]=(n[e]||0)+(t??1)}function ju(e,t){e=`_counter_`+e,H[e]=t??0}function Mu(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 Nu(e){var t=U(e,`counter-reset`);t&&Mu(Tu(t,/^\s+/),ju,0);var n=U(e,`counter-increment`);n&&Mu(Tu(n,/^\s+/),Au,1)}function Pu(e,t){var n=nt(e,!0);return n&&(n=n.toRGB(),t?n=n.toCssRgba():n.a===0&&(n=null)),n}function Fu(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 Iu(e,t,n){H=Object.create(H),H[e.tagName.toLowerCase()]={element:e,style:t};let r=U(t,`text-decoration`);if(r&&r!=`none`){let n=ot(e,`text-decoration-color`);r.split(/\s+/g).forEach(function(e){if(!H[e]&&(H[e]=n,e==`underline`)){let e=U(t,`text-underline-offset`);e!=`auto`&&(H[`underline-offset`]=parseFloat(e))}})}Bu(t)&&(H._stackingContext={element:e,group:n})}function Lu(){H=Object.getPrototypeOf(H)}function Ru(e){if(H._clipbox!=null){var t=e.bbox(H._matrix);H._clipbox?H._clipbox=j.intersect(H._clipbox,t):H._clipbox=t}}function zu(){var e=H._clipbox;if(e==null)return!0;if(e)return e.width()===0||e.height()===0}function Bu(e){function t(t){return U(e,t)}if(t(`transform`)!=`none`||t(`position`)!=`static`||t(`z-index`)!=`auto`||t(`opacity`)<1)return!0}function Vu(e,t){return window.getComputedStyle(e,t||null)}function U(e,t,n){var r=e.getPropertyValue(t);return(r==null||r===``)&&(gu.webkit?r=e.getPropertyValue(`-webkit-`+t):gu.mozilla?r=e.getPropertyValue(`-moz-`+t):gu.opera?r=e.getPropertyValue(`-o-`+t):xu&&(r=e.getPropertyValue(`-ms-`+t))),arguments.length>2&&(r==null||r===``)?n:r}function Hu(e,t,n,r){e.setProperty(t,n,r),gu.webkit?e.setProperty(`-webkit-`+t,n,r):gu.mozilla?e.setProperty(`-moz-`+t,n,r):gu.opera?e.setProperty(`-o-`+t,n,r):xu&&(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 Uu(e,t,n){return n=`border-`+n,{width:parseFloat(U(t,n+`-width`)),style:U(t,n+`-style`),color:ot(e,n+`-color`)}}function Wu(e,t){var n=e.style.cssText,r=t();return En(e,n),r}function Gu(e,t){var n=U(e,`border-`+t+`-radius`).split(/\s+/g).map(parseFloat);return n.length==1&&n.push(n[0]),ed({x:n[0],y:n[1]})}function Ku(e){var t=e.getBoundingClientRect();return t=qu(t,`border-*-width`,e),t=qu(t,`padding-*`,e),t}function qu(e,t,n){var r,i,a,o,s;return typeof t==`string`?(r=Vu(n),i=parseFloat(U(r,t.replace(`*`,`top`))),a=parseFloat(U(r,t.replace(`*`,`right`))),o=parseFloat(U(r,t.replace(`*`,`bottom`))),s=parseFloat(U(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 Ju(e){var t=U(e,`transform`);if(t==`none`)return null;var n=/^\s*matrix\(\s*(.*?)\s*\)\s*$/.exec(t);if(n){var r=U(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 Yu(e){return 180*e/Math.PI%360}function Xu(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 Zu(e,t){return t=new k(t[0],t[1],t[2],t[3],t[4],t[5]),e.transform(t),t}function Qu(e,t){e.clip(t)}function $u(e,t,n,r){for(var i=new er([t,n],r).curvePoints(),a=1;a<i.length;)e.curveTo(i[a++],i[a++],i[a++])}function ed(e){return(e.x<=0||e.y<=0)&&(e.x=e.y=0),e}function td(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 nd(e,t,n){var r=Vu(e),i=Gu(r,`top-left`),a=Gu(r,`top-right`),o=Gu(r,`bottom-left`),s=Gu(r,`bottom-right`);if(n==`padding`||n==`content`){var c=Uu(e,r,`top`),l=Uu(e,r,`right`),u=Uu(e,r,`bottom`),d=Uu(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(U(r,`padding-top`)),p=parseFloat(U(r,`padding-right`)),m=parseFloat(U(r,`padding-bottom`)),h=parseFloat(U(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),rd(t,i,a,s,o)}function rd(e,t,n,r,i){var a=td(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&&$u(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&&$u(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&&$u(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&&$u(u,e.left+l.x,e.bottom-l.y,{startAngle:90,endAngle:180,radiusX:l.x,radiusY:l.y}),u.close()}function id(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 gt(e).toLowerCase();case`upper-roman`:return gt(e).toUpperCase();case`lower-latin`:case`lower-alpha`:return Fu(e-1);case`upper-latin`:case`upper-alpha`:return Fu(e-1).toUpperCase();default:return n}}function ad(e,t){function n(e,t,n){return n?(n=n.replace(/^\s*(["'])(.*)\1\s*$/,`$2`),ku(e).map(function(e){return id(e,t)}).join(n)):id(Ou(e)||0,t)}var r=Tu(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=Tu(a[1]),i.push(n(r[0],r[1]))):(a=/^\s*counters\((.*?)\)\s*$/.exec(t))?(r=Tu(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 od(e){if(e.cssText)return e.cssText;for(var t=[],n=0;n<e.length;++n)t.push(e[n]+`: `+U(e,e[n]));return t.join(`;
`)}function sd(e,t){if(e.tagName==vu){cd(e,t);return}let n=[];function r(t,r){let i=Vu(e,t),a=i.content;if(Nu(i),a&&a!=`normal`&&a!=`none`&&i.width!=`0px`){let t=e.ownerDocument.createElement(vu);En(t,od(i)),t.textContent=ad(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`,cd(e,t),e.className=r,n.forEach(function(t){e.removeChild(t)})}else cd(e,t)}function cd(e,t){var n=Vu(e),r=Uu(e,n,`top`),i=Uu(e,n,`right`),a=Uu(e,n,`bottom`),o=Uu(e,n,`left`),s=Gu(n,`top-left`),c=Gu(n,`top-right`),l=Gu(n,`bottom-left`),u=Gu(n,`bottom-right`),d=U(n,`direction`),f=Pu(ot(e,`background-color`)),p=wu(U(n,`background-image`)),m=Tu(U(n,`background-repeat`)),h=Tu(U(n,`background-position`)),g=Tu(U(n,`background-origin`)),_=Tu(U(n,`background-size`)),v,y;xu&&(v=n.textOverflow,v==`ellipsis`&&(y=e.style.textOverflow,e.style.textOverflow=`clip`)),gu.msie&&gu.version<10&&(h=Tu(e.currentStyle.backgroundPosition));var b=qu(e.getBoundingClientRect(),`border-*-width`,e);(function(){var e=U(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();Qu(l,u),t.append(l),t=l,Ru(u)}})();var x,S,ee,C=U(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)ae(x[S],S===0,S==x.length-1);if(e.tagName==`A`&&e.href&&!/^#?$/.test(e.getAttribute(`href`))&&(!H._avoidLinks||!Cu(e,H._avoidLinks))){let n=document.createRange();n.selectNodeContents(e),_u(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`)&&ie(x[0]),(function(){function r(){var n=nd(e,b,`padding`),r=new P;Qu(r,n),t.append(r),t=r,Ru(n)}(md(e)||/^(hidden|auto|scroll)/.test(U(n,`overflow`))||/^(hidden|auto|scroll)/.test(U(n,`overflow-x`))||/^(hidden|auto|scroll)/.test(U(n,`overflow-y`)))&&r()})(),!ud(e,t)&&!dd(e,t)&&yd(e,t),xu&&v==`ellipsis`&&(e.style.textOverflow=y),t;function te(t){if(/^td$/i.test(e.tagName)){var n=H.table;if(n&&U(n.style,`border-collapse`)==`collapse`){var r=Uu(n.element,n.style,`left`).width,i=Uu(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 _u(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;Zu(u,c),t.append(u),ed(o),ed(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);Zu(s,i),$u(s,0,n.y,{startAngle:-90,endAngle:-Yu(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)),$u(s,0,n.y,{startAngle:-Yu(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 ne(e){var n=new P;if(Qu(n,rd(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;)re(n,e,p[i],m[i%m.length],h[i%h.length],g[i%g.length],_[i%_.length])}function re(t,n,r,i,a,o,s){if(!r||r==`none`)return;if(r.type==`url`){var c=bu[r.url];c&&c.width>0&&c.height>0&&l(t,n,c.width,c.height,function(e,t){e.append(new ti(r.url,t))})}else if(r.type==`linear`)l(t,n,n.width,n.height,ld(r));else return;function l(t,n,r,c,l){var u=r/c,d,f=n;if(o==`content-box`?(f=qu(f,`border-*-width`,e),f=qu(f,`padding-*`,e)):o==`padding-box`&&(f=qu(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 ie(){var r=U(n,`list-style-type`);if(r==`none`)return;var i=U(n,`list-style-position`);function a(n){Wu(e,function(){e.style.position=`relative`;var r=e.ownerDocument.createElement(vu);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),Sd(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=` `,e.setAttribute(yu,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=gt(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=Fu(t),/^upper/i.test(r)&&(t=t.toUpperCase()),e.innerHTML=t+`.`})});break}}function ae(n,f,p){if(n.width===0||n.height===0)return;ne(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=qu(n,r.width/2);var g=nd(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 _=td(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 ld(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 ji({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 ud(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 dd(e,t){let n=e.getAttribute(yu);if(!n)return!1;var r=e.getBoundingClientRect();let i=ot(e,`color`);if(n===`square`){let e=r.height/5;t.append(new ui(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 Jn(new Vn([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 fd(e,t,n){var r=Ku(e),i=new ti(t,new j([r.left,r.top],[r.width,r.height]));Qu(i,nd(e,r,`content`)),n.append(i)}function pd(e,t){var n=Vu(e),r=Vu(t),i=parseFloat(U(n,`z-index`)),a=parseFloat(U(r,`z-index`)),o=U(n,`position`),s=U(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 md(e){return/^(?:textarea|select|input)$/i.test(e.tagName)}function hd(e){return e.selectedOptions&&e.selectedOptions.length>0?e.selectedOptions[0]:e.options[e.selectedIndex]}function gd(e,t){Vu(e);var n=ot(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 Jn(new Vn([(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 Jn(new Vn([(r.left+r.right)/2,(r.top+r.bottom)/2],Math.min(r.width-8,r.height-8)/2)).fill(n).stroke(null)))}function _d(e,t){var n=e.tagName.toLowerCase();if(n==`input`&&(e.type==`checkbox`||e.type==`radio`))return gd(e,t);var r=e.parentNode,i=e.ownerDocument,a=i.createElement(vu),o;if(En(a,od(Vu(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(vu),En(o,od(Vu(e.options[s]))),o.style.display=`block`,o.textContent=e.options[s].textContent,a.appendChild(o);else o=hd(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`,yd(a,t),e.style.display=``,r.removeChild(a)}function vd(e){let t=new window.XMLSerializer,n=t.serializeToString(e);if(gu.mozilla&&!(e.getAttribute(`width`)&&e.getAttribute(`height`))){let r=new window.DOMParser().parseFromString(n,`image/svg+xml`).documentElement,i=Ku(e);r.setAttribute(`width`,i.width),r.setAttribute(`height`,i.height),n=t.serializeToString(r)}return n}function yd(e,t){switch(H._stackingContext.element===e&&(H._stackingContext.group=t),e.tagName.toLowerCase()){case`img`:fd(e,e.src,t);break;case`svg`:fd(e,`data:image/svg+xml;base64,${At(vd(e))}`,t);break;case`canvas`:try{fd(e,e.toDataURL(`image/png`),t)}catch{}break;case`textarea`:case`input`:case`select`:_d(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)&&bd(e,a,t);break;case 1:var o=Vu(a),s=U(o,`float`);U(o,`position`)==`static`?s==`none`?n.push(a):r.push(a):i.push(a);break}Ft(n,pd).forEach(function(e){Sd(e,t)}),Ft(r,pd).forEach(function(e){Sd(e,t)}),Ft(i,pd).forEach(function(e){Sd(e,t)})}}function bd(e,t,n){if(zu())return;var r=Vu(e);if(parseFloat(U(r,`text-indent`))<-500)return;var i=t.data,a=0,o=i.search(/\S\s*$/)+1;if(!o)return;var s=U(r,`font-size`),c=U(r,`line-height`),l=[U(r,`font-style`),U(r,`font-variant`),U(r,`font-weight`),s,U(r,`font-family`)].join(` `);if(s=parseFloat(s),c=parseFloat(c),s===0||isNaN(s))return;var u=ot(e,`color`),d=e.ownerDocument.createRange(),f=U(r,`text-align`)==`justify`,p=U(r,`column-count`,1),m=U(r,`white-space`),h=U(r,`text-transform`),g=e.getBoundingClientRect().width/s*5;g===0&&(g=500);var _=null,v=H.underline,y=H[`line-through`],b=H.overline,x=H[`underline-offset`];for(v&&S(re);!C(););(y||b)&&S(ne);return;function S(e){d.selectNode(t);let n=_u(d.getClientRects());S=e=>n.forEach(e),S(e)}function ee(e){if(xu||gu.chrome||gu.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))}xu&&(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(xu&&!isNaN(c)){var r=Eu(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 Su(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 ne(e){let t=s/12;w(t,e,y,e.bottom-e.height/2.7),w(t,e,b,e.top)}function re(e){let t=s/12,n=e.bottom;x==null?n+=t:n+=x,w(t,e,v,n)}}function xd(e,t,n){var r;n==`auto`?(r=t,n=0):(r=H._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&&H._clipbox){var s=H._matrix.invert(),c=H._clipbox.transformCopy(s);Qu(o,N.fromRect(c))}return o}function Sd(e,t){var n=Vu(e);if(Nu(n),!/^(style|script|link|meta|iframe|col|colgroup)$/i.test(e.tagName)&&H._clipbox!=null){var r=parseFloat(U(n,`opacity`)),i=U(n,`visibility`),a=U(n,`display`);if(r!==0&&i!=`hidden`&&a!=`none`){var o=Ju(n),s,c=U(n,`z-index`);(o||r<1)&&c==`auto`&&(c=0),s=xd(e,t,c),r<1&&s.opacity(r*s.opacity()),Iu(e,n,s),o?Wu(e,function(){Hu(e.style,`transform`,`none`,`important`),Hu(e.style,`transition`,`none`,`important`),U(n,`position`)==`static`&&Hu(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=Cd(a,o.matrix),a=Cd(a,[1,0,0,1,r,i]),a=Zu(s,a),H._matrix=H._matrix.multiplyCopy(a),sd(e,s)}):sd(e,s),Lu()}}}function Cd(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 wd(e){let t=.5;e.options.stroke&&vt(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 Td(e,t){return-e.x*t.y+e.y*t.x<0}function Ed(e){return typeof e==`number`&&!isNaN(e)}function Dd(e){return typeof e==de}function Od(e){return Ed(e)||Dd(e)&&isFinite(e)}function kd(e,t){return(e+1)%t}function Ad(e,t){let n=e-1;return n<0?t-1:n}function jd(e,t){return t===1||e%t===0?0:e<0?t+e%t:e>=t?e%t:e}function Md(e){return typeof e==`function`}let Nd=`object`;function Pd(e,t){for(let n in t){if(n===`__proto__`||n===`constructor`)continue;let r=t[n],i=typeof r,a;if(a=i===Nd&&r!==null?r.constructor:null,a&&a!==Array)if(r instanceof Date)e[n]=new Date(r.getTime());else if(Md(r.clone))e[n]=r.clone();else{let t=e[n];typeof t==Nd?e[n]=t||{}:e[n]={},Pd(e[n],r)}else i!==`undefined`&&(e[n]=r)}return e}function W(e){let t=arguments.length;for(let n=1;n<t;n++)Pd(e,arguments[n]);return e}function Fd(e){return typeof e==`object`}function Id(e){return Ed(e)?e+`px`:e}let Ld=/width|height|top|left|bottom|right/i;function Rd(e){return Ld.test(e)}function zd(e,t){let n=Dd(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]=Rd(i)?parseFloat(r[i]):r[i]}return t}else if(Fd(t))for(let n in t)e.style[n]=Id(t[n])}function Bd(e,t=0){let n={top:0,right:0,bottom:0,left:0};return typeof e==`number`?n.top=n[ce]=n[f]=n[C]=e:(n.top=e.top||t,n[ce]=e.right||t,n[f]=e.bottom||t,n[C]=e.left||t),n}let Vd={compile:function(e){return e}};var Hd=class{static register(e){Vd=e}static compile(e,t){return Vd.compile(e,t)}};function Ud(e={}){let t;return e.template?e.template=t=Hd.compile(e.template):Md(e.content)&&(t=e.content),t}function Wd(e={}){let t;return e.ariaTemplate?e.ariaTemplate=t=Hd.compile(e.ariaTemplate):Md(e.ariaContent)&&(t=e.ariaContent),t}let Gd=/\[(?:(\d+)|['"](.*?)['"])\]|((?:(?!\[.*?\]|\.).)+)/g,Kd={};Kd.undefined=function(e){return e};function qd(e){if(Kd[e])return Kd[e];let t=[];return e.replace(Gd,function(e,n,r,i){t.push(n===void 0?r||i:n)}),Kd[e]=function(e){let n=e;for(let e=0;e<t.length&&n;e++)n=n[t[e]];return n},Kd[e]}let Jd=(e,t)=>e.filter(t);function Yd(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 Xd=class{constructor(){this._map=new Map}get(e){return this._map.get(e)}set(e,t){this._map.set(e,t)}};function Zd(e,t){if(t)return t.includes(e)}function Qd(e,t,n){return O(e+(t-e)*n,3)}let $d=`trigger`;var ef=class{constructor(e,t){this.observer=e,this.handlerMap=W({},this.handlerMap,t)}trigger(e,t){let{observer:n,handlerMap:r}=this,i;return r[e]?i=this.callObserver(r[e],t):n[$d]&&(i=this.callObserver($d,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 tf(e){return Object.prototype.toString.call(e)===`[object Object]`}function nf(e,t){let n=e.length,r=[];for(let i=0;i<n;i++){let n=t(e[i]);vt(n)&&r.push(n)}return r}let rf=He.browser||{};function af(e){let t=0;return e.wheelDelta?(t=-e.wheelDelta/120,rf.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:of,bindEvents:sf,defined:G,deg:cf,elementOffset:lf,elementSize:uf,eventCoordinates:df,eventElement:ff,hashKey:pf,last:mf,limitValue:K,objectKey:hf,rad:gf,round:q,unbindEvents:_f,valueOrDefault:vf}=Mn;var yf=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){ze(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=W({},n.options,t):n.options=t}let bf=`k-i-`,xf=`k-svg-i-`;var Sf=class{constructor(e,t){this.element=e,this.options=W({},this.options,t),this.wrapper()}wrapper(){this.addClasses()}addClasses(){}html(){return this.element.outerHTML}};J(Sf,{name:``,size:`none`,themeColor:`none`,flip:`default`,iconClass:``,stylingOptions:[`size`,`themeColor`,`fill`]});var Cf=class extends Sf{constructor(e,t){super(e,t)}wrapper(){let e=this.element.className.split(` `).find(e=>e.startsWith(bf)),t=this.options.icon?`${this.options.icon.startsWith(bf)?``:bf}${this.options.icon}`:``;this._className=t,Ce(this.element,`k-icon`),Ce(this.element,`k-font-icon`),Te(this.element,e),Ce(this.element,t),Ce(this.element,this.options.iconClass||``),super.wrapper()}};J(Cf,{name:`HTMLFontIcon`,icon:null});var wf=class extends Sf{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(xf));if(!e&&t){let n=t.match(/k-i-(\w+(?:-\w+)*)/);n&&(e=n[1],t=t.replace(n[0],``))}Dd(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?`${xf}${e.name}`:``;if(this._className=r,Ce(this.element,`k-svg-icon`),Te(this.element,n),Ce(this.element,r),Ce(this.element,t||``),this.element.setAttribute(`aria-hidden`,`true`),e&&tf(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(wf,{name:`HTMLSvgIcon`,icon:null,svgIcons:{}});let Tf={svg:wf,font:Cf};function Ef(e,t){let n=e,r=t;return(!n||Fd(n)&&!(n instanceof HTMLElement)||Dd(n))&&(r=n,n=document.createElement(`span`)),Dd(r)&&(r={icon:r}),r.type||=`svg`,Tf[r.type]?new Tf[r.type](n,r).html():null}function Df(e){let t=te,n=w;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===te?void 0:t,max:n===w?void 0:n}}function Of(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(t(r,n,e))return r}}let kf=k,Af=/matrix\((.*)\)/;function jf(e){let t=e.match(Af);if(t===null||t.length!==2)return kf.unit();let n=t[1].split(`,`).map(e=>parseFloat(e));return new kf(...n)}function Mf(e){let t=getComputedStyle(e).transform;return t===`none`?kf.unit():jf(t)}function Nf(e){if(!e)return kf.unit();let t=Mf(e),n=e.parentElement;for(;n;){let e=Mf(n);t=t.multiplyCopy(e),n=n.parentElement}return t.b=t.c=t.e=t.f=0,t}function Pf(e){return new rt(e).isDark()?T:d}let Ff={};var If=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!==Ff)}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]=Ff,delete this._index[e])}clear(){this._index={},this._values=[]}get size(){return this._values.length}},Lf=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 Rf=()=>{let e=!1;return typeof Set==`function`&&(e=new Set([1]).has(1)),e};function zf(e){return Rf()?new Lf(e):new If(e)}function Bf(e){throw e}let Vf={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 Hf(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Uf=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=Wf(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 Wf(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 Gf={down:`pointerdown`,move:`pointermove`,up:`pointerup`,cancel:`pointercancel pointerleave`};function Kf(e){return Gf[e]||e}let qf=e=>e.replace(/([^ ]+)/g,Kf),Jf=1;function Yf(){return`kchart`+Jf++}function Xf(){return Yf()}let Zf=new WeakMap,Qf=Symbol(`id`);function $f(e,t,n,r,i){np(e,t,n,r,i)}function ep(e,t,n,r,i){ip(e,t,n,r,i)}function tp(e){return typeof e==`string`}function np(e,t,n,r,i){(Se(t)?t:(t||``).split(` `)).forEach(function(t){rp(e,t,n,r,i)})}function rp(e,t,n,r,i){let a=r,o;n&&Md(n)&&!r?a=n:n&&tp(n)&&Md(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[Qf]||(a[Qf]=Xf());let c=Zf.get(e);c||(c=new Map,Zf.set(e,c)),c.set(t+a[Qf],s),e.addEventListener(t,s,!!i)}function ip(e,t,n,r){(Se(t)?t:(t||``).split(` `)).forEach(function(t){ap(e,t,n,r)})}function ap(e,t,n,r){let i=Zf.get(e);if(i&&n&&n[Qf]){let a=t+n[Qf],o=i.get(a);i.delete(a),o&&e.removeEventListener(t,o,!!r)}}function op(){let e=sp(navigator.userAgent),t={};return t.mobileOS=e,t}function sp(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=cp(i,r),t[t.name]=!0;break}return t}function cp(e,t,n){for(let n in t)if(t[n].test(e))return n;return n===void 0?e:n}function lp(){}function up(){return new Date().getTime()}let dp=`string`,fp=`function`,pp=function(){this._defaultPrevented=!0},mp=function(){return this._defaultPrevented===!0};var hp=class{constructor(){this._events={}}destroy(){this.unbind()}bind(e,t,n){let r=this,i,a=typeof e==dp?[e]:e||[],o,s,c,l=typeof t==fp,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==dp?[e]:e,a,o,s=typeof t==fp,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=pp,e.isDefaultPrevented=mp,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 gp=Object.assign,_p=e=>{e.preventDefault()},vp=800,yp=0,bp=`press`,xp=`hold`,Sp=`select`,Cp=`start`,wp=`move`,Tp=`cancel`,Ep=`doubleTap`,Dp=`release`,Op=`gesturechange`,kp=`gestureend`,Ap=`gesturetap`,jp={api:0,touch:0,mouse:9,pointer:9};function Mp(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 Np(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 Pp=class{constructor(e,t){let n=this;n.support=op(),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=up()}move(e){let t=this,n=e[`page`+t.axis],r=up(),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]}},Fp=class{constructor(e,t,n){gp(this,{x:new Pp(`X`,n.location),y:new Pp(`Y`,n.location),type:n.type,threshold:e.threshold||jp[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(bp,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(Ep,e),t.userEvents._clicks=0},300))}_hold(){this._trigger(xp,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(!Lp.current||Lp.current===t.userEvents)t._start(e);else return t.dispose()}t._finished||t._trigger(wp,e)}}end(e){this.endTime=up(),!this._finished&&(this._finished=!0,this._trigger(Dp,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=up(),this._moved=!0,this._trigger(Cp,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 Ip(e){let t=Gf.up.split(` `),n=0,r=t.length;for(;n<r;n++)e(t[n])}var Lp=class e extends hp{constructor(e,t){super();let n=this,r,i=op();if(this.support=i,t||={},this.options=t,r=n.filter=t.filter,n.threshold=t.threshold||yp,n.minHold=t.minHold||vp,n.touches=[],n._maxTouches=t.multiTouch?2:1,n.allowSelection=t.allowSelection,n.captureUpIfMoved=t.captureUpIfMoved,n._clicks=0,n.supportDoubleTap=t.supportDoubleTap,gp(n,{element:e,surface:t.surface||e,stopPropagation:t.stopPropagation,pressed:!1}),this._surfaceMoveHandler=this._move.bind(this),$f(n.surface,qf(`move`),this._surfaceMoveHandler),this._surfaceEndHandler=this._end.bind(this),$f(n.surface,qf(`up cancel`),this._surfaceEndHandler),this._elementStartHandler=this._start.bind(this),$f(e,qf(`down`),r,this._elementStartHandler),e.style[`touch-action`]=t.touchAction||`none`,t.preventDragEvent&&(this._elementDragStartHandler=_p,$f(e,qf(`dragstart`),this._elementDragStartHandler)),this._elementSelectHandler=this._select.bind(this),$f(e,qf(`mousedown`),r,this._elementSelectHandler),n.captureUpIfMoved){let e=n.surface;n._preventIfMovingProxy=n.preventIfMoving.bind(n),Ip(function(t){e.addEventListener(t,n._preventIfMovingProxy,!0)})}n.bind([bp,xp,`tap`,Ep,Cp,wp,`end`,Dp,Tp,`gesturestart`,Op,kp,Ap,Sp],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;Ip(function(n){t.removeEventListener(n,e._preventIfMovingProxy,!0)})}ep(e.surface,qf(`move`),this._surfaceMoveHandler),ep(e.surface,qf(`up cancel`),this._surfaceEndHandler),ep(n,qf(`down`),this._elementStartHandler),t.preventDragEvent&&ep(n,qf(`dragstart`),this._elementDragStartHandler),ep(n,qf(`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(Tp)}notify(e,t){let n=this.touches,r=e;if(this._isMultiTouch()){switch(r){case wp:r=Op;break;case`end`:r=kp;break;case`tap`:r=Ap;break;default:break}gp(t,{touches:n},Mp(n[0],n[1]))}return this.trigger(r,gp(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 Jd(this.touches,function(e){return e.isMoved()}).length}_select(e){(!this.allowSelection||this.trigger(Sp,{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=Np(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 Fp(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=Np(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:lp,preventDefault:lp})}static defaultThreshold(e){yp=e}static minHold(e){vp=e}},Rp=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=gf(t),r=Math.cos(n),i=Math.sin(n),{x:a,y:o}=e,{x:s,y:c}=this;return this.x=q(a+(s-a)*r+(c-o)*i,3),this.y=q(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=gf(n);return new e(t.x-r*Math.cos(i),t.y-r*Math.sin(i))}},Y=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=Bd(e);return this.x1-=t.left,this.x2+=t.right,this.y1-=t.top,this.y2+=t.bottom,this}unpad(e){let t=Bd(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 Rp(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 Rp(this.x1,this.y1),new Rp(this.x2,this.y1),new Rp(this.x2,this.y2),new Rp(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=zp(0,0,r,i,e),o=zp(t,0,r,i,e),s=zp(t,n,r,i,e),c=zp(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 zp(e,t,n,r,i){let a=gf(i);return new Rp(n+(e-n)*Math.cos(a)+(t-r)*Math.sin(a),r-(e-n)*Math.sin(a)+(t-r)*Math.cos(a))}var Bp=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=gf(e),r=Math.cos(n),i=Math.sin(n),a=t?this.innerRadius:this.radius;return new Rp(q(this.center.x-r*a,3),q(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(gf(i)),l=Math.cos(gf(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 Y(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 Rp(o,s),l=this.point(i),u=new Rp(l.x-t.x,l.y-t.y),d=this.point(a),f=new Rp(d.x-t.x,d.y-t.y),p=q(o*o+s*s,3);return(u.equals(c)||Td(u,c))&&!Td(f,c)&&p>=n*n&&p<=r*r}getBBox(){let e=new Y(te,te,w,w),t=q(this.startAngle%360),n=q((t+this.angle)%360),r=this.innerRadius,i=[0,90,180,270,t,n].sort(Vp),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 Vp(e,t){return e-t}var Hp=class e extends Bp{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}},Up=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 er(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}};Up.current=new Up;var Wp=class{constructor(e){this.children=[],this.initOptions(e)}initOptions(e){this.options=W({},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:vf(this.options.visible,!0)})}createAnimation(){this.visual&&this.options.animation&&(this.animation=da.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(vf(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:T,opacity:t||.2},stroke:{color:T,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=vf(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=Pf(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}};Wp.prototype.options={};let{dotsPattern:Gp,verticalStripesPattern:Kp,crosshatchPattern:qp,diagonalStripesPattern:Jp,gridPattern:Yp}=Fo,Xp={dots:Gp,verticalStripes:Kp,crosshatch:qp,diagonalStripes:Jp,grid:Yp};function Zp(e,t){return Md(e)?e(t):e}function Qp(e,t,n){let r=Zp(e,n),i=r&&Xp[r.type];return i?i(Object.assign({},t,r)):t}var $p=class extends Wp{constructor(e){super(e),this.options.margin=Bd(this.options.margin),this.options.padding=Bd(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 Y(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:vf(t.opacity,e.opacity),dashType:t.dashType},fill:Qp(e.pattern,{color:e.background,opacity:e.opacity},void 0),cursor:e.cursor}}};J($p,{align:C,vAlign:`top`,margin:{},padding:{},border:{color:d,width:0},background:``,shrinkToFit:!1,width:0,height:0,visible:!0});function em(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 tm=class extends $p{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 Jn(new Vn([q(t.x1+a,3),q(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 Qr(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=vf(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(),em(this.visual,this.options.accessibilityOptions)}};J(tm,{type:m,align:p,vAlign:p});let nm=`radial`,rm={glass:{type:`linear`,rotation:0,stops:[{offset:0,color:T,opacity:0},{offset:.25,color:T,opacity:.3},{offset:1,color:T,opacity:0}]},sharpBevel:{type:nm,stops:[{offset:0,color:T,opacity:.55},{offset:.65,color:T,opacity:0},{offset:.95,color:T,opacity:.25}]},roundedBevel:{type:nm,stops:[{offset:.33,color:T,opacity:.06},{offset:.83,color:T,opacity:.2},{offset:.95,color:T,opacity:0}]},roundedGlass:{type:nm,supportVML:!1,stops:[{offset:0,color:T,opacity:0},{offset:.5,color:T,opacity:.3},{offset:.99,color:T,opacity:0}]},sharpGlass:{type:nm,supportVML:!1,stops:[{offset:0,color:T,opacity:.2},{offset:.15,color:T,opacity:.15},{offset:.17,color:T,opacity:.35},{offset:.85,color:T,opacity:.05},{offset:.87,color:T,opacity:.15},{offset:.99,color:T,opacity:0}]},bubbleShadow:{type:nm,center:[.5,.5],radius:.5}};function im(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 Y(r,o,i,s),u[1]=new Y(n,s,r,c),u[2]=new Y(i,s,a,c),u[3]=new Y(r,c,i,l),e.x1===n&&e.y1===o||t.x1===n&&t.y1===o?(u[4]=new Y(n,o,r,s),u[5]=new Y(i,c,a,l)):(u[4]=new Y(i,o,a,s),u[5]=new Y(n,c,r,l)),Jd(u,function(e){return e.height()>0&&e.width()>0})[0]}var am=class extends Wp{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 Y(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=im(n,t[e].box)||new Y}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=hf(e),r=rm[e.gradient],i;if(t[n])i=t[n];else{let a=Object.assign({},r,e);r.type===`linear`?i=new ji(a):(e.innerRadius&&(a.stops=om(a)),i=new Mi(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 Y(0,0,e.width,e.height)}};J(am,{width:600,height:400,background:T,border:{color:d,width:0},margin:Bd(5),zIndex:-2});function om(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 sm=class extends Wp{constructor(e){super(e),this._initDirection()}_initDirection(){let e=this.options;e.vertical?(this.groupAxis=`x`,this.elementAxis=`y`,this.groupSizeField=ge,this.elementSizeField=x,this.groupSpacing=e.spacing,this.elementSpacing=e.vSpacing):(this.groupAxis=`y`,this.elementAxis=`x`,this.groupSizeField=x,this.elementSizeField=ge,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 Y;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=q(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&&q(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(sm,{vertical:!0,wrap:!0,vSpacing:0,spacing:0});let cm=ei;var lm=class extends Wp{constructor(e,t){super(t),this.content=e,this.reflow(new Y)}reflow(e){let t=this.options,n=t.size=sn(this.content,{font:t.font});this.baseline=n.baseline,this.box=new Y(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 cm(this.content,this.box.toRect().topLeft(),{font:e,fill:{color:t,opacity:n},cursor:r,stroke:i,paintOrder:a})}};J(lm,{font:_,color:d});function um(e){let t=e.origin,n=e.bottomRight();return new Y(t.x,t.y,n.x,n.y)}let dm=/\n/m;var fm=class extends $p{constructor(e,t,n){super(t),this.content=e,this.data=n,this._initContainer(),this.options._autoReflow!==!1&&this.reflow(new Y)}_initContainer(){let e=this.options,t=String(this.content).split(dm),n=new sm({vertical:!0,align:e.align,wrap:!1}),r=W({},e,{opacity:1,animation:null});this.container=n,this.append(n);for(let e=0;e<t.length;e++){let i=new lm(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=um(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=Bd(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&&!G(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])}},pm=class e extends Wp{constructor(e){super(e),this._textBox=new fm(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 mm(n),mm(r),r.reverse(),n.concat(r)}};function mm(e){for(let t=1;t<e.length;t++){let n=e[t]._textBox,r=e[t-1]._textBox;r.options.margin=Object.assign(Bd(r.options.margin),{bottom:0}),n.options.margin=Object.assign(Bd(n.options.margin),{top:0})}}J(pm,{color:d,position:`top`,align:p,margin:Bd(5),padding:Bd(5)});var hm=class extends fm{constructor(e,t,n,r,i){super(t,i),this.text=t,this.value=e,this.index=n,this.dataItem=r,this.reflow(new Y)}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(u,{element:ff(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=um(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;q(h,10)===q(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(hm,{_autoReflow:!1});var gm=class extends $p{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 Y,i=()=>this,a=n.size,o=this.fields.text,s,c;if(G(t)&&t.visible){let e=Ud(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 fm(o,W({},t)),this.label.aliasFor=i,t.position===`inside`&&!G(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 tm(W({},n));l.aliasFor=i,this.marker=l,this.append(l),this.label&&this.append(this.label),l.reflow(new Y),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;Zd(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}});wd(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(ae,n)}eventArgs(e){let t=this.options;return Object.assign(this.fields,{element:ff(e),text:G(t.label)?t.label.text:``,visual:this.visual})}};J(gm,{icon:{visible:!0,type:m},label:{position:S,visible:!0,align:p,vAlign:p},line:{visible:!0},visible:!0,position:`top`,zIndex:2});let _m={format:(e,t)=>t,toString:e=>e,parseDate:e=>new Date(e),firstDay:()=>0};var vm=class{static register(e){_m=e}static get implementation(){return _m}};let ym=/\{(\d+)(:[^\}]+)?\}/g;var bm=class{constructor(e){this._intlService=e}get intl(){return this._intlService||vm.implementation}set intl(e){this._intlService=e}auto(e,...t){let n=this.intl;return Dd(e)&&e.match(b)?n.format(e,...t):n.toString(t[0],e)}localeAuto(e,t,n){let r=this.intl,i;return i=Dd(e)&&e.match(b)?e.replace(ym,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}},xm=class{constructor(e,t={}){this._intlService=t.intlService,this.sender=t.sender||e,this.format=new bm(t.intlService),this.chart=e,this.rtl=!!t.rtl}get intl(){return this._intlService||vm.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 Sm;var Cm=class{static register(e){Sm=e}static create(e,t){let n;return n=Sm?Sm.create(e,t):new Lp(e,Object.assign({},{multiTouch:!0,touchAction:`manipulation`},t)),n}},wm=r({ChartService:()=>xm,DomEventsBuilder:()=>Cm,FormatService:()=>bm,IntlService:()=>vm,TemplateService:()=>Hd});function Tm(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),wd(a),a}function Em(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),wd(a),a}var Dm=class extends Wp{constructor(e,t=new xm){super(e),this.chartService=t,this.options.visible||(this.options=W({},this.options,{labels:{visible:!1},line:{visible:!1},margin:0,majorTickSize:0,minorTickSize:0})),this.options.minorTicks=W({},{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=W({},{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;Fd(t)&&(e.alignRotation=t.align,e.rotation=t.angle)}createLabels(){let e=this.options,t=e.vertical?ce:p,n=W({},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=Jd(this.children,e=>!(e instanceof hm)),this.labels=[]}clearTitle(){this.title&&=(this.children=Jd(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 Y(i,t.y1,i,t.y2-o):new Y(t.x1,a,t.x2-o,a)}createTitle(){let e=this.options,t=W({rotation:e.vertical?-90:0,text:``,zIndex:1,visualSize:!0},e.title);if(t.visible&&t.text){let e=new fm(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=W({},t,n[r]);i.value=this.parseNoteValue(i.value);let a=new gm({value:i.value,text:i.label.text,dataItem:i},i,this.chartService);a.options.visible&&(G(a.options.position)?e.vertical&&!Zd(a.options.position,[`left`,`right`])?a.options.position=e.reverse?C:ce:!e.vertical&&!Zd(a.options.position,[`top`,`bottom`])&&(a.options.position=e.reverse?f:`top`):e.vertical?a.options.position=e.reverse?C:ce:a.options.position=e.reverse?f:`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)G(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(Tm(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&&wd(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=Jd(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 Y(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(G(e)&&e.visible){let n=Ud(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 fm(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=q(e[a]);Zd(r,d)||a%n!==0&&(!o||l!==r)&&(u.position=r,f.append(Em(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?ge:x,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 Y(e.x1,e.y1,e.x1+u+c,e.y2):this.box=new Y(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=C):(r-=s+e.box.width(),e.options.rotationOrigin=ce),c=e.box.move(r,n)}else{let i=o.y1;t?(i-=s+e.box.height(),e.options.rotationOrigin=f):(i+=s,e.options.rotationOrigin=`top`),c=new Y(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 Y);return!0}}arrangeTitle(){let{options:e,title:t}=this,n=e.labels.mirror,r=e.vertical;t&&(r?(t.options.align=n?ce:C,t.options.vAlign=t.options.position):(t.options.align=t.options.position,t.options.vAlign=n?`top`:f),t.reflow(this.box))}arrangeNotes(){for(let e=0;e<this.notes.length;e++){let t=this.notes[e],n=t.options.value,r;G(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=Ud(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&&(!G(a.min)||a.min<=n)||r<t&&i>0&&(!G(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=K(e,n,r),c=K(e+o,n+o,r)):t>r&&i>0&&(c=K(t,n,r),s=K(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=K(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(Dm,{labels:{visible:!0,rotation:0,mirror:!1,step:1,skip:0},line:{width:1,color:d,visible:!0},title:{visible:!0,position:p},majorTicks:{align:se,size:4,skip:0,step:1},minorTicks:{align:se,size:3,skip:0,step:1},axisCrossingValue:0,majorTickType:se,minorTickType:ne,majorGridLines:{skip:0,step:1},minorGridLines:{visible:!1,width:1,color:d,skip:0,step:1},margin:5,visible:!0,reverse:!1,justified:!0,notes:{label:{text:``}},_alignLines:!0,_deferLabels:!1});let Om=`seconds`,km=`minutes`,Am=`hours`,jm=`days`,Mm=`weeks`,Nm=`months`,Pm=`years`,Fm=1e3,Im=60*Fm,Lm=60*Im,Rm=24*Lm,zm={years:31536e6,months:26784e5,weeks:6048e5,days:Rm,hours:Lm,minutes:Im,seconds:Fm,milliseconds:1};function Bm(e,t){return e.getTime()-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Im}function X(e,t){return new Date(e.getTime()+t)}function Z(e){let t;return e instanceof Date?t=e:e&&(t=new Date(e)),t}function Vm(e,t=0){let n=0,r=e.getDay();if(!isNaN(r))for(;r!==t;)r===0?r=6:r--,n++;return X(e,-n*Rm)}function Hm(e,t){return t===0&&e.getHours()===23?(e.setHours(e.getHours()+2),!0):!1}function Um(e,t){let n=new Date(e);return n.setMinutes(0,0,0),X(n,(e.getTimezoneOffset()-n.getTimezoneOffset())*Im+t*Lm)}function Q(e,t,n,r){let i=e;if(e){let a=Z(e),o=a.getHours();n===`years`?(i=new Date(a.getFullYear()+t,0,1),Hm(i,0)):n===`months`?(i=new Date(a.getFullYear(),a.getMonth()+t,1),Hm(i,o)):n===`weeks`?(i=Q(Vm(a,r),t*7,jm),Hm(i,o)):n===`days`?(i=new Date(a.getFullYear(),a.getMonth(),a.getDate()+t),Hm(i,o)):n===`hours`?i=Um(a,t):n===`minutes`?(i=X(a,t*Im),i.getSeconds()>0&&i.setSeconds(0)):n===`seconds`?i=X(a,t*Fm):n===`milliseconds`&&(i=X(a,t)),n!==`milliseconds`&&i.getMilliseconds()>0&&i.setMilliseconds(0)}return i}function Wm(e,t,n){return Q(Z(e),0,t,n)}function Gm(e,t,n){let r=Z(e);return r&&Wm(r,t,n).getTime()===r.getTime()?r:Q(r,1,t,n)}function Km(e,t){return e&&t?e.getTime()-t.getTime():-1}function qm(e,t){return e.getTime()-t}function $(e){if(Se(e)){let t=[];for(let n=0;n<e.length;n++)t.push($(e[n]));return t}else if(e)return Z(e).getTime()}function Jm(e,t){return e&&t?$(e)===$(t):e===t}function Ym(e,t,n){return Bm(e,t)/zm[n]}function Xm(e,t,n,r){let i=Z(e),a=Z(t),o;return o=n===`months`?i.getMonth()-a.getMonth()+(i.getFullYear()-a.getFullYear())*12+Ym(i,new Date(i.getFullYear(),i.getMonth()),jm)/new Date(i.getFullYear(),i.getMonth()+1,0).getDate():n===`years`?i.getFullYear()-a.getFullYear()+Xm(i,new Date(i.getFullYear(),0),Nm,1)/12:n===`days`||n===`weeks`?Ym(i,a,n):qm(i,t)/zm[n],o/r}function Zm(e,t,n){let r;return r=n===`years`?t.getFullYear()-e.getFullYear():n===`months`?Zm(e,t,Pm)*12+t.getMonth()-e.getMonth():Math.floor(n===`days`?qm(t,e)/Rm:qm(t,e)/zm[n]),r}function Qm(e,t){let n=0,r=t.length-1,i;for(;n<=r;){i=Math.floor((n+r)/2);let a=t[i];if(a<e){n=i+1;continue}if(a>e){r=i-1;continue}for(;Jm(t[i-1],e);)i--;return i}return t[i]<=e?i:i-1}function $m(e,t){let n;return n=Dd(t)&&e.parseDate(t)||Z(t),n}function eh(e,t){if(Se(t)){let n=[];for(let r=0;r<t.length;r++)n.push($m(e,t[r]));return n}return $m(e,t)}function th(e,t){return Ed(e.weekStartDay)?e.weekStartDay:t&&t.firstDay?t.firstDay():0}let nh=.1;function rh(e,t){return e instanceof Date?t.findIndex(t=>Jm(t,e)):t.indexOf(e)}var ih=class e extends Dm{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=Ed(e.min)?e.min%1:0,r;return r=Ed(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:Ed(e.min)?e.min:0,max:Ed(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=mf(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+q(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=vf(e,0),p=vf(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=K(m,o[c+1],o[c+2]),h=K(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]=K(e[t+1],n[t+1],n[t+2]),r[t+2]=K(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):Ed(i)&&(i-=r),typeof a==`string`?a=this.categoryIndex(a):Ed(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=q(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<nh&&(l=c+nh),{min:c,max:l}}zoomRange(e,t){let{min:n,max:r}=this.totalRange(),i=this.scaleRange(e,t);return{min:K(i.min,n,r),max:K(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=vf(r.categories[e],``);return n.dataItem=i,new hm(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=q(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):rh(e,t.srcCategories)}currentRangeIndices(){let e=this.options,t=0;Ed(e.min)&&(t=Math.floor(e.min));let n;return n=Ed(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=Ed(t.min)?t.min:0,r;if(r=Ed(t.max)?t.max:Ed(t.min)?n+t.categories.length:this.totalRange().max||1,e){let e=this.totalRange();n=K(n,0,e.max),r=K(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 Xd,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(ih,{type:`category`,vertical:!1,majorGridLines:{visible:!1,width:1,color:d},labels:{zIndex:1},justified:!1,_deferLabels:!0});let ah={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`},oh=[`milliseconds`,Om,km,Am,jm,Mm,Nm,Pm];function sh(e,t){t&&(e._range=void 0);let n=e._range;return n||(n=e._range=Df(e),n.min=Z(n.min),n.max=Z(n.max)),n}var ch=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}},lh=class{constructor(e,t,n){this.options=n,n.baseUnitStep=n.baseUnitStep||1;let{roundToBaseUnit:r,justified:i}=n;this.start=Q(e,0,n.baseUnit,n.weekStartDay);let a=this.roundToTotalStep(t),o=!i&&Jm(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&&Jm(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=Xm(this.displayStart,this.valueStart,e,t),r=Xm(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(Xm(e,this.valueStart,t.baseUnit,t.baseUnitStep))}totalIndex(e){let t=this.options;return Math.floor(Xm(e,this.start,t.baseUnit,t.baseUnitStep))}dateIndex(e){let t=this.options;return Xm(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=Q(r,t.baseUnitStep,t.baseUnit,t.weekStartDay)}return e}dateAt(e,t){let n=this.options;return Q(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=Xm(e,o,r,i),c=t?Math.ceil(s):Math.floor(s);return n&&(c+=n),Q(o,c*i,r,a)}};function uh(e,t,n){let r=sh(e.categories),i=(e.max||r.max)-(e.min||r.min),{autoBaseUnitSteps:a,maxDateGroups:o}=e,s=e.baseUnit===`fit`,c=t?oh.indexOf(t):0,l=s?oh[c++]:e.baseUnit,u=i/zm[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===mf(oh)){p=Math.ceil(d/o);break}else if(s)l=oh[c++]||mf(oh),d=i/zm[l],f=null;else{u>o&&(p=Math.ceil(d/o));break}}e.baseUnitStep=p,e.baseUnit=l}function dh(e){let t=e.categories,n=G(t)?t.length:0,r=te,i,a;for(let e=0;e<n;e++){let n=t[e];if(n&&i){let e=Math.abs(Bm(n,i));e!==0&&(r=Math.min(r,e),a=r>=31536e6?Pm:r>=26784e5-864e5*3?Nm:r>=6048e5?Mm:r>=864e5?jm:r>=36e5?Am:r>=6e4?km:Om)}i=n}e.baseUnit=a||`days`}function fh(e){let t=(e.baseUnit||``).toLowerCase();return t!==`fit`&&!Zd(t,oh)&&dh(e),(t===`fit`||e.baseUnitStep===`auto`)&&uh(e),e}var ph=class e extends ih{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=eh(t,r),r._parsed=!0),n=W({roundToBaseUnit:!0},n,{categories:r,min:$m(t,n.min),max:$m(t,n.max),weekStartDay:th(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=sh(r,!0),t=n.maxDivisions,i=fh(n),a=n._forecast;if(a&&(a.before>0&&(e.min=Q(e.min,-a.before,i.baseUnit,i.weekStartDay)),a.after>0&&(e.max=Q(e.max,a.after,i.baseUnit,i.weekStartDay))),this.dataRange=new lh(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;uh(i,a.baseUnit,a.baseUnitStep),this.divisionRange=new lh(e.min,e.max,i)}else this.divisionRange=this.dataRange}else n.baseUnit=n.baseUnit||`days`,this.dataRange=this.divisionRange=new ch(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 Km(e,t.min)>=0&&Km(e,t.max)<=0&&n.length}parseNoteValue(e){return $m(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=q(e/c,10);if(s.min&&s.max){let e=X(t.min||s.min,l),i=X(t.max||s.max,l);s={min:Q(e,0,n,r),max:Q(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=q(e/s,10)*(t.reverse?-1:1),l=X(i,c),u=X(a,c),d=this.limitRange($(l),$(u),$(o.min),$(o.max),c);if(d)return d.min=Z(d.min),d.max=Z(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=qm(r.max,r.min)/(i.max-i.min),o=this.options;return{min:X(r.min,n.min*a),max:X(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=mf(e[f])*t*zm[f],s=qm(o,a),c=qm(m,p),l=oh.indexOf(f),u,d;if(c<zm[f]&&f!==`milliseconds`)f=oh[l-1],u=mf(e[f]),d=(s-(t-1)*u*zm[f])/2,p=X(a,d),m=X(o,-d);else if(c>r&&f!==`years`){let t=0;do{l++,f=oh[l],t=0,d=2*zm[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=X(a,-d),m=X(o,d),p=X(p,K(m,i.min,i.max)-m),m=X(m,K(p,i.min,i.max)-p))}}if(p&&m&&qm(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=qm(n.min,r.min);r.max=X(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 hm(a,s,e,i,t)}createRangeLabels(){let{displayStart:e,displayEnd:t}=this.divisionRange,n=this.options,r=Object.assign({},n.labels,n.rangeLabels,{align:p,zIndex:n.zIndex});if(r.visible!==!0)return;this.normalizeLabelRotation(r),r.alignRotation=p,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 hm(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 Y))},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=sh(e.srcCategories);return{min:Z(t.min),max:Z(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=sh(e.srcCategories);return new lh(t.min,t.max,Object.assign({},e,{justified:!1,roundToBaseUnit:!0,justifyEnd:!1})).displayRange()}};J(ph,{type:g,labels:{dateFormats:ah},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 mh(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 hh(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 gh(e,t){return be(Math.floor(e/t)*t)}function _h(e,t){return be(Math.ceil(e/t)*t)}function vh(e){return Math.max(Math.min(e,3e5),-3e5)}let yh=10**-9;var bh=class e extends Dm{constructor(e,t,n,r){super(Object.assign({},n,{seriesMin:e,seriesMax:t}),r)}initUserOptions(e){let t=xh(e.seriesMin,e.seriesMax,e);return this.totalOptions=Sh(t,e),wh(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(q(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(q(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=vf(e,t||0),d=vf(t,e||0);n&&(u=K(u,r.min,r.max),d=K(d,r.min,r.max));let f=Math.min(u,d)-r.min,p=Math.max(u,d)-r.min,m=new Y(o.x1,o.y1,o.x1,o.y1);return m[i+1]=vh(c+l*(a>0?f:p)),m[i+2]=vh(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:be(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:be(i+o),max:be(r+o),offset:o}}labelsCount(){return this.getDivisions(this.options.majorUnit)}createAxisLabel(e,t,n){let r=this.options,i=be(r.min+e*r.majorUnit);return new hm(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>yh)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:be(this.options.min+a),max:be(this.options.max-o)}}zoomRange(e,t){let{totalMin:n,totalMax:r}=this,i=this.scaleRange(e,t);return{min:K(i.min,n,r),max:K(i.max,n,r),narrowRange:!1}}};function xh(e,t,n){let r=n.narrowRange,i=mh(e,t,r),a=hh(e,t,r),o=xe(i,a),s={majorUnit:o};return n.roundToMajorUnit!==!1&&(i<0&&Th(i,o,1/3)&&(i-=o),a>0&&Th(a,o,1/3)&&(a+=o)),s.min=gh(i,o),s.max=_h(a,o),s}function Sh(e,t){return{min:G(t.min)?Math.min(e.min,t.min):e.min,max:G(t.max)?Math.max(e.max,t.max):e.max,majorUnit:e.majorUnit}}function Ch(e,t){for(let n=0;n<t.length;n++){let r=t[n];e[r]===null&&(e[r]=void 0)}}function wh(e,t){let n=t,r,i;if(t){Ch(t,[`min`,`max`]),r=G(t.min),i=G(t.max);let a=r||i;a&&t.min===t.max&&(t.min>0?t.min=0:t.max=1),t.majorUnit?(e.min=gh(e.min,t.majorUnit),e.max=_h(e.max,t.majorUnit)):a&&(n=W(e,t),e.majorUnit=xe(n.min,n.max))}e.minorUnit=(n.majorUnit||e.majorUnit)/5;let a=W(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 Th(e,t,n){let r=q(Math.abs(e%t),10),i=t*(1-n);return r===0||r>i}J(bh,{type:`numeric`,min:0,max:1,vertical:!0,majorGridLines:{visible:!0,width:1,color:d},labels:{format:`#.####################`},zIndex:1});let Eh=1e3;var Dh=class e extends Dm{constructor(e,t,n,r){let i=Z(e),a=Z(t),o=r.intl,s=n||{};s=W(s||{},{min:$m(o,s.min),max:$m(o,s.max),axisCrossingValue:eh(o,s.axisCrossingValues||s.axisCrossingValue),weekStartDay:th(s,o)}),s=kh(i,a,s),super(s,r),this.intlService=o,this.seriesMin=i,this.seriesMax=a;let c=s.weekStartDay||0;this.totalMin=$(Wm($(i)-1,s.baseUnit,c)),this.totalMax=$(Gm($(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(Zm(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/qm(t.max,t.min),s=t.weekStartDay||0,c=[i];for(let r=1;r<a;r++){let a=i+qm(Q(t.min,r*e,t.baseUnit,s),t.min)*o*n;c.push(q(a,3))}return c}getMajorTickPositions(){return this.getTickPositions(this.options.majorUnit)}getMinorTickPositions(){return this.getTickPositions(this.options.minorUnit)}getSlot(e,t,n){return bh.prototype.getSlot.call(this,$m(this.intlService,e),$m(this.intlService,t),n)}getValue(e){let t=bh.prototype.getValue.call(this,e);return t===null?null:Z(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=Q(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 hm(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/qm(o.max,o.min),c=q(e/s,10);return(r||i)&&!(r&&i)&&(c=-c),{min:X(t.min,c),max:X(t.max,c),offset:c}}shouldRenderNote(e){let t=this.range();return Km(e,t.min)>=0&&Km(e,t.max)<=0}pan(e){let t=this.translateRange(e,!0),n=this.limitRange($(t.min),$(t.max),this.totalMin,this.totalMax,t.offset);if(n)return{min:Z(n.min),max:Z(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:Z(i),max:Z(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=Z($(this.options.min)+a),c=Z($(this.options.max)-o);return c-s<Eh&&(c=Z($(s)+Eh)),{min:s,max:c}}zoomRange(e,t){let n=this.scaleRange(e,t);return{min:Z(K($(n.min),this.totalMin,this.totalMax)),max:Z(K($(n.max),this.totalMin,this.totalMax))}}};function Oh(e){let t=Am;return e>=31536e6?t=Pm:e>=26784e5?t=Nm:e>=6048e5?t=Mm:e>=864e5&&(t=jm),t}function kh(e,t,n){let r=n.min||e,i=n.max||t,a=n.baseUnit||(i&&r?Oh(Bm(i,r)):`hours`),o=zm[a],s=n.weekStartDay||0,c=Wm($(r)-1,a,s)||Z(i),l=Gm($(i)+1,a,s),u=(n.majorUnit?n.majorUnit:void 0)||_h(xe(c.getTime(),l.getTime()),o)/o,d=Zm(c,l,a),f=_h(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||Q(c,-p,a,s),n.max=n.max||Q(l,m,a,s),n.minorUnit=n.minorUnit||u/5,n.majorUnit=u,n}J(Dh,{type:g,majorGridLines:{visible:!0,width:1,color:d},labels:{dateFormats:ah}});let Ah=1e-6;var jh=class e extends Dm{constructor(e,t,n,r){let i=W({majorUnit:10,min:e,max:t},n),a=i.majorUnit,o=Ph(t,a),s=Nh(e,t,i),c=Mh(s,o,i,n);i.max=c.max,i.min=c.min,i.minorUnit=n.minorUnit||q(a-1,10),super(i,r),this.totalMin=G(n.min)?Math.min(s,n.min):s,this.totalMax=G(n.max)?Math.max(o,n.max):o,this.logMin=q(Ih(c.min,a),10),this.logMax=q(Ih(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=vf(e,t||1),g=vf(t,e||1);if(h<=0||g<=0)return null;n&&(h=K(h,s,c),g=K(g,s,c)),h=Ih(h,o),g=Ih(g,o);let _=Math.min(h,g)-i,v=Math.max(h,g)-i,y=new Y(d.x1,d.y1,d.x1,d.y1);return y[l+1]=vh(p+m*(u>0?_:v)),y[l+2]=vh(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 q(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=q(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(Tm(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){Zd(e,o)||(a.position=e,s.append(Em(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(q(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(q(o+s*(Ih(i,a)-c),10),t)}}}createAxisLabel(e,t,n){let r=Math.ceil(this.logMin+e),i=this.options.majorUnit**+r;return new hm(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=Ih(this.options.min,n),i=Ih(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<Ah&&(l=c+Ah),{min:c,max:l}}zoomRange(e,t){let n=this.scaleRange(e,t),{totalMin:r,totalMax:i}=this;return{min:K(n.min,r,i),max:K(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 Mh(e,t,n,r){let{min:i,max:a}=n;return G(n.axisCrossingValue)&&n.axisCrossingValue<=0&&Fh(),G(r.max)?r.max<=0&&Fh():a=t,G(r.min)?r.min<=0&&Fh():i=e,{min:i,max:a}}function Nh(e,t,n){let r=n.majorUnit,i=e;return e<=0?i=t<=1?r**-2:1:n.narrowRange||(i=r**+Math.floor(Ih(e,r))),i}function Ph(e,t){let n=q(Ih(e,t),10)%1,r;return r=e<=0?t:n!==0&&(n<.3||n>.9)?t**+(Ih(e,t)+.2):t**+Math.ceil(Ih(e,t)),r}function Fh(){throw Error(`Non positive values cannot be used for a logarithmic axis`)}function Ih(e,t){return Math.log(e)/Math.log(t)}J(jh,{type:`log`,majorUnit:10,minorUnit:1,axisCrossingValue:1,vertical:!0,majorGridLines:{visible:!0,width:1,color:d},zIndex:1,_deferLabels:!0});let Lh={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),of(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 Vn([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 nf(a,e=>{let t=this.intervalAngle(e);if(!s||t!==90)return t})}};var Rh=class extends ih{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 Y;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=q(u,3)%360,r&&Zd(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 nf(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=gf(360/(this.options.categories.length*2)),r=Math.cos(t)*e,i=this.majorAngles();return function(t){return!n&&Zd(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=Up.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=K(Math.floor(c),0,o-1);let l=a[c];r&&(l-=s/2,l<0&&(l+=360));let u=s*(K(Math.ceil(t||c),c,o-1)-c+1);return new Bp(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 er([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(Rh,{startAngle:90,labels:{margin:Bd(10)},majorGridLines:{visible:!0},justified:!0}),W(Rh.prototype,Lh);var zh=class extends Dm{constructor(e,t){super(e,t);let n=this.options;n.minorUnit=n.minorUnit||n.majorUnit/2}getDivisions(e){return bh.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 Y,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&&Zd(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=K(e,n.min,n.max),o=K(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 Bp(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 er([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(cf(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(zh,{type:`polar`,startAngle:0,reverse:!1,majorUnit:60,min:0,max:360,labels:{margin:Bd(10)},majorGridLines:{color:d,visible:!0,width:1},minorGridLines:{color:`#aaa`}}),W(zh.prototype,Lh,{createPlotBands:Rh.prototype.createPlotBands,majorAngles:Rh.prototype.majorAngles,range:bh.prototype.range,labelsCount:bh.prototype.labelsCount,createAxisLabel:bh.prototype.createAxisLabel});let Bh={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 Bp(i,i.y-c.y2,i.y-c.y1,0,360),u;u=e===`arc`?Up.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 Vn(i,e.innerRadius),o=new Vn(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();of(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 Vn([e.x,e.y],a);if(r.type===`arc`)s.append(new Jn(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=(cf(Math.atan2(n,t))+540)%360;r.sort(function(e,t){return Vh(e,s)-Vh(t,s)});let c=Vh(r[0],r[1])/2,l=Vh(s,r[0]),u=90-c,d=180-l-u;o=a*(Math.sin(gf(d))/Math.sin(gf(u)))}return this.axisType().prototype.getValue.call(this,new Rp(t.x1,t.y2-o))}};function Vh(e,t){return 180-Math.abs(Math.abs(e-t)-180)}var Hh=class extends bh{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 bh}};W(Hh.prototype,Bh);var Uh=class extends jh{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 jh}};W(Uh.prototype,Bh);let Wh=.333;var Gh=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 Sr(a));a.equals(t[i-1]);)r=!0,t.pop(),i--;if(i===2){let e=this.tangent(a,o,`x`,`y`);return mf(n).controlOut(this.firstControlPoint(e,a,o,`x`,`y`)),n.push(new Sr(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);mf(n).controlOut(u),u=r[1];let i=r[0];n.push(new Sr(o,i))}if(r){a=t[i-2],o=t[i-1],s=t[0];let e=this.controlPoints(a,o,s);mf(n).controlOut(u),n.push(new Sr(o,e[0])),mf(n).controlOut(e[1]),n.push(new Sr(s,l))}else{let e=this.tangent(o,s,`x`,`y`);mf(n).controlOut(u),n.push(new Sr(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||q(i,1)===q(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]?Kh((n[i]-e[i])*(t[r]-e[r])):-Kh((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)*Wh;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)*Wh;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 Kh(e){return e<=0?-1:1}var qh=r({Axis:()=>Dm,AxisLabel:()=>hm,Box:()=>Y,BoxElement:()=>$p,CategoryAxis:()=>ih,ChartElement:()=>Wp,CurveProcessor:()=>Gh,DateCategoryAxis:()=>ph,DateValueAxis:()=>Dh,FloatElement:()=>sm,FontLoader:()=>yf,Gradients:()=>rm,HashMap:()=>Xd,InstanceObserver:()=>ef,LogarithmicAxis:()=>jh,Matrix:()=>Uf,Note:()=>gm,NumericAxis:()=>bh,Observable:()=>hp,Point:()=>Rp,PolarAxis:()=>zh,RadarCategoryAxis:()=>Rh,RadarLogarithmicAxis:()=>Uh,RadarNumericAxis:()=>Hh,Ring:()=>Bp,RootElement:()=>am,Sector:()=>Hp,ShapeBuilder:()=>Up,ShapeElement:()=>tm,Text:()=>lm,TextBox:()=>fm,Title:()=>pm,UserEvents:()=>Lp,absoluteDateDiff:()=>Bm,addClass:()=>Ce,addDuration:()=>Q,addTicks:()=>X,alignPathToPixel:()=>wd,append:()=>of,applyEventMap:()=>qf,autoMajorUnit:()=>xe,autoTextColor:()=>Pf,bindEvents:()=>sf,ceilDate:()=>Gm,clockwise:()=>Td,constants:()=>i,convertableToNumber:()=>Od,createHashSet:()=>zf,createPatternFill:()=>Qp,cycleDown:()=>Ad,cycleIndex:()=>jd,cycleUp:()=>kd,dateComparer:()=>Km,dateDiff:()=>qm,dateEquals:()=>Jm,dateIndex:()=>Xm,deepExtend:()=>W,defaultErrorHandler:()=>Bf,defined:()=>G,deg:()=>cf,duration:()=>Zm,elementOffset:()=>lf,elementScale:()=>Nf,elementSize:()=>uf,elementStyles:()=>zd,eventCoordinates:()=>df,eventElement:()=>ff,eventMap:()=>Gf,find:()=>Of,firstDay:()=>th,floorDate:()=>Wm,getAriaTemplate:()=>Wd,getSpacing:()=>Bd,getSupportedFeatures:()=>op,getTemplate:()=>Ud,getter:()=>qd,grep:()=>Jd,hasClasses:()=>Yd,hasOwnProperty:()=>Hf,hashKey:()=>pf,inArray:()=>Zd,interpolateValue:()=>Qd,isArray:()=>Se,isFunction:()=>Md,isNumber:()=>Ed,isObject:()=>Fd,isPlainObject:()=>tf,isString:()=>Dd,keys:()=>Vf,last:()=>mf,limitValue:()=>K,logToConsole:()=>ze,lteDateIndex:()=>Qm,map:()=>nf,mousewheelDelta:()=>af,noop:()=>lp,now:()=>up,objectKey:()=>hf,off:()=>ep,on:()=>$f,parseDate:()=>$m,parseDates:()=>eh,rad:()=>gf,rectToBox:()=>um,removeClass:()=>Te,renderIcon:()=>Ef,round:()=>q,services:()=>wm,setDefaultOptions:()=>J,sparseArrayLimits:()=>Df,startOfWeek:()=>Vm,styleValue:()=>Id,toDate:()=>Z,toTime:()=>$,unbindEvents:()=>_f,valueOrDefault:()=>vf});let Jh={id:`dataviz.core`,name:`Core`,description:`The DataViz core functions`,category:`dataviz`,depends:[`core`,`drawing`],hidden:!0};window.kendo.dataviz=window.kendo.dataviz||{},kendo.deepExtend(kendo.dataviz,kendo.deepExtend({},qh)),kendo.dataviz.Gradients=rm;let Yh=kendo.jQuery,Xh=kendo.dataviz,Zh=kendo.drawing,Qh=wm;for(let e in qh)Hf(e)&&(Xh[e]=qh[e]);Xh.SASS_THEMES=[`sass`,`default-v2`,`bootstrap-v4`,`material-v2`],Xh.ExportMixin={extend:function(e,t){if(!e.exportVisual)throw Error(`Mixin target has no exportVisual method defined.`);e.exportSVG=this.exportSVG,e.exportImage=this.exportImage,e.exportPDF=this.exportPDF,t||(e.svg=this.svg,e.imageDataURL=this.imageDataURL)},exportSVG:function(e){return Zh.exportSVG(this.exportVisual(),e)},exportImage:function(e){return Zh.exportImage(this.exportVisual(e),e)},exportPDF:function(e){return Zh.exportPDF(this.exportVisual(),e)},svg:function(){if(Zh.svg.Surface)return Zh.svg.exportGroup(this.exportVisual());throw Error(`SVG Export failed. Unable to export instantiate kendo.drawing.svg.Surface`)},imageDataURL:function(){if(!kendo.support.canvas)return null;if(Zh.canvas.Surface){var e=Yh(`<div />`).css({display:`none`,width:this.element.width(),height:this.element.height()}).appendTo(document.body),t=new Zh.canvas.Surface(e[0]);t.draw(this.exportVisual());var n=t._rootElement.toDataURL();return t.destroy(),e.remove(),n}else throw Error(`Image Export failed. Unable to export instantiate kendo.drawing.canvas.Surface`)}},Qh.IntlService.register({format:function(e){return kendo.format.apply(null,[e].concat(Array.prototype.slice.call(arguments,1)))},toString:kendo.toString,parseDate:kendo.parseDate,firstDay:function(){return kendo.culture().calendars.standard.firstDay}}),Qh.TemplateService.register({compile:kendo.template}),Xh.inArray=function(e,t){if(t)return t.indexOf(e)!==-1},Xh.Point2D=Rp,Xh.Box2D=Y,Xh.mwDelta=function(e){return af(e.originalEvent)};var $h=kendo;e.__meta__=Jh,e.default=$h});
//# sourceMappingURL=kendo.dataviz.core.min.js.map