@rero/rero-ils-ui
Version:
User interface for RERO integrated library system (RERO ILS).
452 lines • 302 kB
JavaScript
import{e as Wo,h as xr,i as vr}from"./chunk-BNO2ALQS.js";import{$a as No,$b as hr,A as zi,B as At,Bb as Jo,Da as Oo,Db as Zo,Fb as er,Ga as Ro,Gb as tr,Hb as ir,Ja as Fi,Jb as nr,Ka as xt,Lb as sr,Ma as zo,Me as _r,Nb as or,Ne as yr,Oa as Wn,Pb as rr,Qb as ar,Sa as $n,Sb as lr,T as Mo,Ta as Kn,Tb as cr,Ua as Ao,Va as Un,Vb as dr,Wa as Qn,Y as Do,Ya as Fo,_a as Vo,ab as Bo,ac as ur,bb as Yn,bc as fr,d as So,db as Ho,dc as pr,eb as jo,g as An,ga as Ai,h as ko,hb as ri,i as ni,ia as Vn,id as Bi,ja as si,jb as $o,ka as Ft,la as Eo,lb as Ko,ma as Nn,mb as qn,na as Io,nb as Uo,o as Fn,oa as pe,ob as Qo,p as yt,qb as Yo,qc as gr,ra as Po,rc as mr,sa as Lo,sb as qo,sc as br,ta as Bn,tc as Vi,ua as oi,wa as Hn,wb as Go,ya as ge,ye as Hi,za as jn,zb as Xo,zc as Ni}from"./chunk-DMPOHDCX.js";import{$b as On,Bb as In,Bc as Rt,Ca as H,Cc as He,Da as Ne,Db as M,Ec as Ri,Hc as _o,Ia as pt,Ic as yo,Jc as xo,K as po,Na as Ii,Nc as vo,Oc as zt,Pc as xe,Qc as je,Rb as Ot,Sb as T,Sc as wo,Tb as Li,Ub as Pn,Uc as To,Vb as ti,Wb as Oi,Yb as ii,Yc as bt,Zb as Ln,Zc as _t,a as Ee,ac as Rn,b as Pt,bc as O,cb as mo,cc as N,cd as et,dc as ue,ec as gt,fa as ve,fc as mt,ga as Ie,gc as K,hb as S,hc as Ze,id as Co,la as de,m as Lt,mb as ei,nb as te,nc as fe,nd as q,oc as E,od as tt,pc as bo,qc as zn,s as Je,sa as go,ta as we,ua as Te,uc as $,vc as oe,w as Di,wa as Ei,wc as P,xb as Be,xc as L,yb as Pe,zb as Pi}from"./chunk-GDWQHTGO.js";var Zl=["colgroup"],ec=["caption"],tc=["header"],ic=["body"],nc=["footer"],sc=["summary"],oc=["emptymessage"],rc=["paginatorleft"],ac=["paginatorright"],lc=["paginatordropdownitem"],cc=["frozenheader"],dc=["frozenbody"],hc=["frozenfooter"],uc=["frozencolgroup"],fc=["loadingicon"],pc=["reorderindicatorupicon"],gc=["reorderindicatordownicon"],mc=["sorticon"],bc=["checkboxicon"],_c=["headercheckboxicon"],yc=["togglericon"],xc=["paginatorfirstpagelinkicon"],vc=["paginatorlastpagelinkicon"],wc=["paginatorpreviouspagelinkicon"],Tc=["paginatornextpagelinkicon"],Cc=["loader"],Sc=["container"],kc=["resizeHelper"],Mc=["reorderIndicatorUp"],Dc=["reorderIndicatorDown"],Ec=["table"],Ic=["scrollableView"],Pc=["scrollableFrozenView"],Lc=(t,n,e,i,s,o)=>({"p-treetable p-component":!0,"p-treetable-gridlines":t,"p-treetable-hoverable-rows":n,"p-treetable-auto-layout":e,"p-treetable-resizable":i,"p-treetable-resizable-fit":s,"p-treetable-flex-scrollable":o}),We=t=>({$implicit:t}),Oc=(t,n)=>({left:t,width:n}),Rc=t=>({width:t});function zc(t,n){if(t&1&&ue(0,"i"),t&2){let e=E(2);Oi("p-treetable-loading-icon pi-spin "+e.loadingIcon)}}function Ac(t,n){t&1&&ue(0,"SpinnerIcon",24),t&2&&T("spin",!0)("styleClass","p-treetable-loading-icon")}function Fc(t,n){}function Vc(t,n){t&1&&M(0,Fc,0,0,"ng-template")}function Nc(t,n){if(t&1&&(O(0,"span",25),M(1,Vc,1,0,null,26),N()),t&2){let e=E(3);S(),T("ngTemplateOutlet",e.loadingIconTemplate||e._loadingIconTemplate)}}function Bc(t,n){if(t&1&&(gt(0),M(1,Ac,1,2,"SpinnerIcon",22)(2,Nc,2,1,"span",23),mt()),t&2){let e=E(2);S(),T("ngIf",!e.loadingIconTemplate&&!e._loadingIconTemplate),S(),T("ngIf",e.loadingIconTemplate||e._loadingIconTemplate)}}function Hc(t,n){if(t&1&&(O(0,"div",18)(1,"div",19),M(2,zc,1,2,"i",20)(3,Bc,3,2,"ng-container",21),N()()),t&2){let e=E();S(2),T("ngIf",e.loadingIcon),S(),T("ngIf",!e.loadingIcon)}}function jc(t,n){t&1&&K(0)}function Wc(t,n){if(t&1&&(O(0,"div",27),M(1,jc,1,0,"ng-container",26),N()),t&2){let e=E();S(),T("ngTemplateOutlet",e.captionTemplate||e._captionTemplate)}}function $c(t,n){t&1&&K(0)}function Kc(t,n){if(t&1&&M(0,$c,1,0,"ng-container",26),t&2){let e=E(3);T("ngTemplateOutlet",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate)}}function Uc(t,n){t&1&&M(0,Kc,1,1,"ng-template",29)}function Qc(t,n){t&1&&K(0)}function Yc(t,n){if(t&1&&M(0,Qc,1,0,"ng-container",26),t&2){let e=E(3);T("ngTemplateOutlet",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate)}}function qc(t,n){t&1&&M(0,Yc,1,1,"ng-template",30)}function Gc(t,n){t&1&&K(0)}function Xc(t,n){if(t&1&&M(0,Gc,1,0,"ng-container",26),t&2){let e=E(3);T("ngTemplateOutlet",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate)}}function Jc(t,n){t&1&&M(0,Xc,1,1,"ng-template",31)}function Zc(t,n){t&1&&K(0)}function ed(t,n){if(t&1&&M(0,Zc,1,0,"ng-container",26),t&2){let e=E(3);T("ngTemplateOutlet",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function td(t,n){t&1&&M(0,ed,1,1,"ng-template",32)}function id(t,n){if(t&1){let e=Ze();O(0,"p-paginator",28),fe("onPageChange",function(s){we(e);let o=E();return Te(o.onPageChange(s))}),M(1,Uc,1,0,null,21)(2,qc,1,0,null,21)(3,Jc,1,0,null,21)(4,td,1,0,null,21),N()}if(t&2){let e,i,s,o=E();T("rows",o.rows)("first",o.first)("totalRecords",o.totalRecords)("pageLinkSize",o.pageLinks)("alwaysShow",o.alwaysShowPaginator)("rowsPerPageOptions",o.rowsPerPageOptions)("templateLeft",(e=o.paginatorLeftTemplate)!==null&&e!==void 0?e:o._paginatorLeftTemplate)("templateRight",(i=o.paginatorRightTemplate)!==null&&i!==void 0?i:o._paginatorRightTemplate)("dropdownAppendTo",o.paginatorDropdownAppendTo)("currentPageReportTemplate",o.currentPageReportTemplate)("showFirstLastIcon",o.showFirstLastIcon)("dropdownItemTemplate",(s=o.paginatorDropdownItemTemplate)!==null&&s!==void 0?s:o._paginatorDropdownItemTemplate)("showCurrentPageReport",o.showCurrentPageReport)("showJumpToPageDropdown",o.showJumpToPageDropdown)("showPageLinks",o.showPageLinks)("styleClass",o.paginatorStyleClass)("locale",o.paginatorLocale),S(),T("ngIf",o.paginatorFirstPageLinkIconTemplate||o._paginatorFirstPageLinkIconTemplate),S(),T("ngIf",o.paginatorPreviousPageLinkIconTemplate||o._paginatorPreviousPageLinkIconTemplate),S(),T("ngIf",o.paginatorLastPageLinkIconTemplate||o._paginatorLastPageLinkIconTemplate),S(),T("ngIf",o.paginatorNextPageLinkIconTemplate||o._paginatorNextPageLinkIconTemplate)}}function nd(t,n){t&1&&K(0)}function sd(t,n){t&1&&K(0)}function od(t,n){t&1&&K(0)}function rd(t,n){if(t&1&&(O(0,"div",33)(1,"table",34,1),M(3,nd,1,0,"ng-container",35),O(4,"thead",36),M(5,sd,1,0,"ng-container",35),N(),ue(6,"tbody",37),O(7,"tfoot",38),M(8,od,1,0,"ng-container",35),N()()()),t&2){let e,i=E();S(),T("ngClass",i.tableStyleClass)("ngStyle",i.tableStyle),S(2),T("ngTemplateOutlet",i.colGroupTemplate||i._colGroupTemplate)("ngTemplateOutletContext",xe(10,We,i.columns)),S(2),T("ngTemplateOutlet",i.headerTemplate||i._headerTemplate)("ngTemplateOutletContext",xe(12,We,i.columns)),S(),T("pTreeTableBody",i.columns)("pTreeTableBodyTemplate",(e=i.bodyTemplate)!==null&&e!==void 0?e:i._bodyTemplate),S(2),T("ngTemplateOutlet",i.footerTemplate||i._footerTemplate)("ngTemplateOutletContext",xe(14,We,i.columns))}}function ad(t,n){if(t&1&&ue(0,"div",42,3),t&2){let e=E(2);T("ttScrollableView",e.frozenColumns)("frozen",!0)("ngStyle",xe(4,Rc,e.frozenWidth))("scrollHeight",e.scrollHeight)}}function ld(t,n){if(t&1&&(O(0,"div",39),M(1,ad,2,6,"div",40),ue(2,"div",41,2),N()),t&2){let e=E();S(),T("ngIf",e.frozenColumns||e.frozenBodyTemplate||e._frozenBodyTemplate),S(),T("ttScrollableView",e.columns)("frozen",!1)("scrollHeight",e.scrollHeight)("ngStyle",je(5,Oc,e.frozenWidth,"calc(100% - "+e.frozenWidth+")"))}}function cd(t,n){t&1&&K(0)}function dd(t,n){if(t&1&&M(0,cd,1,0,"ng-container",26),t&2){let e=E(3);T("ngTemplateOutlet",e.paginatorFirstPageLinkIconTemplate||e._paginatorFirstPageLinkIconTemplate)}}function hd(t,n){t&1&&M(0,dd,1,1,"ng-template",29)}function ud(t,n){t&1&&K(0)}function fd(t,n){if(t&1&&M(0,ud,1,0,"ng-container",26),t&2){let e=E(3);T("ngTemplateOutlet",e.paginatorPreviousPageLinkIconTemplate||e._paginatorPreviousPageLinkIconTemplate)}}function pd(t,n){t&1&&M(0,fd,1,1,"ng-template",30)}function gd(t,n){t&1&&K(0)}function md(t,n){if(t&1&&M(0,gd,1,0,"ng-container",26),t&2){let e=E(3);T("ngTemplateOutlet",e.paginatorLastPageLinkIconTemplate||e._paginatorLastPageLinkIconTemplate)}}function bd(t,n){t&1&&M(0,md,1,1,"ng-template",31)}function _d(t,n){t&1&&K(0)}function yd(t,n){if(t&1&&M(0,_d,1,0,"ng-container",26),t&2){let e=E(3);T("ngTemplateOutlet",e.paginatorNextPageLinkIconTemplate||e._paginatorNextPageLinkIconTemplate)}}function xd(t,n){t&1&&M(0,yd,1,1,"ng-template",32)}function vd(t,n){if(t&1){let e=Ze();O(0,"p-paginator",43),fe("onPageChange",function(s){we(e);let o=E();return Te(o.onPageChange(s))}),M(1,hd,1,0,null,21)(2,pd,1,0,null,21)(3,bd,1,0,null,21)(4,xd,1,0,null,21),N()}if(t&2){let e,i,s,o=E();T("rows",o.rows)("first",o.first)("totalRecords",o.totalRecords)("pageLinkSize",o.pageLinks)("alwaysShow",o.alwaysShowPaginator)("rowsPerPageOptions",o.rowsPerPageOptions)("templateLeft",(e=o.paginatorLeftTemplate)!==null&&e!==void 0?e:o._paginatorLeftTemplate)("templateRight",(i=o.paginatorRightTemplate)!==null&&i!==void 0?i:o._paginatorRightTemplate)("dropdownAppendTo",o.paginatorDropdownAppendTo)("currentPageReportTemplate",o.currentPageReportTemplate)("showFirstLastIcon",o.showFirstLastIcon)("dropdownItemTemplate",(s=o.paginatorDropdownItemTemplate)!==null&&s!==void 0?s:o._paginatorDropdownItemTemplate)("showCurrentPageReport",o.showCurrentPageReport)("showJumpToPageDropdown",o.showJumpToPageDropdown)("showPageLinks",o.showPageLinks)("styleClass",o.paginatorStyleClass)("locale",o.paginatorLocale),S(),T("ngIf",o.paginatorFirstPageLinkIconTemplate||o._paginatorFirstPageLinkIconTemplate),S(),T("ngIf",o.paginatorPreviousPageLinkIconTemplate||o._paginatorPreviousPageLinkIconTemplate),S(),T("ngIf",o.paginatorLastPageLinkIconTemplate||o._paginatorLastPageLinkIconTemplate),S(),T("ngIf",o.paginatorNextPageLinkIconTemplate||o._paginatorNextPageLinkIconTemplate)}}function wd(t,n){t&1&&K(0)}function Td(t,n){if(t&1&&(O(0,"div",44),M(1,wd,1,0,"ng-container",26),N()),t&2){let e=E();S(),T("ngTemplateOutlet",e.summaryTemplate||e._summaryTemplate)}}function Cd(t,n){t&1&&ue(0,"div",45,4)}function Sd(t,n){t&1&&ue(0,"ArrowDownIcon")}function kd(t,n){}function Md(t,n){t&1&&M(0,kd,0,0,"ng-template")}function Dd(t,n){if(t&1&&(O(0,"span",46,5),M(2,Sd,1,0,"ArrowDownIcon",21)(3,Md,1,0,null,26),N()),t&2){let e=E();S(2),T("ngIf",!e.reorderIndicatorUpIconTemplate&&!e._reorderIndicatorUpIconTemplate),S(),T("ngTemplateOutlet",e.reorderIndicatorUpIconTemplate||e._reorderIndicatorUpIconTemplate)}}function Ed(t,n){t&1&&ue(0,"ArrowUpIcon")}function Id(t,n){}function Pd(t,n){t&1&&M(0,Id,0,0,"ng-template")}function Ld(t,n){if(t&1&&(O(0,"span",47,6),M(2,Ed,1,0,"ArrowUpIcon",21)(3,Pd,1,0,null,26),N()),t&2){let e=E();S(2),T("ngIf",!e.reorderIndicatorDownIconTemplate&&!e._reorderIndicatorDownIconTemplate),S(),T("ngTemplateOutlet",e.reorderIndicatorDownIconTemplate||e._reorderIndicatorDownIconTemplate)}}var Od=["pTreeTableBody",""],Rd=(t,n,e,i)=>({$implicit:t,node:n,rowData:e,columns:i}),zd=(t,n)=>({$implicit:t,frozen:n});function Ad(t,n){t&1&&K(0)}function Fd(t,n){if(t&1&&(gt(0),M(1,Ad,1,0,"ng-container",2),mt()),t&2){let e=E().$implicit,i=E();S(),T("ngTemplateOutlet",i.template)("ngTemplateOutletContext",wo(2,Rd,e,e.node,e.node.data,i.columns))}}function Vd(t,n){if(t&1&&M(0,Fd,2,7,"ng-container",1),t&2){let e=n.$implicit;T("ngIf",e.visible)}}function Nd(t,n){t&1&&K(0)}function Bd(t,n){if(t&1&&(gt(0),M(1,Nd,1,0,"ng-container",2),mt()),t&2){let e=E();S(),T("ngTemplateOutlet",e.tt.emptyMessageTemplate)("ngTemplateOutletContext",je(2,zd,e.columns,e.frozen))}}var Hd=["scrollHeader"],jd=["scrollHeaderBox"],Wd=["scrollBody"],$d=["scrollTable"],Kd=["loadingTable"],Ud=["scrollFooter"],Qd=["scrollFooterBox"],Yd=["scrollableAligner"],qd=["scroller"],Gd=["ttScrollableView",""],Xd=t=>({height:t}),Tr=(t,n)=>({$implicit:t,options:n}),Jd=t=>({options:t}),Zd=(t,n)=>({"max-height":t,"overflow-y":n}),eh=()=>({});function th(t,n){t&1&&K(0)}function ih(t,n){t&1&&K(0)}function nh(t,n){t&1&&K(0)}function sh(t,n){if(t&1&&M(0,nh,1,0,"ng-container",14),t&2){let e=n.$implicit,i=n.options;E(2);let s=Rt(11);T("ngTemplateOutlet",s)("ngTemplateOutletContext",je(2,Tr,e,i))}}function oh(t,n){t&1&&K(0)}function rh(t,n){if(t&1&&M(0,oh,1,0,"ng-container",14),t&2){let e=n.options,i=E(3);T("ngTemplateOutlet",i.tt.loaderTemplate||i.tt._loaderTemplate)("ngTemplateOutletContext",xe(2,Jd,e))}}function ah(t,n){t&1&&(gt(0),M(1,rh,1,4,"ng-template",null,5,et),mt())}function lh(t,n){if(t&1){let e=Ze();O(0,"p-scroller",19,3),fe("onLazyLoad",function(s){we(e);let o=E();return Te(o.tt.onLazyItemLoad(s))}),M(2,sh,1,5,"ng-template",null,4,et)(4,ah,3,0,"ng-container",17),N()}if(t&2){let e=E();ti(xe(8,Xd,e.tt.scrollHeight!=="flex"?e.tt.scrollHeight:void 0)),T("items",e.tt.serializedValue)("scrollHeight",e.scrollHeight!=="flex"?void 0:"100%")("itemSize",e.tt.virtualScrollItemSize||e.tt._virtualRowHeight)("lazy",e.tt.lazy)("options",e.tt.virtualScrollOptions),S(4),T("ngIf",e.tt.loaderTemplate||e.tt._loaderTemplate)}}function ch(t,n){t&1&&K(0)}function dh(t,n){if(t&1&&(gt(0),O(1,"div",20,6),M(3,ch,1,0,"ng-container",14),N(),mt()),t&2){let e=E(),i=Rt(11);S(),T("ngStyle",je(3,Zd,e.tt.scrollHeight!=="flex"?e.scrollHeight:void 0,!e.frozen&&e.tt.scrollHeight?"scroll":void 0)),S(2),T("ngTemplateOutlet",i)("ngTemplateOutletContext",je(7,Tr,e.serializedValue,zt(6,eh)))}}function hh(t,n){t&1&&K(0)}function uh(t,n){t&1&&ue(0,"div",24,8)}function fh(t,n){if(t&1&&(O(0,"table",21,7),M(2,hh,1,0,"ng-container",14),ue(3,"tbody",22),N(),M(4,uh,2,0,"div",23)),t&2){let e=n.$implicit,i=n.options,s=E();ti(i.contentStyle),Oi(s.tt.tableStyleClass),T("ngClass",i.contentStyleClass)("ngStyle",s.tt.tableStyle),S(2),T("ngTemplateOutlet",s.frozen?s.tt.frozenColGroupTemplate||s.tt._frozenColGroupTemplate||s.tt.colGroupTemplate||s.tt._colGroupTemplate:s.tt.colGroupTemplate||s.tt._colGroupTemplate)("ngTemplateOutletContext",xe(13,We,s.columns)),S(),T("pTreeTableBody",s.columns)("pTreeTableBodyTemplate",s.frozen?s.tt.frozenBodyTemplate||s.tt._frozenBodyTemplate||s.tt.bodyTemplate||s.tt._bodyTemplate:s.tt.bodyTemplate||s.tt._bodyTemplate)("serializedNodes",e)("frozen",s.frozen),S(),T("ngIf",s.frozen)}}function ph(t,n){t&1&&K(0)}function gh(t,n){t&1&&K(0)}function mh(t,n){if(t&1&&(O(0,"div",25,9)(2,"div",26,10)(4,"table",27),M(5,ph,1,0,"ng-container",14),O(6,"tfoot",28),M(7,gh,1,0,"ng-container",14),N()()()()),t&2){let e=E();S(4),T("ngClass",e.tt.tableStyleClass)("ngStyle",e.tt.tableStyle),S(),T("ngTemplateOutlet",e.frozen?e.tt.frozenColGroupTemplate||e.tt._frozenColGroupTemplate||e.tt.colGroupTemplate||e.tt._colGroupTemplate:e.tt.colGroupTemplate||e.tt._colGroupTemplate)("ngTemplateOutletContext",xe(6,We,e.columns)),S(2),T("ngTemplateOutlet",e.frozen?e.tt.frozenFooterTemplate||e.tt._frozenFooterTemplate||e.tt.footerTemplate||e.tt._footerTemplate:e.tt.footerTemplate||e.tt._footerTemplate)("ngTemplateOutletContext",xe(8,We,e.columns))}}function bh(t,n){t&1&&ue(0,"ChevronDownIcon"),t&2&&Ot("aria-hidden",!0)}function _h(t,n){t&1&&ue(0,"ChevronRightIcon"),t&2&&Ot("aria-hidden",!0)}function yh(t,n){if(t&1&&(gt(0),M(1,bh,1,1,"ChevronDownIcon",1)(2,_h,1,1,"ChevronRightIcon",1),mt()),t&2){let e=E();S(),T("ngIf",e.rowNode.node.expanded),S(),T("ngIf",!e.rowNode.node.expanded)}}function xh(t,n){}function vh(t,n){t&1&&M(0,xh,0,0,"ng-template")}var wh=({dt:t})=>`
/* For PrimeNG */
.p-treetable {
position: relative;
}
.p-treetable table {
border-collapse: collapse;
width: 100%;
table-layout: fixed;
}
.p-treetable .p-sortable-column {
cursor: pointer;
user-select: none;
}
.p-treetable .p-sortable-column .p-column-title,
.p-treetable .p-sortable-column .p-sortable-column-icon,
.p-treetable .p-sortable-column .p-sortable-column-badge {
vertical-align: middle;
}
.p-treetable .p-sortable-column .p-sortable-column-badge {
display: inline-flex;
align-items: center;
justify-content: center;
}
.p-treetable-auto-layout>.p-treetable-wrapper {
overflow-x: auto;
}
.p-treetable-auto-layout>.p-treetable-wrapper>table {
table-layout: auto;
}
.p-treetable-hoverable-rows .p-treetable-tbody>tr {
cursor: pointer;
}
.p-treetable-toggler {
cursor: pointer;
user-select: none;
display: inline-flex;
align-items: center;
justify-content: center;
vertical-align: middle;
overflow: hidden;
position: relative;
}
/* Scrollable */
.p-treetable-scrollable-wrapper {
position: relative;
}
.p-treetable-scrollable-header,
.p-treetable-scrollable-footer {
overflow: hidden;
flex-shrink: 0;
}
.p-treetable-scrollable-body {
overflow: auto;
position: relative;
}
.p-treetable-virtual-table {
position: absolute;
}
/* Frozen Columns */
.p-treetable-frozen-view .p-treetable-scrollable-body {
overflow: hidden;
}
.p-treetable-frozen-view>.p-treetable-scrollable-body>table>.p-treetable-tbody>tr>td:last-child {
border-right: 0 none;
}
.p-treetable-unfrozen-view {
position: absolute;
top: 0;
}
/* Flex Scrollable */
.p-treetable-flex-scrollable {
display: flex;
flex-direction: column;
flex: 1;
height: 100%;
}
.p-treetable-flex-scrollable .p-treetable-scrollable-wrapper,
.p-treetable-flex-scrollable .p-treetable-scrollable-view {
display: flex;
flex-direction: column;
flex: 1;
height: 100%;
}
.p-treetable-flex-scrollable .p-treetable-virtual-scrollable-body {
flex: 1;
}
/* Resizable */
.p-treetable-resizable>.p-treetable-wrapper {
overflow-x: auto;
}
.p-treetable-resizable .p-treetable-thead>tr>th,
.p-treetable-resizable .p-treetable-tfoot>tr>td,
.p-treetable-resizable .p-treetable-tbody>tr>td {
overflow: hidden;
}
.p-treetable-resizable .p-resizable-column {
background-clip: padding-box;
position: relative;
}
.p-treetable-resizable-fit .p-resizable-column:last-child .p-column-resizer {
display: none;
}
.p-treetable .p-column-resizer {
display: block;
position: absolute;
top: 0;
right: 0;
margin: 0;
width: ${t("treetable.column.resizer.width")};
height: 100%;
padding: 0px;
cursor: col-resize;
border: 1px solid transparent;
}
.p-treetable .p-column-resizer-helper {
width: ${t("treetable.resize.indicator.width")};
position: absolute;
z-index: 10;
display: none;
background: ${t("treetable.resize.indicator.color")};
}
.p-treetable .p-row-editor-init,
.p-treetable .p-row-editor-save,
.p-treetable .p-row-editor-cancel {
display: inline-flex;
align-items: center;
justify-content: center;
overflow: hidden;
position: relative;
}
/* Reorder */
.p-treetable-reorder-indicator-up,
.p-treetable-reorder-indicator-down {
position: absolute;
display: none;
}
[ttReorderableColumn] {
cursor: move;
}
/* Loader */
.p-treetable-mask {
position: absolute !important;
display: flex;
align-items: center;
justify-content: center;
z-index: 2;
}
.p-treetable-loading-icon {
font-size: ${t("treetable.loading.icon.size")};
width: ${t("treetable.loading.icon.size")};
height: ${t("treetable.loading.icon.size")};
}
/* Virtual Scroll */
.p-treetable .p-scroller-loading {
transform: none !important;
min-height: 0;
position: sticky;
top: 0;
left: 0;
}
.p-treetable .p-paginator-top {
border-color: ${t("treetable.paginator.top.border.color")};
border-style: solid;
border-width: ${t("treetable.paginator.top.border.width")};
}
.p-treetable .p-paginator-bottom {
border-color: ${t("treetable.paginator.bottom.border.color")};
border-style: solid;
border-width: ${t("treetable.paginator.bottom.border.width")};
}
.p-treetable .p-treetable-header {
background: ${t("treetable.header.background")};
color: ${t("treetable.header.color")};
border-color: ${t("treetable.header.border.color")};
border-style: solid;
border-width: ${t("treetable.header.border.width")};
padding: ${t("treetable.header.padding")};
font-weight: ${t("treetable.column.title.font.weight")};
}
.p-treetable .p-treetable-footer {
background: ${t("treetable.footer.background")};
color: ${t("treetable.footer.color")};
border-color: ${t("treetable.footer.border.color")};
border-style: solid;
border-width: ${t("treetable.footer.border.width")};
padding: ${t("treetable.footer.padding")};
font-weight: ${t("treetable.column.footer.font.weight")};
}
.p-treetable .p-treetable-thead>tr>th {
padding: ${t("treetable.header.cell.padding")};
background: ${t("treetable.header.cell.background")};
border-color: ${t("treetable.header.cell.border.color")};
border-style: solid;
border-width: 0 0 1px 0;
color: ${t("treetable.header.cell.color")};
font-weight: ${t("treetable.column.title.font.weight")};
text-align: start;
transition: background ${t("treetable.transition.duration")}, color ${t("treetable.transition.duration")}, border-color ${t("treetable.transition.duration")},
outline-color ${t("treetable.transition.duration")}, box-shadow ${t("treetable.transition.duration")};
}
.p-treetable .p-treetable-tfoot>tr>td {
text-align: start;
padding: ${t("treetable.footer.cell.padding")};
border-color: ${t("treetable.footer.cell.border.color")};
border-style: solid;
border-width: 0 0 1px 0;
color: ${t("treetable.footer.cell.color")};
background: ${t("treetable.footer.cell.background")};
font-weight: ${t("treetable.column.footer.font.weight")};
}
.p-treetable .p-sortable-column {
cursor: pointer;
user-select: none;
outline-color: transparent;
vertical-align: middle;
}
.p-treetable .p-sortable-column .p-sortable-column-icon {
color: ${t("treetable.sort.icon.color")};
transition: color ${t("treetable.transition.duration")};
}
.p-treetable .p-sortable-column:not(.p-treetable-column-sorted):hover {
background: ${t("treetable.header.cell.hover.background")};
color: ${t("treetable.header.cell.hover.color")};
}
.p-treetable .p-sortable-column:not(.p-treetable-column-sorted):hover .p-sortable-column-icon {
color: ${t("treetable.sort.icon.hover.color")};
}
.p-treetable .p-sortable-column.p-treetable-column-sorted {
background: ${t("treetable.header.cell.selected.background")};
color: ${t("treetable.header.cell.selected.color")};
}
.p-treetable .p-sortable-column.p-treetable-column-sorted .p-sortable-column-icon {
color: ${t("treetable.header.cell.selected.color")};
}
.p-treetable .p-sortable-column:focus-visible {
box-shadow: ${t("treetable.header.cell.focus.ring.shadow")};
outline: ${t("treetable.header.cell.focus.ring.width")} ${t("treetable.header.cell.focus.ring.style")} ${t("treetable.header.cell.focus.ring.color")};
outline-offset: ${t("treetable.header.cell.focus.ring.offset")};
}
.p-treetable-hoverable .p-treetable-selectable-row {
cursor: pointer;
}
.p-treetable .p-treetable-tbody > tr {
outline-color: transparent;
background: ${t("treetable.row.background")};
color: ${t("treetable.row.color")};
transition: background ${t("treetable.transition.duration")}, color ${t("treetable.transition.duration")}, border-color ${t("treetable.transition.duration")},
outline-color ${t("treetable.transition.duration")}, box-shadow ${t("treetable.transition.duration")};
}
.p-treetable .p-treetable-tbody>tr>td {
text-align: start;
border-color: ${t("treetable.body.cell.border.color")};
border-style: solid;
border-width: 0 0 1px 0;
padding: ${t("treetable.body.cell.padding")};
}
.p-treetable .p-treetable-tbody>tr>td .p-treetable-toggler {
display: inline-flex;
align-items: center;
justify-content: center;
overflow: hidden;
position: relative;
width: ${t("treetable.node.toggle.button.size")};
height: ${t("treetable.node.toggle.button.size")};
color: ${t("treetable.node.toggle.button.color")};
border: 0 none;
background: transparent;
cursor: pointer;
border-radius: ${t("treetable.node.toggle.button.border.radius")};
transition: background ${t("treetable.transition.duration")}, color ${t("treetable.transition.duration")}, border-color ${t("treetable.transition.duration")},
outline-color ${t("treetable.transition.duration")}, box-shadow ${t("treetable.transition.duration")};
outline-color: transparent;
user-select: none;
}
.p-treetable .p-treetable-tbody>tr>td .p-treetable-toggler:enabled:hover {
color: ${t("treetable.node.toggle.button.hover.color")};
background: ${t("treetable.node.toggle.button.hover.background")};
}
.p-treetable .p-treetable-tbody>tr>tr.treetable-row-selected .p-treetable-toggler:hover {
background: ${t("treetable.node.toggle.button.selected.hover.background")};
color: ${t("treetable.node.toggle.button.selected.hover.color")};
}
.p-treetable .p-treetable-tbody>tr>td .p-treetable-toggler:focus-visible {
box-shadow: ${t("treetable.node.toggle.button.focus.ring.shadow")};
outline: ${t("treetable.node.toggle.button.focus.ring.width")} ${t("treetable.node.toggle.button.focus.ring.style")} ${t("treetable.node.toggle.button.focus.ring.color")};
outline-offset: ${t("treetable.node.toggle.button.focus.ring.offset")};
}
.p-treetable .p-treetable-tbody>tr.p-treetable-row-selected {
background: ${t("treetable.row.selected.background")};
color: ${t("treetable.row.selected.color")};
}
.p-treetable-tbody > tr:focus-visible,
.p-treetable-tbody > tr.p-treetable-contextmenu-row-selected {
box-shadow: ${t("treetable.row.focus.ring.shadow")};
outline: ${t("treetable.row.focus.ring.width")} ${t("treetable.row.focus.ring.style")} ${t("treetable.row.focus.ring.color")};
outline-offset: ${t("treetable.row.focus.ring.offset")};
}
.p-treetable .p-treetable-tbody>tr.p-treetable-row-selected .p-treetable-toggler {
color: inherit;
}
.p-treetable .p-treetable-tbody>tr.p-treetable-row-selected .p-treetable-toggler:hover {
background: ${t("treetable.node.toggle.button.selected.hover.background")};
color: ${t("treetable.node.toggle.button.selected.hover.color")};
}
.p-treetable.p-treetable-hoverable-rows .p-treetable-tbody>tr:not(.p-treetable-row-selected):hover {
background: ${t("treetable.row.hover.background")};
color: ${t("treetable.row.hover.color")};
}
.p-treetable.p-treetable-gridlines .p-datatable-header {
border-width: 1px 1px 0 1px;
}
.p-treetable.p-treetable-gridlines .p-treetable-footer {
border-width: 0 1px 1px 1px;
}
.p-treetable.p-treetable-gridlines .p-treetable-top {
border-width: 0 1px 0 1px;
}
.p-treetable.p-treetable-gridlines .p-treetable-bottom {
border-width: 0 1px 1px 1px;
}
.p-treetable.p-treetable-gridlines .p-treetable-thead>tr>th {
border-width: 1px;
}
.p-treetable.p-treetable-gridlines .p-treetable-tbody>tr>td {
border-width: 1px;
}
.p-treetable.p-treetable-gridlines .p-treetable-tfoot>tr>td {
border-width: 1px;
}
.p-treetable.p-treetable-sm .p-treetable-header {
padding: 0.65625rem 0.875rem;
}
.p-treetable.p-treetable-sm .p-treetable-thead>tr>th {
padding: 0.375rem 0.5rem;
}
.p-treetable.p-treetable-sm .p-treetable-tbody>tr>td {
padding: 0.375rem 0.5rem;
}
.p-treetable.p-treetable-sm .p-treetable-tfoot>tr>td {
padding: 0.375rem 0.5rem;
}
.p-treetable.p-treetable-sm .p-treetable-footer {
padding: 0.375rem 0.5rem;
}
.p-treetable.p-treetable-lg .p-treetable-header {
padding: 0.9375rem 1.25rem;
}
.p-treetable.p-treetable-lg .p-treetable-thead>tr>th {
padding: 0.9375rem 1.25rem;
}
.p-treetable.p-treetable-lg .p-treetable-tbody>tr>td {
padding: 0.9375rem 1.25rem;
}
.p-treetable.p-treetable-lg .p-treetable-tfoot>tr>td {
padding: 0.9375rem 1.25rem;
}
.p-treetable.p-treetable-lg .p-treetable-footer {
padding: 0.9375rem 1.25rem;
}
p-treetabletoggler + p-treetablecheckbox .p-checkbox,
p-treetable-toggler + p-treetable-checkbox .p-checkbox,
p-tree-table-toggler + p-tree-table-checkbox .p-checkbox {
vertical-align: middle;
}
p-treetabletoggler + p-treetablecheckbox + span,
p-treetable-toggler + p-treetable-checkbox + span,
p-tree-table-toggler + p-tree-table-checkbox + span {
vertical-align: middle;
}
`,Th={root:({instance:t})=>({"p-treetable p-component":!0,"p-treetable-hoverable":t.rowHover||t.selectionMode,"p-treetable-resizable":t.resizableColumns,"p-treetable-resizable-fit":t.resizableColumns&&t.columnResizeMode==="fit","p-treetable-scrollable":t.scrollable,"p-treetable-flex-scrollable":t.scrollable&&t.scrollHeight==="flex","p-treetable-gridlines":t.showGridlines,"p-treetable-sm":t.size==="small","p-treetable-lg":t.size==="large"}),loading:"p-treetable-loading",mask:"p-treetable-mask p-overlay-mask",loadingIcon:"p-treetable-loading-icon",header:"p-treetable-header",paginator:({instance:t})=>"p-treetable-paginator-"+t.paginatorPosition,tableContainer:"p-treetable-table-container",table:({instance:t})=>({"p-treetable-table":!0,"p-treetable-scrollable-table":t.scrollable,"p-treetable-resizable-table":t.resizableColumns,"p-treetable-resizable-table-fit":t.resizableColumns&&t.columnResizeMode==="fit"}),thead:"p-treetable-thead",headerCell:({instance:t})=>({"p-treetable-header-cell":!0,"p-treetable-sortable-column":t.sortable,"p-treetable-resizable-column":t.resizableColumns,"p-treetable-column-sorted":t?.sorted,"p-treetable-frozen-column":t.columnProp("frozen")}),columnResizer:"p-treetable-column-resizer",columnHeaderContent:"p-treetable-column-header-content",columnTitle:"p-treetable-column-title",sortIcon:"p-treetable-sort-icon",pcSortBadge:"p-treetable-sort-badge",tbody:"p-treetable-tbody",row:({instance:t})=>({"p-treetable-row-selected":t.selected}),bodyCell:({instance:t})=>({"p-treetable-frozen-column":t.columnProp("frozen")}),bodyCellContent:({instance:t})=>({"p-treetable-body-cell-content":!0,"p-treetable-body-cell-content-expander":t.columnProp("expander")}),toggler:"p-treetable-body-cell-content-expander",nodeToggleButton:"p-treetable-node-toggle-button",nodeToggleIcon:"p-treetable-node-toggle-icon",pcNodeCheckbox:"p-treetable-node-checkbox",emptyMessage:"p-treetable-empty-message",tfoot:"p-treetable-tfoot",footerCell:({instance:t})=>({"p-treetable-frozen-column":t.columnProp("frozen")}),footer:"p-treetable-footer",columnResizeIndicator:"p-treetable-column-resize-indicator"},Ch={tableContainer:{overflow:"auto"},thead:{position:"sticky"},tfoot:{position:"sticky"}},wr=(()=>{class t extends zo{name="treetable";theme=wh;classes=Th;inlineStyles=Ch;static \u0275fac=(()=>{let e;return function(s){return(e||(e=Ei(t)))(s||t)}})();static \u0275prov=ve({token:t,factory:t.\u0275fac})}return t})();var Gn=(()=>{class t{sortSource=new Lt;selectionSource=new Lt;contextMenuSource=new Lt;uiUpdateSource=new Lt;totalRecordsSource=new Lt;sortSource$=this.sortSource.asObservable();selectionSource$=this.selectionSource.asObservable();contextMenuSource$=this.contextMenuSource.asObservable();uiUpdateSource$=this.uiUpdateSource.asObservable();totalRecordsSource$=this.totalRecordsSource.asObservable();onSort(e){this.sortSource.next(e)}onSelectionChange(){this.selectionSource.next(null)}onContextMenu(e){this.contextMenuSource.next(e)}onUIUpdate(e){this.uiUpdateSource.next(e)}onTotalRecordsChange(e){this.totalRecordsSource.next(e)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=ve({token:t,factory:t.\u0275fac})}return t})(),Xn=(()=>{class t extends Wn{_componentStyle=de(wr);columns;style;styleClass;tableStyle;tableStyleClass;autoLayout;lazy=!1;lazyLoadOnInit=!0;paginator;rows;first=0;pageLinks=5;rowsPerPageOptions;alwaysShowPaginator=!0;paginatorPosition="bottom";paginatorStyleClass;paginatorDropdownAppendTo;currentPageReportTemplate="{currentPage} of {totalPages}";showCurrentPageReport;showJumpToPageDropdown;showFirstLastIcon=!0;showPageLinks=!0;defaultSortOrder=1;sortMode="single";resetPageOnSort=!0;customSort;selectionMode;contextMenuSelection;contextMenuSelectionMode="separate";dataKey;metaKeySelection=!1;compareSelectionBy="deepEquals";rowHover;loading;loadingIcon;showLoader=!0;scrollable;scrollHeight;virtualScroll;virtualScrollItemSize;virtualScrollOptions;virtualScrollDelay=150;frozenWidth;frozenColumns;resizableColumns;columnResizeMode="fit";reorderableColumns;contextMenu;rowTrackBy=(e,i)=>i;filters={};globalFilterFields;filterDelay=300;filterMode="lenient";filterLocale;paginatorLocale;get totalRecords(){return this._totalRecords}set totalRecords(e){this._totalRecords=e,this.tableService.onTotalRecordsChange(this._totalRecords)}get sortField(){return this._sortField}set sortField(e){this._sortField=e}get sortOrder(){return this._sortOrder}set sortOrder(e){this._sortOrder=e}get multiSortMeta(){return this._multiSortMeta}set multiSortMeta(e){this._multiSortMeta=e}get selection(){return this._selection}set selection(e){this._selection=e}get value(){return this._value}set value(e){this._value=e}get virtualRowHeight(){return this._virtualRowHeight}set virtualRowHeight(e){this._virtualRowHeight=e,console.log("The virtualRowHeight property is deprecated, use virtualScrollItemSize property instead.")}get selectionKeys(){return this._selectionKeys}set selectionKeys(e){this._selectionKeys=e,this.selectionKeysChange.emit(this._selectionKeys)}showGridlines=!1;selectionChange=new H;contextMenuSelectionChange=new H;onFilter=new H;onNodeExpand=new H;onNodeCollapse=new H;onPage=new H;onSort=new H;onLazyLoad=new H;sortFunction=new H;onColResize=new H;onColReorder=new H;onNodeSelect=new H;onNodeUnselect=new H;onContextMenuSelect=new H;onHeaderCheckboxToggle=new H;onEditInit=new H;onEditComplete=new H;onEditCancel=new H;selectionKeysChange=new H;containerViewChild;resizeHelperViewChild;reorderIndicatorUpViewChild;reorderIndicatorDownViewChild;tableViewChild;scrollableViewChild;scrollableFrozenViewChild;_value=[];_virtualRowHeight=28;_selectionKeys;serializedValue;_totalRecords=0;_multiSortMeta;_sortField;_sortOrder=1;filteredNodes;filterTimeout;_colGroupTemplate;colGroupTemplate;_captionTemplate;captionTemplate;_headerTemplate;headerTemplate;_bodyTemplate;bodyTemplate;_footerTemplate;footerTemplate;_summaryTemplate;summaryTemplate;_emptyMessageTemplate;emptyMessageTemplate;_paginatorLeftTemplate;paginatorLeftTemplate;_paginatorRightTemplate;paginatorRightTemplate;_paginatorDropdownItemTemplate;paginatorDropdownItemTemplate;_frozenHeaderTemplate;frozenHeaderTemplate;_frozenBodyTemplate;frozenBodyTemplate;_frozenFooterTemplate;frozenFooterTemplate;_frozenColGroupTemplate;frozenColGroupTemplate;_loadingIconTemplate;loadingIconTemplate;_reorderIndicatorUpIconTemplate;reorderIndicatorUpIconTemplate;_reorderIndicatorDownIconTemplate;reorderIndicatorDownIconTemplate;_sortIconTemplate;sortIconTemplate;_checkboxIconTemplate;checkboxIconTemplate;_headerCheckboxIconTemplate;headerCheckboxIconTemplate;_togglerIconTemplate;togglerIconTemplate;_paginatorFirstPageLinkIconTemplate;paginatorFirstPageLinkIconTemplate;_paginatorLastPageLinkIconTemplate;paginatorLastPageLinkIconTemplate;_paginatorPreviousPageLinkIconTemplate;paginatorPreviousPageLinkIconTemplate;_paginatorNextPageLinkIconTemplate;paginatorNextPageLinkIconTemplate;_loaderTemplate;loaderTemplate;lastResizerHelperX;reorderIconWidth;reorderIconHeight;draggedColumn;dropPosition;preventSelectionSetterPropagation;_selection;selectedKeys={};rowTouched;editingCell;editingCellData;editingCellField;editingCellClick;documentEditListener;initialized;toggleRowIndex;ngOnInit(){super.ngOnInit(),this.lazy&&this.lazyLoadOnInit&&!this.virtualScroll&&this.onLazyLoad.emit(this.createLazyLoadMetadata()),this.initialized=!0}templates;ngAfterContentInit(){this.templates.forEach(e=>{switch(e.getType()){case"caption":this.captionTemplate=e.template;break;case"header":this.headerTemplate=e.template;break;case"body":this.bodyTemplate=e.template;break;case"footer":this.footerTemplate=e.template;break;case"summary":this.summaryTemplate=e.template;break;case"colgroup":this.colGroupTemplate=e.template;break;case"emptymessage":this.emptyMessageTemplate=e.template;break;case"paginatorleft":this.paginatorLeftTemplate=e.template;break;case"paginatorright":this.paginatorRightTemplate=e.template;break;case"paginatordropdownitem":this.paginatorDropdownItemTemplate=e.template;break;case"frozenheader":this.frozenHeaderTemplate=e.template;break;case"frozenbody":this.frozenBodyTemplate=e.template;break;case"frozenfooter":this.frozenFooterTemplate=e.template;break;case"frozencolgroup":this.frozenColGroupTemplate=e.template;break;case"loadingicon":this.loadingIconTemplate=e.template;break;case"reorderindicatorupicon":this.reorderIndicatorUpIconTemplate=e.template;break;case"reorderindicatordownicon":this.reorderIndicatorDownIconTemplate=e.template;break;case"sorticon":this.sortIconTemplate=e.template;break;case"checkboxicon":this.checkboxIconTemplate=e.template;break;case"headercheckboxicon":this.headerCheckboxIconTemplate=e.template;break;case"togglericon":this.togglerIconTemplate=e.template;break;case"paginatorfirstpagelinkicon":this.paginatorFirstPageLinkIconTemplate=e.template;break;case"paginatorlastpagelinkicon":this.paginatorLastPageLinkIconTemplate=e.template;break;case"paginatorpreviouspagelinkicon":this.paginatorPreviousPageLinkIconTemplate=e.template;break;case"paginatornextpagelinkicon":this.paginatorNextPageLinkIconTemplate=e.template;break;case"loader":this.loaderTemplate=e.template;break}})}filterService=de(Ro);tableService=de(Gn);zone=de(Ne);ngOnChanges(e){super.ngOnChanges(e),e.value&&(this._value=e.value.currentValue,this.lazy||(this.totalRecords=this._value?this._value.length:0,this.sortMode=="single"&&this.sortField?this.sortSingle():this.sortMode=="multiple"&&this.multiSortMeta?this.sortMultiple():this.hasFilter()&&this._filter()),this.updateSerializedValue(),this.tableService.onUIUpdate(this.value)),e.sortField&&(this._sortField=e.sortField.currentValue,(!this.lazy||this.initialized)&&this.sortMode==="single"&&this.sortSingle()),e.sortOrder&&(this._sortOrder=e.sortOrder.currentValue,(!this.lazy||this.initialized)&&this.sortMode==="single"&&this.sortSingle()),e.multiSortMeta&&(this._multiSortMeta=e.multiSortMeta.currentValue,this.sortMode==="multiple"&&this.sortMultiple()),e.selection&&(this._selection=e.selection.currentValue,this.preventSelectionSetterPropagation||(this.updateselectedKeys(),this.tableService.onSelectionChange()),this.preventSelectionSetterPropagation=!1)}updateSerializedValue(){this.serializedValue=[],this.paginator?this.serializePageNodes():this.serializeNodes(null,this.filteredNodes||this.value,0,!0)}serializeNodes(e,i,s,o){if(i&&i.length)for(let r of i){r.parent=e;let a={node:r,parent:e,level:s,visible:o&&(e?e.expanded:!0)};this.serializedValue.push(a),a.visible&&r.expanded&&this.serializeNodes(r,r.children,s+1,a.visible)}}serializePageNodes(){let e=this.filteredNodes||this.value;if(this.serializedValue=[],e&&e.length){let i=this.lazy?0:this.first;for(let s=i;s<i+this.rows;s++){let o=e[s];o&&(this.serializedValue.push({node:o,parent:null,level:0,visible:!0}),this.serializeNodes(o,o.children,1,!0))}}}updateselectedKeys(){if(this.dataKey&&this._selection)if(this.selectedKeys={},Array.isArray(this._selection))for(let e of this._selection)this.selectedKeys[String(ge(e.data,this.dataKey))]=1;else this.selectedKeys[String(ge(this._selection.data,this.dataKey))]=1}onPageChange(e){this.first=e.first,this.rows=e.rows,this.lazy?this.onLazyLoad.emit(this.createLazyLoadMetadata()):this.serializePageNodes(),this.onPage.emit({first:this.first,rows:this.rows}),this.tableService.onUIUpdate(this.value),this.scrollable&&this.resetScrollTop()}sort(e){let i=e.originalEvent;if(this.sortMode==="single"&&(this._sortOrder=this.sortField===e.field?this.sortOrder*-1:this.defaultSortOrder,this._sortField=e.field,this.sortSingle(),this.resetPageOnSort&&this.scrollable&&this.resetScrollTop()),this.sortMode==="multiple"){let s=i.metaKey||i.ctrlKey,o=this.getSortMeta(e.field);o?s?o.order=o.order*-1:(this._multiSortMeta=[{field:e.field,order:o.order*-1}],this.resetPageOnSort&&this.scrollable&&this.resetScrollTop()):((!s||!this.multiSortMeta)&&(this._multiSortMeta=[],this.resetPageOnSort&&this.scrollable&&this.resetScrollTop()),this.multiSortMeta.push({field:e.field,order:this.defaultSortOrder})),this.sortMultiple()}}sortSingle(){if(this.sortField&&this.sortOrder){this.lazy?this.onLazyLoad.emit(this.createLazyLoadMetadata()):this.value&&(this.sortNodes(this.value),this.hasFilter()&&this._filter());let e={field:this.sortField,order:this.sortOrder};this.onSort.emit(e),this.tableService.onSort(e),this.updateSerializedValue()}}sortNodes(e){if(!(!e||e.length===0)){this.customSort?this.sortFunction.emit({data:e,mode:this.sortMode,field:this.sortField,order:this.sortOrder}):e.sort((i,s)=>{let o=ge(i.data,this.sortField),r=ge(s.data,this.sortField),a=null;return o==null&&r!=null?a=-1:o!=null&&r==null?a=1:o==null&&r==null?a=0:typeof o=="string"&&typeof r=="string"?a=o.localeCompare(r,void 0,{numeric:!0}):a=o<r?-1:o>r?1:0,this.sortOrder*a});for(let i of e)this.sortNodes(i.children)}}sortMultiple(){this.multiSortMeta&&(this.lazy?this.onLazyLoad.emit(this.createLazyLoadMetadata()):this.value&&(this.sortMultipleNodes(this.value),this.hasFilter()&&this._filter()),this.onSort.emit({multisortmeta:this.multiSortMeta}),this.updateSerializedValue(),this.tableService.onSort(this.multiSortMeta))}sortMultipleNodes(e){if(!(!e||e.length===0)){this.customSort?this.sortFunction.emit({data:this.value,mode:this.sortMode,multiSortMeta:this.multiSortMeta}):e.sort((i,s)=>this.multisortField(i,s,this.multiSortMeta,0));for(let i of e)this.sortMultipleNodes(i.children)}}multisortField(e,i,s,o){if(Hn(this.multiSortMeta)||Hn(s[o]))return 0;let r=ge(e.data,s[o].field),a=ge(i.data,s[o].field),l=null;if(r==null&&a!=null?l=-1:r!=null&&a==null?l=1:r==null&&a==null&&(l=0),typeof r=="string"||r instanceof String){if(r.localeCompare&&r!=a)return s[o].order*r.localeCompare(a,void 0,{numeric:!0})}else l=r<a?-1:1;return r==a?s.length-1>o?this.multisortField(e,i,s,o+1):0:s[o].order*l}getSortMeta(e){if(this.multiSortMeta&&this.multiSortMeta.length){for(let i=0;i<this.multiSortMeta.length;i++)if(this.multiSortMeta[i].field===e)return this.multiSortMeta[i]}return null}isSorted(e){if(this.sortMode==="single")return this.sortField&&this.sortField===e;if(this.sortMode==="multiple"){let i=!1;if(this.multiSortMeta){for(let s=0;s<this.multiSortMeta.length;s++)if(this.multiSortMeta[s].field==e){i=!0;break}}return i}}createLazyLoadMetadata(){return{first:this.first,rows:this.rows,sortField:this.sortField,sortOrder:this.sortOrder,filters:this.filters,globalFilter:this.filters&&this.filters.global?this.filters.global.value:null,multiSortMeta:this.multiSortMeta,forceUpdate:()=>this.cd.detectChanges()}}onLazyItemLoad(e){this.onLazyLoad.emit(Pt(Ee(Ee({},this.createLazyLoadMetadata()),e),{rows:e.last-e.first}))}resetScrollTop(){this.virtualScroll?this.scrollToVirtualIndex(0):this.scrollTo({top:0})}scrollToVirtualIndex(e){this.scrollableViewChild&&this.scrollableViewChild.scrollToVirtualIndex(e),this.scrollableFrozenViewChild&&this.scrollableViewChild.scrollToVirtualIndex(e)}scrollTo(e){this.scrollableViewChild&&this.scrollableViewChild.scrollTo(e),this.scrollableFrozenViewChild&&this.scrollableViewChild.scrollTo(e)}isEmpty(){let e=this.filteredNodes||this.value;return e==null||e.length==0}getBlockableElement(){return this.el.nativeElement.children[0]}onColumnResizeBegin(e){let i=oi(this.containerViewChild?.nativeElement).left;this.lastResizerHelperX=e.pageX-i+this.containerViewChild?.nativeElement.scrollLeft,e.preventDefault()}onColumnResize(e){let i=oi(this.containerViewChild?.nativeElement).left;si(this.containerViewChild?.nativeElement,"p-unselectable-text"),this.resizeHelperViewChild.nativeElement.style.height=this.containerViewChild?.nativeElement.offsetHeight+"px",this.resizeHelperViewChild.nativeElement.style.top="0px",this.resizeHelperViewChild.nativeElement.style.left=e.pageX-i+this.containerViewChild?.nativeElement.scrollLeft+"px",this.resizeHelperViewChild.nativeElement.style.display="block"}onColumnResizeEnd(e,i){let s=this.resizeHelperViewChild.nativeElement.offsetLeft-this.lastResizerHelperX,o=i.offsetWidth,r=o+s,a=i.style.minWidth||15;if(o+s>parseInt(a)){if(this.columnResizeMode==="fit"){let l=i.nextElementSibling;for(;!l.offsetParent;)l=l.nextElementSibling;if(l){let c=l.offsetWidth-s,d=l.style.minWidth||15;if(r>15&&c>parseInt(d))if(this.scrollable){let h=this.findParentScrollableView(i),u=pe(h,".p-treetable-scrollable-body table")||pe(h,".p-scroller-viewport table"),f=pe(h,"table.p-treetable-scrollable-header-table"),g=pe(h,"table.p-treetable-scrollable-footer-table"),p=Bn(i);this.resizeColGroup(f,p,r,c),this.resizeColGroup(u,p,r,c),this.resizeColGroup(g,p,r,c)}else i.style.width=r+"px",l&&(l.style.width=c+"px")}}else if(this.columnResizeMode==="expand")if(this.scrollable){let l=this.findParentScrollableView(i),c=pe(l,".p-treetable-scrollable-body")||pe(l,".p-scroller-viewport"),d=pe(l,".p-treetable-scrollable-header"),h=pe(l,".p-treetable-scrollable-footer"),u=pe(l,".p-treetable-scrollable-body table")||pe(l,".p-scroller-viewport table"),f=pe(l,"table.p-treetable-scrollable-header-table"),g=pe(l,"table.p-treetable-scrollable-footer-table");u.style.width=u.offsetWidth+s+"px",f.style.width=f.offsetWidth+s+"px",g&&(g.style.width=g.offsetWidth+s+"px");let p=Bn(i),m=i?u.offsetWidth+s:r,b=i?f.offsetWidth+s:r,_=this.containerViewChild?.nativeElement.offsetWidth>=m,x=(w,y,v,k)=>{w&&y&&(w.style.width=k?v+Nn(c)+"px":"auto",y.style.width=v+"px")};x(c,u,m,_),x(d,f,b,_),x(h,g,b,_),this.resizeColGroup(f,p,r,null),this.resizeColGroup(u,p,r,null),this.resizeColGroup(g,p,r,null)}else{this.tableViewChild.nativeElement.style.width=this.tableViewChild?.nativeElement.offsetWidth+s+"px",i.style.width=r+"px";let l=this.tableViewChild?.nativeElement.style.width;this.containerViewChild.nativeElement.style.width=l+"px"}this.onColResize.emit({element:i,delta:s})}this.resizeHelperViewChild.nativeElement.style.display="none",Ft(this.containerViewChild?.nativeElement,"p-unselectable-text")}findParentScrollableView(e){if(e){let i=e.parentElement;for(;i&&!Vn(i,"p-treetable-scrollable-view");)i=i.parentElement;return i}else return null}resizeColGroup(e,i,s,o){if(e){let r=e.children[0].nodeName==="COLGROUP"?e.children[0]:null;if(r){let a=r.children[i],l=a.nextElementSibling;a.style.width=s+"px",l&&o&&(l.style.width=o+"px")}else throw"Scrollable tables require a colgroup to support resizable columns"}}onColumnDragStart(e,i){this.reorderIconWidth=Lo(this.reorderIndicatorUpViewChild?.nativeElement),this.reorderIconHeight=Po(this.reorderIndicatorDownViewChild?.nativeElement),this.draggedColumn=i,e.dataTransfer.setData("text","b")}onColumnDragEnter(e,i){if(this.reorderableColumns&&this.draggedColumn&&i){e.preventDefault();let s=oi(this.containerViewChild?.nativeElement),o=oi(i);if(this.draggedColumn!=i){let r=o.left-s.left,a=s.top-o.top,l=o.left+i.offsetWidth/2;this.reorderIndicatorUpViewChild.nativeElement.style.top=o.top-s.top-(this.reorderIconHeight-1)+"px",this.reorderIndicatorDownViewChild.nativeElement.style.top=o.top-s.top+i.offsetHeight+"px",e.pageX>l?(this.reorderIndicatorUpViewChild.nativeElement.style.left=r+i.offsetWidth-Math.ceil(this.reorderIconWidth/2)+"px",this.reorderIndicatorDownViewChild.nativeElement.style.left=r+i.offsetWidth-Math.ceil(this.reorderIconWidth/2)+"px",this.dropPosition=1):(this.reorderIndicatorUpViewChild.nativeElement.style.left=r-Math.ceil(this.reorderIconWidth/2)+"px",this.reorderIndicatorDownViewChild.nativeElement.style.left=r-Math.ceil(this.reorderIconWidth/2)+"px",this.dropPosition=-1),this.reorderIndicatorUpViewChild.nativeElement.style.display="block",this.reorderIndicatorDownViewChild.nativeElement.style.display="block"}else e.dataTransfer.dropEffect="none"}}onColumnDragLeave(e){this.reorderableColumns&&this.draggedColumn&&(e.preventDefault(),this.reorderIndicatorUpViewChild.nativeElement.style.display="none",this.reorderIndicatorDownViewChild.nativeElement.style.display="none")}onColumnDrop(e,i){if(e.preventDefault(),this.draggedColumn){let s=ri.indexWithinGroup(this.draggedColumn,"ttreorderablecolumn"),o=ri.indexWithinGroup(i,"ttreorderablecolumn"),r=s!=o;r&&(o-s==1&&this.dropPosition===-1||s-o==1&&this.dropPosition===1)&&(r=!1),r&&o<s&&this.dropPosition===1&&(o=o+1),r&&o>s&&this.dropPosition===-1&&(o=o-1),r&&(Oo(this.columns,s,o),this.onColReorder.emit({dragIndex:s,dropIndex:o,columns:this.columns})),this.reorderIndicatorUpViewChild.nativeElement.style.display="none",this.reorderIndicatorDownViewChild.nativeElement.style.display="none",this.draggedColumn.draggable=!1,this.draggedColumn=null,this.dropPosition=null}}handleRowClick(e){let i=e.originalEvent.target.nodeName;if(!(i=="INPUT"||i=="BUTTON"||i=="A"||Vn(e.originalEvent.target,"p-clickable"))){if(this.selectionMode){this.preventSelectionSetterPropagation=!0;let s=e.rowNode,o=this.isSelected(s.node),r=this.rowTouched?!1:this.metaKeySelection,a=this.dataKey?String(ge(s.node.data,this.dataKey)):null;if(r){let l=e.originalEvent,c=l.metaKey||l.ctrlKey;if(o&&c){if(this.isSingleSelectionMode())this._selection=null,this.selectedKeys={},this.selectionChange.emit(null);else{let d=this.findIndexInSelection(s.node);this._selection=this.selection.filter((h,u)=>u!=d),this.selectionChange.emit(this.selection),a&&delete this.selectedKeys[a]}this.onNodeUnselect.emit({originalEvent:e.originalEvent,node:s.node,type:"row"})}else this.isSingleSelectionMode()?(this._selection=s.node,this.selectionChange.emit(s.node),a&&(this.selectedKeys={},this.selectedKeys[a]=1)):this.isMultipleSelectionMode()&&(c?this._selection=this.selection||[]:(this._selection=[],this.selectedKeys={}),this._selection=[...this.selection,s.node],this.selectionChange.emit(this.selection),a&&(this.selectedKeys[a]=1)),this.onNodeSelect.emit({originalEvent:e.originalEvent,node:s.node,type:"row",index:e.rowIndex})}else if(this.selectionMode==="single")o?(this._selection=null,this.selectedKeys={},this.selectionChange.emit(this.selection),this.onNodeUnselect.emit({originalEvent:e.originalEvent,node:s.node,type:"row"})):(this._selection=s.node,this.selectionChange.emit(this.selection),this.onNodeSelect.emit({originalEvent:e.originalEvent,node:s.node,type:"row",index:e.rowIndex}),a&&(this.selectedKeys={},this.selectedKeys[a]=1));else if(this.selectionMode==="multiple")if(o){let l=this.findIndexInSelection(s.node);this._selection=this.selection.filter((c,d)=>d!=l),this.selectionChange.emit(this.selection),this.onNodeUnselect.emit({originalEvent:e.originalEvent,node:s.node,type:"row"}),a&&delete this.selectedKeys[a]}else this._selection=this.selection?[...this.selection,s.node]:[s.node],this.selectionChange.emit(this.selection),this.onNodeSelect.emit({originalEvent:e.originalEvent,node:s.node,type:"row",index:e.rowIndex}),a&&(this.selectedKeys[a]=1);this.tableService.onSelectionChange()}this.rowTouched=!1}}handleRowTouchEnd(e){this.rowTouched=!0}handleRowRightClick(e){if(this.contextMenu){let i=e.rowNode.node;if(this.contextMenuSelectionMode==="separate")this.contextMenuSelection=i,this.contextMenuSelectionChange.emit(i),this.onContextMenuSelect.emit({originalEvent:e.originalEvent,node:i}),this.contextMenu.show(e.originalEvent),this.tableService.onContextMenu(i);else if(this.contextMenuSelectionMode==="joint"){this.preventSelectionSetterPropagation=!0;let s=this.isSelected(i),o=this.dataKey?String(ge(i.data,this.dataKey)):null;s||(this.isSingleSelectionMode()?(this.selection=i,this.selectionChange.emit(i)):this.isMultipleSelectionMode()&&(this.selection=[i],this.selectionChange.emit(this.selection)),o&&(this.selectedKeys[o]=1)),this.contextMenu.show(e.originalEvent),this.onContextMenuSelect.emit({originalEvent:e.originalEvent,node:i})}}}toggleNodeWithCheckbox(e){this.selection=this.selection||[],this.preventSelectionSetterPropagation=!0;let i=e.rowNode.node;this.isSelected(i)?(this.propagateSelectionDown(i,!1),e.rowNode.parent&&this.propagateSelectionUp(i.parent,!1),this.selectionChange.emit(this.selection),this.onNodeUnselect.emit({originalEvent:e,node:i})):(this.propagateSelectionDown(i,!0),e.rowNode.parent&&this.propagateSelectionUp(i.parent,!0),this.selectionChange.emit(this.selection),this.onNodeSelect.emit({originalEvent:e,node:i})),this.tableService.onSelectionChange()}toggleNodesWithCheckbox(e,i){let s=this.filteredNodes||this.value;this._selection=i&&s?s.slice():[],this.toggleAll(i),i||(this._selection=[],this.selectedKeys={}),this.preventSelectionSetterPropagation=!0,this.selectionChange.emit(this._selection),this.tableService.onSelectionChange(),this.onHeaderCheckboxToggle.emit({originalEvent:e,checked:i})}toggleAll(e){let i=this.filteredNodes||this.value;if(this.selectionKeys){if(i&&i.length){for(let s of i)this.propagateDown(s,e);this.selectionKeysChange.emit(this.selectionKeys)}}else if(i&&i.length)for(let s of i)this.propagateSelectionDown(s,e)}propagateSelectionUp(e,i){if(e.children&&e.children.length){let o=0,r=!1,a=this.dataKey?String(ge(e.data,this.dataKey)):null;for(let l of e.children)this.isSelected(l)?o++:l.partialSelected&&(r=!0);if(i&&o==e.children.length)this._selection=[...this.selection||[],e],e.partialSelected=!1,a&&(this.selectedKeys[a]=1);else{if(!i){let l=this.findIndexInSelection(e);l>=0&&(this._selection=this.selection.filter((c,d)=>d!=l),a&&delete this.selectedKeys[a])}r||o>0&&o!=e.children.length?e.partialSelected=!0:e.partialSelected=!1}}let s=e.parent;e.checked=i,s&&this.propagateSelectionUp(s,i)}propagateSelectionDown(e,i){let s=this.findIndexInSelection(e),o=this.dataKey?String(ge(e.data,this.dataKey)):null;if(i&&s==-1?(this._selection=[...this.selection||[],e],o&&(this.selectedKeys[o]=1)):!i&&s>-1&&(this._selection=this.selection.filter((r,a)=>a!=s),o&&delete this.selectedKeys[o]),e.partialSelected=!1,e.checked=i,e.children&&e.children.length)for(let r of e.children)this.propagateSelectionDown(r,i)}isSelected(e){return e&&this.selection?this.dataKey?e.hasOwnProperty("checked")?e.checked:this.selectedKeys[ge(e.data,this.dataKey)]!==void 0:Array.isArray(this.selection)?this.findIndexInSelection(e)>-1:this.equals(e,this.selection):!1}isNodeSelected(e){return this.selectionMode&&this.selectionKeys?this.selectionKeys[this.nodeKey(e)]?.checked===!0:!1}isNodePartialSelected(e){return this.selectionMode&&this.selectionKeys?this.selectionKeys[this.nodeKey(e)]?.partialChecked===!0:!1}nodeKey(e){return ge(e,this.dataKey)||ge(e?.data,this.dataKey)}toggleCheckbox(e){let{rowNode:i,check:s,originalEvent:o}=e,r=i.node;this.selectionKeys?(this.propagateDown(r,s),r.parent&&this.propagateUp(r.parent,s),this.selectionKeysChange.emit(this.selectionKeys)):this.toggleNodeWithCheckbox({originalEvent:o,rowNode:i}),this.tableService.onSelectionChange()}propagateDown(e,i){if(i?this.selectionKeys[this.nodeKey(e)]={checked:!0,partialChecked:!1}:delete this.selectionKeys[this.nodeKey(e)],e.children&&e.children.length)for(let s of e.children)this.propagateDown(s,i)}propagateUp(e,i){let s=0,o=!1;for(let a of e.children)this.selectionKeys[this.nodeKey(a)]&&this.selectionKeys[this.nodeKey(a)].checked?s++:this.selectionKeys[this.nodeKey(a)]&&this.selectionKeys[this.nodeKey(a)].partialChecked&&(o=!0);i&&s===e.children.length?this.selectionKeys[this.nodeKey(e)]={checked:!0,partialChecked:!1}:(i||delete this.selectionKeys[this.nodeKey(e)],o||s>0&&s!==e.children.length?this.selectionKeys[this.nodeKey(e)]={checked:!1,partialChecked:!0}:this.selectionKeys[this.nodeKey(e)]={checked:!1,partialChecked:!1});let r=e.parent;r&&this.propagateUp(r,i)}findIndexInSelection(e){let i=-1;if(this.selection&&this.selection.length){for(let s=0;s<this.selection.length;s++)if(this.equals(e,this.selection[s])){i=s;break}}return i}isSingleSelectionMode(){return this.selectionMode==="single"}isMultipleSelectionMode(){return this.selectionMode==="multiple"}equals(e,i){return this.compareSelectionBy==="equals"?jn(e,i):jn(e.data,i.data,this.dataKey)}filter(e,i,s){this.filterTimeout&&clearTimeout(this.filterTimeout),this.isFilterBlank(e)?this.filters[i]&&delete this.filters[i]:this.filters[i]={value:e,matchMode:s},this.filterTimeout=setTimeout(()=>{this._filter(),this.filterTimeout=null},this.filterDelay)}filterGlobal(e,i){this.filter(e,"global",i)}isFilterBlank(e){return e!=null?!!(typeof e=="string"&&e.trim().length==0||Array.isArray(e)&&e.length==0):!0}_filter(){if(this.lazy)this.onLazyLoad.emit(this.createLazyLoadMetadata());else{if(!this.value)return;if(!this.hasFilter())this.filteredNodes=null,this.paginator&&(this.totalRecords=this.value?this.value.length:0);else{let i;if(this.filters.global){if(!this.columns&&!this.globalFilterFields)throw new Error("Global filtering requires dynamic columns or globalFilterFields to be defined.");i=this.globalFilterFields||this.columns}this.filteredNodes=[];let s=this.filterMode==="strict",o=!1;for(let r of this.value){let a=Ee({},r),l=!0,c=!1,d;for(let u in this.filters)if(this.filters.hasOwnProperty(u)&&u!=="global"){let f=this.filters[u],g=u,p=f.value,m=f.matchMode||"startsWith",b=this.filterService.filters[m];if(d={filterField:g,filterValue:p,filterConstraint:b,isStrictMode:s},(s&&!(this.findFilteredNodes(a,d)||this.isFilterMatched(a,d))||!s&&!(this.isFilterMatched(a,d)||this.findFilteredNodes(a,d)))&&(l=!1),!l)break}if(this.filters.global&&!c&&i){let u=Ee({},a),f,g=this.filters.global.value,p=this.filterService.filters[this.filters.global.matchMode];d={filterField:f,filterValue:g,filterConstraint:p,isStrictMode:s,globalFilterFieldsArray:i},(s&&(this.findFilteredNodes(u,d)||this.isFilterMatched(u,d))||!s&&(this.isFilterMatched(u,d)||this.findFilteredNodes(u,d)))&&(c=!0,a=u)}let h=l;this.filters.global&&(h=l&&c),h&&this.filteredNodes.push(a),o=o||!l||c||l&&this.filteredNodes.length>0||!c&&this.filteredNodes.length===0}o||(this.filteredNodes=null),this.paginator&&(this.totalRecords=this.filteredNodes?this.filteredNodes.length:this.value?this.value.length:0)}this.cd.markForCheck()}this.first=0;let e=this.filteredNodes||this.value;this.onFilter.emit({filters:this.filters,filteredValue:e}),this.tableService.onUIUpdate(e),this.updateSerializedValue(),this.scrollable&&this.resetScrollTop()}findFilteredNodes(e,i){if(e){let s=!1;if(e.children){let o=[...e.children];e.children=[];for(let r of o){let a=Ee({},r);this.isFilterMatched(a,i)&&(s=!0,e.children.push(a))}}if(s)return!0}}isFilterMatched(e,i){let{filterField:s,filterValue:o,filterConstraint:r,isStrictMode:a,globalFilterFieldsArray:l}=i,c=!1,d=h=>r(ge(e.data,h),o,this.filterLocale);return c=l?.length?l.some(h=>d(h.field||h)):d(s),(!c||a&&!this.isNodeLeaf(e))&&(c=this.findFilteredNodes(e,{filterField:s,filterValue:o,filterConstraint:r,isStrictMode:a,globalFilterFieldsArray:l})||c),c}isNodeLeaf(e){return e.leaf===!1?!1:!(e.children&&e.children.length)}hasFilter(){let e=!0;for(let i in this.filters)if(this.filters.hasOwnProperty(i)){e=!1;break}return!e}reset(){this._sortField=null,this._sortOrder=1,this._multiSortMeta=null,this.tableService.onSort(null),this.filteredNodes=null,this.filters={},this.first=0,this.lazy?this.onLazyLoad.emit(this.createLazyLoadMetadata()):this.totalRecords=this._value?this._value.length:0}updateEditingCell(e,i,s){this.editingCell=e,this.editingCellData=i,this.editingCellField=s,this.bindDocumentEditListener()}isEditingCellValid(){return this.editingCell&&Io(this.editingCell,".ng-invalid.ng-dirty").length===0}bindDocumentEditListener(){this.documentEditListener||(this.documentEditListener=this.renderer.listen(this.document,"click",e=>{this.editingCell&&!this.editingCellClick&&this.isEditingCellValid()&&(Ft(this.editingCell,"p-cell-editing"),this.editingCell=null,this.onEditComplete.emit({field:this.editingCellField,data:this.editingCellData}),this.editingCellField=null,this.editingCellData=null,this.unbindDocumentEditListener()),this.editingCellClick=!1}))}unbindDocumentEditListener(){this.documentEditListener&&(this.documentEditListener(),this.documentEditListener=null)}ngOnDestroy(){this.unbindDocumentEditListener(),this.editingCell=null,this.editingCellField=null,this.editingCellData=null,this.initialized=null,super.ngOnDestroy()}static \u0275fac=(()=>{let e;return function(s){return(e||(e=Ei(t)))(s||t)}})();static \u0275cmp=Be({type:t,selectors:[["p-treeTable"],["p-treetable"],["p-tree-table"]],contentQueries:function(i,s,o){if(i&1&&($(o,Zl,4),$(o,ec,4),$(o,tc,4),$(o,ic,4),$(o,nc,4),$(o,sc,4),$(o,oc,4),$(o,rc,4),$(o,ac,4),$(o,lc,4),$(o,cc,4),$(o,dc,4),$(o,hc,4),$(o,uc,4),$(o,fc,4),$(o,pc,4),$(o,gc,4),$(o,mc,4),$(o,bc,4),$(o,_c,4),$(o,yc,4),$(o,xc,4),$(o,vc,4),$(o,wc,4),$(o,Tc,4),$(o,Cc,4),$(o,Fi,4)),i&2){let r;P(r=L())&&(s._colGroupTemplate=r.first),P(r=L())&&(s._captionTemplate=r.first),P(r=L())&&(s._headerTemplate=r.first),P(r=L())&&(s._bodyTemplate=r.first),P(r=L())&&(s._footerTemplate=r.first),P(r=L())&&(s._summaryTemplate=r.first),P(r=L())&&(s._emptyMessageTemplate=r.first),P(r=L())&&(s._paginatorLeftTemplate=r.first),P(r=L())&&(s._paginatorRightTemplate=r.first),P(r=L())&&(s._paginatorDropdownItemTemplate=r.first),P(r=L())&&(s._frozenHeaderTemplate=r.first),P(r=L())&&(s._frozenBodyTemplate=r.first),P(r=L())&&(s._frozenFooterTemplate=r.first),P(r=L())&&(s._frozenColGroupTemplate=r.first),P(r=L())&&(s._loadingIconTemplate=r.first),P(r=L())&&(s._reorderIndicatorUpIconTemplate=r.first),P(r=L())&&(s._reorderIndicatorDownIconTemplate=r.first),P(r=L())&&(s._sortIconTemplate=r.first),P(r=L())&&(s._checkboxIconTemplate=r.first),P(r=L())&&(s._headerCheckboxIconTemplate=r.first),P(r=L())&&(s._togglerIconTemplate=r.first),P(r=L())&&(s._paginatorFirstPageLinkIconTemplate=r.first),P(r=L())&&(s._paginatorLastPageLinkIconTemplate=r.first),P(r=L())&&(s._paginatorPreviousPageLinkIconTemplate=r.first),P(r=L())&&(s._paginatorNextPageLinkIconTemplate=r.first),P(r=L())&&(s._loaderTemplate=r.first),P(r=L())&&(s.templates=r)}},viewQuery:function(i,s){if(i&1&&(oe(Sc,5),oe(kc,5),oe(Mc,5),oe(Dc,5),oe(Ec,5),oe(Ic,5),oe(Pc,5)),i&2){let o;P(o=L())&&(s.containerViewChild=o.first),P(o=L())&&(s.resizeHelperViewChild=o.first),P(o=L())&&(s.reorderIndicatorUpViewChild=o.first),P(o=L())&&(s.reorderIndicatorDownViewChild=o.first),P(o=L())&&(s.tableViewChild=o.first),P(o=L())&&(s.scrollableViewChild=o.first),P(o=L())&&(s.scrollableFrozenViewChild=o.first)}},inputs:{columns:"columns",style:"style",styleClass:"styleClass",tableStyle:"tableStyle",tableStyleClass:"tableStyleClass",autoLayout:[2,"autoLayout","autoLayout",q],lazy:[2,"lazy","lazy",q],lazyLoadOnInit:[2,"lazyLoadOnInit","lazyLoadOnInit",q],paginator:[2,"paginator","paginator",q],rows:[2,"rows","rows",tt],first:[2,"first","first",tt],pageLinks:[2,"pageLinks","pageLinks",tt],rowsPerPageOptions:"rowsPerPageOptions",alwaysShowPaginator:[2,"alwaysShowPaginator","alwaysShowPaginator",q],paginatorPosition:"paginatorPosition",paginatorStyleClass:"paginatorStyleClass",paginatorDropdownAppendTo:"paginatorDropdownAppendTo",currentPageReportTemplate:"currentPageReportTemplate",showCurrentPageReport:[2,"showCurrentPageReport","showCurrentPageReport",q],showJumpToPageDropdown:[2,"showJumpToPageDropdown","showJumpToPageDropdown",q],showFirstLastIcon:[2,"showFirstLastIcon","showFirstLastIcon",q],showPageLinks:[2,"showPageLinks","showPageLinks",q],defaultSortOrder:[2,"defaultSortOrder","defaultSortOrder",tt],sortMode:"sortMode",resetPageOnSort:[2,"resetPageOnSort","resetPageOnSort",q],customSort:[2,"customSort","customSort",q],selectionMode:"selectionMode",contextMenuSelection:"contextMenuSelection",contextMenuSelectionMode:"contextMenuSelectionMode",dataKey:"dataKey",metaKeySelection:[2,"metaKeySelection","metaKeySelection",q],compareSelectionBy:"compareSelectionBy",rowHover:[2,"rowHover","rowHover",q],loading:[2,"loading","loading",q],loadingIcon:"loadingIcon",showLoader:[2,"showLoader","showLoader",q],scrollable:[2,"scrollable","scrollable",q],scrollHeight:"scrollHeight",virtualScroll:[2,"virtualScroll","virtualScroll",q],virtualScrollItemSize:[2,"virtualScrollItemSize","virtualScrollItemSize",tt],virtualScrollOptions:"virtualScrollOptions",virtualScrollDelay:[2,"virtualScrollDelay","virtualScrollDelay",tt],frozenWidth:"frozenWidth",frozenColumns:"frozenColumns",resizableColumns:[2,"resizableColumns","resizableColumns",q],columnResizeMode:"columnResizeMode",reorderableColumns:[2,"reorderableColumns","reorderableColumns",q],contextMenu:"contextMenu",rowTrackBy:"rowTrackBy",filters:"filters",globalFilterFields:"globalFilterFields",filterDelay:[2,"filterDelay","filterDelay",tt],filterMode:"filterMode",filterLocale:"filterLocale",paginatorLocale:"paginatorLocale",totalRecords:"totalRecords",sortField:"sortField",sortOrder:"sortOrder",multiSortMeta:"multiSortMeta",selection:"selection",value:"value",virtualRowHeight:"virtualRowHeight",selectionKeys:"selectionKeys",showGridlines:[2,"showGridlines","showGridlines",q]},outputs:{selectionChange:"selectionChange",contextMenuSelectionChange:"contextMenuSelectionChange",onFilter:"onFilter",onNodeExpand:"onNodeExpand",onNodeCollapse:"onNodeCollapse",onPage:"onPage",onSort:"onSort",onLazyLoad:"onLazyLoad",sortFunction:"sortFunction",onColResize:"onColResize",onColReorder:"onColReorder",onNodeSelect:"onNodeSelect",onNodeUnselect:"onNodeUnselect",onContextMenuSelect:"onContextMenuSelect",onHeaderCheckboxToggle:"onHeaderCheckboxToggle",onEditInit:"onEditInit",onEditComplete:"onEditComplete",onEditCancel:"onEditCancel",selectionKeysChange:"selectionKeysChange"},standalone:!1,features:[vo([Gn,wr]),In,go],decls:12,vars:21,consts:[["container",""],["table",""],["scrollableView",""],["scrollableFrozenView",""],["resizeHelper",""],["reorderIndicatorUp",""],["reorderIndicatorDown",""],["data-scrollselectors",".p-treetable-scrollable-body",3,"ngStyle","ngClass"],["class","p-treetable-loading",4,"ngIf"],["class","p-treetable-header",4,"ngIf"],["styleClass","p-paginator-top",3,"rows","first","totalRecords","pageLinkSize","alwaysShow","rowsPerPageOptions","templateLeft","templateRight","dropdownAppendTo","currentPageReportTemplate","showFirstLastIcon","dropdownItemTemplate","showCurrentPageReport","showJumpToPageDropdown","showPageLinks","styleClass","locale","onPageChange",4,"ngIf"],["class","p-treetable-wrapper",4,"ngIf"],["class","p-treetable-scrollable-wrapper",4,"ngIf"],["styleClass","p-paginator-bottom",3,"rows","first","totalRecords","pageLinkSize","alwaysShow","rowsPerPageOptions","templateLeft","templateRight","dropdownAppendTo","currentPageReportTemplate","showFirstLastIcon","dropdownItemTemplate","showCurrentPageReport","showJumpToPageDropdown","showPageLinks","styleClass","locale","onPageChange",4,"ngIf"],["class","p-treetable-footer",4,"ngIf"],["class","p-column-resizer-helper","style","display:none",4,"ngIf"],["class","p-treetable-reorder-indicator-up","style","display: none;",4,"ngIf"],["class","p-treetable-reorder-indicator-down","style","display: none;",4,"ngIf"],[1,"p-treetable-loading"],[1,"p-overlay-mask","p-treetable-mask"],[3,"class",4,"ngIf"],[4,"ngIf"],[3,"spin","styleClass",4,"ngIf"],["class","p-treetable-loading-icon",4,"ngIf"],[3,"spin","styleClass"],[1,"p-treetable-loading-icon"],[4,"ngTemplateOutlet"],[1,"p-treetable-header"],["styleClass","p-paginator-top",3,"onPageChange","rows","first","totalRecords","pageLinkSize","alwaysShow","rowsPerPageOptions","templateLeft","templateRight","dropdownAppendTo","currentPageReportTemplate","showFirstLastIcon","dropdownItemTemplate","showCurrentPageReport","showJumpToPageDropdown","showPageLinks","styleClass","locale"],["pTemplate","firstpagelinkicon"],["pTemplate","previouspagelinkicon"],["pTemplate","lastpagelinkicon"],["pTemplate","nextpagelinkicon"],[1,"p-treetable-wrapper"],["role","table",3,"ngClass","ngStyle"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["role","rowgroup",1,"p-treetable-thead"],["role","rowgroup",1,"p-treetable-tbody",3,"pTreeTableBody","pTreeTableBodyTemplate"],["role","rowgroup",1,"p-treetable-tfoot"],[1,"p-treetable-scrollable-wrapper"],["class","p-treetable-scrollable-view p-treetable-frozen-view",3,"ttScrollableView","frozen","ngStyle","scrollHeight",4,"ngIf"],[1,"p-treetable-scrollable-view",3,"ttScrollableView","frozen","scrollHeight","ngStyle"],[1,"p-treetable-scrollable-view","p-treetable-frozen-view",3,"ttScrollableView","frozen","ngStyle","scrollHeight"],["styleClass","p-paginator-bottom",3,"onPageChange","rows","first","totalRecords","pageLinkSize","alwaysShow","rowsPerPageOptions","templateLeft","templateRight","dropdownAppendTo","currentPageReportTemplate","showFirstLastIcon","dropdownItemTemplate","showCurrentPageReport","showJumpToPageDropdown","showPageLinks","styleClass","locale"],[1,"p-treetable-footer"],[1,"p-column-resizer-helper",2,"display","none"],[1,"p-treetable-reorder-indicator-up",2,"display","none"],[1,"p-treetable-reorder-indicator-down",2,"display","none"]],template:function(i,s){i&1&&(O(0,"div",7,0),M(2,Hc,4,2,"div",8)(3,Wc,2,1,"div",9)(4,id,5,21,"p-paginator",10)(5,rd,9,16,"div",11)(6,ld,4,8,"div",12)(7,vd,5,21,"p-paginator",13)(8,Td,2,1,"div",14)(9,Cd,2,0,"div",15)(10,Dd,4,2,"span",16)(11,Ld,4,2,"span",17),N()),i&2&&(Oi(s.styleClass),T("ngStyle",s.style)("ngClass",To(14,Lc,s.showGridlines,s.rowHover||s.selectionMode==="single"||s.selectionMode==="multiple",s.autoLayout,s.resizableColumns,s.resizableColumns&&s.columnResizeMode==="fit",s.scrollable&&s.scrollHeight==="flex")),S(2),T("ngIf",s.loading&&s.showLoader),S(),T("ngIf",s.captionTemplate||s._captionTemplate),S(),T("ngIf",s.paginator&&(s.paginatorPosition==="top"||s.paginatorPosition=="both")),S(),T("ngIf",!s.scrollable),S(),T("ngIf",s.scrollable),S(),T("ngIf",s.paginator&&(s.paginatorPosition==="bottom"||s.paginatorPosition=="both")),S(),T("ngIf",s.summaryTemplate||s._summaryTemplate),S(),T("ngIf",s.resizableColumns),S(),T("ngIf",s.reorderableColumns),S(),T("ngIf",s.reorderableColumns))},dependencies:()=>[An,ni,yt,Fn,lr,Fi,Yn,$n,Kn,Sh,Cr],encapsulation:2})}return t})(),Cr=(()=>{class t{tt;treeTableService;cd;columns;template;frozen;serializedNodes;scrollerOptions;subscription;constructor(e,i,s){this.tt=e,this.treeTableService=i,this.cd=s,this.subscription=this.tt.tableService.uiUpdateSource$.subscribe(()=>{this.tt.virtualScroll&&this.cd.detectChanges()})}getScrollerOption(e,i){return this.tt.virtualScroll?(i=i||this.scrollerOptions,i?i[e]:null):null}getRowIndex(e){let i=this.getScrollerOption("getItemOptions");return i?i(e).index:e}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}static \u0275fac=function(i){return new(i||t)(te(Xn),te(Gn),te(Co))};static \u0275cmp=Be({type:t,selectors:[["","pTreeTableBody",""]],inputs:{columns:[0,"pTreeTableBody","columns"],template:[0,"pTreeTableBodyTemplate","template"],frozen:[2,"frozen","frozen",q],serializedNodes:"serializedNodes",scrollerOptions:"scrollerOptions"},standalone:!1,attrs:Od,decls:2,vars:3,consts:[["ngFor","",3,"ngForOf","ngForTrackBy"],[4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(i,s){i&1&&M(0,Vd,1,1,"ng-template",0)(1,Bd,2,5,"ng-container",1),i&2&&(T("ngForOf",s.serializedNodes||s.tt.serializedValue)("ngForTrackBy",s.tt.rowTrackBy),S(),T("ngIf",s.tt.isEmpty()))},dependencies:[ko,ni,yt],encapsulation:2})}return t})(),Sh=(()=>{class t{platformId;renderer;tt;el;zone;columns;frozen;scrollHeaderViewChild;scrollHeaderBoxViewChild;scrollBodyViewChild;scrollTableViewChild;scrollLoadingTableViewChild;scrollFooterViewChild;scrollFooterBoxViewChild;scrollableAlignerViewChild;scroller;headerScrollListener;bodyScrollListener;footerScrollListener;frozenSiblingBody;totalRecordsSubscription;_scrollHeight;preventBodyScrollPropagation;get scrollHeight(){return this._scrollHeight}set scrollHeight(e){this._scrollHeight=e,e!=null&&(e.includes("%")||e.includes("calc"))&&console.log('Percentage scroll height calculation is removed in favor of the more performant CSS based flex mode, use scrollHeight="flex" instead.')}constructor(e,i,s,o,r){this.platformId=e,this.renderer=i,this.tt=s,this.el=o,this.zone=r}ngAfterViewInit(){if(At(this.platformId)){if(this.frozen)this.scrollableAlignerViewChild&&this.scrollableAlignerViewChild.nativeElement&&(this.scrollableAlignerViewChild.nativeElement.style.height=Eo()+"px");else{(this.tt.frozenColumns||this.tt.frozenBodyTemplate||this.tt._frozenBodyTemplate)&&si(this.el.nativeElement,"p-treetable-unfrozen-view");let e=this.el.nativeElement.previousElementSibling;if(e&&(this.tt.virtualScroll?this.frozenSiblingBody=pe(e,".p-scroller-viewport"):this.frozenSiblingBody=pe(e,".p-treetable-scrollable-body")),this.scrollHeight){let i=Nn();this.scrollHeaderBoxViewChild.nativeElement.style.paddingRight=i+"px",this.scrollFooterBoxViewChild&&this.scrollFooterBoxViewChild.nativeElement&&(this.scrollFooterBoxViewChild.nativeElement.style.paddingRight=i+"px")}}this.bindEvents()}}bindEvents(){At(this.platformId)&&this.zone.runOutsideAngular(()=>{this.scrollHeaderViewChild&&this.scrollHeaderViewChild.nativeElement&&(this.headerScrollListener=this.renderer.listen(this.scrollHeaderBoxViewChild?.nativeElement,"scroll",this.onHeaderScroll.bind(this))),this.scrollFooterViewChild&&this.scrollFooterViewChild.nativeElement&&(this.footerScrollListener=this.renderer.listen(this.scrollFooterViewChild.nativeElement,"scroll",this.onFooterScroll.bind(this))),this.frozen||(this.tt.virtualScroll?this.bodyScrollListener=this.renderer.listen((this.scroller?.getElementRef()).nativeElement,"scroll",this.onBodyScroll.bind(this)):this.bodyScrollListener=this.renderer.listen(this.scrollBodyViewChild?.nativeElement,"scroll",this.onBodyScroll.bind(this)))})}unbindEvents(){At(this.platformId)&&(this.scrollHeaderViewChild&&this.scrollHeaderViewChild.nativeElement&&this.headerScrollListener&&(this.headerScrollListener(),this.headerScrollListener=null),this.scrollFooterViewChild&&this.scrollFooterViewChild.nativeElement&&this.footerScrollListener&&(this.footerScrollListener(),this.footerScrollListener=null),this.scrollBodyViewChild&&this.scrollBodyViewChild.nativeElement&&this.bodyScrollListener&&(this.bodyScrollListener(),this.bodyScrollListener=null),this.scroller&&this.scroller.getElementRef()&&this.bodyScrollListener&&(this.bodyScrollListener(),this.bodyScrollListener=null))}onHeaderScroll(){let e=this.scrollHeaderViewChild?.nativeElement.scrollLeft;this.scrollBodyViewChild.nativeElement.scrollLeft=e,this.scrollFooterViewChild&&this.scrollFooterViewChild.nativeElement&&(this.scrollFooterViewChild.nativeElement.scrollLeft=e),this.preventBodyScrollPropagation=!0}onFooterScroll(){let e=this.scrollFooterViewChild?.nativeElement.scrollLeft;this.scrollBodyViewChild.nativeElement.scrollLeft=e,this.scrollHeaderViewChild&&this.scrollHeaderViewChild.nativeElement&&(this.scrollHeaderViewChild.nativeElement.scrollLeft=e),this.preventBodyScrollPropagation=!0}onBodyScroll(e){if(this.preventBodyScrollPropagation){this.preventBodyScrollPropagation=!1;return}this.scrollHeaderViewChild&&this.scrollHeaderViewChild.nativeElement&&(this.scrollHeaderBoxViewChild.nativeElement.style.marginLeft=-1*e.target.scrollLeft+"px"),this.scrollFooterViewChild&&this.scrollFooterViewChild.nativeElement&&(this.scrollFooterBoxViewChild.nativeElement.style.marginLeft=-1*e.target.scrollLeft+"px"),this.frozenSiblingBody&&(this.frozenSiblingBody.scrollTop=e.target.scrollTop)}scrollToVirtualIndex(e){this.scroller&&this.scroller.scrollToIndex(e)}scrollTo(e){this.scroller?this.scroller.scrollTo(e):this.scrollBodyViewChild?.nativeElement.scrollTo?this.scrollBodyViewChild.nativeElement.scrollTo(e):(this.scrollBodyViewChild.nativeElement.scrollLeft=e.left,this.scrollBodyViewChild.nativeElement.scrollTop=e.top)}ngOnDestroy(){this.unbindEvents(),this.frozenSiblingBody=null}static \u0275fac=function(i){return new(i||t)(te(Ii),te(ei),te(Xn),te(pt),te(Ne))};static \u0275cmp=Be({type:t,selectors:[["","ttScrollableView",""]],viewQuery:function(i,s){if(i&1&&(oe(Hd,5),oe(jd,5),oe(Wd,5),oe($d,5),oe(Kd,5),oe(Ud,5),oe(Qd,5),oe(Yd,5),oe(qd,5)),i&2){let o;P(o=L())&&(s.scrollHeaderViewChild=o.first),P(o=L())&&(s.scrollHeaderBoxViewChild=o.first),P(o=L())&&(s.scrollBodyViewChild=o.first),P(o=L())&&(s.scrollTableViewChild=o.first),P(o=L())&&(s.scrollLoadingTableViewChild=o.first),P(o=L())&&(s.scrollFooterViewChild=o.first),P(o=L())&&(s.scrollFooterBoxViewChild=o.first),P(o=L())&&(s.scrollableAlignerViewChild=o.first),P(o=L())&&(s.scroller=o.first)}},inputs:{columns:[0,"ttScrollableView","columns"],frozen:[2,"frozen","frozen",q],scrollHeight:"scrollHeight"},standalone:!1,attrs:Gd,decls:13,vars:13,consts:[["scrollHeader",""],["scrollHeaderBox",""],["buildInItems",""],["scroller",""],["content",""],["loader",""],["scrollBody",""],["scrollTable",""],["scrollableAligner",""],["scrollFooter",""],["scrollFooterBox",""],[1,"p-treetable-scrollable-header"],[1,"p-treetable-scrollable-header-box"],[1,"p-treetable-scrollable-header-table",3,"ngClass","ngStyle"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["role","rowgroup",1,"p-treetable-thead"],["styleClass","p-treetable-scrollable-body",3,"items","style","scrollHeight","itemSize","lazy","options","onLazyLoad",4,"ngIf"],[4,"ngIf"],["class","p-treetable-scrollable-footer",4,"ngIf"],["styleClass","p-treetable-scrollable-body",3,"onLazyLoad","items","scrollHeight","itemSize","lazy","options"],[1,"p-treetable-scrollable-body",3,"ngStyle"],["role","table",3,"ngClass","ngStyle"],["role","rowgroup",1,"p-treetable-tbody",3,"pTreeTableBody","pTreeTableBodyTemplate","serializedNodes","frozen"],["style","background-color:transparent",4,"ngIf"],[2,"background-color","transparent"],[1,"p-treetable-scrollable-footer"],[1,"p-treetable-scrollable-footer-box"],[1,"p-treetable-scrollable-footer-table",3,"ngClass","ngStyle"],["role","rowgroup",1,"p-treetable-tfoot"]],template:function(i,s){i&1&&(O(0,"div",11,0)(2,"div",12,1)(4,"table",13),M(5,th,1,0,"ng-container",14),O(6,"thead",15),M(7,ih,1,0,"ng-container",14),N()()()(),M(8,lh,5,10,"p-scroller",16)(9,dh,4,10,"ng-container",17)(10,fh,5,15,"ng-template",null,2,et)(12,mh,8,10,"div",18)),i&2&&(S(4),T("ngClass",s.tt.tableStyleClass)("ngStyle",s.tt.tableStyle),S(),T("ngTemplateOutlet",s.frozen?s.tt.frozenColGroupTemplate||s.tt._frozenColGroupTemplate||s.tt.colGroupTemplate||s.tt._colGroupTemplate:s.tt.colGroupTemplate||s.tt._colGroupTemplate)("ngTemplateOutletContext",xe(9,We,s.columns)),S(2),T("ngTemplateOutlet",s.frozen?s.tt.frozenHeaderTemplate||s.tt._frozenHeaderTemplate||s.tt.headerTemplate||s.tt._headerTemplate:s.tt.headerTemplate||s.tt._headerTemplate)("ngTemplateOutletContext",xe(11,We,s.columns)),S(),T("ngIf",s.tt.virtualScroll),S(),T("ngIf",!s.tt.virtualScroll),S(3),T("ngIf",s.tt.footerTemplate||s.tt._footerTemplate))},dependencies:()=>[An,ni,yt,Fn,qn,Cr],encapsulation:2})}return t})();var ub=(()=>{class t extends Wn{tt;rowNode;constructor(e){super(),this.tt=e}get toggleButtonAriaLabel(){return this.config.translation?this.rowNode.expanded?this.config.translation.aria.collapseRow:this.config.translation.aria.expandRow:void 0}onClick(e){this.rowNode.node.expanded=!this.rowNode.node.expanded,this.rowNode.node.expanded?this.tt.onNodeExpand.emit({originalEvent:e,node:this.rowNode.node}):this.tt.onNodeCollapse.emit({originalEvent:e,node:this.rowNode.node}),this.tt.updateSerializedValue(),this.tt.tableService.onUIUpdate(this.tt.value),e.preventDefault()}static \u0275fac=function(i){return new(i||t)(te(Xn))};static \u0275cmp=Be({type:t,selectors:[["p-treeTableToggler"],["p-treetabletoggler"],["p-treetable-toggler"]],inputs:{rowNode:"rowNode"},standalone:!1,features:[In],decls:3,vars:12,consts:[["type","button","tabindex","-1","pRipple","",1,"p-treetable-toggler",3,"click"],[4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(i,s){i&1&&(O(0,"button",0),fe("click",function(r){return s.onClick(r)}),M(1,yh,3,2,"ng-container",1)(2,vh,1,0,null,2),N()),i&2&&(Li("visibility",s.rowNode.node.leaf===!1||s.rowNode.node.children&&s.rowNode.node.children.length?"visible":"hidden")("margin-inline-start",s.rowNode.level*16+"px"),Ot("data-pc-section","rowtoggler")("data-pc-group-section","rowactionbutton")("aria-label",s.toggleButtonAriaLabel),S(),T("ngIf",!s.tt.togglerIconTemplate&&!s.tt._togglerIconTemplate),S(),T("ngTemplateOutlet",s.tt.togglerIconTemplate||s.tt._togglerIconTemplate)("ngTemplateOutletContext",xe(10,We,s.rowNode.node.expanded)))},dependencies:()=>[ni,yt,Ho,Un,Qn],encapsulation:2})}return t})(),Sr=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=Pe({type:t});static \u0275inj=Ie({imports:[zi,cr,qn,Yn,$n,Kn,Vo,Bo,No,Ao,Fo,Un,Qn,ar,xt,Ai,xt]})}return t})();function ci(t){return t+.5|0}var it=(t,n,e)=>Math.max(Math.min(t,e),n);function ai(t){return it(ci(t*2.55),0,255)}function nt(t){return it(ci(t*255),0,255)}function Ke(t){return it(ci(t/2.55)/100,0,1)}function kr(t){return it(ci(t*100),0,100)}var Ce={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Zn=[..."0123456789ABCDEF"],kh=t=>Zn[t&15],Mh=t=>Zn[(t&240)>>4]+Zn[t&15],ji=t=>(t&240)>>4===(t&15),Dh=t=>ji(t.r)&&ji(t.g)&&ji(t.b)&&ji(t.a);function Eh(t){var n=t.length,e;return t[0]==="#"&&(n===4||n===5?e={r:255&Ce[t[1]]*17,g:255&Ce[t[2]]*17,b:255&Ce[t[3]]*17,a:n===5?Ce[t[4]]*17:255}:(n===7||n===9)&&(e={r:Ce[t[1]]<<4|Ce[t[2]],g:Ce[t[3]]<<4|Ce[t[4]],b:Ce[t[5]]<<4|Ce[t[6]],a:n===9?Ce[t[7]]<<4|Ce[t[8]]:255})),e}var Ih=(t,n)=>t<255?n(t):"";function Ph(t){var n=Dh(t)?kh:Mh;return t?"#"+n(t.r)+n(t.g)+n(t.b)+Ih(t.a,n):void 0}var Lh=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ir(t,n,e){let i=n*Math.min(e,1-e),s=(o,r=(o+t/30)%12)=>e-i*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function Oh(t,n,e){let i=(s,o=(s+t/60)%6)=>e-e*n*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function Rh(t,n,e){let i=Ir(t,1,.5),s;for(n+e>1&&(s=1/(n+e),n*=s,e*=s),s=0;s<3;s++)i[s]*=1-n-e,i[s]+=n;return i}function zh(t,n,e,i,s){return t===s?(n-e)/i+(n<e?6:0):n===s?(e-t)/i+2:(t-n)/i+4}function es(t){let e=t.r/255,i=t.g/255,s=t.b/255,o=Math.max(e,i,s),r=Math.min(e,i,s),a=(o+r)/2,l,c,d;return o!==r&&(d=o-r,c=a>.5?d/(2-o-r):d/(o+r),l=zh(e,i,s,d,o),l=l*60+.5),[l|0,c||0,a]}function ts(t,n,e,i){return(Array.isArray(n)?t(n[0],n[1],n[2]):t(n,e,i)).map(nt)}function is(t,n,e){return ts(Ir,t,n,e)}function Ah(t,n,e){return ts(Rh,t,n,e)}function Fh(t,n,e){return ts(Oh,t,n,e)}function Pr(t){return(t%360+360)%360}function Vh(t){let n=Lh.exec(t),e=255,i;if(!n)return;n[5]!==i&&(e=n[6]?ai(+n[5]):nt(+n[5]));let s=Pr(+n[2]),o=+n[3]/100,r=+n[4]/100;return n[1]==="hwb"?i=Ah(s,o,r):n[1]==="hsv"?i=Fh(s,o,r):i=is(s,o,r),{r:i[0],g:i[1],b:i[2],a:e}}function Nh(t,n){var e=es(t);e[0]=Pr(e[0]+n),e=is(e),t.r=e[0],t.g=e[1],t.b=e[2]}function Bh(t){if(!t)return;let n=es(t),e=n[0],i=kr(n[1]),s=kr(n[2]);return t.a<255?`hsla(${e}, ${i}%, ${s}%, ${Ke(t.a)})`:`hsl(${e}, ${i}%, ${s}%)`}var Mr={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Dr={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Hh(){let t={},n=Object.keys(Dr),e=Object.keys(Mr),i,s,o,r,a;for(i=0;i<n.length;i++){for(r=a=n[i],s=0;s<e.length;s++)o=e[s],a=a.replace(o,Mr[o]);o=parseInt(Dr[r],16),t[a]=[o>>16&255,o>>8&255,o&255]}return t}var Wi;function jh(t){Wi||(Wi=Hh(),Wi.transparent=[0,0,0,0]);let n=Wi[t.toLowerCase()];return n&&{r:n[0],g:n[1],b:n[2],a:n.length===4?n[3]:255}}var Wh=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function $h(t){let n=Wh.exec(t),e=255,i,s,o;if(n){if(n[7]!==i){let r=+n[7];e=n[8]?ai(r):it(r*255,0,255)}return i=+n[1],s=+n[3],o=+n[5],i=255&(n[2]?ai(i):it(i,0,255)),s=255&(n[4]?ai(s):it(s,0,255)),o=255&(n[6]?ai(o):it(o,0,255)),{r:i,g:s,b:o,a:e}}}function Kh(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Ke(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}var Jn=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,Vt=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function Uh(t,n,e){let i=Vt(Ke(t.r)),s=Vt(Ke(t.g)),o=Vt(Ke(t.b));return{r:nt(Jn(i+e*(Vt(Ke(n.r))-i))),g:nt(Jn(s+e*(Vt(Ke(n.g))-s))),b:nt(Jn(o+e*(Vt(Ke(n.b))-o))),a:t.a+e*(n.a-t.a)}}function $i(t,n,e){if(t){let i=es(t);i[n]=Math.max(0,Math.min(i[n]+i[n]*e,n===0?360:1)),i=is(i),t.r=i[0],t.g=i[1],t.b=i[2]}}function Lr(t,n){return t&&Object.assign(n||{},t)}function Er(t){var n={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(n={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(n.a=nt(t[3]))):(n=Lr(t,{r:0,g:0,b:0,a:1}),n.a=nt(n.a)),n}function Qh(t){return t.charAt(0)==="r"?$h(t):Vh(t)}var li=class t{constructor(n){if(n instanceof t)return n;let e=typeof n,i;e==="object"?i=Er(n):e==="string"&&(i=Eh(n)||jh(n)||Qh(n)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var n=Lr(this._rgb);return n&&(n.a=Ke(n.a)),n}set rgb(n){this._rgb=Er(n)}rgbString(){return this._valid?Kh(this._rgb):void 0}hexString(){return this._valid?Ph(this._rgb):void 0}hslString(){return this._valid?Bh(this._rgb):void 0}mix(n,e){if(n){let i=this.rgb,s=n.rgb,o,r=e===o?.5:e,a=2*r-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,i.r=255&c*i.r+o*s.r+.5,i.g=255&c*i.g+o*s.g+.5,i.b=255&c*i.b+o*s.b+.5,i.a=r*i.a+(1-r)*s.a,this.rgb=i}return this}interpolate(n,e){return n&&(this._rgb=Uh(this._rgb,n._rgb,e)),this}clone(){return new t(this.rgb)}alpha(n){return this._rgb.a=nt(n),this}clearer(n){let e=this._rgb;return e.a*=1-n,this}greyscale(){let n=this._rgb,e=ci(n.r*.3+n.g*.59+n.b*.11);return n.r=n.g=n.b=e,this}opaquer(n){let e=this._rgb;return e.a*=1+n,this}negate(){let n=this._rgb;return n.r=255-n.r,n.g=255-n.g,n.b=255-n.b,this}lighten(n){return $i(this._rgb,2,n),this}darken(n){return $i(this._rgb,2,-n),this}saturate(n){return $i(this._rgb,1,n),this}desaturate(n){return $i(this._rgb,1,-n),this}rotate(n){return Nh(this._rgb,n),this}};function Re(){}var Wr=(()=>{let t=0;return()=>t++})();function A(t){return t==null}function Q(t){if(Array.isArray&&Array.isArray(t))return!0;let n=Object.prototype.toString.call(t);return n.slice(0,7)==="[object"&&n.slice(-6)==="Array]"}function F(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function J(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function me(t,n){return J(t)?t:n}function I(t,n){return typeof t>"u"?n:t}var $r=(t,n)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/n,rs=(t,n)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*n:+t;function U(t,n,e){if(t&&typeof t.call=="function")return t.apply(e,n)}function j(t,n,e,i){let s,o,r;if(Q(t))if(o=t.length,i)for(s=o-1;s>=0;s--)n.call(e,t[s],s);else for(s=0;s<o;s++)n.call(e,t[s],s);else if(F(t))for(r=Object.keys(t),o=r.length,s=0;s<o;s++)n.call(e,t[r[s]],r[s])}function ui(t,n){let e,i,s,o;if(!t||!n||t.length!==n.length)return!1;for(e=0,i=t.length;e<i;++e)if(s=t[e],o=n[e],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function qi(t){if(Q(t))return t.map(qi);if(F(t)){let n=Object.create(null),e=Object.keys(t),i=e.length,s=0;for(;s<i;++s)n[e[s]]=qi(t[e[s]]);return n}return t}function Kr(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function Yh(t,n,e,i){if(!Kr(t))return;let s=n[t],o=e[t];F(s)&&F(o)?Bt(s,o,i):n[t]=qi(o)}function Bt(t,n,e){let i=Q(n)?n:[n],s=i.length;if(!F(t))return t;e=e||{};let o=e.merger||Yh,r;for(let a=0;a<s;++a){if(r=i[a],!F(r))continue;let l=Object.keys(r);for(let c=0,d=l.length;c<d;++c)o(l[c],t,r,e)}return t}function jt(t,n){return Bt(t,n,{merger:qh})}function qh(t,n,e){if(!Kr(t))return;let i=n[t],s=e[t];F(i)&&F(s)?jt(i,s):Object.prototype.hasOwnProperty.call(n,t)||(n[t]=qi(s))}var Or={"":t=>t,x:t=>t.x,y:t=>t.y};function Gh(t){let n=t.split("."),e=[],i="";for(let s of n)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function Xh(t){let n=Gh(t);return e=>{for(let i of n){if(i==="")break;e=e&&e[i]}return e}}function Ye(t,n){return(Or[n]||(Or[n]=Xh(n)))(t)}function Zi(t){return t.charAt(0).toUpperCase()+t.slice(1)}var Wt=t=>typeof t<"u",Ue=t=>typeof t=="function",as=(t,n)=>{if(t.size!==n.size)return!1;for(let e of t)if(!n.has(e))return!1;return!0};function Ur(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}var B=Math.PI,Y=2*B,Jh=Y+B,Gi=Number.POSITIVE_INFINITY,Zh=B/180,Z=B/2,vt=B/4,Rr=B*2/3,Qe=Math.log10,Me=Math.sign;function $t(t,n,e){return Math.abs(t-n)<e}function ls(t){let n=Math.round(t);t=$t(t,n,t/1e3)?n:t;let e=Math.pow(10,Math.floor(Qe(t))),i=t/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function Qr(t){let n=[],e=Math.sqrt(t),i;for(i=1;i<e;i++)t%i===0&&(n.push(i),n.push(t/i));return e===(e|0)&&n.push(e),n.sort((s,o)=>s-o).pop(),n}function eu(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function Ct(t){return!eu(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function Yr(t,n){let e=Math.round(t);return e-n<=t&&e+n>=t}function cs(t,n,e){let i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i][e],isNaN(o)||(n.min=Math.min(n.min,o),n.max=Math.max(n.max,o))}function Se(t){return t*(B/180)}function en(t){return t*(180/B)}function ds(t){if(!J(t))return;let n=1,e=0;for(;Math.round(t*n)/n!==t;)n*=10,e++;return e}function hs(t,n){let e=n.x-t.x,i=n.y-t.y,s=Math.sqrt(e*e+i*i),o=Math.atan2(i,e);return o<-.5*B&&(o+=Y),{angle:o,distance:s}}function Xi(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))}function tu(t,n){return(t-n+Jh)%Y-B}function re(t){return(t%Y+Y)%Y}function Kt(t,n,e,i){let s=re(t),o=re(n),r=re(e),a=re(o-s),l=re(r-s),c=re(s-o),d=re(s-r);return s===o||s===r||i&&o===r||a>l&&c<d}function ne(t,n,e){return Math.max(n,Math.min(e,t))}function qr(t){return ne(t,-32768,32767)}function ze(t,n,e,i=1e-6){return t>=Math.min(n,e)-i&&t<=Math.max(n,e)+i}function tn(t,n,e){e=e||(r=>t[r]<n);let i=t.length-1,s=0,o;for(;i-s>1;)o=s+i>>1,e(o)?s=o:i=o;return{lo:s,hi:i}}var Le=(t,n,e,i)=>tn(t,e,i?s=>{let o=t[s][n];return o<e||o===e&&t[s+1][n]===e}:s=>t[s][n]<e),Gr=(t,n,e)=>tn(t,e,i=>t[i][n]>=e);function Xr(t,n,e){let i=0,s=t.length;for(;i<s&&t[i]<n;)i++;for(;s>i&&t[s-1]>e;)s--;return i>0||s<t.length?t.slice(i,s):t}var Jr=["push","pop","shift","splice","unshift"];function Zr(t,n){if(t._chartjs){t._chartjs.listeners.push(n);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[n]}}),Jr.forEach(e=>{let i="_onData"+Zi(e),s=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...o){let r=s.apply(this,o);return t._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o)}),r}})})}function us(t,n){let e=t._chartjs;if(!e)return;let i=e.listeners,s=i.indexOf(n);s!==-1&&i.splice(s,1),!(i.length>0)&&(Jr.forEach(o=>{delete t[o]}),delete t._chartjs)}function fs(t){let n=new Set(t);return n.size===t.length?t:Array.from(n)}var ps=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function gs(t,n){let e=[],i=!1;return function(...s){e=s,i||(i=!0,ps.call(window,()=>{i=!1,t.apply(n,e)}))}}function ea(t,n){let e;return function(...i){return n?(clearTimeout(e),e=setTimeout(t,n,i)):t.apply(this,i),n}}var nn=t=>t==="start"?"left":t==="end"?"right":"center",ae=(t,n,e)=>t==="start"?n:t==="end"?e:(n+e)/2,ta=(t,n,e,i)=>t===(i?"left":"right")?e:t==="center"?(n+e)/2:n;function ms(t,n,e){let i=n.length,s=0,o=i;if(t._sorted){let{iScale:r,vScale:a,_parsed:l}=t,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,d=r.axis,{min:h,max:u,minDefined:f,maxDefined:g}=r.getUserBounds();if(f){if(s=Math.min(Le(l,d,h).lo,e?i:Le(n,d,r.getPixelForValue(h)).lo),c){let p=l.slice(0,s+1).reverse().findIndex(m=>!A(m[a.axis]));s-=Math.max(0,p)}s=ne(s,0,i-1)}if(g){let p=Math.max(Le(l,r.axis,u,!0).hi+1,e?0:Le(n,d,r.getPixelForValue(u),!0).hi+1);if(c){let m=l.slice(p-1).findIndex(b=>!A(b[a.axis]));p+=Math.max(0,m)}o=ne(p,s,i)-s}else o=i-s}return{start:s,count:o}}function bs(t){let{xScale:n,yScale:e,_scaleRanges:i}=t,s={xmin:n.min,xmax:n.max,ymin:e.min,ymax:e.max};if(!i)return t._scaleRanges=s,!0;let o=i.xmin!==n.min||i.xmax!==n.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,s),o}var Ki=t=>t===0||t===1,zr=(t,n,e)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-n)*Y/e)),Ar=(t,n,e)=>Math.pow(2,-10*t)*Math.sin((t-n)*Y/e)+1,Nt={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*Z)+1,easeOutSine:t=>Math.sin(t*Z),easeInOutSine:t=>-.5*(Math.cos(B*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>Ki(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Ki(t)?t:zr(t,.075,.3),easeOutElastic:t=>Ki(t)?t:Ar(t,.075,.3),easeInOutElastic(t){return Ki(t)?t:t<.5?.5*zr(t*2,.1125,.45):.5+.5*Ar(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let n=1.70158;return(t/=.5)<1?.5*(t*t*(((n*=1.525)+1)*t-n)):.5*((t-=2)*t*(((n*=1.525)+1)*t+n)+2)},easeInBounce:t=>1-Nt.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?Nt.easeInBounce(t*2)*.5:Nt.easeOutBounce(t*2-1)*.5+.5};function _s(t){if(t&&typeof t=="object"){let n=t.toString();return n==="[object CanvasPattern]"||n==="[object CanvasGradient]"}return!1}function ys(t){return _s(t)?t:new li(t)}function ns(t){return _s(t)?t:new li(t).saturate(.5).darken(.1).hexString()}var iu=["x","y","borderWidth","radius","tension"],nu=["color","borderColor","backgroundColor"];function su(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"}),t.set("animations",{colors:{type:"color",properties:nu},numbers:{type:"number",properties:iu}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}})}function ou(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var Fr=new Map;function ru(t,n){n=n||{};let e=t+JSON.stringify(n),i=Fr.get(e);return i||(i=new Intl.NumberFormat(t,n),Fr.set(e,i)),i}function Ut(t,n,e){return ru(n,e).format(t)}var ia={values(t){return Q(t)?t:""+t},numeric(t,n,e){if(t===0)return"0";let i=this.chart.options.locale,s,o=t;if(e.length>1){let c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=au(t,e)}let r=Qe(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Ut(t,i,l)},logarithmic(t,n,e){if(t===0)return"0";let i=e[n].significand||t/Math.pow(10,Math.floor(Qe(t)));return[1,2,3,5,10,15].includes(i)||n>.8*e.length?ia.numeric.call(this,t,n,e):""}};function au(t,n){let e=n.length>3?n[2].value-n[1].value:n[1].value-n[0].value;return Math.abs(e)>=1&&t!==Math.floor(t)&&(e=t-Math.floor(t)),e}var fi={formatters:ia};function lu(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(n,e)=>e.lineWidth,tickColor:(n,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:fi.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"&&n!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"})}var ot=Object.create(null),sn=Object.create(null);function di(t,n){if(!n)return t;let e=n.split(".");for(let i=0,s=e.length;i<s;++i){let o=e[i];t=t[o]||(t[o]=Object.create(null))}return t}function ss(t,n,e){return typeof n=="string"?Bt(di(t,n),e):Bt(di(t,""),n)}var os=class{constructor(n,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>ns(s.backgroundColor),this.hoverBorderColor=(i,s)=>ns(s.borderColor),this.hoverColor=(i,s)=>ns(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(n),this.apply(e)}set(n,e){return ss(this,n,e)}get(n){return di(this,n)}describe(n,e){return ss(sn,n,e)}override(n,e){return ss(ot,n,e)}route(n,e,i,s){let o=di(this,n),r=di(this,i),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){let l=this[a],c=r[s];return F(l)?Object.assign({},c,l):I(l,c)},set(l){this[a]=l}}})}apply(n){n.forEach(e=>e(this))}},G=new os({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[su,ou,lu]);function cu(t){return!t||A(t.size)||A(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function hi(t,n,e,i,s){let o=n[s];return o||(o=n[s]=t.measureText(s).width,e.push(s)),o>i&&(i=o),i}function na(t,n,e,i){i=i||{};let s=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==n&&(s=i.data={},o=i.garbageCollect=[],i.font=n),t.save(),t.font=n;let r=0,a=e.length,l,c,d,h,u;for(l=0;l<a;l++)if(h=e[l],h!=null&&!Q(h))r=hi(t,s,o,r,h);else if(Q(h))for(c=0,d=h.length;c<d;c++)u=h[c],u!=null&&!Q(u)&&(r=hi(t,s,o,r,u));t.restore();let f=o.length/2;if(f>e.length){for(l=0;l<f;l++)delete s[o[l]];o.splice(0,f)}return r}function rt(t,n,e){let i=t.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((n-s)*i)/i+s}function xs(t,n){!n&&!t||(n=n||t.getContext("2d"),n.save(),n.resetTransform(),n.clearRect(0,0,t.width,t.height),n.restore())}function on(t,n,e,i){vs(t,n,e,i,null)}function vs(t,n,e,i,s){let o,r,a,l,c,d,h,u,f=n.pointStyle,g=n.rotation,p=n.radius,m=(g||0)*Zh;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){t.save(),t.translate(e,i),t.rotate(m),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),t.restore();return}if(!(isNaN(p)||p<=0)){switch(t.beginPath(),f){default:s?t.ellipse(e,i,s/2,p,0,0,Y):t.arc(e,i,p,0,Y),t.closePath();break;case"triangle":d=s?s/2:p,t.moveTo(e+Math.sin(m)*d,i-Math.cos(m)*p),m+=Rr,t.lineTo(e+Math.sin(m)*d,i-Math.cos(m)*p),m+=Rr,t.lineTo(e+Math.sin(m)*d,i-Math.cos(m)*p),t.closePath();break;case"rectRounded":c=p*.516,l=p-c,r=Math.cos(m+vt)*l,h=Math.cos(m+vt)*(s?s/2-c:l),a=Math.sin(m+vt)*l,u=Math.sin(m+vt)*(s?s/2-c:l),t.arc(e-h,i-a,c,m-B,m-Z),t.arc(e+u,i-r,c,m-Z,m),t.arc(e+h,i+a,c,m,m+Z),t.arc(e-u,i+r,c,m+Z,m+B),t.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*p,d=s?s/2:l,t.rect(e-d,i-l,2*d,2*l);break}m+=vt;case"rectRot":h=Math.cos(m)*(s?s/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),t.moveTo(e-h,i-a),t.lineTo(e+u,i-r),t.lineTo(e+h,i+a),t.lineTo(e-u,i+r),t.closePath();break;case"crossRot":m+=vt;case"cross":h=Math.cos(m)*(s?s/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),t.moveTo(e-h,i-a),t.lineTo(e+h,i+a),t.moveTo(e+u,i-r),t.lineTo(e-u,i+r);break;case"star":h=Math.cos(m)*(s?s/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),t.moveTo(e-h,i-a),t.lineTo(e+h,i+a),t.moveTo(e+u,i-r),t.lineTo(e-u,i+r),m+=vt,h=Math.cos(m)*(s?s/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),t.moveTo(e-h,i-a),t.lineTo(e+h,i+a),t.moveTo(e+u,i-r),t.lineTo(e-u,i+r);break;case"line":r=s?s/2:Math.cos(m)*p,a=Math.sin(m)*p,t.moveTo(e-r,i-a),t.lineTo(e+r,i+a);break;case"dash":t.moveTo(e,i),t.lineTo(e+Math.cos(m)*(s?s/2:p),i+Math.sin(m)*p);break;case!1:t.closePath();break}t.fill(),n.borderWidth>0&&t.stroke()}}function Oe(t,n,e){return e=e||.5,!n||t&&t.x>n.left-e&&t.x<n.right+e&&t.y>n.top-e&&t.y<n.bottom+e}function pi(t,n){t.save(),t.beginPath(),t.rect(n.left,n.top,n.right-n.left,n.bottom-n.top),t.clip()}function gi(t){t.restore()}function sa(t,n,e,i,s){if(!n)return t.lineTo(e.x,e.y);if(s==="middle"){let o=(n.x+e.x)/2;t.lineTo(o,n.y),t.lineTo(o,e.y)}else s==="after"!=!!i?t.lineTo(n.x,e.y):t.lineTo(e.x,n.y);t.lineTo(e.x,e.y)}function oa(t,n,e,i){if(!n)return t.lineTo(e.x,e.y);t.bezierCurveTo(i?n.cp1x:n.cp2x,i?n.cp1y:n.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function du(t,n){n.translation&&t.translate(n.translation[0],n.translation[1]),A(n.rotation)||t.rotate(n.rotation),n.color&&(t.fillStyle=n.color),n.textAlign&&(t.textAlign=n.textAlign),n.textBaseline&&(t.textBaseline=n.textBaseline)}function hu(t,n,e,i,s){if(s.strikethrough||s.underline){let o=t.measureText(i),r=n-o.actualBoundingBoxLeft,a=n+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,d=s.strikethrough?(l+c)/2:c;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=s.decorationWidth||2,t.moveTo(r,d),t.lineTo(a,d),t.stroke()}}function uu(t,n){let e=t.fillStyle;t.fillStyle=n.color,t.fillRect(n.left,n.top,n.width,n.height),t.fillStyle=e}function at(t,n,e,i,s,o={}){let r=Q(n)?n:[n],a=o.strokeWidth>0&&o.strokeColor!=="",l,c;for(t.save(),t.font=s.string,du(t,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&uu(t,o.backdrop),a&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),A(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(c,e,i,o.maxWidth)),t.fillText(c,e,i,o.maxWidth),hu(t,e,i,c,o),i+=Number(s.lineHeight);t.restore()}function Qt(t,n){let{x:e,y:i,w:s,h:o,radius:r}=n;t.arc(e+r.topLeft,i+r.topLeft,r.topLeft,1.5*B,B,!0),t.lineTo(e,i+o-r.bottomLeft),t.arc(e+r.bottomLeft,i+o-r.bottomLeft,r.bottomLeft,B,Z,!0),t.lineTo(e+s-r.bottomRight,i+o),t.arc(e+s-r.bottomRight,i+o-r.bottomRight,r.bottomRight,Z,0,!0),t.lineTo(e+s,i+r.topRight),t.arc(e+s-r.topRight,i+r.topRight,r.topRight,0,-Z,!0),t.lineTo(e+r.topLeft,i)}var fu=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,pu=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function gu(t,n){let e=(""+t).match(fu);if(!e||e[1]==="normal")return n*1.2;switch(t=+e[2],e[3]){case"px":return t;case"%":t/=100;break}return n*t}var mu=t=>+t||0;function rn(t,n){let e={},i=F(n),s=i?Object.keys(n):n,o=F(t)?i?r=>I(t[r],t[n[r]]):r=>t[r]:()=>t;for(let r of s)e[r]=mu(o(r));return e}function ws(t){return rn(t,{top:"y",right:"x",bottom:"y",left:"x"})}function lt(t){return rn(t,["topLeft","topRight","bottomLeft","bottomRight"])}function le(t){let n=ws(t);return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function ie(t,n){t=t||{},n=n||G.font;let e=I(t.size,n.size);typeof e=="string"&&(e=parseInt(e,10));let i=I(t.style,n.style);i&&!(""+i).match(pu)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);let s={family:I(t.family,n.family),lineHeight:gu(I(t.lineHeight,n.lineHeight),e),size:e,style:i,weight:I(t.weight,n.weight),string:""};return s.string=cu(s),s}function Yt(t,n,e,i){let s=!0,o,r,a;for(o=0,r=t.length;o<r;++o)if(a=t[o],a!==void 0&&(n!==void 0&&typeof a=="function"&&(a=a(n),s=!1),e!==void 0&&Q(a)&&(a=a[e%a.length],s=!1),a!==void 0))return i&&!s&&(i.cacheable=!1),a}function ra(t,n,e){let{min:i,max:s}=t,o=rs(n,(s-i)/2),r=(a,l)=>e&&a===0?0:a+l;return{min:r(i,-Math.abs(o)),max:r(s,o)}}function qe(t,n){return Object.assign(Object.create(t),n)}function an(t,n=[""],e,i,s=()=>t[0]){let o=e||t;typeof i>"u"&&(i=ca("_fallback",t));let r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:i,_getTarget:s,override:a=>an([a,...t],n,o,i)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete t[0][l],!0},get(a,l){return aa(a,l,()=>Cu(l,n,t,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(a,l){return Nr(a).includes(l)},ownKeys(a){return Nr(a)},set(a,l,c){let d=a._storage||(a._storage=s());return a[l]=d[l]=c,delete a._keys,!0}})}function Tt(t,n,e,i){let s={_cacheable:!1,_proxy:t,_context:n,_subProxy:e,_stack:new Set,_descriptors:Ts(t,i),setContext:o=>Tt(t,o,e,i),override:o=>Tt(t.override(o),n,e,i)};return new Proxy(s,{deleteProperty(o,r){return delete o[r],delete t[r],!0},get(o,r,a){return aa(o,r,()=>_u(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(t,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,r)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(o,r){return Reflect.has(t,r)},ownKeys(){return Reflect.ownKeys(t)},set(o,r,a){return t[r]=a,delete o[r],!0}})}function Ts(t,n={scriptable:!0,indexable:!0}){let{_scriptable:e=n.scriptable,_indexable:i=n.indexable,_allKeys:s=n.allKeys}=t;return{allKeys:s,scriptable:e,indexable:i,isScriptable:Ue(e)?e:()=>e,isIndexable:Ue(i)?i:()=>i}}var bu=(t,n)=>t?t+Zi(n):n,Cs=(t,n)=>F(n)&&t!=="adapters"&&(Object.getPrototypeOf(n)===null||n.constructor===Object);function aa(t,n,e){if(Object.prototype.hasOwnProperty.call(t,n)||n==="constructor")return t[n];let i=e();return t[n]=i,i}function _u(t,n,e){let{_proxy:i,_context:s,_subProxy:o,_descriptors:r}=t,a=i[n];return Ue(a)&&r.isScriptable(n)&&(a=yu(n,a,t,e)),Q(a)&&a.length&&(a=xu(n,a,t,r.isIndexable)),Cs(n,a)&&(a=Tt(a,s,o&&o[n],r)),a}function yu(t,n,e,i){let{_proxy:s,_context:o,_subProxy:r,_stack:a}=e;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let l=n(o,r||i);return a.delete(t),Cs(t,l)&&(l=Ss(s._scopes,s,t,l)),l}function xu(t,n,e,i){let{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&i(t))return n[o.index%n.length];if(F(n[0])){let l=n,c=s._scopes.filter(d=>d!==l);n=[];for(let d of l){let h=Ss(c,s,t,d);n.push(Tt(h,o,r&&r[t],a))}}return n}function la(t,n,e){return Ue(t)?t(n,e):t}var vu=(t,n)=>t===!0?n:typeof t=="string"?Ye(n,t):void 0;function wu(t,n,e,i,s){for(let o of n){let r=vu(e,o);if(r){t.add(r);let a=la(r._fallback,e,s);if(typeof a<"u"&&a!==e&&a!==i)return a}else if(r===!1&&typeof i<"u"&&e!==i)return null}return!1}function Ss(t,n,e,i){let s=n._rootScopes,o=la(n._fallback,e,i),r=[...t,...s],a=new Set;a.add(i);let l=Vr(a,r,e,o||e,i);return l===null||typeof o<"u"&&o!==e&&(l=Vr(a,r,o,l,i),l===null)?!1:an(Array.from(a),[""],s,o,()=>Tu(n,e,i))}function Vr(t,n,e,i,s){for(;e;)e=wu(t,n,e,i,s);return e}function Tu(t,n,e){let i=t._getTarget();n in i||(i[n]={});let s=i[n];return Q(s)&&F(e)?e:s||{}}function Cu(t,n,e,i){let s;for(let o of n)if(s=ca(bu(o,t),e),typeof s<"u")return Cs(t,s)?Ss(e,i,t,s):s}function ca(t,n){for(let e of n){if(!e)continue;let i=e[t];if(typeof i<"u")return i}}function Nr(t){let n=t._keys;return n||(n=t._keys=Su(t._scopes)),n}function Su(t){let n=new Set;for(let e of t)for(let i of Object.keys(e).filter(s=>!s.startsWith("_")))n.add(i);return Array.from(n)}function ks(t,n,e,i){let{iScale:s}=t,{key:o="r"}=this._parsing,r=new Array(i),a,l,c,d;for(a=0,l=i;a<l;++a)c=a+e,d=n[c],r[a]={r:s.parse(Ye(d,o),c)};return r}var ku=Number.EPSILON||1e-14,Ht=(t,n)=>n<t.length&&!t[n].skip&&t[n],da=t=>t==="x"?"y":"x";function Mu(t,n,e,i){let s=t.skip?n:t,o=n,r=e.skip?n:e,a=Xi(o,s),l=Xi(r,o),c=a/(a+l),d=l/(a+l);c=isNaN(c)?0:c,d=isNaN(d)?0:d;let h=i*c,u=i*d;return{previous:{x:o.x-h*(r.x-s.x),y:o.y-h*(r.y-s.y)},next:{x:o.x+u*(r.x-s.x),y:o.y+u*(r.y-s.y)}}}function Du(t,n,e){let i=t.length,s,o,r,a,l,c=Ht(t,0);for(let d=0;d<i-1;++d)if(l=c,c=Ht(t,d+1),!(!l||!c)){if($t(n[d],0,ku)){e[d]=e[d+1]=0;continue}s=e[d]/n[d],o=e[d+1]/n[d],a=Math.pow(s,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),e[d]=s*r*n[d],e[d+1]=o*r*n[d])}}function Eu(t,n,e="x"){let i=da(e),s=t.length,o,r,a,l=Ht(t,0);for(let c=0;c<s;++c){if(r=a,a=l,l=Ht(t,c+1),!a)continue;let d=a[e],h=a[i];r&&(o=(d-r[e])/3,a[`cp1${e}`]=d-o,a[`cp1${i}`]=h-o*n[c]),l&&(o=(l[e]-d)/3,a[`cp2${e}`]=d+o,a[`cp2${i}`]=h+o*n[c])}}function Iu(t,n="x"){let e=da(n),i=t.length,s=Array(i).fill(0),o=Array(i),r,a,l,c=Ht(t,0);for(r=0;r<i;++r)if(a=l,l=c,c=Ht(t,r+1),!!l){if(c){let d=c[n]-l[n];s[r]=d!==0?(c[e]-l[e])/d:0}o[r]=a?c?Me(s[r-1])!==Me(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}Du(t,s,o),Eu(t,o,n)}function Ui(t,n,e){return Math.max(Math.min(t,e),n)}function Pu(t,n){let e,i,s,o,r,a=Oe(t[0],n);for(e=0,i=t.length;e<i;++e)r=o,o=a,a=e<i-1&&Oe(t[e+1],n),o&&(s=t[e],r&&(s.cp1x=Ui(s.cp1x,n.left,n.right),s.cp1y=Ui(s.cp1y,n.top,n.bottom)),a&&(s.cp2x=Ui(s.cp2x,n.left,n.right),s.cp2y=Ui(s.cp2y,n.top,n.bottom)))}function ha(t,n,e,i,s){let o,r,a,l;if(n.spanGaps&&(t=t.filter(c=>!c.skip)),n.cubicInterpolationMode==="monotone")Iu(t,s);else{let c=i?t[t.length-1]:t[0];for(o=0,r=t.length;o<r;++o)a=t[o],l=Mu(c,a,t[Math.min(o+1,r-(i?0:1))%r],n.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}n.capBezierPoints&&Pu(t,e)}function ln(){return typeof window<"u"&&typeof document<"u"}function cn(t){let n=t.parentNode;return n&&n.toString()==="[object ShadowRoot]"&&(n=n.host),n}function Ji(t,n,e){let i;return typeof t=="string"?(i=parseInt(t,10),t.indexOf("%")!==-1&&(i=i/100*n.parentNode[e])):i=t,i}var dn=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function Lu(t,n){return dn(t).getPropertyValue(n)}var Ou=["top","right","bottom","left"];function wt(t,n,e){let i={};e=e?"-"+e:"";for(let s=0;s<4;s++){let o=Ou[s];i[o]=parseFloat(t[n+"-"+o+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}var Ru=(t,n,e)=>(t>0||n>0)&&(!e||!e.shadowRoot);function zu(t,n){let e=t.touches,i=e&&e.length?e[0]:t,{offsetX:s,offsetY:o}=i,r=!1,a,l;if(Ru(s,o,t.target))a=s,l=o;else{let c=n.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function ct(t,n){if("native"in t)return t;let{canvas:e,currentDevicePixelRatio:i}=n,s=dn(e),o=s.boxSizing==="border-box",r=wt(s,"padding"),a=wt(s,"border","width"),{x:l,y:c,box:d}=zu(t,e),h=r.left+(d&&a.left),u=r.top+(d&&a.top),{width:f,height:g}=n;return o&&(f-=r.width+a.width,g-=r.height+a.height),{x:Math.round((l-h)/f*e.width/i),y:Math.round((c-u)/g*e.height/i)}}function Au(t,n,e){let i,s;if(n===void 0||e===void 0){let o=t&&cn(t);if(!o)n=t.clientWidth,e=t.clientHeight;else{let r=o.getBoundingClientRect(),a=dn(o),l=wt(a,"border","width"),c=wt(a,"padding");n=r.width-c.width-l.width,e=r.height-c.height-l.height,i=Ji(a.maxWidth,o,"clientWidth"),s=Ji(a.maxHeight,o,"clientHeight")}}return{width:n,height:e,maxWidth:i||Gi,maxHeight:s||Gi}}var Qi=t=>Math.round(t*10)/10;function ua(t,n,e,i){let s=dn(t),o=wt(s,"margin"),r=Ji(s.maxWidth,t,"clientWidth")||Gi,a=Ji(s.maxHeight,t,"clientHeight")||Gi,l=Au(t,n,e),{width:c,height:d}=l;if(s.boxSizing==="content-box"){let u=wt(s,"border","width"),f=wt(s,"padding");c-=f.width+u.width,d-=f.height+u.height}return c=Math.max(0,c-o.width),d=Math.max(0,i?c/i:d-o.height),c=Qi(Math.min(c,r,l.maxWidth)),d=Qi(Math.min(d,a,l.maxHeight)),c&&!d&&(d=Qi(c/2)),(n!==void 0||e!==void 0)&&i&&l.height&&d>l.height&&(d=l.height,c=Qi(Math.floor(d*i))),{width:c,height:d}}function Ms(t,n,e){let i=n||1,s=Math.floor(t.height*i),o=Math.floor(t.width*i);t.height=Math.floor(t.height),t.width=Math.floor(t.width);let r=t.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${t.height}px`,r.style.width=`${t.width}px`),t.currentDevicePixelRatio!==i||r.height!==s||r.width!==o?(t.currentDevicePixelRatio=i,r.height=s,r.width=o,t.ctx.setTransform(i,0,0,i,0,0),!0):!1}var fa=function(){let t=!1;try{let n={get passive(){return t=!0,!1}};ln()&&(window.addEventListener("test",null,n),window.removeEventListener("test",null,n))}catch{}return t}();function Ds(t,n){let e=Lu(t,n),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function st(t,n,e,i){return{x:t.x+e*(n.x-t.x),y:t.y+e*(n.y-t.y)}}function pa(t,n,e,i){return{x:t.x+e*(n.x-t.x),y:i==="middle"?e<.5?t.y:n.y:i==="after"?e<1?t.y:n.y:e>0?n.y:t.y}}function ga(t,n,e,i){let s={x:t.cp2x,y:t.cp2y},o={x:n.cp1x,y:n.cp1y},r=st(t,s,e),a=st(s,o,e),l=st(o,n,e),c=st(r,a,e),d=st(a,l,e);return st(c,d,e)}var Fu=function(t,n){return{x(e){return t+t+n-e},setWidth(e){n=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},Vu=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,n){return t+n},leftForLtr(t,n){return t}}};function St(t,n,e){return t?Fu(n,e):Vu()}function Es(t,n){let e,i;(n==="ltr"||n==="rtl")&&(e=t.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",n,"important"),t.prevTextDirection=i)}function Is(t,n){n!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",n[0],n[1]))}function ma(t){return t==="angle"?{between:Kt,compare:tu,normalize:re}:{between:ze,compare:(n,e)=>n-e,normalize:n=>n}}function Br({start:t,end:n,count:e,loop:i,style:s}){return{start:t%e,end:n%e,loop:i&&(n-t+1)%e===0,style:s}}function Nu(t,n,e){let{property:i,start:s,end:o}=e,{between:r,normalize:a}=ma(i),l=n.length,{start:c,end:d,loop:h}=t,u,f;if(h){for(c+=l,d+=l,u=0,f=l;u<f&&r(a(n[c%l][i]),s,o);++u)c--,d--;c%=l,d%=l}return d<c&&(d+=l),{start:c,end:d,loop:h,style:t.style}}function Ps(t,n,e){if(!e)return[t];let{property:i,start:s,end:o}=e,r=n.length,{compare:a,between:l,normalize:c}=ma(i),{start:d,end:h,loop:u,style:f}=Nu(t,n,e),g=[],p=!1,m=null,b,_,x,w=()=>l(s,x,b)&&a(s,x)!==0,y=()=>a(o,b)===0||l(o,x,b),v=()=>p||w(),k=()=>!p||y();for(let C=d,D=d;C<=h;++C)_=n[C%r],!_.skip&&(b=c(_[i]),b!==x&&(p=l(b,s,o),m===null&&v()&&(m=a(b,s)===0?C:D),m!==null&&k()&&(g.push(Br({start:m,end:C,loop:u,count:r,style:f})),m=null),D=C,x=b));return m!==null&&g.push(Br({start:m,end:h,loop:u,count:r,style:f})),g}function Ls(t,n){let e=[],i=t.segments;for(let s=0;s<i.length;s++){let o=Ps(i[s],t.points,n);o.length&&e.push(...o)}return e}function Bu(t,n,e,i){let s=0,o=n-1;if(e&&!i)for(;s<n&&!t[s].skip;)s++;for(;s<n&&t[s].skip;)s++;for(s%=n,e&&(o+=s);o>s&&t[o%n].skip;)o--;return o%=n,{start:s,end:o}}function Hu(t,n,e,i){let s=t.length,o=[],r=n,a=t[n],l;for(l=n+1;l<=e;++l){let c=t[l%s];c.skip||c.stop?a.skip||(i=!1,o.push({start:n%s,end:(l-1)%s,loop:i}),n=r=c.stop?l:null):(r=l,a.skip&&(n=l)),a=c}return r!==null&&o.push({start:n%s,end:r%s,loop:i}),o}function ba(t,n){let e=t.points,i=t.options.spanGaps,s=e.length;if(!s)return[];let o=!!t._loop,{start:r,end:a}=Bu(e,s,o,i);if(i===!0)return Hr(t,[{start:r,end:a,loop:o}],e,n);let l=a<r?a+s:a,c=!!t._fullLoop&&r===0&&a===s-1;return Hr(t,Hu(e,r,l,c),e,n)}function Hr(t,n,e,i){return!i||!i.setContext||!e?n:ju(t,n,e,i)}function ju(t,n,e,i){let s=t._chart.getContext(),o=jr(t.options),{_datasetIndex:r,options:{spanGaps:a}}=t,l=e.length,c=[],d=o,h=n[0].start,u=h;function f(g,p,m,b){let _=a?-1:1;if(g!==p){for(g+=l;e[g%l].skip;)g-=_;for(;e[p%l].skip;)p+=_;g%l!==p%l&&(c.push({start:g%l,end:p%l,loop:m,style:b}),d=b,h=p%l)}}for(let g of n){h=a?h:g.start;let p=e[h%l],m;for(u=h+1;u<=g.end;u++){let b=e[u%l];m=jr(i.setContext(qe(s,{type:"segment",p0:p,p1:b,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:r}))),Wu(m,d)&&f(h,u-1,g.loop,d),p=b,d=m}h<u-1&&f(h,u-1,g.loop,d)}return c}function jr(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Wu(t,n){if(!n)return!1;let e=[],i=function(s,o){return _s(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(t,i)!==JSON.stringify(n,i)}function Yi(t,n,e){return t.options.clip?t[e]:n[e]}function $u(t,n){let{xScale:e,yScale:i}=t;return e&&i?{left:Yi(e,n,"left"),right:Yi(e,n,"right"),top:Yi(i,n,"top"),bottom:Yi(i,n,"bottom")}:n}function Os(t,n){let e=n._clip;if(e.disabled)return!1;let i=$u(n,t.chartArea);return{left:e.left===!1?0:i.left-(e.left===!0?0:e.left),right:e.right===!1?t.width:i.right+(e.right===!0?0:e.right),top:e.top===!1?0:i.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?t.height:i.bottom+(e.bottom===!0?0:e.bottom)}}var Ks=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(n,e,i,s){let o=e.listeners[s],r=e.duration;o.forEach(a=>a({chart:n,initial:e.initial,numSteps:r,currentStep:Math.min(i-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=ps.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(n=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;let o=i.items,r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(n),a=!0):(o[r]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,i,n,"progress")),o.length||(i.running=!1,this._notify(s,i,n,"complete"),i.initial=!1),e+=o.length}),this._lastDate=n,e===0&&(this._running=!1)}_getAnims(n){let e=this._charts,i=e.get(n);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(n,i)),i}listen(n,e,i){this._getAnims(n).listeners[e].push(i)}add(n,e){!e||!e.length||this._getAnims(n).items.push(...e)}has(n){return this._getAnims(n).items.length>0}start(n){let e=this._charts.get(n);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(n){if(!this._running)return!1;let e=this._charts.get(n);return!(!e||!e.running||!e.items.length)}stop(n){let e=this._charts.get(n);if(!e||!e.items.length)return;let i=e.items,s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(n,e,Date.now(),"complete")}remove(n){return this._charts.delete(n)}},Ge=new Ks,_a="transparent",Ku={boolean(t,n,e){return e>.5?n:t},color(t,n,e){let i=ys(t||_a),s=i.valid&&ys(n||_a);return s&&s.valid?s.mix(i,e).hexString():n},number(t,n,e){return t+(n-t)*e}},Us=class{constructor(n,e,i,s){let o=e[i];s=Yt([n.to,s,o,n.from]);let r=Yt([n.from,o,s]);this._active=!0,this._fn=n.fn||Ku[n.type||typeof r],this._easing=Nt[n.easing]||Nt.linear,this._start=Math.floor(Date.now()+(n.delay||0)),this._duration=this._total=Math.floor(n.duration),this._loop=!!n.loop,this._target=e,this._prop=i,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(n,e,i){if(this._active){this._notify(!1);let s=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,n.duration)),this._total+=o,this._loop=!!n.loop,this._to=Yt([n.to,e,s,n.from]),this._from=Yt([n.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(n){let e=n-this._start,i=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to,l;if(this._active=o!==a&&(r||e<i),!this._active){this._target[s]=a,this._notify(!0);return}if(e<0){this._target[s]=o;return}l=e/i%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){let n=this._promises||(this._promises=[]);return new Promise((e,i)=>{n.push({res:e,rej:i})})}_notify(n){let e=n?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][e]()}},yn=class{constructor(n,e){this._chart=n,this._properties=new Map,this.configure(e)}configure(n){if(!F(n))return;let e=Object.keys(G.animation),i=this._properties;Object.getOwnPropertyNames(n).forEach(s=>{let o=n[s];if(!F(o))return;let r={};for(let a of e)r[a]=o[a];(Q(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,r)})})}_animateOptions(n,e){let i=e.options,s=Qu(n,i);if(!s)return[];let o=this._createAnimations(s,i);return i.$shared&&Uu(n.options.$animations,i).then(()=>{n.options=i},()=>{}),o}_createAnimations(n,e){let i=this._properties,s=[],o=n.$animations||(n.$animations={}),r=Object.keys(e),a=Date.now(),l;for(l=r.length-1;l>=0;--l){let c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(n,e));continue}let d=e[c],h=o[c],u=i.get(c);if(h)if(u&&h.active()){h.update(u,d,a);continue}else h.cancel();if(!u||!u.duration){n[c]=d;continue}o[c]=h=new Us(u,n,c,d),s.push(h)}return s}update(n,e){if(this._properties.size===0){Object.assign(n,e);return}let i=this._createAnimations(n,e);if(i.length)return Ge.add(this._chart,i),!0}};function Uu(t,n){let e=[],i=Object.keys(n);for(let s=0;s<i.length;s++){let o=t[i[s]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function Qu(t,n){if(!n)return;let e=t.options;if(!e){t.options=n;return}return e.$shared&&(t.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function ya(t,n){let e=t&&t.options||{},i=e.reverse,s=e.min===void 0?n:0,o=e.max===void 0?n:0;return{start:i?o:s,end:i?s:o}}function Yu(t,n,e){if(e===!1)return!1;let i=ya(t,e),s=ya(n,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function qu(t){let n,e,i,s;return F(t)?(n=t.top,e=t.right,i=t.bottom,s=t.left):n=e=i=s=t,{top:n,right:e,bottom:i,left:s,disabled:t===!1}}function _l(t,n){let e=[],i=t._getSortedDatasetMetas(n),s,o;for(s=0,o=i.length;s<o;++s)e.push(i[s].index);return e}function xa(t,n,e,i={}){let s=t.keys,o=i.mode==="single",r,a,l,c;if(n===null)return;let d=!1;for(r=0,a=s.length;r<a;++r){if(l=+s[r],l===e){if(d=!0,i.all)continue;break}c=t.values[l],J(c)&&(o||n===0||Me(n)===Me(c))&&(n+=c)}return!d&&!i.all?0:n}function Gu(t,n){let{iScale:e,vScale:i}=n,s=e.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",r=Object.keys(t),a=new Array(r.length),l,c,d;for(l=0,c=r.length;l<c;++l)d=r[l],a[l]={[s]:d,[o]:t[d]};return a}function Rs(t,n){let e=t&&t.options.stacked;return e||e===void 0&&n.stack!==void 0}function Xu(t,n,e){return`${t.id}.${n.id}.${e.stack||e.type}`}function Ju(t){let{min:n,max:e,minDefined:i,maxDefined:s}=t.getUserBounds();return{min:i?n:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function Zu(t,n,e){let i=t[n]||(t[n]={});return i[e]||(i[e]={})}function va(t,n,e,i){for(let s of n.getMatchingVisibleMetas(i).reverse()){let o=t[s.index];if(e&&o>0||!e&&o<0)return s.index}return null}function wa(t,n){let{chart:e,_cachedMeta:i}=t,s=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=i,l=o.axis,c=r.axis,d=Xu(o,r,i),h=n.length,u;for(let f=0;f<h;++f){let g=n[f],{[l]:p,[c]:m}=g,b=g._stacks||(g._stacks={});u=b[c]=Zu(s,d,p),u[a]=m,u._top=va(u,r,!0,i.type),u._bottom=va(u,r,!1,i.type);let _=u._visualValues||(u._visualValues={});_[a]=m}}function zs(t,n){let e=t.scales;return Object.keys(e).filter(i=>e[i].axis===n).shift()}function ef(t,n){return qe(t,{active:!1,dataset:void 0,datasetIndex:n,index:n,mode:"default",type:"dataset"})}function tf(t,n,e){return qe(t,{active:!1,dataIndex:n,parsed:void 0,raw:void 0,element:e,index:n,mode:"default",type:"data"})}function mi(t,n){let e=t.controller.index,i=t.vScale&&t.vScale.axis;if(i){n=n||t._parsed;for(let s of n){let o=s._stacks;if(!o||o[i]===void 0||o[i][e]===void 0)return;delete o[i][e],o[i]._visualValues!==void 0&&o[i]._visualValues[e]!==void 0&&delete o[i]._visualValues[e]}}}var As=t=>t==="reset"||t==="none",Ta=(t,n)=>n?t:Object.assign({},t),nf=(t,n,e)=>t&&!n.hidden&&n._stacked&&{keys:_l(e,!0),values:null},ht=(()=>{class t{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,i){this.chart=e,this._ctx=e.ctx,this.index=i,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Rs(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&mi(this._cachedMeta),this.index=e}linkScales(){let e=this.chart,i=this._cachedMeta,s=this.getDataset(),o=(u,f,g,p)=>u==="x"?f:u==="r"?p:g,r=i.xAxisID=I(s.xAxisID,zs(e,"x")),a=i.yAxisID=I(s.yAxisID,zs(e,"y")),l=i.rAxisID=I(s.rAxisID,zs(e,"r")),c=i.indexAxis,d=i.iAxisID=o(c,r,a,l),h=i.vAxisID=o(c,a,r,l);i.xScale=this.getScaleForId(r),i.yScale=this.getScaleForId(a),i.rScale=this.getScaleForId(l),i.iScale=this.getScaleForId(d),i.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){let i=this._cachedMeta;return e===i.iScale?i.vScale:i.iScale}reset(){this._update("reset")}_destroy(){let e=this._cachedMeta;this._data&&us(this._data,this),e._stacked&&mi(e)}_dataCheck(){let e=this.getDataset(),i=e.data||(e.data=[]),s=this._data;if(F(i)){let o=this._cachedMeta;this._data=Gu(i,o)}else if(s!==i){if(s){us(s,this);let o=this._cachedMeta;mi(o),o._parsed=[]}i&&Object.isExtensible(i)&&Zr(i,this),this._syncList=[],this._data=i}}addElements(){let e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){let i=this._cachedMeta,s=this.getDataset(),o=!1;this._dataCheck();let r=i._stacked;i._stacked=Rs(i.vScale,i),i.stack!==s.stack&&(o=!0,mi(i),i.stack=s.stack),this._resyncElements(e),(o||r!==i._stacked)&&(wa(this,i._parsed),i._stacked=Rs(i.vScale,i))}configure(){let e=this.chart.config,i=e.datasetScopeKeys(this._type),s=e.getOptionScopes(this.getDataset(),i,!0);this.options=e.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,i){let{_cachedMeta:s,_data:o}=this,{iScale:r,_stacked:a}=s,l=r.axis,c=e===0&&i===o.length?!0:s._sorted,d=e>0&&s._parsed[e-1],h,u,f;if(this._parsing===!1)s._parsed=o,s._sorted=!0,f=o;else{Q(o[e])?f=this.parseArrayData(s,o,e,i):F(o[e])?f=this.parseObjectData(s,o,e,i):f=this.parsePrimitiveData(s,o,e,i);let g=()=>u[l]===null||d&&u[l]<d[l];for(h=0;h<i;++h)s._parsed[h+e]=u=f[h],c&&(g()&&(c=!1),d=u);s._sorted=c}a&&wa(this,f)}parsePrimitiveData(e,i,s,o){let{iScale:r,vScale:a}=e,l=r.axis,c=a.axis,d=r.getLabels(),h=r===a,u=new Array(o),f,g,p;for(f=0,g=o;f<g;++f)p=f+s,u[f]={[l]:h||r.parse(d[p],p),[c]:a.parse(i[p],p)};return u}parseArrayData(e,i,s,o){let{xScale:r,yScale:a}=e,l=new Array(o),c,d,h,u;for(c=0,d=o;c<d;++c)h=c+s,u=i[h],l[c]={x:r.parse(u[0],h),y:a.parse(u[1],h)};return l}parseObjectData(e,i,s,o){let{xScale:r,yScale:a}=e,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=new Array(o),h,u,f,g;for(h=0,u=o;h<u;++h)f=h+s,g=i[f],d[h]={x:r.parse(Ye(g,l),f),y:a.parse(Ye(g,c),f)};return d}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,i,s){let o=this.chart,r=this._cachedMeta,a=i[e.axis],l={keys:_l(o,!0),values:i._stacks[e.axis]._visualValues};return xa(l,a,r.index,{mode:s})}updateRangeFromParsed(e,i,s,o){let r=s[i.axis],a=r===null?NaN:r,l=o&&s._stacks[i.axis];o&&l&&(o.values=l,a=xa(o,r,this._cachedMeta.index)),e.min=Math.min(e.min,a),e.max=Math.max(e.max,a)}getMinMax(e,i){let s=this._cachedMeta,o=s._parsed,r=s._sorted&&e===s.iScale,a=o.length,l=this._getOtherScale(e),c=nf(i,s,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:u}=Ju(l),f,g;function p(){g=o[f];let m=g[l.axis];return!J(g[e.axis])||h>m||u<m}for(f=0;f<a&&!(!p()&&(this.updateRangeFromParsed(d,e,g,c),r));++f);if(r){for(f=a-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(d,e,g,c);break}}return d}getAllParsedValues(e){let i=this._cachedMeta._parsed,s=[],o,r,a;for(o=0,r=i.length;o<r;++o)a=i[o][e.axis],J(a)&&s.push(a);return s}getMaxOverflow(){return!1}getLabelAndValue(e){let i=this._cachedMeta,s=i.iScale,o=i.vScale,r=this.getParsed(e);return{label:s?""+s.getLabelForValue(r[s.axis]):"",value:o?""+o.getLabelForValue(r[o.axis]):""}}_update(e){let i=this._cachedMeta;this.update(e||"default"),i._clip=qu(I(this.options.clip,Yu(i.xScale,i.yScale,this.getMaxOverflow())))}update(e){}draw(){let e=this._ctx,i=this.chart,s=this._cachedMeta,o=s.data||[],r=i.chartArea,a=[],l=this._drawStart||0,c=this._drawCount||o.length-l,d=this.options.drawActiveElementsOnTop,h;for(s.dataset&&s.dataset.draw(e,r,l,c),h=l;h<l+c;++h){let u=o[h];u.hidden||(u.active&&d?a.push(u):u.draw(e,r))}for(h=0;h<a.length;++h)a[h].draw(e,r)}getStyle(e,i){let s=i?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(e||0,s)}getContext(e,i,s){let o=this.getDataset(),r;if(e>=0&&e<this._cachedMeta.data.length){let a=this._cachedMeta.data[e];r=a.$context||(a.$context=tf(this.getContext(),e,a)),r.parsed=this.getParsed(e),r.raw=o.data[e],r.index=r.dataIndex=e}else r=this.$context||(this.$context=ef(this.chart.getContext(),this.index)),r.dataset=o,r.index=r.datasetIndex=this.index;return r.active=!!i,r.mode=s,r}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,i){return this._resolveElementOptions(this.dataElementType.id,i,e)}_resolveElementOptions(e,i="default",s){let o=i==="active",r=this._cachedDataOpts,a=e+"-"+i,l=r[a],c=this.enableOptionSharing&&Wt(s);if(l)return Ta(l,c);let d=this.chart.config,h=d.datasetElementScopeKeys(this._type,e),u=o?[`${e}Hover`,"hover",e,""]:[e,""],f=d.getOptionScopes(this.getDataset(),h),g=Object.keys(G.elements[e]),p=()=>this.getContext(s,o,i),m=d.resolveNamedOptions(f,g,p,u);return m.$shared&&(m.$shared=c,r[a]=Object.freeze(Ta(m,c))),m}_resolveAnimations(e,i,s){let o=this.chart,r=this._cachedDataOpts,a=`animation-${i}`,l=r[a];if(l)return l;let c;if(o.options.animation!==!1){let h=this.chart.config,u=h.datasetAnimationScopeKeys(this._type,i),f=h.getOptionScopes(this.getDataset(),u);c=h.createResolver(f,this.getContext(e,s,i))}let d=new yn(o,c&&c.animations);return c&&c._cacheable&&(r[a]=Object.freeze(d)),d}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,i){return!i||As(e)||this.chart._animationsDisabled}_getSharedOptions(e,i){let s=this.resolveDataElementOptions(e,i),o=this._sharedOptions,r=this.getSharedOptions(s),a=this.includeOptions(i,r)||r!==o;return this.updateSharedOptions(r,i,s),{sharedOptions:r,includeOptions:a}}updateElement(e,i,s,o){As(o)?Object.assign(e,s):this._resolveAnimations(i,o).update(e,s)}updateSharedOptions(e,i,s){e&&!As(i)&&this._resolveAnimations(void 0,i).update(e,s)}_setStyle(e,i,s,o){e.active=o;let r=this.getStyle(i,o);this._resolveAnimations(i,s,o).update(e,{options:!o&&this.getSharedOptions(r)||r})}removeHoverStyle(e,i,s){this._setStyle(e,s,"active",!1)}setHoverStyle(e,i,s){this._setStyle(e,s,"active",!0)}_removeDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){let i=this._data,s=this._cachedMeta.data;for(let[l,c,d]of this._syncList)this[l](c,d);this._syncList=[];let o=s.length,r=i.length,a=Math.min(r,o);a&&this.parse(0,a),r>o?this._insertElements(o,r-o,e):r<o&&this._removeElements(r,o-r)}_insertElements(e,i,s=!0){let o=this._cachedMeta,r=o.data,a=e+i,l,c=d=>{for(d.length+=i,l=d.length-1;l>=a;l--)d[l]=d[l-i]};for(c(r),l=e;l<a;++l)r[l]=new this.dataElementType;this._parsing&&c(o._parsed),this.parse(e,i),s&&this.updateElements(r,e,i,"reset")}updateElements(e,i,s,o){}_removeElements(e,i){let s=this._cachedMeta;if(this._parsing){let o=s._parsed.splice(e,i);s._stacked&&mi(s,o)}s.data.splice(e,i)}_sync(e){if(this._parsing)this._syncList.push(e);else{let[i,s,o]=e;this[i](s,o)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){let e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,i){i&&this._sync(["_removeElements",e,i]);let s=arguments.length-2;s&&this._sync(["_insertElements",e,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}return t})();function sf(t,n){if(!t._cache.$bar){let e=t.getMatchingVisibleMetas(n),i=[];for(let s=0,o=e.length;s<o;s++)i=i.concat(e[s].controller.getAllParsedValues(t));t._cache.$bar=fs(i.sort((s,o)=>s-o))}return t._cache.$bar}function of(t){let n=t.iScale,e=sf(n,t.type),i=n._length,s,o,r,a,l=()=>{r===32767||r===-32768||(Wt(a)&&(i=Math.min(i,Math.abs(r-a)||i)),a=r)};for(s=0,o=e.length;s<o;++s)r=n.getPixelForValue(e[s]),l();for(a=void 0,s=0,o=n.ticks.length;s<o;++s)r=n.getPixelForTick(s),l();return i}function rf(t,n,e,i){let s=e.barThickness,o,r;return A(s)?(o=n.min*e.categoryPercentage,r=e.barPercentage):(o=s*i,r=1),{chunk:o/i,ratio:r,start:n.pixels[t]-o/2}}function af(t,n,e,i){let s=n.pixels,o=s[t],r=t>0?s[t-1]:null,a=t<s.length-1?s[t+1]:null,l=e.categoryPercentage;r===null&&(r=o-(a===null?n.end-n.start:a-o)),a===null&&(a=o+o-r);let c=o-(o-Math.min(r,a))/2*l;return{chunk:Math.abs(a-r)/2*l/i,ratio:e.barPercentage,start:c}}function lf(t,n,e,i){let s=e.parse(t[0],i),o=e.parse(t[1],i),r=Math.min(s,o),a=Math.max(s,o),l=r,c=a;Math.abs(r)>Math.abs(a)&&(l=a,c=r),n[e.axis]=c,n._custom={barStart:l,barEnd:c,start:s,end:o,min:r,max:a}}function yl(t,n,e,i){return Q(t)?lf(t,n,e,i):n[e.axis]=e.parse(t,i),n}function Ca(t,n,e,i){let s=t.iScale,o=t.vScale,r=s.getLabels(),a=s===o,l=[],c,d,h,u;for(c=e,d=e+i;c<d;++c)u=n[c],h={},h[s.axis]=a||s.parse(r[c],c),l.push(yl(u,h,o,c));return l}function Fs(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function cf(t,n,e){return t!==0?Me(t):(n.isHorizontal()?1:-1)*(n.min>=e?1:-1)}function df(t){let n,e,i,s,o;return t.horizontal?(n=t.base>t.x,e="left",i="right"):(n=t.base<t.y,e="bottom",i="top"),n?(s="end",o="start"):(s="start",o="end"),{start:e,end:i,reverse:n,top:s,bottom:o}}function hf(t,n,e,i){let s=n.borderSkipped,o={};if(!s){t.borderSkipped=o;return}if(s===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:r,end:a,reverse:l,top:c,bottom:d}=df(t);s==="middle"&&e&&(t.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=d:(o[Sa(d,r,a,l)]=!0,s=c)),o[Sa(s,r,a,l)]=!0,t.borderSkipped=o}function Sa(t,n,e,i){return i?(t=uf(t,n,e),t=ka(t,e,n)):t=ka(t,n,e),t}function uf(t,n,e){return t===n?e:t===e?n:t}function ka(t,n,e){return t==="start"?n:t==="end"?e:t}function ff(t,{inflateAmount:n},e){t.inflateAmount=n==="auto"?e===1?.33:0:n}var pf=(()=>{class t extends ht{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(e,i,s,o){return Ca(e,i,s,o)}parseArrayData(e,i,s,o){return Ca(e,i,s,o)}parseObjectData(e,i,s,o){let{iScale:r,vScale:a}=e,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=r.axis==="x"?l:c,h=a.axis==="x"?l:c,u=[],f,g,p,m;for(f=s,g=s+o;f<g;++f)m=i[f],p={},p[r.axis]=r.parse(Ye(m,d),f),u.push(yl(Ye(m,h),p,a,f));return u}updateRangeFromParsed(e,i,s,o){super.updateRangeFromParsed(e,i,s,o);let r=s._custom;r&&i===this._cachedMeta.vScale&&(e.min=Math.min(e.min,r.min),e.max=Math.max(e.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(e){let i=this._cachedMeta,{iScale:s,vScale:o}=i,r=this.getParsed(e),a=r._custom,l=Fs(a)?"["+a.start+", "+a.end+"]":""+o.getLabelForValue(r[o.axis]);return{label:""+s.getLabelForValue(r[s.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();let e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){let i=this._cachedMeta;this.updateElements(i.data,0,i.data.length,e)}updateElements(e,i,s,o){let r=o==="reset",{index:a,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),d=l.isHorizontal(),h=this._getRuler(),{sharedOptions:u,includeOptions:f}=this._getSharedOptions(i,o);for(let g=i;g<i+s;g++){let p=this.getParsed(g),m=r||A(p[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(g),b=this._calculateBarIndexPixels(g,h),_=(p._stacks||{})[l.axis],x={horizontal:d,base:m.base,enableBorderRadius:!_||Fs(p._custom)||a===_._top||a===_._bottom,x:d?m.head:b.center,y:d?b.center:m.head,height:d?b.size:Math.abs(m.size),width:d?Math.abs(m.size):b.size};f&&(x.options=u||this.resolveDataElementOptions(g,e[g].active?"active":o));let w=x.options||e[g].options;hf(x,w,_,a),ff(x,w,h.ratio),this.updateElement(e[g],g,x,o)}}_getStacks(e,i){let{iScale:s}=this._cachedMeta,o=s.getMatchingVisibleMetas(this._type).filter(h=>h.controller.options.grouped),r=s.options.stacked,a=[],l=this._cachedMeta.controller.getParsed(i),c=l&&l[s.axis],d=h=>{let u=h._parsed.find(g=>g[s.axis]===c),f=u&&u[h.vScale.axis];if(A(f)||isNaN(f))return!0};for(let h of o)if(!(i!==void 0&&d(h))&&((r===!1||a.indexOf(h.stack)===-1||r===void 0&&h.stack===void 0)&&a.push(h.stack),h.index===e))break;return a.length||a.push(void 0),a}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let e=this.chart.scales,i=this.chart.options.indexAxis;return Object.keys(e).filter(s=>e[s].axis===i).shift()}_getAxis(){let e={},i=this.getFirstScaleIdForIndexAxis();for(let s of this.chart.data.datasets)e[I(this.chart.options.indexAxis==="x"?s.xAxisID:s.yAxisID,i)]=!0;return Object.keys(e)}_getStackIndex(e,i,s){let o=this._getStacks(e,s),r=i!==void 0?o.indexOf(i):-1;return r===-1?o.length-1:r}_getRuler(){let e=this.options,i=this._cachedMeta,s=i.iScale,o=[],r,a;for(r=0,a=i.data.length;r<a;++r)o.push(s.getPixelForValue(this.getParsed(r)[s.axis],r));let l=e.barThickness;return{min:l||of(i),pixels:o,start:s._startPixel,end:s._endPixel,stackCount:this._getStackCount(),scale:s,grouped:e.grouped,ratio:l?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){let{_cachedMeta:{vScale:i,_stacked:s,index:o},options:{base:r,minBarLength:a}}=this,l=r||0,c=this.getParsed(e),d=c._custom,h=Fs(d),u=c[i.axis],f=0,g=s?this.applyStack(i,c,s):u,p,m;g!==u&&(f=g-u,g=u),h&&(u=d.barStart,g=d.barEnd-d.barStart,u!==0&&Me(u)!==Me(d.barEnd)&&(f=0),f+=u);let b=!A(r)&&!h?r:f,_=i.getPixelForValue(b);if(this.chart.getDataVisibility(e)?p=i.getPixelForValue(f+g):p=_,m=p-_,Math.abs(m)<a){m=cf(m,i,l)*a,u===l&&(_-=m/2);let x=i.getPixelForDecimal(0),w=i.getPixelForDecimal(1),y=Math.min(x,w),v=Math.max(x,w);_=Math.max(Math.min(_,v),y),p=_+m,s&&!h&&(c._stacks[i.axis]._visualValues[o]=i.getValueForPixel(p)-i.getValueForPixel(_))}if(_===i.getPixelForValue(l)){let x=Me(m)*i.getLineWidthForValue(l)/2;_+=x,m-=x}return{size:m,base:_,head:p,center:p+m/2}}_calculateBarIndexPixels(e,i){let s=i.scale,o=this.options,r=o.skipNull,a=I(o.maxBarThickness,1/0),l,c,d=this._getAxisCount();if(i.grouped){let h=r?this._getStackCount(e):i.stackCount,u=o.barThickness==="flex"?af(e,i,o,h*d):rf(e,i,o,h*d),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,g=this._getAxis().indexOf(I(f,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,r?e:void 0)+g;l=u.start+u.chunk*p+u.chunk/2,c=Math.min(a,u.chunk*u.ratio)}else l=s.getPixelForValue(this.getParsed(e)[s.axis],e),c=Math.min(a,i.min*i.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){let e=this._cachedMeta,i=e.vScale,s=e.data,o=s.length,r=0;for(;r<o;++r)this.getParsed(r)[i.axis]!==null&&!s[r].hidden&&s[r].draw(this._ctx)}}return t})(),gf=(()=>{class t extends ht{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,i,s,o){let r=super.parsePrimitiveData(e,i,s,o);for(let a=0;a<r.length;a++)r[a]._custom=this.resolveDataElementOptions(a+s).radius;return r}parseArrayData(e,i,s,o){let r=super.parseArrayData(e,i,s,o);for(let a=0;a<r.length;a++){let l=i[s+a];r[a]._custom=I(l[2],this.resolveDataElementOptions(a+s).radius)}return r}parseObjectData(e,i,s,o){let r=super.parseObjectData(e,i,s,o);for(let a=0;a<r.length;a++){let l=i[s+a];r[a]._custom=I(l&&l.r&&+l.r,this.resolveDataElementOptions(a+s).radius)}return r}getMaxOverflow(){let e=this._cachedMeta.data,i=0;for(let s=e.length-1;s>=0;--s)i=Math.max(i,e[s].size(this.resolveDataElementOptions(s))/2);return i>0&&i}getLabelAndValue(e){let i=this._cachedMeta,s=this.chart.data.labels||[],{xScale:o,yScale:r}=i,a=this.getParsed(e),l=o.getLabelForValue(a.x),c=r.getLabelForValue(a.y),d=a._custom;return{label:s[e]||"",value:"("+l+", "+c+(d?", "+d:"")+")"}}update(e){let i=this._cachedMeta.data;this.updateElements(i,0,i.length,e)}updateElements(e,i,s,o){let r=o==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(i,o),h=a.axis,u=l.axis;for(let f=i;f<i+s;f++){let g=e[f],p=!r&&this.getParsed(f),m={},b=m[h]=r?a.getPixelForDecimal(.5):a.getPixelForValue(p[h]),_=m[u]=r?l.getBasePixel():l.getPixelForValue(p[u]);m.skip=isNaN(b)||isNaN(_),d&&(m.options=c||this.resolveDataElementOptions(f,g.active?"active":o),r&&(m.options.radius=0)),this.updateElement(g,f,m,o)}}resolveDataElementOptions(e,i){let s=this.getParsed(e),o=super.resolveDataElementOptions(e,i);o.$shared&&(o=Object.assign({},o,{$shared:!1}));let r=o.radius;return i!=="active"&&(o.radius=0),o.radius+=I(s&&s._custom,r),o}}return t})();function mf(t,n,e){let i=1,s=1,o=0,r=0;if(n<Y){let a=t,l=a+n,c=Math.cos(a),d=Math.sin(a),h=Math.cos(l),u=Math.sin(l),f=(x,w,y)=>Kt(x,a,l,!0)?1:Math.max(w,w*e,y,y*e),g=(x,w,y)=>Kt(x,a,l,!0)?-1:Math.min(w,w*e,y,y*e),p=f(0,c,h),m=f(Z,d,u),b=g(B,c,h),_=g(B+Z,d,u);i=(p-b)/2,s=(m-_)/2,o=-(p+b)/2,r=-(m+_)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:r}}var fo=(()=>{class t extends ht{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){let i=e.data;if(i.labels.length&&i.datasets.length){let{labels:{pointStyle:s,color:o}}=e.legend.options;return i.labels.map((r,a)=>{let c=e.getDatasetMeta(0).controller.getStyle(a);return{text:r,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:o,lineWidth:c.borderWidth,pointStyle:s,hidden:!e.getDataVisibility(a),index:a}})}return[]}},onClick(e,i,s){s.chart.toggleDataVisibility(i.index),s.chart.update()}}}};constructor(e,i){super(e,i),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,i){let s=this.getDataset().data,o=this._cachedMeta;if(this._parsing===!1)o._parsed=s;else{let r=c=>+s[c];if(F(s[e])){let{key:c="value"}=this._parsing;r=d=>+Ye(s[d],c)}let a,l;for(a=e,l=e+i;a<l;++a)o._parsed[a]=r(a)}}_getRotation(){return Se(this.options.rotation-90)}_getCircumference(){return Se(this.options.circumference)}_getRotationExtents(){let e=Y,i=-Y;for(let s=0;s<this.chart.data.datasets.length;++s)if(this.chart.isDatasetVisible(s)&&this.chart.getDatasetMeta(s).type===this._type){let o=this.chart.getDatasetMeta(s).controller,r=o._getRotation(),a=o._getCircumference();e=Math.min(e,r),i=Math.max(i,r+a)}return{rotation:e,circumference:i-e}}update(e){let i=this.chart,{chartArea:s}=i,o=this._cachedMeta,r=o.data,a=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,l=Math.max((Math.min(s.width,s.height)-a)/2,0),c=Math.min($r(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:h,rotation:u}=this._getRotationExtents(),{ratioX:f,ratioY:g,offsetX:p,offsetY:m}=mf(u,h,c),b=(s.width-a)/f,_=(s.height-a)/g,x=Math.max(Math.min(b,_)/2,0),w=rs(this.options.radius,x),y=Math.max(w*c,0),v=(w-y)/this._getVisibleDatasetWeightTotal();this.offsetX=p*w,this.offsetY=m*w,o.total=this.calculateTotal(),this.outerRadius=w-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*d,0),this.updateElements(r,0,r.length,e)}_circumference(e,i){let s=this.options,o=this._cachedMeta,r=this._getCircumference();return i&&s.animation.animateRotate||!this.chart.getDataVisibility(e)||o._parsed[e]===null||o.data[e].hidden?0:this.calculateCircumference(o._parsed[e]*r/Y)}updateElements(e,i,s,o){let r=o==="reset",a=this.chart,l=a.chartArea,d=a.options.animation,h=(l.left+l.right)/2,u=(l.top+l.bottom)/2,f=r&&d.animateScale,g=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:m,includeOptions:b}=this._getSharedOptions(i,o),_=this._getRotation(),x;for(x=0;x<i;++x)_+=this._circumference(x,r);for(x=i;x<i+s;++x){let w=this._circumference(x,r),y=e[x],v={x:h+this.offsetX,y:u+this.offsetY,startAngle:_,endAngle:_+w,circumference:w,outerRadius:p,innerRadius:g};b&&(v.options=m||this.resolveDataElementOptions(x,y.active?"active":o)),_+=w,this.updateElement(y,x,v,o)}}calculateTotal(){let e=this._cachedMeta,i=e.data,s=0,o;for(o=0;o<i.length;o++){let r=e._parsed[o];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(o)&&!i[o].hidden&&(s+=Math.abs(r))}return s}calculateCircumference(e){let i=this._cachedMeta.total;return i>0&&!isNaN(e)?Y*(Math.abs(e)/i):0}getLabelAndValue(e){let i=this._cachedMeta,s=this.chart,o=s.data.labels||[],r=Ut(i._parsed[e],s.options.locale);return{label:o[e]||"",value:r}}getMaxBorderWidth(e){let i=0,s=this.chart,o,r,a,l,c;if(!e){for(o=0,r=s.data.datasets.length;o<r;++o)if(s.isDatasetVisible(o)){a=s.getDatasetMeta(o),e=a.data,l=a.controller;break}}if(!e)return 0;for(o=0,r=e.length;o<r;++o)c=l.resolveDataElementOptions(o),c.borderAlign!=="inner"&&(i=Math.max(i,c.borderWidth||0,c.hoverBorderWidth||0));return i}getMaxOffset(e){let i=0;for(let s=0,o=e.length;s<o;++s){let r=this.resolveDataElementOptions(s);i=Math.max(i,r.offset||0,r.hoverOffset||0)}return i}_getRingWeightOffset(e){let i=0;for(let s=0;s<e;++s)this.chart.isDatasetVisible(s)&&(i+=this._getRingWeight(s));return i}_getRingWeight(e){return Math.max(I(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}return t})(),bf=(()=>{class t extends ht{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){let i=this._cachedMeta,{dataset:s,data:o=[],_dataset:r}=i,a=this.chart._animationsDisabled,{start:l,count:c}=ms(i,o,a);this._drawStart=l,this._drawCount=c,bs(i)&&(l=0,c=o.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!r._decimated,s.points=o;let d=this.resolveDatasetElementOptions(e);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(s,void 0,{animated:!a,options:d},e),this.updateElements(o,l,c,e)}updateElements(e,i,s,o){let r=o==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:h,includeOptions:u}=this._getSharedOptions(i,o),f=a.axis,g=l.axis,{spanGaps:p,segment:m}=this.options,b=Ct(p)?p:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||r||o==="none",x=i+s,w=e.length,y=i>0&&this.getParsed(i-1);for(let v=0;v<w;++v){let k=e[v],C=_?k:{};if(v<i||v>=x){C.skip=!0;continue}let D=this.getParsed(v),z=A(D[g]),R=C[f]=a.getPixelForValue(D[f],v),V=C[g]=r||z?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,D,c):D[g],v);C.skip=isNaN(R)||isNaN(V)||z,C.stop=v>0&&Math.abs(D[f]-y[f])>b,m&&(C.parsed=D,C.raw=d.data[v]),u&&(C.options=h||this.resolveDataElementOptions(v,k.active?"active":o)),_||this.updateElement(k,v,C,o),y=D}}getMaxOverflow(){let e=this._cachedMeta,i=e.dataset,s=i.options&&i.options.borderWidth||0,o=e.data||[];if(!o.length)return s;let r=o[0].size(this.resolveDataElementOptions(0)),a=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(s,r,a)/2}draw(){let e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}return t})(),xl=(()=>{class t extends ht{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){let i=e.data;if(i.labels.length&&i.datasets.length){let{labels:{pointStyle:s,color:o}}=e.legend.options;return i.labels.map((r,a)=>{let c=e.getDatasetMeta(0).controller.getStyle(a);return{text:r,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:o,lineWidth:c.borderWidth,pointStyle:s,hidden:!e.getDataVisibility(a),index:a}})}return[]}},onClick(e,i,s){s.chart.toggleDataVisibility(i.index),s.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(e,i){super(e,i),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){let i=this._cachedMeta,s=this.chart,o=s.data.labels||[],r=Ut(i._parsed[e].r,s.options.locale);return{label:o[e]||"",value:r}}parseObjectData(e,i,s,o){return ks.bind(this)(e,i,s,o)}update(e){let i=this._cachedMeta.data;this._updateRadius(),this.updateElements(i,0,i.length,e)}getMinMax(){let e=this._cachedMeta,i={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((s,o)=>{let r=this.getParsed(o).r;!isNaN(r)&&this.chart.getDataVisibility(o)&&(r<i.min&&(i.min=r),r>i.max&&(i.max=r))}),i}_updateRadius(){let e=this.chart,i=e.chartArea,s=e.options,o=Math.min(i.right-i.left,i.bottom-i.top),r=Math.max(o/2,0),a=Math.max(s.cutoutPercentage?r/100*s.cutoutPercentage:1,0),l=(r-a)/e.getVisibleDatasetCount();this.outerRadius=r-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(e,i,s,o){let r=o==="reset",a=this.chart,c=a.options.animation,d=this._cachedMeta.rScale,h=d.xCenter,u=d.yCenter,f=d.getIndexAngle(0)-.5*B,g=f,p,m=360/this.countVisibleElements();for(p=0;p<i;++p)g+=this._computeAngle(p,o,m);for(p=i;p<i+s;p++){let b=e[p],_=g,x=g+this._computeAngle(p,o,m),w=a.getDataVisibility(p)?d.getDistanceFromCenterForValue(this.getParsed(p).r):0;g=x,r&&(c.animateScale&&(w=0),c.animateRotate&&(_=x=f));let y={x:h,y:u,innerRadius:0,outerRadius:w,startAngle:_,endAngle:x,options:this.resolveDataElementOptions(p,b.active?"active":o)};this.updateElement(b,p,y,o)}}countVisibleElements(){let e=this._cachedMeta,i=0;return e.data.forEach((s,o)=>{!isNaN(this.getParsed(o).r)&&this.chart.getDataVisibility(o)&&i++}),i}_computeAngle(e,i,s){return this.chart.getDataVisibility(e)?Se(this.resolveDataElementOptions(e,i).angle||s):0}}return t})(),_f=(()=>{class t extends fo{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}return t})(),yf=(()=>{class t extends ht{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(e){let i=this._cachedMeta.vScale,s=this.getParsed(e);return{label:i.getLabels()[e],value:""+i.getLabelForValue(s[i.axis])}}parseObjectData(e,i,s,o){return ks.bind(this)(e,i,s,o)}update(e){let i=this._cachedMeta,s=i.dataset,o=i.data||[],r=i.iScale.getLabels();if(s.points=o,e!=="resize"){let a=this.resolveDatasetElementOptions(e);this.options.showLine||(a.borderWidth=0);let l={_loop:!0,_fullLoop:r.length===o.length,options:a};this.updateElement(s,void 0,l,e)}this.updateElements(o,0,o.length,e)}updateElements(e,i,s,o){let r=this._cachedMeta.rScale,a=o==="reset";for(let l=i;l<i+s;l++){let c=e[l],d=this.resolveDataElementOptions(l,c.active?"active":o),h=r.getPointPositionForValue(l,this.getParsed(l).r),u=a?r.xCenter:h.x,f=a?r.yCenter:h.y,g={x:u,y:f,angle:h.angle,skip:isNaN(u)||isNaN(f),options:d};this.updateElement(c,l,g,o)}}}return t})(),xf=(()=>{class t extends ht{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(e){let i=this._cachedMeta,s=this.chart.data.labels||[],{xScale:o,yScale:r}=i,a=this.getParsed(e),l=o.getLabelForValue(a.x),c=r.getLabelForValue(a.y);return{label:s[e]||"",value:"("+l+", "+c+")"}}update(e){let i=this._cachedMeta,{data:s=[]}=i,o=this.chart._animationsDisabled,{start:r,count:a}=ms(i,s,o);if(this._drawStart=r,this._drawCount=a,bs(i)&&(r=0,a=s.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:l,_dataset:c}=i;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!c._decimated,l.points=s;let d=this.resolveDatasetElementOptions(e);d.segment=this.options.segment,this.updateElement(l,void 0,{animated:!o,options:d},e)}else this.datasetElementType&&(delete i.dataset,this.datasetElementType=!1);this.updateElements(s,r,a,e)}addElements(){let{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(e,i,s,o){let r=o==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,h=this.resolveDataElementOptions(i,o),u=this.getSharedOptions(h),f=this.includeOptions(o,u),g=a.axis,p=l.axis,{spanGaps:m,segment:b}=this.options,_=Ct(m)?m:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||r||o==="none",w=i>0&&this.getParsed(i-1);for(let y=i;y<i+s;++y){let v=e[y],k=this.getParsed(y),C=x?v:{},D=A(k[p]),z=C[g]=a.getPixelForValue(k[g],y),R=C[p]=r||D?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,k,c):k[p],y);C.skip=isNaN(z)||isNaN(R)||D,C.stop=y>0&&Math.abs(k[g]-w[g])>_,b&&(C.parsed=k,C.raw=d.data[y]),f&&(C.options=u||this.resolveDataElementOptions(y,v.active?"active":o)),x||this.updateElement(v,y,C,o),w=k}this.updateSharedOptions(u,o,h)}getMaxOverflow(){let e=this._cachedMeta,i=e.data||[];if(!this.options.showLine){let l=0;for(let c=i.length-1;c>=0;--c)l=Math.max(l,i[c].size(this.resolveDataElementOptions(c))/2);return l>0&&l}let s=e.dataset,o=s.options&&s.options.borderWidth||0;if(!i.length)return o;let r=i[0].size(this.resolveDataElementOptions(0)),a=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(o,r,a)/2}}return t})(),vf=Object.freeze({__proto__:null,BarController:pf,BubbleController:gf,DoughnutController:fo,LineController:bf,PieController:_f,PolarAreaController:xl,RadarController:yf,ScatterController:xf});function kt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var Qs=class t{static override(n){Object.assign(t.prototype,n)}options;constructor(n){this.options=n||{}}init(){}formats(){return kt()}parse(){return kt()}format(){return kt()}add(){return kt()}diff(){return kt()}startOf(){return kt()}endOf(){return kt()}},wf={_date:Qs};function Tf(t,n,e,i){let{controller:s,data:o,_sorted:r}=t,a=s._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(a&&n===a.axis&&n!=="r"&&r&&o.length){let c=a._reversePixels?Gr:Le;if(i){if(s._sharedOptions){let d=o[0],h=typeof d.getRange=="function"&&d.getRange(n);if(h){let u=c(o,n,e-h),f=c(o,n,e+h);return{lo:u.lo,hi:f.hi}}}}else{let d=c(o,n,e);if(l){let{vScale:h}=s._cachedMeta,{_parsed:u}=t,f=u.slice(0,d.lo+1).reverse().findIndex(p=>!A(p[h.axis]));d.lo-=Math.max(0,f);let g=u.slice(d.hi).findIndex(p=>!A(p[h.axis]));d.hi+=Math.max(0,g)}return d}}return{lo:0,hi:o.length-1}}function ki(t,n,e,i,s){let o=t.getSortedVisibleDatasetMetas(),r=e[n];for(let a=0,l=o.length;a<l;++a){let{index:c,data:d}=o[a],{lo:h,hi:u}=Tf(o[a],n,r,s);for(let f=h;f<=u;++f){let g=d[f];g.skip||i(g,c,f)}}}function Cf(t){let n=t.indexOf("x")!==-1,e=t.indexOf("y")!==-1;return function(i,s){let o=n?Math.abs(i.x-s.x):0,r=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function Vs(t,n,e,i,s){let o=[];return!s&&!t.isPointInArea(n)||ki(t,e,n,function(a,l,c){!s&&!Oe(a,t.chartArea,0)||a.inRange(n.x,n.y,i)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function Sf(t,n,e,i){let s=[];function o(r,a,l){let{startAngle:c,endAngle:d}=r.getProps(["startAngle","endAngle"],i),{angle:h}=hs(r,{x:n.x,y:n.y});Kt(h,c,d)&&s.push({element:r,datasetIndex:a,index:l})}return ki(t,e,n,o),s}function kf(t,n,e,i,s,o){let r=[],a=Cf(e),l=Number.POSITIVE_INFINITY;function c(d,h,u){let f=d.inRange(n.x,n.y,s);if(i&&!f)return;let g=d.getCenterPoint(s);if(!(!!o||t.isPointInArea(g))&&!f)return;let m=a(n,g);m<l?(r=[{element:d,datasetIndex:h,index:u}],l=m):m===l&&r.push({element:d,datasetIndex:h,index:u})}return ki(t,e,n,c),r}function Ns(t,n,e,i,s,o){return!o&&!t.isPointInArea(n)?[]:e==="r"&&!i?Sf(t,n,e,s):kf(t,n,e,i,s,o)}function Ma(t,n,e,i,s){let o=[],r=e==="x"?"inXRange":"inYRange",a=!1;return ki(t,e,n,(l,c,d)=>{l[r]&&l[r](n[e],s)&&(o.push({element:l,datasetIndex:c,index:d}),a=a||l.inRange(n.x,n.y,s))}),i&&!a?[]:o}var Mf={evaluateInteractionItems:ki,modes:{index(t,n,e,i){let s=ct(n,t),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?Vs(t,s,o,i,r):Ns(t,s,o,!1,i,r),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(c=>{let d=a[0].index,h=c.data[d];h&&!h.skip&&l.push({element:h,datasetIndex:c.index,index:d})}),l):[]},dataset(t,n,e,i){let s=ct(n,t),o=e.axis||"xy",r=e.includeInvisible||!1,a=e.intersect?Vs(t,s,o,i,r):Ns(t,s,o,!1,i,r);if(a.length>0){let l=a[0].datasetIndex,c=t.getDatasetMeta(l).data;a=[];for(let d=0;d<c.length;++d)a.push({element:c[d],datasetIndex:l,index:d})}return a},point(t,n,e,i){let s=ct(n,t),o=e.axis||"xy",r=e.includeInvisible||!1;return Vs(t,s,o,i,r)},nearest(t,n,e,i){let s=ct(n,t),o=e.axis||"xy",r=e.includeInvisible||!1;return Ns(t,s,o,e.intersect,i,r)},x(t,n,e,i){let s=ct(n,t);return Ma(t,s,"x",e.intersect,i)},y(t,n,e,i){let s=ct(n,t);return Ma(t,s,"y",e.intersect,i)}}},vl=["left","top","right","bottom"];function bi(t,n){return t.filter(e=>e.pos===n)}function Da(t,n){return t.filter(e=>vl.indexOf(e.pos)===-1&&e.box.axis===n)}function _i(t,n){return t.sort((e,i)=>{let s=n?i:e,o=n?e:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Df(t){let n=[],e,i,s,o,r,a;for(e=0,i=(t||[]).length;e<i;++e)s=t[e],{position:o,options:{stack:r,stackWeight:a=1}}=s,n.push({index:e,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:a});return n}function Ef(t){let n={};for(let e of t){let{stack:i,pos:s,stackWeight:o}=e;if(!i||!vl.includes(s))continue;let r=n[i]||(n[i]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return n}function If(t,n){let e=Ef(t),{vBoxMaxWidth:i,hBoxMaxHeight:s}=n,o,r,a;for(o=0,r=t.length;o<r;++o){a=t[o];let{fullSize:l}=a.box,c=e[a.stack],d=c&&a.stackWeight/c.weight;a.horizontal?(a.width=d?d*i:l&&n.availableWidth,a.height=s):(a.width=i,a.height=d?d*s:l&&n.availableHeight)}return e}function Pf(t){let n=Df(t),e=_i(n.filter(c=>c.box.fullSize),!0),i=_i(bi(n,"left"),!0),s=_i(bi(n,"right")),o=_i(bi(n,"top"),!0),r=_i(bi(n,"bottom")),a=Da(n,"x"),l=Da(n,"y");return{fullSize:e,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:bi(n,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function Ea(t,n,e,i){return Math.max(t[e],n[e])+Math.max(t[i],n[i])}function wl(t,n){t.top=Math.max(t.top,n.top),t.left=Math.max(t.left,n.left),t.bottom=Math.max(t.bottom,n.bottom),t.right=Math.max(t.right,n.right)}function Lf(t,n,e,i){let{pos:s,box:o}=e,r=t.maxPadding;if(!F(s)){e.size&&(t[s]-=e.size);let h=i[e.stack]||{size:0,count:1};h.size=Math.max(h.size,e.horizontal?o.height:o.width),e.size=h.size/h.count,t[s]+=e.size}o.getPadding&&wl(r,o.getPadding());let a=Math.max(0,n.outerWidth-Ea(r,t,"left","right")),l=Math.max(0,n.outerHeight-Ea(r,t,"top","bottom")),c=a!==t.w,d=l!==t.h;return t.w=a,t.h=l,e.horizontal?{same:c,other:d}:{same:d,other:c}}function Of(t){let n=t.maxPadding;function e(i){let s=Math.max(n[i]-t[i],0);return t[i]+=s,s}t.y+=e("top"),t.x+=e("left"),e("right"),e("bottom")}function Rf(t,n){let e=n.maxPadding;function i(s){let o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(n[r],e[r])}),o}return i(t?["left","right"]:["top","bottom"])}function vi(t,n,e,i){let s=[],o,r,a,l,c,d;for(o=0,r=t.length,c=0;o<r;++o){a=t[o],l=a.box,l.update(a.width||n.w,a.height||n.h,Rf(a.horizontal,n));let{same:h,other:u}=Lf(n,e,a,i);c|=h&&s.length,d=d||u,l.fullSize||s.push(a)}return c&&vi(s,n,e,i)||d}function hn(t,n,e,i,s){t.top=e,t.left=n,t.right=n+i,t.bottom=e+s,t.width=i,t.height=s}function Ia(t,n,e,i){let s=e.padding,{x:o,y:r}=n;for(let a of t){let l=a.box,c=i[a.stack]||{count:1,placed:0,weight:1},d=a.stackWeight/c.weight||1;if(a.horizontal){let h=n.w*d,u=c.size||l.height;Wt(c.start)&&(r=c.start),l.fullSize?hn(l,s.left,r,e.outerWidth-s.right-s.left,u):hn(l,n.left+c.placed,r,h,u),c.start=r,c.placed+=h,r=l.bottom}else{let h=n.h*d,u=c.size||l.width;Wt(c.start)&&(o=c.start),l.fullSize?hn(l,o,s.top,u,e.outerHeight-s.bottom-s.top):hn(l,o,n.top+c.placed,u,h),c.start=o,c.placed+=h,o=l.right}}n.x=o,n.y=r}var he={addBox(t,n){t.boxes||(t.boxes=[]),n.fullSize=n.fullSize||!1,n.position=n.position||"top",n.weight=n.weight||0,n._layers=n._layers||function(){return[{z:0,draw(e){n.draw(e)}}]},t.boxes.push(n)},removeBox(t,n){let e=t.boxes?t.boxes.indexOf(n):-1;e!==-1&&t.boxes.splice(e,1)},configure(t,n,e){n.fullSize=e.fullSize,n.position=e.position,n.weight=e.weight},update(t,n,e,i){if(!t)return;let s=le(t.options.layout.padding),o=Math.max(n-s.width,0),r=Math.max(e-s.height,0),a=Pf(t.boxes),l=a.vertical,c=a.horizontal;j(t.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});let d=l.reduce((p,m)=>m.box.options&&m.box.options.display===!1?p:p+1,0)||1,h=Object.freeze({outerWidth:n,outerHeight:e,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/d,hBoxMaxHeight:r/2}),u=Object.assign({},s);wl(u,le(i));let f=Object.assign({maxPadding:u,w:o,h:r,x:s.left,y:s.top},s),g=If(l.concat(c),h);vi(a.fullSize,f,h,g),vi(l,f,h,g),vi(c,f,h,g)&&vi(l,f,h,g),Of(f),Ia(a.leftAndTop,f,h,g),f.x+=f.w,f.y+=f.h,Ia(a.rightAndBottom,f,h,g),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},j(a.chartArea,p=>{let m=p.box;Object.assign(m,t.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}},xn=class{acquireContext(n,e){}releaseContext(n){return!1}addEventListener(n,e,i){}removeEventListener(n,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(n,e,i,s){return e=Math.max(0,e||n.width),i=i||n.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(n){return!0}updateConfig(n){}},Ys=class extends xn{acquireContext(n){return n&&n.getContext&&n.getContext("2d")||null}updateConfig(n){n.options.animation=!1}},bn="$chartjs",zf={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Pa=t=>t===null||t==="";function Af(t,n){let e=t.style,i=t.getAttribute("height"),s=t.getAttribute("width");if(t[bn]={initial:{height:i,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Pa(s)){let o=Ds(t,"width");o!==void 0&&(t.width=o)}if(Pa(i))if(t.style.height==="")t.height=t.width/(n||2);else{let o=Ds(t,"height");o!==void 0&&(t.height=o)}return t}var Tl=fa?{passive:!0}:!1;function Ff(t,n,e){t&&t.addEventListener(n,e,Tl)}function Vf(t,n,e){t&&t.canvas&&t.canvas.removeEventListener(n,e,Tl)}function Nf(t,n){let e=zf[t.type]||t.type,{x:i,y:s}=ct(t,n);return{type:e,chart:n,native:t,x:i!==void 0?i:null,y:s!==void 0?s:null}}function vn(t,n){for(let e of t)if(e===n||e.contains(n))return!0}function Bf(t,n,e){let i=t.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||vn(a.addedNodes,i),r=r&&!vn(a.removedNodes,i);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Hf(t,n,e){let i=t.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||vn(a.removedNodes,i),r=r&&!vn(a.addedNodes,i);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}var Ti=new Map,La=0;function Cl(){let t=window.devicePixelRatio;t!==La&&(La=t,Ti.forEach((n,e)=>{e.currentDevicePixelRatio!==t&&n()}))}function jf(t,n){Ti.size||window.addEventListener("resize",Cl),Ti.set(t,n)}function Wf(t){Ti.delete(t),Ti.size||window.removeEventListener("resize",Cl)}function $f(t,n,e){let i=t.canvas,s=i&&cn(i);if(!s)return;let o=gs((a,l)=>{let c=s.clientWidth;e(a,l),c<s.clientWidth&&e()},window),r=new ResizeObserver(a=>{let l=a[0],c=l.contentRect.width,d=l.contentRect.height;c===0&&d===0||o(c,d)});return r.observe(s),jf(t,o),r}function Bs(t,n,e){e&&e.disconnect(),n==="resize"&&Wf(t)}function Kf(t,n,e){let i=t.canvas,s=gs(o=>{t.ctx!==null&&e(Nf(o,t))},t);return Ff(i,n,s),s}var qs=class extends xn{acquireContext(n,e){let i=n&&n.getContext&&n.getContext("2d");return i&&i.canvas===n?(Af(n,e),i):null}releaseContext(n){let e=n.canvas;if(!e[bn])return!1;let i=e[bn].initial;["height","width"].forEach(o=>{let r=i[o];A(r)?e.removeAttribute(o):e.setAttribute(o,r)});let s=i.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[bn],!0}addEventListener(n,e,i){this.removeEventListener(n,e);let s=n.$proxies||(n.$proxies={}),r={attach:Bf,detach:Hf,resize:$f}[e]||Kf;s[e]=r(n,e,i)}removeEventListener(n,e){let i=n.$proxies||(n.$proxies={}),s=i[e];if(!s)return;({attach:Bs,detach:Bs,resize:Bs}[e]||Vf)(n,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(n,e,i,s){return ua(n,e,i,s)}isAttached(n){let e=n&&cn(n);return!!(e&&e.isConnected)}};function Uf(t){return!ln()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?Ys:qs}var De=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(n){let{x:e,y:i}=this.getProps(["x","y"],n);return{x:e,y:i}}hasValue(){return Ct(this.x)&&Ct(this.y)}getProps(n,e){let i=this.$animations;if(!e||!i)return this;let s={};return n.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}};function Qf(t,n){let e=t.options.ticks,i=Yf(t),s=Math.min(e.maxTicksLimit||i,i),o=e.major.enabled?Gf(n):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return Xf(n,c,o,r/s),c;let d=qf(o,n,s);if(r>0){let h,u,f=r>1?Math.round((l-a)/(r-1)):null;for(un(n,c,d,A(f)?0:a-f,a),h=0,u=r-1;h<u;h++)un(n,c,d,o[h],o[h+1]);return un(n,c,d,l,A(f)?n.length:l+f),c}return un(n,c,d),c}function Yf(t){let n=t.options.offset,e=t._tickSize(),i=t._length/e+(n?0:1),s=t._maxLength/e;return Math.floor(Math.min(i,s))}function qf(t,n,e){let i=Jf(t),s=n.length/e;if(!i)return Math.max(s,1);let o=Qr(i);for(let r=0,a=o.length-1;r<a;r++){let l=o[r];if(l>s)return l}return Math.max(s,1)}function Gf(t){let n=[],e,i;for(e=0,i=t.length;e<i;e++)t[e].major&&n.push(e);return n}function Xf(t,n,e,i){let s=0,o=e[0],r;for(i=Math.ceil(i),r=0;r<t.length;r++)r===o&&(n.push(t[r]),s++,o=e[s*i])}function un(t,n,e,i,s){let o=I(i,0),r=Math.min(I(s,t.length),t.length),a=0,l,c,d;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),d=o;d<0;)a++,d=Math.round(o+a*e);for(c=Math.max(o,0);c<r;c++)c===d&&(n.push(t[c]),a++,d=Math.round(o+a*e))}function Jf(t){let n=t.length,e,i;if(n<2)return!1;for(i=t[0],e=1;e<n;++e)if(t[e]-t[e-1]!==i)return!1;return i}var Zf=t=>t==="left"?"right":t==="right"?"left":t,Oa=(t,n,e)=>n==="top"||n==="left"?t[n]+e:t[n]-e,Ra=(t,n)=>Math.min(n||t,t);function za(t,n){let e=[],i=t.length/n,s=t.length,o=0;for(;o<s;o+=i)e.push(t[Math.floor(o)]);return e}function ep(t,n,e){let i=t.ticks.length,s=Math.min(n,i-1),o=t._startPixel,r=t._endPixel,a=1e-6,l=t.getPixelForTick(s),c;if(!(e&&(i===1?c=Math.max(l-o,r-l):n===0?c=(t.getPixelForTick(1)-l)/2:c=(l-t.getPixelForTick(s-1))/2,l+=s<n?c:-c,l<o-a||l>r+a)))return l}function tp(t,n){j(t,e=>{let i=e.gc,s=i.length/2,o;if(s>n){for(o=0;o<s;++o)delete e.data[i[o]];i.splice(0,s)}})}function yi(t){return t.drawTicks?t.tickLength:0}function Aa(t,n){if(!t.display)return 0;let e=ie(t.font,n),i=le(t.padding);return(Q(t.text)?t.text.length:1)*e.lineHeight+i.height}function ip(t,n){return qe(t,{scale:n,type:"scale"})}function np(t,n,e){return qe(t,{tick:e,index:n,type:"tick"})}function sp(t,n,e){let i=nn(t);return(e&&n!=="right"||!e&&n==="right")&&(i=Zf(i)),i}function op(t,n,e,i){let{top:s,left:o,bottom:r,right:a,chart:l}=t,{chartArea:c,scales:d}=l,h=0,u,f,g,p=r-s,m=a-o;if(t.isHorizontal()){if(f=ae(i,o,a),F(e)){let b=Object.keys(e)[0],_=e[b];g=d[b].getPixelForValue(_)+p-n}else e==="center"?g=(c.bottom+c.top)/2+p-n:g=Oa(t,e,n);u=a-o}else{if(F(e)){let b=Object.keys(e)[0],_=e[b];f=d[b].getPixelForValue(_)-m+n}else e==="center"?f=(c.left+c.right)/2-m+n:f=Oa(t,e,n);g=ae(i,r,s),h=e==="left"?-Z:Z}return{titleX:f,titleY:g,maxWidth:u,rotation:h}}var Dt=class t extends De{constructor(n){super(),this.id=n.id,this.type=n.type,this.options=void 0,this.ctx=n.ctx,this.chart=n.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(n){this.options=n.setContext(this.getContext()),this.axis=n.axis,this._userMin=this.parse(n.min),this._userMax=this.parse(n.max),this._suggestedMin=this.parse(n.suggestedMin),this._suggestedMax=this.parse(n.suggestedMax)}parse(n,e){return n}getUserBounds(){let{_userMin:n,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return n=me(n,Number.POSITIVE_INFINITY),e=me(e,Number.NEGATIVE_INFINITY),i=me(i,Number.POSITIVE_INFINITY),s=me(s,Number.NEGATIVE_INFINITY),{min:me(n,i),max:me(e,s),minDefined:J(n),maxDefined:J(e)}}getMinMax(n){let{min:e,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:e,max:i};let a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,n),s||(e=Math.min(e,r.min)),o||(i=Math.max(i,r.max));return e=o&&e>i?i:e,i=s&&e>i?e:i,{min:me(e,me(i,e)),max:me(i,me(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let n=this.chart.data;return this.options.labels||(this.isHorizontal()?n.xLabels:n.yLabels)||n.labels||[]}getLabelItems(n=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(n))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){U(this.options.beforeUpdate,[this])}update(n,e,i){let{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=n,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ra(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=a<this.ticks.length;this._convertTicksToLabels(l?za(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Qf(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let n=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,n=!n),this._startPixel=e,this._endPixel=i,this._reversePixels=n,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){U(this.options.afterUpdate,[this])}beforeSetDimensions(){U(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){U(this.options.afterSetDimensions,[this])}_callHooks(n){this.chart.notifyPlugins(n,this.getContext()),U(this.options[n],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){U(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(n){let e=this.options.ticks,i,s,o;for(i=0,s=n.length;i<s;i++)o=n[i],o.label=U(e.callback,[o.value,i,n],this)}afterTickToLabelConversion(){U(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){U(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let n=this.options,e=n.ticks,i=Ra(this.ticks.length,n.ticks.maxTicksLimit),s=e.minRotation||0,o=e.maxRotation,r=s,a,l,c;if(!this._isVisible()||!e.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}let d=this._getLabelSizes(),h=d.widest.width,u=d.highest.height,f=ne(this.chart.width-h,0,this.maxWidth);a=n.offset?this.maxWidth/i:f/(i-1),h+6>a&&(a=f/(i-(n.offset?.5:1)),l=this.maxHeight-yi(n.grid)-e.padding-Aa(n.title,this.chart.options.font),c=Math.sqrt(h*h+u*u),r=en(Math.min(Math.asin(ne((d.highest.height+6)/a,-1,1)),Math.asin(ne(l/c,-1,1))-Math.asin(ne(u/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){U(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){U(this.options.beforeFit,[this])}fit(){let n={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){let l=Aa(s,e.options.font);if(a?(n.width=this.maxWidth,n.height=yi(o)+l):(n.height=this.maxHeight,n.width=yi(o)+l),i.display&&this.ticks.length){let{first:c,last:d,widest:h,highest:u}=this._getLabelSizes(),f=i.padding*2,g=Se(this.labelRotation),p=Math.cos(g),m=Math.sin(g);if(a){let b=i.mirror?0:m*h.width+p*u.height;n.height=Math.min(this.maxHeight,n.height+b+f)}else{let b=i.mirror?0:p*h.width+m*u.height;n.width=Math.min(this.maxWidth,n.width+b+f)}this._calculatePadding(c,d,m,p)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=n.height):(this.width=n.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(n,e,i,s){let{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let d=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1),u=0,f=0;l?c?(u=s*n.width,f=i*e.height):(u=i*n.height,f=s*e.width):o==="start"?f=e.width:o==="end"?u=n.width:o!=="inner"&&(u=n.width/2,f=e.width/2),this.paddingLeft=Math.max((u-d+r)*this.width/(this.width-d),0),this.paddingRight=Math.max((f-h+r)*this.width/(this.width-h),0)}else{let d=e.height/2,h=n.height/2;o==="start"?(d=0,h=n.height):o==="end"&&(d=e.height,h=0),this.paddingTop=d+r,this.paddingBottom=h+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){U(this.options.afterFit,[this])}isHorizontal(){let{axis:n,position:e}=this.options;return e==="top"||e==="bottom"||n==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(n){this.beforeTickToLabelConversion(),this.generateTickLabels(n);let e,i;for(e=0,i=n.length;e<i;e++)A(n[e].label)&&(n.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let n=this._labelSizes;if(!n){let e=this.options.ticks.sampleSize,i=this.ticks;e<i.length&&(i=za(i,e)),this._labelSizes=n=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return n}_computeLabelSizes(n,e,i){let{ctx:s,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(e/Ra(e,i)),c=0,d=0,h,u,f,g,p,m,b,_,x,w,y;for(h=0;h<e;h+=l){if(g=n[h].label,p=this._resolveTickFontOptions(h),s.font=m=p.string,b=o[m]=o[m]||{data:{},gc:[]},_=p.lineHeight,x=w=0,!A(g)&&!Q(g))x=hi(s,b.data,b.gc,x,g),w=_;else if(Q(g))for(u=0,f=g.length;u<f;++u)y=g[u],!A(y)&&!Q(y)&&(x=hi(s,b.data,b.gc,x,y),w+=_);r.push(x),a.push(w),c=Math.max(x,c),d=Math.max(w,d)}tp(o,e);let v=r.indexOf(c),k=a.indexOf(d),C=D=>({width:r[D]||0,height:a[D]||0});return{first:C(0),last:C(e-1),widest:C(v),highest:C(k),widths:r,heights:a}}getLabelForValue(n){return n}getPixelForValue(n,e){return NaN}getValueForPixel(n){}getPixelForTick(n){let e=this.ticks;return n<0||n>e.length-1?null:this.getPixelForValue(e[n].value)}getPixelForDecimal(n){this._reversePixels&&(n=1-n);let e=this._startPixel+n*this._length;return qr(this._alignToPixels?rt(this.chart,e,0):e)}getDecimalForPixel(n){let e=(n-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:n,max:e}=this;return n<0&&e<0?e:n>0&&e>0?n:0}getContext(n){let e=this.ticks||[];if(n>=0&&n<e.length){let i=e[n];return i.$context||(i.$context=np(this.getContext(),n,i))}return this.$context||(this.$context=ip(this.chart.getContext(),this))}_tickSize(){let n=this.options.ticks,e=Se(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=n.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*i>a*s?a/i:l/s:l*s<a*i?l/i:a/s}_isVisible(){let n=this.options.display;return n!=="auto"?!!n:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(n){let e=this.axis,i=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),h=this.ticks.length+(l?1:0),u=yi(o),f=[],g=a.setContext(this.getContext()),p=g.display?g.width:0,m=p/2,b=function(X){return rt(i,X,p)},_,x,w,y,v,k,C,D,z,R,V,se;if(r==="top")_=b(this.bottom),k=this.bottom-u,D=_-m,R=b(n.top)+m,se=n.bottom;else if(r==="bottom")_=b(this.top),R=n.top,se=b(n.bottom)-m,k=_+m,D=this.top+u;else if(r==="left")_=b(this.right),v=this.right-u,C=_-m,z=b(n.left)+m,V=n.right;else if(r==="right")_=b(this.left),z=n.left,V=b(n.right)-m,v=_+m,C=this.left+u;else if(e==="x"){if(r==="center")_=b((n.top+n.bottom)/2+.5);else if(F(r)){let X=Object.keys(r)[0],ee=r[X];_=b(this.chart.scales[X].getPixelForValue(ee))}R=n.top,se=n.bottom,k=_+m,D=k+u}else if(e==="y"){if(r==="center")_=b((n.left+n.right)/2);else if(F(r)){let X=Object.keys(r)[0],ee=r[X];_=b(this.chart.scales[X].getPixelForValue(ee))}v=_-m,C=v-u,z=n.left,V=n.right}let ye=I(s.ticks.maxTicksLimit,h),W=Math.max(1,Math.ceil(h/ye));for(x=0;x<h;x+=W){let X=this.getContext(x),ee=o.setContext(X),ke=a.setContext(X),ce=ee.lineWidth,Et=ee.color,Mi=ke.dash||[],It=ke.dashOffset,Jt=ee.tickWidth,ut=ee.tickColor,Zt=ee.tickBorderDash||[],ft=ee.tickBorderDashOffset;w=ep(this,x,l),w!==void 0&&(y=rt(i,w,ce),c?v=C=z=V=y:k=D=R=se=y,f.push({tx1:v,ty1:k,tx2:C,ty2:D,x1:z,y1:R,x2:V,y2:se,width:ce,color:Et,borderDash:Mi,borderDashOffset:It,tickWidth:Jt,tickColor:ut,tickBorderDash:Zt,tickBorderDashOffset:ft}))}return this._ticksLength=h,this._borderValue=_,f}_computeLabelItems(n){let e=this.axis,i=this.options,{position:s,ticks:o}=i,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:d,mirror:h}=o,u=yi(i.grid),f=u+d,g=h?-d:f,p=-Se(this.labelRotation),m=[],b,_,x,w,y,v,k,C,D,z,R,V,se="middle";if(s==="top")v=this.bottom-g,k=this._getXAxisLabelAlignment();else if(s==="bottom")v=this.top+g,k=this._getXAxisLabelAlignment();else if(s==="left"){let W=this._getYAxisLabelAlignment(u);k=W.textAlign,y=W.x}else if(s==="right"){let W=this._getYAxisLabelAlignment(u);k=W.textAlign,y=W.x}else if(e==="x"){if(s==="center")v=(n.top+n.bottom)/2+f;else if(F(s)){let W=Object.keys(s)[0],X=s[W];v=this.chart.scales[W].getPixelForValue(X)+f}k=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")y=(n.left+n.right)/2-f;else if(F(s)){let W=Object.keys(s)[0],X=s[W];y=this.chart.scales[W].getPixelForValue(X)}k=this._getYAxisLabelAlignment(u).textAlign}e==="y"&&(l==="start"?se="top":l==="end"&&(se="bottom"));let ye=this._getLabelSizes();for(b=0,_=a.length;b<_;++b){x=a[b],w=x.label;let W=o.setContext(this.getContext(b));C=this.getPixelForTick(b)+o.labelOffset,D=this._resolveTickFontOptions(b),z=D.lineHeight,R=Q(w)?w.length:1;let X=R/2,ee=W.color,ke=W.textStrokeColor,ce=W.textStrokeWidth,Et=k;r?(y=C,k==="inner"&&(b===_-1?Et=this.options.reverse?"left":"right":b===0?Et=this.options.reverse?"right":"left":Et="center"),s==="top"?c==="near"||p!==0?V=-R*z+z/2:c==="center"?V=-ye.highest.height/2-X*z+z:V=-ye.highest.height+z/2:c==="near"||p!==0?V=z/2:c==="center"?V=ye.highest.height/2-X*z:V=ye.highest.height-R*z,h&&(V*=-1),p!==0&&!W.showLabelBackdrop&&(y+=z/2*Math.sin(p))):(v=C,V=(1-R)*z/2);let Mi;if(W.showLabelBackdrop){let It=le(W.backdropPadding),Jt=ye.heights[b],ut=ye.widths[b],Zt=V-It.top,ft=0-It.left;switch(se){case"middle":Zt-=Jt/2;break;case"bottom":Zt-=Jt;break}switch(k){case"center":ft-=ut/2;break;case"right":ft-=ut;break;case"inner":b===_-1?ft-=ut:b>0&&(ft-=ut/2);break}Mi={left:ft,top:Zt,width:ut+It.width,height:Jt+It.height,color:W.backdropColor}}m.push({label:w,font:D,textOffset:V,options:{rotation:p,color:ee,strokeColor:ke,strokeWidth:ce,textAlign:Et,textBaseline:se,translation:[y,v],backdrop:Mi}})}return m}_getXAxisLabelAlignment(){let{position:n,ticks:e}=this.options;if(-Se(this.labelRotation))return n==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(n){let{position:e,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=n+o,l=r.widest.width,c,d;return e==="left"?s?(d=this.right+o,i==="near"?c="left":i==="center"?(c="center",d+=l/2):(c="right",d+=l)):(d=this.right-a,i==="near"?c="right":i==="center"?(c="center",d-=l/2):(c="left",d=this.left)):e==="right"?s?(d=this.left+o,i==="near"?c="right":i==="center"?(c="center",d-=l/2):(c="left",d-=l)):(d=this.left+a,i==="near"?c="left":i==="center"?(c="center",d+=l/2):(c="right",d=this.right)):c="right",{textAlign:c,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;let n=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:n.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:n.width}}drawBackground(){let{ctx:n,options:{backgroundColor:e},left:i,top:s,width:o,height:r}=this;e&&(n.save(),n.fillStyle=e,n.fillRect(i,s,o,r),n.restore())}getLineWidthForValue(n){let e=this.options.grid;if(!this._isVisible()||!e.display)return 0;let s=this.ticks.findIndex(o=>o.value===n);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(n){let e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(n)),o,r,a=(l,c,d)=>{!d.width||!d.color||(i.save(),i.lineWidth=d.width,i.strokeStyle=d.color,i.setLineDash(d.borderDash||[]),i.lineDashOffset=d.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(o=0,r=s.length;o<r;++o){let l=s[o];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){let{chart:n,ctx:e,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),r=i.display?o.width:0;if(!r)return;let a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue,c,d,h,u;this.isHorizontal()?(c=rt(n,this.left,r)-r/2,d=rt(n,this.right,a)+a/2,h=u=l):(h=rt(n,this.top,r)-r/2,u=rt(n,this.bottom,a)+a/2,c=d=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,h),e.lineTo(d,u),e.stroke(),e.restore()}drawLabels(n){if(!this.options.ticks.display)return;let i=this.ctx,s=this._computeLabelArea();s&&pi(i,s);let o=this.getLabelItems(n);for(let r of o){let a=r.options,l=r.font,c=r.label,d=r.textOffset;at(i,c,0,d,l,a)}s&&gi(i)}drawTitle(){let{ctx:n,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;let o=ie(i.font),r=le(i.padding),a=i.align,l=o.lineHeight/2;e==="bottom"||e==="center"||F(e)?(l+=r.bottom,Q(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=r.top;let{titleX:c,titleY:d,maxWidth:h,rotation:u}=op(this,l,e,a);at(n,i.text,0,0,o,{color:i.color,maxWidth:h,rotation:u,textAlign:sp(a,e,s),textBaseline:"middle",translation:[c,d]})}draw(n){this._isVisible()&&(this.drawBackground(),this.drawGrid(n),this.drawBorder(),this.drawTitle(),this.drawLabels(n))}_layers(){let n=this.options,e=n.ticks&&n.ticks.z||0,i=I(n.grid&&n.grid.z,-1),s=I(n.border&&n.border.z,0);return!this._isVisible()||this.draw!==t.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(n){let e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[],o,r;for(o=0,r=e.length;o<r;++o){let a=e[o];a[i]===this.id&&(!n||a.type===n)&&s.push(a)}return s}_resolveTickFontOptions(n){let e=this.options.ticks.setContext(this.getContext(n));return ie(e.font)}_maxDigits(){let n=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/n}},Gt=class{constructor(n,e,i){this.type=n,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(n){return Object.prototype.isPrototypeOf.call(this.type.prototype,n.prototype)}register(n){let e=Object.getPrototypeOf(n),i;lp(e)&&(i=this.register(e));let s=this.items,o=n.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+n);return o in s||(s[o]=n,rp(n,r,i),this.override&&G.override(n.id,n.overrides)),r}get(n){return this.items[n]}unregister(n){let e=this.items,i=n.id,s=this.scope;i in e&&delete e[i],s&&i in G[s]&&(delete G[s][i],this.override&&delete ot[i])}};function rp(t,n,e){let i=Bt(Object.create(null),[e?G.get(e):{},G.get(n),t.defaults]);G.set(n,i),t.defaultRoutes&&ap(n,t.defaultRoutes),t.descriptors&&G.describe(n,t.descriptors)}function ap(t,n){Object.keys(n).forEach(e=>{let i=e.split("."),s=i.pop(),o=[t].concat(i).join("."),r=n[e].split("."),a=r.pop(),l=r.join(".");G.route(o,s,l,a)})}function lp(t){return"id"in t&&"defaults"in t}var Gs=class{constructor(){this.controllers=new Gt(ht,"datasets",!0),this.elements=new Gt(De,"elements"),this.plugins=new Gt(Object,"plugins"),this.scales=new Gt(Dt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...n){this._each("register",n)}remove(...n){this._each("unregister",n)}addControllers(...n){this._each("register",n,this.controllers)}addElements(...n){this._each("register",n,this.elements)}addPlugins(...n){this._each("register",n,this.plugins)}addScales(...n){this._each("register",n,this.scales)}getController(n){return this._get(n,this.controllers,"controller")}getElement(n){return this._get(n,this.elements,"element")}getPlugin(n){return this._get(n,this.plugins,"plugin")}getScale(n){return this._get(n,this.scales,"scale")}removeControllers(...n){this._each("unregister",n,this.controllers)}removeElements(...n){this._each("unregister",n,this.elements)}removePlugins(...n){this._each("unregister",n,this.plugins)}removeScales(...n){this._each("unregister",n,this.scales)}_each(n,e,i){[...e].forEach(s=>{let o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(n,o,s):j(s,r=>{let a=i||this._getRegistryForType(r);this._exec(n,a,r)})})}_exec(n,e,i){let s=Zi(n);U(i["before"+s],[],i),e[n](i),U(i["after"+s],[],i)}_getRegistryForType(n){for(let e=0;e<this._typedRegistries.length;e++){let i=this._typedRegistries[e];if(i.isForType(n))return i}return this.plugins}_get(n,e,i){let s=e.get(n);if(s===void 0)throw new Error('"'+n+'" is not a registered '+i+".");return s}},Fe=new Gs,Xs=class{constructor(){this._init=[]}notify(n,e,i,s){e==="beforeInit"&&(this._init=this._createDescriptors(n,!0),this._notify(this._init,n,"install"));let o=s?this._descriptors(n).filter(s):this._descriptors(n),r=this._notify(o,n,e,i);return e==="afterDestroy"&&(this._notify(o,n,"stop"),this._notify(this._init,n,"uninstall")),r}_notify(n,e,i,s){s=s||{};for(let o of n){let r=o.plugin,a=r[i],l=[e,s,o.options];if(U(a,l,r)===!1&&s.cancelable)return!1}return!0}invalidate(){A(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(n){if(this._cache)return this._cache;let e=this._cache=this._createDescriptors(n);return this._notifyStateChanges(n),e}_createDescriptors(n,e){let i=n&&n.config,s=I(i.options&&i.options.plugins,{}),o=cp(i);return s===!1&&!e?[]:hp(n,o,s,e)}_notifyStateChanges(n){let e=this._oldCache||[],i=this._cache,s=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(s(e,i),n,"stop"),this._notify(s(i,e),n,"start")}};function cp(t){let n={},e=[],i=Object.keys(Fe.plugins.items);for(let o=0;o<i.length;o++)e.push(Fe.getPlugin(i[o]));let s=t.plugins||[];for(let o=0;o<s.length;o++){let r=s[o];e.indexOf(r)===-1&&(e.push(r),n[r.id]=!0)}return{plugins:e,localIds:n}}function dp(t,n){return!n&&t===!1?null:t===!0?{}:t}function hp(t,{plugins:n,localIds:e},i,s){let o=[],r=t.getContext();for(let a of n){let l=a.id,c=dp(i[l],s);c!==null&&o.push({plugin:a,options:up(t.config,{plugin:a,local:e[l]},c,r)})}return o}function up(t,{plugin:n,local:e},i,s){let o=t.pluginScopeKeys(n),r=t.getOptionScopes(i,o);return e&&n.defaults&&r.push(n.defaults),t.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Js(t,n){let e=G.datasets[t]||{};return((n.datasets||{})[t]||{}).indexAxis||n.indexAxis||e.indexAxis||"x"}function fp(t,n){let e=t;return t==="_index_"?e=n:t==="_value_"&&(e=n==="x"?"y":"x"),e}function pp(t,n){return t===n?"_index_":"_value_"}function Fa(t){if(t==="x"||t==="y"||t==="r")return t}function gp(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function Zs(t,...n){if(Fa(t))return t;for(let e of n){let i=e.axis||gp(e.position)||t.length>1&&Fa(t[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function Va(t,n,e){if(e[n+"AxisID"]===t)return{axis:n}}function mp(t,n){if(n.data&&n.data.datasets){let e=n.data.datasets.filter(i=>i.xAxisID===t||i.yAxisID===t);if(e.length)return Va(t,"x",e[0])||Va(t,"y",e[0])}return{}}function bp(t,n){let e=ot[t.type]||{scales:{}},i=n.scales||{},s=Js(t.type,n),o=Object.create(null);return Object.keys(i).forEach(r=>{let a=i[r];if(!F(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);let l=Zs(r,a,mp(r,t),G.scales[a.type]),c=pp(l,s),d=e.scales||{};o[r]=jt(Object.create(null),[{axis:l},a,d[l],d[c]])}),t.data.datasets.forEach(r=>{let a=r.type||t.type,l=r.indexAxis||Js(a,n),d=(ot[a]||{}).scales||{};Object.keys(d).forEach(h=>{let u=fp(h,l),f=r[u+"AxisID"]||u;o[f]=o[f]||Object.create(null),jt(o[f],[{axis:u},i[f],d[h]])})}),Object.keys(o).forEach(r=>{let a=o[r];jt(a,[G.scales[a.type],G.scale])}),o}function Sl(t){let n=t.options||(t.options={});n.plugins=I(n.plugins,{}),n.scales=bp(t,n)}function kl(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function _p(t){return t=t||{},t.data=kl(t.data),Sl(t),t}var Na=new Map,Ml=new Set;function fn(t,n){let e=Na.get(t);return e||(e=n(),Na.set(t,e),Ml.add(e)),e}var xi=(t,n,e)=>{let i=Ye(n,e);i!==void 0&&t.add(i)},eo=class{constructor(n){this._config=_p(n),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(n){this._config.type=n}get data(){return this._config.data}set data(n){this._config.data=kl(n)}get options(){return this._config.options}set options(n){this._config.options=n}get plugins(){return this._config.plugins}update(){let n=this._config;this.clearCache(),Sl(n)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(n){return fn(n,()=>[[`datasets.${n}`,""]])}datasetAnimationScopeKeys(n,e){return fn(`${n}.transition.${e}`,()=>[[`datasets.${n}.transitions.${e}`,`transitions.${e}`],[`datasets.${n}`,""]])}datasetElementScopeKeys(n,e){return fn(`${n}-${e}`,()=>[[`datasets.${n}.elements.${e}`,`datasets.${n}`,`elements.${e}`,""]])}pluginScopeKeys(n){let e=n.id,i=this.type;return fn(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...n.additionalOptionScopes||[]]])}_cachedScopes(n,e){let i=this._scopeCache,s=i.get(n);return(!s||e)&&(s=new Map,i.set(n,s)),s}getOptionScopes(n,e,i){let{options:s,type:o}=this,r=this._cachedScopes(n,i),a=r.get(e);if(a)return a;let l=new Set;e.forEach(d=>{n&&(l.add(n),d.forEach(h=>xi(l,n,h))),d.forEach(h=>xi(l,s,h)),d.forEach(h=>xi(l,ot[o]||{},h)),d.forEach(h=>xi(l,G,h)),d.forEach(h=>xi(l,sn,h))});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Ml.has(e)&&r.set(e,c),c}chartOptionScopes(){let{options:n,type:e}=this;return[n,ot[e]||{},G.datasets[e]||{},{type:e},G,sn]}resolveNamedOptions(n,e,i,s=[""]){let o={$shared:!0},{resolver:r,subPrefixes:a}=Ba(this._resolverCache,n,s),l=r;if(xp(r,e)){o.$shared=!1,i=Ue(i)?i():i;let c=this.createResolver(n,i,a);l=Tt(r,i,c)}for(let c of e)o[c]=l[c];return o}createResolver(n,e,i=[""],s){let{resolver:o}=Ba(this._resolverCache,n,i);return F(e)?Tt(o,e,void 0,s):o}};function Ba(t,n,e){let i=t.get(n);i||(i=new Map,t.set(n,i));let s=e.join(),o=i.get(s);return o||(o={resolver:an(n,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,o)),o}var yp=t=>F(t)&&Object.getOwnPropertyNames(t).some(n=>Ue(t[n]));function xp(t,n){let{isScriptable:e,isIndexable:i}=Ts(t);for(let s of n){let o=e(s),r=i(s),a=(r||o)&&t[s];if(o&&(Ue(a)||yp(a))||r&&Q(a))return!0}return!1}var vp="4.5.0",wp=["top","bottom","left","right","chartArea"];function Ha(t,n){return t==="top"||t==="bottom"||wp.indexOf(t)===-1&&n==="x"}function ja(t,n){return function(e,i){return e[t]===i[t]?e[n]-i[n]:e[t]-i[t]}}function Wa(t){let n=t.chart,e=n.options.animation;n.notifyPlugins("afterRender"),U(e&&e.onComplete,[t],n)}function Tp(t){let n=t.chart,e=n.options.animation;U(e&&e.onProgress,[t],n)}function Dl(t){return ln()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}var _n={},$a=t=>{let n=Dl(t);return Object.values(_n).filter(e=>e.canvas===n).pop()};function Cp(t,n,e){let i=Object.keys(t);for(let s of i){let o=+s;if(o>=n){let r=t[s];delete t[s],(e>0||o>n)&&(t[o+e]=r)}}}function Sp(t,n,e,i){return!e||t.type==="mouseout"?null:i?n:t}var Sn=(()=>{class t{static defaults=G;static instances=_n;static overrides=ot;static registry=Fe;static version=vp;static getChart=$a;static register(...e){Fe.add(...e),Ka()}static unregister(...e){Fe.remove(...e),Ka()}constructor(e,i){let s=this.config=new eo(i),o=Dl(e),r=$a(o);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");let a=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||Uf(o)),this.platform.updateConfig(s);let l=this.platform.acquireContext(o,a.aspectRatio),c=l&&l.canvas,d=c&&c.height,h=c&&c.width;if(this.id=Wr(),this.ctx=l,this.canvas=c,this.width=h,this.height=d,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Xs,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ea(u=>this.update(u),a.resizeDelay||0),this._dataChanges=[],_n[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}Ge.listen(this,"complete",Wa),Ge.listen(this,"progress",Tp),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:e,maintainAspectRatio:i},width:s,height:o,_aspectRatio:r}=this;return A(e)?i&&r?r:o?s/o:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return Fe}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ms(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return xs(this.canvas,this.ctx),this}stop(){return Ge.stop(this),this}resize(e,i){Ge.running(this)?this._resizeBeforeDraw={width:e,height:i}:this._resize(e,i)}_resize(e,i){let s=this.options,o=this.canvas,r=s.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(o,e,i,r),l=s.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Ms(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),U(s.onResize,[this,a],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){let i=this.options.scales||{};j(i,(s,o)=>{s.id=o})}buildOrUpdateScales(){let e=this.options,i=e.scales,s=this.scales,o=Object.keys(s).reduce((a,l)=>(a[l]=!1,a),{}),r=[];i&&(r=r.concat(Object.keys(i).map(a=>{let l=i[a],c=Zs(a,l),d=c==="r",h=c==="x";return{options:l,dposition:d?"chartArea":h?"bottom":"left",dtype:d?"radialLinear":h?"category":"linear"}}))),j(r,a=>{let l=a.options,c=l.id,d=Zs(c,l),h=I(l.type,a.dtype);(l.position===void 0||Ha(l.position,d)!==Ha(a.dposition))&&(l.position=a.dposition),o[c]=!0;let u=null;if(c in s&&s[c].type===h)u=s[c];else{let f=Fe.getScale(h);u=new f({id:c,type:h,ctx:this.ctx,chart:this}),s[u.id]=u}u.init(l,e)}),j(o,(a,l)=>{a||delete s[l]}),j(s,a=>{he.configure(this,a,a.options),he.addBox(this,a)})}_updateMetasets(){let e=this._metasets,i=this.data.datasets.length,s=e.length;if(e.sort((o,r)=>o.index-r.index),s>i){for(let o=i;o<s;++o)this._destroyDatasetMeta(o);e.splice(i,s-i)}this._sortedMetasets=e.slice(0).sort(ja("order","index"))}_removeUnreferencedMetasets(){let{_metasets:e,data:{datasets:i}}=this;e.length>i.length&&delete this._stacks,e.forEach((s,o)=>{i.filter(r=>r===s._dataset).length===0&&this._destroyDatasetMeta(o)})}buildOrUpdateControllers(){let e=[],i=this.data.datasets,s,o;for(this._removeUnreferencedMetasets(),s=0,o=i.length;s<o;s++){let r=i[s],a=this.getDatasetMeta(s),l=r.type||this.config.type;if(a.type&&a.type!==l&&(this._destroyDatasetMeta(s),a=this.getDatasetMeta(s)),a.type=l,a.indexAxis=r.indexAxis||Js(l,this.options),a.order=r.order||0,a.index=s,a.label=""+r.label,a.visible=this.isDatasetVisible(s),a.controller)a.controller.updateIndex(s),a.controller.linkScales();else{let c=Fe.getController(l),{datasetElementType:d,dataElementType:h}=G.datasets[l];Object.assign(c,{dataElementType:Fe.getElement(h),datasetElementType:d&&Fe.getElement(d)}),a.controller=new c(this,s),e.push(a.controller)}}return this._updateMetasets(),e}_resetElements(){j(this.data.datasets,(e,i)=>{this.getDatasetMeta(i).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){let i=this.config;i.update();let s=this._options=i.createResolver(i.chartOptionScopes(),this.getContext()),o=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;let r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let d=0,h=this.data.datasets.length;d<h;d++){let{controller:u}=this.getDatasetMeta(d),f=!o&&r.indexOf(u)===-1;u.buildOrUpdateElements(f),a=Math.max(+u.getMaxOverflow(),a)}a=this._minPadding=s.layout.autoPadding?a:0,this._updateLayout(a),o||j(r,d=>{d.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(ja("z","_idx"));let{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){j(this.scales,e=>{he.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let e=this.options,i=new Set(Object.keys(this._listeners)),s=new Set(e.events);(!as(i,s)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:e}=this,i=this._getUniformDataChanges()||[];for(let{method:s,start:o,count:r}of i){let a=s==="_removeElements"?-r:r;Cp(e,o,a)}}_getUniformDataChanges(){let e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];let i=this.data.datasets.length,s=r=>new Set(e.filter(a=>a[0]===r).map((a,l)=>l+","+a.splice(1).join(","))),o=s(0);for(let r=1;r<i;r++)if(!as(o,s(r)))return;return Array.from(o).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;he.update(this,this.width,this.height,e);let i=this.chartArea,s=i.width<=0||i.height<=0;this._layers=[],j(this.boxes,o=>{s&&o.position==="chartArea"||(o.configure&&o.configure(),this._layers.push(...o._layers()))},this),this._layers.forEach((o,r)=>{o._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let i=0,s=this.data.datasets.length;i<s;++i)this.getDatasetMeta(i).controller.configure();for(let i=0,s=this.data.datasets.length;i<s;++i)this._updateDataset(i,Ue(e)?e({datasetIndex:i}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,i){let s=this.getDatasetMeta(e),o={meta:s,index:e,mode:i,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",o)!==!1&&(s.controller._update(i),o.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",o))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Ge.has(this)?this.attached&&!Ge.running(this)&&Ge.start(this):(this.draw(),Wa({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){let{width:s,height:o}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(s,o)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;let i=this._layers;for(e=0;e<i.length&&i[e].z<=0;++e)i[e].draw(this.chartArea);for(this._drawDatasets();e<i.length;++e)i[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){let i=this._sortedMetasets,s=[],o,r;for(o=0,r=i.length;o<r;++o){let a=i[o];(!e||a.visible)&&s.push(a)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;let e=this.getSortedVisibleDatasetMetas();for(let i=e.length-1;i>=0;--i)this._drawDataset(e[i]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){let i=this.ctx,s={meta:e,index:e.index,cancelable:!0},o=Os(this,e);this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(o&&pi(i,o),e.controller.draw(),o&&gi(i),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(e){return Oe(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,i,s,o){let r=Mf.modes[i];return typeof r=="function"?r(this,e,s,o):[]}getDatasetMeta(e){let i=this.data.datasets[e],s=this._metasets,o=s.filter(r=>r&&r._dataset===i).pop();return o||(o={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:i&&i.order||0,index:e,_dataset:i,_parsed:[],_sorted:!1},s.push(o)),o}getContext(){return this.$context||(this.$context=qe(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){let i=this.data.datasets[e];if(!i)return!1;let s=this.getDatasetMeta(e);return typeof s.hidden=="boolean"?!s.hidden:!i.hidden}setDatasetVisibility(e,i){let s=this.getDatasetMeta(e);s.hidden=!i}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,i,s){let o=s?"show":"hide",r=this.getDatasetMeta(e),a=r.controller._resolveAnimations(void 0,o);Wt(i)?(r.data[i].hidden=!s,this.update()):(this.setDatasetVisibility(e,s),a.update(r,{visible:s}),this.update(l=>l.datasetIndex===e?o:void 0))}hide(e,i){this._updateVisibility(e,i,!1)}show(e,i){this._updateVisibility(e,i,!0)}_destroyDatasetMeta(e){let i=this._metasets[e];i&&i.controller&&i.controller._destroy(),delete this._metasets[e]}_stop(){let e,i;for(this.stop(),Ge.remove(this),e=0,i=this.data.datasets.length;e<i;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:e,ctx:i}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),xs(e,i),this.platform.releaseContext(i),this.canvas=null,this.ctx=null),delete _n[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let e=this._listeners,i=this.platform,s=(r,a)=>{i.addEventListener(this,r,a),e[r]=a},o=(r,a,l)=>{r.offsetX=a,r.offsetY=l,this._eventHandler(r)};j(this.options.events,r=>s(r,o))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let e=this._responsiveListeners,i=this.platform,s=(c,d)=>{i.addEventListener(this,c,d),e[c]=d},o=(c,d)=>{e[c]&&(i.removeEventListener(this,c,d),delete e[c])},r=(c,d)=>{this.canvas&&this.resize(c,d)},a,l=()=>{o("attach",l),this.attached=!0,this.resize(),s("resize",r),s("detach",a)};a=()=>{this.attached=!1,o("resize",r),this._stop(),this._resize(0,0),s("attach",l)},i.isAttached(this.canvas)?l():a()}unbindEvents(){j(this._listeners,(e,i)=>{this.platform.removeEventListener(this,i,e)}),this._listeners={},j(this._responsiveListeners,(e,i)=>{this.platform.removeEventListener(this,i,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,i,s){let o=s?"set":"remove",r,a,l,c;for(i==="dataset"&&(r=this.getDatasetMeta(e[0].datasetIndex),r.controller["_"+o+"DatasetHoverStyle"]()),l=0,c=e.length;l<c;++l){a=e[l];let d=a&&this.getDatasetMeta(a.datasetIndex).controller;d&&d[o+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){let i=this._active||[],s=e.map(({datasetIndex:r,index:a})=>{let l=this.getDatasetMeta(r);if(!l)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:l.data[a],index:a}});!ui(s,i)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,i))}notifyPlugins(e,i,s){return this._plugins.notify(this,e,i,s)}isPluginEnabled(e){return this._plugins._cache.filter(i=>i.plugin.id===e).length===1}_updateHoverStyles(e,i,s){let o=this.options.hover,r=(c,d)=>c.filter(h=>!d.some(u=>h.datasetIndex===u.datasetIndex&&h.index===u.index)),a=r(i,e),l=s?e:r(e,i);a.length&&this.updateHoverStyle(a,o.mode,!1),l.length&&o.mode&&this.updateHoverStyle(l,o.mode,!0)}_eventHandler(e,i){let s={event:e,replay:i,cancelable:!0,inChartArea:this.isPointInArea(e)},o=a=>(a.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",s,o)===!1)return;let r=this._handleEvent(e,i,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,o),(r||s.changed)&&this.render(),this}_handleEvent(e,i,s){let{_active:o=[],options:r}=this,a=i,l=this._getActiveElements(e,o,s,a),c=Ur(e),d=Sp(e,this._lastEvent,s,c);s&&(this._lastEvent=null,U(r.onHover,[e,l,this],this),c&&U(r.onClick,[e,l,this],this));let h=!ui(l,o);return(h||i)&&(this._active=l,this._updateHoverStyles(l,o,i)),this._lastEvent=d,h}_getActiveElements(e,i,s,o){if(e.type==="mouseout")return[];if(!s)return i;let r=this.options.hover;return this.getElementsAtEventForMode(e,r.mode,r,o)}}return t})();function Ka(){return j(Sn.instances,t=>t._plugins.invalidate())}function kp(t,n,e){let{startAngle:i,x:s,y:o,outerRadius:r,innerRadius:a,options:l}=n,{borderWidth:c,borderJoinStyle:d}=l,h=Math.min(c/r,re(i-e));if(t.beginPath(),t.arc(s,o,r-c/2,i+h/2,e-h/2),a>0){let u=Math.min(c/a,re(i-e));t.arc(s,o,a+c/2,e-u/2,i+u/2,!0)}else{let u=Math.min(c/2,r*re(i-e));if(d==="round")t.arc(s,o,u,e-B/2,i+B/2,!0);else if(d==="bevel"){let f=2*u*u,g=-f*Math.cos(e+B/2)+s,p=-f*Math.sin(e+B/2)+o,m=f*Math.cos(i+B/2)+s,b=f*Math.sin(i+B/2)+o;t.lineTo(g,p),t.lineTo(m,b)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}function Mp(t,n,e){let{startAngle:i,pixelMargin:s,x:o,y:r,outerRadius:a,innerRadius:l}=n,c=s/a;t.beginPath(),t.arc(o,r,a,i-c,e+c),l>s?(c=s/l,t.arc(o,r,l,e+c,i-c,!0)):t.arc(o,r,s,e+Z,i-Z),t.closePath(),t.clip()}function Dp(t){return rn(t,["outerStart","outerEnd","innerStart","innerEnd"])}function Ep(t,n,e,i){let s=Dp(t.options.borderRadius),o=(e-n)/2,r=Math.min(o,i*n/2),a=l=>{let c=(e-Math.min(o,l))*i/2;return ne(l,0,Math.min(o,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:ne(s.innerStart,0,r),innerEnd:ne(s.innerEnd,0,r)}}function qt(t,n,e,i){return{x:e+t*Math.cos(n),y:i+t*Math.sin(n)}}function wn(t,n,e,i,s,o){let{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:d}=n,h=Math.max(n.outerRadius+i+e-c,0),u=d>0?d+i+e+c:0,f=0,g=s-l;if(i){let W=d>0?d-i:0,X=h>0?h-i:0,ee=(W+X)/2,ke=ee!==0?g*ee/(ee+i):g;f=(g-ke)/2}let p=Math.max(.001,g*h-e/B)/h,m=(g-p)/2,b=l+m+f,_=s-m-f,{outerStart:x,outerEnd:w,innerStart:y,innerEnd:v}=Ep(n,u,h,_-b),k=h-x,C=h-w,D=b+x/k,z=_-w/C,R=u+y,V=u+v,se=b+y/R,ye=_-v/V;if(t.beginPath(),o){let W=(D+z)/2;if(t.arc(r,a,h,D,W),t.arc(r,a,h,W,z),w>0){let ce=qt(C,z,r,a);t.arc(ce.x,ce.y,w,z,_+Z)}let X=qt(V,_,r,a);if(t.lineTo(X.x,X.y),v>0){let ce=qt(V,ye,r,a);t.arc(ce.x,ce.y,v,_+Z,ye+Math.PI)}let ee=(_-v/u+(b+y/u))/2;if(t.arc(r,a,u,_-v/u,ee,!0),t.arc(r,a,u,ee,b+y/u,!0),y>0){let ce=qt(R,se,r,a);t.arc(ce.x,ce.y,y,se+Math.PI,b-Z)}let ke=qt(k,b,r,a);if(t.lineTo(ke.x,ke.y),x>0){let ce=qt(k,D,r,a);t.arc(ce.x,ce.y,x,b-Z,D)}}else{t.moveTo(r,a);let W=Math.cos(D)*h+r,X=Math.sin(D)*h+a;t.lineTo(W,X);let ee=Math.cos(z)*h+r,ke=Math.sin(z)*h+a;t.lineTo(ee,ke)}t.closePath()}function Ip(t,n,e,i,s){let{fullCircles:o,startAngle:r,circumference:a}=n,l=n.endAngle;if(o){wn(t,n,e,i,l,s);for(let c=0;c<o;++c)t.fill();isNaN(a)||(l=r+(a%Y||Y))}return wn(t,n,e,i,l,s),t.fill(),l}function Pp(t,n,e,i,s){let{fullCircles:o,startAngle:r,circumference:a,options:l}=n,{borderWidth:c,borderJoinStyle:d,borderDash:h,borderDashOffset:u,borderRadius:f}=l,g=l.borderAlign==="inner";if(!c)return;t.setLineDash(h||[]),t.lineDashOffset=u,g?(t.lineWidth=c*2,t.lineJoin=d||"round"):(t.lineWidth=c,t.lineJoin=d||"bevel");let p=n.endAngle;if(o){wn(t,n,e,i,p,s);for(let m=0;m<o;++m)t.stroke();isNaN(a)||(p=r+(a%Y||Y))}g&&Mp(t,n,p),l.selfJoin&&p-r>=B&&f===0&&d!=="miter"&&kp(t,n,p),o||(wn(t,n,e,i,p,s),t.stroke())}var to=class extends De{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:n=>n!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(n){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,e,i){let s=this.getProps(["x","y"],i),{angle:o,distance:r}=hs(s,{x:n,y:e}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:d,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),u=(this.options.spacing+this.options.borderWidth)/2,f=I(h,l-a),g=Kt(o,a,l)&&a!==l,p=f>=Y||g,m=ze(r,c+u,d+u);return p&&m}getCenterPoint(n){let{x:e,y:i,startAngle:s,endAngle:o,innerRadius:r,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:l,spacing:c}=this.options,d=(s+o)/2,h=(r+a+c+l)/2;return{x:e+Math.cos(d)*h,y:i+Math.sin(d)*h}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){let{options:e,circumference:i}=this,s=(e.offset||0)/4,o=(e.spacing||0)/2,r=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=i>Y?Math.floor(i/Y):0,i===0||this.innerRadius<0||this.outerRadius<0)return;n.save();let a=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(a)*s,Math.sin(a)*s);let l=1-Math.sin(Math.min(B,i||0)),c=s*l;n.fillStyle=e.backgroundColor,n.strokeStyle=e.borderColor,Ip(n,this,c,o,r),Pp(n,this,c,o,r),n.restore()}};function El(t,n,e=n){t.lineCap=I(e.borderCapStyle,n.borderCapStyle),t.setLineDash(I(e.borderDash,n.borderDash)),t.lineDashOffset=I(e.borderDashOffset,n.borderDashOffset),t.lineJoin=I(e.borderJoinStyle,n.borderJoinStyle),t.lineWidth=I(e.borderWidth,n.borderWidth),t.strokeStyle=I(e.borderColor,n.borderColor)}function Lp(t,n,e){t.lineTo(e.x,e.y)}function Op(t){return t.stepped?sa:t.tension||t.cubicInterpolationMode==="monotone"?oa:Lp}function Il(t,n,e={}){let i=t.length,{start:s=0,end:o=i-1}=e,{start:r,end:a}=n,l=Math.max(s,r),c=Math.min(o,a),d=s<r&&o<r||s>a&&o>a;return{count:i,start:l,loop:n.loop,ilen:c<l&&!d?i+c-l:c-l}}function Rp(t,n,e,i){let{points:s,options:o}=n,{count:r,start:a,loop:l,ilen:c}=Il(s,e,i),d=Op(o),{move:h=!0,reverse:u}=i||{},f,g,p;for(f=0;f<=c;++f)g=s[(a+(u?c-f:f))%r],!g.skip&&(h?(t.moveTo(g.x,g.y),h=!1):d(t,p,g,u,o.stepped),p=g);return l&&(g=s[(a+(u?c:0))%r],d(t,p,g,u,o.stepped)),!!l}function zp(t,n,e,i){let s=n.points,{count:o,start:r,ilen:a}=Il(s,e,i),{move:l=!0,reverse:c}=i||{},d=0,h=0,u,f,g,p,m,b,_=w=>(r+(c?a-w:w))%o,x=()=>{p!==m&&(t.lineTo(d,m),t.lineTo(d,p),t.lineTo(d,b))};for(l&&(f=s[_(0)],t.moveTo(f.x,f.y)),u=0;u<=a;++u){if(f=s[_(u)],f.skip)continue;let w=f.x,y=f.y,v=w|0;v===g?(y<p?p=y:y>m&&(m=y),d=(h*d+w)/++h):(x(),t.lineTo(w,y),g=v,h=0,p=m=y),b=y}x()}function io(t){let n=t.options,e=n.borderDash&&n.borderDash.length;return!t._decimated&&!t._loop&&!n.tension&&n.cubicInterpolationMode!=="monotone"&&!n.stepped&&!e?zp:Rp}function Ap(t){return t.stepped?pa:t.tension||t.cubicInterpolationMode==="monotone"?ga:st}function Fp(t,n,e,i){let s=n._path;s||(s=n._path=new Path2D,n.path(s,e,i)&&s.closePath()),El(t,n.options),t.stroke(s)}function Vp(t,n,e,i){let{segments:s,options:o}=n,r=io(n);for(let a of s)El(t,o,a.style),t.beginPath(),r(t,n,a,{start:e,end:e+i-1})&&t.closePath(),t.stroke()}var Np=typeof Path2D=="function";function Bp(t,n,e,i){Np&&!n.options.segment?Fp(t,n,e,i):Vp(t,n,e,i)}var kn=(()=>{class t extends De{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"};constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,i){let s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){let o=s.spanGaps?this._loop:this._fullLoop;ha(this._points,s,e,o,i),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=ba(this,this.options.segment))}first(){let e=this.segments,i=this.points;return e.length&&i[e[0].start]}last(){let e=this.segments,i=this.points,s=e.length;return s&&i[e[s-1].end]}interpolate(e,i){let s=this.options,o=e[i],r=this.points,a=Ls(this,{property:i,start:o,end:o});if(!a.length)return;let l=[],c=Ap(s),d,h;for(d=0,h=a.length;d<h;++d){let{start:u,end:f}=a[d],g=r[u],p=r[f];if(g===p){l.push(g);continue}let m=Math.abs((o-g[i])/(p[i]-g[i])),b=c(g,p,m,s.stepped);b[i]=e[i],l.push(b)}return l.length===1?l[0]:l}pathSegment(e,i,s){return io(this)(e,this,i,s)}path(e,i,s){let o=this.segments,r=io(this),a=this._loop;i=i||0,s=s||this.points.length-i;for(let l of o)a&=r(e,this,l,{start:i,end:i+s-1});return!!a}draw(e,i,s,o){let r=this.options||{};(this.points||[]).length&&r.borderWidth&&(e.save(),Bp(e,this,s,o),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}return t})();function Ua(t,n,e,i){let s=t.options,{[e]:o}=t.getProps([e],i);return Math.abs(n-o)<s.radius+s.hitRadius}var Hp=(()=>{class t extends De{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,s){let o=this.options,{x:r,y:a}=this.getProps(["x","y"],s);return Math.pow(e-r,2)+Math.pow(i-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(e,i){return Ua(this,e,"x",i)}inYRange(e,i){return Ua(this,e,"y",i)}getCenterPoint(e){let{x:i,y:s}=this.getProps(["x","y"],e);return{x:i,y:s}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);let s=i&&e.borderWidth||0;return(i+s)*2}draw(e,i){let s=this.options;this.skip||s.radius<.1||!Oe(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,on(e,s,this.x,this.y))}getRange(){let e=this.options||{};return e.radius+e.hitRadius}}return t})();function Pl(t,n){let{x:e,y:i,base:s,width:o,height:r}=t.getProps(["x","y","base","width","height"],n),a,l,c,d,h;return t.horizontal?(h=r/2,a=Math.min(e,s),l=Math.max(e,s),c=i-h,d=i+h):(h=o/2,a=e-h,l=e+h,c=Math.min(i,s),d=Math.max(i,s)),{left:a,top:c,right:l,bottom:d}}function dt(t,n,e,i){return t?0:ne(n,e,i)}function jp(t,n,e){let i=t.options.borderWidth,s=t.borderSkipped,o=ws(i);return{t:dt(s.top,o.top,0,e),r:dt(s.right,o.right,0,n),b:dt(s.bottom,o.bottom,0,e),l:dt(s.left,o.left,0,n)}}function Wp(t,n,e){let{enableBorderRadius:i}=t.getProps(["enableBorderRadius"]),s=t.options.borderRadius,o=lt(s),r=Math.min(n,e),a=t.borderSkipped,l=i||F(s);return{topLeft:dt(!l||a.top||a.left,o.topLeft,0,r),topRight:dt(!l||a.top||a.right,o.topRight,0,r),bottomLeft:dt(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:dt(!l||a.bottom||a.right,o.bottomRight,0,r)}}function $p(t){let n=Pl(t),e=n.right-n.left,i=n.bottom-n.top,s=jp(t,e/2,i/2),o=Wp(t,e/2,i/2);return{outer:{x:n.left,y:n.top,w:e,h:i,radius:o},inner:{x:n.left+s.l,y:n.top+s.t,w:e-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function Hs(t,n,e,i){let s=n===null,o=e===null,a=t&&!(s&&o)&&Pl(t,i);return a&&(s||ze(n,a.left,a.right))&&(o||ze(e,a.top,a.bottom))}function Kp(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function Up(t,n){t.rect(n.x,n.y,n.w,n.h)}function js(t,n,e={}){let i=t.x!==e.x?-n:0,s=t.y!==e.y?-n:0,o=(t.x+t.w!==e.x+e.w?n:0)-i,r=(t.y+t.h!==e.y+e.h?n:0)-s;return{x:t.x+i,y:t.y+s,w:t.w+o,h:t.h+r,radius:t.radius}}var no=class extends De{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(n){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,n&&Object.assign(this,n)}draw(n){let{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:o,outer:r}=$p(this),a=Kp(r.radius)?Qt:Up;n.save(),(r.w!==o.w||r.h!==o.h)&&(n.beginPath(),a(n,js(r,e,o)),n.clip(),a(n,js(o,-e,r)),n.fillStyle=i,n.fill("evenodd")),n.beginPath(),a(n,js(o,e)),n.fillStyle=s,n.fill(),n.restore()}inRange(n,e,i){return Hs(this,n,e,i)}inXRange(n,e){return Hs(this,n,null,e)}inYRange(n,e){return Hs(this,null,n,e)}getCenterPoint(n){let{x:e,y:i,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],n);return{x:o?(e+s)/2:e,y:o?i:(i+s)/2}}getRange(n){return n==="x"?this.width/2:this.height/2}},Qp=Object.freeze({__proto__:null,ArcElement:to,BarElement:no,LineElement:kn,PointElement:Hp}),so=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Qa=so.map(t=>t.replace("rgb(","rgba(").replace(")",", 0.5)"));function Ll(t){return so[t%so.length]}function Ol(t){return Qa[t%Qa.length]}function Yp(t,n){return t.borderColor=Ll(n),t.backgroundColor=Ol(n),++n}function qp(t,n){return t.backgroundColor=t.data.map(()=>Ll(n++)),n}function Gp(t,n){return t.backgroundColor=t.data.map(()=>Ol(n++)),n}function Xp(t){let n=0;return(e,i)=>{let s=t.getDatasetMeta(i).controller;s instanceof fo?n=qp(e,n):s instanceof xl?n=Gp(e,n):s&&(n=Yp(e,n))}}function Ya(t){let n;for(n in t)if(t[n].borderColor||t[n].backgroundColor)return!0;return!1}function Jp(t){return t&&(t.borderColor||t.backgroundColor)}function Zp(){return G.borderColor!=="rgba(0,0,0,0.1)"||G.backgroundColor!=="rgba(0,0,0,0.1)"}var eg={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,n,e){if(!e.enabled)return;let{data:{datasets:i},options:s}=t.config,{elements:o}=s,r=Ya(i)||Jp(s)||o&&Ya(o)||Zp();if(!e.forceOverride&&r)return;let a=Xp(t);i.forEach(a)}};function tg(t,n,e,i,s){let o=s.samples||i;if(o>=e)return t.slice(n,n+e);let r=[],a=(e-2)/(o-2),l=0,c=n+e-1,d=n,h,u,f,g,p;for(r[l++]=t[d],h=0;h<o-2;h++){let m=0,b=0,_,x=Math.floor((h+1)*a)+1+n,w=Math.min(Math.floor((h+2)*a)+1,e)+n,y=w-x;for(_=x;_<w;_++)m+=t[_].x,b+=t[_].y;m/=y,b/=y;let v=Math.floor(h*a)+1+n,k=Math.min(Math.floor((h+1)*a)+1,e)+n,{x:C,y:D}=t[d];for(f=g=-1,_=v;_<k;_++)g=.5*Math.abs((C-m)*(t[_].y-D)-(C-t[_].x)*(b-D)),g>f&&(f=g,u=t[_],p=_);r[l++]=u,d=p}return r[l++]=t[c],r}function ig(t,n,e,i){let s=0,o=0,r,a,l,c,d,h,u,f,g,p,m=[],b=n+e-1,_=t[n].x,w=t[b].x-_;for(r=n;r<n+e;++r){a=t[r],l=(a.x-_)/w*i,c=a.y;let y=l|0;if(y===d)c<g?(g=c,h=r):c>p&&(p=c,u=r),s=(o*s+a.x)/++o;else{let v=r-1;if(!A(h)&&!A(u)){let k=Math.min(h,u),C=Math.max(h,u);k!==f&&k!==v&&m.push(Pt(Ee({},t[k]),{x:s})),C!==f&&C!==v&&m.push(Pt(Ee({},t[C]),{x:s}))}r>0&&v!==f&&m.push(t[v]),m.push(a),d=y,o=0,g=p=c,h=u=f=r}}return m}function Rl(t){if(t._decimated){let n=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:n})}}function qa(t){t.data.datasets.forEach(n=>{Rl(n)})}function ng(t,n){let e=n.length,i=0,s,{iScale:o}=t,{min:r,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(i=ne(Le(n,o.axis,r).lo,0,e-1)),c?s=ne(Le(n,o.axis,a).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var sg={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,n,e)=>{if(!e.enabled){qa(t);return}let i=t.width;t.data.datasets.forEach((s,o)=>{let{_data:r,indexAxis:a}=s,l=t.getDatasetMeta(o),c=r||s.data;if(Yt([a,t.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;let d=t.scales[l.xAxisID];if(d.type!=="linear"&&d.type!=="time"||t.options.parsing)return;let{start:h,count:u}=ng(l,c),f=e.threshold||4*i;if(u<=f){Rl(s);return}A(r)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(p){this._data=p}}));let g;switch(e.algorithm){case"lttb":g=tg(c,h,u,i,e);break;case"min-max":g=ig(c,h,u,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=g})},destroy(t){qa(t)}};function og(t,n,e){let i=t.segments,s=t.points,o=n.points,r=[];for(let a of i){let{start:l,end:c}=a;c=Mn(l,c,s);let d=oo(e,s[l],s[c],a.loop);if(!n.segments){r.push({source:a,target:d,start:s[l],end:s[c]});continue}let h=Ls(n,d);for(let u of h){let f=oo(e,o[u.start],o[u.end],u.loop),g=Ps(a,s,f);for(let p of g)r.push({source:p,target:u,start:{[e]:Ga(d,f,"start",Math.max)},end:{[e]:Ga(d,f,"end",Math.min)}})}}return r}function oo(t,n,e,i){if(i)return;let s=n[t],o=e[t];return t==="angle"&&(s=re(s),o=re(o)),{property:t,start:s,end:o}}function rg(t,n){let{x:e=null,y:i=null}=t||{},s=n.points,o=[];return n.segments.forEach(({start:r,end:a})=>{a=Mn(r,a,s);let l=s[r],c=s[a];i!==null?(o.push({x:l.x,y:i}),o.push({x:c.x,y:i})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function Mn(t,n,e){for(;n>t;n--){let i=e[n];if(!isNaN(i.x)&&!isNaN(i.y))break}return n}function Ga(t,n,e,i){return t&&n?i(t[e],n[e]):t?t[e]:n?n[e]:0}function zl(t,n){let e=[],i=!1;return Q(t)?(i=!0,e=t):e=rg(t,n),e.length?new kn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Xa(t){return t&&t.fill!==!1}function ag(t,n,e){let s=t[n].fill,o=[n],r;if(!e)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!J(s))return s;if(r=t[s],!r)return!1;if(r.visible)return s;o.push(s),s=r.fill}return!1}function lg(t,n,e){let i=ug(t);if(F(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return J(s)&&Math.floor(s)===s?cg(i[0],n,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function cg(t,n,e,i){return(t==="-"||t==="+")&&(e=n+e),e===n||e<0||e>=i?!1:e}function dg(t,n){let e=null;return t==="start"?e=n.bottom:t==="end"?e=n.top:F(t)?e=n.getPixelForValue(t.value):n.getBasePixel&&(e=n.getBasePixel()),e}function hg(t,n,e){let i;return t==="start"?i=e:t==="end"?i=n.options.reverse?n.min:n.max:F(t)?i=t.value:i=n.getBaseValue(),i}function ug(t){let n=t.options,e=n.fill,i=I(e&&e.target,e);return i===void 0&&(i=!!n.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function fg(t){let{scale:n,index:e,line:i}=t,s=[],o=i.segments,r=i.points,a=pg(n,e);a.push(zl({x:null,y:n.bottom},i));for(let l=0;l<o.length;l++){let c=o[l];for(let d=c.start;d<=c.end;d++)gg(s,r[d],a)}return new kn({points:s,options:{}})}function pg(t,n){let e=[],i=t.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){let o=i[s];if(o.index===n)break;o.hidden||e.unshift(o.dataset)}return e}function gg(t,n,e){let i=[];for(let s=0;s<e.length;s++){let o=e[s],{first:r,last:a,point:l}=mg(o,n,"x");if(!(!l||r&&a)){if(r)i.unshift(l);else if(t.push(l),!a)break}}t.push(...i)}function mg(t,n,e){let i=t.interpolate(n,e);if(!i)return{};let s=i[e],o=t.segments,r=t.points,a=!1,l=!1;for(let c=0;c<o.length;c++){let d=o[c],h=r[d.start][e],u=r[d.end][e];if(ze(s,h,u)){a=s===h,l=s===u;break}}return{first:a,last:l,point:i}}var Tn=class{constructor(n){this.x=n.x,this.y=n.y,this.radius=n.radius}pathSegment(n,e,i){let{x:s,y:o,radius:r}=this;return e=e||{start:0,end:Y},n.arc(s,o,r,e.end,e.start,!0),!i.bounds}interpolate(n){let{x:e,y:i,radius:s}=this,o=n.angle;return{x:e+Math.cos(o)*s,y:i+Math.sin(o)*s,angle:o}}};function bg(t){let{chart:n,fill:e,line:i}=t;if(J(e))return _g(n,e);if(e==="stack")return fg(t);if(e==="shape")return!0;let s=yg(t);return s instanceof Tn?s:zl(s,i)}function _g(t,n){let e=t.getDatasetMeta(n);return e&&t.isDatasetVisible(n)?e.dataset:null}function yg(t){return(t.scale||{}).getPointPositionForValue?vg(t):xg(t)}function xg(t){let{scale:n={},fill:e}=t,i=dg(e,n);if(J(i)){let s=n.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function vg(t){let{scale:n,fill:e}=t,i=n.options,s=n.getLabels().length,o=i.reverse?n.max:n.min,r=hg(e,n,o),a=[];if(i.grid.circular){let l=n.getPointPositionForValue(0,o);return new Tn({x:l.x,y:l.y,radius:n.getDistanceFromCenterForValue(r)})}for(let l=0;l<s;++l)a.push(n.getPointPositionForValue(l,r));return a}function Ws(t,n,e){let i=bg(n),{chart:s,index:o,line:r,scale:a,axis:l}=n,c=r.options,d=c.fill,h=c.backgroundColor,{above:u=h,below:f=h}=d||{},g=s.getDatasetMeta(o),p=Os(s,g);i&&r.points.length&&(pi(t,e),wg(t,{line:r,target:i,above:u,below:f,area:e,scale:a,axis:l,clip:p}),gi(t))}function wg(t,n){let{line:e,target:i,above:s,below:o,area:r,scale:a,clip:l}=n,c=e._loop?"angle":n.axis;t.save();let d=o;o!==s&&(c==="x"?(Ja(t,i,r.top),$s(t,{line:e,target:i,color:s,scale:a,property:c,clip:l}),t.restore(),t.save(),Ja(t,i,r.bottom)):c==="y"&&(Za(t,i,r.left),$s(t,{line:e,target:i,color:o,scale:a,property:c,clip:l}),t.restore(),t.save(),Za(t,i,r.right),d=s)),$s(t,{line:e,target:i,color:d,scale:a,property:c,clip:l}),t.restore()}function Ja(t,n,e){let{segments:i,points:s}=n,o=!0,r=!1;t.beginPath();for(let a of i){let{start:l,end:c}=a,d=s[l],h=s[Mn(l,c,s)];o?(t.moveTo(d.x,d.y),o=!1):(t.lineTo(d.x,e),t.lineTo(d.x,d.y)),r=!!n.pathSegment(t,a,{move:r}),r?t.closePath():t.lineTo(h.x,e)}t.lineTo(n.first().x,e),t.closePath(),t.clip()}function Za(t,n,e){let{segments:i,points:s}=n,o=!0,r=!1;t.beginPath();for(let a of i){let{start:l,end:c}=a,d=s[l],h=s[Mn(l,c,s)];o?(t.moveTo(d.x,d.y),o=!1):(t.lineTo(e,d.y),t.lineTo(d.x,d.y)),r=!!n.pathSegment(t,a,{move:r}),r?t.closePath():t.lineTo(e,h.y)}t.lineTo(e,n.first().y),t.closePath(),t.clip()}function $s(t,n){let{line:e,target:i,property:s,color:o,scale:r,clip:a}=n,l=og(e,i,s);for(let{source:c,target:d,start:h,end:u}of l){let{style:{backgroundColor:f=o}={}}=c,g=i!==!0;t.save(),t.fillStyle=f,Tg(t,r,a,g&&oo(s,h,u)),t.beginPath();let p=!!e.pathSegment(t,c),m;if(g){p?t.closePath():el(t,i,u,s);let b=!!i.pathSegment(t,d,{move:p,reverse:!0});m=p&&b,m||el(t,i,h,s)}t.closePath(),t.fill(m?"evenodd":"nonzero"),t.restore()}}function Tg(t,n,e,i){let s=n.chart.chartArea,{property:o,start:r,end:a}=i||{};if(o==="x"||o==="y"){let l,c,d,h;o==="x"?(l=r,c=s.top,d=a,h=s.bottom):(l=s.left,c=r,d=s.right,h=a),t.beginPath(),e&&(l=Math.max(l,e.left),d=Math.min(d,e.right),c=Math.max(c,e.top),h=Math.min(h,e.bottom)),t.rect(l,c,d-l,h-c),t.clip()}}function el(t,n,e,i){let s=n.interpolate(e,i);s&&t.lineTo(s.x,s.y)}var Cg={id:"filler",afterDatasetsUpdate(t,n,e){let i=(t.data.datasets||[]).length,s=[],o,r,a,l;for(r=0;r<i;++r)o=t.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof kn&&(l={visible:t.isDatasetVisible(r),index:r,fill:lg(a,r,i),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,s.push(l);for(r=0;r<i;++r)l=s[r],!(!l||l.fill===!1)&&(l.fill=ag(s,r,e.propagate))},beforeDraw(t,n,e){let i=e.drawTime==="beforeDraw",s=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let r=s.length-1;r>=0;--r){let a=s[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),i&&a.fill&&Ws(t.ctx,a,o))}},beforeDatasetsDraw(t,n,e){if(e.drawTime!=="beforeDatasetsDraw")return;let i=t.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){let o=i[s].$filler;Xa(o)&&Ws(t.ctx,o,t.chartArea)}},beforeDatasetDraw(t,n,e){let i=n.meta.$filler;!Xa(i)||e.drawTime!=="beforeDatasetDraw"||Ws(t.ctx,i,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},tl=(t,n)=>{let{boxHeight:e=n,boxWidth:i=n}=t;return t.usePointStyle&&(e=Math.min(e,n),i=t.pointStyleWidth||Math.min(i,n)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(n,e)}},Sg=(t,n)=>t!==null&&n!==null&&t.datasetIndex===n.datasetIndex&&t.index===n.index,Cn=class extends De{constructor(n){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=n.chart,this.options=n.options,this.ctx=n.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(n,e,i){this.maxWidth=n,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let n=this.options.labels||{},e=U(n.generateLabels,[this.chart],this)||[];n.filter&&(e=e.filter(i=>n.filter(i,this.chart.data))),n.sort&&(e=e.sort((i,s)=>n.sort(i,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){let{options:n,ctx:e}=this;if(!n.display){this.width=this.height=0;return}let i=n.labels,s=ie(i.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=tl(i,o),c,d;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,d=this._fitRows(r,o,a,l)+10):(d=this.maxHeight,c=this._fitCols(r,s,a,l)+10),this.width=Math.min(c,n.maxWidth||this.maxWidth),this.height=Math.min(d,n.maxHeight||this.maxHeight)}_fitRows(n,e,i,s){let{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],d=s+a,h=n;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-d;return this.legendItems.forEach((g,p)=>{let m=i+e/2+o.measureText(g.text).width;(p===0||c[c.length-1]+m+2*a>r)&&(h+=d,c[c.length-(p>0?0:1)]=0,f+=d,u++),l[p]={left:0,top:f,row:u,width:m,height:s},c[c.length-1]+=m+a}),h}_fitCols(n,e,i,s){let{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],d=r-n,h=a,u=0,f=0,g=0,p=0;return this.legendItems.forEach((m,b)=>{let{itemWidth:_,itemHeight:x}=kg(i,e,o,m,s);b>0&&f+x+2*a>d&&(h+=u+a,c.push({width:u,height:f}),g+=u+a,p++,u=f=0),l[b]={left:g,top:f,col:p,width:_,height:x},u=Math.max(u,_),f+=x+a}),h+=u,c.push({width:u,height:f}),h}adjustHitBoxes(){if(!this.options.display)return;let n=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:o}}=this,r=St(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=ae(i,this.left+s,this.right-this.lineWidths[a]);for(let c of e)a!==c.row&&(a=c.row,l=ae(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+n+s,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+s}else{let a=0,l=ae(i,this.top+n+s,this.bottom-this.columnSizes[a].height);for(let c of e)c.col!==a&&(a=c.col,l=ae(i,this.top+n+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let n=this.ctx;pi(n,this),this._draw(),gi(n)}}_draw(){let{options:n,columnSizes:e,lineWidths:i,ctx:s}=this,{align:o,labels:r}=n,a=G.color,l=St(n.rtl,this.left,this.width),c=ie(r.font),{padding:d}=r,h=c.size,u=h/2,f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;let{boxWidth:g,boxHeight:p,itemHeight:m}=tl(r,h),b=function(v,k,C){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;s.save();let D=I(C.lineWidth,1);if(s.fillStyle=I(C.fillStyle,a),s.lineCap=I(C.lineCap,"butt"),s.lineDashOffset=I(C.lineDashOffset,0),s.lineJoin=I(C.lineJoin,"miter"),s.lineWidth=D,s.strokeStyle=I(C.strokeStyle,a),s.setLineDash(I(C.lineDash,[])),r.usePointStyle){let z={radius:p*Math.SQRT2/2,pointStyle:C.pointStyle,rotation:C.rotation,borderWidth:D},R=l.xPlus(v,g/2),V=k+u;vs(s,z,R,V,r.pointStyleWidth&&g)}else{let z=k+Math.max((h-p)/2,0),R=l.leftForLtr(v,g),V=lt(C.borderRadius);s.beginPath(),Object.values(V).some(se=>se!==0)?Qt(s,{x:R,y:z,w:g,h:p,radius:V}):s.rect(R,z,g,p),s.fill(),D!==0&&s.stroke()}s.restore()},_=function(v,k,C){at(s,C.text,v,k+m/2,c,{strikethrough:C.hidden,textAlign:l.textAlign(C.textAlign)})},x=this.isHorizontal(),w=this._computeTitleHeight();x?f={x:ae(o,this.left+d,this.right-i[0]),y:this.top+d+w,line:0}:f={x:this.left+d,y:ae(o,this.top+w+d,this.bottom-e[0].height),line:0},Es(this.ctx,n.textDirection);let y=m+d;this.legendItems.forEach((v,k)=>{s.strokeStyle=v.fontColor,s.fillStyle=v.fontColor;let C=s.measureText(v.text).width,D=l.textAlign(v.textAlign||(v.textAlign=r.textAlign)),z=g+u+C,R=f.x,V=f.y;l.setWidth(this.width),x?k>0&&R+z+d>this.right&&(V=f.y+=y,f.line++,R=f.x=ae(o,this.left+d,this.right-i[f.line])):k>0&&V+y>this.bottom&&(R=f.x=R+e[f.line].width+d,f.line++,V=f.y=ae(o,this.top+w+d,this.bottom-e[f.line].height));let se=l.x(R);if(b(se,V,v),R=ta(D,R+g+u,x?R+z:this.right,n.rtl),_(l.x(R),V,v),x)f.x+=z+d;else if(typeof v.text!="string"){let ye=c.lineHeight;f.y+=Al(v,ye)+d}else f.y+=y}),Is(this.ctx,n.textDirection)}drawTitle(){let n=this.options,e=n.title,i=ie(e.font),s=le(e.padding);if(!e.display)return;let o=St(n.rtl,this.left,this.width),r=this.ctx,a=e.position,l=i.size/2,c=s.top+l,d,h=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),d=this.top+c,h=ae(n.align,h,this.right-u);else{let g=this.columnSizes.reduce((p,m)=>Math.max(p,m.height),0);d=c+ae(n.align,this.top,this.bottom-g-n.labels.padding-this._computeTitleHeight())}let f=ae(a,h,h+u);r.textAlign=o.textAlign(nn(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=i.string,at(r,e.text,f,d,i)}_computeTitleHeight(){let n=this.options.title,e=ie(n.font),i=le(n.padding);return n.display?e.lineHeight+i.height:0}_getLegendItemAt(n,e){let i,s,o;if(ze(n,this.left,this.right)&&ze(e,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],ze(n,s.left,s.left+s.width)&&ze(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(n){let e=this.options;if(!Eg(n.type,e))return;let i=this._getLegendItemAt(n.x,n.y);if(n.type==="mousemove"||n.type==="mouseout"){let s=this._hoveredItem,o=Sg(s,i);s&&!o&&U(e.onLeave,[n,s,this],this),this._hoveredItem=i,i&&!o&&U(e.onHover,[n,i,this],this)}else i&&U(e.onClick,[n,i,this],this)}};function kg(t,n,e,i,s){let o=Mg(i,t,n,e),r=Dg(s,i,n.lineHeight);return{itemWidth:o,itemHeight:r}}function Mg(t,n,e,i){let s=t.text;return s&&typeof s!="string"&&(s=s.reduce((o,r)=>o.length>r.length?o:r)),n+e.size/2+i.measureText(s).width}function Dg(t,n,e){let i=t;return typeof n.text!="string"&&(i=Al(n,e)),i}function Al(t,n){let e=t.text?t.text.length:0;return n*e}function Eg(t,n){return!!((t==="mousemove"||t==="mouseout")&&(n.onHover||n.onLeave)||n.onClick&&(t==="click"||t==="mouseup"))}var Ig={id:"legend",_element:Cn,start(t,n,e){let i=t.legend=new Cn({ctx:t.ctx,options:e,chart:t});he.configure(t,i,e),he.addBox(t,i)},stop(t){he.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,n,e){let i=t.legend;he.configure(t,i,e),i.options=e},afterUpdate(t){let n=t.legend;n.buildLabels(),n.adjustHitBoxes()},afterEvent(t,n){n.replay||t.legend.handleEvent(n.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,n,e){let i=n.datasetIndex,s=e.chart;s.isDatasetVisible(i)?(s.hide(i),n.hidden=!0):(s.show(i),n.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){let n=t.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(l=>{let c=l.controller.getStyle(e?0:void 0),d=le(c.borderWidth);return{text:n[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}},Ci=class extends De{constructor(n){super(),this.chart=n.chart,this.options=n.options,this.ctx=n.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(n,e){let i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=n,this.height=this.bottom=e;let s=Q(i.text)?i.text.length:1;this._padding=le(i.padding);let o=s*ie(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){let n=this.options.position;return n==="top"||n==="bottom"}_drawArgs(n){let{top:e,left:i,bottom:s,right:o,options:r}=this,a=r.align,l=0,c,d,h;return this.isHorizontal()?(d=ae(a,i,o),h=e+n,c=o-i):(r.position==="left"?(d=i+n,h=ae(a,s,e),l=B*-.5):(d=o-n,h=ae(a,e,s),l=B*.5),c=s-e),{titleX:d,titleY:h,maxWidth:c,rotation:l}}draw(){let n=this.ctx,e=this.options;if(!e.display)return;let i=ie(e.font),o=i.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);at(n,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:nn(e.align),textBaseline:"middle",translation:[r,a]})}};function Pg(t,n){let e=new Ci({ctx:t.ctx,options:n,chart:t});he.configure(t,e,n),he.addBox(t,e),t.titleBlock=e}var Lg={id:"title",_element:Ci,start(t,n,e){Pg(t,e)},stop(t){let n=t.titleBlock;he.removeBox(t,n),delete t.titleBlock},beforeUpdate(t,n,e){let i=t.titleBlock;he.configure(t,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},pn=new WeakMap,Og={id:"subtitle",start(t,n,e){let i=new Ci({ctx:t.ctx,options:e,chart:t});he.configure(t,i,e),he.addBox(t,i),pn.set(t,i)},stop(t){he.removeBox(t,pn.get(t)),pn.delete(t)},beforeUpdate(t,n,e){let i=pn.get(t);he.configure(t,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},wi={average(t){if(!t.length)return!1;let n,e,i=new Set,s=0,o=0;for(n=0,e=t.length;n<e;++n){let a=t[n].element;if(a&&a.hasValue()){let l=a.tooltipPosition();i.add(l.x),s+=l.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((a,l)=>a+l)/i.size,y:s/o}},nearest(t,n){if(!t.length)return!1;let e=n.x,i=n.y,s=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=t.length;o<r;++o){let l=t[o].element;if(l&&l.hasValue()){let c=l.getCenterPoint(),d=Xi(n,c);d<s&&(s=d,a=l)}}if(a){let l=a.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function Ae(t,n){return n&&(Q(n)?Array.prototype.push.apply(t,n):t.push(n)),t}function Xe(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
`)>-1?t.split(`
`):t}function Rg(t,n){let{element:e,datasetIndex:i,index:s}=n,o=t.getDatasetMeta(i).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:t,label:r,parsed:o.getParsed(s),raw:t.data.datasets[i].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function il(t,n){let e=t.chart.ctx,{body:i,footer:s,title:o}=t,{boxWidth:r,boxHeight:a}=n,l=ie(n.bodyFont),c=ie(n.titleFont),d=ie(n.footerFont),h=o.length,u=s.length,f=i.length,g=le(n.padding),p=g.height,m=0,b=i.reduce((w,y)=>w+y.before.length+y.lines.length+y.after.length,0);if(b+=t.beforeBody.length+t.afterBody.length,h&&(p+=h*c.lineHeight+(h-1)*n.titleSpacing+n.titleMarginBottom),b){let w=n.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=f*w+(b-f)*l.lineHeight+(b-1)*n.bodySpacing}u&&(p+=n.footerMarginTop+u*d.lineHeight+(u-1)*n.footerSpacing);let _=0,x=function(w){m=Math.max(m,e.measureText(w).width+_)};return e.save(),e.font=c.string,j(t.title,x),e.font=l.string,j(t.beforeBody.concat(t.afterBody),x),_=n.displayColors?r+2+n.boxPadding:0,j(i,w=>{j(w.before,x),j(w.lines,x),j(w.after,x)}),_=0,e.font=d.string,j(t.footer,x),e.restore(),m+=g.width,{width:m,height:p}}function zg(t,n){let{y:e,height:i}=n;return e<i/2?"top":e>t.height-i/2?"bottom":"center"}function Ag(t,n,e,i){let{x:s,width:o}=i,r=e.caretSize+e.caretPadding;if(t==="left"&&s+o+r>n.width||t==="right"&&s-o-r<0)return!0}function Fg(t,n,e,i){let{x:s,width:o}=e,{width:r,chartArea:{left:a,right:l}}=t,c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),Ag(c,t,n,e)&&(c="center"),c}function nl(t,n,e){let i=e.yAlign||n.yAlign||zg(t,e);return{xAlign:e.xAlign||n.xAlign||Fg(t,n,e,i),yAlign:i}}function Vg(t,n){let{x:e,width:i}=t;return n==="right"?e-=i:n==="center"&&(e-=i/2),e}function Ng(t,n,e){let{y:i,height:s}=t;return n==="top"?i+=e:n==="bottom"?i-=s+e:i-=s/2,i}function sl(t,n,e,i){let{caretSize:s,caretPadding:o,cornerRadius:r}=t,{xAlign:a,yAlign:l}=e,c=s+o,{topLeft:d,topRight:h,bottomLeft:u,bottomRight:f}=lt(r),g=Vg(n,a),p=Ng(n,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(d,u)+s:a==="right"&&(g+=Math.max(h,f)+s),{x:ne(g,0,i.width-n.width),y:ne(p,0,i.height-n.height)}}function gn(t,n,e){let i=le(e.padding);return n==="center"?t.x+t.width/2:n==="right"?t.x+t.width-i.right:t.x+i.left}function ol(t){return Ae([],Xe(t))}function Bg(t,n,e){return qe(t,{tooltip:n,tooltipItems:e,type:"tooltip"})}function rl(t,n){let e=n&&n.dataset&&n.dataset.tooltip&&n.dataset.tooltip.callbacks;return e?t.override(e):t}var Fl={beforeTitle:Re,title(t){if(t.length>0){let n=t[0],e=n.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return n.dataset.label||"";if(n.label)return n.label;if(i>0&&n.dataIndex<i)return e[n.dataIndex]}return""},afterTitle:Re,beforeBody:Re,beforeLabel:Re,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let n=t.dataset.label||"";n&&(n+=": ");let e=t.formattedValue;return A(e)||(n+=e),n},labelColor(t){let e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){let e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Re,afterBody:Re,beforeFooter:Re,footer:Re,afterFooter:Re};function be(t,n,e,i){let s=t[n].call(e,i);return typeof s>"u"?Fl[n].call(e,i):s}var al=(()=>{class t extends De{static positioners=wi;constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let e=this._cachedAnimations;if(e)return e;let i=this.chart,s=this.options.setContext(this.getContext()),o=s.enabled&&i.options.animation&&s.animations,r=new yn(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=Bg(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,i){let{callbacks:s}=i,o=be(s,"beforeTitle",this,e),r=be(s,"title",this,e),a=be(s,"afterTitle",this,e),l=[];return l=Ae(l,Xe(o)),l=Ae(l,Xe(r)),l=Ae(l,Xe(a)),l}getBeforeBody(e,i){return ol(be(i.callbacks,"beforeBody",this,e))}getBody(e,i){let{callbacks:s}=i,o=[];return j(e,r=>{let a={before:[],lines:[],after:[]},l=rl(s,r);Ae(a.before,Xe(be(l,"beforeLabel",this,r))),Ae(a.lines,be(l,"label",this,r)),Ae(a.after,Xe(be(l,"afterLabel",this,r))),o.push(a)}),o}getAfterBody(e,i){return ol(be(i.callbacks,"afterBody",this,e))}getFooter(e,i){let{callbacks:s}=i,o=be(s,"beforeFooter",this,e),r=be(s,"footer",this,e),a=be(s,"afterFooter",this,e),l=[];return l=Ae(l,Xe(o)),l=Ae(l,Xe(r)),l=Ae(l,Xe(a)),l}_createItems(e){let i=this._active,s=this.chart.data,o=[],r=[],a=[],l=[],c,d;for(c=0,d=i.length;c<d;++c)l.push(Rg(this.chart,i[c]));return e.filter&&(l=l.filter((h,u,f)=>e.filter(h,u,f,s))),e.itemSort&&(l=l.sort((h,u)=>e.itemSort(h,u,s))),j(l,h=>{let u=rl(e.callbacks,h);o.push(be(u,"labelColor",this,h)),r.push(be(u,"labelPointStyle",this,h)),a.push(be(u,"labelTextColor",this,h))}),this.labelColors=o,this.labelPointStyles=r,this.labelTextColors=a,this.dataPoints=l,l}update(e,i){let s=this.options.setContext(this.getContext()),o=this._active,r,a=[];if(!o.length)this.opacity!==0&&(r={opacity:0});else{let l=wi[s.position].call(this,o,this._eventPosition);a=this._createItems(s),this.title=this.getTitle(a,s),this.beforeBody=this.getBeforeBody(a,s),this.body=this.getBody(a,s),this.afterBody=this.getAfterBody(a,s),this.footer=this.getFooter(a,s);let c=this._size=il(this,s),d=Object.assign({},l,c),h=nl(this.chart,s,d),u=sl(s,d,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,r={opacity:1,x:u.x,y:u.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,r&&this._resolveAnimations().update(this,r),e&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:i})}drawCaret(e,i,s,o){let r=this.getCaretPosition(e,s,o);i.lineTo(r.x1,r.y1),i.lineTo(r.x2,r.y2),i.lineTo(r.x3,r.y3)}getCaretPosition(e,i,s){let{xAlign:o,yAlign:r}=this,{caretSize:a,cornerRadius:l}=s,{topLeft:c,topRight:d,bottomLeft:h,bottomRight:u}=lt(l),{x:f,y:g}=e,{width:p,height:m}=i,b,_,x,w,y,v;return r==="center"?(y=g+m/2,o==="left"?(b=f,_=b-a,w=y+a,v=y-a):(b=f+p,_=b+a,w=y-a,v=y+a),x=b):(o==="left"?_=f+Math.max(c,h)+a:o==="right"?_=f+p-Math.max(d,u)-a:_=this.caretX,r==="top"?(w=g,y=w-a,b=_-a,x=_+a):(w=g+m,y=w+a,b=_+a,x=_-a),v=w),{x1:b,x2:_,x3:x,y1:w,y2:y,y3:v}}drawTitle(e,i,s){let o=this.title,r=o.length,a,l,c;if(r){let d=St(s.rtl,this.x,this.width);for(e.x=gn(this,s.titleAlign,s),i.textAlign=d.textAlign(s.titleAlign),i.textBaseline="middle",a=ie(s.titleFont),l=s.titleSpacing,i.fillStyle=s.titleColor,i.font=a.string,c=0;c<r;++c)i.fillText(o[c],d.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+l,c+1===r&&(e.y+=s.titleMarginBottom-l)}}_drawColorBox(e,i,s,o,r){let a=this.labelColors[s],l=this.labelPointStyles[s],{boxHeight:c,boxWidth:d}=r,h=ie(r.bodyFont),u=gn(this,"left",r),f=o.x(u),g=c<h.lineHeight?(h.lineHeight-c)/2:0,p=i.y+g;if(r.usePointStyle){let m={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},b=o.leftForLtr(f,d)+d/2,_=p+c/2;e.strokeStyle=r.multiKeyBackground,e.fillStyle=r.multiKeyBackground,on(e,m,b,_),e.strokeStyle=a.borderColor,e.fillStyle=a.backgroundColor,on(e,m,b,_)}else{e.lineWidth=F(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,e.strokeStyle=a.borderColor,e.setLineDash(a.borderDash||[]),e.lineDashOffset=a.borderDashOffset||0;let m=o.leftForLtr(f,d),b=o.leftForLtr(o.xPlus(f,1),d-2),_=lt(a.borderRadius);Object.values(_).some(x=>x!==0)?(e.beginPath(),e.fillStyle=r.multiKeyBackground,Qt(e,{x:m,y:p,w:d,h:c,radius:_}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),Qt(e,{x:b,y:p+1,w:d-2,h:c-2,radius:_}),e.fill()):(e.fillStyle=r.multiKeyBackground,e.fillRect(m,p,d,c),e.strokeRect(m,p,d,c),e.fillStyle=a.backgroundColor,e.fillRect(b,p+1,d-2,c-2))}e.fillStyle=this.labelTextColors[s]}drawBody(e,i,s){let{body:o}=this,{bodySpacing:r,bodyAlign:a,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:h}=s,u=ie(s.bodyFont),f=u.lineHeight,g=0,p=St(s.rtl,this.x,this.width),m=function(D){i.fillText(D,p.x(e.x+g),e.y+f/2),e.y+=f+r},b=p.textAlign(a),_,x,w,y,v,k,C;for(i.textAlign=a,i.textBaseline="middle",i.font=u.string,e.x=gn(this,b,s),i.fillStyle=s.bodyColor,j(this.beforeBody,m),g=l&&b!=="right"?a==="center"?d/2+h:d+2+h:0,y=0,k=o.length;y<k;++y){for(_=o[y],x=this.labelTextColors[y],i.fillStyle=x,j(_.before,m),w=_.lines,l&&w.length&&(this._drawColorBox(i,e,y,p,s),f=Math.max(u.lineHeight,c)),v=0,C=w.length;v<C;++v)m(w[v]),f=u.lineHeight;j(_.after,m)}g=0,f=u.lineHeight,j(this.afterBody,m),e.y-=r}drawFooter(e,i,s){let o=this.footer,r=o.length,a,l;if(r){let c=St(s.rtl,this.x,this.width);for(e.x=gn(this,s.footerAlign,s),e.y+=s.footerMarginTop,i.textAlign=c.textAlign(s.footerAlign),i.textBaseline="middle",a=ie(s.footerFont),i.fillStyle=s.footerColor,i.font=a.string,l=0;l<r;++l)i.fillText(o[l],c.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+s.footerSpacing}}drawBackground(e,i,s,o){let{xAlign:r,yAlign:a}=this,{x:l,y:c}=e,{width:d,height:h}=s,{topLeft:u,topRight:f,bottomLeft:g,bottomRight:p}=lt(o.cornerRadius);i.fillStyle=o.backgroundColor,i.strokeStyle=o.borderColor,i.lineWidth=o.borderWidth,i.beginPath(),i.moveTo(l+u,c),a==="top"&&this.drawCaret(e,i,s,o),i.lineTo(l+d-f,c),i.quadraticCurveTo(l+d,c,l+d,c+f),a==="center"&&r==="right"&&this.drawCaret(e,i,s,o),i.lineTo(l+d,c+h-p),i.quadraticCurveTo(l+d,c+h,l+d-p,c+h),a==="bottom"&&this.drawCaret(e,i,s,o),i.lineTo(l+g,c+h),i.quadraticCurveTo(l,c+h,l,c+h-g),a==="center"&&r==="left"&&this.drawCaret(e,i,s,o),i.lineTo(l,c+u),i.quadraticCurveTo(l,c,l+u,c),i.closePath(),i.fill(),o.borderWidth>0&&i.stroke()}_updateAnimationTarget(e){let i=this.chart,s=this.$animations,o=s&&s.x,r=s&&s.y;if(o||r){let a=wi[e.position].call(this,this._active,this._eventPosition);if(!a)return;let l=this._size=il(this,e),c=Object.assign({},a,this._size),d=nl(i,e,c),h=sl(e,c,d,i);(o._to!==h.x||r._to!==h.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(e){let i=this.options.setContext(this.getContext()),s=this.opacity;if(!s)return;this._updateAnimationTarget(i);let o={width:this.width,height:this.height},r={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;let a=le(i.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;i.enabled&&l&&(e.save(),e.globalAlpha=s,this.drawBackground(r,e,o,i),Es(e,i.textDirection),r.y+=a.top,this.drawTitle(r,e,i),this.drawBody(r,e,i),this.drawFooter(r,e,i),Is(e,i.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,i){let s=this._active,o=e.map(({datasetIndex:l,index:c})=>{let d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[c],index:c}}),r=!ui(s,o),a=this._positionChanged(o,i);(r||a)&&(this._active=o,this._eventPosition=i,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,i,s=!0){if(i&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let o=this.options,r=this._active||[],a=this._getActiveElements(e,r,i,s),l=this._positionChanged(a,e),c=i||!ui(a,r)||l;return c&&(this._active=a,(o.enabled||o.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,i))),c}_getActiveElements(e,i,s,o){let r=this.options;if(e.type==="mouseout")return[];if(!o)return i.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);let a=this.chart.getElementsAtEventForMode(e,r.mode,r,s);return r.reverse&&a.reverse(),a}_positionChanged(e,i){let{caretX:s,caretY:o,options:r}=this,a=wi[r.position].call(this,e,i);return a!==!1&&(s!==a.x||o!==a.y)}}return t})(),Hg={id:"tooltip",_element:al,positioners:wi,afterInit(t,n,e){e&&(t.tooltip=new al({chart:t,options:e}))},beforeUpdate(t,n,e){t.tooltip&&t.tooltip.initialize(e)},reset(t,n,e){t.tooltip&&t.tooltip.initialize(e)},afterDraw(t){let n=t.tooltip;if(n&&n._willRender()){let e={tooltip:n};if(t.notifyPlugins("beforeTooltipDraw",Pt(Ee({},e),{cancelable:!0}))===!1)return;n.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",e)}},afterEvent(t,n){if(t.tooltip){let e=n.replay;t.tooltip.handleEvent(n.event,e,n.inChartArea)&&(n.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,n)=>n.bodyFont.size,boxWidth:(t,n)=>n.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Fl},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},jg=Object.freeze({__proto__:null,Colors:eg,Decimation:sg,Filler:Cg,Legend:Ig,SubTitle:Og,Title:Lg,Tooltip:Hg}),Wg=(t,n,e,i)=>(typeof n=="string"?(e=t.push(n)-1,i.unshift({index:e,label:n})):isNaN(n)&&(e=null),e);function $g(t,n,e,i){let s=t.indexOf(n);if(s===-1)return Wg(t,n,e,i);let o=t.lastIndexOf(n);return s!==o?e:s}var Kg=(t,n)=>t===null?null:ne(Math.round(t),0,n);function ll(t){let n=this.getLabels();return t>=0&&t<n.length?n[t]:t}var Ug=(()=>{class t extends Dt{static id="category";static defaults={ticks:{callback:ll}};constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){let i=this._addedLabels;if(i.length){let s=this.getLabels();for(let{index:o,label:r}of i)s[o]===r&&s.splice(o,1);this._addedLabels=[]}super.init(e)}parse(e,i){if(A(e))return null;let s=this.getLabels();return i=isFinite(i)&&s[i]===e?i:$g(s,e,I(i,e),this._addedLabels),Kg(i,s.length-1)}determineDataLimits(){let{minDefined:e,maxDefined:i}=this.getUserBounds(),{min:s,max:o}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(s=0),i||(o=this.getLabels().length-1)),this.min=s,this.max=o}buildTicks(){let e=this.min,i=this.max,s=this.options.offset,o=[],r=this.getLabels();r=e===0&&i===r.length-1?r:r.slice(e,i+1),this._valueRange=Math.max(r.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let a=e;a<=i;a++)o.push({value:a});return o}getLabelForValue(e){return ll.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){let i=this.ticks;return e<0||e>i.length-1?null:this.getPixelForValue(i[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}return t})();function Qg(t,n){let e=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:d,maxDigits:h,includeBounds:u}=t,f=o||1,g=d-1,{min:p,max:m}=n,b=!A(r),_=!A(a),x=!A(c),w=(m-p)/(h+1),y=ls((m-p)/g/f)*f,v,k,C,D;if(y<1e-14&&!b&&!_)return[{value:p},{value:m}];D=Math.ceil(m/y)-Math.floor(p/y),D>g&&(y=ls(D*y/g/f)*f),A(l)||(v=Math.pow(10,l),y=Math.ceil(y*v)/v),s==="ticks"?(k=Math.floor(p/y)*y,C=Math.ceil(m/y)*y):(k=p,C=m),b&&_&&o&&Yr((a-r)/o,y/1e3)?(D=Math.round(Math.min((a-r)/y,d)),y=(a-r)/D,k=r,C=a):x?(k=b?r:k,C=_?a:C,D=c-1,y=(C-k)/D):(D=(C-k)/y,$t(D,Math.round(D),y/1e3)?D=Math.round(D):D=Math.ceil(D));let z=Math.max(ds(y),ds(k));v=Math.pow(10,A(l)?z:l),k=Math.round(k*v)/v,C=Math.round(C*v)/v;let R=0;for(b&&(u&&k!==r?(e.push({value:r}),k<r&&R++,$t(Math.round((k+R*y)*v)/v,r,cl(r,w,t))&&R++):k<r&&R++);R<D;++R){let V=Math.round((k+R*y)*v)/v;if(_&&V>a)break;e.push({value:V})}return _&&u&&C!==a?e.length&&$t(e[e.length-1].value,a,cl(a,w,t))?e[e.length-1].value=a:e.push({value:a}):(!_||C===a)&&e.push({value:C}),e}function cl(t,n,{horizontal:e,minRotation:i}){let s=Se(i),o=(e?Math.sin(s):Math.cos(s))||.001,r=.75*n*(""+t).length;return Math.min(n/o,r)}var Xt=class extends Dt{constructor(n){super(n),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(n,e){return A(n)||(typeof n=="number"||n instanceof Number)&&!isFinite(+n)?null:+n}handleTickRangeOptions(){let{beginAtZero:n}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds(),{min:s,max:o}=this,r=l=>s=e?s:l,a=l=>o=i?o:l;if(n){let l=Me(s),c=Me(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);a(o+l),n||r(s-l)}this.min=s,this.max=o}getTickLimit(){let n=this.options.ticks,{maxTicksLimit:e,stepSize:i}=n,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let n=this.options,e=n.ticks,i=this.getTickLimit();i=Math.max(2,i);let s={maxTicks:i,bounds:n.bounds,min:n.min,max:n.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=Qg(s,o);return n.bounds==="ticks"&&cs(r,this,"value"),n.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){let n=this.ticks,e=this.min,i=this.max;if(super.configure(),this.options.offset&&n.length){let s=(i-e)/Math.max(n.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(n){return Ut(n,this.chart.options.locale,this.options.ticks.format)}},ro=class extends Xt{static id="linear";static defaults={ticks:{callback:fi.formatters.numeric}};determineDataLimits(){let{min:n,max:e}=this.getMinMax(!0);this.min=J(n)?n:0,this.max=J(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){let n=this.isHorizontal(),e=n?this.width:this.height,i=Se(this.options.ticks.minRotation),s=(n?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(n){return n===null?NaN:this.getPixelForDecimal((n-this._startValue)/this._valueRange)}getValueForPixel(n){return this._startValue+this.getDecimalForPixel(n)*this._valueRange}},Si=t=>Math.floor(Qe(t)),Mt=(t,n)=>Math.pow(10,Si(t)+n);function dl(t){return t/Math.pow(10,Si(t))===1}function hl(t,n,e){let i=Math.pow(10,e),s=Math.floor(t/i);return Math.ceil(n/i)-s}function Yg(t,n){let e=n-t,i=Si(e);for(;hl(t,n,i)>10;)i++;for(;hl(t,n,i)<10;)i--;return Math.min(i,Si(t))}function qg(t,{min:n,max:e}){n=me(t.min,n);let i=[],s=Si(n),o=Yg(n,e),r=o<0?Math.pow(10,Math.abs(o)):1,a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((n-l)*r)/r,d=Math.floor((n-l)/a/10)*a*10,h=Math.floor((c-d)/Math.pow(10,o)),u=me(t.min,Math.round((l+d+h*Math.pow(10,o))*r)/r);for(;u<e;)i.push({value:u,major:dl(u),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(o++,h=2,r=o>=0?1:r),u=Math.round((l+d+h*Math.pow(10,o))*r)/r;let f=me(t.max,u);return i.push({value:f,major:dl(f),significand:h}),i}var ao=class extends Dt{static id="logarithmic";static defaults={ticks:{callback:fi.formatters.logarithmic,major:{enabled:!0}}};constructor(n){super(n),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(n,e){let i=Xt.prototype.parse.apply(this,[n,e]);if(i===0){this._zero=!0;return}return J(i)&&i>0?i:null}determineDataLimits(){let{min:n,max:e}=this.getMinMax(!0);this.min=J(n)?Math.max(0,n):null,this.max=J(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!J(this._userMin)&&(this.min=n===Mt(this.min,0)?Mt(this.min,-1):Mt(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:n,maxDefined:e}=this.getUserBounds(),i=this.min,s=this.max,o=a=>i=n?i:a,r=a=>s=e?s:a;i===s&&(i<=0?(o(1),r(10)):(o(Mt(i,-1)),r(Mt(s,1)))),i<=0&&o(Mt(s,-1)),s<=0&&r(Mt(i,1)),this.min=i,this.max=s}buildTicks(){let n=this.options,e={min:this._userMin,max:this._userMax},i=qg(e,this);return n.bounds==="ticks"&&cs(i,this,"value"),n.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(n){return n===void 0?"0":Ut(n,this.chart.options.locale,this.options.ticks.format)}configure(){let n=this.min;super.configure(),this._startValue=Qe(n),this._valueRange=Qe(this.max)-Qe(n)}getPixelForValue(n){return(n===void 0||n===0)&&(n=this.min),n===null||isNaN(n)?NaN:this.getPixelForDecimal(n===this.min?0:(Qe(n)-this._startValue)/this._valueRange)}getValueForPixel(n){let e=this.getDecimalForPixel(n);return Math.pow(10,this._startValue+e*this._valueRange)}};function lo(t){let n=t.ticks;if(n.display&&t.display){let e=le(n.backdropPadding);return I(n.font&&n.font.size,G.font.size)+e.height}return 0}function Gg(t,n,e){return e=Q(e)?e:[e],{w:na(t,n.string,e),h:e.length*n.lineHeight}}function ul(t,n,e,i,s){return t===i||t===s?{start:n-e/2,end:n+e/2}:t<i||t>s?{start:n-e,end:n}:{start:n,end:n+e}}function Xg(t){let n={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},e=Object.assign({},n),i=[],s=[],o=t._pointLabels.length,r=t.options.pointLabels,a=r.centerPointLabels?B/o:0;for(let l=0;l<o;l++){let c=r.setContext(t.getPointLabelContext(l));s[l]=c.padding;let d=t.getPointPosition(l,t.drawingArea+s[l],a),h=ie(c.font),u=Gg(t.ctx,h,t._pointLabels[l]);i[l]=u;let f=re(t.getIndexAngle(l)+a),g=Math.round(en(f)),p=ul(g,d.x,u.w,0,180),m=ul(g,d.y,u.h,90,270);Jg(e,n,f,p,m)}t.setCenterPoint(n.l-e.l,e.r-n.r,n.t-e.t,e.b-n.b),t._pointLabelItems=tm(t,i,s)}function Jg(t,n,e,i,s){let o=Math.abs(Math.sin(e)),r=Math.abs(Math.cos(e)),a=0,l=0;i.start<n.l?(a=(n.l-i.start)/o,t.l=Math.min(t.l,n.l-a)):i.end>n.r&&(a=(i.end-n.r)/o,t.r=Math.max(t.r,n.r+a)),s.start<n.t?(l=(n.t-s.start)/r,t.t=Math.min(t.t,n.t-l)):s.end>n.b&&(l=(s.end-n.b)/r,t.b=Math.max(t.b,n.b+l))}function Zg(t,n,e){let i=t.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=e,l=t.getPointPosition(n,i+s+r,o),c=Math.round(en(re(l.angle+Z))),d=sm(l.y,a.h,c),h=im(c),u=nm(l.x,a.w,h);return{visible:!0,x:l.x,y:d,textAlign:h,left:u,top:d,right:u+a.w,bottom:d+a.h}}function em(t,n){if(!n)return!0;let{left:e,top:i,right:s,bottom:o}=t;return!(Oe({x:e,y:i},n)||Oe({x:e,y:o},n)||Oe({x:s,y:i},n)||Oe({x:s,y:o},n))}function tm(t,n,e){let i=[],s=t._pointLabels.length,o=t.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:lo(o)/2,additionalAngle:r?B/s:0},c;for(let d=0;d<s;d++){l.padding=e[d],l.size=n[d];let h=Zg(t,d,l);i.push(h),a==="auto"&&(h.visible=em(h,c),h.visible&&(c=h))}return i}function im(t){return t===0||t===180?"center":t<180?"left":"right"}function nm(t,n,e){return e==="right"?t-=n:e==="center"&&(t-=n/2),t}function sm(t,n,e){return e===90||e===270?t-=n/2:(e>270||e<90)&&(t-=n),t}function om(t,n,e){let{left:i,top:s,right:o,bottom:r}=e,{backdropColor:a}=n;if(!A(a)){let l=lt(n.borderRadius),c=le(n.backdropPadding);t.fillStyle=a;let d=i-c.left,h=s-c.top,u=o-i+c.width,f=r-s+c.height;Object.values(l).some(g=>g!==0)?(t.beginPath(),Qt(t,{x:d,y:h,w:u,h:f,radius:l}),t.fill()):t.fillRect(d,h,u,f)}}function rm(t,n){let{ctx:e,options:{pointLabels:i}}=t;for(let s=n-1;s>=0;s--){let o=t._pointLabelItems[s];if(!o.visible)continue;let r=i.setContext(t.getPointLabelContext(s));om(e,r,o);let a=ie(r.font),{x:l,y:c,textAlign:d}=o;at(e,t._pointLabels[s],l,c+a.lineHeight/2,a,{color:r.color,textAlign:d,textBaseline:"middle"})}}function Vl(t,n,e,i){let{ctx:s}=t;if(e)s.arc(t.xCenter,t.yCenter,n,0,Y);else{let o=t.getPointPosition(0,n);s.moveTo(o.x,o.y);for(let r=1;r<i;r++)o=t.getPointPosition(r,n),s.lineTo(o.x,o.y)}}function am(t,n,e,i,s){let o=t.ctx,r=n.circular,{color:a,lineWidth:l}=n;!r&&!i||!a||!l||e<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),Vl(t,e,r,i),o.closePath(),o.stroke(),o.restore())}function lm(t,n,e){return qe(t,{label:e,index:n,type:"pointLabel"})}var co=class extends Xt{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:fi.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(n){return n},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(n){super(n),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let n=this._padding=le(lo(this.options)/2),e=this.width=this.maxWidth-n.width,i=this.height=this.maxHeight-n.height;this.xCenter=Math.floor(this.left+e/2+n.left),this.yCenter=Math.floor(this.top+i/2+n.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){let{min:n,max:e}=this.getMinMax(!1);this.min=J(n)&&!isNaN(n)?n:0,this.max=J(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/lo(this.options))}generateTickLabels(n){Xt.prototype.generateTickLabels.call(this,n),this._pointLabels=this.getLabels().map((e,i)=>{let s=U(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){let n=this.options;n.display&&n.pointLabels.display?Xg(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(n,e,i,s){this.xCenter+=Math.floor((n-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(n,e,i,s))}getIndexAngle(n){let e=Y/(this._pointLabels.length||1),i=this.options.startAngle||0;return re(n*e+Se(i))}getDistanceFromCenterForValue(n){if(A(n))return NaN;let e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-n)*e:(n-this.min)*e}getValueForDistanceFromCenter(n){if(A(n))return NaN;let e=n/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(n){let e=this._pointLabels||[];if(n>=0&&n<e.length){let i=e[n];return lm(this.getContext(),n,i)}}getPointPosition(n,e,i=0){let s=this.getIndexAngle(n)-Z+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(n,e){return this.getPointPosition(n,this.getDistanceFromCenterForValue(e))}getBasePosition(n){return this.getPointPositionForValue(n||0,this.getBaseValue())}getPointLabelPosition(n){let{left:e,top:i,right:s,bottom:o}=this._pointLabelItems[n];return{left:e,top:i,right:s,bottom:o}}drawBackground(){let{backgroundColor:n,grid:{circular:e}}=this.options;if(n){let i=this.ctx;i.save(),i.beginPath(),Vl(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=n,i.fill(),i.restore()}}drawGrid(){let n=this.ctx,e=this.options,{angleLines:i,grid:s,border:o}=e,r=this._pointLabels.length,a,l,c;if(e.pointLabels.display&&rm(this,r),s.display&&this.ticks.forEach((d,h)=>{if(h!==0||h===0&&this.min<0){l=this.getDistanceFromCenterForValue(d.value);let u=this.getContext(h),f=s.setContext(u),g=o.setContext(u);am(this,f,l,r,g)}}),i.display){for(n.save(),a=r-1;a>=0;a--){let d=i.setContext(this.getPointLabelContext(a)),{color:h,lineWidth:u}=d;!u||!h||(n.lineWidth=u,n.strokeStyle=h,n.setLineDash(d.borderDash),n.lineDashOffset=d.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(a,l),n.beginPath(),n.moveTo(this.xCenter,this.yCenter),n.lineTo(c.x,c.y),n.stroke())}n.restore()}}drawBorder(){}drawLabels(){let n=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;let s=this.getIndexAngle(0),o,r;n.save(),n.translate(this.xCenter,this.yCenter),n.rotate(s),n.textAlign="center",n.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;let c=i.setContext(this.getContext(l)),d=ie(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){n.font=d.string,r=n.measureText(a.label).width,n.fillStyle=c.backdropColor;let h=le(c.backdropPadding);n.fillRect(-r/2-h.left,-o-d.size/2-h.top,r+h.width,d.size+h.height)}at(n,a.label,0,-o,d,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),n.restore()}drawTitle(){}},Dn={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},_e=Object.keys(Dn);function fl(t,n){return t-n}function pl(t,n){if(A(n))return null;let e=t._adapter,{parser:i,round:s,isoWeekday:o}=t._parseOpts,r=n;return typeof i=="function"&&(r=i(r)),J(r)||(r=typeof i=="string"?e.parse(r,i):e.parse(r)),r===null?null:(s&&(r=s==="week"&&(Ct(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,s)),+r)}function gl(t,n,e,i){let s=_e.length;for(let o=_e.indexOf(t);o<s-1;++o){let r=Dn[_e[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-n)/(a*r.size))<=i)return _e[o]}return _e[s-1]}function cm(t,n,e,i,s){for(let o=_e.length-1;o>=_e.indexOf(e);o--){let r=_e[o];if(Dn[r].common&&t._adapter.diff(s,i,r)>=n-1)return r}return _e[e?_e.indexOf(e):0]}function dm(t){for(let n=_e.indexOf(t)+1,e=_e.length;n<e;++n)if(Dn[_e[n]].common)return _e[n]}function ml(t,n,e){if(!e)t[n]=!0;else if(e.length){let{lo:i,hi:s}=tn(e,n),o=e[i]>=n?e[i]:e[s];t[o]=!0}}function hm(t,n,e,i){let s=t._adapter,o=+s.startOf(n[0].value,i),r=n[n.length-1].value,a,l;for(a=o;a<=r;a=+s.add(a,1,i))l=e[a],l>=0&&(n[l].major=!0);return n}function bl(t,n,e){let i=[],s={},o=n.length,r,a;for(r=0;r<o;++r)a=n[r],s[a]=r,i.push({value:a,major:!1});return o===0||!e?i:hm(t,i,s,e)}var ho=(()=>{class t extends Dt{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,i={}){let s=e.time||(e.time={}),o=this._adapter=new wf._date(e.adapters.date);o.init(i),jt(s.displayFormats,o.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(e),this._normalized=i.normalized}parse(e,i){return e===void 0?null:pl(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let e=this.options,i=this._adapter,s=e.time.unit||"day",{min:o,max:r,minDefined:a,maxDefined:l}=this.getUserBounds();function c(d){!a&&!isNaN(d.min)&&(o=Math.min(o,d.min)),!l&&!isNaN(d.max)&&(r=Math.max(r,d.max))}(!a||!l)&&(c(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&c(this.getMinMax(!1))),o=J(o)&&!isNaN(o)?o:+i.startOf(Date.now(),s),r=J(r)&&!isNaN(r)?r:+i.endOf(Date.now(),s)+1,this.min=Math.min(o,r-1),this.max=Math.max(o+1,r)}_getLabelBounds(){let e=this.getLabelTimestamps(),i=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return e.length&&(i=e[0],s=e[e.length-1]),{min:i,max:s}}buildTicks(){let e=this.options,i=e.time,s=e.ticks,o=s.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&o.length&&(this.min=this._userMin||o[0],this.max=this._userMax||o[o.length-1]);let r=this.min,a=this.max,l=Xr(o,r,a);return this._unit=i.unit||(s.autoSkip?gl(i.minUnit,this.min,this.max,this._getLabelCapacity(r)):cm(this,l.length,i.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:dm(this._unit),this.initOffsets(o),e.reverse&&l.reverse(),bl(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let i=0,s=0,o,r;this.options.offset&&e.length&&(o=this.getDecimalForValue(e[0]),e.length===1?i=1-o:i=(this.getDecimalForValue(e[1])-o)/2,r=this.getDecimalForValue(e[e.length-1]),e.length===1?s=r:s=(r-this.getDecimalForValue(e[e.length-2]))/2);let a=e.length<3?.5:.25;i=ne(i,0,a),s=ne(s,0,a),this._offsets={start:i,end:s,factor:1/(i+1+s)}}_generate(){let e=this._adapter,i=this.min,s=this.max,o=this.options,r=o.time,a=r.unit||gl(r.minUnit,i,s,this._getLabelCapacity(i)),l=I(o.ticks.stepSize,1),c=a==="week"?r.isoWeekday:!1,d=Ct(c)||c===!0,h={},u=i,f,g;if(d&&(u=+e.startOf(u,"isoWeek",c)),u=+e.startOf(u,d?"day":a),e.diff(s,i,a)>1e5*l)throw new Error(i+" and "+s+" are too far apart with stepSize of "+l+" "+a);let p=o.ticks.source==="data"&&this.getDataTimestamps();for(f=u,g=0;f<s;f=+e.add(f,l,a),g++)ml(h,f,p);return(f===s||o.bounds==="ticks"||g===1)&&ml(h,f,p),Object.keys(h).sort(fl).map(m=>+m)}getLabelForValue(e){let i=this._adapter,s=this.options.time;return s.tooltipFormat?i.format(e,s.tooltipFormat):i.format(e,s.displayFormats.datetime)}format(e,i){let o=this.options.time.displayFormats,r=this._unit,a=i||o[r];return this._adapter.format(e,a)}_tickFormatFunction(e,i,s,o){let r=this.options,a=r.ticks.callback;if(a)return U(a,[e,i,s],this);let l=r.time.displayFormats,c=this._unit,d=this._majorUnit,h=c&&l[c],u=d&&l[d],f=s[i],g=d&&u&&f&&f.major;return this._adapter.format(e,o||(g?u:h))}generateTickLabels(e){let i,s,o;for(i=0,s=e.length;i<s;++i)o=e[i],o.label=this._tickFormatFunction(o.value,i,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){let i=this._offsets,s=this.getDecimalForValue(e);return this.getPixelForDecimal((i.start+s)*i.factor)}getValueForPixel(e){let i=this._offsets,s=this.getDecimalForPixel(e)/i.factor-i.end;return this.min+s*(this.max-this.min)}_getLabelSize(e){let i=this.options.ticks,s=this.ctx.measureText(e).width,o=Se(this.isHorizontal()?i.maxRotation:i.minRotation),r=Math.cos(o),a=Math.sin(o),l=this._resolveTickFontOptions(0).size;return{w:s*r+l*a,h:s*a+l*r}}_getLabelCapacity(e){let i=this.options.time,s=i.displayFormats,o=s[i.unit]||s.millisecond,r=this._tickFormatFunction(e,0,bl(this,[e],this._majorUnit),o),a=this._getLabelSize(r),l=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return l>0?l:1}getDataTimestamps(){let e=this._cache.data||[],i,s;if(e.length)return e;let o=this.getMatchingVisibleMetas();if(this._normalized&&o.length)return this._cache.data=o[0].controller.getAllParsedValues(this);for(i=0,s=o.length;i<s;++i)e=e.concat(o[i].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){let e=this._cache.labels||[],i,s;if(e.length)return e;let o=this.getLabels();for(i=0,s=o.length;i<s;++i)e.push(pl(this,o[i]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return fs(e.sort(fl))}}return t})();function mn(t,n,e){let i=0,s=t.length-1,o,r,a,l;e?(n>=t[i].pos&&n<=t[s].pos&&({lo:i,hi:s}=Le(t,"pos",n)),{pos:o,time:a}=t[i],{pos:r,time:l}=t[s]):(n>=t[i].time&&n<=t[s].time&&({lo:i,hi:s}=Le(t,"time",n)),{time:o,pos:a}=t[i],{time:r,pos:l}=t[s]);let c=r-o;return c?a+(l-a)*(n-o)/c:a}var uo=class extends ho{static id="timeseries";static defaults=ho.defaults;constructor(n){super(n),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let n=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(n);this._minPos=mn(e,this.min),this._tableRange=mn(e,this.max)-this._minPos,super.initOffsets(n)}buildLookupTable(n){let{min:e,max:i}=this,s=[],o=[],r,a,l,c,d;for(r=0,a=n.length;r<a;++r)c=n[r],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(r=0,a=s.length;r<a;++r)d=s[r+1],l=s[r-1],c=s[r],Math.round((d+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){let n=this.min,e=this.max,i=super.getDataTimestamps();return(!i.includes(n)||!i.length)&&i.splice(0,0,n),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((s,o)=>s-o)}_getTimestampsForTable(){let n=this._cache.all||[];if(n.length)return n;let e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?n=this.normalize(e.concat(i)):n=e.length?e:i,n=this._cache.all=n,n}getDecimalForValue(n){return(mn(this._table,n)-this._minPos)/this._tableRange}getValueForPixel(n){let e=this._offsets,i=this.getDecimalForPixel(n)/e.factor-e.end;return mn(this._table,i*this._tableRange+this._minPos,!0)}},um=Object.freeze({__proto__:null,CategoryScale:Ug,LinearScale:ro,LogarithmicScale:ao,RadialLinearScale:co,TimeScale:ho,TimeSeriesScale:uo}),Nl=[vf,Qp,jg,um];Sn.register(...Nl);var Bl=Sn;var fm=(()=>{class t{platformId;el;zone;type;plugins=[];width;height;responsive=!0;ariaLabel;ariaLabelledBy;get data(){return this._data}set data(e){this._data=e,this.reinit()}get options(){return this._options}set options(e){this._options=e,this.reinit()}onDataSelect=new H;isBrowser=!1;initialized;_data;_options={};chart;constructor(e,i,s){this.platformId=e,this.el=i,this.zone=s}ngAfterViewInit(){this.initChart(),this.initialized=!0}onCanvasClick(e){if(this.chart){let i=this.chart.getElementsAtEventForMode(e,"nearest",{intersect:!0},!1),s=this.chart.getElementsAtEventForMode(e,"dataset",{intersect:!0},!1);i&&i[0]&&s&&this.onDataSelect.emit({originalEvent:e,element:i[0],dataset:s})}}initChart(){if(At(this.platformId)){let e=this.options||{};e.responsive=this.responsive,e.responsive&&(this.height||this.width)&&(e.maintainAspectRatio=!1),this.zone.runOutsideAngular(()=>{this.chart=new Bl(this.el.nativeElement.children[0].children[0],{type:this.type,data:this.data,options:this.options,plugins:this.plugins})})}}getCanvas(){return this.el.nativeElement.children[0].children[0]}getBase64Image(){return this.chart.toBase64Image()}generateLegend(){if(this.chart)return this.chart.generateLegend()}refresh(){this.chart&&this.chart.update()}reinit(){this.chart&&(this.chart.destroy(),this.initChart())}ngOnDestroy(){this.chart&&(this.chart.destroy(),this.initialized=!1,this.chart=null)}static \u0275fac=function(i){return new(i||t)(te(Ii),te(pt),te(Ne))};static \u0275cmp=Be({type:t,selectors:[["p-chart"]],inputs:{type:"type",plugins:"plugins",width:"width",height:"height",responsive:[2,"responsive","responsive",q],ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",data:"data",options:"options"},outputs:{onDataSelect:"onDataSelect"},decls:2,vars:8,consts:[[2,"position","relative"],["role","img",3,"click"]],template:function(i,s){i&1&&(O(0,"div",0)(1,"canvas",1),fe("click",function(r){return s.onCanvasClick(r)}),N()()),i&2&&(Li("width",s.responsive&&!s.width?null:s.width)("height",s.responsive&&!s.height?null:s.height),S(),Ot("aria-label",s.ariaLabel)("aria-labelledby",s.ariaLabelledBy)("width",s.responsive&&!s.width?null:s.width)("height",s.responsive&&!s.height?null:s.height))},dependencies:[zi,xt],encapsulation:2,changeDetection:0})}return t})(),Hl=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=Pe({type:t});static \u0275inj=Ie({imports:[fm,xt,xt]})}return t})();var jl=(()=>{class t{el;zone;renderer;scope;dragEffect;dragHandle;onDragStart=new H;onDragEnd=new H;onDrag=new H;handle;dragListener;mouseDownListener;mouseUpListener;_pDraggableDisabled=!1;constructor(e,i,s){this.el=e,this.zone=i,this.renderer=s}get pDraggableDisabled(){return this._pDraggableDisabled}set pDraggableDisabled(e){this._pDraggableDisabled=e,this._pDraggableDisabled?this.unbindMouseListeners():(this.el.nativeElement.draggable=!0,this.bindMouseListeners())}ngAfterViewInit(){this.pDraggableDisabled||(this.el.nativeElement.draggable=!0,this.bindMouseListeners())}bindDragListener(){this.dragListener||this.zone.runOutsideAngular(()=>{this.dragListener=this.renderer.listen(this.el.nativeElement,"drag",this.drag.bind(this))})}unbindDragListener(){this.dragListener&&this.zone.runOutsideAngular(()=>{this.dragListener&&this.dragListener(),this.dragListener=null})}bindMouseListeners(){!this.mouseDownListener&&!this.mouseUpListener&&this.zone.runOutsideAngular(()=>{this.mouseDownListener=this.renderer.listen(this.el.nativeElement,"mousedown",this.mousedown.bind(this)),this.mouseUpListener=this.renderer.listen(this.el.nativeElement,"mouseup",this.mouseup.bind(this))})}unbindMouseListeners(){this.mouseDownListener&&this.mouseUpListener&&this.zone.runOutsideAngular(()=>{this.mouseDownListener&&this.mouseDownListener(),this.mouseUpListener&&this.mouseUpListener(),this.mouseDownListener=null,this.mouseUpListener=null})}drag(e){this.onDrag.emit(e)}dragStart(e){this.allowDrag()&&!this.pDraggableDisabled?(this.dragEffect&&(e.dataTransfer.effectAllowed=this.dragEffect),e.dataTransfer.setData("text",this.scope),this.onDragStart.emit(e),this.bindDragListener()):e.preventDefault()}dragEnd(e){this.onDragEnd.emit(e),this.unbindDragListener()}mousedown(e){this.handle=e.target}mouseup(e){this.handle=null}allowDrag(){return this.dragHandle&&this.handle?ri.matches(this.handle,this.dragHandle):!0}ngOnDestroy(){this.unbindDragListener(),this.unbindMouseListeners()}static \u0275fac=function(i){return new(i||t)(te(pt),te(Ne),te(ei))};static \u0275dir=Pi({type:t,selectors:[["","pDraggable",""]],hostBindings:function(i,s){i&1&&fe("dragstart",function(r){return s.dragStart(r)})("dragend",function(r){return s.dragEnd(r)})},inputs:{scope:[0,"pDraggable","scope"],dragEffect:"dragEffect",dragHandle:"dragHandle",pDraggableDisabled:"pDraggableDisabled"},outputs:{onDragStart:"onDragStart",onDragEnd:"onDragEnd",onDrag:"onDrag"}})}return t})(),Wl=(()=>{class t{el;zone;renderer;scope;_pDroppableDisabled=!1;get pDroppableDisabled(){return this._pDroppableDisabled}set pDroppableDisabled(e){this._pDroppableDisabled=e,this._pDroppableDisabled?this.unbindDragOverListener():this.bindDragOverListener()}dropEffect;onDragEnter=new H;onDragLeave=new H;onDrop=new H;constructor(e,i,s){this.el=e,this.zone=i,this.renderer=s}dragOverListener;ngAfterViewInit(){this.pDroppableDisabled||this.bindDragOverListener()}bindDragOverListener(){this.dragOverListener||this.zone.runOutsideAngular(()=>{this.dragOverListener=this.renderer.listen(this.el.nativeElement,"dragover",this.dragOver.bind(this))})}unbindDragOverListener(){this.dragOverListener&&this.zone.runOutsideAngular(()=>{this.dragOverListener&&this.dragOverListener(),this.dragOverListener=null})}dragOver(e){e.preventDefault()}drop(e){this.allowDrop(e)&&(Ft(this.el.nativeElement,"p-draggable-enter"),e.preventDefault(),this.onDrop.emit(e))}dragEnter(e){e.preventDefault(),this.dropEffect&&(e.dataTransfer.dropEffect=this.dropEffect),si(this.el.nativeElement,"p-draggable-enter"),this.onDragEnter.emit(e)}dragLeave(e){e.preventDefault(),this.el.nativeElement.contains(e.relatedTarget)||(Ft(this.el.nativeElement,"p-draggable-enter"),this.onDragLeave.emit(e))}allowDrop(e){let i=e.dataTransfer.getData("text");if(typeof this.scope=="string"&&i==this.scope)return!0;if(Array.isArray(this.scope)){for(let s=0;s<this.scope.length;s++)if(i==this.scope[s])return!0}return!1}ngOnDestroy(){this.unbindDragOverListener()}static \u0275fac=function(i){return new(i||t)(te(pt),te(Ne),te(ei))};static \u0275dir=Pi({type:t,selectors:[["","pDroppable",""]],hostBindings:function(i,s){i&1&&fe("drop",function(r){return s.drop(r)})("dragenter",function(r){return s.dragEnter(r)})("dragleave",function(r){return s.dragLeave(r)})},inputs:{scope:[0,"pDroppable","scope"],pDroppableDisabled:"pDroppableDisabled",dropEffect:"dropEffect"},outputs:{onDragEnter:"onDragEnter",onDragLeave:"onDragLeave",onDrop:"onDrop"}})}return t})(),$l=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=Pe({type:t});static \u0275inj=Ie({})}return t})();var Kl=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=Pe({type:t})}static{this.\u0275inj=Ie({imports:[Wo,Qo,$o,Yo,Hl,qo,$l,Xo,Zo,Jo,er,Ko,ir,nr,jo,sr,rr,hr,dr,fr,pr,or,Sr]})}}return t})();var gm=[[["","headerMessage",""]],"*"],mm=["[headerMessage]","*"],bm=()=>["previewMessage"],Ul=(t,n)=>({preview:t,position:n}),_m=()=>({cursor:"grab"}),ym=()=>["previewBottomMessage"];function xm(t,n){if(t&1&&K(0,3),t&2){let e=E(),i=Rt(18);T("ngTemplateOutlet",i)("ngTemplateOutletContext",je(3,Ul,e.preview,zt(2,bm)))}}function vm(t,n){t&1&&(He(0),bt(1,"translate")),t&2&&Ri(" ",_t(1,1,"Suggested email address")," ")}function wm(t,n){t&1&&(He(0),bt(1,"translate")),t&2&&Ri(" ",_t(1,1,"Suggested email addresses")," ")}function Tm(t,n){if(t&1&&(O(0,"div",12),M(1,vm,2,3)(2,wm,2,3),O(3,"small",13),He(4,"("),O(5,"span",14),He(6,"Drag and drop"),N(),He(7,")"),N()()),t&2){let e=E(2);S(),ii(e.emails.length<2?1:2)}}function Cm(t,n){if(t&1){let e=Ze();O(0,"p-tag",15),fe("onDragStart",function(){let s=we(e).$implicit,o=E(2);return Te(o.dragStart(s))})("onDragEnd",function(){we(e);let s=E(2);return Te(s.dragEnd())}),N()}if(t&2){let e=n.$implicit;ti(zt(3,_m)),T("value",e)}}function Sm(t,n){if(t&1&&(O(0,"p-panel"),M(1,Tm,8,1,"ng-template",null,1,et),O(3,"div",10),On(4,Cm,1,4,"p-tag",11,Ln),N()()),t&2){let e=E();S(4),Rn(e.emails)}}function km(t,n){if(t&1){let e=Ze();O(0,"div",16),He(1),bt(2,"translate"),N(),O(3,"div",17)(4,"p-autocomplete",18),fe("onDrop",function(s){we(e);let o=E();return Te(o.drop(s))})("onBlur",function(s){we(e);let o=E();return Te(o.onBlur(s))}),xo("ngModelChange",function(s){let o=we(e).$implicit,r=E();return yo(r.recipients[o],s)||(r.recipients[o]=s),Te(s)}),N()()}if(t&2){let e=n.$implicit,i=E();Pn("field-required",i.mandatoryEmailTypes.includes(e)),S(),Ri(" ",_t(2,6,"email_"+e),"\xA0: "),S(3),T("typeahead",!1)("inputId",e),_o("ngModel",i.recipients[e])}}function Mm(t,n){if(t&1&&K(0,3),t&2){let e=E(),i=Rt(18);T("ngTemplateOutlet",i)("ngTemplateOutletContext",je(3,Ul,e.preview,zt(2,ym)))}}function Dm(t,n){t&1&&(O(0,"div",20)(1,"div",21),He(2,"Message"),N(),O(3,"div",22),zn(4,1,["[select]","position"]),N()())}function Em(t,n){if(t&1&&(O(0,"p-panel"),M(1,Dm,5,0,"ng-template",null,1,et),ue(3,"pre",19),N()),t&2){let e=n.preview;S(3),T("innerHTML",e.trim(),mo)}}var k0=(()=>{class t{constructor(){this.previewPosition="top",this.emailTypes=["to","cc","bcc","reply_to"],this.mandatoryEmailTypes=["to"],this.data=new H,this.closeDialog=new H(!1),this.recipients={to:[],cc:[],bcc:[],reply_to:[]}}set prePopulateRecipients(e){let i=Object.keys(this.recipients);e.forEach(s=>{i.includes(s.type)&&this.recipients[s.type].push(s.address)})}dragStart(e){this.draggedEmail=e}dragEnd(){this.draggedEmail=null}drop(e){if(this.draggedEmail){let i=e.target.id;i&&!this.recipients[i].some(s=>s===this.draggedEmail)&&this.recipients[i].push(this.draggedEmail)}}close(){this.closeDialog.emit(!0)}confirm(){let e=[];Object.keys(this.recipients).forEach(i=>this.recipients[i].every(s=>e.push({type:i,address:s}))),this.data.emit(e)}formValid(){return this.mandatoryEmailTypes.every(e=>this.recipients[e].length>0)?Object.keys(this.recipients).every(e=>this.recipients[e].every(i=>yr.validateEmail(i))):!1}onBlur(e){let i=e.target;i.value&&i?.dispatchEvent(new KeyboardEvent("keydown",{code:"Enter"}))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=Be({type:t,selectors:[["admin-preview-email"]],inputs:{emails:"emails",preview:"preview",previewPosition:"previewPosition",emailTypes:"emailTypes",mandatoryEmailTypes:"mandatoryEmailTypes",prePopulateRecipients:"prePopulateRecipients"},outputs:{data:"data",closeDialog:"closeDialog"},standalone:!1,ngContentSelectors:mm,decls:19,vars:13,consts:[["messagePreview",""],["header",""],[1,"ui:flex","ui:flex-col","ui:gap-2"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["translate",""],[3,"header"],[1,"ui:grid","ui:grid-cols-12","ui:gap-4","ui:mt-2","ui:mb-4","ui:mx-4"],[1,"ui:flex","ui:justify-end","ui:gap-1","ui:mt-2"],["severity","danger","outlined","","aria-label","Close",3,"onClick","label"],[3,"onClick","label","disabled"],[1,"ui:flex","ui:gap-1","ui:mb-4","ui:mx-4"],["pDraggable","emails","icon","fa fa-user",3,"style","value"],[1,"p-panel-title"],[1,"ui:ml-1"],["translate","",1,"ui:italic"],["pDraggable","emails","icon","fa fa-user",3,"onDragStart","onDragEnd","value"],[1,"ui:col-span-2"],[1,"ui:col-span-10"],["multiple","","fluid","","pDroppable","emails",3,"onDrop","onBlur","ngModelChange","typeahead","inputId","ngModel"],[1,"ui:max-h-[25rem]","ui:text-sm","ui:overflow-auto","ui:px-5","ui:mb-4",3,"innerHTML"],[1,"ui:grid","ui:grid-flow-row","ui:auto-rows-max"],["translate","",1,"ui:font-bold"],[1,"ui:italic","ui:text-sm"]],template:function(i,s){if(i&1){let o=Ze();bo(gm),O(0,"div",2),zn(1),M(2,xm,1,6,"ng-container",3),O(3,"h5",4),He(4,"Who do you want to send the message to?"),N(),M(5,Sm,6,0,"p-panel"),O(6,"p-panel",5),bt(7,"translate"),O(8,"div",6),On(9,km,5,8,null,null,Ln),N()(),M(11,Mm,1,6,"ng-container",3),N(),O(12,"div",7)(13,"p-button",8),bt(14,"translate"),fe("onClick",function(){return we(o),Te(s.close())}),N(),O(15,"p-button",9),bt(16,"translate"),fe("onClick",function(){return we(o),Te(s.confirm())}),N()(),M(17,Em,4,1,"ng-template",null,0,et)}i&2&&(S(2),ii(s.previewPosition==="top"?2:-1),S(3),ii(s.emails.length>0?5:-1),S(),T("header",_t(7,7,"Recipients")),S(3),Rn(s.emailTypes),S(2),ii(s.previewPosition==="bottom"?11:-1),S(2),T("label",_t(14,9,"Cancel")),S(2),T("label",_t(16,11,"Confirm"))("disabled",!s.formValid()))},dependencies:[Mo,Do,Uo,jl,Wl,tr,ur,yt,Go,gr,mr],encapsulation:2})}}return t})();var R0=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=Pe({type:t})}static{this.\u0275inj=Ie({imports:[Ai,Kl,_r,br]})}}return t})();var En=function(t){return t.CANCELLED="cancelled",t.ORDERED="ordered",t.PENDING="pending",t.PARTIALLY_RECEIVED="partially_received",t.RECEIVED="received",t}(En||{}),F0={priority:0,status:En.PENDING,notes:[]},Yl=function(t){return t.APPROVED="approved",t.CANCELLED="cancelled",t.ORDERED="ordered",t.PARTIALLY_RECEIVED="partially_received",t.RECEIVED="received",t}(Yl||{}),V0={status:Yl.APPROVED,priority:0,quantity:0,received_quantity:0,amount:0,total_amount:0,notes:[]},Ql=class{constructor(n){this.label=null,this.description=null,this.pid=null,this.active=!1,this.created=null,this.updated=null,Object.assign(this,n),this.active=n.current,this.pid=Bi(n.$ref)}};var H0=(()=>{class t{validate(e,i){return i.status===En.RECEIVED&&(e.create={can:!1,reasons:{others:{order_fully_received:""}}}),e}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=ve({token:t,factory:t.\u0275fac})}}return t})();var ql=class{static processRecipientSuggestions(n){let e={emails:[],recipients:[]};return n.map(i=>{e.emails.push(i.address),i.type&&i.type.map(s=>{e.recipients.push({address:i.address,type:s})})}),e.emails.sort(),e}};var Ve=function(t){return t.AT_DESK="at_desk",t.AVAILABILITY="availability",t.BOOKING="booking",t.DUE_SOON="due_soon",t.OVERDUE="overdue",t.RECALL="recall",t.REQUEST="request",t.TRANSIT_NOTICE="transit_notice",t.ACQUISITION_ORDER="acquisition_order",t.CLAIM_ISSUE="claim_issue",t.AUTO_EXTEND="auto_extend",t}(Ve||{}),Gl=class{static{this.types={patron:[Ve.AVAILABILITY,Ve.DUE_SOON,Ve.OVERDUE,Ve.RECALL,Ve.AUTO_EXTEND],library:[Ve.AT_DESK,Ve.BOOKING,Ve.REQUEST,Ve.TRANSIT_NOTICE]}}constructor(n){this.notification_sent=!1,Object.assign(this,n)}};var Y0=(()=>{class t{constructor(){this.userService=de(Hi)}validate(e,i){if(this.userService.user.currentLibrary!==i){let s={can:!1,reasons:{others:{record_not_in_current_library:""}}};e.create=s,e.delete=s,e.update=s}return e}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=ve({token:t,factory:t.\u0275fac})}}return t})();var Xl=class{constructor(){this.routeToolService=de(vr),this.location=de(So),this.DISABLED=()=>Je({can:!1,message:""})}routeMatcher(n,e){return n[0].path==="records"&&n[1].path===e?this.matchedUrl(n):null}fieldsToRemoved(n,e){return e.forEach(i=>{i in n&&delete n[i]}),n}matchedUrl(n){return{consumed:[new Vi(n[0].path,{}),new Vi(n[1].path,{})],posParams:{type:new Vi(n[1].path,{})}}}removeKey(n,e){if(n instanceof Array&&(n=n.map(i=>this.removeKey(i,e))),n instanceof Object)for(let i of Object.keys(n))i===e?delete n[e]:n[i]=this.removeKey(n[i],e);return n}redirectUrl(n,e){let i="$ref"in n?Bi(n.$ref):n.pid;return Je(`${e}/${i}`)}expertSearchFilter(){return{label:"Expert search",filter:"simple",value:"0",disabledValue:"1",persistent:!0}}canRead(n){let e=this.routeToolService.userService.user.currentOrganisation,i="organisation"in n.metadata?n.metadata.organisation.pid:!1;return Je({can:e===i,message:""})}_expertSearchLink(){let n="help/recherche",e={fr:"help/recherche"},i=Object.keys(e);return this.routeToolService.translateService.currentLang in i?e[this.routeToolService.translateService.currentLang]:n}};var c_=(()=>{class t{constructor(){this.permissionService=de(xr),this.router=de(Ni),this._mandatoryParams=["type","pid"]}canActivate(e){return!("action"in e.data)||!Object.values(Im).includes(e.data.action)||!this._mandatoryParams.every(i=>i in e.params)?(this.router.navigate(["/errors/400"],{skipLocationChange:!0}),Je(!1)):this.permissionService.getPermission(e.params.type,e.params.pid).pipe(Di(i=>i[e.data.action].can?!0:(this.router.navigate(["/errors/403"],{skipLocationChange:!0}),!1)))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=ve({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})(),Im={CREATE:"create",DELETE:"delete",LIST:"list",READ:"read",UPDATE:"update"};var b_=(()=>{class t{constructor(){this.userService=de(Hi),this.router=de(Ni)}canActivate(e){return this.getOwningLibrary$(e).pipe(Di(i=>i!==this.userService.user.currentLibrary?(this.router.navigate(["/errors/403"],{skipLocationChange:!0}),!1):!0),po(()=>this.router.navigate(["/errors/500"],{skipLocationChange:!0})))}getOwningLibrary$(e){return Je(e.queryParams.library)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=ve({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();export{fm as a,Xn as b,ub as c,Sr as d,Kl as e,En as f,F0 as g,Yl as h,V0 as i,Ql as j,H0 as k,Xl as l,c_ as m,Im as n,ql as o,k0 as p,Ve as q,Gl as r,b_ as s,R0 as t,Y0 as u};