@arcgis/map-components 5.2.0-next.55 → 5.2.0-next.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/{CEQVLPP2.js → 34HQ4DIU.js} +1 -1
- package/dist/cdn/3K7YV4SA.js +2 -0
- package/dist/cdn/4IOVE754.js +4 -0
- package/dist/cdn/54DPKOI2.js +2 -0
- package/dist/cdn/{SIZFSGGL.js → 5KBFECNZ.js} +1 -1
- package/dist/cdn/{EFRTVN3U.js → ARVSEV26.js} +1 -1
- package/dist/cdn/{BMYM5GUH.js → BYZRGKOW.js} +1 -1
- package/dist/cdn/{ZLYR2YYJ.js → CVSQSV2T.js} +2 -2
- package/dist/cdn/DTR5I2KQ.js +2 -0
- package/dist/cdn/FBCMR23T.js +2 -0
- package/dist/cdn/{474ENJV3.js → FOHSM4R7.js} +1 -1
- package/dist/cdn/{GMIKKUI5.js → FWYUKFIR.js} +1 -1
- package/dist/cdn/{ZKI5D5XC.js → VC4FPVTG.js} +1 -1
- package/dist/cdn/XCCZTOXH.js +2 -0
- package/dist/cdn/index.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +5 -5
- package/dist/cdn/37CSW5WZ.js +0 -2
- package/dist/cdn/6PH76ATO.js +0 -2
- package/dist/cdn/7MBRM6UK.js +0 -2
- package/dist/cdn/H7BPQQ3W.js +0 -2
- package/dist/cdn/MUVEIVYN.js +0 -4
- package/dist/cdn/RQNFEF4Y.js +0 -2
- /package/dist/cdn/{7V5OX7NX.js → 2WS6ADGC.js} +0 -0
- /package/dist/cdn/{6NXVOGBD.js → 3J2BDZNE.js} +0 -0
- /package/dist/cdn/{ITQUWYTW.js → 3PLX2VZZ.js} +0 -0
- /package/dist/cdn/{FRWIY4ZW.js → 3XZU4KZX.js} +0 -0
- /package/dist/cdn/{2AXUQSPF.js → 4B2SV3DL.js} +0 -0
- /package/dist/cdn/{UUOJ32OM.js → 4WTMWS4L.js} +0 -0
- /package/dist/cdn/{TFCUOETX.js → 57URHW23.js} +0 -0
- /package/dist/cdn/{DRLKUZST.js → 5D5K4ODL.js} +0 -0
- /package/dist/cdn/{VPY4ZWB2.js → 6D7LJWC3.js} +0 -0
- /package/dist/cdn/{QL3Z3YGW.js → 6IZPSVRK.js} +0 -0
- /package/dist/cdn/{LZ5UPVXI.js → 7IA62IHQ.js} +0 -0
- /package/dist/cdn/{HDVXHIXT.js → A4LOY55I.js} +0 -0
- /package/dist/cdn/{PR37XCRY.js → BSA3D7EV.js} +0 -0
- /package/dist/cdn/{PMVPYHRO.js → CGM2YWJH.js} +0 -0
- /package/dist/cdn/{SLHRX525.js → EAN2ER5F.js} +0 -0
- /package/dist/cdn/{RT46BLCV.js → F3MJCQ74.js} +0 -0
- /package/dist/cdn/{4XLX32SH.js → FFKWCM3U.js} +0 -0
- /package/dist/cdn/{DSK73NEI.js → GJRDLFOY.js} +0 -0
- /package/dist/cdn/{H73K347O.js → I62OLA5J.js} +0 -0
- /package/dist/cdn/{3FKUTL66.js → INJXVNS3.js} +0 -0
- /package/dist/cdn/{Y7MR7D3R.js → JYWV4RJT.js} +0 -0
- /package/dist/cdn/{HOZPGWGN.js → KU2D7B6L.js} +0 -0
- /package/dist/cdn/{M6YEWPWS.js → KUGHB56Z.js} +0 -0
- /package/dist/cdn/{INYT5TOO.js → M5YTVQ3E.js} +0 -0
- /package/dist/cdn/{BWGRL4DG.js → MUMLZBK2.js} +0 -0
- /package/dist/cdn/{7NFOSEAK.js → OCYNG6CZ.js} +0 -0
- /package/dist/cdn/{U3Y5DKUV.js → POCKSTPT.js} +0 -0
- /package/dist/cdn/{FBPT7ZQQ.js → RDWKI3KP.js} +0 -0
- /package/dist/cdn/{YEYBFIOW.js → SF5BNNTL.js} +0 -0
- /package/dist/cdn/{5RMF6NQH.js → SKVY2FTI.js} +0 -0
- /package/dist/cdn/{JMZ4HLL6.js → SMOBVQX6.js} +0 -0
- /package/dist/cdn/{PTEBMWLB.js → TDMJD6KE.js} +0 -0
- /package/dist/cdn/{TFWFBDDB.js → UHL5U7GJ.js} +0 -0
- /package/dist/cdn/{UFXJQRMV.js → ULVWM2Z5.js} +0 -0
- /package/dist/cdn/{NYPCIHNR.js → UT4Y7W2I.js} +0 -0
- /package/dist/cdn/{JONRM3RR.js → VXYZPWDK.js} +0 -0
- /package/dist/cdn/{V5OSAAJ7.js → WLNDY4AF.js} +0 -0
- /package/dist/cdn/{LMM7CA6W.js → X7DC4UOR.js} +0 -0
- /package/dist/cdn/{74ZIEI3T.js → Y3QCO64W.js} +0 -0
- /package/dist/cdn/{NHJKCOD6.js → YKVEZBMI.js} +0 -0
- /package/dist/cdn/{XPFNISJZ.js → YYY2B7Z3.js} +0 -0
- /package/dist/cdn/{3ERU3RSV.js → Z5KZ3J36.js} +0 -0
- /package/dist/cdn/{XUQDVXFA.js → ZIHLJCFU.js} +0 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{a as Je}from"./VC4FPVTG.js";import{a as $t,b as Ft,c as wi,d as Ke}from"./FWYUKFIR.js";import{A as X,C as gi,E as z,F as Et,H as _i,I as yi,J as xi,K as lt,L as bi,P as $,Q as vi,R as mt,T as Ds,c as Ct,e as Kt,ga as Ze,h as ot,i as K,k as J,l as ks,m as Ts,o as Be,r as Ms,s as Ss,u as Rt,y as I,z as qe}from"./54DPKOI2.js";import{A as Zt,B as di,C as ms,D as gs,E as ui,F as _s,G as fi,H as pi,I as ys,J as xs,K as bs,L as $e,M as Pe,N as vs,P as at,S as ht,T as Y,X as mi,c as hs,d as N,e as Xe,f as bt,h as Ue,i as ls,j as je,l as De,m as cs,n as ci,o as ds,p as zt,q as St,r as us,s as Q,t as fs,u as vt,v as ps,w as Z,x as Ee}from"./FOHSM4R7.js";import{a as nt,b as pt,d as W,e as Bt,f as hi}from"./YYY2B7Z3.js";import{D as jt,F as Se,G as qt,I as as,J as tt,K as os,M as ns,N as yt,O as li,P as xt,R as Ce,S as ws,T as Cs,W as Dt,b as rt,d as es,f as Tt,g as A,h as Lt,i as we,j as Mt,k as At,m as is,n as ss,o as T,q as ke,r as Nt,s as Te,t as rs,u as Me,v as Ut}from"./OCYNG6CZ.js";import{a as Fs}from"./H6RQVSYM.js";var ki=class{constructor(){this._targets=[],this._observer=new ResizeObserver(t=>{T(t,e=>{T(this._targets,i=>{i.target===e.target&&i.callback()})})})}addTarget(t,e){this._observer.observe(t,{box:"border-box"}),this._targets.push({target:t,callback:e})}removeTarget(t){this._observer.unobserve(t),jt(this._targets,e=>e.target!==t)}},ti=class g{constructor(){this._timer=null,this._targets=[]}addTarget(t,e){if(this._timer===null){let s=null,r=()=>{let a=Date.now();(s===null||a>s+g.delay)&&(s=a,T(this._targets,o=>{let n=o.target.getBoundingClientRect();(n.width!==o.size.width||n.height!==o.size.height)&&(o.size=n,o.callback())})),this._targets.length===0?this._timer=null:this._timer=requestAnimationFrame(r)};this._timer=requestAnimationFrame(r)}let i={width:0,height:0,left:0,right:0,top:0,bottom:0,x:0,y:0};this._targets.push({target:t,callback:e,size:i})}removeTarget(t){jt(this._targets,e=>e.target!==t),this._targets.length===0&&this._timer!==null&&(cancelAnimationFrame(this._timer),this._timer=null)}};ti.delay=200;var Qe=null;function Os(){return Qe===null&&(typeof ResizeObserver<"u"?Qe=new ki:Qe=new ti),Qe}var ei=class{constructor(t,e){this._disposed=!1,this._sensor=Os(),this._element=t,this._listener=Xe(e),this._sensor.addTarget(t,e)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._sensor.removeTarget(this._element),this._listener.dispose())}get sensor(){return this._sensor}};var Ot=class extends I{};Ot.className="InterfaceColors";Ot.classNames=I.classNames.concat([Ot.className]);var wt=class extends z{_beforeChanged(){super._beforeChanged(),(this.isDirty("pointerBaseWidth")||this.isDirty("cornerRadius")||this.isDirty("pointerLength")||this.isDirty("pointerX")||this.isDirty("pointerY")||this.isDirty("width")||this.isDirty("height"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){this.markDirtyBounds();let t=this.width(),e=this.height();if(t>0&&e>0){let i=this.get("cornerRadius",8);i=ot(i,0,Math.min(t/2,e/2));let s=this.get("pointerX",0),r=this.get("pointerY",0),a=this.get("pointerBaseWidth",15)/2,o=0,n=0,d=t,u=0,h=t,c=e,l=0,m=e,_=(s-o)*(c-n)-(r-n)*(h-o),f=(s-l)*(u-m)-(r-m)*(d-l),p=this._display;if(p.moveTo(i,0),_>0&&f>0){let b=Math.round(ot(s,i+a,t-a-i));r=ot(r,-1/0,0),p.lineTo(b-a,0),p.lineTo(s,r),p.lineTo(b+a,0)}if(p.lineTo(t-i,0),p.arcTo(t,0,t,i,i),_>0&&f<0){let b=Math.round(ot(r,i+a,e-a-i));s=ot(s,t,1/0),p.lineTo(t,i),p.lineTo(t,Math.max(b-a,i)),p.lineTo(s,r),p.lineTo(t,b+a)}if(p.lineTo(t,e-i),p.arcTo(t,e,t-i,e,i),_<0&&f<0){let b=Math.round(ot(s,i+a,t-a-i));r=ot(r,e,1/0),p.lineTo(t-i,e),p.lineTo(b+a,e),p.lineTo(s,r),p.lineTo(b-a,e)}if(p.lineTo(i,e),p.arcTo(0,e,0,e-i,i),_<0&&f>0){let b=Math.round(ot(r,i+a,e-i-a));s=ot(s,-1/0,0),p.lineTo(0,e-i),p.lineTo(0,b+a),p.lineTo(s,r),p.lineTo(0,Math.max(b-a,i))}p.lineTo(0,i),p.arcTo(0,0,i,0,i),p.closePath()}}}};wt.className="PointedRectangle";wt.classNames=z.classNames.concat([wt.className]);var _t=class extends ${constructor(t,e,i,s=[]){super(t,e,i,s),this._fx=0,this._fy=0,this._w=0,this._h=0,this._htmlContentHovered=!1}_afterNew(){this._settings.themeTags=at(this._settings.themeTags,["tooltip"]),super._afterNew(),this._setDefaultFn("background",()=>wt.new(this._root,{})).set("themeTags",["tooltip","background"]),this._label=this.children.push(mt.new(this._root,{})),this._disposers.push(this._label.events.on("boundschanged",()=>{this._updateBackground()})),this._disposers.push(this.on("bounds",()=>{this._updateBackground()})),this._updateTextColor(),this._root.tooltipContainer.children.push(this),this.hide(0),this._disposers.push(this.label.onPrivate("htmlElement",e=>{e&&(this._disposers.push(N(e,"pointerover",i=>{this._htmlContentHovered=!0})),this._disposers.push(N(e,"pointerout",i=>{this._htmlContentHovered=!1})))})),this.on("visible",e=>{this._handleReaderAnnouncement()}),this.label.events.on("dataitemchanged",e=>{this._handleReaderAnnouncement()}),this._root._tooltips.push(this)}_handleReaderAnnouncement(){this.get("readerAnnounce")&&this.isVisibleDeep()&&this._root.readerAlert(this.label.getAccessibleText())}get label(){return this._label}_dispose(){super._dispose(),Nt(this._root._tooltips,this)}_updateChildren(){super._updateChildren(),(this.isDirty("pointerOrientation")||this.isPrivateDirty("minWidth")||this.isPrivateDirty("minHeight"))&&this.get("background")._markDirtyKey("width"),this.get("labelText")!=null&&this.label.set("text",this.get("labelText")),this.get("labelHTML")!=null&&this.label.set("html",this.get("labelHTML")),this.get("labelAriaLabel")!=null&&this.label.set("ariaLabel",this.get("labelAriaLabel"))}_changed(){if(super._changed(),(this.isDirty("pointTo")||this.isDirty("pointerOrientation"))&&this._updateBackground(),this.isDirty("tooltipTarget")&&this.updateBackgroundColor(),this.isDirty("keepTargetHover"))if(this.get("keepTargetHover")){let e=this.get("background");this._keepHoverDp=new xt([e.events.on("pointerover",i=>{let s=this.get("tooltipTarget");s&&(s.parent&&s.parent.getPrivate("tooltipTarget")==s&&(s=s.parent),s.hover())}),e.events.on("pointerout",i=>{let s=this.get("tooltipTarget");s&&(s.parent&&s.parent.getPrivate("tooltipTarget")==s&&(s=s.parent),this._htmlContentHovered||s.unhover())})]),this.label.onPrivate("htmlElement",i=>{this._keepHoverDp&&i&&this._keepHoverDp.disposers.push(N(i,"pointerleave",s=>{let r=this.root._renderer.getEvent(s);e.events.dispatch("pointerout",{type:"pointerout",originalEvent:r.event,point:r.point,simulated:!1,target:e})}))})}else this._keepHoverDp&&(this._keepHoverDp.dispose(),this._keepHoverDp=void 0)}_onShow(){super._onShow(),this.updateBackgroundColor()}updateBackgroundColor(){let t=this.get("tooltipTarget"),e=this.get("background"),i,s;if(t&&e){if(i=t.get("fill"),s=t.get("stroke"),i==null&&(i=s),this.get("getFillFromSprite")&&(this._fillDp&&this._fillDp.dispose(),i!=null&&e.set("fill",i),this._fillDp=t.on("fill",r=>{r!=null&&(e.set("fill",r),this._updateTextColor(r))}),this._disposers.push(this._fillDp)),this.get("getFillGradientFromSprite")){this._fillGrDp&&this._fillGrDp.dispose();let r=t.get("fillGradient");r!=null&&e.set("fillGradient",r),this._fillGrDp=t.on("fillGradient",a=>{a!=null&&e.set("fillGradient",a)}),this._disposers.push(this._fillGrDp)}this.get("getStrokeFromSprite")&&(this._strokeDp&&this._strokeDp.dispose(),i!=null&&e.set("stroke",i),this._strokeDp=t.on("fill",r=>{r!=null&&e.set("stroke",r)}),this._disposers.push(this._strokeDp)),this.get("getLabelFillFromSprite")&&(this._labelDp&&this._labelDp.dispose(),i!=null&&this.label.set("fill",i),this._labelDp=t.on("fill",r=>{r!=null&&this.label.set("fill",r)}),this._disposers.push(this._labelDp))}this._updateTextColor(i)}_updateTextColor(t){this.get("autoTextColor")&&(t==null&&(t=this.get("background").get("fill")),t==null&&(t=this._root.interfaceColors.get("background")),t instanceof Y&&this.label.set("fill",Y.alternative(t,this._root.interfaceColors.get("alternativeText"),this._root.interfaceColors.get("text"))))}_setDataItem(t){super._setDataItem(t),this.label._setDataItem(t)}_updateBackground(){super.updateBackground();let t=this._root.container;if(t){let e=.5,i=.5,s=this.get("centerX");s instanceof nt&&(e=s.value);let r=this.get("centerY");r instanceof nt&&(i=r.value);let a=t.width(),o=t.height(),n=this.parent,d=0,u=0;if(n){d=n.x(),u=n.y();let M=n.get("layerMargin");M&&(d+=M.left||0,u+=M.top||0,a+=(M.left||0)+(M.right||0),o+=(M.top||0)+(M.bottom||0))}let h=this.get("bounds",{left:-d,top:-u,right:a-d,bottom:o-u});this._updateBounds();let c=this.width(),l=this.height();c===0&&(c=this._w),l===0&&(l=this._h);let m=this.get("pointTo",{x:a/2,y:o/2}),_=m.x,f=m.y,p=this.get("pointerOrientation"),b=this.get("background"),x=0,y=0,v=0;b instanceof wt&&(x=b.get("pointerLength",0),y=b.get("strokeWidth",0)/2,v=y,b.set("width",c),b.set("height",l));let k=0,w=0,C=h.right-h.left,P=h.bottom-h.top;p=="horizontal"||p=="left"||p=="right"?(y=0,p=="horizontal"?_>h.left+C/2?(_-=c*(1-e)+x,v*=-1):_+=c*e+x:p=="left"?_+=c*(1-e)+x:(_-=c*e+x,v*=-1)):(v=0,p=="vertical"?f>h.top+l/2+x?f-=l*(1-i)+x:(f+=l*i+x,y*=-1):p=="down"?f-=l*(1-i)+x:(f+=l*i+x,y*=-1)),_=ot(_,h.left+c*e,h.left+C-c*(1-e))+v,f=ot(f,h.top+l*i,h.top+P-l*(1-i))-y,k=m.x-_+c*e+v,w=m.y-f+l*i-y,this._fx=_,this._fy=f;let S=this.get("animationDuration",0);if(S>0&&this.get("visible")&&this.get("opacity")>.1){let M=this.get("animationEasing");this.animate({key:"x",to:_,duration:S,easing:M}),this.animate({key:"y",to:f,duration:S,easing:M})}else this.set("x",_),this.set("y",f);b instanceof wt&&(b.set("pointerX",k),b.set("pointerY",w)),c>0&&(this._w=c),l>0&&(this._h=l)}}};_t.className="Tooltip";_t.classNames=$.classNames.concat([_t.className]);var Le=class extends I{_setDefaults(){this._setDefault("negativeBase",0),this._setDefault("numberFormat","#,###.#####"),this._setDefault("smallNumberThreshold",1);let t="_big_number_suffix_",e="_small_number_suffix_",i="_byte_suffix_";this._setDefault("bigNumberPrefixes",[{number:1e3,suffix:this._t(t+"3")},{number:1e6,suffix:this._t(t+"6")},{number:1e9,suffix:this._t(t+"9")},{number:1e12,suffix:this._t(t+"12")},{number:1e15,suffix:this._t(t+"15")},{number:1e18,suffix:this._t(t+"18")},{number:1e21,suffix:this._t(t+"21")},{number:1e24,suffix:this._t(t+"24")}]),this._setDefault("smallNumberPrefixes",[{number:1e-24,suffix:this._t(e+"24")},{number:1e-21,suffix:this._t(e+"21")},{number:1e-18,suffix:this._t(e+"18")},{number:1e-15,suffix:this._t(e+"15")},{number:1e-12,suffix:this._t(e+"12")},{number:1e-9,suffix:this._t(e+"9")},{number:1e-6,suffix:this._t(e+"6")},{number:.001,suffix:this._t(e+"3")}]),this._setDefault("bytePrefixes",[{number:1,suffix:this._t(i+"B")},{number:1024,suffix:this._t(i+"KB")},{number:1048576,suffix:this._t(i+"MB")},{number:1073741824,suffix:this._t(i+"GB")},{number:1099511627776,suffix:this._t(i+"TB")},{number:0x4000000000000,suffix:this._t(i+"PB")}]),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(t,e,i){(e==null||Tt(e)&&e.toLowerCase()==="number")&&(e=this.get("numberFormat",""));let s,r=Number(t);if(Lt(e))try{return this.get("intlLocales")?new Intl.NumberFormat(this.get("intlLocales"),e).format(r):new Intl.NumberFormat(void 0,e).format(r)}catch{return"Invalid"}else{e=Zt(e);let a=this.parseFormat(e,this._root.language),o;r>this.get("negativeBase")?o=a.positive:r<this.get("negativeBase")?o=a.negative:o=a.zero,i!=null&&!o.mod&&(o=as(o),o.decimals.active=r==0?0:i),s=o.template.split(Mt).join(this.applyFormat(r,o))}return this.get("forceLTR")===!0&&(s="\u200E"+s),s}parseFormat(t,e){let i=e.translateEmpty("_thousandSeparator"),s=e.translateEmpty("_decimalSeparator"),r={positive:{thousands:{active:-1,passive:-1,interval:-1,separator:i},decimals:{active:-1,passive:-1,separator:s},template:"",source:"",parsed:!1},negative:{thousands:{active:-1,passive:-1,interval:-1,separator:i},decimals:{active:-1,passive:-1,separator:s},template:"",source:"",parsed:!1},zero:{thousands:{active:-1,passive:-1,interval:-1,separator:i},decimals:{active:-1,passive:-1,separator:s},template:"",source:"",parsed:!1}};t=t.replace("||",At);let a=t.split("|");return r.positive.source=a[0],typeof a[2]>"u"?r.zero=r.positive:r.zero.source=a[2],typeof a[1]>"u"?r.negative=r.positive:r.negative.source=a[1],tt(r,(o,n)=>{if(n.parsed)return;let d=n.source;d.toLowerCase()==="number"&&(d=this.get("numberFormat","#,###.#####"));let u=lt.chunk(d,!0);for(let h=0;h<u.length;h++){let c=u[h];if(c.text=c.text.replace(At,"|"),c.type==="value"){let l=c.text.match(/[#0.,]+[ ]?[abespABESP%!]?[abespABESP‰!]?/);if(l)if(l===null||l[0]==="")n.template+=c.text;else{let m=l[0].match(/[abespABESP%‰!]{2}|[abespABESP%‰]{1}$/);m&&(n.mod=m[0].toLowerCase(),n.modSpacing=!!l[0].match(/[ ]{1}[abespABESP%‰!]{1}$/));let _=l[0].split(".");if(_[0]!==""){n.thousands.active=(_[0].match(/0/g)||[]).length,n.thousands.passive=(_[0].match(/\#/g)||[]).length+n.thousands.active;let f=_[0].split(",");f.length===1||(n.thousands.interval=(f.pop()||"").length,n.thousands.interval===0&&(n.thousands.interval=-1))}typeof _[1]>"u"||(n.decimals.active=(_[1].match(/0/g)||[]).length,n.decimals.passive=(_[1].match(/\#/g)||[]).length+n.decimals.active),n.template+=c.text.split(l[0]).join(Mt)}}else n.template+=c.text}n.parsed=!0}),r}applyFormat(t,e){let i=t<0;t=Math.abs(t);let s="",r="",a=e.mod?e.mod.split(""):[];if(a.indexOf("b")!==-1){let h=this.applyPrefix(t,this.get("bytePrefixes"),a.indexOf("!")!==-1);t=h[0],s=h[1],r=h[2],e.modSpacing&&(r=" "+r)}else if(a.indexOf("a")!==-1){let h=this.applyPrefix(t,t<this.get("smallNumberThreshold")?this.get("smallNumberPrefixes"):this.get("bigNumberPrefixes"),a.indexOf("!")!==-1);t=h[0],s=h[1],r=h[2],e.modSpacing&&(r=" "+r)}else if(a.indexOf("p")!==-1){let h=Math.min(t.toString().length+2,21);t=parseFloat(t.toPrecision(h)),s=this._root.language.translate("_percentPrefix"),r=this._root.language.translate("_percentSuffix"),s==""&&r==""&&(r="%")}else if(a.indexOf("%")!==-1){let h=Math.min(t.toString().length+2,21);t*=100,t=parseFloat(t.toPrecision(h)),r="%"}else if(a.indexOf("\u2030")!==-1){let h=Math.min(t.toString().length+3,21);t*=1e3,t=parseFloat(t.toPrecision(h)),r="\u2030"}if(a.indexOf("e")!==-1){let h;e.decimals.passive>=0?h=t.toExponential(e.decimals.passive).split("e"):h=t.toExponential().split("e"),t=Number(h[0]),r="e"+h[1],e.modSpacing&&(r=" "+r)}else if(e.decimals.passive===0)t=Math.round(t);else if(e.decimals.passive>0){let h=ps(t);if(h>0){let c=Math.pow(10,e.decimals.passive);t=Math.round(parseFloat((t*c).toFixed(h)))/c}}let o="",n=es(t).split("."),d=n[0];if(d.length<e.thousands.active&&(d=Array(e.thousands.active-d.length+1).join("0")+d),e.thousands.interval>0){let h=[],c=d.split("").reverse().join("");for(let l=0,m=d.length;l<=m;l+=e.thousands.interval){let _=c.substr(l,e.thousands.interval).split("").reverse().join("");_!==""&&h.unshift(_)}d=h.join(e.thousands.separator)}o+=d,n.length===1&&n.push("");let u=n[1];return u.length<e.decimals.active&&(u+=Array(e.decimals.active-u.length+1).join("0")),u!==""&&(o+=e.decimals.separator+u),o===""&&(o="0"),t!==0&&i&&a.indexOf("s")===-1&&(o="-"+o),s&&(o=s+o),r&&(o+=r),o}applyPrefix(t,e,i=!1){let s=t,r="",a="",o=!1,n=1;for(let d=0,u=e.length;d<u;d++)e[d].number<=t&&(e[d].number===0?s=0:(s=t/e[d].number,n=e[d].number),r=e[d].prefix,a=e[d].suffix,o=!0);return!o&&i&&e.length&&t!=0&&(s=t/e[0].number,r=e[0].prefix,a=e[0].suffix,o=!0),o&&(s=parseFloat(s.toPrecision(Math.min(n.toString().length+Math.floor(s).toString().replace(/[^0-9]*/g,"").length,21)))),[s,r,a]}escape(t){return t.replace("||",At)}unescape(t){return t.replace(At,"|")}};function $s(g,t){let e=0,i=0,s=1,r=0,a=0,o=0,n=0,d=0;return g.formatToParts(t).forEach(u=>{switch(u.type){case"year":e=+u.value;break;case"month":i=+u.value-1;break;case"day":s=+u.value;break;case"hour":r=+u.value;break;case"minute":a=+u.value;break;case"second":o=+u.value;break;case"fractionalSecond":n=+u.value;break;case"weekday":switch(u.value){case"Sun":d=0;break;case"Mon":d=1;break;case"Tue":d=2;break;case"Wed":d=3;break;case"Thu":d=4;break;case"Fri":d=5;break;case"Sat":d=6;break}}}),r===24&&(r=0),{year:e,month:i,day:s,hour:r,minute:a,second:o,millisecond:n,weekday:d}}function Es(g,t){let{year:e,month:i,day:s,hour:r,minute:a,second:o,millisecond:n}=$s(g,t);return Date.UTC(e,i,s,r,a,o,n)}var Ae=class{constructor(t,e){if(!e)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this.name=t,this._utc=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",fractionalSecondDigits:3}),this._dtf=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",fractionalSecondDigits:3})}static new(t){return new this(t,!0)}convertLocal(t){let e=this.offsetUTC(t),i=t.getTimezoneOffset(),s=new Date(t);s.setUTCMinutes(s.getUTCMinutes()-(e-i));let r=s.getTimezoneOffset();return i!=r&&s.setUTCMinutes(s.getUTCMinutes()+r-i),s}offsetUTC(t){let e=Es(this._utc,t),i=Es(this._dtf,t);return(e-i)/6e4}parseDate(t){return $s(this._dtf,t)}};var Ne=class extends I{_setDefaults(){this._setDefault("capitalize",!0),this._setDefault("dateFormat","yyyy-MM-dd"),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(t,e,i=!1){(typeof e>"u"||e==="")&&(e=this.get("dateFormat","yyyy-MM-dd"));let s,r=t;if(Lt(e))try{let d=this.get("intlLocales");return d?new Intl.DateTimeFormat(d,e).format(r):new Intl.DateTimeFormat(void 0,e).format(r)}catch{return"Invalid"}let a=this.parseFormat(e),o=this._root.timezone,n=r;return o&&!this._root.utc&&!i&&(r=o.convertLocal(r)),A(r.getTime())?(s=this.applyFormat(r,a,i,n),this.get("capitalize")&&(s=s.replace(/^.{1}/,s.substr(0,1).toUpperCase())),s):"Invalid date"}applyFormat(t,e,i=!1,s){let r=e.template,a,o,n,d,u,h,c,l,m=t.getTime();this._root.utc&&!i?(a=t.getUTCFullYear(),o=t.getUTCMonth(),n=t.getUTCDay(),d=t.getUTCDate(),u=t.getUTCHours(),h=t.getUTCMinutes(),c=t.getUTCSeconds(),l=t.getUTCMilliseconds()):(a=t.getFullYear(),o=t.getMonth(),n=t.getDay(),d=t.getDate(),u=t.getHours(),h=t.getMinutes(),c=t.getSeconds(),l=t.getMilliseconds());for(let _=0,f=e.parts.length;_<f;_++){let p="";switch(e.parts[_]){case"G":p=this._t(a<0?"_era_bc":"_era_ad");break;case"yyyy":p=Math.abs(a).toString(),a<0&&(p+=this._t("_era_bc"));break;case"yyy":case"yy":case"y":p=Math.abs(a).toString().substr(-e.parts[_].length),a<0&&(p+=this._t("_era_bc"));break;case"YYYY":case"YYY":case"YY":case"Y":let b=ys(t,this._root.utc);e.parts[_]=="YYYY"?p=Math.abs(b).toString():p=Math.abs(b).toString().substr(-e.parts[_].length),b<0&&(p+=this._t("_era_bc"));break;case"u":break;case"q":p=""+Math.ceil((t.getMonth()+1)/3);break;case"MMMMM":p=this._t(this._getMonth(o)).substr(0,1);break;case"MMMM":p=this._t(this._getMonth(o));break;case"MMM":p=this._t(this._getShortMonth(o));break;case"MM":p=Z(o+1,2,"0");break;case"M":p=(o+1).toString();break;case"ww":p=Z(pi(t,this._root.utc),2,"0");break;case"w":p=pi(t,this._root.utc).toString();break;case"W":p=xs(t,this._root.utc).toString();break;case"dd":p=Z(d,2,"0");break;case"d":p=d.toString();break;case"DD":case"DDD":p=Z(fi(t,this._root.utc).toString(),e.parts[_].length,"0");break;case"D":p=fi(t,this._root.utc).toString();break;case"F":break;case"g":break;case"t":p=this._root.language.translateFunc("_dateOrd").call(this,d);break;case"E":p=(n||7).toString();break;case"EE":p=Z((n||7).toString(),2,"0");break;case"EEE":case"eee":p=this._t(this._getShortWeekday(n));break;case"EEEE":case"eeee":p=this._t(this._getWeekday(n));break;case"EEEEE":case"eeeee":p=this._t(this._getShortWeekday(n)).substr(0,1);break;case"e":case"ee":p=(n-(this._root.locale.firstDayOfWeek||1)+1).toString(),e.parts[_]=="ee"&&(p=Z(p,2,"0"));break;case"a":u>=12?p=this._t("PM"):p=this._t("AM");break;case"aa":u>=12?p=this._t("P.M."):p=this._t("A.M.");break;case"aaa":u>=12?p=this._t("P"):p=this._t("A");break;case"h":p=$e(u).toString();break;case"hh":p=Z($e(u),2,"0");break;case"H":p=u.toString();break;case"HH":p=Z(u,2,"0");break;case"K":p=$e(u,0).toString();break;case"KK":p=Z($e(u,0),2,"0");break;case"k":p=(u+1).toString();break;case"kk":p=Z(u+1,2,"0");break;case"m":p=h.toString();break;case"mm":p=Z(h,2,"0");break;case"s":p=c.toString();break;case"ss":p=Z(c,2,"0");break;case"S":case"SS":case"SSS":p=Math.round(l/1e3*Math.pow(10,e.parts[_].length)).toString();break;case"x":p=m.toString();break;case"n":case"nn":case"nnn":p=Z(l,e.parts[_].length,"0");break;case"z":p=Pe(s||t,!1,!1,this._root.utc,this._root.timezone?this._root.timezone.name:void 0).replace(/[+-]+[0-9]+$/,"");break;case"zz":p=Pe(s||t,!0,!1,this._root.utc,this._root.timezone?this._root.timezone.name:void 0);break;case"zzz":p=Pe(s||t,!1,!0,this._root.utc,this._root.timezone?this._root.timezone.name:void 0).replace(/[+-]+[0-9]+$/,"");break;case"zzzz":p=Pe(s||t,!0,!0,this._root.utc,this._root.timezone?this._root.timezone.name:void 0);break;case"Z":case"ZZ":let x=this._root.utc?"UTC":this._root.timezone;x instanceof Ae&&(x=x.name);let y=x?vs(x,s||t):t.getTimezoneOffset(),v=Math.abs(y)/60,k=Math.floor(v),w=v*60-k*60;this._root.utc&&(k=0,w=0),e.parts[_]=="Z"?(p="GMT",p+=y>0?"-":"+",p+=Z(k,2)+":"+Z(w,2)):(p=y>0?"-":"+",p+=Z(k,2)+Z(w,2));break;case"i":p=t.toISOString();break;case"I":p=t.toUTCString();break}r=r.replace(Mt,p)}return r}parseFormat(t){let e={template:"",parts:[]},i=lt.chunk(t,!0);for(let s=0;s<i.length;s++){let r=i[s];if(r.type==="value"){if(r.text.match(/^date$/i)){let o=this.get("dateFormat","yyyy-MM-dd");Tt(o)||(o="yyyy-MM-dd"),r.text=o}let a=r.text.match(/G|yyyy|yyy|yy|y|YYYY|YYY|YY|Y|u|q|MMMMM|MMMM|MMM|MM|M|ww|w|W|dd|d|DDD|DD|D|F|g|EEEEE|EEEE|EEE|EE|E|eeeee|eeee|eee|ee|e|aaa|aa|a|hh|h|HH|H|KK|K|kk|k|mm|m|ss|s|SSS|SS|S|A|zzzz|zzz|zz|z|ZZ|Z|t|x|nnn|nn|n|i|I/g);if(a)for(let o=0;o<a.length;o++)e.parts.push(a[o]),r.text=r.text.replace(a[o],Mt)}e.template+=r.text}return e}_months(){return["January","February","March","April","May","June","July","August","September","October","November","December"]}_getMonth(t){return this._months()[t]}_shortMonths(){return["Jan","Feb","Mar","Apr","May(short)","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}_getShortMonth(t){return this._shortMonths()[t]}_weekdays(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]}_getWeekday(t){return this._weekdays()[t]}_shortWeekdays(){return["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]}_getShortWeekday(t){return this._shortWeekdays()[t]}parse(t,e,i){if(typeof i>"u"&&(i=this._root.utc),t instanceof Date)return t;if(A(t))return new Date(t);if(e=="x")return new Date(parseInt(t));Tt(t)||(t=t.toString());let s,r="";e=Zt(e),e=e.substr(0,t.length);let a=this.parseFormat(e),o={year:-1,year3:-1,year2:-1,year1:-1,month:-1,monthShort:-1,monthLong:-1,weekdayShort:-1,weekdayLong:-1,day:-1,yearDay:-1,week:-1,hourBase0:-1,hour12Base0:-1,hourBase1:-1,hour12Base1:-1,minute:-1,second:-1,millisecond:-1,millisecondDigits:-1,am:-1,zone:-1,timestamp:-1,iso:-1},n={year:1970,month:0,day:1,hour:0,minute:0,second:0,millisecond:0,timestamp:null,offset:0,utc:i},d=0,u=0;for(let l=0;l<a.parts.length;l++){switch(u=l+d+1,a.parts[l]){case"yyyy":case"YYYY":r+="([0-9]{4})",o.year=u;break;case"yyy":case"YYY":r+="([0-9]{3})",o.year3=u;break;case"yy":case"YY":r+="([0-9]{2})",o.year2=u;break;case"y":case"Y":r+="([0-9]{1})",o.year1=u;break;case"MMMM":r+="("+this.getStringList(this._months()).join("|")+")",o.monthLong=u;break;case"MMM":r+="("+this.getStringList(this._shortMonths()).join("|")+")",o.monthShort=u;break;case"MM":case"M":r+="([0-9]{2}|[0-9]{1})",o.month=u;break;case"ww":case"w":r+="([0-9]{2}|[0-9]{1})",o.week=u;break;case"dd":case"d":r+="([0-9]{2}|[0-9]{1})",o.day=u;break;case"DDD":case"DD":case"D":r+="([0-9]{3}|[0-9]{2}|[0-9]{1})",o.yearDay=u;break;case"dddd":r+="("+this.getStringList(this._weekdays()).join("|")+")",o.weekdayLong=u;break;case"ddd":r+="("+this.getStringList(this._shortWeekdays()).join("|")+")",o.weekdayShort=u;break;case"aaa":case"aa":case"a":r+="("+this.getStringList(["AM","PM","A.M.","P.M.","A","P"]).join("|")+")",o.am=u;break;case"hh":case"h":r+="([0-9]{2}|[0-9]{1})",o.hour12Base1=u;break;case"HH":case"H":r+="([0-9]{2}|[0-9]{1})",o.hourBase0=u;break;case"KK":case"K":r+="([0-9]{2}|[0-9]{1})",o.hour12Base0=u;break;case"kk":case"k":r+="([0-9]{2}|[0-9]{1})",o.hourBase1=u;break;case"mm":case"m":r+="([0-9]{2}|[0-9]{1})",o.minute=u;break;case"ss":case"s":r+="([0-9]{2}|[0-9]{1})",o.second=u;break;case"SSS":case"SS":case"S":r+="([0-9]{3}|[0-9]{2}|[0-9]{1})",o.millisecond=u,o.millisecondDigits=a.parts[l].length;break;case"nnn":case"nn":case"n":r+="([0-9]{3}|[0-9]{2}|[0-9]{1})",o.millisecond=u;break;case"x":r+="([0-9]{1,})",o.timestamp=u;break;case"Z":r+="GMT([-+]+[0-9]{2}:[0-9]{2})",o.zone=u;break;case"ZZ":r+="([\\-+]+[0-9]{2}[0-9]{2})",o.zone=u;break;case"i":r+="([0-9]{4})-?([0-9]{2})-?([0-9]{2})T?([0-9]{2}):?([0-9]{2}):?([0-9]{2})\\.?([0-9]{0,3})([zZ]|[+\\-][0-9]{2}:?[0-9]{2}|$)",o.iso=u,d+=7;break;case"G":case"YYYY":case"YYY":case"YY":case"Y":case"MMMMM":case"W":case"EEEEE":case"EEEE":case"EEE":case"EE":case"E":case"eeeee":case"eeee":case"eee":case"ee":case"e":case"zzzz":case"zzz":case"zz":case"z":case"t":d--;break}r+="[^0-9]*"}let h=new RegExp(r),c=t.match(h);if(c){if(o.year>-1&&(n.year=parseInt(c[o.year])),o.year3>-1){let l=parseInt(c[o.year3]);l+=1e3,n.year=l}if(o.year2>-1){let l=parseInt(c[o.year2]);l>50?l+=1e3:l+=2e3,n.year=l}if(o.year1>-1){let l=parseInt(c[o.year1]);l=Math.floor(new Date().getFullYear()/10)*10+l,n.year=l}if(o.monthLong>-1&&(n.month=this.resolveMonth(c[o.monthLong])),o.monthShort>-1&&(n.month=this.resolveShortMonth(c[o.monthShort])),o.month>-1&&(n.month=parseInt(c[o.month])-1),o.week>-1&&o.day===-1&&(n.month=0,n.day=bs(parseInt(c[o.week]),n.year,1,i)),o.day>-1&&(n.day=parseInt(c[o.day])),o.yearDay>-1&&(n.month=0,n.day=parseInt(c[o.yearDay])),o.hourBase0>-1&&(n.hour=parseInt(c[o.hourBase0])),o.hourBase1>-1&&(n.hour=parseInt(c[o.hourBase1])-1),o.hour12Base0>-1){let l=parseInt(c[o.hour12Base0]);l==11&&(l=0),o.am>-1&&!this.isAm(c[o.am])&&(l+=12),n.hour=l}if(o.hour12Base1>-1){let l=parseInt(c[o.hour12Base1]);l==12&&(l=0),o.am>-1&&!this.isAm(c[o.am])&&(l+=12),n.hour=l}if(o.minute>-1&&(n.minute=parseInt(c[o.minute])),o.second>-1&&(n.second=parseInt(c[o.second])),o.millisecond>-1){let l=parseInt(c[o.millisecond]);o.millisecondDigits==2?l*=10:o.millisecondDigits==1&&(l*=100),n.millisecond=l}if(o.timestamp>-1){n.timestamp=parseInt(c[o.timestamp]);let l=new Date(n.timestamp);n.year=l.getUTCFullYear(),n.month=l.getUTCMonth(),n.day=l.getUTCDate(),n.hour=l.getUTCHours(),n.minute=l.getUTCMinutes(),n.second=l.getUTCSeconds(),n.millisecond=l.getUTCMilliseconds()}o.zone>-1&&(n.offset=this.resolveTimezoneOffset(new Date(n.year,n.month,n.day),c[o.zone])),o.iso>-1&&(n.year=rt(c[o.iso+0]),n.month=rt(c[o.iso+1])-1,n.day=rt(c[o.iso+2]),n.hour=rt(c[o.iso+3]),n.minute=rt(c[o.iso+4]),n.second=rt(c[o.iso+5]),n.millisecond=rt(c[o.iso+6]),c[o.iso+7]=="Z"||c[o.iso+7]=="z"?n.utc=!0:c[o.iso+7]!=""&&(n.offset=this.resolveTimezoneOffset(new Date(n.year,n.month,n.day),c[o.iso+7]))),n.utc?s=new Date(Date.UTC(n.year,n.month,n.day,n.hour,n.minute,n.second,n.millisecond)):s=new Date(n.year,n.month,n.day,n.hour,n.minute+n.offset,n.second,n.millisecond)}else s=new Date(t);return s}resolveTimezoneOffset(t,e){if(e.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/)){let s=e.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/),r=s[1],a=s[2],o=s[3],n=parseInt(a)*60+parseInt(o);r=="+"&&(n*=-1);let d=(t||new Date).getTimezoneOffset();return n-d}return 0}resolveMonth(t){let e=this._months().indexOf(t);return e>-1||!this._root.language.isDefault()&&(e=this._root.language.translateAll(this._months()).indexOf(t),e>-1)?e:0}resolveShortMonth(t){let e=this._shortMonths().indexOf(t);return e>-1||(e=this._months().indexOf(t),e>-1)||this._root.language&&!this._root.language.isDefault()&&(e=this._root.language.translateAll(this._shortMonths()).indexOf(t),e>-1)?e:0}isAm(t){return this.getStringList(["AM","A.M.","A"]).indexOf(t.toUpperCase())>-1}getStringList(t){let e=[];for(let i=0;i<t.length;i++)this._root.language?e.push(ui(this._t(t[i]))):e.push(ui(t[i]));return e}};var ze=class extends I{constructor(){super(...arguments),this._unitAliases={Y:"y",D:"d",H:"h",K:"h",k:"h",n:"S"}}_setDefaults(){let t="_duration_millisecond",e="_duration_second",i="_duration_minute",s="_duration_hour",r="_duration_day",a="_duration_week",o="_duration_month",n="_duration_year",d="_second",u="_minute",h="_hour",c="_day",l="_week",m="_week",_="_year";this._setDefault("negativeBase",0),this._setDefault("baseUnit","second"),this._setDefault("durationFormats",{millisecond:{millisecond:this._t(t),second:this._t(t+d),minute:this._t(t+u),hour:this._t(t+h),day:this._t(t+c),week:this._t(t+l),month:this._t(t+m),year:this._t(t+_)},second:{second:this._t(e),minute:this._t(e+u),hour:this._t(e+h),day:this._t(e+c),week:this._t(e+l),month:this._t(e+m),year:this._t(e+_)},minute:{minute:this._t(i),hour:this._t(i+h),day:this._t(i+c),week:this._t(i+l),month:this._t(i+m),year:this._t(i+_)},hour:{hour:this._t(s),day:this._t(s+c),week:this._t(s+l),month:this._t(s+m),year:this._t(s+_)},day:{day:this._t(r),week:this._t(r+l),month:this._t(r+m),year:this._t(r+_)},week:{week:this._t(a),month:this._t(a+m),year:this._t(a+_)},month:{month:this._t(o),year:this._t(o+_)},year:{year:this._t(n)}}),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(t,e,i){let s=i||this.get("baseUnit");(typeof e>"u"||e==="")&&(this.get("durationFormat")!=null?e=this.get("durationFormat"):e=this.getFormat(rt(t),void 0,s)),e=Zt(e);let r=this.parseFormat(e,s),a=Number(t),o;a>this.get("negativeBase")?o=r.positive:a<this.get("negativeBase")?o=r.negative:o=r.zero;let n=this.applyFormat(a,o);return o.color!==""&&(n="["+o.color+"]"+n+"[/]"),n}parseFormat(t,e){let i=e||this.get("baseUnit"),s={positive:{color:"",template:"",parts:[],source:"",baseUnit:i,parsed:!1,absolute:!1},negative:{color:"",template:"",parts:[],source:"",baseUnit:i,parsed:!1,absolute:!1},zero:{color:"",template:"",parts:[],source:"",baseUnit:i,parsed:!1,absolute:!1}};t=t.replace("||",At);let r=t.split("|");return s.positive.source=r[0],typeof r[2]>"u"?s.zero=s.positive:s.zero.source=r[2],typeof r[1]>"u"?s.negative=s.positive:s.negative.source=r[1],tt(s,(a,o)=>{if(o.parsed)return;let n=o.source,d=[];d=o.source.match(/^\[([^\]]*)\]/),d&&d.length&&d[0]!==""&&(n=o.source.substr(d[0].length),o.color=d[1]);let u=lt.chunk(n,!0);for(let h=0;h<u.length;h++){let c=u[h];if(c.text=c.text.replace(At,"|"),c.type==="value"){c.text.match(/[yYMdDwhHKkmsSn]+a/)&&(o.absolute=!0,c.text=c.text.replace(/([yYMdDwhHKkmsSn]+)a/,"$1"));let l=c.text.match(/y+|Y+|M+|d+|D+|w+|h+|H+|K+|k+|m+|s+|S+|n+/g);if(l)for(let m=0;m<l.length;m++)l[m]==null&&(l[m]=this._unitAliases[l[m]]),o.parts.push(l[m]),c.text=c.text.replace(l[m],Mt)}o.template+=c.text}o.parsed=!0}),s}applyFormat(t,e){let i=!e.absolute&&t<this.get("negativeBase");t=Math.abs(t);let s=this.toTimeStamp(t,e.baseUnit),r=e.template,a={millisecond:0,second:0,minute:0,hour:0,day:0,week:0,month:0,year:0};for(let o=0,n=e.parts.length;o<n;o++){let d=e.parts[o],u=this._toTimeUnit(d.substr(0,1)),h,c=this._getUnitValue(u);o<n-1?h=Math.floor(s/c):h=Math.round(s/c),a[u]+=h,s-=h*c}tt(a,(o,n)=>{o=="millisecond"&&n==1e3?(a.second++,a.millisecond=0):o=="second"&&n==60?(a.minute++,a.second=0):o=="minute"&&n==60?(a.hour++,a.minute=0):o=="hour"&&n==24?(a.day++,a.hour=0):o=="day"&&n==7&&e.parts.indexOf("w")!==-1?(a.week++,a.day=0):o=="day"&&n==30?(a.month++,a.day=0):o=="month"&&n==12&&(a.year++,a.month=0)});for(let o=0,n=e.parts.length;o<n;o++){let d=e.parts[o],u=this._toTimeUnit(d.substr(0,1)),h=d.length;r=r.replace(Mt,Z(a[u],h,"0"))}return i&&(r="-"+r),r}toTimeStamp(t,e){return t*this._getUnitValue(e)}_toTimeUnit(t){switch(t){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year"}}getFormat(t,e,i){if(this.get("durationFormat")!=null)return this.get("durationFormat");if(i||(i=this.get("baseUnit")),e!=null&&t!=e){t=Math.abs(t),e=Math.abs(e);let s=this.getValueUnit(Math.max(t,e),i);return this.get("durationFormats")[i][s]}else{let s=this.getValueUnit(t,i);return this.get("durationFormats")[i][s]}}getValueUnit(t,e){e||(e=this.get("baseUnit"));let i,s=this.getMilliseconds(t,e);return os(this._getUnitValues(),(r,a)=>{if(r==e||i){if(s/a<=1)return i||(i=r),!1;i=r}return!0}),i}getMilliseconds(t,e){return e||(e=this.get("baseUnit")),t*this._getUnitValue(e)}_getUnitValue(t){return this._getUnitValues()[t]}_getUnitValues(){return{millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2592e6,year:31536e6}}};var ii={firstDayOfWeek:1,_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"\u03BC",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date:"yyyy-MM-dd",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_short:"HH",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"AD",_era_bc:"BC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"",February:"",March:"",April:"",May:"",June:"",July:"",August:"",September:"",October:"",November:"",December:"",Jan:"",Feb:"",Mar:"",Apr:"","May(short)":"May",Jun:"",Jul:"",Aug:"",Sep:"",Oct:"",Nov:"",Dec:"",Sunday:"",Monday:"",Tuesday:"",Wednesday:"",Thursday:"",Friday:"",Saturday:"",Sun:"",Mon:"",Tue:"",Wed:"",Thu:"",Fri:"",Sat:"",_dateOrd:function(g){let t="th";if(g<11||g>13)switch(g%10){case 1:t="st";break;case 2:t="nd";break;case 3:t="rd";break}return t},"Zoom Out":"",Play:"",Stop:"",Legend:"","Press ENTER to toggle":"",Loading:"",Home:"",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Force directed tree":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"",Image:"",Data:"",Print:"","Press ENTER or use arrow keys to navigate":"","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"","From %1":"","To %1":"","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":"",Close:"",Minimize:"",Confirm:""};var si=class extends I{_setDefaults(){this.setPrivate("defaultLocale",ii),super._setDefaults()}translate(t,e,...i){e||(e=this._root.locale||this.getPrivate("defaultLocale"));let s=t,r=e[t];if(r===null)s="";else if(r!=null)r&&(s=r);else if(e!==this.getPrivate("defaultLocale"))return this.translate(t,this.getPrivate("defaultLocale"),...i);if(i.length)for(let a=i.length,o=0;o<a;++o)s=s.split("%"+(o+1)).join(i[o]);return s}translateAny(t,e,...i){return this.translate(t,e,...i)}setTranslationAny(t,e,i){let s=i||this._root.locale;s[t]=e}setTranslationsAny(t,e){tt(t,(i,s)=>{this.setTranslationAny(i,s,e)})}translateEmpty(t,e,...i){let s=this.translate(t,e,...i);return s==t?"":s}translateFunc(t,e){return this._root.locale[t]?this._root.locale[t]:e!==this.getPrivate("defaultLocale")?this.translateFunc(t,this.getPrivate("defaultLocale")):()=>""}translateAll(t,e){return this.isDefault()?t:ss(t,i=>this.translate(i,e))}isDefault(){return this.getPrivate("defaultLocale")===this._root.locale}};var Jt=class{constructor(t=1,e=0,i=0,s=1,r=0,a=0){this.a=t,this.b=e,this.c=i,this.d=s,this.tx=r,this.ty=a}setTransform(t,e,i,s,r,a=1){this.a=Math.cos(r)*a,this.b=Math.sin(r)*a,this.c=-Math.sin(r)*a,this.d=Math.cos(r)*a,this.tx=t-(i*this.a+s*this.c),this.ty=e-(i*this.b+s*this.d)}apply(t){return{x:this.a*t.x+this.c*t.y+this.tx,y:this.b*t.x+this.d*t.y+this.ty}}applyInverse(t){let e=1/(this.a*this.d+this.c*-this.b);return{x:this.d*e*t.x+-this.c*e*t.y+(this.ty*this.c-this.tx*this.d)*e,y:this.a*e*t.y+-this.b*e*t.x+(-this.ty*this.a+this.tx*this.b)*e}}append(t){let e=this.a,i=this.b,s=this.c,r=this.d;this.a=t.a*e+t.b*s,this.b=t.a*i+t.b*r,this.c=t.c*e+t.d*s,this.d=t.c*i+t.d*r,this.tx=t.tx*e+t.ty*s+this.tx,this.ty=t.tx*i+t.ty*r+this.ty}prepend(t){let e=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){let i=this.a,s=this.c;this.a=i*t.a+this.b*t.c,this.b=i*t.b+this.b*t.d,this.c=s*t.a+this.d*t.c,this.d=s*t.b+this.d*t.d}this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty}copyFrom(t){this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty}};var Hs=(function(){function g(t,e){var i=[],s=!0,r=!1,a=void 0;try{for(var o=t[Symbol.iterator](),n;!(s=(n=o.next()).done)&&(i.push(n.value),!(e&&i.length===e));s=!0);}catch(d){r=!0,a=d}finally{try{!s&&o.return&&o.return()}finally{if(r)throw a}}return i}return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return g(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),Re=Math.PI*2,Ti=function(t,e,i,s,r,a,o){var n=t.x,d=t.y;n*=e,d*=i;var u=s*n-r*d,h=r*n+s*d;return{x:u+a,y:h+o}},Is=function(t,e){var i=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(e/4),s=Math.cos(t),r=Math.sin(t),a=Math.cos(t+e),o=Math.sin(t+e);return[{x:s-r*i,y:r+s*i},{x:a+o*i,y:o-a*i},{x:a,y:o}]},Ps=function(t,e,i,s){var r=t*s-e*i<0?-1:1,a=t*i+e*s;return a>1&&(a=1),a<-1&&(a=-1),r*Math.acos(a)},Ys=function(t,e,i,s,r,a,o,n,d,u,h,c){var l=Math.pow(r,2),m=Math.pow(a,2),_=Math.pow(h,2),f=Math.pow(c,2),p=l*m-l*f-m*_;p<0&&(p=0),p/=l*f+m*_,p=Math.sqrt(p)*(o===n?-1:1);var b=p*r/a*c,x=p*-a/r*h,y=u*b-d*x+(t+i)/2,v=d*b+u*x+(e+s)/2,k=(h-b)/r,w=(c-x)/a,C=(-h-b)/r,P=(-c-x)/a,S=Ps(1,0,k,w),M=Ps(k,w,C,P);return n===0&&M>0&&(M-=Re),n===1&&M<0&&(M+=Re),[y,v,S,M]},Ws=function(t){var e=t.px,i=t.py,s=t.cx,r=t.cy,a=t.rx,o=t.ry,n=t.xAxisRotation,d=n===void 0?0:n,u=t.largeArcFlag,h=u===void 0?0:u,c=t.sweepFlag,l=c===void 0?0:c,m=[];if(a===0||o===0)return[];var _=Math.sin(d*Re/360),f=Math.cos(d*Re/360),p=f*(e-s)/2+_*(i-r)/2,b=-_*(e-s)/2+f*(i-r)/2;if(p===0&&b===0)return[];a=Math.abs(a),o=Math.abs(o);var x=Math.pow(p,2)/Math.pow(a,2)+Math.pow(b,2)/Math.pow(o,2);x>1&&(a*=Math.sqrt(x),o*=Math.sqrt(x));var y=Ys(e,i,s,r,a,o,h,l,_,f,p,b),v=Hs(y,4),k=v[0],w=v[1],C=v[2],P=v[3],S=Math.abs(P)/(Re/4);Math.abs(1-S)<1e-7&&(S=1);var M=Math.max(Math.ceil(S),1);P/=M;for(var D=0;D<M;D++)m.push(Is(C,P)),C+=P;return m.map(function(E){var F=Ti(E[0],a,o,f,_,k,w),B=F.x,U=F.y,L=Ti(E[1],a,o,f,_,k,w),O=L.x,R=L.y,H=Ti(E[2],a,o,f,_,k,w),it=H.x,G=H.y;return{x1:B,y1:U,x2:O,y2:R,x:it,y:G}})},Bs=Ws;function Gs(g,t,e){if(t!==e)throw new Error("Required "+e+" arguments for "+g+" but got "+t)}function Fe(g,t,e){if(t<e)throw new Error("Required at least "+e+" arguments for "+g+" but got "+t)}function dt(g,t,e){if(Fe(g,t,e),t%e!==0)throw new Error("Arguments for "+g+" must be in pairs of "+e)}function Vs(g){for(let t=0;t<g.length;t+=7){let e=t+3,i=g[e];if(i.length>1){let s=/^([01])([01])(.*)$/.exec(i);s!==null&&(g.splice(e,0,s[1]),++e,g.splice(e,0,s[2]),++e,s[3].length>0?g[e]=s[3]:g.splice(e,1))}if(++e,i=g[e],i.length>1){let s=/^([01])(.+)$/.exec(i);s!==null&&(g.splice(e,0,s[1]),++e,g[e]=s[2])}}}function Ls(g){if(g===0||g===1)return g;throw new Error("Flag must be 0 or 1")}function Xs(g){let t=[0,0,0];for(let e=0;e<24;e++)t[e%3]<<=1,t[e%3]|=g&1,g>>=1;return(t[0]|0)+(t[1]<<8)+(t[2]<<16)}function ri(g,t){for(;!(g.interactive&&!t(g));)if(g._parent)g=g._parent;else break}function Us(g,t,e){return N(g,je(t),i=>{let s=ci(i),r=i.touches;r?(r.length==0&&(r=i.changedTouches),e(Ut(r),s)):e([i],s)})}function As(g){let t=document.createElement("canvas");t.width=1,t.height=1;let e=t.getContext("2d",{willReadFrequently:!0});e.drawImage(g,0,0,1,1);try{return e.getImageData(0,0,1,1),!1}catch{return console.warn('Image "'+g.src+'" is loaded from different host and is not covered by CORS policy. For more information about the implications read here: https://www.amcharts.com/docs/v5/concepts/cors'),!0}}function Oe(g){g.width=0,g.height=0,g.style.width="0px",g.style.height="0px"}function Mi(g){return Math.floor(g)+.5}var Si=class{constructor(){this._x=0,this._y=0}get x(){return this._x}get y(){return this._y}set x(t){this._x=t}set y(t){this._y=t}},Qt=class extends ns{constructor(t){super(),this.mask=null,this.visible=!0,this.exportable=!0,this.interactive=!1,this.inactive=null,this.wheelable=!1,this.cancelTouch=!1,this.isMeasured=!1,this.buttonMode=!1,this.alpha=1,this.compoundAlpha=1,this.angle=0,this.scale=1,this.x=0,this.y=0,this.crisp=!1,this.pivot=new Si,this._localMatrix=new Jt,this._matrix=new Jt,this._uMatrix=new Jt,this._mx=NaN,this._my=NaN,this._mpx=NaN,this._mpy=NaN,this._mAngle=NaN,this._mScale=NaN,this._renderer=t}subStatus(t){return{inactive:this.inactive==null?t.inactive:this.inactive,layer:this._layer||t.layer}}_dispose(){this._renderer._removeObject(this),this.getLayer().dirty=!0}getCanvas(){return this.getLayer().view}getLayer(){let t=this;for(;;){if(t._layer)return t._layer;if(t._parent)t=t._parent;else return this._renderer.defaultLayer}}setLayer(t,e){t==null?this._layer=void 0:(this._layer=this._renderer.getLayer(t,!0),this._layer.visible=!0,this._layer.margin=e,e&&zt(this._layer.view,!1),this._renderer._ghostLayer.setMargin(this._renderer.layers),this._parent&&this._parent.registerChildLayer(this._layer),this._layer.dirty=!0,this._renderer.resizeLayer(this._layer),this._renderer.resizeGhost())}markDirtyLayer(){this.getLayer().dirty=!0}clear(){this.invalidateBounds()}invalidateBounds(){this._localBounds=void 0}_addBounds(t){}_getColorId(){return this._colorId===void 0&&(this._colorId=this._renderer.paintId(this)),this._colorId}_isInteractive(t){return!t.inactive&&(this.interactive||this._renderer._forceInteractive>0)}_isInteractiveMask(t){return this._isInteractive(t)}contains(t){for(;;){if(t===this)return!0;if(t._parent)t=t._parent;else return!1}}toGlobal(t){return this._matrix.apply(t)}toLocal(t){return this._matrix.applyInverse(t)}getLocalMatrix(){return this._uMatrix.setTransform(0,0,this.pivot.x,this.pivot.y,this.angle*Math.PI/180,this.scale),this._uMatrix}getLocalBounds(){return this._localBounds||(this._localBounds={left:1e7,top:1e7,right:-1e7,bottom:-1e7},this._addBounds(this._localBounds)),this._localBounds}getAdjustedBounds(t){this._setMatrix();let e=this.getLocalMatrix(),i=e.apply({x:t.left,y:t.top}),s=e.apply({x:t.right,y:t.top}),r=e.apply({x:t.right,y:t.bottom}),a=e.apply({x:t.left,y:t.bottom});return{left:Math.min(i.x,s.x,r.x,a.x),top:Math.min(i.y,s.y,r.y,a.y),right:Math.max(i.x,s.x,r.x,a.x),bottom:Math.max(i.y,s.y,r.y,a.y)}}on(t,e,i){return this.interactive?this._renderer._addEvent(this,t,e,i):new yt(()=>{})}_setMatrix(){let t=this.pivot.x,e=this.pivot.y;(this.x!==this._mx||this.y!==this._my||t!==this._mpx||e!==this._mpy||this.angle!==this._mAngle||this.scale!==this._mScale)&&(this._localMatrix.setTransform(this.x,this.y,t,e,this.angle*Math.PI/180,this.scale),this._mx=this.x,this._my=this.y,this._mpx=t,this._mpy=e,this._mAngle=this.angle,this._mScale=this.scale),this._matrix.copyFrom(this._localMatrix),this._parent&&this._matrix.prepend(this._parent._matrix)}_transform(t,e){let i=this._matrix,s=i.tx*e,r=i.ty*e;this.crisp&&(s=Mi(s),r=Mi(r)),t.setTransform(i.a*e,i.b*e,i.c*e,i.d*e,s,r)}_transformMargin(t,e,i){let s=this._matrix;t.setTransform(s.a*e,s.b*e,s.c*e,s.d*e,(s.tx+i.left)*e,(s.ty+i.top)*e)}_transformLayer(t,e,i){i.margin?this._transformMargin(t,i.scale||e,i.margin):this._transform(t,i.scale||e)}render(t,e=0){if(this.visible&&(this.exportable!==!1||!this._renderer._omitTainted)){this._setMatrix();let i=this.subStatus(t),s=this._renderer.resolution,r=this._renderer.layers,a=this._renderer._ghostLayer,o=a.context,n=this.mask;n&&n._setMatrix(),T(r,d=>{if(d){let u=d.context;u.save(),n&&(n._transformLayer(u,s,d),n._runPath(u),u.clip()),u.globalAlpha=this.compoundAlpha*this.alpha,this._transformLayer(u,s,d),this.filter&&(u.filter=this.filter)}}),o.save(),n&&this._isInteractiveMask(i)&&(n._transformMargin(o,s,a.margin),n._runPath(o),o.clip()),this._transformMargin(o,s,a.margin),i.layer.order>0&&!e&&rs(this._renderer._deferredGhostLayers,i.layer.order),this._render(i,e),o.restore(),T(r,d=>{d&&d.context.restore()})}}_render(t,e=0){this.exportable===!1&&(t.layer.tainted=!0)}_ghostOnly(t=0){return t>0}_drawGhost(t,e=0){let i=this._isInteractive(t),s=t.layer.order||0;return!!(i&&(s==0&&!this._ghostOnly(e)||s==e))}hovering(){return this._renderer._hovering.has(this)}dragging(){return this._renderer._dragging.some(t=>t.value===this)}shouldCancelTouch(){let t=this._renderer;return t.tapToActivate&&!t._touchActive?!1:this.cancelTouch?!0:this._parent?this._parent.shouldCancelTouch():!1}},Ci=class extends Qt{constructor(){super(...arguments),this.interactiveChildren=!0,this._children=[]}_isInteractiveMask(t){return this.interactiveChildren||super._isInteractiveMask(t)}addChild(t){t._parent=this,this._children.push(t),t._layer&&this.registerChildLayer(t._layer)}addChildAt(t,e){t._parent=this,this._children.splice(e,0,t),t._layer&&this.registerChildLayer(t._layer)}removeChild(t){t._parent=void 0,Te(this._children,t)}_render(t,e){super._render(t);let i=this._renderer;this.interactive&&this.interactiveChildren&&++i._forceInteractive,T(this._children,s=>{s.compoundAlpha=this.compoundAlpha*this.alpha,s.render(t,e)}),this.interactive&&this.interactiveChildren&&--i._forceInteractive}registerChildLayer(t){this._childLayers||(this._childLayers=[]),Me(this._childLayers,t),this._parent&&this._parent.registerChildLayer(t)}markDirtyLayer(t=!1){super.markDirtyLayer(),t&&this._childLayers&&T(this._childLayers,e=>e.dirty=!0)}_dispose(){super._dispose(),this._childLayers&&T(this._childLayers,t=>{t.dirty=!0})}};function j(g,t){g.left=Math.min(g.left,t.x),g.top=Math.min(g.top,t.y),g.right=Math.max(g.right,t.x),g.bottom=Math.max(g.bottom,t.y)}var q=class{colorize(t,e){}colorizeGhost(t,e){this.colorize(t,e)}path(t){}pathGhost(t){this.path(t)}addBounds(t){}},Di=class extends q{colorize(t,e){t.beginPath()}},He=class extends q{constructor(t){super(),this.color=t}colorize(t,e){e!==void 0?t.fillStyle=e:t.fillStyle=this.color}},Ei=class extends q{constructor(t){super(),this.clearShadow=t}colorize(t,e){t.fill(),this.clearShadow&&(t.shadowColor="",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0)}},$i=class extends q{colorize(t,e){t.stroke()}},Ie=class extends q{constructor(t,e,i,s){super(),this.width=t,this.color=e,this.lineJoin=i,this.lineCap=s}colorize(t,e){e!==void 0?t.strokeStyle=e:t.strokeStyle=this.color,t.lineWidth=this.width,this.lineJoin&&(t.lineJoin=this.lineJoin),this.lineCap&&(t.lineCap=this.lineCap)}},Pi=class extends q{constructor(t){super(),this.dash=t}colorize(t,e){t.setLineDash(this.dash)}},Bi=class extends q{constructor(t){super(),this.dashOffset=t}colorize(t,e){t.lineDashOffset=this.dashOffset}},Li=class extends q{constructor(t,e,i,s){super(),this.x=t,this.y=e,this.width=i,this.height=s}path(t){t.rect(this.x,this.y,this.width,this.height)}addBounds(t){let e=this.x,i=this.y,s=e+this.width,r=i+this.height;j(t,{x:e,y:i}),j(t,{x:s,y:i}),j(t,{x:e,y:r}),j(t,{x:s,y:r})}},Ai=class extends q{constructor(t,e,i){super(),this.x=t,this.y=e,this.radius=i}path(t){t.moveTo(this.x+this.radius,this.y),t.arc(this.x,this.y,this.radius,0,2*Math.PI)}addBounds(t){j(t,{x:this.x-this.radius,y:this.y-this.radius}),j(t,{x:this.x+this.radius,y:this.y+this.radius})}},Ni=class extends q{constructor(t,e,i,s){super(),this.x=t,this.y=e,this.radiusX=i,this.radiusY=s}path(t){t.ellipse(0,0,this.radiusX,this.radiusY,0,0,Math.PI*2)}addBounds(t){j(t,{x:this.x-this.radiusX,y:this.y-this.radiusY}),j(t,{x:this.x+this.radiusX,y:this.y+this.radiusY})}},zi=class extends q{constructor(t,e,i,s,r,a){super(),this.cx=t,this.cy=e,this.radius=i,this.startAngle=s,this.endAngle=r,this.anticlockwise=a}path(t){this.radius>0&&t.arc(this.cx,this.cy,this.radius,this.startAngle,this.endAngle,this.anticlockwise)}addBounds(t){let e=Ts(this.cx,this.cy,this.startAngle*Kt,this.endAngle*Kt,this.radius);j(t,{x:e.left,y:e.top}),j(t,{x:e.right,y:e.bottom})}},Ri=class extends q{constructor(t,e,i,s,r){super(),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.radius=r}path(t){this.radius>0&&t.arcTo(this.x1,this.y1,this.x2,this.y2,this.radius)}addBounds(t){}},Fi=class extends q{constructor(t,e){super(),this.x=t,this.y=e}path(t){t.lineTo(this.x,this.y)}addBounds(t){j(t,{x:this.x,y:this.y})}},Oi=class extends q{constructor(t,e){super(),this.x=t,this.y=e}path(t){t.moveTo(this.x,this.y)}addBounds(t){j(t,{x:this.x,y:this.y})}},Hi=class extends q{path(t){t.closePath()}},Ii=class extends q{constructor(t,e,i,s,r,a){super(),this.cpX=t,this.cpY=e,this.cpX2=i,this.cpY2=s,this.toX=r,this.toY=a}path(t){t.bezierCurveTo(this.cpX,this.cpY,this.cpX2,this.cpY2,this.toX,this.toY)}addBounds(t){j(t,{x:this.cpX,y:this.cpY}),j(t,{x:this.cpX2,y:this.cpY2}),j(t,{x:this.toX,y:this.toY})}},Yi=class extends q{constructor(t,e,i,s){super(),this.cpX=t,this.cpY=e,this.toX=i,this.toY=s}path(t){t.quadraticCurveTo(this.cpX,this.cpY,this.toX,this.toY)}addBounds(t){j(t,{x:this.cpX,y:this.cpY}),j(t,{x:this.toX,y:this.toY})}},Wi=class extends q{constructor(t,e,i,s,r){super(),this.color=t,this.blur=e,this.offsetX=i,this.offsetY=s,this.opacity=r}colorize(t,e){this.opacity&&(t.fillStyle=this.color),t.shadowColor=this.color,t.shadowBlur=this.blur,t.shadowOffsetX=this.offsetX,t.shadowOffsetY=this.offsetY}colorizeGhost(t,e){}},Gi=class extends q{constructor(t,e,i,s,r){super(),this.image=t,this.width=e,this.height=i,this.x=s,this.y=r}path(t){t.drawImage(this.image,this.x,this.y,this.width,this.height)}addBounds(t){j(t,{x:this.x,y:this.y}),j(t,{x:this.width,y:this.height})}},Vi=class extends Qt{constructor(){super(...arguments),this._operations=[],this.blendMode=gi.NORMAL,this._hasShadows=!1}clear(){super.clear(),this._operations.length=0}_pushOp(t){this._operations.push(t)}beginFill(t,e=1){this._fillAlpha=e,t?t instanceof Y?this._pushOp(new He(t.toCSS(e))):(this.isMeasured=!0,this._pushOp(new He(t))):this._pushOp(new He("rgba(0, 0, 0, "+e+")"))}endFill(){this._pushOp(new Ei(this._hasShadows))}endStroke(){this._pushOp(new $i)}beginPath(){this._pushOp(new Di)}lineStyle(t=0,e,i=1,s,r){this._strokeAlpha=i,e?e instanceof Y?this._pushOp(new Ie(t,e.toCSS(i),s,r)):this._pushOp(new Ie(t,e,s,r)):this._pushOp(new Ie(t,"rgba(0, 0, 0, "+i+")",s,r))}setLineDash(t){this._pushOp(new Pi(t||[]))}setLineDashOffset(t=0){this._pushOp(new Bi(t))}drawRect(t,e,i,s){this._pushOp(new Li(t,e,i,s))}drawCircle(t,e,i){this._pushOp(new Ai(t,e,i))}drawEllipse(t,e,i,s){this._pushOp(new Ni(t,e,i,s))}arc(t,e,i,s,r,a=!1){this._pushOp(new zi(t,e,i,s,r,a))}arcTo(t,e,i,s,r){this._pushOp(new Ri(t,e,i,s,r))}lineTo(t,e){this._pushOp(new Fi(t,e))}moveTo(t,e){this._pushOp(new Oi(t,e))}bezierCurveTo(t,e,i,s,r,a){this._pushOp(new Ii(t,e,i,s,r,a))}quadraticCurveTo(t,e,i,s){this._pushOp(new Yi(t,e,i,s))}closePath(){this._pushOp(new Hi)}shadow(t,e=0,i=0,s=0,r){this._hasShadows=!0,this._pushOp(new Wi(r?t.toCSS(r):t.toCSS(this._fillAlpha||this._strokeAlpha),e,i,s))}image(t,e,i,s,r){this._pushOp(new Gi(t,e,i,s,r))}svgPath(t){let e=0,i=0,s=null,r=null,a=null,o=null,n=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,d=/[\u0009\u0020\u000A\u000C\u000D]*([\+\-]?[0-9]*\.?[0-9]+(?:[eE][\+\-]?[0-9]+)?)[\u0009\u0020\u000A\u000C\u000D]*,?/g,u=this._operations.length;try{let h;for(;(h=n.exec(t))!==null;){let c=h[1],l=h[2],m=[];for(;(h=d.exec(l))!==null;)m.push(h[1]);switch(c!=="S"&&c!=="s"&&c!=="C"&&c!=="c"&&(s=null,r=null),c!=="Q"&&c!=="q"&&c!=="T"&&c!=="t"&&(a=null,o=null),c){case"M":dt(c,m.length,2),e=+m[0],i=+m[1],this.moveTo(e,i);for(let f=2;f<m.length;f+=2)e=+m[f],i=+m[f+1],this.lineTo(e,i);break;case"m":dt(c,m.length,2),e+=+m[0],i+=+m[1],this.moveTo(e,i);for(let f=2;f<m.length;f+=2)e+=+m[f],i+=+m[f+1],this.lineTo(e,i);break;case"L":dt(c,m.length,2);for(let f=0;f<m.length;f+=2)e=+m[f],i=+m[f+1],this.lineTo(e,i);break;case"l":dt(c,m.length,2);for(let f=0;f<m.length;f+=2)e+=+m[f],i+=+m[f+1],this.lineTo(e,i);break;case"H":Fe(c,m.length,1);for(let f=0;f<m.length;++f)e=+m[f],this.lineTo(e,i);break;case"h":Fe(c,m.length,1);for(let f=0;f<m.length;++f)e+=+m[f],this.lineTo(e,i);break;case"V":Fe(c,m.length,1);for(let f=0;f<m.length;++f)i=+m[f],this.lineTo(e,i);break;case"v":Fe(c,m.length,1);for(let f=0;f<m.length;++f)i+=+m[f],this.lineTo(e,i);break;case"C":dt(c,m.length,6);for(let f=0;f<m.length;f+=6){let p=+m[f],b=+m[f+1];s=+m[f+2],r=+m[f+3],e=+m[f+4],i=+m[f+5],this.bezierCurveTo(p,b,s,r,e,i)}break;case"c":dt(c,m.length,6);for(let f=0;f<m.length;f+=6){let p=+m[f]+e,b=+m[f+1]+i;s=+m[f+2]+e,r=+m[f+3]+i,e+=+m[f+4],i+=+m[f+5],this.bezierCurveTo(p,b,s,r,e,i)}break;case"S":dt(c,m.length,4),(s===null||r===null)&&(s=e,r=i);for(let f=0;f<m.length;f+=4){let p=2*e-s,b=2*i-r;s=+m[f],r=+m[f+1],e=+m[f+2],i=+m[f+3],this.bezierCurveTo(p,b,s,r,e,i)}break;case"s":dt(c,m.length,4),(s===null||r===null)&&(s=e,r=i);for(let f=0;f<m.length;f+=4){let p=2*e-s,b=2*i-r;s=+m[f]+e,r=+m[f+1]+i,e+=+m[f+2],i+=+m[f+3],this.bezierCurveTo(p,b,s,r,e,i)}break;case"Q":dt(c,m.length,4);for(let f=0;f<m.length;f+=4)a=+m[f],o=+m[f+1],e=+m[f+2],i=+m[f+3],this.quadraticCurveTo(a,o,e,i);break;case"q":dt(c,m.length,4);for(let f=0;f<m.length;f+=4)a=+m[f]+e,o=+m[f+1]+i,e+=+m[f+2],i+=+m[f+3],this.quadraticCurveTo(a,o,e,i);break;case"T":dt(c,m.length,2),(a===null||o===null)&&(a=e,o=i);for(let f=0;f<m.length;f+=2)a=2*e-a,o=2*i-o,e=+m[f],i=+m[f+1],this.quadraticCurveTo(a,o,e,i);break;case"t":dt(c,m.length,2),(a===null||o===null)&&(a=e,o=i);for(let f=0;f<m.length;f+=2)a=2*e-a,o=2*i-o,e+=+m[f],i+=+m[f+1],this.quadraticCurveTo(a,o,e,i);break;case"A":case"a":let _=c==="a";Vs(m),dt(c,m.length,7);for(let f=0;f<m.length;f+=7){let p=+m[f+5],b=+m[f+6];_&&(p+=e,b+=i);let x=Bs({px:e,py:i,rx:+m[f],ry:+m[f+1],xAxisRotation:+m[f+2],largeArcFlag:Ls(+m[f+3]),sweepFlag:Ls(+m[f+4]),cx:p,cy:b});T(x,y=>{this.bezierCurveTo(y.x1,y.y1,y.x2,y.y2,y.x,y.y),e=y.x,i=y.y})}break;case"Z":case"z":Gs(c,m.length,0),this.closePath();break}}}catch(h){this._operations.length=u,console.warn(`Error when parsing svgPath:
|
|
3
|
+
`+h.message+`
|
|
4
|
+
`+t)}}_runPath(t){t.beginPath(),T(this._operations,e=>{e.path(t)})}_render(t,e=0){super._render(t);let i=t.layer.dirty,s=this._isInteractive(t),r=this._ghostOnly(e),a=this._drawGhost(t,e);if(i||s||r){let o=t.layer.context,n=this._renderer._ghostLayer.context;i&&!r&&(o.globalCompositeOperation=this.blendMode,o.beginPath());let d;a&&(n.beginPath(),d=this._getColorId()),T(this._operations,u=>{i&&!r&&(u.path(o),u.colorize(o,void 0)),a&&(u.pathGhost(n),u.colorizeGhost(n,d))})}}renderDetached(t){if(this.visible){this._setMatrix(),t.save();let e=this.mask;e&&(e._setMatrix(),e._transform(t,1),e._runPath(t),t.clip()),t.globalAlpha=this.compoundAlpha*this.alpha,this._transform(t,1),this.filter&&(t.filter=this.filter),t.globalCompositeOperation=this.blendMode,t.beginPath(),T(this._operations,i=>{i.path(t),i.colorize(t,void 0)}),t.restore()}}_addBounds(t){this.visible&&this.isMeasured&&T(this._operations,e=>{e.addBounds(t)})}},ai=class extends Qt{constructor(t,e,i){super(t),this.resolution=1,this.textVisible=!0,this._originalScale=1,this.text=e,this.style=i}invalidateBounds(){super.invalidateBounds(),this._textInfo=void 0}invalidateVisibility(){this.textVisible=!0,this.scale=this._originalScale||1}_shared(t){this.style.textAlign&&(t.textAlign=this.style.textAlign),this.style.direction&&(t.direction=this.style.direction),this.style.textBaseline&&(t.textBaseline=this.style.textBaseline)}_prerender(t,e=!1,i=!1){super._render(t);let s=t.layer.context,r=this._renderer._ghostLayer.context,a=this.style,o=this._getFontStyle(void 0,i);s.font=o,this._isInteractive(t)&&!e&&(r.font=o),a.fill&&(a.fill instanceof Y?s.fillStyle=a.fill.toCSS(a.fillOpacity!=null?a.fillOpacity:1):s.fillStyle=a.fill),a.shadowColor&&(t.layer.context.shadowColor=a.shadowColor.toCSS(a.shadowOpacity||1)),a.shadowBlur&&(t.layer.context.shadowBlur=a.shadowBlur),a.shadowOffsetX&&(t.layer.context.shadowOffsetX=a.shadowOffsetX),a.shadowOffsetY&&(t.layer.context.shadowOffsetY=a.shadowOffsetY),this._shared(s),this._isInteractive(t)&&!e&&(r.fillStyle=this._getColorId(),this._shared(r))}_getFontStyle(t,e=!1){let i=this.style,s=[];return t&&t.fontVariant?s.push(t.fontVariant):i.fontVariant&&s.push(i.fontVariant),e||(t&&t.fontWeight?s.push(t.fontWeight):i.fontWeight&&s.push(i.fontWeight)),t&&t.fontStyle?s.push(t.fontStyle):i.fontStyle&&s.push(i.fontStyle),t&&t.fontSize?(A(t.fontSize)&&(t.fontSize=t.fontSize+"px"),s.push(t.fontSize)):i.fontSize&&(A(i.fontSize)&&(i.fontSize=i.fontSize+"px"),s.push(i.fontSize)),i.fontFamily=="inherit"?s.push(getComputedStyle(this._renderer.view).getPropertyValue("font-family")):t&&t.fontFamily?s.push(t.fontFamily):i.fontFamily?s.push(i.fontFamily):s.length&&s.push("Arial"),s.join(" ")}_render(t,e=0){if(this._textInfo||this._measure(t),this.textVisible){let i=this._isInteractive(t),s=t.layer.context,r=t.layer.dirty,a=this._renderer._ghostLayer.context,o=this._ghostOnly(e),n=this._drawGhost(t,e);s.save(),a.save(),this._prerender(t),T(this._textInfo,(d,u)=>{T(d.textChunks,(h,c)=>{if(h.style&&(s.save(),a.save(),o||(s.font=h.style),this._isInteractive(t)&&(a.font=h.style)),h.fill&&(s.save(),o||(s.fillStyle=h.fill.toCSS())),r&&!o&&s.fillText(h.text,h.offsetX,d.offsetY+h.offsetY),h.textDecoration=="underline"||h.textDecoration=="line-through"){let l=1,m=1,_=h.height,f=this.style.oversizedBehavior||"";if(["truncate","wrap","wrap-no-break"].indexOf(f)>-1){let x=this._measureText(h.text,s);h.width=x.actualBoundingBoxLeft+x.actualBoundingBoxRight}let p=h.offsetX;switch(this.style.textAlign){case"right":case"end":p-=h.width;break;case"center":p-=h.width/2;break}if(h.style)switch(lt.getTextStyle(h.style).fontWeight){case"bolder":case"bold":case"700":case"800":case"900":l=2;break}_&&(m=_/20);let b;h.textDecoration=="line-through"?b=l+d.offsetY+h.offsetY-h.height/2:b=l+m*1.5+d.offsetY+h.offsetY,b=Mi(b),o||(s.save(),s.beginPath(),h.fill?s.strokeStyle=h.fill.toCSS():this.style.fill&&this.style.fill instanceof Y&&(s.strokeStyle=this.style.fill.toCSS()),s.lineWidth=l*m,s.moveTo(p,b),s.lineTo(p+h.width,b),s.stroke(),s.restore())}i&&this.interactive&&n&&a.fillText(h.text,h.offsetX,d.offsetY+h.offsetY),h.fill&&s.restore(),h.style&&(s.restore(),a.restore())})}),s.restore(),a.restore()}}_addBounds(t){if(this.visible&&this.isMeasured){let e=this._measure({inactive:this.inactive,layer:this.getLayer()});j(t,{x:e.left,y:e.top}),j(t,{x:e.right,y:e.bottom})}}_ignoreFontWeight(){return/apple/i.test(navigator.vendor)}_measure(t){let e=t.layer.context,i=this._renderer._ghostLayer.context,s=this.style.direction=="rtl";this._textInfo=[];let r=this.style.oversizedBehavior,a=this.style.maxWidth,o=A(a)&&r=="truncate",n=A(a)&&(r=="wrap"||r=="wrap-no-break");e.save(),i.save(),this._prerender(t,!0,this._ignoreFontWeight());let d="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",u=this.text.toString().replace(/\r/g,"").split(/\n/),h=!0,c=0,l=0,m=0,_;T(u,(p,b)=>{let x;for(p==""?x=[{type:"value",text:""}]:x=lt.chunk(p,!1,this.style.ignoreFormatting);x.length>0;){let y={offsetY:m,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]},v=this._measureText(d,e),k=v.actualBoundingBoxAscent+v.actualBoundingBoxDescent;y.height=k,y.ascent=v.actualBoundingBoxAscent;let w,C=this.style.textDecoration,P,S,M=!1,D=!0,E=[],F;ke(x,(B,U)=>{if(B.type=="format")if(B.text=="[/]")h||(e.restore(),i.restore(),h=!0),P=void 0,_=void 0,S=void 0,C=this.style.textDecoration,F=void 0,w=B.text;else{h||(e.restore(),i.restore());let L=lt.getTextStyle(B.text),O=this._getFontStyle(L);e.save(),i.save(),e.font=O,_=O,w=B.text,L.textDecoration&&(C=L.textDecoration),L.fill&&(P=L.fill),L.width&&(S=rt(L.width)),L.verticalAlign&&(F=L.verticalAlign),h=!1;let R=this._measureText(d,e),H=R.actualBoundingBoxAscent+R.actualBoundingBoxDescent;H>y.height&&(y.height=H),R.actualBoundingBoxAscent>y.ascent&&(y.ascent=R.actualBoundingBoxAscent)}else if(B.type=="value"&&!M){let L=this._measureText(B.text,e),O=L.actualBoundingBoxLeft+L.actualBoundingBoxRight;if(o){this.truncated=void 0;let G=D||this.style.breakWords||!1,V=this.style.ellipsis||"",st=this._measureText(V,e),ve=st.actualBoundingBoxLeft+st.actualBoundingBoxRight;if(y.width+O>a){let We=a-y.width-ve;B.text=this._truncateText(e,B.text,We,G),B.text+=V,M=!0,this.truncated=!0}}else if(n&&y.width+O>a){let G=a-y.width,V=this._truncateText(e,B.text,G,!1,D&&this.style.oversizedBehavior!="wrap-no-break");if(V=="")return this.textVisible=!0,!1;if(!D){let st=this._measureText(Ee(V),e);if(st.actualBoundingBoxLeft+st.actualBoundingBoxRight>G)return E=x.slice(U),w&&E.unshift({type:"format",text:w}),x=[],!1}E=x.slice(U+1),Ee(V)!=Ee(B.text)&&(E.unshift({type:"value",text:B.text.substr(V.length)}),w&&E.unshift({type:"format",text:w})),B.text=Ee(V),x=[],M=!0}let R=1,H=1;if(_&&S&&S>O){let G=O/S;switch(this.style.textAlign){case"right":case"end":R=G;break;case"center":R=G,H=G;break;default:H=G}O=S}let it=L.actualBoundingBoxAscent+L.actualBoundingBoxDescent;it>y.height&&(y.height=it),L.actualBoundingBoxAscent>y.ascent&&(y.ascent=L.actualBoundingBoxAscent),y.width+=O,y.left+=L.actualBoundingBoxLeft/R,y.right+=L.actualBoundingBoxRight/H,y.textChunks.push({style:_,fill:P,text:B.text,width:O,height:it,left:L.actualBoundingBoxLeft,right:L.actualBoundingBoxRight,ascent:L.actualBoundingBoxAscent,offsetX:0,offsetY:0,textDecoration:C,verticalAlign:F}),D=!1}return!0}),this.style.lineHeight instanceof nt?(y.height*=this.style.lineHeight.value,y.ascent*=this.style.lineHeight.value):(y.height*=this.style.lineHeight||1.2,y.ascent*=this.style.lineHeight||1.2),c<y.left&&(c=y.left),l<y.right&&(l=y.right),this._textInfo.push(y),m+=y.height,x=E||[]}}),h||(e.restore(),i.restore()),T(this._textInfo,(p,b)=>{let x=0;T(p.textChunks,y=>{if(y.offsetX=x+y.left-p.left,y.offsetY+=p.height-p.height*(this.style.baselineRatio||.19),x+=y.width*(s?-1:1),y.verticalAlign)switch(y.verticalAlign){case"super":y.offsetY-=p.height/2-y.height/2;break;case"sub":y.offsetY+=y.height/2;break}})});let f={left:s?-l:-c,top:0,right:s?c:l,bottom:m};if(r!=="none"){let p=this._fitRatio(f,r=="truncate");if(p<1)if(r=="fit")A(this.style.minScale)&&p<this.style.minScale?(this.textVisible=!1,f.left=0,f.top=0,f.right=0,f.bottom=0):(this._originalScale||(this._originalScale=this.scale),this.scale=p,this.textVisible=!0);else if(r=="hide")this.textVisible=!1,f.left=0,f.top=0,f.right=0,f.bottom=0;else{switch(this.style.textAlign){case"right":case"end":f.left=s?a:-a,f.right=0;break;case"center":f.left=-a/2,f.right=a/2;break;default:f.left=0,f.right=s?-a:a}this.scale=this._originalScale||1,this._originalScale=void 0,this.textVisible=!0}else this.scale=this._originalScale||1,this._originalScale=void 0,this.textVisible=!0}return e.restore(),i.restore(),f}_fitRatio(t,e=!1){let i=this.style.maxWidth,s=e?void 0:this.style.maxHeight;if(!A(i)&&!A(s))return 1;let r=t.right-t.left,a=t.bottom-t.top;return Math.min(i/r||1,s/a||1)}_truncateText(t,e,i,s=!1,r=!0){let a;do{if(s)e=e.slice(0,-1);else{let n=e.replace(/(?:[^,;:!?\\\/\s]|,(?=\d))+[,;:!?\\\/\s]*$/g,"");if((n==""||n===e)&&r)s=!0;else{if(n=="")return e;e=n}}let o=this._measureText(e,t);a=o.actualBoundingBoxLeft+o.actualBoundingBoxRight}while(a>i&&e!="");return e}_measureText(t,e){let i=e.measureText(t),s={};if(i.actualBoundingBoxAscent==null){let a=document.createElement("div");a.innerText=t,a.style.visibility="hidden",a.style.position="absolute",a.style.top="-1000000px;",a.style.fontFamily=this.style.fontFamily||"",a.style.fontSize=this.style.fontSize+"",document.body.appendChild(a);let o=a.getBoundingClientRect();document.body.removeChild(a);let n=o.height,d=i.width;s={actualBoundingBoxAscent:n,actualBoundingBoxDescent:0,actualBoundingBoxLeft:0,actualBoundingBoxRight:d,fontBoundingBoxAscent:n,fontBoundingBoxDescent:0,width:d}}else s={actualBoundingBoxAscent:i.actualBoundingBoxAscent,actualBoundingBoxDescent:i.actualBoundingBoxDescent,actualBoundingBoxLeft:i.actualBoundingBoxLeft,actualBoundingBoxRight:i.actualBoundingBoxRight,fontBoundingBoxAscent:i.actualBoundingBoxAscent,fontBoundingBoxDescent:i.actualBoundingBoxDescent,width:i.width};let r=i.width;switch(this.style.textAlign){case"right":case"end":s.actualBoundingBoxLeft=r,s.actualBoundingBoxRight=0;break;case"center":s.actualBoundingBoxLeft=r/2,s.actualBoundingBoxRight=r/2;break;default:s.actualBoundingBoxLeft=0,s.actualBoundingBoxRight=r}return s}},Xi=class{constructor(){this.lineHeight=pt(120),this.baselineRatio=.19,this.oversizedBehavior="none",this.breakWords=!1,this.ellipsis="\u2026",this.ignoreFormatting=!1}},Ui=class extends ai{constructor(){super(...arguments),this.textType="circular",this.inside=!1,this.orientation="auto",this.kerning=0,this._textReversed=!1}_render(t,e=0){this.textType==="circular"?this._renderCircular(t,e):super._render(t,e)}_renderCircular(t,e=0){if(this.textVisible){this._prerender(t);let i=this._isInteractive(t),s=t.layer.context,r=t.layer.dirty,a=this._renderer._ghostLayer.context;s.save(),i&&a.save(),this._textInfo||this._measure(t);let o=this.radius||0,n=this.startAngle||0,d=0,u=this.orientation,h=u=="auto"?"auto":u=="inward",c=this.inside,l=this.style.textAlign||"left",m=this.kerning||0,_=l=="left"?1:-1,f=!this._textReversed,p=this._ghostOnly(e),b=this._drawGhost(t,e);if(h=="auto"){let x=0,y=0;T(this._textInfo,(v,k)=>{let w=n+v.width/(o-v.height)/2*-_;w>x&&(x=w)}),l=="left"?y=(x+d/2)*Kt:l=="right"?y=(x-d/2)*Kt:y=n*Kt,y=ks(y),h=y>=270||y<=90}h==!0&&f&&(this._textInfo.reverse(),this._textReversed=!0),T(this._textInfo,(x,y)=>{let v=x.height;c||(o+=v),(_==-1&&h||_==1&&!h)&&f&&x.textChunks.reverse();let k=n;d=0,l=="center"&&(k+=x.width/(o-v)/2*-_,d=k-n),k+=Math.PI*(h?0:1),s.save(),i&&a.save(),p||s.rotate(k),i&&a.rotate(k);let w=0;T(x.textChunks,(C,P)=>{let S=C.text,M=C.width;w=M/2/(o-v)*_,p||s.rotate(w),i&&a.rotate(w),C.style&&(s.save(),a.save(),p||(s.font=C.style),i&&(a.font=C.style)),C.fill&&(s.save(),p||(s.fillStyle=C.fill.toCSS())),p||(s.textBaseline="middle",s.textAlign="center"),i&&(a.textBaseline="middle",a.textAlign="center"),r&&!p&&s.fillText(S,0,(h?1:-1)*(0-o+v/2)),i&&b&&a.fillText(S,0,(h?1:-1)*(0-o+v/2)),C.fill&&s.restore(),C.style&&(s.restore(),a.restore()),w=(M/2+m)/(o-v)*_,p||s.rotate(w),i&&a.rotate(w)}),s.restore(),i&&a.restore(),c&&(o-=v)}),s.restore(),i&&a.restore()}}_measure(t){return this.textType==="circular"?this._measureCircular(t):super._measure(t)}_measureCircular(t){let e=t.layer.context,i=this._renderer._ghostLayer.context,s=this.style.direction=="rtl",r=this.style.oversizedBehavior,a=this.style.maxWidth,o=A(a)&&r=="truncate",n=this.style.ellipsis||"",d;this.textVisible=!0,this._textInfo=[],this._textReversed=!1,e.save(),i.save(),this._prerender(t,!0);let u=this.text.toString().replace(/\r/g,"").split(/\n/),h=!0,c=0,l=0;return T(u,(m,_)=>{let f=lt.chunk(m,!1,this.style.ignoreFormatting),p={offsetY:l,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]},b,x,y;T(f,(v,k)=>{if(v.type=="format"){if(v.text=="[/]")h||(e.restore(),i.restore(),h=!0),x=void 0,b=void 0,y=void 0;else{let w=lt.getTextStyle(v.text),C=this._getFontStyle(w);e.save(),i.save(),e.font=C,b=C,w.fill&&(x=w.fill),w.width&&(y=rt(w.width)),h=!1}o&&(d=this._measureText(n,e))}else if(v.type=="value"){let w=v.text.match(/./ug)||[];s&&(w=_s(v.text),w.reverse());for(let C=0;C<w.length;C++){let P=w[C],S=this._measureText(P,e),M=S.width;b&&y&&y>M&&(M=y);let D=S.actualBoundingBoxAscent+S.actualBoundingBoxDescent;if(D>p.height&&(p.height=D),S.actualBoundingBoxAscent>p.ascent&&(p.ascent=S.actualBoundingBoxAscent),c+=M,o){d||(d=this._measureText(n,e));let E=d.actualBoundingBoxLeft+d.actualBoundingBoxRight;if(c+E>a){p.textChunks.length==1?this.textVisible=!1:(p.width+=E,p.left+=d.actualBoundingBoxLeft,p.right+=d.actualBoundingBoxRight,p.textChunks.push({style:b,fill:x,text:n,width:E,height:D+d.actualBoundingBoxDescent,left:d.actualBoundingBoxLeft,right:d.actualBoundingBoxRight,ascent:d.actualBoundingBoxAscent,offsetX:0,offsetY:D,textDecoration:void 0}));break}}p.width+=M,p.left+=S.actualBoundingBoxLeft,p.right+=S.actualBoundingBoxRight,p.textChunks.push({style:b,fill:x,text:P,width:M,height:D+S.actualBoundingBoxDescent,left:S.actualBoundingBoxLeft,right:S.actualBoundingBoxRight,ascent:S.actualBoundingBoxAscent,offsetX:0,offsetY:D,textDecoration:void 0})}}}),this.style.lineHeight instanceof nt?p.height*=this.style.lineHeight.value:p.height*=this.style.lineHeight||1.2,this._textInfo.push(p),l+=p.height}),h||(e.restore(),i.restore()),r=="hide"&&c>a&&(this.textVisible=!1),T(this._textInfo,m=>{T(m.textChunks,_=>{_.offsetY+=Math.round((m.height-_.height+(m.ascent-_.ascent))/2)})}),e.restore(),i.restore(),{left:0,top:0,right:0,bottom:0}}},ji=class extends Qt{constructor(t,e){super(t),this.image=e}_dispose(){super._dispose(),this._imageMask&&Oe(this._imageMask)}getLocalBounds(){if(!this._localBounds){let t=0,e=0;this.width&&(t=this.width),this.height&&(e=this.height),this._localBounds={left:0,top:0,right:t,bottom:e},this._addBounds(this._localBounds)}return this._localBounds}_render(t,e=0){if(super._render(t),this.image){if(this.tainted===void 0&&(this.tainted=As(this.image),t.layer.tainted=!0),this.tainted&&this._renderer._omitTainted)return;let i=this._ghostOnly(e),s=this._drawGhost(t,e);if(t.layer.dirty&&!i){this.shadowColor&&(t.layer.context.shadowColor=this.shadowColor.toCSS(this.shadowOpacity||1)),this.shadowBlur&&(t.layer.context.shadowBlur=this.shadowBlur),this.shadowOffsetX&&(t.layer.context.shadowOffsetX=this.shadowOffsetX),this.shadowOffsetY&&(t.layer.context.shadowOffsetY=this.shadowOffsetY);let r=this.width||this.image.naturalWidth,a=this.height||this.image.naturalHeight;t.layer.context.drawImage(this.image,0,0,r,a)}if(this.interactive&&this._isInteractive(t)&&s){let r=this._getMask(this.image);this._renderer._ghostLayer.context.drawImage(r,0,0)}}}clear(){super.clear(),this.image=void 0,this._imageMask=void 0}_getMask(t){if(this._imageMask===void 0){let e=this.width||t.naturalWidth,i=this.height||t.naturalHeight,s=document.createElement("canvas");s.width=e,s.height=i;let r=s.getContext("2d");r.imageSmoothingEnabled=!1,r.fillStyle=this._getColorId(),r.fillRect(0,0,e,i),As(t)||(r.globalCompositeOperation="destination-in",r.drawImage(t,0,0,e,i)),this._imageMask=s}return this._imageMask}},qi=class{constructor(t,e,i,s){this.event=t,this.originalPoint=e,this.point=i,this.bbox=s,this.simulated=!1,this.native=!0,bt("touchevents")&&t instanceof Touch?this.id=t.identifier:this.id=null}},Ye=class extends li{constructor(t){if(super(),this.view=document.createElement("div"),this._layerDom=document.createElement("div"),this.layers=[],this._dirtyLayers=[],this.defaultLayer=this.getLayer(0),this._ghostLayer=new Zi,this._deferredGhostLayers=[],this._patternCanvas=document.createElement("canvas"),this._patternContext=this._patternCanvas.getContext("2d"),this._realWidth=0,this._realHeight=0,this._calculatedWidth=0,this._calculatedHeight=0,this.interactionsEnabled=!0,this._listeners={},this._events={},this._colorId=0,this._colorMap={},this._forceInteractive=0,this._omitTainted=!1,this._hovering=new Set,this._dragging=[],this._mousedown=[],this.tapToActivate=!1,this.tapToActivateTimeout=3e3,this._touchActive=!1,t==null?this.resolution=window.devicePixelRatio:this.resolution=t,this.view.style.position="absolute",this.view.setAttribute("aria-hidden","true"),this.view.appendChild(this._layerDom),this._disposers.push(new yt(()=>{tt(this._events,(e,i)=>{i.disposer.dispose()}),T(this.layers,e=>{Oe(e.view),e.exportableView&&Oe(e.exportableView)}),Oe(this._ghostLayer.view),Oe(this._patternCanvas)})),this._disposers.push(Xe(()=>{t==null&&(this.resolution=window.devicePixelRatio)})),bt("touchevents")){let e=i=>{this._dragging.length!==0&&ke(this._dragging,s=>s.value.shouldCancelTouch()?(i.preventDefault(),!1):!0),this._touchActiveTimeout&&this._delayTouchDeactivate()};this._disposers.push(N(window,"touchstart",e,{passive:!1})),this._disposers.push(N(this.view,"touchstart",e,{passive:!1})),this._disposers.push(N(this.view,"touchmove",()=>{this._touchActiveTimeout&&this._delayTouchDeactivate()},{passive:!0})),this._disposers.push(N(window,"click",i=>{this._touchActive=!1},{passive:!0})),this._disposers.push(N(this.view,"click",i=>{window.setTimeout(()=>{this._touchActive=!0,this._delayTouchDeactivate()},100)},{passive:!0}))}bt("wheelevents")&&this._disposers.push(N(this.view,"wheel",e=>{let i=!1;this._hovering.forEach(s=>{if(s.wheelable)return i=!0,!1}),i&&e.preventDefault()},{passive:!1}))}resetImageArray(){this._ghostLayer.imageArray=void 0}_delayTouchDeactivate(){this._touchActiveTimeout&&clearTimeout(this._touchActiveTimeout),this.tapToActivateTimeout>0&&(this._touchActiveTimeout=window.setTimeout(()=>{this._touchActive=!1},this.tapToActivateTimeout))}get debugGhostView(){return!!this._ghostLayer.view.parentNode}set debugGhostView(t){t?this._ghostLayer.view.parentNode||this.view.appendChild(this._ghostLayer.view):this._ghostLayer.view.parentNode&&this._ghostLayer.view.parentNode.removeChild(this._ghostLayer.view)}createLinearGradient(t,e,i,s){return this.defaultLayer.context.createLinearGradient(t,e,i,s)}createRadialGradient(t,e,i,s,r,a){return this.defaultLayer.context.createRadialGradient(t,e,i,s,r,a)}createPattern(t,e,i,s,r){return this._patternCanvas.width=s,this._patternCanvas.height=r,this._patternContext.clearRect(0,0,s,r),e.renderDetached(this._patternContext),t.renderDetached(this._patternContext),this._patternContext.createPattern(this._patternCanvas,i)}makeContainer(){return new Ci(this)}makeGraphics(){return new Vi(this)}makeText(t,e){return new ai(this,t,e)}makeTextStyle(){return new Xi}makeRadialText(t,e){return new Ui(this,t,e)}makePicture(t){return new ji(this,t)}resizeLayer(t){t.resize(this._calculatedWidth,this._calculatedHeight,this._calculatedWidth,this._calculatedHeight,this.resolution)}resizeGhost(){this._ghostLayer.resize(this._calculatedWidth,this._calculatedHeight,this._calculatedWidth,this._calculatedHeight,this.resolution)}resize(t,e,i,s){this._realWidth=t,this._realHeight=e,this._calculatedWidth=i,this._calculatedHeight=s,T(this.layers,r=>{r&&(r.dirty=!0,this.resizeLayer(r))}),this.resizeGhost(),this.view.style.width=i+"px",this.view.style.height=s+"px"}createDetachedLayer(t=!1){let e=document.createElement("canvas"),i=e.getContext("2d",{willReadFrequently:t}),s=new oi(e,i);return e.style.position="absolute",e.style.top="0px",e.style.left="0px",s}getLayerByOrder(t){let e=this.layers,i=e.length;for(let s=0;s<i;s++){let r=e[s];if(r.order==t)return r}}getLayer(t,e=!0){let i=this.getLayerByOrder(t);if(i)return i;let s=this.createDetachedLayer(t==99);s.order=t,s.visible=e,s.view.className="am5-layer-"+t,s.visible&&this.resizeLayer(s);let r=this.layers;r.push(s),r.sort((d,u)=>d.order>u.order?1:d.order<u.order?-1:0);let a=r.length,o=is(r,s),n;for(let d=o+1;d<a;d++)if(r[d].visible){n=r[d];break}return s.visible&&(n===void 0?this._layerDom.appendChild(s.view):this._layerDom.insertBefore(s.view,n.view)),s}render(t){this._dirtyLayers.length=0,this._deferredGhostLayers=[],T(this.layers,i=>{i&&i.dirty&&i.visible&&(this._dirtyLayers.push(i),i.clear())}),this._ghostLayer.clear(),t.render({inactive:null,layer:this.defaultLayer});let e=this._deferredGhostLayers;if(e.length&&(e.sort((i,s)=>i-s),T(e,i=>{t.render({inactive:null,layer:this.defaultLayer},i)})),this._ghostLayer.context.restore(),T(this.layers,i=>{if(i){let s=i.context;s.beginPath(),s.moveTo(0,0),s.stroke()}}),T(this._dirtyLayers,i=>{i.context.restore(),i.dirty=!1}),this._hovering.size&&this._lastPointerMoveEvent){let{events:i,target:s,native:r}=this._lastPointerMoveEvent;T(i,a=>{this._dispatchGlobalMousemove(a,s,r)})}}paintId(t){let e=Xs(++this._colorId),i=Y.fromHex(e).toCSS();return this._colorMap[i]=t,i}_removeObject(t){t._colorId!==void 0&&delete this._colorMap[t._colorId]}_adjustBoundingBox(t){let e=this._ghostLayer.margin;return new DOMRect(-e.left,-e.top,t.width+e.left+e.right,t.height+e.top+e.bottom)}getEvent(t,e=!0){let i=this.view.getBoundingClientRect(),s=t.clientX||0,r=t.clientY||0,a=this._calculatedWidth/this._realWidth,o=this._calculatedHeight/this._realHeight,n={x:s-i.left,y:r-i.top},d={x:(s-(e?i.left:0))*a,y:(r-(e?i.top:0))*o};return new qi(t,n,d,this._adjustBoundingBox(i))}_getHitTarget(t,e,i){if(e.width===0||e.height===0||t.x<e.left||t.x>e.right||t.y<e.top||t.y>e.bottom||!i||!this._layerDom.contains(i))return;let s=this._ghostLayer.getImageData(t,e);if(s.data[0]===0&&s.data[1]===0&&s.data[2]===0)return!1;let r=Y.fromRGB(s.data[0],s.data[1],s.data[2]).toCSS();return this._colorMap[r]}getObjectAtPoint(t){let e=this._ghostLayer.getImageArray(t);if(e[0]===0&&e[1]===0&&e[2]===0)return;let i=Y.fromRGB(e[0],e[1],e[2]).toCSS();return this._colorMap[i]}_withEvents(t,e){let i=this._events[t];if(i!==void 0){i.dispatching=!0;try{e(i)}finally{i.dispatching=!1,i.cleanup&&(i.cleanup=!1,jt(i.callbacks,s=>!s.disposed),i.callbacks.length===0&&(i.disposer.dispose(),delete this._events[t]))}}}_dispatchEventAll(t,e){this.interactionsEnabled&&this._withEvents(t,i=>{T(i.callbacks,s=>{s.disposed||s.callback.call(s.context,e)})})}_dispatchEvent(t,e,i){if(!this.interactionsEnabled)return!1;let s=!1;return this._withEvents(t,r=>{T(r.callbacks,a=>{!a.disposed&&a.object===e&&(a.callback.call(a.context,i),s=!0)})}),s}_dispatchMousedown(t,e){let i=t.button;if(i!=0&&i!=2&&i!=1&&i!==void 0)return;let s=this.getEvent(t),r=this._getHitTarget(s.originalPoint,s.bbox,e);if(r){let a=s.id,o=!1;ri(r,n=>{let d={id:a,value:n};return this._mousedown.push(d),!o&&this._dispatchEvent("pointerdown",n,s)&&(o=!0,this._dragging.some(h=>h.value===n&&h.id===a)||this._dragging.push(d)),!0})}this._dispatchEventAll("globalpointerdown",s)}_dispatchGlobalMousemove(t,e,i){let s=this.getEvent(t),r=this._getHitTarget(s.originalPoint,s.bbox,e);s.native=i,r?(this._hovering.forEach(a=>{a.contains(r)||(this._hovering.delete(a),a.cursorOverStyle&&De(document.body,"cursor",a._replacedCursorStyle),this._dispatchEvent("pointerout",a,s))}),s.native&&ri(r,a=>(this._hovering.has(a)||(this._hovering.add(a),a.cursorOverStyle&&(a._replacedCursorStyle=cs(document.body,"cursor"),De(document.body,"cursor",a.cursorOverStyle)),this._dispatchEvent("pointerover",a,s)),!0))):(this._hovering.forEach(a=>{a.cursorOverStyle&&De(document.body,"cursor",a._replacedCursorStyle),this._dispatchEvent("pointerout",a,s)}),this._hovering.clear()),this._dispatchEventAll("globalpointermove",s)}removeHovering(t){this._hovering.delete(t),t.cursorOverStyle&&De(document.body,"cursor",t._replacedCursorStyle)}_dispatchGlobalMouseup(t,e){let i=this.getEvent(t);i.native=e,this._dispatchEventAll("globalpointerup",i)}_dispatchDragMove(t){if(this._dragging.length!==0){let e=this.getEvent(t),i=e.id;this._dragging.forEach(s=>{s.id===i&&this._dispatchEvent("pointermove",s.value,e)})}}_dispatchDragEnd(t,e){let i=t.button,s;if(i==0||i===void 0)s="click";else if(i==2)s="rightclick";else if(i==1)s="middleclick";else return;let r=this.getEvent(t),a=r.id;if(this._mousedown.length!==0){let o=this._getHitTarget(r.originalPoint,r.bbox,e);o&&this._mousedown.forEach(n=>{n.id===a&&n.value.contains(o)&&this._dispatchEvent(s,n.value,r)}),this._mousedown.length=0}this._dragging.length!==0&&(this._dragging.forEach(o=>{o.id===a&&this._dispatchEvent("pointerup",o.value,r)}),this._dragging.length=0)}_dispatchDoubleClick(t,e){let i=this.getEvent(t),s=this._getHitTarget(i.originalPoint,i.bbox,e);s&&ri(s,r=>!this._dispatchEvent("dblclick",r,i))}_dispatchWheel(t,e){let i=this.getEvent(t),s=this._getHitTarget(i.originalPoint,i.bbox,e);s&&ri(s,r=>!this._dispatchEvent("wheel",r,i))}_makeSharedEvent(t,e){if(this._listeners[t]===void 0){let i=e();this._listeners[t]=new Ce(()=>{delete this._listeners[t],i.dispose()})}return this._listeners[t].increment()}_onPointerEvent(t,e){let i=!1,s=null;function r(){s=null,i=!1}return new xt([new yt(()=>{s!==null&&clearTimeout(s),r()}),N(this.view,je(t),a=>{i=!0,s!==null&&clearTimeout(s),s=window.setTimeout(r,0)}),Us(window,t,(a,o)=>{s!==null&&(clearTimeout(s),s=null),e(a,o,i),i=!1})])}_initEvent(t){switch(t){case"globalpointermove":case"pointerover":case"pointerout":return this._makeSharedEvent("pointermove",()=>{let e=(i,s,r)=>{this._lastPointerMoveEvent={events:i,target:s,native:r},T(i,a=>{this._dispatchGlobalMousemove(a,s,r)})};return new xt([this._onPointerEvent("pointerdown",e),this._onPointerEvent("pointermove",e)])});case"globalpointerup":return this._makeSharedEvent("pointerup",()=>{let e=this._onPointerEvent("pointerup",(s,r,a)=>{T(s,o=>{this._dispatchGlobalMouseup(o,a)}),this._lastPointerMoveEvent={events:s,target:r,native:a}}),i=this._onPointerEvent("pointercancel",(s,r,a)=>{T(s,o=>{this._dispatchGlobalMouseup(o,a)}),this._lastPointerMoveEvent={events:s,target:r,native:a}});return new yt(()=>{e.dispose(),i.dispose()})});case"click":case"rightclick":case"middleclick":case"pointerdown":case"globalpointerdown":case"pointermove":case"pointerup":return this._makeSharedEvent("pointerdown",()=>{let e=this._onPointerEvent("pointerdown",(a,o)=>{T(a,n=>{this._dispatchMousedown(n,o)})}),i=this._onPointerEvent("pointermove",a=>{T(a,o=>{this._dispatchDragMove(o)})}),s=this._onPointerEvent("pointerup",(a,o)=>{T(a,n=>{this._dispatchDragEnd(n,o)})}),r=this._onPointerEvent("pointercancel",(a,o)=>{T(a,n=>{this._dispatchDragEnd(n,o)})});return new yt(()=>{e.dispose(),i.dispose(),s.dispose(),r.dispose()})});case"dblclick":return this._makeSharedEvent("dblclick",()=>this._onPointerEvent("dblclick",(e,i)=>{T(e,s=>{this._dispatchDoubleClick(s,i)})}));case"wheel":return this._makeSharedEvent("wheel",()=>N(this.view,je("wheel"),e=>{this._dispatchWheel(e,ci(e))},{passive:!1}))}}_addEvent(t,e,i,s){let r=this._events[e];r===void 0&&(r=this._events[e]={disposer:this._initEvent(e),callbacks:[],dispatching:!1,cleanup:!1});let a={object:t,context:s,callback:i,disposed:!1};return r.callbacks.push(a),new yt(()=>{a.disposed=!0,r.dispatching?r.cleanup=!0:(Te(r.callbacks,a),r.callbacks.length===0&&(r.disposer.dispose(),delete this._events[e]))})}getCanvas(t,e){this.render(t),e||(e={});let i=this.resolution,s=Math.floor(this._calculatedWidth*this.resolution),r=Math.floor(this._calculatedHeight*this.resolution);if(e.minWidth&&e.minWidth>s){let l=e.minWidth/s;l>i&&(i=l*this.resolution)}if(e.minHeight&&e.minHeight>r){let l=e.minHeight/r;l>i&&(i=l*this.resolution)}if(e.maxWidth&&e.maxWidth<s){let l=e.maxWidth/s;l<i&&(i=l*this.resolution)}if(e.maxHeight&&e.maxHeight>r){let l=e.maxHeight/r;l<i&&(i=l*this.resolution)}e.maintainPixelRatio&&(i/=this.resolution);let a=[],o=!1,n=document.createElement("canvas");i!=this.resolution&&(o=!0,s=s*i/this.resolution,r=r*i/this.resolution),n.width=s,n.height=r,n.style.position="fixed",n.style.top="-10000px",this.view.appendChild(n),a.push(n);let d=n.getContext("2d"),u=0,h=0,c=!1;return T(this.layers,l=>{if(l&&l.visible&&(l.tainted||o)){c=!0,l.exportableView=l.view,l.exportableContext=l.context,l.view=document.createElement("canvas"),l.view.style.position="fixed",l.view.style.top="-10000px",this.view.appendChild(l.view),a.push(l.view);let m=0,_=0;l.margin&&(m+=l.margin.left||0+l.margin.right||0,_+=l.margin.top||0+l.margin.bottom||0),l.view.width=s+m,l.view.height=r+_,l.context=l.view.getContext("2d"),l.dirty=!0,l.scale=i}}),c&&(this._omitTainted=!0,this.render(t),this._omitTainted=!1),T(this.layers,l=>{if(l&&l.visible){let m=0,_=0;l.margin&&(m=-(l.margin.left||0)*this.resolution,_=-(l.margin.top||0)*this.resolution),d.drawImage(l.view,m,_),l.exportableView&&(l.view=l.exportableView,l.exportableView=void 0),l.exportableContext&&(l.context=l.exportableContext,l.exportableContext=void 0),u<l.view.clientWidth&&(u=l.view.clientWidth),h<l.view.clientHeight&&(h=l.view.clientHeight),l.scale=void 0}}),n.style.width=u+"px",n.style.height=h+"px",T(a,l=>{l.style.position="",l.style.top="",this.view.removeChild(l)}),n}},Zi=class{constructor(){this.margin={left:0,right:0,top:0,bottom:0},this._resolution=1,this._width=0,this._height=0,this.view=document.createElement("canvas"),this.context=this.view.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.context.imageSmoothingEnabled=!1,this.view.style.position="absolute",this.view.style.top="0px",this.view.style.left="0px"}resize(t,e,i,s,r){this._resolution=r,t+=this.margin.left+this.margin.right,e+=this.margin.top+this.margin.bottom,i+=this.margin.left+this.margin.right,s+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+"px",this.view.style.top=-this.margin.top+"px",this._width=Math.floor(t*r),this._height=Math.floor(e*r),this.view.width=this._width,this.view.style.width=i+"px",this.view.height=this._height,this.view.style.height=s+"px"}getImageData(t,e){return this.context.getImageData(Math.round((t.x-e.left)/e.width*this._width),Math.round((t.y-e.top)/e.height*this._height),1,1)}getImageArray(t){this.imageArray||(this.imageArray=this.context.getImageData(0,0,this._width,this._height).data);let e=this.imageArray,i=Math.round(t.x*this._resolution),r=(Math.round(t.y*this._resolution)*this._width+i)*4;return[e[r],e[r+1],e[r+2],e[r+3]]}setMargin(t){this.margin.left=0,this.margin.right=0,this.margin.top=0,this.margin.bottom=0,T(t,e=>{e.margin&&(this.margin.left=Math.max(this.margin.left,e.margin.left),this.margin.right=Math.max(this.margin.right,e.margin.right),this.margin.top=Math.max(this.margin.top,e.margin.top),this.margin.bottom=Math.max(this.margin.bottom,e.margin.bottom))})}clear(){this.context.save(),this.context.fillStyle="#000",this.context.fillRect(0,0,this._width,this._height)}},oi=class{constructor(t,e){this.tainted=!0,this.order=0,this.visible=!0,this.dirty=!0,this._width=0,this._height=0,this.view=t,this.context=e}resize(t,e,i,s,r){this.width!=null&&(t=this.width,i=this.width),this.height!=null&&(e=this.height,s=this.height),this.margin?(t+=this.margin.left+this.margin.right,e+=this.margin.top+this.margin.bottom,i+=this.margin.left+this.margin.right,s+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+"px",this.view.style.top=-this.margin.top+"px"):(this.view.style.left="0px",this.view.style.top="0px"),this._width=Math.floor(t*r),this._height=Math.floor(e*r),this.view.width=this._width,this.view.style.width=i+"px",this.view.height=this._height,this.view.style.height=s+"px"}clear(){this.context.save(),this.context.clearRect(0,0,this._width,this._height)}};function Ns(g,t){g==null?requestAnimationFrame(t):setTimeout(()=>{requestAnimationFrame(t)},1e3/g)}var Ki=class g{constructor(t,e={},i){if(this._isDirty=!1,this._isDirtyParents=!1,this._isDirtyAnimation=!1,this._dirty={},this._dirtyParents={},this._dirtyBounds={},this._dirtyPositions={},this._ticker=null,this._tickers=[],this._updateTick=!0,this.skipRenderFrame=!1,this.events=new ws,this.animationTime=null,this._animations=[],this.language=si.new(this,{}),this.locale=ii,this.utc=!1,this.numberFormatter=Le.new(this,{}),this.dateFormatter=Ne.new(this,{}),this.durationFormatter=ze.new(this,{}),this.tabindex=0,this._tabindexes=[],this._a11yD=!1,this._focusElementDirty=!1,this._skipNextGroupJump=!0,this.verticalLayout=yi.new(this,{}),this.horizontalLayout=_i.new(this,{}),this.gridLayout=xi.new(this,{}),this._paused=!1,this.autoResize=!0,this._fontHash=[],this._isDisposed=!1,this._disposers=[],this._tooltips=[],this._htmlEnabledContainers=[],this.entitiesById={},!i)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this._settings=e,e.accessible==!1&&(this._a11yD=!0),e.useSafeResolution==null&&(e.useSafeResolution=!0),e.sanitizeHTML==null&&(e.sanitizeHTML=!0);let s;e.useSafeResolution&&(s=fs()),this._renderer=new Ye(s);let r;if(t instanceof HTMLElement?r=t:r=document.getElementById(t),T(Rt.rootElements,n=>{if(n.dom===r)if(Rt.autoDispose)n.dispose();else throw new Error("You cannot have multiple Roots on the same DOM node")}),this.interfaceColors=Ot.new(this,{}),r===null)throw new Error("Could not find HTML element with id `"+t+"`");this.dom=r;let a=document.createElement("div");a.style.position="relative",a.style.width="100%",a.style.height="100%",r.appendChild(a);let o=e.tooltipContainerBounds;o&&(this._tooltipContainerSettings=o),this._inner=a,this._updateComputedStyles(),Rt.rootElements.push(this)}static new(t,e){let i=new g(t,e,!0);return i._init(),i}moveDOM(t){let e;if(t instanceof HTMLElement?e=t:e=document.getElementById(t),e){for(;this.dom.childNodes.length>0;)e.appendChild(this.dom.childNodes[0]);this.dom=e,this._initResizeSensor(),this.resize()}}_handleLogo(){if(this._logo){let t=this.dom.offsetWidth,e=this.dom.offsetHeight;t<=150||e<=60?this._logo.hide():this._logo.show()}}_showBranding(){if(!this._logo){let t=this.tooltipContainer.children.push($.new(this,{interactive:!0,interactiveChildren:!1,position:"absolute",setStateOnChildren:!0,paddingTop:9,paddingRight:9,paddingBottom:9,paddingLeft:9,scale:.6,y:pt(100),centerY:W,tooltipY:10,tooltipText:"Created using amCharts 5",tooltipX:W,cursorOverStyle:"pointer",background:Et.new(this,{fill:ht(4671320),fillOpacity:0,tooltipY:5})}));t.set("tooltip",this.systemTooltip),t.events.on("click",()=>{window.open("https://www.amcharts.com/","_blank")}),t.states.create("hover",{});let e=t.children.push(z.new(this,{stroke:ht(13421772),strokeWidth:3,svgPath:"M5 25 L13 25h13.6c3.4 0 6 0 10.3-4.3s5.2-12 8.6-12c3.4 0 4.3 8.6 7.7 8.6M83.4 25H79.8c-3.4 0-6 0-10.3-4.3s-5.2-12-8.6-12-4.3 8.6-7.7 8.6",dx:-50,strokeOpacity:0}));e.states.create("hover",{stroke:ht(3976191)});let i=t.children.push(z.new(this,{stroke:ht(8947848),strokeWidth:3,svgPath:"M83.4 25h-31C37 25 39.5 4.4 28.4 4.4S18.9 24.2 4.3 25H0",dx:50,strokeOpacity:0})),s=Ss(Ms),r=1500;t.setTimeout(()=>{i.animate({key:"strokeOpacity",to:1,duration:r,easing:s}),i.animate({key:"dx",to:0,duration:r,easing:s}),e.animate({key:"dx",to:0,duration:r,easing:s}),e.animate({key:"strokeOpacity",to:1,duration:r,easing:s})},3e3),i.states.create("hover",{stroke:ht(4671320)}),this._logo=t,this._handleLogo()}}_getRealSize(){return this.dom.getBoundingClientRect()}_getCalculatedSize(t){return this._settings.calculateSize?this._settings.calculateSize(t):{width:t.width,height:t.height}}_init(){let t=this._settings;t.accessible!==!1&&(t.focusable&&(this._inner.setAttribute("focusable","true"),this._inner.setAttribute("tabindex",this.tabindex+"")),t.ariaLabel&&this._inner.setAttribute("aria-label",t.ariaLabel),t.role&&this._inner.setAttribute("role",t.role));let e=this._renderer,i=this._getRealSize(),s=this._getCalculatedSize(i),r=Math.floor(s.width),a=Math.floor(s.height),o=Math.floor(i.width),n=Math.floor(i.height),d=$.new(this,{visible:!0,width:r,height:a});this._rootContainer=d,this._rootContainer._defaultThemes.push(Ds.new(this));let u=d.children.push($.new(this,{visible:!0,width:W,height:W}));this.container=u,e.resize(o,n,r,a),this._inner.appendChild(e.view),this._initResizeSensor();let h=document.createElement("div");if(this._htmlElementContainer=h,h.className="am5-html-container",h.style.position="absolute",h.style.pointerEvents="none",this._tooltipContainerSettings||(h.style.overflow="hidden"),this._inner.appendChild(h),this._a11yD!==!0){let c=document.createElement("div");c.className="am5-reader-container",c.setAttribute("role","alert"),c.style.position="absolute",c.style.width="1px",c.style.height="1px",c.style.overflow="hidden",c.style.clip="rect(1px, 1px, 1px, 1px)",this._readerAlertElement=c,this._inner.appendChild(this._readerAlertElement);let l=document.createElement("div");l.className="am5-focus-container",l.style.position="absolute",l.style.pointerEvents="none",l.style.top="0px",l.style.left="0px",l.style.overflow="hidden",l.style.width=r+"px",l.style.height=a+"px",l.setAttribute("role","graphics-document"),t.ariaLabel&&l.setAttribute("aria-label",t.ariaLabel),zt(l,!1),this._focusElementContainer=l,this._inner.appendChild(this._focusElementContainer);let m=document.createElement("div");this._tooltipElementContainer=m,m.className="am5-tooltip-container",this._inner.appendChild(m),bt("keyboardevents")&&(this._disposers.push(N(window,"keydown",_=>{let f=St(_);f=="Shift"?this._isShift=!0:f=="Tab"&&(this._isShift=_.shiftKey)})),this._disposers.push(N(window,"keyup",_=>{St(_)=="Shift"&&(this._isShift=!1)})),this._disposers.push(N(l,"click",()=>{let _=this._focusedSprite;if(_){let f=_.get("clickAnnounceText","");f!==""&&this.readerAlert(f);let p=e.getEvent(new MouseEvent("click"));_.events.dispatch("click",{type:"click",originalEvent:p.event,point:p.point,simulated:!0,target:_})}})),this._disposers.push(N(l,"keydown",_=>{let f=this._focusedSprite;if(f){_.key=="Escape"&&(Ue(),this._focusedSprite=void 0);let p=0,b=0,x=St(_);switch(x){case"Enter":case" ":let y=f.get("clickAnnounceText","");if(y!==""&&this.readerAlert(y),x==" "&&f.get("role")!="checkbox")return;_.preventDefault();let v=e.getEvent(new MouseEvent("mouse"));f.events.dispatch("click",{type:"click",originalEvent:v.event,point:v.point,simulated:!0,target:f});return;case"ArrowLeft":p=-6;break;case"ArrowRight":p=6;break;case"ArrowUp":b=-6;break;case"ArrowDown":b=6;break;default:return}if(p!=0||b!=0){if(_.preventDefault(),!f.isDragging()){this._keyboardDragPoint={x:0,y:0};let k=e.getEvent(new MouseEvent("mousedown",{clientX:0,clientY:0}));k.point={x:0,y:0},f.events.isEnabled("pointerdown")&&f.events.dispatch("pointerdown",{type:"pointerdown",originalEvent:k.event,point:k.point,simulated:!0,target:f})}let y=this._keyboardDragPoint;y.x+=p,y.y+=b;let v=e.getEvent(new MouseEvent("mousemove",{clientX:y.x,clientY:y.y}),!1);f.events.isEnabled("globalpointermove")&&f.events.dispatch("globalpointermove",{type:"globalpointermove",originalEvent:v.event,point:v.point,simulated:!0,target:f})}}})),this._disposers.push(N(l,"keyup",_=>{if(this._focusedSprite){let f=this._focusedSprite,p=St(_);switch(p){case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"ArrowDown":if(f.isDragging()){let x=this._keyboardDragPoint,y=e.getEvent(new MouseEvent("mouseup",{clientX:x.x,clientY:x.y}));f.events.isEnabled("globalpointerup")&&f.events.dispatch("globalpointerup",{type:"globalpointerup",originalEvent:y.event,point:y.point,simulated:!0,target:f}),this._keyboardDragPoint=void 0;return}else if(f.get("focusableGroup")){let x=f.get("focusableGroup"),y=this._tabindexes.filter(w=>!!(w.get("focusableGroup")==x&&w.getPrivate("focusable")!==!1&&w.isVisibleDeep())),v=y.indexOf(f),k=y.length-1;v+=p=="ArrowRight"||p=="ArrowDown"?1:-1,v<0?v=k:v>k&&(v=0),ls(y[v].getPrivate("focusElement").dom)}break;case"Tab":let b=f.get("focusableGroup");if(b&&this._isShift){this._skipNextGroupJump||(this._focusNext(f.getPrivate("focusElement").dom,-1,b),this._skipNextGroupJump=!0);return}break}}})))}this._startTicker(),this.setThemes([]),this._addTooltip(),this._hasLicense()||this._showBranding()}get systemTooltip(){if(!this._systemTooltip){let t=_t.new(this,{themeTags:["system"]});this._systemTooltip=t}return this._systemTooltip}_initResizeSensor(){this._resizeSensorDisposer&&this._resizeSensorDisposer.dispose(),this._resizeSensorDisposer=new ei(this.dom,()=>{this.autoResize&&this.resize()}),this._disposers.push(this._resizeSensorDisposer)}resize(){let t=this._getRealSize(),e=this._getCalculatedSize(t),i=Math.floor(e.width),s=Math.floor(e.height);if(i>0&&s>0){let r=Math.floor(t.width),a=Math.floor(t.height),o=this._htmlElementContainer;if(o.style.width=i+"px",o.style.height=s+"px",this._a11yD!==!0){let d=this._focusElementContainer;d.style.width=i+"px",d.style.height=s+"px"}this._renderer.resize(r,a,i,s);let n=this._rootContainer;n.setPrivate("width",i),n.setPrivate("height",s),this._render(),this._handleLogo()}}_render(){if(this.skipRenderFrame){this.skipRenderFrame=!1;return}this._renderer.render(this._rootContainer._display),this._focusElementDirty&&(this._updateCurrentFocus(),this._focusElementDirty=!1)}_runTickers(t){T(this._tickers,e=>{e(t)})}_runAnimations(t){let e=0;return jt(this._animations,i=>{let s=i._runAnimation(t);return s===mi.Stopped?!1:(s===mi.Playing&&++e,!0)}),this._isDirtyAnimation=!1,e===0}_runDirties(){let t={};for(;this._isDirtyParents;)this._isDirtyParents=!1,qt(this._dirtyParents).forEach(([a,o])=>{delete this._dirtyParents[a],o.isDisposed()||(t[o.uid]=o,o._prepareChildren())});qt(t).forEach(([a,o])=>{o._updateChildren()});let e=[];qt(this._dirty).forEach(([a,o])=>{o.isDisposed()?delete this._dirty[a]:(e.push(o),o._beforeChanged())}),e.forEach(a=>{a._changed(),delete this._dirty[a.uid],a._clearDirty()}),this._isDirty=!1;let i={},s=[];qt(this._dirtyBounds).forEach(([a,o])=>{delete this._dirtyBounds[a],o.isDisposed()||(i[o.uid]=o.depth(),s.push(o))}),this._positionHTMLElements(),s.sort((a,o)=>Cs(i[o.uid],i[a.uid])),s.forEach(a=>{a._updateBounds()});let r=this._dirtyPositions;qt(r).forEach(([a,o])=>{delete r[a],o.isDisposed()||o._updatePosition()}),e.forEach(a=>{a._afterChanged()}),qt(t).forEach(([a,o])=>{o._childrenPrep=!1,o._childrenUpdt=!1})}_renderFrame(t){if(this._updateTick){this.events.isEnabled("framestarted")&&this.events.dispatch("framestarted",{type:"framestarted",target:this,timestamp:t}),this._checkComputedStyles(),this._runTickers(t);let e=this._runAnimations(t);return this._runDirties(),this._render(),this._renderer.resetImageArray(),this._positionHTMLElements(),this.events.isEnabled("frameended")&&this.events.dispatch("frameended",{type:"frameended",target:this,timestamp:t}),this._tickers.length===0&&e&&!this._isDirtyAnimation&&!this._isDirty}else return!0}_runTicker(t,e){this.isDisposed()||(this.animationTime=t,this._renderFrame(t)?(this._ticker=null,this.animationTime=null):this._paused||(e?this._ticker:Ns(this.fps,this._ticker)))}_runTickerNow(t=1e4){if(!this.isDisposed()){let e=performance.now()+t;for(;;){let i=performance.now();if(i>=e){this.animationTime=null;break}if(this.animationTime=i,this._renderFrame(i)){this.animationTime=null;break}}}}_startTicker(){this._ticker===null&&(this.animationTime=null,this._ticker=t=>{this._runTicker(t)},Ns(this.fps,this._ticker))}get updateTick(){return this._updateTick}set updateTick(t){this._updateTick=t,t&&this._startTicker()}_addDirtyEntity(t){this._isDirty=!0,this._dirty[t.uid]===void 0&&(this._dirty[t.uid]=t),this._startTicker()}_addDirtyParent(t){this._isDirty=!0,this._isDirtyParents=!0,this._dirtyParents[t.uid]===void 0&&(this._dirtyParents[t.uid]=t),this._startTicker()}_addDirtyBounds(t){this._isDirty=!0,this._dirtyBounds[t.uid]===void 0&&(this._dirtyBounds[t.uid]=t),this._startTicker()}_addDirtyPosition(t){this._isDirty=!0,this._dirtyPositions[t.uid]===void 0&&(this._dirtyPositions[t.uid]=t),this._startTicker()}_addAnimation(t){this._isDirtyAnimation=!0,this._animations.indexOf(t)===-1&&this._animations.push(t),this._startTicker()}_markDirty(){this._isDirty=!0}_markDirtyRedraw(){this.events.once("frameended",()=>{this._isDirty=!0,this._startTicker()})}eachFrame(t){return this._tickers.push(t),this._startTicker(),new yt(()=>{Te(this._tickers,t)})}markDirtyGlobal(t){t||(t=this.container),t.walkChildren(e=>{e instanceof $&&this.markDirtyGlobal(e),e.markDirty(),e.markDirtyBounds()})}width(){return Math.floor(this._getCalculatedSize(this._getRealSize()).width)}height(){return Math.floor(this._getCalculatedSize(this._getRealSize()).height)}dispose(){this._isDisposed||(this._isDisposed=!0,this._rootContainer.dispose(),this._renderer.dispose(),this.horizontalLayout.dispose(),this.verticalLayout.dispose(),this.interfaceColors.dispose(),T(this._disposers,t=>{t.dispose()}),this._inner&&hs(this._inner),Nt(Rt.rootElements,this))}isDisposed(){return this._isDisposed}readerAlert(t){if(this._a11yD!==!0){let e=this._readerAlertElement;t=di(t),e.innerHTML==t&&(e.innerHTML=""),e.innerHTML=t}}setThemes(t){this._rootContainer.set("themes",t);let e=this.tooltipContainer;e&&e._applyThemes();let i=this.interfaceColors;i&&i._applyThemes()}_addTooltip(){if(!this.tooltipContainer){let t=this._tooltipContainerSettings,e=this._rootContainer.children.push($.new(this,{position:"absolute",isMeasured:!1,width:W,height:W,layer:t?35:30,layerMargin:t||void 0}));this.tooltipContainer=e;let i=_t.new(this,{});this.container.set("tooltip",i),i.hide(0),this._tooltip=i}}_registerTabindexOrder(t){this._a11yD!=!0&&(t.get("focusable")?Me(this._tabindexes,t):Nt(this._tabindexes,t),this._invalidateTabindexes())}_unregisterTabindexOrder(t){this._a11yD!=!0&&(Nt(this._tabindexes,t),this._invalidateTabindexes())}_invalidateTabindexes(){if(this._a11yD==!0)return;this._tabindexes.sort((e,i)=>{let s=e.get("tabindexOrder",0),r=i.get("tabindexOrder",0);return s==r?0:s>r?1:-1});let t=[];T(this._tabindexes,(e,i)=>{e.getPrivate("focusElement")?this._moveFocusElement(i,e):this._makeFocusElement(i,e);let s=e.get("focusableGroup");s&&e.getPrivate("focusable")!==!1&&(t.indexOf(s)!==-1?e.getPrivate("focusElement").dom.setAttribute("tabindex","-1"):t.push(s))})}_updateCurrentFocus(){this._a11yD!=!0&&this._focusedSprite&&(this._decorateFocusElement(this._focusedSprite),this._positionFocusElement(this._focusedSprite))}_decorateFocusElement(t,e){if(this._a11yD==!0||(e||(e=t.getPrivate("focusElement").dom),!e))return;let i=t.get("role");i?e.setAttribute("role",i):e.removeAttribute("role");let s=t.get("ariaLabel");if(s){let _=bi(t,s);e.setAttribute("aria-label",_)}else e.removeAttribute("aria-label");let r=t.get("ariaLive");r?e.setAttribute("aria-live",r):e.removeAttribute("aria-live");let a=t.get("ariaChecked");a!=null&&i&&["checkbox","option","radio","menuitemcheckbox","menuitemradio","treeitem"].indexOf(i)!==-1?e.setAttribute("aria-checked",a?"true":"false"):e.removeAttribute("aria-checked");let o=t.get("ariaCurrent");o!=null?e.setAttribute("aria-current",o):e.removeAttribute("aria-current");let n=t.get("ariaSelected");n!=null&&i&&["gridcell","option","row","tab","columnheader","rowheader","treeitem"].indexOf(i)!==-1?e.setAttribute("aria-selected",n?"true":"false"):e.removeAttribute("aria-selected"),t.get("ariaHidden")?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden");let d=t.get("ariaOrientation");d?e.setAttribute("aria-orientation",d):e.removeAttribute("aria-orientation");let u=t.get("ariaValueNow");u?e.setAttribute("aria-valuenow",u):e.removeAttribute("aria-valuenow");let h=t.get("ariaValueMin");h?e.setAttribute("aria-valuemin",h):e.removeAttribute("aria-valuemin");let c=t.get("ariaValueMax");c?e.setAttribute("aria-valuemax",c):e.removeAttribute("aria-valuemax");let l=t.get("ariaValueText");l?e.setAttribute("aria-valuetext",l):e.removeAttribute("aria-valuetext");let m=t.get("ariaControls");m?e.setAttribute("aria-controls",m):e.removeAttribute("aria-controls"),t.get("visible")&&t.get("opacity")!==0&&t.get("role")!="tooltip"&&!t.isHidden()&&t.getPrivate("focusable")!==!1&&(t.height()||t.width())?(e.getAttribute("tabindex")!="-1"&&e.setAttribute("tabindex",""+this.tabindex),e.removeAttribute("aria-hidden")):(e.removeAttribute("tabindex"),e.setAttribute("aria-hidden","true"))}_makeFocusElement(t,e){if(e.getPrivate("focusElement")||this._a11yD==!0)return;let i=document.createElement("div");e.get("role")!="tooltip"&&(i.tabIndex=this.tabindex),i.style.position="absolute",zt(i,!1);let s=[];e.setPrivate("focusElement",{dom:i,disposers:s}),this._decorateFocusElement(e),s.push(N(i,"focus",r=>{this._handleFocus(r)})),s.push(N(i,"blur",r=>{this._handleBlur(r)})),this._moveFocusElement(t,e)}_removeFocusElement(t){if(this._a11yD==!0)return;Nt(this._tabindexes,t);let e=t.getPrivate("focusElement");e&&(this._focusElementContainer.removeChild(e.dom),T(e.disposers,s=>{s.dispose()}))}_hideFocusElement(t){if(this._a11yD==!0)return;let e=t.getPrivate("focusElement");e.dom.style.display="none"}_moveFocusElement(t,e){if(this._a11yD==!0)return;let i=this._focusElementContainer,s=e.getPrivate("focusElement").dom;if(s===this._focusElementContainer.children[t])return;let r=this._focusElementContainer.children[t+1];r?i.insertBefore(s,r):i.append(s)}_positionFocusElement(t){if(this._a11yD==!0||t==null)return;this._focusElementContainer.scrollTop=0;let e=t.globalBounds(),i=e.right==e.left?t.width():e.right-e.left,s=e.top==e.bottom?t.height():e.bottom-e.top,r=this._settings.focusPadding!==void 0?this._settings.focusPadding:2,a=e.left-r,o=e.top-r;i<0&&(a+=i,i=Math.abs(i)),s<0&&(o+=s,s=Math.abs(s));let n=t.getPrivate("focusElement").dom;n.style.top=o+"px",n.style.left=a+"px",n.style.width=i+r*2+"px",n.style.height=s+r*2+"px"}_getSpriteByFocusElement(t){let e;return ke(this._tabindexes,(i,s)=>i.getPrivate("focusElement").dom===t?(e=i,!1):!0),e}_handleFocus(t){if(this._a11yD==!0)return;let e=this._getSpriteByFocusElement(t.target);if(e){if(!e.isVisibleDeep()){this._focusNext(t.target,this._isShift?-1:1);return}this._positionFocusElement(e),this._focusedSprite=e,e.events.isEnabled("focus")&&e.events.dispatch("focus",{type:"focus",originalEvent:t,target:e}),e.getPrivate("focusElement").dom.tabIndex==-1&&(this._skipNextGroupJump=!1)}}_focusNext(t,e,i){if(this._a11yD==!0)return;let s=this.dom.getRootNode?this.dom.getRootNode():null,r=this.dom.ownerDocument||document;s&&(typeof ShadowRoot<"u"&&s instanceof ShadowRoot||s instanceof Document)&&(r=s);let a=Array.from(r.querySelectorAll(["a[href]","area[href]","button:not([disabled])","details","input:not([disabled])","iframe:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[contentEditable=""]','[contentEditable="true"]','[contentEditable="TRUE"]','[tabindex]:not([tabindex^="-"])'].join(","))),o=a.indexOf(t)+e;o<0?o=a.length-1:o>=a.length&&(o=0);let n=a[o];if(i&&e==-1){let d=this._getSpriteByFocusElement(n);if(d&&d.get("focusableGroup")==i){this._focusNext(n,e);return}}n&&n.focus()}_handleBlur(t){if(this._a11yD==!0)return;let e=this._focusedSprite;e&&!e.isDisposed()&&e.events.isEnabled("blur")&&e.events.dispatch("blur",{type:"blur",originalEvent:t,target:e}),this._focusedSprite=void 0}updateTooltip(t){if(this._a11yD==!0)return;let e=ms(di(t._getText())),i=t.getPrivate("tooltipElement");t.get("role")=="tooltip"&&e!=""?(i||(i=this._makeTooltipElement(t)),i.innerHTML!=e&&(i.innerHTML=e),i.setAttribute("aria-hidden",t.isVisibleDeep()?"false":"true")):i&&(i.remove(),t.removePrivate("tooltipElement"))}_makeTooltipElement(t){let e=this._tooltipElementContainer,i=document.createElement("div");return i.style.position="absolute",i.style.width="1px",i.style.height="1px",i.style.overflow="hidden",i.style.clip="rect(1px, 1px, 1px, 1px)",zt(i,!1),this._decorateFocusElement(t,i),e.append(i),t.setPrivate("tooltipElement",i),i}_removeTooltipElement(t){if(this._a11yD==!0)return;let e=t.getPrivate("tooltipElement");if(e){let i=e.parentElement;i&&i.removeChild(e)}}_invalidateAccessibility(t){if(this._a11yD==!0)return;this._focusElementDirty=!0;let e=t.getPrivate("focusElement");t.get("focusable")?e&&(this._decorateFocusElement(t),this._focusedSprite===t&&this._positionFocusElement(t)):e&&this._removeFocusElement(t)}focused(t){return this._focusedSprite===t}documentPointToRoot(t){let e=this._getRealSize(),i=this._getCalculatedSize(e),s=i.width/e.width,r=i.height/e.height;return{x:(t.x-e.left)*s,y:(t.y-e.top)*r}}rootPointToDocument(t){let e=this._getRealSize(),i=this._getCalculatedSize(e),s=i.width/e.width,r=i.height/e.height;return{x:t.x/s+e.left,y:t.y/r+e.top}}addDisposer(t){return this._disposers.push(t),t}_updateComputedStyles(){let t=window.getComputedStyle(this.dom),e=this._fontHash,i=Se(t).flatMap(s=>{var r;return typeof s=="string"&&s.startsWith("font")?[(r=t[s])===null||r===void 0?void 0:r.toString()]:[]});if(e.length!==i.length)return this._fontHash=i,!0;for(let s=0;s<e.length;s++)if(e[s]!==i[s])return this._fontHash=i,!0;return!1}_checkComputedStyles(){this._updateComputedStyles()&&this._invalidateLabelBounds(this.container)}_invalidateLabelBounds(t){t instanceof $?t.children.each(e=>{this._invalidateLabelBounds(e)}):t instanceof vi&&t.markDirtyBounds()}_hasLicense(){for(let t=0;t<Rt.licenses.length;t++)if(Rt.licenses[t].match(/^AM5C.{5,}/i))return!0;return!1}_licenseApplied(){this._logo&&this._logo.set("forceHidden",!0)}get debugGhostView(){return this._renderer.debugGhostView}set debugGhostView(t){this._renderer.debugGhostView=t}set tapToActivate(t){this._renderer.tapToActivate=t}get tapToActivate(){return this._renderer.tapToActivate}set tapToActivateTimeout(t){this._renderer.tapToActivateTimeout=t}get tapToActivateTimeout(){return this._renderer.tapToActivateTimeout}_makeHTMLElement(t){let e=this._htmlElementContainer,i=document.createElement("div");t.setPrivate("htmlElement",i);let s=!1,r;t._walkParents(o=>{if(o.get("verticalScrollbar"))return s=!0,r=o,!1});let a;return s&&(a=document.createElement("div"),t.setPrivate("htmlElementWrapper",a),t.setPrivate("wrapperContainer",r),a.style.position="absolute",a.style.overflow="hidden",a.style.boxSizing="border-box",a.style.top="0px",a.style.left="0px",a.style.width="100%",a.style.height="100%",r.events.on("boundschanged",()=>{this._positionHTMLElement(t)})),i.style.position="absolute",i.style.overflow="auto",i.style.boxSizing="border-box",zt(i,t.get("interactive",!1)),t.events.isEnabled("click")&&(zt(i,!0),this._disposers.push(N(i,"click",o=>{let n=this._renderer.getEvent(o);t.events.dispatch("click",{type:"click",originalEvent:n.event,point:n.point,simulated:!1,target:t})}))),this._positionHTMLElement(t),s?(a.append(i),e.append(a)):e.append(i),Me(this._htmlEnabledContainers,t),i}_positionHTMLElements(){T(this._htmlEnabledContainers,t=>{this._positionHTMLElement(t)})}_positionHTMLElement(t){let e=t.getPrivate("htmlElementWrapper");if(e){let s=t.getPrivate("wrapperContainer");if(s){let r=s.globalBounds();e.style.clipPath="rect("+r.top+"px "+r.right+"px "+r.bottom+"px "+r.left+"px)"}}let i=t.getPrivate("htmlElement");if(i){T(["paddingTop","paddingRight","paddingBottom","paddingLeft","minWidth","minHeight","maxWidth","maxHeight"],x=>{let y=t.get(x);y?i.style[x]=y+"px":i.style[x]=""}),T(["fontFamily","fontSize","fontStyle","fontWeight","fontStyle","fontVariant","textDecoration"],x=>{let y=t.get(x);y?x=="fontSize"&&!Tt(y)?i.style[x]=y+"px":i.style[x]=y+"":i.style[x]=""});let a=t.compositeScale()||1,o=t.compositeRotation()||0;i.style.transform="",i.style.transformOrigin="";let n=t.compositeOpacity();setTimeout(()=>{i.style.opacity=n+""},10);let d=t.isVisibleDeep();d&&(i.style.display="block");let u={x:t.x()+t.get("dx",0),y:t.y()+t.get("dy",0)};t.parent&&(u=t.parent.toGlobal(u)),i.style.top=u.y+"px",i.style.left=u.x+"px";let h=t.get("width"),c=t.get("height"),l=0,m=0;if(h&&(l=t.width()),c&&(m=t.height()),!h||!c){i.style.position="fixed",i.style.width="",i.style.height="";let x=i.getBoundingClientRect();i.style.position="absolute",h||(l=x.width),c||(m=x.height);let y=l/a,v=m/a,k=t.get("centerX",0),w=t.get("centerY",0),C=0,P=0,S=0,M=0;k instanceof nt?(C=-k.value*y,P=(1-k.value)*y):(C=-k,P=y-k),w instanceof nt?(S=-w.value*v,M=(1-w.value)*v):(S=-w,M=v-w),t._localBounds={left:C,right:P,top:S,bottom:M};let D=t._adjustedLocalBounds,E=t._display.getAdjustedBounds(t._localBounds);t._adjustedLocalBounds=E,(D.left!==E.left||D.right!==E.right||D.top!==E.top||D.bottom!==E.bottom)&&t.markDirtyBounds()}l>0&&(i.style.minWidth=l+"px"),m>0&&(i.style.minHeight=m+"px"),(!d||n==0)&&(i.style.display="none");let _=t.get("centerX",0),f=hi(_)?_.percent+"%":_+"px",p=t.get("centerY",0),b=hi(p)?p.percent+"%":p+"px";(_||p)&&(i.style.transform="translate(-"+f+", -"+b+")"+i.style.transform),a!=1&&(i.style.transform+="scale("+a+")"),o!=0&&(i.style.transform+=" rotate("+o+"deg)"),i.style.transform!=""&&(i.style.transformOrigin=f+" "+b)}}_sanitizeHTML(t){return this._settings.sanitizeHTML?gs(t):t}_setHTMLContent(t,e){let i=t.getPrivate("htmlElement");i||(i=this._makeHTMLElement(t),this.autoResize||this.resize());let s=this._sanitizeHTML(e);i.innerHTML!=s&&(i.innerHTML=s)}_removeHTMLContent(t){let e=t.getPrivate("htmlElementWrapper"),i=t.getPrivate("htmlElement");e?(this._htmlElementContainer.removeChild(e),t.removePrivate("htmlElement"),t.removePrivate("htmlElementWrapper"),t.removePrivate("wrapperContainer")):i&&(this._htmlElementContainer.removeChild(i),t.removePrivate("htmlElement"),t.removePrivate("wrapperContainer")),Nt(this._htmlEnabledContainers,t)}};var ni;function qs(g,t,e){let i=t.interfaceColors,s=i.get("secondaryButton").toCSS(),r=i.get("text").toCSS(),a=i.get("alternativeBackground").toCSS(.45);if(!ni){let o=new xt([new Q(g,".am5-modal",{width:"100%",height:"100%",position:"absolute","z-index":"100000",top:"0",left:"0"},t.nonce),new Q(g,".am5-modal-curtain",{top:"0",left:"0",width:"100%",height:"100%",position:"absolute",background:i.get("background").toCSS(.5),"z-index":"100"},t.nonce),new Q(g,".am5-modal-wrapper",{top:"0",left:"0",width:"100%",height:"100%",position:"absolute","text-align":"center","white-space":"nowrap",background:i.get("background").toCSS(.5),"z-index":"101"},t.nonce),new Q(g,".am5-modal-wrapper:before",{content:"''",display:"inline-block",height:"100%","vertical-align":"middle","margin-right":"-0.25em"},t.nonce),new Q(g,".am5-modal-content",{display:"inline-block",padding:"1.2em","vertical-align":"middle","text-align":"start","white-space":"normal",background:i.get("background").toCSS(),"border-radius":"4px","-webkit-box-shadow":"0px 0px 36px 0px "+a,"box-shadow":"0px 0px 36px 0px "+a,color:r},t.nonce),new Q(g,".am5-modal-content h1",{"font-size":"1em",margin:"0 0 0.5em 0"},t.nonce),new Q(g,".am5-modal-table",{display:"table",margin:"1em 0"},t.nonce),new Q(g,".am5-modal-table-row",{display:"table-row"},t.nonce),new Q(g,".am5-modal-table-heading",{display:"table-heading",padding:"3px 10px 3px 0"},t.nonce),new Q(g,".am5-modal-table-cell",{display:"table-cell",padding:"3px 0 3px 0"},t.nonce),new Q(g,".am5-modal-table-cell > *",{"vertical-align":"middle"},t.nonce),new Q(g,".am5-modal-content input[type=text], .am5-modal-content input[type=number], .am5-modal-content select",{border:"1px solid "+s,"border-radius":"4px",padding:"3px 5px",margin:"2px"},t.nonce),new Q(g,".am5-modal-input-narrow",{width:"70px"},t.nonce),new Q(g,".am5-modal-button",{"font-weight":"400",color:i.get("secondaryButtonText").toCSS(),"line-height":"1.5","text-align":"center","text-decoration":"none","vertical-align":"middle",cursor:"pointer",padding:"0.2em 0.8em","font-size":"1em","border-radius":"0.25em",margin:"0 0.25em 0 0",border:"1px solid "+i.get("secondaryButtonStroke").toCSS(),background:i.get("secondaryButton").toCSS()},t.nonce),new Q(g,".am5-modal-button:hover",{background:i.get("secondaryButtonHover").toCSS()},t.nonce),new Q(g,".am5-modal-button.am5-modal-primary",{color:i.get("primaryButtonText").toCSS(),border:"1px solid "+i.get("primaryButtonStroke").toCSS(),background:i.get("primaryButton").toCSS()},t.nonce),new Q(g,".am5-modal-button.am5-modal-primary:hover",{background:i.get("primaryButtonHover").toCSS()},t.nonce)]);ni=new Ce(()=>{ni=void 0,o.dispose()})}return ni.increment()}var te=class extends I{_afterNew(){super._afterNewApplyThemes(),this._setRawDefault("deactivateRoot",!0),qs(us(this._root.dom),this._root);let t=document.createElement("div");t.className="am5-modal",t.style.display="none",this.root._inner.appendChild(t),this.setPrivate("container",t);let e=document.createElement("div");e.className="am5-modal-curtain",t.appendChild(e),this.setPrivate("curtain",e),this._disposers.push(N(e,"click",()=>{this.cancel()}));let i=document.createElement("div");i.className="am5-modal-wrapper",t.appendChild(i),this.setPrivate("wrapper",i);let s=document.createElement("div");s.className="am5-modal-content",i.appendChild(s),this.setPrivate("content",s);let r=this.get("content");r&&(s.innerHTML=this._root._sanitizeHTML(r)),bt("keyboardevents")&&this._disposers.push(N(document,"keydown",a=>{this.isOpen()&&St(a)=="Escape"&&this.cancel()}))}_beforeChanged(){super._beforeChanged(),this.isDirty("content")&&(this.getPrivate("content").innerHTML=this._root._sanitizeHTML(this.get("content","")))}isOpen(){return this.getPrivate("container").style.display!="none"}open(){this.getPrivate("container").style.display="block",this.get("deactivateRoot")&&this.setTimeout(()=>{this._root._renderer.interactionsEnabled=!1},10),this.events.dispatch("opened",{type:"opened",target:this})}close(){this.getPrivate("container").style.display="none",this.get("deactivateRoot")&&(this._root._renderer.interactionsEnabled=!0),this.events.dispatch("closed",{type:"closed",target:this})}cancel(){this.getPrivate("container").style.display="none",this.get("deactivateRoot")&&(this._root._renderer.interactionsEnabled=!0),this.events.dispatch("cancelled",{type:"cancelled",target:this})}_dispose(){super._dispose();let t=this.getPrivate("container");t.parentElement&&t.parentElement.removeChild(t)}};te.className="Modal";te.classNames=I.classNames.concat([te.className]);var ee=class extends I{_afterNew(){super._afterNewApplyThemes()}_beforeChanged(){if(super._beforeChanged(),this.isDirty("sprite")){let t=this.get("sprite");t&&(t.setAll({position:"absolute",role:"figure"}),this._disposers.push(t))}(this.isDirty("locationX")||this.isDirty("locationY"))&&this.series&&this.series._positionBullet(this)}};ee.className="Bullet";ee.classNames=I.classNames.concat([ee.className]);var ie=class extends Ft{_afterNew(){super._afterNew(),this.addTag("confirm"),bt("keyboardevents")&&this._disposers.push(N(document,"keydown",t=>{let e=St(t);this.get("active")&&e=="Escape"&&this._cancel()})),this._disposers.push(N(document,"click",()=>{this._ignoreClick||this._cancel(),this._ignoreClick=!1})),this.events.on("click",()=>{this.get("active")||(this._ignoreClick=!0),this._confirm()})}_cancel(){this.get("active")&&(this.events.dispatch("cancelled",{type:"cancelled",target:this}),this.set("active",!1))}_confirm(){this.get("active")&&(this.events.dispatch("confirmed",{type:"confirmed",target:this}),this.set("active",!1),this.isFocus()&&this.setTimeout(()=>{this.set("active",!1),Ue()},10))}_prepareChildren(){super._prepareChildren()}};ie.className="ConfirmButton";ie.classNames=Ft.classNames.concat([ie.className]);var It=class extends z{_afterNew(){super._afterNew(),this._display.isMeasured=!0,this.setPrivateRaw("trustBounds",!0)}_beforeChanged(){super._beforeChanged(),this.isDirty("radius")&&(this._clear=!0)}_changed(){super._changed(),this._clear&&this._display.drawCircle(0,0,Math.abs(this.get("radius",10)))}};It.className="Circle";It.classNames=z.classNames.concat([It.className]);var se=class extends z{_beforeChanged(){if(super._beforeChanged(),this.isDirty("coordinates")){let t=[],e=this.get("coordinates");e&&T(e,i=>{t.push({x:i[0],y:i[1]})}),this.set("points",t)}if(this.isPrivateDirty("points")&&(this._clear=!0),this.isDirty("points")){this._clear=!0;let t=this.get("points"),e=this._prevSettings.points;if(e){if(t){let o=Ut(t),n=Ut(e),d=o.length,u=n.length;if(d>u){let h=Ut(o);for(let c=0;c<d;c++){let l=Math.floor(c/d*u);h[c]={x:n[l].x,y:n[l].y}}n=h}else if(u>d){let h=Ut(n);for(let c=0;c<u;c++){let l=Math.floor(c/u*d);h[c]={x:o[l].x,y:o[l].y}}o=h}this.setPrivateRaw("previousPoints",n),this.setPrivateRaw("points",o),this.morphAnimation=this.animatePrivate({key:"morphProgress",from:0,to:1,duration:this.get("animationDuration",0),easing:this.get("animationEasing")}),this._root.events.once("frameended",()=>{this._markDirtyPrivateKey("morphProgress")})}}else this.setPrivateRaw("previousPoints",t),this.setPrivateRaw("points",t);let i=1/0,s=-1/0,r=1/0,a=-1/0;if(t)for(let o=1,n=t.length;o<n;o++){let d=t[o];i=Math.min(i,d.x),s=Math.max(s,d.x),r=Math.min(r,d.y),a=Math.max(a,d.y)}this.setPrivate("minX",i),this.setPrivate("maxX",s),this.setPrivate("minY",r),this.setPrivate("maxY",r)}this.isPrivateDirty("morphProgress")&&(this._clear=!0)}_changed(){super._changed(),this._clear&&this._draw()}_draw(){let t=this.getPrivate("previousPoints"),e=this.getPrivate("points"),i=this.getPrivate("morphProgress",1);if(e&&t){let s=e[0],r=t[0];s&&this._display.moveTo(r.x+(s.x-r.x)*i,r.y+(s.y-r.y)*i);for(let a=1,o=e.length;a<o;a++){let n=e[a],d=t[a];this._display.lineTo(d.x+(n.x-d.x)*i,d.y+(n.y-d.y)*i)}this._display.closePath()}}_updateSize(){this.markDirty(),this._clear=!0}};se.className="Polygon";se.classNames=z.classNames.concat([se.className]);var re=class extends z{_beforeChanged(){super._beforeChanged(),(this.isDirty("radiusX")||this.isDirty("radiusY")||this.isDirty("rotation"))&&(this._clear=!0)}_changed(){super._changed(),this._clear&&this._display.drawEllipse(0,0,Math.abs(this.get("radiusX")),Math.abs(this.get("radiusY")))}};re.className="Ellipse";re.classNames=z.classNames.concat([re.className]);var ae=class extends z{_beforeChanged(){super._beforeChanged(),(this.isDirty("radius")||this.isDirty("innerRadius")||this.isDirty("spikes"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){let t=this._display,e=this.get("radius",0),i=vt(this.get("innerRadius",0),e),s=this.get("spikes",0),r=Math.PI/s,a=Math.PI/2*3;t.moveTo(0,-e);for(let o=0;o<s;o++)t.lineTo(Math.cos(a)*e,Math.sin(a)*e),a+=r,t.lineTo(Math.cos(a)*i,Math.sin(a)*i),a+=r;t.lineTo(0,-e),t.closePath()}}};ae.className="Star";ae.classNames=z.classNames.concat([ae.className]);var Yt=class extends ${constructor(){super(...arguments),this._movePoints={},this._downScale=1,this._downX=0,this._downY=0,this.contents=this.children.push($.new(this._root,{width:W,height:W,x:0,y:0,draggable:!0,background:Et.new(this._root,{fill:ht(16777215),fillOpacity:0})}))}_afterNew(){super._afterNew();let t=this.contents.events;this._disposers.push(t.on("pointerdown",s=>{this._handleThisDown(s)})),this._disposers.push(t.on("globalpointerup",s=>{this._handleThisUp(s)})),this._disposers.push(t.on("globalpointermove",s=>{this._handleThisMove(s)}));let e=this.contents.get("background");e&&(e.adapters.add("width",s=>Number(s)*20),e.adapters.add("height",s=>Number(s)*20),e.adapters.add("x",s=>Number(s)-e.width()/2),e.adapters.add("y",s=>Number(s)-e.height()/2));let i=this.contents;i.adapters.add("x",s=>{let r=i.get("scale",1);if(A(s)&&r>=1){let a=this.get("maxPanOut",.4),o=i.width();s=Math.min(o*a,s),s=Math.max(this.width()-o*r*(1+a),s)}return s}),i.adapters.add("y",s=>{let r=i.get("scale",1);if(A(s)&&r>=1){let a=this.get("maxPanOut",.4),o=i.height();s=Math.min(o*a,s),s=Math.max(this.height()-o*r*(1+a),s)}return s})}_prepareChildren(){super._prepareChildren(),this.isDirty("wheelable")&&this._handleSetWheel(),this.contents._display.cancelTouch=this.get("pinchZoom",!1)}_handleSetWheel(){this.get("wheelable")?(this._wheelDp&&this._wheelDp.dispose(),this._wheelDp=this.events.on("wheel",t=>{let e=t.originalEvent;if(ds(e,this))e.preventDefault();else return;let i=this.toLocal(t.point);this._handleWheelZoom(e.deltaY,i)}),this._disposers.push(this._wheelDp)):this._wheelDp&&this._wheelDp.dispose()}_handleWheelZoom(t,e){let i=this.get("zoomStep",2),s=this.contents.get("scale",1),r=s;t>0?r=s/i:t<0&&(r=s*i),r!=s&&this.zoomToPoint(e,r)}zoomToPoint(t,e){e&&(e=ot(e,this.get("minZoomLevel",1),this.get("maxZoomLevel",32)));let i=this.contents.get("scale",1),s=t.x,r=t.y,a=s,o=r,n=this.contents,d=n.x(),u=n.y(),h=a-(s-d)/i*e,c=o-(r-u)/i*e;return this._animateTo(h,c,e),this._za}zoomIn(){return this.zoomToPoint({x:this.width()/2,y:this.height()/2},this.contents.get("scale",1)*this.get("zoomStep",2))}zoomOut(){return this.zoomToPoint({x:this.width()/2,y:this.height()/2},this.contents.get("scale",1)/this.get("zoomStep",2))}goHome(){return this._animateTo(0,0,1)}_animateTo(t,e,i){let s=this.get("animationDuration",0),r=this.get("animationEasing"),a=this.contents;this._txa=a.animate({key:"x",to:t,duration:s,easing:r}),this._tya=a.animate({key:"y",to:e,duration:s,easing:r}),this._za=a.animate({key:"scale",to:i,duration:s,easing:r})}_handleThisUp(t){this._downPoints={}}_handleThisDown(t){let e=this.contents;this._downScale=e.get("scale",1);let i=e._downPoints,s=Se(i).length;if(s==1){let r=i[1];r||(r=i[0]),r&&r.x==t.point.x&&r.y==t.point.y&&(s=0)}if(s>0){this._downX=e.x(),this._downY=e.y();let r=e._getDownPointId();if(r){let a=this._movePoints[r];a&&(e._downPoints[r]=a)}}}_handleThisMove(t){let i=t.originalEvent.pointerId;if(this.get("pinchZoom")&&i&&(this._movePoints[i]=t.point,Se(this.contents._downPoints).length>1)){this._handlePinch();return}}_handlePinch(){let t=0,e=[],i=[];if(tt(this.contents._downPoints,(s,r)=>{e[t]=r;let a=this._movePoints[s];a&&(i[t]=a),t++}),e.length>1&&i.length>1){this.contents._isDragging=!1;let s=e[0],r=e[1],a=i[0],o=i[1];if(s&&r&&a&&o){s=this.toLocal(s),r=this.toLocal(r),a=this.toLocal(a),o=this.toLocal(o);let n=Math.hypot(r.x-s.x,r.y-s.y),u=Math.hypot(o.x-a.x,o.y-a.y)/n*this._downScale,h={x:a.x+(o.x-a.x)/2,y:a.y+(o.y-a.y)/2},c={x:s.x+(r.x-s.x)/2,y:s.y+(r.y-s.y)/2},l=this._downX||0,m=this._downY||0,_=this._downScale,f=h.x-(-l+c.x)/_*u,p=h.y-(-m+c.y)/_*u;this.contents.setAll({x:f,y:p,scale:u})}}}};Yt.className="ZoomableContainer";Yt.classNames=$.classNames.concat([Yt.className]);var ut=class extends I{_afterNew(){super._afterNewApplyThemes()}getFill(t){return{addColorStop:(e,i)=>{}}}_changed(){super._changed()}getBounds(t){let e=this.get("target");if(e){let i=e.globalBounds(),s=t.toLocal({x:i.left,y:i.top}),r=t.toLocal({x:i.right,y:i.top}),a=t.toLocal({x:i.right,y:i.bottom}),o=t.toLocal({x:i.left,y:i.bottom});return{left:Math.min(s.x,r.x,a.x,o.x),top:Math.min(s.y,r.y,a.y,o.y),right:Math.max(s.x,r.x,a.x,o.x),bottom:Math.max(s.y,r.y,a.y,o.y)}}return t._display.getLocalBounds()}};ut.className="Gradient";ut.classNames=I.classNames.concat([ut.className]);var Wt=class extends ut{getFill(t){let e=this.get("rotation",0),i=this.getBounds(t),s=i.left||0,r=i.right||0,a=i.top||0,o=i.bottom||0,n=J(e),d=K(e),u=n*(r-s),h=d*(o-a);u==0&&(u=1),h==0&&(h=1);let c=Math.max(u,h),l=this._root._renderer.createLinearGradient(s,a,s+c*n,a+c*d),m=this.get("stops");if(m){let _=0;T(m,f=>{let p=f.offset;A(p)||(p=_/(m.length-1));let b=f.opacity;A(b)||(b=1);let x=f.color;if(x){let y=f.lighten;y&&(x=Y.lighten(x,y));let v=f.brighten;v&&(x=Y.brighten(x,v)),l.addColorStop(p,"rgba("+x.r+","+x.g+","+x.b+","+b+")")}_++})}return l}};Wt.className="LinearGradient";Wt.classNames=ut.classNames.concat([Wt.className]);var oe=class extends ${constructor(){super(...arguments),this.labelContainer=this.children.push($.new(this._root,{})),this.markerContainer=this.children.push($.new(this._root,{})),this.startLabel=this.labelContainer.children.push(mt.new(this._root,{themeTags:["start"]})),this.endLabel=this.labelContainer.children.push(mt.new(this._root,{themeTags:["end"]})),this.markers=this.addDisposer(new Ct(Dt.new({}),()=>$t._new(this._root,{themeTags:at(this.markers.template.get("themeTags",[]),[this.get("orientation"),"heatlegend","marker"])},[this.markers.template])))}_afterNew(){this._settings.themeTags=at(this._settings.themeTags,["heatlegend",this._settings.orientation]),super._afterNew(),this.set("tooltip",_t.new(this._root,{themeTags:["heatlegend"]}))}makeMarker(){let t=this.markers.make();return t.states.create("disabled",{}),t}showValue(t,e,i){let s=this.getTooltip();if(s&&A(t)){let r=this.get("startValue",0),a=this.get("endValue",1),o=(t-r)/(a-r);(o==1/0||o==-1/0||isNaN(o))&&(o=.5);let n=this.get("startColor"),d=this.get("endColor");e||(e=this.getNumberFormatter().format(t)),i||(i=Y.interpolate(o,n,d)),s.label.set("text",e);let u;this.get("orientation")=="vertical"?u=this.markerContainer.toGlobal({x:0,y:this.innerHeight()*(1-o)}):u=this.markerContainer.toGlobal({x:this.innerWidth()*o,y:0});let h=s.get("background");h&&h.set("fill",i),s.set("pointTo",u),s.show()}}_prepareChildren(){super._prepareChildren();let t=this.labelContainer,e=this.get("orientation"),i=this.startLabel,s=this.endLabel,r=this.getTooltip();if(this.isDirty("orientation")&&(e=="vertical"?(this.markerContainer.setAll({layout:this._root.verticalLayout,height:W}),this.set("layout",this._root.horizontalLayout),i.setAll({y:W,x:void 0,centerY:W,centerX:W}),s.setAll({y:0,x:void 0,centerY:0,centerX:W}),t.setAll({height:W,width:void 0}),r&&r.set("pointerOrientation","horizontal")):(this.markerContainer.setAll({layout:this._root.horizontalLayout,width:W}),this.set("layout",this._root.verticalLayout),i.setAll({x:0,y:void 0,centerX:0,centerY:0}),s.setAll({x:W,y:void 0,centerX:W,centerY:0}),t.setAll({width:W,height:void 0}),r&&r.set("pointerOrientation","vertical"))),this.isDirty("stepCount")||this.isDirty("startColor")||this.isDirty("endColor")||this.isDirty("startOpacity")||this.isDirty("endOpacity")||this.isDirty("orientation")){let a=this.get("stepCount",1),o=this.get("startColor"),n=this.get("endColor"),d=this.get("startOpacity",1),u=this.get("endOpacity",1);if(this.markerContainer.children.clear(),a>1)for(let h=0;h<a;h++){let c=this.makeMarker();e=="vertical"?this.markerContainer.children.moveValue(c,0):this.markerContainer.children.push(c),o&&n&&c.setAll({fill:Y.interpolate(h/a,o,n),fillOpacity:pt(h/a*100).interpolate(d,u)})}else if(a==1){let h=this.makeMarker();this.markerContainer.children.push(h);let c=Wt.new(this._root,{stops:[{color:o,opacity:d},{color:n,opacity:u}]});if(e=="vertical"){c.set("rotation",90);let l=c.get("stops");l&&l.reverse()}else c.set("rotation",0);o&&n&&h.set("fillGradient",c)}}(this.isDirty("startText")||this.isDirty("startValue"))&&i.set("text",this.get("startText",this.getNumberFormatter().format(this.get("startValue",0)))),(this.isDirty("endText")||this.isDirty("endValue"))&&s.set("text",this.get("endText",this.getNumberFormatter().format(this.get("endValue",1))))}};oe.className="HeatLegend";oe.classNames=$.classNames.concat([oe.className]);var ne=class extends Ze{constructor(){super(...arguments),this.itemContainers=this.addDisposer(new Ct(Dt.new({}),()=>$._new(this._root,{themeTags:at(this.itemContainers.template.get("themeTags",[]),["legend","item"]),themeTagsSelf:at(this.itemContainers.template.get("themeTagsSelf",[]),["itemcontainer"]),background:$t.new(this._root,{themeTags:at(this.itemContainers.template.get("themeTags",[]),["legend","item","background"]),themeTagsSelf:at(this.itemContainers.template.get("themeTagsSelf",[]),["itemcontainer"])})},[this.itemContainers.template]))),this.markers=this.addDisposer(new Ct(Dt.new({}),()=>$._new(this._root,{themeTags:at(this.markers.template.get("themeTags",[]),["legend","marker"])},[this.markers.template]))),this.labels=this.addDisposer(new Ct(Dt.new({}),()=>mt._new(this._root,{themeTags:at(this.labels.template.get("themeTags",[]),["legend","label"])},[this.labels.template]))),this.valueLabels=this.addDisposer(new Ct(Dt.new({}),()=>mt._new(this._root,{themeTags:at(this.valueLabels.template.get("themeTags",[]),["legend","label","value"])},[this.valueLabels.template]))),this.markerRectangles=this.addDisposer(new Ct(Dt.new({}),()=>$t._new(this._root,{themeTags:at(this.markerRectangles.template.get("themeTags",[]),["legend","marker","rectangle"])},[this.markerRectangles.template])))}_afterNew(){this._settings.themeTags=at(this._settings.themeTags,["legend"]),this.fields.push("name","stroke","fill"),super._afterNew()}makeItemContainer(t){let e=this.children.push(this.itemContainers.make());return e._setDataItem(t),this.itemContainers.push(e),e.states.create("disabled",{}),e}makeMarker(){let t=this.markers.make();return this.markers.push(t),t.states.create("disabled",{}),t}makeLabel(){let t=this.labels.make();return t.states.create("disabled",{}),t}makeValueLabel(){let t=this.valueLabels.make();return t.states.create("disabled",{}),t}makeMarkerRectangle(){let t=this.markerRectangles.make();return t.states.create("disabled",{}),t}processDataItem(t){super.processDataItem(t);let e=this.makeItemContainer(t),i=this.get("nameField"),s=this.get("fillField"),r=this.get("strokeField");if(e){let a=this.get("clickTarget","itemContainer"),o=t.dataContext;o&&o.set&&o.set("legendDataItem",t),e._setDataItem(t),t.set("itemContainer",e);let n=this.makeMarker();if(n){e.children.push(n),n._setDataItem(t),t.set("marker",n);let h=this.get("useDefaultMarker"),c=n.children.push(this.makeMarkerRectangle()),l=t.get("fill"),m=t.get("stroke");t.set("markerRectangle",c),o&&o.get&&(l=o.get(s,l),m=o.get(r,m)),m||(m=l),h?o.on&&(o.on(s,()=>{c.set("fill",o.get(s))}),o.on(r,()=>{c.set("stroke",o.get(r))})):o&&o.createLegendMarker&&o.createLegendMarker(),c.setAll({fill:l,stroke:m});let _=o.component;_&&_.updateLegendMarker&&_.updateLegendMarker(o)}let d=this.makeLabel();if(d){e.children.push(d),d._setDataItem(t),t.set("label",d),d.text.on("text",()=>{e.setRaw("ariaLabel",d.text._getText()+(this.get("clickTarget")!=="none"?"; "+this._t("Press ENTER to toggle"):"")),e.markDirtyAccessibility()}),o&&o.get&&t.set("name",o.get(i));let h=t.get("name");h&&d.set("text",h)}let u=this.makeValueLabel();if(u&&(e.children.push(u),u._setDataItem(t),t.set("valueLabel",u)),o&&o.show&&(o.on("visible",h=>{e.set("disabled",!h)}),o.get("visible")||e.set("disabled",!0),a!="none")){let h=e;a=="marker"&&(h=n),this._addClickEvents(h,o,t)}this.children.values.sort((h,c)=>{let l=h.dataItem?h.dataItem.dataContext:void 0,m=c.dataItem?c.dataItem.dataContext:void 0;if(l&&m){let _=this.data.indexOf(l),f=this.data.indexOf(m);if(_>f)return 1;if(_<f)return-1}return 0}),o&&o.updateLegendValue&&o.updateLegendValue()}}_addClickEvents(t,e,i){t.set("cursorOverStyle","pointer"),t.events.on("pointerover",()=>{let s=e.component;s&&s.hoverDataItem&&s.hoverDataItem(e)}),t.events.on("pointerout",()=>{let s=e.component;s&&s.hoverDataItem&&s.unhoverDataItem(e)}),t.events.on("click",()=>{let s=i.get("label").text._getText();e.show&&e.isHidden&&(e.isHidden()||e.get("visible")===!1)?(e.show(),t.set("disabled",!1),this._root.readerAlert(this._t("%1 shown",this._root.locale,s))):e.hide&&(e.hide(),t.set("disabled",!0),this._root.readerAlert(this._t("%1 hidden",this._root.locale,s)))})}disposeDataItem(t){super.disposeDataItem(t);let e=t.dataContext;e&&e.get&&e.get("legendDataItem")==t&&e.set("legendDataItem",void 0);let i=t.get("itemContainer");i&&(this.itemContainers.removeValue(i),i.dispose());let s=t.get("marker");s&&(this.markers.removeValue(s),s.dispose());let r=t.get("markerRectangle");r&&(this.markerRectangles.removeValue(r),r.dispose());let a=t.get("label");a&&(this.labels.removeValue(a),a.dispose());let o=t.get("valueLabel");o&&(this.valueLabels.removeValue(o),o.dispose())}};ne.className="Legend";ne.classNames=Ze.classNames.concat([ne.className]);var ft=class extends z{_beforeChanged(){super._beforeChanged(),(this.isDirty("width")||this.isDirty("height")||this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&(this._clear=!0)}_changed(){super._changed(),this._clear&&!this.get("draw")&&this._draw()}_draw(){let t=this.width(),e=this.height(),i=this._display;i.moveTo(-t/2,e/2),i.lineTo(0,-e/2),i.lineTo(t/2,e/2),i.lineTo(-t/2,e/2),i.closePath()}_updateSize(){this.markDirty(),this._clear=!0}};ft.className="Triangle";ft.classNames=z.classNames.concat([ft.className]);var kt=class g extends z{_beforeChanged(){super._beforeChanged(),this.isDirty("points")&&(this._clear=!0)}static makeOrthogonal(t){if(t.length>1){let e=[];for(let i=0;i<t.length-1;i++){let s=t[i],r=t[i+1];e.push(s),s.x!==r.x&&s.y!==r.y&&e.push({x:r.x,y:s.y})}e.push(t[t.length-1]),t=e}return t}_changed(){if(super._changed(),this._clear){let t=this._display,e=this.get("points",[]);if(e.length===0)return;e=g.makeOrthogonal(e),t.moveTo(e[0].x,e[0].y);for(let i=1;i<e.length;i++){let s=this.get("cornerRadius",0),r=e[i-1],a=e[i],o=e[i+1],n=a.y===r.y&&a.x!==r.x,d=a.x===r.x&&a.y!==r.y,u=o&&(n&&o.y!==a.y||d&&o.x!==a.x);if(s>0&&o&&u){if(d){s=Math.min(s,Math.abs(a.x-o.x)/2,Math.abs(a.y-r.y)/2);let h=Math.sign(a.y-r.y);t.lineTo(a.x,a.y-s*h);let c=o.x<a.x?-1:1;t.arcTo(a.x,a.y,a.x+s*c,a.y,s)}else if(n){s=Math.min(s,Math.abs(a.y-o.y)/2,Math.abs(a.x-r.x)/2);let h=Math.sign(a.x-r.x);t.lineTo(a.x-s*h,a.y);let c=o.y<a.y?-1:1;t.arcTo(a.x,a.y,a.x,a.y+s*c,s)}}else t.lineTo(a.x,a.y)}}}};kt.className="OrthogonalLine";kt.classNames=z.classNames.concat([kt.className]);var he=class extends ${constructor(){super(...arguments),this.line=this.children.push(kt.new(this._root,{themeTags:["line"]})),this.hitLine=this.children.push(kt.new(this._root,{themeTags:["hit"]})),this.startArrow=this.children.push(ft.new(this._root,{themeTags:["start","arrow"]})),this.endArrow=this.children.push(ft.new(this._root,{themeTags:["end","arrow"]}))}_afterNew(){this.addTag("link"),super._afterNew()}_updateChildren(){if(super._updateChildren(),this.isDirty("points")){let t=kt.makeOrthogonal(this.get("points",[]));this.line.set("points",t),this.hitLine.set("points",t);let e=this.startArrow,i=this.endArrow,s=t.length;if(s>1){let[r,a]=t;e.setAll({x:r.x,y:r.y,rotation:Be(r,a)-90});let o=t[s-1],n=t[s-2];i.setAll({x:o.x,y:o.y,rotation:Be(n,o)+90})}else if(s===1){let[r]=t;e.setAll({x:r.x,y:r.y,rotation:0}),i.setAll({x:r.x,y:r.y,rotation:0})}}}};he.className="Link";he.classNames=$.classNames.concat([he.className]);var le=class extends qe{constructor(){super(...arguments),this._display=this._root._renderer.makePicture(void 0)}_changed(){if(super._changed(),this.isDirty("width")){let t=this.get("width");this._display.width=A(t)?t:void 0}if(this.isDirty("height")){let t=this.get("height");this._display.height=A(t)?t:void 0}if(this.isDirty("shadowColor")){this._display.clear();let t=this.get("shadowColor");this._display.shadowColor=t??void 0}this.isDirty("shadowBlur")&&(this._display.clear(),this._display.shadowBlur=this.get("shadowBlur")),this.isDirty("shadowOffsetX")&&(this._display.clear(),this._display.shadowOffsetX=this.get("shadowOffsetX")),this.isDirty("shadowOffsetY")&&(this._display.clear(),this._display.shadowOffsetY=this.get("shadowOffsetY")),this.isDirty("shadowOpacity")&&(this._display.clear(),this._display.shadowOpacity=this.get("shadowOpacity")),(this.isDirty("src")||this.isDirty("cors"))&&(this._display.clear(),this._load())}_load(){let t=this.get("src");if(t){let e=new Image;e.crossOrigin=this.get("cors","anonymous"),e.src=t;let i=this.events;e.decode().then(()=>{this._display.image=e,this._updateSize(),!i.isDisposed()&&i.isEnabled("loaded")&&i.dispatch("loaded",{type:"loaded",target:this})}).catch(s=>{!i.isDisposed()&&i.isEnabled("loaderror")&&i.dispatch("loaderror",{type:"loaderror",target:this})})}}_updateSize(){super._updateSize();let t=this._display.image;if(t){let e=this.getPrivate("width",this.get("width")),i=this.getPrivate("height",this.get("height")),s=t.width&&t.height?t.width/t.height:0;A(e)&&A(i)?(this._display.width=e,this._display.height=i):A(e)&&s?i=e/s:A(i)&&s?e=i*s:(e=t.width,i=t.height),A(e)&&(this._display.width=e),A(i)&&(this._display.height=i),this.markDirtyBounds(),this.markDirty()}}};le.className="Picture";le.classNames=qe.classNames.concat([le.className]);var ce=class extends Ke{_afterNew(){this._addOrientationClass(),super._afterNew(),this.endGrip.setPrivate("visible",!1),this.thumb.setPrivate("visible",!1)}updateGrips(){super.updateGrips();let t=this.startGrip;this.endGrip.setAll({x:t.x(),y:t.y()}),this.setRaw("end",this.get("start"))}};ce.className="Slider";ce.classNames=Ke.classNames.concat([ce.className]);var de=class extends ${constructor(){super(...arguments),this.homeButton=this.children.push(Ft.new(this._root,{width:35,height:35,themeTags:["home"]})),this.plusButton=this.children.push(Ft.new(this._root,{width:35,height:35,themeTags:["plus"]})),this.minusButton=this.children.push(Ft.new(this._root,{width:35,height:35,themeTags:["minus"]}))}_afterNew(){super._afterNew(),this.set("position","absolute"),this.set("layout",this._root.verticalLayout),this.addTag("zoomtools"),this.plusButton.setAll({icon:z.new(this._root,{themeTags:["icon"]}),layout:void 0}),this.minusButton.setAll({icon:z.new(this._root,{themeTags:["icon"]}),layout:void 0}),this.homeButton.setAll({icon:z.new(this._root,{themeTags:["icon"]}),layout:void 0})}_prepareChildren(){if(super._prepareChildren(),this.isDirty("target")){let t=this.get("target"),e=this._prevSettings.target;t&&(t instanceof Yt&&(this._targetDisposer=this.addDisposer(t.contents.on("scale",i=>{i==t.get("minZoomLevel")?this.minusButton.set("disabled",!0):this.minusButton.set("disabled",!1),i==t.get("maxZoomLevel")?this.plusButton.set("disabled",!0):this.plusButton.set("disabled",!1)})),this.root.events.once("frameended",()=>{t.get("scale")==t.get("minZoomLevel")&&this.minusButton.set("disabled",!0)})),this._disposer=new xt([this.plusButton.events.on("click",()=>{t.zoomIn()}),this.minusButton.events.on("click",()=>{t.zoomOut()}),this.homeButton.events.on("click",()=>{t.goHome()})])),e&&(this._disposer&&this._disposer.dispose(),this._targetDisposer&&this._targetDisposer.dispose())}}};de.className="ZoomTools";de.classNames=$.classNames.concat([de.className]);var ue=class extends X{constructor(){super(...arguments),this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this._clearGrain=!1}_beforeChanged(){let t=this.get("width",200),e=this.get("height",200);this.canvas.width!==t&&(this.canvas.width=t),this.canvas.height!==e&&(this.canvas.height=e),(this.isDirty("size")||this.isDirty("density")||this.isDirty("minOpacity")||this.isDirty("maxOpacity")||this.isDirty("colors")||this.isDirty("horizontalGap")||this.isDirty("verticalGap"))&&(this._clearGrain=!0),super._beforeChanged()}_changed(){if(super._changed(),this._clearGrain){let t=this.get("width",200),e=this.get("height",200),i=this.context.createImageData(t,e),s=Math.max(1,this.get("size",1)),r=this.get("minOpacity",0),a=this.get("maxOpacity",.3),o=this.get("colors",[this.get("color",Y.fromHex(0))]),n=t/s,d=e/s,u=this.get("density",1),h=this.get("horizontalGap",0)+1,c=this.get("verticalGap",0)+1,l=o.length,m=a-r,_=new Array(l),f=new Array(l),p=new Array(l);for(let k=0;k<l;k++)_[k]=o[k].r,f[k]=o[k].g,p[k]=o[k].b;let b=new Uint32Array(i.data.buffer),x=u>=1,y=h>1?h:0,v=c>1?c:0;for(let k=0;k<d;k++)if(!(v&&k%v!==0)){for(let w=0;w<n;w++)if(!(y&&w%y!==0)&&(x||Math.random()<u)){let C=l>1?Math.random()*l|0:0,P=(r+Math.random()*m)*255|0,S=(_[C]|f[C]<<8|p[C]<<16|P<<24)>>>0;s===1?b[k*t+w]=S:this._setRectData(w,k,s,t,b,S)}}this.context.putImageData(i,0,0),this._pattern=this.context.createPattern(this.canvas,"repeat")}this._clearGrain=!1}_checkDirtyFill(){return!1}_setRectData(t,e,i,s,r,a){let o=t*i,n=e*i,d=o+i,u=n+i;for(var h=n;h<u;h++){let l=h*s+o;for(var c=o;c<d;c++)r[l]=a,l++}}};ue.className="GrainPattern";ue.classNames=X.classNames.concat([ue.className]);var fe=class extends ut{getFill(t){let e=this.getBounds(t),i=0,s=0,r=e.left||0,a=e.right||0,o=e.top||0,n=e.bottom||0,d=a-r,u=n-o,h=t.get("radius");A(h)?(i=0,s=0):(h=Math.min(d,u)/2,i=d/2,s=u/2);let c=this.get("x"),l=this.get("y");c!=null&&(i=vt(c,d)),l!=null&&(s=vt(l,u));let m=this._root._renderer.createRadialGradient(i,s,0,i,s,h),_=this.get("stops");if(_){let f=0;T(_,p=>{let b=p.offset;A(b)||(b=f/(_.length-1));let x=p.opacity;A(x)||(x=1);let y=p.color;if(y){let v=p.lighten;v&&(y=Y.lighten(y,v));let k=p.brighten;k&&(y=Y.brighten(y,k)),m.addColorStop(b,"rgba("+y.r+","+y.g+","+y.b+","+x+")")}f++})}return m}};fe.className="RadialGradient";fe.classNames=ut.classNames.concat([fe.className]);var Gt=class extends X{_beforeChanged(){super._beforeChanged(),(this.isDirty("gap")||this.isDirty("radius")||this.isDirty("checkered"))&&(this._clear=!0),this._optimizeTileSize()}_optimizeTileSize(){let t=this.get("repetition");if(t&&t!=="repeat"||this.get("rotation",0)!==0)return;let e=this.get("gap",0),i=this.get("radius",3)*2+e;if(i<=0)return;let s=this.get("checkered",!1)?2:1,r=Math.max(1,Math.round(i*s));this.get("width",100)!==r&&this.setRaw("width",r),this.get("height",100)!==r&&this.setRaw("height",r)}_draw(){super._draw();let t=this.get("checkered",!1),e=this.get("centered",!0),i=this.get("gap",0),s=this.get("rotation",0),r=this.get("width",100),a=this.get("height",100),o=this.get("radius",3),n=o*2+i,d=o*2+i,u=Math.round(r/n),h=Math.round(a/d);n=r/u,d=a/h,s!=0&&(this._display.x=n*J(s),this._display.y=d*K(s));let c=-2,l=u+2,m=-2,_=h+2;if(s!=0){let b=J(s),x=K(s),y=this._display.x,v=this._display.y,k=1/0,w=-1/0,C=1/0,P=-1/0,S=[[0,0],[r,0],[0,a],[r,a]];for(let M=0;M<S.length;M++){let D=S[M][0]-y,E=S[M][1]-v,F=b*D+x*E,B=-x*D+b*E;F<k&&(k=F),F>w&&(w=F),B<C&&(C=B),B>P&&(P=B)}c=Math.floor(k/n)-2,l=Math.ceil(w/n)+2,m=Math.floor(C/d)-2,_=Math.ceil(P/d)+2}let f=this.get("color"),p=this.get("colorOpacity");(f||p)&&this._display.beginFill(f,p);for(let b=m;b<_;b++)for(let x=c;x<l;x++)if(!t||(b&1)!=1&&(x&1)!=1||(b&1)==1&&(x&1)==1){let y=x*n,v=b*d;e&&(y+=n+i/2,v+=d+i/2),this._display.drawCircle(y-o,v-o,o)}(f||p)&&this._display.endFill()}};Gt.className="CirclePattern";Gt.classNames=X.classNames.concat([Gt.className]);var Vt=class extends X{_beforeChanged(){super._beforeChanged(),(this.isDirty("gap")||this.isDirty("angle"))&&(this._clear=!0),this._optimizeTileSize()}_optimizeTileSize(){let t=this.get("repetition");if(t&&t!=="repeat"||this.get("rotation"))return;let e=this.get("gap",0);if(!e)return;let i=e+this.get("strokeWidth",1),s=this.get("angle",0)*Math.PI/180,r=Math.abs(Math.sin(s)),a=Math.abs(Math.cos(s)),o=4,n=Math.max(1,Math.ceil((r>1e-6?i/r:1)*o)),d=Math.max(1,Math.ceil((a>1e-6?i/a:1)*o));this.get("width",100)>n&&this.setRaw("width",n),this.get("height",100)>d&&this.setRaw("height",d)}_draw(){super._draw();let t=this.get("width",100),e=this.get("height",100),i=this.get("gap",0),s=this.get("strokeWidth",1);if(!i)this._display.moveTo(0,0),this._display.lineTo(t,0);else{let o=i+s,n=e/o,d=this.get("angle",0)*Math.PI/180;if(d===0)for(let u=-n;u<n*2;u++){let h=Math.round(u*o-o/2)+.5;this._display.moveTo(-t,h),this._display.lineTo(t*2,h)}else{let u=Math.cos(d),h=Math.sin(d),c=Math.max(Math.abs(t*h),Math.abs(e*u));c>1e-6&&(o=c/Math.max(1,Math.round(c/o)));let l=Math.sqrt(t*t+e*e)*2,m=o/Math.max(Math.abs(u),Math.abs(h)),_=Math.ceil(l/m)*2;for(let f=-_;f<_;f++){let p=f*o,b=p*h-l*u,x=p*u+l*h,y=p*h+l*u,v=p*u-l*h;this._display.moveTo(b,x),this._display.lineTo(y,v)}}}this._display.lineStyle(s,this.get("color"),this.get("colorOpacity"));let r=this.get("strokeDasharray");A(r)&&(r<.5?r=[0]:r=[r]),this._display.setLineDash(r);let a=this.get("strokeDashoffset");a&&this._display.setLineDashOffset(a),this._display.endStroke()}};Vt.className="LinePattern";Vt.classNames=X.classNames.concat([Vt.className]);var Xt=class extends X{_beforeChanged(){super._beforeChanged(),(this.isDirty("gap")||this.isDirty("rotateShapes")||this.isDirty("maxWidth")||this.isDirty("maxHeight")||this.isDirty("checkered"))&&(this._clear=!0),this._optimizeTileSize()}_optimizeTileSize(){let t=this.get("repetition");if(t&&t!=="repeat"||this.get("rotation",0)!==0&&!this.get("rotateShapes",!1))return;let e=this.get("gap",0),i=this.get("maxWidth",5)+e,s=this.get("maxHeight",5)+e;if(i<=0||s<=0)return;let r=this.get("checkered",!1)?2:1,a=Math.max(1,Math.round(i*r)),o=Math.max(1,Math.round(s*r));this.get("width",100)!==a&&this.setRaw("width",a),this.get("height",100)!==o&&this.setRaw("height",o)}_draw(){super._draw();let t=this.get("checkered",!1),e=this.get("centered",!0),i=this.get("gap",0),s=this.get("rotation",0),r=this.get("rotateShapes",!1),a=this.get("width",100),o=this.get("height",100),n=this.get("maxWidth",5),d=this.get("maxHeight",5),u=this._display,h=n+i,c=d+i,l=Math.round(a/h),m=Math.round(o/c);h=a/l,c=o/m;let _=r?0:s,f=r?s:0;u.angle=_,_!=0?(u.x=h/2*J(_),u.y=-c/2*K(_)):(u.x=0,u.y=0);let p=0,b=l,x=0,y=m;if(f!=0)p=-1,b=l+1,x=-1,y=m+1;else if(_!=0){let B=J(_),U=K(_),L=u.x,O=u.y,R=1/0,H=-1/0,it=1/0,G=-1/0,V=[[0,0],[a,0],[0,o],[a,o]];for(let st=0;st<V.length;st++){let ve=V[st][0]-L,We=V[st][1]-O,Ge=B*ve+U*We,Ve=-U*ve+B*We;Ge<R&&(R=Ge),Ge>H&&(H=Ge),Ve<it&&(it=Ve),Ve>G&&(G=Ve)}p=Math.floor(R/h)-2,b=Math.ceil(H/h)+2,x=Math.floor(it/c)-2,y=Math.ceil(G/c)+2}let v=J(f),k=K(f),w=n/2,C=d/2,P=w*v,S=w*k,M=C*v,D=C*k;for(let B=x;B<y;B++)for(let U=p;U<b;U++)if(!t||(B&1)!=1&&(U&1)!=1||(B&1)==1&&(U&1)==1){let L=U*h,O=B*c;if(e&&(L+=(h-n)/2,O+=(c-d)/2),f!=0){let R=L+w,H=O+C;u.moveTo(R-P+D,H-S-M),u.lineTo(R+P+D,H+S-M),u.lineTo(R+P-D,H+S+M),u.lineTo(R-P-D,H-S+M),u.closePath()}else u.drawRect(L,O,n,d)}let E=this.get("color"),F=this.get("colorOpacity");(E||F)&&(u.beginFill(E,F),u.endFill())}};Xt.className="RectanglePattern";Xt.classNames=X.classNames.concat([Xt.className]);var pe=class extends X{_beforeChanged(){super._beforeChanged(),(this.isDirty("gap")||this.isDirty("radius")||this.isDirty("innerRadius")||this.isDirty("spikes")||this.isDirty("checkered")||this.isDirty("rotateShapes"))&&(this._clear=!0),this._optimizeTileSize()}_optimizeTileSize(){let t=this.get("repetition");if(t&&t!=="repeat"||this.get("rotation",0)!==0&&!this.get("rotateShapes",!1))return;let e=this.get("gap",0),i=this.get("radius",5)*2+e;if(i<=0)return;let s=this.get("checkered",!1)?2:1,r=Math.max(1,Math.round(i*s));this.get("width",100)!==r&&this.setRaw("width",r),this.get("height",100)!==r&&this.setRaw("height",r)}_draw(){super._draw();let t=this.get("checkered",!1),e=this.get("centered",!0),i=this.get("gap",0),s=this.get("rotation",0),r=this.get("rotateShapes",!1),a=this.get("width",100),o=this.get("height",100),n=this.get("radius",5),d=vt(this.get("innerRadius",pt(50)),n),u=this.get("spikes",5),h=this._display,c=n*2+i,l=n*2+i,m=Math.round(a/c),_=Math.round(o/l);c=a/m,l=o/_;let f=r?0:s,p=r?s:0;h.angle=f,f!=0?(h.x=c/2*J(f),h.y=-l/2*K(f)):(h.x=0,h.y=0);let b=0,x=m,y=0,v=_;if(p!=0)b=-1,x=m+1,y=-1,v=_+1;else if(f!=0){let S=J(f),M=K(f),D=h.x,E=h.y,F=1/0,B=-1/0,U=1/0,L=-1/0,O=[[0,0],[a,0],[0,o],[a,o]];for(let R=0;R<O.length;R++){let H=O[R][0]-D,it=O[R][1]-E,G=S*H+M*it,V=-M*H+S*it;G<F&&(F=G),G>B&&(B=G),V<U&&(U=V),V>L&&(L=V)}b=Math.floor(F/c)-2,x=Math.ceil(B/c)+2,y=Math.floor(U/l)-2,v=Math.ceil(L/l)+2}let k=J(p),w=K(p);for(let S=y;S<v;S++)for(let M=b;M<x;M++)if(!t||(S&1)!=1&&(M&1)!=1||(S&1)==1&&(M&1)==1){let D=M*c,E=S*l;e?(D+=c/2,E+=l/2):(D+=n,E+=n),this._drawStar(D,E,n,d,u,k,w)}let C=this.get("color"),P=this.get("colorOpacity");(C||P)&&(h.beginFill(C,P),h.endFill())}_drawStar(t,e,i,s,r,a,o){let n=this._display,d=Math.PI/r,u=Math.PI/2*3,h=0,c=-i;n.moveTo(t+h*a-c*o,e+h*o+c*a);for(let l=0;l<r;l++)h=Math.cos(u)*i,c=Math.sin(u)*i,n.lineTo(t+h*a-c*o,e+h*o+c*a),u+=d,h=Math.cos(u)*s,c=Math.sin(u)*s,n.lineTo(t+h*a-c*o,e+h*o+c*a),u+=d;h=0,c=-i,n.lineTo(t+h*a-c*o,e+h*o+c*a),n.closePath()}};pe.className="StarPattern";pe.classNames=X.classNames.concat([pe.className]);var me=class extends X{_beforeChanged(){super._beforeChanged(),(this.isDirty("gap")||this.isDirty("maxWidth")||this.isDirty("maxHeight")||this.isDirty("checkered")||this.isDirty("rotateShapes"))&&(this._clear=!0),this._optimizeTileSize()}_optimizeTileSize(){let t=this.get("repetition");if(t&&t!=="repeat"||this.get("rotation",0)!==0&&!this.get("rotateShapes",!1))return;let e=this.get("gap",0),i=this.get("maxWidth",8)+e,s=this.get("maxHeight",8)+e;if(i<=0||s<=0)return;let r=this.get("checkered",!1)?2:1,a=Math.max(1,Math.round(i*r)),o=Math.max(1,Math.round(s*r));this.get("width",100)!==a&&this.setRaw("width",a),this.get("height",100)!==o&&this.setRaw("height",o)}_draw(){super._draw();let t=this.get("checkered",!1),e=this.get("centered",!0),i=this.get("gap",0),s=this.get("rotation",0),r=this.get("rotateShapes",!1),a=this.get("width",100),o=this.get("height",100),n=this.get("maxWidth",8),d=this.get("maxHeight",8),u=this._display,h=n+i,c=d+i,l=Math.round(a/h),m=Math.round(o/c);h=a/l,c=o/m;let _=r?0:s,f=r?s:0;u.angle=_,_!=0?(u.x=h/2*J(_),u.y=-c/2*K(_)):(u.x=0,u.y=0);let p=0,b=l,x=0,y=m;if(f!=0)p=-1,b=l+1,x=-1,y=m+1;else if(_!=0){let M=J(_),D=K(_),E=u.x,F=u.y,B=1/0,U=-1/0,L=1/0,O=-1/0,R=[[0,0],[a,0],[0,o],[a,o]];for(let H=0;H<R.length;H++){let it=R[H][0]-E,G=R[H][1]-F,V=M*it+D*G,st=-D*it+M*G;V<B&&(B=V),V>U&&(U=V),st<L&&(L=st),st>O&&(O=st)}p=Math.floor(B/h)-2,b=Math.ceil(U/h)+2,x=Math.floor(L/c)-2,y=Math.ceil(O/c)+2}let v=J(f),k=K(f),w=n/2,C=d/2;for(let M=x;M<y;M++)for(let D=p;D<b;D++)if(!t||(M&1)!=1&&(D&1)!=1||(M&1)==1&&(D&1)==1){let E=D*h,F=M*c;e?(E+=h/2,F+=c/2):(E+=w,F+=C),this._point(E,F,-w,C,v,k,!0),this._point(E,F,0,-C,v,k,!1),this._point(E,F,w,C,v,k,!1),u.closePath()}let P=this.get("color"),S=this.get("colorOpacity");(P||S)&&(u.beginFill(P,S),u.endFill())}_point(t,e,i,s,r,a,o){let n=t+i*r-s*a,d=e+i*a+s*r;o?this._display.moveTo(n,d):this._display.lineTo(n,d)}};me.className="TrianglePattern";me.classNames=X.classNames.concat([me.className]);var ge=class extends X{constructor(){super(...arguments),this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this._clearPath=!1,this._bbox={x:0,y:0,w:1,h:1}}_beforeChanged(){this._optimizeTileSize(),super._beforeChanged();let t=this.get("width",100),e=this.get("height",100);this.canvas.width!==t&&(this.canvas.width=t),this.canvas.height!==e&&(this.canvas.height=e),(this._clear||this.isDirty("svgPath")||this.isDirty("gap")||this.isDirty("maxWidth")||this.isDirty("maxHeight")||this.isDirty("checkered")||this.isDirty("centered"))&&(this._clearPath=!0)}_optimizeTileSize(){let t=this.get("repetition");if(t&&t!=="repeat")return;let e=this.get("gap",0),i=this.get("maxWidth",10)+e,s=this.get("maxHeight",10)+e;if(i<=0||s<=0)return;let r=this.get("checkered",!1)?2:1,a=Math.max(1,Math.round(i*r)),o=Math.max(1,Math.round(s*r));this.get("width",100)!==a&&this.setRaw("width",a),this.get("height",100)!==o&&this.setRaw("height",o)}_changed(){if(super._changed(),this._clearPath){let t=this.get("svgPath");t!=null&&this._renderPattern(t)}this._clearPath=!1}_renderPattern(t){t!==this._bboxPath&&(this._bbox=this._getPathBounds(t),this._bboxPath=t);let e=this.get("width",100),i=this.get("height",100),s=this.get("gap",0),r=this.get("maxWidth",10),a=this.get("maxHeight",10),o=this.get("checkered",!1),n=this.get("centered",!0),d=this.get("rotation",0)*Math.PI/180,u=this.context;u.setTransform(1,0,0,1,0,0),u.clearRect(0,0,e,i);let h=this.get("fill"),c=this.get("fillOpacity",1);h&&c>0&&(u.fillStyle=h.toCSS(c),u.fillRect(0,0,e,i));let l=this.get("color");u.fillStyle=l?l.toCSS(this.get("colorOpacity",1)):"#000000";let m=new Path2D(t),_=this._bbox,f=Math.min(r/_.w,a/_.h),p=_.x+_.w/2,b=_.y+_.h/2,x=r+s,y=a+s,v=Math.max(1,Math.round(e/x)),k=Math.max(1,Math.round(i/y));x=e/v,y=i/k;for(let w=-1;w<=k;w++)for(let C=-1;C<=v;C++){if(o&&(w&1)!==(C&1))continue;let P=n?C*x+x/2:C*x+s/2+r/2,S=n?w*y+y/2:w*y+s/2+a/2;u.save(),u.translate(P,S),d!==0&&u.rotate(d),u.scale(f,f),u.translate(-p,-b),u.fill(m),u.restore()}this._pattern=u.createPattern(this.canvas,this.get("repetition","repeat"))}_getPathBounds(t){let e="http://www.w3.org/2000/svg",i=document.createElementNS(e,"svg");i.style.cssText="position:absolute;left:-10000px;top:-10000px;width:0;height:0;overflow:hidden;";let s=document.createElementNS(e,"path");s.setAttribute("d",t),i.appendChild(s),document.body.appendChild(i);let r=0,a=0,o=1,n=1;try{let d=s.getBBox();r=d.x,a=d.y,o=d.width||1,n=d.height||1}catch{}return document.body.removeChild(i),{x:r,y:a,w:o,h:n}}};ge.className="PathPattern";ge.classNames=X.classNames.concat([ge.className]);var _e=class extends I{_afterNew(){if(super._afterNewApplyThemes(),this.get("patterns",[]).length===0){let t=this.get("color",this.root.interfaceColors.get("stroke"));this.set("patterns",[this.getLinePattern({width:1e3,height:1e3,angle:45,strokeWidth:1,color:t}),this.getRectanglePattern({width:10,height:10,rotation:0,maxWidth:4,maxHeight:4,color:t}),this.getLinePattern({width:1e3,height:1e3,angle:-45,strokeWidth:1,gap:6,color:t}),this.getCirclePattern({width:11,height:11,radius:2,color:t}),this.getLinePattern({width:6,height:6,angle:90,strokeWidth:1,color:t}),this.getRectanglePattern({width:14,height:14,rotation:45,rotateShapes:!0,gap:4,maxWidth:6,maxHeight:6,checkered:!0,color:t}),this.getLinePattern({width:6,height:6,angle:0,strokeWidth:1,color:t}),this.getRectanglePattern({width:15,height:15,rotation:0,gap:5,maxWidth:5,maxHeight:5,checkered:!0,color:t}),this.getLinePattern({width:1e3,height:1e3,angle:45,strokeWidth:2,gap:3,strokeDasharray:[4,2],color:t}),this.getCirclePattern({width:20,height:20,radius:3,gap:4,checkered:!0,color:t}),this.getLinePattern({width:1e3,height:1e3,angle:-45,strokeWidth:2,gap:3,strokeDasharray:[4,2],color:t}),this.getRectanglePattern({width:10,height:10,rotation:0,gap:1,maxWidth:9,maxHeight:9,color:t}),this.getLinePattern({width:1e3,height:1e3,angle:-45,strokeWidth:2,gap:1,color:t}),this.getLinePattern({width:1e3,height:1e3,angle:45,strokeWidth:2,gap:1,color:t}),this.getLinePattern({width:1e3,height:1e3,angle:0,strokeWidth:3,gap:1,color:t}),this.getLinePattern({width:1e3,height:1e3,angle:90,strokeWidth:3,gap:1,color:t})])}this._dirty.patterns=!1}_beforeChanged(){this.isDirty("patterns")&&this.reset()}getIndex(t){let e=this.get("patterns",[]);if(t<e.length&&e[t]!==null)return e[t];if(t>e.length-1){let i=t-Math.floor(t*(t/e.length));return e[i]}return e[t]}next(){let t=this.getPrivate("currentStep",this.get("startIndex",0));return this.setPrivate("currentStep",t+this.get("step",1)),this.getIndex(t)}reset(){this.setPrivate("currentStep",this.get("startIndex",0))}getLinePattern(t){return Vt.new(this.root,t)}getRectanglePattern(t){return Xt.new(this.root,t)}getCirclePattern(t){return Gt.new(this.root,t)}};_e.className="PatternSet";_e.classNames=I.classNames.concat([_e.className]);var Ji=class{static parse(t,e){e=this._applyDefaults(e);try{if(Tt(t)){let i=JSON.parse(t);return e.reverse&&we(i)&&i.reverse(),i}else{if(we(t)||Lt(t))return t;throw"Unable to parse JSON data"}}catch{return}}static _applyDefaults(t){let e={},i={reverse:!1};return t||(t={}),tt(i,(s,r)=>{e[s]=t[s]||r}),e}},Qi=class{static parse(t,e){e=this._applyDefaults(e);let i=this.CSVToArray(t,e.delimiter),s=[],r=[],a,o;for(o=0;o<e.skipRows;o++)i.shift();if(e.useColumnNames){r=i.shift();for(let d=0;d<r.length;d++)a=r[d]!=null?r[d].replace(/^\s+|\s+$/gm,""):"",a===""&&(a="col"+d),r[d]=a}let n;for(;n=e.reverse?i.pop():i.shift(),!!n;){if(e.skipEmpty&&n.length===1&&n[0]==="")continue;let d={};for(o=0;o<n.length;o++)a=r[o]===void 0?"col"+o:r[o],d[a]=n[o];s.push(d)}return s}static CSVToArray(t,e){e=e||",";let i=new RegExp("(\\"+e+'|\\r?\\n|\\r|^)(?:"([^"]*(?:""[^"]*)*)"|([^"\\'+e+"\\r\\n]*))","gi"),s=[[]],r=null;for(;r=i.exec(t),!!r;){let a=r[1];a.length&&a!==e&&s.push([]);let o;r[2]?o=r[2].replace(new RegExp('""',"g"),'"'):o=r[3],s[s.length-1].push(o)}return s}static _applyDefaults(t){let e={},i={delimiter:",",reverse:!1,skipRows:0,skipEmpty:!0,useColumnNames:!1};return t||(t={}),tt(i,(s,r)=>{e[s]=t[s]||r}),e}};var ts=class extends I{constructor(){super(...arguments),this._checkDates=!1,this._checkNumbers=!1,this._checkColors=!1,this._checkEmpty=!1,this._checkDeep=!1}_afterNew(){super._afterNew(),this._checkFeatures(),this.on("dateFields",()=>this._checkFeatures()),this.on("dateFormat",()=>this._checkFeatures()),this.on("numericFields",()=>this._checkFeatures()),this.on("colorFields",()=>this._checkFeatures()),this.on("emptyAs",()=>this._checkFeatures())}_checkFeatures(){(this.isDirty("dateFields")||this.isDirty("dateFormat"))&&(this._checkDates=this.get("dateFields")&&this.get("dateFields").length>0),this.isDirty("numericFields")&&(this._checkNumbers=this.get("numericFields")&&this.get("numericFields").length>0),this.isDirty("colorFields")&&(this._checkColors=this.get("colorFields")&&this.get("colorFields").length>0),this.isDirty("emptyAs")&&(this._checkEmpty=this.get("emptyAs")!=null),this._checkDeepFeatures()}_checkDeepFeatures(){let t=[];T(["dateFields","numericFields","colorFields"],e=>{T(this.get(e,[]),i=>{let s=i.split(".");for(s.pop();s.length>0;)t.push(s.join(".")),s.pop()})}),this._checkDeep=t.length>0,this.setPrivate("deepFields",t)}processMany(t){we(t)&&(this._checkDates||this._checkNumbers||this._checkColors||this._checkEmpty)&&T(t,e=>{this.processRow(e)})}processRow(t,e=""){tt(t,(i,s)=>{let r=e+i;this._checkEmpty&&(t[i]=this._maybeToEmpty(t[i])),this._checkNumbers&&(t[i]=this._maybeToNumber(r,t[i])),this._checkDates&&(t[i]=this._maybeToDate(r,t[i])),this._checkColors&&(t[i]=this._maybeToColor(r,t[i])),this._checkDeep&&this.getPrivate("deepFields",[]).indexOf(r)!==-1&&Lt(t[i])&&this.processRow(t[i],r+".")})}_maybeToNumber(t,e){return this.get("numericFields").indexOf(t)!==-1?rt(e):e}_maybeToDate(t,e){return this.get("dateFields").indexOf(t)!==-1?this._root.dateFormatter.parse(e,this.get("dateFormat","")).getTime():e}_maybeToEmpty(t){return(t==null||t=="")&&this.get("emptyAs")!=null?this.get("emptyAs"):t}_maybeToColor(t,e){return this.get("colorFields").indexOf(t)!==-1?Y.fromAny(e):e}};var ye=class extends ${constructor(){super(...arguments),this.rectangle=this.children.push(Et.new(this._root,{themeTags:["rectangle"],fillOpacity:0,fill:ht(16777215)})),this.gripL=this._createGrip("left"),this.gripR=this._createGrip("right"),this.gripT=this._createGrip("top"),this.gripB=this._createGrip("bottom"),this._is=1,this._ix=0,this._iw=0,this._isHover=!1}_afterNew(){super._afterNew(),this.addTag("resizer"),this.set("visible",!1),this.gripL.events.on("dragged",t=>{this._resize(t.target,-1)}),this.gripR.events.on("dragged",t=>{this._resize(t.target,1)}),this.gripL.events.on("dragstart",t=>{this._resizeStart(t.target)}),this.gripR.events.on("dragstart",t=>{this._resizeStart(t.target)}),this.gripT.events.on("dragged",t=>{this._rotate(t,90)}),this.gripB.events.on("dragged",t=>{this._rotate(t,-90)}),this.gripT.events.on("dragstart",t=>{this._resizeStart(t.target)}),this.gripB.events.on("dragstart",t=>{this._resizeStart(t.target)})}_resizeStart(t){let e=this.get("sprite");e&&(this._is=e.get("scale",1),this._ix=t.x(),this._iw=this.width()/2)}_resize(t,e){let i=this.get("sprite"),s=this.get("spriteTemplate");if(i){let r=Math.max(.01,this._is*(1+e*(t.x()-this._ix)/this._iw));s?s.set("scale",r):i.set("scale",r),i.states.lookup("default").set("scale",r),this._updatePositions()}}_rotate(t,e){let i=this.get("sprite"),s=this.get("spriteTemplate");if(i){let r=this.parent;if(r){let a=this.get("rotationStep",10),o=Math.round((Be({x:this.x(),y:this.y()},r.toLocal(t.point))+e)/a)*a;s?s.set("rotation",o):i.set("rotation",o),i.states.lookup("default").set("rotation",o),this._updatePositions()}}}_createGrip(t){let e=this.children.push($.new(this._root,{themeTags:["grip",t],setStateOnChildren:!0,draggable:!0}));return e.children.push($t.new(this._root,{themeTags:["outline"],centerX:Bt,centerY:Bt})),e.children.push($t.new(this._root,{centerX:Bt,centerY:Bt})),e}_updateChildren(){if(super._updateChildren(),this.isDirty("sprite")){let t=this.get("sprite");if(t){this.show(0),this.setPrivate("visible",!0),this._updatePositions();let e=t.parent;e&&e.children.moveValue(this,0),this._positionDP=t.events.on("positionchanged",()=>{this._updatePositions()}),this._positionDP=t.events.on("boundschanged",()=>{this._updatePositions()})}else this.hide(0),this.setPrivate("visible",!1),this._positionDP&&this._positionDP.dispose()}(this.isDirty("width")||this.isDirty("height")||this.isDirty("rotation"))&&this._updatePositions()}_updatePositions(){let t=this.get("sprite");if(t){let e=t.localBounds(),i=t.get("scale",1),s=20,r=(e.right-e.left)*i+s,a=(e.bottom-e.top)*i+s,o=t.get("rotation",0),n=this.rectangle,d=t.get("centerX",Bt),u=t.get("centerY",Bt),h=0;d instanceof nt&&(h=d.value);let c=0;u instanceof nt&&(c=u.value),n.setAll({centerX:d,centerY:u,width:r,height:a}),this.setAll({x:t.x()+s*(h-.5)*J(o)-s*(c-.5)*K(o),y:t.y()+s*(c-.5)*J(o)+s*(h-.5)*K(o),width:r,height:a,rotation:o}),this.gripT.setAll({x:(.5-h)*r,y:-c*a}),this.gripB.setAll({x:(.5-h)*r,y:(1-c)*a}),this.gripL.setAll({x:-h*r,y:(.5-c)*a}),this.gripR.setAll({x:(1-h)*r,y:(.5-c)*a}),this.rectangle.setAll({width:r,height:a})}}};ye.className="SpriteResizer";ye.classNames=$.classNames.concat([ye.className]);var xe=class extends ${constructor(){super(...arguments),this.label=this.children.push(wi.new(this._root,{})),this.buttonsContainer=this.children.push($.new(this._root,{themeTags:["buttons"]})),this.upButton=this.buttonsContainer.children.push(ft.new(this._root,{themeTags:["upbutton"]})),this.downButton=this.buttonsContainer.children.push(ft.new(this._root,{themeTags:["downbutton"]}))}_afterNew(){this.addTag("numericstepper"),this.set("layout",this._root.horizontalLayout),this.label.adapters.add("text",t=>(t&&t.replace(/\D/g,""),t===""&&(t="0"),t)),this.set("background",Et.new(this._root,{fillOpacity:0,fill:ht(16777215)})),this.buttonsContainer.states.create("hidden",{opacity:0,visible:!0}),this.events.on("pointerover",()=>{this.buttonsContainer.set("active",!0)}),this.events.on("pointerout",()=>{this.buttonsContainer.set("active",!1)}),this.label.on("text",t=>{if(t){let e=parseFloat(t);isNaN(e)||this.set("value",e)}}),this.upButton.events.on("click",()=>{this.set("value",this.get("value",0)+1)}),this.downButton.events.on("click",()=>{this.set("value",Math.max(0,this.get("value",0)-1))}),super._afterNew()}_updateChildren(){super._updateChildren();let t=this.get("value",0),e=this.label;if(this.isDirty("value")&&e.set("text",t.toString()),this.isDirty("disabled")){let i=this.get("disabled",!1);this.set("interactive",!i),this.upButton.set("interactive",!i),this.downButton.set("interactive",!i),i?(this.label.set("editOn","none"),this.buttonsContainer.hide(0)):(this.label.set("editOn","click"),this.buttonsContainer.show(0))}}};xe.className="NumericStepper";xe.classNames=$.classNames.concat([xe.className]);var be=class extends ${constructor(){super(...arguments),this.circle=this.children.push(It.new(this._root,{themeTags:["background"]})),this.label=this.children.push(mt.new(this._root,{})),this.slice=this.children.push(Je.new(this._root,{isMeasured:!1})),this.backgroundSlice=this.children.push(Je.new(this._root,{themeTags:["background"]}))}_afterNew(){this.addTag("progresspie"),super._afterNew()}_updateChildren(){if(super._updateChildren(),this.isDirty("width")||this.isDirty("height")||this.isDirty("radius")||this.isDirty("innerRadius")){let t=this.innerWidth(),e=this.innerHeight(),i=vt(this.get("radius",W),Math.min(t,e)/2),s=vt(this.get("innerRadius",pt(80)),i);this.slice.setAll({radius:i,innerRadius:s}),this.backgroundSlice.setAll({radius:i,innerRadius:s}),this.circle.set("radius",i)}if(this.isDirty("value")){let t=this.get("value",0);this.slice.set("arc",t*360),this.backgroundSlice.set("arc",360),this.label.setAll({text:this.getNumberFormatter().format(t*100,this.get("numberFormat","#'"))}),this.root.events.once("frameended",()=>{this.label.markDirtyKey("text")})}}};be.className="ProgressPie";be.classNames=$.classNames.concat([be.className]);var Rs={};Fs(Rs,{load:()=>Zs,readBlob:()=>zs});function Zs(g,t,e){return new Promise((i,s)=>{let r=e!=null&&e.responseType=="blob",a=new XMLHttpRequest;if(a.onload=()=>{if(a.status===200){let o,n;if(r){n=a.response,zs(n).then(u=>{let h={xhr:a,error:!1,response:u,blob:n,type:a.getResponseHeader("Content-Type"),target:t};i(h)});return}else o=a.responseText||a.response;let d={xhr:a,error:!1,response:o,blob:n,type:a.getResponseHeader("Content-Type"),target:t};i(d)}else s({xhr:a,error:!0,type:a.getResponseHeader("Content-Type"),target:t})},a.onerror=()=>{s({xhr:a,error:!0,type:a.getResponseHeader("Content-Type"),target:t})},a.open("GET",g,!0),e&&e.withCredentials&&(a.withCredentials=!0),e!=null){if(e.requestHeaders!=null)for(let o=0;o<e.requestHeaders.length;o++){let n=e.requestHeaders[o];a.setRequestHeader(n.key,n.value)}e.responseType!=null&&(a.responseType=e.responseType)}a.send()})}function zs(g){return new Promise((t,e)=>{let i=new FileReader;i.onload=s=>{t(i.result)},i.onerror=s=>{e(s)},i.readAsText(g)})}export{Ot as a,wt as b,_t as c,Le as d,Ae as e,Ne as f,ze as g,Ye as h,oi as i,Ki as j,te as k,ee as l,ie as m,It as n,se as o,re as p,ae as q,Yt as r,ut as s,Wt as t,oe as u,ne as v,ft as w,kt as x,he as y,le as z,ce as A,de as B,ue as C,fe as D,Gt as E,Vt as F,Xt as G,pe as H,me as I,ge as J,_e as K,Ji as L,Qi as M,ts as N,ye as O,xe as P,be as Q,Rs as R};
|